From: Cris Di Sclafani Date: Mon, 3 Aug 2020 11:44:17 +0000 (+0200) Subject: Built motion from commit (unavailable).|2.5.0 X-Git-Url: http://repos.xcallymotion.com/?a=commitdiff_plain;h=23b7b8091894e1a3dadcabdec85bd534abefd649;p=motion2.git Built motion from commit (unavailable).|2.5.0 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 3325b40..b91e53c 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -1 +1 @@ -define({ "name": "xCALLY Motion API", "version": "2.5.0", "description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.", "title": "xCALLY MOTION API", "header": { "title": "Introduction", "content": "

The API

\n

This is the documentation for the xCALLY MOTION API.

\n

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

\n

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

\n

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

\n

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

\n
GET /api/users\n
\n

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

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

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

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

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

\n

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

\n

Security and Authentication

\n

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

\n

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

\n

Basic authentication

\n

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

\n

Example:

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

OAuth access token

\n

The xCALLY API supports OAuth authorization flows.

\n

OAuth access tokens also permit client-side API requests.

\n

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

\n

Example:

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

API Key

\n

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

\n

Example:

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

Request Format

\n

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

\n

Response Format

\n

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

\n

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

\n

200 range

\n

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

\n

400 range

\n

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

\n

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

\n

500 range

\n

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

\n

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

\n

Data Types

\n

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

\n

ID integers

\n

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

\n

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

\n

Time stamps

\n

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

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

The API

\n

This is the documentation for the xCALLY MOTION API.

\n

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

\n

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

\n

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

\n

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

\n
GET /api/users\n
\n

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

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

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

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

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

\n

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

\n

Security and Authentication

\n

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

\n

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

\n

Basic authentication

\n

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

\n

Example:

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

OAuth access token

\n

The xCALLY API supports OAuth authorization flows.

\n

OAuth access tokens also permit client-side API requests.

\n

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

\n

Example:

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

API Key

\n

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

\n

Example:

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

Request Format

\n

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

\n

Response Format

\n

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

\n

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

\n

200 range

\n

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

\n

400 range

\n

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

\n

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

\n

500 range

\n

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

\n

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

\n

Data Types

\n

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

\n

ID integers

\n

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

\n

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

\n

Time stamps

\n

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

\n" }, "template": { "withGenerator": false, "withCompare": false, "forceLanguage": "en" }, "sampleUrl": false, "defaultVersion": "0.0.0", "apidoc": "0.3.0", "generator": { "name": "apidoc", "time": "2020-08-03T10:53:38.279Z", "url": "http://apidocjs.com", "version": "0.19.0" } }); diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 02cec89..11105c0 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -1 +1 @@ -{ "name": "xCALLY Motion API", "version": "2.5.0", "description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.", "title": "xCALLY MOTION API", "header": { "title": "Introduction", "content": "

The API

\n

This is the documentation for the xCALLY MOTION API.

\n

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

\n

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

\n

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

\n

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

\n
GET /api/users\n
\n

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

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

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

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

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

\n

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

\n

Security and Authentication

\n

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

\n

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

\n

Basic authentication

\n

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

\n

Example:

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

OAuth access token

\n

The xCALLY API supports OAuth authorization flows.

\n

OAuth access tokens also permit client-side API requests.

\n

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

\n

Example:

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

API Key

\n

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

\n

Example:

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

Request Format

\n

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

\n

Response Format

\n

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

\n

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

\n

200 range

\n

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

\n

400 range

\n

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

\n

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

\n

500 range

\n

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

\n

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

\n

Data Types

\n

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

\n

ID integers

\n

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

\n

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

\n

Time stamps

\n

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

\n" }, "template": { "withGenerator": false, "withCompare": false, "forceLanguage": "en" }, "sampleUrl": false, "defaultVersion": "0.0.0", "apidoc": "0.3.0", "generator": { "name": "apidoc", "time": "2020-07-31T08:59:04.367Z", "url": "http://apidocjs.com", "version": "0.19.0" } } +{ "name": "xCALLY Motion API", "version": "2.5.0", "description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.", "title": "xCALLY MOTION API", "header": { "title": "Introduction", "content": "

The API

\n

This is the documentation for the xCALLY MOTION API.

\n

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

\n

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

\n

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

\n

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

\n
GET /api/users\n
\n

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

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

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

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

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

\n

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

\n

Security and Authentication

\n

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

\n

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

\n

Basic authentication

\n

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

\n

Example:

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

OAuth access token

\n

The xCALLY API supports OAuth authorization flows.

\n

OAuth access tokens also permit client-side API requests.

\n

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

\n

Example:

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

API Key

\n

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

\n

Example:

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

Request Format

\n

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

\n

Response Format

\n

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

\n

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

\n

200 range

\n

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

\n

400 range

\n

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

\n

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

\n

500 range

\n

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

\n

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

\n

Data Types

\n

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

\n

ID integers

\n

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

\n

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

\n

Time stamps

\n

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

\n" }, "template": { "withGenerator": false, "withCompare": false, "forceLanguage": "en" }, "sampleUrl": false, "defaultVersion": "0.0.0", "apidoc": "0.3.0", "generator": { "name": "apidoc", "time": "2020-08-03T10:53:38.279Z", "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 c941ec1..59f3a24 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 _0x1e39=['browser','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','motionbar[NULL,NULL,WinAppArguments]','TEXT','sequelize','VIRTUAL','getDataValue','action','contactManager','integration','urlForward'];(function(_0xbc3542,_0x4de021){var _0x1c88ff=function(_0x1d1fb4){while(--_0x1d1fb4){_0xbc3542['push'](_0xbc3542['shift']());}};_0x1c88ff(++_0x4de021);}(_0x1e39,0x13b));var _0x91e3=function(_0x46361e,_0x243aaf){_0x46361e=_0x46361e-0x0;var _0x14e302=_0x1e39[_0x46361e];return _0x14e302;};'use strict';var Sequelize=require(_0x91e3('0x0'));module['exports']={'name':{'type':Sequelize[_0x91e3('0x1')],'get':function(_0x27f664){return this[_0x91e3('0x2')](_0x91e3('0x3'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x91e3('0x4'),_0x91e3('0x5'),'motionbar','jscripty',_0x91e3('0x6'),_0x91e3('0x7'),'bot','script']],'msg':_0x91e3('0x8')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x91e3('0x9')](0x1000),'comment':_0x91e3('0xa')},'data2':{'type':Sequelize[_0x91e3('0x9')](0x1000),'comment':_0x91e3('0xb')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x91e3('0xc')},'data4':{'type':Sequelize[_0x91e3('0x9')](0x1000)},'data5':{'type':Sequelize[_0x91e3('0x9')](0x1000)},'data6':{'type':Sequelize[_0x91e3('0x9')]},'data7':{'type':Sequelize[_0x91e3('0xd')]}}; \ No newline at end of file +var _0xd614=['motionbar[NULL,NULL,WinAppArguments]','TEXT','sequelize','exports','VIRTUAL','getDataValue','action','STRING','contactManager','integration','jscripty','urlForward','browser','bot','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]'];(function(_0x485b5a,_0x2b289b){var _0xd2b34d=function(_0x34dcbd){while(--_0x34dcbd){_0x485b5a['push'](_0x485b5a['shift']());}};_0xd2b34d(++_0x2b289b);}(_0xd614,0x1d2));var _0x4d61=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xd614[_0x53ccf2];return _0x5a2964;};'use strict';var Sequelize=require(_0x4d61('0x0'));module[_0x4d61('0x1')]={'name':{'type':Sequelize[_0x4d61('0x2')],'get':function(_0x1d725a){return this[_0x4d61('0x3')](_0x4d61('0x4'));}},'action':{'type':Sequelize[_0x4d61('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0x4d61('0x6'),_0x4d61('0x7'),'motionbar',_0x4d61('0x8'),_0x4d61('0x9'),_0x4d61('0xa'),_0x4d61('0xb'),'script']],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x4d61('0xc')},'data1':{'type':Sequelize[_0x4d61('0x5')](0x1000),'comment':'contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]'},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x4d61('0xd')},'data3':{'type':Sequelize[_0x4d61('0x5')](0x1000),'comment':_0x4d61('0xe')},'data4':{'type':Sequelize[_0x4d61('0x5')](0x1000)},'data5':{'type':Sequelize[_0x4d61('0x5')](0x1000)},'data6':{'type':Sequelize[_0x4d61('0x5')]},'data7':{'type':Sequelize[_0x4d61('0xf')]}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 5f5c627..152c1cf 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 _0x1424=['end','json','count','offset','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','Action','find','params','catch','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','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','../../mysqldb','sendStatus','status'];(function(_0x939b34,_0x52dd91){var _0x2a62fd=function(_0x2ae6fb){while(--_0x2ae6fb){_0x939b34['push'](_0x939b34['shift']());}};_0x2a62fd(++_0x52dd91);}(_0x1424,0xf4));var _0x4142=function(_0x561a34,_0x3c02c6){_0x561a34=_0x561a34-0x0;var _0x29bd3f=_0x1424[_0x561a34];return _0x29bd3f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x4142('0x0'));var rimraf=require(_0x4142('0x1'));var zipdir=require(_0x4142('0x2'));var jsonpatch=require(_0x4142('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4142('0x4'));var Mustache=require(_0x4142('0x5'));var util=require('util');var path=require(_0x4142('0x6'));var sox=require(_0x4142('0x7'));var csv=require(_0x4142('0x8'));var ejs=require(_0x4142('0x9'));var fs=require('fs');var _=require(_0x4142('0xa'));var squel=require(_0x4142('0xb'));var crypto=require(_0x4142('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x4142('0xd'));var toCsv=require(_0x4142('0x8'));var querystring=require(_0x4142('0xe'));var Papa=require(_0x4142('0xf'));var Redis=require(_0x4142('0x10'));var authService=require(_0x4142('0x11'));var qs=require(_0x4142('0x12'));var as=require(_0x4142('0x13'));var hardwareService=require(_0x4142('0x14'));var logger=require(_0x4142('0x15'))(_0x4142('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x4142('0x17'))['db'];function respondWithStatusCode(_0xbc1a23,_0x5d9dc2){_0x5d9dc2=_0x5d9dc2||0xcc;return function(_0x1cccd4){if(_0x1cccd4){return _0xbc1a23[_0x4142('0x18')](_0x5d9dc2);}return _0xbc1a23[_0x4142('0x19')](_0x5d9dc2)[_0x4142('0x1a')]();};}function respondWithResult(_0x5ae5cd,_0x11efd3){_0x11efd3=_0x11efd3||0xc8;return function(_0x3659cd){if(_0x3659cd){return _0x5ae5cd[_0x4142('0x19')](_0x11efd3)[_0x4142('0x1b')](_0x3659cd);}};}function respondWithFilteredResult(_0x4670b8,_0x8417e4){return function(_0xdaddab){if(_0xdaddab){var _0x563174=_0xdaddab[_0x4142('0x1c')],_0x391276=_0x8417e4[_0x4142('0x1d')],_0x128edb=_0x8417e4['offset']+_0x8417e4['limit'],_0x4e3629;if(_0x128edb>=_0x563174){_0x128edb=_0x563174;_0x4e3629=0xc8;}else{_0x4e3629=0xce;}_0x4670b8['status'](_0x4e3629);return _0x4670b8[_0x4142('0x1e')](_0x4142('0x1f'),_0x391276+'-'+_0x128edb+'/'+_0x563174)[_0x4142('0x1b')](_0xdaddab);}return null;};}function patchUpdates(_0xb16b36){return function(_0x48fcd9){try{jsonpatch[_0x4142('0x20')](_0x48fcd9,_0xb16b36,!![]);}catch(_0x50e128){return BPromise['reject'](_0x50e128);}return _0x48fcd9[_0x4142('0x21')]();};}function saveUpdates(_0x3a935f,_0x325ed0){return function(_0x1a08da){if(_0x1a08da){return _0x1a08da[_0x4142('0x22')](_0x3a935f)[_0x4142('0x23')](function(_0x1d6d97){return _0x1d6d97;});}return null;};}function removeEntity(_0x2ef67b,_0x552670){return function(_0x4bd4d0){if(_0x4bd4d0){return _0x4bd4d0[_0x4142('0x24')]()[_0x4142('0x23')](function(){_0x2ef67b[_0x4142('0x19')](0xcc)[_0x4142('0x1a')]();});}};}function handleEntityNotFound(_0x3a7e6d,_0x344e70){return function(_0x1aa020){if(!_0x1aa020){_0x3a7e6d['sendStatus'](0x194);}return _0x1aa020;};}function handleError(_0x54fd86,_0x117c53){_0x117c53=_0x117c53||0x1f4;return function(_0x34619d){logger[_0x4142('0x25')](_0x34619d[_0x4142('0x26')]);if(_0x34619d[_0x4142('0x27')]){delete _0x34619d[_0x4142('0x27')];}_0x54fd86[_0x4142('0x19')](_0x117c53)[_0x4142('0x28')](_0x34619d);};}exports[_0x4142('0x22')]=function(_0xa6b388,_0x2bfdba){if(_0xa6b388['body']['id']){delete _0xa6b388['body']['id'];}return db[_0x4142('0x29')][_0x4142('0x2a')]({'where':{'id':_0xa6b388[_0x4142('0x2b')]['id']}})[_0x4142('0x23')](handleEntityNotFound(_0x2bfdba,null))[_0x4142('0x23')](saveUpdates(_0xa6b388['body'],null))[_0x4142('0x23')](respondWithResult(_0x2bfdba,null))[_0x4142('0x2c')](handleError(_0x2bfdba,null));};exports['destroy']=function(_0x147987,_0x1c6beb){return db[_0x4142('0x29')][_0x4142('0x2a')]({'where':{'id':_0x147987[_0x4142('0x2b')]['id']}})[_0x4142('0x23')](handleEntityNotFound(_0x1c6beb,null))[_0x4142('0x23')](removeEntity(_0x1c6beb,null))[_0x4142('0x2c')](handleError(_0x1c6beb,null));}; \ No newline at end of file +var _0xa3c9=['set','Content-Range','apply','reject','destroy','then','end','error','stack','name','send','update','body','params','Action','find','catch','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset'];(function(_0x15f4f1,_0x5bd6f8){var _0x3deadb=function(_0x403cb2){while(--_0x403cb2){_0x15f4f1['push'](_0x15f4f1['shift']());}};_0x3deadb(++_0x5bd6f8);}(_0xa3c9,0x1df));var _0x9a3c=function(_0x483e3a,_0x568361){_0x483e3a=_0x483e3a-0x0;var _0x43fca9=_0xa3c9[_0x483e3a];return _0x43fca9;};'use strict';var pdf=require(_0x9a3c('0x0'));var emlformat=require(_0x9a3c('0x1'));var rimraf=require(_0x9a3c('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9a3c('0x3'));var rp=require(_0x9a3c('0x4'));var moment=require(_0x9a3c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9a3c('0x6'));var util=require(_0x9a3c('0x7'));var path=require(_0x9a3c('0x8'));var sox=require('sox');var csv=require(_0x9a3c('0x9'));var ejs=require(_0x9a3c('0xa'));var fs=require('fs');var _=require(_0x9a3c('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9a3c('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9a3c('0xd'));var Redis=require('ioredis');var authService=require(_0x9a3c('0xe'));var qs=require(_0x9a3c('0xf'));var as=require(_0x9a3c('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9a3c('0x11'));var utils=require(_0x9a3c('0x12'));var config=require('../../config/environment');var db=require(_0x9a3c('0x13'))['db'];function respondWithStatusCode(_0x3a7685,_0x3837e5){_0x3837e5=_0x3837e5||0xcc;return function(_0x4436d4){if(_0x4436d4){return _0x3a7685[_0x9a3c('0x14')](_0x3837e5);}return _0x3a7685[_0x9a3c('0x15')](_0x3837e5)['end']();};}function respondWithResult(_0x4aac98,_0x59e253){_0x59e253=_0x59e253||0xc8;return function(_0xd31c32){if(_0xd31c32){return _0x4aac98['status'](_0x59e253)[_0x9a3c('0x16')](_0xd31c32);}};}function respondWithFilteredResult(_0x422c25,_0x52bc74){return function(_0x20714a){if(_0x20714a){var _0x8f0fcb=_0x20714a[_0x9a3c('0x17')],_0x296b27=_0x52bc74['offset'],_0x4ae397=_0x52bc74[_0x9a3c('0x18')]+_0x52bc74['limit'],_0x47b03a;if(_0x4ae397>=_0x8f0fcb){_0x4ae397=_0x8f0fcb;_0x47b03a=0xc8;}else{_0x47b03a=0xce;}_0x422c25['status'](_0x47b03a);return _0x422c25[_0x9a3c('0x19')](_0x9a3c('0x1a'),_0x296b27+'-'+_0x4ae397+'/'+_0x8f0fcb)[_0x9a3c('0x16')](_0x20714a);}return null;};}function patchUpdates(_0x507835){return function(_0x180a9a){try{jsonpatch[_0x9a3c('0x1b')](_0x180a9a,_0x507835,!![]);}catch(_0x36cc29){return BPromise[_0x9a3c('0x1c')](_0x36cc29);}return _0x180a9a['save']();};}function saveUpdates(_0x317540,_0x293079){return function(_0x3106c7){if(_0x3106c7){return _0x3106c7['update'](_0x317540)['then'](function(_0x2c17b7){return _0x2c17b7;});}return null;};}function removeEntity(_0x248622,_0x6bfdf1){return function(_0x29aa15){if(_0x29aa15){return _0x29aa15[_0x9a3c('0x1d')]()[_0x9a3c('0x1e')](function(){_0x248622[_0x9a3c('0x15')](0xcc)[_0x9a3c('0x1f')]();});}};}function handleEntityNotFound(_0xa60e16,_0x1de75c){return function(_0x3a91d2){if(!_0x3a91d2){_0xa60e16[_0x9a3c('0x14')](0x194);}return _0x3a91d2;};}function handleError(_0x394c57,_0x3fef91){_0x3fef91=_0x3fef91||0x1f4;return function(_0x5ca1dd){logger[_0x9a3c('0x20')](_0x5ca1dd[_0x9a3c('0x21')]);if(_0x5ca1dd[_0x9a3c('0x22')]){delete _0x5ca1dd[_0x9a3c('0x22')];}_0x394c57[_0x9a3c('0x15')](_0x3fef91)[_0x9a3c('0x23')](_0x5ca1dd);};}exports[_0x9a3c('0x24')]=function(_0x5e517e,_0x537e29){if(_0x5e517e[_0x9a3c('0x25')]['id']){delete _0x5e517e['body']['id'];}return db['Action']['find']({'where':{'id':_0x5e517e[_0x9a3c('0x26')]['id']}})[_0x9a3c('0x1e')](handleEntityNotFound(_0x537e29,null))[_0x9a3c('0x1e')](saveUpdates(_0x5e517e[_0x9a3c('0x25')],null))['then'](respondWithResult(_0x537e29,null))['catch'](handleError(_0x537e29,null));};exports[_0x9a3c('0x1d')]=function(_0x2b95b0,_0xab61c5){return db[_0x9a3c('0x27')][_0x9a3c('0x28')]({'where':{'id':_0x2b95b0[_0x9a3c('0x26')]['id']}})[_0x9a3c('0x1e')](handleEntityNotFound(_0xab61c5,null))[_0x9a3c('0x1e')](removeEntity(_0xab61c5,null))[_0x9a3c('0x29')](handleError(_0xab61c5,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 8778fa6..f1f681e 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 _0x08ca=['moment','bluebird','../../config/environment','./action.attributes','exports','Action','lodash','util','../../config/logger'];(function(_0x48afdb,_0x51bfdd){var _0x2946b8=function(_0x5a0720){while(--_0x5a0720){_0x48afdb['push'](_0x48afdb['shift']());}};_0x2946b8(++_0x51bfdd);}(_0x08ca,0x16e));var _0xa08c=function(_0x21048b,_0x42cc37){_0x21048b=_0x21048b-0x0;var _0x3d9a39=_0x08ca[_0x21048b];return _0x3d9a39;};'use strict';var _=require(_0xa08c('0x0'));var util=require(_0xa08c('0x1'));var logger=require(_0xa08c('0x2'))('api');var moment=require(_0xa08c('0x3'));var BPromise=require(_0xa08c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa08c('0x5'));var attributes=require(_0xa08c('0x6'));module[_0xa08c('0x7')]=function(_0x6b4b98,_0x3284f5){return _0x6b4b98['define'](_0xa08c('0x8'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x39c0=['exports','tools_actions','lodash','../../config/logger','api','request-promise','path','rimraf','../../config/environment'];(function(_0xaea4f9,_0x591b52){var _0x5dc8c9=function(_0x2c32c9){while(--_0x2c32c9){_0xaea4f9['push'](_0xaea4f9['shift']());}};_0x5dc8c9(++_0x591b52);}(_0x39c0,0x89));var _0x039c=function(_0x3df585,_0x3d3ff){_0x3df585=_0x3df585-0x0;var _0x19a71d=_0x39c0[_0x3df585];return _0x19a71d;};'use strict';var _=require(_0x039c('0x0'));var util=require('util');var logger=require(_0x039c('0x1'))(_0x039c('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x039c('0x3'));var fs=require('fs');var path=require(_0x039c('0x4'));var rimraf=require(_0x039c('0x5'));var config=require(_0x039c('0x6'));var attributes=require('./action.attributes');module[_0x039c('0x7')]=function(_0x816ff5,_0x466a88){return _0x816ff5['define']('Action',attributes,{'tableName':_0x039c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js index ace7ba9..0337245 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 _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s'];(function(_0x4d06d3,_0x4fbd90){var _0x3bb95b=function(_0x1f9970){while(--_0x1f9970){_0x4d06d3['push'](_0x4d06d3['shift']());}};_0x3bb95b(++_0x4fbd90);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x38ce4c,_0xfdbe8c){_0x38ce4c=_0x38ce4c-0x0;var _0x5d4544=_0xcb91[_0x38ce4c];return _0x5d4544;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('Action,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});} \ No newline at end of file +var _0x0713=['Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x21db42,_0x2d2951){var _0x4d6ca3=function(_0x59e8a1){while(--_0x59e8a1){_0x21db42['push'](_0x21db42['shift']());}};_0x4d6ca3(++_0x2d2951);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('Action,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('Action,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('Action,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index d46059a..414484e 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 _0x00f1=['../../config/environment','put','/:id','isAuthenticated','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x411978,_0x3d4377){var _0x11c799=function(_0x19713b){while(--_0x19713b){_0x411978['push'](_0x411978['shift']());}};_0x11c799(++_0x3d4377);}(_0x00f1,0xcb));var _0x100f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x00f1[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x100f('0x0'));var util=require(_0x100f('0x1'));var path=require(_0x100f('0x2'));var timeout=require(_0x100f('0x3'));var express=require(_0x100f('0x4'));var router=express[_0x100f('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x100f('0x6'));var config=require(_0x100f('0x7'));var controller=require('./action.controller');router[_0x100f('0x8')](_0x100f('0x9'),auth[_0x100f('0xa')](),controller[_0x100f('0xb')]);router[_0x100f('0xc')]('/:id',auth[_0x100f('0xa')](),controller['destroy']);module[_0x100f('0xd')]=router; \ No newline at end of file +var _0x8d85=['update','delete','destroy','exports','multer','path','express','Router','../../components/interaction/service','put','/:id','isAuthenticated'];(function(_0x32d27a,_0x363953){var _0x5ce5ef=function(_0x5bde21){while(--_0x5bde21){_0x32d27a['push'](_0x32d27a['shift']());}};_0x5ce5ef(++_0x363953);}(_0x8d85,0x1cc));var _0x58d8=function(_0xee75ea,_0x3c6c3a){_0xee75ea=_0xee75ea-0x0;var _0x1367f7=_0x8d85[_0xee75ea];return _0x1367f7;};'use strict';var multer=require(_0x58d8('0x0'));var util=require('util');var path=require(_0x58d8('0x1'));var timeout=require('connect-timeout');var express=require(_0x58d8('0x2'));var router=express[_0x58d8('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x58d8('0x4'));var config=require('../../config/environment');var controller=require('./action.controller');router[_0x58d8('0x5')](_0x58d8('0x6'),auth[_0x58d8('0x7')](),controller[_0x58d8('0x8')]);router[_0x58d8('0x9')]('/:id',auth[_0x58d8('0x7')](),controller[_0x58d8('0xa')]);module[_0x58d8('0xb')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 230f2ed..bf191f8 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 _0xdf8d=['exports','STRING','sequelize'];(function(_0x141ae5,_0x54c911){var _0x163f94=function(_0x10190b){while(--_0x10190b){_0x141ae5['push'](_0x141ae5['shift']());}};_0x163f94(++_0x54c911);}(_0xdf8d,0x83));var _0xddf8=function(_0x3c22e0,_0x1dc6ea){_0x3c22e0=_0x3c22e0-0x0;var _0x215811=_0xdf8d[_0x3c22e0];return _0x215811;};'use strict';var Sequelize=require(_0xddf8('0x0'));module[_0xddf8('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0xddf8('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xde98=['sequelize','exports','STRING','TEXT'];(function(_0x43127f,_0x1dc927){var _0x10a378=function(_0x492615){while(--_0x492615){_0x43127f['push'](_0x43127f['shift']());}};_0x10a378(++_0x1dc927);}(_0xde98,0x148));var _0x8de9=function(_0x55015a,_0x4bda6f){_0x55015a=_0x55015a-0x0;var _0x1082c2=_0xde98[_0x55015a];return _0x1082c2;};'use strict';var Sequelize=require(_0x8de9('0x0'));module[_0x8de9('0x1')]={'name':{'type':Sequelize[_0x8de9('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x8de9('0x2')]},'parent':{'type':Sequelize[_0x8de9('0x2')]},'table':{'type':Sequelize[_0x8de9('0x2')]},'conditions':{'type':Sequelize[_0x8de9('0x3')]},'joins':{'type':Sequelize[_0x8de9('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 6546790..4e9d964 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 _0xaa48=['csv','custom','AnalyticExtractedReport','cdr','startDate','endDate','info','Run\x20Query:','child_process','../../components/export/','../../files/reports','countTable','COUNT(*)','SELECT','run','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','IS\x20NULL','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','Content-Range','reject','update','then','destroy','UserProfileResource','end','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','length','attributes','order','sort','where','pick','filter','options','count','includeAll','include','AnalyticCustomReport','findAll','rows','catch','show','params','keys','merge','find','create','user','get','UserProfileSection','CustomReports','body','preview','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','MetricId','metric','function','replace','format','orderBy','DESC','alias','joins','parse','includes','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','clone','debug','toString','sequelize','QueryTypes','join','right_join','COUNT(%s)','MAX(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','DATE(%s)','IS\x20NOT\x20EMPTY','operator','groupBy','Limited\x20Query:','No\x20available\x20data','output','web','fullPath','%s-%s.%s','randomstring','generate'];(function(_0x58adb6,_0x3001d8){var _0x436e13=function(_0x1095dd){while(--_0x1095dd){_0x58adb6['push'](_0x58adb6['shift']());}};_0x436e13(++_0x3001d8);}(_0xaa48,0x15a));var _0x8aa4=function(_0x5b6b18,_0x22464e){_0x5b6b18=_0x5b6b18-0x0;var _0x19d8e1=_0xaa48[_0x5b6b18];return _0x19d8e1;};'use strict';var pdf=require(_0x8aa4('0x0'));var emlformat=require(_0x8aa4('0x1'));var rimraf=require(_0x8aa4('0x2'));var zipdir=require(_0x8aa4('0x3'));var jsonpatch=require(_0x8aa4('0x4'));var rp=require(_0x8aa4('0x5'));var moment=require(_0x8aa4('0x6'));var BPromise=require(_0x8aa4('0x7'));var Mustache=require(_0x8aa4('0x8'));var util=require(_0x8aa4('0x9'));var path=require(_0x8aa4('0xa'));var sox=require(_0x8aa4('0xb'));var csv=require(_0x8aa4('0xc'));var ejs=require(_0x8aa4('0xd'));var fs=require('fs');var _=require(_0x8aa4('0xe'));var squel=require(_0x8aa4('0xf'));var crypto=require(_0x8aa4('0x10'));var jsforce=require(_0x8aa4('0x11'));var deskjs=require(_0x8aa4('0x12'));var toCsv=require('to-csv');var querystring=require(_0x8aa4('0x13'));var Papa=require(_0x8aa4('0x14'));var Redis=require('ioredis');var authService=require(_0x8aa4('0x15'));var qs=require(_0x8aa4('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8aa4('0x17'));var logger=require(_0x8aa4('0x18'))(_0x8aa4('0x19'));var utils=require(_0x8aa4('0x1a'));var config=require(_0x8aa4('0x1b'));var db=require(_0x8aa4('0x1c'))['db'];function respondWithStatusCode(_0x824014,_0x3dc274){_0x3dc274=_0x3dc274||0xcc;return function(_0x1dc057){if(_0x1dc057){return _0x824014[_0x8aa4('0x1d')](_0x3dc274);}return _0x824014['status'](_0x3dc274)['end']();};}function respondWithResult(_0x3143f7,_0x455a80){_0x455a80=_0x455a80||0xc8;return function(_0xb8ce80){if(_0xb8ce80){return _0x3143f7[_0x8aa4('0x1e')](_0x455a80)[_0x8aa4('0x1f')](_0xb8ce80);}};}function respondWithFilteredResult(_0x406f0e,_0x2b3f62){return function(_0x356df1){if(_0x356df1){var _0x1ae822=_0x356df1['count'],_0xce8df5=_0x2b3f62[_0x8aa4('0x20')],_0x5cca31=_0x2b3f62[_0x8aa4('0x20')]+_0x2b3f62[_0x8aa4('0x21')],_0x5abc5a;if(_0x5cca31>=_0x1ae822){_0x5cca31=_0x1ae822;_0x5abc5a=0xc8;}else{_0x5abc5a=0xce;}_0x406f0e[_0x8aa4('0x1e')](_0x5abc5a);return _0x406f0e['set'](_0x8aa4('0x22'),_0xce8df5+'-'+_0x5cca31+'/'+_0x1ae822)[_0x8aa4('0x1f')](_0x356df1);}return null;};}function patchUpdates(_0x59d3a2){return function(_0x3d6353){try{jsonpatch['apply'](_0x3d6353,_0x59d3a2,!![]);}catch(_0x5e8a77){return BPromise[_0x8aa4('0x23')](_0x5e8a77);}return _0x3d6353['save']();};}function saveUpdates(_0x324d59,_0x2df294){return function(_0x521b69){if(_0x521b69){return _0x521b69[_0x8aa4('0x24')](_0x324d59)[_0x8aa4('0x25')](function(_0x4c45c9){return _0x4c45c9;});}return null;};}function removeEntity(_0x1a514e,_0x2859d1){return function(_0x1c8676){if(_0x1c8676){return _0x1c8676[_0x8aa4('0x26')]()[_0x8aa4('0x25')](function(){var _0x4ecaec=_0x1c8676['get']({'plain':!![]});var _0x4c429f='CustomReports';return db[_0x8aa4('0x27')]['destroy']({'where':{'type':_0x4c429f,'resourceId':_0x4ecaec['id']}})[_0x8aa4('0x25')](function(){return _0x1c8676;});})[_0x8aa4('0x25')](function(){_0x1a514e[_0x8aa4('0x1e')](0xcc)[_0x8aa4('0x28')]();});}};}function handleEntityNotFound(_0x5b8165,_0x513cb9){return function(_0x30f7d1){if(!_0x30f7d1){_0x5b8165['sendStatus'](0x194);}return _0x30f7d1;};}function handleError(_0x286601,_0x4145ed){_0x4145ed=_0x4145ed||0x1f4;return function(_0x556f5c){logger[_0x8aa4('0x29')](_0x556f5c['stack']);if(_0x556f5c[_0x8aa4('0x2a')]){delete _0x556f5c['name'];}_0x286601[_0x8aa4('0x1e')](_0x4145ed)[_0x8aa4('0x2b')](_0x556f5c);};}exports[_0x8aa4('0x2c')]=function(_0xf88a0e,_0x169ca3){var _0x4ba8b8={},_0x5d4894={},_0x5f1028={'count':0x0,'rows':[]};var _0x2aec56=_[_0x8aa4('0x2d')](db['AnalyticCustomReport'][_0x8aa4('0x2e')],function(_0x1f452e){return{'name':_0x1f452e[_0x8aa4('0x2f')],'type':_0x1f452e[_0x8aa4('0x30')][_0x8aa4('0x31')]};});_0x5d4894[_0x8aa4('0x32')]=_['map'](_0x2aec56,_0x8aa4('0x2a'));_0x5d4894['query']=_['keys'](_0xf88a0e[_0x8aa4('0x33')]);_0x5d4894[_0x8aa4('0x34')]=_[_0x8aa4('0x35')](_0x5d4894[_0x8aa4('0x32')],_0x5d4894[_0x8aa4('0x33')]);_0x4ba8b8['attributes']=_[_0x8aa4('0x35')](_0x5d4894[_0x8aa4('0x32')],qs[_0x8aa4('0x36')](_0xf88a0e['query']['fields']));_0x4ba8b8['attributes']=_0x4ba8b8['attributes'][_0x8aa4('0x37')]?_0x4ba8b8[_0x8aa4('0x38')]:_0x5d4894[_0x8aa4('0x32')];if(!_0xf88a0e[_0x8aa4('0x33')]['hasOwnProperty']('nolimit')){_0x4ba8b8[_0x8aa4('0x21')]=qs[_0x8aa4('0x21')](_0xf88a0e[_0x8aa4('0x33')][_0x8aa4('0x21')]);_0x4ba8b8[_0x8aa4('0x20')]=qs['offset'](_0xf88a0e['query'][_0x8aa4('0x20')]);}_0x4ba8b8[_0x8aa4('0x39')]=qs[_0x8aa4('0x3a')](_0xf88a0e['query'][_0x8aa4('0x3a')]);_0x4ba8b8[_0x8aa4('0x3b')]=qs['filters'](_[_0x8aa4('0x3c')](_0xf88a0e[_0x8aa4('0x33')],_0x5d4894[_0x8aa4('0x34')]));if(_0xf88a0e['query'][_0x8aa4('0x3d')]){_0x4ba8b8['where']=_['merge'](_0x4ba8b8[_0x8aa4('0x3b')],{'$or':_['map'](_0x2aec56,function(_0x36b960){if(_0x36b960[_0x8aa4('0x30')]!=='VIRTUAL'){var _0x230b7b={};_0x230b7b[_0x36b960[_0x8aa4('0x2a')]]={'$like':'%'+_0xf88a0e[_0x8aa4('0x33')][_0x8aa4('0x3d')]+'%'};return _0x230b7b;}})});}_0x4ba8b8=_['merge']({},_0x4ba8b8,_0xf88a0e[_0x8aa4('0x3e')]);var _0xca05c8={'where':_0x4ba8b8[_0x8aa4('0x3b')]};return db['AnalyticCustomReport'][_0x8aa4('0x3f')](_0xca05c8)[_0x8aa4('0x25')](function(_0x5013a2){_0x5f1028[_0x8aa4('0x3f')]=_0x5013a2;if(_0xf88a0e['query'][_0x8aa4('0x40')]){_0x4ba8b8[_0x8aa4('0x41')]=[{'all':!![]}];}return db[_0x8aa4('0x42')][_0x8aa4('0x43')](_0x4ba8b8);})[_0x8aa4('0x25')](function(_0x424100){_0x5f1028[_0x8aa4('0x44')]=_0x424100;return _0x5f1028;})[_0x8aa4('0x25')](respondWithFilteredResult(_0x169ca3,_0x4ba8b8))[_0x8aa4('0x45')](handleError(_0x169ca3,null));};exports[_0x8aa4('0x46')]=function(_0x87d3e,_0x228e64){var _0x234325={'raw':![],'where':{'id':_0x87d3e[_0x8aa4('0x47')]['id']}},_0x521ebe={};_0x521ebe[_0x8aa4('0x32')]=_[_0x8aa4('0x48')](db[_0x8aa4('0x42')][_0x8aa4('0x2e')]);_0x521ebe[_0x8aa4('0x33')]=_[_0x8aa4('0x48')](_0x87d3e['query']);_0x521ebe[_0x8aa4('0x34')]=_[_0x8aa4('0x35')](_0x521ebe[_0x8aa4('0x32')],_0x521ebe['query']);_0x234325['attributes']=_['intersection'](_0x521ebe[_0x8aa4('0x32')],qs['fields'](_0x87d3e[_0x8aa4('0x33')][_0x8aa4('0x36')]));_0x234325[_0x8aa4('0x38')]=_0x234325[_0x8aa4('0x38')][_0x8aa4('0x37')]?_0x234325[_0x8aa4('0x38')]:_0x521ebe[_0x8aa4('0x32')];if(_0x87d3e['query'][_0x8aa4('0x40')]){_0x234325[_0x8aa4('0x41')]=[{'all':!![]}];}_0x234325=_[_0x8aa4('0x49')]({},_0x234325,_0x87d3e[_0x8aa4('0x3e')]);return db[_0x8aa4('0x42')][_0x8aa4('0x4a')](_0x234325)['then'](handleEntityNotFound(_0x228e64,null))[_0x8aa4('0x25')](respondWithResult(_0x228e64,null))[_0x8aa4('0x45')](handleError(_0x228e64,null));};exports['create']=function(_0x436ad7,_0x50eed7){return db[_0x8aa4('0x42')][_0x8aa4('0x4b')](_0x436ad7['body'],{})[_0x8aa4('0x25')](function(_0x370725){var _0x4d193b=_0x436ad7[_0x8aa4('0x4c')][_0x8aa4('0x4d')]({'plain':!![]});if(!_0x4d193b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4d193b['role']===_0x8aa4('0x4c')){var _0x2c7958=_0x370725[_0x8aa4('0x4d')]({'plain':!![]});var _0x3fcc7a='Reports';return db[_0x8aa4('0x4e')]['find']({'where':{'name':_0x3fcc7a,'userProfileId':_0x4d193b['userProfileId']},'raw':!![]})[_0x8aa4('0x25')](function(_0x25fd01){if(_0x25fd01&&_0x25fd01['autoAssociation']===0x0){return db[_0x8aa4('0x27')][_0x8aa4('0x4b')]({'name':_0x2c7958['name'],'resourceId':_0x2c7958['id'],'type':_0x8aa4('0x4f'),'sectionId':_0x25fd01['id']},{})[_0x8aa4('0x25')](function(){return _0x370725;});}else{return _0x370725;}})[_0x8aa4('0x45')](function(_0x221685){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x221685);throw _0x221685;});}return _0x370725;})[_0x8aa4('0x25')](respondWithResult(_0x50eed7,0xc9))[_0x8aa4('0x45')](handleError(_0x50eed7,null));};exports[_0x8aa4('0x24')]=function(_0x3aff5e,_0x19e3ae){if(_0x3aff5e[_0x8aa4('0x50')]['id']){delete _0x3aff5e[_0x8aa4('0x50')]['id'];}return db[_0x8aa4('0x42')][_0x8aa4('0x4a')]({'where':{'id':_0x3aff5e['params']['id']}})[_0x8aa4('0x25')](handleEntityNotFound(_0x19e3ae,null))[_0x8aa4('0x25')](saveUpdates(_0x3aff5e[_0x8aa4('0x50')],null))['then'](respondWithResult(_0x19e3ae,null))[_0x8aa4('0x45')](handleError(_0x19e3ae,null));};exports[_0x8aa4('0x26')]=function(_0xa021a5,_0x5b0f26){return db['AnalyticCustomReport'][_0x8aa4('0x4a')]({'where':{'id':_0xa021a5[_0x8aa4('0x47')]['id']}})['then'](handleEntityNotFound(_0x5b0f26,null))[_0x8aa4('0x25')](removeEntity(_0x5b0f26,null))[_0x8aa4('0x45')](handleError(_0x5b0f26,null));};exports[_0x8aa4('0x51')]=function(_0x17241a,_0x5d3f01){var _0x3cae59=0xa;var _0x12b2b1=['join','left_join','right_join',_0x8aa4('0x52')];var _0x33d63b={'SUM':_0x8aa4('0x53'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x8aa4('0x54'),'MAX':'MAX(%s)','MIN':_0x8aa4('0x55'),'AVG':_0x8aa4('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x41d996={'SEC_TO_TIME':_0x8aa4('0x57'),'DATE':'DATE(%s)','HOUR':_0x8aa4('0x58'),'ROUND':_0x8aa4('0x59'),'UNIX_TIMESTAMP':_0x8aa4('0x5a')};var _0x5e8127=function(_0x8f1194){return!_['includes'](['IS\x20NULL',_0x8aa4('0x5b'),_0x8aa4('0x5c'),'IS\x20NOT\x20EMPTY'],_0x8f1194);};var _0x509b18=function(_0x129c79){if(!_0x129c79||!_0x129c79[_0x8aa4('0x5d')]['length']){return'';}for(var _0x36cd33='(',_0x4571e6=0x0;_0x4571e6<_0x129c79[_0x8aa4('0x5d')][_0x8aa4('0x37')];_0x4571e6+=0x1){_0x4571e6>0x0&&(_0x36cd33+='\x20'+_0x129c79['operator']+'\x20');_0x36cd33+=_0x129c79['rules'][_0x4571e6][_0x8aa4('0x5e')]?_0x509b18(_0x129c79[_0x8aa4('0x5d')][_0x4571e6][_0x8aa4('0x5e')]):_0x129c79[_0x8aa4('0x5d')][_0x4571e6][_0x8aa4('0x5f')]+'\x20'+_0x129c79[_0x8aa4('0x5d')][_0x4571e6][_0x8aa4('0x60')]+(_0x5e8127(_0x129c79['rules'][_0x4571e6][_0x8aa4('0x60')])?'\x20'+_0x129c79[_0x8aa4('0x5d')][_0x4571e6][_0x8aa4('0x61')]:'');}return _0x36cd33+')';};var _0x3ccc30={'where':{'id':_0x17241a['params']['id']}},_0x19458c,_0x304487,_0x1d2cff,_0x5f1d6c,_0x3915a5;_0x3ccc30=_[_0x8aa4('0x49')]({},_0x3ccc30,_0x17241a[_0x8aa4('0x3e')]);return db[_0x8aa4('0x42')][_0x8aa4('0x4a')](_0x3ccc30)[_0x8aa4('0x25')](function(_0x290f1d){if(_0x290f1d){_0x19458c=_0x290f1d;return _0x290f1d[_0x8aa4('0x62')]();}return null;})[_0x8aa4('0x25')](function(_0xee41db){if(_0xee41db){if(!_0xee41db[_0x8aa4('0x37')]){throw new db[(_0x8aa4('0x63'))][(_0x8aa4('0x64'))](_0x8aa4('0x65'),0x193);}_0x304487=_0xee41db;return db[_0x8aa4('0x66')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x64ffa){if(_0x64ffa){_0x1d2cff=_[_0x8aa4('0x67')](_0x64ffa,'id');var _0x3db063;var _0x2e0a5f=squel[_0x8aa4('0x68')]();_0x2e0a5f[_0x8aa4('0x69')](_0x19458c['table']);for(var _0x47fa80=0x0;_0x47fa80<_0x304487[_0x8aa4('0x37')];_0x47fa80+=0x1){_0x3db063=_0x304487[_0x47fa80][_0x8aa4('0x6a')]?_0x1d2cff[_0x304487[_0x47fa80][_0x8aa4('0x6a')]][_0x8aa4('0x6b')]:_0x304487[_0x47fa80][_0x8aa4('0x5f')];_0x3db063=_0x304487[_0x47fa80][_0x8aa4('0x6c')]?_[_0x8aa4('0x6d')](_0x33d63b[_0x304487[_0x47fa80][_0x8aa4('0x6c')]],'%s',_0x3db063):_0x3db063;_0x3db063=_0x304487[_0x47fa80][_0x8aa4('0x6e')]?_[_0x8aa4('0x6d')](_0x41d996[_0x304487[_0x47fa80][_0x8aa4('0x6e')]],'%s',_0x3db063):_0x3db063;if(_0x304487[_0x47fa80]['groupBy']){_0x2e0a5f['group'](_0x3db063);}_0x304487[_0x47fa80][_0x8aa4('0x6f')]&&_0x2e0a5f[_0x8aa4('0x39')](_0x3db063,_0x304487[_0x47fa80][_0x8aa4('0x6f')]===_0x8aa4('0x70')?![]:!![]);_0x2e0a5f['field'](_0x3db063,_0x304487[_0x47fa80][_0x8aa4('0x71')]||_0x3db063);}if(_0x19458c[_0x8aa4('0x72')]){_0x19458c['joins']=JSON[_0x8aa4('0x73')](_0x19458c[_0x8aa4('0x72')]);for(var _0x3efebd=0x0;_0x3efebd<_0x19458c[_0x8aa4('0x72')]['length'];_0x3efebd+=0x1){if(_0x19458c[_0x8aa4('0x72')][_0x3efebd]['type']&&_[_0x8aa4('0x74')](_0x12b2b1,_0x19458c[_0x8aa4('0x72')][_0x3efebd]['type'])&&_0x19458c['joins'][_0x3efebd][_0x8aa4('0x75')]&&_0x19458c[_0x8aa4('0x72')][_0x3efebd][_0x8aa4('0x76')]&&_0x19458c[_0x8aa4('0x72')][_0x3efebd][_0x8aa4('0x77')]){_0x2e0a5f[_0x19458c['joins'][_0x3efebd][_0x8aa4('0x30')]](_0x19458c[_0x8aa4('0x72')][_0x3efebd]['foreignTable'],null,util[_0x8aa4('0x6e')](_0x8aa4('0x78'),_0x19458c[_0x8aa4('0x79')],_0x19458c[_0x8aa4('0x72')][_0x3efebd][_0x8aa4('0x75')],_0x19458c[_0x8aa4('0x72')][_0x3efebd]['foreignTable'],_0x19458c['joins'][_0x3efebd]['foreignKey']));}}}if(_0x19458c['conditions']){_0x19458c[_0x8aa4('0x7a')]=JSON[_0x8aa4('0x73')](_0x19458c[_0x8aa4('0x7a')]);_0x2e0a5f[_0x8aa4('0x3b')](_0x509b18(_0x19458c['conditions'][_0x8aa4('0x5e')]));}_0x3915a5=_0x2e0a5f[_0x8aa4('0x7b')]();_0x2e0a5f[_0x8aa4('0x21')](_0x3cae59);_0x2e0a5f[_0x8aa4('0x20')](0x0);logger[_0x8aa4('0x7c')]('Limited\x20Query:',_0x2e0a5f[_0x8aa4('0x7d')]());return db[_0x8aa4('0x7e')][_0x8aa4('0x33')](_0x2e0a5f[_0x8aa4('0x7d')](),{'type':db[_0x8aa4('0x7e')][_0x8aa4('0x7f')]['SELECT']});}})['then'](respondWithResult(_0x5d3f01,null))[_0x8aa4('0x45')](handleError(_0x5d3f01,null));};function runReport(_0x9869d6,_0x5acd05,_0x315a80){var _0x127fed=_0x5acd05['name'];var _0x58c511=0xa;var _0x389e79=[_0x8aa4('0x80'),'left_join',_0x8aa4('0x81'),'cross_join'];var _0x239b3f={'SUM':'SUM(%s)','COUNT':_0x8aa4('0x82'),'COUNT DISTINCT':_0x8aa4('0x54'),'MAX':_0x8aa4('0x83'),'MIN':_0x8aa4('0x55'),'AVG':_0x8aa4('0x56'),'GROUP_CONCAT':_0x8aa4('0x84'),'GROUP_CONCAT ASC':_0x8aa4('0x85'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x14be98={'SEC_TO_TIME':_0x8aa4('0x57'),'DATE':_0x8aa4('0x86'),'HOUR':_0x8aa4('0x58'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x8aa4('0x5a')};var _0x47bb69=function(_0x3c07b3){return!_[_0x8aa4('0x74')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x8aa4('0x5c'),_0x8aa4('0x87')],_0x3c07b3);};var _0x5b38dc=function(_0x57ca6b){if(!_0x57ca6b||!_0x57ca6b[_0x8aa4('0x5d')][_0x8aa4('0x37')]){return'';}for(var _0x1ef0cf='(',_0x3c3073=0x0;_0x3c3073<_0x57ca6b['rules'][_0x8aa4('0x37')];_0x3c3073+=0x1){_0x3c3073>0x0&&(_0x1ef0cf+='\x20'+_0x57ca6b[_0x8aa4('0x88')]+'\x20');_0x1ef0cf+=_0x57ca6b[_0x8aa4('0x5d')][_0x3c3073][_0x8aa4('0x5e')]?_0x5b38dc(_0x57ca6b[_0x8aa4('0x5d')][_0x3c3073][_0x8aa4('0x5e')]):_0x57ca6b[_0x8aa4('0x5d')][_0x3c3073][_0x8aa4('0x5f')]+'\x20'+_0x57ca6b['rules'][_0x3c3073][_0x8aa4('0x60')]+(_0x47bb69(_0x57ca6b[_0x8aa4('0x5d')][_0x3c3073][_0x8aa4('0x60')])?'\x20'+_0x57ca6b[_0x8aa4('0x5d')][_0x3c3073][_0x8aa4('0x61')]:'');}return _0x1ef0cf+')';};var _0x349960={'where':{'id':_0x9869d6['id']}},_0x5754de,_0x269f03,_0x50d59e,_0x2813e5,_0x34cb5b;_0x349960=_[_0x8aa4('0x49')]({},_0x349960,_0x315a80);return db['AnalyticCustomReport'][_0x8aa4('0x4a')](_0x349960)[_0x8aa4('0x25')](function(_0x1bba48){if(_0x1bba48){_0x5754de=_0x1bba48;return _0x1bba48[_0x8aa4('0x62')]();}return null;})[_0x8aa4('0x25')](function(_0x264f97){if(_0x264f97){if(!_0x264f97[_0x8aa4('0x37')]){throw new db[(_0x8aa4('0x63'))][(_0x8aa4('0x64'))](_0x8aa4('0x65'),0x193);}_0x269f03=_0x264f97;return db[_0x8aa4('0x66')][_0x8aa4('0x43')]({'raw':!![]});}return null;})[_0x8aa4('0x25')](function(_0x1ab8a4){if(_0x1ab8a4){_0x50d59e=_[_0x8aa4('0x67')](_0x1ab8a4,'id');var _0x478ffa;var _0x59f702=squel['select']();_0x59f702[_0x8aa4('0x69')](_0x5754de[_0x8aa4('0x79')]);for(var _0x2406ab=0x0;_0x2406ab<_0x269f03[_0x8aa4('0x37')];_0x2406ab+=0x1){_0x478ffa=_0x269f03[_0x2406ab][_0x8aa4('0x6a')]?_0x50d59e[_0x269f03[_0x2406ab]['MetricId']][_0x8aa4('0x6b')]:_0x269f03[_0x2406ab][_0x8aa4('0x5f')];_0x478ffa=_0x269f03[_0x2406ab][_0x8aa4('0x6c')]?_[_0x8aa4('0x6d')](_0x239b3f[_0x269f03[_0x2406ab]['function']],'%s',_0x478ffa):_0x478ffa;_0x478ffa=_0x269f03[_0x2406ab][_0x8aa4('0x6e')]?_['replace'](_0x14be98[_0x269f03[_0x2406ab][_0x8aa4('0x6e')]],'%s',_0x478ffa):_0x478ffa;if(_0x269f03[_0x2406ab][_0x8aa4('0x89')]){_0x59f702[_0x8aa4('0x5e')](_0x478ffa);}_0x269f03[_0x2406ab][_0x8aa4('0x6f')]&&_0x59f702[_0x8aa4('0x39')](_0x478ffa,_0x269f03[_0x2406ab][_0x8aa4('0x6f')]===_0x8aa4('0x70')?![]:!![]);_0x59f702[_0x8aa4('0x5f')](_0x478ffa,_0x269f03[_0x2406ab][_0x8aa4('0x71')]||_0x478ffa);}if(_0x5754de[_0x8aa4('0x72')]){_0x5754de[_0x8aa4('0x72')]=JSON[_0x8aa4('0x73')](_0x5754de[_0x8aa4('0x72')]);for(var _0x5767ca=0x0;_0x5767ca<_0x5754de['joins'][_0x8aa4('0x37')];_0x5767ca+=0x1){if(_0x5754de[_0x8aa4('0x72')][_0x5767ca][_0x8aa4('0x30')]&&_['includes'](_0x389e79,_0x5754de['joins'][_0x5767ca][_0x8aa4('0x30')])&&_0x5754de['joins'][_0x5767ca][_0x8aa4('0x75')]&&_0x5754de[_0x8aa4('0x72')][_0x5767ca]['foreignTable']&&_0x5754de[_0x8aa4('0x72')][_0x5767ca][_0x8aa4('0x77')]){_0x59f702[_0x5754de[_0x8aa4('0x72')][_0x5767ca][_0x8aa4('0x30')]](_0x5754de['joins'][_0x5767ca]['foreignTable'],null,util[_0x8aa4('0x6e')](_0x8aa4('0x78'),_0x5754de[_0x8aa4('0x79')],_0x5754de['joins'][_0x5767ca]['parentKey'],_0x5754de[_0x8aa4('0x72')][_0x5767ca][_0x8aa4('0x76')],_0x5754de[_0x8aa4('0x72')][_0x5767ca][_0x8aa4('0x77')]));}}}if(_0x5754de['conditions']){_0x5754de['conditions']=JSON[_0x8aa4('0x73')](_0x5754de[_0x8aa4('0x7a')]);_0x59f702[_0x8aa4('0x3b')](_0x5b38dc(_0x5754de[_0x8aa4('0x7a')][_0x8aa4('0x5e')]));}_0x34cb5b=_0x59f702['clone']();_0x59f702[_0x8aa4('0x21')](_0x58c511);_0x59f702['offset'](0x0);logger[_0x8aa4('0x7c')](_0x8aa4('0x8a'),_0x59f702[_0x8aa4('0x7d')]());return db[_0x8aa4('0x7e')]['query'](_0x59f702[_0x8aa4('0x7d')](),{'type':db[_0x8aa4('0x7e')][_0x8aa4('0x7f')]['SELECT']});}})[_0x8aa4('0x25')](function(_0x3be8d2){if(!_0x3be8d2['length']){throw new db[(_0x8aa4('0x63'))][(_0x8aa4('0x64'))](_0x8aa4('0x8b'),0xcc);}if(_0x5acd05[_0x8aa4('0x8c')]===_0x8aa4('0x8d')){return null;}var _0x5a92d0=_['merge'](_0x5acd05,{'name':_0x5acd05[_0x8aa4('0x8e')]||_0x5acd05[_0x8aa4('0x2a')]||_0x5754de[_0x8aa4('0x2a')],'basename':_0x127fed,'savename':util[_0x8aa4('0x6e')](_0x8aa4('0x8f'),_0x5acd05[_0x8aa4('0x2a')]||_0x5754de['name'],require(_0x8aa4('0x90'))[_0x8aa4('0x91')](0x4),_0x5acd05[_0x8aa4('0x8c')]||_0x8aa4('0x92')),'reportId':_0x5754de['id'],'reportType':_0x8aa4('0x93')});return db[_0x8aa4('0x94')][_0x8aa4('0x4b')](_0x5a92d0,{'raw':!![]});})[_0x8aa4('0x25')](function(_0x256162){if(_0x5754de['table']===_0x8aa4('0x95')){_0x34cb5b['where'](_0x5754de[_0x8aa4('0x79')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x5acd05['startDate'],_0x5acd05['endDate']);}else{_0x34cb5b[_0x8aa4('0x3b')](_0x5754de[_0x8aa4('0x79')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5acd05[_0x8aa4('0x96')],_0x5acd05[_0x8aa4('0x97')]);}if(_0x256162){logger[_0x8aa4('0x98')](_0x8aa4('0x99'),_0x34cb5b[_0x8aa4('0x7d')]());require(_0x8aa4('0x9a'))['fork'](path[_0x8aa4('0x80')](__dirname,_0x8aa4('0x9b'),_0x256162[_0x8aa4('0x8c')]),[_0x256162['id'],_0x34cb5b[_0x8aa4('0x7d')](),path[_0x8aa4('0x80')](__dirname,_0x8aa4('0x9c'),_0x256162['savename']),_0x127fed]);return _0x256162;}else{var _0xd951e6=squel[_0x8aa4('0x68')]();_0xd951e6[_0x8aa4('0x69')]('('+_0x34cb5b[_0x8aa4('0x7d')]()+')',_0x8aa4('0x9d'));_0xd951e6['field'](_0x8aa4('0x9e'),_0x8aa4('0x3f'));_0x34cb5b[_0x8aa4('0x21')](_0x5acd05['limit']||_0x58c511);_0x34cb5b[_0x8aa4('0x20')](_0x5acd05[_0x8aa4('0x20')]||0x0);return db[_0x8aa4('0x7e')][_0x8aa4('0x33')](_0xd951e6[_0x8aa4('0x7d')](),{'type':db['sequelize'][_0x8aa4('0x7f')][_0x8aa4('0x9f')]})[_0x8aa4('0x25')](function(_0x494d53){if(!_0x494d53[_0x8aa4('0x37')]){_0x2813e5=0x0;}else{_0x2813e5=_0x494d53[0x0][_0x8aa4('0x3f')]||0x0;}return db[_0x8aa4('0x7e')][_0x8aa4('0x33')](_0x34cb5b[_0x8aa4('0x7d')](),{'type':db[_0x8aa4('0x7e')]['QueryTypes'][_0x8aa4('0x9f')]});})[_0x8aa4('0x25')](function(_0x390f62){return{'rows':_0x390f62||[],'count':_0x2813e5};});}});}exports[_0x8aa4('0xa0')]=function(_0xd1e67,_0x1d2e46){return runReport(_0xd1e67[_0x8aa4('0x47')],_0xd1e67['query'],_0xd1e67['options'])[_0x8aa4('0x25')](respondWithResult(_0x1d2e46,null))[_0x8aa4('0x45')](handleError(_0x1d2e46,null));};exports[_0x8aa4('0xa1')]=runReport;exports[_0x8aa4('0x33')]=function(_0x493a0f,_0x326118){var _0x47335e=0xa;var _0x33ac54=[_0x8aa4('0x80'),'left_join',_0x8aa4('0x81'),_0x8aa4('0x52')];var _0x20d365={'SUM':_0x8aa4('0x53'),'COUNT':_0x8aa4('0x82'),'COUNT DISTINCT':_0x8aa4('0x54'),'MAX':_0x8aa4('0x83'),'MIN':_0x8aa4('0x55'),'AVG':_0x8aa4('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x8aa4('0xa2')};var _0x4a2532={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x8aa4('0x86'),'HOUR':'HOUR(%s)','ROUND':_0x8aa4('0x59'),'UNIX_TIMESTAMP':_0x8aa4('0x5a')};var _0x5c5f3d=function(_0x4d5a7f){return!_[_0x8aa4('0x74')]([_0x8aa4('0xa3'),_0x8aa4('0x5b'),_0x8aa4('0x5c'),_0x8aa4('0x87')],_0x4d5a7f);};var _0x22b5b4=function(_0x3bb364){if(!_0x3bb364||!_0x3bb364[_0x8aa4('0x5d')]['length']){return'';}for(var _0x56523c='(',_0x4efd3b=0x0;_0x4efd3b<_0x3bb364[_0x8aa4('0x5d')]['length'];_0x4efd3b+=0x1){_0x4efd3b>0x0&&(_0x56523c+='\x20'+_0x3bb364['operator']+'\x20');_0x56523c+=_0x3bb364['rules'][_0x4efd3b][_0x8aa4('0x5e')]?_0x22b5b4(_0x3bb364[_0x8aa4('0x5d')][_0x4efd3b][_0x8aa4('0x5e')]):_0x3bb364[_0x8aa4('0x5d')][_0x4efd3b][_0x8aa4('0x5f')]+'\x20'+_0x3bb364[_0x8aa4('0x5d')][_0x4efd3b][_0x8aa4('0x60')]+(_0x5c5f3d(_0x3bb364[_0x8aa4('0x5d')][_0x4efd3b][_0x8aa4('0x60')])?'\x20'+_0x3bb364['rules'][_0x4efd3b][_0x8aa4('0x61')]:'');}return _0x56523c+')';};var _0x7a68e3={'where':{'id':_0x493a0f[_0x8aa4('0x47')]['id']}},_0x120f7b,_0x3fbb98,_0x5caf6c,_0x36eef9,_0x2f42c5;_0x7a68e3=_[_0x8aa4('0x49')]({},_0x7a68e3,_0x493a0f[_0x8aa4('0x3e')]);return db['AnalyticCustomReport'][_0x8aa4('0x4a')](_0x7a68e3)[_0x8aa4('0x25')](function(_0x164fcf){if(_0x164fcf){_0x120f7b=_0x164fcf;return _0x164fcf[_0x8aa4('0x62')]();}return null;})[_0x8aa4('0x25')](function(_0x5e9d95){if(_0x5e9d95){if(!_0x5e9d95['length']){throw new db[(_0x8aa4('0x63'))]['ValidationErrorItem'](_0x8aa4('0x65'),0x193);}_0x3fbb98=_0x5e9d95;return db['AnalyticMetric'][_0x8aa4('0x43')]({'raw':!![]});}return null;})[_0x8aa4('0x25')](function(_0x18d930){if(_0x18d930){_0x5caf6c=_[_0x8aa4('0x67')](_0x18d930,'id');var _0x24488c;var _0x495ea9=squel[_0x8aa4('0x68')]();_0x495ea9[_0x8aa4('0x69')](_0x120f7b[_0x8aa4('0x79')]);for(var _0x4ee755=0x0;_0x4ee755<_0x3fbb98[_0x8aa4('0x37')];_0x4ee755+=0x1){_0x24488c=_0x3fbb98[_0x4ee755]['MetricId']?_0x5caf6c[_0x3fbb98[_0x4ee755][_0x8aa4('0x6a')]][_0x8aa4('0x6b')]:_0x3fbb98[_0x4ee755]['field'];_0x24488c=_0x3fbb98[_0x4ee755][_0x8aa4('0x6c')]?_[_0x8aa4('0x6d')](_0x20d365[_0x3fbb98[_0x4ee755]['function']],'%s',_0x24488c):_0x24488c;_0x24488c=_0x3fbb98[_0x4ee755]['format']?_[_0x8aa4('0x6d')](_0x4a2532[_0x3fbb98[_0x4ee755][_0x8aa4('0x6e')]],'%s',_0x24488c):_0x24488c;if(_0x3fbb98[_0x4ee755][_0x8aa4('0x89')]){_0x495ea9[_0x8aa4('0x5e')](_0x24488c);}_0x3fbb98[_0x4ee755][_0x8aa4('0x6f')]&&_0x495ea9[_0x8aa4('0x39')](_0x24488c,_0x3fbb98[_0x4ee755][_0x8aa4('0x6f')]===_0x8aa4('0x70')?![]:!![]);_0x495ea9[_0x8aa4('0x5f')](_0x24488c,_0x3fbb98[_0x4ee755][_0x8aa4('0x71')]||_0x24488c);}if(_0x120f7b['joins']){_0x120f7b['joins']=JSON[_0x8aa4('0x73')](_0x120f7b[_0x8aa4('0x72')]);for(var _0xfa2cb4=0x0;_0xfa2cb4<_0x120f7b[_0x8aa4('0x72')][_0x8aa4('0x37')];_0xfa2cb4+=0x1){if(_0x120f7b[_0x8aa4('0x72')][_0xfa2cb4]['type']&&_['includes'](_0x33ac54,_0x120f7b['joins'][_0xfa2cb4]['type'])&&_0x120f7b[_0x8aa4('0x72')][_0xfa2cb4]['parentKey']&&_0x120f7b['joins'][_0xfa2cb4][_0x8aa4('0x76')]&&_0x120f7b[_0x8aa4('0x72')][_0xfa2cb4]['foreignKey']){_0x495ea9[_0x120f7b[_0x8aa4('0x72')][_0xfa2cb4][_0x8aa4('0x30')]](_0x120f7b['joins'][_0xfa2cb4][_0x8aa4('0x76')],null,util[_0x8aa4('0x6e')](_0x8aa4('0x78'),_0x120f7b[_0x8aa4('0x79')],_0x120f7b[_0x8aa4('0x72')][_0xfa2cb4][_0x8aa4('0x75')],_0x120f7b['joins'][_0xfa2cb4][_0x8aa4('0x76')],_0x120f7b[_0x8aa4('0x72')][_0xfa2cb4][_0x8aa4('0x77')]));}}}if(_0x120f7b[_0x8aa4('0x7a')]){_0x120f7b[_0x8aa4('0x7a')]=JSON['parse'](_0x120f7b[_0x8aa4('0x7a')]);_0x495ea9[_0x8aa4('0x3b')](_0x22b5b4(_0x120f7b['conditions'][_0x8aa4('0x5e')]));}_0x2f42c5=_0x495ea9[_0x8aa4('0x7b')]();_0x495ea9[_0x8aa4('0x21')](_0x47335e);_0x495ea9['offset'](0x0);logger[_0x8aa4('0x7c')](_0x8aa4('0x8a'),_0x495ea9[_0x8aa4('0x7d')]());return db[_0x8aa4('0x7e')]['query'](_0x495ea9[_0x8aa4('0x7d')](),{'type':db[_0x8aa4('0x7e')][_0x8aa4('0x7f')]['SELECT']});}})[_0x8aa4('0x25')](function(){return{'sql':_0x2f42c5[_0x8aa4('0x7d')]()};})['then'](respondWithResult(_0x326118,null))[_0x8aa4('0x45')](handleError(_0x326118,null));}; \ No newline at end of file +var _0x12ef=['catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','CustomReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','left_join','right_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','options','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','format','groupBy','orderBy','order','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','Limited\x20Query:','sequelize','SELECT','join','cross_join','GROUP_CONCAT(%s)','replace','DESC','debug','toString','QueryTypes','No\x20available\x20data','output','fullPath','%s-%s.%s','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','../../components/export/','COUNT(*)','run','runReport','SEC_TO_TIME(%s)','HOUR(%s)','html-pdf','eml-format','moment','bluebird','mustache','path','sox','ejs','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','then','get','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticCustomReport','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','params','find'];(function(_0xa2edae,_0x5e5f61){var _0x51fffc=function(_0x4157c4){while(--_0x4157c4){_0xa2edae['push'](_0xa2edae['shift']());}};_0x51fffc(++_0x5e5f61);}(_0x12ef,0x19d));var _0xf12e=function(_0x568496,_0x565afd){_0x568496=_0x568496-0x0;var _0x26c5c1=_0x12ef[_0x568496];return _0x26c5c1;};'use strict';var pdf=require(_0xf12e('0x0'));var emlformat=require(_0xf12e('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf12e('0x2'));var BPromise=require(_0xf12e('0x3'));var Mustache=require(_0xf12e('0x4'));var util=require('util');var path=require(_0xf12e('0x5'));var sox=require(_0xf12e('0x6'));var csv=require('to-csv');var ejs=require(_0xf12e('0x7'));var fs=require('fs');var _=require(_0xf12e('0x8'));var squel=require('squel');var crypto=require(_0xf12e('0x9'));var jsforce=require(_0xf12e('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xf12e('0xb'));var querystring=require(_0xf12e('0xc'));var Papa=require(_0xf12e('0xd'));var Redis=require(_0xf12e('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf12e('0xf'));var hardwareService=require(_0xf12e('0x10'));var logger=require('../../config/logger')(_0xf12e('0x11'));var utils=require(_0xf12e('0x12'));var config=require(_0xf12e('0x13'));var db=require(_0xf12e('0x14'))['db'];function respondWithStatusCode(_0x3481c5,_0x42ca65){_0x42ca65=_0x42ca65||0xcc;return function(_0x3e2f55){if(_0x3e2f55){return _0x3481c5[_0xf12e('0x15')](_0x42ca65);}return _0x3481c5[_0xf12e('0x16')](_0x42ca65)[_0xf12e('0x17')]();};}function respondWithResult(_0x497c39,_0x5f1fc0){_0x5f1fc0=_0x5f1fc0||0xc8;return function(_0x937318){if(_0x937318){return _0x497c39[_0xf12e('0x16')](_0x5f1fc0)[_0xf12e('0x18')](_0x937318);}};}function respondWithFilteredResult(_0x3e43e8,_0x4ab40b){return function(_0xa0bc4f){if(_0xa0bc4f){var _0x17f97e=_0xa0bc4f[_0xf12e('0x19')],_0x110887=_0x4ab40b[_0xf12e('0x1a')],_0x59f9f0=_0x4ab40b[_0xf12e('0x1a')]+_0x4ab40b[_0xf12e('0x1b')],_0x29faf7;if(_0x59f9f0>=_0x17f97e){_0x59f9f0=_0x17f97e;_0x29faf7=0xc8;}else{_0x29faf7=0xce;}_0x3e43e8['status'](_0x29faf7);return _0x3e43e8[_0xf12e('0x1c')]('Content-Range',_0x110887+'-'+_0x59f9f0+'/'+_0x17f97e)[_0xf12e('0x18')](_0xa0bc4f);}return null;};}function patchUpdates(_0x4e1f0e){return function(_0x5e7684){try{jsonpatch[_0xf12e('0x1d')](_0x5e7684,_0x4e1f0e,!![]);}catch(_0x3f3655){return BPromise[_0xf12e('0x1e')](_0x3f3655);}return _0x5e7684[_0xf12e('0x1f')]();};}function saveUpdates(_0x1522f5,_0x4022e3){return function(_0x41134f){if(_0x41134f){return _0x41134f[_0xf12e('0x20')](_0x1522f5)[_0xf12e('0x21')](function(_0x234efc){return _0x234efc;});}return null;};}function removeEntity(_0x56f01c,_0x48ee57){return function(_0x45cfc1){if(_0x45cfc1){return _0x45cfc1['destroy']()['then'](function(){var _0x1d0198=_0x45cfc1[_0xf12e('0x22')]({'plain':!![]});var _0x202124='CustomReports';return db[_0xf12e('0x23')][_0xf12e('0x24')]({'where':{'type':_0x202124,'resourceId':_0x1d0198['id']}})[_0xf12e('0x21')](function(){return _0x45cfc1;});})[_0xf12e('0x21')](function(){_0x56f01c[_0xf12e('0x16')](0xcc)[_0xf12e('0x17')]();});}};}function handleEntityNotFound(_0x95f364,_0x52a086){return function(_0x38da59){if(!_0x38da59){_0x95f364['sendStatus'](0x194);}return _0x38da59;};}function handleError(_0x343e75,_0x2f9ce1){_0x2f9ce1=_0x2f9ce1||0x1f4;return function(_0x3c1af1){logger[_0xf12e('0x25')](_0x3c1af1[_0xf12e('0x26')]);if(_0x3c1af1['name']){delete _0x3c1af1[_0xf12e('0x27')];}_0x343e75[_0xf12e('0x16')](_0x2f9ce1)[_0xf12e('0x28')](_0x3c1af1);};}exports[_0xf12e('0x29')]=function(_0x4b59c7,_0x3c2e75){var _0x478317={},_0x46edd3={},_0x1c46aa={'count':0x0,'rows':[]};var _0x1a42ec=_[_0xf12e('0x2a')](db[_0xf12e('0x2b')]['rawAttributes'],function(_0x341ec6){return{'name':_0x341ec6[_0xf12e('0x2c')],'type':_0x341ec6['type'][_0xf12e('0x2d')]};});_0x46edd3[_0xf12e('0x2e')]=_[_0xf12e('0x2a')](_0x1a42ec,_0xf12e('0x27'));_0x46edd3[_0xf12e('0x2f')]=_[_0xf12e('0x30')](_0x4b59c7[_0xf12e('0x2f')]);_0x46edd3[_0xf12e('0x31')]=_[_0xf12e('0x32')](_0x46edd3[_0xf12e('0x2e')],_0x46edd3[_0xf12e('0x2f')]);_0x478317[_0xf12e('0x33')]=_['intersection'](_0x46edd3[_0xf12e('0x2e')],qs[_0xf12e('0x34')](_0x4b59c7[_0xf12e('0x2f')][_0xf12e('0x34')]));_0x478317[_0xf12e('0x33')]=_0x478317['attributes'][_0xf12e('0x35')]?_0x478317[_0xf12e('0x33')]:_0x46edd3[_0xf12e('0x2e')];if(!_0x4b59c7[_0xf12e('0x2f')][_0xf12e('0x36')](_0xf12e('0x37'))){_0x478317[_0xf12e('0x1b')]=qs[_0xf12e('0x1b')](_0x4b59c7[_0xf12e('0x2f')][_0xf12e('0x1b')]);_0x478317[_0xf12e('0x1a')]=qs[_0xf12e('0x1a')](_0x4b59c7[_0xf12e('0x2f')][_0xf12e('0x1a')]);}_0x478317['order']=qs[_0xf12e('0x38')](_0x4b59c7['query']['sort']);_0x478317[_0xf12e('0x39')]=qs[_0xf12e('0x31')](_[_0xf12e('0x3a')](_0x4b59c7[_0xf12e('0x2f')],_0x46edd3[_0xf12e('0x31')]));if(_0x4b59c7['query'][_0xf12e('0x3b')]){_0x478317[_0xf12e('0x39')]=_[_0xf12e('0x3c')](_0x478317[_0xf12e('0x39')],{'$or':_[_0xf12e('0x2a')](_0x1a42ec,function(_0xe2723f){if(_0xe2723f[_0xf12e('0x3d')]!==_0xf12e('0x3e')){var _0x1c4caf={};_0x1c4caf[_0xe2723f[_0xf12e('0x27')]]={'$like':'%'+_0x4b59c7[_0xf12e('0x2f')][_0xf12e('0x3b')]+'%'};return _0x1c4caf;}})});}_0x478317=_['merge']({},_0x478317,_0x4b59c7['options']);var _0x404fa2={'where':_0x478317['where']};return db[_0xf12e('0x2b')][_0xf12e('0x19')](_0x404fa2)['then'](function(_0x11d3b3){_0x1c46aa[_0xf12e('0x19')]=_0x11d3b3;if(_0x4b59c7[_0xf12e('0x2f')][_0xf12e('0x3f')]){_0x478317[_0xf12e('0x40')]=[{'all':!![]}];}return db[_0xf12e('0x2b')][_0xf12e('0x41')](_0x478317);})[_0xf12e('0x21')](function(_0x2a674d){_0x1c46aa[_0xf12e('0x42')]=_0x2a674d;return _0x1c46aa;})[_0xf12e('0x21')](respondWithFilteredResult(_0x3c2e75,_0x478317))['catch'](handleError(_0x3c2e75,null));};exports[_0xf12e('0x43')]=function(_0x3c7cee,_0x16463e){var _0x178223={'raw':![],'where':{'id':_0x3c7cee[_0xf12e('0x44')]['id']}},_0x5f271f={};_0x5f271f[_0xf12e('0x2e')]=_[_0xf12e('0x30')](db['AnalyticCustomReport']['rawAttributes']);_0x5f271f[_0xf12e('0x2f')]=_[_0xf12e('0x30')](_0x3c7cee[_0xf12e('0x2f')]);_0x5f271f[_0xf12e('0x31')]=_['intersection'](_0x5f271f[_0xf12e('0x2e')],_0x5f271f[_0xf12e('0x2f')]);_0x178223[_0xf12e('0x33')]=_[_0xf12e('0x32')](_0x5f271f[_0xf12e('0x2e')],qs['fields'](_0x3c7cee[_0xf12e('0x2f')][_0xf12e('0x34')]));_0x178223['attributes']=_0x178223[_0xf12e('0x33')][_0xf12e('0x35')]?_0x178223[_0xf12e('0x33')]:_0x5f271f[_0xf12e('0x2e')];if(_0x3c7cee[_0xf12e('0x2f')][_0xf12e('0x3f')]){_0x178223[_0xf12e('0x40')]=[{'all':!![]}];}_0x178223=_[_0xf12e('0x3c')]({},_0x178223,_0x3c7cee['options']);return db[_0xf12e('0x2b')][_0xf12e('0x45')](_0x178223)[_0xf12e('0x21')](handleEntityNotFound(_0x16463e,null))[_0xf12e('0x21')](respondWithResult(_0x16463e,null))[_0xf12e('0x46')](handleError(_0x16463e,null));};exports[_0xf12e('0x47')]=function(_0x3dda6f,_0x2ee80c){return db[_0xf12e('0x2b')][_0xf12e('0x47')](_0x3dda6f[_0xf12e('0x48')],{})[_0xf12e('0x21')](function(_0x4959b4){var _0x5aa8ba=_0x3dda6f[_0xf12e('0x49')]['get']({'plain':!![]});if(!_0x5aa8ba)throw new Error(_0xf12e('0x4a'));if(_0x5aa8ba['role']==='user'){var _0x1863e5=_0x4959b4[_0xf12e('0x22')]({'plain':!![]});var _0x44598e='Reports';return db[_0xf12e('0x4b')][_0xf12e('0x45')]({'where':{'name':_0x44598e,'userProfileId':_0x5aa8ba[_0xf12e('0x4c')]},'raw':!![]})[_0xf12e('0x21')](function(_0x39ee7f){if(_0x39ee7f&&_0x39ee7f[_0xf12e('0x4d')]===0x0){return db[_0xf12e('0x23')][_0xf12e('0x47')]({'name':_0x1863e5[_0xf12e('0x27')],'resourceId':_0x1863e5['id'],'type':_0xf12e('0x4e'),'sectionId':_0x39ee7f['id']},{})[_0xf12e('0x21')](function(){return _0x4959b4;});}else{return _0x4959b4;}})['catch'](function(_0x485c29){logger['error'](_0xf12e('0x4f'),_0x485c29);throw _0x485c29;});}return _0x4959b4;})[_0xf12e('0x21')](respondWithResult(_0x2ee80c,0xc9))[_0xf12e('0x46')](handleError(_0x2ee80c,null));};exports[_0xf12e('0x20')]=function(_0x59bd58,_0x18ccb3){if(_0x59bd58[_0xf12e('0x48')]['id']){delete _0x59bd58[_0xf12e('0x48')]['id'];}return db[_0xf12e('0x2b')][_0xf12e('0x45')]({'where':{'id':_0x59bd58[_0xf12e('0x44')]['id']}})[_0xf12e('0x21')](handleEntityNotFound(_0x18ccb3,null))[_0xf12e('0x21')](saveUpdates(_0x59bd58['body'],null))[_0xf12e('0x21')](respondWithResult(_0x18ccb3,null))['catch'](handleError(_0x18ccb3,null));};exports[_0xf12e('0x24')]=function(_0x4c87e0,_0x264845){return db[_0xf12e('0x2b')]['find']({'where':{'id':_0x4c87e0[_0xf12e('0x44')]['id']}})[_0xf12e('0x21')](handleEntityNotFound(_0x264845,null))[_0xf12e('0x21')](removeEntity(_0x264845,null))[_0xf12e('0x46')](handleError(_0x264845,null));};exports['preview']=function(_0x311e24,_0x1aed73){var _0x2da8f6=0xa;var _0xe052b=['join',_0xf12e('0x50'),_0xf12e('0x51'),'cross_join'];var _0x11dbec={'SUM':_0xf12e('0x52'),'COUNT':_0xf12e('0x53'),'COUNT DISTINCT':_0xf12e('0x54'),'MAX':_0xf12e('0x55'),'MIN':_0xf12e('0x56'),'AVG':_0xf12e('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xf12e('0x58'),'GROUP_CONCAT DESC':_0xf12e('0x59')};var _0x4c4589={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xf12e('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0xf12e('0x5b'),'UNIX_TIMESTAMP':_0xf12e('0x5c')};var _0x8315b=function(_0x19ed94){return!_[_0xf12e('0x5d')]([_0xf12e('0x5e'),_0xf12e('0x5f'),_0xf12e('0x60'),_0xf12e('0x61')],_0x19ed94);};var _0x46f06d=function(_0x147f23){if(!_0x147f23||!_0x147f23[_0xf12e('0x62')][_0xf12e('0x35')]){return'';}for(var _0x5db438='(',_0xc39f34=0x0;_0xc39f34<_0x147f23['rules'][_0xf12e('0x35')];_0xc39f34+=0x1){_0xc39f34>0x0&&(_0x5db438+='\x20'+_0x147f23['operator']+'\x20');_0x5db438+=_0x147f23[_0xf12e('0x62')][_0xc39f34][_0xf12e('0x63')]?_0x46f06d(_0x147f23[_0xf12e('0x62')][_0xc39f34][_0xf12e('0x63')]):_0x147f23['rules'][_0xc39f34][_0xf12e('0x64')]+'\x20'+_0x147f23[_0xf12e('0x62')][_0xc39f34][_0xf12e('0x65')]+(_0x8315b(_0x147f23['rules'][_0xc39f34][_0xf12e('0x65')])?'\x20'+_0x147f23[_0xf12e('0x62')][_0xc39f34][_0xf12e('0x66')]:'');}return _0x5db438+')';};var _0x3c5ed7={'where':{'id':_0x311e24[_0xf12e('0x44')]['id']}},_0x4af4a7,_0x436963,_0x2cd303,_0x5372bd,_0x52d9be;_0x3c5ed7=_['merge']({},_0x3c5ed7,_0x311e24[_0xf12e('0x67')]);return db[_0xf12e('0x2b')][_0xf12e('0x45')](_0x3c5ed7)['then'](function(_0x31cddc){if(_0x31cddc){_0x4af4a7=_0x31cddc;return _0x31cddc[_0xf12e('0x68')]();}return null;})['then'](function(_0x356e05){if(_0x356e05){if(!_0x356e05[_0xf12e('0x35')]){throw new db[(_0xf12e('0x69'))][(_0xf12e('0x6a'))](_0xf12e('0x6b'),0x193);}_0x436963=_0x356e05;return db[_0xf12e('0x6c')][_0xf12e('0x41')]({'raw':!![]});}return null;})['then'](function(_0x118e64){if(_0x118e64){_0x2cd303=_[_0xf12e('0x6d')](_0x118e64,'id');var _0x2f23e9;var _0x36633b=squel[_0xf12e('0x6e')]();_0x36633b[_0xf12e('0x6f')](_0x4af4a7[_0xf12e('0x70')]);for(var _0x55fcb4=0x0;_0x55fcb4<_0x436963[_0xf12e('0x35')];_0x55fcb4+=0x1){_0x2f23e9=_0x436963[_0x55fcb4][_0xf12e('0x71')]?_0x2cd303[_0x436963[_0x55fcb4][_0xf12e('0x71')]][_0xf12e('0x72')]:_0x436963[_0x55fcb4][_0xf12e('0x64')];_0x2f23e9=_0x436963[_0x55fcb4][_0xf12e('0x73')]?_['replace'](_0x11dbec[_0x436963[_0x55fcb4][_0xf12e('0x73')]],'%s',_0x2f23e9):_0x2f23e9;_0x2f23e9=_0x436963[_0x55fcb4][_0xf12e('0x74')]?_['replace'](_0x4c4589[_0x436963[_0x55fcb4][_0xf12e('0x74')]],'%s',_0x2f23e9):_0x2f23e9;if(_0x436963[_0x55fcb4][_0xf12e('0x75')]){_0x36633b['group'](_0x2f23e9);}_0x436963[_0x55fcb4][_0xf12e('0x76')]&&_0x36633b[_0xf12e('0x77')](_0x2f23e9,_0x436963[_0x55fcb4][_0xf12e('0x76')]==='DESC'?![]:!![]);_0x36633b[_0xf12e('0x64')](_0x2f23e9,_0x436963[_0x55fcb4][_0xf12e('0x78')]||_0x2f23e9);}if(_0x4af4a7['joins']){_0x4af4a7[_0xf12e('0x79')]=JSON[_0xf12e('0x7a')](_0x4af4a7[_0xf12e('0x79')]);for(var _0x546188=0x0;_0x546188<_0x4af4a7['joins']['length'];_0x546188+=0x1){if(_0x4af4a7[_0xf12e('0x79')][_0x546188][_0xf12e('0x3d')]&&_[_0xf12e('0x5d')](_0xe052b,_0x4af4a7[_0xf12e('0x79')][_0x546188]['type'])&&_0x4af4a7[_0xf12e('0x79')][_0x546188][_0xf12e('0x7b')]&&_0x4af4a7[_0xf12e('0x79')][_0x546188][_0xf12e('0x7c')]&&_0x4af4a7[_0xf12e('0x79')][_0x546188][_0xf12e('0x7d')]){_0x36633b[_0x4af4a7[_0xf12e('0x79')][_0x546188][_0xf12e('0x3d')]](_0x4af4a7['joins'][_0x546188][_0xf12e('0x7c')],null,util[_0xf12e('0x74')](_0xf12e('0x7e'),_0x4af4a7[_0xf12e('0x70')],_0x4af4a7[_0xf12e('0x79')][_0x546188][_0xf12e('0x7b')],_0x4af4a7[_0xf12e('0x79')][_0x546188][_0xf12e('0x7c')],_0x4af4a7[_0xf12e('0x79')][_0x546188]['foreignKey']));}}}if(_0x4af4a7[_0xf12e('0x7f')]){_0x4af4a7['conditions']=JSON['parse'](_0x4af4a7[_0xf12e('0x7f')]);_0x36633b['where'](_0x46f06d(_0x4af4a7[_0xf12e('0x7f')][_0xf12e('0x63')]));}_0x52d9be=_0x36633b[_0xf12e('0x80')]();_0x36633b['limit'](_0x2da8f6);_0x36633b[_0xf12e('0x1a')](0x0);logger['debug'](_0xf12e('0x81'),_0x36633b['toString']());return db[_0xf12e('0x82')][_0xf12e('0x2f')](_0x36633b['toString'](),{'type':db['sequelize']['QueryTypes'][_0xf12e('0x83')]});}})[_0xf12e('0x21')](respondWithResult(_0x1aed73,null))[_0xf12e('0x46')](handleError(_0x1aed73,null));};function runReport(_0x11b6ac,_0x1f5b7a,_0x30ff1b){var _0x3810f3=_0x1f5b7a['name'];var _0x22544c=0xa;var _0x29de78=[_0xf12e('0x84'),_0xf12e('0x50'),_0xf12e('0x51'),_0xf12e('0x85')];var _0x2a45b5={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xf12e('0x54'),'MAX':_0xf12e('0x55'),'MIN':'MIN(%s)','AVG':_0xf12e('0x57'),'GROUP_CONCAT':_0xf12e('0x86'),'GROUP_CONCAT ASC':_0xf12e('0x58'),'GROUP_CONCAT DESC':_0xf12e('0x59')};var _0x4a6b1c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xf12e('0x5b'),'UNIX_TIMESTAMP':_0xf12e('0x5c')};var _0x253b2b=function(_0x357d87){return!_[_0xf12e('0x5d')]([_0xf12e('0x5e'),'IS\x20NOT\x20NULL',_0xf12e('0x60'),_0xf12e('0x61')],_0x357d87);};var _0x53b455=function(_0x2bbbb7){if(!_0x2bbbb7||!_0x2bbbb7[_0xf12e('0x62')][_0xf12e('0x35')]){return'';}for(var _0x2048d3='(',_0x332cb3=0x0;_0x332cb3<_0x2bbbb7[_0xf12e('0x62')]['length'];_0x332cb3+=0x1){_0x332cb3>0x0&&(_0x2048d3+='\x20'+_0x2bbbb7['operator']+'\x20');_0x2048d3+=_0x2bbbb7[_0xf12e('0x62')][_0x332cb3][_0xf12e('0x63')]?_0x53b455(_0x2bbbb7[_0xf12e('0x62')][_0x332cb3]['group']):_0x2bbbb7[_0xf12e('0x62')][_0x332cb3][_0xf12e('0x64')]+'\x20'+_0x2bbbb7['rules'][_0x332cb3][_0xf12e('0x65')]+(_0x253b2b(_0x2bbbb7[_0xf12e('0x62')][_0x332cb3]['condition'])?'\x20'+_0x2bbbb7[_0xf12e('0x62')][_0x332cb3]['value']:'');}return _0x2048d3+')';};var _0xdb1f71={'where':{'id':_0x11b6ac['id']}},_0x36dbf9,_0x438ec4,_0xeb56b0,_0x32561d,_0x506fa1;_0xdb1f71=_[_0xf12e('0x3c')]({},_0xdb1f71,_0x30ff1b);return db[_0xf12e('0x2b')][_0xf12e('0x45')](_0xdb1f71)[_0xf12e('0x21')](function(_0x3c78cf){if(_0x3c78cf){_0x36dbf9=_0x3c78cf;return _0x3c78cf[_0xf12e('0x68')]();}return null;})[_0xf12e('0x21')](function(_0x3c3204){if(_0x3c3204){if(!_0x3c3204['length']){throw new db[(_0xf12e('0x69'))][(_0xf12e('0x6a'))](_0xf12e('0x6b'),0x193);}_0x438ec4=_0x3c3204;return db[_0xf12e('0x6c')][_0xf12e('0x41')]({'raw':!![]});}return null;})[_0xf12e('0x21')](function(_0x1a4381){if(_0x1a4381){_0xeb56b0=_[_0xf12e('0x6d')](_0x1a4381,'id');var _0x352789;var _0x332ebd=squel['select']();_0x332ebd[_0xf12e('0x6f')](_0x36dbf9[_0xf12e('0x70')]);for(var _0x2f2cd4=0x0;_0x2f2cd4<_0x438ec4[_0xf12e('0x35')];_0x2f2cd4+=0x1){_0x352789=_0x438ec4[_0x2f2cd4][_0xf12e('0x71')]?_0xeb56b0[_0x438ec4[_0x2f2cd4][_0xf12e('0x71')]]['metric']:_0x438ec4[_0x2f2cd4][_0xf12e('0x64')];_0x352789=_0x438ec4[_0x2f2cd4]['function']?_[_0xf12e('0x87')](_0x2a45b5[_0x438ec4[_0x2f2cd4][_0xf12e('0x73')]],'%s',_0x352789):_0x352789;_0x352789=_0x438ec4[_0x2f2cd4][_0xf12e('0x74')]?_[_0xf12e('0x87')](_0x4a6b1c[_0x438ec4[_0x2f2cd4][_0xf12e('0x74')]],'%s',_0x352789):_0x352789;if(_0x438ec4[_0x2f2cd4][_0xf12e('0x75')]){_0x332ebd[_0xf12e('0x63')](_0x352789);}_0x438ec4[_0x2f2cd4][_0xf12e('0x76')]&&_0x332ebd[_0xf12e('0x77')](_0x352789,_0x438ec4[_0x2f2cd4][_0xf12e('0x76')]===_0xf12e('0x88')?![]:!![]);_0x332ebd[_0xf12e('0x64')](_0x352789,_0x438ec4[_0x2f2cd4]['alias']||_0x352789);}if(_0x36dbf9[_0xf12e('0x79')]){_0x36dbf9[_0xf12e('0x79')]=JSON[_0xf12e('0x7a')](_0x36dbf9[_0xf12e('0x79')]);for(var _0x453b64=0x0;_0x453b64<_0x36dbf9[_0xf12e('0x79')][_0xf12e('0x35')];_0x453b64+=0x1){if(_0x36dbf9[_0xf12e('0x79')][_0x453b64][_0xf12e('0x3d')]&&_[_0xf12e('0x5d')](_0x29de78,_0x36dbf9['joins'][_0x453b64][_0xf12e('0x3d')])&&_0x36dbf9[_0xf12e('0x79')][_0x453b64][_0xf12e('0x7b')]&&_0x36dbf9[_0xf12e('0x79')][_0x453b64][_0xf12e('0x7c')]&&_0x36dbf9['joins'][_0x453b64][_0xf12e('0x7d')]){_0x332ebd[_0x36dbf9[_0xf12e('0x79')][_0x453b64][_0xf12e('0x3d')]](_0x36dbf9[_0xf12e('0x79')][_0x453b64][_0xf12e('0x7c')],null,util[_0xf12e('0x74')](_0xf12e('0x7e'),_0x36dbf9['table'],_0x36dbf9[_0xf12e('0x79')][_0x453b64]['parentKey'],_0x36dbf9[_0xf12e('0x79')][_0x453b64][_0xf12e('0x7c')],_0x36dbf9[_0xf12e('0x79')][_0x453b64]['foreignKey']));}}}if(_0x36dbf9[_0xf12e('0x7f')]){_0x36dbf9[_0xf12e('0x7f')]=JSON[_0xf12e('0x7a')](_0x36dbf9['conditions']);_0x332ebd['where'](_0x53b455(_0x36dbf9[_0xf12e('0x7f')][_0xf12e('0x63')]));}_0x506fa1=_0x332ebd['clone']();_0x332ebd['limit'](_0x22544c);_0x332ebd[_0xf12e('0x1a')](0x0);logger[_0xf12e('0x89')](_0xf12e('0x81'),_0x332ebd[_0xf12e('0x8a')]());return db['sequelize'][_0xf12e('0x2f')](_0x332ebd[_0xf12e('0x8a')](),{'type':db[_0xf12e('0x82')][_0xf12e('0x8b')][_0xf12e('0x83')]});}})[_0xf12e('0x21')](function(_0x4829fc){if(!_0x4829fc[_0xf12e('0x35')]){throw new db['Sequelize'][(_0xf12e('0x6a'))](_0xf12e('0x8c'),0xcc);}if(_0x1f5b7a[_0xf12e('0x8d')]==='web'){return null;}var _0x45cfca=_[_0xf12e('0x3c')](_0x1f5b7a,{'name':_0x1f5b7a[_0xf12e('0x8e')]||_0x1f5b7a['name']||_0x36dbf9[_0xf12e('0x27')],'basename':_0x3810f3,'savename':util[_0xf12e('0x74')](_0xf12e('0x8f'),_0x1f5b7a[_0xf12e('0x27')]||_0x36dbf9[_0xf12e('0x27')],require('randomstring')[_0xf12e('0x90')](0x4),_0x1f5b7a[_0xf12e('0x8d')]||_0xf12e('0x91')),'reportId':_0x36dbf9['id'],'reportType':_0xf12e('0x92')});return db[_0xf12e('0x93')][_0xf12e('0x47')](_0x45cfca,{'raw':!![]});})['then'](function(_0x2a4b80){if(_0x36dbf9[_0xf12e('0x70')]===_0xf12e('0x94')){_0x506fa1[_0xf12e('0x39')](_0x36dbf9[_0xf12e('0x70')]+_0xf12e('0x95'),_0x1f5b7a[_0xf12e('0x96')],_0x1f5b7a[_0xf12e('0x97')]);}else{_0x506fa1[_0xf12e('0x39')](_0x36dbf9['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x1f5b7a[_0xf12e('0x96')],_0x1f5b7a[_0xf12e('0x97')]);}if(_0x2a4b80){logger[_0xf12e('0x98')](_0xf12e('0x99'),_0x506fa1[_0xf12e('0x8a')]());require(_0xf12e('0x9a'))['fork'](path[_0xf12e('0x84')](__dirname,_0xf12e('0x9b'),_0x2a4b80['output']),[_0x2a4b80['id'],_0x506fa1[_0xf12e('0x8a')](),path[_0xf12e('0x84')](__dirname,'../../files/reports',_0x2a4b80['savename']),_0x3810f3]);return _0x2a4b80;}else{var _0x3f2763=squel[_0xf12e('0x6e')]();_0x3f2763[_0xf12e('0x6f')]('('+_0x506fa1[_0xf12e('0x8a')]()+')','countTable');_0x3f2763[_0xf12e('0x64')](_0xf12e('0x9c'),_0xf12e('0x19'));_0x506fa1[_0xf12e('0x1b')](_0x1f5b7a[_0xf12e('0x1b')]||_0x22544c);_0x506fa1['offset'](_0x1f5b7a['offset']||0x0);return db[_0xf12e('0x82')]['query'](_0x3f2763[_0xf12e('0x8a')](),{'type':db[_0xf12e('0x82')][_0xf12e('0x8b')][_0xf12e('0x83')]})[_0xf12e('0x21')](function(_0x9cd693){if(!_0x9cd693[_0xf12e('0x35')]){_0x32561d=0x0;}else{_0x32561d=_0x9cd693[0x0][_0xf12e('0x19')]||0x0;}return db[_0xf12e('0x82')][_0xf12e('0x2f')](_0x506fa1[_0xf12e('0x8a')](),{'type':db[_0xf12e('0x82')][_0xf12e('0x8b')][_0xf12e('0x83')]});})[_0xf12e('0x21')](function(_0x15e8ae){return{'rows':_0x15e8ae||[],'count':_0x32561d};});}});}exports[_0xf12e('0x9d')]=function(_0x1800d1,_0x129e31){return runReport(_0x1800d1[_0xf12e('0x44')],_0x1800d1[_0xf12e('0x2f')],_0x1800d1[_0xf12e('0x67')])[_0xf12e('0x21')](respondWithResult(_0x129e31,null))['catch'](handleError(_0x129e31,null));};exports[_0xf12e('0x9e')]=runReport;exports[_0xf12e('0x2f')]=function(_0x524265,_0x17cdcb){var _0xc0358b=0xa;var _0x4f4485=['join',_0xf12e('0x50'),_0xf12e('0x51'),_0xf12e('0x85')];var _0x1a1e73={'SUM':_0xf12e('0x52'),'COUNT':_0xf12e('0x53'),'COUNT DISTINCT':_0xf12e('0x54'),'MAX':_0xf12e('0x55'),'MIN':_0xf12e('0x56'),'AVG':_0xf12e('0x57'),'GROUP_CONCAT':_0xf12e('0x86'),'GROUP_CONCAT ASC':_0xf12e('0x58'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5c8dcc={'SEC_TO_TIME':_0xf12e('0x9f'),'DATE':_0xf12e('0x5a'),'HOUR':_0xf12e('0xa0'),'ROUND':_0xf12e('0x5b'),'UNIX_TIMESTAMP':_0xf12e('0x5c')};var _0x1a321e=function(_0x1b1beb){return!_[_0xf12e('0x5d')]([_0xf12e('0x5e'),_0xf12e('0x5f'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x1b1beb);};var _0x161c3e=function(_0x1eea1d){if(!_0x1eea1d||!_0x1eea1d[_0xf12e('0x62')][_0xf12e('0x35')]){return'';}for(var _0x330a8d='(',_0x1d2c7c=0x0;_0x1d2c7c<_0x1eea1d[_0xf12e('0x62')][_0xf12e('0x35')];_0x1d2c7c+=0x1){_0x1d2c7c>0x0&&(_0x330a8d+='\x20'+_0x1eea1d['operator']+'\x20');_0x330a8d+=_0x1eea1d[_0xf12e('0x62')][_0x1d2c7c][_0xf12e('0x63')]?_0x161c3e(_0x1eea1d['rules'][_0x1d2c7c]['group']):_0x1eea1d[_0xf12e('0x62')][_0x1d2c7c][_0xf12e('0x64')]+'\x20'+_0x1eea1d[_0xf12e('0x62')][_0x1d2c7c]['condition']+(_0x1a321e(_0x1eea1d[_0xf12e('0x62')][_0x1d2c7c][_0xf12e('0x65')])?'\x20'+_0x1eea1d[_0xf12e('0x62')][_0x1d2c7c][_0xf12e('0x66')]:'');}return _0x330a8d+')';};var _0x123643={'where':{'id':_0x524265[_0xf12e('0x44')]['id']}},_0x517728,_0x4da00d,_0x3be145,_0x1c55cb,_0x29c5e5;_0x123643=_[_0xf12e('0x3c')]({},_0x123643,_0x524265[_0xf12e('0x67')]);return db[_0xf12e('0x2b')][_0xf12e('0x45')](_0x123643)[_0xf12e('0x21')](function(_0x2e1035){if(_0x2e1035){_0x517728=_0x2e1035;return _0x2e1035[_0xf12e('0x68')]();}return null;})[_0xf12e('0x21')](function(_0x369ebb){if(_0x369ebb){if(!_0x369ebb[_0xf12e('0x35')]){throw new db['Sequelize'][(_0xf12e('0x6a'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4da00d=_0x369ebb;return db[_0xf12e('0x6c')][_0xf12e('0x41')]({'raw':!![]});}return null;})[_0xf12e('0x21')](function(_0x63a009){if(_0x63a009){_0x3be145=_[_0xf12e('0x6d')](_0x63a009,'id');var _0x2f569f;var _0x22ee7c=squel[_0xf12e('0x6e')]();_0x22ee7c[_0xf12e('0x6f')](_0x517728[_0xf12e('0x70')]);for(var _0x42c5f8=0x0;_0x42c5f8<_0x4da00d['length'];_0x42c5f8+=0x1){_0x2f569f=_0x4da00d[_0x42c5f8][_0xf12e('0x71')]?_0x3be145[_0x4da00d[_0x42c5f8][_0xf12e('0x71')]][_0xf12e('0x72')]:_0x4da00d[_0x42c5f8][_0xf12e('0x64')];_0x2f569f=_0x4da00d[_0x42c5f8][_0xf12e('0x73')]?_[_0xf12e('0x87')](_0x1a1e73[_0x4da00d[_0x42c5f8][_0xf12e('0x73')]],'%s',_0x2f569f):_0x2f569f;_0x2f569f=_0x4da00d[_0x42c5f8]['format']?_[_0xf12e('0x87')](_0x5c8dcc[_0x4da00d[_0x42c5f8][_0xf12e('0x74')]],'%s',_0x2f569f):_0x2f569f;if(_0x4da00d[_0x42c5f8][_0xf12e('0x75')]){_0x22ee7c[_0xf12e('0x63')](_0x2f569f);}_0x4da00d[_0x42c5f8][_0xf12e('0x76')]&&_0x22ee7c[_0xf12e('0x77')](_0x2f569f,_0x4da00d[_0x42c5f8][_0xf12e('0x76')]===_0xf12e('0x88')?![]:!![]);_0x22ee7c[_0xf12e('0x64')](_0x2f569f,_0x4da00d[_0x42c5f8][_0xf12e('0x78')]||_0x2f569f);}if(_0x517728[_0xf12e('0x79')]){_0x517728[_0xf12e('0x79')]=JSON['parse'](_0x517728[_0xf12e('0x79')]);for(var _0xbf139e=0x0;_0xbf139e<_0x517728[_0xf12e('0x79')][_0xf12e('0x35')];_0xbf139e+=0x1){if(_0x517728[_0xf12e('0x79')][_0xbf139e][_0xf12e('0x3d')]&&_[_0xf12e('0x5d')](_0x4f4485,_0x517728[_0xf12e('0x79')][_0xbf139e][_0xf12e('0x3d')])&&_0x517728[_0xf12e('0x79')][_0xbf139e][_0xf12e('0x7b')]&&_0x517728[_0xf12e('0x79')][_0xbf139e][_0xf12e('0x7c')]&&_0x517728[_0xf12e('0x79')][_0xbf139e]['foreignKey']){_0x22ee7c[_0x517728[_0xf12e('0x79')][_0xbf139e][_0xf12e('0x3d')]](_0x517728[_0xf12e('0x79')][_0xbf139e][_0xf12e('0x7c')],null,util[_0xf12e('0x74')](_0xf12e('0x7e'),_0x517728[_0xf12e('0x70')],_0x517728['joins'][_0xbf139e][_0xf12e('0x7b')],_0x517728['joins'][_0xbf139e][_0xf12e('0x7c')],_0x517728['joins'][_0xbf139e][_0xf12e('0x7d')]));}}}if(_0x517728[_0xf12e('0x7f')]){_0x517728['conditions']=JSON[_0xf12e('0x7a')](_0x517728['conditions']);_0x22ee7c[_0xf12e('0x39')](_0x161c3e(_0x517728['conditions'][_0xf12e('0x63')]));}_0x29c5e5=_0x22ee7c['clone']();_0x22ee7c[_0xf12e('0x1b')](_0xc0358b);_0x22ee7c[_0xf12e('0x1a')](0x0);logger[_0xf12e('0x89')](_0xf12e('0x81'),_0x22ee7c[_0xf12e('0x8a')]());return db[_0xf12e('0x82')][_0xf12e('0x2f')](_0x22ee7c[_0xf12e('0x8a')](),{'type':db['sequelize']['QueryTypes']['SELECT']});}})[_0xf12e('0x21')](function(){return{'sql':_0x29c5e5['toString']()};})['then'](respondWithResult(_0x17cdcb,null))[_0xf12e('0x46')](handleError(_0x17cdcb,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 3c91512..26eb7ef 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 _0x3679=['bluebird','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','lodash','../../config/logger','api','moment'];(function(_0x128787,_0x3626b6){var _0x23500f=function(_0xc29527){while(--_0xc29527){_0x128787['push'](_0x128787['shift']());}};_0x23500f(++_0x3626b6);}(_0x3679,0x98));var _0x9367=function(_0x566359,_0xc9a4b9){_0x566359=_0x566359-0x0;var _0x3142b4=_0x3679[_0x566359];return _0x3142b4;};'use strict';var _=require(_0x9367('0x0'));var util=require('util');var logger=require(_0x9367('0x1'))(_0x9367('0x2'));var moment=require(_0x9367('0x3'));var BPromise=require(_0x9367('0x4'));var rp=require(_0x9367('0x5'));var fs=require('fs');var path=require(_0x9367('0x6'));var rimraf=require(_0x9367('0x7'));var config=require(_0x9367('0x8'));var attributes=require(_0x9367('0x9'));module[_0x9367('0xa')]=function(_0x8737e4,_0x17f811){return _0x8737e4[_0x9367('0xb')]('AnalyticCustomReport',attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfb32=['rimraf','exports','define','analytics_custom_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x4ce18a,_0x3fc4b6){var _0x5635cc=function(_0x56ccf0){while(--_0x56ccf0){_0x4ce18a['push'](_0x4ce18a['shift']());}};_0x5635cc(++_0x3fc4b6);}(_0xfb32,0x1d8));var _0x2fb3=function(_0x158f01,_0x12af3e){_0x158f01=_0x158f01-0x0;var _0x5ef74e=_0xfb32[_0x158f01];return _0x5ef74e;};'use strict';var _=require(_0x2fb3('0x0'));var util=require(_0x2fb3('0x1'));var logger=require(_0x2fb3('0x2'))(_0x2fb3('0x3'));var moment=require(_0x2fb3('0x4'));var BPromise=require(_0x2fb3('0x5'));var rp=require(_0x2fb3('0x6'));var fs=require('fs');var path=require(_0x2fb3('0x7'));var rimraf=require(_0x2fb3('0x8'));var config=require('../../config/environment');var attributes=require('./analyticCustomReport.attributes');module[_0x2fb3('0x9')]=function(_0x206e1c,_0x1e3fea){return _0x206e1c[_0x2fb3('0xa')]('AnalyticCustomReport',attributes,{'tableName':_0x2fb3('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js index 888f551..0f2f5f7 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 _0xab28=['info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','AnalyticCustomReport,\x20%s,\x20%s','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x59f0ff,_0x2b9d67){var _0x28e782=function(_0x437e09){while(--_0x437e09){_0x59f0ff['push'](_0x59f0ff['shift']());}};_0x28e782(++_0x2b9d67);}(_0xab28,0x193));var _0x8ab2=function(_0x2faaba,_0x3f2b50){_0x2faaba=_0x2faaba-0x0;var _0x7099d9=_0xab28[_0x2faaba];return _0x7099d9;};'use strict';var _=require(_0x8ab2('0x0'));var util=require(_0x8ab2('0x1'));var moment=require(_0x8ab2('0x2'));var BPromise=require(_0x8ab2('0x3'));var rs=require(_0x8ab2('0x4'));var fs=require('fs');var Redis=require(_0x8ab2('0x5'));var db=require(_0x8ab2('0x6'))['db'];var utils=require(_0x8ab2('0x7'));var logger=require(_0x8ab2('0x8'))(_0x8ab2('0x9'));var config=require(_0x8ab2('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8ab2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x152fc1,_0x4ec9c6,_0x30abde){return new BPromise(function(_0x2e4672,_0x4b667e){return client[_0x8ab2('0xc')](_0x152fc1,_0x30abde)[_0x8ab2('0xd')](function(_0x19260c){logger['info'](_0x8ab2('0xe'),_0x4ec9c6,'request\x20sent');logger[_0x8ab2('0xf')](_0x8ab2('0x10'),_0x4ec9c6,_0x8ab2('0x11'),JSON[_0x8ab2('0x12')](_0x19260c));if(_0x19260c[_0x8ab2('0x13')]){if(_0x19260c['error'][_0x8ab2('0x14')]===0x1f4){logger[_0x8ab2('0x13')](_0x8ab2('0xe'),_0x4ec9c6,_0x19260c[_0x8ab2('0x13')][_0x8ab2('0x15')]);return _0x4b667e(_0x19260c['error']['message']);}logger[_0x8ab2('0x13')](_0x8ab2('0xe'),_0x4ec9c6,_0x19260c[_0x8ab2('0x13')]['message']);return _0x2e4672(_0x19260c[_0x8ab2('0x13')][_0x8ab2('0x15')]);}else{logger[_0x8ab2('0x16')](_0x8ab2('0xe'),_0x4ec9c6,_0x8ab2('0x11'));_0x2e4672(_0x19260c[_0x8ab2('0x17')][_0x8ab2('0x15')]);}})[_0x8ab2('0x18')](function(_0x408842){logger[_0x8ab2('0x13')]('AnalyticCustomReport,\x20%s,\x20%s',_0x4ec9c6,_0x408842);_0x4b667e(_0x408842);});});} \ No newline at end of file +var _0x3713=['rpc','jayson/promise','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x4855db,_0x516493){var _0x30fd9c=function(_0x40dfc3){while(--_0x40dfc3){_0x4855db['push'](_0x4855db['shift']());}};_0x30fd9c(++_0x516493);}(_0x3713,0x180));var _0x3371=function(_0x30d782,_0x9a6d45){_0x30d782=_0x30d782-0x0;var _0x5753f5=_0x3713[_0x30d782];return _0x5753f5;};'use strict';var _=require(_0x3371('0x0'));var util=require(_0x3371('0x1'));var moment=require(_0x3371('0x2'));var BPromise=require(_0x3371('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3371('0x4'));var db=require(_0x3371('0x5'))['db'];var utils=require(_0x3371('0x6'));var logger=require('../../config/logger')(_0x3371('0x7'));var config=require('../../config/environment');var jayson=require(_0x3371('0x8'));var client=jayson[_0x3371('0x9')][_0x3371('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xcfbc88,_0x34642c,_0x186f5e){return new BPromise(function(_0x436bf9,_0x4ee4e1){return client[_0x3371('0xb')](_0xcfbc88,_0x186f5e)[_0x3371('0xc')](function(_0x43a091){logger[_0x3371('0xd')](_0x3371('0xe'),_0x34642c,_0x3371('0xf'));logger[_0x3371('0x10')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x34642c,_0x3371('0xf'),JSON[_0x3371('0x11')](_0x43a091));if(_0x43a091[_0x3371('0x12')]){if(_0x43a091['error'][_0x3371('0x13')]===0x1f4){logger['error'](_0x3371('0xe'),_0x34642c,_0x43a091['error'][_0x3371('0x14')]);return _0x4ee4e1(_0x43a091[_0x3371('0x12')][_0x3371('0x14')]);}logger[_0x3371('0x12')](_0x3371('0xe'),_0x34642c,_0x43a091[_0x3371('0x12')][_0x3371('0x14')]);return _0x436bf9(_0x43a091['error'][_0x3371('0x14')]);}else{logger[_0x3371('0xd')](_0x3371('0xe'),_0x34642c,_0x3371('0xf'));_0x436bf9(_0x43a091[_0x3371('0x15')][_0x3371('0x14')]);}})[_0x3371('0x16')](function(_0x792e1c){logger[_0x3371('0x12')](_0x3371('0xe'),_0x34642c,_0x792e1c);_0x4ee4e1(_0x792e1c);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index ab80aa8..f5788b0 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 _0xcbae=['put','update','/:id','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create'];(function(_0x3bf93e,_0x307b6f){var _0x4e6875=function(_0x3b875a){while(--_0x3b875a){_0x3bf93e['push'](_0x3bf93e['shift']());}};_0x4e6875(++_0x307b6f);}(_0xcbae,0xf5));var _0xecba=function(_0x1d6b3a,_0x50b0f9){_0x1d6b3a=_0x1d6b3a-0x0;var _0x5daa0c=_0xcbae[_0x1d6b3a];return _0x5daa0c;};'use strict';var multer=require('multer');var util=require(_0xecba('0x0'));var path=require('path');var timeout=require(_0xecba('0x1'));var express=require(_0xecba('0x2'));var router=express[_0xecba('0x3')]();var auth=require(_0xecba('0x4'));var interaction=require(_0xecba('0x5'));var config=require(_0xecba('0x6'));var controller=require('./analyticCustomReport.controller');router[_0xecba('0x7')]('/',auth[_0xecba('0x8')](),controller[_0xecba('0x9')]);router['get']('/:id',auth[_0xecba('0x8')](),controller[_0xecba('0xa')]);router['get'](_0xecba('0xb'),auth[_0xecba('0x8')](),controller[_0xecba('0xc')]);router[_0xecba('0x7')](_0xecba('0xd'),auth[_0xecba('0x8')](),controller[_0xecba('0xe')]);router[_0xecba('0x7')](_0xecba('0xf'),auth['isAuthenticated'](),controller[_0xecba('0x10')]);router[_0xecba('0x11')]('/',auth[_0xecba('0x8')](),controller[_0xecba('0x12')]);router[_0xecba('0x13')]('/:id',auth[_0xecba('0x8')](),controller[_0xecba('0x14')]);router['delete'](_0xecba('0x15'),auth[_0xecba('0x8')](),controller[_0xecba('0x16')]);module[_0xecba('0x17')]=router; \ No newline at end of file +var _0x6960=['put','update','delete','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','index','/:id','isAuthenticated','show','get','/:id/preview','/:id/run','run','/:id/query','post','create'];(function(_0x39b6a3,_0x4d6330){var _0xc83019=function(_0x1ab92c){while(--_0x1ab92c){_0x39b6a3['push'](_0x39b6a3['shift']());}};_0xc83019(++_0x4d6330);}(_0x6960,0x94));var _0x0696=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x6960[_0x3e5086];return _0xfeb102;};'use strict';var multer=require(_0x0696('0x0'));var util=require('util');var path=require(_0x0696('0x1'));var timeout=require(_0x0696('0x2'));var express=require(_0x0696('0x3'));var router=express[_0x0696('0x4')]();var auth=require(_0x0696('0x5'));var interaction=require(_0x0696('0x6'));var config=require(_0x0696('0x7'));var controller=require(_0x0696('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x0696('0x9')]);router['get'](_0x0696('0xa'),auth[_0x0696('0xb')](),controller[_0x0696('0xc')]);router[_0x0696('0xd')](_0x0696('0xe'),auth[_0x0696('0xb')](),controller['preview']);router[_0x0696('0xd')](_0x0696('0xf'),auth[_0x0696('0xb')](),controller[_0x0696('0x10')]);router[_0x0696('0xd')](_0x0696('0x11'),auth[_0x0696('0xb')](),controller['query']);router[_0x0696('0x12')]('/',auth[_0x0696('0xb')](),controller[_0x0696('0x13')]);router[_0x0696('0x14')]('/:id',auth[_0x0696('0xb')](),controller[_0x0696('0x15')]);router[_0x0696('0x16')](_0x0696('0xa'),auth[_0x0696('0xb')](),controller[_0x0696('0x17')]);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 9566588..b01844c 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 _0xd7a4=['exports','STRING','TEXT','sequelize'];(function(_0x438988,_0x2a86cf){var _0x1ce59f=function(_0x26f36a){while(--_0x26f36a){_0x438988['push'](_0x438988['shift']());}};_0x1ce59f(++_0x2a86cf);}(_0xd7a4,0x19f));var _0x4d7a=function(_0x43c7d1,_0x2d0e47){_0x43c7d1=_0x43c7d1-0x0;var _0x3712cc=_0xd7a4[_0x43c7d1];return _0x3712cc;};'use strict';var Sequelize=require(_0x4d7a('0x0'));module[_0x4d7a('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x4d7a('0x2')]},'parent':{'type':Sequelize[_0x4d7a('0x2')]},'table':{'type':Sequelize[_0x4d7a('0x2')]},'conditions':{'type':Sequelize[_0x4d7a('0x3')]},'joins':{'type':Sequelize[_0x4d7a('0x3')]}}; \ No newline at end of file +var _0x6e8b=['sequelize','STRING','TEXT'];(function(_0x56138f,_0x1e9ebb){var _0x1acaf7=function(_0x48690d){while(--_0x48690d){_0x56138f['push'](_0x56138f['shift']());}};_0x1acaf7(++_0x1e9ebb);}(_0x6e8b,0x75));var _0xb6e8=function(_0x2860ab,_0x27440f){_0x2860ab=_0x2860ab-0x0;var _0x3037c4=_0x6e8b[_0x2860ab];return _0x3037c4;};'use strict';var Sequelize=require(_0xb6e8('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xb6e8('0x1')]},'parent':{'type':Sequelize[_0xb6e8('0x1')]},'table':{'type':Sequelize[_0xb6e8('0x1')]},'conditions':{'type':Sequelize[_0xb6e8('0x2')]},'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 931db32..616d7a8 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 _0x2544=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','Content-Range','json','apply','reject','save','update','then','destroy','get','DefaultReports','UserProfileResource','end','error','stack','name','index','AnalyticDefaultReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','preview','join','left_join','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)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','operator','group','field','value','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','from','table','MetricId','function','replace','format','orderBy','DESC','alias','joins','parse','parentKey','foreignKey','foreignTable','conditions','debug','sequelize','toString','QueryTypes','SELECT','MAX(%s)','IS\x20NOT\x20EMPTY','condition','Please\x20insert\x20at\x20least\x20one\x20field','metric','groupBy','%s.%s\x20=\x20%s.%s','clone','Limited\x20Query:','No\x20available\x20data','web','fullPath','randomstring','generate','output','csv','cdr','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','select','countTable','run','runReport'];(function(_0x2714ec,_0x36daa4){var _0x2608e5=function(_0x408468){while(--_0x408468){_0x2714ec['push'](_0x2714ec['shift']());}};_0x2608e5(++_0x36daa4);}(_0x2544,0x1ec));var _0x4254=function(_0x5bab1e,_0x22a4fe){_0x5bab1e=_0x5bab1e-0x0;var _0x247d24=_0x2544[_0x5bab1e];return _0x247d24;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x4254('0x0'));var rimraf=require(_0x4254('0x1'));var zipdir=require(_0x4254('0x2'));var jsonpatch=require(_0x4254('0x3'));var rp=require('request-promise');var moment=require(_0x4254('0x4'));var BPromise=require(_0x4254('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4254('0x6'));var sox=require('sox');var csv=require(_0x4254('0x7'));var ejs=require(_0x4254('0x8'));var fs=require('fs');var _=require(_0x4254('0x9'));var squel=require(_0x4254('0xa'));var crypto=require(_0x4254('0xb'));var jsforce=require(_0x4254('0xc'));var deskjs=require(_0x4254('0xd'));var toCsv=require(_0x4254('0x7'));var querystring=require(_0x4254('0xe'));var Papa=require(_0x4254('0xf'));var Redis=require(_0x4254('0x10'));var authService=require(_0x4254('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x4254('0x12'));var config=require(_0x4254('0x13'));var db=require(_0x4254('0x14'))['db'];function respondWithStatusCode(_0x3ba6d2,_0x3ce95b){_0x3ce95b=_0x3ce95b||0xcc;return function(_0x52285a){if(_0x52285a){return _0x3ba6d2[_0x4254('0x15')](_0x3ce95b);}return _0x3ba6d2[_0x4254('0x16')](_0x3ce95b)['end']();};}function respondWithResult(_0x385e95,_0x164fd7){_0x164fd7=_0x164fd7||0xc8;return function(_0x48536e){if(_0x48536e){return _0x385e95[_0x4254('0x16')](_0x164fd7)['json'](_0x48536e);}};}function respondWithFilteredResult(_0x2f3d40,_0x5322c3){return function(_0x405664){if(_0x405664){var _0x47b816=_0x405664[_0x4254('0x17')],_0x466b84=_0x5322c3[_0x4254('0x18')],_0x56def8=_0x5322c3[_0x4254('0x18')]+_0x5322c3[_0x4254('0x19')],_0x4f3da2;if(_0x56def8>=_0x47b816){_0x56def8=_0x47b816;_0x4f3da2=0xc8;}else{_0x4f3da2=0xce;}_0x2f3d40[_0x4254('0x16')](_0x4f3da2);return _0x2f3d40['set'](_0x4254('0x1a'),_0x466b84+'-'+_0x56def8+'/'+_0x47b816)[_0x4254('0x1b')](_0x405664);}return null;};}function patchUpdates(_0x3075ce){return function(_0x5eb3d3){try{jsonpatch[_0x4254('0x1c')](_0x5eb3d3,_0x3075ce,!![]);}catch(_0x421a7a){return BPromise[_0x4254('0x1d')](_0x421a7a);}return _0x5eb3d3[_0x4254('0x1e')]();};}function saveUpdates(_0x554c2c,_0x5902e3){return function(_0x1c567b){if(_0x1c567b){return _0x1c567b[_0x4254('0x1f')](_0x554c2c)[_0x4254('0x20')](function(_0x412045){return _0x412045;});}return null;};}function removeEntity(_0xf3b761,_0x44e6a8){return function(_0x324bed){if(_0x324bed){return _0x324bed[_0x4254('0x21')]()['then'](function(){var _0x14c877=_0x324bed[_0x4254('0x22')]({'plain':!![]});var _0x57b862=_0x4254('0x23');return db[_0x4254('0x24')]['destroy']({'where':{'type':_0x57b862,'resourceId':_0x14c877['id']}})[_0x4254('0x20')](function(){return _0x324bed;});})[_0x4254('0x20')](function(){_0xf3b761[_0x4254('0x16')](0xcc)[_0x4254('0x25')]();});}};}function handleEntityNotFound(_0x102028,_0x29180a){return function(_0x45e6b8){if(!_0x45e6b8){_0x102028[_0x4254('0x15')](0x194);}return _0x45e6b8;};}function handleError(_0x545f70,_0x49fc90){_0x49fc90=_0x49fc90||0x1f4;return function(_0x2426be){logger[_0x4254('0x26')](_0x2426be[_0x4254('0x27')]);if(_0x2426be[_0x4254('0x28')]){delete _0x2426be[_0x4254('0x28')];}_0x545f70[_0x4254('0x16')](_0x49fc90)['send'](_0x2426be);};}exports[_0x4254('0x29')]=function(_0x1600cf,_0x14d55a){var _0x41f705={},_0x5d2fd0={},_0x3ba70c={'count':0x0,'rows':[]};var _0x4f3f41=_['map'](db[_0x4254('0x2a')][_0x4254('0x2b')],function(_0xca7803){return{'name':_0xca7803[_0x4254('0x2c')],'type':_0xca7803['type'][_0x4254('0x2d')]};});_0x5d2fd0[_0x4254('0x2e')]=_[_0x4254('0x2f')](_0x4f3f41,_0x4254('0x28'));_0x5d2fd0[_0x4254('0x30')]=_[_0x4254('0x31')](_0x1600cf[_0x4254('0x30')]);_0x5d2fd0[_0x4254('0x32')]=_[_0x4254('0x33')](_0x5d2fd0[_0x4254('0x2e')],_0x5d2fd0[_0x4254('0x30')]);_0x41f705[_0x4254('0x34')]=_[_0x4254('0x33')](_0x5d2fd0[_0x4254('0x2e')],qs[_0x4254('0x35')](_0x1600cf[_0x4254('0x30')][_0x4254('0x35')]));_0x41f705[_0x4254('0x34')]=_0x41f705[_0x4254('0x34')][_0x4254('0x36')]?_0x41f705[_0x4254('0x34')]:_0x5d2fd0[_0x4254('0x2e')];if(!_0x1600cf[_0x4254('0x30')][_0x4254('0x37')](_0x4254('0x38'))){_0x41f705[_0x4254('0x19')]=qs[_0x4254('0x19')](_0x1600cf[_0x4254('0x30')][_0x4254('0x19')]);_0x41f705[_0x4254('0x18')]=qs[_0x4254('0x18')](_0x1600cf[_0x4254('0x30')][_0x4254('0x18')]);}_0x41f705[_0x4254('0x39')]=qs[_0x4254('0x3a')](_0x1600cf[_0x4254('0x30')][_0x4254('0x3a')]);_0x41f705['where']=qs[_0x4254('0x32')](_[_0x4254('0x3b')](_0x1600cf['query'],_0x5d2fd0[_0x4254('0x32')]));if(_0x1600cf['query'][_0x4254('0x3c')]){_0x41f705[_0x4254('0x3d')]=_['merge'](_0x41f705[_0x4254('0x3d')],{'$or':_['map'](_0x4f3f41,function(_0x1330ea){if(_0x1330ea[_0x4254('0x3e')]!==_0x4254('0x3f')){var _0x3ac097={};_0x3ac097[_0x1330ea[_0x4254('0x28')]]={'$like':'%'+_0x1600cf['query'][_0x4254('0x3c')]+'%'};return _0x3ac097;}})});}_0x41f705=_[_0x4254('0x40')]({},_0x41f705,_0x1600cf[_0x4254('0x41')]);var _0xc6e36b={'where':_0x41f705[_0x4254('0x3d')]};return db['AnalyticDefaultReport'][_0x4254('0x17')](_0xc6e36b)['then'](function(_0x2e1e4a){_0x3ba70c['count']=_0x2e1e4a;if(_0x1600cf['query'][_0x4254('0x42')]){_0x41f705[_0x4254('0x43')]=[{'all':!![]}];}return db[_0x4254('0x2a')][_0x4254('0x44')](_0x41f705);})['then'](function(_0xa86c6b){_0x3ba70c[_0x4254('0x45')]=_0xa86c6b;return _0x3ba70c;})[_0x4254('0x20')](respondWithFilteredResult(_0x14d55a,_0x41f705))[_0x4254('0x46')](handleError(_0x14d55a,null));};exports['show']=function(_0x415f00,_0x59116f){var _0x4709b6={'raw':!![],'where':{'id':_0x415f00[_0x4254('0x47')]['id']}},_0x182ba5={};_0x182ba5[_0x4254('0x2e')]=_['keys'](db[_0x4254('0x2a')][_0x4254('0x2b')]);_0x182ba5[_0x4254('0x30')]=_[_0x4254('0x31')](_0x415f00[_0x4254('0x30')]);_0x182ba5[_0x4254('0x32')]=_[_0x4254('0x33')](_0x182ba5[_0x4254('0x2e')],_0x182ba5[_0x4254('0x30')]);_0x4709b6[_0x4254('0x34')]=_['intersection'](_0x182ba5['model'],qs[_0x4254('0x35')](_0x415f00[_0x4254('0x30')][_0x4254('0x35')]));_0x4709b6[_0x4254('0x34')]=_0x4709b6['attributes'][_0x4254('0x36')]?_0x4709b6[_0x4254('0x34')]:_0x182ba5[_0x4254('0x2e')];if(_0x415f00['query'][_0x4254('0x42')]){_0x4709b6[_0x4254('0x43')]=[{'all':!![]}];}_0x4709b6=_[_0x4254('0x40')]({},_0x4709b6,_0x415f00[_0x4254('0x41')]);return db[_0x4254('0x2a')]['find'](_0x4709b6)['then'](handleEntityNotFound(_0x59116f,null))[_0x4254('0x20')](respondWithResult(_0x59116f,null))[_0x4254('0x46')](handleError(_0x59116f,null));};exports['create']=function(_0x1a878a,_0x1b6865){return db[_0x4254('0x2a')][_0x4254('0x48')](_0x1a878a['body'],{})[_0x4254('0x20')](function(_0x2cc095){var _0x84836f=_0x1a878a[_0x4254('0x49')][_0x4254('0x22')]({'plain':!![]});if(!_0x84836f)throw new Error(_0x4254('0x4a'));if(_0x84836f['role']===_0x4254('0x49')){var _0x5abab3=_0x2cc095[_0x4254('0x22')]({'plain':!![]});var _0xc2a60c=_0x4254('0x4b');return db[_0x4254('0x4c')][_0x4254('0x4d')]({'where':{'name':_0xc2a60c,'userProfileId':_0x84836f['userProfileId']},'raw':!![]})['then'](function(_0xa35aff){if(_0xa35aff&&_0xa35aff[_0x4254('0x4e')]===0x0){return db[_0x4254('0x24')][_0x4254('0x48')]({'name':_0x5abab3[_0x4254('0x28')],'resourceId':_0x5abab3['id'],'type':'DefaultReports','sectionId':_0xa35aff['id']},{})[_0x4254('0x20')](function(){return _0x2cc095;});}else{return _0x2cc095;}})[_0x4254('0x46')](function(_0x1d8c43){logger[_0x4254('0x26')](_0x4254('0x4f'),_0x1d8c43);throw _0x1d8c43;});}return _0x2cc095;})[_0x4254('0x20')](respondWithResult(_0x1b6865,0xc9))[_0x4254('0x46')](handleError(_0x1b6865,null));};exports[_0x4254('0x1f')]=function(_0xe37cbb,_0x45803b){if(_0xe37cbb[_0x4254('0x50')]['id']){delete _0xe37cbb[_0x4254('0x50')]['id'];}return db['AnalyticDefaultReport'][_0x4254('0x4d')]({'where':{'id':_0xe37cbb['params']['id']}})[_0x4254('0x20')](handleEntityNotFound(_0x45803b,null))['then'](saveUpdates(_0xe37cbb[_0x4254('0x50')],null))[_0x4254('0x20')](respondWithResult(_0x45803b,null))[_0x4254('0x46')](handleError(_0x45803b,null));};exports[_0x4254('0x21')]=function(_0xe6d1a9,_0x4fe95f){return db[_0x4254('0x2a')]['find']({'where':{'id':_0xe6d1a9[_0x4254('0x47')]['id']}})[_0x4254('0x20')](handleEntityNotFound(_0x4fe95f,null))[_0x4254('0x20')](removeEntity(_0x4fe95f,null))['catch'](handleError(_0x4fe95f,null));};exports[_0x4254('0x51')]=function(_0x292836,_0x3c6ec7){var _0x2e434e=0xa;var _0x58b63f=[_0x4254('0x52'),_0x4254('0x53'),_0x4254('0x54'),_0x4254('0x55')];var _0x23869f={'SUM':_0x4254('0x56'),'COUNT':_0x4254('0x57'),'COUNT DISTINCT':_0x4254('0x58'),'MAX':'MAX(%s)','MIN':_0x4254('0x59'),'AVG':_0x4254('0x5a'),'GROUP_CONCAT':_0x4254('0x5b'),'GROUP_CONCAT ASC':_0x4254('0x5c'),'GROUP_CONCAT DESC':_0x4254('0x5d')};var _0x491877={'SEC_TO_TIME':_0x4254('0x5e'),'DATE':_0x4254('0x5f'),'HOUR':_0x4254('0x60'),'ROUND':_0x4254('0x61'),'UNIX_TIMESTAMP':_0x4254('0x62')};var _0x583be8=function(_0x4de594){return!_[_0x4254('0x63')]([_0x4254('0x64'),_0x4254('0x65'),_0x4254('0x66'),'IS\x20NOT\x20EMPTY'],_0x4de594);};var _0x1261e1=function(_0x5df5cc){if(!_0x5df5cc||!_0x5df5cc[_0x4254('0x67')]['length']){return'';}for(var _0x3fc1fb='(',_0x1e1c45=0x0;_0x1e1c45<_0x5df5cc[_0x4254('0x67')][_0x4254('0x36')];_0x1e1c45+=0x1){_0x1e1c45>0x0&&(_0x3fc1fb+='\x20'+_0x5df5cc[_0x4254('0x68')]+'\x20');_0x3fc1fb+=_0x5df5cc[_0x4254('0x67')][_0x1e1c45][_0x4254('0x69')]?_0x1261e1(_0x5df5cc[_0x4254('0x67')][_0x1e1c45][_0x4254('0x69')]):_0x5df5cc[_0x4254('0x67')][_0x1e1c45][_0x4254('0x6a')]+'\x20'+_0x5df5cc[_0x4254('0x67')][_0x1e1c45]['condition']+(_0x583be8(_0x5df5cc[_0x4254('0x67')][_0x1e1c45]['condition'])?'\x20'+_0x5df5cc[_0x4254('0x67')][_0x1e1c45][_0x4254('0x6b')]:'');}return _0x3fc1fb+')';};var _0x30c8cf={'where':{'id':_0x292836[_0x4254('0x47')]['id']}},_0x125490,_0x2039e0,_0x720c82,_0x5cdfe2,_0x5a660e;_0x30c8cf=_['merge']({},_0x30c8cf,_0x292836[_0x4254('0x41')]);return db[_0x4254('0x2a')][_0x4254('0x4d')](_0x30c8cf)['then'](function(_0x52af7f){if(_0x52af7f){_0x125490=_0x52af7f;return _0x52af7f[_0x4254('0x6c')]();}return null;})[_0x4254('0x20')](function(_0x186412){if(_0x186412){if(!_0x186412['length']){throw new db[(_0x4254('0x6d'))][(_0x4254('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2039e0=_0x186412;return db[_0x4254('0x6f')][_0x4254('0x44')]({'raw':!![]});}return null;})[_0x4254('0x20')](function(_0x2bd957){if(_0x2bd957){_0x720c82=_[_0x4254('0x70')](_0x2bd957,'id');var _0x218474;var _0x2b6486=squel['select']();_0x2b6486[_0x4254('0x71')](_0x125490[_0x4254('0x72')]);for(var _0x266ad7=0x0;_0x266ad7<_0x2039e0[_0x4254('0x36')];_0x266ad7+=0x1){_0x218474=_0x2039e0[_0x266ad7][_0x4254('0x73')]?_0x720c82[_0x2039e0[_0x266ad7]['MetricId']]['metric']:_0x2039e0[_0x266ad7][_0x4254('0x6a')];_0x218474=_0x2039e0[_0x266ad7][_0x4254('0x74')]?_[_0x4254('0x75')](_0x23869f[_0x2039e0[_0x266ad7][_0x4254('0x74')]],'%s',_0x218474):_0x218474;_0x218474=_0x2039e0[_0x266ad7][_0x4254('0x76')]?_[_0x4254('0x75')](_0x491877[_0x2039e0[_0x266ad7][_0x4254('0x76')]],'%s',_0x218474):_0x218474;if(_0x2039e0[_0x266ad7]['groupBy']){_0x2b6486[_0x4254('0x69')](_0x218474);}_0x2039e0[_0x266ad7][_0x4254('0x77')]&&_0x2b6486[_0x4254('0x39')](_0x218474,_0x2039e0[_0x266ad7][_0x4254('0x77')]===_0x4254('0x78')?![]:!![]);_0x2b6486[_0x4254('0x6a')](_0x218474,_0x2039e0[_0x266ad7][_0x4254('0x79')]||_0x218474);}if(_0x125490[_0x4254('0x7a')]){_0x125490[_0x4254('0x7a')]=JSON[_0x4254('0x7b')](_0x125490['joins']);for(var _0x4be58e=0x0;_0x4be58e<_0x125490['joins'][_0x4254('0x36')];_0x4be58e+=0x1){if(_0x125490['joins'][_0x4be58e][_0x4254('0x3e')]&&_['includes'](_0x58b63f,_0x125490[_0x4254('0x7a')][_0x4be58e][_0x4254('0x3e')])&&_0x125490[_0x4254('0x7a')][_0x4be58e][_0x4254('0x7c')]&&_0x125490['joins'][_0x4be58e]['foreignTable']&&_0x125490[_0x4254('0x7a')][_0x4be58e][_0x4254('0x7d')]){_0x2b6486[_0x125490[_0x4254('0x7a')][_0x4be58e][_0x4254('0x3e')]](_0x125490['joins'][_0x4be58e][_0x4254('0x7e')],null,util[_0x4254('0x76')]('%s.%s\x20=\x20%s.%s',_0x125490[_0x4254('0x72')],_0x125490['joins'][_0x4be58e][_0x4254('0x7c')],_0x125490[_0x4254('0x7a')][_0x4be58e][_0x4254('0x7e')],_0x125490[_0x4254('0x7a')][_0x4be58e][_0x4254('0x7d')]));}}}if(_0x125490[_0x4254('0x7f')]){_0x125490['conditions']=JSON[_0x4254('0x7b')](_0x125490['conditions']);_0x2b6486[_0x4254('0x3d')](_0x1261e1(_0x125490[_0x4254('0x7f')]['group']));}_0x5a660e=_0x2b6486['clone']();_0x2b6486['limit'](_0x2e434e);_0x2b6486[_0x4254('0x18')](0x0);logger[_0x4254('0x80')]('Limited\x20Query:',_0x2b6486['toString']());return db[_0x4254('0x81')]['query'](_0x2b6486[_0x4254('0x82')](),{'type':db['sequelize'][_0x4254('0x83')][_0x4254('0x84')]});}})[_0x4254('0x20')](respondWithResult(_0x3c6ec7,null))[_0x4254('0x46')](handleError(_0x3c6ec7,null));};function runReport(_0x4a0f07,_0xdbaeef,_0x192a1f){var _0x34e279=_0xdbaeef[_0x4254('0x28')];var _0x5ebfba=0xa;var _0x48a478=[_0x4254('0x52'),_0x4254('0x53'),_0x4254('0x54'),_0x4254('0x55')];var _0x48449e={'SUM':_0x4254('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x4254('0x85'),'MIN':_0x4254('0x59'),'AVG':_0x4254('0x5a'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4254('0x5d')};var _0x1f2c5={'SEC_TO_TIME':_0x4254('0x5e'),'DATE':_0x4254('0x5f'),'HOUR':_0x4254('0x60'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x4254('0x62')};var _0xa3e33f=function(_0x22eef8){return!_['includes']([_0x4254('0x64'),_0x4254('0x65'),'IS\x20EMPTY',_0x4254('0x86')],_0x22eef8);};var _0x4a6d77=function(_0x4cf686){if(!_0x4cf686||!_0x4cf686['rules'][_0x4254('0x36')]){return'';}for(var _0x4a23aa='(',_0x134c3e=0x0;_0x134c3e<_0x4cf686['rules'][_0x4254('0x36')];_0x134c3e+=0x1){_0x134c3e>0x0&&(_0x4a23aa+='\x20'+_0x4cf686[_0x4254('0x68')]+'\x20');_0x4a23aa+=_0x4cf686[_0x4254('0x67')][_0x134c3e][_0x4254('0x69')]?_0x4a6d77(_0x4cf686['rules'][_0x134c3e][_0x4254('0x69')]):_0x4cf686['rules'][_0x134c3e][_0x4254('0x6a')]+'\x20'+_0x4cf686[_0x4254('0x67')][_0x134c3e][_0x4254('0x87')]+(_0xa3e33f(_0x4cf686[_0x4254('0x67')][_0x134c3e][_0x4254('0x87')])?'\x20'+_0x4cf686['rules'][_0x134c3e][_0x4254('0x6b')]:'');}return _0x4a23aa+')';};var _0x1eb1ac={'where':{'id':_0x4a0f07['id']}},_0x3b6743,_0x3e0730,_0x4a0107,_0x1fbb6b,_0x32a790;_0x1eb1ac=_['merge']({},_0x1eb1ac,_0x192a1f);return db[_0x4254('0x2a')][_0x4254('0x4d')](_0x1eb1ac)['then'](function(_0x1403a6){if(_0x1403a6){_0x3b6743=_0x1403a6;return _0x1403a6['getFields']();}return null;})[_0x4254('0x20')](function(_0x24d686){if(_0x24d686){if(!_0x24d686[_0x4254('0x36')]){throw new db['Sequelize'][(_0x4254('0x6e'))](_0x4254('0x88'),0x193);}_0x3e0730=_0x24d686;return db[_0x4254('0x6f')][_0x4254('0x44')]({'raw':!![]});}return null;})['then'](function(_0x434db3){if(_0x434db3){_0x4a0107=_[_0x4254('0x70')](_0x434db3,'id');var _0x2960a1;var _0x8d9e99=squel['select']();_0x8d9e99[_0x4254('0x71')](_0x3b6743[_0x4254('0x72')]);for(var _0xa22f3e=0x0;_0xa22f3e<_0x3e0730['length'];_0xa22f3e+=0x1){_0x2960a1=_0x3e0730[_0xa22f3e][_0x4254('0x73')]?_0x4a0107[_0x3e0730[_0xa22f3e][_0x4254('0x73')]][_0x4254('0x89')]:_0x3e0730[_0xa22f3e][_0x4254('0x6a')];_0x2960a1=_0x3e0730[_0xa22f3e][_0x4254('0x74')]?_[_0x4254('0x75')](_0x48449e[_0x3e0730[_0xa22f3e][_0x4254('0x74')]],'%s',_0x2960a1):_0x2960a1;_0x2960a1=_0x3e0730[_0xa22f3e][_0x4254('0x76')]?_['replace'](_0x1f2c5[_0x3e0730[_0xa22f3e]['format']],'%s',_0x2960a1):_0x2960a1;if(_0x3e0730[_0xa22f3e][_0x4254('0x8a')]){_0x8d9e99['group'](_0x2960a1);}_0x3e0730[_0xa22f3e][_0x4254('0x77')]&&_0x8d9e99[_0x4254('0x39')](_0x2960a1,_0x3e0730[_0xa22f3e]['orderBy']===_0x4254('0x78')?![]:!![]);_0x8d9e99[_0x4254('0x6a')](_0x2960a1,_0x3e0730[_0xa22f3e][_0x4254('0x79')]||_0x2960a1);}if(_0x3b6743[_0x4254('0x7a')]){_0x3b6743[_0x4254('0x7a')]=JSON[_0x4254('0x7b')](_0x3b6743[_0x4254('0x7a')]);for(var _0x22b153=0x0;_0x22b153<_0x3b6743[_0x4254('0x7a')]['length'];_0x22b153+=0x1){if(_0x3b6743[_0x4254('0x7a')][_0x22b153][_0x4254('0x3e')]&&_[_0x4254('0x63')](_0x48a478,_0x3b6743['joins'][_0x22b153][_0x4254('0x3e')])&&_0x3b6743[_0x4254('0x7a')][_0x22b153][_0x4254('0x7c')]&&_0x3b6743[_0x4254('0x7a')][_0x22b153][_0x4254('0x7e')]&&_0x3b6743['joins'][_0x22b153]['foreignKey']){_0x8d9e99[_0x3b6743[_0x4254('0x7a')][_0x22b153][_0x4254('0x3e')]](_0x3b6743[_0x4254('0x7a')][_0x22b153][_0x4254('0x7e')],null,util[_0x4254('0x76')](_0x4254('0x8b'),_0x3b6743[_0x4254('0x72')],_0x3b6743['joins'][_0x22b153][_0x4254('0x7c')],_0x3b6743['joins'][_0x22b153]['foreignTable'],_0x3b6743['joins'][_0x22b153][_0x4254('0x7d')]));}}}if(_0x3b6743[_0x4254('0x7f')]){_0x3b6743['conditions']=JSON[_0x4254('0x7b')](_0x3b6743[_0x4254('0x7f')]);_0x8d9e99[_0x4254('0x3d')](_0x4a6d77(_0x3b6743[_0x4254('0x7f')][_0x4254('0x69')]));}_0x32a790=_0x8d9e99[_0x4254('0x8c')]();_0x8d9e99[_0x4254('0x19')](_0x5ebfba);_0x8d9e99[_0x4254('0x18')](0x0);logger[_0x4254('0x80')](_0x4254('0x8d'),_0x8d9e99[_0x4254('0x82')]());return db[_0x4254('0x81')]['query'](_0x8d9e99['toString'](),{'type':db['sequelize'][_0x4254('0x83')][_0x4254('0x84')]});}})[_0x4254('0x20')](function(_0x37f047){if(!_0x37f047[_0x4254('0x36')]){throw new db['Sequelize'][(_0x4254('0x6e'))](_0x4254('0x8e'),0xcc);}if(_0xdbaeef['output']===_0x4254('0x8f')){return null;}var _0x4e1808=_[_0x4254('0x40')](_0xdbaeef,{'name':_0xdbaeef[_0x4254('0x90')]||_0xdbaeef[_0x4254('0x28')]||_0x3b6743[_0x4254('0x28')],'basename':_0x34e279,'savename':util[_0x4254('0x76')]('%s-%s.%s',_0xdbaeef[_0x4254('0x28')]||_0x3b6743[_0x4254('0x28')],require(_0x4254('0x91'))[_0x4254('0x92')](0x4),_0xdbaeef[_0x4254('0x93')]||_0x4254('0x94')),'reportId':_0x3b6743['id'],'reportType':'default'});return db['AnalyticExtractedReport']['create'](_0x4e1808,{'raw':!![]});})[_0x4254('0x20')](function(_0x1a7039){if(_0x3b6743[_0x4254('0x72')]===_0x4254('0x95')){_0x32a790[_0x4254('0x3d')](_0x3b6743['table']+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0xdbaeef['startDate'],_0xdbaeef[_0x4254('0x96')]);}else{_0x32a790[_0x4254('0x3d')](_0x3b6743[_0x4254('0x72')]+_0x4254('0x97'),_0xdbaeef[_0x4254('0x98')],_0xdbaeef[_0x4254('0x96')]);}if(_0x1a7039){logger[_0x4254('0x99')](_0x4254('0x9a'),_0x32a790['toString']());require(_0x4254('0x9b'))[_0x4254('0x9c')](path[_0x4254('0x52')](__dirname,_0x4254('0x9d'),_0x1a7039[_0x4254('0x93')]),[_0x1a7039['id'],_0x32a790[_0x4254('0x82')](),path[_0x4254('0x52')](__dirname,_0x4254('0x9e'),_0x1a7039[_0x4254('0x9f')]),_0x34e279]);return _0x1a7039;}else{var _0x4ce011=squel[_0x4254('0xa0')]();_0x4ce011[_0x4254('0x71')]('('+_0x32a790[_0x4254('0x82')]()+')',_0x4254('0xa1'));_0x4ce011[_0x4254('0x6a')]('COUNT(*)',_0x4254('0x17'));_0x32a790['limit'](_0xdbaeef[_0x4254('0x19')]||_0x5ebfba);_0x32a790[_0x4254('0x18')](_0xdbaeef[_0x4254('0x18')]||0x0);return db[_0x4254('0x81')][_0x4254('0x30')](_0x4ce011['toString'](),{'type':db['sequelize'][_0x4254('0x83')][_0x4254('0x84')]})[_0x4254('0x20')](function(_0x32d219){if(!_0x32d219[_0x4254('0x36')]){_0x1fbb6b=0x0;}else{_0x1fbb6b=_0x32d219[0x0]['count']||0x0;}return db[_0x4254('0x81')][_0x4254('0x30')](_0x32a790[_0x4254('0x82')](),{'type':db[_0x4254('0x81')][_0x4254('0x83')][_0x4254('0x84')]});})[_0x4254('0x20')](function(_0x59be00){return{'rows':_0x59be00||[],'count':_0x1fbb6b};});}});}exports[_0x4254('0xa2')]=function(_0x2c1612,_0x799fe1){return runReport(_0x2c1612[_0x4254('0x47')],_0x2c1612[_0x4254('0x30')],_0x2c1612[_0x4254('0x41')])[_0x4254('0x20')](respondWithResult(_0x799fe1,null))[_0x4254('0x46')](handleError(_0x799fe1,null));};exports[_0x4254('0xa3')]=runReport;exports[_0x4254('0x30')]=function(_0x5700aa,_0x1a327c){var _0x5e174d=0xa;var _0xd8634c=[_0x4254('0x52'),'left_join',_0x4254('0x54'),_0x4254('0x55')];var _0x354b1d={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x4254('0x85'),'MIN':_0x4254('0x59'),'AVG':_0x4254('0x5a'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x4254('0x5c'),'GROUP_CONCAT DESC':_0x4254('0x5d')};var _0x1a1a33={'SEC_TO_TIME':_0x4254('0x5e'),'DATE':'DATE(%s)','HOUR':_0x4254('0x60'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x4254('0x62')};var _0x546e38=function(_0x4efbdb){return!_['includes']([_0x4254('0x64'),_0x4254('0x65'),_0x4254('0x66'),'IS\x20NOT\x20EMPTY'],_0x4efbdb);};var _0x28c5e6=function(_0x5937e7){if(!_0x5937e7||!_0x5937e7[_0x4254('0x67')]['length']){return'';}for(var _0x4c5ca5='(',_0x126282=0x0;_0x126282<_0x5937e7[_0x4254('0x67')][_0x4254('0x36')];_0x126282+=0x1){_0x126282>0x0&&(_0x4c5ca5+='\x20'+_0x5937e7['operator']+'\x20');_0x4c5ca5+=_0x5937e7[_0x4254('0x67')][_0x126282][_0x4254('0x69')]?_0x28c5e6(_0x5937e7['rules'][_0x126282]['group']):_0x5937e7[_0x4254('0x67')][_0x126282]['field']+'\x20'+_0x5937e7[_0x4254('0x67')][_0x126282][_0x4254('0x87')]+(_0x546e38(_0x5937e7[_0x4254('0x67')][_0x126282]['condition'])?'\x20'+_0x5937e7[_0x4254('0x67')][_0x126282][_0x4254('0x6b')]:'');}return _0x4c5ca5+')';};var _0x47359e={'where':{'id':_0x5700aa[_0x4254('0x47')]['id']}},_0x4e2cae,_0x518ceb,_0x228d06,_0x33ec05,_0x1329a5;_0x47359e=_[_0x4254('0x40')]({},_0x47359e,_0x5700aa['options']);return db[_0x4254('0x2a')][_0x4254('0x4d')](_0x47359e)[_0x4254('0x20')](function(_0x1c423b){if(_0x1c423b){_0x4e2cae=_0x1c423b;return _0x1c423b[_0x4254('0x6c')]();}return null;})[_0x4254('0x20')](function(_0x242dcd){if(_0x242dcd){if(!_0x242dcd['length']){throw new db[(_0x4254('0x6d'))]['ValidationErrorItem'](_0x4254('0x88'),0x193);}_0x518ceb=_0x242dcd;return db[_0x4254('0x6f')][_0x4254('0x44')]({'raw':!![]});}return null;})[_0x4254('0x20')](function(_0x2735d7){if(_0x2735d7){_0x228d06=_[_0x4254('0x70')](_0x2735d7,'id');var _0x53a792;var _0xbf2f2e=squel[_0x4254('0xa0')]();_0xbf2f2e[_0x4254('0x71')](_0x4e2cae['table']);for(var _0x1a40e3=0x0;_0x1a40e3<_0x518ceb[_0x4254('0x36')];_0x1a40e3+=0x1){_0x53a792=_0x518ceb[_0x1a40e3][_0x4254('0x73')]?_0x228d06[_0x518ceb[_0x1a40e3][_0x4254('0x73')]]['metric']:_0x518ceb[_0x1a40e3][_0x4254('0x6a')];_0x53a792=_0x518ceb[_0x1a40e3]['function']?_['replace'](_0x354b1d[_0x518ceb[_0x1a40e3]['function']],'%s',_0x53a792):_0x53a792;_0x53a792=_0x518ceb[_0x1a40e3]['format']?_[_0x4254('0x75')](_0x1a1a33[_0x518ceb[_0x1a40e3][_0x4254('0x76')]],'%s',_0x53a792):_0x53a792;if(_0x518ceb[_0x1a40e3][_0x4254('0x8a')]){_0xbf2f2e[_0x4254('0x69')](_0x53a792);}_0x518ceb[_0x1a40e3][_0x4254('0x77')]&&_0xbf2f2e['order'](_0x53a792,_0x518ceb[_0x1a40e3][_0x4254('0x77')]===_0x4254('0x78')?![]:!![]);_0xbf2f2e[_0x4254('0x6a')](_0x53a792,_0x518ceb[_0x1a40e3][_0x4254('0x79')]||_0x53a792);}if(_0x4e2cae['joins']){_0x4e2cae[_0x4254('0x7a')]=JSON[_0x4254('0x7b')](_0x4e2cae[_0x4254('0x7a')]);for(var _0x5e5794=0x0;_0x5e5794<_0x4e2cae[_0x4254('0x7a')][_0x4254('0x36')];_0x5e5794+=0x1){if(_0x4e2cae[_0x4254('0x7a')][_0x5e5794]['type']&&_['includes'](_0xd8634c,_0x4e2cae['joins'][_0x5e5794][_0x4254('0x3e')])&&_0x4e2cae['joins'][_0x5e5794][_0x4254('0x7c')]&&_0x4e2cae['joins'][_0x5e5794][_0x4254('0x7e')]&&_0x4e2cae[_0x4254('0x7a')][_0x5e5794]['foreignKey']){_0xbf2f2e[_0x4e2cae[_0x4254('0x7a')][_0x5e5794][_0x4254('0x3e')]](_0x4e2cae[_0x4254('0x7a')][_0x5e5794][_0x4254('0x7e')],null,util[_0x4254('0x76')](_0x4254('0x8b'),_0x4e2cae[_0x4254('0x72')],_0x4e2cae['joins'][_0x5e5794][_0x4254('0x7c')],_0x4e2cae[_0x4254('0x7a')][_0x5e5794][_0x4254('0x7e')],_0x4e2cae['joins'][_0x5e5794]['foreignKey']));}}}if(_0x4e2cae[_0x4254('0x7f')]){_0x4e2cae['conditions']=JSON['parse'](_0x4e2cae[_0x4254('0x7f')]);_0xbf2f2e['where'](_0x28c5e6(_0x4e2cae['conditions']['group']));}_0x1329a5=_0xbf2f2e[_0x4254('0x8c')]();_0xbf2f2e['limit'](_0x5e174d);_0xbf2f2e[_0x4254('0x18')](0x0);logger[_0x4254('0x80')](_0x4254('0x8d'),_0xbf2f2e[_0x4254('0x82')]());return db['sequelize']['query'](_0xbf2f2e[_0x4254('0x82')](),{'type':db['sequelize'][_0x4254('0x83')]['SELECT']});}})[_0x4254('0x20')](function(){return{'sql':_0x1329a5[_0x4254('0x82')]()};})[_0x4254('0x20')](respondWithResult(_0x1a327c,null))[_0x4254('0x46')](handleError(_0x1a327c,null));}; \ No newline at end of file +var _0xe151=['order','sort','where','filter','merge','type','options','AnalyticDefaultReport','includeAll','include','findAll','rows','params','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','right_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','select','table','MetricId','metric','field','function','replace','format','groupBy','orderBy','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','toString','sequelize','QueryTypes','SELECT','GROUP_CONCAT(%s)','HOUR(%s)','Please\x20insert\x20at\x20least\x20one\x20field','from','DESC','Limited\x20Query:','No\x20available\x20data','output','web','fullPath','%s-%s.%s','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','run','runReport','cross_join','debug','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','count','offset','limit','set','Content-Range','json','reject','save','update','then','destroy','get','DefaultReports','UserProfileResource','error','stack','name','send','index','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x2aa0e7,_0x4e5145){var _0x1472c0=function(_0x4deaeb){while(--_0x4deaeb){_0x2aa0e7['push'](_0x2aa0e7['shift']());}};_0x1472c0(++_0x4e5145);}(_0xe151,0x1b9));var _0x1e15=function(_0x51f84a,_0x445f17){_0x51f84a=_0x51f84a-0x0;var _0x4ba63d=_0xe151[_0x51f84a];return _0x4ba63d;};'use strict';var pdf=require(_0x1e15('0x0'));var emlformat=require(_0x1e15('0x1'));var rimraf=require(_0x1e15('0x2'));var zipdir=require(_0x1e15('0x3'));var jsonpatch=require(_0x1e15('0x4'));var rp=require(_0x1e15('0x5'));var moment=require(_0x1e15('0x6'));var BPromise=require(_0x1e15('0x7'));var Mustache=require(_0x1e15('0x8'));var util=require(_0x1e15('0x9'));var path=require('path');var sox=require(_0x1e15('0xa'));var csv=require(_0x1e15('0xb'));var ejs=require(_0x1e15('0xc'));var fs=require('fs');var _=require(_0x1e15('0xd'));var squel=require(_0x1e15('0xe'));var crypto=require(_0x1e15('0xf'));var jsforce=require(_0x1e15('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x1e15('0xb'));var querystring=require('querystring');var Papa=require(_0x1e15('0x11'));var Redis=require(_0x1e15('0x12'));var authService=require(_0x1e15('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x1e15('0x14'));var hardwareService=require(_0x1e15('0x15'));var logger=require('../../config/logger')(_0x1e15('0x16'));var utils=require(_0x1e15('0x17'));var config=require(_0x1e15('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x30231c,_0x53617b){_0x53617b=_0x53617b||0xcc;return function(_0x123b71){if(_0x123b71){return _0x30231c[_0x1e15('0x19')](_0x53617b);}return _0x30231c[_0x1e15('0x1a')](_0x53617b)[_0x1e15('0x1b')]();};}function respondWithResult(_0x15cca4,_0x5ef792){_0x5ef792=_0x5ef792||0xc8;return function(_0x45aeef){if(_0x45aeef){return _0x15cca4['status'](_0x5ef792)['json'](_0x45aeef);}};}function respondWithFilteredResult(_0x1c8524,_0x10650c){return function(_0x57961e){if(_0x57961e){var _0x1febd4=_0x57961e[_0x1e15('0x1c')],_0x40500b=_0x10650c[_0x1e15('0x1d')],_0x220136=_0x10650c[_0x1e15('0x1d')]+_0x10650c[_0x1e15('0x1e')],_0x506be8;if(_0x220136>=_0x1febd4){_0x220136=_0x1febd4;_0x506be8=0xc8;}else{_0x506be8=0xce;}_0x1c8524[_0x1e15('0x1a')](_0x506be8);return _0x1c8524[_0x1e15('0x1f')](_0x1e15('0x20'),_0x40500b+'-'+_0x220136+'/'+_0x1febd4)[_0x1e15('0x21')](_0x57961e);}return null;};}function patchUpdates(_0x1b80b0){return function(_0x26f1b9){try{jsonpatch['apply'](_0x26f1b9,_0x1b80b0,!![]);}catch(_0x30ecd7){return BPromise[_0x1e15('0x22')](_0x30ecd7);}return _0x26f1b9[_0x1e15('0x23')]();};}function saveUpdates(_0x532f2f,_0x54886d){return function(_0x355eb2){if(_0x355eb2){return _0x355eb2[_0x1e15('0x24')](_0x532f2f)[_0x1e15('0x25')](function(_0x1c81ac){return _0x1c81ac;});}return null;};}function removeEntity(_0x364781,_0x720f94){return function(_0xdbc587){if(_0xdbc587){return _0xdbc587[_0x1e15('0x26')]()[_0x1e15('0x25')](function(){var _0x49395e=_0xdbc587[_0x1e15('0x27')]({'plain':!![]});var _0x3451b9=_0x1e15('0x28');return db[_0x1e15('0x29')][_0x1e15('0x26')]({'where':{'type':_0x3451b9,'resourceId':_0x49395e['id']}})[_0x1e15('0x25')](function(){return _0xdbc587;});})[_0x1e15('0x25')](function(){_0x364781[_0x1e15('0x1a')](0xcc)[_0x1e15('0x1b')]();});}};}function handleEntityNotFound(_0x35fcd7,_0x545739){return function(_0x338e71){if(!_0x338e71){_0x35fcd7[_0x1e15('0x19')](0x194);}return _0x338e71;};}function handleError(_0x3b78ae,_0x68559d){_0x68559d=_0x68559d||0x1f4;return function(_0x4d2baa){logger[_0x1e15('0x2a')](_0x4d2baa[_0x1e15('0x2b')]);if(_0x4d2baa[_0x1e15('0x2c')]){delete _0x4d2baa[_0x1e15('0x2c')];}_0x3b78ae[_0x1e15('0x1a')](_0x68559d)[_0x1e15('0x2d')](_0x4d2baa);};}exports[_0x1e15('0x2e')]=function(_0x3498d1,_0x2baf52){var _0x200953={},_0x38fd29={},_0x4ba690={'count':0x0,'rows':[]};var _0xba576=_['map'](db['AnalyticDefaultReport'][_0x1e15('0x2f')],function(_0x512917){return{'name':_0x512917[_0x1e15('0x30')],'type':_0x512917['type'][_0x1e15('0x31')]};});_0x38fd29[_0x1e15('0x32')]=_[_0x1e15('0x33')](_0xba576,'name');_0x38fd29[_0x1e15('0x34')]=_[_0x1e15('0x35')](_0x3498d1['query']);_0x38fd29[_0x1e15('0x36')]=_[_0x1e15('0x37')](_0x38fd29[_0x1e15('0x32')],_0x38fd29[_0x1e15('0x34')]);_0x200953[_0x1e15('0x38')]=_[_0x1e15('0x37')](_0x38fd29['model'],qs[_0x1e15('0x39')](_0x3498d1[_0x1e15('0x34')]['fields']));_0x200953[_0x1e15('0x38')]=_0x200953['attributes'][_0x1e15('0x3a')]?_0x200953['attributes']:_0x38fd29['model'];if(!_0x3498d1[_0x1e15('0x34')][_0x1e15('0x3b')]('nolimit')){_0x200953[_0x1e15('0x1e')]=qs[_0x1e15('0x1e')](_0x3498d1['query'][_0x1e15('0x1e')]);_0x200953[_0x1e15('0x1d')]=qs[_0x1e15('0x1d')](_0x3498d1['query'][_0x1e15('0x1d')]);}_0x200953[_0x1e15('0x3c')]=qs[_0x1e15('0x3d')](_0x3498d1[_0x1e15('0x34')][_0x1e15('0x3d')]);_0x200953[_0x1e15('0x3e')]=qs[_0x1e15('0x36')](_['pick'](_0x3498d1[_0x1e15('0x34')],_0x38fd29[_0x1e15('0x36')]));if(_0x3498d1[_0x1e15('0x34')][_0x1e15('0x3f')]){_0x200953[_0x1e15('0x3e')]=_[_0x1e15('0x40')](_0x200953[_0x1e15('0x3e')],{'$or':_[_0x1e15('0x33')](_0xba576,function(_0x290317){if(_0x290317[_0x1e15('0x41')]!=='VIRTUAL'){var _0x478bd6={};_0x478bd6[_0x290317[_0x1e15('0x2c')]]={'$like':'%'+_0x3498d1[_0x1e15('0x34')][_0x1e15('0x3f')]+'%'};return _0x478bd6;}})});}_0x200953=_['merge']({},_0x200953,_0x3498d1[_0x1e15('0x42')]);var _0x505c6b={'where':_0x200953[_0x1e15('0x3e')]};return db[_0x1e15('0x43')]['count'](_0x505c6b)[_0x1e15('0x25')](function(_0x215f08){_0x4ba690[_0x1e15('0x1c')]=_0x215f08;if(_0x3498d1['query'][_0x1e15('0x44')]){_0x200953[_0x1e15('0x45')]=[{'all':!![]}];}return db[_0x1e15('0x43')][_0x1e15('0x46')](_0x200953);})['then'](function(_0x39dfae){_0x4ba690[_0x1e15('0x47')]=_0x39dfae;return _0x4ba690;})[_0x1e15('0x25')](respondWithFilteredResult(_0x2baf52,_0x200953))['catch'](handleError(_0x2baf52,null));};exports['show']=function(_0x5427bd,_0x55f5dc){var _0x2fcdb2={'raw':!![],'where':{'id':_0x5427bd[_0x1e15('0x48')]['id']}},_0x410ad0={};_0x410ad0[_0x1e15('0x32')]=_[_0x1e15('0x35')](db[_0x1e15('0x43')][_0x1e15('0x2f')]);_0x410ad0['query']=_['keys'](_0x5427bd[_0x1e15('0x34')]);_0x410ad0['filters']=_[_0x1e15('0x37')](_0x410ad0['model'],_0x410ad0['query']);_0x2fcdb2['attributes']=_[_0x1e15('0x37')](_0x410ad0['model'],qs['fields'](_0x5427bd[_0x1e15('0x34')][_0x1e15('0x39')]));_0x2fcdb2['attributes']=_0x2fcdb2[_0x1e15('0x38')][_0x1e15('0x3a')]?_0x2fcdb2[_0x1e15('0x38')]:_0x410ad0[_0x1e15('0x32')];if(_0x5427bd[_0x1e15('0x34')]['includeAll']){_0x2fcdb2[_0x1e15('0x45')]=[{'all':!![]}];}_0x2fcdb2=_[_0x1e15('0x40')]({},_0x2fcdb2,_0x5427bd[_0x1e15('0x42')]);return db['AnalyticDefaultReport'][_0x1e15('0x49')](_0x2fcdb2)['then'](handleEntityNotFound(_0x55f5dc,null))[_0x1e15('0x25')](respondWithResult(_0x55f5dc,null))[_0x1e15('0x4a')](handleError(_0x55f5dc,null));};exports[_0x1e15('0x4b')]=function(_0x31d2e6,_0x32319f){return db[_0x1e15('0x43')][_0x1e15('0x4b')](_0x31d2e6[_0x1e15('0x4c')],{})[_0x1e15('0x25')](function(_0x2ffe90){var _0xbf95b5=_0x31d2e6[_0x1e15('0x4d')][_0x1e15('0x27')]({'plain':!![]});if(!_0xbf95b5)throw new Error(_0x1e15('0x4e'));if(_0xbf95b5[_0x1e15('0x4f')]===_0x1e15('0x4d')){var _0x50761a=_0x2ffe90[_0x1e15('0x27')]({'plain':!![]});var _0x58df7a=_0x1e15('0x50');return db[_0x1e15('0x51')]['find']({'where':{'name':_0x58df7a,'userProfileId':_0xbf95b5['userProfileId']},'raw':!![]})[_0x1e15('0x25')](function(_0x4e401e){if(_0x4e401e&&_0x4e401e[_0x1e15('0x52')]===0x0){return db[_0x1e15('0x29')][_0x1e15('0x4b')]({'name':_0x50761a['name'],'resourceId':_0x50761a['id'],'type':'DefaultReports','sectionId':_0x4e401e['id']},{})[_0x1e15('0x25')](function(){return _0x2ffe90;});}else{return _0x2ffe90;}})[_0x1e15('0x4a')](function(_0x203f6c){logger[_0x1e15('0x2a')](_0x1e15('0x53'),_0x203f6c);throw _0x203f6c;});}return _0x2ffe90;})[_0x1e15('0x25')](respondWithResult(_0x32319f,0xc9))[_0x1e15('0x4a')](handleError(_0x32319f,null));};exports['update']=function(_0x5240b7,_0x193793){if(_0x5240b7[_0x1e15('0x4c')]['id']){delete _0x5240b7['body']['id'];}return db['AnalyticDefaultReport'][_0x1e15('0x49')]({'where':{'id':_0x5240b7[_0x1e15('0x48')]['id']}})[_0x1e15('0x25')](handleEntityNotFound(_0x193793,null))[_0x1e15('0x25')](saveUpdates(_0x5240b7[_0x1e15('0x4c')],null))[_0x1e15('0x25')](respondWithResult(_0x193793,null))[_0x1e15('0x4a')](handleError(_0x193793,null));};exports['destroy']=function(_0x1dfaa6,_0x17b8d7){return db['AnalyticDefaultReport'][_0x1e15('0x49')]({'where':{'id':_0x1dfaa6[_0x1e15('0x48')]['id']}})[_0x1e15('0x25')](handleEntityNotFound(_0x17b8d7,null))[_0x1e15('0x25')](removeEntity(_0x17b8d7,null))[_0x1e15('0x4a')](handleError(_0x17b8d7,null));};exports['preview']=function(_0x50d418,_0x254d0b){var _0x3e22ba=0xa;var _0xa865f1=[_0x1e15('0x54'),_0x1e15('0x55'),_0x1e15('0x56'),'cross_join'];var _0x1429ad={'SUM':_0x1e15('0x57'),'COUNT':_0x1e15('0x58'),'COUNT DISTINCT':_0x1e15('0x59'),'MAX':_0x1e15('0x5a'),'MIN':_0x1e15('0x5b'),'AVG':_0x1e15('0x5c'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x1e15('0x5d'),'GROUP_CONCAT DESC':_0x1e15('0x5e')};var _0x59bced={'SEC_TO_TIME':_0x1e15('0x5f'),'DATE':_0x1e15('0x60'),'HOUR':'HOUR(%s)','ROUND':_0x1e15('0x61'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5724b0=function(_0xa9b467){return!_[_0x1e15('0x62')]([_0x1e15('0x63'),_0x1e15('0x64'),_0x1e15('0x65'),_0x1e15('0x66')],_0xa9b467);};var _0x538022=function(_0x141441){if(!_0x141441||!_0x141441[_0x1e15('0x67')][_0x1e15('0x3a')]){return'';}for(var _0x49e242='(',_0x2252dd=0x0;_0x2252dd<_0x141441[_0x1e15('0x67')][_0x1e15('0x3a')];_0x2252dd+=0x1){_0x2252dd>0x0&&(_0x49e242+='\x20'+_0x141441[_0x1e15('0x68')]+'\x20');_0x49e242+=_0x141441[_0x1e15('0x67')][_0x2252dd][_0x1e15('0x69')]?_0x538022(_0x141441[_0x1e15('0x67')][_0x2252dd]['group']):_0x141441[_0x1e15('0x67')][_0x2252dd]['field']+'\x20'+_0x141441['rules'][_0x2252dd][_0x1e15('0x6a')]+(_0x5724b0(_0x141441['rules'][_0x2252dd][_0x1e15('0x6a')])?'\x20'+_0x141441[_0x1e15('0x67')][_0x2252dd][_0x1e15('0x6b')]:'');}return _0x49e242+')';};var _0x32425c={'where':{'id':_0x50d418[_0x1e15('0x48')]['id']}},_0x34082d,_0x1ddcff,_0x19027d,_0xffb486,_0x2ec806;_0x32425c=_['merge']({},_0x32425c,_0x50d418[_0x1e15('0x42')]);return db[_0x1e15('0x43')][_0x1e15('0x49')](_0x32425c)[_0x1e15('0x25')](function(_0x4fbf1b){if(_0x4fbf1b){_0x34082d=_0x4fbf1b;return _0x4fbf1b[_0x1e15('0x6c')]();}return null;})['then'](function(_0x44096b){if(_0x44096b){if(!_0x44096b[_0x1e15('0x3a')]){throw new db[(_0x1e15('0x6d'))][(_0x1e15('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x1ddcff=_0x44096b;return db[_0x1e15('0x6f')][_0x1e15('0x46')]({'raw':!![]});}return null;})[_0x1e15('0x25')](function(_0x55ef34){if(_0x55ef34){_0x19027d=_[_0x1e15('0x70')](_0x55ef34,'id');var _0xdf9805;var _0x1af8cc=squel[_0x1e15('0x71')]();_0x1af8cc['from'](_0x34082d[_0x1e15('0x72')]);for(var _0x3f4d9a=0x0;_0x3f4d9a<_0x1ddcff[_0x1e15('0x3a')];_0x3f4d9a+=0x1){_0xdf9805=_0x1ddcff[_0x3f4d9a][_0x1e15('0x73')]?_0x19027d[_0x1ddcff[_0x3f4d9a]['MetricId']][_0x1e15('0x74')]:_0x1ddcff[_0x3f4d9a][_0x1e15('0x75')];_0xdf9805=_0x1ddcff[_0x3f4d9a][_0x1e15('0x76')]?_[_0x1e15('0x77')](_0x1429ad[_0x1ddcff[_0x3f4d9a]['function']],'%s',_0xdf9805):_0xdf9805;_0xdf9805=_0x1ddcff[_0x3f4d9a][_0x1e15('0x78')]?_['replace'](_0x59bced[_0x1ddcff[_0x3f4d9a][_0x1e15('0x78')]],'%s',_0xdf9805):_0xdf9805;if(_0x1ddcff[_0x3f4d9a][_0x1e15('0x79')]){_0x1af8cc['group'](_0xdf9805);}_0x1ddcff[_0x3f4d9a][_0x1e15('0x7a')]&&_0x1af8cc[_0x1e15('0x3c')](_0xdf9805,_0x1ddcff[_0x3f4d9a][_0x1e15('0x7a')]==='DESC'?![]:!![]);_0x1af8cc['field'](_0xdf9805,_0x1ddcff[_0x3f4d9a][_0x1e15('0x7b')]||_0xdf9805);}if(_0x34082d['joins']){_0x34082d[_0x1e15('0x7c')]=JSON[_0x1e15('0x7d')](_0x34082d['joins']);for(var _0x34b31c=0x0;_0x34b31c<_0x34082d[_0x1e15('0x7c')][_0x1e15('0x3a')];_0x34b31c+=0x1){if(_0x34082d[_0x1e15('0x7c')][_0x34b31c]['type']&&_['includes'](_0xa865f1,_0x34082d[_0x1e15('0x7c')][_0x34b31c][_0x1e15('0x41')])&&_0x34082d['joins'][_0x34b31c][_0x1e15('0x7e')]&&_0x34082d[_0x1e15('0x7c')][_0x34b31c][_0x1e15('0x7f')]&&_0x34082d[_0x1e15('0x7c')][_0x34b31c][_0x1e15('0x80')]){_0x1af8cc[_0x34082d[_0x1e15('0x7c')][_0x34b31c][_0x1e15('0x41')]](_0x34082d[_0x1e15('0x7c')][_0x34b31c]['foreignTable'],null,util[_0x1e15('0x78')](_0x1e15('0x81'),_0x34082d['table'],_0x34082d[_0x1e15('0x7c')][_0x34b31c][_0x1e15('0x7e')],_0x34082d[_0x1e15('0x7c')][_0x34b31c]['foreignTable'],_0x34082d['joins'][_0x34b31c]['foreignKey']));}}}if(_0x34082d[_0x1e15('0x82')]){_0x34082d['conditions']=JSON['parse'](_0x34082d[_0x1e15('0x82')]);_0x1af8cc[_0x1e15('0x3e')](_0x538022(_0x34082d[_0x1e15('0x82')][_0x1e15('0x69')]));}_0x2ec806=_0x1af8cc[_0x1e15('0x83')]();_0x1af8cc[_0x1e15('0x1e')](_0x3e22ba);_0x1af8cc[_0x1e15('0x1d')](0x0);logger['debug']('Limited\x20Query:',_0x1af8cc[_0x1e15('0x84')]());return db[_0x1e15('0x85')]['query'](_0x1af8cc[_0x1e15('0x84')](),{'type':db[_0x1e15('0x85')][_0x1e15('0x86')][_0x1e15('0x87')]});}})['then'](respondWithResult(_0x254d0b,null))[_0x1e15('0x4a')](handleError(_0x254d0b,null));};function runReport(_0x24c7c6,_0x9685f6,_0x4c1cd1){var _0x16d766=_0x9685f6[_0x1e15('0x2c')];var _0x31e33d=0xa;var _0x53c155=[_0x1e15('0x54'),'left_join',_0x1e15('0x56'),'cross_join'];var _0x11493e={'SUM':_0x1e15('0x57'),'COUNT':_0x1e15('0x58'),'COUNT DISTINCT':_0x1e15('0x59'),'MAX':_0x1e15('0x5a'),'MIN':'MIN(%s)','AVG':_0x1e15('0x5c'),'GROUP_CONCAT':_0x1e15('0x88'),'GROUP_CONCAT ASC':_0x1e15('0x5d'),'GROUP_CONCAT DESC':_0x1e15('0x5e')};var _0x43fcd5={'SEC_TO_TIME':_0x1e15('0x5f'),'DATE':_0x1e15('0x60'),'HOUR':_0x1e15('0x89'),'ROUND':_0x1e15('0x61'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2bfb07=function(_0x1d6a94){return!_[_0x1e15('0x62')](['IS\x20NULL',_0x1e15('0x64'),_0x1e15('0x65'),_0x1e15('0x66')],_0x1d6a94);};var _0xa12baf=function(_0x375149){if(!_0x375149||!_0x375149[_0x1e15('0x67')][_0x1e15('0x3a')]){return'';}for(var _0x5c5962='(',_0x589f39=0x0;_0x589f39<_0x375149[_0x1e15('0x67')][_0x1e15('0x3a')];_0x589f39+=0x1){_0x589f39>0x0&&(_0x5c5962+='\x20'+_0x375149['operator']+'\x20');_0x5c5962+=_0x375149[_0x1e15('0x67')][_0x589f39][_0x1e15('0x69')]?_0xa12baf(_0x375149[_0x1e15('0x67')][_0x589f39]['group']):_0x375149[_0x1e15('0x67')][_0x589f39]['field']+'\x20'+_0x375149[_0x1e15('0x67')][_0x589f39][_0x1e15('0x6a')]+(_0x2bfb07(_0x375149['rules'][_0x589f39][_0x1e15('0x6a')])?'\x20'+_0x375149[_0x1e15('0x67')][_0x589f39]['value']:'');}return _0x5c5962+')';};var _0x2069cc={'where':{'id':_0x24c7c6['id']}},_0x2e26b6,_0x4df4e1,_0x35e20a,_0x3c9fff,_0x2df394;_0x2069cc=_[_0x1e15('0x40')]({},_0x2069cc,_0x4c1cd1);return db['AnalyticDefaultReport']['find'](_0x2069cc)[_0x1e15('0x25')](function(_0x3ab234){if(_0x3ab234){_0x2e26b6=_0x3ab234;return _0x3ab234['getFields']();}return null;})[_0x1e15('0x25')](function(_0x1692d9){if(_0x1692d9){if(!_0x1692d9[_0x1e15('0x3a')]){throw new db['Sequelize'][(_0x1e15('0x6e'))](_0x1e15('0x8a'),0x193);}_0x4df4e1=_0x1692d9;return db[_0x1e15('0x6f')][_0x1e15('0x46')]({'raw':!![]});}return null;})[_0x1e15('0x25')](function(_0x385e10){if(_0x385e10){_0x35e20a=_[_0x1e15('0x70')](_0x385e10,'id');var _0x313362;var _0x5e31c3=squel[_0x1e15('0x71')]();_0x5e31c3[_0x1e15('0x8b')](_0x2e26b6[_0x1e15('0x72')]);for(var _0x324606=0x0;_0x324606<_0x4df4e1[_0x1e15('0x3a')];_0x324606+=0x1){_0x313362=_0x4df4e1[_0x324606][_0x1e15('0x73')]?_0x35e20a[_0x4df4e1[_0x324606][_0x1e15('0x73')]][_0x1e15('0x74')]:_0x4df4e1[_0x324606][_0x1e15('0x75')];_0x313362=_0x4df4e1[_0x324606][_0x1e15('0x76')]?_[_0x1e15('0x77')](_0x11493e[_0x4df4e1[_0x324606]['function']],'%s',_0x313362):_0x313362;_0x313362=_0x4df4e1[_0x324606][_0x1e15('0x78')]?_['replace'](_0x43fcd5[_0x4df4e1[_0x324606]['format']],'%s',_0x313362):_0x313362;if(_0x4df4e1[_0x324606][_0x1e15('0x79')]){_0x5e31c3[_0x1e15('0x69')](_0x313362);}_0x4df4e1[_0x324606]['orderBy']&&_0x5e31c3[_0x1e15('0x3c')](_0x313362,_0x4df4e1[_0x324606][_0x1e15('0x7a')]===_0x1e15('0x8c')?![]:!![]);_0x5e31c3['field'](_0x313362,_0x4df4e1[_0x324606][_0x1e15('0x7b')]||_0x313362);}if(_0x2e26b6[_0x1e15('0x7c')]){_0x2e26b6['joins']=JSON[_0x1e15('0x7d')](_0x2e26b6[_0x1e15('0x7c')]);for(var _0x2bcf7f=0x0;_0x2bcf7f<_0x2e26b6[_0x1e15('0x7c')]['length'];_0x2bcf7f+=0x1){if(_0x2e26b6[_0x1e15('0x7c')][_0x2bcf7f][_0x1e15('0x41')]&&_[_0x1e15('0x62')](_0x53c155,_0x2e26b6['joins'][_0x2bcf7f][_0x1e15('0x41')])&&_0x2e26b6[_0x1e15('0x7c')][_0x2bcf7f][_0x1e15('0x7e')]&&_0x2e26b6[_0x1e15('0x7c')][_0x2bcf7f][_0x1e15('0x7f')]&&_0x2e26b6[_0x1e15('0x7c')][_0x2bcf7f][_0x1e15('0x80')]){_0x5e31c3[_0x2e26b6[_0x1e15('0x7c')][_0x2bcf7f]['type']](_0x2e26b6[_0x1e15('0x7c')][_0x2bcf7f][_0x1e15('0x7f')],null,util[_0x1e15('0x78')]('%s.%s\x20=\x20%s.%s',_0x2e26b6[_0x1e15('0x72')],_0x2e26b6[_0x1e15('0x7c')][_0x2bcf7f]['parentKey'],_0x2e26b6[_0x1e15('0x7c')][_0x2bcf7f][_0x1e15('0x7f')],_0x2e26b6[_0x1e15('0x7c')][_0x2bcf7f][_0x1e15('0x80')]));}}}if(_0x2e26b6['conditions']){_0x2e26b6[_0x1e15('0x82')]=JSON['parse'](_0x2e26b6['conditions']);_0x5e31c3['where'](_0xa12baf(_0x2e26b6[_0x1e15('0x82')][_0x1e15('0x69')]));}_0x2df394=_0x5e31c3['clone']();_0x5e31c3[_0x1e15('0x1e')](_0x31e33d);_0x5e31c3[_0x1e15('0x1d')](0x0);logger['debug'](_0x1e15('0x8d'),_0x5e31c3['toString']());return db[_0x1e15('0x85')][_0x1e15('0x34')](_0x5e31c3[_0x1e15('0x84')](),{'type':db[_0x1e15('0x85')][_0x1e15('0x86')]['SELECT']});}})[_0x1e15('0x25')](function(_0x481380){if(!_0x481380[_0x1e15('0x3a')]){throw new db[(_0x1e15('0x6d'))][(_0x1e15('0x6e'))](_0x1e15('0x8e'),0xcc);}if(_0x9685f6[_0x1e15('0x8f')]===_0x1e15('0x90')){return null;}var _0x493677=_['merge'](_0x9685f6,{'name':_0x9685f6[_0x1e15('0x91')]||_0x9685f6[_0x1e15('0x2c')]||_0x2e26b6[_0x1e15('0x2c')],'basename':_0x16d766,'savename':util[_0x1e15('0x78')](_0x1e15('0x92'),_0x9685f6[_0x1e15('0x2c')]||_0x2e26b6[_0x1e15('0x2c')],require('randomstring')[_0x1e15('0x93')](0x4),_0x9685f6['output']||_0x1e15('0x94')),'reportId':_0x2e26b6['id'],'reportType':_0x1e15('0x95')});return db[_0x1e15('0x96')]['create'](_0x493677,{'raw':!![]});})[_0x1e15('0x25')](function(_0xb2254f){if(_0x2e26b6[_0x1e15('0x72')]===_0x1e15('0x97')){_0x2df394[_0x1e15('0x3e')](_0x2e26b6[_0x1e15('0x72')]+_0x1e15('0x98'),_0x9685f6[_0x1e15('0x99')],_0x9685f6[_0x1e15('0x9a')]);}else{_0x2df394[_0x1e15('0x3e')](_0x2e26b6[_0x1e15('0x72')]+_0x1e15('0x9b'),_0x9685f6[_0x1e15('0x99')],_0x9685f6[_0x1e15('0x9a')]);}if(_0xb2254f){logger['info'](_0x1e15('0x9c'),_0x2df394[_0x1e15('0x84')]());require(_0x1e15('0x9d'))[_0x1e15('0x9e')](path['join'](__dirname,_0x1e15('0x9f'),_0xb2254f[_0x1e15('0x8f')]),[_0xb2254f['id'],_0x2df394['toString'](),path[_0x1e15('0x54')](__dirname,_0x1e15('0xa0'),_0xb2254f[_0x1e15('0xa1')]),_0x16d766]);return _0xb2254f;}else{var _0x31d91d=squel[_0x1e15('0x71')]();_0x31d91d[_0x1e15('0x8b')]('('+_0x2df394[_0x1e15('0x84')]()+')',_0x1e15('0xa2'));_0x31d91d[_0x1e15('0x75')]('COUNT(*)','count');_0x2df394[_0x1e15('0x1e')](_0x9685f6[_0x1e15('0x1e')]||_0x31e33d);_0x2df394['offset'](_0x9685f6[_0x1e15('0x1d')]||0x0);return db[_0x1e15('0x85')]['query'](_0x31d91d['toString'](),{'type':db[_0x1e15('0x85')][_0x1e15('0x86')]['SELECT']})['then'](function(_0x25b9cd){if(!_0x25b9cd['length']){_0x3c9fff=0x0;}else{_0x3c9fff=_0x25b9cd[0x0][_0x1e15('0x1c')]||0x0;}return db[_0x1e15('0x85')][_0x1e15('0x34')](_0x2df394[_0x1e15('0x84')](),{'type':db[_0x1e15('0x85')][_0x1e15('0x86')][_0x1e15('0x87')]});})[_0x1e15('0x25')](function(_0x5cac8b){return{'rows':_0x5cac8b||[],'count':_0x3c9fff};});}});}exports[_0x1e15('0xa3')]=function(_0x1a01e5,_0x514cb6){return runReport(_0x1a01e5[_0x1e15('0x48')],_0x1a01e5['query'],_0x1a01e5[_0x1e15('0x42')])[_0x1e15('0x25')](respondWithResult(_0x514cb6,null))[_0x1e15('0x4a')](handleError(_0x514cb6,null));};exports[_0x1e15('0xa4')]=runReport;exports[_0x1e15('0x34')]=function(_0xa810dd,_0x28b2e4){var _0x2f5936=0xa;var _0x304336=[_0x1e15('0x54'),_0x1e15('0x55'),_0x1e15('0x56'),_0x1e15('0xa5')];var _0x5031dd={'SUM':_0x1e15('0x57'),'COUNT':_0x1e15('0x58'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x1e15('0x5a'),'MIN':_0x1e15('0x5b'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x1e15('0x88'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x32584e={'SEC_TO_TIME':_0x1e15('0x5f'),'DATE':_0x1e15('0x60'),'HOUR':_0x1e15('0x89'),'ROUND':_0x1e15('0x61'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x154132=function(_0x39e3f3){return!_['includes'](['IS\x20NULL','IS\x20NOT\x20NULL',_0x1e15('0x65'),_0x1e15('0x66')],_0x39e3f3);};var _0x2d3602=function(_0x584c3a){if(!_0x584c3a||!_0x584c3a['rules'][_0x1e15('0x3a')]){return'';}for(var _0x4c5bfb='(',_0xe9b530=0x0;_0xe9b530<_0x584c3a[_0x1e15('0x67')]['length'];_0xe9b530+=0x1){_0xe9b530>0x0&&(_0x4c5bfb+='\x20'+_0x584c3a[_0x1e15('0x68')]+'\x20');_0x4c5bfb+=_0x584c3a[_0x1e15('0x67')][_0xe9b530][_0x1e15('0x69')]?_0x2d3602(_0x584c3a['rules'][_0xe9b530]['group']):_0x584c3a[_0x1e15('0x67')][_0xe9b530][_0x1e15('0x75')]+'\x20'+_0x584c3a['rules'][_0xe9b530][_0x1e15('0x6a')]+(_0x154132(_0x584c3a[_0x1e15('0x67')][_0xe9b530][_0x1e15('0x6a')])?'\x20'+_0x584c3a[_0x1e15('0x67')][_0xe9b530][_0x1e15('0x6b')]:'');}return _0x4c5bfb+')';};var _0x4e5718={'where':{'id':_0xa810dd[_0x1e15('0x48')]['id']}},_0x5b66e7,_0x536494,_0x46909b,_0x1b894f,_0x22ff90;_0x4e5718=_[_0x1e15('0x40')]({},_0x4e5718,_0xa810dd[_0x1e15('0x42')]);return db[_0x1e15('0x43')][_0x1e15('0x49')](_0x4e5718)['then'](function(_0x42ff51){if(_0x42ff51){_0x5b66e7=_0x42ff51;return _0x42ff51['getFields']();}return null;})['then'](function(_0x8e7dee){if(_0x8e7dee){if(!_0x8e7dee['length']){throw new db['Sequelize'][(_0x1e15('0x6e'))](_0x1e15('0x8a'),0x193);}_0x536494=_0x8e7dee;return db[_0x1e15('0x6f')]['findAll']({'raw':!![]});}return null;})[_0x1e15('0x25')](function(_0x493516){if(_0x493516){_0x46909b=_[_0x1e15('0x70')](_0x493516,'id');var _0x1875ea;var _0x12edf2=squel[_0x1e15('0x71')]();_0x12edf2['from'](_0x5b66e7[_0x1e15('0x72')]);for(var _0x30f978=0x0;_0x30f978<_0x536494[_0x1e15('0x3a')];_0x30f978+=0x1){_0x1875ea=_0x536494[_0x30f978]['MetricId']?_0x46909b[_0x536494[_0x30f978][_0x1e15('0x73')]][_0x1e15('0x74')]:_0x536494[_0x30f978][_0x1e15('0x75')];_0x1875ea=_0x536494[_0x30f978][_0x1e15('0x76')]?_['replace'](_0x5031dd[_0x536494[_0x30f978][_0x1e15('0x76')]],'%s',_0x1875ea):_0x1875ea;_0x1875ea=_0x536494[_0x30f978]['format']?_['replace'](_0x32584e[_0x536494[_0x30f978][_0x1e15('0x78')]],'%s',_0x1875ea):_0x1875ea;if(_0x536494[_0x30f978][_0x1e15('0x79')]){_0x12edf2[_0x1e15('0x69')](_0x1875ea);}_0x536494[_0x30f978][_0x1e15('0x7a')]&&_0x12edf2[_0x1e15('0x3c')](_0x1875ea,_0x536494[_0x30f978][_0x1e15('0x7a')]===_0x1e15('0x8c')?![]:!![]);_0x12edf2[_0x1e15('0x75')](_0x1875ea,_0x536494[_0x30f978][_0x1e15('0x7b')]||_0x1875ea);}if(_0x5b66e7[_0x1e15('0x7c')]){_0x5b66e7[_0x1e15('0x7c')]=JSON['parse'](_0x5b66e7[_0x1e15('0x7c')]);for(var _0x34d30e=0x0;_0x34d30e<_0x5b66e7[_0x1e15('0x7c')][_0x1e15('0x3a')];_0x34d30e+=0x1){if(_0x5b66e7['joins'][_0x34d30e][_0x1e15('0x41')]&&_[_0x1e15('0x62')](_0x304336,_0x5b66e7[_0x1e15('0x7c')][_0x34d30e][_0x1e15('0x41')])&&_0x5b66e7['joins'][_0x34d30e][_0x1e15('0x7e')]&&_0x5b66e7[_0x1e15('0x7c')][_0x34d30e][_0x1e15('0x7f')]&&_0x5b66e7['joins'][_0x34d30e]['foreignKey']){_0x12edf2[_0x5b66e7[_0x1e15('0x7c')][_0x34d30e][_0x1e15('0x41')]](_0x5b66e7[_0x1e15('0x7c')][_0x34d30e][_0x1e15('0x7f')],null,util[_0x1e15('0x78')](_0x1e15('0x81'),_0x5b66e7[_0x1e15('0x72')],_0x5b66e7['joins'][_0x34d30e][_0x1e15('0x7e')],_0x5b66e7[_0x1e15('0x7c')][_0x34d30e][_0x1e15('0x7f')],_0x5b66e7[_0x1e15('0x7c')][_0x34d30e][_0x1e15('0x80')]));}}}if(_0x5b66e7[_0x1e15('0x82')]){_0x5b66e7[_0x1e15('0x82')]=JSON[_0x1e15('0x7d')](_0x5b66e7[_0x1e15('0x82')]);_0x12edf2[_0x1e15('0x3e')](_0x2d3602(_0x5b66e7['conditions']['group']));}_0x22ff90=_0x12edf2[_0x1e15('0x83')]();_0x12edf2[_0x1e15('0x1e')](_0x2f5936);_0x12edf2[_0x1e15('0x1d')](0x0);logger[_0x1e15('0xa6')](_0x1e15('0x8d'),_0x12edf2[_0x1e15('0x84')]());return db[_0x1e15('0x85')][_0x1e15('0x34')](_0x12edf2['toString'](),{'type':db[_0x1e15('0x85')][_0x1e15('0x86')][_0x1e15('0x87')]});}})[_0x1e15('0x25')](function(){return{'sql':_0x22ff90[_0x1e15('0x84')]()};})[_0x1e15('0x25')](respondWithResult(_0x28b2e4,null))[_0x1e15('0x4a')](handleError(_0x28b2e4,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 7f75288..7abf155 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 _0x34f8=['AnalyticDefaultReport','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','define'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x34f8,0xbc));var _0x834f=function(_0x1593d4,_0xbe2cc3){_0x1593d4=_0x1593d4-0x0;var _0x17eee6=_0x34f8[_0x1593d4];return _0x17eee6;};'use strict';var _=require(_0x834f('0x0'));var util=require(_0x834f('0x1'));var logger=require('../../config/logger')(_0x834f('0x2'));var moment=require(_0x834f('0x3'));var BPromise=require(_0x834f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x834f('0x5'));var rimraf=require(_0x834f('0x6'));var config=require(_0x834f('0x7'));var attributes=require(_0x834f('0x8'));module['exports']=function(_0x197f0f,_0x3b9639){return _0x197f0f[_0x834f('0x9')](_0x834f('0xa'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x884b=['util','../../config/logger','api','moment','bluebird','path','../../config/environment','./analyticDefaultReport.attributes','exports','AnalyticDefaultReport','lodash'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x884b,0x99));var _0xb884=function(_0xfbe06e,_0x2fb7ab){_0xfbe06e=_0xfbe06e-0x0;var _0x24e5b6=_0x884b[_0xfbe06e];return _0x24e5b6;};'use strict';var _=require(_0xb884('0x0'));var util=require(_0xb884('0x1'));var logger=require(_0xb884('0x2'))(_0xb884('0x3'));var moment=require(_0xb884('0x4'));var BPromise=require(_0xb884('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb884('0x6'));var rimraf=require('rimraf');var config=require(_0xb884('0x7'));var attributes=require(_0xb884('0x8'));module[_0xb884('0x9')]=function(_0x15c4a9,_0x133af1){return _0x15c4a9['define'](_0xb884('0xa'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index 9220867..327c316 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 _0xa9e0=['http','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\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(_0x610713,_0x27c846){var _0x2cf7c3=function(_0x25b3c5){while(--_0x25b3c5){_0x610713['push'](_0x610713['shift']());}};_0x2cf7c3(++_0x27c846);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});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 _0x6e6c=['randomstring','../../config/utils','rpc','jayson/promise','client','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','bluebird'];(function(_0x206510,_0x170973){var _0x87aba=function(_0x116e8e){while(--_0x116e8e){_0x206510['push'](_0x206510['shift']());}};_0x87aba(++_0x170973);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x6e6c[_0x19e35c];return _0x3e1fe8;};'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')]('AnalyticDefaultReport,\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']('AnalyticDefaultReport,\x20%s,\x20%s',_0x30a10b,_0xedf127);_0x15d268(_0xedf127);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index a27ec74..7ebc5a8 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 _0xb793=['show','/:id/run','run','/:id/query','post','create','update','delete','destroy','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','index','/:id','isAuthenticated'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb793,0x72));var _0x3b79=function(_0x2523cd,_0x4b86df){_0x2523cd=_0x2523cd-0x0;var _0x702a0a=_0xb793[_0x2523cd];return _0x702a0a;};'use strict';var multer=require(_0x3b79('0x0'));var util=require(_0x3b79('0x1'));var path=require('path');var timeout=require(_0x3b79('0x2'));var express=require(_0x3b79('0x3'));var router=express[_0x3b79('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x3b79('0x5'));var config=require(_0x3b79('0x6'));var controller=require(_0x3b79('0x7'));router[_0x3b79('0x8')]('/',auth['isAuthenticated'](),controller[_0x3b79('0x9')]);router[_0x3b79('0x8')](_0x3b79('0xa'),auth[_0x3b79('0xb')](),controller[_0x3b79('0xc')]);router[_0x3b79('0x8')]('/:id/preview',auth['isAuthenticated'](),controller['preview']);router['get'](_0x3b79('0xd'),auth['isAuthenticated'](),controller[_0x3b79('0xe')]);router[_0x3b79('0x8')](_0x3b79('0xf'),auth['isAuthenticated'](),controller['query']);router[_0x3b79('0x10')]('/',auth[_0x3b79('0xb')](),controller[_0x3b79('0x11')]);router['put'](_0x3b79('0xa'),auth[_0x3b79('0xb')](),controller[_0x3b79('0x12')]);router[_0x3b79('0x13')](_0x3b79('0xa'),auth['isAuthenticated'](),controller[_0x3b79('0x14')]);module['exports']=router; \ No newline at end of file +var _0xc9bf=['/:id','show','/:id/preview','preview','run','query','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x4331b8,_0x1d36a7){var _0x40b12e=function(_0x57f6b7){while(--_0x57f6b7){_0x4331b8['push'](_0x4331b8['shift']());}};_0x40b12e(++_0x1d36a7);}(_0xc9bf,0xad));var _0xfc9b=function(_0x18404e,_0x22c437){_0x18404e=_0x18404e-0x0;var _0x5ee009=_0xc9bf[_0x18404e];return _0x5ee009;};'use strict';var multer=require('multer');var util=require(_0xfc9b('0x0'));var path=require(_0xfc9b('0x1'));var timeout=require(_0xfc9b('0x2'));var express=require(_0xfc9b('0x3'));var router=express[_0xfc9b('0x4')]();var auth=require(_0xfc9b('0x5'));var interaction=require(_0xfc9b('0x6'));var config=require(_0xfc9b('0x7'));var controller=require('./analyticDefaultReport.controller');router[_0xfc9b('0x8')]('/',auth[_0xfc9b('0x9')](),controller[_0xfc9b('0xa')]);router[_0xfc9b('0x8')](_0xfc9b('0xb'),auth[_0xfc9b('0x9')](),controller[_0xfc9b('0xc')]);router['get'](_0xfc9b('0xd'),auth[_0xfc9b('0x9')](),controller[_0xfc9b('0xe')]);router[_0xfc9b('0x8')]('/:id/run',auth[_0xfc9b('0x9')](),controller[_0xfc9b('0xf')]);router[_0xfc9b('0x8')]('/:id/query',auth['isAuthenticated'](),controller[_0xfc9b('0x10')]);router['post']('/',auth[_0xfc9b('0x9')](),controller[_0xfc9b('0x11')]);router[_0xfc9b('0x12')](_0xfc9b('0xb'),auth[_0xfc9b('0x9')](),controller[_0xfc9b('0x13')]);router[_0xfc9b('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xfc9b('0x15')]);module[_0xfc9b('0x16')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 0598ad7..f3ad175 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 _0x3f57=['pdf','DATE','Loading','manual','scheduled','INTEGER','sequelize','moment','exports','STRING','ENUM','csv'];(function(_0xbb3b35,_0x26a7f5){var _0x512d06=function(_0x812115){while(--_0x812115){_0xbb3b35['push'](_0xbb3b35['shift']());}};_0x512d06(++_0x26a7f5);}(_0x3f57,0x1da));var _0x73f5=function(_0x27d244,_0x4c1830){_0x27d244=_0x27d244-0x0;var _0x45fdc7=_0x3f57[_0x27d244];return _0x45fdc7;};'use strict';var Sequelize=require(_0x73f5('0x0'));var moment=require(_0x73f5('0x1'));module[_0x73f5('0x2')]={'name':{'type':Sequelize[_0x73f5('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x73f5('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x73f5('0x4')](_0x73f5('0x5'),_0x73f5('0x6'),'xlsx'),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x73f5('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x73f5('0x7')]},'endDate':{'type':Sequelize[_0x73f5('0x7')]},'status':{'type':Sequelize[_0x73f5('0x3')],'defaultValue':_0x73f5('0x8')},'type':{'type':Sequelize[_0x73f5('0x4')](_0x73f5('0x9'),_0x73f5('0xa')),'allowNull':![],'defaultValue':_0x73f5('0x9')},'reportId':{'type':Sequelize[_0x73f5('0xb')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x73f5('0x3')]}}; \ No newline at end of file +var _0xbec1=['csv','DATE','Loading','manual','INTEGER','sequelize','moment','exports','STRING','ENUM','pdf','xlsx'];(function(_0x37ded3,_0x371ebb){var _0x51e49e=function(_0x30cc78){while(--_0x30cc78){_0x37ded3['push'](_0x37ded3['shift']());}};_0x51e49e(++_0x371ebb);}(_0xbec1,0xdd));var _0x1bec=function(_0x58c103,_0xe16026){_0x58c103=_0x58c103-0x0;var _0x15747d=_0xbec1[_0x58c103];return _0x15747d;};'use strict';var Sequelize=require(_0x1bec('0x0'));var moment=require(_0x1bec('0x1'));module[_0x1bec('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x1bec('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x1bec('0x4')]('csv',_0x1bec('0x5'),_0x1bec('0x6')),'allowNull':![],'defaultValue':_0x1bec('0x7')},'savename':{'type':Sequelize[_0x1bec('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x1bec('0x8')]},'endDate':{'type':Sequelize[_0x1bec('0x8')]},'status':{'type':Sequelize[_0x1bec('0x3')],'defaultValue':_0x1bec('0x9')},'type':{'type':Sequelize[_0x1bec('0x4')](_0x1bec('0xa'),'scheduled'),'allowNull':![],'defaultValue':_0x1bec('0xa')},'reportId':{'type':Sequelize[_0x1bec('0xb')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x1bec('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 49dc359..b088dce 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 _0x5877=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','get','ExtractedReports','UserProfileResource','destroy','error','stack','name','send','map','rawAttributes','type','key','query','keys','filters','intersection','model','fields','attributes','length','nolimit','order','sort','filter','merge','where','VIRTUAL','options','count','includeAll','include','AnalyticExtractedReport','findAll','catch','show','params','find','create','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','download','basename','savename','output','existsSync','join','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','root','%s.%s','toLowerCase','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5877,0x169));var _0x7587=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x5877[_0x2dafbe];return _0x58a45a;};'use strict';var pdf=require(_0x7587('0x0'));var emlformat=require(_0x7587('0x1'));var rimraf=require(_0x7587('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7587('0x3'));var rp=require('request-promise');var moment=require(_0x7587('0x4'));var BPromise=require(_0x7587('0x5'));var Mustache=require(_0x7587('0x6'));var util=require(_0x7587('0x7'));var path=require(_0x7587('0x8'));var sox=require(_0x7587('0x9'));var csv=require(_0x7587('0xa'));var ejs=require(_0x7587('0xb'));var fs=require('fs');var _=require(_0x7587('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7587('0xd'));var toCsv=require('to-csv');var querystring=require(_0x7587('0xe'));var Papa=require('papaparse');var Redis=require(_0x7587('0xf'));var authService=require(_0x7587('0x10'));var qs=require(_0x7587('0x11'));var as=require(_0x7587('0x12'));var hardwareService=require(_0x7587('0x13'));var logger=require(_0x7587('0x14'))(_0x7587('0x15'));var utils=require(_0x7587('0x16'));var config=require(_0x7587('0x17'));var db=require(_0x7587('0x18'))['db'];function respondWithStatusCode(_0x45d2db,_0x5e3ead){_0x5e3ead=_0x5e3ead||0xcc;return function(_0x48f513){if(_0x48f513){return _0x45d2db[_0x7587('0x19')](_0x5e3ead);}return _0x45d2db[_0x7587('0x1a')](_0x5e3ead)[_0x7587('0x1b')]();};}function respondWithResult(_0x2ac15e,_0x103040){_0x103040=_0x103040||0xc8;return function(_0x432273){if(_0x432273){return _0x2ac15e[_0x7587('0x1a')](_0x103040)[_0x7587('0x1c')](_0x432273);}};}function respondWithFilteredResult(_0x1a3d2e,_0x27432d){return function(_0xb841b2){if(_0xb841b2){var _0x5eb90c=_0xb841b2['count'],_0xcf713=_0x27432d[_0x7587('0x1d')],_0xfe3aa6=_0x27432d[_0x7587('0x1d')]+_0x27432d[_0x7587('0x1e')],_0x9d01e9;if(_0xfe3aa6>=_0x5eb90c){_0xfe3aa6=_0x5eb90c;_0x9d01e9=0xc8;}else{_0x9d01e9=0xce;}_0x1a3d2e[_0x7587('0x1a')](_0x9d01e9);return _0x1a3d2e[_0x7587('0x1f')](_0x7587('0x20'),_0xcf713+'-'+_0xfe3aa6+'/'+_0x5eb90c)[_0x7587('0x1c')](_0xb841b2);}return null;};}function patchUpdates(_0x129370){return function(_0x4238af){try{jsonpatch[_0x7587('0x21')](_0x4238af,_0x129370,!![]);}catch(_0x5e7da4){return BPromise[_0x7587('0x22')](_0x5e7da4);}return _0x4238af[_0x7587('0x23')]();};}function saveUpdates(_0x573890,_0x492746){return function(_0x1562fa){if(_0x1562fa){return _0x1562fa[_0x7587('0x24')](_0x573890)[_0x7587('0x25')](function(_0x3610ff){return _0x3610ff;});}return null;};}function removeEntity(_0x2b88b8,_0x1a06c9){return function(_0x100868){if(_0x100868){return _0x100868['destroy']()[_0x7587('0x25')](function(){var _0x457857=_0x100868[_0x7587('0x26')]({'plain':!![]});var _0x18bf49=_0x7587('0x27');return db[_0x7587('0x28')][_0x7587('0x29')]({'where':{'type':_0x18bf49,'resourceId':_0x457857['id']}})['then'](function(){return _0x100868;});})[_0x7587('0x25')](function(){_0x2b88b8[_0x7587('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x469adf,_0x49e7f9){return function(_0x2211cf){if(!_0x2211cf){_0x469adf['sendStatus'](0x194);}return _0x2211cf;};}function handleError(_0x3a15fd,_0x5ca64c){_0x5ca64c=_0x5ca64c||0x1f4;return function(_0xb07d2c){logger[_0x7587('0x2a')](_0xb07d2c[_0x7587('0x2b')]);if(_0xb07d2c['name']){delete _0xb07d2c[_0x7587('0x2c')];}_0x3a15fd['status'](_0x5ca64c)[_0x7587('0x2d')](_0xb07d2c);};}exports['index']=function(_0x4e5251,_0x2ff0a3){var _0x26cf99={},_0x5455c7={},_0x5eb1d1={'count':0x0,'rows':[]};var _0x57791b=_[_0x7587('0x2e')](db['AnalyticExtractedReport'][_0x7587('0x2f')],function(_0x3275a9){return{'name':_0x3275a9['fieldName'],'type':_0x3275a9[_0x7587('0x30')][_0x7587('0x31')]};});_0x5455c7['model']=_[_0x7587('0x2e')](_0x57791b,_0x7587('0x2c'));_0x5455c7[_0x7587('0x32')]=_[_0x7587('0x33')](_0x4e5251[_0x7587('0x32')]);_0x5455c7[_0x7587('0x34')]=_['intersection'](_0x5455c7['model'],_0x5455c7[_0x7587('0x32')]);_0x26cf99['attributes']=_[_0x7587('0x35')](_0x5455c7[_0x7587('0x36')],qs[_0x7587('0x37')](_0x4e5251[_0x7587('0x32')][_0x7587('0x37')]));_0x26cf99[_0x7587('0x38')]=_0x26cf99[_0x7587('0x38')][_0x7587('0x39')]?_0x26cf99[_0x7587('0x38')]:_0x5455c7[_0x7587('0x36')];if(!_0x4e5251[_0x7587('0x32')]['hasOwnProperty'](_0x7587('0x3a'))){_0x26cf99[_0x7587('0x1e')]=qs[_0x7587('0x1e')](_0x4e5251[_0x7587('0x32')]['limit']);_0x26cf99['offset']=qs['offset'](_0x4e5251['query'][_0x7587('0x1d')]);}_0x26cf99[_0x7587('0x3b')]=qs[_0x7587('0x3c')](_0x4e5251[_0x7587('0x32')][_0x7587('0x3c')]);_0x26cf99['where']=qs[_0x7587('0x34')](_['pick'](_0x4e5251[_0x7587('0x32')],_0x5455c7[_0x7587('0x34')]));if(_0x4e5251[_0x7587('0x32')][_0x7587('0x3d')]){_0x26cf99['where']=_[_0x7587('0x3e')](_0x26cf99[_0x7587('0x3f')],{'$or':_['map'](_0x57791b,function(_0x224b9f){if(_0x224b9f[_0x7587('0x30')]!==_0x7587('0x40')){var _0x3e48be={};_0x3e48be[_0x224b9f[_0x7587('0x2c')]]={'$like':'%'+_0x4e5251[_0x7587('0x32')][_0x7587('0x3d')]+'%'};return _0x3e48be;}})});}_0x26cf99=_['merge']({},_0x26cf99,_0x4e5251[_0x7587('0x41')]);var _0x2da91a={'where':_0x26cf99[_0x7587('0x3f')]};return db['AnalyticExtractedReport'][_0x7587('0x42')](_0x2da91a)['then'](function(_0x499a03){_0x5eb1d1['count']=_0x499a03;if(_0x4e5251['query'][_0x7587('0x43')]){_0x26cf99[_0x7587('0x44')]=[{'all':!![]}];}return db[_0x7587('0x45')][_0x7587('0x46')](_0x26cf99);})[_0x7587('0x25')](function(_0x30dd7c){_0x5eb1d1['rows']=_0x30dd7c;return _0x5eb1d1;})[_0x7587('0x25')](respondWithFilteredResult(_0x2ff0a3,_0x26cf99))[_0x7587('0x47')](handleError(_0x2ff0a3,null));};exports[_0x7587('0x48')]=function(_0x2c1ee8,_0x40e6c1){var _0x99e0b6={'raw':!![],'where':{'id':_0x2c1ee8[_0x7587('0x49')]['id']}},_0xdaa060={};_0xdaa060['model']=_[_0x7587('0x33')](db[_0x7587('0x45')]['rawAttributes']);_0xdaa060[_0x7587('0x32')]=_[_0x7587('0x33')](_0x2c1ee8[_0x7587('0x32')]);_0xdaa060['filters']=_['intersection'](_0xdaa060[_0x7587('0x36')],_0xdaa060[_0x7587('0x32')]);_0x99e0b6[_0x7587('0x38')]=_[_0x7587('0x35')](_0xdaa060[_0x7587('0x36')],qs[_0x7587('0x37')](_0x2c1ee8[_0x7587('0x32')][_0x7587('0x37')]));_0x99e0b6[_0x7587('0x38')]=_0x99e0b6[_0x7587('0x38')][_0x7587('0x39')]?_0x99e0b6[_0x7587('0x38')]:_0xdaa060[_0x7587('0x36')];if(_0x2c1ee8[_0x7587('0x32')][_0x7587('0x43')]){_0x99e0b6[_0x7587('0x44')]=[{'all':!![]}];}_0x99e0b6=_[_0x7587('0x3e')]({},_0x99e0b6,_0x2c1ee8[_0x7587('0x41')]);return db[_0x7587('0x45')][_0x7587('0x4a')](_0x99e0b6)[_0x7587('0x25')](handleEntityNotFound(_0x40e6c1,null))['then'](respondWithResult(_0x40e6c1,null))[_0x7587('0x47')](handleError(_0x40e6c1,null));};exports[_0x7587('0x4b')]=function(_0x2a9b52,_0xfec560){return db[_0x7587('0x45')][_0x7587('0x4b')](_0x2a9b52['body'],{})[_0x7587('0x25')](function(_0x314fea){var _0x596699=_0x2a9b52[_0x7587('0x4c')]['get']({'plain':!![]});if(!_0x596699)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x596699['role']==='user'){var _0x77829a=_0x314fea[_0x7587('0x26')]({'plain':!![]});var _0x364bf5='ExtractedReports';return db[_0x7587('0x4d')][_0x7587('0x4a')]({'where':{'name':_0x364bf5,'userProfileId':_0x596699[_0x7587('0x4e')]},'raw':!![]})[_0x7587('0x25')](function(_0x2e4cf3){if(_0x2e4cf3&&_0x2e4cf3['autoAssociation']===0x0){return db['UserProfileResource'][_0x7587('0x4b')]({'name':_0x77829a[_0x7587('0x2c')],'resourceId':_0x77829a['id'],'type':_0x2e4cf3[_0x7587('0x2c')],'sectionId':_0x2e4cf3['id']},{})[_0x7587('0x25')](function(){return _0x314fea;});}else{return _0x314fea;}})[_0x7587('0x47')](function(_0x1fca04){logger[_0x7587('0x2a')](_0x7587('0x4f'),_0x1fca04);throw _0x1fca04;});}return _0x314fea;})[_0x7587('0x25')](respondWithResult(_0xfec560,0xc9))[_0x7587('0x47')](handleError(_0xfec560,null));};exports[_0x7587('0x24')]=function(_0xf98600,_0x2dab41){if(_0xf98600[_0x7587('0x50')]['id']){delete _0xf98600['body']['id'];}return db['AnalyticExtractedReport'][_0x7587('0x4a')]({'where':{'id':_0xf98600[_0x7587('0x49')]['id']}})[_0x7587('0x25')](handleEntityNotFound(_0x2dab41,null))[_0x7587('0x25')](saveUpdates(_0xf98600[_0x7587('0x50')],null))[_0x7587('0x25')](respondWithResult(_0x2dab41,null))[_0x7587('0x47')](handleError(_0x2dab41,null));};exports[_0x7587('0x29')]=function(_0x2f523d,_0xf1ec8a){return db[_0x7587('0x45')][_0x7587('0x4a')]({'where':{'id':_0x2f523d[_0x7587('0x49')]['id']}})[_0x7587('0x25')](handleEntityNotFound(_0xf1ec8a,null))['then'](removeEntity(_0xf1ec8a,null))[_0x7587('0x47')](handleError(_0xf1ec8a,null));};exports[_0x7587('0x51')]=function(_0x15b940,_0x3253ac,_0x3067f1){return db[_0x7587('0x45')][_0x7587('0x4a')]({'where':{'id':_0x15b940[_0x7587('0x49')]['id']},'attributes':[_0x7587('0x2c'),_0x7587('0x52'),_0x7587('0x53'),_0x7587('0x54')],'raw':!![]})[_0x7587('0x25')](handleEntityNotFound(_0x3253ac,null))[_0x7587('0x25')](function(_0x469766){if(_0x469766){if(!fs[_0x7587('0x55')](path[_0x7587('0x56')](config['root'],_0x7587('0x57'),_0x469766[_0x7587('0x53')]))){throw new db[(_0x7587('0x58'))][(_0x7587('0x59'))](_0x7587('0x5a'));}if(_0x15b940['query'][_0x7587('0x5b')]){return _0x3253ac[_0x7587('0x19')](0xc8);}return _0x3253ac[_0x7587('0x51')](path[_0x7587('0x56')](config[_0x7587('0x5c')],'server/files/reports',_0x469766[_0x7587('0x53')]),util['format'](_0x7587('0x5d'),_0x469766['basename']||_0x469766[_0x7587('0x2c')],_0x469766[_0x7587('0x54')][_0x7587('0x5e')]()));}})[_0x7587('0x47')](handleError(_0x3253ac,null));}; \ No newline at end of file +var _0x3e29=['nolimit','order','sort','filters','pick','filter','where','merge','options','count','include','findAll','show','includeAll','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','download','savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','exists','basename','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset','limit','status','set','Content-Range','apply','reject','update','destroy','get','ExtractedReports','UserProfileResource','then','stack','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','model','name','query','keys','attributes','intersection','fields','length','hasOwnProperty'];(function(_0x18cd5b,_0x10240b){var _0x5eaa52=function(_0x2bccad){while(--_0x2bccad){_0x18cd5b['push'](_0x18cd5b['shift']());}};_0x5eaa52(++_0x10240b);}(_0x3e29,0x8a));var _0x93e2=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x3e29[_0x17d9e3];return _0x14192d;};'use strict';var pdf=require(_0x93e2('0x0'));var emlformat=require(_0x93e2('0x1'));var rimraf=require(_0x93e2('0x2'));var zipdir=require(_0x93e2('0x3'));var jsonpatch=require(_0x93e2('0x4'));var rp=require(_0x93e2('0x5'));var moment=require(_0x93e2('0x6'));var BPromise=require(_0x93e2('0x7'));var Mustache=require(_0x93e2('0x8'));var util=require(_0x93e2('0x9'));var path=require(_0x93e2('0xa'));var sox=require('sox');var csv=require(_0x93e2('0xb'));var ejs=require(_0x93e2('0xc'));var fs=require('fs');var _=require(_0x93e2('0xd'));var squel=require(_0x93e2('0xe'));var crypto=require('crypto');var jsforce=require(_0x93e2('0xf'));var deskjs=require(_0x93e2('0x10'));var toCsv=require('to-csv');var querystring=require(_0x93e2('0x11'));var Papa=require(_0x93e2('0x12'));var Redis=require(_0x93e2('0x13'));var authService=require(_0x93e2('0x14'));var qs=require(_0x93e2('0x15'));var as=require(_0x93e2('0x16'));var hardwareService=require(_0x93e2('0x17'));var logger=require(_0x93e2('0x18'))(_0x93e2('0x19'));var utils=require(_0x93e2('0x1a'));var config=require(_0x93e2('0x1b'));var db=require(_0x93e2('0x1c'))['db'];function respondWithStatusCode(_0x360dca,_0x403843){_0x403843=_0x403843||0xcc;return function(_0xbb44d1){if(_0xbb44d1){return _0x360dca[_0x93e2('0x1d')](_0x403843);}return _0x360dca['status'](_0x403843)[_0x93e2('0x1e')]();};}function respondWithResult(_0x565a5c,_0x461980){_0x461980=_0x461980||0xc8;return function(_0x472b36){if(_0x472b36){return _0x565a5c['status'](_0x461980)[_0x93e2('0x1f')](_0x472b36);}};}function respondWithFilteredResult(_0x2079c5,_0x37d889){return function(_0x568097){if(_0x568097){var _0x5b2ac5=_0x568097['count'],_0x52b49a=_0x37d889[_0x93e2('0x20')],_0x59bf4d=_0x37d889[_0x93e2('0x20')]+_0x37d889[_0x93e2('0x21')],_0x3d24c5;if(_0x59bf4d>=_0x5b2ac5){_0x59bf4d=_0x5b2ac5;_0x3d24c5=0xc8;}else{_0x3d24c5=0xce;}_0x2079c5[_0x93e2('0x22')](_0x3d24c5);return _0x2079c5[_0x93e2('0x23')](_0x93e2('0x24'),_0x52b49a+'-'+_0x59bf4d+'/'+_0x5b2ac5)[_0x93e2('0x1f')](_0x568097);}return null;};}function patchUpdates(_0x4af9fe){return function(_0x460594){try{jsonpatch[_0x93e2('0x25')](_0x460594,_0x4af9fe,!![]);}catch(_0x58803e){return BPromise[_0x93e2('0x26')](_0x58803e);}return _0x460594['save']();};}function saveUpdates(_0x56ce98,_0x3cf142){return function(_0x341eff){if(_0x341eff){return _0x341eff[_0x93e2('0x27')](_0x56ce98)['then'](function(_0x167617){return _0x167617;});}return null;};}function removeEntity(_0x458d9d,_0x189f83){return function(_0x1f6187){if(_0x1f6187){return _0x1f6187[_0x93e2('0x28')]()['then'](function(){var _0xa6a8b4=_0x1f6187[_0x93e2('0x29')]({'plain':!![]});var _0x798c79=_0x93e2('0x2a');return db[_0x93e2('0x2b')][_0x93e2('0x28')]({'where':{'type':_0x798c79,'resourceId':_0xa6a8b4['id']}})[_0x93e2('0x2c')](function(){return _0x1f6187;});})['then'](function(){_0x458d9d['status'](0xcc)[_0x93e2('0x1e')]();});}};}function handleEntityNotFound(_0x129c56,_0x2e9bcc){return function(_0x6532f8){if(!_0x6532f8){_0x129c56[_0x93e2('0x1d')](0x194);}return _0x6532f8;};}function handleError(_0x181fc4,_0x46c277){_0x46c277=_0x46c277||0x1f4;return function(_0x3189fd){logger['error'](_0x3189fd[_0x93e2('0x2d')]);if(_0x3189fd['name']){delete _0x3189fd['name'];}_0x181fc4[_0x93e2('0x22')](_0x46c277)[_0x93e2('0x2e')](_0x3189fd);};}exports[_0x93e2('0x2f')]=function(_0x3976c4,_0x58c68b){var _0x2fbc78={},_0x6c58a1={},_0x4226d6={'count':0x0,'rows':[]};var _0x576ee5=_[_0x93e2('0x30')](db[_0x93e2('0x31')][_0x93e2('0x32')],function(_0xdb7093){return{'name':_0xdb7093[_0x93e2('0x33')],'type':_0xdb7093[_0x93e2('0x34')]['key']};});_0x6c58a1[_0x93e2('0x35')]=_['map'](_0x576ee5,_0x93e2('0x36'));_0x6c58a1[_0x93e2('0x37')]=_[_0x93e2('0x38')](_0x3976c4[_0x93e2('0x37')]);_0x6c58a1['filters']=_['intersection'](_0x6c58a1['model'],_0x6c58a1['query']);_0x2fbc78[_0x93e2('0x39')]=_[_0x93e2('0x3a')](_0x6c58a1[_0x93e2('0x35')],qs[_0x93e2('0x3b')](_0x3976c4[_0x93e2('0x37')][_0x93e2('0x3b')]));_0x2fbc78[_0x93e2('0x39')]=_0x2fbc78['attributes'][_0x93e2('0x3c')]?_0x2fbc78['attributes']:_0x6c58a1[_0x93e2('0x35')];if(!_0x3976c4[_0x93e2('0x37')][_0x93e2('0x3d')](_0x93e2('0x3e'))){_0x2fbc78[_0x93e2('0x21')]=qs['limit'](_0x3976c4[_0x93e2('0x37')][_0x93e2('0x21')]);_0x2fbc78[_0x93e2('0x20')]=qs[_0x93e2('0x20')](_0x3976c4[_0x93e2('0x37')][_0x93e2('0x20')]);}_0x2fbc78[_0x93e2('0x3f')]=qs[_0x93e2('0x40')](_0x3976c4[_0x93e2('0x37')][_0x93e2('0x40')]);_0x2fbc78['where']=qs[_0x93e2('0x41')](_[_0x93e2('0x42')](_0x3976c4[_0x93e2('0x37')],_0x6c58a1[_0x93e2('0x41')]));if(_0x3976c4['query'][_0x93e2('0x43')]){_0x2fbc78[_0x93e2('0x44')]=_['merge'](_0x2fbc78[_0x93e2('0x44')],{'$or':_['map'](_0x576ee5,function(_0x27febc){if(_0x27febc[_0x93e2('0x34')]!=='VIRTUAL'){var _0x9e41ef={};_0x9e41ef[_0x27febc[_0x93e2('0x36')]]={'$like':'%'+_0x3976c4[_0x93e2('0x37')][_0x93e2('0x43')]+'%'};return _0x9e41ef;}})});}_0x2fbc78=_[_0x93e2('0x45')]({},_0x2fbc78,_0x3976c4[_0x93e2('0x46')]);var _0x4042f3={'where':_0x2fbc78[_0x93e2('0x44')]};return db[_0x93e2('0x31')][_0x93e2('0x47')](_0x4042f3)[_0x93e2('0x2c')](function(_0x42cb7f){_0x4226d6[_0x93e2('0x47')]=_0x42cb7f;if(_0x3976c4[_0x93e2('0x37')]['includeAll']){_0x2fbc78[_0x93e2('0x48')]=[{'all':!![]}];}return db[_0x93e2('0x31')][_0x93e2('0x49')](_0x2fbc78);})['then'](function(_0x598046){_0x4226d6['rows']=_0x598046;return _0x4226d6;})[_0x93e2('0x2c')](respondWithFilteredResult(_0x58c68b,_0x2fbc78))['catch'](handleError(_0x58c68b,null));};exports[_0x93e2('0x4a')]=function(_0x3d6868,_0x391f2f){var _0x18e963={'raw':!![],'where':{'id':_0x3d6868['params']['id']}},_0x46bd0e={};_0x46bd0e[_0x93e2('0x35')]=_[_0x93e2('0x38')](db[_0x93e2('0x31')][_0x93e2('0x32')]);_0x46bd0e[_0x93e2('0x37')]=_[_0x93e2('0x38')](_0x3d6868[_0x93e2('0x37')]);_0x46bd0e[_0x93e2('0x41')]=_[_0x93e2('0x3a')](_0x46bd0e[_0x93e2('0x35')],_0x46bd0e[_0x93e2('0x37')]);_0x18e963[_0x93e2('0x39')]=_[_0x93e2('0x3a')](_0x46bd0e[_0x93e2('0x35')],qs[_0x93e2('0x3b')](_0x3d6868['query'][_0x93e2('0x3b')]));_0x18e963[_0x93e2('0x39')]=_0x18e963['attributes']['length']?_0x18e963['attributes']:_0x46bd0e[_0x93e2('0x35')];if(_0x3d6868['query'][_0x93e2('0x4b')]){_0x18e963[_0x93e2('0x48')]=[{'all':!![]}];}_0x18e963=_['merge']({},_0x18e963,_0x3d6868['options']);return db[_0x93e2('0x31')][_0x93e2('0x4c')](_0x18e963)[_0x93e2('0x2c')](handleEntityNotFound(_0x391f2f,null))[_0x93e2('0x2c')](respondWithResult(_0x391f2f,null))[_0x93e2('0x4d')](handleError(_0x391f2f,null));};exports[_0x93e2('0x4e')]=function(_0x1f0961,_0x1ccc66){return db[_0x93e2('0x31')]['create'](_0x1f0961[_0x93e2('0x4f')],{})[_0x93e2('0x2c')](function(_0x22e037){var _0x325f1c=_0x1f0961[_0x93e2('0x50')][_0x93e2('0x29')]({'plain':!![]});if(!_0x325f1c)throw new Error(_0x93e2('0x51'));if(_0x325f1c[_0x93e2('0x52')]===_0x93e2('0x50')){var _0x1736d8=_0x22e037[_0x93e2('0x29')]({'plain':!![]});var _0x17d51f=_0x93e2('0x2a');return db[_0x93e2('0x53')][_0x93e2('0x4c')]({'where':{'name':_0x17d51f,'userProfileId':_0x325f1c[_0x93e2('0x54')]},'raw':!![]})['then'](function(_0x489a2e){if(_0x489a2e&&_0x489a2e[_0x93e2('0x55')]===0x0){return db[_0x93e2('0x2b')]['create']({'name':_0x1736d8[_0x93e2('0x36')],'resourceId':_0x1736d8['id'],'type':_0x489a2e[_0x93e2('0x36')],'sectionId':_0x489a2e['id']},{})[_0x93e2('0x2c')](function(){return _0x22e037;});}else{return _0x22e037;}})['catch'](function(_0x2317d3){logger[_0x93e2('0x56')](_0x93e2('0x57'),_0x2317d3);throw _0x2317d3;});}return _0x22e037;})[_0x93e2('0x2c')](respondWithResult(_0x1ccc66,0xc9))[_0x93e2('0x4d')](handleError(_0x1ccc66,null));};exports['update']=function(_0x4e14f5,_0x51fa89){if(_0x4e14f5['body']['id']){delete _0x4e14f5[_0x93e2('0x4f')]['id'];}return db[_0x93e2('0x31')][_0x93e2('0x4c')]({'where':{'id':_0x4e14f5[_0x93e2('0x58')]['id']}})['then'](handleEntityNotFound(_0x51fa89,null))['then'](saveUpdates(_0x4e14f5['body'],null))[_0x93e2('0x2c')](respondWithResult(_0x51fa89,null))[_0x93e2('0x4d')](handleError(_0x51fa89,null));};exports[_0x93e2('0x28')]=function(_0xec0a36,_0x40fab3){return db[_0x93e2('0x31')][_0x93e2('0x4c')]({'where':{'id':_0xec0a36[_0x93e2('0x58')]['id']}})[_0x93e2('0x2c')](handleEntityNotFound(_0x40fab3,null))[_0x93e2('0x2c')](removeEntity(_0x40fab3,null))[_0x93e2('0x4d')](handleError(_0x40fab3,null));};exports[_0x93e2('0x59')]=function(_0x31d6e2,_0x3b4548,_0x1dc025){return db['AnalyticExtractedReport'][_0x93e2('0x4c')]({'where':{'id':_0x31d6e2[_0x93e2('0x58')]['id']},'attributes':['name','basename',_0x93e2('0x5a'),_0x93e2('0x5b')],'raw':!![]})[_0x93e2('0x2c')](handleEntityNotFound(_0x3b4548,null))['then'](function(_0x144f90){if(_0x144f90){if(!fs[_0x93e2('0x5c')](path[_0x93e2('0x5d')](config[_0x93e2('0x5e')],_0x93e2('0x5f'),_0x144f90[_0x93e2('0x5a')]))){throw new db[(_0x93e2('0x60'))][(_0x93e2('0x61'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x31d6e2[_0x93e2('0x37')][_0x93e2('0x62')]){return _0x3b4548[_0x93e2('0x1d')](0xc8);}return _0x3b4548['download'](path['join'](config[_0x93e2('0x5e')],_0x93e2('0x5f'),_0x144f90[_0x93e2('0x5a')]),util['format']('%s.%s',_0x144f90[_0x93e2('0x63')]||_0x144f90[_0x93e2('0x36')],_0x144f90[_0x93e2('0x5b')]['toLowerCase']()));}})[_0x93e2('0x4d')](handleError(_0x3b4548,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 6246184..9cc400a 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 _0xd509=['rimraf','./analyticExtractedReport.attributes','exports','define','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x233ec0,_0x5ed1be){var _0x31ee7f=function(_0x49a7a7){while(--_0x49a7a7){_0x233ec0['push'](_0x233ec0['shift']());}};_0x31ee7f(++_0x5ed1be);}(_0xd509,0x1d2));var _0x9d50=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd509[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9d50('0x0'));var util=require('util');var logger=require(_0x9d50('0x1'))(_0x9d50('0x2'));var moment=require(_0x9d50('0x3'));var BPromise=require(_0x9d50('0x4'));var rp=require(_0x9d50('0x5'));var fs=require('fs');var path=require(_0x9d50('0x6'));var rimraf=require(_0x9d50('0x7'));var config=require('../../config/environment');var attributes=require(_0x9d50('0x8'));module[_0x9d50('0x9')]=function(_0x6d08c4,_0x35e0bb){return _0x6d08c4[_0x9d50('0xa')]('AnalyticExtractedReport',attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0e66=['AnalyticExtractedReport','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define'];(function(_0x2fde2d,_0x4a3128){var _0x449a25=function(_0x3bc979){while(--_0x3bc979){_0x2fde2d['push'](_0x2fde2d['shift']());}};_0x449a25(++_0x4a3128);}(_0x0e66,0x90));var _0x60e6=function(_0x1aed80,_0x3ca6f6){_0x1aed80=_0x1aed80-0x0;var _0x43961e=_0x0e66[_0x1aed80];return _0x43961e;};'use strict';var _=require(_0x60e6('0x0'));var util=require(_0x60e6('0x1'));var logger=require('../../config/logger')(_0x60e6('0x2'));var moment=require(_0x60e6('0x3'));var BPromise=require(_0x60e6('0x4'));var rp=require(_0x60e6('0x5'));var fs=require('fs');var path=require(_0x60e6('0x6'));var rimraf=require(_0x60e6('0x7'));var config=require(_0x60e6('0x8'));var attributes=require(_0x60e6('0x9'));module[_0x60e6('0xa')]=function(_0x13defd,_0x3d4c65){return _0x13defd[_0x60e6('0xb')](_0x60e6('0xc'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js index 4885869..1a8c9ba 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 _0x5c3c=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','message','catch'];(function(_0x3bf6f3,_0xd0ec2a){var _0x26ab22=function(_0x1b457b){while(--_0x1b457b){_0x3bf6f3['push'](_0x3bf6f3['shift']());}};_0x26ab22(++_0xd0ec2a);}(_0x5c3c,0x140));var _0xc5c3=function(_0x39d544,_0x35c14f){_0x39d544=_0x39d544-0x0;var _0x5a5ff2=_0x5c3c[_0x39d544];return _0x5a5ff2;};'use strict';var _=require(_0xc5c3('0x0'));var util=require(_0xc5c3('0x1'));var moment=require(_0xc5c3('0x2'));var BPromise=require(_0xc5c3('0x3'));var rs=require(_0xc5c3('0x4'));var fs=require('fs');var Redis=require(_0xc5c3('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc5c3('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xc5c3('0x7'));var jayson=require(_0xc5c3('0x8'));var client=jayson[_0xc5c3('0x9')][_0xc5c3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3548cf,_0x2a485,_0x4c3c49){return new BPromise(function(_0x484e9e,_0xfdd7d7){return client[_0xc5c3('0xb')](_0x3548cf,_0x4c3c49)['then'](function(_0x2acb35){logger[_0xc5c3('0xc')](_0xc5c3('0xd'),_0x2a485,_0xc5c3('0xe'));logger['debug'](_0xc5c3('0xf'),_0x2a485,_0xc5c3('0xe'),JSON['stringify'](_0x2acb35));if(_0x2acb35[_0xc5c3('0x10')]){if(_0x2acb35['error'][_0xc5c3('0x11')]===0x1f4){logger['error'](_0xc5c3('0xd'),_0x2a485,_0x2acb35['error'][_0xc5c3('0x12')]);return _0xfdd7d7(_0x2acb35[_0xc5c3('0x10')][_0xc5c3('0x12')]);}logger[_0xc5c3('0x10')](_0xc5c3('0xd'),_0x2a485,_0x2acb35[_0xc5c3('0x10')][_0xc5c3('0x12')]);return _0x484e9e(_0x2acb35[_0xc5c3('0x10')][_0xc5c3('0x12')]);}else{logger[_0xc5c3('0xc')](_0xc5c3('0xd'),_0x2a485,_0xc5c3('0xe'));_0x484e9e(_0x2acb35['result'][_0xc5c3('0x12')]);}})[_0xc5c3('0x13')](function(_0x284925){logger[_0xc5c3('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x2a485,_0x284925);_0xfdd7d7(_0x284925);});});} \ No newline at end of file +var _0x26ad=['then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x650e11,_0x284f86){var _0x1a9b47=function(_0x6e15e3){while(--_0x6e15e3){_0x650e11['push'](_0x650e11['shift']());}};_0x1a9b47(++_0x284f86);}(_0x26ad,0xf9));var _0xd26a=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x26ad[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0xd26a('0x0'));var util=require(_0xd26a('0x1'));var moment=require(_0xd26a('0x2'));var BPromise=require(_0xd26a('0x3'));var rs=require(_0xd26a('0x4'));var fs=require('fs');var Redis=require(_0xd26a('0x5'));var db=require(_0xd26a('0x6'))['db'];var utils=require(_0xd26a('0x7'));var logger=require(_0xd26a('0x8'))(_0xd26a('0x9'));var config=require(_0xd26a('0xa'));var jayson=require(_0xd26a('0xb'));var client=jayson[_0xd26a('0xc')][_0xd26a('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x2d085e,_0x3c3d49,_0xf912d6){return new BPromise(function(_0x53ac36,_0x1e7ab1){return client[_0xd26a('0xe')](_0x2d085e,_0xf912d6)[_0xd26a('0xf')](function(_0x56b687){logger[_0xd26a('0x10')](_0xd26a('0x11'),_0x3c3d49,_0xd26a('0x12'));logger['debug'](_0xd26a('0x13'),_0x3c3d49,'request\x20sent',JSON[_0xd26a('0x14')](_0x56b687));if(_0x56b687['error']){if(_0x56b687[_0xd26a('0x15')]['code']===0x1f4){logger['error'](_0xd26a('0x11'),_0x3c3d49,_0x56b687[_0xd26a('0x15')]['message']);return _0x1e7ab1(_0x56b687[_0xd26a('0x15')][_0xd26a('0x16')]);}logger[_0xd26a('0x15')](_0xd26a('0x11'),_0x3c3d49,_0x56b687['error'][_0xd26a('0x16')]);return _0x53ac36(_0x56b687['error']['message']);}else{logger[_0xd26a('0x10')](_0xd26a('0x11'),_0x3c3d49,_0xd26a('0x12'));_0x53ac36(_0x56b687[_0xd26a('0x17')][_0xd26a('0x16')]);}})['catch'](function(_0x3e6508){logger[_0xd26a('0x15')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x3c3d49,_0x3e6508);_0x1e7ab1(_0x3e6508);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 46172fb..6b3ade2 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 _0xd5d8=['util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./analyticExtractedReport.controller','isAuthenticated','/:id','/:id/download','download','post','create','put','update','delete','destroy','exports','multer'];(function(_0x4df278,_0x5c5f72){var _0x4a9abb=function(_0x14abc0){while(--_0x14abc0){_0x4df278['push'](_0x4df278['shift']());}};_0x4a9abb(++_0x5c5f72);}(_0xd5d8,0x1a3));var _0x8d5d=function(_0x34a0d8,_0x2df614){_0x34a0d8=_0x34a0d8-0x0;var _0x2b5d50=_0xd5d8[_0x34a0d8];return _0x2b5d50;};'use strict';var multer=require(_0x8d5d('0x0'));var util=require(_0x8d5d('0x1'));var path=require(_0x8d5d('0x2'));var timeout=require(_0x8d5d('0x3'));var express=require(_0x8d5d('0x4'));var router=express[_0x8d5d('0x5')]();var auth=require(_0x8d5d('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8d5d('0x7'));var controller=require(_0x8d5d('0x8'));router['get']('/',auth[_0x8d5d('0x9')](),controller['index']);router['get'](_0x8d5d('0xa'),auth['isAuthenticated'](),controller['show']);router['get'](_0x8d5d('0xb'),auth[_0x8d5d('0x9')](),controller[_0x8d5d('0xc')]);router[_0x8d5d('0xd')]('/',auth['isAuthenticated'](),controller[_0x8d5d('0xe')]);router[_0x8d5d('0xf')](_0x8d5d('0xa'),auth[_0x8d5d('0x9')](),controller[_0x8d5d('0x10')]);router[_0x8d5d('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x8d5d('0x12')]);module[_0x8d5d('0x13')]=router; \ No newline at end of file +var _0x274e=['delete','destroy','exports','multer','util','express','Router','../../config/environment','isAuthenticated','index','/:id','download','create','put'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x274e,0x1d1));var _0xe274=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x274e[_0x13e741];return _0x3f8bb3;};'use strict';var multer=require(_0xe274('0x0'));var util=require(_0xe274('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe274('0x2'));var router=express[_0xe274('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe274('0x4'));var controller=require('./analyticExtractedReport.controller');router['get']('/',auth[_0xe274('0x5')](),controller[_0xe274('0x6')]);router['get'](_0xe274('0x7'),auth[_0xe274('0x5')](),controller['show']);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0xe274('0x8')]);router['post']('/',auth[_0xe274('0x5')](),controller[_0xe274('0x9')]);router[_0xe274('0xa')](_0xe274('0x7'),auth[_0xe274('0x5')](),controller['update']);router[_0xe274('0xb')]('/:id',auth[_0xe274('0x5')](),controller[_0xe274('0xc')]);module[_0xe274('0xd')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index e5bafb6..8041b22 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 _0x7217=['STRING','BOOLEAN','sequelize','TEXT'];(function(_0x8908df,_0x51133f){var _0x3600ea=function(_0x7417c7){while(--_0x7417c7){_0x8908df['push'](_0x8908df['shift']());}};_0x3600ea(++_0x51133f);}(_0x7217,0x19e));var _0x7721=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0x7217[_0x5b78e8];return _0xf2c321;};'use strict';var Sequelize=require(_0x7721('0x0'));module['exports']={'field':{'type':Sequelize[_0x7721('0x1')]},'alias':{'type':Sequelize[_0x7721('0x2')]},'function':{'type':Sequelize[_0x7721('0x2')]},'format':{'type':Sequelize[_0x7721('0x2')]},'groupBy':{'type':Sequelize[_0x7721('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xc4aa=['exports','TEXT','STRING','sequelize'];(function(_0x233fbd,_0xd02bb8){var _0x575bea=function(_0x4c33f9){while(--_0x4c33f9){_0x233fbd['push'](_0x233fbd['shift']());}};_0x575bea(++_0xd02bb8);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x342baa,_0x4a110f){_0x342baa=_0x342baa-0x0;var _0x1208f3=_0xc4aa[_0x342baa];return _0x1208f3;};'use strict';var Sequelize=require(_0xac4a('0x0'));module[_0xac4a('0x1')]={'field':{'type':Sequelize[_0xac4a('0x2')]},'alias':{'type':Sequelize[_0xac4a('0x3')]},'function':{'type':Sequelize[_0xac4a('0x3')]},'format':{'type':Sequelize[_0xac4a('0x3')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'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 ad38d25..55e632d 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 _0xa064=['sort','where','pick','filter','VIRTUAL','merge','includeAll','findAll','rows','catch','show','params','keys','include','options','find','create','body','bulkCreate','bulkDestroy','findOne','sequelize','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','to-csv','ejs','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','name','send','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','nolimit','limit','order'];(function(_0x5e64f5,_0x1d69c1){var _0x121424=function(_0xaa9c26){while(--_0xaa9c26){_0x5e64f5['push'](_0x5e64f5['shift']());}};_0x121424(++_0x1d69c1);}(_0xa064,0x192));var _0x4a06=function(_0x5da01c,_0x53bf77){_0x5da01c=_0x5da01c-0x0;var _0x1216c2=_0xa064[_0x5da01c];return _0x1216c2;};'use strict';var pdf=require(_0x4a06('0x0'));var emlformat=require(_0x4a06('0x1'));var rimraf=require(_0x4a06('0x2'));var zipdir=require(_0x4a06('0x3'));var jsonpatch=require(_0x4a06('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4a06('0x5'));var Mustache=require('mustache');var util=require(_0x4a06('0x6'));var path=require(_0x4a06('0x7'));var sox=require('sox');var csv=require(_0x4a06('0x8'));var ejs=require(_0x4a06('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x4a06('0xa'));var crypto=require(_0x4a06('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4a06('0x8'));var querystring=require(_0x4a06('0xc'));var Papa=require(_0x4a06('0xd'));var Redis=require(_0x4a06('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x4a06('0xf'));var as=require(_0x4a06('0x10'));var hardwareService=require(_0x4a06('0x11'));var logger=require(_0x4a06('0x12'))(_0x4a06('0x13'));var utils=require(_0x4a06('0x14'));var config=require(_0x4a06('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x610aa7,_0x52818e){_0x52818e=_0x52818e||0xcc;return function(_0x16d686){if(_0x16d686){return _0x610aa7[_0x4a06('0x16')](_0x52818e);}return _0x610aa7[_0x4a06('0x17')](_0x52818e)['end']();};}function respondWithResult(_0xeb7556,_0xdbc234){_0xdbc234=_0xdbc234||0xc8;return function(_0xf9b166){if(_0xf9b166){return _0xeb7556['status'](_0xdbc234)[_0x4a06('0x18')](_0xf9b166);}};}function respondWithFilteredResult(_0x45adf2,_0x292770){return function(_0x51643c){if(_0x51643c){var _0x221a80=_0x51643c[_0x4a06('0x19')],_0x29e99b=_0x292770['offset'],_0xa2655c=_0x292770[_0x4a06('0x1a')]+_0x292770['limit'],_0x3574e9;if(_0xa2655c>=_0x221a80){_0xa2655c=_0x221a80;_0x3574e9=0xc8;}else{_0x3574e9=0xce;}_0x45adf2[_0x4a06('0x17')](_0x3574e9);return _0x45adf2[_0x4a06('0x1b')](_0x4a06('0x1c'),_0x29e99b+'-'+_0xa2655c+'/'+_0x221a80)[_0x4a06('0x18')](_0x51643c);}return null;};}function patchUpdates(_0x28b067){return function(_0x46d266){try{jsonpatch[_0x4a06('0x1d')](_0x46d266,_0x28b067,!![]);}catch(_0x39c640){return BPromise[_0x4a06('0x1e')](_0x39c640);}return _0x46d266[_0x4a06('0x1f')]();};}function saveUpdates(_0x4a53e0,_0x98df26){return function(_0x3933e6){if(_0x3933e6){return _0x3933e6[_0x4a06('0x20')](_0x4a53e0)[_0x4a06('0x21')](function(_0x379061){return _0x379061;});}return null;};}function removeEntity(_0x2822d6,_0x20f9f4){return function(_0x156af7){if(_0x156af7){return _0x156af7[_0x4a06('0x22')]()[_0x4a06('0x21')](function(){_0x2822d6[_0x4a06('0x17')](0xcc)[_0x4a06('0x23')]();});}};}function handleEntityNotFound(_0x38c823,_0x5ebd7c){return function(_0x501ee9){if(!_0x501ee9){_0x38c823[_0x4a06('0x16')](0x194);}return _0x501ee9;};}function handleError(_0x2ad64a,_0x272544){_0x272544=_0x272544||0x1f4;return function(_0x166f02){logger['error'](_0x166f02['stack']);if(_0x166f02[_0x4a06('0x24')]){delete _0x166f02[_0x4a06('0x24')];}_0x2ad64a['status'](_0x272544)[_0x4a06('0x25')](_0x166f02);};}exports['index']=function(_0xf5cb0,_0xa48043){var _0x524225={},_0x1a47be={},_0x16bc1b={'count':0x0,'rows':[]};var _0x1be810=_[_0x4a06('0x26')](db[_0x4a06('0x27')][_0x4a06('0x28')],function(_0x5ee187){return{'name':_0x5ee187[_0x4a06('0x29')],'type':_0x5ee187[_0x4a06('0x2a')][_0x4a06('0x2b')]};});_0x1a47be['model']=_[_0x4a06('0x26')](_0x1be810,_0x4a06('0x24'));_0x1a47be[_0x4a06('0x2c')]=_['keys'](_0xf5cb0['query']);_0x1a47be[_0x4a06('0x2d')]=_[_0x4a06('0x2e')](_0x1a47be[_0x4a06('0x2f')],_0x1a47be[_0x4a06('0x2c')]);_0x524225[_0x4a06('0x30')]=_[_0x4a06('0x2e')](_0x1a47be[_0x4a06('0x2f')],qs[_0x4a06('0x31')](_0xf5cb0['query'][_0x4a06('0x31')]));_0x524225[_0x4a06('0x30')]=_0x524225[_0x4a06('0x30')][_0x4a06('0x32')]?_0x524225[_0x4a06('0x30')]:_0x1a47be['model'];if(!_0xf5cb0[_0x4a06('0x2c')]['hasOwnProperty'](_0x4a06('0x33'))){_0x524225[_0x4a06('0x34')]=qs['limit'](_0xf5cb0[_0x4a06('0x2c')][_0x4a06('0x34')]);_0x524225[_0x4a06('0x1a')]=qs[_0x4a06('0x1a')](_0xf5cb0[_0x4a06('0x2c')]['offset']);}_0x524225[_0x4a06('0x35')]=qs['sort'](_0xf5cb0[_0x4a06('0x2c')][_0x4a06('0x36')]);_0x524225[_0x4a06('0x37')]=qs['filters'](_[_0x4a06('0x38')](_0xf5cb0[_0x4a06('0x2c')],_0x1a47be[_0x4a06('0x2d')]));if(_0xf5cb0[_0x4a06('0x2c')][_0x4a06('0x39')]){_0x524225[_0x4a06('0x37')]=_['merge'](_0x524225[_0x4a06('0x37')],{'$or':_['map'](_0x1be810,function(_0x207c94){if(_0x207c94[_0x4a06('0x2a')]!==_0x4a06('0x3a')){var _0x4e98ce={};_0x4e98ce[_0x207c94[_0x4a06('0x24')]]={'$like':'%'+_0xf5cb0['query'][_0x4a06('0x39')]+'%'};return _0x4e98ce;}})});}_0x524225=_[_0x4a06('0x3b')]({},_0x524225,_0xf5cb0['options']);var _0x218bf9={'where':_0x524225[_0x4a06('0x37')]};return db[_0x4a06('0x27')][_0x4a06('0x19')](_0x218bf9)[_0x4a06('0x21')](function(_0x305382){_0x16bc1b[_0x4a06('0x19')]=_0x305382;if(_0xf5cb0[_0x4a06('0x2c')][_0x4a06('0x3c')]){_0x524225['include']=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x4a06('0x3d')](_0x524225);})[_0x4a06('0x21')](function(_0xedab1){_0x16bc1b[_0x4a06('0x3e')]=_0xedab1;return _0x16bc1b;})[_0x4a06('0x21')](respondWithFilteredResult(_0xa48043,_0x524225))[_0x4a06('0x3f')](handleError(_0xa48043,null));};exports[_0x4a06('0x40')]=function(_0x554856,_0x49ee96){var _0x465938={'raw':![],'where':{'id':_0x554856[_0x4a06('0x41')]['id']}},_0x3301be={};_0x3301be[_0x4a06('0x2f')]=_[_0x4a06('0x42')](db['AnalyticFieldReport'][_0x4a06('0x28')]);_0x3301be['query']=_[_0x4a06('0x42')](_0x554856[_0x4a06('0x2c')]);_0x3301be[_0x4a06('0x2d')]=_[_0x4a06('0x2e')](_0x3301be['model'],_0x3301be[_0x4a06('0x2c')]);_0x465938[_0x4a06('0x30')]=_[_0x4a06('0x2e')](_0x3301be['model'],qs[_0x4a06('0x31')](_0x554856[_0x4a06('0x2c')][_0x4a06('0x31')]));_0x465938['attributes']=_0x465938[_0x4a06('0x30')][_0x4a06('0x32')]?_0x465938[_0x4a06('0x30')]:_0x3301be[_0x4a06('0x2f')];if(_0x554856[_0x4a06('0x2c')][_0x4a06('0x3c')]){_0x465938[_0x4a06('0x43')]=[{'all':!![]}];}_0x465938=_[_0x4a06('0x3b')]({},_0x465938,_0x554856[_0x4a06('0x44')]);return db[_0x4a06('0x27')][_0x4a06('0x45')](_0x465938)[_0x4a06('0x21')](handleEntityNotFound(_0x49ee96,null))[_0x4a06('0x21')](respondWithResult(_0x49ee96,null))['catch'](handleError(_0x49ee96,null));};exports[_0x4a06('0x46')]=function(_0x4f52c0,_0x3ddf88){return db[_0x4a06('0x27')][_0x4a06('0x46')](_0x4f52c0[_0x4a06('0x47')],{})[_0x4a06('0x21')](respondWithResult(_0x3ddf88,0xc9))['catch'](handleError(_0x3ddf88,null));};exports[_0x4a06('0x48')]=function(_0x1f4fad,_0x24cdf8){return db['AnalyticFieldReport'][_0x4a06('0x48')](_0x1f4fad[_0x4a06('0x47')],{'raw':![],'individualHooks':!![]})[_0x4a06('0x21')](respondWithResult(_0x24cdf8,0xc9))['catch'](handleError(_0x24cdf8,null));};exports[_0x4a06('0x20')]=function(_0x2824ed,_0x131caa){if(_0x2824ed[_0x4a06('0x47')]['id']){delete _0x2824ed[_0x4a06('0x47')]['id'];}return db[_0x4a06('0x27')]['find']({'where':{'id':_0x2824ed[_0x4a06('0x41')]['id']}})[_0x4a06('0x21')](handleEntityNotFound(_0x131caa,null))[_0x4a06('0x21')](saveUpdates(_0x2824ed[_0x4a06('0x47')],null))[_0x4a06('0x21')](respondWithResult(_0x131caa,null))[_0x4a06('0x3f')](handleError(_0x131caa,null));};exports['destroy']=function(_0xcfa915,_0x5c7951){return db['AnalyticFieldReport'][_0x4a06('0x45')]({'where':{'id':_0xcfa915[_0x4a06('0x41')]['id']}})[_0x4a06('0x21')](handleEntityNotFound(_0x5c7951,null))[_0x4a06('0x21')](removeEntity(_0x5c7951,null))[_0x4a06('0x3f')](handleError(_0x5c7951,null));};exports[_0x4a06('0x49')]=function(_0x4b8fd3,_0x391930){return db[_0x4a06('0x27')]['destroy']({'where':{'id':_0x4b8fd3[_0x4a06('0x2c')]['ids']||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x391930,0xcc))[_0x4a06('0x3f')](handleError(_0x391930,null));};exports['addFields']=function(_0x2d45fe,_0x24c759,_0x1746cc){return db['AnalyticCustomReport'][_0x4a06('0x4a')]({'where':{'id':_0x2d45fe[_0x4a06('0x41')]['id']}})[_0x4a06('0x21')](handleEntityNotFound(_0x24c759,null))['then'](function(_0x5d9be6){if(_0x5d9be6){return db[_0x4a06('0x4b')]['transaction'](function(_0x40a24a){return db[_0x4a06('0x27')][_0x4a06('0x22')]({'where':{'CustomReportId':_0x2d45fe[_0x4a06('0x41')]['id']},'transaction':_0x40a24a})[_0x4a06('0x21')](function(_0x26b65d){var _0x378fd6=_[_0x4a06('0x26')](_0x2d45fe[_0x4a06('0x47')],function(_0x4276ed){delete _0x4276ed['id'];_0x4276ed['CustomReportId']=_0x2d45fe[_0x4a06('0x41')]['id'];return _0x4276ed;});return db[_0x4a06('0x27')]['bulkCreate'](_0x378fd6,{'transaction':_0x40a24a});});})[_0x4a06('0x21')](function(){return db[_0x4a06('0x27')][_0x4a06('0x3d')]({'where':{'CustomReportId':_0x2d45fe[_0x4a06('0x41')]['id']}});});}})[_0x4a06('0x21')](respondWithResult(_0x24c759,null))['catch'](handleError(_0x24c759,null));}; \ No newline at end of file +var _0x3c03=['json','count','offset','limit','Content-Range','apply','save','then','destroy','error','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','bulkCreate','body','update','bulkDestroy','addFields','AnalyticCustomReport','findOne','transaction','CustomReportId','html-pdf','fast-json-patch','request-promise','moment','bluebird','util','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/utils','../../config/environment','sendStatus','status','end'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x3c03,0x16d));var _0x33c0=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0x3c03[_0x525c7b];return _0x27b33e;};'use strict';var pdf=require(_0x33c0('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x33c0('0x1'));var rp=require(_0x33c0('0x2'));var moment=require(_0x33c0('0x3'));var BPromise=require(_0x33c0('0x4'));var Mustache=require('mustache');var util=require(_0x33c0('0x5'));var path=require(_0x33c0('0x6'));var sox=require(_0x33c0('0x7'));var csv=require(_0x33c0('0x8'));var ejs=require(_0x33c0('0x9'));var fs=require('fs');var _=require(_0x33c0('0xa'));var squel=require(_0x33c0('0xb'));var crypto=require('crypto');var jsforce=require(_0x33c0('0xc'));var deskjs=require(_0x33c0('0xd'));var toCsv=require('to-csv');var querystring=require(_0x33c0('0xe'));var Papa=require(_0x33c0('0xf'));var Redis=require('ioredis');var authService=require(_0x33c0('0x10'));var qs=require(_0x33c0('0x11'));var as=require(_0x33c0('0x12'));var hardwareService=require(_0x33c0('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x33c0('0x14'));var config=require(_0x33c0('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5ab672,_0x5063bb){_0x5063bb=_0x5063bb||0xcc;return function(_0x381ada){if(_0x381ada){return _0x5ab672[_0x33c0('0x16')](_0x5063bb);}return _0x5ab672[_0x33c0('0x17')](_0x5063bb)[_0x33c0('0x18')]();};}function respondWithResult(_0x3a76e2,_0x3e632e){_0x3e632e=_0x3e632e||0xc8;return function(_0x5879db){if(_0x5879db){return _0x3a76e2[_0x33c0('0x17')](_0x3e632e)[_0x33c0('0x19')](_0x5879db);}};}function respondWithFilteredResult(_0x1d954c,_0x5dd9fb){return function(_0x3ae3a8){if(_0x3ae3a8){var _0x58c21e=_0x3ae3a8[_0x33c0('0x1a')],_0x1e4134=_0x5dd9fb[_0x33c0('0x1b')],_0x5a88cb=_0x5dd9fb[_0x33c0('0x1b')]+_0x5dd9fb[_0x33c0('0x1c')],_0x115715;if(_0x5a88cb>=_0x58c21e){_0x5a88cb=_0x58c21e;_0x115715=0xc8;}else{_0x115715=0xce;}_0x1d954c[_0x33c0('0x17')](_0x115715);return _0x1d954c['set'](_0x33c0('0x1d'),_0x1e4134+'-'+_0x5a88cb+'/'+_0x58c21e)[_0x33c0('0x19')](_0x3ae3a8);}return null;};}function patchUpdates(_0x1b775f){return function(_0x42db79){try{jsonpatch[_0x33c0('0x1e')](_0x42db79,_0x1b775f,!![]);}catch(_0x2237e7){return BPromise['reject'](_0x2237e7);}return _0x42db79[_0x33c0('0x1f')]();};}function saveUpdates(_0x84311e,_0x3b2f68){return function(_0x25e2c4){if(_0x25e2c4){return _0x25e2c4['update'](_0x84311e)[_0x33c0('0x20')](function(_0x38312c){return _0x38312c;});}return null;};}function removeEntity(_0x315d86,_0x1d1d3d){return function(_0x51d76c){if(_0x51d76c){return _0x51d76c[_0x33c0('0x21')]()[_0x33c0('0x20')](function(){_0x315d86[_0x33c0('0x17')](0xcc)[_0x33c0('0x18')]();});}};}function handleEntityNotFound(_0x330dc7,_0x394d5c){return function(_0x3a55e4){if(!_0x3a55e4){_0x330dc7[_0x33c0('0x16')](0x194);}return _0x3a55e4;};}function handleError(_0x401e3a,_0x4876e6){_0x4876e6=_0x4876e6||0x1f4;return function(_0x4333a2){logger[_0x33c0('0x22')](_0x4333a2[_0x33c0('0x23')]);if(_0x4333a2[_0x33c0('0x24')]){delete _0x4333a2['name'];}_0x401e3a[_0x33c0('0x17')](_0x4876e6)[_0x33c0('0x25')](_0x4333a2);};}exports[_0x33c0('0x26')]=function(_0x6c927f,_0x12a58a){var _0x4f6d3b={},_0x547675={},_0x5f3720={'count':0x0,'rows':[]};var _0x1cf88e=_[_0x33c0('0x27')](db[_0x33c0('0x28')][_0x33c0('0x29')],function(_0x6e93f9){return{'name':_0x6e93f9[_0x33c0('0x2a')],'type':_0x6e93f9[_0x33c0('0x2b')]['key']};});_0x547675[_0x33c0('0x2c')]=_['map'](_0x1cf88e,_0x33c0('0x24'));_0x547675[_0x33c0('0x2d')]=_[_0x33c0('0x2e')](_0x6c927f[_0x33c0('0x2d')]);_0x547675['filters']=_[_0x33c0('0x2f')](_0x547675[_0x33c0('0x2c')],_0x547675[_0x33c0('0x2d')]);_0x4f6d3b[_0x33c0('0x30')]=_[_0x33c0('0x2f')](_0x547675['model'],qs[_0x33c0('0x31')](_0x6c927f[_0x33c0('0x2d')][_0x33c0('0x31')]));_0x4f6d3b[_0x33c0('0x30')]=_0x4f6d3b[_0x33c0('0x30')][_0x33c0('0x32')]?_0x4f6d3b[_0x33c0('0x30')]:_0x547675[_0x33c0('0x2c')];if(!_0x6c927f[_0x33c0('0x2d')][_0x33c0('0x33')](_0x33c0('0x34'))){_0x4f6d3b[_0x33c0('0x1c')]=qs[_0x33c0('0x1c')](_0x6c927f[_0x33c0('0x2d')][_0x33c0('0x1c')]);_0x4f6d3b[_0x33c0('0x1b')]=qs[_0x33c0('0x1b')](_0x6c927f[_0x33c0('0x2d')][_0x33c0('0x1b')]);}_0x4f6d3b['order']=qs[_0x33c0('0x35')](_0x6c927f[_0x33c0('0x2d')]['sort']);_0x4f6d3b['where']=qs[_0x33c0('0x36')](_[_0x33c0('0x37')](_0x6c927f[_0x33c0('0x2d')],_0x547675[_0x33c0('0x36')]));if(_0x6c927f[_0x33c0('0x2d')][_0x33c0('0x38')]){_0x4f6d3b['where']=_[_0x33c0('0x39')](_0x4f6d3b[_0x33c0('0x3a')],{'$or':_['map'](_0x1cf88e,function(_0x303060){if(_0x303060[_0x33c0('0x2b')]!==_0x33c0('0x3b')){var _0x5700e6={};_0x5700e6[_0x303060[_0x33c0('0x24')]]={'$like':'%'+_0x6c927f[_0x33c0('0x2d')][_0x33c0('0x38')]+'%'};return _0x5700e6;}})});}_0x4f6d3b=_[_0x33c0('0x39')]({},_0x4f6d3b,_0x6c927f[_0x33c0('0x3c')]);var _0x4cf55b={'where':_0x4f6d3b[_0x33c0('0x3a')]};return db[_0x33c0('0x28')][_0x33c0('0x1a')](_0x4cf55b)[_0x33c0('0x20')](function(_0x3d3bb7){_0x5f3720['count']=_0x3d3bb7;if(_0x6c927f[_0x33c0('0x2d')][_0x33c0('0x3d')]){_0x4f6d3b[_0x33c0('0x3e')]=[{'all':!![]}];}return db[_0x33c0('0x28')][_0x33c0('0x3f')](_0x4f6d3b);})['then'](function(_0x15d991){_0x5f3720['rows']=_0x15d991;return _0x5f3720;})[_0x33c0('0x20')](respondWithFilteredResult(_0x12a58a,_0x4f6d3b))[_0x33c0('0x40')](handleError(_0x12a58a,null));};exports[_0x33c0('0x41')]=function(_0x3e0d03,_0x24ba79){var _0x1dd2a3={'raw':![],'where':{'id':_0x3e0d03[_0x33c0('0x42')]['id']}},_0x105f5d={};_0x105f5d[_0x33c0('0x2c')]=_['keys'](db['AnalyticFieldReport']['rawAttributes']);_0x105f5d[_0x33c0('0x2d')]=_[_0x33c0('0x2e')](_0x3e0d03[_0x33c0('0x2d')]);_0x105f5d['filters']=_[_0x33c0('0x2f')](_0x105f5d[_0x33c0('0x2c')],_0x105f5d['query']);_0x1dd2a3['attributes']=_[_0x33c0('0x2f')](_0x105f5d[_0x33c0('0x2c')],qs['fields'](_0x3e0d03[_0x33c0('0x2d')][_0x33c0('0x31')]));_0x1dd2a3[_0x33c0('0x30')]=_0x1dd2a3[_0x33c0('0x30')][_0x33c0('0x32')]?_0x1dd2a3[_0x33c0('0x30')]:_0x105f5d[_0x33c0('0x2c')];if(_0x3e0d03['query'][_0x33c0('0x3d')]){_0x1dd2a3[_0x33c0('0x3e')]=[{'all':!![]}];}_0x1dd2a3=_[_0x33c0('0x39')]({},_0x1dd2a3,_0x3e0d03[_0x33c0('0x3c')]);return db[_0x33c0('0x28')][_0x33c0('0x43')](_0x1dd2a3)[_0x33c0('0x20')](handleEntityNotFound(_0x24ba79,null))['then'](respondWithResult(_0x24ba79,null))[_0x33c0('0x40')](handleError(_0x24ba79,null));};exports[_0x33c0('0x44')]=function(_0x2e2be5,_0x463864){return db[_0x33c0('0x28')][_0x33c0('0x44')](_0x2e2be5['body'],{})[_0x33c0('0x20')](respondWithResult(_0x463864,0xc9))['catch'](handleError(_0x463864,null));};exports[_0x33c0('0x45')]=function(_0x5b1f3a,_0x10250d){return db['AnalyticFieldReport'][_0x33c0('0x45')](_0x5b1f3a[_0x33c0('0x46')],{'raw':![],'individualHooks':!![]})[_0x33c0('0x20')](respondWithResult(_0x10250d,0xc9))[_0x33c0('0x40')](handleError(_0x10250d,null));};exports[_0x33c0('0x47')]=function(_0x20a166,_0x391e81){if(_0x20a166['body']['id']){delete _0x20a166[_0x33c0('0x46')]['id'];}return db[_0x33c0('0x28')][_0x33c0('0x43')]({'where':{'id':_0x20a166[_0x33c0('0x42')]['id']}})['then'](handleEntityNotFound(_0x391e81,null))[_0x33c0('0x20')](saveUpdates(_0x20a166['body'],null))[_0x33c0('0x20')](respondWithResult(_0x391e81,null))[_0x33c0('0x40')](handleError(_0x391e81,null));};exports[_0x33c0('0x21')]=function(_0x1086c2,_0x6e1b97){return db[_0x33c0('0x28')][_0x33c0('0x43')]({'where':{'id':_0x1086c2['params']['id']}})[_0x33c0('0x20')](handleEntityNotFound(_0x6e1b97,null))['then'](removeEntity(_0x6e1b97,null))[_0x33c0('0x40')](handleError(_0x6e1b97,null));};exports[_0x33c0('0x48')]=function(_0xb7deed,_0x38a0e7){return db[_0x33c0('0x28')][_0x33c0('0x21')]({'where':{'id':_0xb7deed[_0x33c0('0x2d')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0x33c0('0x20')](respondWithResult(_0x38a0e7,0xcc))[_0x33c0('0x40')](handleError(_0x38a0e7,null));};exports[_0x33c0('0x49')]=function(_0x2f8036,_0x3d9079,_0x5cbf53){return db[_0x33c0('0x4a')][_0x33c0('0x4b')]({'where':{'id':_0x2f8036[_0x33c0('0x42')]['id']}})[_0x33c0('0x20')](handleEntityNotFound(_0x3d9079,null))['then'](function(_0x68feb3){if(_0x68feb3){return db['sequelize'][_0x33c0('0x4c')](function(_0x2850b2){return db['AnalyticFieldReport'][_0x33c0('0x21')]({'where':{'CustomReportId':_0x2f8036[_0x33c0('0x42')]['id']},'transaction':_0x2850b2})[_0x33c0('0x20')](function(_0x4be8f0){var _0x5ec5e2=_[_0x33c0('0x27')](_0x2f8036[_0x33c0('0x46')],function(_0x96d63c){delete _0x96d63c['id'];_0x96d63c[_0x33c0('0x4d')]=_0x2f8036[_0x33c0('0x42')]['id'];return _0x96d63c;});return db[_0x33c0('0x28')]['bulkCreate'](_0x5ec5e2,{'transaction':_0x2850b2});});})[_0x33c0('0x20')](function(){return db[_0x33c0('0x28')]['findAll']({'where':{'CustomReportId':_0x2f8036[_0x33c0('0x42')]['id']}});});}})[_0x33c0('0x20')](respondWithResult(_0x3d9079,null))['catch'](handleError(_0x3d9079,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index c7ddee4..d96d119 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 _0x70c0=['analytics_report_fields','util','../../config/logger','request-promise','rimraf','exports','AnalyticFieldReport'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x70c0,0xd3));var _0x070c=function(_0x1eb2d3,_0x120337){_0x1eb2d3=_0x1eb2d3-0x0;var _0x23d40f=_0x70c0[_0x1eb2d3];return _0x23d40f;};'use strict';var _=require('lodash');var util=require(_0x070c('0x0'));var logger=require(_0x070c('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x070c('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x070c('0x3'));var config=require('../../config/environment');var attributes=require('./analyticFieldReport.attributes');module[_0x070c('0x4')]=function(_0x28ef2e,_0x420b33){return _0x28ef2e['define'](_0x070c('0x5'),attributes,{'tableName':_0x070c('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xde8b=['path','../../config/environment','./analyticFieldReport.attributes','exports','analytics_report_fields','lodash','../../config/logger','api','moment','bluebird'];(function(_0x4da2fb,_0x4e90cb){var _0x1348e8=function(_0x347356){while(--_0x347356){_0x4da2fb['push'](_0x4da2fb['shift']());}};_0x1348e8(++_0x4e90cb);}(_0xde8b,0x73));var _0xbde8=function(_0x1bfc62,_0x2610d5){_0x1bfc62=_0x1bfc62-0x0;var _0x506404=_0xde8b[_0x1bfc62];return _0x506404;};'use strict';var _=require(_0xbde8('0x0'));var util=require('util');var logger=require(_0xbde8('0x1'))(_0xbde8('0x2'));var moment=require(_0xbde8('0x3'));var BPromise=require(_0xbde8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbde8('0x5'));var rimraf=require('rimraf');var config=require(_0xbde8('0x6'));var attributes=require(_0xbde8('0x7'));module[_0xbde8('0x8')]=function(_0x25fb8e,_0x517b7e){return _0x25fb8e['define']('AnalyticFieldReport',attributes,{'tableName':_0xbde8('0x9'),'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 ad4cc6f..c0b7720 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 _0x44fe=['rpc','../../config/environment','jayson/promise','client','request','info','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x9b3efc,_0x577a0d){var _0x200f05=function(_0x15ad7c){while(--_0x15ad7c){_0x9b3efc['push'](_0x9b3efc['shift']());}};_0x200f05(++_0x577a0d);}(_0x44fe,0x10a));var _0xe44f=function(_0x16fd4a,_0x573084){_0x16fd4a=_0x16fd4a-0x0;var _0x36defc=_0x44fe[_0x16fd4a];return _0x36defc;};'use strict';var _=require(_0xe44f('0x0'));var util=require(_0xe44f('0x1'));var moment=require(_0xe44f('0x2'));var BPromise=require(_0xe44f('0x3'));var rs=require(_0xe44f('0x4'));var fs=require('fs');var Redis=require(_0xe44f('0x5'));var db=require(_0xe44f('0x6'))['db'];var utils=require(_0xe44f('0x7'));var logger=require(_0xe44f('0x8'))(_0xe44f('0x9'));var config=require(_0xe44f('0xa'));var jayson=require(_0xe44f('0xb'));var client=jayson[_0xe44f('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x254411,_0x1b7ef1,_0x547169){return new BPromise(function(_0x4809fd,_0x3e2407){return client[_0xe44f('0xd')](_0x254411,_0x547169)['then'](function(_0x4e5fd5){logger[_0xe44f('0xe')]('AnalyticFieldReport,\x20%s,\x20%s',_0x1b7ef1,_0xe44f('0xf'));logger[_0xe44f('0x10')](_0xe44f('0x11'),_0x1b7ef1,_0xe44f('0xf'),JSON[_0xe44f('0x12')](_0x4e5fd5));if(_0x4e5fd5[_0xe44f('0x13')]){if(_0x4e5fd5[_0xe44f('0x13')][_0xe44f('0x14')]===0x1f4){logger[_0xe44f('0x13')](_0xe44f('0x15'),_0x1b7ef1,_0x4e5fd5[_0xe44f('0x13')][_0xe44f('0x16')]);return _0x3e2407(_0x4e5fd5[_0xe44f('0x13')][_0xe44f('0x16')]);}logger[_0xe44f('0x13')](_0xe44f('0x15'),_0x1b7ef1,_0x4e5fd5[_0xe44f('0x13')][_0xe44f('0x16')]);return _0x4809fd(_0x4e5fd5[_0xe44f('0x13')][_0xe44f('0x16')]);}else{logger[_0xe44f('0xe')](_0xe44f('0x15'),_0x1b7ef1,'request\x20sent');_0x4809fd(_0x4e5fd5[_0xe44f('0x17')][_0xe44f('0x16')]);}})[_0xe44f('0x18')](function(_0x51220b){logger['error'](_0xe44f('0x15'),_0x1b7ef1,_0x51220b);_0x3e2407(_0x51220b);});});} \ No newline at end of file +var _0x29ea=['message','catch','lodash','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xabfec4,_0x35076e){var _0x7bafa2=function(_0x52d551){while(--_0x52d551){_0xabfec4['push'](_0xabfec4['shift']());}};_0x7bafa2(++_0x35076e);}(_0x29ea,0xf9));var _0xa29e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x29ea[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xa29e('0x0'));var util=require('util');var moment=require(_0xa29e('0x1'));var BPromise=require('bluebird');var rs=require(_0xa29e('0x2'));var fs=require('fs');var Redis=require(_0xa29e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa29e('0x4'));var logger=require('../../config/logger')(_0xa29e('0x5'));var config=require(_0xa29e('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xa29e('0x7')][_0xa29e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x27402e,_0x2c8680,_0x4b0fe4){return new BPromise(function(_0x255bfb,_0x4705f4){return client['request'](_0x27402e,_0x4b0fe4)[_0xa29e('0x9')](function(_0x5e750c){logger[_0xa29e('0xa')](_0xa29e('0xb'),_0x2c8680,_0xa29e('0xc'));logger[_0xa29e('0xd')](_0xa29e('0xe'),_0x2c8680,_0xa29e('0xc'),JSON[_0xa29e('0xf')](_0x5e750c));if(_0x5e750c[_0xa29e('0x10')]){if(_0x5e750c['error']['code']===0x1f4){logger[_0xa29e('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x2c8680,_0x5e750c[_0xa29e('0x10')]['message']);return _0x4705f4(_0x5e750c[_0xa29e('0x10')][_0xa29e('0x11')]);}logger[_0xa29e('0x10')](_0xa29e('0xb'),_0x2c8680,_0x5e750c[_0xa29e('0x10')]['message']);return _0x255bfb(_0x5e750c[_0xa29e('0x10')][_0xa29e('0x11')]);}else{logger[_0xa29e('0xa')](_0xa29e('0xb'),_0x2c8680,_0xa29e('0xc'));_0x255bfb(_0x5e750c['result'][_0xa29e('0x11')]);}})[_0xa29e('0x12')](function(_0x5bf25e){logger[_0xa29e('0x10')](_0xa29e('0xb'),_0x2c8680,_0x5bf25e);_0x4705f4(_0x5bf25e);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 4c747ba..27bf7cf 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(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'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 _0xe14b=['addFields','update','delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','express','Router','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','/create_many','bulkCreate'];(function(_0x10a7b2,_0x37587c){var _0x5cf00e=function(_0x69b0b9){while(--_0x69b0b9){_0x10a7b2['push'](_0x10a7b2['shift']());}};_0x5cf00e(++_0x37587c);}(_0xe14b,0x93));var _0xbe14=function(_0x5d669e,_0x43635d){_0x5d669e=_0x5d669e-0x0;var _0x3fe2f3=_0xe14b[_0x5d669e];return _0x3fe2f3;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xbe14('0x4'));var config=require('../../config/environment');var controller=require('./analyticFieldReport.controller');router[_0xbe14('0x5')]('/',auth[_0xbe14('0x6')](),controller[_0xbe14('0x7')]);router[_0xbe14('0x5')](_0xbe14('0x8'),auth[_0xbe14('0x6')](),controller[_0xbe14('0x9')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xbe14('0xa')](_0xbe14('0xb'),auth[_0xbe14('0x6')](),controller[_0xbe14('0xc')]);router['post']('/:id/create_many',auth[_0xbe14('0x6')](),controller[_0xbe14('0xd')]);router['put'](_0xbe14('0x8'),auth[_0xbe14('0x6')](),controller[_0xbe14('0xe')]);router[_0xbe14('0xf')](_0xbe14('0x10'),auth[_0xbe14('0x6')](),controller[_0xbe14('0x11')]);router[_0xbe14('0xf')](_0xbe14('0x8'),auth[_0xbe14('0x6')](),controller[_0xbe14('0x12')]);module[_0xbe14('0x13')]=router; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js index 1b88736..17a2179 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 _0xc30f=['TEXT','sequelize','exports','STRING','name'];(function(_0x39a292,_0x5de91f){var _0x894739=function(_0x1bb621){while(--_0x1bb621){_0x39a292['push'](_0x39a292['shift']());}};_0x894739(++_0x5de91f);}(_0xc30f,0x97));var _0xfc30=function(_0x2236dc,_0x43c7f9){_0x2236dc=_0x2236dc-0x0;var _0x20583f=_0xc30f[_0x2236dc];return _0x20583f;};'use strict';var Sequelize=require(_0xfc30('0x0'));module[_0xfc30('0x1')]={'name':{'type':Sequelize[_0xfc30('0x2')],'allowNull':![],'unique':_0xfc30('0x3')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0xfc30('0x4')]},'description':{'type':Sequelize[_0xfc30('0x2')]}}; \ No newline at end of file +var _0x96cc=['TEXT','sequelize','STRING'];(function(_0x3437a2,_0x4aa5ec){var _0x38ec72=function(_0x39009b){while(--_0x39009b){_0x3437a2['push'](_0x3437a2['shift']());}};_0x38ec72(++_0x4aa5ec);}(_0x96cc,0x16c));var _0xc96c=function(_0x5caa75,_0x6bb88d){_0x5caa75=_0x5caa75-0x0;var _0x5f4f74=_0x96cc[_0x5caa75];return _0x5f4f74;};'use strict';var Sequelize=require(_0xc96c('0x0'));module['exports']={'name':{'type':Sequelize[_0xc96c('0x1')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0xc96c('0x1')]},'metric':{'type':Sequelize[_0xc96c('0x2')]},'description':{'type':Sequelize[_0xc96c('0x1')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 05bb099..f446d85 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 _0xd5fb=['userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','squel','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','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','reject','save','update','destroy','then','get','UserProfileResource','error','stack','name','send','map','AnalyticMetric','rawAttributes','fieldName','key','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','catch','params','create','body','user','role','Metrics','UserProfileSection','find'];(function(_0x2415ad,_0x1cc8b8){var _0x2b3c93=function(_0x3f3b99){while(--_0x3f3b99){_0x2415ad['push'](_0x2415ad['shift']());}};_0x2b3c93(++_0x1cc8b8);}(_0xd5fb,0x1e3));var _0xbd5f=function(_0x21eef2,_0x1480ea){_0x21eef2=_0x21eef2-0x0;var _0x32f106=_0xd5fb[_0x21eef2];return _0x32f106;};'use strict';var pdf=require(_0xbd5f('0x0'));var emlformat=require(_0xbd5f('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xbd5f('0x2'));var rp=require('request-promise');var moment=require(_0xbd5f('0x3'));var BPromise=require(_0xbd5f('0x4'));var Mustache=require(_0xbd5f('0x5'));var util=require(_0xbd5f('0x6'));var path=require(_0xbd5f('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xbd5f('0x8'));var crypto=require('crypto');var jsforce=require(_0xbd5f('0x9'));var deskjs=require(_0xbd5f('0xa'));var toCsv=require(_0xbd5f('0xb'));var querystring=require(_0xbd5f('0xc'));var Papa=require('papaparse');var Redis=require(_0xbd5f('0xd'));var authService=require(_0xbd5f('0xe'));var qs=require(_0xbd5f('0xf'));var as=require(_0xbd5f('0x10'));var hardwareService=require(_0xbd5f('0x11'));var logger=require(_0xbd5f('0x12'))(_0xbd5f('0x13'));var utils=require(_0xbd5f('0x14'));var config=require(_0xbd5f('0x15'));var db=require(_0xbd5f('0x16'))['db'];function respondWithStatusCode(_0x4fd64b,_0x190f7e){_0x190f7e=_0x190f7e||0xcc;return function(_0x42907a){if(_0x42907a){return _0x4fd64b[_0xbd5f('0x17')](_0x190f7e);}return _0x4fd64b[_0xbd5f('0x18')](_0x190f7e)[_0xbd5f('0x19')]();};}function respondWithResult(_0x145f0e,_0x368f55){_0x368f55=_0x368f55||0xc8;return function(_0x14ad10){if(_0x14ad10){return _0x145f0e['status'](_0x368f55)[_0xbd5f('0x1a')](_0x14ad10);}};}function respondWithFilteredResult(_0x1af089,_0x13e2a4){return function(_0x1de143){if(_0x1de143){var _0x46a0e0=_0x1de143[_0xbd5f('0x1b')],_0x2dd65d=_0x13e2a4[_0xbd5f('0x1c')],_0x5aaf05=_0x13e2a4[_0xbd5f('0x1c')]+_0x13e2a4[_0xbd5f('0x1d')],_0x535f12;if(_0x5aaf05>=_0x46a0e0){_0x5aaf05=_0x46a0e0;_0x535f12=0xc8;}else{_0x535f12=0xce;}_0x1af089['status'](_0x535f12);return _0x1af089[_0xbd5f('0x1e')]('Content-Range',_0x2dd65d+'-'+_0x5aaf05+'/'+_0x46a0e0)['json'](_0x1de143);}return null;};}function patchUpdates(_0x13579d){return function(_0x16fec5){try{jsonpatch['apply'](_0x16fec5,_0x13579d,!![]);}catch(_0x34afba){return BPromise[_0xbd5f('0x1f')](_0x34afba);}return _0x16fec5[_0xbd5f('0x20')]();};}function saveUpdates(_0x38e2a6,_0x59e884){return function(_0x30e643){if(_0x30e643){return _0x30e643[_0xbd5f('0x21')](_0x38e2a6)['then'](function(_0x4cbc14){return _0x4cbc14;});}return null;};}function removeEntity(_0x598dde,_0x4dfec1){return function(_0xc167c3){if(_0xc167c3){return _0xc167c3[_0xbd5f('0x22')]()[_0xbd5f('0x23')](function(){var _0x54e125=_0xc167c3[_0xbd5f('0x24')]({'plain':!![]});var _0x4c961a='Metrics';return db[_0xbd5f('0x25')]['destroy']({'where':{'type':_0x4c961a,'resourceId':_0x54e125['id']}})[_0xbd5f('0x23')](function(){return _0xc167c3;});})[_0xbd5f('0x23')](function(){_0x598dde[_0xbd5f('0x18')](0xcc)[_0xbd5f('0x19')]();});}};}function handleEntityNotFound(_0x12dbe,_0x3012a1){return function(_0x25db52){if(!_0x25db52){_0x12dbe[_0xbd5f('0x17')](0x194);}return _0x25db52;};}function handleError(_0x3ca9e6,_0x41a5e2){_0x41a5e2=_0x41a5e2||0x1f4;return function(_0x1997f5){logger[_0xbd5f('0x26')](_0x1997f5[_0xbd5f('0x27')]);if(_0x1997f5[_0xbd5f('0x28')]){delete _0x1997f5['name'];}_0x3ca9e6[_0xbd5f('0x18')](_0x41a5e2)[_0xbd5f('0x29')](_0x1997f5);};}exports['index']=function(_0x524137,_0x170d75){var _0x35e533={},_0x470a52={},_0x49eaa2={'count':0x0,'rows':[]};var _0x90e6cd=_[_0xbd5f('0x2a')](db[_0xbd5f('0x2b')][_0xbd5f('0x2c')],function(_0x56d96b){return{'name':_0x56d96b[_0xbd5f('0x2d')],'type':_0x56d96b['type'][_0xbd5f('0x2e')]};});_0x470a52['model']=_[_0xbd5f('0x2a')](_0x90e6cd,_0xbd5f('0x28'));_0x470a52[_0xbd5f('0x2f')]=_[_0xbd5f('0x30')](_0x524137[_0xbd5f('0x2f')]);_0x470a52['filters']=_['intersection'](_0x470a52[_0xbd5f('0x31')],_0x470a52[_0xbd5f('0x2f')]);_0x35e533[_0xbd5f('0x32')]=_[_0xbd5f('0x33')](_0x470a52['model'],qs['fields'](_0x524137['query'][_0xbd5f('0x34')]));_0x35e533[_0xbd5f('0x32')]=_0x35e533['attributes'][_0xbd5f('0x35')]?_0x35e533[_0xbd5f('0x32')]:_0x470a52[_0xbd5f('0x31')];if(!_0x524137[_0xbd5f('0x2f')][_0xbd5f('0x36')]('nolimit')){_0x35e533[_0xbd5f('0x1d')]=qs[_0xbd5f('0x1d')](_0x524137[_0xbd5f('0x2f')][_0xbd5f('0x1d')]);_0x35e533['offset']=qs[_0xbd5f('0x1c')](_0x524137[_0xbd5f('0x2f')]['offset']);}_0x35e533[_0xbd5f('0x37')]=qs[_0xbd5f('0x38')](_0x524137['query'][_0xbd5f('0x38')]);_0x35e533[_0xbd5f('0x39')]=qs[_0xbd5f('0x3a')](_[_0xbd5f('0x3b')](_0x524137[_0xbd5f('0x2f')],_0x470a52['filters']));if(_0x524137[_0xbd5f('0x2f')]['filter']){_0x35e533[_0xbd5f('0x39')]=_[_0xbd5f('0x3c')](_0x35e533[_0xbd5f('0x39')],{'$or':_[_0xbd5f('0x2a')](_0x90e6cd,function(_0x4f6633){if(_0x4f6633[_0xbd5f('0x3d')]!==_0xbd5f('0x3e')){var _0x445cef={};_0x445cef[_0x4f6633[_0xbd5f('0x28')]]={'$like':'%'+_0x524137[_0xbd5f('0x2f')][_0xbd5f('0x3f')]+'%'};return _0x445cef;}})});}_0x35e533=_[_0xbd5f('0x3c')]({},_0x35e533,_0x524137[_0xbd5f('0x40')]);var _0x8a6c04={'where':_0x35e533[_0xbd5f('0x39')]};return db[_0xbd5f('0x2b')][_0xbd5f('0x1b')](_0x8a6c04)['then'](function(_0x4379ee){_0x49eaa2[_0xbd5f('0x1b')]=_0x4379ee;if(_0x524137[_0xbd5f('0x2f')][_0xbd5f('0x41')]){_0x35e533[_0xbd5f('0x42')]=[{'all':!![]}];}return db[_0xbd5f('0x2b')][_0xbd5f('0x43')](_0x35e533);})['then'](function(_0x356ef9){_0x49eaa2['rows']=_0x356ef9;return _0x49eaa2;})[_0xbd5f('0x23')](respondWithFilteredResult(_0x170d75,_0x35e533))[_0xbd5f('0x44')](handleError(_0x170d75,null));};exports['show']=function(_0x2a00e1,_0x377772){var _0x170fa2={'raw':!![],'where':{'id':_0x2a00e1[_0xbd5f('0x45')]['id']}},_0xc82c08={};_0xc82c08[_0xbd5f('0x31')]=_['keys'](db[_0xbd5f('0x2b')][_0xbd5f('0x2c')]);_0xc82c08[_0xbd5f('0x2f')]=_[_0xbd5f('0x30')](_0x2a00e1['query']);_0xc82c08['filters']=_[_0xbd5f('0x33')](_0xc82c08['model'],_0xc82c08['query']);_0x170fa2[_0xbd5f('0x32')]=_['intersection'](_0xc82c08[_0xbd5f('0x31')],qs[_0xbd5f('0x34')](_0x2a00e1['query'][_0xbd5f('0x34')]));_0x170fa2[_0xbd5f('0x32')]=_0x170fa2['attributes'][_0xbd5f('0x35')]?_0x170fa2['attributes']:_0xc82c08[_0xbd5f('0x31')];if(_0x2a00e1[_0xbd5f('0x2f')][_0xbd5f('0x41')]){_0x170fa2[_0xbd5f('0x42')]=[{'all':!![]}];}_0x170fa2=_[_0xbd5f('0x3c')]({},_0x170fa2,_0x2a00e1[_0xbd5f('0x40')]);return db[_0xbd5f('0x2b')]['find'](_0x170fa2)[_0xbd5f('0x23')](handleEntityNotFound(_0x377772,null))['then'](respondWithResult(_0x377772,null))[_0xbd5f('0x44')](handleError(_0x377772,null));};exports[_0xbd5f('0x46')]=function(_0x97a87f,_0xe540b0){return db[_0xbd5f('0x2b')][_0xbd5f('0x46')](_0x97a87f[_0xbd5f('0x47')],{})['then'](function(_0x212ec0){var _0x23502e=_0x97a87f[_0xbd5f('0x48')][_0xbd5f('0x24')]({'plain':!![]});if(!_0x23502e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x23502e[_0xbd5f('0x49')]==='user'){var _0x23c3ca=_0x212ec0[_0xbd5f('0x24')]({'plain':!![]});var _0x7401c5=_0xbd5f('0x4a');return db[_0xbd5f('0x4b')][_0xbd5f('0x4c')]({'where':{'name':_0x7401c5,'userProfileId':_0x23502e[_0xbd5f('0x4d')]},'raw':!![]})['then'](function(_0x1504a8){if(_0x1504a8&&_0x1504a8[_0xbd5f('0x4e')]===0x0){return db[_0xbd5f('0x25')]['create']({'name':_0x23c3ca[_0xbd5f('0x28')],'resourceId':_0x23c3ca['id'],'type':_0x1504a8[_0xbd5f('0x28')],'sectionId':_0x1504a8['id']},{})[_0xbd5f('0x23')](function(){return _0x212ec0;});}else{return _0x212ec0;}})['catch'](function(_0x513ef9){logger[_0xbd5f('0x26')](_0xbd5f('0x4f'),_0x513ef9);throw _0x513ef9;});}return _0x212ec0;})[_0xbd5f('0x23')](respondWithResult(_0xe540b0,0xc9))[_0xbd5f('0x44')](handleError(_0xe540b0,null));};exports[_0xbd5f('0x21')]=function(_0x2f3241,_0x21e3e7){if(_0x2f3241[_0xbd5f('0x47')]['id']){delete _0x2f3241[_0xbd5f('0x47')]['id'];}return db[_0xbd5f('0x2b')][_0xbd5f('0x4c')]({'where':{'id':_0x2f3241['params']['id']}})[_0xbd5f('0x23')](handleEntityNotFound(_0x21e3e7,null))['then'](saveUpdates(_0x2f3241['body'],null))['then'](respondWithResult(_0x21e3e7,null))[_0xbd5f('0x44')](handleError(_0x21e3e7,null));};exports[_0xbd5f('0x22')]=function(_0x114b01,_0x27855e){return db[_0xbd5f('0x2b')][_0xbd5f('0x4c')]({'where':{'id':_0x114b01[_0xbd5f('0x45')]['id']}})[_0xbd5f('0x23')](handleEntityNotFound(_0x27855e,null))['then'](removeEntity(_0x27855e,null))[_0xbd5f('0x44')](handleError(_0x27855e,null));}; \ No newline at end of file +var _0xffa1=['limit','set','Content-Range','reject','save','update','then','destroy','Metrics','UserProfileResource','end','error','stack','name','send','index','AnalyticMetric','rawAttributes','fieldName','type','map','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','find','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','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'];(function(_0x4d1df1,_0x5e6e2c){var _0x35382f=function(_0x3129b5){while(--_0x3129b5){_0x4d1df1['push'](_0x4d1df1['shift']());}};_0x35382f(++_0x5e6e2c);}(_0xffa1,0xde));var _0x1ffa=function(_0x3049ab,_0x46ec37){_0x3049ab=_0x3049ab-0x0;var _0x1af9dc=_0xffa1[_0x3049ab];return _0x1af9dc;};'use strict';var pdf=require(_0x1ffa('0x0'));var emlformat=require(_0x1ffa('0x1'));var rimraf=require(_0x1ffa('0x2'));var zipdir=require(_0x1ffa('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1ffa('0x4'));var moment=require(_0x1ffa('0x5'));var BPromise=require(_0x1ffa('0x6'));var Mustache=require(_0x1ffa('0x7'));var util=require(_0x1ffa('0x8'));var path=require('path');var sox=require(_0x1ffa('0x9'));var csv=require(_0x1ffa('0xa'));var ejs=require(_0x1ffa('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x1ffa('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1ffa('0xd'));var toCsv=require(_0x1ffa('0xa'));var querystring=require(_0x1ffa('0xe'));var Papa=require('papaparse');var Redis=require(_0x1ffa('0xf'));var authService=require(_0x1ffa('0x10'));var qs=require(_0x1ffa('0x11'));var as=require(_0x1ffa('0x12'));var hardwareService=require(_0x1ffa('0x13'));var logger=require(_0x1ffa('0x14'))(_0x1ffa('0x15'));var utils=require(_0x1ffa('0x16'));var config=require(_0x1ffa('0x17'));var db=require(_0x1ffa('0x18'))['db'];function respondWithStatusCode(_0x2b4033,_0x1fef89){_0x1fef89=_0x1fef89||0xcc;return function(_0x3dae2b){if(_0x3dae2b){return _0x2b4033[_0x1ffa('0x19')](_0x1fef89);}return _0x2b4033[_0x1ffa('0x1a')](_0x1fef89)['end']();};}function respondWithResult(_0x3c9f3c,_0x567481){_0x567481=_0x567481||0xc8;return function(_0x35ffcb){if(_0x35ffcb){return _0x3c9f3c[_0x1ffa('0x1a')](_0x567481)[_0x1ffa('0x1b')](_0x35ffcb);}};}function respondWithFilteredResult(_0x1dde64,_0x275c2b){return function(_0x51f973){if(_0x51f973){var _0x392fcb=_0x51f973[_0x1ffa('0x1c')],_0x15196b=_0x275c2b[_0x1ffa('0x1d')],_0x210549=_0x275c2b[_0x1ffa('0x1d')]+_0x275c2b[_0x1ffa('0x1e')],_0x55ec4d;if(_0x210549>=_0x392fcb){_0x210549=_0x392fcb;_0x55ec4d=0xc8;}else{_0x55ec4d=0xce;}_0x1dde64[_0x1ffa('0x1a')](_0x55ec4d);return _0x1dde64[_0x1ffa('0x1f')](_0x1ffa('0x20'),_0x15196b+'-'+_0x210549+'/'+_0x392fcb)[_0x1ffa('0x1b')](_0x51f973);}return null;};}function patchUpdates(_0x33f042){return function(_0x10322a){try{jsonpatch['apply'](_0x10322a,_0x33f042,!![]);}catch(_0x501a53){return BPromise[_0x1ffa('0x21')](_0x501a53);}return _0x10322a[_0x1ffa('0x22')]();};}function saveUpdates(_0x4f560f,_0x223062){return function(_0x279234){if(_0x279234){return _0x279234[_0x1ffa('0x23')](_0x4f560f)[_0x1ffa('0x24')](function(_0x32a476){return _0x32a476;});}return null;};}function removeEntity(_0x138156,_0x4fba71){return function(_0x2d99be){if(_0x2d99be){return _0x2d99be[_0x1ffa('0x25')]()[_0x1ffa('0x24')](function(){var _0xa40c39=_0x2d99be['get']({'plain':!![]});var _0x1f8e5f=_0x1ffa('0x26');return db[_0x1ffa('0x27')][_0x1ffa('0x25')]({'where':{'type':_0x1f8e5f,'resourceId':_0xa40c39['id']}})['then'](function(){return _0x2d99be;});})[_0x1ffa('0x24')](function(){_0x138156[_0x1ffa('0x1a')](0xcc)[_0x1ffa('0x28')]();});}};}function handleEntityNotFound(_0x184bf3,_0xb56d1b){return function(_0x4cc02d){if(!_0x4cc02d){_0x184bf3[_0x1ffa('0x19')](0x194);}return _0x4cc02d;};}function handleError(_0x26d14f,_0x5163c3){_0x5163c3=_0x5163c3||0x1f4;return function(_0x221ef5){logger[_0x1ffa('0x29')](_0x221ef5[_0x1ffa('0x2a')]);if(_0x221ef5[_0x1ffa('0x2b')]){delete _0x221ef5[_0x1ffa('0x2b')];}_0x26d14f[_0x1ffa('0x1a')](_0x5163c3)[_0x1ffa('0x2c')](_0x221ef5);};}exports[_0x1ffa('0x2d')]=function(_0x321ea8,_0x39e79b){var _0x10d5f2={},_0x1a12fd={},_0x5f1cc3={'count':0x0,'rows':[]};var _0x3849ba=_['map'](db[_0x1ffa('0x2e')][_0x1ffa('0x2f')],function(_0x221291){return{'name':_0x221291[_0x1ffa('0x30')],'type':_0x221291[_0x1ffa('0x31')]['key']};});_0x1a12fd['model']=_[_0x1ffa('0x32')](_0x3849ba,_0x1ffa('0x2b'));_0x1a12fd[_0x1ffa('0x33')]=_['keys'](_0x321ea8[_0x1ffa('0x33')]);_0x1a12fd[_0x1ffa('0x34')]=_[_0x1ffa('0x35')](_0x1a12fd['model'],_0x1a12fd['query']);_0x10d5f2['attributes']=_[_0x1ffa('0x35')](_0x1a12fd[_0x1ffa('0x36')],qs[_0x1ffa('0x37')](_0x321ea8[_0x1ffa('0x33')][_0x1ffa('0x37')]));_0x10d5f2[_0x1ffa('0x38')]=_0x10d5f2['attributes'][_0x1ffa('0x39')]?_0x10d5f2['attributes']:_0x1a12fd[_0x1ffa('0x36')];if(!_0x321ea8[_0x1ffa('0x33')][_0x1ffa('0x3a')](_0x1ffa('0x3b'))){_0x10d5f2['limit']=qs[_0x1ffa('0x1e')](_0x321ea8[_0x1ffa('0x33')][_0x1ffa('0x1e')]);_0x10d5f2[_0x1ffa('0x1d')]=qs[_0x1ffa('0x1d')](_0x321ea8[_0x1ffa('0x33')][_0x1ffa('0x1d')]);}_0x10d5f2['order']=qs[_0x1ffa('0x3c')](_0x321ea8[_0x1ffa('0x33')][_0x1ffa('0x3c')]);_0x10d5f2[_0x1ffa('0x3d')]=qs[_0x1ffa('0x34')](_[_0x1ffa('0x3e')](_0x321ea8[_0x1ffa('0x33')],_0x1a12fd[_0x1ffa('0x34')]));if(_0x321ea8['query'][_0x1ffa('0x3f')]){_0x10d5f2[_0x1ffa('0x3d')]=_[_0x1ffa('0x40')](_0x10d5f2[_0x1ffa('0x3d')],{'$or':_[_0x1ffa('0x32')](_0x3849ba,function(_0xd6de80){if(_0xd6de80[_0x1ffa('0x31')]!==_0x1ffa('0x41')){var _0x15b153={};_0x15b153[_0xd6de80[_0x1ffa('0x2b')]]={'$like':'%'+_0x321ea8[_0x1ffa('0x33')][_0x1ffa('0x3f')]+'%'};return _0x15b153;}})});}_0x10d5f2=_[_0x1ffa('0x40')]({},_0x10d5f2,_0x321ea8[_0x1ffa('0x42')]);var _0x52325b={'where':_0x10d5f2[_0x1ffa('0x3d')]};return db[_0x1ffa('0x2e')][_0x1ffa('0x1c')](_0x52325b)[_0x1ffa('0x24')](function(_0x300d65){_0x5f1cc3[_0x1ffa('0x1c')]=_0x300d65;if(_0x321ea8['query'][_0x1ffa('0x43')]){_0x10d5f2[_0x1ffa('0x44')]=[{'all':!![]}];}return db[_0x1ffa('0x2e')][_0x1ffa('0x45')](_0x10d5f2);})[_0x1ffa('0x24')](function(_0x535fc1){_0x5f1cc3[_0x1ffa('0x46')]=_0x535fc1;return _0x5f1cc3;})['then'](respondWithFilteredResult(_0x39e79b,_0x10d5f2))[_0x1ffa('0x47')](handleError(_0x39e79b,null));};exports[_0x1ffa('0x48')]=function(_0x16c197,_0x994673){var _0x4c72ee={'raw':!![],'where':{'id':_0x16c197['params']['id']}},_0x41ba50={};_0x41ba50[_0x1ffa('0x36')]=_['keys'](db[_0x1ffa('0x2e')]['rawAttributes']);_0x41ba50[_0x1ffa('0x33')]=_[_0x1ffa('0x49')](_0x16c197[_0x1ffa('0x33')]);_0x41ba50[_0x1ffa('0x34')]=_[_0x1ffa('0x35')](_0x41ba50[_0x1ffa('0x36')],_0x41ba50['query']);_0x4c72ee['attributes']=_['intersection'](_0x41ba50['model'],qs['fields'](_0x16c197['query'][_0x1ffa('0x37')]));_0x4c72ee[_0x1ffa('0x38')]=_0x4c72ee[_0x1ffa('0x38')][_0x1ffa('0x39')]?_0x4c72ee[_0x1ffa('0x38')]:_0x41ba50[_0x1ffa('0x36')];if(_0x16c197['query'][_0x1ffa('0x43')]){_0x4c72ee['include']=[{'all':!![]}];}_0x4c72ee=_['merge']({},_0x4c72ee,_0x16c197[_0x1ffa('0x42')]);return db[_0x1ffa('0x2e')][_0x1ffa('0x4a')](_0x4c72ee)[_0x1ffa('0x24')](handleEntityNotFound(_0x994673,null))[_0x1ffa('0x24')](respondWithResult(_0x994673,null))[_0x1ffa('0x47')](handleError(_0x994673,null));};exports['create']=function(_0x2f18e9,_0x2575f8){return db['AnalyticMetric']['create'](_0x2f18e9[_0x1ffa('0x4b')],{})['then'](function(_0xb5d86c){var _0x3c4e17=_0x2f18e9[_0x1ffa('0x4c')][_0x1ffa('0x4d')]({'plain':!![]});if(!_0x3c4e17)throw new Error(_0x1ffa('0x4e'));if(_0x3c4e17['role']===_0x1ffa('0x4c')){var _0x2eb6b7=_0xb5d86c[_0x1ffa('0x4d')]({'plain':!![]});var _0x4c6c3a=_0x1ffa('0x26');return db[_0x1ffa('0x4f')][_0x1ffa('0x4a')]({'where':{'name':_0x4c6c3a,'userProfileId':_0x3c4e17[_0x1ffa('0x50')]},'raw':!![]})['then'](function(_0x1fe3d5){if(_0x1fe3d5&&_0x1fe3d5[_0x1ffa('0x51')]===0x0){return db['UserProfileResource']['create']({'name':_0x2eb6b7[_0x1ffa('0x2b')],'resourceId':_0x2eb6b7['id'],'type':_0x1fe3d5[_0x1ffa('0x2b')],'sectionId':_0x1fe3d5['id']},{})[_0x1ffa('0x24')](function(){return _0xb5d86c;});}else{return _0xb5d86c;}})[_0x1ffa('0x47')](function(_0x4a8f7e){logger[_0x1ffa('0x29')](_0x1ffa('0x52'),_0x4a8f7e);throw _0x4a8f7e;});}return _0xb5d86c;})[_0x1ffa('0x24')](respondWithResult(_0x2575f8,0xc9))['catch'](handleError(_0x2575f8,null));};exports['update']=function(_0x5c63a6,_0x1454aa){if(_0x5c63a6[_0x1ffa('0x4b')]['id']){delete _0x5c63a6[_0x1ffa('0x4b')]['id'];}return db[_0x1ffa('0x2e')][_0x1ffa('0x4a')]({'where':{'id':_0x5c63a6['params']['id']}})[_0x1ffa('0x24')](handleEntityNotFound(_0x1454aa,null))[_0x1ffa('0x24')](saveUpdates(_0x5c63a6[_0x1ffa('0x4b')],null))[_0x1ffa('0x24')](respondWithResult(_0x1454aa,null))[_0x1ffa('0x47')](handleError(_0x1454aa,null));};exports[_0x1ffa('0x25')]=function(_0x326686,_0x23db51){return db['AnalyticMetric'][_0x1ffa('0x4a')]({'where':{'id':_0x326686[_0x1ffa('0x53')]['id']}})['then'](handleEntityNotFound(_0x23db51,null))['then'](removeEntity(_0x23db51,null))['catch'](handleError(_0x23db51,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index c246f59..bf20792 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 _0x7288=['request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7288,0x105));var _0x8728=function(_0x246358,_0x5f5a4a){_0x246358=_0x246358-0x0;var _0x229541=_0x7288[_0x246358];return _0x229541;};'use strict';var _=require(_0x8728('0x0'));var util=require(_0x8728('0x1'));var logger=require(_0x8728('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8728('0x3'));var fs=require('fs');var path=require(_0x8728('0x4'));var rimraf=require(_0x8728('0x5'));var config=require(_0x8728('0x6'));var attributes=require(_0x8728('0x7'));module[_0x8728('0x8')]=function(_0x28b5bd,_0xefcd12){return _0x28b5bd[_0x8728('0x9')](_0x8728('0xa'),attributes,{'tableName':_0x8728('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2cfb=['request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','lodash','../../config/logger','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2cfb,0x1dd));var _0xb2cf=function(_0x12a554,_0x3d7ef8){_0x12a554=_0x12a554-0x0;var _0x244ba0=_0x2cfb[_0x12a554];return _0x244ba0;};'use strict';var _=require(_0xb2cf('0x0'));var util=require('util');var logger=require(_0xb2cf('0x1'))('api');var moment=require('moment');var BPromise=require(_0xb2cf('0x2'));var rp=require(_0xb2cf('0x3'));var fs=require('fs');var path=require(_0xb2cf('0x4'));var rimraf=require(_0xb2cf('0x5'));var config=require(_0xb2cf('0x6'));var attributes=require(_0xb2cf('0x7'));module[_0xb2cf('0x8')]=function(_0x5f28f6,_0x549631){return _0x5f28f6[_0xb2cf('0x9')](_0xb2cf('0xa'),attributes,{'tableName':_0xb2cf('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 afd5e4a..7540ded 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 _0xfb2d=['code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','then','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','error'];(function(_0x4b4865,_0xb43449){var _0x190dc2=function(_0x2b41f7){while(--_0x2b41f7){_0x4b4865['push'](_0x4b4865['shift']());}};_0x190dc2(++_0xb43449);}(_0xfb2d,0xe0));var _0xdfb2=function(_0x474bc0,_0x26989c){_0x474bc0=_0x474bc0-0x0;var _0x4b24cf=_0xfb2d[_0x474bc0];return _0x4b24cf;};'use strict';var _=require(_0xdfb2('0x0'));var util=require('util');var moment=require(_0xdfb2('0x1'));var BPromise=require(_0xdfb2('0x2'));var rs=require(_0xdfb2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdfb2('0x4'))['db'];var utils=require(_0xdfb2('0x5'));var logger=require(_0xdfb2('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xdfb2('0x7'));var client=jayson['client'][_0xdfb2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f55ef,_0x1cb480,_0x183872){return new BPromise(function(_0x16672d,_0x2cc759){return client[_0xdfb2('0x9')](_0x3f55ef,_0x183872)[_0xdfb2('0xa')](function(_0x333298){logger['info'](_0xdfb2('0xb'),_0x1cb480,_0xdfb2('0xc'));logger[_0xdfb2('0xd')](_0xdfb2('0xe'),_0x1cb480,_0xdfb2('0xc'),JSON['stringify'](_0x333298));if(_0x333298[_0xdfb2('0xf')]){if(_0x333298['error'][_0xdfb2('0x10')]===0x1f4){logger[_0xdfb2('0xf')](_0xdfb2('0xb'),_0x1cb480,_0x333298[_0xdfb2('0xf')][_0xdfb2('0x11')]);return _0x2cc759(_0x333298[_0xdfb2('0xf')][_0xdfb2('0x11')]);}logger[_0xdfb2('0xf')](_0xdfb2('0xb'),_0x1cb480,_0x333298[_0xdfb2('0xf')][_0xdfb2('0x11')]);return _0x16672d(_0x333298[_0xdfb2('0xf')]['message']);}else{logger['info'](_0xdfb2('0xb'),_0x1cb480,_0xdfb2('0xc'));_0x16672d(_0x333298[_0xdfb2('0x12')][_0xdfb2('0x11')]);}})[_0xdfb2('0x13')](function(_0x4a3edf){logger[_0xdfb2('0xf')]('AnalyticMetric,\x20%s,\x20%s',_0x1cb480,_0x4a3edf);_0x2cc759(_0x4a3edf);});});} \ No newline at end of file +var _0x81eb=['lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x19616a,_0x545c46){var _0x57bfb4=function(_0x9ab37b){while(--_0x9ab37b){_0x19616a['push'](_0x19616a['shift']());}};_0x57bfb4(++_0x545c46);}(_0x81eb,0x11d));var _0xb81e=function(_0x5da9ec,_0x337717){_0x5da9ec=_0x5da9ec-0x0;var _0x454e6d=_0x81eb[_0x5da9ec];return _0x454e6d;};'use strict';var _=require(_0xb81e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb81e('0x1'));var rs=require(_0xb81e('0x2'));var fs=require('fs');var Redis=require(_0xb81e('0x3'));var db=require(_0xb81e('0x4'))['db'];var utils=require(_0xb81e('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xb81e('0x6'));var jayson=require(_0xb81e('0x7'));var client=jayson[_0xb81e('0x8')][_0xb81e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x8b10a6,_0x1e0c6b,_0x4d2db9){return new BPromise(function(_0x3113ca,_0x579da1){return client[_0xb81e('0xa')](_0x8b10a6,_0x4d2db9)[_0xb81e('0xb')](function(_0x2be001){logger[_0xb81e('0xc')](_0xb81e('0xd'),_0x1e0c6b,_0xb81e('0xe'));logger['debug'](_0xb81e('0xf'),_0x1e0c6b,'request\x20sent',JSON[_0xb81e('0x10')](_0x2be001));if(_0x2be001['error']){if(_0x2be001[_0xb81e('0x11')]['code']===0x1f4){logger[_0xb81e('0x11')](_0xb81e('0xd'),_0x1e0c6b,_0x2be001[_0xb81e('0x11')][_0xb81e('0x12')]);return _0x579da1(_0x2be001[_0xb81e('0x11')]['message']);}logger[_0xb81e('0x11')](_0xb81e('0xd'),_0x1e0c6b,_0x2be001[_0xb81e('0x11')][_0xb81e('0x12')]);return _0x3113ca(_0x2be001[_0xb81e('0x11')][_0xb81e('0x12')]);}else{logger['info'](_0xb81e('0xd'),_0x1e0c6b,_0xb81e('0xe'));_0x3113ca(_0x2be001['result'][_0xb81e('0x12')]);}})['catch'](function(_0x1edccd){logger['error'](_0xb81e('0xd'),_0x1e0c6b,_0x1edccd);_0x579da1(_0x1edccd);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index c06f93c..edf9c1d 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 _0x1261=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','/:id','show','post','isAuthenticated','create','put','update','delete'];(function(_0x40911a,_0x55ec99){var _0x27e8e3=function(_0x2ba910){while(--_0x2ba910){_0x40911a['push'](_0x40911a['shift']());}};_0x27e8e3(++_0x55ec99);}(_0x1261,0x144));var _0x1126=function(_0x1d326a,_0x89b53){_0x1d326a=_0x1d326a-0x0;var _0x5804d5=_0x1261[_0x1d326a];return _0x5804d5;};'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('0xc')]('/',auth[_0x1126('0xd')](),controller[_0x1126('0xe')]);router[_0x1126('0xf')]('/:id',auth[_0x1126('0xd')](),controller[_0x1126('0x10')]);router[_0x1126('0x11')]('/:id',auth[_0x1126('0xd')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x57ca=['isAuthenticated','index','/:id','show','post','create','delete','destroy','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x1be994,_0x267018){var _0x365952=function(_0x4869ed){while(--_0x4869ed){_0x1be994['push'](_0x1be994['shift']());}};_0x365952(++_0x267018);}(_0x57ca,0x108));var _0xa57c=function(_0x2ebae1,_0x58acde){_0x2ebae1=_0x2ebae1-0x0;var _0x26eebb=_0x57ca[_0x2ebae1];return _0x26eebb;};'use strict';var multer=require('multer');var util=require(_0xa57c('0x0'));var path=require(_0xa57c('0x1'));var timeout=require('connect-timeout');var express=require(_0xa57c('0x2'));var router=express[_0xa57c('0x3')]();var auth=require(_0xa57c('0x4'));var interaction=require(_0xa57c('0x5'));var config=require(_0xa57c('0x6'));var controller=require('./analyticMetric.controller');router[_0xa57c('0x7')]('/',auth[_0xa57c('0x8')](),controller[_0xa57c('0x9')]);router[_0xa57c('0x7')](_0xa57c('0xa'),auth[_0xa57c('0x8')](),controller[_0xa57c('0xb')]);router[_0xa57c('0xc')]('/',auth['isAuthenticated'](),controller[_0xa57c('0xd')]);router['put'](_0xa57c('0xa'),auth[_0xa57c('0x8')](),controller['update']);router[_0xa57c('0xe')]('/:id',auth[_0xa57c('0x8')](),controller[_0xa57c('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 95f89d6..d13f339 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 _0x4775=['sequelize','exports','TEXT'];(function(_0x310938,_0x3dcc27){var _0x5856a2=function(_0x3c5d31){while(--_0x3c5d31){_0x310938['push'](_0x310938['shift']());}};_0x5856a2(++_0x3dcc27);}(_0x4775,0x84));var _0x5477=function(_0x525af9,_0x4edd23){_0x525af9=_0x525af9-0x0;var _0x129fbf=_0x4775[_0x525af9];return _0x129fbf;};'use strict';var Sequelize=require(_0x5477('0x0'));module[_0x5477('0x1')]={'tree':{'type':Sequelize[_0x5477('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x8dda=['exports','TEXT','sequelize'];(function(_0x97d4b6,_0x1b8eab){var _0x364238=function(_0x496705){while(--_0x496705){_0x97d4b6['push'](_0x97d4b6['shift']());}};_0x364238(++_0x1b8eab);}(_0x8dda,0x125));var _0xa8dd=function(_0x133e37,_0xbe3667){_0x133e37=_0x133e37-0x0;var _0x4942d8=_0x8dda[_0x133e37];return _0x4942d8;};'use strict';var Sequelize=require(_0xa8dd('0x0'));module[_0xa8dd('0x1')]={'tree':{'type':Sequelize[_0xa8dd('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index ca308e6..a38311f 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 _0xdd4f=['intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','include','findAll','rows','catch','show','params','length','create','body','find','html-pdf','fast-json-patch','request-promise','bluebird','mustache','util','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','sendStatus','end','status','offset','limit','set','Content-Range','json','reject','save','update','then','destroy','error','stack','name','send','index','AnalyticTreeReport','rawAttributes','fieldName','type','model','map','query','keys','filters'];(function(_0x503e90,_0x11dd3a){var _0x8d2356=function(_0x4c44a5){while(--_0x4c44a5){_0x503e90['push'](_0x503e90['shift']());}};_0x8d2356(++_0x11dd3a);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0x373371,_0x822e7f){_0x373371=_0x373371-0x0;var _0x4fc510=_0xdd4f[_0x373371];return _0x4fc510;};'use strict';var pdf=require(_0xfdd4('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xfdd4('0x1'));var rp=require(_0xfdd4('0x2'));var moment=require('moment');var BPromise=require(_0xfdd4('0x3'));var Mustache=require(_0xfdd4('0x4'));var util=require(_0xfdd4('0x5'));var path=require('path');var sox=require(_0xfdd4('0x6'));var csv=require(_0xfdd4('0x7'));var ejs=require(_0xfdd4('0x8'));var fs=require('fs');var _=require(_0xfdd4('0x9'));var squel=require(_0xfdd4('0xa'));var crypto=require('crypto');var jsforce=require(_0xfdd4('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xfdd4('0x7'));var querystring=require(_0xfdd4('0xc'));var Papa=require(_0xfdd4('0xd'));var Redis=require('ioredis');var authService=require(_0xfdd4('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xfdd4('0xf'));var hardwareService=require(_0xfdd4('0x10'));var logger=require(_0xfdd4('0x11'))(_0xfdd4('0x12'));var utils=require(_0xfdd4('0x13'));var config=require(_0xfdd4('0x14'));var db=require(_0xfdd4('0x15'))['db'];function respondWithStatusCode(_0x1c71c4,_0x3f07f1){_0x3f07f1=_0x3f07f1||0xcc;return function(_0x4565e6){if(_0x4565e6){return _0x1c71c4[_0xfdd4('0x16')](_0x3f07f1);}return _0x1c71c4['status'](_0x3f07f1)[_0xfdd4('0x17')]();};}function respondWithResult(_0xd7dbf,_0x227099){_0x227099=_0x227099||0xc8;return function(_0x57b21f){if(_0x57b21f){return _0xd7dbf[_0xfdd4('0x18')](_0x227099)['json'](_0x57b21f);}};}function respondWithFilteredResult(_0x467824,_0x42c3a8){return function(_0x2f34ec){if(_0x2f34ec){var _0x431255=_0x2f34ec['count'],_0x37b05f=_0x42c3a8[_0xfdd4('0x19')],_0x52cf2c=_0x42c3a8[_0xfdd4('0x19')]+_0x42c3a8[_0xfdd4('0x1a')],_0x47ed1d;if(_0x52cf2c>=_0x431255){_0x52cf2c=_0x431255;_0x47ed1d=0xc8;}else{_0x47ed1d=0xce;}_0x467824[_0xfdd4('0x18')](_0x47ed1d);return _0x467824[_0xfdd4('0x1b')](_0xfdd4('0x1c'),_0x37b05f+'-'+_0x52cf2c+'/'+_0x431255)[_0xfdd4('0x1d')](_0x2f34ec);}return null;};}function patchUpdates(_0x2ffd5f){return function(_0x32e00d){try{jsonpatch['apply'](_0x32e00d,_0x2ffd5f,!![]);}catch(_0x1e5d91){return BPromise[_0xfdd4('0x1e')](_0x1e5d91);}return _0x32e00d[_0xfdd4('0x1f')]();};}function saveUpdates(_0x36e611,_0x1454f1){return function(_0x29cc8d){if(_0x29cc8d){return _0x29cc8d[_0xfdd4('0x20')](_0x36e611)[_0xfdd4('0x21')](function(_0x523a7d){return _0x523a7d;});}return null;};}function removeEntity(_0x2147e6,_0x17302b){return function(_0x2a24e8){if(_0x2a24e8){return _0x2a24e8[_0xfdd4('0x22')]()[_0xfdd4('0x21')](function(){_0x2147e6[_0xfdd4('0x18')](0xcc)[_0xfdd4('0x17')]();});}};}function handleEntityNotFound(_0x277ec1,_0x538b00){return function(_0x1e14da){if(!_0x1e14da){_0x277ec1[_0xfdd4('0x16')](0x194);}return _0x1e14da;};}function handleError(_0x4397a3,_0x53d35a){_0x53d35a=_0x53d35a||0x1f4;return function(_0x58fe0d){logger[_0xfdd4('0x23')](_0x58fe0d[_0xfdd4('0x24')]);if(_0x58fe0d[_0xfdd4('0x25')]){delete _0x58fe0d[_0xfdd4('0x25')];}_0x4397a3['status'](_0x53d35a)[_0xfdd4('0x26')](_0x58fe0d);};}exports[_0xfdd4('0x27')]=function(_0x3cd2c9,_0x31e053){var _0x3c6728={},_0x192471={},_0x453a48={'count':0x0,'rows':[]};var _0x37b7a2=_['map'](db[_0xfdd4('0x28')][_0xfdd4('0x29')],function(_0x385a68){return{'name':_0x385a68[_0xfdd4('0x2a')],'type':_0x385a68[_0xfdd4('0x2b')]['key']};});_0x192471[_0xfdd4('0x2c')]=_[_0xfdd4('0x2d')](_0x37b7a2,_0xfdd4('0x25'));_0x192471[_0xfdd4('0x2e')]=_[_0xfdd4('0x2f')](_0x3cd2c9['query']);_0x192471[_0xfdd4('0x30')]=_[_0xfdd4('0x31')](_0x192471[_0xfdd4('0x2c')],_0x192471['query']);_0x3c6728[_0xfdd4('0x32')]=_['intersection'](_0x192471[_0xfdd4('0x2c')],qs[_0xfdd4('0x33')](_0x3cd2c9['query']['fields']));_0x3c6728[_0xfdd4('0x32')]=_0x3c6728[_0xfdd4('0x32')]['length']?_0x3c6728['attributes']:_0x192471[_0xfdd4('0x2c')];if(!_0x3cd2c9[_0xfdd4('0x2e')][_0xfdd4('0x34')](_0xfdd4('0x35'))){_0x3c6728[_0xfdd4('0x1a')]=qs[_0xfdd4('0x1a')](_0x3cd2c9[_0xfdd4('0x2e')][_0xfdd4('0x1a')]);_0x3c6728[_0xfdd4('0x19')]=qs[_0xfdd4('0x19')](_0x3cd2c9[_0xfdd4('0x2e')][_0xfdd4('0x19')]);}_0x3c6728[_0xfdd4('0x36')]=qs[_0xfdd4('0x37')](_0x3cd2c9[_0xfdd4('0x2e')][_0xfdd4('0x37')]);_0x3c6728[_0xfdd4('0x38')]=qs[_0xfdd4('0x30')](_[_0xfdd4('0x39')](_0x3cd2c9[_0xfdd4('0x2e')],_0x192471[_0xfdd4('0x30')]));if(_0x3cd2c9[_0xfdd4('0x2e')][_0xfdd4('0x3a')]){_0x3c6728[_0xfdd4('0x38')]=_[_0xfdd4('0x3b')](_0x3c6728[_0xfdd4('0x38')],{'$or':_['map'](_0x37b7a2,function(_0x2b6c87){if(_0x2b6c87[_0xfdd4('0x2b')]!==_0xfdd4('0x3c')){var _0x439389={};_0x439389[_0x2b6c87[_0xfdd4('0x25')]]={'$like':'%'+_0x3cd2c9[_0xfdd4('0x2e')]['filter']+'%'};return _0x439389;}})});}_0x3c6728=_[_0xfdd4('0x3b')]({},_0x3c6728,_0x3cd2c9['options']);var _0xeca9d={'where':_0x3c6728[_0xfdd4('0x38')]};return db[_0xfdd4('0x28')][_0xfdd4('0x3d')](_0xeca9d)['then'](function(_0x1c6f43){_0x453a48[_0xfdd4('0x3d')]=_0x1c6f43;if(_0x3cd2c9[_0xfdd4('0x2e')][_0xfdd4('0x3e')]){_0x3c6728[_0xfdd4('0x3f')]=[{'all':!![]}];}return db[_0xfdd4('0x28')][_0xfdd4('0x40')](_0x3c6728);})[_0xfdd4('0x21')](function(_0xe65944){_0x453a48[_0xfdd4('0x41')]=_0xe65944;return _0x453a48;})['then'](respondWithFilteredResult(_0x31e053,_0x3c6728))[_0xfdd4('0x42')](handleError(_0x31e053,null));};exports[_0xfdd4('0x43')]=function(_0x210a15,_0x67a1e3){var _0x5173db={'raw':!![],'where':{'id':_0x210a15[_0xfdd4('0x44')]['id']}},_0x3e2bda={};_0x3e2bda[_0xfdd4('0x2c')]=_[_0xfdd4('0x2f')](db[_0xfdd4('0x28')]['rawAttributes']);_0x3e2bda[_0xfdd4('0x2e')]=_[_0xfdd4('0x2f')](_0x210a15[_0xfdd4('0x2e')]);_0x3e2bda[_0xfdd4('0x30')]=_[_0xfdd4('0x31')](_0x3e2bda[_0xfdd4('0x2c')],_0x3e2bda[_0xfdd4('0x2e')]);_0x5173db['attributes']=_[_0xfdd4('0x31')](_0x3e2bda['model'],qs[_0xfdd4('0x33')](_0x210a15[_0xfdd4('0x2e')][_0xfdd4('0x33')]));_0x5173db[_0xfdd4('0x32')]=_0x5173db['attributes'][_0xfdd4('0x45')]?_0x5173db[_0xfdd4('0x32')]:_0x3e2bda['model'];if(_0x210a15[_0xfdd4('0x2e')][_0xfdd4('0x3e')]){_0x5173db['include']=[{'all':!![]}];}_0x5173db=_[_0xfdd4('0x3b')]({},_0x5173db,_0x210a15['options']);return db['AnalyticTreeReport']['find'](_0x5173db)[_0xfdd4('0x21')](handleEntityNotFound(_0x67a1e3,null))[_0xfdd4('0x21')](respondWithResult(_0x67a1e3,null))[_0xfdd4('0x42')](handleError(_0x67a1e3,null));};exports['create']=function(_0x393029,_0x169d72){return db['AnalyticTreeReport'][_0xfdd4('0x46')](_0x393029[_0xfdd4('0x47')],{})[_0xfdd4('0x21')](respondWithResult(_0x169d72,0xc9))[_0xfdd4('0x42')](handleError(_0x169d72,null));};exports[_0xfdd4('0x20')]=function(_0x3817fe,_0x2578eb){if(_0x3817fe[_0xfdd4('0x47')]['id']){delete _0x3817fe[_0xfdd4('0x47')]['id'];}return db[_0xfdd4('0x28')][_0xfdd4('0x48')]({'where':{'id':_0x3817fe[_0xfdd4('0x44')]['id']}})[_0xfdd4('0x21')](handleEntityNotFound(_0x2578eb,null))[_0xfdd4('0x21')](saveUpdates(_0x3817fe['body'],null))['then'](respondWithResult(_0x2578eb,null))[_0xfdd4('0x42')](handleError(_0x2578eb,null));};exports[_0xfdd4('0x22')]=function(_0x1296e6,_0x1932ef){return db['AnalyticTreeReport'][_0xfdd4('0x48')]({'where':{'id':_0x1296e6[_0xfdd4('0x44')]['id']}})['then'](handleEntityNotFound(_0x1932ef,null))['then'](removeEntity(_0x1932ef,null))['catch'](handleError(_0x1932ef,null));}; \ No newline at end of file +var _0x4fc2=['../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','save','then','destroy','error','stack','name','send','index','map','AnalyticTreeReport','fieldName','type','key','model','keys','filters','intersection','query','fields','length','nolimit','limit','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','catch','params','rawAttributes','attributes','includeAll','create','update','body','find','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x3a6358,_0xe54920){var _0x45c6e0=function(_0x250ac7){while(--_0x250ac7){_0x3a6358['push'](_0x3a6358['shift']());}};_0x45c6e0(++_0xe54920);}(_0x4fc2,0x111));var _0x24fc=function(_0x35da16,_0x4ce9e1){_0x35da16=_0x35da16-0x0;var _0x232c10=_0x4fc2[_0x35da16];return _0x232c10;};'use strict';var pdf=require(_0x24fc('0x0'));var emlformat=require(_0x24fc('0x1'));var rimraf=require(_0x24fc('0x2'));var zipdir=require(_0x24fc('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x24fc('0x4'));var moment=require(_0x24fc('0x5'));var BPromise=require(_0x24fc('0x6'));var Mustache=require('mustache');var util=require(_0x24fc('0x7'));var path=require(_0x24fc('0x8'));var sox=require('sox');var csv=require(_0x24fc('0x9'));var ejs=require(_0x24fc('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x24fc('0xb'));var crypto=require(_0x24fc('0xc'));var jsforce=require(_0x24fc('0xd'));var deskjs=require(_0x24fc('0xe'));var toCsv=require(_0x24fc('0x9'));var querystring=require(_0x24fc('0xf'));var Papa=require('papaparse');var Redis=require(_0x24fc('0x10'));var authService=require(_0x24fc('0x11'));var qs=require(_0x24fc('0x12'));var as=require(_0x24fc('0x13'));var hardwareService=require(_0x24fc('0x14'));var logger=require(_0x24fc('0x15'))(_0x24fc('0x16'));var utils=require(_0x24fc('0x17'));var config=require('../../config/environment');var db=require(_0x24fc('0x18'))['db'];function respondWithStatusCode(_0x1cde5d,_0x5cc65e){_0x5cc65e=_0x5cc65e||0xcc;return function(_0x306873){if(_0x306873){return _0x1cde5d[_0x24fc('0x19')](_0x5cc65e);}return _0x1cde5d[_0x24fc('0x1a')](_0x5cc65e)[_0x24fc('0x1b')]();};}function respondWithResult(_0x30f19b,_0x326276){_0x326276=_0x326276||0xc8;return function(_0x537b5c){if(_0x537b5c){return _0x30f19b[_0x24fc('0x1a')](_0x326276)[_0x24fc('0x1c')](_0x537b5c);}};}function respondWithFilteredResult(_0x2ffed3,_0x42cbe8){return function(_0x4acd36){if(_0x4acd36){var _0x2ac989=_0x4acd36[_0x24fc('0x1d')],_0x588543=_0x42cbe8[_0x24fc('0x1e')],_0x4af098=_0x42cbe8[_0x24fc('0x1e')]+_0x42cbe8['limit'],_0x3385c7;if(_0x4af098>=_0x2ac989){_0x4af098=_0x2ac989;_0x3385c7=0xc8;}else{_0x3385c7=0xce;}_0x2ffed3[_0x24fc('0x1a')](_0x3385c7);return _0x2ffed3[_0x24fc('0x1f')](_0x24fc('0x20'),_0x588543+'-'+_0x4af098+'/'+_0x2ac989)[_0x24fc('0x1c')](_0x4acd36);}return null;};}function patchUpdates(_0x4c5a43){return function(_0x5eabee){try{jsonpatch[_0x24fc('0x21')](_0x5eabee,_0x4c5a43,!![]);}catch(_0x304881){return BPromise['reject'](_0x304881);}return _0x5eabee[_0x24fc('0x22')]();};}function saveUpdates(_0x36a771,_0xbf1d6b){return function(_0x2d0e3d){if(_0x2d0e3d){return _0x2d0e3d['update'](_0x36a771)[_0x24fc('0x23')](function(_0x545939){return _0x545939;});}return null;};}function removeEntity(_0x339b50,_0x591c8f){return function(_0x3ed464){if(_0x3ed464){return _0x3ed464[_0x24fc('0x24')]()[_0x24fc('0x23')](function(){_0x339b50['status'](0xcc)[_0x24fc('0x1b')]();});}};}function handleEntityNotFound(_0x552035,_0x35a9c7){return function(_0x2bb93a){if(!_0x2bb93a){_0x552035[_0x24fc('0x19')](0x194);}return _0x2bb93a;};}function handleError(_0x34b5b2,_0x3296fc){_0x3296fc=_0x3296fc||0x1f4;return function(_0x262e11){logger[_0x24fc('0x25')](_0x262e11[_0x24fc('0x26')]);if(_0x262e11[_0x24fc('0x27')]){delete _0x262e11[_0x24fc('0x27')];}_0x34b5b2['status'](_0x3296fc)[_0x24fc('0x28')](_0x262e11);};}exports[_0x24fc('0x29')]=function(_0x3ee302,_0x5bb4c8){var _0xf2f77d={},_0x3d1ec8={},_0x35f9f9={'count':0x0,'rows':[]};var _0x290f84=_[_0x24fc('0x2a')](db[_0x24fc('0x2b')]['rawAttributes'],function(_0x240ae7){return{'name':_0x240ae7[_0x24fc('0x2c')],'type':_0x240ae7[_0x24fc('0x2d')][_0x24fc('0x2e')]};});_0x3d1ec8[_0x24fc('0x2f')]=_['map'](_0x290f84,'name');_0x3d1ec8['query']=_[_0x24fc('0x30')](_0x3ee302['query']);_0x3d1ec8[_0x24fc('0x31')]=_[_0x24fc('0x32')](_0x3d1ec8[_0x24fc('0x2f')],_0x3d1ec8[_0x24fc('0x33')]);_0xf2f77d['attributes']=_[_0x24fc('0x32')](_0x3d1ec8[_0x24fc('0x2f')],qs['fields'](_0x3ee302[_0x24fc('0x33')][_0x24fc('0x34')]));_0xf2f77d['attributes']=_0xf2f77d['attributes'][_0x24fc('0x35')]?_0xf2f77d['attributes']:_0x3d1ec8[_0x24fc('0x2f')];if(!_0x3ee302[_0x24fc('0x33')]['hasOwnProperty'](_0x24fc('0x36'))){_0xf2f77d[_0x24fc('0x37')]=qs[_0x24fc('0x37')](_0x3ee302[_0x24fc('0x33')][_0x24fc('0x37')]);_0xf2f77d[_0x24fc('0x1e')]=qs[_0x24fc('0x1e')](_0x3ee302[_0x24fc('0x33')][_0x24fc('0x1e')]);}_0xf2f77d['order']=qs[_0x24fc('0x38')](_0x3ee302[_0x24fc('0x33')][_0x24fc('0x38')]);_0xf2f77d[_0x24fc('0x39')]=qs[_0x24fc('0x31')](_['pick'](_0x3ee302['query'],_0x3d1ec8[_0x24fc('0x31')]));if(_0x3ee302['query'][_0x24fc('0x3a')]){_0xf2f77d[_0x24fc('0x39')]=_[_0x24fc('0x3b')](_0xf2f77d[_0x24fc('0x39')],{'$or':_['map'](_0x290f84,function(_0x610638){if(_0x610638['type']!==_0x24fc('0x3c')){var _0x3b8fb6={};_0x3b8fb6[_0x610638[_0x24fc('0x27')]]={'$like':'%'+_0x3ee302[_0x24fc('0x33')][_0x24fc('0x3a')]+'%'};return _0x3b8fb6;}})});}_0xf2f77d=_['merge']({},_0xf2f77d,_0x3ee302[_0x24fc('0x3d')]);var _0x3f40cd={'where':_0xf2f77d[_0x24fc('0x39')]};return db[_0x24fc('0x2b')]['count'](_0x3f40cd)[_0x24fc('0x23')](function(_0x2f0bd9){_0x35f9f9['count']=_0x2f0bd9;if(_0x3ee302[_0x24fc('0x33')]['includeAll']){_0xf2f77d[_0x24fc('0x3e')]=[{'all':!![]}];}return db[_0x24fc('0x2b')][_0x24fc('0x3f')](_0xf2f77d);})[_0x24fc('0x23')](function(_0x431189){_0x35f9f9[_0x24fc('0x40')]=_0x431189;return _0x35f9f9;})[_0x24fc('0x23')](respondWithFilteredResult(_0x5bb4c8,_0xf2f77d))[_0x24fc('0x41')](handleError(_0x5bb4c8,null));};exports['show']=function(_0x1721ea,_0x43fb6d){var _0x32f72c={'raw':!![],'where':{'id':_0x1721ea[_0x24fc('0x42')]['id']}},_0x4fee9f={};_0x4fee9f[_0x24fc('0x2f')]=_['keys'](db[_0x24fc('0x2b')][_0x24fc('0x43')]);_0x4fee9f[_0x24fc('0x33')]=_['keys'](_0x1721ea[_0x24fc('0x33')]);_0x4fee9f[_0x24fc('0x31')]=_['intersection'](_0x4fee9f[_0x24fc('0x2f')],_0x4fee9f[_0x24fc('0x33')]);_0x32f72c[_0x24fc('0x44')]=_[_0x24fc('0x32')](_0x4fee9f['model'],qs[_0x24fc('0x34')](_0x1721ea[_0x24fc('0x33')][_0x24fc('0x34')]));_0x32f72c[_0x24fc('0x44')]=_0x32f72c[_0x24fc('0x44')]['length']?_0x32f72c[_0x24fc('0x44')]:_0x4fee9f[_0x24fc('0x2f')];if(_0x1721ea[_0x24fc('0x33')][_0x24fc('0x45')]){_0x32f72c['include']=[{'all':!![]}];}_0x32f72c=_[_0x24fc('0x3b')]({},_0x32f72c,_0x1721ea[_0x24fc('0x3d')]);return db['AnalyticTreeReport']['find'](_0x32f72c)[_0x24fc('0x23')](handleEntityNotFound(_0x43fb6d,null))['then'](respondWithResult(_0x43fb6d,null))['catch'](handleError(_0x43fb6d,null));};exports[_0x24fc('0x46')]=function(_0x5879c2,_0x281194){return db[_0x24fc('0x2b')][_0x24fc('0x46')](_0x5879c2['body'],{})[_0x24fc('0x23')](respondWithResult(_0x281194,0xc9))[_0x24fc('0x41')](handleError(_0x281194,null));};exports[_0x24fc('0x47')]=function(_0x1ad8d6,_0x39873d){if(_0x1ad8d6[_0x24fc('0x48')]['id']){delete _0x1ad8d6[_0x24fc('0x48')]['id'];}return db[_0x24fc('0x2b')]['find']({'where':{'id':_0x1ad8d6['params']['id']}})[_0x24fc('0x23')](handleEntityNotFound(_0x39873d,null))[_0x24fc('0x23')](saveUpdates(_0x1ad8d6[_0x24fc('0x48')],null))['then'](respondWithResult(_0x39873d,null))['catch'](handleError(_0x39873d,null));};exports[_0x24fc('0x24')]=function(_0x213439,_0x179a60){return db[_0x24fc('0x2b')][_0x24fc('0x49')]({'where':{'id':_0x213439[_0x24fc('0x42')]['id']}})[_0x24fc('0x23')](handleEntityNotFound(_0x179a60,null))[_0x24fc('0x23')](removeEntity(_0x179a60,null))[_0x24fc('0x41')](handleError(_0x179a60,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index b82e2ee..f491c7b 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 _0x58e6=['lodash','util','bluebird','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','analytics_report_trees'];(function(_0x12475c,_0x4e6424){var _0x3434e9=function(_0x2a1a40){while(--_0x2a1a40){_0x12475c['push'](_0x12475c['shift']());}};_0x3434e9(++_0x4e6424);}(_0x58e6,0x1c2));var _0x658e=function(_0x193257,_0xbef52c){_0x193257=_0x193257-0x0;var _0x19a4bd=_0x58e6[_0x193257];return _0x19a4bd;};'use strict';var _=require(_0x658e('0x0'));var util=require(_0x658e('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x658e('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x658e('0x3'));var rimraf=require(_0x658e('0x4'));var config=require(_0x658e('0x5'));var attributes=require(_0x658e('0x6'));module[_0x658e('0x7')]=function(_0x2add44,_0x3251b8){return _0x2add44['define']('AnalyticTreeReport',attributes,{'tableName':_0x658e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a12=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./analyticTreeReport.attributes','exports','define','analytics_report_trees','lodash','util'];(function(_0x4001ad,_0x1e22dd){var _0x4c7ec2=function(_0x24cb8a){while(--_0x24cb8a){_0x4001ad['push'](_0x4001ad['shift']());}};_0x4c7ec2(++_0x1e22dd);}(_0x7a12,0xe8));var _0x27a1=function(_0x2ec813,_0xcd8e2d){_0x2ec813=_0x2ec813-0x0;var _0x4b2c5a=_0x7a12[_0x2ec813];return _0x4b2c5a;};'use strict';var _=require(_0x27a1('0x0'));var util=require(_0x27a1('0x1'));var logger=require(_0x27a1('0x2'))(_0x27a1('0x3'));var moment=require(_0x27a1('0x4'));var BPromise=require(_0x27a1('0x5'));var rp=require(_0x27a1('0x6'));var fs=require('fs');var path=require(_0x27a1('0x7'));var rimraf=require('rimraf');var config=require(_0x27a1('0x8'));var attributes=require(_0x27a1('0x9'));module[_0x27a1('0xa')]=function(_0x389116,_0x2ccadb){return _0x389116[_0x27a1('0xb')]('AnalyticTreeReport',attributes,{'tableName':_0x27a1('0xc'),'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 f6eb830..c0e2bff 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 _0xc4db=['error','code','message','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','AnalyticTreeReport,\x20%s,\x20%s,\x20%s'];(function(_0x404eed,_0x5390c5){var _0xd45887=function(_0x1ee42b){while(--_0x1ee42b){_0x404eed['push'](_0x404eed['shift']());}};_0xd45887(++_0x5390c5);}(_0xc4db,0x75));var _0xbc4d=function(_0x1ef8c2,_0x53bd14){_0x1ef8c2=_0x1ef8c2-0x0;var _0x394a67=_0xc4db[_0x1ef8c2];return _0x394a67;};'use strict';var _=require('lodash');var util=require(_0xbc4d('0x0'));var moment=require(_0xbc4d('0x1'));var BPromise=require(_0xbc4d('0x2'));var rs=require(_0xbc4d('0x3'));var fs=require('fs');var Redis=require(_0xbc4d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbc4d('0x5'));var logger=require(_0xbc4d('0x6'))(_0xbc4d('0x7'));var config=require(_0xbc4d('0x8'));var jayson=require(_0xbc4d('0x9'));var client=jayson['client'][_0xbc4d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xefdb99,_0x2c082c,_0x2d70c0){return new BPromise(function(_0x478267,_0x5dc561){return client['request'](_0xefdb99,_0x2d70c0)[_0xbc4d('0xb')](function(_0x3c0243){logger[_0xbc4d('0xc')](_0xbc4d('0xd'),_0x2c082c,_0xbc4d('0xe'));logger['debug'](_0xbc4d('0xf'),_0x2c082c,'request\x20sent',JSON['stringify'](_0x3c0243));if(_0x3c0243[_0xbc4d('0x10')]){if(_0x3c0243[_0xbc4d('0x10')][_0xbc4d('0x11')]===0x1f4){logger['error'](_0xbc4d('0xd'),_0x2c082c,_0x3c0243[_0xbc4d('0x10')][_0xbc4d('0x12')]);return _0x5dc561(_0x3c0243[_0xbc4d('0x10')][_0xbc4d('0x12')]);}logger[_0xbc4d('0x10')](_0xbc4d('0xd'),_0x2c082c,_0x3c0243['error'][_0xbc4d('0x12')]);return _0x478267(_0x3c0243['error'][_0xbc4d('0x12')]);}else{logger[_0xbc4d('0xc')](_0xbc4d('0xd'),_0x2c082c,_0xbc4d('0xe'));_0x478267(_0x3c0243['result']['message']);}})['catch'](function(_0x36e115){logger[_0xbc4d('0x10')]('AnalyticTreeReport,\x20%s,\x20%s',_0x2c082c,_0x36e115);_0x5dc561(_0x36e115);});});} \ No newline at end of file +var _0x568a=['util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','lodash'];(function(_0x13c3a1,_0x87d441){var _0x4c56c7=function(_0x46148e){while(--_0x46148e){_0x13c3a1['push'](_0x13c3a1['shift']());}};_0x4c56c7(++_0x87d441);}(_0x568a,0x10d));var _0xa568=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0x568a[_0x1d24eb];return _0x1dc576;};'use strict';var _=require(_0xa568('0x0'));var util=require(_0xa568('0x1'));var moment=require(_0xa568('0x2'));var BPromise=require(_0xa568('0x3'));var rs=require(_0xa568('0x4'));var fs=require('fs');var Redis=require(_0xa568('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xa568('0x6'));var logger=require('../../config/logger')(_0xa568('0x7'));var config=require('../../config/environment');var jayson=require(_0xa568('0x8'));var client=jayson[_0xa568('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4aded0,_0x5cb540,_0x9f6783){return new BPromise(function(_0x465655,_0x7b6d8a){return client[_0xa568('0xa')](_0x4aded0,_0x9f6783)[_0xa568('0xb')](function(_0x27e8de){logger['info'](_0xa568('0xc'),_0x5cb540,'request\x20sent');logger['debug'](_0xa568('0xd'),_0x5cb540,_0xa568('0xe'),JSON['stringify'](_0x27e8de));if(_0x27e8de[_0xa568('0xf')]){if(_0x27e8de[_0xa568('0xf')]['code']===0x1f4){logger['error'](_0xa568('0xc'),_0x5cb540,_0x27e8de[_0xa568('0xf')][_0xa568('0x10')]);return _0x7b6d8a(_0x27e8de[_0xa568('0xf')][_0xa568('0x10')]);}logger['error'](_0xa568('0xc'),_0x5cb540,_0x27e8de[_0xa568('0xf')]['message']);return _0x465655(_0x27e8de[_0xa568('0xf')][_0xa568('0x10')]);}else{logger['info'](_0xa568('0xc'),_0x5cb540,_0xa568('0xe'));_0x465655(_0x27e8de[_0xa568('0x11')][_0xa568('0x10')]);}})['catch'](function(_0x3dca8a){logger['error'](_0xa568('0xc'),_0x5cb540,_0x3dca8a);_0x7b6d8a(_0x3dca8a);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index c2b8136..78143e0 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 _0x6ed0=['util','path','connect-timeout','express','Router','../../components/auth/service','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','post','create','delete','destroy','exports','multer'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6ed0,0x1db));var _0x06ed=function(_0x368ef3,_0x2f4c04){_0x368ef3=_0x368ef3-0x0;var _0x274dc7=_0x6ed0[_0x368ef3];return _0x274dc7;};'use strict';var multer=require(_0x06ed('0x0'));var util=require(_0x06ed('0x1'));var path=require(_0x06ed('0x2'));var timeout=require(_0x06ed('0x3'));var express=require(_0x06ed('0x4'));var router=express[_0x06ed('0x5')]();var auth=require(_0x06ed('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x06ed('0x7'));router[_0x06ed('0x8')]('/',auth[_0x06ed('0x9')](),controller[_0x06ed('0xa')]);router[_0x06ed('0x8')](_0x06ed('0xb'),auth[_0x06ed('0x9')](),controller['show']);router[_0x06ed('0xc')]('/',auth['isAuthenticated'](),controller[_0x06ed('0xd')]);router['put'](_0x06ed('0xb'),auth[_0x06ed('0x9')](),controller['update']);router[_0x06ed('0xe')]('/:id',auth[_0x06ed('0x9')](),controller[_0x06ed('0xf')]);module[_0x06ed('0x10')]=router; \ No newline at end of file +var _0xb32a=['put','update','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x490a0b,_0x773d1d){var _0x1834b5=function(_0x48b567){while(--_0x48b567){_0x490a0b['push'](_0x490a0b['shift']());}};_0x1834b5(++_0x773d1d);}(_0xb32a,0xdc));var _0xab32=function(_0x88300d,_0x491e73){_0x88300d=_0x88300d-0x0;var _0x5bab4e=_0xb32a[_0x88300d];return _0x5bab4e;};'use strict';var multer=require(_0xab32('0x0'));var util=require('util');var path=require(_0xab32('0x1'));var timeout=require('connect-timeout');var express=require(_0xab32('0x2'));var router=express[_0xab32('0x3')]();var auth=require(_0xab32('0x4'));var interaction=require(_0xab32('0x5'));var config=require(_0xab32('0x6'));var controller=require('./analyticTreeReport.controller');router[_0xab32('0x7')]('/',auth[_0xab32('0x8')](),controller[_0xab32('0x9')]);router[_0xab32('0x7')](_0xab32('0xa'),auth['isAuthenticated'](),controller[_0xab32('0xb')]);router[_0xab32('0xc')]('/',auth[_0xab32('0x8')](),controller[_0xab32('0xd')]);router[_0xab32('0xe')](_0xab32('0xa'),auth[_0xab32('0x8')](),controller[_0xab32('0xf')]);router['delete'](_0xab32('0xa'),auth[_0xab32('0x8')](),controller[_0xab32('0x10')]);module[_0xab32('0x11')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 2c68ef5..897835b 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 _0xbb97=['STRING','sequelize','exports'];(function(_0x43a6cd,_0x503d1a){var _0x5acb36=function(_0x2dd95e){while(--_0x2dd95e){_0x43a6cd['push'](_0x43a6cd['shift']());}};_0x5acb36(++_0x503d1a);}(_0xbb97,0xb2));var _0x7bb9=function(_0x48103d,_0x230b49){_0x48103d=_0x48103d-0x0;var _0x4f99ca=_0xbb97[_0x48103d];return _0x4f99ca;};'use strict';var Sequelize=require(_0x7bb9('0x0'));module[_0x7bb9('0x1')]={'name':{'type':Sequelize[_0x7bb9('0x2')]},'basename':{'type':Sequelize[_0x7bb9('0x2')]},'type':{'type':Sequelize[_0x7bb9('0x2')]}}; \ No newline at end of file +var _0xfc75=['exports','STRING'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0xfc75,0x1f4));var _0x5fc7=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xfc75[_0x21a9d9];return _0x46adce;};'use strict';var Sequelize=require('sequelize');module[_0x5fc7('0x0')]={'name':{'type':Sequelize[_0x5fc7('0x1')]},'basename':{'type':Sequelize[_0x5fc7('0x1')]},'type':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 667fc8a..0347e65 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 _0x3cc8=['name','send','index','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','map','include','Attachment','rows','catch','show','options','clone','params','includeAll','find','get','createdAt','updatedAt','body','update','originalname','basename','file','filename','mimetype','create','download','findOne','join','server/files/attachments/','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','then','end','error','stack'];(function(_0x1d9234,_0x183dff){var _0x24eae8=function(_0x3c1fc4){while(--_0x3c1fc4){_0x1d9234['push'](_0x1d9234['shift']());}};_0x24eae8(++_0x183dff);}(_0x3cc8,0x12f));var _0x83cc=function(_0x4cb48d,_0x2a2d41){_0x4cb48d=_0x4cb48d-0x0;var _0x493f4b=_0x3cc8[_0x4cb48d];return _0x493f4b;};'use strict';var pdf=require(_0x83cc('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x83cc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x83cc('0x2'));var rp=require(_0x83cc('0x3'));var moment=require(_0x83cc('0x4'));var BPromise=require(_0x83cc('0x5'));var Mustache=require('mustache');var util=require(_0x83cc('0x6'));var path=require(_0x83cc('0x7'));var sox=require(_0x83cc('0x8'));var csv=require(_0x83cc('0x9'));var ejs=require(_0x83cc('0xa'));var fs=require('fs');var _=require(_0x83cc('0xb'));var squel=require('squel');var crypto=require(_0x83cc('0xc'));var jsforce=require(_0x83cc('0xd'));var deskjs=require(_0x83cc('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x83cc('0xf'));var authService=require(_0x83cc('0x10'));var qs=require(_0x83cc('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x83cc('0x12'));var logger=require(_0x83cc('0x13'))(_0x83cc('0x14'));var utils=require(_0x83cc('0x15'));var config=require(_0x83cc('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x59a238,_0x1ba132){_0x1ba132=_0x1ba132||0xcc;return function(_0x598f81){if(_0x598f81){return _0x59a238[_0x83cc('0x17')](_0x1ba132);}return _0x59a238[_0x83cc('0x18')](_0x1ba132)['end']();};}function respondWithResult(_0x18c00a,_0x9c8d26){_0x9c8d26=_0x9c8d26||0xc8;return function(_0x146c81){if(_0x146c81){return _0x18c00a[_0x83cc('0x18')](_0x9c8d26)[_0x83cc('0x19')](_0x146c81);}};}function respondWithFilteredResult(_0x33a3ba,_0x474fba){return function(_0x574e45){if(_0x574e45){var _0x8dc2e3=_0x574e45[_0x83cc('0x1a')],_0x1630f9=_0x474fba[_0x83cc('0x1b')],_0x2a3fa0=_0x474fba[_0x83cc('0x1b')]+_0x474fba['limit'],_0x2c8111;if(_0x2a3fa0>=_0x8dc2e3){_0x2a3fa0=_0x8dc2e3;_0x2c8111=0xc8;}else{_0x2c8111=0xce;}_0x33a3ba[_0x83cc('0x18')](_0x2c8111);return _0x33a3ba[_0x83cc('0x1c')](_0x83cc('0x1d'),_0x1630f9+'-'+_0x2a3fa0+'/'+_0x8dc2e3)[_0x83cc('0x19')](_0x574e45);}return null;};}function patchUpdates(_0x18dab3){return function(_0x1a1bef){try{jsonpatch[_0x83cc('0x1e')](_0x1a1bef,_0x18dab3,!![]);}catch(_0xbaaea){return BPromise[_0x83cc('0x1f')](_0xbaaea);}return _0x1a1bef[_0x83cc('0x20')]();};}function saveUpdates(_0x2c7445,_0x22b173){return function(_0x596c40){if(_0x596c40){return _0x596c40['update'](_0x2c7445)[_0x83cc('0x21')](function(_0xad6736){return _0xad6736;});}return null;};}function removeEntity(_0x1ba4a2,_0x46bcfa){return function(_0x83b37d){if(_0x83b37d){return _0x83b37d['destroy']()[_0x83cc('0x21')](function(){_0x1ba4a2[_0x83cc('0x18')](0xcc)[_0x83cc('0x22')]();});}};}function handleEntityNotFound(_0x130448,_0x39d0b2){return function(_0xb77c9d){if(!_0xb77c9d){_0x130448[_0x83cc('0x17')](0x194);}return _0xb77c9d;};}function handleError(_0x42ae32,_0x5c20c1){_0x5c20c1=_0x5c20c1||0x1f4;return function(_0x3b5b0a){logger[_0x83cc('0x23')](_0x3b5b0a[_0x83cc('0x24')]);if(_0x3b5b0a[_0x83cc('0x25')]){delete _0x3b5b0a[_0x83cc('0x25')];}_0x42ae32[_0x83cc('0x18')](_0x5c20c1)[_0x83cc('0x26')](_0x3b5b0a);};}exports[_0x83cc('0x27')]=function(_0x2e9c70,_0x20bb3c){var _0x24352a={},_0x443036={},_0x57ccdf={'count':0x0,'rows':[]};var _0x1c6d59=_['map'](db['Attachment']['rawAttributes'],function(_0x41a08a){return{'name':_0x41a08a[_0x83cc('0x28')],'type':_0x41a08a[_0x83cc('0x29')][_0x83cc('0x2a')]};});_0x443036['model']=_['map'](_0x1c6d59,_0x83cc('0x25'));_0x443036[_0x83cc('0x2b')]=_[_0x83cc('0x2c')](_0x2e9c70['query']);_0x443036[_0x83cc('0x2d')]=_['intersection'](_0x443036[_0x83cc('0x2e')],_0x443036[_0x83cc('0x2b')]);_0x24352a[_0x83cc('0x2f')]=_[_0x83cc('0x30')](_0x443036[_0x83cc('0x2e')],qs[_0x83cc('0x31')](_0x2e9c70[_0x83cc('0x2b')][_0x83cc('0x31')]));_0x24352a[_0x83cc('0x2f')]=_0x24352a[_0x83cc('0x2f')][_0x83cc('0x32')]?_0x24352a[_0x83cc('0x2f')]:_0x443036[_0x83cc('0x2e')];if(!_0x2e9c70[_0x83cc('0x2b')][_0x83cc('0x33')](_0x83cc('0x34'))){_0x24352a['limit']=qs['limit'](_0x2e9c70[_0x83cc('0x2b')][_0x83cc('0x35')]);_0x24352a[_0x83cc('0x1b')]=qs[_0x83cc('0x1b')](_0x2e9c70[_0x83cc('0x2b')]['offset']);}_0x24352a['order']=qs[_0x83cc('0x36')](_0x2e9c70[_0x83cc('0x2b')][_0x83cc('0x36')]);_0x24352a[_0x83cc('0x37')]=qs[_0x83cc('0x2d')](_[_0x83cc('0x38')](_0x2e9c70[_0x83cc('0x2b')],_0x443036[_0x83cc('0x2d')]));if(_0x2e9c70[_0x83cc('0x2b')][_0x83cc('0x39')]){_0x24352a[_0x83cc('0x37')]=_[_0x83cc('0x3a')](_0x24352a[_0x83cc('0x37')],{'$or':_[_0x83cc('0x3b')](_0x1c6d59,function(_0x23c3ba){if(_0x23c3ba[_0x83cc('0x29')]!=='VIRTUAL'){var _0x803a8e={};_0x803a8e[_0x23c3ba['name']]={'$like':'%'+_0x2e9c70[_0x83cc('0x2b')][_0x83cc('0x39')]+'%'};return _0x803a8e;}})});}_0x24352a=_[_0x83cc('0x3a')]({},_0x24352a,_0x2e9c70['options']);var _0x4769f9={'where':_0x24352a[_0x83cc('0x37')]};return db['Attachment'][_0x83cc('0x1a')](_0x4769f9)[_0x83cc('0x21')](function(_0xaf2b52){_0x57ccdf[_0x83cc('0x1a')]=_0xaf2b52;if(_0x2e9c70[_0x83cc('0x2b')]['includeAll']){_0x24352a[_0x83cc('0x3c')]=[{'all':!![]}];}return db[_0x83cc('0x3d')]['findAll'](_0x24352a);})['then'](function(_0x4ff84f){_0x57ccdf[_0x83cc('0x3e')]=_0x4ff84f;return _0x57ccdf;})[_0x83cc('0x21')](respondWithFilteredResult(_0x20bb3c,_0x24352a))[_0x83cc('0x3f')](handleError(_0x20bb3c,null));};exports[_0x83cc('0x40')]=function(_0x42aac7,_0x859c48){var _0x776f51={'raw':!![],'where':{'id':_0x42aac7['params']['id']}},_0x42a3a6={};_0x42a3a6[_0x83cc('0x2e')]=_[_0x83cc('0x2c')](db[_0x83cc('0x3d')]['rawAttributes']);_0x42a3a6[_0x83cc('0x2b')]=_[_0x83cc('0x2c')](_0x42aac7[_0x83cc('0x2b')]);_0x42a3a6[_0x83cc('0x2d')]=_[_0x83cc('0x30')](_0x42a3a6[_0x83cc('0x2e')],_0x42a3a6[_0x83cc('0x2b')]);_0x776f51[_0x83cc('0x2f')]=_[_0x83cc('0x30')](_0x42a3a6[_0x83cc('0x2e')],qs[_0x83cc('0x31')](_0x42aac7[_0x83cc('0x2b')]['fields']));_0x776f51[_0x83cc('0x2f')]=_0x776f51[_0x83cc('0x2f')][_0x83cc('0x32')]?_0x776f51['attributes']:_0x42a3a6[_0x83cc('0x2e')];if(_0x42aac7[_0x83cc('0x2b')]['includeAll']){_0x776f51[_0x83cc('0x3c')]=[{'all':!![]}];}_0x776f51=_[_0x83cc('0x3a')]({},_0x776f51,_0x42aac7[_0x83cc('0x41')]);return db[_0x83cc('0x3d')]['find'](_0x776f51)['then'](handleEntityNotFound(_0x859c48,null))[_0x83cc('0x21')](respondWithResult(_0x859c48,null))[_0x83cc('0x3f')](handleError(_0x859c48,null));};exports[_0x83cc('0x42')]=function(_0x39542c,_0xbb4039){var _0x5a5269={'where':{'id':_0x39542c[_0x83cc('0x43')]['id']}},_0x127c4b={};_0x127c4b[_0x83cc('0x2e')]=_[_0x83cc('0x2c')](db[_0x83cc('0x3d')]['rawAttributes']);_0x5a5269['attributes']=_[_0x83cc('0x30')](_0x127c4b['model'],qs[_0x83cc('0x31')](_0x39542c[_0x83cc('0x2b')]['fields']));_0x5a5269[_0x83cc('0x2f')]=_0x5a5269[_0x83cc('0x2f')]['length']?_0x5a5269[_0x83cc('0x2f')]:_0x127c4b[_0x83cc('0x2e')];if(_0x39542c['query'][_0x83cc('0x44')]){_0x5a5269[_0x83cc('0x3c')]=[{'all':!![]}];}_0x5a5269=_[_0x83cc('0x3a')]({},_0x5a5269,_0x39542c['options']);return db[_0x83cc('0x3d')][_0x83cc('0x45')](_0x5a5269)[_0x83cc('0x21')](handleEntityNotFound(_0xbb4039,null))['then'](function(_0x118cb8){if(_0x118cb8){var _0x38b6e2=_0x118cb8[_0x83cc('0x46')]({'plain':!![]});_0x38b6e2=qs['omit'](_0x38b6e2,['id',_0x83cc('0x47'),_0x83cc('0x48')]);_0x39542c[_0x83cc('0x49')]=_['omit'](_0x39542c[_0x83cc('0x49')],['id','createdAt','updatedAt']);return db[_0x83cc('0x3d')]['create'](_[_0x83cc('0x3a')](_0x38b6e2,_0x39542c[_0x83cc('0x49')]),{'include':_0x39542c['query']['includeAll']?[{'all':!![]}]:undefined});}})[_0x83cc('0x21')](respondWithResult(_0xbb4039,0xc9))[_0x83cc('0x3f')](handleError(_0xbb4039,null));};exports[_0x83cc('0x4a')]=function(_0x2efff5,_0x53b30c){if(_0x2efff5[_0x83cc('0x49')]['id']){delete _0x2efff5[_0x83cc('0x49')]['id'];}return db[_0x83cc('0x3d')]['find']({'where':{'id':_0x2efff5[_0x83cc('0x43')]['id']}})[_0x83cc('0x21')](handleEntityNotFound(_0x53b30c,null))[_0x83cc('0x21')](saveUpdates(_0x2efff5[_0x83cc('0x49')],null))[_0x83cc('0x21')](respondWithResult(_0x53b30c,null))[_0x83cc('0x3f')](handleError(_0x53b30c,null));};exports['destroy']=function(_0x1945b0,_0x86eb55){return db['Attachment'][_0x83cc('0x45')]({'where':{'id':_0x1945b0[_0x83cc('0x43')]['id']}})[_0x83cc('0x21')](handleEntityNotFound(_0x86eb55,null))['then'](removeEntity(_0x86eb55,null))['catch'](handleError(_0x86eb55,null));};exports['create']=function(_0x32032b,_0x532f86,_0x4fb46c){_0x32032b[_0x83cc('0x49')][_0x83cc('0x25')]=_0x32032b['file'][_0x83cc('0x4b')];_0x32032b[_0x83cc('0x49')][_0x83cc('0x4c')]=_0x32032b[_0x83cc('0x4d')][_0x83cc('0x4e')];_0x32032b[_0x83cc('0x49')]['type']=_0x32032b[_0x83cc('0x4d')][_0x83cc('0x4f')];return db['Attachment'][_0x83cc('0x50')](_0x32032b['body'])[_0x83cc('0x21')](respondWithResult(_0x532f86,0xc9))[_0x83cc('0x3f')](handleError(_0x532f86,null));};exports[_0x83cc('0x51')]=function(_0x595ef2,_0x3ce942,_0x5eed50){return db[_0x83cc('0x3d')][_0x83cc('0x52')]({'where':{'id':_0x595ef2[_0x83cc('0x43')]['id']},'raw':!![]})[_0x83cc('0x21')](handleEntityNotFound(_0x3ce942,null))[_0x83cc('0x21')](function(_0x153ac0){if(_0x153ac0){return _0x3ce942[_0x83cc('0x51')](path[_0x83cc('0x53')](config['root'],_0x83cc('0x54'),_0x153ac0[_0x83cc('0x4c')]));}})['catch'](handleError(_0x3ce942,null));}; \ No newline at end of file +var _0x1268=['filename','download','join','root','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','papaparse','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','nolimit','limit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','include','Attachment','findAll','catch','show','params','keys','find','clone','length','includeAll','omit','createdAt','updatedAt','body','create','file','originalname'];(function(_0x2aa91d,_0x1b4ef5){var _0x204079=function(_0x1b6e86){while(--_0x1b6e86){_0x2aa91d['push'](_0x2aa91d['shift']());}};_0x204079(++_0x1b4ef5);}(_0x1268,0xf4));var _0x8126=function(_0x14bc33,_0x2ee81d){_0x14bc33=_0x14bc33-0x0;var _0x5a3a1a=_0x1268[_0x14bc33];return _0x5a3a1a;};'use strict';var pdf=require(_0x8126('0x0'));var emlformat=require(_0x8126('0x1'));var rimraf=require(_0x8126('0x2'));var zipdir=require(_0x8126('0x3'));var jsonpatch=require(_0x8126('0x4'));var rp=require('request-promise');var moment=require(_0x8126('0x5'));var BPromise=require(_0x8126('0x6'));var Mustache=require('mustache');var util=require(_0x8126('0x7'));var path=require(_0x8126('0x8'));var sox=require(_0x8126('0x9'));var csv=require(_0x8126('0xa'));var ejs=require(_0x8126('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x8126('0xc'));var crypto=require('crypto');var jsforce=require(_0x8126('0xd'));var deskjs=require(_0x8126('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8126('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8126('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x8126('0x11'));var config=require(_0x8126('0x12'));var db=require(_0x8126('0x13'))['db'];function respondWithStatusCode(_0x24b313,_0x25aab4){_0x25aab4=_0x25aab4||0xcc;return function(_0x2c611f){if(_0x2c611f){return _0x24b313[_0x8126('0x14')](_0x25aab4);}return _0x24b313[_0x8126('0x15')](_0x25aab4)[_0x8126('0x16')]();};}function respondWithResult(_0x7a6702,_0x48af2c){_0x48af2c=_0x48af2c||0xc8;return function(_0x1b43e8){if(_0x1b43e8){return _0x7a6702['status'](_0x48af2c)[_0x8126('0x17')](_0x1b43e8);}};}function respondWithFilteredResult(_0x2b6431,_0x464cc8){return function(_0x38fe74){if(_0x38fe74){var _0xcf36f2=_0x38fe74[_0x8126('0x18')],_0x4cc029=_0x464cc8['offset'],_0x1534f7=_0x464cc8[_0x8126('0x19')]+_0x464cc8['limit'],_0x1739b1;if(_0x1534f7>=_0xcf36f2){_0x1534f7=_0xcf36f2;_0x1739b1=0xc8;}else{_0x1739b1=0xce;}_0x2b6431['status'](_0x1739b1);return _0x2b6431[_0x8126('0x1a')](_0x8126('0x1b'),_0x4cc029+'-'+_0x1534f7+'/'+_0xcf36f2)['json'](_0x38fe74);}return null;};}function patchUpdates(_0x24bd9b){return function(_0x4a6cfa){try{jsonpatch[_0x8126('0x1c')](_0x4a6cfa,_0x24bd9b,!![]);}catch(_0x50b28d){return BPromise['reject'](_0x50b28d);}return _0x4a6cfa[_0x8126('0x1d')]();};}function saveUpdates(_0x126c98,_0x127b6a){return function(_0x4f5bf7){if(_0x4f5bf7){return _0x4f5bf7[_0x8126('0x1e')](_0x126c98)[_0x8126('0x1f')](function(_0x5837e0){return _0x5837e0;});}return null;};}function removeEntity(_0x506107,_0x1ec305){return function(_0x47d6b2){if(_0x47d6b2){return _0x47d6b2[_0x8126('0x20')]()[_0x8126('0x1f')](function(){_0x506107[_0x8126('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f2407,_0x3c30d4){return function(_0x1a43e1){if(!_0x1a43e1){_0x3f2407[_0x8126('0x14')](0x194);}return _0x1a43e1;};}function handleError(_0x220038,_0x8ca4ec){_0x8ca4ec=_0x8ca4ec||0x1f4;return function(_0x4df414){logger['error'](_0x4df414[_0x8126('0x21')]);if(_0x4df414[_0x8126('0x22')]){delete _0x4df414[_0x8126('0x22')];}_0x220038['status'](_0x8ca4ec)[_0x8126('0x23')](_0x4df414);};}exports[_0x8126('0x24')]=function(_0x17b73b,_0x1ed39b){var _0x52b1c8={},_0x2527d0={},_0x19f2bf={'count':0x0,'rows':[]};var _0xbcbd2e=_[_0x8126('0x25')](db['Attachment'][_0x8126('0x26')],function(_0x50ea99){return{'name':_0x50ea99[_0x8126('0x27')],'type':_0x50ea99['type'][_0x8126('0x28')]};});_0x2527d0[_0x8126('0x29')]=_[_0x8126('0x25')](_0xbcbd2e,_0x8126('0x22'));_0x2527d0[_0x8126('0x2a')]=_['keys'](_0x17b73b[_0x8126('0x2a')]);_0x2527d0[_0x8126('0x2b')]=_[_0x8126('0x2c')](_0x2527d0[_0x8126('0x29')],_0x2527d0['query']);_0x52b1c8[_0x8126('0x2d')]=_['intersection'](_0x2527d0[_0x8126('0x29')],qs[_0x8126('0x2e')](_0x17b73b['query'][_0x8126('0x2e')]));_0x52b1c8[_0x8126('0x2d')]=_0x52b1c8[_0x8126('0x2d')]['length']?_0x52b1c8[_0x8126('0x2d')]:_0x2527d0['model'];if(!_0x17b73b[_0x8126('0x2a')]['hasOwnProperty'](_0x8126('0x2f'))){_0x52b1c8[_0x8126('0x30')]=qs[_0x8126('0x30')](_0x17b73b['query'][_0x8126('0x30')]);_0x52b1c8['offset']=qs[_0x8126('0x19')](_0x17b73b['query'][_0x8126('0x19')]);}_0x52b1c8[_0x8126('0x31')]=qs[_0x8126('0x32')](_0x17b73b[_0x8126('0x2a')][_0x8126('0x32')]);_0x52b1c8[_0x8126('0x33')]=qs[_0x8126('0x2b')](_[_0x8126('0x34')](_0x17b73b[_0x8126('0x2a')],_0x2527d0[_0x8126('0x2b')]));if(_0x17b73b[_0x8126('0x2a')]['filter']){_0x52b1c8[_0x8126('0x33')]=_[_0x8126('0x35')](_0x52b1c8[_0x8126('0x33')],{'$or':_[_0x8126('0x25')](_0xbcbd2e,function(_0x4631b0){if(_0x4631b0[_0x8126('0x36')]!==_0x8126('0x37')){var _0x2256d3={};_0x2256d3[_0x4631b0[_0x8126('0x22')]]={'$like':'%'+_0x17b73b[_0x8126('0x2a')][_0x8126('0x38')]+'%'};return _0x2256d3;}})});}_0x52b1c8=_[_0x8126('0x35')]({},_0x52b1c8,_0x17b73b[_0x8126('0x39')]);var _0x55ea54={'where':_0x52b1c8[_0x8126('0x33')]};return db['Attachment'][_0x8126('0x18')](_0x55ea54)[_0x8126('0x1f')](function(_0x18124e){_0x19f2bf[_0x8126('0x18')]=_0x18124e;if(_0x17b73b[_0x8126('0x2a')]['includeAll']){_0x52b1c8[_0x8126('0x3a')]=[{'all':!![]}];}return db[_0x8126('0x3b')][_0x8126('0x3c')](_0x52b1c8);})['then'](function(_0x3e97cb){_0x19f2bf['rows']=_0x3e97cb;return _0x19f2bf;})[_0x8126('0x1f')](respondWithFilteredResult(_0x1ed39b,_0x52b1c8))[_0x8126('0x3d')](handleError(_0x1ed39b,null));};exports[_0x8126('0x3e')]=function(_0x3792b6,_0x10722c){var _0x2cfd60={'raw':!![],'where':{'id':_0x3792b6[_0x8126('0x3f')]['id']}},_0x334c7e={};_0x334c7e[_0x8126('0x29')]=_[_0x8126('0x40')](db['Attachment'][_0x8126('0x26')]);_0x334c7e['query']=_[_0x8126('0x40')](_0x3792b6[_0x8126('0x2a')]);_0x334c7e[_0x8126('0x2b')]=_[_0x8126('0x2c')](_0x334c7e[_0x8126('0x29')],_0x334c7e[_0x8126('0x2a')]);_0x2cfd60[_0x8126('0x2d')]=_[_0x8126('0x2c')](_0x334c7e[_0x8126('0x29')],qs[_0x8126('0x2e')](_0x3792b6[_0x8126('0x2a')][_0x8126('0x2e')]));_0x2cfd60[_0x8126('0x2d')]=_0x2cfd60[_0x8126('0x2d')]['length']?_0x2cfd60[_0x8126('0x2d')]:_0x334c7e[_0x8126('0x29')];if(_0x3792b6[_0x8126('0x2a')]['includeAll']){_0x2cfd60[_0x8126('0x3a')]=[{'all':!![]}];}_0x2cfd60=_[_0x8126('0x35')]({},_0x2cfd60,_0x3792b6[_0x8126('0x39')]);return db[_0x8126('0x3b')][_0x8126('0x41')](_0x2cfd60)[_0x8126('0x1f')](handleEntityNotFound(_0x10722c,null))[_0x8126('0x1f')](respondWithResult(_0x10722c,null))[_0x8126('0x3d')](handleError(_0x10722c,null));};exports[_0x8126('0x42')]=function(_0x59d569,_0x40cd88){var _0x5d2863={'where':{'id':_0x59d569[_0x8126('0x3f')]['id']}},_0x478b42={};_0x478b42[_0x8126('0x29')]=_['keys'](db['Attachment'][_0x8126('0x26')]);_0x5d2863[_0x8126('0x2d')]=_[_0x8126('0x2c')](_0x478b42[_0x8126('0x29')],qs[_0x8126('0x2e')](_0x59d569[_0x8126('0x2a')][_0x8126('0x2e')]));_0x5d2863[_0x8126('0x2d')]=_0x5d2863[_0x8126('0x2d')][_0x8126('0x43')]?_0x5d2863[_0x8126('0x2d')]:_0x478b42[_0x8126('0x29')];if(_0x59d569[_0x8126('0x2a')][_0x8126('0x44')]){_0x5d2863[_0x8126('0x3a')]=[{'all':!![]}];}_0x5d2863=_['merge']({},_0x5d2863,_0x59d569[_0x8126('0x39')]);return db['Attachment']['find'](_0x5d2863)[_0x8126('0x1f')](handleEntityNotFound(_0x40cd88,null))['then'](function(_0x4758f0){if(_0x4758f0){var _0x1d3dbd=_0x4758f0['get']({'plain':!![]});_0x1d3dbd=qs[_0x8126('0x45')](_0x1d3dbd,['id',_0x8126('0x46'),_0x8126('0x47')]);_0x59d569[_0x8126('0x48')]=_['omit'](_0x59d569[_0x8126('0x48')],['id',_0x8126('0x46'),'updatedAt']);return db[_0x8126('0x3b')]['create'](_[_0x8126('0x35')](_0x1d3dbd,_0x59d569[_0x8126('0x48')]),{'include':_0x59d569[_0x8126('0x2a')][_0x8126('0x44')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x40cd88,0xc9))[_0x8126('0x3d')](handleError(_0x40cd88,null));};exports[_0x8126('0x1e')]=function(_0x41fc90,_0x345d4a){if(_0x41fc90[_0x8126('0x48')]['id']){delete _0x41fc90['body']['id'];}return db['Attachment']['find']({'where':{'id':_0x41fc90[_0x8126('0x3f')]['id']}})['then'](handleEntityNotFound(_0x345d4a,null))[_0x8126('0x1f')](saveUpdates(_0x41fc90[_0x8126('0x48')],null))[_0x8126('0x1f')](respondWithResult(_0x345d4a,null))['catch'](handleError(_0x345d4a,null));};exports[_0x8126('0x20')]=function(_0x437a0a,_0x17719e){return db[_0x8126('0x3b')][_0x8126('0x41')]({'where':{'id':_0x437a0a[_0x8126('0x3f')]['id']}})[_0x8126('0x1f')](handleEntityNotFound(_0x17719e,null))[_0x8126('0x1f')](removeEntity(_0x17719e,null))[_0x8126('0x3d')](handleError(_0x17719e,null));};exports[_0x8126('0x49')]=function(_0x4e2a02,_0x4fe092,_0x3dbd1a){_0x4e2a02[_0x8126('0x48')]['name']=_0x4e2a02[_0x8126('0x4a')][_0x8126('0x4b')];_0x4e2a02[_0x8126('0x48')]['basename']=_0x4e2a02[_0x8126('0x4a')][_0x8126('0x4c')];_0x4e2a02[_0x8126('0x48')]['type']=_0x4e2a02[_0x8126('0x4a')]['mimetype'];return db[_0x8126('0x3b')]['create'](_0x4e2a02['body'])[_0x8126('0x1f')](respondWithResult(_0x4fe092,0xc9))[_0x8126('0x3d')](handleError(_0x4fe092,null));};exports['download']=function(_0x5aec36,_0x55c770,_0x2b8666){return db[_0x8126('0x3b')]['findOne']({'where':{'id':_0x5aec36[_0x8126('0x3f')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x55c770,null))[_0x8126('0x1f')](function(_0x1b6856){if(_0x1b6856){return _0x55c770[_0x8126('0x4d')](path[_0x8126('0x4e')](config[_0x8126('0x4f')],'server/files/attachments/',_0x1b6856['basename']));}})[_0x8126('0x3d')](handleError(_0x55c770,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index b9cbf65..4a67264 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 _0x69d3=['../../config/logger','moment','bluebird','rimraf','exports','define','Attachment','attachments','lodash','util'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0x69d3,0xda));var _0x369d=function(_0xbc519a,_0x31ced6){_0xbc519a=_0xbc519a-0x0;var _0x2b0566=_0x69d3[_0xbc519a];return _0x2b0566;};'use strict';var _=require(_0x369d('0x0'));var util=require(_0x369d('0x1'));var logger=require(_0x369d('0x2'))('api');var moment=require(_0x369d('0x3'));var BPromise=require(_0x369d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x369d('0x5'));var config=require('../../config/environment');var attributes=require('./attachment.attributes');module[_0x369d('0x6')]=function(_0x2f2a53,_0x18c9f1){return _0x2f2a53[_0x369d('0x7')](_0x369d('0x8'),attributes,{'tableName':_0x369d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x263f=['Attachment','attachments','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x263f,0x182));var _0xf263=function(_0x2b61fa,_0x1e8136){_0x2b61fa=_0x2b61fa-0x0;var _0x1ede11=_0x263f[_0x2b61fa];return _0x1ede11;};'use strict';var _=require(_0xf263('0x0'));var util=require(_0xf263('0x1'));var logger=require(_0xf263('0x2'))(_0xf263('0x3'));var moment=require(_0xf263('0x4'));var BPromise=require(_0xf263('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf263('0x6'));var rimraf=require(_0xf263('0x7'));var config=require(_0xf263('0x8'));var attributes=require('./attachment.attributes');module[_0xf263('0x9')]=function(_0xdb2fc1,_0x4c7ab2){return _0xdb2fc1['define'](_0xf263('0xa'),attributes,{'tableName':_0xf263('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js index dcfc88c..d3d1ee3 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 _0xbfcd=['error','code','Attachment,\x20%s,\x20%s','message','result','catch','CreateAttachment','Attachment','create','body','options','raw','then','debug','lodash','util','moment','randomstring','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x11fce5,_0x344852){var _0x27792f=function(_0x2b8861){while(--_0x2b8861){_0x11fce5['push'](_0x11fce5['shift']());}};_0x27792f(++_0x344852);}(_0xbfcd,0xee));var _0xdbfc=function(_0x590141,_0x3cb4cd){_0x590141=_0x590141-0x0;var _0xda5e30=_0xbfcd[_0x590141];return _0xda5e30;};'use strict';var _=require(_0xdbfc('0x0'));var util=require(_0xdbfc('0x1'));var moment=require(_0xdbfc('0x2'));var BPromise=require('bluebird');var rs=require(_0xdbfc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xdbfc('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xdbfc('0x5'));var jayson=require(_0xdbfc('0x6'));var client=jayson[_0xdbfc('0x7')][_0xdbfc('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2f8e73,_0x17e80d,_0xa00a53){return new BPromise(function(_0x58c3b8,_0x3f2e20){return client[_0xdbfc('0x9')](_0x2f8e73,_0xa00a53)['then'](function(_0x2e9150){logger[_0xdbfc('0xa')]('Attachment,\x20%s,\x20%s',_0x17e80d,_0xdbfc('0xb'));logger['debug'](_0xdbfc('0xc'),_0x17e80d,'request\x20sent',JSON[_0xdbfc('0xd')](_0x2e9150));if(_0x2e9150['error']){if(_0x2e9150[_0xdbfc('0xe')][_0xdbfc('0xf')]===0x1f4){logger[_0xdbfc('0xe')](_0xdbfc('0x10'),_0x17e80d,_0x2e9150[_0xdbfc('0xe')][_0xdbfc('0x11')]);return _0x3f2e20(_0x2e9150[_0xdbfc('0xe')][_0xdbfc('0x11')]);}logger['error'](_0xdbfc('0x10'),_0x17e80d,_0x2e9150[_0xdbfc('0xe')][_0xdbfc('0x11')]);return _0x58c3b8(_0x2e9150[_0xdbfc('0xe')]['message']);}else{logger[_0xdbfc('0xa')](_0xdbfc('0x10'),_0x17e80d,_0xdbfc('0xb'));_0x58c3b8(_0x2e9150[_0xdbfc('0x12')][_0xdbfc('0x11')]);}})[_0xdbfc('0x13')](function(_0x20801e){logger[_0xdbfc('0xe')](_0xdbfc('0x10'),_0x17e80d,_0x20801e);_0x3f2e20(_0x20801e);});});}exports[_0xdbfc('0x14')]=function(_0x379766){var _0x42cfa3=this;return new Promise(function(_0x572ceb,_0x109aed){return db[_0xdbfc('0x15')][_0xdbfc('0x16')](_0x379766[_0xdbfc('0x17')],{'raw':_0x379766[_0xdbfc('0x18')]?_0x379766['options'][_0xdbfc('0x19')]===undefined?!![]:![]:!![]})[_0xdbfc('0x1a')](function(_0x1f0fed){logger[_0xdbfc('0xa')]('CreateAttachment',_0x379766);logger[_0xdbfc('0x1b')](_0xdbfc('0x14'),_0x379766,JSON[_0xdbfc('0xd')](_0x1f0fed));_0x572ceb(_0x1f0fed);})[_0xdbfc('0x13')](function(_0xd3bfd9){logger[_0xdbfc('0xe')]('CreateAttachment',_0xd3bfd9['message'],_0x379766);_0x109aed(_0x42cfa3[_0xdbfc('0xe')](0x1f4,_0xd3bfd9[_0xdbfc('0x11')]));});});}; \ No newline at end of file +var _0x8e3b=['body','options','raw','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateAttachment','create'];(function(_0x3f08b3,_0x5ad182){var _0x45ade2=function(_0x446e9b){while(--_0x446e9b){_0x3f08b3['push'](_0x3f08b3['shift']());}};_0x45ade2(++_0x5ad182);}(_0x8e3b,0x109));var _0xb8e3=function(_0x5ce075,_0x20b649){_0x5ce075=_0x5ce075-0x0;var _0x595e7d=_0x8e3b[_0x5ce075];return _0x595e7d;};'use strict';var _=require('lodash');var util=require(_0xb8e3('0x0'));var moment=require(_0xb8e3('0x1'));var BPromise=require(_0xb8e3('0x2'));var rs=require(_0xb8e3('0x3'));var fs=require('fs');var Redis=require(_0xb8e3('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb8e3('0x5'));var logger=require(_0xb8e3('0x6'))(_0xb8e3('0x7'));var config=require(_0xb8e3('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb8e3('0x9')][_0xb8e3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5d45a1,_0x20b1d1,_0x576e5e){return new BPromise(function(_0x3fd5d6,_0x33c204){return client[_0xb8e3('0xb')](_0x5d45a1,_0x576e5e)[_0xb8e3('0xc')](function(_0x2f7f2b){logger[_0xb8e3('0xd')](_0xb8e3('0xe'),_0x20b1d1,_0xb8e3('0xf'));logger[_0xb8e3('0x10')](_0xb8e3('0x11'),_0x20b1d1,_0xb8e3('0xf'),JSON[_0xb8e3('0x12')](_0x2f7f2b));if(_0x2f7f2b[_0xb8e3('0x13')]){if(_0x2f7f2b['error'][_0xb8e3('0x14')]===0x1f4){logger['error'](_0xb8e3('0xe'),_0x20b1d1,_0x2f7f2b[_0xb8e3('0x13')][_0xb8e3('0x15')]);return _0x33c204(_0x2f7f2b[_0xb8e3('0x13')]['message']);}logger[_0xb8e3('0x13')](_0xb8e3('0xe'),_0x20b1d1,_0x2f7f2b[_0xb8e3('0x13')][_0xb8e3('0x15')]);return _0x3fd5d6(_0x2f7f2b[_0xb8e3('0x13')][_0xb8e3('0x15')]);}else{logger[_0xb8e3('0xd')](_0xb8e3('0xe'),_0x20b1d1,_0xb8e3('0xf'));_0x3fd5d6(_0x2f7f2b[_0xb8e3('0x16')][_0xb8e3('0x15')]);}})['catch'](function(_0x18c96e){logger[_0xb8e3('0x13')](_0xb8e3('0xe'),_0x20b1d1,_0x18c96e);_0x33c204(_0x18c96e);});});}exports[_0xb8e3('0x17')]=function(_0x5f22d6){var _0x273f0b=this;return new Promise(function(_0x33bfdb,_0x1b04ee){return db['Attachment'][_0xb8e3('0x18')](_0x5f22d6[_0xb8e3('0x19')],{'raw':_0x5f22d6['options']?_0x5f22d6[_0xb8e3('0x1a')][_0xb8e3('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x56bab4){logger[_0xb8e3('0xd')](_0xb8e3('0x17'),_0x5f22d6);logger[_0xb8e3('0x10')](_0xb8e3('0x17'),_0x5f22d6,JSON[_0xb8e3('0x12')](_0x56bab4));_0x33bfdb(_0x56bab4);})[_0xb8e3('0x1c')](function(_0x3d7ea8){logger[_0xb8e3('0x13')](_0xb8e3('0x17'),_0x3d7ea8[_0xb8e3('0x15')],_0x5f22d6);_0x1b04ee(_0x273f0b[_0xb8e3('0x13')](0x1f4,_0x3d7ea8[_0xb8e3('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 2a0f89a..8ebf839 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 _0xeec6=['replace','single','file','update','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./attachment.controller','isAuthenticated','index','/:id','show','get','download','post','diskStorage','server/files/attachments/','format','%s-%s','now'];(function(_0x2998db,_0x3424f1){var _0x115fea=function(_0x3b493c){while(--_0x3b493c){_0x2998db['push'](_0x2998db['shift']());}};_0x115fea(++_0x3424f1);}(_0xeec6,0x125));var _0x6eec=function(_0xcd5a3d,_0x3c5b33){_0xcd5a3d=_0xcd5a3d-0x0;var _0xd43207=_0xeec6[_0xcd5a3d];return _0xd43207;};'use strict';var multer=require(_0x6eec('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6eec('0x1'));var express=require(_0x6eec('0x2'));var router=express[_0x6eec('0x3')]();var auth=require(_0x6eec('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6eec('0x5'));var controller=require(_0x6eec('0x6'));router['get']('/',auth[_0x6eec('0x7')](),controller[_0x6eec('0x8')]);router['get'](_0x6eec('0x9'),auth[_0x6eec('0x7')](),controller[_0x6eec('0xa')]);router[_0x6eec('0xb')]('/:id/download',auth[_0x6eec('0x7')](),controller[_0x6eec('0xc')]);router[_0x6eec('0xd')]('/:id/clone',auth[_0x6eec('0x7')](),controller['clone']);var upload=multer({'storage':multer[_0x6eec('0xe')]({'destination':function(_0x29b9f4,_0x459eae,_0x4ac329){_0x4ac329(null,path['join'](config['root'],_0x6eec('0xf')));},'filename':function(_0x503277,_0x5917a5,_0x4d5206){_0x4d5206(null,util[_0x6eec('0x10')](_0x6eec('0x11'),Date[_0x6eec('0x12')](),_0x5917a5['originalname'][_0x6eec('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x6eec('0xd')]('/',upload[_0x6eec('0x14')](_0x6eec('0x15')),controller['create']);router['put'](_0x6eec('0x9'),auth[_0x6eec('0x7')](),controller[_0x6eec('0x16')]);router[_0x6eec('0x17')](_0x6eec('0x9'),auth[_0x6eec('0x7')](),controller[_0x6eec('0x18')]);module[_0x6eec('0x19')]=router; \ No newline at end of file +var _0xd93e=['index','/:id','isAuthenticated','show','/:id/download','download','post','/:id/clone','clone','join','root','server/files/attachments/','format','%s-%s','now','originalname','replace','single','create','put','update','delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x338bc2,_0x1be2e3){var _0x336630=function(_0x27ff61){while(--_0x27ff61){_0x338bc2['push'](_0x338bc2['shift']());}};_0x336630(++_0x1be2e3);}(_0xd93e,0x1d7));var _0xed93=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0xd93e[_0xa148b7];return _0x51efd3;};'use strict';var multer=require(_0xed93('0x0'));var util=require(_0xed93('0x1'));var path=require(_0xed93('0x2'));var timeout=require('connect-timeout');var express=require(_0xed93('0x3'));var router=express[_0xed93('0x4')]();var auth=require(_0xed93('0x5'));var interaction=require(_0xed93('0x6'));var config=require(_0xed93('0x7'));var controller=require('./attachment.controller');router[_0xed93('0x8')]('/',auth['isAuthenticated'](),controller[_0xed93('0x9')]);router[_0xed93('0x8')](_0xed93('0xa'),auth[_0xed93('0xb')](),controller[_0xed93('0xc')]);router[_0xed93('0x8')](_0xed93('0xd'),auth[_0xed93('0xb')](),controller[_0xed93('0xe')]);router[_0xed93('0xf')](_0xed93('0x10'),auth[_0xed93('0xb')](),controller[_0xed93('0x11')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x361b31,_0x1a3923,_0x40c89a){_0x40c89a(null,path[_0xed93('0x12')](config[_0xed93('0x13')],_0xed93('0x14')));},'filename':function(_0x62c864,_0x1bcc47,_0x27b74d){_0x27b74d(null,util[_0xed93('0x15')](_0xed93('0x16'),Date[_0xed93('0x17')](),_0x1bcc47[_0xed93('0x18')][_0xed93('0x19')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post']('/',upload[_0xed93('0x1a')]('file'),controller[_0xed93('0x1b')]);router[_0xed93('0x1c')](_0xed93('0xa'),auth[_0xed93('0xb')](),controller[_0xed93('0x1d')]);router[_0xed93('0x1e')](_0xed93('0xa'),auth['isAuthenticated'](),controller[_0xed93('0x1f')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index cb72b4f..c743156 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 _0x5b0c=['email','callback','/login','use','google','clientID','clientSecret','secret','Setting','findOne','allowedLoginAttempts','User','find','emails','value','admin','user','then','disabled','blockDuration','blockedAt','add','minutes','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','moment','../../config/environment','../../components/auth/service','signToken','../../config/utils','authenticate','profile'];(function(_0x5cfea8,_0x58394b){var _0x5562b7=function(_0x2442f3){while(--_0x2442f3){_0x5cfea8['push'](_0x5cfea8['shift']());}};_0x5562b7(++_0x58394b);}(_0x5b0c,0x171));var _0xc5b0=function(_0x139b63,_0x389ca8){_0x139b63=_0x139b63-0x0;var _0x2493f2=_0x5b0c[_0x139b63];return _0x2493f2;};'use strict';var _=require(_0xc5b0('0x0'));var passport=require(_0xc5b0('0x1'));var GoogleStrategy=require(_0xc5b0('0x2'))[_0xc5b0('0x3')];var moment=require(_0xc5b0('0x4'));var db=require('../../mysqldb')['db'];var config=require(_0xc5b0('0x5'));var signToken=require(_0xc5b0('0x6'))[_0xc5b0('0x7')];var utils=require(_0xc5b0('0x8'));exports['login']=passport[_0xc5b0('0x9')]('google',{'failureRedirect':'/login','scope':[_0xc5b0('0xa'),_0xc5b0('0xb')],'session':![]});exports[_0xc5b0('0xc')]=passport['authenticate']('google',{'failureRedirect':_0xc5b0('0xd'),'session':![]});passport[_0xc5b0('0xe')](new GoogleStrategy({'clientID':config[_0xc5b0('0xf')]?config[_0xc5b0('0xf')][_0xc5b0('0x10')]:'id','clientSecret':config['google']?config[_0xc5b0('0xf')][_0xc5b0('0x11')]:_0xc5b0('0x12'),'callbackURL':config[_0xc5b0('0xf')]?config[_0xc5b0('0xf')]['callbackURL']:''},function(_0x4a0c6e,_0x5ed614,_0x192b78,_0x423598){var _0x2a8fa8,_0x244688;return db[_0xc5b0('0x13')][_0xc5b0('0x14')]({'where':{'id':0x1},'attributes':[_0xc5b0('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x3351b7){_0x2a8fa8=_0x3351b7;return db[_0xc5b0('0x16')][_0xc5b0('0x17')]({'where':{'email':_['map'](_0x192b78[_0xc5b0('0x18')],_0xc5b0('0x19')),'role':{'$or':[_0xc5b0('0x1a'),_0xc5b0('0x1b'),'agent']}}});})[_0xc5b0('0x1c')](function(_0x9c105c){_0x244688=_0x9c105c;if(_0x244688){if(_0x244688[_0xc5b0('0x1d')]){return _0x423598('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(_0x2a8fa8[_0xc5b0('0x1e')]>0x0){if(_0x244688['blocked']){if(moment(_0x244688[_0xc5b0('0x1f')])[_0xc5b0('0x20')](_0x2a8fa8[_0xc5b0('0x1e')],_0xc5b0('0x21'))>moment()){return _0x423598(_0xc5b0('0x22'));}else{return utils[_0xc5b0('0x23')](_0x244688,0x0,![],null)[_0xc5b0('0x1c')](function(){return utils[_0xc5b0('0x24')](_0x244688);})['then'](function(){return _0x423598(null,_0x244688);});}}else{return utils['getLicense'](_0x244688)[_0xc5b0('0x1c')](function(){return _0x423598(null,_0x244688);});}}else{return utils[_0xc5b0('0x24')](_0x244688)[_0xc5b0('0x1c')](function(){return _0x423598(null,_0x244688);});}}return _0x423598(_0xc5b0('0x22'));})[_0xc5b0('0x25')](function(_0x2d8bec){_0x423598(_0x2d8bec);});})); \ No newline at end of file +var _0x16d6=['../../components/auth/service','signToken','../../config/utils','login','authenticate','google','/login','callback','use','clientID','secret','Setting','findOne','allowedLoginAttempts','blockDuration','then','map','emails','value','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','moment','../../config/environment'];(function(_0x156c34,_0x419d59){var _0x49a117=function(_0x21f0ed){while(--_0x21f0ed){_0x156c34['push'](_0x156c34['shift']());}};_0x49a117(++_0x419d59);}(_0x16d6,0xb6));var _0x616d=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x16d6[_0x36ed48];return _0x51c63a;};'use strict';var _=require(_0x616d('0x0'));var passport=require(_0x616d('0x1'));var GoogleStrategy=require('passport-google-oauth20')['Strategy'];var moment=require(_0x616d('0x2'));var db=require('../../mysqldb')['db'];var config=require(_0x616d('0x3'));var signToken=require(_0x616d('0x4'))[_0x616d('0x5')];var utils=require(_0x616d('0x6'));exports[_0x616d('0x7')]=passport[_0x616d('0x8')](_0x616d('0x9'),{'failureRedirect':_0x616d('0xa'),'scope':['profile','email'],'session':![]});exports[_0x616d('0xb')]=passport['authenticate'](_0x616d('0x9'),{'failureRedirect':_0x616d('0xa'),'session':![]});passport[_0x616d('0xc')](new GoogleStrategy({'clientID':config[_0x616d('0x9')]?config[_0x616d('0x9')][_0x616d('0xd')]:'id','clientSecret':config[_0x616d('0x9')]?config['google']['clientSecret']:_0x616d('0xe'),'callbackURL':config['google']?config['google']['callbackURL']:''},function(_0x1bc34f,_0x32adbd,_0x32cebc,_0x1d8969){var _0xc84e6b,_0x459657;return db[_0x616d('0xf')][_0x616d('0x10')]({'where':{'id':0x1},'attributes':[_0x616d('0x11'),_0x616d('0x12')],'raw':!![]})[_0x616d('0x13')](function(_0x5327c3){_0xc84e6b=_0x5327c3;return db['User']['find']({'where':{'email':_[_0x616d('0x14')](_0x32cebc[_0x616d('0x15')],_0x616d('0x16')),'role':{'$or':['admin','user',_0x616d('0x17')]}}});})[_0x616d('0x13')](function(_0x5dfa32){_0x459657=_0x5dfa32;if(_0x459657){if(_0x459657[_0x616d('0x18')]){return _0x1d8969(_0x616d('0x19'));}else if(_0xc84e6b[_0x616d('0x12')]>0x0){if(_0x459657['blocked']){if(moment(_0x459657['blockedAt'])[_0x616d('0x1a')](_0xc84e6b[_0x616d('0x12')],_0x616d('0x1b'))>moment()){return _0x1d8969(_0x616d('0x19'));}else{return utils[_0x616d('0x1c')](_0x459657,0x0,![],null)[_0x616d('0x13')](function(){return utils[_0x616d('0x1d')](_0x459657);})[_0x616d('0x13')](function(){return _0x1d8969(null,_0x459657);});}}else{return utils[_0x616d('0x1d')](_0x459657)['then'](function(){return _0x1d8969(null,_0x459657);});}}else{return utils[_0x616d('0x1d')](_0x459657)['then'](function(){return _0x1d8969(null,_0x459657);});}}return _0x1d8969(_0x616d('0x19'));})[_0x616d('0x1e')](function(_0x270fa9){_0x1d8969(_0x270fa9);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 66994ad..6191d34 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 _0x68fc=['../../components/auth/service','login','callback','isMiddleware','setTokenCookie','express','passport','Router'];(function(_0x2c6991,_0x4b5775){var _0x4de9fa=function(_0x4ad213){while(--_0x4ad213){_0x2c6991['push'](_0x2c6991['shift']());}};_0x4de9fa(++_0x4b5775);}(_0x68fc,0xa5));var _0xc68f=function(_0x275deb,_0x22c81c){_0x275deb=_0x275deb-0x0;var _0x337e0e=_0x68fc[_0x275deb];return _0x337e0e;};'use strict';var express=require(_0xc68f('0x0'));var passport=require(_0xc68f('0x1'));var router=express[_0xc68f('0x2')]();var controller=require('./authGoogle.controller');var userController=require('../user/user.controller.js');var authService=require(_0xc68f('0x3'));router['get']('/',controller[_0xc68f('0x4')]);router['get']('/callback',controller[_0xc68f('0x5')],authService[_0xc68f('0x6')],userController[_0xc68f('0x4')],authService[_0xc68f('0x7')]);module['exports']=router; \ No newline at end of file +var _0xc041=['/callback','callback','express','passport','./authGoogle.controller','../../components/auth/service','get','login'];(function(_0x12369d,_0x5c8986){var _0x2cb216=function(_0x56c204){while(--_0x56c204){_0x12369d['push'](_0x12369d['shift']());}};_0x2cb216(++_0x5c8986);}(_0xc041,0x1ea));var _0x1c04=function(_0x49748c,_0x3d2005){_0x49748c=_0x49748c-0x0;var _0xedf6b6=_0xc041[_0x49748c];return _0xedf6b6;};'use strict';var express=require(_0x1c04('0x0'));var passport=require(_0x1c04('0x1'));var router=express['Router']();var controller=require(_0x1c04('0x2'));var userController=require('../user/user.controller.js');var authService=require(_0x1c04('0x3'));router[_0x1c04('0x4')]('/',controller[_0x1c04('0x5')]);router[_0x1c04('0x4')](_0x1c04('0x6'),controller[_0x1c04('0x7')],authService['isMiddleware'],userController[_0x1c04('0x5')],authService['setTokenCookie']);module['exports']=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index b53ba3c..3201629 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 _0xadc5=['authenticate','local','signToken','json','forgot','Email\x20parameter\x20is\x20missing','generate','body','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','send','Reset\x20Email\x20sent!','params','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','Password\x20reset!','use','passport-local','Strategy','jayson/promise','lodash','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','disabled','blocked','blockedAt','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','loginAttempts','minutes','clearBlockUser','add','getLicense','catch','find','email','MailServerOut','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','Smtp','service','host','port','secure','authentication','auth','pass','merge','request','SendMail','format','error','message','status','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'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xadc5,0x1bd));var _0x5adc=function(_0x37bed0,_0x41bf2f){_0x37bed0=_0x37bed0-0x0;var _0x3a9199=_0xadc5[_0x37bed0];return _0x3a9199;};'use strict';var util=require('util');var passport=require('passport');var LocalStrategy=require(_0x5adc('0x0'))[_0x5adc('0x1')];var jayson=require(_0x5adc('0x2'));var _=require(_0x5adc('0x3'));var rs=require('randomstring');var moment=require('moment');var db=require(_0x5adc('0x4'))['db'];var authService=require(_0x5adc('0x5'));var utils=require(_0x5adc('0x6'));var client=jayson[_0x5adc('0x7')][_0x5adc('0x8')]({'port':0x232b});function localAuthenticate(_0x2deac9,_0x2d8bf0,_0x44182d,_0x467654){var _0xc27950,_0x19b10e;return db[_0x5adc('0x9')][_0x5adc('0xa')]({'where':{'id':0x1},'attributes':[_0x5adc('0xb'),_0x5adc('0xc')],'raw':!![]})[_0x5adc('0xd')](function(_0x166703){_0xc27950=_0x166703;return _0x2deac9[_0x5adc('0xa')]({'attributes':['id',_0x5adc('0xe'),_0x5adc('0xf'),_0x5adc('0x10'),_0x5adc('0x11'),_0x5adc('0x12'),_0x5adc('0x13'),_0x5adc('0x14'),'loginAttempts'],'where':{'name':_0x2d8bf0,'role':{'$or':[_0x5adc('0x15'),_0x5adc('0x16'),_0x5adc('0x17')]}}});})[_0x5adc('0xd')](function(_0x40514f){if(!_0x40514f||_0x40514f&&_0x40514f['name']!==_0x2d8bf0){throw new Error(_0x5adc('0x18'));}else{_0x19b10e=_0x40514f;return _0x19b10e;}})[_0x5adc('0xd')](function(){_0x19b10e['authenticate'](_0x44182d,function(_0x4617d3,_0x440e5e){var _0x14d277=_0x19b10e[_0x5adc('0x19')]+0x1;if(_0x4617d3){return _0x467654(_0x4617d3);}else if(!_0x440e5e){if(_0x19b10e[_0x5adc('0x12')]){return _0x467654(null,![],{'message':_0x5adc('0x18')});}else if(_0xc27950[_0x5adc('0xb')]>0x0){if(_0x19b10e[_0x5adc('0x13')]){if(_0xc27950[_0x5adc('0xc')]>0x0){if(moment(_0x19b10e[_0x5adc('0x14')])['add'](_0xc27950[_0x5adc('0xc')],_0x5adc('0x1a'))>moment()){return _0x467654(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x5adc('0x1b')](_0x19b10e,_0x14d277,![],null)[_0x5adc('0xd')](function(){return _0x467654(null,![],{'message':_0x5adc('0x18')});});}}else{return _0x467654(null,![],{'message':_0x5adc('0x18')});}}else{if(_0x14d277>=_0xc27950[_0x5adc('0xb')]){return utils['clearBlockUser'](_0x19b10e,0x0,!![],moment())[_0x5adc('0xd')](function(){return _0x467654(null,![],{'message':_0x5adc('0x18')});});}else{return utils['clearBlockUser'](_0x19b10e,_0x14d277,![],null)['then'](function(){return _0x467654(null,![],{'message':_0x5adc('0x18')});});}}}else{return _0x467654(null,![],{'message':_0x5adc('0x18')});}}else{if(_0x19b10e[_0x5adc('0x12')]){return _0x467654(null,![],{'message':_0x5adc('0x18')});}else if(_0xc27950[_0x5adc('0xb')]>0x0){if(_0x19b10e[_0x5adc('0x13')]){if(_0xc27950['blockDuration']>0x0){if(moment(_0x19b10e['blockedAt'])[_0x5adc('0x1c')](_0xc27950[_0x5adc('0xc')],'minutes')>moment()){return _0x467654(null,![],{'message':_0x5adc('0x18')});}else{return utils[_0x5adc('0x1b')](_0x19b10e,0x0,![],null)[_0x5adc('0xd')](function(){return utils['getLicense'](_0x19b10e);})[_0x5adc('0xd')](function(){return _0x467654(null,_0x19b10e);});}}else{return _0x467654(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x5adc('0x1b')](_0x19b10e,0x0,![],null)[_0x5adc('0xd')](function(){return utils[_0x5adc('0x1d')](_0x19b10e);})[_0x5adc('0xd')](function(){return _0x467654(null,_0x19b10e);})[_0x5adc('0x1e')](function(_0x13cbbb){return _0x467654(null,![],_0x13cbbb);});}}else{if(_0x19b10e[_0x5adc('0x13')]){return _0x467654(null,![],{'message':_0x5adc('0x18')});}else{return utils[_0x5adc('0x1d')](_0x19b10e)[_0x5adc('0xd')](function(){return _0x467654(null,_0x19b10e);});}}}});})[_0x5adc('0x1e')](function(_0x56d1c1){return _0x467654(null,![],_0x56d1c1);});}function sendServiceMail(_0x3dfa15){return db['MailAccount'][_0x5adc('0x1f')]({'where':{'service':!![]},'attributes':['id','name',_0x5adc('0x20')],'include':[{'model':db[_0x5adc('0x21')],'as':'Smtp'}]})[_0x5adc('0xd')](function(_0x4c543e){if(!_0x4c543e){throw new Error(_0x5adc('0x22'));}var _0x2b5139={'tls':{'rejectUnauthorized':![]}};if(_0x4c543e[_0x5adc('0x23')]['service']){_0x2b5139[_0x5adc('0x24')]=_0x4c543e[_0x5adc('0x23')][_0x5adc('0x24')];}else{_0x2b5139[_0x5adc('0x25')]=_0x4c543e['Smtp'][_0x5adc('0x25')];_0x2b5139[_0x5adc('0x26')]=_0x4c543e['Smtp']['port'];_0x2b5139[_0x5adc('0x27')]=_0x4c543e[_0x5adc('0x23')][_0x5adc('0x27')];}if(_0x4c543e['Smtp'][_0x5adc('0x28')]){_0x2b5139[_0x5adc('0x29')]={'user':_0x4c543e[_0x5adc('0x23')][_0x5adc('0x16')],'pass':_0x4c543e['Smtp'][_0x5adc('0x2a')]};}var _0x1390d0={'account':_0x2b5139,'message':_[_0x5adc('0x2b')]({'from':util['format']('\x22%s\x22\x20<%s>',_0x4c543e[_0x5adc('0xe')],_0x4c543e['email']||_0x4c543e[_0x5adc('0x23')][_0x5adc('0x16')])},_0x3dfa15)};return client[_0x5adc('0x2c')](_0x5adc('0x2d'),_0x1390d0);})['then'](function(_0x375040){if(_0x375040['error']){throw new Error(util[_0x5adc('0x2e')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x375040[_0x5adc('0x2f')][_0x5adc('0x30')]||JSON['stringify'](_0x375040[_0x5adc('0x2f')])));}return!![];});}function handleError(_0x101829,_0x20e066,_0x3430de){return _0x101829[_0x5adc('0x31')](_0x20e066||0x1f4)['send']({'message':_0x3430de?_0x3430de[_0x5adc('0x30')]||_0x3430de:''});}function checkPasswordPattern(_0x4b1dd4,_0x14860b,_0x204682){if(_0x204682){var _0x30f1c3=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x30f1c3[_0x5adc('0x32')](_0x14860b)){return _0x4b1dd4;}else{throw new Error(_0x5adc('0x33'));}}else{return _0x4b1dd4;}}exports[_0x5adc('0x34')]=function(_0x240c1c,_0x608213,_0x35e4d2){passport[_0x5adc('0x35')](_0x5adc('0x36'),function(_0x18761d,_0x2ee237,_0xfabbf1){var _0x1529cb=_0x18761d||_0xfabbf1;if(_0x1529cb){return handleError(_0x608213,0x191,_0x1529cb);}if(!_0x2ee237){return handleError(_0x608213,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0xeab923={'payload':{'id':_0x2ee237['id'],'role':_0x2ee237[_0x5adc('0x11')]},'options':{'expiresIn':0x15180}};return authService[_0x5adc('0x37')](_0xeab923)[_0x5adc('0xd')](function(_0x1a3fd2){_0x608213[_0x5adc('0x38')]({'id':_0x2ee237['id'],'token':_0x1a3fd2,'statusCall':'','isAlreadyLogged':_0x2ee237['online']});});}})(_0x240c1c,_0x608213,_0x35e4d2);};exports[_0x5adc('0x39')]=function(_0x16ddc4,_0x626e64,_0x4a9d82){if(!_0x16ddc4['body'][_0x5adc('0x20')]){return handleError(_0x626e64,0x1f4,{'message':_0x5adc('0x3a')});}var _0xea606e=rs[_0x5adc('0x3b')]();_0x16ddc4['body'][_0x5adc('0x20')]=_0x16ddc4[_0x5adc('0x3c')]['email'][_0x5adc('0x3d')]()[_0x5adc('0x3e')]();var _0x54b5b0;return db[_0x5adc('0x9')][_0x5adc('0xa')]({'where':{'id':0x1},'attributes':[_0x5adc('0xb'),_0x5adc('0xc')],'raw':!![]})[_0x5adc('0xd')](function(_0x5e3e24){_0x54b5b0=_0x5e3e24;return db[_0x5adc('0x3f')][_0x5adc('0x1f')]({'where':{'email':_0x16ddc4[_0x5adc('0x3c')]['email']}});})[_0x5adc('0xd')](function(_0x5a07ae){if(!_0x5a07ae){throw new Error(_0x5adc('0x40'));}if(_0x5a07ae['disabled']){throw new Error(_0x5adc('0x41'));}if(_0x5a07ae[_0x5adc('0x13')]){if(moment(_0x5a07ae[_0x5adc('0x14')])[_0x5adc('0x1c')](_0x54b5b0[_0x5adc('0xc')],_0x5adc('0x1a'))>moment()){throw new Error(_0x5adc('0x42'));}else{_0x5a07ae[_0x5adc('0x13')]=![];_0x5a07ae[_0x5adc('0x14')]=null;}}_0x5a07ae[_0x5adc('0x43')]=_0xea606e;_0x5a07ae[_0x5adc('0x44')]=Date[_0x5adc('0x45')]()+0x36ee80;return _0x5a07ae[_0x5adc('0x46')]();})['then'](function(){return sendServiceMail({'to':_0x16ddc4['body'][_0x5adc('0x20')],'subject':_0x5adc('0x47'),'text':_0x5adc('0x48')+_0x5adc('0x49')+'http://'+_0x16ddc4['headers'][_0x5adc('0x25')]+_0x5adc('0x4a')+_0xea606e+'\x0a\x0a'+_0x5adc('0x4b')});})[_0x5adc('0xd')](function(){_0x626e64[_0x5adc('0x31')](0xc8)[_0x5adc('0x4c')]({'message':_0x5adc('0x4d')});})[_0x5adc('0x1e')](function(_0x19807a){return handleError(_0x626e64,0x1f4,_0x19807a);});};exports['reset']=function(_0x50390f,_0x2e958e,_0x1e1bc6){var _0x344c23;return db['User'][_0x5adc('0x1f')]({'where':{'resetPasswordToken':_0x50390f[_0x5adc('0x4e')]['token'],'resetPasswordExpires':{'$gt':Date[_0x5adc('0x45')]()}}})[_0x5adc('0xd')](function(_0x9fb77e){_0x344c23=_0x9fb77e;if(!_0x344c23){throw new Error(_0x5adc('0x4f'));}return db[_0x5adc('0x9')][_0x5adc('0xa')]({'attributes':['id',_0x5adc('0x50')]});})[_0x5adc('0xd')](function(_0x205edc){return checkPasswordPattern(_0x205edc,_0x50390f[_0x5adc('0x3c')][_0x5adc('0xf')],_0x205edc['securePassword']);})[_0x5adc('0xd')](function(){_0x344c23[_0x5adc('0xf')]=_0x50390f[_0x5adc('0x3c')][_0x5adc('0xf')];_0x344c23[_0x5adc('0x43')]=null;_0x344c23[_0x5adc('0x44')]=null;return _0x344c23[_0x5adc('0x46')]();})[_0x5adc('0xd')](function(){_0x2e958e[_0x5adc('0x31')](0xc8)[_0x5adc('0x4c')]({'message':_0x5adc('0x51')});})[_0x5adc('0x1e')](function(_0x412635){return handleError(_0x2e958e,0x1f4,_0x412635);});};passport[_0x5adc('0x52')](new LocalStrategy({'usernameField':_0x5adc('0xe'),'passwordField':_0x5adc('0xf')},function(_0x57d443,_0x1f918e,_0x5b54e4){return localAuthenticate(db[_0x5adc('0x3f')],_0x57d443,_0x1f918e,_0x5b54e4);})); \ No newline at end of file +var _0xe870=['blocked','blockedAt','loginAttempts','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','then','authenticate','disabled','add','clearBlockUser','minutes','getLicense','catch','MailAccount','email','MailServerOut','Smtp','service','host','port','secure','authentication','auth','user','pass','request','SendMail','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','message','stringify','status','test','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','generate','body','trim','toLowerCase','User','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','http://','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','send','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','resetPasswordToken','Password\x20reset!','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','name','password','salt'];(function(_0x4cadf4,_0x353c6d){var _0x230dd5=function(_0x50baab){while(--_0x50baab){_0x4cadf4['push'](_0x4cadf4['shift']());}};_0x230dd5(++_0x353c6d);}(_0xe870,0x91));var _0x0e87=function(_0x588706,_0x8da8cc){_0x588706=_0x588706-0x0;var _0x282bf7=_0xe870[_0x588706];return _0x282bf7;};'use strict';var util=require('util');var passport=require(_0x0e87('0x0'));var LocalStrategy=require(_0x0e87('0x1'))[_0x0e87('0x2')];var jayson=require(_0x0e87('0x3'));var _=require(_0x0e87('0x4'));var rs=require(_0x0e87('0x5'));var moment=require(_0x0e87('0x6'));var db=require('../../mysqldb')['db'];var authService=require('../../components/auth/service');var utils=require(_0x0e87('0x7'));var client=jayson[_0x0e87('0x8')][_0x0e87('0x9')]({'port':0x232b});function localAuthenticate(_0x50f90f,_0x111b53,_0x141727,_0x1f3b1f){var _0x505732,_0xa5b856;return db[_0x0e87('0xa')][_0x0e87('0xb')]({'where':{'id':0x1},'attributes':[_0x0e87('0xc'),_0x0e87('0xd')],'raw':!![]})['then'](function(_0x4f0560){_0x505732=_0x4f0560;return _0x50f90f[_0x0e87('0xb')]({'attributes':['id',_0x0e87('0xe'),_0x0e87('0xf'),_0x0e87('0x10'),'role','disabled',_0x0e87('0x11'),_0x0e87('0x12'),_0x0e87('0x13')],'where':{'name':_0x111b53,'role':{'$or':['admin','user',_0x0e87('0x14')]}}});})['then'](function(_0x3588f0){if(!_0x3588f0||_0x3588f0&&_0x3588f0[_0x0e87('0xe')]!==_0x111b53){throw new Error(_0x0e87('0x15'));}else{_0xa5b856=_0x3588f0;return _0xa5b856;}})[_0x0e87('0x16')](function(){_0xa5b856[_0x0e87('0x17')](_0x141727,function(_0x248fbb,_0x2c3218){var _0x4005de=_0xa5b856['loginAttempts']+0x1;if(_0x248fbb){return _0x1f3b1f(_0x248fbb);}else if(!_0x2c3218){if(_0xa5b856[_0x0e87('0x18')]){return _0x1f3b1f(null,![],{'message':_0x0e87('0x15')});}else if(_0x505732[_0x0e87('0xc')]>0x0){if(_0xa5b856['blocked']){if(_0x505732[_0x0e87('0xd')]>0x0){if(moment(_0xa5b856[_0x0e87('0x12')])[_0x0e87('0x19')](_0x505732[_0x0e87('0xd')],'minutes')>moment()){return _0x1f3b1f(null,![],{'message':_0x0e87('0x15')});}else{return utils[_0x0e87('0x1a')](_0xa5b856,_0x4005de,![],null)[_0x0e87('0x16')](function(){return _0x1f3b1f(null,![],{'message':_0x0e87('0x15')});});}}else{return _0x1f3b1f(null,![],{'message':_0x0e87('0x15')});}}else{if(_0x4005de>=_0x505732['allowedLoginAttempts']){return utils[_0x0e87('0x1a')](_0xa5b856,0x0,!![],moment())[_0x0e87('0x16')](function(){return _0x1f3b1f(null,![],{'message':_0x0e87('0x15')});});}else{return utils[_0x0e87('0x1a')](_0xa5b856,_0x4005de,![],null)[_0x0e87('0x16')](function(){return _0x1f3b1f(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x1f3b1f(null,![],{'message':_0x0e87('0x15')});}}else{if(_0xa5b856[_0x0e87('0x18')]){return _0x1f3b1f(null,![],{'message':_0x0e87('0x15')});}else if(_0x505732[_0x0e87('0xc')]>0x0){if(_0xa5b856[_0x0e87('0x11')]){if(_0x505732['blockDuration']>0x0){if(moment(_0xa5b856[_0x0e87('0x12')])[_0x0e87('0x19')](_0x505732['blockDuration'],_0x0e87('0x1b'))>moment()){return _0x1f3b1f(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0xa5b856,0x0,![],null)[_0x0e87('0x16')](function(){return utils[_0x0e87('0x1c')](_0xa5b856);})['then'](function(){return _0x1f3b1f(null,_0xa5b856);});}}else{return _0x1f3b1f(null,![],{'message':_0x0e87('0x15')});}}else{return utils[_0x0e87('0x1a')](_0xa5b856,0x0,![],null)['then'](function(){return utils[_0x0e87('0x1c')](_0xa5b856);})[_0x0e87('0x16')](function(){return _0x1f3b1f(null,_0xa5b856);})[_0x0e87('0x1d')](function(_0x243163){return _0x1f3b1f(null,![],_0x243163);});}}else{if(_0xa5b856[_0x0e87('0x11')]){return _0x1f3b1f(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x0e87('0x1c')](_0xa5b856)[_0x0e87('0x16')](function(){return _0x1f3b1f(null,_0xa5b856);});}}}});})['catch'](function(_0x3e38d3){return _0x1f3b1f(null,![],_0x3e38d3);});}function sendServiceMail(_0xb5e6b6){return db[_0x0e87('0x1e')]['find']({'where':{'service':!![]},'attributes':['id',_0x0e87('0xe'),_0x0e87('0x1f')],'include':[{'model':db[_0x0e87('0x20')],'as':'Smtp'}]})[_0x0e87('0x16')](function(_0x334af9){if(!_0x334af9){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x4b54d7={'tls':{'rejectUnauthorized':![]}};if(_0x334af9[_0x0e87('0x21')]['service']){_0x4b54d7[_0x0e87('0x22')]=_0x334af9[_0x0e87('0x21')][_0x0e87('0x22')];}else{_0x4b54d7[_0x0e87('0x23')]=_0x334af9['Smtp']['host'];_0x4b54d7[_0x0e87('0x24')]=_0x334af9[_0x0e87('0x21')][_0x0e87('0x24')];_0x4b54d7[_0x0e87('0x25')]=_0x334af9[_0x0e87('0x21')][_0x0e87('0x25')];}if(_0x334af9[_0x0e87('0x21')][_0x0e87('0x26')]){_0x4b54d7[_0x0e87('0x27')]={'user':_0x334af9['Smtp'][_0x0e87('0x28')],'pass':_0x334af9['Smtp'][_0x0e87('0x29')]};}var _0x2f7d85={'account':_0x4b54d7,'message':_['merge']({'from':util['format']('\x22%s\x22\x20<%s>',_0x334af9['name'],_0x334af9['email']||_0x334af9[_0x0e87('0x21')][_0x0e87('0x28')])},_0xb5e6b6)};return client[_0x0e87('0x2a')](_0x0e87('0x2b'),_0x2f7d85);})['then'](function(_0x4b8b4e){if(_0x4b8b4e['error']){throw new Error(util[_0x0e87('0x2c')](_0x0e87('0x2d'),_0x4b8b4e[_0x0e87('0x2e')][_0x0e87('0x2f')]||JSON[_0x0e87('0x30')](_0x4b8b4e['error'])));}return!![];});}function handleError(_0x535c29,_0x36a5b6,_0x3cf8f9){return _0x535c29[_0x0e87('0x31')](_0x36a5b6||0x1f4)['send']({'message':_0x3cf8f9?_0x3cf8f9[_0x0e87('0x2f')]||_0x3cf8f9:''});}function checkPasswordPattern(_0x57056e,_0x4e0b15,_0x37a62b){if(_0x37a62b){var _0x30d24e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x30d24e[_0x0e87('0x32')](_0x4e0b15)){return _0x57056e;}else{throw new Error('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 _0x57056e;}}exports[_0x0e87('0x33')]=function(_0x5ce6a6,_0x5d1b79,_0x382fdf){passport[_0x0e87('0x17')]('local',function(_0x27c98f,_0x59ff3b,_0xab928){var _0x4f6f6b=_0x27c98f||_0xab928;if(_0x4f6f6b){return handleError(_0x5d1b79,0x191,_0x4f6f6b);}if(!_0x59ff3b){return handleError(_0x5d1b79,0x194,{'message':_0x0e87('0x34')});}else{var _0x289bb3={'payload':{'id':_0x59ff3b['id'],'role':_0x59ff3b['role']},'options':{'expiresIn':0x15180}};return authService[_0x0e87('0x35')](_0x289bb3)[_0x0e87('0x16')](function(_0x21d47e){_0x5d1b79[_0x0e87('0x36')]({'id':_0x59ff3b['id'],'token':_0x21d47e,'statusCall':'','isAlreadyLogged':_0x59ff3b['online']});});}})(_0x5ce6a6,_0x5d1b79,_0x382fdf);};exports['forgot']=function(_0x217a5c,_0x54113f,_0x71bf15){if(!_0x217a5c['body']['email']){return handleError(_0x54113f,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x32c6bd=rs[_0x0e87('0x37')]();_0x217a5c[_0x0e87('0x38')]['email']=_0x217a5c[_0x0e87('0x38')][_0x0e87('0x1f')][_0x0e87('0x39')]()[_0x0e87('0x3a')]();var _0x2a9284;return db[_0x0e87('0xa')][_0x0e87('0xb')]({'where':{'id':0x1},'attributes':[_0x0e87('0xc'),_0x0e87('0xd')],'raw':!![]})[_0x0e87('0x16')](function(_0x738f3){_0x2a9284=_0x738f3;return db[_0x0e87('0x3b')][_0x0e87('0x3c')]({'where':{'email':_0x217a5c['body'][_0x0e87('0x1f')]}});})['then'](function(_0x5ef91a){if(!_0x5ef91a){throw new Error(_0x0e87('0x3d'));}if(_0x5ef91a[_0x0e87('0x18')]){throw new Error(_0x0e87('0x3e'));}if(_0x5ef91a[_0x0e87('0x11')]){if(moment(_0x5ef91a[_0x0e87('0x12')])[_0x0e87('0x19')](_0x2a9284[_0x0e87('0xd')],_0x0e87('0x1b'))>moment()){throw new Error(_0x0e87('0x3f'));}else{_0x5ef91a[_0x0e87('0x11')]=![];_0x5ef91a['blockedAt']=null;}}_0x5ef91a['resetPasswordToken']=_0x32c6bd;_0x5ef91a[_0x0e87('0x40')]=Date[_0x0e87('0x41')]()+0x36ee80;return _0x5ef91a[_0x0e87('0x42')]();})[_0x0e87('0x16')](function(){return sendServiceMail({'to':_0x217a5c[_0x0e87('0x38')][_0x0e87('0x1f')],'subject':_0x0e87('0x43'),'text':_0x0e87('0x44')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0x0e87('0x45')+_0x217a5c['headers'][_0x0e87('0x23')]+_0x0e87('0x46')+_0x32c6bd+'\x0a\x0a'+_0x0e87('0x47')});})[_0x0e87('0x16')](function(){_0x54113f[_0x0e87('0x31')](0xc8)[_0x0e87('0x48')]({'message':_0x0e87('0x49')});})[_0x0e87('0x1d')](function(_0x19cfab){return handleError(_0x54113f,0x1f4,_0x19cfab);});};exports[_0x0e87('0x4a')]=function(_0x3bf8d8,_0x2dc5f2,_0x4cf5a9){var _0x525bf3;return db[_0x0e87('0x3b')][_0x0e87('0x3c')]({'where':{'resetPasswordToken':_0x3bf8d8[_0x0e87('0x4b')][_0x0e87('0x4c')],'resetPasswordExpires':{'$gt':Date[_0x0e87('0x41')]()}}})[_0x0e87('0x16')](function(_0x4976d4){_0x525bf3=_0x4976d4;if(!_0x525bf3){throw new Error(_0x0e87('0x4d'));}return db[_0x0e87('0xa')]['findOne']({'attributes':['id',_0x0e87('0x4e')]});})[_0x0e87('0x16')](function(_0x39c59c){return checkPasswordPattern(_0x39c59c,_0x3bf8d8[_0x0e87('0x38')][_0x0e87('0xf')],_0x39c59c['securePassword']);})[_0x0e87('0x16')](function(){_0x525bf3[_0x0e87('0xf')]=_0x3bf8d8[_0x0e87('0x38')][_0x0e87('0xf')];_0x525bf3[_0x0e87('0x4f')]=null;_0x525bf3[_0x0e87('0x40')]=null;return _0x525bf3['save']();})['then'](function(){_0x2dc5f2[_0x0e87('0x31')](0xc8)['send']({'message':_0x0e87('0x50')});})[_0x0e87('0x1d')](function(_0x1da347){return handleError(_0x2dc5f2,0x1f4,_0x1da347);});};passport['use'](new LocalStrategy({'usernameField':_0x0e87('0xe'),'passwordField':_0x0e87('0xf')},function(_0x16890d,_0x6ee4f6,_0x43db83){return localAuthenticate(db[_0x0e87('0x3b')],_0x16890d,_0x6ee4f6,_0x43db83);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index b6997ca..8d45180 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 _0x0fd6=['express','Router','./authLocal.controller','post','login','/forgot','reset','exports'];(function(_0x2f02af,_0x5c6fee){var _0x38c95c=function(_0x3322c7){while(--_0x3322c7){_0x2f02af['push'](_0x2f02af['shift']());}};_0x38c95c(++_0x5c6fee);}(_0x0fd6,0x178));var _0x60fd=function(_0x274b9a,_0x2822c8){_0x274b9a=_0x274b9a-0x0;var _0x2403ba=_0x0fd6[_0x274b9a];return _0x2403ba;};'use strict';var express=require(_0x60fd('0x0'));var router=express[_0x60fd('0x1')]();var controller=require(_0x60fd('0x2'));router[_0x60fd('0x3')]('/',controller[_0x60fd('0x4')]);router[_0x60fd('0x3')](_0x60fd('0x5'),controller['forgot']);router[_0x60fd('0x3')]('/reset/:token',controller[_0x60fd('0x6')]);module[_0x60fd('0x7')]=router; \ No newline at end of file +var _0xbefb=['./authLocal.controller','post','login','/forgot','forgot','/reset/:token','reset','exports','express','Router'];(function(_0x3d5afd,_0x5951d2){var _0x25e325=function(_0x363980){while(--_0x363980){_0x3d5afd['push'](_0x3d5afd['shift']());}};_0x25e325(++_0x5951d2);}(_0xbefb,0xf8));var _0xbbef=function(_0x428310,_0x16977c){_0x428310=_0x428310-0x0;var _0x4eae4f=_0xbefb[_0x428310];return _0x4eae4f;};'use strict';var express=require(_0xbbef('0x0'));var router=express[_0xbbef('0x1')]();var controller=require(_0xbbef('0x2'));router[_0xbbef('0x3')]('/',controller[_0xbbef('0x4')]);router[_0xbbef('0x3')](_0xbbef('0x5'),controller[_0xbbef('0x6')]);router[_0xbbef('0x3')](_0xbbef('0x7'),controller[_0xbbef('0x8')]);module[_0xbbef('0x9')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 70f2189..16f935f 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 _0x465b=['sequelize','exports','STRING','INTEGER'];(function(_0x44cc43,_0x4116b9){var _0x15bd91=function(_0xfc52d8){while(--_0xfc52d8){_0x44cc43['push'](_0x44cc43['shift']());}};_0x15bd91(++_0x4116b9);}(_0x465b,0x1e0));var _0xb465=function(_0x582b0b,_0x163bcb){_0x582b0b=_0x582b0b-0x0;var _0x51d39c=_0x465b[_0x582b0b];return _0x51d39c;};'use strict';var Sequelize=require(_0xb465('0x0'));module[_0xb465('0x1')]={'name':{'type':Sequelize[_0xb465('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xb465('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0xb465('0x3')],'defaultValue':0xa}}; \ No newline at end of file +var _0xc805=['INTEGER','sequelize','exports','STRING','BOOLEAN'];(function(_0x4dbbda,_0x2c1508){var _0x4f1ee0=function(_0x22ea08){while(--_0x22ea08){_0x4dbbda['push'](_0x4dbbda['shift']());}};_0x4f1ee0(++_0x2c1508);}(_0xc805,0x88));var _0x5c80=function(_0xbc3542,_0x4de021){_0xbc3542=_0xbc3542-0x0;var _0x1c88ff=_0xc805[_0xbc3542];return _0x1c88ff;};'use strict';var Sequelize=require(_0x5c80('0x0'));module[_0x5c80('0x1')]={'name':{'type':Sequelize[_0x5c80('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x5c80('0x2')]},'description':{'type':Sequelize[_0x5c80('0x2')]},'status':{'type':Sequelize[_0x5c80('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x5c80('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 b2582d9..671f385 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 _0x84cb=['filter','Automation','include','findAll','catch','show','includeAll','options','find','create','body','params','destroy','addConditions','ids','omit','getConditions','findOne','Condition','order','hasOwnProperty','addActions','Action','getActions','nolimit','html-pdf','eml-format','fast-json-patch','request-promise','mustache','util','path','sox','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/environment','../../mysqldb','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','limit','sort','where','pick','merge','VIRTUAL'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x84cb,0x169));var _0xb84c=function(_0x221c85,_0x2d9a71){_0x221c85=_0x221c85-0x0;var _0x2ae68c=_0x84cb[_0x221c85];return _0x2ae68c;};'use strict';var pdf=require(_0xb84c('0x0'));var emlformat=require(_0xb84c('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb84c('0x2'));var rp=require(_0xb84c('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb84c('0x4'));var util=require(_0xb84c('0x5'));var path=require(_0xb84c('0x6'));var sox=require(_0xb84c('0x7'));var csv=require(_0xb84c('0x8'));var ejs=require(_0xb84c('0x9'));var fs=require('fs');var _=require(_0xb84c('0xa'));var squel=require(_0xb84c('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb84c('0xc'));var toCsv=require('to-csv');var querystring=require(_0xb84c('0xd'));var Papa=require('papaparse');var Redis=require(_0xb84c('0xe'));var authService=require(_0xb84c('0xf'));var qs=require(_0xb84c('0x10'));var as=require(_0xb84c('0x11'));var hardwareService=require(_0xb84c('0x12'));var logger=require(_0xb84c('0x13'))(_0xb84c('0x14'));var utils=require('../../config/utils');var config=require(_0xb84c('0x15'));var db=require(_0xb84c('0x16'))['db'];function respondWithStatusCode(_0x58ca6f,_0x5dce14){_0x5dce14=_0x5dce14||0xcc;return function(_0x5c6ba2){if(_0x5c6ba2){return _0x58ca6f['sendStatus'](_0x5dce14);}return _0x58ca6f[_0xb84c('0x17')](_0x5dce14)[_0xb84c('0x18')]();};}function respondWithResult(_0x55c1f4,_0x31a9ed){_0x31a9ed=_0x31a9ed||0xc8;return function(_0x364d12){if(_0x364d12){return _0x55c1f4[_0xb84c('0x17')](_0x31a9ed)[_0xb84c('0x19')](_0x364d12);}};}function respondWithFilteredResult(_0x273ed9,_0x52ea8e){return function(_0x14649c){if(_0x14649c){var _0x56b784=_0x14649c[_0xb84c('0x1a')],_0x3d31ea=_0x52ea8e[_0xb84c('0x1b')],_0x3dbf0f=_0x52ea8e[_0xb84c('0x1b')]+_0x52ea8e['limit'],_0x569382;if(_0x3dbf0f>=_0x56b784){_0x3dbf0f=_0x56b784;_0x569382=0xc8;}else{_0x569382=0xce;}_0x273ed9[_0xb84c('0x17')](_0x569382);return _0x273ed9[_0xb84c('0x1c')](_0xb84c('0x1d'),_0x3d31ea+'-'+_0x3dbf0f+'/'+_0x56b784)[_0xb84c('0x19')](_0x14649c);}return null;};}function patchUpdates(_0x2733bb){return function(_0x5da1f7){try{jsonpatch[_0xb84c('0x1e')](_0x5da1f7,_0x2733bb,!![]);}catch(_0x3bd05b){return BPromise[_0xb84c('0x1f')](_0x3bd05b);}return _0x5da1f7[_0xb84c('0x20')]();};}function saveUpdates(_0x1886ef,_0x104d47){return function(_0x2e196b){if(_0x2e196b){return _0x2e196b[_0xb84c('0x21')](_0x1886ef)['then'](function(_0x481b9f){return _0x481b9f;});}return null;};}function removeEntity(_0x3cae44,_0x4b24e0){return function(_0x64e513){if(_0x64e513){return _0x64e513['destroy']()[_0xb84c('0x22')](function(){_0x3cae44[_0xb84c('0x17')](0xcc)[_0xb84c('0x18')]();});}};}function handleEntityNotFound(_0x2c17ef,_0x2af036){return function(_0xbbe792){if(!_0xbbe792){_0x2c17ef[_0xb84c('0x23')](0x194);}return _0xbbe792;};}function handleError(_0x5e60a2,_0x5a79cc){_0x5a79cc=_0x5a79cc||0x1f4;return function(_0x39fea7){logger['error'](_0x39fea7[_0xb84c('0x24')]);if(_0x39fea7['name']){delete _0x39fea7[_0xb84c('0x25')];}_0x5e60a2[_0xb84c('0x17')](_0x5a79cc)[_0xb84c('0x26')](_0x39fea7);};}exports[_0xb84c('0x27')]=function(_0x568ff7,_0x5d9e9a){var _0x4225a2={},_0x4c07f5={},_0x1577f8={'count':0x0,'rows':[]};var _0x1afe40=_[_0xb84c('0x28')](db['Automation'][_0xb84c('0x29')],function(_0x2afbc8){return{'name':_0x2afbc8[_0xb84c('0x2a')],'type':_0x2afbc8[_0xb84c('0x2b')][_0xb84c('0x2c')]};});_0x4c07f5[_0xb84c('0x2d')]=_[_0xb84c('0x28')](_0x1afe40,'name');_0x4c07f5[_0xb84c('0x2e')]=_[_0xb84c('0x2f')](_0x568ff7['query']);_0x4c07f5[_0xb84c('0x30')]=_[_0xb84c('0x31')](_0x4c07f5[_0xb84c('0x2d')],_0x4c07f5['query']);_0x4225a2[_0xb84c('0x32')]=_[_0xb84c('0x31')](_0x4c07f5[_0xb84c('0x2d')],qs[_0xb84c('0x33')](_0x568ff7['query'][_0xb84c('0x33')]));_0x4225a2[_0xb84c('0x32')]=_0x4225a2[_0xb84c('0x32')][_0xb84c('0x34')]?_0x4225a2['attributes']:_0x4c07f5['model'];if(!_0x568ff7[_0xb84c('0x2e')]['hasOwnProperty']('nolimit')){_0x4225a2[_0xb84c('0x35')]=qs[_0xb84c('0x35')](_0x568ff7[_0xb84c('0x2e')][_0xb84c('0x35')]);_0x4225a2['offset']=qs[_0xb84c('0x1b')](_0x568ff7['query'][_0xb84c('0x1b')]);}_0x4225a2['order']=qs[_0xb84c('0x36')](_0x568ff7['query'][_0xb84c('0x36')]);_0x4225a2[_0xb84c('0x37')]=qs[_0xb84c('0x30')](_[_0xb84c('0x38')](_0x568ff7[_0xb84c('0x2e')],_0x4c07f5[_0xb84c('0x30')]));if(_0x568ff7[_0xb84c('0x2e')]['filter']){_0x4225a2[_0xb84c('0x37')]=_[_0xb84c('0x39')](_0x4225a2[_0xb84c('0x37')],{'$or':_['map'](_0x1afe40,function(_0x2d20f2){if(_0x2d20f2[_0xb84c('0x2b')]!==_0xb84c('0x3a')){var _0x1b727a={};_0x1b727a[_0x2d20f2['name']]={'$like':'%'+_0x568ff7[_0xb84c('0x2e')][_0xb84c('0x3b')]+'%'};return _0x1b727a;}})});}_0x4225a2=_[_0xb84c('0x39')]({},_0x4225a2,_0x568ff7['options']);var _0xb085ed={'where':_0x4225a2[_0xb84c('0x37')]};return db[_0xb84c('0x3c')][_0xb84c('0x1a')](_0xb085ed)[_0xb84c('0x22')](function(_0x55393f){_0x1577f8[_0xb84c('0x1a')]=_0x55393f;if(_0x568ff7[_0xb84c('0x2e')]['includeAll']){_0x4225a2[_0xb84c('0x3d')]=[{'all':!![]}];}return db['Automation'][_0xb84c('0x3e')](_0x4225a2);})['then'](function(_0x4cbe3c){_0x1577f8['rows']=_0x4cbe3c;return _0x1577f8;})[_0xb84c('0x22')](respondWithFilteredResult(_0x5d9e9a,_0x4225a2))[_0xb84c('0x3f')](handleError(_0x5d9e9a,null));};exports[_0xb84c('0x40')]=function(_0xb68727,_0x181b93){var _0x1074f4={'raw':![],'where':{'id':_0xb68727['params']['id']}},_0x5563c4={};_0x5563c4['model']=_['keys'](db[_0xb84c('0x3c')][_0xb84c('0x29')]);_0x5563c4[_0xb84c('0x2e')]=_['keys'](_0xb68727['query']);_0x5563c4['filters']=_[_0xb84c('0x31')](_0x5563c4[_0xb84c('0x2d')],_0x5563c4[_0xb84c('0x2e')]);_0x1074f4[_0xb84c('0x32')]=_[_0xb84c('0x31')](_0x5563c4['model'],qs['fields'](_0xb68727[_0xb84c('0x2e')]['fields']));_0x1074f4[_0xb84c('0x32')]=_0x1074f4[_0xb84c('0x32')][_0xb84c('0x34')]?_0x1074f4[_0xb84c('0x32')]:_0x5563c4['model'];if(_0xb68727[_0xb84c('0x2e')][_0xb84c('0x41')]){_0x1074f4[_0xb84c('0x3d')]=[{'all':!![]}];}_0x1074f4=_['merge']({},_0x1074f4,_0xb68727[_0xb84c('0x42')]);return db['Automation'][_0xb84c('0x43')](_0x1074f4)['then'](handleEntityNotFound(_0x181b93,null))[_0xb84c('0x22')](respondWithResult(_0x181b93,null))[_0xb84c('0x3f')](handleError(_0x181b93,null));};exports[_0xb84c('0x44')]=function(_0x465646,_0x4f9d57){return db['Automation']['create'](_0x465646['body'],{})[_0xb84c('0x22')](respondWithResult(_0x4f9d57,0xc9))[_0xb84c('0x3f')](handleError(_0x4f9d57,null));};exports[_0xb84c('0x21')]=function(_0x38a97e,_0x4b48b5){if(_0x38a97e[_0xb84c('0x45')]['id']){delete _0x38a97e[_0xb84c('0x45')]['id'];}return db['Automation'][_0xb84c('0x43')]({'where':{'id':_0x38a97e[_0xb84c('0x46')]['id']}})[_0xb84c('0x22')](handleEntityNotFound(_0x4b48b5,null))[_0xb84c('0x22')](saveUpdates(_0x38a97e[_0xb84c('0x45')],null))['then'](respondWithResult(_0x4b48b5,null))[_0xb84c('0x3f')](handleError(_0x4b48b5,null));};exports[_0xb84c('0x47')]=function(_0xa10952,_0x8a5751){return db[_0xb84c('0x3c')][_0xb84c('0x43')]({'where':{'id':_0xa10952['params']['id']}})['then'](handleEntityNotFound(_0x8a5751,null))['then'](removeEntity(_0x8a5751,null))[_0xb84c('0x3f')](handleError(_0x8a5751,null));};exports[_0xb84c('0x48')]=function(_0x597134,_0x19279a,_0x563a0d){return db['Condition'][_0xb84c('0x43')]({'where':{'id':_0x597134[_0xb84c('0x46')]['id']}})['then'](handleEntityNotFound(_0x19279a,null))[_0xb84c('0x22')](function(_0x4645ed){if(_0x4645ed){return _0x4645ed[_0xb84c('0x48')](_0x597134[_0xb84c('0x45')][_0xb84c('0x49')],_[_0xb84c('0x4a')](_0x597134[_0xb84c('0x45')],[_0xb84c('0x49'),'id'])||{});}})[_0xb84c('0x22')](respondWithResult(_0x19279a,null))[_0xb84c('0x3f')](handleError(_0x19279a,null));};exports[_0xb84c('0x4b')]=function(_0x3a6e07,_0x48a3f0,_0x49e642){var _0x1bc503={};var _0x173623={};var _0x9535bf;var _0x362120;return db[_0xb84c('0x3c')][_0xb84c('0x4c')]({'where':{'id':_0x3a6e07[_0xb84c('0x46')]['id']}})['then'](handleEntityNotFound(_0x48a3f0,null))[_0xb84c('0x22')](function(_0x4b4766){if(_0x4b4766){_0x9535bf=_0x4b4766;_0x173623['model']=_[_0xb84c('0x2f')](db[_0xb84c('0x4d')]['rawAttributes']);_0x173623[_0xb84c('0x2e')]=_[_0xb84c('0x2f')](_0x3a6e07['query']);_0x173623[_0xb84c('0x30')]=_[_0xb84c('0x31')](_0x173623[_0xb84c('0x2d')],_0x173623[_0xb84c('0x2e')]);_0x1bc503[_0xb84c('0x32')]=_['intersection'](_0x173623[_0xb84c('0x2d')],qs[_0xb84c('0x33')](_0x3a6e07[_0xb84c('0x2e')][_0xb84c('0x33')]));_0x1bc503[_0xb84c('0x32')]=_0x1bc503[_0xb84c('0x32')][_0xb84c('0x34')]?_0x1bc503['attributes']:_0x173623[_0xb84c('0x2d')];_0x1bc503[_0xb84c('0x4e')]=qs[_0xb84c('0x36')](_0x3a6e07[_0xb84c('0x2e')]['sort']);_0x1bc503[_0xb84c('0x37')]=qs[_0xb84c('0x30')](_[_0xb84c('0x38')](_0x3a6e07[_0xb84c('0x2e')],_0x173623[_0xb84c('0x30')]));if(_0x3a6e07[_0xb84c('0x2e')][_0xb84c('0x3b')]){_0x1bc503[_0xb84c('0x37')]=_['merge'](_0x1bc503['where'],{'$or':_[_0xb84c('0x28')](_0x1bc503[_0xb84c('0x32')],function(_0x151457){var _0x24acbe={};_0x24acbe[_0x151457]={'$like':'%'+_0x3a6e07[_0xb84c('0x2e')][_0xb84c('0x3b')]+'%'};return _0x24acbe;})});}_0x1bc503=_[_0xb84c('0x39')]({},_0x1bc503,_0x3a6e07[_0xb84c('0x42')]);return _0x9535bf[_0xb84c('0x4b')](_0x1bc503);}})['then'](function(_0x2a6a18){if(_0x2a6a18){_0x362120=_0x2a6a18[_0xb84c('0x34')];if(!_0x3a6e07[_0xb84c('0x2e')][_0xb84c('0x4f')]('nolimit')){_0x1bc503['limit']=qs[_0xb84c('0x35')](_0x3a6e07[_0xb84c('0x2e')][_0xb84c('0x35')]);_0x1bc503[_0xb84c('0x1b')]=qs[_0xb84c('0x1b')](_0x3a6e07[_0xb84c('0x2e')][_0xb84c('0x1b')]);}return _0x9535bf[_0xb84c('0x4b')](_0x1bc503);}})[_0xb84c('0x22')](function(_0x3fdfe4){if(_0x3fdfe4){return _0x3fdfe4?{'count':_0x362120,'rows':_0x3fdfe4}:null;}})['then'](respondWithResult(_0x48a3f0,null))['catch'](handleError(_0x48a3f0,null));};exports[_0xb84c('0x50')]=function(_0x2c97a9,_0x5edd30,_0x19698d){return db[_0xb84c('0x51')][_0xb84c('0x43')]({'where':{'id':_0x2c97a9[_0xb84c('0x46')]['id']}})['then'](handleEntityNotFound(_0x5edd30,null))[_0xb84c('0x22')](function(_0x2fae44){if(_0x2fae44){return _0x2fae44[_0xb84c('0x50')](_0x2c97a9[_0xb84c('0x45')][_0xb84c('0x49')],_['omit'](_0x2c97a9[_0xb84c('0x45')],['ids','id'])||{});}})[_0xb84c('0x22')](respondWithResult(_0x5edd30,null))[_0xb84c('0x3f')](handleError(_0x5edd30,null));};exports[_0xb84c('0x52')]=function(_0x3046a1,_0x194ad0,_0x36eb68){var _0x200fbc={};var _0x8feda8={};var _0x4d6418;var _0x206d33;return db['Automation'][_0xb84c('0x4c')]({'where':{'id':_0x3046a1['params']['id']}})[_0xb84c('0x22')](handleEntityNotFound(_0x194ad0,null))[_0xb84c('0x22')](function(_0x5770f4){if(_0x5770f4){_0x4d6418=_0x5770f4;_0x8feda8[_0xb84c('0x2d')]=_['keys'](db[_0xb84c('0x51')]['rawAttributes']);_0x8feda8[_0xb84c('0x2e')]=_['keys'](_0x3046a1[_0xb84c('0x2e')]);_0x8feda8['filters']=_['intersection'](_0x8feda8[_0xb84c('0x2d')],_0x8feda8[_0xb84c('0x2e')]);_0x200fbc['attributes']=_[_0xb84c('0x31')](_0x8feda8[_0xb84c('0x2d')],qs['fields'](_0x3046a1[_0xb84c('0x2e')]['fields']));_0x200fbc[_0xb84c('0x32')]=_0x200fbc[_0xb84c('0x32')][_0xb84c('0x34')]?_0x200fbc[_0xb84c('0x32')]:_0x8feda8[_0xb84c('0x2d')];_0x200fbc[_0xb84c('0x4e')]=qs[_0xb84c('0x36')](_0x3046a1[_0xb84c('0x2e')][_0xb84c('0x36')]);_0x200fbc[_0xb84c('0x37')]=qs[_0xb84c('0x30')](_[_0xb84c('0x38')](_0x3046a1[_0xb84c('0x2e')],_0x8feda8[_0xb84c('0x30')]));if(_0x3046a1[_0xb84c('0x2e')][_0xb84c('0x3b')]){_0x200fbc[_0xb84c('0x37')]=_['merge'](_0x200fbc['where'],{'$or':_[_0xb84c('0x28')](_0x200fbc[_0xb84c('0x32')],function(_0x4cca55){var _0x5ca0a1={};_0x5ca0a1[_0x4cca55]={'$like':'%'+_0x3046a1[_0xb84c('0x2e')][_0xb84c('0x3b')]+'%'};return _0x5ca0a1;})});}_0x200fbc=_['merge']({},_0x200fbc,_0x3046a1[_0xb84c('0x42')]);return _0x4d6418[_0xb84c('0x52')](_0x200fbc);}})[_0xb84c('0x22')](function(_0x42f57e){if(_0x42f57e){_0x206d33=_0x42f57e[_0xb84c('0x34')];if(!_0x3046a1['query'][_0xb84c('0x4f')](_0xb84c('0x53'))){_0x200fbc[_0xb84c('0x35')]=qs[_0xb84c('0x35')](_0x3046a1['query'][_0xb84c('0x35')]);_0x200fbc[_0xb84c('0x1b')]=qs[_0xb84c('0x1b')](_0x3046a1[_0xb84c('0x2e')][_0xb84c('0x1b')]);}return _0x4d6418[_0xb84c('0x52')](_0x200fbc);}})[_0xb84c('0x22')](function(_0x26f6c1){if(_0x26f6c1){return _0x26f6c1?{'count':_0x206d33,'rows':_0x26f6c1}:null;}})[_0xb84c('0x22')](respondWithResult(_0x194ad0,null))['catch'](handleError(_0x194ad0,null));}; \ No newline at end of file +var _0x47cb=['filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','Automation','rows','show','params','rawAttributes','fields','options','find','catch','create','body','addConditions','Condition','ids','omit','getConditions','findOne','addActions','getActions','Action','html-pdf','eml-format','zip-dir','fast-json-patch','moment','util','path','to-csv','ejs','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','status','count','offset','limit','Content-Range','json','apply','save','update','then','destroy','sendStatus','error','name','send','index','map','fieldName','type','key','model','query','keys'];(function(_0x1d5663,_0x2f6a69){var _0x344a4d=function(_0x3f3e93){while(--_0x3f3e93){_0x1d5663['push'](_0x1d5663['shift']());}};_0x344a4d(++_0x2f6a69);}(_0x47cb,0x10c));var _0xb47c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x47cb[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xb47c('0x0'));var emlformat=require(_0xb47c('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xb47c('0x2'));var jsonpatch=require(_0xb47c('0x3'));var rp=require('request-promise');var moment=require(_0xb47c('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb47c('0x5'));var path=require(_0xb47c('0x6'));var sox=require('sox');var csv=require(_0xb47c('0x7'));var ejs=require(_0xb47c('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xb47c('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb47c('0xa'));var toCsv=require(_0xb47c('0x7'));var querystring=require(_0xb47c('0xb'));var Papa=require(_0xb47c('0xc'));var Redis=require(_0xb47c('0xd'));var authService=require(_0xb47c('0xe'));var qs=require(_0xb47c('0xf'));var as=require(_0xb47c('0x10'));var hardwareService=require(_0xb47c('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0xb47c('0x12'));var config=require(_0xb47c('0x13'));var db=require(_0xb47c('0x14'))['db'];function respondWithStatusCode(_0x31da44,_0x4d254b){_0x4d254b=_0x4d254b||0xcc;return function(_0xb8b040){if(_0xb8b040){return _0x31da44['sendStatus'](_0x4d254b);}return _0x31da44['status'](_0x4d254b)['end']();};}function respondWithResult(_0x4bd5bc,_0x19c452){_0x19c452=_0x19c452||0xc8;return function(_0xc0d7f2){if(_0xc0d7f2){return _0x4bd5bc[_0xb47c('0x15')](_0x19c452)['json'](_0xc0d7f2);}};}function respondWithFilteredResult(_0x1fdf3a,_0x5d08b0){return function(_0xe84be5){if(_0xe84be5){var _0x3a07f6=_0xe84be5[_0xb47c('0x16')],_0x361880=_0x5d08b0[_0xb47c('0x17')],_0x5e574a=_0x5d08b0[_0xb47c('0x17')]+_0x5d08b0[_0xb47c('0x18')],_0x253c2b;if(_0x5e574a>=_0x3a07f6){_0x5e574a=_0x3a07f6;_0x253c2b=0xc8;}else{_0x253c2b=0xce;}_0x1fdf3a['status'](_0x253c2b);return _0x1fdf3a['set'](_0xb47c('0x19'),_0x361880+'-'+_0x5e574a+'/'+_0x3a07f6)[_0xb47c('0x1a')](_0xe84be5);}return null;};}function patchUpdates(_0x25a3d7){return function(_0x3e59ce){try{jsonpatch[_0xb47c('0x1b')](_0x3e59ce,_0x25a3d7,!![]);}catch(_0x1e3a0d){return BPromise['reject'](_0x1e3a0d);}return _0x3e59ce[_0xb47c('0x1c')]();};}function saveUpdates(_0x112839,_0x24ebe8){return function(_0x2be110){if(_0x2be110){return _0x2be110[_0xb47c('0x1d')](_0x112839)[_0xb47c('0x1e')](function(_0x55323f){return _0x55323f;});}return null;};}function removeEntity(_0x1cb8a1,_0x3fd074){return function(_0x47cc76){if(_0x47cc76){return _0x47cc76[_0xb47c('0x1f')]()[_0xb47c('0x1e')](function(){_0x1cb8a1[_0xb47c('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1262b3,_0x31d1e2){return function(_0x4c1756){if(!_0x4c1756){_0x1262b3[_0xb47c('0x20')](0x194);}return _0x4c1756;};}function handleError(_0x25035d,_0x36b04d){_0x36b04d=_0x36b04d||0x1f4;return function(_0x48f289){logger[_0xb47c('0x21')](_0x48f289['stack']);if(_0x48f289['name']){delete _0x48f289[_0xb47c('0x22')];}_0x25035d[_0xb47c('0x15')](_0x36b04d)[_0xb47c('0x23')](_0x48f289);};}exports[_0xb47c('0x24')]=function(_0x367d7d,_0x5f3a0f){var _0x1cd991={},_0x46c10f={},_0x1cb6aa={'count':0x0,'rows':[]};var _0x3a92e5=_[_0xb47c('0x25')](db['Automation']['rawAttributes'],function(_0x53fe2e){return{'name':_0x53fe2e[_0xb47c('0x26')],'type':_0x53fe2e[_0xb47c('0x27')][_0xb47c('0x28')]};});_0x46c10f[_0xb47c('0x29')]=_[_0xb47c('0x25')](_0x3a92e5,_0xb47c('0x22'));_0x46c10f[_0xb47c('0x2a')]=_[_0xb47c('0x2b')](_0x367d7d[_0xb47c('0x2a')]);_0x46c10f[_0xb47c('0x2c')]=_[_0xb47c('0x2d')](_0x46c10f[_0xb47c('0x29')],_0x46c10f['query']);_0x1cd991[_0xb47c('0x2e')]=_[_0xb47c('0x2d')](_0x46c10f[_0xb47c('0x29')],qs['fields'](_0x367d7d['query']['fields']));_0x1cd991['attributes']=_0x1cd991[_0xb47c('0x2e')][_0xb47c('0x2f')]?_0x1cd991[_0xb47c('0x2e')]:_0x46c10f[_0xb47c('0x29')];if(!_0x367d7d['query'][_0xb47c('0x30')](_0xb47c('0x31'))){_0x1cd991['limit']=qs[_0xb47c('0x18')](_0x367d7d[_0xb47c('0x2a')][_0xb47c('0x18')]);_0x1cd991[_0xb47c('0x17')]=qs[_0xb47c('0x17')](_0x367d7d[_0xb47c('0x2a')]['offset']);}_0x1cd991[_0xb47c('0x32')]=qs[_0xb47c('0x33')](_0x367d7d[_0xb47c('0x2a')]['sort']);_0x1cd991[_0xb47c('0x34')]=qs['filters'](_[_0xb47c('0x35')](_0x367d7d[_0xb47c('0x2a')],_0x46c10f[_0xb47c('0x2c')]));if(_0x367d7d[_0xb47c('0x2a')][_0xb47c('0x36')]){_0x1cd991[_0xb47c('0x34')]=_['merge'](_0x1cd991[_0xb47c('0x34')],{'$or':_[_0xb47c('0x25')](_0x3a92e5,function(_0x3ca2ad){if(_0x3ca2ad[_0xb47c('0x27')]!==_0xb47c('0x37')){var _0xf46f08={};_0xf46f08[_0x3ca2ad[_0xb47c('0x22')]]={'$like':'%'+_0x367d7d[_0xb47c('0x2a')][_0xb47c('0x36')]+'%'};return _0xf46f08;}})});}_0x1cd991=_[_0xb47c('0x38')]({},_0x1cd991,_0x367d7d['options']);var _0x269f34={'where':_0x1cd991['where']};return db['Automation'][_0xb47c('0x16')](_0x269f34)[_0xb47c('0x1e')](function(_0xe2ecdc){_0x1cb6aa['count']=_0xe2ecdc;if(_0x367d7d['query'][_0xb47c('0x39')]){_0x1cd991['include']=[{'all':!![]}];}return db[_0xb47c('0x3a')]['findAll'](_0x1cd991);})['then'](function(_0x54c0e2){_0x1cb6aa[_0xb47c('0x3b')]=_0x54c0e2;return _0x1cb6aa;})[_0xb47c('0x1e')](respondWithFilteredResult(_0x5f3a0f,_0x1cd991))['catch'](handleError(_0x5f3a0f,null));};exports[_0xb47c('0x3c')]=function(_0x4befdf,_0x3b5546){var _0x1d7b59={'raw':![],'where':{'id':_0x4befdf[_0xb47c('0x3d')]['id']}},_0x1b4c7b={};_0x1b4c7b[_0xb47c('0x29')]=_['keys'](db[_0xb47c('0x3a')][_0xb47c('0x3e')]);_0x1b4c7b[_0xb47c('0x2a')]=_['keys'](_0x4befdf['query']);_0x1b4c7b[_0xb47c('0x2c')]=_[_0xb47c('0x2d')](_0x1b4c7b[_0xb47c('0x29')],_0x1b4c7b[_0xb47c('0x2a')]);_0x1d7b59[_0xb47c('0x2e')]=_['intersection'](_0x1b4c7b['model'],qs[_0xb47c('0x3f')](_0x4befdf[_0xb47c('0x2a')][_0xb47c('0x3f')]));_0x1d7b59['attributes']=_0x1d7b59[_0xb47c('0x2e')]['length']?_0x1d7b59[_0xb47c('0x2e')]:_0x1b4c7b['model'];if(_0x4befdf['query'][_0xb47c('0x39')]){_0x1d7b59['include']=[{'all':!![]}];}_0x1d7b59=_[_0xb47c('0x38')]({},_0x1d7b59,_0x4befdf[_0xb47c('0x40')]);return db[_0xb47c('0x3a')][_0xb47c('0x41')](_0x1d7b59)[_0xb47c('0x1e')](handleEntityNotFound(_0x3b5546,null))[_0xb47c('0x1e')](respondWithResult(_0x3b5546,null))[_0xb47c('0x42')](handleError(_0x3b5546,null));};exports[_0xb47c('0x43')]=function(_0x4ec42d,_0x3f1f20){return db[_0xb47c('0x3a')][_0xb47c('0x43')](_0x4ec42d['body'],{})[_0xb47c('0x1e')](respondWithResult(_0x3f1f20,0xc9))[_0xb47c('0x42')](handleError(_0x3f1f20,null));};exports[_0xb47c('0x1d')]=function(_0x464931,_0x2ad6fe){if(_0x464931[_0xb47c('0x44')]['id']){delete _0x464931[_0xb47c('0x44')]['id'];}return db[_0xb47c('0x3a')][_0xb47c('0x41')]({'where':{'id':_0x464931[_0xb47c('0x3d')]['id']}})[_0xb47c('0x1e')](handleEntityNotFound(_0x2ad6fe,null))[_0xb47c('0x1e')](saveUpdates(_0x464931[_0xb47c('0x44')],null))[_0xb47c('0x1e')](respondWithResult(_0x2ad6fe,null))[_0xb47c('0x42')](handleError(_0x2ad6fe,null));};exports[_0xb47c('0x1f')]=function(_0x5d5326,_0xcb4ec8){return db['Automation']['find']({'where':{'id':_0x5d5326[_0xb47c('0x3d')]['id']}})['then'](handleEntityNotFound(_0xcb4ec8,null))['then'](removeEntity(_0xcb4ec8,null))[_0xb47c('0x42')](handleError(_0xcb4ec8,null));};exports[_0xb47c('0x45')]=function(_0x5c2e4f,_0x1e8680,_0x55c500){return db[_0xb47c('0x46')][_0xb47c('0x41')]({'where':{'id':_0x5c2e4f[_0xb47c('0x3d')]['id']}})[_0xb47c('0x1e')](handleEntityNotFound(_0x1e8680,null))[_0xb47c('0x1e')](function(_0x1609b6){if(_0x1609b6){return _0x1609b6['addConditions'](_0x5c2e4f[_0xb47c('0x44')][_0xb47c('0x47')],_[_0xb47c('0x48')](_0x5c2e4f['body'],[_0xb47c('0x47'),'id'])||{});}})[_0xb47c('0x1e')](respondWithResult(_0x1e8680,null))[_0xb47c('0x42')](handleError(_0x1e8680,null));};exports[_0xb47c('0x49')]=function(_0x2f5566,_0x4c8eb7,_0xa9e450){var _0x1131e5={};var _0x167820={};var _0x384957;var _0x40c86b;return db[_0xb47c('0x3a')][_0xb47c('0x4a')]({'where':{'id':_0x2f5566[_0xb47c('0x3d')]['id']}})[_0xb47c('0x1e')](handleEntityNotFound(_0x4c8eb7,null))['then'](function(_0x589ec7){if(_0x589ec7){_0x384957=_0x589ec7;_0x167820[_0xb47c('0x29')]=_[_0xb47c('0x2b')](db[_0xb47c('0x46')][_0xb47c('0x3e')]);_0x167820[_0xb47c('0x2a')]=_['keys'](_0x2f5566[_0xb47c('0x2a')]);_0x167820[_0xb47c('0x2c')]=_[_0xb47c('0x2d')](_0x167820[_0xb47c('0x29')],_0x167820[_0xb47c('0x2a')]);_0x1131e5['attributes']=_[_0xb47c('0x2d')](_0x167820['model'],qs[_0xb47c('0x3f')](_0x2f5566[_0xb47c('0x2a')]['fields']));_0x1131e5[_0xb47c('0x2e')]=_0x1131e5['attributes'][_0xb47c('0x2f')]?_0x1131e5[_0xb47c('0x2e')]:_0x167820[_0xb47c('0x29')];_0x1131e5[_0xb47c('0x32')]=qs[_0xb47c('0x33')](_0x2f5566[_0xb47c('0x2a')]['sort']);_0x1131e5['where']=qs[_0xb47c('0x2c')](_[_0xb47c('0x35')](_0x2f5566['query'],_0x167820[_0xb47c('0x2c')]));if(_0x2f5566[_0xb47c('0x2a')][_0xb47c('0x36')]){_0x1131e5[_0xb47c('0x34')]=_[_0xb47c('0x38')](_0x1131e5['where'],{'$or':_[_0xb47c('0x25')](_0x1131e5[_0xb47c('0x2e')],function(_0x55f3cd){var _0x3d8b3f={};_0x3d8b3f[_0x55f3cd]={'$like':'%'+_0x2f5566['query'][_0xb47c('0x36')]+'%'};return _0x3d8b3f;})});}_0x1131e5=_['merge']({},_0x1131e5,_0x2f5566['options']);return _0x384957[_0xb47c('0x49')](_0x1131e5);}})['then'](function(_0x52a73c){if(_0x52a73c){_0x40c86b=_0x52a73c['length'];if(!_0x2f5566[_0xb47c('0x2a')][_0xb47c('0x30')](_0xb47c('0x31'))){_0x1131e5['limit']=qs['limit'](_0x2f5566[_0xb47c('0x2a')][_0xb47c('0x18')]);_0x1131e5[_0xb47c('0x17')]=qs[_0xb47c('0x17')](_0x2f5566['query']['offset']);}return _0x384957[_0xb47c('0x49')](_0x1131e5);}})[_0xb47c('0x1e')](function(_0x396478){if(_0x396478){return _0x396478?{'count':_0x40c86b,'rows':_0x396478}:null;}})[_0xb47c('0x1e')](respondWithResult(_0x4c8eb7,null))[_0xb47c('0x42')](handleError(_0x4c8eb7,null));};exports[_0xb47c('0x4b')]=function(_0x52c727,_0x5c6690,_0x5695ba){return db['Action']['find']({'where':{'id':_0x52c727[_0xb47c('0x3d')]['id']}})[_0xb47c('0x1e')](handleEntityNotFound(_0x5c6690,null))['then'](function(_0x2e1e9a){if(_0x2e1e9a){return _0x2e1e9a['addActions'](_0x52c727['body'][_0xb47c('0x47')],_['omit'](_0x52c727['body'],['ids','id'])||{});}})[_0xb47c('0x1e')](respondWithResult(_0x5c6690,null))[_0xb47c('0x42')](handleError(_0x5c6690,null));};exports[_0xb47c('0x4c')]=function(_0x4627f8,_0x38bb3b,_0x4f81e3){var _0x591670={};var _0x298761={};var _0x4160be;var _0x22a040;return db[_0xb47c('0x3a')][_0xb47c('0x4a')]({'where':{'id':_0x4627f8[_0xb47c('0x3d')]['id']}})[_0xb47c('0x1e')](handleEntityNotFound(_0x38bb3b,null))[_0xb47c('0x1e')](function(_0x31bb36){if(_0x31bb36){_0x4160be=_0x31bb36;_0x298761['model']=_[_0xb47c('0x2b')](db[_0xb47c('0x4d')][_0xb47c('0x3e')]);_0x298761[_0xb47c('0x2a')]=_[_0xb47c('0x2b')](_0x4627f8['query']);_0x298761[_0xb47c('0x2c')]=_[_0xb47c('0x2d')](_0x298761['model'],_0x298761[_0xb47c('0x2a')]);_0x591670[_0xb47c('0x2e')]=_[_0xb47c('0x2d')](_0x298761[_0xb47c('0x29')],qs['fields'](_0x4627f8[_0xb47c('0x2a')][_0xb47c('0x3f')]));_0x591670[_0xb47c('0x2e')]=_0x591670[_0xb47c('0x2e')]['length']?_0x591670[_0xb47c('0x2e')]:_0x298761['model'];_0x591670[_0xb47c('0x32')]=qs[_0xb47c('0x33')](_0x4627f8[_0xb47c('0x2a')][_0xb47c('0x33')]);_0x591670[_0xb47c('0x34')]=qs[_0xb47c('0x2c')](_[_0xb47c('0x35')](_0x4627f8[_0xb47c('0x2a')],_0x298761[_0xb47c('0x2c')]));if(_0x4627f8[_0xb47c('0x2a')]['filter']){_0x591670[_0xb47c('0x34')]=_[_0xb47c('0x38')](_0x591670[_0xb47c('0x34')],{'$or':_[_0xb47c('0x25')](_0x591670[_0xb47c('0x2e')],function(_0x329622){var _0x212fd0={};_0x212fd0[_0x329622]={'$like':'%'+_0x4627f8[_0xb47c('0x2a')][_0xb47c('0x36')]+'%'};return _0x212fd0;})});}_0x591670=_[_0xb47c('0x38')]({},_0x591670,_0x4627f8[_0xb47c('0x40')]);return _0x4160be[_0xb47c('0x4c')](_0x591670);}})[_0xb47c('0x1e')](function(_0x241540){if(_0x241540){_0x22a040=_0x241540[_0xb47c('0x2f')];if(!_0x4627f8[_0xb47c('0x2a')][_0xb47c('0x30')](_0xb47c('0x31'))){_0x591670[_0xb47c('0x18')]=qs['limit'](_0x4627f8[_0xb47c('0x2a')][_0xb47c('0x18')]);_0x591670[_0xb47c('0x17')]=qs[_0xb47c('0x17')](_0x4627f8[_0xb47c('0x2a')]['offset']);}return _0x4160be[_0xb47c('0x4c')](_0x591670);}})[_0xb47c('0x1e')](function(_0x470183){if(_0x470183){return _0x470183?{'count':_0x22a040,'rows':_0x470183}:null;}})['then'](respondWithResult(_0x38bb3b,null))['catch'](handleError(_0x38bb3b,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 59c55f2..82b59c1 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 _0xa4ec=['./automation.attributes','exports','tools_automations','lodash','../../config/logger','api','moment','bluebird','request-promise','../../config/environment'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0xa4ec,0x193));var _0xca4e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa4ec[_0x5783f4];return _0x28e380;};'use strict';var _=require(_0xca4e('0x0'));var util=require('util');var logger=require(_0xca4e('0x1'))(_0xca4e('0x2'));var moment=require(_0xca4e('0x3'));var BPromise=require(_0xca4e('0x4'));var rp=require(_0xca4e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xca4e('0x6'));var attributes=require(_0xca4e('0x7'));module[_0xca4e('0x8')]=function(_0x5887c7,_0x38a60c){return _0x5887c7['define']('Automation',attributes,{'tableName':_0xca4e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5a95=['path','rimraf','./automation.attributes','exports','define','Automation','tools_automations','util','../../config/logger','api','bluebird','request-promise'];(function(_0x433c85,_0x39c8c8){var _0x3cc613=function(_0x43205d){while(--_0x43205d){_0x433c85['push'](_0x433c85['shift']());}};_0x3cc613(++_0x39c8c8);}(_0x5a95,0x8b));var _0x55a9=function(_0x4cb533,_0x464209){_0x4cb533=_0x4cb533-0x0;var _0x4ffacc=_0x5a95[_0x4cb533];return _0x4ffacc;};'use strict';var _=require('lodash');var util=require(_0x55a9('0x0'));var logger=require(_0x55a9('0x1'))(_0x55a9('0x2'));var moment=require('moment');var BPromise=require(_0x55a9('0x3'));var rp=require(_0x55a9('0x4'));var fs=require('fs');var path=require(_0x55a9('0x5'));var rimraf=require(_0x55a9('0x6'));var config=require('../../config/environment');var attributes=require(_0x55a9('0x7'));module[_0x55a9('0x8')]=function(_0x1ee87a,_0x19747a){return _0x1ee87a[_0x55a9('0x9')](_0x55a9('0xa'),attributes,{'tableName':_0x55a9('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 bcab2bb..27f2b50 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 _0x1401=['util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','then','info','Automation,\x20%s,\x20%s,\x20%s','error','Automation,\x20%s,\x20%s','message','request\x20sent','result','catch'];(function(_0x31bcbe,_0x4ce65b){var _0x485320=function(_0x1cb6d7){while(--_0x1cb6d7){_0x31bcbe['push'](_0x31bcbe['shift']());}};_0x485320(++_0x4ce65b);}(_0x1401,0x144));var _0x1140=function(_0x4394f7,_0x43ee7b){_0x4394f7=_0x4394f7-0x0;var _0x340a66=_0x1401[_0x4394f7];return _0x340a66;};'use strict';var _=require('lodash');var util=require(_0x1140('0x0'));var moment=require(_0x1140('0x1'));var BPromise=require('bluebird');var rs=require(_0x1140('0x2'));var fs=require('fs');var Redis=require(_0x1140('0x3'));var db=require(_0x1140('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1140('0x5'))(_0x1140('0x6'));var config=require(_0x1140('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1140('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x508eb2,_0x4b2a65,_0x230ed5){return new BPromise(function(_0x36dcf8,_0x5a87ed){return client['request'](_0x508eb2,_0x230ed5)[_0x1140('0x9')](function(_0x4fc50a){logger[_0x1140('0xa')]('Automation,\x20%s,\x20%s',_0x4b2a65,'request\x20sent');logger['debug'](_0x1140('0xb'),_0x4b2a65,'request\x20sent',JSON['stringify'](_0x4fc50a));if(_0x4fc50a[_0x1140('0xc')]){if(_0x4fc50a[_0x1140('0xc')]['code']===0x1f4){logger[_0x1140('0xc')](_0x1140('0xd'),_0x4b2a65,_0x4fc50a[_0x1140('0xc')][_0x1140('0xe')]);return _0x5a87ed(_0x4fc50a[_0x1140('0xc')]['message']);}logger[_0x1140('0xc')](_0x1140('0xd'),_0x4b2a65,_0x4fc50a['error'][_0x1140('0xe')]);return _0x36dcf8(_0x4fc50a[_0x1140('0xc')]['message']);}else{logger['info'](_0x1140('0xd'),_0x4b2a65,_0x1140('0xf'));_0x36dcf8(_0x4fc50a[_0x1140('0x10')][_0x1140('0xe')]);}})[_0x1140('0x11')](function(_0x43cd7f){logger[_0x1140('0xc')](_0x1140('0xd'),_0x4b2a65,_0x43cd7f);_0x5a87ed(_0x43cd7f);});});} \ No newline at end of file +var _0x2c74=['request','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x4c520e,_0x27c8f0){var _0x16593b=function(_0xc5b2d9){while(--_0xc5b2d9){_0x4c520e['push'](_0x4c520e['shift']());}};_0x16593b(++_0x27c8f0);}(_0x2c74,0x164));var _0x42c7=function(_0x44176c,_0x150427){_0x44176c=_0x44176c-0x0;var _0x15f4bb=_0x2c74[_0x44176c];return _0x15f4bb;};'use strict';var _=require(_0x42c7('0x0'));var util=require(_0x42c7('0x1'));var moment=require(_0x42c7('0x2'));var BPromise=require(_0x42c7('0x3'));var rs=require(_0x42c7('0x4'));var fs=require('fs');var Redis=require(_0x42c7('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x42c7('0x6'));var logger=require(_0x42c7('0x7'))(_0x42c7('0x8'));var config=require(_0x42c7('0x9'));var jayson=require(_0x42c7('0xa'));var client=jayson['client'][_0x42c7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1366cd,_0x53d9fa,_0x298689){return new BPromise(function(_0x1c5ed4,_0x57091d){return client[_0x42c7('0xc')](_0x1366cd,_0x298689)['then'](function(_0x1d527e){logger[_0x42c7('0xd')](_0x42c7('0xe'),_0x53d9fa,_0x42c7('0xf'));logger[_0x42c7('0x10')](_0x42c7('0x11'),_0x53d9fa,_0x42c7('0xf'),JSON['stringify'](_0x1d527e));if(_0x1d527e['error']){if(_0x1d527e['error'][_0x42c7('0x12')]===0x1f4){logger[_0x42c7('0x13')]('Automation,\x20%s,\x20%s',_0x53d9fa,_0x1d527e[_0x42c7('0x13')][_0x42c7('0x14')]);return _0x57091d(_0x1d527e[_0x42c7('0x13')][_0x42c7('0x14')]);}logger[_0x42c7('0x13')](_0x42c7('0xe'),_0x53d9fa,_0x1d527e['error'][_0x42c7('0x14')]);return _0x1c5ed4(_0x1d527e[_0x42c7('0x13')][_0x42c7('0x14')]);}else{logger[_0x42c7('0xd')]('Automation,\x20%s,\x20%s',_0x53d9fa,_0x42c7('0xf'));_0x1c5ed4(_0x1d527e[_0x42c7('0x15')][_0x42c7('0x14')]);}})[_0x42c7('0x16')](function(_0x3adc73){logger[_0x42c7('0x13')](_0x42c7('0xe'),_0x53d9fa,_0x3adc73);_0x57091d(_0x3adc73);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 796c6be..ca23e93 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 _0xcc04=['/:id','show','get','getConditions','post','create','/:id/conditions','addConditions','/:id/actions','addActions','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','isAuthenticated','index'];(function(_0x2dd9b6,_0x1c016f){var _0x3e9fd8=function(_0x5b18c8){while(--_0x5b18c8){_0x2dd9b6['push'](_0x2dd9b6['shift']());}};_0x3e9fd8(++_0x1c016f);}(_0xcc04,0x1c8));var _0x4cc0=function(_0x1cae00,_0x4589e4){_0x1cae00=_0x1cae00-0x0;var _0x391291=_0xcc04[_0x1cae00];return _0x391291;};'use strict';var multer=require(_0x4cc0('0x0'));var util=require(_0x4cc0('0x1'));var path=require(_0x4cc0('0x2'));var timeout=require(_0x4cc0('0x3'));var express=require(_0x4cc0('0x4'));var router=express[_0x4cc0('0x5')]();var auth=require(_0x4cc0('0x6'));var interaction=require(_0x4cc0('0x7'));var config=require(_0x4cc0('0x8'));var controller=require(_0x4cc0('0x9'));router['get']('/',auth[_0x4cc0('0xa')](),controller[_0x4cc0('0xb')]);router['get'](_0x4cc0('0xc'),auth[_0x4cc0('0xa')](),controller[_0x4cc0('0xd')]);router[_0x4cc0('0xe')]('/:id/conditions',auth[_0x4cc0('0xa')](),controller[_0x4cc0('0xf')]);router[_0x4cc0('0xe')]('/:id/actions',auth[_0x4cc0('0xa')](),controller['getActions']);router[_0x4cc0('0x10')]('/',auth['isAuthenticated'](),controller[_0x4cc0('0x11')]);router[_0x4cc0('0x10')](_0x4cc0('0x12'),auth[_0x4cc0('0xa')](),controller[_0x4cc0('0x13')]);router[_0x4cc0('0x10')](_0x4cc0('0x14'),auth[_0x4cc0('0xa')](),controller[_0x4cc0('0x15')]);router[_0x4cc0('0x16')](_0x4cc0('0xc'),auth[_0x4cc0('0xa')](),controller[_0x4cc0('0x17')]);router['delete'](_0x4cc0('0xc'),auth[_0x4cc0('0xa')](),controller[_0x4cc0('0x18')]);module[_0x4cc0('0x19')]=router; \ No newline at end of file +var _0x4704=['/:id','show','get','/:id/conditions','getConditions','post','addConditions','/:id/actions','update','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./automation.controller','isAuthenticated','index'];(function(_0x2c33a6,_0x3b0f2f){var _0x49d87a=function(_0x4e4094){while(--_0x4e4094){_0x2c33a6['push'](_0x2c33a6['shift']());}};_0x49d87a(++_0x3b0f2f);}(_0x4704,0x19a));var _0x4470=function(_0x147e9f,_0x57b3cb){_0x147e9f=_0x147e9f-0x0;var _0x321585=_0x4704[_0x147e9f];return _0x321585;};'use strict';var multer=require(_0x4470('0x0'));var util=require('util');var path=require(_0x4470('0x1'));var timeout=require(_0x4470('0x2'));var express=require(_0x4470('0x3'));var router=express[_0x4470('0x4')]();var auth=require(_0x4470('0x5'));var interaction=require(_0x4470('0x6'));var config=require('../../config/environment');var controller=require(_0x4470('0x7'));router['get']('/',auth[_0x4470('0x8')](),controller[_0x4470('0x9')]);router['get'](_0x4470('0xa'),auth['isAuthenticated'](),controller[_0x4470('0xb')]);router[_0x4470('0xc')](_0x4470('0xd'),auth[_0x4470('0x8')](),controller[_0x4470('0xe')]);router[_0x4470('0xc')]('/:id/actions',auth[_0x4470('0x8')](),controller['getActions']);router['post']('/',auth[_0x4470('0x8')](),controller['create']);router[_0x4470('0xf')](_0x4470('0xd'),auth[_0x4470('0x8')](),controller[_0x4470('0x10')]);router['post'](_0x4470('0x11'),auth['isAuthenticated'](),controller['addActions']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x4470('0x12')]);router[_0x4470('0x13')](_0x4470('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x4470('0x14')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index b910c87..4991880 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 _0x2330=['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)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','name','ENUM','ivr','STRING','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\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\x20Between\x20Words\x20Silence','#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)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)'];(function(_0x1391a8,_0x4e2f7f){var _0x1e3519=function(_0x1ad406){while(--_0x1ad406){_0x1391a8['push'](_0x1391a8['shift']());}};_0x1e3519(++_0x4e2f7f);}(_0x2330,0x1cc));var _0x0233=function(_0x1440ce,_0x136aee){_0x1440ce=_0x1440ce-0x0;var _0x389c35=_0x2330[_0x1440ce];return _0x389c35;};'use strict';var Sequelize=require(_0x0233('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x0233('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x0233('0x2')](_0x0233('0x3')),'allowNull':![],'defaultValue':_0x0233('0x3')},'description':{'type':Sequelize[_0x0233('0x4')]},'active':{'type':Sequelize[_0x0233('0x5')],'defaultValue':0x0,'comment':_0x0233('0x6')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x0233('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x0233('0x4')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x0233('0x4')]},'dialOriginateTimeout':{'type':Sequelize[_0x0233('0x8')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0233('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x0233('0x8')](0x3)[_0x0233('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0233('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x0233('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0233('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0x0233('0x8')](0x3)[_0x0233('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0233('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0x0233('0x8')](0x5)[_0x0233('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0233('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x0233('0x8')](0x3)[_0x0233('0x7')],'defaultValue':0x3,'comment':_0x0233('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0233('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0233('0xf')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0233('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x0233('0x10')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x0233('0x11')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x0233('0x12'),'never',_0x0233('0x13')),'defaultValue':_0x0233('0x12')},'dialAMDActive':{'type':Sequelize[_0x0233('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x0233('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x0233('0x14')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x0233('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x0233('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x0233('0x8')](0x9)[_0x0233('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x0233('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x0233('0x8')](0x9)[_0x0233('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0233('0x17')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x0233('0x8')](0x9)[_0x0233('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x0233('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x0233('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x0233('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x0233('0x8')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0233('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0x0233('0x2')](_0x0233('0x1b'),_0x0233('0x1c')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x0233('0x4')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x0233('0x8')](0x3)[_0x0233('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0233('0x1d')},'dialCutDigit':{'type':Sequelize[_0x0233('0x8')](0x3)[_0x0233('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0233('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x0233('0x8')](0x3)[_0x0233('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0233('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x0233('0x8')](0x5)[_0x0233('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0233('0x20')},'dialDropMaxRetry':{'type':Sequelize[_0x0233('0x8')](0x3)[_0x0233('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0233('0x21')},'dialDropRetryFrequency':{'type':Sequelize[_0x0233('0x8')](0x5)[_0x0233('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0233('0x22')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x0233('0x8')](0x3)[_0x0233('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0233('0x23')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x0233('0x8')](0x5)[_0x0233('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0233('0x24')},'dialMachineMaxRetry':{'type':Sequelize[_0x0233('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x0233('0x8')](0x5)[_0x0233('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x0233('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x0233('0x8')](0x5)[_0x0233('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0233('0x25')}}; \ No newline at end of file +var _0x7dae=['INTEGER','UNSIGNED','Max\x20200\x20calls.','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','ENUM','onlyIfOpen','#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','ASC','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ivr','BOOLEAN','Active/Disactive\x20Campaign'];(function(_0x1140b7,_0x487da6){var _0xdb7211=function(_0x275450){while(--_0x275450){_0x1140b7['push'](_0x1140b7['shift']());}};_0xdb7211(++_0x487da6);}(_0x7dae,0xa8));var _0xe7da=function(_0x1c0770,_0x2f793e){_0x1c0770=_0x1c0770-0x0;var _0x15197d=_0x7dae[_0x1c0770];return _0x15197d;};'use strict';var Sequelize=require(_0xe7da('0x0'));module[_0xe7da('0x1')]={'name':{'type':Sequelize[_0xe7da('0x2')],'unique':_0xe7da('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xe7da('0x4')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0xe7da('0x2')]},'active':{'type':Sequelize[_0xe7da('0x5')],'defaultValue':0x0,'comment':_0xe7da('0x6')},'limitCalls':{'type':Sequelize[_0xe7da('0x7')](0x4)[_0xe7da('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xe7da('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0xe7da('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0xe7da('0x7')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0xe7da('0x7')](0x3)[_0xe7da('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe7da('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe7da('0xb')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xe7da('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe7da('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0xe7da('0x7')](0x5)[_0xe7da('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xe7da('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xe7da('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xe7da('0x7')](0x5)[_0xe7da('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe7da('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0xe7da('0x7')](0x3)[_0xe7da('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xe7da('0xf')},'dialTimezone':{'type':Sequelize[_0xe7da('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xe7da('0x2')],'defaultValue':_0xe7da('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0xe7da('0x11')]('always','never',_0xe7da('0x12')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0xe7da('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xe7da('0x7')](0x9)[_0xe7da('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xe7da('0x7')](0x9)[_0xe7da('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xe7da('0x13')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xe7da('0x7')](0x9)[_0xe7da('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xe7da('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0xe7da('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xe7da('0x15')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xe7da('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xe7da('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0xe7da('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xe7da('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xe7da('0x7')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xe7da('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xe7da('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xe7da('0x7')](0x9)[_0xe7da('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xe7da('0x19')},'dialOrderByScheduledAt':{'type':Sequelize[_0xe7da('0x11')](_0xe7da('0x1a'),_0xe7da('0x1b')),'defaultValue':_0xe7da('0x1a')},'dialPrefix':{'type':Sequelize[_0xe7da('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xe7da('0x7')](0x3)[_0xe7da('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0xe7da('0x7')](0x3)[_0xe7da('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xe7da('0x1c')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xe7da('0x7')](0x3)[_0xe7da('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe7da('0x1d')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xe7da('0x7')](0x5)[_0xe7da('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe7da('0x1e')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xe7da('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe7da('0x1f')},'dialDropRetryFrequency':{'type':Sequelize[_0xe7da('0x7')](0x5)[_0xe7da('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0xe7da('0x7')](0x3)[_0xe7da('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xe7da('0x7')](0x5)[_0xe7da('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0xe7da('0x7')](0x3)[_0xe7da('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe7da('0x20')},'dialMachineRetryFrequency':{'type':Sequelize[_0xe7da('0x7')](0x5)[_0xe7da('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xe7da('0x7')](0x3)[_0xe7da('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe7da('0x21')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xe7da('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe7da('0x22')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 5849f9c..00fe150 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 _0x6c76=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','set','Content-Range','apply','reject','update','then','destroy','get','IvrCampaigns','error','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','offset','order','sort','where','filters','pick','filter','merge','type','options','Campaign','includeAll','include','findAll','rows','catch','show','params','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','body','updatedAt','userProfileId','getHoppers','findOne','CmHopper','CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','ids','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','ContactId','createdAt','select','phone','field','NOW()','CmListId','toString','ListId','from','cm_contacts','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','scheduledAt','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','push','sequelize','all','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','removeBlackLists','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','sox','to-csv','lodash','jsforce','desk.js','papaparse','ioredis'];(function(_0x5b1c48,_0x128a7f){var _0x5ab9aa=function(_0x20fed6){while(--_0x20fed6){_0x5b1c48['push'](_0x5b1c48['shift']());}};_0x5ab9aa(++_0x128a7f);}(_0x6c76,0x184));var _0x66c7=function(_0x36afc9,_0x330ac6){_0x36afc9=_0x36afc9-0x0;var _0x3c5d2b=_0x6c76[_0x36afc9];return _0x3c5d2b;};'use strict';var pdf=require(_0x66c7('0x0'));var emlformat=require(_0x66c7('0x1'));var rimraf=require(_0x66c7('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x66c7('0x3'));var rp=require(_0x66c7('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x66c7('0x5'));var util=require(_0x66c7('0x6'));var path=require('path');var sox=require(_0x66c7('0x7'));var csv=require(_0x66c7('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x66c7('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x66c7('0xa'));var deskjs=require(_0x66c7('0xb'));var toCsv=require(_0x66c7('0x8'));var querystring=require('querystring');var Papa=require(_0x66c7('0xc'));var Redis=require(_0x66c7('0xd'));var authService=require(_0x66c7('0xe'));var qs=require(_0x66c7('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x66c7('0x10'));var logger=require(_0x66c7('0x11'))(_0x66c7('0x12'));var utils=require(_0x66c7('0x13'));var config=require(_0x66c7('0x14'));var db=require(_0x66c7('0x15'))['db'];function respondWithStatusCode(_0x174717,_0x5176a3){_0x5176a3=_0x5176a3||0xcc;return function(_0x18c309){if(_0x18c309){return _0x174717[_0x66c7('0x16')](_0x5176a3);}return _0x174717[_0x66c7('0x17')](_0x5176a3)[_0x66c7('0x18')]();};}function respondWithResult(_0x4f6c91,_0x1e91d1){_0x1e91d1=_0x1e91d1||0xc8;return function(_0x618bd7){if(_0x618bd7){return _0x4f6c91[_0x66c7('0x17')](_0x1e91d1)[_0x66c7('0x19')](_0x618bd7);}};}function respondWithFilteredResult(_0x5d44e1,_0x110f6d){return function(_0x4dd902){if(_0x4dd902){var _0x208010=_0x4dd902[_0x66c7('0x1a')],_0x39f951=_0x110f6d['offset'],_0x3c81c0=_0x110f6d['offset']+_0x110f6d['limit'],_0x42e930;if(_0x3c81c0>=_0x208010){_0x3c81c0=_0x208010;_0x42e930=0xc8;}else{_0x42e930=0xce;}_0x5d44e1['status'](_0x42e930);return _0x5d44e1[_0x66c7('0x1b')](_0x66c7('0x1c'),_0x39f951+'-'+_0x3c81c0+'/'+_0x208010)['json'](_0x4dd902);}return null;};}function patchUpdates(_0x524e87){return function(_0x256b0a){try{jsonpatch[_0x66c7('0x1d')](_0x256b0a,_0x524e87,!![]);}catch(_0x4756f7){return BPromise[_0x66c7('0x1e')](_0x4756f7);}return _0x256b0a['save']();};}function saveUpdates(_0x49a3c7,_0x1853b2){return function(_0x237177){if(_0x237177){return _0x237177[_0x66c7('0x1f')](_0x49a3c7)[_0x66c7('0x20')](function(_0x465457){return _0x465457;});}return null;};}function removeEntity(_0x75f118,_0x4804cf){return function(_0x4ddbd2){if(_0x4ddbd2){return _0x4ddbd2[_0x66c7('0x21')]()['then'](function(){var _0x7462f1=_0x4ddbd2[_0x66c7('0x22')]({'plain':!![]});var _0x44bdef=_0x66c7('0x23');return db['UserProfileResource'][_0x66c7('0x21')]({'where':{'type':_0x44bdef,'resourceId':_0x7462f1['id']}})[_0x66c7('0x20')](function(){return _0x4ddbd2;});})['then'](function(){_0x75f118[_0x66c7('0x17')](0xcc)[_0x66c7('0x18')]();});}};}function handleEntityNotFound(_0x2bb86d,_0x2ef6a2){return function(_0x2af0a3){if(!_0x2af0a3){_0x2bb86d['sendStatus'](0x194);}return _0x2af0a3;};}function handleError(_0x5bc4e6,_0x4e514a){_0x4e514a=_0x4e514a||0x1f4;return function(_0x2dd131){logger[_0x66c7('0x24')](_0x2dd131['stack']);if(_0x2dd131[_0x66c7('0x25')]){delete _0x2dd131[_0x66c7('0x25')];}_0x5bc4e6[_0x66c7('0x17')](_0x4e514a)[_0x66c7('0x26')](_0x2dd131);};}exports[_0x66c7('0x27')]=function(_0x27be81,_0x570f0d){var _0xccefb2={},_0x2e2560={},_0xc4b2bf={'count':0x0,'rows':[]};var _0x33be23=_[_0x66c7('0x28')](db['Campaign'][_0x66c7('0x29')],function(_0x4f1a34){return{'name':_0x4f1a34[_0x66c7('0x2a')],'type':_0x4f1a34['type'][_0x66c7('0x2b')]};});_0x2e2560[_0x66c7('0x2c')]=_[_0x66c7('0x28')](_0x33be23,_0x66c7('0x25'));_0x2e2560[_0x66c7('0x2d')]=_[_0x66c7('0x2e')](_0x27be81['query']);_0x2e2560['filters']=_[_0x66c7('0x2f')](_0x2e2560[_0x66c7('0x2c')],_0x2e2560[_0x66c7('0x2d')]);_0xccefb2[_0x66c7('0x30')]=_[_0x66c7('0x2f')](_0x2e2560[_0x66c7('0x2c')],qs[_0x66c7('0x31')](_0x27be81[_0x66c7('0x2d')][_0x66c7('0x31')]));_0xccefb2[_0x66c7('0x30')]=_0xccefb2[_0x66c7('0x30')][_0x66c7('0x32')]?_0xccefb2['attributes']:_0x2e2560['model'];if(!_0x27be81[_0x66c7('0x2d')][_0x66c7('0x33')](_0x66c7('0x34'))){_0xccefb2[_0x66c7('0x35')]=qs[_0x66c7('0x35')](_0x27be81[_0x66c7('0x2d')][_0x66c7('0x35')]);_0xccefb2['offset']=qs[_0x66c7('0x36')](_0x27be81[_0x66c7('0x2d')][_0x66c7('0x36')]);}_0xccefb2[_0x66c7('0x37')]=qs[_0x66c7('0x38')](_0x27be81[_0x66c7('0x2d')][_0x66c7('0x38')]);_0xccefb2[_0x66c7('0x39')]=qs[_0x66c7('0x3a')](_[_0x66c7('0x3b')](_0x27be81[_0x66c7('0x2d')],_0x2e2560['filters']));if(_0x27be81['query'][_0x66c7('0x3c')]){_0xccefb2[_0x66c7('0x39')]=_[_0x66c7('0x3d')](_0xccefb2['where'],{'$or':_['map'](_0x33be23,function(_0x2e31b8){if(_0x2e31b8[_0x66c7('0x3e')]!=='VIRTUAL'){var _0x2d98e4={};_0x2d98e4[_0x2e31b8[_0x66c7('0x25')]]={'$like':'%'+_0x27be81[_0x66c7('0x2d')]['filter']+'%'};return _0x2d98e4;}})});}_0xccefb2=_[_0x66c7('0x3d')]({},_0xccefb2,_0x27be81[_0x66c7('0x3f')]);var _0x9f6ca8={'where':_0xccefb2[_0x66c7('0x39')]};return db[_0x66c7('0x40')][_0x66c7('0x1a')](_0x9f6ca8)[_0x66c7('0x20')](function(_0x279d27){_0xc4b2bf[_0x66c7('0x1a')]=_0x279d27;if(_0x27be81['query'][_0x66c7('0x41')]){_0xccefb2[_0x66c7('0x42')]=[{'all':!![]}];}return db[_0x66c7('0x40')][_0x66c7('0x43')](_0xccefb2);})[_0x66c7('0x20')](function(_0x28983c){_0xc4b2bf[_0x66c7('0x44')]=_0x28983c;return _0xc4b2bf;})[_0x66c7('0x20')](respondWithFilteredResult(_0x570f0d,_0xccefb2))[_0x66c7('0x45')](handleError(_0x570f0d,null));};exports[_0x66c7('0x46')]=function(_0x513317,_0x5bb5fc){var _0x528f5c={'raw':![],'where':{'id':_0x513317[_0x66c7('0x47')]['id']}},_0x209f58={};_0x209f58['model']=_['keys'](db[_0x66c7('0x40')][_0x66c7('0x29')]);_0x209f58[_0x66c7('0x2d')]=_[_0x66c7('0x2e')](_0x513317[_0x66c7('0x2d')]);_0x209f58['filters']=_[_0x66c7('0x2f')](_0x209f58['model'],_0x209f58['query']);_0x528f5c[_0x66c7('0x30')]=_[_0x66c7('0x2f')](_0x209f58[_0x66c7('0x2c')],qs[_0x66c7('0x31')](_0x513317['query']['fields']));_0x528f5c[_0x66c7('0x30')]=_0x528f5c['attributes']['length']?_0x528f5c[_0x66c7('0x30')]:_0x209f58[_0x66c7('0x2c')];if(_0x513317[_0x66c7('0x2d')][_0x66c7('0x41')]){_0x528f5c['include']=[{'all':!![]}];}_0x528f5c=_[_0x66c7('0x3d')]({},_0x528f5c,_0x513317[_0x66c7('0x3f')]);return db[_0x66c7('0x40')]['find'](_0x528f5c)[_0x66c7('0x20')](handleEntityNotFound(_0x5bb5fc,null))[_0x66c7('0x20')](respondWithResult(_0x5bb5fc,null))[_0x66c7('0x45')](handleError(_0x5bb5fc,null));};exports[_0x66c7('0x48')]=function(_0x1b78a6,_0x3b4f34){return db[_0x66c7('0x40')][_0x66c7('0x48')](_0x1b78a6['body'],{})[_0x66c7('0x20')](function(_0x12d377){var _0x23d0eb=_0x1b78a6[_0x66c7('0x49')][_0x66c7('0x22')]({'plain':!![]});if(!_0x23d0eb)throw new Error(_0x66c7('0x4a'));if(_0x23d0eb[_0x66c7('0x4b')]===_0x66c7('0x49')){var _0x1b3dc2=_0x12d377[_0x66c7('0x22')]({'plain':!![]});var _0x9e2346=_0x66c7('0x23');return db[_0x66c7('0x4c')][_0x66c7('0x4d')]({'where':{'name':_0x9e2346,'userProfileId':_0x23d0eb['userProfileId']},'raw':!![]})[_0x66c7('0x20')](function(_0x225fb6){if(_0x225fb6&&_0x225fb6[_0x66c7('0x4e')]===0x0){return db[_0x66c7('0x4f')]['create']({'name':_0x1b3dc2[_0x66c7('0x25')],'resourceId':_0x1b3dc2['id'],'type':_0x225fb6[_0x66c7('0x25')],'sectionId':_0x225fb6['id']},{})['then'](function(){return _0x12d377;});}else{return _0x12d377;}})[_0x66c7('0x45')](function(_0x2affe4){logger[_0x66c7('0x24')](_0x66c7('0x50'),_0x2affe4);throw _0x2affe4;});}return _0x12d377;})[_0x66c7('0x20')](respondWithResult(_0x3b4f34,0xc9))[_0x66c7('0x45')](handleError(_0x3b4f34,null));};exports[_0x66c7('0x51')]=function(_0x5cd4e9,_0x933dd6){var _0x455ab3={'where':{'id':_0x5cd4e9[_0x66c7('0x47')]['id']}},_0x4a619d={};_0x4a619d[_0x66c7('0x2c')]=_[_0x66c7('0x2e')](db['Campaign'][_0x66c7('0x29')]);_0x455ab3[_0x66c7('0x30')]=_[_0x66c7('0x2f')](_0x4a619d[_0x66c7('0x2c')],qs[_0x66c7('0x31')](_0x5cd4e9[_0x66c7('0x2d')][_0x66c7('0x31')]));_0x455ab3[_0x66c7('0x30')]=_0x455ab3['attributes'][_0x66c7('0x32')]?_0x455ab3[_0x66c7('0x30')]:_0x4a619d['model'];if(_0x5cd4e9[_0x66c7('0x2d')][_0x66c7('0x41')]){_0x455ab3[_0x66c7('0x42')]=[{'all':!![]}];}_0x455ab3=_['merge']({},_0x455ab3,_0x5cd4e9['options']);return db[_0x66c7('0x40')]['find'](_0x455ab3)[_0x66c7('0x20')](handleEntityNotFound(_0x933dd6,null))[_0x66c7('0x20')](function(_0x45e5a2){if(_0x45e5a2){var _0x106b1e=_0x45e5a2[_0x66c7('0x22')]({'plain':!![]});_0x106b1e=qs[_0x66c7('0x52')](_0x106b1e,['id','createdAt','updatedAt']);_0x5cd4e9[_0x66c7('0x53')]=_[_0x66c7('0x52')](_0x5cd4e9['body'],['id','createdAt',_0x66c7('0x54')]);return db['Campaign'][_0x66c7('0x48')](_[_0x66c7('0x3d')](_0x106b1e,_0x5cd4e9[_0x66c7('0x53')]),{'include':_0x5cd4e9[_0x66c7('0x2d')]['includeAll']?[{'all':!![]}]:undefined})[_0x66c7('0x20')](function(_0x1dc6e6){var _0x2443cb=_0x5cd4e9[_0x66c7('0x49')][_0x66c7('0x22')]({'plain':!![]});if(!_0x2443cb)throw new Error(_0x66c7('0x4a'));if(_0x2443cb['role']===_0x66c7('0x49')){var _0x39c18e=_0x1dc6e6[_0x66c7('0x22')]({'plain':!![]});var _0x5352ec=_0x66c7('0x23');return db['UserProfileSection'][_0x66c7('0x4d')]({'where':{'name':_0x5352ec,'userProfileId':_0x2443cb[_0x66c7('0x55')]},'raw':!![]})[_0x66c7('0x20')](function(_0x445af1){if(_0x445af1&&_0x445af1[_0x66c7('0x4e')]===0x0){return db[_0x66c7('0x4f')]['create']({'name':_0x39c18e[_0x66c7('0x25')],'resourceId':_0x39c18e['id'],'type':_0x445af1[_0x66c7('0x25')],'sectionId':_0x445af1['id']},{})[_0x66c7('0x20')](function(){return _0x1dc6e6;});}else{return _0x1dc6e6;}})[_0x66c7('0x45')](function(_0x8f9402){logger['error'](_0x66c7('0x50'),_0x8f9402);throw _0x8f9402;});}return _0x1dc6e6;});}})[_0x66c7('0x20')](respondWithResult(_0x933dd6,0xc9))[_0x66c7('0x45')](handleError(_0x933dd6,null));};exports[_0x66c7('0x1f')]=function(_0x433fb5,_0x22ab1d){if(_0x433fb5[_0x66c7('0x53')]['id']){delete _0x433fb5[_0x66c7('0x53')]['id'];}return db[_0x66c7('0x40')][_0x66c7('0x4d')]({'where':{'id':_0x433fb5[_0x66c7('0x47')]['id']}})[_0x66c7('0x20')](handleEntityNotFound(_0x22ab1d,null))['then'](saveUpdates(_0x433fb5[_0x66c7('0x53')],null))[_0x66c7('0x20')](respondWithResult(_0x22ab1d,null))[_0x66c7('0x45')](handleError(_0x22ab1d,null));};exports[_0x66c7('0x21')]=function(_0x1a7e10,_0x419b49){return db[_0x66c7('0x40')]['find']({'where':{'id':_0x1a7e10[_0x66c7('0x47')]['id']}})[_0x66c7('0x20')](handleEntityNotFound(_0x419b49,null))[_0x66c7('0x20')](removeEntity(_0x419b49,null))[_0x66c7('0x45')](handleError(_0x419b49,null));};exports[_0x66c7('0x56')]=function(_0x447398,_0x41bdf3,_0x3e8f4c){var _0xe89d87={'raw':!![],'where':{}};var _0x4069a6={};var _0x21eb0a={'count':0x0,'rows':[]};return db[_0x66c7('0x40')][_0x66c7('0x57')]({'where':{'id':_0x447398[_0x66c7('0x47')]['id']}})[_0x66c7('0x20')](handleEntityNotFound(_0x41bdf3,null))[_0x66c7('0x20')](function(_0x5bca99){if(_0x5bca99){_0x4069a6[_0x66c7('0x2c')]=_[_0x66c7('0x2e')](db[_0x66c7('0x58')][_0x66c7('0x29')]);_0x4069a6[_0x66c7('0x2d')]=_[_0x66c7('0x2e')](_0x447398[_0x66c7('0x2d')]);_0x4069a6[_0x66c7('0x3a')]=_[_0x66c7('0x2f')](_0x4069a6[_0x66c7('0x2c')],_0x4069a6[_0x66c7('0x2d')]);_0xe89d87[_0x66c7('0x30')]=_[_0x66c7('0x2f')](_0x4069a6[_0x66c7('0x2c')],qs[_0x66c7('0x31')](_0x447398[_0x66c7('0x2d')][_0x66c7('0x31')]));_0xe89d87['attributes']=_0xe89d87[_0x66c7('0x30')][_0x66c7('0x32')]?_0xe89d87[_0x66c7('0x30')]:_0x4069a6[_0x66c7('0x2c')];if(!_0x447398[_0x66c7('0x2d')][_0x66c7('0x33')]('nolimit')){_0xe89d87['limit']=qs[_0x66c7('0x35')](_0x447398['query'][_0x66c7('0x35')]);_0xe89d87[_0x66c7('0x36')]=qs[_0x66c7('0x36')](_0x447398[_0x66c7('0x2d')][_0x66c7('0x36')]);}_0xe89d87[_0x66c7('0x37')]=qs[_0x66c7('0x38')](_0x447398[_0x66c7('0x2d')][_0x66c7('0x38')]);_0xe89d87[_0x66c7('0x39')]=qs[_0x66c7('0x3a')](_[_0x66c7('0x3b')](_0x447398['query'],_0x4069a6[_0x66c7('0x3a')]));_0xe89d87[_0x66c7('0x39')][_0x66c7('0x59')]=_0x5bca99['id'];if(_0x447398[_0x66c7('0x2d')]['filter']){_0xe89d87[_0x66c7('0x39')]=_[_0x66c7('0x3d')](_0xe89d87['where'],{'$or':_[_0x66c7('0x28')](_0xe89d87[_0x66c7('0x30')],function(_0x3f25c0){var _0x2fadf8={};_0x2fadf8[_0x3f25c0]={'$like':'%'+_0x447398[_0x66c7('0x2d')][_0x66c7('0x3c')]+'%'};return _0x2fadf8;})});}_0xe89d87=_['merge']({},_0xe89d87,_0x447398['options']);return db[_0x66c7('0x58')]['count']({'where':_0xe89d87['where']})[_0x66c7('0x20')](function(_0xb61ce5){_0x21eb0a[_0x66c7('0x1a')]=_0xb61ce5;if(_0x447398[_0x66c7('0x2d')][_0x66c7('0x41')]){_0xe89d87[_0x66c7('0x42')]=[{'all':!![]}];}return db[_0x66c7('0x58')][_0x66c7('0x43')](_0xe89d87);})['then'](function(_0x3a216e){_0x21eb0a[_0x66c7('0x44')]=_0x3a216e;return _0x21eb0a;});}})[_0x66c7('0x20')](respondWithFilteredResult(_0x41bdf3,_0xe89d87))[_0x66c7('0x45')](handleError(_0x41bdf3,null));};exports[_0x66c7('0x5a')]=function(_0xfe12d6,_0x412525,_0x44a672){var _0x46b54f={'raw':!![],'where':{}};var _0x13a5d1={};var _0x1c6f80={'count':0x0,'rows':[]};return db[_0x66c7('0x40')][_0x66c7('0x57')]({'where':{'id':_0xfe12d6[_0x66c7('0x47')]['id']}})[_0x66c7('0x20')](handleEntityNotFound(_0x412525,null))[_0x66c7('0x20')](function(_0x2b1854){if(_0x2b1854){_0x13a5d1[_0x66c7('0x2c')]=_[_0x66c7('0x2e')](db[_0x66c7('0x5b')][_0x66c7('0x29')]);_0x13a5d1[_0x66c7('0x2d')]=_[_0x66c7('0x2e')](_0xfe12d6[_0x66c7('0x2d')]);_0x13a5d1[_0x66c7('0x3a')]=_[_0x66c7('0x2f')](_0x13a5d1[_0x66c7('0x2c')],_0x13a5d1['query']);_0x46b54f[_0x66c7('0x30')]=_[_0x66c7('0x2f')](_0x13a5d1[_0x66c7('0x2c')],qs['fields'](_0xfe12d6[_0x66c7('0x2d')][_0x66c7('0x31')]));_0x46b54f[_0x66c7('0x30')]=_0x46b54f['attributes'][_0x66c7('0x32')]?_0x46b54f[_0x66c7('0x30')]:_0x13a5d1[_0x66c7('0x2c')];if(!_0xfe12d6['query'][_0x66c7('0x33')](_0x66c7('0x34'))){_0x46b54f[_0x66c7('0x35')]=qs[_0x66c7('0x35')](_0xfe12d6['query'][_0x66c7('0x35')]);_0x46b54f[_0x66c7('0x36')]=qs[_0x66c7('0x36')](_0xfe12d6[_0x66c7('0x2d')]['offset']);}_0x46b54f['order']=qs[_0x66c7('0x38')](_0xfe12d6[_0x66c7('0x2d')][_0x66c7('0x38')]);_0x46b54f[_0x66c7('0x39')]=qs[_0x66c7('0x3a')](_['pick'](_0xfe12d6[_0x66c7('0x2d')],_0x13a5d1[_0x66c7('0x3a')]));_0x46b54f[_0x66c7('0x39')][_0x66c7('0x59')]=_0x2b1854['id'];if(_0xfe12d6[_0x66c7('0x2d')]['filter']){_0x46b54f[_0x66c7('0x39')]=_[_0x66c7('0x3d')](_0x46b54f[_0x66c7('0x39')],{'$or':_[_0x66c7('0x28')](_0x46b54f[_0x66c7('0x30')],function(_0x4310e6){var _0x9b1421={};_0x9b1421[_0x4310e6]={'$like':'%'+_0xfe12d6[_0x66c7('0x2d')]['filter']+'%'};return _0x9b1421;})});}_0x46b54f=_[_0x66c7('0x3d')]({},_0x46b54f,_0xfe12d6[_0x66c7('0x3f')]);return db[_0x66c7('0x5b')]['count']({'where':_0x46b54f[_0x66c7('0x39')]})[_0x66c7('0x20')](function(_0x41ba9a){_0x1c6f80[_0x66c7('0x1a')]=_0x41ba9a;if(_0xfe12d6[_0x66c7('0x2d')][_0x66c7('0x41')]){_0x46b54f[_0x66c7('0x42')]=[{'all':!![]}];}return db[_0x66c7('0x5b')]['findAll'](_0x46b54f);})[_0x66c7('0x20')](function(_0x1b1c6d){_0x1c6f80[_0x66c7('0x44')]=_0x1b1c6d;return _0x1c6f80;});}})[_0x66c7('0x20')](respondWithFilteredResult(_0x412525,_0x46b54f))[_0x66c7('0x45')](handleError(_0x412525,null));};exports[_0x66c7('0x5c')]=function(_0x58f604,_0x475272,_0x446e40){var _0x109d6a={'raw':!![],'where':{}};var _0x223ab1={};var _0x12085a={'count':0x0,'rows':[]};return db[_0x66c7('0x40')][_0x66c7('0x57')]({'where':{'id':_0x58f604[_0x66c7('0x47')]['id']}})['then'](handleEntityNotFound(_0x475272,null))[_0x66c7('0x20')](function(_0xb951d4){if(_0xb951d4){_0x223ab1[_0x66c7('0x2c')]=_['keys'](db[_0x66c7('0x5d')][_0x66c7('0x29')]);_0x223ab1[_0x66c7('0x2d')]=_[_0x66c7('0x2e')](_0x58f604[_0x66c7('0x2d')]);_0x223ab1[_0x66c7('0x3a')]=_[_0x66c7('0x2f')](_0x223ab1['model'],_0x223ab1[_0x66c7('0x2d')]);_0x109d6a['attributes']=_['intersection'](_0x223ab1['model'],qs['fields'](_0x58f604[_0x66c7('0x2d')][_0x66c7('0x31')]));_0x109d6a['attributes']=_0x109d6a['attributes'][_0x66c7('0x32')]?_0x109d6a[_0x66c7('0x30')]:_0x223ab1['model'];if(!_0x58f604['query'][_0x66c7('0x33')]('nolimit')){_0x109d6a['limit']=qs[_0x66c7('0x35')](_0x58f604[_0x66c7('0x2d')]['limit']);_0x109d6a[_0x66c7('0x36')]=qs[_0x66c7('0x36')](_0x58f604[_0x66c7('0x2d')][_0x66c7('0x36')]);}_0x109d6a[_0x66c7('0x37')]=qs[_0x66c7('0x38')](_0x58f604[_0x66c7('0x2d')][_0x66c7('0x38')]);_0x109d6a[_0x66c7('0x39')]=qs['filters'](_[_0x66c7('0x3b')](_0x58f604['query'],_0x223ab1[_0x66c7('0x3a')]));_0x109d6a[_0x66c7('0x39')]['CampaignId']=_0xb951d4['id'];if(_0x58f604[_0x66c7('0x2d')][_0x66c7('0x3c')]){_0x109d6a[_0x66c7('0x39')]=_[_0x66c7('0x3d')](_0x109d6a[_0x66c7('0x39')],{'$or':_['map'](_0x109d6a[_0x66c7('0x30')],function(_0x5c463c){var _0x44df97={};_0x44df97[_0x5c463c]={'$like':'%'+_0x58f604[_0x66c7('0x2d')][_0x66c7('0x3c')]+'%'};return _0x44df97;})});}_0x109d6a=_[_0x66c7('0x3d')]({},_0x109d6a,_0x58f604[_0x66c7('0x3f')]);return db[_0x66c7('0x5d')][_0x66c7('0x1a')]({'where':_0x109d6a['where']})['then'](function(_0x2ed11c){_0x12085a['count']=_0x2ed11c;if(_0x58f604['query']['includeAll']){_0x109d6a[_0x66c7('0x42')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x66c7('0x43')](_0x109d6a);})[_0x66c7('0x20')](function(_0x40d269){_0x12085a['rows']=_0x40d269;return _0x12085a;});}})[_0x66c7('0x20')](respondWithFilteredResult(_0x475272,_0x109d6a))['catch'](handleError(_0x475272,null));};exports[_0x66c7('0x5e')]=function(_0x5ed31b,_0x37fb5a,_0x248b31){var _0xca6817={'raw':!![],'where':{}};var _0x3c8c2b={};var _0x10d0cf={'count':0x0,'rows':[]};return db[_0x66c7('0x40')][_0x66c7('0x57')]({'where':{'id':_0x5ed31b['params']['id']}})[_0x66c7('0x20')](handleEntityNotFound(_0x37fb5a,null))['then'](function(_0x580072){if(_0x580072){_0x3c8c2b[_0x66c7('0x2c')]=_[_0x66c7('0x2e')](db[_0x66c7('0x5f')][_0x66c7('0x29')]);_0x3c8c2b[_0x66c7('0x2d')]=_[_0x66c7('0x2e')](_0x5ed31b[_0x66c7('0x2d')]);_0x3c8c2b[_0x66c7('0x3a')]=_[_0x66c7('0x2f')](_0x3c8c2b[_0x66c7('0x2c')],_0x3c8c2b[_0x66c7('0x2d')]);_0xca6817[_0x66c7('0x30')]=_[_0x66c7('0x2f')](_0x3c8c2b['model'],qs[_0x66c7('0x31')](_0x5ed31b['query'][_0x66c7('0x31')]));_0xca6817[_0x66c7('0x30')]=_0xca6817[_0x66c7('0x30')][_0x66c7('0x32')]?_0xca6817[_0x66c7('0x30')]:_0x3c8c2b[_0x66c7('0x2c')];if(!_0x5ed31b['query']['hasOwnProperty']('nolimit')){_0xca6817['limit']=qs['limit'](_0x5ed31b[_0x66c7('0x2d')][_0x66c7('0x35')]);_0xca6817[_0x66c7('0x36')]=qs[_0x66c7('0x36')](_0x5ed31b['query']['offset']);}_0xca6817[_0x66c7('0x37')]=qs[_0x66c7('0x38')](_0x5ed31b['query'][_0x66c7('0x38')]);_0xca6817[_0x66c7('0x39')]=qs['filters'](_[_0x66c7('0x3b')](_0x5ed31b[_0x66c7('0x2d')],_0x3c8c2b[_0x66c7('0x3a')]));_0xca6817[_0x66c7('0x39')]['CampaignId']=_0x580072['id'];if(_0x5ed31b['query'][_0x66c7('0x3c')]){_0xca6817[_0x66c7('0x39')]=_[_0x66c7('0x3d')](_0xca6817[_0x66c7('0x39')],{'$or':_[_0x66c7('0x28')](_0xca6817[_0x66c7('0x30')],function(_0x30b087){var _0x2ff6f2={};_0x2ff6f2[_0x30b087]={'$like':'%'+_0x5ed31b[_0x66c7('0x2d')][_0x66c7('0x3c')]+'%'};return _0x2ff6f2;})});}_0xca6817=_['merge']({},_0xca6817,_0x5ed31b[_0x66c7('0x3f')]);return db[_0x66c7('0x5f')][_0x66c7('0x1a')]({'where':_0xca6817[_0x66c7('0x39')]})[_0x66c7('0x20')](function(_0x3fb5eb){_0x10d0cf[_0x66c7('0x1a')]=_0x3fb5eb;if(_0x5ed31b[_0x66c7('0x2d')][_0x66c7('0x41')]){_0xca6817[_0x66c7('0x42')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x66c7('0x43')](_0xca6817);})[_0x66c7('0x20')](function(_0x140a3d){_0x10d0cf[_0x66c7('0x44')]=_0x140a3d;return _0x10d0cf;});}})[_0x66c7('0x20')](respondWithFilteredResult(_0x37fb5a,_0xca6817))[_0x66c7('0x45')](handleError(_0x37fb5a,null));};exports[_0x66c7('0x60')]=function(_0x35ab01,_0x5f0f33,_0x18c58a){var _0x2bac63={};var _0x4377f1={};var _0x45720f;var _0x13477f;return db[_0x66c7('0x40')][_0x66c7('0x57')]({'where':{'id':_0x35ab01[_0x66c7('0x47')]['id']}})[_0x66c7('0x20')](handleEntityNotFound(_0x5f0f33,null))[_0x66c7('0x20')](function(_0x3259b1){if(_0x3259b1){_0x45720f=_0x3259b1;_0x4377f1[_0x66c7('0x2c')]=_['keys'](db['CmList'][_0x66c7('0x29')]);_0x4377f1[_0x66c7('0x2d')]=_[_0x66c7('0x2e')](_0x35ab01[_0x66c7('0x2d')]);_0x4377f1[_0x66c7('0x3a')]=_[_0x66c7('0x2f')](_0x4377f1[_0x66c7('0x2c')],_0x4377f1[_0x66c7('0x2d')]);_0x2bac63['attributes']=_[_0x66c7('0x2f')](_0x4377f1[_0x66c7('0x2c')],qs['fields'](_0x35ab01[_0x66c7('0x2d')][_0x66c7('0x31')]));_0x2bac63[_0x66c7('0x30')]=_0x2bac63[_0x66c7('0x30')]['length']?_0x2bac63[_0x66c7('0x30')]:_0x4377f1[_0x66c7('0x2c')];_0x2bac63[_0x66c7('0x37')]=qs[_0x66c7('0x38')](_0x35ab01['query']['sort']);_0x2bac63[_0x66c7('0x39')]=qs[_0x66c7('0x3a')](_[_0x66c7('0x3b')](_0x35ab01[_0x66c7('0x2d')],_0x4377f1[_0x66c7('0x3a')]));if(_0x35ab01[_0x66c7('0x2d')]['filter']){_0x2bac63[_0x66c7('0x39')]=_[_0x66c7('0x3d')](_0x2bac63[_0x66c7('0x39')],{'$or':_[_0x66c7('0x28')](_0x2bac63['attributes'],function(_0x233f72){var _0x4b01ee={};_0x4b01ee[_0x233f72]={'$like':'%'+_0x35ab01[_0x66c7('0x2d')]['filter']+'%'};return _0x4b01ee;})});}_0x2bac63=_['merge']({},_0x2bac63,_0x35ab01[_0x66c7('0x3f')]);return _0x45720f[_0x66c7('0x60')](_0x2bac63);}})['then'](function(_0x533816){if(_0x533816){_0x13477f=_0x533816[_0x66c7('0x32')];if(!_0x35ab01['query'][_0x66c7('0x33')](_0x66c7('0x34'))){_0x2bac63[_0x66c7('0x35')]=qs[_0x66c7('0x35')](_0x35ab01['query'][_0x66c7('0x35')]);_0x2bac63[_0x66c7('0x36')]=qs[_0x66c7('0x36')](_0x35ab01[_0x66c7('0x2d')][_0x66c7('0x36')]);}return _0x45720f['getLists'](_0x2bac63);}})['then'](function(_0x100338){if(_0x100338){return _0x100338?{'count':_0x13477f,'rows':_0x100338}:null;}})[_0x66c7('0x20')](respondWithResult(_0x5f0f33,null))[_0x66c7('0x45')](handleError(_0x5f0f33,null));};exports[_0x66c7('0x61')]=function(_0x3bae47,_0x501a80,_0x290fcc){var _0x3a8821,_0x405cfc;return db[_0x66c7('0x40')][_0x66c7('0x4d')]({'where':{'id':_0x3bae47['params']['id']}})['then'](handleEntityNotFound(_0x501a80,null))[_0x66c7('0x20')](function(_0x328532){if(_0x328532){_0x405cfc=_0x328532;return _0x328532['addLists'](_0x3bae47[_0x66c7('0x53')]['ids'],_[_0x66c7('0x52')](_0x3bae47[_0x66c7('0x53')],[_0x66c7('0x62'),'id'])||{});}return null;})['spread'](function(_0x1354ef){var _0x5013a7;_0x3a8821=_0x1354ef||[];var _0x46c2ff=[];if(_0x1354ef){for(var _0x4dd492=0x0;_0x4dd492<_0x1354ef[_0x66c7('0x32')];_0x4dd492+=0x1){var _0x361fe0=_0x1354ef[_0x4dd492][_0x66c7('0x22')]({'plain':!![]});_0x405cfc[_0x66c7('0x63')]=_0x3bae47['body'][_0x66c7('0x63')]?_0x3bae47[_0x66c7('0x53')]['dialCheckDuplicateType']:_0x405cfc[_0x66c7('0x63')];switch(_0x405cfc[_0x66c7('0x63')]){case'always':_0x5013a7=squel[_0x66c7('0x64')]()[_0x66c7('0x65')](_0x66c7('0x66'))[_0x66c7('0x67')](['phone','scheduledAt',_0x66c7('0x68'),'ListId',_0x66c7('0x59'),_0x66c7('0x69'),'updatedAt'],squel[_0x66c7('0x6a')]()['field'](_0x66c7('0x6b'),_0x66c7('0x6b'))[_0x66c7('0x6c')](_0x66c7('0x6d'),'scheduledAt')[_0x66c7('0x6c')]('id',_0x66c7('0x68'))['field'](_0x361fe0[_0x66c7('0x6e')][_0x66c7('0x6f')](),_0x66c7('0x70'))[_0x66c7('0x6c')](_0x3bae47[_0x66c7('0x47')]['id'][_0x66c7('0x6f')](),_0x66c7('0x59'))[_0x66c7('0x6c')](_0x66c7('0x6d'),_0x66c7('0x69'))[_0x66c7('0x6c')](_0x66c7('0x6d'),_0x66c7('0x54'))[_0x66c7('0x71')](_0x66c7('0x72'))[_0x66c7('0x39')]('deletedAt\x20IS\x20NULL')[_0x66c7('0x39')]('ListId\x20=\x20?',_0x361fe0['CmListId'][_0x66c7('0x6f')]())[_0x66c7('0x39')]('phone\x20IS\x20NOT\x20NULL')[_0x66c7('0x39')](_0x66c7('0x73'),squel[_0x66c7('0x6a')]()[_0x66c7('0x6c')](_0x66c7('0x74'))['from'](_0x66c7('0x75'))[_0x66c7('0x39')](_0x66c7('0x76'),_0x3bae47[_0x66c7('0x47')]['id'][_0x66c7('0x6f')]()))[_0x66c7('0x39')]('phone\x20NOT\x20IN\x20(?)',squel[_0x66c7('0x6a')]()['field'](_0x66c7('0x77'))['from'](_0x66c7('0x66'))[_0x66c7('0x39')](_0x66c7('0x76'),_0x3bae47[_0x66c7('0x47')]['id'][_0x66c7('0x6f')]())))['toString']();break;case _0x66c7('0x78'):_0x5013a7=squel[_0x66c7('0x64')]()[_0x66c7('0x65')]('cm_hopper')[_0x66c7('0x67')](['phone',_0x66c7('0x79'),_0x66c7('0x68'),'ListId',_0x66c7('0x59'),_0x66c7('0x69'),_0x66c7('0x54')],squel['select']()[_0x66c7('0x6c')](_0x66c7('0x6b'),_0x66c7('0x6b'))['field']('NOW()',_0x66c7('0x79'))['field']('id',_0x66c7('0x68'))[_0x66c7('0x6c')](_0x361fe0['CmListId'][_0x66c7('0x6f')](),'ListId')['field'](_0x3bae47[_0x66c7('0x47')]['id'][_0x66c7('0x6f')](),_0x66c7('0x59'))['field'](_0x66c7('0x6d'),_0x66c7('0x69'))[_0x66c7('0x6c')](_0x66c7('0x6d'),_0x66c7('0x54'))['from'](_0x66c7('0x72'))[_0x66c7('0x39')](_0x66c7('0x7a'))['where'](_0x66c7('0x7b'),_0x361fe0['CmListId'][_0x66c7('0x6f')]())[_0x66c7('0x39')](_0x66c7('0x7c'))[_0x66c7('0x39')](_0x66c7('0x73'),squel[_0x66c7('0x6a')]()['field'](_0x66c7('0x77'))[_0x66c7('0x71')]('cm_hopper')[_0x66c7('0x39')](_0x66c7('0x76'),_0x3bae47[_0x66c7('0x47')]['id'][_0x66c7('0x6f')]())))['toString']();break;default:_0x5013a7=squel[_0x66c7('0x64')]()[_0x66c7('0x65')]('cm_hopper')['fromQuery'](['phone',_0x66c7('0x79'),_0x66c7('0x68'),_0x66c7('0x70'),_0x66c7('0x59'),_0x66c7('0x69'),_0x66c7('0x54')],squel['select']()[_0x66c7('0x6c')](_0x66c7('0x6b'),_0x66c7('0x6b'))[_0x66c7('0x6c')](_0x66c7('0x6d'),_0x66c7('0x79'))[_0x66c7('0x6c')]('id','ContactId')[_0x66c7('0x6c')](_0x361fe0['CmListId'][_0x66c7('0x6f')](),_0x66c7('0x70'))['field'](_0x3bae47[_0x66c7('0x47')]['id'][_0x66c7('0x6f')](),_0x66c7('0x59'))['field'](_0x66c7('0x6d'),_0x66c7('0x69'))[_0x66c7('0x6c')](_0x66c7('0x6d'),_0x66c7('0x54'))['from'](_0x66c7('0x72'))[_0x66c7('0x39')](_0x66c7('0x7a'))[_0x66c7('0x39')]('ListId\x20=\x20?',_0x361fe0[_0x66c7('0x6e')][_0x66c7('0x6f')]())[_0x66c7('0x39')]('phone\x20IS\x20NOT\x20NULL'))['toString']();}_0x46c2ff[_0x66c7('0x7d')](db[_0x66c7('0x7e')][_0x66c7('0x2d')](_0x5013a7));}return BPromise[_0x66c7('0x7f')](_0x46c2ff);}})[_0x66c7('0x20')](function(){return _0x3a8821;})[_0x66c7('0x20')](respondWithResult(_0x501a80,null))[_0x66c7('0x45')](handleError(_0x501a80,null));};exports[_0x66c7('0x80')]=function(_0x54785,_0x3b538e,_0x49399d){return db['Campaign'][_0x66c7('0x4d')]({'where':{'id':_0x54785[_0x66c7('0x47')]['id']}})[_0x66c7('0x20')](handleEntityNotFound(_0x3b538e,null))[_0x66c7('0x20')](function(_0x3fb850){if(_0x3fb850){return _0x3fb850[_0x66c7('0x80')](_0x54785[_0x66c7('0x2d')]['ids']);}})['then'](function(_0x181009){if(_0x181009){return db[_0x66c7('0x58')][_0x66c7('0x21')]({'where':{'ListId':_0x54785[_0x66c7('0x2d')][_0x66c7('0x62')],'CampaignId':_0x54785[_0x66c7('0x47')]['id']}})[_0x66c7('0x20')](function(){return _0x181009;});}})['then'](respondWithStatusCode(_0x3b538e,null))[_0x66c7('0x45')](handleError(_0x3b538e,null));};exports[_0x66c7('0x81')]=function(_0x200825,_0xebc457,_0x2dd01b){var _0x166911={'raw':!![],'where':{}};var _0x308efe={};var _0x1ab91c={'count':0x0,'rows':[]};return db[_0x66c7('0x40')]['findOne']({'where':{'id':_0x200825[_0x66c7('0x47')]['id']}})[_0x66c7('0x20')](handleEntityNotFound(_0xebc457,null))['then'](function(_0x426f22){if(_0x426f22){_0x308efe[_0x66c7('0x2c')]=_[_0x66c7('0x2e')](db[_0x66c7('0x82')][_0x66c7('0x29')]);_0x308efe[_0x66c7('0x2d')]=_['keys'](_0x200825[_0x66c7('0x2d')]);_0x308efe['filters']=_[_0x66c7('0x2f')](_0x308efe[_0x66c7('0x2c')],_0x308efe[_0x66c7('0x2d')]);_0x166911[_0x66c7('0x30')]=_[_0x66c7('0x2f')](_0x308efe['model'],qs[_0x66c7('0x31')](_0x200825[_0x66c7('0x2d')][_0x66c7('0x31')]));_0x166911[_0x66c7('0x30')]=_0x166911[_0x66c7('0x30')]['length']?_0x166911[_0x66c7('0x30')]:_0x308efe[_0x66c7('0x2c')];if(!_0x200825[_0x66c7('0x2d')]['hasOwnProperty'](_0x66c7('0x34'))){_0x166911[_0x66c7('0x35')]=qs[_0x66c7('0x35')](_0x200825[_0x66c7('0x2d')][_0x66c7('0x35')]);_0x166911[_0x66c7('0x36')]=qs[_0x66c7('0x36')](_0x200825['query'][_0x66c7('0x36')]);}_0x166911[_0x66c7('0x37')]=qs[_0x66c7('0x38')](_0x200825[_0x66c7('0x2d')][_0x66c7('0x38')]);_0x166911['where']=qs['filters'](_[_0x66c7('0x3b')](_0x200825[_0x66c7('0x2d')],_0x308efe[_0x66c7('0x3a')]));_0x166911['where'][_0x66c7('0x59')]=_0x426f22['id'];if(_0x200825[_0x66c7('0x2d')][_0x66c7('0x3c')]){_0x166911[_0x66c7('0x39')]=_[_0x66c7('0x3d')](_0x166911[_0x66c7('0x39')],{'$or':_[_0x66c7('0x28')](_0x166911['attributes'],function(_0x48e6a4){var _0x27e1d9={};_0x27e1d9[_0x48e6a4]={'$like':'%'+_0x200825[_0x66c7('0x2d')]['filter']+'%'};return _0x27e1d9;})});}_0x166911=_[_0x66c7('0x3d')]({},_0x166911,_0x200825[_0x66c7('0x3f')]);return db[_0x66c7('0x82')][_0x66c7('0x1a')]({'where':_0x166911['where']})[_0x66c7('0x20')](function(_0x34c44c){_0x1ab91c['count']=_0x34c44c;if(_0x200825[_0x66c7('0x2d')][_0x66c7('0x41')]){_0x166911[_0x66c7('0x42')]=[{'all':!![]}];}return db['CmList'][_0x66c7('0x43')](_0x166911);})['then'](function(_0x52de9e){_0x1ab91c[_0x66c7('0x44')]=_0x52de9e;return _0x1ab91c;});}})[_0x66c7('0x20')](respondWithFilteredResult(_0xebc457,_0x166911))[_0x66c7('0x45')](handleError(_0xebc457,null));};exports[_0x66c7('0x83')]=function(_0x3e875e,_0x24eb7f,_0x273c3f){var _0x2987c4,_0x3a3ec7;return db[_0x66c7('0x40')][_0x66c7('0x4d')]({'where':{'id':_0x3e875e[_0x66c7('0x47')]['id']}})[_0x66c7('0x20')](handleEntityNotFound(_0x24eb7f,null))['then'](function(_0x1f1d95){if(_0x1f1d95){_0x3a3ec7=_0x1f1d95;return _0x1f1d95[_0x66c7('0x83')](_0x3e875e[_0x66c7('0x53')][_0x66c7('0x62')],_[_0x66c7('0x52')](_0x3e875e[_0x66c7('0x53')],[_0x66c7('0x62'),'id'])||{});}return null;})['spread'](function(_0x2beba7){var _0x110e58;_0x2987c4=_0x2beba7||[];var _0x2a9750=[];if(_0x2beba7){for(var _0x11f42d=0x0;_0x11f42d<_0x2beba7[_0x66c7('0x32')];_0x11f42d+=0x1){var _0x2aa16a=_0x2beba7[_0x11f42d][_0x66c7('0x22')]({'plain':!![]});_0x110e58=squel[_0x66c7('0x64')]()[_0x66c7('0x65')](_0x66c7('0x84'))[_0x66c7('0x67')](['phone',_0x66c7('0x68'),_0x66c7('0x70'),_0x66c7('0x59'),_0x66c7('0x69'),_0x66c7('0x54')],squel[_0x66c7('0x6a')]()['field'](_0x66c7('0x6b'),'phone')[_0x66c7('0x6c')]('id',_0x66c7('0x68'))[_0x66c7('0x6c')](_0x2aa16a[_0x66c7('0x6e')][_0x66c7('0x6f')](),_0x66c7('0x70'))[_0x66c7('0x6c')](_0x3e875e[_0x66c7('0x47')]['id'][_0x66c7('0x6f')](),_0x66c7('0x59'))[_0x66c7('0x6c')](_0x66c7('0x6d'),_0x66c7('0x69'))[_0x66c7('0x6c')](_0x66c7('0x6d'),'updatedAt')['from'](_0x66c7('0x72'))['where']('deletedAt\x20IS\x20NULL')['where'](_0x66c7('0x7b'),_0x2aa16a['CmListId']['toString']())['where']('phone\x20IS\x20NOT\x20NULL'))['toString']();_0x2a9750[_0x66c7('0x7d')](db[_0x66c7('0x7e')][_0x66c7('0x2d')](_0x110e58));}return BPromise[_0x66c7('0x7f')](_0x2a9750);}})[_0x66c7('0x20')](function(){return _0x2987c4;})[_0x66c7('0x20')](respondWithResult(_0x24eb7f,null))[_0x66c7('0x45')](handleError(_0x24eb7f,null));};exports['removeBlackLists']=function(_0x5ef922,_0x1cc5b7,_0x13f04b){return db[_0x66c7('0x40')][_0x66c7('0x4d')]({'where':{'id':_0x5ef922[_0x66c7('0x47')]['id']}})[_0x66c7('0x20')](handleEntityNotFound(_0x1cc5b7,null))[_0x66c7('0x20')](function(_0x55a4e2){if(_0x55a4e2){return _0x55a4e2[_0x66c7('0x85')](_0x5ef922[_0x66c7('0x2d')][_0x66c7('0x62')]);}})[_0x66c7('0x20')](function(_0x380187){if(_0x380187){return db['CmHopperBlack'][_0x66c7('0x21')]({'where':{'ListId':_0x5ef922[_0x66c7('0x2d')]['ids'],'CampaignId':_0x5ef922[_0x66c7('0x47')]['id']}})[_0x66c7('0x20')](function(){return _0x380187;});}})[_0x66c7('0x20')](respondWithStatusCode(_0x1cc5b7,null))[_0x66c7('0x45')](handleError(_0x1cc5b7,null));}; \ No newline at end of file +var _0x54ef=['rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','UserProfileResource','stack','name','send','index','Campaign','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','length','sort','where','pick','merge','VIRTUAL','filter','options','findAll','rows','show','params','keys','fields','includeAll','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','IvrCampaigns','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','include','omit','updatedAt','createdAt','body','getHoppers','nolimit','order','CampaignId','getHopperHistories','findOne','CmHopperHistory','hasOwnProperty','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','ids','spread','dialCheckDuplicateType','insert','into','fromQuery','scheduledAt','ContactId','ListId','select','phone','field','NOW()','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','onlyIfOpen','cm_hopper','push','sequelize','all','removeLists','CmHopper','getBlackLists','CmList','addBlackLists','cm_hopper_black','removeBlackLists','html-pdf','eml-format'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x54ef,0x112));var _0xf54e=function(_0x2d4196,_0x3c2c64){_0x2d4196=_0x2d4196-0x0;var _0x3ffca6=_0x54ef[_0x2d4196];return _0x3ffca6;};'use strict';var pdf=require(_0xf54e('0x0'));var emlformat=require(_0xf54e('0x1'));var rimraf=require(_0xf54e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf54e('0x3'));var rp=require(_0xf54e('0x4'));var moment=require(_0xf54e('0x5'));var BPromise=require(_0xf54e('0x6'));var Mustache=require(_0xf54e('0x7'));var util=require(_0xf54e('0x8'));var path=require(_0xf54e('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf54e('0xa'));var fs=require('fs');var _=require(_0xf54e('0xb'));var squel=require(_0xf54e('0xc'));var crypto=require('crypto');var jsforce=require(_0xf54e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf54e('0xe'));var querystring=require(_0xf54e('0xf'));var Papa=require('papaparse');var Redis=require(_0xf54e('0x10'));var authService=require(_0xf54e('0x11'));var qs=require(_0xf54e('0x12'));var as=require(_0xf54e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf54e('0x14'))(_0xf54e('0x15'));var utils=require(_0xf54e('0x16'));var config=require(_0xf54e('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x358c88,_0x4b0ee1){_0x4b0ee1=_0x4b0ee1||0xcc;return function(_0x4bd828){if(_0x4bd828){return _0x358c88[_0xf54e('0x18')](_0x4b0ee1);}return _0x358c88[_0xf54e('0x19')](_0x4b0ee1)[_0xf54e('0x1a')]();};}function respondWithResult(_0x380f26,_0x5644aa){_0x5644aa=_0x5644aa||0xc8;return function(_0x331732){if(_0x331732){return _0x380f26[_0xf54e('0x19')](_0x5644aa)[_0xf54e('0x1b')](_0x331732);}};}function respondWithFilteredResult(_0x15f639,_0x56828e){return function(_0x2366ee){if(_0x2366ee){var _0x389abc=_0x2366ee[_0xf54e('0x1c')],_0x3eb415=_0x56828e[_0xf54e('0x1d')],_0x5c5d00=_0x56828e[_0xf54e('0x1d')]+_0x56828e[_0xf54e('0x1e')],_0x4af633;if(_0x5c5d00>=_0x389abc){_0x5c5d00=_0x389abc;_0x4af633=0xc8;}else{_0x4af633=0xce;}_0x15f639[_0xf54e('0x19')](_0x4af633);return _0x15f639[_0xf54e('0x1f')](_0xf54e('0x20'),_0x3eb415+'-'+_0x5c5d00+'/'+_0x389abc)[_0xf54e('0x1b')](_0x2366ee);}return null;};}function patchUpdates(_0x1dcc04){return function(_0x4689fe){try{jsonpatch[_0xf54e('0x21')](_0x4689fe,_0x1dcc04,!![]);}catch(_0x50fc66){return BPromise['reject'](_0x50fc66);}return _0x4689fe[_0xf54e('0x22')]();};}function saveUpdates(_0x59f338,_0x3e1556){return function(_0x1bfe99){if(_0x1bfe99){return _0x1bfe99[_0xf54e('0x23')](_0x59f338)[_0xf54e('0x24')](function(_0xf64f12){return _0xf64f12;});}return null;};}function removeEntity(_0x3887b0,_0x388aa0){return function(_0x11985e){if(_0x11985e){return _0x11985e[_0xf54e('0x25')]()[_0xf54e('0x24')](function(){var _0x1c58bd=_0x11985e['get']({'plain':!![]});var _0x6f6d29='IvrCampaigns';return db[_0xf54e('0x26')][_0xf54e('0x25')]({'where':{'type':_0x6f6d29,'resourceId':_0x1c58bd['id']}})[_0xf54e('0x24')](function(){return _0x11985e;});})[_0xf54e('0x24')](function(){_0x3887b0[_0xf54e('0x19')](0xcc)[_0xf54e('0x1a')]();});}};}function handleEntityNotFound(_0x1e08d1,_0x43488d){return function(_0x2342a9){if(!_0x2342a9){_0x1e08d1[_0xf54e('0x18')](0x194);}return _0x2342a9;};}function handleError(_0xf6cdd7,_0x39c0ae){_0x39c0ae=_0x39c0ae||0x1f4;return function(_0x2ea001){logger['error'](_0x2ea001[_0xf54e('0x27')]);if(_0x2ea001['name']){delete _0x2ea001[_0xf54e('0x28')];}_0xf6cdd7['status'](_0x39c0ae)[_0xf54e('0x29')](_0x2ea001);};}exports[_0xf54e('0x2a')]=function(_0x21ba00,_0xa13cd0){var _0x25b643={},_0x3993e4={},_0x36f985={'count':0x0,'rows':[]};var _0x54bd8f=_['map'](db[_0xf54e('0x2b')][_0xf54e('0x2c')],function(_0x2ec92e){return{'name':_0x2ec92e[_0xf54e('0x2d')],'type':_0x2ec92e[_0xf54e('0x2e')][_0xf54e('0x2f')]};});_0x3993e4[_0xf54e('0x30')]=_[_0xf54e('0x31')](_0x54bd8f,_0xf54e('0x28'));_0x3993e4[_0xf54e('0x32')]=_['keys'](_0x21ba00['query']);_0x3993e4[_0xf54e('0x33')]=_[_0xf54e('0x34')](_0x3993e4['model'],_0x3993e4[_0xf54e('0x32')]);_0x25b643[_0xf54e('0x35')]=_[_0xf54e('0x34')](_0x3993e4[_0xf54e('0x30')],qs['fields'](_0x21ba00['query']['fields']));_0x25b643[_0xf54e('0x35')]=_0x25b643[_0xf54e('0x35')][_0xf54e('0x36')]?_0x25b643[_0xf54e('0x35')]:_0x3993e4[_0xf54e('0x30')];if(!_0x21ba00[_0xf54e('0x32')]['hasOwnProperty']('nolimit')){_0x25b643['limit']=qs[_0xf54e('0x1e')](_0x21ba00[_0xf54e('0x32')]['limit']);_0x25b643['offset']=qs[_0xf54e('0x1d')](_0x21ba00[_0xf54e('0x32')][_0xf54e('0x1d')]);}_0x25b643['order']=qs[_0xf54e('0x37')](_0x21ba00[_0xf54e('0x32')]['sort']);_0x25b643[_0xf54e('0x38')]=qs[_0xf54e('0x33')](_[_0xf54e('0x39')](_0x21ba00[_0xf54e('0x32')],_0x3993e4[_0xf54e('0x33')]));if(_0x21ba00[_0xf54e('0x32')]['filter']){_0x25b643['where']=_[_0xf54e('0x3a')](_0x25b643[_0xf54e('0x38')],{'$or':_[_0xf54e('0x31')](_0x54bd8f,function(_0x4b1f84){if(_0x4b1f84[_0xf54e('0x2e')]!==_0xf54e('0x3b')){var _0x448054={};_0x448054[_0x4b1f84[_0xf54e('0x28')]]={'$like':'%'+_0x21ba00[_0xf54e('0x32')][_0xf54e('0x3c')]+'%'};return _0x448054;}})});}_0x25b643=_[_0xf54e('0x3a')]({},_0x25b643,_0x21ba00[_0xf54e('0x3d')]);var _0x8b4c={'where':_0x25b643[_0xf54e('0x38')]};return db[_0xf54e('0x2b')][_0xf54e('0x1c')](_0x8b4c)[_0xf54e('0x24')](function(_0x2625fd){_0x36f985[_0xf54e('0x1c')]=_0x2625fd;if(_0x21ba00['query']['includeAll']){_0x25b643['include']=[{'all':!![]}];}return db[_0xf54e('0x2b')][_0xf54e('0x3e')](_0x25b643);})['then'](function(_0x3dae9b){_0x36f985[_0xf54e('0x3f')]=_0x3dae9b;return _0x36f985;})[_0xf54e('0x24')](respondWithFilteredResult(_0xa13cd0,_0x25b643))['catch'](handleError(_0xa13cd0,null));};exports[_0xf54e('0x40')]=function(_0x13d145,_0x1e016e){var _0x794be7={'raw':![],'where':{'id':_0x13d145[_0xf54e('0x41')]['id']}},_0x4b1931={};_0x4b1931[_0xf54e('0x30')]=_[_0xf54e('0x42')](db[_0xf54e('0x2b')]['rawAttributes']);_0x4b1931[_0xf54e('0x32')]=_[_0xf54e('0x42')](_0x13d145[_0xf54e('0x32')]);_0x4b1931[_0xf54e('0x33')]=_[_0xf54e('0x34')](_0x4b1931[_0xf54e('0x30')],_0x4b1931['query']);_0x794be7[_0xf54e('0x35')]=_['intersection'](_0x4b1931[_0xf54e('0x30')],qs['fields'](_0x13d145[_0xf54e('0x32')][_0xf54e('0x43')]));_0x794be7[_0xf54e('0x35')]=_0x794be7['attributes'][_0xf54e('0x36')]?_0x794be7[_0xf54e('0x35')]:_0x4b1931[_0xf54e('0x30')];if(_0x13d145[_0xf54e('0x32')][_0xf54e('0x44')]){_0x794be7['include']=[{'all':!![]}];}_0x794be7=_[_0xf54e('0x3a')]({},_0x794be7,_0x13d145[_0xf54e('0x3d')]);return db[_0xf54e('0x2b')][_0xf54e('0x45')](_0x794be7)['then'](handleEntityNotFound(_0x1e016e,null))[_0xf54e('0x24')](respondWithResult(_0x1e016e,null))[_0xf54e('0x46')](handleError(_0x1e016e,null));};exports['create']=function(_0x22c842,_0xd4d956){return db[_0xf54e('0x2b')][_0xf54e('0x47')](_0x22c842['body'],{})[_0xf54e('0x24')](function(_0x2b645e){var _0x2527f6=_0x22c842[_0xf54e('0x48')][_0xf54e('0x49')]({'plain':!![]});if(!_0x2527f6)throw new Error(_0xf54e('0x4a'));if(_0x2527f6[_0xf54e('0x4b')]===_0xf54e('0x48')){var _0x15bfef=_0x2b645e[_0xf54e('0x49')]({'plain':!![]});var _0xaf9bf0=_0xf54e('0x4c');return db[_0xf54e('0x4d')][_0xf54e('0x45')]({'where':{'name':_0xaf9bf0,'userProfileId':_0x2527f6[_0xf54e('0x4e')]},'raw':!![]})[_0xf54e('0x24')](function(_0x40d8ab){if(_0x40d8ab&&_0x40d8ab[_0xf54e('0x4f')]===0x0){return db[_0xf54e('0x26')][_0xf54e('0x47')]({'name':_0x15bfef['name'],'resourceId':_0x15bfef['id'],'type':_0x40d8ab['name'],'sectionId':_0x40d8ab['id']},{})[_0xf54e('0x24')](function(){return _0x2b645e;});}else{return _0x2b645e;}})[_0xf54e('0x46')](function(_0x45861b){logger[_0xf54e('0x50')](_0xf54e('0x51'),_0x45861b);throw _0x45861b;});}return _0x2b645e;})[_0xf54e('0x24')](respondWithResult(_0xd4d956,0xc9))[_0xf54e('0x46')](handleError(_0xd4d956,null));};exports[_0xf54e('0x52')]=function(_0x89b811,_0xdf63c4){var _0x1df308={'where':{'id':_0x89b811[_0xf54e('0x41')]['id']}},_0x59c313={};_0x59c313[_0xf54e('0x30')]=_[_0xf54e('0x42')](db[_0xf54e('0x2b')][_0xf54e('0x2c')]);_0x1df308[_0xf54e('0x35')]=_[_0xf54e('0x34')](_0x59c313['model'],qs[_0xf54e('0x43')](_0x89b811[_0xf54e('0x32')][_0xf54e('0x43')]));_0x1df308['attributes']=_0x1df308[_0xf54e('0x35')]['length']?_0x1df308[_0xf54e('0x35')]:_0x59c313[_0xf54e('0x30')];if(_0x89b811[_0xf54e('0x32')]['includeAll']){_0x1df308[_0xf54e('0x53')]=[{'all':!![]}];}_0x1df308=_[_0xf54e('0x3a')]({},_0x1df308,_0x89b811[_0xf54e('0x3d')]);return db[_0xf54e('0x2b')][_0xf54e('0x45')](_0x1df308)[_0xf54e('0x24')](handleEntityNotFound(_0xdf63c4,null))[_0xf54e('0x24')](function(_0x55d57f){if(_0x55d57f){var _0x55de5c=_0x55d57f[_0xf54e('0x49')]({'plain':!![]});_0x55de5c=qs[_0xf54e('0x54')](_0x55de5c,['id','createdAt',_0xf54e('0x55')]);_0x89b811['body']=_[_0xf54e('0x54')](_0x89b811['body'],['id',_0xf54e('0x56'),_0xf54e('0x55')]);return db[_0xf54e('0x2b')][_0xf54e('0x47')](_[_0xf54e('0x3a')](_0x55de5c,_0x89b811[_0xf54e('0x57')]),{'include':_0x89b811['query']['includeAll']?[{'all':!![]}]:undefined})[_0xf54e('0x24')](function(_0x2b273d){var _0x493011=_0x89b811['user'][_0xf54e('0x49')]({'plain':!![]});if(!_0x493011)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x493011[_0xf54e('0x4b')]===_0xf54e('0x48')){var _0x47596c=_0x2b273d[_0xf54e('0x49')]({'plain':!![]});var _0x1d7c52=_0xf54e('0x4c');return db[_0xf54e('0x4d')][_0xf54e('0x45')]({'where':{'name':_0x1d7c52,'userProfileId':_0x493011[_0xf54e('0x4e')]},'raw':!![]})[_0xf54e('0x24')](function(_0x1f9dad){if(_0x1f9dad&&_0x1f9dad[_0xf54e('0x4f')]===0x0){return db[_0xf54e('0x26')][_0xf54e('0x47')]({'name':_0x47596c['name'],'resourceId':_0x47596c['id'],'type':_0x1f9dad[_0xf54e('0x28')],'sectionId':_0x1f9dad['id']},{})[_0xf54e('0x24')](function(){return _0x2b273d;});}else{return _0x2b273d;}})[_0xf54e('0x46')](function(_0x11908b){logger[_0xf54e('0x50')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x11908b);throw _0x11908b;});}return _0x2b273d;});}})[_0xf54e('0x24')](respondWithResult(_0xdf63c4,0xc9))[_0xf54e('0x46')](handleError(_0xdf63c4,null));};exports['update']=function(_0x51ec35,_0x2818cf){if(_0x51ec35['body']['id']){delete _0x51ec35[_0xf54e('0x57')]['id'];}return db[_0xf54e('0x2b')][_0xf54e('0x45')]({'where':{'id':_0x51ec35[_0xf54e('0x41')]['id']}})['then'](handleEntityNotFound(_0x2818cf,null))[_0xf54e('0x24')](saveUpdates(_0x51ec35['body'],null))[_0xf54e('0x24')](respondWithResult(_0x2818cf,null))[_0xf54e('0x46')](handleError(_0x2818cf,null));};exports[_0xf54e('0x25')]=function(_0x5de2f5,_0x2d04db){return db['Campaign'][_0xf54e('0x45')]({'where':{'id':_0x5de2f5[_0xf54e('0x41')]['id']}})['then'](handleEntityNotFound(_0x2d04db,null))[_0xf54e('0x24')](removeEntity(_0x2d04db,null))['catch'](handleError(_0x2d04db,null));};exports[_0xf54e('0x58')]=function(_0x2df028,_0x33acd3,_0x38405c){var _0x21159f={'raw':!![],'where':{}};var _0x54ee29={};var _0x3a9dd7={'count':0x0,'rows':[]};return db[_0xf54e('0x2b')]['findOne']({'where':{'id':_0x2df028[_0xf54e('0x41')]['id']}})[_0xf54e('0x24')](handleEntityNotFound(_0x33acd3,null))['then'](function(_0x8e7a38){if(_0x8e7a38){_0x54ee29[_0xf54e('0x30')]=_[_0xf54e('0x42')](db['CmHopper'][_0xf54e('0x2c')]);_0x54ee29['query']=_[_0xf54e('0x42')](_0x2df028[_0xf54e('0x32')]);_0x54ee29['filters']=_[_0xf54e('0x34')](_0x54ee29[_0xf54e('0x30')],_0x54ee29[_0xf54e('0x32')]);_0x21159f[_0xf54e('0x35')]=_[_0xf54e('0x34')](_0x54ee29[_0xf54e('0x30')],qs[_0xf54e('0x43')](_0x2df028[_0xf54e('0x32')][_0xf54e('0x43')]));_0x21159f[_0xf54e('0x35')]=_0x21159f[_0xf54e('0x35')]['length']?_0x21159f[_0xf54e('0x35')]:_0x54ee29[_0xf54e('0x30')];if(!_0x2df028[_0xf54e('0x32')]['hasOwnProperty'](_0xf54e('0x59'))){_0x21159f[_0xf54e('0x1e')]=qs[_0xf54e('0x1e')](_0x2df028[_0xf54e('0x32')][_0xf54e('0x1e')]);_0x21159f[_0xf54e('0x1d')]=qs[_0xf54e('0x1d')](_0x2df028['query'][_0xf54e('0x1d')]);}_0x21159f[_0xf54e('0x5a')]=qs[_0xf54e('0x37')](_0x2df028['query'][_0xf54e('0x37')]);_0x21159f[_0xf54e('0x38')]=qs[_0xf54e('0x33')](_[_0xf54e('0x39')](_0x2df028['query'],_0x54ee29['filters']));_0x21159f[_0xf54e('0x38')][_0xf54e('0x5b')]=_0x8e7a38['id'];if(_0x2df028[_0xf54e('0x32')][_0xf54e('0x3c')]){_0x21159f[_0xf54e('0x38')]=_[_0xf54e('0x3a')](_0x21159f[_0xf54e('0x38')],{'$or':_[_0xf54e('0x31')](_0x21159f[_0xf54e('0x35')],function(_0x205b47){var _0x4e6f8f={};_0x4e6f8f[_0x205b47]={'$like':'%'+_0x2df028[_0xf54e('0x32')][_0xf54e('0x3c')]+'%'};return _0x4e6f8f;})});}_0x21159f=_[_0xf54e('0x3a')]({},_0x21159f,_0x2df028[_0xf54e('0x3d')]);return db['CmHopper'][_0xf54e('0x1c')]({'where':_0x21159f[_0xf54e('0x38')]})[_0xf54e('0x24')](function(_0x213206){_0x3a9dd7['count']=_0x213206;if(_0x2df028[_0xf54e('0x32')][_0xf54e('0x44')]){_0x21159f[_0xf54e('0x53')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x21159f);})[_0xf54e('0x24')](function(_0x1a5a77){_0x3a9dd7[_0xf54e('0x3f')]=_0x1a5a77;return _0x3a9dd7;});}})[_0xf54e('0x24')](respondWithFilteredResult(_0x33acd3,_0x21159f))[_0xf54e('0x46')](handleError(_0x33acd3,null));};exports[_0xf54e('0x5c')]=function(_0x2b42f5,_0x824202,_0x8093bc){var _0x4adf60={'raw':!![],'where':{}};var _0xa5de47={};var _0x3edfa0={'count':0x0,'rows':[]};return db[_0xf54e('0x2b')][_0xf54e('0x5d')]({'where':{'id':_0x2b42f5[_0xf54e('0x41')]['id']}})[_0xf54e('0x24')](handleEntityNotFound(_0x824202,null))[_0xf54e('0x24')](function(_0x9a8f4f){if(_0x9a8f4f){_0xa5de47[_0xf54e('0x30')]=_[_0xf54e('0x42')](db[_0xf54e('0x5e')][_0xf54e('0x2c')]);_0xa5de47['query']=_[_0xf54e('0x42')](_0x2b42f5[_0xf54e('0x32')]);_0xa5de47['filters']=_['intersection'](_0xa5de47[_0xf54e('0x30')],_0xa5de47[_0xf54e('0x32')]);_0x4adf60[_0xf54e('0x35')]=_[_0xf54e('0x34')](_0xa5de47[_0xf54e('0x30')],qs[_0xf54e('0x43')](_0x2b42f5[_0xf54e('0x32')][_0xf54e('0x43')]));_0x4adf60[_0xf54e('0x35')]=_0x4adf60['attributes'][_0xf54e('0x36')]?_0x4adf60[_0xf54e('0x35')]:_0xa5de47[_0xf54e('0x30')];if(!_0x2b42f5['query'][_0xf54e('0x5f')]('nolimit')){_0x4adf60[_0xf54e('0x1e')]=qs['limit'](_0x2b42f5[_0xf54e('0x32')][_0xf54e('0x1e')]);_0x4adf60['offset']=qs['offset'](_0x2b42f5[_0xf54e('0x32')][_0xf54e('0x1d')]);}_0x4adf60[_0xf54e('0x5a')]=qs[_0xf54e('0x37')](_0x2b42f5[_0xf54e('0x32')]['sort']);_0x4adf60['where']=qs[_0xf54e('0x33')](_[_0xf54e('0x39')](_0x2b42f5[_0xf54e('0x32')],_0xa5de47[_0xf54e('0x33')]));_0x4adf60[_0xf54e('0x38')][_0xf54e('0x5b')]=_0x9a8f4f['id'];if(_0x2b42f5[_0xf54e('0x32')][_0xf54e('0x3c')]){_0x4adf60[_0xf54e('0x38')]=_[_0xf54e('0x3a')](_0x4adf60['where'],{'$or':_[_0xf54e('0x31')](_0x4adf60[_0xf54e('0x35')],function(_0x4d4667){var _0x4fd274={};_0x4fd274[_0x4d4667]={'$like':'%'+_0x2b42f5[_0xf54e('0x32')][_0xf54e('0x3c')]+'%'};return _0x4fd274;})});}_0x4adf60=_[_0xf54e('0x3a')]({},_0x4adf60,_0x2b42f5[_0xf54e('0x3d')]);return db[_0xf54e('0x5e')]['count']({'where':_0x4adf60[_0xf54e('0x38')]})[_0xf54e('0x24')](function(_0xd631af){_0x3edfa0[_0xf54e('0x1c')]=_0xd631af;if(_0x2b42f5['query'][_0xf54e('0x44')]){_0x4adf60[_0xf54e('0x53')]=[{'all':!![]}];}return db[_0xf54e('0x5e')][_0xf54e('0x3e')](_0x4adf60);})['then'](function(_0x289946){_0x3edfa0[_0xf54e('0x3f')]=_0x289946;return _0x3edfa0;});}})[_0xf54e('0x24')](respondWithFilteredResult(_0x824202,_0x4adf60))[_0xf54e('0x46')](handleError(_0x824202,null));};exports[_0xf54e('0x60')]=function(_0x4daac7,_0x2cb0cd,_0x536202){var _0x54cb92={'raw':!![],'where':{}};var _0x963253={};var _0x2d3d16={'count':0x0,'rows':[]};return db[_0xf54e('0x2b')][_0xf54e('0x5d')]({'where':{'id':_0x4daac7[_0xf54e('0x41')]['id']}})[_0xf54e('0x24')](handleEntityNotFound(_0x2cb0cd,null))[_0xf54e('0x24')](function(_0x7ad573){if(_0x7ad573){_0x963253[_0xf54e('0x30')]=_['keys'](db[_0xf54e('0x61')][_0xf54e('0x2c')]);_0x963253[_0xf54e('0x32')]=_[_0xf54e('0x42')](_0x4daac7[_0xf54e('0x32')]);_0x963253[_0xf54e('0x33')]=_['intersection'](_0x963253[_0xf54e('0x30')],_0x963253[_0xf54e('0x32')]);_0x54cb92[_0xf54e('0x35')]=_[_0xf54e('0x34')](_0x963253[_0xf54e('0x30')],qs[_0xf54e('0x43')](_0x4daac7['query'][_0xf54e('0x43')]));_0x54cb92[_0xf54e('0x35')]=_0x54cb92[_0xf54e('0x35')][_0xf54e('0x36')]?_0x54cb92['attributes']:_0x963253['model'];if(!_0x4daac7[_0xf54e('0x32')][_0xf54e('0x5f')](_0xf54e('0x59'))){_0x54cb92[_0xf54e('0x1e')]=qs[_0xf54e('0x1e')](_0x4daac7[_0xf54e('0x32')]['limit']);_0x54cb92[_0xf54e('0x1d')]=qs[_0xf54e('0x1d')](_0x4daac7[_0xf54e('0x32')][_0xf54e('0x1d')]);}_0x54cb92[_0xf54e('0x5a')]=qs[_0xf54e('0x37')](_0x4daac7['query'][_0xf54e('0x37')]);_0x54cb92['where']=qs[_0xf54e('0x33')](_['pick'](_0x4daac7[_0xf54e('0x32')],_0x963253[_0xf54e('0x33')]));_0x54cb92[_0xf54e('0x38')][_0xf54e('0x5b')]=_0x7ad573['id'];if(_0x4daac7[_0xf54e('0x32')]['filter']){_0x54cb92[_0xf54e('0x38')]=_[_0xf54e('0x3a')](_0x54cb92['where'],{'$or':_[_0xf54e('0x31')](_0x54cb92[_0xf54e('0x35')],function(_0x42dc85){var _0x3e646d={};_0x3e646d[_0x42dc85]={'$like':'%'+_0x4daac7['query'][_0xf54e('0x3c')]+'%'};return _0x3e646d;})});}_0x54cb92=_[_0xf54e('0x3a')]({},_0x54cb92,_0x4daac7['options']);return db[_0xf54e('0x61')]['count']({'where':_0x54cb92['where']})[_0xf54e('0x24')](function(_0x51910e){_0x2d3d16[_0xf54e('0x1c')]=_0x51910e;if(_0x4daac7[_0xf54e('0x32')][_0xf54e('0x44')]){_0x54cb92[_0xf54e('0x53')]=[{'all':!![]}];}return db[_0xf54e('0x61')]['findAll'](_0x54cb92);})[_0xf54e('0x24')](function(_0x351239){_0x2d3d16[_0xf54e('0x3f')]=_0x351239;return _0x2d3d16;});}})[_0xf54e('0x24')](respondWithFilteredResult(_0x2cb0cd,_0x54cb92))['catch'](handleError(_0x2cb0cd,null));};exports[_0xf54e('0x62')]=function(_0x52d9fa,_0x1da57f,_0x1e6414){var _0x4cfa3f={'raw':!![],'where':{}};var _0x236f93={};var _0xe0a229={'count':0x0,'rows':[]};return db[_0xf54e('0x2b')][_0xf54e('0x5d')]({'where':{'id':_0x52d9fa['params']['id']}})[_0xf54e('0x24')](handleEntityNotFound(_0x1da57f,null))[_0xf54e('0x24')](function(_0x72535e){if(_0x72535e){_0x236f93['model']=_['keys'](db[_0xf54e('0x63')]['rawAttributes']);_0x236f93['query']=_['keys'](_0x52d9fa[_0xf54e('0x32')]);_0x236f93[_0xf54e('0x33')]=_[_0xf54e('0x34')](_0x236f93[_0xf54e('0x30')],_0x236f93[_0xf54e('0x32')]);_0x4cfa3f[_0xf54e('0x35')]=_[_0xf54e('0x34')](_0x236f93[_0xf54e('0x30')],qs[_0xf54e('0x43')](_0x52d9fa['query'][_0xf54e('0x43')]));_0x4cfa3f['attributes']=_0x4cfa3f[_0xf54e('0x35')][_0xf54e('0x36')]?_0x4cfa3f['attributes']:_0x236f93[_0xf54e('0x30')];if(!_0x52d9fa['query'][_0xf54e('0x5f')](_0xf54e('0x59'))){_0x4cfa3f[_0xf54e('0x1e')]=qs[_0xf54e('0x1e')](_0x52d9fa[_0xf54e('0x32')][_0xf54e('0x1e')]);_0x4cfa3f['offset']=qs['offset'](_0x52d9fa['query'][_0xf54e('0x1d')]);}_0x4cfa3f['order']=qs[_0xf54e('0x37')](_0x52d9fa[_0xf54e('0x32')][_0xf54e('0x37')]);_0x4cfa3f[_0xf54e('0x38')]=qs[_0xf54e('0x33')](_['pick'](_0x52d9fa[_0xf54e('0x32')],_0x236f93[_0xf54e('0x33')]));_0x4cfa3f[_0xf54e('0x38')][_0xf54e('0x5b')]=_0x72535e['id'];if(_0x52d9fa[_0xf54e('0x32')][_0xf54e('0x3c')]){_0x4cfa3f['where']=_[_0xf54e('0x3a')](_0x4cfa3f[_0xf54e('0x38')],{'$or':_[_0xf54e('0x31')](_0x4cfa3f[_0xf54e('0x35')],function(_0x1a80ff){var _0x516eeb={};_0x516eeb[_0x1a80ff]={'$like':'%'+_0x52d9fa[_0xf54e('0x32')][_0xf54e('0x3c')]+'%'};return _0x516eeb;})});}_0x4cfa3f=_[_0xf54e('0x3a')]({},_0x4cfa3f,_0x52d9fa[_0xf54e('0x3d')]);return db[_0xf54e('0x63')][_0xf54e('0x1c')]({'where':_0x4cfa3f[_0xf54e('0x38')]})[_0xf54e('0x24')](function(_0x2e42f7){_0xe0a229['count']=_0x2e42f7;if(_0x52d9fa[_0xf54e('0x32')][_0xf54e('0x44')]){_0x4cfa3f['include']=[{'all':!![]}];}return db['CmHopperBlack'][_0xf54e('0x3e')](_0x4cfa3f);})['then'](function(_0x40bf28){_0xe0a229[_0xf54e('0x3f')]=_0x40bf28;return _0xe0a229;});}})[_0xf54e('0x24')](respondWithFilteredResult(_0x1da57f,_0x4cfa3f))[_0xf54e('0x46')](handleError(_0x1da57f,null));};exports['getLists']=function(_0x406140,_0x3c4a66,_0x59fb9a){var _0x90ad88={};var _0x3797bf={};var _0x1ac57a;var _0x458450;return db[_0xf54e('0x2b')][_0xf54e('0x5d')]({'where':{'id':_0x406140[_0xf54e('0x41')]['id']}})[_0xf54e('0x24')](handleEntityNotFound(_0x3c4a66,null))[_0xf54e('0x24')](function(_0x3634bc){if(_0x3634bc){_0x1ac57a=_0x3634bc;_0x3797bf[_0xf54e('0x30')]=_['keys'](db['CmList'][_0xf54e('0x2c')]);_0x3797bf[_0xf54e('0x32')]=_[_0xf54e('0x42')](_0x406140[_0xf54e('0x32')]);_0x3797bf[_0xf54e('0x33')]=_['intersection'](_0x3797bf[_0xf54e('0x30')],_0x3797bf[_0xf54e('0x32')]);_0x90ad88[_0xf54e('0x35')]=_[_0xf54e('0x34')](_0x3797bf['model'],qs[_0xf54e('0x43')](_0x406140[_0xf54e('0x32')][_0xf54e('0x43')]));_0x90ad88[_0xf54e('0x35')]=_0x90ad88[_0xf54e('0x35')][_0xf54e('0x36')]?_0x90ad88[_0xf54e('0x35')]:_0x3797bf[_0xf54e('0x30')];_0x90ad88[_0xf54e('0x5a')]=qs[_0xf54e('0x37')](_0x406140[_0xf54e('0x32')][_0xf54e('0x37')]);_0x90ad88[_0xf54e('0x38')]=qs[_0xf54e('0x33')](_['pick'](_0x406140[_0xf54e('0x32')],_0x3797bf['filters']));if(_0x406140['query'][_0xf54e('0x3c')]){_0x90ad88[_0xf54e('0x38')]=_[_0xf54e('0x3a')](_0x90ad88[_0xf54e('0x38')],{'$or':_[_0xf54e('0x31')](_0x90ad88[_0xf54e('0x35')],function(_0x396f98){var _0x113020={};_0x113020[_0x396f98]={'$like':'%'+_0x406140[_0xf54e('0x32')][_0xf54e('0x3c')]+'%'};return _0x113020;})});}_0x90ad88=_[_0xf54e('0x3a')]({},_0x90ad88,_0x406140[_0xf54e('0x3d')]);return _0x1ac57a[_0xf54e('0x64')](_0x90ad88);}})['then'](function(_0x3ff4a5){if(_0x3ff4a5){_0x458450=_0x3ff4a5[_0xf54e('0x36')];if(!_0x406140[_0xf54e('0x32')][_0xf54e('0x5f')](_0xf54e('0x59'))){_0x90ad88['limit']=qs['limit'](_0x406140[_0xf54e('0x32')][_0xf54e('0x1e')]);_0x90ad88['offset']=qs['offset'](_0x406140[_0xf54e('0x32')]['offset']);}return _0x1ac57a[_0xf54e('0x64')](_0x90ad88);}})[_0xf54e('0x24')](function(_0x6e09bf){if(_0x6e09bf){return _0x6e09bf?{'count':_0x458450,'rows':_0x6e09bf}:null;}})[_0xf54e('0x24')](respondWithResult(_0x3c4a66,null))[_0xf54e('0x46')](handleError(_0x3c4a66,null));};exports[_0xf54e('0x65')]=function(_0x50bff9,_0x39fc7d,_0x2e0cf9){var _0x5cf1e4,_0x3fc819;return db[_0xf54e('0x2b')]['find']({'where':{'id':_0x50bff9[_0xf54e('0x41')]['id']}})[_0xf54e('0x24')](handleEntityNotFound(_0x39fc7d,null))[_0xf54e('0x24')](function(_0x54efa9){if(_0x54efa9){_0x3fc819=_0x54efa9;return _0x54efa9['addLists'](_0x50bff9[_0xf54e('0x57')][_0xf54e('0x66')],_['omit'](_0x50bff9['body'],['ids','id'])||{});}return null;})[_0xf54e('0x67')](function(_0x32b55f){var _0x11fb0c;_0x5cf1e4=_0x32b55f||[];var _0x5072aa=[];if(_0x32b55f){for(var _0x187b1c=0x0;_0x187b1c<_0x32b55f[_0xf54e('0x36')];_0x187b1c+=0x1){var _0x28d019=_0x32b55f[_0x187b1c][_0xf54e('0x49')]({'plain':!![]});_0x3fc819[_0xf54e('0x68')]=_0x50bff9['body']['dialCheckDuplicateType']?_0x50bff9['body']['dialCheckDuplicateType']:_0x3fc819['dialCheckDuplicateType'];switch(_0x3fc819[_0xf54e('0x68')]){case'always':_0x11fb0c=squel[_0xf54e('0x69')]()[_0xf54e('0x6a')]('cm_hopper')[_0xf54e('0x6b')](['phone',_0xf54e('0x6c'),_0xf54e('0x6d'),_0xf54e('0x6e'),_0xf54e('0x5b'),_0xf54e('0x56'),_0xf54e('0x55')],squel[_0xf54e('0x6f')]()['field'](_0xf54e('0x70'),_0xf54e('0x70'))[_0xf54e('0x71')](_0xf54e('0x72'),_0xf54e('0x6c'))['field']('id',_0xf54e('0x6d'))[_0xf54e('0x71')](_0x28d019[_0xf54e('0x73')][_0xf54e('0x74')](),_0xf54e('0x6e'))[_0xf54e('0x71')](_0x50bff9['params']['id']['toString'](),'CampaignId')[_0xf54e('0x71')](_0xf54e('0x72'),_0xf54e('0x56'))[_0xf54e('0x71')](_0xf54e('0x72'),'updatedAt')[_0xf54e('0x75')](_0xf54e('0x76'))['where'](_0xf54e('0x77'))[_0xf54e('0x38')](_0xf54e('0x78'),_0x28d019['CmListId'][_0xf54e('0x74')]())[_0xf54e('0x38')](_0xf54e('0x79'))[_0xf54e('0x38')](_0xf54e('0x7a'),squel[_0xf54e('0x6f')]()[_0xf54e('0x71')](_0xf54e('0x7b'))['from'](_0xf54e('0x7c'))['where'](_0xf54e('0x7d'),_0x50bff9[_0xf54e('0x41')]['id'][_0xf54e('0x74')]()))[_0xf54e('0x38')](_0xf54e('0x7a'),squel[_0xf54e('0x6f')]()[_0xf54e('0x71')]('COALESCE(phone,\x27\x27)')['from']('cm_hopper')[_0xf54e('0x38')]('CampaignId\x20=\x20?',_0x50bff9[_0xf54e('0x41')]['id']['toString']())))[_0xf54e('0x74')]();break;case _0xf54e('0x7e'):_0x11fb0c=squel['insert']()[_0xf54e('0x6a')](_0xf54e('0x7f'))[_0xf54e('0x6b')]([_0xf54e('0x70'),_0xf54e('0x6c'),_0xf54e('0x6d'),_0xf54e('0x6e'),_0xf54e('0x5b'),_0xf54e('0x56'),_0xf54e('0x55')],squel[_0xf54e('0x6f')]()['field'](_0xf54e('0x70'),_0xf54e('0x70'))[_0xf54e('0x71')]('NOW()',_0xf54e('0x6c'))['field']('id',_0xf54e('0x6d'))[_0xf54e('0x71')](_0x28d019[_0xf54e('0x73')][_0xf54e('0x74')](),_0xf54e('0x6e'))[_0xf54e('0x71')](_0x50bff9[_0xf54e('0x41')]['id'][_0xf54e('0x74')](),_0xf54e('0x5b'))[_0xf54e('0x71')](_0xf54e('0x72'),'createdAt')['field']('NOW()',_0xf54e('0x55'))[_0xf54e('0x75')](_0xf54e('0x76'))['where'](_0xf54e('0x77'))[_0xf54e('0x38')]('ListId\x20=\x20?',_0x28d019[_0xf54e('0x73')][_0xf54e('0x74')]())[_0xf54e('0x38')](_0xf54e('0x79'))[_0xf54e('0x38')](_0xf54e('0x7a'),squel[_0xf54e('0x6f')]()['field']('COALESCE(phone,\x27\x27)')[_0xf54e('0x75')](_0xf54e('0x7f'))[_0xf54e('0x38')](_0xf54e('0x7d'),_0x50bff9['params']['id'][_0xf54e('0x74')]())))[_0xf54e('0x74')]();break;default:_0x11fb0c=squel['insert']()[_0xf54e('0x6a')]('cm_hopper')[_0xf54e('0x6b')]([_0xf54e('0x70'),_0xf54e('0x6c'),_0xf54e('0x6d'),'ListId',_0xf54e('0x5b'),'createdAt',_0xf54e('0x55')],squel[_0xf54e('0x6f')]()[_0xf54e('0x71')](_0xf54e('0x70'),'phone')['field'](_0xf54e('0x72'),_0xf54e('0x6c'))[_0xf54e('0x71')]('id','ContactId')[_0xf54e('0x71')](_0x28d019[_0xf54e('0x73')]['toString'](),_0xf54e('0x6e'))[_0xf54e('0x71')](_0x50bff9[_0xf54e('0x41')]['id'][_0xf54e('0x74')](),_0xf54e('0x5b'))[_0xf54e('0x71')]('NOW()',_0xf54e('0x56'))[_0xf54e('0x71')](_0xf54e('0x72'),_0xf54e('0x55'))[_0xf54e('0x75')](_0xf54e('0x76'))[_0xf54e('0x38')](_0xf54e('0x77'))[_0xf54e('0x38')](_0xf54e('0x78'),_0x28d019[_0xf54e('0x73')][_0xf54e('0x74')]())[_0xf54e('0x38')](_0xf54e('0x79')))[_0xf54e('0x74')]();}_0x5072aa[_0xf54e('0x80')](db[_0xf54e('0x81')]['query'](_0x11fb0c));}return BPromise[_0xf54e('0x82')](_0x5072aa);}})[_0xf54e('0x24')](function(){return _0x5cf1e4;})[_0xf54e('0x24')](respondWithResult(_0x39fc7d,null))['catch'](handleError(_0x39fc7d,null));};exports[_0xf54e('0x83')]=function(_0x3b3d45,_0x40aae0,_0x2f90de){return db[_0xf54e('0x2b')]['find']({'where':{'id':_0x3b3d45[_0xf54e('0x41')]['id']}})['then'](handleEntityNotFound(_0x40aae0,null))[_0xf54e('0x24')](function(_0xa70512){if(_0xa70512){return _0xa70512['removeLists'](_0x3b3d45[_0xf54e('0x32')][_0xf54e('0x66')]);}})[_0xf54e('0x24')](function(_0x4026ea){if(_0x4026ea){return db[_0xf54e('0x84')][_0xf54e('0x25')]({'where':{'ListId':_0x3b3d45[_0xf54e('0x32')][_0xf54e('0x66')],'CampaignId':_0x3b3d45[_0xf54e('0x41')]['id']}})['then'](function(){return _0x4026ea;});}})[_0xf54e('0x24')](respondWithStatusCode(_0x40aae0,null))['catch'](handleError(_0x40aae0,null));};exports[_0xf54e('0x85')]=function(_0x380881,_0x54869f,_0x15184a){var _0x54c75b={'raw':!![],'where':{}};var _0x3da876={};var _0x826b2f={'count':0x0,'rows':[]};return db['Campaign'][_0xf54e('0x5d')]({'where':{'id':_0x380881[_0xf54e('0x41')]['id']}})['then'](handleEntityNotFound(_0x54869f,null))['then'](function(_0x526f27){if(_0x526f27){_0x3da876[_0xf54e('0x30')]=_[_0xf54e('0x42')](db[_0xf54e('0x86')][_0xf54e('0x2c')]);_0x3da876[_0xf54e('0x32')]=_[_0xf54e('0x42')](_0x380881[_0xf54e('0x32')]);_0x3da876[_0xf54e('0x33')]=_['intersection'](_0x3da876['model'],_0x3da876[_0xf54e('0x32')]);_0x54c75b[_0xf54e('0x35')]=_[_0xf54e('0x34')](_0x3da876[_0xf54e('0x30')],qs[_0xf54e('0x43')](_0x380881['query'][_0xf54e('0x43')]));_0x54c75b['attributes']=_0x54c75b['attributes'][_0xf54e('0x36')]?_0x54c75b[_0xf54e('0x35')]:_0x3da876[_0xf54e('0x30')];if(!_0x380881[_0xf54e('0x32')][_0xf54e('0x5f')](_0xf54e('0x59'))){_0x54c75b[_0xf54e('0x1e')]=qs['limit'](_0x380881[_0xf54e('0x32')][_0xf54e('0x1e')]);_0x54c75b[_0xf54e('0x1d')]=qs[_0xf54e('0x1d')](_0x380881[_0xf54e('0x32')]['offset']);}_0x54c75b[_0xf54e('0x5a')]=qs[_0xf54e('0x37')](_0x380881[_0xf54e('0x32')][_0xf54e('0x37')]);_0x54c75b[_0xf54e('0x38')]=qs['filters'](_['pick'](_0x380881[_0xf54e('0x32')],_0x3da876[_0xf54e('0x33')]));_0x54c75b[_0xf54e('0x38')]['CampaignId']=_0x526f27['id'];if(_0x380881[_0xf54e('0x32')][_0xf54e('0x3c')]){_0x54c75b[_0xf54e('0x38')]=_[_0xf54e('0x3a')](_0x54c75b['where'],{'$or':_[_0xf54e('0x31')](_0x54c75b[_0xf54e('0x35')],function(_0x3219be){var _0x4b3de5={};_0x4b3de5[_0x3219be]={'$like':'%'+_0x380881[_0xf54e('0x32')][_0xf54e('0x3c')]+'%'};return _0x4b3de5;})});}_0x54c75b=_[_0xf54e('0x3a')]({},_0x54c75b,_0x380881[_0xf54e('0x3d')]);return db[_0xf54e('0x86')][_0xf54e('0x1c')]({'where':_0x54c75b[_0xf54e('0x38')]})[_0xf54e('0x24')](function(_0x51b684){_0x826b2f[_0xf54e('0x1c')]=_0x51b684;if(_0x380881[_0xf54e('0x32')][_0xf54e('0x44')]){_0x54c75b[_0xf54e('0x53')]=[{'all':!![]}];}return db['CmList']['findAll'](_0x54c75b);})['then'](function(_0x4b96cb){_0x826b2f[_0xf54e('0x3f')]=_0x4b96cb;return _0x826b2f;});}})[_0xf54e('0x24')](respondWithFilteredResult(_0x54869f,_0x54c75b))[_0xf54e('0x46')](handleError(_0x54869f,null));};exports['addBlackLists']=function(_0x5a84b8,_0xd82fad,_0x5debcf){var _0x21319b,_0x59f6fc;return db[_0xf54e('0x2b')][_0xf54e('0x45')]({'where':{'id':_0x5a84b8[_0xf54e('0x41')]['id']}})['then'](handleEntityNotFound(_0xd82fad,null))[_0xf54e('0x24')](function(_0x260b7a){if(_0x260b7a){_0x59f6fc=_0x260b7a;return _0x260b7a[_0xf54e('0x87')](_0x5a84b8[_0xf54e('0x57')]['ids'],_[_0xf54e('0x54')](_0x5a84b8[_0xf54e('0x57')],[_0xf54e('0x66'),'id'])||{});}return null;})[_0xf54e('0x67')](function(_0x20947f){var _0x4713cf;_0x21319b=_0x20947f||[];var _0x57f6af=[];if(_0x20947f){for(var _0x31e4c1=0x0;_0x31e4c1<_0x20947f['length'];_0x31e4c1+=0x1){var _0x4d406a=_0x20947f[_0x31e4c1][_0xf54e('0x49')]({'plain':!![]});_0x4713cf=squel['insert']()[_0xf54e('0x6a')](_0xf54e('0x88'))['fromQuery'](['phone',_0xf54e('0x6d'),'ListId',_0xf54e('0x5b'),_0xf54e('0x56'),'updatedAt'],squel[_0xf54e('0x6f')]()['field'](_0xf54e('0x70'),_0xf54e('0x70'))['field']('id',_0xf54e('0x6d'))[_0xf54e('0x71')](_0x4d406a[_0xf54e('0x73')][_0xf54e('0x74')](),_0xf54e('0x6e'))[_0xf54e('0x71')](_0x5a84b8[_0xf54e('0x41')]['id'][_0xf54e('0x74')](),_0xf54e('0x5b'))['field']('NOW()',_0xf54e('0x56'))[_0xf54e('0x71')](_0xf54e('0x72'),_0xf54e('0x55'))['from'](_0xf54e('0x76'))[_0xf54e('0x38')]('deletedAt\x20IS\x20NULL')[_0xf54e('0x38')](_0xf54e('0x78'),_0x4d406a[_0xf54e('0x73')][_0xf54e('0x74')]())[_0xf54e('0x38')](_0xf54e('0x79')))[_0xf54e('0x74')]();_0x57f6af[_0xf54e('0x80')](db[_0xf54e('0x81')][_0xf54e('0x32')](_0x4713cf));}return BPromise[_0xf54e('0x82')](_0x57f6af);}})['then'](function(){return _0x21319b;})['then'](respondWithResult(_0xd82fad,null))[_0xf54e('0x46')](handleError(_0xd82fad,null));};exports[_0xf54e('0x89')]=function(_0x30327d,_0x26a904,_0x20f555){return db[_0xf54e('0x2b')]['find']({'where':{'id':_0x30327d[_0xf54e('0x41')]['id']}})[_0xf54e('0x24')](handleEntityNotFound(_0x26a904,null))['then'](function(_0x410b61){if(_0x410b61){return _0x410b61[_0xf54e('0x89')](_0x30327d[_0xf54e('0x32')][_0xf54e('0x66')]);}})['then'](function(_0x55f815){if(_0x55f815){return db[_0xf54e('0x63')][_0xf54e('0x25')]({'where':{'ListId':_0x30327d[_0xf54e('0x32')][_0xf54e('0x66')],'CampaignId':_0x30327d['params']['id']}})['then'](function(){return _0x55f815;});}})[_0xf54e('0x24')](respondWithStatusCode(_0x26a904,null))[_0xf54e('0x46')](handleError(_0x26a904,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 15eba8e..752aa11 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 _0x3bb2=['exports','Campaign','campaigns','util','../../config/logger','moment','bluebird','request-promise','rimraf','./campaign.attributes'];(function(_0x4e51f8,_0x323ff2){var _0x1edd69=function(_0x14730f){while(--_0x14730f){_0x4e51f8['push'](_0x4e51f8['shift']());}};_0x1edd69(++_0x323ff2);}(_0x3bb2,0x1bb));var _0x23bb=function(_0x523191,_0x2a654c){_0x523191=_0x523191-0x0;var _0x30a906=_0x3bb2[_0x523191];return _0x30a906;};'use strict';var _=require('lodash');var util=require(_0x23bb('0x0'));var logger=require(_0x23bb('0x1'))('api');var moment=require(_0x23bb('0x2'));var BPromise=require(_0x23bb('0x3'));var rp=require(_0x23bb('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x23bb('0x5'));var config=require('../../config/environment');var attributes=require(_0x23bb('0x6'));module[_0x23bb('0x7')]=function(_0x588d07,_0x45c16e){return _0x588d07['define'](_0x23bb('0x8'),attributes,{'tableName':_0x23bb('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcdff=['lodash','util','request-promise','path','../../config/environment','./campaign.attributes','exports','Campaign','campaigns'];(function(_0x3d148d,_0x1b2fb7){var _0x1dcce2=function(_0x3670ce){while(--_0x3670ce){_0x3d148d['push'](_0x3d148d['shift']());}};_0x1dcce2(++_0x1b2fb7);}(_0xcdff,0x1d4));var _0xfcdf=function(_0x12f12c,_0x53e294){_0x12f12c=_0x12f12c-0x0;var _0x480ed0=_0xcdff[_0x12f12c];return _0x480ed0;};'use strict';var _=require(_0xfcdf('0x0'));var util=require(_0xfcdf('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xfcdf('0x2'));var fs=require('fs');var path=require(_0xfcdf('0x3'));var rimraf=require('rimraf');var config=require(_0xfcdf('0x4'));var attributes=require(_0xfcdf('0x5'));module[_0xfcdf('0x6')]=function(_0x44906,_0x45ae86){return _0x44906['define'](_0xfcdf('0x7'),attributes,{'tableName':_0xfcdf('0x8'),'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 cd72466..5ab1168 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 _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(_0x15d4cb,_0x3abf19){var _0x15c11a=function(_0x89780a){while(--_0x89780a){_0x15d4cb['push'](_0x15d4cb['shift']());}};_0x15c11a(++_0x3abf19);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'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 +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(_0x5ab81a,_0x4d1e8a){var _0x56a2c1=function(_0x50635e){while(--_0x50635e){_0x5ab81a['push'](_0x5ab81a['shift']());}};_0x56a2c1(++_0x4d1e8a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'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 31c03e3..59c06c8 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 _0xdb15=['/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','create','post','/:id/clone','clone','addLists','addBlackLists','update','delete','destroy','removeLists','exports','util','path','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x3945b9,_0x6ff682){var _0x579f7a=function(_0x3838cd){while(--_0x3838cd){_0x3945b9['push'](_0x3945b9['shift']());}};_0x579f7a(++_0x6ff682);}(_0xdb15,0x141));var _0x5db1=function(_0x57b697,_0x226db7){_0x57b697=_0x57b697-0x0;var _0x4e6c0e=_0xdb15[_0x57b697];return _0x4e6c0e;};'use strict';var multer=require('multer');var util=require(_0x5db1('0x0'));var path=require(_0x5db1('0x1'));var timeout=require('connect-timeout');var express=require(_0x5db1('0x2'));var router=express[_0x5db1('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x5db1('0x4'));var config=require(_0x5db1('0x5'));var controller=require('./campaign.controller');router[_0x5db1('0x6')]('/',auth[_0x5db1('0x7')](),controller[_0x5db1('0x8')]);router[_0x5db1('0x6')](_0x5db1('0x9'),auth[_0x5db1('0x7')](),controller[_0x5db1('0xa')]);router[_0x5db1('0x6')](_0x5db1('0xb'),auth[_0x5db1('0x7')](),controller[_0x5db1('0xc')]);router[_0x5db1('0x6')](_0x5db1('0xd'),auth[_0x5db1('0x7')](),controller[_0x5db1('0xe')]);router[_0x5db1('0x6')](_0x5db1('0xf'),auth[_0x5db1('0x7')](),controller[_0x5db1('0x10')]);router[_0x5db1('0x6')](_0x5db1('0x11'),auth['isAuthenticated'](),controller[_0x5db1('0x12')]);router[_0x5db1('0x6')](_0x5db1('0x13'),auth['isAuthenticated'](),controller[_0x5db1('0x14')]);router['get'](_0x5db1('0x15'),auth['isAuthenticated'](),controller['getBlackLists']);router['post']('/',auth['isAuthenticated'](),controller[_0x5db1('0x16')]);router[_0x5db1('0x17')](_0x5db1('0x18'),auth[_0x5db1('0x7')](),controller[_0x5db1('0x19')]);router[_0x5db1('0x17')](_0x5db1('0x13'),auth[_0x5db1('0x7')](),controller[_0x5db1('0x1a')]);router[_0x5db1('0x17')](_0x5db1('0x15'),auth[_0x5db1('0x7')](),controller[_0x5db1('0x1b')]);router['put'](_0x5db1('0x9'),auth[_0x5db1('0x7')](),controller[_0x5db1('0x1c')]);router[_0x5db1('0x1d')](_0x5db1('0x9'),auth['isAuthenticated'](),controller[_0x5db1('0x1e')]);router[_0x5db1('0x1d')](_0x5db1('0x13'),auth[_0x5db1('0x7')](),controller[_0x5db1('0x1f')]);router[_0x5db1('0x1d')](_0x5db1('0x15'),auth[_0x5db1('0x7')](),controller['removeBlackLists']);module[_0x5db1('0x20')]=router; \ No newline at end of file +var _0xd471=['express','Router','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','show','/:id/hopper_histories','get','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists','addBlackLists','put','/:id','update','destroy','delete','removeLists','removeBlackLists','exports','path','connect-timeout'];(function(_0x1df483,_0x340648){var _0x376fac=function(_0x1cc77f){while(--_0x1cc77f){_0x1df483['push'](_0x1df483['shift']());}};_0x376fac(++_0x340648);}(_0xd471,0xf6));var _0x1d47=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xd471[_0x432682];return _0x463d05;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1d47('0x0'));var timeout=require(_0x1d47('0x1'));var express=require(_0x1d47('0x2'));var router=express[_0x1d47('0x3')]();var auth=require(_0x1d47('0x4'));var interaction=require(_0x1d47('0x5'));var config=require('../../config/environment');var controller=require('./campaign.controller');router['get']('/',auth[_0x1d47('0x6')](),controller[_0x1d47('0x7')]);router['get']('/:id',auth[_0x1d47('0x6')](),controller[_0x1d47('0x8')]);router['get']('/:id/hoppers',auth['isAuthenticated'](),controller['getHoppers']);router['get'](_0x1d47('0x9'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0x1d47('0xa')](_0x1d47('0xb'),auth['isAuthenticated'](),controller[_0x1d47('0xc')]);router[_0x1d47('0xa')](_0x1d47('0xd'),auth[_0x1d47('0x6')](),controller['getHopperBlacks']);router[_0x1d47('0xa')](_0x1d47('0xe'),auth[_0x1d47('0x6')](),controller['getLists']);router[_0x1d47('0xa')](_0x1d47('0xf'),auth[_0x1d47('0x6')](),controller[_0x1d47('0x10')]);router[_0x1d47('0x11')]('/',auth[_0x1d47('0x6')](),controller[_0x1d47('0x12')]);router[_0x1d47('0x11')](_0x1d47('0x13'),auth[_0x1d47('0x6')](),controller[_0x1d47('0x14')]);router[_0x1d47('0x11')]('/:id/lists',auth[_0x1d47('0x6')](),controller[_0x1d47('0x15')]);router[_0x1d47('0x11')](_0x1d47('0xf'),auth[_0x1d47('0x6')](),controller[_0x1d47('0x16')]);router[_0x1d47('0x17')](_0x1d47('0x18'),auth['isAuthenticated'](),controller[_0x1d47('0x19')]);router['delete'](_0x1d47('0x18'),auth[_0x1d47('0x6')](),controller[_0x1d47('0x1a')]);router[_0x1d47('0x1b')]('/:id/lists',auth['isAuthenticated'](),controller[_0x1d47('0x1c')]);router[_0x1d47('0x1b')](_0x1d47('0xf'),auth[_0x1d47('0x6')](),controller[_0x1d47('0x1d')]);module[_0x1d47('0x1e')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 207b448..a7d7a2c 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 _0x291d=['sequelize','exports','TEXT','STRING','getDataValue','key'];(function(_0x25f380,_0x405c02){var _0x36ad6b=function(_0x20e0a5){while(--_0x20e0a5){_0x25f380['push'](_0x25f380['shift']());}};_0x36ad6b(++_0x405c02);}(_0x291d,0x144));var _0xd291=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0x291d[_0x4709c0];return _0x13348b;};'use strict';var Sequelize=require(_0xd291('0x0'));module[_0xd291('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0xd291('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xd291('0x3')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xd291('0x4')](_0xd291('0x5'));}}}; \ No newline at end of file +var _0x4dda=['TEXT','VIRTUAL','key','sequelize','exports','STRING'];(function(_0x593d9,_0x3b7582){var _0x19ef5b=function(_0x51e1f9){while(--_0x51e1f9){_0x593d9['push'](_0x593d9['shift']());}};_0x19ef5b(++_0x3b7582);}(_0x4dda,0x189));var _0xa4dd=function(_0x53b3ee,_0x12feb7){_0x53b3ee=_0x53b3ee-0x0;var _0x50fae3=_0x4dda[_0x53b3ee];return _0x50fae3;};'use strict';var Sequelize=require(_0xa4dd('0x0'));module[_0xa4dd('0x1')]={'key':{'type':Sequelize[_0xa4dd('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xa4dd('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0xa4dd('0x2')]},'name':{'type':Sequelize[_0xa4dd('0x4')],'get':function(){return this['getDataValue'](_0xa4dd('0x5'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index e8275f5..5ad743b 100644 --- a/server/api/cannedAnswer/cannedAnswer.controller.js +++ b/server/api/cannedAnswer/cannedAnswer.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['filters','intersection','attributes','fields','length','order','sort','pick','filter','where','merge','options','include','findAll','catch','show','includeAll','find','body','params','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','The\x20inserted\x20key\x20already\x20exists.','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','CannedAnswers','destroy','sendStatus','error','stack','name','map','CannedAnswer','rawAttributes','fieldName','type','key','model','keys','query'];(function(_0x50b2bb,_0x3822bf){var _0x26df2e=function(_0x300fce){while(--_0x300fce){_0x50b2bb['push'](_0x50b2bb['shift']());}};_0x26df2e(++_0x3822bf);}(_0x34e8,0x12c));var _0x834e=function(_0x1f6da7,_0x4cab44){_0x1f6da7=_0x1f6da7-0x0;var _0x403e4e=_0x34e8[_0x1f6da7];return _0x403e4e;};'use strict';var pdf=require(_0x834e('0x0'));var emlformat=require(_0x834e('0x1'));var rimraf=require(_0x834e('0x2'));var zipdir=require(_0x834e('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x834e('0x4'));var moment=require(_0x834e('0x5'));var BPromise=require(_0x834e('0x6'));var Mustache=require(_0x834e('0x7'));var util=require(_0x834e('0x8'));var path=require(_0x834e('0x9'));var sox=require(_0x834e('0xa'));var csv=require('to-csv');var ejs=require(_0x834e('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x834e('0xc'));var crypto=require(_0x834e('0xd'));var jsforce=require(_0x834e('0xe'));var deskjs=require(_0x834e('0xf'));var toCsv=require(_0x834e('0x10'));var querystring=require(_0x834e('0x11'));var Papa=require(_0x834e('0x12'));var Redis=require(_0x834e('0x13'));var authService=require(_0x834e('0x14'));var qs=require(_0x834e('0x15'));var as=require(_0x834e('0x16'));var hardwareService=require(_0x834e('0x17'));var logger=require(_0x834e('0x18'))(_0x834e('0x19'));var utils=require(_0x834e('0x1a'));var config=require(_0x834e('0x1b'));var db=require(_0x834e('0x1c'))['db'];function respondWithStatusCode(_0x538bb3,_0x5e5b6d){_0x5e5b6d=_0x5e5b6d||0xcc;return function(_0x6cd9b9){if(_0x6cd9b9){return _0x538bb3['sendStatus'](_0x5e5b6d);}return _0x538bb3[_0x834e('0x1d')](_0x5e5b6d)[_0x834e('0x1e')]();};}function respondWithResult(_0x28e659,_0x21cc0a){_0x21cc0a=_0x21cc0a||0xc8;return function(_0x50e860){if(_0x50e860){return _0x28e659[_0x834e('0x1d')](_0x21cc0a)[_0x834e('0x1f')](_0x50e860);}};}function respondWithFilteredResult(_0x57274a,_0x316205){return function(_0x4a9cdc){if(_0x4a9cdc){var _0x38a8cd=_0x4a9cdc[_0x834e('0x20')],_0x36d443=_0x316205[_0x834e('0x21')],_0x478afe=_0x316205['offset']+_0x316205[_0x834e('0x22')],_0x43ac41;if(_0x478afe>=_0x38a8cd){_0x478afe=_0x38a8cd;_0x43ac41=0xc8;}else{_0x43ac41=0xce;}_0x57274a[_0x834e('0x1d')](_0x43ac41);return _0x57274a[_0x834e('0x23')](_0x834e('0x24'),_0x36d443+'-'+_0x478afe+'/'+_0x38a8cd)[_0x834e('0x1f')](_0x4a9cdc);}return null;};}function patchUpdates(_0x254677){return function(_0x1dd214){try{jsonpatch['apply'](_0x1dd214,_0x254677,!![]);}catch(_0x2545b4){return BPromise[_0x834e('0x25')](_0x2545b4);}return _0x1dd214[_0x834e('0x26')]();};}function saveUpdates(_0x325a99,_0x4ab05d){return function(_0x45a630){if(_0x45a630){return _0x45a630[_0x834e('0x27')](_0x325a99)['then'](function(_0x1b4bdf){return _0x1b4bdf;});}return null;};}function removeEntity(_0x28d687,_0x8d406e){return function(_0x5c55ca){if(_0x5c55ca){return _0x5c55ca['destroy']()[_0x834e('0x28')](function(){var _0x34563b=_0x5c55ca['get']({'plain':!![]});var _0x25ee1d=_0x834e('0x29');return db['UserProfileResource'][_0x834e('0x2a')]({'where':{'type':_0x25ee1d,'resourceId':_0x34563b['id']}})[_0x834e('0x28')](function(){return _0x5c55ca;});})[_0x834e('0x28')](function(){_0x28d687['status'](0xcc)[_0x834e('0x1e')]();});}};}function handleEntityNotFound(_0x3e310f,_0x5e1cc5){return function(_0x5bef62){if(!_0x5bef62){_0x3e310f[_0x834e('0x2b')](0x194);}return _0x5bef62;};}function handleError(_0x508a1d,_0x2826ec){_0x2826ec=_0x2826ec||0x1f4;return function(_0x3f1b0b){logger[_0x834e('0x2c')](_0x3f1b0b[_0x834e('0x2d')]);if(_0x3f1b0b[_0x834e('0x2e')]){delete _0x3f1b0b[_0x834e('0x2e')];}_0x508a1d['status'](_0x2826ec)['send'](_0x3f1b0b);};}exports['index']=function(_0x58c1d7,_0x2c7a8d){var _0x567cea={},_0x106d6a={},_0x5dacc1={'count':0x0,'rows':[]};var _0xb5bc06=_[_0x834e('0x2f')](db[_0x834e('0x30')][_0x834e('0x31')],function(_0x4551f5){return{'name':_0x4551f5[_0x834e('0x32')],'type':_0x4551f5[_0x834e('0x33')][_0x834e('0x34')]};});_0x106d6a[_0x834e('0x35')]=_['map'](_0xb5bc06,_0x834e('0x2e'));_0x106d6a['query']=_[_0x834e('0x36')](_0x58c1d7[_0x834e('0x37')]);_0x106d6a[_0x834e('0x38')]=_[_0x834e('0x39')](_0x106d6a[_0x834e('0x35')],_0x106d6a[_0x834e('0x37')]);_0x567cea[_0x834e('0x3a')]=_[_0x834e('0x39')](_0x106d6a[_0x834e('0x35')],qs[_0x834e('0x3b')](_0x58c1d7['query'][_0x834e('0x3b')]));_0x567cea[_0x834e('0x3a')]=_0x567cea[_0x834e('0x3a')][_0x834e('0x3c')]?_0x567cea['attributes']:_0x106d6a[_0x834e('0x35')];if(!_0x58c1d7[_0x834e('0x37')]['hasOwnProperty']('nolimit')){_0x567cea['limit']=qs[_0x834e('0x22')](_0x58c1d7[_0x834e('0x37')][_0x834e('0x22')]);_0x567cea[_0x834e('0x21')]=qs[_0x834e('0x21')](_0x58c1d7[_0x834e('0x37')]['offset']);}_0x567cea[_0x834e('0x3d')]=qs['sort'](_0x58c1d7[_0x834e('0x37')][_0x834e('0x3e')]);_0x567cea['where']=qs[_0x834e('0x38')](_[_0x834e('0x3f')](_0x58c1d7['query'],_0x106d6a['filters']));if(_0x58c1d7[_0x834e('0x37')][_0x834e('0x40')]){_0x567cea[_0x834e('0x41')]=_[_0x834e('0x42')](_0x567cea[_0x834e('0x41')],{'$or':_['map'](_0xb5bc06,function(_0x1c5ed6){if(_0x1c5ed6['type']!=='VIRTUAL'){var _0x1b2edf={};_0x1b2edf[_0x1c5ed6['name']]={'$like':'%'+_0x58c1d7[_0x834e('0x37')][_0x834e('0x40')]+'%'};return _0x1b2edf;}})});}_0x567cea=_[_0x834e('0x42')]({},_0x567cea,_0x58c1d7[_0x834e('0x43')]);var _0x2b7933={'where':_0x567cea['where']};return db[_0x834e('0x30')][_0x834e('0x20')](_0x2b7933)[_0x834e('0x28')](function(_0x58c5fb){_0x5dacc1[_0x834e('0x20')]=_0x58c5fb;if(_0x58c1d7[_0x834e('0x37')]['includeAll']){_0x567cea[_0x834e('0x44')]=[{'all':!![]}];}return db['CannedAnswer'][_0x834e('0x45')](_0x567cea);})[_0x834e('0x28')](function(_0x4a18bb){_0x5dacc1['rows']=_0x4a18bb;return _0x5dacc1;})[_0x834e('0x28')](respondWithFilteredResult(_0x2c7a8d,_0x567cea))[_0x834e('0x46')](handleError(_0x2c7a8d,null));};exports[_0x834e('0x47')]=function(_0xbc1571,_0x8ad264){var _0x23feea={'raw':!![],'where':{'id':_0xbc1571['params']['id']}},_0x195204={};_0x195204[_0x834e('0x35')]=_['keys'](db[_0x834e('0x30')]['rawAttributes']);_0x195204[_0x834e('0x37')]=_['keys'](_0xbc1571[_0x834e('0x37')]);_0x195204[_0x834e('0x38')]=_['intersection'](_0x195204[_0x834e('0x35')],_0x195204[_0x834e('0x37')]);_0x23feea[_0x834e('0x3a')]=_[_0x834e('0x39')](_0x195204[_0x834e('0x35')],qs[_0x834e('0x3b')](_0xbc1571[_0x834e('0x37')][_0x834e('0x3b')]));_0x23feea[_0x834e('0x3a')]=_0x23feea[_0x834e('0x3a')]['length']?_0x23feea[_0x834e('0x3a')]:_0x195204[_0x834e('0x35')];if(_0xbc1571['query'][_0x834e('0x48')]){_0x23feea[_0x834e('0x44')]=[{'all':!![]}];}_0x23feea=_[_0x834e('0x42')]({},_0x23feea,_0xbc1571[_0x834e('0x43')]);return db[_0x834e('0x30')][_0x834e('0x49')](_0x23feea)['then'](handleEntityNotFound(_0x8ad264,null))['then'](respondWithResult(_0x8ad264,null))[_0x834e('0x46')](handleError(_0x8ad264,null));};exports[_0x834e('0x27')]=function(_0x30568e,_0x40ff5a){if(_0x30568e[_0x834e('0x4a')]['id']){delete _0x30568e[_0x834e('0x4a')]['id'];}return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x30568e[_0x834e('0x4b')]['id']}})[_0x834e('0x28')](handleEntityNotFound(_0x40ff5a,null))[_0x834e('0x28')](saveUpdates(_0x30568e[_0x834e('0x4a')],null))[_0x834e('0x28')](respondWithResult(_0x40ff5a,null))[_0x834e('0x46')](handleError(_0x40ff5a,null));};exports[_0x834e('0x2a')]=function(_0x1a3855,_0x3df078){return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x1a3855[_0x834e('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3df078,null))[_0x834e('0x28')](removeEntity(_0x3df078,null))[_0x834e('0x46')](handleError(_0x3df078,null));};exports['create']=function(_0x3c00a3,_0x3b0988){var _0x55d491={'key':_0x3c00a3[_0x834e('0x4a')][_0x834e('0x34')]};if(_0x3c00a3[_0x834e('0x4a')][_0x834e('0x4c')]){_0x55d491[_0x834e('0x4c')]=_0x3c00a3[_0x834e('0x4a')][_0x834e('0x4c')];}else if(_0x3c00a3['body'][_0x834e('0x4d')]){_0x55d491[_0x834e('0x4d')]=_0x3c00a3[_0x834e('0x4a')][_0x834e('0x4d')];}else if(_0x3c00a3[_0x834e('0x4a')][_0x834e('0x4e')]){_0x55d491[_0x834e('0x4e')]=_0x3c00a3[_0x834e('0x4a')]['OpenchannelAccountId'];}else if(_0x3c00a3[_0x834e('0x4a')]['ChatWebsiteId']){_0x55d491[_0x834e('0x4f')]=_0x3c00a3['body'][_0x834e('0x4f')];}return db['CannedAnswer']['find']({'where':_0x55d491})[_0x834e('0x28')](function(_0x3e1bee){if(_0x3e1bee){throw new db['Sequelize']['ValidationError'](_0x834e('0x50'));}return db[_0x834e('0x30')][_0x834e('0x51')](_0x3c00a3[_0x834e('0x4a')]);})[_0x834e('0x28')](function(_0x315858){var _0x3d3f2b=_0x3c00a3[_0x834e('0x52')]['get']({'plain':!![]});if(!_0x3d3f2b)throw new Error(_0x834e('0x53'));if(_0x3d3f2b[_0x834e('0x54')]==='user'){var _0x281342=_0x315858['get']({'plain':!![]});return db[_0x834e('0x55')][_0x834e('0x49')]({'where':{'name':'CannedAnswers','userProfileId':_0x3d3f2b[_0x834e('0x56')]},'raw':!![]})[_0x834e('0x28')](function(_0x2de29a){if(_0x2de29a&&_0x2de29a[_0x834e('0x57')]===0x0){return db['UserProfileResource'][_0x834e('0x51')]({'name':_0x281342[_0x834e('0x2e')],'resourceId':_0x281342['id'],'type':_0x2de29a[_0x834e('0x2e')],'sectionId':_0x2de29a['id']},{})['then'](function(){return _0x315858;});}else{return _0x315858;}})[_0x834e('0x46')](function(_0x1fcae9){logger[_0x834e('0x2c')](_0x834e('0x58'),_0x1fcae9);throw _0x1fcae9;});}return _0x315858;})[_0x834e('0x28')](respondWithResult(_0x3b0988,0xc9))[_0x834e('0x46')](handleError(_0x3b0988,null));}; \ No newline at end of file +var _0x9957=['limit','set','Content-Range','reject','save','then','destroy','get','CannedAnswers','UserProfileResource','stack','name','send','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','filter','options','CannedAnswer','count','include','catch','show','params','keys','length','includeAll','find','update','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','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','sendStatus','status','end','json','offset'];(function(_0x3b8f8d,_0x5c3d85){var _0x5a3526=function(_0x50b596){while(--_0x50b596){_0x3b8f8d['push'](_0x3b8f8d['shift']());}};_0x5a3526(++_0x5c3d85);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var pdf=require(_0x7995('0x0'));var emlformat=require(_0x7995('0x1'));var rimraf=require(_0x7995('0x2'));var zipdir=require(_0x7995('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7995('0x4'));var moment=require(_0x7995('0x5'));var BPromise=require(_0x7995('0x6'));var Mustache=require(_0x7995('0x7'));var util=require('util');var path=require(_0x7995('0x8'));var sox=require(_0x7995('0x9'));var csv=require(_0x7995('0xa'));var ejs=require(_0x7995('0xb'));var fs=require('fs');var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var db=require(_0x7995('0x19'))['db'];function respondWithStatusCode(_0x2cb37a,_0x19a27e){_0x19a27e=_0x19a27e||0xcc;return function(_0x385f00){if(_0x385f00){return _0x2cb37a[_0x7995('0x1a')](_0x19a27e);}return _0x2cb37a[_0x7995('0x1b')](_0x19a27e)[_0x7995('0x1c')]();};}function respondWithResult(_0x4cc004,_0x58f5ad){_0x58f5ad=_0x58f5ad||0xc8;return function(_0x2b4e94){if(_0x2b4e94){return _0x4cc004[_0x7995('0x1b')](_0x58f5ad)[_0x7995('0x1d')](_0x2b4e94);}};}function respondWithFilteredResult(_0x321ae8,_0x3f1d3e){return function(_0x1a5310){if(_0x1a5310){var _0x2202ce=_0x1a5310['count'],_0x41cbf0=_0x3f1d3e[_0x7995('0x1e')],_0x5377e5=_0x3f1d3e[_0x7995('0x1e')]+_0x3f1d3e[_0x7995('0x1f')],_0x2eeacc;if(_0x5377e5>=_0x2202ce){_0x5377e5=_0x2202ce;_0x2eeacc=0xc8;}else{_0x2eeacc=0xce;}_0x321ae8[_0x7995('0x1b')](_0x2eeacc);return _0x321ae8[_0x7995('0x20')](_0x7995('0x21'),_0x41cbf0+'-'+_0x5377e5+'/'+_0x2202ce)['json'](_0x1a5310);}return null;};}function patchUpdates(_0x54c9ae){return function(_0x2536c8){try{jsonpatch['apply'](_0x2536c8,_0x54c9ae,!![]);}catch(_0x555f74){return BPromise[_0x7995('0x22')](_0x555f74);}return _0x2536c8[_0x7995('0x23')]();};}function saveUpdates(_0x4cbe10,_0x3a9b54){return function(_0x51f276){if(_0x51f276){return _0x51f276['update'](_0x4cbe10)[_0x7995('0x24')](function(_0x327b1f){return _0x327b1f;});}return null;};}function removeEntity(_0x350fd9,_0x1a8568){return function(_0x460924){if(_0x460924){return _0x460924[_0x7995('0x25')]()['then'](function(){var _0x32a09a=_0x460924[_0x7995('0x26')]({'plain':!![]});var _0x204507=_0x7995('0x27');return db[_0x7995('0x28')][_0x7995('0x25')]({'where':{'type':_0x204507,'resourceId':_0x32a09a['id']}})[_0x7995('0x24')](function(){return _0x460924;});})[_0x7995('0x24')](function(){_0x350fd9['status'](0xcc)[_0x7995('0x1c')]();});}};}function handleEntityNotFound(_0x34e70c,_0x401dc3){return function(_0x268ce7){if(!_0x268ce7){_0x34e70c[_0x7995('0x1a')](0x194);}return _0x268ce7;};}function handleError(_0x2a307e,_0x56691a){_0x56691a=_0x56691a||0x1f4;return function(_0x47625f){logger['error'](_0x47625f[_0x7995('0x29')]);if(_0x47625f[_0x7995('0x2a')]){delete _0x47625f[_0x7995('0x2a')];}_0x2a307e[_0x7995('0x1b')](_0x56691a)[_0x7995('0x2b')](_0x47625f);};}exports['index']=function(_0x9b2a15,_0x514445){var _0x456a28={},_0x3250e0={},_0x4253e5={'count':0x0,'rows':[]};var _0x574574=_['map'](db['CannedAnswer'][_0x7995('0x2c')],function(_0xe6b0b3){return{'name':_0xe6b0b3[_0x7995('0x2d')],'type':_0xe6b0b3[_0x7995('0x2e')][_0x7995('0x2f')]};});_0x3250e0[_0x7995('0x30')]=_['map'](_0x574574,'name');_0x3250e0[_0x7995('0x31')]=_['keys'](_0x9b2a15[_0x7995('0x31')]);_0x3250e0[_0x7995('0x32')]=_[_0x7995('0x33')](_0x3250e0[_0x7995('0x30')],_0x3250e0[_0x7995('0x31')]);_0x456a28['attributes']=_[_0x7995('0x33')](_0x3250e0[_0x7995('0x30')],qs['fields'](_0x9b2a15['query']['fields']));_0x456a28[_0x7995('0x34')]=_0x456a28[_0x7995('0x34')]['length']?_0x456a28[_0x7995('0x34')]:_0x3250e0['model'];if(!_0x9b2a15[_0x7995('0x31')][_0x7995('0x35')](_0x7995('0x36'))){_0x456a28['limit']=qs['limit'](_0x9b2a15[_0x7995('0x31')]['limit']);_0x456a28['offset']=qs[_0x7995('0x1e')](_0x9b2a15[_0x7995('0x31')]['offset']);}_0x456a28[_0x7995('0x37')]=qs[_0x7995('0x38')](_0x9b2a15[_0x7995('0x31')][_0x7995('0x38')]);_0x456a28[_0x7995('0x39')]=qs['filters'](_[_0x7995('0x3a')](_0x9b2a15[_0x7995('0x31')],_0x3250e0[_0x7995('0x32')]));if(_0x9b2a15[_0x7995('0x31')]['filter']){_0x456a28[_0x7995('0x39')]=_[_0x7995('0x3b')](_0x456a28[_0x7995('0x39')],{'$or':_[_0x7995('0x3c')](_0x574574,function(_0x1f5bee){if(_0x1f5bee[_0x7995('0x2e')]!=='VIRTUAL'){var _0x183a68={};_0x183a68[_0x1f5bee[_0x7995('0x2a')]]={'$like':'%'+_0x9b2a15[_0x7995('0x31')][_0x7995('0x3d')]+'%'};return _0x183a68;}})});}_0x456a28=_[_0x7995('0x3b')]({},_0x456a28,_0x9b2a15[_0x7995('0x3e')]);var _0x14d638={'where':_0x456a28[_0x7995('0x39')]};return db[_0x7995('0x3f')][_0x7995('0x40')](_0x14d638)[_0x7995('0x24')](function(_0x270d52){_0x4253e5[_0x7995('0x40')]=_0x270d52;if(_0x9b2a15['query']['includeAll']){_0x456a28[_0x7995('0x41')]=[{'all':!![]}];}return db[_0x7995('0x3f')]['findAll'](_0x456a28);})['then'](function(_0x3f8522){_0x4253e5['rows']=_0x3f8522;return _0x4253e5;})['then'](respondWithFilteredResult(_0x514445,_0x456a28))[_0x7995('0x42')](handleError(_0x514445,null));};exports[_0x7995('0x43')]=function(_0x35c8ff,_0x576b96){var _0x46ac4f={'raw':!![],'where':{'id':_0x35c8ff[_0x7995('0x44')]['id']}},_0x5e85b9={};_0x5e85b9['model']=_['keys'](db[_0x7995('0x3f')][_0x7995('0x2c')]);_0x5e85b9[_0x7995('0x31')]=_[_0x7995('0x45')](_0x35c8ff['query']);_0x5e85b9[_0x7995('0x32')]=_[_0x7995('0x33')](_0x5e85b9[_0x7995('0x30')],_0x5e85b9[_0x7995('0x31')]);_0x46ac4f['attributes']=_['intersection'](_0x5e85b9[_0x7995('0x30')],qs['fields'](_0x35c8ff[_0x7995('0x31')]['fields']));_0x46ac4f[_0x7995('0x34')]=_0x46ac4f['attributes'][_0x7995('0x46')]?_0x46ac4f[_0x7995('0x34')]:_0x5e85b9['model'];if(_0x35c8ff[_0x7995('0x31')][_0x7995('0x47')]){_0x46ac4f[_0x7995('0x41')]=[{'all':!![]}];}_0x46ac4f=_[_0x7995('0x3b')]({},_0x46ac4f,_0x35c8ff['options']);return db[_0x7995('0x3f')][_0x7995('0x48')](_0x46ac4f)[_0x7995('0x24')](handleEntityNotFound(_0x576b96,null))['then'](respondWithResult(_0x576b96,null))[_0x7995('0x42')](handleError(_0x576b96,null));};exports[_0x7995('0x49')]=function(_0x511567,_0x3d8ae3){if(_0x511567[_0x7995('0x4a')]['id']){delete _0x511567['body']['id'];}return db[_0x7995('0x3f')][_0x7995('0x48')]({'where':{'id':_0x511567['params']['id']}})[_0x7995('0x24')](handleEntityNotFound(_0x3d8ae3,null))['then'](saveUpdates(_0x511567[_0x7995('0x4a')],null))[_0x7995('0x24')](respondWithResult(_0x3d8ae3,null))[_0x7995('0x42')](handleError(_0x3d8ae3,null));};exports[_0x7995('0x25')]=function(_0xddf537,_0x14b537){return db[_0x7995('0x3f')]['find']({'where':{'id':_0xddf537[_0x7995('0x44')]['id']}})[_0x7995('0x24')](handleEntityNotFound(_0x14b537,null))[_0x7995('0x24')](removeEntity(_0x14b537,null))['catch'](handleError(_0x14b537,null));};exports[_0x7995('0x4b')]=function(_0x1fe77e,_0x12d4b8){var _0x47d1d8={'key':_0x1fe77e['body']['key']};if(_0x1fe77e[_0x7995('0x4a')][_0x7995('0x4c')]){_0x47d1d8['MailAccountId']=_0x1fe77e[_0x7995('0x4a')][_0x7995('0x4c')];}else if(_0x1fe77e[_0x7995('0x4a')][_0x7995('0x4d')]){_0x47d1d8[_0x7995('0x4d')]=_0x1fe77e['body'][_0x7995('0x4d')];}else if(_0x1fe77e['body'][_0x7995('0x4e')]){_0x47d1d8[_0x7995('0x4e')]=_0x1fe77e[_0x7995('0x4a')]['OpenchannelAccountId'];}else if(_0x1fe77e['body']['ChatWebsiteId']){_0x47d1d8['ChatWebsiteId']=_0x1fe77e[_0x7995('0x4a')][_0x7995('0x4f')];}return db[_0x7995('0x3f')][_0x7995('0x48')]({'where':_0x47d1d8})[_0x7995('0x24')](function(_0x357e60){if(_0x357e60){throw new db[(_0x7995('0x50'))][(_0x7995('0x51'))](_0x7995('0x52'));}return db[_0x7995('0x3f')][_0x7995('0x4b')](_0x1fe77e[_0x7995('0x4a')]);})[_0x7995('0x24')](function(_0x35bea3){var _0x1ea1dc=_0x1fe77e[_0x7995('0x53')][_0x7995('0x26')]({'plain':!![]});if(!_0x1ea1dc)throw new Error(_0x7995('0x54'));if(_0x1ea1dc[_0x7995('0x55')]==='user'){var _0x56a374=_0x35bea3[_0x7995('0x26')]({'plain':!![]});return db[_0x7995('0x56')][_0x7995('0x48')]({'where':{'name':'CannedAnswers','userProfileId':_0x1ea1dc['userProfileId']},'raw':!![]})[_0x7995('0x24')](function(_0x197b52){if(_0x197b52&&_0x197b52[_0x7995('0x57')]===0x0){return db[_0x7995('0x28')]['create']({'name':_0x56a374[_0x7995('0x2a')],'resourceId':_0x56a374['id'],'type':_0x197b52[_0x7995('0x2a')],'sectionId':_0x197b52['id']},{})[_0x7995('0x24')](function(){return _0x35bea3;});}else{return _0x35bea3;}})[_0x7995('0x42')](function(_0x502d43){logger['error'](_0x7995('0x58'),_0x502d43);throw _0x502d43;});}return _0x35bea3;})[_0x7995('0x24')](respondWithResult(_0x12d4b8,0xc9))[_0x7995('0x42')](handleError(_0x12d4b8,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index b28ca0d..596780f 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 _0x117d=['tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./cannedAnswer.attributes','exports'];(function(_0x244b1a,_0x413208){var _0x2d6037=function(_0x3bfcd3){while(--_0x3bfcd3){_0x244b1a['push'](_0x244b1a['shift']());}};_0x2d6037(++_0x413208);}(_0x117d,0xac));var _0xd117=function(_0x367e5b,_0x5721e4){_0x367e5b=_0x367e5b-0x0;var _0x4b909e=_0x117d[_0x367e5b];return _0x4b909e;};'use strict';var _=require(_0xd117('0x0'));var util=require(_0xd117('0x1'));var logger=require(_0xd117('0x2'))('api');var moment=require(_0xd117('0x3'));var BPromise=require(_0xd117('0x4'));var rp=require(_0xd117('0x5'));var fs=require('fs');var path=require(_0xd117('0x6'));var rimraf=require(_0xd117('0x7'));var config=require('../../config/environment');var attributes=require(_0xd117('0x8'));module[_0xd117('0x9')]=function(_0xa760de,_0x55f7a3){return _0xa760de['define']('CannedAnswer',attributes,{'tableName':_0xd117('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd117('0xb'),'collate':_0xd117('0xc')});}; \ No newline at end of file +var _0x46a4=['request-promise','path','rimraf','../../config/environment','exports','define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird'];(function(_0x7af30d,_0x5bf830){var _0x848cff=function(_0x462f4f){while(--_0x462f4f){_0x7af30d['push'](_0x7af30d['shift']());}};_0x848cff(++_0x5bf830);}(_0x46a4,0x190));var _0x446a=function(_0x148ac4,_0x1e0088){_0x148ac4=_0x148ac4-0x0;var _0x31d66b=_0x46a4[_0x148ac4];return _0x31d66b;};'use strict';var _=require(_0x446a('0x0'));var util=require(_0x446a('0x1'));var logger=require('../../config/logger')(_0x446a('0x2'));var moment=require(_0x446a('0x3'));var BPromise=require(_0x446a('0x4'));var rp=require(_0x446a('0x5'));var fs=require('fs');var path=require(_0x446a('0x6'));var rimraf=require(_0x446a('0x7'));var config=require(_0x446a('0x8'));var attributes=require('./cannedAnswer.attributes');module[_0x446a('0x9')]=function(_0x590da0,_0x3e32c3){return _0x590da0[_0x446a('0xa')](_0x446a('0xb'),attributes,{'tableName':_0x446a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x446a('0xd'),'collate':_0x446a('0xe')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index a8123c5..6c7ffa7 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 _0x13b4=['catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x13b4,0x191));var _0x413b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x13b4[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x413b('0x0'));var util=require(_0x413b('0x1'));var moment=require(_0x413b('0x2'));var BPromise=require(_0x413b('0x3'));var rs=require(_0x413b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x413b('0x5'))['db'];var utils=require(_0x413b('0x6'));var logger=require(_0x413b('0x7'))(_0x413b('0x8'));var config=require(_0x413b('0x9'));var jayson=require(_0x413b('0xa'));var client=jayson[_0x413b('0xb')][_0x413b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x258825,_0x346133,_0x5b3da4){return new BPromise(function(_0x55ab3a,_0x19a369){return client[_0x413b('0xd')](_0x258825,_0x5b3da4)[_0x413b('0xe')](function(_0x30896e){logger[_0x413b('0xf')](_0x413b('0x10'),_0x346133,_0x413b('0x11'));logger[_0x413b('0x12')](_0x413b('0x13'),_0x346133,'request\x20sent',JSON[_0x413b('0x14')](_0x30896e));if(_0x30896e[_0x413b('0x15')]){if(_0x30896e[_0x413b('0x15')]['code']===0x1f4){logger['error']('CannedAnswer,\x20%s,\x20%s',_0x346133,_0x30896e['error'][_0x413b('0x16')]);return _0x19a369(_0x30896e[_0x413b('0x15')][_0x413b('0x16')]);}logger['error']('CannedAnswer,\x20%s,\x20%s',_0x346133,_0x30896e[_0x413b('0x15')]['message']);return _0x55ab3a(_0x30896e[_0x413b('0x15')][_0x413b('0x16')]);}else{logger['info']('CannedAnswer,\x20%s,\x20%s',_0x346133,_0x413b('0x11'));_0x55ab3a(_0x30896e[_0x413b('0x17')][_0x413b('0x16')]);}})[_0x413b('0x18')](function(_0x59a426){logger[_0x413b('0x15')](_0x413b('0x10'),_0x346133,_0x59a426);_0x19a369(_0x59a426);});});} \ No newline at end of file +var _0x561d=['request','then','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x12397a,_0x16d5fa){var _0x216897=function(_0x258ad5){while(--_0x258ad5){_0x12397a['push'](_0x12397a['shift']());}};_0x216897(++_0x16d5fa);}(_0x561d,0xe3));var _0xd561=function(_0x45cb12,_0x1317e1){_0x45cb12=_0x45cb12-0x0;var _0x3655f7=_0x561d[_0x45cb12];return _0x3655f7;};'use strict';var _=require(_0xd561('0x0'));var util=require(_0xd561('0x1'));var moment=require(_0xd561('0x2'));var BPromise=require('bluebird');var rs=require(_0xd561('0x3'));var fs=require('fs');var Redis=require(_0xd561('0x4'));var db=require(_0xd561('0x5'))['db'];var utils=require(_0xd561('0x6'));var logger=require(_0xd561('0x7'))(_0xd561('0x8'));var config=require(_0xd561('0x9'));var jayson=require(_0xd561('0xa'));var client=jayson[_0xd561('0xb')][_0xd561('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x436921,_0xf61b5f,_0x353464){return new BPromise(function(_0x3d74aa,_0x1057f4){return client[_0xd561('0xd')](_0x436921,_0x353464)[_0xd561('0xe')](function(_0x5e7e5f){logger[_0xd561('0xf')](_0xd561('0x10'),_0xf61b5f,_0xd561('0x11'));logger[_0xd561('0x12')](_0xd561('0x13'),_0xf61b5f,_0xd561('0x11'),JSON[_0xd561('0x14')](_0x5e7e5f));if(_0x5e7e5f[_0xd561('0x15')]){if(_0x5e7e5f[_0xd561('0x15')]['code']===0x1f4){logger[_0xd561('0x15')](_0xd561('0x10'),_0xf61b5f,_0x5e7e5f[_0xd561('0x15')][_0xd561('0x16')]);return _0x1057f4(_0x5e7e5f[_0xd561('0x15')][_0xd561('0x16')]);}logger['error'](_0xd561('0x10'),_0xf61b5f,_0x5e7e5f[_0xd561('0x15')][_0xd561('0x16')]);return _0x3d74aa(_0x5e7e5f[_0xd561('0x15')][_0xd561('0x16')]);}else{logger['info'](_0xd561('0x10'),_0xf61b5f,_0xd561('0x11'));_0x3d74aa(_0x5e7e5f['result'][_0xd561('0x16')]);}})[_0xd561('0x17')](function(_0x3b0586){logger[_0xd561('0x15')](_0xd561('0x10'),_0xf61b5f,_0x3b0586);_0x1057f4(_0x3b0586);});});} \ No newline at end of file diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js index eedadf1..23ec695 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 _0xcc0b=['get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller'];(function(_0x1c1820,_0x18bb79){var _0x6690e6=function(_0x11ae54){while(--_0x11ae54){_0x1c1820['push'](_0x1c1820['shift']());}};_0x6690e6(++_0x18bb79);}(_0xcc0b,0xc0));var _0xbcc0=function(_0x499001,_0x3f27ae){_0x499001=_0x499001-0x0;var _0x320c65=_0xcc0b[_0x499001];return _0x320c65;};'use strict';var multer=require(_0xbcc0('0x0'));var util=require(_0xbcc0('0x1'));var path=require('path');var timeout=require(_0xbcc0('0x2'));var express=require(_0xbcc0('0x3'));var router=express[_0xbcc0('0x4')]();var auth=require(_0xbcc0('0x5'));var interaction=require(_0xbcc0('0x6'));var config=require('../../config/environment');var controller=require(_0xbcc0('0x7'));router[_0xbcc0('0x8')]('/',auth['isAuthenticated'](),controller[_0xbcc0('0x9')]);router[_0xbcc0('0x8')](_0xbcc0('0xa'),auth[_0xbcc0('0xb')](),controller[_0xbcc0('0xc')]);router[_0xbcc0('0xd')]('/',auth['isAuthenticated'](),controller[_0xbcc0('0xe')]);router[_0xbcc0('0xf')](_0xbcc0('0xa'),auth[_0xbcc0('0xb')](),controller[_0xbcc0('0x10')]);router[_0xbcc0('0x11')](_0xbcc0('0xa'),auth[_0xbcc0('0xb')](),controller[_0xbcc0('0x12')]);module[_0xbcc0('0x13')]=router; \ No newline at end of file +var _0xd965=['get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','./cannedAnswer.controller'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd965,0xe7));var _0x5d96=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd965[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x5d96('0x0'));var util=require('util');var path=require(_0x5d96('0x1'));var timeout=require(_0x5d96('0x2'));var express=require(_0x5d96('0x3'));var router=express['Router']();var auth=require(_0x5d96('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x5d96('0x5'));var controller=require(_0x5d96('0x6'));router[_0x5d96('0x7')]('/',auth[_0x5d96('0x8')](),controller[_0x5d96('0x9')]);router[_0x5d96('0x7')](_0x5d96('0xa'),auth['isAuthenticated'](),controller[_0x5d96('0xb')]);router[_0x5d96('0xc')]('/',auth[_0x5d96('0x8')](),controller[_0x5d96('0xd')]);router[_0x5d96('0xe')](_0x5d96('0xa'),auth[_0x5d96('0x8')](),controller[_0x5d96('0xf')]);router['delete'](_0x5d96('0xa'),auth[_0x5d96('0x8')](),controller[_0x5d96('0x10')]);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 2964665..d68cc82 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 _0xd5bd=['1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0xd5bd,0x1c5));var _0xdd5b=function(_0x58b332,_0x54787d){_0x58b332=_0x58b332-0x0;var _0xb8e97e=_0xd5bd[_0x58b332];return _0xb8e97e;};'use strict';var Sequelize=require(_0xdd5b('0x0'));module[_0xdd5b('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0xdd5b('0x2')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0xdd5b('0x3')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0xdd5b('0x3')]},'lastapp':{'type':Sequelize[_0xdd5b('0x3')]},'lastdata':{'type':Sequelize[_0xdd5b('0x3')]},'duration':{'type':Sequelize[_0xdd5b('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xdd5b('0x3')]},'amaflags':{'type':Sequelize[_0xdd5b('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0xdd5b('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xdd5b('0x3')]},'sequence':{'type':Sequelize[_0xdd5b('0x3')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xdd5b('0x3')]},'tag':{'type':Sequelize[_0xdd5b('0x3')]}}; \ No newline at end of file +var _0x6ce1=['INTEGER','sequelize','exports','DATE','1970-01-01\x2000:00:01','STRING'];(function(_0x232eb7,_0x199b07){var _0xd7fb8=function(_0x149ed6){while(--_0x149ed6){_0x232eb7['push'](_0x232eb7['shift']());}};_0xd7fb8(++_0x199b07);}(_0x6ce1,0x103));var _0x16ce=function(_0x24b8a2,_0x49f037){_0x24b8a2=_0x24b8a2-0x0;var _0x463755=_0x6ce1[_0x24b8a2];return _0x463755;};'use strict';var Sequelize=require(_0x16ce('0x0'));module[_0x16ce('0x1')]={'calldate':{'type':Sequelize[_0x16ce('0x2')],'allowNull':![],'defaultValue':_0x16ce('0x3')},'clid':{'type':Sequelize[_0x16ce('0x4')]},'src':{'type':Sequelize[_0x16ce('0x4')]},'dst':{'type':Sequelize[_0x16ce('0x4')]},'dcontext':{'type':Sequelize[_0x16ce('0x4')]},'channel':{'type':Sequelize[_0x16ce('0x4')]},'dstchannel':{'type':Sequelize[_0x16ce('0x4')]},'lastapp':{'type':Sequelize[_0x16ce('0x4')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x16ce('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x16ce('0x4')]},'amaflags':{'type':Sequelize[_0x16ce('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x16ce('0x4')]},'uniqueid':{'type':Sequelize[_0x16ce('0x4')]},'linkedid':{'type':Sequelize[_0x16ce('0x4')]},'sequence':{'type':Sequelize[_0x16ce('0x4')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x16ce('0x4')]},'tag':{'type':Sequelize[_0x16ce('0x4')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index c1f68b2..95bc070 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 _0x2d82=['../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','set','json','apply','reject','save','update','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','VIRTUAL','options','then','count','include','Cdr','findAll','rows','catch','params','keys','includeAll','create','body','find','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils'];(function(_0x2db12b,_0x30ab1d){var _0x20990b=function(_0x589477){while(--_0x589477){_0x2db12b['push'](_0x2db12b['shift']());}};_0x20990b(++_0x30ab1d);}(_0x2d82,0x1a0));var _0x22d8=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0x2d82[_0x33032e];return _0x13316b;};'use strict';var pdf=require(_0x22d8('0x0'));var emlformat=require(_0x22d8('0x1'));var rimraf=require(_0x22d8('0x2'));var zipdir=require(_0x22d8('0x3'));var jsonpatch=require(_0x22d8('0x4'));var rp=require(_0x22d8('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x22d8('0x6'));var util=require(_0x22d8('0x7'));var path=require('path');var sox=require(_0x22d8('0x8'));var csv=require('to-csv');var ejs=require(_0x22d8('0x9'));var fs=require('fs');var _=require(_0x22d8('0xa'));var squel=require(_0x22d8('0xb'));var crypto=require(_0x22d8('0xc'));var jsforce=require(_0x22d8('0xd'));var deskjs=require(_0x22d8('0xe'));var toCsv=require(_0x22d8('0xf'));var querystring=require(_0x22d8('0x10'));var Papa=require('papaparse');var Redis=require(_0x22d8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x22d8('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x22d8('0x13'));var logger=require('../../config/logger')(_0x22d8('0x14'));var utils=require(_0x22d8('0x15'));var config=require(_0x22d8('0x16'));var db=require(_0x22d8('0x17'))['db'];function respondWithStatusCode(_0x3baefc,_0x19d8c2){_0x19d8c2=_0x19d8c2||0xcc;return function(_0x50b9e9){if(_0x50b9e9){return _0x3baefc[_0x22d8('0x18')](_0x19d8c2);}return _0x3baefc[_0x22d8('0x19')](_0x19d8c2)[_0x22d8('0x1a')]();};}function respondWithResult(_0x1c32fa,_0x36db9f){_0x36db9f=_0x36db9f||0xc8;return function(_0x39c9d9){if(_0x39c9d9){return _0x1c32fa[_0x22d8('0x19')](_0x36db9f)['json'](_0x39c9d9);}};}function respondWithFilteredResult(_0x143d3f,_0x23889b){return function(_0x533683){if(_0x533683){var _0x5af526=_0x533683['count'],_0xae6e6c=_0x23889b['offset'],_0x20168c=_0x23889b[_0x22d8('0x1b')]+_0x23889b[_0x22d8('0x1c')],_0x129232;if(_0x20168c>=_0x5af526){_0x20168c=_0x5af526;_0x129232=0xc8;}else{_0x129232=0xce;}_0x143d3f[_0x22d8('0x19')](_0x129232);return _0x143d3f[_0x22d8('0x1d')]('Content-Range',_0xae6e6c+'-'+_0x20168c+'/'+_0x5af526)[_0x22d8('0x1e')](_0x533683);}return null;};}function patchUpdates(_0x3b96fb){return function(_0x478835){try{jsonpatch[_0x22d8('0x1f')](_0x478835,_0x3b96fb,!![]);}catch(_0x1af45d){return BPromise[_0x22d8('0x20')](_0x1af45d);}return _0x478835[_0x22d8('0x21')]();};}function saveUpdates(_0x144b42,_0x4745ad){return function(_0x59810b){if(_0x59810b){return _0x59810b[_0x22d8('0x22')](_0x144b42)['then'](function(_0x5ce83d){return _0x5ce83d;});}return null;};}function removeEntity(_0x1aca6d,_0x59550b){return function(_0x3e6e6f){if(_0x3e6e6f){return _0x3e6e6f[_0x22d8('0x23')]()['then'](function(){_0x1aca6d['status'](0xcc)[_0x22d8('0x1a')]();});}};}function handleEntityNotFound(_0x52ed80,_0x90050a){return function(_0x3d0c81){if(!_0x3d0c81){_0x52ed80[_0x22d8('0x18')](0x194);}return _0x3d0c81;};}function handleError(_0x484d95,_0x2563eb){_0x2563eb=_0x2563eb||0x1f4;return function(_0x5029fa){logger[_0x22d8('0x24')](_0x5029fa[_0x22d8('0x25')]);if(_0x5029fa[_0x22d8('0x26')]){delete _0x5029fa[_0x22d8('0x26')];}_0x484d95[_0x22d8('0x19')](_0x2563eb)['send'](_0x5029fa);};}exports[_0x22d8('0x27')]=function(_0x3f248d,_0x272f1d){var _0x5e2491={},_0x10782b={},_0x2e6e8f={'count':0x0,'rows':[]};var _0x28b89d=_[_0x22d8('0x28')](db['Cdr'][_0x22d8('0x29')],function(_0x6a36d3){return{'name':_0x6a36d3[_0x22d8('0x2a')],'type':_0x6a36d3[_0x22d8('0x2b')]['key']};});_0x10782b[_0x22d8('0x2c')]=_[_0x22d8('0x28')](_0x28b89d,_0x22d8('0x26'));_0x10782b[_0x22d8('0x2d')]=_['keys'](_0x3f248d[_0x22d8('0x2d')]);_0x10782b['filters']=_[_0x22d8('0x2e')](_0x10782b[_0x22d8('0x2c')],_0x10782b[_0x22d8('0x2d')]);_0x5e2491[_0x22d8('0x2f')]=_['intersection'](_0x10782b[_0x22d8('0x2c')],qs[_0x22d8('0x30')](_0x3f248d[_0x22d8('0x2d')][_0x22d8('0x30')]));_0x5e2491[_0x22d8('0x2f')]=_0x5e2491[_0x22d8('0x2f')][_0x22d8('0x31')]?_0x5e2491[_0x22d8('0x2f')]:_0x10782b['model'];if(!_0x3f248d[_0x22d8('0x2d')][_0x22d8('0x32')](_0x22d8('0x33'))){_0x5e2491[_0x22d8('0x1c')]=qs[_0x22d8('0x1c')](_0x3f248d[_0x22d8('0x2d')]['limit']);_0x5e2491[_0x22d8('0x1b')]=qs[_0x22d8('0x1b')](_0x3f248d[_0x22d8('0x2d')][_0x22d8('0x1b')]);}_0x5e2491['order']=qs[_0x22d8('0x34')](_0x3f248d[_0x22d8('0x2d')][_0x22d8('0x34')]);_0x5e2491[_0x22d8('0x35')]=qs[_0x22d8('0x36')](_[_0x22d8('0x37')](_0x3f248d['query'],_0x10782b['filters']));if(_0x3f248d[_0x22d8('0x2d')]['filter']){_0x5e2491[_0x22d8('0x35')]=_[_0x22d8('0x38')](_0x5e2491[_0x22d8('0x35')],{'$or':_[_0x22d8('0x28')](_0x28b89d,function(_0x586e95){if(_0x586e95['type']!==_0x22d8('0x39')){var _0x2b4e0a={};_0x2b4e0a[_0x586e95[_0x22d8('0x26')]]={'$like':'%'+_0x3f248d[_0x22d8('0x2d')]['filter']+'%'};return _0x2b4e0a;}})});}_0x5e2491=_[_0x22d8('0x38')]({},_0x5e2491,_0x3f248d[_0x22d8('0x3a')]);var _0x2a78de={'where':_0x5e2491[_0x22d8('0x35')]};return db['Cdr']['count'](_0x2a78de)[_0x22d8('0x3b')](function(_0x44fe6d){_0x2e6e8f[_0x22d8('0x3c')]=_0x44fe6d;if(_0x3f248d[_0x22d8('0x2d')]['includeAll']){_0x5e2491[_0x22d8('0x3d')]=[{'all':!![]}];}return db[_0x22d8('0x3e')][_0x22d8('0x3f')](_0x5e2491);})[_0x22d8('0x3b')](function(_0x26b8d5){_0x2e6e8f[_0x22d8('0x40')]=_0x26b8d5;return _0x2e6e8f;})[_0x22d8('0x3b')](respondWithFilteredResult(_0x272f1d,_0x5e2491))[_0x22d8('0x41')](handleError(_0x272f1d,null));};exports['show']=function(_0x1caead,_0x5052cf){var _0x469f73={'raw':!![],'where':{'id':_0x1caead[_0x22d8('0x42')]['id']}},_0x311cc4={};_0x311cc4[_0x22d8('0x2c')]=_[_0x22d8('0x43')](db[_0x22d8('0x3e')][_0x22d8('0x29')]);_0x311cc4[_0x22d8('0x2d')]=_[_0x22d8('0x43')](_0x1caead['query']);_0x311cc4[_0x22d8('0x36')]=_[_0x22d8('0x2e')](_0x311cc4[_0x22d8('0x2c')],_0x311cc4[_0x22d8('0x2d')]);_0x469f73[_0x22d8('0x2f')]=_[_0x22d8('0x2e')](_0x311cc4['model'],qs[_0x22d8('0x30')](_0x1caead['query']['fields']));_0x469f73['attributes']=_0x469f73[_0x22d8('0x2f')]['length']?_0x469f73[_0x22d8('0x2f')]:_0x311cc4['model'];if(_0x1caead[_0x22d8('0x2d')][_0x22d8('0x44')]){_0x469f73[_0x22d8('0x3d')]=[{'all':!![]}];}_0x469f73=_[_0x22d8('0x38')]({},_0x469f73,_0x1caead['options']);return db['Cdr']['find'](_0x469f73)[_0x22d8('0x3b')](handleEntityNotFound(_0x5052cf,null))['then'](respondWithResult(_0x5052cf,null))[_0x22d8('0x41')](handleError(_0x5052cf,null));};exports[_0x22d8('0x45')]=function(_0x2b13c7,_0x52a4da){return db['Cdr'][_0x22d8('0x45')](_0x2b13c7[_0x22d8('0x46')],{})[_0x22d8('0x3b')](respondWithResult(_0x52a4da,0xc9))[_0x22d8('0x41')](handleError(_0x52a4da,null));};exports[_0x22d8('0x22')]=function(_0x5085c7,_0x4cebd0){if(_0x5085c7['body']['id']){delete _0x5085c7[_0x22d8('0x46')]['id'];}return db[_0x22d8('0x3e')][_0x22d8('0x47')]({'where':{'id':_0x5085c7[_0x22d8('0x42')]['id']}})[_0x22d8('0x3b')](handleEntityNotFound(_0x4cebd0,null))['then'](saveUpdates(_0x5085c7[_0x22d8('0x46')],null))[_0x22d8('0x3b')](respondWithResult(_0x4cebd0,null))[_0x22d8('0x41')](handleError(_0x4cebd0,null));};exports[_0x22d8('0x23')]=function(_0x44d9db,_0x4d7ce3){return db['Cdr'][_0x22d8('0x47')]({'where':{'id':_0x44d9db['params']['id']}})[_0x22d8('0x3b')](handleEntityNotFound(_0x4d7ce3,null))[_0x22d8('0x3b')](removeEntity(_0x4d7ce3,null))['catch'](handleError(_0x4d7ce3,null));};exports['describe']=function(_0x7972a6,_0x4faea3){return db['Cdr'][_0x22d8('0x48')]()[_0x22d8('0x3b')](respondWithResult(_0x4faea3,null))[_0x22d8('0x41')](handleError(_0x4faea3,null));}; \ No newline at end of file +var _0xe526=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','end','error','stack','name','index','map','Cdr','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','sort','pick','where','filter','merge','options','includeAll','findAll','rows','catch','show','params','rawAttributes','find','create','body','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','ejs','lodash','squel','desk.js','to-csv','querystring','papaparse','../../components/auth/service'];(function(_0x102f97,_0x5bda2f){var _0xd22058=function(_0x2ccc1f){while(--_0x2ccc1f){_0x102f97['push'](_0x102f97['shift']());}};_0xd22058(++_0x5bda2f);}(_0xe526,0x103));var _0x6e52=function(_0x2b90e2,_0x524fa1){_0x2b90e2=_0x2b90e2-0x0;var _0x2d2eef=_0xe526[_0x2b90e2];return _0x2d2eef;};'use strict';var pdf=require(_0x6e52('0x0'));var emlformat=require(_0x6e52('0x1'));var rimraf=require(_0x6e52('0x2'));var zipdir=require(_0x6e52('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6e52('0x4'));var BPromise=require(_0x6e52('0x5'));var Mustache=require(_0x6e52('0x6'));var util=require(_0x6e52('0x7'));var path=require(_0x6e52('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6e52('0x9'));var fs=require('fs');var _=require(_0x6e52('0xa'));var squel=require(_0x6e52('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6e52('0xc'));var toCsv=require(_0x6e52('0xd'));var querystring=require(_0x6e52('0xe'));var Papa=require(_0x6e52('0xf'));var Redis=require('ioredis');var authService=require(_0x6e52('0x10'));var qs=require(_0x6e52('0x11'));var as=require(_0x6e52('0x12'));var hardwareService=require(_0x6e52('0x13'));var logger=require('../../config/logger')(_0x6e52('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x56405a,_0x50bf85){_0x50bf85=_0x50bf85||0xcc;return function(_0x25d9a5){if(_0x25d9a5){return _0x56405a[_0x6e52('0x15')](_0x50bf85);}return _0x56405a[_0x6e52('0x16')](_0x50bf85)['end']();};}function respondWithResult(_0x1037c8,_0x466cda){_0x466cda=_0x466cda||0xc8;return function(_0x226331){if(_0x226331){return _0x1037c8[_0x6e52('0x16')](_0x466cda)[_0x6e52('0x17')](_0x226331);}};}function respondWithFilteredResult(_0x3deec3,_0x4cc4ed){return function(_0x3b26d3){if(_0x3b26d3){var _0xe31a00=_0x3b26d3[_0x6e52('0x18')],_0x325daa=_0x4cc4ed['offset'],_0x3cd299=_0x4cc4ed[_0x6e52('0x19')]+_0x4cc4ed[_0x6e52('0x1a')],_0x103dc4;if(_0x3cd299>=_0xe31a00){_0x3cd299=_0xe31a00;_0x103dc4=0xc8;}else{_0x103dc4=0xce;}_0x3deec3['status'](_0x103dc4);return _0x3deec3[_0x6e52('0x1b')](_0x6e52('0x1c'),_0x325daa+'-'+_0x3cd299+'/'+_0xe31a00)['json'](_0x3b26d3);}return null;};}function patchUpdates(_0x14f98f){return function(_0x38f7aa){try{jsonpatch[_0x6e52('0x1d')](_0x38f7aa,_0x14f98f,!![]);}catch(_0x30b819){return BPromise['reject'](_0x30b819);}return _0x38f7aa[_0x6e52('0x1e')]();};}function saveUpdates(_0x563864,_0x35efd6){return function(_0x3297fa){if(_0x3297fa){return _0x3297fa[_0x6e52('0x1f')](_0x563864)[_0x6e52('0x20')](function(_0x3ac54d){return _0x3ac54d;});}return null;};}function removeEntity(_0x4fd886,_0x3231f7){return function(_0xda17cc){if(_0xda17cc){return _0xda17cc[_0x6e52('0x21')]()[_0x6e52('0x20')](function(){_0x4fd886[_0x6e52('0x16')](0xcc)[_0x6e52('0x22')]();});}};}function handleEntityNotFound(_0x2e6236,_0x267363){return function(_0x37a5bd){if(!_0x37a5bd){_0x2e6236[_0x6e52('0x15')](0x194);}return _0x37a5bd;};}function handleError(_0x5d67e5,_0x11ab23){_0x11ab23=_0x11ab23||0x1f4;return function(_0x9ed94c){logger[_0x6e52('0x23')](_0x9ed94c[_0x6e52('0x24')]);if(_0x9ed94c[_0x6e52('0x25')]){delete _0x9ed94c[_0x6e52('0x25')];}_0x5d67e5[_0x6e52('0x16')](_0x11ab23)['send'](_0x9ed94c);};}exports[_0x6e52('0x26')]=function(_0x2ae4ee,_0x2f3ca4){var _0x16ccbc={},_0x215834={},_0x5ccc47={'count':0x0,'rows':[]};var _0x4f69fb=_[_0x6e52('0x27')](db[_0x6e52('0x28')]['rawAttributes'],function(_0x37d610){return{'name':_0x37d610[_0x6e52('0x29')],'type':_0x37d610[_0x6e52('0x2a')][_0x6e52('0x2b')]};});_0x215834[_0x6e52('0x2c')]=_[_0x6e52('0x27')](_0x4f69fb,_0x6e52('0x25'));_0x215834[_0x6e52('0x2d')]=_[_0x6e52('0x2e')](_0x2ae4ee['query']);_0x215834[_0x6e52('0x2f')]=_['intersection'](_0x215834[_0x6e52('0x2c')],_0x215834['query']);_0x16ccbc[_0x6e52('0x30')]=_[_0x6e52('0x31')](_0x215834['model'],qs[_0x6e52('0x32')](_0x2ae4ee[_0x6e52('0x2d')][_0x6e52('0x32')]));_0x16ccbc[_0x6e52('0x30')]=_0x16ccbc[_0x6e52('0x30')][_0x6e52('0x33')]?_0x16ccbc[_0x6e52('0x30')]:_0x215834['model'];if(!_0x2ae4ee[_0x6e52('0x2d')]['hasOwnProperty'](_0x6e52('0x34'))){_0x16ccbc[_0x6e52('0x1a')]=qs['limit'](_0x2ae4ee['query']['limit']);_0x16ccbc[_0x6e52('0x19')]=qs[_0x6e52('0x19')](_0x2ae4ee[_0x6e52('0x2d')][_0x6e52('0x19')]);}_0x16ccbc['order']=qs[_0x6e52('0x35')](_0x2ae4ee[_0x6e52('0x2d')][_0x6e52('0x35')]);_0x16ccbc['where']=qs[_0x6e52('0x2f')](_[_0x6e52('0x36')](_0x2ae4ee[_0x6e52('0x2d')],_0x215834['filters']));if(_0x2ae4ee[_0x6e52('0x2d')]['filter']){_0x16ccbc[_0x6e52('0x37')]=_['merge'](_0x16ccbc[_0x6e52('0x37')],{'$or':_[_0x6e52('0x27')](_0x4f69fb,function(_0x17365c){if(_0x17365c[_0x6e52('0x2a')]!=='VIRTUAL'){var _0x5e2702={};_0x5e2702[_0x17365c[_0x6e52('0x25')]]={'$like':'%'+_0x2ae4ee['query'][_0x6e52('0x38')]+'%'};return _0x5e2702;}})});}_0x16ccbc=_[_0x6e52('0x39')]({},_0x16ccbc,_0x2ae4ee[_0x6e52('0x3a')]);var _0x38d740={'where':_0x16ccbc[_0x6e52('0x37')]};return db[_0x6e52('0x28')]['count'](_0x38d740)[_0x6e52('0x20')](function(_0x359a78){_0x5ccc47[_0x6e52('0x18')]=_0x359a78;if(_0x2ae4ee['query'][_0x6e52('0x3b')]){_0x16ccbc['include']=[{'all':!![]}];}return db[_0x6e52('0x28')][_0x6e52('0x3c')](_0x16ccbc);})[_0x6e52('0x20')](function(_0x35db07){_0x5ccc47[_0x6e52('0x3d')]=_0x35db07;return _0x5ccc47;})[_0x6e52('0x20')](respondWithFilteredResult(_0x2f3ca4,_0x16ccbc))[_0x6e52('0x3e')](handleError(_0x2f3ca4,null));};exports[_0x6e52('0x3f')]=function(_0x251a98,_0xa40ca9){var _0x3cc574={'raw':!![],'where':{'id':_0x251a98[_0x6e52('0x40')]['id']}},_0x43a7ef={};_0x43a7ef[_0x6e52('0x2c')]=_[_0x6e52('0x2e')](db['Cdr'][_0x6e52('0x41')]);_0x43a7ef[_0x6e52('0x2d')]=_[_0x6e52('0x2e')](_0x251a98[_0x6e52('0x2d')]);_0x43a7ef['filters']=_['intersection'](_0x43a7ef['model'],_0x43a7ef[_0x6e52('0x2d')]);_0x3cc574['attributes']=_[_0x6e52('0x31')](_0x43a7ef['model'],qs[_0x6e52('0x32')](_0x251a98[_0x6e52('0x2d')]['fields']));_0x3cc574[_0x6e52('0x30')]=_0x3cc574[_0x6e52('0x30')][_0x6e52('0x33')]?_0x3cc574['attributes']:_0x43a7ef[_0x6e52('0x2c')];if(_0x251a98[_0x6e52('0x2d')][_0x6e52('0x3b')]){_0x3cc574['include']=[{'all':!![]}];}_0x3cc574=_['merge']({},_0x3cc574,_0x251a98[_0x6e52('0x3a')]);return db[_0x6e52('0x28')][_0x6e52('0x42')](_0x3cc574)['then'](handleEntityNotFound(_0xa40ca9,null))[_0x6e52('0x20')](respondWithResult(_0xa40ca9,null))[_0x6e52('0x3e')](handleError(_0xa40ca9,null));};exports[_0x6e52('0x43')]=function(_0x5adc16,_0x2fe67c){return db[_0x6e52('0x28')][_0x6e52('0x43')](_0x5adc16[_0x6e52('0x44')],{})[_0x6e52('0x20')](respondWithResult(_0x2fe67c,0xc9))['catch'](handleError(_0x2fe67c,null));};exports[_0x6e52('0x1f')]=function(_0x3f050c,_0x5e23d6){if(_0x3f050c[_0x6e52('0x44')]['id']){delete _0x3f050c['body']['id'];}return db[_0x6e52('0x28')][_0x6e52('0x42')]({'where':{'id':_0x3f050c[_0x6e52('0x40')]['id']}})[_0x6e52('0x20')](handleEntityNotFound(_0x5e23d6,null))[_0x6e52('0x20')](saveUpdates(_0x3f050c[_0x6e52('0x44')],null))[_0x6e52('0x20')](respondWithResult(_0x5e23d6,null))[_0x6e52('0x3e')](handleError(_0x5e23d6,null));};exports[_0x6e52('0x21')]=function(_0x2f9520,_0x27412a){return db[_0x6e52('0x28')][_0x6e52('0x42')]({'where':{'id':_0x2f9520[_0x6e52('0x40')]['id']}})[_0x6e52('0x20')](handleEntityNotFound(_0x27412a,null))[_0x6e52('0x20')](removeEntity(_0x27412a,null))[_0x6e52('0x3e')](handleError(_0x27412a,null));};exports['describe']=function(_0xf62b8d,_0x21fd9f){return db[_0x6e52('0x28')]['describe']()[_0x6e52('0x20')](respondWithResult(_0x21fd9f,null))[_0x6e52('0x3e')](handleError(_0x21fd9f,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 9a18f2f..e7c5139 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 _0x9536=['api','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports','define','Cdr','cdr','accountcode','calldate','disposition','dst','src','uniqueid','lodash','util','../../config/logger'];(function(_0x5d3d64,_0x4eea8a){var _0x1de48f=function(_0x4f40d9){while(--_0x4f40d9){_0x5d3d64['push'](_0x5d3d64['shift']());}};_0x1de48f(++_0x4eea8a);}(_0x9536,0x179));var _0x6953=function(_0xbc2974,_0xec3342){_0xbc2974=_0xbc2974-0x0;var _0x3a5b4f=_0x9536[_0xbc2974];return _0x3a5b4f;};'use strict';var _=require(_0x6953('0x0'));var util=require(_0x6953('0x1'));var logger=require(_0x6953('0x2'))(_0x6953('0x3'));var moment=require('moment');var BPromise=require(_0x6953('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6953('0x5'));var rimraf=require(_0x6953('0x6'));var config=require(_0x6953('0x7'));var attributes=require(_0x6953('0x8'));module[_0x6953('0x9')]=function(_0x494ac2,_0x2b273e){return _0x494ac2[_0x6953('0xa')](_0x6953('0xb'),attributes,{'tableName':_0x6953('0xc'),'paranoid':![],'indexes':[{'name':_0x6953('0xd'),'fields':['accountcode']},{'name':_0x6953('0xe'),'fields':[_0x6953('0xe')]},{'name':_0x6953('0xf'),'fields':['disposition']},{'name':_0x6953('0x10'),'fields':[_0x6953('0x10')]},{'name':_0x6953('0x11'),'fields':[_0x6953('0x11')]},{'name':_0x6953('0x12'),'fields':[_0x6953('0x12')]}],'timestamps':![]});}; \ No newline at end of file +var _0x2542=['lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports','define','Cdr','cdr','accountcode','calldate','disposition','dst','src','uniqueid'];(function(_0x5dafd0,_0x3bcbb6){var _0x364354=function(_0x5da31c){while(--_0x5da31c){_0x5dafd0['push'](_0x5dafd0['shift']());}};_0x364354(++_0x3bcbb6);}(_0x2542,0x169));var _0x2254=function(_0x430f75,_0x4ac140){_0x430f75=_0x430f75-0x0;var _0x452fa5=_0x2542[_0x430f75];return _0x452fa5;};'use strict';var _=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var logger=require(_0x2254('0x2'))(_0x2254('0x3'));var moment=require('moment');var BPromise=require(_0x2254('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2254('0x5'));var rimraf=require(_0x2254('0x6'));var config=require(_0x2254('0x7'));var attributes=require(_0x2254('0x8'));module[_0x2254('0x9')]=function(_0x508183,_0x19ad3c){return _0x508183[_0x2254('0xa')](_0x2254('0xb'),attributes,{'tableName':_0x2254('0xc'),'paranoid':![],'indexes':[{'name':_0x2254('0xd'),'fields':[_0x2254('0xd')]},{'name':_0x2254('0xe'),'fields':[_0x2254('0xe')]},{'name':_0x2254('0xf'),'fields':[_0x2254('0xf')]},{'name':_0x2254('0x10'),'fields':['dst']},{'name':_0x2254('0x11'),'fields':[_0x2254('0x11')]},{'name':_0x2254('0x12'),'fields':[_0x2254('0x12')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index 971695a..d9755a9 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 _0x4832=['Cdr,\x20%s,\x20%s','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x52e986,_0x2d4e6){var _0xb3740d=function(_0x38fe03){while(--_0x38fe03){_0x52e986['push'](_0x52e986['shift']());}};_0xb3740d(++_0x2d4e6);}(_0x4832,0x14b));var _0x2483=function(_0x28669c,_0x1f62c4){_0x28669c=_0x28669c-0x0;var _0x4a3af6=_0x4832[_0x28669c];return _0x4a3af6;};'use strict';var _=require(_0x2483('0x0'));var util=require('util');var moment=require(_0x2483('0x1'));var BPromise=require(_0x2483('0x2'));var rs=require(_0x2483('0x3'));var fs=require('fs');var Redis=require(_0x2483('0x4'));var db=require(_0x2483('0x5'))['db'];var utils=require(_0x2483('0x6'));var logger=require(_0x2483('0x7'))(_0x2483('0x8'));var config=require(_0x2483('0x9'));var jayson=require(_0x2483('0xa'));var client=jayson[_0x2483('0xb')][_0x2483('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4a6c15,_0x48ce0c,_0x15cfc9){return new BPromise(function(_0x39297d,_0x45488b){return client['request'](_0x4a6c15,_0x15cfc9)[_0x2483('0xd')](function(_0x1e888b){logger['info'](_0x2483('0xe'),_0x48ce0c,_0x2483('0xf'));logger['debug'](_0x2483('0x10'),_0x48ce0c,_0x2483('0xf'),JSON[_0x2483('0x11')](_0x1e888b));if(_0x1e888b[_0x2483('0x12')]){if(_0x1e888b[_0x2483('0x12')][_0x2483('0x13')]===0x1f4){logger[_0x2483('0x12')](_0x2483('0xe'),_0x48ce0c,_0x1e888b[_0x2483('0x12')][_0x2483('0x14')]);return _0x45488b(_0x1e888b[_0x2483('0x12')]['message']);}logger[_0x2483('0x12')]('Cdr,\x20%s,\x20%s',_0x48ce0c,_0x1e888b[_0x2483('0x12')]['message']);return _0x39297d(_0x1e888b['error'][_0x2483('0x14')]);}else{logger[_0x2483('0x15')]('Cdr,\x20%s,\x20%s',_0x48ce0c,_0x2483('0xf'));_0x39297d(_0x1e888b['result']['message']);}})[_0x2483('0x16')](function(_0x5bef12){logger[_0x2483('0x12')](_0x2483('0xe'),_0x48ce0c,_0x5bef12);_0x45488b(_0x5bef12);});});} \ No newline at end of file +var _0x1b60=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s'];(function(_0x5ddbd1,_0x47e7f8){var _0x398fbb=function(_0x4430f0){while(--_0x4430f0){_0x5ddbd1['push'](_0x5ddbd1['shift']());}};_0x398fbb(++_0x47e7f8);}(_0x1b60,0x83));var _0x01b6=function(_0x16c033,_0x47c180){_0x16c033=_0x16c033-0x0;var _0x113421=_0x1b60[_0x16c033];return _0x113421;};'use strict';var _=require(_0x01b6('0x0'));var util=require(_0x01b6('0x1'));var moment=require(_0x01b6('0x2'));var BPromise=require(_0x01b6('0x3'));var rs=require(_0x01b6('0x4'));var fs=require('fs');var Redis=require(_0x01b6('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x01b6('0x6'));var logger=require(_0x01b6('0x7'))(_0x01b6('0x8'));var config=require(_0x01b6('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x01b6('0xa')][_0x01b6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x153601,_0x80d53b,_0x41cd14){return new BPromise(function(_0x41acc3,_0x39bab6){return client[_0x01b6('0xc')](_0x153601,_0x41cd14)[_0x01b6('0xd')](function(_0x2348e2){logger[_0x01b6('0xe')](_0x01b6('0xf'),_0x80d53b,_0x01b6('0x10'));logger[_0x01b6('0x11')](_0x01b6('0x12'),_0x80d53b,_0x01b6('0x10'),JSON[_0x01b6('0x13')](_0x2348e2));if(_0x2348e2[_0x01b6('0x14')]){if(_0x2348e2[_0x01b6('0x14')][_0x01b6('0x15')]===0x1f4){logger['error']('Cdr,\x20%s,\x20%s',_0x80d53b,_0x2348e2[_0x01b6('0x14')][_0x01b6('0x16')]);return _0x39bab6(_0x2348e2['error'][_0x01b6('0x16')]);}logger[_0x01b6('0x14')](_0x01b6('0xf'),_0x80d53b,_0x2348e2[_0x01b6('0x14')][_0x01b6('0x16')]);return _0x41acc3(_0x2348e2[_0x01b6('0x14')][_0x01b6('0x16')]);}else{logger[_0x01b6('0xe')](_0x01b6('0xf'),_0x80d53b,_0x01b6('0x10'));_0x41acc3(_0x2348e2[_0x01b6('0x17')][_0x01b6('0x16')]);}})[_0x01b6('0x18')](function(_0x54082d){logger[_0x01b6('0x14')](_0x01b6('0xf'),_0x80d53b,_0x54082d);_0x39bab6(_0x54082d);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 105a970..007ad4f 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 _0xb65f=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','post','put','update','multer','util','path','connect-timeout','express'];(function(_0x531db8,_0x52a7ad){var _0x32059b=function(_0x5573cf){while(--_0x5573cf){_0x531db8['push'](_0x531db8['shift']());}};_0x32059b(++_0x52a7ad);}(_0xb65f,0x1ab));var _0xfb65=function(_0x11ebac,_0x476a52){_0x11ebac=_0x11ebac-0x0;var _0x29ae69=_0xb65f[_0x11ebac];return _0x29ae69;};'use strict';var multer=require(_0xfb65('0x0'));var util=require(_0xfb65('0x1'));var path=require(_0xfb65('0x2'));var timeout=require(_0xfb65('0x3'));var express=require(_0xfb65('0x4'));var router=express[_0xfb65('0x5')]();var auth=require(_0xfb65('0x6'));var interaction=require(_0xfb65('0x7'));var config=require(_0xfb65('0x8'));var controller=require('./cdr.controller');router[_0xfb65('0x9')]('/',auth[_0xfb65('0xa')](),controller[_0xfb65('0xb')]);router[_0xfb65('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xfb65('0xc')]);router[_0xfb65('0x9')](_0xfb65('0xd'),auth['isAuthenticated'](),controller[_0xfb65('0xe')]);router[_0xfb65('0xf')]('/',auth[_0xfb65('0xa')](),controller['create']);router[_0xfb65('0x10')](_0xfb65('0xd'),auth[_0xfb65('0xa')](),controller[_0xfb65('0x11')]);router['delete']('/:id',auth[_0xfb65('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x485a=['post','isAuthenticated','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','describe','/:id'];(function(_0x4a9dd9,_0x4a991c){var _0x441928=function(_0x19be27){while(--_0x19be27){_0x4a9dd9['push'](_0x4a9dd9['shift']());}};_0x441928(++_0x4a991c);}(_0x485a,0x1ac));var _0xa485=function(_0x505dcb,_0x3d3646){_0x505dcb=_0x505dcb-0x0;var _0x3f1944=_0x485a[_0x505dcb];return _0x3f1944;};'use strict';var multer=require('multer');var util=require(_0xa485('0x0'));var path=require(_0xa485('0x1'));var timeout=require(_0xa485('0x2'));var express=require(_0xa485('0x3'));var router=express[_0xa485('0x4')]();var auth=require(_0xa485('0x5'));var interaction=require(_0xa485('0x6'));var config=require(_0xa485('0x7'));var controller=require('./cdr.controller');router[_0xa485('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xa485('0x8')](_0xa485('0x9'),auth['isAuthenticated'](),controller[_0xa485('0xa')]);router[_0xa485('0x8')](_0xa485('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xa485('0xc')]('/',auth[_0xa485('0xd')](),controller[_0xa485('0xe')]);router[_0xa485('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xa485('0x10')]);router[_0xa485('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xa485('0x12')]);module[_0xa485('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index 977fa42..42becdf 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 _0x626e=['INTEGER','STRING','TEXT','sequelize'];(function(_0x1cf886,_0xd171f9){var _0x1fc5f1=function(_0xd7997a){while(--_0xd7997a){_0x1cf886['push'](_0x1cf886['shift']());}};_0x1fc5f1(++_0xd171f9);}(_0x626e,0xf3));var _0xe626=function(_0x32007b,_0x16a2f5){_0x32007b=_0x32007b-0x0;var _0x1bd22a=_0x626e[_0x32007b];return _0x1bd22a;};'use strict';var Sequelize=require(_0xe626('0x0'));module['exports']={'priority':{'type':Sequelize[_0xe626('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xe626('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xe626('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xe626('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xa879=['STRING','sequelize','exports','INTEGER','noop','TEXT'];(function(_0x46e35b,_0x4e4a13){var _0x2398c2=function(_0x59fae3){while(--_0x59fae3){_0x46e35b['push'](_0x46e35b['shift']());}};_0x2398c2(++_0x4e4a13);}(_0xa879,0x1ab));var _0x9a87=function(_0x863485,_0x487634){_0x863485=_0x863485-0x0;var _0x3b2d45=_0xa879[_0x863485];return _0x3b2d45;};'use strict';var Sequelize=require(_0x9a87('0x0'));module[_0x9a87('0x1')]={'priority':{'type':Sequelize[_0x9a87('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9a87('0x3')},'appdata':{'type':Sequelize[_0x9a87('0x4')]()},'description':{'type':Sequelize[_0x9a87('0x5')]},'interval':{'type':Sequelize[_0x9a87('0x5')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index ab5aaf5..675737b 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 _0x7c65=['params','rimraf','fast-json-patch','request-promise','moment','path','sox','to-csv','lodash','crypto','desk.js','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','limit','status','apply','reject','destroy','error','stack','name','send','model','keys','query','filters','intersection','attributes','length','includeAll','include','merge','options','find','then','catch','update','body','ChatApplication'];(function(_0x467ed3,_0x27f1f5){var _0x3bb3d2=function(_0x2c0201){while(--_0x2c0201){_0x467ed3['push'](_0x467ed3['shift']());}};_0x3bb3d2(++_0x27f1f5);}(_0x7c65,0xc9));var _0x57c6=function(_0x43974b,_0x4a90b1){_0x43974b=_0x43974b-0x0;var _0x3ba6ae=_0x7c65[_0x43974b];return _0x3ba6ae;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x57c6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x57c6('0x1'));var rp=require(_0x57c6('0x2'));var moment=require(_0x57c6('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x57c6('0x4'));var sox=require(_0x57c6('0x5'));var csv=require(_0x57c6('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x57c6('0x7'));var squel=require('squel');var crypto=require(_0x57c6('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x57c6('0x9'));var toCsv=require(_0x57c6('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x57c6('0xa'));var as=require(_0x57c6('0xb'));var hardwareService=require(_0x57c6('0xc'));var logger=require(_0x57c6('0xd'))(_0x57c6('0xe'));var utils=require(_0x57c6('0xf'));var config=require(_0x57c6('0x10'));var db=require(_0x57c6('0x11'))['db'];function respondWithStatusCode(_0x3f9ead,_0x1a3b86){_0x1a3b86=_0x1a3b86||0xcc;return function(_0x238c07){if(_0x238c07){return _0x3f9ead[_0x57c6('0x12')](_0x1a3b86);}return _0x3f9ead['status'](_0x1a3b86)[_0x57c6('0x13')]();};}function respondWithResult(_0x1f8a28,_0x17e8e8){_0x17e8e8=_0x17e8e8||0xc8;return function(_0x561980){if(_0x561980){return _0x1f8a28['status'](_0x17e8e8)[_0x57c6('0x14')](_0x561980);}};}function respondWithFilteredResult(_0x5b5bed,_0x307ac1){return function(_0x246b31){if(_0x246b31){var _0x41c2c6=_0x246b31[_0x57c6('0x15')],_0xac3313=_0x307ac1['offset'],_0x597c53=_0x307ac1[_0x57c6('0x16')]+_0x307ac1[_0x57c6('0x17')],_0x51f42f;if(_0x597c53>=_0x41c2c6){_0x597c53=_0x41c2c6;_0x51f42f=0xc8;}else{_0x51f42f=0xce;}_0x5b5bed[_0x57c6('0x18')](_0x51f42f);return _0x5b5bed['set']('Content-Range',_0xac3313+'-'+_0x597c53+'/'+_0x41c2c6)[_0x57c6('0x14')](_0x246b31);}return null;};}function patchUpdates(_0x3797a1){return function(_0x517191){try{jsonpatch[_0x57c6('0x19')](_0x517191,_0x3797a1,!![]);}catch(_0x131a9a){return BPromise[_0x57c6('0x1a')](_0x131a9a);}return _0x517191['save']();};}function saveUpdates(_0x3dd8ad,_0x3f1148){return function(_0x4fcda1){if(_0x4fcda1){return _0x4fcda1['update'](_0x3dd8ad)['then'](function(_0x50829f){return _0x50829f;});}return null;};}function removeEntity(_0x23def7,_0x28c67d){return function(_0x254734){if(_0x254734){return _0x254734[_0x57c6('0x1b')]()['then'](function(){_0x23def7['status'](0xcc)[_0x57c6('0x13')]();});}};}function handleEntityNotFound(_0x5239d8,_0x57396f){return function(_0x475f96){if(!_0x475f96){_0x5239d8[_0x57c6('0x12')](0x194);}return _0x475f96;};}function handleError(_0x1dcee9,_0x1c015b){_0x1c015b=_0x1c015b||0x1f4;return function(_0x1ad79c){logger[_0x57c6('0x1c')](_0x1ad79c[_0x57c6('0x1d')]);if(_0x1ad79c['name']){delete _0x1ad79c[_0x57c6('0x1e')];}_0x1dcee9[_0x57c6('0x18')](_0x1c015b)[_0x57c6('0x1f')](_0x1ad79c);};}exports['show']=function(_0x3aad5c,_0x334ba1){var _0x405053={'raw':!![],'where':{'id':_0x3aad5c['params']['id']}},_0x261f66={};_0x261f66[_0x57c6('0x20')]=_[_0x57c6('0x21')](db['ChatApplication']['rawAttributes']);_0x261f66['query']=_[_0x57c6('0x21')](_0x3aad5c[_0x57c6('0x22')]);_0x261f66[_0x57c6('0x23')]=_[_0x57c6('0x24')](_0x261f66[_0x57c6('0x20')],_0x261f66['query']);_0x405053['attributes']=_[_0x57c6('0x24')](_0x261f66[_0x57c6('0x20')],qs['fields'](_0x3aad5c[_0x57c6('0x22')]['fields']));_0x405053[_0x57c6('0x25')]=_0x405053['attributes'][_0x57c6('0x26')]?_0x405053[_0x57c6('0x25')]:_0x261f66[_0x57c6('0x20')];if(_0x3aad5c[_0x57c6('0x22')][_0x57c6('0x27')]){_0x405053[_0x57c6('0x28')]=[{'all':!![]}];}_0x405053=_[_0x57c6('0x29')]({},_0x405053,_0x3aad5c[_0x57c6('0x2a')]);return db['ChatApplication'][_0x57c6('0x2b')](_0x405053)[_0x57c6('0x2c')](handleEntityNotFound(_0x334ba1,null))[_0x57c6('0x2c')](respondWithResult(_0x334ba1,null))[_0x57c6('0x2d')](handleError(_0x334ba1,null));};exports[_0x57c6('0x2e')]=function(_0x591089,_0x15ea92){if(_0x591089['body']['id']){delete _0x591089[_0x57c6('0x2f')]['id'];}return db[_0x57c6('0x30')]['find']({'where':{'id':_0x591089[_0x57c6('0x31')]['id']}})['then'](handleEntityNotFound(_0x15ea92,null))[_0x57c6('0x2c')](saveUpdates(_0x591089[_0x57c6('0x2f')],null))[_0x57c6('0x2c')](respondWithResult(_0x15ea92,null))[_0x57c6('0x2d')](handleError(_0x15ea92,null));};exports['destroy']=function(_0x49e41e,_0x1654a0){return db[_0x57c6('0x30')]['find']({'where':{'id':_0x49e41e[_0x57c6('0x31')]['id']}})[_0x57c6('0x2c')](handleEntityNotFound(_0x1654a0,null))['then'](removeEntity(_0x1654a0,null))[_0x57c6('0x2d')](handleError(_0x1654a0,null));}; \ No newline at end of file +var _0x6998=['Content-Range','apply','reject','save','update','then','error','stack','name','send','show','params','model','keys','ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','length','include','options','find','body','destroy','catch','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','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','sendStatus','status','json','count','offset','limit','set'];(function(_0x5803d1,_0x5d65b6){var _0x53b621=function(_0x8a1feb){while(--_0x8a1feb){_0x5803d1['push'](_0x5803d1['shift']());}};_0x53b621(++_0x5d65b6);}(_0x6998,0x92));var _0x8699=function(_0x273dc5,_0x268a81){_0x273dc5=_0x273dc5-0x0;var _0x46dae7=_0x6998[_0x273dc5];return _0x46dae7;};'use strict';var pdf=require(_0x8699('0x0'));var emlformat=require(_0x8699('0x1'));var rimraf=require(_0x8699('0x2'));var zipdir=require(_0x8699('0x3'));var jsonpatch=require(_0x8699('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8699('0x5'));var Mustache=require(_0x8699('0x6'));var util=require('util');var path=require(_0x8699('0x7'));var sox=require(_0x8699('0x8'));var csv=require(_0x8699('0x9'));var ejs=require(_0x8699('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x8699('0xb'));var crypto=require(_0x8699('0xc'));var jsforce=require(_0x8699('0xd'));var deskjs=require(_0x8699('0xe'));var toCsv=require(_0x8699('0x9'));var querystring=require(_0x8699('0xf'));var Papa=require(_0x8699('0x10'));var Redis=require(_0x8699('0x11'));var authService=require(_0x8699('0x12'));var qs=require(_0x8699('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8699('0x14'));var logger=require(_0x8699('0x15'))(_0x8699('0x16'));var utils=require(_0x8699('0x17'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x49faa1,_0x3e6d72){_0x3e6d72=_0x3e6d72||0xcc;return function(_0x3c8685){if(_0x3c8685){return _0x49faa1[_0x8699('0x18')](_0x3e6d72);}return _0x49faa1['status'](_0x3e6d72)['end']();};}function respondWithResult(_0x5af61f,_0x523e62){_0x523e62=_0x523e62||0xc8;return function(_0x28040f){if(_0x28040f){return _0x5af61f[_0x8699('0x19')](_0x523e62)[_0x8699('0x1a')](_0x28040f);}};}function respondWithFilteredResult(_0xe5e050,_0x3d5957){return function(_0x48e078){if(_0x48e078){var _0x4be2f9=_0x48e078[_0x8699('0x1b')],_0x5a4aba=_0x3d5957['offset'],_0x54d1e3=_0x3d5957[_0x8699('0x1c')]+_0x3d5957[_0x8699('0x1d')],_0x3502f8;if(_0x54d1e3>=_0x4be2f9){_0x54d1e3=_0x4be2f9;_0x3502f8=0xc8;}else{_0x3502f8=0xce;}_0xe5e050['status'](_0x3502f8);return _0xe5e050[_0x8699('0x1e')](_0x8699('0x1f'),_0x5a4aba+'-'+_0x54d1e3+'/'+_0x4be2f9)[_0x8699('0x1a')](_0x48e078);}return null;};}function patchUpdates(_0x2e5504){return function(_0x1e2298){try{jsonpatch[_0x8699('0x20')](_0x1e2298,_0x2e5504,!![]);}catch(_0x4a950d){return BPromise[_0x8699('0x21')](_0x4a950d);}return _0x1e2298[_0x8699('0x22')]();};}function saveUpdates(_0xfb29ef,_0x2379c1){return function(_0x5d8c42){if(_0x5d8c42){return _0x5d8c42[_0x8699('0x23')](_0xfb29ef)[_0x8699('0x24')](function(_0x5d0039){return _0x5d0039;});}return null;};}function removeEntity(_0xf608d5,_0x1be7ce){return function(_0x1579f7){if(_0x1579f7){return _0x1579f7['destroy']()[_0x8699('0x24')](function(){_0xf608d5[_0x8699('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c18e4,_0x550198){return function(_0x159be9){if(!_0x159be9){_0x2c18e4[_0x8699('0x18')](0x194);}return _0x159be9;};}function handleError(_0x4a8b8a,_0x5def88){_0x5def88=_0x5def88||0x1f4;return function(_0x56dfbf){logger[_0x8699('0x25')](_0x56dfbf[_0x8699('0x26')]);if(_0x56dfbf[_0x8699('0x27')]){delete _0x56dfbf[_0x8699('0x27')];}_0x4a8b8a[_0x8699('0x19')](_0x5def88)[_0x8699('0x28')](_0x56dfbf);};}exports[_0x8699('0x29')]=function(_0x561ec1,_0x6ebeb6){var _0x178299={'raw':!![],'where':{'id':_0x561ec1[_0x8699('0x2a')]['id']}},_0x3c59c0={};_0x3c59c0[_0x8699('0x2b')]=_[_0x8699('0x2c')](db[_0x8699('0x2d')][_0x8699('0x2e')]);_0x3c59c0['query']=_[_0x8699('0x2c')](_0x561ec1[_0x8699('0x2f')]);_0x3c59c0[_0x8699('0x30')]=_[_0x8699('0x31')](_0x3c59c0[_0x8699('0x2b')],_0x3c59c0[_0x8699('0x2f')]);_0x178299[_0x8699('0x32')]=_[_0x8699('0x31')](_0x3c59c0[_0x8699('0x2b')],qs['fields'](_0x561ec1['query'][_0x8699('0x33')]));_0x178299['attributes']=_0x178299[_0x8699('0x32')][_0x8699('0x34')]?_0x178299['attributes']:_0x3c59c0[_0x8699('0x2b')];if(_0x561ec1[_0x8699('0x2f')]['includeAll']){_0x178299[_0x8699('0x35')]=[{'all':!![]}];}_0x178299=_['merge']({},_0x178299,_0x561ec1[_0x8699('0x36')]);return db[_0x8699('0x2d')][_0x8699('0x37')](_0x178299)[_0x8699('0x24')](handleEntityNotFound(_0x6ebeb6,null))[_0x8699('0x24')](respondWithResult(_0x6ebeb6,null))['catch'](handleError(_0x6ebeb6,null));};exports[_0x8699('0x23')]=function(_0x5d1774,_0x5e5ef9){if(_0x5d1774[_0x8699('0x38')]['id']){delete _0x5d1774['body']['id'];}return db['ChatApplication'][_0x8699('0x37')]({'where':{'id':_0x5d1774[_0x8699('0x2a')]['id']}})[_0x8699('0x24')](handleEntityNotFound(_0x5e5ef9,null))[_0x8699('0x24')](saveUpdates(_0x5d1774[_0x8699('0x38')],null))[_0x8699('0x24')](respondWithResult(_0x5e5ef9,null))['catch'](handleError(_0x5e5ef9,null));};exports[_0x8699('0x39')]=function(_0x3afbea,_0x477b65){return db['ChatApplication']['find']({'where':{'id':_0x3afbea[_0x8699('0x2a')]['id']}})[_0x8699('0x24')](handleEntityNotFound(_0x477b65,null))['then'](removeEntity(_0x477b65,null))[_0x8699('0x3a')](handleError(_0x477b65,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index f946b2d..3ce065c 100644 --- a/server/api/chatApplication/chatApplication.model.js +++ b/server/api/chatApplication/chatApplication.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['define','ChatApplication','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','exports'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0a9e('0xb')});}; \ No newline at end of file +var _0xa9e0=['define','ChatApplication','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','exports'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0a9e('0xb')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 66999c5..5d23e08 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 _0x916d=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','moment','randomstring'];(function(_0xf13be4,_0x11cf9c){var _0x99969a=function(_0xb55edd){while(--_0xb55edd){_0xf13be4['push'](_0xf13be4['shift']());}};_0x99969a(++_0x11cf9c);}(_0x916d,0x1a0));var _0xd916=function(_0x4062e8,_0x201f8f){_0x4062e8=_0x4062e8-0x0;var _0xe52a68=_0x916d[_0x4062e8];return _0xe52a68;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd916('0x0'));var BPromise=require('bluebird');var rs=require(_0xd916('0x1'));var fs=require('fs');var Redis=require(_0xd916('0x2'));var db=require(_0xd916('0x3'))['db'];var utils=require(_0xd916('0x4'));var logger=require(_0xd916('0x5'))(_0xd916('0x6'));var config=require(_0xd916('0x7'));var jayson=require(_0xd916('0x8'));var client=jayson[_0xd916('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x12a2d0,_0x3a6375,_0x2cf251){return new BPromise(function(_0x2cabb8,_0x514291){return client[_0xd916('0xa')](_0x12a2d0,_0x2cf251)[_0xd916('0xb')](function(_0x32d0ae){logger['info'](_0xd916('0xc'),_0x3a6375,_0xd916('0xd'));logger[_0xd916('0xe')](_0xd916('0xf'),_0x3a6375,'request\x20sent',JSON['stringify'](_0x32d0ae));if(_0x32d0ae[_0xd916('0x10')]){if(_0x32d0ae[_0xd916('0x10')][_0xd916('0x11')]===0x1f4){logger[_0xd916('0x10')](_0xd916('0xc'),_0x3a6375,_0x32d0ae[_0xd916('0x10')]['message']);return _0x514291(_0x32d0ae[_0xd916('0x10')][_0xd916('0x12')]);}logger['error'](_0xd916('0xc'),_0x3a6375,_0x32d0ae['error'][_0xd916('0x12')]);return _0x2cabb8(_0x32d0ae[_0xd916('0x10')][_0xd916('0x12')]);}else{logger[_0xd916('0x13')](_0xd916('0xc'),_0x3a6375,_0xd916('0xd'));_0x2cabb8(_0x32d0ae[_0xd916('0x14')][_0xd916('0x12')]);}})[_0xd916('0x15')](function(_0x9fc5c2){logger[_0xd916('0x10')](_0xd916('0xc'),_0x3a6375,_0x9fc5c2);_0x514291(_0x9fc5c2);});});} \ No newline at end of file +var _0xb64b=['request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','message','ChatApplication,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','info'];(function(_0x3a04c6,_0x12a482){var _0xf4131a=function(_0x413ea2){while(--_0x413ea2){_0x3a04c6['push'](_0x3a04c6['shift']());}};_0xf4131a(++_0x12a482);}(_0xb64b,0x134));var _0xbb64=function(_0x31c3ec,_0x41a015){_0x31c3ec=_0x31c3ec-0x0;var _0x319164=_0xb64b[_0x31c3ec];return _0x319164;};'use strict';var _=require(_0xbb64('0x0'));var util=require(_0xbb64('0x1'));var moment=require(_0xbb64('0x2'));var BPromise=require(_0xbb64('0x3'));var rs=require(_0xbb64('0x4'));var fs=require('fs');var Redis=require(_0xbb64('0x5'));var db=require(_0xbb64('0x6'))['db'];var utils=require(_0xbb64('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xbb64('0x8'));var jayson=require(_0xbb64('0x9'));var client=jayson[_0xbb64('0xa')][_0xbb64('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x524c73,_0x450ddd,_0x32f417){return new BPromise(function(_0x50f376,_0x1bf4f3){return client['request'](_0x524c73,_0x32f417)[_0xbb64('0xc')](function(_0x5427c8){logger[_0xbb64('0xd')]('ChatApplication,\x20%s,\x20%s',_0x450ddd,_0xbb64('0xe'));logger[_0xbb64('0xf')](_0xbb64('0x10'),_0x450ddd,_0xbb64('0xe'),JSON['stringify'](_0x5427c8));if(_0x5427c8['error']){if(_0x5427c8[_0xbb64('0x11')][_0xbb64('0x12')]===0x1f4){logger[_0xbb64('0x11')]('ChatApplication,\x20%s,\x20%s',_0x450ddd,_0x5427c8[_0xbb64('0x11')][_0xbb64('0x13')]);return _0x1bf4f3(_0x5427c8[_0xbb64('0x11')][_0xbb64('0x13')]);}logger[_0xbb64('0x11')](_0xbb64('0x14'),_0x450ddd,_0x5427c8[_0xbb64('0x11')][_0xbb64('0x13')]);return _0x50f376(_0x5427c8[_0xbb64('0x11')][_0xbb64('0x13')]);}else{logger['info'](_0xbb64('0x14'),_0x450ddd,'request\x20sent');_0x50f376(_0x5427c8[_0xbb64('0x15')]['message']);}})[_0xbb64('0x16')](function(_0x264e9e){logger[_0xbb64('0x11')](_0xbb64('0x14'),_0x450ddd,_0x264e9e);_0x1bf4f3(_0x264e9e);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index da1a837..b282ef5 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 _0x89d2=['multer','path','express','../../components/auth/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show','put','delete','destroy','exports'];(function(_0x56ef27,_0x4b8894){var _0x457ae3=function(_0x2a0853){while(--_0x2a0853){_0x56ef27['push'](_0x56ef27['shift']());}};_0x457ae3(++_0x4b8894);}(_0x89d2,0x150));var _0x289d=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x89d2[_0x55f8b4];return _0x2475f9;};'use strict';var multer=require(_0x289d('0x0'));var util=require('util');var path=require(_0x289d('0x1'));var timeout=require('connect-timeout');var express=require(_0x289d('0x2'));var router=express['Router']();var auth=require(_0x289d('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x289d('0x4'));var controller=require(_0x289d('0x5'));router[_0x289d('0x6')](_0x289d('0x7'),auth[_0x289d('0x8')](),controller[_0x289d('0x9')]);router[_0x289d('0xa')](_0x289d('0x7'),auth[_0x289d('0x8')](),controller['update']);router[_0x289d('0xb')](_0x289d('0x7'),auth[_0x289d('0x8')](),controller[_0x289d('0xc')]);module[_0x289d('0xd')]=router; \ No newline at end of file +var _0x2e76=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','isAuthenticated','/:id','destroy','multer'];(function(_0x25274c,_0x4c7506){var _0x66ca7e=function(_0x1d673d){while(--_0x1d673d){_0x25274c['push'](_0x25274c['shift']());}};_0x66ca7e(++_0x4c7506);}(_0x2e76,0x199));var _0x62e7=function(_0x2975d5,_0x51e3db){_0x2975d5=_0x2975d5-0x0;var _0x2a2689=_0x2e76[_0x2975d5];return _0x2a2689;};'use strict';var multer=require(_0x62e7('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x62e7('0x1'));var express=require('express');var router=express[_0x62e7('0x2')]();var auth=require(_0x62e7('0x3'));var interaction=require(_0x62e7('0x4'));var config=require(_0x62e7('0x5'));var controller=require(_0x62e7('0x6'));router['get']('/:id',auth[_0x62e7('0x7')](),controller['show']);router['put'](_0x62e7('0x8'),auth[_0x62e7('0x7')](),controller['update']);router['delete'](_0x62e7('0x8'),auth['isAuthenticated'](),controller[_0x62e7('0x9')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 87a95a2..b2471f4 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 _0x8ed1=['STRING','BOOLEAN'];(function(_0x1b1c65,_0x23ca6d){var _0x1b86d9=function(_0x1e8559){while(--_0x1e8559){_0x1b1c65['push'](_0x1b1c65['shift']());}};_0x1b86d9(++_0x23ca6d);}(_0x8ed1,0x14c));var _0x18ed=function(_0x577066,_0x44bef7){_0x577066=_0x577066-0x0;var _0xe3f4e1=_0x8ed1[_0x577066];return _0xe3f4e1;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x18ed('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0x18ed('0x0')]},'write':{'type':Sequelize[_0x18ed('0x1')],'defaultValue':!![]}}; \ No newline at end of file +var _0xb29e=['sequelize','STRING','BOOLEAN'];(function(_0x25f894,_0x26d5f9){var _0x526c99=function(_0x137fa6){while(--_0x137fa6){_0x25f894['push'](_0x25f894['shift']());}};_0x526c99(++_0x26d5f9);}(_0xb29e,0x129));var _0xeb29=function(_0x22f48d,_0x51b8e1){_0x22f48d=_0x22f48d-0x0;var _0x26ba9a=_0xb29e[_0x22f48d];return _0x26ba9a;};'use strict';var Sequelize=require(_0xeb29('0x0'));module['exports']={'name':{'type':Sequelize[_0xeb29('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xeb29('0x1')]},'write':{'type':Sequelize[_0xeb29('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 83d4bc9..9ddcb76 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 _0xe989=['where','pick','filter','merge','VIRTUAL','options','include','rows','show','params','includeAll','find','create','body','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','User','intersection','getMembers','hasOwnProperty','removeMembers','ChatGroupId','getMessages','findOne','$gte','split','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./chatGroup.socket','register','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','error','code','ChatGroup,\x20%s,\x20%s','message','result','catch','end','status','count','offset','set','Content-Range','json','apply','save','update','destroy','sendStatus','stack','send','map','ChatGroup','rawAttributes','fieldName','name','query','keys','filters','model','attributes','fields','length','nolimit','limit','order','sort'];(function(_0x3b663f,_0x9ad0c9){var _0xfd7f8f=function(_0x3bf790){while(--_0x3bf790){_0x3b663f['push'](_0x3b663f['shift']());}};_0xfd7f8f(++_0x9ad0c9);}(_0xe989,0x15f));var _0x9e98=function(_0x83d0ad,_0x36efe7){_0x83d0ad=_0x83d0ad-0x0;var _0x5077aa=_0xe989[_0x83d0ad];return _0x5077aa;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9e98('0x0'));var rimraf=require(_0x9e98('0x1'));var zipdir=require(_0x9e98('0x2'));var jsonpatch=require(_0x9e98('0x3'));var rp=require(_0x9e98('0x4'));var moment=require(_0x9e98('0x5'));var BPromise=require(_0x9e98('0x6'));var Mustache=require('mustache');var util=require(_0x9e98('0x7'));var path=require('path');var sox=require(_0x9e98('0x8'));var csv=require(_0x9e98('0x9'));var ejs=require(_0x9e98('0xa'));var fs=require('fs');var _=require(_0x9e98('0xb'));var squel=require(_0x9e98('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9e98('0xd'));var toCsv=require(_0x9e98('0x9'));var querystring=require(_0x9e98('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9e98('0xf'));var as=require(_0x9e98('0x10'));var hardwareService=require(_0x9e98('0x11'));var logger=require('../../config/logger')(_0x9e98('0x12'));var utils=require('../../config/utils');var config=require(_0x9e98('0x13'));var db=require(_0x9e98('0x14'))['db'];config[_0x9e98('0x15')]=_[_0x9e98('0x16')](config[_0x9e98('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x9e98('0x17'))(new Redis(config[_0x9e98('0x15')]));require(_0x9e98('0x18'))[_0x9e98('0x19')](socket);var jayson=require('jayson/promise');var client=jayson[_0x9e98('0x1a')][_0x9e98('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x45b828,_0x16cc25,_0x214052){if(_0x214052){var _0x2a0ae7=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2a0ae7[_0x9e98('0x1c')](_0x16cc25)){return _0x45b828;}else{throw new db[(_0x9e98('0x1d'))][(_0x9e98('0x1e'))](_0x9e98('0x1f'));}}else{return _0x45b828;}}function respondWithRpcPromise(_0x26d8ae,_0x370b0a,_0x320603,_0x1b6ea0){return new BPromise(function(_0x567a05,_0x42cf61){var _0x3440e6=_0x1b6ea0||client;return _0x3440e6[_0x9e98('0x20')](_0x26d8ae,_0x320603)[_0x9e98('0x21')](function(_0x2a1697){logger[_0x9e98('0x22')]('ChatGroup,\x20%s,\x20%s',_0x370b0a,_0x9e98('0x23'));logger['debug'](_0x9e98('0x24'),_0x370b0a,_0x9e98('0x23'),JSON['stringify'](_0x2a1697));if(_0x2a1697[_0x9e98('0x25')]){if(_0x2a1697[_0x9e98('0x25')][_0x9e98('0x26')]===0x1f4){logger[_0x9e98('0x25')](_0x9e98('0x27'),_0x370b0a,_0x2a1697['error'][_0x9e98('0x28')]);return _0x42cf61(_0x2a1697[_0x9e98('0x25')]['message']);}logger[_0x9e98('0x25')](_0x9e98('0x27'),_0x370b0a,_0x2a1697[_0x9e98('0x25')][_0x9e98('0x28')]);return _0x567a05(_0x2a1697['error'][_0x9e98('0x28')]);}else{logger[_0x9e98('0x22')](_0x9e98('0x27'),_0x370b0a,_0x9e98('0x23'));_0x567a05(_0x2a1697[_0x9e98('0x29')][_0x9e98('0x28')]);}})[_0x9e98('0x2a')](function(_0x2ce6ca){logger[_0x9e98('0x25')](_0x9e98('0x27'),_0x370b0a,_0x2ce6ca);_0x42cf61(_0x2ce6ca);});});}function respondWithStatusCode(_0x576bd7,_0x17928a){_0x17928a=_0x17928a||0xcc;return function(_0x12aa6a){if(_0x12aa6a){return _0x576bd7['sendStatus'](_0x17928a);}return _0x576bd7['status'](_0x17928a)[_0x9e98('0x2b')]();};}function respondWithResult(_0x3dcdfa,_0x537d17){_0x537d17=_0x537d17||0xc8;return function(_0x2058cf){if(_0x2058cf){return _0x3dcdfa[_0x9e98('0x2c')](_0x537d17)['json'](_0x2058cf);}};}function respondWithFilteredResult(_0x285594,_0x17661a){return function(_0x19dcc2){if(_0x19dcc2){var _0x403568=_0x19dcc2[_0x9e98('0x2d')],_0x3b55fc=_0x17661a['offset'],_0x5bf9f0=_0x17661a[_0x9e98('0x2e')]+_0x17661a['limit'],_0x49d462;if(_0x5bf9f0>=_0x403568){_0x5bf9f0=_0x403568;_0x49d462=0xc8;}else{_0x49d462=0xce;}_0x285594[_0x9e98('0x2c')](_0x49d462);return _0x285594[_0x9e98('0x2f')](_0x9e98('0x30'),_0x3b55fc+'-'+_0x5bf9f0+'/'+_0x403568)[_0x9e98('0x31')](_0x19dcc2);}return null;};}function patchUpdates(_0x34fbac){return function(_0x524c92){try{jsonpatch[_0x9e98('0x32')](_0x524c92,_0x34fbac,!![]);}catch(_0x48671a){return BPromise['reject'](_0x48671a);}return _0x524c92[_0x9e98('0x33')]();};}function saveUpdates(_0x320206,_0x55c442){return function(_0x109a4b){if(_0x109a4b){return _0x109a4b[_0x9e98('0x34')](_0x320206)[_0x9e98('0x21')](function(_0x16f483){return _0x16f483;});}return null;};}function removeEntity(_0x30a3d6,_0x3debe3){return function(_0x11c918){if(_0x11c918){return _0x11c918[_0x9e98('0x35')]()[_0x9e98('0x21')](function(){_0x30a3d6[_0x9e98('0x2c')](0xcc)[_0x9e98('0x2b')]();});}};}function handleEntityNotFound(_0x2ad703,_0x166d23){return function(_0x1a24a9){if(!_0x1a24a9){_0x2ad703[_0x9e98('0x36')](0x194);}return _0x1a24a9;};}function handleError(_0x3bba16,_0x4ce23e){_0x4ce23e=_0x4ce23e||0x1f4;return function(_0x5b4e4a){logger[_0x9e98('0x25')](_0x5b4e4a[_0x9e98('0x37')]);if(_0x5b4e4a['name']){delete _0x5b4e4a['name'];}_0x3bba16['status'](_0x4ce23e)[_0x9e98('0x38')](_0x5b4e4a);};}exports['index']=function(_0x2faba0,_0x283f12){var _0x32ce9f={},_0x423e26={},_0x4d1e3c={'count':0x0,'rows':[]};var _0x54b2a7=_[_0x9e98('0x39')](db[_0x9e98('0x3a')][_0x9e98('0x3b')],function(_0x19aa04){return{'name':_0x19aa04[_0x9e98('0x3c')],'type':_0x19aa04['type']['key']};});_0x423e26['model']=_['map'](_0x54b2a7,_0x9e98('0x3d'));_0x423e26[_0x9e98('0x3e')]=_[_0x9e98('0x3f')](_0x2faba0[_0x9e98('0x3e')]);_0x423e26[_0x9e98('0x40')]=_['intersection'](_0x423e26[_0x9e98('0x41')],_0x423e26[_0x9e98('0x3e')]);_0x32ce9f[_0x9e98('0x42')]=_['intersection'](_0x423e26[_0x9e98('0x41')],qs[_0x9e98('0x43')](_0x2faba0[_0x9e98('0x3e')][_0x9e98('0x43')]));_0x32ce9f['attributes']=_0x32ce9f['attributes'][_0x9e98('0x44')]?_0x32ce9f['attributes']:_0x423e26['model'];if(!_0x2faba0['query']['hasOwnProperty'](_0x9e98('0x45'))){_0x32ce9f[_0x9e98('0x46')]=qs[_0x9e98('0x46')](_0x2faba0[_0x9e98('0x3e')]['limit']);_0x32ce9f[_0x9e98('0x2e')]=qs[_0x9e98('0x2e')](_0x2faba0['query'][_0x9e98('0x2e')]);}_0x32ce9f[_0x9e98('0x47')]=qs['sort'](_0x2faba0[_0x9e98('0x3e')][_0x9e98('0x48')]);_0x32ce9f[_0x9e98('0x49')]=qs['filters'](_[_0x9e98('0x4a')](_0x2faba0[_0x9e98('0x3e')],_0x423e26[_0x9e98('0x40')]));if(_0x2faba0['query'][_0x9e98('0x4b')]){_0x32ce9f[_0x9e98('0x49')]=_[_0x9e98('0x4c')](_0x32ce9f[_0x9e98('0x49')],{'$or':_['map'](_0x54b2a7,function(_0x4e9cfe){if(_0x4e9cfe['type']!==_0x9e98('0x4d')){var _0x2ee695={};_0x2ee695[_0x4e9cfe[_0x9e98('0x3d')]]={'$like':'%'+_0x2faba0[_0x9e98('0x3e')][_0x9e98('0x4b')]+'%'};return _0x2ee695;}})});}_0x32ce9f=_[_0x9e98('0x4c')]({},_0x32ce9f,_0x2faba0[_0x9e98('0x4e')]);var _0x168459={'where':_0x32ce9f['where']};return db['ChatGroup'][_0x9e98('0x2d')](_0x168459)['then'](function(_0x1a7c9a){_0x4d1e3c[_0x9e98('0x2d')]=_0x1a7c9a;if(_0x2faba0['query']['includeAll']){_0x32ce9f[_0x9e98('0x4f')]=[{'all':!![]}];}return db[_0x9e98('0x3a')]['findAll'](_0x32ce9f);})['then'](function(_0x13d82f){_0x4d1e3c[_0x9e98('0x50')]=_0x13d82f;return _0x4d1e3c;})[_0x9e98('0x21')](respondWithFilteredResult(_0x283f12,_0x32ce9f))['catch'](handleError(_0x283f12,null));};exports[_0x9e98('0x51')]=function(_0x12a313,_0x40b035){var _0x1fecf3={'raw':!![],'where':{'id':_0x12a313[_0x9e98('0x52')]['id']}},_0x30320e={};_0x30320e[_0x9e98('0x41')]=_[_0x9e98('0x3f')](db[_0x9e98('0x3a')][_0x9e98('0x3b')]);_0x30320e['query']=_[_0x9e98('0x3f')](_0x12a313[_0x9e98('0x3e')]);_0x30320e['filters']=_['intersection'](_0x30320e[_0x9e98('0x41')],_0x30320e['query']);_0x1fecf3[_0x9e98('0x42')]=_['intersection'](_0x30320e['model'],qs[_0x9e98('0x43')](_0x12a313[_0x9e98('0x3e')][_0x9e98('0x43')]));_0x1fecf3['attributes']=_0x1fecf3[_0x9e98('0x42')][_0x9e98('0x44')]?_0x1fecf3[_0x9e98('0x42')]:_0x30320e[_0x9e98('0x41')];if(_0x12a313[_0x9e98('0x3e')][_0x9e98('0x53')]){_0x1fecf3['include']=[{'all':!![]}];}_0x1fecf3=_[_0x9e98('0x4c')]({},_0x1fecf3,_0x12a313[_0x9e98('0x4e')]);return db[_0x9e98('0x3a')][_0x9e98('0x54')](_0x1fecf3)['then'](handleEntityNotFound(_0x40b035,null))[_0x9e98('0x21')](respondWithResult(_0x40b035,null))[_0x9e98('0x2a')](handleError(_0x40b035,null));};exports[_0x9e98('0x55')]=function(_0xfd6b5b,_0x1c4900){return db['ChatGroup'][_0x9e98('0x55')](_0xfd6b5b[_0x9e98('0x56')],{})['then'](respondWithResult(_0x1c4900,0xc9))[_0x9e98('0x2a')](handleError(_0x1c4900,null));};exports[_0x9e98('0x34')]=function(_0x92c54d,_0x37ebc7){if(_0x92c54d['body']['id']){delete _0x92c54d[_0x9e98('0x56')]['id'];}return db[_0x9e98('0x3a')][_0x9e98('0x54')]({'where':{'id':_0x92c54d['params']['id']}})[_0x9e98('0x21')](handleEntityNotFound(_0x37ebc7,null))[_0x9e98('0x21')](saveUpdates(_0x92c54d[_0x9e98('0x56')],null))[_0x9e98('0x21')](respondWithResult(_0x37ebc7,null))['catch'](handleError(_0x37ebc7,null));};exports[_0x9e98('0x35')]=function(_0x14e7be,_0x5077b3){return db['ChatGroup']['find']({'where':{'id':_0x14e7be[_0x9e98('0x52')]['id']}})['then'](handleEntityNotFound(_0x5077b3,null))[_0x9e98('0x21')](removeEntity(_0x5077b3,null))[_0x9e98('0x2a')](handleError(_0x5077b3,null));};exports[_0x9e98('0x57')]=function(_0xc5ba5e,_0x1038d0){return db[_0x9e98('0x3a')]['describe']()[_0x9e98('0x21')](respondWithResult(_0x1038d0,null))[_0x9e98('0x2a')](handleError(_0x1038d0,null));};exports[_0x9e98('0x58')]=function(_0x1e3079,_0x1f47b2,_0x101268){return db[_0x9e98('0x59')][_0x9e98('0x2d')]({'where':{'ChatGroupId':_0x1e3079[_0x9e98('0x52')]['id'],'ToId':_0x1e3079[_0x9e98('0x5a')]['id'],'read':![]}})[_0x9e98('0x21')](function(_0x292069){return{'id':_[_0x9e98('0x5b')](_0x1e3079[_0x9e98('0x52')]['id']),'count':_0x292069};})[_0x9e98('0x21')](respondWithResult(_0x1f47b2,null))[_0x9e98('0x2a')](handleError(_0x1f47b2,null));};exports[_0x9e98('0x5c')]=function(_0x18fc9b,_0x4370ed,_0x2bd3b6){return db[_0x9e98('0x3a')][_0x9e98('0x54')]({'where':{'id':_0x18fc9b[_0x9e98('0x52')]['id']}})[_0x9e98('0x21')](handleEntityNotFound(_0x4370ed,null))[_0x9e98('0x21')](function(_0x58e99c){if(_0x58e99c){return _0x58e99c['addMembers'](_0x18fc9b[_0x9e98('0x56')][_0x9e98('0x5d')],_[_0x9e98('0x5e')](_0x18fc9b['body'],[_0x9e98('0x5d'),'id'])||{});}})[_0x9e98('0x21')](respondWithResult(_0x4370ed,null))['catch'](handleError(_0x4370ed,null));};exports['getMembers']=function(_0x18e106,_0x4a32fb,_0x3b99bf){var _0x13c9a0={};var _0x23037f={};var _0x535a0f;var _0x449081;return db[_0x9e98('0x3a')]['findOne']({'where':{'id':_0x18e106[_0x9e98('0x52')]['id']}})['then'](handleEntityNotFound(_0x4a32fb,null))[_0x9e98('0x21')](function(_0x5de96d){if(_0x5de96d){_0x535a0f=_0x5de96d;_0x23037f[_0x9e98('0x41')]=_[_0x9e98('0x3f')](db[_0x9e98('0x5f')][_0x9e98('0x3b')]);_0x23037f[_0x9e98('0x3e')]=_[_0x9e98('0x3f')](_0x18e106['query']);_0x23037f['filters']=_[_0x9e98('0x60')](_0x23037f[_0x9e98('0x41')],_0x23037f[_0x9e98('0x3e')]);_0x13c9a0[_0x9e98('0x42')]=_[_0x9e98('0x60')](_0x23037f[_0x9e98('0x41')],qs['fields'](_0x18e106[_0x9e98('0x3e')]['fields']));_0x13c9a0[_0x9e98('0x42')]=_0x13c9a0[_0x9e98('0x42')][_0x9e98('0x44')]?_0x13c9a0[_0x9e98('0x42')]:_0x23037f[_0x9e98('0x41')];_0x13c9a0[_0x9e98('0x47')]=qs['sort'](_0x18e106['query'][_0x9e98('0x48')]);_0x13c9a0[_0x9e98('0x49')]=qs[_0x9e98('0x40')](_[_0x9e98('0x4a')](_0x18e106['query'],_0x23037f[_0x9e98('0x40')]));if(_0x18e106['query'][_0x9e98('0x4b')]){_0x13c9a0[_0x9e98('0x49')]=_['merge'](_0x13c9a0[_0x9e98('0x49')],{'$or':_[_0x9e98('0x39')](_0x13c9a0[_0x9e98('0x42')],function(_0x36e16e){var _0x4d3e55={};_0x4d3e55[_0x36e16e]={'$like':'%'+_0x18e106[_0x9e98('0x3e')][_0x9e98('0x4b')]+'%'};return _0x4d3e55;})});}_0x13c9a0=_[_0x9e98('0x4c')]({},_0x13c9a0,_0x18e106[_0x9e98('0x4e')]);return _0x535a0f[_0x9e98('0x61')](_0x13c9a0);}})[_0x9e98('0x21')](function(_0x53631f){if(_0x53631f){_0x449081=_0x53631f[_0x9e98('0x44')];if(!_0x18e106[_0x9e98('0x3e')][_0x9e98('0x62')](_0x9e98('0x45'))){_0x13c9a0[_0x9e98('0x46')]=qs['limit'](_0x18e106[_0x9e98('0x3e')][_0x9e98('0x46')]);_0x13c9a0[_0x9e98('0x2e')]=qs['offset'](_0x18e106[_0x9e98('0x3e')][_0x9e98('0x2e')]);}return _0x535a0f['getMembers'](_0x13c9a0);}})['then'](function(_0x508573){if(_0x508573){return _0x508573?{'count':_0x449081,'rows':_0x508573}:null;}})[_0x9e98('0x21')](respondWithResult(_0x4a32fb,null))['catch'](handleError(_0x4a32fb,null));};exports[_0x9e98('0x63')]=function(_0x5dc478,_0x328089,_0x131b5e){return db[_0x9e98('0x3a')]['find']({'where':{'id':_0x5dc478[_0x9e98('0x52')]['id']}})['then'](handleEntityNotFound(_0x328089,null))[_0x9e98('0x21')](function(_0x1a9de6){if(_0x1a9de6){return _0x1a9de6[_0x9e98('0x63')](_0x5dc478[_0x9e98('0x3e')]['ids']);}})[_0x9e98('0x21')](respondWithStatusCode(_0x328089,null))['catch'](handleError(_0x328089,null));};exports['addMessage']=function(_0x11e683,_0x1b77a2,_0xe173bc){if(_0x11e683[_0x9e98('0x56')]['id']){delete _0x11e683['body']['id'];}return db[_0x9e98('0x3a')][_0x9e98('0x54')]({'where':{'id':_0x11e683[_0x9e98('0x52')]['id']}})['then'](handleEntityNotFound(_0x1b77a2,null))[_0x9e98('0x21')](function(_0x2b58d3){if(_0x2b58d3){_0x11e683[_0x9e98('0x56')][_0x9e98('0x64')]=_0x2b58d3['id'];return db[_0x9e98('0x59')]['create'](_0x11e683[_0x9e98('0x56')]);}})['then'](respondWithResult(_0x1b77a2,null))[_0x9e98('0x2a')](handleError(_0x1b77a2,null));};exports[_0x9e98('0x65')]=function(_0x5e7b54,_0x55391c,_0x437b4f){var _0x362c11={};var _0x2da708={};var _0x5b9d56;var _0x5a157d;return db[_0x9e98('0x3a')][_0x9e98('0x66')]({'where':{'id':_0x5e7b54['params']['id']}})['then'](handleEntityNotFound(_0x55391c,null))['then'](function(_0x3372c3){if(_0x3372c3){_0x5b9d56=_0x3372c3;_0x2da708[_0x9e98('0x41')]=_[_0x9e98('0x3f')](db['ChatInternalMessage'][_0x9e98('0x3b')]);_0x2da708[_0x9e98('0x3e')]=_[_0x9e98('0x3f')](_0x5e7b54[_0x9e98('0x3e')]);_0x2da708['filters']=_[_0x9e98('0x60')](_0x2da708[_0x9e98('0x41')],_0x2da708[_0x9e98('0x3e')]);_0x362c11[_0x9e98('0x42')]=_[_0x9e98('0x60')](_0x2da708[_0x9e98('0x41')],qs[_0x9e98('0x43')](_0x5e7b54[_0x9e98('0x3e')][_0x9e98('0x43')]));_0x362c11[_0x9e98('0x42')]=_0x362c11['attributes'][_0x9e98('0x44')]?_0x362c11[_0x9e98('0x42')]:_0x2da708[_0x9e98('0x41')];_0x362c11[_0x9e98('0x47')]=qs[_0x9e98('0x48')](_0x5e7b54[_0x9e98('0x3e')][_0x9e98('0x48')]);_0x362c11['where']=qs[_0x9e98('0x40')](_[_0x9e98('0x4a')](_0x5e7b54[_0x9e98('0x3e')],_0x2da708[_0x9e98('0x40')]));if(_0x5e7b54[_0x9e98('0x3e')]['filter']){_0x362c11[_0x9e98('0x49')]=_['merge'](_0x362c11[_0x9e98('0x49')],{'$or':_[_0x9e98('0x39')](_0x362c11[_0x9e98('0x42')],function(_0x582a8d){var _0x22f60b={};_0x22f60b[_0x582a8d]={'$like':'%'+_0x5e7b54['query'][_0x9e98('0x4b')]+'%'};return _0x22f60b;})});}if(_0x5e7b54[_0x9e98('0x3e')][_0x9e98('0x67')]){var _0x5c4f8c=_0x5e7b54[_0x9e98('0x3e')][_0x9e98('0x67')][_0x9e98('0x68')](',');var _0x113f2d={};_0x113f2d[_0x5c4f8c[0x0]]={'$gte':moment(_0x5c4f8c[0x1])['format'](_0x9e98('0x69'))};_0x362c11[_0x9e98('0x49')]=_[_0x9e98('0x4c')](_0x362c11['where'],_0x113f2d);}_0x362c11=_[_0x9e98('0x4c')]({},_0x362c11,_0x5e7b54[_0x9e98('0x4e')]);return _0x5b9d56[_0x9e98('0x65')](_0x362c11);}})[_0x9e98('0x21')](function(_0x155346){if(_0x155346){_0x5a157d=_0x155346[_0x9e98('0x44')];if(!_0x5e7b54[_0x9e98('0x3e')][_0x9e98('0x62')]('nolimit')){_0x362c11[_0x9e98('0x46')]=qs[_0x9e98('0x46')](_0x5e7b54[_0x9e98('0x3e')]['limit']);_0x362c11['offset']=qs[_0x9e98('0x2e')](_0x5e7b54[_0x9e98('0x3e')][_0x9e98('0x2e')]);}return _0x5b9d56[_0x9e98('0x65')](_0x362c11);}})[_0x9e98('0x21')](function(_0x5cfda8){if(_0x5cfda8){return _0x5cfda8?{'count':_0x5a157d,'rows':_0x5cfda8}:null;}})[_0x9e98('0x21')](respondWithResult(_0x55391c,null))[_0x9e98('0x2a')](handleError(_0x55391c,null));}; \ No newline at end of file +var _0xf774=['rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','show','params','keys','includeAll','create','body','describe','getUnread','ChatInternalMessage','user','ids','User','getMembers','removeMembers','find','addMessage','ChatGroupId','getMessages','findOne','$gte','format','YYYY-MM-DD\x20HH:mm:ss','nolimit','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','localhost','socket.io-emitter','./chatGroup.socket','register','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~!@#$%^&-_=+[{]}.','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','sendStatus','status','end','count','offset','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','map','ChatGroup'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0xf774,0x100));var _0x4f77=function(_0x2ea36e,_0x326ae6){_0x2ea36e=_0x2ea36e-0x0;var _0x4683f4=_0xf774[_0x2ea36e];return _0x4683f4;};'use strict';var pdf=require(_0x4f77('0x0'));var emlformat=require(_0x4f77('0x1'));var rimraf=require(_0x4f77('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4f77('0x3'));var rp=require(_0x4f77('0x4'));var moment=require(_0x4f77('0x5'));var BPromise=require(_0x4f77('0x6'));var Mustache=require(_0x4f77('0x7'));var util=require(_0x4f77('0x8'));var path=require(_0x4f77('0x9'));var sox=require(_0x4f77('0xa'));var csv=require('to-csv');var ejs=require(_0x4f77('0xb'));var fs=require('fs');var _=require(_0x4f77('0xc'));var squel=require(_0x4f77('0xd'));var crypto=require(_0x4f77('0xe'));var jsforce=require(_0x4f77('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x4f77('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4f77('0x11'));var qs=require(_0x4f77('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4f77('0x13'));var logger=require(_0x4f77('0x14'))(_0x4f77('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x4f77('0x16'))['db'];config[_0x4f77('0x17')]=_['defaults'](config[_0x4f77('0x17')],{'host':_0x4f77('0x18'),'port':0x18eb});var socket=require(_0x4f77('0x19'))(new Redis(config[_0x4f77('0x17')]));require(_0x4f77('0x1a'))[_0x4f77('0x1b')](socket);var jayson=require(_0x4f77('0x1c'));var client=jayson[_0x4f77('0x1d')]['http']({'port':0x232a});function checkPasswordPattern(_0x3e6599,_0x4c1e0f,_0xbe0517){if(_0xbe0517){var _0x4edfeb=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4edfeb['test'](_0x4c1e0f)){return _0x3e6599;}else{throw new db[(_0x4f77('0x1e'))]['ValidationError'](_0x4f77('0x1f'));}}else{return _0x3e6599;}}function respondWithRpcPromise(_0x53eb90,_0x5a77c4,_0x161bcb,_0x2ca5c0){return new BPromise(function(_0x4218af,_0x4120b8){var _0x262e6b=_0x2ca5c0||client;return _0x262e6b['request'](_0x53eb90,_0x161bcb)['then'](function(_0x9488ff){logger['info'](_0x4f77('0x20'),_0x5a77c4,_0x4f77('0x21'));logger[_0x4f77('0x22')](_0x4f77('0x23'),_0x5a77c4,'request\x20sent',JSON[_0x4f77('0x24')](_0x9488ff));if(_0x9488ff[_0x4f77('0x25')]){if(_0x9488ff[_0x4f77('0x25')]['code']===0x1f4){logger[_0x4f77('0x25')](_0x4f77('0x20'),_0x5a77c4,_0x9488ff[_0x4f77('0x25')]['message']);return _0x4120b8(_0x9488ff[_0x4f77('0x25')][_0x4f77('0x26')]);}logger[_0x4f77('0x25')]('ChatGroup,\x20%s,\x20%s',_0x5a77c4,_0x9488ff[_0x4f77('0x25')][_0x4f77('0x26')]);return _0x4218af(_0x9488ff['error']['message']);}else{logger[_0x4f77('0x27')](_0x4f77('0x20'),_0x5a77c4,'request\x20sent');_0x4218af(_0x9488ff['result'][_0x4f77('0x26')]);}})[_0x4f77('0x28')](function(_0x268b37){logger[_0x4f77('0x25')](_0x4f77('0x20'),_0x5a77c4,_0x268b37);_0x4120b8(_0x268b37);});});}function respondWithStatusCode(_0x354e8c,_0x2789ec){_0x2789ec=_0x2789ec||0xcc;return function(_0x1563c0){if(_0x1563c0){return _0x354e8c[_0x4f77('0x29')](_0x2789ec);}return _0x354e8c[_0x4f77('0x2a')](_0x2789ec)[_0x4f77('0x2b')]();};}function respondWithResult(_0xf3af4e,_0x492aad){_0x492aad=_0x492aad||0xc8;return function(_0x277e0e){if(_0x277e0e){return _0xf3af4e[_0x4f77('0x2a')](_0x492aad)['json'](_0x277e0e);}};}function respondWithFilteredResult(_0x2f3e44,_0xa883a5){return function(_0x2f64d7){if(_0x2f64d7){var _0x30675d=_0x2f64d7[_0x4f77('0x2c')],_0x5dc306=_0xa883a5[_0x4f77('0x2d')],_0x3405f7=_0xa883a5[_0x4f77('0x2d')]+_0xa883a5['limit'],_0x568fca;if(_0x3405f7>=_0x30675d){_0x3405f7=_0x30675d;_0x568fca=0xc8;}else{_0x568fca=0xce;}_0x2f3e44[_0x4f77('0x2a')](_0x568fca);return _0x2f3e44[_0x4f77('0x2e')](_0x4f77('0x2f'),_0x5dc306+'-'+_0x3405f7+'/'+_0x30675d)['json'](_0x2f64d7);}return null;};}function patchUpdates(_0x2d741b){return function(_0x574347){try{jsonpatch[_0x4f77('0x30')](_0x574347,_0x2d741b,!![]);}catch(_0xaf5207){return BPromise['reject'](_0xaf5207);}return _0x574347[_0x4f77('0x31')]();};}function saveUpdates(_0x1db08b,_0x249cfb){return function(_0x303b9e){if(_0x303b9e){return _0x303b9e[_0x4f77('0x32')](_0x1db08b)[_0x4f77('0x33')](function(_0x45b643){return _0x45b643;});}return null;};}function removeEntity(_0x26ed0a,_0x4f7767){return function(_0x4541c0){if(_0x4541c0){return _0x4541c0[_0x4f77('0x34')]()[_0x4f77('0x33')](function(){_0x26ed0a[_0x4f77('0x2a')](0xcc)[_0x4f77('0x2b')]();});}};}function handleEntityNotFound(_0x911a77,_0x7d7b64){return function(_0x40ea5f){if(!_0x40ea5f){_0x911a77[_0x4f77('0x29')](0x194);}return _0x40ea5f;};}function handleError(_0x5384c0,_0x4ce36b){_0x4ce36b=_0x4ce36b||0x1f4;return function(_0x5d7cbb){logger[_0x4f77('0x25')](_0x5d7cbb[_0x4f77('0x35')]);if(_0x5d7cbb['name']){delete _0x5d7cbb[_0x4f77('0x36')];}_0x5384c0[_0x4f77('0x2a')](_0x4ce36b)[_0x4f77('0x37')](_0x5d7cbb);};}exports[_0x4f77('0x38')]=function(_0x232d05,_0x17df7f){var _0x13a67d={},_0x8148dc={},_0x1e2b17={'count':0x0,'rows':[]};var _0x48e6f0=_[_0x4f77('0x39')](db[_0x4f77('0x3a')][_0x4f77('0x3b')],function(_0x29bc91){return{'name':_0x29bc91[_0x4f77('0x3c')],'type':_0x29bc91[_0x4f77('0x3d')][_0x4f77('0x3e')]};});_0x8148dc[_0x4f77('0x3f')]=_[_0x4f77('0x39')](_0x48e6f0,'name');_0x8148dc[_0x4f77('0x40')]=_['keys'](_0x232d05['query']);_0x8148dc[_0x4f77('0x41')]=_[_0x4f77('0x42')](_0x8148dc[_0x4f77('0x3f')],_0x8148dc['query']);_0x13a67d[_0x4f77('0x43')]=_['intersection'](_0x8148dc['model'],qs['fields'](_0x232d05['query'][_0x4f77('0x44')]));_0x13a67d[_0x4f77('0x43')]=_0x13a67d[_0x4f77('0x43')][_0x4f77('0x45')]?_0x13a67d[_0x4f77('0x43')]:_0x8148dc['model'];if(!_0x232d05[_0x4f77('0x40')][_0x4f77('0x46')]('nolimit')){_0x13a67d['limit']=qs[_0x4f77('0x47')](_0x232d05[_0x4f77('0x40')][_0x4f77('0x47')]);_0x13a67d['offset']=qs[_0x4f77('0x2d')](_0x232d05[_0x4f77('0x40')][_0x4f77('0x2d')]);}_0x13a67d[_0x4f77('0x48')]=qs[_0x4f77('0x49')](_0x232d05[_0x4f77('0x40')][_0x4f77('0x49')]);_0x13a67d[_0x4f77('0x4a')]=qs['filters'](_[_0x4f77('0x4b')](_0x232d05['query'],_0x8148dc[_0x4f77('0x41')]));if(_0x232d05['query'][_0x4f77('0x4c')]){_0x13a67d[_0x4f77('0x4a')]=_[_0x4f77('0x4d')](_0x13a67d[_0x4f77('0x4a')],{'$or':_['map'](_0x48e6f0,function(_0x108294){if(_0x108294[_0x4f77('0x3d')]!==_0x4f77('0x4e')){var _0x2f9895={};_0x2f9895[_0x108294[_0x4f77('0x36')]]={'$like':'%'+_0x232d05[_0x4f77('0x40')][_0x4f77('0x4c')]+'%'};return _0x2f9895;}})});}_0x13a67d=_['merge']({},_0x13a67d,_0x232d05[_0x4f77('0x4f')]);var _0x3bb6f9={'where':_0x13a67d['where']};return db[_0x4f77('0x3a')][_0x4f77('0x2c')](_0x3bb6f9)['then'](function(_0x4ad0b2){_0x1e2b17[_0x4f77('0x2c')]=_0x4ad0b2;if(_0x232d05[_0x4f77('0x40')]['includeAll']){_0x13a67d[_0x4f77('0x50')]=[{'all':!![]}];}return db['ChatGroup']['findAll'](_0x13a67d);})[_0x4f77('0x33')](function(_0x211ea5){_0x1e2b17[_0x4f77('0x51')]=_0x211ea5;return _0x1e2b17;})[_0x4f77('0x33')](respondWithFilteredResult(_0x17df7f,_0x13a67d))[_0x4f77('0x28')](handleError(_0x17df7f,null));};exports[_0x4f77('0x52')]=function(_0x4deec6,_0x4cfd32){var _0x451ff3={'raw':!![],'where':{'id':_0x4deec6[_0x4f77('0x53')]['id']}},_0x499eab={};_0x499eab[_0x4f77('0x3f')]=_[_0x4f77('0x54')](db[_0x4f77('0x3a')][_0x4f77('0x3b')]);_0x499eab[_0x4f77('0x40')]=_['keys'](_0x4deec6[_0x4f77('0x40')]);_0x499eab[_0x4f77('0x41')]=_[_0x4f77('0x42')](_0x499eab[_0x4f77('0x3f')],_0x499eab[_0x4f77('0x40')]);_0x451ff3[_0x4f77('0x43')]=_[_0x4f77('0x42')](_0x499eab['model'],qs[_0x4f77('0x44')](_0x4deec6['query'][_0x4f77('0x44')]));_0x451ff3['attributes']=_0x451ff3[_0x4f77('0x43')][_0x4f77('0x45')]?_0x451ff3['attributes']:_0x499eab[_0x4f77('0x3f')];if(_0x4deec6[_0x4f77('0x40')][_0x4f77('0x55')]){_0x451ff3[_0x4f77('0x50')]=[{'all':!![]}];}_0x451ff3=_['merge']({},_0x451ff3,_0x4deec6[_0x4f77('0x4f')]);return db[_0x4f77('0x3a')]['find'](_0x451ff3)[_0x4f77('0x33')](handleEntityNotFound(_0x4cfd32,null))[_0x4f77('0x33')](respondWithResult(_0x4cfd32,null))[_0x4f77('0x28')](handleError(_0x4cfd32,null));};exports['create']=function(_0x2d97e1,_0x4d08ed){return db[_0x4f77('0x3a')][_0x4f77('0x56')](_0x2d97e1[_0x4f77('0x57')],{})[_0x4f77('0x33')](respondWithResult(_0x4d08ed,0xc9))[_0x4f77('0x28')](handleError(_0x4d08ed,null));};exports[_0x4f77('0x32')]=function(_0x44a1db,_0x2515ee){if(_0x44a1db[_0x4f77('0x57')]['id']){delete _0x44a1db[_0x4f77('0x57')]['id'];}return db[_0x4f77('0x3a')]['find']({'where':{'id':_0x44a1db[_0x4f77('0x53')]['id']}})['then'](handleEntityNotFound(_0x2515ee,null))[_0x4f77('0x33')](saveUpdates(_0x44a1db[_0x4f77('0x57')],null))[_0x4f77('0x33')](respondWithResult(_0x2515ee,null))[_0x4f77('0x28')](handleError(_0x2515ee,null));};exports[_0x4f77('0x34')]=function(_0x4b7863,_0x5afd51){return db[_0x4f77('0x3a')]['find']({'where':{'id':_0x4b7863['params']['id']}})[_0x4f77('0x33')](handleEntityNotFound(_0x5afd51,null))['then'](removeEntity(_0x5afd51,null))['catch'](handleError(_0x5afd51,null));};exports['describe']=function(_0x16ef33,_0x56cf38){return db['ChatGroup'][_0x4f77('0x58')]()[_0x4f77('0x33')](respondWithResult(_0x56cf38,null))[_0x4f77('0x28')](handleError(_0x56cf38,null));};exports[_0x4f77('0x59')]=function(_0x505500,_0x39ac22,_0x4b5ca4){return db[_0x4f77('0x5a')][_0x4f77('0x2c')]({'where':{'ChatGroupId':_0x505500['params']['id'],'ToId':_0x505500[_0x4f77('0x5b')]['id'],'read':![]}})[_0x4f77('0x33')](function(_0x2ddc5a){return{'id':_['toInteger'](_0x505500[_0x4f77('0x53')]['id']),'count':_0x2ddc5a};})[_0x4f77('0x33')](respondWithResult(_0x39ac22,null))['catch'](handleError(_0x39ac22,null));};exports['addMembers']=function(_0x543027,_0x3a34cb,_0x5b9cfa){return db[_0x4f77('0x3a')]['find']({'where':{'id':_0x543027[_0x4f77('0x53')]['id']}})[_0x4f77('0x33')](handleEntityNotFound(_0x3a34cb,null))[_0x4f77('0x33')](function(_0x488bcb){if(_0x488bcb){return _0x488bcb['addMembers'](_0x543027['body'][_0x4f77('0x5c')],_['omit'](_0x543027['body'],[_0x4f77('0x5c'),'id'])||{});}})[_0x4f77('0x33')](respondWithResult(_0x3a34cb,null))[_0x4f77('0x28')](handleError(_0x3a34cb,null));};exports['getMembers']=function(_0x22950d,_0x1f053f,_0x413167){var _0x1f27e1={};var _0x301a84={};var _0x5f4e94;var _0x157c8c;return db[_0x4f77('0x3a')]['findOne']({'where':{'id':_0x22950d[_0x4f77('0x53')]['id']}})[_0x4f77('0x33')](handleEntityNotFound(_0x1f053f,null))[_0x4f77('0x33')](function(_0x4737b3){if(_0x4737b3){_0x5f4e94=_0x4737b3;_0x301a84[_0x4f77('0x3f')]=_[_0x4f77('0x54')](db[_0x4f77('0x5d')][_0x4f77('0x3b')]);_0x301a84[_0x4f77('0x40')]=_['keys'](_0x22950d['query']);_0x301a84[_0x4f77('0x41')]=_[_0x4f77('0x42')](_0x301a84[_0x4f77('0x3f')],_0x301a84[_0x4f77('0x40')]);_0x1f27e1['attributes']=_[_0x4f77('0x42')](_0x301a84['model'],qs['fields'](_0x22950d[_0x4f77('0x40')]['fields']));_0x1f27e1[_0x4f77('0x43')]=_0x1f27e1[_0x4f77('0x43')][_0x4f77('0x45')]?_0x1f27e1[_0x4f77('0x43')]:_0x301a84[_0x4f77('0x3f')];_0x1f27e1['order']=qs[_0x4f77('0x49')](_0x22950d['query'][_0x4f77('0x49')]);_0x1f27e1[_0x4f77('0x4a')]=qs[_0x4f77('0x41')](_[_0x4f77('0x4b')](_0x22950d[_0x4f77('0x40')],_0x301a84[_0x4f77('0x41')]));if(_0x22950d[_0x4f77('0x40')][_0x4f77('0x4c')]){_0x1f27e1[_0x4f77('0x4a')]=_[_0x4f77('0x4d')](_0x1f27e1[_0x4f77('0x4a')],{'$or':_['map'](_0x1f27e1[_0x4f77('0x43')],function(_0x2614d6){var _0x2f03f1={};_0x2f03f1[_0x2614d6]={'$like':'%'+_0x22950d[_0x4f77('0x40')][_0x4f77('0x4c')]+'%'};return _0x2f03f1;})});}_0x1f27e1=_[_0x4f77('0x4d')]({},_0x1f27e1,_0x22950d[_0x4f77('0x4f')]);return _0x5f4e94[_0x4f77('0x5e')](_0x1f27e1);}})[_0x4f77('0x33')](function(_0x3a6a4f){if(_0x3a6a4f){_0x157c8c=_0x3a6a4f[_0x4f77('0x45')];if(!_0x22950d['query']['hasOwnProperty']('nolimit')){_0x1f27e1[_0x4f77('0x47')]=qs[_0x4f77('0x47')](_0x22950d[_0x4f77('0x40')][_0x4f77('0x47')]);_0x1f27e1[_0x4f77('0x2d')]=qs[_0x4f77('0x2d')](_0x22950d[_0x4f77('0x40')][_0x4f77('0x2d')]);}return _0x5f4e94[_0x4f77('0x5e')](_0x1f27e1);}})[_0x4f77('0x33')](function(_0x505325){if(_0x505325){return _0x505325?{'count':_0x157c8c,'rows':_0x505325}:null;}})[_0x4f77('0x33')](respondWithResult(_0x1f053f,null))[_0x4f77('0x28')](handleError(_0x1f053f,null));};exports[_0x4f77('0x5f')]=function(_0x37bd82,_0x220450,_0x185ef5){return db[_0x4f77('0x3a')][_0x4f77('0x60')]({'where':{'id':_0x37bd82[_0x4f77('0x53')]['id']}})['then'](handleEntityNotFound(_0x220450,null))[_0x4f77('0x33')](function(_0x2d1136){if(_0x2d1136){return _0x2d1136['removeMembers'](_0x37bd82['query'][_0x4f77('0x5c')]);}})[_0x4f77('0x33')](respondWithStatusCode(_0x220450,null))[_0x4f77('0x28')](handleError(_0x220450,null));};exports[_0x4f77('0x61')]=function(_0x577aea,_0x12d681,_0x494fc2){if(_0x577aea[_0x4f77('0x57')]['id']){delete _0x577aea[_0x4f77('0x57')]['id'];}return db[_0x4f77('0x3a')][_0x4f77('0x60')]({'where':{'id':_0x577aea[_0x4f77('0x53')]['id']}})[_0x4f77('0x33')](handleEntityNotFound(_0x12d681,null))['then'](function(_0x47f3ba){if(_0x47f3ba){_0x577aea[_0x4f77('0x57')][_0x4f77('0x62')]=_0x47f3ba['id'];return db[_0x4f77('0x5a')]['create'](_0x577aea[_0x4f77('0x57')]);}})[_0x4f77('0x33')](respondWithResult(_0x12d681,null))['catch'](handleError(_0x12d681,null));};exports[_0x4f77('0x63')]=function(_0x1b9943,_0x30721f,_0x3a43c7){var _0x7167a0={};var _0x28d646={};var _0x5d372d;var _0xaf8ead;return db[_0x4f77('0x3a')][_0x4f77('0x64')]({'where':{'id':_0x1b9943[_0x4f77('0x53')]['id']}})[_0x4f77('0x33')](handleEntityNotFound(_0x30721f,null))['then'](function(_0x29f991){if(_0x29f991){_0x5d372d=_0x29f991;_0x28d646[_0x4f77('0x3f')]=_['keys'](db['ChatInternalMessage'][_0x4f77('0x3b')]);_0x28d646[_0x4f77('0x40')]=_[_0x4f77('0x54')](_0x1b9943[_0x4f77('0x40')]);_0x28d646['filters']=_[_0x4f77('0x42')](_0x28d646[_0x4f77('0x3f')],_0x28d646['query']);_0x7167a0[_0x4f77('0x43')]=_['intersection'](_0x28d646['model'],qs['fields'](_0x1b9943[_0x4f77('0x40')]['fields']));_0x7167a0['attributes']=_0x7167a0[_0x4f77('0x43')][_0x4f77('0x45')]?_0x7167a0['attributes']:_0x28d646[_0x4f77('0x3f')];_0x7167a0[_0x4f77('0x48')]=qs[_0x4f77('0x49')](_0x1b9943['query'][_0x4f77('0x49')]);_0x7167a0[_0x4f77('0x4a')]=qs[_0x4f77('0x41')](_[_0x4f77('0x4b')](_0x1b9943['query'],_0x28d646['filters']));if(_0x1b9943[_0x4f77('0x40')]['filter']){_0x7167a0[_0x4f77('0x4a')]=_[_0x4f77('0x4d')](_0x7167a0[_0x4f77('0x4a')],{'$or':_[_0x4f77('0x39')](_0x7167a0[_0x4f77('0x43')],function(_0x364c86){var _0x25c1bb={};_0x25c1bb[_0x364c86]={'$like':'%'+_0x1b9943[_0x4f77('0x40')][_0x4f77('0x4c')]+'%'};return _0x25c1bb;})});}if(_0x1b9943['query'][_0x4f77('0x65')]){var _0x48d51b=_0x1b9943[_0x4f77('0x40')][_0x4f77('0x65')]['split'](',');var _0x25dc2d={};_0x25dc2d[_0x48d51b[0x0]]={'$gte':moment(_0x48d51b[0x1])[_0x4f77('0x66')](_0x4f77('0x67'))};_0x7167a0[_0x4f77('0x4a')]=_[_0x4f77('0x4d')](_0x7167a0[_0x4f77('0x4a')],_0x25dc2d);}_0x7167a0=_['merge']({},_0x7167a0,_0x1b9943[_0x4f77('0x4f')]);return _0x5d372d['getMessages'](_0x7167a0);}})[_0x4f77('0x33')](function(_0x2513de){if(_0x2513de){_0xaf8ead=_0x2513de[_0x4f77('0x45')];if(!_0x1b9943['query'][_0x4f77('0x46')](_0x4f77('0x68'))){_0x7167a0[_0x4f77('0x47')]=qs['limit'](_0x1b9943[_0x4f77('0x40')][_0x4f77('0x47')]);_0x7167a0[_0x4f77('0x2d')]=qs[_0x4f77('0x2d')](_0x1b9943[_0x4f77('0x40')]['offset']);}return _0x5d372d[_0x4f77('0x63')](_0x7167a0);}})['then'](function(_0xed29bb){if(_0xed29bb){return _0xed29bb?{'count':_0xaf8ead,'rows':_0xed29bb}:null;}})['then'](respondWithResult(_0x30721f,null))[_0x4f77('0x28')](handleError(_0x30721f,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 69f4a61..9f3d5bc 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 _0xb10b=['hasOwnProperty','hook','events','ChatGroup','setMaxListeners','save','remove','emit'];(function(_0x33f349,_0xcbc1be){var _0x5329b3=function(_0x1eabbd){while(--_0x1eabbd){_0x33f349['push'](_0x33f349['shift']());}};_0x5329b3(++_0xcbc1be);}(_0xb10b,0x12a));var _0xbb10=function(_0x1f7fb2,_0x116309){_0x1f7fb2=_0x1f7fb2-0x0;var _0x61fc27=_0xb10b[_0x1f7fb2];return _0x61fc27;};'use strict';var EventEmitter=require(_0xbb10('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0xbb10('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xbb10('0x2')](0x0);var events={'afterCreate':_0xbb10('0x3'),'afterUpdate':'update','afterDestroy':_0xbb10('0x4')};function emitEvent(_0x9bbed){return function(_0x460981,_0x22320e,_0x49baf4){ChatGroupEvents[_0xbb10('0x5')](_0x9bbed+':'+_0x460981['id'],_0x460981);ChatGroupEvents['emit'](_0x9bbed,_0x460981);_0x49baf4(null);};}for(var e in events){if(events[_0xbb10('0x6')](e)){var event=events[e];ChatGroup[_0xbb10('0x7')](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file +var _0x5f66=['remove','emit','exports','../../mysqldb','setMaxListeners','save','update'];(function(_0x2f8368,_0x268f96){var _0x45aa53=function(_0x589e81){while(--_0x589e81){_0x2f8368['push'](_0x2f8368['shift']());}};_0x45aa53(++_0x268f96);}(_0x5f66,0x1a0));var _0x65f6=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x5f66[_0x297fd3];return _0x2af381;};'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 defbf71..0e0aa70 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 _0xbe52=['../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x3d99ce,_0x216db1){var _0x376c13=function(_0x22347d){while(--_0x22347d){_0x3d99ce['push'](_0x3d99ce['shift']());}};_0x376c13(++_0x216db1);}(_0xbe52,0x164));var _0x2be5=function(_0x5a8375,_0x5572fc){_0x5a8375=_0x5a8375-0x0;var _0x20495c=_0xbe52[_0x5a8375];return _0x20495c;};'use strict';var _=require(_0x2be5('0x0'));var util=require(_0x2be5('0x1'));var logger=require(_0x2be5('0x2'))(_0x2be5('0x3'));var moment=require(_0x2be5('0x4'));var BPromise=require('bluebird');var rp=require(_0x2be5('0x5'));var fs=require('fs');var path=require(_0x2be5('0x6'));var rimraf=require(_0x2be5('0x7'));var config=require(_0x2be5('0x8'));var attributes=require(_0x2be5('0x9'));module[_0x2be5('0xa')]=function(_0x39dc18,_0x13fadf){return _0x39dc18[_0x2be5('0xb')](_0x2be5('0xc'),attributes,{'tableName':_0x2be5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3248=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./chatGroup.attributes','define','ChatGroup','chat_groups'];(function(_0x58b965,_0x9e7f3a){var _0x411e87=function(_0xc3c84){while(--_0xc3c84){_0x58b965['push'](_0x58b965['shift']());}};_0x411e87(++_0x9e7f3a);}(_0x3248,0x1b0));var _0x8324=function(_0x1de45f,_0xe82170){_0x1de45f=_0x1de45f-0x0;var _0x526129=_0x3248[_0x1de45f];return _0x526129;};'use strict';var _=require(_0x8324('0x0'));var util=require(_0x8324('0x1'));var logger=require(_0x8324('0x2'))(_0x8324('0x3'));var moment=require(_0x8324('0x4'));var BPromise=require(_0x8324('0x5'));var rp=require(_0x8324('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8324('0x7'));var attributes=require(_0x8324('0x8'));module['exports']=function(_0x18edd2,_0x283f5f){return _0x18edd2[_0x8324('0x9')](_0x8324('0xa'),attributes,{'tableName':_0x8324('0xb'),'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 588721e..e32d490 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 _0x448b=['lodash','util','moment','bluebird','randomstring','../../config/utils','jayson/promise','http','defaults','socket.io-emitter','./chatGroup.socket','register','request','info','ChatGroup,\x20%s,\x20%s','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','error','code','message','result','catch'];(function(_0x2f3a34,_0x19a907){var _0x97f5c7=function(_0x573d19){while(--_0x573d19){_0x2f3a34['push'](_0x2f3a34['shift']());}};_0x97f5c7(++_0x19a907);}(_0x448b,0x1ce));var _0xb448=function(_0x4fba68,_0x415703){_0x4fba68=_0x4fba68-0x0;var _0x3e10be=_0x448b[_0x4fba68];return _0x3e10be;};'use strict';var _=require(_0xb448('0x0'));var util=require(_0xb448('0x1'));var moment=require(_0xb448('0x2'));var BPromise=require(_0xb448('0x3'));var rs=require(_0xb448('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb448('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xb448('0x6'));var client=jayson['client'][_0xb448('0x7')]({'port':0x232a});config['redis']=_[_0xb448('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xb448('0x9'))(new Redis(config['redis']));require(_0xb448('0xa'))[_0xb448('0xb')](socket);function respondWithRpcPromise(_0x19fb86,_0x3dfb0b,_0x347e57){return new BPromise(function(_0x7ccdc8,_0x1a2be1){return client[_0xb448('0xc')](_0x19fb86,_0x347e57)['then'](function(_0x404d2b){logger[_0xb448('0xd')](_0xb448('0xe'),_0x3dfb0b,_0xb448('0xf'));logger['debug'](_0xb448('0x10'),_0x3dfb0b,_0xb448('0xf'),JSON['stringify'](_0x404d2b));if(_0x404d2b['error']){if(_0x404d2b[_0xb448('0x11')][_0xb448('0x12')]===0x1f4){logger[_0xb448('0x11')](_0xb448('0xe'),_0x3dfb0b,_0x404d2b['error'][_0xb448('0x13')]);return _0x1a2be1(_0x404d2b[_0xb448('0x11')]['message']);}logger[_0xb448('0x11')]('ChatGroup,\x20%s,\x20%s',_0x3dfb0b,_0x404d2b['error'][_0xb448('0x13')]);return _0x7ccdc8(_0x404d2b[_0xb448('0x11')][_0xb448('0x13')]);}else{logger[_0xb448('0xd')](_0xb448('0xe'),_0x3dfb0b,'request\x20sent');_0x7ccdc8(_0x404d2b[_0xb448('0x14')][_0xb448('0x13')]);}})[_0xb448('0x15')](function(_0x52dc97){logger[_0xb448('0x11')](_0xb448('0xe'),_0x3dfb0b,_0x52dc97);_0x1a2be1(_0x52dc97);});});} \ No newline at end of file +var _0x6e86=['./chatGroup.socket','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','redis','defaults','localhost'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x6e86,0xa9));var _0x66e8=function(_0x314ccd,_0xb410af){_0x314ccd=_0x314ccd-0x0;var _0x27ed35=_0x6e86[_0x314ccd];return _0x27ed35;};'use strict';var _=require(_0x66e8('0x0'));var util=require(_0x66e8('0x1'));var moment=require(_0x66e8('0x2'));var BPromise=require(_0x66e8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x66e8('0x4'));var db=require(_0x66e8('0x5'))['db'];var utils=require(_0x66e8('0x6'));var logger=require(_0x66e8('0x7'))(_0x66e8('0x8'));var config=require('../../config/environment');var jayson=require(_0x66e8('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x66e8('0xa')]=_[_0x66e8('0xb')](config['redis'],{'host':_0x66e8('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x66e8('0xa')]));require(_0x66e8('0xd'))[_0x66e8('0xe')](socket);function respondWithRpcPromise(_0x3c6599,_0x43beaf,_0x212bbe){return new BPromise(function(_0x4f3117,_0x36e4e7){return client[_0x66e8('0xf')](_0x3c6599,_0x212bbe)[_0x66e8('0x10')](function(_0xcdacce){logger[_0x66e8('0x11')](_0x66e8('0x12'),_0x43beaf,_0x66e8('0x13'));logger['debug'](_0x66e8('0x14'),_0x43beaf,_0x66e8('0x13'),JSON[_0x66e8('0x15')](_0xcdacce));if(_0xcdacce[_0x66e8('0x16')]){if(_0xcdacce[_0x66e8('0x16')]['code']===0x1f4){logger['error'](_0x66e8('0x12'),_0x43beaf,_0xcdacce[_0x66e8('0x16')][_0x66e8('0x17')]);return _0x36e4e7(_0xcdacce[_0x66e8('0x16')]['message']);}logger[_0x66e8('0x16')](_0x66e8('0x12'),_0x43beaf,_0xcdacce[_0x66e8('0x16')][_0x66e8('0x17')]);return _0x4f3117(_0xcdacce[_0x66e8('0x16')]['message']);}else{logger['info'](_0x66e8('0x12'),_0x43beaf,_0x66e8('0x13'));_0x4f3117(_0xcdacce[_0x66e8('0x18')][_0x66e8('0x17')]);}})[_0x66e8('0x19')](function(_0x17fc4d){logger['error'](_0x66e8('0x12'),_0x43beaf,_0x17fc4d);_0x36e4e7(_0x17fc4d);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index d12f0f5..b7d312b 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 _0x4a19=['remove','emit','register','length','chatGroup:','./chatGroup.events','save'];(function(_0x5c2a56,_0x154cbc){var _0x55ea73=function(_0x5afe14){while(--_0x5afe14){_0x5c2a56['push'](_0x5c2a56['shift']());}};_0x55ea73(++_0x154cbc);}(_0x4a19,0xd0));var _0x94a1=function(_0x1256b8,_0x1bba73){_0x1256b8=_0x1256b8-0x0;var _0x52bc82=_0x4a19[_0x1256b8];return _0x52bc82;};'use strict';var ChatGroupEvents=require(_0x94a1('0x0'));var events=[_0x94a1('0x1'),_0x94a1('0x2'),'update'];function createListener(_0x18c314,_0x1dd617){return function(_0x48c3a3){_0x1dd617[_0x94a1('0x3')](_0x18c314,_0x48c3a3);};}function removeListener(_0x24783a,_0x416890){return function(){ChatGroupEvents['removeListener'](_0x24783a,_0x416890);};}exports[_0x94a1('0x4')]=function(_0x33a7ff){for(var _0x57e7be=0x0,_0x4527ad=events[_0x94a1('0x5')];_0x57e7be<_0x4527ad;_0x57e7be++){var _0x42509c=events[_0x57e7be];var _0x3a3d95=createListener(_0x94a1('0x6')+_0x42509c,_0x33a7ff);ChatGroupEvents['on'](_0x42509c,_0x3a3d95);}}; \ No newline at end of file +var _0x2673=['emit','register','chatGroup:','./chatGroup.events','save','remove'];(function(_0x52eca0,_0x277037){var _0x383a52=function(_0x140658){while(--_0x140658){_0x52eca0['push'](_0x52eca0['shift']());}};_0x383a52(++_0x277037);}(_0x2673,0xab));var _0x3267=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0x2673[_0x5f3f88];return _0xd08119;};'use strict';var ChatGroupEvents=require(_0x3267('0x0'));var events=[_0x3267('0x1'),_0x3267('0x2'),'update'];function createListener(_0x274d7b,_0x366a52){return function(_0x188bac){_0x366a52[_0x3267('0x3')](_0x274d7b,_0x188bac);};}function removeListener(_0x29fa3f,_0x21bded){return function(){ChatGroupEvents['removeListener'](_0x29fa3f,_0x21bded);};}exports[_0x3267('0x4')]=function(_0x12f2b4){for(var _0x54dc7f=0x0,_0x736cca=events['length'];_0x54dc7f<_0x736cca;_0x54dc7f++){var _0x4e6d9f=events[_0x54dc7f];var _0x1aa7f9=createListener(_0x3267('0x5')+_0x4e6d9f,_0x12f2b4);ChatGroupEvents['on'](_0x4e6d9f,_0x1aa7f9);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index ae5b255..0d37c3f 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 _0xe319=['get','isAuthenticated','index','/describe','describe','/:id','show','/:id/unread','getMembers','/:id/messages','getMessages','post','create','addMessage','put','delete','destroy','/:id/members','exports','util','path','express','Router','../../components/auth/service','../../config/environment','./chatGroup.controller'];(function(_0x21ab9a,_0x4662dd){var _0x1afd05=function(_0x47e6e8){while(--_0x47e6e8){_0x21ab9a['push'](_0x21ab9a['shift']());}};_0x1afd05(++_0x4662dd);}(_0xe319,0x117));var _0x9e31=function(_0x12691a,_0x2b26e1){_0x12691a=_0x12691a-0x0;var _0xf72be4=_0xe319[_0x12691a];return _0xf72be4;};'use strict';var multer=require('multer');var util=require(_0x9e31('0x0'));var path=require(_0x9e31('0x1'));var timeout=require('connect-timeout');var express=require(_0x9e31('0x2'));var router=express[_0x9e31('0x3')]();var auth=require(_0x9e31('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x9e31('0x5'));var controller=require(_0x9e31('0x6'));router[_0x9e31('0x7')]('/',auth[_0x9e31('0x8')](),controller[_0x9e31('0x9')]);router[_0x9e31('0x7')](_0x9e31('0xa'),auth[_0x9e31('0x8')](),controller[_0x9e31('0xb')]);router[_0x9e31('0x7')](_0x9e31('0xc'),auth['isAuthenticated'](),controller[_0x9e31('0xd')]);router[_0x9e31('0x7')](_0x9e31('0xe'),auth[_0x9e31('0x8')](),controller['getUnread']);router[_0x9e31('0x7')]('/:id/members',auth[_0x9e31('0x8')](),controller[_0x9e31('0xf')]);router[_0x9e31('0x7')](_0x9e31('0x10'),auth[_0x9e31('0x8')](),controller[_0x9e31('0x11')]);router[_0x9e31('0x12')]('/',auth[_0x9e31('0x8')](),controller[_0x9e31('0x13')]);router[_0x9e31('0x12')]('/:id/members',auth[_0x9e31('0x8')](),controller['addMembers']);router[_0x9e31('0x12')](_0x9e31('0x10'),auth[_0x9e31('0x8')](),controller[_0x9e31('0x14')]);router[_0x9e31('0x15')](_0x9e31('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x9e31('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x9e31('0x17')]);router['delete'](_0x9e31('0x18'),auth[_0x9e31('0x8')](),controller['removeMembers']);module[_0x9e31('0x19')]=router; \ No newline at end of file +var _0x812f=['../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/:id','show','/:id/unread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMembers','addMessage','put','update','delete','destroy','exports','multer','util','connect-timeout','Router'];(function(_0x14575a,_0x4abc6d){var _0xd6c154=function(_0x2f293e){while(--_0x2f293e){_0x14575a['push'](_0x14575a['shift']());}};_0xd6c154(++_0x4abc6d);}(_0x812f,0x11a));var _0xf812=function(_0x59efb3,_0x1dc380){_0x59efb3=_0x59efb3-0x0;var _0x1b81fa=_0x812f[_0x59efb3];return _0x1b81fa;};'use strict';var multer=require(_0xf812('0x0'));var util=require(_0xf812('0x1'));var path=require('path');var timeout=require(_0xf812('0x2'));var express=require('express');var router=express[_0xf812('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xf812('0x4'));var config=require(_0xf812('0x5'));var controller=require(_0xf812('0x6'));router[_0xf812('0x7')]('/',auth[_0xf812('0x8')](),controller[_0xf812('0x9')]);router[_0xf812('0x7')]('/describe',auth[_0xf812('0x8')](),controller['describe']);router[_0xf812('0x7')](_0xf812('0xa'),auth[_0xf812('0x8')](),controller[_0xf812('0xb')]);router['get'](_0xf812('0xc'),auth[_0xf812('0x8')](),controller['getUnread']);router[_0xf812('0x7')](_0xf812('0xd'),auth['isAuthenticated'](),controller[_0xf812('0xe')]);router[_0xf812('0x7')](_0xf812('0xf'),auth[_0xf812('0x8')](),controller[_0xf812('0x10')]);router[_0xf812('0x11')]('/',auth[_0xf812('0x8')](),controller[_0xf812('0x12')]);router[_0xf812('0x11')](_0xf812('0xd'),auth[_0xf812('0x8')](),controller[_0xf812('0x13')]);router[_0xf812('0x11')]('/:id/messages',auth[_0xf812('0x8')](),controller[_0xf812('0x14')]);router[_0xf812('0x15')](_0xf812('0xa'),auth[_0xf812('0x8')](),controller[_0xf812('0x16')]);router[_0xf812('0x17')](_0xf812('0xa'),auth[_0xf812('0x8')](),controller[_0xf812('0x18')]);router[_0xf812('0x17')](_0xf812('0xd'),auth[_0xf812('0x8')](),controller['removeMembers']);module[_0xf812('0x19')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 042c31e..aa846e8 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 _0x00f0=['BOOLEAN','star','thumb','TEXT','DATE','STRING','long','ENUM','out','exports'];(function(_0x2f1114,_0x4561f1){var _0x2fe856=function(_0x8397f8){while(--_0x8397f8){_0x2f1114['push'](_0x2f1114['shift']());}};_0x2fe856(++_0x4561f1);}(_0x00f0,0x81));var _0x000f=function(_0x32ccfb,_0x1b9af3){_0x32ccfb=_0x32ccfb-0x0;var _0x1ba8d2=_0x00f0[_0x32ccfb];return _0x1ba8d2;};'use strict';var Sequelize=require('sequelize');module[_0x000f('0x0')]={'closed':{'type':Sequelize[_0x000f('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize['ENUM'](_0x000f('0x2'),_0x000f('0x3')),'defaultValue':_0x000f('0x2')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x000f('0x4')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x000f('0x5')]},'disposition':{'type':Sequelize[_0x000f('0x6')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x000f('0x6')]},'browserVersion':{'type':Sequelize[_0x000f('0x6')]},'osName':{'type':Sequelize[_0x000f('0x6')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x000f('0x6')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x000f('0x6')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x000f('0x6')]},'formData':{'type':Sequelize[_0x000f('0x4')](_0x000f('0x7'))},'read1stAt':{'type':Sequelize[_0x000f('0x5')]},'lastMsgAt':{'type':Sequelize[_0x000f('0x5')]},'lastMsgDirection':{'type':Sequelize[_0x000f('0x8')]('in',_0x000f('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x000f('0x6')]}}; \ No newline at end of file +var _0x9655=['STRING','out','exports','BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','DATE'];(function(_0x2f2d81,_0x2024d3){var _0x45b884=function(_0xbebb53){while(--_0xbebb53){_0x2f2d81['push'](_0x2f2d81['shift']());}};_0x45b884(++_0x2024d3);}(_0x9655,0x160));var _0x5965=function(_0x24e950,_0x7235b9){_0x24e950=_0x24e950-0x0;var _0x3f9001=_0x9655[_0x24e950];return _0x3f9001;};'use strict';var Sequelize=require('sequelize');module[_0x5965('0x0')]={'closed':{'type':Sequelize[_0x5965('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x5965('0x2')]},'ratingType':{'type':Sequelize[_0x5965('0x3')](_0x5965('0x4'),_0x5965('0x5')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0x5965('0x6')]},'pathTranscript':{'type':Sequelize[_0x5965('0x6')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x5965('0x7')]},'disposition':{'type':Sequelize[_0x5965('0x8')]},'note':{'type':Sequelize[_0x5965('0x8')]},'browserName':{'type':Sequelize[_0x5965('0x8')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x5965('0x8')]},'osVersion':{'type':Sequelize[_0x5965('0x8')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x5965('0x8')]},'deviceType':{'type':Sequelize[_0x5965('0x8')]},'referer':{'type':Sequelize[_0x5965('0x6')]},'customerIp':{'type':Sequelize[_0x5965('0x8')]},'formData':{'type':Sequelize[_0x5965('0x6')]('long')},'read1stAt':{'type':Sequelize[_0x5965('0x7')]},'lastMsgAt':{'type':Sequelize[_0x5965('0x7')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x5965('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x5965('0x8')]},'customerPort':{'type':Sequelize[_0x5965('0x8')]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index fc9eff1..f24a23c 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 _0x2bd8=['files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','direction','Account','Owner','30px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','%s\x20#%d','Chat','YYYY-MM-DD','N.A.','closedAt','disposition','browserName','osName','tail','existsSync','createReadStream','createWriteStream','out','secret','renderFile','toFile','err','unlinkSync','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','redis','socket.io-emitter','./chatInteraction.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~!@#$%^&-_=+[{]}.','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','count','offset','limit','Content-Range','json','apply','save','update','then','destroy','name','Users','TagIds','Tags','split','forEach','index','ChatInteraction','rawAttributes','type','key','model','map','query','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','select','field','from','tools_tags','ui.ChatInteractionId','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','expr','search','parseSearch','sqlOperator','conditions','length','find','unreadMessages','value','having','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','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','some','compact','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','createdAt','$gte','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','\x27\x27\x27\x27','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','QueryTypes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','journey','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','isEmpty','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','merge','a.key','Account.key','Account.mandatoryDisposition','i.*','Contact.firstName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ChatInteractionId','rows','show','params','keys','includeAll','include','options','create','body','describe','abandon','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','AbandonInteraction','file','originalname','filename','mimetype','Attachment','attachmentDownload','findOne','Unauthorized','attachId','join','server/files/attachments/','basename','close','mailTranscript','root','server/files/chat/upload/','format','now','pathTranscript','Messages','ChatWebsite','CmContact','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','alias','fullname','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','MailAccount','Smtp','service','host','port','secure','authentication','auth','user','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ChatMessage','omit','nolimit','YYYY-MM-DD\x20HH:mm:ss','findAll','getMyMessages','includeAgent','push','ids','spread','emit','removeTags','server'];(function(_0x2df724,_0x411382){var _0x1b2504=function(_0x1d3cd1){while(--_0x1d3cd1){_0x2df724['push'](_0x2df724['shift']());}};_0x1b2504(++_0x411382);}(_0x2bd8,0x130));var _0x82bd=function(_0x895349,_0x24cc98){_0x895349=_0x895349-0x0;var _0x2bf647=_0x2bd8[_0x895349];return _0x2bf647;};'use strict';var pdf=require(_0x82bd('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x82bd('0x1'));var zipdir=require(_0x82bd('0x2'));var jsonpatch=require(_0x82bd('0x3'));var rp=require(_0x82bd('0x4'));var moment=require(_0x82bd('0x5'));var BPromise=require(_0x82bd('0x6'));var Mustache=require(_0x82bd('0x7'));var util=require('util');var path=require(_0x82bd('0x8'));var sox=require(_0x82bd('0x9'));var csv=require(_0x82bd('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x82bd('0xb'));var squel=require(_0x82bd('0xc'));var crypto=require(_0x82bd('0xd'));var jsforce=require(_0x82bd('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x82bd('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x82bd('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x82bd('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x82bd('0x11'));var config=require(_0x82bd('0x12'));var db=require('../../mysqldb')['db'];config[_0x82bd('0x13')]=_['defaults'](config[_0x82bd('0x13')],{'host':'localhost','port':0x18eb});var socket=require(_0x82bd('0x14'))(new Redis(config[_0x82bd('0x13')]));require(_0x82bd('0x15'))[_0x82bd('0x16')](socket);var jayson=require('jayson/promise');var client=jayson[_0x82bd('0x17')][_0x82bd('0x18')]({'port':0x232b});var client9004=jayson['client'][_0x82bd('0x18')]({'port':0x232c});function checkPasswordPattern(_0x4db39d,_0x35dd09,_0x433e7d){if(_0x433e7d){var _0x2c5155=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2c5155[_0x82bd('0x19')](_0x35dd09)){return _0x4db39d;}else{throw new db[(_0x82bd('0x1a'))][(_0x82bd('0x1b'))](_0x82bd('0x1c'));}}else{return _0x4db39d;}}function respondWithRpcPromise(_0xb7a986,_0x31a350,_0xf180aa,_0x390107){return new BPromise(function(_0x29b689,_0x1c3779){var _0x253741=_0x390107||client;return _0x253741['request'](_0xb7a986,_0xf180aa)['then'](function(_0x283ce7){logger[_0x82bd('0x1d')](_0x82bd('0x1e'),_0x31a350,_0x82bd('0x1f'));logger[_0x82bd('0x20')](_0x82bd('0x21'),_0x31a350,_0x82bd('0x1f'),JSON[_0x82bd('0x22')](_0x283ce7));if(_0x283ce7[_0x82bd('0x23')]){if(_0x283ce7[_0x82bd('0x23')][_0x82bd('0x24')]===0x1f4){logger[_0x82bd('0x23')](_0x82bd('0x1e'),_0x31a350,_0x283ce7[_0x82bd('0x23')][_0x82bd('0x25')]);return _0x1c3779(_0x283ce7[_0x82bd('0x23')][_0x82bd('0x25')]);}logger[_0x82bd('0x23')](_0x82bd('0x1e'),_0x31a350,_0x283ce7['error']['message']);return _0x29b689(_0x283ce7[_0x82bd('0x23')][_0x82bd('0x25')]);}else{logger[_0x82bd('0x1d')](_0x82bd('0x1e'),_0x31a350,_0x82bd('0x1f'));_0x29b689(_0x283ce7[_0x82bd('0x26')][_0x82bd('0x25')]);}})[_0x82bd('0x27')](function(_0x2f0bb6){logger[_0x82bd('0x23')]('ChatInteraction,\x20%s,\x20%s',_0x31a350,_0x2f0bb6);_0x1c3779(_0x2f0bb6);});});}function respondWithStatusCode(_0x5bd22f,_0x5609b7){_0x5609b7=_0x5609b7||0xcc;return function(_0x5d1015){if(_0x5d1015){return _0x5bd22f[_0x82bd('0x28')](_0x5609b7);}return _0x5bd22f[_0x82bd('0x29')](_0x5609b7)[_0x82bd('0x2a')]();};}function respondWithResult(_0x190bca,_0x363ef9){_0x363ef9=_0x363ef9||0xc8;return function(_0x50585e){if(_0x50585e){return _0x190bca['status'](_0x363ef9)['json'](_0x50585e);}};}function respondWithFilteredResult(_0x1e6866,_0x2a5867){return function(_0x40884f){if(_0x40884f){var _0x580ba8=_0x40884f[_0x82bd('0x2b')],_0x166c46=_0x2a5867[_0x82bd('0x2c')],_0x4f209e=_0x2a5867[_0x82bd('0x2c')]+_0x2a5867[_0x82bd('0x2d')],_0x9cc69b;if(_0x4f209e>=_0x580ba8){_0x4f209e=_0x580ba8;_0x9cc69b=0xc8;}else{_0x9cc69b=0xce;}_0x1e6866[_0x82bd('0x29')](_0x9cc69b);return _0x1e6866['set'](_0x82bd('0x2e'),_0x166c46+'-'+_0x4f209e+'/'+_0x580ba8)[_0x82bd('0x2f')](_0x40884f);}return null;};}function patchUpdates(_0x3a7d07){return function(_0x4a927a){try{jsonpatch[_0x82bd('0x30')](_0x4a927a,_0x3a7d07,!![]);}catch(_0x4c8a9b){return BPromise['reject'](_0x4c8a9b);}return _0x4a927a[_0x82bd('0x31')]();};}function saveUpdates(_0x3eb00d,_0x2cc56){return function(_0x44e1d9){if(_0x44e1d9){return _0x44e1d9[_0x82bd('0x32')](_0x3eb00d)[_0x82bd('0x33')](function(_0x45e473){return _0x45e473;});}return null;};}function removeEntity(_0x4497b9,_0x42dc7f){return function(_0xefc6e4){if(_0xefc6e4){return _0xefc6e4[_0x82bd('0x34')]()[_0x82bd('0x33')](function(){_0x4497b9[_0x82bd('0x29')](0xcc)[_0x82bd('0x2a')]();});}};}function handleEntityNotFound(_0x29fecf,_0x23e305){return function(_0x1097e3){if(!_0x1097e3){_0x29fecf['sendStatus'](0x194);}return _0x1097e3;};}function handleError(_0x59b7ca,_0x59319d){_0x59319d=_0x59319d||0x1f4;return function(_0x3fea10){logger[_0x82bd('0x23')](_0x3fea10['stack']);if(_0x3fea10[_0x82bd('0x35')]){delete _0x3fea10['name'];}_0x59b7ca['status'](_0x59319d)['send'](_0x3fea10);};}function getInteractionUsers(_0x2b7675,_0x293116){return new BPromise(function(_0x28e521,_0x396585){try{if(_0x293116[_0x2b7675['id']]){_0x2b7675[_0x82bd('0x36')]=_['map'](_0x293116[_0x2b7675['id']],function(_0x54e33f){return{'id':_0x54e33f['id'],'fullname':_0x54e33f['fullname']};});}}catch(_0x64bc54){_0x396585(_0x64bc54);}_0x28e521(_0x2b7675);});}function getInteractionTags(_0x5f5489,_0x5d09f7){return new BPromise(function(_0xba38a4,_0x37146d){try{if(_0x5f5489[_0x82bd('0x37')]){_0x5f5489[_0x82bd('0x38')]=[];_0x5f5489[_0x82bd('0x37')][_0x82bd('0x39')](',')[_0x82bd('0x3a')](function(_0x1f27f5){_0x5f5489[_0x82bd('0x38')]['push'](_0x5d09f7[_0x1f27f5]);});}delete _0x5f5489['TagIds'];}catch(_0xe210f4){_0x37146d(_0xe210f4);}_0xba38a4(_0x5f5489);});}function updateChatInteraction(_0x689b3c,_0x5835bf,_0x4f066b){return new BPromise(function(_0x277b7a,_0x18a697){return getInteractionUsers(_0x689b3c,_0x4f066b)['then'](function(_0x121f1f){return getInteractionTags(_0x121f1f,_0x5835bf);})[_0x82bd('0x33')](function(_0x42aa82){_0x277b7a(_0x42aa82);})[_0x82bd('0x27')](function(_0x21a7c7){_0x18a697(_0x21a7c7);});});}exports[_0x82bd('0x3b')]=function(_0x2a18c3,_0x2c429d){var _0x21d7d4={},_0x239d48={},_0x399475={'count':0x0,'rows':[]};var _0x9a2bcc=_['map'](db[_0x82bd('0x3c')][_0x82bd('0x3d')],function(_0x4c09ff){return{'name':_0x4c09ff['fieldName'],'type':_0x4c09ff[_0x82bd('0x3e')][_0x82bd('0x3f')]};});_0x239d48[_0x82bd('0x40')]=_[_0x82bd('0x41')](_0x9a2bcc,_0x82bd('0x35'));_0x239d48['query']=_['keys'](_0x2a18c3[_0x82bd('0x42')]);_0x239d48[_0x82bd('0x43')]=_['intersection'](_0x239d48[_0x82bd('0x40')],_0x239d48['query']);_0x21d7d4[_0x82bd('0x44')]=_[_0x82bd('0x45')](_0x239d48['model'],qs[_0x82bd('0x46')](_0x2a18c3[_0x82bd('0x42')]['fields']));_0x21d7d4['attributes']=_0x21d7d4[_0x82bd('0x44')]['length']?_0x21d7d4[_0x82bd('0x44')]:_0x239d48[_0x82bd('0x40')];if(!_0x2a18c3[_0x82bd('0x42')][_0x82bd('0x47')]('nolimit')){_0x21d7d4['limit']=qs[_0x82bd('0x2d')](_0x2a18c3[_0x82bd('0x42')]['limit']);_0x21d7d4[_0x82bd('0x2c')]=qs[_0x82bd('0x2c')](_0x2a18c3[_0x82bd('0x42')]['offset']);}_0x21d7d4[_0x82bd('0x48')]=qs[_0x82bd('0x49')](_0x2a18c3[_0x82bd('0x42')][_0x82bd('0x49')]);_0x21d7d4[_0x82bd('0x4a')]=qs[_0x82bd('0x43')](_[_0x82bd('0x4b')](_0x2a18c3[_0x82bd('0x42')],_0x239d48[_0x82bd('0x43')]));var _0x1fd682=[];var _0x3dc1f7=squel[_0x82bd('0x4c')]()[_0x82bd('0x4d')]('id')['field'](_0x82bd('0x35'))[_0x82bd('0x4d')]('color')[_0x82bd('0x4e')](_0x82bd('0x4f'));var _0x8dfe63=squel[_0x82bd('0x4c')]()['field']('u.id')[_0x82bd('0x4d')]('u.fullname')['field'](_0x82bd('0x50'))['from']('user_has_chat_interactions','ui')[_0x82bd('0x51')](_0x82bd('0x52'),'u',_0x82bd('0x53'));var _0xcfb5ef=squel[_0x82bd('0x4c')]()[_0x82bd('0x4e')](_0x82bd('0x54'),'i')[_0x82bd('0x51')](_0x82bd('0x55'),'c',_0x82bd('0x56'))[_0x82bd('0x51')](_0x82bd('0x52'),'o',_0x82bd('0x57'))[_0x82bd('0x51')](_0x82bd('0x58'),'a','a.id\x20=\x20i.ChatWebsiteId')[_0x82bd('0x51')](_0x82bd('0x59'),'me',_0x82bd('0x5a'))[_0x82bd('0x51')](_0x82bd('0x5b'),'it','it.ChatInteractionId\x20=\x20i.id')['left_join']('tools_tags','t','t.id\x20=\x20it.TagId');var _0x3b91fb=squel[_0x82bd('0x5c')]();var _0x1a4620=[];var _0x127f8f=squel['expr']();var _0x56c954;if(_0x2a18c3[_0x82bd('0x42')][_0x82bd('0x5d')]){_0x56c954=as[_0x82bd('0x5e')](_0x2a18c3['query'][_0x82bd('0x5d')]);var _0x2252ef=_0x56c954[_0x82bd('0x5f')];for(var _0xe29090=0x0;_0xe29090<_0x56c954[_0x82bd('0x60')][_0x82bd('0x61')];_0xe29090++){var _0x144a47=_0x56c954[_0x82bd('0x60')][_0xe29090];var _0x15f843='i';var _0x20b636=_[_0x82bd('0x62')](_0x9a2bcc,[_0x82bd('0x35'),_0x144a47[_0x82bd('0x4d')]]);if(!_0x20b636){switch(_0x144a47[_0x82bd('0x4d')]){case _0x82bd('0x63'):if(_0x144a47[_0x82bd('0x64')]==0x1){_0xcfb5ef[_0x82bd('0x65')]('`'+_0x144a47[_0x82bd('0x4d')]+'`\x20=\x200');}else{_0xcfb5ef[_0x82bd('0x65')]('`'+_0x144a47['field']+'`\x20>\x200');}break;case _0x82bd('0x66'):if(_0x144a47['operator']===_0x82bd('0x67')){if(_0x144a47[_0x82bd('0x64')][_0x82bd('0x39')]('\x20')[_0x82bd('0x61')]>0x1){_0x3b91fb[_0x2252ef](_0x82bd('0x68'),qs[_0x82bd('0x69')](_0x144a47[_0x82bd('0x64')]),null);}else{var _0x1b2979='%'+_0x144a47[_0x82bd('0x64')]+'%';_0x3b91fb[_0x2252ef](_0x82bd('0x6a'),_0x1b2979,_0x1b2979,_0x1b2979);}}else{_0x20b636=_[_0x82bd('0x62')](_0x9a2bcc,['name','ContactId']);_0x144a47[_0x82bd('0x4d')]=_0x82bd('0x6b');_0x505032=as['buildExpression'](_0x15f843,_0x20b636['type'],_0x144a47);_0x3b91fb[_0x2252ef](_0x505032[_0x82bd('0x6c')],_0x505032[_0x82bd('0x64')][_0x82bd('0x6d')],_0x505032[_0x82bd('0x64')]['end']);}break;case _0x82bd('0x6e'):var _0x5431d1=_0x144a47[_0x82bd('0x64')][_0x82bd('0x39')](',')['map'](function(_0x27d247){return Number(_0x27d247);});_0x5431d1[_0x82bd('0x3a')](function(_0x44636e){_0x127f8f['or'](_0x82bd('0x6f'),'%,'+_0x44636e+',%');});_0x1a4620=_['union'](_0x1a4620,_0x5431d1);break;case _0x82bd('0x70'):if(_0x144a47[_0x82bd('0x71')]===_0x82bd('0x67')){_0x3b91fb[_0x2252ef](_0x82bd('0x72'),'%'+_0x144a47[_0x82bd('0x64')]+'%',null);}else{_0x20b636=_[_0x82bd('0x62')](_0x9a2bcc,[_0x82bd('0x35'),_0x82bd('0x73')]);_0x144a47[_0x82bd('0x4d')]='UserId';_0x505032=as[_0x82bd('0x74')](_0x15f843,_0x20b636['type'],_0x144a47);_0x3b91fb[_0x2252ef](_0x505032['text'],_0x505032[_0x82bd('0x64')][_0x82bd('0x6d')],_0x505032['value'][_0x82bd('0x2a')]);}break;case'body':_0x505032=as[_0x82bd('0x74')]('me',null,_0x144a47);_0x3b91fb[_0x2252ef](_0x505032[_0x82bd('0x6c')],_0x505032['value'][_0x82bd('0x6d')],_0x505032[_0x82bd('0x64')]['end']);break;}}else{var _0x505032=as['buildExpression'](_0x15f843,_0x20b636[_0x82bd('0x3e')],_0x144a47);_0x3b91fb[_0x2252ef](_0x505032[_0x82bd('0x6c')],_0x505032['value'][_0x82bd('0x6d')],_0x505032[_0x82bd('0x64')]['end']);}}}else{var _0x5591af=_(_0x2a18c3[_0x82bd('0x42')])['keys']()['map'](function(_0x308b8e){return _[_0x82bd('0x75')](_0x9a2bcc,[_0x82bd('0x35'),_0x308b8e])?_0x308b8e:undefined;})[_0x82bd('0x76')]()[_0x82bd('0x64')]();if(!_['isEmpty'](_0x5591af)){_0x5591af[_0x82bd('0x3a')](function(_0x5101d0){if(_0x5101d0===_0x82bd('0x77')){_0xcfb5ef['where'](_0x82bd('0x78'),[]['concat'](_0x2a18c3['query'][_0x5101d0]));}else if(_0x5101d0===_0x82bd('0x79')){var _0x26e2a6=JSON['parse'](_0x2a18c3[_0x82bd('0x42')][_0x5101d0])[_0x82bd('0x7a')];var _0x16acb7=JSON['parse'](_0x2a18c3['query'][_0x5101d0])[_0x82bd('0x7b')];_0xcfb5ef[_0x82bd('0x4a')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x26e2a6,_0x16acb7);}else{if(_0x2a18c3[_0x82bd('0x42')][_0x5101d0]===_0x82bd('0x7c')){_0xcfb5ef['where']('i.'+_0x5101d0+_0x82bd('0x7d'));}else{_0xcfb5ef[_0x82bd('0x4a')]('i.'+_0x5101d0+_0x82bd('0x7e'),_0x2a18c3[_0x82bd('0x42')][_0x5101d0]);}}});}if(_0x2a18c3[_0x82bd('0x42')][_0x82bd('0x7f')]){if(_0x2a18c3['query'][_0x82bd('0x7f')]==0x1){_0xcfb5ef[_0x82bd('0x65')](_0x82bd('0x80'));}else{_0xcfb5ef['having'](_0x82bd('0x81'));}}if(_0x2a18c3['query'][_0x82bd('0x82')]){_0x1a4620=_[_0x82bd('0x83')](_0x2a18c3[_0x82bd('0x42')][_0x82bd('0x82')])?_0x2a18c3[_0x82bd('0x42')]['tag']:new Array(_0x2a18c3[_0x82bd('0x42')][_0x82bd('0x82')]);_0x1a4620['forEach'](function(_0x2de7a8){_0x127f8f['or'](_0x82bd('0x6f'),'%,'+_0x2de7a8+',%');});}if(_0x2a18c3['query'][_0x82bd('0x84')]){var _0x3d9a3e=_0x2a18c3[_0x82bd('0x42')]['filter']['replace']('\x5c','\x5c\x5c')[_0x82bd('0x85')]('\x27\x27',_0x82bd('0x86'));if(qs[_0x82bd('0x87')](_0x3d9a3e)){_0x3b91fb['or']('i.id\x20LIKE\x20?',_0x3d9a3e+'%');}else{_0x3b91fb['or'](_0x82bd('0x88'),qs[_0x82bd('0x69')](_0x3d9a3e))['or'](_0x82bd('0x89'),_0x3d9a3e+'%');}}}_0xcfb5ef['where'](_0x3b91fb);_0xcfb5ef['group']('i.id');var _0x542daf={'type':db[_0x82bd('0x1a')][_0x82bd('0x8a')]['SELECT'],'raw':!![]};var _0x35d111=_0xcfb5ef['clone']();_0x35d111[_0x82bd('0x4d')]('i.id');_0x35d111[_0x82bd('0x4d')](_0x82bd('0x8b'),_0x82bd('0x63'));if(_0x21d7d4['order']){_0x21d7d4[_0x82bd('0x48')][_0x82bd('0x3a')](function(_0x15119a){_0xcfb5ef[_0x82bd('0x48')]('i.'+_0x15119a[0x0],_0x15119a[0x1]===_0x82bd('0x8c')?![]:!![]);});}if(!_['isEmpty'](_0x1a4620)){_0xcfb5ef[_0x82bd('0x65')](_0x127f8f);_0x35d111[_0x82bd('0x4a')](_0x82bd('0x8d'),_0x1a4620);}BPromise['resolve']()['then'](function(){if(!_0x56c954){if(_0x2a18c3['query'][_0x82bd('0x77')]||_0x2a18c3[_0x82bd('0x42')][_0x82bd('0x8e')])return;_0x35d111[_0x82bd('0x4a')](_0x82bd('0x8f'));_0xcfb5ef['where']('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}return _0x2a18c3['user']['getChatWebsites']({'attributes':['id'],'raw':!![]})[_0x82bd('0x33')](function(_0x519934){if(_[_0x82bd('0x90')](_0x519934)){_0x35d111[_0x82bd('0x4a')](_0x82bd('0x91'));_0xcfb5ef[_0x82bd('0x4a')](_0x82bd('0x91'));}else{_0x35d111['where'](_0x82bd('0x78'),_[_0x82bd('0x41')](_0x519934,'id'));_0xcfb5ef[_0x82bd('0x4a')](_0x82bd('0x78'),_[_0x82bd('0x41')](_0x519934,'id'));}});})[_0x82bd('0x33')](function(){db[_0x82bd('0x92')][_0x82bd('0x42')](_0x35d111[_0x82bd('0x93')](),_0x542daf)[_0x82bd('0x33')](function(_0x31ae4a){_0x399475[_0x82bd('0x2b')]=_0x31ae4a[_0x82bd('0x61')];if(_0x399475['count']===0x0)return[];return db[_0x82bd('0x92')][_0x82bd('0x42')](_0x3dc1f7['toString'](),_0x542daf)['then'](function(_0x5ca4b5){_0x1fd682=_['keyBy'](_0x5ca4b5,'id');_0x542daf=_[_0x82bd('0x94')](_0x542daf,{'model':db[_0x82bd('0x3c')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2a18c3[_0x82bd('0x42')][_0x82bd('0x46')]){_0x21d7d4[_0x82bd('0x44')][_0x82bd('0x3a')](function(_0x17f2aa){_0xcfb5ef[_0x82bd('0x4d')]('i.'+_0x17f2aa);});}else{_0xcfb5ef['field'](_0x82bd('0x8b'),'unreadMessages');_0xcfb5ef[_0x82bd('0x4d')](_0x82bd('0x95'),_0x82bd('0x96'));_0xcfb5ef[_0x82bd('0x4d')]('a.mandatoryDisposition',_0x82bd('0x97'));_0xcfb5ef[_0x82bd('0x4d')](_0x82bd('0x98'));_0xcfb5ef[_0x82bd('0x4d')]('c.firstName',_0x82bd('0x99'));_0xcfb5ef[_0x82bd('0x4d')]('c.lastName','Contact.lastName');_0xcfb5ef['field'](_0x82bd('0x9a'),_0x82bd('0x9b'));_0xcfb5ef[_0x82bd('0x4d')](_0x82bd('0x9c'),_0x82bd('0x9d'));_0xcfb5ef[_0x82bd('0x4d')](_0x82bd('0x9e'),_0x82bd('0x9f'));_0xcfb5ef[_0x82bd('0x4d')](_0x82bd('0xa0'),_0x82bd('0xa1'));_0xcfb5ef[_0x82bd('0x4d')](_0x82bd('0xa2'),_0x82bd('0xa3'));_0xcfb5ef[_0x82bd('0x4d')](_0x82bd('0xa4'),_0x82bd('0xa5'));_0xcfb5ef[_0x82bd('0x4d')](_0x82bd('0xa6'),_0x82bd('0x37'));}_0xcfb5ef[_0x82bd('0x2d')](_0x21d7d4['limit']);_0xcfb5ef['offset'](_0x21d7d4[_0x82bd('0x2c')]);return db[_0x82bd('0x92')][_0x82bd('0x42')](_0xcfb5ef[_0x82bd('0x93')](),_0x542daf);})['then'](function(_0x5d304c){_0x8dfe63[_0x82bd('0x4a')]('ui.ChatInteractionId\x20IN\x20?',_[_0x82bd('0x41')](_0x5d304c,'id'));return db[_0x82bd('0x92')][_0x82bd('0x42')](_0x8dfe63[_0x82bd('0x93')](),_0x542daf)[_0x82bd('0x33')](function(_0x2a10ea){var _0x1570ba=_['groupBy'](_0x2a10ea,_0x82bd('0xa7'));var _0x1f5672=[];_0x5d304c[_0x82bd('0x3a')](function(_0x16299e){_0x1f5672['push'](updateChatInteraction(_0x16299e,_0x1fd682,_0x1570ba));});return BPromise['all'](_0x1f5672);});});})[_0x82bd('0x33')](function(_0x5e8068){_0x399475[_0x82bd('0xa8')]=_0x5e8068;return _0x399475;})[_0x82bd('0x33')](respondWithFilteredResult(_0x2c429d,_0x21d7d4));})[_0x82bd('0x27')](handleError(_0x2c429d,null));};exports[_0x82bd('0xa9')]=function(_0x17c5f5,_0x4930d6){var _0x31da6c={'raw':![],'where':{'id':_0x17c5f5[_0x82bd('0xaa')]['id']}},_0x21a6c8={};_0x21a6c8['model']=_['keys'](db[_0x82bd('0x3c')][_0x82bd('0x3d')]);_0x21a6c8[_0x82bd('0x42')]=_[_0x82bd('0xab')](_0x17c5f5[_0x82bd('0x42')]);_0x21a6c8['filters']=_[_0x82bd('0x45')](_0x21a6c8[_0x82bd('0x40')],_0x21a6c8[_0x82bd('0x42')]);_0x31da6c[_0x82bd('0x44')]=_['intersection'](_0x21a6c8[_0x82bd('0x40')],qs['fields'](_0x17c5f5[_0x82bd('0x42')][_0x82bd('0x46')]));_0x31da6c[_0x82bd('0x44')]=_0x31da6c['attributes']['length']?_0x31da6c['attributes']:_0x21a6c8[_0x82bd('0x40')];if(_0x17c5f5[_0x82bd('0x42')][_0x82bd('0xac')]){_0x31da6c[_0x82bd('0xad')]=[{'all':!![]}];}_0x31da6c=_[_0x82bd('0x94')]({},_0x31da6c,_0x17c5f5[_0x82bd('0xae')]);return db[_0x82bd('0x3c')]['find'](_0x31da6c)[_0x82bd('0x33')](handleEntityNotFound(_0x4930d6,null))[_0x82bd('0x33')](respondWithResult(_0x4930d6,null))[_0x82bd('0x27')](handleError(_0x4930d6,null));};exports[_0x82bd('0xaf')]=function(_0x152dde,_0x2744af){return db[_0x82bd('0x3c')][_0x82bd('0xaf')](_0x152dde[_0x82bd('0xb0')],{})[_0x82bd('0x33')](respondWithResult(_0x2744af,0xc9))['catch'](handleError(_0x2744af,null));};exports[_0x82bd('0x32')]=function(_0xbbec07,_0x32c5ea){if(_0xbbec07[_0x82bd('0xb0')]['id']){delete _0xbbec07['body']['id'];}return db[_0x82bd('0x3c')]['find']({'where':{'id':_0xbbec07[_0x82bd('0xaa')]['id']}})[_0x82bd('0x33')](handleEntityNotFound(_0x32c5ea,null))['then'](saveUpdates(_0xbbec07[_0x82bd('0xb0')],null))[_0x82bd('0x33')](respondWithResult(_0x32c5ea,null))[_0x82bd('0x27')](handleError(_0x32c5ea,null));};exports[_0x82bd('0x34')]=function(_0x53b10a,_0x2599ea){return db[_0x82bd('0x3c')]['find']({'where':{'id':_0x53b10a[_0x82bd('0xaa')]['id']}})[_0x82bd('0x33')](handleEntityNotFound(_0x2599ea,null))[_0x82bd('0x33')](removeEntity(_0x2599ea,null))[_0x82bd('0x27')](handleError(_0x2599ea,null));};exports['describe']=function(_0x2c6d96,_0x534abe){return db[_0x82bd('0x3c')][_0x82bd('0xb1')]()[_0x82bd('0x33')](respondWithResult(_0x534abe,null))[_0x82bd('0x27')](handleError(_0x534abe,null));};exports['customUpdate']=function(_0x1d46b6,_0x503bcd){if(_0x1d46b6[_0x82bd('0xb0')]['id']){delete _0x1d46b6['body']['id'];}return db['ChatInteraction'][_0x82bd('0x62')]({'where':{'id':_0x1d46b6[_0x82bd('0xaa')]['id']}})['then'](handleEntityNotFound(_0x503bcd,null))['then'](saveUpdates(_0x1d46b6['body'],null))[_0x82bd('0x33')](respondWithResult(_0x503bcd,null))['catch'](handleError(_0x503bcd,null));};exports['abandon']=function(_0x11b7dd,_0x4584c8,_0x5726a5){if(_0x11b7dd['body']['id']){delete _0x11b7dd['body']['id'];}return db[_0x82bd('0x3c')]['find']({'where':{'id':_0x11b7dd[_0x82bd('0xaa')]['id']}})[_0x82bd('0x33')](function(_0xafd594){if(!_0xafd594){logger[_0x82bd('0x23')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x82bd('0xb2'),0x194,_0x82bd('0xb3'));_0x4584c8['sendStatus'](0x194);}else{if(_0xafd594[_0x82bd('0x73')]){throw new db[(_0x82bd('0x1a'))][(_0x82bd('0x1b'))](_0x82bd('0xb4'));}}return _0xafd594;})[_0x82bd('0x33')](function(_0x4bceda){if(_0x4bceda){return _0x4bceda[_0x82bd('0x32')]({'closed':_0x11b7dd[_0x82bd('0xb0')][_0x82bd('0xb5')],'disposition':_0x11b7dd[_0x82bd('0xb0')]['disposition']})[_0x82bd('0x33')](function(_0x42f058){return _0x42f058;});}})[_0x82bd('0x33')](function(_0x1caf00){return respondWithRpcPromise(_0x82bd('0xb6'),'abandon',_0x11b7dd[_0x82bd('0xb0')],client9004);})[_0x82bd('0x33')](respondWithResult(_0x4584c8,null))[_0x82bd('0x27')](handleError(_0x4584c8,null));};exports['attachmentUpload']=function(_0x4f5408,_0x243cd4,_0x3fa5f5){_0x4f5408['body'][_0x82bd('0x35')]=_0x4f5408[_0x82bd('0xb7')][_0x82bd('0xb8')];_0x4f5408['body']['basename']=_0x4f5408['file'][_0x82bd('0xb9')];_0x4f5408[_0x82bd('0xb0')]['type']=_0x4f5408['file'][_0x82bd('0xba')];return db[_0x82bd('0xbb')]['create'](_0x4f5408['body'])[_0x82bd('0x33')](respondWithResult(_0x243cd4,0xc9))['catch'](handleError(_0x243cd4,null));};exports[_0x82bd('0xbc')]=function(_0x3a348e,_0x39b840,_0x8deea8){return db['ChatInteraction'][_0x82bd('0xbd')]({'where':{'id':_0x3a348e[_0x82bd('0xaa')]['id']},'raw':!![]})[_0x82bd('0x33')](handleEntityNotFound(_0x39b840,null))['then'](function(_0x3488c8){if(_0x3488c8){if(_0x3488c8[_0x82bd('0xb5')]){return _0x39b840['status'](0x193)[_0x82bd('0x2f')]({'status':0x193,'message':_0x82bd('0xbe')});}return db['Attachment'][_0x82bd('0xbd')]({'where':{'id':_0x3a348e[_0x82bd('0x42')][_0x82bd('0xbf')]},'raw':!![]})[_0x82bd('0x33')](handleEntityNotFound(_0x39b840,null));}})[_0x82bd('0x33')](function(_0x36af9c){if(_0x36af9c){return _0x39b840['download'](path[_0x82bd('0xc0')](config['root'],_0x82bd('0xc1'),_0x36af9c[_0x82bd('0xc2')]));}})[_0x82bd('0x27')](handleError(_0x39b840,null));};exports[_0x82bd('0xc3')]=function(_0x305561,_0x2ae635){var _0x132245=null;var _0x31221e=null;var _0x21b426=null;var _0x32bc99=null;if(_0x305561[_0x82bd('0xb0')]['id']){delete _0x305561[_0x82bd('0xb0')]['id'];}if(_0x305561[_0x82bd('0xb0')][_0x82bd('0xc4')]){_0x32bc99=path[_0x82bd('0xc0')](config[_0x82bd('0xc5')],_0x82bd('0xc6'),util[_0x82bd('0xc7')]('transcript-%s.txt',Date[_0x82bd('0xc8')]()));_0x305561[_0x82bd('0xb0')][_0x82bd('0xc9')]=_0x32bc99;}return db[_0x82bd('0x3c')][_0x82bd('0x62')]({'where':{'id':_0x305561[_0x82bd('0xaa')]['id']},'include':[{'model':db['ChatMessage'],'as':_0x82bd('0xca'),'include':[{'model':db[_0x82bd('0x70')],'as':_0x82bd('0x70')}]}]})[_0x82bd('0x33')](handleEntityNotFound(_0x2ae635,null))[_0x82bd('0x33')](saveUpdates(_0x305561[_0x82bd('0xb0')],null))[_0x82bd('0x33')](function(_0x365808){if(_0x365808){_0x132245=_0x365808;return db[_0x82bd('0xcb')][_0x82bd('0x62')]({'where':{'id':_0x132245[_0x82bd('0x77')]}});}})[_0x82bd('0x33')](function(_0x4b06ae){if(_0x4b06ae){_0x21b426=_0x4b06ae;return db[_0x82bd('0xcc')]['find']({'where':{'id':_0x132245[_0x82bd('0x6b')]}});}})[_0x82bd('0x33')](function(_0x5acb66){if(_0x5acb66){_0x31221e=_0x5acb66;if(_0x32bc99){var _0x3e9bd2=null;for(var _0x4497cd=0x1;_0x4497cd<_0x132245[_0x82bd('0xca')][_0x82bd('0x61')];++_0x4497cd){_0x3e9bd2=_0x132245[_0x82bd('0xca')][_0x4497cd];var _0x1fa65b=_0x3e9bd2['UserId']?util['format'](_0x82bd('0xcd'),_0x21b426[_0x82bd('0xce')],_0x3e9bd2[_0x82bd('0x73')]):_0x82bd('0xcf');var _0x41de14=_0x305561[_0x82bd('0xb0')][_0x82bd('0xd0')]||util[_0x82bd('0xc7')](_0x82bd('0xcd'),_0x82bd('0xd1'),_0x3e9bd2[_0x82bd('0x6b')]);switch(_0x21b426[_0x82bd('0xd2')]){case'website_alias':_0x1fa65b=_0x3e9bd2[_0x82bd('0x73')]?util['format'](_0x82bd('0xcd'),_0x21b426[_0x82bd('0xce')],_0x3e9bd2[_0x82bd('0x73')]):_0x82bd('0xcf');break;case'agent_alias':_0x1fa65b=_0x3e9bd2[_0x82bd('0x73')]?_0x3e9bd2[_0x82bd('0x70')][_0x82bd('0xd3')]||_0x3e9bd2['User'][_0x82bd('0xd4')]:_0x82bd('0xcf');break;case _0x82bd('0xd5'):_0x1fa65b=_0x3e9bd2[_0x82bd('0x73')]?_0x3e9bd2[_0x82bd('0x70')][_0x82bd('0xd4')]:_0x82bd('0xcf');break;default:_0x1fa65b=_0x3e9bd2[_0x82bd('0x73')]?util[_0x82bd('0xc7')](_0x82bd('0xcd'),_0x21b426[_0x82bd('0xce')],_0x3e9bd2[_0x82bd('0x73')]):_0x82bd('0xcf');}var _0x27a6d1=util[_0x82bd('0xc7')](_0x82bd('0xd6'),moment(_0x3e9bd2['createdAt'])[_0x82bd('0xc7')](_0x82bd('0xd7')),_0x3e9bd2['direction']==='in'?_0x41de14:_0x1fa65b,_0x3e9bd2[_0x82bd('0xb0')]);if(!_0x3e9bd2['secret']){fs['appendFileSync'](_0x32bc99,_0x27a6d1);}}return db[_0x82bd('0xd8')]['findOne']({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]});}}})[_0x82bd('0x33')](function(_0x13ea4c){if(_0x13ea4c&&_0x13ea4c[_0x82bd('0xd9')]&&_0x305561['body']){var _0x4c68cc={'tls':{'rejectUnauthorized':![]}};if(_0x13ea4c[_0x82bd('0xd9')][_0x82bd('0xda')]){_0x4c68cc['service']=_0x13ea4c[_0x82bd('0xd9')]['service'];}else{_0x4c68cc[_0x82bd('0xdb')]=_0x13ea4c[_0x82bd('0xd9')][_0x82bd('0xdb')];_0x4c68cc['port']=_0x13ea4c['Smtp'][_0x82bd('0xdc')];_0x4c68cc[_0x82bd('0xdd')]=_0x13ea4c[_0x82bd('0xd9')]['secure'];}if(_0x13ea4c['Smtp'][_0x82bd('0xde')]){_0x4c68cc[_0x82bd('0xdf')]={'user':_0x13ea4c['Smtp'][_0x82bd('0xe0')],'pass':_0x13ea4c[_0x82bd('0xd9')][_0x82bd('0xe1')]};}return respondWithRpcPromise(_0x82bd('0xe2'),_0x82bd('0xe3'),{'account':_0x4c68cc,'message':{'from':util[_0x82bd('0xc7')](_0x82bd('0xe4'),_0x13ea4c[_0x82bd('0x35')],_0x13ea4c[_0x82bd('0xe5')]||_0x13ea4c[_0x82bd('0xd9')][_0x82bd('0xe0')]),'to':_0x305561[_0x82bd('0xb0')][_0x82bd('0xc4')],'subject':_0x82bd('0xe6'),'text':util['format'](_0x82bd('0xe7'),_0x305561[_0x82bd('0xb0')][_0x82bd('0xc4')]),'attachments':[{'path':_0x32bc99}]}})[_0x82bd('0x33')](function(){return _0x132245;})[_0x82bd('0x27')](function(_0x3901d9){console[_0x82bd('0x23')](_0x3901d9);});}else{return _0x132245;}})['then'](respondWithStatusCode(_0x2ae635,0xc8))['catch'](handleError(_0x2ae635,null));};exports[_0x82bd('0xe8')]=function(_0x2541a8,_0x1f39de,_0x1d2ff9){return db[_0x82bd('0xe9')][_0x82bd('0x62')]({'where':{'id':_0x2541a8[_0x82bd('0xaa')]['id']}})[_0x82bd('0x33')](handleEntityNotFound(_0x1f39de,null))[_0x82bd('0x33')](function(_0x214dfe){if(_0x214dfe){return _0x214dfe[_0x82bd('0xe8')](_0x2541a8[_0x82bd('0xb0')]['ids'],_[_0x82bd('0xea')](_0x2541a8['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x1f39de,null))[_0x82bd('0x27')](handleError(_0x1f39de,null));};exports['getMessages']=function(_0x39ecca,_0x12f18c,_0x52fe38){var _0x29456b={'raw':![],'where':{}};var _0x16bb93={};var _0x438836={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x82bd('0xbd')]({'where':{'id':_0x39ecca[_0x82bd('0xaa')]['id']}})['then'](handleEntityNotFound(_0x12f18c,null))[_0x82bd('0x33')](function(_0x498b48){if(_0x498b48){_0x16bb93[_0x82bd('0x40')]=_[_0x82bd('0xab')](db[_0x82bd('0xe9')][_0x82bd('0x3d')]);_0x16bb93[_0x82bd('0x42')]=_[_0x82bd('0xab')](_0x39ecca[_0x82bd('0x42')]);_0x16bb93['filters']=_[_0x82bd('0x45')](_0x16bb93['model'],_0x16bb93[_0x82bd('0x42')]);_0x29456b[_0x82bd('0x44')]=_['intersection'](_0x16bb93[_0x82bd('0x40')],qs['fields'](_0x39ecca[_0x82bd('0x42')][_0x82bd('0x46')]));_0x29456b[_0x82bd('0x44')]=_0x29456b[_0x82bd('0x44')][_0x82bd('0x61')]?_0x29456b[_0x82bd('0x44')]:_0x16bb93[_0x82bd('0x40')];if(!_0x39ecca[_0x82bd('0x42')][_0x82bd('0x47')](_0x82bd('0xeb'))){_0x29456b[_0x82bd('0x2d')]=qs['limit'](_0x39ecca[_0x82bd('0x42')][_0x82bd('0x2d')]);_0x29456b[_0x82bd('0x2c')]=qs[_0x82bd('0x2c')](_0x39ecca[_0x82bd('0x42')][_0x82bd('0x2c')]);}_0x29456b['order']=qs[_0x82bd('0x49')](_0x39ecca[_0x82bd('0x42')][_0x82bd('0x49')]);_0x29456b[_0x82bd('0x4a')]=qs[_0x82bd('0x43')](_[_0x82bd('0x4b')](_0x39ecca[_0x82bd('0x42')],_0x16bb93[_0x82bd('0x43')]));_0x29456b[_0x82bd('0x4a')][_0x82bd('0xa7')]=_0x498b48['id'];if(_0x39ecca[_0x82bd('0x42')]['filter']){_0x29456b[_0x82bd('0x4a')]=_['merge'](_0x29456b[_0x82bd('0x4a')],{'$or':_[_0x82bd('0x41')](_0x29456b[_0x82bd('0x44')],function(_0x5aab8f){var _0x3d792b={};_0x3d792b[_0x5aab8f]={'$like':'%'+_0x39ecca[_0x82bd('0x42')][_0x82bd('0x84')]+'%'};return _0x3d792b;})});}if(_0x39ecca['query'][_0x82bd('0x7a')]){var _0x13cb83=_0x39ecca[_0x82bd('0x42')][_0x82bd('0x7a')][_0x82bd('0x39')](',');var _0x218cea={};_0x218cea[_0x13cb83[0x0]]={'$gte':moment(_0x13cb83[0x1])[_0x82bd('0xc7')](_0x82bd('0xec'))};_0x29456b[_0x82bd('0x4a')]=_[_0x82bd('0x94')](_0x29456b[_0x82bd('0x4a')],_0x218cea);}_0x29456b=_[_0x82bd('0x94')]({},_0x29456b,_0x39ecca['options']);return db[_0x82bd('0xe9')][_0x82bd('0x2b')]({'where':_0x29456b['where']})[_0x82bd('0x33')](function(_0x393e6b){_0x438836[_0x82bd('0x2b')]=_0x393e6b;if(_0x39ecca[_0x82bd('0x42')][_0x82bd('0xac')]){_0x29456b[_0x82bd('0xad')]=[{'all':!![]}];}return db['ChatMessage'][_0x82bd('0xed')](_0x29456b);})[_0x82bd('0x33')](function(_0x589d31){_0x438836[_0x82bd('0xa8')]=_0x589d31;return _0x438836;});}})[_0x82bd('0x33')](respondWithFilteredResult(_0x12f18c,_0x29456b))[_0x82bd('0x27')](handleError(_0x12f18c,null));};exports[_0x82bd('0xee')]=function(_0x52e55f,_0x345707,_0x4e29f6){var _0x28fae0={'where':{}},_0x492827={},_0x1736f3={'count':0x0,'rows':[]};return db[_0x82bd('0x3c')][_0x82bd('0xbd')]({'where':{'id':_0x52e55f[_0x82bd('0xaa')]['id']}})[_0x82bd('0x33')](handleEntityNotFound(_0x345707,null))[_0x82bd('0x33')](function(_0x107374){if(_0x107374){_0x492827['model']=_[_0x82bd('0xab')](db[_0x82bd('0xe9')][_0x82bd('0x3d')]);_0x492827['query']=_[_0x82bd('0xab')](_0x52e55f[_0x82bd('0x42')]);_0x492827['filters']=_[_0x82bd('0x45')](_0x492827[_0x82bd('0x40')],_0x492827[_0x82bd('0x42')]);_0x28fae0[_0x82bd('0x44')]=_[_0x82bd('0x45')](_0x492827['model'],qs['fields'](_0x52e55f['query'][_0x82bd('0x46')]));_0x28fae0['attributes']=_0x28fae0[_0x82bd('0x44')][_0x82bd('0x61')]?_0x28fae0[_0x82bd('0x44')]:_0x492827['model'];if(!_0x52e55f[_0x82bd('0x42')][_0x82bd('0x47')](_0x82bd('0xeb'))){_0x28fae0[_0x82bd('0x2d')]=qs[_0x82bd('0x2d')](_0x52e55f['query'][_0x82bd('0x2d')]);_0x28fae0[_0x82bd('0x2c')]=qs[_0x82bd('0x2c')](_0x52e55f[_0x82bd('0x42')][_0x82bd('0x2c')]);}_0x28fae0['order']=qs[_0x82bd('0x49')](_0x52e55f[_0x82bd('0x42')][_0x82bd('0x49')]);_0x28fae0['where']=qs[_0x82bd('0x43')](_[_0x82bd('0x4b')](_0x52e55f[_0x82bd('0x42')],_0x492827[_0x82bd('0x43')]));_0x28fae0[_0x82bd('0x4a')][_0x82bd('0xa7')]=_0x107374['id'];if(_0x52e55f['query'][_0x82bd('0x84')]){_0x28fae0[_0x82bd('0x4a')]=_[_0x82bd('0x94')](_0x28fae0[_0x82bd('0x4a')],{'$or':_[_0x82bd('0x41')](_0x28fae0[_0x82bd('0x44')],function(_0x453092){var _0x54b993={};_0x54b993[_0x453092]={'$like':'%'+_0x52e55f[_0x82bd('0x42')][_0x82bd('0x84')]+'%'};return _0x54b993;})});}_0x28fae0['where']['secret']=![];if(_0x52e55f['query']['id']){_0x28fae0[_0x82bd('0x4a')]['id']={'$gt':_0x52e55f[_0x82bd('0x42')]['id']};}_0x28fae0=_[_0x82bd('0x94')]({},_0x28fae0,_0x52e55f[_0x82bd('0xae')]);return db['ChatMessage'][_0x82bd('0x2b')]({'where':_0x28fae0['where']})[_0x82bd('0x33')](function(_0x305cbd){_0x1736f3[_0x82bd('0x2b')]=_0x305cbd;_0x28fae0['include']=[];if(_0x52e55f[_0x82bd('0x42')][_0x82bd('0xef')]){_0x28fae0['include'][_0x82bd('0xf0')]({'model':db[_0x82bd('0x70')],'as':_0x82bd('0x70'),'attributes':['id',_0x82bd('0xd4'),_0x82bd('0xd3')]});}if(_0x52e55f['query'][_0x82bd('0xac')]){_0x28fae0[_0x82bd('0xad')]=[{'all':!![]}];}return db['ChatMessage'][_0x82bd('0xed')](_0x28fae0);})[_0x82bd('0x33')](function(_0x19a379){_0x1736f3[_0x82bd('0xa8')]=_0x19a379;return _0x1736f3;});}})[_0x82bd('0x33')](respondWithFilteredResult(_0x345707,_0x28fae0))[_0x82bd('0x27')](handleError(_0x345707,null));};exports['addTags']=function(_0xb081ae,_0x9903e2,_0x56b691){return db[_0x82bd('0x3c')][_0x82bd('0x62')]({'where':{'id':_0xb081ae[_0x82bd('0xaa')]['id']}})[_0x82bd('0x33')](handleEntityNotFound(_0x9903e2,null))[_0x82bd('0x33')](function(_0x46b569){if(_0x46b569){return _0x46b569['setTags'](_0xb081ae[_0x82bd('0xb0')][_0x82bd('0xf1')],_[_0x82bd('0xea')](_0xb081ae['body'],[_0x82bd('0xf1'),'id'])||{})[_0x82bd('0xf2')](function(){return db['Tag']['findAll']({'attributes':['id',_0x82bd('0x35'),'color'],'where':{'id':_0xb081ae[_0x82bd('0xb0')][_0x82bd('0xf1')]}});})['then'](function(_0x26d5ff){socket[_0x82bd('0xf3')]('chatInteractionTags:save',{'id':Number(_0xb081ae[_0x82bd('0xaa')]['id']),'tags':_0x26d5ff||[]});return{'id':Number(_0xb081ae[_0x82bd('0xaa')]['id']),'tags':_0x26d5ff||[]};});}})[_0x82bd('0x33')](respondWithResult(_0x9903e2,null))['catch'](handleError(_0x9903e2,null));};exports[_0x82bd('0xf4')]=function(_0x130fad,_0x4c7861,_0x53135b){return db[_0x82bd('0x3c')]['find']({'where':{'id':_0x130fad[_0x82bd('0xaa')]['id']}})[_0x82bd('0x33')](handleEntityNotFound(_0x4c7861,null))[_0x82bd('0x33')](function(_0x488faf){if(_0x488faf){return _0x488faf['removeTags'](_0x130fad[_0x82bd('0x42')]['ids']);}})['then'](respondWithStatusCode(_0x4c7861,null))[_0x82bd('0x27')](handleError(_0x4c7861,null));};exports['download']=function(_0x56d036,_0x5cf973){var _0x38d44e=moment()['unix']()[_0x82bd('0x93')]();var _0x27a84b=path[_0x82bd('0xc0')](config[_0x82bd('0xc5')],_0x82bd('0xf5'),_0x82bd('0xf6'),_0x82bd('0xf7'));var _0x3aad63=path[_0x82bd('0xc0')](config['root'],_0x82bd('0xf5'),_0x82bd('0xf6'),_0x82bd('0xf8'));var _0xc107f5=path['join'](_0x27a84b,_0x38d44e);var _0x3a342c=util[_0x82bd('0xc7')](_0x82bd('0xf9'),_0x56d036['params']['id'],_0x38d44e);var _0x5a579f=path[_0x82bd('0xc0')](_0x27a84b,_0x3a342c);var _0x5a4256=[];_0x5a4256[_0x82bd('0xf0')]({'model':db[_0x82bd('0x70')],'as':'User','attributes':['id',_0x82bd('0xd4')],'raw':!![]});_0x5a4256['push']({'model':db[_0x82bd('0xcc')],'as':_0x82bd('0x66'),'attributes':['id',_0x82bd('0xfa'),_0x82bd('0xfb')],'raw':!![]});if(_0x56d036['query'][_0x82bd('0xf8')]){_0x5a4256[_0x82bd('0xf0')]({'model':db[_0x82bd('0xbb')],'as':_0x82bd('0xbb'),'raw':!![]});}var _0x22b578=[{'model':db['ChatMessage'],'as':_0x82bd('0xca'),'attributes':['id',_0x82bd('0xb0'),_0x82bd('0x79'),_0x82bd('0xfc'),'secret',_0x82bd('0x7f')],'include':_0x5a4256}];_0x22b578[_0x82bd('0xf0')]({'model':db['ChatWebsite'],'as':_0x82bd('0xfd'),'attributes':['id',_0x82bd('0x35')]});_0x22b578[_0x82bd('0xf0')]({'model':db['User'],'as':_0x82bd('0xfe'),'attributes':['id',_0x82bd('0xd4')]});return db[_0x82bd('0x3c')]['find']({'where':{'id':_0x56d036[_0x82bd('0xaa')]['id']},'include':_0x22b578})[_0x82bd('0x33')](handleEntityNotFound(_0x5cf973,null))[_0x82bd('0x33')](function(_0x412141){if(_0x412141){var _0x2907d0=_0x412141['get']({'plain':!![]});fs['mkdirSync'](_0xc107f5);var _0x56719e={'format':'A4','border':'10px','header':{'height':'40px','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':_0x82bd('0xff'),'contents':{'default':util['format'](_0x82bd('0x100'),util[_0x82bd('0xc7')](_0x82bd('0x101'),_0x82bd('0x102'),_0x2907d0['id']),moment()[_0x82bd('0xc7')](_0x82bd('0x103'))[_0x82bd('0x93')]())}}};var _0x5a5caa={'channel':'Chat','account':_0x2907d0[_0x82bd('0xfd')][_0x82bd('0x35')],'agent':_0x2907d0[_0x82bd('0xfe')]?_0x2907d0[_0x82bd('0xfe')][_0x82bd('0xd4')]:_0x82bd('0x104'),'createdAt':moment(_0x2907d0[_0x82bd('0x79')])[_0x82bd('0xc7')](_0x82bd('0xec'))[_0x82bd('0x93')](),'closedAt':_0x2907d0['closed']?moment(_0x2907d0[_0x82bd('0x105')])['format'](_0x82bd('0xec'))['toString']():'','disposition':_0x2907d0[_0x82bd('0x106')],'chatInfo':{'browser':_0x2907d0[_0x82bd('0x107')],'os':_0x2907d0[_0x82bd('0x108')],'referer':_0x2907d0['referer'],'customerIp':_0x2907d0['customerIp'],'customerPort':_0x2907d0['customerPort']?_0x2907d0['customerPort']:_0x82bd('0x104')},'messages':_(_0x2907d0[_0x82bd('0xca')])[_0x82bd('0x109')]()[_0x82bd('0x84')]({'secret':![]})[_0x82bd('0x41')](function(_0x4c3016){if(_0x4c3016[_0x82bd('0xbb')]){var _0x5dfdfc=path['join'](_0x3aad63,_0x4c3016['Attachment'][_0x82bd('0xc2')]);if(fs[_0x82bd('0x10a')](_0x5dfdfc)){fs[_0x82bd('0x10b')](_0x5dfdfc)['pipe'](fs[_0x82bd('0x10c')](path[_0x82bd('0xc0')](_0xc107f5,_0x4c3016[_0x82bd('0xbb')][_0x82bd('0xc2')])));}}return{'date':moment(_0x4c3016[_0x82bd('0x79')])['format'](_0x82bd('0xec'))[_0x82bd('0x93')](),'sender':_0x4c3016['direction']==='out'?_0x4c3016['User']?_0x4c3016[_0x82bd('0x70')][_0x82bd('0xd4')]:_0x82bd('0xcf'):_0x4c3016[_0x82bd('0x66')]['firstName']+(_0x4c3016[_0x82bd('0x66')][_0x82bd('0xfb')]?'\x20'+_0x4c3016[_0x82bd('0x66')][_0x82bd('0xfb')]:''),'body':_0x4c3016['Attachment']?_0x4c3016['Attachment']['basename']:_0x4c3016[_0x82bd('0xb0')],'direction':_0x4c3016[_0x82bd('0xfc')]===_0x82bd('0x10d')?'A':'C','secret':_0x4c3016[_0x82bd('0x10e')],'read':_0x4c3016['read'],'attachment':_0x4c3016['Attachment']};})[_0x82bd('0x64')]()};return ejs[_0x82bd('0x10f')](path['join'](config[_0x82bd('0xc5')],_0x82bd('0xf5'),'views','downloadInteraction.html'),{'interaction':_0x5a5caa})[_0x82bd('0x33')](function(_0x31af19){return new BPromise(function(_0x5caf82,_0x42d49b){pdf[_0x82bd('0xaf')](_0x31af19,_0x56719e)[_0x82bd('0x110')](path[_0x82bd('0xc0')](_0xc107f5,'transcript-'+_0x2907d0['id']+'-'+_0x38d44e+'.pdf'),function(_0x420e05,_0x3660b8){if(_0x420e05)return _0x42d49b(_0x420e05);_0x5caf82(_0x3660b8);});});})[_0x82bd('0x33')](function(){return new BPromise(function(_0x1178e9,_0x5a5318){zipdir(_0xc107f5,{'saveTo':_0x5a579f},function(_0x57ad60,_0x5e5d8d){if(_0x57ad60)return _0x5a5318(_0x57ad60);return _0x1178e9(_0x5e5d8d);});})[_0x82bd('0x33')](function(){return new BPromise(function(_0x3c904a,_0x43acba){rimraf(_0xc107f5,function(_0x5c37dd){if(_0x5c37dd)_0x43acba(_0x5c37dd);return _0x3c904a();});});})['then'](function(){return _0x5cf973['download'](_0x5a579f,_0x3a342c,function(_0x518a47){if(_0x518a47){console['log'](_0x82bd('0x111'),_0x518a47);}else{fs[_0x82bd('0x112')](_0x5a579f);}});});});}else{return _0x5cf973[_0x82bd('0x28')](0xc8);}})[_0x82bd('0x27')](handleError(_0x5cf973,null));}; \ No newline at end of file +var _0xf072=['`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','QueryTypes','clone','unreadMessages','DESC','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','sequelize','toString','keyBy','merge','ChatInteraction','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','i.*','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','all','show','rawAttributes','include','options','create','body','params','describe','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','disposition','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','attachmentDownload','findOne','closed','Unauthorized','attachId','download','join','root','server/files/attachments/','close','mailTranscript','server/files/chat/upload/','format','now','pathTranscript','Messages','ChatWebsite','CmContact','agentAlias','customer','%s%d','Visitor','System','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','direction','secret','Smtp','service','host','port','secure','authentication','auth','pass','sendMail','\x22%s\x22\x20<%s>','email','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ChatMessage','getMessages','hasOwnProperty','ChatInteractionId','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','getMyMessages','rows','addTags','setTags','ids','omit','spread','emit','chatInteractionTags:save','removeTags','unix','server','files','tmp','attachments','Contact','firstName','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','osName','referer','customerIp','customerPort','N.A.','tail','existsSync','createReadStream','pipe','createWriteStream','out','lastName','views','downloadInteraction.html','toFile','transcript-','log','unlinkSync','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','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/utils','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','stringify','error','ChatInteraction,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','destroy','stack','name','Users','fullname','Tags','TagIds','split','forEach','push','index','map','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','nolimit','order','sort','where','pick','field','color','from','tools_tags','select','u.id','u.fullname','user_has_chat_interactions','left_join','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','chat_websites','chat_messages','me.ChatInteractionId\x20=\x20i.id','it.ChatInteractionId\x20=\x20i.id','expr','search','parseSearch','sqlOperator','conditions','length','find','having','`\x20>\x200','operator','$substring','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','UserId','compact','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read'];(function(_0x2a9e61,_0x1a0610){var _0x16eaee=function(_0x1434f7){while(--_0x1434f7){_0x2a9e61['push'](_0x2a9e61['shift']());}};_0x16eaee(++_0x1a0610);}(_0xf072,0x1cf));var _0x2f07=function(_0x11978f,_0x25897b){_0x11978f=_0x11978f-0x0;var _0x5c3e80=_0xf072[_0x11978f];return _0x5c3e80;};'use strict';var pdf=require(_0x2f07('0x0'));var emlformat=require(_0x2f07('0x1'));var rimraf=require(_0x2f07('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2f07('0x3'));var rp=require('request-promise');var moment=require(_0x2f07('0x4'));var BPromise=require(_0x2f07('0x5'));var Mustache=require(_0x2f07('0x6'));var util=require('util');var path=require(_0x2f07('0x7'));var sox=require(_0x2f07('0x8'));var csv=require(_0x2f07('0x9'));var ejs=require(_0x2f07('0xa'));var fs=require('fs');var _=require(_0x2f07('0xb'));var squel=require(_0x2f07('0xc'));var crypto=require(_0x2f07('0xd'));var jsforce=require(_0x2f07('0xe'));var deskjs=require(_0x2f07('0xf'));var toCsv=require(_0x2f07('0x9'));var querystring=require(_0x2f07('0x10'));var Papa=require(_0x2f07('0x11'));var Redis=require(_0x2f07('0x12'));var authService=require(_0x2f07('0x13'));var qs=require(_0x2f07('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2f07('0x15'));var logger=require(_0x2f07('0x16'))(_0x2f07('0x17'));var utils=require(_0x2f07('0x18'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x2f07('0x19')]=_[_0x2f07('0x1a')](config['redis'],{'host':_0x2f07('0x1b'),'port':0x18eb});var socket=require(_0x2f07('0x1c'))(new Redis(config[_0x2f07('0x19')]));require('./chatInteraction.socket')[_0x2f07('0x1d')](socket);var jayson=require(_0x2f07('0x1e'));var client=jayson[_0x2f07('0x1f')][_0x2f07('0x20')]({'port':0x232b});var client9004=jayson[_0x2f07('0x1f')][_0x2f07('0x20')]({'port':0x232c});function checkPasswordPattern(_0x5d32d6,_0x8475cf,_0x5a7b5c){if(_0x5a7b5c){var _0x2232a4=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2232a4[_0x2f07('0x21')](_0x8475cf)){return _0x5d32d6;}else{throw new db[(_0x2f07('0x22'))][(_0x2f07('0x23'))](_0x2f07('0x24'));}}else{return _0x5d32d6;}}function respondWithRpcPromise(_0x46c9b4,_0x1a6135,_0xe3ed0,_0x55bd60){return new BPromise(function(_0x15c3dd,_0x4e35fd){var _0x3cd3c0=_0x55bd60||client;return _0x3cd3c0[_0x2f07('0x25')](_0x46c9b4,_0xe3ed0)[_0x2f07('0x26')](function(_0xd944d6){logger[_0x2f07('0x27')]('ChatInteraction,\x20%s,\x20%s',_0x1a6135,_0x2f07('0x28'));logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x1a6135,'request\x20sent',JSON[_0x2f07('0x29')](_0xd944d6));if(_0xd944d6['error']){if(_0xd944d6[_0x2f07('0x2a')]['code']===0x1f4){logger[_0x2f07('0x2a')](_0x2f07('0x2b'),_0x1a6135,_0xd944d6[_0x2f07('0x2a')][_0x2f07('0x2c')]);return _0x4e35fd(_0xd944d6['error'][_0x2f07('0x2c')]);}logger[_0x2f07('0x2a')](_0x2f07('0x2b'),_0x1a6135,_0xd944d6['error'][_0x2f07('0x2c')]);return _0x15c3dd(_0xd944d6[_0x2f07('0x2a')]['message']);}else{logger[_0x2f07('0x27')](_0x2f07('0x2b'),_0x1a6135,'request\x20sent');_0x15c3dd(_0xd944d6[_0x2f07('0x2d')]['message']);}})[_0x2f07('0x2e')](function(_0x17a43a){logger[_0x2f07('0x2a')](_0x2f07('0x2b'),_0x1a6135,_0x17a43a);_0x4e35fd(_0x17a43a);});});}function respondWithStatusCode(_0x20e4f8,_0x139ea8){_0x139ea8=_0x139ea8||0xcc;return function(_0x787aad){if(_0x787aad){return _0x20e4f8[_0x2f07('0x2f')](_0x139ea8);}return _0x20e4f8[_0x2f07('0x30')](_0x139ea8)[_0x2f07('0x31')]();};}function respondWithResult(_0x3b4e2f,_0x279eb3){_0x279eb3=_0x279eb3||0xc8;return function(_0x4c607a){if(_0x4c607a){return _0x3b4e2f[_0x2f07('0x30')](_0x279eb3)[_0x2f07('0x32')](_0x4c607a);}};}function respondWithFilteredResult(_0xada137,_0x571839){return function(_0x36d4b8){if(_0x36d4b8){var _0x21b5e6=_0x36d4b8[_0x2f07('0x33')],_0x115c97=_0x571839[_0x2f07('0x34')],_0x5ad0de=_0x571839[_0x2f07('0x34')]+_0x571839[_0x2f07('0x35')],_0xcd91be;if(_0x5ad0de>=_0x21b5e6){_0x5ad0de=_0x21b5e6;_0xcd91be=0xc8;}else{_0xcd91be=0xce;}_0xada137[_0x2f07('0x30')](_0xcd91be);return _0xada137[_0x2f07('0x36')]('Content-Range',_0x115c97+'-'+_0x5ad0de+'/'+_0x21b5e6)[_0x2f07('0x32')](_0x36d4b8);}return null;};}function patchUpdates(_0x5b0407){return function(_0x3496eb){try{jsonpatch[_0x2f07('0x37')](_0x3496eb,_0x5b0407,!![]);}catch(_0x2ee193){return BPromise[_0x2f07('0x38')](_0x2ee193);}return _0x3496eb[_0x2f07('0x39')]();};}function saveUpdates(_0x26daca,_0x153792){return function(_0x3a2bb7){if(_0x3a2bb7){return _0x3a2bb7[_0x2f07('0x3a')](_0x26daca)[_0x2f07('0x26')](function(_0x2fafba){return _0x2fafba;});}return null;};}function removeEntity(_0x2461cc,_0xa74d2c){return function(_0x2cadb1){if(_0x2cadb1){return _0x2cadb1[_0x2f07('0x3b')]()[_0x2f07('0x26')](function(){_0x2461cc['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3975cd,_0x142449){return function(_0x4532c5){if(!_0x4532c5){_0x3975cd['sendStatus'](0x194);}return _0x4532c5;};}function handleError(_0x51744a,_0x347bfa){_0x347bfa=_0x347bfa||0x1f4;return function(_0x4acfb6){logger[_0x2f07('0x2a')](_0x4acfb6[_0x2f07('0x3c')]);if(_0x4acfb6[_0x2f07('0x3d')]){delete _0x4acfb6[_0x2f07('0x3d')];}_0x51744a[_0x2f07('0x30')](_0x347bfa)['send'](_0x4acfb6);};}function getInteractionUsers(_0x45fe2f,_0x49f610){return new BPromise(function(_0x3664eb,_0x4b38ba){try{if(_0x49f610[_0x45fe2f['id']]){_0x45fe2f[_0x2f07('0x3e')]=_['map'](_0x49f610[_0x45fe2f['id']],function(_0x508f8a){return{'id':_0x508f8a['id'],'fullname':_0x508f8a[_0x2f07('0x3f')]};});}}catch(_0x256de1){_0x4b38ba(_0x256de1);}_0x3664eb(_0x45fe2f);});}function getInteractionTags(_0x5e96b5,_0x3e4e48){return new BPromise(function(_0x52b0ba,_0x429ae1){try{if(_0x5e96b5['TagIds']){_0x5e96b5[_0x2f07('0x40')]=[];_0x5e96b5[_0x2f07('0x41')][_0x2f07('0x42')](',')[_0x2f07('0x43')](function(_0x25b1a9){_0x5e96b5[_0x2f07('0x40')][_0x2f07('0x44')](_0x3e4e48[_0x25b1a9]);});}delete _0x5e96b5[_0x2f07('0x41')];}catch(_0x5083d5){_0x429ae1(_0x5083d5);}_0x52b0ba(_0x5e96b5);});}function updateChatInteraction(_0x209752,_0x263518,_0x20d8da){return new BPromise(function(_0x3f1b6b,_0x46c665){return getInteractionUsers(_0x209752,_0x20d8da)[_0x2f07('0x26')](function(_0x5129c){return getInteractionTags(_0x5129c,_0x263518);})['then'](function(_0xb61345){_0x3f1b6b(_0xb61345);})[_0x2f07('0x2e')](function(_0x32e3b0){_0x46c665(_0x32e3b0);});});}exports[_0x2f07('0x45')]=function(_0x3db7ad,_0xb6afe8){var _0x4d5932={},_0x2361f2={},_0x2ed96d={'count':0x0,'rows':[]};var _0xcf8dd8=_[_0x2f07('0x46')](db['ChatInteraction']['rawAttributes'],function(_0x290c3e){return{'name':_0x290c3e[_0x2f07('0x47')],'type':_0x290c3e[_0x2f07('0x48')][_0x2f07('0x49')]};});_0x2361f2['model']=_[_0x2f07('0x46')](_0xcf8dd8,_0x2f07('0x3d'));_0x2361f2[_0x2f07('0x4a')]=_[_0x2f07('0x4b')](_0x3db7ad[_0x2f07('0x4a')]);_0x2361f2[_0x2f07('0x4c')]=_[_0x2f07('0x4d')](_0x2361f2[_0x2f07('0x4e')],_0x2361f2[_0x2f07('0x4a')]);_0x4d5932[_0x2f07('0x4f')]=_['intersection'](_0x2361f2['model'],qs['fields'](_0x3db7ad[_0x2f07('0x4a')][_0x2f07('0x50')]));_0x4d5932['attributes']=_0x4d5932[_0x2f07('0x4f')]['length']?_0x4d5932[_0x2f07('0x4f')]:_0x2361f2[_0x2f07('0x4e')];if(!_0x3db7ad[_0x2f07('0x4a')]['hasOwnProperty'](_0x2f07('0x51'))){_0x4d5932[_0x2f07('0x35')]=qs['limit'](_0x3db7ad['query'][_0x2f07('0x35')]);_0x4d5932[_0x2f07('0x34')]=qs[_0x2f07('0x34')](_0x3db7ad[_0x2f07('0x4a')][_0x2f07('0x34')]);}_0x4d5932[_0x2f07('0x52')]=qs[_0x2f07('0x53')](_0x3db7ad[_0x2f07('0x4a')][_0x2f07('0x53')]);_0x4d5932[_0x2f07('0x54')]=qs[_0x2f07('0x4c')](_[_0x2f07('0x55')](_0x3db7ad[_0x2f07('0x4a')],_0x2361f2[_0x2f07('0x4c')]));var _0x21af60=[];var _0x42ea53=squel['select']()[_0x2f07('0x56')]('id')[_0x2f07('0x56')](_0x2f07('0x3d'))[_0x2f07('0x56')](_0x2f07('0x57'))[_0x2f07('0x58')](_0x2f07('0x59'));var _0x23a8ee=squel[_0x2f07('0x5a')]()['field'](_0x2f07('0x5b'))[_0x2f07('0x56')](_0x2f07('0x5c'))[_0x2f07('0x56')]('ui.ChatInteractionId')['from'](_0x2f07('0x5d'),'ui')[_0x2f07('0x5e')]('users','u','u.id\x20=\x20ui.UserId');var _0xc3b506=squel['select']()[_0x2f07('0x58')](_0x2f07('0x5f'),'i')[_0x2f07('0x5e')](_0x2f07('0x60'),'c',_0x2f07('0x61'))[_0x2f07('0x5e')](_0x2f07('0x62'),'o',_0x2f07('0x63'))[_0x2f07('0x5e')](_0x2f07('0x64'),'a','a.id\x20=\x20i.ChatWebsiteId')[_0x2f07('0x5e')](_0x2f07('0x65'),'me',_0x2f07('0x66'))[_0x2f07('0x5e')]('chat_interaction_has_tags','it',_0x2f07('0x67'))['left_join']('tools_tags','t','t.id\x20=\x20it.TagId');var _0x43fa9b=squel[_0x2f07('0x68')]();var _0x111096=[];var _0x2e017c=squel[_0x2f07('0x68')]();var _0x4fab7d;if(_0x3db7ad[_0x2f07('0x4a')][_0x2f07('0x69')]){_0x4fab7d=as[_0x2f07('0x6a')](_0x3db7ad['query'][_0x2f07('0x69')]);var _0x488dec=_0x4fab7d[_0x2f07('0x6b')];for(var _0x4c9b01=0x0;_0x4c9b01<_0x4fab7d[_0x2f07('0x6c')][_0x2f07('0x6d')];_0x4c9b01++){var _0x4408a7=_0x4fab7d[_0x2f07('0x6c')][_0x4c9b01];var _0x3a750f='i';var _0x2b6ff8=_[_0x2f07('0x6e')](_0xcf8dd8,[_0x2f07('0x3d'),_0x4408a7[_0x2f07('0x56')]]);if(!_0x2b6ff8){switch(_0x4408a7[_0x2f07('0x56')]){case'unreadMessages':if(_0x4408a7['value']==0x1){_0xc3b506[_0x2f07('0x6f')]('`'+_0x4408a7['field']+'`\x20=\x200');}else{_0xc3b506['having']('`'+_0x4408a7['field']+_0x2f07('0x70'));}break;case'Contact':if(_0x4408a7[_0x2f07('0x71')]===_0x2f07('0x72')){if(_0x4408a7[_0x2f07('0x73')][_0x2f07('0x42')]('\x20')['length']>0x1){_0x43fa9b[_0x488dec](_0x2f07('0x74'),qs[_0x2f07('0x75')](_0x4408a7[_0x2f07('0x73')]),null);}else{var _0x3eb1ea='%'+_0x4408a7['value']+'%';_0x43fa9b[_0x488dec](_0x2f07('0x76'),_0x3eb1ea,_0x3eb1ea,_0x3eb1ea);}}else{_0x2b6ff8=_[_0x2f07('0x6e')](_0xcf8dd8,[_0x2f07('0x3d'),_0x2f07('0x77')]);_0x4408a7['field']=_0x2f07('0x77');_0x46f607=as[_0x2f07('0x78')](_0x3a750f,_0x2b6ff8[_0x2f07('0x48')],_0x4408a7);_0x43fa9b[_0x488dec](_0x46f607[_0x2f07('0x79')],_0x46f607['value'][_0x2f07('0x7a')],_0x46f607['value'][_0x2f07('0x31')]);}break;case _0x2f07('0x7b'):var _0x441de3=_0x4408a7[_0x2f07('0x73')]['split'](',')[_0x2f07('0x46')](function(_0x45d2f5){return Number(_0x45d2f5);});_0x441de3['forEach'](function(_0x19b13a){_0x2e017c['or'](_0x2f07('0x7c'),'%,'+_0x19b13a+',%');});_0x111096=_['union'](_0x111096,_0x441de3);break;case _0x2f07('0x7d'):if(_0x4408a7[_0x2f07('0x71')]===_0x2f07('0x72')){_0x43fa9b[_0x488dec]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x4408a7['value']+'%',null);}else{_0x2b6ff8=_[_0x2f07('0x6e')](_0xcf8dd8,[_0x2f07('0x3d'),'UserId']);_0x4408a7[_0x2f07('0x56')]=_0x2f07('0x7e');_0x46f607=as[_0x2f07('0x78')](_0x3a750f,_0x2b6ff8[_0x2f07('0x48')],_0x4408a7);_0x43fa9b[_0x488dec](_0x46f607[_0x2f07('0x79')],_0x46f607[_0x2f07('0x73')][_0x2f07('0x7a')],_0x46f607[_0x2f07('0x73')]['end']);}break;case'body':_0x46f607=as['buildExpression']('me',null,_0x4408a7);_0x43fa9b[_0x488dec](_0x46f607['text'],_0x46f607['value']['start'],_0x46f607['value'][_0x2f07('0x31')]);break;}}else{var _0x46f607=as[_0x2f07('0x78')](_0x3a750f,_0x2b6ff8[_0x2f07('0x48')],_0x4408a7);_0x43fa9b[_0x488dec](_0x46f607['text'],_0x46f607[_0x2f07('0x73')][_0x2f07('0x7a')],_0x46f607[_0x2f07('0x73')][_0x2f07('0x31')]);}}}else{var _0x5b68f9=_(_0x3db7ad[_0x2f07('0x4a')])[_0x2f07('0x4b')]()['map'](function(_0x5cbc28){return _['some'](_0xcf8dd8,['name',_0x5cbc28])?_0x5cbc28:undefined;})[_0x2f07('0x7f')]()[_0x2f07('0x73')]();if(!_[_0x2f07('0x80')](_0x5b68f9)){_0x5b68f9['forEach'](function(_0x250212){if(_0x250212===_0x2f07('0x81')){_0xc3b506[_0x2f07('0x54')](_0x2f07('0x82'),[][_0x2f07('0x83')](_0x3db7ad[_0x2f07('0x4a')][_0x250212]));}else if(_0x250212===_0x2f07('0x84')){var _0x2a5592=JSON['parse'](_0x3db7ad['query'][_0x250212])[_0x2f07('0x85')];var _0x1ab958=JSON[_0x2f07('0x86')](_0x3db7ad[_0x2f07('0x4a')][_0x250212])[_0x2f07('0x87')];_0xc3b506[_0x2f07('0x54')](_0x2f07('0x88'),_0x2a5592,_0x1ab958);}else{if(_0x3db7ad[_0x2f07('0x4a')][_0x250212]===_0x2f07('0x89')){_0xc3b506[_0x2f07('0x54')]('i.'+_0x250212+_0x2f07('0x8a'));}else{_0xc3b506['where']('i.'+_0x250212+_0x2f07('0x8b'),_0x3db7ad[_0x2f07('0x4a')][_0x250212]);}}});}if(_0x3db7ad[_0x2f07('0x4a')][_0x2f07('0x8c')]){if(_0x3db7ad[_0x2f07('0x4a')]['read']==0x1){_0xc3b506[_0x2f07('0x6f')](_0x2f07('0x8d'));}else{_0xc3b506[_0x2f07('0x6f')](_0x2f07('0x8e'));}}if(_0x3db7ad[_0x2f07('0x4a')][_0x2f07('0x8f')]){_0x111096=_['isArray'](_0x3db7ad[_0x2f07('0x4a')][_0x2f07('0x8f')])?_0x3db7ad['query'][_0x2f07('0x8f')]:new Array(_0x3db7ad[_0x2f07('0x4a')][_0x2f07('0x8f')]);_0x111096['forEach'](function(_0x3c364b){_0x2e017c['or'](_0x2f07('0x7c'),'%,'+_0x3c364b+',%');});}if(_0x3db7ad['query'][_0x2f07('0x90')]){var _0x4c182c=_0x3db7ad[_0x2f07('0x4a')][_0x2f07('0x90')][_0x2f07('0x91')]('\x5c','\x5c\x5c')[_0x2f07('0x91')]('\x27\x27',_0x2f07('0x92'));if(qs[_0x2f07('0x93')](_0x4c182c)){_0x43fa9b['or'](_0x2f07('0x94'),_0x4c182c+'%');}else{_0x43fa9b['or'](_0x2f07('0x95'),qs[_0x2f07('0x75')](_0x4c182c))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x4c182c+'%');}}}_0xc3b506[_0x2f07('0x54')](_0x43fa9b);_0xc3b506[_0x2f07('0x96')](_0x2f07('0x97'));var _0x31d31a={'type':db[_0x2f07('0x22')][_0x2f07('0x98')]['SELECT'],'raw':!![]};var _0x52d5c6=_0xc3b506[_0x2f07('0x99')]();_0x52d5c6[_0x2f07('0x56')](_0x2f07('0x97'));_0x52d5c6[_0x2f07('0x56')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x2f07('0x9a'));if(_0x4d5932['order']){_0x4d5932[_0x2f07('0x52')]['forEach'](function(_0x203070){_0xc3b506[_0x2f07('0x52')]('i.'+_0x203070[0x0],_0x203070[0x1]===_0x2f07('0x9b')?![]:!![]);});}if(!_[_0x2f07('0x80')](_0x111096)){_0xc3b506[_0x2f07('0x6f')](_0x2e017c);_0x52d5c6[_0x2f07('0x54')](_0x2f07('0x9c'),_0x111096);}BPromise[_0x2f07('0x9d')]()[_0x2f07('0x26')](function(){if(!_0x4fab7d){if(_0x3db7ad[_0x2f07('0x4a')]['ChatWebsiteId']||_0x3db7ad[_0x2f07('0x4a')]['journey'])return;_0x52d5c6[_0x2f07('0x54')](_0x2f07('0x9e'));_0xc3b506[_0x2f07('0x54')](_0x2f07('0x9e'));return;}return _0x3db7ad[_0x2f07('0x9f')]['getChatWebsites']({'attributes':['id'],'raw':!![]})[_0x2f07('0x26')](function(_0x2f2df3){if(_[_0x2f07('0x80')](_0x2f2df3)){_0x52d5c6['where']('i.ChatWebsiteId\x20IS\x20NULL');_0xc3b506['where']('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x52d5c6[_0x2f07('0x54')](_0x2f07('0x82'),_[_0x2f07('0x46')](_0x2f2df3,'id'));_0xc3b506['where'](_0x2f07('0x82'),_[_0x2f07('0x46')](_0x2f2df3,'id'));}});})[_0x2f07('0x26')](function(){db[_0x2f07('0xa0')][_0x2f07('0x4a')](_0x52d5c6[_0x2f07('0xa1')](),_0x31d31a)[_0x2f07('0x26')](function(_0x5f57ba){_0x2ed96d[_0x2f07('0x33')]=_0x5f57ba['length'];if(_0x2ed96d[_0x2f07('0x33')]===0x0)return[];return db[_0x2f07('0xa0')]['query'](_0x42ea53['toString'](),_0x31d31a)[_0x2f07('0x26')](function(_0x471c92){_0x21af60=_[_0x2f07('0xa2')](_0x471c92,'id');_0x31d31a=_[_0x2f07('0xa3')](_0x31d31a,{'model':db[_0x2f07('0xa4')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3db7ad[_0x2f07('0x4a')][_0x2f07('0x50')]){_0x4d5932['attributes'][_0x2f07('0x43')](function(_0x13f509){_0xc3b506['field']('i.'+_0x13f509);});}else{_0xc3b506['field'](_0x2f07('0xa5'),'unreadMessages');_0xc3b506['field'](_0x2f07('0xa6'),_0x2f07('0xa7'));_0xc3b506[_0x2f07('0x56')](_0x2f07('0xa8'),'Account.mandatoryDisposition');_0xc3b506[_0x2f07('0x56')](_0x2f07('0xa9'));_0xc3b506[_0x2f07('0x56')]('c.firstName',_0x2f07('0xaa'));_0xc3b506[_0x2f07('0x56')](_0x2f07('0xab'),'Contact.lastName');_0xc3b506['field'](_0x2f07('0xac'),_0x2f07('0xad'));_0xc3b506[_0x2f07('0x56')](_0x2f07('0xae'),_0x2f07('0xaf'));_0xc3b506[_0x2f07('0x56')](_0x2f07('0xb0'),_0x2f07('0xb1'));_0xc3b506[_0x2f07('0x56')](_0x2f07('0xb2'),_0x2f07('0xb3'));_0xc3b506[_0x2f07('0x56')]('o.fullname',_0x2f07('0xb4'));_0xc3b506[_0x2f07('0x56')](_0x2f07('0xb5'),_0x2f07('0xb6'));_0xc3b506[_0x2f07('0x56')](_0x2f07('0xb7'),_0x2f07('0x41'));}_0xc3b506['limit'](_0x4d5932[_0x2f07('0x35')]);_0xc3b506[_0x2f07('0x34')](_0x4d5932[_0x2f07('0x34')]);return db[_0x2f07('0xa0')][_0x2f07('0x4a')](_0xc3b506['toString'](),_0x31d31a);})[_0x2f07('0x26')](function(_0xe2382b){_0x23a8ee[_0x2f07('0x54')](_0x2f07('0xb8'),_[_0x2f07('0x46')](_0xe2382b,'id'));return db[_0x2f07('0xa0')][_0x2f07('0x4a')](_0x23a8ee['toString'](),_0x31d31a)[_0x2f07('0x26')](function(_0x2bb444){var _0x5260b0=_[_0x2f07('0xb9')](_0x2bb444,'ChatInteractionId');var _0x3331fb=[];_0xe2382b['forEach'](function(_0x3508cf){_0x3331fb[_0x2f07('0x44')](updateChatInteraction(_0x3508cf,_0x21af60,_0x5260b0));});return BPromise[_0x2f07('0xba')](_0x3331fb);});});})[_0x2f07('0x26')](function(_0x3b49a3){_0x2ed96d['rows']=_0x3b49a3;return _0x2ed96d;})[_0x2f07('0x26')](respondWithFilteredResult(_0xb6afe8,_0x4d5932));})[_0x2f07('0x2e')](handleError(_0xb6afe8,null));};exports[_0x2f07('0xbb')]=function(_0x15c918,_0x3416f8){var _0x386e50={'raw':![],'where':{'id':_0x15c918['params']['id']}},_0x2457ca={};_0x2457ca[_0x2f07('0x4e')]=_[_0x2f07('0x4b')](db[_0x2f07('0xa4')][_0x2f07('0xbc')]);_0x2457ca[_0x2f07('0x4a')]=_[_0x2f07('0x4b')](_0x15c918['query']);_0x2457ca[_0x2f07('0x4c')]=_[_0x2f07('0x4d')](_0x2457ca[_0x2f07('0x4e')],_0x2457ca[_0x2f07('0x4a')]);_0x386e50[_0x2f07('0x4f')]=_['intersection'](_0x2457ca[_0x2f07('0x4e')],qs['fields'](_0x15c918[_0x2f07('0x4a')][_0x2f07('0x50')]));_0x386e50['attributes']=_0x386e50[_0x2f07('0x4f')][_0x2f07('0x6d')]?_0x386e50['attributes']:_0x2457ca[_0x2f07('0x4e')];if(_0x15c918[_0x2f07('0x4a')]['includeAll']){_0x386e50[_0x2f07('0xbd')]=[{'all':!![]}];}_0x386e50=_[_0x2f07('0xa3')]({},_0x386e50,_0x15c918[_0x2f07('0xbe')]);return db[_0x2f07('0xa4')]['find'](_0x386e50)[_0x2f07('0x26')](handleEntityNotFound(_0x3416f8,null))['then'](respondWithResult(_0x3416f8,null))[_0x2f07('0x2e')](handleError(_0x3416f8,null));};exports[_0x2f07('0xbf')]=function(_0x468799,_0x540920){return db[_0x2f07('0xa4')][_0x2f07('0xbf')](_0x468799[_0x2f07('0xc0')],{})[_0x2f07('0x26')](respondWithResult(_0x540920,0xc9))['catch'](handleError(_0x540920,null));};exports[_0x2f07('0x3a')]=function(_0x4e9206,_0x1b4dfc){if(_0x4e9206['body']['id']){delete _0x4e9206[_0x2f07('0xc0')]['id'];}return db['ChatInteraction'][_0x2f07('0x6e')]({'where':{'id':_0x4e9206[_0x2f07('0xc1')]['id']}})[_0x2f07('0x26')](handleEntityNotFound(_0x1b4dfc,null))[_0x2f07('0x26')](saveUpdates(_0x4e9206['body'],null))[_0x2f07('0x26')](respondWithResult(_0x1b4dfc,null))[_0x2f07('0x2e')](handleError(_0x1b4dfc,null));};exports['destroy']=function(_0x47a864,_0x384a30){return db[_0x2f07('0xa4')][_0x2f07('0x6e')]({'where':{'id':_0x47a864[_0x2f07('0xc1')]['id']}})[_0x2f07('0x26')](handleEntityNotFound(_0x384a30,null))[_0x2f07('0x26')](removeEntity(_0x384a30,null))[_0x2f07('0x2e')](handleError(_0x384a30,null));};exports[_0x2f07('0xc2')]=function(_0xe5e7f4,_0x5a6650){return db[_0x2f07('0xa4')]['describe']()['then'](respondWithResult(_0x5a6650,null))['catch'](handleError(_0x5a6650,null));};exports['customUpdate']=function(_0x4b45d5,_0x41aa60){if(_0x4b45d5[_0x2f07('0xc0')]['id']){delete _0x4b45d5['body']['id'];}return db[_0x2f07('0xa4')][_0x2f07('0x6e')]({'where':{'id':_0x4b45d5[_0x2f07('0xc1')]['id']}})['then'](handleEntityNotFound(_0x41aa60,null))['then'](saveUpdates(_0x4b45d5[_0x2f07('0xc0')],null))[_0x2f07('0x26')](respondWithResult(_0x41aa60,null))[_0x2f07('0x2e')](handleError(_0x41aa60,null));};exports[_0x2f07('0xc3')]=function(_0x537c77,_0x3da09f,_0x5c2bc7){if(_0x537c77[_0x2f07('0xc0')]['id']){delete _0x537c77[_0x2f07('0xc0')]['id'];}return db['ChatInteraction'][_0x2f07('0x6e')]({'where':{'id':_0x537c77['params']['id']}})['then'](function(_0x2d73f6){if(!_0x2d73f6){logger[_0x2f07('0x2a')](_0x2f07('0xc4'),'abandon',0x194,_0x2f07('0xc5'));_0x3da09f[_0x2f07('0x2f')](0x194);}else{if(_0x2d73f6['UserId']){throw new db[(_0x2f07('0x22'))][(_0x2f07('0x23'))](_0x2f07('0xc6'));}}return _0x2d73f6;})['then'](function(_0x11216d){if(_0x11216d){return _0x11216d[_0x2f07('0x3a')]({'closed':_0x537c77[_0x2f07('0xc0')]['closed'],'disposition':_0x537c77[_0x2f07('0xc0')][_0x2f07('0xc7')]})[_0x2f07('0x26')](function(_0x35ba0e){return _0x35ba0e;});}})[_0x2f07('0x26')](function(_0x26d876){return respondWithRpcPromise(_0x2f07('0xc8'),_0x2f07('0xc3'),_0x537c77[_0x2f07('0xc0')],client9004);})[_0x2f07('0x26')](respondWithResult(_0x3da09f,null))[_0x2f07('0x2e')](handleError(_0x3da09f,null));};exports[_0x2f07('0xc9')]=function(_0xea6c54,_0x5993a5,_0x1dbf09){_0xea6c54[_0x2f07('0xc0')][_0x2f07('0x3d')]=_0xea6c54[_0x2f07('0xca')][_0x2f07('0xcb')];_0xea6c54[_0x2f07('0xc0')][_0x2f07('0xcc')]=_0xea6c54['file'][_0x2f07('0xcd')];_0xea6c54['body']['type']=_0xea6c54[_0x2f07('0xca')][_0x2f07('0xce')];return db[_0x2f07('0xcf')][_0x2f07('0xbf')](_0xea6c54[_0x2f07('0xc0')])[_0x2f07('0x26')](respondWithResult(_0x5993a5,0xc9))['catch'](handleError(_0x5993a5,null));};exports[_0x2f07('0xd0')]=function(_0x1840f2,_0x3246bf,_0x17a44d){return db[_0x2f07('0xa4')][_0x2f07('0xd1')]({'where':{'id':_0x1840f2[_0x2f07('0xc1')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x3246bf,null))[_0x2f07('0x26')](function(_0x550e55){if(_0x550e55){if(_0x550e55[_0x2f07('0xd2')]){return _0x3246bf['status'](0x193)[_0x2f07('0x32')]({'status':0x193,'message':_0x2f07('0xd3')});}return db[_0x2f07('0xcf')]['findOne']({'where':{'id':_0x1840f2[_0x2f07('0x4a')][_0x2f07('0xd4')]},'raw':!![]})['then'](handleEntityNotFound(_0x3246bf,null));}})[_0x2f07('0x26')](function(_0x4dbfd8){if(_0x4dbfd8){return _0x3246bf[_0x2f07('0xd5')](path[_0x2f07('0xd6')](config[_0x2f07('0xd7')],_0x2f07('0xd8'),_0x4dbfd8['basename']));}})[_0x2f07('0x2e')](handleError(_0x3246bf,null));};exports[_0x2f07('0xd9')]=function(_0x22b164,_0x3e9541){var _0x3d4966=null;var _0x59cc0a=null;var _0x33e65a=null;var _0x18c76e=null;if(_0x22b164[_0x2f07('0xc0')]['id']){delete _0x22b164[_0x2f07('0xc0')]['id'];}if(_0x22b164[_0x2f07('0xc0')][_0x2f07('0xda')]){_0x18c76e=path['join'](config['root'],_0x2f07('0xdb'),util[_0x2f07('0xdc')]('transcript-%s.txt',Date[_0x2f07('0xdd')]()));_0x22b164[_0x2f07('0xc0')][_0x2f07('0xde')]=_0x18c76e;}return db[_0x2f07('0xa4')][_0x2f07('0x6e')]({'where':{'id':_0x22b164[_0x2f07('0xc1')]['id']},'include':[{'model':db['ChatMessage'],'as':_0x2f07('0xdf'),'include':[{'model':db[_0x2f07('0x7d')],'as':_0x2f07('0x7d')}]}]})['then'](handleEntityNotFound(_0x3e9541,null))[_0x2f07('0x26')](saveUpdates(_0x22b164['body'],null))[_0x2f07('0x26')](function(_0x483371){if(_0x483371){_0x3d4966=_0x483371;return db[_0x2f07('0xe0')]['find']({'where':{'id':_0x3d4966[_0x2f07('0x81')]}});}})['then'](function(_0x36afe7){if(_0x36afe7){_0x33e65a=_0x36afe7;return db[_0x2f07('0xe1')]['find']({'where':{'id':_0x3d4966[_0x2f07('0x77')]}});}})['then'](function(_0x250d9c){if(_0x250d9c){_0x59cc0a=_0x250d9c;if(_0x18c76e){var _0x13cae3=null;for(var _0x58aade=0x1;_0x58aade<_0x3d4966['Messages']['length'];++_0x58aade){_0x13cae3=_0x3d4966['Messages'][_0x58aade];var _0x281411=_0x13cae3['UserId']?util['format']('%s%d',_0x33e65a[_0x2f07('0xe2')],_0x13cae3[_0x2f07('0x7e')]):'System';var _0x45c8ee=_0x22b164[_0x2f07('0xc0')][_0x2f07('0xe3')]||util[_0x2f07('0xdc')](_0x2f07('0xe4'),_0x2f07('0xe5'),_0x13cae3[_0x2f07('0x77')]);switch(_0x33e65a['agentIdentifier']){case'website_alias':_0x281411=_0x13cae3[_0x2f07('0x7e')]?util['format'](_0x2f07('0xe4'),_0x33e65a[_0x2f07('0xe2')],_0x13cae3[_0x2f07('0x7e')]):_0x2f07('0xe6');break;case'agent_alias':_0x281411=_0x13cae3[_0x2f07('0x7e')]?_0x13cae3['User'][_0x2f07('0xe7')]||_0x13cae3[_0x2f07('0x7d')][_0x2f07('0x3f')]:'System';break;case _0x2f07('0xe8'):_0x281411=_0x13cae3['UserId']?_0x13cae3[_0x2f07('0x7d')][_0x2f07('0x3f')]:_0x2f07('0xe6');break;default:_0x281411=_0x13cae3[_0x2f07('0x7e')]?util[_0x2f07('0xdc')](_0x2f07('0xe4'),_0x33e65a[_0x2f07('0xe2')],_0x13cae3['UserId']):_0x2f07('0xe6');}var _0x2c1f3a=util[_0x2f07('0xdc')](_0x2f07('0xe9'),moment(_0x13cae3[_0x2f07('0x84')])['format']('MM/DD/YYYY\x20HH:mm:ss'),_0x13cae3[_0x2f07('0xea')]==='in'?_0x45c8ee:_0x281411,_0x13cae3[_0x2f07('0xc0')]);if(!_0x13cae3[_0x2f07('0xeb')]){fs['appendFileSync'](_0x18c76e,_0x2c1f3a);}}return db['MailAccount'][_0x2f07('0xd1')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x2f07('0xec'),'raw':!![]}]});}}})[_0x2f07('0x26')](function(_0xd184ce){if(_0xd184ce&&_0xd184ce[_0x2f07('0xec')]&&_0x22b164['body']){var _0x21a67c={'tls':{'rejectUnauthorized':![]}};if(_0xd184ce[_0x2f07('0xec')][_0x2f07('0xed')]){_0x21a67c[_0x2f07('0xed')]=_0xd184ce['Smtp'][_0x2f07('0xed')];}else{_0x21a67c[_0x2f07('0xee')]=_0xd184ce[_0x2f07('0xec')][_0x2f07('0xee')];_0x21a67c[_0x2f07('0xef')]=_0xd184ce[_0x2f07('0xec')][_0x2f07('0xef')];_0x21a67c[_0x2f07('0xf0')]=_0xd184ce['Smtp'][_0x2f07('0xf0')];}if(_0xd184ce[_0x2f07('0xec')][_0x2f07('0xf1')]){_0x21a67c[_0x2f07('0xf2')]={'user':_0xd184ce['Smtp']['user'],'pass':_0xd184ce[_0x2f07('0xec')][_0x2f07('0xf3')]};}return respondWithRpcPromise('SendMail',_0x2f07('0xf4'),{'account':_0x21a67c,'message':{'from':util[_0x2f07('0xdc')](_0x2f07('0xf5'),_0xd184ce[_0x2f07('0x3d')],_0xd184ce[_0x2f07('0xf6')]||_0xd184ce[_0x2f07('0xec')][_0x2f07('0x9f')]),'to':_0x22b164[_0x2f07('0xc0')][_0x2f07('0xda')],'subject':'Mail\x20Transcript','text':util[_0x2f07('0xdc')](_0x2f07('0xf7'),_0x22b164[_0x2f07('0xc0')][_0x2f07('0xda')]),'attachments':[{'path':_0x18c76e}]}})[_0x2f07('0x26')](function(){return _0x3d4966;})['catch'](function(_0x1df272){console[_0x2f07('0x2a')](_0x1df272);});}else{return _0x3d4966;}})[_0x2f07('0x26')](respondWithStatusCode(_0x3e9541,0xc8))[_0x2f07('0x2e')](handleError(_0x3e9541,null));};exports[_0x2f07('0xf8')]=function(_0x503072,_0x1b25ab,_0x2ec246){return db[_0x2f07('0xf9')][_0x2f07('0x6e')]({'where':{'id':_0x503072[_0x2f07('0xc1')]['id']}})[_0x2f07('0x26')](handleEntityNotFound(_0x1b25ab,null))['then'](function(_0xf39df){if(_0xf39df){return _0xf39df[_0x2f07('0xf8')](_0x503072[_0x2f07('0xc0')]['ids'],_['omit'](_0x503072[_0x2f07('0xc0')],['ids','id'])||{});}})[_0x2f07('0x26')](respondWithResult(_0x1b25ab,null))['catch'](handleError(_0x1b25ab,null));};exports[_0x2f07('0xfa')]=function(_0x11a6ae,_0xbd4127,_0x4d9c52){var _0x12a880={'raw':![],'where':{}};var _0x220b97={};var _0x594172={'count':0x0,'rows':[]};return db[_0x2f07('0xa4')][_0x2f07('0xd1')]({'where':{'id':_0x11a6ae['params']['id']}})['then'](handleEntityNotFound(_0xbd4127,null))['then'](function(_0xf918c5){if(_0xf918c5){_0x220b97['model']=_[_0x2f07('0x4b')](db['ChatMessage'][_0x2f07('0xbc')]);_0x220b97[_0x2f07('0x4a')]=_[_0x2f07('0x4b')](_0x11a6ae['query']);_0x220b97[_0x2f07('0x4c')]=_[_0x2f07('0x4d')](_0x220b97[_0x2f07('0x4e')],_0x220b97['query']);_0x12a880[_0x2f07('0x4f')]=_['intersection'](_0x220b97[_0x2f07('0x4e')],qs[_0x2f07('0x50')](_0x11a6ae[_0x2f07('0x4a')][_0x2f07('0x50')]));_0x12a880[_0x2f07('0x4f')]=_0x12a880[_0x2f07('0x4f')][_0x2f07('0x6d')]?_0x12a880[_0x2f07('0x4f')]:_0x220b97[_0x2f07('0x4e')];if(!_0x11a6ae[_0x2f07('0x4a')][_0x2f07('0xfb')]('nolimit')){_0x12a880[_0x2f07('0x35')]=qs['limit'](_0x11a6ae[_0x2f07('0x4a')][_0x2f07('0x35')]);_0x12a880[_0x2f07('0x34')]=qs[_0x2f07('0x34')](_0x11a6ae[_0x2f07('0x4a')]['offset']);}_0x12a880['order']=qs[_0x2f07('0x53')](_0x11a6ae[_0x2f07('0x4a')]['sort']);_0x12a880['where']=qs[_0x2f07('0x4c')](_[_0x2f07('0x55')](_0x11a6ae[_0x2f07('0x4a')],_0x220b97['filters']));_0x12a880[_0x2f07('0x54')][_0x2f07('0xfc')]=_0xf918c5['id'];if(_0x11a6ae[_0x2f07('0x4a')][_0x2f07('0x90')]){_0x12a880[_0x2f07('0x54')]=_[_0x2f07('0xa3')](_0x12a880[_0x2f07('0x54')],{'$or':_[_0x2f07('0x46')](_0x12a880[_0x2f07('0x4f')],function(_0x4c169b){var _0x2400c8={};_0x2400c8[_0x4c169b]={'$like':'%'+_0x11a6ae[_0x2f07('0x4a')][_0x2f07('0x90')]+'%'};return _0x2400c8;})});}if(_0x11a6ae[_0x2f07('0x4a')][_0x2f07('0x85')]){var _0x131d0a=_0x11a6ae[_0x2f07('0x4a')][_0x2f07('0x85')]['split'](',');var _0x156c0b={};_0x156c0b[_0x131d0a[0x0]]={'$gte':moment(_0x131d0a[0x1])[_0x2f07('0xdc')](_0x2f07('0xfd'))};_0x12a880[_0x2f07('0x54')]=_[_0x2f07('0xa3')](_0x12a880[_0x2f07('0x54')],_0x156c0b);}_0x12a880=_['merge']({},_0x12a880,_0x11a6ae[_0x2f07('0xbe')]);return db[_0x2f07('0xf9')][_0x2f07('0x33')]({'where':_0x12a880[_0x2f07('0x54')]})[_0x2f07('0x26')](function(_0x37c1d7){_0x594172[_0x2f07('0x33')]=_0x37c1d7;if(_0x11a6ae[_0x2f07('0x4a')][_0x2f07('0xfe')]){_0x12a880[_0x2f07('0xbd')]=[{'all':!![]}];}return db[_0x2f07('0xf9')][_0x2f07('0xff')](_0x12a880);})[_0x2f07('0x26')](function(_0x3b2f8d){_0x594172['rows']=_0x3b2f8d;return _0x594172;});}})[_0x2f07('0x26')](respondWithFilteredResult(_0xbd4127,_0x12a880))[_0x2f07('0x2e')](handleError(_0xbd4127,null));};exports[_0x2f07('0x100')]=function(_0x406232,_0xf900dd,_0x185316){var _0x43f02a={'where':{}},_0x1d273b={},_0x2b432c={'count':0x0,'rows':[]};return db[_0x2f07('0xa4')]['findOne']({'where':{'id':_0x406232[_0x2f07('0xc1')]['id']}})[_0x2f07('0x26')](handleEntityNotFound(_0xf900dd,null))['then'](function(_0x1e1dd3){if(_0x1e1dd3){_0x1d273b[_0x2f07('0x4e')]=_[_0x2f07('0x4b')](db[_0x2f07('0xf9')][_0x2f07('0xbc')]);_0x1d273b[_0x2f07('0x4a')]=_[_0x2f07('0x4b')](_0x406232[_0x2f07('0x4a')]);_0x1d273b[_0x2f07('0x4c')]=_[_0x2f07('0x4d')](_0x1d273b['model'],_0x1d273b[_0x2f07('0x4a')]);_0x43f02a[_0x2f07('0x4f')]=_[_0x2f07('0x4d')](_0x1d273b[_0x2f07('0x4e')],qs[_0x2f07('0x50')](_0x406232[_0x2f07('0x4a')][_0x2f07('0x50')]));_0x43f02a[_0x2f07('0x4f')]=_0x43f02a[_0x2f07('0x4f')][_0x2f07('0x6d')]?_0x43f02a[_0x2f07('0x4f')]:_0x1d273b['model'];if(!_0x406232[_0x2f07('0x4a')][_0x2f07('0xfb')](_0x2f07('0x51'))){_0x43f02a[_0x2f07('0x35')]=qs[_0x2f07('0x35')](_0x406232[_0x2f07('0x4a')][_0x2f07('0x35')]);_0x43f02a[_0x2f07('0x34')]=qs['offset'](_0x406232[_0x2f07('0x4a')][_0x2f07('0x34')]);}_0x43f02a['order']=qs[_0x2f07('0x53')](_0x406232[_0x2f07('0x4a')][_0x2f07('0x53')]);_0x43f02a[_0x2f07('0x54')]=qs[_0x2f07('0x4c')](_[_0x2f07('0x55')](_0x406232[_0x2f07('0x4a')],_0x1d273b[_0x2f07('0x4c')]));_0x43f02a[_0x2f07('0x54')][_0x2f07('0xfc')]=_0x1e1dd3['id'];if(_0x406232['query'][_0x2f07('0x90')]){_0x43f02a[_0x2f07('0x54')]=_[_0x2f07('0xa3')](_0x43f02a[_0x2f07('0x54')],{'$or':_['map'](_0x43f02a[_0x2f07('0x4f')],function(_0xd987f1){var _0x1f786e={};_0x1f786e[_0xd987f1]={'$like':'%'+_0x406232[_0x2f07('0x4a')][_0x2f07('0x90')]+'%'};return _0x1f786e;})});}_0x43f02a[_0x2f07('0x54')][_0x2f07('0xeb')]=![];if(_0x406232[_0x2f07('0x4a')]['id']){_0x43f02a['where']['id']={'$gt':_0x406232['query']['id']};}_0x43f02a=_[_0x2f07('0xa3')]({},_0x43f02a,_0x406232[_0x2f07('0xbe')]);return db[_0x2f07('0xf9')][_0x2f07('0x33')]({'where':_0x43f02a[_0x2f07('0x54')]})[_0x2f07('0x26')](function(_0x34391e){_0x2b432c['count']=_0x34391e;_0x43f02a[_0x2f07('0xbd')]=[];if(_0x406232[_0x2f07('0x4a')]['includeAgent']){_0x43f02a['include']['push']({'model':db[_0x2f07('0x7d')],'as':_0x2f07('0x7d'),'attributes':['id',_0x2f07('0x3f'),_0x2f07('0xe7')]});}if(_0x406232[_0x2f07('0x4a')][_0x2f07('0xfe')]){_0x43f02a[_0x2f07('0xbd')]=[{'all':!![]}];}return db['ChatMessage'][_0x2f07('0xff')](_0x43f02a);})['then'](function(_0x2bf947){_0x2b432c[_0x2f07('0x101')]=_0x2bf947;return _0x2b432c;});}})[_0x2f07('0x26')](respondWithFilteredResult(_0xf900dd,_0x43f02a))[_0x2f07('0x2e')](handleError(_0xf900dd,null));};exports[_0x2f07('0x102')]=function(_0x1697b8,_0x2309a2,_0x13ff19){return db['ChatInteraction']['find']({'where':{'id':_0x1697b8['params']['id']}})[_0x2f07('0x26')](handleEntityNotFound(_0x2309a2,null))[_0x2f07('0x26')](function(_0x566027){if(_0x566027){return _0x566027[_0x2f07('0x103')](_0x1697b8[_0x2f07('0xc0')][_0x2f07('0x104')],_[_0x2f07('0x105')](_0x1697b8[_0x2f07('0xc0')],['ids','id'])||{})[_0x2f07('0x106')](function(){return db[_0x2f07('0x7b')][_0x2f07('0xff')]({'attributes':['id','name',_0x2f07('0x57')],'where':{'id':_0x1697b8['body'][_0x2f07('0x104')]}});})['then'](function(_0x395a27){socket[_0x2f07('0x107')](_0x2f07('0x108'),{'id':Number(_0x1697b8[_0x2f07('0xc1')]['id']),'tags':_0x395a27||[]});return{'id':Number(_0x1697b8[_0x2f07('0xc1')]['id']),'tags':_0x395a27||[]};});}})[_0x2f07('0x26')](respondWithResult(_0x2309a2,null))[_0x2f07('0x2e')](handleError(_0x2309a2,null));};exports['removeTags']=function(_0x2d53b4,_0x3c97d4,_0x487cf2){return db[_0x2f07('0xa4')][_0x2f07('0x6e')]({'where':{'id':_0x2d53b4[_0x2f07('0xc1')]['id']}})[_0x2f07('0x26')](handleEntityNotFound(_0x3c97d4,null))['then'](function(_0x3a1897){if(_0x3a1897){return _0x3a1897[_0x2f07('0x109')](_0x2d53b4['query'][_0x2f07('0x104')]);}})[_0x2f07('0x26')](respondWithStatusCode(_0x3c97d4,null))[_0x2f07('0x2e')](handleError(_0x3c97d4,null));};exports[_0x2f07('0xd5')]=function(_0x3391a2,_0x305013){var _0xf31736=moment()[_0x2f07('0x10a')]()[_0x2f07('0xa1')]();var _0x2ce48a=path[_0x2f07('0xd6')](config[_0x2f07('0xd7')],_0x2f07('0x10b'),_0x2f07('0x10c'),_0x2f07('0x10d'));var _0x4146f6=path['join'](config[_0x2f07('0xd7')],_0x2f07('0x10b'),_0x2f07('0x10c'),_0x2f07('0x10e'));var _0x4f0125=path[_0x2f07('0xd6')](_0x2ce48a,_0xf31736);var _0xb859=util[_0x2f07('0xdc')]('transcript-%d-%s.zip',_0x3391a2['params']['id'],_0xf31736);var _0x5a866b=path[_0x2f07('0xd6')](_0x2ce48a,_0xb859);var _0x58ddb6=[];_0x58ddb6[_0x2f07('0x44')]({'model':db[_0x2f07('0x7d')],'as':_0x2f07('0x7d'),'attributes':['id',_0x2f07('0x3f')],'raw':!![]});_0x58ddb6[_0x2f07('0x44')]({'model':db[_0x2f07('0xe1')],'as':_0x2f07('0x10f'),'attributes':['id',_0x2f07('0x110'),'lastName'],'raw':!![]});if(_0x3391a2[_0x2f07('0x4a')][_0x2f07('0x10e')]){_0x58ddb6[_0x2f07('0x44')]({'model':db[_0x2f07('0xcf')],'as':'Attachment','raw':!![]});}var _0x2adc3f=[{'model':db['ChatMessage'],'as':'Messages','attributes':['id',_0x2f07('0xc0'),_0x2f07('0x84'),_0x2f07('0xea'),_0x2f07('0xeb'),_0x2f07('0x8c')],'include':_0x58ddb6}];_0x2adc3f[_0x2f07('0x44')]({'model':db[_0x2f07('0xe0')],'as':_0x2f07('0x111'),'attributes':['id',_0x2f07('0x3d')]});_0x2adc3f[_0x2f07('0x44')]({'model':db[_0x2f07('0x7d')],'as':'Owner','attributes':['id','fullname']});return db[_0x2f07('0xa4')]['find']({'where':{'id':_0x3391a2[_0x2f07('0xc1')]['id']},'include':_0x2adc3f})[_0x2f07('0x26')](handleEntityNotFound(_0x305013,null))['then'](function(_0x228b9e){if(_0x228b9e){var _0x16ba1d=_0x228b9e[_0x2f07('0x112')]({'plain':!![]});fs['mkdirSync'](_0x4f0125);var _0x19f66d={'format':'A4','border':_0x2f07('0x113'),'header':{'height':_0x2f07('0x114'),'contents':{'first':_0x2f07('0x115')}},'footer':{'height':_0x2f07('0x116'),'contents':{'default':util[_0x2f07('0xdc')](_0x2f07('0x117'),util['format'](_0x2f07('0x118'),_0x2f07('0x119'),_0x16ba1d['id']),moment()[_0x2f07('0xdc')](_0x2f07('0x11a'))[_0x2f07('0xa1')]())}}};var _0xcad610={'channel':_0x2f07('0x119'),'account':_0x16ba1d[_0x2f07('0x111')][_0x2f07('0x3d')],'agent':_0x16ba1d['Owner']?_0x16ba1d[_0x2f07('0x11b')][_0x2f07('0x3f')]:'N.A.','createdAt':moment(_0x16ba1d[_0x2f07('0x84')])['format'](_0x2f07('0xfd'))[_0x2f07('0xa1')](),'closedAt':_0x16ba1d['closed']?moment(_0x16ba1d['closedAt'])[_0x2f07('0xdc')](_0x2f07('0xfd'))[_0x2f07('0xa1')]():'','disposition':_0x16ba1d[_0x2f07('0xc7')],'chatInfo':{'browser':_0x16ba1d['browserName'],'os':_0x16ba1d[_0x2f07('0x11c')],'referer':_0x16ba1d[_0x2f07('0x11d')],'customerIp':_0x16ba1d[_0x2f07('0x11e')],'customerPort':_0x16ba1d[_0x2f07('0x11f')]?_0x16ba1d[_0x2f07('0x11f')]:_0x2f07('0x120')},'messages':_(_0x16ba1d[_0x2f07('0xdf')])[_0x2f07('0x121')]()[_0x2f07('0x90')]({'secret':![]})[_0x2f07('0x46')](function(_0x2d6cb3){if(_0x2d6cb3[_0x2f07('0xcf')]){var _0x11ab13=path[_0x2f07('0xd6')](_0x4146f6,_0x2d6cb3[_0x2f07('0xcf')][_0x2f07('0xcc')]);if(fs[_0x2f07('0x122')](_0x11ab13)){fs[_0x2f07('0x123')](_0x11ab13)[_0x2f07('0x124')](fs[_0x2f07('0x125')](path[_0x2f07('0xd6')](_0x4f0125,_0x2d6cb3['Attachment'][_0x2f07('0xcc')])));}}return{'date':moment(_0x2d6cb3['createdAt'])[_0x2f07('0xdc')](_0x2f07('0xfd'))['toString'](),'sender':_0x2d6cb3[_0x2f07('0xea')]===_0x2f07('0x126')?_0x2d6cb3[_0x2f07('0x7d')]?_0x2d6cb3[_0x2f07('0x7d')][_0x2f07('0x3f')]:_0x2f07('0xe6'):_0x2d6cb3[_0x2f07('0x10f')][_0x2f07('0x110')]+(_0x2d6cb3[_0x2f07('0x10f')][_0x2f07('0x127')]?'\x20'+_0x2d6cb3[_0x2f07('0x10f')][_0x2f07('0x127')]:''),'body':_0x2d6cb3[_0x2f07('0xcf')]?_0x2d6cb3['Attachment'][_0x2f07('0xcc')]:_0x2d6cb3[_0x2f07('0xc0')],'direction':_0x2d6cb3['direction']===_0x2f07('0x126')?'A':'C','secret':_0x2d6cb3[_0x2f07('0xeb')],'read':_0x2d6cb3[_0x2f07('0x8c')],'attachment':_0x2d6cb3[_0x2f07('0xcf')]};})['value']()};return ejs['renderFile'](path[_0x2f07('0xd6')](config[_0x2f07('0xd7')],_0x2f07('0x10b'),_0x2f07('0x128'),_0x2f07('0x129')),{'interaction':_0xcad610})[_0x2f07('0x26')](function(_0x1f85da){return new BPromise(function(_0x109fb1,_0x32b733){pdf[_0x2f07('0xbf')](_0x1f85da,_0x19f66d)[_0x2f07('0x12a')](path['join'](_0x4f0125,_0x2f07('0x12b')+_0x16ba1d['id']+'-'+_0xf31736+'.pdf'),function(_0x1271dc,_0x4b70b4){if(_0x1271dc)return _0x32b733(_0x1271dc);_0x109fb1(_0x4b70b4);});});})[_0x2f07('0x26')](function(){return new BPromise(function(_0x1b38cb,_0x545821){zipdir(_0x4f0125,{'saveTo':_0x5a866b},function(_0x13d85d,_0x1d218e){if(_0x13d85d)return _0x545821(_0x13d85d);return _0x1b38cb(_0x1d218e);});})[_0x2f07('0x26')](function(){return new BPromise(function(_0x427de8,_0x5a6661){rimraf(_0x4f0125,function(_0x105c4f){if(_0x105c4f)_0x5a6661(_0x105c4f);return _0x427de8();});});})[_0x2f07('0x26')](function(){return _0x305013[_0x2f07('0xd5')](_0x5a866b,_0xb859,function(_0x3958f3){if(_0x3958f3){console[_0x2f07('0x12c')]('err',_0x3958f3);}else{fs[_0x2f07('0x12d')](_0x5a866b);}});});});}else{return _0x305013['sendStatus'](0xc8);}})[_0x2f07('0x2e')](handleError(_0x305013,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index f728605..c0f2ca3 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 _0x6691=['save','update','remove','getUsers','then','map','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x6691,0x12d));var _0x1669=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x6691[_0x6c993a];return _0x27f547;};'use strict';var EventEmitter=require(_0x1669('0x0'));var ChatInteraction=require(_0x1669('0x1'))['db'][_0x1669('0x2')];var ChatMessage=require(_0x1669('0x1'))['db'][_0x1669('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x1669('0x4')](0x0);var events={'afterCreate':_0x1669('0x5'),'afterUpdate':_0x1669('0x6'),'afterDestroy':_0x1669('0x7')};function emitEvent(_0x2ad807){return function(_0x4b41a5,_0x2a81ab,_0x1bf2c8){_0x4b41a5[_0x1669('0x8')]({'attributes':['id'],'raw':!![]})[_0x1669('0x9')](function(_0x55393c){_0x4b41a5['setDataValue']('Users',_0x55393c[_0x1669('0xa')](function(_0x562fe9){return{'id':_0x562fe9['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x4b41a5['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x56e0ee){_0x4b41a5['setDataValue'](_0x1669('0xb'),_0x56e0ee[_0x1669('0xc')]);ChatInteractionEvents[_0x1669('0xd')](_0x2ad807+':'+_0x4b41a5['id'],_0x4b41a5);ChatInteractionEvents[_0x1669('0xd')](_0x2ad807,_0x4b41a5);_0x1bf2c8(null);})[_0x1669('0xe')](_0x1bf2c8(null));};}for(var e in events){if(events[_0x1669('0xf')](e)){var event=events[e];ChatInteraction[_0x1669('0x10')](e,emitEvent(event));}}module[_0x1669('0x11')]=ChatInteractionEvents; \ No newline at end of file +var _0xf130=['../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','then','setDataValue','map','findAll','emit','catch','hasOwnProperty','hook','events'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xf130,0x149));var _0x0f13=function(_0x1fa9b9,_0x180483){_0x1fa9b9=_0x1fa9b9-0x0;var _0x336e80=_0xf130[_0x1fa9b9];return _0x336e80;};'use strict';var EventEmitter=require(_0x0f13('0x0'));var ChatInteraction=require(_0x0f13('0x1'))['db'][_0x0f13('0x2')];var ChatMessage=require(_0x0f13('0x1'))['db'][_0x0f13('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x0f13('0x4')](0x0);var events={'afterCreate':_0x0f13('0x5'),'afterUpdate':_0x0f13('0x6'),'afterDestroy':'remove'};function emitEvent(_0x1313c4){return function(_0x1f9807,_0x251ba0,_0x352816){_0x1f9807['getUsers']({'attributes':['id'],'raw':!![]})[_0x0f13('0x7')](function(_0x4d637f){_0x1f9807[_0x0f13('0x8')]('Users',_0x4d637f[_0x0f13('0x9')](function(_0x41ebe8){return{'id':_0x41ebe8['id']};}));return ChatMessage[_0x0f13('0xa')]({'where':{'ChatInteractionId':_0x1f9807['id'],'direction':'in','read':![]},'raw':!![]});})[_0x0f13('0x7')](function(_0x1d574c){_0x1f9807[_0x0f13('0x8')]('unreadMessages',_0x1d574c['length']);ChatInteractionEvents[_0x0f13('0xb')](_0x1313c4+':'+_0x1f9807['id'],_0x1f9807);ChatInteractionEvents['emit'](_0x1313c4,_0x1f9807);_0x352816(null);})[_0x0f13('0xc')](_0x352816(null));};}for(var e in events){if(events[_0x0f13('0xd')](e)){var event=events[e];ChatInteraction[_0x0f13('0xe')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index 0b019ca..1746970 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 _0xdb5f=['./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x1978f3,_0x387a40){var _0x25f0ce=function(_0x3ca20a){while(--_0x3ca20a){_0x1978f3['push'](_0x1978f3['shift']());}};_0x25f0ce(++_0x387a40);}(_0xdb5f,0x1e5));var _0xfdb5=function(_0x23f19e,_0x4d583b){_0x23f19e=_0x23f19e-0x0;var _0x2a95d4=_0xdb5f[_0x23f19e];return _0x2a95d4;};'use strict';var _=require(_0xfdb5('0x0'));var util=require(_0xfdb5('0x1'));var logger=require(_0xfdb5('0x2'))(_0xfdb5('0x3'));var moment=require(_0xfdb5('0x4'));var BPromise=require(_0xfdb5('0x5'));var rp=require(_0xfdb5('0x6'));var fs=require('fs');var path=require(_0xfdb5('0x7'));var rimraf=require('rimraf');var config=require(_0xfdb5('0x8'));var attributes=require(_0xfdb5('0x9'));module[_0xfdb5('0xa')]=function(_0x2263fc,_0xb2d603){return _0x2263fc[_0xfdb5('0xb')](_0xfdb5('0xc'),attributes,{'tableName':_0xfdb5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x42c972,_0x5ca781,_0x1eb1e0){if(_0x42c972[_0xfdb5('0xe')](_0xfdb5('0xf'))){_0x42c972['closedAt']=moment()[_0xfdb5('0x10')](_0xfdb5('0x11'));}_0x1eb1e0(null,_0x42c972);}},'charset':_0xfdb5('0x12'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x0776=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','ChatInteraction','chat_interactions','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','util'];(function(_0x2212d1,_0x483fc8){var _0x15eec5=function(_0x15e6ac){while(--_0x15e6ac){_0x2212d1['push'](_0x2212d1['shift']());}};_0x15eec5(++_0x483fc8);}(_0x0776,0xba));var _0x6077=function(_0x491470,_0x5db278){_0x491470=_0x491470-0x0;var _0x16c6e7=_0x0776[_0x491470];return _0x16c6e7;};'use strict';var _=require('lodash');var util=require(_0x6077('0x0'));var logger=require(_0x6077('0x1'))(_0x6077('0x2'));var moment=require(_0x6077('0x3'));var BPromise=require(_0x6077('0x4'));var rp=require(_0x6077('0x5'));var fs=require('fs');var path=require(_0x6077('0x6'));var rimraf=require(_0x6077('0x7'));var config=require(_0x6077('0x8'));var attributes=require('./chatInteraction.attributes');module['exports']=function(_0x14a537,_0x4b166d){return _0x14a537[_0x6077('0x9')](_0x6077('0xa'),attributes,{'tableName':_0x6077('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xf84c46,_0xb64f01,_0xb39e74){if(_0xf84c46['changed'](_0x6077('0xc'))){_0xf84c46[_0x6077('0xd')]=moment()['format'](_0x6077('0xe'));}_0xb39e74(null,_0xf84c46);}},'charset':_0x6077('0xf'),'collate':_0x6077('0x10')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 3921e16..1caccac 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 _0x757b=['code','message','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','attributes','catch','AddTagsToChatInteraction','find','then','addTags','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x757b,0x15a));var _0xb757=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x757b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb757('0x0'));var util=require(_0xb757('0x1'));var moment=require(_0xb757('0x2'));var BPromise=require(_0xb757('0x3'));var rs=require(_0xb757('0x4'));var fs=require('fs');var Redis=require(_0xb757('0x5'));var db=require(_0xb757('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb757('0x7'));var config=require('../../config/environment');var jayson=require(_0xb757('0x8'));var client=jayson['client'][_0xb757('0x9')]({'port':0x232a});config[_0xb757('0xa')]=_[_0xb757('0xb')](config['redis'],{'host':_0xb757('0xc'),'port':0x18eb});var socket=require(_0xb757('0xd'))(new Redis(config['redis']));require('./chatInteraction.socket')[_0xb757('0xe')](socket);function respondWithRpcPromise(_0x730ab2,_0x5809dd,_0x490f05){return new BPromise(function(_0x367606,_0x36abfe){return client[_0xb757('0xf')](_0x730ab2,_0x490f05)['then'](function(_0x3467d7){logger[_0xb757('0x10')](_0xb757('0x11'),_0x5809dd,_0xb757('0x12'));logger[_0xb757('0x13')](_0xb757('0x14'),_0x5809dd,_0xb757('0x12'),JSON[_0xb757('0x15')](_0x3467d7));if(_0x3467d7[_0xb757('0x16')]){if(_0x3467d7[_0xb757('0x16')][_0xb757('0x17')]===0x1f4){logger[_0xb757('0x16')](_0xb757('0x11'),_0x5809dd,_0x3467d7[_0xb757('0x16')][_0xb757('0x18')]);return _0x36abfe(_0x3467d7[_0xb757('0x16')][_0xb757('0x18')]);}logger[_0xb757('0x16')](_0xb757('0x11'),_0x5809dd,_0x3467d7[_0xb757('0x16')][_0xb757('0x18')]);return _0x367606(_0x3467d7['error'][_0xb757('0x18')]);}else{logger[_0xb757('0x10')](_0xb757('0x11'),_0x5809dd,_0xb757('0x12'));_0x367606(_0x3467d7['result'][_0xb757('0x18')]);}})['catch'](function(_0x1c834b){logger[_0xb757('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x5809dd,_0x1c834b);_0x36abfe(_0x1c834b);});});}exports[_0xb757('0x19')]=function(_0x18ee12){var _0x21ae0d=this;return new Promise(function(_0x1b9bb9,_0x2c0e74){return db[_0xb757('0x1a')][_0xb757('0x1b')](_0x18ee12[_0xb757('0x1c')],{'raw':_0x18ee12[_0xb757('0x1d')]?_0x18ee12[_0xb757('0x1d')][_0xb757('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x18ee12[_0xb757('0x1d')]?_0x18ee12[_0xb757('0x1d')][_0xb757('0x1f')]||null:null,'attributes':_0x18ee12['options']?_0x18ee12['options'][_0xb757('0x20')]||null:null,'limit':_0x18ee12['options']?_0x18ee12[_0xb757('0x1d')]['limit']||null:null})['then'](function(_0x5ec059){logger['info'](_0xb757('0x19'),_0x18ee12);logger[_0xb757('0x13')](_0xb757('0x19'),_0x18ee12,JSON[_0xb757('0x15')](_0x5ec059));_0x1b9bb9(_0x5ec059);})[_0xb757('0x21')](function(_0x41cdc3){logger[_0xb757('0x16')](_0xb757('0x19'),_0x41cdc3[_0xb757('0x18')],_0x18ee12);_0x2c0e74(_0x21ae0d[_0xb757('0x16')](0x1f4,_0x41cdc3[_0xb757('0x18')]));});});};exports[_0xb757('0x22')]=function(_0x4d706d){return new Promise(function(_0x17738a,_0x1c4370){return db[_0xb757('0x1a')][_0xb757('0x23')]({'where':_0x4d706d[_0xb757('0x1d')]?_0x4d706d[_0xb757('0x1d')][_0xb757('0x1f')]||null:null})[_0xb757('0x24')](function(_0x5e9ca7){if(_0x5e9ca7){return _0x5e9ca7[_0xb757('0x25')](_0x4d706d[_0xb757('0x1c')][_0xb757('0x26')],_['omit'](_0x4d706d[_0xb757('0x1c')],[_0xb757('0x26'),'id'])||{});}})[_0xb757('0x27')](function(_0x1eee7e){logger['info'](_0xb757('0x28'),_0x4d706d);logger[_0xb757('0x13')]('AddTags',_0x4d706d,JSON[_0xb757('0x15')](_0x1eee7e));_0x17738a(_0x1eee7e);})[_0xb757('0x21')](function(_0x582f1b){logger['error'](_0xb757('0x28'),_0x582f1b[_0xb757('0x18')],_0x4d706d);_0x1c4370(_this[_0xb757('0x16')](0x1f4,_0x582f1b['message']));});});}; \ No newline at end of file +var _0xba81=['util','moment','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','redis','defaults','localhost','./chatInteraction.socket','request','info','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','limit','then','AddTagsToChatInteraction','find','ids','omit','AddTags','lodash'];(function(_0x1146f7,_0x475356){var _0x2e5725=function(_0x44f2a2){while(--_0x44f2a2){_0x1146f7['push'](_0x1146f7['shift']());}};_0x2e5725(++_0x475356);}(_0xba81,0x71));var _0x1ba8=function(_0x65eae,_0x32dc5f){_0x65eae=_0x65eae-0x0;var _0x18e82b=_0xba81[_0x65eae];return _0x18e82b;};'use strict';var _=require(_0x1ba8('0x0'));var util=require(_0x1ba8('0x1'));var moment=require(_0x1ba8('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1ba8('0x3'));var db=require(_0x1ba8('0x4'))['db'];var utils=require(_0x1ba8('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x1ba8('0x6'));var client=jayson[_0x1ba8('0x7')][_0x1ba8('0x8')]({'port':0x232a});config[_0x1ba8('0x9')]=_[_0x1ba8('0xa')](config[_0x1ba8('0x9')],{'host':_0x1ba8('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1ba8('0x9')]));require(_0x1ba8('0xc'))['register'](socket);function respondWithRpcPromise(_0x2a2e24,_0x2a4bab,_0x5389b7){return new BPromise(function(_0x226243,_0x244c0a){return client[_0x1ba8('0xd')](_0x2a2e24,_0x5389b7)['then'](function(_0x2d9c82){logger[_0x1ba8('0xe')]('ChatInteraction,\x20%s,\x20%s',_0x2a4bab,'request\x20sent');logger[_0x1ba8('0xf')](_0x1ba8('0x10'),_0x2a4bab,_0x1ba8('0x11'),JSON[_0x1ba8('0x12')](_0x2d9c82));if(_0x2d9c82['error']){if(_0x2d9c82[_0x1ba8('0x13')][_0x1ba8('0x14')]===0x1f4){logger['error'](_0x1ba8('0x15'),_0x2a4bab,_0x2d9c82['error']['message']);return _0x244c0a(_0x2d9c82[_0x1ba8('0x13')][_0x1ba8('0x16')]);}logger[_0x1ba8('0x13')]('ChatInteraction,\x20%s,\x20%s',_0x2a4bab,_0x2d9c82[_0x1ba8('0x13')][_0x1ba8('0x16')]);return _0x226243(_0x2d9c82[_0x1ba8('0x13')][_0x1ba8('0x16')]);}else{logger[_0x1ba8('0xe')](_0x1ba8('0x15'),_0x2a4bab,_0x1ba8('0x11'));_0x226243(_0x2d9c82['result'][_0x1ba8('0x16')]);}})[_0x1ba8('0x17')](function(_0x4f1208){logger[_0x1ba8('0x13')]('ChatInteraction,\x20%s,\x20%s',_0x2a4bab,_0x4f1208);_0x244c0a(_0x4f1208);});});}exports[_0x1ba8('0x18')]=function(_0x45bc49){var _0x40cc5c=this;return new Promise(function(_0x13e905,_0x23e70f){return db[_0x1ba8('0x19')][_0x1ba8('0x1a')](_0x45bc49[_0x1ba8('0x1b')],{'raw':_0x45bc49[_0x1ba8('0x1c')]?_0x45bc49[_0x1ba8('0x1c')][_0x1ba8('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x45bc49[_0x1ba8('0x1c')]?_0x45bc49['options'][_0x1ba8('0x1e')]||null:null,'attributes':_0x45bc49[_0x1ba8('0x1c')]?_0x45bc49[_0x1ba8('0x1c')]['attributes']||null:null,'limit':_0x45bc49['options']?_0x45bc49[_0x1ba8('0x1c')][_0x1ba8('0x1f')]||null:null})[_0x1ba8('0x20')](function(_0x4ad1f0){logger['info']('UpdateChatInteraction',_0x45bc49);logger[_0x1ba8('0xf')](_0x1ba8('0x18'),_0x45bc49,JSON[_0x1ba8('0x12')](_0x4ad1f0));_0x13e905(_0x4ad1f0);})['catch'](function(_0x3a7055){logger['error']('UpdateChatInteraction',_0x3a7055[_0x1ba8('0x16')],_0x45bc49);_0x23e70f(_0x40cc5c['error'](0x1f4,_0x3a7055['message']));});});};exports[_0x1ba8('0x21')]=function(_0x3e2469){return new Promise(function(_0x55c481,_0x14cb63){return db[_0x1ba8('0x19')][_0x1ba8('0x22')]({'where':_0x3e2469['options']?_0x3e2469[_0x1ba8('0x1c')]['where']||null:null})[_0x1ba8('0x20')](function(_0x5224f7){if(_0x5224f7){return _0x5224f7['addTags'](_0x3e2469[_0x1ba8('0x1b')][_0x1ba8('0x23')],_[_0x1ba8('0x24')](_0x3e2469[_0x1ba8('0x1b')],[_0x1ba8('0x23'),'id'])||{});}})['spread'](function(_0x440b0c){logger[_0x1ba8('0xe')](_0x1ba8('0x25'),_0x3e2469);logger['debug'](_0x1ba8('0x25'),_0x3e2469,JSON[_0x1ba8('0x12')](_0x440b0c));_0x55c481(_0x440b0c);})[_0x1ba8('0x17')](function(_0x3ea5c7){logger[_0x1ba8('0x13')](_0x1ba8('0x25'),_0x3ea5c7[_0x1ba8('0x16')],_0x3e2469);_0x14cb63(_this['error'](0x1f4,_0x3ea5c7['message']));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 054b451..39900b2 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 _0xf114=['length','chatInteraction:','./chatInteraction.events','save','update','removeListener','register'];(function(_0x191650,_0x25452b){var _0x540557=function(_0x37afac){while(--_0x37afac){_0x191650['push'](_0x191650['shift']());}};_0x540557(++_0x25452b);}(_0xf114,0x198));var _0x4f11=function(_0x43def2,_0x155df6){_0x43def2=_0x43def2-0x0;var _0x2ae7d1=_0xf114[_0x43def2];return _0x2ae7d1;};'use strict';var ChatInteractionEvents=require(_0x4f11('0x0'));var events=[_0x4f11('0x1'),'remove',_0x4f11('0x2')];function createListener(_0x4aef7b,_0x1bf028){return function(_0x16be09){_0x1bf028['emit'](_0x4aef7b,_0x16be09);};}function removeListener(_0x3db8d6,_0x22a942){return function(){ChatInteractionEvents[_0x4f11('0x3')](_0x3db8d6,_0x22a942);};}exports[_0x4f11('0x4')]=function(_0x2ac7d7){for(var _0x2e43aa=0x0,_0x1257b6=events[_0x4f11('0x5')];_0x2e43aa<_0x1257b6;_0x2e43aa++){var _0x60fd41=events[_0x2e43aa];var _0x5f3a3c=createListener(_0x4f11('0x6')+_0x60fd41,_0x2ac7d7);ChatInteractionEvents['on'](_0x60fd41,_0x5f3a3c);}}; \ No newline at end of file +var _0x20a3=['register','length','./chatInteraction.events','save','update','emit','removeListener'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0x20a3,0x183));var _0x320a=function(_0x6ebf25,_0x2b5e18){_0x6ebf25=_0x6ebf25-0x0;var _0x22f7d6=_0x20a3[_0x6ebf25];return _0x22f7d6;};'use strict';var ChatInteractionEvents=require(_0x320a('0x0'));var events=[_0x320a('0x1'),'remove',_0x320a('0x2')];function createListener(_0x430ba2,_0x2f6b42){return function(_0x5ba895){_0x2f6b42[_0x320a('0x3')](_0x430ba2,_0x5ba895);};}function removeListener(_0x3155a7,_0x5c19f9){return function(){ChatInteractionEvents[_0x320a('0x4')](_0x3155a7,_0x5c19f9);};}exports[_0x320a('0x5')]=function(_0x10c541){for(var _0x42eee1=0x0,_0x430b39=events[_0x320a('0x6')];_0x42eee1<_0x430b39;_0x42eee1++){var _0x7c2cc2=events[_0x42eee1];var _0x1bb34e=createListener('chatInteraction:'+_0x7c2cc2,_0x10c541);ChatInteractionEvents['on'](_0x7c2cc2,_0x1bb34e);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index f967a23..6acdfa1 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 _0xcc44=['originalname','single','file','attachmentUpload','post','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','update','customUpdate','/:id/abandon','abandon','close','delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/attachment_download','isChatInteractionAuthorized','attachmentDownload','/:id/messages','getMessages','getMyMessages','/:id/download','download','diskStorage','join','server/files/attachments/','%s-%s','now'];(function(_0x915de9,_0xabf9e5){var _0x274129=function(_0x27fd79){while(--_0x27fd79){_0x915de9['push'](_0x915de9['shift']());}};_0x274129(++_0xabf9e5);}(_0xcc44,0x165));var _0x4cc4=function(_0x17d69e,_0x27717d){_0x17d69e=_0x17d69e-0x0;var _0x4b153f=_0xcc44[_0x17d69e];return _0x4b153f;};'use strict';var multer=require(_0x4cc4('0x0'));var util=require('util');var path=require(_0x4cc4('0x1'));var timeout=require('connect-timeout');var express=require(_0x4cc4('0x2'));var router=express[_0x4cc4('0x3')]();var auth=require(_0x4cc4('0x4'));var interaction=require(_0x4cc4('0x5'));var config=require(_0x4cc4('0x6'));var controller=require(_0x4cc4('0x7'));router[_0x4cc4('0x8')]('/',auth[_0x4cc4('0x9')](),controller['index']);router['get'](_0x4cc4('0xa'),auth[_0x4cc4('0x9')](),controller[_0x4cc4('0xb')]);router[_0x4cc4('0x8')](_0x4cc4('0xc'),auth['isChatInteractionAuthorized'](),controller[_0x4cc4('0xd')]);router[_0x4cc4('0x8')](_0x4cc4('0xe'),auth[_0x4cc4('0xf')](),controller[_0x4cc4('0x10')]);router[_0x4cc4('0x8')](_0x4cc4('0x11'),auth[_0x4cc4('0x9')](),controller[_0x4cc4('0x12')]);router[_0x4cc4('0x8')]('/:id/my_messages',auth[_0x4cc4('0xf')](),controller[_0x4cc4('0x13')]);router['get'](_0x4cc4('0x14'),auth[_0x4cc4('0x9')](),controller[_0x4cc4('0x15')]);router['post']('/',auth[_0x4cc4('0x9')](),controller['create']);var upload=multer({'storage':multer[_0x4cc4('0x16')]({'destination':function(_0x1b342f,_0x1c4a10,_0x9847f){_0x9847f(null,path[_0x4cc4('0x17')](config['root'],_0x4cc4('0x18')));},'filename':function(_0x1aa82c,_0x6b9ff4,_0x4f8736){_0x4f8736(null,util['format'](_0x4cc4('0x19'),Date[_0x4cc4('0x1a')](),_0x6b9ff4[_0x4cc4('0x1b')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post']('/:id/attachment_upload',upload[_0x4cc4('0x1c')](_0x4cc4('0x1d')),controller[_0x4cc4('0x1e')]);router[_0x4cc4('0x1f')](_0x4cc4('0x11'),auth[_0x4cc4('0xf')](),controller[_0x4cc4('0x20')]);router[_0x4cc4('0x1f')](_0x4cc4('0x21'),auth['isAuthenticated'](),interaction[_0x4cc4('0x22')](_0x4cc4('0x23'),_0x4cc4('0x24')),controller[_0x4cc4('0x25')]);router[_0x4cc4('0x26')]('/:id',auth[_0x4cc4('0x9')](),interaction['tracked'](_0x4cc4('0x23'),_0x4cc4('0x27')),controller[_0x4cc4('0x28')]);router[_0x4cc4('0x26')]('/:id/custom_update',controller[_0x4cc4('0x29')]);router[_0x4cc4('0x26')](_0x4cc4('0x2a'),auth[_0x4cc4('0xf')](),controller[_0x4cc4('0x2b')]);router[_0x4cc4('0x26')]('/:id/close',controller[_0x4cc4('0x2c')]);router[_0x4cc4('0x2d')](_0x4cc4('0xc'),auth[_0x4cc4('0x9')](),interaction['tracked'](_0x4cc4('0x23'),'chatinteraction:destroy'),controller[_0x4cc4('0x2e')]);router[_0x4cc4('0x2d')](_0x4cc4('0x21'),auth['isAuthenticated'](),controller['removeTags']);module[_0x4cc4('0x2f')]=router; \ No newline at end of file +var _0x7cd3=['create','diskStorage','join','server/files/attachments/','format','%s-%s','now','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','update','/:id/custom_update','/:id/abandon','/:id/close','close','chatinteraction:destroy','delete','/:id/tags','removeTags','exports','multer','path','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','isChatInteractionAuthorized','attachmentDownload','getMessages','/:id/my_messages','getMyMessages','/:id/download','post'];(function(_0x174a4d,_0x203ae3){var _0x240fa1=function(_0x7139f){while(--_0x7139f){_0x174a4d['push'](_0x174a4d['shift']());}};_0x240fa1(++_0x203ae3);}(_0x7cd3,0x144));var _0x37cd=function(_0x1ecc21,_0x1d0fe5){_0x1ecc21=_0x1ecc21-0x0;var _0x381abb=_0x7cd3[_0x1ecc21];return _0x381abb;};'use strict';var multer=require(_0x37cd('0x0'));var util=require('util');var path=require(_0x37cd('0x1'));var timeout=require('connect-timeout');var express=require(_0x37cd('0x2'));var router=express[_0x37cd('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x37cd('0x4'));var config=require(_0x37cd('0x5'));var controller=require('./chatInteraction.controller');router[_0x37cd('0x6')]('/',auth[_0x37cd('0x7')](),controller['index']);router[_0x37cd('0x6')](_0x37cd('0x8'),auth['isAuthenticated'](),controller[_0x37cd('0x9')]);router['get'](_0x37cd('0xa'),auth['isChatInteractionAuthorized'](),controller[_0x37cd('0xb')]);router[_0x37cd('0x6')]('/:id/attachment_download',auth[_0x37cd('0xc')](),controller[_0x37cd('0xd')]);router[_0x37cd('0x6')]('/:id/messages',auth[_0x37cd('0x7')](),controller[_0x37cd('0xe')]);router[_0x37cd('0x6')](_0x37cd('0xf'),auth[_0x37cd('0xc')](),controller[_0x37cd('0x10')]);router[_0x37cd('0x6')](_0x37cd('0x11'),auth['isAuthenticated'](),controller['download']);router[_0x37cd('0x12')]('/',auth[_0x37cd('0x7')](),controller[_0x37cd('0x13')]);var upload=multer({'storage':multer[_0x37cd('0x14')]({'destination':function(_0x71da37,_0x31538f,_0x6d043c){_0x6d043c(null,path[_0x37cd('0x15')](config['root'],_0x37cd('0x16')));},'filename':function(_0x1a21c3,_0x50ef95,_0x279e52){_0x279e52(null,util[_0x37cd('0x17')](_0x37cd('0x18'),Date[_0x37cd('0x19')](),_0x50ef95[_0x37cd('0x1a')][_0x37cd('0x1b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x37cd('0x12')](_0x37cd('0x1c'),upload[_0x37cd('0x1d')](_0x37cd('0x1e')),controller[_0x37cd('0x1f')]);router[_0x37cd('0x12')]('/:id/messages',auth[_0x37cd('0xc')](),controller[_0x37cd('0x20')]);router[_0x37cd('0x12')]('/:id/tags',auth[_0x37cd('0x7')](),interaction[_0x37cd('0x21')](_0x37cd('0x22'),_0x37cd('0x23')),controller[_0x37cd('0x24')]);router[_0x37cd('0x25')](_0x37cd('0xa'),auth['isAuthenticated'](),interaction[_0x37cd('0x21')](_0x37cd('0x22'),_0x37cd('0x26')),controller[_0x37cd('0x27')]);router['put'](_0x37cd('0x28'),controller['customUpdate']);router[_0x37cd('0x25')](_0x37cd('0x29'),auth[_0x37cd('0xc')](),controller['abandon']);router[_0x37cd('0x25')](_0x37cd('0x2a'),controller[_0x37cd('0x2b')]);router['delete'](_0x37cd('0xa'),auth[_0x37cd('0x7')](),interaction[_0x37cd('0x21')]('chat',_0x37cd('0x2c')),controller['destroy']);router[_0x37cd('0x2d')](_0x37cd('0x2e'),auth[_0x37cd('0x7')](),controller[_0x37cd('0x2f')]);module[_0x37cd('0x30')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index cb9dd73..6250f2e 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 _0xda2d=['medium','BOOLEAN','INTEGER','exports','TEXT'];(function(_0x88a454,_0x17f887){var _0x4ab85a=function(_0x12885){while(--_0x12885){_0x88a454['push'](_0x88a454['shift']());}};_0x4ab85a(++_0x17f887);}(_0xda2d,0x102));var _0xdda2=function(_0x413f7a,_0x33b86c){_0x413f7a=_0x413f7a-0x0;var _0x446ad1=_0xda2d[_0x413f7a];return _0x446ad1;};'use strict';var Sequelize=require('sequelize');module[_0xdda2('0x0')]={'body':{'type':Sequelize[_0xdda2('0x1')](_0xdda2('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xdda2('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xdda2('0x4')]}}; \ No newline at end of file +var _0x1261=['TEXT','medium','BOOLEAN','INTEGER','exports'];(function(_0x38153c,_0x2bfbbe){var _0x405d82=function(_0x39ba75){while(--_0x39ba75){_0x38153c['push'](_0x38153c['shift']());}};_0x405d82(++_0x2bfbbe);}(_0x1261,0x144));var _0x1126=function(_0x4f53a6,_0x582ff5){_0x4f53a6=_0x4f53a6-0x0;var _0x30e4b7=_0x1261[_0x4f53a6];return _0x30e4b7;};'use strict';var Sequelize=require('sequelize');module[_0x1126('0x0')]={'body':{'type':Sequelize[_0x1126('0x1')](_0x1126('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x1126('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x1126('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 1864078..4cc7f3d 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 _0xb8f0=['UserProfileSection','userProfileId','filter','agent','resourceId','push','FromId','read','-createdAt','all','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','count','offset','limit','set','Content-Range','save','update','then','destroy','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','query','keys','intersection','attributes','model','length','nolimit','order','sort','where','pick','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','filters','fields','includeAll','find','create','body','describe','messages','lastMessageAt','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','fullname','role','internal','online','allowmessenger','showWebBar','-online','VoiceQueue','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x4b7b62,_0x4920a9){var _0x2280df=function(_0x21e1f8){while(--_0x21e1f8){_0x4b7b62['push'](_0x4b7b62['shift']());}};_0x2280df(++_0x4920a9);}(_0xb8f0,0x1b6));var _0x0b8f=function(_0x1dba64,_0x4f2752){_0x1dba64=_0x1dba64-0x0;var _0x3e2db3=_0xb8f0[_0x1dba64];return _0x3e2db3;};'use strict';var pdf=require(_0x0b8f('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x0b8f('0x1'));var zipdir=require(_0x0b8f('0x2'));var jsonpatch=require(_0x0b8f('0x3'));var rp=require('request-promise');var moment=require(_0x0b8f('0x4'));var BPromise=require(_0x0b8f('0x5'));var Mustache=require('mustache');var util=require(_0x0b8f('0x6'));var path=require(_0x0b8f('0x7'));var sox=require(_0x0b8f('0x8'));var csv=require(_0x0b8f('0x9'));var ejs=require(_0x0b8f('0xa'));var fs=require('fs');var _=require(_0x0b8f('0xb'));var squel=require('squel');var crypto=require(_0x0b8f('0xc'));var jsforce=require(_0x0b8f('0xd'));var deskjs=require(_0x0b8f('0xe'));var toCsv=require(_0x0b8f('0x9'));var querystring=require(_0x0b8f('0xf'));var Papa=require(_0x0b8f('0x10'));var Redis=require(_0x0b8f('0x11'));var authService=require(_0x0b8f('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x0b8f('0x13'));var hardwareService=require(_0x0b8f('0x14'));var logger=require(_0x0b8f('0x15'))(_0x0b8f('0x16'));var utils=require('../../config/utils');var config=require(_0x0b8f('0x17'));var db=require(_0x0b8f('0x18'))['db'];config[_0x0b8f('0x19')]=_[_0x0b8f('0x1a')](config['redis'],{'host':_0x0b8f('0x1b'),'port':0x18eb});var socket=require(_0x0b8f('0x1c'))(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0x0b8f('0x1d')](socket);function respondWithStatusCode(_0x1ac26f,_0x6d2585){_0x6d2585=_0x6d2585||0xcc;return function(_0x36842f){if(_0x36842f){return _0x1ac26f[_0x0b8f('0x1e')](_0x6d2585);}return _0x1ac26f[_0x0b8f('0x1f')](_0x6d2585)[_0x0b8f('0x20')]();};}function respondWithResult(_0x307929,_0x51fed4){_0x51fed4=_0x51fed4||0xc8;return function(_0x39d90b){if(_0x39d90b){return _0x307929[_0x0b8f('0x1f')](_0x51fed4)['json'](_0x39d90b);}};}function respondWithFilteredResult(_0x19ebf3,_0x3767f1){return function(_0x29b083){if(_0x29b083){var _0x4d1838=_0x29b083[_0x0b8f('0x21')],_0x5f302b=_0x3767f1['offset'],_0x37d82c=_0x3767f1[_0x0b8f('0x22')]+_0x3767f1[_0x0b8f('0x23')],_0x45e0fe;if(_0x37d82c>=_0x4d1838){_0x37d82c=_0x4d1838;_0x45e0fe=0xc8;}else{_0x45e0fe=0xce;}_0x19ebf3['status'](_0x45e0fe);return _0x19ebf3[_0x0b8f('0x24')](_0x0b8f('0x25'),_0x5f302b+'-'+_0x37d82c+'/'+_0x4d1838)['json'](_0x29b083);}return null;};}function patchUpdates(_0x41867f){return function(_0x62c06e){try{jsonpatch['apply'](_0x62c06e,_0x41867f,!![]);}catch(_0x40c1ad){return BPromise['reject'](_0x40c1ad);}return _0x62c06e[_0x0b8f('0x26')]();};}function saveUpdates(_0x2a3945,_0x3682da){return function(_0x4b130f){if(_0x4b130f){return _0x4b130f[_0x0b8f('0x27')](_0x2a3945)[_0x0b8f('0x28')](function(_0x551fbd){return _0x551fbd;});}return null;};}function removeEntity(_0x9c71f2,_0x3d4b76){return function(_0x2313ef){if(_0x2313ef){return _0x2313ef[_0x0b8f('0x29')]()[_0x0b8f('0x28')](function(){_0x9c71f2[_0x0b8f('0x1f')](0xcc)[_0x0b8f('0x20')]();});}};}function handleEntityNotFound(_0x23f3d0,_0x3638cf){return function(_0x173eba){if(!_0x173eba){_0x23f3d0[_0x0b8f('0x1e')](0x194);}return _0x173eba;};}function handleError(_0x569c35,_0x39457c){_0x39457c=_0x39457c||0x1f4;return function(_0x446e8c){logger[_0x0b8f('0x2a')](_0x446e8c[_0x0b8f('0x2b')]);if(_0x446e8c[_0x0b8f('0x2c')]){delete _0x446e8c[_0x0b8f('0x2c')];}_0x569c35[_0x0b8f('0x1f')](_0x39457c)[_0x0b8f('0x2d')](_0x446e8c);};}exports[_0x0b8f('0x2e')]=function(_0x3437eb,_0x356e4c){var _0x35096e={},_0x3522a9={},_0x540659={'count':0x0,'rows':[]};var _0x3f9cc3=_[_0x0b8f('0x2f')](db[_0x0b8f('0x30')][_0x0b8f('0x31')],function(_0x37f5bd){return{'name':_0x37f5bd[_0x0b8f('0x32')],'type':_0x37f5bd[_0x0b8f('0x33')]['key']};});_0x3522a9['model']=_[_0x0b8f('0x2f')](_0x3f9cc3,_0x0b8f('0x2c'));_0x3522a9[_0x0b8f('0x34')]=_[_0x0b8f('0x35')](_0x3437eb[_0x0b8f('0x34')]);_0x3522a9['filters']=_[_0x0b8f('0x36')](_0x3522a9['model'],_0x3522a9['query']);_0x35096e[_0x0b8f('0x37')]=_[_0x0b8f('0x36')](_0x3522a9[_0x0b8f('0x38')],qs['fields'](_0x3437eb[_0x0b8f('0x34')]['fields']));_0x35096e[_0x0b8f('0x37')]=_0x35096e[_0x0b8f('0x37')][_0x0b8f('0x39')]?_0x35096e[_0x0b8f('0x37')]:_0x3522a9[_0x0b8f('0x38')];if(!_0x3437eb[_0x0b8f('0x34')]['hasOwnProperty'](_0x0b8f('0x3a'))){_0x35096e[_0x0b8f('0x23')]=qs[_0x0b8f('0x23')](_0x3437eb[_0x0b8f('0x34')][_0x0b8f('0x23')]);_0x35096e[_0x0b8f('0x22')]=qs[_0x0b8f('0x22')](_0x3437eb['query'][_0x0b8f('0x22')]);}_0x35096e[_0x0b8f('0x3b')]=qs[_0x0b8f('0x3c')](_0x3437eb[_0x0b8f('0x34')][_0x0b8f('0x3c')]);_0x35096e[_0x0b8f('0x3d')]=qs['filters'](_[_0x0b8f('0x3e')](_0x3437eb[_0x0b8f('0x34')],_0x3522a9['filters']));if(_0x3437eb['query']['filter']){_0x35096e[_0x0b8f('0x3d')]=_[_0x0b8f('0x3f')](_0x35096e['where'],{'$or':_[_0x0b8f('0x2f')](_0x3f9cc3,function(_0x5e442f){if(_0x5e442f['type']!==_0x0b8f('0x40')){var _0x3ae612={};_0x3ae612[_0x5e442f[_0x0b8f('0x2c')]]={'$like':'%'+_0x3437eb[_0x0b8f('0x34')]['filter']+'%'};return _0x3ae612;}})});}_0x35096e=_[_0x0b8f('0x3f')]({},_0x35096e,_0x3437eb[_0x0b8f('0x41')]);var _0x18652a={'where':_0x35096e[_0x0b8f('0x3d')]};return db[_0x0b8f('0x30')][_0x0b8f('0x21')](_0x18652a)['then'](function(_0x1e22cb){_0x540659[_0x0b8f('0x21')]=_0x1e22cb;if(_0x3437eb[_0x0b8f('0x34')]['includeAll']){_0x35096e[_0x0b8f('0x42')]=[{'all':!![]}];}return db[_0x0b8f('0x30')][_0x0b8f('0x43')](_0x35096e);})[_0x0b8f('0x28')](function(_0x3db2b8){_0x540659[_0x0b8f('0x44')]=_0x3db2b8;return _0x540659;})[_0x0b8f('0x28')](respondWithFilteredResult(_0x356e4c,_0x35096e))[_0x0b8f('0x45')](handleError(_0x356e4c,null));};exports[_0x0b8f('0x46')]=function(_0x8ab316,_0x5ab13c){var _0x333aec={'raw':!![],'where':{'id':_0x8ab316[_0x0b8f('0x47')]['id']}},_0x5b6998={};_0x5b6998[_0x0b8f('0x38')]=_['keys'](db[_0x0b8f('0x30')]['rawAttributes']);_0x5b6998[_0x0b8f('0x34')]=_[_0x0b8f('0x35')](_0x8ab316[_0x0b8f('0x34')]);_0x5b6998[_0x0b8f('0x48')]=_[_0x0b8f('0x36')](_0x5b6998[_0x0b8f('0x38')],_0x5b6998['query']);_0x333aec['attributes']=_[_0x0b8f('0x36')](_0x5b6998[_0x0b8f('0x38')],qs[_0x0b8f('0x49')](_0x8ab316[_0x0b8f('0x34')][_0x0b8f('0x49')]));_0x333aec[_0x0b8f('0x37')]=_0x333aec[_0x0b8f('0x37')]['length']?_0x333aec[_0x0b8f('0x37')]:_0x5b6998[_0x0b8f('0x38')];if(_0x8ab316['query'][_0x0b8f('0x4a')]){_0x333aec[_0x0b8f('0x42')]=[{'all':!![]}];}_0x333aec=_[_0x0b8f('0x3f')]({},_0x333aec,_0x8ab316[_0x0b8f('0x41')]);return db['ChatInternalMessage'][_0x0b8f('0x4b')](_0x333aec)[_0x0b8f('0x28')](handleEntityNotFound(_0x5ab13c,null))[_0x0b8f('0x28')](respondWithResult(_0x5ab13c,null))[_0x0b8f('0x45')](handleError(_0x5ab13c,null));};exports[_0x0b8f('0x4c')]=function(_0x3a3a1a,_0x40d224){return db['ChatInternalMessage'][_0x0b8f('0x4c')](_0x3a3a1a[_0x0b8f('0x4d')],{})[_0x0b8f('0x28')](respondWithResult(_0x40d224,0xc9))[_0x0b8f('0x45')](handleError(_0x40d224,null));};exports[_0x0b8f('0x27')]=function(_0x20ad89,_0x118b49){if(_0x20ad89[_0x0b8f('0x4d')]['id']){delete _0x20ad89[_0x0b8f('0x4d')]['id'];}return db[_0x0b8f('0x30')]['find']({'where':{'id':_0x20ad89['params']['id']}})[_0x0b8f('0x28')](handleEntityNotFound(_0x118b49,null))[_0x0b8f('0x28')](saveUpdates(_0x20ad89[_0x0b8f('0x4d')],null))[_0x0b8f('0x28')](respondWithResult(_0x118b49,null))['catch'](handleError(_0x118b49,null));};exports['destroy']=function(_0x15ff94,_0x5458a1){return db[_0x0b8f('0x30')]['find']({'where':{'id':_0x15ff94[_0x0b8f('0x47')]['id']}})[_0x0b8f('0x28')](handleEntityNotFound(_0x5458a1,null))[_0x0b8f('0x28')](removeEntity(_0x5458a1,null))[_0x0b8f('0x45')](handleError(_0x5458a1,null));};exports[_0x0b8f('0x4e')]=function(_0x17e036,_0x41b414){return db[_0x0b8f('0x30')][_0x0b8f('0x4e')]()[_0x0b8f('0x28')](respondWithResult(_0x41b414,null))[_0x0b8f('0x45')](handleError(_0x41b414,null));};function wrapUser(_0x282296){return function(_0x861a0c){var _0x5c3180=_0x282296['get']({'plain':!![]});_0x5c3180[_0x0b8f('0x4f')]=[];if(_0x861a0c){_0x5c3180[_0x0b8f('0x50')]=_0x861a0c[_0x0b8f('0x51')];_0x5c3180['lastMessage']=_0x861a0c;}else{_0x5c3180[_0x0b8f('0x50')]=moment(0x0)[_0x0b8f('0x52')](_0x0b8f('0x53'));_0x5c3180[_0x0b8f('0x54')]={};}return _0x5c3180;};}exports[_0x0b8f('0x55')]=function(_0x54d2c3,_0x2ea97c,_0x58aaa0){var _0x57da73=[];return db['User'][_0x0b8f('0x43')]({'where':{'role':['agent','admin','user']},'attributes':['id',_0x0b8f('0x56'),_0x0b8f('0x2c'),_0x0b8f('0x57'),'userpic',_0x0b8f('0x58'),_0x0b8f('0x59'),'lastLoginAt',_0x0b8f('0x5a'),_0x0b8f('0x5b')],'order':qs['sort'](_0x0b8f('0x5c')),'include':[{'model':db[_0x0b8f('0x5d')],'as':'VoiceQueues','attributes':['id','name',_0x0b8f('0x33')],'through':{'attributes':[]}}]})['then'](function(_0x368ada){if(_0x368ada){var _0x4c042a=_0x54d2c3[_0x0b8f('0x5e')][_0x0b8f('0x5f')]({'plain':!![]});if(!_0x4c042a)throw new Error(_0x0b8f('0x60'));if(_0x4c042a[_0x0b8f('0x57')]===_0x0b8f('0x5e')){return db[_0x0b8f('0x61')][_0x0b8f('0x4b')]({'where':{'name':'Agents','userProfileId':_0x4c042a[_0x0b8f('0x62')]},'raw':!![]})[_0x0b8f('0x28')](function(_0x275991){if(_0x275991){if(_0x275991['autoAssociation']===0x0){return db['UserProfileResource'][_0x0b8f('0x43')]({'where':{'sectionId':_0x275991['id']},'raw':!![]})['then'](function(_0x2cf339){var _0x5f13dd=[];if(_['isEmpty'](_0x2cf339)){_0x5f13dd=_[_0x0b8f('0x63')](_0x368ada,function(_0x23eab1){if(_0x23eab1['role']!==_0x0b8f('0x64')){return _0x23eab1;}});return _0x5f13dd;}else{for(var _0x33ca97=0x0;_0x33ca97<_0x368ada[_0x0b8f('0x39')];_0x33ca97++){var _0x4c1896=_0x368ada[_0x33ca97];if(_0x4c1896[_0x0b8f('0x57')]==='agent'){var _0x586a34=_[_0x0b8f('0x4b')](_0x2cf339,function(_0x5e98bc){return _0x5e98bc[_0x0b8f('0x65')]===_0x4c1896['id'];});if(_0x586a34)_0x5f13dd['push'](_0x4c1896);}else{_0x5f13dd[_0x0b8f('0x66')](_0x4c1896);}}return _0x5f13dd;}});}else{return _0x368ada;}}else{var _0x48e072=_[_0x0b8f('0x63')](_0x368ada,function(_0xe803ad){if(_0xe803ad[_0x0b8f('0x57')]!==_0x0b8f('0x64')){return _0xe803ad;}});return _0x48e072;}});}else{return _0x368ada;}}})['then'](function(_0xdae336){var _0x14d3af=[];if(_0xdae336){_0x57da73=_0xdae336;for(var _0x3aea93=0x0;_0x3aea93<_0xdae336[_0x0b8f('0x39')];_0x3aea93+=0x1){_0x57da73[_0x3aea93][_0x0b8f('0x4f')]=[];_0x14d3af['push'](db[_0x0b8f('0x30')]['find']({'where':{'FromId':[_0x54d2c3[_0x0b8f('0x5e')]['id'],_0xdae336[_0x3aea93]['id']],'ToId':[_0x54d2c3[_0x0b8f('0x5e')]['id'],_0xdae336[_0x3aea93]['id']],'ChatGroupId':null},'attributes':['id',_0x0b8f('0x51'),_0x0b8f('0x67'),'ToId',_0x0b8f('0x68'),'body'],'order':qs[_0x0b8f('0x3c')](_0x0b8f('0x69')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x0b8f('0x28')](wrapUser(_0xdae336[_0x3aea93])));}return BPromise[_0x0b8f('0x6a')](_0x14d3af);}return[];})[_0x0b8f('0x28')](function(_0x539017){return{'rows':_0x539017,'count':_0x539017[_0x0b8f('0x39')]};})['then'](respondWithResult(_0x2ea97c,null))[_0x0b8f('0x45')](handleError(_0x2ea97c,null));}; \ No newline at end of file +var _0xc1b4=['all','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','util','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','sendStatus','status','end','json','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','ChatInternalMessage','fieldName','type','model','keys','filters','intersection','query','fields','attributes','hasOwnProperty','nolimit','limit','offset','order','sort','where','pick','filter','VIRTUAL','merge','options','count','includeAll','findAll','catch','rawAttributes','include','find','create','body','update','params','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','user','fullname','role','userpic','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','autoAssociation','UserProfileResource','isEmpty','length','push','FromId','read','-createdAt'];(function(_0x4bb145,_0x3e7d33){var _0x4db596=function(_0x144489){while(--_0x144489){_0x4bb145['push'](_0x4bb145['shift']());}};_0x4db596(++_0x3e7d33);}(_0xc1b4,0xdd));var _0x4c1b=function(_0xae792a,_0xca7c3d){_0xae792a=_0xae792a-0x0;var _0x5860a3=_0xc1b4[_0xae792a];return _0x5860a3;};'use strict';var pdf=require(_0x4c1b('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x4c1b('0x1'));var zipdir=require(_0x4c1b('0x2'));var jsonpatch=require(_0x4c1b('0x3'));var rp=require(_0x4c1b('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4c1b('0x5'));var path=require('path');var sox=require(_0x4c1b('0x6'));var csv=require('to-csv');var ejs=require(_0x4c1b('0x7'));var fs=require('fs');var _=require(_0x4c1b('0x8'));var squel=require('squel');var crypto=require(_0x4c1b('0x9'));var jsforce=require(_0x4c1b('0xa'));var deskjs=require(_0x4c1b('0xb'));var toCsv=require(_0x4c1b('0xc'));var querystring=require(_0x4c1b('0xd'));var Papa=require(_0x4c1b('0xe'));var Redis=require('ioredis');var authService=require(_0x4c1b('0xf'));var qs=require(_0x4c1b('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4c1b('0x11'));var logger=require(_0x4c1b('0x12'))(_0x4c1b('0x13'));var utils=require(_0x4c1b('0x14'));var config=require(_0x4c1b('0x15'));var db=require('../../mysqldb')['db'];config[_0x4c1b('0x16')]=_['defaults'](config['redis'],{'host':_0x4c1b('0x17'),'port':0x18eb});var socket=require(_0x4c1b('0x18'))(new Redis(config['redis']));require(_0x4c1b('0x19'))['register'](socket);function respondWithStatusCode(_0x5bfe51,_0x342042){_0x342042=_0x342042||0xcc;return function(_0x4d943c){if(_0x4d943c){return _0x5bfe51[_0x4c1b('0x1a')](_0x342042);}return _0x5bfe51[_0x4c1b('0x1b')](_0x342042)[_0x4c1b('0x1c')]();};}function respondWithResult(_0x1cd780,_0x1d4285){_0x1d4285=_0x1d4285||0xc8;return function(_0x362c8e){if(_0x362c8e){return _0x1cd780[_0x4c1b('0x1b')](_0x1d4285)[_0x4c1b('0x1d')](_0x362c8e);}};}function respondWithFilteredResult(_0x5228b0,_0x8e1478){return function(_0x39a7d8){if(_0x39a7d8){var _0xb9e28d=_0x39a7d8['count'],_0x10254e=_0x8e1478['offset'],_0xb987e9=_0x8e1478['offset']+_0x8e1478['limit'],_0x340bd0;if(_0xb987e9>=_0xb9e28d){_0xb987e9=_0xb9e28d;_0x340bd0=0xc8;}else{_0x340bd0=0xce;}_0x5228b0['status'](_0x340bd0);return _0x5228b0[_0x4c1b('0x1e')](_0x4c1b('0x1f'),_0x10254e+'-'+_0xb987e9+'/'+_0xb9e28d)[_0x4c1b('0x1d')](_0x39a7d8);}return null;};}function patchUpdates(_0x15d89f){return function(_0x57222b){try{jsonpatch[_0x4c1b('0x20')](_0x57222b,_0x15d89f,!![]);}catch(_0x10da9e){return BPromise[_0x4c1b('0x21')](_0x10da9e);}return _0x57222b[_0x4c1b('0x22')]();};}function saveUpdates(_0x355d60,_0x3df2f0){return function(_0x58d206){if(_0x58d206){return _0x58d206['update'](_0x355d60)[_0x4c1b('0x23')](function(_0x8db82a){return _0x8db82a;});}return null;};}function removeEntity(_0x5d5922,_0x38bf4e){return function(_0x243036){if(_0x243036){return _0x243036[_0x4c1b('0x24')]()[_0x4c1b('0x23')](function(){_0x5d5922[_0x4c1b('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x222aaf,_0x20b79a){return function(_0x4ac2fc){if(!_0x4ac2fc){_0x222aaf[_0x4c1b('0x1a')](0x194);}return _0x4ac2fc;};}function handleError(_0x17cac3,_0x5918b6){_0x5918b6=_0x5918b6||0x1f4;return function(_0x3de71c){logger[_0x4c1b('0x25')](_0x3de71c[_0x4c1b('0x26')]);if(_0x3de71c[_0x4c1b('0x27')]){delete _0x3de71c['name'];}_0x17cac3[_0x4c1b('0x1b')](_0x5918b6)[_0x4c1b('0x28')](_0x3de71c);};}exports[_0x4c1b('0x29')]=function(_0xa702d2,_0x70e5b2){var _0x15bb0d={},_0x23eb24={},_0x4e5d77={'count':0x0,'rows':[]};var _0x4de4d9=_[_0x4c1b('0x2a')](db[_0x4c1b('0x2b')]['rawAttributes'],function(_0xfe79bf){return{'name':_0xfe79bf[_0x4c1b('0x2c')],'type':_0xfe79bf[_0x4c1b('0x2d')]['key']};});_0x23eb24[_0x4c1b('0x2e')]=_[_0x4c1b('0x2a')](_0x4de4d9,_0x4c1b('0x27'));_0x23eb24['query']=_[_0x4c1b('0x2f')](_0xa702d2['query']);_0x23eb24[_0x4c1b('0x30')]=_[_0x4c1b('0x31')](_0x23eb24[_0x4c1b('0x2e')],_0x23eb24[_0x4c1b('0x32')]);_0x15bb0d['attributes']=_[_0x4c1b('0x31')](_0x23eb24['model'],qs['fields'](_0xa702d2[_0x4c1b('0x32')][_0x4c1b('0x33')]));_0x15bb0d[_0x4c1b('0x34')]=_0x15bb0d[_0x4c1b('0x34')]['length']?_0x15bb0d['attributes']:_0x23eb24[_0x4c1b('0x2e')];if(!_0xa702d2[_0x4c1b('0x32')][_0x4c1b('0x35')](_0x4c1b('0x36'))){_0x15bb0d['limit']=qs[_0x4c1b('0x37')](_0xa702d2[_0x4c1b('0x32')][_0x4c1b('0x37')]);_0x15bb0d[_0x4c1b('0x38')]=qs[_0x4c1b('0x38')](_0xa702d2['query'][_0x4c1b('0x38')]);}_0x15bb0d[_0x4c1b('0x39')]=qs[_0x4c1b('0x3a')](_0xa702d2['query'][_0x4c1b('0x3a')]);_0x15bb0d[_0x4c1b('0x3b')]=qs['filters'](_[_0x4c1b('0x3c')](_0xa702d2[_0x4c1b('0x32')],_0x23eb24[_0x4c1b('0x30')]));if(_0xa702d2[_0x4c1b('0x32')][_0x4c1b('0x3d')]){_0x15bb0d[_0x4c1b('0x3b')]=_['merge'](_0x15bb0d['where'],{'$or':_['map'](_0x4de4d9,function(_0x454b70){if(_0x454b70[_0x4c1b('0x2d')]!==_0x4c1b('0x3e')){var _0x2077a6={};_0x2077a6[_0x454b70[_0x4c1b('0x27')]]={'$like':'%'+_0xa702d2[_0x4c1b('0x32')][_0x4c1b('0x3d')]+'%'};return _0x2077a6;}})});}_0x15bb0d=_[_0x4c1b('0x3f')]({},_0x15bb0d,_0xa702d2[_0x4c1b('0x40')]);var _0x18a501={'where':_0x15bb0d[_0x4c1b('0x3b')]};return db[_0x4c1b('0x2b')][_0x4c1b('0x41')](_0x18a501)[_0x4c1b('0x23')](function(_0x479733){_0x4e5d77[_0x4c1b('0x41')]=_0x479733;if(_0xa702d2[_0x4c1b('0x32')][_0x4c1b('0x42')]){_0x15bb0d['include']=[{'all':!![]}];}return db[_0x4c1b('0x2b')][_0x4c1b('0x43')](_0x15bb0d);})['then'](function(_0x5447d4){_0x4e5d77['rows']=_0x5447d4;return _0x4e5d77;})[_0x4c1b('0x23')](respondWithFilteredResult(_0x70e5b2,_0x15bb0d))[_0x4c1b('0x44')](handleError(_0x70e5b2,null));};exports['show']=function(_0x20f18b,_0x43c6a9){var _0x47630b={'raw':!![],'where':{'id':_0x20f18b['params']['id']}},_0x292d9c={};_0x292d9c[_0x4c1b('0x2e')]=_['keys'](db[_0x4c1b('0x2b')][_0x4c1b('0x45')]);_0x292d9c[_0x4c1b('0x32')]=_['keys'](_0x20f18b['query']);_0x292d9c[_0x4c1b('0x30')]=_['intersection'](_0x292d9c[_0x4c1b('0x2e')],_0x292d9c['query']);_0x47630b[_0x4c1b('0x34')]=_['intersection'](_0x292d9c['model'],qs[_0x4c1b('0x33')](_0x20f18b[_0x4c1b('0x32')][_0x4c1b('0x33')]));_0x47630b['attributes']=_0x47630b['attributes']['length']?_0x47630b[_0x4c1b('0x34')]:_0x292d9c[_0x4c1b('0x2e')];if(_0x20f18b[_0x4c1b('0x32')][_0x4c1b('0x42')]){_0x47630b[_0x4c1b('0x46')]=[{'all':!![]}];}_0x47630b=_[_0x4c1b('0x3f')]({},_0x47630b,_0x20f18b[_0x4c1b('0x40')]);return db['ChatInternalMessage'][_0x4c1b('0x47')](_0x47630b)[_0x4c1b('0x23')](handleEntityNotFound(_0x43c6a9,null))[_0x4c1b('0x23')](respondWithResult(_0x43c6a9,null))[_0x4c1b('0x44')](handleError(_0x43c6a9,null));};exports[_0x4c1b('0x48')]=function(_0x3af6df,_0x501a7b){return db[_0x4c1b('0x2b')]['create'](_0x3af6df[_0x4c1b('0x49')],{})[_0x4c1b('0x23')](respondWithResult(_0x501a7b,0xc9))['catch'](handleError(_0x501a7b,null));};exports[_0x4c1b('0x4a')]=function(_0x319c89,_0x10a3f0){if(_0x319c89[_0x4c1b('0x49')]['id']){delete _0x319c89['body']['id'];}return db[_0x4c1b('0x2b')][_0x4c1b('0x47')]({'where':{'id':_0x319c89[_0x4c1b('0x4b')]['id']}})[_0x4c1b('0x23')](handleEntityNotFound(_0x10a3f0,null))[_0x4c1b('0x23')](saveUpdates(_0x319c89[_0x4c1b('0x49')],null))[_0x4c1b('0x23')](respondWithResult(_0x10a3f0,null))[_0x4c1b('0x44')](handleError(_0x10a3f0,null));};exports[_0x4c1b('0x24')]=function(_0x427504,_0x4cf1a6){return db[_0x4c1b('0x2b')][_0x4c1b('0x47')]({'where':{'id':_0x427504[_0x4c1b('0x4b')]['id']}})[_0x4c1b('0x23')](handleEntityNotFound(_0x4cf1a6,null))[_0x4c1b('0x23')](removeEntity(_0x4cf1a6,null))[_0x4c1b('0x44')](handleError(_0x4cf1a6,null));};exports['describe']=function(_0x16a1e6,_0xca9898){return db['ChatInternalMessage'][_0x4c1b('0x4c')]()[_0x4c1b('0x23')](respondWithResult(_0xca9898,null))['catch'](handleError(_0xca9898,null));};function wrapUser(_0x401180){return function(_0x296a04){var _0xa1174e=_0x401180[_0x4c1b('0x4d')]({'plain':!![]});_0xa1174e[_0x4c1b('0x4e')]=[];if(_0x296a04){_0xa1174e[_0x4c1b('0x4f')]=_0x296a04[_0x4c1b('0x50')];_0xa1174e[_0x4c1b('0x51')]=_0x296a04;}else{_0xa1174e[_0x4c1b('0x4f')]=moment(0x0)[_0x4c1b('0x52')](_0x4c1b('0x53'));_0xa1174e[_0x4c1b('0x51')]={};}return _0xa1174e;};}exports[_0x4c1b('0x54')]=function(_0x543c75,_0x284eb6,_0x3ae0af){var _0x107b93=[];return db[_0x4c1b('0x55')]['findAll']({'where':{'role':[_0x4c1b('0x56'),_0x4c1b('0x57'),_0x4c1b('0x58')]},'attributes':['id',_0x4c1b('0x59'),_0x4c1b('0x27'),_0x4c1b('0x5a'),_0x4c1b('0x5b'),'internal',_0x4c1b('0x5c'),_0x4c1b('0x5d'),_0x4c1b('0x5e'),_0x4c1b('0x5f')],'order':qs[_0x4c1b('0x3a')](_0x4c1b('0x60')),'include':[{'model':db['VoiceQueue'],'as':_0x4c1b('0x61'),'attributes':['id',_0x4c1b('0x27'),_0x4c1b('0x2d')],'through':{'attributes':[]}}]})[_0x4c1b('0x23')](function(_0x388f0e){if(_0x388f0e){var _0x3231df=_0x543c75[_0x4c1b('0x58')][_0x4c1b('0x4d')]({'plain':!![]});if(!_0x3231df)throw new Error(_0x4c1b('0x62'));if(_0x3231df[_0x4c1b('0x5a')]==='user'){return db[_0x4c1b('0x63')][_0x4c1b('0x47')]({'where':{'name':_0x4c1b('0x64'),'userProfileId':_0x3231df['userProfileId']},'raw':!![]})[_0x4c1b('0x23')](function(_0x1c7fd9){if(_0x1c7fd9){if(_0x1c7fd9[_0x4c1b('0x65')]===0x0){return db[_0x4c1b('0x66')][_0x4c1b('0x43')]({'where':{'sectionId':_0x1c7fd9['id']},'raw':!![]})[_0x4c1b('0x23')](function(_0x1b807c){var _0x226420=[];if(_[_0x4c1b('0x67')](_0x1b807c)){_0x226420=_[_0x4c1b('0x3d')](_0x388f0e,function(_0x17b2fa){if(_0x17b2fa[_0x4c1b('0x5a')]!=='agent'){return _0x17b2fa;}});return _0x226420;}else{for(var _0x514fe7=0x0;_0x514fe7<_0x388f0e[_0x4c1b('0x68')];_0x514fe7++){var _0x51c317=_0x388f0e[_0x514fe7];if(_0x51c317['role']===_0x4c1b('0x56')){var _0x1b307d=_['find'](_0x1b807c,function(_0x1c6dc4){return _0x1c6dc4['resourceId']===_0x51c317['id'];});if(_0x1b307d)_0x226420[_0x4c1b('0x69')](_0x51c317);}else{_0x226420[_0x4c1b('0x69')](_0x51c317);}}return _0x226420;}});}else{return _0x388f0e;}}else{var _0xbee5a0=_[_0x4c1b('0x3d')](_0x388f0e,function(_0x4d9296){if(_0x4d9296[_0x4c1b('0x5a')]!=='agent'){return _0x4d9296;}});return _0xbee5a0;}});}else{return _0x388f0e;}}})[_0x4c1b('0x23')](function(_0x31e91e){var _0x1f7652=[];if(_0x31e91e){_0x107b93=_0x31e91e;for(var _0x798db6=0x0;_0x798db6<_0x31e91e[_0x4c1b('0x68')];_0x798db6+=0x1){_0x107b93[_0x798db6][_0x4c1b('0x4e')]=[];_0x1f7652[_0x4c1b('0x69')](db[_0x4c1b('0x2b')][_0x4c1b('0x47')]({'where':{'FromId':[_0x543c75[_0x4c1b('0x58')]['id'],_0x31e91e[_0x798db6]['id']],'ToId':[_0x543c75[_0x4c1b('0x58')]['id'],_0x31e91e[_0x798db6]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0x4c1b('0x6a'),'ToId',_0x4c1b('0x6b'),_0x4c1b('0x49')],'order':qs['sort'](_0x4c1b('0x6c')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x31e91e[_0x798db6])));}return BPromise[_0x4c1b('0x6d')](_0x1f7652);}return[];})[_0x4c1b('0x23')](function(_0x3c3136){return{'rows':_0x3c3136,'count':_0x3c3136[_0x4c1b('0x68')]};})[_0x4c1b('0x23')](respondWithResult(_0x284eb6,null))[_0x4c1b('0x44')](handleError(_0x284eb6,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index a1b2ae2..362e017 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 _0xcdb1=['update','remove','emit','hasOwnProperty','hook','../../mysqldb','ChatInternalMessage','setMaxListeners','save'];(function(_0x53ba51,_0x2f2321){var _0x2e776e=function(_0x16b5cf){while(--_0x16b5cf){_0x53ba51['push'](_0x53ba51['shift']());}};_0x2e776e(++_0x2f2321);}(_0xcdb1,0x1eb));var _0x1cdb=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xcdb1[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x1cdb('0x0'))['db'][_0x1cdb('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x1cdb('0x2')](0x0);var events={'afterCreate':_0x1cdb('0x3'),'afterUpdate':_0x1cdb('0x4'),'afterDestroy':_0x1cdb('0x5')};function emitEvent(_0x255567){return function(_0x921512,_0x73ee0b,_0x59c279){ChatInternalMessageEvents[_0x1cdb('0x6')](_0x255567+':'+_0x921512['id'],_0x921512);ChatInternalMessageEvents[_0x1cdb('0x6')](_0x255567,_0x921512);_0x59c279(null);};}for(var e in events){if(events[_0x1cdb('0x7')](e)){var event=events[e];ChatInternalMessage[_0x1cdb('0x8')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file +var _0xaa96=['exports','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x23407f,_0x37f9e9){var _0x492a1f=function(_0x5983c0){while(--_0x5983c0){_0x23407f['push'](_0x23407f['shift']());}};_0x492a1f(++_0x37f9e9);}(_0xaa96,0x145));var _0x6aa9=function(_0x3fcb45,_0x36298e){_0x3fcb45=_0x3fcb45-0x0;var _0x242689=_0xaa96[_0x3fcb45];return _0x242689;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x6aa9('0x0'))['db'][_0x6aa9('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x6aa9('0x2')](0x0);var events={'afterCreate':_0x6aa9('0x3'),'afterUpdate':_0x6aa9('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2d53d8){return function(_0x269671,_0x6955f9,_0x3ef7ea){ChatInternalMessageEvents[_0x6aa9('0x5')](_0x2d53d8+':'+_0x269671['id'],_0x269671);ChatInternalMessageEvents[_0x6aa9('0x5')](_0x2d53d8,_0x269671);_0x3ef7ea(null);};}for(var e in events){if(events[_0x6aa9('0x6')](e)){var event=events[e];ChatInternalMessage[_0x6aa9('0x7')](e,emitEvent(event));}}module[_0x6aa9('0x8')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index cdf8626..872f7ef 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 _0xda3f=['../../config/environment','exports','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','request-promise','rimraf'];(function(_0x3955e9,_0x48c85e){var _0xfaebf2=function(_0x4de784){while(--_0x4de784){_0x3955e9['push'](_0x3955e9['shift']());}};_0xfaebf2(++_0x48c85e);}(_0xda3f,0xec));var _0xfda3=function(_0x129321,_0x139186){_0x129321=_0x129321-0x0;var _0x5bd7eb=_0xda3f[_0x129321];return _0x5bd7eb;};'use strict';var _=require('lodash');var util=require(_0xfda3('0x0'));var logger=require(_0xfda3('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xfda3('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfda3('0x3'));var config=require(_0xfda3('0x4'));var attributes=require('./chatInternalMessage.attributes');module[_0xfda3('0x5')]=function(_0x43a010,_0x47e7e2){return _0x43a010['define'](_0xfda3('0x6'),attributes,{'tableName':_0xfda3('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfda3('0x8'),'collate':_0xfda3('0x9')});}; \ No newline at end of file +var _0xb43b=['./chatInternalMessage.attributes','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x2c6120,_0x1f3e60){var _0x5fb114=function(_0x45a72d){while(--_0x45a72d){_0x2c6120['push'](_0x2c6120['shift']());}};_0x5fb114(++_0x1f3e60);}(_0xb43b,0x1b2));var _0xbb43=function(_0x250b89,_0x31c00d){_0x250b89=_0x250b89-0x0;var _0x5f149f=_0xb43b[_0x250b89];return _0x5f149f;};'use strict';var _=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var logger=require('../../config/logger')(_0xbb43('0x2'));var moment=require(_0xbb43('0x3'));var BPromise=require(_0xbb43('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbb43('0x5'));var rimraf=require(_0xbb43('0x6'));var config=require(_0xbb43('0x7'));var attributes=require(_0xbb43('0x8'));module['exports']=function(_0x491fb9,_0x378df5){return _0x491fb9['define'](_0xbb43('0x9'),attributes,{'tableName':_0xbb43('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbb43('0xb'),'collate':_0xbb43('0xc')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 1d3714f..db527f1 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 _0x956c=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0xc3ab50,_0x2008de){var _0x2c4630=function(_0x50c77){while(--_0x50c77){_0xc3ab50['push'](_0xc3ab50['shift']());}};_0x2c4630(++_0x2008de);}(_0x956c,0x186));var _0xc956=function(_0x5eaaa7,_0x2589b6){_0x5eaaa7=_0x5eaaa7-0x0;var _0x456115=_0x956c[_0x5eaaa7];return _0x456115;};'use strict';var _=require(_0xc956('0x0'));var util=require(_0xc956('0x1'));var moment=require(_0xc956('0x2'));var BPromise=require(_0xc956('0x3'));var rs=require(_0xc956('0x4'));var fs=require('fs');var Redis=require(_0xc956('0x5'));var db=require(_0xc956('0x6'))['db'];var utils=require(_0xc956('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xc956('0x8'));var jayson=require(_0xc956('0x9'));var client=jayson[_0xc956('0xa')]['http']({'port':0x232a});config[_0xc956('0xb')]=_[_0xc956('0xc')](config['redis'],{'host':_0xc956('0xd'),'port':0x18eb});var socket=require(_0xc956('0xe'))(new Redis(config[_0xc956('0xb')]));require(_0xc956('0xf'))[_0xc956('0x10')](socket);function respondWithRpcPromise(_0x3625e0,_0x4a5058,_0x493f6b){return new BPromise(function(_0x40c733,_0x3531f9){return client[_0xc956('0x11')](_0x3625e0,_0x493f6b)[_0xc956('0x12')](function(_0x394fa0){logger[_0xc956('0x13')](_0xc956('0x14'),_0x4a5058,_0xc956('0x15'));logger[_0xc956('0x16')](_0xc956('0x17'),_0x4a5058,_0xc956('0x15'),JSON[_0xc956('0x18')](_0x394fa0));if(_0x394fa0[_0xc956('0x19')]){if(_0x394fa0[_0xc956('0x19')][_0xc956('0x1a')]===0x1f4){logger['error'](_0xc956('0x14'),_0x4a5058,_0x394fa0['error'][_0xc956('0x1b')]);return _0x3531f9(_0x394fa0[_0xc956('0x19')][_0xc956('0x1b')]);}logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x4a5058,_0x394fa0['error'][_0xc956('0x1b')]);return _0x40c733(_0x394fa0[_0xc956('0x19')]['message']);}else{logger['info'](_0xc956('0x14'),_0x4a5058,_0xc956('0x15'));_0x40c733(_0x394fa0[_0xc956('0x1c')][_0xc956('0x1b')]);}})[_0xc956('0x1d')](function(_0x2edf41){logger[_0xc956('0x19')](_0xc956('0x14'),_0x4a5058,_0x2edf41);_0x3531f9(_0x2edf41);});});} \ No newline at end of file +var _0x0b77=['message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x2534cf,_0x545be6){var _0x221461=function(_0x379e83){while(--_0x379e83){_0x2534cf['push'](_0x2534cf['shift']());}};_0x221461(++_0x545be6);}(_0x0b77,0x1e9));var _0x70b7=function(_0x391c55,_0x168617){_0x391c55=_0x391c55-0x0;var _0xa434e0=_0x0b77[_0x391c55];return _0xa434e0;};'use strict';var _=require('lodash');var util=require(_0x70b7('0x0'));var moment=require(_0x70b7('0x1'));var BPromise=require(_0x70b7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x70b7('0x3'));var db=require(_0x70b7('0x4'))['db'];var utils=require(_0x70b7('0x5'));var logger=require(_0x70b7('0x6'))(_0x70b7('0x7'));var config=require(_0x70b7('0x8'));var jayson=require(_0x70b7('0x9'));var client=jayson[_0x70b7('0xa')][_0x70b7('0xb')]({'port':0x232a});config[_0x70b7('0xc')]=_['defaults'](config[_0x70b7('0xc')],{'host':_0x70b7('0xd'),'port':0x18eb});var socket=require(_0x70b7('0xe'))(new Redis(config[_0x70b7('0xc')]));require('./chatInternalMessage.socket')[_0x70b7('0xf')](socket);function respondWithRpcPromise(_0x3b140e,_0x178a3a,_0x2248e4){return new BPromise(function(_0x169b38,_0xebe6d3){return client['request'](_0x3b140e,_0x2248e4)[_0x70b7('0x10')](function(_0x2cbdd2){logger[_0x70b7('0x11')](_0x70b7('0x12'),_0x178a3a,_0x70b7('0x13'));logger[_0x70b7('0x14')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x178a3a,_0x70b7('0x13'),JSON[_0x70b7('0x15')](_0x2cbdd2));if(_0x2cbdd2[_0x70b7('0x16')]){if(_0x2cbdd2[_0x70b7('0x16')][_0x70b7('0x17')]===0x1f4){logger['error'](_0x70b7('0x12'),_0x178a3a,_0x2cbdd2[_0x70b7('0x16')][_0x70b7('0x18')]);return _0xebe6d3(_0x2cbdd2[_0x70b7('0x16')][_0x70b7('0x18')]);}logger[_0x70b7('0x16')](_0x70b7('0x12'),_0x178a3a,_0x2cbdd2[_0x70b7('0x16')][_0x70b7('0x18')]);return _0x169b38(_0x2cbdd2[_0x70b7('0x16')][_0x70b7('0x18')]);}else{logger[_0x70b7('0x11')](_0x70b7('0x12'),_0x178a3a,_0x70b7('0x13'));_0x169b38(_0x2cbdd2[_0x70b7('0x19')][_0x70b7('0x18')]);}})[_0x70b7('0x1a')](function(_0x2d69ac){logger[_0x70b7('0x16')](_0x70b7('0x12'),_0x178a3a,_0x2d69ac);_0xebe6d3(_0x2d69ac);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index a94ef70..92eb0a2 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 _0xc3b0=['remove','update','emit','removeListener','register','length','./chatInternalMessage.events','save'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xc3b0,0x166));var _0x0c3b=function(_0x5ab072,_0x48306c){_0x5ab072=_0x5ab072-0x0;var _0x38f9d0=_0xc3b0[_0x5ab072];return _0x38f9d0;};'use strict';var ChatInternalMessageEvents=require(_0x0c3b('0x0'));var events=[_0x0c3b('0x1'),_0x0c3b('0x2'),_0x0c3b('0x3')];function createListener(_0x5348c4,_0x5af7d8){return function(_0x2f8bb7){_0x5af7d8[_0x0c3b('0x4')](_0x5348c4,_0x2f8bb7);};}function removeListener(_0x508b38,_0x2b13c6){return function(){ChatInternalMessageEvents[_0x0c3b('0x5')](_0x508b38,_0x2b13c6);};}exports[_0x0c3b('0x6')]=function(_0x5ba7f1){for(var _0x408fd8=0x0,_0x3e2305=events[_0x0c3b('0x7')];_0x408fd8<_0x3e2305;_0x408fd8++){var _0x4e7c4f=events[_0x408fd8];var _0x5c4e3a=createListener('chatInternalMessage:'+_0x4e7c4f,_0x5ba7f1);ChatInternalMessageEvents['on'](_0x4e7c4f,_0x5c4e3a);}}; \ No newline at end of file +var _0x2285=['remove','update','emit','removeListener','register','length','chatInternalMessage:','save'];(function(_0x32f1d9,_0x3ee043){var _0x421430=function(_0x2f268a){while(--_0x2f268a){_0x32f1d9['push'](_0x32f1d9['shift']());}};_0x421430(++_0x3ee043);}(_0x2285,0x177));var _0x5228=function(_0x3dc226,_0x13c9ef){_0x3dc226=_0x3dc226-0x0;var _0x18fb55=_0x2285[_0x3dc226];return _0x18fb55;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0x5228('0x0'),_0x5228('0x1'),_0x5228('0x2')];function createListener(_0x109405,_0x3d4b29){return function(_0x4f0eae){_0x3d4b29[_0x5228('0x3')](_0x109405,_0x4f0eae);};}function removeListener(_0x527cb3,_0x5bf024){return function(){ChatInternalMessageEvents[_0x5228('0x4')](_0x527cb3,_0x5bf024);};}exports[_0x5228('0x5')]=function(_0x322927){for(var _0x5ef1d3=0x0,_0x18b2db=events[_0x5228('0x6')];_0x5ef1d3<_0x18b2db;_0x5ef1d3++){var _0x192393=events[_0x5ef1d3];var _0x322b86=createListener(_0x5228('0x7')+_0x192393,_0x322927);ChatInternalMessageEvents['on'](_0x192393,_0x322b86);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 23cbec6..7e9387c 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 _0xb7e7=['exports','multer','path','express','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get','/describe','isAuthenticated','/users','getUsers','/:id','post','create','put','update','delete'];(function(_0x197444,_0x2cc304){var _0xc606f5=function(_0x1c9e02){while(--_0x1c9e02){_0x197444['push'](_0x197444['shift']());}};_0xc606f5(++_0x2cc304);}(_0xb7e7,0x121));var _0x7b7e=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xb7e7[_0x126558];return _0x1f6d14;};'use strict';var multer=require(_0x7b7e('0x0'));var util=require('util');var path=require(_0x7b7e('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b7e('0x2'));var router=express['Router']();var auth=require(_0x7b7e('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x7b7e('0x4'));var controller=require(_0x7b7e('0x5'));router[_0x7b7e('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7b7e('0x6')](_0x7b7e('0x7'),auth[_0x7b7e('0x8')](),controller['describe']);router[_0x7b7e('0x6')](_0x7b7e('0x9'),auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xa')]);router[_0x7b7e('0x6')](_0x7b7e('0xb'),auth[_0x7b7e('0x8')](),controller['show']);router[_0x7b7e('0xc')]('/',auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xd')]);router[_0x7b7e('0xe')](_0x7b7e('0xb'),controller[_0x7b7e('0xf')]);router[_0x7b7e('0x10')](_0x7b7e('0xb'),auth[_0x7b7e('0x8')](),controller['destroy']);module[_0x7b7e('0x11')]=router; \ No newline at end of file +var _0xcb91=['isAuthenticated','/describe','describe','/:id','show','post','put','update','delete','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get'];(function(_0x2536f4,_0x1bfbb3){var _0x50ee43=function(_0x1c4de3){while(--_0x1c4de3){_0x2536f4['push'](_0x2536f4['shift']());}};_0x50ee43(++_0x1bfbb3);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3a3c17,_0x5b7b7e){_0x3a3c17=_0x3a3c17-0x0;var _0xd07f21=_0xcb91[_0x3a3c17];return _0xd07f21;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x1cb9('0x4'));var config=require(_0x1cb9('0x5'));var controller=require('./chatInternalMessage.controller');router[_0x1cb9('0x6')]('/',auth[_0x1cb9('0x7')](),controller['index']);router[_0x1cb9('0x6')](_0x1cb9('0x8'),auth['isAuthenticated'](),controller[_0x1cb9('0x9')]);router[_0x1cb9('0x6')]('/users',auth[_0x1cb9('0x7')](),controller['getUsers']);router['get'](_0x1cb9('0xa'),auth[_0x1cb9('0x7')](),controller[_0x1cb9('0xb')]);router[_0x1cb9('0xc')]('/',auth[_0x1cb9('0x7')](),controller['create']);router[_0x1cb9('0xd')](_0x1cb9('0xa'),controller[_0x1cb9('0xe')]);router[_0x1cb9('0xf')](_0x1cb9('0xa'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 68e23b5..d7872db 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 _0x028c=['ENUM','out','DATE','sequelize','TEXT','medium','BOOLEAN'];(function(_0x43b8d3,_0x4e710c){var _0x445170=function(_0x219e21){while(--_0x219e21){_0x43b8d3['push'](_0x43b8d3['shift']());}};_0x445170(++_0x4e710c);}(_0x028c,0x13e));var _0xc028=function(_0x50c710,_0x504134){_0x50c710=_0x50c710-0x0;var _0x2d5f79=_0x028c[_0x50c710];return _0x2d5f79;};'use strict';var Sequelize=require(_0xc028('0x0'));module['exports']={'body':{'type':Sequelize[_0xc028('0x1')](_0xc028('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xc028('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xc028('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xc028('0x4')]('in',_0xc028('0x5')),'defaultValue':_0xc028('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xc028('0x6')]}}; \ No newline at end of file +var _0xf53e=['medium','BOOLEAN','out','DATE','sequelize'];(function(_0x1a7a6b,_0x45c3d3){var _0x46c83d=function(_0x441a47){while(--_0x441a47){_0x1a7a6b['push'](_0x1a7a6b['shift']());}};_0x46c83d(++_0x45c3d3);}(_0xf53e,0x194));var _0xef53=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf53e[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xef53('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0xef53('0x1')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0xef53('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xef53('0x3')),'defaultValue':_0xef53('0x3'),'allowNull':![]},'readAt':{'type':Sequelize[_0xef53('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 6601588..4357f56 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 _0x0134=['length','create','body','params','describe','chat-interactions','accept','format','UserId','user','find','CmContact','ChatInteraction','ChatInteractionId','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','interface','SIP/%s','channel','event','EventManager','acceptmessage','parse','agent','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectmessage','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','client','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','info','result','catch','sendStatus','end','status','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','stack','name','send','index','map','ChatMessage','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0134,0x124));var _0x4013=function(_0x1880f5,_0x18418a){_0x1880f5=_0x1880f5-0x0;var _0x3f0957=_0x0134[_0x1880f5];return _0x3f0957;};'use strict';var pdf=require(_0x4013('0x0'));var emlformat=require(_0x4013('0x1'));var rimraf=require(_0x4013('0x2'));var zipdir=require(_0x4013('0x3'));var jsonpatch=require(_0x4013('0x4'));var rp=require(_0x4013('0x5'));var moment=require(_0x4013('0x6'));var BPromise=require(_0x4013('0x7'));var Mustache=require(_0x4013('0x8'));var util=require(_0x4013('0x9'));var path=require(_0x4013('0xa'));var sox=require(_0x4013('0xb'));var csv=require(_0x4013('0xc'));var ejs=require(_0x4013('0xd'));var fs=require('fs');var _=require(_0x4013('0xe'));var squel=require(_0x4013('0xf'));var crypto=require(_0x4013('0x10'));var jsforce=require('jsforce');var deskjs=require(_0x4013('0x11'));var toCsv=require(_0x4013('0xc'));var querystring=require(_0x4013('0x12'));var Papa=require(_0x4013('0x13'));var Redis=require(_0x4013('0x14'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4013('0x15'));var logger=require(_0x4013('0x16'))(_0x4013('0x17'));var utils=require('../../config/utils');var config=require(_0x4013('0x18'));var db=require(_0x4013('0x19'))['db'];config[_0x4013('0x1a')]=_[_0x4013('0x1b')](config[_0x4013('0x1a')],{'host':_0x4013('0x1c'),'port':0x18eb});var socket=require(_0x4013('0x1d'))(new Redis(config['redis']));require(_0x4013('0x1e'))[_0x4013('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson[_0x4013('0x20')][_0x4013('0x21')]({'port':0x232c});var client9002=jayson[_0x4013('0x20')][_0x4013('0x21')]({'port':0x232a});function checkPasswordPattern(_0x262366,_0x1c3101,_0x54ef2e){if(_0x54ef2e){var _0x1408e2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1408e2['test'](_0x1c3101)){return _0x262366;}else{throw new db[(_0x4013('0x22'))][(_0x4013('0x23'))](_0x4013('0x24'));}}else{return _0x262366;}}function respondWithRpcPromise(_0x3d77c5,_0x4a9e84,_0x1b8206,_0x2b7fe0){return new BPromise(function(_0x1af723,_0x2a1561){var _0xb1a61a=_0x2b7fe0||client;return _0xb1a61a[_0x4013('0x25')](_0x3d77c5,_0x1b8206)[_0x4013('0x26')](function(_0x41d180){logger['info']('ChatMessage,\x20%s,\x20%s',_0x4a9e84,_0x4013('0x27'));logger[_0x4013('0x28')](_0x4013('0x29'),_0x4a9e84,_0x4013('0x27'),JSON[_0x4013('0x2a')](_0x41d180));if(_0x41d180['error']){if(_0x41d180[_0x4013('0x2b')][_0x4013('0x2c')]===0x1f4){logger[_0x4013('0x2b')](_0x4013('0x2d'),_0x4a9e84,_0x41d180['error'][_0x4013('0x2e')]);return _0x2a1561(_0x41d180[_0x4013('0x2b')]['message']);}logger['error'](_0x4013('0x2d'),_0x4a9e84,_0x41d180[_0x4013('0x2b')][_0x4013('0x2e')]);return _0x1af723(_0x41d180[_0x4013('0x2b')]['message']);}else{logger[_0x4013('0x2f')](_0x4013('0x2d'),_0x4a9e84,_0x4013('0x27'));_0x1af723(_0x41d180[_0x4013('0x30')][_0x4013('0x2e')]);}})[_0x4013('0x31')](function(_0x253993){logger['error']('ChatMessage,\x20%s,\x20%s',_0x4a9e84,_0x253993);_0x2a1561(_0x253993);});});}function respondWithStatusCode(_0x5962ac,_0x53c912){_0x53c912=_0x53c912||0xcc;return function(_0x10787f){if(_0x10787f){return _0x5962ac[_0x4013('0x32')](_0x53c912);}return _0x5962ac['status'](_0x53c912)[_0x4013('0x33')]();};}function respondWithResult(_0x467c95,_0x2221ee){_0x2221ee=_0x2221ee||0xc8;return function(_0xf87e28){if(_0xf87e28){return _0x467c95[_0x4013('0x34')](_0x2221ee)[_0x4013('0x35')](_0xf87e28);}};}function respondWithFilteredResult(_0x3fec74,_0x587987){return function(_0x4c1dbd){if(_0x4c1dbd){var _0xc85ae5=_0x4c1dbd[_0x4013('0x36')],_0x495678=_0x587987[_0x4013('0x37')],_0x1c5ddd=_0x587987[_0x4013('0x37')]+_0x587987[_0x4013('0x38')],_0x306499;if(_0x1c5ddd>=_0xc85ae5){_0x1c5ddd=_0xc85ae5;_0x306499=0xc8;}else{_0x306499=0xce;}_0x3fec74['status'](_0x306499);return _0x3fec74[_0x4013('0x39')](_0x4013('0x3a'),_0x495678+'-'+_0x1c5ddd+'/'+_0xc85ae5)['json'](_0x4c1dbd);}return null;};}function patchUpdates(_0x5832c1){return function(_0x37d942){try{jsonpatch['apply'](_0x37d942,_0x5832c1,!![]);}catch(_0x1e4ec2){return BPromise[_0x4013('0x3b')](_0x1e4ec2);}return _0x37d942[_0x4013('0x3c')]();};}function saveUpdates(_0x479e4e,_0x2dcbf5){return function(_0xa0cbca){if(_0xa0cbca){return _0xa0cbca[_0x4013('0x3d')](_0x479e4e)['then'](function(_0xda6165){return _0xda6165;});}return null;};}function removeEntity(_0x1a22eb,_0x5d7eb2){return function(_0x22499e){if(_0x22499e){return _0x22499e[_0x4013('0x3e')]()[_0x4013('0x26')](function(){_0x1a22eb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xb2c473,_0x5c7fe9){return function(_0x414413){if(!_0x414413){_0xb2c473[_0x4013('0x32')](0x194);}return _0x414413;};}function handleError(_0x1b113e,_0x1df1b2){_0x1df1b2=_0x1df1b2||0x1f4;return function(_0x3c3f1d){logger[_0x4013('0x2b')](_0x3c3f1d[_0x4013('0x3f')]);if(_0x3c3f1d[_0x4013('0x40')]){delete _0x3c3f1d[_0x4013('0x40')];}_0x1b113e[_0x4013('0x34')](_0x1df1b2)[_0x4013('0x41')](_0x3c3f1d);};}exports[_0x4013('0x42')]=function(_0x2e0c0f,_0xd82879){var _0x29aba={},_0x3be52d={},_0xfaac48={'count':0x0,'rows':[]};var _0xd32e39=_[_0x4013('0x43')](db[_0x4013('0x44')][_0x4013('0x45')],function(_0x47e9c8){return{'name':_0x47e9c8[_0x4013('0x46')],'type':_0x47e9c8[_0x4013('0x47')][_0x4013('0x48')]};});_0x3be52d[_0x4013('0x49')]=_[_0x4013('0x43')](_0xd32e39,_0x4013('0x40'));_0x3be52d[_0x4013('0x4a')]=_[_0x4013('0x4b')](_0x2e0c0f[_0x4013('0x4a')]);_0x3be52d['filters']=_[_0x4013('0x4c')](_0x3be52d[_0x4013('0x49')],_0x3be52d[_0x4013('0x4a')]);_0x29aba[_0x4013('0x4d')]=_[_0x4013('0x4c')](_0x3be52d[_0x4013('0x49')],qs[_0x4013('0x4e')](_0x2e0c0f[_0x4013('0x4a')][_0x4013('0x4e')]));_0x29aba[_0x4013('0x4d')]=_0x29aba[_0x4013('0x4d')]['length']?_0x29aba[_0x4013('0x4d')]:_0x3be52d[_0x4013('0x49')];if(!_0x2e0c0f['query'][_0x4013('0x4f')](_0x4013('0x50'))){_0x29aba[_0x4013('0x38')]=qs['limit'](_0x2e0c0f[_0x4013('0x4a')][_0x4013('0x38')]);_0x29aba[_0x4013('0x37')]=qs[_0x4013('0x37')](_0x2e0c0f[_0x4013('0x4a')][_0x4013('0x37')]);}_0x29aba[_0x4013('0x51')]=qs[_0x4013('0x52')](_0x2e0c0f[_0x4013('0x4a')][_0x4013('0x52')]);_0x29aba[_0x4013('0x53')]=qs['filters'](_[_0x4013('0x54')](_0x2e0c0f[_0x4013('0x4a')],_0x3be52d[_0x4013('0x55')]));if(_0x2e0c0f[_0x4013('0x4a')][_0x4013('0x56')]){_0x29aba[_0x4013('0x53')]=_[_0x4013('0x57')](_0x29aba['where'],{'$or':_['map'](_0xd32e39,function(_0x2b4b13){if(_0x2b4b13['type']!==_0x4013('0x58')){var _0x558b15={};_0x558b15[_0x2b4b13[_0x4013('0x40')]]={'$like':'%'+_0x2e0c0f[_0x4013('0x4a')]['filter']+'%'};return _0x558b15;}})});}_0x29aba=_['merge']({},_0x29aba,_0x2e0c0f[_0x4013('0x59')]);var _0x4cab2c={'where':_0x29aba[_0x4013('0x53')]};return db['ChatMessage']['count'](_0x4cab2c)['then'](function(_0x33c5a2){_0xfaac48[_0x4013('0x36')]=_0x33c5a2;if(_0x2e0c0f['query'][_0x4013('0x5a')]){_0x29aba[_0x4013('0x5b')]=[{'all':!![]}];}return db['ChatMessage'][_0x4013('0x5c')](_0x29aba);})[_0x4013('0x26')](function(_0x4a9ff5){_0xfaac48[_0x4013('0x5d')]=_0x4a9ff5;return _0xfaac48;})[_0x4013('0x26')](respondWithFilteredResult(_0xd82879,_0x29aba))['catch'](handleError(_0xd82879,null));};exports[_0x4013('0x5e')]=function(_0x42b058,_0x28f267){var _0x381b24={'raw':!![],'where':{'id':_0x42b058['params']['id']}},_0x2a372f={};_0x2a372f[_0x4013('0x49')]=_[_0x4013('0x4b')](db[_0x4013('0x44')][_0x4013('0x45')]);_0x2a372f[_0x4013('0x4a')]=_[_0x4013('0x4b')](_0x42b058[_0x4013('0x4a')]);_0x2a372f[_0x4013('0x55')]=_[_0x4013('0x4c')](_0x2a372f[_0x4013('0x49')],_0x2a372f[_0x4013('0x4a')]);_0x381b24[_0x4013('0x4d')]=_[_0x4013('0x4c')](_0x2a372f[_0x4013('0x49')],qs['fields'](_0x42b058[_0x4013('0x4a')][_0x4013('0x4e')]));_0x381b24[_0x4013('0x4d')]=_0x381b24['attributes'][_0x4013('0x5f')]?_0x381b24[_0x4013('0x4d')]:_0x2a372f['model'];if(_0x42b058[_0x4013('0x4a')][_0x4013('0x5a')]){_0x381b24['include']=[{'all':!![]}];}_0x381b24=_['merge']({},_0x381b24,_0x42b058['options']);return db[_0x4013('0x44')]['find'](_0x381b24)[_0x4013('0x26')](handleEntityNotFound(_0x28f267,null))[_0x4013('0x26')](respondWithResult(_0x28f267,null))[_0x4013('0x31')](handleError(_0x28f267,null));};exports[_0x4013('0x60')]=function(_0x2f6d47,_0x1f36da){return db['ChatMessage'][_0x4013('0x60')](_0x2f6d47[_0x4013('0x61')],{})[_0x4013('0x26')](respondWithResult(_0x1f36da,0xc9))[_0x4013('0x31')](handleError(_0x1f36da,null));};exports['update']=function(_0xf63c8a,_0x653890){if(_0xf63c8a[_0x4013('0x61')]['id']){delete _0xf63c8a[_0x4013('0x61')]['id'];}return db[_0x4013('0x44')]['find']({'where':{'id':_0xf63c8a[_0x4013('0x62')]['id']}})[_0x4013('0x26')](handleEntityNotFound(_0x653890,null))[_0x4013('0x26')](saveUpdates(_0xf63c8a[_0x4013('0x61')],null))[_0x4013('0x26')](respondWithResult(_0x653890,null))[_0x4013('0x31')](handleError(_0x653890,null));};exports[_0x4013('0x3e')]=function(_0x3e2768,_0x41876c){return db[_0x4013('0x44')]['find']({'where':{'id':_0x3e2768[_0x4013('0x62')]['id']}})[_0x4013('0x26')](handleEntityNotFound(_0x41876c,null))['then'](removeEntity(_0x41876c,null))['catch'](handleError(_0x41876c,null));};exports['describe']=function(_0x132dab,_0x54ebc8){return db[_0x4013('0x44')][_0x4013('0x63')]()[_0x4013('0x26')](respondWithResult(_0x54ebc8,null))['catch'](handleError(_0x54ebc8,null));};var interaction_log=require(_0x4013('0x16'))(_0x4013('0x64'));exports[_0x4013('0x65')]=function(_0xa545fb,_0x56de11,_0x3d6428){var _0x12fdfb={'channel':'chat'};if(_0xa545fb['body']['id']){delete _0xa545fb[_0x4013('0x61')]['id'];}_0xa545fb[_0x4013('0x61')]['read']=!![];_0xa545fb[_0x4013('0x61')]['readAt']=moment()[_0x4013('0x66')]('YYYY-MM-DD\x20HH:mm:ss');_0xa545fb[_0x4013('0x61')][_0x4013('0x67')]=_0xa545fb['body'][_0x4013('0x67')]||_0xa545fb[_0x4013('0x68')]['id'];return db['ChatMessage'][_0x4013('0x69')]({'where':{'id':_0xa545fb[_0x4013('0x62')]['id'],'UserId':null},'include':[{'model':db[_0x4013('0x6a')],'as':'Contact'}]})[_0x4013('0x26')](handleEntityNotFound(_0x56de11,null))[_0x4013('0x26')](saveUpdates(_0xa545fb['body'],null))[_0x4013('0x26')](function(_0x1cc315){if(_0x1cc315){_0x12fdfb[_0x4013('0x2e')]=_0x1cc315['get']({'plain':!![]});return db[_0x4013('0x6b')][_0x4013('0x69')]({'where':{'id':_0x1cc315[_0x4013('0x6c')]}});}return null;})[_0x4013('0x26')](handleEntityNotFound(_0x56de11,null))['then'](function(_0x530f46){if(_0x530f46){return _0x530f46[_0x4013('0x3d')]({'UserId':_0xa545fb[_0x4013('0x61')]['UserId'],'read1stAt':_['isNil'](_0x530f46[_0x4013('0x6d')])?moment()[_0x4013('0x66')](_0x4013('0x6e')):undefined});}return null;})[_0x4013('0x26')](function(_0x14deef){if(_0x14deef){_0x12fdfb[_0x4013('0x6f')]=_0x14deef[_0x4013('0x70')]({'plain':!![]});interaction_log[_0x4013('0x2f')](_0x4013('0x71'),_0xa545fb[_0x4013('0x68')]['id'],_0xa545fb['user'][_0x4013('0x40')],_0xa545fb[_0x4013('0x68')][_0x4013('0x72')],_0x12fdfb[_0x4013('0x6f')]['id'],_0xa545fb[_0x4013('0x61')]?JSON[_0x4013('0x2a')](_0xa545fb['body']):_0x4013('0x73'));return respondWithRpcPromise(_0x4013('0x74'),_0x4013('0x75'),_0x12fdfb);}return null;})[_0x4013('0x26')](function(_0x1e4981){if(_0x1e4981){if(_0xa545fb[_0x4013('0x61')]['manual']){_0x12fdfb[_0x4013('0x2e')][_0x4013('0x76')]=util[_0x4013('0x66')](_0x4013('0x77'),_0xa545fb[_0x4013('0x68')][_0x4013('0x40')]);_0x12fdfb['message'][_0x4013('0x78')]=_0x12fdfb['channel'];_0x12fdfb[_0x4013('0x2e')][_0x4013('0x79')]=_0x4013('0x65');return respondWithRpcPromise(_0x4013('0x7a'),_0x4013('0x7a'),{'event':_0x4013('0x7b'),'message':_['merge'](_0x12fdfb[_0x4013('0x2e')],JSON[_0x4013('0x7c')](_0x12fdfb['interaction']['formData']))},client9002)[_0x4013('0x26')](function(){return _0x12fdfb;});}return _0x12fdfb;}return null;})['then'](respondWithResult(_0x56de11,null))[_0x4013('0x31')](handleError(_0x56de11,null));};var interaction_log=require(_0x4013('0x16'))(_0x4013('0x64'));exports['reject']=function(_0x38b874,_0x295c8c,_0x389275){var _0x47a28b={'agent':{},'channel':'chat'};if(_0x38b874[_0x4013('0x61')]['id']){delete _0x38b874[_0x4013('0x61')]['id'];}_0x38b874['body'][_0x4013('0x67')]=_0x38b874[_0x4013('0x61')]['UserId']||_0x38b874[_0x4013('0x68')]['id'];_0x47a28b[_0x4013('0x7d')]['id']=_0x38b874[_0x4013('0x61')][_0x4013('0x67')];return db['ChatMessage']['find']({'where':{'id':_0x38b874[_0x4013('0x62')]['id'],'UserId':null}})[_0x4013('0x26')](handleEntityNotFound(_0x295c8c,null))[_0x4013('0x26')](function(_0x32282e){if(_0x32282e){_0x47a28b['message']=_0x32282e[_0x4013('0x70')]({'plain':!![]});return db['ChatInteraction'][_0x4013('0x69')]({'where':{'id':_0x32282e[_0x4013('0x6c')]}});}return null;})['then'](handleEntityNotFound(_0x295c8c,null))[_0x4013('0x26')](function(_0x29c4d4){if(_0x29c4d4){_0x47a28b['interaction']=_0x29c4d4[_0x4013('0x70')]({'plain':!![]});interaction_log['info'](_0x4013('0x7e'),_0x38b874[_0x4013('0x68')]['id'],_0x38b874['user']['name'],_0x38b874[_0x4013('0x68')][_0x4013('0x72')],_0x47a28b[_0x4013('0x6f')]['id'],_0x38b874['body']?JSON[_0x4013('0x2a')](_0x38b874[_0x4013('0x61')]):_0x4013('0x73'));return respondWithRpcPromise(_0x4013('0x7f'),'rejectMessage',_0x47a28b);}return null;})[_0x4013('0x26')](function(_0x4fc224){if(_0x4fc224){_0x4fc224[_0x4013('0x2e')]['interface']=util['format'](_0x4013('0x77'),_0x38b874[_0x4013('0x68')]['name']);_0x4fc224[_0x4013('0x2e')][_0x4013('0x78')]=_0x47a28b[_0x4013('0x78')];_0x4fc224[_0x4013('0x2e')][_0x4013('0x79')]=_0x4013('0x3b');respondWithRpcPromise(_0x4013('0x7a'),'EventManager',{'event':_0x4013('0x80'),'message':_0x4fc224[_0x4013('0x2e')]},client9002);return _0x47a28b;}return null;})[_0x4013('0x26')](respondWithResult(_0x295c8c,null))[_0x4013('0x31')](handleError(_0x295c8c,null));}; \ No newline at end of file +var _0xc3fc=['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','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','sendStatus','end','count','offset','status','Content-Range','json','apply','save','update','then','stack','name','send','map','ChatMessage','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','show','keys','length','create','body','find','params','destroy','describe','chat-interactions','accept','read','readAt','UserId','Contact','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','format','YYYY-MM-DD\x20HH:mm:ss','interaction','user','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','parse','formData','reject','role','RejectMessage','rejectMessage','rejectmessage','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','test','ValidationError'];(function(_0x249025,_0x41a1cf){var _0x146dc8=function(_0x1bf73d){while(--_0x1bf73d){_0x249025['push'](_0x249025['shift']());}};_0x146dc8(++_0x41a1cf);}(_0xc3fc,0xd5));var _0xcc3f=function(_0x3ea121,_0x559b59){_0x3ea121=_0x3ea121-0x0;var _0x39d159=_0xc3fc[_0x3ea121];return _0x39d159;};'use strict';var pdf=require(_0xcc3f('0x0'));var emlformat=require(_0xcc3f('0x1'));var rimraf=require(_0xcc3f('0x2'));var zipdir=require(_0xcc3f('0x3'));var jsonpatch=require(_0xcc3f('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xcc3f('0x5'));var Mustache=require(_0xcc3f('0x6'));var util=require(_0xcc3f('0x7'));var path=require(_0xcc3f('0x8'));var sox=require(_0xcc3f('0x9'));var csv=require(_0xcc3f('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xcc3f('0xb'));var crypto=require(_0xcc3f('0xc'));var jsforce=require(_0xcc3f('0xd'));var deskjs=require(_0xcc3f('0xe'));var toCsv=require(_0xcc3f('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xcc3f('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xcc3f('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcc3f('0x11'))(_0xcc3f('0x12'));var utils=require('../../config/utils');var config=require(_0xcc3f('0x13'));var db=require(_0xcc3f('0x14'))['db'];config[_0xcc3f('0x15')]=_['defaults'](config[_0xcc3f('0x15')],{'host':_0xcc3f('0x16'),'port':0x18eb});var socket=require(_0xcc3f('0x17'))(new Redis(config[_0xcc3f('0x15')]));require(_0xcc3f('0x18'))[_0xcc3f('0x19')](socket);var jayson=require(_0xcc3f('0x1a'));var client=jayson[_0xcc3f('0x1b')][_0xcc3f('0x1c')]({'port':0x232c});var client9002=jayson[_0xcc3f('0x1b')][_0xcc3f('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x528af5,_0x4afd59,_0xe51746){if(_0xe51746){var _0x27d288=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x27d288[_0xcc3f('0x1d')](_0x4afd59)){return _0x528af5;}else{throw new db['Sequelize'][(_0xcc3f('0x1e'))](_0xcc3f('0x1f'));}}else{return _0x528af5;}}function respondWithRpcPromise(_0x3d775,_0x2af5df,_0x5a5f70,_0x138a03){return new BPromise(function(_0x4f28b4,_0xbafd5f){var _0x20773c=_0x138a03||client;return _0x20773c[_0xcc3f('0x20')](_0x3d775,_0x5a5f70)['then'](function(_0x475db1){logger['info'](_0xcc3f('0x21'),_0x2af5df,_0xcc3f('0x22'));logger[_0xcc3f('0x23')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x2af5df,'request\x20sent',JSON[_0xcc3f('0x24')](_0x475db1));if(_0x475db1[_0xcc3f('0x25')]){if(_0x475db1[_0xcc3f('0x25')][_0xcc3f('0x26')]===0x1f4){logger[_0xcc3f('0x25')]('ChatMessage,\x20%s,\x20%s',_0x2af5df,_0x475db1[_0xcc3f('0x25')][_0xcc3f('0x27')]);return _0xbafd5f(_0x475db1[_0xcc3f('0x25')][_0xcc3f('0x27')]);}logger[_0xcc3f('0x25')](_0xcc3f('0x21'),_0x2af5df,_0x475db1[_0xcc3f('0x25')][_0xcc3f('0x27')]);return _0x4f28b4(_0x475db1[_0xcc3f('0x25')][_0xcc3f('0x27')]);}else{logger[_0xcc3f('0x28')](_0xcc3f('0x21'),_0x2af5df,_0xcc3f('0x22'));_0x4f28b4(_0x475db1['result']['message']);}})[_0xcc3f('0x29')](function(_0x5d8d0a){logger['error'](_0xcc3f('0x21'),_0x2af5df,_0x5d8d0a);_0xbafd5f(_0x5d8d0a);});});}function respondWithStatusCode(_0x311868,_0x1df814){_0x1df814=_0x1df814||0xcc;return function(_0xd6898b){if(_0xd6898b){return _0x311868[_0xcc3f('0x2a')](_0x1df814);}return _0x311868['status'](_0x1df814)[_0xcc3f('0x2b')]();};}function respondWithResult(_0x2e6f75,_0x3c6e62){_0x3c6e62=_0x3c6e62||0xc8;return function(_0x170cba){if(_0x170cba){return _0x2e6f75['status'](_0x3c6e62)['json'](_0x170cba);}};}function respondWithFilteredResult(_0x289e11,_0x547697){return function(_0x378a4b){if(_0x378a4b){var _0x152785=_0x378a4b[_0xcc3f('0x2c')],_0x177b87=_0x547697[_0xcc3f('0x2d')],_0x3f82ca=_0x547697[_0xcc3f('0x2d')]+_0x547697['limit'],_0x4d8a7c;if(_0x3f82ca>=_0x152785){_0x3f82ca=_0x152785;_0x4d8a7c=0xc8;}else{_0x4d8a7c=0xce;}_0x289e11[_0xcc3f('0x2e')](_0x4d8a7c);return _0x289e11['set'](_0xcc3f('0x2f'),_0x177b87+'-'+_0x3f82ca+'/'+_0x152785)[_0xcc3f('0x30')](_0x378a4b);}return null;};}function patchUpdates(_0x57a809){return function(_0x39f471){try{jsonpatch[_0xcc3f('0x31')](_0x39f471,_0x57a809,!![]);}catch(_0x2cfdc){return BPromise['reject'](_0x2cfdc);}return _0x39f471[_0xcc3f('0x32')]();};}function saveUpdates(_0x54013b,_0x257271){return function(_0x2f7907){if(_0x2f7907){return _0x2f7907[_0xcc3f('0x33')](_0x54013b)[_0xcc3f('0x34')](function(_0x182ecd){return _0x182ecd;});}return null;};}function removeEntity(_0x258345,_0xdfc9fd){return function(_0x54093b){if(_0x54093b){return _0x54093b['destroy']()['then'](function(){_0x258345[_0xcc3f('0x2e')](0xcc)[_0xcc3f('0x2b')]();});}};}function handleEntityNotFound(_0x9735a2,_0x216e5f){return function(_0x15b814){if(!_0x15b814){_0x9735a2['sendStatus'](0x194);}return _0x15b814;};}function handleError(_0xda443e,_0x3224d4){_0x3224d4=_0x3224d4||0x1f4;return function(_0xfa10bd){logger[_0xcc3f('0x25')](_0xfa10bd[_0xcc3f('0x35')]);if(_0xfa10bd[_0xcc3f('0x36')]){delete _0xfa10bd[_0xcc3f('0x36')];}_0xda443e['status'](_0x3224d4)[_0xcc3f('0x37')](_0xfa10bd);};}exports['index']=function(_0x4f86af,_0x1dce46){var _0x448792={},_0x2934ff={},_0x5ba048={'count':0x0,'rows':[]};var _0x1a2c86=_[_0xcc3f('0x38')](db[_0xcc3f('0x39')][_0xcc3f('0x3a')],function(_0x46f7a2){return{'name':_0x46f7a2[_0xcc3f('0x3b')],'type':_0x46f7a2[_0xcc3f('0x3c')][_0xcc3f('0x3d')]};});_0x2934ff[_0xcc3f('0x3e')]=_[_0xcc3f('0x38')](_0x1a2c86,'name');_0x2934ff[_0xcc3f('0x3f')]=_['keys'](_0x4f86af['query']);_0x2934ff['filters']=_[_0xcc3f('0x40')](_0x2934ff['model'],_0x2934ff[_0xcc3f('0x3f')]);_0x448792[_0xcc3f('0x41')]=_[_0xcc3f('0x40')](_0x2934ff[_0xcc3f('0x3e')],qs[_0xcc3f('0x42')](_0x4f86af[_0xcc3f('0x3f')][_0xcc3f('0x42')]));_0x448792[_0xcc3f('0x41')]=_0x448792[_0xcc3f('0x41')]['length']?_0x448792[_0xcc3f('0x41')]:_0x2934ff[_0xcc3f('0x3e')];if(!_0x4f86af['query'][_0xcc3f('0x43')](_0xcc3f('0x44'))){_0x448792[_0xcc3f('0x45')]=qs['limit'](_0x4f86af['query'][_0xcc3f('0x45')]);_0x448792[_0xcc3f('0x2d')]=qs[_0xcc3f('0x2d')](_0x4f86af[_0xcc3f('0x3f')]['offset']);}_0x448792[_0xcc3f('0x46')]=qs[_0xcc3f('0x47')](_0x4f86af[_0xcc3f('0x3f')][_0xcc3f('0x47')]);_0x448792[_0xcc3f('0x48')]=qs[_0xcc3f('0x49')](_[_0xcc3f('0x4a')](_0x4f86af[_0xcc3f('0x3f')],_0x2934ff[_0xcc3f('0x49')]));if(_0x4f86af[_0xcc3f('0x3f')]['filter']){_0x448792[_0xcc3f('0x48')]=_['merge'](_0x448792['where'],{'$or':_[_0xcc3f('0x38')](_0x1a2c86,function(_0x1efaae){if(_0x1efaae[_0xcc3f('0x3c')]!=='VIRTUAL'){var _0x3cf200={};_0x3cf200[_0x1efaae['name']]={'$like':'%'+_0x4f86af[_0xcc3f('0x3f')][_0xcc3f('0x4b')]+'%'};return _0x3cf200;}})});}_0x448792=_[_0xcc3f('0x4c')]({},_0x448792,_0x4f86af[_0xcc3f('0x4d')]);var _0x319fa1={'where':_0x448792[_0xcc3f('0x48')]};return db[_0xcc3f('0x39')][_0xcc3f('0x2c')](_0x319fa1)['then'](function(_0x36de89){_0x5ba048[_0xcc3f('0x2c')]=_0x36de89;if(_0x4f86af['query'][_0xcc3f('0x4e')]){_0x448792[_0xcc3f('0x4f')]=[{'all':!![]}];}return db['ChatMessage'][_0xcc3f('0x50')](_0x448792);})['then'](function(_0x72a9c5){_0x5ba048[_0xcc3f('0x51')]=_0x72a9c5;return _0x5ba048;})[_0xcc3f('0x34')](respondWithFilteredResult(_0x1dce46,_0x448792))[_0xcc3f('0x29')](handleError(_0x1dce46,null));};exports[_0xcc3f('0x52')]=function(_0x4f4b18,_0x128b1f){var _0x3f0e81={'raw':!![],'where':{'id':_0x4f4b18['params']['id']}},_0x16eb71={};_0x16eb71[_0xcc3f('0x3e')]=_[_0xcc3f('0x53')](db['ChatMessage'][_0xcc3f('0x3a')]);_0x16eb71[_0xcc3f('0x3f')]=_[_0xcc3f('0x53')](_0x4f4b18[_0xcc3f('0x3f')]);_0x16eb71['filters']=_[_0xcc3f('0x40')](_0x16eb71[_0xcc3f('0x3e')],_0x16eb71[_0xcc3f('0x3f')]);_0x3f0e81[_0xcc3f('0x41')]=_['intersection'](_0x16eb71['model'],qs[_0xcc3f('0x42')](_0x4f4b18[_0xcc3f('0x3f')][_0xcc3f('0x42')]));_0x3f0e81[_0xcc3f('0x41')]=_0x3f0e81[_0xcc3f('0x41')][_0xcc3f('0x54')]?_0x3f0e81[_0xcc3f('0x41')]:_0x16eb71[_0xcc3f('0x3e')];if(_0x4f4b18['query'][_0xcc3f('0x4e')]){_0x3f0e81[_0xcc3f('0x4f')]=[{'all':!![]}];}_0x3f0e81=_[_0xcc3f('0x4c')]({},_0x3f0e81,_0x4f4b18[_0xcc3f('0x4d')]);return db[_0xcc3f('0x39')]['find'](_0x3f0e81)['then'](handleEntityNotFound(_0x128b1f,null))[_0xcc3f('0x34')](respondWithResult(_0x128b1f,null))[_0xcc3f('0x29')](handleError(_0x128b1f,null));};exports[_0xcc3f('0x55')]=function(_0x2ec9ed,_0x14c762){return db[_0xcc3f('0x39')][_0xcc3f('0x55')](_0x2ec9ed[_0xcc3f('0x56')],{})[_0xcc3f('0x34')](respondWithResult(_0x14c762,0xc9))[_0xcc3f('0x29')](handleError(_0x14c762,null));};exports[_0xcc3f('0x33')]=function(_0x24fccd,_0x1745cf){if(_0x24fccd[_0xcc3f('0x56')]['id']){delete _0x24fccd[_0xcc3f('0x56')]['id'];}return db[_0xcc3f('0x39')][_0xcc3f('0x57')]({'where':{'id':_0x24fccd[_0xcc3f('0x58')]['id']}})[_0xcc3f('0x34')](handleEntityNotFound(_0x1745cf,null))[_0xcc3f('0x34')](saveUpdates(_0x24fccd[_0xcc3f('0x56')],null))['then'](respondWithResult(_0x1745cf,null))['catch'](handleError(_0x1745cf,null));};exports[_0xcc3f('0x59')]=function(_0x5acdf3,_0x2c6d7f){return db[_0xcc3f('0x39')][_0xcc3f('0x57')]({'where':{'id':_0x5acdf3['params']['id']}})[_0xcc3f('0x34')](handleEntityNotFound(_0x2c6d7f,null))['then'](removeEntity(_0x2c6d7f,null))['catch'](handleError(_0x2c6d7f,null));};exports['describe']=function(_0x23de44,_0x1a1660){return db[_0xcc3f('0x39')][_0xcc3f('0x5a')]()['then'](respondWithResult(_0x1a1660,null))[_0xcc3f('0x29')](handleError(_0x1a1660,null));};var interaction_log=require(_0xcc3f('0x11'))(_0xcc3f('0x5b'));exports[_0xcc3f('0x5c')]=function(_0x2a9f04,_0x338419,_0xa5aba0){var _0x12df16={'channel':'chat'};if(_0x2a9f04[_0xcc3f('0x56')]['id']){delete _0x2a9f04[_0xcc3f('0x56')]['id'];}_0x2a9f04['body'][_0xcc3f('0x5d')]=!![];_0x2a9f04[_0xcc3f('0x56')][_0xcc3f('0x5e')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x2a9f04['body']['UserId']=_0x2a9f04[_0xcc3f('0x56')][_0xcc3f('0x5f')]||_0x2a9f04['user']['id'];return db['ChatMessage'][_0xcc3f('0x57')]({'where':{'id':_0x2a9f04[_0xcc3f('0x58')]['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0xcc3f('0x60')}]})['then'](handleEntityNotFound(_0x338419,null))[_0xcc3f('0x34')](saveUpdates(_0x2a9f04[_0xcc3f('0x56')],null))[_0xcc3f('0x34')](function(_0x5c3c68){if(_0x5c3c68){_0x12df16[_0xcc3f('0x27')]=_0x5c3c68[_0xcc3f('0x61')]({'plain':!![]});return db[_0xcc3f('0x62')][_0xcc3f('0x57')]({'where':{'id':_0x5c3c68[_0xcc3f('0x63')]}});}return null;})[_0xcc3f('0x34')](handleEntityNotFound(_0x338419,null))[_0xcc3f('0x34')](function(_0x269161){if(_0x269161){return _0x269161[_0xcc3f('0x33')]({'UserId':_0x2a9f04[_0xcc3f('0x56')][_0xcc3f('0x5f')],'read1stAt':_[_0xcc3f('0x64')](_0x269161[_0xcc3f('0x65')])?moment()[_0xcc3f('0x66')](_0xcc3f('0x67')):undefined});}return null;})[_0xcc3f('0x34')](function(_0x2a9f3b){if(_0x2a9f3b){_0x12df16[_0xcc3f('0x68')]=_0x2a9f3b['get']({'plain':!![]});interaction_log['info']('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2a9f04['user']['id'],_0x2a9f04[_0xcc3f('0x69')][_0xcc3f('0x36')],_0x2a9f04[_0xcc3f('0x69')]['role'],_0x12df16[_0xcc3f('0x68')]['id'],_0x2a9f04[_0xcc3f('0x56')]?JSON['stringify'](_0x2a9f04[_0xcc3f('0x56')]):'null');return respondWithRpcPromise(_0xcc3f('0x6a'),_0xcc3f('0x6b'),_0x12df16);}return null;})['then'](function(_0x1fa4a7){if(_0x1fa4a7){if(_0x2a9f04[_0xcc3f('0x56')][_0xcc3f('0x6c')]){_0x12df16[_0xcc3f('0x27')][_0xcc3f('0x6d')]=util['format'](_0xcc3f('0x6e'),_0x2a9f04[_0xcc3f('0x69')][_0xcc3f('0x36')]);_0x12df16['message'][_0xcc3f('0x6f')]=_0x12df16[_0xcc3f('0x6f')];_0x12df16[_0xcc3f('0x27')][_0xcc3f('0x70')]='accept';return respondWithRpcPromise(_0xcc3f('0x71'),_0xcc3f('0x71'),{'event':_0xcc3f('0x72'),'message':_[_0xcc3f('0x4c')](_0x12df16['message'],JSON[_0xcc3f('0x73')](_0x12df16[_0xcc3f('0x68')][_0xcc3f('0x74')]))},client9002)[_0xcc3f('0x34')](function(){return _0x12df16;});}return _0x12df16;}return null;})['then'](respondWithResult(_0x338419,null))[_0xcc3f('0x29')](handleError(_0x338419,null));};var interaction_log=require(_0xcc3f('0x11'))(_0xcc3f('0x5b'));exports[_0xcc3f('0x75')]=function(_0x40d625,_0xbce812,_0x375d6c){var _0x3c6c44={'agent':{},'channel':'chat'};if(_0x40d625['body']['id']){delete _0x40d625[_0xcc3f('0x56')]['id'];}_0x40d625['body']['UserId']=_0x40d625['body'][_0xcc3f('0x5f')]||_0x40d625[_0xcc3f('0x69')]['id'];_0x3c6c44['agent']['id']=_0x40d625[_0xcc3f('0x56')][_0xcc3f('0x5f')];return db[_0xcc3f('0x39')]['find']({'where':{'id':_0x40d625[_0xcc3f('0x58')]['id'],'UserId':null}})[_0xcc3f('0x34')](handleEntityNotFound(_0xbce812,null))['then'](function(_0x2f2050){if(_0x2f2050){_0x3c6c44[_0xcc3f('0x27')]=_0x2f2050[_0xcc3f('0x61')]({'plain':!![]});return db[_0xcc3f('0x62')][_0xcc3f('0x57')]({'where':{'id':_0x2f2050[_0xcc3f('0x63')]}});}return null;})[_0xcc3f('0x34')](handleEntityNotFound(_0xbce812,null))[_0xcc3f('0x34')](function(_0x149928){if(_0x149928){_0x3c6c44[_0xcc3f('0x68')]=_0x149928[_0xcc3f('0x61')]({'plain':!![]});interaction_log['info']('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x40d625[_0xcc3f('0x69')]['id'],_0x40d625['user'][_0xcc3f('0x36')],_0x40d625[_0xcc3f('0x69')][_0xcc3f('0x76')],_0x3c6c44['interaction']['id'],_0x40d625[_0xcc3f('0x56')]?JSON[_0xcc3f('0x24')](_0x40d625[_0xcc3f('0x56')]):'null');return respondWithRpcPromise(_0xcc3f('0x77'),_0xcc3f('0x78'),_0x3c6c44);}return null;})[_0xcc3f('0x34')](function(_0x3d9b0f){if(_0x3d9b0f){_0x3d9b0f[_0xcc3f('0x27')][_0xcc3f('0x6d')]=util['format'](_0xcc3f('0x6e'),_0x40d625[_0xcc3f('0x69')][_0xcc3f('0x36')]);_0x3d9b0f[_0xcc3f('0x27')][_0xcc3f('0x6f')]=_0x3c6c44[_0xcc3f('0x6f')];_0x3d9b0f[_0xcc3f('0x27')][_0xcc3f('0x70')]=_0xcc3f('0x75');respondWithRpcPromise('EventManager',_0xcc3f('0x71'),{'event':_0xcc3f('0x79'),'message':_0x3d9b0f[_0xcc3f('0x27')]},client9002);return _0x3c6c44;}return null;})[_0xcc3f('0x34')](respondWithResult(_0xbce812,null))[_0xcc3f('0x29')](handleError(_0xbce812,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 6be0ada..97ad157 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 _0xb723=['exports','../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','emit','hook'];(function(_0x1174ec,_0x35daa7){var _0x47f1be=function(_0x3451e6){while(--_0x3451e6){_0x1174ec['push'](_0x1174ec['shift']());}};_0x47f1be(++_0x35daa7);}(_0xb723,0xeb));var _0x3b72=function(_0x11f82b,_0x255da7){_0x11f82b=_0x11f82b-0x0;var _0xf6dada=_0xb723[_0x11f82b];return _0xf6dada;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x3b72('0x0'))['db'][_0x3b72('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x3b72('0x2')](0x0);var events={'afterCreate':_0x3b72('0x3'),'afterUpdate':_0x3b72('0x4'),'afterDestroy':_0x3b72('0x5')};function emitEvent(_0x2f53da){return function(_0xada87f,_0xb5f6a,_0x28e85e){ChatMessageEvents[_0x3b72('0x6')](_0x2f53da+':'+_0xada87f['id'],_0xada87f);ChatMessageEvents[_0x3b72('0x6')](_0x2f53da,_0xada87f);_0x28e85e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x3b72('0x7')](e,emitEvent(event));}}module[_0x3b72('0x8')]=ChatMessageEvents; \ No newline at end of file +var _0x05f5=['ChatMessage','emit','hook','exports','../../mysqldb'];(function(_0x5e0c6d,_0x5de199){var _0x57096d=function(_0x2da729){while(--_0x2da729){_0x5e0c6d['push'](_0x5e0c6d['shift']());}};_0x57096d(++_0x5de199);}(_0x05f5,0x9a));var _0x505f=function(_0x18624e,_0x172c43){_0x18624e=_0x18624e-0x0;var _0x41ef95=_0x05f5[_0x18624e];return _0x41ef95;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x505f('0x0'))['db'][_0x505f('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x320071){return function(_0x503e4e,_0x762281,_0x216102){ChatMessageEvents[_0x505f('0x2')](_0x320071+':'+_0x503e4e['id'],_0x503e4e);ChatMessageEvents['emit'](_0x320071,_0x503e4e);_0x216102(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x505f('0x3')](e,emitEvent(event));}}module[_0x505f('0x4')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 224321f..e625617 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 _0xd028=['error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','chat_messages','fti_chat_messages','body','models','direction','toLowerCase','secret','UserId','ChatInteractionId','update','createdAt','catch'];(function(_0x4d3106,_0x4ebecb){var _0x2f9f46=function(_0x4f9bf5){while(--_0x4f9bf5){_0x4d3106['push'](_0x4d3106['shift']());}};_0x2f9f46(++_0x4ebecb);}(_0xd028,0x198));var _0x8d02=function(_0x59d692,_0x274b2a){_0x59d692=_0x59d692-0x0;var _0x4458f1=_0xd028[_0x59d692];return _0x4458f1;};'use strict';var _=require(_0x8d02('0x0'));var util=require(_0x8d02('0x1'));var logger=require(_0x8d02('0x2'))(_0x8d02('0x3'));var moment=require(_0x8d02('0x4'));var BPromise=require('bluebird');var rp=require(_0x8d02('0x5'));var fs=require('fs');var path=require(_0x8d02('0x6'));var rimraf=require(_0x8d02('0x7'));var config=require(_0x8d02('0x8'));var attributes=require(_0x8d02('0x9'));module[_0x8d02('0xa')]=function(_0x1631d0,_0x24d5de){return _0x1631d0[_0x8d02('0xb')]('ChatMessage',attributes,{'tableName':_0x8d02('0xc'),'paranoid':![],'indexes':[{'name':_0x8d02('0xd'),'fields':[_0x8d02('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3aa59b,_0x188fdd,_0x40cc77){var _0x145390=_0x1631d0[_0x8d02('0xf')];var _0x554220=_0x3aa59b['get']({'plain':!![]});if(_0x554220[_0x8d02('0x10')]['toLowerCase']()==='in'||_0x554220[_0x8d02('0x10')][_0x8d02('0x11')]()==='out'&&!_0x554220[_0x8d02('0x12')]&&!_['isNil'](_0x554220[_0x8d02('0x13')])){_0x145390['ChatInteraction']['findOne']({'where':{'id':_0x554220[_0x8d02('0x14')]}})['then'](function(_0x277ba8){if(_0x277ba8){_0x277ba8[_0x8d02('0x15')]({'lastMsgAt':_0x554220[_0x8d02('0x16')],'lastMsgDirection':_0x554220[_0x8d02('0x10')]['toLowerCase']()});}})[_0x8d02('0x17')](function(_0x4dec75){console[_0x8d02('0x18')](_0x4dec75);});}_0x40cc77();}},'charset':_0x8d02('0x19'),'collate':_0x8d02('0x1a')});}; \ No newline at end of file +var _0x9a54=['./chatMessage.attributes','exports','define','chat_messages','fti_chat_messages','body','direction','secret','isNil','ChatInteraction','findOne','ChatInteractionId','then','createdAt','toLowerCase','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','request-promise','path'];(function(_0x2f056f,_0x394dee){var _0x1c2f15=function(_0x364390){while(--_0x364390){_0x2f056f['push'](_0x2f056f['shift']());}};_0x1c2f15(++_0x394dee);}(_0x9a54,0xf8));var _0x49a5=function(_0x7c1a77,_0x1cefe3){_0x7c1a77=_0x7c1a77-0x0;var _0x3496d7=_0x9a54[_0x7c1a77];return _0x3496d7;};'use strict';var _=require(_0x49a5('0x0'));var util=require(_0x49a5('0x1'));var logger=require(_0x49a5('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x49a5('0x3'));var fs=require('fs');var path=require(_0x49a5('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x49a5('0x5'));module[_0x49a5('0x6')]=function(_0x460465,_0x26d80d){return _0x460465[_0x49a5('0x7')]('ChatMessage',attributes,{'tableName':_0x49a5('0x8'),'paranoid':![],'indexes':[{'name':_0x49a5('0x9'),'fields':[_0x49a5('0xa')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x47cb14,_0x58c98f,_0x3cd2fd){var _0x3a8d6c=_0x460465['models'];var _0x20c8f4=_0x47cb14['get']({'plain':!![]});if(_0x20c8f4[_0x49a5('0xb')]['toLowerCase']()==='in'||_0x20c8f4[_0x49a5('0xb')]['toLowerCase']()==='out'&&!_0x20c8f4[_0x49a5('0xc')]&&!_[_0x49a5('0xd')](_0x20c8f4['UserId'])){_0x3a8d6c[_0x49a5('0xe')][_0x49a5('0xf')]({'where':{'id':_0x20c8f4[_0x49a5('0x10')]}})[_0x49a5('0x11')](function(_0x49e7a9){if(_0x49e7a9){_0x49e7a9['update']({'lastMsgAt':_0x20c8f4[_0x49a5('0x12')],'lastMsgDirection':_0x20c8f4[_0x49a5('0xb')][_0x49a5('0x13')]()});}})['catch'](function(_0x1783c9){console[_0x49a5('0x14')](_0x1783c9);});}_0x3cd2fd();}},'charset':_0x49a5('0x15'),'collate':_0x49a5('0x16')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index aa30471..b5838fc 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 _0xcbf1=['util','moment','bluebird','ioredis','../../config/utils','rpc','client','redis','localhost','socket.io-emitter','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateChatMessage','ChatMessage','create','body','options','raw','debug','lodash'];(function(_0x2e9187,_0x3763f6){var _0x1fc3a8=function(_0xb30d96){while(--_0xb30d96){_0x2e9187['push'](_0x2e9187['shift']());}};_0x1fc3a8(++_0x3763f6);}(_0xcbf1,0xbc));var _0x1cbf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcbf1[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1cbf('0x0'));var util=require(_0x1cbf('0x1'));var moment=require(_0x1cbf('0x2'));var BPromise=require(_0x1cbf('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1cbf('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cbf('0x5'));var logger=require('../../config/logger')(_0x1cbf('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1cbf('0x7')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x1cbf('0x8')],{'host':_0x1cbf('0x9'),'port':0x18eb});var socket=require(_0x1cbf('0xa'))(new Redis(config[_0x1cbf('0x8')]));require('./chatMessage.socket')['register'](socket);function respondWithRpcPromise(_0x240ccd,_0x54ace4,_0x3583d2){return new BPromise(function(_0x324f55,_0x27b7f0){return client['request'](_0x240ccd,_0x3583d2)[_0x1cbf('0xb')](function(_0x95542e){logger[_0x1cbf('0xc')](_0x1cbf('0xd'),_0x54ace4,_0x1cbf('0xe'));logger['debug'](_0x1cbf('0xf'),_0x54ace4,_0x1cbf('0xe'),JSON['stringify'](_0x95542e));if(_0x95542e[_0x1cbf('0x10')]){if(_0x95542e[_0x1cbf('0x10')][_0x1cbf('0x11')]===0x1f4){logger[_0x1cbf('0x10')](_0x1cbf('0xd'),_0x54ace4,_0x95542e['error']['message']);return _0x27b7f0(_0x95542e[_0x1cbf('0x10')][_0x1cbf('0x12')]);}logger[_0x1cbf('0x10')]('ChatMessage,\x20%s,\x20%s',_0x54ace4,_0x95542e[_0x1cbf('0x10')]['message']);return _0x324f55(_0x95542e[_0x1cbf('0x10')][_0x1cbf('0x12')]);}else{logger[_0x1cbf('0xc')](_0x1cbf('0xd'),_0x54ace4,'request\x20sent');_0x324f55(_0x95542e['result'][_0x1cbf('0x12')]);}})[_0x1cbf('0x13')](function(_0x4dd30d){logger[_0x1cbf('0x10')](_0x1cbf('0xd'),_0x54ace4,_0x4dd30d);_0x27b7f0(_0x4dd30d);});});}exports[_0x1cbf('0x14')]=function(_0x307c5e){var _0x922c07=this;return new Promise(function(_0x3eac6a,_0x5cf70f){return db[_0x1cbf('0x15')][_0x1cbf('0x16')](_0x307c5e[_0x1cbf('0x17')],{'raw':_0x307c5e[_0x1cbf('0x18')]?_0x307c5e[_0x1cbf('0x18')][_0x1cbf('0x19')]===undefined?!![]:![]:!![]})[_0x1cbf('0xb')](function(_0x3a7924){logger['info'](_0x1cbf('0x14'),_0x307c5e);logger[_0x1cbf('0x1a')](_0x1cbf('0x14'),_0x307c5e,JSON['stringify'](_0x3a7924));_0x3eac6a(_0x3a7924);})[_0x1cbf('0x13')](function(_0x59f5f6){logger[_0x1cbf('0x10')]('CreateChatMessage',_0x59f5f6[_0x1cbf('0x12')],_0x307c5e);_0x5cf70f(_0x922c07['error'](0x1f4,_0x59f5f6[_0x1cbf('0x12')]));});});}; \ No newline at end of file +var _0x9e25=['util','moment','ioredis','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateChatMessage','ChatMessage','create','body','options','lodash'];(function(_0x274fd0,_0x24bbde){var _0x134e80=function(_0x5bca6a){while(--_0x5bca6a){_0x274fd0['push'](_0x274fd0['shift']());}};_0x134e80(++_0x24bbde);}(_0x9e25,0x104));var _0x59e2=function(_0x3c2b57,_0x3c818b){_0x3c2b57=_0x3c2b57-0x0;var _0x314adf=_0x9e25[_0x3c2b57];return _0x314adf;};'use strict';var _=require(_0x59e2('0x0'));var util=require(_0x59e2('0x1'));var moment=require(_0x59e2('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x59e2('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x59e2('0x4'));var config=require('../../config/environment');var jayson=require(_0x59e2('0x5'));var client=jayson[_0x59e2('0x6')][_0x59e2('0x7')]({'port':0x232a});config[_0x59e2('0x8')]=_[_0x59e2('0x9')](config[_0x59e2('0x8')],{'host':_0x59e2('0xa'),'port':0x18eb});var socket=require(_0x59e2('0xb'))(new Redis(config[_0x59e2('0x8')]));require('./chatMessage.socket')['register'](socket);function respondWithRpcPromise(_0x53db60,_0x51d972,_0x937e00){return new BPromise(function(_0xa5faa7,_0x2c942f){return client[_0x59e2('0xc')](_0x53db60,_0x937e00)[_0x59e2('0xd')](function(_0x292ef6){logger[_0x59e2('0xe')](_0x59e2('0xf'),_0x51d972,_0x59e2('0x10'));logger[_0x59e2('0x11')](_0x59e2('0x12'),_0x51d972,'request\x20sent',JSON[_0x59e2('0x13')](_0x292ef6));if(_0x292ef6[_0x59e2('0x14')]){if(_0x292ef6[_0x59e2('0x14')][_0x59e2('0x15')]===0x1f4){logger['error'](_0x59e2('0xf'),_0x51d972,_0x292ef6[_0x59e2('0x14')][_0x59e2('0x16')]);return _0x2c942f(_0x292ef6[_0x59e2('0x14')][_0x59e2('0x16')]);}logger[_0x59e2('0x14')](_0x59e2('0xf'),_0x51d972,_0x292ef6[_0x59e2('0x14')][_0x59e2('0x16')]);return _0xa5faa7(_0x292ef6[_0x59e2('0x14')][_0x59e2('0x16')]);}else{logger[_0x59e2('0xe')](_0x59e2('0xf'),_0x51d972,_0x59e2('0x10'));_0xa5faa7(_0x292ef6['result']['message']);}})[_0x59e2('0x17')](function(_0x4294b1){logger[_0x59e2('0x14')](_0x59e2('0xf'),_0x51d972,_0x4294b1);_0x2c942f(_0x4294b1);});});}exports[_0x59e2('0x18')]=function(_0x2f8a90){var _0x422151=this;return new Promise(function(_0x5e8940,_0x263f9f){return db[_0x59e2('0x19')][_0x59e2('0x1a')](_0x2f8a90[_0x59e2('0x1b')],{'raw':_0x2f8a90[_0x59e2('0x1c')]?_0x2f8a90[_0x59e2('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0x59e2('0xd')](function(_0x4643b4){logger[_0x59e2('0xe')](_0x59e2('0x18'),_0x2f8a90);logger['debug']('CreateChatMessage',_0x2f8a90,JSON[_0x59e2('0x13')](_0x4643b4));_0x5e8940(_0x4643b4);})[_0x59e2('0x17')](function(_0x19cd94){logger[_0x59e2('0x14')](_0x59e2('0x18'),_0x19cd94[_0x59e2('0x16')],_0x2f8a90);_0x263f9f(_0x422151[_0x59e2('0x14')](0x1f4,_0x19cd94['message']));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index dcf4970..35ae795 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 _0x187d=['./chatMessage.events','remove','update','emit','removeListener','length','chatMessage:'];(function(_0x447b2b,_0x5bbcc5){var _0x471d98=function(_0x44cc0d){while(--_0x44cc0d){_0x447b2b['push'](_0x447b2b['shift']());}};_0x471d98(++_0x5bbcc5);}(_0x187d,0x93));var _0xd187=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0x187d[_0x37c22c];return _0x119d79;};'use strict';var ChatMessageEvents=require(_0xd187('0x0'));var events=['save',_0xd187('0x1'),_0xd187('0x2')];function createListener(_0x44d5f6,_0x1cb41f){return function(_0x18498b){_0x1cb41f[_0xd187('0x3')](_0x44d5f6,_0x18498b);};}function removeListener(_0x58622a,_0x28fa0b){return function(){ChatMessageEvents[_0xd187('0x4')](_0x58622a,_0x28fa0b);};}exports['register']=function(_0x1d2533){for(var _0x58ee7=0x0,_0x444a60=events[_0xd187('0x5')];_0x58ee7<_0x444a60;_0x58ee7++){var _0x28ce2f=events[_0x58ee7];var _0x2d6992=createListener(_0xd187('0x6')+_0x28ce2f,_0x1d2533);ChatMessageEvents['on'](_0x28ce2f,_0x2d6992);}}; \ No newline at end of file +var _0x5f2f=['remove','update','emit','removeListener','register','length','chatMessage:','./chatMessage.events','save'];(function(_0x4812e0,_0x2ccf3c){var _0x252e0f=function(_0x14cdb8){while(--_0x14cdb8){_0x4812e0['push'](_0x4812e0['shift']());}};_0x252e0f(++_0x2ccf3c);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1ebf2c,_0x2455ac){_0x1ebf2c=_0x1ebf2c-0x0;var _0x5807ee=_0x5f2f[_0x1ebf2c];return _0x5807ee;};'use strict';var ChatMessageEvents=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(){ChatMessageEvents[_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);ChatMessageEvents['on'](_0x5907aa,_0x466882);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 4dea795..7f100b6 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 _0x05b3=['/:id','tracked','chat','chatmessage:create','create','put','update','/:id/accept','accept','/:id/reject','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index'];(function(_0x523542,_0x20539a){var _0x33727e=function(_0x5c7e0f){while(--_0x5c7e0f){_0x523542['push'](_0x523542['shift']());}};_0x33727e(++_0x20539a);}(_0x05b3,0x183));var _0x305b=function(_0x3b0912,_0x39d739){_0x3b0912=_0x3b0912-0x0;var _0xa8f339=_0x05b3[_0x3b0912];return _0xa8f339;};'use strict';var multer=require(_0x305b('0x0'));var util=require(_0x305b('0x1'));var path=require(_0x305b('0x2'));var timeout=require(_0x305b('0x3'));var express=require(_0x305b('0x4'));var router=express[_0x305b('0x5')]();var auth=require(_0x305b('0x6'));var interaction=require(_0x305b('0x7'));var config=require(_0x305b('0x8'));var controller=require(_0x305b('0x9'));router[_0x305b('0xa')]('/',auth[_0x305b('0xb')](),controller[_0x305b('0xc')]);router[_0x305b('0xa')]('/describe',auth[_0x305b('0xb')](),controller['describe']);router[_0x305b('0xa')](_0x305b('0xd'),auth[_0x305b('0xb')](),controller['show']);router['post']('/',auth[_0x305b('0xb')](),interaction[_0x305b('0xe')](_0x305b('0xf'),_0x305b('0x10')),controller[_0x305b('0x11')]);router[_0x305b('0x12')]('/:id',controller[_0x305b('0x13')]);router[_0x305b('0x12')](_0x305b('0x14'),auth[_0x305b('0xb')](),controller[_0x305b('0x15')]);router[_0x305b('0x12')](_0x305b('0x16'),auth['isAuthenticated'](),controller['reject']);router['delete'](_0x305b('0xd'),auth[_0x305b('0xb')](),controller[_0x305b('0x17')]);module[_0x305b('0x18')]=router; \ No newline at end of file +var _0xf981=['show','post','tracked','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','path','express','Router','../../components/auth/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0xc0754,_0x37f107){var _0x195498=function(_0x23dba7){while(--_0x23dba7){_0xc0754['push'](_0xc0754['shift']());}};_0x195498(++_0x37f107);}(_0xf981,0x1ee));var _0x1f98=function(_0x57dd45,_0x4b76b0){_0x57dd45=_0x57dd45-0x0;var _0x47d2d9=_0xf981[_0x57dd45];return _0x47d2d9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1f98('0x0'));var timeout=require('connect-timeout');var express=require(_0x1f98('0x1'));var router=express[_0x1f98('0x2')]();var auth=require(_0x1f98('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x1f98('0x4'));var controller=require(_0x1f98('0x5'));router[_0x1f98('0x6')]('/',auth[_0x1f98('0x7')](),controller[_0x1f98('0x8')]);router[_0x1f98('0x6')](_0x1f98('0x9'),auth['isAuthenticated'](),controller[_0x1f98('0xa')]);router['get'](_0x1f98('0xb'),auth[_0x1f98('0x7')](),controller[_0x1f98('0xc')]);router[_0x1f98('0xd')]('/',auth[_0x1f98('0x7')](),interaction[_0x1f98('0xe')]('chat','chatmessage:create'),controller['create']);router[_0x1f98('0xf')]('/:id',controller['update']);router[_0x1f98('0xf')](_0x1f98('0x10'),auth[_0x1f98('0x7')](),controller[_0x1f98('0x11')]);router[_0x1f98('0xf')](_0x1f98('0x12'),auth[_0x1f98('0x7')](),controller[_0x1f98('0x13')]);router[_0x1f98('0x14')](_0x1f98('0xb'),auth[_0x1f98('0x7')](),controller[_0x1f98('0x15')]);module[_0x1f98('0x16')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index b525d98..f085d90 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 _0x42a3=['medium','exports'];(function(_0x25a597,_0xa4ae6d){var _0x2a5eb4=function(_0x3e36cb){while(--_0x3e36cb){_0x25a597['push'](_0x25a597['shift']());}};_0x2a5eb4(++_0xa4ae6d);}(_0x42a3,0x1e3));var _0x342a=function(_0x3ebffe,_0x36e9d4){_0x3ebffe=_0x3ebffe-0x0;var _0x44568b=_0x42a3[_0x3ebffe];return _0x44568b;};'use strict';var Sequelize=require('sequelize');module[_0x342a('0x0')]={'body':{'type':Sequelize['TEXT'](_0x342a('0x1')),'allowNull':![]}}; \ No newline at end of file +var _0xbf25=['medium','exports','TEXT'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0xbf25,0x1ab));var _0x5bf2=function(_0x348525,_0x3dc0dd){_0x348525=_0x348525-0x0;var _0x34d503=_0xbf25[_0x348525];return _0x34d503;};'use strict';var Sequelize=require('sequelize');module[_0x5bf2('0x0')]={'body':{'type':Sequelize[_0x5bf2('0x1')](_0x5bf2('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 58dac37..9103445 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 _0x993e=['set','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','sort','pick','where','merge','VIRTUAL','filter','options','ChatOfflineMessage','includeAll','findAll','catch','params','length','find','create','body','update','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','json','count','offset','limit'];(function(_0x3ec5a3,_0x40cac0){var _0x3bc8dc=function(_0x240980){while(--_0x240980){_0x3ec5a3['push'](_0x3ec5a3['shift']());}};_0x3bc8dc(++_0x40cac0);}(_0x993e,0x1d5));var _0xe993=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x993e[_0x122ef9];return _0x42fba0;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xe993('0x0'));var zipdir=require(_0xe993('0x1'));var jsonpatch=require(_0xe993('0x2'));var rp=require(_0xe993('0x3'));var moment=require(_0xe993('0x4'));var BPromise=require(_0xe993('0x5'));var Mustache=require(_0xe993('0x6'));var util=require(_0xe993('0x7'));var path=require(_0xe993('0x8'));var sox=require(_0xe993('0x9'));var csv=require('to-csv');var ejs=require(_0xe993('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xe993('0xb'));var crypto=require('crypto');var jsforce=require(_0xe993('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xe993('0xd'));var querystring=require(_0xe993('0xe'));var Papa=require('papaparse');var Redis=require(_0xe993('0xf'));var authService=require(_0xe993('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xe993('0x11'));var hardwareService=require(_0xe993('0x12'));var logger=require('../../config/logger')(_0xe993('0x13'));var utils=require(_0xe993('0x14'));var config=require(_0xe993('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5ac7a3,_0x27c3fc){_0x27c3fc=_0x27c3fc||0xcc;return function(_0x208522){if(_0x208522){return _0x5ac7a3[_0xe993('0x16')](_0x27c3fc);}return _0x5ac7a3[_0xe993('0x17')](_0x27c3fc)['end']();};}function respondWithResult(_0x478d3f,_0x5c07dc){_0x5c07dc=_0x5c07dc||0xc8;return function(_0x3aab92){if(_0x3aab92){return _0x478d3f[_0xe993('0x17')](_0x5c07dc)[_0xe993('0x18')](_0x3aab92);}};}function respondWithFilteredResult(_0x4ea8e0,_0x17a974){return function(_0x1cd682){if(_0x1cd682){var _0x3593df=_0x1cd682[_0xe993('0x19')],_0x4dc2c5=_0x17a974[_0xe993('0x1a')],_0x56f3a7=_0x17a974[_0xe993('0x1a')]+_0x17a974[_0xe993('0x1b')],_0x26fed6;if(_0x56f3a7>=_0x3593df){_0x56f3a7=_0x3593df;_0x26fed6=0xc8;}else{_0x26fed6=0xce;}_0x4ea8e0[_0xe993('0x17')](_0x26fed6);return _0x4ea8e0[_0xe993('0x1c')](_0xe993('0x1d'),_0x4dc2c5+'-'+_0x56f3a7+'/'+_0x3593df)['json'](_0x1cd682);}return null;};}function patchUpdates(_0x577d08){return function(_0xafb96f){try{jsonpatch[_0xe993('0x1e')](_0xafb96f,_0x577d08,!![]);}catch(_0x695d05){return BPromise[_0xe993('0x1f')](_0x695d05);}return _0xafb96f[_0xe993('0x20')]();};}function saveUpdates(_0x272953,_0x2e6234){return function(_0x18946c){if(_0x18946c){return _0x18946c['update'](_0x272953)[_0xe993('0x21')](function(_0x3f2e49){return _0x3f2e49;});}return null;};}function removeEntity(_0x2bb53d,_0x4ffd0c){return function(_0x24a984){if(_0x24a984){return _0x24a984[_0xe993('0x22')]()[_0xe993('0x21')](function(){_0x2bb53d[_0xe993('0x17')](0xcc)[_0xe993('0x23')]();});}};}function handleEntityNotFound(_0x5eec0b,_0x2f8f84){return function(_0x2fb4ad){if(!_0x2fb4ad){_0x5eec0b[_0xe993('0x16')](0x194);}return _0x2fb4ad;};}function handleError(_0x57d360,_0x5ac5ea){_0x5ac5ea=_0x5ac5ea||0x1f4;return function(_0x40d99c){logger[_0xe993('0x24')](_0x40d99c[_0xe993('0x25')]);if(_0x40d99c[_0xe993('0x26')]){delete _0x40d99c[_0xe993('0x26')];}_0x57d360['status'](_0x5ac5ea)[_0xe993('0x27')](_0x40d99c);};}exports[_0xe993('0x28')]=function(_0x41d72c,_0x11ef0e){var _0x7762aa={},_0x43cf01={},_0x3c2b4e={'count':0x0,'rows':[]};var _0x2b5d7a=_[_0xe993('0x29')](db['ChatOfflineMessage'][_0xe993('0x2a')],function(_0x10be2d){return{'name':_0x10be2d['fieldName'],'type':_0x10be2d[_0xe993('0x2b')][_0xe993('0x2c')]};});_0x43cf01[_0xe993('0x2d')]=_['map'](_0x2b5d7a,_0xe993('0x26'));_0x43cf01[_0xe993('0x2e')]=_[_0xe993('0x2f')](_0x41d72c['query']);_0x43cf01[_0xe993('0x30')]=_[_0xe993('0x31')](_0x43cf01[_0xe993('0x2d')],_0x43cf01[_0xe993('0x2e')]);_0x7762aa[_0xe993('0x32')]=_[_0xe993('0x31')](_0x43cf01[_0xe993('0x2d')],qs['fields'](_0x41d72c[_0xe993('0x2e')][_0xe993('0x33')]));_0x7762aa[_0xe993('0x32')]=_0x7762aa['attributes']['length']?_0x7762aa[_0xe993('0x32')]:_0x43cf01[_0xe993('0x2d')];if(!_0x41d72c[_0xe993('0x2e')]['hasOwnProperty'](_0xe993('0x34'))){_0x7762aa['limit']=qs[_0xe993('0x1b')](_0x41d72c[_0xe993('0x2e')][_0xe993('0x1b')]);_0x7762aa['offset']=qs[_0xe993('0x1a')](_0x41d72c[_0xe993('0x2e')][_0xe993('0x1a')]);}_0x7762aa['order']=qs[_0xe993('0x35')](_0x41d72c['query'][_0xe993('0x35')]);_0x7762aa['where']=qs[_0xe993('0x30')](_[_0xe993('0x36')](_0x41d72c[_0xe993('0x2e')],_0x43cf01[_0xe993('0x30')]));if(_0x41d72c[_0xe993('0x2e')]['filter']){_0x7762aa[_0xe993('0x37')]=_[_0xe993('0x38')](_0x7762aa['where'],{'$or':_[_0xe993('0x29')](_0x2b5d7a,function(_0x1fd642){if(_0x1fd642['type']!==_0xe993('0x39')){var _0x2891d9={};_0x2891d9[_0x1fd642[_0xe993('0x26')]]={'$like':'%'+_0x41d72c['query'][_0xe993('0x3a')]+'%'};return _0x2891d9;}})});}_0x7762aa=_[_0xe993('0x38')]({},_0x7762aa,_0x41d72c[_0xe993('0x3b')]);var _0x70ac45={'where':_0x7762aa['where']};return db[_0xe993('0x3c')]['count'](_0x70ac45)[_0xe993('0x21')](function(_0xe443f2){_0x3c2b4e[_0xe993('0x19')]=_0xe443f2;if(_0x41d72c[_0xe993('0x2e')][_0xe993('0x3d')]){_0x7762aa['include']=[{'all':!![]}];}return db[_0xe993('0x3c')][_0xe993('0x3e')](_0x7762aa);})[_0xe993('0x21')](function(_0x22a318){_0x3c2b4e['rows']=_0x22a318;return _0x3c2b4e;})[_0xe993('0x21')](respondWithFilteredResult(_0x11ef0e,_0x7762aa))[_0xe993('0x3f')](handleError(_0x11ef0e,null));};exports['show']=function(_0x4ac80a,_0x31327e){var _0x6b4ffc={'raw':!![],'where':{'id':_0x4ac80a[_0xe993('0x40')]['id']}},_0x52f0e0={};_0x52f0e0[_0xe993('0x2d')]=_[_0xe993('0x2f')](db[_0xe993('0x3c')]['rawAttributes']);_0x52f0e0['query']=_[_0xe993('0x2f')](_0x4ac80a[_0xe993('0x2e')]);_0x52f0e0['filters']=_[_0xe993('0x31')](_0x52f0e0[_0xe993('0x2d')],_0x52f0e0[_0xe993('0x2e')]);_0x6b4ffc['attributes']=_[_0xe993('0x31')](_0x52f0e0['model'],qs[_0xe993('0x33')](_0x4ac80a[_0xe993('0x2e')]['fields']));_0x6b4ffc[_0xe993('0x32')]=_0x6b4ffc[_0xe993('0x32')][_0xe993('0x41')]?_0x6b4ffc[_0xe993('0x32')]:_0x52f0e0['model'];if(_0x4ac80a[_0xe993('0x2e')]['includeAll']){_0x6b4ffc['include']=[{'all':!![]}];}_0x6b4ffc=_['merge']({},_0x6b4ffc,_0x4ac80a['options']);return db[_0xe993('0x3c')][_0xe993('0x42')](_0x6b4ffc)[_0xe993('0x21')](handleEntityNotFound(_0x31327e,null))[_0xe993('0x21')](respondWithResult(_0x31327e,null))[_0xe993('0x3f')](handleError(_0x31327e,null));};exports[_0xe993('0x43')]=function(_0x9783b9,_0x346bf0){return db[_0xe993('0x3c')]['create'](_0x9783b9[_0xe993('0x44')],{})[_0xe993('0x21')](respondWithResult(_0x346bf0,0xc9))['catch'](handleError(_0x346bf0,null));};exports[_0xe993('0x45')]=function(_0x4f7f6f,_0x3613ea){if(_0x4f7f6f[_0xe993('0x44')]['id']){delete _0x4f7f6f[_0xe993('0x44')]['id'];}return db[_0xe993('0x3c')]['find']({'where':{'id':_0x4f7f6f[_0xe993('0x40')]['id']}})[_0xe993('0x21')](handleEntityNotFound(_0x3613ea,null))['then'](saveUpdates(_0x4f7f6f[_0xe993('0x44')],null))['then'](respondWithResult(_0x3613ea,null))[_0xe993('0x3f')](handleError(_0x3613ea,null));};exports[_0xe993('0x22')]=function(_0xa7e269,_0x3d421a){return db[_0xe993('0x3c')][_0xe993('0x42')]({'where':{'id':_0xa7e269[_0xe993('0x40')]['id']}})[_0xe993('0x21')](handleEntityNotFound(_0x3d421a,null))['then'](removeEntity(_0x3d421a,null))['catch'](handleError(_0x3d421a,null));};exports['describe']=function(_0x2f109b,_0x3f39c0){return db[_0xe993('0x3c')][_0xe993('0x46')]()['then'](respondWithResult(_0x3f39c0,null))[_0xe993('0x3f')](handleError(_0x3f39c0,null));}; \ No newline at end of file +var _0x6d42=['../../config/utils','status','json','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','map','ChatOfflineMessage','rawAttributes','fieldName','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','offset','order','sort','filters','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','show','params','catch','create','body','find','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x18cce1,_0x385c20){var _0x2507b0=function(_0x7bd6b9){while(--_0x7bd6b9){_0x18cce1['push'](_0x18cce1['shift']());}};_0x2507b0(++_0x385c20);}(_0x6d42,0x15c));var _0x26d4=function(_0x44ef7f,_0x4d3267){_0x44ef7f=_0x44ef7f-0x0;var _0x222c6a=_0x6d42[_0x44ef7f];return _0x222c6a;};'use strict';var pdf=require(_0x26d4('0x0'));var emlformat=require(_0x26d4('0x1'));var rimraf=require(_0x26d4('0x2'));var zipdir=require(_0x26d4('0x3'));var jsonpatch=require(_0x26d4('0x4'));var rp=require(_0x26d4('0x5'));var moment=require(_0x26d4('0x6'));var BPromise=require(_0x26d4('0x7'));var Mustache=require(_0x26d4('0x8'));var util=require(_0x26d4('0x9'));var path=require('path');var sox=require(_0x26d4('0xa'));var csv=require(_0x26d4('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x26d4('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x26d4('0xd'));var toCsv=require(_0x26d4('0xb'));var querystring=require(_0x26d4('0xe'));var Papa=require(_0x26d4('0xf'));var Redis=require(_0x26d4('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x26d4('0x11'));var as=require(_0x26d4('0x12'));var hardwareService=require(_0x26d4('0x13'));var logger=require(_0x26d4('0x14'))(_0x26d4('0x15'));var utils=require(_0x26d4('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5b14be,_0x57c3ba){_0x57c3ba=_0x57c3ba||0xcc;return function(_0x2d30b3){if(_0x2d30b3){return _0x5b14be['sendStatus'](_0x57c3ba);}return _0x5b14be[_0x26d4('0x17')](_0x57c3ba)['end']();};}function respondWithResult(_0x3d21f9,_0x418505){_0x418505=_0x418505||0xc8;return function(_0x54d711){if(_0x54d711){return _0x3d21f9[_0x26d4('0x17')](_0x418505)[_0x26d4('0x18')](_0x54d711);}};}function respondWithFilteredResult(_0x2782a6,_0x110731){return function(_0x332ab2){if(_0x332ab2){var _0x3b5706=_0x332ab2[_0x26d4('0x19')],_0x2a915c=_0x110731['offset'],_0x37b733=_0x110731['offset']+_0x110731[_0x26d4('0x1a')],_0xf3faef;if(_0x37b733>=_0x3b5706){_0x37b733=_0x3b5706;_0xf3faef=0xc8;}else{_0xf3faef=0xce;}_0x2782a6['status'](_0xf3faef);return _0x2782a6[_0x26d4('0x1b')](_0x26d4('0x1c'),_0x2a915c+'-'+_0x37b733+'/'+_0x3b5706)[_0x26d4('0x18')](_0x332ab2);}return null;};}function patchUpdates(_0x184f30){return function(_0x14ee6f){try{jsonpatch[_0x26d4('0x1d')](_0x14ee6f,_0x184f30,!![]);}catch(_0x5b24da){return BPromise[_0x26d4('0x1e')](_0x5b24da);}return _0x14ee6f[_0x26d4('0x1f')]();};}function saveUpdates(_0x392038,_0xc42db9){return function(_0xf2f735){if(_0xf2f735){return _0xf2f735[_0x26d4('0x20')](_0x392038)[_0x26d4('0x21')](function(_0x3951a3){return _0x3951a3;});}return null;};}function removeEntity(_0x283d67,_0x22faed){return function(_0x127b67){if(_0x127b67){return _0x127b67[_0x26d4('0x22')]()[_0x26d4('0x21')](function(){_0x283d67[_0x26d4('0x17')](0xcc)[_0x26d4('0x23')]();});}};}function handleEntityNotFound(_0x22962f,_0x5a9b27){return function(_0x573734){if(!_0x573734){_0x22962f['sendStatus'](0x194);}return _0x573734;};}function handleError(_0xa66538,_0x45b927){_0x45b927=_0x45b927||0x1f4;return function(_0x58ccb9){logger[_0x26d4('0x24')](_0x58ccb9['stack']);if(_0x58ccb9[_0x26d4('0x25')]){delete _0x58ccb9[_0x26d4('0x25')];}_0xa66538[_0x26d4('0x17')](_0x45b927)[_0x26d4('0x26')](_0x58ccb9);};}exports[_0x26d4('0x27')]=function(_0xb7b75e,_0x5efbe8){var _0x2c234e={},_0x2b3226={},_0x347d4f={'count':0x0,'rows':[]};var _0x21da20=_[_0x26d4('0x28')](db[_0x26d4('0x29')][_0x26d4('0x2a')],function(_0x467e84){return{'name':_0x467e84[_0x26d4('0x2b')],'type':_0x467e84[_0x26d4('0x2c')]['key']};});_0x2b3226[_0x26d4('0x2d')]=_[_0x26d4('0x28')](_0x21da20,_0x26d4('0x25'));_0x2b3226[_0x26d4('0x2e')]=_[_0x26d4('0x2f')](_0xb7b75e[_0x26d4('0x2e')]);_0x2b3226['filters']=_[_0x26d4('0x30')](_0x2b3226[_0x26d4('0x2d')],_0x2b3226[_0x26d4('0x2e')]);_0x2c234e['attributes']=_[_0x26d4('0x30')](_0x2b3226[_0x26d4('0x2d')],qs[_0x26d4('0x31')](_0xb7b75e[_0x26d4('0x2e')][_0x26d4('0x31')]));_0x2c234e[_0x26d4('0x32')]=_0x2c234e[_0x26d4('0x32')][_0x26d4('0x33')]?_0x2c234e[_0x26d4('0x32')]:_0x2b3226[_0x26d4('0x2d')];if(!_0xb7b75e['query'][_0x26d4('0x34')](_0x26d4('0x35'))){_0x2c234e[_0x26d4('0x1a')]=qs['limit'](_0xb7b75e[_0x26d4('0x2e')][_0x26d4('0x1a')]);_0x2c234e[_0x26d4('0x36')]=qs['offset'](_0xb7b75e[_0x26d4('0x2e')][_0x26d4('0x36')]);}_0x2c234e[_0x26d4('0x37')]=qs['sort'](_0xb7b75e[_0x26d4('0x2e')][_0x26d4('0x38')]);_0x2c234e['where']=qs[_0x26d4('0x39')](_[_0x26d4('0x3a')](_0xb7b75e[_0x26d4('0x2e')],_0x2b3226[_0x26d4('0x39')]));if(_0xb7b75e[_0x26d4('0x2e')][_0x26d4('0x3b')]){_0x2c234e['where']=_[_0x26d4('0x3c')](_0x2c234e[_0x26d4('0x3d')],{'$or':_[_0x26d4('0x28')](_0x21da20,function(_0xbd0c3c){if(_0xbd0c3c[_0x26d4('0x2c')]!==_0x26d4('0x3e')){var _0x57e597={};_0x57e597[_0xbd0c3c['name']]={'$like':'%'+_0xb7b75e['query'][_0x26d4('0x3b')]+'%'};return _0x57e597;}})});}_0x2c234e=_[_0x26d4('0x3c')]({},_0x2c234e,_0xb7b75e[_0x26d4('0x3f')]);var _0x22d2fd={'where':_0x2c234e['where']};return db[_0x26d4('0x29')][_0x26d4('0x19')](_0x22d2fd)[_0x26d4('0x21')](function(_0x26eaf6){_0x347d4f['count']=_0x26eaf6;if(_0xb7b75e['query'][_0x26d4('0x40')]){_0x2c234e[_0x26d4('0x41')]=[{'all':!![]}];}return db['ChatOfflineMessage'][_0x26d4('0x42')](_0x2c234e);})['then'](function(_0x3fd8fd){_0x347d4f['rows']=_0x3fd8fd;return _0x347d4f;})[_0x26d4('0x21')](respondWithFilteredResult(_0x5efbe8,_0x2c234e))['catch'](handleError(_0x5efbe8,null));};exports[_0x26d4('0x43')]=function(_0x31c352,_0x530134){var _0x2cf3d5={'raw':!![],'where':{'id':_0x31c352[_0x26d4('0x44')]['id']}},_0x25fa8c={};_0x25fa8c[_0x26d4('0x2d')]=_['keys'](db['ChatOfflineMessage'][_0x26d4('0x2a')]);_0x25fa8c[_0x26d4('0x2e')]=_[_0x26d4('0x2f')](_0x31c352[_0x26d4('0x2e')]);_0x25fa8c['filters']=_[_0x26d4('0x30')](_0x25fa8c['model'],_0x25fa8c[_0x26d4('0x2e')]);_0x2cf3d5[_0x26d4('0x32')]=_[_0x26d4('0x30')](_0x25fa8c[_0x26d4('0x2d')],qs['fields'](_0x31c352[_0x26d4('0x2e')][_0x26d4('0x31')]));_0x2cf3d5['attributes']=_0x2cf3d5['attributes'][_0x26d4('0x33')]?_0x2cf3d5[_0x26d4('0x32')]:_0x25fa8c[_0x26d4('0x2d')];if(_0x31c352[_0x26d4('0x2e')][_0x26d4('0x40')]){_0x2cf3d5[_0x26d4('0x41')]=[{'all':!![]}];}_0x2cf3d5=_[_0x26d4('0x3c')]({},_0x2cf3d5,_0x31c352['options']);return db['ChatOfflineMessage']['find'](_0x2cf3d5)[_0x26d4('0x21')](handleEntityNotFound(_0x530134,null))[_0x26d4('0x21')](respondWithResult(_0x530134,null))[_0x26d4('0x45')](handleError(_0x530134,null));};exports[_0x26d4('0x46')]=function(_0xd685f4,_0x80b77f){return db[_0x26d4('0x29')][_0x26d4('0x46')](_0xd685f4[_0x26d4('0x47')],{})['then'](respondWithResult(_0x80b77f,0xc9))[_0x26d4('0x45')](handleError(_0x80b77f,null));};exports[_0x26d4('0x20')]=function(_0x3f9c6f,_0x280697){if(_0x3f9c6f[_0x26d4('0x47')]['id']){delete _0x3f9c6f[_0x26d4('0x47')]['id'];}return db[_0x26d4('0x29')][_0x26d4('0x48')]({'where':{'id':_0x3f9c6f[_0x26d4('0x44')]['id']}})[_0x26d4('0x21')](handleEntityNotFound(_0x280697,null))[_0x26d4('0x21')](saveUpdates(_0x3f9c6f[_0x26d4('0x47')],null))[_0x26d4('0x21')](respondWithResult(_0x280697,null))[_0x26d4('0x45')](handleError(_0x280697,null));};exports[_0x26d4('0x22')]=function(_0x3b7655,_0x1f48e8){return db['ChatOfflineMessage']['find']({'where':{'id':_0x3b7655[_0x26d4('0x44')]['id']}})[_0x26d4('0x21')](handleEntityNotFound(_0x1f48e8,null))[_0x26d4('0x21')](removeEntity(_0x1f48e8,null))[_0x26d4('0x45')](handleError(_0x1f48e8,null));};exports[_0x26d4('0x49')]=function(_0x1a6aca,_0x2b81ad){return db[_0x26d4('0x29')][_0x26d4('0x49')]()['then'](respondWithResult(_0x2b81ad,null))[_0x26d4('0x45')](handleError(_0x2b81ad,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 965b17d..7f80e8f 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 _0x5c12=['request-promise','path','rimraf','../../config/environment','./chatOfflineMessage.attributes','define','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5c12,0x188));var _0x25c1=function(_0x10f6e8,_0x351db6){_0x10f6e8=_0x10f6e8-0x0;var _0x35bb3c=_0x5c12[_0x10f6e8];return _0x35bb3c;};'use strict';var _=require('lodash');var util=require(_0x25c1('0x0'));var logger=require(_0x25c1('0x1'))('api');var moment=require(_0x25c1('0x2'));var BPromise=require(_0x25c1('0x3'));var rp=require(_0x25c1('0x4'));var fs=require('fs');var path=require(_0x25c1('0x5'));var rimraf=require(_0x25c1('0x6'));var config=require(_0x25c1('0x7'));var attributes=require(_0x25c1('0x8'));module['exports']=function(_0x204287,_0x42ac16){return _0x204287[_0x25c1('0x9')]('ChatOfflineMessage',attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x25c1('0xa'),'collate':_0x25c1('0xb')});}; \ No newline at end of file +var _0xb903=['api','bluebird','request-promise','path','rimraf','../../config/environment','./chatOfflineMessage.attributes','exports','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x1406ae,_0x292395){var _0x23a076=function(_0x5e147a){while(--_0x5e147a){_0x1406ae['push'](_0x1406ae['shift']());}};_0x23a076(++_0x292395);}(_0xb903,0x185));var _0x3b90=function(_0x4a2b9a,_0x487c4f){_0x4a2b9a=_0x4a2b9a-0x0;var _0x29596d=_0xb903[_0x4a2b9a];return _0x29596d;};'use strict';var _=require(_0x3b90('0x0'));var util=require(_0x3b90('0x1'));var logger=require(_0x3b90('0x2'))(_0x3b90('0x3'));var moment=require('moment');var BPromise=require(_0x3b90('0x4'));var rp=require(_0x3b90('0x5'));var fs=require('fs');var path=require(_0x3b90('0x6'));var rimraf=require(_0x3b90('0x7'));var config=require(_0x3b90('0x8'));var attributes=require(_0x3b90('0x9'));module[_0x3b90('0xa')]=function(_0x5acd76,_0x15b68f){return _0x5acd76['define']('ChatOfflineMessage',attributes,{'tableName':_0x3b90('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3b90('0xc'),'collate':_0x3b90('0xd')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 835ba69..4913969 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 _0x837c=['info','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x837c,0x11e));var _0xc837=function(_0x55701e,_0x25167e){_0x55701e=_0x55701e-0x0;var _0x409cf9=_0x837c[_0x55701e];return _0x409cf9;};'use strict';var _=require(_0xc837('0x0'));var util=require(_0xc837('0x1'));var moment=require('moment');var BPromise=require(_0xc837('0x2'));var rs=require(_0xc837('0x3'));var fs=require('fs');var Redis=require(_0xc837('0x4'));var db=require(_0xc837('0x5'))['db'];var utils=require(_0xc837('0x6'));var logger=require(_0xc837('0x7'))(_0xc837('0x8'));var config=require(_0xc837('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xc837('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x135b06,_0x582d65,_0x8fb3fc){return new BPromise(function(_0xa8309a,_0xbc5774){return client['request'](_0x135b06,_0x8fb3fc)['then'](function(_0x2bc2bd){logger['info'](_0xc837('0xb'),_0x582d65,_0xc837('0xc'));logger['debug'](_0xc837('0xd'),_0x582d65,_0xc837('0xc'),JSON[_0xc837('0xe')](_0x2bc2bd));if(_0x2bc2bd[_0xc837('0xf')]){if(_0x2bc2bd[_0xc837('0xf')][_0xc837('0x10')]===0x1f4){logger[_0xc837('0xf')](_0xc837('0xb'),_0x582d65,_0x2bc2bd[_0xc837('0xf')][_0xc837('0x11')]);return _0xbc5774(_0x2bc2bd[_0xc837('0xf')][_0xc837('0x11')]);}logger[_0xc837('0xf')]('ChatOfflineMessage,\x20%s,\x20%s',_0x582d65,_0x2bc2bd[_0xc837('0xf')][_0xc837('0x11')]);return _0xa8309a(_0x2bc2bd[_0xc837('0xf')][_0xc837('0x11')]);}else{logger[_0xc837('0x12')](_0xc837('0xb'),_0x582d65,'request\x20sent');_0xa8309a(_0x2bc2bd['result'][_0xc837('0x11')]);}})['catch'](function(_0x2e5bce){logger[_0xc837('0xf')](_0xc837('0xb'),_0x582d65,_0x2e5bce);_0xbc5774(_0x2e5bce);});});} \ No newline at end of file +var _0x9b85=['error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x148d9a,_0x248b35){var _0x30e782=function(_0x51acbf){while(--_0x51acbf){_0x148d9a['push'](_0x148d9a['shift']());}};_0x30e782(++_0x248b35);}(_0x9b85,0x1bd));var _0x59b8=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0x9b85[_0xaa0309];return _0x5de7ce;};'use strict';var _=require(_0x59b8('0x0'));var util=require(_0x59b8('0x1'));var moment=require(_0x59b8('0x2'));var BPromise=require('bluebird');var rs=require(_0x59b8('0x3'));var fs=require('fs');var Redis=require(_0x59b8('0x4'));var db=require(_0x59b8('0x5'))['db'];var utils=require(_0x59b8('0x6'));var logger=require(_0x59b8('0x7'))('rpc');var config=require(_0x59b8('0x8'));var jayson=require(_0x59b8('0x9'));var client=jayson[_0x59b8('0xa')][_0x59b8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x30b9d9,_0x2abc27,_0x1c9276){return new BPromise(function(_0x25b881,_0x38ce29){return client['request'](_0x30b9d9,_0x1c9276)[_0x59b8('0xc')](function(_0x53b48e){logger['info'](_0x59b8('0xd'),_0x2abc27,_0x59b8('0xe'));logger['debug'](_0x59b8('0xf'),_0x2abc27,_0x59b8('0xe'),JSON[_0x59b8('0x10')](_0x53b48e));if(_0x53b48e[_0x59b8('0x11')]){if(_0x53b48e['error'][_0x59b8('0x12')]===0x1f4){logger['error'](_0x59b8('0xd'),_0x2abc27,_0x53b48e[_0x59b8('0x11')]['message']);return _0x38ce29(_0x53b48e[_0x59b8('0x11')]['message']);}logger[_0x59b8('0x11')](_0x59b8('0xd'),_0x2abc27,_0x53b48e[_0x59b8('0x11')][_0x59b8('0x13')]);return _0x25b881(_0x53b48e[_0x59b8('0x11')][_0x59b8('0x13')]);}else{logger['info'](_0x59b8('0xd'),_0x2abc27,_0x59b8('0xe'));_0x25b881(_0x53b48e[_0x59b8('0x14')]['message']);}})['catch'](function(_0x1ef69b){logger[_0x59b8('0x11')](_0x59b8('0xd'),_0x2abc27,_0x1ef69b);_0x38ce29(_0x1ef69b);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index bf4f317..6ef2f0a 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 _0xa822=['show','create','put','delete','/:id','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./chatOfflineMessage.controller','get','/describe','isAuthenticated','describe'];(function(_0x274407,_0x3d748a){var _0x36e818=function(_0x220122){while(--_0x220122){_0x274407['push'](_0x274407['shift']());}};_0x36e818(++_0x3d748a);}(_0xa822,0xdf));var _0x2a82=function(_0x4498a2,_0x143689){_0x4498a2=_0x4498a2-0x0;var _0x411aa8=_0xa822[_0x4498a2];return _0x411aa8;};'use strict';var multer=require(_0x2a82('0x0'));var util=require(_0x2a82('0x1'));var path=require(_0x2a82('0x2'));var timeout=require(_0x2a82('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x2a82('0x4'));var interaction=require(_0x2a82('0x5'));var config=require('../../config/environment');var controller=require(_0x2a82('0x6'));router[_0x2a82('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x2a82('0x7')](_0x2a82('0x8'),auth[_0x2a82('0x9')](),controller[_0x2a82('0xa')]);router['get']('/:id',auth[_0x2a82('0x9')](),controller[_0x2a82('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x2a82('0xc')]);router[_0x2a82('0xd')]('/:id',auth[_0x2a82('0x9')](),controller['update']);router[_0x2a82('0xe')](_0x2a82('0xf'),auth[_0x2a82('0x9')](),controller[_0x2a82('0x10')]);module[_0x2a82('0x11')]=router; \ No newline at end of file +var _0xe9fe=['post','create','put','update','delete','destroy','multer','util','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','isAuthenticated','index','get','/:id','show'];(function(_0x2b5b21,_0x2bf677){var _0x3381f5=function(_0x474b5c){while(--_0x474b5c){_0x2b5b21['push'](_0x2b5b21['shift']());}};_0x3381f5(++_0x2bf677);}(_0xe9fe,0x84));var _0xee9f=function(_0x47408e,_0x481428){_0x47408e=_0x47408e-0x0;var _0x1636bc=_0xe9fe[_0x47408e];return _0x1636bc;};'use strict';var multer=require(_0xee9f('0x0'));var util=require(_0xee9f('0x1'));var path=require('path');var timeout=require(_0xee9f('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0xee9f('0x3'));var interaction=require(_0xee9f('0x4'));var config=require(_0xee9f('0x5'));var controller=require(_0xee9f('0x6'));router['get']('/',auth[_0xee9f('0x7')](),controller[_0xee9f('0x8')]);router[_0xee9f('0x9')]('/describe',auth[_0xee9f('0x7')](),controller['describe']);router[_0xee9f('0x9')](_0xee9f('0xa'),auth[_0xee9f('0x7')](),controller[_0xee9f('0xb')]);router[_0xee9f('0xc')]('/',auth['isAuthenticated'](),controller[_0xee9f('0xd')]);router[_0xee9f('0xe')](_0xee9f('0xa'),auth[_0xee9f('0x7')](),controller[_0xee9f('0xf')]);router[_0xee9f('0x10')](_0xee9f('0xa'),auth['isAuthenticated'](),controller[_0xee9f('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index a545102..be418c2 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 _0xd1af=['INTEGER','exports','STRING','mouseOver','timeout'];(function(_0x3c5e71,_0xfc0c07){var _0x71b974=function(_0x40c7e7){while(--_0x40c7e7){_0x3c5e71['push'](_0x3c5e71['shift']());}};_0x71b974(++_0xfc0c07);}(_0xd1af,0x1c3));var _0xfd1a=function(_0x49b706,_0xaa79e2){_0x49b706=_0x49b706-0x0;var _0x28d62c=_0xd1af[_0x49b706];return _0x28d62c;};'use strict';var Sequelize=require('sequelize');module[_0xfd1a('0x0')]={'name':{'type':Sequelize[_0xfd1a('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xfd1a('0x2'),_0xfd1a('0x3')),'defaultValue':_0xfd1a('0x2')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xfd1a('0x4')]}}; \ No newline at end of file +var _0x719c=['mouseOver','timeout','STRING','INTEGER','sequelize','exports'];(function(_0x4e7d25,_0x58285f){var _0x526fe6=function(_0x4f0aec){while(--_0x4f0aec){_0x4e7d25['push'](_0x4e7d25['shift']());}};_0x526fe6(++_0x58285f);}(_0x719c,0x9a));var _0xc719=function(_0x4621ae,_0xc3158c){_0x4621ae=_0x4621ae-0x0;var _0x1cd6fa=_0x719c[_0x4621ae];return _0x1cd6fa;};'use strict';var Sequelize=require(_0xc719('0x0'));module[_0xc719('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xc719('0x2'),_0xc719('0x3')),'defaultValue':_0xc719('0x2')},'selector':{'type':Sequelize[_0xc719('0x4')]},'timeout':{'type':Sequelize[_0xc719('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 20dbe31..6d55ca1 100644 --- a/server/api/chatProactiveAction/chatProactiveAction.controller.js +++ b/server/api/chatProactiveAction/chatProactiveAction.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['mustache','path','to-csv','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','offset','limit','status','set','Content-Range','apply','reject','update','then','destroy','end','stack','send','show','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','fields','attributes','length','include','options','catch','create','body','find','html-pdf','eml-format','rimraf','request-promise','moment','bluebird'];(function(_0x616d89,_0x45947e){var _0x3fd09c=function(_0x24c03f){while(--_0x24c03f){_0x616d89['push'](_0x616d89['shift']());}};_0x3fd09c(++_0x45947e);}(_0x70e0,0x17b));var _0x070e=function(_0x1604d7,_0x1b0b27){_0x1604d7=_0x1604d7-0x0;var _0x392281=_0x70e0[_0x1604d7];return _0x392281;};'use strict';var pdf=require(_0x070e('0x0'));var emlformat=require(_0x070e('0x1'));var rimraf=require(_0x070e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x070e('0x3'));var moment=require(_0x070e('0x4'));var BPromise=require(_0x070e('0x5'));var Mustache=require(_0x070e('0x6'));var util=require('util');var path=require(_0x070e('0x7'));var sox=require('sox');var csv=require(_0x070e('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x070e('0x9'));var jsforce=require(_0x070e('0xa'));var deskjs=require(_0x070e('0xb'));var toCsv=require(_0x070e('0x8'));var querystring=require(_0x070e('0xc'));var Papa=require(_0x070e('0xd'));var Redis=require(_0x070e('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x070e('0xf'));var hardwareService=require(_0x070e('0x10'));var logger=require(_0x070e('0x11'))(_0x070e('0x12'));var utils=require(_0x070e('0x13'));var config=require(_0x070e('0x14'));var db=require(_0x070e('0x15'))['db'];function respondWithStatusCode(_0x1baa12,_0x39d2b9){_0x39d2b9=_0x39d2b9||0xcc;return function(_0x5bf079){if(_0x5bf079){return _0x1baa12[_0x070e('0x16')](_0x39d2b9);}return _0x1baa12['status'](_0x39d2b9)['end']();};}function respondWithResult(_0x24baba,_0x56c7ba){_0x56c7ba=_0x56c7ba||0xc8;return function(_0x4a33d2){if(_0x4a33d2){return _0x24baba['status'](_0x56c7ba)[_0x070e('0x17')](_0x4a33d2);}};}function respondWithFilteredResult(_0x14c3fd,_0x51d14d){return function(_0x5d3a38){if(_0x5d3a38){var _0x373d86=_0x5d3a38['count'],_0xeae1a5=_0x51d14d['offset'],_0x180897=_0x51d14d[_0x070e('0x18')]+_0x51d14d[_0x070e('0x19')],_0x19d9da;if(_0x180897>=_0x373d86){_0x180897=_0x373d86;_0x19d9da=0xc8;}else{_0x19d9da=0xce;}_0x14c3fd[_0x070e('0x1a')](_0x19d9da);return _0x14c3fd[_0x070e('0x1b')](_0x070e('0x1c'),_0xeae1a5+'-'+_0x180897+'/'+_0x373d86)['json'](_0x5d3a38);}return null;};}function patchUpdates(_0x3938b5){return function(_0x168dc6){try{jsonpatch[_0x070e('0x1d')](_0x168dc6,_0x3938b5,!![]);}catch(_0x3ea105){return BPromise[_0x070e('0x1e')](_0x3ea105);}return _0x168dc6['save']();};}function saveUpdates(_0x5b2f48,_0x4e958f){return function(_0x9907cf){if(_0x9907cf){return _0x9907cf[_0x070e('0x1f')](_0x5b2f48)[_0x070e('0x20')](function(_0x4be0d7){return _0x4be0d7;});}return null;};}function removeEntity(_0x5b184,_0x5dc5d2){return function(_0xf8dd5d){if(_0xf8dd5d){return _0xf8dd5d[_0x070e('0x21')]()[_0x070e('0x20')](function(){_0x5b184[_0x070e('0x1a')](0xcc)[_0x070e('0x22')]();});}};}function handleEntityNotFound(_0xa86797,_0xe405e){return function(_0x164cdf){if(!_0x164cdf){_0xa86797['sendStatus'](0x194);}return _0x164cdf;};}function handleError(_0x2f8055,_0x270061){_0x270061=_0x270061||0x1f4;return function(_0x4790eb){logger['error'](_0x4790eb[_0x070e('0x23')]);if(_0x4790eb['name']){delete _0x4790eb['name'];}_0x2f8055[_0x070e('0x1a')](_0x270061)[_0x070e('0x24')](_0x4790eb);};}exports[_0x070e('0x25')]=function(_0x1743cc,_0x4763c6){var _0x497f58={'raw':!![],'where':{'id':_0x1743cc[_0x070e('0x26')]['id']}},_0x374c54={};_0x374c54[_0x070e('0x27')]=_[_0x070e('0x28')](db[_0x070e('0x29')][_0x070e('0x2a')]);_0x374c54[_0x070e('0x2b')]=_[_0x070e('0x28')](_0x1743cc['query']);_0x374c54[_0x070e('0x2c')]=_[_0x070e('0x2d')](_0x374c54[_0x070e('0x27')],_0x374c54['query']);_0x497f58['attributes']=_[_0x070e('0x2d')](_0x374c54[_0x070e('0x27')],qs[_0x070e('0x2e')](_0x1743cc['query'][_0x070e('0x2e')]));_0x497f58[_0x070e('0x2f')]=_0x497f58[_0x070e('0x2f')][_0x070e('0x30')]?_0x497f58['attributes']:_0x374c54['model'];if(_0x1743cc['query']['includeAll']){_0x497f58[_0x070e('0x31')]=[{'all':!![]}];}_0x497f58=_['merge']({},_0x497f58,_0x1743cc[_0x070e('0x32')]);return db[_0x070e('0x29')]['find'](_0x497f58)['then'](handleEntityNotFound(_0x4763c6,null))[_0x070e('0x20')](respondWithResult(_0x4763c6,null))[_0x070e('0x33')](handleError(_0x4763c6,null));};exports['create']=function(_0x546a16,_0x41ade4){return db[_0x070e('0x29')][_0x070e('0x34')](_0x546a16[_0x070e('0x35')],{})[_0x070e('0x20')](respondWithResult(_0x41ade4,0xc9))['catch'](handleError(_0x41ade4,null));};exports['update']=function(_0x24d17d,_0x3011c4){if(_0x24d17d[_0x070e('0x35')]['id']){delete _0x24d17d[_0x070e('0x35')]['id'];}return db[_0x070e('0x29')]['find']({'where':{'id':_0x24d17d[_0x070e('0x26')]['id']}})[_0x070e('0x20')](handleEntityNotFound(_0x3011c4,null))['then'](saveUpdates(_0x24d17d[_0x070e('0x35')],null))[_0x070e('0x20')](respondWithResult(_0x3011c4,null))['catch'](handleError(_0x3011c4,null));};exports['destroy']=function(_0x5ddbe9,_0x363bff){return db[_0x070e('0x29')][_0x070e('0x36')]({'where':{'id':_0x5ddbe9[_0x070e('0x26')]['id']}})[_0x070e('0x20')](handleEntityNotFound(_0x363bff,null))['then'](removeEntity(_0x363bff,null))[_0x070e('0x33')](handleError(_0x363bff,null));}; \ No newline at end of file +var _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(_0xdefbc3,_0x1ea49a){var _0x367798=function(_0x594678){while(--_0x594678){_0xdefbc3['push'](_0xdefbc3['shift']());}};_0x367798(++_0x1ea49a);}(_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={'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 diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 39f96ac..d8ac396 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 _0xc17c=['ChatProactiveAction','chat_proactive_actions','lodash','../../config/logger','api','request-promise','path','../../config/environment','./chatProactiveAction.attributes','exports','define'];(function(_0x54cd9f,_0xf07b4e){var _0x1501dd=function(_0x1cece2){while(--_0x1cece2){_0x54cd9f['push'](_0x54cd9f['shift']());}};_0x1501dd(++_0xf07b4e);}(_0xc17c,0xf4));var _0xcc17=function(_0x2b5410,_0x464117){_0x2b5410=_0x2b5410-0x0;var _0x25b768=_0xc17c[_0x2b5410];return _0x25b768;};'use strict';var _=require(_0xcc17('0x0'));var util=require('util');var logger=require(_0xcc17('0x1'))(_0xcc17('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xcc17('0x3'));var fs=require('fs');var path=require(_0xcc17('0x4'));var rimraf=require('rimraf');var config=require(_0xcc17('0x5'));var attributes=require(_0xcc17('0x6'));module[_0xcc17('0x7')]=function(_0x229feb,_0xfeed91){return _0x229feb[_0xcc17('0x8')](_0xcc17('0x9'),attributes,{'tableName':_0xcc17('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe56a=['api','moment','rimraf','chat_proactive_actions','lodash','util','../../config/logger'];(function(_0x586c04,_0x7225d1){var _0x3ec54d=function(_0x5111aa){while(--_0x5111aa){_0x586c04['push'](_0x586c04['shift']());}};_0x3ec54d(++_0x7225d1);}(_0xe56a,0x177));var _0xae56=function(_0x568f30,_0x1a3c1a){_0x568f30=_0x568f30-0x0;var _0x162baf=_0xe56a[_0x568f30];return _0x162baf;};'use strict';var _=require(_0xae56('0x0'));var util=require(_0xae56('0x1'));var logger=require(_0xae56('0x2'))(_0xae56('0x3'));var moment=require(_0xae56('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xae56('0x5'));var config=require('../../config/environment');var attributes=require('./chatProactiveAction.attributes');module['exports']=function(_0x4c1bdd,_0xbbafba){return _0x4c1bdd['define']('ChatProactiveAction',attributes,{'tableName':_0xae56('0x6'),'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 86284e2..aa2f508 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 _0x0879=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','then','info','ChatProactiveAction,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','lodash'];(function(_0x4f5a01,_0x590de4){var _0x3c882a=function(_0x260482){while(--_0x260482){_0x4f5a01['push'](_0x4f5a01['shift']());}};_0x3c882a(++_0x590de4);}(_0x0879,0x18e));var _0x9087=function(_0x554344,_0x27f258){_0x554344=_0x554344-0x0;var _0x1b642a=_0x0879[_0x554344];return _0x1b642a;};'use strict';var _=require(_0x9087('0x0'));var util=require(_0x9087('0x1'));var moment=require('moment');var BPromise=require(_0x9087('0x2'));var rs=require(_0x9087('0x3'));var fs=require('fs');var Redis=require(_0x9087('0x4'));var db=require(_0x9087('0x5'))['db'];var utils=require(_0x9087('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x9087('0x7'));var jayson=require(_0x9087('0x8'));var client=jayson[_0x9087('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3791f6,_0x5b23ce,_0x1f259f){return new BPromise(function(_0x27ffc5,_0xc944e8){return client[_0x9087('0xa')](_0x3791f6,_0x1f259f)[_0x9087('0xb')](function(_0x53ebe4){logger[_0x9087('0xc')](_0x9087('0xd'),_0x5b23ce,'request\x20sent');logger[_0x9087('0xe')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x5b23ce,_0x9087('0xf'),JSON['stringify'](_0x53ebe4));if(_0x53ebe4[_0x9087('0x10')]){if(_0x53ebe4[_0x9087('0x10')][_0x9087('0x11')]===0x1f4){logger[_0x9087('0x10')](_0x9087('0xd'),_0x5b23ce,_0x53ebe4['error'][_0x9087('0x12')]);return _0xc944e8(_0x53ebe4[_0x9087('0x10')][_0x9087('0x12')]);}logger[_0x9087('0x10')]('ChatProactiveAction,\x20%s,\x20%s',_0x5b23ce,_0x53ebe4['error'][_0x9087('0x12')]);return _0x27ffc5(_0x53ebe4[_0x9087('0x10')][_0x9087('0x12')]);}else{logger['info'](_0x9087('0xd'),_0x5b23ce,_0x9087('0xf'));_0x27ffc5(_0x53ebe4[_0x9087('0x13')][_0x9087('0x12')]);}})[_0x9087('0x14')](function(_0x474466){logger['error'](_0x9087('0xd'),_0x5b23ce,_0x474466);_0xc944e8(_0x474466);});});} \ No newline at end of file +var _0x80bb=['ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','ChatProactiveAction,\x20%s,\x20%s'];(function(_0xdbd513,_0x204565){var _0x58d7b4=function(_0x34bf59){while(--_0x34bf59){_0xdbd513['push'](_0xdbd513['shift']());}};_0x58d7b4(++_0x204565);}(_0x80bb,0x1d5));var _0xb80b=function(_0x5639a1,_0x1616ab){_0x5639a1=_0x5639a1-0x0;var _0x4ec638=_0x80bb[_0x5639a1];return _0x4ec638;};'use strict';var _=require(_0xb80b('0x0'));var util=require(_0xb80b('0x1'));var moment=require(_0xb80b('0x2'));var BPromise=require(_0xb80b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb80b('0x4'));var db=require(_0xb80b('0x5'))['db'];var utils=require(_0xb80b('0x6'));var logger=require(_0xb80b('0x7'))('rpc');var config=require(_0xb80b('0x8'));var jayson=require(_0xb80b('0x9'));var client=jayson[_0xb80b('0xa')][_0xb80b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3fdbdf,_0x469068,_0x79f5e5){return new BPromise(function(_0x4898a0,_0x59e85e){return client['request'](_0x3fdbdf,_0x79f5e5)[_0xb80b('0xc')](function(_0x3dd0b6){logger[_0xb80b('0xd')](_0xb80b('0xe'),_0x469068,'request\x20sent');logger['debug'](_0xb80b('0xf'),_0x469068,'request\x20sent',JSON[_0xb80b('0x10')](_0x3dd0b6));if(_0x3dd0b6[_0xb80b('0x11')]){if(_0x3dd0b6[_0xb80b('0x11')][_0xb80b('0x12')]===0x1f4){logger[_0xb80b('0x11')](_0xb80b('0xe'),_0x469068,_0x3dd0b6[_0xb80b('0x11')]['message']);return _0x59e85e(_0x3dd0b6[_0xb80b('0x11')][_0xb80b('0x13')]);}logger[_0xb80b('0x11')](_0xb80b('0xe'),_0x469068,_0x3dd0b6[_0xb80b('0x11')][_0xb80b('0x13')]);return _0x4898a0(_0x3dd0b6[_0xb80b('0x11')]['message']);}else{logger[_0xb80b('0xd')](_0xb80b('0xe'),_0x469068,_0xb80b('0x14'));_0x4898a0(_0x3dd0b6[_0xb80b('0x15')]['message']);}})['catch'](function(_0x36afb6){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x469068,_0x36afb6);_0x59e85e(_0x36afb6);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 7643c95..91f11ec 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 _0x9b08=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','show','post','isAuthenticated','create','update','delete','exports','multer','util','express'];(function(_0xefc870,_0x1a024a){var _0x3d6a50=function(_0x6de4a0){while(--_0x6de4a0){_0xefc870['push'](_0xefc870['shift']());}};_0x3d6a50(++_0x1a024a);}(_0x9b08,0x1ea));var _0x89b0=function(_0x4e6ae6,_0x49dba6){_0x4e6ae6=_0x4e6ae6-0x0;var _0x23c108=_0x9b08[_0x4e6ae6];return _0x23c108;};'use strict';var multer=require(_0x89b0('0x0'));var util=require(_0x89b0('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x89b0('0x2'));var router=express[_0x89b0('0x3')]();var auth=require(_0x89b0('0x4'));var interaction=require(_0x89b0('0x5'));var config=require(_0x89b0('0x6'));var controller=require(_0x89b0('0x7'));router[_0x89b0('0x8')](_0x89b0('0x9'),auth['isAuthenticated'](),controller[_0x89b0('0xa')]);router[_0x89b0('0xb')]('/',auth[_0x89b0('0xc')](),controller[_0x89b0('0xd')]);router['put'](_0x89b0('0x9'),auth[_0x89b0('0xc')](),controller[_0x89b0('0xe')]);router[_0x89b0('0xf')](_0x89b0('0x9'),auth[_0x89b0('0xc')](),controller['destroy']);module[_0x89b0('0x10')]=router; \ No newline at end of file +var _0x8112=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','create','delete','destroy','exports','multer','util','express','Router'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8112,0xc8));var _0x2811=function(_0x891c55,_0x233fe8){_0x891c55=_0x891c55-0x0;var _0x260823=_0x8112[_0x891c55];return _0x260823;};'use strict';var multer=require(_0x2811('0x0'));var util=require(_0x2811('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2811('0x2'));var router=express[_0x2811('0x3')]();var auth=require(_0x2811('0x4'));var interaction=require(_0x2811('0x5'));var config=require(_0x2811('0x6'));var controller=require(_0x2811('0x7'));router[_0x2811('0x8')](_0x2811('0x9'),auth[_0x2811('0xa')](),controller[_0x2811('0xb')]);router[_0x2811('0xc')]('/',auth[_0x2811('0xa')](),controller[_0x2811('0xd')]);router['put'](_0x2811('0x9'),auth[_0x2811('0xa')](),controller['update']);router[_0x2811('0xe')](_0x2811('0x9'),auth[_0x2811('0xa')](),controller[_0x2811('0xf')]);module[_0x2811('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index f1596f2..d798ace 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 _0xa643=['ENUM','rrmemory','beepall','roundrobin','sequelize','exports','name','STRING'];(function(_0x1d7b02,_0x195242){var _0x3375ba=function(_0x3106ae){while(--_0x3106ae){_0x1d7b02['push'](_0x1d7b02['shift']());}};_0x3375ba(++_0x195242);}(_0xa643,0x11c));var _0x3a64=function(_0x29cdc6,_0x26bf93){_0x29cdc6=_0x29cdc6-0x0;var _0x2014ca=_0xa643[_0x29cdc6];return _0x2014ca;};'use strict';var Sequelize=require(_0x3a64('0x0'));module[_0x3a64('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x3a64('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x3a64('0x3')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x3a64('0x4')](_0x3a64('0x5'),_0x3a64('0x6'),_0x3a64('0x7'))}}; \ No newline at end of file +var _0x1bb2=['beepall','sequelize','STRING','name','ENUM','rrmemory'];(function(_0x3a2b40,_0x4a1835){var _0x504f32=function(_0x479a50){while(--_0x479a50){_0x3a2b40['push'](_0x3a2b40['shift']());}};_0x504f32(++_0x4a1835);}(_0x1bb2,0xe5));var _0x21bb=function(_0x578a3b,_0x4263c2){_0x578a3b=_0x578a3b-0x0;var _0x290c8d=_0x1bb2[_0x578a3b];return _0x290c8d;};'use strict';var Sequelize=require(_0x21bb('0x0'));module['exports']={'name':{'type':Sequelize[_0x21bb('0x1')],'unique':_0x21bb('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x21bb('0x3')](_0x21bb('0x4'),_0x21bb('0x5'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 80beb09..094d62c 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 _0xfd50=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','findOne','UserChatQueue','findAndCountAll','UserId','agent','updatedAt','createdAt','format','%s/%s','SIP','chatPause','getTeams','Team','addTeams','ids','Agents','voicePause','interface','flatMap','sequelize','each','findOrCreate','forEach','emit','removeTeams','User','select','field','tq.TeamId','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','compact','transaction','isEmpty','removeAgents','addAgents','spread','userChatQueue:save','isArray','userChatQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','lodash','crypto','jsforce','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','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','end','status','json','count','offset','limit','set','apply','reject','save','update','destroy','then','get','ChatQueues','UserProfileResource','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','type','merge','options','ChatQueue','include','findAll','rows','show','params','keys','create'];(function(_0x49ded9,_0x57c1c9){var _0x445fc6=function(_0x2dbb20){while(--_0x2dbb20){_0x49ded9['push'](_0x49ded9['shift']());}};_0x445fc6(++_0x57c1c9);}(_0xfd50,0x178));var _0x0fd5=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0xfd50[_0x4c12ec];return _0x3ae42c;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0fd5('0x0'));var rimraf=require(_0x0fd5('0x1'));var zipdir=require(_0x0fd5('0x2'));var jsonpatch=require(_0x0fd5('0x3'));var rp=require(_0x0fd5('0x4'));var moment=require('moment');var BPromise=require(_0x0fd5('0x5'));var Mustache=require(_0x0fd5('0x6'));var util=require('util');var path=require('path');var sox=require(_0x0fd5('0x7'));var csv=require(_0x0fd5('0x8'));var ejs=require(_0x0fd5('0x9'));var fs=require('fs');var _=require(_0x0fd5('0xa'));var squel=require('squel');var crypto=require(_0x0fd5('0xb'));var jsforce=require(_0x0fd5('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x0fd5('0x8'));var querystring=require(_0x0fd5('0xd'));var Papa=require(_0x0fd5('0xe'));var Redis=require(_0x0fd5('0xf'));var authService=require(_0x0fd5('0x10'));var qs=require(_0x0fd5('0x11'));var as=require(_0x0fd5('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0fd5('0x13'))(_0x0fd5('0x14'));var utils=require('../../config/utils');var config=require(_0x0fd5('0x15'));var db=require(_0x0fd5('0x16'))['db'];config[_0x0fd5('0x17')]=_[_0x0fd5('0x18')](config[_0x0fd5('0x17')],{'host':_0x0fd5('0x19'),'port':0x18eb});var socket=require(_0x0fd5('0x1a'))(new Redis(config['redis']));require('./chatQueue.socket')[_0x0fd5('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0x0fd5('0x1c')][_0x0fd5('0x1d')]({'port':0x232a});function checkPasswordPattern(_0xbfa7d1,_0xd8e3f5,_0x200639){if(_0x200639){var _0x5e2911=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5e2911[_0x0fd5('0x1e')](_0xd8e3f5)){return _0xbfa7d1;}else{throw new db[(_0x0fd5('0x1f'))][(_0x0fd5('0x20'))](_0x0fd5('0x21'));}}else{return _0xbfa7d1;}}function respondWithRpcPromise(_0xe6e3d2,_0x2e2871,_0x4c3d76,_0x977f7d){return new BPromise(function(_0x8cee,_0x3f1843){var _0x442815=_0x977f7d||client;return _0x442815[_0x0fd5('0x22')](_0xe6e3d2,_0x4c3d76)['then'](function(_0xd6bf91){logger[_0x0fd5('0x23')](_0x0fd5('0x24'),_0x2e2871,_0x0fd5('0x25'));logger[_0x0fd5('0x26')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x2e2871,_0x0fd5('0x25'),JSON['stringify'](_0xd6bf91));if(_0xd6bf91[_0x0fd5('0x27')]){if(_0xd6bf91[_0x0fd5('0x27')]['code']===0x1f4){logger[_0x0fd5('0x27')](_0x0fd5('0x24'),_0x2e2871,_0xd6bf91[_0x0fd5('0x27')][_0x0fd5('0x28')]);return _0x3f1843(_0xd6bf91['error'][_0x0fd5('0x28')]);}logger[_0x0fd5('0x27')](_0x0fd5('0x24'),_0x2e2871,_0xd6bf91[_0x0fd5('0x27')]['message']);return _0x8cee(_0xd6bf91[_0x0fd5('0x27')][_0x0fd5('0x28')]);}else{logger[_0x0fd5('0x23')](_0x0fd5('0x24'),_0x2e2871,_0x0fd5('0x25'));_0x8cee(_0xd6bf91[_0x0fd5('0x29')][_0x0fd5('0x28')]);}})[_0x0fd5('0x2a')](function(_0x110fab){logger[_0x0fd5('0x27')](_0x0fd5('0x24'),_0x2e2871,_0x110fab);_0x3f1843(_0x110fab);});});}function respondWithStatusCode(_0x2b0991,_0x2596d7){_0x2596d7=_0x2596d7||0xcc;return function(_0x52a6a2){if(_0x52a6a2){return _0x2b0991['sendStatus'](_0x2596d7);}return _0x2b0991['status'](_0x2596d7)[_0x0fd5('0x2b')]();};}function respondWithResult(_0x4547dd,_0x566a98){_0x566a98=_0x566a98||0xc8;return function(_0x46e395){if(_0x46e395){return _0x4547dd[_0x0fd5('0x2c')](_0x566a98)[_0x0fd5('0x2d')](_0x46e395);}};}function respondWithFilteredResult(_0x79a5a,_0x49dfb2){return function(_0x3542d7){if(_0x3542d7){var _0xe9b954=_0x3542d7[_0x0fd5('0x2e')],_0x222dee=_0x49dfb2[_0x0fd5('0x2f')],_0x4cc40b=_0x49dfb2[_0x0fd5('0x2f')]+_0x49dfb2[_0x0fd5('0x30')],_0x3e41d4;if(_0x4cc40b>=_0xe9b954){_0x4cc40b=_0xe9b954;_0x3e41d4=0xc8;}else{_0x3e41d4=0xce;}_0x79a5a['status'](_0x3e41d4);return _0x79a5a[_0x0fd5('0x31')]('Content-Range',_0x222dee+'-'+_0x4cc40b+'/'+_0xe9b954)['json'](_0x3542d7);}return null;};}function patchUpdates(_0x3f6f67){return function(_0x50e03e){try{jsonpatch[_0x0fd5('0x32')](_0x50e03e,_0x3f6f67,!![]);}catch(_0x2d20f2){return BPromise[_0x0fd5('0x33')](_0x2d20f2);}return _0x50e03e[_0x0fd5('0x34')]();};}function saveUpdates(_0x3e8f91,_0x37e028){return function(_0x4081dd){if(_0x4081dd){return _0x4081dd[_0x0fd5('0x35')](_0x3e8f91)['then'](function(_0x11a07d){return _0x11a07d;});}return null;};}function removeEntity(_0x51ced1,_0x1cd73a){return function(_0x24f5a6){if(_0x24f5a6){return _0x24f5a6[_0x0fd5('0x36')]()[_0x0fd5('0x37')](function(){var _0x248d29=_0x24f5a6[_0x0fd5('0x38')]({'plain':!![]});var _0x82a7be=_0x0fd5('0x39');return db[_0x0fd5('0x3a')][_0x0fd5('0x36')]({'where':{'type':_0x82a7be,'resourceId':_0x248d29['id']}})[_0x0fd5('0x37')](function(){return _0x24f5a6;});})[_0x0fd5('0x37')](function(){_0x51ced1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x438741,_0x5781fa){return function(_0x4f5444){if(!_0x4f5444){_0x438741[_0x0fd5('0x3b')](0x194);}return _0x4f5444;};}function handleError(_0x3d4bdb,_0xbd1c49){_0xbd1c49=_0xbd1c49||0x1f4;return function(_0x3f184c){logger[_0x0fd5('0x27')](_0x3f184c[_0x0fd5('0x3c')]);if(_0x3f184c[_0x0fd5('0x3d')]){delete _0x3f184c[_0x0fd5('0x3d')];}_0x3d4bdb[_0x0fd5('0x2c')](_0xbd1c49)[_0x0fd5('0x3e')](_0x3f184c);};}exports[_0x0fd5('0x3f')]=function(_0xffd38e,_0x3eb4bc){var _0x2cd18d={},_0x436529={},_0x1ee77a={'count':0x0,'rows':[]};var _0x5aa1ab=_[_0x0fd5('0x40')](db['ChatQueue'][_0x0fd5('0x41')],function(_0x183b7c){return{'name':_0x183b7c[_0x0fd5('0x42')],'type':_0x183b7c['type'][_0x0fd5('0x43')]};});_0x436529[_0x0fd5('0x44')]=_['map'](_0x5aa1ab,_0x0fd5('0x3d'));_0x436529[_0x0fd5('0x45')]=_['keys'](_0xffd38e[_0x0fd5('0x45')]);_0x436529[_0x0fd5('0x46')]=_[_0x0fd5('0x47')](_0x436529[_0x0fd5('0x44')],_0x436529[_0x0fd5('0x45')]);_0x2cd18d[_0x0fd5('0x48')]=_[_0x0fd5('0x47')](_0x436529[_0x0fd5('0x44')],qs[_0x0fd5('0x49')](_0xffd38e[_0x0fd5('0x45')][_0x0fd5('0x49')]));_0x2cd18d[_0x0fd5('0x48')]=_0x2cd18d[_0x0fd5('0x48')][_0x0fd5('0x4a')]?_0x2cd18d[_0x0fd5('0x48')]:_0x436529['model'];if(!_0xffd38e[_0x0fd5('0x45')][_0x0fd5('0x4b')](_0x0fd5('0x4c'))){_0x2cd18d[_0x0fd5('0x30')]=qs[_0x0fd5('0x30')](_0xffd38e[_0x0fd5('0x45')][_0x0fd5('0x30')]);_0x2cd18d[_0x0fd5('0x2f')]=qs['offset'](_0xffd38e[_0x0fd5('0x45')][_0x0fd5('0x2f')]);}_0x2cd18d[_0x0fd5('0x4d')]=qs[_0x0fd5('0x4e')](_0xffd38e[_0x0fd5('0x45')][_0x0fd5('0x4e')]);_0x2cd18d['where']=qs[_0x0fd5('0x46')](_['pick'](_0xffd38e['query'],_0x436529['filters']));if(_0xffd38e[_0x0fd5('0x45')][_0x0fd5('0x4f')]){_0x2cd18d[_0x0fd5('0x50')]=_['merge'](_0x2cd18d[_0x0fd5('0x50')],{'$or':_[_0x0fd5('0x40')](_0x5aa1ab,function(_0x1e6038){if(_0x1e6038[_0x0fd5('0x51')]!=='VIRTUAL'){var _0x121491={};_0x121491[_0x1e6038['name']]={'$like':'%'+_0xffd38e[_0x0fd5('0x45')][_0x0fd5('0x4f')]+'%'};return _0x121491;}})});}_0x2cd18d=_[_0x0fd5('0x52')]({},_0x2cd18d,_0xffd38e[_0x0fd5('0x53')]);var _0x5b2445={'where':_0x2cd18d[_0x0fd5('0x50')]};return db[_0x0fd5('0x54')]['count'](_0x5b2445)[_0x0fd5('0x37')](function(_0x1cd6d6){_0x1ee77a[_0x0fd5('0x2e')]=_0x1cd6d6;if(_0xffd38e[_0x0fd5('0x45')]['includeAll']){_0x2cd18d[_0x0fd5('0x55')]=[{'all':!![]}];}return db['ChatQueue'][_0x0fd5('0x56')](_0x2cd18d);})[_0x0fd5('0x37')](function(_0x226376){_0x1ee77a[_0x0fd5('0x57')]=_0x226376;return _0x1ee77a;})[_0x0fd5('0x37')](respondWithFilteredResult(_0x3eb4bc,_0x2cd18d))[_0x0fd5('0x2a')](handleError(_0x3eb4bc,null));};exports[_0x0fd5('0x58')]=function(_0x223562,_0x31959b){var _0x596063={'raw':!![],'where':{'id':_0x223562[_0x0fd5('0x59')]['id']}},_0x3e7626={};_0x3e7626[_0x0fd5('0x44')]=_[_0x0fd5('0x5a')](db['ChatQueue'][_0x0fd5('0x41')]);_0x3e7626[_0x0fd5('0x45')]=_[_0x0fd5('0x5a')](_0x223562[_0x0fd5('0x45')]);_0x3e7626[_0x0fd5('0x46')]=_[_0x0fd5('0x47')](_0x3e7626[_0x0fd5('0x44')],_0x3e7626[_0x0fd5('0x45')]);_0x596063['attributes']=_[_0x0fd5('0x47')](_0x3e7626[_0x0fd5('0x44')],qs['fields'](_0x223562[_0x0fd5('0x45')][_0x0fd5('0x49')]));_0x596063[_0x0fd5('0x48')]=_0x596063[_0x0fd5('0x48')][_0x0fd5('0x4a')]?_0x596063[_0x0fd5('0x48')]:_0x3e7626['model'];if(_0x223562[_0x0fd5('0x45')]['includeAll']){_0x596063[_0x0fd5('0x55')]=[{'all':!![]}];}_0x596063=_[_0x0fd5('0x52')]({},_0x596063,_0x223562[_0x0fd5('0x53')]);return db['ChatQueue']['find'](_0x596063)[_0x0fd5('0x37')](handleEntityNotFound(_0x31959b,null))['then'](respondWithResult(_0x31959b,null))[_0x0fd5('0x2a')](handleError(_0x31959b,null));};exports['create']=function(_0x3db04d,_0x3118e0){return db['ChatQueue'][_0x0fd5('0x5b')](_0x3db04d['body'],{})[_0x0fd5('0x37')](function(_0x15044d){var _0x5a930f=_0x3db04d[_0x0fd5('0x5c')][_0x0fd5('0x38')]({'plain':!![]});if(!_0x5a930f)throw new Error(_0x0fd5('0x5d'));if(_0x5a930f[_0x0fd5('0x5e')]===_0x0fd5('0x5c')){var _0x4e8120=_0x15044d[_0x0fd5('0x38')]({'plain':!![]});var _0x207613=_0x0fd5('0x39');return db[_0x0fd5('0x5f')][_0x0fd5('0x60')]({'where':{'name':_0x207613,'userProfileId':_0x5a930f[_0x0fd5('0x61')]},'raw':!![]})[_0x0fd5('0x37')](function(_0x43c05f){if(_0x43c05f&&_0x43c05f[_0x0fd5('0x62')]===0x0){return db[_0x0fd5('0x3a')][_0x0fd5('0x5b')]({'name':_0x4e8120[_0x0fd5('0x3d')],'resourceId':_0x4e8120['id'],'type':_0x43c05f[_0x0fd5('0x3d')],'sectionId':_0x43c05f['id']},{})[_0x0fd5('0x37')](function(){return _0x15044d;});}else{return _0x15044d;}})[_0x0fd5('0x2a')](function(_0x4ea5a8){logger[_0x0fd5('0x27')](_0x0fd5('0x63'),_0x4ea5a8);throw _0x4ea5a8;});}return _0x15044d;})[_0x0fd5('0x37')](respondWithResult(_0x3118e0,0xc9))[_0x0fd5('0x2a')](handleError(_0x3118e0,null));};exports[_0x0fd5('0x35')]=function(_0x30c005,_0x79999f){if(_0x30c005[_0x0fd5('0x64')]['id']){delete _0x30c005[_0x0fd5('0x64')]['id'];}return db[_0x0fd5('0x54')][_0x0fd5('0x60')]({'where':{'id':_0x30c005[_0x0fd5('0x59')]['id']}})['then'](handleEntityNotFound(_0x79999f,null))['then'](saveUpdates(_0x30c005[_0x0fd5('0x64')],null))[_0x0fd5('0x37')](respondWithResult(_0x79999f,null))[_0x0fd5('0x2a')](handleError(_0x79999f,null));};exports[_0x0fd5('0x36')]=function(_0x568838,_0x3800b9){return db[_0x0fd5('0x54')][_0x0fd5('0x60')]({'where':{'id':_0x568838[_0x0fd5('0x59')]['id']}})[_0x0fd5('0x37')](handleEntityNotFound(_0x3800b9,null))[_0x0fd5('0x37')](removeEntity(_0x3800b9,null))[_0x0fd5('0x2a')](handleError(_0x3800b9,null));};exports[_0x0fd5('0x65')]=function(_0x6f3208,_0x4efe4d){return db[_0x0fd5('0x54')]['describe']()[_0x0fd5('0x37')](respondWithResult(_0x4efe4d,null))[_0x0fd5('0x2a')](handleError(_0x4efe4d,null));};exports['getMembers']=function(_0x5d811b,_0x287d88,_0x52e142){var _0x5948e0={'raw':!![],'where':{}},_0x34b3d7={},_0x366444;return db[_0x0fd5('0x54')][_0x0fd5('0x66')]({'where':{'id':_0x5d811b[_0x0fd5('0x59')]['id']}})[_0x0fd5('0x37')](handleEntityNotFound(_0x287d88,null))[_0x0fd5('0x37')](function(_0x5a6eb8){if(_0x5a6eb8){_0x366444=_0x5a6eb8[_0x0fd5('0x38')]({'plain':!![]});_0x34b3d7[_0x0fd5('0x44')]=_['keys'](db['UserChatQueue'][_0x0fd5('0x41')]);_0x34b3d7[_0x0fd5('0x45')]=_['keys'](_0x5d811b['query']);_0x34b3d7[_0x0fd5('0x46')]=_[_0x0fd5('0x47')](_0x34b3d7[_0x0fd5('0x44')],_0x34b3d7['query']);_0x5948e0[_0x0fd5('0x48')]=_[_0x0fd5('0x47')](_0x34b3d7[_0x0fd5('0x44')],qs[_0x0fd5('0x49')](_0x5d811b[_0x0fd5('0x45')][_0x0fd5('0x49')]));_0x5948e0[_0x0fd5('0x48')]=_0x5948e0[_0x0fd5('0x48')][_0x0fd5('0x4a')]?_0x5948e0[_0x0fd5('0x48')]:_0x34b3d7[_0x0fd5('0x44')];if(!_0x5d811b[_0x0fd5('0x45')][_0x0fd5('0x4b')](_0x0fd5('0x4c'))){_0x5948e0['limit']=qs[_0x0fd5('0x30')](_0x5d811b[_0x0fd5('0x45')][_0x0fd5('0x30')]);_0x5948e0[_0x0fd5('0x2f')]=qs[_0x0fd5('0x2f')](_0x5d811b[_0x0fd5('0x45')][_0x0fd5('0x2f')]);}_0x5948e0[_0x0fd5('0x4d')]=qs[_0x0fd5('0x4e')](_0x5d811b[_0x0fd5('0x45')]['sort']);_0x5948e0[_0x0fd5('0x50')]=qs[_0x0fd5('0x46')](_['pick'](_0x5d811b[_0x0fd5('0x45')],_0x34b3d7[_0x0fd5('0x46')]));_0x5948e0['where']['ChatQueueId']=_0x5a6eb8['id'];if(_0x5d811b[_0x0fd5('0x45')][_0x0fd5('0x4f')]){_0x5948e0['where']=_[_0x0fd5('0x52')](_0x5948e0['where'],{'$or':_[_0x0fd5('0x40')](_0x5948e0[_0x0fd5('0x48')],function(_0x1eee7b){var _0x2d9257={};_0x2d9257[_0x1eee7b]={'$like':'%'+_0x5d811b[_0x0fd5('0x45')][_0x0fd5('0x4f')]+'%'};return _0x2d9257;})});}_0x5948e0=_[_0x0fd5('0x52')]({},_0x5948e0,_0x5d811b[_0x0fd5('0x53')]);return db[_0x0fd5('0x67')][_0x0fd5('0x56')](_0x5948e0);}})[_0x0fd5('0x37')](function(_0xfce14d){if(_0xfce14d){return db['User'][_0x0fd5('0x68')]({'where':{'id':_[_0x0fd5('0x40')](_0xfce14d,_0x0fd5('0x69')),'role':_0x0fd5('0x6a')},'attributes':['id',_0x0fd5('0x3d'),'chatPause',_0x0fd5('0x6b'),_0x0fd5('0x6c')]});}})['then'](function(_0x41895e){if(_0x41895e){return{'count':_0x41895e[_0x0fd5('0x2e')],'rows':_[_0x0fd5('0x40')](_0x41895e['rows'],function(_0x22cbbb){return{'membername':_0x22cbbb['name'],'UserId':_0x22cbbb['id'],'queue_name':_0x366444[_0x0fd5('0x3d')],'ChatQueueId':_0x366444['id'],'interface':util[_0x0fd5('0x6d')](_0x0fd5('0x6e'),_0x0fd5('0x6f'),_0x22cbbb['name']),'penalty':0x0,'paused':_0x22cbbb[_0x0fd5('0x70')],'createdAt':_0x22cbbb[_0x0fd5('0x6c')],'updatedAt':_0x22cbbb['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x0fd5('0x37')](respondWithFilteredResult(_0x287d88,_0x5948e0))[_0x0fd5('0x2a')](handleError(_0x287d88,null));};exports[_0x0fd5('0x71')]=function(_0x2dd216,_0xe60150,_0xb31ae2){var _0x38d1fb={};var _0x1fab55={};var _0x3a2e27;var _0xfe44e1;return db['ChatQueue'][_0x0fd5('0x66')]({'where':{'id':_0x2dd216[_0x0fd5('0x59')]['id']}})['then'](handleEntityNotFound(_0xe60150,null))[_0x0fd5('0x37')](function(_0x5e0bc6){if(_0x5e0bc6){_0x3a2e27=_0x5e0bc6;_0x1fab55['model']=_[_0x0fd5('0x5a')](db[_0x0fd5('0x72')][_0x0fd5('0x41')]);_0x1fab55['query']=_[_0x0fd5('0x5a')](_0x2dd216['query']);_0x1fab55[_0x0fd5('0x46')]=_['intersection'](_0x1fab55[_0x0fd5('0x44')],_0x1fab55[_0x0fd5('0x45')]);_0x38d1fb[_0x0fd5('0x48')]=_['intersection'](_0x1fab55[_0x0fd5('0x44')],qs['fields'](_0x2dd216[_0x0fd5('0x45')][_0x0fd5('0x49')]));_0x38d1fb[_0x0fd5('0x48')]=_0x38d1fb[_0x0fd5('0x48')][_0x0fd5('0x4a')]?_0x38d1fb[_0x0fd5('0x48')]:_0x1fab55['model'];_0x38d1fb['order']=qs[_0x0fd5('0x4e')](_0x2dd216[_0x0fd5('0x45')][_0x0fd5('0x4e')]);_0x38d1fb[_0x0fd5('0x50')]=qs[_0x0fd5('0x46')](_['pick'](_0x2dd216[_0x0fd5('0x45')],_0x1fab55[_0x0fd5('0x46')]));if(_0x2dd216[_0x0fd5('0x45')]['filter']){_0x38d1fb[_0x0fd5('0x50')]=_['merge'](_0x38d1fb[_0x0fd5('0x50')],{'$or':_[_0x0fd5('0x40')](_0x38d1fb[_0x0fd5('0x48')],function(_0x1df3a7){var _0x483422={};_0x483422[_0x1df3a7]={'$like':'%'+_0x2dd216[_0x0fd5('0x45')]['filter']+'%'};return _0x483422;})});}_0x38d1fb=_[_0x0fd5('0x52')]({},_0x38d1fb,_0x2dd216['options']);return _0x3a2e27[_0x0fd5('0x71')](_0x38d1fb);}})['then'](function(_0x5967d1){if(_0x5967d1){_0xfe44e1=_0x5967d1[_0x0fd5('0x4a')];if(!_0x2dd216['query'][_0x0fd5('0x4b')]('nolimit')){_0x38d1fb[_0x0fd5('0x30')]=qs[_0x0fd5('0x30')](_0x2dd216[_0x0fd5('0x45')][_0x0fd5('0x30')]);_0x38d1fb[_0x0fd5('0x2f')]=qs['offset'](_0x2dd216['query'][_0x0fd5('0x2f')]);}return _0x3a2e27[_0x0fd5('0x71')](_0x38d1fb);}})['then'](function(_0x1fa0a9){if(_0x1fa0a9){return _0x1fa0a9?{'count':_0xfe44e1,'rows':_0x1fa0a9}:null;}})[_0x0fd5('0x37')](respondWithResult(_0xe60150,null))[_0x0fd5('0x2a')](handleError(_0xe60150,null));};exports[_0x0fd5('0x73')]=function(_0x2b08a1,_0x5e5969,_0x4253d7){var _0xa5a8c4=_0x2b08a1['body'][_0x0fd5('0x74')];return db['Team']['findAll']({'where':{'id':_0xa5a8c4},'attributes':['id'],'include':[{'model':db['User'],'as':_0x0fd5('0x75'),'attributes':['id','name','online',_0x0fd5('0x76'),_0x0fd5('0x77')],'raw':!![]}]})[_0x0fd5('0x37')](function(_0x2ad89c){if(_0x2ad89c){var _0xe23b80=_[_0x0fd5('0x78')](_0x2ad89c,function(_0x465e51){var _0x53361c=_0x465e51[_0x0fd5('0x38')]({'plain':!![]});return _0x53361c['Agents'];});return db['ChatQueue'][_0x0fd5('0x60')]({'where':{'id':_0x2b08a1[_0x0fd5('0x59')]['id']}})[_0x0fd5('0x37')](function(_0x2be2ff){return db[_0x0fd5('0x79')]['transaction'](function(_0x880347){return _0x2be2ff[_0x0fd5('0x73')](_0xa5a8c4,{'transaction':_0x880347})['then'](function(){return BPromise[_0x0fd5('0x7a')](_0xe23b80,function(_0x11b5a3){return db[_0x0fd5('0x67')][_0x0fd5('0x7b')]({'where':{'UserId':_0x11b5a3['id'],'ChatQueueId':_0x2b08a1['params']['id']},'transaction':_0x880347});});})['then'](function(){_0xe23b80[_0x0fd5('0x7c')](function(_0x51296e){socket[_0x0fd5('0x7d')]('userChatQueue:save',{'UserId':_0x51296e['id'],'ChatQueueId':_0x2be2ff['id']});});});});});}})[_0x0fd5('0x37')](respondWithStatusCode(_0x5e5969,null))[_0x0fd5('0x2a')](handleError(_0x5e5969,null));};exports[_0x0fd5('0x7e')]=function(_0x1c4171,_0x183035,_0x38c228){return db[_0x0fd5('0x72')][_0x0fd5('0x56')]({'where':{'id':_0x1c4171['query'][_0x0fd5('0x74')]},'attributes':['id'],'include':[{'model':db[_0x0fd5('0x7f')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x0fd5('0x37')](handleEntityNotFound(_0x183035,null))[_0x0fd5('0x37')](function(_0x2f0ae5){var _0x6a9bd=_[_0x0fd5('0x40')](_0x2f0ae5,'id');var _0x30eead=[];var _0x130fde=[];var _0x4c50c1=squel[_0x0fd5('0x80')]();_0x4c50c1[_0x0fd5('0x81')](_0x0fd5('0x82'))['from'](_0x0fd5('0x83'),'tq')[_0x0fd5('0x84')](_0x0fd5('0x85'),'ut',_0x0fd5('0x86'))[_0x0fd5('0x50')](_0x0fd5('0x87'),_0x1c4171['params']['id']);for(var _0x4b38e1=0x0;_0x4b38e1<_0x2f0ae5[_0x0fd5('0x4a')];_0x4b38e1+=0x1){let _0x12e474=_0x2f0ae5[_0x4b38e1];for(var _0x38883d=0x0;_0x38883d<_0x12e474[_0x0fd5('0x75')][_0x0fd5('0x4a')];_0x38883d+=0x1){let _0x119469=_0x12e474[_0x0fd5('0x75')][_0x38883d];var _0x194a04=_0x4c50c1[_0x0fd5('0x88')]();_0x194a04[_0x0fd5('0x50')](_0x0fd5('0x89'),_0x119469['id']);_0x130fde[_0x0fd5('0x8a')](db[_0x0fd5('0x79')][_0x0fd5('0x45')](_0x194a04[_0x0fd5('0x8b')](),{'type':db[_0x0fd5('0x79')][_0x0fd5('0x8c')][_0x0fd5('0x8d')]})[_0x0fd5('0x37')](function(_0x12098f){if(_0x12098f[_0x0fd5('0x4a')]===0x1){return _0x119469['id'];}else{var _0x3888cf=_[_0x0fd5('0x8e')](_[_0x0fd5('0x40')](_0x12098f,_0x0fd5('0x8f')),function(_0x517fea){return _[_0x0fd5('0x90')](_0x6a9bd,_0x517fea);});if(_0x3888cf){return _0x119469['id'];}}}));}}return BPromise[_0x0fd5('0x91')](_0x130fde)[_0x0fd5('0x37')](function(_0x553abd){_0x30eead=_(_0x30eead)['union'](_0x553abd)[_0x0fd5('0x92')]()['value']();return db[_0x0fd5('0x54')][_0x0fd5('0x60')]({'where':{'id':_0x1c4171[_0x0fd5('0x59')]['id']}})[_0x0fd5('0x37')](function(_0x21a924){return db['sequelize'][_0x0fd5('0x93')](function(_0x379f2c){return _0x21a924[_0x0fd5('0x7e')](_0x1c4171[_0x0fd5('0x45')]['ids'],{'transaction':_0x379f2c})[_0x0fd5('0x37')](function(){if(!_[_0x0fd5('0x94')](_0x30eead)){return _0x21a924[_0x0fd5('0x95')](_0x30eead,{'transaction':_0x379f2c});}})[_0x0fd5('0x37')](function(){_0x30eead[_0x0fd5('0x7c')](function(_0x4c2c0c){socket[_0x0fd5('0x7d')]('userChatQueue:remove',{'UserId':_0x4c2c0c,'ChatQueueId':_0x21a924['id']});});});});});});})['then'](respondWithStatusCode(_0x183035,null))[_0x0fd5('0x2a')](handleError(_0x183035,null));};exports[_0x0fd5('0x96')]=function(_0x1165b3,_0xd32204,_0x12744a){return db[_0x0fd5('0x54')][_0x0fd5('0x60')]({'where':{'id':_0x1165b3[_0x0fd5('0x59')]['id']}})[_0x0fd5('0x37')](handleEntityNotFound(_0xd32204,null))[_0x0fd5('0x37')](function(_0x4d5414){if(_0x4d5414){return _0x4d5414[_0x0fd5('0x96')](_0x1165b3[_0x0fd5('0x64')]['ids'],_['omit'](_0x1165b3['body'],[_0x0fd5('0x74'),'id'])||{})[_0x0fd5('0x97')](function(_0x4559a4){for(var _0x5e87e4=0x0;_0x5e87e4<_0x1165b3['body'][_0x0fd5('0x74')][_0x0fd5('0x4a')];_0x5e87e4+=0x1){socket[_0x0fd5('0x7d')](_0x0fd5('0x98'),{'UserId':_0x1165b3[_0x0fd5('0x64')][_0x0fd5('0x74')][_0x5e87e4],'ChatQueueId':_0x1165b3[_0x0fd5('0x59')]['id']});}return _0x4559a4;});}})['then'](respondWithResult(_0xd32204,null))['catch'](handleError(_0xd32204,null));};exports[_0x0fd5('0x95')]=function(_0x31218e,_0x490917,_0x1fdbca){return db['ChatQueue'][_0x0fd5('0x60')]({'where':{'id':_0x31218e[_0x0fd5('0x59')]['id']}})[_0x0fd5('0x37')](handleEntityNotFound(_0x490917,null))[_0x0fd5('0x37')](function(_0x41db7d){if(_0x41db7d){return _0x41db7d[_0x0fd5('0x95')](_0x31218e['query'][_0x0fd5('0x74')])[_0x0fd5('0x37')](function(){if(_[_0x0fd5('0x99')](_0x31218e['query'][_0x0fd5('0x74')])){for(var _0x5640a1=0x0;_0x5640a1<_0x31218e[_0x0fd5('0x45')][_0x0fd5('0x74')][_0x0fd5('0x4a')];_0x5640a1+=0x1){socket[_0x0fd5('0x7d')](_0x0fd5('0x9a'),{'UserId':Number(_0x31218e[_0x0fd5('0x45')][_0x0fd5('0x74')][_0x5640a1]),'ChatQueueId':Number(_0x31218e['params']['id'])});}}else{socket['emit'](_0x0fd5('0x9a'),{'UserId':Number(_0x31218e[_0x0fd5('0x45')][_0x0fd5('0x74')]),'ChatQueueId':Number(_0x31218e[_0x0fd5('0x59')]['id'])});}});}})['then'](respondWithStatusCode(_0x490917,null))['catch'](handleError(_0x490917,null));};exports[_0x0fd5('0x9b')]=function(_0x3a7af8,_0xea8c46,_0x4e83a3){var _0x244d43={};var _0x111c22={};var _0x499e25;var _0x57e748;return db['ChatQueue'][_0x0fd5('0x66')]({'where':{'id':_0x3a7af8[_0x0fd5('0x59')]['id']}})[_0x0fd5('0x37')](handleEntityNotFound(_0xea8c46,null))[_0x0fd5('0x37')](function(_0x5f3964){if(_0x5f3964){_0x499e25=_0x5f3964;_0x111c22['model']=_[_0x0fd5('0x5a')](db[_0x0fd5('0x7f')][_0x0fd5('0x41')]);_0x111c22[_0x0fd5('0x45')]=_[_0x0fd5('0x5a')](_0x3a7af8['query']);_0x111c22[_0x0fd5('0x46')]=_[_0x0fd5('0x47')](_0x111c22[_0x0fd5('0x44')],_0x111c22['query']);_0x244d43[_0x0fd5('0x48')]=_[_0x0fd5('0x47')](_0x111c22[_0x0fd5('0x44')],qs[_0x0fd5('0x49')](_0x3a7af8[_0x0fd5('0x45')][_0x0fd5('0x49')]));_0x244d43[_0x0fd5('0x48')]=_0x244d43['attributes'][_0x0fd5('0x4a')]?_0x244d43['attributes']:_0x111c22['model'];_0x244d43[_0x0fd5('0x4d')]=qs[_0x0fd5('0x4e')](_0x3a7af8[_0x0fd5('0x45')][_0x0fd5('0x4e')]);_0x244d43[_0x0fd5('0x50')]=qs[_0x0fd5('0x46')](_['pick'](_0x3a7af8[_0x0fd5('0x45')],_0x111c22[_0x0fd5('0x46')]));if(_0x3a7af8[_0x0fd5('0x45')][_0x0fd5('0x4f')]){_0x244d43[_0x0fd5('0x50')]=_[_0x0fd5('0x52')](_0x244d43[_0x0fd5('0x50')],{'$or':_[_0x0fd5('0x40')](_0x244d43['attributes'],function(_0xe70ef8){var _0xce17c6={};_0xce17c6[_0xe70ef8]={'$like':'%'+_0x3a7af8[_0x0fd5('0x45')][_0x0fd5('0x4f')]+'%'};return _0xce17c6;})});}_0x244d43=_[_0x0fd5('0x52')]({},_0x244d43,_0x3a7af8[_0x0fd5('0x53')]);return _0x499e25[_0x0fd5('0x9b')](_0x244d43);}})[_0x0fd5('0x37')](function(_0x42f63c){if(_0x42f63c){_0x57e748=_0x42f63c[_0x0fd5('0x4a')];if(!_0x3a7af8[_0x0fd5('0x45')]['hasOwnProperty'](_0x0fd5('0x4c'))){_0x244d43[_0x0fd5('0x30')]=qs[_0x0fd5('0x30')](_0x3a7af8[_0x0fd5('0x45')][_0x0fd5('0x30')]);_0x244d43[_0x0fd5('0x2f')]=qs[_0x0fd5('0x2f')](_0x3a7af8[_0x0fd5('0x45')][_0x0fd5('0x2f')]);}return _0x499e25['getAgents'](_0x244d43);}})[_0x0fd5('0x37')](function(_0x429cf9){if(_0x429cf9){return _0x429cf9?{'count':_0x57e748,'rows':_0x429cf9}:null;}})[_0x0fd5('0x37')](respondWithResult(_0xea8c46,null))[_0x0fd5('0x2a')](handleError(_0xea8c46,null));}; \ No newline at end of file +var _0x444e=['type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','pick','filters','where','merge','VIRTUAL','filter','includeAll','include','findAll','show','length','options','ChatQueue','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','findOne','UserChatQueue','ChatQueueId','User','findAndCountAll','agent','chatPause','updatedAt','createdAt','rows','format','%s/%s','getTeams','Team','addTeams','ids','voicePause','interface','flatMap','Agents','sequelize','forEach','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','transaction','isEmpty','removeAgents','emit','userChatQueue:remove','omit','isArray','getAgents','html-pdf','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','squel','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','redis','defaults','localhost','./chatQueue.socket','register','client','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','message','info','result','sendStatus','end','count','offset','set','Content-Range','json','reject','save','destroy','get','ChatQueues','UserProfileResource','status','name','send','index','map','rawAttributes','fieldName'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x444e,0xe8));var _0xe444=function(_0x55be77,_0x533ac3){_0x55be77=_0x55be77-0x0;var _0x147b5d=_0x444e[_0x55be77];return _0x147b5d;};'use strict';var pdf=require(_0xe444('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xe444('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe444('0x2'));var rp=require('request-promise');var moment=require(_0xe444('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe444('0x4'));var util=require(_0xe444('0x5'));var path=require(_0xe444('0x6'));var sox=require(_0xe444('0x7'));var csv=require(_0xe444('0x8'));var ejs=require(_0xe444('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xe444('0xa'));var crypto=require('crypto');var jsforce=require(_0xe444('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xe444('0x8'));var querystring=require(_0xe444('0xc'));var Papa=require(_0xe444('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe444('0xe'));var as=require(_0xe444('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe444('0x10'))('api');var utils=require('../../config/utils');var config=require(_0xe444('0x11'));var db=require('../../mysqldb')['db'];config[_0xe444('0x12')]=_[_0xe444('0x13')](config['redis'],{'host':_0xe444('0x14'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xe444('0x15'))[_0xe444('0x16')](socket);var jayson=require('jayson/promise');var client=jayson[_0xe444('0x17')]['http']({'port':0x232a});function checkPasswordPattern(_0x19ab27,_0x3acd97,_0x18f7cf){if(_0x18f7cf){var _0x3af415=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3af415[_0xe444('0x18')](_0x3acd97)){return _0x19ab27;}else{throw new db[(_0xe444('0x19'))][(_0xe444('0x1a'))](_0xe444('0x1b'));}}else{return _0x19ab27;}}function respondWithRpcPromise(_0x11129b,_0x4009c7,_0x236bc4,_0x3d9066){return new BPromise(function(_0x38879b,_0x4e2711){var _0x3407a2=_0x3d9066||client;return _0x3407a2[_0xe444('0x1c')](_0x11129b,_0x236bc4)[_0xe444('0x1d')](function(_0x2f6a4a){logger['info'](_0xe444('0x1e'),_0x4009c7,_0xe444('0x1f'));logger[_0xe444('0x20')](_0xe444('0x21'),_0x4009c7,_0xe444('0x1f'),JSON['stringify'](_0x2f6a4a));if(_0x2f6a4a[_0xe444('0x22')]){if(_0x2f6a4a[_0xe444('0x22')]['code']===0x1f4){logger[_0xe444('0x22')]('ChatQueue,\x20%s,\x20%s',_0x4009c7,_0x2f6a4a[_0xe444('0x22')][_0xe444('0x23')]);return _0x4e2711(_0x2f6a4a[_0xe444('0x22')][_0xe444('0x23')]);}logger[_0xe444('0x22')]('ChatQueue,\x20%s,\x20%s',_0x4009c7,_0x2f6a4a['error'][_0xe444('0x23')]);return _0x38879b(_0x2f6a4a[_0xe444('0x22')][_0xe444('0x23')]);}else{logger[_0xe444('0x24')](_0xe444('0x1e'),_0x4009c7,'request\x20sent');_0x38879b(_0x2f6a4a[_0xe444('0x25')][_0xe444('0x23')]);}})['catch'](function(_0x32055b){logger[_0xe444('0x22')](_0xe444('0x1e'),_0x4009c7,_0x32055b);_0x4e2711(_0x32055b);});});}function respondWithStatusCode(_0x26ca6f,_0x2619cf){_0x2619cf=_0x2619cf||0xcc;return function(_0x23072c){if(_0x23072c){return _0x26ca6f[_0xe444('0x26')](_0x2619cf);}return _0x26ca6f['status'](_0x2619cf)[_0xe444('0x27')]();};}function respondWithResult(_0xe8814b,_0x311989){_0x311989=_0x311989||0xc8;return function(_0x304b33){if(_0x304b33){return _0xe8814b['status'](_0x311989)['json'](_0x304b33);}};}function respondWithFilteredResult(_0x1bfec6,_0x6f5319){return function(_0x33de83){if(_0x33de83){var _0x239894=_0x33de83[_0xe444('0x28')],_0x5173d5=_0x6f5319[_0xe444('0x29')],_0x26e233=_0x6f5319['offset']+_0x6f5319['limit'],_0x224785;if(_0x26e233>=_0x239894){_0x26e233=_0x239894;_0x224785=0xc8;}else{_0x224785=0xce;}_0x1bfec6['status'](_0x224785);return _0x1bfec6[_0xe444('0x2a')](_0xe444('0x2b'),_0x5173d5+'-'+_0x26e233+'/'+_0x239894)[_0xe444('0x2c')](_0x33de83);}return null;};}function patchUpdates(_0x152e89){return function(_0x937dde){try{jsonpatch['apply'](_0x937dde,_0x152e89,!![]);}catch(_0x2c6169){return BPromise[_0xe444('0x2d')](_0x2c6169);}return _0x937dde[_0xe444('0x2e')]();};}function saveUpdates(_0x5cf82e,_0x187c27){return function(_0x49b708){if(_0x49b708){return _0x49b708['update'](_0x5cf82e)[_0xe444('0x1d')](function(_0x471a11){return _0x471a11;});}return null;};}function removeEntity(_0x5307d2,_0x3dd328){return function(_0x4f31ef){if(_0x4f31ef){return _0x4f31ef[_0xe444('0x2f')]()['then'](function(){var _0x4b01b9=_0x4f31ef[_0xe444('0x30')]({'plain':!![]});var _0x48180c=_0xe444('0x31');return db[_0xe444('0x32')][_0xe444('0x2f')]({'where':{'type':_0x48180c,'resourceId':_0x4b01b9['id']}})[_0xe444('0x1d')](function(){return _0x4f31ef;});})['then'](function(){_0x5307d2[_0xe444('0x33')](0xcc)[_0xe444('0x27')]();});}};}function handleEntityNotFound(_0x231b81,_0x545995){return function(_0x16fffe){if(!_0x16fffe){_0x231b81['sendStatus'](0x194);}return _0x16fffe;};}function handleError(_0x3b7980,_0x157ba6){_0x157ba6=_0x157ba6||0x1f4;return function(_0x40df20){logger['error'](_0x40df20['stack']);if(_0x40df20[_0xe444('0x34')]){delete _0x40df20[_0xe444('0x34')];}_0x3b7980[_0xe444('0x33')](_0x157ba6)[_0xe444('0x35')](_0x40df20);};}exports[_0xe444('0x36')]=function(_0x3f50a8,_0x34cce8){var _0x5c2ddf={},_0x50ff77={},_0x435240={'count':0x0,'rows':[]};var _0x495c9d=_[_0xe444('0x37')](db['ChatQueue'][_0xe444('0x38')],function(_0x1a3105){return{'name':_0x1a3105[_0xe444('0x39')],'type':_0x1a3105[_0xe444('0x3a')][_0xe444('0x3b')]};});_0x50ff77[_0xe444('0x3c')]=_['map'](_0x495c9d,_0xe444('0x34'));_0x50ff77[_0xe444('0x3d')]=_[_0xe444('0x3e')](_0x3f50a8[_0xe444('0x3d')]);_0x50ff77['filters']=_[_0xe444('0x3f')](_0x50ff77[_0xe444('0x3c')],_0x50ff77[_0xe444('0x3d')]);_0x5c2ddf[_0xe444('0x40')]=_[_0xe444('0x3f')](_0x50ff77[_0xe444('0x3c')],qs[_0xe444('0x41')](_0x3f50a8[_0xe444('0x3d')][_0xe444('0x41')]));_0x5c2ddf['attributes']=_0x5c2ddf['attributes']['length']?_0x5c2ddf[_0xe444('0x40')]:_0x50ff77[_0xe444('0x3c')];if(!_0x3f50a8[_0xe444('0x3d')][_0xe444('0x42')](_0xe444('0x43'))){_0x5c2ddf['limit']=qs['limit'](_0x3f50a8[_0xe444('0x3d')][_0xe444('0x44')]);_0x5c2ddf[_0xe444('0x29')]=qs['offset'](_0x3f50a8[_0xe444('0x3d')][_0xe444('0x29')]);}_0x5c2ddf[_0xe444('0x45')]=qs[_0xe444('0x46')](_0x3f50a8[_0xe444('0x3d')][_0xe444('0x46')]);_0x5c2ddf['where']=qs['filters'](_[_0xe444('0x47')](_0x3f50a8[_0xe444('0x3d')],_0x50ff77[_0xe444('0x48')]));if(_0x3f50a8[_0xe444('0x3d')]['filter']){_0x5c2ddf[_0xe444('0x49')]=_[_0xe444('0x4a')](_0x5c2ddf[_0xe444('0x49')],{'$or':_[_0xe444('0x37')](_0x495c9d,function(_0xbbd474){if(_0xbbd474[_0xe444('0x3a')]!==_0xe444('0x4b')){var _0x26d4d3={};_0x26d4d3[_0xbbd474['name']]={'$like':'%'+_0x3f50a8[_0xe444('0x3d')][_0xe444('0x4c')]+'%'};return _0x26d4d3;}})});}_0x5c2ddf=_[_0xe444('0x4a')]({},_0x5c2ddf,_0x3f50a8['options']);var _0x124fc3={'where':_0x5c2ddf['where']};return db['ChatQueue']['count'](_0x124fc3)[_0xe444('0x1d')](function(_0x142af3){_0x435240['count']=_0x142af3;if(_0x3f50a8['query'][_0xe444('0x4d')]){_0x5c2ddf[_0xe444('0x4e')]=[{'all':!![]}];}return db['ChatQueue'][_0xe444('0x4f')](_0x5c2ddf);})[_0xe444('0x1d')](function(_0x106586){_0x435240['rows']=_0x106586;return _0x435240;})[_0xe444('0x1d')](respondWithFilteredResult(_0x34cce8,_0x5c2ddf))['catch'](handleError(_0x34cce8,null));};exports[_0xe444('0x50')]=function(_0x3f65d3,_0x5d92e6){var _0x5ab72c={'raw':!![],'where':{'id':_0x3f65d3['params']['id']}},_0x118174={};_0x118174[_0xe444('0x3c')]=_[_0xe444('0x3e')](db['ChatQueue'][_0xe444('0x38')]);_0x118174[_0xe444('0x3d')]=_[_0xe444('0x3e')](_0x3f65d3[_0xe444('0x3d')]);_0x118174[_0xe444('0x48')]=_[_0xe444('0x3f')](_0x118174[_0xe444('0x3c')],_0x118174[_0xe444('0x3d')]);_0x5ab72c[_0xe444('0x40')]=_[_0xe444('0x3f')](_0x118174[_0xe444('0x3c')],qs[_0xe444('0x41')](_0x3f65d3['query'][_0xe444('0x41')]));_0x5ab72c[_0xe444('0x40')]=_0x5ab72c['attributes'][_0xe444('0x51')]?_0x5ab72c['attributes']:_0x118174[_0xe444('0x3c')];if(_0x3f65d3['query'][_0xe444('0x4d')]){_0x5ab72c['include']=[{'all':!![]}];}_0x5ab72c=_[_0xe444('0x4a')]({},_0x5ab72c,_0x3f65d3[_0xe444('0x52')]);return db[_0xe444('0x53')][_0xe444('0x54')](_0x5ab72c)[_0xe444('0x1d')](handleEntityNotFound(_0x5d92e6,null))['then'](respondWithResult(_0x5d92e6,null))[_0xe444('0x55')](handleError(_0x5d92e6,null));};exports[_0xe444('0x56')]=function(_0x49a889,_0xcae9ee){return db[_0xe444('0x53')][_0xe444('0x56')](_0x49a889[_0xe444('0x57')],{})['then'](function(_0x8da647){var _0x67c2e6=_0x49a889['user'][_0xe444('0x30')]({'plain':!![]});if(!_0x67c2e6)throw new Error(_0xe444('0x58'));if(_0x67c2e6['role']==='user'){var _0x1bd0dc=_0x8da647[_0xe444('0x30')]({'plain':!![]});var _0x31f478=_0xe444('0x31');return db['UserProfileSection'][_0xe444('0x54')]({'where':{'name':_0x31f478,'userProfileId':_0x67c2e6['userProfileId']},'raw':!![]})[_0xe444('0x1d')](function(_0x3f0b3c){if(_0x3f0b3c&&_0x3f0b3c[_0xe444('0x59')]===0x0){return db[_0xe444('0x32')][_0xe444('0x56')]({'name':_0x1bd0dc['name'],'resourceId':_0x1bd0dc['id'],'type':_0x3f0b3c[_0xe444('0x34')],'sectionId':_0x3f0b3c['id']},{})[_0xe444('0x1d')](function(){return _0x8da647;});}else{return _0x8da647;}})['catch'](function(_0x2bd3b5){logger[_0xe444('0x22')](_0xe444('0x5a'),_0x2bd3b5);throw _0x2bd3b5;});}return _0x8da647;})[_0xe444('0x1d')](respondWithResult(_0xcae9ee,0xc9))[_0xe444('0x55')](handleError(_0xcae9ee,null));};exports[_0xe444('0x5b')]=function(_0x1c744e,_0x410311){if(_0x1c744e[_0xe444('0x57')]['id']){delete _0x1c744e[_0xe444('0x57')]['id'];}return db[_0xe444('0x53')]['find']({'where':{'id':_0x1c744e[_0xe444('0x5c')]['id']}})[_0xe444('0x1d')](handleEntityNotFound(_0x410311,null))['then'](saveUpdates(_0x1c744e[_0xe444('0x57')],null))['then'](respondWithResult(_0x410311,null))[_0xe444('0x55')](handleError(_0x410311,null));};exports[_0xe444('0x2f')]=function(_0x44281e,_0x8e2fa5){return db['ChatQueue'][_0xe444('0x54')]({'where':{'id':_0x44281e[_0xe444('0x5c')]['id']}})['then'](handleEntityNotFound(_0x8e2fa5,null))[_0xe444('0x1d')](removeEntity(_0x8e2fa5,null))[_0xe444('0x55')](handleError(_0x8e2fa5,null));};exports['describe']=function(_0x3b9d4d,_0x2e023b){return db[_0xe444('0x53')]['describe']()[_0xe444('0x1d')](respondWithResult(_0x2e023b,null))[_0xe444('0x55')](handleError(_0x2e023b,null));};exports['getMembers']=function(_0x157b48,_0x26852c,_0x41a174){var _0x28695d={'raw':!![],'where':{}},_0x392a3a={},_0x476628;return db[_0xe444('0x53')][_0xe444('0x5d')]({'where':{'id':_0x157b48['params']['id']}})[_0xe444('0x1d')](handleEntityNotFound(_0x26852c,null))[_0xe444('0x1d')](function(_0x1025e2){if(_0x1025e2){_0x476628=_0x1025e2[_0xe444('0x30')]({'plain':!![]});_0x392a3a['model']=_[_0xe444('0x3e')](db[_0xe444('0x5e')][_0xe444('0x38')]);_0x392a3a['query']=_[_0xe444('0x3e')](_0x157b48[_0xe444('0x3d')]);_0x392a3a[_0xe444('0x48')]=_[_0xe444('0x3f')](_0x392a3a[_0xe444('0x3c')],_0x392a3a[_0xe444('0x3d')]);_0x28695d[_0xe444('0x40')]=_[_0xe444('0x3f')](_0x392a3a[_0xe444('0x3c')],qs[_0xe444('0x41')](_0x157b48[_0xe444('0x3d')]['fields']));_0x28695d[_0xe444('0x40')]=_0x28695d[_0xe444('0x40')][_0xe444('0x51')]?_0x28695d['attributes']:_0x392a3a[_0xe444('0x3c')];if(!_0x157b48[_0xe444('0x3d')]['hasOwnProperty'](_0xe444('0x43'))){_0x28695d[_0xe444('0x44')]=qs[_0xe444('0x44')](_0x157b48['query'][_0xe444('0x44')]);_0x28695d[_0xe444('0x29')]=qs[_0xe444('0x29')](_0x157b48[_0xe444('0x3d')][_0xe444('0x29')]);}_0x28695d['order']=qs['sort'](_0x157b48[_0xe444('0x3d')]['sort']);_0x28695d[_0xe444('0x49')]=qs[_0xe444('0x48')](_[_0xe444('0x47')](_0x157b48['query'],_0x392a3a[_0xe444('0x48')]));_0x28695d['where'][_0xe444('0x5f')]=_0x1025e2['id'];if(_0x157b48[_0xe444('0x3d')]['filter']){_0x28695d['where']=_['merge'](_0x28695d[_0xe444('0x49')],{'$or':_['map'](_0x28695d[_0xe444('0x40')],function(_0x5c7303){var _0x4877a1={};_0x4877a1[_0x5c7303]={'$like':'%'+_0x157b48[_0xe444('0x3d')][_0xe444('0x4c')]+'%'};return _0x4877a1;})});}_0x28695d=_[_0xe444('0x4a')]({},_0x28695d,_0x157b48[_0xe444('0x52')]);return db['UserChatQueue']['findAll'](_0x28695d);}})[_0xe444('0x1d')](function(_0x58110f){if(_0x58110f){return db[_0xe444('0x60')][_0xe444('0x61')]({'where':{'id':_['map'](_0x58110f,'UserId'),'role':_0xe444('0x62')},'attributes':['id',_0xe444('0x34'),_0xe444('0x63'),_0xe444('0x64'),_0xe444('0x65')]});}})[_0xe444('0x1d')](function(_0x84490){if(_0x84490){return{'count':_0x84490[_0xe444('0x28')],'rows':_['map'](_0x84490[_0xe444('0x66')],function(_0x4fc53a){return{'membername':_0x4fc53a[_0xe444('0x34')],'UserId':_0x4fc53a['id'],'queue_name':_0x476628[_0xe444('0x34')],'ChatQueueId':_0x476628['id'],'interface':util[_0xe444('0x67')](_0xe444('0x68'),'SIP',_0x4fc53a[_0xe444('0x34')]),'penalty':0x0,'paused':_0x4fc53a[_0xe444('0x63')],'createdAt':_0x4fc53a[_0xe444('0x65')],'updatedAt':_0x4fc53a[_0xe444('0x64')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xe444('0x1d')](respondWithFilteredResult(_0x26852c,_0x28695d))['catch'](handleError(_0x26852c,null));};exports[_0xe444('0x69')]=function(_0x433304,_0x1d7b58,_0x466c5c){var _0x19ba7f={};var _0x3d94d0={};var _0x4ea343;var _0x4cc1fb;return db[_0xe444('0x53')][_0xe444('0x5d')]({'where':{'id':_0x433304['params']['id']}})['then'](handleEntityNotFound(_0x1d7b58,null))[_0xe444('0x1d')](function(_0x42b9b5){if(_0x42b9b5){_0x4ea343=_0x42b9b5;_0x3d94d0[_0xe444('0x3c')]=_[_0xe444('0x3e')](db[_0xe444('0x6a')][_0xe444('0x38')]);_0x3d94d0[_0xe444('0x3d')]=_['keys'](_0x433304[_0xe444('0x3d')]);_0x3d94d0[_0xe444('0x48')]=_[_0xe444('0x3f')](_0x3d94d0['model'],_0x3d94d0[_0xe444('0x3d')]);_0x19ba7f[_0xe444('0x40')]=_['intersection'](_0x3d94d0[_0xe444('0x3c')],qs['fields'](_0x433304['query'][_0xe444('0x41')]));_0x19ba7f[_0xe444('0x40')]=_0x19ba7f[_0xe444('0x40')]['length']?_0x19ba7f[_0xe444('0x40')]:_0x3d94d0[_0xe444('0x3c')];_0x19ba7f[_0xe444('0x45')]=qs['sort'](_0x433304[_0xe444('0x3d')][_0xe444('0x46')]);_0x19ba7f['where']=qs[_0xe444('0x48')](_['pick'](_0x433304[_0xe444('0x3d')],_0x3d94d0['filters']));if(_0x433304[_0xe444('0x3d')]['filter']){_0x19ba7f[_0xe444('0x49')]=_[_0xe444('0x4a')](_0x19ba7f[_0xe444('0x49')],{'$or':_[_0xe444('0x37')](_0x19ba7f[_0xe444('0x40')],function(_0x26d26d){var _0x517f69={};_0x517f69[_0x26d26d]={'$like':'%'+_0x433304[_0xe444('0x3d')][_0xe444('0x4c')]+'%'};return _0x517f69;})});}_0x19ba7f=_[_0xe444('0x4a')]({},_0x19ba7f,_0x433304[_0xe444('0x52')]);return _0x4ea343[_0xe444('0x69')](_0x19ba7f);}})[_0xe444('0x1d')](function(_0x5b67eb){if(_0x5b67eb){_0x4cc1fb=_0x5b67eb[_0xe444('0x51')];if(!_0x433304[_0xe444('0x3d')][_0xe444('0x42')](_0xe444('0x43'))){_0x19ba7f['limit']=qs[_0xe444('0x44')](_0x433304[_0xe444('0x3d')]['limit']);_0x19ba7f[_0xe444('0x29')]=qs[_0xe444('0x29')](_0x433304[_0xe444('0x3d')]['offset']);}return _0x4ea343[_0xe444('0x69')](_0x19ba7f);}})['then'](function(_0x191d33){if(_0x191d33){return _0x191d33?{'count':_0x4cc1fb,'rows':_0x191d33}:null;}})[_0xe444('0x1d')](respondWithResult(_0x1d7b58,null))[_0xe444('0x55')](handleError(_0x1d7b58,null));};exports[_0xe444('0x6b')]=function(_0x1ad740,_0x193802,_0x1ef277){var _0x35ad6b=_0x1ad740[_0xe444('0x57')][_0xe444('0x6c')];return db[_0xe444('0x6a')][_0xe444('0x4f')]({'where':{'id':_0x35ad6b},'attributes':['id'],'include':[{'model':db[_0xe444('0x60')],'as':'Agents','attributes':['id',_0xe444('0x34'),'online',_0xe444('0x6d'),_0xe444('0x6e')],'raw':!![]}]})[_0xe444('0x1d')](function(_0x470146){if(_0x470146){var _0x263af2=_[_0xe444('0x6f')](_0x470146,function(_0x77eb3a){var _0x806511=_0x77eb3a['get']({'plain':!![]});return _0x806511[_0xe444('0x70')];});return db[_0xe444('0x53')][_0xe444('0x54')]({'where':{'id':_0x1ad740[_0xe444('0x5c')]['id']}})[_0xe444('0x1d')](function(_0x5e31ef){return db[_0xe444('0x71')]['transaction'](function(_0x1fa8ca){return _0x5e31ef[_0xe444('0x6b')](_0x35ad6b,{'transaction':_0x1fa8ca})['then'](function(){return BPromise['each'](_0x263af2,function(_0xb6cea6){return db[_0xe444('0x5e')]['findOrCreate']({'where':{'UserId':_0xb6cea6['id'],'ChatQueueId':_0x1ad740[_0xe444('0x5c')]['id']},'transaction':_0x1fa8ca});});})[_0xe444('0x1d')](function(){_0x263af2[_0xe444('0x72')](function(_0x1505f5){socket['emit'](_0xe444('0x73'),{'UserId':_0x1505f5['id'],'ChatQueueId':_0x5e31ef['id']});});});});});}})['then'](respondWithStatusCode(_0x193802,null))[_0xe444('0x55')](handleError(_0x193802,null));};exports[_0xe444('0x74')]=function(_0x55ff9d,_0x360236,_0xc46db3){return db[_0xe444('0x6a')][_0xe444('0x4f')]({'where':{'id':_0x55ff9d[_0xe444('0x3d')][_0xe444('0x6c')]},'attributes':['id'],'include':[{'model':db[_0xe444('0x60')],'as':_0xe444('0x70'),'attributes':['id'],'raw':!![]}]})[_0xe444('0x1d')](handleEntityNotFound(_0x360236,null))[_0xe444('0x1d')](function(_0x2d5a9c){var _0x281db5=_[_0xe444('0x37')](_0x2d5a9c,'id');var _0x15847a=[];var _0xbd2d75=[];var _0x4e85a0=squel[_0xe444('0x75')]();_0x4e85a0[_0xe444('0x76')](_0xe444('0x77'))[_0xe444('0x78')](_0xe444('0x79'),'tq')[_0xe444('0x7a')](_0xe444('0x7b'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xe444('0x49')](_0xe444('0x7c'),_0x55ff9d[_0xe444('0x5c')]['id']);for(var _0x1a4794=0x0;_0x1a4794<_0x2d5a9c[_0xe444('0x51')];_0x1a4794+=0x1){let _0x485e6c=_0x2d5a9c[_0x1a4794];for(var _0x27ee60=0x0;_0x27ee60<_0x485e6c[_0xe444('0x70')]['length'];_0x27ee60+=0x1){let _0x7664d4=_0x485e6c[_0xe444('0x70')][_0x27ee60];var _0x39cdc7=_0x4e85a0[_0xe444('0x7d')]();_0x39cdc7['where'](_0xe444('0x7e'),_0x7664d4['id']);_0xbd2d75[_0xe444('0x7f')](db[_0xe444('0x71')][_0xe444('0x3d')](_0x39cdc7['toString'](),{'type':db[_0xe444('0x71')][_0xe444('0x80')][_0xe444('0x81')]})['then'](function(_0x1f68a4){if(_0x1f68a4['length']===0x1){return _0x7664d4['id'];}else{var _0xfba77f=_[_0xe444('0x82')](_[_0xe444('0x37')](_0x1f68a4,_0xe444('0x83')),function(_0x27d038){return _[_0xe444('0x84')](_0x281db5,_0x27d038);});if(_0xfba77f){return _0x7664d4['id'];}}}));}}return BPromise[_0xe444('0x85')](_0xbd2d75)[_0xe444('0x1d')](function(_0xb32dd0){_0x15847a=_(_0x15847a)[_0xe444('0x86')](_0xb32dd0)[_0xe444('0x87')]()[_0xe444('0x88')]();return db[_0xe444('0x53')][_0xe444('0x54')]({'where':{'id':_0x55ff9d['params']['id']}})[_0xe444('0x1d')](function(_0x1cfe36){return db[_0xe444('0x71')][_0xe444('0x89')](function(_0x34db13){return _0x1cfe36[_0xe444('0x74')](_0x55ff9d[_0xe444('0x3d')][_0xe444('0x6c')],{'transaction':_0x34db13})['then'](function(){if(!_[_0xe444('0x8a')](_0x15847a)){return _0x1cfe36[_0xe444('0x8b')](_0x15847a,{'transaction':_0x34db13});}})[_0xe444('0x1d')](function(){_0x15847a[_0xe444('0x72')](function(_0x5e85de){socket[_0xe444('0x8c')](_0xe444('0x8d'),{'UserId':_0x5e85de,'ChatQueueId':_0x1cfe36['id']});});});});});});})['then'](respondWithStatusCode(_0x360236,null))[_0xe444('0x55')](handleError(_0x360236,null));};exports['addAgents']=function(_0x2474b5,_0x17529f,_0x2b16b0){return db[_0xe444('0x53')][_0xe444('0x54')]({'where':{'id':_0x2474b5[_0xe444('0x5c')]['id']}})[_0xe444('0x1d')](handleEntityNotFound(_0x17529f,null))[_0xe444('0x1d')](function(_0x1d2578){if(_0x1d2578){return _0x1d2578['addAgents'](_0x2474b5[_0xe444('0x57')][_0xe444('0x6c')],_[_0xe444('0x8e')](_0x2474b5['body'],[_0xe444('0x6c'),'id'])||{})['spread'](function(_0x5c1498){for(var _0x1add2c=0x0;_0x1add2c<_0x2474b5[_0xe444('0x57')][_0xe444('0x6c')]['length'];_0x1add2c+=0x1){socket['emit'](_0xe444('0x73'),{'UserId':_0x2474b5[_0xe444('0x57')][_0xe444('0x6c')][_0x1add2c],'ChatQueueId':_0x2474b5[_0xe444('0x5c')]['id']});}return _0x5c1498;});}})['then'](respondWithResult(_0x17529f,null))[_0xe444('0x55')](handleError(_0x17529f,null));};exports[_0xe444('0x8b')]=function(_0x29646a,_0x950511,_0x1bdae4){return db[_0xe444('0x53')][_0xe444('0x54')]({'where':{'id':_0x29646a['params']['id']}})['then'](handleEntityNotFound(_0x950511,null))[_0xe444('0x1d')](function(_0x141ede){if(_0x141ede){return _0x141ede[_0xe444('0x8b')](_0x29646a[_0xe444('0x3d')]['ids'])[_0xe444('0x1d')](function(){if(_[_0xe444('0x8f')](_0x29646a[_0xe444('0x3d')][_0xe444('0x6c')])){for(var _0xacc71e=0x0;_0xacc71e<_0x29646a['query'][_0xe444('0x6c')][_0xe444('0x51')];_0xacc71e+=0x1){socket[_0xe444('0x8c')](_0xe444('0x8d'),{'UserId':Number(_0x29646a[_0xe444('0x3d')][_0xe444('0x6c')][_0xacc71e]),'ChatQueueId':Number(_0x29646a['params']['id'])});}}else{socket[_0xe444('0x8c')]('userChatQueue:remove',{'UserId':Number(_0x29646a[_0xe444('0x3d')][_0xe444('0x6c')]),'ChatQueueId':Number(_0x29646a[_0xe444('0x5c')]['id'])});}});}})[_0xe444('0x1d')](respondWithStatusCode(_0x950511,null))[_0xe444('0x55')](handleError(_0x950511,null));};exports['getAgents']=function(_0x36f404,_0x146a7c,_0x3eb01c){var _0x330bc5={};var _0x2b6694={};var _0x5b3a35;var _0x269eae;return db['ChatQueue'][_0xe444('0x5d')]({'where':{'id':_0x36f404[_0xe444('0x5c')]['id']}})[_0xe444('0x1d')](handleEntityNotFound(_0x146a7c,null))[_0xe444('0x1d')](function(_0x371945){if(_0x371945){_0x5b3a35=_0x371945;_0x2b6694[_0xe444('0x3c')]=_[_0xe444('0x3e')](db['User'][_0xe444('0x38')]);_0x2b6694[_0xe444('0x3d')]=_[_0xe444('0x3e')](_0x36f404[_0xe444('0x3d')]);_0x2b6694[_0xe444('0x48')]=_[_0xe444('0x3f')](_0x2b6694[_0xe444('0x3c')],_0x2b6694[_0xe444('0x3d')]);_0x330bc5[_0xe444('0x40')]=_['intersection'](_0x2b6694['model'],qs[_0xe444('0x41')](_0x36f404['query'][_0xe444('0x41')]));_0x330bc5[_0xe444('0x40')]=_0x330bc5[_0xe444('0x40')]['length']?_0x330bc5['attributes']:_0x2b6694[_0xe444('0x3c')];_0x330bc5['order']=qs[_0xe444('0x46')](_0x36f404[_0xe444('0x3d')][_0xe444('0x46')]);_0x330bc5[_0xe444('0x49')]=qs['filters'](_[_0xe444('0x47')](_0x36f404[_0xe444('0x3d')],_0x2b6694[_0xe444('0x48')]));if(_0x36f404[_0xe444('0x3d')][_0xe444('0x4c')]){_0x330bc5[_0xe444('0x49')]=_[_0xe444('0x4a')](_0x330bc5[_0xe444('0x49')],{'$or':_[_0xe444('0x37')](_0x330bc5[_0xe444('0x40')],function(_0x5e40e4){var _0xdc52b3={};_0xdc52b3[_0x5e40e4]={'$like':'%'+_0x36f404[_0xe444('0x3d')][_0xe444('0x4c')]+'%'};return _0xdc52b3;})});}_0x330bc5=_[_0xe444('0x4a')]({},_0x330bc5,_0x36f404[_0xe444('0x52')]);return _0x5b3a35[_0xe444('0x90')](_0x330bc5);}})[_0xe444('0x1d')](function(_0x22475a){if(_0x22475a){_0x269eae=_0x22475a[_0xe444('0x51')];if(!_0x36f404['query']['hasOwnProperty']('nolimit')){_0x330bc5[_0xe444('0x44')]=qs[_0xe444('0x44')](_0x36f404['query'][_0xe444('0x44')]);_0x330bc5[_0xe444('0x29')]=qs[_0xe444('0x29')](_0x36f404['query'][_0xe444('0x29')]);}return _0x5b3a35['getAgents'](_0x330bc5);}})[_0xe444('0x1d')](function(_0x33f184){if(_0x33f184){return _0x33f184?{'count':_0x269eae,'rows':_0x33f184}:null;}})[_0xe444('0x1d')](respondWithResult(_0x146a7c,null))[_0xe444('0x55')](handleError(_0x146a7c,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 4acf33f..c75cfc4 100644 --- a/server/api/chatQueue/chatQueue.events.js +++ b/server/api/chatQueue/chatQueue.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['hasOwnProperty','hook','events','ChatQueue','setMaxListeners','save','remove','emit'];(function(_0x113f34,_0x2725cc){var _0x306811=function(_0x24be92){while(--_0x24be92){_0x113f34['push'](_0x113f34['shift']());}};_0x306811(++_0x2725cc);}(_0xb10b,0x12a));var _0xbb10=function(_0x5bda3b,_0x41160f){_0x5bda3b=_0x5bda3b-0x0;var _0x431bb9=_0xb10b[_0x5bda3b];return _0x431bb9;};'use strict';var EventEmitter=require(_0xbb10('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0xbb10('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xbb10('0x2')](0x0);var events={'afterCreate':_0xbb10('0x3'),'afterUpdate':'update','afterDestroy':_0xbb10('0x4')};function emitEvent(_0x9bbed){return function(_0x460981,_0x22320e,_0x49baf4){ChatQueueEvents[_0xbb10('0x5')](_0x9bbed+':'+_0x460981['id'],_0x460981);ChatQueueEvents['emit'](_0x9bbed,_0x460981);_0x49baf4(null);};}for(var e in events){if(events[_0xbb10('0x6')](e)){var event=events[e];ChatQueue[_0xbb10('0x7')](e,emitEvent(event));}}module['exports']=ChatQueueEvents; \ No newline at end of file +var _0xb10b=['hasOwnProperty','hook','events','ChatQueue','setMaxListeners','save','remove','emit'];(function(_0x416ce0,_0x212c61){var _0xd703a9=function(_0x35e327){while(--_0x35e327){_0x416ce0['push'](_0x416ce0['shift']());}};_0xd703a9(++_0x212c61);}(_0xb10b,0x12a));var _0xbb10=function(_0x4ed9c9,_0x1b9648){_0x4ed9c9=_0x4ed9c9-0x0;var _0x591fc0=_0xb10b[_0x4ed9c9];return _0x591fc0;};'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 621d13a..18db0f3 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 _0xee4e=['path','../../config/environment','./chatQueue.attributes','define','ChatQueue','util','api','moment','bluebird','request-promise'];(function(_0x1477f0,_0x55b555){var _0x5ddb2d=function(_0x1d9bd9){while(--_0x1d9bd9){_0x1477f0['push'](_0x1477f0['shift']());}};_0x5ddb2d(++_0x55b555);}(_0xee4e,0x131));var _0xeee4=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xee4e[_0x432682];return _0x463d05;};'use strict';var _=require('lodash');var util=require(_0xeee4('0x0'));var logger=require('../../config/logger')(_0xeee4('0x1'));var moment=require(_0xeee4('0x2'));var BPromise=require(_0xeee4('0x3'));var rp=require(_0xeee4('0x4'));var fs=require('fs');var path=require(_0xeee4('0x5'));var rimraf=require('rimraf');var config=require(_0xeee4('0x6'));var attributes=require(_0xeee4('0x7'));module['exports']=function(_0x13c291,_0x33ea0b){return _0x13c291[_0xeee4('0x8')](_0xeee4('0x9'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x22b6=['path','rimraf','exports','define','ChatQueue','chat_queues','util','../../config/logger','bluebird','request-promise'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0x22b6,0xce));var _0x622b=function(_0x24e6fa,_0x25cc0a){_0x24e6fa=_0x24e6fa-0x0;var _0x18e1b2=_0x22b6[_0x24e6fa];return _0x18e1b2;};'use strict';var _=require('lodash');var util=require(_0x622b('0x0'));var logger=require(_0x622b('0x1'))('api');var moment=require('moment');var BPromise=require(_0x622b('0x2'));var rp=require(_0x622b('0x3'));var fs=require('fs');var path=require(_0x622b('0x4'));var rimraf=require(_0x622b('0x5'));var config=require('../../config/environment');var attributes=require('./chatQueue.attributes');module[_0x622b('0x6')]=function(_0x3d1fe0,_0x2ca00f){return _0x3d1fe0[_0x622b('0x7')](_0x622b('0x8'),attributes,{'tableName':_0x622b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js index e8d2579..c92794c 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 _0x3cae=['./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','ChatQueue','findAll','options','attributes','limit','include','map','model','GetChatQueue','ShowChatQueue','find','raw','where','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter'];(function(_0xa3463d,_0x32f8da){var _0x50fd67=function(_0xb984fd){while(--_0xb984fd){_0xa3463d['push'](_0xa3463d['shift']());}};_0x50fd67(++_0x32f8da);}(_0x3cae,0x117));var _0xe3ca=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0x3cae[_0x1da04e];return _0xdd8c41;};'use strict';var _=require(_0xe3ca('0x0'));var util=require(_0xe3ca('0x1'));var moment=require(_0xe3ca('0x2'));var BPromise=require(_0xe3ca('0x3'));var rs=require(_0xe3ca('0x4'));var fs=require('fs');var Redis=require(_0xe3ca('0x5'));var db=require(_0xe3ca('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xe3ca('0x7'))(_0xe3ca('0x8'));var config=require('../../config/environment');var jayson=require(_0xe3ca('0x9'));var client=jayson['client'][_0xe3ca('0xa')]({'port':0x232a});config[_0xe3ca('0xb')]=_[_0xe3ca('0xc')](config['redis'],{'host':_0xe3ca('0xd'),'port':0x18eb});var socket=require(_0xe3ca('0xe'))(new Redis(config[_0xe3ca('0xb')]));require(_0xe3ca('0xf'))[_0xe3ca('0x10')](socket);function respondWithRpcPromise(_0x1785c5,_0x423bba,_0x57a3d5){return new BPromise(function(_0xca87b3,_0x59394d){return client[_0xe3ca('0x11')](_0x1785c5,_0x57a3d5)[_0xe3ca('0x12')](function(_0x219866){logger[_0xe3ca('0x13')](_0xe3ca('0x14'),_0x423bba,'request\x20sent');logger['debug'](_0xe3ca('0x15'),_0x423bba,'request\x20sent',JSON[_0xe3ca('0x16')](_0x219866));if(_0x219866[_0xe3ca('0x17')]){if(_0x219866['error'][_0xe3ca('0x18')]===0x1f4){logger[_0xe3ca('0x17')](_0xe3ca('0x14'),_0x423bba,_0x219866[_0xe3ca('0x17')][_0xe3ca('0x19')]);return _0x59394d(_0x219866[_0xe3ca('0x17')][_0xe3ca('0x19')]);}logger[_0xe3ca('0x17')]('ChatQueue,\x20%s,\x20%s',_0x423bba,_0x219866['error'][_0xe3ca('0x19')]);return _0xca87b3(_0x219866[_0xe3ca('0x17')][_0xe3ca('0x19')]);}else{logger[_0xe3ca('0x13')](_0xe3ca('0x14'),_0x423bba,_0xe3ca('0x1a'));_0xca87b3(_0x219866['result'][_0xe3ca('0x19')]);}})[_0xe3ca('0x1b')](function(_0x180699){logger['error']('ChatQueue,\x20%s,\x20%s',_0x423bba,_0x180699);_0x59394d(_0x180699);});});}exports['GetChatQueue']=function(_0x21c516){var _0x593fd1=this;return new Promise(function(_0x508317,_0x3b7591){return db[_0xe3ca('0x1c')][_0xe3ca('0x1d')]({'raw':_0x21c516[_0xe3ca('0x1e')]?_0x21c516[_0xe3ca('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x21c516[_0xe3ca('0x1e')]?_0x21c516[_0xe3ca('0x1e')]['where']||null:null,'attributes':_0x21c516[_0xe3ca('0x1e')]?_0x21c516[_0xe3ca('0x1e')][_0xe3ca('0x1f')]||null:null,'limit':_0x21c516[_0xe3ca('0x1e')]?_0x21c516[_0xe3ca('0x1e')][_0xe3ca('0x20')]||null:null,'include':_0x21c516[_0xe3ca('0x1e')]?_0x21c516[_0xe3ca('0x1e')][_0xe3ca('0x21')]?_[_0xe3ca('0x22')](_0x21c516[_0xe3ca('0x1e')]['include'],function(_0x16e1d6){return{'model':db[_0x16e1d6['model']],'as':_0x16e1d6['as'],'attributes':_0x16e1d6[_0xe3ca('0x1f')],'include':_0x16e1d6[_0xe3ca('0x21')]?_[_0xe3ca('0x22')](_0x16e1d6[_0xe3ca('0x21')],function(_0x576491){return{'model':db[_0x576491['model']],'as':_0x576491['as'],'attributes':_0x576491[_0xe3ca('0x1f')],'include':_0x576491[_0xe3ca('0x21')]?_[_0xe3ca('0x22')](_0x576491['include'],function(_0x1dbd98){return{'model':db[_0x1dbd98[_0xe3ca('0x23')]],'as':_0x1dbd98['as'],'attributes':_0x1dbd98[_0xe3ca('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xe3ca('0x12')](function(_0x532662){logger['info'](_0xe3ca('0x24'),_0x21c516);logger['debug'](_0xe3ca('0x24'),_0x21c516,JSON['stringify'](_0x532662));_0x508317(_0x532662);})['catch'](function(_0xd5e714){logger[_0xe3ca('0x17')](_0xe3ca('0x24'),_0xd5e714[_0xe3ca('0x19')],_0x21c516);_0x3b7591(_0x593fd1[_0xe3ca('0x17')](0x1f4,_0xd5e714['message']));});});};exports[_0xe3ca('0x25')]=function(_0x50f226){var _0x5b2e69=this;return new Promise(function(_0x5bf12f,_0x1acc28){return db[_0xe3ca('0x1c')][_0xe3ca('0x26')]({'raw':_0x50f226[_0xe3ca('0x1e')]?_0x50f226[_0xe3ca('0x1e')][_0xe3ca('0x27')]===undefined?!![]:![]:!![],'where':_0x50f226[_0xe3ca('0x1e')]?_0x50f226[_0xe3ca('0x1e')][_0xe3ca('0x28')]||null:null,'attributes':_0x50f226[_0xe3ca('0x1e')]?_0x50f226[_0xe3ca('0x1e')]['attributes']||null:null,'include':_0x50f226[_0xe3ca('0x1e')]?_0x50f226[_0xe3ca('0x1e')][_0xe3ca('0x21')]?_[_0xe3ca('0x22')](_0x50f226[_0xe3ca('0x1e')][_0xe3ca('0x21')],function(_0x59413d){return{'model':db[_0x59413d[_0xe3ca('0x23')]],'as':_0x59413d['as'],'attributes':_0x59413d[_0xe3ca('0x1f')],'include':_0x59413d[_0xe3ca('0x21')]?_[_0xe3ca('0x22')](_0x59413d[_0xe3ca('0x21')],function(_0x396a0a){return{'model':db[_0x396a0a[_0xe3ca('0x23')]],'as':_0x396a0a['as'],'attributes':_0x396a0a[_0xe3ca('0x1f')],'include':_0x396a0a[_0xe3ca('0x21')]?_['map'](_0x396a0a[_0xe3ca('0x21')],function(_0x1effdb){return{'model':db[_0x1effdb['model']],'as':_0x1effdb['as'],'attributes':_0x1effdb[_0xe3ca('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xe3ca('0x12')](function(_0x3cf213){logger['info'](_0xe3ca('0x25'),_0x50f226);logger[_0xe3ca('0x29')]('ShowChatQueue',_0x50f226,JSON[_0xe3ca('0x16')](_0x3cf213));_0x5bf12f(_0x3cf213);})['catch'](function(_0x4efb4c){logger[_0xe3ca('0x17')](_0xe3ca('0x25'),_0x4efb4c['message'],_0x50f226);_0x1acc28(_0x5b2e69[_0xe3ca('0x17')](0x1f4,_0x4efb4c[_0xe3ca('0x19')]));});});}; \ No newline at end of file +var _0x434a=['map','then','catch','ShowChatQueue','ChatQueue','find','where','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','./chatQueue.socket','register','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetChatQueue','options','raw','attributes','include','model'];(function(_0x4222b5,_0x92a34f){var _0x258356=function(_0x734da1){while(--_0x734da1){_0x4222b5['push'](_0x4222b5['shift']());}};_0x258356(++_0x92a34f);}(_0x434a,0x9f));var _0xa434=function(_0xd71443,_0x3dbbb3){_0xd71443=_0xd71443-0x0;var _0x550ce4=_0x434a[_0xd71443];return _0x550ce4;};'use strict';var _=require(_0xa434('0x0'));var util=require(_0xa434('0x1'));var moment=require('moment');var BPromise=require(_0xa434('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa434('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa434('0x4'));var logger=require(_0xa434('0x5'))(_0xa434('0x6'));var config=require('../../config/environment');var jayson=require(_0xa434('0x7'));var client=jayson[_0xa434('0x8')][_0xa434('0x9')]({'port':0x232a});config['redis']=_[_0xa434('0xa')](config[_0xa434('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xa434('0xc'))[_0xa434('0xd')](socket);function respondWithRpcPromise(_0x3e53c9,_0x50ff6d,_0x2ba9ad){return new BPromise(function(_0x3d4950,_0x18f427){return client[_0xa434('0xe')](_0x3e53c9,_0x2ba9ad)['then'](function(_0x5f2832){logger[_0xa434('0xf')](_0xa434('0x10'),_0x50ff6d,_0xa434('0x11'));logger[_0xa434('0x12')](_0xa434('0x13'),_0x50ff6d,_0xa434('0x11'),JSON[_0xa434('0x14')](_0x5f2832));if(_0x5f2832[_0xa434('0x15')]){if(_0x5f2832['error'][_0xa434('0x16')]===0x1f4){logger[_0xa434('0x15')]('ChatQueue,\x20%s,\x20%s',_0x50ff6d,_0x5f2832[_0xa434('0x15')][_0xa434('0x17')]);return _0x18f427(_0x5f2832[_0xa434('0x15')][_0xa434('0x17')]);}logger[_0xa434('0x15')](_0xa434('0x10'),_0x50ff6d,_0x5f2832['error'][_0xa434('0x17')]);return _0x3d4950(_0x5f2832['error'][_0xa434('0x17')]);}else{logger[_0xa434('0xf')](_0xa434('0x10'),_0x50ff6d,'request\x20sent');_0x3d4950(_0x5f2832[_0xa434('0x18')]['message']);}})['catch'](function(_0x4fcc6c){logger[_0xa434('0x15')]('ChatQueue,\x20%s,\x20%s',_0x50ff6d,_0x4fcc6c);_0x18f427(_0x4fcc6c);});});}exports[_0xa434('0x19')]=function(_0x21fe0d){var _0x1aa275=this;return new Promise(function(_0x142d19,_0x26d612){return db['ChatQueue']['findAll']({'raw':_0x21fe0d[_0xa434('0x1a')]?_0x21fe0d[_0xa434('0x1a')][_0xa434('0x1b')]===undefined?!![]:![]:!![],'where':_0x21fe0d[_0xa434('0x1a')]?_0x21fe0d[_0xa434('0x1a')]['where']||null:null,'attributes':_0x21fe0d['options']?_0x21fe0d[_0xa434('0x1a')][_0xa434('0x1c')]||null:null,'limit':_0x21fe0d['options']?_0x21fe0d[_0xa434('0x1a')]['limit']||null:null,'include':_0x21fe0d[_0xa434('0x1a')]?_0x21fe0d[_0xa434('0x1a')]['include']?_['map'](_0x21fe0d[_0xa434('0x1a')][_0xa434('0x1d')],function(_0x56b2dc){return{'model':db[_0x56b2dc[_0xa434('0x1e')]],'as':_0x56b2dc['as'],'attributes':_0x56b2dc[_0xa434('0x1c')],'include':_0x56b2dc[_0xa434('0x1d')]?_['map'](_0x56b2dc[_0xa434('0x1d')],function(_0x3a907d){return{'model':db[_0x3a907d[_0xa434('0x1e')]],'as':_0x3a907d['as'],'attributes':_0x3a907d[_0xa434('0x1c')],'include':_0x3a907d[_0xa434('0x1d')]?_[_0xa434('0x1f')](_0x3a907d[_0xa434('0x1d')],function(_0x1a7259){return{'model':db[_0x1a7259[_0xa434('0x1e')]],'as':_0x1a7259['as'],'attributes':_0x1a7259[_0xa434('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa434('0x20')](function(_0x10612c){logger[_0xa434('0xf')](_0xa434('0x19'),_0x21fe0d);logger[_0xa434('0x12')](_0xa434('0x19'),_0x21fe0d,JSON['stringify'](_0x10612c));_0x142d19(_0x10612c);})[_0xa434('0x21')](function(_0x1a97b){logger[_0xa434('0x15')](_0xa434('0x19'),_0x1a97b[_0xa434('0x17')],_0x21fe0d);_0x26d612(_0x1aa275[_0xa434('0x15')](0x1f4,_0x1a97b[_0xa434('0x17')]));});});};exports[_0xa434('0x22')]=function(_0x1db7db){var _0x169abe=this;return new Promise(function(_0x41be40,_0x2b43f5){return db[_0xa434('0x23')][_0xa434('0x24')]({'raw':_0x1db7db[_0xa434('0x1a')]?_0x1db7db[_0xa434('0x1a')][_0xa434('0x1b')]===undefined?!![]:![]:!![],'where':_0x1db7db['options']?_0x1db7db[_0xa434('0x1a')][_0xa434('0x25')]||null:null,'attributes':_0x1db7db[_0xa434('0x1a')]?_0x1db7db[_0xa434('0x1a')][_0xa434('0x1c')]||null:null,'include':_0x1db7db[_0xa434('0x1a')]?_0x1db7db[_0xa434('0x1a')][_0xa434('0x1d')]?_[_0xa434('0x1f')](_0x1db7db[_0xa434('0x1a')][_0xa434('0x1d')],function(_0x326b1e){return{'model':db[_0x326b1e['model']],'as':_0x326b1e['as'],'attributes':_0x326b1e[_0xa434('0x1c')],'include':_0x326b1e[_0xa434('0x1d')]?_[_0xa434('0x1f')](_0x326b1e[_0xa434('0x1d')],function(_0x2167f4){return{'model':db[_0x2167f4[_0xa434('0x1e')]],'as':_0x2167f4['as'],'attributes':_0x2167f4[_0xa434('0x1c')],'include':_0x2167f4[_0xa434('0x1d')]?_[_0xa434('0x1f')](_0x2167f4['include'],function(_0xb3ffd){return{'model':db[_0xb3ffd[_0xa434('0x1e')]],'as':_0xb3ffd['as'],'attributes':_0xb3ffd[_0xa434('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa434('0x20')](function(_0x521215){logger[_0xa434('0xf')](_0xa434('0x22'),_0x1db7db);logger[_0xa434('0x12')]('ShowChatQueue',_0x1db7db,JSON[_0xa434('0x14')](_0x521215));_0x41be40(_0x521215);})[_0xa434('0x21')](function(_0x19c5e7){logger[_0xa434('0x15')](_0xa434('0x22'),_0x19c5e7[_0xa434('0x17')],_0x1db7db);_0x2b43f5(_0x169abe[_0xa434('0x15')](0x1f4,_0x19c5e7['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index cbc7765..8032f0b 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 _0xb10b=['emit','removeListener','register','chatQueue:','./chatQueue.events','remove','update'];(function(_0x4b3413,_0x58c416){var _0x3b01ba=function(_0xb25f43){while(--_0xb25f43){_0x4b3413['push'](_0x4b3413['shift']());}};_0x3b01ba(++_0x58c416);}(_0xb10b,0x12a));var _0xbb10=function(_0x241207,_0x39a50c){_0x241207=_0x241207-0x0;var _0x26f4ce=_0xb10b[_0x241207];return _0x26f4ce;};'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 +var _0xbaf0=['removeListener','register','length','chatQueue:','save','remove','update'];(function(_0x47813f,_0x4c662b){var _0x3cd31a=function(_0xfa0b70){while(--_0xfa0b70){_0x47813f['push'](_0x47813f['shift']());}};_0x3cd31a(++_0x4c662b);}(_0xbaf0,0x12a));var _0x0baf=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xbaf0[_0x4cf98e];return _0x1623ac;};'use strict';var ChatQueueEvents=require('./chatQueue.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(){ChatQueueEvents[_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);ChatQueueEvents['on'](_0x1d0a0d,_0x5f5030);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 1f58537..955efa5 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 _0x5e52=['../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','describe','/:id','show','/:id/teams','getTeams','/:id/users','getAgents','post','addAgents','put','update','delete','destroy','removeAgents','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x27833f,_0x3c419e){var _0x5be8a4=function(_0x396974){while(--_0x396974){_0x27833f['push'](_0x27833f['shift']());}};_0x5be8a4(++_0x3c419e);}(_0x5e52,0x7c));var _0x25e5=function(_0x34f99d,_0x17e35f){_0x34f99d=_0x34f99d-0x0;var _0x2d9c27=_0x5e52[_0x34f99d];return _0x2d9c27;};'use strict';var multer=require(_0x25e5('0x0'));var util=require(_0x25e5('0x1'));var path=require(_0x25e5('0x2'));var timeout=require(_0x25e5('0x3'));var express=require(_0x25e5('0x4'));var router=express[_0x25e5('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x25e5('0x6'));var config=require(_0x25e5('0x7'));var controller=require(_0x25e5('0x8'));router[_0x25e5('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x25e5('0x9')]('/describe',auth[_0x25e5('0xa')](),controller[_0x25e5('0xb')]);router[_0x25e5('0x9')](_0x25e5('0xc'),auth['isAuthenticated'](),controller[_0x25e5('0xd')]);router[_0x25e5('0x9')]('/:id/members',auth[_0x25e5('0xa')](),controller['getMembers']);router['get'](_0x25e5('0xe'),auth[_0x25e5('0xa')](),controller[_0x25e5('0xf')]);router[_0x25e5('0x9')](_0x25e5('0x10'),auth['isAuthenticated'](),controller[_0x25e5('0x11')]);router[_0x25e5('0x12')]('/',auth[_0x25e5('0xa')](),controller['create']);router[_0x25e5('0x12')]('/:id/teams',auth[_0x25e5('0xa')](),controller['addTeams']);router[_0x25e5('0x12')](_0x25e5('0x10'),auth[_0x25e5('0xa')](),controller[_0x25e5('0x13')]);router[_0x25e5('0x14')](_0x25e5('0xc'),auth[_0x25e5('0xa')](),controller[_0x25e5('0x15')]);router[_0x25e5('0x16')](_0x25e5('0xc'),auth[_0x25e5('0xa')](),controller[_0x25e5('0x17')]);router[_0x25e5('0x16')](_0x25e5('0xe'),auth[_0x25e5('0xa')](),controller['removeTeams']);router['delete'](_0x25e5('0x10'),auth['isAuthenticated'](),controller[_0x25e5('0x18')]);module[_0x25e5('0x19')]=router; \ No newline at end of file +var _0x3dc4=['addTeams','put','/:id','destroy','delete','removeTeams','/:id/users','removeAgents','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','describe','get','show','/:id/members','getMembers','/:id/teams','getTeams','getAgents','post','create'];(function(_0x5586d8,_0x2bb671){var _0x24ea96=function(_0x2daca7){while(--_0x2daca7){_0x5586d8['push'](_0x5586d8['shift']());}};_0x24ea96(++_0x2bb671);}(_0x3dc4,0x167));var _0x43dc=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x3dc4[_0x4b369d];return _0x571a98;};'use strict';var multer=require(_0x43dc('0x0'));var util=require(_0x43dc('0x1'));var path=require(_0x43dc('0x2'));var timeout=require(_0x43dc('0x3'));var express=require('express');var router=express[_0x43dc('0x4')]();var auth=require(_0x43dc('0x5'));var interaction=require(_0x43dc('0x6'));var config=require(_0x43dc('0x7'));var controller=require('./chatQueue.controller');router['get']('/',auth[_0x43dc('0x8')](),controller['index']);router['get']('/describe',auth[_0x43dc('0x8')](),controller[_0x43dc('0x9')]);router[_0x43dc('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x43dc('0xb')]);router[_0x43dc('0xa')](_0x43dc('0xc'),auth[_0x43dc('0x8')](),controller[_0x43dc('0xd')]);router[_0x43dc('0xa')](_0x43dc('0xe'),auth['isAuthenticated'](),controller[_0x43dc('0xf')]);router[_0x43dc('0xa')]('/:id/users',auth['isAuthenticated'](),controller[_0x43dc('0x10')]);router[_0x43dc('0x11')]('/',auth[_0x43dc('0x8')](),controller[_0x43dc('0x12')]);router[_0x43dc('0x11')](_0x43dc('0xe'),auth[_0x43dc('0x8')](),controller[_0x43dc('0x13')]);router[_0x43dc('0x11')]('/:id/users',auth[_0x43dc('0x8')](),controller['addAgents']);router[_0x43dc('0x14')](_0x43dc('0x15'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x43dc('0x15'),auth[_0x43dc('0x8')](),controller[_0x43dc('0x16')]);router[_0x43dc('0x17')](_0x43dc('0xe'),auth[_0x43dc('0x8')](),controller[_0x43dc('0x18')]);router[_0x43dc('0x17')](_0x43dc('0x19'),auth['isAuthenticated'](),controller[_0x43dc('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 886410a..19ac289 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 _0x90e7=['STRING','DATE','moment'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0x90e7,0xbc));var _0x790e=function(_0x35d3e7,_0x50f65e){_0x35d3e7=_0x35d3e7-0x0;var _0x4f2ea3=_0x90e7[_0x35d3e7];return _0x4f2ea3;};'use strict';var moment=require(_0x790e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x790e('0x1')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x790e('0x2')]},'exitAt':{'type':Sequelize[_0x790e('0x2')]},'reason':{'type':Sequelize[_0x790e('0x1')]}}; \ No newline at end of file +var _0x3edb=['DATE','moment','exports','STRING'];(function(_0x32bcb4,_0x2257dd){var _0x4a68a8=function(_0x452465){while(--_0x452465){_0x32bcb4['push'](_0x32bcb4['shift']());}};_0x4a68a8(++_0x2257dd);}(_0x3edb,0x1e1));var _0xb3ed=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0x3edb[_0x4baae2];return _0x1a2285;};'use strict';var moment=require(_0xb3ed('0x0'));var Sequelize=require('sequelize');module[_0xb3ed('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xb3ed('0x2')]},'joinAt':{'type':Sequelize[_0xb3ed('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xb3ed('0x3')]},'reason':{'type':Sequelize[_0xb3ed('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 0aa2825..d12cac9 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 _0x011f=['../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','apply','save','update','destroy','then','error','stack','name','send','index','ChatQueueReport','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','filter','map','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','squel','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x1440fd,_0x16653e){var _0x30ca02=function(_0x38f1cd){while(--_0x38f1cd){_0x1440fd['push'](_0x1440fd['shift']());}};_0x30ca02(++_0x16653e);}(_0x011f,0x15a));var _0xf011=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x011f[_0x2c7618];return _0x5ce3f0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf011('0x0'));var rimraf=require(_0xf011('0x1'));var zipdir=require(_0xf011('0x2'));var jsonpatch=require(_0xf011('0x3'));var rp=require(_0xf011('0x4'));var moment=require(_0xf011('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xf011('0x6'));var util=require(_0xf011('0x7'));var path=require(_0xf011('0x8'));var sox=require('sox');var csv=require(_0xf011('0x9'));var ejs=require(_0xf011('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xf011('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf011('0xc'));var toCsv=require(_0xf011('0x9'));var querystring=require('querystring');var Papa=require(_0xf011('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf011('0xe'));var as=require(_0xf011('0xf'));var hardwareService=require(_0xf011('0x10'));var logger=require(_0xf011('0x11'))(_0xf011('0x12'));var utils=require(_0xf011('0x13'));var config=require(_0xf011('0x14'));var db=require(_0xf011('0x15'))['db'];function respondWithStatusCode(_0x334f72,_0x58fd2c){_0x58fd2c=_0x58fd2c||0xcc;return function(_0x5d3896){if(_0x5d3896){return _0x334f72[_0xf011('0x16')](_0x58fd2c);}return _0x334f72[_0xf011('0x17')](_0x58fd2c)[_0xf011('0x18')]();};}function respondWithResult(_0x3a42dd,_0x55a53b){_0x55a53b=_0x55a53b||0xc8;return function(_0x25814d){if(_0x25814d){return _0x3a42dd[_0xf011('0x17')](_0x55a53b)[_0xf011('0x19')](_0x25814d);}};}function respondWithFilteredResult(_0x1bde02,_0x6a44ef){return function(_0x52fddc){if(_0x52fddc){var _0x44ee6a=_0x52fddc[_0xf011('0x1a')],_0x20c241=_0x6a44ef[_0xf011('0x1b')],_0x47710f=_0x6a44ef[_0xf011('0x1b')]+_0x6a44ef['limit'],_0x5bb518;if(_0x47710f>=_0x44ee6a){_0x47710f=_0x44ee6a;_0x5bb518=0xc8;}else{_0x5bb518=0xce;}_0x1bde02['status'](_0x5bb518);return _0x1bde02[_0xf011('0x1c')]('Content-Range',_0x20c241+'-'+_0x47710f+'/'+_0x44ee6a)[_0xf011('0x19')](_0x52fddc);}return null;};}function patchUpdates(_0x9642bf){return function(_0x3a72cc){try{jsonpatch[_0xf011('0x1d')](_0x3a72cc,_0x9642bf,!![]);}catch(_0x4fd8b0){return BPromise['reject'](_0x4fd8b0);}return _0x3a72cc[_0xf011('0x1e')]();};}function saveUpdates(_0x529cc,_0xc6e05e){return function(_0x2aebf8){if(_0x2aebf8){return _0x2aebf8[_0xf011('0x1f')](_0x529cc)['then'](function(_0x4e8a78){return _0x4e8a78;});}return null;};}function removeEntity(_0x19a3c9,_0x2d97af){return function(_0x31c1f6){if(_0x31c1f6){return _0x31c1f6[_0xf011('0x20')]()[_0xf011('0x21')](function(){_0x19a3c9[_0xf011('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x506e2c,_0x13072f){return function(_0x54cdf4){if(!_0x54cdf4){_0x506e2c[_0xf011('0x16')](0x194);}return _0x54cdf4;};}function handleError(_0x30cc4c,_0x37a0f2){_0x37a0f2=_0x37a0f2||0x1f4;return function(_0x131879){logger[_0xf011('0x22')](_0x131879[_0xf011('0x23')]);if(_0x131879[_0xf011('0x24')]){delete _0x131879['name'];}_0x30cc4c[_0xf011('0x17')](_0x37a0f2)[_0xf011('0x25')](_0x131879);};}exports[_0xf011('0x26')]=function(_0x336715,_0x267a5c){var _0x3214fb={},_0x50917c={},_0x41a9fd={'count':0x0,'rows':[]};var _0x4b2333=_['map'](db[_0xf011('0x27')][_0xf011('0x28')],function(_0x5ebf0a){return{'name':_0x5ebf0a[_0xf011('0x29')],'type':_0x5ebf0a[_0xf011('0x2a')]['key']};});_0x50917c['model']=_['map'](_0x4b2333,_0xf011('0x24'));_0x50917c[_0xf011('0x2b')]=_[_0xf011('0x2c')](_0x336715[_0xf011('0x2b')]);_0x50917c[_0xf011('0x2d')]=_[_0xf011('0x2e')](_0x50917c[_0xf011('0x2f')],_0x50917c['query']);_0x3214fb[_0xf011('0x30')]=_[_0xf011('0x2e')](_0x50917c[_0xf011('0x2f')],qs['fields'](_0x336715[_0xf011('0x2b')][_0xf011('0x31')]));_0x3214fb[_0xf011('0x30')]=_0x3214fb[_0xf011('0x30')]['length']?_0x3214fb[_0xf011('0x30')]:_0x50917c[_0xf011('0x2f')];if(!_0x336715[_0xf011('0x2b')][_0xf011('0x32')](_0xf011('0x33'))){_0x3214fb[_0xf011('0x34')]=qs['limit'](_0x336715[_0xf011('0x2b')][_0xf011('0x34')]);_0x3214fb['offset']=qs['offset'](_0x336715[_0xf011('0x2b')][_0xf011('0x1b')]);}_0x3214fb[_0xf011('0x35')]=qs[_0xf011('0x36')](_0x336715[_0xf011('0x2b')][_0xf011('0x36')]);_0x3214fb[_0xf011('0x37')]=qs[_0xf011('0x2d')](_['pick'](_0x336715[_0xf011('0x2b')],_0x50917c[_0xf011('0x2d')]));if(_0x336715[_0xf011('0x2b')][_0xf011('0x38')]){_0x3214fb[_0xf011('0x37')]=_['merge'](_0x3214fb[_0xf011('0x37')],{'$or':_[_0xf011('0x39')](_0x4b2333,function(_0x13b0cf){if(_0x13b0cf['type']!==_0xf011('0x3a')){var _0x4c802c={};_0x4c802c[_0x13b0cf['name']]={'$like':'%'+_0x336715[_0xf011('0x2b')][_0xf011('0x38')]+'%'};return _0x4c802c;}})});}_0x3214fb=_[_0xf011('0x3b')]({},_0x3214fb,_0x336715[_0xf011('0x3c')]);var _0xc83c6f={'where':_0x3214fb[_0xf011('0x37')]};return db[_0xf011('0x27')][_0xf011('0x1a')](_0xc83c6f)[_0xf011('0x21')](function(_0x3f412e){_0x41a9fd[_0xf011('0x1a')]=_0x3f412e;if(_0x336715[_0xf011('0x2b')][_0xf011('0x3d')]){_0x3214fb[_0xf011('0x3e')]=[{'all':!![]}];}return db[_0xf011('0x27')][_0xf011('0x3f')](_0x3214fb);})['then'](function(_0x2d2eb6){_0x41a9fd[_0xf011('0x40')]=_0x2d2eb6;return _0x41a9fd;})[_0xf011('0x21')](respondWithFilteredResult(_0x267a5c,_0x3214fb))[_0xf011('0x41')](handleError(_0x267a5c,null));};exports[_0xf011('0x42')]=function(_0x2354d1,_0x734965){var _0x7df9c2={'raw':!![],'where':{'id':_0x2354d1[_0xf011('0x43')]['id']}},_0x4f29b2={};_0x4f29b2[_0xf011('0x2f')]=_['keys'](db['ChatQueueReport'][_0xf011('0x28')]);_0x4f29b2['query']=_[_0xf011('0x2c')](_0x2354d1[_0xf011('0x2b')]);_0x4f29b2['filters']=_[_0xf011('0x2e')](_0x4f29b2[_0xf011('0x2f')],_0x4f29b2[_0xf011('0x2b')]);_0x7df9c2[_0xf011('0x30')]=_[_0xf011('0x2e')](_0x4f29b2[_0xf011('0x2f')],qs[_0xf011('0x31')](_0x2354d1[_0xf011('0x2b')][_0xf011('0x31')]));_0x7df9c2[_0xf011('0x30')]=_0x7df9c2[_0xf011('0x30')][_0xf011('0x44')]?_0x7df9c2['attributes']:_0x4f29b2[_0xf011('0x2f')];if(_0x2354d1[_0xf011('0x2b')][_0xf011('0x3d')]){_0x7df9c2[_0xf011('0x3e')]=[{'all':!![]}];}_0x7df9c2=_[_0xf011('0x3b')]({},_0x7df9c2,_0x2354d1[_0xf011('0x3c')]);return db['ChatQueueReport'][_0xf011('0x45')](_0x7df9c2)[_0xf011('0x21')](handleEntityNotFound(_0x734965,null))['then'](respondWithResult(_0x734965,null))[_0xf011('0x41')](handleError(_0x734965,null));};exports[_0xf011('0x46')]=function(_0x389d31,_0x28269c){return db[_0xf011('0x27')]['create'](_0x389d31[_0xf011('0x47')],{})[_0xf011('0x21')](respondWithResult(_0x28269c,0xc9))['catch'](handleError(_0x28269c,null));};exports[_0xf011('0x1f')]=function(_0x4d9949,_0xb2a47f){if(_0x4d9949['body']['id']){delete _0x4d9949[_0xf011('0x47')]['id'];}return db['ChatQueueReport']['find']({'where':{'id':_0x4d9949[_0xf011('0x43')]['id']}})[_0xf011('0x21')](handleEntityNotFound(_0xb2a47f,null))[_0xf011('0x21')](saveUpdates(_0x4d9949[_0xf011('0x47')],null))[_0xf011('0x21')](respondWithResult(_0xb2a47f,null))[_0xf011('0x41')](handleError(_0xb2a47f,null));};exports[_0xf011('0x20')]=function(_0x153ae6,_0x9c17a6){return db[_0xf011('0x27')][_0xf011('0x45')]({'where':{'id':_0x153ae6[_0xf011('0x43')]['id']}})[_0xf011('0x21')](handleEntityNotFound(_0x9c17a6,null))['then'](removeEntity(_0x9c17a6,null))[_0xf011('0x41')](handleError(_0x9c17a6,null));};exports[_0xf011('0x48')]=function(_0x5994f7,_0x2ccef6){return db[_0xf011('0x27')][_0xf011('0x48')]()[_0xf011('0x21')](respondWithResult(_0x2ccef6,null))[_0xf011('0x41')](handleError(_0x2ccef6,null));}; \ No newline at end of file +var _0x013c=['key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','options','includeAll','include','findAll','catch','params','merge','find','create','body','destroy','describe','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','type'];(function(_0xbe200f,_0x4b50eb){var _0x192597=function(_0x106cfd){while(--_0x106cfd){_0xbe200f['push'](_0xbe200f['shift']());}};_0x192597(++_0x4b50eb);}(_0x013c,0x150));var _0xc013=function(_0x2ac5f8,_0x4c3a9f){_0x2ac5f8=_0x2ac5f8-0x0;var _0x3b8229=_0x013c[_0x2ac5f8];return _0x3b8229;};'use strict';var pdf=require(_0xc013('0x0'));var emlformat=require(_0xc013('0x1'));var rimraf=require(_0xc013('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc013('0x3'));var rp=require('request-promise');var moment=require(_0xc013('0x4'));var BPromise=require(_0xc013('0x5'));var Mustache=require(_0xc013('0x6'));var util=require(_0xc013('0x7'));var path=require(_0xc013('0x8'));var sox=require(_0xc013('0x9'));var csv=require(_0xc013('0xa'));var ejs=require(_0xc013('0xb'));var fs=require('fs');var _=require(_0xc013('0xc'));var squel=require(_0xc013('0xd'));var crypto=require(_0xc013('0xe'));var jsforce=require(_0xc013('0xf'));var deskjs=require(_0xc013('0x10'));var toCsv=require(_0xc013('0xa'));var querystring=require(_0xc013('0x11'));var Papa=require(_0xc013('0x12'));var Redis=require(_0xc013('0x13'));var authService=require(_0xc013('0x14'));var qs=require(_0xc013('0x15'));var as=require(_0xc013('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc013('0x17'));var utils=require(_0xc013('0x18'));var config=require(_0xc013('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x32522e,_0x2d5ec8){_0x2d5ec8=_0x2d5ec8||0xcc;return function(_0x379c4f){if(_0x379c4f){return _0x32522e[_0xc013('0x1a')](_0x2d5ec8);}return _0x32522e[_0xc013('0x1b')](_0x2d5ec8)[_0xc013('0x1c')]();};}function respondWithResult(_0xad564,_0x891eda){_0x891eda=_0x891eda||0xc8;return function(_0x482a52){if(_0x482a52){return _0xad564[_0xc013('0x1b')](_0x891eda)[_0xc013('0x1d')](_0x482a52);}};}function respondWithFilteredResult(_0x291dc1,_0x3889e7){return function(_0x220d70){if(_0x220d70){var _0x518164=_0x220d70[_0xc013('0x1e')],_0x20a44f=_0x3889e7[_0xc013('0x1f')],_0xcdf5b0=_0x3889e7[_0xc013('0x1f')]+_0x3889e7[_0xc013('0x20')],_0x502d27;if(_0xcdf5b0>=_0x518164){_0xcdf5b0=_0x518164;_0x502d27=0xc8;}else{_0x502d27=0xce;}_0x291dc1['status'](_0x502d27);return _0x291dc1[_0xc013('0x21')](_0xc013('0x22'),_0x20a44f+'-'+_0xcdf5b0+'/'+_0x518164)['json'](_0x220d70);}return null;};}function patchUpdates(_0x3c06d9){return function(_0x38ebe7){try{jsonpatch[_0xc013('0x23')](_0x38ebe7,_0x3c06d9,!![]);}catch(_0x332bf9){return BPromise[_0xc013('0x24')](_0x332bf9);}return _0x38ebe7[_0xc013('0x25')]();};}function saveUpdates(_0x258718,_0x3b43ea){return function(_0x29cbe5){if(_0x29cbe5){return _0x29cbe5[_0xc013('0x26')](_0x258718)[_0xc013('0x27')](function(_0x4d9ddd){return _0x4d9ddd;});}return null;};}function removeEntity(_0x5dccca,_0x1ca640){return function(_0x4e9ea0){if(_0x4e9ea0){return _0x4e9ea0['destroy']()[_0xc013('0x27')](function(){_0x5dccca[_0xc013('0x1b')](0xcc)[_0xc013('0x1c')]();});}};}function handleEntityNotFound(_0x19e90c,_0x41b0e4){return function(_0x156ce5){if(!_0x156ce5){_0x19e90c[_0xc013('0x1a')](0x194);}return _0x156ce5;};}function handleError(_0x440160,_0x42d9e6){_0x42d9e6=_0x42d9e6||0x1f4;return function(_0x4b16f9){logger['error'](_0x4b16f9[_0xc013('0x28')]);if(_0x4b16f9[_0xc013('0x29')]){delete _0x4b16f9[_0xc013('0x29')];}_0x440160[_0xc013('0x1b')](_0x42d9e6)[_0xc013('0x2a')](_0x4b16f9);};}exports[_0xc013('0x2b')]=function(_0x4f5a41,_0x1bd6da){var _0x2d6343={},_0x2acd75={},_0x16c704={'count':0x0,'rows':[]};var _0x5c64b1=_[_0xc013('0x2c')](db[_0xc013('0x2d')][_0xc013('0x2e')],function(_0x15fd44){return{'name':_0x15fd44[_0xc013('0x2f')],'type':_0x15fd44[_0xc013('0x30')][_0xc013('0x31')]};});_0x2acd75['model']=_[_0xc013('0x2c')](_0x5c64b1,_0xc013('0x29'));_0x2acd75[_0xc013('0x32')]=_[_0xc013('0x33')](_0x4f5a41['query']);_0x2acd75['filters']=_[_0xc013('0x34')](_0x2acd75[_0xc013('0x35')],_0x2acd75[_0xc013('0x32')]);_0x2d6343['attributes']=_[_0xc013('0x34')](_0x2acd75['model'],qs[_0xc013('0x36')](_0x4f5a41['query'][_0xc013('0x36')]));_0x2d6343[_0xc013('0x37')]=_0x2d6343['attributes'][_0xc013('0x38')]?_0x2d6343['attributes']:_0x2acd75['model'];if(!_0x4f5a41[_0xc013('0x32')][_0xc013('0x39')](_0xc013('0x3a'))){_0x2d6343[_0xc013('0x20')]=qs[_0xc013('0x20')](_0x4f5a41[_0xc013('0x32')][_0xc013('0x20')]);_0x2d6343[_0xc013('0x1f')]=qs[_0xc013('0x1f')](_0x4f5a41[_0xc013('0x32')]['offset']);}_0x2d6343[_0xc013('0x3b')]=qs['sort'](_0x4f5a41['query'][_0xc013('0x3c')]);_0x2d6343['where']=qs[_0xc013('0x3d')](_[_0xc013('0x3e')](_0x4f5a41[_0xc013('0x32')],_0x2acd75['filters']));if(_0x4f5a41[_0xc013('0x32')][_0xc013('0x3f')]){_0x2d6343[_0xc013('0x40')]=_['merge'](_0x2d6343[_0xc013('0x40')],{'$or':_[_0xc013('0x2c')](_0x5c64b1,function(_0x1a23f9){if(_0x1a23f9['type']!=='VIRTUAL'){var _0x208d7c={};_0x208d7c[_0x1a23f9['name']]={'$like':'%'+_0x4f5a41[_0xc013('0x32')][_0xc013('0x3f')]+'%'};return _0x208d7c;}})});}_0x2d6343=_['merge']({},_0x2d6343,_0x4f5a41[_0xc013('0x41')]);var _0x1992ca={'where':_0x2d6343['where']};return db[_0xc013('0x2d')][_0xc013('0x1e')](_0x1992ca)[_0xc013('0x27')](function(_0x5f1fc2){_0x16c704[_0xc013('0x1e')]=_0x5f1fc2;if(_0x4f5a41[_0xc013('0x32')][_0xc013('0x42')]){_0x2d6343[_0xc013('0x43')]=[{'all':!![]}];}return db[_0xc013('0x2d')][_0xc013('0x44')](_0x2d6343);})[_0xc013('0x27')](function(_0x185a9a){_0x16c704['rows']=_0x185a9a;return _0x16c704;})[_0xc013('0x27')](respondWithFilteredResult(_0x1bd6da,_0x2d6343))[_0xc013('0x45')](handleError(_0x1bd6da,null));};exports['show']=function(_0x5610db,_0x4e030a){var _0x2ef1dd={'raw':!![],'where':{'id':_0x5610db[_0xc013('0x46')]['id']}},_0x3faef7={};_0x3faef7[_0xc013('0x35')]=_['keys'](db[_0xc013('0x2d')]['rawAttributes']);_0x3faef7['query']=_['keys'](_0x5610db[_0xc013('0x32')]);_0x3faef7['filters']=_[_0xc013('0x34')](_0x3faef7[_0xc013('0x35')],_0x3faef7[_0xc013('0x32')]);_0x2ef1dd[_0xc013('0x37')]=_['intersection'](_0x3faef7[_0xc013('0x35')],qs[_0xc013('0x36')](_0x5610db[_0xc013('0x32')]['fields']));_0x2ef1dd[_0xc013('0x37')]=_0x2ef1dd['attributes']['length']?_0x2ef1dd[_0xc013('0x37')]:_0x3faef7[_0xc013('0x35')];if(_0x5610db['query'][_0xc013('0x42')]){_0x2ef1dd[_0xc013('0x43')]=[{'all':!![]}];}_0x2ef1dd=_[_0xc013('0x47')]({},_0x2ef1dd,_0x5610db[_0xc013('0x41')]);return db[_0xc013('0x2d')][_0xc013('0x48')](_0x2ef1dd)['then'](handleEntityNotFound(_0x4e030a,null))['then'](respondWithResult(_0x4e030a,null))[_0xc013('0x45')](handleError(_0x4e030a,null));};exports[_0xc013('0x49')]=function(_0x5a1660,_0x4ae07b){return db['ChatQueueReport']['create'](_0x5a1660[_0xc013('0x4a')],{})[_0xc013('0x27')](respondWithResult(_0x4ae07b,0xc9))[_0xc013('0x45')](handleError(_0x4ae07b,null));};exports['update']=function(_0x141a50,_0x1a9b26){if(_0x141a50[_0xc013('0x4a')]['id']){delete _0x141a50['body']['id'];}return db[_0xc013('0x2d')][_0xc013('0x48')]({'where':{'id':_0x141a50[_0xc013('0x46')]['id']}})[_0xc013('0x27')](handleEntityNotFound(_0x1a9b26,null))[_0xc013('0x27')](saveUpdates(_0x141a50['body'],null))['then'](respondWithResult(_0x1a9b26,null))[_0xc013('0x45')](handleError(_0x1a9b26,null));};exports[_0xc013('0x4b')]=function(_0x507353,_0x467de6){return db[_0xc013('0x2d')][_0xc013('0x48')]({'where':{'id':_0x507353[_0xc013('0x46')]['id']}})[_0xc013('0x27')](handleEntityNotFound(_0x467de6,null))[_0xc013('0x27')](removeEntity(_0x467de6,null))[_0xc013('0x45')](handleError(_0x467de6,null));};exports['describe']=function(_0x189255,_0x3d765c){return db[_0xc013('0x2d')][_0xc013('0x4c')]()[_0xc013('0x27')](respondWithResult(_0x3d765c,null))[_0xc013('0x45')](handleError(_0x3d765c,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 9dc573c..a453b66 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 _0x299b=['./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util','../../config/logger','api','path','rimraf','../../config/environment'];(function(_0x1c8cc6,_0x411e5c){var _0x522936=function(_0x38d044){while(--_0x38d044){_0x1c8cc6['push'](_0x1c8cc6['shift']());}};_0x522936(++_0x411e5c);}(_0x299b,0x1c0));var _0xb299=function(_0x283127,_0x54d4d5){_0x283127=_0x283127-0x0;var _0x43da5d=_0x299b[_0x283127];return _0x43da5d;};'use strict';var _=require(_0xb299('0x0'));var util=require(_0xb299('0x1'));var logger=require(_0xb299('0x2'))(_0xb299('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb299('0x4'));var rimraf=require(_0xb299('0x5'));var config=require(_0xb299('0x6'));var attributes=require(_0xb299('0x7'));module[_0xb299('0x8')]=function(_0x4fab49,_0x3dbd50){return _0x4fab49[_0xb299('0x9')](_0xb299('0xa'),attributes,{'tableName':_0xb299('0xb'),'paranoid':![],'indexes':[{'name':_0xb299('0xc'),'fields':[_0xb299('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x68c9=['ChatQueueReport','report_chat_queue','uniqueid','lodash','../../config/logger','api','moment','request-promise','path','../../config/environment','define'];(function(_0x1878cb,_0x4e755e){var _0x5126af=function(_0x288a24){while(--_0x288a24){_0x1878cb['push'](_0x1878cb['shift']());}};_0x5126af(++_0x4e755e);}(_0x68c9,0x92));var _0x968c=function(_0x37cf8c,_0x2af8b3){_0x37cf8c=_0x37cf8c-0x0;var _0x351fcf=_0x68c9[_0x37cf8c];return _0x351fcf;};'use strict';var _=require(_0x968c('0x0'));var util=require('util');var logger=require(_0x968c('0x1'))(_0x968c('0x2'));var moment=require(_0x968c('0x3'));var BPromise=require('bluebird');var rp=require(_0x968c('0x4'));var fs=require('fs');var path=require(_0x968c('0x5'));var rimraf=require('rimraf');var config=require(_0x968c('0x6'));var attributes=require('./chatQueueReport.attributes');module['exports']=function(_0x377bc1,_0x11b248){return _0x377bc1[_0x968c('0x7')](_0x968c('0x8'),attributes,{'tableName':_0x968c('0x9'),'paranoid':![],'indexes':[{'name':_0x968c('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index 70bca92..f4241ce 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 _0xb8ee=['raw','catch','UpdateChatQueueReport','where','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','CreateChatQueueReport','ChatQueueReport','create','body','options'];(function(_0x22f49b,_0x444bd1){var _0x428004=function(_0x2faf38){while(--_0x2faf38){_0x22f49b['push'](_0x22f49b['shift']());}};_0x428004(++_0x444bd1);}(_0xb8ee,0x91));var _0xeb8e=function(_0x57d7f7,_0x335c81){_0x57d7f7=_0x57d7f7-0x0;var _0x1a6800=_0xb8ee[_0x57d7f7];return _0x1a6800;};'use strict';var _=require(_0xeb8e('0x0'));var util=require(_0xeb8e('0x1'));var moment=require(_0xeb8e('0x2'));var BPromise=require(_0xeb8e('0x3'));var rs=require(_0xeb8e('0x4'));var fs=require('fs');var Redis=require(_0xeb8e('0x5'));var db=require(_0xeb8e('0x6'))['db'];var utils=require(_0xeb8e('0x7'));var logger=require(_0xeb8e('0x8'))(_0xeb8e('0x9'));var config=require(_0xeb8e('0xa'));var jayson=require(_0xeb8e('0xb'));var client=jayson[_0xeb8e('0xc')][_0xeb8e('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5a68e0,_0x268146,_0x25164d){return new BPromise(function(_0x470f46,_0x1f6414){return client[_0xeb8e('0xe')](_0x5a68e0,_0x25164d)[_0xeb8e('0xf')](function(_0x55ab6d){logger[_0xeb8e('0x10')](_0xeb8e('0x11'),_0x268146,'request\x20sent');logger[_0xeb8e('0x12')](_0xeb8e('0x13'),_0x268146,_0xeb8e('0x14'),JSON[_0xeb8e('0x15')](_0x55ab6d));if(_0x55ab6d['error']){if(_0x55ab6d['error'][_0xeb8e('0x16')]===0x1f4){logger['error'](_0xeb8e('0x11'),_0x268146,_0x55ab6d[_0xeb8e('0x17')][_0xeb8e('0x18')]);return _0x1f6414(_0x55ab6d[_0xeb8e('0x17')][_0xeb8e('0x18')]);}logger[_0xeb8e('0x17')](_0xeb8e('0x11'),_0x268146,_0x55ab6d[_0xeb8e('0x17')][_0xeb8e('0x18')]);return _0x470f46(_0x55ab6d[_0xeb8e('0x17')][_0xeb8e('0x18')]);}else{logger[_0xeb8e('0x10')](_0xeb8e('0x11'),_0x268146,_0xeb8e('0x14'));_0x470f46(_0x55ab6d['result'][_0xeb8e('0x18')]);}})['catch'](function(_0x6b2f25){logger[_0xeb8e('0x17')](_0xeb8e('0x11'),_0x268146,_0x6b2f25);_0x1f6414(_0x6b2f25);});});}exports[_0xeb8e('0x19')]=function(_0x4af52a){var _0x84b613=this;return new Promise(function(_0x26a619,_0x1b103a){return db[_0xeb8e('0x1a')][_0xeb8e('0x1b')](_0x4af52a[_0xeb8e('0x1c')],{'raw':_0x4af52a[_0xeb8e('0x1d')]?_0x4af52a[_0xeb8e('0x1d')][_0xeb8e('0x1e')]===undefined?!![]:![]:!![]})[_0xeb8e('0xf')](function(_0x11bcd7){logger[_0xeb8e('0x10')](_0xeb8e('0x19'),_0x4af52a);logger[_0xeb8e('0x12')](_0xeb8e('0x19'),_0x4af52a,JSON[_0xeb8e('0x15')](_0x11bcd7));_0x26a619(_0x11bcd7);})[_0xeb8e('0x1f')](function(_0x4e91d){logger[_0xeb8e('0x17')]('CreateChatQueueReport',_0x4e91d[_0xeb8e('0x18')],_0x4af52a);_0x1b103a(_0x84b613[_0xeb8e('0x17')](0x1f4,_0x4e91d[_0xeb8e('0x18')]));});});};exports[_0xeb8e('0x20')]=function(_0x1a3a19){var _0x471a19=this;return new Promise(function(_0x17bcbe,_0x4fb8bf){return db[_0xeb8e('0x1a')]['update'](_0x1a3a19[_0xeb8e('0x1c')],{'raw':_0x1a3a19['options']?_0x1a3a19[_0xeb8e('0x1d')][_0xeb8e('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1a3a19['options']?_0x1a3a19[_0xeb8e('0x1d')][_0xeb8e('0x21')]||null:null,'attributes':_0x1a3a19[_0xeb8e('0x1d')]?_0x1a3a19[_0xeb8e('0x1d')][_0xeb8e('0x22')]||null:null,'limit':_0x1a3a19[_0xeb8e('0x1d')]?_0x1a3a19[_0xeb8e('0x1d')]['limit']||null:null})[_0xeb8e('0xf')](function(_0x446b62){logger[_0xeb8e('0x10')](_0xeb8e('0x20'),_0x1a3a19);logger['debug'](_0xeb8e('0x20'),_0x1a3a19,JSON['stringify'](_0x446b62));_0x17bcbe(_0x446b62);})[_0xeb8e('0x1f')](function(_0x13ba12){logger[_0xeb8e('0x17')]('UpdateChatQueueReport',_0x13ba12['message'],_0x1a3a19);_0x4fb8bf(_0x471a19[_0xeb8e('0x17')](0x1f4,_0x13ba12[_0xeb8e('0x18')]));});});}; \ No newline at end of file +var _0xbd8a=['UpdateChatQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport','body','options','raw','update','where','attributes','limit'];(function(_0x5acbf1,_0x932220){var _0x1350fe=function(_0x48b1d7){while(--_0x48b1d7){_0x5acbf1['push'](_0x5acbf1['shift']());}};_0x1350fe(++_0x932220);}(_0xbd8a,0x119));var _0xabd8=function(_0x382602,_0x5e9d2d){_0x382602=_0x382602-0x0;var _0x14dda6=_0xbd8a[_0x382602];return _0x14dda6;};'use strict';var _=require(_0xabd8('0x0'));var util=require(_0xabd8('0x1'));var moment=require(_0xabd8('0x2'));var BPromise=require(_0xabd8('0x3'));var rs=require(_0xabd8('0x4'));var fs=require('fs');var Redis=require(_0xabd8('0x5'));var db=require(_0xabd8('0x6'))['db'];var utils=require(_0xabd8('0x7'));var logger=require(_0xabd8('0x8'))(_0xabd8('0x9'));var config=require(_0xabd8('0xa'));var jayson=require(_0xabd8('0xb'));var client=jayson[_0xabd8('0xc')][_0xabd8('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x1f7936,_0x24e7c5,_0xac74dc){return new BPromise(function(_0x47d8bf,_0x17ff08){return client['request'](_0x1f7936,_0xac74dc)[_0xabd8('0xe')](function(_0x563783){logger[_0xabd8('0xf')](_0xabd8('0x10'),_0x24e7c5,_0xabd8('0x11'));logger[_0xabd8('0x12')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x24e7c5,_0xabd8('0x11'),JSON[_0xabd8('0x13')](_0x563783));if(_0x563783[_0xabd8('0x14')]){if(_0x563783[_0xabd8('0x14')][_0xabd8('0x15')]===0x1f4){logger[_0xabd8('0x14')](_0xabd8('0x10'),_0x24e7c5,_0x563783[_0xabd8('0x14')]['message']);return _0x17ff08(_0x563783[_0xabd8('0x14')][_0xabd8('0x16')]);}logger[_0xabd8('0x14')](_0xabd8('0x10'),_0x24e7c5,_0x563783[_0xabd8('0x14')][_0xabd8('0x16')]);return _0x47d8bf(_0x563783['error'][_0xabd8('0x16')]);}else{logger[_0xabd8('0xf')](_0xabd8('0x10'),_0x24e7c5,_0xabd8('0x11'));_0x47d8bf(_0x563783[_0xabd8('0x17')][_0xabd8('0x16')]);}})[_0xabd8('0x18')](function(_0x1bc67e){logger[_0xabd8('0x14')]('ChatQueueReport,\x20%s,\x20%s',_0x24e7c5,_0x1bc67e);_0x17ff08(_0x1bc67e);});});}exports[_0xabd8('0x19')]=function(_0x5edb80){var _0x554ba3=this;return new Promise(function(_0x493ec0,_0x566473){return db[_0xabd8('0x1a')]['create'](_0x5edb80[_0xabd8('0x1b')],{'raw':_0x5edb80[_0xabd8('0x1c')]?_0x5edb80[_0xabd8('0x1c')][_0xabd8('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x22eff7){logger[_0xabd8('0xf')](_0xabd8('0x19'),_0x5edb80);logger[_0xabd8('0x12')](_0xabd8('0x19'),_0x5edb80,JSON[_0xabd8('0x13')](_0x22eff7));_0x493ec0(_0x22eff7);})[_0xabd8('0x18')](function(_0xdb0177){logger[_0xabd8('0x14')](_0xabd8('0x19'),_0xdb0177['message'],_0x5edb80);_0x566473(_0x554ba3[_0xabd8('0x14')](0x1f4,_0xdb0177[_0xabd8('0x16')]));});});};exports['UpdateChatQueueReport']=function(_0x541b6f){var _0x548e9b=this;return new Promise(function(_0x394fec,_0x1c1fb5){return db['ChatQueueReport'][_0xabd8('0x1e')](_0x541b6f[_0xabd8('0x1b')],{'raw':_0x541b6f[_0xabd8('0x1c')]?_0x541b6f['options'][_0xabd8('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x541b6f[_0xabd8('0x1c')]?_0x541b6f[_0xabd8('0x1c')][_0xabd8('0x1f')]||null:null,'attributes':_0x541b6f['options']?_0x541b6f[_0xabd8('0x1c')][_0xabd8('0x20')]||null:null,'limit':_0x541b6f[_0xabd8('0x1c')]?_0x541b6f[_0xabd8('0x1c')][_0xabd8('0x21')]||null:null})[_0xabd8('0xe')](function(_0x8df0a8){logger[_0xabd8('0xf')](_0xabd8('0x22'),_0x541b6f);logger['debug'](_0xabd8('0x22'),_0x541b6f,JSON[_0xabd8('0x13')](_0x8df0a8));_0x394fec(_0x8df0a8);})[_0xabd8('0x18')](function(_0x3a59f3){logger[_0xabd8('0x14')]('UpdateChatQueueReport',_0x3a59f3['message'],_0x541b6f);_0x1c1fb5(_0x548e9b[_0xabd8('0x14')](0x1f4,_0x3a59f3['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index ee65cb6..5ef5c15 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 _0x5c5d=['create','put','/:id','update','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','show'];(function(_0x26eeac,_0x25dc6a){var _0xb58d5f=function(_0x1a0b25){while(--_0x1a0b25){_0x26eeac['push'](_0x26eeac['shift']());}};_0xb58d5f(++_0x25dc6a);}(_0x5c5d,0x142));var _0xd5c5=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0x5c5d[_0x2b10c6];return _0x3789d2;};'use strict';var multer=require(_0xd5c5('0x0'));var util=require(_0xd5c5('0x1'));var path=require(_0xd5c5('0x2'));var timeout=require('connect-timeout');var express=require(_0xd5c5('0x3'));var router=express[_0xd5c5('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xd5c5('0x5'));var config=require(_0xd5c5('0x6'));var controller=require(_0xd5c5('0x7'));router[_0xd5c5('0x8')]('/',auth[_0xd5c5('0x9')](),controller[_0xd5c5('0xa')]);router[_0xd5c5('0x8')](_0xd5c5('0xb'),auth[_0xd5c5('0x9')](),controller[_0xd5c5('0xc')]);router['get']('/:id',auth[_0xd5c5('0x9')](),controller[_0xd5c5('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xd5c5('0xe')]);router[_0xd5c5('0xf')](_0xd5c5('0x10'),auth[_0xd5c5('0x9')](),controller[_0xd5c5('0x11')]);router[_0xd5c5('0x12')](_0xd5c5('0x10'),auth['isAuthenticated'](),controller[_0xd5c5('0x13')]);module[_0xd5c5('0x14')]=router; \ No newline at end of file +var _0xdc1a=['../../components/interaction/service','./chatQueueReport.controller','isAuthenticated','index','get','/describe','/:id','show','post','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x4a2d50,_0x10a87){var _0x2a7fad=function(_0x289aec){while(--_0x289aec){_0x4a2d50['push'](_0x4a2d50['shift']());}};_0x2a7fad(++_0x10a87);}(_0xdc1a,0x92));var _0xadc1=function(_0x73c625,_0x275710){_0x73c625=_0x73c625-0x0;var _0xee1b31=_0xdc1a[_0x73c625];return _0xee1b31;};'use strict';var multer=require(_0xadc1('0x0'));var util=require('util');var path=require(_0xadc1('0x1'));var timeout=require(_0xadc1('0x2'));var express=require(_0xadc1('0x3'));var router=express[_0xadc1('0x4')]();var auth=require(_0xadc1('0x5'));var interaction=require(_0xadc1('0x6'));var config=require('../../config/environment');var controller=require(_0xadc1('0x7'));router['get']('/',auth[_0xadc1('0x8')](),controller[_0xadc1('0x9')]);router[_0xadc1('0xa')](_0xadc1('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xadc1('0xa')](_0xadc1('0xc'),auth[_0xadc1('0x8')](),controller[_0xadc1('0xd')]);router[_0xadc1('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xadc1('0xc'),auth[_0xadc1('0x8')](),controller[_0xadc1('0xf')]);router[_0xadc1('0x10')](_0xadc1('0xc'),auth[_0xadc1('0x8')](),controller[_0xadc1('0x11')]);module[_0xadc1('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index b1dc8a8..d02f682 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 _0x15cc=['DATE','NOW','moment','sequelize','exports','ENUM','account','agent','queue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x15cc,0xd1));var _0xc15c=function(_0x2e067a,_0xab528c){_0x2e067a=_0x2e067a-0x0;var _0xc64976=_0x15cc[_0x2e067a];return _0xc64976;};'use strict';var moment=require(_0xc15c('0x0'));var Sequelize=require(_0xc15c('0x1'));module[_0xc15c('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xc15c('0x3')](_0xc15c('0x4'),_0xc15c('0x5'),_0xc15c('0x6')),'allowNull':![],'defaultValue':_0xc15c('0x6')},'transferredAt':{'type':Sequelize[_0xc15c('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc15c('0x8')]}}; \ No newline at end of file +var _0x73cb=['DATE','NOW','STRING','ENUM','agent','queue'];(function(_0x5af0bc,_0x5a538d){var _0x5bbc99=function(_0x207254){while(--_0x207254){_0x5af0bc['push'](_0x5af0bc['shift']());}};_0x5bbc99(++_0x5a538d);}(_0x73cb,0x7a));var _0xb73c=function(_0x32d0c9,_0x4e673d){_0x32d0c9=_0x32d0c9-0x0;var _0x5cbfd7=_0x73cb[_0x32d0c9];return _0x5cbfd7;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xb73c('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0xb73c('0x1')]('account',_0xb73c('0x2'),'queue'),'allowNull':![],'defaultValue':_0xb73c('0x3')},'transferredAt':{'type':Sequelize[_0xb73c('0x4')],'allowNull':![],'defaultValue':Sequelize[_0xb73c('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 87ccb85..656f0f1 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 _0xd7cb=['fields','hasOwnProperty','nolimit','limit','offset','sort','where','pick','filter','merge','count','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','set','Content-Range','apply','save','update','then','destroy','end','error','stack','name','send','index','map','ChatTransferReport','fieldName','type','key','model','keys','query','filters','intersection','attributes'];(function(_0x32d0b6,_0xf2f122){var _0x50711b=function(_0x41e0e1){while(--_0x41e0e1){_0x32d0b6['push'](_0x32d0b6['shift']());}};_0x50711b(++_0xf2f122);}(_0xd7cb,0x192));var _0xbd7c=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xd7cb[_0x397e5f];return _0x5302b8;};'use strict';var pdf=require(_0xbd7c('0x0'));var emlformat=require(_0xbd7c('0x1'));var rimraf=require(_0xbd7c('0x2'));var zipdir=require(_0xbd7c('0x3'));var jsonpatch=require(_0xbd7c('0x4'));var rp=require(_0xbd7c('0x5'));var moment=require(_0xbd7c('0x6'));var BPromise=require(_0xbd7c('0x7'));var Mustache=require(_0xbd7c('0x8'));var util=require(_0xbd7c('0x9'));var path=require(_0xbd7c('0xa'));var sox=require(_0xbd7c('0xb'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xbd7c('0xc'));var squel=require(_0xbd7c('0xd'));var crypto=require(_0xbd7c('0xe'));var jsforce=require(_0xbd7c('0xf'));var deskjs=require(_0xbd7c('0x10'));var toCsv=require(_0xbd7c('0x11'));var querystring=require(_0xbd7c('0x12'));var Papa=require('papaparse');var Redis=require(_0xbd7c('0x13'));var authService=require(_0xbd7c('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xbd7c('0x15'));var hardwareService=require(_0xbd7c('0x16'));var logger=require('../../config/logger')(_0xbd7c('0x17'));var utils=require(_0xbd7c('0x18'));var config=require(_0xbd7c('0x19'));var db=require(_0xbd7c('0x1a'))['db'];function respondWithStatusCode(_0x2adc72,_0x2d8f4e){_0x2d8f4e=_0x2d8f4e||0xcc;return function(_0x3dc2f2){if(_0x3dc2f2){return _0x2adc72[_0xbd7c('0x1b')](_0x2d8f4e);}return _0x2adc72['status'](_0x2d8f4e)['end']();};}function respondWithResult(_0x594c22,_0x2d4cc3){_0x2d4cc3=_0x2d4cc3||0xc8;return function(_0x1f1abc){if(_0x1f1abc){return _0x594c22[_0xbd7c('0x1c')](_0x2d4cc3)[_0xbd7c('0x1d')](_0x1f1abc);}};}function respondWithFilteredResult(_0x2a2a2c,_0x5c86d1){return function(_0xf52d51){if(_0xf52d51){var _0x4cbe5e=_0xf52d51['count'],_0x3b647b=_0x5c86d1['offset'],_0x376539=_0x5c86d1['offset']+_0x5c86d1['limit'],_0x5a4ca4;if(_0x376539>=_0x4cbe5e){_0x376539=_0x4cbe5e;_0x5a4ca4=0xc8;}else{_0x5a4ca4=0xce;}_0x2a2a2c[_0xbd7c('0x1c')](_0x5a4ca4);return _0x2a2a2c[_0xbd7c('0x1e')](_0xbd7c('0x1f'),_0x3b647b+'-'+_0x376539+'/'+_0x4cbe5e)[_0xbd7c('0x1d')](_0xf52d51);}return null;};}function patchUpdates(_0x54f631){return function(_0x37cdeb){try{jsonpatch[_0xbd7c('0x20')](_0x37cdeb,_0x54f631,!![]);}catch(_0x1839ab){return BPromise['reject'](_0x1839ab);}return _0x37cdeb[_0xbd7c('0x21')]();};}function saveUpdates(_0x54cb8b,_0x2a0718){return function(_0x3b6711){if(_0x3b6711){return _0x3b6711[_0xbd7c('0x22')](_0x54cb8b)[_0xbd7c('0x23')](function(_0x8e7f4f){return _0x8e7f4f;});}return null;};}function removeEntity(_0x198d1b,_0x435ed3){return function(_0x53b3dc){if(_0x53b3dc){return _0x53b3dc[_0xbd7c('0x24')]()[_0xbd7c('0x23')](function(){_0x198d1b[_0xbd7c('0x1c')](0xcc)[_0xbd7c('0x25')]();});}};}function handleEntityNotFound(_0x399aaa,_0x31174c){return function(_0x5137af){if(!_0x5137af){_0x399aaa[_0xbd7c('0x1b')](0x194);}return _0x5137af;};}function handleError(_0x25e4a4,_0xbf4ac8){_0xbf4ac8=_0xbf4ac8||0x1f4;return function(_0x206985){logger[_0xbd7c('0x26')](_0x206985[_0xbd7c('0x27')]);if(_0x206985[_0xbd7c('0x28')]){delete _0x206985['name'];}_0x25e4a4[_0xbd7c('0x1c')](_0xbf4ac8)[_0xbd7c('0x29')](_0x206985);};}exports[_0xbd7c('0x2a')]=function(_0x5e5ce7,_0x50bb24){var _0x3648db={},_0x3cb260={},_0x5421a7={'count':0x0,'rows':[]};var _0x329272=_[_0xbd7c('0x2b')](db[_0xbd7c('0x2c')]['rawAttributes'],function(_0x3d3335){return{'name':_0x3d3335[_0xbd7c('0x2d')],'type':_0x3d3335[_0xbd7c('0x2e')][_0xbd7c('0x2f')]};});_0x3cb260[_0xbd7c('0x30')]=_[_0xbd7c('0x2b')](_0x329272,_0xbd7c('0x28'));_0x3cb260['query']=_[_0xbd7c('0x31')](_0x5e5ce7[_0xbd7c('0x32')]);_0x3cb260[_0xbd7c('0x33')]=_[_0xbd7c('0x34')](_0x3cb260[_0xbd7c('0x30')],_0x3cb260['query']);_0x3648db[_0xbd7c('0x35')]=_[_0xbd7c('0x34')](_0x3cb260['model'],qs['fields'](_0x5e5ce7['query'][_0xbd7c('0x36')]));_0x3648db[_0xbd7c('0x35')]=_0x3648db[_0xbd7c('0x35')]['length']?_0x3648db[_0xbd7c('0x35')]:_0x3cb260[_0xbd7c('0x30')];if(!_0x5e5ce7[_0xbd7c('0x32')][_0xbd7c('0x37')](_0xbd7c('0x38'))){_0x3648db[_0xbd7c('0x39')]=qs[_0xbd7c('0x39')](_0x5e5ce7['query'][_0xbd7c('0x39')]);_0x3648db[_0xbd7c('0x3a')]=qs['offset'](_0x5e5ce7[_0xbd7c('0x32')][_0xbd7c('0x3a')]);}_0x3648db['order']=qs['sort'](_0x5e5ce7[_0xbd7c('0x32')][_0xbd7c('0x3b')]);_0x3648db[_0xbd7c('0x3c')]=qs[_0xbd7c('0x33')](_[_0xbd7c('0x3d')](_0x5e5ce7[_0xbd7c('0x32')],_0x3cb260[_0xbd7c('0x33')]));if(_0x5e5ce7[_0xbd7c('0x32')][_0xbd7c('0x3e')]){_0x3648db[_0xbd7c('0x3c')]=_['merge'](_0x3648db[_0xbd7c('0x3c')],{'$or':_['map'](_0x329272,function(_0x4904db){if(_0x4904db[_0xbd7c('0x2e')]!=='VIRTUAL'){var _0x194d93={};_0x194d93[_0x4904db[_0xbd7c('0x28')]]={'$like':'%'+_0x5e5ce7[_0xbd7c('0x32')][_0xbd7c('0x3e')]+'%'};return _0x194d93;}})});}_0x3648db=_[_0xbd7c('0x3f')]({},_0x3648db,_0x5e5ce7['options']);var _0x20f9aa={'where':_0x3648db[_0xbd7c('0x3c')]};return db['ChatTransferReport'][_0xbd7c('0x40')](_0x20f9aa)['then'](function(_0xc70e53){_0x5421a7['count']=_0xc70e53;if(_0x5e5ce7[_0xbd7c('0x32')][_0xbd7c('0x41')]){_0x3648db[_0xbd7c('0x42')]=[{'all':!![]}];}return db[_0xbd7c('0x2c')][_0xbd7c('0x43')](_0x3648db);})[_0xbd7c('0x23')](function(_0x59b12c){_0x5421a7['rows']=_0x59b12c;return _0x5421a7;})['then'](respondWithFilteredResult(_0x50bb24,_0x3648db))[_0xbd7c('0x44')](handleError(_0x50bb24,null));};exports[_0xbd7c('0x45')]=function(_0x3bd567,_0x5d0f8d){var _0x30516f={'raw':!![],'where':{'id':_0x3bd567[_0xbd7c('0x46')]['id']}},_0x557e3a={};_0x557e3a[_0xbd7c('0x30')]=_['keys'](db[_0xbd7c('0x2c')][_0xbd7c('0x47')]);_0x557e3a[_0xbd7c('0x32')]=_[_0xbd7c('0x31')](_0x3bd567['query']);_0x557e3a[_0xbd7c('0x33')]=_[_0xbd7c('0x34')](_0x557e3a[_0xbd7c('0x30')],_0x557e3a['query']);_0x30516f[_0xbd7c('0x35')]=_['intersection'](_0x557e3a[_0xbd7c('0x30')],qs[_0xbd7c('0x36')](_0x3bd567[_0xbd7c('0x32')][_0xbd7c('0x36')]));_0x30516f[_0xbd7c('0x35')]=_0x30516f[_0xbd7c('0x35')]['length']?_0x30516f[_0xbd7c('0x35')]:_0x557e3a[_0xbd7c('0x30')];if(_0x3bd567['query'][_0xbd7c('0x41')]){_0x30516f[_0xbd7c('0x42')]=[{'all':!![]}];}_0x30516f=_['merge']({},_0x30516f,_0x3bd567['options']);return db[_0xbd7c('0x2c')][_0xbd7c('0x48')](_0x30516f)[_0xbd7c('0x23')](handleEntityNotFound(_0x5d0f8d,null))[_0xbd7c('0x23')](respondWithResult(_0x5d0f8d,null))[_0xbd7c('0x44')](handleError(_0x5d0f8d,null));};exports[_0xbd7c('0x49')]=function(_0xab51c9,_0x15c2da){return db[_0xbd7c('0x2c')][_0xbd7c('0x49')](_0xab51c9['body'],{})[_0xbd7c('0x23')](respondWithResult(_0x15c2da,0xc9))['catch'](handleError(_0x15c2da,null));};exports[_0xbd7c('0x22')]=function(_0x1a1373,_0x3fabe8){if(_0x1a1373[_0xbd7c('0x4a')]['id']){delete _0x1a1373[_0xbd7c('0x4a')]['id'];}return db[_0xbd7c('0x2c')][_0xbd7c('0x48')]({'where':{'id':_0x1a1373[_0xbd7c('0x46')]['id']}})[_0xbd7c('0x23')](handleEntityNotFound(_0x3fabe8,null))['then'](saveUpdates(_0x1a1373['body'],null))['then'](respondWithResult(_0x3fabe8,null))[_0xbd7c('0x44')](handleError(_0x3fabe8,null));};exports[_0xbd7c('0x24')]=function(_0x35df6d,_0x34bfe6){return db['ChatTransferReport'][_0xbd7c('0x48')]({'where':{'id':_0x35df6d[_0xbd7c('0x46')]['id']}})[_0xbd7c('0x23')](handleEntityNotFound(_0x34bfe6,null))[_0xbd7c('0x23')](removeEntity(_0x34bfe6,null))[_0xbd7c('0x44')](handleError(_0x34bfe6,null));};exports[_0xbd7c('0x4b')]=function(_0x4d8be2,_0x4dbf1c){return db['ChatTransferReport'][_0xbd7c('0x4b')]()['then'](respondWithResult(_0x4dbf1c,null))[_0xbd7c('0x44')](handleError(_0x4dbf1c,null));}; \ No newline at end of file +var _0xf66b=['show','params','find','catch','create','body','update','destroy','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','lodash','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../mysqldb','end','json','offset','limit','status','set','Content-Range','apply','save','then','sendStatus','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','order','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll'];(function(_0x3f3f40,_0x4e745f){var _0x32c366=function(_0x343f6a){while(--_0x343f6a){_0x3f3f40['push'](_0x3f3f40['shift']());}};_0x32c366(++_0x4e745f);}(_0xf66b,0x1a1));var _0xbf66=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0xf66b[_0x513aa5];return _0x1a1a7c;};'use strict';var pdf=require(_0xbf66('0x0'));var emlformat=require(_0xbf66('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xbf66('0x2'));var jsonpatch=require(_0xbf66('0x3'));var rp=require(_0xbf66('0x4'));var moment=require('moment');var BPromise=require(_0xbf66('0x5'));var Mustache=require(_0xbf66('0x6'));var util=require(_0xbf66('0x7'));var path=require('path');var sox=require(_0xbf66('0x8'));var csv=require('to-csv');var ejs=require(_0xbf66('0x9'));var fs=require('fs');var _=require(_0xbf66('0xa'));var squel=require('squel');var crypto=require(_0xbf66('0xb'));var jsforce=require(_0xbf66('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbf66('0xd'));var Papa=require(_0xbf66('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xbf66('0xf'));var as=require(_0xbf66('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbf66('0x11'))('api');var utils=require('../../config/utils');var config=require(_0xbf66('0x12'));var db=require(_0xbf66('0x13'))['db'];function respondWithStatusCode(_0x22bcd6,_0x16aa4c){_0x16aa4c=_0x16aa4c||0xcc;return function(_0x3110b4){if(_0x3110b4){return _0x22bcd6['sendStatus'](_0x16aa4c);}return _0x22bcd6['status'](_0x16aa4c)[_0xbf66('0x14')]();};}function respondWithResult(_0x32a927,_0x208dd5){_0x208dd5=_0x208dd5||0xc8;return function(_0xf050e9){if(_0xf050e9){return _0x32a927['status'](_0x208dd5)[_0xbf66('0x15')](_0xf050e9);}};}function respondWithFilteredResult(_0x51bd95,_0x1ac447){return function(_0x19e1fb){if(_0x19e1fb){var _0x221bc1=_0x19e1fb['count'],_0x1e8169=_0x1ac447[_0xbf66('0x16')],_0x2f0139=_0x1ac447[_0xbf66('0x16')]+_0x1ac447[_0xbf66('0x17')],_0x18f131;if(_0x2f0139>=_0x221bc1){_0x2f0139=_0x221bc1;_0x18f131=0xc8;}else{_0x18f131=0xce;}_0x51bd95[_0xbf66('0x18')](_0x18f131);return _0x51bd95[_0xbf66('0x19')](_0xbf66('0x1a'),_0x1e8169+'-'+_0x2f0139+'/'+_0x221bc1)[_0xbf66('0x15')](_0x19e1fb);}return null;};}function patchUpdates(_0x5972c4){return function(_0x16d955){try{jsonpatch[_0xbf66('0x1b')](_0x16d955,_0x5972c4,!![]);}catch(_0x22cbd4){return BPromise['reject'](_0x22cbd4);}return _0x16d955[_0xbf66('0x1c')]();};}function saveUpdates(_0x78a0bc,_0x1f1763){return function(_0x3bbc2c){if(_0x3bbc2c){return _0x3bbc2c['update'](_0x78a0bc)[_0xbf66('0x1d')](function(_0x204654){return _0x204654;});}return null;};}function removeEntity(_0x1b7e89,_0x234ccc){return function(_0x35f23a){if(_0x35f23a){return _0x35f23a['destroy']()['then'](function(){_0x1b7e89[_0xbf66('0x18')](0xcc)[_0xbf66('0x14')]();});}};}function handleEntityNotFound(_0x55bdd1,_0x1668eb){return function(_0x3ada67){if(!_0x3ada67){_0x55bdd1[_0xbf66('0x1e')](0x194);}return _0x3ada67;};}function handleError(_0x40e18a,_0x495318){_0x495318=_0x495318||0x1f4;return function(_0x30579a){logger['error'](_0x30579a['stack']);if(_0x30579a[_0xbf66('0x1f')]){delete _0x30579a[_0xbf66('0x1f')];}_0x40e18a[_0xbf66('0x18')](_0x495318)[_0xbf66('0x20')](_0x30579a);};}exports[_0xbf66('0x21')]=function(_0x50710d,_0x337790){var _0x1e76fb={},_0x2c701b={},_0xd5fa31={'count':0x0,'rows':[]};var _0x4fc4f0=_[_0xbf66('0x22')](db[_0xbf66('0x23')][_0xbf66('0x24')],function(_0x574a57){return{'name':_0x574a57[_0xbf66('0x25')],'type':_0x574a57[_0xbf66('0x26')][_0xbf66('0x27')]};});_0x2c701b[_0xbf66('0x28')]=_[_0xbf66('0x22')](_0x4fc4f0,_0xbf66('0x1f'));_0x2c701b[_0xbf66('0x29')]=_[_0xbf66('0x2a')](_0x50710d[_0xbf66('0x29')]);_0x2c701b[_0xbf66('0x2b')]=_['intersection'](_0x2c701b[_0xbf66('0x28')],_0x2c701b[_0xbf66('0x29')]);_0x1e76fb['attributes']=_[_0xbf66('0x2c')](_0x2c701b[_0xbf66('0x28')],qs['fields'](_0x50710d[_0xbf66('0x29')][_0xbf66('0x2d')]));_0x1e76fb[_0xbf66('0x2e')]=_0x1e76fb['attributes'][_0xbf66('0x2f')]?_0x1e76fb[_0xbf66('0x2e')]:_0x2c701b[_0xbf66('0x28')];if(!_0x50710d['query']['hasOwnProperty']('nolimit')){_0x1e76fb[_0xbf66('0x17')]=qs['limit'](_0x50710d['query'][_0xbf66('0x17')]);_0x1e76fb[_0xbf66('0x16')]=qs[_0xbf66('0x16')](_0x50710d[_0xbf66('0x29')][_0xbf66('0x16')]);}_0x1e76fb[_0xbf66('0x30')]=qs['sort'](_0x50710d['query']['sort']);_0x1e76fb[_0xbf66('0x31')]=qs['filters'](_[_0xbf66('0x32')](_0x50710d[_0xbf66('0x29')],_0x2c701b[_0xbf66('0x2b')]));if(_0x50710d[_0xbf66('0x29')][_0xbf66('0x33')]){_0x1e76fb[_0xbf66('0x31')]=_[_0xbf66('0x34')](_0x1e76fb['where'],{'$or':_[_0xbf66('0x22')](_0x4fc4f0,function(_0x5e937a){if(_0x5e937a['type']!==_0xbf66('0x35')){var _0x1fae20={};_0x1fae20[_0x5e937a[_0xbf66('0x1f')]]={'$like':'%'+_0x50710d[_0xbf66('0x29')][_0xbf66('0x33')]+'%'};return _0x1fae20;}})});}_0x1e76fb=_[_0xbf66('0x34')]({},_0x1e76fb,_0x50710d[_0xbf66('0x36')]);var _0x18367a={'where':_0x1e76fb[_0xbf66('0x31')]};return db['ChatTransferReport'][_0xbf66('0x37')](_0x18367a)[_0xbf66('0x1d')](function(_0x29d8d3){_0xd5fa31['count']=_0x29d8d3;if(_0x50710d[_0xbf66('0x29')][_0xbf66('0x38')]){_0x1e76fb[_0xbf66('0x39')]=[{'all':!![]}];}return db[_0xbf66('0x23')][_0xbf66('0x3a')](_0x1e76fb);})['then'](function(_0x5044f7){_0xd5fa31['rows']=_0x5044f7;return _0xd5fa31;})[_0xbf66('0x1d')](respondWithFilteredResult(_0x337790,_0x1e76fb))['catch'](handleError(_0x337790,null));};exports[_0xbf66('0x3b')]=function(_0x226fde,_0x566b1e){var _0x374b52={'raw':!![],'where':{'id':_0x226fde[_0xbf66('0x3c')]['id']}},_0x4a11b9={};_0x4a11b9[_0xbf66('0x28')]=_[_0xbf66('0x2a')](db['ChatTransferReport']['rawAttributes']);_0x4a11b9[_0xbf66('0x29')]=_[_0xbf66('0x2a')](_0x226fde[_0xbf66('0x29')]);_0x4a11b9[_0xbf66('0x2b')]=_['intersection'](_0x4a11b9[_0xbf66('0x28')],_0x4a11b9['query']);_0x374b52['attributes']=_[_0xbf66('0x2c')](_0x4a11b9[_0xbf66('0x28')],qs[_0xbf66('0x2d')](_0x226fde[_0xbf66('0x29')][_0xbf66('0x2d')]));_0x374b52[_0xbf66('0x2e')]=_0x374b52[_0xbf66('0x2e')]['length']?_0x374b52[_0xbf66('0x2e')]:_0x4a11b9[_0xbf66('0x28')];if(_0x226fde[_0xbf66('0x29')][_0xbf66('0x38')]){_0x374b52[_0xbf66('0x39')]=[{'all':!![]}];}_0x374b52=_['merge']({},_0x374b52,_0x226fde['options']);return db['ChatTransferReport'][_0xbf66('0x3d')](_0x374b52)['then'](handleEntityNotFound(_0x566b1e,null))[_0xbf66('0x1d')](respondWithResult(_0x566b1e,null))[_0xbf66('0x3e')](handleError(_0x566b1e,null));};exports[_0xbf66('0x3f')]=function(_0x115c2f,_0x547864){return db[_0xbf66('0x23')]['create'](_0x115c2f[_0xbf66('0x40')],{})['then'](respondWithResult(_0x547864,0xc9))[_0xbf66('0x3e')](handleError(_0x547864,null));};exports[_0xbf66('0x41')]=function(_0x46a054,_0x210636){if(_0x46a054[_0xbf66('0x40')]['id']){delete _0x46a054[_0xbf66('0x40')]['id'];}return db[_0xbf66('0x23')][_0xbf66('0x3d')]({'where':{'id':_0x46a054[_0xbf66('0x3c')]['id']}})[_0xbf66('0x1d')](handleEntityNotFound(_0x210636,null))[_0xbf66('0x1d')](saveUpdates(_0x46a054[_0xbf66('0x40')],null))[_0xbf66('0x1d')](respondWithResult(_0x210636,null))[_0xbf66('0x3e')](handleError(_0x210636,null));};exports[_0xbf66('0x42')]=function(_0x5dfbc6,_0x2cfa20){return db[_0xbf66('0x23')][_0xbf66('0x3d')]({'where':{'id':_0x5dfbc6[_0xbf66('0x3c')]['id']}})[_0xbf66('0x1d')](handleEntityNotFound(_0x2cfa20,null))[_0xbf66('0x1d')](removeEntity(_0x2cfa20,null))['catch'](handleError(_0x2cfa20,null));};exports[_0xbf66('0x43')]=function(_0x175aca,_0x314aad){return db[_0xbf66('0x23')]['describe']()['then'](respondWithResult(_0x314aad,null))[_0xbf66('0x3e')](handleError(_0x314aad,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 6cb56d3..9676138 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 _0xcdd1=['ChatTransferReport','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./chatTransferReport.attributes','exports','define'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0xcdd1,0x13a));var _0x1cdd=function(_0xf89c3,_0x351bf1){_0xf89c3=_0xf89c3-0x0;var _0x274fc8=_0xcdd1[_0xf89c3];return _0x274fc8;};'use strict';var _=require(_0x1cdd('0x0'));var util=require(_0x1cdd('0x1'));var logger=require(_0x1cdd('0x2'))(_0x1cdd('0x3'));var moment=require('moment');var BPromise=require(_0x1cdd('0x4'));var rp=require(_0x1cdd('0x5'));var fs=require('fs');var path=require(_0x1cdd('0x6'));var rimraf=require(_0x1cdd('0x7'));var config=require('../../config/environment');var attributes=require(_0x1cdd('0x8'));module[_0x1cdd('0x9')]=function(_0x446477,_0x29a84a){return _0x446477[_0x1cdd('0xa')](_0x1cdd('0xb'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x1cdd('0xc'),'fields':[_0x1cdd('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xff91=['define','report_chat_transfer','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x4e0eb6,_0x240784){var _0x46e432=function(_0x24b973){while(--_0x24b973){_0x4e0eb6['push'](_0x4e0eb6['shift']());}};_0x46e432(++_0x240784);}(_0xff91,0x1d1));var _0x1ff9=function(_0x2b8e5a,_0x24f667){_0x2b8e5a=_0x2b8e5a-0x0;var _0x57f8a4=_0xff91[_0x2b8e5a];return _0x57f8a4;};'use strict';var _=require('lodash');var util=require(_0x1ff9('0x0'));var logger=require(_0x1ff9('0x1'))(_0x1ff9('0x2'));var moment=require(_0x1ff9('0x3'));var BPromise=require(_0x1ff9('0x4'));var rp=require(_0x1ff9('0x5'));var fs=require('fs');var path=require(_0x1ff9('0x6'));var rimraf=require(_0x1ff9('0x7'));var config=require('../../config/environment');var attributes=require('./chatTransferReport.attributes');module['exports']=function(_0x3ce8b8,_0x371e6d){return _0x3ce8b8[_0x1ff9('0x8')]('ChatTransferReport',attributes,{'tableName':_0x1ff9('0x9'),'paranoid':![],'indexes':[{'name':_0x1ff9('0xa'),'fields':[_0x1ff9('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 77990fb..a096aff 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 _0x06e3=['../../config/utils','../../config/logger','jayson/promise','client','http','request','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x1ef90c,_0x23ab1d){var _0x5caeab=function(_0x15a652){while(--_0x15a652){_0x1ef90c['push'](_0x1ef90c['shift']());}};_0x5caeab(++_0x23ab1d);}(_0x06e3,0x1b3));var _0x306e=function(_0x5abd58,_0xbf13b8){_0x5abd58=_0x5abd58-0x0;var _0x32171f=_0x06e3[_0x5abd58];return _0x32171f;};'use strict';var _=require('lodash');var util=require(_0x306e('0x0'));var moment=require(_0x306e('0x1'));var BPromise=require(_0x306e('0x2'));var rs=require(_0x306e('0x3'));var fs=require('fs');var Redis=require(_0x306e('0x4'));var db=require(_0x306e('0x5'))['db'];var utils=require(_0x306e('0x6'));var logger=require(_0x306e('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x306e('0x8'));var client=jayson[_0x306e('0x9')][_0x306e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x51f70a,_0x25d9ca,_0x1b46c4){return new BPromise(function(_0x19d0cc,_0x5dacf3){return client[_0x306e('0xb')](_0x51f70a,_0x1b46c4)['then'](function(_0x478252){logger[_0x306e('0xc')](_0x306e('0xd'),_0x25d9ca,_0x306e('0xe'));logger[_0x306e('0xf')](_0x306e('0x10'),_0x25d9ca,_0x306e('0xe'),JSON['stringify'](_0x478252));if(_0x478252[_0x306e('0x11')]){if(_0x478252[_0x306e('0x11')]['code']===0x1f4){logger[_0x306e('0x11')](_0x306e('0xd'),_0x25d9ca,_0x478252[_0x306e('0x11')][_0x306e('0x12')]);return _0x5dacf3(_0x478252[_0x306e('0x11')][_0x306e('0x12')]);}logger['error'](_0x306e('0xd'),_0x25d9ca,_0x478252['error'][_0x306e('0x12')]);return _0x19d0cc(_0x478252[_0x306e('0x11')][_0x306e('0x12')]);}else{logger[_0x306e('0xc')]('ChatTransferReport,\x20%s,\x20%s',_0x25d9ca,'request\x20sent');_0x19d0cc(_0x478252[_0x306e('0x13')][_0x306e('0x12')]);}})[_0x306e('0x14')](function(_0x350cc9){logger[_0x306e('0x11')](_0x306e('0xd'),_0x25d9ca,_0x350cc9);_0x5dacf3(_0x350cc9);});});} \ No newline at end of file +var _0xd8ee=['rpc','../../config/environment','jayson/promise','client','request','then','ChatTransferReport,\x20%s,\x20%s','stringify','error','code','message','info','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x378e9c,_0x2ec930){var _0x48ea69=function(_0x48e267){while(--_0x48e267){_0x378e9c['push'](_0x378e9c['shift']());}};_0x48ea69(++_0x2ec930);}(_0xd8ee,0x9c));var _0xed8e=function(_0xd1179e,_0x5c65de){_0xd1179e=_0xd1179e-0x0;var _0x1c7c8e=_0xd8ee[_0xd1179e];return _0x1c7c8e;};'use strict';var _=require(_0xed8e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xed8e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xed8e('0x2'));var db=require(_0xed8e('0x3'))['db'];var utils=require(_0xed8e('0x4'));var logger=require(_0xed8e('0x5'))(_0xed8e('0x6'));var config=require(_0xed8e('0x7'));var jayson=require(_0xed8e('0x8'));var client=jayson[_0xed8e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1c2a7b,_0x43748e,_0x255347){return new BPromise(function(_0x3f085b,_0x27c38a){return client[_0xed8e('0xa')](_0x1c2a7b,_0x255347)[_0xed8e('0xb')](function(_0x1c2441){logger['info'](_0xed8e('0xc'),_0x43748e,'request\x20sent');logger['debug']('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x43748e,'request\x20sent',JSON[_0xed8e('0xd')](_0x1c2441));if(_0x1c2441[_0xed8e('0xe')]){if(_0x1c2441[_0xed8e('0xe')][_0xed8e('0xf')]===0x1f4){logger['error'](_0xed8e('0xc'),_0x43748e,_0x1c2441[_0xed8e('0xe')][_0xed8e('0x10')]);return _0x27c38a(_0x1c2441[_0xed8e('0xe')]['message']);}logger[_0xed8e('0xe')](_0xed8e('0xc'),_0x43748e,_0x1c2441[_0xed8e('0xe')][_0xed8e('0x10')]);return _0x3f085b(_0x1c2441[_0xed8e('0xe')][_0xed8e('0x10')]);}else{logger[_0xed8e('0x11')](_0xed8e('0xc'),_0x43748e,'request\x20sent');_0x3f085b(_0x1c2441['result'][_0xed8e('0x10')]);}})['catch'](function(_0x4d9963){logger[_0xed8e('0xe')](_0xed8e('0xc'),_0x43748e,_0x4d9963);_0x27c38a(_0x4d9963);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 8fd4dcc..1446b9c 100644 --- a/server/api/chatTransferReport/index.js +++ b/server/api/chatTransferReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf0=['connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','util','path'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xbaf0,0x12a));var _0x0baf=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbaf0[_0x14add3];return _0x4a174f;};'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 _0x5f66=['describe','get','/:id','show','create','put','delete','destroy','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatTransferReport.controller','isAuthenticated','index'];(function(_0x44bcb0,_0x235aa9){var _0xfaf881=function(_0x25d81d){while(--_0x25d81d){_0x44bcb0['push'](_0x44bcb0['shift']());}};_0xfaf881(++_0x235aa9);}(_0x5f66,0x1a0));var _0x65f6=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x5f66[_0x173441];return _0x2423a8;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var auth=require(_0x65f6('0x4'));var interaction=require(_0x65f6('0x5'));var config=require('../../config/environment');var controller=require(_0x65f6('0x6'));router['get']('/',auth[_0x65f6('0x7')](),controller[_0x65f6('0x8')]);router['get']('/describe',auth[_0x65f6('0x7')](),controller[_0x65f6('0x9')]);router[_0x65f6('0xa')](_0x65f6('0xb'),auth[_0x65f6('0x7')](),controller[_0x65f6('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x65f6('0xd')]);router[_0x65f6('0xe')](_0x65f6('0xb'),auth[_0x65f6('0x7')](),controller['update']);router[_0x65f6('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x65f6('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index bf16812..20a9551 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 _0xfeab=['#9f946a','#ffffff','BOOLEAN','ENUM','squared','rounded','We\x20are\x20here!','Send','Contact\x20us','INTEGER','Powered\x20by\x20xCALLY','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','input','name','text','getDataValue','onlineForm','parse','stringify','Comments','Leave\x20your\x20comments','offlineForm','setDataValue','generate','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','exports','STRING','address','email'];(function(_0x3f4f3b,_0x2d7be2){var _0xfc6f02=function(_0x226ae2){while(--_0x226ae2){_0x3f4f3b['push'](_0x3f4f3b['shift']());}};_0xfc6f02(++_0x2d7be2);}(_0xfeab,0x184));var _0xbfea=function(_0x5b48be,_0x2edd73){_0x5b48be=_0x5b48be-0x0;var _0x4c586d=_0xfeab[_0x5b48be];return _0x4c586d;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0xbfea('0x0')]={'name':{'type':Sequelize[_0xbfea('0x1')],'allowNull':![]},'address':{'type':Sequelize[_0xbfea('0x1')],'allowNull':![],'unique':_0xbfea('0x2')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0xbfea('0x1')],'defaultValue':_0xbfea('0x3')},'mapKeyOffline':{'type':Sequelize[_0xbfea('0x1')],'defaultValue':_0xbfea('0x3')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xbfea('0x1')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0xbfea('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xbfea('0x4'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xbfea('0x1')],'allowNull':![],'defaultValue':_0xbfea('0x4'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xbfea('0x1')],'allowNull':![],'defaultValue':_0xbfea('0x5'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0xbfea('0x6')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xbfea('0x7')]('rounded',_0xbfea('0x8')),'defaultValue':_0xbfea('0x9')},'header_online':{'type':Sequelize[_0xbfea('0x1')],'defaultValue':_0xbfea('0xa')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0xbfea('0x1')],'defaultValue':_0xbfea('0xb')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0xbfea('0xc')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xbfea('0xd')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xbfea('0x1')],'defaultValue':_0xbfea('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0xbfea('0x6')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xbfea('0xf')]},'closingQuestion':{'type':Sequelize[_0xbfea('0x1')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0xbfea('0x1')],'defaultValue':_0xbfea('0x10')},'formSubmitFailureMessage':{'type':Sequelize[_0xbfea('0x1')],'defaultValue':_0xbfea('0x11')},'noteTitle':{'type':Sequelize[_0xbfea('0x1')],'defaultValue':_0xbfea('0x12')},'placeholderMessage':{'type':Sequelize[_0xbfea('0x1')],'defaultValue':_0xbfea('0x13')},'closingMessage':{'type':Sequelize[_0xbfea('0x1')],'defaultValue':_0xbfea('0x14')},'closingMessageButton':{'type':Sequelize[_0xbfea('0x1')],'defaultValue':_0xbfea('0xb')},'skipMessageButton':{'type':Sequelize[_0xbfea('0x1')],'defaultValue':_0xbfea('0x15')},'conditionAgreement':{'type':Sequelize[_0xbfea('0x6')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xbfea('0x6')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xbfea('0x6')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0xbfea('0x16')},'ratingType':{'type':Sequelize['ENUM'](_0xbfea('0x17'),_0xbfea('0x18')),'defaultValue':_0xbfea('0x17')},'ratingStarsNumber':{'type':Sequelize[_0xbfea('0xd')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xbfea('0xf')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xbfea('0x19'),'variable':null,'config':{'placeholder':_0xbfea('0x1a'),'type':_0xbfea('0x1b'),'required':!![]},'props':{'title':_0xbfea('0x1a'),'helpText':''}},{'type':_0xbfea('0x19'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xbfea('0x3'),'type':_0xbfea('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xbfea('0x1c')](_0xbfea('0x1d'))?JSON[_0xbfea('0x1e')](this[_0xbfea('0x1c')](_0xbfea('0x1d'))):{};},'set':function(_0x4e7fb8){return this['setDataValue'](_0xbfea('0x1d'),JSON[_0xbfea('0x1f')](_0x4e7fb8));}},'offlineForm':{'type':Sequelize[_0xbfea('0xf')],'defaultValue':function(){return JSON[_0xbfea('0x1f')]({'items':[{'type':_0xbfea('0x19'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xbfea('0x3'),'type':'email'},'variable':null},{'type':'textarea','config':{'placeholder':_0xbfea('0x20')},'props':{'title':_0xbfea('0x20'),'helpText':_0xbfea('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0xbfea('0x1c')](_0xbfea('0x22'))?JSON['parse'](this[_0xbfea('0x1c')](_0xbfea('0x22'))):{};},'set':function(_0x55cdd0){return this[_0xbfea('0x23')](_0xbfea('0x22'),JSON['stringify'](_0x55cdd0));}},'token':{'type':Sequelize[_0xbfea('0x1')],'defaultValue':function(){return rs[_0xbfea('0x24')]();}},'autoclose':{'type':Sequelize[_0xbfea('0x6')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xbfea('0x6')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xbfea('0x1')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xbfea('0x1')]},'waitingTitle':{'type':Sequelize[_0xbfea('0x1')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0xbfea('0x1')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0xbfea('0x1')],'defaultValue':_0xbfea('0x25')},'offlineMessageBody':{'type':Sequelize[_0xbfea('0x1')],'defaultValue':_0xbfea('0x26')},'enableUnmanagedNote':{'type':Sequelize[_0xbfea('0x6')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0xbfea('0x27')},'skipUnmanaged':{'type':Sequelize[_0xbfea('0x1')],'defaultValue':_0xbfea('0x15')},'sendUnmanaged':{'type':Sequelize[_0xbfea('0x1')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xbfea('0x6')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0xbfea('0x1')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xbfea('0x28');}},'notificationSound':{'type':Sequelize[_0xbfea('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xbfea('0x6')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xbfea('0x1')],'defaultValue':_0xbfea('0x29')},'waitForTheAssignedAgent':{'type':Sequelize[_0xbfea('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xbfea('0x1')],'defaultValue':_0xbfea('0x2a')},'verticalAlignment':{'type':Sequelize[_0xbfea('0xd')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xbfea('0x1')],'defaultValue':_0xbfea('0x2b')},'defaultTitle':{'type':Sequelize[_0xbfea('0x1')]},'customerAvatar':{'type':Sequelize[_0xbfea('0xf')]},'showCustomerAvatar':{'type':Sequelize[_0xbfea('0x6')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xbfea('0xd')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xbfea('0x2c'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xbfea('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xbfea('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xbfea('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0xbfea('0x2d')},'systemAvatar':{'type':Sequelize[_0xbfea('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xbfea('0xd')],'comment':_0xbfea('0x2e')},'mandatoryDisposition':{'type':Sequelize[_0xbfea('0x6')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x576c32){if(!_0x576c32)this[_0xbfea('0x23')](_0xbfea('0x2f'),null);this[_0xbfea('0x23')](_0xbfea('0x30'),_0x576c32);}}}; \ No newline at end of file +var _0x41e0=['Form\x20submission\x20error','Thanks\x20you\x20for\x20your\x20time!','Skip','ENUM','star','input','name','getDataValue','onlineForm','parse','setDataValue','stringify','textarea','Comments','offlineForm','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','alternate','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','randomstring','exports','STRING','address','email','Agent','#9f946a','#ffffff','INTEGER','BOOLEAN','rounded','squared','We\x20are\x20here!','Send','Contact\x20us','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted'];(function(_0x3f7e3e,_0x2b2419){var _0x466292=function(_0x4014bf){while(--_0x4014bf){_0x3f7e3e['push'](_0x3f7e3e['shift']());}};_0x466292(++_0x2b2419);}(_0x41e0,0x17e));var _0x041e=function(_0x21efd3,_0x445165){_0x21efd3=_0x21efd3-0x0;var _0x3898f5=_0x41e0[_0x21efd3];return _0x3898f5;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x041e('0x0'));module[_0x041e('0x1')]={'name':{'type':Sequelize[_0x041e('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x041e('0x2')],'allowNull':![],'unique':_0x041e('0x3')},'description':{'type':Sequelize[_0x041e('0x2')]},'mapKey':{'type':Sequelize[_0x041e('0x2')],'defaultValue':_0x041e('0x4')},'mapKeyOffline':{'type':Sequelize[_0x041e('0x2')],'defaultValue':'email'},'key':{'type':Sequelize[_0x041e('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x041e('0x2')],'defaultValue':_0x041e('0x5')},'customerAlias':{'type':Sequelize[_0x041e('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x041e('0x2')],'allowNull':![],'defaultValue':'#9f946a','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x041e('0x2')],'allowNull':![],'defaultValue':_0x041e('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x041e('0x2')],'allowNull':![],'defaultValue':_0x041e('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x041e('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0x041e('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0x041e('0xa'),_0x041e('0xb')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0x041e('0x2')],'defaultValue':_0x041e('0xc')},'start_chat_button':{'type':Sequelize[_0x041e('0x2')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0x041e('0x2')],'defaultValue':_0x041e('0xd')},'header_offline':{'type':Sequelize[_0x041e('0x2')],'defaultValue':_0x041e('0xe')},'download_transcript':{'type':Sequelize[_0x041e('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x041e('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x041e('0x2')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0x041e('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x041e('0xf')]},'closingQuestion':{'type':Sequelize[_0x041e('0x2')],'defaultValue':_0x041e('0x10')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x041e('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0x041e('0x2')],'defaultValue':_0x041e('0x12')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0x041e('0x2')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x041e('0x2')],'defaultValue':_0x041e('0x13')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0x041e('0x2')],'defaultValue':_0x041e('0x14')},'conditionAgreement':{'type':Sequelize[_0x041e('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x041e('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x041e('0x2')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0x041e('0x15')](_0x041e('0x16'),'thumb'),'defaultValue':_0x041e('0x16')},'ratingStarsNumber':{'type':Sequelize[_0x041e('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x041e('0x17'),'variable':null,'config':{'placeholder':_0x041e('0x18'),'type':'text','required':!![]},'props':{'title':_0x041e('0x18'),'helpText':''}},{'type':_0x041e('0x17'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x041e('0x4'),'type':_0x041e('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x041e('0x19')](_0x041e('0x1a'))?JSON[_0x041e('0x1b')](this['getDataValue'](_0x041e('0x1a'))):{};},'set':function(_0x418706){return this[_0x041e('0x1c')](_0x041e('0x1a'),JSON[_0x041e('0x1d')](_0x418706));}},'offlineForm':{'type':Sequelize[_0x041e('0xf')],'defaultValue':function(){return JSON[_0x041e('0x1d')]({'items':[{'type':'input','props':{'title':_0x041e('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x041e('0x4'),'type':'email'},'variable':null},{'type':_0x041e('0x1e'),'config':{'placeholder':'Comments'},'props':{'title':_0x041e('0x1f'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0x041e('0x19')](_0x041e('0x20'))?JSON['parse'](this[_0x041e('0x19')](_0x041e('0x20'))):{};},'set':function(_0x3236f1){return this[_0x041e('0x1c')](_0x041e('0x20'),JSON[_0x041e('0x1d')](_0x3236f1));}},'token':{'type':Sequelize[_0x041e('0x2')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x041e('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x041e('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0x041e('0x21')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x041e('0x22')},'offlineMessageSubject':{'type':Sequelize[_0x041e('0x2')],'defaultValue':_0x041e('0x23')},'offlineMessageBody':{'type':Sequelize[_0x041e('0x2')],'defaultValue':_0x041e('0x24')},'enableUnmanagedNote':{'type':Sequelize[_0x041e('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0x041e('0x2')],'defaultValue':_0x041e('0x14')},'sendUnmanaged':{'type':Sequelize[_0x041e('0x2')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x041e('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x041e('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x041e('0xf')]},'showAgentAvatar':{'type':Sequelize[_0x041e('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x041e('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x041e('0x2')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x041e('0x2')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0x041e('0x8')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x041e('0x2')],'defaultValue':_0x041e('0x25')},'defaultTitle':{'type':Sequelize[_0x041e('0x2')]},'customerAvatar':{'type':Sequelize[_0x041e('0xf')]},'showCustomerAvatar':{'type':Sequelize[_0x041e('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x041e('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x041e('0x2')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x041e('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x041e('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x041e('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0x041e('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x041e('0x8')],'comment':_0x041e('0x26')},'mandatoryDisposition':{'type':Sequelize[_0x041e('0x9')],'defaultValue':![],'comment':_0x041e('0x27'),'set':function(_0x1a6059){if(!_0x1a6059)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0x041e('0x1c')]('mandatoryDisposition',_0x1a6059);}}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 7d6071b..40c1518 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 _0x8b4b=['showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','notify','user-agent-parser','setUA','headers','user-agent','getResult','chat','CmContact','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','ChatApplication','Applications','account','applications','list','orderBy','asc','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','split','x-real-port','browser','version','format','%s\x20%s','unknown','device','vendor','stringify','threadId','ChatInteraction','externalUrl','interaction','firstName','lastName','messageId','created','push','ChatMessage','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','EventManager','offline','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','findOrCreate','spread','readFileSync','utf8','render','toPairs','offlineMessageBody','MailAccount','MailServerOut','Smtp','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','addInteraction','omit','Contact','User','Owner','fullname','internal','Tags','tag','Command','getSnippet','timezone','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','interval','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','../../config/license/util','virtual','License','increment','chatLicenseExceeded','some','server/files/chat/iframe.js','remote','remoteAddress','referer','alignment','verticalAlignment','color','textColor','sequelize','bulkCreate','getApplications','chatProactiveAction','addProactiveActions','ChatProactiveAction','getFields','offlineForm','onlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','include','addAgents','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','lodash','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./chatWebsite.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','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','info','result','sendStatus','status','json','count','offset','set','Content-Range','reject','save','update','then','destroy','get','UserProfileResource','end','name','send','index','Pause','map','ChatWebsite','rawAttributes','type','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','findAll','rows','catch','show','mandatoryDispositionPause','keys','length','find','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatWebsites','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','merge','removeDispositions','getAnswers','CannedAnswer','removeAnswers','ids','addLogo','sitepic','file','filename','agentAvatar','addCustomerAvatar','addSystemAvatar','getLogo','join','getLicense','isNil','existsSync','root','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar'];(function(_0x506d83,_0x1899e9){var _0x335e8b=function(_0x4a7044){while(--_0x4a7044){_0x506d83['push'](_0x506d83['shift']());}};_0x335e8b(++_0x1899e9);}(_0x8b4b,0x97));var _0xb8b4=function(_0x2d12c3,_0x25cd87){_0x2d12c3=_0x2d12c3-0x0;var _0x10d916=_0x8b4b[_0x2d12c3];return _0x10d916;};'use strict';var pdf=require(_0xb8b4('0x0'));var emlformat=require(_0xb8b4('0x1'));var rimraf=require(_0xb8b4('0x2'));var zipdir=require(_0xb8b4('0x3'));var jsonpatch=require(_0xb8b4('0x4'));var rp=require(_0xb8b4('0x5'));var moment=require(_0xb8b4('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xb8b4('0x7'));var util=require('util');var path=require(_0xb8b4('0x8'));var sox=require(_0xb8b4('0x9'));var csv=require(_0xb8b4('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb8b4('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb8b4('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xb8b4('0xa'));var querystring=require(_0xb8b4('0xd'));var Papa=require(_0xb8b4('0xe'));var Redis=require(_0xb8b4('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xb8b4('0x10'));var as=require(_0xb8b4('0x11'));var hardwareService=require(_0xb8b4('0x12'));var logger=require(_0xb8b4('0x13'))(_0xb8b4('0x14'));var utils=require(_0xb8b4('0x15'));var config=require(_0xb8b4('0x16'));var db=require(_0xb8b4('0x17'))['db'];config[_0xb8b4('0x18')]=_[_0xb8b4('0x19')](config[_0xb8b4('0x18')],{'host':_0xb8b4('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb8b4('0x18')]));require(_0xb8b4('0x1b'))[_0xb8b4('0x1c')](socket);var jayson=require(_0xb8b4('0x1d'));var client=jayson[_0xb8b4('0x1e')][_0xb8b4('0x1f')]({'port':0x232c});var client9002=jayson['client'][_0xb8b4('0x1f')]({'port':0x232a});var client9003=jayson[_0xb8b4('0x1e')][_0xb8b4('0x1f')]({'port':0x232b});function checkPasswordPattern(_0x3485f8,_0x5a51a5,_0x1f83f1){if(_0x1f83f1){var _0xca6d76=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xca6d76[_0xb8b4('0x20')](_0x5a51a5)){return _0x3485f8;}else{throw new db[(_0xb8b4('0x21'))][(_0xb8b4('0x22'))](_0xb8b4('0x23'));}}else{return _0x3485f8;}}function respondWithRpcPromise(_0x5bd233,_0x1e62a6,_0x3f7dc2,_0x53a8d2){return new BPromise(function(_0x469fed,_0x4ff4bb){var _0x96782f=_0x53a8d2||client;return _0x96782f[_0xb8b4('0x24')](_0x5bd233,_0x3f7dc2)['then'](function(_0x150e26){logger['info'](_0xb8b4('0x25'),_0x1e62a6,_0xb8b4('0x26'));logger[_0xb8b4('0x27')](_0xb8b4('0x28'),_0x1e62a6,_0xb8b4('0x26'),JSON['stringify'](_0x150e26));if(_0x150e26[_0xb8b4('0x29')]){if(_0x150e26['error'][_0xb8b4('0x2a')]===0x1f4){logger[_0xb8b4('0x29')](_0xb8b4('0x25'),_0x1e62a6,_0x150e26[_0xb8b4('0x29')][_0xb8b4('0x2b')]);return _0x4ff4bb(_0x150e26['error'][_0xb8b4('0x2b')]);}logger[_0xb8b4('0x29')]('ChatWebsite,\x20%s,\x20%s',_0x1e62a6,_0x150e26[_0xb8b4('0x29')][_0xb8b4('0x2b')]);return _0x469fed(_0x150e26[_0xb8b4('0x29')]['message']);}else{logger[_0xb8b4('0x2c')]('ChatWebsite,\x20%s,\x20%s',_0x1e62a6,'request\x20sent');_0x469fed(_0x150e26[_0xb8b4('0x2d')][_0xb8b4('0x2b')]);}})['catch'](function(_0x4f6f09){logger[_0xb8b4('0x29')](_0xb8b4('0x25'),_0x1e62a6,_0x4f6f09);_0x4ff4bb(_0x4f6f09);});});}function respondWithStatusCode(_0x533c6c,_0x857eb1){_0x857eb1=_0x857eb1||0xcc;return function(_0x48abea){if(_0x48abea){return _0x533c6c[_0xb8b4('0x2e')](_0x857eb1);}return _0x533c6c[_0xb8b4('0x2f')](_0x857eb1)['end']();};}function respondWithResult(_0x5d611a,_0x3a63a9){_0x3a63a9=_0x3a63a9||0xc8;return function(_0x49e6c1){if(_0x49e6c1){return _0x5d611a[_0xb8b4('0x2f')](_0x3a63a9)[_0xb8b4('0x30')](_0x49e6c1);}};}function respondWithFilteredResult(_0x301444,_0x49d329){return function(_0x48f910){if(_0x48f910){var _0x1de749=_0x48f910[_0xb8b4('0x31')],_0x2c7fb1=_0x49d329['offset'],_0x3d18aa=_0x49d329[_0xb8b4('0x32')]+_0x49d329['limit'],_0x267d40;if(_0x3d18aa>=_0x1de749){_0x3d18aa=_0x1de749;_0x267d40=0xc8;}else{_0x267d40=0xce;}_0x301444[_0xb8b4('0x2f')](_0x267d40);return _0x301444[_0xb8b4('0x33')](_0xb8b4('0x34'),_0x2c7fb1+'-'+_0x3d18aa+'/'+_0x1de749)[_0xb8b4('0x30')](_0x48f910);}return null;};}function patchUpdates(_0x53f5dd){return function(_0x3f9ac6){try{jsonpatch['apply'](_0x3f9ac6,_0x53f5dd,!![]);}catch(_0x38c37c){return BPromise[_0xb8b4('0x35')](_0x38c37c);}return _0x3f9ac6[_0xb8b4('0x36')]();};}function saveUpdates(_0x23f3d0,_0x3ae7bb){return function(_0x15509a){if(_0x15509a){return _0x15509a[_0xb8b4('0x37')](_0x23f3d0)[_0xb8b4('0x38')](function(_0x2bc1db){return _0x2bc1db;});}return null;};}function removeEntity(_0x11d479,_0x2856cf){return function(_0x148cfa){if(_0x148cfa){return _0x148cfa[_0xb8b4('0x39')]()[_0xb8b4('0x38')](function(){var _0x4f2a65=_0x148cfa[_0xb8b4('0x3a')]({'plain':!![]});var _0x4941bc='ChatWebsites';return db[_0xb8b4('0x3b')][_0xb8b4('0x39')]({'where':{'type':_0x4941bc,'resourceId':_0x4f2a65['id']}})[_0xb8b4('0x38')](function(){return _0x148cfa;});})['then'](function(){_0x11d479[_0xb8b4('0x2f')](0xcc)[_0xb8b4('0x3c')]();});}};}function handleEntityNotFound(_0x342d26,_0x2426c1){return function(_0x52784f){if(!_0x52784f){_0x342d26['sendStatus'](0x194);}return _0x52784f;};}function handleError(_0x2126cf,_0x1e71f5){_0x1e71f5=_0x1e71f5||0x1f4;return function(_0x2ac494){logger[_0xb8b4('0x29')](_0x2ac494['stack']);if(_0x2ac494[_0xb8b4('0x3d')]){delete _0x2ac494[_0xb8b4('0x3d')];}_0x2126cf[_0xb8b4('0x2f')](_0x1e71f5)[_0xb8b4('0x3e')](_0x2ac494);};}exports[_0xb8b4('0x3f')]=function(_0x29b2c1,_0x452be0){var _0x53b5c3={'include':[{'model':db[_0xb8b4('0x40')],'as':'mandatoryDispositionPause'}]},_0x26e5f1={},_0x32176d={'count':0x0,'rows':[]};var _0x4935bb=_[_0xb8b4('0x41')](db[_0xb8b4('0x42')][_0xb8b4('0x43')],function(_0x18908f){return{'name':_0x18908f['fieldName'],'type':_0x18908f[_0xb8b4('0x44')]['key']};});_0x26e5f1[_0xb8b4('0x45')]=_[_0xb8b4('0x41')](_0x4935bb,'name');_0x26e5f1['query']=_['keys'](_0x29b2c1[_0xb8b4('0x46')]);_0x26e5f1[_0xb8b4('0x47')]=_['intersection'](_0x26e5f1[_0xb8b4('0x45')],_0x26e5f1[_0xb8b4('0x46')]);_0x53b5c3['attributes']=_[_0xb8b4('0x48')](_0x26e5f1['model'],qs[_0xb8b4('0x49')](_0x29b2c1[_0xb8b4('0x46')]['fields']));_0x53b5c3['attributes']=_0x53b5c3[_0xb8b4('0x4a')]['length']?_0x53b5c3[_0xb8b4('0x4a')]:_0x26e5f1['model'];if(!_0x29b2c1[_0xb8b4('0x46')][_0xb8b4('0x4b')](_0xb8b4('0x4c'))){_0x53b5c3['limit']=qs['limit'](_0x29b2c1[_0xb8b4('0x46')][_0xb8b4('0x4d')]);_0x53b5c3['offset']=qs[_0xb8b4('0x32')](_0x29b2c1['query']['offset']);}_0x53b5c3[_0xb8b4('0x4e')]=qs['sort'](_0x29b2c1[_0xb8b4('0x46')][_0xb8b4('0x4f')]);_0x53b5c3[_0xb8b4('0x50')]=qs['filters'](_[_0xb8b4('0x51')](_0x29b2c1[_0xb8b4('0x46')],_0x26e5f1[_0xb8b4('0x47')]));if(_0x29b2c1[_0xb8b4('0x46')][_0xb8b4('0x52')]){_0x53b5c3[_0xb8b4('0x50')]=_['merge'](_0x53b5c3[_0xb8b4('0x50')],{'$or':_[_0xb8b4('0x41')](_0x4935bb,function(_0x1f4482){if(_0x1f4482[_0xb8b4('0x44')]!==_0xb8b4('0x53')){var _0x1ab9ce={};_0x1ab9ce[_0x1f4482[_0xb8b4('0x3d')]]={'$like':'%'+_0x29b2c1[_0xb8b4('0x46')][_0xb8b4('0x52')]+'%'};return _0x1ab9ce;}})});}_0x53b5c3=_['merge']({},_0x53b5c3,_0x29b2c1[_0xb8b4('0x54')]);var _0xa540c4={'where':_0x53b5c3[_0xb8b4('0x50')]};return db[_0xb8b4('0x42')]['count'](_0xa540c4)[_0xb8b4('0x38')](function(_0x2feb98){_0x32176d[_0xb8b4('0x31')]=_0x2feb98;if(_0x29b2c1[_0xb8b4('0x46')][_0xb8b4('0x55')]){_0x53b5c3['include']=[{'all':!![]}];}return db[_0xb8b4('0x42')][_0xb8b4('0x56')](_0x53b5c3);})['then'](function(_0x29db7a){_0x32176d[_0xb8b4('0x57')]=_0x29db7a;return _0x32176d;})[_0xb8b4('0x38')](respondWithFilteredResult(_0x452be0,_0x53b5c3))[_0xb8b4('0x58')](handleError(_0x452be0,null));};exports[_0xb8b4('0x59')]=function(_0x4d07a5,_0x5b0445){var _0x137e39={'raw':![],'where':{'id':_0x4d07a5['params']['id']},'include':[{'model':db[_0xb8b4('0x40')],'as':_0xb8b4('0x5a')}]},_0x522ee1={};_0x522ee1[_0xb8b4('0x45')]=_['keys'](db[_0xb8b4('0x42')][_0xb8b4('0x43')]);_0x522ee1[_0xb8b4('0x46')]=_[_0xb8b4('0x5b')](_0x4d07a5[_0xb8b4('0x46')]);_0x522ee1[_0xb8b4('0x47')]=_[_0xb8b4('0x48')](_0x522ee1['model'],_0x522ee1[_0xb8b4('0x46')]);_0x137e39[_0xb8b4('0x4a')]=_['intersection'](_0x522ee1[_0xb8b4('0x45')],qs[_0xb8b4('0x49')](_0x4d07a5['query']['fields']));_0x137e39[_0xb8b4('0x4a')]=_0x137e39[_0xb8b4('0x4a')][_0xb8b4('0x5c')]?_0x137e39[_0xb8b4('0x4a')]:_0x522ee1['model'];if(_0x4d07a5['query'][_0xb8b4('0x55')]){_0x137e39['include']=[{'all':!![]}];}_0x137e39=_['merge']({},_0x137e39,_0x4d07a5[_0xb8b4('0x54')]);return db['ChatWebsite'][_0xb8b4('0x5d')](_0x137e39)[_0xb8b4('0x38')](handleEntityNotFound(_0x5b0445,null))[_0xb8b4('0x38')](respondWithResult(_0x5b0445,null))['catch'](handleError(_0x5b0445,null));};exports['create']=function(_0x117dc1,_0x3a6e3d){return db[_0xb8b4('0x42')]['create'](_0x117dc1['body'],{})['then'](function(_0xe090cb){var _0x462f08=_0x117dc1[_0xb8b4('0x5e')][_0xb8b4('0x3a')]({'plain':!![]});if(!_0x462f08)throw new Error(_0xb8b4('0x5f'));if(_0x462f08[_0xb8b4('0x60')]==='user'){var _0x40dc3f=_0xe090cb[_0xb8b4('0x3a')]({'plain':!![]});var _0x385b09=_0xb8b4('0x61');return db['UserProfileSection']['find']({'where':{'name':_0x385b09,'userProfileId':_0x462f08['userProfileId']},'raw':!![]})['then'](function(_0x4efbad){if(_0x4efbad&&_0x4efbad[_0xb8b4('0x62')]===0x0){return db[_0xb8b4('0x3b')][_0xb8b4('0x63')]({'name':_0x40dc3f[_0xb8b4('0x3d')],'resourceId':_0x40dc3f['id'],'type':_0x4efbad[_0xb8b4('0x3d')],'sectionId':_0x4efbad['id']},{})['then'](function(){return _0xe090cb;});}else{return _0xe090cb;}})[_0xb8b4('0x58')](function(_0x1518dd){logger[_0xb8b4('0x29')](_0xb8b4('0x64'),_0x1518dd);throw _0x1518dd;});}return _0xe090cb;})[_0xb8b4('0x38')](respondWithResult(_0x3a6e3d,0xc9))[_0xb8b4('0x58')](handleError(_0x3a6e3d,null));};exports[_0xb8b4('0x37')]=function(_0x562a9a,_0x2f6990){if(_0x562a9a[_0xb8b4('0x65')]['id']){delete _0x562a9a[_0xb8b4('0x65')]['id'];}return db[_0xb8b4('0x42')][_0xb8b4('0x5d')]({'where':{'id':_0x562a9a[_0xb8b4('0x66')]['id']},'include':[{'model':db[_0xb8b4('0x40')],'as':'mandatoryDispositionPause'}]})[_0xb8b4('0x38')](handleEntityNotFound(_0x2f6990,null))[_0xb8b4('0x38')](saveUpdates(_0x562a9a[_0xb8b4('0x65')],null))[_0xb8b4('0x38')](respondWithResult(_0x2f6990,null))[_0xb8b4('0x58')](handleError(_0x2f6990,null));};exports[_0xb8b4('0x39')]=function(_0x15b61f,_0x33ade6){return db[_0xb8b4('0x42')][_0xb8b4('0x5d')]({'where':{'id':_0x15b61f[_0xb8b4('0x66')]['id']}})[_0xb8b4('0x38')](handleEntityNotFound(_0x33ade6,null))[_0xb8b4('0x38')](removeEntity(_0x33ade6,null))['catch'](handleError(_0x33ade6,null));};exports[_0xb8b4('0x67')]=function(_0x5b5d47,_0x940a15){return db[_0xb8b4('0x42')][_0xb8b4('0x67')]()[_0xb8b4('0x38')](respondWithResult(_0x940a15,null))[_0xb8b4('0x58')](handleError(_0x940a15,null));};exports[_0xb8b4('0x68')]=function(_0x401749,_0x30142f,_0x1bf129){if(_0x401749[_0xb8b4('0x65')]['id']){delete _0x401749[_0xb8b4('0x65')]['id'];}return db[_0xb8b4('0x42')]['find']({'where':{'id':_0x401749['params']['id']}})['then'](handleEntityNotFound(_0x30142f,null))[_0xb8b4('0x38')](function(_0x2a51a2){if(_0x2a51a2){_0x401749[_0xb8b4('0x65')][_0xb8b4('0x69')]=_0x2a51a2['id'];return db[_0xb8b4('0x6a')][_0xb8b4('0x63')](_0x401749[_0xb8b4('0x65')]);}})['then'](respondWithResult(_0x30142f,null))[_0xb8b4('0x58')](handleError(_0x30142f,null));};exports[_0xb8b4('0x6b')]=function(_0x3370c3,_0x34273d,_0x3b60a6){var _0x39e1a7={'raw':![],'where':{}};var _0x317f08={};var _0x6d8c92={'count':0x0,'rows':[]};return db[_0xb8b4('0x42')][_0xb8b4('0x6c')]({'where':{'id':_0x3370c3[_0xb8b4('0x66')]['id']}})[_0xb8b4('0x38')](handleEntityNotFound(_0x34273d,null))['then'](function(_0x550622){if(_0x550622){_0x317f08['model']=_[_0xb8b4('0x5b')](db['Disposition'][_0xb8b4('0x43')]);_0x317f08[_0xb8b4('0x46')]=_[_0xb8b4('0x5b')](_0x3370c3[_0xb8b4('0x46')]);_0x317f08[_0xb8b4('0x47')]=_[_0xb8b4('0x48')](_0x317f08[_0xb8b4('0x45')],_0x317f08[_0xb8b4('0x46')]);_0x39e1a7[_0xb8b4('0x4a')]=_['intersection'](_0x317f08[_0xb8b4('0x45')],qs[_0xb8b4('0x49')](_0x3370c3['query']['fields']));_0x39e1a7[_0xb8b4('0x4a')]=_0x39e1a7[_0xb8b4('0x4a')][_0xb8b4('0x5c')]?_0x39e1a7[_0xb8b4('0x4a')]:_0x317f08['model'];if(!_0x3370c3[_0xb8b4('0x46')]['hasOwnProperty'](_0xb8b4('0x4c'))){_0x39e1a7[_0xb8b4('0x4d')]=qs[_0xb8b4('0x4d')](_0x3370c3[_0xb8b4('0x46')][_0xb8b4('0x4d')]);_0x39e1a7[_0xb8b4('0x32')]=qs[_0xb8b4('0x32')](_0x3370c3[_0xb8b4('0x46')][_0xb8b4('0x32')]);}_0x39e1a7[_0xb8b4('0x4e')]=qs['sort'](_0x3370c3[_0xb8b4('0x46')][_0xb8b4('0x4f')]);_0x39e1a7['where']=qs[_0xb8b4('0x47')](_[_0xb8b4('0x51')](_0x3370c3[_0xb8b4('0x46')],_0x317f08[_0xb8b4('0x47')]));_0x39e1a7['where'][_0xb8b4('0x69')]=_0x550622['id'];if(_0x3370c3[_0xb8b4('0x46')][_0xb8b4('0x52')]){_0x39e1a7[_0xb8b4('0x50')]=_[_0xb8b4('0x6d')](_0x39e1a7['where'],{'$or':_[_0xb8b4('0x41')](_0x39e1a7[_0xb8b4('0x4a')],function(_0x2f9c3c){var _0x51863e={};_0x51863e[_0x2f9c3c]={'$like':'%'+_0x3370c3[_0xb8b4('0x46')][_0xb8b4('0x52')]+'%'};return _0x51863e;})});}_0x39e1a7=_['merge']({},_0x39e1a7,_0x3370c3[_0xb8b4('0x54')]);return db[_0xb8b4('0x6a')]['count']({'where':_0x39e1a7[_0xb8b4('0x50')]})[_0xb8b4('0x38')](function(_0x1f43d4){_0x6d8c92[_0xb8b4('0x31')]=_0x1f43d4;if(_0x3370c3['query'][_0xb8b4('0x55')]){_0x39e1a7['include']=[{'all':!![]}];}return db['Disposition']['findAll'](_0x39e1a7);})[_0xb8b4('0x38')](function(_0x489cd7){_0x6d8c92[_0xb8b4('0x57')]=_0x489cd7;return _0x6d8c92;});}})[_0xb8b4('0x38')](respondWithFilteredResult(_0x34273d,_0x39e1a7))[_0xb8b4('0x58')](handleError(_0x34273d,null));};exports['removeDispositions']=function(_0x5ee0f1,_0x23389d,_0x95c0ca){return db[_0xb8b4('0x42')][_0xb8b4('0x5d')]({'where':{'id':_0x5ee0f1['params']['id']}})[_0xb8b4('0x38')](handleEntityNotFound(_0x23389d,null))[_0xb8b4('0x38')](function(_0x15bba2){if(_0x15bba2){return _0x15bba2[_0xb8b4('0x6e')](_0x5ee0f1['query']['ids']);}})[_0xb8b4('0x38')](respondWithStatusCode(_0x23389d,null))[_0xb8b4('0x58')](handleError(_0x23389d,null));};exports['addAnswer']=function(_0x1c4aea,_0x5f013f,_0xd549c5){if(_0x1c4aea[_0xb8b4('0x65')]['id']){delete _0x1c4aea['body']['id'];}return db[_0xb8b4('0x42')][_0xb8b4('0x5d')]({'where':{'id':_0x1c4aea[_0xb8b4('0x66')]['id']}})[_0xb8b4('0x38')](handleEntityNotFound(_0x5f013f,null))[_0xb8b4('0x38')](function(_0x4f7ce6){if(_0x4f7ce6){_0x1c4aea[_0xb8b4('0x65')][_0xb8b4('0x69')]=_0x4f7ce6['id'];return db['CannedAnswer'][_0xb8b4('0x63')](_0x1c4aea[_0xb8b4('0x65')]);}})[_0xb8b4('0x38')](respondWithResult(_0x5f013f,null))['catch'](handleError(_0x5f013f,null));};exports[_0xb8b4('0x6f')]=function(_0x101829,_0x34f0c0,_0xe88422){var _0x5b05d4={'raw':![],'where':{}};var _0x54e544={};var _0x2a2464={'count':0x0,'rows':[]};return db[_0xb8b4('0x42')][_0xb8b4('0x6c')]({'where':{'id':_0x101829[_0xb8b4('0x66')]['id']}})['then'](handleEntityNotFound(_0x34f0c0,null))[_0xb8b4('0x38')](function(_0x12ebdb){if(_0x12ebdb){_0x54e544[_0xb8b4('0x45')]=_[_0xb8b4('0x5b')](db['CannedAnswer'][_0xb8b4('0x43')]);_0x54e544[_0xb8b4('0x46')]=_[_0xb8b4('0x5b')](_0x101829[_0xb8b4('0x46')]);_0x54e544['filters']=_[_0xb8b4('0x48')](_0x54e544[_0xb8b4('0x45')],_0x54e544['query']);_0x5b05d4[_0xb8b4('0x4a')]=_[_0xb8b4('0x48')](_0x54e544[_0xb8b4('0x45')],qs[_0xb8b4('0x49')](_0x101829[_0xb8b4('0x46')][_0xb8b4('0x49')]));_0x5b05d4[_0xb8b4('0x4a')]=_0x5b05d4[_0xb8b4('0x4a')]['length']?_0x5b05d4[_0xb8b4('0x4a')]:_0x54e544[_0xb8b4('0x45')];if(!_0x101829['query']['hasOwnProperty'](_0xb8b4('0x4c'))){_0x5b05d4[_0xb8b4('0x4d')]=qs[_0xb8b4('0x4d')](_0x101829[_0xb8b4('0x46')]['limit']);_0x5b05d4['offset']=qs[_0xb8b4('0x32')](_0x101829[_0xb8b4('0x46')]['offset']);}_0x5b05d4['order']=qs['sort'](_0x101829[_0xb8b4('0x46')][_0xb8b4('0x4f')]);_0x5b05d4[_0xb8b4('0x50')]=qs[_0xb8b4('0x47')](_[_0xb8b4('0x51')](_0x101829[_0xb8b4('0x46')],_0x54e544[_0xb8b4('0x47')]));_0x5b05d4[_0xb8b4('0x50')][_0xb8b4('0x69')]=_0x12ebdb['id'];if(_0x101829['query'][_0xb8b4('0x52')]){_0x5b05d4[_0xb8b4('0x50')]=_['merge'](_0x5b05d4[_0xb8b4('0x50')],{'$or':_['map'](_0x5b05d4[_0xb8b4('0x4a')],function(_0x48ba19){var _0x4c06d6={};_0x4c06d6[_0x48ba19]={'$like':'%'+_0x101829[_0xb8b4('0x46')][_0xb8b4('0x52')]+'%'};return _0x4c06d6;})});}_0x5b05d4=_[_0xb8b4('0x6d')]({},_0x5b05d4,_0x101829[_0xb8b4('0x54')]);return db[_0xb8b4('0x70')][_0xb8b4('0x31')]({'where':_0x5b05d4[_0xb8b4('0x50')]})[_0xb8b4('0x38')](function(_0x2149ef){_0x2a2464[_0xb8b4('0x31')]=_0x2149ef;if(_0x101829['query'][_0xb8b4('0x55')]){_0x5b05d4['include']=[{'all':!![]}];}return db[_0xb8b4('0x70')][_0xb8b4('0x56')](_0x5b05d4);})[_0xb8b4('0x38')](function(_0x2da93b){_0x2a2464[_0xb8b4('0x57')]=_0x2da93b;return _0x2a2464;});}})[_0xb8b4('0x38')](respondWithFilteredResult(_0x34f0c0,_0x5b05d4))[_0xb8b4('0x58')](handleError(_0x34f0c0,null));};exports['removeAnswers']=function(_0x59c078,_0x5905c9,_0x48f65d){return db[_0xb8b4('0x42')][_0xb8b4('0x5d')]({'where':{'id':_0x59c078[_0xb8b4('0x66')]['id']}})[_0xb8b4('0x38')](handleEntityNotFound(_0x5905c9,null))['then'](function(_0x3d0275){if(_0x3d0275){return _0x3d0275[_0xb8b4('0x71')](_0x59c078['query'][_0xb8b4('0x72')]);}})['then'](respondWithStatusCode(_0x5905c9,null))['catch'](handleError(_0x5905c9,null));};exports[_0xb8b4('0x73')]=function(_0x474d24,_0x3f0fee,_0x3c8157){_0x474d24[_0xb8b4('0x65')][_0xb8b4('0x74')]=_0x474d24[_0xb8b4('0x75')][_0xb8b4('0x76')];return db['ChatWebsite'][_0xb8b4('0x5d')]({'where':{'id':_0x474d24[_0xb8b4('0x66')]['id']}})[_0xb8b4('0x38')](handleEntityNotFound(_0x3f0fee,null))[_0xb8b4('0x38')](saveUpdates(_0x474d24[_0xb8b4('0x65')],null))[_0xb8b4('0x38')](respondWithResult(_0x3f0fee,null))['catch'](handleError(_0x3f0fee,null));};exports['addAvatar']=function(_0x5b05e6,_0x73aa41,_0x430024){_0x5b05e6['body'][_0xb8b4('0x77')]=_0x5b05e6[_0xb8b4('0x75')][_0xb8b4('0x76')];return db[_0xb8b4('0x42')][_0xb8b4('0x5d')]({'where':{'id':_0x5b05e6[_0xb8b4('0x66')]['id']}})[_0xb8b4('0x38')](handleEntityNotFound(_0x73aa41,null))[_0xb8b4('0x38')](saveUpdates(_0x5b05e6[_0xb8b4('0x65')],null))[_0xb8b4('0x38')](respondWithResult(_0x73aa41,null))[_0xb8b4('0x58')](handleError(_0x73aa41,null));};exports[_0xb8b4('0x78')]=function(_0x335b94,_0x2e1c8f,_0x209310){_0x335b94[_0xb8b4('0x65')]['customerAvatar']=_0x335b94[_0xb8b4('0x75')][_0xb8b4('0x76')];return db[_0xb8b4('0x42')]['find']({'where':{'id':_0x335b94[_0xb8b4('0x66')]['id']}})[_0xb8b4('0x38')](handleEntityNotFound(_0x2e1c8f,null))[_0xb8b4('0x38')](saveUpdates(_0x335b94[_0xb8b4('0x65')],null))[_0xb8b4('0x38')](respondWithResult(_0x2e1c8f,null))[_0xb8b4('0x58')](handleError(_0x2e1c8f,null));};exports[_0xb8b4('0x79')]=function(_0x3364fe,_0x4ab8b6,_0x3203ce){_0x3364fe[_0xb8b4('0x65')]['systemAvatar']=_0x3364fe[_0xb8b4('0x75')][_0xb8b4('0x76')];return db[_0xb8b4('0x42')][_0xb8b4('0x5d')]({'where':{'id':_0x3364fe[_0xb8b4('0x66')]['id']}})[_0xb8b4('0x38')](handleEntityNotFound(_0x4ab8b6,null))[_0xb8b4('0x38')](saveUpdates(_0x3364fe[_0xb8b4('0x65')],null))[_0xb8b4('0x38')](respondWithResult(_0x4ab8b6,null))[_0xb8b4('0x58')](handleError(_0x4ab8b6,null));};exports[_0xb8b4('0x7a')]=function(_0x55dfe5,_0xd8ae92,_0x36969f){var _0x9c658c=path[_0xb8b4('0x7b')](config['root'],'server/files/images/logos/default_logo.png');var _0x511c7b={'where':{'id':_0x55dfe5[_0xb8b4('0x66')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x43ec64=![];return require('../../config/license/util')[_0xb8b4('0x7c')]()[_0xb8b4('0x38')](function(_0x423858){if(_0x423858){_0x43ec64=_0x423858['custom'];}})[_0xb8b4('0x38')](function(){return db[_0xb8b4('0x42')]['find'](_0x511c7b);})['then'](handleEntityNotFound(_0xd8ae92,null))['then'](function(_0x208115){if(_0x208115){if(!_[_0xb8b4('0x7d')](_0x208115[_0xb8b4('0x74')])){if(fs[_0xb8b4('0x7e')](path['join'](config[_0xb8b4('0x7f')],'server/files/images/logos/',_0x208115[_0xb8b4('0x74')]))&&_0x43ec64){_0x9c658c=path[_0xb8b4('0x7b')](config[_0xb8b4('0x7f')],_0xb8b4('0x80'),_0x208115['sitepic']);}}return _0xd8ae92[_0xb8b4('0x81')](_0x9c658c);}})['catch'](handleError(_0xd8ae92,null));};exports[_0xb8b4('0x82')]=function(_0x2a0ef3,_0x217a42,_0x282675){var _0x45b1ce=path[_0xb8b4('0x7b')](config[_0xb8b4('0x7f')],_0xb8b4('0x83'));var _0x24590a={'where':{'id':_0x2a0ef3['params']['id']},'attributes':['id',_0xb8b4('0x77')],'raw':!![]};return db[_0xb8b4('0x42')][_0xb8b4('0x5d')](_0x24590a)['then'](handleEntityNotFound(_0x217a42,null))[_0xb8b4('0x38')](function(_0x548a56){if(_0x548a56){if(!_[_0xb8b4('0x7d')](_0x548a56[_0xb8b4('0x77')])){if(fs[_0xb8b4('0x7e')](path[_0xb8b4('0x7b')](config[_0xb8b4('0x7f')],_0xb8b4('0x84'),_0x548a56[_0xb8b4('0x77')]))){_0x45b1ce=path[_0xb8b4('0x7b')](config['root'],_0xb8b4('0x84'),_0x548a56['agentAvatar']);}}return _0x217a42[_0xb8b4('0x81')](_0x45b1ce);}})[_0xb8b4('0x58')](handleError(_0x217a42,null));};exports[_0xb8b4('0x85')]=function(_0xf403a8,_0x41aaaa,_0x2fa8a7){var _0x1bdc3b=path[_0xb8b4('0x7b')](config[_0xb8b4('0x7f')],_0xb8b4('0x86'));var _0x210ba3={'where':{'id':_0xf403a8[_0xb8b4('0x66')]['id']},'attributes':['id',_0xb8b4('0x87'),'showCustomerAvatar'],'raw':!![]};return db[_0xb8b4('0x42')][_0xb8b4('0x5d')](_0x210ba3)[_0xb8b4('0x38')](handleEntityNotFound(_0x41aaaa,null))['then'](function(_0x152121){if(_0x152121){if(!_[_0xb8b4('0x7d')](_0x152121[_0xb8b4('0x87')])){if(fs[_0xb8b4('0x7e')](path[_0xb8b4('0x7b')](config[_0xb8b4('0x7f')],_0xb8b4('0x84'),_0x152121[_0xb8b4('0x87')]))&&_0x152121[_0xb8b4('0x88')]){_0x1bdc3b=path[_0xb8b4('0x7b')](config[_0xb8b4('0x7f')],_0xb8b4('0x84'),_0x152121[_0xb8b4('0x87')]);}}return _0x41aaaa[_0xb8b4('0x81')](_0x1bdc3b);}})[_0xb8b4('0x58')](handleError(_0x41aaaa,null));};exports[_0xb8b4('0x89')]=function(_0x56062e,_0x97aba,_0x3e3f5b){var _0x3ec752=path[_0xb8b4('0x7b')](config[_0xb8b4('0x7f')],_0xb8b4('0x8a'));var _0x2ee533={'where':{'id':_0x56062e[_0xb8b4('0x66')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db['ChatWebsite'][_0xb8b4('0x5d')](_0x2ee533)[_0xb8b4('0x38')](handleEntityNotFound(_0x97aba,null))[_0xb8b4('0x38')](function(_0x19b813){if(_0x19b813){if(!_[_0xb8b4('0x7d')](_0x19b813['systemAvatar'])){if(fs[_0xb8b4('0x7e')](path[_0xb8b4('0x7b')](config[_0xb8b4('0x7f')],_0xb8b4('0x84'),_0x19b813[_0xb8b4('0x8b')]))){_0x3ec752=path[_0xb8b4('0x7b')](config[_0xb8b4('0x7f')],_0xb8b4('0x84'),_0x19b813['systemAvatar']);}}return _0x97aba[_0xb8b4('0x81')](_0x3ec752);}})[_0xb8b4('0x58')](handleError(_0x97aba,null));};exports[_0xb8b4('0x8c')]=function(_0x248165,_0x315ff7,_0x304e80){var _0x11b318=require(_0xb8b4('0x8d'));var _0x2e9def=new _0x11b318();var _0x29c7e5=_0x2e9def[_0xb8b4('0x8e')](_0x248165[_0xb8b4('0x8f')][_0xb8b4('0x90')])[_0xb8b4('0x91')]();var _0x5389dd={'body':_0x248165[_0xb8b4('0x65')],'channel':_0xb8b4('0x92')};var _0x37bad9=[];var _0x2adab9=[];var _0x37079e={};var _0x4941b9=![];return db[_0xb8b4('0x93')]['describe']()['then'](function(_0xcc9c13){if(!_0xcc9c13){throw new db['Sequelize'][(_0xb8b4('0x22'))](_0xb8b4('0x94'));}_0x37bad9=_[_0xb8b4('0x95')](_[_0xb8b4('0x5b')](_0xcc9c13),[_0xb8b4('0x96'),_0xb8b4('0x97')]);_0x2adab9=_[_0xb8b4('0x95')](_[_0xb8b4('0x5b')](_0xcc9c13),[_0xb8b4('0x96'),_0xb8b4('0x97'),_0xb8b4('0x98'),_0xb8b4('0x99')]);if(_0x248165[_0xb8b4('0x65')]['id']){delete _0x248165['body']['id'];}if(_[_0xb8b4('0x7d')](_0x248165['body'][_0xb8b4('0x9a')])){throw new db[(_0xb8b4('0x21'))][(_0xb8b4('0x22'))](_0xb8b4('0x9b'));}if(_[_0xb8b4('0x7d')](_0x248165['body'][_0xb8b4('0x65')])||_0x248165[_0xb8b4('0x65')]['body']===''){throw new db[(_0xb8b4('0x21'))][(_0xb8b4('0x22'))](_0xb8b4('0x9c'));}if(_[_0xb8b4('0x7d')](_0x248165[_0xb8b4('0x65')]['mapKey'])){throw new db[(_0xb8b4('0x21'))][(_0xb8b4('0x22'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2adab9);}if(!_[_0xb8b4('0x9d')](_0x2adab9,_0x248165['body'][_0xb8b4('0x9e')])){throw new db[(_0xb8b4('0x21'))]['ValidationError'](_0xb8b4('0x9f')+_0x2adab9);}_0x37079e[_0x248165[_0xb8b4('0x65')][_0xb8b4('0x9e')]]=_0x248165[_0xb8b4('0x65')][_0xb8b4('0x9a')];})[_0xb8b4('0x38')](function(){return db['ChatWebsite'][_0xb8b4('0x5d')]({'where':{'id':_0x248165['params']['id']},'include':[{'model':db[_0xb8b4('0xa0')],'as':_0xb8b4('0xa1'),'include':[{'model':db[_0xb8b4('0x93')],'as':_0xb8b4('0xa2'),'where':_0x37079e,'limit':0x1,'order':[[_0xb8b4('0x97'),'DESC']]}]},{'model':db[_0xb8b4('0xa3')],'as':_0xb8b4('0xa4')}]});})[_0xb8b4('0x38')](handleEntityNotFound(_0x315ff7,null))[_0xb8b4('0x38')](function(_0x397791){if(_0x397791&&_0x397791[_0xb8b4('0xa1')]){_0x5389dd[_0xb8b4('0xa5')]=_0x397791;_0x5389dd[_0xb8b4('0xa6')]=_0x397791['Applications'];_0x5389dd[_0xb8b4('0xa7')]=_0x397791[_0xb8b4('0xa1')];_0x5389dd[_0xb8b4('0xa6')]=_[_0xb8b4('0xa8')](_0x5389dd[_0xb8b4('0xa6')],['priority'],[_0xb8b4('0xa9')]);if(_0x5389dd['account'][_0xb8b4('0xa4')]){delete _0x5389dd[_0xb8b4('0xa5')][_0xb8b4('0xa4')];}if(_0x5389dd['account'][_0xb8b4('0xa1')]&&_0x5389dd[_0xb8b4('0xa5')]['List'][_0xb8b4('0xa2')][_0xb8b4('0x5c')]){return _0x5389dd['account']['List'][_0xb8b4('0xa2')][0x0];}var _0x58140c=_[_0xb8b4('0x19')](_0x248165[_0xb8b4('0x65')],{'firstName':_0x248165[_0xb8b4('0x65')][_0xb8b4('0x9a')],'ListId':_0x397791[_0xb8b4('0x99')]});_0x58140c[_0x248165['body'][_0xb8b4('0x9e')]]=_0x248165['body'][_0xb8b4('0x9a')];return db[_0xb8b4('0x93')][_0xb8b4('0x63')](_0x58140c,{'fields':_0x37bad9,'raw':!![]});}})[_0xb8b4('0x38')](handleEntityNotFound(_0x315ff7,null))['then'](function(_0x1b3bc9){_0x5389dd[_0xb8b4('0xaa')]=_0x1b3bc9;var _0x5c8346=_0x248165[_0xb8b4('0x65')][_0xb8b4('0xab')];if(_0x248165[_0xb8b4('0x8f')][_0xb8b4('0xac')]){_0x5c8346=_0x248165[_0xb8b4('0x8f')][_0xb8b4('0xac')];}else if(_0x248165[_0xb8b4('0x8f')][_0xb8b4('0xad')]){_0x5c8346=_[_0xb8b4('0xae')](_0x248165[_0xb8b4('0x8f')][_0xb8b4('0xad')][_0xb8b4('0xaf')](','));}if(_0x1b3bc9){var _0x71dc3c={'ContactId':_0x1b3bc9['id'],'ChatWebsiteId':_0x248165['params']['id'],'from':(_0x1b3bc9['firstName']||'')+'\x20'+(_0x1b3bc9['lastName']||''),'customerIp':_0x5c8346,'customerPort':_0x248165['headers'][_0xb8b4('0xb0')]?_0x248165[_0xb8b4('0x8f')][_0xb8b4('0xb0')]:null,'referer':_0x248165[_0xb8b4('0x65')]['referer'],'browserName':_0x29c7e5[_0xb8b4('0xb1')][_0xb8b4('0x3d')]&&_0x29c7e5[_0xb8b4('0xb1')][_0xb8b4('0xb2')]?util[_0xb8b4('0xb3')](_0xb8b4('0xb4'),_0x29c7e5[_0xb8b4('0xb1')]['name'],_0x29c7e5[_0xb8b4('0xb1')][_0xb8b4('0xb2')]):'unknown','browserVersion':_0x29c7e5[_0xb8b4('0xb1')][_0xb8b4('0xb2')]||_0xb8b4('0xb5'),'osName':util[_0xb8b4('0xb3')](_0xb8b4('0xb4'),_0x29c7e5['os']['name'],_0x29c7e5['os'][_0xb8b4('0xb2')]),'osVersion':_0x29c7e5['os'][_0xb8b4('0xb2')],'deviceModel':_0x29c7e5['device'][_0xb8b4('0x45')]&&_0x29c7e5[_0xb8b4('0xb6')][_0xb8b4('0xb7')]?util['format']('%s\x20%s\x20%s',_0x29c7e5['device'][_0xb8b4('0x45')],_0x29c7e5[_0xb8b4('0xb6')][_0xb8b4('0xb7')],_0x29c7e5['device']['type']):null,'deviceVendor':_0x29c7e5[_0xb8b4('0xb6')][_0xb8b4('0xb7')],'deviceType':_0x29c7e5[_0xb8b4('0xb6')]['type'],'formData':JSON[_0xb8b4('0xb8')](_0x248165[_0xb8b4('0x65')])};var _0x1f2a88={'ChatWebsiteId':_0x248165[_0xb8b4('0x66')]['id'],'closed':![]};if(_0x248165[_0xb8b4('0x65')]['threadId']){_0x1f2a88[_0xb8b4('0xb9')]=_0x248165[_0xb8b4('0x65')][_0xb8b4('0xb9')];return db[_0xb8b4('0xba')][_0xb8b4('0x5d')]({'where':_0x1f2a88})[_0xb8b4('0x38')](function(_0x5a6058){if(_0x5a6058){return[_0x5a6058,![]];}_0x71dc3c[_0xb8b4('0xb9')]=_0x248165['body'][_0xb8b4('0xb9')];_0x71dc3c[_0xb8b4('0xbb')]=_0x248165[_0xb8b4('0x65')]['externalUrl'];return db[_0xb8b4('0xba')][_0xb8b4('0x63')](_0x71dc3c)[_0xb8b4('0x38')](function(_0x2943e0){return[_0x2943e0,!![]];});});}_0x1f2a88['ContactId']=_0x1b3bc9['id'];if(_0x248165[_0xb8b4('0x65')][_0xb8b4('0xbc')]&&_0x248165[_0xb8b4('0x65')][_0xb8b4('0xbc')]['id']){_0x1f2a88['id']=_0x248165[_0xb8b4('0x65')][_0xb8b4('0xbc')]['id'];return db[_0xb8b4('0xba')]['find']({'where':_0x1f2a88})[_0xb8b4('0x38')](function(_0x148e99){if(_0x148e99){return[_0x148e99,![]];}return db[_0xb8b4('0xba')][_0xb8b4('0x63')](_0x71dc3c)[_0xb8b4('0x38')](function(_0x2b6ca2){return[_0x2b6ca2,!![]];});});}return db[_0xb8b4('0xba')][_0xb8b4('0x63')](_0x71dc3c)[_0xb8b4('0x38')](function(_0x47a767){return[_0x47a767,!![]];});}})['spread'](function(_0x4edd7b,_0x32f876){if(_0x4edd7b){_0x4941b9=_0x32f876;if(!_0x32f876){var _0x10325c={'from':(_0x5389dd[_0xb8b4('0xaa')][_0xb8b4('0xbd')]||'')+'\x20'+(_0x5389dd[_0xb8b4('0xaa')][_0xb8b4('0xbe')]||'')};if(_0x248165[_0xb8b4('0x65')][_0xb8b4('0xb9')]&&_0x248165[_0xb8b4('0x65')][_0xb8b4('0xbf')]&&_0x248165[_0xb8b4('0x65')][_0xb8b4('0xb9')]!=_0x248165['body'][_0xb8b4('0xbf')]){_0x10325c[_0xb8b4('0xb9')]=_0x248165[_0xb8b4('0x65')][_0xb8b4('0xbf')];}return _0x4edd7b[_0xb8b4('0x37')](_0x10325c);}else{return _0x4edd7b;}}})['then'](function(_0xbc1727){_0x5389dd[_0xb8b4('0xbc')]=_0xbc1727[_0xb8b4('0x3a')]({'plain':!![]});_0x5389dd[_0xb8b4('0xbc')][_0xb8b4('0xc0')]=_0x4941b9;if(_0x5389dd[_0xb8b4('0xbc')][_0xb8b4('0xc0')]){if(_0x5389dd[_0xb8b4('0xa5')]['autoclose']){_0x5389dd[_0xb8b4('0xa6')][_0xb8b4('0xc1')]({'id':0x0,'priority':_0x5389dd[_0xb8b4('0xa6')]['length']+0x1,'app':'close','appdata':'unmanaged','interval':'*,*,*,*'});}}return db[_0xb8b4('0xc2')]['create']({'body':_0x248165['body']['body'],'ChatWebsiteId':_0x248165[_0xb8b4('0x66')]['id'],'ChatInteractionId':_0xbc1727['id'],'direction':'in','ContactId':_0x5389dd[_0xb8b4('0xaa')]['id'],'AttachmentId':_0x248165['body'][_0xb8b4('0xc3')]});})['then'](function(_0x4b3de6){_0x5389dd['message']=_0x4b3de6;if(_0x5389dd[_0xb8b4('0xbc')][_0xb8b4('0xc4')]){return db['User']['find']({'attributes':['id','name'],'where':{'id':_0x5389dd[_0xb8b4('0xbc')][_0xb8b4('0xc4')]}})[_0xb8b4('0x38')](function(_0x22eb73){if(_0x22eb73){_0x5389dd[_0xb8b4('0xa6')][_0xb8b4('0xc5')]({'id':0x0,'priority':0x0,'app':_0xb8b4('0xc6'),'appdata':_0x22eb73[_0xb8b4('0x3d')]+','+(_0x5389dd['account'][_0xb8b4('0xc7')]||0xa),'interval':_0xb8b4('0xc8')});_0x5389dd['forcedOwnership']=!![];}return respondWithRpcPromise(_0xb8b4('0xc9'),_0xb8b4('0xca'),_0x5389dd);});}return respondWithRpcPromise(_0xb8b4('0xc9'),'startRouting',_0x5389dd);})[_0xb8b4('0x38')](function(_0x396b83){respondWithRpcPromise(_0xb8b4('0xcb'),'EventManager',{'event':_0xb8b4('0x8c'),'message':_0x396b83},client9002);return _0x396b83;})['then'](respondWithResult(_0x315ff7,null))[_0xb8b4('0x58')](handleError(_0x315ff7,null));};exports[_0xb8b4('0xcc')]=function(_0x5e809c,_0x57ec29,_0x59e3e7){var _0x2709be,_0x38d14f,_0x1f8227;var _0x40d5a1=[];var _0x379546=[];var _0x32c846={};return db[_0xb8b4('0x93')][_0xb8b4('0x67')]()[_0xb8b4('0x38')](function(_0x3d6f8e){if(!_0x3d6f8e){throw new db[(_0xb8b4('0x21'))][(_0xb8b4('0x22'))]('no\x20available\x20attributes');}_0x379546=_[_0xb8b4('0x95')](_[_0xb8b4('0x5b')](_0x3d6f8e),[_0xb8b4('0x96'),_0xb8b4('0x97')]);_0x40d5a1=_[_0xb8b4('0x95')](_['keys'](_0x3d6f8e),[_0xb8b4('0x96'),'updatedAt',_0xb8b4('0x98'),'ListId']);if(_0x5e809c[_0xb8b4('0x65')]['id']){delete _0x5e809c[_0xb8b4('0x65')]['id'];}if(_[_0xb8b4('0x7d')](_0x5e809c['body'][_0xb8b4('0x9a')])){throw _0x57ec29['status'](0x1f4)[_0xb8b4('0x3e')](new db[(_0xb8b4('0x21'))][(_0xb8b4('0x22'))]('from\x20is\x20mandatory'));}if(_['isNil'](_0x5e809c[_0xb8b4('0x65')][_0xb8b4('0x65')])||_0x5e809c[_0xb8b4('0x65')]['body']===''){throw _0x57ec29[_0xb8b4('0x2f')](0x1f4)[_0xb8b4('0x3e')](new db[(_0xb8b4('0x21'))][(_0xb8b4('0x22'))](_0xb8b4('0x9c')));}if(_[_0xb8b4('0x7d')](_0x5e809c[_0xb8b4('0x65')][_0xb8b4('0xcd')])){throw _0x57ec29[_0xb8b4('0x2f')](0x1f4)['send'](new db['Sequelize'][(_0xb8b4('0x22'))](_0xb8b4('0xce')+_0x40d5a1));}if(!_[_0xb8b4('0x9d')](_0x40d5a1,_0x5e809c[_0xb8b4('0x65')][_0xb8b4('0xcd')])){throw _0x57ec29['status'](0x1f4)[_0xb8b4('0x3e')](new db[(_0xb8b4('0x21'))][(_0xb8b4('0x22'))](_0xb8b4('0xcf')+_0x40d5a1));}_0x32c846[_0x5e809c[_0xb8b4('0x65')][_0xb8b4('0xcd')]]=_0x5e809c[_0xb8b4('0x65')][_0xb8b4('0x9a')];})[_0xb8b4('0x38')](function(){return db[_0xb8b4('0x42')][_0xb8b4('0x5d')]({'where':{'id':_0x5e809c[_0xb8b4('0x66')]['id']},'include':[{'model':db[_0xb8b4('0xa0')],'as':_0xb8b4('0xa1')}]});})[_0xb8b4('0x38')](handleEntityNotFound(_0x57ec29,null))['then'](function(_0x2bcb73){if(_0x2bcb73&&_0x2bcb73[_0xb8b4('0xa1')]){_0x38d14f=_0x2bcb73;var _0x988bba=_[_0xb8b4('0x19')](_0x5e809c[_0xb8b4('0x65')],{'firstName':_0x5e809c[_0xb8b4('0x65')][_0xb8b4('0x9a')],'phone':_0x5e809c[_0xb8b4('0x65')][_0xb8b4('0x9a')],'ListId':_0x2bcb73[_0xb8b4('0x99')]});_0x988bba[_0x5e809c[_0xb8b4('0x65')][_0xb8b4('0xcd')]]=_0x5e809c['body'][_0xb8b4('0x9a')];return db[_0xb8b4('0x93')][_0xb8b4('0xd0')]({'where':_0x32c846,'defaults':_0x988bba});}})[_0xb8b4('0xd1')](function(_0x384fb7){if(_0x384fb7){_0x1f8227=_0x384fb7;var _0xd79120=fs[_0xb8b4('0xd2')](path[_0xb8b4('0x7b')](config['root'],'server/files/templates/chatOfflineMessage.ejs'),_0xb8b4('0xd3'));var _0x503abf=ejs[_0xb8b4('0xd4')](_0xd79120,{'body':_[_0xb8b4('0xd5')](_0x5e809c[_0xb8b4('0x65')][_0xb8b4('0x65')]),'bodyTitle':_0x38d14f[_0xb8b4('0xd6')]});return db['ChatOfflineMessage'][_0xb8b4('0x63')]({'body':_0x503abf,'ContactId':_0x384fb7['id'],'ChatWebsiteId':_0x38d14f['id']});}})['then'](function(_0x8e0f4){if(_0x8e0f4){_0x2709be=_0x8e0f4;return db[_0xb8b4('0xd7')][_0xb8b4('0x6c')]({'where':{'service':!![]},'include':[{'model':db[_0xb8b4('0xd8')],'as':_0xb8b4('0xd9'),'raw':!![]}]});}})[_0xb8b4('0x38')](function(_0x132544){if(_0x132544&&_0x132544[_0xb8b4('0xd9')]&&_0x38d14f[_0xb8b4('0xda')]){var _0x4ebce3={'tls':{'rejectUnauthorized':![]}};if(_0x132544[_0xb8b4('0xd9')][_0xb8b4('0xdb')]){_0x4ebce3[_0xb8b4('0xdb')]=_0x132544[_0xb8b4('0xd9')]['service'];}else{_0x4ebce3['host']=_0x132544[_0xb8b4('0xd9')][_0xb8b4('0xdc')];_0x4ebce3[_0xb8b4('0xdd')]=_0x132544['Smtp'][_0xb8b4('0xdd')];_0x4ebce3[_0xb8b4('0xde')]=_0x132544[_0xb8b4('0xd9')]['secure'];}if(_0x132544[_0xb8b4('0xd9')][_0xb8b4('0xdf')]){_0x4ebce3[_0xb8b4('0xe0')]={'user':_0x132544[_0xb8b4('0xd9')][_0xb8b4('0x5e')],'pass':_0x132544[_0xb8b4('0xd9')][_0xb8b4('0xe1')]};}return respondWithRpcPromise(_0xb8b4('0xe2'),_0xb8b4('0xe3'),{'account':_0x4ebce3,'message':{'from':util[_0xb8b4('0xb3')](_0xb8b4('0xe4'),_0x132544[_0xb8b4('0x3d')],_0x132544[_0xb8b4('0xe5')]||_0x132544[_0xb8b4('0xd9')][_0xb8b4('0x5e')]),'to':_0x38d14f['forwardOfflineAddress'],'subject':_0x38d14f[_0xb8b4('0xe6')],'text':_0x2709be[_0xb8b4('0x65')]}},client9003)[_0xb8b4('0x38')](function(){return _0x2709be;})[_0xb8b4('0x58')](function(_0x4e046c){console['error'](_0x4e046c);});}})[_0xb8b4('0x38')](function(){if(_0x2709be){return _0x2709be;}})[_0xb8b4('0x38')](respondWithResult(_0x57ec29,null))[_0xb8b4('0x58')](handleError(_0x57ec29,null));};exports['addInteraction']=function(_0x4d1240,_0xed2c1,_0x9f031e){return db['ChatInteraction'][_0xb8b4('0x5d')]({'where':{'id':_0x4d1240[_0xb8b4('0x66')]['id']}})['then'](handleEntityNotFound(_0xed2c1,null))[_0xb8b4('0x38')](function(_0x5218da){if(_0x5218da){return _0x5218da[_0xb8b4('0xe7')](_0x4d1240[_0xb8b4('0x65')][_0xb8b4('0x72')],_[_0xb8b4('0xe8')](_0x4d1240[_0xb8b4('0x65')],[_0xb8b4('0x72'),'id'])||{});}})[_0xb8b4('0x38')](respondWithResult(_0xed2c1,null))[_0xb8b4('0x58')](handleError(_0xed2c1,null));};exports['getInteractions']=function(_0x39abbf,_0x302037,_0x2ce34b){var _0xa0badb={'raw':![],'where':{}};var _0x397589={};var _0xad4c67={'count':0x0,'rows':[]};return db[_0xb8b4('0x42')][_0xb8b4('0x6c')]({'where':{'id':_0x39abbf['params']['id']}})[_0xb8b4('0x38')](handleEntityNotFound(_0x302037,null))['then'](function(_0x10133f){if(_0x10133f){_0x397589[_0xb8b4('0x45')]=_[_0xb8b4('0x5b')](db[_0xb8b4('0xba')][_0xb8b4('0x43')]);_0x397589[_0xb8b4('0x46')]=_['keys'](_0x39abbf[_0xb8b4('0x46')]);_0x397589['filters']=_[_0xb8b4('0x48')](_0x397589['model'],_0x397589[_0xb8b4('0x46')]);_0xa0badb[_0xb8b4('0x4a')]=_[_0xb8b4('0x48')](_0x397589['model'],qs[_0xb8b4('0x49')](_0x39abbf[_0xb8b4('0x46')][_0xb8b4('0x49')]));_0xa0badb[_0xb8b4('0x4a')]=_0xa0badb[_0xb8b4('0x4a')][_0xb8b4('0x5c')]?_0xa0badb[_0xb8b4('0x4a')]:_0x397589['model'];if(!_0x39abbf[_0xb8b4('0x46')][_0xb8b4('0x4b')]('nolimit')){_0xa0badb[_0xb8b4('0x4d')]=qs[_0xb8b4('0x4d')](_0x39abbf['query']['limit']);_0xa0badb[_0xb8b4('0x32')]=qs[_0xb8b4('0x32')](_0x39abbf[_0xb8b4('0x46')][_0xb8b4('0x32')]);}_0xa0badb[_0xb8b4('0x4e')]=qs[_0xb8b4('0x4f')](_0x39abbf['query'][_0xb8b4('0x4f')]);_0xa0badb[_0xb8b4('0x50')]=qs['filters'](_[_0xb8b4('0x51')](_0x39abbf[_0xb8b4('0x46')],_0x397589['filters']));_0xa0badb[_0xb8b4('0x50')][_0xb8b4('0x69')]=_0x10133f['id'];if(_0x39abbf[_0xb8b4('0x46')]['filter']){_0xa0badb[_0xb8b4('0x50')]=_[_0xb8b4('0x6d')](_0xa0badb[_0xb8b4('0x50')],{'$or':_[_0xb8b4('0x41')](_0xa0badb['attributes'],function(_0x139b57){var _0x3e30a3={};_0x3e30a3[_0x139b57]={'$like':'%'+_0x39abbf['query'][_0xb8b4('0x52')]+'%'};return _0x3e30a3;})});}_0xa0badb=_[_0xb8b4('0x6d')]({},_0xa0badb,_0x39abbf[_0xb8b4('0x54')]);return db['ChatInteraction']['count']({'where':_0xa0badb[_0xb8b4('0x50')]})[_0xb8b4('0x38')](function(_0x7814e8){_0xad4c67[_0xb8b4('0x31')]=_0x7814e8;if(_0x39abbf[_0xb8b4('0x46')][_0xb8b4('0x55')]){_0xa0badb['include']=[{'model':db[_0xb8b4('0x93')],'as':_0xb8b4('0xe9'),'required':![]},{'model':db[_0xb8b4('0xea')],'as':_0xb8b4('0xeb'),'attributes':[_0xb8b4('0x3d'),_0xb8b4('0xec'),_0xb8b4('0xed')],'required':![]},{'model':db['Tag'],'as':_0xb8b4('0xee'),'attributes':['id',_0xb8b4('0x3d'),'color'],'where':_0x39abbf['query']['tag']?{'id':_0x39abbf[_0xb8b4('0x46')][_0xb8b4('0xef')]}:undefined,'required':_0x39abbf[_0xb8b4('0x46')][_0xb8b4('0xef')]?!![]:![]}];}return db[_0xb8b4('0xba')][_0xb8b4('0x56')](_0xa0badb);})[_0xb8b4('0x38')](function(_0x40703f){_0xad4c67[_0xb8b4('0x57')]=_0x40703f;return _0xad4c67;});}})[_0xb8b4('0x38')](respondWithFilteredResult(_0x302037,_0xa0badb))[_0xb8b4('0x58')](handleError(_0x302037,null));};function iftimePromise(_0x499ceb,_0x5bb78f){return respondWithRpcPromise(_0xb8b4('0xf0'),_0xb8b4('0xf1'),{'command':_0x5bb78f[_0xb8b4('0xf2')]?util['format']('iftime\x20%s,%s',_0x499ceb['interval'],_0x5bb78f['timezone']):util[_0xb8b4('0xb3')](_0xb8b4('0xf3'),_0x499ceb['interval'])},client9002)[_0xb8b4('0x38')](function(_0x4bca94){var _0xa9cd10=_0x4bca94&&_0x4bca94[_0xb8b4('0xf4')](_0xb8b4('0xf5'))>=0x0?!![]:![];logger['info'](_0xb8b4('0xf6'),_0x5bb78f['id'],_0x499ceb['id'],_0x499ceb[_0xb8b4('0xf7')],_0xa9cd10?'ONLINE':'OFFLINE',_0x5bb78f[_0xb8b4('0xf2')]?_0x5bb78f[_0xb8b4('0xf2')]:_0xb8b4('0xf8'));return _0xa9cd10;})[_0xb8b4('0x58')](function(_0x26ce7a){logger['error'](_0xb8b4('0xf6'),_0x5bb78f['id'],_0x499ceb['id'],_0x499ceb[_0xb8b4('0xf7')],util[_0xb8b4('0xf9')](_0x26ce7a,{'showHidden':![],'depth':null}),_0x5bb78f['timezone']?_0x5bb78f['timezone']:_0xb8b4('0xf8'));return![];});}exports['getSnippet']=function(_0x53af50,_0x3e9e74,_0x277cd5){var _0x4b5cc7=0x0;var _0x1542ad=0x0;var _0xe1a3d6=![];var _0x1f7550;var _0x24409f;return db[_0xb8b4('0x42')][_0xb8b4('0x5d')]({'where':{'id':_0x53af50[_0xb8b4('0x66')]['id']},'include':[{'model':db['Interval'],'as':_0xb8b4('0xfa'),'include':[{'model':db[_0xb8b4('0xfa')],'as':_0xb8b4('0xfb'),'attributes':['id',_0xb8b4('0xf7')],'raw':!![]}]}]})[_0xb8b4('0x38')](handleEntityNotFound(_0x3e9e74,null))[_0xb8b4('0x38')](function(_0x36c04c){if(_0x36c04c){_0x1f7550=_0x36c04c;return _0x36c04c[_0xb8b4('0xfc')]({'raw':!![]});}})['then'](function(_0x901196){if(_0x1f7550){if(_0x901196){_0x24409f=_0x901196;}}return require(_0xb8b4('0xfd'))[_0xb8b4('0x7c')]();})[_0xb8b4('0x38')](function(_0x598352){if(_0x598352){_0x1542ad=_0x598352[_0xb8b4('0xfe')];_0xe1a3d6=_0x598352['custom'];}})['then'](function(){return db[_0xb8b4('0xba')][_0xb8b4('0x31')]({'where':{'closed':![]}});})[_0xb8b4('0x38')](function(_0x2e4202){_0x4b5cc7=_0x2e4202;if(_0x1542ad&&_0x2e4202>_0x1542ad){return db[_0xb8b4('0xff')][_0xb8b4('0x6c')]({'where':{'id':0x1}})[_0xb8b4('0x38')](function(_0x35dd89){if(_0x35dd89){_0x35dd89[_0xb8b4('0x100')](_0xb8b4('0x101'));}});}})[_0xb8b4('0x38')](function(){if(_0x1f7550[_0xb8b4('0xfa')]&&_0x1f7550['Interval'][_0xb8b4('0xfb')]){var _0x1182c1=[];for(var _0x2c54bb=0x0;_0x2c54bb<_0x1f7550['Interval'][_0xb8b4('0xfb')][_0xb8b4('0x5c')];_0x2c54bb++){var _0x1607f6=_0x1f7550['Interval'][_0xb8b4('0xfb')][_0x2c54bb][_0xb8b4('0x3a')]({'plain':!![]});_0x1182c1[_0xb8b4('0xc1')](iftimePromise(_0x1607f6,_0x1f7550));}return BPromise['all'](_0x1182c1)[_0xb8b4('0x38')](function(_0x396e02){return _[_0xb8b4('0x102')](_0x396e02);});}else{return!![];}})['then'](function(_0x169185){var _0x1dbc08=fs[_0xb8b4('0xd2')](path[_0xb8b4('0x7b')](config[_0xb8b4('0x7f')],_0xb8b4('0x103')),'utf8');var _0x339599={'remote':_0x1f7550[_0xb8b4('0x104')],'query':querystring[_0xb8b4('0xb8')](_['merge'](_0x1f7550[_0xb8b4('0x3a')]({'plain':!![]}),{'customerIp':_0x53af50[_0xb8b4('0x8f')][_0xb8b4('0xad')]||_0x53af50['headers']['x-real-ip']||_0x53af50['connection'][_0xb8b4('0x105')]||_0x53af50['ip'],'referer':_0x53af50[_0xb8b4('0x8f')][_0xb8b4('0x106')],'openedInteractions':_0x4b5cc7,'maxInteractions':_0x1542ad,'virtual':_0xe1a3d6['virtual'],'online':_0x169185,'custom':_0xe1a3d6}))['replace'](/'/g,'\x5c\x27')};_0x3e9e74[_0xb8b4('0x3e')](ejs['render'](Mustache[_0xb8b4('0xd4')](_0x1dbc08,_0x339599),{'proactiveActions':_0x24409f,'alignment':_0x1f7550[_0xb8b4('0x107')],'verticalAlignment':_0x1f7550[_0xb8b4('0x108')],'div_color':_0x1f7550[_0xb8b4('0x109')],'text_color':_0x1f7550[_0xb8b4('0x10a')]}));})[_0xb8b4('0x58')](handleError(_0x3e9e74,null));};exports['addApplications']=function(_0x15d420,_0x4dca1e,_0x44225c){return db[_0xb8b4('0x42')]['findOne']({'where':{'id':_0x15d420[_0xb8b4('0x66')]['id']}})[_0xb8b4('0x38')](handleEntityNotFound(_0x4dca1e,null))[_0xb8b4('0x38')](function(_0x1ffc19){if(_0x1ffc19){return db[_0xb8b4('0x10b')]['transaction'](function(_0x46d26f){return db[_0xb8b4('0xa3')][_0xb8b4('0x39')]({'where':{'ChatWebsiteId':_0x15d420['params']['id']},'transaction':_0x46d26f})['then'](function(_0xce2089){var _0x482704=_[_0xb8b4('0x41')](_0x15d420['body'],function(_0x8a8401){_0x8a8401[_0xb8b4('0x69')]=_0x15d420[_0xb8b4('0x66')]['id'];return _0x8a8401;});return db['ChatApplication'][_0xb8b4('0x10c')](_0x482704,{'transaction':_0x46d26f});});})[_0xb8b4('0x38')](function(){return db[_0xb8b4('0xa3')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x15d420['params']['id']},'order':'priority'});});}})['then'](respondWithResult(_0x4dca1e,null))[_0xb8b4('0x58')](handleError(_0x4dca1e,null));};exports['getApplications']=function(_0x22bb97,_0x455b32,_0x122349){var _0x515498={};var _0x3a5402={};var _0x11e027;var _0x5c3062;return db[_0xb8b4('0x42')][_0xb8b4('0x6c')]({'where':{'id':_0x22bb97[_0xb8b4('0x66')]['id']}})['then'](handleEntityNotFound(_0x455b32,null))['then'](function(_0x65ebb3){if(_0x65ebb3){_0x11e027=_0x65ebb3;_0x3a5402[_0xb8b4('0x45')]=_[_0xb8b4('0x5b')](db['ChatApplication']['rawAttributes']);_0x3a5402[_0xb8b4('0x46')]=_['keys'](_0x22bb97[_0xb8b4('0x46')]);_0x3a5402[_0xb8b4('0x47')]=_[_0xb8b4('0x48')](_0x3a5402[_0xb8b4('0x45')],_0x3a5402[_0xb8b4('0x46')]);_0x515498[_0xb8b4('0x4a')]=_[_0xb8b4('0x48')](_0x3a5402[_0xb8b4('0x45')],qs[_0xb8b4('0x49')](_0x22bb97['query'][_0xb8b4('0x49')]));_0x515498[_0xb8b4('0x4a')]=_0x515498['attributes'][_0xb8b4('0x5c')]?_0x515498[_0xb8b4('0x4a')]:_0x3a5402[_0xb8b4('0x45')];_0x515498[_0xb8b4('0x4e')]=qs['sort'](_0x22bb97[_0xb8b4('0x46')][_0xb8b4('0x4f')]);_0x515498[_0xb8b4('0x50')]=qs[_0xb8b4('0x47')](_['pick'](_0x22bb97[_0xb8b4('0x46')],_0x3a5402[_0xb8b4('0x47')]));if(_0x22bb97[_0xb8b4('0x46')][_0xb8b4('0x52')]){_0x515498['where']=_[_0xb8b4('0x6d')](_0x515498[_0xb8b4('0x50')],{'$or':_['map'](_0x515498[_0xb8b4('0x4a')],function(_0x18091f){var _0x3fb19b={};_0x3fb19b[_0x18091f]={'$like':'%'+_0x22bb97[_0xb8b4('0x46')][_0xb8b4('0x52')]+'%'};return _0x3fb19b;})});}_0x515498=_['merge']({},_0x515498,_0x22bb97['options']);return _0x11e027['getApplications'](_0x515498);}})[_0xb8b4('0x38')](function(_0x4fc0f7){if(_0x4fc0f7){_0x5c3062=_0x4fc0f7['length'];if(!_0x22bb97[_0xb8b4('0x46')][_0xb8b4('0x4b')]('nolimit')){_0x515498['limit']=qs[_0xb8b4('0x4d')](_0x22bb97[_0xb8b4('0x46')][_0xb8b4('0x4d')]);_0x515498['offset']=qs[_0xb8b4('0x32')](_0x22bb97[_0xb8b4('0x46')][_0xb8b4('0x32')]);}return _0x11e027[_0xb8b4('0x10d')](_0x515498);}})['then'](function(_0x18c8b1){if(_0x18c8b1){return _0x18c8b1?{'count':_0x5c3062,'rows':_0x18c8b1}:null;}})[_0xb8b4('0x38')](respondWithResult(_0x455b32,null))[_0xb8b4('0x58')](handleError(_0x455b32,null));};exports['addProactiveActions']=function(_0x87593f,_0x1b1060,_0x5d92cb){return db[_0xb8b4('0x10e')]['find']({'where':{'id':_0x87593f[_0xb8b4('0x66')]['id']}})[_0xb8b4('0x38')](handleEntityNotFound(_0x1b1060,null))[_0xb8b4('0x38')](function(_0x169161){if(_0x169161){return _0x169161[_0xb8b4('0x10f')](_0x87593f[_0xb8b4('0x65')][_0xb8b4('0x72')],_[_0xb8b4('0xe8')](_0x87593f[_0xb8b4('0x65')],['ids','id'])||{});}})[_0xb8b4('0x38')](respondWithResult(_0x1b1060,null))['catch'](handleError(_0x1b1060,null));};exports[_0xb8b4('0xfc')]=function(_0x5df555,_0x46ba71,_0xd3c231){var _0x303eb4={};var _0x2c2bbf={};var _0x4b71cf;var _0x4d3d88;return db['ChatWebsite'][_0xb8b4('0x6c')]({'where':{'id':_0x5df555[_0xb8b4('0x66')]['id']}})['then'](handleEntityNotFound(_0x46ba71,null))[_0xb8b4('0x38')](function(_0x1d5552){if(_0x1d5552){_0x4b71cf=_0x1d5552;_0x2c2bbf[_0xb8b4('0x45')]=_[_0xb8b4('0x5b')](db[_0xb8b4('0x110')][_0xb8b4('0x43')]);_0x2c2bbf[_0xb8b4('0x46')]=_[_0xb8b4('0x5b')](_0x5df555[_0xb8b4('0x46')]);_0x2c2bbf['filters']=_[_0xb8b4('0x48')](_0x2c2bbf[_0xb8b4('0x45')],_0x2c2bbf['query']);_0x303eb4[_0xb8b4('0x4a')]=_[_0xb8b4('0x48')](_0x2c2bbf[_0xb8b4('0x45')],qs['fields'](_0x5df555[_0xb8b4('0x46')][_0xb8b4('0x49')]));_0x303eb4[_0xb8b4('0x4a')]=_0x303eb4[_0xb8b4('0x4a')][_0xb8b4('0x5c')]?_0x303eb4[_0xb8b4('0x4a')]:_0x2c2bbf[_0xb8b4('0x45')];_0x303eb4['order']=qs[_0xb8b4('0x4f')](_0x5df555['query'][_0xb8b4('0x4f')]);_0x303eb4[_0xb8b4('0x50')]=qs[_0xb8b4('0x47')](_[_0xb8b4('0x51')](_0x5df555[_0xb8b4('0x46')],_0x2c2bbf['filters']));if(_0x5df555[_0xb8b4('0x46')][_0xb8b4('0x52')]){_0x303eb4[_0xb8b4('0x50')]=_[_0xb8b4('0x6d')](_0x303eb4['where'],{'$or':_[_0xb8b4('0x41')](_0x303eb4[_0xb8b4('0x4a')],function(_0x227cbc){var _0x317eb7={};_0x317eb7[_0x227cbc]={'$like':'%'+_0x5df555[_0xb8b4('0x46')][_0xb8b4('0x52')]+'%'};return _0x317eb7;})});}_0x303eb4=_[_0xb8b4('0x6d')]({},_0x303eb4,_0x5df555[_0xb8b4('0x54')]);return _0x4b71cf[_0xb8b4('0xfc')](_0x303eb4);}})[_0xb8b4('0x38')](function(_0x1e0013){if(_0x1e0013){_0x4d3d88=_0x1e0013[_0xb8b4('0x5c')];if(!_0x5df555[_0xb8b4('0x46')][_0xb8b4('0x4b')](_0xb8b4('0x4c'))){_0x303eb4['limit']=qs['limit'](_0x5df555['query'][_0xb8b4('0x4d')]);_0x303eb4[_0xb8b4('0x32')]=qs['offset'](_0x5df555[_0xb8b4('0x46')][_0xb8b4('0x32')]);}return _0x4b71cf[_0xb8b4('0xfc')](_0x303eb4);}})[_0xb8b4('0x38')](function(_0x3495d6){if(_0x3495d6){return _0x3495d6?{'count':_0x4d3d88,'rows':_0x3495d6}:null;}})[_0xb8b4('0x38')](respondWithResult(_0x46ba71,null))[_0xb8b4('0x58')](handleError(_0x46ba71,null));};exports[_0xb8b4('0x111')]=function(_0x527a75,_0x638d3b,_0x5aefbe){var _0x560816=_0x527a75[_0xb8b4('0x46')]['online']==='false'?_0xb8b4('0x112'):_0xb8b4('0x113');return db[_0xb8b4('0x42')]['find']({'attributes':['id',_0x560816],'where':{'id':_0x527a75['params']['id']}})[_0xb8b4('0x38')](handleEntityNotFound(_0x638d3b,null))[_0xb8b4('0x38')](function(_0x99265d){if(_0x99265d){var _0x4c8299=_0x99265d[_0x560816];var _0x25e9f8=_0x4c8299&&_0x4c8299[_0xb8b4('0x114')]?_0x4c8299['items']:[];_0x638d3b[_0xb8b4('0x3e')]({'fromKey':_[_0xb8b4('0x7d')](_0x4c8299[_0xb8b4('0x115')])?undefined:_0x4c8299[_0xb8b4('0x115')],'count':_0x25e9f8['length'],'rows':_0x25e9f8});}})[_0xb8b4('0x58')](handleError(_0x638d3b,null));};exports[_0xb8b4('0x116')]=function(_0x5847c5,_0x495c95,_0x33d97d){var _0x52773b={'raw':![],'where':{}};var _0x23afae={};var _0x40be39={'count':0x0,'rows':[]};return db[_0xb8b4('0x42')]['findOne']({'where':{'id':_0x5847c5[_0xb8b4('0x66')]['id']}})[_0xb8b4('0x38')](handleEntityNotFound(_0x495c95,null))[_0xb8b4('0x38')](function(_0x2f796c){if(_0x2f796c){_0x23afae[_0xb8b4('0x45')]=_['keys'](db[_0xb8b4('0x117')][_0xb8b4('0x43')]);_0x23afae[_0xb8b4('0x46')]=_[_0xb8b4('0x5b')](_0x5847c5[_0xb8b4('0x46')]);_0x23afae[_0xb8b4('0x47')]=_['intersection'](_0x23afae[_0xb8b4('0x45')],_0x23afae[_0xb8b4('0x46')]);_0x52773b[_0xb8b4('0x4a')]=_['intersection'](_0x23afae[_0xb8b4('0x45')],qs['fields'](_0x5847c5[_0xb8b4('0x46')][_0xb8b4('0x49')]));_0x52773b['attributes']=_0x52773b['attributes'][_0xb8b4('0x5c')]?_0x52773b[_0xb8b4('0x4a')]:_0x23afae['model'];if(!_0x5847c5[_0xb8b4('0x46')][_0xb8b4('0x4b')](_0xb8b4('0x4c'))){_0x52773b['limit']=qs[_0xb8b4('0x4d')](_0x5847c5['query']['limit']);_0x52773b['offset']=qs['offset'](_0x5847c5['query'][_0xb8b4('0x32')]);}_0x52773b['order']=qs[_0xb8b4('0x4f')](_0x5847c5['query'][_0xb8b4('0x4f')]);_0x52773b[_0xb8b4('0x50')]=qs[_0xb8b4('0x47')](_[_0xb8b4('0x51')](_0x5847c5[_0xb8b4('0x46')],_0x23afae[_0xb8b4('0x47')]));_0x52773b[_0xb8b4('0x50')][_0xb8b4('0x69')]=_0x2f796c['id'];if(_0x5847c5[_0xb8b4('0x46')][_0xb8b4('0x52')]){_0x52773b[_0xb8b4('0x50')]=_['merge'](_0x52773b[_0xb8b4('0x50')],{'$or':_[_0xb8b4('0x41')](_0x52773b[_0xb8b4('0x4a')],function(_0x58780d){var _0x5a9fa6={};_0x5a9fa6[_0x58780d]={'$like':'%'+_0x5847c5['query'][_0xb8b4('0x52')]+'%'};return _0x5a9fa6;})});}_0x52773b=_['merge']({},_0x52773b,_0x5847c5[_0xb8b4('0x54')]);return db['ChatOfflineMessage'][_0xb8b4('0x31')]({'where':_0x52773b[_0xb8b4('0x50')]})[_0xb8b4('0x38')](function(_0x2fd07d){_0x40be39[_0xb8b4('0x31')]=_0x2fd07d;if(_0x5847c5[_0xb8b4('0x46')]['includeAll']){_0x52773b[_0xb8b4('0x118')]=[{'all':!![]}];}else{_0x52773b[_0xb8b4('0x118')]=[{'model':db['CmContact'],'as':_0xb8b4('0xe9'),'required':![]}];}return db[_0xb8b4('0x117')]['findAll'](_0x52773b);})[_0xb8b4('0x38')](function(_0x65db8b){_0x40be39[_0xb8b4('0x57')]=_0x65db8b;return _0x40be39;});}})[_0xb8b4('0x38')](respondWithFilteredResult(_0x495c95,_0x52773b))[_0xb8b4('0x58')](handleError(_0x495c95,null));};exports[_0xb8b4('0x119')]=function(_0x4412ed,_0xe202ca,_0x380528){return db[_0xb8b4('0x42')][_0xb8b4('0x5d')]({'where':{'id':_0x4412ed[_0xb8b4('0x66')]['id']}})[_0xb8b4('0x38')](handleEntityNotFound(_0xe202ca,null))[_0xb8b4('0x38')](function(_0x464d98){if(_0x464d98){return _0x464d98[_0xb8b4('0x119')](_0x4412ed['body']['ids'],_[_0xb8b4('0xe8')](_0x4412ed[_0xb8b4('0x65')],[_0xb8b4('0x72'),'id'])||{})[_0xb8b4('0xd1')](function(_0x8f2917){for(var _0x459d4e=0x0;_0x459d4e<_0x4412ed['body']['ids']['length'];_0x459d4e+=0x1){socket[_0xb8b4('0x11a')]('userChatWebsite:save',{'UserId':_0x4412ed[_0xb8b4('0x65')][_0xb8b4('0x72')][_0x459d4e],'ChatWebsiteId':_0x4412ed[_0xb8b4('0x66')]['id']});}return _0x8f2917;});}})[_0xb8b4('0x38')](respondWithResult(_0xe202ca,null))[_0xb8b4('0x58')](handleError(_0xe202ca,null));};exports[_0xb8b4('0x11b')]=function(_0x21a282,_0x18ba6a,_0x47258d){return db[_0xb8b4('0x42')][_0xb8b4('0x5d')]({'where':{'id':_0x21a282[_0xb8b4('0x66')]['id']}})[_0xb8b4('0x38')](handleEntityNotFound(_0x18ba6a,null))['then'](function(_0x44705f){if(_0x44705f){return _0x44705f[_0xb8b4('0x11b')](_0x21a282[_0xb8b4('0x46')][_0xb8b4('0x72')])[_0xb8b4('0x38')](function(){if(_[_0xb8b4('0x11c')](_0x21a282[_0xb8b4('0x46')][_0xb8b4('0x72')])){for(var _0x20e819=0x0;_0x20e819<_0x21a282[_0xb8b4('0x46')][_0xb8b4('0x72')][_0xb8b4('0x5c')];_0x20e819+=0x1){socket[_0xb8b4('0x11a')]('userChatWebsite:remove',{'UserId':Number(_0x21a282[_0xb8b4('0x46')][_0xb8b4('0x72')][_0x20e819]),'ChatWebsiteId':Number(_0x21a282['params']['id'])});}}else{socket[_0xb8b4('0x11a')](_0xb8b4('0x11d'),{'UserId':Number(_0x21a282['query'][_0xb8b4('0x72')]),'ChatWebsiteId':Number(_0x21a282[_0xb8b4('0x66')]['id'])});}});}})[_0xb8b4('0x38')](respondWithStatusCode(_0x18ba6a,null))[_0xb8b4('0x58')](handleError(_0x18ba6a,null));};exports['getAgents']=function(_0x372392,_0x2289b0,_0x3c1e22){var _0x40a3e2={};var _0x5e98f8={};var _0x4fc798;var _0x576d86;return db['ChatWebsite'][_0xb8b4('0x6c')]({'where':{'id':_0x372392['params']['id']}})[_0xb8b4('0x38')](handleEntityNotFound(_0x2289b0,null))[_0xb8b4('0x38')](function(_0x2b084d){if(_0x2b084d){_0x4fc798=_0x2b084d;_0x5e98f8['model']=_[_0xb8b4('0x5b')](db['User'][_0xb8b4('0x43')]);_0x5e98f8[_0xb8b4('0x46')]=_['keys'](_0x372392[_0xb8b4('0x46')]);_0x5e98f8[_0xb8b4('0x47')]=_['intersection'](_0x5e98f8[_0xb8b4('0x45')],_0x5e98f8['query']);_0x40a3e2['attributes']=_[_0xb8b4('0x48')](_0x5e98f8['model'],qs[_0xb8b4('0x49')](_0x372392['query'][_0xb8b4('0x49')]));_0x40a3e2[_0xb8b4('0x4a')]=_0x40a3e2[_0xb8b4('0x4a')][_0xb8b4('0x5c')]?_0x40a3e2['attributes']:_0x5e98f8['model'];_0x40a3e2[_0xb8b4('0x4e')]=qs['sort'](_0x372392[_0xb8b4('0x46')][_0xb8b4('0x4f')]);_0x40a3e2[_0xb8b4('0x50')]=qs[_0xb8b4('0x47')](_['pick'](_0x372392['query'],_0x5e98f8[_0xb8b4('0x47')]));if(_0x372392[_0xb8b4('0x46')][_0xb8b4('0x52')]){_0x40a3e2['where']=_['merge'](_0x40a3e2[_0xb8b4('0x50')],{'$or':_[_0xb8b4('0x41')](_0x40a3e2[_0xb8b4('0x4a')],function(_0x5e2e05){var _0x4b1f90={};_0x4b1f90[_0x5e2e05]={'$like':'%'+_0x372392[_0xb8b4('0x46')][_0xb8b4('0x52')]+'%'};return _0x4b1f90;})});}_0x40a3e2=_[_0xb8b4('0x6d')]({},_0x40a3e2,_0x372392[_0xb8b4('0x54')]);return _0x4fc798[_0xb8b4('0x11e')](_0x40a3e2);}})[_0xb8b4('0x38')](function(_0x587b6e){if(_0x587b6e){_0x576d86=_0x587b6e[_0xb8b4('0x5c')];if(!_0x372392[_0xb8b4('0x46')][_0xb8b4('0x4b')](_0xb8b4('0x4c'))){_0x40a3e2[_0xb8b4('0x4d')]=qs[_0xb8b4('0x4d')](_0x372392[_0xb8b4('0x46')][_0xb8b4('0x4d')]);_0x40a3e2[_0xb8b4('0x32')]=qs[_0xb8b4('0x32')](_0x372392[_0xb8b4('0x46')][_0xb8b4('0x32')]);}return _0x4fc798['getAgents'](_0x40a3e2);}})['then'](function(_0x17772d){if(_0x17772d){return _0x17772d?{'count':_0x576d86,'rows':_0x17772d}:null;}})[_0xb8b4('0x38')](respondWithResult(_0x2289b0,null))[_0xb8b4('0x58')](handleError(_0x2289b0,null));}; \ No newline at end of file +var _0x2e98=['*,*,*,*','ChatMessage','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','no\x20available\x20attributes','updatedAt','CompanyId','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','offlineMessageBody','MailAccount','MailServerOut','Smtp','forwardOfflineAddress','service','host','port','secure','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tag','color','tag','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','getLicense','virtual','License','increment','chatLicenseExceeded','all','some','server/files/chat/iframe.js','remote','connection','referer','replace','render','alignment','verticalAlignment','textColor','sequelize','transaction','bulkCreate','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','addAgents','emit','removeAgents','isArray','userChatWebsite:remove','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','lodash','squel','desk.js','querystring','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','./chatWebsite.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~!@#$%^&-_=+[{]}.','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','status','end','json','offset','limit','set','Content-Range','reject','update','destroy','get','ChatWebsites','UserProfileResource','stack','name','send','index','Pause','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','fields','attributes','hasOwnProperty','order','sort','where','filters','filter','merge','ChatWebsite','count','includeAll','include','findAll','rows','show','params','mandatoryDispositionPause','length','options','body','user','role','find','userProfileId','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','getDispositions','findOne','nolimit','ChatWebsiteId','removeDispositions','ids','CannedAnswer','getAnswers','pick','removeAnswers','addLogo','sitepic','file','agentAvatar','filename','addCustomerAvatar','customerAvatar','systemAvatar','getLogo','join','server/files/images/logos/default_logo.png','../../config/license/util','custom','existsSync','root','server/files/images/logos/','download','isNil','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','headers','user-agent','getResult','chat','difference','createdAt','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','CmContact','Contacts','DESC','ChatApplication','Applications','account','orderBy','priority','asc','contact','cf-connecting-ip','first','split','lastName','x-real-port','browser','%s\x20%s','version','unknown','device','format','%s\x20%s\x20%s','vendor','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','firstName','messageId','created','applications','push','close','unmanaged'];(function(_0x6c5690,_0xf8cf2a){var _0x416f9f=function(_0x43da21){while(--_0x43da21){_0x6c5690['push'](_0x6c5690['shift']());}};_0x416f9f(++_0xf8cf2a);}(_0x2e98,0x17f));var _0x82e9=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x2e98[_0x2641f9];return _0x585741;};'use strict';var pdf=require(_0x82e9('0x0'));var emlformat=require(_0x82e9('0x1'));var rimraf=require(_0x82e9('0x2'));var zipdir=require(_0x82e9('0x3'));var jsonpatch=require(_0x82e9('0x4'));var rp=require('request-promise');var moment=require(_0x82e9('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x82e9('0x6'));var path=require(_0x82e9('0x7'));var sox=require(_0x82e9('0x8'));var csv=require(_0x82e9('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x82e9('0xa'));var squel=require(_0x82e9('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x82e9('0xc'));var toCsv=require(_0x82e9('0x9'));var querystring=require(_0x82e9('0xd'));var Papa=require('papaparse');var Redis=require(_0x82e9('0xe'));var authService=require(_0x82e9('0xf'));var qs=require(_0x82e9('0x10'));var as=require(_0x82e9('0x11'));var hardwareService=require(_0x82e9('0x12'));var logger=require(_0x82e9('0x13'))(_0x82e9('0x14'));var utils=require(_0x82e9('0x15'));var config=require(_0x82e9('0x16'));var db=require(_0x82e9('0x17'))['db'];config[_0x82e9('0x18')]=_[_0x82e9('0x19')](config[_0x82e9('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x82e9('0x1a'))(new Redis(config['redis']));require(_0x82e9('0x1b'))['register'](socket);var jayson=require(_0x82e9('0x1c'));var client=jayson[_0x82e9('0x1d')]['http']({'port':0x232c});var client9002=jayson[_0x82e9('0x1d')]['http']({'port':0x232a});var client9003=jayson[_0x82e9('0x1d')][_0x82e9('0x1e')]({'port':0x232b});function checkPasswordPattern(_0x38c12e,_0x39cdb8,_0x2238da){if(_0x2238da){var _0x12e053=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x12e053[_0x82e9('0x1f')](_0x39cdb8)){return _0x38c12e;}else{throw new db[(_0x82e9('0x20'))][(_0x82e9('0x21'))](_0x82e9('0x22'));}}else{return _0x38c12e;}}function respondWithRpcPromise(_0x1d43da,_0x1cf264,_0xbde60d,_0x5084b8){return new BPromise(function(_0xe4a267,_0x42cf3c){var _0x32085e=_0x5084b8||client;return _0x32085e['request'](_0x1d43da,_0xbde60d)[_0x82e9('0x23')](function(_0x565e93){logger[_0x82e9('0x24')](_0x82e9('0x25'),_0x1cf264,_0x82e9('0x26'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x1cf264,'request\x20sent',JSON[_0x82e9('0x27')](_0x565e93));if(_0x565e93['error']){if(_0x565e93['error'][_0x82e9('0x28')]===0x1f4){logger[_0x82e9('0x29')]('ChatWebsite,\x20%s,\x20%s',_0x1cf264,_0x565e93[_0x82e9('0x29')][_0x82e9('0x2a')]);return _0x42cf3c(_0x565e93[_0x82e9('0x29')][_0x82e9('0x2a')]);}logger[_0x82e9('0x29')](_0x82e9('0x25'),_0x1cf264,_0x565e93['error'][_0x82e9('0x2a')]);return _0xe4a267(_0x565e93[_0x82e9('0x29')][_0x82e9('0x2a')]);}else{logger[_0x82e9('0x24')]('ChatWebsite,\x20%s,\x20%s',_0x1cf264,'request\x20sent');_0xe4a267(_0x565e93[_0x82e9('0x2b')][_0x82e9('0x2a')]);}})[_0x82e9('0x2c')](function(_0x32b46c){logger[_0x82e9('0x29')](_0x82e9('0x25'),_0x1cf264,_0x32b46c);_0x42cf3c(_0x32b46c);});});}function respondWithStatusCode(_0x531acf,_0x758f7e){_0x758f7e=_0x758f7e||0xcc;return function(_0x1ab765){if(_0x1ab765){return _0x531acf['sendStatus'](_0x758f7e);}return _0x531acf[_0x82e9('0x2d')](_0x758f7e)[_0x82e9('0x2e')]();};}function respondWithResult(_0x168978,_0x1c67d3){_0x1c67d3=_0x1c67d3||0xc8;return function(_0x244346){if(_0x244346){return _0x168978[_0x82e9('0x2d')](_0x1c67d3)[_0x82e9('0x2f')](_0x244346);}};}function respondWithFilteredResult(_0x4485c7,_0x3d584a){return function(_0x582b34){if(_0x582b34){var _0x35be4a=_0x582b34['count'],_0x4795b6=_0x3d584a[_0x82e9('0x30')],_0x5a309f=_0x3d584a['offset']+_0x3d584a[_0x82e9('0x31')],_0x6c7e96;if(_0x5a309f>=_0x35be4a){_0x5a309f=_0x35be4a;_0x6c7e96=0xc8;}else{_0x6c7e96=0xce;}_0x4485c7[_0x82e9('0x2d')](_0x6c7e96);return _0x4485c7[_0x82e9('0x32')](_0x82e9('0x33'),_0x4795b6+'-'+_0x5a309f+'/'+_0x35be4a)[_0x82e9('0x2f')](_0x582b34);}return null;};}function patchUpdates(_0x3b3abe){return function(_0x35db84){try{jsonpatch['apply'](_0x35db84,_0x3b3abe,!![]);}catch(_0x5b8c78){return BPromise[_0x82e9('0x34')](_0x5b8c78);}return _0x35db84['save']();};}function saveUpdates(_0x5e6be7,_0x319b87){return function(_0x38c1e6){if(_0x38c1e6){return _0x38c1e6[_0x82e9('0x35')](_0x5e6be7)[_0x82e9('0x23')](function(_0x1a19d2){return _0x1a19d2;});}return null;};}function removeEntity(_0x5cb6b6,_0x4f7243){return function(_0x5d5acb){if(_0x5d5acb){return _0x5d5acb[_0x82e9('0x36')]()['then'](function(){var _0x2cb567=_0x5d5acb[_0x82e9('0x37')]({'plain':!![]});var _0x4bc260=_0x82e9('0x38');return db[_0x82e9('0x39')]['destroy']({'where':{'type':_0x4bc260,'resourceId':_0x2cb567['id']}})[_0x82e9('0x23')](function(){return _0x5d5acb;});})[_0x82e9('0x23')](function(){_0x5cb6b6[_0x82e9('0x2d')](0xcc)[_0x82e9('0x2e')]();});}};}function handleEntityNotFound(_0x49593b,_0x444703){return function(_0x35baa1){if(!_0x35baa1){_0x49593b['sendStatus'](0x194);}return _0x35baa1;};}function handleError(_0x21795d,_0x25415a){_0x25415a=_0x25415a||0x1f4;return function(_0x207dc0){logger['error'](_0x207dc0[_0x82e9('0x3a')]);if(_0x207dc0[_0x82e9('0x3b')]){delete _0x207dc0['name'];}_0x21795d[_0x82e9('0x2d')](_0x25415a)[_0x82e9('0x3c')](_0x207dc0);};}exports[_0x82e9('0x3d')]=function(_0x498e48,_0x54f778){var _0x1b8e81={'include':[{'model':db[_0x82e9('0x3e')],'as':'mandatoryDispositionPause'}]},_0x1be167={},_0xa15eae={'count':0x0,'rows':[]};var _0x4f7e85=_['map'](db['ChatWebsite'][_0x82e9('0x3f')],function(_0x4424f6){return{'name':_0x4424f6[_0x82e9('0x40')],'type':_0x4424f6[_0x82e9('0x41')][_0x82e9('0x42')]};});_0x1be167[_0x82e9('0x43')]=_[_0x82e9('0x44')](_0x4f7e85,_0x82e9('0x3b'));_0x1be167[_0x82e9('0x45')]=_[_0x82e9('0x46')](_0x498e48['query']);_0x1be167['filters']=_[_0x82e9('0x47')](_0x1be167[_0x82e9('0x43')],_0x1be167[_0x82e9('0x45')]);_0x1b8e81['attributes']=_['intersection'](_0x1be167['model'],qs['fields'](_0x498e48[_0x82e9('0x45')][_0x82e9('0x48')]));_0x1b8e81[_0x82e9('0x49')]=_0x1b8e81[_0x82e9('0x49')]['length']?_0x1b8e81[_0x82e9('0x49')]:_0x1be167[_0x82e9('0x43')];if(!_0x498e48[_0x82e9('0x45')][_0x82e9('0x4a')]('nolimit')){_0x1b8e81[_0x82e9('0x31')]=qs[_0x82e9('0x31')](_0x498e48['query']['limit']);_0x1b8e81[_0x82e9('0x30')]=qs['offset'](_0x498e48[_0x82e9('0x45')][_0x82e9('0x30')]);}_0x1b8e81[_0x82e9('0x4b')]=qs[_0x82e9('0x4c')](_0x498e48[_0x82e9('0x45')]['sort']);_0x1b8e81[_0x82e9('0x4d')]=qs[_0x82e9('0x4e')](_['pick'](_0x498e48[_0x82e9('0x45')],_0x1be167[_0x82e9('0x4e')]));if(_0x498e48[_0x82e9('0x45')][_0x82e9('0x4f')]){_0x1b8e81[_0x82e9('0x4d')]=_[_0x82e9('0x50')](_0x1b8e81['where'],{'$or':_[_0x82e9('0x44')](_0x4f7e85,function(_0x202c59){if(_0x202c59[_0x82e9('0x41')]!=='VIRTUAL'){var _0x5c9507={};_0x5c9507[_0x202c59[_0x82e9('0x3b')]]={'$like':'%'+_0x498e48['query']['filter']+'%'};return _0x5c9507;}})});}_0x1b8e81=_['merge']({},_0x1b8e81,_0x498e48['options']);var _0x1ee51c={'where':_0x1b8e81[_0x82e9('0x4d')]};return db[_0x82e9('0x51')][_0x82e9('0x52')](_0x1ee51c)[_0x82e9('0x23')](function(_0x261e66){_0xa15eae[_0x82e9('0x52')]=_0x261e66;if(_0x498e48[_0x82e9('0x45')][_0x82e9('0x53')]){_0x1b8e81[_0x82e9('0x54')]=[{'all':!![]}];}return db[_0x82e9('0x51')][_0x82e9('0x55')](_0x1b8e81);})[_0x82e9('0x23')](function(_0x2e39df){_0xa15eae[_0x82e9('0x56')]=_0x2e39df;return _0xa15eae;})[_0x82e9('0x23')](respondWithFilteredResult(_0x54f778,_0x1b8e81))[_0x82e9('0x2c')](handleError(_0x54f778,null));};exports[_0x82e9('0x57')]=function(_0x5b5646,_0x5d6c56){var _0x4bf61d={'raw':![],'where':{'id':_0x5b5646[_0x82e9('0x58')]['id']},'include':[{'model':db['Pause'],'as':_0x82e9('0x59')}]},_0x1fb703={};_0x1fb703['model']=_[_0x82e9('0x46')](db[_0x82e9('0x51')][_0x82e9('0x3f')]);_0x1fb703[_0x82e9('0x45')]=_[_0x82e9('0x46')](_0x5b5646[_0x82e9('0x45')]);_0x1fb703[_0x82e9('0x4e')]=_[_0x82e9('0x47')](_0x1fb703[_0x82e9('0x43')],_0x1fb703[_0x82e9('0x45')]);_0x4bf61d[_0x82e9('0x49')]=_[_0x82e9('0x47')](_0x1fb703[_0x82e9('0x43')],qs[_0x82e9('0x48')](_0x5b5646[_0x82e9('0x45')][_0x82e9('0x48')]));_0x4bf61d[_0x82e9('0x49')]=_0x4bf61d[_0x82e9('0x49')][_0x82e9('0x5a')]?_0x4bf61d[_0x82e9('0x49')]:_0x1fb703['model'];if(_0x5b5646[_0x82e9('0x45')][_0x82e9('0x53')]){_0x4bf61d[_0x82e9('0x54')]=[{'all':!![]}];}_0x4bf61d=_['merge']({},_0x4bf61d,_0x5b5646[_0x82e9('0x5b')]);return db[_0x82e9('0x51')]['find'](_0x4bf61d)[_0x82e9('0x23')](handleEntityNotFound(_0x5d6c56,null))[_0x82e9('0x23')](respondWithResult(_0x5d6c56,null))['catch'](handleError(_0x5d6c56,null));};exports['create']=function(_0x2acc23,_0x2315b2){return db[_0x82e9('0x51')]['create'](_0x2acc23[_0x82e9('0x5c')],{})[_0x82e9('0x23')](function(_0x4fd7aa){var _0x42ef9b=_0x2acc23[_0x82e9('0x5d')][_0x82e9('0x37')]({'plain':!![]});if(!_0x42ef9b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x42ef9b[_0x82e9('0x5e')]===_0x82e9('0x5d')){var _0x53fb02=_0x4fd7aa[_0x82e9('0x37')]({'plain':!![]});var _0x4c202f=_0x82e9('0x38');return db['UserProfileSection'][_0x82e9('0x5f')]({'where':{'name':_0x4c202f,'userProfileId':_0x42ef9b[_0x82e9('0x60')]},'raw':!![]})[_0x82e9('0x23')](function(_0x5aead1){if(_0x5aead1&&_0x5aead1['autoAssociation']===0x0){return db[_0x82e9('0x39')][_0x82e9('0x61')]({'name':_0x53fb02[_0x82e9('0x3b')],'resourceId':_0x53fb02['id'],'type':_0x5aead1[_0x82e9('0x3b')],'sectionId':_0x5aead1['id']},{})[_0x82e9('0x23')](function(){return _0x4fd7aa;});}else{return _0x4fd7aa;}})[_0x82e9('0x2c')](function(_0x4f490b){logger[_0x82e9('0x29')](_0x82e9('0x62'),_0x4f490b);throw _0x4f490b;});}return _0x4fd7aa;})[_0x82e9('0x23')](respondWithResult(_0x2315b2,0xc9))[_0x82e9('0x2c')](handleError(_0x2315b2,null));};exports[_0x82e9('0x35')]=function(_0x2eee32,_0xe0214f){if(_0x2eee32['body']['id']){delete _0x2eee32['body']['id'];}return db['ChatWebsite'][_0x82e9('0x5f')]({'where':{'id':_0x2eee32[_0x82e9('0x58')]['id']},'include':[{'model':db['Pause'],'as':_0x82e9('0x59')}]})[_0x82e9('0x23')](handleEntityNotFound(_0xe0214f,null))[_0x82e9('0x23')](saveUpdates(_0x2eee32[_0x82e9('0x5c')],null))[_0x82e9('0x23')](respondWithResult(_0xe0214f,null))[_0x82e9('0x2c')](handleError(_0xe0214f,null));};exports[_0x82e9('0x36')]=function(_0x1c6908,_0x56326f){return db[_0x82e9('0x51')]['find']({'where':{'id':_0x1c6908[_0x82e9('0x58')]['id']}})[_0x82e9('0x23')](handleEntityNotFound(_0x56326f,null))[_0x82e9('0x23')](removeEntity(_0x56326f,null))[_0x82e9('0x2c')](handleError(_0x56326f,null));};exports[_0x82e9('0x63')]=function(_0x248ad4,_0x5d857f){return db[_0x82e9('0x51')][_0x82e9('0x63')]()[_0x82e9('0x23')](respondWithResult(_0x5d857f,null))['catch'](handleError(_0x5d857f,null));};exports[_0x82e9('0x64')]=function(_0x1fdc02,_0x35d11c,_0x2ceb9f){if(_0x1fdc02[_0x82e9('0x5c')]['id']){delete _0x1fdc02[_0x82e9('0x5c')]['id'];}return db[_0x82e9('0x51')]['find']({'where':{'id':_0x1fdc02[_0x82e9('0x58')]['id']}})[_0x82e9('0x23')](handleEntityNotFound(_0x35d11c,null))[_0x82e9('0x23')](function(_0x5cfa48){if(_0x5cfa48){_0x1fdc02[_0x82e9('0x5c')]['ChatWebsiteId']=_0x5cfa48['id'];return db[_0x82e9('0x65')][_0x82e9('0x61')](_0x1fdc02[_0x82e9('0x5c')]);}})[_0x82e9('0x23')](respondWithResult(_0x35d11c,null))[_0x82e9('0x2c')](handleError(_0x35d11c,null));};exports[_0x82e9('0x66')]=function(_0x2f303e,_0x55551d,_0x2907ce){var _0x4d47f1={'raw':![],'where':{}};var _0x36f080={};var _0x9bdbee={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x82e9('0x67')]({'where':{'id':_0x2f303e[_0x82e9('0x58')]['id']}})[_0x82e9('0x23')](handleEntityNotFound(_0x55551d,null))['then'](function(_0x3f5c61){if(_0x3f5c61){_0x36f080['model']=_['keys'](db[_0x82e9('0x65')][_0x82e9('0x3f')]);_0x36f080[_0x82e9('0x45')]=_[_0x82e9('0x46')](_0x2f303e[_0x82e9('0x45')]);_0x36f080[_0x82e9('0x4e')]=_[_0x82e9('0x47')](_0x36f080['model'],_0x36f080[_0x82e9('0x45')]);_0x4d47f1[_0x82e9('0x49')]=_[_0x82e9('0x47')](_0x36f080[_0x82e9('0x43')],qs[_0x82e9('0x48')](_0x2f303e[_0x82e9('0x45')]['fields']));_0x4d47f1[_0x82e9('0x49')]=_0x4d47f1[_0x82e9('0x49')]['length']?_0x4d47f1['attributes']:_0x36f080['model'];if(!_0x2f303e[_0x82e9('0x45')][_0x82e9('0x4a')](_0x82e9('0x68'))){_0x4d47f1[_0x82e9('0x31')]=qs[_0x82e9('0x31')](_0x2f303e[_0x82e9('0x45')][_0x82e9('0x31')]);_0x4d47f1[_0x82e9('0x30')]=qs[_0x82e9('0x30')](_0x2f303e[_0x82e9('0x45')]['offset']);}_0x4d47f1[_0x82e9('0x4b')]=qs['sort'](_0x2f303e[_0x82e9('0x45')][_0x82e9('0x4c')]);_0x4d47f1[_0x82e9('0x4d')]=qs[_0x82e9('0x4e')](_['pick'](_0x2f303e['query'],_0x36f080[_0x82e9('0x4e')]));_0x4d47f1['where'][_0x82e9('0x69')]=_0x3f5c61['id'];if(_0x2f303e[_0x82e9('0x45')][_0x82e9('0x4f')]){_0x4d47f1[_0x82e9('0x4d')]=_[_0x82e9('0x50')](_0x4d47f1[_0x82e9('0x4d')],{'$or':_[_0x82e9('0x44')](_0x4d47f1['attributes'],function(_0x1bc0bb){var _0x1dbf33={};_0x1dbf33[_0x1bc0bb]={'$like':'%'+_0x2f303e[_0x82e9('0x45')][_0x82e9('0x4f')]+'%'};return _0x1dbf33;})});}_0x4d47f1=_[_0x82e9('0x50')]({},_0x4d47f1,_0x2f303e[_0x82e9('0x5b')]);return db['Disposition'][_0x82e9('0x52')]({'where':_0x4d47f1[_0x82e9('0x4d')]})['then'](function(_0x3a973a){_0x9bdbee[_0x82e9('0x52')]=_0x3a973a;if(_0x2f303e['query'][_0x82e9('0x53')]){_0x4d47f1[_0x82e9('0x54')]=[{'all':!![]}];}return db[_0x82e9('0x65')][_0x82e9('0x55')](_0x4d47f1);})[_0x82e9('0x23')](function(_0x37df6c){_0x9bdbee[_0x82e9('0x56')]=_0x37df6c;return _0x9bdbee;});}})['then'](respondWithFilteredResult(_0x55551d,_0x4d47f1))[_0x82e9('0x2c')](handleError(_0x55551d,null));};exports[_0x82e9('0x6a')]=function(_0xa3be9e,_0x4227ea,_0x1e42e0){return db[_0x82e9('0x51')][_0x82e9('0x5f')]({'where':{'id':_0xa3be9e[_0x82e9('0x58')]['id']}})[_0x82e9('0x23')](handleEntityNotFound(_0x4227ea,null))[_0x82e9('0x23')](function(_0x14f62c){if(_0x14f62c){return _0x14f62c[_0x82e9('0x6a')](_0xa3be9e[_0x82e9('0x45')][_0x82e9('0x6b')]);}})['then'](respondWithStatusCode(_0x4227ea,null))[_0x82e9('0x2c')](handleError(_0x4227ea,null));};exports['addAnswer']=function(_0x29f1ce,_0x2a6871,_0x4d2307){if(_0x29f1ce['body']['id']){delete _0x29f1ce[_0x82e9('0x5c')]['id'];}return db[_0x82e9('0x51')][_0x82e9('0x5f')]({'where':{'id':_0x29f1ce[_0x82e9('0x58')]['id']}})[_0x82e9('0x23')](handleEntityNotFound(_0x2a6871,null))[_0x82e9('0x23')](function(_0x4cf47e){if(_0x4cf47e){_0x29f1ce['body'][_0x82e9('0x69')]=_0x4cf47e['id'];return db[_0x82e9('0x6c')][_0x82e9('0x61')](_0x29f1ce[_0x82e9('0x5c')]);}})[_0x82e9('0x23')](respondWithResult(_0x2a6871,null))[_0x82e9('0x2c')](handleError(_0x2a6871,null));};exports[_0x82e9('0x6d')]=function(_0x34c2be,_0x2eb4b2,_0x5e4bd9){var _0x359028={'raw':![],'where':{}};var _0x5922cd={};var _0x406c55={'count':0x0,'rows':[]};return db[_0x82e9('0x51')][_0x82e9('0x67')]({'where':{'id':_0x34c2be[_0x82e9('0x58')]['id']}})[_0x82e9('0x23')](handleEntityNotFound(_0x2eb4b2,null))[_0x82e9('0x23')](function(_0x50c0f5){if(_0x50c0f5){_0x5922cd[_0x82e9('0x43')]=_[_0x82e9('0x46')](db['CannedAnswer'][_0x82e9('0x3f')]);_0x5922cd['query']=_[_0x82e9('0x46')](_0x34c2be[_0x82e9('0x45')]);_0x5922cd[_0x82e9('0x4e')]=_[_0x82e9('0x47')](_0x5922cd['model'],_0x5922cd[_0x82e9('0x45')]);_0x359028[_0x82e9('0x49')]=_[_0x82e9('0x47')](_0x5922cd[_0x82e9('0x43')],qs['fields'](_0x34c2be[_0x82e9('0x45')][_0x82e9('0x48')]));_0x359028[_0x82e9('0x49')]=_0x359028[_0x82e9('0x49')]['length']?_0x359028[_0x82e9('0x49')]:_0x5922cd[_0x82e9('0x43')];if(!_0x34c2be[_0x82e9('0x45')][_0x82e9('0x4a')]('nolimit')){_0x359028[_0x82e9('0x31')]=qs['limit'](_0x34c2be[_0x82e9('0x45')][_0x82e9('0x31')]);_0x359028[_0x82e9('0x30')]=qs[_0x82e9('0x30')](_0x34c2be['query'][_0x82e9('0x30')]);}_0x359028['order']=qs[_0x82e9('0x4c')](_0x34c2be[_0x82e9('0x45')][_0x82e9('0x4c')]);_0x359028['where']=qs['filters'](_[_0x82e9('0x6e')](_0x34c2be[_0x82e9('0x45')],_0x5922cd['filters']));_0x359028[_0x82e9('0x4d')][_0x82e9('0x69')]=_0x50c0f5['id'];if(_0x34c2be[_0x82e9('0x45')][_0x82e9('0x4f')]){_0x359028['where']=_['merge'](_0x359028[_0x82e9('0x4d')],{'$or':_['map'](_0x359028[_0x82e9('0x49')],function(_0x4c1a7f){var _0x50e888={};_0x50e888[_0x4c1a7f]={'$like':'%'+_0x34c2be['query'][_0x82e9('0x4f')]+'%'};return _0x50e888;})});}_0x359028=_[_0x82e9('0x50')]({},_0x359028,_0x34c2be[_0x82e9('0x5b')]);return db[_0x82e9('0x6c')][_0x82e9('0x52')]({'where':_0x359028[_0x82e9('0x4d')]})['then'](function(_0x4b93d8){_0x406c55[_0x82e9('0x52')]=_0x4b93d8;if(_0x34c2be[_0x82e9('0x45')][_0x82e9('0x53')]){_0x359028[_0x82e9('0x54')]=[{'all':!![]}];}return db[_0x82e9('0x6c')][_0x82e9('0x55')](_0x359028);})[_0x82e9('0x23')](function(_0x17392a){_0x406c55['rows']=_0x17392a;return _0x406c55;});}})['then'](respondWithFilteredResult(_0x2eb4b2,_0x359028))[_0x82e9('0x2c')](handleError(_0x2eb4b2,null));};exports[_0x82e9('0x6f')]=function(_0x590ba7,_0x2ca1fc,_0x2a539c){return db['ChatWebsite'][_0x82e9('0x5f')]({'where':{'id':_0x590ba7[_0x82e9('0x58')]['id']}})[_0x82e9('0x23')](handleEntityNotFound(_0x2ca1fc,null))['then'](function(_0x142db7){if(_0x142db7){return _0x142db7['removeAnswers'](_0x590ba7[_0x82e9('0x45')][_0x82e9('0x6b')]);}})[_0x82e9('0x23')](respondWithStatusCode(_0x2ca1fc,null))['catch'](handleError(_0x2ca1fc,null));};exports[_0x82e9('0x70')]=function(_0xcecf,_0xa2e1a,_0x17c730){_0xcecf[_0x82e9('0x5c')][_0x82e9('0x71')]=_0xcecf[_0x82e9('0x72')]['filename'];return db['ChatWebsite']['find']({'where':{'id':_0xcecf['params']['id']}})[_0x82e9('0x23')](handleEntityNotFound(_0xa2e1a,null))['then'](saveUpdates(_0xcecf[_0x82e9('0x5c')],null))[_0x82e9('0x23')](respondWithResult(_0xa2e1a,null))[_0x82e9('0x2c')](handleError(_0xa2e1a,null));};exports['addAvatar']=function(_0xfa9cab,_0x265cd5,_0x8b862a){_0xfa9cab[_0x82e9('0x5c')][_0x82e9('0x73')]=_0xfa9cab[_0x82e9('0x72')][_0x82e9('0x74')];return db[_0x82e9('0x51')][_0x82e9('0x5f')]({'where':{'id':_0xfa9cab[_0x82e9('0x58')]['id']}})[_0x82e9('0x23')](handleEntityNotFound(_0x265cd5,null))[_0x82e9('0x23')](saveUpdates(_0xfa9cab[_0x82e9('0x5c')],null))[_0x82e9('0x23')](respondWithResult(_0x265cd5,null))[_0x82e9('0x2c')](handleError(_0x265cd5,null));};exports[_0x82e9('0x75')]=function(_0x568eaf,_0x1d4933,_0x1a09ea){_0x568eaf['body'][_0x82e9('0x76')]=_0x568eaf[_0x82e9('0x72')][_0x82e9('0x74')];return db[_0x82e9('0x51')][_0x82e9('0x5f')]({'where':{'id':_0x568eaf[_0x82e9('0x58')]['id']}})[_0x82e9('0x23')](handleEntityNotFound(_0x1d4933,null))[_0x82e9('0x23')](saveUpdates(_0x568eaf[_0x82e9('0x5c')],null))['then'](respondWithResult(_0x1d4933,null))[_0x82e9('0x2c')](handleError(_0x1d4933,null));};exports['addSystemAvatar']=function(_0x487bd1,_0x3eabb1,_0x4ffaef){_0x487bd1['body'][_0x82e9('0x77')]=_0x487bd1[_0x82e9('0x72')]['filename'];return db[_0x82e9('0x51')][_0x82e9('0x5f')]({'where':{'id':_0x487bd1['params']['id']}})['then'](handleEntityNotFound(_0x3eabb1,null))[_0x82e9('0x23')](saveUpdates(_0x487bd1['body'],null))[_0x82e9('0x23')](respondWithResult(_0x3eabb1,null))[_0x82e9('0x2c')](handleError(_0x3eabb1,null));};exports[_0x82e9('0x78')]=function(_0x3a2a81,_0x471080,_0x55a7a7){var _0x3088ea=path[_0x82e9('0x79')](config['root'],_0x82e9('0x7a'));var _0x49c2da={'where':{'id':_0x3a2a81[_0x82e9('0x58')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x32a81d=![];return require(_0x82e9('0x7b'))['getLicense']()[_0x82e9('0x23')](function(_0xd2b0d){if(_0xd2b0d){_0x32a81d=_0xd2b0d[_0x82e9('0x7c')];}})[_0x82e9('0x23')](function(){return db[_0x82e9('0x51')][_0x82e9('0x5f')](_0x49c2da);})[_0x82e9('0x23')](handleEntityNotFound(_0x471080,null))[_0x82e9('0x23')](function(_0x3aac20){if(_0x3aac20){if(!_['isNil'](_0x3aac20[_0x82e9('0x71')])){if(fs[_0x82e9('0x7d')](path['join'](config[_0x82e9('0x7e')],_0x82e9('0x7f'),_0x3aac20[_0x82e9('0x71')]))&&_0x32a81d){_0x3088ea=path[_0x82e9('0x79')](config[_0x82e9('0x7e')],_0x82e9('0x7f'),_0x3aac20['sitepic']);}}return _0x471080[_0x82e9('0x80')](_0x3088ea);}})[_0x82e9('0x2c')](handleError(_0x471080,null));};exports['getAvatar']=function(_0x51917c,_0x1d0da3,_0x38a953){var _0x3f1094=path[_0x82e9('0x79')](config[_0x82e9('0x7e')],'server/files/images/avatars/default_avatar.png');var _0x2afa88={'where':{'id':_0x51917c[_0x82e9('0x58')]['id']},'attributes':['id',_0x82e9('0x73')],'raw':!![]};return db[_0x82e9('0x51')]['find'](_0x2afa88)[_0x82e9('0x23')](handleEntityNotFound(_0x1d0da3,null))[_0x82e9('0x23')](function(_0x1feeae){if(_0x1feeae){if(!_[_0x82e9('0x81')](_0x1feeae[_0x82e9('0x73')])){if(fs[_0x82e9('0x7d')](path[_0x82e9('0x79')](config[_0x82e9('0x7e')],'server/files/images/avatars/',_0x1feeae[_0x82e9('0x73')]))){_0x3f1094=path[_0x82e9('0x79')](config[_0x82e9('0x7e')],_0x82e9('0x82'),_0x1feeae['agentAvatar']);}}return _0x1d0da3[_0x82e9('0x80')](_0x3f1094);}})[_0x82e9('0x2c')](handleError(_0x1d0da3,null));};exports[_0x82e9('0x83')]=function(_0x48db86,_0x4ffd4f,_0x2709fb){var _0x28efb3=path[_0x82e9('0x79')](config[_0x82e9('0x7e')],_0x82e9('0x84'));var _0x30258d={'where':{'id':_0x48db86['params']['id']},'attributes':['id','customerAvatar',_0x82e9('0x85')],'raw':!![]};return db[_0x82e9('0x51')][_0x82e9('0x5f')](_0x30258d)[_0x82e9('0x23')](handleEntityNotFound(_0x4ffd4f,null))['then'](function(_0x5f021c){if(_0x5f021c){if(!_['isNil'](_0x5f021c[_0x82e9('0x76')])){if(fs[_0x82e9('0x7d')](path[_0x82e9('0x79')](config['root'],_0x82e9('0x82'),_0x5f021c[_0x82e9('0x76')]))&&_0x5f021c[_0x82e9('0x85')]){_0x28efb3=path[_0x82e9('0x79')](config[_0x82e9('0x7e')],'server/files/images/avatars/',_0x5f021c[_0x82e9('0x76')]);}}return _0x4ffd4f[_0x82e9('0x80')](_0x28efb3);}})['catch'](handleError(_0x4ffd4f,null));};exports[_0x82e9('0x86')]=function(_0x87157,_0x4e9114,_0x515b0b){var _0x2d74cb=path[_0x82e9('0x79')](config[_0x82e9('0x7e')],_0x82e9('0x87'));var _0x2ccb2f={'where':{'id':_0x87157[_0x82e9('0x58')]['id']},'attributes':['id',_0x82e9('0x77')],'raw':!![]};return db[_0x82e9('0x51')][_0x82e9('0x5f')](_0x2ccb2f)['then'](handleEntityNotFound(_0x4e9114,null))['then'](function(_0x7c6a18){if(_0x7c6a18){if(!_[_0x82e9('0x81')](_0x7c6a18[_0x82e9('0x77')])){if(fs[_0x82e9('0x7d')](path['join'](config[_0x82e9('0x7e')],_0x82e9('0x82'),_0x7c6a18[_0x82e9('0x77')]))){_0x2d74cb=path[_0x82e9('0x79')](config['root'],_0x82e9('0x82'),_0x7c6a18[_0x82e9('0x77')]);}}return _0x4e9114[_0x82e9('0x80')](_0x2d74cb);}})['catch'](handleError(_0x4e9114,null));};exports[_0x82e9('0x88')]=function(_0x4de9e6,_0x19292e,_0x4ca72d){var _0x37d034=require(_0x82e9('0x89'));var _0x2928dd=new _0x37d034();var _0x3ae585=_0x2928dd['setUA'](_0x4de9e6[_0x82e9('0x8a')][_0x82e9('0x8b')])[_0x82e9('0x8c')]();var _0x45e7ef={'body':_0x4de9e6['body'],'channel':_0x82e9('0x8d')};var _0x841efc=[];var _0x1667b3=[];var _0x3eea50={};var _0x8437bb=![];return db['CmContact'][_0x82e9('0x63')]()['then'](function(_0x469e4b){if(!_0x469e4b){throw new db[(_0x82e9('0x20'))][(_0x82e9('0x21'))]('no\x20available\x20attributes');}_0x841efc=_[_0x82e9('0x8e')](_['keys'](_0x469e4b),['createdAt','updatedAt']);_0x1667b3=_[_0x82e9('0x8e')](_[_0x82e9('0x46')](_0x469e4b),[_0x82e9('0x8f'),'updatedAt','CompanyId',_0x82e9('0x90')]);if(_0x4de9e6[_0x82e9('0x5c')]['id']){delete _0x4de9e6[_0x82e9('0x5c')]['id'];}if(_['isNil'](_0x4de9e6[_0x82e9('0x5c')][_0x82e9('0x91')])){throw new db['Sequelize'][(_0x82e9('0x21'))](_0x82e9('0x92'));}if(_['isNil'](_0x4de9e6[_0x82e9('0x5c')]['body'])||_0x4de9e6[_0x82e9('0x5c')][_0x82e9('0x5c')]===''){throw new db['Sequelize'][(_0x82e9('0x21'))](_0x82e9('0x93'));}if(_[_0x82e9('0x81')](_0x4de9e6[_0x82e9('0x5c')][_0x82e9('0x94')])){throw new db[(_0x82e9('0x20'))][(_0x82e9('0x21'))](_0x82e9('0x95')+_0x1667b3);}if(!_[_0x82e9('0x96')](_0x1667b3,_0x4de9e6[_0x82e9('0x5c')][_0x82e9('0x94')])){throw new db['Sequelize'][(_0x82e9('0x21'))](_0x82e9('0x97')+_0x1667b3);}_0x3eea50[_0x4de9e6['body'][_0x82e9('0x94')]]=_0x4de9e6[_0x82e9('0x5c')][_0x82e9('0x91')];})['then'](function(){return db['ChatWebsite'][_0x82e9('0x5f')]({'where':{'id':_0x4de9e6[_0x82e9('0x58')]['id']},'include':[{'model':db['CmList'],'as':_0x82e9('0x98'),'include':[{'model':db[_0x82e9('0x99')],'as':_0x82e9('0x9a'),'where':_0x3eea50,'limit':0x1,'order':[['updatedAt',_0x82e9('0x9b')]]}]},{'model':db[_0x82e9('0x9c')],'as':_0x82e9('0x9d')}]});})['then'](handleEntityNotFound(_0x19292e,null))['then'](function(_0x6a25c2){if(_0x6a25c2&&_0x6a25c2[_0x82e9('0x98')]){_0x45e7ef[_0x82e9('0x9e')]=_0x6a25c2;_0x45e7ef['applications']=_0x6a25c2[_0x82e9('0x9d')];_0x45e7ef['list']=_0x6a25c2[_0x82e9('0x98')];_0x45e7ef['applications']=_[_0x82e9('0x9f')](_0x45e7ef['applications'],[_0x82e9('0xa0')],[_0x82e9('0xa1')]);if(_0x45e7ef[_0x82e9('0x9e')]['Applications']){delete _0x45e7ef[_0x82e9('0x9e')]['Applications'];}if(_0x45e7ef[_0x82e9('0x9e')][_0x82e9('0x98')]&&_0x45e7ef[_0x82e9('0x9e')][_0x82e9('0x98')][_0x82e9('0x9a')][_0x82e9('0x5a')]){return _0x45e7ef[_0x82e9('0x9e')]['List']['Contacts'][0x0];}var _0x1ebf7d=_[_0x82e9('0x19')](_0x4de9e6['body'],{'firstName':_0x4de9e6[_0x82e9('0x5c')]['from'],'ListId':_0x6a25c2[_0x82e9('0x90')]});_0x1ebf7d[_0x4de9e6['body'][_0x82e9('0x94')]]=_0x4de9e6[_0x82e9('0x5c')][_0x82e9('0x91')];return db[_0x82e9('0x99')]['create'](_0x1ebf7d,{'fields':_0x841efc,'raw':!![]});}})['then'](handleEntityNotFound(_0x19292e,null))[_0x82e9('0x23')](function(_0x1459b8){_0x45e7ef[_0x82e9('0xa2')]=_0x1459b8;var _0x4f4d2b=_0x4de9e6[_0x82e9('0x5c')]['customerIp'];if(_0x4de9e6[_0x82e9('0x8a')][_0x82e9('0xa3')]){_0x4f4d2b=_0x4de9e6['headers'][_0x82e9('0xa3')];}else if(_0x4de9e6[_0x82e9('0x8a')]['x-forwarded-for']){_0x4f4d2b=_[_0x82e9('0xa4')](_0x4de9e6[_0x82e9('0x8a')]['x-forwarded-for'][_0x82e9('0xa5')](','));}if(_0x1459b8){var _0x51755f={'ContactId':_0x1459b8['id'],'ChatWebsiteId':_0x4de9e6[_0x82e9('0x58')]['id'],'from':(_0x1459b8['firstName']||'')+'\x20'+(_0x1459b8[_0x82e9('0xa6')]||''),'customerIp':_0x4f4d2b,'customerPort':_0x4de9e6['headers'][_0x82e9('0xa7')]?_0x4de9e6[_0x82e9('0x8a')]['x-real-port']:null,'referer':_0x4de9e6[_0x82e9('0x5c')]['referer'],'browserName':_0x3ae585[_0x82e9('0xa8')]['name']&&_0x3ae585['browser']['version']?util['format'](_0x82e9('0xa9'),_0x3ae585[_0x82e9('0xa8')]['name'],_0x3ae585[_0x82e9('0xa8')][_0x82e9('0xaa')]):_0x82e9('0xab'),'browserVersion':_0x3ae585[_0x82e9('0xa8')]['version']||_0x82e9('0xab'),'osName':util['format'](_0x82e9('0xa9'),_0x3ae585['os']['name'],_0x3ae585['os'][_0x82e9('0xaa')]),'osVersion':_0x3ae585['os'][_0x82e9('0xaa')],'deviceModel':_0x3ae585[_0x82e9('0xac')][_0x82e9('0x43')]&&_0x3ae585[_0x82e9('0xac')]['vendor']?util[_0x82e9('0xad')](_0x82e9('0xae'),_0x3ae585['device'][_0x82e9('0x43')],_0x3ae585[_0x82e9('0xac')][_0x82e9('0xaf')],_0x3ae585[_0x82e9('0xac')][_0x82e9('0x41')]):null,'deviceVendor':_0x3ae585[_0x82e9('0xac')][_0x82e9('0xaf')],'deviceType':_0x3ae585[_0x82e9('0xac')][_0x82e9('0x41')],'formData':JSON[_0x82e9('0x27')](_0x4de9e6[_0x82e9('0x5c')])};var _0x110eeb={'ChatWebsiteId':_0x4de9e6['params']['id'],'closed':![]};if(_0x4de9e6[_0x82e9('0x5c')][_0x82e9('0xb0')]){_0x110eeb[_0x82e9('0xb0')]=_0x4de9e6[_0x82e9('0x5c')][_0x82e9('0xb0')];return db[_0x82e9('0xb1')]['find']({'where':_0x110eeb})[_0x82e9('0x23')](function(_0x41df1a){if(_0x41df1a){return[_0x41df1a,![]];}_0x51755f[_0x82e9('0xb0')]=_0x4de9e6[_0x82e9('0x5c')][_0x82e9('0xb0')];_0x51755f[_0x82e9('0xb2')]=_0x4de9e6['body'][_0x82e9('0xb2')];return db[_0x82e9('0xb1')][_0x82e9('0x61')](_0x51755f)[_0x82e9('0x23')](function(_0x47708d){return[_0x47708d,!![]];});});}_0x110eeb[_0x82e9('0xb3')]=_0x1459b8['id'];if(_0x4de9e6[_0x82e9('0x5c')][_0x82e9('0xb4')]&&_0x4de9e6[_0x82e9('0x5c')][_0x82e9('0xb4')]['id']){_0x110eeb['id']=_0x4de9e6[_0x82e9('0x5c')][_0x82e9('0xb4')]['id'];return db[_0x82e9('0xb1')][_0x82e9('0x5f')]({'where':_0x110eeb})[_0x82e9('0x23')](function(_0x730d5){if(_0x730d5){return[_0x730d5,![]];}return db[_0x82e9('0xb1')][_0x82e9('0x61')](_0x51755f)[_0x82e9('0x23')](function(_0x455f60){return[_0x455f60,!![]];});});}return db[_0x82e9('0xb1')][_0x82e9('0x61')](_0x51755f)['then'](function(_0x48f061){return[_0x48f061,!![]];});}})[_0x82e9('0xb5')](function(_0x1e0f66,_0x9a44b7){if(_0x1e0f66){_0x8437bb=_0x9a44b7;if(!_0x9a44b7){var _0x15fb15={'from':(_0x45e7ef[_0x82e9('0xa2')][_0x82e9('0xb6')]||'')+'\x20'+(_0x45e7ef[_0x82e9('0xa2')]['lastName']||'')};if(_0x4de9e6[_0x82e9('0x5c')]['threadId']&&_0x4de9e6[_0x82e9('0x5c')]['messageId']&&_0x4de9e6[_0x82e9('0x5c')][_0x82e9('0xb0')]!=_0x4de9e6[_0x82e9('0x5c')][_0x82e9('0xb7')]){_0x15fb15[_0x82e9('0xb0')]=_0x4de9e6[_0x82e9('0x5c')][_0x82e9('0xb7')];}return _0x1e0f66['update'](_0x15fb15);}else{return _0x1e0f66;}}})[_0x82e9('0x23')](function(_0x836bb5){_0x45e7ef[_0x82e9('0xb4')]=_0x836bb5[_0x82e9('0x37')]({'plain':!![]});_0x45e7ef[_0x82e9('0xb4')][_0x82e9('0xb8')]=_0x8437bb;if(_0x45e7ef['interaction'][_0x82e9('0xb8')]){if(_0x45e7ef[_0x82e9('0x9e')]['autoclose']){_0x45e7ef[_0x82e9('0xb9')][_0x82e9('0xba')]({'id':0x0,'priority':_0x45e7ef[_0x82e9('0xb9')]['length']+0x1,'app':_0x82e9('0xbb'),'appdata':_0x82e9('0xbc'),'interval':_0x82e9('0xbd')});}}return db[_0x82e9('0xbe')][_0x82e9('0x61')]({'body':_0x4de9e6[_0x82e9('0x5c')]['body'],'ChatWebsiteId':_0x4de9e6[_0x82e9('0x58')]['id'],'ChatInteractionId':_0x836bb5['id'],'direction':'in','ContactId':_0x45e7ef['contact']['id'],'AttachmentId':_0x4de9e6[_0x82e9('0x5c')]['AttachmentId']});})[_0x82e9('0x23')](function(_0x56d2d6){_0x45e7ef['message']=_0x56d2d6;if(_0x45e7ef['interaction'][_0x82e9('0xbf')]){return db[_0x82e9('0xc0')]['find']({'attributes':['id',_0x82e9('0x3b')],'where':{'id':_0x45e7ef['interaction'][_0x82e9('0xbf')]}})[_0x82e9('0x23')](function(_0x40c2ab){if(_0x40c2ab){_0x45e7ef[_0x82e9('0xb9')][_0x82e9('0xc1')]({'id':0x0,'priority':0x0,'app':_0x82e9('0xc2'),'appdata':_0x40c2ab[_0x82e9('0x3b')]+','+(_0x45e7ef[_0x82e9('0x9e')][_0x82e9('0xc3')]||0xa),'interval':_0x82e9('0xbd')});_0x45e7ef[_0x82e9('0xc4')]=!![];}return respondWithRpcPromise(_0x82e9('0xc5'),_0x82e9('0xc6'),_0x45e7ef);});}return respondWithRpcPromise('Start','startRouting',_0x45e7ef);})[_0x82e9('0x23')](function(_0x4a1b8f){respondWithRpcPromise(_0x82e9('0xc7'),_0x82e9('0xc7'),{'event':_0x82e9('0x88'),'message':_0x4a1b8f},client9002);return _0x4a1b8f;})[_0x82e9('0x23')](respondWithResult(_0x19292e,null))['catch'](handleError(_0x19292e,null));};exports[_0x82e9('0xc8')]=function(_0x451088,_0x51c913,_0x576e95){var _0x48a654,_0x15e9be,_0x3b0545;var _0x2391e6=[];var _0x16c804=[];var _0x48ebaa={};return db[_0x82e9('0x99')][_0x82e9('0x63')]()['then'](function(_0x14bc4c){if(!_0x14bc4c){throw new db['Sequelize']['ValidationError'](_0x82e9('0xc9'));}_0x16c804=_[_0x82e9('0x8e')](_[_0x82e9('0x46')](_0x14bc4c),[_0x82e9('0x8f'),'updatedAt']);_0x2391e6=_[_0x82e9('0x8e')](_[_0x82e9('0x46')](_0x14bc4c),['createdAt',_0x82e9('0xca'),_0x82e9('0xcb'),_0x82e9('0x90')]);if(_0x451088[_0x82e9('0x5c')]['id']){delete _0x451088[_0x82e9('0x5c')]['id'];}if(_[_0x82e9('0x81')](_0x451088[_0x82e9('0x5c')][_0x82e9('0x91')])){throw _0x51c913['status'](0x1f4)[_0x82e9('0x3c')](new db['Sequelize'][(_0x82e9('0x21'))](_0x82e9('0x92')));}if(_[_0x82e9('0x81')](_0x451088[_0x82e9('0x5c')][_0x82e9('0x5c')])||_0x451088[_0x82e9('0x5c')][_0x82e9('0x5c')]===''){throw _0x51c913[_0x82e9('0x2d')](0x1f4)[_0x82e9('0x3c')](new db[(_0x82e9('0x20'))][(_0x82e9('0x21'))](_0x82e9('0x93')));}if(_['isNil'](_0x451088['body'][_0x82e9('0xcc')])){throw _0x51c913[_0x82e9('0x2d')](0x1f4)[_0x82e9('0x3c')](new db[(_0x82e9('0x20'))][(_0x82e9('0x21'))](_0x82e9('0xcd')+_0x2391e6));}if(!_[_0x82e9('0x96')](_0x2391e6,_0x451088['body'][_0x82e9('0xcc')])){throw _0x51c913['status'](0x1f4)[_0x82e9('0x3c')](new db[(_0x82e9('0x20'))]['ValidationError']('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2391e6));}_0x48ebaa[_0x451088[_0x82e9('0x5c')]['mapKeyOffline']]=_0x451088[_0x82e9('0x5c')][_0x82e9('0x91')];})[_0x82e9('0x23')](function(){return db['ChatWebsite'][_0x82e9('0x5f')]({'where':{'id':_0x451088[_0x82e9('0x58')]['id']},'include':[{'model':db['CmList'],'as':_0x82e9('0x98')}]});})[_0x82e9('0x23')](handleEntityNotFound(_0x51c913,null))[_0x82e9('0x23')](function(_0x5c1a8a){if(_0x5c1a8a&&_0x5c1a8a[_0x82e9('0x98')]){_0x15e9be=_0x5c1a8a;var _0x48d11e=_[_0x82e9('0x19')](_0x451088[_0x82e9('0x5c')],{'firstName':_0x451088[_0x82e9('0x5c')][_0x82e9('0x91')],'phone':_0x451088[_0x82e9('0x5c')][_0x82e9('0x91')],'ListId':_0x5c1a8a[_0x82e9('0x90')]});_0x48d11e[_0x451088[_0x82e9('0x5c')][_0x82e9('0xcc')]]=_0x451088[_0x82e9('0x5c')]['from'];return db[_0x82e9('0x99')]['findOrCreate']({'where':_0x48ebaa,'defaults':_0x48d11e});}})[_0x82e9('0xb5')](function(_0x357aae){if(_0x357aae){_0x3b0545=_0x357aae;var _0x41bb2c=fs[_0x82e9('0xce')](path[_0x82e9('0x79')](config[_0x82e9('0x7e')],_0x82e9('0xcf')),_0x82e9('0xd0'));var _0x339144=ejs['render'](_0x41bb2c,{'body':_[_0x82e9('0xd1')](_0x451088[_0x82e9('0x5c')]['body']),'bodyTitle':_0x15e9be[_0x82e9('0xd2')]});return db['ChatOfflineMessage'][_0x82e9('0x61')]({'body':_0x339144,'ContactId':_0x357aae['id'],'ChatWebsiteId':_0x15e9be['id']});}})['then'](function(_0x50990a){if(_0x50990a){_0x48a654=_0x50990a;return db[_0x82e9('0xd3')][_0x82e9('0x67')]({'where':{'service':!![]},'include':[{'model':db[_0x82e9('0xd4')],'as':_0x82e9('0xd5'),'raw':!![]}]});}})[_0x82e9('0x23')](function(_0x583609){if(_0x583609&&_0x583609[_0x82e9('0xd5')]&&_0x15e9be[_0x82e9('0xd6')]){var _0x26135a={'tls':{'rejectUnauthorized':![]}};if(_0x583609['Smtp'][_0x82e9('0xd7')]){_0x26135a[_0x82e9('0xd7')]=_0x583609['Smtp'][_0x82e9('0xd7')];}else{_0x26135a[_0x82e9('0xd8')]=_0x583609[_0x82e9('0xd5')][_0x82e9('0xd8')];_0x26135a[_0x82e9('0xd9')]=_0x583609[_0x82e9('0xd5')]['port'];_0x26135a['secure']=_0x583609[_0x82e9('0xd5')][_0x82e9('0xda')];}if(_0x583609[_0x82e9('0xd5')]['authentication']){_0x26135a['auth']={'user':_0x583609[_0x82e9('0xd5')][_0x82e9('0x5d')],'pass':_0x583609[_0x82e9('0xd5')][_0x82e9('0xdb')]};}return respondWithRpcPromise(_0x82e9('0xdc'),_0x82e9('0xdd'),{'account':_0x26135a,'message':{'from':util['format'](_0x82e9('0xde'),_0x583609[_0x82e9('0x3b')],_0x583609[_0x82e9('0xdf')]||_0x583609[_0x82e9('0xd5')][_0x82e9('0x5d')]),'to':_0x15e9be[_0x82e9('0xd6')],'subject':_0x15e9be[_0x82e9('0xe0')],'text':_0x48a654[_0x82e9('0x5c')]}},client9003)[_0x82e9('0x23')](function(){return _0x48a654;})[_0x82e9('0x2c')](function(_0x755336){console[_0x82e9('0x29')](_0x755336);});}})['then'](function(){if(_0x48a654){return _0x48a654;}})['then'](respondWithResult(_0x51c913,null))[_0x82e9('0x2c')](handleError(_0x51c913,null));};exports[_0x82e9('0xe1')]=function(_0x1f62c9,_0x52ec84,_0x580ea7){return db[_0x82e9('0xb1')][_0x82e9('0x5f')]({'where':{'id':_0x1f62c9[_0x82e9('0x58')]['id']}})[_0x82e9('0x23')](handleEntityNotFound(_0x52ec84,null))[_0x82e9('0x23')](function(_0xe30233){if(_0xe30233){return _0xe30233[_0x82e9('0xe1')](_0x1f62c9['body'][_0x82e9('0x6b')],_[_0x82e9('0xe2')](_0x1f62c9[_0x82e9('0x5c')],[_0x82e9('0x6b'),'id'])||{});}})[_0x82e9('0x23')](respondWithResult(_0x52ec84,null))[_0x82e9('0x2c')](handleError(_0x52ec84,null));};exports[_0x82e9('0xe3')]=function(_0x309534,_0x10ea41,_0x32fca4){var _0x484f98={'raw':![],'where':{}};var _0x59d42c={};var _0x277239={'count':0x0,'rows':[]};return db[_0x82e9('0x51')][_0x82e9('0x67')]({'where':{'id':_0x309534[_0x82e9('0x58')]['id']}})[_0x82e9('0x23')](handleEntityNotFound(_0x10ea41,null))['then'](function(_0x5df185){if(_0x5df185){_0x59d42c[_0x82e9('0x43')]=_[_0x82e9('0x46')](db['ChatInteraction'][_0x82e9('0x3f')]);_0x59d42c[_0x82e9('0x45')]=_[_0x82e9('0x46')](_0x309534[_0x82e9('0x45')]);_0x59d42c['filters']=_[_0x82e9('0x47')](_0x59d42c[_0x82e9('0x43')],_0x59d42c[_0x82e9('0x45')]);_0x484f98[_0x82e9('0x49')]=_[_0x82e9('0x47')](_0x59d42c[_0x82e9('0x43')],qs[_0x82e9('0x48')](_0x309534[_0x82e9('0x45')]['fields']));_0x484f98[_0x82e9('0x49')]=_0x484f98[_0x82e9('0x49')]['length']?_0x484f98[_0x82e9('0x49')]:_0x59d42c['model'];if(!_0x309534['query'][_0x82e9('0x4a')](_0x82e9('0x68'))){_0x484f98['limit']=qs[_0x82e9('0x31')](_0x309534[_0x82e9('0x45')][_0x82e9('0x31')]);_0x484f98[_0x82e9('0x30')]=qs['offset'](_0x309534[_0x82e9('0x45')][_0x82e9('0x30')]);}_0x484f98[_0x82e9('0x4b')]=qs['sort'](_0x309534[_0x82e9('0x45')][_0x82e9('0x4c')]);_0x484f98[_0x82e9('0x4d')]=qs[_0x82e9('0x4e')](_[_0x82e9('0x6e')](_0x309534['query'],_0x59d42c[_0x82e9('0x4e')]));_0x484f98['where']['ChatWebsiteId']=_0x5df185['id'];if(_0x309534[_0x82e9('0x45')][_0x82e9('0x4f')]){_0x484f98[_0x82e9('0x4d')]=_[_0x82e9('0x50')](_0x484f98[_0x82e9('0x4d')],{'$or':_['map'](_0x484f98[_0x82e9('0x49')],function(_0x33f0f0){var _0x315093={};_0x315093[_0x33f0f0]={'$like':'%'+_0x309534[_0x82e9('0x45')]['filter']+'%'};return _0x315093;})});}_0x484f98=_['merge']({},_0x484f98,_0x309534[_0x82e9('0x5b')]);return db[_0x82e9('0xb1')][_0x82e9('0x52')]({'where':_0x484f98[_0x82e9('0x4d')]})[_0x82e9('0x23')](function(_0x5d28ef){_0x277239[_0x82e9('0x52')]=_0x5d28ef;if(_0x309534[_0x82e9('0x45')][_0x82e9('0x53')]){_0x484f98[_0x82e9('0x54')]=[{'model':db[_0x82e9('0x99')],'as':_0x82e9('0xe4'),'required':![]},{'model':db['User'],'as':_0x82e9('0xe5'),'attributes':[_0x82e9('0x3b'),_0x82e9('0xe6'),_0x82e9('0xe7')],'required':![]},{'model':db[_0x82e9('0xe8')],'as':'Tags','attributes':['id',_0x82e9('0x3b'),_0x82e9('0xe9')],'where':_0x309534[_0x82e9('0x45')][_0x82e9('0xea')]?{'id':_0x309534['query']['tag']}:undefined,'required':_0x309534[_0x82e9('0x45')][_0x82e9('0xea')]?!![]:![]}];}return db[_0x82e9('0xb1')]['findAll'](_0x484f98);})[_0x82e9('0x23')](function(_0x550f3e){_0x277239[_0x82e9('0x56')]=_0x550f3e;return _0x277239;});}})['then'](respondWithFilteredResult(_0x10ea41,_0x484f98))[_0x82e9('0x2c')](handleError(_0x10ea41,null));};function iftimePromise(_0x5ebcf8,_0x405761){return respondWithRpcPromise('Command',_0x82e9('0xeb'),{'command':_0x405761[_0x82e9('0xec')]?util['format'](_0x82e9('0xed'),_0x5ebcf8[_0x82e9('0xee')],_0x405761['timezone']):util[_0x82e9('0xad')](_0x82e9('0xef'),_0x5ebcf8[_0x82e9('0xee')])},client9002)[_0x82e9('0x23')](function(_0x4ba538){var _0x23ad09=_0x4ba538&&_0x4ba538[_0x82e9('0xf0')](_0x82e9('0xf1'))>=0x0?!![]:![];logger['info'](_0x82e9('0xf2'),_0x405761['id'],_0x5ebcf8['id'],_0x5ebcf8[_0x82e9('0xee')],_0x23ad09?'ONLINE':'OFFLINE',_0x405761[_0x82e9('0xec')]?_0x405761[_0x82e9('0xec')]:_0x82e9('0xf3'));return _0x23ad09;})[_0x82e9('0x2c')](function(_0x30d517){logger[_0x82e9('0x29')](_0x82e9('0xf2'),_0x405761['id'],_0x5ebcf8['id'],_0x5ebcf8[_0x82e9('0xee')],util[_0x82e9('0xf4')](_0x30d517,{'showHidden':![],'depth':null}),_0x405761[_0x82e9('0xec')]?_0x405761[_0x82e9('0xec')]:_0x82e9('0xf3'));return![];});}exports[_0x82e9('0xeb')]=function(_0x2e7f4f,_0x499faa,_0x3d02b7){var _0x104a6c=0x0;var _0x5a38b8=0x0;var _0x1a1c72=![];var _0x35836f;var _0xb0ce88;return db[_0x82e9('0x51')][_0x82e9('0x5f')]({'where':{'id':_0x2e7f4f['params']['id']},'include':[{'model':db[_0x82e9('0xf5')],'as':_0x82e9('0xf5'),'include':[{'model':db[_0x82e9('0xf5')],'as':_0x82e9('0xf6'),'attributes':['id',_0x82e9('0xee')],'raw':!![]}]}]})[_0x82e9('0x23')](handleEntityNotFound(_0x499faa,null))['then'](function(_0x131a63){if(_0x131a63){_0x35836f=_0x131a63;return _0x131a63[_0x82e9('0xf7')]({'raw':!![]});}})[_0x82e9('0x23')](function(_0x5c7a48){if(_0x35836f){if(_0x5c7a48){_0xb0ce88=_0x5c7a48;}}return require('../../config/license/util')[_0x82e9('0xf8')]();})[_0x82e9('0x23')](function(_0x31e887){if(_0x31e887){_0x5a38b8=_0x31e887[_0x82e9('0xf9')];_0x1a1c72=_0x31e887[_0x82e9('0x7c')];}})[_0x82e9('0x23')](function(){return db['ChatInteraction'][_0x82e9('0x52')]({'where':{'closed':![]}});})['then'](function(_0x2ac6ad){_0x104a6c=_0x2ac6ad;if(_0x5a38b8&&_0x2ac6ad>_0x5a38b8){return db[_0x82e9('0xfa')][_0x82e9('0x67')]({'where':{'id':0x1}})[_0x82e9('0x23')](function(_0x1061a6){if(_0x1061a6){_0x1061a6[_0x82e9('0xfb')](_0x82e9('0xfc'));}});}})[_0x82e9('0x23')](function(){if(_0x35836f[_0x82e9('0xf5')]&&_0x35836f['Interval'][_0x82e9('0xf6')]){var _0x372c1a=[];for(var _0x26cd75=0x0;_0x26cd75<_0x35836f[_0x82e9('0xf5')][_0x82e9('0xf6')][_0x82e9('0x5a')];_0x26cd75++){var _0x3668dc=_0x35836f[_0x82e9('0xf5')][_0x82e9('0xf6')][_0x26cd75][_0x82e9('0x37')]({'plain':!![]});_0x372c1a[_0x82e9('0xba')](iftimePromise(_0x3668dc,_0x35836f));}return BPromise[_0x82e9('0xfd')](_0x372c1a)[_0x82e9('0x23')](function(_0xfc782){return _[_0x82e9('0xfe')](_0xfc782);});}else{return!![];}})[_0x82e9('0x23')](function(_0x114cc0){var _0x518ecb=fs['readFileSync'](path[_0x82e9('0x79')](config[_0x82e9('0x7e')],_0x82e9('0xff')),'utf8');var _0x101a8e={'remote':_0x35836f[_0x82e9('0x100')],'query':querystring[_0x82e9('0x27')](_[_0x82e9('0x50')](_0x35836f[_0x82e9('0x37')]({'plain':!![]}),{'customerIp':_0x2e7f4f['headers']['x-forwarded-for']||_0x2e7f4f[_0x82e9('0x8a')]['x-real-ip']||_0x2e7f4f[_0x82e9('0x101')]['remoteAddress']||_0x2e7f4f['ip'],'referer':_0x2e7f4f['headers'][_0x82e9('0x102')],'openedInteractions':_0x104a6c,'maxInteractions':_0x5a38b8,'virtual':_0x1a1c72[_0x82e9('0xf9')],'online':_0x114cc0,'custom':_0x1a1c72}))[_0x82e9('0x103')](/'/g,'\x5c\x27')};_0x499faa[_0x82e9('0x3c')](ejs[_0x82e9('0x104')](Mustache[_0x82e9('0x104')](_0x518ecb,_0x101a8e),{'proactiveActions':_0xb0ce88,'alignment':_0x35836f[_0x82e9('0x105')],'verticalAlignment':_0x35836f[_0x82e9('0x106')],'div_color':_0x35836f[_0x82e9('0xe9')],'text_color':_0x35836f[_0x82e9('0x107')]}));})['catch'](handleError(_0x499faa,null));};exports['addApplications']=function(_0x58c45d,_0x238f82,_0x2d651a){return db[_0x82e9('0x51')]['findOne']({'where':{'id':_0x58c45d[_0x82e9('0x58')]['id']}})[_0x82e9('0x23')](handleEntityNotFound(_0x238f82,null))[_0x82e9('0x23')](function(_0x155f43){if(_0x155f43){return db[_0x82e9('0x108')][_0x82e9('0x109')](function(_0x4bc5ac){return db['ChatApplication'][_0x82e9('0x36')]({'where':{'ChatWebsiteId':_0x58c45d[_0x82e9('0x58')]['id']},'transaction':_0x4bc5ac})[_0x82e9('0x23')](function(_0x31b094){var _0x55246c=_['map'](_0x58c45d[_0x82e9('0x5c')],function(_0x215cd6){_0x215cd6[_0x82e9('0x69')]=_0x58c45d[_0x82e9('0x58')]['id'];return _0x215cd6;});return db[_0x82e9('0x9c')][_0x82e9('0x10a')](_0x55246c,{'transaction':_0x4bc5ac});});})[_0x82e9('0x23')](function(){return db['ChatApplication'][_0x82e9('0x10b')]({'where':{'ChatWebsiteId':_0x58c45d[_0x82e9('0x58')]['id']},'order':_0x82e9('0xa0')});});}})[_0x82e9('0x23')](respondWithResult(_0x238f82,null))[_0x82e9('0x2c')](handleError(_0x238f82,null));};exports['getApplications']=function(_0x543f0f,_0x588e05,_0x11db54){var _0xa497d2={};var _0x446d37={};var _0x4f0c13;var _0x30f711;return db[_0x82e9('0x51')][_0x82e9('0x67')]({'where':{'id':_0x543f0f[_0x82e9('0x58')]['id']}})[_0x82e9('0x23')](handleEntityNotFound(_0x588e05,null))[_0x82e9('0x23')](function(_0x3cbbd4){if(_0x3cbbd4){_0x4f0c13=_0x3cbbd4;_0x446d37[_0x82e9('0x43')]=_[_0x82e9('0x46')](db[_0x82e9('0x9c')][_0x82e9('0x3f')]);_0x446d37[_0x82e9('0x45')]=_['keys'](_0x543f0f['query']);_0x446d37[_0x82e9('0x4e')]=_['intersection'](_0x446d37['model'],_0x446d37[_0x82e9('0x45')]);_0xa497d2['attributes']=_[_0x82e9('0x47')](_0x446d37[_0x82e9('0x43')],qs[_0x82e9('0x48')](_0x543f0f[_0x82e9('0x45')][_0x82e9('0x48')]));_0xa497d2[_0x82e9('0x49')]=_0xa497d2['attributes']['length']?_0xa497d2[_0x82e9('0x49')]:_0x446d37[_0x82e9('0x43')];_0xa497d2['order']=qs[_0x82e9('0x4c')](_0x543f0f[_0x82e9('0x45')]['sort']);_0xa497d2[_0x82e9('0x4d')]=qs[_0x82e9('0x4e')](_[_0x82e9('0x6e')](_0x543f0f[_0x82e9('0x45')],_0x446d37['filters']));if(_0x543f0f[_0x82e9('0x45')][_0x82e9('0x4f')]){_0xa497d2[_0x82e9('0x4d')]=_[_0x82e9('0x50')](_0xa497d2[_0x82e9('0x4d')],{'$or':_[_0x82e9('0x44')](_0xa497d2[_0x82e9('0x49')],function(_0x50dfe2){var _0x3373c9={};_0x3373c9[_0x50dfe2]={'$like':'%'+_0x543f0f[_0x82e9('0x45')][_0x82e9('0x4f')]+'%'};return _0x3373c9;})});}_0xa497d2=_[_0x82e9('0x50')]({},_0xa497d2,_0x543f0f[_0x82e9('0x5b')]);return _0x4f0c13[_0x82e9('0x10c')](_0xa497d2);}})[_0x82e9('0x23')](function(_0x53bb37){if(_0x53bb37){_0x30f711=_0x53bb37['length'];if(!_0x543f0f[_0x82e9('0x45')]['hasOwnProperty'](_0x82e9('0x68'))){_0xa497d2[_0x82e9('0x31')]=qs[_0x82e9('0x31')](_0x543f0f['query'][_0x82e9('0x31')]);_0xa497d2[_0x82e9('0x30')]=qs[_0x82e9('0x30')](_0x543f0f['query'][_0x82e9('0x30')]);}return _0x4f0c13[_0x82e9('0x10c')](_0xa497d2);}})[_0x82e9('0x23')](function(_0x2c90ae){if(_0x2c90ae){return _0x2c90ae?{'count':_0x30f711,'rows':_0x2c90ae}:null;}})[_0x82e9('0x23')](respondWithResult(_0x588e05,null))['catch'](handleError(_0x588e05,null));};exports[_0x82e9('0x10d')]=function(_0x3e0551,_0x388cf9,_0x5f4af3){return db[_0x82e9('0x10e')]['find']({'where':{'id':_0x3e0551[_0x82e9('0x58')]['id']}})['then'](handleEntityNotFound(_0x388cf9,null))[_0x82e9('0x23')](function(_0x4d77d7){if(_0x4d77d7){return _0x4d77d7[_0x82e9('0x10d')](_0x3e0551['body'][_0x82e9('0x6b')],_[_0x82e9('0xe2')](_0x3e0551[_0x82e9('0x5c')],['ids','id'])||{});}})[_0x82e9('0x23')](respondWithResult(_0x388cf9,null))[_0x82e9('0x2c')](handleError(_0x388cf9,null));};exports[_0x82e9('0xf7')]=function(_0x213369,_0x259a6d,_0x1ff35a){var _0x5f0fc3={};var _0x5a9f0f={};var _0x12736d;var _0x175358;return db[_0x82e9('0x51')][_0x82e9('0x67')]({'where':{'id':_0x213369[_0x82e9('0x58')]['id']}})['then'](handleEntityNotFound(_0x259a6d,null))[_0x82e9('0x23')](function(_0x54748f){if(_0x54748f){_0x12736d=_0x54748f;_0x5a9f0f[_0x82e9('0x43')]=_[_0x82e9('0x46')](db[_0x82e9('0x10f')][_0x82e9('0x3f')]);_0x5a9f0f[_0x82e9('0x45')]=_['keys'](_0x213369['query']);_0x5a9f0f[_0x82e9('0x4e')]=_['intersection'](_0x5a9f0f[_0x82e9('0x43')],_0x5a9f0f[_0x82e9('0x45')]);_0x5f0fc3['attributes']=_[_0x82e9('0x47')](_0x5a9f0f[_0x82e9('0x43')],qs[_0x82e9('0x48')](_0x213369['query'][_0x82e9('0x48')]));_0x5f0fc3['attributes']=_0x5f0fc3[_0x82e9('0x49')][_0x82e9('0x5a')]?_0x5f0fc3[_0x82e9('0x49')]:_0x5a9f0f[_0x82e9('0x43')];_0x5f0fc3[_0x82e9('0x4b')]=qs[_0x82e9('0x4c')](_0x213369[_0x82e9('0x45')][_0x82e9('0x4c')]);_0x5f0fc3[_0x82e9('0x4d')]=qs['filters'](_[_0x82e9('0x6e')](_0x213369['query'],_0x5a9f0f['filters']));if(_0x213369['query'][_0x82e9('0x4f')]){_0x5f0fc3[_0x82e9('0x4d')]=_[_0x82e9('0x50')](_0x5f0fc3[_0x82e9('0x4d')],{'$or':_[_0x82e9('0x44')](_0x5f0fc3[_0x82e9('0x49')],function(_0x2417bd){var _0x5e8da0={};_0x5e8da0[_0x2417bd]={'$like':'%'+_0x213369[_0x82e9('0x45')]['filter']+'%'};return _0x5e8da0;})});}_0x5f0fc3=_['merge']({},_0x5f0fc3,_0x213369[_0x82e9('0x5b')]);return _0x12736d['getProactiveActions'](_0x5f0fc3);}})[_0x82e9('0x23')](function(_0x6025bc){if(_0x6025bc){_0x175358=_0x6025bc[_0x82e9('0x5a')];if(!_0x213369[_0x82e9('0x45')][_0x82e9('0x4a')]('nolimit')){_0x5f0fc3[_0x82e9('0x31')]=qs[_0x82e9('0x31')](_0x213369[_0x82e9('0x45')][_0x82e9('0x31')]);_0x5f0fc3[_0x82e9('0x30')]=qs[_0x82e9('0x30')](_0x213369[_0x82e9('0x45')]['offset']);}return _0x12736d[_0x82e9('0xf7')](_0x5f0fc3);}})[_0x82e9('0x23')](function(_0x1992d1){if(_0x1992d1){return _0x1992d1?{'count':_0x175358,'rows':_0x1992d1}:null;}})[_0x82e9('0x23')](respondWithResult(_0x259a6d,null))[_0x82e9('0x2c')](handleError(_0x259a6d,null));};exports[_0x82e9('0x110')]=function(_0x4d4df8,_0x150f29,_0x19ca5f){var _0x40f67c=_0x4d4df8[_0x82e9('0x45')][_0x82e9('0x111')]===_0x82e9('0x112')?_0x82e9('0x113'):_0x82e9('0x114');return db[_0x82e9('0x51')][_0x82e9('0x5f')]({'attributes':['id',_0x40f67c],'where':{'id':_0x4d4df8[_0x82e9('0x58')]['id']}})[_0x82e9('0x23')](handleEntityNotFound(_0x150f29,null))[_0x82e9('0x23')](function(_0x307455){if(_0x307455){var _0x4cbb4a=_0x307455[_0x40f67c];var _0x1ebaf0=_0x4cbb4a&&_0x4cbb4a[_0x82e9('0x115')]?_0x4cbb4a[_0x82e9('0x115')]:[];_0x150f29[_0x82e9('0x3c')]({'fromKey':_[_0x82e9('0x81')](_0x4cbb4a[_0x82e9('0x116')])?undefined:_0x4cbb4a[_0x82e9('0x116')],'count':_0x1ebaf0[_0x82e9('0x5a')],'rows':_0x1ebaf0});}})['catch'](handleError(_0x150f29,null));};exports[_0x82e9('0x117')]=function(_0x2193b0,_0x34b5be,_0x14aa4e){var _0x348d8d={'raw':![],'where':{}};var _0x381823={};var _0xa48027={'count':0x0,'rows':[]};return db[_0x82e9('0x51')][_0x82e9('0x67')]({'where':{'id':_0x2193b0[_0x82e9('0x58')]['id']}})[_0x82e9('0x23')](handleEntityNotFound(_0x34b5be,null))['then'](function(_0x3d4d91){if(_0x3d4d91){_0x381823[_0x82e9('0x43')]=_[_0x82e9('0x46')](db[_0x82e9('0x118')][_0x82e9('0x3f')]);_0x381823['query']=_[_0x82e9('0x46')](_0x2193b0[_0x82e9('0x45')]);_0x381823[_0x82e9('0x4e')]=_['intersection'](_0x381823[_0x82e9('0x43')],_0x381823[_0x82e9('0x45')]);_0x348d8d['attributes']=_[_0x82e9('0x47')](_0x381823[_0x82e9('0x43')],qs[_0x82e9('0x48')](_0x2193b0[_0x82e9('0x45')][_0x82e9('0x48')]));_0x348d8d[_0x82e9('0x49')]=_0x348d8d[_0x82e9('0x49')][_0x82e9('0x5a')]?_0x348d8d['attributes']:_0x381823[_0x82e9('0x43')];if(!_0x2193b0[_0x82e9('0x45')][_0x82e9('0x4a')](_0x82e9('0x68'))){_0x348d8d['limit']=qs[_0x82e9('0x31')](_0x2193b0[_0x82e9('0x45')][_0x82e9('0x31')]);_0x348d8d[_0x82e9('0x30')]=qs[_0x82e9('0x30')](_0x2193b0[_0x82e9('0x45')]['offset']);}_0x348d8d[_0x82e9('0x4b')]=qs[_0x82e9('0x4c')](_0x2193b0[_0x82e9('0x45')][_0x82e9('0x4c')]);_0x348d8d[_0x82e9('0x4d')]=qs['filters'](_[_0x82e9('0x6e')](_0x2193b0[_0x82e9('0x45')],_0x381823['filters']));_0x348d8d[_0x82e9('0x4d')]['ChatWebsiteId']=_0x3d4d91['id'];if(_0x2193b0[_0x82e9('0x45')][_0x82e9('0x4f')]){_0x348d8d[_0x82e9('0x4d')]=_[_0x82e9('0x50')](_0x348d8d['where'],{'$or':_[_0x82e9('0x44')](_0x348d8d[_0x82e9('0x49')],function(_0x3d4905){var _0x3cd804={};_0x3cd804[_0x3d4905]={'$like':'%'+_0x2193b0['query'][_0x82e9('0x4f')]+'%'};return _0x3cd804;})});}_0x348d8d=_[_0x82e9('0x50')]({},_0x348d8d,_0x2193b0[_0x82e9('0x5b')]);return db[_0x82e9('0x118')][_0x82e9('0x52')]({'where':_0x348d8d[_0x82e9('0x4d')]})[_0x82e9('0x23')](function(_0x488ff3){_0xa48027[_0x82e9('0x52')]=_0x488ff3;if(_0x2193b0['query']['includeAll']){_0x348d8d[_0x82e9('0x54')]=[{'all':!![]}];}else{_0x348d8d[_0x82e9('0x54')]=[{'model':db['CmContact'],'as':_0x82e9('0xe4'),'required':![]}];}return db[_0x82e9('0x118')][_0x82e9('0x55')](_0x348d8d);})[_0x82e9('0x23')](function(_0x318c59){_0xa48027[_0x82e9('0x56')]=_0x318c59;return _0xa48027;});}})['then'](respondWithFilteredResult(_0x34b5be,_0x348d8d))[_0x82e9('0x2c')](handleError(_0x34b5be,null));};exports[_0x82e9('0x119')]=function(_0x189025,_0x22274a,_0x31b83c){return db[_0x82e9('0x51')][_0x82e9('0x5f')]({'where':{'id':_0x189025[_0x82e9('0x58')]['id']}})[_0x82e9('0x23')](handleEntityNotFound(_0x22274a,null))['then'](function(_0x155140){if(_0x155140){return _0x155140[_0x82e9('0x119')](_0x189025[_0x82e9('0x5c')][_0x82e9('0x6b')],_['omit'](_0x189025['body'],[_0x82e9('0x6b'),'id'])||{})['spread'](function(_0x26c3e1){for(var _0x3ae079=0x0;_0x3ae079<_0x189025[_0x82e9('0x5c')][_0x82e9('0x6b')][_0x82e9('0x5a')];_0x3ae079+=0x1){socket[_0x82e9('0x11a')]('userChatWebsite:save',{'UserId':_0x189025[_0x82e9('0x5c')][_0x82e9('0x6b')][_0x3ae079],'ChatWebsiteId':_0x189025[_0x82e9('0x58')]['id']});}return _0x26c3e1;});}})[_0x82e9('0x23')](respondWithResult(_0x22274a,null))['catch'](handleError(_0x22274a,null));};exports[_0x82e9('0x11b')]=function(_0x3e0324,_0x209417,_0x392cd2){return db[_0x82e9('0x51')][_0x82e9('0x5f')]({'where':{'id':_0x3e0324[_0x82e9('0x58')]['id']}})[_0x82e9('0x23')](handleEntityNotFound(_0x209417,null))[_0x82e9('0x23')](function(_0xf8ac11){if(_0xf8ac11){return _0xf8ac11['removeAgents'](_0x3e0324[_0x82e9('0x45')][_0x82e9('0x6b')])[_0x82e9('0x23')](function(){if(_[_0x82e9('0x11c')](_0x3e0324[_0x82e9('0x45')]['ids'])){for(var _0x1c3bab=0x0;_0x1c3bab<_0x3e0324['query']['ids']['length'];_0x1c3bab+=0x1){socket[_0x82e9('0x11a')](_0x82e9('0x11d'),{'UserId':Number(_0x3e0324[_0x82e9('0x45')][_0x82e9('0x6b')][_0x1c3bab]),'ChatWebsiteId':Number(_0x3e0324[_0x82e9('0x58')]['id'])});}}else{socket['emit']('userChatWebsite:remove',{'UserId':Number(_0x3e0324[_0x82e9('0x45')][_0x82e9('0x6b')]),'ChatWebsiteId':Number(_0x3e0324['params']['id'])});}});}})[_0x82e9('0x23')](respondWithStatusCode(_0x209417,null))[_0x82e9('0x2c')](handleError(_0x209417,null));};exports['getAgents']=function(_0x379254,_0x5721ce,_0x460c88){var _0x21fff7={};var _0x5e2c94={};var _0x296fde;var _0xd121f9;return db[_0x82e9('0x51')]['findOne']({'where':{'id':_0x379254[_0x82e9('0x58')]['id']}})[_0x82e9('0x23')](handleEntityNotFound(_0x5721ce,null))[_0x82e9('0x23')](function(_0x5f1609){if(_0x5f1609){_0x296fde=_0x5f1609;_0x5e2c94[_0x82e9('0x43')]=_[_0x82e9('0x46')](db[_0x82e9('0xc0')]['rawAttributes']);_0x5e2c94[_0x82e9('0x45')]=_[_0x82e9('0x46')](_0x379254[_0x82e9('0x45')]);_0x5e2c94[_0x82e9('0x4e')]=_[_0x82e9('0x47')](_0x5e2c94['model'],_0x5e2c94[_0x82e9('0x45')]);_0x21fff7[_0x82e9('0x49')]=_[_0x82e9('0x47')](_0x5e2c94[_0x82e9('0x43')],qs[_0x82e9('0x48')](_0x379254['query']['fields']));_0x21fff7['attributes']=_0x21fff7[_0x82e9('0x49')][_0x82e9('0x5a')]?_0x21fff7[_0x82e9('0x49')]:_0x5e2c94[_0x82e9('0x43')];_0x21fff7[_0x82e9('0x4b')]=qs[_0x82e9('0x4c')](_0x379254[_0x82e9('0x45')][_0x82e9('0x4c')]);_0x21fff7[_0x82e9('0x4d')]=qs['filters'](_[_0x82e9('0x6e')](_0x379254[_0x82e9('0x45')],_0x5e2c94[_0x82e9('0x4e')]));if(_0x379254['query'][_0x82e9('0x4f')]){_0x21fff7[_0x82e9('0x4d')]=_[_0x82e9('0x50')](_0x21fff7[_0x82e9('0x4d')],{'$or':_[_0x82e9('0x44')](_0x21fff7['attributes'],function(_0x5db989){var _0x22170d={};_0x22170d[_0x5db989]={'$like':'%'+_0x379254['query'][_0x82e9('0x4f')]+'%'};return _0x22170d;})});}_0x21fff7=_[_0x82e9('0x50')]({},_0x21fff7,_0x379254[_0x82e9('0x5b')]);return _0x296fde['getAgents'](_0x21fff7);}})[_0x82e9('0x23')](function(_0x228ee3){if(_0x228ee3){_0xd121f9=_0x228ee3[_0x82e9('0x5a')];if(!_0x379254[_0x82e9('0x45')][_0x82e9('0x4a')](_0x82e9('0x68'))){_0x21fff7['limit']=qs['limit'](_0x379254[_0x82e9('0x45')][_0x82e9('0x31')]);_0x21fff7[_0x82e9('0x30')]=qs['offset'](_0x379254[_0x82e9('0x45')][_0x82e9('0x30')]);}return _0x296fde['getAgents'](_0x21fff7);}})[_0x82e9('0x23')](function(_0x18ac21){if(_0x18ac21){return _0x18ac21?{'count':_0xd121f9,'rows':_0x18ac21}:null;}})[_0x82e9('0x23')](respondWithResult(_0x5721ce,null))[_0x82e9('0x2c')](handleError(_0x5721ce,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 694915c..bb60d48 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 _0xd737=['save','update','remove','emit','hasOwnProperty','hook','exports','events','ChatWebsite'];(function(_0x116d94,_0x2e863d){var _0x3bdb66=function(_0x259681){while(--_0x259681){_0x116d94['push'](_0x116d94['shift']());}};_0x3bdb66(++_0x2e863d);}(_0xd737,0x85));var _0x7d73=function(_0x2803ab,_0x1c33f2){_0x2803ab=_0x2803ab-0x0;var _0x3d6e8e=_0xd737[_0x2803ab];return _0x3d6e8e;};'use strict';var EventEmitter=require(_0x7d73('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0x7d73('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7d73('0x2'),'afterUpdate':_0x7d73('0x3'),'afterDestroy':_0x7d73('0x4')};function emitEvent(_0x5cfa01){return function(_0x5369be,_0x3e19ad,_0x493f54){ChatWebsiteEvents['emit'](_0x5cfa01+':'+_0x5369be['id'],_0x5369be);ChatWebsiteEvents[_0x7d73('0x5')](_0x5cfa01,_0x5369be);_0x493f54(null);};}for(var e in events){if(events[_0x7d73('0x6')](e)){var event=events[e];ChatWebsite[_0x7d73('0x7')](e,emitEvent(event));}}module[_0x7d73('0x8')]=ChatWebsiteEvents; \ No newline at end of file +var _0x5292=['hook','exports','events','../../mysqldb','setMaxListeners','update','remove'];(function(_0x2df20c,_0x2cbddb){var _0x1d4066=function(_0x28d566){while(--_0x28d566){_0x2df20c['push'](_0x2df20c['shift']());}};_0x1d4066(++_0x2cbddb);}(_0x5292,0xf7));var _0x2529=function(_0x53dd63,_0x5e1852){_0x53dd63=_0x53dd63-0x0;var _0x460c0a=_0x5292[_0x53dd63];return _0x460c0a;};'use strict';var EventEmitter=require(_0x2529('0x0'));var ChatWebsite=require(_0x2529('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x2529('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2529('0x3'),'afterDestroy':_0x2529('0x4')};function emitEvent(_0x29576c){return function(_0x228165,_0x5d25dc,_0x28c08d){ChatWebsiteEvents['emit'](_0x29576c+':'+_0x228165['id'],_0x228165);ChatWebsiteEvents['emit'](_0x29576c,_0x228165);_0x28c08d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0x2529('0x5')](e,emitEvent(event));}}module[_0x2529('0x6')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 43cd3e1..aaa38f3 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 _0x5423=['request-promise','path','rimraf','../../config/environment','exports','define','ChatWebsite','lodash','util','api','moment'];(function(_0x5b9039,_0x5b2edb){var _0x21e499=function(_0x20c88d){while(--_0x20c88d){_0x5b9039['push'](_0x5b9039['shift']());}};_0x21e499(++_0x5b2edb);}(_0x5423,0xe3));var _0x3542=function(_0x5dc89f,_0x4411bc){_0x5dc89f=_0x5dc89f-0x0;var _0x5115e4=_0x5423[_0x5dc89f];return _0x5115e4;};'use strict';var _=require(_0x3542('0x0'));var util=require(_0x3542('0x1'));var logger=require('../../config/logger')(_0x3542('0x2'));var moment=require(_0x3542('0x3'));var BPromise=require('bluebird');var rp=require(_0x3542('0x4'));var fs=require('fs');var path=require(_0x3542('0x5'));var rimraf=require(_0x3542('0x6'));var config=require(_0x3542('0x7'));var attributes=require('./chatWebsite.attributes');module[_0x3542('0x8')]=function(_0x2d2ae9,_0x15ee3b){return _0x2d2ae9[_0x3542('0x9')](_0x3542('0xa'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0c5d=['api','bluebird','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','define','lodash','util'];(function(_0xefb67b,_0x18fac7){var _0x23a717=function(_0x2762e1){while(--_0x2762e1){_0xefb67b['push'](_0xefb67b['shift']());}};_0x23a717(++_0x18fac7);}(_0x0c5d,0x6c));var _0xd0c5=function(_0x1e9ed6,_0x5edb40){_0x1e9ed6=_0x1e9ed6-0x0;var _0x33fe8b=_0x0c5d[_0x1e9ed6];return _0x33fe8b;};'use strict';var _=require(_0xd0c5('0x0'));var util=require(_0xd0c5('0x1'));var logger=require('../../config/logger')(_0xd0c5('0x2'));var moment=require('moment');var BPromise=require(_0xd0c5('0x3'));var rp=require(_0xd0c5('0x4'));var fs=require('fs');var path=require(_0xd0c5('0x5'));var rimraf=require(_0xd0c5('0x6'));var config=require(_0xd0c5('0x7'));var attributes=require(_0xd0c5('0x8'));module[_0xd0c5('0x9')]=function(_0x121911,_0x569992){return _0x121911[_0xd0c5('0xa')]('ChatWebsite',attributes,{'tableName':'chat_websites','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 68083dd..d2deab3 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 _0xfcf0=['ChatWebsite,\x20%s,\x20%s','message','info','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','request\x20sent','debug','stringify','error','code'];(function(_0x340d17,_0x3d6339){var _0x4a18d1=function(_0x50d179){while(--_0x50d179){_0x340d17['push'](_0x340d17['shift']());}};_0x4a18d1(++_0x3d6339);}(_0xfcf0,0x138));var _0x0fcf=function(_0x5e2cb4,_0x592c64){_0x5e2cb4=_0x5e2cb4-0x0;var _0x282902=_0xfcf0[_0x5e2cb4];return _0x282902;};'use strict';var _=require(_0x0fcf('0x0'));var util=require(_0x0fcf('0x1'));var moment=require('moment');var BPromise=require(_0x0fcf('0x2'));var rs=require(_0x0fcf('0x3'));var fs=require('fs');var Redis=require(_0x0fcf('0x4'));var db=require(_0x0fcf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0fcf('0x6'))(_0x0fcf('0x7'));var config=require(_0x0fcf('0x8'));var jayson=require(_0x0fcf('0x9'));var client=jayson[_0x0fcf('0xa')][_0x0fcf('0xb')]({'port':0x232a});config[_0x0fcf('0xc')]=_[_0x0fcf('0xd')](config['redis'],{'host':_0x0fcf('0xe'),'port':0x18eb});var socket=require(_0x0fcf('0xf'))(new Redis(config[_0x0fcf('0xc')]));require('./chatWebsite.socket')[_0x0fcf('0x10')](socket);function respondWithRpcPromise(_0x7ac7bd,_0x239e5d,_0x4b3923){return new BPromise(function(_0x369959,_0x5c29ed){return client[_0x0fcf('0x11')](_0x7ac7bd,_0x4b3923)[_0x0fcf('0x12')](function(_0x201a58){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x239e5d,_0x0fcf('0x13'));logger[_0x0fcf('0x14')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x239e5d,_0x0fcf('0x13'),JSON[_0x0fcf('0x15')](_0x201a58));if(_0x201a58[_0x0fcf('0x16')]){if(_0x201a58[_0x0fcf('0x16')][_0x0fcf('0x17')]===0x1f4){logger['error'](_0x0fcf('0x18'),_0x239e5d,_0x201a58[_0x0fcf('0x16')][_0x0fcf('0x19')]);return _0x5c29ed(_0x201a58['error'][_0x0fcf('0x19')]);}logger[_0x0fcf('0x16')](_0x0fcf('0x18'),_0x239e5d,_0x201a58[_0x0fcf('0x16')]['message']);return _0x369959(_0x201a58[_0x0fcf('0x16')][_0x0fcf('0x19')]);}else{logger[_0x0fcf('0x1a')](_0x0fcf('0x18'),_0x239e5d,_0x0fcf('0x13'));_0x369959(_0x201a58['result'][_0x0fcf('0x19')]);}})[_0x0fcf('0x1b')](function(_0x5dad87){logger[_0x0fcf('0x16')](_0x0fcf('0x18'),_0x239e5d,_0x5dad87);_0x5c29ed(_0x5dad87);});});} \ No newline at end of file +var _0x0598=['result','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','register','then','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','info'];(function(_0xf8865,_0x43f369){var _0x3bfa52=function(_0x550452){while(--_0x550452){_0xf8865['push'](_0xf8865['shift']());}};_0x3bfa52(++_0x43f369);}(_0x0598,0x92));var _0x8059=function(_0x1b048d,_0x5c3e49){_0x1b048d=_0x1b048d-0x0;var _0x52e77a=_0x0598[_0x1b048d];return _0x52e77a;};'use strict';var _=require(_0x8059('0x0'));var util=require(_0x8059('0x1'));var moment=require('moment');var BPromise=require(_0x8059('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8059('0x3'))['db'];var utils=require(_0x8059('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x8059('0x5'));var client=jayson[_0x8059('0x6')]['http']({'port':0x232a});config['redis']=_[_0x8059('0x7')](config[_0x8059('0x8')],{'host':_0x8059('0x9'),'port':0x18eb});var socket=require(_0x8059('0xa'))(new Redis(config['redis']));require('./chatWebsite.socket')[_0x8059('0xb')](socket);function respondWithRpcPromise(_0x1bf5fd,_0x336f85,_0x5097d6){return new BPromise(function(_0x283b63,_0x52a60d){return client['request'](_0x1bf5fd,_0x5097d6)[_0x8059('0xc')](function(_0x4109a9){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x336f85,'request\x20sent');logger[_0x8059('0xd')](_0x8059('0xe'),_0x336f85,_0x8059('0xf'),JSON[_0x8059('0x10')](_0x4109a9));if(_0x4109a9[_0x8059('0x11')]){if(_0x4109a9['error'][_0x8059('0x12')]===0x1f4){logger['error'](_0x8059('0x13'),_0x336f85,_0x4109a9['error'][_0x8059('0x14')]);return _0x52a60d(_0x4109a9[_0x8059('0x11')][_0x8059('0x14')]);}logger['error']('ChatWebsite,\x20%s,\x20%s',_0x336f85,_0x4109a9['error'][_0x8059('0x14')]);return _0x283b63(_0x4109a9[_0x8059('0x11')][_0x8059('0x14')]);}else{logger[_0x8059('0x15')](_0x8059('0x13'),_0x336f85,'request\x20sent');_0x283b63(_0x4109a9[_0x8059('0x16')][_0x8059('0x14')]);}})[_0x8059('0x17')](function(_0x1c4566){logger['error'](_0x8059('0x13'),_0x336f85,_0x1c4566);_0x52a60d(_0x1c4566);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index ef07137..d250a7a 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(_0x171e4d,_0x4f2493){var _0x2d2bf4=function(_0x3a74cc){while(--_0x3a74cc){_0x171e4d['push'](_0x171e4d['shift']());}};_0x2d2bf4(++_0x4f2493);}(_0x5f2f,0x73));var _0xf5f2=function(_0x221700,_0x57af01){_0x221700=_0x221700-0x0;var _0x185e8f=_0x5f2f[_0x221700];return _0x185e8f;};'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 _0xb10b=['emit','removeListener','register','chatWebsite:','./chatWebsite.events','remove','update'];(function(_0x310a23,_0x49f6b5){var _0x50fe57=function(_0x46305d){while(--_0x46305d){_0x310a23['push'](_0x310a23['shift']());}};_0x50fe57(++_0x49f6b5);}(_0xb10b,0x12a));var _0xbb10=function(_0x337d97,_0x19c381){_0x337d97=_0x337d97-0x0;var _0x53aa89=_0xb10b[_0x337d97];return _0x53aa89;};'use strict';var ChatWebsiteEvents=require(_0xbb10('0x0'));var events=['save',_0xbb10('0x1'),_0xbb10('0x2')];function createListener(_0x1dcb08,_0x4d688c){return function(_0x4541ae){_0x4d688c[_0xbb10('0x3')](_0x1dcb08,_0x4541ae);};}function removeListener(_0x460981,_0x22320e){return function(){ChatWebsiteEvents[_0xbb10('0x4')](_0x460981,_0x22320e);};}exports[_0xbb10('0x5')]=function(_0x481979){for(var _0x328583=0x0,_0x3cdd53=events['length'];_0x328583<_0x3cdd53;_0x328583++){var _0x1b9e94=events[_0x328583];var _0x3fb675=createListener(_0xbb10('0x6')+_0x1b9e94,_0x481979);ChatWebsiteEvents['on'](_0x1b9e94,_0x3fb675);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 928ab2c..fe34739 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 _0x00e1=['getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','getSnippet','getProactiveActions','getFields','getOfflineMessages','getAgents','post','create','diskStorage','join','root','format','%s-%s','now','file','addLogo','originalname','/:id/avatar','single','addAvatar','notify','/:id/offline','offline','addInteraction','/:id/applications','/:id/proactive_actions','addProactiveActions','/:id/users','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','isAuthenticated','index','get','/describe','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo'];(function(_0x1ec883,_0x41eafe){var _0x2f1387=function(_0x24913f){while(--_0x24913f){_0x1ec883['push'](_0x1ec883['shift']());}};_0x2f1387(++_0x41eafe);}(_0x00e1,0x160));var _0x100e=function(_0x2ec226,_0x1bde56){_0x2ec226=_0x2ec226-0x0;var _0x20f363=_0x00e1[_0x2ec226];return _0x20f363;};'use strict';var multer=require(_0x100e('0x0'));var util=require(_0x100e('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x100e('0x2'));var router=express[_0x100e('0x3')]();var auth=require(_0x100e('0x4'));var interaction=require(_0x100e('0x5'));var config=require(_0x100e('0x6'));var controller=require(_0x100e('0x7'));router['get']('/',auth[_0x100e('0x8')](),controller[_0x100e('0x9')]);router[_0x100e('0xa')](_0x100e('0xb'),auth[_0x100e('0x8')](),controller[_0x100e('0xc')]);router[_0x100e('0xa')]('/:id',auth[_0x100e('0x8')](),controller[_0x100e('0xd')]);router[_0x100e('0xa')](_0x100e('0xe'),auth[_0x100e('0x8')](),controller[_0x100e('0xf')]);router[_0x100e('0xa')](_0x100e('0x10'),auth['isAuthenticated'](),controller[_0x100e('0x11')]);router['get'](_0x100e('0x12'),controller[_0x100e('0x13')]);router[_0x100e('0xa')]('/:id/avatar',controller[_0x100e('0x14')]);router[_0x100e('0xa')](_0x100e('0x15'),controller[_0x100e('0x16')]);router[_0x100e('0xa')](_0x100e('0x17'),controller[_0x100e('0x18')]);router[_0x100e('0xa')]('/:id/interactions',auth['isAuthenticated'](),controller['getInteractions']);router[_0x100e('0xa')]('/:id/snippet',controller[_0x100e('0x19')]);router[_0x100e('0xa')]('/:id/applications',auth[_0x100e('0x8')](),controller['getApplications']);router[_0x100e('0xa')]('/:id/proactive_actions',auth[_0x100e('0x8')](),controller[_0x100e('0x1a')]);router[_0x100e('0xa')]('/:id/fields',controller[_0x100e('0x1b')]);router[_0x100e('0xa')]('/:id/offline_messages',auth[_0x100e('0x8')](),controller[_0x100e('0x1c')]);router['get']('/:id/users',auth[_0x100e('0x8')](),controller[_0x100e('0x1d')]);router[_0x100e('0x1e')]('/',auth['isAuthenticated'](),controller[_0x100e('0x1f')]);router[_0x100e('0x1e')]('/:id/dispositions',auth[_0x100e('0x8')](),controller['addDisposition']);router[_0x100e('0x1e')]('/:id/canned_answers',auth[_0x100e('0x8')](),controller['addAnswer']);var upload=multer({'storage':multer[_0x100e('0x20')]({'destination':function(_0x53bd8a,_0xa77932,_0xf3dd6f){_0xf3dd6f(null,path[_0x100e('0x21')](config[_0x100e('0x22')],'server/files/images/logos/'));},'filename':function(_0x147f64,_0x51a1d0,_0x37cf99){_0x37cf99(null,util[_0x100e('0x23')](_0x100e('0x24'),Date[_0x100e('0x25')](),_0x51a1d0['originalname']));}})});router[_0x100e('0x1e')](_0x100e('0x12'),upload['single'](_0x100e('0x26')),controller[_0x100e('0x27')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x22c778,_0x3ef220,_0x5e56e9){_0x5e56e9(null,path[_0x100e('0x21')](config[_0x100e('0x22')],'server/files/images/avatars/'));},'filename':function(_0x4d591a,_0x393f01,_0x3a8400){_0x3a8400(null,util[_0x100e('0x23')]('%s-%s',Date[_0x100e('0x25')](),_0x393f01[_0x100e('0x28')]));}})});router[_0x100e('0x1e')](_0x100e('0x29'),upload[_0x100e('0x2a')]('file'),controller[_0x100e('0x2b')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5b81b2,_0x524d59,_0x35f2a5){_0x35f2a5(null,path[_0x100e('0x21')](config[_0x100e('0x22')],'server/files/images/avatars/'));},'filename':function(_0x24430d,_0x46ed33,_0x2d6e88){_0x2d6e88(null,util['format'](_0x100e('0x24'),Date[_0x100e('0x25')](),_0x46ed33[_0x100e('0x28')]));}})});router['post']('/:id/customer_avatar',upload['single'](_0x100e('0x26')),controller['addCustomerAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x19667b,_0x1fb479,_0x24d697){_0x24d697(null,path[_0x100e('0x21')](config['root'],'server/files/images/avatars/'));},'filename':function(_0x16e94f,_0x495448,_0x455142){_0x455142(null,util[_0x100e('0x23')](_0x100e('0x24'),Date[_0x100e('0x25')](),_0x495448[_0x100e('0x28')]));}})});router[_0x100e('0x1e')](_0x100e('0x17'),upload[_0x100e('0x2a')](_0x100e('0x26')),controller['addSystemAvatar']);router[_0x100e('0x1e')]('/:id/notify',controller[_0x100e('0x2c')]);router['post'](_0x100e('0x2d'),controller[_0x100e('0x2e')]);router[_0x100e('0x1e')]('/:id/interactions',auth[_0x100e('0x8')](),controller[_0x100e('0x2f')]);router[_0x100e('0x1e')](_0x100e('0x30'),auth[_0x100e('0x8')](),controller['addApplications']);router['post'](_0x100e('0x31'),auth[_0x100e('0x8')](),controller[_0x100e('0x32')]);router[_0x100e('0x1e')](_0x100e('0x33'),auth[_0x100e('0x8')](),controller[_0x100e('0x34')]);router[_0x100e('0x35')](_0x100e('0x36'),auth[_0x100e('0x8')](),controller[_0x100e('0x37')]);router['delete'](_0x100e('0x36'),auth[_0x100e('0x8')](),controller[_0x100e('0x38')]);router[_0x100e('0x39')](_0x100e('0xe'),auth[_0x100e('0x8')](),controller[_0x100e('0x3a')]);router[_0x100e('0x39')](_0x100e('0x10'),auth['isAuthenticated'](),controller[_0x100e('0x3b')]);router[_0x100e('0x39')]('/:id/users',auth[_0x100e('0x8')](),controller[_0x100e('0x3c')]);module[_0x100e('0x3d')]=router; \ No newline at end of file +var _0xb346=['create','addDisposition','addAnswer','diskStorage','server/files/images/logos/','format','%s-%s','now','single','file','join','root','server/files/images/avatars/','originalname','addAvatar','addSystemAvatar','/:id/notify','notify','offline','addInteraction','put','delete','removeDispositions','/:id/canned_answers','removeAnswers','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','isAuthenticated','describe','get','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','getSnippet','getApplications','/:id/proactive_actions','getProactiveActions','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','post'];(function(_0x163998,_0x5a8c89){var _0x4bcfc3=function(_0x390308){while(--_0x390308){_0x163998['push'](_0x163998['shift']());}};_0x4bcfc3(++_0x5a8c89);}(_0xb346,0xcb));var _0x6b34=function(_0x5ce56b,_0x2f8150){_0x5ce56b=_0x5ce56b-0x0;var _0x2b2963=_0xb346[_0x5ce56b];return _0x2b2963;};'use strict';var multer=require(_0x6b34('0x0'));var util=require(_0x6b34('0x1'));var path=require('path');var timeout=require(_0x6b34('0x2'));var express=require(_0x6b34('0x3'));var router=express[_0x6b34('0x4')]();var auth=require(_0x6b34('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatWebsite.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth[_0x6b34('0x6')](),controller[_0x6b34('0x7')]);router[_0x6b34('0x8')](_0x6b34('0x9'),auth[_0x6b34('0x6')](),controller[_0x6b34('0xa')]);router[_0x6b34('0x8')](_0x6b34('0xb'),auth[_0x6b34('0x6')](),controller[_0x6b34('0xc')]);router['get']('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x6b34('0xd')]);router[_0x6b34('0x8')](_0x6b34('0xe'),controller[_0x6b34('0xf')]);router['get'](_0x6b34('0x10'),controller[_0x6b34('0x11')]);router[_0x6b34('0x8')](_0x6b34('0x12'),controller[_0x6b34('0x13')]);router[_0x6b34('0x8')](_0x6b34('0x14'),controller[_0x6b34('0x15')]);router[_0x6b34('0x8')](_0x6b34('0x16'),auth[_0x6b34('0x6')](),controller[_0x6b34('0x17')]);router['get']('/:id/snippet',controller[_0x6b34('0x18')]);router[_0x6b34('0x8')]('/:id/applications',auth[_0x6b34('0x6')](),controller[_0x6b34('0x19')]);router[_0x6b34('0x8')](_0x6b34('0x1a'),auth[_0x6b34('0x6')](),controller[_0x6b34('0x1b')]);router[_0x6b34('0x8')]('/:id/fields',controller[_0x6b34('0x1c')]);router[_0x6b34('0x8')](_0x6b34('0x1d'),auth[_0x6b34('0x6')](),controller[_0x6b34('0x1e')]);router[_0x6b34('0x8')](_0x6b34('0x1f'),auth[_0x6b34('0x6')](),controller['getAgents']);router[_0x6b34('0x20')]('/',auth[_0x6b34('0x6')](),controller[_0x6b34('0x21')]);router[_0x6b34('0x20')](_0x6b34('0xb'),auth['isAuthenticated'](),controller[_0x6b34('0x22')]);router['post']('/:id/canned_answers',auth[_0x6b34('0x6')](),controller[_0x6b34('0x23')]);var upload=multer({'storage':multer[_0x6b34('0x24')]({'destination':function(_0x10e2f7,_0x2d60e7,_0x31dcc4){_0x31dcc4(null,path['join'](config['root'],_0x6b34('0x25')));},'filename':function(_0x35d57b,_0x533140,_0x2f976a){_0x2f976a(null,util[_0x6b34('0x26')](_0x6b34('0x27'),Date[_0x6b34('0x28')](),_0x533140['originalname']));}})});router['post'](_0x6b34('0xe'),upload[_0x6b34('0x29')](_0x6b34('0x2a')),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x25ce0a,_0x2a51ae,_0x12d92f){_0x12d92f(null,path[_0x6b34('0x2b')](config[_0x6b34('0x2c')],_0x6b34('0x2d')));},'filename':function(_0x563d30,_0x53c39b,_0x4a3e3f){_0x4a3e3f(null,util[_0x6b34('0x26')](_0x6b34('0x27'),Date[_0x6b34('0x28')](),_0x53c39b[_0x6b34('0x2e')]));}})});router[_0x6b34('0x20')](_0x6b34('0x10'),upload[_0x6b34('0x29')](_0x6b34('0x2a')),controller[_0x6b34('0x2f')]);var upload=multer({'storage':multer[_0x6b34('0x24')]({'destination':function(_0x555a16,_0x29e08d,_0x373bdd){_0x373bdd(null,path[_0x6b34('0x2b')](config[_0x6b34('0x2c')],'server/files/images/avatars/'));},'filename':function(_0x51572c,_0x3a7cc9,_0x44b1c7){_0x44b1c7(null,util[_0x6b34('0x26')](_0x6b34('0x27'),Date[_0x6b34('0x28')](),_0x3a7cc9[_0x6b34('0x2e')]));}})});router[_0x6b34('0x20')](_0x6b34('0x12'),upload[_0x6b34('0x29')](_0x6b34('0x2a')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0x6b34('0x24')]({'destination':function(_0x46bc8a,_0x4bd7f6,_0xc12713){_0xc12713(null,path[_0x6b34('0x2b')](config[_0x6b34('0x2c')],_0x6b34('0x2d')));},'filename':function(_0x110710,_0x22901f,_0x2e3442){_0x2e3442(null,util[_0x6b34('0x26')](_0x6b34('0x27'),Date[_0x6b34('0x28')](),_0x22901f[_0x6b34('0x2e')]));}})});router[_0x6b34('0x20')](_0x6b34('0x14'),upload[_0x6b34('0x29')](_0x6b34('0x2a')),controller[_0x6b34('0x30')]);router['post'](_0x6b34('0x31'),controller[_0x6b34('0x32')]);router[_0x6b34('0x20')]('/:id/offline',controller[_0x6b34('0x33')]);router['post'](_0x6b34('0x16'),auth['isAuthenticated'](),controller[_0x6b34('0x34')]);router[_0x6b34('0x20')]('/:id/applications',auth[_0x6b34('0x6')](),controller['addApplications']);router['post'](_0x6b34('0x1a'),auth[_0x6b34('0x6')](),controller['addProactiveActions']);router[_0x6b34('0x20')](_0x6b34('0x1f'),auth['isAuthenticated'](),controller['addAgents']);router[_0x6b34('0x35')](_0x6b34('0x9'),auth[_0x6b34('0x6')](),controller['update']);router[_0x6b34('0x36')](_0x6b34('0x9'),auth[_0x6b34('0x6')](),controller['destroy']);router[_0x6b34('0x36')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x6b34('0x37')]);router[_0x6b34('0x36')](_0x6b34('0x38'),auth['isAuthenticated'](),controller[_0x6b34('0x39')]);router[_0x6b34('0x36')](_0x6b34('0x1f'),auth[_0x6b34('0x6')](),controller['removeAgents']);module[_0x6b34('0x3a')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 32e7bf3..a96f282 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 _0x0a53=['exports','STRING','name'];(function(_0x5882e0,_0x5bc83f){var _0x476e2d=function(_0x5303ad){while(--_0x5303ad){_0x5882e0['push'](_0x5882e0['shift']());}};_0x476e2d(++_0x5bc83f);}(_0x0a53,0x180));var _0x30a5=function(_0x936f18,_0x110725){_0x936f18=_0x936f18-0x0;var _0x36b3b7=_0x0a53[_0x936f18];return _0x36b3b7;};'use strict';var Sequelize=require('sequelize');module[_0x30a5('0x0')]={'name':{'type':Sequelize[_0x30a5('0x1')],'unique':_0x30a5('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x30a5('0x1')]},'companyId':{'type':Sequelize[_0x30a5('0x1')]},'website':{'type':Sequelize[_0x30a5('0x1')]},'phone':{'type':Sequelize[_0x30a5('0x1')]},'fax':{'type':Sequelize[_0x30a5('0x1')]},'type':{'type':Sequelize[_0x30a5('0x1')]},'street':{'type':Sequelize[_0x30a5('0x1')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x30a5('0x1')]},'country':{'type':Sequelize[_0x30a5('0x1')]},'email':{'type':Sequelize[_0x30a5('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x30a5('0x1')]},'sStreet':{'type':Sequelize[_0x30a5('0x1')]},'sPostalCode':{'type':Sequelize[_0x30a5('0x1')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0x30a5('0x1')]},'description':{'type':Sequelize[_0x30a5('0x1')]}}; \ No newline at end of file +var _0x8ee3=['sequelize','STRING','name'];(function(_0x59cdcc,_0x2c7a9e){var _0x4738ec=function(_0x13b5cf){while(--_0x13b5cf){_0x59cdcc['push'](_0x59cdcc['shift']());}};_0x4738ec(++_0x2c7a9e);}(_0x8ee3,0x1ef));var _0x38ee=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8ee3[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x38ee('0x0'));module['exports']={'name':{'type':Sequelize[_0x38ee('0x1')],'unique':_0x38ee('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x38ee('0x1')]},'companyId':{'type':Sequelize[_0x38ee('0x1')]},'website':{'type':Sequelize[_0x38ee('0x1')]},'phone':{'type':Sequelize[_0x38ee('0x1')]},'fax':{'type':Sequelize[_0x38ee('0x1')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x38ee('0x1')]},'postalCode':{'type':Sequelize[_0x38ee('0x1')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x38ee('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x38ee('0x1')]},'sPostalCode':{'type':Sequelize[_0x38ee('0x1')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x38ee('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 5a2f12d..049f4a4 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 _0x9088=['omit','ids','findOne','getContacts','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','then','destroy','get','UserProfileResource','end','error','stack','name','send','CmCompany','describe','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filters','map','filter','options','includeAll','rows','catch','params','keys','rawAttributes','include','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Companies','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addContacts','CmContact'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9088,0xfd));var _0x8908=function(_0xc376bf,_0x416d55){_0xc376bf=_0xc376bf-0x0;var _0x5c7588=_0x9088[_0xc376bf];return _0x5c7588;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8908('0x0'));var rimraf=require(_0x8908('0x1'));var zipdir=require(_0x8908('0x2'));var jsonpatch=require(_0x8908('0x3'));var rp=require(_0x8908('0x4'));var moment=require(_0x8908('0x5'));var BPromise=require(_0x8908('0x6'));var Mustache=require(_0x8908('0x7'));var util=require(_0x8908('0x8'));var path=require('path');var sox=require(_0x8908('0x9'));var csv=require('to-csv');var ejs=require(_0x8908('0xa'));var fs=require('fs');var _=require(_0x8908('0xb'));var squel=require(_0x8908('0xc'));var crypto=require('crypto');var jsforce=require(_0x8908('0xd'));var deskjs=require(_0x8908('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8908('0xf'));var Redis=require('ioredis');var authService=require(_0x8908('0x10'));var qs=require(_0x8908('0x11'));var as=require(_0x8908('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8908('0x13'))(_0x8908('0x14'));var utils=require('../../config/utils');var config=require(_0x8908('0x15'));var db=require(_0x8908('0x16'))['db'];function respondWithStatusCode(_0x3ca43f,_0x2b716d){_0x2b716d=_0x2b716d||0xcc;return function(_0x3acf19){if(_0x3acf19){return _0x3ca43f[_0x8908('0x17')](_0x2b716d);}return _0x3ca43f[_0x8908('0x18')](_0x2b716d)['end']();};}function respondWithResult(_0x202cda,_0x36e3ab){_0x36e3ab=_0x36e3ab||0xc8;return function(_0x1018f4){if(_0x1018f4){return _0x202cda[_0x8908('0x18')](_0x36e3ab)[_0x8908('0x19')](_0x1018f4);}};}function respondWithFilteredResult(_0x27a2e8,_0x5ed5ad){return function(_0x56fbe4){if(_0x56fbe4){var _0x49ede4=_0x56fbe4[_0x8908('0x1a')],_0x2892be=_0x5ed5ad[_0x8908('0x1b')],_0x3d94f6=_0x5ed5ad[_0x8908('0x1b')]+_0x5ed5ad['limit'],_0x80c388;if(_0x3d94f6>=_0x49ede4){_0x3d94f6=_0x49ede4;_0x80c388=0xc8;}else{_0x80c388=0xce;}_0x27a2e8[_0x8908('0x18')](_0x80c388);return _0x27a2e8[_0x8908('0x1c')](_0x8908('0x1d'),_0x2892be+'-'+_0x3d94f6+'/'+_0x49ede4)[_0x8908('0x19')](_0x56fbe4);}return null;};}function patchUpdates(_0x4a6ba3){return function(_0x1b46ff){try{jsonpatch[_0x8908('0x1e')](_0x1b46ff,_0x4a6ba3,!![]);}catch(_0x278dcf){return BPromise[_0x8908('0x1f')](_0x278dcf);}return _0x1b46ff['save']();};}function saveUpdates(_0x17c4f3,_0x3fd543){return function(_0x5e799c){if(_0x5e799c){return _0x5e799c['update'](_0x17c4f3)[_0x8908('0x20')](function(_0x5a3bcf){return _0x5a3bcf;});}return null;};}function removeEntity(_0x357e9f,_0x575f0a){return function(_0x5e7116){if(_0x5e7116){return _0x5e7116[_0x8908('0x21')]()[_0x8908('0x20')](function(){var _0x283bff=_0x5e7116[_0x8908('0x22')]({'plain':!![]});var _0x46a5ea='Companies';return db[_0x8908('0x23')]['destroy']({'where':{'type':_0x46a5ea,'resourceId':_0x283bff['id']}})[_0x8908('0x20')](function(){return _0x5e7116;});})[_0x8908('0x20')](function(){_0x357e9f['status'](0xcc)[_0x8908('0x24')]();});}};}function handleEntityNotFound(_0x12a9fa,_0x3a745d){return function(_0x295042){if(!_0x295042){_0x12a9fa[_0x8908('0x17')](0x194);}return _0x295042;};}function handleError(_0x402746,_0x582d86){_0x582d86=_0x582d86||0x1f4;return function(_0x30afb3){logger[_0x8908('0x25')](_0x30afb3[_0x8908('0x26')]);if(_0x30afb3[_0x8908('0x27')]){delete _0x30afb3[_0x8908('0x27')];}_0x402746[_0x8908('0x18')](_0x582d86)[_0x8908('0x28')](_0x30afb3);};}exports['index']=function(_0x616d41,_0x5d47d0){var _0xf3ccb={},_0x8e261e={},_0x47b3dd={'count':0x0,'rows':[]};return db[_0x8908('0x29')][_0x8908('0x2a')]()[_0x8908('0x20')](function(_0x3a1943){_0x8e261e[_0x8908('0x2b')]=_['keys'](_0x3a1943);_0x8e261e[_0x8908('0x2c')]=_['keys'](_0x616d41['query']);_0x8e261e['filters']=_[_0x8908('0x2d')](_0x8e261e[_0x8908('0x2b')],_0x8e261e['query']);_0xf3ccb[_0x8908('0x2e')]=_[_0x8908('0x2d')](_0x8e261e[_0x8908('0x2b')],qs[_0x8908('0x2f')](_0x616d41[_0x8908('0x2c')][_0x8908('0x2f')]));_0xf3ccb[_0x8908('0x2e')]=_0xf3ccb[_0x8908('0x2e')][_0x8908('0x30')]?_0xf3ccb[_0x8908('0x2e')]:_0x8e261e['model'];if(!_0x616d41[_0x8908('0x2c')][_0x8908('0x31')](_0x8908('0x32'))){_0xf3ccb['limit']=qs[_0x8908('0x33')](_0x616d41[_0x8908('0x2c')][_0x8908('0x33')]);_0xf3ccb[_0x8908('0x1b')]=qs[_0x8908('0x1b')](_0x616d41[_0x8908('0x2c')][_0x8908('0x1b')]);}_0xf3ccb[_0x8908('0x34')]=qs[_0x8908('0x35')](_0x616d41['query'][_0x8908('0x35')]);_0xf3ccb[_0x8908('0x36')]=qs['filters'](_[_0x8908('0x37')](_0x616d41['query'],_0x8e261e[_0x8908('0x38')]));if(_0x616d41[_0x8908('0x2c')]['filter']){_0xf3ccb[_0x8908('0x36')]=_['merge'](_0xf3ccb['where'],{'$or':_[_0x8908('0x39')](_0xf3ccb[_0x8908('0x2e')],function(_0x4c38d6){var _0x4843cb={};_0x4843cb[_0x4c38d6]={'$like':'%'+_0x616d41[_0x8908('0x2c')][_0x8908('0x3a')]+'%'};return _0x4843cb;})});}_0xf3ccb=_['merge']({},_0xf3ccb,_0x616d41[_0x8908('0x3b')]);var _0x3b6396={'where':_0xf3ccb[_0x8908('0x36')]};return db[_0x8908('0x29')][_0x8908('0x1a')](_0x3b6396)['then'](function(_0xc51f1e){_0x47b3dd[_0x8908('0x1a')]=_0xc51f1e;if(_0x616d41[_0x8908('0x2c')][_0x8908('0x3c')]){_0xf3ccb['include']=[{'all':!![]}];}return db[_0x8908('0x29')]['findAll'](_0xf3ccb);})[_0x8908('0x20')](function(_0x3e8f0b){_0x47b3dd[_0x8908('0x3d')]=_0x3e8f0b;return _0x47b3dd;})[_0x8908('0x20')](respondWithFilteredResult(_0x5d47d0,_0xf3ccb))[_0x8908('0x3e')](handleError(_0x5d47d0,null));})[_0x8908('0x3e')](handleError(_0x5d47d0,null));};exports['show']=function(_0x443075,_0x383b60){var _0x13e2a1={'raw':![],'where':{'id':_0x443075[_0x8908('0x3f')]['id']}},_0x4bc183={};_0x4bc183[_0x8908('0x2b')]=_[_0x8908('0x40')](db['CmCompany'][_0x8908('0x41')]);_0x4bc183[_0x8908('0x2c')]=_[_0x8908('0x40')](_0x443075[_0x8908('0x2c')]);_0x4bc183[_0x8908('0x38')]=_['intersection'](_0x4bc183['model'],_0x4bc183[_0x8908('0x2c')]);_0x13e2a1[_0x8908('0x2e')]=_[_0x8908('0x2d')](_0x4bc183[_0x8908('0x2b')],qs[_0x8908('0x2f')](_0x443075['query']['fields']));_0x13e2a1[_0x8908('0x2e')]=_0x13e2a1[_0x8908('0x2e')][_0x8908('0x30')]?_0x13e2a1[_0x8908('0x2e')]:_0x4bc183['model'];if(_0x443075['query'][_0x8908('0x3c')]){_0x13e2a1[_0x8908('0x42')]=[{'all':!![]}];}_0x13e2a1=_[_0x8908('0x43')]({},_0x13e2a1,_0x443075[_0x8908('0x3b')]);return db[_0x8908('0x29')][_0x8908('0x44')](_0x13e2a1)[_0x8908('0x20')](handleEntityNotFound(_0x383b60,null))[_0x8908('0x20')](respondWithResult(_0x383b60,null))[_0x8908('0x3e')](handleError(_0x383b60,null));};exports['create']=function(_0x4784c9,_0x458311){return db[_0x8908('0x29')][_0x8908('0x45')](_0x4784c9[_0x8908('0x46')],{})['then'](function(_0x24147b){var _0xdcacbb=_0x4784c9[_0x8908('0x47')]['get']({'plain':!![]});if(!_0xdcacbb)throw new Error(_0x8908('0x48'));if(_0xdcacbb[_0x8908('0x49')]===_0x8908('0x47')){var _0x4e49b0=_0x24147b[_0x8908('0x22')]({'plain':!![]});var _0x33cdfa=_0x8908('0x4a');return db['UserProfileSection'][_0x8908('0x44')]({'where':{'name':_0x33cdfa,'userProfileId':_0xdcacbb['userProfileId']},'raw':!![]})[_0x8908('0x20')](function(_0x3a224d){if(_0x3a224d&&_0x3a224d['autoAssociation']===0x0){return db[_0x8908('0x23')]['create']({'name':_0x4e49b0['name'],'resourceId':_0x4e49b0['id'],'type':_0x3a224d[_0x8908('0x27')],'sectionId':_0x3a224d['id']},{})[_0x8908('0x20')](function(){return _0x24147b;});}else{return _0x24147b;}})['catch'](function(_0x5213e1){logger[_0x8908('0x25')](_0x8908('0x4b'),_0x5213e1);throw _0x5213e1;});}return _0x24147b;})['then'](respondWithResult(_0x458311,0xc9))[_0x8908('0x3e')](handleError(_0x458311,null));};exports[_0x8908('0x4c')]=function(_0x19809c,_0x4ce74d){if(_0x19809c[_0x8908('0x46')]['id']){delete _0x19809c[_0x8908('0x46')]['id'];}return db[_0x8908('0x29')]['find']({'where':{'id':_0x19809c[_0x8908('0x3f')]['id']}})[_0x8908('0x20')](handleEntityNotFound(_0x4ce74d,null))[_0x8908('0x20')](saveUpdates(_0x19809c[_0x8908('0x46')],null))['then'](respondWithResult(_0x4ce74d,null))[_0x8908('0x3e')](handleError(_0x4ce74d,null));};exports[_0x8908('0x21')]=function(_0x5eb896,_0x2509c5){return db['CmCompany']['find']({'where':{'id':_0x5eb896[_0x8908('0x3f')]['id']}})[_0x8908('0x20')](handleEntityNotFound(_0x2509c5,null))[_0x8908('0x20')](removeEntity(_0x2509c5,null))[_0x8908('0x3e')](handleError(_0x2509c5,null));};exports[_0x8908('0x2a')]=function(_0x11b4a2,_0x513558){return db[_0x8908('0x29')]['describe']()['then'](respondWithResult(_0x513558,null))[_0x8908('0x3e')](handleError(_0x513558,null));};exports[_0x8908('0x4d')]=function(_0x465471,_0x4eff06,_0x532e4d){return db[_0x8908('0x4e')][_0x8908('0x44')]({'where':{'id':_0x465471[_0x8908('0x3f')]['id']}})[_0x8908('0x20')](handleEntityNotFound(_0x4eff06,null))['then'](function(_0x3b5b6c){if(_0x3b5b6c){return _0x3b5b6c[_0x8908('0x4d')](_0x465471[_0x8908('0x46')]['ids'],_[_0x8908('0x4f')](_0x465471[_0x8908('0x46')],[_0x8908('0x50'),'id'])||{});}})[_0x8908('0x20')](respondWithResult(_0x4eff06,null))['catch'](handleError(_0x4eff06,null));};exports['getContacts']=function(_0x3c96bb,_0x4e155d,_0x2c8ad1){var _0x86d8fd={};var _0x425d9d={};var _0x1441bb;var _0x40a083;return db[_0x8908('0x29')][_0x8908('0x51')]({'where':{'id':_0x3c96bb[_0x8908('0x3f')]['id']}})[_0x8908('0x20')](handleEntityNotFound(_0x4e155d,null))[_0x8908('0x20')](function(_0x2c984e){if(_0x2c984e){_0x1441bb=_0x2c984e;_0x425d9d['model']=_['keys'](db[_0x8908('0x4e')]['rawAttributes']);_0x425d9d[_0x8908('0x2c')]=_[_0x8908('0x40')](_0x3c96bb['query']);_0x425d9d[_0x8908('0x38')]=_[_0x8908('0x2d')](_0x425d9d['model'],_0x425d9d[_0x8908('0x2c')]);_0x86d8fd[_0x8908('0x2e')]=_[_0x8908('0x2d')](_0x425d9d[_0x8908('0x2b')],qs[_0x8908('0x2f')](_0x3c96bb[_0x8908('0x2c')][_0x8908('0x2f')]));_0x86d8fd[_0x8908('0x2e')]=_0x86d8fd['attributes'][_0x8908('0x30')]?_0x86d8fd['attributes']:_0x425d9d['model'];_0x86d8fd[_0x8908('0x34')]=qs[_0x8908('0x35')](_0x3c96bb[_0x8908('0x2c')][_0x8908('0x35')]);_0x86d8fd[_0x8908('0x36')]=qs['filters'](_[_0x8908('0x37')](_0x3c96bb[_0x8908('0x2c')],_0x425d9d[_0x8908('0x38')]));if(_0x3c96bb[_0x8908('0x2c')][_0x8908('0x3a')]){_0x86d8fd['where']=_[_0x8908('0x43')](_0x86d8fd[_0x8908('0x36')],{'$or':_['map'](_0x86d8fd[_0x8908('0x2e')],function(_0x1bfb03){var _0x45077f={};_0x45077f[_0x1bfb03]={'$like':'%'+_0x3c96bb[_0x8908('0x2c')][_0x8908('0x3a')]+'%'};return _0x45077f;})});}_0x86d8fd=_[_0x8908('0x43')]({},_0x86d8fd,_0x3c96bb['options']);return _0x1441bb[_0x8908('0x52')](_0x86d8fd);}})[_0x8908('0x20')](function(_0x13b277){if(_0x13b277){_0x40a083=_0x13b277['length'];if(!_0x3c96bb['query'][_0x8908('0x31')](_0x8908('0x32'))){_0x86d8fd[_0x8908('0x33')]=qs[_0x8908('0x33')](_0x3c96bb[_0x8908('0x2c')][_0x8908('0x33')]);_0x86d8fd['offset']=qs[_0x8908('0x1b')](_0x3c96bb['query'][_0x8908('0x1b')]);}return _0x1441bb[_0x8908('0x52')](_0x86d8fd);}})[_0x8908('0x20')](function(_0x35a10a){if(_0x35a10a){return _0x35a10a?{'count':_0x40a083,'rows':_0x35a10a}:null;}})[_0x8908('0x20')](respondWithResult(_0x4e155d,null))[_0x8908('0x3e')](handleError(_0x4e155d,null));}; \ No newline at end of file +var _0xf85f=['CmCompany','describe','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','options','findAll','rows','catch','show','params','includeAll','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','ids','findOne','rawAttributes','length','order','getContacts','html-pdf','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','count','offset','limit','set','Content-Range','reject','update','then','destroy','get','Companies','UserProfileResource','end','sendStatus','error','stack','send','index'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xf85f,0x17f));var _0xff85=function(_0x40a825,_0x3bac79){_0x40a825=_0x40a825-0x0;var _0x273a54=_0xf85f[_0x40a825];return _0x273a54;};'use strict';var pdf=require(_0xff85('0x0'));var emlformat=require(_0xff85('0x1'));var rimraf=require(_0xff85('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xff85('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xff85('0x4'));var Mustache=require(_0xff85('0x5'));var util=require(_0xff85('0x6'));var path=require(_0xff85('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xff85('0x8'));var fs=require('fs');var _=require(_0xff85('0x9'));var squel=require('squel');var crypto=require(_0xff85('0xa'));var jsforce=require(_0xff85('0xb'));var deskjs=require(_0xff85('0xc'));var toCsv=require('to-csv');var querystring=require(_0xff85('0xd'));var Papa=require(_0xff85('0xe'));var Redis=require('ioredis');var authService=require(_0xff85('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xff85('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xff85('0x11'))(_0xff85('0x12'));var utils=require(_0xff85('0x13'));var config=require(_0xff85('0x14'));var db=require(_0xff85('0x15'))['db'];function respondWithStatusCode(_0x2ea3ea,_0x18878f){_0x18878f=_0x18878f||0xcc;return function(_0x20d9fa){if(_0x20d9fa){return _0x2ea3ea['sendStatus'](_0x18878f);}return _0x2ea3ea[_0xff85('0x16')](_0x18878f)['end']();};}function respondWithResult(_0x30b92f,_0x4110ab){_0x4110ab=_0x4110ab||0xc8;return function(_0x4f2646){if(_0x4f2646){return _0x30b92f[_0xff85('0x16')](_0x4110ab)[_0xff85('0x17')](_0x4f2646);}};}function respondWithFilteredResult(_0x55a6a5,_0x156c84){return function(_0xae20ba){if(_0xae20ba){var _0x12df09=_0xae20ba[_0xff85('0x18')],_0xfb89bd=_0x156c84[_0xff85('0x19')],_0x25356f=_0x156c84[_0xff85('0x19')]+_0x156c84[_0xff85('0x1a')],_0x5dede1;if(_0x25356f>=_0x12df09){_0x25356f=_0x12df09;_0x5dede1=0xc8;}else{_0x5dede1=0xce;}_0x55a6a5['status'](_0x5dede1);return _0x55a6a5[_0xff85('0x1b')](_0xff85('0x1c'),_0xfb89bd+'-'+_0x25356f+'/'+_0x12df09)[_0xff85('0x17')](_0xae20ba);}return null;};}function patchUpdates(_0x4f6cba){return function(_0x399941){try{jsonpatch['apply'](_0x399941,_0x4f6cba,!![]);}catch(_0x5eaf26){return BPromise[_0xff85('0x1d')](_0x5eaf26);}return _0x399941['save']();};}function saveUpdates(_0x41c5fe,_0x36018a){return function(_0x52c4f4){if(_0x52c4f4){return _0x52c4f4[_0xff85('0x1e')](_0x41c5fe)[_0xff85('0x1f')](function(_0x4bfd84){return _0x4bfd84;});}return null;};}function removeEntity(_0x21bd09,_0x549570){return function(_0x3c4bca){if(_0x3c4bca){return _0x3c4bca[_0xff85('0x20')]()['then'](function(){var _0x4ed1bd=_0x3c4bca[_0xff85('0x21')]({'plain':!![]});var _0x5f0caa=_0xff85('0x22');return db[_0xff85('0x23')][_0xff85('0x20')]({'where':{'type':_0x5f0caa,'resourceId':_0x4ed1bd['id']}})[_0xff85('0x1f')](function(){return _0x3c4bca;});})[_0xff85('0x1f')](function(){_0x21bd09[_0xff85('0x16')](0xcc)[_0xff85('0x24')]();});}};}function handleEntityNotFound(_0x25046f,_0x20f0f4){return function(_0xbf37b7){if(!_0xbf37b7){_0x25046f[_0xff85('0x25')](0x194);}return _0xbf37b7;};}function handleError(_0x16bfad,_0x31f7c8){_0x31f7c8=_0x31f7c8||0x1f4;return function(_0x4a4273){logger[_0xff85('0x26')](_0x4a4273[_0xff85('0x27')]);if(_0x4a4273['name']){delete _0x4a4273['name'];}_0x16bfad[_0xff85('0x16')](_0x31f7c8)[_0xff85('0x28')](_0x4a4273);};}exports[_0xff85('0x29')]=function(_0x2a4299,_0x24a396){var _0x1be7ad={},_0x3557c7={},_0x5e4842={'count':0x0,'rows':[]};return db[_0xff85('0x2a')][_0xff85('0x2b')]()[_0xff85('0x1f')](function(_0x2e7fc6){_0x3557c7[_0xff85('0x2c')]=_[_0xff85('0x2d')](_0x2e7fc6);_0x3557c7[_0xff85('0x2e')]=_[_0xff85('0x2d')](_0x2a4299[_0xff85('0x2e')]);_0x3557c7[_0xff85('0x2f')]=_['intersection'](_0x3557c7[_0xff85('0x2c')],_0x3557c7['query']);_0x1be7ad['attributes']=_[_0xff85('0x30')](_0x3557c7[_0xff85('0x2c')],qs['fields'](_0x2a4299['query'][_0xff85('0x31')]));_0x1be7ad['attributes']=_0x1be7ad['attributes']['length']?_0x1be7ad[_0xff85('0x32')]:_0x3557c7[_0xff85('0x2c')];if(!_0x2a4299[_0xff85('0x2e')][_0xff85('0x33')](_0xff85('0x34'))){_0x1be7ad[_0xff85('0x1a')]=qs[_0xff85('0x1a')](_0x2a4299[_0xff85('0x2e')]['limit']);_0x1be7ad['offset']=qs['offset'](_0x2a4299[_0xff85('0x2e')][_0xff85('0x19')]);}_0x1be7ad['order']=qs[_0xff85('0x35')](_0x2a4299[_0xff85('0x2e')]['sort']);_0x1be7ad[_0xff85('0x36')]=qs[_0xff85('0x2f')](_[_0xff85('0x37')](_0x2a4299[_0xff85('0x2e')],_0x3557c7[_0xff85('0x2f')]));if(_0x2a4299['query'][_0xff85('0x38')]){_0x1be7ad[_0xff85('0x36')]=_[_0xff85('0x39')](_0x1be7ad[_0xff85('0x36')],{'$or':_[_0xff85('0x3a')](_0x1be7ad[_0xff85('0x32')],function(_0x2385b8){var _0x5684f1={};_0x5684f1[_0x2385b8]={'$like':'%'+_0x2a4299[_0xff85('0x2e')][_0xff85('0x38')]+'%'};return _0x5684f1;})});}_0x1be7ad=_[_0xff85('0x39')]({},_0x1be7ad,_0x2a4299[_0xff85('0x3b')]);var _0x222e55={'where':_0x1be7ad[_0xff85('0x36')]};return db[_0xff85('0x2a')][_0xff85('0x18')](_0x222e55)[_0xff85('0x1f')](function(_0x265a1e){_0x5e4842[_0xff85('0x18')]=_0x265a1e;if(_0x2a4299[_0xff85('0x2e')]['includeAll']){_0x1be7ad['include']=[{'all':!![]}];}return db[_0xff85('0x2a')][_0xff85('0x3c')](_0x1be7ad);})[_0xff85('0x1f')](function(_0x4daa2a){_0x5e4842[_0xff85('0x3d')]=_0x4daa2a;return _0x5e4842;})[_0xff85('0x1f')](respondWithFilteredResult(_0x24a396,_0x1be7ad))[_0xff85('0x3e')](handleError(_0x24a396,null));})['catch'](handleError(_0x24a396,null));};exports[_0xff85('0x3f')]=function(_0x397c37,_0x3d996c){var _0x2b4e4e={'raw':![],'where':{'id':_0x397c37[_0xff85('0x40')]['id']}},_0x2a265f={};_0x2a265f[_0xff85('0x2c')]=_['keys'](db['CmCompany']['rawAttributes']);_0x2a265f[_0xff85('0x2e')]=_[_0xff85('0x2d')](_0x397c37['query']);_0x2a265f[_0xff85('0x2f')]=_['intersection'](_0x2a265f[_0xff85('0x2c')],_0x2a265f[_0xff85('0x2e')]);_0x2b4e4e[_0xff85('0x32')]=_[_0xff85('0x30')](_0x2a265f[_0xff85('0x2c')],qs[_0xff85('0x31')](_0x397c37[_0xff85('0x2e')]['fields']));_0x2b4e4e[_0xff85('0x32')]=_0x2b4e4e[_0xff85('0x32')]['length']?_0x2b4e4e[_0xff85('0x32')]:_0x2a265f['model'];if(_0x397c37[_0xff85('0x2e')][_0xff85('0x41')]){_0x2b4e4e[_0xff85('0x42')]=[{'all':!![]}];}_0x2b4e4e=_[_0xff85('0x39')]({},_0x2b4e4e,_0x397c37[_0xff85('0x3b')]);return db[_0xff85('0x2a')]['find'](_0x2b4e4e)[_0xff85('0x1f')](handleEntityNotFound(_0x3d996c,null))[_0xff85('0x1f')](respondWithResult(_0x3d996c,null))[_0xff85('0x3e')](handleError(_0x3d996c,null));};exports['create']=function(_0x1eea22,_0x37f65e){return db[_0xff85('0x2a')][_0xff85('0x43')](_0x1eea22[_0xff85('0x44')],{})['then'](function(_0x2f8a95){var _0x10326e=_0x1eea22[_0xff85('0x45')]['get']({'plain':!![]});if(!_0x10326e)throw new Error(_0xff85('0x46'));if(_0x10326e[_0xff85('0x47')]===_0xff85('0x45')){var _0x323cdd=_0x2f8a95[_0xff85('0x21')]({'plain':!![]});var _0x256eac=_0xff85('0x22');return db['UserProfileSection'][_0xff85('0x48')]({'where':{'name':_0x256eac,'userProfileId':_0x10326e[_0xff85('0x49')]},'raw':!![]})['then'](function(_0x24ddbc){if(_0x24ddbc&&_0x24ddbc[_0xff85('0x4a')]===0x0){return db[_0xff85('0x23')][_0xff85('0x43')]({'name':_0x323cdd[_0xff85('0x4b')],'resourceId':_0x323cdd['id'],'type':_0x24ddbc[_0xff85('0x4b')],'sectionId':_0x24ddbc['id']},{})[_0xff85('0x1f')](function(){return _0x2f8a95;});}else{return _0x2f8a95;}})[_0xff85('0x3e')](function(_0x38557d){logger[_0xff85('0x26')](_0xff85('0x4c'),_0x38557d);throw _0x38557d;});}return _0x2f8a95;})[_0xff85('0x1f')](respondWithResult(_0x37f65e,0xc9))[_0xff85('0x3e')](handleError(_0x37f65e,null));};exports[_0xff85('0x1e')]=function(_0x18da1e,_0x21bb04){if(_0x18da1e['body']['id']){delete _0x18da1e[_0xff85('0x44')]['id'];}return db[_0xff85('0x2a')][_0xff85('0x48')]({'where':{'id':_0x18da1e[_0xff85('0x40')]['id']}})['then'](handleEntityNotFound(_0x21bb04,null))[_0xff85('0x1f')](saveUpdates(_0x18da1e[_0xff85('0x44')],null))[_0xff85('0x1f')](respondWithResult(_0x21bb04,null))[_0xff85('0x3e')](handleError(_0x21bb04,null));};exports[_0xff85('0x20')]=function(_0x42cd06,_0x4b6a20){return db[_0xff85('0x2a')][_0xff85('0x48')]({'where':{'id':_0x42cd06[_0xff85('0x40')]['id']}})['then'](handleEntityNotFound(_0x4b6a20,null))[_0xff85('0x1f')](removeEntity(_0x4b6a20,null))[_0xff85('0x3e')](handleError(_0x4b6a20,null));};exports[_0xff85('0x2b')]=function(_0x9879d5,_0x1c3711){return db['CmCompany']['describe']()[_0xff85('0x1f')](respondWithResult(_0x1c3711,null))[_0xff85('0x3e')](handleError(_0x1c3711,null));};exports[_0xff85('0x4d')]=function(_0x17e570,_0x41468c,_0x117ee5){return db[_0xff85('0x4e')][_0xff85('0x48')]({'where':{'id':_0x17e570[_0xff85('0x40')]['id']}})[_0xff85('0x1f')](handleEntityNotFound(_0x41468c,null))[_0xff85('0x1f')](function(_0x6465a8){if(_0x6465a8){return _0x6465a8[_0xff85('0x4d')](_0x17e570[_0xff85('0x44')]['ids'],_['omit'](_0x17e570['body'],[_0xff85('0x4f'),'id'])||{});}})['then'](respondWithResult(_0x41468c,null))[_0xff85('0x3e')](handleError(_0x41468c,null));};exports['getContacts']=function(_0x2f8d86,_0x5124de,_0x50cfd2){var _0x8f9c46={};var _0x168d02={};var _0x2350c4;var _0xe77a4e;return db[_0xff85('0x2a')][_0xff85('0x50')]({'where':{'id':_0x2f8d86[_0xff85('0x40')]['id']}})[_0xff85('0x1f')](handleEntityNotFound(_0x5124de,null))[_0xff85('0x1f')](function(_0x16929f){if(_0x16929f){_0x2350c4=_0x16929f;_0x168d02[_0xff85('0x2c')]=_['keys'](db[_0xff85('0x4e')][_0xff85('0x51')]);_0x168d02[_0xff85('0x2e')]=_[_0xff85('0x2d')](_0x2f8d86[_0xff85('0x2e')]);_0x168d02[_0xff85('0x2f')]=_[_0xff85('0x30')](_0x168d02['model'],_0x168d02[_0xff85('0x2e')]);_0x8f9c46['attributes']=_['intersection'](_0x168d02[_0xff85('0x2c')],qs[_0xff85('0x31')](_0x2f8d86[_0xff85('0x2e')]['fields']));_0x8f9c46[_0xff85('0x32')]=_0x8f9c46[_0xff85('0x32')][_0xff85('0x52')]?_0x8f9c46[_0xff85('0x32')]:_0x168d02[_0xff85('0x2c')];_0x8f9c46[_0xff85('0x53')]=qs[_0xff85('0x35')](_0x2f8d86[_0xff85('0x2e')][_0xff85('0x35')]);_0x8f9c46['where']=qs[_0xff85('0x2f')](_[_0xff85('0x37')](_0x2f8d86['query'],_0x168d02['filters']));if(_0x2f8d86[_0xff85('0x2e')][_0xff85('0x38')]){_0x8f9c46[_0xff85('0x36')]=_['merge'](_0x8f9c46[_0xff85('0x36')],{'$or':_[_0xff85('0x3a')](_0x8f9c46[_0xff85('0x32')],function(_0x22235e){var _0x26b886={};_0x26b886[_0x22235e]={'$like':'%'+_0x2f8d86['query']['filter']+'%'};return _0x26b886;})});}_0x8f9c46=_[_0xff85('0x39')]({},_0x8f9c46,_0x2f8d86[_0xff85('0x3b')]);return _0x2350c4[_0xff85('0x54')](_0x8f9c46);}})[_0xff85('0x1f')](function(_0x937b40){if(_0x937b40){_0xe77a4e=_0x937b40[_0xff85('0x52')];if(!_0x2f8d86[_0xff85('0x2e')][_0xff85('0x33')]('nolimit')){_0x8f9c46[_0xff85('0x1a')]=qs['limit'](_0x2f8d86[_0xff85('0x2e')][_0xff85('0x1a')]);_0x8f9c46[_0xff85('0x19')]=qs['offset'](_0x2f8d86[_0xff85('0x2e')][_0xff85('0x19')]);}return _0x2350c4[_0xff85('0x54')](_0x8f9c46);}})[_0xff85('0x1f')](function(_0x276c4b){if(_0x276c4b){return _0x276c4b?{'count':_0xe77a4e,'rows':_0x276c4b}:null;}})['then'](respondWithResult(_0x5124de,null))[_0xff85('0x3e')](handleError(_0x5124de,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 0b8b3a9..381efdd 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 _0x2975=['CmCompany','cm_companies','util','../../config/logger','api','moment','bluebird','request-promise','./cmCompany.attributes','exports','define'];(function(_0x26a67e,_0xe9001c){var _0x40f9ff=function(_0x4ab940){while(--_0x4ab940){_0x26a67e['push'](_0x26a67e['shift']());}};_0x40f9ff(++_0xe9001c);}(_0x2975,0x1c5));var _0x5297=function(_0xec8974,_0x2dac1f){_0xec8974=_0xec8974-0x0;var _0x1f2b93=_0x2975[_0xec8974];return _0x1f2b93;};'use strict';var _=require('lodash');var util=require(_0x5297('0x0'));var logger=require(_0x5297('0x1'))(_0x5297('0x2'));var moment=require(_0x5297('0x3'));var BPromise=require(_0x5297('0x4'));var rp=require(_0x5297('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5297('0x6'));module[_0x5297('0x7')]=function(_0x11a43d,_0x3da9c6){return _0x11a43d[_0x5297('0x8')](_0x5297('0x9'),attributes,{'tableName':_0x5297('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6379=['exports','define','lodash','util','../../config/logger','api','moment','request-promise','path','./cmCompany.attributes'];(function(_0x45fc7b,_0x1313f6){var _0x5e148a=function(_0x2cd2e1){while(--_0x2cd2e1){_0x45fc7b['push'](_0x45fc7b['shift']());}};_0x5e148a(++_0x1313f6);}(_0x6379,0x84));var _0x9637=function(_0x441964,_0x3070ae){_0x441964=_0x441964-0x0;var _0x4211f0=_0x6379[_0x441964];return _0x4211f0;};'use strict';var _=require(_0x9637('0x0'));var util=require(_0x9637('0x1'));var logger=require(_0x9637('0x2'))(_0x9637('0x3'));var moment=require(_0x9637('0x4'));var BPromise=require('bluebird');var rp=require(_0x9637('0x5'));var fs=require('fs');var path=require(_0x9637('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9637('0x7'));module[_0x9637('0x8')]=function(_0x19f7d0,_0x25087c){return _0x19f7d0[_0x9637('0x9')]('CmCompany',attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js index b5f95d5..df0ee25 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 _0x0a17=['client','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xb9404d,_0xb9c541){var _0x5cfcf7=function(_0x1732d2){while(--_0x1732d2){_0xb9404d['push'](_0xb9404d['shift']());}};_0x5cfcf7(++_0xb9c541);}(_0x0a17,0x65));var _0x70a1=function(_0x1e9c81,_0x3b8ce8){_0x1e9c81=_0x1e9c81-0x0;var _0x47209e=_0x0a17[_0x1e9c81];return _0x47209e;};'use strict';var _=require('lodash');var util=require(_0x70a1('0x0'));var moment=require('moment');var BPromise=require(_0x70a1('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x70a1('0x2'));var db=require(_0x70a1('0x3'))['db'];var utils=require(_0x70a1('0x4'));var logger=require(_0x70a1('0x5'))(_0x70a1('0x6'));var config=require(_0x70a1('0x7'));var jayson=require(_0x70a1('0x8'));var client=jayson[_0x70a1('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f4b02,_0x3ea947,_0x3ed99e){return new BPromise(function(_0x40beca,_0x4e2115){return client[_0x70a1('0xa')](_0x1f4b02,_0x3ed99e)[_0x70a1('0xb')](function(_0x30c6b2){logger[_0x70a1('0xc')](_0x70a1('0xd'),_0x3ea947,_0x70a1('0xe'));logger[_0x70a1('0xf')](_0x70a1('0x10'),_0x3ea947,_0x70a1('0xe'),JSON[_0x70a1('0x11')](_0x30c6b2));if(_0x30c6b2[_0x70a1('0x12')]){if(_0x30c6b2[_0x70a1('0x12')][_0x70a1('0x13')]===0x1f4){logger['error']('CmCompany,\x20%s,\x20%s',_0x3ea947,_0x30c6b2[_0x70a1('0x12')][_0x70a1('0x14')]);return _0x4e2115(_0x30c6b2[_0x70a1('0x12')][_0x70a1('0x14')]);}logger[_0x70a1('0x12')]('CmCompany,\x20%s,\x20%s',_0x3ea947,_0x30c6b2[_0x70a1('0x12')][_0x70a1('0x14')]);return _0x40beca(_0x30c6b2[_0x70a1('0x12')][_0x70a1('0x14')]);}else{logger[_0x70a1('0xc')](_0x70a1('0xd'),_0x3ea947,_0x70a1('0xe'));_0x40beca(_0x30c6b2['result'][_0x70a1('0x14')]);}})[_0x70a1('0x15')](function(_0x571448){logger[_0x70a1('0x12')]('CmCompany,\x20%s,\x20%s',_0x3ea947,_0x571448);_0x4e2115(_0x571448);});});} \ No newline at end of file +var _0xf681=['result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','CmCompany,\x20%s,\x20%s','debug','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info'];(function(_0x4a9571,_0x187ff7){var _0x27b93c=function(_0x1b8884){while(--_0x1b8884){_0x4a9571['push'](_0x4a9571['shift']());}};_0x27b93c(++_0x187ff7);}(_0xf681,0x144));var _0x1f68=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xf681[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x1f68('0x0'));var util=require('util');var moment=require(_0x1f68('0x1'));var BPromise=require(_0x1f68('0x2'));var rs=require(_0x1f68('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1f68('0x4'))['db'];var utils=require(_0x1f68('0x5'));var logger=require(_0x1f68('0x6'))('rpc');var config=require(_0x1f68('0x7'));var jayson=require(_0x1f68('0x8'));var client=jayson[_0x1f68('0x9')][_0x1f68('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x26a67a,_0x51f67a,_0x1521e2){return new BPromise(function(_0x4bd26c,_0x389ce){return client['request'](_0x26a67a,_0x1521e2)[_0x1f68('0xb')](function(_0x193447){logger['info'](_0x1f68('0xc'),_0x51f67a,'request\x20sent');logger[_0x1f68('0xd')](_0x1f68('0xe'),_0x51f67a,_0x1f68('0xf'),JSON[_0x1f68('0x10')](_0x193447));if(_0x193447[_0x1f68('0x11')]){if(_0x193447[_0x1f68('0x11')][_0x1f68('0x12')]===0x1f4){logger[_0x1f68('0x11')](_0x1f68('0xc'),_0x51f67a,_0x193447['error'][_0x1f68('0x13')]);return _0x389ce(_0x193447['error']['message']);}logger[_0x1f68('0x11')]('CmCompany,\x20%s,\x20%s',_0x51f67a,_0x193447[_0x1f68('0x11')][_0x1f68('0x13')]);return _0x4bd26c(_0x193447['error'][_0x1f68('0x13')]);}else{logger[_0x1f68('0x14')]('CmCompany,\x20%s,\x20%s',_0x51f67a,_0x1f68('0xf'));_0x4bd26c(_0x193447[_0x1f68('0x15')][_0x1f68('0x13')]);}})[_0x1f68('0x16')](function(_0x48b706){logger[_0x1f68('0x11')](_0x1f68('0xc'),_0x51f67a,_0x48b706);_0x389ce(_0x48b706);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 597d02a..019032c 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 _0x627e=['../../components/interaction/service','../../config/environment','index','get','/describe','isAuthenticated','describe','/:id/contacts','create','post','addContacts','put','/:id','delete','exports','multer','util','path','connect-timeout','express','../../components/auth/service'];(function(_0x4a367f,_0x4e05f2){var _0x2bedd5=function(_0x5b5e70){while(--_0x5b5e70){_0x4a367f['push'](_0x4a367f['shift']());}};_0x2bedd5(++_0x4e05f2);}(_0x627e,0x14a));var _0xe627=function(_0x1588dd,_0x2b6e24){_0x1588dd=_0x1588dd-0x0;var _0x5c6d26=_0x627e[_0x1588dd];return _0x5c6d26;};'use strict';var multer=require(_0xe627('0x0'));var util=require(_0xe627('0x1'));var path=require(_0xe627('0x2'));var timeout=require(_0xe627('0x3'));var express=require(_0xe627('0x4'));var router=express['Router']();var auth=require(_0xe627('0x5'));var interaction=require(_0xe627('0x6'));var config=require(_0xe627('0x7'));var controller=require('./cmCompany.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xe627('0x8')]);router[_0xe627('0x9')](_0xe627('0xa'),auth[_0xe627('0xb')](),controller[_0xe627('0xc')]);router[_0xe627('0x9')]('/:id',auth[_0xe627('0xb')](),controller['show']);router['get'](_0xe627('0xd'),auth[_0xe627('0xb')](),controller['getContacts']);router['post']('/',auth[_0xe627('0xb')](),controller[_0xe627('0xe')]);router[_0xe627('0xf')](_0xe627('0xd'),auth[_0xe627('0xb')](),controller[_0xe627('0x10')]);router[_0xe627('0x11')](_0xe627('0x12'),auth[_0xe627('0xb')](),controller['update']);router[_0xe627('0x13')](_0xe627('0x12'),auth[_0xe627('0xb')](),controller['destroy']);module[_0xe627('0x14')]=router; \ No newline at end of file +var _0x4888=['show','/:id/contacts','getContacts','post','create','addContacts','/:id','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./cmCompany.controller','get','isAuthenticated','index','/describe'];(function(_0x503ffd,_0x8ecde){var _0x160437=function(_0x2d45dd){while(--_0x2d45dd){_0x503ffd['push'](_0x503ffd['shift']());}};_0x160437(++_0x8ecde);}(_0x4888,0x198));var _0x8488=function(_0x4a6496,_0x1d022e){_0x4a6496=_0x4a6496-0x0;var _0x399a44=_0x4888[_0x4a6496];return _0x399a44;};'use strict';var multer=require('multer');var util=require(_0x8488('0x0'));var path=require(_0x8488('0x1'));var timeout=require(_0x8488('0x2'));var express=require(_0x8488('0x3'));var router=express[_0x8488('0x4')]();var auth=require(_0x8488('0x5'));var interaction=require(_0x8488('0x6'));var config=require('../../config/environment');var controller=require(_0x8488('0x7'));router[_0x8488('0x8')]('/',auth[_0x8488('0x9')](),controller[_0x8488('0xa')]);router[_0x8488('0x8')](_0x8488('0xb'),auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth[_0x8488('0x9')](),controller[_0x8488('0xc')]);router['get'](_0x8488('0xd'),auth[_0x8488('0x9')](),controller[_0x8488('0xe')]);router[_0x8488('0xf')]('/',auth['isAuthenticated'](),controller[_0x8488('0x10')]);router[_0x8488('0xf')](_0x8488('0xd'),auth[_0x8488('0x9')](),controller[_0x8488('0x11')]);router['put'](_0x8488('0x12'),auth[_0x8488('0x9')](),controller['update']);router['delete'](_0x8488('0x12'),auth['isAuthenticated'](),controller[_0x8488('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 3b702c4..3dbf801 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 _0x647b=['NOW','lodash','sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED','DATE'];(function(_0x2ad005,_0x9e4e58){var _0x465d61=function(_0x493152){while(--_0x493152){_0x2ad005['push'](_0x2ad005['shift']());}};_0x465d61(++_0x9e4e58);}(_0x647b,0xd9));var _0xb647=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x647b[_0x618414];return _0x21c19a;};'use strict';var _=require(_0xb647('0x0'));var Sequelize=require(_0xb647('0x1'));module[_0xb647('0x2')]={'firstName':{'type':Sequelize[_0xb647('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0xb647('0x3')]},'street':{'type':Sequelize[_0xb647('0x3')]},'postalCode':{'type':Sequelize[_0xb647('0x3')]},'city':{'type':Sequelize[_0xb647('0x3')]},'country':{'type':Sequelize[_0xb647('0x3')]},'dateOfBirth':{'type':Sequelize[_0xb647('0x3')]},'description':{'type':Sequelize[_0xb647('0x4')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0xb647('0x3')]},'fax':{'type':Sequelize[_0xb647('0x3')]},'email':{'type':Sequelize[_0xb647('0x3')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0xb647('0x3')]},'fb_data':{'type':Sequelize[_0xb647('0x3')]},'twitter':{'type':Sequelize[_0xb647('0x3')]},'skype':{'type':Sequelize[_0xb647('0x3')]},'teams':{'type':Sequelize[_0xb647('0x3')]},'viber':{'type':Sequelize[_0xb647('0x3')]},'line':{'type':Sequelize[_0xb647('0x3')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize[_0xb647('0x5')](0x2)[_0xb647('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xb647('0x7')],'defaultValue':Sequelize[_0xb647('0x8')]}}; \ No newline at end of file +var _0x4bdb=['exports','STRING','TEXT','INTEGER','DATE','lodash','sequelize'];(function(_0x22055e,_0x4b91b8){var _0x212a12=function(_0x54a6d4){while(--_0x54a6d4){_0x22055e['push'](_0x22055e['shift']());}};_0x212a12(++_0x4b91b8);}(_0x4bdb,0x116));var _0xb4bd=function(_0x294960,_0x31c92e){_0x294960=_0x294960-0x0;var _0x1aa035=_0x4bdb[_0x294960];return _0x1aa035;};'use strict';var _=require(_0xb4bd('0x0'));var Sequelize=require(_0xb4bd('0x1'));module[_0xb4bd('0x2')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0xb4bd('0x3')]},'street':{'type':Sequelize[_0xb4bd('0x3')]},'postalCode':{'type':Sequelize[_0xb4bd('0x3')]},'city':{'type':Sequelize[_0xb4bd('0x3')]},'country':{'type':Sequelize[_0xb4bd('0x3')]},'dateOfBirth':{'type':Sequelize[_0xb4bd('0x3')]},'description':{'type':Sequelize[_0xb4bd('0x4')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0xb4bd('0x3')]},'fax':{'type':Sequelize[_0xb4bd('0x3')]},'email':{'type':Sequelize[_0xb4bd('0x3')]},'url':{'type':Sequelize[_0xb4bd('0x3')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0xb4bd('0x3')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0xb4bd('0x3')]},'teams':{'type':Sequelize[_0xb4bd('0x3')]},'viber':{'type':Sequelize[_0xb4bd('0x3')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0xb4bd('0x3')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0xb4bd('0x5')]},'priority':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xb4bd('0x6')],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 2264e9b..3719d92 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 _0x4514=['$or','spread','show','$and','omit','format','pickBy','cf_%d','table','cm_contacts','toParam','phone','rawAttributes','options','getTags','setTags','ids','ContactId','includeAll','getHopperHistories','CmHopperHistory','include','CmHopperFinal','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','join','root','server/files/tmp','file','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','createReadStream','parse','meta','import','binding','No\x20firstName\x20column\x20specified','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','pid','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','ejs','lodash','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./cmContact.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','then','destroy','error','name','send','index','describe','keys','length','startsWith','cf_','CmCustomField','findOne','trimStart','all','fieldType','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','select','field','color','from','tools_tags','left_join','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','conditions','find','Tag','value','split','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','and','datetime','castTo','DATE','buildExpression','text','start','push','Contact','isEmpty','ListId','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','isArray','filter','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.fax\x20LIKE\x20?','c.email\x20LIKE\x20?','c.lastName\x20LIKE\x20?','c.id','Sequelize','SELECT','order','having','t.id\x20IN\x20?','resolve','some','User','user','c.ListId\x20IS\x20NULL','c.ListId\x20IN\x20?','map','sequelize','toString','merge','CmContact','c.lastName','c.fax','c.email','c.ListId','c.deletedAt','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','catch','params','columnName','displayName','alias','values','body','findAll','get','mergeWith','tags','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','ChatInteraction','update','ChatOfflineMessage','MailInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','ReportAgentPreview','VoiceCallReport','FaxQueueReport','OpenchannelQueueReport','create','bulkCreate','each','duplicates'];(function(_0x5c509c,_0x123d62){var _0x3da3be=function(_0xb01776){while(--_0xb01776){_0x5c509c['push'](_0x5c509c['shift']());}};_0x3da3be(++_0x123d62);}(_0x4514,0x11c));var _0x4451=function(_0x416b5c,_0x46ddcf){_0x416b5c=_0x416b5c-0x0;var _0x69587c=_0x4514[_0x416b5c];return _0x69587c;};'use strict';var pdf=require(_0x4451('0x0'));var emlformat=require(_0x4451('0x1'));var rimraf=require(_0x4451('0x2'));var zipdir=require(_0x4451('0x3'));var jsonpatch=require(_0x4451('0x4'));var rp=require('request-promise');var moment=require(_0x4451('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4451('0x6'));var path=require(_0x4451('0x7'));var sox=require(_0x4451('0x8'));var csv=require(_0x4451('0x9'));var ejs=require(_0x4451('0xa'));var fs=require('fs');var _=require(_0x4451('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4451('0xc'));var toCsv=require('to-csv');var querystring=require(_0x4451('0xd'));var Papa=require('papaparse');var Redis=require(_0x4451('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x4451('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4451('0x10'))('api');var utils=require('../../config/utils');var config=require(_0x4451('0x11'));var db=require(_0x4451('0x12'))['db'];config['redis']=_[_0x4451('0x13')](config[_0x4451('0x14')],{'host':_0x4451('0x15'),'port':0x18eb});var socket=require(_0x4451('0x16'))(new Redis(config['redis']));require(_0x4451('0x17'))[_0x4451('0x18')](socket);function respondWithStatusCode(_0x29968b,_0x4741ab){_0x4741ab=_0x4741ab||0xcc;return function(_0x402e40){if(_0x402e40){return _0x29968b[_0x4451('0x19')](_0x4741ab);}return _0x29968b[_0x4451('0x1a')](_0x4741ab)[_0x4451('0x1b')]();};}function respondWithResult(_0x489665,_0x2f7c41){_0x2f7c41=_0x2f7c41||0xc8;return function(_0x209199){if(_0x209199){return _0x489665['status'](_0x2f7c41)[_0x4451('0x1c')](_0x209199);}};}function respondWithFilteredResult(_0x401be7,_0x13d1d0){return function(_0x295e55){if(_0x295e55){var _0x18631b=_0x295e55[_0x4451('0x1d')],_0x5428f4=_0x13d1d0[_0x4451('0x1e')],_0x2aaf9b=_0x13d1d0[_0x4451('0x1e')]+_0x13d1d0[_0x4451('0x1f')],_0x5740c8;if(_0x2aaf9b>=_0x18631b){_0x2aaf9b=_0x18631b;_0x5740c8=0xc8;}else{_0x5740c8=0xce;}_0x401be7[_0x4451('0x1a')](_0x5740c8);return _0x401be7[_0x4451('0x20')](_0x4451('0x21'),_0x5428f4+'-'+_0x2aaf9b+'/'+_0x18631b)['json'](_0x295e55);}return null;};}function patchUpdates(_0x439c06){return function(_0x44f6e7){try{jsonpatch['apply'](_0x44f6e7,_0x439c06,!![]);}catch(_0x37d76c){return BPromise[_0x4451('0x22')](_0x37d76c);}return _0x44f6e7['save']();};}function saveUpdates(_0x2ad2aa,_0x45c562){return function(_0x3862ec){if(_0x3862ec){return _0x3862ec['update'](_0x2ad2aa)[_0x4451('0x23')](function(_0x49bf1b){return _0x49bf1b;});}return null;};}function removeEntity(_0x3a6210,_0x480c3c){return function(_0x449906){if(_0x449906){return _0x449906[_0x4451('0x24')]()[_0x4451('0x23')](function(){_0x3a6210[_0x4451('0x1a')](0xcc)[_0x4451('0x1b')]();});}};}function handleEntityNotFound(_0x5bd112,_0x5cb3eb){return function(_0x2d6691){if(!_0x2d6691){_0x5bd112[_0x4451('0x19')](0x194);}return _0x2d6691;};}function handleError(_0x3f45be,_0x34a0ed){_0x34a0ed=_0x34a0ed||0x1f4;return function(_0x5ae845){logger[_0x4451('0x25')](_0x5ae845['stack']);if(_0x5ae845[_0x4451('0x26')]){delete _0x5ae845[_0x4451('0x26')];}_0x3f45be[_0x4451('0x1a')](_0x34a0ed)[_0x4451('0x27')](_0x5ae845);};}exports[_0x4451('0x28')]=function(_0xaa2217,_0x2c8c2a){var _0x9f33e6={},_0x2177b5={},_0x72312a={'count':0x0,'rows':[]};return db['CmContact'][_0x4451('0x29')]()['then'](function(_0x237255){var _0x235054=[];for(var _0x1dbc5d=0x0;_0x1dbc5d0x1){_0x2058f0['or'](_0x4451('0x65'),qs[_0x4451('0x66')](_0x4fab8d),null);}else{if(qs[_0x4451('0x67')](_0x4fab8d)){_0x2058f0['or'](_0x4451('0x68'),_0x4fab8d+'%');_0x2058f0['or'](_0x4451('0x69'),_0x4fab8d+'%');_0x2058f0['or']('c.mobile\x20LIKE\x20?',_0x4fab8d+'%');_0x2058f0['or'](_0x4451('0x6a'),_0x4fab8d+'%');}else if(qs['isEmail'](_0x4fab8d)){_0x2058f0['or'](_0x4451('0x6b'),_0x4fab8d+'%');}else{_0x2058f0['or']('c.firstName\x20LIKE\x20?','%'+_0x4fab8d+'%');_0x2058f0['or'](_0x4451('0x6c'),'%'+_0x4fab8d+'%');_0x2058f0['or'](_0x4451('0x6b'),'%'+_0x4fab8d+'%');}}}}_0x2c4fb0[_0x4451('0x3d')](_0x2058f0);_0x2c4fb0['group'](_0x4451('0x6d'));var _0x25e12f={'type':db[_0x4451('0x6e')]['QueryTypes'][_0x4451('0x6f')],'raw':!![]};var _0xdc5426=_0x2c4fb0['clone']()[_0x4451('0x40')](_0x4451('0x6d'));if(_0x9f33e6[_0x4451('0x70')]){_0x9f33e6[_0x4451('0x70')]['forEach'](function(_0x562303){_0x2c4fb0[_0x4451('0x70')]('c.'+_0x562303[0x0],_0x562303[0x1]==='DESC'?![]:!![]);});}if(!_[_0x4451('0x5c')](_0x1605bd)){_0x2c4fb0[_0x4451('0x71')](_0x2c634e);_0xdc5426[_0x4451('0x3d')](_0x4451('0x72'),_0x1605bd);}BPromise[_0x4451('0x73')]()[_0x4451('0x23')](function(){if(_0x54c330&&!_[_0x4451('0x74')](_0x54c330[_0x4451('0x4c')],[_0x4451('0x40'),_0x4451('0x75')])){return _0xaa2217[_0x4451('0x76')]['getLists']({'attributes':['id'],'raw':!![]})[_0x4451('0x23')](function(_0x1f1927){if(_[_0x4451('0x5c')](_0x1f1927)){_0xdc5426[_0x4451('0x3d')]('c.ListId\x20IS\x20NULL');_0x2c4fb0['where'](_0x4451('0x77'));}else{_0xdc5426[_0x4451('0x3d')](_0x4451('0x78'),_[_0x4451('0x79')](_0x1f1927,'id'));_0x2c4fb0['where'](_0x4451('0x78'),_['map'](_0x1f1927,'id'));}});}else{return;}})[_0x4451('0x23')](function(){db[_0x4451('0x7a')][_0x4451('0x35')](_0xdc5426['toString'](),_0x25e12f)['then'](function(_0x379933){_0x72312a['count']=_0x379933[_0x4451('0x2b')];if(_0x72312a[_0x4451('0x1d')]===0x0)return[];return db['sequelize'][_0x4451('0x35')](_0x371ea2[_0x4451('0x7b')](),_0x25e12f);})[_0x4451('0x23')](function(_0x5c4688){_0x3cc363=_['keyBy'](_0x5c4688,'id');_0x25e12f=_[_0x4451('0x7c')](_0x25e12f,{'model':db[_0x4451('0x7d')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xaa2217[_0x4451('0x35')][_0x4451('0x39')]){_0x9f33e6[_0x4451('0x38')][_0x4451('0x51')](function(_0x2e99a4){_0x2c4fb0[_0x4451('0x40')]('c.'+_0x2e99a4);});}else{_0x2c4fb0[_0x4451('0x40')](_0x4451('0x6d'));_0x2c4fb0[_0x4451('0x40')]('c.firstName');_0x2c4fb0[_0x4451('0x40')](_0x4451('0x7e'));_0x2c4fb0[_0x4451('0x40')]('c.phone');_0x2c4fb0[_0x4451('0x40')]('c.mobile');_0x2c4fb0[_0x4451('0x40')](_0x4451('0x7f'));_0x2c4fb0[_0x4451('0x40')](_0x4451('0x80'));_0x2c4fb0[_0x4451('0x40')](_0x4451('0x81'));_0x2c4fb0[_0x4451('0x40')](_0x4451('0x82'));_0x2c4fb0[_0x4451('0x40')](_0x4451('0x83'),_0x4451('0x84'));}if(_0x9f33e6['limit'])_0x2c4fb0[_0x4451('0x1f')](_0x9f33e6[_0x4451('0x1f')]);if(_0x9f33e6[_0x4451('0x1e')])_0x2c4fb0[_0x4451('0x1e')](_0x9f33e6['offset']);return db[_0x4451('0x7a')][_0x4451('0x35')](_0x2c4fb0[_0x4451('0x7b')](),_0x25e12f);})[_0x4451('0x23')](function(_0x6f9350){_0x6f9350[_0x4451('0x51')](function(_0x12e3de){if(_0x12e3de[_0x4451('0x84')]){_0x12e3de[_0x4451('0x85')]=[];_0x12e3de[_0x4451('0x84')][_0x4451('0x50')](',')[_0x4451('0x51')](function(_0x2b66f0){_0x12e3de[_0x4451('0x85')][_0x4451('0x5a')](_0x3cc363[_0x2b66f0]);});}delete _0x12e3de['TagIds'];});_0x72312a[_0x4451('0x86')]=_0x6f9350;return _0x72312a;})[_0x4451('0x23')](respondWithFilteredResult(_0x2c8c2a,_0x9f33e6));});})[_0x4451('0x87')](handleError(_0x2c8c2a,null));};exports[_0x4451('0x24')]=function(_0x1f54fe,_0x386283){return db[_0x4451('0x7d')][_0x4451('0x4d')]({'where':{'id':_0x1f54fe[_0x4451('0x88')]['id']}})[_0x4451('0x23')](handleEntityNotFound(_0x386283,null))[_0x4451('0x23')](removeEntity(_0x386283,null))['catch'](handleError(_0x386283,null));};exports[_0x4451('0x29')]=function(_0x2630b4,_0x4d424f){return db[_0x4451('0x7d')][_0x4451('0x29')]()[_0x4451('0x23')](function(_0x5f4f1c){delete _0x5f4f1c['tags'];for(var _0x92ac86=0x0;_0x92ac86=_0xf69f1a){_0x5c071f=_0xf69f1a;_0x3e68e9=0xc8;}else{_0x3e68e9=0xce;}_0x6e6a37['status'](_0x3e68e9);return _0x6e6a37[_0xbd95('0x23')](_0xbd95('0x24'),_0x278d77+'-'+_0x5c071f+'/'+_0xf69f1a)[_0xbd95('0x1f')](_0x4cbbfd);}return null;};}function patchUpdates(_0x513f47){return function(_0x41f405){try{jsonpatch[_0xbd95('0x25')](_0x41f405,_0x513f47,!![]);}catch(_0x23256e){return BPromise[_0xbd95('0x26')](_0x23256e);}return _0x41f405[_0xbd95('0x27')]();};}function saveUpdates(_0x369c48,_0x370e5c){return function(_0x2d77e3){if(_0x2d77e3){return _0x2d77e3[_0xbd95('0x28')](_0x369c48)[_0xbd95('0x29')](function(_0x59539f){return _0x59539f;});}return null;};}function removeEntity(_0x467edc,_0x1d22ca){return function(_0x27afe3){if(_0x27afe3){return _0x27afe3[_0xbd95('0x2a')]()[_0xbd95('0x29')](function(){_0x467edc[_0xbd95('0x1e')](0xcc)[_0xbd95('0x2b')]();});}};}function handleEntityNotFound(_0x1afd2f,_0x4ab591){return function(_0x705f6e){if(!_0x705f6e){_0x1afd2f['sendStatus'](0x194);}return _0x705f6e;};}function handleError(_0x553738,_0x594ed1){_0x594ed1=_0x594ed1||0x1f4;return function(_0x5d2efc){logger[_0xbd95('0x2c')](_0x5d2efc[_0xbd95('0x2d')]);if(_0x5d2efc[_0xbd95('0x2e')]){delete _0x5d2efc[_0xbd95('0x2e')];}_0x553738[_0xbd95('0x1e')](_0x594ed1)[_0xbd95('0x2f')](_0x5d2efc);};}exports['index']=function(_0x59721d,_0x5bfaa5){var _0x50b9cc={},_0x47e87d={},_0x37c9de={'count':0x0,'rows':[]};return db['CmContact']['describe']()[_0xbd95('0x29')](function(_0x101a43){var _0x18889a=[];for(var _0x24267f=0x0;_0x24267f0x1){_0x531156['or'](_0xbd95('0x6f'),qs['getFullTextValue'](_0x134b1e),null);}else{if(qs[_0xbd95('0x70')](_0x134b1e)){_0x531156['or'](_0xbd95('0x71'),_0x134b1e+'%');_0x531156['or']('c.phone\x20LIKE\x20?',_0x134b1e+'%');_0x531156['or'](_0xbd95('0x72'),_0x134b1e+'%');_0x531156['or'](_0xbd95('0x73'),_0x134b1e+'%');}else if(qs[_0xbd95('0x74')](_0x134b1e)){_0x531156['or'](_0xbd95('0x75'),_0x134b1e+'%');}else{_0x531156['or'](_0xbd95('0x76'),'%'+_0x134b1e+'%');_0x531156['or'](_0xbd95('0x77'),'%'+_0x134b1e+'%');_0x531156['or'](_0xbd95('0x75'),'%'+_0x134b1e+'%');}}}}_0x59ea33[_0xbd95('0x44')](_0x531156);_0x59ea33[_0xbd95('0x78')]('c.id');var _0x1fe778={'type':db[_0xbd95('0x79')][_0xbd95('0x7a')][_0xbd95('0x7b')],'raw':!![]};var _0x4b64a0=_0x59ea33[_0xbd95('0x7c')]()[_0xbd95('0x47')]('c.id');if(_0x50b9cc[_0xbd95('0x42')]){_0x50b9cc['order'][_0xbd95('0x5a')](function(_0x2117b3){_0x59ea33['order']('c.'+_0x2117b3[0x0],_0x2117b3[0x1]===_0xbd95('0x7d')?![]:!![]);});}if(!_[_0xbd95('0x67')](_0x2d55bf)){_0x59ea33['having'](_0x56f425);_0x4b64a0['where']('t.id\x20IN\x20?',_0x2d55bf);}BPromise[_0xbd95('0x7e')]()[_0xbd95('0x29')](function(){if(_0x1b1ec1&&!_['some'](_0x1b1ec1['conditions'],[_0xbd95('0x47'),_0xbd95('0x5c')])){return _0x59721d[_0xbd95('0x7f')][_0xbd95('0x80')]({'attributes':['id'],'raw':!![]})[_0xbd95('0x29')](function(_0x293034){if(_[_0xbd95('0x67')](_0x293034)){_0x4b64a0['where'](_0xbd95('0x81'));_0x59ea33[_0xbd95('0x44')](_0xbd95('0x81'));}else{_0x4b64a0[_0xbd95('0x44')](_0xbd95('0x68'),_['map'](_0x293034,'id'));_0x59ea33[_0xbd95('0x44')](_0xbd95('0x68'),_[_0xbd95('0x63')](_0x293034,'id'));}});}else{return;}})['then'](function(){db[_0xbd95('0x82')][_0xbd95('0x3b')](_0x4b64a0[_0xbd95('0x83')](),_0x1fe778)['then'](function(_0x1c0112){_0x37c9de['count']=_0x1c0112[_0xbd95('0x37')];if(_0x37c9de['count']===0x0)return[];return db[_0xbd95('0x82')]['query'](_0x32e530[_0xbd95('0x83')](),_0x1fe778);})[_0xbd95('0x29')](function(_0x52f4cd){_0x53d347=_[_0xbd95('0x84')](_0x52f4cd,'id');_0x1fe778=_[_0xbd95('0x85')](_0x1fe778,{'model':db[_0xbd95('0x86')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x59721d[_0xbd95('0x3b')]['fields']){_0x50b9cc[_0xbd95('0x3e')][_0xbd95('0x5a')](function(_0x273056){_0x59ea33['field']('c.'+_0x273056);});}else{_0x59ea33[_0xbd95('0x47')](_0xbd95('0x87'));_0x59ea33[_0xbd95('0x47')](_0xbd95('0x88'));_0x59ea33[_0xbd95('0x47')](_0xbd95('0x89'));_0x59ea33['field'](_0xbd95('0x8a'));_0x59ea33['field'](_0xbd95('0x8b'));_0x59ea33['field'](_0xbd95('0x8c'));_0x59ea33['field']('c.email');_0x59ea33['field']('c.ListId');_0x59ea33[_0xbd95('0x47')](_0xbd95('0x8d'));_0x59ea33[_0xbd95('0x47')](_0xbd95('0x8e'),_0xbd95('0x8f'));}if(_0x50b9cc[_0xbd95('0x22')])_0x59ea33['limit'](_0x50b9cc['limit']);if(_0x50b9cc[_0xbd95('0x21')])_0x59ea33[_0xbd95('0x21')](_0x50b9cc[_0xbd95('0x21')]);return db[_0xbd95('0x82')][_0xbd95('0x3b')](_0x59ea33[_0xbd95('0x83')](),_0x1fe778);})[_0xbd95('0x29')](function(_0x362863){_0x362863[_0xbd95('0x5a')](function(_0x11bf4a){if(_0x11bf4a[_0xbd95('0x8f')]){_0x11bf4a[_0xbd95('0x90')]=[];_0x11bf4a[_0xbd95('0x8f')][_0xbd95('0x59')](',')[_0xbd95('0x5a')](function(_0x26c9ff){_0x11bf4a[_0xbd95('0x90')][_0xbd95('0x33')](_0x53d347[_0x26c9ff]);});}delete _0x11bf4a[_0xbd95('0x8f')];});_0x37c9de[_0xbd95('0x91')]=_0x362863;return _0x37c9de;})[_0xbd95('0x29')](respondWithFilteredResult(_0x5bfaa5,_0x50b9cc));});})[_0xbd95('0x92')](handleError(_0x5bfaa5,null));};exports[_0xbd95('0x2a')]=function(_0x370a01,_0x3b0a18){return db[_0xbd95('0x86')][_0xbd95('0x56')]({'where':{'id':_0x370a01[_0xbd95('0x93')]['id']}})['then'](handleEntityNotFound(_0x3b0a18,null))[_0xbd95('0x29')](removeEntity(_0x3b0a18,null))['catch'](handleError(_0x3b0a18,null));};exports[_0xbd95('0x94')]=function(_0x5a7b9e,_0x2afb0e){return db[_0xbd95('0x86')][_0xbd95('0x94')]()[_0xbd95('0x29')](function(_0x4f3795){delete _0x4f3795[_0xbd95('0x95')];for(var _0x28f30a=0x0;_0x28f30a{}\s\\|]/g,'-');_0x3b5fa4(null,util[_0xd46e('0x21')]('%s-%s%s',path[_0xd46e('0x22')](_0x312d6f[_0xd46e('0x1f')],path[_0xd46e('0x23')](_0x312d6f[_0xd46e('0x1f')])),Date[_0xd46e('0x24')](),path[_0xd46e('0x23')](_0x312d6f[_0xd46e('0x1f')])));}})});router[_0xd46e('0x15')](_0xd46e('0x25'),upload['single'](_0xd46e('0x26')),controller['uploadCsv']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x371054,_0x2a5271,_0x21135f){_0x21135f(null,path[_0xd46e('0x1c')](config[_0xd46e('0x1d')],_0xd46e('0x1e')));},'filename':function(_0x1740d1,_0x4dab6a,_0x45d789){_0x4dab6a[_0xd46e('0x1f')]=_0x4dab6a[_0xd46e('0x1f')][_0xd46e('0x20')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x45d789(null,util[_0xd46e('0x21')](_0xd46e('0x27'),path['basename'](_0x4dab6a[_0xd46e('0x1f')],path[_0xd46e('0x23')](_0x4dab6a[_0xd46e('0x1f')])),Date[_0xd46e('0x24')](),path[_0xd46e('0x23')](_0x4dab6a[_0xd46e('0x1f')])));}})});router[_0xd46e('0x15')](_0xd46e('0x28'),upload[_0xd46e('0x29')](_0xd46e('0x26')),controller[_0xd46e('0x2a')]);router[_0xd46e('0x15')](_0xd46e('0x2b'),auth['isAuthenticated'](),controller[_0xd46e('0x2c')]);router[_0xd46e('0x2d')](_0xd46e('0xc'),auth[_0xd46e('0x8')](),controller['update']);router[_0xd46e('0x2e')](_0xd46e('0xc'),auth['isAuthenticated'](),controller[_0xd46e('0x2f')]);module[_0xd46e('0x30')]=router; \ No newline at end of file +var _0x55ca=['originalname','replace','format','basename','extname','now','file','server/files/tmp','%s-%s%s','single','upload','/upload/:id','put','/:id','update','delete','destroy','exports','multer','util','Router','../../components/auth/service','../../config/environment','./cmContact.controller','get','isAuthenticated','index','/describe','describe','show','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','getJscriptySessions','post','/merge','merge','create','/create_many','bulkCreate','/:id/tags','diskStorage','join','root'];(function(_0x13ce0c,_0x3f2a0d){var _0x4388fb=function(_0x27db4b){while(--_0x27db4b){_0x13ce0c['push'](_0x13ce0c['shift']());}};_0x4388fb(++_0x3f2a0d);}(_0x55ca,0x126));var _0xa55c=function(_0x451d04,_0x999e7d){_0x451d04=_0x451d04-0x0;var _0x32c6fe=_0x55ca[_0x451d04];return _0x32c6fe;};'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/tags',auth[_0xa55c('0x7')](),controller[_0xa55c('0xc')]);router[_0xa55c('0x6')](_0xa55c('0xd'),auth[_0xa55c('0x7')](),controller[_0xa55c('0xe')]);router[_0xa55c('0x6')](_0xa55c('0xf'),auth[_0xa55c('0x7')](),controller[_0xa55c('0x10')]);router['get']('/:id/hopper_finals',auth[_0xa55c('0x7')](),controller['getHopperFinals']);router['get']('/:id/jscripty_sessions',auth[_0xa55c('0x7')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x13'),auth[_0xa55c('0x7')](),controller[_0xa55c('0x14')]);router['post']('/',auth[_0xa55c('0x7')](),controller[_0xa55c('0x15')]);router[_0xa55c('0x12')](_0xa55c('0x16'),auth[_0xa55c('0x7')](),controller[_0xa55c('0x17')]);router[_0xa55c('0x12')](_0xa55c('0x18'),auth[_0xa55c('0x7')](),controller['setTags']);var upload=multer({'storage':multer[_0xa55c('0x19')]({'destination':function(_0x104a99,_0x461284,_0x358b61){_0x358b61(null,path[_0xa55c('0x1a')](config[_0xa55c('0x1b')],'server/files/tmp'));},'filename':function(_0x5f5158,_0xd643cc,_0x3776ac){_0xd643cc[_0xa55c('0x1c')]=_0xd643cc['originalname'][_0xa55c('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3776ac(null,util[_0xa55c('0x1e')]('%s-%s%s',path[_0xa55c('0x1f')](_0xd643cc[_0xa55c('0x1c')],path[_0xa55c('0x20')](_0xd643cc[_0xa55c('0x1c')])),Date[_0xa55c('0x21')](),path['extname'](_0xd643cc[_0xa55c('0x1c')])));}})});router['post']('/csv',upload['single'](_0xa55c('0x22')),controller['uploadCsv']);var upload=multer({'storage':multer[_0xa55c('0x19')]({'destination':function(_0x190757,_0x3f64de,_0xf0e574){_0xf0e574(null,path[_0xa55c('0x1a')](config[_0xa55c('0x1b')],_0xa55c('0x23')));},'filename':function(_0x11e7f7,_0x192df2,_0x3cd152){_0x192df2[_0xa55c('0x1c')]=_0x192df2['originalname'][_0xa55c('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3cd152(null,util[_0xa55c('0x1e')](_0xa55c('0x24'),path[_0xa55c('0x1f')](_0x192df2['originalname'],path[_0xa55c('0x20')](_0x192df2[_0xa55c('0x1c')])),Date[_0xa55c('0x21')](),path[_0xa55c('0x20')](_0x192df2[_0xa55c('0x1c')])));}})});router[_0xa55c('0x12')]('/upload',upload[_0xa55c('0x25')]('file'),controller[_0xa55c('0x26')]);router[_0xa55c('0x12')](_0xa55c('0x27'),auth[_0xa55c('0x7')](),controller['import']);router[_0xa55c('0x28')](_0xa55c('0x29'),auth[_0xa55c('0x7')](),controller[_0xa55c('0x2a')]);router[_0xa55c('0x2b')](_0xa55c('0x29'),auth[_0xa55c('0x7')](),controller[_0xa55c('0x2c')]);module[_0xa55c('0x2d')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 30330c4..4d79273 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 _0x6123=['setDataValue','getDataValue','alias','STRING','name','TEXT','long','type','select','values'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0x6123,0x187));var _0x3612=function(_0x161958,_0x15c347){_0x161958=_0x161958-0x0;var _0x5db905=_0x6123[_0x161958];return _0x5db905;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x1c1aaa){return this[_0x3612('0x0')](_0x3612('0x1'));}},'alias':{'type':Sequelize[_0x3612('0x2')],'allowNull':![],'set':function(_0x4c396f){this['setDataValue'](_0x3612('0x1'),_0x4c396f?_0x4c396f:this[_0x3612('0x0')](_0x3612('0x3')));}},'type':{'type':Sequelize[_0x3612('0x2')],'allowNull':![]},'values':{'type':Sequelize[_0x3612('0x4')](_0x3612('0x5')),'get':function(){if(this[_0x3612('0x0')](_0x3612('0x6'))===_0x3612('0x7')){return JSON['parse'](this[_0x3612('0x0')](_0x3612('0x8')));}else{return this[_0x3612('0x0')](_0x3612('0x8'));}},'set':function(_0x2a9576){if(Array['isArray'](_0x2a9576)){this[_0x3612('0x9')](_0x3612('0x8'),JSON['stringify'](_0x2a9576));}else{this['setDataValue'](_0x3612('0x8'),_0x2a9576);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x934f=['alias','getDataValue','name','STRING','TEXT','long','type','select','parse','values','BOOLEAN','lodash','exports','VIRTUAL','setDataValue'];(function(_0x36117e,_0x539307){var _0x3800e9=function(_0xf43b48){while(--_0xf43b48){_0x36117e['push'](_0x36117e['shift']());}};_0x3800e9(++_0x539307);}(_0x934f,0x173));var _0xf934=function(_0xa8ff2f,_0x43e207){_0xa8ff2f=_0xa8ff2f-0x0;var _0x1c27af=_0x934f[_0xa8ff2f];return _0x1c27af;};'use strict';var Sequelize=require('sequelize');var _=require(_0xf934('0x0'));module[_0xf934('0x1')]={'name':{'type':Sequelize[_0xf934('0x2')],'get':function(_0x2c138f){return this['getDataValue']('alias');}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x289fc6){this[_0xf934('0x3')](_0xf934('0x4'),_0x289fc6?_0x289fc6:this[_0xf934('0x5')](_0xf934('0x6')));}},'type':{'type':Sequelize[_0xf934('0x7')],'allowNull':![]},'values':{'type':Sequelize[_0xf934('0x8')](_0xf934('0x9')),'get':function(){if(this[_0xf934('0x5')](_0xf934('0xa'))===_0xf934('0xb')){return JSON[_0xf934('0xc')](this['getDataValue'](_0xf934('0xd')));}else{return this[_0xf934('0x5')]('values');}},'set':function(_0x59f969){if(Array['isArray'](_0x59f969)){this['setDataValue'](_0xf934('0xd'),JSON['stringify'](_0x59f969));}else{this[_0xf934('0x3')](_0xf934('0xd'),_0x59f969);}}},'required':{'type':Sequelize[_0xf934('0xe')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 0e1ee7c..7a87162 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 _0x6dd2=['type','key','model','differenceBy','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','CmCustomField','includeAll','findAll','rows','catch','show','params','include','body','find','create','sequelize','transaction','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','queryInterface','addColumn','cm_contacts','format','cf_%d','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName'];(function(_0x5ea9f7,_0x5e42da){var _0x295c11=function(_0x43858e){while(--_0x43858e){_0x5ea9f7['push'](_0x5ea9f7['shift']());}};_0x295c11(++_0x5e42da);}(_0x6dd2,0x13e));var _0x26dd=function(_0x44df89,_0x472b67){_0x44df89=_0x44df89-0x0;var _0x6689c=_0x6dd2[_0x44df89];return _0x6689c;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x26dd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x26dd('0x1'));var jsonpatch=require(_0x26dd('0x2'));var rp=require('request-promise');var moment=require(_0x26dd('0x3'));var BPromise=require(_0x26dd('0x4'));var Mustache=require(_0x26dd('0x5'));var util=require('util');var path=require(_0x26dd('0x6'));var sox=require('sox');var csv=require(_0x26dd('0x7'));var ejs=require(_0x26dd('0x8'));var fs=require('fs');var _=require(_0x26dd('0x9'));var squel=require(_0x26dd('0xa'));var crypto=require(_0x26dd('0xb'));var jsforce=require(_0x26dd('0xc'));var deskjs=require(_0x26dd('0xd'));var toCsv=require(_0x26dd('0x7'));var querystring=require(_0x26dd('0xe'));var Papa=require('papaparse');var Redis=require(_0x26dd('0xf'));var authService=require(_0x26dd('0x10'));var qs=require(_0x26dd('0x11'));var as=require(_0x26dd('0x12'));var hardwareService=require(_0x26dd('0x13'));var logger=require(_0x26dd('0x14'))(_0x26dd('0x15'));var utils=require(_0x26dd('0x16'));var config=require('../../config/environment');var db=require(_0x26dd('0x17'))['db'];function respondWithStatusCode(_0x1ff675,_0x2144bb){_0x2144bb=_0x2144bb||0xcc;return function(_0x5ed181){if(_0x5ed181){return _0x1ff675['sendStatus'](_0x2144bb);}return _0x1ff675[_0x26dd('0x18')](_0x2144bb)[_0x26dd('0x19')]();};}function respondWithResult(_0x35b11,_0x32780e){_0x32780e=_0x32780e||0xc8;return function(_0x288006){if(_0x288006){return _0x35b11[_0x26dd('0x18')](_0x32780e)[_0x26dd('0x1a')](_0x288006);}};}function respondWithFilteredResult(_0x389c3b,_0x15eb4e){return function(_0x43ea5c){if(_0x43ea5c){var _0x70abe7=_0x43ea5c[_0x26dd('0x1b')],_0xfe45ca=_0x15eb4e[_0x26dd('0x1c')],_0x4e0500=_0x15eb4e['offset']+_0x15eb4e[_0x26dd('0x1d')],_0x37c1e1;if(_0x4e0500>=_0x70abe7){_0x4e0500=_0x70abe7;_0x37c1e1=0xc8;}else{_0x37c1e1=0xce;}_0x389c3b[_0x26dd('0x18')](_0x37c1e1);return _0x389c3b[_0x26dd('0x1e')](_0x26dd('0x1f'),_0xfe45ca+'-'+_0x4e0500+'/'+_0x70abe7)[_0x26dd('0x1a')](_0x43ea5c);}return null;};}function patchUpdates(_0x305c84){return function(_0xfef766){try{jsonpatch[_0x26dd('0x20')](_0xfef766,_0x305c84,!![]);}catch(_0x1e4f40){return BPromise[_0x26dd('0x21')](_0x1e4f40);}return _0xfef766[_0x26dd('0x22')]();};}function saveUpdates(_0x64279b,_0xbd4555){return function(_0x509e25){if(_0x509e25){return _0x509e25[_0x26dd('0x23')](_0x64279b)['then'](function(_0x516c1f){return _0x516c1f;});}return null;};}function removeEntity(_0x37f991,_0x4f36d5){return function(_0x27f0af){if(_0x27f0af){return _0x27f0af[_0x26dd('0x24')]()[_0x26dd('0x25')](function(){_0x37f991['status'](0xcc)[_0x26dd('0x19')]();});}};}function handleEntityNotFound(_0x276959,_0x17fd42){return function(_0x3aec75){if(!_0x3aec75){_0x276959['sendStatus'](0x194);}return _0x3aec75;};}function handleError(_0x43fd4c,_0x2f2f0b){_0x2f2f0b=_0x2f2f0b||0x1f4;return function(_0x43890c){logger[_0x26dd('0x26')](_0x43890c[_0x26dd('0x27')]);if(_0x43890c[_0x26dd('0x28')]){delete _0x43890c[_0x26dd('0x28')];}_0x43fd4c[_0x26dd('0x18')](_0x2f2f0b)[_0x26dd('0x29')](_0x43890c);};}exports[_0x26dd('0x2a')]=function(_0x256d3c,_0x21eb0e){var _0x2b94cd={},_0x25a26c={},_0x35f775={'count':0x0,'rows':[]};var _0x21efad=_[_0x26dd('0x2b')](db['CmCustomField'][_0x26dd('0x2c')],function(_0x35cb86){return{'name':_0x35cb86[_0x26dd('0x2d')],'type':_0x35cb86[_0x26dd('0x2e')][_0x26dd('0x2f')]};});_0x25a26c[_0x26dd('0x30')]=_[_0x26dd('0x31')](_[_0x26dd('0x2b')](_0x21efad,'name'),[_0x26dd('0x28')]);_0x25a26c['query']=_[_0x26dd('0x32')](_0x256d3c[_0x26dd('0x33')]);_0x25a26c[_0x26dd('0x34')]=_[_0x26dd('0x35')](_0x25a26c[_0x26dd('0x30')],_0x25a26c['query']);_0x2b94cd[_0x26dd('0x36')]=_[_0x26dd('0x35')](_0x25a26c[_0x26dd('0x30')],qs[_0x26dd('0x37')](_0x256d3c[_0x26dd('0x33')][_0x26dd('0x37')]));_0x2b94cd[_0x26dd('0x36')]=_0x2b94cd['attributes'][_0x26dd('0x38')]?_0x2b94cd[_0x26dd('0x36')]:_0x25a26c['model'];if(!_0x256d3c[_0x26dd('0x33')]['hasOwnProperty'](_0x26dd('0x39'))){_0x2b94cd[_0x26dd('0x1d')]=qs['limit'](_0x256d3c[_0x26dd('0x33')][_0x26dd('0x1d')]);_0x2b94cd[_0x26dd('0x1c')]=qs['offset'](_0x256d3c[_0x26dd('0x33')][_0x26dd('0x1c')]);}_0x2b94cd[_0x26dd('0x3a')]=qs[_0x26dd('0x3b')](_0x256d3c[_0x26dd('0x33')][_0x26dd('0x3b')]);_0x2b94cd[_0x26dd('0x3c')]=qs['filters'](_[_0x26dd('0x3d')](_0x256d3c['query'],_0x25a26c['filters']));if(_0x256d3c['query'][_0x26dd('0x3e')]){_0x2b94cd['where']=_[_0x26dd('0x3f')](_0x2b94cd['where'],{'$or':_[_0x26dd('0x2b')](_0x21efad,function(_0x4f33c1){if(_0x4f33c1[_0x26dd('0x2e')]!==_0x26dd('0x40')){var _0x58a8f0={};_0x58a8f0[_0x4f33c1[_0x26dd('0x28')]]={'$like':'%'+_0x256d3c[_0x26dd('0x33')][_0x26dd('0x3e')]+'%'};return _0x58a8f0;}})});}_0x2b94cd=_['merge']({},_0x2b94cd,_0x256d3c[_0x26dd('0x41')]);var _0x23273e={'where':_0x2b94cd[_0x26dd('0x3c')]};return db[_0x26dd('0x42')][_0x26dd('0x1b')](_0x23273e)[_0x26dd('0x25')](function(_0x2992dc){_0x35f775[_0x26dd('0x1b')]=_0x2992dc;if(_0x256d3c[_0x26dd('0x33')][_0x26dd('0x43')]){_0x2b94cd['include']=[{'all':!![]}];}return db[_0x26dd('0x42')][_0x26dd('0x44')](_0x2b94cd);})[_0x26dd('0x25')](function(_0x4e22bb){_0x35f775[_0x26dd('0x45')]=_0x4e22bb;return _0x35f775;})[_0x26dd('0x25')](respondWithFilteredResult(_0x21eb0e,_0x2b94cd))[_0x26dd('0x46')](handleError(_0x21eb0e,null));};exports[_0x26dd('0x47')]=function(_0x3a49b0,_0x3656c7){var _0x358509={'raw':!![],'where':{'id':_0x3a49b0[_0x26dd('0x48')]['id']}},_0x569b9e={};_0x569b9e[_0x26dd('0x30')]=_[_0x26dd('0x32')](db[_0x26dd('0x42')]['rawAttributes']);_0x569b9e[_0x26dd('0x33')]=_[_0x26dd('0x32')](_0x3a49b0[_0x26dd('0x33')]);_0x569b9e[_0x26dd('0x34')]=_[_0x26dd('0x35')](_0x569b9e[_0x26dd('0x30')],_0x569b9e['query']);_0x358509[_0x26dd('0x36')]=_[_0x26dd('0x35')](_0x569b9e[_0x26dd('0x30')],qs[_0x26dd('0x37')](_0x3a49b0['query'][_0x26dd('0x37')]));_0x358509[_0x26dd('0x36')]=_0x358509[_0x26dd('0x36')][_0x26dd('0x38')]?_0x358509[_0x26dd('0x36')]:_0x569b9e[_0x26dd('0x30')];if(_0x3a49b0[_0x26dd('0x33')]['includeAll']){_0x358509[_0x26dd('0x49')]=[{'all':!![]}];}_0x358509=_[_0x26dd('0x3f')]({},_0x358509,_0x3a49b0['options']);return db['CmCustomField']['find'](_0x358509)['then'](handleEntityNotFound(_0x3656c7,null))[_0x26dd('0x25')](respondWithResult(_0x3656c7,null))[_0x26dd('0x46')](handleError(_0x3656c7,null));};exports[_0x26dd('0x23')]=function(_0x1bc2d4,_0x3dfd17){if(_0x1bc2d4[_0x26dd('0x4a')]['id']){delete _0x1bc2d4[_0x26dd('0x4a')]['id'];}return db[_0x26dd('0x42')][_0x26dd('0x4b')]({'where':{'id':_0x1bc2d4[_0x26dd('0x48')]['id']}})[_0x26dd('0x25')](handleEntityNotFound(_0x3dfd17,null))[_0x26dd('0x25')](saveUpdates(_0x1bc2d4[_0x26dd('0x4a')],null))[_0x26dd('0x25')](respondWithResult(_0x3dfd17,null))[_0x26dd('0x46')](handleError(_0x3dfd17,null));};exports[_0x26dd('0x24')]=function(_0x5b200b,_0x39b2ec){return db[_0x26dd('0x42')][_0x26dd('0x4b')]({'where':{'id':_0x5b200b[_0x26dd('0x48')]['id']}})[_0x26dd('0x25')](handleEntityNotFound(_0x39b2ec,null))['then'](removeEntity(_0x39b2ec,null))[_0x26dd('0x46')](handleError(_0x39b2ec,null));};exports[_0x26dd('0x4c')]=function(_0x48b8b2,_0x20fc93){var _0x60fbfd;return db[_0x26dd('0x4d')][_0x26dd('0x4e')](function(_0x2baedf){return db[_0x26dd('0x42')]['create'](_0x48b8b2[_0x26dd('0x4a')],{'transaction':_0x2baedf})[_0x26dd('0x25')](function(_0x4784fa){_0x60fbfd=_0x4784fa;var _0x42ba1f={'type':db[_0x26dd('0x4f')][_0x26dd('0x50')],'transaction':_0x2baedf};switch(_0x48b8b2[_0x26dd('0x4a')]['type']){case _0x26dd('0x51'):_0x42ba1f[_0x26dd('0x2e')]=db[_0x26dd('0x4f')]['TEXT'];break;case _0x26dd('0x52'):_0x42ba1f[_0x26dd('0x2e')]=db['Sequelize'][_0x26dd('0x53')];break;case _0x26dd('0x54'):_0x42ba1f[_0x26dd('0x2e')]=db['Sequelize'][_0x26dd('0x55')];_0x42ba1f['defaultValue']=![];break;default:}return db[_0x26dd('0x4d')][_0x26dd('0x56')][_0x26dd('0x57')](_0x26dd('0x58'),util[_0x26dd('0x59')](_0x26dd('0x5a'),_0x60fbfd['id']),_0x42ba1f);})['then'](function(){return _0x60fbfd;});})[_0x26dd('0x25')](respondWithResult(_0x20fc93,0xc9))[_0x26dd('0x46')](handleError(_0x20fc93,null));}; \ No newline at end of file +var _0x8e76=['key','differenceBy','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','CmCustomField','then','includeAll','include','findAll','rows','catch','show','params','keys','fields','find','body','create','sequelize','transaction','Sequelize','TEXT','number','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','format','cf_%d','html-pdf','rimraf','zip-dir','moment','bluebird','mustache','util','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','set','json','apply','update','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','type'];(function(_0x5e80a1,_0x5558fa){var _0x2290fc=function(_0x28f829){while(--_0x28f829){_0x5e80a1['push'](_0x5e80a1['shift']());}};_0x2290fc(++_0x5558fa);}(_0x8e76,0x135));var _0x68e7=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0x8e76[_0x2a6809];return _0x11c371;};'use strict';var pdf=require(_0x68e7('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x68e7('0x1'));var zipdir=require(_0x68e7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x68e7('0x3'));var BPromise=require(_0x68e7('0x4'));var Mustache=require(_0x68e7('0x5'));var util=require(_0x68e7('0x6'));var path=require('path');var sox=require(_0x68e7('0x7'));var csv=require(_0x68e7('0x8'));var ejs=require(_0x68e7('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x68e7('0xa'));var jsforce=require(_0x68e7('0xb'));var deskjs=require(_0x68e7('0xc'));var toCsv=require('to-csv');var querystring=require(_0x68e7('0xd'));var Papa=require(_0x68e7('0xe'));var Redis=require(_0x68e7('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x68e7('0x10'));var as=require(_0x68e7('0x11'));var hardwareService=require(_0x68e7('0x12'));var logger=require('../../config/logger')(_0x68e7('0x13'));var utils=require(_0x68e7('0x14'));var config=require(_0x68e7('0x15'));var db=require(_0x68e7('0x16'))['db'];function respondWithStatusCode(_0x4cfb8b,_0x3a0d7c){_0x3a0d7c=_0x3a0d7c||0xcc;return function(_0xc8a831){if(_0xc8a831){return _0x4cfb8b[_0x68e7('0x17')](_0x3a0d7c);}return _0x4cfb8b[_0x68e7('0x18')](_0x3a0d7c)['end']();};}function respondWithResult(_0x2c6a97,_0x10a176){_0x10a176=_0x10a176||0xc8;return function(_0x468826){if(_0x468826){return _0x2c6a97['status'](_0x10a176)['json'](_0x468826);}};}function respondWithFilteredResult(_0x5d1a0d,_0x107029){return function(_0x1e256a){if(_0x1e256a){var _0x477ffc=_0x1e256a[_0x68e7('0x19')],_0x5b5331=_0x107029[_0x68e7('0x1a')],_0x45ae27=_0x107029[_0x68e7('0x1a')]+_0x107029[_0x68e7('0x1b')],_0x4cf785;if(_0x45ae27>=_0x477ffc){_0x45ae27=_0x477ffc;_0x4cf785=0xc8;}else{_0x4cf785=0xce;}_0x5d1a0d[_0x68e7('0x18')](_0x4cf785);return _0x5d1a0d[_0x68e7('0x1c')]('Content-Range',_0x5b5331+'-'+_0x45ae27+'/'+_0x477ffc)[_0x68e7('0x1d')](_0x1e256a);}return null;};}function patchUpdates(_0x35de5e){return function(_0x185a0d){try{jsonpatch[_0x68e7('0x1e')](_0x185a0d,_0x35de5e,!![]);}catch(_0x53e6fa){return BPromise['reject'](_0x53e6fa);}return _0x185a0d['save']();};}function saveUpdates(_0x36eb8a,_0x1bde64){return function(_0x4f4907){if(_0x4f4907){return _0x4f4907[_0x68e7('0x1f')](_0x36eb8a)['then'](function(_0x3ffe29){return _0x3ffe29;});}return null;};}function removeEntity(_0x4fdfd7,_0x37609a){return function(_0x57a25a){if(_0x57a25a){return _0x57a25a[_0x68e7('0x20')]()['then'](function(){_0x4fdfd7[_0x68e7('0x18')](0xcc)[_0x68e7('0x21')]();});}};}function handleEntityNotFound(_0x548b99,_0x2e4e46){return function(_0x41b0c8){if(!_0x41b0c8){_0x548b99[_0x68e7('0x17')](0x194);}return _0x41b0c8;};}function handleError(_0x2fcca5,_0xa01536){_0xa01536=_0xa01536||0x1f4;return function(_0x10a10f){logger[_0x68e7('0x22')](_0x10a10f[_0x68e7('0x23')]);if(_0x10a10f[_0x68e7('0x24')]){delete _0x10a10f[_0x68e7('0x24')];}_0x2fcca5['status'](_0xa01536)[_0x68e7('0x25')](_0x10a10f);};}exports[_0x68e7('0x26')]=function(_0x1974ca,_0x428511){var _0x2ee190={},_0xe28ee8={},_0x570dab={'count':0x0,'rows':[]};var _0x5b010a=_[_0x68e7('0x27')](db['CmCustomField'][_0x68e7('0x28')],function(_0x118b13){return{'name':_0x118b13[_0x68e7('0x29')],'type':_0x118b13[_0x68e7('0x2a')][_0x68e7('0x2b')]};});_0xe28ee8['model']=_[_0x68e7('0x2c')](_[_0x68e7('0x27')](_0x5b010a,_0x68e7('0x24')),[_0x68e7('0x24')]);_0xe28ee8[_0x68e7('0x2d')]=_['keys'](_0x1974ca[_0x68e7('0x2d')]);_0xe28ee8[_0x68e7('0x2e')]=_[_0x68e7('0x2f')](_0xe28ee8[_0x68e7('0x30')],_0xe28ee8[_0x68e7('0x2d')]);_0x2ee190[_0x68e7('0x31')]=_['intersection'](_0xe28ee8[_0x68e7('0x30')],qs['fields'](_0x1974ca[_0x68e7('0x2d')]['fields']));_0x2ee190[_0x68e7('0x31')]=_0x2ee190['attributes'][_0x68e7('0x32')]?_0x2ee190['attributes']:_0xe28ee8[_0x68e7('0x30')];if(!_0x1974ca[_0x68e7('0x2d')][_0x68e7('0x33')](_0x68e7('0x34'))){_0x2ee190[_0x68e7('0x1b')]=qs['limit'](_0x1974ca[_0x68e7('0x2d')]['limit']);_0x2ee190[_0x68e7('0x1a')]=qs[_0x68e7('0x1a')](_0x1974ca['query'][_0x68e7('0x1a')]);}_0x2ee190[_0x68e7('0x35')]=qs[_0x68e7('0x36')](_0x1974ca['query'][_0x68e7('0x36')]);_0x2ee190[_0x68e7('0x37')]=qs[_0x68e7('0x2e')](_[_0x68e7('0x38')](_0x1974ca['query'],_0xe28ee8[_0x68e7('0x2e')]));if(_0x1974ca[_0x68e7('0x2d')]['filter']){_0x2ee190['where']=_[_0x68e7('0x39')](_0x2ee190[_0x68e7('0x37')],{'$or':_[_0x68e7('0x27')](_0x5b010a,function(_0x2f8a2e){if(_0x2f8a2e[_0x68e7('0x2a')]!==_0x68e7('0x3a')){var _0x39c98b={};_0x39c98b[_0x2f8a2e[_0x68e7('0x24')]]={'$like':'%'+_0x1974ca[_0x68e7('0x2d')][_0x68e7('0x3b')]+'%'};return _0x39c98b;}})});}_0x2ee190=_['merge']({},_0x2ee190,_0x1974ca[_0x68e7('0x3c')]);var _0x2bc54d={'where':_0x2ee190[_0x68e7('0x37')]};return db[_0x68e7('0x3d')][_0x68e7('0x19')](_0x2bc54d)[_0x68e7('0x3e')](function(_0x127ea8){_0x570dab[_0x68e7('0x19')]=_0x127ea8;if(_0x1974ca['query'][_0x68e7('0x3f')]){_0x2ee190[_0x68e7('0x40')]=[{'all':!![]}];}return db[_0x68e7('0x3d')][_0x68e7('0x41')](_0x2ee190);})['then'](function(_0x486874){_0x570dab[_0x68e7('0x42')]=_0x486874;return _0x570dab;})[_0x68e7('0x3e')](respondWithFilteredResult(_0x428511,_0x2ee190))[_0x68e7('0x43')](handleError(_0x428511,null));};exports[_0x68e7('0x44')]=function(_0x55ce65,_0x35c3f0){var _0xe68a1={'raw':!![],'where':{'id':_0x55ce65[_0x68e7('0x45')]['id']}},_0x527398={};_0x527398[_0x68e7('0x30')]=_[_0x68e7('0x46')](db['CmCustomField']['rawAttributes']);_0x527398['query']=_[_0x68e7('0x46')](_0x55ce65['query']);_0x527398['filters']=_[_0x68e7('0x2f')](_0x527398[_0x68e7('0x30')],_0x527398[_0x68e7('0x2d')]);_0xe68a1['attributes']=_['intersection'](_0x527398[_0x68e7('0x30')],qs[_0x68e7('0x47')](_0x55ce65[_0x68e7('0x2d')][_0x68e7('0x47')]));_0xe68a1[_0x68e7('0x31')]=_0xe68a1[_0x68e7('0x31')][_0x68e7('0x32')]?_0xe68a1['attributes']:_0x527398[_0x68e7('0x30')];if(_0x55ce65[_0x68e7('0x2d')][_0x68e7('0x3f')]){_0xe68a1[_0x68e7('0x40')]=[{'all':!![]}];}_0xe68a1=_[_0x68e7('0x39')]({},_0xe68a1,_0x55ce65[_0x68e7('0x3c')]);return db['CmCustomField'][_0x68e7('0x48')](_0xe68a1)['then'](handleEntityNotFound(_0x35c3f0,null))['then'](respondWithResult(_0x35c3f0,null))['catch'](handleError(_0x35c3f0,null));};exports['update']=function(_0x9b6e64,_0x5ef20a){if(_0x9b6e64['body']['id']){delete _0x9b6e64[_0x68e7('0x49')]['id'];}return db[_0x68e7('0x3d')][_0x68e7('0x48')]({'where':{'id':_0x9b6e64[_0x68e7('0x45')]['id']}})['then'](handleEntityNotFound(_0x5ef20a,null))[_0x68e7('0x3e')](saveUpdates(_0x9b6e64['body'],null))['then'](respondWithResult(_0x5ef20a,null))[_0x68e7('0x43')](handleError(_0x5ef20a,null));};exports[_0x68e7('0x20')]=function(_0x16eea1,_0x20295b){return db[_0x68e7('0x3d')][_0x68e7('0x48')]({'where':{'id':_0x16eea1[_0x68e7('0x45')]['id']}})[_0x68e7('0x3e')](handleEntityNotFound(_0x20295b,null))['then'](removeEntity(_0x20295b,null))[_0x68e7('0x43')](handleError(_0x20295b,null));};exports[_0x68e7('0x4a')]=function(_0xea517b,_0x2a7700){var _0x3a0321;return db[_0x68e7('0x4b')][_0x68e7('0x4c')](function(_0x2d9db0){return db[_0x68e7('0x3d')][_0x68e7('0x4a')](_0xea517b[_0x68e7('0x49')],{'transaction':_0x2d9db0})[_0x68e7('0x3e')](function(_0x22b00a){_0x3a0321=_0x22b00a;var _0x1cbdc0={'type':db[_0x68e7('0x4d')][_0x68e7('0x4e')],'transaction':_0x2d9db0};switch(_0xea517b[_0x68e7('0x49')][_0x68e7('0x2a')]){case'text':_0x1cbdc0[_0x68e7('0x2a')]=db[_0x68e7('0x4d')][_0x68e7('0x4e')];break;case _0x68e7('0x4f'):_0x1cbdc0[_0x68e7('0x2a')]=db[_0x68e7('0x4d')]['INTEGER'];break;case _0x68e7('0x50'):_0x1cbdc0[_0x68e7('0x2a')]=db['Sequelize'][_0x68e7('0x51')];_0x1cbdc0[_0x68e7('0x52')]=![];break;default:}return db[_0x68e7('0x4b')][_0x68e7('0x53')][_0x68e7('0x54')](_0x68e7('0x55'),util[_0x68e7('0x56')](_0x68e7('0x57'),_0x3a0321['id']),_0x1cbdc0);})[_0x68e7('0x3e')](function(){return _0x3a0321;});})[_0x68e7('0x3e')](respondWithResult(_0x2a7700,0xc9))['catch'](handleError(_0x2a7700,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index c873dae..85870c7 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 _0x47fa=['moment','bluebird','path','rimraf','./cmCustomField.attributes','exports','define','CmCustomField','cm_custom_fields','lodash','util','../../config/logger','api'];(function(_0x1795f8,_0x27fe71){var _0x3bed40=function(_0x1b7ed2){while(--_0x1b7ed2){_0x1795f8['push'](_0x1795f8['shift']());}};_0x3bed40(++_0x27fe71);}(_0x47fa,0xb2));var _0xa47f=function(_0x5b697a,_0x280202){_0x5b697a=_0x5b697a-0x0;var _0x5de43b=_0x47fa[_0x5b697a];return _0x5de43b;};'use strict';var _=require(_0xa47f('0x0'));var util=require(_0xa47f('0x1'));var logger=require(_0xa47f('0x2'))(_0xa47f('0x3'));var moment=require(_0xa47f('0x4'));var BPromise=require(_0xa47f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa47f('0x6'));var rimraf=require(_0xa47f('0x7'));var config=require('../../config/environment');var attributes=require(_0xa47f('0x8'));module[_0xa47f('0x9')]=function(_0x53e598,_0x78ef69){return _0x53e598[_0xa47f('0xa')](_0xa47f('0xb'),attributes,{'tableName':_0xa47f('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdddf=['path','rimraf','../../config/environment','exports','define','lodash','util','api','moment','request-promise'];(function(_0xa7a348,_0x585d84){var _0x372095=function(_0x37d98b){while(--_0x37d98b){_0xa7a348['push'](_0xa7a348['shift']());}};_0x372095(++_0x585d84);}(_0xdddf,0x9b));var _0xfddd=function(_0x44bffa,_0x5f2af9){_0x44bffa=_0x44bffa-0x0;var _0x1e9134=_0xdddf[_0x44bffa];return _0x1e9134;};'use strict';var _=require(_0xfddd('0x0'));var util=require(_0xfddd('0x1'));var logger=require('../../config/logger')(_0xfddd('0x2'));var moment=require(_0xfddd('0x3'));var BPromise=require('bluebird');var rp=require(_0xfddd('0x4'));var fs=require('fs');var path=require(_0xfddd('0x5'));var rimraf=require(_0xfddd('0x6'));var config=require(_0xfddd('0x7'));var attributes=require('./cmCustomField.attributes');module[_0xfddd('0x8')]=function(_0x5c50bd,_0x86a8a4){return _0x5c50bd[_0xfddd('0x9')]('CmCustomField',attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index 4006b50..d622c5c 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 _0xed1f=['request','then','info','CmCustomField,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x51198c,_0x123a72){var _0x59e4e3=function(_0x388147){while(--_0x388147){_0x51198c['push'](_0x51198c['shift']());}};_0x59e4e3(++_0x123a72);}(_0xed1f,0x6a));var _0xfed1=function(_0x3fba9f,_0x3b7b9b){_0x3fba9f=_0x3fba9f-0x0;var _0x192cf1=_0xed1f[_0x3fba9f];return _0x192cf1;};'use strict';var _=require(_0xfed1('0x0'));var util=require(_0xfed1('0x1'));var moment=require(_0xfed1('0x2'));var BPromise=require(_0xfed1('0x3'));var rs=require(_0xfed1('0x4'));var fs=require('fs');var Redis=require(_0xfed1('0x5'));var db=require(_0xfed1('0x6'))['db'];var utils=require(_0xfed1('0x7'));var logger=require(_0xfed1('0x8'))(_0xfed1('0x9'));var config=require(_0xfed1('0xa'));var jayson=require(_0xfed1('0xb'));var client=jayson[_0xfed1('0xc')][_0xfed1('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x380e18,_0x612b38,_0x2a6082){return new BPromise(function(_0x2967ef,_0x568d48){return client[_0xfed1('0xe')](_0x380e18,_0x2a6082)[_0xfed1('0xf')](function(_0x48862d){logger[_0xfed1('0x10')](_0xfed1('0x11'),_0x612b38,'request\x20sent');logger[_0xfed1('0x12')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0x612b38,_0xfed1('0x13'),JSON[_0xfed1('0x14')](_0x48862d));if(_0x48862d['error']){if(_0x48862d['error'][_0xfed1('0x15')]===0x1f4){logger[_0xfed1('0x16')]('CmCustomField,\x20%s,\x20%s',_0x612b38,_0x48862d[_0xfed1('0x16')]['message']);return _0x568d48(_0x48862d['error'][_0xfed1('0x17')]);}logger[_0xfed1('0x16')]('CmCustomField,\x20%s,\x20%s',_0x612b38,_0x48862d[_0xfed1('0x16')]['message']);return _0x2967ef(_0x48862d['error'][_0xfed1('0x17')]);}else{logger[_0xfed1('0x10')](_0xfed1('0x11'),_0x612b38,_0xfed1('0x13'));_0x2967ef(_0x48862d['result'][_0xfed1('0x17')]);}})['catch'](function(_0x36ff34){logger[_0xfed1('0x16')]('CmCustomField,\x20%s,\x20%s',_0x612b38,_0x36ff34);_0x568d48(_0x36ff34);});});} \ No newline at end of file +var _0xd0bb=['debug','stringify','error','code','CmCustomField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','request\x20sent'];(function(_0x14c56d,_0xcb2098){var _0x44df26=function(_0x57c118){while(--_0x57c118){_0x14c56d['push'](_0x14c56d['shift']());}};_0x44df26(++_0xcb2098);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0x358fd3,_0x4a9c44){_0x358fd3=_0x358fd3-0x0;var _0x1ad0f3=_0xd0bb[_0x358fd3];return _0x1ad0f3;};'use strict';var _=require(_0xbd0b('0x0'));var util=require(_0xbd0b('0x1'));var moment=require(_0xbd0b('0x2'));var BPromise=require('bluebird');var rs=require(_0xbd0b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbd0b('0x4'))['db'];var utils=require(_0xbd0b('0x5'));var logger=require('../../config/logger')(_0xbd0b('0x6'));var config=require('../../config/environment');var jayson=require(_0xbd0b('0x7'));var client=jayson[_0xbd0b('0x8')][_0xbd0b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x37c205,_0x809599,_0x5eb975){return new BPromise(function(_0x2a4075,_0x4533ff){return client[_0xbd0b('0xa')](_0x37c205,_0x5eb975)[_0xbd0b('0xb')](function(_0x16e185){logger['info']('CmCustomField,\x20%s,\x20%s',_0x809599,_0xbd0b('0xc'));logger[_0xbd0b('0xd')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0x809599,_0xbd0b('0xc'),JSON[_0xbd0b('0xe')](_0x16e185));if(_0x16e185['error']){if(_0x16e185[_0xbd0b('0xf')][_0xbd0b('0x10')]===0x1f4){logger[_0xbd0b('0xf')](_0xbd0b('0x11'),_0x809599,_0x16e185[_0xbd0b('0xf')][_0xbd0b('0x12')]);return _0x4533ff(_0x16e185[_0xbd0b('0xf')][_0xbd0b('0x12')]);}logger[_0xbd0b('0xf')](_0xbd0b('0x11'),_0x809599,_0x16e185[_0xbd0b('0xf')]['message']);return _0x2a4075(_0x16e185[_0xbd0b('0xf')]['message']);}else{logger['info'](_0xbd0b('0x11'),_0x809599,_0xbd0b('0xc'));_0x2a4075(_0x16e185[_0xbd0b('0x13')][_0xbd0b('0x12')]);}})[_0xbd0b('0x14')](function(_0x546db3){logger['error'](_0xbd0b('0x11'),_0x809599,_0x546db3);_0x4533ff(_0x546db3);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index e5a36de..d757a40 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 _0x2fd0=['Router','../../components/auth/service','./cmCustomField.controller','isAuthenticated','index','get','show','post','put','/:id','update','delete','exports','multer','util','path','connect-timeout','express'];(function(_0xf91841,_0x182ae3){var _0x4b9c44=function(_0x2e216e){while(--_0x2e216e){_0xf91841['push'](_0xf91841['shift']());}};_0x4b9c44(++_0x182ae3);}(_0x2fd0,0x1e1));var _0x02fd=function(_0x7132d2,_0x38ca71){_0x7132d2=_0x7132d2-0x0;var _0x1f2920=_0x2fd0[_0x7132d2];return _0x1f2920;};'use strict';var multer=require(_0x02fd('0x0'));var util=require(_0x02fd('0x1'));var path=require(_0x02fd('0x2'));var timeout=require(_0x02fd('0x3'));var express=require(_0x02fd('0x4'));var router=express[_0x02fd('0x5')]();var auth=require(_0x02fd('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x02fd('0x7'));router['get']('/',auth[_0x02fd('0x8')](),controller[_0x02fd('0x9')]);router[_0x02fd('0xa')]('/:id',auth[_0x02fd('0x8')](),controller[_0x02fd('0xb')]);router[_0x02fd('0xc')]('/',auth[_0x02fd('0x8')](),controller['create']);router[_0x02fd('0xd')](_0x02fd('0xe'),auth[_0x02fd('0x8')](),controller[_0x02fd('0xf')]);router[_0x02fd('0x10')](_0x02fd('0xe'),auth[_0x02fd('0x8')](),controller['destroy']);module[_0x02fd('0x11')]=router; \ No newline at end of file +var _0xc195=['express','Router','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','multer','util','path'];(function(_0x597049,_0x582690){var _0x30f47b=function(_0x580cb8){while(--_0x580cb8){_0x597049['push'](_0x597049['shift']());}};_0x30f47b(++_0x582690);}(_0xc195,0x95));var _0x5c19=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0xc195[_0x29d94e];return _0x106237;};'use strict';var multer=require(_0x5c19('0x0'));var util=require(_0x5c19('0x1'));var path=require(_0x5c19('0x2'));var timeout=require('connect-timeout');var express=require(_0x5c19('0x3'));var router=express[_0x5c19('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x5c19('0x5'));var config=require(_0x5c19('0x6'));var controller=require(_0x5c19('0x7'));router[_0x5c19('0x8')]('/',auth[_0x5c19('0x9')](),controller[_0x5c19('0xa')]);router['get'](_0x5c19('0xb'),auth[_0x5c19('0x9')](),controller[_0x5c19('0xc')]);router[_0x5c19('0xd')]('/',auth[_0x5c19('0x9')](),controller[_0x5c19('0xe')]);router['put'](_0x5c19('0xb'),auth[_0x5c19('0x9')](),controller[_0x5c19('0xf')]);router[_0x5c19('0x10')](_0x5c19('0xb'),auth['isAuthenticated'](),controller[_0x5c19('0x11')]);module[_0x5c19('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 7a986b7..a19f1c4 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 _0x44e8=['STRING','BOOLEAN','DATE','format','INTEGER','UNSIGNED','contactListQueue','moment'];(function(_0x1000e3,_0x3fd3f2){var _0xda3798=function(_0x8c2b32){while(--_0x8c2b32){_0x1000e3['push'](_0x1000e3['shift']());}};_0xda3798(++_0x3fd3f2);}(_0x44e8,0xd7));var _0x844e=function(_0x21e741,_0x2f2eef){_0x21e741=_0x21e741-0x0;var _0x26749d=_0x44e8[_0x21e741];return _0x26749d;};'use strict';var moment=require(_0x844e('0x0'));var Sequelize=require('sequelize');module['exports']={'phone':{'type':Sequelize[_0x844e('0x1')],'allowNull':![]},'active':{'type':Sequelize[_0x844e('0x2')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x844e('0x3')],'defaultValue':moment()[_0x844e('0x4')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x844e('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x844e('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x844e('0x5')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x844e('0x2')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x844e('0x3')]},'priority':{'type':Sequelize[_0x844e('0x5')](0x2)[_0x844e('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x844e('0x2')],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x844e('0x7')},'ListId':{'type':Sequelize[_0x844e('0x5')],'unique':_0x844e('0x7')},'UserId':{'type':Sequelize[_0x844e('0x5')]},'VoiceQueueId':{'type':Sequelize[_0x844e('0x5')],'unique':_0x844e('0x7')},'CampaignId':{'type':Sequelize['INTEGER']},'countnosuchnumberretry':{'type':Sequelize[_0x844e('0x5')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x844e('0x5')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x844e('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x844e('0x5')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x844e('0x5')],'defaultValue':0x0}}; \ No newline at end of file +var _0x3baf=['STRING','BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','contactListQueue','moment','sequelize','exports'];(function(_0x51ed6e,_0x3bcc0e){var _0x554c80=function(_0x53afbf){while(--_0x53afbf){_0x51ed6e['push'](_0x51ed6e['shift']());}};_0x554c80(++_0x3bcc0e);}(_0x3baf,0xf7));var _0xf3ba=function(_0x4715fe,_0x590fd2){_0x4715fe=_0x4715fe-0x0;var _0x59255c=_0x3baf[_0x4715fe];return _0x59255c;};'use strict';var moment=require(_0xf3ba('0x0'));var Sequelize=require(_0xf3ba('0x1'));module[_0xf3ba('0x2')]={'phone':{'type':Sequelize[_0xf3ba('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0xf3ba('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xf3ba('0x5')],'defaultValue':moment()[_0xf3ba('0x6')](_0xf3ba('0x7'))},'countbusyretry':{'type':Sequelize[_0xf3ba('0x8')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xf3ba('0x8')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xf3ba('0x8')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xf3ba('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xf3ba('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xf3ba('0x5')]},'priority':{'type':Sequelize[_0xf3ba('0x8')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0xf3ba('0x9')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0xf3ba('0x9')},'UserId':{'type':Sequelize[_0xf3ba('0x8')]},'VoiceQueueId':{'type':Sequelize[_0xf3ba('0x8')],'unique':_0xf3ba('0x9')},'CampaignId':{'type':Sequelize[_0xf3ba('0x8')]},'countnosuchnumberretry':{'type':Sequelize[_0xf3ba('0x8')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xf3ba('0x8')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xf3ba('0x8')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xf3ba('0x8')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xf3ba('0x8')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index 0c3bcb1..a04fd84 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 _0x16b6=['deleted','campaign','user','UserId','deletedat','format','calleridnum','phone','queue','ivr','CmContact','ContactId','firstName','lastName','isNil','calleridname','finally','getPreview','getVoiceQueues','outbound','dialOrderByScheduledAt','sequelize','YYYY-MM-DD\x20HH:mm:ss','direction','isEmpty','hopperIds','priority','ASC','scheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','COALESCE(CmHopper.UserId,\x200)\x20DESC','scheduledat','LOCK','UPDATE','Contact','Company','List','Queue','dialActive','preview','isNumber','error','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','$and','$or','$gte','$lte','$ne','$eq','$not','$between','$notBetween','$in','$like','$notLike','$overlap','$contained','$any','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','type','filter','options','CmHopper','includeAll','include','findAll','rows','catch','params','find','create','body','update','describe','VoiceQueueId','VoiceQueue','Campaign','CampaignId','omit','createdAt','updatedAt','state'];(function(_0x462359,_0x4c074){var _0x12bc47=function(_0x3be31e){while(--_0x3be31e){_0x462359['push'](_0x462359['shift']());}};_0x12bc47(++_0x4c074);}(_0x16b6,0x150));var _0x616b=function(_0x4c62a9,_0x50613e){_0x4c62a9=_0x4c62a9-0x0;var _0x5e5524=_0x16b6[_0x4c62a9];return _0x5e5524;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x616b('0x0'));var zipdir=require(_0x616b('0x1'));var jsonpatch=require(_0x616b('0x2'));var rp=require(_0x616b('0x3'));var moment=require('moment');var BPromise=require(_0x616b('0x4'));var Mustache=require(_0x616b('0x5'));var util=require(_0x616b('0x6'));var path=require(_0x616b('0x7'));var sox=require(_0x616b('0x8'));var csv=require(_0x616b('0x9'));var ejs=require(_0x616b('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x616b('0xb'));var crypto=require(_0x616b('0xc'));var jsforce=require(_0x616b('0xd'));var deskjs=require(_0x616b('0xe'));var toCsv=require(_0x616b('0x9'));var querystring=require(_0x616b('0xf'));var Papa=require(_0x616b('0x10'));var Redis=require(_0x616b('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x616b('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x616b('0x13'));var logger=require(_0x616b('0x14'))(_0x616b('0x15'));var utils=require(_0x616b('0x16'));var config=require(_0x616b('0x17'));var db=require(_0x616b('0x18'))['db'];function respondWithStatusCode(_0x169c86,_0x35a3b8){_0x35a3b8=_0x35a3b8||0xcc;return function(_0x3d7528){if(_0x3d7528){return _0x169c86[_0x616b('0x19')](_0x35a3b8);}return _0x169c86[_0x616b('0x1a')](_0x35a3b8)[_0x616b('0x1b')]();};}function respondWithResult(_0x3e1d57,_0x2cb026){_0x2cb026=_0x2cb026||0xc8;return function(_0x307d29){if(_0x307d29){return _0x3e1d57[_0x616b('0x1a')](_0x2cb026)[_0x616b('0x1c')](_0x307d29);}};}function respondWithFilteredResult(_0x4c75ff,_0x585a5e){return function(_0x3e4fe9){if(_0x3e4fe9){var _0x5a4f5b=_0x3e4fe9[_0x616b('0x1d')],_0xbdc1e1=_0x585a5e[_0x616b('0x1e')],_0x44a882=_0x585a5e[_0x616b('0x1e')]+_0x585a5e[_0x616b('0x1f')],_0x338fb8;if(_0x44a882>=_0x5a4f5b){_0x44a882=_0x5a4f5b;_0x338fb8=0xc8;}else{_0x338fb8=0xce;}_0x4c75ff['status'](_0x338fb8);return _0x4c75ff[_0x616b('0x20')](_0x616b('0x21'),_0xbdc1e1+'-'+_0x44a882+'/'+_0x5a4f5b)['json'](_0x3e4fe9);}return null;};}function patchUpdates(_0x578553){return function(_0x3ae013){try{jsonpatch[_0x616b('0x22')](_0x3ae013,_0x578553,!![]);}catch(_0xb3274f){return BPromise[_0x616b('0x23')](_0xb3274f);}return _0x3ae013[_0x616b('0x24')]();};}function saveUpdates(_0x3f44ec,_0x4c1cd8){return function(_0x34feb){if(_0x34feb){return _0x34feb['update'](_0x3f44ec)[_0x616b('0x25')](function(_0x45f442){return _0x45f442;});}return null;};}function removeEntity(_0x485d02,_0x3176c9){return function(_0xe8a664){if(_0xe8a664){return _0xe8a664[_0x616b('0x26')]()[_0x616b('0x25')](function(){_0x485d02[_0x616b('0x1a')](0xcc)[_0x616b('0x1b')]();});}};}function handleEntityNotFound(_0x2876a7,_0x5d504e){return function(_0x413a2a){if(!_0x413a2a){_0x2876a7[_0x616b('0x19')](0x194);}return _0x413a2a;};}function handleError(_0x24c92e,_0x305361){_0x305361=_0x305361||0x1f4;return function(_0x14f358){logger['error'](_0x14f358[_0x616b('0x27')]);if(_0x14f358[_0x616b('0x28')]){delete _0x14f358[_0x616b('0x28')];}_0x24c92e[_0x616b('0x1a')](_0x305361)[_0x616b('0x29')](_0x14f358);};}exports[_0x616b('0x2a')]=function(_0x54f0ce,_0x1afa22){var _0x287ed4={},_0x44372d={},_0x337295={'count':0x0,'rows':[]};var _0x3d9d40=_[_0x616b('0x2b')](db['CmHopper'][_0x616b('0x2c')],function(_0x44a4ec){return{'name':_0x44a4ec[_0x616b('0x2d')],'type':_0x44a4ec['type'][_0x616b('0x2e')]};});_0x44372d[_0x616b('0x2f')]=_[_0x616b('0x2b')](_0x3d9d40,'name');_0x44372d[_0x616b('0x30')]=_[_0x616b('0x31')](_0x54f0ce[_0x616b('0x30')]);_0x44372d[_0x616b('0x32')]=_['intersection'](_0x44372d[_0x616b('0x2f')],_0x44372d[_0x616b('0x30')]);_0x44372d[_0x616b('0x32')]=_['concat'](_0x44372d['filters'],[_0x616b('0x33'),_0x616b('0x34'),'$gt',_0x616b('0x35'),'$lt',_0x616b('0x36'),_0x616b('0x37'),_0x616b('0x38'),_0x616b('0x39'),_0x616b('0x3a'),_0x616b('0x3b'),_0x616b('0x3c'),'$notIn',_0x616b('0x3d'),_0x616b('0x3e'),'$iLike','$notILike',_0x616b('0x3d'),_0x616b('0x3f'),'$contains',_0x616b('0x40'),_0x616b('0x41')]);_0x287ed4[_0x616b('0x42')]=_[_0x616b('0x43')](_0x44372d[_0x616b('0x2f')],qs[_0x616b('0x44')](_0x54f0ce[_0x616b('0x30')]['fields']));_0x287ed4[_0x616b('0x42')]=_0x287ed4['attributes'][_0x616b('0x45')]?_0x287ed4[_0x616b('0x42')]:_0x44372d['model'];if(!_0x54f0ce[_0x616b('0x30')][_0x616b('0x46')](_0x616b('0x47'))){_0x287ed4[_0x616b('0x1f')]=qs[_0x616b('0x1f')](_0x54f0ce[_0x616b('0x30')][_0x616b('0x1f')]);_0x287ed4[_0x616b('0x1e')]=qs[_0x616b('0x1e')](_0x54f0ce[_0x616b('0x30')][_0x616b('0x1e')]);}_0x287ed4['order']=qs[_0x616b('0x48')](_0x54f0ce[_0x616b('0x30')]['sort']);_0x287ed4[_0x616b('0x49')]=qs['filters'](_[_0x616b('0x4a')](_0x54f0ce[_0x616b('0x30')],_0x44372d[_0x616b('0x32')]));if(_0x54f0ce['query']['filter']){_0x287ed4[_0x616b('0x49')]=_[_0x616b('0x4b')](_0x287ed4[_0x616b('0x49')],{'$or':_[_0x616b('0x2b')](_0x3d9d40,function(_0xb25d8d){if(_0xb25d8d[_0x616b('0x4c')]!=='VIRTUAL'){var _0x1813aa={};_0x1813aa[_0xb25d8d[_0x616b('0x28')]]={'$like':'%'+_0x54f0ce[_0x616b('0x30')][_0x616b('0x4d')]+'%'};return _0x1813aa;}})});}_0x287ed4=_['merge']({},_0x287ed4,_0x54f0ce[_0x616b('0x4e')]);var _0x129387={'where':_0x287ed4['where']};return db[_0x616b('0x4f')][_0x616b('0x1d')](_0x129387)[_0x616b('0x25')](function(_0x41ade5){_0x337295['count']=_0x41ade5;if(_0x54f0ce[_0x616b('0x30')][_0x616b('0x50')]){_0x287ed4[_0x616b('0x51')]=[{'all':!![]}];}return db[_0x616b('0x4f')][_0x616b('0x52')](_0x287ed4);})[_0x616b('0x25')](function(_0xdcd0a4){_0x337295[_0x616b('0x53')]=_0xdcd0a4;return _0x337295;})['then'](respondWithFilteredResult(_0x1afa22,_0x287ed4))[_0x616b('0x54')](handleError(_0x1afa22,null));};exports['show']=function(_0x15c2b8,_0xd33ffb){var _0x1b47b2={'raw':!![],'where':{'id':_0x15c2b8[_0x616b('0x55')]['id']}},_0x3b11ee={};_0x3b11ee[_0x616b('0x2f')]=_['keys'](db['CmHopper'][_0x616b('0x2c')]);_0x3b11ee[_0x616b('0x30')]=_[_0x616b('0x31')](_0x15c2b8['query']);_0x3b11ee['filters']=_[_0x616b('0x43')](_0x3b11ee[_0x616b('0x2f')],_0x3b11ee[_0x616b('0x30')]);_0x1b47b2[_0x616b('0x42')]=_[_0x616b('0x43')](_0x3b11ee['model'],qs[_0x616b('0x44')](_0x15c2b8[_0x616b('0x30')][_0x616b('0x44')]));_0x1b47b2['attributes']=_0x1b47b2['attributes'][_0x616b('0x45')]?_0x1b47b2[_0x616b('0x42')]:_0x3b11ee['model'];if(_0x15c2b8[_0x616b('0x30')][_0x616b('0x50')]){_0x1b47b2[_0x616b('0x51')]=[{'all':!![]}];}_0x1b47b2=_[_0x616b('0x4b')]({},_0x1b47b2,_0x15c2b8['options']);return db[_0x616b('0x4f')][_0x616b('0x56')](_0x1b47b2)[_0x616b('0x25')](handleEntityNotFound(_0xd33ffb,null))[_0x616b('0x25')](respondWithResult(_0xd33ffb,null))['catch'](handleError(_0xd33ffb,null));};exports[_0x616b('0x57')]=function(_0x56280c,_0x51d988){return db[_0x616b('0x4f')]['create'](_0x56280c[_0x616b('0x58')],{})[_0x616b('0x25')](respondWithResult(_0x51d988,0xc9))[_0x616b('0x54')](handleError(_0x51d988,null));};exports[_0x616b('0x59')]=function(_0x1cb3b9,_0x54c290){if(_0x1cb3b9[_0x616b('0x58')]['id']){delete _0x1cb3b9['body']['id'];}return db[_0x616b('0x4f')][_0x616b('0x56')]({'where':{'id':_0x1cb3b9[_0x616b('0x55')]['id']}})[_0x616b('0x25')](handleEntityNotFound(_0x54c290,null))[_0x616b('0x25')](saveUpdates(_0x1cb3b9[_0x616b('0x58')],null))[_0x616b('0x25')](respondWithResult(_0x54c290,null))[_0x616b('0x54')](handleError(_0x54c290,null));};exports['describe']=function(_0x2edcc9,_0x8b6af2){return db[_0x616b('0x4f')][_0x616b('0x5a')]()[_0x616b('0x25')](respondWithResult(_0x8b6af2,null))[_0x616b('0x54')](handleError(_0x8b6af2,null));};exports[_0x616b('0x26')]=function(_0x1f3276,_0x10d1fd){var _0x3e24ba;return db[_0x616b('0x4f')]['find']({'where':{'id':_0x1f3276[_0x616b('0x55')]['id']}})['then'](handleEntityNotFound(_0x10d1fd,null))['then'](function(_0x34f050){if(_0x34f050){return _0x34f050['destroy']()[_0x616b('0x25')](function(_0x19e718){return _0x19e718;});}})[_0x616b('0x25')](function(_0x1becb0){_0x3e24ba=_0x1becb0;if(_0x1becb0){if(_0x1becb0[_0x616b('0x5b')]||_0x1becb0['CampaignId']){return db[_0x1becb0[_0x616b('0x5b')]?_0x616b('0x5c'):_0x616b('0x5d')][_0x616b('0x56')]({'where':{'id':_0x1becb0[_0x616b('0x5b')]?_0x1becb0[_0x616b('0x5b')]:_0x1becb0[_0x616b('0x5e')]},'attributes':['id',_0x616b('0x28')],'raw':!![]});}}})[_0x616b('0x25')](function(_0x157fd3){var _0x52fda7={};if(_0x157fd3){_['merge'](_0x52fda7,_[_0x616b('0x5f')](_0x3e24ba['dataValues'],[_0x616b('0x60'),_0x616b('0x61'),'id']));_0x52fda7[_0x616b('0x62')]=0x15;_0x52fda7['statedesc']=_0x616b('0x63');_0x52fda7[_0x616b('0x64')]=_0x157fd3['name'];_0x52fda7['membername']=_0x1f3276[_0x616b('0x65')]['name'];_0x52fda7[_0x616b('0x66')]=_0x1f3276['user']['id'];_0x52fda7[_0x616b('0x63')]=!![];_0x52fda7[_0x616b('0x67')]=moment()[_0x616b('0x68')]('YYYY-MM-DD\x20HH:mm:ss');_0x52fda7[_0x616b('0x69')]=_0x3e24ba[_0x616b('0x6a')];_0x52fda7['campaigntype']=_0x3e24ba[_0x616b('0x5b')]?_0x616b('0x6b'):_0x616b('0x6c');return db[_0x616b('0x6d')][_0x616b('0x56')]({'where':{'id':_0x52fda7[_0x616b('0x6e')]},'attributes':[_0x616b('0x6f'),_0x616b('0x70')]})[_0x616b('0x25')](function(_0x9b7bb2){if(!_[_0x616b('0x71')](_0x10d1fd)&&!_[_0x616b('0x71')](_0x9b7bb2[_0x616b('0x6f')])){_0x52fda7[_0x616b('0x72')]=_0x9b7bb2[_0x616b('0x6f')];if(!_[_0x616b('0x71')](_0x9b7bb2[_0x616b('0x70')])){_0x52fda7[_0x616b('0x72')]+='\x20'+_0x9b7bb2[_0x616b('0x70')];}}})[_0x616b('0x73')](function(){return db['CmHopperFinal']['create'](_0x52fda7);});}})[_0x616b('0x25')](function(){return _0x10d1fd['status'](0xcc)['end']();})[_0x616b('0x54')](handleError(_0x10d1fd,null));};exports[_0x616b('0x74')]=function(_0x4f910a,_0x158589,_0x567adb){var _0x332715=[];return db[_0x616b('0x6d')][_0x616b('0x5a')]()['then'](function(_0x2bd0fd){_0x332715=_['keys'](_0x2bd0fd);return _0x4f910a[_0x616b('0x65')][_0x616b('0x75')]({'where':{'type':_0x616b('0x76'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0x616b('0x77')],'raw':!![]});})[_0x616b('0x25')](function(_0x576877){if(_0x576877&&_0x576877[_0x616b('0x45')]){return db[_0x616b('0x78')]['transaction'](function(_0x392847){var _0x1780d0={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x616b('0x68')](_0x616b('0x79'))},'VoiceQueueId':{'$in':_['map'](_0x576877,'id')},'$or':[{'UserId':null},{'UserId':_0x4f910a[_0x616b('0x65')]['id']}]};var _0x80785a=[];if(_0x4f910a[_0x616b('0x58')][_0x616b('0x7a')]&&_0x4f910a['body']['direction']==='prev'){if(!_[_0x616b('0x7b')](_0x4f910a['body'][_0x616b('0x7c')])){_0x1780d0['id']={'$in':_0x4f910a[_0x616b('0x58')][_0x616b('0x7c')]};}_0x80785a=[[_0x616b('0x7d'),_0x616b('0x7e')],[_0x616b('0x7f'),_0x576877[0x0][_0x616b('0x77')]===_0x616b('0x7e')?_0x616b('0x80'):_0x616b('0x7e')],db[_0x616b('0x78')][_0x616b('0x81')](_0x616b('0x82')),['id',_0x616b('0x80')]];}else{if(!_[_0x616b('0x7b')](_0x4f910a['body'][_0x616b('0x7c')])){_0x1780d0['id']={'$notIn':_0x4f910a[_0x616b('0x58')][_0x616b('0x7c')]};}_0x80785a=[[_0x616b('0x7d'),_0x616b('0x80')],['scheduledAt',_0x576877[0x0][_0x616b('0x77')]],db[_0x616b('0x78')]['literal'](_0x616b('0x83')),['id','ASC']];}return db[_0x616b('0x4f')]['findOne']({'attributes':['id',_0x616b('0x84')],'where':_0x1780d0,'order':_0x80785a,'transaction':_0x392847,'lock':_0x392847[_0x616b('0x85')][_0x616b('0x86')],'include':[{'model':db[_0x616b('0x6d')],'as':_0x616b('0x87'),'attributes':_0x332715,'include':[{'model':db['CmCompany'],'as':_0x616b('0x88'),'attributes':['id',_0x616b('0x28')]}]},{'model':db['CmList'],'as':_0x616b('0x89'),'attributes':['id','name']},{'model':db[_0x616b('0x5c')],'as':_0x616b('0x8a'),'attributes':['id',_0x616b('0x28'),_0x616b('0x8b')]}]})[_0x616b('0x25')](function(_0x2eb7ef){if(_0x2eb7ef){return _0x2eb7ef[_0x616b('0x59')]({'UserId':_0x4f910a['user']['id']},{'transaction':_0x392847});}});});}})[_0x616b('0x25')](handleEntityNotFound(_0x158589,null))['then'](respondWithResult(_0x158589,null))['catch'](handleError(_0x158589,null));};exports['getOpenContacts']=function(_0x14adce,_0x1b2eed,_0x3c683c){return _0x14adce[_0x616b('0x65')][_0x616b('0x75')]({'where':{'type':_0x616b('0x76'),'dialActive':!![],'dialMethod':_0x616b('0x8c')},'attributes':['id'],'raw':!![]})[_0x616b('0x25')](function(_0x577cf0){if(_0x577cf0&&_0x577cf0['length']){return db[_0x616b('0x4f')][_0x616b('0x1d')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x616b('0x68')](_0x616b('0x79'))},'VoiceQueueId':{'$in':_[_0x616b('0x2b')](_0x577cf0,'id')},'$or':[{'UserId':null},{'UserId':_0x14adce['user']['id']}]}});}return 0x0;})[_0x616b('0x25')](function(_0x28bf9c){if(!_[_0x616b('0x71')](_0x28bf9c)&&_[_0x616b('0x8d')](_0x28bf9c)){return _0x1b2eed[_0x616b('0x1a')](0xc8)[_0x616b('0x1c')]({'contacts':_0x28bf9c});}else{logger[_0x616b('0x8e')](_0x616b('0x8f'),'getOpenContacts',0x194,_0x616b('0x90'));_0x1b2eed[_0x616b('0x19')](0x194);}})[_0x616b('0x54')](handleError(_0x1b2eed,null));}; \ No newline at end of file +var _0x2d21=['findOne','UPDATE','Company','CmList','Queue','dialActive','outbound','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts','entity\x20not\x20found','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','update','then','destroy','error','stack','name','send','index','CmHopper','rawAttributes','type','key','model','map','query','intersection','filters','$and','$or','$gt','$eq','$not','$in','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contains','$any','fields','attributes','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','includeAll','rows','catch','show','params','keys','length','include','options','find','create','body','describe','CampaignId','VoiceQueueId','VoiceQueue','Campaign','omit','createdAt','state','statedesc','deleted','membername','user','UserId','YYYY-MM-DD\x20HH:mm:ss','phone','campaigntype','ivr','CmContact','firstName','lastName','calleridname','isNil','finally','getPreview','getVoiceQueues','dialOrderByScheduledAt','sequelize','transaction','format','direction','prev','isEmpty','hopperIds','priority','ASC','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','scheduledAt','COALESCE(CmHopper.UserId,\x200)\x20DESC'];(function(_0xb326ac,_0x467273){var _0x1a4f33=function(_0x24f532){while(--_0x24f532){_0xb326ac['push'](_0xb326ac['shift']());}};_0x1a4f33(++_0x467273);}(_0x2d21,0x95));var _0x12d2=function(_0xba1760,_0x191969){_0xba1760=_0xba1760-0x0;var _0x1f3143=_0x2d21[_0xba1760];return _0x1f3143;};'use strict';var pdf=require(_0x12d2('0x0'));var emlformat=require(_0x12d2('0x1'));var rimraf=require(_0x12d2('0x2'));var zipdir=require(_0x12d2('0x3'));var jsonpatch=require(_0x12d2('0x4'));var rp=require(_0x12d2('0x5'));var moment=require(_0x12d2('0x6'));var BPromise=require(_0x12d2('0x7'));var Mustache=require('mustache');var util=require('util');var path=require(_0x12d2('0x8'));var sox=require(_0x12d2('0x9'));var csv=require(_0x12d2('0xa'));var ejs=require(_0x12d2('0xb'));var fs=require('fs');var _=require(_0x12d2('0xc'));var squel=require('squel');var crypto=require(_0x12d2('0xd'));var jsforce=require(_0x12d2('0xe'));var deskjs=require(_0x12d2('0xf'));var toCsv=require(_0x12d2('0xa'));var querystring=require(_0x12d2('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x12d2('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x12d2('0x12'));var hardwareService=require(_0x12d2('0x13'));var logger=require(_0x12d2('0x14'))(_0x12d2('0x15'));var utils=require(_0x12d2('0x16'));var config=require(_0x12d2('0x17'));var db=require(_0x12d2('0x18'))['db'];function respondWithStatusCode(_0x143176,_0x109c27){_0x109c27=_0x109c27||0xcc;return function(_0x3b7ff1){if(_0x3b7ff1){return _0x143176[_0x12d2('0x19')](_0x109c27);}return _0x143176[_0x12d2('0x1a')](_0x109c27)[_0x12d2('0x1b')]();};}function respondWithResult(_0x535c47,_0x3c802c){_0x3c802c=_0x3c802c||0xc8;return function(_0x51ded3){if(_0x51ded3){return _0x535c47[_0x12d2('0x1a')](_0x3c802c)[_0x12d2('0x1c')](_0x51ded3);}};}function respondWithFilteredResult(_0x5c8ae5,_0x4f72ef){return function(_0xbcfeec){if(_0xbcfeec){var _0x2fbb05=_0xbcfeec[_0x12d2('0x1d')],_0x344961=_0x4f72ef[_0x12d2('0x1e')],_0x251cd2=_0x4f72ef[_0x12d2('0x1e')]+_0x4f72ef[_0x12d2('0x1f')],_0x466e43;if(_0x251cd2>=_0x2fbb05){_0x251cd2=_0x2fbb05;_0x466e43=0xc8;}else{_0x466e43=0xce;}_0x5c8ae5[_0x12d2('0x1a')](_0x466e43);return _0x5c8ae5[_0x12d2('0x20')](_0x12d2('0x21'),_0x344961+'-'+_0x251cd2+'/'+_0x2fbb05)[_0x12d2('0x1c')](_0xbcfeec);}return null;};}function patchUpdates(_0x30f883){return function(_0x359cdc){try{jsonpatch[_0x12d2('0x22')](_0x359cdc,_0x30f883,!![]);}catch(_0x42278f){return BPromise['reject'](_0x42278f);}return _0x359cdc['save']();};}function saveUpdates(_0xf3dabf,_0x3bbce5){return function(_0x115e55){if(_0x115e55){return _0x115e55[_0x12d2('0x23')](_0xf3dabf)[_0x12d2('0x24')](function(_0x1b9d73){return _0x1b9d73;});}return null;};}function removeEntity(_0x2c81dd,_0x3ade77){return function(_0x586fa2){if(_0x586fa2){return _0x586fa2[_0x12d2('0x25')]()['then'](function(){_0x2c81dd[_0x12d2('0x1a')](0xcc)[_0x12d2('0x1b')]();});}};}function handleEntityNotFound(_0x14e754,_0x293b4f){return function(_0x5336a8){if(!_0x5336a8){_0x14e754['sendStatus'](0x194);}return _0x5336a8;};}function handleError(_0x1202bc,_0x3c4025){_0x3c4025=_0x3c4025||0x1f4;return function(_0x2b34d1){logger[_0x12d2('0x26')](_0x2b34d1[_0x12d2('0x27')]);if(_0x2b34d1[_0x12d2('0x28')]){delete _0x2b34d1[_0x12d2('0x28')];}_0x1202bc[_0x12d2('0x1a')](_0x3c4025)[_0x12d2('0x29')](_0x2b34d1);};}exports[_0x12d2('0x2a')]=function(_0x30ef7d,_0x437b86){var _0x3877f6={},_0x569030={},_0x87980c={'count':0x0,'rows':[]};var _0x2a96f4=_['map'](db[_0x12d2('0x2b')][_0x12d2('0x2c')],function(_0x9ef00){return{'name':_0x9ef00['fieldName'],'type':_0x9ef00[_0x12d2('0x2d')][_0x12d2('0x2e')]};});_0x569030[_0x12d2('0x2f')]=_[_0x12d2('0x30')](_0x2a96f4,_0x12d2('0x28'));_0x569030[_0x12d2('0x31')]=_['keys'](_0x30ef7d['query']);_0x569030['filters']=_[_0x12d2('0x32')](_0x569030[_0x12d2('0x2f')],_0x569030[_0x12d2('0x31')]);_0x569030[_0x12d2('0x33')]=_['concat'](_0x569030[_0x12d2('0x33')],[_0x12d2('0x34'),_0x12d2('0x35'),_0x12d2('0x36'),'$gte','$lt','$lte','$ne',_0x12d2('0x37'),_0x12d2('0x38'),'$between','$notBetween',_0x12d2('0x39'),_0x12d2('0x3a'),_0x12d2('0x3b'),_0x12d2('0x3c'),_0x12d2('0x3d'),_0x12d2('0x3e'),_0x12d2('0x3b'),_0x12d2('0x3f'),_0x12d2('0x40'),'$contained',_0x12d2('0x41')]);_0x3877f6['attributes']=_[_0x12d2('0x32')](_0x569030[_0x12d2('0x2f')],qs[_0x12d2('0x42')](_0x30ef7d[_0x12d2('0x31')][_0x12d2('0x42')]));_0x3877f6[_0x12d2('0x43')]=_0x3877f6['attributes']['length']?_0x3877f6[_0x12d2('0x43')]:_0x569030[_0x12d2('0x2f')];if(!_0x30ef7d[_0x12d2('0x31')][_0x12d2('0x44')]('nolimit')){_0x3877f6[_0x12d2('0x1f')]=qs['limit'](_0x30ef7d[_0x12d2('0x31')][_0x12d2('0x1f')]);_0x3877f6['offset']=qs['offset'](_0x30ef7d[_0x12d2('0x31')][_0x12d2('0x1e')]);}_0x3877f6['order']=qs[_0x12d2('0x45')](_0x30ef7d['query']['sort']);_0x3877f6[_0x12d2('0x46')]=qs['filters'](_[_0x12d2('0x47')](_0x30ef7d[_0x12d2('0x31')],_0x569030['filters']));if(_0x30ef7d[_0x12d2('0x31')][_0x12d2('0x48')]){_0x3877f6['where']=_[_0x12d2('0x49')](_0x3877f6[_0x12d2('0x46')],{'$or':_['map'](_0x2a96f4,function(_0x71be36){if(_0x71be36[_0x12d2('0x2d')]!==_0x12d2('0x4a')){var _0x2e69c1={};_0x2e69c1[_0x71be36[_0x12d2('0x28')]]={'$like':'%'+_0x30ef7d[_0x12d2('0x31')]['filter']+'%'};return _0x2e69c1;}})});}_0x3877f6=_['merge']({},_0x3877f6,_0x30ef7d['options']);var _0x8d2394={'where':_0x3877f6[_0x12d2('0x46')]};return db['CmHopper'][_0x12d2('0x1d')](_0x8d2394)[_0x12d2('0x24')](function(_0x1155b6){_0x87980c[_0x12d2('0x1d')]=_0x1155b6;if(_0x30ef7d[_0x12d2('0x31')][_0x12d2('0x4b')]){_0x3877f6['include']=[{'all':!![]}];}return db[_0x12d2('0x2b')]['findAll'](_0x3877f6);})['then'](function(_0x4c4a92){_0x87980c[_0x12d2('0x4c')]=_0x4c4a92;return _0x87980c;})['then'](respondWithFilteredResult(_0x437b86,_0x3877f6))[_0x12d2('0x4d')](handleError(_0x437b86,null));};exports[_0x12d2('0x4e')]=function(_0x3ade1f,_0x4800d7){var _0x198fd2={'raw':!![],'where':{'id':_0x3ade1f[_0x12d2('0x4f')]['id']}},_0x21b0c2={};_0x21b0c2[_0x12d2('0x2f')]=_[_0x12d2('0x50')](db['CmHopper'][_0x12d2('0x2c')]);_0x21b0c2[_0x12d2('0x31')]=_[_0x12d2('0x50')](_0x3ade1f[_0x12d2('0x31')]);_0x21b0c2[_0x12d2('0x33')]=_[_0x12d2('0x32')](_0x21b0c2[_0x12d2('0x2f')],_0x21b0c2[_0x12d2('0x31')]);_0x198fd2[_0x12d2('0x43')]=_[_0x12d2('0x32')](_0x21b0c2[_0x12d2('0x2f')],qs['fields'](_0x3ade1f['query'][_0x12d2('0x42')]));_0x198fd2[_0x12d2('0x43')]=_0x198fd2[_0x12d2('0x43')][_0x12d2('0x51')]?_0x198fd2['attributes']:_0x21b0c2[_0x12d2('0x2f')];if(_0x3ade1f[_0x12d2('0x31')][_0x12d2('0x4b')]){_0x198fd2[_0x12d2('0x52')]=[{'all':!![]}];}_0x198fd2=_['merge']({},_0x198fd2,_0x3ade1f[_0x12d2('0x53')]);return db[_0x12d2('0x2b')][_0x12d2('0x54')](_0x198fd2)['then'](handleEntityNotFound(_0x4800d7,null))[_0x12d2('0x24')](respondWithResult(_0x4800d7,null))['catch'](handleError(_0x4800d7,null));};exports[_0x12d2('0x55')]=function(_0x323434,_0x525d8b){return db['CmHopper'][_0x12d2('0x55')](_0x323434[_0x12d2('0x56')],{})[_0x12d2('0x24')](respondWithResult(_0x525d8b,0xc9))['catch'](handleError(_0x525d8b,null));};exports['update']=function(_0x3061d8,_0x36a430){if(_0x3061d8[_0x12d2('0x56')]['id']){delete _0x3061d8[_0x12d2('0x56')]['id'];}return db[_0x12d2('0x2b')][_0x12d2('0x54')]({'where':{'id':_0x3061d8[_0x12d2('0x4f')]['id']}})[_0x12d2('0x24')](handleEntityNotFound(_0x36a430,null))['then'](saveUpdates(_0x3061d8[_0x12d2('0x56')],null))['then'](respondWithResult(_0x36a430,null))[_0x12d2('0x4d')](handleError(_0x36a430,null));};exports[_0x12d2('0x57')]=function(_0x19d511,_0x59e6bb){return db[_0x12d2('0x2b')][_0x12d2('0x57')]()[_0x12d2('0x24')](respondWithResult(_0x59e6bb,null))[_0x12d2('0x4d')](handleError(_0x59e6bb,null));};exports[_0x12d2('0x25')]=function(_0x5ebda9,_0xb1f8a2){var _0x3e673e;return db[_0x12d2('0x2b')][_0x12d2('0x54')]({'where':{'id':_0x5ebda9[_0x12d2('0x4f')]['id']}})[_0x12d2('0x24')](handleEntityNotFound(_0xb1f8a2,null))['then'](function(_0x4708ae){if(_0x4708ae){return _0x4708ae[_0x12d2('0x25')]()[_0x12d2('0x24')](function(_0x1e20d7){return _0x1e20d7;});}})[_0x12d2('0x24')](function(_0x29592a){_0x3e673e=_0x29592a;if(_0x29592a){if(_0x29592a['VoiceQueueId']||_0x29592a[_0x12d2('0x58')]){return db[_0x29592a[_0x12d2('0x59')]?_0x12d2('0x5a'):_0x12d2('0x5b')][_0x12d2('0x54')]({'where':{'id':_0x29592a['VoiceQueueId']?_0x29592a['VoiceQueueId']:_0x29592a[_0x12d2('0x58')]},'attributes':['id',_0x12d2('0x28')],'raw':!![]});}}})[_0x12d2('0x24')](function(_0x22e2f0){var _0x57e48e={};if(_0x22e2f0){_['merge'](_0x57e48e,_[_0x12d2('0x5c')](_0x3e673e['dataValues'],[_0x12d2('0x5d'),'updatedAt','id']));_0x57e48e[_0x12d2('0x5e')]=0x15;_0x57e48e[_0x12d2('0x5f')]=_0x12d2('0x60');_0x57e48e['campaign']=_0x22e2f0[_0x12d2('0x28')];_0x57e48e[_0x12d2('0x61')]=_0x5ebda9[_0x12d2('0x62')][_0x12d2('0x28')];_0x57e48e[_0x12d2('0x63')]=_0x5ebda9['user']['id'];_0x57e48e[_0x12d2('0x60')]=!![];_0x57e48e['deletedat']=moment()['format'](_0x12d2('0x64'));_0x57e48e['calleridnum']=_0x3e673e[_0x12d2('0x65')];_0x57e48e[_0x12d2('0x66')]=_0x3e673e[_0x12d2('0x59')]?'queue':_0x12d2('0x67');return db[_0x12d2('0x68')][_0x12d2('0x54')]({'where':{'id':_0x57e48e['ContactId']},'attributes':[_0x12d2('0x69'),_0x12d2('0x6a')]})[_0x12d2('0x24')](function(_0x3663a7){if(!_['isNil'](_0xb1f8a2)&&!_['isNil'](_0x3663a7[_0x12d2('0x69')])){_0x57e48e[_0x12d2('0x6b')]=_0x3663a7[_0x12d2('0x69')];if(!_[_0x12d2('0x6c')](_0x3663a7[_0x12d2('0x6a')])){_0x57e48e[_0x12d2('0x6b')]+='\x20'+_0x3663a7['lastName'];}}})[_0x12d2('0x6d')](function(){return db['CmHopperFinal']['create'](_0x57e48e);});}})[_0x12d2('0x24')](function(){return _0xb1f8a2['status'](0xcc)['end']();})[_0x12d2('0x4d')](handleError(_0xb1f8a2,null));};exports[_0x12d2('0x6e')]=function(_0x1fdace,_0x1bd369,_0x1841c2){var _0x11d273=[];return db[_0x12d2('0x68')][_0x12d2('0x57')]()[_0x12d2('0x24')](function(_0x54d1ba){_0x11d273=_[_0x12d2('0x50')](_0x54d1ba);return _0x1fdace[_0x12d2('0x62')][_0x12d2('0x6f')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0x12d2('0x70')],'raw':!![]});})['then'](function(_0x42b3d3){if(_0x42b3d3&&_0x42b3d3['length']){return db[_0x12d2('0x71')][_0x12d2('0x72')](function(_0x487f4e){var _0x3cb5ef={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x12d2('0x73')](_0x12d2('0x64'))},'VoiceQueueId':{'$in':_[_0x12d2('0x30')](_0x42b3d3,'id')},'$or':[{'UserId':null},{'UserId':_0x1fdace[_0x12d2('0x62')]['id']}]};var _0x54a52e=[];if(_0x1fdace[_0x12d2('0x56')][_0x12d2('0x74')]&&_0x1fdace[_0x12d2('0x56')][_0x12d2('0x74')]===_0x12d2('0x75')){if(!_[_0x12d2('0x76')](_0x1fdace[_0x12d2('0x56')]['hopperIds'])){_0x3cb5ef['id']={'$in':_0x1fdace[_0x12d2('0x56')][_0x12d2('0x77')]};}_0x54a52e=[[_0x12d2('0x78'),_0x12d2('0x79')],['scheduledAt',_0x42b3d3[0x0][_0x12d2('0x70')]===_0x12d2('0x79')?_0x12d2('0x7a'):_0x12d2('0x79')],db['sequelize'][_0x12d2('0x7b')](_0x12d2('0x7c')),['id',_0x12d2('0x7a')]];}else{if(!_['isEmpty'](_0x1fdace['body'][_0x12d2('0x77')])){_0x3cb5ef['id']={'$notIn':_0x1fdace[_0x12d2('0x56')]['hopperIds']};}_0x54a52e=[['priority',_0x12d2('0x7a')],[_0x12d2('0x7d'),_0x42b3d3[0x0]['dialOrderByScheduledAt']],db[_0x12d2('0x71')][_0x12d2('0x7b')](_0x12d2('0x7e')),['id',_0x12d2('0x79')]];}return db[_0x12d2('0x2b')][_0x12d2('0x7f')]({'attributes':['id','scheduledat'],'where':_0x3cb5ef,'order':_0x54a52e,'transaction':_0x487f4e,'lock':_0x487f4e['LOCK'][_0x12d2('0x80')],'include':[{'model':db[_0x12d2('0x68')],'as':'Contact','attributes':_0x11d273,'include':[{'model':db['CmCompany'],'as':_0x12d2('0x81'),'attributes':['id',_0x12d2('0x28')]}]},{'model':db[_0x12d2('0x82')],'as':'List','attributes':['id',_0x12d2('0x28')]},{'model':db[_0x12d2('0x5a')],'as':_0x12d2('0x83'),'attributes':['id','name',_0x12d2('0x84')]}]})['then'](function(_0xda0875){if(_0xda0875){return _0xda0875[_0x12d2('0x23')]({'UserId':_0x1fdace[_0x12d2('0x62')]['id']},{'transaction':_0x487f4e});}});});}})[_0x12d2('0x24')](handleEntityNotFound(_0x1bd369,null))[_0x12d2('0x24')](respondWithResult(_0x1bd369,null))[_0x12d2('0x4d')](handleError(_0x1bd369,null));};exports['getOpenContacts']=function(_0x525669,_0x1e80d7,_0x95fa1){return _0x525669[_0x12d2('0x62')][_0x12d2('0x6f')]({'where':{'type':_0x12d2('0x85'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})[_0x12d2('0x24')](function(_0x18902c){if(_0x18902c&&_0x18902c[_0x12d2('0x51')]){return db['CmHopper'][_0x12d2('0x1d')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x12d2('0x73')](_0x12d2('0x64'))},'VoiceQueueId':{'$in':_[_0x12d2('0x30')](_0x18902c,'id')},'$or':[{'UserId':null},{'UserId':_0x525669['user']['id']}]}});}return 0x0;})[_0x12d2('0x24')](function(_0xf004cb){if(!_[_0x12d2('0x6c')](_0xf004cb)&&_[_0x12d2('0x86')](_0xf004cb)){return _0x1e80d7[_0x12d2('0x1a')](0xc8)[_0x12d2('0x1c')]({'contacts':_0xf004cb});}else{logger[_0x12d2('0x26')](_0x12d2('0x87'),_0x12d2('0x88'),0x194,_0x12d2('0x89'));_0x1e80d7[_0x12d2('0x19')](0x194);}})[_0x12d2('0x4d')](handleError(_0x1e80d7,null));}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 6d0307e..eadbfca 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 _0x7fdf=['exports','cm_hopper','scheduledat','phone','priority','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x7fdf,0x19a));var _0xf7fd=function(_0x4dcecc,_0x3865b9){_0x4dcecc=_0x4dcecc-0x0;var _0x2aa658=_0x7fdf[_0x4dcecc];return _0x2aa658;};'use strict';var _=require(_0xf7fd('0x0'));var util=require(_0xf7fd('0x1'));var logger=require(_0xf7fd('0x2'))(_0xf7fd('0x3'));var moment=require('moment');var BPromise=require(_0xf7fd('0x4'));var rp=require(_0xf7fd('0x5'));var fs=require('fs');var path=require(_0xf7fd('0x6'));var rimraf=require(_0xf7fd('0x7'));var config=require(_0xf7fd('0x8'));var attributes=require(_0xf7fd('0x9'));module[_0xf7fd('0xa')]=function(_0x41225f,_0x4c8061){return _0x41225f['define']('CmHopper',attributes,{'tableName':_0xf7fd('0xb'),'paranoid':![],'indexes':[{'name':_0xf7fd('0xc'),'fields':['scheduledat']},{'name':_0xf7fd('0xd'),'fields':[_0xf7fd('0xd')]},{'name':_0xf7fd('0xe'),'fields':[_0xf7fd('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe3ea=['scheduledat','phone','priority','lodash','../../config/logger','api','bluebird','path','./cmHopper.attributes','exports','define','cm_hopper'];(function(_0xdea748,_0xf73e40){var _0x4f03d3=function(_0x3da7cc){while(--_0x3da7cc){_0xdea748['push'](_0xdea748['shift']());}};_0x4f03d3(++_0xf73e40);}(_0xe3ea,0xc3));var _0xae3e=function(_0x48fce1,_0x32bb0a){_0x48fce1=_0x48fce1-0x0;var _0x58e6e5=_0xe3ea[_0x48fce1];return _0x58e6e5;};'use strict';var _=require(_0xae3e('0x0'));var util=require('util');var logger=require(_0xae3e('0x1'))(_0xae3e('0x2'));var moment=require('moment');var BPromise=require(_0xae3e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xae3e('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xae3e('0x5'));module[_0xae3e('0x6')]=function(_0x392cd2,_0x5ae76e){return _0x392cd2[_0xae3e('0x7')]('CmHopper',attributes,{'tableName':_0xae3e('0x8'),'paranoid':![],'indexes':[{'name':_0xae3e('0x9'),'fields':[_0xae3e('0x9')]},{'name':'phone','fields':[_0xae3e('0xa')]},{'name':_0xae3e('0xb'),'fields':[_0xae3e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index ed7bd7b..cc882b8 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 _0xb10b=['order','LOCK','UPDATE','Contact','keys','User','Agent','name','voicePause','length','push','CmHopperFinal','MoveContactManagedDialer','CountReScheduled','COUNT','`scheduledat`\x20>=\x20','format','\x22%s\x22','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','all','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopper,\x20%s,\x20%s','CmHopper,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','GetCmHopper','CmHopper','findAll','options','raw','where','attributes','include','map','model','debug','catch','ShowCmHopper','CreateCmHopper','create','body','update','limit','UpdateCmHopper','destroy','DestroyCmHopper','GetContactDialer','CmContact','describe','sequelize','transaction'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xb10b,0x12a));var _0xbb10=function(_0x290fd8,_0x33829d){_0x290fd8=_0x290fd8-0x0;var _0x1daa07=_0xb10b[_0x290fd8];return _0x1daa07;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'limit':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['limit']||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1c')]?_[_0xbb10('0x1d')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1c')],function(_0x407cb4){return{'model':db[_0x407cb4[_0xbb10('0x1e')]],'as':_0x407cb4['as'],'attributes':_0x407cb4[_0xbb10('0x1b')],'include':_0x407cb4[_0xbb10('0x1c')]?_[_0xbb10('0x1d')](_0x407cb4[_0xbb10('0x1c')],function(_0x537898){return{'model':db[_0x537898['model']],'as':_0x537898['as'],'attributes':_0x537898['attributes'],'include':_0x537898[_0xbb10('0x1c')]?_[_0xbb10('0x1d')](_0x537898[_0xbb10('0x1c')],function(_0x4e25ff){return{'model':db[_0x4e25ff[_0xbb10('0x1e')]],'as':_0x4e25ff['as'],'attributes':_0x4e25ff[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xbb10('0xc')](function(_0x1d5e95){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')]('GetCmHopper',_0x378da8,JSON[_0xbb10('0x11')](_0x1d5e95));_0x575cca(_0x1d5e95);})[_0xbb10('0x20')](function(_0xfc3595){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0xfc3595[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4['error'](0x1f4,_0xfc3595[_0xbb10('0x13')]));});});};exports['ShowCmHopper']=function(_0x448d5c){var _0x56f2da=this;return new Promise(function(_0x16ad2a,_0x1dcc9c){return db[_0xbb10('0x16')]['find']({'raw':_0x448d5c['options']?_0x448d5c[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x448d5c['options']?_0x448d5c[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x448d5c[_0xbb10('0x18')]?_0x448d5c[_0xbb10('0x18')][_0xbb10('0x1b')]||null:null,'include':_0x448d5c[_0xbb10('0x18')]?_0x448d5c[_0xbb10('0x18')]['include']?_[_0xbb10('0x1d')](_0x448d5c[_0xbb10('0x18')][_0xbb10('0x1c')],function(_0x8c1ce6){return{'model':db[_0x8c1ce6[_0xbb10('0x1e')]],'as':_0x8c1ce6['as'],'attributes':_0x8c1ce6[_0xbb10('0x1b')],'include':_0x8c1ce6[_0xbb10('0x1c')]?_[_0xbb10('0x1d')](_0x8c1ce6[_0xbb10('0x1c')],function(_0x56943c){return{'model':db[_0x56943c[_0xbb10('0x1e')]],'as':_0x56943c['as'],'attributes':_0x56943c[_0xbb10('0x1b')],'include':_0x56943c[_0xbb10('0x1c')]?_[_0xbb10('0x1d')](_0x56943c['include'],function(_0x111762){return{'model':db[_0x111762['model']],'as':_0x111762['as'],'attributes':_0x111762['attributes']};}):[]};}):[]};}):[]:[]})[_0xbb10('0xc')](function(_0x40c164){logger[_0xbb10('0xd')](_0xbb10('0x21'),_0x448d5c);logger[_0xbb10('0x1f')](_0xbb10('0x21'),_0x448d5c,JSON['stringify'](_0x40c164));_0x16ad2a(_0x40c164);})[_0xbb10('0x20')](function(_0x25d72f){logger['error']('ShowCmHopper',_0x25d72f['message'],_0x448d5c);_0x1dcc9c(_0x56f2da[_0xbb10('0x12')](0x1f4,_0x25d72f[_0xbb10('0x13')]));});});};exports[_0xbb10('0x22')]=function(_0x4d5a9b){var _0x3c0cd7=this;return new Promise(function(_0x3e8538,_0x4345f3){return db['CmHopper'][_0xbb10('0x23')](_0x4d5a9b[_0xbb10('0x24')],{'raw':_0x4d5a9b[_0xbb10('0x18')]?_0x4d5a9b[_0xbb10('0x18')]['raw']===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0x110eb5){logger['info'](_0xbb10('0x22'),_0x4d5a9b);logger[_0xbb10('0x1f')](_0xbb10('0x22'),_0x4d5a9b,JSON[_0xbb10('0x11')](_0x110eb5));_0x3e8538(_0x110eb5);})[_0xbb10('0x20')](function(_0x185a52){logger['error'](_0xbb10('0x22'),_0x185a52[_0xbb10('0x13')],_0x4d5a9b);_0x4345f3(_0x3c0cd7[_0xbb10('0x12')](0x1f4,_0x185a52[_0xbb10('0x13')]));});});};exports['UpdateCmHopper']=function(_0x3fff6c){var _0x331751=this;return new Promise(function(_0x23dc18,_0x403beb){return db['CmHopper'][_0xbb10('0x25')](_0x3fff6c[_0xbb10('0x24')],{'raw':_0x3fff6c['options']?_0x3fff6c['options'][_0xbb10('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3fff6c['options']?_0x3fff6c[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x3fff6c['options']?_0x3fff6c[_0xbb10('0x18')][_0xbb10('0x1b')]||null:null,'limit':_0x3fff6c[_0xbb10('0x18')]?_0x3fff6c['options'][_0xbb10('0x26')]||null:null})[_0xbb10('0xc')](function(_0x3b9fdf){logger[_0xbb10('0xd')](_0xbb10('0x27'),_0x3fff6c);logger[_0xbb10('0x1f')](_0xbb10('0x27'),_0x3fff6c,JSON[_0xbb10('0x11')](_0x3b9fdf));_0x23dc18(_0x3b9fdf);})[_0xbb10('0x20')](function(_0x43b948){logger[_0xbb10('0x12')](_0xbb10('0x27'),_0x43b948['message'],_0x3fff6c);_0x403beb(_0x331751[_0xbb10('0x12')](0x1f4,_0x43b948[_0xbb10('0x13')]));});});};exports['DestroyCmHopper']=function(_0x14e1cb){var _0x2f5027=this;return new Promise(function(_0x1a7df6,_0x5a5226){return db[_0xbb10('0x16')][_0xbb10('0x28')]({'where':_0x14e1cb[_0xbb10('0x18')]?_0x14e1cb['options']['where']||null:null})[_0xbb10('0xc')](function(_0x76a208){logger[_0xbb10('0xd')]('DestroyCmHopper',_0x14e1cb);logger['debug'](_0xbb10('0x29'),_0x14e1cb,JSON[_0xbb10('0x11')](_0x76a208));_0x1a7df6(_0x76a208);})[_0xbb10('0x20')](function(_0xf820fe){logger[_0xbb10('0x12')](_0xbb10('0x29'),_0xf820fe[_0xbb10('0x13')],_0x14e1cb);_0x5a5226(_0x2f5027[_0xbb10('0x12')](0x1f4,_0xf820fe[_0xbb10('0x13')]));});});};exports[_0xbb10('0x2a')]=function(_0x550111){var _0x5eafac=this;return new Promise(function(_0x412e13,_0x467dba){return db[_0xbb10('0x2b')][_0xbb10('0x2c')]()[_0xbb10('0xc')](function(_0x440f9e){return db[_0xbb10('0x2d')][_0xbb10('0x2e')](function(_0x1c0d8f){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'where':_0x550111[_0xbb10('0x18')]?_0x550111[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x550111[_0xbb10('0x18')]?_0x550111['options'][_0xbb10('0x1b')]||null:null,'limit':_0x550111['options']?_0x550111[_0xbb10('0x18')][_0xbb10('0x26')]||null:null,'order':_0x550111[_0xbb10('0x18')]?_0x550111[_0xbb10('0x18')][_0xbb10('0x2f')]||null:null,'transaction':_0x1c0d8f,'lock':_0x1c0d8f[_0xbb10('0x30')][_0xbb10('0x31')],'include':[{'model':db[_0xbb10('0x2b')],'as':_0xbb10('0x32'),'attributes':_[_0xbb10('0x33')](_0x440f9e)},{'model':db[_0xbb10('0x34')],'as':_0xbb10('0x35'),'attributes':['id',_0xbb10('0x36'),_0xbb10('0x37')]}]})[_0xbb10('0xc')](function(_0x5de0cc){var _0x4571b6=[];for(var _0x466eb7=0x0;_0x466eb7<_0x5de0cc[_0xbb10('0x38')];_0x466eb7+=0x1){_0x4571b6[_0xbb10('0x39')](_0x5de0cc[_0x466eb7][_0xbb10('0x25')](_0x550111[_0xbb10('0x24')],{'transaction':_0x1c0d8f}));}return BPromise['all'](_0x4571b6);});})[_0xbb10('0xc')](function(_0x4731ce){logger[_0xbb10('0xd')](_0xbb10('0x2a'),_0x550111);logger[_0xbb10('0x1f')](_0xbb10('0x2a'),_0x550111,JSON[_0xbb10('0x11')](_0x4731ce));_0x412e13(_0x4731ce);})[_0xbb10('0x20')](function(_0x205e01){logger[_0xbb10('0x12')](_0xbb10('0x2a'),_0x205e01[_0xbb10('0x13')],_0x550111);_0x467dba(_0x5eafac[_0xbb10('0x12')](0x1f4,_0x205e01['message']));});});});};exports['MoveContactManagedDialer']=function(_0x16272d){var _0x3e6338=this;return new Promise(function(_0x3d0cb7,_0x8b0a7d){return db['sequelize']['transaction'](function(_0x79411e){return db[_0xbb10('0x3a')][_0xbb10('0x23')](_0x16272d[_0xbb10('0x24')],{'raw':_0x16272d[_0xbb10('0x18')]?_0x16272d[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'transaction':_0x79411e})['then'](function(){return db[_0xbb10('0x16')][_0xbb10('0x28')]({'where':_0x16272d['options']?_0x16272d['options']['where']||null:null,'transaction':_0x79411e});});})[_0xbb10('0xc')](function(_0x31c727){logger[_0xbb10('0xd')]('MoveContactManagedDialer',_0x16272d);logger['debug']('MoveContactManagedDialer',_0x16272d,JSON[_0xbb10('0x11')](_0x31c727));_0x3d0cb7(_0x31c727);})[_0xbb10('0x20')](function(_0x45167a){logger['error'](_0xbb10('0x3b'),_0x45167a[_0xbb10('0x13')],_0x16272d);_0x8b0a7d(_0x3e6338['error'](0x1f4,_0x45167a['message']));});});};exports[_0xbb10('0x3c')]=function(_0x308896){var _0xd77753=this;return new Promise(function(_0x237246,_0x54b7c5){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x308896[_0xbb10('0x18')]?_0x308896['options'][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x308896[_0xbb10('0x18')]?_0x308896[_0xbb10('0x18')]['where']||null:null,'attributes':[[db[_0xbb10('0x2d')]['fn'](_0xbb10('0x3d'),db[_0xbb10('0x2d')]['fn']('IF',db[_0xbb10('0x2d')]['literal'](_0xbb10('0x3e')+util[_0xbb10('0x3f')](_0xbb10('0x40'),moment()[_0xbb10('0x3f')]('YYYY-MM-DD\x20HH:mm:ss'))+_0xbb10('0x41')))),_0xbb10('0x42')]]})[_0xbb10('0xc')](function(_0x2ceb3e){logger[_0xbb10('0xd')](_0xbb10('0x3c'),_0x308896);logger[_0xbb10('0x1f')]('CountReScheduled',_0x308896,JSON['stringify'](_0x2ceb3e));_0x237246(_0x2ceb3e);})['catch'](function(_0xdfbc0b){logger[_0xbb10('0x12')](_0xbb10('0x3c'),_0xdfbc0b['message'],_0x308896);_0x54b7c5(_0xd77753['error'](0x1f4,_0xdfbc0b[_0xbb10('0x13')]));});});};exports[_0xbb10('0x43')]=function(_0xd9e743){var _0x3a9677=this;return new Promise(function(_0x260e06,_0x1ad2ed){return db['CmContact'][_0xbb10('0x2c')]()[_0xbb10('0xc')](function(_0x270fdb){return db[_0xbb10('0x2d')][_0xbb10('0x2e')](function(_0x5bfc68){return db['CmHopper']['findAll']({'where':_0xd9e743[_0xbb10('0x18')]?_0xd9e743[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0xd9e743[_0xbb10('0x18')]?_0xd9e743[_0xbb10('0x18')][_0xbb10('0x1b')]||null:null,'limit':0x1,'order':_0xd9e743['options']?_0xd9e743[_0xbb10('0x18')]['order']||null:null,'group':db['CmHopper']['UserId'],'transaction':_0x5bfc68,'lock':_0x5bfc68[_0xbb10('0x30')][_0xbb10('0x31')],'include':_0xd9e743[_0xbb10('0x18')]?_0xd9e743[_0xbb10('0x18')]['include']?_[_0xbb10('0x1d')](_0xd9e743['options']['include'],function(_0x165fe9){return{'model':db[_0x165fe9[_0xbb10('0x1e')]],'as':_0x165fe9['as'],'attributes':_0x165fe9[_0xbb10('0x1b')],'include':_0x165fe9[_0xbb10('0x1c')]?_[_0xbb10('0x1d')](_0x165fe9['include'],function(_0x2d52ea){return{'model':db[_0x2d52ea[_0xbb10('0x1e')]],'as':_0x2d52ea['as'],'attributes':_0x2d52ea[_0xbb10('0x1b')],'include':_0x2d52ea[_0xbb10('0x1c')]?_[_0xbb10('0x1d')](_0x2d52ea[_0xbb10('0x1c')],function(_0x174395){return{'model':db[_0x174395['model']],'as':_0x174395['as'],'attributes':_0x174395[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xbb10('0xc')](function(_0x30f3ea){var _0x322b41=[];for(var _0x37b20e=0x0;_0x37b20e<_0x30f3ea[_0xbb10('0x38')];_0x37b20e+=0x1){_0x322b41[_0xbb10('0x39')](_0x30f3ea[_0x37b20e][_0xbb10('0x25')](_0xd9e743['body'],{'transaction':_0x5bfc68}));}return BPromise[_0xbb10('0x44')](_0x322b41);});})[_0xbb10('0xc')](function(_0x145baf){logger['info']('GetContactRecallMe',_0xd9e743);logger['debug'](_0xbb10('0x43'),_0xd9e743,JSON['stringify'](_0x145baf));_0x260e06(_0x145baf);})['catch'](function(_0x1701c5){logger[_0xbb10('0x12')](_0xbb10('0x43'),_0x1701c5[_0xbb10('0x13')],_0xd9e743);_0x1ad2ed(_0x3a9677[_0xbb10('0x12')](0x1f4,_0x1701c5[_0xbb10('0x13')]));});});});}; \ No newline at end of file +var _0xb10b=['order','LOCK','UPDATE','Contact','keys','User','Agent','name','voicePause','length','push','CmHopperFinal','MoveContactManagedDialer','CountReScheduled','COUNT','`scheduledat`\x20>=\x20','format','\x22%s\x22','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','all','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopper,\x20%s,\x20%s','CmHopper,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','GetCmHopper','CmHopper','findAll','options','raw','where','attributes','include','map','model','debug','catch','ShowCmHopper','CreateCmHopper','create','body','update','limit','UpdateCmHopper','destroy','DestroyCmHopper','GetContactDialer','CmContact','describe','sequelize','transaction'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xb10b,0x12a));var _0xbb10=function(_0x6eb02d,_0x20bdf5){_0x6eb02d=_0x6eb02d-0x0;var _0xb756de=_0xb10b[_0x6eb02d];return _0xb756de;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'limit':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['limit']||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1c')]?_[_0xbb10('0x1d')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1c')],function(_0x407cb4){return{'model':db[_0x407cb4[_0xbb10('0x1e')]],'as':_0x407cb4['as'],'attributes':_0x407cb4[_0xbb10('0x1b')],'include':_0x407cb4[_0xbb10('0x1c')]?_[_0xbb10('0x1d')](_0x407cb4[_0xbb10('0x1c')],function(_0x537898){return{'model':db[_0x537898['model']],'as':_0x537898['as'],'attributes':_0x537898['attributes'],'include':_0x537898[_0xbb10('0x1c')]?_[_0xbb10('0x1d')](_0x537898[_0xbb10('0x1c')],function(_0x4e25ff){return{'model':db[_0x4e25ff[_0xbb10('0x1e')]],'as':_0x4e25ff['as'],'attributes':_0x4e25ff[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xbb10('0xc')](function(_0x1d5e95){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')]('GetCmHopper',_0x378da8,JSON[_0xbb10('0x11')](_0x1d5e95));_0x575cca(_0x1d5e95);})[_0xbb10('0x20')](function(_0xfc3595){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0xfc3595[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4['error'](0x1f4,_0xfc3595[_0xbb10('0x13')]));});});};exports['ShowCmHopper']=function(_0x448d5c){var _0x56f2da=this;return new Promise(function(_0x16ad2a,_0x1dcc9c){return db[_0xbb10('0x16')]['find']({'raw':_0x448d5c['options']?_0x448d5c[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x448d5c['options']?_0x448d5c[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x448d5c[_0xbb10('0x18')]?_0x448d5c[_0xbb10('0x18')][_0xbb10('0x1b')]||null:null,'include':_0x448d5c[_0xbb10('0x18')]?_0x448d5c[_0xbb10('0x18')]['include']?_[_0xbb10('0x1d')](_0x448d5c[_0xbb10('0x18')][_0xbb10('0x1c')],function(_0x8c1ce6){return{'model':db[_0x8c1ce6[_0xbb10('0x1e')]],'as':_0x8c1ce6['as'],'attributes':_0x8c1ce6[_0xbb10('0x1b')],'include':_0x8c1ce6[_0xbb10('0x1c')]?_[_0xbb10('0x1d')](_0x8c1ce6[_0xbb10('0x1c')],function(_0x56943c){return{'model':db[_0x56943c[_0xbb10('0x1e')]],'as':_0x56943c['as'],'attributes':_0x56943c[_0xbb10('0x1b')],'include':_0x56943c[_0xbb10('0x1c')]?_[_0xbb10('0x1d')](_0x56943c['include'],function(_0x111762){return{'model':db[_0x111762['model']],'as':_0x111762['as'],'attributes':_0x111762['attributes']};}):[]};}):[]};}):[]:[]})[_0xbb10('0xc')](function(_0x40c164){logger[_0xbb10('0xd')](_0xbb10('0x21'),_0x448d5c);logger[_0xbb10('0x1f')](_0xbb10('0x21'),_0x448d5c,JSON['stringify'](_0x40c164));_0x16ad2a(_0x40c164);})[_0xbb10('0x20')](function(_0x25d72f){logger['error']('ShowCmHopper',_0x25d72f['message'],_0x448d5c);_0x1dcc9c(_0x56f2da[_0xbb10('0x12')](0x1f4,_0x25d72f[_0xbb10('0x13')]));});});};exports[_0xbb10('0x22')]=function(_0x4d5a9b){var _0x3c0cd7=this;return new Promise(function(_0x3e8538,_0x4345f3){return db['CmHopper'][_0xbb10('0x23')](_0x4d5a9b[_0xbb10('0x24')],{'raw':_0x4d5a9b[_0xbb10('0x18')]?_0x4d5a9b[_0xbb10('0x18')]['raw']===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0x110eb5){logger['info'](_0xbb10('0x22'),_0x4d5a9b);logger[_0xbb10('0x1f')](_0xbb10('0x22'),_0x4d5a9b,JSON[_0xbb10('0x11')](_0x110eb5));_0x3e8538(_0x110eb5);})[_0xbb10('0x20')](function(_0x185a52){logger['error'](_0xbb10('0x22'),_0x185a52[_0xbb10('0x13')],_0x4d5a9b);_0x4345f3(_0x3c0cd7[_0xbb10('0x12')](0x1f4,_0x185a52[_0xbb10('0x13')]));});});};exports['UpdateCmHopper']=function(_0x3fff6c){var _0x331751=this;return new Promise(function(_0x23dc18,_0x403beb){return db['CmHopper'][_0xbb10('0x25')](_0x3fff6c[_0xbb10('0x24')],{'raw':_0x3fff6c['options']?_0x3fff6c['options'][_0xbb10('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3fff6c['options']?_0x3fff6c[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x3fff6c['options']?_0x3fff6c[_0xbb10('0x18')][_0xbb10('0x1b')]||null:null,'limit':_0x3fff6c[_0xbb10('0x18')]?_0x3fff6c['options'][_0xbb10('0x26')]||null:null})[_0xbb10('0xc')](function(_0x3b9fdf){logger[_0xbb10('0xd')](_0xbb10('0x27'),_0x3fff6c);logger[_0xbb10('0x1f')](_0xbb10('0x27'),_0x3fff6c,JSON[_0xbb10('0x11')](_0x3b9fdf));_0x23dc18(_0x3b9fdf);})[_0xbb10('0x20')](function(_0x43b948){logger[_0xbb10('0x12')](_0xbb10('0x27'),_0x43b948['message'],_0x3fff6c);_0x403beb(_0x331751[_0xbb10('0x12')](0x1f4,_0x43b948[_0xbb10('0x13')]));});});};exports['DestroyCmHopper']=function(_0x14e1cb){var _0x2f5027=this;return new Promise(function(_0x1a7df6,_0x5a5226){return db[_0xbb10('0x16')][_0xbb10('0x28')]({'where':_0x14e1cb[_0xbb10('0x18')]?_0x14e1cb['options']['where']||null:null})[_0xbb10('0xc')](function(_0x76a208){logger[_0xbb10('0xd')]('DestroyCmHopper',_0x14e1cb);logger['debug'](_0xbb10('0x29'),_0x14e1cb,JSON[_0xbb10('0x11')](_0x76a208));_0x1a7df6(_0x76a208);})[_0xbb10('0x20')](function(_0xf820fe){logger[_0xbb10('0x12')](_0xbb10('0x29'),_0xf820fe[_0xbb10('0x13')],_0x14e1cb);_0x5a5226(_0x2f5027[_0xbb10('0x12')](0x1f4,_0xf820fe[_0xbb10('0x13')]));});});};exports[_0xbb10('0x2a')]=function(_0x550111){var _0x5eafac=this;return new Promise(function(_0x412e13,_0x467dba){return db[_0xbb10('0x2b')][_0xbb10('0x2c')]()[_0xbb10('0xc')](function(_0x440f9e){return db[_0xbb10('0x2d')][_0xbb10('0x2e')](function(_0x1c0d8f){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'where':_0x550111[_0xbb10('0x18')]?_0x550111[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x550111[_0xbb10('0x18')]?_0x550111['options'][_0xbb10('0x1b')]||null:null,'limit':_0x550111['options']?_0x550111[_0xbb10('0x18')][_0xbb10('0x26')]||null:null,'order':_0x550111[_0xbb10('0x18')]?_0x550111[_0xbb10('0x18')][_0xbb10('0x2f')]||null:null,'transaction':_0x1c0d8f,'lock':_0x1c0d8f[_0xbb10('0x30')][_0xbb10('0x31')],'include':[{'model':db[_0xbb10('0x2b')],'as':_0xbb10('0x32'),'attributes':_[_0xbb10('0x33')](_0x440f9e)},{'model':db[_0xbb10('0x34')],'as':_0xbb10('0x35'),'attributes':['id',_0xbb10('0x36'),_0xbb10('0x37')]}]})[_0xbb10('0xc')](function(_0x5de0cc){var _0x4571b6=[];for(var _0x466eb7=0x0;_0x466eb7<_0x5de0cc[_0xbb10('0x38')];_0x466eb7+=0x1){_0x4571b6[_0xbb10('0x39')](_0x5de0cc[_0x466eb7][_0xbb10('0x25')](_0x550111[_0xbb10('0x24')],{'transaction':_0x1c0d8f}));}return BPromise['all'](_0x4571b6);});})[_0xbb10('0xc')](function(_0x4731ce){logger[_0xbb10('0xd')](_0xbb10('0x2a'),_0x550111);logger[_0xbb10('0x1f')](_0xbb10('0x2a'),_0x550111,JSON[_0xbb10('0x11')](_0x4731ce));_0x412e13(_0x4731ce);})[_0xbb10('0x20')](function(_0x205e01){logger[_0xbb10('0x12')](_0xbb10('0x2a'),_0x205e01[_0xbb10('0x13')],_0x550111);_0x467dba(_0x5eafac[_0xbb10('0x12')](0x1f4,_0x205e01['message']));});});});};exports['MoveContactManagedDialer']=function(_0x16272d){var _0x3e6338=this;return new Promise(function(_0x3d0cb7,_0x8b0a7d){return db['sequelize']['transaction'](function(_0x79411e){return db[_0xbb10('0x3a')][_0xbb10('0x23')](_0x16272d[_0xbb10('0x24')],{'raw':_0x16272d[_0xbb10('0x18')]?_0x16272d[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'transaction':_0x79411e})['then'](function(){return db[_0xbb10('0x16')][_0xbb10('0x28')]({'where':_0x16272d['options']?_0x16272d['options']['where']||null:null,'transaction':_0x79411e});});})[_0xbb10('0xc')](function(_0x31c727){logger[_0xbb10('0xd')]('MoveContactManagedDialer',_0x16272d);logger['debug']('MoveContactManagedDialer',_0x16272d,JSON[_0xbb10('0x11')](_0x31c727));_0x3d0cb7(_0x31c727);})[_0xbb10('0x20')](function(_0x45167a){logger['error'](_0xbb10('0x3b'),_0x45167a[_0xbb10('0x13')],_0x16272d);_0x8b0a7d(_0x3e6338['error'](0x1f4,_0x45167a['message']));});});};exports[_0xbb10('0x3c')]=function(_0x308896){var _0xd77753=this;return new Promise(function(_0x237246,_0x54b7c5){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x308896[_0xbb10('0x18')]?_0x308896['options'][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x308896[_0xbb10('0x18')]?_0x308896[_0xbb10('0x18')]['where']||null:null,'attributes':[[db[_0xbb10('0x2d')]['fn'](_0xbb10('0x3d'),db[_0xbb10('0x2d')]['fn']('IF',db[_0xbb10('0x2d')]['literal'](_0xbb10('0x3e')+util[_0xbb10('0x3f')](_0xbb10('0x40'),moment()[_0xbb10('0x3f')]('YYYY-MM-DD\x20HH:mm:ss'))+_0xbb10('0x41')))),_0xbb10('0x42')]]})[_0xbb10('0xc')](function(_0x2ceb3e){logger[_0xbb10('0xd')](_0xbb10('0x3c'),_0x308896);logger[_0xbb10('0x1f')]('CountReScheduled',_0x308896,JSON['stringify'](_0x2ceb3e));_0x237246(_0x2ceb3e);})['catch'](function(_0xdfbc0b){logger[_0xbb10('0x12')](_0xbb10('0x3c'),_0xdfbc0b['message'],_0x308896);_0x54b7c5(_0xd77753['error'](0x1f4,_0xdfbc0b[_0xbb10('0x13')]));});});};exports[_0xbb10('0x43')]=function(_0xd9e743){var _0x3a9677=this;return new Promise(function(_0x260e06,_0x1ad2ed){return db['CmContact'][_0xbb10('0x2c')]()[_0xbb10('0xc')](function(_0x270fdb){return db[_0xbb10('0x2d')][_0xbb10('0x2e')](function(_0x5bfc68){return db['CmHopper']['findAll']({'where':_0xd9e743[_0xbb10('0x18')]?_0xd9e743[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0xd9e743[_0xbb10('0x18')]?_0xd9e743[_0xbb10('0x18')][_0xbb10('0x1b')]||null:null,'limit':0x1,'order':_0xd9e743['options']?_0xd9e743[_0xbb10('0x18')]['order']||null:null,'group':db['CmHopper']['UserId'],'transaction':_0x5bfc68,'lock':_0x5bfc68[_0xbb10('0x30')][_0xbb10('0x31')],'include':_0xd9e743[_0xbb10('0x18')]?_0xd9e743[_0xbb10('0x18')]['include']?_[_0xbb10('0x1d')](_0xd9e743['options']['include'],function(_0x165fe9){return{'model':db[_0x165fe9[_0xbb10('0x1e')]],'as':_0x165fe9['as'],'attributes':_0x165fe9[_0xbb10('0x1b')],'include':_0x165fe9[_0xbb10('0x1c')]?_[_0xbb10('0x1d')](_0x165fe9['include'],function(_0x2d52ea){return{'model':db[_0x2d52ea[_0xbb10('0x1e')]],'as':_0x2d52ea['as'],'attributes':_0x2d52ea[_0xbb10('0x1b')],'include':_0x2d52ea[_0xbb10('0x1c')]?_[_0xbb10('0x1d')](_0x2d52ea[_0xbb10('0x1c')],function(_0x174395){return{'model':db[_0x174395['model']],'as':_0x174395['as'],'attributes':_0x174395[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xbb10('0xc')](function(_0x30f3ea){var _0x322b41=[];for(var _0x37b20e=0x0;_0x37b20e<_0x30f3ea[_0xbb10('0x38')];_0x37b20e+=0x1){_0x322b41[_0xbb10('0x39')](_0x30f3ea[_0x37b20e][_0xbb10('0x25')](_0xd9e743['body'],{'transaction':_0x5bfc68}));}return BPromise[_0xbb10('0x44')](_0x322b41);});})[_0xbb10('0xc')](function(_0x145baf){logger['info']('GetContactRecallMe',_0xd9e743);logger['debug'](_0xbb10('0x43'),_0xd9e743,JSON['stringify'](_0x145baf));_0x260e06(_0x145baf);})['catch'](function(_0x1701c5){logger[_0xbb10('0x12')](_0xbb10('0x43'),_0x1701c5[_0xbb10('0x13')],_0xd9e743);_0x1ad2ed(_0x3a9677[_0xbb10('0x12')](0x1f4,_0x1701c5[_0xbb10('0x13')]));});});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index a9b1e18..e43b9a3 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 _0xd0da=['../../config/environment','isAuthenticated','/describe','describe','get','getOpenContacts','/:id','show','post','create','/preview','getPreview','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x51fb42,_0x30b02a){var _0x447a5b=function(_0x16389a){while(--_0x16389a){_0x51fb42['push'](_0x51fb42['shift']());}};_0x447a5b(++_0x30b02a);}(_0xd0da,0x1b1));var _0xad0d=function(_0x38fbc2,_0x641aa1){_0x38fbc2=_0x38fbc2-0x0;var _0x43c7d4=_0xd0da[_0x38fbc2];return _0x43c7d4;};'use strict';var multer=require(_0xad0d('0x0'));var util=require(_0xad0d('0x1'));var path=require(_0xad0d('0x2'));var timeout=require(_0xad0d('0x3'));var express=require(_0xad0d('0x4'));var router=express['Router']();var auth=require(_0xad0d('0x5'));var interaction=require(_0xad0d('0x6'));var config=require(_0xad0d('0x7'));var controller=require('./cmHopper.controller');router['get']('/',auth[_0xad0d('0x8')](),controller['index']);router['get'](_0xad0d('0x9'),auth[_0xad0d('0x8')](),controller[_0xad0d('0xa')]);router[_0xad0d('0xb')]('/opencontacts',auth[_0xad0d('0x8')](),controller[_0xad0d('0xc')]);router[_0xad0d('0xb')](_0xad0d('0xd'),auth[_0xad0d('0x8')](),controller[_0xad0d('0xe')]);router[_0xad0d('0xf')]('/',auth[_0xad0d('0x8')](),controller[_0xad0d('0x10')]);router[_0xad0d('0xf')](_0xad0d('0x11'),auth[_0xad0d('0x8')](),controller[_0xad0d('0x12')]);router['put'](_0xad0d('0xd'),auth[_0xad0d('0x8')](),controller['update']);router[_0xad0d('0x13')](_0xad0d('0xd'),auth['isAuthenticated'](),controller[_0xad0d('0x14')]);module[_0xad0d('0x15')]=router; \ No newline at end of file +var _0x7033=['multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopper.controller','get','isAuthenticated','index','/describe','/opencontacts','getOpenContacts','/:id','show','post','/preview','getPreview','put','destroy','exports'];(function(_0x2b3091,_0x3b3fb5){var _0x533bd6=function(_0x4098e7){while(--_0x4098e7){_0x2b3091['push'](_0x2b3091['shift']());}};_0x533bd6(++_0x3b3fb5);}(_0x7033,0x19e));var _0x3703=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x7033[_0x3ab51d];return _0x29a04e;};'use strict';var multer=require(_0x3703('0x0'));var util=require(_0x3703('0x1'));var path=require(_0x3703('0x2'));var timeout=require(_0x3703('0x3'));var express=require('express');var router=express[_0x3703('0x4')]();var auth=require(_0x3703('0x5'));var interaction=require(_0x3703('0x6'));var config=require(_0x3703('0x7'));var controller=require(_0x3703('0x8'));router[_0x3703('0x9')]('/',auth[_0x3703('0xa')](),controller[_0x3703('0xb')]);router[_0x3703('0x9')](_0x3703('0xc'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x3703('0xd'),auth[_0x3703('0xa')](),controller[_0x3703('0xe')]);router[_0x3703('0x9')](_0x3703('0xf'),auth['isAuthenticated'](),controller[_0x3703('0x10')]);router[_0x3703('0x11')]('/',auth[_0x3703('0xa')](),controller['create']);router['post'](_0x3703('0x12'),auth['isAuthenticated'](),controller[_0x3703('0x13')]);router[_0x3703('0x14')](_0x3703('0xf'),auth[_0x3703('0xa')](),controller['update']);router['delete'](_0x3703('0xf'),auth[_0x3703('0xa')](),controller[_0x3703('0x15')]);module[_0x3703('0x16')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index e5909d5..3b5cd13 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 _0xaa68=['moment','exports','STRING','INTEGER','contactListQueue'];(function(_0x2e4aec,_0x478aea){var _0x5daecc=function(_0x4dae93){while(--_0x4dae93){_0x2e4aec['push'](_0x2e4aec['shift']());}};_0x5daecc(++_0x478aea);}(_0xaa68,0x11d));var _0x8aa6=function(_0x415a8d,_0x4e0526){_0x415a8d=_0x415a8d-0x0;var _0x73fc3b=_0xaa68[_0x415a8d];return _0x73fc3b;};'use strict';var moment=require(_0x8aa6('0x0'));var Sequelize=require('sequelize');module[_0x8aa6('0x1')]={'phone':{'type':Sequelize[_0x8aa6('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x8aa6('0x3')],'unique':_0x8aa6('0x4')},'ListId':{'type':Sequelize[_0x8aa6('0x3')],'unique':_0x8aa6('0x4')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x8aa6('0x4')}}; \ No newline at end of file +var _0xcc7a=['contactListQueue','sequelize','exports','STRING','INTEGER'];(function(_0x7dc7a8,_0x56a053){var _0x37f727=function(_0x2ad3cf){while(--_0x2ad3cf){_0x7dc7a8['push'](_0x7dc7a8['shift']());}};_0x37f727(++_0x56a053);}(_0xcc7a,0x65));var _0xacc7=function(_0x53f897,_0x539857){_0x53f897=_0x53f897-0x0;var _0x6879f8=_0xcc7a[_0x53f897];return _0x6879f8;};'use strict';var moment=require('moment');var Sequelize=require(_0xacc7('0x0'));module[_0xacc7('0x1')]={'phone':{'type':Sequelize[_0xacc7('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xacc7('0x3')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0xacc7('0x3')],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize[_0xacc7('0x3')],'unique':_0xacc7('0x4')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index bf4d383..8462003 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 _0x86dc=['status','end','json','count','offset','limit','set','apply','reject','save','update','then','error','name','index','map','rawAttributes','key','model','query','keys','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','include','CmHopperBlack','findAll','rows','catch','fields','includeAll','find','body','params','describe','html-pdf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','lodash','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus'];(function(_0x333928,_0x20e19e){var _0x1ed238=function(_0x2cee2a){while(--_0x2cee2a){_0x333928['push'](_0x333928['shift']());}};_0x1ed238(++_0x20e19e);}(_0x86dc,0x13e));var _0xc86d=function(_0x4a1bec,_0x30a2e5){_0x4a1bec=_0x4a1bec-0x0;var _0x117ecc=_0x86dc[_0x4a1bec];return _0x117ecc;};'use strict';var pdf=require(_0xc86d('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc86d('0x1'));var jsonpatch=require(_0xc86d('0x2'));var rp=require(_0xc86d('0x3'));var moment=require(_0xc86d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc86d('0x5'));var util=require('util');var path=require(_0xc86d('0x6'));var sox=require('sox');var csv=require(_0xc86d('0x7'));var ejs=require(_0xc86d('0x8'));var fs=require('fs');var _=require(_0xc86d('0x9'));var squel=require('squel');var crypto=require(_0xc86d('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xc86d('0xb'));var toCsv=require(_0xc86d('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc86d('0xc'));var authService=require(_0xc86d('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xc86d('0xe'));var hardwareService=require(_0xc86d('0xf'));var logger=require(_0xc86d('0x10'))(_0xc86d('0x11'));var utils=require(_0xc86d('0x12'));var config=require(_0xc86d('0x13'));var db=require(_0xc86d('0x14'))['db'];function respondWithStatusCode(_0x2a5900,_0x299776){_0x299776=_0x299776||0xcc;return function(_0x38abd7){if(_0x38abd7){return _0x2a5900[_0xc86d('0x15')](_0x299776);}return _0x2a5900[_0xc86d('0x16')](_0x299776)[_0xc86d('0x17')]();};}function respondWithResult(_0xccef31,_0x450fb1){_0x450fb1=_0x450fb1||0xc8;return function(_0x2a963c){if(_0x2a963c){return _0xccef31[_0xc86d('0x16')](_0x450fb1)[_0xc86d('0x18')](_0x2a963c);}};}function respondWithFilteredResult(_0x2bc469,_0x24c9c3){return function(_0x199a4a){if(_0x199a4a){var _0x5e58aa=_0x199a4a[_0xc86d('0x19')],_0x4fb8e7=_0x24c9c3[_0xc86d('0x1a')],_0x49af1f=_0x24c9c3[_0xc86d('0x1a')]+_0x24c9c3[_0xc86d('0x1b')],_0x3a253c;if(_0x49af1f>=_0x5e58aa){_0x49af1f=_0x5e58aa;_0x3a253c=0xc8;}else{_0x3a253c=0xce;}_0x2bc469[_0xc86d('0x16')](_0x3a253c);return _0x2bc469[_0xc86d('0x1c')]('Content-Range',_0x4fb8e7+'-'+_0x49af1f+'/'+_0x5e58aa)['json'](_0x199a4a);}return null;};}function patchUpdates(_0x275f57){return function(_0x2dcf09){try{jsonpatch[_0xc86d('0x1d')](_0x2dcf09,_0x275f57,!![]);}catch(_0x56f510){return BPromise[_0xc86d('0x1e')](_0x56f510);}return _0x2dcf09[_0xc86d('0x1f')]();};}function saveUpdates(_0x4f1efc,_0x4eb0e5){return function(_0x330c70){if(_0x330c70){return _0x330c70[_0xc86d('0x20')](_0x4f1efc)['then'](function(_0x34bb85){return _0x34bb85;});}return null;};}function removeEntity(_0x1adaaa,_0x3a4abb){return function(_0x27ebd8){if(_0x27ebd8){return _0x27ebd8['destroy']()[_0xc86d('0x21')](function(){_0x1adaaa[_0xc86d('0x16')](0xcc)[_0xc86d('0x17')]();});}};}function handleEntityNotFound(_0x1bb9ed,_0xbeed40){return function(_0x56278d){if(!_0x56278d){_0x1bb9ed[_0xc86d('0x15')](0x194);}return _0x56278d;};}function handleError(_0x419afa,_0x41de64){_0x41de64=_0x41de64||0x1f4;return function(_0xd59e7b){logger[_0xc86d('0x22')](_0xd59e7b['stack']);if(_0xd59e7b[_0xc86d('0x23')]){delete _0xd59e7b['name'];}_0x419afa['status'](_0x41de64)['send'](_0xd59e7b);};}exports[_0xc86d('0x24')]=function(_0x3948c4,_0x273c5a){var _0x1e29be={},_0xd8b255={},_0x1ad978={'count':0x0,'rows':[]};var _0x2fabc0=_[_0xc86d('0x25')](db['CmHopperBlack'][_0xc86d('0x26')],function(_0x2bce7b){return{'name':_0x2bce7b['fieldName'],'type':_0x2bce7b['type'][_0xc86d('0x27')]};});_0xd8b255[_0xc86d('0x28')]=_[_0xc86d('0x25')](_0x2fabc0,_0xc86d('0x23'));_0xd8b255[_0xc86d('0x29')]=_[_0xc86d('0x2a')](_0x3948c4[_0xc86d('0x29')]);_0xd8b255['filters']=_['intersection'](_0xd8b255[_0xc86d('0x28')],_0xd8b255[_0xc86d('0x29')]);_0x1e29be[_0xc86d('0x2b')]=_[_0xc86d('0x2c')](_0xd8b255[_0xc86d('0x28')],qs['fields'](_0x3948c4[_0xc86d('0x29')]['fields']));_0x1e29be[_0xc86d('0x2b')]=_0x1e29be[_0xc86d('0x2b')][_0xc86d('0x2d')]?_0x1e29be[_0xc86d('0x2b')]:_0xd8b255[_0xc86d('0x28')];if(!_0x3948c4[_0xc86d('0x29')][_0xc86d('0x2e')](_0xc86d('0x2f'))){_0x1e29be[_0xc86d('0x1b')]=qs['limit'](_0x3948c4['query']['limit']);_0x1e29be['offset']=qs['offset'](_0x3948c4['query'][_0xc86d('0x1a')]);}_0x1e29be[_0xc86d('0x30')]=qs[_0xc86d('0x31')](_0x3948c4[_0xc86d('0x29')][_0xc86d('0x31')]);_0x1e29be[_0xc86d('0x32')]=qs['filters'](_[_0xc86d('0x33')](_0x3948c4[_0xc86d('0x29')],_0xd8b255[_0xc86d('0x34')]));if(_0x3948c4[_0xc86d('0x29')][_0xc86d('0x35')]){_0x1e29be[_0xc86d('0x32')]=_[_0xc86d('0x36')](_0x1e29be[_0xc86d('0x32')],{'$or':_[_0xc86d('0x25')](_0x2fabc0,function(_0x2f600f){if(_0x2f600f['type']!==_0xc86d('0x37')){var _0x5b2df9={};_0x5b2df9[_0x2f600f[_0xc86d('0x23')]]={'$like':'%'+_0x3948c4[_0xc86d('0x29')][_0xc86d('0x35')]+'%'};return _0x5b2df9;}})});}_0x1e29be=_['merge']({},_0x1e29be,_0x3948c4[_0xc86d('0x38')]);var _0x3ba673={'where':_0x1e29be[_0xc86d('0x32')]};return db['CmHopperBlack'][_0xc86d('0x19')](_0x3ba673)[_0xc86d('0x21')](function(_0x10c565){_0x1ad978[_0xc86d('0x19')]=_0x10c565;if(_0x3948c4[_0xc86d('0x29')]['includeAll']){_0x1e29be[_0xc86d('0x39')]=[{'all':!![]}];}return db[_0xc86d('0x3a')][_0xc86d('0x3b')](_0x1e29be);})[_0xc86d('0x21')](function(_0x3bd5ce){_0x1ad978[_0xc86d('0x3c')]=_0x3bd5ce;return _0x1ad978;})['then'](respondWithFilteredResult(_0x273c5a,_0x1e29be))[_0xc86d('0x3d')](handleError(_0x273c5a,null));};exports['show']=function(_0x2023b5,_0x23deca){var _0x39bdc7={'raw':!![],'where':{'id':_0x2023b5['params']['id']}},_0x2e5971={};_0x2e5971['model']=_['keys'](db[_0xc86d('0x3a')][_0xc86d('0x26')]);_0x2e5971[_0xc86d('0x29')]=_[_0xc86d('0x2a')](_0x2023b5['query']);_0x2e5971[_0xc86d('0x34')]=_[_0xc86d('0x2c')](_0x2e5971[_0xc86d('0x28')],_0x2e5971[_0xc86d('0x29')]);_0x39bdc7[_0xc86d('0x2b')]=_['intersection'](_0x2e5971[_0xc86d('0x28')],qs[_0xc86d('0x3e')](_0x2023b5[_0xc86d('0x29')][_0xc86d('0x3e')]));_0x39bdc7['attributes']=_0x39bdc7[_0xc86d('0x2b')]['length']?_0x39bdc7['attributes']:_0x2e5971[_0xc86d('0x28')];if(_0x2023b5['query'][_0xc86d('0x3f')]){_0x39bdc7[_0xc86d('0x39')]=[{'all':!![]}];}_0x39bdc7=_[_0xc86d('0x36')]({},_0x39bdc7,_0x2023b5[_0xc86d('0x38')]);return db['CmHopperBlack'][_0xc86d('0x40')](_0x39bdc7)[_0xc86d('0x21')](handleEntityNotFound(_0x23deca,null))[_0xc86d('0x21')](respondWithResult(_0x23deca,null))['catch'](handleError(_0x23deca,null));};exports['update']=function(_0x2e2c3,_0x4b41ec){if(_0x2e2c3[_0xc86d('0x41')]['id']){delete _0x2e2c3[_0xc86d('0x41')]['id'];}return db[_0xc86d('0x3a')]['find']({'where':{'id':_0x2e2c3['params']['id']}})[_0xc86d('0x21')](handleEntityNotFound(_0x4b41ec,null))[_0xc86d('0x21')](saveUpdates(_0x2e2c3[_0xc86d('0x41')],null))['then'](respondWithResult(_0x4b41ec,null))[_0xc86d('0x3d')](handleError(_0x4b41ec,null));};exports['destroy']=function(_0x280298,_0x2e9fc3){return db['CmHopperBlack'][_0xc86d('0x40')]({'where':{'id':_0x280298[_0xc86d('0x42')]['id']}})['then'](handleEntityNotFound(_0x2e9fc3,null))[_0xc86d('0x21')](removeEntity(_0x2e9fc3,null))['catch'](handleError(_0x2e9fc3,null));};exports[_0xc86d('0x43')]=function(_0x44f29,_0x47474a){return db['CmHopperBlack']['describe']()[_0xc86d('0x21')](respondWithResult(_0x47474a,null))[_0xc86d('0x3d')](handleError(_0x47474a,null));}; \ No newline at end of file +var _0x806d=['json','count','offset','limit','set','save','update','destroy','then','error','name','send','index','map','CmHopperBlack','fieldName','type','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','merge','filter','options','includeAll','include','findAll','show','params','rawAttributes','find','body','catch','html-pdf','eml-format','rimraf','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end'];(function(_0x536866,_0x54e594){var _0x3f8cee=function(_0x116c1e){while(--_0x116c1e){_0x536866['push'](_0x536866['shift']());}};_0x3f8cee(++_0x54e594);}(_0x806d,0x131));var _0xd806=function(_0x315358,_0x2b67ca){_0x315358=_0x315358-0x0;var _0x487e62=_0x806d[_0x315358];return _0x487e62;};'use strict';var pdf=require(_0xd806('0x0'));var emlformat=require(_0xd806('0x1'));var rimraf=require(_0xd806('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd806('0x3'));var BPromise=require(_0xd806('0x4'));var Mustache=require('mustache');var util=require(_0xd806('0x5'));var path=require('path');var sox=require(_0xd806('0x6'));var csv=require(_0xd806('0x7'));var ejs=require(_0xd806('0x8'));var fs=require('fs');var _=require(_0xd806('0x9'));var squel=require(_0xd806('0xa'));var crypto=require(_0xd806('0xb'));var jsforce=require(_0xd806('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xd806('0x7'));var querystring=require(_0xd806('0xd'));var Papa=require(_0xd806('0xe'));var Redis=require(_0xd806('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xd806('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd806('0x11'));var logger=require(_0xd806('0x12'))('api');var utils=require(_0xd806('0x13'));var config=require(_0xd806('0x14'));var db=require(_0xd806('0x15'))['db'];function respondWithStatusCode(_0x3e4fc1,_0x451cba){_0x451cba=_0x451cba||0xcc;return function(_0x394569){if(_0x394569){return _0x3e4fc1[_0xd806('0x16')](_0x451cba);}return _0x3e4fc1[_0xd806('0x17')](_0x451cba)[_0xd806('0x18')]();};}function respondWithResult(_0x775b1b,_0x32f405){_0x32f405=_0x32f405||0xc8;return function(_0x47ef3b){if(_0x47ef3b){return _0x775b1b[_0xd806('0x17')](_0x32f405)[_0xd806('0x19')](_0x47ef3b);}};}function respondWithFilteredResult(_0x69dd14,_0x4a2139){return function(_0x7a8ed1){if(_0x7a8ed1){var _0x5a4ae4=_0x7a8ed1[_0xd806('0x1a')],_0x33127f=_0x4a2139[_0xd806('0x1b')],_0x1195c4=_0x4a2139[_0xd806('0x1b')]+_0x4a2139[_0xd806('0x1c')],_0x47f679;if(_0x1195c4>=_0x5a4ae4){_0x1195c4=_0x5a4ae4;_0x47f679=0xc8;}else{_0x47f679=0xce;}_0x69dd14[_0xd806('0x17')](_0x47f679);return _0x69dd14[_0xd806('0x1d')]('Content-Range',_0x33127f+'-'+_0x1195c4+'/'+_0x5a4ae4)[_0xd806('0x19')](_0x7a8ed1);}return null;};}function patchUpdates(_0x4321f3){return function(_0x3206bc){try{jsonpatch['apply'](_0x3206bc,_0x4321f3,!![]);}catch(_0x37bf19){return BPromise['reject'](_0x37bf19);}return _0x3206bc[_0xd806('0x1e')]();};}function saveUpdates(_0x1954f8,_0x222a12){return function(_0x469f01){if(_0x469f01){return _0x469f01[_0xd806('0x1f')](_0x1954f8)['then'](function(_0x4837e8){return _0x4837e8;});}return null;};}function removeEntity(_0x30fa8c,_0x3680c1){return function(_0x76392f){if(_0x76392f){return _0x76392f[_0xd806('0x20')]()[_0xd806('0x21')](function(){_0x30fa8c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a173b,_0x1335c9){return function(_0x17aa45){if(!_0x17aa45){_0x2a173b[_0xd806('0x16')](0x194);}return _0x17aa45;};}function handleError(_0x3a4934,_0x5e5062){_0x5e5062=_0x5e5062||0x1f4;return function(_0x1af29b){logger[_0xd806('0x22')](_0x1af29b['stack']);if(_0x1af29b['name']){delete _0x1af29b[_0xd806('0x23')];}_0x3a4934['status'](_0x5e5062)[_0xd806('0x24')](_0x1af29b);};}exports[_0xd806('0x25')]=function(_0x450e80,_0x3a4435){var _0x219ea3={},_0x59b43d={},_0x4f0679={'count':0x0,'rows':[]};var _0xad5769=_[_0xd806('0x26')](db[_0xd806('0x27')]['rawAttributes'],function(_0x2b6b4d){return{'name':_0x2b6b4d[_0xd806('0x28')],'type':_0x2b6b4d[_0xd806('0x29')]['key']};});_0x59b43d[_0xd806('0x2a')]=_[_0xd806('0x26')](_0xad5769,_0xd806('0x23'));_0x59b43d[_0xd806('0x2b')]=_[_0xd806('0x2c')](_0x450e80[_0xd806('0x2b')]);_0x59b43d['filters']=_['intersection'](_0x59b43d['model'],_0x59b43d['query']);_0x219ea3[_0xd806('0x2d')]=_[_0xd806('0x2e')](_0x59b43d[_0xd806('0x2a')],qs[_0xd806('0x2f')](_0x450e80[_0xd806('0x2b')][_0xd806('0x2f')]));_0x219ea3[_0xd806('0x2d')]=_0x219ea3[_0xd806('0x2d')][_0xd806('0x30')]?_0x219ea3['attributes']:_0x59b43d[_0xd806('0x2a')];if(!_0x450e80[_0xd806('0x2b')][_0xd806('0x31')](_0xd806('0x32'))){_0x219ea3['limit']=qs[_0xd806('0x1c')](_0x450e80['query'][_0xd806('0x1c')]);_0x219ea3['offset']=qs['offset'](_0x450e80[_0xd806('0x2b')][_0xd806('0x1b')]);}_0x219ea3['order']=qs[_0xd806('0x33')](_0x450e80[_0xd806('0x2b')]['sort']);_0x219ea3[_0xd806('0x34')]=qs[_0xd806('0x35')](_['pick'](_0x450e80[_0xd806('0x2b')],_0x59b43d[_0xd806('0x35')]));if(_0x450e80['query']['filter']){_0x219ea3[_0xd806('0x34')]=_[_0xd806('0x36')](_0x219ea3['where'],{'$or':_[_0xd806('0x26')](_0xad5769,function(_0x25c172){if(_0x25c172['type']!=='VIRTUAL'){var _0x5be80c={};_0x5be80c[_0x25c172[_0xd806('0x23')]]={'$like':'%'+_0x450e80[_0xd806('0x2b')][_0xd806('0x37')]+'%'};return _0x5be80c;}})});}_0x219ea3=_[_0xd806('0x36')]({},_0x219ea3,_0x450e80[_0xd806('0x38')]);var _0xdc0242={'where':_0x219ea3[_0xd806('0x34')]};return db[_0xd806('0x27')][_0xd806('0x1a')](_0xdc0242)[_0xd806('0x21')](function(_0x47a0ad){_0x4f0679[_0xd806('0x1a')]=_0x47a0ad;if(_0x450e80['query'][_0xd806('0x39')]){_0x219ea3[_0xd806('0x3a')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xd806('0x3b')](_0x219ea3);})['then'](function(_0x1834f6){_0x4f0679['rows']=_0x1834f6;return _0x4f0679;})['then'](respondWithFilteredResult(_0x3a4435,_0x219ea3))['catch'](handleError(_0x3a4435,null));};exports[_0xd806('0x3c')]=function(_0x4b4af2,_0x2dd7a8){var _0x11a915={'raw':!![],'where':{'id':_0x4b4af2[_0xd806('0x3d')]['id']}},_0x9fe6d3={};_0x9fe6d3[_0xd806('0x2a')]=_['keys'](db['CmHopperBlack'][_0xd806('0x3e')]);_0x9fe6d3['query']=_[_0xd806('0x2c')](_0x4b4af2[_0xd806('0x2b')]);_0x9fe6d3[_0xd806('0x35')]=_['intersection'](_0x9fe6d3[_0xd806('0x2a')],_0x9fe6d3['query']);_0x11a915[_0xd806('0x2d')]=_[_0xd806('0x2e')](_0x9fe6d3[_0xd806('0x2a')],qs[_0xd806('0x2f')](_0x4b4af2['query'][_0xd806('0x2f')]));_0x11a915[_0xd806('0x2d')]=_0x11a915[_0xd806('0x2d')]['length']?_0x11a915[_0xd806('0x2d')]:_0x9fe6d3['model'];if(_0x4b4af2[_0xd806('0x2b')][_0xd806('0x39')]){_0x11a915[_0xd806('0x3a')]=[{'all':!![]}];}_0x11a915=_[_0xd806('0x36')]({},_0x11a915,_0x4b4af2['options']);return db['CmHopperBlack'][_0xd806('0x3f')](_0x11a915)[_0xd806('0x21')](handleEntityNotFound(_0x2dd7a8,null))['then'](respondWithResult(_0x2dd7a8,null))['catch'](handleError(_0x2dd7a8,null));};exports[_0xd806('0x1f')]=function(_0x1fa440,_0x2b54c1){if(_0x1fa440[_0xd806('0x40')]['id']){delete _0x1fa440[_0xd806('0x40')]['id'];}return db['CmHopperBlack']['find']({'where':{'id':_0x1fa440[_0xd806('0x3d')]['id']}})['then'](handleEntityNotFound(_0x2b54c1,null))['then'](saveUpdates(_0x1fa440[_0xd806('0x40')],null))[_0xd806('0x21')](respondWithResult(_0x2b54c1,null))[_0xd806('0x41')](handleError(_0x2b54c1,null));};exports['destroy']=function(_0x10ee58,_0x5ad86f){return db[_0xd806('0x27')][_0xd806('0x3f')]({'where':{'id':_0x10ee58[_0xd806('0x3d')]['id']}})[_0xd806('0x21')](handleEntityNotFound(_0x5ad86f,null))[_0xd806('0x21')](removeEntity(_0x5ad86f,null))['catch'](handleError(_0x5ad86f,null));};exports['describe']=function(_0x53876f,_0x1badb8){return db[_0xd806('0x27')]['describe']()['then'](respondWithResult(_0x1badb8,null))[_0xd806('0x41')](handleError(_0x1badb8,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 2e11705..26b7507 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 _0xd59c=['api','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','CmHopperBlack','lodash','util','../../config/logger'];(function(_0x1126b6,_0x15b2ca){var _0x33fb44=function(_0xd349a8){while(--_0xd349a8){_0x1126b6['push'](_0x1126b6['shift']());}};_0x33fb44(++_0x15b2ca);}(_0xd59c,0xd5));var _0xcd59=function(_0x55a998,_0x51d195){_0x55a998=_0x55a998-0x0;var _0x94891f=_0xd59c[_0x55a998];return _0x94891f;};'use strict';var _=require(_0xcd59('0x0'));var util=require(_0xcd59('0x1'));var logger=require(_0xcd59('0x2'))(_0xcd59('0x3'));var moment=require('moment');var BPromise=require(_0xcd59('0x4'));var rp=require(_0xcd59('0x5'));var fs=require('fs');var path=require(_0xcd59('0x6'));var rimraf=require(_0xcd59('0x7'));var config=require(_0xcd59('0x8'));var attributes=require(_0xcd59('0x9'));module[_0xcd59('0xa')]=function(_0x35ea1f,_0x3dfd88){return _0x35ea1f['define'](_0xcd59('0xb'),attributes,{'tableName':'cm_hopper_black','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe41e=['cm_hopper_black','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperBlack.attributes'];(function(_0x2cfcd0,_0x1a2757){var _0x9b4a2c=function(_0x1df9c0){while(--_0x1df9c0){_0x2cfcd0['push'](_0x2cfcd0['shift']());}};_0x9b4a2c(++_0x1a2757);}(_0xe41e,0xb1));var _0xee41=function(_0x2534a9,_0x5f1a1f){_0x2534a9=_0x2534a9-0x0;var _0x5612aa=_0xe41e[_0x2534a9];return _0x5612aa;};'use strict';var _=require(_0xee41('0x0'));var util=require('util');var logger=require(_0xee41('0x1'))(_0xee41('0x2'));var moment=require(_0xee41('0x3'));var BPromise=require(_0xee41('0x4'));var rp=require(_0xee41('0x5'));var fs=require('fs');var path=require(_0xee41('0x6'));var rimraf=require(_0xee41('0x7'));var config=require(_0xee41('0x8'));var attributes=require(_0xee41('0x9'));module['exports']=function(_0x28ea19,_0x544f5c){return _0x28ea19['define']('CmHopperBlack',attributes,{'tableName':_0xee41('0xa'),'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 cf9601b..f276c62 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 _0xc916=['model','stringify','UpdateCmHopperBlack','body','where','DestroyCmHopperBlack','destroy','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','attributes','include','map'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc916,0x12f));var _0x6c91=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xc916[_0x55f8b4];return _0x2475f9;};'use strict';var _=require(_0x6c91('0x0'));var util=require(_0x6c91('0x1'));var moment=require(_0x6c91('0x2'));var BPromise=require(_0x6c91('0x3'));var rs=require(_0x6c91('0x4'));var fs=require('fs');var Redis=require(_0x6c91('0x5'));var db=require(_0x6c91('0x6'))['db'];var utils=require(_0x6c91('0x7'));var logger=require('../../config/logger')(_0x6c91('0x8'));var config=require(_0x6c91('0x9'));var jayson=require(_0x6c91('0xa'));var client=jayson[_0x6c91('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x30c961,_0xb607f5,_0x2693ec){return new BPromise(function(_0x19d2d4,_0x3d402d){return client['request'](_0x30c961,_0x2693ec)[_0x6c91('0xc')](function(_0x4a16f2){logger[_0x6c91('0xd')](_0x6c91('0xe'),_0xb607f5,_0x6c91('0xf'));logger[_0x6c91('0x10')]('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0xb607f5,_0x6c91('0xf'),JSON['stringify'](_0x4a16f2));if(_0x4a16f2[_0x6c91('0x11')]){if(_0x4a16f2['error'][_0x6c91('0x12')]===0x1f4){logger[_0x6c91('0x11')](_0x6c91('0xe'),_0xb607f5,_0x4a16f2['error'][_0x6c91('0x13')]);return _0x3d402d(_0x4a16f2['error'][_0x6c91('0x13')]);}logger[_0x6c91('0x11')](_0x6c91('0xe'),_0xb607f5,_0x4a16f2['error'][_0x6c91('0x13')]);return _0x19d2d4(_0x4a16f2[_0x6c91('0x11')][_0x6c91('0x13')]);}else{logger['info'](_0x6c91('0xe'),_0xb607f5,_0x6c91('0xf'));_0x19d2d4(_0x4a16f2[_0x6c91('0x14')][_0x6c91('0x13')]);}})[_0x6c91('0x15')](function(_0x1c99e2){logger['error'](_0x6c91('0xe'),_0xb607f5,_0x1c99e2);_0x3d402d(_0x1c99e2);});});}exports[_0x6c91('0x16')]=function(_0x5d415a){var _0x3bd6db=this;return new Promise(function(_0x5ac7ed,_0x21fa5a){return db[_0x6c91('0x17')][_0x6c91('0x18')]({'raw':_0x5d415a[_0x6c91('0x19')]?_0x5d415a[_0x6c91('0x19')][_0x6c91('0x1a')]===undefined?!![]:![]:!![],'where':_0x5d415a[_0x6c91('0x19')]?_0x5d415a[_0x6c91('0x19')]['where']||null:null,'attributes':_0x5d415a[_0x6c91('0x19')]?_0x5d415a[_0x6c91('0x19')][_0x6c91('0x1b')]||null:null,'limit':_0x5d415a[_0x6c91('0x19')]?_0x5d415a[_0x6c91('0x19')]['limit']||null:null,'include':_0x5d415a[_0x6c91('0x19')]?_0x5d415a[_0x6c91('0x19')][_0x6c91('0x1c')]?_[_0x6c91('0x1d')](_0x5d415a['options'][_0x6c91('0x1c')],function(_0x4d6438){return{'model':db[_0x4d6438[_0x6c91('0x1e')]],'as':_0x4d6438['as'],'attributes':_0x4d6438[_0x6c91('0x1b')],'include':_0x4d6438[_0x6c91('0x1c')]?_[_0x6c91('0x1d')](_0x4d6438['include'],function(_0x5c6155){return{'model':db[_0x5c6155[_0x6c91('0x1e')]],'as':_0x5c6155['as'],'attributes':_0x5c6155['attributes'],'include':_0x5c6155[_0x6c91('0x1c')]?_[_0x6c91('0x1d')](_0x5c6155[_0x6c91('0x1c')],function(_0x4318e3){return{'model':db[_0x4318e3[_0x6c91('0x1e')]],'as':_0x4318e3['as'],'attributes':_0x4318e3[_0x6c91('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x29d33a){logger[_0x6c91('0xd')]('GetCmHopperBlack',_0x5d415a);logger[_0x6c91('0x10')]('GetCmHopperBlack',_0x5d415a,JSON[_0x6c91('0x1f')](_0x29d33a));_0x5ac7ed(_0x29d33a);})[_0x6c91('0x15')](function(_0x1478e9){logger['error'](_0x6c91('0x16'),_0x1478e9['message'],_0x5d415a);_0x21fa5a(_0x3bd6db[_0x6c91('0x11')](0x1f4,_0x1478e9[_0x6c91('0x13')]));});});};exports[_0x6c91('0x20')]=function(_0x51c1a0){var _0x5c6359=this;return new Promise(function(_0x40c92b,_0xa262aa){return db['CmHopperBlack']['update'](_0x51c1a0[_0x6c91('0x21')],{'raw':_0x51c1a0['options']?_0x51c1a0[_0x6c91('0x19')][_0x6c91('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x51c1a0[_0x6c91('0x19')]?_0x51c1a0[_0x6c91('0x19')][_0x6c91('0x22')]||null:null,'attributes':_0x51c1a0[_0x6c91('0x19')]?_0x51c1a0['options'][_0x6c91('0x1b')]||null:null,'limit':_0x51c1a0[_0x6c91('0x19')]?_0x51c1a0[_0x6c91('0x19')]['limit']||null:null})['then'](function(_0x5ead7c){logger[_0x6c91('0xd')](_0x6c91('0x20'),_0x51c1a0);logger[_0x6c91('0x10')](_0x6c91('0x20'),_0x51c1a0,JSON[_0x6c91('0x1f')](_0x5ead7c));_0x40c92b(_0x5ead7c);})[_0x6c91('0x15')](function(_0x7cb61){logger['error'](_0x6c91('0x20'),_0x7cb61['message'],_0x51c1a0);_0xa262aa(_0x5c6359[_0x6c91('0x11')](0x1f4,_0x7cb61[_0x6c91('0x13')]));});});};exports[_0x6c91('0x23')]=function(_0x10129d){var _0x2a481f=this;return new Promise(function(_0x4c758c,_0x3f54a7){return db[_0x6c91('0x17')][_0x6c91('0x24')]({'where':_0x10129d[_0x6c91('0x19')]?_0x10129d[_0x6c91('0x19')][_0x6c91('0x22')]||null:null})[_0x6c91('0xc')](function(_0xb3a1a6){logger[_0x6c91('0xd')](_0x6c91('0x23'),_0x10129d);logger['debug'](_0x6c91('0x23'),_0x10129d,JSON['stringify'](_0xb3a1a6));_0x4c758c(_0xb3a1a6);})['catch'](function(_0x5ed516){logger['error'](_0x6c91('0x23'),_0x5ed516[_0x6c91('0x13')],_0x10129d);_0x3f54a7(_0x2a481f[_0x6c91('0x11')](0x1f4,_0x5ed516[_0x6c91('0x13')]));});});}; \ No newline at end of file +var _0x35e4=['debug','UpdateCmHopperBlack','update','body','destroy','DestroyCmHopperBlack','lodash','util','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','CmHopperBlack,\x20%s,\x20%s','CmHopperBlack,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','where','limit','include','map','model','attributes','then'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x35e4,0x109));var _0x435e=function(_0x173e83,_0x75b88c){_0x173e83=_0x173e83-0x0;var _0x410541=_0x35e4[_0x173e83];return _0x410541;};'use strict';var _=require(_0x435e('0x0'));var util=require(_0x435e('0x1'));var moment=require('moment');var BPromise=require(_0x435e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x435e('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x435e('0x4'))(_0x435e('0x5'));var config=require(_0x435e('0x6'));var jayson=require(_0x435e('0x7'));var client=jayson[_0x435e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x517feb,_0x43970f,_0x1b3760){return new BPromise(function(_0x51791d,_0x1b2316){return client['request'](_0x517feb,_0x1b3760)['then'](function(_0x460da3){logger[_0x435e('0x9')](_0x435e('0xa'),_0x43970f,'request\x20sent');logger['debug'](_0x435e('0xb'),_0x43970f,_0x435e('0xc'),JSON[_0x435e('0xd')](_0x460da3));if(_0x460da3[_0x435e('0xe')]){if(_0x460da3[_0x435e('0xe')][_0x435e('0xf')]===0x1f4){logger[_0x435e('0xe')](_0x435e('0xa'),_0x43970f,_0x460da3[_0x435e('0xe')][_0x435e('0x10')]);return _0x1b2316(_0x460da3['error'][_0x435e('0x10')]);}logger[_0x435e('0xe')]('CmHopperBlack,\x20%s,\x20%s',_0x43970f,_0x460da3[_0x435e('0xe')][_0x435e('0x10')]);return _0x51791d(_0x460da3['error'][_0x435e('0x10')]);}else{logger[_0x435e('0x9')](_0x435e('0xa'),_0x43970f,_0x435e('0xc'));_0x51791d(_0x460da3[_0x435e('0x11')][_0x435e('0x10')]);}})[_0x435e('0x12')](function(_0x15f580){logger['error'](_0x435e('0xa'),_0x43970f,_0x15f580);_0x1b2316(_0x15f580);});});}exports[_0x435e('0x13')]=function(_0x1e9658){var _0x238e78=this;return new Promise(function(_0x20dd26,_0x4d4005){return db[_0x435e('0x14')][_0x435e('0x15')]({'raw':_0x1e9658[_0x435e('0x16')]?_0x1e9658[_0x435e('0x16')][_0x435e('0x17')]===undefined?!![]:![]:!![],'where':_0x1e9658[_0x435e('0x16')]?_0x1e9658[_0x435e('0x16')][_0x435e('0x18')]||null:null,'attributes':_0x1e9658[_0x435e('0x16')]?_0x1e9658[_0x435e('0x16')]['attributes']||null:null,'limit':_0x1e9658[_0x435e('0x16')]?_0x1e9658[_0x435e('0x16')][_0x435e('0x19')]||null:null,'include':_0x1e9658['options']?_0x1e9658[_0x435e('0x16')][_0x435e('0x1a')]?_[_0x435e('0x1b')](_0x1e9658[_0x435e('0x16')]['include'],function(_0x4844ee){return{'model':db[_0x4844ee[_0x435e('0x1c')]],'as':_0x4844ee['as'],'attributes':_0x4844ee[_0x435e('0x1d')],'include':_0x4844ee[_0x435e('0x1a')]?_['map'](_0x4844ee['include'],function(_0x5bf9c7){return{'model':db[_0x5bf9c7['model']],'as':_0x5bf9c7['as'],'attributes':_0x5bf9c7[_0x435e('0x1d')],'include':_0x5bf9c7['include']?_[_0x435e('0x1b')](_0x5bf9c7[_0x435e('0x1a')],function(_0x518f3c){return{'model':db[_0x518f3c[_0x435e('0x1c')]],'as':_0x518f3c['as'],'attributes':_0x518f3c[_0x435e('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x435e('0x1e')](function(_0x219358){logger['info'](_0x435e('0x13'),_0x1e9658);logger[_0x435e('0x1f')](_0x435e('0x13'),_0x1e9658,JSON['stringify'](_0x219358));_0x20dd26(_0x219358);})['catch'](function(_0x1c31c0){logger[_0x435e('0xe')](_0x435e('0x13'),_0x1c31c0[_0x435e('0x10')],_0x1e9658);_0x4d4005(_0x238e78[_0x435e('0xe')](0x1f4,_0x1c31c0['message']));});});};exports[_0x435e('0x20')]=function(_0x43a8f4){var _0x3722b8=this;return new Promise(function(_0x4d4c00,_0x14059d){return db[_0x435e('0x14')][_0x435e('0x21')](_0x43a8f4[_0x435e('0x22')],{'raw':_0x43a8f4[_0x435e('0x16')]?_0x43a8f4[_0x435e('0x16')][_0x435e('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x43a8f4[_0x435e('0x16')]?_0x43a8f4[_0x435e('0x16')]['where']||null:null,'attributes':_0x43a8f4[_0x435e('0x16')]?_0x43a8f4[_0x435e('0x16')]['attributes']||null:null,'limit':_0x43a8f4[_0x435e('0x16')]?_0x43a8f4[_0x435e('0x16')]['limit']||null:null})['then'](function(_0x12fa17){logger[_0x435e('0x9')](_0x435e('0x20'),_0x43a8f4);logger[_0x435e('0x1f')](_0x435e('0x20'),_0x43a8f4,JSON[_0x435e('0xd')](_0x12fa17));_0x4d4c00(_0x12fa17);})[_0x435e('0x12')](function(_0x5cce1e){logger[_0x435e('0xe')](_0x435e('0x20'),_0x5cce1e['message'],_0x43a8f4);_0x14059d(_0x3722b8[_0x435e('0xe')](0x1f4,_0x5cce1e[_0x435e('0x10')]));});});};exports['DestroyCmHopperBlack']=function(_0x2f9317){var _0x4716b2=this;return new Promise(function(_0x103d0e,_0x4576e3){return db[_0x435e('0x14')][_0x435e('0x23')]({'where':_0x2f9317[_0x435e('0x16')]?_0x2f9317[_0x435e('0x16')]['where']||null:null})['then'](function(_0x5b2a05){logger['info'](_0x435e('0x24'),_0x2f9317);logger['debug'](_0x435e('0x24'),_0x2f9317,JSON[_0x435e('0xd')](_0x5b2a05));_0x103d0e(_0x5b2a05);})[_0x435e('0x12')](function(_0x3a2c90){logger[_0x435e('0xe')](_0x435e('0x24'),_0x3a2c90[_0x435e('0x10')],_0x2f9317);_0x4576e3(_0x4716b2[_0x435e('0xe')](0x1f4,_0x3a2c90[_0x435e('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 2551541..cce904e 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 _0x9957=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router'];(function(_0x387777,_0x356171){var _0x3f84c0=function(_0x4d4423){while(--_0x4d4423){_0x387777['push'](_0x387777['shift']());}};_0x3f84c0(++_0x356171);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var auth=require(_0x7995('0x5'));var interaction=require(_0x7995('0x6'));var config=require(_0x7995('0x7'));var controller=require('./cmHopperBlack.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('0xe')](_0x7995('0xc'),auth[_0x7995('0x9')](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x11')]);module[_0x7995('0x12')]=router; \ No newline at end of file +var _0x9f62=['/describe','describe','/:id','exports','util','connect-timeout','express','Router','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated'];(function(_0x2da94c,_0x3deb12){var _0x548a51=function(_0x2fbb2f){while(--_0x2fbb2f){_0x2da94c['push'](_0x2da94c['shift']());}};_0x548a51(++_0x3deb12);}(_0x9f62,0x154));var _0x29f6=function(_0x5797d0,_0x532095){_0x5797d0=_0x5797d0-0x0;var _0x232a4e=_0x9f62[_0x5797d0];return _0x232a4e;};'use strict';var multer=require('multer');var util=require(_0x29f6('0x0'));var path=require('path');var timeout=require(_0x29f6('0x1'));var express=require(_0x29f6('0x2'));var router=express[_0x29f6('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x29f6('0x4'));var controller=require(_0x29f6('0x5'));router[_0x29f6('0x6')]('/',auth[_0x29f6('0x7')](),controller['index']);router[_0x29f6('0x6')](_0x29f6('0x8'),auth[_0x29f6('0x7')](),controller[_0x29f6('0x9')]);router[_0x29f6('0x6')]('/:id',auth['isAuthenticated'](),controller['show']);router['put'](_0x29f6('0xa'),auth[_0x29f6('0x7')](),controller['update']);router['delete'](_0x29f6('0xa'),auth[_0x29f6('0x7')](),controller['destroy']);module[_0x29f6('0xb')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index df666c0..24be3b7 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 _0x7be1=['followuptime','diff','seconds','dispositionat','BOOLEAN','sequelize','moment','exports','INTEGER','STRING','DATE','getDataValue','endtime','setDataValue'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x7be1,0x19b));var _0x17be=function(_0x131e60,_0x5352ce){_0x131e60=_0x131e60-0x0;var _0x4bc497=_0x7be1[_0x131e60];return _0x4bc497;};'use strict';var Sequelize=require(_0x17be('0x0'));var moment=require(_0x17be('0x1'));module[_0x17be('0x2')]={'state':{'type':Sequelize[_0x17be('0x3')](0x2)},'statedesc':{'type':Sequelize[_0x17be('0x4')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x17be('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x17be('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x17be('0x4')]},'originatecalleridnum':{'type':Sequelize[_0x17be('0x4')]},'originatecalleridname':{'type':Sequelize[_0x17be('0x4')]},'calleridnum':{'type':Sequelize[_0x17be('0x4')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x17be('0x5')]},'responsetime':{'type':Sequelize[_0x17be('0x5')]},'answertime':{'type':Sequelize[_0x17be('0x5')]},'droptime':{'type':Sequelize[_0x17be('0x5')]},'endtime':{'type':Sequelize[_0x17be('0x5')]},'ringtime':{'type':Sequelize[_0x17be('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x17be('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x17be('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x17be('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x17be('0x4')]},'campaign':{'type':Sequelize[_0x17be('0x4')]},'campaigntype':{'type':Sequelize[_0x17be('0x4')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x17be('0x4')]},'disposition':{'type':Sequelize[_0x17be('0x4')]},'dispositionat':{'type':Sequelize[_0x17be('0x5')],'set':function(_0x11f764){var _0x39eada=this[_0x17be('0x6')](_0x17be('0x7'));if(_0x39eada&&_0x11f764){this[_0x17be('0x8')](_0x17be('0x9'),moment(_0x11f764)[_0x17be('0xa')](moment(_0x39eada),_0x17be('0xb')));}return this[_0x17be('0x8')](_0x17be('0xc'),_0x11f764);}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x17be('0xd')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x17be('0xd')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x17be('0x5')]},'callback':{'type':Sequelize[_0x17be('0xd')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x17be('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x17be('0x5')]},'deleted':{'type':Sequelize[_0x17be('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x17be('0x5')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x17be('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x17be('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x17be('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x17be('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xed88=['BOOLEAN','sequelize','moment','exports','INTEGER','STRING','DATE','getDataValue','setDataValue','followuptime','diff','seconds','dispositionat'];(function(_0x511049,_0x27d460){var _0x2e1d72=function(_0x410cd8){while(--_0x410cd8){_0x511049['push'](_0x511049['shift']());}};_0x2e1d72(++_0x27d460);}(_0xed88,0x76));var _0x8ed8=function(_0x4bdca2,_0x347380){_0x4bdca2=_0x4bdca2-0x0;var _0x53bfe4=_0xed88[_0x4bdca2];return _0x53bfe4;};'use strict';var Sequelize=require(_0x8ed8('0x0'));var moment=require(_0x8ed8('0x1'));module[_0x8ed8('0x2')]={'state':{'type':Sequelize[_0x8ed8('0x3')](0x2)},'statedesc':{'type':Sequelize[_0x8ed8('0x4')]},'scheduledat':{'type':Sequelize[_0x8ed8('0x5')]},'countbusyretry':{'type':Sequelize[_0x8ed8('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x8ed8('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x8ed8('0x4')]},'originatecalleridnum':{'type':Sequelize[_0x8ed8('0x4')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x8ed8('0x4')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x8ed8('0x5')]},'responsetime':{'type':Sequelize[_0x8ed8('0x5')]},'answertime':{'type':Sequelize[_0x8ed8('0x5')]},'droptime':{'type':Sequelize[_0x8ed8('0x5')]},'endtime':{'type':Sequelize[_0x8ed8('0x5')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x8ed8('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x8ed8('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x8ed8('0x4')]},'campaign':{'type':Sequelize[_0x8ed8('0x4')]},'campaigntype':{'type':Sequelize[_0x8ed8('0x4')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x8ed8('0x4')]},'disposition':{'type':Sequelize[_0x8ed8('0x4')]},'dispositionat':{'type':Sequelize[_0x8ed8('0x5')],'set':function(_0x13bdbc){var _0xea5b28=this[_0x8ed8('0x6')]('endtime');if(_0xea5b28&&_0x13bdbc){this[_0x8ed8('0x7')](_0x8ed8('0x8'),moment(_0x13bdbc)[_0x8ed8('0x9')](moment(_0xea5b28),_0x8ed8('0xa')));}return this[_0x8ed8('0x7')](_0x8ed8('0xb'),_0x13bdbc);}},'amd':{'type':Sequelize[_0x8ed8('0xc')],'defaultValue':![]},'fax':{'type':Sequelize[_0x8ed8('0xc')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x8ed8('0xc')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x8ed8('0xc')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x8ed8('0x5')]},'callback':{'type':Sequelize[_0x8ed8('0xc')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x8ed8('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize[_0x8ed8('0x5')]},'recallme':{'type':Sequelize[_0x8ed8('0xc')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x8ed8('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0x8ed8('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x8ed8('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x8ed8('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x8ed8('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 e27d311..b94f282 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 _0x6ce8=['bluebird','mustache','util','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','CmHopperFinal','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filters','merge','filter','includeAll','include','findAll','rows','catch','show','params','options','find','describe','body','uniqueid','sequelize','COUNT','`state`\x20=\x200,\x201,\x20null','literal','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','reCallContacts','countContactsIvrCampaignHopperFinal','noSuchContacts','congestionContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','fromQuery','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','field','phone','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','toString','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','cm_hopper','VoiceQueueId\x20=\x20?','select','calleridnum','Campaign','into','CampaignId','CampaignId\x20=\x20?','state\x20=\x20?','state\x20=\x204','checkContactHopper','CmHopper','findOne','eml-format','rimraf','fast-json-patch','request-promise','moment'];(function(_0x7c1337,_0x536b08){var _0x57e56f=function(_0x490acd){while(--_0x490acd){_0x7c1337['push'](_0x7c1337['shift']());}};_0x57e56f(++_0x536b08);}(_0x6ce8,0xfd));var _0x86ce=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x6ce8[_0x2641f9];return _0x585741;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x86ce('0x0'));var rimraf=require(_0x86ce('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x86ce('0x2'));var rp=require(_0x86ce('0x3'));var moment=require(_0x86ce('0x4'));var BPromise=require(_0x86ce('0x5'));var Mustache=require(_0x86ce('0x6'));var util=require(_0x86ce('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x86ce('0x8'));var fs=require('fs');var _=require(_0x86ce('0x9'));var squel=require(_0x86ce('0xa'));var crypto=require(_0x86ce('0xb'));var jsforce=require(_0x86ce('0xc'));var deskjs=require(_0x86ce('0xd'));var toCsv=require(_0x86ce('0xe'));var querystring=require('querystring');var Papa=require(_0x86ce('0xf'));var Redis=require(_0x86ce('0x10'));var authService=require(_0x86ce('0x11'));var qs=require(_0x86ce('0x12'));var as=require(_0x86ce('0x13'));var hardwareService=require(_0x86ce('0x14'));var logger=require('../../config/logger')(_0x86ce('0x15'));var utils=require(_0x86ce('0x16'));var config=require(_0x86ce('0x17'));var db=require(_0x86ce('0x18'))['db'];function respondWithStatusCode(_0x1e60b4,_0x10fd79){_0x10fd79=_0x10fd79||0xcc;return function(_0x45f394){if(_0x45f394){return _0x1e60b4[_0x86ce('0x19')](_0x10fd79);}return _0x1e60b4[_0x86ce('0x1a')](_0x10fd79)[_0x86ce('0x1b')]();};}function respondWithResult(_0x735074,_0x1b8d60){_0x1b8d60=_0x1b8d60||0xc8;return function(_0xf6986f){if(_0xf6986f){return _0x735074['status'](_0x1b8d60)[_0x86ce('0x1c')](_0xf6986f);}};}function respondWithFilteredResult(_0x1bdcc7,_0x37f93a){return function(_0x52f9f5){if(_0x52f9f5){var _0x4494bb=_0x52f9f5[_0x86ce('0x1d')],_0x921fcc=_0x37f93a[_0x86ce('0x1e')],_0x18acbe=_0x37f93a[_0x86ce('0x1e')]+_0x37f93a[_0x86ce('0x1f')],_0x55d74c;if(_0x18acbe>=_0x4494bb){_0x18acbe=_0x4494bb;_0x55d74c=0xc8;}else{_0x55d74c=0xce;}_0x1bdcc7[_0x86ce('0x1a')](_0x55d74c);return _0x1bdcc7[_0x86ce('0x20')]('Content-Range',_0x921fcc+'-'+_0x18acbe+'/'+_0x4494bb)[_0x86ce('0x1c')](_0x52f9f5);}return null;};}function patchUpdates(_0x37b41b){return function(_0x3d2948){try{jsonpatch[_0x86ce('0x21')](_0x3d2948,_0x37b41b,!![]);}catch(_0x48f756){return BPromise[_0x86ce('0x22')](_0x48f756);}return _0x3d2948[_0x86ce('0x23')]();};}function saveUpdates(_0x352f0d,_0x3e41da){return function(_0x40ded4){if(_0x40ded4){return _0x40ded4[_0x86ce('0x24')](_0x352f0d)[_0x86ce('0x25')](function(_0x454202){return _0x454202;});}return null;};}function removeEntity(_0x46f6dc,_0x5cd573){return function(_0x31ac01){if(_0x31ac01){return _0x31ac01[_0x86ce('0x26')]()[_0x86ce('0x25')](function(){_0x46f6dc[_0x86ce('0x1a')](0xcc)[_0x86ce('0x1b')]();});}};}function handleEntityNotFound(_0x10d84d,_0x49c126){return function(_0x5fbe2e){if(!_0x5fbe2e){_0x10d84d[_0x86ce('0x19')](0x194);}return _0x5fbe2e;};}function handleError(_0x2d1bca,_0x202ca9){_0x202ca9=_0x202ca9||0x1f4;return function(_0x4163d3){logger[_0x86ce('0x27')](_0x4163d3[_0x86ce('0x28')]);if(_0x4163d3[_0x86ce('0x29')]){delete _0x4163d3[_0x86ce('0x29')];}_0x2d1bca['status'](_0x202ca9)[_0x86ce('0x2a')](_0x4163d3);};}exports[_0x86ce('0x2b')]=function(_0x5e9cc0,_0x51b830){var _0x26c0e9={},_0x1c8653={},_0x33a8c9={'count':0x0,'rows':[]};var _0x223ff5=_[_0x86ce('0x2c')](db[_0x86ce('0x2d')][_0x86ce('0x2e')],function(_0x2ff255){return{'name':_0x2ff255[_0x86ce('0x2f')],'type':_0x2ff255[_0x86ce('0x30')][_0x86ce('0x31')]};});_0x1c8653[_0x86ce('0x32')]=_[_0x86ce('0x2c')](_0x223ff5,'name');_0x1c8653[_0x86ce('0x33')]=_[_0x86ce('0x34')](_0x5e9cc0[_0x86ce('0x33')]);_0x1c8653['filters']=_['intersection'](_0x1c8653[_0x86ce('0x32')],_0x1c8653[_0x86ce('0x33')]);_0x26c0e9[_0x86ce('0x35')]=_[_0x86ce('0x36')](_0x1c8653['model'],qs[_0x86ce('0x37')](_0x5e9cc0[_0x86ce('0x33')]['fields']));_0x26c0e9[_0x86ce('0x35')]=_0x26c0e9[_0x86ce('0x35')][_0x86ce('0x38')]?_0x26c0e9[_0x86ce('0x35')]:_0x1c8653[_0x86ce('0x32')];if(!_0x5e9cc0[_0x86ce('0x33')][_0x86ce('0x39')]('nolimit')){_0x26c0e9[_0x86ce('0x1f')]=qs[_0x86ce('0x1f')](_0x5e9cc0[_0x86ce('0x33')]['limit']);_0x26c0e9['offset']=qs['offset'](_0x5e9cc0[_0x86ce('0x33')][_0x86ce('0x1e')]);}_0x26c0e9[_0x86ce('0x3a')]=qs['sort'](_0x5e9cc0[_0x86ce('0x33')][_0x86ce('0x3b')]);_0x26c0e9[_0x86ce('0x3c')]=qs['filters'](_[_0x86ce('0x3d')](_0x5e9cc0['query'],_0x1c8653[_0x86ce('0x3e')]));if(_0x5e9cc0[_0x86ce('0x33')]['filter']){_0x26c0e9[_0x86ce('0x3c')]=_[_0x86ce('0x3f')](_0x26c0e9[_0x86ce('0x3c')],{'$or':_['map'](_0x223ff5,function(_0x48cd4c){if(_0x48cd4c['type']!=='VIRTUAL'){var _0x5d220e={};_0x5d220e[_0x48cd4c[_0x86ce('0x29')]]={'$like':'%'+_0x5e9cc0[_0x86ce('0x33')][_0x86ce('0x40')]+'%'};return _0x5d220e;}})});}_0x26c0e9=_[_0x86ce('0x3f')]({},_0x26c0e9,_0x5e9cc0['options']);var _0x458702={'where':_0x26c0e9['where']};return db[_0x86ce('0x2d')][_0x86ce('0x1d')](_0x458702)[_0x86ce('0x25')](function(_0x57105a){_0x33a8c9[_0x86ce('0x1d')]=_0x57105a;if(_0x5e9cc0[_0x86ce('0x33')][_0x86ce('0x41')]){_0x26c0e9[_0x86ce('0x42')]=[{'all':!![]}];}return db[_0x86ce('0x2d')][_0x86ce('0x43')](_0x26c0e9);})[_0x86ce('0x25')](function(_0x14ded8){_0x33a8c9[_0x86ce('0x44')]=_0x14ded8;return _0x33a8c9;})[_0x86ce('0x25')](respondWithFilteredResult(_0x51b830,_0x26c0e9))[_0x86ce('0x45')](handleError(_0x51b830,null));};exports[_0x86ce('0x46')]=function(_0x1fd10a,_0x35524b){var _0x1ed92b={'raw':!![],'where':{'id':_0x1fd10a[_0x86ce('0x47')]['id']}},_0x28ea12={};_0x28ea12[_0x86ce('0x32')]=_['keys'](db[_0x86ce('0x2d')][_0x86ce('0x2e')]);_0x28ea12[_0x86ce('0x33')]=_['keys'](_0x1fd10a['query']);_0x28ea12[_0x86ce('0x3e')]=_[_0x86ce('0x36')](_0x28ea12[_0x86ce('0x32')],_0x28ea12[_0x86ce('0x33')]);_0x1ed92b[_0x86ce('0x35')]=_[_0x86ce('0x36')](_0x28ea12[_0x86ce('0x32')],qs[_0x86ce('0x37')](_0x1fd10a[_0x86ce('0x33')][_0x86ce('0x37')]));_0x1ed92b['attributes']=_0x1ed92b['attributes'][_0x86ce('0x38')]?_0x1ed92b[_0x86ce('0x35')]:_0x28ea12[_0x86ce('0x32')];if(_0x1fd10a[_0x86ce('0x33')][_0x86ce('0x41')]){_0x1ed92b['include']=[{'all':!![]}];}_0x1ed92b=_['merge']({},_0x1ed92b,_0x1fd10a[_0x86ce('0x48')]);return db[_0x86ce('0x2d')][_0x86ce('0x49')](_0x1ed92b)[_0x86ce('0x25')](handleEntityNotFound(_0x35524b,null))[_0x86ce('0x25')](respondWithResult(_0x35524b,null))['catch'](handleError(_0x35524b,null));};exports[_0x86ce('0x4a')]=function(_0x5980ae,_0x4f4ecb){return db[_0x86ce('0x2d')]['describe']()['then'](respondWithResult(_0x4f4ecb,null))['catch'](handleError(_0x4f4ecb,null));};exports[_0x86ce('0x24')]=function(_0x127826,_0x1095b6){if(_0x127826[_0x86ce('0x4b')][_0x86ce('0x4c')]){delete _0x127826['body'][_0x86ce('0x4c')];}return db[_0x86ce('0x2d')]['find']({'where':{'uniqueid':_0x127826['params']['id']}})[_0x86ce('0x25')](handleEntityNotFound(_0x1095b6,null))[_0x86ce('0x25')](saveUpdates(_0x127826[_0x86ce('0x4b')],null))['then'](respondWithResult(_0x1095b6,null))['catch'](handleError(_0x1095b6,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x466864,_0x4faa1a,_0x26c791){return db[_0x86ce('0x2d')][_0x86ce('0x43')]({'raw':![],'where':{'VoiceQueueId':_0x466864['params']['id']},'attributes':[[db[_0x86ce('0x4d')]['fn'](_0x86ce('0x4e'),db[_0x86ce('0x4d')]['fn']('IF',db[_0x86ce('0x4d')]['literal'](_0x86ce('0x4f')))),'noSuchContacts'],[db[_0x86ce('0x4d')]['fn'](_0x86ce('0x4e'),db[_0x86ce('0x4d')]['fn']('IF',db[_0x86ce('0x4d')][_0x86ce('0x50')](_0x86ce('0x51')))),'noAnswerContacts'],[db[_0x86ce('0x4d')]['fn'](_0x86ce('0x4e'),db[_0x86ce('0x4d')]['fn']('IF',db[_0x86ce('0x4d')][_0x86ce('0x50')](_0x86ce('0x52')))),_0x86ce('0x53')],[db['sequelize']['fn'](_0x86ce('0x4e'),db[_0x86ce('0x4d')]['fn']('IF',db['sequelize'][_0x86ce('0x50')](_0x86ce('0x54')))),'congestionContacts'],[db['sequelize']['fn'](_0x86ce('0x4e'),db[_0x86ce('0x4d')]['fn']('IF',db['sequelize'][_0x86ce('0x50')](_0x86ce('0x55')))),_0x86ce('0x56')],[db[_0x86ce('0x4d')]['fn'](_0x86ce('0x4e'),db[_0x86ce('0x4d')]['fn']('IF',db[_0x86ce('0x4d')][_0x86ce('0x50')](_0x86ce('0x57')))),_0x86ce('0x58')],[db['sequelize']['fn'](_0x86ce('0x4e'),db['sequelize']['fn']('IF',db[_0x86ce('0x4d')][_0x86ce('0x50')]('`state`\x20=\x2022,\x201,\x20null'))),_0x86ce('0x59')],[db[_0x86ce('0x4d')]['fn'](_0x86ce('0x4e'),db['sequelize']['fn']('IF',db[_0x86ce('0x4d')][_0x86ce('0x50')]('`state`\x20=\x2019,\x201,\x20null'))),'answeringMachine']]})['then'](handleEntityNotFound(_0x4faa1a,null))['then'](respondWithResult(_0x4faa1a,null))[_0x86ce('0x45')](handleError(_0x4faa1a,null));};exports[_0x86ce('0x5a')]=function(_0x51cafe,_0x17faee,_0x27ecc1){return db[_0x86ce('0x2d')]['findAll']({'raw':![],'where':{'CampaignId':_0x51cafe['params']['id']},'attributes':[[db[_0x86ce('0x4d')]['fn']('COUNT',db[_0x86ce('0x4d')]['fn']('IF',db[_0x86ce('0x4d')][_0x86ce('0x50')](_0x86ce('0x4f')))),_0x86ce('0x5b')],[db['sequelize']['fn']('COUNT',db[_0x86ce('0x4d')]['fn']('IF',db[_0x86ce('0x4d')][_0x86ce('0x50')](_0x86ce('0x51')))),'noAnswerContacts'],[db[_0x86ce('0x4d')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x86ce('0x4d')]['literal'](_0x86ce('0x52')))),_0x86ce('0x53')],[db['sequelize']['fn']('COUNT',db[_0x86ce('0x4d')]['fn']('IF',db[_0x86ce('0x4d')]['literal'](_0x86ce('0x54')))),_0x86ce('0x5c')],[db[_0x86ce('0x4d')]['fn'](_0x86ce('0x4e'),db[_0x86ce('0x4d')]['fn']('IF',db[_0x86ce('0x4d')][_0x86ce('0x50')](_0x86ce('0x55')))),'dropContacts'],[db['sequelize']['fn']('COUNT',db[_0x86ce('0x4d')]['fn']('IF',db[_0x86ce('0x4d')][_0x86ce('0x50')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x86ce('0x58')],[db[_0x86ce('0x4d')]['fn'](_0x86ce('0x4e'),db[_0x86ce('0x4d')]['fn']('IF',db['sequelize'][_0x86ce('0x50')]('`state`\x20=\x2022,\x201,\x20null'))),_0x86ce('0x59')],[db['sequelize']['fn']('COUNT',db[_0x86ce('0x4d')]['fn']('IF',db[_0x86ce('0x4d')][_0x86ce('0x50')](_0x86ce('0x5d')))),_0x86ce('0x5e')]]})['then'](handleEntityNotFound(_0x17faee,null))['then'](respondWithResult(_0x17faee,null))[_0x86ce('0x45')](handleError(_0x17faee,null));};exports[_0x86ce('0x5f')]=function(_0xe3a8e0,_0x2346a1,_0x436689){return db[_0x86ce('0x60')]['find']({'where':{'id':_0xe3a8e0[_0x86ce('0x47')]['id']}})[_0x86ce('0x25')](handleEntityNotFound(_0x2346a1,null))[_0x86ce('0x25')](function(_0x3d2d2a){var _0x28d475;if(_0x3d2d2a){_0x28d475=squel[_0x86ce('0x61')]()['into']('cm_hopper')[_0x86ce('0x62')](['phone',_0x86ce('0x63'),_0x86ce('0x64'),_0x86ce('0x65'),_0x86ce('0x66'),_0x86ce('0x67'),_0x86ce('0x68')],squel['select']()[_0x86ce('0x69')]('ANY_VALUE(calleridnum)',_0x86ce('0x6a'))['field'](_0x86ce('0x6b'),_0x86ce('0x63'))['field'](_0x86ce('0x6c'),'ContactId')[_0x86ce('0x69')]('ANY_VALUE(ListId)',_0x86ce('0x65'))[_0x86ce('0x69')](_0x86ce('0x6d'),_0x86ce('0x66'))[_0x86ce('0x69')](_0x86ce('0x6b'),_0x86ce('0x67'))['field'](_0x86ce('0x6b'),_0x86ce('0x68'))[_0x86ce('0x6e')](_0x86ce('0x6f'))[_0x86ce('0x3c')]('VoiceQueueId\x20=\x20?',_0xe3a8e0[_0x86ce('0x47')]['id'][_0x86ce('0x70')]())['where']('state\x20=\x20?',_0xe3a8e0[_0x86ce('0x4b')][_0x86ce('0x71')][_0x86ce('0x70')]())[_0x86ce('0x3c')](_0x86ce('0x72'))[_0x86ce('0x3c')](_0x86ce('0x73'),squel['select']()['field'](_0x86ce('0x6a'))[_0x86ce('0x6e')](_0x86ce('0x74'))[_0x86ce('0x3c')](_0x86ce('0x75'),_0xe3a8e0[_0x86ce('0x47')]['id'][_0x86ce('0x70')]()))[_0x86ce('0x3c')](_0x86ce('0x73'),squel[_0x86ce('0x76')]()[_0x86ce('0x69')](_0x86ce('0x77'))['from']('cm_hopper_final')[_0x86ce('0x3c')]('VoiceQueueId\x20=\x20?',_0xe3a8e0[_0x86ce('0x47')]['id']['toString']())[_0x86ce('0x3c')]('state\x20=\x204'))['group'](_0x86ce('0x64')))['toString']();return db[_0x86ce('0x4d')]['query'](_0x28d475);}return[];})[_0x86ce('0x25')](respondWithResult(_0x2346a1,null))[_0x86ce('0x45')](handleError(_0x2346a1,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x5827dd,_0x27938b,_0x506eb5){return db[_0x86ce('0x78')][_0x86ce('0x49')]({'where':{'id':_0x5827dd[_0x86ce('0x47')]['id']}})[_0x86ce('0x25')](handleEntityNotFound(_0x27938b,null))[_0x86ce('0x25')](function(_0x188a1f){var _0x3d38aa;if(_0x188a1f){_0x3d38aa=squel[_0x86ce('0x61')]()[_0x86ce('0x79')](_0x86ce('0x74'))['fromQuery'](['phone',_0x86ce('0x63'),_0x86ce('0x64'),_0x86ce('0x65'),'CampaignId',_0x86ce('0x67'),_0x86ce('0x68')],squel[_0x86ce('0x76')]()[_0x86ce('0x69')]('ANY_VALUE(calleridnum)','phone')[_0x86ce('0x69')](_0x86ce('0x6b'),_0x86ce('0x63'))['field']('ANY_VALUE(ContactId)','ContactId')[_0x86ce('0x69')]('ANY_VALUE(ListId)','ListId')[_0x86ce('0x69')]('ANY_VALUE(CampaignId)',_0x86ce('0x7a'))[_0x86ce('0x69')](_0x86ce('0x6b'),_0x86ce('0x67'))[_0x86ce('0x69')](_0x86ce('0x6b'),'updatedAt')[_0x86ce('0x6e')](_0x86ce('0x6f'))[_0x86ce('0x3c')](_0x86ce('0x7b'),_0x5827dd[_0x86ce('0x47')]['id'][_0x86ce('0x70')]())[_0x86ce('0x3c')](_0x86ce('0x7c'),_0x5827dd[_0x86ce('0x4b')]['state'][_0x86ce('0x70')]())['where']('calleridnum\x20IS\x20NOT\x20NULL')[_0x86ce('0x3c')](_0x86ce('0x73'),squel[_0x86ce('0x76')]()[_0x86ce('0x69')](_0x86ce('0x6a'))[_0x86ce('0x6e')](_0x86ce('0x74'))['where']('CampaignId\x20=\x20?',_0x5827dd[_0x86ce('0x47')]['id']['toString']()))[_0x86ce('0x3c')](_0x86ce('0x73'),squel['select']()['field']('calleridnum')['from']('cm_hopper_final')[_0x86ce('0x3c')](_0x86ce('0x7b'),_0x5827dd[_0x86ce('0x47')]['id'][_0x86ce('0x70')]())[_0x86ce('0x3c')](_0x86ce('0x7d')))['group'](_0x86ce('0x64')))[_0x86ce('0x70')]();return db['sequelize'][_0x86ce('0x33')](_0x3d38aa);}return[];})[_0x86ce('0x25')](respondWithResult(_0x27938b,null))[_0x86ce('0x45')](handleError(_0x27938b,null));};exports[_0x86ce('0x7e')]=function(_0x2014a3,_0x3cfcd1,_0x85bcb7){return db[_0x86ce('0x7f')][_0x86ce('0x80')]({'where':{'VoiceQueueId':_0x2014a3[_0x86ce('0x4b')][_0x86ce('0x66')],'CampaignId':_0x2014a3[_0x86ce('0x4b')]['CampaignId'],'ContactId':_0x2014a3[_0x86ce('0x4b')][_0x86ce('0x64')]}})[_0x86ce('0x25')](handleEntityNotFound(_0x3cfcd1,null))['then'](function(_0x2da07a){if(_0x2da07a){return _0x2da07a;}return null;})[_0x86ce('0x25')](respondWithResult(_0x3cfcd1,null))['catch'](handleError(_0x3cfcd1,null));}; \ No newline at end of file +var _0x2346=['json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','fieldName','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','CmHopperFinal','findAll','rows','catch','show','rawAttributes','include','options','find','describe','body','uniqueid','params','countContactsQueueCampaignHopperFinal','sequelize','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','COUNT','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','countContactsIvrCampaignHopperFinal','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','abandonedContacts','answeringMachine','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ListId','VoiceQueueId','createdAt','updatedAt','select','field','ANY_VALUE(calleridnum)','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','NOW()','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','calleridnum\x20NOT\x20IN\x20(?)','from','calleridnum','cm_hopper_final','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','CampaignId','ContactId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','checkContactHopper','CmHopper','findOne','eml-format','rimraf','zip-dir','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','desk.js','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../mysqldb','sendStatus','end','status'];(function(_0x56baae,_0x35fcd9){var _0x794bd4=function(_0x4af543){while(--_0x4af543){_0x56baae['push'](_0x56baae['shift']());}};_0x794bd4(++_0x35fcd9);}(_0x2346,0x16b));var _0x6234=function(_0x2a9153,_0x44fd73){_0x2a9153=_0x2a9153-0x0;var _0x2f6615=_0x2346[_0x2a9153];return _0x2f6615;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6234('0x0'));var rimraf=require(_0x6234('0x1'));var zipdir=require(_0x6234('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6234('0x3'));var BPromise=require(_0x6234('0x4'));var Mustache=require(_0x6234('0x5'));var util=require('util');var path=require('path');var sox=require(_0x6234('0x6'));var csv=require(_0x6234('0x7'));var ejs=require(_0x6234('0x8'));var fs=require('fs');var _=require(_0x6234('0x9'));var squel=require(_0x6234('0xa'));var crypto=require(_0x6234('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x6234('0xc'));var toCsv=require(_0x6234('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6234('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x6234('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6234('0xf'))('api');var utils=require(_0x6234('0x10'));var config=require('../../config/environment');var db=require(_0x6234('0x11'))['db'];function respondWithStatusCode(_0x130917,_0x4b5d64){_0x4b5d64=_0x4b5d64||0xcc;return function(_0x1a5f19){if(_0x1a5f19){return _0x130917[_0x6234('0x12')](_0x4b5d64);}return _0x130917['status'](_0x4b5d64)[_0x6234('0x13')]();};}function respondWithResult(_0x2c8ea6,_0xe4db13){_0xe4db13=_0xe4db13||0xc8;return function(_0x1ea05e){if(_0x1ea05e){return _0x2c8ea6[_0x6234('0x14')](_0xe4db13)[_0x6234('0x15')](_0x1ea05e);}};}function respondWithFilteredResult(_0x59d3c0,_0x18b227){return function(_0x4ac9db){if(_0x4ac9db){var _0x5a22c1=_0x4ac9db[_0x6234('0x16')],_0x14de8c=_0x18b227[_0x6234('0x17')],_0x138e9b=_0x18b227[_0x6234('0x17')]+_0x18b227[_0x6234('0x18')],_0x42a1cc;if(_0x138e9b>=_0x5a22c1){_0x138e9b=_0x5a22c1;_0x42a1cc=0xc8;}else{_0x42a1cc=0xce;}_0x59d3c0[_0x6234('0x14')](_0x42a1cc);return _0x59d3c0[_0x6234('0x19')](_0x6234('0x1a'),_0x14de8c+'-'+_0x138e9b+'/'+_0x5a22c1)[_0x6234('0x15')](_0x4ac9db);}return null;};}function patchUpdates(_0x3357fc){return function(_0x2beb5d){try{jsonpatch[_0x6234('0x1b')](_0x2beb5d,_0x3357fc,!![]);}catch(_0x15ddc4){return BPromise[_0x6234('0x1c')](_0x15ddc4);}return _0x2beb5d[_0x6234('0x1d')]();};}function saveUpdates(_0x4c9457,_0x257a43){return function(_0x15e2a4){if(_0x15e2a4){return _0x15e2a4[_0x6234('0x1e')](_0x4c9457)[_0x6234('0x1f')](function(_0x4e72e9){return _0x4e72e9;});}return null;};}function removeEntity(_0x58a36b,_0x54a045){return function(_0x30ce33){if(_0x30ce33){return _0x30ce33[_0x6234('0x20')]()[_0x6234('0x1f')](function(){_0x58a36b[_0x6234('0x14')](0xcc)[_0x6234('0x13')]();});}};}function handleEntityNotFound(_0x4b0c9b,_0x772336){return function(_0x4d5bb9){if(!_0x4d5bb9){_0x4b0c9b[_0x6234('0x12')](0x194);}return _0x4d5bb9;};}function handleError(_0x40a0af,_0x4948f5){_0x4948f5=_0x4948f5||0x1f4;return function(_0x4f01a2){logger[_0x6234('0x21')](_0x4f01a2[_0x6234('0x22')]);if(_0x4f01a2[_0x6234('0x23')]){delete _0x4f01a2[_0x6234('0x23')];}_0x40a0af[_0x6234('0x14')](_0x4948f5)['send'](_0x4f01a2);};}exports[_0x6234('0x24')]=function(_0x33a1b2,_0x344398){var _0x5c66aa={},_0x44c1c1={},_0x98eeb7={'count':0x0,'rows':[]};var _0x3a262e=_[_0x6234('0x25')](db['CmHopperFinal']['rawAttributes'],function(_0x3edbcd){return{'name':_0x3edbcd[_0x6234('0x26')],'type':_0x3edbcd['type'][_0x6234('0x27')]};});_0x44c1c1['model']=_[_0x6234('0x25')](_0x3a262e,_0x6234('0x23'));_0x44c1c1[_0x6234('0x28')]=_[_0x6234('0x29')](_0x33a1b2['query']);_0x44c1c1[_0x6234('0x2a')]=_['intersection'](_0x44c1c1[_0x6234('0x2b')],_0x44c1c1[_0x6234('0x28')]);_0x5c66aa[_0x6234('0x2c')]=_[_0x6234('0x2d')](_0x44c1c1['model'],qs[_0x6234('0x2e')](_0x33a1b2['query'][_0x6234('0x2e')]));_0x5c66aa['attributes']=_0x5c66aa[_0x6234('0x2c')][_0x6234('0x2f')]?_0x5c66aa[_0x6234('0x2c')]:_0x44c1c1[_0x6234('0x2b')];if(!_0x33a1b2['query'][_0x6234('0x30')](_0x6234('0x31'))){_0x5c66aa['limit']=qs[_0x6234('0x18')](_0x33a1b2[_0x6234('0x28')][_0x6234('0x18')]);_0x5c66aa[_0x6234('0x17')]=qs[_0x6234('0x17')](_0x33a1b2[_0x6234('0x28')][_0x6234('0x17')]);}_0x5c66aa[_0x6234('0x32')]=qs[_0x6234('0x33')](_0x33a1b2['query'][_0x6234('0x33')]);_0x5c66aa[_0x6234('0x34')]=qs[_0x6234('0x2a')](_[_0x6234('0x35')](_0x33a1b2[_0x6234('0x28')],_0x44c1c1['filters']));if(_0x33a1b2[_0x6234('0x28')][_0x6234('0x36')]){_0x5c66aa[_0x6234('0x34')]=_[_0x6234('0x37')](_0x5c66aa[_0x6234('0x34')],{'$or':_[_0x6234('0x25')](_0x3a262e,function(_0xf48937){if(_0xf48937['type']!=='VIRTUAL'){var _0x44e88a={};_0x44e88a[_0xf48937[_0x6234('0x23')]]={'$like':'%'+_0x33a1b2['query'][_0x6234('0x36')]+'%'};return _0x44e88a;}})});}_0x5c66aa=_[_0x6234('0x37')]({},_0x5c66aa,_0x33a1b2['options']);var _0x136cc6={'where':_0x5c66aa['where']};return db['CmHopperFinal'][_0x6234('0x16')](_0x136cc6)[_0x6234('0x1f')](function(_0x2d3993){_0x98eeb7[_0x6234('0x16')]=_0x2d3993;if(_0x33a1b2[_0x6234('0x28')][_0x6234('0x38')]){_0x5c66aa['include']=[{'all':!![]}];}return db[_0x6234('0x39')][_0x6234('0x3a')](_0x5c66aa);})[_0x6234('0x1f')](function(_0x4fd6f9){_0x98eeb7[_0x6234('0x3b')]=_0x4fd6f9;return _0x98eeb7;})[_0x6234('0x1f')](respondWithFilteredResult(_0x344398,_0x5c66aa))[_0x6234('0x3c')](handleError(_0x344398,null));};exports[_0x6234('0x3d')]=function(_0x971f01,_0x1461f3){var _0x14e689={'raw':!![],'where':{'id':_0x971f01['params']['id']}},_0xc89bd3={};_0xc89bd3[_0x6234('0x2b')]=_[_0x6234('0x29')](db[_0x6234('0x39')][_0x6234('0x3e')]);_0xc89bd3[_0x6234('0x28')]=_[_0x6234('0x29')](_0x971f01[_0x6234('0x28')]);_0xc89bd3[_0x6234('0x2a')]=_[_0x6234('0x2d')](_0xc89bd3[_0x6234('0x2b')],_0xc89bd3[_0x6234('0x28')]);_0x14e689[_0x6234('0x2c')]=_[_0x6234('0x2d')](_0xc89bd3[_0x6234('0x2b')],qs[_0x6234('0x2e')](_0x971f01[_0x6234('0x28')]['fields']));_0x14e689[_0x6234('0x2c')]=_0x14e689[_0x6234('0x2c')][_0x6234('0x2f')]?_0x14e689[_0x6234('0x2c')]:_0xc89bd3[_0x6234('0x2b')];if(_0x971f01['query']['includeAll']){_0x14e689[_0x6234('0x3f')]=[{'all':!![]}];}_0x14e689=_[_0x6234('0x37')]({},_0x14e689,_0x971f01[_0x6234('0x40')]);return db['CmHopperFinal'][_0x6234('0x41')](_0x14e689)[_0x6234('0x1f')](handleEntityNotFound(_0x1461f3,null))[_0x6234('0x1f')](respondWithResult(_0x1461f3,null))[_0x6234('0x3c')](handleError(_0x1461f3,null));};exports[_0x6234('0x42')]=function(_0xa83cb6,_0x7fec1d){return db[_0x6234('0x39')][_0x6234('0x42')]()['then'](respondWithResult(_0x7fec1d,null))[_0x6234('0x3c')](handleError(_0x7fec1d,null));};exports['update']=function(_0x20af09,_0x39dd41){if(_0x20af09[_0x6234('0x43')][_0x6234('0x44')]){delete _0x20af09['body']['uniqueid'];}return db['CmHopperFinal']['find']({'where':{'uniqueid':_0x20af09[_0x6234('0x45')]['id']}})[_0x6234('0x1f')](handleEntityNotFound(_0x39dd41,null))[_0x6234('0x1f')](saveUpdates(_0x20af09[_0x6234('0x43')],null))['then'](respondWithResult(_0x39dd41,null))['catch'](handleError(_0x39dd41,null));};exports[_0x6234('0x46')]=function(_0x394ccd,_0x1db456,_0x2dcee4){return db[_0x6234('0x39')]['findAll']({'raw':![],'where':{'VoiceQueueId':_0x394ccd['params']['id']},'attributes':[[db['sequelize']['fn']('COUNT',db[_0x6234('0x47')]['fn']('IF',db[_0x6234('0x47')][_0x6234('0x48')](_0x6234('0x49')))),_0x6234('0x4a')],[db['sequelize']['fn'](_0x6234('0x4b'),db['sequelize']['fn']('IF',db[_0x6234('0x47')][_0x6234('0x48')]('`state`\x20=\x203,\x201,\x20null'))),'noAnswerContacts'],[db[_0x6234('0x47')]['fn'](_0x6234('0x4b'),db[_0x6234('0x47')]['fn']('IF',db[_0x6234('0x47')][_0x6234('0x48')]('`state`\x20=\x205,\x201,\x20null'))),'busyContacts'],[db['sequelize']['fn'](_0x6234('0x4b'),db[_0x6234('0x47')]['fn']('IF',db[_0x6234('0x47')]['literal']('`state`\x20=\x208,\x201,\x20null'))),_0x6234('0x4c')],[db[_0x6234('0x47')]['fn']('COUNT',db[_0x6234('0x47')]['fn']('IF',db[_0x6234('0x47')][_0x6234('0x48')](_0x6234('0x4d')))),'dropContacts'],[db['sequelize']['fn'](_0x6234('0x4b'),db['sequelize']['fn']('IF',db[_0x6234('0x47')]['literal'](_0x6234('0x4e')))),'abandonedContacts'],[db[_0x6234('0x47')]['fn'](_0x6234('0x4b'),db[_0x6234('0x47')]['fn']('IF',db[_0x6234('0x47')][_0x6234('0x48')](_0x6234('0x4f')))),_0x6234('0x50')],[db['sequelize']['fn'](_0x6234('0x4b'),db['sequelize']['fn']('IF',db['sequelize'][_0x6234('0x48')](_0x6234('0x51')))),'answeringMachine']]})[_0x6234('0x1f')](handleEntityNotFound(_0x1db456,null))['then'](respondWithResult(_0x1db456,null))[_0x6234('0x3c')](handleError(_0x1db456,null));};exports[_0x6234('0x52')]=function(_0x58f96e,_0x24b2ab,_0x38126){return db[_0x6234('0x39')]['findAll']({'raw':![],'where':{'CampaignId':_0x58f96e[_0x6234('0x45')]['id']},'attributes':[[db['sequelize']['fn'](_0x6234('0x4b'),db[_0x6234('0x47')]['fn']('IF',db[_0x6234('0x47')]['literal']('`state`\x20=\x200,\x201,\x20null'))),'noSuchContacts'],[db[_0x6234('0x47')]['fn'](_0x6234('0x4b'),db[_0x6234('0x47')]['fn']('IF',db['sequelize'][_0x6234('0x48')](_0x6234('0x53')))),_0x6234('0x54')],[db[_0x6234('0x47')]['fn']('COUNT',db[_0x6234('0x47')]['fn']('IF',db['sequelize'][_0x6234('0x48')](_0x6234('0x55')))),_0x6234('0x56')],[db[_0x6234('0x47')]['fn']('COUNT',db[_0x6234('0x47')]['fn']('IF',db['sequelize'][_0x6234('0x48')]('`state`\x20=\x208,\x201,\x20null'))),'congestionContacts'],[db['sequelize']['fn'](_0x6234('0x4b'),db[_0x6234('0x47')]['fn']('IF',db[_0x6234('0x47')][_0x6234('0x48')](_0x6234('0x4d')))),'dropContacts'],[db[_0x6234('0x47')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x6234('0x47')][_0x6234('0x48')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x6234('0x57')],[db['sequelize']['fn'](_0x6234('0x4b'),db[_0x6234('0x47')]['fn']('IF',db[_0x6234('0x47')][_0x6234('0x48')](_0x6234('0x4f')))),'reCallContacts'],[db[_0x6234('0x47')]['fn'](_0x6234('0x4b'),db[_0x6234('0x47')]['fn']('IF',db[_0x6234('0x47')]['literal'](_0x6234('0x51')))),_0x6234('0x58')]]})[_0x6234('0x1f')](handleEntityNotFound(_0x24b2ab,null))[_0x6234('0x1f')](respondWithResult(_0x24b2ab,null))[_0x6234('0x3c')](handleError(_0x24b2ab,null));};exports[_0x6234('0x59')]=function(_0x1b304d,_0xc18554,_0x3fca3e){return db[_0x6234('0x5a')][_0x6234('0x41')]({'where':{'id':_0x1b304d[_0x6234('0x45')]['id']}})[_0x6234('0x1f')](handleEntityNotFound(_0xc18554,null))['then'](function(_0x27651e){var _0x4133f6;if(_0x27651e){_0x4133f6=squel[_0x6234('0x5b')]()[_0x6234('0x5c')](_0x6234('0x5d'))[_0x6234('0x5e')]([_0x6234('0x5f'),_0x6234('0x60'),'ContactId',_0x6234('0x61'),_0x6234('0x62'),_0x6234('0x63'),_0x6234('0x64')],squel[_0x6234('0x65')]()[_0x6234('0x66')](_0x6234('0x67'),'phone')[_0x6234('0x66')]('NOW()',_0x6234('0x60'))[_0x6234('0x66')](_0x6234('0x68'),'ContactId')[_0x6234('0x66')](_0x6234('0x69'),_0x6234('0x61'))[_0x6234('0x66')](_0x6234('0x6a'),'VoiceQueueId')[_0x6234('0x66')](_0x6234('0x6b'),_0x6234('0x63'))[_0x6234('0x66')](_0x6234('0x6b'),_0x6234('0x64'))['from']('cm_hopper_final')[_0x6234('0x34')](_0x6234('0x6c'),_0x1b304d[_0x6234('0x45')]['id'][_0x6234('0x6d')]())[_0x6234('0x34')](_0x6234('0x6e'),_0x1b304d['body']['state'][_0x6234('0x6d')]())[_0x6234('0x34')]('calleridnum\x20IS\x20NOT\x20NULL')[_0x6234('0x34')](_0x6234('0x6f'),squel[_0x6234('0x65')]()[_0x6234('0x66')](_0x6234('0x5f'))[_0x6234('0x70')]('cm_hopper')['where']('VoiceQueueId\x20=\x20?',_0x1b304d['params']['id'][_0x6234('0x6d')]()))[_0x6234('0x34')](_0x6234('0x6f'),squel[_0x6234('0x65')]()[_0x6234('0x66')](_0x6234('0x71'))[_0x6234('0x70')](_0x6234('0x72'))[_0x6234('0x34')]('VoiceQueueId\x20=\x20?',_0x1b304d[_0x6234('0x45')]['id']['toString']())[_0x6234('0x34')](_0x6234('0x73')))[_0x6234('0x74')]('ContactId'))[_0x6234('0x6d')]();return db[_0x6234('0x47')][_0x6234('0x28')](_0x4133f6);}return[];})['then'](respondWithResult(_0xc18554,null))[_0x6234('0x3c')](handleError(_0xc18554,null));};exports[_0x6234('0x75')]=function(_0x523732,_0x1a32b2,_0x1b839f){return db[_0x6234('0x76')][_0x6234('0x41')]({'where':{'id':_0x523732['params']['id']}})[_0x6234('0x1f')](handleEntityNotFound(_0x1a32b2,null))[_0x6234('0x1f')](function(_0x2351c9){var _0x1b74c7;if(_0x2351c9){_0x1b74c7=squel['insert']()[_0x6234('0x5c')](_0x6234('0x5d'))[_0x6234('0x5e')](['phone','scheduledAt','ContactId',_0x6234('0x61'),_0x6234('0x77'),_0x6234('0x63'),'updatedAt'],squel['select']()['field']('ANY_VALUE(calleridnum)',_0x6234('0x5f'))[_0x6234('0x66')](_0x6234('0x6b'),'scheduledAt')['field'](_0x6234('0x68'),_0x6234('0x78'))[_0x6234('0x66')](_0x6234('0x69'),'ListId')[_0x6234('0x66')](_0x6234('0x79'),_0x6234('0x77'))[_0x6234('0x66')](_0x6234('0x6b'),_0x6234('0x63'))[_0x6234('0x66')]('NOW()','updatedAt')['from'](_0x6234('0x72'))[_0x6234('0x34')](_0x6234('0x7a'),_0x523732['params']['id'][_0x6234('0x6d')]())[_0x6234('0x34')](_0x6234('0x6e'),_0x523732[_0x6234('0x43')][_0x6234('0x7b')]['toString']())['where'](_0x6234('0x7c'))['where'](_0x6234('0x6f'),squel[_0x6234('0x65')]()['field'](_0x6234('0x5f'))[_0x6234('0x70')](_0x6234('0x5d'))[_0x6234('0x34')]('CampaignId\x20=\x20?',_0x523732[_0x6234('0x45')]['id'][_0x6234('0x6d')]()))[_0x6234('0x34')](_0x6234('0x6f'),squel[_0x6234('0x65')]()[_0x6234('0x66')]('calleridnum')['from'](_0x6234('0x72'))[_0x6234('0x34')](_0x6234('0x7a'),_0x523732['params']['id']['toString']())['where']('state\x20=\x204'))[_0x6234('0x74')](_0x6234('0x78')))[_0x6234('0x6d')]();return db[_0x6234('0x47')][_0x6234('0x28')](_0x1b74c7);}return[];})[_0x6234('0x1f')](respondWithResult(_0x1a32b2,null))['catch'](handleError(_0x1a32b2,null));};exports[_0x6234('0x7d')]=function(_0x595b33,_0x11b05f,_0x9ee28a){return db[_0x6234('0x7e')][_0x6234('0x7f')]({'where':{'VoiceQueueId':_0x595b33[_0x6234('0x43')]['VoiceQueueId'],'CampaignId':_0x595b33[_0x6234('0x43')][_0x6234('0x77')],'ContactId':_0x595b33['body']['ContactId']}})[_0x6234('0x1f')](handleEntityNotFound(_0x11b05f,null))[_0x6234('0x1f')](function(_0x163d1e){if(_0x163d1e){return _0x163d1e;}return null;})[_0x6234('0x1f')](respondWithResult(_0x11b05f,null))[_0x6234('0x3c')](handleError(_0x11b05f,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index dade631..48aa53d 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 _0xa8dc=['exports','define','CmHopperFinal','calleridnum','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperFinal.attributes'];(function(_0x6b2c5c,_0x3f6949){var _0x18e3ce=function(_0x1a143f){while(--_0x1a143f){_0x6b2c5c['push'](_0x6b2c5c['shift']());}};_0x18e3ce(++_0x3f6949);}(_0xa8dc,0x6c));var _0xca8d=function(_0x2df62f,_0x108081){_0x2df62f=_0x2df62f-0x0;var _0x36c339=_0xa8dc[_0x2df62f];return _0x36c339;};'use strict';var _=require(_0xca8d('0x0'));var util=require(_0xca8d('0x1'));var logger=require(_0xca8d('0x2'))('api');var moment=require('moment');var BPromise=require(_0xca8d('0x3'));var rp=require(_0xca8d('0x4'));var fs=require('fs');var path=require(_0xca8d('0x5'));var rimraf=require(_0xca8d('0x6'));var config=require(_0xca8d('0x7'));var attributes=require(_0xca8d('0x8'));module[_0xca8d('0x9')]=function(_0x5655ea,_0x1169b8){return _0x5655ea[_0xca8d('0xa')](_0xca8d('0xb'),attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':_0xca8d('0xc'),'fields':[_0xca8d('0xc')]},{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x2f7a=['./cmHopperFinal.attributes','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x874cf1,_0x2a4954){var _0x233579=function(_0xa6e939){while(--_0xa6e939){_0x874cf1['push'](_0x874cf1['shift']());}};_0x233579(++_0x2a4954);}(_0x2f7a,0x18c));var _0xa2f7=function(_0x510f22,_0x2b60d3){_0x510f22=_0x510f22-0x0;var _0x24ab18=_0x2f7a[_0x510f22];return _0x24ab18;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa2f7('0x0'))('api');var moment=require(_0xa2f7('0x1'));var BPromise=require(_0xa2f7('0x2'));var rp=require(_0xa2f7('0x3'));var fs=require('fs');var path=require(_0xa2f7('0x4'));var rimraf=require(_0xa2f7('0x5'));var config=require(_0xa2f7('0x6'));var attributes=require(_0xa2f7('0x7'));module['exports']=function(_0x49b5a3,_0x2e68c1){return _0x49b5a3[_0xa2f7('0x8')](_0xa2f7('0x9'),attributes,{'tableName':_0xa2f7('0xa'),'paranoid':![],'indexes':[{'name':'calleridnum','fields':[_0xa2f7('0xb')]},{'name':_0xa2f7('0xc'),'fields':[_0xa2f7('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 3e58dad..de3cba3 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 _0xc574=['CreateCmHopperFinal','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','CmHopperFinal,\x20%s,\x20%s','request\x20sent','debug','CmHopperFinal,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','CmHopperFinal','create','body','options'];(function(_0x6b62a1,_0x1d79cd){var _0x39156e=function(_0x7c6012){while(--_0x7c6012){_0x6b62a1['push'](_0x6b62a1['shift']());}};_0x39156e(++_0x1d79cd);}(_0xc574,0x107));var _0x4c57=function(_0x519d42,_0x4e97c1){_0x519d42=_0x519d42-0x0;var _0x3ac7f4=_0xc574[_0x519d42];return _0x3ac7f4;};'use strict';var _=require(_0x4c57('0x0'));var util=require(_0x4c57('0x1'));var moment=require(_0x4c57('0x2'));var BPromise=require('bluebird');var rs=require(_0x4c57('0x3'));var fs=require('fs');var Redis=require(_0x4c57('0x4'));var db=require(_0x4c57('0x5'))['db'];var utils=require(_0x4c57('0x6'));var logger=require(_0x4c57('0x7'))('rpc');var config=require(_0x4c57('0x8'));var jayson=require(_0x4c57('0x9'));var client=jayson[_0x4c57('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x395da1,_0xed2423,_0x3f227c){return new BPromise(function(_0x17aaa5,_0x2f7668){return client[_0x4c57('0xb')](_0x395da1,_0x3f227c)[_0x4c57('0xc')](function(_0x114a76){logger['info'](_0x4c57('0xd'),_0xed2423,_0x4c57('0xe'));logger[_0x4c57('0xf')](_0x4c57('0x10'),_0xed2423,_0x4c57('0xe'),JSON['stringify'](_0x114a76));if(_0x114a76[_0x4c57('0x11')]){if(_0x114a76[_0x4c57('0x11')][_0x4c57('0x12')]===0x1f4){logger[_0x4c57('0x11')](_0x4c57('0xd'),_0xed2423,_0x114a76[_0x4c57('0x11')][_0x4c57('0x13')]);return _0x2f7668(_0x114a76['error']['message']);}logger['error']('CmHopperFinal,\x20%s,\x20%s',_0xed2423,_0x114a76[_0x4c57('0x11')][_0x4c57('0x13')]);return _0x17aaa5(_0x114a76[_0x4c57('0x11')][_0x4c57('0x13')]);}else{logger[_0x4c57('0x14')](_0x4c57('0xd'),_0xed2423,_0x4c57('0xe'));_0x17aaa5(_0x114a76[_0x4c57('0x15')][_0x4c57('0x13')]);}})[_0x4c57('0x16')](function(_0xe0449a){logger[_0x4c57('0x11')](_0x4c57('0xd'),_0xed2423,_0xe0449a);_0x2f7668(_0xe0449a);});});}exports['CreateCmHopperFinal']=function(_0x19133a){var _0xbfda1a=this;return new Promise(function(_0xa3a9a,_0x5bc65a){return db[_0x4c57('0x17')][_0x4c57('0x18')](_0x19133a[_0x4c57('0x19')],{'raw':_0x19133a[_0x4c57('0x1a')]?_0x19133a[_0x4c57('0x1a')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x44eb8a){logger[_0x4c57('0x14')](_0x4c57('0x1b'),_0x19133a);logger['debug'](_0x4c57('0x1b'),_0x19133a,JSON[_0x4c57('0x1c')](_0x44eb8a));_0xa3a9a(_0x44eb8a);})[_0x4c57('0x16')](function(_0x3e5647){logger[_0x4c57('0x11')]('CreateCmHopperFinal',_0x3e5647[_0x4c57('0x13')],_0x19133a);_0x5bc65a(_0xbfda1a[_0x4c57('0x11')](0x1f4,_0x3e5647[_0x4c57('0x13')]));});});}; \ No newline at end of file +var _0xbdba=['../../config/environment','jayson/promise','client','request','info','request\x20sent','debug','error','code','CmHopperFinal,\x20%s,\x20%s','message','catch','CmHopperFinal','create','body','options','raw','then','CreateCmHopperFinal','stringify','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x1f530d,_0x18a19e){var _0x22103f=function(_0x2664c5){while(--_0x2664c5){_0x1f530d['push'](_0x1f530d['shift']());}};_0x22103f(++_0x18a19e);}(_0xbdba,0x107));var _0xabdb=function(_0xe51596,_0x314d5b){_0xe51596=_0xe51596-0x0;var _0x22c705=_0xbdba[_0xe51596];return _0x22c705;};'use strict';var _=require(_0xabdb('0x0'));var util=require('util');var moment=require(_0xabdb('0x1'));var BPromise=require(_0xabdb('0x2'));var rs=require(_0xabdb('0x3'));var fs=require('fs');var Redis=require(_0xabdb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xabdb('0x5'));var logger=require(_0xabdb('0x6'))('rpc');var config=require(_0xabdb('0x7'));var jayson=require(_0xabdb('0x8'));var client=jayson[_0xabdb('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x21b86c,_0x373e4e,_0xe90fff){return new BPromise(function(_0x586a93,_0x2f0ee1){return client[_0xabdb('0xa')](_0x21b86c,_0xe90fff)['then'](function(_0x5b2d56){logger[_0xabdb('0xb')]('CmHopperFinal,\x20%s,\x20%s',_0x373e4e,_0xabdb('0xc'));logger[_0xabdb('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x373e4e,'request\x20sent',JSON['stringify'](_0x5b2d56));if(_0x5b2d56[_0xabdb('0xe')]){if(_0x5b2d56[_0xabdb('0xe')][_0xabdb('0xf')]===0x1f4){logger[_0xabdb('0xe')](_0xabdb('0x10'),_0x373e4e,_0x5b2d56['error'][_0xabdb('0x11')]);return _0x2f0ee1(_0x5b2d56[_0xabdb('0xe')][_0xabdb('0x11')]);}logger[_0xabdb('0xe')]('CmHopperFinal,\x20%s,\x20%s',_0x373e4e,_0x5b2d56[_0xabdb('0xe')]['message']);return _0x586a93(_0x5b2d56[_0xabdb('0xe')]['message']);}else{logger[_0xabdb('0xb')](_0xabdb('0x10'),_0x373e4e,_0xabdb('0xc'));_0x586a93(_0x5b2d56['result']['message']);}})[_0xabdb('0x12')](function(_0x3614e9){logger[_0xabdb('0xe')](_0xabdb('0x10'),_0x373e4e,_0x3614e9);_0x2f0ee1(_0x3614e9);});});}exports['CreateCmHopperFinal']=function(_0x55e8bd){var _0x5968e0=this;return new Promise(function(_0x5e9d0e,_0x16125e){return db[_0xabdb('0x13')][_0xabdb('0x14')](_0x55e8bd[_0xabdb('0x15')],{'raw':_0x55e8bd[_0xabdb('0x16')]?_0x55e8bd['options'][_0xabdb('0x17')]===undefined?!![]:![]:!![]})[_0xabdb('0x18')](function(_0x147d7b){logger[_0xabdb('0xb')](_0xabdb('0x19'),_0x55e8bd);logger['debug'](_0xabdb('0x19'),_0x55e8bd,JSON[_0xabdb('0x1a')](_0x147d7b));_0x5e9d0e(_0x147d7b);})[_0xabdb('0x12')](function(_0x415b12){logger['error']('CreateCmHopperFinal',_0x415b12['message'],_0x55e8bd);_0x16125e(_0x5968e0[_0xabdb('0xe')](0x1f4,_0x415b12[_0xabdb('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index 6ee6812..6c9f8f9 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 _0x78c1=['/campaign/countAttributes/:id','post','/voice/queue/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','index','/describe','describe','/:id','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal'];(function(_0x252243,_0x4f05e1){var _0x5ae013=function(_0x40b226){while(--_0x40b226){_0x252243['push'](_0x252243['shift']());}};_0x5ae013(++_0x4f05e1);}(_0x78c1,0x140));var _0x178c=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x78c1[_0x3e5086];return _0xfeb102;};'use strict';var multer=require(_0x178c('0x0'));var util=require(_0x178c('0x1'));var path=require(_0x178c('0x2'));var timeout=require(_0x178c('0x3'));var express=require(_0x178c('0x4'));var router=express[_0x178c('0x5')]();var auth=require(_0x178c('0x6'));var interaction=require(_0x178c('0x7'));var config=require(_0x178c('0x8'));var controller=require(_0x178c('0x9'));router[_0x178c('0xa')]('/',auth[_0x178c('0xb')](),controller[_0x178c('0xc')]);router[_0x178c('0xa')](_0x178c('0xd'),auth[_0x178c('0xb')](),controller[_0x178c('0xe')]);router[_0x178c('0xa')](_0x178c('0xf'),auth[_0x178c('0xb')](),controller['show']);router[_0x178c('0xa')](_0x178c('0x10'),auth[_0x178c('0xb')](),controller[_0x178c('0x11')]);router[_0x178c('0xa')](_0x178c('0x12'),auth[_0x178c('0xb')](),controller['countContactsIvrCampaignHopperFinal']);router[_0x178c('0x13')](_0x178c('0x14'),auth[_0x178c('0xb')](),controller['moveContactsQueueCampaignHopperFinal']);router[_0x178c('0x13')]('/voice/campaign/moveContacts/:id',auth[_0x178c('0xb')](),controller[_0x178c('0x15')]);router['post'](_0x178c('0x16'),auth[_0x178c('0xb')](),controller[_0x178c('0x17')]);router[_0x178c('0x18')](_0x178c('0xf'),auth[_0x178c('0xb')](),controller['update']);module[_0x178c('0x19')]=router; \ No newline at end of file +var _0xc8dc=['/:id','show','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','put','update','exports','multer','util','express','../../components/auth/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x139b11,_0x166092){var _0x345ce4=function(_0x52a808){while(--_0x52a808){_0x139b11['push'](_0x139b11['shift']());}};_0x345ce4(++_0x166092);}(_0xc8dc,0x96));var _0xcc8d=function(_0x1123bb,_0x54472a){_0x1123bb=_0x1123bb-0x0;var _0xdeb602=_0xc8dc[_0x1123bb];return _0xdeb602;};'use strict';var multer=require(_0xcc8d('0x0'));var util=require(_0xcc8d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xcc8d('0x2'));var router=express['Router']();var auth=require(_0xcc8d('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xcc8d('0x4'));var controller=require(_0xcc8d('0x5'));router[_0xcc8d('0x6')]('/',auth[_0xcc8d('0x7')](),controller[_0xcc8d('0x8')]);router[_0xcc8d('0x6')](_0xcc8d('0x9'),auth[_0xcc8d('0x7')](),controller[_0xcc8d('0xa')]);router['get'](_0xcc8d('0xb'),auth[_0xcc8d('0x7')](),controller[_0xcc8d('0xc')]);router[_0xcc8d('0x6')]('/voice/queue/countAttributes/:id',auth[_0xcc8d('0x7')](),controller[_0xcc8d('0xd')]);router[_0xcc8d('0x6')](_0xcc8d('0xe'),auth[_0xcc8d('0x7')](),controller[_0xcc8d('0xf')]);router['post']('/voice/queue/moveContacts/:id',auth[_0xcc8d('0x7')](),controller['moveContactsQueueCampaignHopperFinal']);router[_0xcc8d('0x10')](_0xcc8d('0x11'),auth[_0xcc8d('0x7')](),controller[_0xcc8d('0x12')]);router['post'](_0xcc8d('0x13'),auth[_0xcc8d('0x7')](),controller['checkContactHopper']);router[_0xcc8d('0x14')](_0xcc8d('0xb'),auth['isAuthenticated'](),controller[_0xcc8d('0x15')]);module[_0xcc8d('0x16')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 159f6ae..21320d5 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 _0xe7fd=['exports','INTEGER','STRING','DATE','BOOLEAN','sequelize'];(function(_0x382056,_0x21ee62){var _0x515a06=function(_0x4a6fd7){while(--_0x4a6fd7){_0x382056['push'](_0x382056['shift']());}};_0x515a06(++_0x21ee62);}(_0xe7fd,0xdd));var _0xde7f=function(_0x46667b,_0x350031){_0x46667b=_0x46667b-0x0;var _0x331eee=_0xe7fd[_0x46667b];return _0x331eee;};'use strict';var Sequelize=require(_0xde7f('0x0'));module[_0xde7f('0x1')]={'state':{'type':Sequelize[_0xde7f('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xde7f('0x3')]},'scheduledat':{'type':Sequelize[_0xde7f('0x4')]},'countbusyretry':{'type':Sequelize[_0xde7f('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xde7f('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xde7f('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xde7f('0x3')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0xde7f('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xde7f('0x4')]},'responsetime':{'type':Sequelize[_0xde7f('0x4')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xde7f('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xde7f('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xde7f('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xde7f('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0xde7f('0x3')]},'campaigntype':{'type':Sequelize[_0xde7f('0x3')]},'membername':{'type':Sequelize[_0xde7f('0x3')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0xde7f('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0xde7f('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xde7f('0x4')]},'recallme':{'type':Sequelize[_0xde7f('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize[_0xde7f('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xde7f('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xde7f('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xde7f('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xde7f('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x2d58=['INTEGER','STRING','DATE','BOOLEAN','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2d58,0xd6));var _0x82d5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2d58[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x82d5('0x0'));module[_0x82d5('0x1')]={'state':{'type':Sequelize[_0x82d5('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x82d5('0x3')]},'scheduledat':{'type':Sequelize[_0x82d5('0x4')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x82d5('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x82d5('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x82d5('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x82d5('0x3')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x82d5('0x3')]},'starttime':{'type':Sequelize[_0x82d5('0x4')]},'responsetime':{'type':Sequelize[_0x82d5('0x4')]},'answertime':{'type':Sequelize[_0x82d5('0x4')]},'droptime':{'type':Sequelize[_0x82d5('0x4')]},'endtime':{'type':Sequelize[_0x82d5('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x82d5('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x82d5('0x3')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x82d5('0x3')]},'membername':{'type':Sequelize[_0x82d5('0x3')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x82d5('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x82d5('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x82d5('0x4')]},'recallme':{'type':Sequelize[_0x82d5('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x82d5('0x4')]},'edited':{'type':Sequelize[_0x82d5('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x82d5('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x82d5('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x82d5('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x82d5('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index b2eec2b..b304cd9 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 _0x56a3=['find','create','describe','catch','body','uniqueid','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','CmHopperHistory','fieldName','key','model','query','keys','filters','intersection','attributes','fields','order','sort','pick','filter','where','merge','type','includeAll','include','findAll','rows','params','rawAttributes','options'];(function(_0x507363,_0x32960e){var _0x25d10d=function(_0x94e31b){while(--_0x94e31b){_0x507363['push'](_0x507363['shift']());}};_0x25d10d(++_0x32960e);}(_0x56a3,0xed));var _0x356a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x56a3[_0x14add3];return _0x4a174f;};'use strict';var pdf=require(_0x356a('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x356a('0x1'));var zipdir=require(_0x356a('0x2'));var jsonpatch=require(_0x356a('0x3'));var rp=require(_0x356a('0x4'));var moment=require('moment');var BPromise=require(_0x356a('0x5'));var Mustache=require(_0x356a('0x6'));var util=require('util');var path=require(_0x356a('0x7'));var sox=require(_0x356a('0x8'));var csv=require(_0x356a('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x356a('0xa'));var squel=require(_0x356a('0xb'));var crypto=require(_0x356a('0xc'));var jsforce=require(_0x356a('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x356a('0x9'));var querystring=require(_0x356a('0xe'));var Papa=require(_0x356a('0xf'));var Redis=require(_0x356a('0x10'));var authService=require(_0x356a('0x11'));var qs=require(_0x356a('0x12'));var as=require(_0x356a('0x13'));var hardwareService=require(_0x356a('0x14'));var logger=require(_0x356a('0x15'))(_0x356a('0x16'));var utils=require(_0x356a('0x17'));var config=require(_0x356a('0x18'));var db=require(_0x356a('0x19'))['db'];function respondWithStatusCode(_0x246f43,_0x223b81){_0x223b81=_0x223b81||0xcc;return function(_0x4320a8){if(_0x4320a8){return _0x246f43[_0x356a('0x1a')](_0x223b81);}return _0x246f43['status'](_0x223b81)[_0x356a('0x1b')]();};}function respondWithResult(_0xb5ecc3,_0x4bcf15){_0x4bcf15=_0x4bcf15||0xc8;return function(_0x7c72fc){if(_0x7c72fc){return _0xb5ecc3[_0x356a('0x1c')](_0x4bcf15)['json'](_0x7c72fc);}};}function respondWithFilteredResult(_0x2505a0,_0xe52a5b){return function(_0x58866a){if(_0x58866a){var _0x5d665c=_0x58866a[_0x356a('0x1d')],_0x22d342=_0xe52a5b['offset'],_0x5e9302=_0xe52a5b[_0x356a('0x1e')]+_0xe52a5b[_0x356a('0x1f')],_0x21d11c;if(_0x5e9302>=_0x5d665c){_0x5e9302=_0x5d665c;_0x21d11c=0xc8;}else{_0x21d11c=0xce;}_0x2505a0[_0x356a('0x1c')](_0x21d11c);return _0x2505a0[_0x356a('0x20')](_0x356a('0x21'),_0x22d342+'-'+_0x5e9302+'/'+_0x5d665c)[_0x356a('0x22')](_0x58866a);}return null;};}function patchUpdates(_0x481dec){return function(_0x4f1e59){try{jsonpatch[_0x356a('0x23')](_0x4f1e59,_0x481dec,!![]);}catch(_0x331431){return BPromise[_0x356a('0x24')](_0x331431);}return _0x4f1e59[_0x356a('0x25')]();};}function saveUpdates(_0x5a717b,_0x4ec618){return function(_0x3d705b){if(_0x3d705b){return _0x3d705b[_0x356a('0x26')](_0x5a717b)[_0x356a('0x27')](function(_0x10ca5a){return _0x10ca5a;});}return null;};}function removeEntity(_0x249e7b,_0x4c256c){return function(_0x5a5a60){if(_0x5a5a60){return _0x5a5a60[_0x356a('0x28')]()[_0x356a('0x27')](function(){_0x249e7b[_0x356a('0x1c')](0xcc)[_0x356a('0x1b')]();});}};}function handleEntityNotFound(_0xa9b968,_0x3ed742){return function(_0x3b59d6){if(!_0x3b59d6){_0xa9b968['sendStatus'](0x194);}return _0x3b59d6;};}function handleError(_0x4e8f85,_0x5647ef){_0x5647ef=_0x5647ef||0x1f4;return function(_0x550502){logger[_0x356a('0x29')](_0x550502[_0x356a('0x2a')]);if(_0x550502[_0x356a('0x2b')]){delete _0x550502[_0x356a('0x2b')];}_0x4e8f85[_0x356a('0x1c')](_0x5647ef)[_0x356a('0x2c')](_0x550502);};}exports[_0x356a('0x2d')]=function(_0x4263ab,_0x4f074c){var _0x12e97a={},_0x33a9fc={},_0x145083={'count':0x0,'rows':[]};var _0x52063a=_[_0x356a('0x2e')](db[_0x356a('0x2f')]['rawAttributes'],function(_0x1e7f23){return{'name':_0x1e7f23[_0x356a('0x30')],'type':_0x1e7f23['type'][_0x356a('0x31')]};});_0x33a9fc[_0x356a('0x32')]=_[_0x356a('0x2e')](_0x52063a,'name');_0x33a9fc[_0x356a('0x33')]=_[_0x356a('0x34')](_0x4263ab[_0x356a('0x33')]);_0x33a9fc[_0x356a('0x35')]=_[_0x356a('0x36')](_0x33a9fc['model'],_0x33a9fc[_0x356a('0x33')]);_0x12e97a[_0x356a('0x37')]=_['intersection'](_0x33a9fc[_0x356a('0x32')],qs[_0x356a('0x38')](_0x4263ab[_0x356a('0x33')][_0x356a('0x38')]));_0x12e97a[_0x356a('0x37')]=_0x12e97a[_0x356a('0x37')]['length']?_0x12e97a[_0x356a('0x37')]:_0x33a9fc['model'];if(!_0x4263ab['query']['hasOwnProperty']('nolimit')){_0x12e97a[_0x356a('0x1f')]=qs[_0x356a('0x1f')](_0x4263ab[_0x356a('0x33')]['limit']);_0x12e97a[_0x356a('0x1e')]=qs['offset'](_0x4263ab['query'][_0x356a('0x1e')]);}_0x12e97a[_0x356a('0x39')]=qs[_0x356a('0x3a')](_0x4263ab['query'][_0x356a('0x3a')]);_0x12e97a['where']=qs['filters'](_[_0x356a('0x3b')](_0x4263ab[_0x356a('0x33')],_0x33a9fc[_0x356a('0x35')]));if(_0x4263ab[_0x356a('0x33')][_0x356a('0x3c')]){_0x12e97a[_0x356a('0x3d')]=_[_0x356a('0x3e')](_0x12e97a[_0x356a('0x3d')],{'$or':_[_0x356a('0x2e')](_0x52063a,function(_0x131098){if(_0x131098[_0x356a('0x3f')]!=='VIRTUAL'){var _0x57a004={};_0x57a004[_0x131098[_0x356a('0x2b')]]={'$like':'%'+_0x4263ab[_0x356a('0x33')][_0x356a('0x3c')]+'%'};return _0x57a004;}})});}_0x12e97a=_[_0x356a('0x3e')]({},_0x12e97a,_0x4263ab['options']);var _0x4f0f65={'where':_0x12e97a['where']};return db[_0x356a('0x2f')][_0x356a('0x1d')](_0x4f0f65)[_0x356a('0x27')](function(_0x47de2d){_0x145083[_0x356a('0x1d')]=_0x47de2d;if(_0x4263ab['query'][_0x356a('0x40')]){_0x12e97a[_0x356a('0x41')]=[{'all':!![]}];}return db[_0x356a('0x2f')][_0x356a('0x42')](_0x12e97a);})['then'](function(_0x252c6e){_0x145083[_0x356a('0x43')]=_0x252c6e;return _0x145083;})[_0x356a('0x27')](respondWithFilteredResult(_0x4f074c,_0x12e97a))['catch'](handleError(_0x4f074c,null));};exports['show']=function(_0x1fc45a,_0x507a3d){var _0x591948={'raw':!![],'where':{'id':_0x1fc45a[_0x356a('0x44')]['id']}},_0x27cffc={};_0x27cffc[_0x356a('0x32')]=_[_0x356a('0x34')](db[_0x356a('0x2f')][_0x356a('0x45')]);_0x27cffc[_0x356a('0x33')]=_[_0x356a('0x34')](_0x1fc45a[_0x356a('0x33')]);_0x27cffc[_0x356a('0x35')]=_['intersection'](_0x27cffc[_0x356a('0x32')],_0x27cffc['query']);_0x591948[_0x356a('0x37')]=_[_0x356a('0x36')](_0x27cffc[_0x356a('0x32')],qs[_0x356a('0x38')](_0x1fc45a[_0x356a('0x33')][_0x356a('0x38')]));_0x591948['attributes']=_0x591948[_0x356a('0x37')]['length']?_0x591948[_0x356a('0x37')]:_0x27cffc['model'];if(_0x1fc45a[_0x356a('0x33')][_0x356a('0x40')]){_0x591948['include']=[{'all':!![]}];}_0x591948=_[_0x356a('0x3e')]({},_0x591948,_0x1fc45a[_0x356a('0x46')]);return db[_0x356a('0x2f')][_0x356a('0x47')](_0x591948)[_0x356a('0x27')](handleEntityNotFound(_0x507a3d,null))['then'](respondWithResult(_0x507a3d,null))['catch'](handleError(_0x507a3d,null));};exports[_0x356a('0x48')]=function(_0x44c738,_0x28c695){return db[_0x356a('0x2f')]['create'](_0x44c738['body'],{})[_0x356a('0x27')](respondWithResult(_0x28c695,0xc9))['catch'](handleError(_0x28c695,null));};exports['describe']=function(_0x3a3eef,_0x5537d9){return db['CmHopperHistory'][_0x356a('0x49')]()[_0x356a('0x27')](respondWithResult(_0x5537d9,null))[_0x356a('0x4a')](handleError(_0x5537d9,null));};exports[_0x356a('0x26')]=function(_0x422eac,_0x53b489){if(_0x422eac[_0x356a('0x4b')][_0x356a('0x4c')]){delete _0x422eac[_0x356a('0x4b')]['uniqueid'];}return db[_0x356a('0x2f')][_0x356a('0x47')]({'where':{'uniqueid':_0x422eac[_0x356a('0x44')]['id']}})[_0x356a('0x27')](handleEntityNotFound(_0x53b489,null))[_0x356a('0x27')](saveUpdates(_0x422eac[_0x356a('0x4b')],null))[_0x356a('0x27')](respondWithResult(_0x53b489,null))['catch'](handleError(_0x53b489,null));}; \ No newline at end of file +var _0x7c93=['catch','show','params','rawAttributes','options','find','create','body','describe','uniqueid','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','sendStatus','end','status','json','count','offset','set','Content-Range','reject','save','update','then','error','name','send','CmHopperHistory','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','includeAll','include','findAll','rows'];(function(_0x216418,_0x2cc603){var _0x5b3d3a=function(_0x589e7a){while(--_0x589e7a){_0x216418['push'](_0x216418['shift']());}};_0x5b3d3a(++_0x2cc603);}(_0x7c93,0x1ed));var _0x37c9=function(_0xa0d06f,_0x59ad48){_0xa0d06f=_0xa0d06f-0x0;var _0x44938f=_0x7c93[_0xa0d06f];return _0x44938f;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x37c9('0x0'));var zipdir=require(_0x37c9('0x1'));var jsonpatch=require(_0x37c9('0x2'));var rp=require(_0x37c9('0x3'));var moment=require(_0x37c9('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x37c9('0x5'));var util=require(_0x37c9('0x6'));var path=require(_0x37c9('0x7'));var sox=require(_0x37c9('0x8'));var csv=require('to-csv');var ejs=require(_0x37c9('0x9'));var fs=require('fs');var _=require(_0x37c9('0xa'));var squel=require(_0x37c9('0xb'));var crypto=require('crypto');var jsforce=require(_0x37c9('0xc'));var deskjs=require(_0x37c9('0xd'));var toCsv=require('to-csv');var querystring=require(_0x37c9('0xe'));var Papa=require(_0x37c9('0xf'));var Redis=require('ioredis');var authService=require(_0x37c9('0x10'));var qs=require(_0x37c9('0x11'));var as=require(_0x37c9('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x37c9('0x13'))(_0x37c9('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3be1ff,_0xcb42f5){_0xcb42f5=_0xcb42f5||0xcc;return function(_0x53a3e6){if(_0x53a3e6){return _0x3be1ff[_0x37c9('0x15')](_0xcb42f5);}return _0x3be1ff['status'](_0xcb42f5)[_0x37c9('0x16')]();};}function respondWithResult(_0x427ae9,_0x220a23){_0x220a23=_0x220a23||0xc8;return function(_0x2fed71){if(_0x2fed71){return _0x427ae9[_0x37c9('0x17')](_0x220a23)[_0x37c9('0x18')](_0x2fed71);}};}function respondWithFilteredResult(_0x4d1c9e,_0x6b937f){return function(_0x4b01e4){if(_0x4b01e4){var _0x160e20=_0x4b01e4[_0x37c9('0x19')],_0xa4c40a=_0x6b937f['offset'],_0x1b2c06=_0x6b937f[_0x37c9('0x1a')]+_0x6b937f['limit'],_0x4c2b50;if(_0x1b2c06>=_0x160e20){_0x1b2c06=_0x160e20;_0x4c2b50=0xc8;}else{_0x4c2b50=0xce;}_0x4d1c9e[_0x37c9('0x17')](_0x4c2b50);return _0x4d1c9e[_0x37c9('0x1b')](_0x37c9('0x1c'),_0xa4c40a+'-'+_0x1b2c06+'/'+_0x160e20)[_0x37c9('0x18')](_0x4b01e4);}return null;};}function patchUpdates(_0x154a4b){return function(_0x3b4b37){try{jsonpatch['apply'](_0x3b4b37,_0x154a4b,!![]);}catch(_0x1eab94){return BPromise[_0x37c9('0x1d')](_0x1eab94);}return _0x3b4b37[_0x37c9('0x1e')]();};}function saveUpdates(_0x54acc1,_0x5ccdfe){return function(_0x443833){if(_0x443833){return _0x443833[_0x37c9('0x1f')](_0x54acc1)[_0x37c9('0x20')](function(_0x853295){return _0x853295;});}return null;};}function removeEntity(_0x8b7f9a,_0xb3dc64){return function(_0x3d211f){if(_0x3d211f){return _0x3d211f['destroy']()['then'](function(){_0x8b7f9a[_0x37c9('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x267fa6,_0x1562ab){return function(_0x188c13){if(!_0x188c13){_0x267fa6[_0x37c9('0x15')](0x194);}return _0x188c13;};}function handleError(_0x38134d,_0x26af2a){_0x26af2a=_0x26af2a||0x1f4;return function(_0x2f8b31){logger[_0x37c9('0x21')](_0x2f8b31['stack']);if(_0x2f8b31[_0x37c9('0x22')]){delete _0x2f8b31['name'];}_0x38134d[_0x37c9('0x17')](_0x26af2a)[_0x37c9('0x23')](_0x2f8b31);};}exports['index']=function(_0x2c2976,_0x256a9d){var _0x3d559b={},_0x4a9aba={},_0x29e083={'count':0x0,'rows':[]};var _0xfbbff2=_['map'](db[_0x37c9('0x24')]['rawAttributes'],function(_0x505f16){return{'name':_0x505f16['fieldName'],'type':_0x505f16[_0x37c9('0x25')]['key']};});_0x4a9aba[_0x37c9('0x26')]=_[_0x37c9('0x27')](_0xfbbff2,_0x37c9('0x22'));_0x4a9aba[_0x37c9('0x28')]=_[_0x37c9('0x29')](_0x2c2976['query']);_0x4a9aba[_0x37c9('0x2a')]=_[_0x37c9('0x2b')](_0x4a9aba['model'],_0x4a9aba[_0x37c9('0x28')]);_0x3d559b[_0x37c9('0x2c')]=_[_0x37c9('0x2b')](_0x4a9aba[_0x37c9('0x26')],qs[_0x37c9('0x2d')](_0x2c2976['query']['fields']));_0x3d559b['attributes']=_0x3d559b[_0x37c9('0x2c')][_0x37c9('0x2e')]?_0x3d559b[_0x37c9('0x2c')]:_0x4a9aba[_0x37c9('0x26')];if(!_0x2c2976[_0x37c9('0x28')][_0x37c9('0x2f')](_0x37c9('0x30'))){_0x3d559b['limit']=qs[_0x37c9('0x31')](_0x2c2976[_0x37c9('0x28')][_0x37c9('0x31')]);_0x3d559b[_0x37c9('0x1a')]=qs[_0x37c9('0x1a')](_0x2c2976[_0x37c9('0x28')]['offset']);}_0x3d559b[_0x37c9('0x32')]=qs[_0x37c9('0x33')](_0x2c2976[_0x37c9('0x28')][_0x37c9('0x33')]);_0x3d559b[_0x37c9('0x34')]=qs[_0x37c9('0x2a')](_['pick'](_0x2c2976[_0x37c9('0x28')],_0x4a9aba[_0x37c9('0x2a')]));if(_0x2c2976['query'][_0x37c9('0x35')]){_0x3d559b[_0x37c9('0x34')]=_[_0x37c9('0x36')](_0x3d559b['where'],{'$or':_[_0x37c9('0x27')](_0xfbbff2,function(_0x183c64){if(_0x183c64[_0x37c9('0x25')]!=='VIRTUAL'){var _0x38c2dd={};_0x38c2dd[_0x183c64[_0x37c9('0x22')]]={'$like':'%'+_0x2c2976['query'][_0x37c9('0x35')]+'%'};return _0x38c2dd;}})});}_0x3d559b=_[_0x37c9('0x36')]({},_0x3d559b,_0x2c2976['options']);var _0x329914={'where':_0x3d559b[_0x37c9('0x34')]};return db[_0x37c9('0x24')][_0x37c9('0x19')](_0x329914)[_0x37c9('0x20')](function(_0x7869a3){_0x29e083['count']=_0x7869a3;if(_0x2c2976[_0x37c9('0x28')][_0x37c9('0x37')]){_0x3d559b[_0x37c9('0x38')]=[{'all':!![]}];}return db[_0x37c9('0x24')][_0x37c9('0x39')](_0x3d559b);})[_0x37c9('0x20')](function(_0x1ebb59){_0x29e083[_0x37c9('0x3a')]=_0x1ebb59;return _0x29e083;})[_0x37c9('0x20')](respondWithFilteredResult(_0x256a9d,_0x3d559b))[_0x37c9('0x3b')](handleError(_0x256a9d,null));};exports[_0x37c9('0x3c')]=function(_0x1f52bc,_0x5e03ac){var _0x363f7b={'raw':!![],'where':{'id':_0x1f52bc[_0x37c9('0x3d')]['id']}},_0x4bfc85={};_0x4bfc85[_0x37c9('0x26')]=_[_0x37c9('0x29')](db[_0x37c9('0x24')][_0x37c9('0x3e')]);_0x4bfc85[_0x37c9('0x28')]=_[_0x37c9('0x29')](_0x1f52bc[_0x37c9('0x28')]);_0x4bfc85[_0x37c9('0x2a')]=_['intersection'](_0x4bfc85[_0x37c9('0x26')],_0x4bfc85['query']);_0x363f7b[_0x37c9('0x2c')]=_[_0x37c9('0x2b')](_0x4bfc85[_0x37c9('0x26')],qs[_0x37c9('0x2d')](_0x1f52bc[_0x37c9('0x28')][_0x37c9('0x2d')]));_0x363f7b['attributes']=_0x363f7b['attributes']['length']?_0x363f7b[_0x37c9('0x2c')]:_0x4bfc85[_0x37c9('0x26')];if(_0x1f52bc[_0x37c9('0x28')][_0x37c9('0x37')]){_0x363f7b[_0x37c9('0x38')]=[{'all':!![]}];}_0x363f7b=_['merge']({},_0x363f7b,_0x1f52bc[_0x37c9('0x3f')]);return db[_0x37c9('0x24')][_0x37c9('0x40')](_0x363f7b)[_0x37c9('0x20')](handleEntityNotFound(_0x5e03ac,null))['then'](respondWithResult(_0x5e03ac,null))['catch'](handleError(_0x5e03ac,null));};exports['create']=function(_0x111617,_0x38cf80){return db[_0x37c9('0x24')][_0x37c9('0x41')](_0x111617[_0x37c9('0x42')],{})[_0x37c9('0x20')](respondWithResult(_0x38cf80,0xc9))[_0x37c9('0x3b')](handleError(_0x38cf80,null));};exports[_0x37c9('0x43')]=function(_0x28ad6a,_0x5eda90){return db['CmHopperHistory'][_0x37c9('0x43')]()[_0x37c9('0x20')](respondWithResult(_0x5eda90,null))[_0x37c9('0x3b')](handleError(_0x5eda90,null));};exports[_0x37c9('0x1f')]=function(_0x3ab09d,_0x403d52){if(_0x3ab09d[_0x37c9('0x42')][_0x37c9('0x44')]){delete _0x3ab09d[_0x37c9('0x42')]['uniqueid'];}return db['CmHopperHistory'][_0x37c9('0x40')]({'where':{'uniqueid':_0x3ab09d['params']['id']}})[_0x37c9('0x20')](handleEntityNotFound(_0x403d52,null))[_0x37c9('0x20')](saveUpdates(_0x3ab09d['body'],null))[_0x37c9('0x20')](respondWithResult(_0x403d52,null))[_0x37c9('0x3b')](handleError(_0x403d52,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 8edf4ad..45fe4a0 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 _0xcefb=['request-promise','path','rimraf','./cmHopperHistory.attributes','exports','CmHopperHistory','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xcefb,0x125));var _0xbcef=function(_0x1a7edf,_0x5c4e04){_0x1a7edf=_0x1a7edf-0x0;var _0x56c1d9=_0xcefb[_0x1a7edf];return _0x56c1d9;};'use strict';var _=require(_0xbcef('0x0'));var util=require(_0xbcef('0x1'));var logger=require(_0xbcef('0x2'))(_0xbcef('0x3'));var moment=require(_0xbcef('0x4'));var BPromise=require(_0xbcef('0x5'));var rp=require(_0xbcef('0x6'));var fs=require('fs');var path=require(_0xbcef('0x7'));var rimraf=require(_0xbcef('0x8'));var config=require('../../config/environment');var attributes=require(_0xbcef('0x9'));module[_0xbcef('0xa')]=function(_0x50f21b,_0x10f083){return _0x50f21b['define'](_0xbcef('0xb'),attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':'endtime','fields':['endtime']},{'name':_0xbcef('0xc'),'fields':[_0xbcef('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf8c7=['endtime','uniqueid','lodash','../../config/logger','api','bluebird','../../config/environment','./cmHopperHistory.attributes','exports','cm_hopper_history'];(function(_0x37ea15,_0x5a0470){var _0x453798=function(_0x47b5f9){while(--_0x47b5f9){_0x37ea15['push'](_0x37ea15['shift']());}};_0x453798(++_0x5a0470);}(_0xf8c7,0x1c4));var _0x7f8c=function(_0x34b14d,_0x33529c){_0x34b14d=_0x34b14d-0x0;var _0xd1f82d=_0xf8c7[_0x34b14d];return _0xd1f82d;};'use strict';var _=require(_0x7f8c('0x0'));var util=require('util');var logger=require(_0x7f8c('0x1'))(_0x7f8c('0x2'));var moment=require('moment');var BPromise=require(_0x7f8c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7f8c('0x4'));var attributes=require(_0x7f8c('0x5'));module[_0x7f8c('0x6')]=function(_0x7459cd,_0x4b1bfa){return _0x7459cd['define']('CmHopperHistory',attributes,{'tableName':_0x7f8c('0x7'),'paranoid':![],'indexes':[{'name':_0x7f8c('0x8'),'fields':[_0x7f8c('0x8')]},{'name':'uniqueid','fields':[_0x7f8c('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 6c14c98..55d1f51 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 _0x0abf=['`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','ivrTotalCallsDays','GetCampaignHopperHistory','lodash','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','CmHopperHistory,\x20%s,\x20%s','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','raw','then','AvgHandleTime','where','sequelize','COUNT','col','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','debug','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay'];(function(_0x5974d8,_0x2fa04f){var _0x67b362=function(_0x4608d2){while(--_0x4608d2){_0x5974d8['push'](_0x5974d8['shift']());}};_0x67b362(++_0x2fa04f);}(_0x0abf,0xe8));var _0xf0ab=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x0abf[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0xf0ab('0x0'));var util=require('util');var moment=require(_0xf0ab('0x1'));var BPromise=require(_0xf0ab('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf0ab('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xf0ab('0x4'))(_0xf0ab('0x5'));var config=require(_0xf0ab('0x6'));var jayson=require(_0xf0ab('0x7'));var client=jayson[_0xf0ab('0x8')][_0xf0ab('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x233afe,_0x57ff3b,_0x2c4628){return new BPromise(function(_0x3f7e2b,_0x3ca099){return client[_0xf0ab('0xa')](_0x233afe,_0x2c4628)['then'](function(_0x472508){logger[_0xf0ab('0xb')](_0xf0ab('0xc'),_0x57ff3b,'request\x20sent');logger['debug'](_0xf0ab('0xd'),_0x57ff3b,'request\x20sent',JSON[_0xf0ab('0xe')](_0x472508));if(_0x472508[_0xf0ab('0xf')]){if(_0x472508[_0xf0ab('0xf')][_0xf0ab('0x10')]===0x1f4){logger[_0xf0ab('0xf')](_0xf0ab('0xc'),_0x57ff3b,_0x472508[_0xf0ab('0xf')]['message']);return _0x3ca099(_0x472508[_0xf0ab('0xf')][_0xf0ab('0x11')]);}logger[_0xf0ab('0xf')](_0xf0ab('0xc'),_0x57ff3b,_0x472508[_0xf0ab('0xf')][_0xf0ab('0x11')]);return _0x3f7e2b(_0x472508[_0xf0ab('0xf')][_0xf0ab('0x11')]);}else{logger[_0xf0ab('0xb')](_0xf0ab('0xc'),_0x57ff3b,_0xf0ab('0x12'));_0x3f7e2b(_0x472508[_0xf0ab('0x13')][_0xf0ab('0x11')]);}})[_0xf0ab('0x14')](function(_0x230f40){logger['error'](_0xf0ab('0xc'),_0x57ff3b,_0x230f40);_0x3ca099(_0x230f40);});});}exports[_0xf0ab('0x15')]=function(_0x1803f0){var _0x1ffeb5=this;return new Promise(function(_0x776619,_0xb9a33){return db[_0xf0ab('0x16')][_0xf0ab('0x17')](_0x1803f0[_0xf0ab('0x18')],{'raw':_0x1803f0[_0xf0ab('0x19')]?_0x1803f0[_0xf0ab('0x19')][_0xf0ab('0x1a')]===undefined?!![]:![]:!![]})[_0xf0ab('0x1b')](function(_0x22a205){logger[_0xf0ab('0xb')](_0xf0ab('0x15'),_0x1803f0);logger['debug'](_0xf0ab('0x15'),_0x1803f0,JSON[_0xf0ab('0xe')](_0x22a205));_0x776619(_0x22a205);})[_0xf0ab('0x14')](function(_0x11ab3a){logger[_0xf0ab('0xf')](_0xf0ab('0x15'),_0x11ab3a[_0xf0ab('0x11')],_0x1803f0);_0xb9a33(_0x1ffeb5[_0xf0ab('0xf')](0x1f4,_0x11ab3a[_0xf0ab('0x11')]));});});};exports[_0xf0ab('0x1c')]=function(_0x43119f){var _0x5645b2=this;return new Promise(function(_0x585841,_0x4eee21){return db[_0xf0ab('0x16')]['findAll']({'raw':_0x43119f[_0xf0ab('0x19')]?_0x43119f[_0xf0ab('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x43119f[_0xf0ab('0x19')]?_0x43119f[_0xf0ab('0x19')][_0xf0ab('0x1d')]||null:null,'attributes':[[db[_0xf0ab('0x1e')]['fn'](_0xf0ab('0x1f'),db['sequelize'][_0xf0ab('0x20')]('id')),'predictiveIntervalTotalCalls'],[db['sequelize']['fn'](_0xf0ab('0x1f'),db[_0xf0ab('0x1e')]['fn']('IF',db[_0xf0ab('0x1e')][_0xf0ab('0x21')](_0xf0ab('0x22')))),_0xf0ab('0x23')],[db[_0xf0ab('0x1e')]['fn'](_0xf0ab('0x1f'),db[_0xf0ab('0x1e')]['fn']('IF',db[_0xf0ab('0x1e')][_0xf0ab('0x21')](_0xf0ab('0x24')))),'predictiveIntervalDroppedCallsTimeout'],[db[_0xf0ab('0x1e')]['fn'](_0xf0ab('0x1f'),db['sequelize']['fn']('IF',db['sequelize'][_0xf0ab('0x21')](_0xf0ab('0x25')))),_0xf0ab('0x26')],[db['sequelize']['fn']('AVG',db[_0xf0ab('0x1e')]['fn']('IF',db['sequelize'][_0xf0ab('0x21')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),_0xf0ab('0x27')],[db[_0xf0ab('0x1e')]['fn']('AVG',db['sequelize']['fn']('IF',db[_0xf0ab('0x1e')][_0xf0ab('0x21')](_0xf0ab('0x28')))),_0xf0ab('0x29')]]})[_0xf0ab('0x1b')](function(_0x36195d){logger[_0xf0ab('0xb')](_0xf0ab('0x1c'),_0x43119f);logger[_0xf0ab('0x2a')](_0xf0ab('0x1c'),_0x43119f,JSON[_0xf0ab('0xe')](_0x36195d));_0x585841(_0x36195d);})[_0xf0ab('0x14')](function(_0x22dcfe){logger[_0xf0ab('0xf')]('AvgHandleTime',_0x22dcfe[_0xf0ab('0x11')],_0x43119f);_0x4eee21(_0x5645b2[_0xf0ab('0xf')](0x1f4,_0x22dcfe[_0xf0ab('0x11')]));});});};exports['GetVoiceQueueHopperHistory']=function(_0x9e38af){var _0xe4d58b=this;return new Promise(function(_0x5d99e7,_0x58bc85){return db[_0xf0ab('0x16')]['findAll']({'raw':_0x9e38af[_0xf0ab('0x19')]?_0x9e38af['options'][_0xf0ab('0x1a')]===undefined?!![]:![]:!![],'where':_0x9e38af[_0xf0ab('0x19')]?_0x9e38af[_0xf0ab('0x19')][_0xf0ab('0x1d')]||null:null,'attributes':[[_0xf0ab('0x2b'),_0xf0ab('0x2c')],[db['sequelize']['fn'](_0xf0ab('0x1f'),db[_0xf0ab('0x1e')]['fn']('IF',db['sequelize'][_0xf0ab('0x21')](_0xf0ab('0x2d')))),_0xf0ab('0x2e')],[db[_0xf0ab('0x1e')]['fn'](_0xf0ab('0x1f'),db[_0xf0ab('0x1e')]['fn']('IF',db[_0xf0ab('0x1e')]['literal'](_0xf0ab('0x2f')))),_0xf0ab('0x30')],[db[_0xf0ab('0x1e')]['fn']('COUNT',db[_0xf0ab('0x1e')]['fn']('IF',db[_0xf0ab('0x1e')][_0xf0ab('0x21')](_0xf0ab('0x22')))),_0xf0ab('0x31')],[db['sequelize']['fn'](_0xf0ab('0x1f'),db[_0xf0ab('0x1e')]['fn']('IF',db[_0xf0ab('0x1e')][_0xf0ab('0x21')](_0xf0ab('0x32')))),_0xf0ab('0x33')],[db[_0xf0ab('0x1e')]['fn'](_0xf0ab('0x1f'),db[_0xf0ab('0x1e')]['fn']('IF',db[_0xf0ab('0x1e')][_0xf0ab('0x21')](_0xf0ab('0x34')))),_0xf0ab('0x35')],[db['sequelize']['fn']('COUNT',db[_0xf0ab('0x1e')]['fn']('IF',db['sequelize'][_0xf0ab('0x21')](_0xf0ab('0x36')))),'outboundDropCallsDayTimeout'],[db[_0xf0ab('0x1e')]['fn'](_0xf0ab('0x1f'),db['sequelize']['fn']('IF',db[_0xf0ab('0x1e')][_0xf0ab('0x21')](_0xf0ab('0x37')))),_0xf0ab('0x38')],[db[_0xf0ab('0x1e')]['fn'](_0xf0ab('0x1f'),db[_0xf0ab('0x1e')]['fn']('IF',db[_0xf0ab('0x1e')][_0xf0ab('0x21')](_0xf0ab('0x39')))),_0xf0ab('0x3a')],[db[_0xf0ab('0x1e')]['fn'](_0xf0ab('0x1f'),db[_0xf0ab('0x1e')]['fn']('IF',db['sequelize']['literal'](_0xf0ab('0x3b')))),'outboundBlacklistCallsDay'],[db['sequelize']['fn']('COUNT',db[_0xf0ab('0x1e')]['fn']('IF',db[_0xf0ab('0x1e')][_0xf0ab('0x21')](_0xf0ab('0x3c')))),_0xf0ab('0x3d')],[db[_0xf0ab('0x1e')]['fn'](_0xf0ab('0x1f'),db[_0xf0ab('0x1e')]['fn']('IF',db[_0xf0ab('0x1e')][_0xf0ab('0x21')](_0xf0ab('0x3e')))),_0xf0ab('0x3f')],[db['sequelize']['fn'](_0xf0ab('0x1f'),db[_0xf0ab('0x1e')]['fn']('IF',db[_0xf0ab('0x1e')][_0xf0ab('0x21')](_0xf0ab('0x40')))),_0xf0ab('0x41')],[db[_0xf0ab('0x1e')]['fn'](_0xf0ab('0x1f'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0xf0ab('0x42')))),_0xf0ab('0x3f')],[db['sequelize']['fn'](_0xf0ab('0x1f'),db[_0xf0ab('0x1e')]['fn']('IF',db['sequelize'][_0xf0ab('0x21')](_0xf0ab('0x43')))),_0xf0ab('0x44')]],'group':[_0xf0ab('0x2b')]})[_0xf0ab('0x1b')](function(_0x33112b){logger[_0xf0ab('0xb')]('GetVoiceQueueHopperHistory',_0x9e38af);logger[_0xf0ab('0x2a')]('GetVoiceQueueHopperHistory',_0x9e38af,JSON[_0xf0ab('0xe')](_0x33112b));_0x5d99e7(_0x33112b);})['catch'](function(_0x1a402b){logger['error']('GetVoiceQueueHopperHistory',_0x1a402b[_0xf0ab('0x11')],_0x9e38af);_0x58bc85(_0xe4d58b['error'](0x1f4,_0x1a402b[_0xf0ab('0x11')]));});});};exports['GetCampaignHopperHistory']=function(_0x2eff07){var _0x488001=this;return new Promise(function(_0x42331c,_0x2114f0){return db[_0xf0ab('0x16')]['findAll']({'raw':_0x2eff07['options']?_0x2eff07['options'][_0xf0ab('0x1a')]===undefined?!![]:![]:!![],'where':_0x2eff07[_0xf0ab('0x19')]?_0x2eff07['options']['where']||null:null,'attributes':[[_0xf0ab('0x2b'),_0xf0ab('0x2c')],[db[_0xf0ab('0x1e')]['fn'](_0xf0ab('0x1f'),db[_0xf0ab('0x1e')][_0xf0ab('0x20')]('id')),_0xf0ab('0x45')],[db[_0xf0ab('0x1e')]['fn'](_0xf0ab('0x1f'),db[_0xf0ab('0x1e')]['fn']('IF',db[_0xf0ab('0x1e')]['literal'](_0xf0ab('0x22')))),'ivrAnswerCallsDay']],'group':[_0xf0ab('0x2b')]})[_0xf0ab('0x1b')](function(_0x14e4ee){logger[_0xf0ab('0xb')](_0xf0ab('0x46'),_0x2eff07);logger[_0xf0ab('0x2a')](_0xf0ab('0x46'),_0x2eff07,JSON[_0xf0ab('0xe')](_0x14e4ee));_0x42331c(_0x14e4ee);})[_0xf0ab('0x14')](function(_0x180ee6){logger['error'](_0xf0ab('0x46'),_0x180ee6[_0xf0ab('0x11')],_0x2eff07);_0x2114f0(_0x488001[_0xf0ab('0xf')](0x1f4,_0x180ee6[_0xf0ab('0x11')]));});});}; \ No newline at end of file +var _0xa571=['CreateCmHopperHistory','CmHopperHistory','create','body','options','AvgHandleTime','findAll','raw','where','sequelize','col','predictiveIntervalTotalCalls','COUNT','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','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoAnswerCallsDay','`state`\x20=\x204,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundReCallsDay','ivrTotalCallsDays','ivrAnswerCallsDay','GetCampaignHopperHistory','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','jayson/promise','client','http','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','message','catch'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xa571,0x107));var _0x1a57=function(_0x56645b,_0x31f3c2){_0x56645b=_0x56645b-0x0;var _0x398660=_0xa571[_0x56645b];return _0x398660;};'use strict';var _=require(_0x1a57('0x0'));var util=require(_0x1a57('0x1'));var moment=require(_0x1a57('0x2'));var BPromise=require(_0x1a57('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1a57('0x4'));var db=require(_0x1a57('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1a57('0x6'));var config=require('../../config/environment');var jayson=require(_0x1a57('0x7'));var client=jayson[_0x1a57('0x8')][_0x1a57('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3c5352,_0x2492f5,_0x924873){return new BPromise(function(_0x5d9f45,_0x3edb40){return client[_0x1a57('0xa')](_0x3c5352,_0x924873)[_0x1a57('0xb')](function(_0x58e266){logger[_0x1a57('0xc')](_0x1a57('0xd'),_0x2492f5,_0x1a57('0xe'));logger[_0x1a57('0xf')](_0x1a57('0x10'),_0x2492f5,_0x1a57('0xe'),JSON[_0x1a57('0x11')](_0x58e266));if(_0x58e266[_0x1a57('0x12')]){if(_0x58e266['error']['code']===0x1f4){logger[_0x1a57('0x12')](_0x1a57('0xd'),_0x2492f5,_0x58e266[_0x1a57('0x12')]['message']);return _0x3edb40(_0x58e266[_0x1a57('0x12')][_0x1a57('0x13')]);}logger['error'](_0x1a57('0xd'),_0x2492f5,_0x58e266['error'][_0x1a57('0x13')]);return _0x5d9f45(_0x58e266[_0x1a57('0x12')][_0x1a57('0x13')]);}else{logger[_0x1a57('0xc')]('CmHopperHistory,\x20%s,\x20%s',_0x2492f5,_0x1a57('0xe'));_0x5d9f45(_0x58e266['result']['message']);}})[_0x1a57('0x14')](function(_0x1c537f){logger[_0x1a57('0x12')]('CmHopperHistory,\x20%s,\x20%s',_0x2492f5,_0x1c537f);_0x3edb40(_0x1c537f);});});}exports[_0x1a57('0x15')]=function(_0x1662a3){var _0x80f8c1=this;return new Promise(function(_0x53bb20,_0x3daa66){return db[_0x1a57('0x16')][_0x1a57('0x17')](_0x1662a3[_0x1a57('0x18')],{'raw':_0x1662a3[_0x1a57('0x19')]?_0x1662a3['options']['raw']===undefined?!![]:![]:!![]})[_0x1a57('0xb')](function(_0x21e811){logger[_0x1a57('0xc')]('CreateCmHopperHistory',_0x1662a3);logger['debug']('CreateCmHopperHistory',_0x1662a3,JSON[_0x1a57('0x11')](_0x21e811));_0x53bb20(_0x21e811);})[_0x1a57('0x14')](function(_0x3f52b9){logger[_0x1a57('0x12')](_0x1a57('0x15'),_0x3f52b9[_0x1a57('0x13')],_0x1662a3);_0x3daa66(_0x80f8c1[_0x1a57('0x12')](0x1f4,_0x3f52b9[_0x1a57('0x13')]));});});};exports[_0x1a57('0x1a')]=function(_0x35d5dc){var _0x29e7cd=this;return new Promise(function(_0x36b17e,_0x26cdd3){return db[_0x1a57('0x16')][_0x1a57('0x1b')]({'raw':_0x35d5dc[_0x1a57('0x19')]?_0x35d5dc[_0x1a57('0x19')][_0x1a57('0x1c')]===undefined?!![]:![]:!![],'where':_0x35d5dc[_0x1a57('0x19')]?_0x35d5dc[_0x1a57('0x19')][_0x1a57('0x1d')]||null:null,'attributes':[[db[_0x1a57('0x1e')]['fn']('COUNT',db['sequelize'][_0x1a57('0x1f')]('id')),_0x1a57('0x20')],[db['sequelize']['fn'](_0x1a57('0x21'),db['sequelize']['fn']('IF',db[_0x1a57('0x1e')][_0x1a57('0x22')]('`state`\x20=\x204,\x201,\x20null'))),_0x1a57('0x23')],[db[_0x1a57('0x1e')]['fn'](_0x1a57('0x21'),db[_0x1a57('0x1e')]['fn']('IF',db['sequelize'][_0x1a57('0x22')](_0x1a57('0x24')))),_0x1a57('0x25')],[db[_0x1a57('0x1e')]['fn']('COUNT',db[_0x1a57('0x1e')]['fn']('IF',db[_0x1a57('0x1e')][_0x1a57('0x22')](_0x1a57('0x26')))),_0x1a57('0x27')],[db[_0x1a57('0x1e')]['fn'](_0x1a57('0x28'),db[_0x1a57('0x1e')]['fn']('IF',db[_0x1a57('0x1e')]['literal'](_0x1a57('0x29')))),_0x1a57('0x2a')],[db['sequelize']['fn']('AVG',db[_0x1a57('0x1e')]['fn']('IF',db[_0x1a57('0x1e')][_0x1a57('0x22')](_0x1a57('0x2b')))),_0x1a57('0x2c')]]})[_0x1a57('0xb')](function(_0xe80d94){logger[_0x1a57('0xc')](_0x1a57('0x1a'),_0x35d5dc);logger[_0x1a57('0xf')](_0x1a57('0x1a'),_0x35d5dc,JSON[_0x1a57('0x11')](_0xe80d94));_0x36b17e(_0xe80d94);})[_0x1a57('0x14')](function(_0x1a6231){logger[_0x1a57('0x12')](_0x1a57('0x1a'),_0x1a6231[_0x1a57('0x13')],_0x35d5dc);_0x26cdd3(_0x29e7cd[_0x1a57('0x12')](0x1f4,_0x1a6231['message']));});});};exports[_0x1a57('0x2d')]=function(_0x173671){var _0x137920=this;return new Promise(function(_0x3dad7c,_0x58b7dc){return db[_0x1a57('0x16')][_0x1a57('0x1b')]({'raw':_0x173671[_0x1a57('0x19')]?_0x173671[_0x1a57('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x173671['options']?_0x173671['options']['where']||null:null,'attributes':[[_0x1a57('0x2e'),_0x1a57('0x2f')],[db[_0x1a57('0x1e')]['fn']('COUNT',db[_0x1a57('0x1e')]['fn']('IF',db[_0x1a57('0x1e')][_0x1a57('0x22')](_0x1a57('0x30')))),'outboundNoSuchCallsDay'],[db[_0x1a57('0x1e')]['fn']('COUNT',db[_0x1a57('0x1e')]['fn']('IF',db[_0x1a57('0x1e')][_0x1a57('0x22')]('`state`\x20=\x203,\x201,\x20null'))),_0x1a57('0x31')],[db[_0x1a57('0x1e')]['fn'](_0x1a57('0x21'),db[_0x1a57('0x1e')]['fn']('IF',db[_0x1a57('0x1e')]['literal'](_0x1a57('0x32')))),'outboundAnswerCallsDay'],[db['sequelize']['fn'](_0x1a57('0x21'),db['sequelize']['fn']('IF',db[_0x1a57('0x1e')][_0x1a57('0x22')](_0x1a57('0x33')))),'outboundBusyCallsDay'],[db[_0x1a57('0x1e')]['fn'](_0x1a57('0x21'),db[_0x1a57('0x1e')]['fn']('IF',db[_0x1a57('0x1e')]['literal'](_0x1a57('0x34')))),_0x1a57('0x35')],[db['sequelize']['fn'](_0x1a57('0x21'),db['sequelize']['fn']('IF',db['sequelize'][_0x1a57('0x22')](_0x1a57('0x36')))),_0x1a57('0x37')],[db[_0x1a57('0x1e')]['fn']('COUNT',db[_0x1a57('0x1e')]['fn']('IF',db[_0x1a57('0x1e')][_0x1a57('0x22')](_0x1a57('0x38')))),_0x1a57('0x39')],[db['sequelize']['fn'](_0x1a57('0x21'),db[_0x1a57('0x1e')]['fn']('IF',db[_0x1a57('0x1e')][_0x1a57('0x22')]('`state`\x20=\x2012,\x201,\x20null'))),_0x1a57('0x3a')],[db['sequelize']['fn'](_0x1a57('0x21'),db[_0x1a57('0x1e')]['fn']('IF',db[_0x1a57('0x1e')][_0x1a57('0x22')](_0x1a57('0x3b')))),_0x1a57('0x3c')],[db[_0x1a57('0x1e')]['fn'](_0x1a57('0x21'),db[_0x1a57('0x1e')]['fn']('IF',db[_0x1a57('0x1e')][_0x1a57('0x22')](_0x1a57('0x3d')))),_0x1a57('0x3e')],[db['sequelize']['fn'](_0x1a57('0x21'),db[_0x1a57('0x1e')]['fn']('IF',db[_0x1a57('0x1e')][_0x1a57('0x22')](_0x1a57('0x3f')))),_0x1a57('0x40')],[db[_0x1a57('0x1e')]['fn'](_0x1a57('0x21'),db[_0x1a57('0x1e')]['fn']('IF',db[_0x1a57('0x1e')][_0x1a57('0x22')]('`state`\x20=\x2016,\x201,\x20null'))),_0x1a57('0x41')],[db[_0x1a57('0x1e')]['fn']('COUNT',db[_0x1a57('0x1e')]['fn']('IF',db[_0x1a57('0x1e')]['literal'](_0x1a57('0x42')))),_0x1a57('0x40')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x1a57('0x1e')][_0x1a57('0x22')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),_0x1a57('0x43')]],'group':[_0x1a57('0x2e')]})['then'](function(_0x5e510e){logger['info'](_0x1a57('0x2d'),_0x173671);logger[_0x1a57('0xf')](_0x1a57('0x2d'),_0x173671,JSON[_0x1a57('0x11')](_0x5e510e));_0x3dad7c(_0x5e510e);})[_0x1a57('0x14')](function(_0x33379c){logger[_0x1a57('0x12')](_0x1a57('0x2d'),_0x33379c['message'],_0x173671);_0x58b7dc(_0x137920['error'](0x1f4,_0x33379c['message']));});});};exports['GetCampaignHopperHistory']=function(_0x554208){var _0xd0261c=this;return new Promise(function(_0x13c04d,_0xcba9f0){return db[_0x1a57('0x16')][_0x1a57('0x1b')]({'raw':_0x554208[_0x1a57('0x19')]?_0x554208[_0x1a57('0x19')][_0x1a57('0x1c')]===undefined?!![]:![]:!![],'where':_0x554208['options']?_0x554208['options']['where']||null:null,'attributes':[[_0x1a57('0x2e'),'name'],[db[_0x1a57('0x1e')]['fn'](_0x1a57('0x21'),db[_0x1a57('0x1e')][_0x1a57('0x1f')]('id')),_0x1a57('0x44')],[db[_0x1a57('0x1e')]['fn'](_0x1a57('0x21'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x1a57('0x32')))),_0x1a57('0x45')]],'group':[_0x1a57('0x2e')]})[_0x1a57('0xb')](function(_0x2db770){logger[_0x1a57('0xc')](_0x1a57('0x46'),_0x554208);logger['debug']('GetCampaignHopperHistory',_0x554208,JSON[_0x1a57('0x11')](_0x2db770));_0x13c04d(_0x2db770);})[_0x1a57('0x14')](function(_0x231154){logger[_0x1a57('0x12')](_0x1a57('0x46'),_0x231154[_0x1a57('0x13')],_0x554208);_0xcba9f0(_0xd0261c['error'](0x1f4,_0x231154['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index e061ea0..a4fa1cc 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 _0xd7d5=['express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','exports','multer','util','path','connect-timeout'];(function(_0x363a2b,_0x2c51a2){var _0x2c720e=function(_0x54ec7){while(--_0x54ec7){_0x363a2b['push'](_0x363a2b['shift']());}};_0x2c720e(++_0x2c51a2);}(_0xd7d5,0x1ea));var _0x5d7d=function(_0x52116b,_0x13966d){_0x52116b=_0x52116b-0x0;var _0x3dc0fc=_0xd7d5[_0x52116b];return _0x3dc0fc;};'use strict';var multer=require(_0x5d7d('0x0'));var util=require(_0x5d7d('0x1'));var path=require(_0x5d7d('0x2'));var timeout=require(_0x5d7d('0x3'));var express=require(_0x5d7d('0x4'));var router=express[_0x5d7d('0x5')]();var auth=require(_0x5d7d('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5d7d('0x7'));var controller=require('./cmHopperHistory.controller');router[_0x5d7d('0x8')]('/',auth[_0x5d7d('0x9')](),controller[_0x5d7d('0xa')]);router[_0x5d7d('0x8')](_0x5d7d('0xb'),auth[_0x5d7d('0x9')](),controller[_0x5d7d('0xc')]);router[_0x5d7d('0x8')](_0x5d7d('0xd'),auth[_0x5d7d('0x9')](),controller['show']);router[_0x5d7d('0xe')]('/',auth[_0x5d7d('0x9')](),controller[_0x5d7d('0xf')]);router[_0x5d7d('0x10')](_0x5d7d('0xd'),auth[_0x5d7d('0x9')](),controller[_0x5d7d('0x11')]);module[_0x5d7d('0x12')]=router; \ No newline at end of file +var _0xb606=['../../components/interaction/service','./cmHopperHistory.controller','get','isAuthenticated','/describe','describe','/:id','post','create','put','exports','util','path','express','Router','../../components/auth/service'];(function(_0xcc2c66,_0x27cf7b){var _0x2197b2=function(_0xacbaeb){while(--_0xacbaeb){_0xcc2c66['push'](_0xcc2c66['shift']());}};_0x2197b2(++_0x27cf7b);}(_0xb606,0xfb));var _0x6b60=function(_0x28be72,_0x2b83af){_0x28be72=_0x28be72-0x0;var _0x46c5da=_0xb606[_0x28be72];return _0x46c5da;};'use strict';var multer=require('multer');var util=require(_0x6b60('0x0'));var path=require(_0x6b60('0x1'));var timeout=require('connect-timeout');var express=require(_0x6b60('0x2'));var router=express[_0x6b60('0x3')]();var auth=require(_0x6b60('0x4'));var interaction=require(_0x6b60('0x5'));var config=require('../../config/environment');var controller=require(_0x6b60('0x6'));router[_0x6b60('0x7')]('/',auth[_0x6b60('0x8')](),controller['index']);router['get'](_0x6b60('0x9'),auth[_0x6b60('0x8')](),controller[_0x6b60('0xa')]);router[_0x6b60('0x7')](_0x6b60('0xb'),auth[_0x6b60('0x8')](),controller['show']);router[_0x6b60('0xc')]('/',auth[_0x6b60('0x8')](),controller[_0x6b60('0xd')]);router[_0x6b60('0xe')](_0x6b60('0xb'),auth[_0x6b60('0x8')](),controller['update']);module[_0x6b60('0xf')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 072c305..df86502 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 _0x8247=['STRING','name','sequelize','exports'];(function(_0x2fce29,_0x28337b){var _0x1743dd=function(_0x35786a){while(--_0x35786a){_0x2fce29['push'](_0x2fce29['shift']());}};_0x1743dd(++_0x28337b);}(_0x8247,0xce));var _0x7824=function(_0x1f1a97,_0xadfc15){_0x1f1a97=_0x1f1a97-0x0;var _0x29fc6a=_0x8247[_0x1f1a97];return _0x29fc6a;};'use strict';var Sequelize=require(_0x7824('0x0'));module[_0x7824('0x1')]={'name':{'type':Sequelize[_0x7824('0x2')],'unique':_0x7824('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x7824('0x2')]},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xccd3=['sequelize','exports','STRING','name'];(function(_0x5ed49a,_0x446f2f){var _0x5e8db6=function(_0x194db1){while(--_0x194db1){_0x5ed49a['push'](_0x5ed49a['shift']());}};_0x5e8db6(++_0x446f2f);}(_0xccd3,0xbc));var _0x3ccd=function(_0x3101c2,_0x456492){_0x3101c2=_0x3101c2-0x0;var _0x74e1f7=_0xccd3[_0x3101c2];return _0x74e1f7;};'use strict';var Sequelize=require(_0x3ccd('0x0'));module[_0x3ccd('0x1')]={'name':{'type':Sequelize[_0x3ccd('0x2')],'unique':_0x3ccd('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x3ccd('0x2')]},'dialPrefix':{'type':Sequelize[_0x3ccd('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index d29cf52..8931f45 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 _0x0713=['cm_contacts','format','getCustomFields','addAgents','spread','emit','userCmList:save','userCmList:remove','getAgents','User','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','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./cmList.socket','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','get','Lists','error','stack','name','send','index','fieldName','key','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','merge','filter','options','CmList','findAll','rows','catch','show','params','length','include','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','Disposition','getDispositions','findOne','ListId','removeDispositions','ids','addContacts','CmContact','tags','isArray','join','push','each','omit','dataValues','errors','message','Malformed\x20request\x20syntax','CmCustomField','CustomFields','rawAttributes','pick','cf_%d','raw','getContacts','now','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','setHeader','Content-type','text/csv','download','/tmp/list_%d_%s.csv','addCustomField','transaction','addCustomFields','Sequelize','type','text','TEXT','number','switch','sequelize','queryInterface','addColumn'];(function(_0x52b23a,_0x373635){var _0x18e060=function(_0x51f5b8){while(--_0x51f5b8){_0x52b23a['push'](_0x52b23a['shift']());}};_0x18e060(++_0x373635);}(_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'];config[_0x3071('0x1a')]=_['defaults'](config['redis'],{'host':_0x3071('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3071('0x1a')]));require(_0x3071('0x1c'))['register'](socket);function respondWithStatusCode(_0x104e73,_0x4e1219){_0x4e1219=_0x4e1219||0xcc;return function(_0x2fc15d){if(_0x2fc15d){return _0x104e73[_0x3071('0x1d')](_0x4e1219);}return _0x104e73[_0x3071('0x1e')](_0x4e1219)[_0x3071('0x1f')]();};}function respondWithResult(_0x1caa5d,_0x2a6a4b){_0x2a6a4b=_0x2a6a4b||0xc8;return function(_0x157a47){if(_0x157a47){return _0x1caa5d[_0x3071('0x1e')](_0x2a6a4b)[_0x3071('0x20')](_0x157a47);}};}function respondWithFilteredResult(_0x344ea6,_0x5f3c22){return function(_0x224996){if(_0x224996){var _0x17dbda=_0x224996[_0x3071('0x21')],_0x1068d9=_0x5f3c22[_0x3071('0x22')],_0x108a83=_0x5f3c22[_0x3071('0x22')]+_0x5f3c22['limit'],_0x3acf0e;if(_0x108a83>=_0x17dbda){_0x108a83=_0x17dbda;_0x3acf0e=0xc8;}else{_0x3acf0e=0xce;}_0x344ea6[_0x3071('0x1e')](_0x3acf0e);return _0x344ea6[_0x3071('0x23')](_0x3071('0x24'),_0x1068d9+'-'+_0x108a83+'/'+_0x17dbda)['json'](_0x224996);}return null;};}function patchUpdates(_0xb8f4e3){return function(_0x5cd80d){try{jsonpatch[_0x3071('0x25')](_0x5cd80d,_0xb8f4e3,!![]);}catch(_0x43128c){return BPromise[_0x3071('0x26')](_0x43128c);}return _0x5cd80d[_0x3071('0x27')]();};}function saveUpdates(_0x33090c,_0x34c50e){return function(_0x3c5cef){if(_0x3c5cef){return _0x3c5cef[_0x3071('0x28')](_0x33090c)['then'](function(_0x481a51){return _0x481a51;});}return null;};}function removeEntity(_0x2ce48a,_0xb05b1d){return function(_0x412652){if(_0x412652){return _0x412652[_0x3071('0x29')]()[_0x3071('0x2a')](function(){var _0x44b45f=_0x412652[_0x3071('0x2b')]({'plain':!![]});var _0x1fe727=_0x3071('0x2c');return db['UserProfileResource'][_0x3071('0x29')]({'where':{'type':_0x1fe727,'resourceId':_0x44b45f['id']}})[_0x3071('0x2a')](function(){return _0x412652;});})[_0x3071('0x2a')](function(){_0x2ce48a['status'](0xcc)[_0x3071('0x1f')]();});}};}function handleEntityNotFound(_0x28792d,_0x163604){return function(_0x950fde){if(!_0x950fde){_0x28792d[_0x3071('0x1d')](0x194);}return _0x950fde;};}function handleError(_0x25b96b,_0x177b5f){_0x177b5f=_0x177b5f||0x1f4;return function(_0x3921a1){logger[_0x3071('0x2d')](_0x3921a1[_0x3071('0x2e')]);if(_0x3921a1[_0x3071('0x2f')]){delete _0x3921a1['name'];}_0x25b96b['status'](_0x177b5f)[_0x3071('0x30')](_0x3921a1);};}exports[_0x3071('0x31')]=function(_0x6ddf96,_0x40be95){var _0x3f6d90={},_0x29538c={},_0x32b6b1={'count':0x0,'rows':[]};var _0x1ccc41=_['map'](db['CmList']['rawAttributes'],function(_0x1b0aaf){return{'name':_0x1b0aaf[_0x3071('0x32')],'type':_0x1b0aaf['type'][_0x3071('0x33')]};});_0x29538c[_0x3071('0x34')]=_[_0x3071('0x35')](_0x1ccc41,_0x3071('0x2f'));_0x29538c['query']=_[_0x3071('0x36')](_0x6ddf96[_0x3071('0x37')]);_0x29538c[_0x3071('0x38')]=_[_0x3071('0x39')](_0x29538c[_0x3071('0x34')],_0x29538c[_0x3071('0x37')]);_0x3f6d90[_0x3071('0x3a')]=_[_0x3071('0x39')](_0x29538c['model'],qs[_0x3071('0x3b')](_0x6ddf96['query']['fields']));_0x3f6d90[_0x3071('0x3a')]=_0x3f6d90[_0x3071('0x3a')]['length']?_0x3f6d90[_0x3071('0x3a')]:_0x29538c[_0x3071('0x34')];if(!_0x6ddf96[_0x3071('0x37')][_0x3071('0x3c')](_0x3071('0x3d'))){_0x3f6d90[_0x3071('0x3e')]=qs['limit'](_0x6ddf96[_0x3071('0x37')][_0x3071('0x3e')]);_0x3f6d90['offset']=qs[_0x3071('0x22')](_0x6ddf96['query'][_0x3071('0x22')]);}_0x3f6d90[_0x3071('0x3f')]=qs['sort'](_0x6ddf96['query'][_0x3071('0x40')]);_0x3f6d90[_0x3071('0x41')]=qs[_0x3071('0x38')](_['pick'](_0x6ddf96[_0x3071('0x37')],_0x29538c['filters']));if(_0x6ddf96[_0x3071('0x37')]['filter']){_0x3f6d90[_0x3071('0x41')]=_[_0x3071('0x42')](_0x3f6d90[_0x3071('0x41')],{'$or':_[_0x3071('0x35')](_0x1ccc41,function(_0x30ab68){if(_0x30ab68['type']!=='VIRTUAL'){var _0x4337eb={};_0x4337eb[_0x30ab68[_0x3071('0x2f')]]={'$like':'%'+_0x6ddf96[_0x3071('0x37')][_0x3071('0x43')]+'%'};return _0x4337eb;}})});}_0x3f6d90=_['merge']({},_0x3f6d90,_0x6ddf96[_0x3071('0x44')]);var _0x60549a={'where':_0x3f6d90[_0x3071('0x41')]};return db[_0x3071('0x45')][_0x3071('0x21')](_0x60549a)[_0x3071('0x2a')](function(_0x56a9d8){_0x32b6b1[_0x3071('0x21')]=_0x56a9d8;if(_0x6ddf96['query']['includeAll']){_0x3f6d90['include']=[{'all':!![]}];}return db['CmList'][_0x3071('0x46')](_0x3f6d90);})[_0x3071('0x2a')](function(_0x67b2fb){_0x32b6b1[_0x3071('0x47')]=_0x67b2fb;return _0x32b6b1;})[_0x3071('0x2a')](respondWithFilteredResult(_0x40be95,_0x3f6d90))[_0x3071('0x48')](handleError(_0x40be95,null));};exports[_0x3071('0x49')]=function(_0x2e6c70,_0x56589e){var _0x1e8222={'raw':![],'where':{'id':_0x2e6c70[_0x3071('0x4a')]['id']}},_0x1641d9={};_0x1641d9[_0x3071('0x34')]=_[_0x3071('0x36')](db['CmList']['rawAttributes']);_0x1641d9[_0x3071('0x37')]=_[_0x3071('0x36')](_0x2e6c70[_0x3071('0x37')]);_0x1641d9[_0x3071('0x38')]=_[_0x3071('0x39')](_0x1641d9['model'],_0x1641d9[_0x3071('0x37')]);_0x1e8222['attributes']=_[_0x3071('0x39')](_0x1641d9['model'],qs['fields'](_0x2e6c70[_0x3071('0x37')]['fields']));_0x1e8222[_0x3071('0x3a')]=_0x1e8222['attributes'][_0x3071('0x4b')]?_0x1e8222[_0x3071('0x3a')]:_0x1641d9[_0x3071('0x34')];if(_0x2e6c70[_0x3071('0x37')]['includeAll']){_0x1e8222[_0x3071('0x4c')]=[{'all':!![]}];}_0x1e8222=_['merge']({},_0x1e8222,_0x2e6c70[_0x3071('0x44')]);return db['CmList'][_0x3071('0x4d')](_0x1e8222)[_0x3071('0x2a')](handleEntityNotFound(_0x56589e,null))['then'](respondWithResult(_0x56589e,null))[_0x3071('0x48')](handleError(_0x56589e,null));};exports[_0x3071('0x4e')]=function(_0x224a70,_0x38bcc2){return db[_0x3071('0x45')][_0x3071('0x4e')](_0x224a70[_0x3071('0x4f')],{})['then'](function(_0x2c6e4c){var _0x486b7a=_0x224a70[_0x3071('0x50')][_0x3071('0x2b')]({'plain':!![]});if(!_0x486b7a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x486b7a[_0x3071('0x51')]===_0x3071('0x50')){var _0x1b832e=_0x2c6e4c[_0x3071('0x2b')]({'plain':!![]});var _0x22aade=_0x3071('0x2c');return db[_0x3071('0x52')][_0x3071('0x4d')]({'where':{'name':_0x22aade,'userProfileId':_0x486b7a[_0x3071('0x53')]},'raw':!![]})[_0x3071('0x2a')](function(_0x4371e7){if(_0x4371e7&&_0x4371e7[_0x3071('0x54')]===0x0){return db[_0x3071('0x55')][_0x3071('0x4e')]({'name':_0x1b832e[_0x3071('0x2f')],'resourceId':_0x1b832e['id'],'type':_0x4371e7[_0x3071('0x2f')],'sectionId':_0x4371e7['id']},{})['then'](function(){return _0x2c6e4c;});}else{return _0x2c6e4c;}})['catch'](function(_0x12536d){logger['error'](_0x3071('0x56'),_0x12536d);throw _0x12536d;});}return _0x2c6e4c;})[_0x3071('0x2a')](respondWithResult(_0x38bcc2,0xc9))[_0x3071('0x48')](handleError(_0x38bcc2,null));};exports['update']=function(_0x1ec428,_0x1ada95){if(_0x1ec428['body']['id']){delete _0x1ec428['body']['id'];}return db[_0x3071('0x45')][_0x3071('0x4d')]({'where':{'id':_0x1ec428[_0x3071('0x4a')]['id']}})[_0x3071('0x2a')](handleEntityNotFound(_0x1ada95,null))['then'](saveUpdates(_0x1ec428[_0x3071('0x4f')],null))[_0x3071('0x2a')](respondWithResult(_0x1ada95,null))[_0x3071('0x48')](handleError(_0x1ada95,null));};exports[_0x3071('0x29')]=function(_0x123323,_0x5206bd){return db[_0x3071('0x45')][_0x3071('0x4d')]({'where':{'id':_0x123323[_0x3071('0x4a')]['id']}})[_0x3071('0x2a')](handleEntityNotFound(_0x5206bd,null))[_0x3071('0x2a')](removeEntity(_0x5206bd,null))[_0x3071('0x48')](handleError(_0x5206bd,null));};exports[_0x3071('0x57')]=function(_0x4bea5d,_0x4d6ed0){return db[_0x3071('0x45')]['describe']()[_0x3071('0x2a')](respondWithResult(_0x4d6ed0,null))[_0x3071('0x48')](handleError(_0x4d6ed0,null));};exports['addDisposition']=function(_0x19dc95,_0x1bf911,_0x4d3886){if(_0x19dc95[_0x3071('0x4f')]['id']){delete _0x19dc95[_0x3071('0x4f')]['id'];}return db[_0x3071('0x45')][_0x3071('0x4d')]({'where':{'id':_0x19dc95[_0x3071('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1bf911,null))[_0x3071('0x2a')](function(_0x313a54){if(_0x313a54){_0x19dc95[_0x3071('0x4f')]['ListId']=_0x313a54['id'];return db[_0x3071('0x58')][_0x3071('0x4e')](_0x19dc95[_0x3071('0x4f')]);}})[_0x3071('0x2a')](respondWithResult(_0x1bf911,null))[_0x3071('0x48')](handleError(_0x1bf911,null));};exports[_0x3071('0x59')]=function(_0xe93f28,_0x2e39ff,_0x3b47e8){var _0x5cb3b3={'raw':![],'where':{}};var _0x5d1316={};var _0x29a58e={'count':0x0,'rows':[]};return db[_0x3071('0x45')][_0x3071('0x5a')]({'where':{'id':_0xe93f28[_0x3071('0x4a')]['id']}})[_0x3071('0x2a')](handleEntityNotFound(_0x2e39ff,null))[_0x3071('0x2a')](function(_0x287974){if(_0x287974){_0x5d1316[_0x3071('0x34')]=_[_0x3071('0x36')](db[_0x3071('0x58')]['rawAttributes']);_0x5d1316[_0x3071('0x37')]=_[_0x3071('0x36')](_0xe93f28[_0x3071('0x37')]);_0x5d1316[_0x3071('0x38')]=_[_0x3071('0x39')](_0x5d1316[_0x3071('0x34')],_0x5d1316[_0x3071('0x37')]);_0x5cb3b3[_0x3071('0x3a')]=_['intersection'](_0x5d1316[_0x3071('0x34')],qs[_0x3071('0x3b')](_0xe93f28['query']['fields']));_0x5cb3b3[_0x3071('0x3a')]=_0x5cb3b3[_0x3071('0x3a')][_0x3071('0x4b')]?_0x5cb3b3[_0x3071('0x3a')]:_0x5d1316['model'];if(!_0xe93f28['query'][_0x3071('0x3c')]('nolimit')){_0x5cb3b3['limit']=qs['limit'](_0xe93f28['query'][_0x3071('0x3e')]);_0x5cb3b3[_0x3071('0x22')]=qs[_0x3071('0x22')](_0xe93f28['query'][_0x3071('0x22')]);}_0x5cb3b3[_0x3071('0x3f')]=qs[_0x3071('0x40')](_0xe93f28[_0x3071('0x37')]['sort']);_0x5cb3b3[_0x3071('0x41')]=qs[_0x3071('0x38')](_['pick'](_0xe93f28[_0x3071('0x37')],_0x5d1316[_0x3071('0x38')]));_0x5cb3b3[_0x3071('0x41')][_0x3071('0x5b')]=_0x287974['id'];if(_0xe93f28[_0x3071('0x37')][_0x3071('0x43')]){_0x5cb3b3[_0x3071('0x41')]=_['merge'](_0x5cb3b3['where'],{'$or':_[_0x3071('0x35')](_0x5cb3b3[_0x3071('0x3a')],function(_0x1456ce){var _0x4bf839={};_0x4bf839[_0x1456ce]={'$like':'%'+_0xe93f28['query'][_0x3071('0x43')]+'%'};return _0x4bf839;})});}_0x5cb3b3=_[_0x3071('0x42')]({},_0x5cb3b3,_0xe93f28[_0x3071('0x44')]);return db[_0x3071('0x58')][_0x3071('0x21')]({'where':_0x5cb3b3[_0x3071('0x41')]})[_0x3071('0x2a')](function(_0x268657){_0x29a58e['count']=_0x268657;if(_0xe93f28[_0x3071('0x37')]['includeAll']){_0x5cb3b3[_0x3071('0x4c')]=[{'all':!![]}];}return db[_0x3071('0x58')][_0x3071('0x46')](_0x5cb3b3);})[_0x3071('0x2a')](function(_0x37cec5){_0x29a58e[_0x3071('0x47')]=_0x37cec5;return _0x29a58e;});}})[_0x3071('0x2a')](respondWithFilteredResult(_0x2e39ff,_0x5cb3b3))[_0x3071('0x48')](handleError(_0x2e39ff,null));};exports['removeDispositions']=function(_0x20dff9,_0x138a94,_0x1da477){return db['CmList'][_0x3071('0x4d')]({'where':{'id':_0x20dff9[_0x3071('0x4a')]['id']}})[_0x3071('0x2a')](handleEntityNotFound(_0x138a94,null))['then'](function(_0x521ee6){if(_0x521ee6){return _0x521ee6[_0x3071('0x5c')](_0x20dff9['query'][_0x3071('0x5d')]);}})[_0x3071('0x2a')](respondWithStatusCode(_0x138a94,null))[_0x3071('0x48')](handleError(_0x138a94,null));};exports[_0x3071('0x5e')]=function(_0x311939,_0x437098,_0x242665){return db['CmList'][_0x3071('0x4d')]({'where':{'id':_0x311939[_0x3071('0x4a')]['id']}})[_0x3071('0x2a')](handleEntityNotFound(_0x437098,null))[_0x3071('0x2a')](function(_0x98d0fb){if(_0x98d0fb){var _0x1fea60=[];var _0x435dcb={'success':[],'errors':[]};return db[_0x3071('0x5f')]['describe']()[_0x3071('0x2a')](function(_0x5ed436){if(_0x311939[_0x3071('0x4f')][_0x3071('0x60')]&&_[_0x3071('0x61')](_0x311939[_0x3071('0x4f')][_0x3071('0x60')])){if(_0x311939[_0x3071('0x4f')][_0x3071('0x60')][_0x3071('0x4b')]){_0x311939[_0x3071('0x4f')][_0x3071('0x60')]=_0x311939['body'][_0x3071('0x60')][_0x3071('0x62')](';')+';';}else{_0x311939['body'][_0x3071('0x60')]=null;}}else{_0x311939[_0x3071('0x4f')][_0x3071('0x60')]=null;}if(_0x311939[_0x3071('0x4f')]&&_[_0x3071('0x61')](_0x311939['body'])){for(var _0x5a7d28=0x0;_0x5a7d28<_0x311939[_0x3071('0x4f')]['length'];_0x5a7d28+=0x1){_0x311939[_0x3071('0x4f')][_0x5a7d28][_0x3071('0x5b')]=_0x311939[_0x3071('0x4a')]['id'];_0x1fea60[_0x3071('0x63')](_0x311939[_0x3071('0x4f')][_0x5a7d28]);}return BPromise[_0x3071('0x64')](_0x1fea60,function(_0x568386){return db[_0x3071('0x5f')][_0x3071('0x4e')](_[_0x3071('0x65')](_0x568386,[_0x3071('0x5d'),'id'])||{},{'fields':_['keys'](_0x5ed436),'raw':!![]})[_0x3071('0x2a')](function(_0x446546){_0x435dcb['success'][_0x3071('0x63')](_0x446546[_0x3071('0x66')]);})[_0x3071('0x48')](function(_0x10bc5b){_0x435dcb[_0x3071('0x67')]['push']({'data':_0x568386,'error':_0x10bc5b[_0x3071('0x68')]});});})['then'](function(_0x34b88b){return _0x435dcb;})[_0x3071('0x48')](function(_0x39060f){return _0x39060f;});}else{_0x437098[_0x3071('0x1e')](0x190)[_0x3071('0x20')]({'message':_0x3071('0x69')});}});}})[_0x3071('0x2a')](respondWithResult(_0x437098,null))[_0x3071('0x48')](handleError(_0x437098,null));};exports['getContacts']=function(_0x2868c2,_0x3efa3c,_0x459653){var _0x4dfb45;return db[_0x3071('0x45')]['find']({'where':{'id':_0x2868c2[_0x3071('0x4a')]['id']},'include':[{'model':db[_0x3071('0x6a')],'as':_0x3071('0x6b')}]})['then'](handleEntityNotFound(_0x3efa3c,null))[_0x3071('0x2a')](function(_0x2ef706){if(_0x2ef706){_0x4dfb45=_0x2ef706;return db[_0x3071('0x5f')][_0x3071('0x6c')];}})[_0x3071('0x2a')](function(_0x2e5f09){if(_0x2e5f09){var _0x12c700={};var _0x2c7749={};_0x2c7749[_0x3071('0x34')]=_['concat'](_[_0x3071('0x36')](_0x2e5f09),_[_0x3071('0x35')](_0x4dfb45[_0x3071('0x6b')],function(_0x5b2830){return util['format']('cf_%d',_0x5b2830['id']);}));_0x2c7749['query']=_['keys'](_0x2868c2[_0x3071('0x37')]);_0x2c7749[_0x3071('0x38')]=_['intersection'](_0x2c7749[_0x3071('0x34')],_0x2c7749[_0x3071('0x37')]);_0x12c700[_0x3071('0x3a')]=_['intersection'](_0x2c7749['model'],qs[_0x3071('0x3b')](_0x2868c2[_0x3071('0x37')][_0x3071('0x3b')]));_0x12c700[_0x3071('0x3a')]=_0x12c700[_0x3071('0x3a')][_0x3071('0x4b')]?_0x12c700[_0x3071('0x3a')]:_0x2c7749['model'];if(!_0x2868c2['query'][_0x3071('0x3c')](_0x3071('0x3d'))){_0x12c700[_0x3071('0x3e')]=qs[_0x3071('0x3e')](_0x2868c2['query'][_0x3071('0x3e')]);_0x12c700[_0x3071('0x22')]=qs[_0x3071('0x22')](_0x2868c2[_0x3071('0x37')][_0x3071('0x22')]);}_0x12c700[_0x3071('0x3f')]=qs[_0x3071('0x40')](_0x2868c2[_0x3071('0x37')]['sort']);_0x12c700[_0x3071('0x41')]=qs[_0x3071('0x38')](_[_0x3071('0x6d')](_0x2868c2[_0x3071('0x37')],_0x2c7749[_0x3071('0x38')]));_0x12c700['raw']=!![];if(_0x2868c2[_0x3071('0x37')]['filter']){_0x12c700['where']=_[_0x3071('0x42')](_0x12c700[_0x3071('0x41')],{'$or':_[_0x3071('0x35')](_0x12c700['attributes'],function(_0x262bca){var _0x1791bc={};_0x1791bc[_0x262bca]={'$like':'%'+_0x2868c2[_0x3071('0x37')][_0x3071('0x43')]+'%'};return _0x1791bc;})});}_0x12c700=_[_0x3071('0x42')]({},_0x12c700,_0x2868c2['options']);return _0x4dfb45['getContacts'](_0x12c700);}})[_0x3071('0x2a')](respondWithResult(_0x3efa3c,null))[_0x3071('0x48')](handleError(_0x3efa3c,null));};exports['getContactsCsv']=function(_0x3ae39b,_0x141122,_0x22e484){var _0x2d559a;return db[_0x3071('0x45')]['find']({'where':{'id':_0x3ae39b[_0x3071('0x4a')]['id']},'include':[{'model':db['CmCustomField'],'as':_0x3071('0x6b')}]})[_0x3071('0x2a')](handleEntityNotFound(_0x141122,null))['then'](function(_0x279525){if(_0x279525){_0x2d559a=_0x279525;return db['CmContact'][_0x3071('0x6c')];}})[_0x3071('0x2a')](function(_0x408ace){if(_0x408ace){var _0x2f36b1={};var _0x5a19b5={};_0x5a19b5[_0x3071('0x34')]=_['concat'](_[_0x3071('0x36')](_0x408ace),_['map'](_0x2d559a[_0x3071('0x6b')],function(_0x3ce867){return util['format'](_0x3071('0x6e'),_0x3ce867['id']);}));_0x5a19b5[_0x3071('0x37')]=_['keys'](_0x3ae39b[_0x3071('0x37')]);_0x5a19b5[_0x3071('0x38')]=_[_0x3071('0x39')](_0x5a19b5[_0x3071('0x34')],_0x5a19b5[_0x3071('0x37')]);_0x2f36b1[_0x3071('0x3a')]=_[_0x3071('0x39')](_0x5a19b5[_0x3071('0x34')],qs[_0x3071('0x3b')](_0x3ae39b[_0x3071('0x37')][_0x3071('0x3b')]));_0x2f36b1[_0x3071('0x3a')]=_0x2f36b1[_0x3071('0x3a')][_0x3071('0x4b')]?_0x2f36b1[_0x3071('0x3a')]:_0x5a19b5['model'];if(!_0x3ae39b[_0x3071('0x37')][_0x3071('0x3c')](_0x3071('0x3d'))){_0x2f36b1[_0x3071('0x3e')]=qs[_0x3071('0x3e')](_0x3ae39b['query']['limit']);_0x2f36b1[_0x3071('0x22')]=qs[_0x3071('0x22')](_0x3ae39b['query'][_0x3071('0x22')]);}_0x2f36b1[_0x3071('0x3f')]=qs['sort'](_0x3ae39b[_0x3071('0x37')][_0x3071('0x40')]);_0x2f36b1[_0x3071('0x41')]=qs[_0x3071('0x38')](_[_0x3071('0x6d')](_0x3ae39b[_0x3071('0x37')],_0x5a19b5[_0x3071('0x38')]));_0x2f36b1[_0x3071('0x6f')]=!![];if(_0x3ae39b[_0x3071('0x37')][_0x3071('0x43')]){_0x2f36b1['where']=_[_0x3071('0x42')](_0x2f36b1['where'],{'$or':_[_0x3071('0x35')](_0x2f36b1[_0x3071('0x3a')],function(_0x46ab46){var _0x3d4d6b={};_0x3d4d6b[_0x46ab46]={'$like':'%'+_0x3ae39b['query']['filter']+'%'};return _0x3d4d6b;})});}_0x2f36b1=_['merge']({},_0x2f36b1,_0x3ae39b[_0x3071('0x44')]);return _0x2d559a[_0x3071('0x70')](_0x2f36b1);}})[_0x3071('0x2a')](function(_0x2e729c){if(!_['isEmpty'](_0x2e729c)){var _0x35aef4=toCsv(_0x2e729c);var _0x7c3473=Date[_0x3071('0x71')]();fs['writeFileSync'](util['format']('/tmp/list_%d_%s.csv',_0x2d559a['id'],_0x7c3473),_0x35aef4);_0x141122['setHeader'](_0x3071('0x72'),_0x3071('0x73')+util['format'](_0x3071('0x74'),_0x2d559a['id'],_0x7c3473));_0x141122[_0x3071('0x75')](_0x3071('0x76'),_0x3071('0x77'));return _0x141122[_0x3071('0x78')](util['format'](_0x3071('0x79'),_0x2d559a['id'],_0x7c3473));}else{return _0x141122[_0x3071('0x1d')](0xcc);}})[_0x3071('0x48')](handleError(_0x141122,null));};exports[_0x3071('0x7a')]=function(_0x56d01a,_0x398590,_0x54d194){var _0x2c5bf0;delete _0x56d01a[_0x3071('0x4f')]['id'];return db[_0x3071('0x45')]['findOne']({'where':{'id':_0x56d01a[_0x3071('0x4a')]['id']}})[_0x3071('0x2a')](handleEntityNotFound(_0x398590,null))[_0x3071('0x2a')](function(_0x1e30be){if(_0x1e30be){return db['sequelize'][_0x3071('0x7b')](function(_0xd89eeb){return db[_0x3071('0x6a')][_0x3071('0x4e')](_0x56d01a[_0x3071('0x4f')],{'transaction':_0xd89eeb})['then'](function(_0x57f202){_0x2c5bf0=_0x57f202;return _0x1e30be[_0x3071('0x7c')](_0x57f202,{'transaction':_0xd89eeb});})[_0x3071('0x2a')](function(){var _0x11c32f={'type':db[_0x3071('0x7d')]['TEXT'],'transaction':_0xd89eeb};switch(_0x56d01a['body'][_0x3071('0x7e')]){case _0x3071('0x7f'):_0x11c32f['type']=db[_0x3071('0x7d')][_0x3071('0x80')];break;case _0x3071('0x81'):_0x11c32f['type']=db['Sequelize']['INTEGER'];break;case _0x3071('0x82'):_0x11c32f[_0x3071('0x7e')]=db[_0x3071('0x7d')]['BOOLEAN'];_0x11c32f['defaultValue']=![];break;default:}return db[_0x3071('0x83')][_0x3071('0x84')][_0x3071('0x85')](_0x3071('0x86'),util[_0x3071('0x87')]('cf_%s',_0x2c5bf0['id']),_0x11c32f);})[_0x3071('0x2a')](function(){return _0x2c5bf0;});});}})['then'](respondWithResult(_0x398590,null))[_0x3071('0x48')](handleError(_0x398590,null));};exports[_0x3071('0x88')]=function(_0x294316,_0xc1632,_0x1817a8){var _0x4e9672={};var _0x64220e={};var _0x1919cc;var _0x17b103;return db[_0x3071('0x45')][_0x3071('0x5a')]({'where':{'id':_0x294316[_0x3071('0x4a')]['id']}})[_0x3071('0x2a')](handleEntityNotFound(_0xc1632,null))[_0x3071('0x2a')](function(_0xc6bc56){if(_0xc6bc56){_0x1919cc=_0xc6bc56;_0x64220e[_0x3071('0x34')]=_[_0x3071('0x36')](db['CmCustomField'][_0x3071('0x6c')]);_0x64220e[_0x3071('0x37')]=_[_0x3071('0x36')](_0x294316[_0x3071('0x37')]);_0x64220e['filters']=_[_0x3071('0x39')](_0x64220e['model'],_0x64220e[_0x3071('0x37')]);_0x4e9672[_0x3071('0x3a')]=_[_0x3071('0x39')](_0x64220e[_0x3071('0x34')],qs[_0x3071('0x3b')](_0x294316[_0x3071('0x37')][_0x3071('0x3b')]));_0x4e9672['attributes']=_0x4e9672[_0x3071('0x3a')]['length']?_0x4e9672['attributes']:_0x64220e[_0x3071('0x34')];_0x4e9672[_0x3071('0x3f')]=qs['sort'](_0x294316[_0x3071('0x37')]['sort']);_0x4e9672[_0x3071('0x41')]=qs[_0x3071('0x38')](_[_0x3071('0x6d')](_0x294316[_0x3071('0x37')],_0x64220e[_0x3071('0x38')]));_0x4e9672[_0x3071('0x41')]=_[_0x3071('0x42')](_0x4e9672[_0x3071('0x41')],{'$or':[{'ListId':_0xc6bc56['id']},{'ListId':null}]});if(_0x294316[_0x3071('0x37')][_0x3071('0x43')]){_0x4e9672[_0x3071('0x41')]=_['merge'](_0x4e9672[_0x3071('0x41')],{'$or':_[_0x3071('0x35')](_0x4e9672[_0x3071('0x3a')],function(_0x5f1c3b){var _0x2f7eee={};_0x2f7eee[_0x5f1c3b]={'$like':'%'+_0x294316['query'][_0x3071('0x43')]+'%'};return _0x2f7eee;})});}_0x4e9672=_[_0x3071('0x42')]({},_0x4e9672,_0x294316[_0x3071('0x44')]);return db[_0x3071('0x6a')]['findAndCountAll'](_0x4e9672);}})['then'](respondWithResult(_0xc1632,null))['catch'](handleError(_0xc1632,null));};exports[_0x3071('0x89')]=function(_0x5da7bc,_0x4d4519,_0x3c617e){return db['CmList'][_0x3071('0x4d')]({'where':{'id':_0x5da7bc[_0x3071('0x4a')]['id']}})[_0x3071('0x2a')](handleEntityNotFound(_0x4d4519,null))['then'](function(_0x16b566){if(_0x16b566){return _0x16b566['addAgents'](_0x5da7bc['body'][_0x3071('0x5d')],_[_0x3071('0x65')](_0x5da7bc[_0x3071('0x4f')],[_0x3071('0x5d'),'id'])||{})[_0x3071('0x8a')](function(_0x38b2c5){for(var _0x3d396d=0x0;_0x3d396d<_0x5da7bc['body'][_0x3071('0x5d')][_0x3071('0x4b')];_0x3d396d+=0x1){socket[_0x3071('0x8b')](_0x3071('0x8c'),{'UserId':_0x5da7bc[_0x3071('0x4f')][_0x3071('0x5d')][_0x3d396d],'CmListId':_0x5da7bc[_0x3071('0x4a')]['id']});}return _0x38b2c5;});}})[_0x3071('0x2a')](respondWithResult(_0x4d4519,null))[_0x3071('0x48')](handleError(_0x4d4519,null));};exports['removeAgents']=function(_0x12765c,_0x149dae,_0x32a43f){return db[_0x3071('0x45')][_0x3071('0x4d')]({'where':{'id':_0x12765c[_0x3071('0x4a')]['id']}})[_0x3071('0x2a')](handleEntityNotFound(_0x149dae,null))['then'](function(_0x2b6fca){if(_0x2b6fca){return _0x2b6fca['removeAgents'](_0x12765c[_0x3071('0x37')][_0x3071('0x5d')])[_0x3071('0x2a')](function(){if(_['isArray'](_0x12765c['query']['ids'])){for(var _0x475047=0x0;_0x475047<_0x12765c[_0x3071('0x37')][_0x3071('0x5d')]['length'];_0x475047+=0x1){socket[_0x3071('0x8b')](_0x3071('0x8d'),{'UserId':Number(_0x12765c[_0x3071('0x37')][_0x3071('0x5d')][_0x475047]),'CmListId':Number(_0x12765c[_0x3071('0x4a')]['id'])});}}else{socket[_0x3071('0x8b')](_0x3071('0x8d'),{'UserId':Number(_0x12765c[_0x3071('0x37')][_0x3071('0x5d')]),'CmListId':Number(_0x12765c['params']['id'])});}});}})[_0x3071('0x2a')](respondWithStatusCode(_0x149dae,null))[_0x3071('0x48')](handleError(_0x149dae,null));};exports[_0x3071('0x8e')]=function(_0x5048ca,_0x34181c,_0x1f9c91){var _0x3cacc1={};var _0x3b5c46={};var _0x3b5619;var _0x1cc091;return db[_0x3071('0x45')][_0x3071('0x5a')]({'where':{'id':_0x5048ca[_0x3071('0x4a')]['id']}})[_0x3071('0x2a')](handleEntityNotFound(_0x34181c,null))[_0x3071('0x2a')](function(_0x1dd796){if(_0x1dd796){_0x3b5619=_0x1dd796;_0x3b5c46['model']=_[_0x3071('0x36')](db[_0x3071('0x8f')]['rawAttributes']);_0x3b5c46['query']=_['keys'](_0x5048ca['query']);_0x3b5c46[_0x3071('0x38')]=_[_0x3071('0x39')](_0x3b5c46['model'],_0x3b5c46[_0x3071('0x37')]);_0x3cacc1[_0x3071('0x3a')]=_[_0x3071('0x39')](_0x3b5c46[_0x3071('0x34')],qs[_0x3071('0x3b')](_0x5048ca[_0x3071('0x37')][_0x3071('0x3b')]));_0x3cacc1[_0x3071('0x3a')]=_0x3cacc1[_0x3071('0x3a')][_0x3071('0x4b')]?_0x3cacc1[_0x3071('0x3a')]:_0x3b5c46[_0x3071('0x34')];_0x3cacc1[_0x3071('0x3f')]=qs['sort'](_0x5048ca[_0x3071('0x37')][_0x3071('0x40')]);_0x3cacc1['where']=qs[_0x3071('0x38')](_[_0x3071('0x6d')](_0x5048ca[_0x3071('0x37')],_0x3b5c46[_0x3071('0x38')]));if(_0x5048ca['query'][_0x3071('0x43')]){_0x3cacc1[_0x3071('0x41')]=_[_0x3071('0x42')](_0x3cacc1[_0x3071('0x41')],{'$or':_['map'](_0x3cacc1['attributes'],function(_0x1afce9){var _0x370797={};_0x370797[_0x1afce9]={'$like':'%'+_0x5048ca[_0x3071('0x37')][_0x3071('0x43')]+'%'};return _0x370797;})});}_0x3cacc1=_[_0x3071('0x42')]({},_0x3cacc1,_0x5048ca[_0x3071('0x44')]);return _0x3b5619[_0x3071('0x8e')](_0x3cacc1);}})[_0x3071('0x2a')](function(_0x4d2992){if(_0x4d2992){_0x1cc091=_0x4d2992[_0x3071('0x4b')];if(!_0x5048ca['query']['hasOwnProperty'](_0x3071('0x3d'))){_0x3cacc1[_0x3071('0x3e')]=qs['limit'](_0x5048ca['query'][_0x3071('0x3e')]);_0x3cacc1[_0x3071('0x22')]=qs[_0x3071('0x22')](_0x5048ca[_0x3071('0x37')]['offset']);}return _0x3b5619[_0x3071('0x8e')](_0x3cacc1);}})[_0x3071('0x2a')](function(_0x2bb0eb){if(_0x2bb0eb){return _0x2bb0eb?{'count':_0x1cc091,'rows':_0x2bb0eb}:null;}})[_0x3071('0x2a')](respondWithResult(_0x34181c,null))[_0x3071('0x48')](handleError(_0x34181c,null));}; \ No newline at end of file +var _0x0713=['cm_contacts','format','getCustomFields','addAgents','spread','emit','userCmList:save','userCmList:remove','getAgents','User','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','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./cmList.socket','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','get','Lists','error','stack','name','send','index','fieldName','key','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','merge','filter','options','CmList','findAll','rows','catch','show','params','length','include','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','Disposition','getDispositions','findOne','ListId','removeDispositions','ids','addContacts','CmContact','tags','isArray','join','push','each','omit','dataValues','errors','message','Malformed\x20request\x20syntax','CmCustomField','CustomFields','rawAttributes','pick','cf_%d','raw','getContacts','now','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','setHeader','Content-type','text/csv','download','/tmp/list_%d_%s.csv','addCustomField','transaction','addCustomFields','Sequelize','type','text','TEXT','number','switch','sequelize','queryInterface','addColumn'];(function(_0xcf58b6,_0x5a439f){var _0x3bf265=function(_0x3102eb){while(--_0x3102eb){_0xcf58b6['push'](_0xcf58b6['shift']());}};_0x3bf265(++_0x5a439f);}(_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'];config[_0x3071('0x1a')]=_['defaults'](config['redis'],{'host':_0x3071('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3071('0x1a')]));require(_0x3071('0x1c'))['register'](socket);function respondWithStatusCode(_0x104e73,_0x4e1219){_0x4e1219=_0x4e1219||0xcc;return function(_0x2fc15d){if(_0x2fc15d){return _0x104e73[_0x3071('0x1d')](_0x4e1219);}return _0x104e73[_0x3071('0x1e')](_0x4e1219)[_0x3071('0x1f')]();};}function respondWithResult(_0x1caa5d,_0x2a6a4b){_0x2a6a4b=_0x2a6a4b||0xc8;return function(_0x157a47){if(_0x157a47){return _0x1caa5d[_0x3071('0x1e')](_0x2a6a4b)[_0x3071('0x20')](_0x157a47);}};}function respondWithFilteredResult(_0x344ea6,_0x5f3c22){return function(_0x224996){if(_0x224996){var _0x17dbda=_0x224996[_0x3071('0x21')],_0x1068d9=_0x5f3c22[_0x3071('0x22')],_0x108a83=_0x5f3c22[_0x3071('0x22')]+_0x5f3c22['limit'],_0x3acf0e;if(_0x108a83>=_0x17dbda){_0x108a83=_0x17dbda;_0x3acf0e=0xc8;}else{_0x3acf0e=0xce;}_0x344ea6[_0x3071('0x1e')](_0x3acf0e);return _0x344ea6[_0x3071('0x23')](_0x3071('0x24'),_0x1068d9+'-'+_0x108a83+'/'+_0x17dbda)['json'](_0x224996);}return null;};}function patchUpdates(_0xb8f4e3){return function(_0x5cd80d){try{jsonpatch[_0x3071('0x25')](_0x5cd80d,_0xb8f4e3,!![]);}catch(_0x43128c){return BPromise[_0x3071('0x26')](_0x43128c);}return _0x5cd80d[_0x3071('0x27')]();};}function saveUpdates(_0x33090c,_0x34c50e){return function(_0x3c5cef){if(_0x3c5cef){return _0x3c5cef[_0x3071('0x28')](_0x33090c)['then'](function(_0x481a51){return _0x481a51;});}return null;};}function removeEntity(_0x2ce48a,_0xb05b1d){return function(_0x412652){if(_0x412652){return _0x412652[_0x3071('0x29')]()[_0x3071('0x2a')](function(){var _0x44b45f=_0x412652[_0x3071('0x2b')]({'plain':!![]});var _0x1fe727=_0x3071('0x2c');return db['UserProfileResource'][_0x3071('0x29')]({'where':{'type':_0x1fe727,'resourceId':_0x44b45f['id']}})[_0x3071('0x2a')](function(){return _0x412652;});})[_0x3071('0x2a')](function(){_0x2ce48a['status'](0xcc)[_0x3071('0x1f')]();});}};}function handleEntityNotFound(_0x28792d,_0x163604){return function(_0x950fde){if(!_0x950fde){_0x28792d[_0x3071('0x1d')](0x194);}return _0x950fde;};}function handleError(_0x25b96b,_0x177b5f){_0x177b5f=_0x177b5f||0x1f4;return function(_0x3921a1){logger[_0x3071('0x2d')](_0x3921a1[_0x3071('0x2e')]);if(_0x3921a1[_0x3071('0x2f')]){delete _0x3921a1['name'];}_0x25b96b['status'](_0x177b5f)[_0x3071('0x30')](_0x3921a1);};}exports[_0x3071('0x31')]=function(_0x6ddf96,_0x40be95){var _0x3f6d90={},_0x29538c={},_0x32b6b1={'count':0x0,'rows':[]};var _0x1ccc41=_['map'](db['CmList']['rawAttributes'],function(_0x1b0aaf){return{'name':_0x1b0aaf[_0x3071('0x32')],'type':_0x1b0aaf['type'][_0x3071('0x33')]};});_0x29538c[_0x3071('0x34')]=_[_0x3071('0x35')](_0x1ccc41,_0x3071('0x2f'));_0x29538c['query']=_[_0x3071('0x36')](_0x6ddf96[_0x3071('0x37')]);_0x29538c[_0x3071('0x38')]=_[_0x3071('0x39')](_0x29538c[_0x3071('0x34')],_0x29538c[_0x3071('0x37')]);_0x3f6d90[_0x3071('0x3a')]=_[_0x3071('0x39')](_0x29538c['model'],qs[_0x3071('0x3b')](_0x6ddf96['query']['fields']));_0x3f6d90[_0x3071('0x3a')]=_0x3f6d90[_0x3071('0x3a')]['length']?_0x3f6d90[_0x3071('0x3a')]:_0x29538c[_0x3071('0x34')];if(!_0x6ddf96[_0x3071('0x37')][_0x3071('0x3c')](_0x3071('0x3d'))){_0x3f6d90[_0x3071('0x3e')]=qs['limit'](_0x6ddf96[_0x3071('0x37')][_0x3071('0x3e')]);_0x3f6d90['offset']=qs[_0x3071('0x22')](_0x6ddf96['query'][_0x3071('0x22')]);}_0x3f6d90[_0x3071('0x3f')]=qs['sort'](_0x6ddf96['query'][_0x3071('0x40')]);_0x3f6d90[_0x3071('0x41')]=qs[_0x3071('0x38')](_['pick'](_0x6ddf96[_0x3071('0x37')],_0x29538c['filters']));if(_0x6ddf96[_0x3071('0x37')]['filter']){_0x3f6d90[_0x3071('0x41')]=_[_0x3071('0x42')](_0x3f6d90[_0x3071('0x41')],{'$or':_[_0x3071('0x35')](_0x1ccc41,function(_0x30ab68){if(_0x30ab68['type']!=='VIRTUAL'){var _0x4337eb={};_0x4337eb[_0x30ab68[_0x3071('0x2f')]]={'$like':'%'+_0x6ddf96[_0x3071('0x37')][_0x3071('0x43')]+'%'};return _0x4337eb;}})});}_0x3f6d90=_['merge']({},_0x3f6d90,_0x6ddf96[_0x3071('0x44')]);var _0x60549a={'where':_0x3f6d90[_0x3071('0x41')]};return db[_0x3071('0x45')][_0x3071('0x21')](_0x60549a)[_0x3071('0x2a')](function(_0x56a9d8){_0x32b6b1[_0x3071('0x21')]=_0x56a9d8;if(_0x6ddf96['query']['includeAll']){_0x3f6d90['include']=[{'all':!![]}];}return db['CmList'][_0x3071('0x46')](_0x3f6d90);})[_0x3071('0x2a')](function(_0x67b2fb){_0x32b6b1[_0x3071('0x47')]=_0x67b2fb;return _0x32b6b1;})[_0x3071('0x2a')](respondWithFilteredResult(_0x40be95,_0x3f6d90))[_0x3071('0x48')](handleError(_0x40be95,null));};exports[_0x3071('0x49')]=function(_0x2e6c70,_0x56589e){var _0x1e8222={'raw':![],'where':{'id':_0x2e6c70[_0x3071('0x4a')]['id']}},_0x1641d9={};_0x1641d9[_0x3071('0x34')]=_[_0x3071('0x36')](db['CmList']['rawAttributes']);_0x1641d9[_0x3071('0x37')]=_[_0x3071('0x36')](_0x2e6c70[_0x3071('0x37')]);_0x1641d9[_0x3071('0x38')]=_[_0x3071('0x39')](_0x1641d9['model'],_0x1641d9[_0x3071('0x37')]);_0x1e8222['attributes']=_[_0x3071('0x39')](_0x1641d9['model'],qs['fields'](_0x2e6c70[_0x3071('0x37')]['fields']));_0x1e8222[_0x3071('0x3a')]=_0x1e8222['attributes'][_0x3071('0x4b')]?_0x1e8222[_0x3071('0x3a')]:_0x1641d9[_0x3071('0x34')];if(_0x2e6c70[_0x3071('0x37')]['includeAll']){_0x1e8222[_0x3071('0x4c')]=[{'all':!![]}];}_0x1e8222=_['merge']({},_0x1e8222,_0x2e6c70[_0x3071('0x44')]);return db['CmList'][_0x3071('0x4d')](_0x1e8222)[_0x3071('0x2a')](handleEntityNotFound(_0x56589e,null))['then'](respondWithResult(_0x56589e,null))[_0x3071('0x48')](handleError(_0x56589e,null));};exports[_0x3071('0x4e')]=function(_0x224a70,_0x38bcc2){return db[_0x3071('0x45')][_0x3071('0x4e')](_0x224a70[_0x3071('0x4f')],{})['then'](function(_0x2c6e4c){var _0x486b7a=_0x224a70[_0x3071('0x50')][_0x3071('0x2b')]({'plain':!![]});if(!_0x486b7a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x486b7a[_0x3071('0x51')]===_0x3071('0x50')){var _0x1b832e=_0x2c6e4c[_0x3071('0x2b')]({'plain':!![]});var _0x22aade=_0x3071('0x2c');return db[_0x3071('0x52')][_0x3071('0x4d')]({'where':{'name':_0x22aade,'userProfileId':_0x486b7a[_0x3071('0x53')]},'raw':!![]})[_0x3071('0x2a')](function(_0x4371e7){if(_0x4371e7&&_0x4371e7[_0x3071('0x54')]===0x0){return db[_0x3071('0x55')][_0x3071('0x4e')]({'name':_0x1b832e[_0x3071('0x2f')],'resourceId':_0x1b832e['id'],'type':_0x4371e7[_0x3071('0x2f')],'sectionId':_0x4371e7['id']},{})['then'](function(){return _0x2c6e4c;});}else{return _0x2c6e4c;}})['catch'](function(_0x12536d){logger['error'](_0x3071('0x56'),_0x12536d);throw _0x12536d;});}return _0x2c6e4c;})[_0x3071('0x2a')](respondWithResult(_0x38bcc2,0xc9))[_0x3071('0x48')](handleError(_0x38bcc2,null));};exports['update']=function(_0x1ec428,_0x1ada95){if(_0x1ec428['body']['id']){delete _0x1ec428['body']['id'];}return db[_0x3071('0x45')][_0x3071('0x4d')]({'where':{'id':_0x1ec428[_0x3071('0x4a')]['id']}})[_0x3071('0x2a')](handleEntityNotFound(_0x1ada95,null))['then'](saveUpdates(_0x1ec428[_0x3071('0x4f')],null))[_0x3071('0x2a')](respondWithResult(_0x1ada95,null))[_0x3071('0x48')](handleError(_0x1ada95,null));};exports[_0x3071('0x29')]=function(_0x123323,_0x5206bd){return db[_0x3071('0x45')][_0x3071('0x4d')]({'where':{'id':_0x123323[_0x3071('0x4a')]['id']}})[_0x3071('0x2a')](handleEntityNotFound(_0x5206bd,null))[_0x3071('0x2a')](removeEntity(_0x5206bd,null))[_0x3071('0x48')](handleError(_0x5206bd,null));};exports[_0x3071('0x57')]=function(_0x4bea5d,_0x4d6ed0){return db[_0x3071('0x45')]['describe']()[_0x3071('0x2a')](respondWithResult(_0x4d6ed0,null))[_0x3071('0x48')](handleError(_0x4d6ed0,null));};exports['addDisposition']=function(_0x19dc95,_0x1bf911,_0x4d3886){if(_0x19dc95[_0x3071('0x4f')]['id']){delete _0x19dc95[_0x3071('0x4f')]['id'];}return db[_0x3071('0x45')][_0x3071('0x4d')]({'where':{'id':_0x19dc95[_0x3071('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1bf911,null))[_0x3071('0x2a')](function(_0x313a54){if(_0x313a54){_0x19dc95[_0x3071('0x4f')]['ListId']=_0x313a54['id'];return db[_0x3071('0x58')][_0x3071('0x4e')](_0x19dc95[_0x3071('0x4f')]);}})[_0x3071('0x2a')](respondWithResult(_0x1bf911,null))[_0x3071('0x48')](handleError(_0x1bf911,null));};exports[_0x3071('0x59')]=function(_0xe93f28,_0x2e39ff,_0x3b47e8){var _0x5cb3b3={'raw':![],'where':{}};var _0x5d1316={};var _0x29a58e={'count':0x0,'rows':[]};return db[_0x3071('0x45')][_0x3071('0x5a')]({'where':{'id':_0xe93f28[_0x3071('0x4a')]['id']}})[_0x3071('0x2a')](handleEntityNotFound(_0x2e39ff,null))[_0x3071('0x2a')](function(_0x287974){if(_0x287974){_0x5d1316[_0x3071('0x34')]=_[_0x3071('0x36')](db[_0x3071('0x58')]['rawAttributes']);_0x5d1316[_0x3071('0x37')]=_[_0x3071('0x36')](_0xe93f28[_0x3071('0x37')]);_0x5d1316[_0x3071('0x38')]=_[_0x3071('0x39')](_0x5d1316[_0x3071('0x34')],_0x5d1316[_0x3071('0x37')]);_0x5cb3b3[_0x3071('0x3a')]=_['intersection'](_0x5d1316[_0x3071('0x34')],qs[_0x3071('0x3b')](_0xe93f28['query']['fields']));_0x5cb3b3[_0x3071('0x3a')]=_0x5cb3b3[_0x3071('0x3a')][_0x3071('0x4b')]?_0x5cb3b3[_0x3071('0x3a')]:_0x5d1316['model'];if(!_0xe93f28['query'][_0x3071('0x3c')]('nolimit')){_0x5cb3b3['limit']=qs['limit'](_0xe93f28['query'][_0x3071('0x3e')]);_0x5cb3b3[_0x3071('0x22')]=qs[_0x3071('0x22')](_0xe93f28['query'][_0x3071('0x22')]);}_0x5cb3b3[_0x3071('0x3f')]=qs[_0x3071('0x40')](_0xe93f28[_0x3071('0x37')]['sort']);_0x5cb3b3[_0x3071('0x41')]=qs[_0x3071('0x38')](_['pick'](_0xe93f28[_0x3071('0x37')],_0x5d1316[_0x3071('0x38')]));_0x5cb3b3[_0x3071('0x41')][_0x3071('0x5b')]=_0x287974['id'];if(_0xe93f28[_0x3071('0x37')][_0x3071('0x43')]){_0x5cb3b3[_0x3071('0x41')]=_['merge'](_0x5cb3b3['where'],{'$or':_[_0x3071('0x35')](_0x5cb3b3[_0x3071('0x3a')],function(_0x1456ce){var _0x4bf839={};_0x4bf839[_0x1456ce]={'$like':'%'+_0xe93f28['query'][_0x3071('0x43')]+'%'};return _0x4bf839;})});}_0x5cb3b3=_[_0x3071('0x42')]({},_0x5cb3b3,_0xe93f28[_0x3071('0x44')]);return db[_0x3071('0x58')][_0x3071('0x21')]({'where':_0x5cb3b3[_0x3071('0x41')]})[_0x3071('0x2a')](function(_0x268657){_0x29a58e['count']=_0x268657;if(_0xe93f28[_0x3071('0x37')]['includeAll']){_0x5cb3b3[_0x3071('0x4c')]=[{'all':!![]}];}return db[_0x3071('0x58')][_0x3071('0x46')](_0x5cb3b3);})[_0x3071('0x2a')](function(_0x37cec5){_0x29a58e[_0x3071('0x47')]=_0x37cec5;return _0x29a58e;});}})[_0x3071('0x2a')](respondWithFilteredResult(_0x2e39ff,_0x5cb3b3))[_0x3071('0x48')](handleError(_0x2e39ff,null));};exports['removeDispositions']=function(_0x20dff9,_0x138a94,_0x1da477){return db['CmList'][_0x3071('0x4d')]({'where':{'id':_0x20dff9[_0x3071('0x4a')]['id']}})[_0x3071('0x2a')](handleEntityNotFound(_0x138a94,null))['then'](function(_0x521ee6){if(_0x521ee6){return _0x521ee6[_0x3071('0x5c')](_0x20dff9['query'][_0x3071('0x5d')]);}})[_0x3071('0x2a')](respondWithStatusCode(_0x138a94,null))[_0x3071('0x48')](handleError(_0x138a94,null));};exports[_0x3071('0x5e')]=function(_0x311939,_0x437098,_0x242665){return db['CmList'][_0x3071('0x4d')]({'where':{'id':_0x311939[_0x3071('0x4a')]['id']}})[_0x3071('0x2a')](handleEntityNotFound(_0x437098,null))[_0x3071('0x2a')](function(_0x98d0fb){if(_0x98d0fb){var _0x1fea60=[];var _0x435dcb={'success':[],'errors':[]};return db[_0x3071('0x5f')]['describe']()[_0x3071('0x2a')](function(_0x5ed436){if(_0x311939[_0x3071('0x4f')][_0x3071('0x60')]&&_[_0x3071('0x61')](_0x311939[_0x3071('0x4f')][_0x3071('0x60')])){if(_0x311939[_0x3071('0x4f')][_0x3071('0x60')][_0x3071('0x4b')]){_0x311939[_0x3071('0x4f')][_0x3071('0x60')]=_0x311939['body'][_0x3071('0x60')][_0x3071('0x62')](';')+';';}else{_0x311939['body'][_0x3071('0x60')]=null;}}else{_0x311939[_0x3071('0x4f')][_0x3071('0x60')]=null;}if(_0x311939[_0x3071('0x4f')]&&_[_0x3071('0x61')](_0x311939['body'])){for(var _0x5a7d28=0x0;_0x5a7d28<_0x311939[_0x3071('0x4f')]['length'];_0x5a7d28+=0x1){_0x311939[_0x3071('0x4f')][_0x5a7d28][_0x3071('0x5b')]=_0x311939[_0x3071('0x4a')]['id'];_0x1fea60[_0x3071('0x63')](_0x311939[_0x3071('0x4f')][_0x5a7d28]);}return BPromise[_0x3071('0x64')](_0x1fea60,function(_0x568386){return db[_0x3071('0x5f')][_0x3071('0x4e')](_[_0x3071('0x65')](_0x568386,[_0x3071('0x5d'),'id'])||{},{'fields':_['keys'](_0x5ed436),'raw':!![]})[_0x3071('0x2a')](function(_0x446546){_0x435dcb['success'][_0x3071('0x63')](_0x446546[_0x3071('0x66')]);})[_0x3071('0x48')](function(_0x10bc5b){_0x435dcb[_0x3071('0x67')]['push']({'data':_0x568386,'error':_0x10bc5b[_0x3071('0x68')]});});})['then'](function(_0x34b88b){return _0x435dcb;})[_0x3071('0x48')](function(_0x39060f){return _0x39060f;});}else{_0x437098[_0x3071('0x1e')](0x190)[_0x3071('0x20')]({'message':_0x3071('0x69')});}});}})[_0x3071('0x2a')](respondWithResult(_0x437098,null))[_0x3071('0x48')](handleError(_0x437098,null));};exports['getContacts']=function(_0x2868c2,_0x3efa3c,_0x459653){var _0x4dfb45;return db[_0x3071('0x45')]['find']({'where':{'id':_0x2868c2[_0x3071('0x4a')]['id']},'include':[{'model':db[_0x3071('0x6a')],'as':_0x3071('0x6b')}]})['then'](handleEntityNotFound(_0x3efa3c,null))[_0x3071('0x2a')](function(_0x2ef706){if(_0x2ef706){_0x4dfb45=_0x2ef706;return db[_0x3071('0x5f')][_0x3071('0x6c')];}})[_0x3071('0x2a')](function(_0x2e5f09){if(_0x2e5f09){var _0x12c700={};var _0x2c7749={};_0x2c7749[_0x3071('0x34')]=_['concat'](_[_0x3071('0x36')](_0x2e5f09),_[_0x3071('0x35')](_0x4dfb45[_0x3071('0x6b')],function(_0x5b2830){return util['format']('cf_%d',_0x5b2830['id']);}));_0x2c7749['query']=_['keys'](_0x2868c2[_0x3071('0x37')]);_0x2c7749[_0x3071('0x38')]=_['intersection'](_0x2c7749[_0x3071('0x34')],_0x2c7749[_0x3071('0x37')]);_0x12c700[_0x3071('0x3a')]=_['intersection'](_0x2c7749['model'],qs[_0x3071('0x3b')](_0x2868c2[_0x3071('0x37')][_0x3071('0x3b')]));_0x12c700[_0x3071('0x3a')]=_0x12c700[_0x3071('0x3a')][_0x3071('0x4b')]?_0x12c700[_0x3071('0x3a')]:_0x2c7749['model'];if(!_0x2868c2['query'][_0x3071('0x3c')](_0x3071('0x3d'))){_0x12c700[_0x3071('0x3e')]=qs[_0x3071('0x3e')](_0x2868c2['query'][_0x3071('0x3e')]);_0x12c700[_0x3071('0x22')]=qs[_0x3071('0x22')](_0x2868c2[_0x3071('0x37')][_0x3071('0x22')]);}_0x12c700[_0x3071('0x3f')]=qs[_0x3071('0x40')](_0x2868c2[_0x3071('0x37')]['sort']);_0x12c700[_0x3071('0x41')]=qs[_0x3071('0x38')](_[_0x3071('0x6d')](_0x2868c2[_0x3071('0x37')],_0x2c7749[_0x3071('0x38')]));_0x12c700['raw']=!![];if(_0x2868c2[_0x3071('0x37')]['filter']){_0x12c700['where']=_[_0x3071('0x42')](_0x12c700[_0x3071('0x41')],{'$or':_[_0x3071('0x35')](_0x12c700['attributes'],function(_0x262bca){var _0x1791bc={};_0x1791bc[_0x262bca]={'$like':'%'+_0x2868c2[_0x3071('0x37')][_0x3071('0x43')]+'%'};return _0x1791bc;})});}_0x12c700=_[_0x3071('0x42')]({},_0x12c700,_0x2868c2['options']);return _0x4dfb45['getContacts'](_0x12c700);}})[_0x3071('0x2a')](respondWithResult(_0x3efa3c,null))[_0x3071('0x48')](handleError(_0x3efa3c,null));};exports['getContactsCsv']=function(_0x3ae39b,_0x141122,_0x22e484){var _0x2d559a;return db[_0x3071('0x45')]['find']({'where':{'id':_0x3ae39b[_0x3071('0x4a')]['id']},'include':[{'model':db['CmCustomField'],'as':_0x3071('0x6b')}]})[_0x3071('0x2a')](handleEntityNotFound(_0x141122,null))['then'](function(_0x279525){if(_0x279525){_0x2d559a=_0x279525;return db['CmContact'][_0x3071('0x6c')];}})[_0x3071('0x2a')](function(_0x408ace){if(_0x408ace){var _0x2f36b1={};var _0x5a19b5={};_0x5a19b5[_0x3071('0x34')]=_['concat'](_[_0x3071('0x36')](_0x408ace),_['map'](_0x2d559a[_0x3071('0x6b')],function(_0x3ce867){return util['format'](_0x3071('0x6e'),_0x3ce867['id']);}));_0x5a19b5[_0x3071('0x37')]=_['keys'](_0x3ae39b[_0x3071('0x37')]);_0x5a19b5[_0x3071('0x38')]=_[_0x3071('0x39')](_0x5a19b5[_0x3071('0x34')],_0x5a19b5[_0x3071('0x37')]);_0x2f36b1[_0x3071('0x3a')]=_[_0x3071('0x39')](_0x5a19b5[_0x3071('0x34')],qs[_0x3071('0x3b')](_0x3ae39b[_0x3071('0x37')][_0x3071('0x3b')]));_0x2f36b1[_0x3071('0x3a')]=_0x2f36b1[_0x3071('0x3a')][_0x3071('0x4b')]?_0x2f36b1[_0x3071('0x3a')]:_0x5a19b5['model'];if(!_0x3ae39b[_0x3071('0x37')][_0x3071('0x3c')](_0x3071('0x3d'))){_0x2f36b1[_0x3071('0x3e')]=qs[_0x3071('0x3e')](_0x3ae39b['query']['limit']);_0x2f36b1[_0x3071('0x22')]=qs[_0x3071('0x22')](_0x3ae39b['query'][_0x3071('0x22')]);}_0x2f36b1[_0x3071('0x3f')]=qs['sort'](_0x3ae39b[_0x3071('0x37')][_0x3071('0x40')]);_0x2f36b1[_0x3071('0x41')]=qs[_0x3071('0x38')](_[_0x3071('0x6d')](_0x3ae39b[_0x3071('0x37')],_0x5a19b5[_0x3071('0x38')]));_0x2f36b1[_0x3071('0x6f')]=!![];if(_0x3ae39b[_0x3071('0x37')][_0x3071('0x43')]){_0x2f36b1['where']=_[_0x3071('0x42')](_0x2f36b1['where'],{'$or':_[_0x3071('0x35')](_0x2f36b1[_0x3071('0x3a')],function(_0x46ab46){var _0x3d4d6b={};_0x3d4d6b[_0x46ab46]={'$like':'%'+_0x3ae39b['query']['filter']+'%'};return _0x3d4d6b;})});}_0x2f36b1=_['merge']({},_0x2f36b1,_0x3ae39b[_0x3071('0x44')]);return _0x2d559a[_0x3071('0x70')](_0x2f36b1);}})[_0x3071('0x2a')](function(_0x2e729c){if(!_['isEmpty'](_0x2e729c)){var _0x35aef4=toCsv(_0x2e729c);var _0x7c3473=Date[_0x3071('0x71')]();fs['writeFileSync'](util['format']('/tmp/list_%d_%s.csv',_0x2d559a['id'],_0x7c3473),_0x35aef4);_0x141122['setHeader'](_0x3071('0x72'),_0x3071('0x73')+util['format'](_0x3071('0x74'),_0x2d559a['id'],_0x7c3473));_0x141122[_0x3071('0x75')](_0x3071('0x76'),_0x3071('0x77'));return _0x141122[_0x3071('0x78')](util['format'](_0x3071('0x79'),_0x2d559a['id'],_0x7c3473));}else{return _0x141122[_0x3071('0x1d')](0xcc);}})[_0x3071('0x48')](handleError(_0x141122,null));};exports[_0x3071('0x7a')]=function(_0x56d01a,_0x398590,_0x54d194){var _0x2c5bf0;delete _0x56d01a[_0x3071('0x4f')]['id'];return db[_0x3071('0x45')]['findOne']({'where':{'id':_0x56d01a[_0x3071('0x4a')]['id']}})[_0x3071('0x2a')](handleEntityNotFound(_0x398590,null))[_0x3071('0x2a')](function(_0x1e30be){if(_0x1e30be){return db['sequelize'][_0x3071('0x7b')](function(_0xd89eeb){return db[_0x3071('0x6a')][_0x3071('0x4e')](_0x56d01a[_0x3071('0x4f')],{'transaction':_0xd89eeb})['then'](function(_0x57f202){_0x2c5bf0=_0x57f202;return _0x1e30be[_0x3071('0x7c')](_0x57f202,{'transaction':_0xd89eeb});})[_0x3071('0x2a')](function(){var _0x11c32f={'type':db[_0x3071('0x7d')]['TEXT'],'transaction':_0xd89eeb};switch(_0x56d01a['body'][_0x3071('0x7e')]){case _0x3071('0x7f'):_0x11c32f['type']=db[_0x3071('0x7d')][_0x3071('0x80')];break;case _0x3071('0x81'):_0x11c32f['type']=db['Sequelize']['INTEGER'];break;case _0x3071('0x82'):_0x11c32f[_0x3071('0x7e')]=db[_0x3071('0x7d')]['BOOLEAN'];_0x11c32f['defaultValue']=![];break;default:}return db[_0x3071('0x83')][_0x3071('0x84')][_0x3071('0x85')](_0x3071('0x86'),util[_0x3071('0x87')]('cf_%s',_0x2c5bf0['id']),_0x11c32f);})[_0x3071('0x2a')](function(){return _0x2c5bf0;});});}})['then'](respondWithResult(_0x398590,null))[_0x3071('0x48')](handleError(_0x398590,null));};exports[_0x3071('0x88')]=function(_0x294316,_0xc1632,_0x1817a8){var _0x4e9672={};var _0x64220e={};var _0x1919cc;var _0x17b103;return db[_0x3071('0x45')][_0x3071('0x5a')]({'where':{'id':_0x294316[_0x3071('0x4a')]['id']}})[_0x3071('0x2a')](handleEntityNotFound(_0xc1632,null))[_0x3071('0x2a')](function(_0xc6bc56){if(_0xc6bc56){_0x1919cc=_0xc6bc56;_0x64220e[_0x3071('0x34')]=_[_0x3071('0x36')](db['CmCustomField'][_0x3071('0x6c')]);_0x64220e[_0x3071('0x37')]=_[_0x3071('0x36')](_0x294316[_0x3071('0x37')]);_0x64220e['filters']=_[_0x3071('0x39')](_0x64220e['model'],_0x64220e[_0x3071('0x37')]);_0x4e9672[_0x3071('0x3a')]=_[_0x3071('0x39')](_0x64220e[_0x3071('0x34')],qs[_0x3071('0x3b')](_0x294316[_0x3071('0x37')][_0x3071('0x3b')]));_0x4e9672['attributes']=_0x4e9672[_0x3071('0x3a')]['length']?_0x4e9672['attributes']:_0x64220e[_0x3071('0x34')];_0x4e9672[_0x3071('0x3f')]=qs['sort'](_0x294316[_0x3071('0x37')]['sort']);_0x4e9672[_0x3071('0x41')]=qs[_0x3071('0x38')](_[_0x3071('0x6d')](_0x294316[_0x3071('0x37')],_0x64220e[_0x3071('0x38')]));_0x4e9672[_0x3071('0x41')]=_[_0x3071('0x42')](_0x4e9672[_0x3071('0x41')],{'$or':[{'ListId':_0xc6bc56['id']},{'ListId':null}]});if(_0x294316[_0x3071('0x37')][_0x3071('0x43')]){_0x4e9672[_0x3071('0x41')]=_['merge'](_0x4e9672[_0x3071('0x41')],{'$or':_[_0x3071('0x35')](_0x4e9672[_0x3071('0x3a')],function(_0x5f1c3b){var _0x2f7eee={};_0x2f7eee[_0x5f1c3b]={'$like':'%'+_0x294316['query'][_0x3071('0x43')]+'%'};return _0x2f7eee;})});}_0x4e9672=_[_0x3071('0x42')]({},_0x4e9672,_0x294316[_0x3071('0x44')]);return db[_0x3071('0x6a')]['findAndCountAll'](_0x4e9672);}})['then'](respondWithResult(_0xc1632,null))['catch'](handleError(_0xc1632,null));};exports[_0x3071('0x89')]=function(_0x5da7bc,_0x4d4519,_0x3c617e){return db['CmList'][_0x3071('0x4d')]({'where':{'id':_0x5da7bc[_0x3071('0x4a')]['id']}})[_0x3071('0x2a')](handleEntityNotFound(_0x4d4519,null))['then'](function(_0x16b566){if(_0x16b566){return _0x16b566['addAgents'](_0x5da7bc['body'][_0x3071('0x5d')],_[_0x3071('0x65')](_0x5da7bc[_0x3071('0x4f')],[_0x3071('0x5d'),'id'])||{})[_0x3071('0x8a')](function(_0x38b2c5){for(var _0x3d396d=0x0;_0x3d396d<_0x5da7bc['body'][_0x3071('0x5d')][_0x3071('0x4b')];_0x3d396d+=0x1){socket[_0x3071('0x8b')](_0x3071('0x8c'),{'UserId':_0x5da7bc[_0x3071('0x4f')][_0x3071('0x5d')][_0x3d396d],'CmListId':_0x5da7bc[_0x3071('0x4a')]['id']});}return _0x38b2c5;});}})[_0x3071('0x2a')](respondWithResult(_0x4d4519,null))[_0x3071('0x48')](handleError(_0x4d4519,null));};exports['removeAgents']=function(_0x12765c,_0x149dae,_0x32a43f){return db[_0x3071('0x45')][_0x3071('0x4d')]({'where':{'id':_0x12765c[_0x3071('0x4a')]['id']}})[_0x3071('0x2a')](handleEntityNotFound(_0x149dae,null))['then'](function(_0x2b6fca){if(_0x2b6fca){return _0x2b6fca['removeAgents'](_0x12765c[_0x3071('0x37')][_0x3071('0x5d')])[_0x3071('0x2a')](function(){if(_['isArray'](_0x12765c['query']['ids'])){for(var _0x475047=0x0;_0x475047<_0x12765c[_0x3071('0x37')][_0x3071('0x5d')]['length'];_0x475047+=0x1){socket[_0x3071('0x8b')](_0x3071('0x8d'),{'UserId':Number(_0x12765c[_0x3071('0x37')][_0x3071('0x5d')][_0x475047]),'CmListId':Number(_0x12765c[_0x3071('0x4a')]['id'])});}}else{socket[_0x3071('0x8b')](_0x3071('0x8d'),{'UserId':Number(_0x12765c[_0x3071('0x37')][_0x3071('0x5d')]),'CmListId':Number(_0x12765c['params']['id'])});}});}})[_0x3071('0x2a')](respondWithStatusCode(_0x149dae,null))[_0x3071('0x48')](handleError(_0x149dae,null));};exports[_0x3071('0x8e')]=function(_0x5048ca,_0x34181c,_0x1f9c91){var _0x3cacc1={};var _0x3b5c46={};var _0x3b5619;var _0x1cc091;return db[_0x3071('0x45')][_0x3071('0x5a')]({'where':{'id':_0x5048ca[_0x3071('0x4a')]['id']}})[_0x3071('0x2a')](handleEntityNotFound(_0x34181c,null))[_0x3071('0x2a')](function(_0x1dd796){if(_0x1dd796){_0x3b5619=_0x1dd796;_0x3b5c46['model']=_[_0x3071('0x36')](db[_0x3071('0x8f')]['rawAttributes']);_0x3b5c46['query']=_['keys'](_0x5048ca['query']);_0x3b5c46[_0x3071('0x38')]=_[_0x3071('0x39')](_0x3b5c46['model'],_0x3b5c46[_0x3071('0x37')]);_0x3cacc1[_0x3071('0x3a')]=_[_0x3071('0x39')](_0x3b5c46[_0x3071('0x34')],qs[_0x3071('0x3b')](_0x5048ca[_0x3071('0x37')][_0x3071('0x3b')]));_0x3cacc1[_0x3071('0x3a')]=_0x3cacc1[_0x3071('0x3a')][_0x3071('0x4b')]?_0x3cacc1[_0x3071('0x3a')]:_0x3b5c46[_0x3071('0x34')];_0x3cacc1[_0x3071('0x3f')]=qs['sort'](_0x5048ca[_0x3071('0x37')][_0x3071('0x40')]);_0x3cacc1['where']=qs[_0x3071('0x38')](_[_0x3071('0x6d')](_0x5048ca[_0x3071('0x37')],_0x3b5c46[_0x3071('0x38')]));if(_0x5048ca['query'][_0x3071('0x43')]){_0x3cacc1[_0x3071('0x41')]=_[_0x3071('0x42')](_0x3cacc1[_0x3071('0x41')],{'$or':_['map'](_0x3cacc1['attributes'],function(_0x1afce9){var _0x370797={};_0x370797[_0x1afce9]={'$like':'%'+_0x5048ca[_0x3071('0x37')][_0x3071('0x43')]+'%'};return _0x370797;})});}_0x3cacc1=_[_0x3071('0x42')]({},_0x3cacc1,_0x5048ca[_0x3071('0x44')]);return _0x3b5619[_0x3071('0x8e')](_0x3cacc1);}})[_0x3071('0x2a')](function(_0x4d2992){if(_0x4d2992){_0x1cc091=_0x4d2992[_0x3071('0x4b')];if(!_0x5048ca['query']['hasOwnProperty'](_0x3071('0x3d'))){_0x3cacc1[_0x3071('0x3e')]=qs['limit'](_0x5048ca['query'][_0x3071('0x3e')]);_0x3cacc1[_0x3071('0x22')]=qs[_0x3071('0x22')](_0x5048ca[_0x3071('0x37')]['offset']);}return _0x3b5619[_0x3071('0x8e')](_0x3cacc1);}})[_0x3071('0x2a')](function(_0x2bb0eb){if(_0x2bb0eb){return _0x2bb0eb?{'count':_0x1cc091,'rows':_0x2bb0eb}:null;}})[_0x3071('0x2a')](respondWithResult(_0x34181c,null))[_0x3071('0x48')](handleError(_0x34181c,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 793fbd8..f4580f3 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 _0x0686=['setMaxListeners','save','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x142d3e,_0x353e86){var _0x493084=function(_0x14aa15){while(--_0x14aa15){_0x142d3e['push'](_0x142d3e['shift']());}};_0x493084(++_0x353e86);}(_0x0686,0xde));var _0x6068=function(_0x45ac2b,_0x3b996e){_0x45ac2b=_0x45ac2b-0x0;var _0x2640a7=_0x0686[_0x45ac2b];return _0x2640a7;};'use strict';var EventEmitter=require(_0x6068('0x0'));var CmList=require(_0x6068('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents[_0x6068('0x2')](0x0);var events={'afterCreate':_0x6068('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xf03508){return function(_0x82fd02,_0x5097ca,_0xb81ec){CmListEvents[_0x6068('0x4')](_0xf03508+':'+_0x82fd02['id'],_0x82fd02);CmListEvents[_0x6068('0x4')](_0xf03508,_0x82fd02);_0xb81ec(null);};}for(var e in events){if(events[_0x6068('0x5')](e)){var event=events[e];CmList[_0x6068('0x6')](e,emitEvent(event));}}module[_0x6068('0x7')]=CmListEvents; \ No newline at end of file +var _0x7816=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x33f3f8,_0x51b47a){var _0x2122db=function(_0x52fa7e){while(--_0x52fa7e){_0x33f3f8['push'](_0x33f3f8['shift']());}};_0x2122db(++_0x51b47a);}(_0x7816,0xd6));var _0x6781=function(_0x952f0,_0x2fcd7b){_0x952f0=_0x952f0-0x0;var _0x3786ae=_0x7816[_0x952f0];return _0x3786ae;};'use strict';var EventEmitter=require(_0x6781('0x0'));var CmList=require(_0x6781('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents[_0x6781('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6781('0x3'),'afterDestroy':_0x6781('0x4')};function emitEvent(_0x15d67d){return function(_0x1fde12,_0x440cfa,_0x33651a){CmListEvents['emit'](_0x15d67d+':'+_0x1fde12['id'],_0x1fde12);CmListEvents[_0x6781('0x5')](_0x15d67d,_0x1fde12);_0x33651a(null);};}for(var e in events){if(events[_0x6781('0x6')](e)){var event=events[e];CmList[_0x6781('0x7')](e,emitEvent(event));}}module[_0x6781('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 f6ec588..7f004a3 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 _0x3f8e=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./cmList.attributes','exports','CmList','cm_lists','lodash'];(function(_0x4336d8,_0x3dc427){var _0x5e8387=function(_0x1d6ac2){while(--_0x1d6ac2){_0x4336d8['push'](_0x4336d8['shift']());}};_0x5e8387(++_0x3dc427);}(_0x3f8e,0x173));var _0xe3f8=function(_0x497c27,_0x527b22){_0x497c27=_0x497c27-0x0;var _0x503cd7=_0x3f8e[_0x497c27];return _0x503cd7;};'use strict';var _=require(_0xe3f8('0x0'));var util=require('util');var logger=require(_0xe3f8('0x1'))(_0xe3f8('0x2'));var moment=require(_0xe3f8('0x3'));var BPromise=require(_0xe3f8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe3f8('0x5'));var rimraf=require(_0xe3f8('0x6'));var config=require(_0xe3f8('0x7'));var attributes=require(_0xe3f8('0x8'));module[_0xe3f8('0x9')]=function(_0x1fcc76,_0x51ad8f){return _0x1fcc76['define'](_0xe3f8('0xa'),attributes,{'tableName':_0xe3f8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd8c8=['request-promise','../../config/environment','./cmList.attributes','exports','define','CmList','../../config/logger','api','bluebird'];(function(_0x35265e,_0x2ebca2){var _0x4a2c90=function(_0x4c1b40){while(--_0x4c1b40){_0x35265e['push'](_0x35265e['shift']());}};_0x4a2c90(++_0x2ebca2);}(_0xd8c8,0x192));var _0x8d8c=function(_0x3f021b,_0x2eb395){_0x3f021b=_0x3f021b-0x0;var _0x9f8353=_0xd8c8[_0x3f021b];return _0x9f8353;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8d8c('0x0'))(_0x8d8c('0x1'));var moment=require('moment');var BPromise=require(_0x8d8c('0x2'));var rp=require(_0x8d8c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8d8c('0x4'));var attributes=require(_0x8d8c('0x5'));module[_0x8d8c('0x6')]=function(_0x3453a2,_0x55450d){return _0x3453a2[_0x8d8c('0x7')](_0x8d8c('0x8'),attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index e6be480..e63fab0 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 _0x1290=['ioredis','../../mysqldb','../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','./cmList.socket','then','info','CmList,\x20%s,\x20%s','request\x20sent','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x119a92,_0x241f8a){var _0x13e783=function(_0x289eef){while(--_0x289eef){_0x119a92['push'](_0x119a92['shift']());}};_0x13e783(++_0x241f8a);}(_0x1290,0xc3));var _0x0129=function(_0x1bc392,_0x26695f){_0x1bc392=_0x1bc392-0x0;var _0x14d803=_0x1290[_0x1bc392];return _0x14d803;};'use strict';var _=require(_0x0129('0x0'));var util=require(_0x0129('0x1'));var moment=require(_0x0129('0x2'));var BPromise=require(_0x0129('0x3'));var rs=require(_0x0129('0x4'));var fs=require('fs');var Redis=require(_0x0129('0x5'));var db=require(_0x0129('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x0129('0x7'));var jayson=require(_0x0129('0x8'));var client=jayson['client'][_0x0129('0x9')]({'port':0x232a});config['redis']=_[_0x0129('0xa')](config[_0x0129('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x0129('0xc'))(new Redis(config[_0x0129('0xb')]));require(_0x0129('0xd'))['register'](socket);function respondWithRpcPromise(_0x55eaf1,_0xca756c,_0x242f3c){return new BPromise(function(_0x303e64,_0x175bf1){return client['request'](_0x55eaf1,_0x242f3c)[_0x0129('0xe')](function(_0x56f063){logger[_0x0129('0xf')](_0x0129('0x10'),_0xca756c,_0x0129('0x11'));logger['debug'](_0x0129('0x12'),_0xca756c,'request\x20sent',JSON[_0x0129('0x13')](_0x56f063));if(_0x56f063['error']){if(_0x56f063[_0x0129('0x14')][_0x0129('0x15')]===0x1f4){logger[_0x0129('0x14')](_0x0129('0x10'),_0xca756c,_0x56f063['error'][_0x0129('0x16')]);return _0x175bf1(_0x56f063[_0x0129('0x14')][_0x0129('0x16')]);}logger[_0x0129('0x14')]('CmList,\x20%s,\x20%s',_0xca756c,_0x56f063[_0x0129('0x14')][_0x0129('0x16')]);return _0x303e64(_0x56f063[_0x0129('0x14')][_0x0129('0x16')]);}else{logger[_0x0129('0xf')]('CmList,\x20%s,\x20%s',_0xca756c,_0x0129('0x11'));_0x303e64(_0x56f063[_0x0129('0x17')][_0x0129('0x16')]);}})[_0x0129('0x18')](function(_0x5be1e8){logger[_0x0129('0x14')]('CmList,\x20%s,\x20%s',_0xca756c,_0x5be1e8);_0x175bf1(_0x5be1e8);});});} \ No newline at end of file +var _0xe5ce=['CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','defaults','localhost','socket.io-emitter','redis','./cmList.socket','then','info','CmList,\x20%s,\x20%s','request\x20sent'];(function(_0x230929,_0x798f46){var _0x2b123b=function(_0x1a30b4){while(--_0x1a30b4){_0x230929['push'](_0x230929['shift']());}};_0x2b123b(++_0x798f46);}(_0xe5ce,0xeb));var _0xee5c=function(_0x2caaac,_0x5577c0){_0x2caaac=_0x2caaac-0x0;var _0x31f558=_0xe5ce[_0x2caaac];return _0x31f558;};'use strict';var _=require(_0xee5c('0x0'));var util=require(_0xee5c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xee5c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xee5c('0x3'))['db'];var utils=require(_0xee5c('0x4'));var logger=require(_0xee5c('0x5'))('rpc');var config=require(_0xee5c('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xee5c('0x7')][_0xee5c('0x8')]({'port':0x232a});config['redis']=_[_0xee5c('0x9')](config['redis'],{'host':_0xee5c('0xa'),'port':0x18eb});var socket=require(_0xee5c('0xb'))(new Redis(config[_0xee5c('0xc')]));require(_0xee5c('0xd'))['register'](socket);function respondWithRpcPromise(_0x2f4cae,_0x57e24a,_0x3374ae){return new BPromise(function(_0x338a1d,_0xd5d689){return client['request'](_0x2f4cae,_0x3374ae)[_0xee5c('0xe')](function(_0x2b6f9e){logger[_0xee5c('0xf')](_0xee5c('0x10'),_0x57e24a,_0xee5c('0x11'));logger['debug'](_0xee5c('0x12'),_0x57e24a,_0xee5c('0x11'),JSON[_0xee5c('0x13')](_0x2b6f9e));if(_0x2b6f9e[_0xee5c('0x14')]){if(_0x2b6f9e[_0xee5c('0x14')][_0xee5c('0x15')]===0x1f4){logger[_0xee5c('0x14')]('CmList,\x20%s,\x20%s',_0x57e24a,_0x2b6f9e[_0xee5c('0x14')][_0xee5c('0x16')]);return _0xd5d689(_0x2b6f9e['error'][_0xee5c('0x16')]);}logger[_0xee5c('0x14')](_0xee5c('0x10'),_0x57e24a,_0x2b6f9e[_0xee5c('0x14')][_0xee5c('0x16')]);return _0x338a1d(_0x2b6f9e[_0xee5c('0x14')]['message']);}else{logger[_0xee5c('0xf')]('CmList,\x20%s,\x20%s',_0x57e24a,_0xee5c('0x11'));_0x338a1d(_0x2b6f9e['result'][_0xee5c('0x16')]);}})['catch'](function(_0x258ad6){logger[_0xee5c('0x14')](_0xee5c('0x10'),_0x57e24a,_0x258ad6);_0xd5d689(_0x258ad6);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 229a1ac..a9c89ce 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 _0xf4d9=['remove','update','removeListener','cmList:','./cmList.events'];(function(_0x54a761,_0x431fd4){var _0x37d1da=function(_0x5ca617){while(--_0x5ca617){_0x54a761['push'](_0x54a761['shift']());}};_0x37d1da(++_0x431fd4);}(_0xf4d9,0x7c));var _0x9f4d=function(_0x5ac19e,_0x3d632f){_0x5ac19e=_0x5ac19e-0x0;var _0x2a5550=_0xf4d9[_0x5ac19e];return _0x2a5550;};'use strict';var CmListEvents=require(_0x9f4d('0x0'));var events=['save',_0x9f4d('0x1'),_0x9f4d('0x2')];function createListener(_0x35fa60,_0x41bd00){return function(_0x22339e){_0x41bd00['emit'](_0x35fa60,_0x22339e);};}function removeListener(_0x179d90,_0x9ee061){return function(){CmListEvents[_0x9f4d('0x3')](_0x179d90,_0x9ee061);};}exports['register']=function(_0x191f1c){for(var _0x370059=0x0,_0x2d7228=events['length'];_0x370059<_0x2d7228;_0x370059++){var _0x415499=events[_0x370059];var _0x55865b=createListener(_0x9f4d('0x4')+_0x415499,_0x191f1c);CmListEvents['on'](_0x415499,_0x55865b);}}; \ No newline at end of file +var _0x6299=['register','remove','update','emit','removeListener'];(function(_0x4b5444,_0x564948){var _0x69071a=function(_0x118f58){while(--_0x118f58){_0x4b5444['push'](_0x4b5444['shift']());}};_0x69071a(++_0x564948);}(_0x6299,0x169));var _0x9629=function(_0x4f704e,_0x1cd9cb){_0x4f704e=_0x4f704e-0x0;var _0x50f294=_0x6299[_0x4f704e];return _0x50f294;};'use strict';var CmListEvents=require('./cmList.events');var events=['save',_0x9629('0x0'),_0x9629('0x1')];function createListener(_0x3cf1e1,_0x35868a){return function(_0x3c3ab2){_0x35868a[_0x9629('0x2')](_0x3cf1e1,_0x3c3ab2);};}function removeListener(_0x55d4ce,_0x327ee9){return function(){CmListEvents[_0x9629('0x3')](_0x55d4ce,_0x327ee9);};}exports[_0x9629('0x4')]=function(_0x1edc13){for(var _0x1206bf=0x0,_0x5d5981=events['length'];_0x1206bf<_0x5d5981;_0x1206bf++){var _0x2c5ca5=events[_0x1206bf];var _0x1754e6=createListener('cmList:'+_0x2c5ca5,_0x1edc13);CmListEvents['on'](_0x2c5ca5,_0x1754e6);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 70271b6..6ff06bf 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 _0xc3a3=['index','/describe','isAuthenticated','describe','/:id','show','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','/:id/fields','getAgents','post','create','/:id/dispositions','addDisposition','addCustomField','/:id/users','addAgents','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./cmList.controller','get'];(function(_0x36514c,_0x219a5d){var _0x18fa87=function(_0x5f5977){while(--_0x5f5977){_0x36514c['push'](_0x36514c['shift']());}};_0x18fa87(++_0x219a5d);}(_0xc3a3,0x11f));var _0x3c3a=function(_0x4e57a2,_0x585b61){_0x4e57a2=_0x4e57a2-0x0;var _0x31d79f=_0xc3a3[_0x4e57a2];return _0x31d79f;};'use strict';var multer=require(_0x3c3a('0x0'));var util=require(_0x3c3a('0x1'));var path=require(_0x3c3a('0x2'));var timeout=require(_0x3c3a('0x3'));var express=require(_0x3c3a('0x4'));var router=express[_0x3c3a('0x5')]();var auth=require(_0x3c3a('0x6'));var interaction=require(_0x3c3a('0x7'));var config=require('../../config/environment');var controller=require(_0x3c3a('0x8'));router[_0x3c3a('0x9')]('/',auth['isAuthenticated'](),controller[_0x3c3a('0xa')]);router['get'](_0x3c3a('0xb'),auth[_0x3c3a('0xc')](),controller[_0x3c3a('0xd')]);router['get'](_0x3c3a('0xe'),auth['isAuthenticated'](),controller[_0x3c3a('0xf')]);router[_0x3c3a('0x9')]('/:id/dispositions',auth[_0x3c3a('0xc')](),controller[_0x3c3a('0x10')]);router[_0x3c3a('0x9')](_0x3c3a('0x11'),auth[_0x3c3a('0xc')](),controller[_0x3c3a('0x12')]);router[_0x3c3a('0x9')](_0x3c3a('0x13'),auth['isAuthenticated'](),controller['getContactsCsv']);router[_0x3c3a('0x9')](_0x3c3a('0x14'),auth[_0x3c3a('0xc')](),controller['getCustomFields']);router['get']('/:id/users',auth[_0x3c3a('0xc')](),controller[_0x3c3a('0x15')]);router[_0x3c3a('0x16')]('/',auth[_0x3c3a('0xc')](),controller[_0x3c3a('0x17')]);router[_0x3c3a('0x16')](_0x3c3a('0x18'),auth['isAuthenticated'](),controller[_0x3c3a('0x19')]);router['post'](_0x3c3a('0x11'),auth[_0x3c3a('0xc')](),controller['addContacts']);router['post'](_0x3c3a('0x14'),auth[_0x3c3a('0xc')](),controller[_0x3c3a('0x1a')]);router[_0x3c3a('0x16')](_0x3c3a('0x1b'),auth[_0x3c3a('0xc')](),controller[_0x3c3a('0x1c')]);router[_0x3c3a('0x1d')](_0x3c3a('0xe'),auth[_0x3c3a('0xc')](),controller[_0x3c3a('0x1e')]);router[_0x3c3a('0x1f')](_0x3c3a('0xe'),auth[_0x3c3a('0xc')](),controller[_0x3c3a('0x20')]);router[_0x3c3a('0x1f')](_0x3c3a('0x18'),auth[_0x3c3a('0xc')](),controller['removeDispositions']);router[_0x3c3a('0x1f')]('/:id/users',auth[_0x3c3a('0xc')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x9fc1=['get','/describe','describe','/:id','/:id/dispositions','getDispositions','/:id/contacts','getContacts','getContactsCsv','/:id/fields','/:id/users','post','addDisposition','addContacts','addCustomField','addAgents','update','delete','destroy','removeDispositions','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index'];(function(_0x1c1bd0,_0x1dc690){var _0x2154fa=function(_0x119941){while(--_0x119941){_0x1c1bd0['push'](_0x1c1bd0['shift']());}};_0x2154fa(++_0x1dc690);}(_0x9fc1,0xc8));var _0x19fc=function(_0x166e29,_0x8c8631){_0x166e29=_0x166e29-0x0;var _0x5f23b5=_0x9fc1[_0x166e29];return _0x5f23b5;};'use strict';var multer=require(_0x19fc('0x0'));var util=require(_0x19fc('0x1'));var path=require('path');var timeout=require(_0x19fc('0x2'));var express=require(_0x19fc('0x3'));var router=express[_0x19fc('0x4')]();var auth=require(_0x19fc('0x5'));var interaction=require(_0x19fc('0x6'));var config=require(_0x19fc('0x7'));var controller=require('./cmList.controller');router['get']('/',auth[_0x19fc('0x8')](),controller[_0x19fc('0x9')]);router[_0x19fc('0xa')](_0x19fc('0xb'),auth[_0x19fc('0x8')](),controller[_0x19fc('0xc')]);router[_0x19fc('0xa')](_0x19fc('0xd'),auth[_0x19fc('0x8')](),controller['show']);router[_0x19fc('0xa')](_0x19fc('0xe'),auth[_0x19fc('0x8')](),controller[_0x19fc('0xf')]);router[_0x19fc('0xa')](_0x19fc('0x10'),auth['isAuthenticated'](),controller[_0x19fc('0x11')]);router['get']('/:id/contacts/csv',auth[_0x19fc('0x8')](),controller[_0x19fc('0x12')]);router['get'](_0x19fc('0x13'),auth['isAuthenticated'](),controller['getCustomFields']);router[_0x19fc('0xa')](_0x19fc('0x14'),auth[_0x19fc('0x8')](),controller['getAgents']);router[_0x19fc('0x15')]('/',auth[_0x19fc('0x8')](),controller['create']);router['post'](_0x19fc('0xe'),auth['isAuthenticated'](),controller[_0x19fc('0x16')]);router[_0x19fc('0x15')](_0x19fc('0x10'),auth[_0x19fc('0x8')](),controller[_0x19fc('0x17')]);router[_0x19fc('0x15')](_0x19fc('0x13'),auth[_0x19fc('0x8')](),controller[_0x19fc('0x18')]);router[_0x19fc('0x15')](_0x19fc('0x14'),auth[_0x19fc('0x8')](),controller[_0x19fc('0x19')]);router['put']('/:id',auth[_0x19fc('0x8')](),controller[_0x19fc('0x1a')]);router[_0x19fc('0x1b')]('/:id',auth[_0x19fc('0x8')](),controller[_0x19fc('0x1c')]);router['delete'](_0x19fc('0xe'),auth[_0x19fc('0x8')](),controller[_0x19fc('0x1d')]);router[_0x19fc('0x1b')](_0x19fc('0x14'),auth[_0x19fc('0x8')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index faed273..72ad624 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 _0x9957=['field','STRING','sequelize','exports','VIRTUAL'];(function(_0x7f0a5,_0x31502){var _0x559f8f=function(_0x3e08a8){while(--_0x3e08a8){_0x7f0a5['push'](_0x7f0a5['shift']());}};_0x559f8f(++_0x31502);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'name':{'type':Sequelize[_0x7995('0x2')],'get':function(_0x10a05d){return this['getDataValue'](_0x7995('0x3'));}},'field':{'type':Sequelize[_0x7995('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0x7995('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x7995('0x4')],'allowNull':![]}}; \ No newline at end of file +var _0xa9e0=['STRING','sequelize','exports','VIRTUAL','field'];(function(_0x5053f6,_0x28d42d){var _0x3e0ad7=function(_0x494405){while(--_0x494405){_0x5053f6['push'](_0x5053f6['shift']());}};_0x3e0ad7(++_0x28d42d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'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 e0deeca..a6ae3ca 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 _0x868c=['../../mysqldb','end','status','count','offset','limit','set','Content-Range','json','apply','reject','update','destroy','then','error','stack','name','send','body','Condition','find','params','catch','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x19add0,_0x518f03){var _0x49d6f2=function(_0x3211e4){while(--_0x3211e4){_0x19add0['push'](_0x19add0['shift']());}};_0x49d6f2(++_0x518f03);}(_0x868c,0x16e));var _0xc868=function(_0x3d5f84,_0x569548){_0x3d5f84=_0x3d5f84-0x0;var _0x1981b8=_0x868c[_0x3d5f84];return _0x1981b8;};'use strict';var pdf=require(_0xc868('0x0'));var emlformat=require(_0xc868('0x1'));var rimraf=require(_0xc868('0x2'));var zipdir=require(_0xc868('0x3'));var jsonpatch=require(_0xc868('0x4'));var rp=require(_0xc868('0x5'));var moment=require(_0xc868('0x6'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc868('0x7'));var path=require(_0xc868('0x8'));var sox=require('sox');var csv=require(_0xc868('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xc868('0xa'));var squel=require(_0xc868('0xb'));var crypto=require(_0xc868('0xc'));var jsforce=require(_0xc868('0xd'));var deskjs=require(_0xc868('0xe'));var toCsv=require(_0xc868('0x9'));var querystring=require(_0xc868('0xf'));var Papa=require(_0xc868('0x10'));var Redis=require(_0xc868('0x11'));var authService=require(_0xc868('0x12'));var qs=require(_0xc868('0x13'));var as=require(_0xc868('0x14'));var hardwareService=require(_0xc868('0x15'));var logger=require(_0xc868('0x16'))(_0xc868('0x17'));var utils=require(_0xc868('0x18'));var config=require(_0xc868('0x19'));var db=require(_0xc868('0x1a'))['db'];function respondWithStatusCode(_0xb246f1,_0x3c48ec){_0x3c48ec=_0x3c48ec||0xcc;return function(_0x130f42){if(_0x130f42){return _0xb246f1['sendStatus'](_0x3c48ec);}return _0xb246f1['status'](_0x3c48ec)[_0xc868('0x1b')]();};}function respondWithResult(_0x25544d,_0x59ca93){_0x59ca93=_0x59ca93||0xc8;return function(_0x2c8387){if(_0x2c8387){return _0x25544d[_0xc868('0x1c')](_0x59ca93)['json'](_0x2c8387);}};}function respondWithFilteredResult(_0x4b70c2,_0xe7b606){return function(_0x461bb9){if(_0x461bb9){var _0x3273f3=_0x461bb9[_0xc868('0x1d')],_0x4dd4b8=_0xe7b606['offset'],_0x25592c=_0xe7b606[_0xc868('0x1e')]+_0xe7b606[_0xc868('0x1f')],_0x3908c3;if(_0x25592c>=_0x3273f3){_0x25592c=_0x3273f3;_0x3908c3=0xc8;}else{_0x3908c3=0xce;}_0x4b70c2[_0xc868('0x1c')](_0x3908c3);return _0x4b70c2[_0xc868('0x20')](_0xc868('0x21'),_0x4dd4b8+'-'+_0x25592c+'/'+_0x3273f3)[_0xc868('0x22')](_0x461bb9);}return null;};}function patchUpdates(_0x4547e7){return function(_0x179055){try{jsonpatch[_0xc868('0x23')](_0x179055,_0x4547e7,!![]);}catch(_0x3abc53){return BPromise[_0xc868('0x24')](_0x3abc53);}return _0x179055['save']();};}function saveUpdates(_0x49af3a,_0x10a459){return function(_0x56769d){if(_0x56769d){return _0x56769d[_0xc868('0x25')](_0x49af3a)['then'](function(_0x54a826){return _0x54a826;});}return null;};}function removeEntity(_0x109e0e,_0x17d40b){return function(_0x317363){if(_0x317363){return _0x317363[_0xc868('0x26')]()[_0xc868('0x27')](function(){_0x109e0e['status'](0xcc)[_0xc868('0x1b')]();});}};}function handleEntityNotFound(_0x4605fa,_0x2a2562){return function(_0x28f994){if(!_0x28f994){_0x4605fa['sendStatus'](0x194);}return _0x28f994;};}function handleError(_0x4dd2d2,_0x4c7a6d){_0x4c7a6d=_0x4c7a6d||0x1f4;return function(_0x5ab381){logger[_0xc868('0x28')](_0x5ab381[_0xc868('0x29')]);if(_0x5ab381[_0xc868('0x2a')]){delete _0x5ab381['name'];}_0x4dd2d2['status'](_0x4c7a6d)[_0xc868('0x2b')](_0x5ab381);};}exports['update']=function(_0x1074a2,_0x36840d){if(_0x1074a2['body']['id']){delete _0x1074a2[_0xc868('0x2c')]['id'];}return db[_0xc868('0x2d')][_0xc868('0x2e')]({'where':{'id':_0x1074a2[_0xc868('0x2f')]['id']}})[_0xc868('0x27')](handleEntityNotFound(_0x36840d,null))[_0xc868('0x27')](saveUpdates(_0x1074a2[_0xc868('0x2c')],null))[_0xc868('0x27')](respondWithResult(_0x36840d,null))['catch'](handleError(_0x36840d,null));};exports['destroy']=function(_0x94c9e,_0x12a00a){return db[_0xc868('0x2d')]['find']({'where':{'id':_0x94c9e[_0xc868('0x2f')]['id']}})[_0xc868('0x27')](handleEntityNotFound(_0x12a00a,null))[_0xc868('0x27')](removeEntity(_0x12a00a,null))[_0xc868('0x30')](handleError(_0x12a00a,null));}; \ No newline at end of file +var _0x43ea=['util','path','sox','ejs','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','body','find','params','catch','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache'];(function(_0x429339,_0x5ca96b){var _0x2fe735=function(_0x2341cb){while(--_0x2341cb){_0x429339['push'](_0x429339['shift']());}};_0x2fe735(++_0x5ca96b);}(_0x43ea,0x142));var _0xa43e=function(_0x3c9422,_0x48201f){_0x3c9422=_0x3c9422-0x0;var _0x4c51aa=_0x43ea[_0x3c9422];return _0x4c51aa;};'use strict';var pdf=require(_0xa43e('0x0'));var emlformat=require(_0xa43e('0x1'));var rimraf=require(_0xa43e('0x2'));var zipdir=require(_0xa43e('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa43e('0x4'));var moment=require('moment');var BPromise=require(_0xa43e('0x5'));var Mustache=require(_0xa43e('0x6'));var util=require(_0xa43e('0x7'));var path=require(_0xa43e('0x8'));var sox=require(_0xa43e('0x9'));var csv=require('to-csv');var ejs=require(_0xa43e('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xa43e('0xb'));var crypto=require(_0xa43e('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xa43e('0xd'));var toCsv=require(_0xa43e('0xe'));var querystring=require(_0xa43e('0xf'));var Papa=require(_0xa43e('0x10'));var Redis=require(_0xa43e('0x11'));var authService=require(_0xa43e('0x12'));var qs=require(_0xa43e('0x13'));var as=require(_0xa43e('0x14'));var hardwareService=require(_0xa43e('0x15'));var logger=require(_0xa43e('0x16'))('api');var utils=require(_0xa43e('0x17'));var config=require(_0xa43e('0x18'));var db=require(_0xa43e('0x19'))['db'];function respondWithStatusCode(_0x43a3e0,_0x358cdc){_0x358cdc=_0x358cdc||0xcc;return function(_0x348e5f){if(_0x348e5f){return _0x43a3e0[_0xa43e('0x1a')](_0x358cdc);}return _0x43a3e0[_0xa43e('0x1b')](_0x358cdc)['end']();};}function respondWithResult(_0x5060f9,_0x3bbc5b){_0x3bbc5b=_0x3bbc5b||0xc8;return function(_0x53bb31){if(_0x53bb31){return _0x5060f9[_0xa43e('0x1b')](_0x3bbc5b)[_0xa43e('0x1c')](_0x53bb31);}};}function respondWithFilteredResult(_0x377799,_0x4cac60){return function(_0x176db7){if(_0x176db7){var _0x3318fa=_0x176db7[_0xa43e('0x1d')],_0x2355ed=_0x4cac60[_0xa43e('0x1e')],_0x13a51a=_0x4cac60[_0xa43e('0x1e')]+_0x4cac60[_0xa43e('0x1f')],_0x1dd4b2;if(_0x13a51a>=_0x3318fa){_0x13a51a=_0x3318fa;_0x1dd4b2=0xc8;}else{_0x1dd4b2=0xce;}_0x377799[_0xa43e('0x1b')](_0x1dd4b2);return _0x377799[_0xa43e('0x20')](_0xa43e('0x21'),_0x2355ed+'-'+_0x13a51a+'/'+_0x3318fa)[_0xa43e('0x1c')](_0x176db7);}return null;};}function patchUpdates(_0x1e8419){return function(_0x249f49){try{jsonpatch[_0xa43e('0x22')](_0x249f49,_0x1e8419,!![]);}catch(_0x39aaaa){return BPromise[_0xa43e('0x23')](_0x39aaaa);}return _0x249f49['save']();};}function saveUpdates(_0xb71703,_0x43f25e){return function(_0x360aae){if(_0x360aae){return _0x360aae[_0xa43e('0x24')](_0xb71703)[_0xa43e('0x25')](function(_0x11a33c){return _0x11a33c;});}return null;};}function removeEntity(_0x4597ea,_0x1e1ba5){return function(_0x28c476){if(_0x28c476){return _0x28c476[_0xa43e('0x26')]()[_0xa43e('0x25')](function(){_0x4597ea[_0xa43e('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x6e8829,_0x291b64){return function(_0x5ba076){if(!_0x5ba076){_0x6e8829[_0xa43e('0x1a')](0x194);}return _0x5ba076;};}function handleError(_0x2dba5f,_0x2836b2){_0x2836b2=_0x2836b2||0x1f4;return function(_0x5b5f7e){logger[_0xa43e('0x27')](_0x5b5f7e[_0xa43e('0x28')]);if(_0x5b5f7e[_0xa43e('0x29')]){delete _0x5b5f7e[_0xa43e('0x29')];}_0x2dba5f[_0xa43e('0x1b')](_0x2836b2)[_0xa43e('0x2a')](_0x5b5f7e);};}exports['update']=function(_0x51d087,_0x1f33a9){if(_0x51d087[_0xa43e('0x2b')]['id']){delete _0x51d087[_0xa43e('0x2b')]['id'];}return db['Condition'][_0xa43e('0x2c')]({'where':{'id':_0x51d087[_0xa43e('0x2d')]['id']}})['then'](handleEntityNotFound(_0x1f33a9,null))['then'](saveUpdates(_0x51d087[_0xa43e('0x2b')],null))['then'](respondWithResult(_0x1f33a9,null))[_0xa43e('0x2e')](handleError(_0x1f33a9,null));};exports[_0xa43e('0x26')]=function(_0xf61f7,_0x24a242){return db['Condition'][_0xa43e('0x2c')]({'where':{'id':_0xf61f7[_0xa43e('0x2d')]['id']}})[_0xa43e('0x25')](handleEntityNotFound(_0x24a242,null))['then'](removeEntity(_0x24a242,null))[_0xa43e('0x2e')](handleError(_0x24a242,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 8a7268b..5dbe7ec 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 _0x4113=['exports','define','Condition','lodash','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./condition.attributes'];(function(_0x2ea177,_0x143370){var _0x1749ea=function(_0x5dd584){while(--_0x5dd584){_0x2ea177['push'](_0x2ea177['shift']());}};_0x1749ea(++_0x143370);}(_0x4113,0xa8));var _0x3411=function(_0x5de22a,_0xa2ef91){_0x5de22a=_0x5de22a-0x0;var _0x13469e=_0x4113[_0x5de22a];return _0x13469e;};'use strict';var _=require(_0x3411('0x0'));var util=require('util');var logger=require(_0x3411('0x1'))(_0x3411('0x2'));var moment=require('moment');var BPromise=require(_0x3411('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3411('0x4'));var rimraf=require(_0x3411('0x5'));var config=require(_0x3411('0x6'));var attributes=require(_0x3411('0x7'));module[_0x3411('0x8')]=function(_0x5c6d4a,_0x35b15b){return _0x5c6d4a[_0x3411('0x9')](_0x3411('0xa'),attributes,{'tableName':'tools_conditions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x93ef=['bluebird','request-promise','path','rimraf','../../config/environment','./condition.attributes','define','tools_conditions','lodash','../../config/logger','api'];(function(_0x3dbd00,_0x493d67){var _0x2e5a56=function(_0x4a4c0f){while(--_0x4a4c0f){_0x3dbd00['push'](_0x3dbd00['shift']());}};_0x2e5a56(++_0x493d67);}(_0x93ef,0xc3));var _0xf93e=function(_0x8b1d94,_0x35c301){_0x8b1d94=_0x8b1d94-0x0;var _0x4fa0cd=_0x93ef[_0x8b1d94];return _0x4fa0cd;};'use strict';var _=require(_0xf93e('0x0'));var util=require('util');var logger=require(_0xf93e('0x1'))(_0xf93e('0x2'));var moment=require('moment');var BPromise=require(_0xf93e('0x3'));var rp=require(_0xf93e('0x4'));var fs=require('fs');var path=require(_0xf93e('0x5'));var rimraf=require(_0xf93e('0x6'));var config=require(_0xf93e('0x7'));var attributes=require(_0xf93e('0x8'));module['exports']=function(_0x4e1cc3,_0x394b1b){return _0x4e1cc3[_0xf93e('0x9')]('Condition',attributes,{'tableName':_0xf93e('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 d2e9455..d51ad17 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 _0x05e4=['rpc','jayson/promise','client','http','then','Condition,\x20%s,\x20%s','request\x20sent','Condition,\x20%s,\x20%s,\x20%s','stringify','error','message','info','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x05e4,0x1c1));var _0x405e=function(_0x46f1da,_0x31c1be){_0x46f1da=_0x46f1da-0x0;var _0xddba6a=_0x05e4[_0x46f1da];return _0xddba6a;};'use strict';var _=require('lodash');var util=require(_0x405e('0x0'));var moment=require(_0x405e('0x1'));var BPromise=require('bluebird');var rs=require(_0x405e('0x2'));var fs=require('fs');var Redis=require(_0x405e('0x3'));var db=require(_0x405e('0x4'))['db'];var utils=require(_0x405e('0x5'));var logger=require(_0x405e('0x6'))(_0x405e('0x7'));var config=require('../../config/environment');var jayson=require(_0x405e('0x8'));var client=jayson[_0x405e('0x9')][_0x405e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5cdc78,_0x4e2cc0,_0x2e4df6){return new BPromise(function(_0x156026,_0x2696e8){return client['request'](_0x5cdc78,_0x2e4df6)[_0x405e('0xb')](function(_0xc26782){logger['info'](_0x405e('0xc'),_0x4e2cc0,_0x405e('0xd'));logger['debug'](_0x405e('0xe'),_0x4e2cc0,_0x405e('0xd'),JSON[_0x405e('0xf')](_0xc26782));if(_0xc26782['error']){if(_0xc26782[_0x405e('0x10')]['code']===0x1f4){logger[_0x405e('0x10')](_0x405e('0xc'),_0x4e2cc0,_0xc26782[_0x405e('0x10')][_0x405e('0x11')]);return _0x2696e8(_0xc26782['error'][_0x405e('0x11')]);}logger[_0x405e('0x10')](_0x405e('0xc'),_0x4e2cc0,_0xc26782[_0x405e('0x10')][_0x405e('0x11')]);return _0x156026(_0xc26782['error'][_0x405e('0x11')]);}else{logger[_0x405e('0x12')](_0x405e('0xc'),_0x4e2cc0,_0x405e('0xd'));_0x156026(_0xc26782['result'][_0x405e('0x11')]);}})['catch'](function(_0x505663){logger[_0x405e('0x10')](_0x405e('0xc'),_0x4e2cc0,_0x505663);_0x2696e8(_0x505663);});});} \ No newline at end of file +var _0x83f7=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','Condition,\x20%s,\x20%s','debug','Condition,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','moment'];(function(_0x3cf7d1,_0x5168ad){var _0x3ee460=function(_0x3ee5fb){while(--_0x3ee5fb){_0x3cf7d1['push'](_0x3cf7d1['shift']());}};_0x3ee460(++_0x5168ad);}(_0x83f7,0x1a0));var _0x783f=function(_0x279413,_0x5c0c9f){_0x279413=_0x279413-0x0;var _0x1fb3a5=_0x83f7[_0x279413];return _0x1fb3a5;};'use strict';var _=require(_0x783f('0x0'));var util=require('util');var moment=require(_0x783f('0x1'));var BPromise=require(_0x783f('0x2'));var rs=require(_0x783f('0x3'));var fs=require('fs');var Redis=require(_0x783f('0x4'));var db=require(_0x783f('0x5'))['db'];var utils=require(_0x783f('0x6'));var logger=require(_0x783f('0x7'))('rpc');var config=require(_0x783f('0x8'));var jayson=require(_0x783f('0x9'));var client=jayson['client'][_0x783f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x464dfb,_0x57b225,_0x68793f){return new BPromise(function(_0x62579b,_0x57dbc2){return client['request'](_0x464dfb,_0x68793f)[_0x783f('0xb')](function(_0x2fbb7b){logger[_0x783f('0xc')](_0x783f('0xd'),_0x57b225,'request\x20sent');logger[_0x783f('0xe')](_0x783f('0xf'),_0x57b225,_0x783f('0x10'),JSON[_0x783f('0x11')](_0x2fbb7b));if(_0x2fbb7b[_0x783f('0x12')]){if(_0x2fbb7b[_0x783f('0x12')]['code']===0x1f4){logger[_0x783f('0x12')]('Condition,\x20%s,\x20%s',_0x57b225,_0x2fbb7b[_0x783f('0x12')][_0x783f('0x13')]);return _0x57dbc2(_0x2fbb7b[_0x783f('0x12')]['message']);}logger['error'](_0x783f('0xd'),_0x57b225,_0x2fbb7b[_0x783f('0x12')]['message']);return _0x62579b(_0x2fbb7b['error']['message']);}else{logger[_0x783f('0xc')](_0x783f('0xd'),_0x57b225,'request\x20sent');_0x62579b(_0x2fbb7b[_0x783f('0x14')][_0x783f('0x13')]);}})[_0x783f('0x15')](function(_0x1ee9a9){logger[_0x783f('0x12')](_0x783f('0xd'),_0x57b225,_0x1ee9a9);_0x57dbc2(_0x1ee9a9);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 924a769..84b1ec3 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 _0x5ffd=['exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','./condition.controller','put','/:id','isAuthenticated','update','delete'];(function(_0x192f5c,_0x63d759){var _0x48b414=function(_0x553038){while(--_0x553038){_0x192f5c['push'](_0x192f5c['shift']());}};_0x48b414(++_0x63d759);}(_0x5ffd,0x16d));var _0xd5ff=function(_0x4bd1c7,_0x28db06){_0x4bd1c7=_0x4bd1c7-0x0;var _0x4267db=_0x5ffd[_0x4bd1c7];return _0x4267db;};'use strict';var multer=require(_0xd5ff('0x0'));var util=require('util');var path=require(_0xd5ff('0x1'));var timeout=require(_0xd5ff('0x2'));var express=require(_0xd5ff('0x3'));var router=express[_0xd5ff('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xd5ff('0x5'));var config=require('../../config/environment');var controller=require(_0xd5ff('0x6'));router[_0xd5ff('0x7')](_0xd5ff('0x8'),auth[_0xd5ff('0x9')](),controller[_0xd5ff('0xa')]);router[_0xd5ff('0xb')](_0xd5ff('0x8'),auth[_0xd5ff('0x9')](),controller['destroy']);module[_0xd5ff('0xc')]=router; \ No newline at end of file +var _0xd59c=['isAuthenticated','update','destroy','multer','util','path','connect-timeout','express','../../config/environment','put'];(function(_0x9b6a59,_0x10cb57){var _0x42b8f9=function(_0x2bcdd3){while(--_0x2bcdd3){_0x9b6a59['push'](_0x9b6a59['shift']());}};_0x42b8f9(++_0x10cb57);}(_0xd59c,0xad));var _0xcd59=function(_0x5e0b2d,_0x5e0ba7){_0x5e0b2d=_0x5e0b2d-0x0;var _0x92f9e6=_0xd59c[_0x5e0b2d];return _0x92f9e6;};'use strict';var multer=require(_0xcd59('0x0'));var util=require(_0xcd59('0x1'));var path=require(_0xcd59('0x2'));var timeout=require(_0xcd59('0x3'));var express=require(_0xcd59('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xcd59('0x5'));var controller=require('./condition.controller');router[_0xcd59('0x6')]('/:id',auth[_0xcd59('0x7')](),controller[_0xcd59('0x8')]);router['delete']('/:id',auth[_0xcd59('0x7')](),controller[_0xcd59('0x9')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index ce040c9..f9dda96 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 _0x2bd8=['name','sequelize','STRING'];(function(_0x5e41f9,_0x51903b){var _0x112d90=function(_0x56c928){while(--_0x56c928){_0x5e41f9['push'](_0x5e41f9['shift']());}};_0x112d90(++_0x51903b);}(_0x2bd8,0x130));var _0x82bd=function(_0xc7112d,_0x5e82e4){_0xc7112d=_0xc7112d-0x0;var _0x3a1bc1=_0x2bd8[_0xc7112d];return _0x3a1bc1;};'use strict';var Sequelize=require(_0x82bd('0x0'));module['exports']={'name':{'type':Sequelize[_0x82bd('0x1')],'allowNull':![],'unique':_0x82bd('0x2')},'description':{'type':Sequelize[_0x82bd('0x1')]}}; \ No newline at end of file +var _0x24ca=['sequelize','STRING','name'];(function(_0x4ccd46,_0x2c790f){var _0x2e6dc4=function(_0x28e1cd){while(--_0x28e1cd){_0x4ccd46['push'](_0x4ccd46['shift']());}};_0x2e6dc4(++_0x2c790f);}(_0x24ca,0x1bc));var _0xa24c=function(_0x1f8053,_0x111077){_0x1f8053=_0x1f8053-0x0;var _0x174fd8=_0x24ca[_0x1f8053];return _0x174fd8;};'use strict';var Sequelize=require(_0xa24c('0x0'));module['exports']={'name':{'type':Sequelize[_0xa24c('0x1')],'allowNull':![],'unique':_0xa24c('0x2')},'description':{'type':Sequelize[_0xa24c('0x1')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index b88be0c..d053aea 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 _0x24b3=['../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./dashboard.socket','register','sendStatus','end','json','count','offset','limit','status','save','update','then','UserProfileResource','destroy','error','stack','name','index','map','Dashboard','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','VIRTUAL','options','includeAll','include','catch','params','merge','find','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','CustomDashboards','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','body','omit','userProfileId','iframe','attrUrl','attrs','custom','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','web-report','reportType','attrReport','attrRefresh','widgetAttributes:\x20%s','addItem','DashboardId','DashboardItem','getItems','findOne','html-pdf','eml-format','rimraf','fast-json-patch','mustache','util','sox','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x582f02,_0x54ad06){var _0x320926=function(_0x2269cc){while(--_0x2269cc){_0x582f02['push'](_0x582f02['shift']());}};_0x320926(++_0x54ad06);}(_0x24b3,0xd3));var _0x324b=function(_0x3eb890,_0x29057e){_0x3eb890=_0x3eb890-0x0;var _0x9729c=_0x24b3[_0x3eb890];return _0x9729c;};'use strict';var pdf=require(_0x324b('0x0'));var emlformat=require(_0x324b('0x1'));var rimraf=require(_0x324b('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x324b('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x324b('0x4'));var util=require(_0x324b('0x5'));var path=require('path');var sox=require(_0x324b('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x324b('0x7'));var crypto=require(_0x324b('0x8'));var jsforce=require(_0x324b('0x9'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x324b('0xa'));var Redis=require('ioredis');var authService=require(_0x324b('0xb'));var qs=require(_0x324b('0xc'));var as=require(_0x324b('0xd'));var hardwareService=require(_0x324b('0xe'));var logger=require(_0x324b('0xf'))(_0x324b('0x10'));var utils=require(_0x324b('0x11'));var config=require(_0x324b('0x12'));var db=require(_0x324b('0x13'))['db'];config[_0x324b('0x14')]=_['defaults'](config[_0x324b('0x14')],{'host':_0x324b('0x15'),'port':0x18eb});var socket=require(_0x324b('0x16'))(new Redis(config[_0x324b('0x14')]));require(_0x324b('0x17'))[_0x324b('0x18')](socket);function respondWithStatusCode(_0x9746e5,_0x9ebae8){_0x9ebae8=_0x9ebae8||0xcc;return function(_0x4652c7){if(_0x4652c7){return _0x9746e5[_0x324b('0x19')](_0x9ebae8);}return _0x9746e5['status'](_0x9ebae8)[_0x324b('0x1a')]();};}function respondWithResult(_0x4fd4cc,_0x2d65ae){_0x2d65ae=_0x2d65ae||0xc8;return function(_0x30e7c4){if(_0x30e7c4){return _0x4fd4cc['status'](_0x2d65ae)[_0x324b('0x1b')](_0x30e7c4);}};}function respondWithFilteredResult(_0x75251d,_0x2ee628){return function(_0x1f797c){if(_0x1f797c){var _0x209104=_0x1f797c[_0x324b('0x1c')],_0x2def86=_0x2ee628[_0x324b('0x1d')],_0x38a03f=_0x2ee628[_0x324b('0x1d')]+_0x2ee628[_0x324b('0x1e')],_0x30fab4;if(_0x38a03f>=_0x209104){_0x38a03f=_0x209104;_0x30fab4=0xc8;}else{_0x30fab4=0xce;}_0x75251d[_0x324b('0x1f')](_0x30fab4);return _0x75251d['set']('Content-Range',_0x2def86+'-'+_0x38a03f+'/'+_0x209104)[_0x324b('0x1b')](_0x1f797c);}return null;};}function patchUpdates(_0x55f14e){return function(_0xb34f7){try{jsonpatch['apply'](_0xb34f7,_0x55f14e,!![]);}catch(_0x1fb9ed){return BPromise['reject'](_0x1fb9ed);}return _0xb34f7[_0x324b('0x20')]();};}function saveUpdates(_0x397cd3,_0x30091d){return function(_0x534392){if(_0x534392){return _0x534392[_0x324b('0x21')](_0x397cd3)[_0x324b('0x22')](function(_0x2eca97){return _0x2eca97;});}return null;};}function removeEntity(_0x5e27cd,_0x4ad982){return function(_0x1427df){if(_0x1427df){return _0x1427df['destroy']()[_0x324b('0x22')](function(){var _0x4390da=_0x1427df['get']({'plain':!![]});var _0x44798='CustomDashboards';return db[_0x324b('0x23')][_0x324b('0x24')]({'where':{'type':_0x44798,'resourceId':_0x4390da['id']}})[_0x324b('0x22')](function(){return _0x1427df;});})[_0x324b('0x22')](function(){_0x5e27cd[_0x324b('0x1f')](0xcc)[_0x324b('0x1a')]();});}};}function handleEntityNotFound(_0x46f79a,_0x48bb79){return function(_0x1b7587){if(!_0x1b7587){_0x46f79a[_0x324b('0x19')](0x194);}return _0x1b7587;};}function handleError(_0x2be143,_0x3656d0){_0x3656d0=_0x3656d0||0x1f4;return function(_0x4f550e){logger[_0x324b('0x25')](_0x4f550e[_0x324b('0x26')]);if(_0x4f550e['name']){delete _0x4f550e[_0x324b('0x27')];}_0x2be143['status'](_0x3656d0)['send'](_0x4f550e);};}exports[_0x324b('0x28')]=function(_0xfbe94d,_0x1b3dad){var _0x41f577={},_0x5406ae={},_0x37bdba={'count':0x0,'rows':[]};var _0x40d7cc=_[_0x324b('0x29')](db[_0x324b('0x2a')][_0x324b('0x2b')],function(_0x38092b){return{'name':_0x38092b[_0x324b('0x2c')],'type':_0x38092b[_0x324b('0x2d')]['key']};});_0x5406ae[_0x324b('0x2e')]=_['map'](_0x40d7cc,_0x324b('0x27'));_0x5406ae[_0x324b('0x2f')]=_[_0x324b('0x30')](_0xfbe94d[_0x324b('0x2f')]);_0x5406ae[_0x324b('0x31')]=_[_0x324b('0x32')](_0x5406ae['model'],_0x5406ae['query']);_0x41f577[_0x324b('0x33')]=_[_0x324b('0x32')](_0x5406ae[_0x324b('0x2e')],qs[_0x324b('0x34')](_0xfbe94d[_0x324b('0x2f')][_0x324b('0x34')]));_0x41f577['attributes']=_0x41f577[_0x324b('0x33')][_0x324b('0x35')]?_0x41f577[_0x324b('0x33')]:_0x5406ae[_0x324b('0x2e')];if(!_0xfbe94d[_0x324b('0x2f')][_0x324b('0x36')](_0x324b('0x37'))){_0x41f577[_0x324b('0x1e')]=qs[_0x324b('0x1e')](_0xfbe94d[_0x324b('0x2f')][_0x324b('0x1e')]);_0x41f577[_0x324b('0x1d')]=qs['offset'](_0xfbe94d[_0x324b('0x2f')]['offset']);}_0x41f577[_0x324b('0x38')]=qs[_0x324b('0x39')](_0xfbe94d['query'][_0x324b('0x39')]);_0x41f577['where']=qs[_0x324b('0x31')](_['pick'](_0xfbe94d[_0x324b('0x2f')],_0x5406ae[_0x324b('0x31')]));if(_0xfbe94d['query'][_0x324b('0x3a')]){_0x41f577[_0x324b('0x3b')]=_['merge'](_0x41f577['where'],{'$or':_['map'](_0x40d7cc,function(_0x26d1a9){if(_0x26d1a9['type']!==_0x324b('0x3c')){var _0x1d43c0={};_0x1d43c0[_0x26d1a9[_0x324b('0x27')]]={'$like':'%'+_0xfbe94d[_0x324b('0x2f')][_0x324b('0x3a')]+'%'};return _0x1d43c0;}})});}_0x41f577=_['merge']({},_0x41f577,_0xfbe94d[_0x324b('0x3d')]);var _0x1071c4={'where':_0x41f577[_0x324b('0x3b')]};return db['Dashboard'][_0x324b('0x1c')](_0x1071c4)[_0x324b('0x22')](function(_0x1caf9b){_0x37bdba[_0x324b('0x1c')]=_0x1caf9b;if(_0xfbe94d[_0x324b('0x2f')][_0x324b('0x3e')]){_0x41f577[_0x324b('0x3f')]=[{'all':!![]}];}return db[_0x324b('0x2a')]['findAll'](_0x41f577);})[_0x324b('0x22')](function(_0x3bccb2){_0x37bdba['rows']=_0x3bccb2;return _0x37bdba;})[_0x324b('0x22')](respondWithFilteredResult(_0x1b3dad,_0x41f577))[_0x324b('0x40')](handleError(_0x1b3dad,null));};exports['show']=function(_0x35dfaf,_0x4a7767){var _0x1f797a={'raw':![],'where':{'id':_0x35dfaf[_0x324b('0x41')]['id']}},_0x2c9a98={};_0x2c9a98[_0x324b('0x2e')]=_[_0x324b('0x30')](db[_0x324b('0x2a')][_0x324b('0x2b')]);_0x2c9a98[_0x324b('0x2f')]=_['keys'](_0x35dfaf[_0x324b('0x2f')]);_0x2c9a98['filters']=_[_0x324b('0x32')](_0x2c9a98['model'],_0x2c9a98[_0x324b('0x2f')]);_0x1f797a[_0x324b('0x33')]=_['intersection'](_0x2c9a98[_0x324b('0x2e')],qs['fields'](_0x35dfaf['query'][_0x324b('0x34')]));_0x1f797a[_0x324b('0x33')]=_0x1f797a[_0x324b('0x33')][_0x324b('0x35')]?_0x1f797a[_0x324b('0x33')]:_0x2c9a98[_0x324b('0x2e')];if(_0x35dfaf[_0x324b('0x2f')][_0x324b('0x3e')]){_0x1f797a[_0x324b('0x3f')]=[{'all':!![]}];}_0x1f797a=_[_0x324b('0x42')]({},_0x1f797a,_0x35dfaf[_0x324b('0x3d')]);return db[_0x324b('0x2a')][_0x324b('0x43')](_0x1f797a)['then'](handleEntityNotFound(_0x4a7767,null))[_0x324b('0x22')](respondWithResult(_0x4a7767,null))['catch'](handleError(_0x4a7767,null));};exports[_0x324b('0x44')]=function(_0xc0db5c,_0x5556f5){return db[_0x324b('0x2a')]['create'](_0xc0db5c['body'],{})['then'](function(_0x26eb97){var _0x34710a=_0xc0db5c['user'][_0x324b('0x45')]({'plain':!![]});if(!_0x34710a)throw new Error(_0x324b('0x46'));if(_0x34710a[_0x324b('0x47')]===_0x324b('0x48')){var _0x17023b=_0x26eb97[_0x324b('0x45')]({'plain':!![]});var _0x38a735=_0x324b('0x49');return db[_0x324b('0x4a')][_0x324b('0x43')]({'where':{'name':_0x38a735,'userProfileId':_0x34710a['userProfileId']},'raw':!![]})[_0x324b('0x22')](function(_0x238c20){if(_0x238c20&&_0x238c20[_0x324b('0x4b')]===0x0){return db[_0x324b('0x23')][_0x324b('0x44')]({'name':_0x17023b['name'],'resourceId':_0x17023b['id'],'type':_0x238c20['name'],'sectionId':_0x238c20['id']},{})[_0x324b('0x22')](function(){return _0x26eb97;});}else{return _0x26eb97;}})[_0x324b('0x40')](function(_0x23e8af){logger[_0x324b('0x25')](_0x324b('0x4c'),_0x23e8af);throw _0x23e8af;});}return _0x26eb97;})['then'](respondWithResult(_0x5556f5,0xc9))[_0x324b('0x40')](handleError(_0x5556f5,null));};exports[_0x324b('0x4d')]=function(_0x4704b6,_0x1743f5){var _0x4d8ceb={'where':{'id':_0x4704b6[_0x324b('0x41')]['id']}},_0x54bc67={};_0x54bc67[_0x324b('0x2e')]=_[_0x324b('0x30')](db['Dashboard'][_0x324b('0x2b')]);_0x4d8ceb[_0x324b('0x33')]=_['intersection'](_0x54bc67['model'],qs['fields'](_0x4704b6[_0x324b('0x2f')][_0x324b('0x34')]));_0x4d8ceb[_0x324b('0x33')]=_0x4d8ceb[_0x324b('0x33')]['length']?_0x4d8ceb['attributes']:_0x54bc67['model'];if(_0x4704b6[_0x324b('0x2f')][_0x324b('0x3e')]){_0x4d8ceb['include']=[{'all':!![]}];}_0x4d8ceb=_[_0x324b('0x42')]({},_0x4d8ceb,_0x4704b6['options']);return db['Dashboard'][_0x324b('0x43')](_0x4d8ceb)[_0x324b('0x22')](handleEntityNotFound(_0x1743f5,null))['then'](function(_0x365ebc){if(_0x365ebc){var _0x543ed1=_0x365ebc['get']({'plain':!![]});_0x543ed1=qs['omit'](_0x543ed1,['id',_0x324b('0x4e'),_0x324b('0x4f')]);_0x4704b6[_0x324b('0x50')]=_[_0x324b('0x51')](_0x4704b6[_0x324b('0x50')],['id',_0x324b('0x4e'),'updatedAt']);return db['Dashboard'][_0x324b('0x44')](_[_0x324b('0x42')](_0x543ed1,_0x4704b6[_0x324b('0x50')]),{'include':_0x4704b6['query']['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x2607c6){var _0x189b38=_0x4704b6[_0x324b('0x48')]['get']({'plain':!![]});if(!_0x189b38)throw new Error(_0x324b('0x46'));if(_0x189b38[_0x324b('0x47')]===_0x324b('0x48')){var _0x2e02d3=_0x2607c6['get']({'plain':!![]});var _0x5d57c6=_0x324b('0x49');return db['UserProfileSection'][_0x324b('0x43')]({'where':{'name':_0x5d57c6,'userProfileId':_0x189b38[_0x324b('0x52')]},'raw':!![]})[_0x324b('0x22')](function(_0xed9741){if(_0xed9741&&_0xed9741[_0x324b('0x4b')]===0x0){return db[_0x324b('0x23')]['create']({'name':_0x2e02d3[_0x324b('0x27')],'resourceId':_0x2e02d3['id'],'type':_0xed9741['name'],'sectionId':_0xed9741['id']},{})['then'](function(){return _0x2607c6;});}else{return _0x2607c6;}})[_0x324b('0x40')](function(_0x9348c7){logger['error'](_0x324b('0x4c'),_0x9348c7);throw _0x9348c7;});}return _0x2607c6;});}})[_0x324b('0x22')](respondWithResult(_0x1743f5,0xc9))[_0x324b('0x40')](handleError(_0x1743f5,null));};exports[_0x324b('0x21')]=function(_0xbd53ab,_0x2ef5fe){if(_0xbd53ab['body']['id']){delete _0xbd53ab[_0x324b('0x50')]['id'];}return db[_0x324b('0x2a')][_0x324b('0x43')]({'where':{'id':_0xbd53ab[_0x324b('0x41')]['id']}})[_0x324b('0x22')](handleEntityNotFound(_0x2ef5fe,null))[_0x324b('0x22')](saveUpdates(_0xbd53ab['body'],null))[_0x324b('0x22')](respondWithResult(_0x2ef5fe,null))[_0x324b('0x40')](handleError(_0x2ef5fe,null));};exports[_0x324b('0x24')]=function(_0x13d571,_0x2fc239){return db[_0x324b('0x2a')][_0x324b('0x43')]({'where':{'id':_0x13d571[_0x324b('0x41')]['id']}})[_0x324b('0x22')](handleEntityNotFound(_0x2fc239,null))[_0x324b('0x22')](removeEntity(_0x2fc239,null))[_0x324b('0x40')](handleError(_0x2fc239,null));};function widgetAttributes(_0x2cce0f){try{switch(_0x2cce0f[_0x324b('0x2d')]){case _0x324b('0x53'):return[{'name':_0x324b('0x54'),'value':_0x2cce0f['attrUrl']||(_0x2cce0f[_0x324b('0x55')]&&_0x2cce0f[_0x324b('0x55')][0x0]?_0x2cce0f['attrs'][0x0]['value']:undefined)||'https://'}];case _0x324b('0x56'):return[{'name':'attrPath','value':_0x2cce0f['attrPath']||(_0x2cce0f[_0x324b('0x55')]&&_0x2cce0f[_0x324b('0x55')][0x0]?_0x2cce0f[_0x324b('0x55')][0x0][_0x324b('0x57')]:undefined)||''}];case _0x324b('0x58'):return[{'name':_0x324b('0x59'),'value':_0x2cce0f[_0x324b('0x59')]||(_0x2cce0f['attrs']&&_0x2cce0f['attrs'][0x0]?_0x2cce0f[_0x324b('0x55')][0x0][_0x324b('0x57')]:undefined)||_0x324b('0x5a')},{'name':'attrTimezone','value':_0x2cce0f[_0x324b('0x5b')]||(_0x2cce0f[_0x324b('0x55')]&&_0x2cce0f[_0x324b('0x55')][0x1]?_0x2cce0f[_0x324b('0x55')][0x1][_0x324b('0x57')]:undefined)||_0x324b('0x5c')},{'name':_0x324b('0x5d'),'value':_0x2cce0f[_0x324b('0x5d')]||(_0x2cce0f[_0x324b('0x55')]&&_0x2cce0f[_0x324b('0x55')][0x2]?_0x2cce0f['attrs'][0x2][_0x324b('0x57')]:undefined)||0xc}];case _0x324b('0x5e'):return[{'name':_0x324b('0x5f'),'value':_0x2cce0f[_0x324b('0x5f')]||(_0x2cce0f[_0x324b('0x55')]&&_0x2cce0f[_0x324b('0x55')][0x0]?_0x2cce0f['attrs'][0x0][_0x324b('0x57')]:undefined)||'total'},{'name':_0x324b('0x60'),'value':_0x2cce0f[_0x324b('0x60')]||(_0x2cce0f[_0x324b('0x55')]&&_0x2cce0f['attrs'][0x1]?_0x2cce0f[_0x324b('0x55')][0x1][_0x324b('0x57')]:undefined)||[]},{'name':'attrFontSize','value':_0x2cce0f[_0x324b('0x5d')]||(_0x2cce0f[_0x324b('0x55')]&&_0x2cce0f['attrs'][0x2]?_0x2cce0f[_0x324b('0x55')][0x2][_0x324b('0x57')]:undefined)||0x14}];case _0x324b('0x61'):case _0x324b('0x62'):return[{'name':_0x324b('0x63'),'value':_0x2cce0f['attrSerie1']||(_0x2cce0f[_0x324b('0x55')]&&_0x2cce0f['attrs'][0x0]?_0x2cce0f[_0x324b('0x55')][0x0][_0x324b('0x57')]:undefined)||_0x324b('0x64')},{'name':_0x324b('0x65'),'value':_0x2cce0f[_0x324b('0x65')]||(_0x2cce0f[_0x324b('0x55')]&&_0x2cce0f[_0x324b('0x55')][0x1]?_0x2cce0f[_0x324b('0x55')][0x1]['value']:undefined)||null},{'name':'attrSerie3','value':_0x2cce0f[_0x324b('0x66')]||(_0x2cce0f[_0x324b('0x55')]&&_0x2cce0f[_0x324b('0x55')][0x2]?_0x2cce0f['attrs'][0x2][_0x324b('0x57')]:undefined)||null},{'name':_0x324b('0x60'),'value':_0x2cce0f[_0x324b('0x60')]||(_0x2cce0f[_0x324b('0x55')]&&_0x2cce0f['attrs'][0x3]?_0x2cce0f['attrs'][0x3][_0x324b('0x57')]:undefined)||[]}];case _0x324b('0x67'):return[{'name':'attrReport','type':_0x2cce0f[_0x324b('0x68')]||(_0x2cce0f[_0x324b('0x55')]&&_0x2cce0f[_0x324b('0x55')][0x0]?_0x2cce0f[_0x324b('0x55')][0x0][_0x324b('0x2d')]:undefined)||null,'value':_0x2cce0f[_0x324b('0x69')]||(_0x2cce0f[_0x324b('0x55')]&&_0x2cce0f[_0x324b('0x55')][0x0]?_0x2cce0f[_0x324b('0x55')][0x0][_0x324b('0x57')]:undefined)||null},{'name':_0x324b('0x6a'),'value':_0x2cce0f[_0x324b('0x6a')]||(_0x2cce0f[_0x324b('0x55')]&&_0x2cce0f[_0x324b('0x55')][0x1]?_0x2cce0f[_0x324b('0x55')][0x1][_0x324b('0x57')]:undefined)||0x0}];default:return[];}}catch(_0x3107b5){logger[_0x324b('0x25')](_0x324b('0x6b'),JSON['stringify'](_0x3107b5));return[];}}exports[_0x324b('0x6c')]=function(_0x5bbd06,_0x5a207d,_0x39cbf0){if(_0x5bbd06[_0x324b('0x50')]['id']){delete _0x5bbd06[_0x324b('0x50')]['id'];}return db[_0x324b('0x2a')]['find']({'where':{'id':_0x5bbd06[_0x324b('0x41')]['id']}})['then'](handleEntityNotFound(_0x5a207d,null))['then'](function(_0x1fc94b){if(_0x1fc94b){_0x5bbd06['body'][_0x324b('0x6d')]=_0x1fc94b['id'];_0x5bbd06['body']['attrs']=widgetAttributes(_0x5bbd06['body']);return db[_0x324b('0x6e')]['create'](_0x5bbd06[_0x324b('0x50')]);}})['then'](respondWithResult(_0x5a207d,null))[_0x324b('0x40')](handleError(_0x5a207d,null));};exports[_0x324b('0x6f')]=function(_0x12cb18,_0x507860,_0x1dcc53){var _0x2def44={};var _0x139393={};var _0x5e38ad;var _0x1a3c4a;return db['Dashboard'][_0x324b('0x70')]({'where':{'id':_0x12cb18[_0x324b('0x41')]['id']}})['then'](handleEntityNotFound(_0x507860,null))[_0x324b('0x22')](function(_0x2e2c6e){if(_0x2e2c6e){_0x5e38ad=_0x2e2c6e;_0x139393[_0x324b('0x2e')]=_['keys'](db['DashboardItem'][_0x324b('0x2b')]);_0x139393[_0x324b('0x2f')]=_[_0x324b('0x30')](_0x12cb18[_0x324b('0x2f')]);_0x139393[_0x324b('0x31')]=_[_0x324b('0x32')](_0x139393['model'],_0x139393[_0x324b('0x2f')]);_0x2def44[_0x324b('0x33')]=_[_0x324b('0x32')](_0x139393[_0x324b('0x2e')],qs[_0x324b('0x34')](_0x12cb18['query']['fields']));_0x2def44[_0x324b('0x33')]=_0x2def44[_0x324b('0x33')]['length']?_0x2def44[_0x324b('0x33')]:_0x139393[_0x324b('0x2e')];_0x2def44[_0x324b('0x38')]=qs[_0x324b('0x39')](_0x12cb18[_0x324b('0x2f')]['sort']);_0x2def44[_0x324b('0x3b')]=qs[_0x324b('0x31')](_['pick'](_0x12cb18[_0x324b('0x2f')],_0x139393[_0x324b('0x31')]));if(_0x12cb18['query'][_0x324b('0x3a')]){_0x2def44[_0x324b('0x3b')]=_['merge'](_0x2def44[_0x324b('0x3b')],{'$or':_['map'](_0x2def44[_0x324b('0x33')],function(_0x4d8a39){var _0x10246a={};_0x10246a[_0x4d8a39]={'$like':'%'+_0x12cb18['query']['filter']+'%'};return _0x10246a;})});}_0x2def44=_[_0x324b('0x42')]({},_0x2def44,_0x12cb18[_0x324b('0x3d')]);return _0x5e38ad[_0x324b('0x6f')](_0x2def44);}})[_0x324b('0x22')](function(_0xe0a34e){if(_0xe0a34e){_0x1a3c4a=_0xe0a34e[_0x324b('0x35')];if(!_0x12cb18[_0x324b('0x2f')][_0x324b('0x36')](_0x324b('0x37'))){_0x2def44[_0x324b('0x1e')]=qs[_0x324b('0x1e')](_0x12cb18[_0x324b('0x2f')]['limit']);_0x2def44[_0x324b('0x1d')]=qs[_0x324b('0x1d')](_0x12cb18[_0x324b('0x2f')][_0x324b('0x1d')]);}return _0x5e38ad[_0x324b('0x6f')](_0x2def44);}})[_0x324b('0x22')](function(_0x5a6f43){if(_0x5a6f43){return _0x5a6f43?{'count':_0x1a3c4a,'rows':_0x5a6f43}:null;}})[_0x324b('0x22')](respondWithResult(_0x507860,null))[_0x324b('0x40')](handleError(_0x507860,null));}; \ No newline at end of file +var _0x16e3=['custom','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardItem','getItems','length','html-pdf','zip-dir','request-promise','moment','mustache','path','sox','ejs','squel','jsforce','to-csv','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','redis','defaults','localhost','register','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','CustomDashboards','UserProfileResource','error','stack','name','map','Dashboard','rawAttributes','fieldName','type','key','query','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','includeAll','findAll','rows','show','params','keys','include','merge','options','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','body','iframe','attrUrl','attrs','value','https://'];(function(_0x52a7a0,_0x5aa120){var _0x3058c0=function(_0x59e1fc){while(--_0x59e1fc){_0x52a7a0['push'](_0x52a7a0['shift']());}};_0x3058c0(++_0x5aa120);}(_0x16e3,0x168));var _0x316e=function(_0x38e8bf,_0x26301f){_0x38e8bf=_0x38e8bf-0x0;var _0x2f06ae=_0x16e3[_0x38e8bf];return _0x2f06ae;};'use strict';var pdf=require(_0x316e('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x316e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x316e('0x2'));var moment=require(_0x316e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x316e('0x4'));var util=require('util');var path=require(_0x316e('0x5'));var sox=require(_0x316e('0x6'));var csv=require('to-csv');var ejs=require(_0x316e('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0x316e('0x8'));var crypto=require('crypto');var jsforce=require(_0x316e('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x316e('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x316e('0xb'));var qs=require(_0x316e('0xc'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x316e('0xd'));var logger=require(_0x316e('0xe'))('api');var utils=require(_0x316e('0xf'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x316e('0x10')]=_[_0x316e('0x11')](config[_0x316e('0x10')],{'host':_0x316e('0x12'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x316e('0x10')]));require('./dashboard.socket')[_0x316e('0x13')](socket);function respondWithStatusCode(_0x7a9bcc,_0x2a5009){_0x2a5009=_0x2a5009||0xcc;return function(_0x4ab332){if(_0x4ab332){return _0x7a9bcc[_0x316e('0x14')](_0x2a5009);}return _0x7a9bcc[_0x316e('0x15')](_0x2a5009)[_0x316e('0x16')]();};}function respondWithResult(_0x5124a4,_0x46dd41){_0x46dd41=_0x46dd41||0xc8;return function(_0x289db7){if(_0x289db7){return _0x5124a4[_0x316e('0x15')](_0x46dd41)[_0x316e('0x17')](_0x289db7);}};}function respondWithFilteredResult(_0x424a97,_0x44e4af){return function(_0x11e924){if(_0x11e924){var _0x5a25b8=_0x11e924[_0x316e('0x18')],_0x3ca181=_0x44e4af[_0x316e('0x19')],_0x1c5fe9=_0x44e4af[_0x316e('0x19')]+_0x44e4af[_0x316e('0x1a')],_0xb48d69;if(_0x1c5fe9>=_0x5a25b8){_0x1c5fe9=_0x5a25b8;_0xb48d69=0xc8;}else{_0xb48d69=0xce;}_0x424a97[_0x316e('0x15')](_0xb48d69);return _0x424a97['set'](_0x316e('0x1b'),_0x3ca181+'-'+_0x1c5fe9+'/'+_0x5a25b8)['json'](_0x11e924);}return null;};}function patchUpdates(_0x3dcfa3){return function(_0x3ab0ea){try{jsonpatch[_0x316e('0x1c')](_0x3ab0ea,_0x3dcfa3,!![]);}catch(_0xd0ae09){return BPromise[_0x316e('0x1d')](_0xd0ae09);}return _0x3ab0ea[_0x316e('0x1e')]();};}function saveUpdates(_0x3c725d,_0x21fa69){return function(_0x1751a4){if(_0x1751a4){return _0x1751a4[_0x316e('0x1f')](_0x3c725d)[_0x316e('0x20')](function(_0x448c88){return _0x448c88;});}return null;};}function removeEntity(_0x1a43af,_0x3f62fb){return function(_0x15252b){if(_0x15252b){return _0x15252b[_0x316e('0x21')]()['then'](function(){var _0x4346c7=_0x15252b['get']({'plain':!![]});var _0x14343b=_0x316e('0x22');return db[_0x316e('0x23')][_0x316e('0x21')]({'where':{'type':_0x14343b,'resourceId':_0x4346c7['id']}})[_0x316e('0x20')](function(){return _0x15252b;});})[_0x316e('0x20')](function(){_0x1a43af[_0x316e('0x15')](0xcc)[_0x316e('0x16')]();});}};}function handleEntityNotFound(_0x3cdc15,_0x41d0b3){return function(_0xfef699){if(!_0xfef699){_0x3cdc15[_0x316e('0x14')](0x194);}return _0xfef699;};}function handleError(_0x50766f,_0x36313d){_0x36313d=_0x36313d||0x1f4;return function(_0x4974cc){logger[_0x316e('0x24')](_0x4974cc[_0x316e('0x25')]);if(_0x4974cc[_0x316e('0x26')]){delete _0x4974cc[_0x316e('0x26')];}_0x50766f['status'](_0x36313d)['send'](_0x4974cc);};}exports['index']=function(_0x22e996,_0xee89fa){var _0x6b433d={},_0x38c7a8={},_0xec9621={'count':0x0,'rows':[]};var _0x371afb=_[_0x316e('0x27')](db[_0x316e('0x28')][_0x316e('0x29')],function(_0x20dfd2){return{'name':_0x20dfd2[_0x316e('0x2a')],'type':_0x20dfd2[_0x316e('0x2b')][_0x316e('0x2c')]};});_0x38c7a8['model']=_[_0x316e('0x27')](_0x371afb,_0x316e('0x26'));_0x38c7a8[_0x316e('0x2d')]=_['keys'](_0x22e996['query']);_0x38c7a8['filters']=_[_0x316e('0x2e')](_0x38c7a8['model'],_0x38c7a8[_0x316e('0x2d')]);_0x6b433d[_0x316e('0x2f')]=_[_0x316e('0x2e')](_0x38c7a8[_0x316e('0x30')],qs[_0x316e('0x31')](_0x22e996[_0x316e('0x2d')]['fields']));_0x6b433d[_0x316e('0x2f')]=_0x6b433d[_0x316e('0x2f')]['length']?_0x6b433d['attributes']:_0x38c7a8['model'];if(!_0x22e996[_0x316e('0x2d')][_0x316e('0x32')](_0x316e('0x33'))){_0x6b433d[_0x316e('0x1a')]=qs['limit'](_0x22e996[_0x316e('0x2d')][_0x316e('0x1a')]);_0x6b433d[_0x316e('0x19')]=qs[_0x316e('0x19')](_0x22e996[_0x316e('0x2d')][_0x316e('0x19')]);}_0x6b433d[_0x316e('0x34')]=qs[_0x316e('0x35')](_0x22e996[_0x316e('0x2d')][_0x316e('0x35')]);_0x6b433d[_0x316e('0x36')]=qs[_0x316e('0x37')](_[_0x316e('0x38')](_0x22e996['query'],_0x38c7a8['filters']));if(_0x22e996[_0x316e('0x2d')][_0x316e('0x39')]){_0x6b433d[_0x316e('0x36')]=_['merge'](_0x6b433d[_0x316e('0x36')],{'$or':_['map'](_0x371afb,function(_0x30c5a9){if(_0x30c5a9['type']!=='VIRTUAL'){var _0x392ff4={};_0x392ff4[_0x30c5a9[_0x316e('0x26')]]={'$like':'%'+_0x22e996[_0x316e('0x2d')][_0x316e('0x39')]+'%'};return _0x392ff4;}})});}_0x6b433d=_['merge']({},_0x6b433d,_0x22e996['options']);var _0x504dd5={'where':_0x6b433d[_0x316e('0x36')]};return db[_0x316e('0x28')][_0x316e('0x18')](_0x504dd5)[_0x316e('0x20')](function(_0x3bb2b5){_0xec9621[_0x316e('0x18')]=_0x3bb2b5;if(_0x22e996[_0x316e('0x2d')][_0x316e('0x3a')]){_0x6b433d['include']=[{'all':!![]}];}return db['Dashboard'][_0x316e('0x3b')](_0x6b433d);})[_0x316e('0x20')](function(_0x1c9204){_0xec9621[_0x316e('0x3c')]=_0x1c9204;return _0xec9621;})['then'](respondWithFilteredResult(_0xee89fa,_0x6b433d))['catch'](handleError(_0xee89fa,null));};exports[_0x316e('0x3d')]=function(_0x594a28,_0xa965f8){var _0x2ef8b9={'raw':![],'where':{'id':_0x594a28[_0x316e('0x3e')]['id']}},_0x57e0cf={};_0x57e0cf['model']=_[_0x316e('0x3f')](db[_0x316e('0x28')]['rawAttributes']);_0x57e0cf[_0x316e('0x2d')]=_[_0x316e('0x3f')](_0x594a28['query']);_0x57e0cf[_0x316e('0x37')]=_[_0x316e('0x2e')](_0x57e0cf[_0x316e('0x30')],_0x57e0cf[_0x316e('0x2d')]);_0x2ef8b9[_0x316e('0x2f')]=_[_0x316e('0x2e')](_0x57e0cf[_0x316e('0x30')],qs['fields'](_0x594a28[_0x316e('0x2d')][_0x316e('0x31')]));_0x2ef8b9[_0x316e('0x2f')]=_0x2ef8b9['attributes']['length']?_0x2ef8b9['attributes']:_0x57e0cf[_0x316e('0x30')];if(_0x594a28[_0x316e('0x2d')][_0x316e('0x3a')]){_0x2ef8b9[_0x316e('0x40')]=[{'all':!![]}];}_0x2ef8b9=_[_0x316e('0x41')]({},_0x2ef8b9,_0x594a28[_0x316e('0x42')]);return db[_0x316e('0x28')][_0x316e('0x43')](_0x2ef8b9)[_0x316e('0x20')](handleEntityNotFound(_0xa965f8,null))[_0x316e('0x20')](respondWithResult(_0xa965f8,null))[_0x316e('0x44')](handleError(_0xa965f8,null));};exports[_0x316e('0x45')]=function(_0x3d95c2,_0x4538d6){return db['Dashboard'][_0x316e('0x45')](_0x3d95c2['body'],{})['then'](function(_0x4e4891){var _0x40c0d2=_0x3d95c2[_0x316e('0x46')][_0x316e('0x47')]({'plain':!![]});if(!_0x40c0d2)throw new Error(_0x316e('0x48'));if(_0x40c0d2[_0x316e('0x49')]===_0x316e('0x46')){var _0x70636d=_0x4e4891[_0x316e('0x47')]({'plain':!![]});var _0x17fc3b='CustomDashboards';return db[_0x316e('0x4a')][_0x316e('0x43')]({'where':{'name':_0x17fc3b,'userProfileId':_0x40c0d2[_0x316e('0x4b')]},'raw':!![]})['then'](function(_0x686f40){if(_0x686f40&&_0x686f40[_0x316e('0x4c')]===0x0){return db[_0x316e('0x23')][_0x316e('0x45')]({'name':_0x70636d['name'],'resourceId':_0x70636d['id'],'type':_0x686f40[_0x316e('0x26')],'sectionId':_0x686f40['id']},{})['then'](function(){return _0x4e4891;});}else{return _0x4e4891;}})['catch'](function(_0x4da098){logger[_0x316e('0x24')](_0x316e('0x4d'),_0x4da098);throw _0x4da098;});}return _0x4e4891;})[_0x316e('0x20')](respondWithResult(_0x4538d6,0xc9))[_0x316e('0x44')](handleError(_0x4538d6,null));};exports[_0x316e('0x4e')]=function(_0x5c366d,_0x58f61e){var _0x1783bd={'where':{'id':_0x5c366d['params']['id']}},_0x22e4ac={};_0x22e4ac['model']=_[_0x316e('0x3f')](db[_0x316e('0x28')][_0x316e('0x29')]);_0x1783bd[_0x316e('0x2f')]=_[_0x316e('0x2e')](_0x22e4ac[_0x316e('0x30')],qs['fields'](_0x5c366d['query'][_0x316e('0x31')]));_0x1783bd['attributes']=_0x1783bd['attributes']['length']?_0x1783bd[_0x316e('0x2f')]:_0x22e4ac[_0x316e('0x30')];if(_0x5c366d[_0x316e('0x2d')]['includeAll']){_0x1783bd[_0x316e('0x40')]=[{'all':!![]}];}_0x1783bd=_[_0x316e('0x41')]({},_0x1783bd,_0x5c366d['options']);return db[_0x316e('0x28')][_0x316e('0x43')](_0x1783bd)[_0x316e('0x20')](handleEntityNotFound(_0x58f61e,null))['then'](function(_0x131491){if(_0x131491){var _0x5ca59f=_0x131491['get']({'plain':!![]});_0x5ca59f=qs[_0x316e('0x4f')](_0x5ca59f,['id',_0x316e('0x50'),_0x316e('0x51')]);_0x5c366d[_0x316e('0x52')]=_[_0x316e('0x4f')](_0x5c366d[_0x316e('0x52')],['id',_0x316e('0x50'),_0x316e('0x51')]);return db[_0x316e('0x28')][_0x316e('0x45')](_['merge'](_0x5ca59f,_0x5c366d['body']),{'include':_0x5c366d[_0x316e('0x2d')][_0x316e('0x3a')]?[{'all':!![]}]:undefined})[_0x316e('0x20')](function(_0x54c795){var _0x8dcdbc=_0x5c366d[_0x316e('0x46')][_0x316e('0x47')]({'plain':!![]});if(!_0x8dcdbc)throw new Error(_0x316e('0x48'));if(_0x8dcdbc['role']===_0x316e('0x46')){var _0x10b44c=_0x54c795['get']({'plain':!![]});var _0x3142d1='CustomDashboards';return db['UserProfileSection'][_0x316e('0x43')]({'where':{'name':_0x3142d1,'userProfileId':_0x8dcdbc['userProfileId']},'raw':!![]})['then'](function(_0x52fc3d){if(_0x52fc3d&&_0x52fc3d[_0x316e('0x4c')]===0x0){return db[_0x316e('0x23')][_0x316e('0x45')]({'name':_0x10b44c[_0x316e('0x26')],'resourceId':_0x10b44c['id'],'type':_0x52fc3d[_0x316e('0x26')],'sectionId':_0x52fc3d['id']},{})[_0x316e('0x20')](function(){return _0x54c795;});}else{return _0x54c795;}})[_0x316e('0x44')](function(_0xb30c55){logger[_0x316e('0x24')](_0x316e('0x4d'),_0xb30c55);throw _0xb30c55;});}return _0x54c795;});}})['then'](respondWithResult(_0x58f61e,0xc9))[_0x316e('0x44')](handleError(_0x58f61e,null));};exports['update']=function(_0x4d0bc7,_0x2a7162){if(_0x4d0bc7['body']['id']){delete _0x4d0bc7[_0x316e('0x52')]['id'];}return db['Dashboard']['find']({'where':{'id':_0x4d0bc7['params']['id']}})[_0x316e('0x20')](handleEntityNotFound(_0x2a7162,null))['then'](saveUpdates(_0x4d0bc7[_0x316e('0x52')],null))[_0x316e('0x20')](respondWithResult(_0x2a7162,null))['catch'](handleError(_0x2a7162,null));};exports[_0x316e('0x21')]=function(_0x2eadfe,_0x2d5aaf){return db[_0x316e('0x28')]['find']({'where':{'id':_0x2eadfe['params']['id']}})[_0x316e('0x20')](handleEntityNotFound(_0x2d5aaf,null))['then'](removeEntity(_0x2d5aaf,null))[_0x316e('0x44')](handleError(_0x2d5aaf,null));};function widgetAttributes(_0x405513){try{switch(_0x405513['type']){case _0x316e('0x53'):return[{'name':'attrUrl','value':_0x405513[_0x316e('0x54')]||(_0x405513[_0x316e('0x55')]&&_0x405513[_0x316e('0x55')][0x0]?_0x405513[_0x316e('0x55')][0x0][_0x316e('0x56')]:undefined)||_0x316e('0x57')}];case _0x316e('0x58'):return[{'name':'attrPath','value':_0x405513['attrPath']||(_0x405513[_0x316e('0x55')]&&_0x405513[_0x316e('0x55')][0x0]?_0x405513[_0x316e('0x55')][0x0]['value']:undefined)||''}];case _0x316e('0x59'):return[{'name':'attrHourFormat','value':_0x405513[_0x316e('0x5a')]||(_0x405513[_0x316e('0x55')]&&_0x405513[_0x316e('0x55')][0x0]?_0x405513[_0x316e('0x55')][0x0][_0x316e('0x56')]:undefined)||'HH:mm:ss'},{'name':_0x316e('0x5b'),'value':_0x405513[_0x316e('0x5b')]||(_0x405513[_0x316e('0x55')]&&_0x405513[_0x316e('0x55')][0x1]?_0x405513[_0x316e('0x55')][0x1][_0x316e('0x56')]:undefined)||_0x316e('0x5c')},{'name':'attrFontSize','value':_0x405513[_0x316e('0x5d')]||(_0x405513['attrs']&&_0x405513['attrs'][0x2]?_0x405513[_0x316e('0x55')][0x2]['value']:undefined)||0xc}];case _0x316e('0x5e'):return[{'name':_0x316e('0x5f'),'value':_0x405513[_0x316e('0x5f')]||(_0x405513[_0x316e('0x55')]&&_0x405513[_0x316e('0x55')][0x0]?_0x405513[_0x316e('0x55')][0x0][_0x316e('0x56')]:undefined)||'total'},{'name':_0x316e('0x60'),'value':_0x405513[_0x316e('0x60')]||(_0x405513[_0x316e('0x55')]&&_0x405513[_0x316e('0x55')][0x1]?_0x405513[_0x316e('0x55')][0x1][_0x316e('0x56')]:undefined)||[]},{'name':_0x316e('0x5d'),'value':_0x405513[_0x316e('0x5d')]||(_0x405513[_0x316e('0x55')]&&_0x405513[_0x316e('0x55')][0x2]?_0x405513['attrs'][0x2]['value']:undefined)||0x14}];case _0x316e('0x61'):case _0x316e('0x62'):return[{'name':_0x316e('0x63'),'value':_0x405513[_0x316e('0x63')]||(_0x405513['attrs']&&_0x405513[_0x316e('0x55')][0x0]?_0x405513['attrs'][0x0][_0x316e('0x56')]:undefined)||'total'},{'name':_0x316e('0x64'),'value':_0x405513[_0x316e('0x64')]||(_0x405513[_0x316e('0x55')]&&_0x405513[_0x316e('0x55')][0x1]?_0x405513[_0x316e('0x55')][0x1][_0x316e('0x56')]:undefined)||null},{'name':'attrSerie3','value':_0x405513[_0x316e('0x65')]||(_0x405513[_0x316e('0x55')]&&_0x405513[_0x316e('0x55')][0x2]?_0x405513['attrs'][0x2][_0x316e('0x56')]:undefined)||null},{'name':_0x316e('0x60'),'value':_0x405513[_0x316e('0x60')]||(_0x405513[_0x316e('0x55')]&&_0x405513['attrs'][0x3]?_0x405513['attrs'][0x3]['value']:undefined)||[]}];case _0x316e('0x66'):return[{'name':_0x316e('0x67'),'type':_0x405513[_0x316e('0x68')]||(_0x405513['attrs']&&_0x405513[_0x316e('0x55')][0x0]?_0x405513[_0x316e('0x55')][0x0]['type']:undefined)||null,'value':_0x405513['attrReport']||(_0x405513[_0x316e('0x55')]&&_0x405513[_0x316e('0x55')][0x0]?_0x405513[_0x316e('0x55')][0x0]['value']:undefined)||null},{'name':'attrRefresh','value':_0x405513[_0x316e('0x69')]||(_0x405513[_0x316e('0x55')]&&_0x405513[_0x316e('0x55')][0x1]?_0x405513[_0x316e('0x55')][0x1][_0x316e('0x56')]:undefined)||0x0}];default:return[];}}catch(_0x2302f8){logger[_0x316e('0x24')](_0x316e('0x6a'),JSON[_0x316e('0x6b')](_0x2302f8));return[];}}exports[_0x316e('0x6c')]=function(_0x52f24a,_0xdc5ec,_0x4d98bd){if(_0x52f24a[_0x316e('0x52')]['id']){delete _0x52f24a[_0x316e('0x52')]['id'];}return db['Dashboard']['find']({'where':{'id':_0x52f24a[_0x316e('0x3e')]['id']}})[_0x316e('0x20')](handleEntityNotFound(_0xdc5ec,null))['then'](function(_0x290ac4){if(_0x290ac4){_0x52f24a[_0x316e('0x52')]['DashboardId']=_0x290ac4['id'];_0x52f24a[_0x316e('0x52')][_0x316e('0x55')]=widgetAttributes(_0x52f24a[_0x316e('0x52')]);return db[_0x316e('0x6d')][_0x316e('0x45')](_0x52f24a['body']);}})[_0x316e('0x20')](respondWithResult(_0xdc5ec,null))['catch'](handleError(_0xdc5ec,null));};exports[_0x316e('0x6e')]=function(_0x252680,_0x51d0a4,_0x9d5f9c){var _0x56b16c={};var _0x58dfc4={};var _0x4dc5ba;var _0x31a8bf;return db[_0x316e('0x28')]['findOne']({'where':{'id':_0x252680[_0x316e('0x3e')]['id']}})[_0x316e('0x20')](handleEntityNotFound(_0x51d0a4,null))[_0x316e('0x20')](function(_0x39829b){if(_0x39829b){_0x4dc5ba=_0x39829b;_0x58dfc4['model']=_[_0x316e('0x3f')](db[_0x316e('0x6d')][_0x316e('0x29')]);_0x58dfc4[_0x316e('0x2d')]=_['keys'](_0x252680['query']);_0x58dfc4[_0x316e('0x37')]=_[_0x316e('0x2e')](_0x58dfc4[_0x316e('0x30')],_0x58dfc4[_0x316e('0x2d')]);_0x56b16c[_0x316e('0x2f')]=_[_0x316e('0x2e')](_0x58dfc4[_0x316e('0x30')],qs[_0x316e('0x31')](_0x252680[_0x316e('0x2d')][_0x316e('0x31')]));_0x56b16c[_0x316e('0x2f')]=_0x56b16c['attributes'][_0x316e('0x6f')]?_0x56b16c[_0x316e('0x2f')]:_0x58dfc4[_0x316e('0x30')];_0x56b16c[_0x316e('0x34')]=qs[_0x316e('0x35')](_0x252680[_0x316e('0x2d')][_0x316e('0x35')]);_0x56b16c[_0x316e('0x36')]=qs[_0x316e('0x37')](_['pick'](_0x252680[_0x316e('0x2d')],_0x58dfc4[_0x316e('0x37')]));if(_0x252680['query'][_0x316e('0x39')]){_0x56b16c['where']=_[_0x316e('0x41')](_0x56b16c['where'],{'$or':_[_0x316e('0x27')](_0x56b16c[_0x316e('0x2f')],function(_0x211902){var _0x5e9baf={};_0x5e9baf[_0x211902]={'$like':'%'+_0x252680[_0x316e('0x2d')][_0x316e('0x39')]+'%'};return _0x5e9baf;})});}_0x56b16c=_[_0x316e('0x41')]({},_0x56b16c,_0x252680[_0x316e('0x42')]);return _0x4dc5ba[_0x316e('0x6e')](_0x56b16c);}})[_0x316e('0x20')](function(_0x2ae8dc){if(_0x2ae8dc){_0x31a8bf=_0x2ae8dc['length'];if(!_0x252680[_0x316e('0x2d')][_0x316e('0x32')](_0x316e('0x33'))){_0x56b16c[_0x316e('0x1a')]=qs[_0x316e('0x1a')](_0x252680[_0x316e('0x2d')][_0x316e('0x1a')]);_0x56b16c[_0x316e('0x19')]=qs[_0x316e('0x19')](_0x252680[_0x316e('0x2d')][_0x316e('0x19')]);}return _0x4dc5ba[_0x316e('0x6e')](_0x56b16c);}})['then'](function(_0x2703b0){if(_0x2703b0){return _0x2703b0?{'count':_0x31a8bf,'rows':_0x2703b0}:null;}})[_0x316e('0x20')](respondWithResult(_0x51d0a4,null))[_0x316e('0x44')](handleError(_0x51d0a4,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index adc6c04..05fa708 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 _0x8c24=['events','../../mysqldb','Dashboard','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x168020,_0x40485d){var _0x526fe3=function(_0x902832){while(--_0x902832){_0x168020['push'](_0x168020['shift']());}};_0x526fe3(++_0x40485d);}(_0x8c24,0x6e));var _0x48c2=function(_0x3d0958,_0x204a7e){_0x3d0958=_0x3d0958-0x0;var _0x1c77f8=_0x8c24[_0x3d0958];return _0x1c77f8;};'use strict';var EventEmitter=require(_0x48c2('0x0'));var Dashboard=require(_0x48c2('0x1'))['db'][_0x48c2('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x48c2('0x3')](0x0);var events={'afterCreate':_0x48c2('0x4'),'afterUpdate':_0x48c2('0x5'),'afterDestroy':_0x48c2('0x6')};function emitEvent(_0x502823){return function(_0x3f8bbd,_0x3a02cb,_0x22eb2d){DashboardEvents[_0x48c2('0x7')](_0x502823+':'+_0x3f8bbd['id'],_0x3f8bbd);DashboardEvents['emit'](_0x502823,_0x3f8bbd);_0x22eb2d(null);};}for(var e in events){if(events[_0x48c2('0x8')](e)){var event=events[e];Dashboard[_0x48c2('0x9')](e,emitEvent(event));}}module[_0x48c2('0xa')]=DashboardEvents; \ No newline at end of file +var _0x79c0=['setMaxListeners','save','remove','hasOwnProperty','hook','exports','events','../../mysqldb','Dashboard'];(function(_0x176ada,_0x58ea9c){var _0x15c1aa=function(_0x2e5427){while(--_0x2e5427){_0x176ada['push'](_0x176ada['shift']());}};_0x15c1aa(++_0x58ea9c);}(_0x79c0,0x1a4));var _0x079c=function(_0x2b5230,_0x53170b){_0x2b5230=_0x2b5230-0x0;var _0x53ed17=_0x79c0[_0x2b5230];return _0x53ed17;};'use strict';var EventEmitter=require(_0x079c('0x0'));var Dashboard=require(_0x079c('0x1'))['db'][_0x079c('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x079c('0x3')](0x0);var events={'afterCreate':_0x079c('0x4'),'afterUpdate':'update','afterDestroy':_0x079c('0x5')};function emitEvent(_0x5b2cf3){return function(_0x57f181,_0x2fc022,_0xc1c566){DashboardEvents['emit'](_0x5b2cf3+':'+_0x57f181['id'],_0x57f181);DashboardEvents['emit'](_0x5b2cf3,_0x57f181);_0xc1c566(null);};}for(var e in events){if(events[_0x079c('0x6')](e)){var event=events[e];Dashboard[_0x079c('0x7')](e,emitEvent(event));}}module[_0x079c('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 b070d08..9465868 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 _0xf5dd=['define','Dashboard','lodash','../../config/logger','moment','request-promise','path','../../config/environment','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf5dd,0x6e));var _0xdf5d=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xf5dd[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0xdf5d('0x0'));var util=require('util');var logger=require(_0xdf5d('0x1'))('api');var moment=require(_0xdf5d('0x2'));var BPromise=require('bluebird');var rp=require(_0xdf5d('0x3'));var fs=require('fs');var path=require(_0xdf5d('0x4'));var rimraf=require('rimraf');var config=require(_0xdf5d('0x5'));var attributes=require('./dashboard.attributes');module[_0xdf5d('0x6')]=function(_0x5a74fa,_0x30e561){return _0x5a74fa[_0xdf5d('0x7')](_0xdf5d('0x8'),attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe7a6=['bluebird','request-promise','path','../../config/environment','./dashboard.attributes','exports','Dashboard','lodash','../../config/logger','api','moment'];(function(_0x577da7,_0x1ddfc4){var _0x353d87=function(_0xc362fe){while(--_0xc362fe){_0x577da7['push'](_0x577da7['shift']());}};_0x353d87(++_0x1ddfc4);}(_0xe7a6,0x1bf));var _0x6e7a=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xe7a6[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x6e7a('0x0'));var util=require('util');var logger=require(_0x6e7a('0x1'))(_0x6e7a('0x2'));var moment=require(_0x6e7a('0x3'));var BPromise=require(_0x6e7a('0x4'));var rp=require(_0x6e7a('0x5'));var fs=require('fs');var path=require(_0x6e7a('0x6'));var rimraf=require('rimraf');var config=require(_0x6e7a('0x7'));var attributes=require(_0x6e7a('0x8'));module[_0x6e7a('0x9')]=function(_0xa68627,_0xda6329){return _0xa68627['define'](_0x6e7a('0xa'),attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.rpc.js b/server/api/dashboard/dashboard.rpc.js index 9abbd37..53e820d 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 _0xe42e=['Dashboard,\x20%s,\x20%s','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','request','then','info','request\x20sent','debug','stringify','error','code','message'];(function(_0x33a6f0,_0x294c6b){var _0x375685=function(_0x59d065){while(--_0x59d065){_0x33a6f0['push'](_0x33a6f0['shift']());}};_0x375685(++_0x294c6b);}(_0xe42e,0xbf));var _0xee42=function(_0xf66bf1,_0x53825e){_0xf66bf1=_0xf66bf1-0x0;var _0x402ca6=_0xe42e[_0xf66bf1];return _0x402ca6;};'use strict';var _=require(_0xee42('0x0'));var util=require(_0xee42('0x1'));var moment=require('moment');var BPromise=require(_0xee42('0x2'));var rs=require(_0xee42('0x3'));var fs=require('fs');var Redis=require(_0xee42('0x4'));var db=require(_0xee42('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xee42('0x6'))(_0xee42('0x7'));var config=require('../../config/environment');var jayson=require(_0xee42('0x8'));var client=jayson['client'][_0xee42('0x9')]({'port':0x232a});config[_0xee42('0xa')]=_[_0xee42('0xb')](config[_0xee42('0xa')],{'host':_0xee42('0xc'),'port':0x18eb});var socket=require(_0xee42('0xd'))(new Redis(config[_0xee42('0xa')]));require(_0xee42('0xe'))[_0xee42('0xf')](socket);function respondWithRpcPromise(_0x139f91,_0x5ed709,_0x68aa18){return new BPromise(function(_0x43de14,_0x2ba2bd){return client[_0xee42('0x10')](_0x139f91,_0x68aa18)[_0xee42('0x11')](function(_0x926751){logger[_0xee42('0x12')]('Dashboard,\x20%s,\x20%s',_0x5ed709,_0xee42('0x13'));logger[_0xee42('0x14')]('Dashboard,\x20%s,\x20%s,\x20%s',_0x5ed709,_0xee42('0x13'),JSON[_0xee42('0x15')](_0x926751));if(_0x926751[_0xee42('0x16')]){if(_0x926751[_0xee42('0x16')][_0xee42('0x17')]===0x1f4){logger['error']('Dashboard,\x20%s,\x20%s',_0x5ed709,_0x926751[_0xee42('0x16')]['message']);return _0x2ba2bd(_0x926751['error'][_0xee42('0x18')]);}logger[_0xee42('0x16')](_0xee42('0x19'),_0x5ed709,_0x926751[_0xee42('0x16')]['message']);return _0x43de14(_0x926751[_0xee42('0x16')]['message']);}else{logger[_0xee42('0x12')](_0xee42('0x19'),_0x5ed709,_0xee42('0x13'));_0x43de14(_0x926751['result'][_0xee42('0x18')]);}})[_0xee42('0x1a')](function(_0x288274){logger[_0xee42('0x16')](_0xee42('0x19'),_0x5ed709,_0x288274);_0x2ba2bd(_0x288274);});});} \ No newline at end of file +var _0x98a1=['rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./dashboard.socket','register','request','then','info','Dashboard,\x20%s,\x20%s','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','lodash','moment','randomstring','ioredis','../../config/utils'];(function(_0x208f80,_0x2522c6){var _0x71c40c=function(_0x555c9a){while(--_0x555c9a){_0x208f80['push'](_0x208f80['shift']());}};_0x71c40c(++_0x2522c6);}(_0x98a1,0x140));var _0x198a=function(_0x311364,_0x2a73eb){_0x311364=_0x311364-0x0;var _0x45c61c=_0x98a1[_0x311364];return _0x45c61c;};'use strict';var _=require(_0x198a('0x0'));var util=require('util');var moment=require(_0x198a('0x1'));var BPromise=require('bluebird');var rs=require(_0x198a('0x2'));var fs=require('fs');var Redis=require(_0x198a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x198a('0x4'));var logger=require('../../config/logger')(_0x198a('0x5'));var config=require('../../config/environment');var jayson=require(_0x198a('0x6'));var client=jayson[_0x198a('0x7')][_0x198a('0x8')]({'port':0x232a});config[_0x198a('0x9')]=_['defaults'](config[_0x198a('0x9')],{'host':_0x198a('0xa'),'port':0x18eb});var socket=require(_0x198a('0xb'))(new Redis(config[_0x198a('0x9')]));require(_0x198a('0xc'))[_0x198a('0xd')](socket);function respondWithRpcPromise(_0x27631d,_0x16146e,_0x2be6b5){return new BPromise(function(_0x3141b1,_0x14efab){return client[_0x198a('0xe')](_0x27631d,_0x2be6b5)[_0x198a('0xf')](function(_0x53af17){logger[_0x198a('0x10')](_0x198a('0x11'),_0x16146e,'request\x20sent');logger['debug'](_0x198a('0x12'),_0x16146e,'request\x20sent',JSON[_0x198a('0x13')](_0x53af17));if(_0x53af17[_0x198a('0x14')]){if(_0x53af17[_0x198a('0x14')][_0x198a('0x15')]===0x1f4){logger[_0x198a('0x14')](_0x198a('0x11'),_0x16146e,_0x53af17[_0x198a('0x14')][_0x198a('0x16')]);return _0x14efab(_0x53af17[_0x198a('0x14')][_0x198a('0x16')]);}logger[_0x198a('0x14')](_0x198a('0x11'),_0x16146e,_0x53af17[_0x198a('0x14')][_0x198a('0x16')]);return _0x3141b1(_0x53af17[_0x198a('0x14')]['message']);}else{logger[_0x198a('0x10')](_0x198a('0x11'),_0x16146e,_0x198a('0x17'));_0x3141b1(_0x53af17[_0x198a('0x18')][_0x198a('0x16')]);}})['catch'](function(_0x2b4e79){logger[_0x198a('0x14')]('Dashboard,\x20%s,\x20%s',_0x16146e,_0x2b4e79);_0x14efab(_0x2b4e79);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 94811dd..e99f149 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 _0xc13b=['remove','emit','register','save'];(function(_0x1a595a,_0x263824){var _0x33f008=function(_0x1e2f9c){while(--_0x1e2f9c){_0x1a595a['push'](_0x1a595a['shift']());}};_0x33f008(++_0x263824);}(_0xc13b,0xf7));var _0xbc13=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0xc13b[_0x5bd426];return _0x23a7eb;};'use strict';var DashboardEvents=require('./dashboard.events');var events=[_0xbc13('0x0'),_0xbc13('0x1'),'update'];function createListener(_0x358f5b,_0x245686){return function(_0xf46ca7){_0x245686[_0xbc13('0x2')](_0x358f5b,_0xf46ca7);};}function removeListener(_0x5e26b9,_0x539220){return function(){DashboardEvents['removeListener'](_0x5e26b9,_0x539220);};}exports[_0xbc13('0x3')]=function(_0x59f70f){for(var _0x920b29=0x0,_0x4e01bd=events['length'];_0x920b29<_0x4e01bd;_0x920b29++){var _0x41a577=events[_0x920b29];var _0x2ce84e=createListener('dashboard:'+_0x41a577,_0x59f70f);DashboardEvents['on'](_0x41a577,_0x2ce84e);}}; \ No newline at end of file +var _0x6182=['removeListener','length','dashboard:','./dashboard.events','save','update','emit'];(function(_0x19e85e,_0x1f0381){var _0x233cbe=function(_0x4fa026){while(--_0x4fa026){_0x19e85e['push'](_0x19e85e['shift']());}};_0x233cbe(++_0x1f0381);}(_0x6182,0x1ed));var _0x2618=function(_0xd546a9,_0x4936be){_0xd546a9=_0xd546a9-0x0;var _0x547be7=_0x6182[_0xd546a9];return _0x547be7;};'use strict';var DashboardEvents=require(_0x2618('0x0'));var events=[_0x2618('0x1'),'remove',_0x2618('0x2')];function createListener(_0x352f97,_0x4f14c5){return function(_0x3a22a1){_0x4f14c5[_0x2618('0x3')](_0x352f97,_0x3a22a1);};}function removeListener(_0x594449,_0x2488a8){return function(){DashboardEvents[_0x2618('0x4')](_0x594449,_0x2488a8);};}exports['register']=function(_0x4d5f6d){for(var _0x5312a5=0x0,_0x2a725c=events[_0x2618('0x5')];_0x5312a5<_0x2a725c;_0x5312a5++){var _0xa09d20=events[_0x5312a5];var _0x4918b9=createListener(_0x2618('0x6')+_0xa09d20,_0x4d5f6d);DashboardEvents['on'](_0xa09d20,_0x4918b9);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 62d7ad1..4b9e269 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 _0xe706=['../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','/:id','show','/:id/items','getItems','post','create','/:id/clone','clone','addItem','put','update','delete','multer','util','path','express','Router'];(function(_0x118733,_0x2bd820){var _0x4777af=function(_0x52886a){while(--_0x52886a){_0x118733['push'](_0x118733['shift']());}};_0x4777af(++_0x2bd820);}(_0xe706,0xa3));var _0x6e70=function(_0x1d1d09,_0x504d77){_0x1d1d09=_0x1d1d09-0x0;var _0x8827e=_0xe706[_0x1d1d09];return _0x8827e;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var auth=require(_0x6e70('0x5'));var interaction=require(_0x6e70('0x6'));var config=require(_0x6e70('0x7'));var controller=require(_0x6e70('0x8'));router[_0x6e70('0x9')]('/',auth[_0x6e70('0xa')](),controller[_0x6e70('0xb')]);router[_0x6e70('0x9')](_0x6e70('0xc'),auth[_0x6e70('0xa')](),controller[_0x6e70('0xd')]);router[_0x6e70('0x9')](_0x6e70('0xe'),auth[_0x6e70('0xa')](),controller[_0x6e70('0xf')]);router[_0x6e70('0x10')]('/',auth[_0x6e70('0xa')](),controller[_0x6e70('0x11')]);router[_0x6e70('0x10')](_0x6e70('0x12'),auth[_0x6e70('0xa')](),controller[_0x6e70('0x13')]);router['post']('/:id/items',auth[_0x6e70('0xa')](),controller[_0x6e70('0x14')]);router[_0x6e70('0x15')](_0x6e70('0xc'),auth[_0x6e70('0xa')](),controller[_0x6e70('0x16')]);router[_0x6e70('0x17')](_0x6e70('0xc'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x70e0=['util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','show','/:id/items','isAuthenticated','getItems','post','/:id/clone','clone','addItem','put','/:id','update','multer'];(function(_0x2a2697,_0x421451){var _0x50ecf0=function(_0x399016){while(--_0x399016){_0x2a2697['push'](_0x2a2697['shift']());}};_0x50ecf0(++_0x421451);}(_0x70e0,0x17b));var _0x070e=function(_0x52b991,_0x183d0a){_0x52b991=_0x52b991-0x0;var _0x2f2521=_0x70e0[_0x52b991];return _0x2f2521;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var auth=require(_0x070e('0x4'));var interaction=require(_0x070e('0x5'));var config=require(_0x070e('0x6'));var controller=require('./dashboard.controller');router[_0x070e('0x7')]('/',auth['isAuthenticated'](),controller[_0x070e('0x8')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x070e('0x9')]);router[_0x070e('0x7')](_0x070e('0xa'),auth[_0x070e('0xb')](),controller[_0x070e('0xc')]);router[_0x070e('0xd')]('/',auth[_0x070e('0xb')](),controller['create']);router['post'](_0x070e('0xe'),auth[_0x070e('0xb')](),controller[_0x070e('0xf')]);router[_0x070e('0xd')](_0x070e('0xa'),auth[_0x070e('0xb')](),controller[_0x070e('0x10')]);router[_0x070e('0x11')](_0x070e('0x12'),auth[_0x070e('0xb')](),controller[_0x070e('0x13')]);router['delete']('/:id',auth[_0x070e('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 46affee..4a5e29c 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 _0x95bb=['sequelize','squel','lodash','exports','STRING','TEXT','long','parse','getDataValue','attrs','stringify','setDataValue','INTEGER','#ffffff','#2196f3'];(function(_0x3e73f6,_0x4f7f01){var _0x5af991=function(_0x186e5a){while(--_0x186e5a){_0x3e73f6['push'](_0x3e73f6['shift']());}};_0x5af991(++_0x4f7f01);}(_0x95bb,0x78));var _0xb95b=function(_0xc5c1e3,_0x24b696){_0xc5c1e3=_0xc5c1e3-0x0;var _0x479ce9=_0x95bb[_0xc5c1e3];return _0x479ce9;};'use strict';var Sequelize=require(_0xb95b('0x0'));var squel=require(_0xb95b('0x1'));var _=require(_0xb95b('0x2'));module[_0xb95b('0x3')]={'title':{'type':Sequelize[_0xb95b('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0xb95b('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xb95b('0x5')](_0xb95b('0x6')),'get':function(){try{return JSON[_0xb95b('0x7')](this[_0xb95b('0x8')]('attrs'));}catch(_0x222ddf){return[];}},'set':function(_0x13637f){try{this['setDataValue'](_0xb95b('0x9'),JSON[_0xb95b('0xa')](_0x13637f));}catch(_0x3119f1){this[_0xb95b('0xb')](_0xb95b('0x9'),JSON[_0xb95b('0xa')]([]));}}},'sizeX':{'type':Sequelize[_0xb95b('0xc')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xb95b('0xc')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xb95b('0xc')]},'col':{'type':Sequelize['INTEGER']},'background':{'type':Sequelize[_0xb95b('0x4')],'allowNull':![],'defaultValue':_0xb95b('0xd'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xb95b('0x4')],'allowNull':![],'defaultValue':_0xb95b('0xe'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xb95b('0x4')]}}; \ No newline at end of file +var _0x6617=['squel','lodash','exports','STRING','TEXT','setDataValue','attrs','stringify','INTEGER','#ffffff','sequelize'];(function(_0x40c98f,_0x538320){var _0x2380b5=function(_0xb737d2){while(--_0xb737d2){_0x40c98f['push'](_0x40c98f['shift']());}};_0x2380b5(++_0x538320);}(_0x6617,0x18b));var _0x7661=function(_0x479160,_0x3ab560){_0x479160=_0x479160-0x0;var _0x47ac6d=_0x6617[_0x479160];return _0x47ac6d;};'use strict';var Sequelize=require(_0x7661('0x0'));var squel=require(_0x7661('0x1'));var _=require(_0x7661('0x2'));module[_0x7661('0x3')]={'title':{'type':Sequelize[_0x7661('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0x7661('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x7661('0x5')]('long'),'get':function(){try{return JSON['parse'](this['getDataValue']('attrs'));}catch(_0x418206){return[];}},'set':function(_0x12e0a8){try{this[_0x7661('0x6')](_0x7661('0x7'),JSON['stringify'](_0x12e0a8));}catch(_0x29ac29){this[_0x7661('0x6')](_0x7661('0x7'),JSON[_0x7661('0x8')]([]));}}},'sizeX':{'type':Sequelize[_0x7661('0x9')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x7661('0x9')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x7661('0x9')]},'col':{'type':Sequelize[_0x7661('0x9')]},'background':{'type':Sequelize[_0x7661('0x4')],'allowNull':![],'defaultValue':_0x7661('0xa'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x7661('0x4')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index ee82045..72ac45b 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 _0x32ab=['querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','./dashboardItem.socket','register','status','end','count','offset','set','Content-Range','json','apply','save','update','sendStatus','stack','name','send','show','params','model','keys','DashboardItem','rawAttributes','query','filters','intersection','fields','attributes','length','includeAll','include','merge','find','then','catch','destroy','iframe','attrUrl','attrs','https://','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','type','attrRefresh','error','widgetAttributes:\x20%s','stringify','create','body','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x32ab,0x1af));var _0xb32a=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x32ab[_0x5d6456];return _0x4d66c1;};'use strict';var pdf=require(_0xb32a('0x0'));var emlformat=require(_0xb32a('0x1'));var rimraf=require(_0xb32a('0x2'));var zipdir=require(_0xb32a('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb32a('0x4'));var moment=require(_0xb32a('0x5'));var BPromise=require(_0xb32a('0x6'));var Mustache=require(_0xb32a('0x7'));var util=require(_0xb32a('0x8'));var path=require('path');var sox=require(_0xb32a('0x9'));var csv=require(_0xb32a('0xa'));var ejs=require(_0xb32a('0xb'));var fs=require('fs');var _=require(_0xb32a('0xc'));var squel=require('squel');var crypto=require(_0xb32a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb32a('0xa'));var querystring=require(_0xb32a('0xe'));var Papa=require('papaparse');var Redis=require(_0xb32a('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xb32a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb32a('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0xb32a('0x12'));var config=require(_0xb32a('0x13'));var db=require(_0xb32a('0x14'))['db'];config[_0xb32a('0x15')]=_[_0xb32a('0x16')](config[_0xb32a('0x15')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xb32a('0x17'))[_0xb32a('0x18')](socket);function respondWithStatusCode(_0x41391a,_0x29498){_0x29498=_0x29498||0xcc;return function(_0x229a93){if(_0x229a93){return _0x41391a['sendStatus'](_0x29498);}return _0x41391a[_0xb32a('0x19')](_0x29498)[_0xb32a('0x1a')]();};}function respondWithResult(_0x2a455d,_0x2b8bef){_0x2b8bef=_0x2b8bef||0xc8;return function(_0x32d455){if(_0x32d455){return _0x2a455d[_0xb32a('0x19')](_0x2b8bef)['json'](_0x32d455);}};}function respondWithFilteredResult(_0x11505a,_0x56f2ef){return function(_0x2f0eff){if(_0x2f0eff){var _0x5569b5=_0x2f0eff[_0xb32a('0x1b')],_0x128e37=_0x56f2ef[_0xb32a('0x1c')],_0x463fd7=_0x56f2ef[_0xb32a('0x1c')]+_0x56f2ef['limit'],_0x9e43be;if(_0x463fd7>=_0x5569b5){_0x463fd7=_0x5569b5;_0x9e43be=0xc8;}else{_0x9e43be=0xce;}_0x11505a['status'](_0x9e43be);return _0x11505a[_0xb32a('0x1d')](_0xb32a('0x1e'),_0x128e37+'-'+_0x463fd7+'/'+_0x5569b5)[_0xb32a('0x1f')](_0x2f0eff);}return null;};}function patchUpdates(_0x246317){return function(_0x45453a){try{jsonpatch[_0xb32a('0x20')](_0x45453a,_0x246317,!![]);}catch(_0x2bb035){return BPromise['reject'](_0x2bb035);}return _0x45453a[_0xb32a('0x21')]();};}function saveUpdates(_0x429b0b,_0x40af1f){return function(_0x4da8b5){if(_0x4da8b5){return _0x4da8b5[_0xb32a('0x22')](_0x429b0b)['then'](function(_0x42fff9){return _0x42fff9;});}return null;};}function removeEntity(_0x4b9b5d,_0x15fb49){return function(_0x1fc852){if(_0x1fc852){return _0x1fc852['destroy']()['then'](function(){_0x4b9b5d[_0xb32a('0x19')](0xcc)[_0xb32a('0x1a')]();});}};}function handleEntityNotFound(_0x29df60,_0x24081f){return function(_0x4d67f2){if(!_0x4d67f2){_0x29df60[_0xb32a('0x23')](0x194);}return _0x4d67f2;};}function handleError(_0x2a51f9,_0x2ececf){_0x2ececf=_0x2ececf||0x1f4;return function(_0x5afc59){logger['error'](_0x5afc59[_0xb32a('0x24')]);if(_0x5afc59[_0xb32a('0x25')]){delete _0x5afc59[_0xb32a('0x25')];}_0x2a51f9[_0xb32a('0x19')](_0x2ececf)[_0xb32a('0x26')](_0x5afc59);};}exports[_0xb32a('0x27')]=function(_0xfa31be,_0x339133){var _0x366bd9={'raw':![],'where':{'id':_0xfa31be[_0xb32a('0x28')]['id']}},_0x2e10b9={};_0x2e10b9[_0xb32a('0x29')]=_[_0xb32a('0x2a')](db[_0xb32a('0x2b')][_0xb32a('0x2c')]);_0x2e10b9[_0xb32a('0x2d')]=_['keys'](_0xfa31be['query']);_0x2e10b9[_0xb32a('0x2e')]=_[_0xb32a('0x2f')](_0x2e10b9['model'],_0x2e10b9[_0xb32a('0x2d')]);_0x366bd9['attributes']=_[_0xb32a('0x2f')](_0x2e10b9[_0xb32a('0x29')],qs[_0xb32a('0x30')](_0xfa31be[_0xb32a('0x2d')][_0xb32a('0x30')]));_0x366bd9[_0xb32a('0x31')]=_0x366bd9['attributes'][_0xb32a('0x32')]?_0x366bd9['attributes']:_0x2e10b9[_0xb32a('0x29')];if(_0xfa31be[_0xb32a('0x2d')][_0xb32a('0x33')]){_0x366bd9[_0xb32a('0x34')]=[{'all':!![]}];}_0x366bd9=_[_0xb32a('0x35')]({},_0x366bd9,_0xfa31be['options']);return db[_0xb32a('0x2b')][_0xb32a('0x36')](_0x366bd9)[_0xb32a('0x37')](handleEntityNotFound(_0x339133,null))[_0xb32a('0x37')](respondWithResult(_0x339133,null))[_0xb32a('0x38')](handleError(_0x339133,null));};exports[_0xb32a('0x39')]=function(_0x3d1c5e,_0x25e7d6){return db[_0xb32a('0x2b')][_0xb32a('0x36')]({'where':{'id':_0x3d1c5e['params']['id']}})[_0xb32a('0x37')](handleEntityNotFound(_0x25e7d6,null))[_0xb32a('0x37')](removeEntity(_0x25e7d6,null))[_0xb32a('0x38')](handleError(_0x25e7d6,null));};function widgetAttributes(_0x2977d3){try{switch(_0x2977d3['type']){case _0xb32a('0x3a'):return[{'name':_0xb32a('0x3b'),'value':_0x2977d3[_0xb32a('0x3b')]||(_0x2977d3[_0xb32a('0x3c')]&&_0x2977d3['attrs'][0x0]?_0x2977d3[_0xb32a('0x3c')][0x0]['value']:undefined)||_0xb32a('0x3d')}];case'custom':return[{'name':_0xb32a('0x3e'),'value':_0x2977d3['attrPath']||(_0x2977d3[_0xb32a('0x3c')]&&_0x2977d3[_0xb32a('0x3c')][0x0]?_0x2977d3[_0xb32a('0x3c')][0x0][_0xb32a('0x3f')]:undefined)||''}];case _0xb32a('0x40'):return[{'name':_0xb32a('0x41'),'value':_0x2977d3[_0xb32a('0x41')]||(_0x2977d3['attrs']&&_0x2977d3[_0xb32a('0x3c')][0x0]?_0x2977d3[_0xb32a('0x3c')][0x0][_0xb32a('0x3f')]:undefined)||_0xb32a('0x42')},{'name':_0xb32a('0x43'),'value':_0x2977d3[_0xb32a('0x43')]||(_0x2977d3[_0xb32a('0x3c')]&&_0x2977d3['attrs'][0x1]?_0x2977d3[_0xb32a('0x3c')][0x1][_0xb32a('0x3f')]:undefined)||_0xb32a('0x44')},{'name':_0xb32a('0x45'),'value':_0x2977d3['attrFontSize']||(_0x2977d3[_0xb32a('0x3c')]&&_0x2977d3[_0xb32a('0x3c')][0x2]?_0x2977d3[_0xb32a('0x3c')][0x2]['value']:undefined)||0xc}];case _0xb32a('0x46'):return[{'name':'attrMetric','value':_0x2977d3[_0xb32a('0x47')]||(_0x2977d3[_0xb32a('0x3c')]&&_0x2977d3[_0xb32a('0x3c')][0x0]?_0x2977d3[_0xb32a('0x3c')][0x0][_0xb32a('0x3f')]:undefined)||_0xb32a('0x48')},{'name':_0xb32a('0x49'),'value':_0x2977d3[_0xb32a('0x49')]||(_0x2977d3[_0xb32a('0x3c')]&&_0x2977d3[_0xb32a('0x3c')][0x1]?_0x2977d3[_0xb32a('0x3c')][0x1][_0xb32a('0x3f')]:undefined)||[]},{'name':'attrFontSize','value':_0x2977d3[_0xb32a('0x45')]||(_0x2977d3[_0xb32a('0x3c')]&&_0x2977d3['attrs'][0x2]?_0x2977d3['attrs'][0x2][_0xb32a('0x3f')]:undefined)||0x14}];case _0xb32a('0x4a'):case _0xb32a('0x4b'):return[{'name':_0xb32a('0x4c'),'value':_0x2977d3['attrSerie1']||(_0x2977d3[_0xb32a('0x3c')]&&_0x2977d3[_0xb32a('0x3c')][0x0]?_0x2977d3['attrs'][0x0][_0xb32a('0x3f')]:undefined)||_0xb32a('0x48')},{'name':_0xb32a('0x4d'),'value':_0x2977d3['attrSerie2']||(_0x2977d3[_0xb32a('0x3c')]&&_0x2977d3[_0xb32a('0x3c')][0x1]?_0x2977d3[_0xb32a('0x3c')][0x1][_0xb32a('0x3f')]:undefined)||null},{'name':_0xb32a('0x4e'),'value':_0x2977d3['attrSerie3']||(_0x2977d3['attrs']&&_0x2977d3['attrs'][0x2]?_0x2977d3['attrs'][0x2]['value']:undefined)||null},{'name':_0xb32a('0x49'),'value':_0x2977d3['attrVoiceQueues']||(_0x2977d3[_0xb32a('0x3c')]&&_0x2977d3['attrs'][0x3]?_0x2977d3['attrs'][0x3][_0xb32a('0x3f')]:undefined)||[]}];case _0xb32a('0x4f'):return[{'name':_0xb32a('0x50'),'type':_0x2977d3[_0xb32a('0x51')]||(_0x2977d3[_0xb32a('0x3c')]&&_0x2977d3[_0xb32a('0x3c')][0x0]?_0x2977d3[_0xb32a('0x3c')][0x0][_0xb32a('0x52')]:undefined)||null,'value':_0x2977d3[_0xb32a('0x50')]||(_0x2977d3[_0xb32a('0x3c')]&&_0x2977d3[_0xb32a('0x3c')][0x0]?_0x2977d3[_0xb32a('0x3c')][0x0][_0xb32a('0x3f')]:undefined)||null},{'name':_0xb32a('0x53'),'value':_0x2977d3[_0xb32a('0x53')]||(_0x2977d3['attrs']&&_0x2977d3['attrs'][0x1]?_0x2977d3[_0xb32a('0x3c')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x4c8138){logger[_0xb32a('0x54')](_0xb32a('0x55'),JSON[_0xb32a('0x56')](_0x4c8138));return[];}}exports[_0xb32a('0x57')]=function(_0x1e414c,_0x2ec239){if(_0x1e414c[_0xb32a('0x58')]){_0x1e414c['body'][_0xb32a('0x3c')]=widgetAttributes(_0x1e414c[_0xb32a('0x58')]);}return db[_0xb32a('0x2b')][_0xb32a('0x57')](_0x1e414c[_0xb32a('0x58')],{})['then'](respondWithResult(_0x2ec239,0xc9))[_0xb32a('0x38')](handleError(_0x2ec239,null));};exports['update']=function(_0x2abce9,_0x293499){if(_0x2abce9[_0xb32a('0x58')]['id']){delete _0x2abce9[_0xb32a('0x58')]['id'];}_0x2abce9[_0xb32a('0x58')][_0xb32a('0x3c')]=widgetAttributes(_0x2abce9[_0xb32a('0x58')]);return db[_0xb32a('0x2b')][_0xb32a('0x36')]({'where':{'id':_0x2abce9['params']['id']}})['then'](handleEntityNotFound(_0x293499,null))[_0xb32a('0x37')](saveUpdates(_0x2abce9[_0xb32a('0x58')],null))[_0xb32a('0x37')](respondWithResult(_0x293499,null))[_0xb32a('0x38')](handleError(_0x293499,null));}; \ No newline at end of file +var _0x7811=['params','model','keys','DashboardItem','rawAttributes','query','filters','attributes','fields','length','includeAll','merge','options','find','then','catch','attrUrl','attrs','value','https://','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','type','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','update','html-pdf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','count','offset','limit','set','Content-Range','json','reject','destroy','error','stack','name','send','show'];(function(_0x135bcc,_0x59cc48){var _0xb03ff=function(_0x27f08e){while(--_0x27f08e){_0x135bcc['push'](_0x135bcc['shift']());}};_0xb03ff(++_0x59cc48);}(_0x7811,0xd7));var _0x1781=function(_0x56e718,_0xd25942){_0x56e718=_0x56e718-0x0;var _0x55f85e=_0x7811[_0x56e718];return _0x55f85e;};'use strict';var pdf=require(_0x1781('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1781('0x1'));var rp=require(_0x1781('0x2'));var moment=require(_0x1781('0x3'));var BPromise=require(_0x1781('0x4'));var Mustache=require('mustache');var util=require(_0x1781('0x5'));var path=require(_0x1781('0x6'));var sox=require('sox');var csv=require(_0x1781('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x1781('0x8'));var squel=require('squel');var crypto=require(_0x1781('0x9'));var jsforce=require(_0x1781('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x1781('0x7'));var querystring=require(_0x1781('0xb'));var Papa=require('papaparse');var Redis=require(_0x1781('0xc'));var authService=require(_0x1781('0xd'));var qs=require(_0x1781('0xe'));var as=require(_0x1781('0xf'));var hardwareService=require(_0x1781('0x10'));var logger=require(_0x1781('0x11'))(_0x1781('0x12'));var utils=require(_0x1781('0x13'));var config=require(_0x1781('0x14'));var db=require(_0x1781('0x15'))['db'];config[_0x1781('0x16')]=_[_0x1781('0x17')](config[_0x1781('0x16')],{'host':_0x1781('0x18'),'port':0x18eb});var socket=require(_0x1781('0x19'))(new Redis(config['redis']));require('./dashboardItem.socket')[_0x1781('0x1a')](socket);function respondWithStatusCode(_0x3e694b,_0x5164ba){_0x5164ba=_0x5164ba||0xcc;return function(_0x48479c){if(_0x48479c){return _0x3e694b[_0x1781('0x1b')](_0x5164ba);}return _0x3e694b[_0x1781('0x1c')](_0x5164ba)[_0x1781('0x1d')]();};}function respondWithResult(_0x5dc2f3,_0x54317f){_0x54317f=_0x54317f||0xc8;return function(_0x5a0456){if(_0x5a0456){return _0x5dc2f3[_0x1781('0x1c')](_0x54317f)['json'](_0x5a0456);}};}function respondWithFilteredResult(_0x373480,_0x2a2f2b){return function(_0xee96ff){if(_0xee96ff){var _0x8ed864=_0xee96ff[_0x1781('0x1e')],_0x55e16f=_0x2a2f2b['offset'],_0x53c71c=_0x2a2f2b[_0x1781('0x1f')]+_0x2a2f2b[_0x1781('0x20')],_0x56ebbc;if(_0x53c71c>=_0x8ed864){_0x53c71c=_0x8ed864;_0x56ebbc=0xc8;}else{_0x56ebbc=0xce;}_0x373480[_0x1781('0x1c')](_0x56ebbc);return _0x373480[_0x1781('0x21')](_0x1781('0x22'),_0x55e16f+'-'+_0x53c71c+'/'+_0x8ed864)[_0x1781('0x23')](_0xee96ff);}return null;};}function patchUpdates(_0x3177cd){return function(_0x7c5d5a){try{jsonpatch['apply'](_0x7c5d5a,_0x3177cd,!![]);}catch(_0x5a5b1d){return BPromise[_0x1781('0x24')](_0x5a5b1d);}return _0x7c5d5a['save']();};}function saveUpdates(_0x4c8fbf,_0x1e3b9c){return function(_0x57b977){if(_0x57b977){return _0x57b977['update'](_0x4c8fbf)['then'](function(_0x2442ca){return _0x2442ca;});}return null;};}function removeEntity(_0x3a30e4,_0x4feb4e){return function(_0x5345fb){if(_0x5345fb){return _0x5345fb[_0x1781('0x25')]()['then'](function(){_0x3a30e4[_0x1781('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38aab0,_0xc07848){return function(_0xdb9320){if(!_0xdb9320){_0x38aab0[_0x1781('0x1b')](0x194);}return _0xdb9320;};}function handleError(_0x300869,_0x46504e){_0x46504e=_0x46504e||0x1f4;return function(_0x48b0a5){logger[_0x1781('0x26')](_0x48b0a5[_0x1781('0x27')]);if(_0x48b0a5[_0x1781('0x28')]){delete _0x48b0a5['name'];}_0x300869[_0x1781('0x1c')](_0x46504e)[_0x1781('0x29')](_0x48b0a5);};}exports[_0x1781('0x2a')]=function(_0xe25cd0,_0x142681){var _0x1019ab={'raw':![],'where':{'id':_0xe25cd0[_0x1781('0x2b')]['id']}},_0x243200={};_0x243200[_0x1781('0x2c')]=_[_0x1781('0x2d')](db[_0x1781('0x2e')][_0x1781('0x2f')]);_0x243200[_0x1781('0x30')]=_[_0x1781('0x2d')](_0xe25cd0[_0x1781('0x30')]);_0x243200[_0x1781('0x31')]=_['intersection'](_0x243200[_0x1781('0x2c')],_0x243200[_0x1781('0x30')]);_0x1019ab[_0x1781('0x32')]=_['intersection'](_0x243200[_0x1781('0x2c')],qs[_0x1781('0x33')](_0xe25cd0[_0x1781('0x30')][_0x1781('0x33')]));_0x1019ab[_0x1781('0x32')]=_0x1019ab[_0x1781('0x32')][_0x1781('0x34')]?_0x1019ab[_0x1781('0x32')]:_0x243200[_0x1781('0x2c')];if(_0xe25cd0[_0x1781('0x30')][_0x1781('0x35')]){_0x1019ab['include']=[{'all':!![]}];}_0x1019ab=_[_0x1781('0x36')]({},_0x1019ab,_0xe25cd0[_0x1781('0x37')]);return db[_0x1781('0x2e')][_0x1781('0x38')](_0x1019ab)[_0x1781('0x39')](handleEntityNotFound(_0x142681,null))[_0x1781('0x39')](respondWithResult(_0x142681,null))['catch'](handleError(_0x142681,null));};exports[_0x1781('0x25')]=function(_0x38340b,_0x1fb328){return db['DashboardItem']['find']({'where':{'id':_0x38340b[_0x1781('0x2b')]['id']}})[_0x1781('0x39')](handleEntityNotFound(_0x1fb328,null))[_0x1781('0x39')](removeEntity(_0x1fb328,null))[_0x1781('0x3a')](handleError(_0x1fb328,null));};function widgetAttributes(_0x2385fa){try{switch(_0x2385fa['type']){case'iframe':return[{'name':_0x1781('0x3b'),'value':_0x2385fa[_0x1781('0x3b')]||(_0x2385fa[_0x1781('0x3c')]&&_0x2385fa[_0x1781('0x3c')][0x0]?_0x2385fa[_0x1781('0x3c')][0x0][_0x1781('0x3d')]:undefined)||_0x1781('0x3e')}];case'custom':return[{'name':'attrPath','value':_0x2385fa['attrPath']||(_0x2385fa[_0x1781('0x3c')]&&_0x2385fa[_0x1781('0x3c')][0x0]?_0x2385fa[_0x1781('0x3c')][0x0][_0x1781('0x3d')]:undefined)||''}];case _0x1781('0x3f'):return[{'name':_0x1781('0x40'),'value':_0x2385fa[_0x1781('0x40')]||(_0x2385fa['attrs']&&_0x2385fa[_0x1781('0x3c')][0x0]?_0x2385fa[_0x1781('0x3c')][0x0]['value']:undefined)||_0x1781('0x41')},{'name':_0x1781('0x42'),'value':_0x2385fa[_0x1781('0x42')]||(_0x2385fa['attrs']&&_0x2385fa[_0x1781('0x3c')][0x1]?_0x2385fa['attrs'][0x1][_0x1781('0x3d')]:undefined)||_0x1781('0x43')},{'name':_0x1781('0x44'),'value':_0x2385fa[_0x1781('0x44')]||(_0x2385fa[_0x1781('0x3c')]&&_0x2385fa['attrs'][0x2]?_0x2385fa[_0x1781('0x3c')][0x2]['value']:undefined)||0xc}];case _0x1781('0x45'):return[{'name':_0x1781('0x46'),'value':_0x2385fa[_0x1781('0x46')]||(_0x2385fa['attrs']&&_0x2385fa[_0x1781('0x3c')][0x0]?_0x2385fa[_0x1781('0x3c')][0x0][_0x1781('0x3d')]:undefined)||_0x1781('0x47')},{'name':_0x1781('0x48'),'value':_0x2385fa[_0x1781('0x48')]||(_0x2385fa[_0x1781('0x3c')]&&_0x2385fa[_0x1781('0x3c')][0x1]?_0x2385fa[_0x1781('0x3c')][0x1][_0x1781('0x3d')]:undefined)||[]},{'name':_0x1781('0x44'),'value':_0x2385fa[_0x1781('0x44')]||(_0x2385fa['attrs']&&_0x2385fa[_0x1781('0x3c')][0x2]?_0x2385fa[_0x1781('0x3c')][0x2][_0x1781('0x3d')]:undefined)||0x14}];case _0x1781('0x49'):case'pie-chart':return[{'name':_0x1781('0x4a'),'value':_0x2385fa[_0x1781('0x4a')]||(_0x2385fa[_0x1781('0x3c')]&&_0x2385fa[_0x1781('0x3c')][0x0]?_0x2385fa[_0x1781('0x3c')][0x0][_0x1781('0x3d')]:undefined)||_0x1781('0x47')},{'name':_0x1781('0x4b'),'value':_0x2385fa[_0x1781('0x4b')]||(_0x2385fa[_0x1781('0x3c')]&&_0x2385fa[_0x1781('0x3c')][0x1]?_0x2385fa[_0x1781('0x3c')][0x1][_0x1781('0x3d')]:undefined)||null},{'name':_0x1781('0x4c'),'value':_0x2385fa[_0x1781('0x4c')]||(_0x2385fa[_0x1781('0x3c')]&&_0x2385fa['attrs'][0x2]?_0x2385fa[_0x1781('0x3c')][0x2][_0x1781('0x3d')]:undefined)||null},{'name':_0x1781('0x48'),'value':_0x2385fa[_0x1781('0x48')]||(_0x2385fa[_0x1781('0x3c')]&&_0x2385fa['attrs'][0x3]?_0x2385fa[_0x1781('0x3c')][0x3][_0x1781('0x3d')]:undefined)||[]}];case _0x1781('0x4d'):return[{'name':_0x1781('0x4e'),'type':_0x2385fa['reportType']||(_0x2385fa[_0x1781('0x3c')]&&_0x2385fa[_0x1781('0x3c')][0x0]?_0x2385fa[_0x1781('0x3c')][0x0][_0x1781('0x4f')]:undefined)||null,'value':_0x2385fa[_0x1781('0x4e')]||(_0x2385fa[_0x1781('0x3c')]&&_0x2385fa[_0x1781('0x3c')][0x0]?_0x2385fa['attrs'][0x0][_0x1781('0x3d')]:undefined)||null},{'name':_0x1781('0x50'),'value':_0x2385fa[_0x1781('0x50')]||(_0x2385fa['attrs']&&_0x2385fa[_0x1781('0x3c')][0x1]?_0x2385fa['attrs'][0x1][_0x1781('0x3d')]:undefined)||0x0}];default:return[];}}catch(_0x5198e7){logger[_0x1781('0x26')](_0x1781('0x51'),JSON[_0x1781('0x52')](_0x5198e7));return[];}}exports[_0x1781('0x53')]=function(_0x401927,_0x5e12a2){if(_0x401927[_0x1781('0x54')]){_0x401927[_0x1781('0x54')]['attrs']=widgetAttributes(_0x401927[_0x1781('0x54')]);}return db[_0x1781('0x2e')][_0x1781('0x53')](_0x401927[_0x1781('0x54')],{})['then'](respondWithResult(_0x5e12a2,0xc9))['catch'](handleError(_0x5e12a2,null));};exports[_0x1781('0x55')]=function(_0x390bb9,_0x2da9ed){if(_0x390bb9[_0x1781('0x54')]['id']){delete _0x390bb9['body']['id'];}_0x390bb9[_0x1781('0x54')][_0x1781('0x3c')]=widgetAttributes(_0x390bb9[_0x1781('0x54')]);return db[_0x1781('0x2e')][_0x1781('0x38')]({'where':{'id':_0x390bb9[_0x1781('0x2b')]['id']}})[_0x1781('0x39')](handleEntityNotFound(_0x2da9ed,null))[_0x1781('0x39')](saveUpdates(_0x390bb9[_0x1781('0x54')],null))[_0x1781('0x39')](respondWithResult(_0x2da9ed,null))[_0x1781('0x3a')](handleError(_0x2da9ed,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 275af26..187d46c 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 _0xfba8=['remove','hasOwnProperty','hook','exports','events','DashboardItem','update'];(function(_0x208fd7,_0x2bd162){var _0x468845=function(_0x3a2679){while(--_0x3a2679){_0x208fd7['push'](_0x208fd7['shift']());}};_0x468845(++_0x2bd162);}(_0xfba8,0x12a));var _0x8fba=function(_0x4527ec,_0x45e9a6){_0x4527ec=_0x4527ec-0x0;var _0x247771=_0xfba8[_0x4527ec];return _0x247771;};'use strict';var EventEmitter=require(_0x8fba('0x0'));var DashboardItem=require('../../mysqldb')['db'][_0x8fba('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x8fba('0x2'),'afterDestroy':_0x8fba('0x3')};function emitEvent(_0x5362db){return function(_0x1b25fe,_0x24470f,_0x5c6acf){DashboardItemEvents['emit'](_0x5362db+':'+_0x1b25fe['id'],_0x1b25fe);DashboardItemEvents['emit'](_0x5362db,_0x1b25fe);_0x5c6acf(null);};}for(var e in events){if(events[_0x8fba('0x4')](e)){var event=events[e];DashboardItem[_0x8fba('0x5')](e,emitEvent(event));}}module[_0x8fba('0x6')]=DashboardItemEvents; \ No newline at end of file +var _0xe526=['hasOwnProperty','hook','exports','events','../../mysqldb','DashboardItem','setMaxListeners','remove'];(function(_0x1fadc2,_0x41f131){var _0x3714c0=function(_0x39f5f6){while(--_0x39f5f6){_0x1fadc2['push'](_0x1fadc2['shift']());}};_0x3714c0(++_0x41f131);}(_0xe526,0x103));var _0x6e52=function(_0x35355b,_0xc36233){_0x35355b=_0x35355b-0x0;var _0x41a302=_0xe526[_0x35355b];return _0x41a302;};'use strict';var EventEmitter=require(_0x6e52('0x0'));var DashboardItem=require(_0x6e52('0x1'))['db'][_0x6e52('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x6e52('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x6e52('0x4')};function emitEvent(_0x3f63cb){return function(_0x2ece4e,_0x102e41,_0x15a563){DashboardItemEvents['emit'](_0x3f63cb+':'+_0x2ece4e['id'],_0x2ece4e);DashboardItemEvents['emit'](_0x3f63cb,_0x2ece4e);_0x15a563(null);};}for(var e in events){if(events[_0x6e52('0x5')](e)){var event=events[e];DashboardItem[_0x6e52('0x6')](e,emitEvent(event));}}module[_0x6e52('0x7')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 16f1771..d094fd8 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 _0x54c8=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','exports','define'];(function(_0x55511d,_0x2c8711){var _0x3fb91c=function(_0x4a87f2){while(--_0x4a87f2){_0x55511d['push'](_0x55511d['shift']());}};_0x3fb91c(++_0x2c8711);}(_0x54c8,0x1b8));var _0x854c=function(_0x258814,_0x280a0a){_0x258814=_0x258814-0x0;var _0x173dd6=_0x54c8[_0x258814];return _0x173dd6;};'use strict';var _=require(_0x854c('0x0'));var util=require(_0x854c('0x1'));var logger=require(_0x854c('0x2'))(_0x854c('0x3'));var moment=require(_0x854c('0x4'));var BPromise=require(_0x854c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x854c('0x6'));var rimraf=require(_0x854c('0x7'));var config=require('../../config/environment');var attributes=require('./dashboardItem.attributes');module[_0x854c('0x8')]=function(_0x48e424,_0x2fe875){return _0x48e424[_0x854c('0x9')]('DashboardItem',attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x201a=['../../config/logger','api','moment','bluebird','request-promise','../../config/environment','exports','define','util'];(function(_0x4574d9,_0x224f1a){var _0x30cea4=function(_0x4d26a5){while(--_0x4d26a5){_0x4574d9['push'](_0x4574d9['shift']());}};_0x30cea4(++_0x224f1a);}(_0x201a,0xc5));var _0xa201=function(_0xcd5247,_0x39f72e){_0xcd5247=_0xcd5247-0x0;var _0x452d40=_0x201a[_0xcd5247];return _0x452d40;};'use strict';var _=require('lodash');var util=require(_0xa201('0x0'));var logger=require(_0xa201('0x1'))(_0xa201('0x2'));var moment=require(_0xa201('0x3'));var BPromise=require(_0xa201('0x4'));var rp=require(_0xa201('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa201('0x6'));var attributes=require('./dashboardItem.attributes');module[_0xa201('0x7')]=function(_0x3125eb,_0x27d17a){return _0x3125eb[_0xa201('0x8')]('DashboardItem',attributes,{'tableName':'dashboard_items','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 82d782f..5d40d4c 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 _0x5a3c=['client','http','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','request','then','info','request\x20sent','debug','error','code','DashboardItem,\x20%s,\x20%s','message','result','lodash','util','moment','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5a3c,0xfc));var _0xc5a3=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0x5a3c[_0x4ea69d];return _0x5318e0;};'use strict';var _=require(_0xc5a3('0x0'));var util=require(_0xc5a3('0x1'));var moment=require(_0xc5a3('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc5a3('0x3'))['db'];var utils=require(_0xc5a3('0x4'));var logger=require('../../config/logger')(_0xc5a3('0x5'));var config=require(_0xc5a3('0x6'));var jayson=require(_0xc5a3('0x7'));var client=jayson[_0xc5a3('0x8')][_0xc5a3('0x9')]({'port':0x232a});config[_0xc5a3('0xa')]=_[_0xc5a3('0xb')](config[_0xc5a3('0xa')],{'host':_0xc5a3('0xc'),'port':0x18eb});var socket=require(_0xc5a3('0xd'))(new Redis(config[_0xc5a3('0xa')]));require(_0xc5a3('0xe'))[_0xc5a3('0xf')](socket);function respondWithRpcPromise(_0x365842,_0x411727,_0x5f1ae6){return new BPromise(function(_0xa0c428,_0x4d2868){return client[_0xc5a3('0x10')](_0x365842,_0x5f1ae6)[_0xc5a3('0x11')](function(_0x284b79){logger[_0xc5a3('0x12')]('DashboardItem,\x20%s,\x20%s',_0x411727,_0xc5a3('0x13'));logger[_0xc5a3('0x14')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0x411727,_0xc5a3('0x13'),JSON['stringify'](_0x284b79));if(_0x284b79[_0xc5a3('0x15')]){if(_0x284b79['error'][_0xc5a3('0x16')]===0x1f4){logger[_0xc5a3('0x15')](_0xc5a3('0x17'),_0x411727,_0x284b79['error']['message']);return _0x4d2868(_0x284b79[_0xc5a3('0x15')]['message']);}logger[_0xc5a3('0x15')]('DashboardItem,\x20%s,\x20%s',_0x411727,_0x284b79[_0xc5a3('0x15')][_0xc5a3('0x18')]);return _0xa0c428(_0x284b79[_0xc5a3('0x15')][_0xc5a3('0x18')]);}else{logger[_0xc5a3('0x12')](_0xc5a3('0x17'),_0x411727,_0xc5a3('0x13'));_0xa0c428(_0x284b79[_0xc5a3('0x19')][_0xc5a3('0x18')]);}})['catch'](function(_0xc805d5){logger[_0xc5a3('0x15')]('DashboardItem,\x20%s,\x20%s',_0x411727,_0xc805d5);_0x4d2868(_0xc805d5);});});} \ No newline at end of file +var _0x6bb4=['request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register'];(function(_0x1d40d5,_0x1ee7a0){var _0x28bdcb=function(_0x355f48){while(--_0x355f48){_0x1d40d5['push'](_0x1d40d5['shift']());}};_0x28bdcb(++_0x1ee7a0);}(_0x6bb4,0x11a));var _0x46bb=function(_0x2b522b,_0x15f23e){_0x2b522b=_0x2b522b-0x0;var _0xcc61ad=_0x6bb4[_0x2b522b];return _0xcc61ad;};'use strict';var _=require(_0x46bb('0x0'));var util=require(_0x46bb('0x1'));var moment=require(_0x46bb('0x2'));var BPromise=require(_0x46bb('0x3'));var rs=require(_0x46bb('0x4'));var fs=require('fs');var Redis=require(_0x46bb('0x5'));var db=require(_0x46bb('0x6'))['db'];var utils=require(_0x46bb('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x46bb('0x8'));var client=jayson[_0x46bb('0x9')]['http']({'port':0x232a});config[_0x46bb('0xa')]=_[_0x46bb('0xb')](config[_0x46bb('0xa')],{'host':_0x46bb('0xc'),'port':0x18eb});var socket=require(_0x46bb('0xd'))(new Redis(config[_0x46bb('0xa')]));require('./dashboardItem.socket')[_0x46bb('0xe')](socket);function respondWithRpcPromise(_0x25068e,_0x415357,_0x27a898){return new BPromise(function(_0x4933ba,_0xfc7978){return client[_0x46bb('0xf')](_0x25068e,_0x27a898)[_0x46bb('0x10')](function(_0x27d5db){logger[_0x46bb('0x11')](_0x46bb('0x12'),_0x415357,_0x46bb('0x13'));logger[_0x46bb('0x14')](_0x46bb('0x15'),_0x415357,'request\x20sent',JSON[_0x46bb('0x16')](_0x27d5db));if(_0x27d5db[_0x46bb('0x17')]){if(_0x27d5db['error'][_0x46bb('0x18')]===0x1f4){logger[_0x46bb('0x17')](_0x46bb('0x12'),_0x415357,_0x27d5db[_0x46bb('0x17')]['message']);return _0xfc7978(_0x27d5db['error']['message']);}logger[_0x46bb('0x17')](_0x46bb('0x12'),_0x415357,_0x27d5db['error'][_0x46bb('0x19')]);return _0x4933ba(_0x27d5db[_0x46bb('0x17')][_0x46bb('0x19')]);}else{logger[_0x46bb('0x11')](_0x46bb('0x12'),_0x415357,'request\x20sent');_0x4933ba(_0x27d5db[_0x46bb('0x1a')][_0x46bb('0x19')]);}})['catch'](function(_0x4a5463){logger[_0x46bb('0x17')](_0x46bb('0x12'),_0x415357,_0x4a5463);_0xfc7978(_0x4a5463);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 8a5cbf5..335c37c 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 _0x6002=['removeListener','length','./dashboardItem.events','save','remove','update','emit'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x6002,0xfe));var _0x2600=function(_0x51aa20,_0x59faff){_0x51aa20=_0x51aa20-0x0;var _0x4f75c2=_0x6002[_0x51aa20];return _0x4f75c2;};'use strict';var DashboardItemEvents=require(_0x2600('0x0'));var events=[_0x2600('0x1'),_0x2600('0x2'),_0x2600('0x3')];function createListener(_0x2a3d3a,_0x490fcc){return function(_0x59bd99){_0x490fcc[_0x2600('0x4')](_0x2a3d3a,_0x59bd99);};}function removeListener(_0x1a1e14,_0x428f1e){return function(){DashboardItemEvents[_0x2600('0x5')](_0x1a1e14,_0x428f1e);};}exports['register']=function(_0x549603){for(var _0x24fbb8=0x0,_0x124b73=events[_0x2600('0x6')];_0x24fbb8<_0x124b73;_0x24fbb8++){var _0x347fc2=events[_0x24fbb8];var _0x22de15=createListener('dashboardItem:'+_0x347fc2,_0x549603);DashboardItemEvents['on'](_0x347fc2,_0x22de15);}}; \ No newline at end of file +var _0x24b9=['register','dashboardItem:','save','remove','emit','removeListener'];(function(_0x4d4c63,_0x33ac30){var _0x383b63=function(_0x2520c6){while(--_0x2520c6){_0x4d4c63['push'](_0x4d4c63['shift']());}};_0x383b63(++_0x33ac30);}(_0x24b9,0x1b2));var _0x924b=function(_0x86dc24,_0x5d9af7){_0x86dc24=_0x86dc24-0x0;var _0x34e14e=_0x24b9[_0x86dc24];return _0x34e14e;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0x924b('0x0'),_0x924b('0x1'),'update'];function createListener(_0xf259e,_0x149aba){return function(_0x440bcf){_0x149aba[_0x924b('0x2')](_0xf259e,_0x440bcf);};}function removeListener(_0x3d4a9b,_0x53fa2c){return function(){DashboardItemEvents[_0x924b('0x3')](_0x3d4a9b,_0x53fa2c);};}exports[_0x924b('0x4')]=function(_0x3fcd76){for(var _0x2ebd0a=0x0,_0xf3e0bc=events['length'];_0x2ebd0a<_0xf3e0bc;_0x2ebd0a++){var _0x3e6689=events[_0x2ebd0a];var _0x5e0852=createListener(_0x924b('0x5')+_0x3e6689,_0x3fcd76);DashboardItemEvents['on'](_0x3e6689,_0x5e0852);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index dcef677..f113f0c 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 _0x187d=['delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./dashboardItem.controller','get','isAuthenticated','show','post','create','put','/:id'];(function(_0x1aeda2,_0x1217eb){var _0x32dc6d=function(_0x34a460){while(--_0x34a460){_0x1aeda2['push'](_0x1aeda2['shift']());}};_0x32dc6d(++_0x1217eb);}(_0x187d,0x93));var _0xd187=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x187d[_0x42245d];return _0x4b211a;};'use strict';var multer=require(_0xd187('0x0'));var util=require('util');var path=require(_0xd187('0x1'));var timeout=require(_0xd187('0x2'));var express=require(_0xd187('0x3'));var router=express[_0xd187('0x4')]();var auth=require(_0xd187('0x5'));var interaction=require(_0xd187('0x6'));var config=require('../../config/environment');var controller=require(_0xd187('0x7'));router[_0xd187('0x8')]('/:id',auth[_0xd187('0x9')](),controller[_0xd187('0xa')]);router[_0xd187('0xb')]('/',auth[_0xd187('0x9')](),controller[_0xd187('0xc')]);router[_0xd187('0xd')](_0xd187('0xe'),auth[_0xd187('0x9')](),controller['update']);router[_0xd187('0xf')](_0xd187('0xe'),auth[_0xd187('0x9')](),controller[_0xd187('0x10')]);module[_0xd187('0x11')]=router; \ No newline at end of file +var _0x4819=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','isAuthenticated','create','put','/:id','delete','exports','util','path','connect-timeout'];(function(_0x3afe18,_0x26922c){var _0x19ed1f=function(_0x1c0660){while(--_0x1c0660){_0x3afe18['push'](_0x3afe18['shift']());}};_0x19ed1f(++_0x26922c);}(_0x4819,0xcd));var _0x9481=function(_0x9c5512,_0x5651f1){_0x9c5512=_0x9c5512-0x0;var _0x5c4f5d=_0x4819[_0x9c5512];return _0x5c4f5d;};'use strict';var multer=require('multer');var util=require(_0x9481('0x0'));var path=require(_0x9481('0x1'));var timeout=require(_0x9481('0x2'));var express=require(_0x9481('0x3'));var router=express[_0x9481('0x4')]();var auth=require(_0x9481('0x5'));var interaction=require(_0x9481('0x6'));var config=require(_0x9481('0x7'));var controller=require(_0x9481('0x8'));router[_0x9481('0x9')]('/:id',auth[_0x9481('0xa')](),controller['show']);router['post']('/',auth[_0x9481('0xa')](),controller[_0x9481('0xb')]);router[_0x9481('0xc')](_0x9481('0xd'),auth[_0x9481('0xa')](),controller['update']);router[_0x9481('0xe')]('/:id',auth[_0x9481('0xa')](),controller['destroy']);module[_0x9481('0xf')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 41a2305..9e73316 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 _0x2454=['exports','STRING','sequelize'];(function(_0x2340b0,_0x2fff1e){var _0x73fac2=function(_0x13731d){while(--_0x13731d){_0x2340b0['push'](_0x2340b0['shift']());}};_0x73fac2(++_0x2fff1e);}(_0x2454,0x194));var _0x4245=function(_0x4387bf,_0x73e377){_0x4387bf=_0x4387bf-0x0;var _0x4ecb66=_0x2454[_0x4387bf];return _0x4ecb66;};'use strict';var Sequelize=require(_0x4245('0x0'));module[_0x4245('0x1')]={'name':{'type':Sequelize[_0x4245('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x5944=['STRING','sequelize','exports'];(function(_0x35a23d,_0x10be6a){var _0x902d82=function(_0x55f433){while(--_0x55f433){_0x35a23d['push'](_0x35a23d['shift']());}};_0x902d82(++_0x10be6a);}(_0x5944,0x1e1));var _0x4594=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x5944[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x4594('0x0'));module[_0x4594('0x1')]={'name':{'type':Sequelize[_0x4594('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 24ce562..706d7f6 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 _0x1cc7=['Disposition','fieldName','type','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','order','sort','pick','filter','merge','options','where','count','include','rows','catch','show','rawAttributes','fields','length','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','params','html-pdf','eml-format','rimraf','moment','bluebird','mustache','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','offset','limit','set','Content-Range','reject','save','update','then','get','Dispositions','UserProfileResource','error','stack','name','send','index','map'];(function(_0x23c8b3,_0x2868a8){var _0x199d4f=function(_0x299bad){while(--_0x299bad){_0x23c8b3['push'](_0x23c8b3['shift']());}};_0x199d4f(++_0x2868a8);}(_0x1cc7,0x15a));var _0x71cc=function(_0x117c08,_0x133031){_0x117c08=_0x117c08-0x0;var _0x58eb56=_0x1cc7[_0x117c08];return _0x58eb56;};'use strict';var pdf=require(_0x71cc('0x0'));var emlformat=require(_0x71cc('0x1'));var rimraf=require(_0x71cc('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x71cc('0x3'));var BPromise=require(_0x71cc('0x4'));var Mustache=require(_0x71cc('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x71cc('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x71cc('0x7'));var squel=require(_0x71cc('0x8'));var crypto=require(_0x71cc('0x9'));var jsforce=require(_0x71cc('0xa'));var deskjs=require(_0x71cc('0xb'));var toCsv=require('to-csv');var querystring=require(_0x71cc('0xc'));var Papa=require(_0x71cc('0xd'));var Redis=require(_0x71cc('0xe'));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(_0x71cc('0xf'))(_0x71cc('0x10'));var utils=require(_0x71cc('0x11'));var config=require('../../config/environment');var db=require(_0x71cc('0x12'))['db'];function respondWithStatusCode(_0x550b3c,_0x1aad83){_0x1aad83=_0x1aad83||0xcc;return function(_0x4f9c5c){if(_0x4f9c5c){return _0x550b3c[_0x71cc('0x13')](_0x1aad83);}return _0x550b3c['status'](_0x1aad83)[_0x71cc('0x14')]();};}function respondWithResult(_0x1f478c,_0x3cee23){_0x3cee23=_0x3cee23||0xc8;return function(_0xd16032){if(_0xd16032){return _0x1f478c[_0x71cc('0x15')](_0x3cee23)['json'](_0xd16032);}};}function respondWithFilteredResult(_0x4495fd,_0x292d0c){return function(_0x3b26d1){if(_0x3b26d1){var _0x14d5ab=_0x3b26d1['count'],_0x3875b8=_0x292d0c[_0x71cc('0x16')],_0x14087c=_0x292d0c[_0x71cc('0x16')]+_0x292d0c[_0x71cc('0x17')],_0x1e359d;if(_0x14087c>=_0x14d5ab){_0x14087c=_0x14d5ab;_0x1e359d=0xc8;}else{_0x1e359d=0xce;}_0x4495fd[_0x71cc('0x15')](_0x1e359d);return _0x4495fd[_0x71cc('0x18')](_0x71cc('0x19'),_0x3875b8+'-'+_0x14087c+'/'+_0x14d5ab)['json'](_0x3b26d1);}return null;};}function patchUpdates(_0x366690){return function(_0x71f927){try{jsonpatch['apply'](_0x71f927,_0x366690,!![]);}catch(_0x550ce7){return BPromise[_0x71cc('0x1a')](_0x550ce7);}return _0x71f927[_0x71cc('0x1b')]();};}function saveUpdates(_0x1612f1,_0x11299c){return function(_0x258d30){if(_0x258d30){return _0x258d30[_0x71cc('0x1c')](_0x1612f1)[_0x71cc('0x1d')](function(_0x18683d){return _0x18683d;});}return null;};}function removeEntity(_0x4cfba0,_0x1442ef){return function(_0x109239){if(_0x109239){return _0x109239['destroy']()[_0x71cc('0x1d')](function(){var _0x20328f=_0x109239[_0x71cc('0x1e')]({'plain':!![]});var _0x1a9b4f=_0x71cc('0x1f');return db[_0x71cc('0x20')]['destroy']({'where':{'type':_0x1a9b4f,'resourceId':_0x20328f['id']}})[_0x71cc('0x1d')](function(){return _0x109239;});})[_0x71cc('0x1d')](function(){_0x4cfba0[_0x71cc('0x15')](0xcc)[_0x71cc('0x14')]();});}};}function handleEntityNotFound(_0x36367b,_0x5fa323){return function(_0x27b933){if(!_0x27b933){_0x36367b[_0x71cc('0x13')](0x194);}return _0x27b933;};}function handleError(_0xbce208,_0x4d4529){_0x4d4529=_0x4d4529||0x1f4;return function(_0x26065a){logger[_0x71cc('0x21')](_0x26065a[_0x71cc('0x22')]);if(_0x26065a[_0x71cc('0x23')]){delete _0x26065a[_0x71cc('0x23')];}_0xbce208[_0x71cc('0x15')](_0x4d4529)[_0x71cc('0x24')](_0x26065a);};}exports[_0x71cc('0x25')]=function(_0x3cc813,_0x1fc046){var _0x30f94d={},_0x35f723={},_0x1d5805={'count':0x0,'rows':[]};var _0x2db9c9=_[_0x71cc('0x26')](db[_0x71cc('0x27')]['rawAttributes'],function(_0x3054ff){return{'name':_0x3054ff[_0x71cc('0x28')],'type':_0x3054ff[_0x71cc('0x29')][_0x71cc('0x2a')]};});_0x35f723[_0x71cc('0x2b')]=_[_0x71cc('0x26')](_0x2db9c9,'name');_0x35f723[_0x71cc('0x2c')]=_[_0x71cc('0x2d')](_0x3cc813[_0x71cc('0x2c')]);_0x35f723[_0x71cc('0x2e')]=_[_0x71cc('0x2f')](_0x35f723[_0x71cc('0x2b')],_0x35f723[_0x71cc('0x2c')]);_0x30f94d['attributes']=_[_0x71cc('0x2f')](_0x35f723['model'],qs['fields'](_0x3cc813[_0x71cc('0x2c')]['fields']));_0x30f94d['attributes']=_0x30f94d[_0x71cc('0x30')]['length']?_0x30f94d[_0x71cc('0x30')]:_0x35f723['model'];if(!_0x3cc813[_0x71cc('0x2c')][_0x71cc('0x31')]('nolimit')){_0x30f94d[_0x71cc('0x17')]=qs[_0x71cc('0x17')](_0x3cc813[_0x71cc('0x2c')][_0x71cc('0x17')]);_0x30f94d[_0x71cc('0x16')]=qs[_0x71cc('0x16')](_0x3cc813[_0x71cc('0x2c')][_0x71cc('0x16')]);}_0x30f94d[_0x71cc('0x32')]=qs[_0x71cc('0x33')](_0x3cc813['query'][_0x71cc('0x33')]);_0x30f94d['where']=qs[_0x71cc('0x2e')](_[_0x71cc('0x34')](_0x3cc813[_0x71cc('0x2c')],_0x35f723[_0x71cc('0x2e')]));if(_0x3cc813[_0x71cc('0x2c')][_0x71cc('0x35')]){_0x30f94d['where']=_[_0x71cc('0x36')](_0x30f94d['where'],{'$or':_[_0x71cc('0x26')](_0x2db9c9,function(_0x3da270){if(_0x3da270[_0x71cc('0x29')]!=='VIRTUAL'){var _0x588748={};_0x588748[_0x3da270['name']]={'$like':'%'+_0x3cc813[_0x71cc('0x2c')][_0x71cc('0x35')]+'%'};return _0x588748;}})});}_0x30f94d=_[_0x71cc('0x36')]({},_0x30f94d,_0x3cc813[_0x71cc('0x37')]);var _0x15798b={'where':_0x30f94d[_0x71cc('0x38')]};return db[_0x71cc('0x27')][_0x71cc('0x39')](_0x15798b)[_0x71cc('0x1d')](function(_0x2c6795){_0x1d5805[_0x71cc('0x39')]=_0x2c6795;if(_0x3cc813[_0x71cc('0x2c')]['includeAll']){_0x30f94d[_0x71cc('0x3a')]=[{'all':!![]}];}return db[_0x71cc('0x27')]['findAll'](_0x30f94d);})['then'](function(_0x463cdd){_0x1d5805[_0x71cc('0x3b')]=_0x463cdd;return _0x1d5805;})['then'](respondWithFilteredResult(_0x1fc046,_0x30f94d))[_0x71cc('0x3c')](handleError(_0x1fc046,null));};exports[_0x71cc('0x3d')]=function(_0x2fbe5e,_0x19d7c8){var _0x21ef21={'raw':!![],'where':{'id':_0x2fbe5e['params']['id']}},_0x5b3a38={};_0x5b3a38['model']=_[_0x71cc('0x2d')](db['Disposition'][_0x71cc('0x3e')]);_0x5b3a38[_0x71cc('0x2c')]=_[_0x71cc('0x2d')](_0x2fbe5e[_0x71cc('0x2c')]);_0x5b3a38[_0x71cc('0x2e')]=_[_0x71cc('0x2f')](_0x5b3a38[_0x71cc('0x2b')],_0x5b3a38[_0x71cc('0x2c')]);_0x21ef21[_0x71cc('0x30')]=_[_0x71cc('0x2f')](_0x5b3a38[_0x71cc('0x2b')],qs[_0x71cc('0x3f')](_0x2fbe5e[_0x71cc('0x2c')]['fields']));_0x21ef21[_0x71cc('0x30')]=_0x21ef21[_0x71cc('0x30')][_0x71cc('0x40')]?_0x21ef21['attributes']:_0x5b3a38[_0x71cc('0x2b')];if(_0x2fbe5e[_0x71cc('0x2c')][_0x71cc('0x41')]){_0x21ef21[_0x71cc('0x3a')]=[{'all':!![]}];}_0x21ef21=_[_0x71cc('0x36')]({},_0x21ef21,_0x2fbe5e[_0x71cc('0x37')]);return db[_0x71cc('0x27')][_0x71cc('0x42')](_0x21ef21)[_0x71cc('0x1d')](handleEntityNotFound(_0x19d7c8,null))[_0x71cc('0x1d')](respondWithResult(_0x19d7c8,null))[_0x71cc('0x3c')](handleError(_0x19d7c8,null));};exports[_0x71cc('0x43')]=function(_0x47cefc,_0x36e7e5){return db[_0x71cc('0x27')][_0x71cc('0x43')](_0x47cefc[_0x71cc('0x44')],{})[_0x71cc('0x1d')](function(_0x273ad1){var _0x430387=_0x47cefc['user'][_0x71cc('0x1e')]({'plain':!![]});if(!_0x430387)throw new Error(_0x71cc('0x45'));if(_0x430387['role']===_0x71cc('0x46')){var _0x41ef8d=_0x273ad1[_0x71cc('0x1e')]({'plain':!![]});var _0xe6b3db=_0x71cc('0x1f');return db[_0x71cc('0x47')][_0x71cc('0x42')]({'where':{'name':_0xe6b3db,'userProfileId':_0x430387[_0x71cc('0x48')]},'raw':!![]})[_0x71cc('0x1d')](function(_0x1647ce){if(_0x1647ce&&_0x1647ce[_0x71cc('0x49')]===0x0){return db['UserProfileResource'][_0x71cc('0x43')]({'name':_0x41ef8d['name'],'resourceId':_0x41ef8d['id'],'type':_0x1647ce[_0x71cc('0x23')],'sectionId':_0x1647ce['id']},{})['then'](function(){return _0x273ad1;});}else{return _0x273ad1;}})[_0x71cc('0x3c')](function(_0x36c71e){logger['error'](_0x71cc('0x4a'),_0x36c71e);throw _0x36c71e;});}return _0x273ad1;})[_0x71cc('0x1d')](respondWithResult(_0x36e7e5,0xc9))['catch'](handleError(_0x36e7e5,null));};exports[_0x71cc('0x1c')]=function(_0x1c311b,_0x459c57){if(_0x1c311b[_0x71cc('0x44')]['id']){delete _0x1c311b[_0x71cc('0x44')]['id'];}return db[_0x71cc('0x27')][_0x71cc('0x42')]({'where':{'id':_0x1c311b['params']['id']}})[_0x71cc('0x1d')](handleEntityNotFound(_0x459c57,null))[_0x71cc('0x1d')](saveUpdates(_0x1c311b['body'],null))['then'](respondWithResult(_0x459c57,null))[_0x71cc('0x3c')](handleError(_0x459c57,null));};exports[_0x71cc('0x4b')]=function(_0x4bd393,_0x7a6dcd){return db[_0x71cc('0x27')][_0x71cc('0x42')]({'where':{'id':_0x4bd393[_0x71cc('0x4c')]['id']}})[_0x71cc('0x1d')](handleEntityNotFound(_0x7a6dcd,null))[_0x71cc('0x1d')](removeEntity(_0x7a6dcd,null))['catch'](handleError(_0x7a6dcd,null));}; \ No newline at end of file +var _0xf3cd=['findAll','rows','catch','keys','rawAttributes','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','Dispositions','UserProfileResource','end','name','map','fieldName','type','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','where','pick','filter','merge','VIRTUAL','options','Disposition','includeAll'];(function(_0x8dfa80,_0x406802){var _0x151210=function(_0x5d4249){while(--_0x5d4249){_0x8dfa80['push'](_0x8dfa80['shift']());}};_0x151210(++_0x406802);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x3e6b2f,_0x1ffa07){_0x3e6b2f=_0x3e6b2f-0x0;var _0x323215=_0xf3cd[_0x3e6b2f];return _0x323215;};'use strict';var pdf=require(_0xdf3c('0x0'));var emlformat=require(_0xdf3c('0x1'));var rimraf=require(_0xdf3c('0x2'));var zipdir=require(_0xdf3c('0x3'));var jsonpatch=require(_0xdf3c('0x4'));var rp=require(_0xdf3c('0x5'));var moment=require('moment');var BPromise=require(_0xdf3c('0x6'));var Mustache=require(_0xdf3c('0x7'));var util=require(_0xdf3c('0x8'));var path=require('path');var sox=require(_0xdf3c('0x9'));var csv=require(_0xdf3c('0xa'));var ejs=require(_0xdf3c('0xb'));var fs=require('fs');var _=require(_0xdf3c('0xc'));var squel=require(_0xdf3c('0xd'));var crypto=require(_0xdf3c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xdf3c('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xdf3c('0x10'));var Redis=require(_0xdf3c('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xdf3c('0x12'));var as=require(_0xdf3c('0x13'));var hardwareService=require(_0xdf3c('0x14'));var logger=require(_0xdf3c('0x15'))(_0xdf3c('0x16'));var utils=require(_0xdf3c('0x17'));var config=require(_0xdf3c('0x18'));var db=require(_0xdf3c('0x19'))['db'];function respondWithStatusCode(_0x5e8925,_0x1d483c){_0x1d483c=_0x1d483c||0xcc;return function(_0x166ae5){if(_0x166ae5){return _0x5e8925[_0xdf3c('0x1a')](_0x1d483c);}return _0x5e8925[_0xdf3c('0x1b')](_0x1d483c)['end']();};}function respondWithResult(_0x2ae4ad,_0x461079){_0x461079=_0x461079||0xc8;return function(_0x13ea5f){if(_0x13ea5f){return _0x2ae4ad['status'](_0x461079)[_0xdf3c('0x1c')](_0x13ea5f);}};}function respondWithFilteredResult(_0x38b01d,_0x173041){return function(_0x4274fd){if(_0x4274fd){var _0x21e587=_0x4274fd[_0xdf3c('0x1d')],_0x1a7a5a=_0x173041[_0xdf3c('0x1e')],_0x305ea5=_0x173041['offset']+_0x173041[_0xdf3c('0x1f')],_0x92008b;if(_0x305ea5>=_0x21e587){_0x305ea5=_0x21e587;_0x92008b=0xc8;}else{_0x92008b=0xce;}_0x38b01d[_0xdf3c('0x1b')](_0x92008b);return _0x38b01d[_0xdf3c('0x20')](_0xdf3c('0x21'),_0x1a7a5a+'-'+_0x305ea5+'/'+_0x21e587)[_0xdf3c('0x1c')](_0x4274fd);}return null;};}function patchUpdates(_0x113b56){return function(_0x16b02b){try{jsonpatch[_0xdf3c('0x22')](_0x16b02b,_0x113b56,!![]);}catch(_0x426f3a){return BPromise[_0xdf3c('0x23')](_0x426f3a);}return _0x16b02b[_0xdf3c('0x24')]();};}function saveUpdates(_0x3d14cc,_0x25487c){return function(_0x5d2390){if(_0x5d2390){return _0x5d2390['update'](_0x3d14cc)[_0xdf3c('0x25')](function(_0x583ce4){return _0x583ce4;});}return null;};}function removeEntity(_0x15776c,_0x40e7ec){return function(_0x36552e){if(_0x36552e){return _0x36552e[_0xdf3c('0x26')]()[_0xdf3c('0x25')](function(){var _0x36ba1c=_0x36552e['get']({'plain':!![]});var _0x22a164=_0xdf3c('0x27');return db[_0xdf3c('0x28')][_0xdf3c('0x26')]({'where':{'type':_0x22a164,'resourceId':_0x36ba1c['id']}})[_0xdf3c('0x25')](function(){return _0x36552e;});})[_0xdf3c('0x25')](function(){_0x15776c[_0xdf3c('0x1b')](0xcc)[_0xdf3c('0x29')]();});}};}function handleEntityNotFound(_0x18cb46,_0x1adee4){return function(_0x4c076c){if(!_0x4c076c){_0x18cb46[_0xdf3c('0x1a')](0x194);}return _0x4c076c;};}function handleError(_0x153daa,_0x4b57a4){_0x4b57a4=_0x4b57a4||0x1f4;return function(_0xdc8962){logger['error'](_0xdc8962['stack']);if(_0xdc8962['name']){delete _0xdc8962[_0xdf3c('0x2a')];}_0x153daa[_0xdf3c('0x1b')](_0x4b57a4)['send'](_0xdc8962);};}exports['index']=function(_0x37ecfd,_0x1f2ce4){var _0xd3cfcb={},_0x1ccdd4={},_0x5c98a2={'count':0x0,'rows':[]};var _0x43ce06=_[_0xdf3c('0x2b')](db['Disposition']['rawAttributes'],function(_0x1f1d8a){return{'name':_0x1f1d8a[_0xdf3c('0x2c')],'type':_0x1f1d8a[_0xdf3c('0x2d')]['key']};});_0x1ccdd4[_0xdf3c('0x2e')]=_[_0xdf3c('0x2b')](_0x43ce06,_0xdf3c('0x2a'));_0x1ccdd4[_0xdf3c('0x2f')]=_['keys'](_0x37ecfd[_0xdf3c('0x2f')]);_0x1ccdd4[_0xdf3c('0x30')]=_['intersection'](_0x1ccdd4[_0xdf3c('0x2e')],_0x1ccdd4[_0xdf3c('0x2f')]);_0xd3cfcb[_0xdf3c('0x31')]=_[_0xdf3c('0x32')](_0x1ccdd4['model'],qs[_0xdf3c('0x33')](_0x37ecfd[_0xdf3c('0x2f')][_0xdf3c('0x33')]));_0xd3cfcb[_0xdf3c('0x31')]=_0xd3cfcb['attributes'][_0xdf3c('0x34')]?_0xd3cfcb[_0xdf3c('0x31')]:_0x1ccdd4['model'];if(!_0x37ecfd['query'][_0xdf3c('0x35')]('nolimit')){_0xd3cfcb[_0xdf3c('0x1f')]=qs['limit'](_0x37ecfd['query']['limit']);_0xd3cfcb[_0xdf3c('0x1e')]=qs[_0xdf3c('0x1e')](_0x37ecfd[_0xdf3c('0x2f')][_0xdf3c('0x1e')]);}_0xd3cfcb['order']=qs['sort'](_0x37ecfd[_0xdf3c('0x2f')]['sort']);_0xd3cfcb[_0xdf3c('0x36')]=qs[_0xdf3c('0x30')](_[_0xdf3c('0x37')](_0x37ecfd[_0xdf3c('0x2f')],_0x1ccdd4[_0xdf3c('0x30')]));if(_0x37ecfd[_0xdf3c('0x2f')][_0xdf3c('0x38')]){_0xd3cfcb[_0xdf3c('0x36')]=_[_0xdf3c('0x39')](_0xd3cfcb['where'],{'$or':_[_0xdf3c('0x2b')](_0x43ce06,function(_0x54e689){if(_0x54e689['type']!==_0xdf3c('0x3a')){var _0x47f760={};_0x47f760[_0x54e689[_0xdf3c('0x2a')]]={'$like':'%'+_0x37ecfd['query'][_0xdf3c('0x38')]+'%'};return _0x47f760;}})});}_0xd3cfcb=_[_0xdf3c('0x39')]({},_0xd3cfcb,_0x37ecfd[_0xdf3c('0x3b')]);var _0x1349a4={'where':_0xd3cfcb[_0xdf3c('0x36')]};return db[_0xdf3c('0x3c')][_0xdf3c('0x1d')](_0x1349a4)[_0xdf3c('0x25')](function(_0x3cf131){_0x5c98a2[_0xdf3c('0x1d')]=_0x3cf131;if(_0x37ecfd[_0xdf3c('0x2f')][_0xdf3c('0x3d')]){_0xd3cfcb['include']=[{'all':!![]}];}return db['Disposition'][_0xdf3c('0x3e')](_0xd3cfcb);})['then'](function(_0x3a6527){_0x5c98a2[_0xdf3c('0x3f')]=_0x3a6527;return _0x5c98a2;})[_0xdf3c('0x25')](respondWithFilteredResult(_0x1f2ce4,_0xd3cfcb))[_0xdf3c('0x40')](handleError(_0x1f2ce4,null));};exports['show']=function(_0x563d31,_0x335c1b){var _0x33edab={'raw':!![],'where':{'id':_0x563d31['params']['id']}},_0x106975={};_0x106975[_0xdf3c('0x2e')]=_[_0xdf3c('0x41')](db[_0xdf3c('0x3c')][_0xdf3c('0x42')]);_0x106975['query']=_[_0xdf3c('0x41')](_0x563d31[_0xdf3c('0x2f')]);_0x106975[_0xdf3c('0x30')]=_[_0xdf3c('0x32')](_0x106975[_0xdf3c('0x2e')],_0x106975['query']);_0x33edab[_0xdf3c('0x31')]=_[_0xdf3c('0x32')](_0x106975[_0xdf3c('0x2e')],qs[_0xdf3c('0x33')](_0x563d31[_0xdf3c('0x2f')][_0xdf3c('0x33')]));_0x33edab['attributes']=_0x33edab['attributes'][_0xdf3c('0x34')]?_0x33edab[_0xdf3c('0x31')]:_0x106975['model'];if(_0x563d31['query'][_0xdf3c('0x3d')]){_0x33edab[_0xdf3c('0x43')]=[{'all':!![]}];}_0x33edab=_[_0xdf3c('0x39')]({},_0x33edab,_0x563d31[_0xdf3c('0x3b')]);return db[_0xdf3c('0x3c')][_0xdf3c('0x44')](_0x33edab)[_0xdf3c('0x25')](handleEntityNotFound(_0x335c1b,null))[_0xdf3c('0x25')](respondWithResult(_0x335c1b,null))[_0xdf3c('0x40')](handleError(_0x335c1b,null));};exports['create']=function(_0x129c2a,_0x2cfdb2){return db[_0xdf3c('0x3c')][_0xdf3c('0x45')](_0x129c2a[_0xdf3c('0x46')],{})[_0xdf3c('0x25')](function(_0x28a468){var _0x553f70=_0x129c2a[_0xdf3c('0x47')]['get']({'plain':!![]});if(!_0x553f70)throw new Error(_0xdf3c('0x48'));if(_0x553f70['role']===_0xdf3c('0x47')){var _0x28144f=_0x28a468[_0xdf3c('0x49')]({'plain':!![]});var _0x94c5b9='Dispositions';return db['UserProfileSection']['find']({'where':{'name':_0x94c5b9,'userProfileId':_0x553f70[_0xdf3c('0x4a')]},'raw':!![]})['then'](function(_0x31c600){if(_0x31c600&&_0x31c600[_0xdf3c('0x4b')]===0x0){return db[_0xdf3c('0x28')][_0xdf3c('0x45')]({'name':_0x28144f[_0xdf3c('0x2a')],'resourceId':_0x28144f['id'],'type':_0x31c600['name'],'sectionId':_0x31c600['id']},{})['then'](function(){return _0x28a468;});}else{return _0x28a468;}})[_0xdf3c('0x40')](function(_0x27a541){logger['error'](_0xdf3c('0x4c'),_0x27a541);throw _0x27a541;});}return _0x28a468;})[_0xdf3c('0x25')](respondWithResult(_0x2cfdb2,0xc9))[_0xdf3c('0x40')](handleError(_0x2cfdb2,null));};exports[_0xdf3c('0x4d')]=function(_0x38de63,_0x46dfb1){if(_0x38de63[_0xdf3c('0x46')]['id']){delete _0x38de63['body']['id'];}return db['Disposition'][_0xdf3c('0x44')]({'where':{'id':_0x38de63[_0xdf3c('0x4e')]['id']}})[_0xdf3c('0x25')](handleEntityNotFound(_0x46dfb1,null))[_0xdf3c('0x25')](saveUpdates(_0x38de63[_0xdf3c('0x46')],null))[_0xdf3c('0x25')](respondWithResult(_0x46dfb1,null))[_0xdf3c('0x40')](handleError(_0x46dfb1,null));};exports[_0xdf3c('0x26')]=function(_0x143d01,_0x31624a){return db[_0xdf3c('0x3c')]['find']({'where':{'id':_0x143d01[_0xdf3c('0x4e')]['id']}})['then'](handleEntityNotFound(_0x31624a,null))['then'](removeEntity(_0x31624a,null))['catch'](handleError(_0x31624a,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 251b1a6..6a9e5f5 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 _0x6bea=['util','../../config/logger','api','moment','path','rimraf','./disposition.attributes','exports','tools_dispositions','name_voice','name','ChatWebsiteId','name_mail','MailAccountId','name_sms','SmsAccountId','FaxAccountId','name_openchannel','OpenchannelAccountId','lodash'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x6bea,0xdb));var _0xa6be=function(_0x2a7d74,_0x3460d6){_0x2a7d74=_0x2a7d74-0x0;var _0xcbe8b8=_0x6bea[_0x2a7d74];return _0xcbe8b8;};'use strict';var _=require(_0xa6be('0x0'));var util=require(_0xa6be('0x1'));var logger=require(_0xa6be('0x2'))(_0xa6be('0x3'));var moment=require(_0xa6be('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa6be('0x5'));var rimraf=require(_0xa6be('0x6'));var config=require('../../config/environment');var attributes=require(_0xa6be('0x7'));module[_0xa6be('0x8')]=function(_0x2098d0,_0x3ee085){return _0x2098d0['define']('Disposition',attributes,{'tableName':_0xa6be('0x9'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xa6be('0xa'),'fields':[_0xa6be('0xb'),'ListId']},{'unique':!![],'name':'name_chat','fields':[_0xa6be('0xb'),_0xa6be('0xc')]},{'unique':!![],'name':_0xa6be('0xd'),'fields':['name',_0xa6be('0xe')]},{'unique':!![],'name':_0xa6be('0xf'),'fields':[_0xa6be('0xb'),_0xa6be('0x10')]},{'unique':!![],'name':'name_fax','fields':[_0xa6be('0xb'),_0xa6be('0x11')]},{'unique':!![],'name':_0xa6be('0x12'),'fields':[_0xa6be('0xb'),_0xa6be('0x13')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2e25=['name_mail','MailAccountId','name_sms','name_openchannel','lodash','util','../../config/logger','moment','bluebird','path','./disposition.attributes','Disposition','name_voice','name','ListId','name_chat','ChatWebsiteId'];(function(_0x159775,_0x2f774e){var _0x10d474=function(_0x2614bf){while(--_0x2614bf){_0x159775['push'](_0x159775['shift']());}};_0x10d474(++_0x2f774e);}(_0x2e25,0x8c));var _0x52e2=function(_0x3aa853,_0x4879e4){_0x3aa853=_0x3aa853-0x0;var _0xa85900=_0x2e25[_0x3aa853];return _0xa85900;};'use strict';var _=require(_0x52e2('0x0'));var util=require(_0x52e2('0x1'));var logger=require(_0x52e2('0x2'))('api');var moment=require(_0x52e2('0x3'));var BPromise=require(_0x52e2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x52e2('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x52e2('0x6'));module['exports']=function(_0x3a3ec0,_0x48b956){return _0x3a3ec0['define'](_0x52e2('0x7'),attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':_0x52e2('0x8'),'fields':[_0x52e2('0x9'),_0x52e2('0xa')]},{'unique':!![],'name':_0x52e2('0xb'),'fields':['name',_0x52e2('0xc')]},{'unique':!![],'name':_0x52e2('0xd'),'fields':['name',_0x52e2('0xe')]},{'unique':!![],'name':_0x52e2('0xf'),'fields':['name','SmsAccountId']},{'unique':!![],'name':'name_fax','fields':[_0x52e2('0x9'),'FaxAccountId']},{'unique':!![],'name':_0x52e2('0x10'),'fields':[_0x52e2('0x9'),'OpenchannelAccountId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 466c388..369fee2 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 _0x4766=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','request','then','info','request\x20sent','debug','stringify','error','code','Disposition,\x20%s,\x20%s','message'];(function(_0x43f881,_0xd6e5a2){var _0x365c14=function(_0x50d386){while(--_0x50d386){_0x43f881['push'](_0x43f881['shift']());}};_0x365c14(++_0xd6e5a2);}(_0x4766,0x1e6));var _0x6476=function(_0x438b1f,_0x3db8cb){_0x438b1f=_0x438b1f-0x0;var _0x2783e0=_0x4766[_0x438b1f];return _0x2783e0;};'use strict';var _=require(_0x6476('0x0'));var util=require('util');var moment=require(_0x6476('0x1'));var BPromise=require(_0x6476('0x2'));var rs=require(_0x6476('0x3'));var fs=require('fs');var Redis=require(_0x6476('0x4'));var db=require(_0x6476('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6476('0x6'))(_0x6476('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6476('0x8')][_0x6476('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5af6b7,_0x350923,_0xe87dbb){return new BPromise(function(_0x3958f3,_0x99094a){return client[_0x6476('0xa')](_0x5af6b7,_0xe87dbb)[_0x6476('0xb')](function(_0x1c8244){logger[_0x6476('0xc')]('Disposition,\x20%s,\x20%s',_0x350923,_0x6476('0xd'));logger[_0x6476('0xe')]('Disposition,\x20%s,\x20%s,\x20%s',_0x350923,_0x6476('0xd'),JSON[_0x6476('0xf')](_0x1c8244));if(_0x1c8244[_0x6476('0x10')]){if(_0x1c8244['error'][_0x6476('0x11')]===0x1f4){logger[_0x6476('0x10')](_0x6476('0x12'),_0x350923,_0x1c8244['error']['message']);return _0x99094a(_0x1c8244[_0x6476('0x10')][_0x6476('0x13')]);}logger[_0x6476('0x10')](_0x6476('0x12'),_0x350923,_0x1c8244['error'][_0x6476('0x13')]);return _0x3958f3(_0x1c8244[_0x6476('0x10')][_0x6476('0x13')]);}else{logger['info'](_0x6476('0x12'),_0x350923,'request\x20sent');_0x3958f3(_0x1c8244[_0x6476('0x14')][_0x6476('0x13')]);}})[_0x6476('0x15')](function(_0x4de559){logger[_0x6476('0x10')](_0x6476('0x12'),_0x350923,_0x4de559);_0x99094a(_0x4de559);});});} \ No newline at end of file +var _0x46fe=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Disposition,\x20%s,\x20%s','request\x20sent','debug','Disposition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x5d01e3,_0x580578){var _0x4671b9=function(_0x233638){while(--_0x233638){_0x5d01e3['push'](_0x5d01e3['shift']());}};_0x4671b9(++_0x580578);}(_0x46fe,0x1a1));var _0xe46f=function(_0x425716,_0x3e9d1c){_0x425716=_0x425716-0x0;var _0x2d39af=_0x46fe[_0x425716];return _0x2d39af;};'use strict';var _=require(_0xe46f('0x0'));var util=require(_0xe46f('0x1'));var moment=require(_0xe46f('0x2'));var BPromise=require(_0xe46f('0x3'));var rs=require(_0xe46f('0x4'));var fs=require('fs');var Redis=require(_0xe46f('0x5'));var db=require(_0xe46f('0x6'))['db'];var utils=require(_0xe46f('0x7'));var logger=require(_0xe46f('0x8'))(_0xe46f('0x9'));var config=require(_0xe46f('0xa'));var jayson=require(_0xe46f('0xb'));var client=jayson[_0xe46f('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x507fc7,_0x46a309,_0x53148f){return new BPromise(function(_0x3680d3,_0x2a66c8){return client[_0xe46f('0xd')](_0x507fc7,_0x53148f)[_0xe46f('0xe')](function(_0x2bff89){logger[_0xe46f('0xf')](_0xe46f('0x10'),_0x46a309,_0xe46f('0x11'));logger[_0xe46f('0x12')](_0xe46f('0x13'),_0x46a309,_0xe46f('0x11'),JSON[_0xe46f('0x14')](_0x2bff89));if(_0x2bff89[_0xe46f('0x15')]){if(_0x2bff89[_0xe46f('0x15')][_0xe46f('0x16')]===0x1f4){logger[_0xe46f('0x15')](_0xe46f('0x10'),_0x46a309,_0x2bff89['error'][_0xe46f('0x17')]);return _0x2a66c8(_0x2bff89[_0xe46f('0x15')][_0xe46f('0x17')]);}logger['error']('Disposition,\x20%s,\x20%s',_0x46a309,_0x2bff89[_0xe46f('0x15')][_0xe46f('0x17')]);return _0x3680d3(_0x2bff89[_0xe46f('0x15')]['message']);}else{logger['info'](_0xe46f('0x10'),_0x46a309,_0xe46f('0x11'));_0x3680d3(_0x2bff89[_0xe46f('0x18')][_0xe46f('0x17')]);}})[_0xe46f('0x19')](function(_0x5e5c6f){logger[_0xe46f('0x15')]('Disposition,\x20%s,\x20%s',_0x46a309,_0x5e5c6f);_0x2a66c8(_0x5e5c6f);});});} \ No newline at end of file diff --git a/server/api/disposition/index.js b/server/api/disposition/index.js index ecc9c19..81090a4 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 _0xfcbb=['util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','index','get','/:id','isAuthenticated','show','post','put','delete','destroy','exports','multer'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xfcbb,0x10d));var _0xbfcb=function(_0xdad69f,_0xc37952){_0xdad69f=_0xdad69f-0x0;var _0x3c674a=_0xfcbb[_0xdad69f];return _0x3c674a;};'use strict';var multer=require(_0xbfcb('0x0'));var util=require(_0xbfcb('0x1'));var path=require(_0xbfcb('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbfcb('0x3')]();var auth=require(_0xbfcb('0x4'));var interaction=require(_0xbfcb('0x5'));var config=require(_0xbfcb('0x6'));var controller=require(_0xbfcb('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xbfcb('0x8')]);router[_0xbfcb('0x9')](_0xbfcb('0xa'),auth[_0xbfcb('0xb')](),controller[_0xbfcb('0xc')]);router[_0xbfcb('0xd')]('/',auth[_0xbfcb('0xb')](),controller['create']);router[_0xbfcb('0xe')](_0xbfcb('0xa'),auth[_0xbfcb('0xb')](),controller['update']);router[_0xbfcb('0xf')](_0xbfcb('0xa'),auth[_0xbfcb('0xb')](),controller[_0xbfcb('0x10')]);module[_0xbfcb('0x11')]=router; \ No newline at end of file +var _0x3cd0=['destroy','exports','multer','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','isAuthenticated','index','get','/:id','post','create','put','delete'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0x3cd0,0x8a));var _0x03cd=function(_0x40df5f,_0x8fd59f){_0x40df5f=_0x40df5f-0x0;var _0x1573f1=_0x3cd0[_0x40df5f];return _0x1573f1;};'use strict';var multer=require(_0x03cd('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x03cd('0x1'));var express=require('express');var router=express[_0x03cd('0x2')]();var auth=require(_0x03cd('0x3'));var interaction=require(_0x03cd('0x4'));var config=require(_0x03cd('0x5'));var controller=require(_0x03cd('0x6'));router['get']('/',auth[_0x03cd('0x7')](),controller[_0x03cd('0x8')]);router[_0x03cd('0x9')](_0x03cd('0xa'),auth[_0x03cd('0x7')](),controller['show']);router[_0x03cd('0xb')]('/',auth['isAuthenticated'](),controller[_0x03cd('0xc')]);router[_0x03cd('0xd')](_0x03cd('0xa'),auth[_0x03cd('0x7')](),controller['update']);router[_0x03cd('0xe')](_0x03cd('0xa'),auth[_0x03cd('0x7')](),controller[_0x03cd('0xf')]);module[_0x03cd('0x10')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 0471c77..00090a8 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 _0xe976=['4800','9600','14400','7200','INTEGER','SIP','IAX','DADHI','KHOMP','TEXT','BOOLEAN','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','exports','STRING','yes','xCALLY\x20Motion\x20Fax','localstationid','ENUM','2400'];(function(_0x16c55d,_0x4dcb2e){var _0x141783=function(_0x38877e){while(--_0x38877e){_0x16c55d['push'](_0x16c55d['shift']());}};_0x141783(++_0x4dcb2e);}(_0xe976,0x67));var _0x6e97=function(_0x4ca6a4,_0x5e9694){_0x4ca6a4=_0x4ca6a4-0x0;var _0x120555=_0xe976[_0x4ca6a4];return _0x120555;};'use strict';var Sequelize=require('sequelize');module[_0x6e97('0x0')]={'name':{'type':Sequelize[_0x6e97('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x6e97('0x1')]},'ecm':{'type':Sequelize['ENUM'](_0x6e97('0x2'),'no'),'defaultValue':_0x6e97('0x2')},'headerinfo':{'type':Sequelize[_0x6e97('0x1')],'defaultValue':_0x6e97('0x3')},'localstationid':{'type':Sequelize[_0x6e97('0x1')],'unique':_0x6e97('0x4')},'minrate':{'type':Sequelize[_0x6e97('0x5')](_0x6e97('0x6'),_0x6e97('0x7'),'7200',_0x6e97('0x8'),'12000',_0x6e97('0x9')),'defaultValue':_0x6e97('0x7')},'maxrate':{'type':Sequelize[_0x6e97('0x5')](_0x6e97('0x6'),'4800',_0x6e97('0xa'),_0x6e97('0x8'),'12000',_0x6e97('0x9')),'defaultValue':_0x6e97('0x9')},'modem':{'type':Sequelize[_0x6e97('0x1')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x6e97('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x6e97('0xb')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x6e97('0x5')](_0x6e97('0xc'),_0x6e97('0xd'),_0x6e97('0xe'),_0x6e97('0xf')),'defaultValue':_0x6e97('0xc')},'key':{'type':Sequelize[_0x6e97('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x6e97('0x10')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x6e97('0x11')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x6e97('0x11')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x6e97('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x6e97('0x11')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6e97('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6e97('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x6e97('0x11')],'defaultValue':![],'comment':_0x6e97('0x12'),'set':function(_0x5067fe){if(!_0x5067fe)this[_0x6e97('0x13')](_0x6e97('0x14'),null);this[_0x6e97('0x13')](_0x6e97('0x15'),_0x5067fe);}}}; \ No newline at end of file +var _0xe4ab=['9600','12000','4800','14400','v17,v27,v29','SIP','IAX','DADHI','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','mandatoryDispositionPauseId','mandatoryDisposition','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','7200'];(function(_0x3bf4d5,_0x366a37){var _0x48fdea=function(_0x665bbe){while(--_0x665bbe){_0x3bf4d5['push'](_0x3bf4d5['shift']());}};_0x48fdea(++_0x366a37);}(_0xe4ab,0x100));var _0xbe4a=function(_0x4cfb4e,_0x307336){_0x4cfb4e=_0x4cfb4e-0x0;var _0x5293a0=_0xe4ab[_0x4cfb4e];return _0x5293a0;};'use strict';var Sequelize=require('sequelize');module[_0xbe4a('0x0')]={'name':{'type':Sequelize[_0xbe4a('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xbe4a('0x1')]},'ecm':{'type':Sequelize[_0xbe4a('0x2')](_0xbe4a('0x3'),'no'),'defaultValue':_0xbe4a('0x3')},'headerinfo':{'type':Sequelize[_0xbe4a('0x1')],'defaultValue':_0xbe4a('0x4')},'localstationid':{'type':Sequelize['STRING'],'unique':_0xbe4a('0x5')},'minrate':{'type':Sequelize['ENUM'](_0xbe4a('0x6'),'4800',_0xbe4a('0x7'),_0xbe4a('0x8'),_0xbe4a('0x9'),'14400'),'defaultValue':_0xbe4a('0xa')},'maxrate':{'type':Sequelize[_0xbe4a('0x2')](_0xbe4a('0x6'),_0xbe4a('0xa'),_0xbe4a('0x7'),_0xbe4a('0x8'),_0xbe4a('0x9'),_0xbe4a('0xb')),'defaultValue':'14400'},'modem':{'type':Sequelize[_0xbe4a('0x1')],'defaultValue':_0xbe4a('0xc')},'gateway':{'type':Sequelize[_0xbe4a('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xbe4a('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xbe4a('0x2')](_0xbe4a('0xd'),_0xbe4a('0xe'),_0xbe4a('0xf'),'KHOMP'),'defaultValue':'SIP'},'key':{'type':Sequelize[_0xbe4a('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xbe4a('0x10')],'defaultValue':function(){return _0xbe4a('0x11');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xbe4a('0x12')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xbe4a('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xbe4a('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xbe4a('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xbe4a('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xbe4a('0x13')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xbe4a('0x12')],'defaultValue':![],'comment':_0xbe4a('0x14'),'set':function(_0x1dc4e5){if(!_0x1dc4e5)this[_0xbe4a('0x15')](_0xbe4a('0x16'),null);this[_0xbe4a('0x15')](_0xbe4a('0x17'),_0x1dc4e5);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index fe3342e..bc44149 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 _0x8dbd=['error','code','message','sendStatus','status','end','json','count','limit','set','apply','reject','save','destroy','get','FaxAccounts','UserProfileResource','stack','name','send','Pause','map','FaxAccount','rawAttributes','fieldName','type','key','query','keys','intersection','model','fields','attributes','hasOwnProperty','nolimit','offset','order','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','mandatoryDispositionPause','length','find','body','user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addDisposition','FaxAccountId','Disposition','create','getDispositions','addAnswer','CannedAnswer','getAnswers','sort','removeAnswers','ids','addInteraction','omit','getInteractions','findOne','FaxInteraction','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','FaxApplication','getApplications','context','from-voip-provider','localstationid','description','priority','appdata','push','Answer','CDR(type)=inbound-fax','gateway','faxdetect','headerinfo','maxrate','minrate','modem','t38timeout','FAXOPT(','Set','ReceiveFax','VoiceExtension','bulkCreate','updateAccountApplications','tech','createdAt','updatedAt','TrunkId','findById','FaxMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','CmContact','Contacts','DESC','attachments','root','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','ListId','List\x20not\x20found','out','filename','Messages','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','userFaxAccount:remove','getAgents','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','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','http','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','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x326492,_0x35210c){var _0x647883=function(_0x20dd53){while(--_0x20dd53){_0x326492['push'](_0x326492['shift']());}};_0x647883(++_0x35210c);}(_0x8dbd,0x159));var _0xd8db=function(_0x209263,_0x247f07){_0x209263=_0x209263-0x0;var _0xa8602e=_0x8dbd[_0x209263];return _0xa8602e;};'use strict';var pdf=require(_0xd8db('0x0'));var emlformat=require(_0xd8db('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xd8db('0x2'));var jsonpatch=require(_0xd8db('0x3'));var rp=require(_0xd8db('0x4'));var moment=require(_0xd8db('0x5'));var BPromise=require(_0xd8db('0x6'));var Mustache=require(_0xd8db('0x7'));var util=require(_0xd8db('0x8'));var path=require(_0xd8db('0x9'));var sox=require(_0xd8db('0xa'));var csv=require(_0xd8db('0xb'));var ejs=require(_0xd8db('0xc'));var fs=require('fs');var _=require(_0xd8db('0xd'));var squel=require(_0xd8db('0xe'));var crypto=require(_0xd8db('0xf'));var jsforce=require(_0xd8db('0x10'));var deskjs=require(_0xd8db('0x11'));var toCsv=require(_0xd8db('0xb'));var querystring=require('querystring');var Papa=require(_0xd8db('0x12'));var Redis=require(_0xd8db('0x13'));var authService=require(_0xd8db('0x14'));var qs=require(_0xd8db('0x15'));var as=require(_0xd8db('0x16'));var hardwareService=require(_0xd8db('0x17'));var logger=require(_0xd8db('0x18'))(_0xd8db('0x19'));var utils=require(_0xd8db('0x1a'));var config=require(_0xd8db('0x1b'));var db=require('../../mysqldb')['db'];config[_0xd8db('0x1c')]=_[_0xd8db('0x1d')](config[_0xd8db('0x1c')],{'host':_0xd8db('0x1e'),'port':0x18eb});var socket=require(_0xd8db('0x1f'))(new Redis(config[_0xd8db('0x1c')]));require(_0xd8db('0x20'))[_0xd8db('0x21')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xd8db('0x22')]({'port':0x232c});var client9002=jayson[_0xd8db('0x23')]['http']({'port':0x232a});function checkPasswordPattern(_0x221681,_0x2eeed7,_0x54ad20){if(_0x54ad20){var _0x2241b6=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2241b6[_0xd8db('0x24')](_0x2eeed7)){return _0x221681;}else{throw new db[(_0xd8db('0x25'))][(_0xd8db('0x26'))](_0xd8db('0x27'));}}else{return _0x221681;}}function respondWithRpcPromise(_0x190ba4,_0x2d0a0c,_0x3177af,_0x29026e){return new BPromise(function(_0x45d00d,_0x235ffc){var _0x533458=_0x29026e||client;return _0x533458['request'](_0x190ba4,_0x3177af)[_0xd8db('0x28')](function(_0x16f30f){logger[_0xd8db('0x29')](_0xd8db('0x2a'),_0x2d0a0c,_0xd8db('0x2b'));logger[_0xd8db('0x2c')](_0xd8db('0x2d'),_0x2d0a0c,_0xd8db('0x2b'),JSON[_0xd8db('0x2e')](_0x16f30f));if(_0x16f30f[_0xd8db('0x2f')]){if(_0x16f30f[_0xd8db('0x2f')][_0xd8db('0x30')]===0x1f4){logger[_0xd8db('0x2f')]('FaxAccount,\x20%s,\x20%s',_0x2d0a0c,_0x16f30f[_0xd8db('0x2f')][_0xd8db('0x31')]);return _0x235ffc(_0x16f30f[_0xd8db('0x2f')][_0xd8db('0x31')]);}logger[_0xd8db('0x2f')]('FaxAccount,\x20%s,\x20%s',_0x2d0a0c,_0x16f30f['error'][_0xd8db('0x31')]);return _0x45d00d(_0x16f30f[_0xd8db('0x2f')][_0xd8db('0x31')]);}else{logger[_0xd8db('0x29')](_0xd8db('0x2a'),_0x2d0a0c,_0xd8db('0x2b'));_0x45d00d(_0x16f30f['result'][_0xd8db('0x31')]);}})['catch'](function(_0x6aed7f){logger[_0xd8db('0x2f')](_0xd8db('0x2a'),_0x2d0a0c,_0x6aed7f);_0x235ffc(_0x6aed7f);});});}function respondWithStatusCode(_0x530704,_0xd6bbbc){_0xd6bbbc=_0xd6bbbc||0xcc;return function(_0x53bf27){if(_0x53bf27){return _0x530704[_0xd8db('0x32')](_0xd6bbbc);}return _0x530704[_0xd8db('0x33')](_0xd6bbbc)[_0xd8db('0x34')]();};}function respondWithResult(_0x45bfbe,_0x1f0e11){_0x1f0e11=_0x1f0e11||0xc8;return function(_0x4a866f){if(_0x4a866f){return _0x45bfbe[_0xd8db('0x33')](_0x1f0e11)[_0xd8db('0x35')](_0x4a866f);}};}function respondWithFilteredResult(_0x4154b6,_0x3d1553){return function(_0x4f0024){if(_0x4f0024){var _0x55355d=_0x4f0024[_0xd8db('0x36')],_0x1ac8d2=_0x3d1553['offset'],_0x51145e=_0x3d1553['offset']+_0x3d1553[_0xd8db('0x37')],_0x300815;if(_0x51145e>=_0x55355d){_0x51145e=_0x55355d;_0x300815=0xc8;}else{_0x300815=0xce;}_0x4154b6[_0xd8db('0x33')](_0x300815);return _0x4154b6[_0xd8db('0x38')]('Content-Range',_0x1ac8d2+'-'+_0x51145e+'/'+_0x55355d)[_0xd8db('0x35')](_0x4f0024);}return null;};}function patchUpdates(_0x24d28f){return function(_0x58ce6d){try{jsonpatch[_0xd8db('0x39')](_0x58ce6d,_0x24d28f,!![]);}catch(_0x44635c){return BPromise[_0xd8db('0x3a')](_0x44635c);}return _0x58ce6d[_0xd8db('0x3b')]();};}function saveUpdates(_0x203505,_0x341083){return function(_0x30e7ad){if(_0x30e7ad){return _0x30e7ad['update'](_0x203505)[_0xd8db('0x28')](function(_0x2fb3b3){return _0x2fb3b3;});}return null;};}function removeEntity(_0x4b09ce,_0x3423de){return function(_0x5b79ed){if(_0x5b79ed){return _0x5b79ed[_0xd8db('0x3c')]()['then'](function(){var _0x437953=_0x5b79ed[_0xd8db('0x3d')]({'plain':!![]});var _0x109588=_0xd8db('0x3e');return db[_0xd8db('0x3f')][_0xd8db('0x3c')]({'where':{'type':_0x109588,'resourceId':_0x437953['id']}})[_0xd8db('0x28')](function(){return _0x5b79ed;});})['then'](function(){_0x4b09ce['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f8cb4,_0x178f92){return function(_0x1a4ac9){if(!_0x1a4ac9){_0x1f8cb4['sendStatus'](0x194);}return _0x1a4ac9;};}function handleError(_0x488795,_0x36f7c0){_0x36f7c0=_0x36f7c0||0x1f4;return function(_0x8cf86){logger[_0xd8db('0x2f')](_0x8cf86[_0xd8db('0x40')]);if(_0x8cf86[_0xd8db('0x41')]){delete _0x8cf86[_0xd8db('0x41')];}_0x488795[_0xd8db('0x33')](_0x36f7c0)[_0xd8db('0x42')](_0x8cf86);};}exports['index']=function(_0x265010,_0x255c8a){var _0x27fd80={'include':[{'model':db[_0xd8db('0x43')],'as':'mandatoryDispositionPause'}]},_0x28b1a7={},_0x3898b4={'count':0x0,'rows':[]};var _0x525cc6=_[_0xd8db('0x44')](db[_0xd8db('0x45')][_0xd8db('0x46')],function(_0x52ef63){return{'name':_0x52ef63[_0xd8db('0x47')],'type':_0x52ef63[_0xd8db('0x48')][_0xd8db('0x49')]};});_0x28b1a7['model']=_[_0xd8db('0x44')](_0x525cc6,_0xd8db('0x41'));_0x28b1a7[_0xd8db('0x4a')]=_[_0xd8db('0x4b')](_0x265010[_0xd8db('0x4a')]);_0x28b1a7['filters']=_[_0xd8db('0x4c')](_0x28b1a7['model'],_0x28b1a7[_0xd8db('0x4a')]);_0x27fd80['attributes']=_['intersection'](_0x28b1a7[_0xd8db('0x4d')],qs['fields'](_0x265010[_0xd8db('0x4a')][_0xd8db('0x4e')]));_0x27fd80[_0xd8db('0x4f')]=_0x27fd80[_0xd8db('0x4f')]['length']?_0x27fd80[_0xd8db('0x4f')]:_0x28b1a7[_0xd8db('0x4d')];if(!_0x265010[_0xd8db('0x4a')][_0xd8db('0x50')](_0xd8db('0x51'))){_0x27fd80[_0xd8db('0x37')]=qs[_0xd8db('0x37')](_0x265010['query'][_0xd8db('0x37')]);_0x27fd80[_0xd8db('0x52')]=qs['offset'](_0x265010[_0xd8db('0x4a')][_0xd8db('0x52')]);}_0x27fd80[_0xd8db('0x53')]=qs['sort'](_0x265010[_0xd8db('0x4a')]['sort']);_0x27fd80[_0xd8db('0x54')]=qs[_0xd8db('0x55')](_[_0xd8db('0x56')](_0x265010[_0xd8db('0x4a')],_0x28b1a7['filters']));if(_0x265010[_0xd8db('0x4a')][_0xd8db('0x57')]){_0x27fd80[_0xd8db('0x54')]=_[_0xd8db('0x58')](_0x27fd80['where'],{'$or':_[_0xd8db('0x44')](_0x525cc6,function(_0x10f700){if(_0x10f700[_0xd8db('0x48')]!=='VIRTUAL'){var _0x5c0932={};_0x5c0932[_0x10f700[_0xd8db('0x41')]]={'$like':'%'+_0x265010[_0xd8db('0x4a')][_0xd8db('0x57')]+'%'};return _0x5c0932;}})});}_0x27fd80=_['merge']({},_0x27fd80,_0x265010[_0xd8db('0x59')]);var _0x57cd75={'where':_0x27fd80['where']};return db[_0xd8db('0x45')]['count'](_0x57cd75)[_0xd8db('0x28')](function(_0x9f8a56){_0x3898b4[_0xd8db('0x36')]=_0x9f8a56;if(_0x265010[_0xd8db('0x4a')][_0xd8db('0x5a')]){_0x27fd80[_0xd8db('0x5b')]=[{'all':!![]}];}return db[_0xd8db('0x45')][_0xd8db('0x5c')](_0x27fd80);})[_0xd8db('0x28')](function(_0x14bef4){_0x3898b4[_0xd8db('0x5d')]=_0x14bef4;return _0x3898b4;})[_0xd8db('0x28')](respondWithFilteredResult(_0x255c8a,_0x27fd80))[_0xd8db('0x5e')](handleError(_0x255c8a,null));};exports[_0xd8db('0x5f')]=function(_0x34b067,_0x59d356){var _0x3bd177={'raw':![],'where':{'id':_0x34b067[_0xd8db('0x60')]['id']},'include':[{'model':db[_0xd8db('0x43')],'as':_0xd8db('0x61')}]},_0x46d54c={};_0x46d54c[_0xd8db('0x4d')]=_[_0xd8db('0x4b')](db['FaxAccount'][_0xd8db('0x46')]);_0x46d54c[_0xd8db('0x4a')]=_[_0xd8db('0x4b')](_0x34b067[_0xd8db('0x4a')]);_0x46d54c['filters']=_[_0xd8db('0x4c')](_0x46d54c['model'],_0x46d54c[_0xd8db('0x4a')]);_0x3bd177[_0xd8db('0x4f')]=_['intersection'](_0x46d54c[_0xd8db('0x4d')],qs[_0xd8db('0x4e')](_0x34b067[_0xd8db('0x4a')][_0xd8db('0x4e')]));_0x3bd177['attributes']=_0x3bd177[_0xd8db('0x4f')][_0xd8db('0x62')]?_0x3bd177[_0xd8db('0x4f')]:_0x46d54c[_0xd8db('0x4d')];if(_0x34b067[_0xd8db('0x4a')][_0xd8db('0x5a')]){_0x3bd177[_0xd8db('0x5b')]=[{'all':!![]}];}_0x3bd177=_[_0xd8db('0x58')]({},_0x3bd177,_0x34b067[_0xd8db('0x59')]);return db[_0xd8db('0x45')][_0xd8db('0x63')](_0x3bd177)[_0xd8db('0x28')](handleEntityNotFound(_0x59d356,null))[_0xd8db('0x28')](respondWithResult(_0x59d356,null))[_0xd8db('0x5e')](handleError(_0x59d356,null));};exports['create']=function(_0x5b52a8,_0x24ace7){return db[_0xd8db('0x45')]['create'](_0x5b52a8[_0xd8db('0x64')],{})[_0xd8db('0x28')](function(_0x271fb9){var _0x6eb76d=_0x5b52a8[_0xd8db('0x65')][_0xd8db('0x3d')]({'plain':!![]});if(!_0x6eb76d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x6eb76d[_0xd8db('0x66')]===_0xd8db('0x65')){var _0x9f7ac7=_0x271fb9[_0xd8db('0x3d')]({'plain':!![]});var _0x4d4e9a=_0xd8db('0x3e');return db[_0xd8db('0x67')][_0xd8db('0x63')]({'where':{'name':_0x4d4e9a,'userProfileId':_0x6eb76d['userProfileId']},'raw':!![]})[_0xd8db('0x28')](function(_0x6b25f3){if(_0x6b25f3&&_0x6b25f3['autoAssociation']===0x0){return db[_0xd8db('0x3f')]['create']({'name':_0x9f7ac7[_0xd8db('0x41')],'resourceId':_0x9f7ac7['id'],'type':_0x6b25f3[_0xd8db('0x41')],'sectionId':_0x6b25f3['id']},{})[_0xd8db('0x28')](function(){return _0x271fb9;});}else{return _0x271fb9;}})['catch'](function(_0x746ac7){logger[_0xd8db('0x2f')](_0xd8db('0x68'),_0x746ac7);throw _0x746ac7;});}return _0x271fb9;})[_0xd8db('0x28')](respondWithResult(_0x24ace7,0xc9))[_0xd8db('0x5e')](handleError(_0x24ace7,null));};exports[_0xd8db('0x69')]=function(_0x20eaf3,_0x2b5c3c){if(_0x20eaf3['body']['id']){delete _0x20eaf3[_0xd8db('0x64')]['id'];}return db[_0xd8db('0x45')]['find']({'where':{'id':_0x20eaf3[_0xd8db('0x60')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x2b5c3c,null))['then'](saveUpdates(_0x20eaf3['body'],null))[_0xd8db('0x28')](respondWithResult(_0x2b5c3c,null))[_0xd8db('0x5e')](handleError(_0x2b5c3c,null));};exports[_0xd8db('0x3c')]=function(_0x17569b,_0x1c63e4){return db[_0xd8db('0x45')]['find']({'where':{'id':_0x17569b['params']['id']}})[_0xd8db('0x28')](handleEntityNotFound(_0x1c63e4,null))[_0xd8db('0x28')](removeEntity(_0x1c63e4,null))[_0xd8db('0x5e')](handleError(_0x1c63e4,null));};exports['describe']=function(_0x3405e0,_0x56fc1c){return db[_0xd8db('0x45')]['describe']()['then'](respondWithResult(_0x56fc1c,null))[_0xd8db('0x5e')](handleError(_0x56fc1c,null));};exports[_0xd8db('0x6a')]=function(_0x2b96dd,_0x36bf52,_0x41b552){if(_0x2b96dd['body']['id']){delete _0x2b96dd['body']['id'];}return db[_0xd8db('0x45')][_0xd8db('0x63')]({'where':{'id':_0x2b96dd[_0xd8db('0x60')]['id']}})[_0xd8db('0x28')](handleEntityNotFound(_0x36bf52,null))[_0xd8db('0x28')](function(_0xbbeb78){if(_0xbbeb78){_0x2b96dd['body'][_0xd8db('0x6b')]=_0xbbeb78['id'];return db[_0xd8db('0x6c')][_0xd8db('0x6d')](_0x2b96dd[_0xd8db('0x64')]);}})[_0xd8db('0x28')](respondWithResult(_0x36bf52,null))[_0xd8db('0x5e')](handleError(_0x36bf52,null));};exports[_0xd8db('0x6e')]=function(_0x3da02c,_0x4e318e,_0x515d9d){var _0x5831ce={'raw':![],'where':{}};var _0x207dff={};var _0x575440={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x3da02c[_0xd8db('0x60')]['id']}})[_0xd8db('0x28')](handleEntityNotFound(_0x4e318e,null))['then'](function(_0x1d4119){if(_0x1d4119){_0x207dff[_0xd8db('0x4d')]=_[_0xd8db('0x4b')](db[_0xd8db('0x6c')]['rawAttributes']);_0x207dff[_0xd8db('0x4a')]=_[_0xd8db('0x4b')](_0x3da02c['query']);_0x207dff[_0xd8db('0x55')]=_['intersection'](_0x207dff[_0xd8db('0x4d')],_0x207dff[_0xd8db('0x4a')]);_0x5831ce[_0xd8db('0x4f')]=_[_0xd8db('0x4c')](_0x207dff['model'],qs[_0xd8db('0x4e')](_0x3da02c[_0xd8db('0x4a')][_0xd8db('0x4e')]));_0x5831ce[_0xd8db('0x4f')]=_0x5831ce[_0xd8db('0x4f')][_0xd8db('0x62')]?_0x5831ce[_0xd8db('0x4f')]:_0x207dff['model'];if(!_0x3da02c['query'][_0xd8db('0x50')](_0xd8db('0x51'))){_0x5831ce['limit']=qs['limit'](_0x3da02c[_0xd8db('0x4a')]['limit']);_0x5831ce['offset']=qs['offset'](_0x3da02c['query']['offset']);}_0x5831ce['order']=qs['sort'](_0x3da02c[_0xd8db('0x4a')]['sort']);_0x5831ce[_0xd8db('0x54')]=qs[_0xd8db('0x55')](_['pick'](_0x3da02c[_0xd8db('0x4a')],_0x207dff[_0xd8db('0x55')]));_0x5831ce[_0xd8db('0x54')][_0xd8db('0x6b')]=_0x1d4119['id'];if(_0x3da02c['query'][_0xd8db('0x57')]){_0x5831ce[_0xd8db('0x54')]=_[_0xd8db('0x58')](_0x5831ce[_0xd8db('0x54')],{'$or':_[_0xd8db('0x44')](_0x5831ce['attributes'],function(_0x4ddb7d){var _0x5f2897={};_0x5f2897[_0x4ddb7d]={'$like':'%'+_0x3da02c[_0xd8db('0x4a')][_0xd8db('0x57')]+'%'};return _0x5f2897;})});}_0x5831ce=_['merge']({},_0x5831ce,_0x3da02c[_0xd8db('0x59')]);return db[_0xd8db('0x6c')][_0xd8db('0x36')]({'where':_0x5831ce[_0xd8db('0x54')]})[_0xd8db('0x28')](function(_0x3b5bfd){_0x575440[_0xd8db('0x36')]=_0x3b5bfd;if(_0x3da02c['query']['includeAll']){_0x5831ce[_0xd8db('0x5b')]=[{'all':!![]}];}return db['Disposition'][_0xd8db('0x5c')](_0x5831ce);})['then'](function(_0x1e74c2){_0x575440['rows']=_0x1e74c2;return _0x575440;});}})[_0xd8db('0x28')](respondWithFilteredResult(_0x4e318e,_0x5831ce))[_0xd8db('0x5e')](handleError(_0x4e318e,null));};exports['removeDispositions']=function(_0x5d2278,_0xce0e98,_0x111248){return db[_0xd8db('0x45')][_0xd8db('0x63')]({'where':{'id':_0x5d2278[_0xd8db('0x60')]['id']}})[_0xd8db('0x28')](handleEntityNotFound(_0xce0e98,null))[_0xd8db('0x28')](function(_0x136259){if(_0x136259){return _0x136259['removeDispositions'](_0x5d2278[_0xd8db('0x4a')]['ids']);}})[_0xd8db('0x28')](respondWithStatusCode(_0xce0e98,null))['catch'](handleError(_0xce0e98,null));};exports[_0xd8db('0x6f')]=function(_0x78d459,_0x50a041,_0x6cd154){if(_0x78d459[_0xd8db('0x64')]['id']){delete _0x78d459[_0xd8db('0x64')]['id'];}return db['FaxAccount'][_0xd8db('0x63')]({'where':{'id':_0x78d459[_0xd8db('0x60')]['id']}})[_0xd8db('0x28')](handleEntityNotFound(_0x50a041,null))[_0xd8db('0x28')](function(_0x373091){if(_0x373091){_0x78d459[_0xd8db('0x64')]['FaxAccountId']=_0x373091['id'];return db[_0xd8db('0x70')][_0xd8db('0x6d')](_0x78d459[_0xd8db('0x64')]);}})[_0xd8db('0x28')](respondWithResult(_0x50a041,null))['catch'](handleError(_0x50a041,null));};exports[_0xd8db('0x71')]=function(_0x20386c,_0xf3dd39,_0x2b9e87){var _0x34c763={'raw':![],'where':{}};var _0x90e9a9={};var _0x10548e={'count':0x0,'rows':[]};return db[_0xd8db('0x45')]['findOne']({'where':{'id':_0x20386c[_0xd8db('0x60')]['id']}})['then'](handleEntityNotFound(_0xf3dd39,null))[_0xd8db('0x28')](function(_0x57c7a3){if(_0x57c7a3){_0x90e9a9['model']=_['keys'](db['CannedAnswer'][_0xd8db('0x46')]);_0x90e9a9[_0xd8db('0x4a')]=_[_0xd8db('0x4b')](_0x20386c[_0xd8db('0x4a')]);_0x90e9a9[_0xd8db('0x55')]=_[_0xd8db('0x4c')](_0x90e9a9['model'],_0x90e9a9[_0xd8db('0x4a')]);_0x34c763['attributes']=_[_0xd8db('0x4c')](_0x90e9a9[_0xd8db('0x4d')],qs[_0xd8db('0x4e')](_0x20386c[_0xd8db('0x4a')][_0xd8db('0x4e')]));_0x34c763['attributes']=_0x34c763['attributes'][_0xd8db('0x62')]?_0x34c763[_0xd8db('0x4f')]:_0x90e9a9['model'];if(!_0x20386c['query']['hasOwnProperty'](_0xd8db('0x51'))){_0x34c763[_0xd8db('0x37')]=qs[_0xd8db('0x37')](_0x20386c['query']['limit']);_0x34c763[_0xd8db('0x52')]=qs[_0xd8db('0x52')](_0x20386c[_0xd8db('0x4a')][_0xd8db('0x52')]);}_0x34c763['order']=qs[_0xd8db('0x72')](_0x20386c[_0xd8db('0x4a')][_0xd8db('0x72')]);_0x34c763[_0xd8db('0x54')]=qs[_0xd8db('0x55')](_[_0xd8db('0x56')](_0x20386c['query'],_0x90e9a9[_0xd8db('0x55')]));_0x34c763['where']['FaxAccountId']=_0x57c7a3['id'];if(_0x20386c[_0xd8db('0x4a')]['filter']){_0x34c763['where']=_[_0xd8db('0x58')](_0x34c763[_0xd8db('0x54')],{'$or':_['map'](_0x34c763[_0xd8db('0x4f')],function(_0x42cc80){var _0x1dc10f={};_0x1dc10f[_0x42cc80]={'$like':'%'+_0x20386c['query'][_0xd8db('0x57')]+'%'};return _0x1dc10f;})});}_0x34c763=_[_0xd8db('0x58')]({},_0x34c763,_0x20386c[_0xd8db('0x59')]);return db[_0xd8db('0x70')]['count']({'where':_0x34c763['where']})[_0xd8db('0x28')](function(_0x203c96){_0x10548e[_0xd8db('0x36')]=_0x203c96;if(_0x20386c[_0xd8db('0x4a')]['includeAll']){_0x34c763[_0xd8db('0x5b')]=[{'all':!![]}];}return db['CannedAnswer'][_0xd8db('0x5c')](_0x34c763);})[_0xd8db('0x28')](function(_0x15a82f){_0x10548e[_0xd8db('0x5d')]=_0x15a82f;return _0x10548e;});}})['then'](respondWithFilteredResult(_0xf3dd39,_0x34c763))[_0xd8db('0x5e')](handleError(_0xf3dd39,null));};exports[_0xd8db('0x73')]=function(_0x59ab3c,_0x4764f9,_0x208550){return db[_0xd8db('0x45')][_0xd8db('0x63')]({'where':{'id':_0x59ab3c[_0xd8db('0x60')]['id']}})['then'](handleEntityNotFound(_0x4764f9,null))[_0xd8db('0x28')](function(_0x4ed091){if(_0x4ed091){return _0x4ed091[_0xd8db('0x73')](_0x59ab3c[_0xd8db('0x4a')][_0xd8db('0x74')]);}})['then'](respondWithStatusCode(_0x4764f9,null))[_0xd8db('0x5e')](handleError(_0x4764f9,null));};exports[_0xd8db('0x75')]=function(_0x409680,_0x39f6ce,_0xee7fa4){return db['FaxInteraction']['find']({'where':{'id':_0x409680[_0xd8db('0x60')]['id']}})[_0xd8db('0x28')](handleEntityNotFound(_0x39f6ce,null))[_0xd8db('0x28')](function(_0x335c00){if(_0x335c00){return _0x335c00[_0xd8db('0x75')](_0x409680['body'][_0xd8db('0x74')],_[_0xd8db('0x76')](_0x409680['body'],[_0xd8db('0x74'),'id'])||{});}})[_0xd8db('0x28')](respondWithResult(_0x39f6ce,null))[_0xd8db('0x5e')](handleError(_0x39f6ce,null));};exports[_0xd8db('0x77')]=function(_0x3f1012,_0x4de4c2,_0x142e82){var _0x7e7fcc={'raw':![],'where':{}};var _0x426794={};var _0x4a6c7d={'count':0x0,'rows':[]};return db[_0xd8db('0x45')][_0xd8db('0x78')]({'where':{'id':_0x3f1012[_0xd8db('0x60')]['id']}})['then'](handleEntityNotFound(_0x4de4c2,null))['then'](function(_0x35da3f){if(_0x35da3f){_0x426794[_0xd8db('0x4d')]=_[_0xd8db('0x4b')](db[_0xd8db('0x79')][_0xd8db('0x46')]);_0x426794[_0xd8db('0x4a')]=_[_0xd8db('0x4b')](_0x3f1012[_0xd8db('0x4a')]);_0x426794[_0xd8db('0x55')]=_[_0xd8db('0x4c')](_0x426794[_0xd8db('0x4d')],_0x426794[_0xd8db('0x4a')]);_0x7e7fcc['attributes']=_[_0xd8db('0x4c')](_0x426794[_0xd8db('0x4d')],qs['fields'](_0x3f1012[_0xd8db('0x4a')]['fields']));_0x7e7fcc[_0xd8db('0x4f')]=_0x7e7fcc[_0xd8db('0x4f')][_0xd8db('0x62')]?_0x7e7fcc[_0xd8db('0x4f')]:_0x426794[_0xd8db('0x4d')];if(!_0x3f1012[_0xd8db('0x4a')][_0xd8db('0x50')](_0xd8db('0x51'))){_0x7e7fcc[_0xd8db('0x37')]=qs['limit'](_0x3f1012[_0xd8db('0x4a')]['limit']);_0x7e7fcc['offset']=qs[_0xd8db('0x52')](_0x3f1012[_0xd8db('0x4a')]['offset']);}_0x7e7fcc['order']=qs[_0xd8db('0x72')](_0x3f1012[_0xd8db('0x4a')][_0xd8db('0x72')]);_0x7e7fcc[_0xd8db('0x54')]=qs[_0xd8db('0x55')](_['pick'](_0x3f1012['query'],_0x426794[_0xd8db('0x55')]));_0x7e7fcc[_0xd8db('0x54')][_0xd8db('0x6b')]=_0x35da3f['id'];if(_0x3f1012[_0xd8db('0x4a')][_0xd8db('0x57')]){_0x7e7fcc[_0xd8db('0x54')]=_[_0xd8db('0x58')](_0x7e7fcc['where'],{'$or':_['map'](_0x7e7fcc[_0xd8db('0x4f')],function(_0x38bd79){var _0x1b885b={};_0x1b885b[_0x38bd79]={'$like':'%'+_0x3f1012[_0xd8db('0x4a')][_0xd8db('0x57')]+'%'};return _0x1b885b;})});}_0x7e7fcc=_[_0xd8db('0x58')]({},_0x7e7fcc,_0x3f1012[_0xd8db('0x59')]);return db[_0xd8db('0x79')][_0xd8db('0x36')]({'where':_0x7e7fcc['where']})[_0xd8db('0x28')](function(_0x32a9bf){_0x4a6c7d['count']=_0x32a9bf;if(_0x3f1012[_0xd8db('0x4a')][_0xd8db('0x5a')]){_0x7e7fcc['include']=[{'model':db['CmContact'],'as':_0xd8db('0x7a'),'required':![]},{'model':db[_0xd8db('0x7b')],'as':_0xd8db('0x7c'),'attributes':[_0xd8db('0x41'),_0xd8db('0x7d'),_0xd8db('0x7e')],'required':![]},{'model':db[_0xd8db('0x7f')],'as':_0xd8db('0x80'),'attributes':['id',_0xd8db('0x41'),_0xd8db('0x81')],'where':_0x3f1012['query'][_0xd8db('0x82')]?{'id':_0x3f1012[_0xd8db('0x4a')][_0xd8db('0x82')]}:undefined,'required':_0x3f1012['query']['tag']?!![]:![]}];}return db[_0xd8db('0x79')]['findAll'](_0x7e7fcc);})[_0xd8db('0x28')](function(_0x2732da){_0x4a6c7d[_0xd8db('0x5d')]=_0x2732da;return _0x4a6c7d;});}})[_0xd8db('0x28')](respondWithFilteredResult(_0x4de4c2,_0x7e7fcc))[_0xd8db('0x5e')](handleError(_0x4de4c2,null));};exports[_0xd8db('0x83')]=function(_0x3b803c,_0xff1405,_0x4aeb3c){return db[_0xd8db('0x45')][_0xd8db('0x78')]({'where':{'id':_0x3b803c[_0xd8db('0x60')]['id']}})[_0xd8db('0x28')](handleEntityNotFound(_0xff1405,null))[_0xd8db('0x28')](function(_0x3a2019){if(_0x3a2019){return db[_0xd8db('0x84')][_0xd8db('0x85')](function(_0x2f0de3){return db[_0xd8db('0x86')]['destroy']({'where':{'FaxAccountId':_0x3b803c[_0xd8db('0x60')]['id']},'transaction':_0x2f0de3})[_0xd8db('0x28')](function(_0xb06e3a){var _0xdd4156=_[_0xd8db('0x44')](_0x3b803c[_0xd8db('0x64')],function(_0x1c969a){_0x1c969a['FaxAccountId']=_0x3b803c[_0xd8db('0x60')]['id'];return _0x1c969a;});return db['FaxApplication']['bulkCreate'](_0xdd4156,{'transaction':_0x2f0de3});});})[_0xd8db('0x28')](function(){return db[_0xd8db('0x86')]['findAndCountAll']({'where':{'FaxAccountId':_0x3b803c[_0xd8db('0x60')]['id']},'order':'priority'});});}})[_0xd8db('0x28')](respondWithResult(_0xff1405,null))[_0xd8db('0x5e')](handleError(_0xff1405,null));};exports[_0xd8db('0x87')]=function(_0x31e523,_0x15300a,_0x1d3e6c){var _0x35d4a0={};var _0x407378={};var _0x31042a;var _0x6b31c9;return db[_0xd8db('0x45')][_0xd8db('0x78')]({'where':{'id':_0x31e523[_0xd8db('0x60')]['id']}})[_0xd8db('0x28')](handleEntityNotFound(_0x15300a,null))[_0xd8db('0x28')](function(_0x8d5568){if(_0x8d5568){_0x31042a=_0x8d5568;_0x407378[_0xd8db('0x4d')]=_[_0xd8db('0x4b')](db['FaxApplication'][_0xd8db('0x46')]);_0x407378['query']=_['keys'](_0x31e523['query']);_0x407378[_0xd8db('0x55')]=_[_0xd8db('0x4c')](_0x407378[_0xd8db('0x4d')],_0x407378[_0xd8db('0x4a')]);_0x35d4a0['attributes']=_[_0xd8db('0x4c')](_0x407378['model'],qs[_0xd8db('0x4e')](_0x31e523['query']['fields']));_0x35d4a0[_0xd8db('0x4f')]=_0x35d4a0['attributes'][_0xd8db('0x62')]?_0x35d4a0[_0xd8db('0x4f')]:_0x407378[_0xd8db('0x4d')];_0x35d4a0['order']=qs[_0xd8db('0x72')](_0x31e523[_0xd8db('0x4a')][_0xd8db('0x72')]);_0x35d4a0['where']=qs[_0xd8db('0x55')](_[_0xd8db('0x56')](_0x31e523[_0xd8db('0x4a')],_0x407378[_0xd8db('0x55')]));if(_0x31e523[_0xd8db('0x4a')][_0xd8db('0x57')]){_0x35d4a0['where']=_[_0xd8db('0x58')](_0x35d4a0[_0xd8db('0x54')],{'$or':_[_0xd8db('0x44')](_0x35d4a0['attributes'],function(_0x45b3f9){var _0x393de4={};_0x393de4[_0x45b3f9]={'$like':'%'+_0x31e523[_0xd8db('0x4a')][_0xd8db('0x57')]+'%'};return _0x393de4;})});}_0x35d4a0=_[_0xd8db('0x58')]({},_0x35d4a0,_0x31e523[_0xd8db('0x59')]);return _0x31042a[_0xd8db('0x87')](_0x35d4a0);}})[_0xd8db('0x28')](function(_0x2e5ea4){if(_0x2e5ea4){_0x6b31c9=_0x2e5ea4[_0xd8db('0x62')];if(!_0x31e523[_0xd8db('0x4a')]['hasOwnProperty'](_0xd8db('0x51'))){_0x35d4a0['limit']=qs[_0xd8db('0x37')](_0x31e523[_0xd8db('0x4a')]['limit']);_0x35d4a0['offset']=qs[_0xd8db('0x52')](_0x31e523[_0xd8db('0x4a')][_0xd8db('0x52')]);}return _0x31042a[_0xd8db('0x87')](_0x35d4a0);}})[_0xd8db('0x28')](function(_0x46d39d){if(_0x46d39d){return _0x46d39d?{'count':_0x6b31c9,'rows':_0x46d39d}:null;}})['then'](respondWithResult(_0x15300a,null))[_0xd8db('0x5e')](handleError(_0x15300a,null));};function Extension(_0x27fcff,_0x478836,_0x20a8e0,_0x1edf32){this[_0xd8db('0x88')]=_0xd8db('0x89');this['exten']=_0x27fcff[_0xd8db('0x8a')];this['app']=_0x1edf32;this['type']='system';this[_0xd8db('0x8b')]='Fax\x20Extension';this[_0xd8db('0x6b')]=_0x27fcff['id'];this[_0xd8db('0x8c')]=_0x478836;this[_0xd8db('0x8d')]=_0x20a8e0;}function createExtensionsReciveFax(_0x12bf87){var _0x2810b2=0x1;var _0x538737=[];_0x538737[_0xd8db('0x8e')](new Extension(_0x12bf87,_0x2810b2,'',_0xd8db('0x8f')));_0x2810b2+=0x1;_0x538737[_0xd8db('0x8e')](new Extension(_0x12bf87,_0x2810b2,_0xd8db('0x90'),'Set'));_0x2810b2+=0x1;for(var _0x2a4dfd in _0x12bf87){if(_0x12bf87[_0xd8db('0x50')](_0x2a4dfd)&&(_0x2a4dfd==='ecm'||_0x2a4dfd===_0xd8db('0x8a')||_0x2a4dfd===_0xd8db('0x91')||_0x2a4dfd===_0xd8db('0x92')||_0x2a4dfd===_0xd8db('0x93')||_0x2a4dfd===_0xd8db('0x94')||_0x2a4dfd===_0xd8db('0x95')||_0x2a4dfd===_0xd8db('0x96')||_0x2a4dfd===_0xd8db('0x97'))){_0x538737[_0xd8db('0x8e')](new Extension(_0x12bf87,_0x2810b2,_0xd8db('0x98')+_0x2a4dfd+')='+_0x12bf87[_0x2a4dfd],_0xd8db('0x99')));_0x2810b2+=0x1;}}_0x538737[_0xd8db('0x8e')](new Extension(_0x12bf87,_0x2810b2,'6','Wait'));_0x2810b2+=0x1;_0x538737[_0xd8db('0x8e')](new Extension(_0x12bf87,_0x2810b2,'/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',_0xd8db('0x9a')));_0x2810b2=0x0;return _0x538737;}exports['addAccountApplications']=function(_0x58c176,_0xf5179e,_0x1dd72f){var _0x1af6d9;return db['sequelize'][_0xd8db('0x85')](function(_0x4900d6){return db['FaxAccount'][_0xd8db('0x6d')](_0x58c176['body'],{'transaction':_0x4900d6})[_0xd8db('0x28')](function(_0x33a62d){_0x1af6d9=_0x33a62d['get']({'plain':!![]});return db[_0xd8db('0x9b')][_0xd8db('0x9c')](createExtensionsReciveFax(_0x1af6d9),{'transaction':_0x4900d6});});})[_0xd8db('0x28')](function(){return _0x1af6d9;})[_0xd8db('0x28')](respondWithResult(_0xf5179e,null))['catch'](handleError(_0xf5179e,null));};exports[_0xd8db('0x9d')]=function(_0x22881f,_0x4b3350,_0x5eb21f){var _0x50eef7;return db[_0xd8db('0x84')][_0xd8db('0x85')](function(_0x2a31c1){return db['FaxAccount'][_0xd8db('0x69')](_0x22881f['body'],{'where':{'id':_0x22881f[_0xd8db('0x64')]['id']},'transaction':_0x2a31c1})[_0xd8db('0x28')](function(_0xcf6d19){return db[_0xd8db('0x9b')][_0xd8db('0x3c')]({'where':{'FaxAccountId':_0x22881f['body']['id']},'transaction':_0x2a31c1})[_0xd8db('0x28')](function(_0x4b99ac){return db[_0xd8db('0x9b')][_0xd8db('0x9c')](createExtensionsReciveFax(_['omit'](_0x22881f['body'],[_0xd8db('0x9e'),_0xd8db('0x49'),_0xd8db('0x9f'),_0xd8db('0xa0'),_0xd8db('0xa1'),'ListId'])),{'transaction':_0x2a31c1});});});})[_0xd8db('0x28')](function(){return db[_0xd8db('0x45')][_0xd8db('0xa2')](_0x22881f[_0xd8db('0x64')]['id']);})[_0xd8db('0x28')](respondWithResult(_0x4b3350,null))[_0xd8db('0x5e')](handleError(_0x4b3350,null));};exports['getMessages']=function(_0x56d3e4,_0x1553b3,_0x197380){var _0x996e40={'raw':!![],'where':{}};var _0x404087={};var _0x9f85cf={'count':0x0,'rows':[]};return db[_0xd8db('0x45')]['findOne']({'where':{'id':_0x56d3e4[_0xd8db('0x60')]['id']}})[_0xd8db('0x28')](handleEntityNotFound(_0x1553b3,null))['then'](function(_0x4cdb49){if(_0x4cdb49){_0x404087[_0xd8db('0x4d')]=_['keys'](db[_0xd8db('0xa3')]['rawAttributes']);_0x404087[_0xd8db('0x4a')]=_[_0xd8db('0x4b')](_0x56d3e4[_0xd8db('0x4a')]);_0x404087[_0xd8db('0x55')]=_[_0xd8db('0x4c')](_0x404087['model'],_0x404087[_0xd8db('0x4a')]);_0x996e40[_0xd8db('0x4f')]=_[_0xd8db('0x4c')](_0x404087[_0xd8db('0x4d')],qs[_0xd8db('0x4e')](_0x56d3e4[_0xd8db('0x4a')]['fields']));_0x996e40[_0xd8db('0x4f')]=_0x996e40['attributes'][_0xd8db('0x62')]?_0x996e40[_0xd8db('0x4f')]:_0x404087[_0xd8db('0x4d')];if(!_0x56d3e4[_0xd8db('0x4a')][_0xd8db('0x50')]('nolimit')){_0x996e40[_0xd8db('0x37')]=qs['limit'](_0x56d3e4[_0xd8db('0x4a')][_0xd8db('0x37')]);_0x996e40[_0xd8db('0x52')]=qs[_0xd8db('0x52')](_0x56d3e4['query']['offset']);}_0x996e40[_0xd8db('0x53')]=qs['sort'](_0x56d3e4[_0xd8db('0x4a')][_0xd8db('0x72')]);_0x996e40[_0xd8db('0x54')]=qs[_0xd8db('0x55')](_[_0xd8db('0x56')](_0x56d3e4['query'],_0x404087[_0xd8db('0x55')]));_0x996e40['where'][_0xd8db('0x6b')]=_0x4cdb49['id'];if(_0x56d3e4[_0xd8db('0x4a')][_0xd8db('0x57')]){_0x996e40[_0xd8db('0x54')]=_[_0xd8db('0x58')](_0x996e40[_0xd8db('0x54')],{'$or':_[_0xd8db('0x44')](_0x996e40[_0xd8db('0x4f')],function(_0x568758){var _0x6b11be={};_0x6b11be[_0x568758]={'$like':'%'+_0x56d3e4['query'][_0xd8db('0x57')]+'%'};return _0x6b11be;})});}if(_0x56d3e4[_0xd8db('0x4a')][_0xd8db('0xa4')]){var _0x1f5365=_0x56d3e4[_0xd8db('0x4a')][_0xd8db('0xa4')]['split'](',');var _0x15f073={};_0x15f073[_0x1f5365[0x0]]={'$gte':moment(_0x1f5365[0x1])[_0xd8db('0xa5')](_0xd8db('0xa6'))};_0x996e40['where']=_[_0xd8db('0x58')](_0x996e40[_0xd8db('0x54')],_0x15f073);}_0x996e40=_[_0xd8db('0x58')]({},_0x996e40,_0x56d3e4[_0xd8db('0x59')]);return db['FaxMessage'][_0xd8db('0x36')]({'where':_0x996e40[_0xd8db('0x54')]})[_0xd8db('0x28')](function(_0xc489cb){_0x9f85cf[_0xd8db('0x36')]=_0xc489cb;if(_0x56d3e4[_0xd8db('0x4a')][_0xd8db('0x5a')]){_0x996e40[_0xd8db('0x5b')]=[{'all':!![]}];}return db[_0xd8db('0xa3')][_0xd8db('0x5c')](_0x996e40);})['then'](function(_0x4204e7){_0x9f85cf['rows']=_0x4204e7;return _0x9f85cf;});}})[_0xd8db('0x28')](respondWithFilteredResult(_0x1553b3,_0x996e40))[_0xd8db('0x5e')](handleError(_0x1553b3,null));};exports[_0xd8db('0x42')]=function(_0x1b250e,_0x2869e5,_0x17760b){var _0x4077a8,_0x4ec3a8={},_0x262810;if(_0x1b250e[_0xd8db('0x64')]['to']){_0x262810=_0x1b250e[_0xd8db('0x64')]['to'][0x0];}return db[_0xd8db('0x45')][_0xd8db('0x63')]({'where':{'id':_0x1b250e[_0xd8db('0x60')]['id']},'include':[{'model':db[_0xd8db('0xa7')],'as':_0xd8db('0xa8'),'include':[{'model':db[_0xd8db('0xa9')],'as':_0xd8db('0xaa'),'where':{'fax':_0x262810},'limit':0x1,'order':[['updatedAt',_0xd8db('0xab')]]}]}]})[_0xd8db('0x28')](handleEntityNotFound(_0x2869e5,null))[_0xd8db('0x28')](function(_0x493eb6){_0x4077a8=_0x493eb6;if(_0x1b250e['body'][_0xd8db('0xac')]&&_0x1b250e[_0xd8db('0x64')]['attachments'][_0xd8db('0x62')]){for(var _0x1176a3=0x0;_0x1176a3<_0x1b250e[_0xd8db('0x64')][_0xd8db('0xac')][_0xd8db('0x62')];_0x1176a3+=0x1){_0x1b250e[_0xd8db('0x64')][_0xd8db('0xac')][_0x1176a3]={'filename':_0x1b250e[_0xd8db('0x64')][_0xd8db('0xac')][_0x1176a3]['name'],'id':_0x1b250e[_0xd8db('0x64')]['attachments'][_0x1176a3]['id'],'path':path['join'](config[_0xd8db('0xad')],_0xd8db('0xae'),_0x1b250e[_0xd8db('0x64')][_0xd8db('0xac')][_0x1176a3][_0xd8db('0xaf')])};}}return respondWithRpcPromise(_0xd8db('0xb0'),_0xd8db('0xb0'),{'FaxAccountId':_['isNil'](_0x1b250e[_0xd8db('0x60')]['id'])?undefined:_0x1b250e[_0xd8db('0x60')]['id'],'path':_['isNil'](_0x1b250e[_0xd8db('0x64')]['attachments'][0x0][_0xd8db('0x9')])?undefined:_0x1b250e[_0xd8db('0x64')][_0xd8db('0xac')][0x0][_0xd8db('0x9')],'fax':_[_0xd8db('0xb1')](_0x1b250e[_0xd8db('0x64')]['to'][0x0])?undefined:_0x1b250e[_0xd8db('0x64')]['to'][0x0]},client9002);})['then'](function(){if(_0x4077a8){if(_['isNil'](_0x1b250e[_0xd8db('0x64')][_0xd8db('0xb2')])){_0x1b250e[_0xd8db('0x64')][_0xd8db('0xb2')]=util[_0xd8db('0xa5')](_0xd8db('0xb3'),_0x4077a8[_0xd8db('0x41')],_0x4077a8[_0xd8db('0xb4')]);}if(_0x4077a8[_0xd8db('0xa8')]){if(_0x4077a8['List'][_0xd8db('0xaa')]['length']){return _0x4077a8['List'][_0xd8db('0xaa')][0x0];}else{return db['CmContact'][_0xd8db('0x6d')](_[_0xd8db('0x1d')](_0x1b250e[_0xd8db('0x64')],{'firstName':_0x1b250e[_0xd8db('0x64')]['to'][0x0],'phone':_0x1b250e['body']['to'][0x0],'fax':_0x1b250e['body']['to'][0x0],'ListId':_0x4077a8[_0xd8db('0xb5')]}));}}else{throw new Error(_0xd8db('0xb6'));}}else{throw new Error('Send\x20Fax\x20failed');}})[_0xd8db('0x28')](function(_0x424ffc){if(_0x424ffc){return db['FaxInteraction']['find']({'where':{'ContactId':_0x424ffc['id'],'closed':![],'FaxAccountId':_0x4077a8['id']}})[_0xd8db('0x28')](function(_0x2bac9d){if(_0x2bac9d){return[_0x2bac9d,![]];}return db[_0xd8db('0x79')][_0xd8db('0x6d')]({'UserId':_0x1b250e[_0xd8db('0x65')]['id'],'ContactId':_0x424ffc['id'],'FaxAccountId':_0x4077a8['id'],'fax':_0x1b250e[_0xd8db('0x64')]['to'][0x0],'firstMsgDirection':_0xd8db('0xb7'),'Messages':[_[_0xd8db('0x58')](_0x1b250e[_0xd8db('0x64')],{'read':![],'body':_0x1b250e[_0xd8db('0x64')][_0xd8db('0xac')][0x0][_0xd8db('0xb8')],'FaxAccountId':_0x4077a8['id'],'UserId':_0x1b250e[_0xd8db('0x65')]['id'],'ContactId':_0x424ffc['id'],'AttachmentId':_0x1b250e[_0xd8db('0x64')][_0xd8db('0xac')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':_0xd8db('0xb9')}]})[_0xd8db('0x28')](function(_0x337595){return[_0x337595,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xd8db('0xba')](function(_0x766214,_0x1e12d8){if(_0x1e12d8){return _0x766214;}return db[_0xd8db('0xa3')][_0xd8db('0x6d')]({'direction':_0xd8db('0xb7'),'read':![],'body':_0x1b250e[_0xd8db('0x64')]['attachments'][0x0][_0xd8db('0xb8')],'FaxAccountId':_0x4077a8['id'],'FaxInteractionId':_0x766214['id'],'UserId':_0x1b250e['user']['id'],'ContactId':_0x766214[_0xd8db('0xbb')],'AttachmentId':_0x1b250e['body'][_0xd8db('0xac')][0x0]['id']})[_0xd8db('0x28')](function(_0x58bbea){_0x766214[_0xd8db('0xbc')]['Messages']=[];_0x766214[_0xd8db('0xbc')][_0xd8db('0xb9')][_0xd8db('0x8e')](_0x58bbea['dataValues']);return _0x766214;});})['then'](function(_0x3329fd){respondWithRpcPromise(_0xd8db('0xbd'),_0xd8db('0xbd'),{'FaxAccountId':_['isNil'](_0x1b250e[_0xd8db('0x60')]['id'])?undefined:_0x1b250e['params']['id'],'path':_[_0xd8db('0xb1')](_0x1b250e[_0xd8db('0x64')][_0xd8db('0xac')][0x0][_0xd8db('0x9')])?undefined:_0x1b250e['body'][_0xd8db('0xac')][0x0][_0xd8db('0x9')],'fax':_[_0xd8db('0xb1')](_0x1b250e[_0xd8db('0x64')]['to'][0x0])?undefined:_0x1b250e[_0xd8db('0x64')]['to'][0x0],'AttachmentId':_0x1b250e[_0xd8db('0x64')][_0xd8db('0xac')][0x0]['id']},client9002)[_0xd8db('0x28')](function(_0x29d92c){logger['info'](_0xd8db('0xbe'),_0x29d92c);})[_0xd8db('0x5e')](function(_0x5cadd7){logger[_0xd8db('0x29')]('SendFaxRpc,\x20%s',_0x5cadd7);});return _0x3329fd;})['then'](respondWithResult(_0x2869e5,null))[_0xd8db('0x5e')](handleError(_0x2869e5,null));};exports[_0xd8db('0xbf')]=function(_0x116eac,_0x4c7071,_0x5289e7){return db[_0xd8db('0x45')]['find']({'where':{'id':_0x116eac[_0xd8db('0x60')]['id']}})[_0xd8db('0x28')](handleEntityNotFound(_0x4c7071,null))['then'](function(_0x353b94){if(_0x353b94){return _0x353b94[_0xd8db('0xbf')](_0x116eac[_0xd8db('0x64')][_0xd8db('0x74')],_['omit'](_0x116eac[_0xd8db('0x64')],['ids','id'])||{})[_0xd8db('0xba')](function(_0x5643e7){for(var _0x1e3b27=0x0;_0x1e3b27<_0x116eac['body']['ids']['length'];_0x1e3b27+=0x1){socket[_0xd8db('0xc0')](_0xd8db('0xc1'),{'UserId':_0x116eac[_0xd8db('0x64')][_0xd8db('0x74')][_0x1e3b27],'FaxAccountId':_0x116eac['params']['id']});}return _0x5643e7;});}})['then'](respondWithResult(_0x4c7071,null))['catch'](handleError(_0x4c7071,null));};exports['removeAgents']=function(_0x4e6ea1,_0x4d8971,_0x497ae1){return db['FaxAccount'][_0xd8db('0x63')]({'where':{'id':_0x4e6ea1[_0xd8db('0x60')]['id']}})[_0xd8db('0x28')](handleEntityNotFound(_0x4d8971,null))[_0xd8db('0x28')](function(_0x45199a){if(_0x45199a){return _0x45199a['removeAgents'](_0x4e6ea1[_0xd8db('0x4a')]['ids'])[_0xd8db('0x28')](function(){if(_['isArray'](_0x4e6ea1['query'][_0xd8db('0x74')])){for(var _0x48e2ab=0x0;_0x48e2ab<_0x4e6ea1[_0xd8db('0x4a')][_0xd8db('0x74')][_0xd8db('0x62')];_0x48e2ab+=0x1){socket[_0xd8db('0xc0')](_0xd8db('0xc2'),{'UserId':Number(_0x4e6ea1[_0xd8db('0x4a')]['ids'][_0x48e2ab]),'FaxAccountId':Number(_0x4e6ea1['params']['id'])});}}else{socket['emit'](_0xd8db('0xc2'),{'UserId':Number(_0x4e6ea1[_0xd8db('0x4a')][_0xd8db('0x74')]),'FaxAccountId':Number(_0x4e6ea1[_0xd8db('0x60')]['id'])});}});}})[_0xd8db('0x28')](respondWithStatusCode(_0x4d8971,null))[_0xd8db('0x5e')](handleError(_0x4d8971,null));};exports[_0xd8db('0xc3')]=function(_0x4ce623,_0x4b5919,_0x3a86a0){var _0x26bd0f={};var _0x260b56={};var _0x414f9c;var _0x411a84;return db['FaxAccount'][_0xd8db('0x78')]({'where':{'id':_0x4ce623[_0xd8db('0x60')]['id']}})[_0xd8db('0x28')](handleEntityNotFound(_0x4b5919,null))[_0xd8db('0x28')](function(_0x272eab){if(_0x272eab){_0x414f9c=_0x272eab;_0x260b56['model']=_[_0xd8db('0x4b')](db[_0xd8db('0x7b')]['rawAttributes']);_0x260b56[_0xd8db('0x4a')]=_['keys'](_0x4ce623[_0xd8db('0x4a')]);_0x260b56[_0xd8db('0x55')]=_[_0xd8db('0x4c')](_0x260b56[_0xd8db('0x4d')],_0x260b56[_0xd8db('0x4a')]);_0x26bd0f[_0xd8db('0x4f')]=_[_0xd8db('0x4c')](_0x260b56['model'],qs[_0xd8db('0x4e')](_0x4ce623[_0xd8db('0x4a')][_0xd8db('0x4e')]));_0x26bd0f[_0xd8db('0x4f')]=_0x26bd0f['attributes'][_0xd8db('0x62')]?_0x26bd0f[_0xd8db('0x4f')]:_0x260b56[_0xd8db('0x4d')];_0x26bd0f['order']=qs[_0xd8db('0x72')](_0x4ce623[_0xd8db('0x4a')][_0xd8db('0x72')]);_0x26bd0f['where']=qs[_0xd8db('0x55')](_['pick'](_0x4ce623[_0xd8db('0x4a')],_0x260b56[_0xd8db('0x55')]));if(_0x4ce623['query'][_0xd8db('0x57')]){_0x26bd0f[_0xd8db('0x54')]=_[_0xd8db('0x58')](_0x26bd0f[_0xd8db('0x54')],{'$or':_[_0xd8db('0x44')](_0x26bd0f['attributes'],function(_0x48292a){var _0x3aead5={};_0x3aead5[_0x48292a]={'$like':'%'+_0x4ce623[_0xd8db('0x4a')][_0xd8db('0x57')]+'%'};return _0x3aead5;})});}_0x26bd0f=_[_0xd8db('0x58')]({},_0x26bd0f,_0x4ce623[_0xd8db('0x59')]);return _0x414f9c['getAgents'](_0x26bd0f);}})['then'](function(_0x215cac){if(_0x215cac){_0x411a84=_0x215cac['length'];if(!_0x4ce623['query'][_0xd8db('0x50')](_0xd8db('0x51'))){_0x26bd0f['limit']=qs[_0xd8db('0x37')](_0x4ce623[_0xd8db('0x4a')]['limit']);_0x26bd0f['offset']=qs[_0xd8db('0x52')](_0x4ce623[_0xd8db('0x4a')]['offset']);}return _0x414f9c[_0xd8db('0xc3')](_0x26bd0f);}})['then'](function(_0x4f3c98){if(_0x4f3c98){return _0x4f3c98?{'count':_0x411a84,'rows':_0x4f3c98}:null;}})['then'](respondWithResult(_0x4b5919,null))['catch'](handleError(_0x4b5919,null));}; \ No newline at end of file +var _0x1db6=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','sendStatus','status','json','count','offset','limit','Content-Range','reject','save','update','destroy','get','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','FaxAccountId','getDispositions','findOne','Disposition','nolimit','pick','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','FaxInteraction','addInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tags','color','tag','sequelize','FaxApplication','bulkCreate','findAndCountAll','priority','getApplications','context','exten','app','description','Fax\x20Extension','appdata','push','CDR(type)=inbound-fax','Set','ecm','localstationid','gateway','faxdetect','headerinfo','maxrate','modem','t38timeout','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','addAccountApplications','transaction','VoiceExtension','updateAccountApplications','tech','createdAt','updatedAt','TrunkId','findById','$gte','format','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','CmList','List','Contacts','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','fax','ListId','List\x20not\x20found','Send\x20Fax\x20failed','Messages','spread','out','filename','dataValues','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','squel','jsforce','desk.js','querystring'];(function(_0x4c00ea,_0x1cf606){var _0x2754b6=function(_0x2bf125){while(--_0x2bf125){_0x4c00ea['push'](_0x4c00ea['shift']());}};_0x2754b6(++_0x1cf606);}(_0x1db6,0xb6));var _0x61db=function(_0x15f807,_0x2158b4){_0x15f807=_0x15f807-0x0;var _0x33b165=_0x1db6[_0x15f807];return _0x33b165;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x61db('0x0'));var zipdir=require(_0x61db('0x1'));var jsonpatch=require(_0x61db('0x2'));var rp=require(_0x61db('0x3'));var moment=require(_0x61db('0x4'));var BPromise=require(_0x61db('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x61db('0x6'));var sox=require(_0x61db('0x7'));var csv=require(_0x61db('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x61db('0x9'));var crypto=require('crypto');var jsforce=require(_0x61db('0xa'));var deskjs=require(_0x61db('0xb'));var toCsv=require(_0x61db('0x8'));var querystring=require(_0x61db('0xc'));var Papa=require(_0x61db('0xd'));var Redis=require(_0x61db('0xe'));var authService=require(_0x61db('0xf'));var qs=require(_0x61db('0x10'));var as=require(_0x61db('0x11'));var hardwareService=require(_0x61db('0x12'));var logger=require(_0x61db('0x13'))(_0x61db('0x14'));var utils=require(_0x61db('0x15'));var config=require(_0x61db('0x16'));var db=require(_0x61db('0x17'))['db'];config[_0x61db('0x18')]=_[_0x61db('0x19')](config[_0x61db('0x18')],{'host':_0x61db('0x1a'),'port':0x18eb});var socket=require(_0x61db('0x1b'))(new Redis(config['redis']));require(_0x61db('0x1c'))[_0x61db('0x1d')](socket);var jayson=require(_0x61db('0x1e'));var client=jayson[_0x61db('0x1f')][_0x61db('0x20')]({'port':0x232c});var client9002=jayson['client'][_0x61db('0x20')]({'port':0x232a});function checkPasswordPattern(_0x1e7711,_0x3c1f36,_0x25b8cd){if(_0x25b8cd){var _0x3e8023=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3e8023[_0x61db('0x21')](_0x3c1f36)){return _0x1e7711;}else{throw new db[(_0x61db('0x22'))][(_0x61db('0x23'))](_0x61db('0x24'));}}else{return _0x1e7711;}}function respondWithRpcPromise(_0x70e8a,_0x3d37d9,_0x33d292,_0x57759d){return new BPromise(function(_0x17309a,_0x1b91da){var _0x4ad65e=_0x57759d||client;return _0x4ad65e[_0x61db('0x25')](_0x70e8a,_0x33d292)[_0x61db('0x26')](function(_0x4a0613){logger['info'](_0x61db('0x27'),_0x3d37d9,_0x61db('0x28'));logger['debug'](_0x61db('0x29'),_0x3d37d9,_0x61db('0x28'),JSON[_0x61db('0x2a')](_0x4a0613));if(_0x4a0613['error']){if(_0x4a0613[_0x61db('0x2b')][_0x61db('0x2c')]===0x1f4){logger[_0x61db('0x2b')](_0x61db('0x27'),_0x3d37d9,_0x4a0613[_0x61db('0x2b')][_0x61db('0x2d')]);return _0x1b91da(_0x4a0613['error'][_0x61db('0x2d')]);}logger[_0x61db('0x2b')](_0x61db('0x27'),_0x3d37d9,_0x4a0613[_0x61db('0x2b')]['message']);return _0x17309a(_0x4a0613[_0x61db('0x2b')]['message']);}else{logger[_0x61db('0x2e')]('FaxAccount,\x20%s,\x20%s',_0x3d37d9,'request\x20sent');_0x17309a(_0x4a0613['result']['message']);}})[_0x61db('0x2f')](function(_0x4d957c){logger[_0x61db('0x2b')]('FaxAccount,\x20%s,\x20%s',_0x3d37d9,_0x4d957c);_0x1b91da(_0x4d957c);});});}function respondWithStatusCode(_0x191b81,_0x56bb74){_0x56bb74=_0x56bb74||0xcc;return function(_0x12722b){if(_0x12722b){return _0x191b81[_0x61db('0x30')](_0x56bb74);}return _0x191b81[_0x61db('0x31')](_0x56bb74)['end']();};}function respondWithResult(_0x535053,_0x3bdd3b){_0x3bdd3b=_0x3bdd3b||0xc8;return function(_0x432fc6){if(_0x432fc6){return _0x535053['status'](_0x3bdd3b)[_0x61db('0x32')](_0x432fc6);}};}function respondWithFilteredResult(_0x2bf4b3,_0xd72500){return function(_0x485092){if(_0x485092){var _0x3a1af6=_0x485092[_0x61db('0x33')],_0x40dffe=_0xd72500[_0x61db('0x34')],_0x15c9a1=_0xd72500[_0x61db('0x34')]+_0xd72500[_0x61db('0x35')],_0x4cbd78;if(_0x15c9a1>=_0x3a1af6){_0x15c9a1=_0x3a1af6;_0x4cbd78=0xc8;}else{_0x4cbd78=0xce;}_0x2bf4b3[_0x61db('0x31')](_0x4cbd78);return _0x2bf4b3['set'](_0x61db('0x36'),_0x40dffe+'-'+_0x15c9a1+'/'+_0x3a1af6)[_0x61db('0x32')](_0x485092);}return null;};}function patchUpdates(_0x12a69b){return function(_0x5ba6e8){try{jsonpatch['apply'](_0x5ba6e8,_0x12a69b,!![]);}catch(_0x30dba8){return BPromise[_0x61db('0x37')](_0x30dba8);}return _0x5ba6e8[_0x61db('0x38')]();};}function saveUpdates(_0x46e26e,_0x15ad7c){return function(_0x15f825){if(_0x15f825){return _0x15f825[_0x61db('0x39')](_0x46e26e)[_0x61db('0x26')](function(_0x514398){return _0x514398;});}return null;};}function removeEntity(_0x1d620a,_0x1c1496){return function(_0x352d50){if(_0x352d50){return _0x352d50[_0x61db('0x3a')]()[_0x61db('0x26')](function(){var _0x5c71ed=_0x352d50[_0x61db('0x3b')]({'plain':!![]});var _0x2496c6='FaxAccounts';return db[_0x61db('0x3c')][_0x61db('0x3a')]({'where':{'type':_0x2496c6,'resourceId':_0x5c71ed['id']}})[_0x61db('0x26')](function(){return _0x352d50;});})['then'](function(){_0x1d620a[_0x61db('0x31')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e9a3a,_0x17e530){return function(_0x104a5a){if(!_0x104a5a){_0x2e9a3a[_0x61db('0x30')](0x194);}return _0x104a5a;};}function handleError(_0x348fa0,_0x50a509){_0x50a509=_0x50a509||0x1f4;return function(_0x25caae){logger[_0x61db('0x2b')](_0x25caae[_0x61db('0x3d')]);if(_0x25caae[_0x61db('0x3e')]){delete _0x25caae[_0x61db('0x3e')];}_0x348fa0['status'](_0x50a509)[_0x61db('0x3f')](_0x25caae);};}exports[_0x61db('0x40')]=function(_0x1dcc3e,_0x4907bf){var _0x2dceba={'include':[{'model':db[_0x61db('0x41')],'as':_0x61db('0x42')}]},_0x25ea94={},_0x1d66a6={'count':0x0,'rows':[]};var _0x231b70=_[_0x61db('0x43')](db[_0x61db('0x44')][_0x61db('0x45')],function(_0x4fb63f){return{'name':_0x4fb63f[_0x61db('0x46')],'type':_0x4fb63f[_0x61db('0x47')][_0x61db('0x48')]};});_0x25ea94[_0x61db('0x49')]=_[_0x61db('0x43')](_0x231b70,'name');_0x25ea94[_0x61db('0x4a')]=_[_0x61db('0x4b')](_0x1dcc3e[_0x61db('0x4a')]);_0x25ea94[_0x61db('0x4c')]=_[_0x61db('0x4d')](_0x25ea94[_0x61db('0x49')],_0x25ea94['query']);_0x2dceba[_0x61db('0x4e')]=_['intersection'](_0x25ea94['model'],qs[_0x61db('0x4f')](_0x1dcc3e[_0x61db('0x4a')][_0x61db('0x4f')]));_0x2dceba[_0x61db('0x4e')]=_0x2dceba[_0x61db('0x4e')][_0x61db('0x50')]?_0x2dceba['attributes']:_0x25ea94[_0x61db('0x49')];if(!_0x1dcc3e[_0x61db('0x4a')][_0x61db('0x51')]('nolimit')){_0x2dceba['limit']=qs[_0x61db('0x35')](_0x1dcc3e['query'][_0x61db('0x35')]);_0x2dceba[_0x61db('0x34')]=qs[_0x61db('0x34')](_0x1dcc3e[_0x61db('0x4a')][_0x61db('0x34')]);}_0x2dceba[_0x61db('0x52')]=qs[_0x61db('0x53')](_0x1dcc3e[_0x61db('0x4a')][_0x61db('0x53')]);_0x2dceba['where']=qs[_0x61db('0x4c')](_['pick'](_0x1dcc3e[_0x61db('0x4a')],_0x25ea94['filters']));if(_0x1dcc3e['query'][_0x61db('0x54')]){_0x2dceba[_0x61db('0x55')]=_[_0x61db('0x56')](_0x2dceba[_0x61db('0x55')],{'$or':_['map'](_0x231b70,function(_0x304699){if(_0x304699[_0x61db('0x47')]!==_0x61db('0x57')){var _0x114809={};_0x114809[_0x304699[_0x61db('0x3e')]]={'$like':'%'+_0x1dcc3e[_0x61db('0x4a')][_0x61db('0x54')]+'%'};return _0x114809;}})});}_0x2dceba=_[_0x61db('0x56')]({},_0x2dceba,_0x1dcc3e[_0x61db('0x58')]);var _0x2445c5={'where':_0x2dceba['where']};return db['FaxAccount'][_0x61db('0x33')](_0x2445c5)['then'](function(_0xe3787){_0x1d66a6['count']=_0xe3787;if(_0x1dcc3e['query'][_0x61db('0x59')]){_0x2dceba[_0x61db('0x5a')]=[{'all':!![]}];}return db[_0x61db('0x44')][_0x61db('0x5b')](_0x2dceba);})[_0x61db('0x26')](function(_0x5617e5){_0x1d66a6[_0x61db('0x5c')]=_0x5617e5;return _0x1d66a6;})['then'](respondWithFilteredResult(_0x4907bf,_0x2dceba))['catch'](handleError(_0x4907bf,null));};exports['show']=function(_0x102d8c,_0x18f0bc){var _0x490e1d={'raw':![],'where':{'id':_0x102d8c[_0x61db('0x5d')]['id']},'include':[{'model':db[_0x61db('0x41')],'as':_0x61db('0x42')}]},_0x4b5b77={};_0x4b5b77[_0x61db('0x49')]=_[_0x61db('0x4b')](db[_0x61db('0x44')]['rawAttributes']);_0x4b5b77[_0x61db('0x4a')]=_['keys'](_0x102d8c[_0x61db('0x4a')]);_0x4b5b77[_0x61db('0x4c')]=_[_0x61db('0x4d')](_0x4b5b77[_0x61db('0x49')],_0x4b5b77[_0x61db('0x4a')]);_0x490e1d[_0x61db('0x4e')]=_['intersection'](_0x4b5b77[_0x61db('0x49')],qs[_0x61db('0x4f')](_0x102d8c[_0x61db('0x4a')][_0x61db('0x4f')]));_0x490e1d[_0x61db('0x4e')]=_0x490e1d[_0x61db('0x4e')][_0x61db('0x50')]?_0x490e1d[_0x61db('0x4e')]:_0x4b5b77[_0x61db('0x49')];if(_0x102d8c[_0x61db('0x4a')][_0x61db('0x59')]){_0x490e1d[_0x61db('0x5a')]=[{'all':!![]}];}_0x490e1d=_[_0x61db('0x56')]({},_0x490e1d,_0x102d8c['options']);return db['FaxAccount']['find'](_0x490e1d)['then'](handleEntityNotFound(_0x18f0bc,null))[_0x61db('0x26')](respondWithResult(_0x18f0bc,null))[_0x61db('0x2f')](handleError(_0x18f0bc,null));};exports[_0x61db('0x5e')]=function(_0x2213d0,_0x51adb1){return db['FaxAccount'][_0x61db('0x5e')](_0x2213d0[_0x61db('0x5f')],{})[_0x61db('0x26')](function(_0x37a53c){var _0x34b1bf=_0x2213d0[_0x61db('0x60')][_0x61db('0x3b')]({'plain':!![]});if(!_0x34b1bf)throw new Error(_0x61db('0x61'));if(_0x34b1bf[_0x61db('0x62')]===_0x61db('0x60')){var _0x5e934d=_0x37a53c[_0x61db('0x3b')]({'plain':!![]});var _0x5a187c='FaxAccounts';return db[_0x61db('0x63')][_0x61db('0x64')]({'where':{'name':_0x5a187c,'userProfileId':_0x34b1bf['userProfileId']},'raw':!![]})['then'](function(_0x196236){if(_0x196236&&_0x196236[_0x61db('0x65')]===0x0){return db[_0x61db('0x3c')][_0x61db('0x5e')]({'name':_0x5e934d[_0x61db('0x3e')],'resourceId':_0x5e934d['id'],'type':_0x196236[_0x61db('0x3e')],'sectionId':_0x196236['id']},{})[_0x61db('0x26')](function(){return _0x37a53c;});}else{return _0x37a53c;}})[_0x61db('0x2f')](function(_0x2a8b9b){logger[_0x61db('0x2b')](_0x61db('0x66'),_0x2a8b9b);throw _0x2a8b9b;});}return _0x37a53c;})[_0x61db('0x26')](respondWithResult(_0x51adb1,0xc9))[_0x61db('0x2f')](handleError(_0x51adb1,null));};exports[_0x61db('0x39')]=function(_0x56354c,_0x3f47e1){if(_0x56354c['body']['id']){delete _0x56354c[_0x61db('0x5f')]['id'];}return db[_0x61db('0x44')][_0x61db('0x64')]({'where':{'id':_0x56354c['params']['id']},'include':[{'model':db['Pause'],'as':_0x61db('0x42')}]})[_0x61db('0x26')](handleEntityNotFound(_0x3f47e1,null))[_0x61db('0x26')](saveUpdates(_0x56354c[_0x61db('0x5f')],null))[_0x61db('0x26')](respondWithResult(_0x3f47e1,null))[_0x61db('0x2f')](handleError(_0x3f47e1,null));};exports[_0x61db('0x3a')]=function(_0x2f128c,_0x203ed5){return db[_0x61db('0x44')][_0x61db('0x64')]({'where':{'id':_0x2f128c['params']['id']}})[_0x61db('0x26')](handleEntityNotFound(_0x203ed5,null))[_0x61db('0x26')](removeEntity(_0x203ed5,null))['catch'](handleError(_0x203ed5,null));};exports[_0x61db('0x67')]=function(_0x1509e0,_0x31ee3c){return db[_0x61db('0x44')][_0x61db('0x67')]()[_0x61db('0x26')](respondWithResult(_0x31ee3c,null))['catch'](handleError(_0x31ee3c,null));};exports[_0x61db('0x68')]=function(_0x54eb9e,_0x5d11af,_0x5358e6){if(_0x54eb9e[_0x61db('0x5f')]['id']){delete _0x54eb9e[_0x61db('0x5f')]['id'];}return db[_0x61db('0x44')][_0x61db('0x64')]({'where':{'id':_0x54eb9e[_0x61db('0x5d')]['id']}})[_0x61db('0x26')](handleEntityNotFound(_0x5d11af,null))[_0x61db('0x26')](function(_0x2d94ec){if(_0x2d94ec){_0x54eb9e[_0x61db('0x5f')][_0x61db('0x69')]=_0x2d94ec['id'];return db['Disposition'][_0x61db('0x5e')](_0x54eb9e['body']);}})[_0x61db('0x26')](respondWithResult(_0x5d11af,null))['catch'](handleError(_0x5d11af,null));};exports[_0x61db('0x6a')]=function(_0x5f40d3,_0x1667a8,_0x212075){var _0x2eb8cd={'raw':![],'where':{}};var _0x4873c2={};var _0x371d5d={'count':0x0,'rows':[]};return db[_0x61db('0x44')][_0x61db('0x6b')]({'where':{'id':_0x5f40d3['params']['id']}})[_0x61db('0x26')](handleEntityNotFound(_0x1667a8,null))['then'](function(_0x143054){if(_0x143054){_0x4873c2[_0x61db('0x49')]=_[_0x61db('0x4b')](db[_0x61db('0x6c')][_0x61db('0x45')]);_0x4873c2[_0x61db('0x4a')]=_[_0x61db('0x4b')](_0x5f40d3[_0x61db('0x4a')]);_0x4873c2['filters']=_[_0x61db('0x4d')](_0x4873c2['model'],_0x4873c2[_0x61db('0x4a')]);_0x2eb8cd[_0x61db('0x4e')]=_['intersection'](_0x4873c2[_0x61db('0x49')],qs['fields'](_0x5f40d3['query']['fields']));_0x2eb8cd[_0x61db('0x4e')]=_0x2eb8cd['attributes'][_0x61db('0x50')]?_0x2eb8cd[_0x61db('0x4e')]:_0x4873c2['model'];if(!_0x5f40d3[_0x61db('0x4a')][_0x61db('0x51')](_0x61db('0x6d'))){_0x2eb8cd[_0x61db('0x35')]=qs[_0x61db('0x35')](_0x5f40d3['query']['limit']);_0x2eb8cd[_0x61db('0x34')]=qs['offset'](_0x5f40d3[_0x61db('0x4a')][_0x61db('0x34')]);}_0x2eb8cd[_0x61db('0x52')]=qs[_0x61db('0x53')](_0x5f40d3['query'][_0x61db('0x53')]);_0x2eb8cd[_0x61db('0x55')]=qs[_0x61db('0x4c')](_[_0x61db('0x6e')](_0x5f40d3[_0x61db('0x4a')],_0x4873c2[_0x61db('0x4c')]));_0x2eb8cd[_0x61db('0x55')][_0x61db('0x69')]=_0x143054['id'];if(_0x5f40d3[_0x61db('0x4a')][_0x61db('0x54')]){_0x2eb8cd['where']=_[_0x61db('0x56')](_0x2eb8cd[_0x61db('0x55')],{'$or':_[_0x61db('0x43')](_0x2eb8cd[_0x61db('0x4e')],function(_0x5976f9){var _0x4edc2e={};_0x4edc2e[_0x5976f9]={'$like':'%'+_0x5f40d3[_0x61db('0x4a')][_0x61db('0x54')]+'%'};return _0x4edc2e;})});}_0x2eb8cd=_[_0x61db('0x56')]({},_0x2eb8cd,_0x5f40d3[_0x61db('0x58')]);return db[_0x61db('0x6c')][_0x61db('0x33')]({'where':_0x2eb8cd['where']})[_0x61db('0x26')](function(_0x36ad70){_0x371d5d[_0x61db('0x33')]=_0x36ad70;if(_0x5f40d3[_0x61db('0x4a')][_0x61db('0x59')]){_0x2eb8cd[_0x61db('0x5a')]=[{'all':!![]}];}return db[_0x61db('0x6c')][_0x61db('0x5b')](_0x2eb8cd);})[_0x61db('0x26')](function(_0x3ea6e3){_0x371d5d[_0x61db('0x5c')]=_0x3ea6e3;return _0x371d5d;});}})[_0x61db('0x26')](respondWithFilteredResult(_0x1667a8,_0x2eb8cd))[_0x61db('0x2f')](handleError(_0x1667a8,null));};exports['removeDispositions']=function(_0x413b3f,_0x565d22,_0x2cd4ec){return db[_0x61db('0x44')][_0x61db('0x64')]({'where':{'id':_0x413b3f[_0x61db('0x5d')]['id']}})[_0x61db('0x26')](handleEntityNotFound(_0x565d22,null))[_0x61db('0x26')](function(_0x347c14){if(_0x347c14){return _0x347c14[_0x61db('0x6f')](_0x413b3f[_0x61db('0x4a')][_0x61db('0x70')]);}})[_0x61db('0x26')](respondWithStatusCode(_0x565d22,null))[_0x61db('0x2f')](handleError(_0x565d22,null));};exports['addAnswer']=function(_0x57ba6c,_0x3c4cfe,_0x2b3eed){if(_0x57ba6c['body']['id']){delete _0x57ba6c[_0x61db('0x5f')]['id'];}return db[_0x61db('0x44')][_0x61db('0x64')]({'where':{'id':_0x57ba6c[_0x61db('0x5d')]['id']}})['then'](handleEntityNotFound(_0x3c4cfe,null))[_0x61db('0x26')](function(_0x440d20){if(_0x440d20){_0x57ba6c[_0x61db('0x5f')]['FaxAccountId']=_0x440d20['id'];return db[_0x61db('0x71')][_0x61db('0x5e')](_0x57ba6c[_0x61db('0x5f')]);}})[_0x61db('0x26')](respondWithResult(_0x3c4cfe,null))[_0x61db('0x2f')](handleError(_0x3c4cfe,null));};exports[_0x61db('0x72')]=function(_0x52f8c3,_0x4eefaf,_0x152541){var _0x173857={'raw':![],'where':{}};var _0x20db52={};var _0x312462={'count':0x0,'rows':[]};return db[_0x61db('0x44')][_0x61db('0x6b')]({'where':{'id':_0x52f8c3[_0x61db('0x5d')]['id']}})[_0x61db('0x26')](handleEntityNotFound(_0x4eefaf,null))['then'](function(_0x96451c){if(_0x96451c){_0x20db52[_0x61db('0x49')]=_[_0x61db('0x4b')](db[_0x61db('0x71')]['rawAttributes']);_0x20db52[_0x61db('0x4a')]=_[_0x61db('0x4b')](_0x52f8c3[_0x61db('0x4a')]);_0x20db52[_0x61db('0x4c')]=_[_0x61db('0x4d')](_0x20db52[_0x61db('0x49')],_0x20db52[_0x61db('0x4a')]);_0x173857[_0x61db('0x4e')]=_[_0x61db('0x4d')](_0x20db52[_0x61db('0x49')],qs[_0x61db('0x4f')](_0x52f8c3['query'][_0x61db('0x4f')]));_0x173857[_0x61db('0x4e')]=_0x173857[_0x61db('0x4e')]['length']?_0x173857[_0x61db('0x4e')]:_0x20db52[_0x61db('0x49')];if(!_0x52f8c3[_0x61db('0x4a')]['hasOwnProperty'](_0x61db('0x6d'))){_0x173857[_0x61db('0x35')]=qs[_0x61db('0x35')](_0x52f8c3['query'][_0x61db('0x35')]);_0x173857[_0x61db('0x34')]=qs[_0x61db('0x34')](_0x52f8c3[_0x61db('0x4a')]['offset']);}_0x173857[_0x61db('0x52')]=qs[_0x61db('0x53')](_0x52f8c3[_0x61db('0x4a')][_0x61db('0x53')]);_0x173857[_0x61db('0x55')]=qs[_0x61db('0x4c')](_[_0x61db('0x6e')](_0x52f8c3[_0x61db('0x4a')],_0x20db52['filters']));_0x173857['where'][_0x61db('0x69')]=_0x96451c['id'];if(_0x52f8c3['query'][_0x61db('0x54')]){_0x173857[_0x61db('0x55')]=_[_0x61db('0x56')](_0x173857[_0x61db('0x55')],{'$or':_[_0x61db('0x43')](_0x173857[_0x61db('0x4e')],function(_0x11cb7b){var _0x458fbb={};_0x458fbb[_0x11cb7b]={'$like':'%'+_0x52f8c3['query'][_0x61db('0x54')]+'%'};return _0x458fbb;})});}_0x173857=_[_0x61db('0x56')]({},_0x173857,_0x52f8c3['options']);return db[_0x61db('0x71')][_0x61db('0x33')]({'where':_0x173857['where']})[_0x61db('0x26')](function(_0xa7f750){_0x312462[_0x61db('0x33')]=_0xa7f750;if(_0x52f8c3[_0x61db('0x4a')][_0x61db('0x59')]){_0x173857[_0x61db('0x5a')]=[{'all':!![]}];}return db[_0x61db('0x71')][_0x61db('0x5b')](_0x173857);})['then'](function(_0x434832){_0x312462['rows']=_0x434832;return _0x312462;});}})[_0x61db('0x26')](respondWithFilteredResult(_0x4eefaf,_0x173857))[_0x61db('0x2f')](handleError(_0x4eefaf,null));};exports[_0x61db('0x73')]=function(_0x4de530,_0x1af2af,_0x5fe930){return db[_0x61db('0x44')][_0x61db('0x64')]({'where':{'id':_0x4de530[_0x61db('0x5d')]['id']}})['then'](handleEntityNotFound(_0x1af2af,null))['then'](function(_0xd699d7){if(_0xd699d7){return _0xd699d7['removeAnswers'](_0x4de530[_0x61db('0x4a')]['ids']);}})[_0x61db('0x26')](respondWithStatusCode(_0x1af2af,null))[_0x61db('0x2f')](handleError(_0x1af2af,null));};exports['addInteraction']=function(_0x40ee60,_0x559103,_0x1ae996){return db[_0x61db('0x74')]['find']({'where':{'id':_0x40ee60['params']['id']}})[_0x61db('0x26')](handleEntityNotFound(_0x559103,null))['then'](function(_0x4ff1a5){if(_0x4ff1a5){return _0x4ff1a5[_0x61db('0x75')](_0x40ee60[_0x61db('0x5f')][_0x61db('0x70')],_[_0x61db('0x76')](_0x40ee60[_0x61db('0x5f')],['ids','id'])||{});}})['then'](respondWithResult(_0x559103,null))['catch'](handleError(_0x559103,null));};exports[_0x61db('0x77')]=function(_0x4b1a27,_0x5f5abf,_0x54639c){var _0x58e124={'raw':![],'where':{}};var _0x5ec052={};var _0x3f5324={'count':0x0,'rows':[]};return db['FaxAccount'][_0x61db('0x6b')]({'where':{'id':_0x4b1a27['params']['id']}})['then'](handleEntityNotFound(_0x5f5abf,null))[_0x61db('0x26')](function(_0x16424b){if(_0x16424b){_0x5ec052['model']=_[_0x61db('0x4b')](db[_0x61db('0x74')][_0x61db('0x45')]);_0x5ec052[_0x61db('0x4a')]=_[_0x61db('0x4b')](_0x4b1a27[_0x61db('0x4a')]);_0x5ec052[_0x61db('0x4c')]=_['intersection'](_0x5ec052['model'],_0x5ec052[_0x61db('0x4a')]);_0x58e124[_0x61db('0x4e')]=_['intersection'](_0x5ec052[_0x61db('0x49')],qs[_0x61db('0x4f')](_0x4b1a27['query'][_0x61db('0x4f')]));_0x58e124[_0x61db('0x4e')]=_0x58e124[_0x61db('0x4e')][_0x61db('0x50')]?_0x58e124[_0x61db('0x4e')]:_0x5ec052[_0x61db('0x49')];if(!_0x4b1a27[_0x61db('0x4a')]['hasOwnProperty'](_0x61db('0x6d'))){_0x58e124[_0x61db('0x35')]=qs[_0x61db('0x35')](_0x4b1a27[_0x61db('0x4a')][_0x61db('0x35')]);_0x58e124[_0x61db('0x34')]=qs[_0x61db('0x34')](_0x4b1a27[_0x61db('0x4a')][_0x61db('0x34')]);}_0x58e124['order']=qs['sort'](_0x4b1a27[_0x61db('0x4a')][_0x61db('0x53')]);_0x58e124[_0x61db('0x55')]=qs[_0x61db('0x4c')](_['pick'](_0x4b1a27['query'],_0x5ec052[_0x61db('0x4c')]));_0x58e124['where'][_0x61db('0x69')]=_0x16424b['id'];if(_0x4b1a27[_0x61db('0x4a')][_0x61db('0x54')]){_0x58e124['where']=_[_0x61db('0x56')](_0x58e124['where'],{'$or':_[_0x61db('0x43')](_0x58e124[_0x61db('0x4e')],function(_0x4d0004){var _0x3167c4={};_0x3167c4[_0x4d0004]={'$like':'%'+_0x4b1a27[_0x61db('0x4a')][_0x61db('0x54')]+'%'};return _0x3167c4;})});}_0x58e124=_[_0x61db('0x56')]({},_0x58e124,_0x4b1a27[_0x61db('0x58')]);return db[_0x61db('0x74')][_0x61db('0x33')]({'where':_0x58e124[_0x61db('0x55')]})[_0x61db('0x26')](function(_0x4a3898){_0x3f5324[_0x61db('0x33')]=_0x4a3898;if(_0x4b1a27['query'][_0x61db('0x59')]){_0x58e124[_0x61db('0x5a')]=[{'model':db[_0x61db('0x78')],'as':_0x61db('0x79'),'required':![]},{'model':db[_0x61db('0x7a')],'as':_0x61db('0x7b'),'attributes':[_0x61db('0x3e'),_0x61db('0x7c'),_0x61db('0x7d')],'required':![]},{'model':db['Tag'],'as':_0x61db('0x7e'),'attributes':['id',_0x61db('0x3e'),_0x61db('0x7f')],'where':_0x4b1a27[_0x61db('0x4a')][_0x61db('0x80')]?{'id':_0x4b1a27['query']['tag']}:undefined,'required':_0x4b1a27['query'][_0x61db('0x80')]?!![]:![]}];}return db[_0x61db('0x74')]['findAll'](_0x58e124);})[_0x61db('0x26')](function(_0x54bcbc){_0x3f5324[_0x61db('0x5c')]=_0x54bcbc;return _0x3f5324;});}})[_0x61db('0x26')](respondWithFilteredResult(_0x5f5abf,_0x58e124))[_0x61db('0x2f')](handleError(_0x5f5abf,null));};exports['addApplications']=function(_0x3d4620,_0x4a8e24,_0x36555b){return db['FaxAccount'][_0x61db('0x6b')]({'where':{'id':_0x3d4620[_0x61db('0x5d')]['id']}})[_0x61db('0x26')](handleEntityNotFound(_0x4a8e24,null))[_0x61db('0x26')](function(_0x2cf47e){if(_0x2cf47e){return db[_0x61db('0x81')]['transaction'](function(_0x2e32fd){return db[_0x61db('0x82')][_0x61db('0x3a')]({'where':{'FaxAccountId':_0x3d4620[_0x61db('0x5d')]['id']},'transaction':_0x2e32fd})[_0x61db('0x26')](function(_0x1378ff){var _0x3680c4=_[_0x61db('0x43')](_0x3d4620['body'],function(_0x157ddc){_0x157ddc['FaxAccountId']=_0x3d4620[_0x61db('0x5d')]['id'];return _0x157ddc;});return db['FaxApplication'][_0x61db('0x83')](_0x3680c4,{'transaction':_0x2e32fd});});})[_0x61db('0x26')](function(){return db[_0x61db('0x82')][_0x61db('0x84')]({'where':{'FaxAccountId':_0x3d4620[_0x61db('0x5d')]['id']},'order':_0x61db('0x85')});});}})['then'](respondWithResult(_0x4a8e24,null))['catch'](handleError(_0x4a8e24,null));};exports[_0x61db('0x86')]=function(_0x26641b,_0x237b61,_0x335762){var _0x5e2818={};var _0x235d91={};var _0x21f34d;var _0x17a8cf;return db[_0x61db('0x44')]['findOne']({'where':{'id':_0x26641b['params']['id']}})[_0x61db('0x26')](handleEntityNotFound(_0x237b61,null))['then'](function(_0x16e188){if(_0x16e188){_0x21f34d=_0x16e188;_0x235d91[_0x61db('0x49')]=_[_0x61db('0x4b')](db[_0x61db('0x82')][_0x61db('0x45')]);_0x235d91[_0x61db('0x4a')]=_[_0x61db('0x4b')](_0x26641b[_0x61db('0x4a')]);_0x235d91[_0x61db('0x4c')]=_[_0x61db('0x4d')](_0x235d91[_0x61db('0x49')],_0x235d91[_0x61db('0x4a')]);_0x5e2818[_0x61db('0x4e')]=_[_0x61db('0x4d')](_0x235d91[_0x61db('0x49')],qs['fields'](_0x26641b['query'][_0x61db('0x4f')]));_0x5e2818['attributes']=_0x5e2818[_0x61db('0x4e')][_0x61db('0x50')]?_0x5e2818[_0x61db('0x4e')]:_0x235d91[_0x61db('0x49')];_0x5e2818[_0x61db('0x52')]=qs['sort'](_0x26641b[_0x61db('0x4a')]['sort']);_0x5e2818['where']=qs[_0x61db('0x4c')](_['pick'](_0x26641b[_0x61db('0x4a')],_0x235d91[_0x61db('0x4c')]));if(_0x26641b[_0x61db('0x4a')][_0x61db('0x54')]){_0x5e2818[_0x61db('0x55')]=_[_0x61db('0x56')](_0x5e2818['where'],{'$or':_[_0x61db('0x43')](_0x5e2818[_0x61db('0x4e')],function(_0x190664){var _0x7d09b0={};_0x7d09b0[_0x190664]={'$like':'%'+_0x26641b[_0x61db('0x4a')]['filter']+'%'};return _0x7d09b0;})});}_0x5e2818=_[_0x61db('0x56')]({},_0x5e2818,_0x26641b['options']);return _0x21f34d[_0x61db('0x86')](_0x5e2818);}})[_0x61db('0x26')](function(_0x281250){if(_0x281250){_0x17a8cf=_0x281250['length'];if(!_0x26641b[_0x61db('0x4a')][_0x61db('0x51')](_0x61db('0x6d'))){_0x5e2818[_0x61db('0x35')]=qs[_0x61db('0x35')](_0x26641b[_0x61db('0x4a')][_0x61db('0x35')]);_0x5e2818[_0x61db('0x34')]=qs['offset'](_0x26641b[_0x61db('0x4a')][_0x61db('0x34')]);}return _0x21f34d['getApplications'](_0x5e2818);}})[_0x61db('0x26')](function(_0x898799){if(_0x898799){return _0x898799?{'count':_0x17a8cf,'rows':_0x898799}:null;}})['then'](respondWithResult(_0x237b61,null))[_0x61db('0x2f')](handleError(_0x237b61,null));};function Extension(_0x228638,_0x5508e2,_0x562c4a,_0x376a5a){this[_0x61db('0x87')]='from-voip-provider';this[_0x61db('0x88')]=_0x228638['localstationid'];this[_0x61db('0x89')]=_0x376a5a;this[_0x61db('0x47')]='system';this[_0x61db('0x8a')]=_0x61db('0x8b');this['FaxAccountId']=_0x228638['id'];this[_0x61db('0x85')]=_0x5508e2;this[_0x61db('0x8c')]=_0x562c4a;}function createExtensionsReciveFax(_0x4564d1){var _0x3cac2d=0x1;var _0x450ecf=[];_0x450ecf[_0x61db('0x8d')](new Extension(_0x4564d1,_0x3cac2d,'','Answer'));_0x3cac2d+=0x1;_0x450ecf[_0x61db('0x8d')](new Extension(_0x4564d1,_0x3cac2d,_0x61db('0x8e'),_0x61db('0x8f')));_0x3cac2d+=0x1;for(var _0x23346f in _0x4564d1){if(_0x4564d1['hasOwnProperty'](_0x23346f)&&(_0x23346f===_0x61db('0x90')||_0x23346f===_0x61db('0x91')||_0x23346f===_0x61db('0x92')||_0x23346f===_0x61db('0x93')||_0x23346f===_0x61db('0x94')||_0x23346f===_0x61db('0x95')||_0x23346f==='minrate'||_0x23346f===_0x61db('0x96')||_0x23346f===_0x61db('0x97'))){_0x450ecf[_0x61db('0x8d')](new Extension(_0x4564d1,_0x3cac2d,'FAXOPT('+_0x23346f+')='+_0x4564d1[_0x23346f],_0x61db('0x8f')));_0x3cac2d+=0x1;}}_0x450ecf['push'](new Extension(_0x4564d1,_0x3cac2d,'6','Wait'));_0x3cac2d+=0x1;_0x450ecf['push'](new Extension(_0x4564d1,_0x3cac2d,_0x61db('0x98'),'ReceiveFax'));_0x3cac2d=0x0;return _0x450ecf;}exports[_0x61db('0x99')]=function(_0x4b1e4f,_0x2ed20a,_0xfc6e57){var _0x3496ae;return db[_0x61db('0x81')][_0x61db('0x9a')](function(_0x3db538){return db[_0x61db('0x44')][_0x61db('0x5e')](_0x4b1e4f[_0x61db('0x5f')],{'transaction':_0x3db538})[_0x61db('0x26')](function(_0x393505){_0x3496ae=_0x393505[_0x61db('0x3b')]({'plain':!![]});return db[_0x61db('0x9b')][_0x61db('0x83')](createExtensionsReciveFax(_0x3496ae),{'transaction':_0x3db538});});})[_0x61db('0x26')](function(){return _0x3496ae;})['then'](respondWithResult(_0x2ed20a,null))['catch'](handleError(_0x2ed20a,null));};exports[_0x61db('0x9c')]=function(_0x46f920,_0x35994b,_0x312628){var _0x216244;return db[_0x61db('0x81')][_0x61db('0x9a')](function(_0x2a099c){return db[_0x61db('0x44')][_0x61db('0x39')](_0x46f920[_0x61db('0x5f')],{'where':{'id':_0x46f920[_0x61db('0x5f')]['id']},'transaction':_0x2a099c})[_0x61db('0x26')](function(_0x563b62){return db[_0x61db('0x9b')][_0x61db('0x3a')]({'where':{'FaxAccountId':_0x46f920['body']['id']},'transaction':_0x2a099c})[_0x61db('0x26')](function(_0x4eb0b8){return db[_0x61db('0x9b')][_0x61db('0x83')](createExtensionsReciveFax(_[_0x61db('0x76')](_0x46f920[_0x61db('0x5f')],[_0x61db('0x9d'),'key',_0x61db('0x9e'),_0x61db('0x9f'),_0x61db('0xa0'),'ListId'])),{'transaction':_0x2a099c});});});})[_0x61db('0x26')](function(){return db[_0x61db('0x44')][_0x61db('0xa1')](_0x46f920[_0x61db('0x5f')]['id']);})[_0x61db('0x26')](respondWithResult(_0x35994b,null))['catch'](handleError(_0x35994b,null));};exports['getMessages']=function(_0x18498a,_0x552860,_0x2a348f){var _0x571f49={'raw':!![],'where':{}};var _0x391360={};var _0x248483={'count':0x0,'rows':[]};return db['FaxAccount'][_0x61db('0x6b')]({'where':{'id':_0x18498a[_0x61db('0x5d')]['id']}})[_0x61db('0x26')](handleEntityNotFound(_0x552860,null))[_0x61db('0x26')](function(_0x122933){if(_0x122933){_0x391360[_0x61db('0x49')]=_[_0x61db('0x4b')](db['FaxMessage'][_0x61db('0x45')]);_0x391360[_0x61db('0x4a')]=_[_0x61db('0x4b')](_0x18498a['query']);_0x391360[_0x61db('0x4c')]=_[_0x61db('0x4d')](_0x391360[_0x61db('0x49')],_0x391360['query']);_0x571f49['attributes']=_[_0x61db('0x4d')](_0x391360[_0x61db('0x49')],qs[_0x61db('0x4f')](_0x18498a[_0x61db('0x4a')][_0x61db('0x4f')]));_0x571f49['attributes']=_0x571f49['attributes']['length']?_0x571f49[_0x61db('0x4e')]:_0x391360[_0x61db('0x49')];if(!_0x18498a['query'][_0x61db('0x51')](_0x61db('0x6d'))){_0x571f49['limit']=qs[_0x61db('0x35')](_0x18498a[_0x61db('0x4a')][_0x61db('0x35')]);_0x571f49[_0x61db('0x34')]=qs[_0x61db('0x34')](_0x18498a[_0x61db('0x4a')][_0x61db('0x34')]);}_0x571f49[_0x61db('0x52')]=qs[_0x61db('0x53')](_0x18498a['query'][_0x61db('0x53')]);_0x571f49[_0x61db('0x55')]=qs[_0x61db('0x4c')](_[_0x61db('0x6e')](_0x18498a['query'],_0x391360[_0x61db('0x4c')]));_0x571f49[_0x61db('0x55')]['FaxAccountId']=_0x122933['id'];if(_0x18498a[_0x61db('0x4a')][_0x61db('0x54')]){_0x571f49[_0x61db('0x55')]=_[_0x61db('0x56')](_0x571f49['where'],{'$or':_['map'](_0x571f49[_0x61db('0x4e')],function(_0x56429e){var _0x49daa3={};_0x49daa3[_0x56429e]={'$like':'%'+_0x18498a[_0x61db('0x4a')]['filter']+'%'};return _0x49daa3;})});}if(_0x18498a[_0x61db('0x4a')][_0x61db('0xa2')]){var _0x1d8863=_0x18498a[_0x61db('0x4a')]['$gte']['split'](',');var _0xe520d={};_0xe520d[_0x1d8863[0x0]]={'$gte':moment(_0x1d8863[0x1])[_0x61db('0xa3')](_0x61db('0xa4'))};_0x571f49['where']=_[_0x61db('0x56')](_0x571f49[_0x61db('0x55')],_0xe520d);}_0x571f49=_[_0x61db('0x56')]({},_0x571f49,_0x18498a[_0x61db('0x58')]);return db[_0x61db('0xa5')][_0x61db('0x33')]({'where':_0x571f49[_0x61db('0x55')]})[_0x61db('0x26')](function(_0x3cc564){_0x248483[_0x61db('0x33')]=_0x3cc564;if(_0x18498a[_0x61db('0x4a')][_0x61db('0x59')]){_0x571f49['include']=[{'all':!![]}];}return db[_0x61db('0xa5')][_0x61db('0x5b')](_0x571f49);})[_0x61db('0x26')](function(_0x36a714){_0x248483[_0x61db('0x5c')]=_0x36a714;return _0x248483;});}})[_0x61db('0x26')](respondWithFilteredResult(_0x552860,_0x571f49))[_0x61db('0x2f')](handleError(_0x552860,null));};exports['send']=function(_0xb31ff3,_0x4662ab,_0x450c57){var _0x2b5543,_0x336676={},_0x49487f;if(_0xb31ff3[_0x61db('0x5f')]['to']){_0x49487f=_0xb31ff3[_0x61db('0x5f')]['to'][0x0];}return db['FaxAccount'][_0x61db('0x64')]({'where':{'id':_0xb31ff3[_0x61db('0x5d')]['id']},'include':[{'model':db[_0x61db('0xa6')],'as':_0x61db('0xa7'),'include':[{'model':db[_0x61db('0x78')],'as':_0x61db('0xa8'),'where':{'fax':_0x49487f},'limit':0x1,'order':[[_0x61db('0x9f'),_0x61db('0xa9')]]}]}]})[_0x61db('0x26')](handleEntityNotFound(_0x4662ab,null))[_0x61db('0x26')](function(_0x558705){_0x2b5543=_0x558705;if(_0xb31ff3[_0x61db('0x5f')][_0x61db('0xaa')]&&_0xb31ff3[_0x61db('0x5f')][_0x61db('0xaa')][_0x61db('0x50')]){for(var _0x356d03=0x0;_0x356d03<_0xb31ff3[_0x61db('0x5f')][_0x61db('0xaa')][_0x61db('0x50')];_0x356d03+=0x1){_0xb31ff3['body'][_0x61db('0xaa')][_0x356d03]={'filename':_0xb31ff3[_0x61db('0x5f')][_0x61db('0xaa')][_0x356d03][_0x61db('0x3e')],'id':_0xb31ff3[_0x61db('0x5f')][_0x61db('0xaa')][_0x356d03]['id'],'path':path[_0x61db('0xab')](config[_0x61db('0xac')],_0x61db('0xad'),_0xb31ff3[_0x61db('0x5f')]['attachments'][_0x356d03][_0x61db('0xae')])};}}return respondWithRpcPromise(_0x61db('0xaf'),_0x61db('0xaf'),{'FaxAccountId':_[_0x61db('0xb0')](_0xb31ff3[_0x61db('0x5d')]['id'])?undefined:_0xb31ff3[_0x61db('0x5d')]['id'],'path':_['isNil'](_0xb31ff3[_0x61db('0x5f')][_0x61db('0xaa')][0x0]['path'])?undefined:_0xb31ff3[_0x61db('0x5f')][_0x61db('0xaa')][0x0][_0x61db('0x6')],'fax':_[_0x61db('0xb0')](_0xb31ff3[_0x61db('0x5f')]['to'][0x0])?undefined:_0xb31ff3['body']['to'][0x0]},client9002);})[_0x61db('0x26')](function(){if(_0x2b5543){if(_[_0x61db('0xb0')](_0xb31ff3[_0x61db('0x5f')][_0x61db('0xb1')])){_0xb31ff3['body'][_0x61db('0xb1')]=util['format']('\x22%s\x22\x20<%s>',_0x2b5543[_0x61db('0x3e')],_0x2b5543[_0x61db('0xb2')]);}if(_0x2b5543[_0x61db('0xa7')]){if(_0x2b5543['List'][_0x61db('0xa8')][_0x61db('0x50')]){return _0x2b5543['List'][_0x61db('0xa8')][0x0];}else{return db[_0x61db('0x78')][_0x61db('0x5e')](_[_0x61db('0x19')](_0xb31ff3[_0x61db('0x5f')],{'firstName':_0xb31ff3[_0x61db('0x5f')]['to'][0x0],'phone':_0xb31ff3[_0x61db('0x5f')]['to'][0x0],'fax':_0xb31ff3[_0x61db('0x5f')]['to'][0x0],'ListId':_0x2b5543[_0x61db('0xb3')]}));}}else{throw new Error(_0x61db('0xb4'));}}else{throw new Error(_0x61db('0xb5'));}})[_0x61db('0x26')](function(_0x23f0c2){if(_0x23f0c2){return db[_0x61db('0x74')][_0x61db('0x64')]({'where':{'ContactId':_0x23f0c2['id'],'closed':![],'FaxAccountId':_0x2b5543['id']}})[_0x61db('0x26')](function(_0xf5eef1){if(_0xf5eef1){return[_0xf5eef1,![]];}return db[_0x61db('0x74')][_0x61db('0x5e')]({'UserId':_0xb31ff3[_0x61db('0x60')]['id'],'ContactId':_0x23f0c2['id'],'FaxAccountId':_0x2b5543['id'],'fax':_0xb31ff3[_0x61db('0x5f')]['to'][0x0],'firstMsgDirection':'out','Messages':[_['merge'](_0xb31ff3[_0x61db('0x5f')],{'read':![],'body':_0xb31ff3[_0x61db('0x5f')][_0x61db('0xaa')][0x0]['filename'],'FaxAccountId':_0x2b5543['id'],'UserId':_0xb31ff3[_0x61db('0x60')]['id'],'ContactId':_0x23f0c2['id'],'AttachmentId':_0xb31ff3[_0x61db('0x5f')][_0x61db('0xaa')][0x0]['id']})]},{'include':[{'model':db[_0x61db('0xa5')],'as':_0x61db('0xb6')}]})[_0x61db('0x26')](function(_0x1eb505){return[_0x1eb505,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x61db('0xb7')](function(_0x2506d1,_0x5bec84){if(_0x5bec84){return _0x2506d1;}return db[_0x61db('0xa5')]['create']({'direction':_0x61db('0xb8'),'read':![],'body':_0xb31ff3[_0x61db('0x5f')]['attachments'][0x0][_0x61db('0xb9')],'FaxAccountId':_0x2b5543['id'],'FaxInteractionId':_0x2506d1['id'],'UserId':_0xb31ff3['user']['id'],'ContactId':_0x2506d1['ContactId'],'AttachmentId':_0xb31ff3['body'][_0x61db('0xaa')][0x0]['id']})[_0x61db('0x26')](function(_0x40f302){_0x2506d1[_0x61db('0xba')][_0x61db('0xb6')]=[];_0x2506d1['dataValues'][_0x61db('0xb6')][_0x61db('0x8d')](_0x40f302[_0x61db('0xba')]);return _0x2506d1;});})[_0x61db('0x26')](function(_0x517a92){respondWithRpcPromise('SendFax','SendFax',{'FaxAccountId':_[_0x61db('0xb0')](_0xb31ff3['params']['id'])?undefined:_0xb31ff3[_0x61db('0x5d')]['id'],'path':_[_0x61db('0xb0')](_0xb31ff3[_0x61db('0x5f')][_0x61db('0xaa')][0x0][_0x61db('0x6')])?undefined:_0xb31ff3[_0x61db('0x5f')]['attachments'][0x0]['path'],'fax':_[_0x61db('0xb0')](_0xb31ff3[_0x61db('0x5f')]['to'][0x0])?undefined:_0xb31ff3[_0x61db('0x5f')]['to'][0x0],'AttachmentId':_0xb31ff3[_0x61db('0x5f')][_0x61db('0xaa')][0x0]['id']},client9002)[_0x61db('0x26')](function(_0x5b67e9){logger[_0x61db('0x2e')](_0x61db('0xbb'),_0x5b67e9);})['catch'](function(_0x358b38){logger[_0x61db('0x2e')]('SendFaxRpc,\x20%s',_0x358b38);});return _0x517a92;})[_0x61db('0x26')](respondWithResult(_0x4662ab,null))[_0x61db('0x2f')](handleError(_0x4662ab,null));};exports[_0x61db('0xbc')]=function(_0x3e6c87,_0x5a24bc,_0x470354){return db[_0x61db('0x44')][_0x61db('0x64')]({'where':{'id':_0x3e6c87['params']['id']}})[_0x61db('0x26')](handleEntityNotFound(_0x5a24bc,null))[_0x61db('0x26')](function(_0x2d2228){if(_0x2d2228){return _0x2d2228[_0x61db('0xbc')](_0x3e6c87['body']['ids'],_['omit'](_0x3e6c87[_0x61db('0x5f')],[_0x61db('0x70'),'id'])||{})[_0x61db('0xb7')](function(_0x5b30a8){for(var _0x528896=0x0;_0x528896<_0x3e6c87['body']['ids'][_0x61db('0x50')];_0x528896+=0x1){socket[_0x61db('0xbd')](_0x61db('0xbe'),{'UserId':_0x3e6c87[_0x61db('0x5f')][_0x61db('0x70')][_0x528896],'FaxAccountId':_0x3e6c87[_0x61db('0x5d')]['id']});}return _0x5b30a8;});}})[_0x61db('0x26')](respondWithResult(_0x5a24bc,null))[_0x61db('0x2f')](handleError(_0x5a24bc,null));};exports[_0x61db('0xbf')]=function(_0x24c5b7,_0x135a01,_0x572d7c){return db[_0x61db('0x44')][_0x61db('0x64')]({'where':{'id':_0x24c5b7[_0x61db('0x5d')]['id']}})[_0x61db('0x26')](handleEntityNotFound(_0x135a01,null))[_0x61db('0x26')](function(_0x363925){if(_0x363925){return _0x363925['removeAgents'](_0x24c5b7[_0x61db('0x4a')][_0x61db('0x70')])[_0x61db('0x26')](function(){if(_[_0x61db('0xc0')](_0x24c5b7[_0x61db('0x4a')]['ids'])){for(var _0x9f45b2=0x0;_0x9f45b2<_0x24c5b7['query'][_0x61db('0x70')][_0x61db('0x50')];_0x9f45b2+=0x1){socket[_0x61db('0xbd')](_0x61db('0xc1'),{'UserId':Number(_0x24c5b7[_0x61db('0x4a')][_0x61db('0x70')][_0x9f45b2]),'FaxAccountId':Number(_0x24c5b7[_0x61db('0x5d')]['id'])});}}else{socket[_0x61db('0xbd')]('userFaxAccount:remove',{'UserId':Number(_0x24c5b7[_0x61db('0x4a')]['ids']),'FaxAccountId':Number(_0x24c5b7[_0x61db('0x5d')]['id'])});}});}})[_0x61db('0x26')](respondWithStatusCode(_0x135a01,null))[_0x61db('0x2f')](handleError(_0x135a01,null));};exports['getAgents']=function(_0x492569,_0x4f18d9,_0x15c6c0){var _0x5ed870={};var _0x12aa50={};var _0x1be461;var _0x239438;return db[_0x61db('0x44')][_0x61db('0x6b')]({'where':{'id':_0x492569[_0x61db('0x5d')]['id']}})[_0x61db('0x26')](handleEntityNotFound(_0x4f18d9,null))[_0x61db('0x26')](function(_0x22f6cd){if(_0x22f6cd){_0x1be461=_0x22f6cd;_0x12aa50[_0x61db('0x49')]=_[_0x61db('0x4b')](db[_0x61db('0x7a')][_0x61db('0x45')]);_0x12aa50[_0x61db('0x4a')]=_[_0x61db('0x4b')](_0x492569['query']);_0x12aa50['filters']=_[_0x61db('0x4d')](_0x12aa50[_0x61db('0x49')],_0x12aa50[_0x61db('0x4a')]);_0x5ed870[_0x61db('0x4e')]=_['intersection'](_0x12aa50['model'],qs[_0x61db('0x4f')](_0x492569[_0x61db('0x4a')][_0x61db('0x4f')]));_0x5ed870['attributes']=_0x5ed870[_0x61db('0x4e')]['length']?_0x5ed870[_0x61db('0x4e')]:_0x12aa50['model'];_0x5ed870[_0x61db('0x52')]=qs[_0x61db('0x53')](_0x492569[_0x61db('0x4a')][_0x61db('0x53')]);_0x5ed870['where']=qs[_0x61db('0x4c')](_[_0x61db('0x6e')](_0x492569[_0x61db('0x4a')],_0x12aa50[_0x61db('0x4c')]));if(_0x492569[_0x61db('0x4a')][_0x61db('0x54')]){_0x5ed870['where']=_['merge'](_0x5ed870[_0x61db('0x55')],{'$or':_['map'](_0x5ed870[_0x61db('0x4e')],function(_0x46ce67){var _0x58c405={};_0x58c405[_0x46ce67]={'$like':'%'+_0x492569['query'][_0x61db('0x54')]+'%'};return _0x58c405;})});}_0x5ed870=_[_0x61db('0x56')]({},_0x5ed870,_0x492569[_0x61db('0x58')]);return _0x1be461['getAgents'](_0x5ed870);}})[_0x61db('0x26')](function(_0x10d9df){if(_0x10d9df){_0x239438=_0x10d9df[_0x61db('0x50')];if(!_0x492569[_0x61db('0x4a')]['hasOwnProperty'](_0x61db('0x6d'))){_0x5ed870['limit']=qs[_0x61db('0x35')](_0x492569[_0x61db('0x4a')][_0x61db('0x35')]);_0x5ed870[_0x61db('0x34')]=qs['offset'](_0x492569['query'][_0x61db('0x34')]);}return _0x1be461[_0x61db('0xc2')](_0x5ed870);}})['then'](function(_0x1c6378){if(_0x1c6378){return _0x1c6378?{'count':_0x239438,'rows':_0x1c6378}:null;}})[_0x61db('0x26')](respondWithResult(_0x4f18d9,null))[_0x61db('0x2f')](handleError(_0x4f18d9,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index b42ee6e..ad560c4 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 _0x4587=['../../mysqldb','setMaxListeners','save','remove','emit','hook','exports'];(function(_0x356127,_0x4873ac){var _0x5d4c75=function(_0x4fe60c){while(--_0x4fe60c){_0x356127['push'](_0x356127['shift']());}};_0x5d4c75(++_0x4873ac);}(_0x4587,0xd2));var _0x7458=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4587[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0x7458('0x0'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x7458('0x1')](0x0);var events={'afterCreate':_0x7458('0x2'),'afterUpdate':'update','afterDestroy':_0x7458('0x3')};function emitEvent(_0x34bfa){return function(_0x51c919,_0x213324,_0x220fc1){FaxAccountEvents[_0x7458('0x4')](_0x34bfa+':'+_0x51c919['id'],_0x51c919);FaxAccountEvents[_0x7458('0x4')](_0x34bfa,_0x51c919);_0x220fc1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount[_0x7458('0x5')](e,emitEvent(event));}}module[_0x7458('0x6')]=FaxAccountEvents; \ No newline at end of file +var _0xc044=['hasOwnProperty','hook','events','FaxAccount','save','update','remove','emit'];(function(_0x1da46b,_0x109ac4){var _0x3a94ef=function(_0x31a2b4){while(--_0x31a2b4){_0x1da46b['push'](_0x1da46b['shift']());}};_0x3a94ef(++_0x109ac4);}(_0xc044,0x172));var _0x4c04=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xc044[_0xa1e3e3];return _0xc980e9;};'use strict';var EventEmitter=require(_0x4c04('0x0'));var FaxAccount=require('../../mysqldb')['db'][_0x4c04('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4c04('0x2'),'afterUpdate':_0x4c04('0x3'),'afterDestroy':_0x4c04('0x4')};function emitEvent(_0x460779){return function(_0x488646,_0x3c59ca,_0x495992){FaxAccountEvents[_0x4c04('0x5')](_0x460779+':'+_0x488646['id'],_0x488646);FaxAccountEvents[_0x4c04('0x5')](_0x460779,_0x488646);_0x495992(null);};}for(var e in events){if(events[_0x4c04('0x6')](e)){var event=events[e];FaxAccount[_0x4c04('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 6e28277..e4f2a71 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 _0x0ebe=['../../config/environment','exports','fax_accounts','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x10ffc1,_0x4c35b3){var _0x569df6=function(_0x428bf3){while(--_0x428bf3){_0x10ffc1['push'](_0x10ffc1['shift']());}};_0x569df6(++_0x4c35b3);}(_0x0ebe,0x19d));var _0xe0eb=function(_0x3782a2,_0x58d5d7){_0x3782a2=_0x3782a2-0x0;var _0x45950=_0x0ebe[_0x3782a2];return _0x45950;};'use strict';var _=require('lodash');var util=require(_0xe0eb('0x0'));var logger=require(_0xe0eb('0x1'))(_0xe0eb('0x2'));var moment=require('moment');var BPromise=require(_0xe0eb('0x3'));var rp=require(_0xe0eb('0x4'));var fs=require('fs');var path=require(_0xe0eb('0x5'));var rimraf=require(_0xe0eb('0x6'));var config=require(_0xe0eb('0x7'));var attributes=require('./faxAccount.attributes');module[_0xe0eb('0x8')]=function(_0xf62bdf,_0x490652){return _0xf62bdf['define']('FaxAccount',attributes,{'tableName':_0xe0eb('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbf01=['../../config/environment','./faxAccount.attributes','exports','define','FaxAccount','fax_accounts','util','api','moment','request-promise','path','rimraf'];(function(_0x5bdcce,_0x2db971){var _0x51d1f6=function(_0x3de84e){while(--_0x3de84e){_0x5bdcce['push'](_0x5bdcce['shift']());}};_0x51d1f6(++_0x2db971);}(_0xbf01,0x1aa));var _0x1bf0=function(_0x59c301,_0x359c50){_0x59c301=_0x59c301-0x0;var _0x3866b9=_0xbf01[_0x59c301];return _0x3866b9;};'use strict';var _=require('lodash');var util=require(_0x1bf0('0x0'));var logger=require('../../config/logger')(_0x1bf0('0x1'));var moment=require(_0x1bf0('0x2'));var BPromise=require('bluebird');var rp=require(_0x1bf0('0x3'));var fs=require('fs');var path=require(_0x1bf0('0x4'));var rimraf=require(_0x1bf0('0x5'));var config=require(_0x1bf0('0x6'));var attributes=require(_0x1bf0('0x7'));module[_0x1bf0('0x8')]=function(_0x1ec3ac,_0x504481){return _0x1ec3ac[_0x1bf0('0x9')](_0x1bf0('0xa'),attributes,{'tableName':_0x1bf0('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 f6a5b33..d23e49f 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 _0x15ca=['*,*,*,*','created','interaction','FaxMessage','AttachmentId','UserId','User','name','agent','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetFaxAccount','FaxAccount','findAll','options','where','attributes','limit','include','map','model','NotifyFaxAccount','fax','CmContact','describe','Sequelize','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','ListId','body','isNil','from','ValidationError','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','account','CmList','Contacts','DESC','FaxApplication','List','get','applications','priority','Applications','length','create','contact','find','FaxInteraction','spread','autoclose','push','close'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x15ca,0xbe));var _0xa15c=function(_0x556475,_0x4ffada){_0x556475=_0x556475-0x0;var _0x278e4f=_0x15ca[_0x556475];return _0x278e4f;};'use strict';var _=require(_0xa15c('0x0'));var util=require(_0xa15c('0x1'));var moment=require(_0xa15c('0x2'));var BPromise=require(_0xa15c('0x3'));var rs=require(_0xa15c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa15c('0x5'))['db'];var utils=require(_0xa15c('0x6'));var logger=require(_0xa15c('0x7'))('rpc');var config=require(_0xa15c('0x8'));var jayson=require(_0xa15c('0x9'));var client=jayson[_0xa15c('0xa')][_0xa15c('0xb')]({'port':0x232c});config[_0xa15c('0xc')]=_[_0xa15c('0xd')](config[_0xa15c('0xc')],{'host':_0xa15c('0xe'),'port':0x18eb});var socket=require(_0xa15c('0xf'))(new Redis(config['redis']));require('./faxAccount.socket')['register'](socket);function respondWithRpcPromise(_0x509855,_0x319cca,_0x16b56f){return new BPromise(function(_0x57661c,_0x3f7c24){return client[_0xa15c('0x10')](_0x509855,_0x16b56f)[_0xa15c('0x11')](function(_0x284f9e){logger[_0xa15c('0x12')](_0xa15c('0x13'),_0x319cca,_0xa15c('0x14'));logger[_0xa15c('0x15')](_0xa15c('0x16'),_0x319cca,_0xa15c('0x14'),JSON[_0xa15c('0x17')](_0x284f9e));if(_0x284f9e['error']){if(_0x284f9e[_0xa15c('0x18')][_0xa15c('0x19')]===0x1f4){logger[_0xa15c('0x18')](_0xa15c('0x13'),_0x319cca,_0x284f9e[_0xa15c('0x18')][_0xa15c('0x1a')]);return _0x3f7c24(_0x284f9e['error'][_0xa15c('0x1a')]);}logger[_0xa15c('0x18')](_0xa15c('0x13'),_0x319cca,_0x284f9e['error']['message']);return _0x57661c(_0x284f9e[_0xa15c('0x18')][_0xa15c('0x1a')]);}else{logger['info']('FaxAccount,\x20%s,\x20%s',_0x319cca,_0xa15c('0x14'));_0x57661c(_0x284f9e[_0xa15c('0x1b')][_0xa15c('0x1a')]);}})['catch'](function(_0x1e2fc1){logger[_0xa15c('0x18')](_0xa15c('0x13'),_0x319cca,_0x1e2fc1);_0x3f7c24(_0x1e2fc1);});});}exports[_0xa15c('0x1c')]=function(_0x28d41f){var _0x474995=this;return new Promise(function(_0x4678f6,_0x521f3b){return db[_0xa15c('0x1d')][_0xa15c('0x1e')]({'raw':_0x28d41f[_0xa15c('0x1f')]?_0x28d41f[_0xa15c('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x28d41f[_0xa15c('0x1f')]?_0x28d41f[_0xa15c('0x1f')][_0xa15c('0x20')]||null:null,'attributes':_0x28d41f['options']?_0x28d41f[_0xa15c('0x1f')][_0xa15c('0x21')]||null:null,'limit':_0x28d41f[_0xa15c('0x1f')]?_0x28d41f[_0xa15c('0x1f')][_0xa15c('0x22')]||null:null,'include':_0x28d41f[_0xa15c('0x1f')]?_0x28d41f[_0xa15c('0x1f')]['include']?_['map'](_0x28d41f['options'][_0xa15c('0x23')],function(_0x3bff89){return{'model':db[_0x3bff89['model']],'as':_0x3bff89['as'],'attributes':_0x3bff89[_0xa15c('0x21')],'include':_0x3bff89['include']?_[_0xa15c('0x24')](_0x3bff89[_0xa15c('0x23')],function(_0x285883){return{'model':db[_0x285883[_0xa15c('0x25')]],'as':_0x285883['as'],'attributes':_0x285883['attributes'],'include':_0x285883[_0xa15c('0x23')]?_['map'](_0x285883[_0xa15c('0x23')],function(_0x127a29){return{'model':db[_0x127a29[_0xa15c('0x25')]],'as':_0x127a29['as'],'attributes':_0x127a29['attributes']};}):[]};}):[]};}):[]:[]})[_0xa15c('0x11')](function(_0x175974){logger['info'](_0xa15c('0x1c'),_0x28d41f);logger['debug'](_0xa15c('0x1c'),_0x28d41f,JSON[_0xa15c('0x17')](_0x175974));_0x4678f6(_0x175974);})['catch'](function(_0x43c192){logger[_0xa15c('0x18')](_0xa15c('0x1c'),_0x43c192['message'],_0x28d41f);_0x521f3b(_0x474995[_0xa15c('0x18')](0x1f4,_0x43c192[_0xa15c('0x1a')]));});});};exports[_0xa15c('0x26')]=function(_0x23ac85,_0xb6e12f,_0x191516){var _0x3a2247=this;return new Promise(function(_0xd19bd,_0xf9c396){var _0x46b719={'body':_0x23ac85['body'],'channel':_0xa15c('0x27')};var _0x320ba6=[];var _0x24a47a=[];var _0x440702={};return db[_0xa15c('0x28')][_0xa15c('0x29')]()[_0xa15c('0x11')](function(_0x22e6c6){if(!_0x22e6c6){throw new db[(_0xa15c('0x2a'))]['ValidationError'](_0xa15c('0x2b'));}_0x320ba6=_[_0xa15c('0x2c')](_[_0xa15c('0x2d')](_0x22e6c6),[_0xa15c('0x2e'),_0xa15c('0x2f')]);_0x24a47a=_['difference'](_['keys'](_0x22e6c6),[_0xa15c('0x2e'),_0xa15c('0x2f'),'CompanyId',_0xa15c('0x30')]);if(_0x23ac85[_0xa15c('0x31')]['id']){delete _0x23ac85[_0xa15c('0x31')]['id'];}if(_[_0xa15c('0x32')](_0x23ac85[_0xa15c('0x31')][_0xa15c('0x33')])){throw new db[(_0xa15c('0x2a'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0xa15c('0x32')](_0x23ac85[_0xa15c('0x31')][_0xa15c('0x31')])||_0x23ac85[_0xa15c('0x31')][_0xa15c('0x31')]===''){throw new db[(_0xa15c('0x2a'))][(_0xa15c('0x34'))](_0xa15c('0x35'));}if(_[_0xa15c('0x32')](_0x23ac85['body'][_0xa15c('0x36')])){throw new db[(_0xa15c('0x2a'))][(_0xa15c('0x34'))](_0xa15c('0x37')+_0x24a47a);}if(!_[_0xa15c('0x38')](_0x24a47a,_0x23ac85[_0xa15c('0x31')]['mapKey'])){throw new db[(_0xa15c('0x2a'))][(_0xa15c('0x34'))](_0xa15c('0x39')+_0x24a47a);}_0x440702[_0x23ac85[_0xa15c('0x31')][_0xa15c('0x36')]]=_0x23ac85[_0xa15c('0x31')][_0xa15c('0x33')];})[_0xa15c('0x11')](function(){return db[_0xa15c('0x1d')]['find']({'where':{'id':_0x23ac85[_0xa15c('0x3a')]['id']},'include':[{'model':db[_0xa15c('0x3b')],'as':'List','include':[{'model':db['CmContact'],'as':_0xa15c('0x3c'),'where':_0x440702,'limit':0x1,'order':[[_0xa15c('0x2f'),_0xa15c('0x3d')]]}]},{'model':db[_0xa15c('0x3e')],'as':'Applications'}]});})[_0xa15c('0x11')](function(_0xc8d469){if(_0xc8d469&&_0xc8d469[_0xa15c('0x3f')]){var _0x6e7ae3=_0xc8d469[_0xa15c('0x40')]({'plain':!![]});_0x46b719[_0xa15c('0x3a')]=_0x6e7ae3;_0x46b719[_0xa15c('0x41')]=_0x6e7ae3['Applications'];_0x46b719['list']=_0x6e7ae3[_0xa15c('0x3f')];_0x46b719[_0xa15c('0x41')]=_['orderBy'](_0x46b719[_0xa15c('0x41')],[_0xa15c('0x42')],['asc']);if(_0x46b719[_0xa15c('0x3a')][_0xa15c('0x43')]){delete _0x46b719[_0xa15c('0x3a')][_0xa15c('0x43')];}if(_0x46b719['account'][_0xa15c('0x3f')]&&_0x46b719['account'][_0xa15c('0x3f')]['Contacts'][_0xa15c('0x44')]){return _0x46b719['account']['List'][_0xa15c('0x3c')][0x0];}var _0x17eb59=_[_0xa15c('0xd')](_0x23ac85[_0xa15c('0x31')],{'firstName':_0x23ac85[_0xa15c('0x31')][_0xa15c('0x33')],'ListId':_0x6e7ae3['ListId']});_0x17eb59[_0x23ac85[_0xa15c('0x31')][_0xa15c('0x36')]]=_0x23ac85[_0xa15c('0x31')][_0xa15c('0x33')];return db[_0xa15c('0x28')][_0xa15c('0x45')](_0x17eb59,{'fields':_0x320ba6,'raw':!![]});}})['then'](function(_0x45254b){_0x46b719[_0xa15c('0x46')]=_0x45254b;if(_0x45254b){var _0x3868b6={'ContactId':_0x45254b['id'],'FaxAccountId':_0x23ac85['account']['id'],'fax':_0x45254b[_0xa15c('0x27')]};return db['FaxInteraction'][_0xa15c('0x47')]({'where':{'ContactId':_0x45254b['id'],'closed':![],'FaxAccountId':_0x23ac85[_0xa15c('0x3a')]['id']}})[_0xa15c('0x11')](function(_0x136d00){if(_0x136d00){return[_0x136d00,![]];}return db[_0xa15c('0x48')][_0xa15c('0x45')](_0x3868b6)[_0xa15c('0x11')](function(_0x126c8a){return[_0x126c8a,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xa15c('0x49')](function(_0x1dbe6d,_0x3916c5){var _0x4bd039=_0x1dbe6d[_0xa15c('0x40')]({'plain':!![]});if(_0x3916c5){if(_0x46b719[_0xa15c('0x3a')][_0xa15c('0x4a')]){_0x46b719[_0xa15c('0x41')][_0xa15c('0x4b')]({'id':0x0,'priority':_0x46b719['applications'][_0xa15c('0x44')]+0x1,'app':_0xa15c('0x4c'),'appdata':'unmanaged','interval':_0xa15c('0x4d')});}_0x4bd039[_0xa15c('0x4e')]=!![];}else{_0x4bd039[_0xa15c('0x4e')]=![];}_0x46b719[_0xa15c('0x4f')]=_0x4bd039;return db[_0xa15c('0x50')][_0xa15c('0x45')]({'body':_0x23ac85[_0xa15c('0x31')]['body'],'FaxAccountId':_0x23ac85[_0xa15c('0x3a')]['id'],'FaxInteractionId':_0x1dbe6d['id'],'direction':'in','ContactId':_0x1dbe6d['ContactId'],'AttachmentId':_0x23ac85[_0xa15c('0x31')][_0xa15c('0x51')]});})[_0xa15c('0x11')](function(_0x9c5318){_0x46b719['message']=_0x9c5318;if(_0x46b719[_0xa15c('0x4f')][_0xa15c('0x52')]){return db[_0xa15c('0x53')][_0xa15c('0x47')]({'attributes':['id',_0xa15c('0x54')],'where':{'id':_0x46b719[_0xa15c('0x4f')][_0xa15c('0x52')]}})[_0xa15c('0x11')](function(_0x28509f){if(_0x28509f){_0x46b719[_0xa15c('0x41')]['unshift']({'id':0x0,'priority':0x0,'app':_0xa15c('0x55'),'appdata':_0x28509f[_0xa15c('0x54')]+','+(_0x46b719[_0xa15c('0x3a')][_0xa15c('0x56')]||0xa),'interval':_0xa15c('0x4d')});}return respondWithRpcPromise(_0xa15c('0x57'),_0xa15c('0x58'),_0x46b719);});}return respondWithRpcPromise(_0xa15c('0x57'),_0xa15c('0x58'),_0x46b719);})[_0xa15c('0x11')](function(_0x58515a){_0xd19bd(_0x58515a);})['catch'](function(_0x358589){_0xf9c396(_0x3a2247['error'](0x1f4,_0x358589['message']));});});}; \ No newline at end of file +var _0x4bf8=['client','http','redis','localhost','register','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetFaxAccount','findAll','options','where','attributes','limit','include','map','model','stringify','NotifyFaxAccount','body','fax','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','ListId','body\x20is\x20mandatory\x20and\x20not\x20empty','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','FaxAccount','find','account','CmList','List','DESC','Applications','get','applications','orderBy','Contacts','length','defaults','contact','FaxInteraction','create','Contact\x20not\x20found','spread','autoclose','push','close','unmanaged','*,*,*,*','created','UserId','name','unshift','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment'];(function(_0x704d5d,_0x318e6d){var _0x98649f=function(_0x5ba870){while(--_0x5ba870){_0x704d5d['push'](_0x704d5d['shift']());}};_0x98649f(++_0x318e6d);}(_0x4bf8,0xa5));var _0x84bf=function(_0x312282,_0x1fb0e4){_0x312282=_0x312282-0x0;var _0x584bea=_0x4bf8[_0x312282];return _0x584bea;};'use strict';var _=require(_0x84bf('0x0'));var util=require(_0x84bf('0x1'));var moment=require(_0x84bf('0x2'));var BPromise=require(_0x84bf('0x3'));var rs=require(_0x84bf('0x4'));var fs=require('fs');var Redis=require(_0x84bf('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x84bf('0x6'));var logger=require(_0x84bf('0x7'))('rpc');var config=require(_0x84bf('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x84bf('0x9')][_0x84bf('0xa')]({'port':0x232c});config[_0x84bf('0xb')]=_['defaults'](config['redis'],{'host':_0x84bf('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x84bf('0xb')]));require('./faxAccount.socket')[_0x84bf('0xd')](socket);function respondWithRpcPromise(_0x29526a,_0x226ab4,_0x577e24){return new BPromise(function(_0x17aa3b,_0x293325){return client[_0x84bf('0xe')](_0x29526a,_0x577e24)[_0x84bf('0xf')](function(_0x1ec6e0){logger[_0x84bf('0x10')](_0x84bf('0x11'),_0x226ab4,_0x84bf('0x12'));logger[_0x84bf('0x13')](_0x84bf('0x14'),_0x226ab4,_0x84bf('0x12'),JSON['stringify'](_0x1ec6e0));if(_0x1ec6e0['error']){if(_0x1ec6e0[_0x84bf('0x15')][_0x84bf('0x16')]===0x1f4){logger[_0x84bf('0x15')](_0x84bf('0x11'),_0x226ab4,_0x1ec6e0[_0x84bf('0x15')][_0x84bf('0x17')]);return _0x293325(_0x1ec6e0[_0x84bf('0x15')][_0x84bf('0x17')]);}logger[_0x84bf('0x15')]('FaxAccount,\x20%s,\x20%s',_0x226ab4,_0x1ec6e0[_0x84bf('0x15')][_0x84bf('0x17')]);return _0x17aa3b(_0x1ec6e0['error']['message']);}else{logger[_0x84bf('0x10')](_0x84bf('0x11'),_0x226ab4,'request\x20sent');_0x17aa3b(_0x1ec6e0[_0x84bf('0x18')][_0x84bf('0x17')]);}})[_0x84bf('0x19')](function(_0x6c84c0){logger[_0x84bf('0x15')](_0x84bf('0x11'),_0x226ab4,_0x6c84c0);_0x293325(_0x6c84c0);});});}exports[_0x84bf('0x1a')]=function(_0x9aab2b){var _0x235b6b=this;return new Promise(function(_0x44385b,_0x393a77){return db['FaxAccount'][_0x84bf('0x1b')]({'raw':_0x9aab2b[_0x84bf('0x1c')]?_0x9aab2b[_0x84bf('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x9aab2b[_0x84bf('0x1c')]?_0x9aab2b[_0x84bf('0x1c')][_0x84bf('0x1d')]||null:null,'attributes':_0x9aab2b[_0x84bf('0x1c')]?_0x9aab2b['options'][_0x84bf('0x1e')]||null:null,'limit':_0x9aab2b[_0x84bf('0x1c')]?_0x9aab2b[_0x84bf('0x1c')][_0x84bf('0x1f')]||null:null,'include':_0x9aab2b['options']?_0x9aab2b[_0x84bf('0x1c')][_0x84bf('0x20')]?_[_0x84bf('0x21')](_0x9aab2b[_0x84bf('0x1c')][_0x84bf('0x20')],function(_0x366adb){return{'model':db[_0x366adb[_0x84bf('0x22')]],'as':_0x366adb['as'],'attributes':_0x366adb[_0x84bf('0x1e')],'include':_0x366adb[_0x84bf('0x20')]?_[_0x84bf('0x21')](_0x366adb[_0x84bf('0x20')],function(_0x4849ba){return{'model':db[_0x4849ba[_0x84bf('0x22')]],'as':_0x4849ba['as'],'attributes':_0x4849ba[_0x84bf('0x1e')],'include':_0x4849ba[_0x84bf('0x20')]?_['map'](_0x4849ba[_0x84bf('0x20')],function(_0x40934c){return{'model':db[_0x40934c[_0x84bf('0x22')]],'as':_0x40934c['as'],'attributes':_0x40934c[_0x84bf('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x84bf('0xf')](function(_0x4ac2c9){logger[_0x84bf('0x10')]('GetFaxAccount',_0x9aab2b);logger[_0x84bf('0x13')](_0x84bf('0x1a'),_0x9aab2b,JSON[_0x84bf('0x23')](_0x4ac2c9));_0x44385b(_0x4ac2c9);})['catch'](function(_0x1189f6){logger[_0x84bf('0x15')](_0x84bf('0x1a'),_0x1189f6[_0x84bf('0x17')],_0x9aab2b);_0x393a77(_0x235b6b['error'](0x1f4,_0x1189f6[_0x84bf('0x17')]));});});};exports[_0x84bf('0x24')]=function(_0x24c772,_0x146a08,_0x27cbb7){var _0x2d5717=this;return new Promise(function(_0x37e681,_0x599e0c){var _0x38e191={'body':_0x24c772[_0x84bf('0x25')],'channel':_0x84bf('0x26')};var _0x3301ba=[];var _0x2f1f94=[];var _0x4072b7={};return db[_0x84bf('0x27')][_0x84bf('0x28')]()[_0x84bf('0xf')](function(_0x2a0234){if(!_0x2a0234){throw new db[(_0x84bf('0x29'))][(_0x84bf('0x2a'))](_0x84bf('0x2b'));}_0x3301ba=_[_0x84bf('0x2c')](_[_0x84bf('0x2d')](_0x2a0234),[_0x84bf('0x2e'),_0x84bf('0x2f')]);_0x2f1f94=_['difference'](_[_0x84bf('0x2d')](_0x2a0234),['createdAt','updatedAt',_0x84bf('0x30'),_0x84bf('0x31')]);if(_0x24c772[_0x84bf('0x25')]['id']){delete _0x24c772[_0x84bf('0x25')]['id'];}if(_['isNil'](_0x24c772[_0x84bf('0x25')]['from'])){throw new db[(_0x84bf('0x29'))]['ValidationError']('from\x20is\x20mandatory');}if(_['isNil'](_0x24c772[_0x84bf('0x25')][_0x84bf('0x25')])||_0x24c772[_0x84bf('0x25')][_0x84bf('0x25')]===''){throw new db[(_0x84bf('0x29'))][(_0x84bf('0x2a'))](_0x84bf('0x32'));}if(_[_0x84bf('0x33')](_0x24c772[_0x84bf('0x25')][_0x84bf('0x34')])){throw new db['Sequelize'][(_0x84bf('0x2a'))](_0x84bf('0x35')+_0x2f1f94);}if(!_[_0x84bf('0x36')](_0x2f1f94,_0x24c772[_0x84bf('0x25')]['mapKey'])){throw new db['Sequelize'][(_0x84bf('0x2a'))](_0x84bf('0x37')+_0x2f1f94);}_0x4072b7[_0x24c772[_0x84bf('0x25')][_0x84bf('0x34')]]=_0x24c772[_0x84bf('0x25')][_0x84bf('0x38')];})[_0x84bf('0xf')](function(){return db[_0x84bf('0x39')][_0x84bf('0x3a')]({'where':{'id':_0x24c772[_0x84bf('0x3b')]['id']},'include':[{'model':db[_0x84bf('0x3c')],'as':_0x84bf('0x3d'),'include':[{'model':db[_0x84bf('0x27')],'as':'Contacts','where':_0x4072b7,'limit':0x1,'order':[[_0x84bf('0x2f'),_0x84bf('0x3e')]]}]},{'model':db['FaxApplication'],'as':_0x84bf('0x3f')}]});})[_0x84bf('0xf')](function(_0x2922e1){if(_0x2922e1&&_0x2922e1['List']){var _0x4ddb10=_0x2922e1[_0x84bf('0x40')]({'plain':!![]});_0x38e191[_0x84bf('0x3b')]=_0x4ddb10;_0x38e191['applications']=_0x4ddb10[_0x84bf('0x3f')];_0x38e191['list']=_0x4ddb10[_0x84bf('0x3d')];_0x38e191[_0x84bf('0x41')]=_[_0x84bf('0x42')](_0x38e191[_0x84bf('0x41')],['priority'],['asc']);if(_0x38e191['account'][_0x84bf('0x3f')]){delete _0x38e191[_0x84bf('0x3b')][_0x84bf('0x3f')];}if(_0x38e191[_0x84bf('0x3b')][_0x84bf('0x3d')]&&_0x38e191[_0x84bf('0x3b')]['List'][_0x84bf('0x43')][_0x84bf('0x44')]){return _0x38e191[_0x84bf('0x3b')][_0x84bf('0x3d')][_0x84bf('0x43')][0x0];}var _0x358063=_[_0x84bf('0x45')](_0x24c772[_0x84bf('0x25')],{'firstName':_0x24c772[_0x84bf('0x25')][_0x84bf('0x38')],'ListId':_0x4ddb10[_0x84bf('0x31')]});_0x358063[_0x24c772['body'][_0x84bf('0x34')]]=_0x24c772['body'][_0x84bf('0x38')];return db[_0x84bf('0x27')]['create'](_0x358063,{'fields':_0x3301ba,'raw':!![]});}})[_0x84bf('0xf')](function(_0x14e641){_0x38e191[_0x84bf('0x46')]=_0x14e641;if(_0x14e641){var _0x53ce5b={'ContactId':_0x14e641['id'],'FaxAccountId':_0x24c772[_0x84bf('0x3b')]['id'],'fax':_0x14e641[_0x84bf('0x26')]};return db['FaxInteraction'][_0x84bf('0x3a')]({'where':{'ContactId':_0x14e641['id'],'closed':![],'FaxAccountId':_0x24c772[_0x84bf('0x3b')]['id']}})['then'](function(_0x1e2af6){if(_0x1e2af6){return[_0x1e2af6,![]];}return db[_0x84bf('0x47')][_0x84bf('0x48')](_0x53ce5b)[_0x84bf('0xf')](function(_0x250a7b){return[_0x250a7b,!![]];});});}else{throw new Error(_0x84bf('0x49'));}})[_0x84bf('0x4a')](function(_0x2acd92,_0x5d7ca6){var _0x584f48=_0x2acd92[_0x84bf('0x40')]({'plain':!![]});if(_0x5d7ca6){if(_0x38e191['account'][_0x84bf('0x4b')]){_0x38e191[_0x84bf('0x41')][_0x84bf('0x4c')]({'id':0x0,'priority':_0x38e191['applications']['length']+0x1,'app':_0x84bf('0x4d'),'appdata':_0x84bf('0x4e'),'interval':_0x84bf('0x4f')});}_0x584f48[_0x84bf('0x50')]=!![];}else{_0x584f48[_0x84bf('0x50')]=![];}_0x38e191['interaction']=_0x584f48;return db['FaxMessage'][_0x84bf('0x48')]({'body':_0x24c772[_0x84bf('0x25')]['body'],'FaxAccountId':_0x24c772[_0x84bf('0x3b')]['id'],'FaxInteractionId':_0x2acd92['id'],'direction':'in','ContactId':_0x2acd92['ContactId'],'AttachmentId':_0x24c772['body']['AttachmentId']});})[_0x84bf('0xf')](function(_0x9cc666){_0x38e191['message']=_0x9cc666;if(_0x38e191['interaction'][_0x84bf('0x51')]){return db['User'][_0x84bf('0x3a')]({'attributes':['id',_0x84bf('0x52')],'where':{'id':_0x38e191['interaction'][_0x84bf('0x51')]}})[_0x84bf('0xf')](function(_0x2dbdd2){if(_0x2dbdd2){_0x38e191[_0x84bf('0x41')][_0x84bf('0x53')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x2dbdd2[_0x84bf('0x52')]+','+(_0x38e191[_0x84bf('0x3b')][_0x84bf('0x54')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x84bf('0x55'),_0x84bf('0x56'),_0x38e191);});}return respondWithRpcPromise(_0x84bf('0x55'),_0x84bf('0x56'),_0x38e191);})['then'](function(_0x38c4b5){_0x37e681(_0x38c4b5);})['catch'](function(_0x21e66a){_0x599e0c(_0x2d5717[_0x84bf('0x15')](0x1f4,_0x21e66a[_0x84bf('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index a70f85c..c90f9f9 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 _0x9f0e=['save','remove','update','emit','removeListener','register','length','faxAccount:','./faxAccount.events'];(function(_0x1d3052,_0x163c8c){var _0x5896fa=function(_0x4fa472){while(--_0x4fa472){_0x1d3052['push'](_0x1d3052['shift']());}};_0x5896fa(++_0x163c8c);}(_0x9f0e,0x116));var _0xe9f0=function(_0x1cc43b,_0x48851f){_0x1cc43b=_0x1cc43b-0x0;var _0x41e66e=_0x9f0e[_0x1cc43b];return _0x41e66e;};'use strict';var FaxAccountEvents=require(_0xe9f0('0x0'));var events=[_0xe9f0('0x1'),_0xe9f0('0x2'),_0xe9f0('0x3')];function createListener(_0x146ad8,_0x4a1a30){return function(_0x5856dc){_0x4a1a30[_0xe9f0('0x4')](_0x146ad8,_0x5856dc);};}function removeListener(_0x150a03,_0x3c589d){return function(){FaxAccountEvents[_0xe9f0('0x5')](_0x150a03,_0x3c589d);};}exports[_0xe9f0('0x6')]=function(_0x50313d){for(var _0x5b87c1=0x0,_0x3a17b3=events[_0xe9f0('0x7')];_0x5b87c1<_0x3a17b3;_0x5b87c1++){var _0xe64a79=events[_0x5b87c1];var _0x4be6a6=createListener(_0xe9f0('0x8')+_0xe64a79,_0x50313d);FaxAccountEvents['on'](_0xe64a79,_0x4be6a6);}}; \ No newline at end of file +var _0xe2fe=['update','emit','register','length','./faxAccount.events'];(function(_0x270d32,_0x51f2e1){var _0x4347bc=function(_0x4a036c){while(--_0x4a036c){_0x270d32['push'](_0x270d32['shift']());}};_0x4347bc(++_0x51f2e1);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var FaxAccountEvents=require(_0xee2f('0x0'));var events=['save','remove',_0xee2f('0x1')];function createListener(_0x5e18ae,_0x169cf9){return function(_0x1b6f4c){_0x169cf9[_0xee2f('0x2')](_0x5e18ae,_0x1b6f4c);};}function removeListener(_0x2d2b03,_0xcb45e6){return function(){FaxAccountEvents['removeListener'](_0x2d2b03,_0xcb45e6);};}exports[_0xee2f('0x3')]=function(_0x2b7e7c){for(var _0x49926b=0x0,_0x1533a0=events[_0xee2f('0x4')];_0x49926b<_0x1533a0;_0x49926b++){var _0x5a7975=events[_0x49926b];var _0x3c4095=createListener('faxAccount:'+_0x5a7975,_0x2b7e7c);FaxAccountEvents['on'](_0x5a7975,_0x3c4095);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 9fcf73c..0e830d5 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 _0x5842=['path','connect-timeout','Router','../../components/auth/service','../../config/environment','./faxAccount.controller','get','isAuthenticated','index','/describe','describe','show','getDispositions','/:id/canned_answers','/:id/interactions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/users','getAgents','post','create','/:id/dispositions','addDisposition','addAnswer','addInteraction','addApplications','/addaccountapplications','addAccountApplications','updateAccountApplications','/:id/send','send','put','/:id','update','destroy','delete','removeAnswers','removeAgents','exports','multer'];(function(_0x3da047,_0x167b2c){var _0x5040c8=function(_0x5c995a){while(--_0x5c995a){_0x3da047['push'](_0x3da047['shift']());}};_0x5040c8(++_0x167b2c);}(_0x5842,0x1cd));var _0x2584=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x5842[_0x255d5b];return _0x3e141a;};'use strict';var multer=require(_0x2584('0x0'));var util=require('util');var path=require(_0x2584('0x1'));var timeout=require(_0x2584('0x2'));var express=require('express');var router=express[_0x2584('0x3')]();var auth=require(_0x2584('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2584('0x5'));var controller=require(_0x2584('0x6'));router[_0x2584('0x7')]('/',auth[_0x2584('0x8')](),controller[_0x2584('0x9')]);router[_0x2584('0x7')](_0x2584('0xa'),auth['isAuthenticated'](),controller[_0x2584('0xb')]);router['get']('/:id',auth[_0x2584('0x8')](),controller[_0x2584('0xc')]);router[_0x2584('0x7')]('/:id/dispositions',auth[_0x2584('0x8')](),controller[_0x2584('0xd')]);router[_0x2584('0x7')](_0x2584('0xe'),auth[_0x2584('0x8')](),controller['getAnswers']);router['get'](_0x2584('0xf'),auth['isAuthenticated'](),controller['getInteractions']);router['get'](_0x2584('0x10'),auth[_0x2584('0x8')](),controller[_0x2584('0x11')]);router[_0x2584('0x7')](_0x2584('0x12'),auth[_0x2584('0x8')](),controller[_0x2584('0x13')]);router[_0x2584('0x7')](_0x2584('0x14'),auth[_0x2584('0x8')](),controller[_0x2584('0x15')]);router[_0x2584('0x16')]('/',auth[_0x2584('0x8')](),controller[_0x2584('0x17')]);router[_0x2584('0x16')](_0x2584('0x18'),auth['isAuthenticated'](),controller[_0x2584('0x19')]);router[_0x2584('0x16')](_0x2584('0xe'),auth['isAuthenticated'](),controller[_0x2584('0x1a')]);router[_0x2584('0x16')](_0x2584('0xf'),auth[_0x2584('0x8')](),controller[_0x2584('0x1b')]);router[_0x2584('0x16')]('/:id/applications',auth[_0x2584('0x8')](),controller[_0x2584('0x1c')]);router[_0x2584('0x16')](_0x2584('0x1d'),auth['isAuthenticated'](),controller[_0x2584('0x1e')]);router[_0x2584('0x16')]('/updateaccountapplications',auth[_0x2584('0x8')](),controller[_0x2584('0x1f')]);router[_0x2584('0x16')](_0x2584('0x20'),auth[_0x2584('0x8')](),controller[_0x2584('0x21')]);router[_0x2584('0x16')]('/:id/users',auth[_0x2584('0x8')](),controller['addAgents']);router[_0x2584('0x22')](_0x2584('0x23'),auth[_0x2584('0x8')](),controller[_0x2584('0x24')]);router['delete'](_0x2584('0x23'),auth['isAuthenticated'](),controller[_0x2584('0x25')]);router[_0x2584('0x26')]('/:id/dispositions',auth['isAuthenticated'](),controller['removeDispositions']);router[_0x2584('0x26')](_0x2584('0xe'),auth[_0x2584('0x8')](),controller[_0x2584('0x27')]);router['delete']('/:id/users',auth[_0x2584('0x8')](),controller[_0x2584('0x28')]);module[_0x2584('0x29')]=router; \ No newline at end of file +var _0xaea0=['/:id','getDispositions','getAnswers','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','/:id/users','getAgents','post','create','/:id/dispositions','/:id/canned_answers','addAnswer','addInteraction','addApplications','/addaccountapplications','addAccountApplications','updateAccountApplications','/:id/send','send','put','delete','destroy','removeDispositions','removeAgents','exports','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','isAuthenticated','/describe','describe'];(function(_0x881128,_0x4e73b9){var _0x53f69f=function(_0x17f410){while(--_0x17f410){_0x881128['push'](_0x881128['shift']());}};_0x53f69f(++_0x4e73b9);}(_0xaea0,0x8e));var _0x0aea=function(_0x104a84,_0x285970){_0x104a84=_0x104a84-0x0;var _0x4973ff=_0xaea0[_0x104a84];return _0x4973ff;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0aea('0x0'));var timeout=require(_0x0aea('0x1'));var express=require(_0x0aea('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x0aea('0x3'));var config=require(_0x0aea('0x4'));var controller=require(_0x0aea('0x5'));router[_0x0aea('0x6')]('/',auth[_0x0aea('0x7')](),controller['index']);router[_0x0aea('0x6')](_0x0aea('0x8'),auth[_0x0aea('0x7')](),controller[_0x0aea('0x9')]);router[_0x0aea('0x6')](_0x0aea('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0aea('0x6')]('/:id/dispositions',auth[_0x0aea('0x7')](),controller[_0x0aea('0xb')]);router[_0x0aea('0x6')]('/:id/canned_answers',auth[_0x0aea('0x7')](),controller[_0x0aea('0xc')]);router['get'](_0x0aea('0xd'),auth['isAuthenticated'](),controller[_0x0aea('0xe')]);router['get'](_0x0aea('0xf'),auth[_0x0aea('0x7')](),controller[_0x0aea('0x10')]);router['get'](_0x0aea('0x11'),auth[_0x0aea('0x7')](),controller['getMessages']);router[_0x0aea('0x6')](_0x0aea('0x12'),auth['isAuthenticated'](),controller[_0x0aea('0x13')]);router[_0x0aea('0x14')]('/',auth[_0x0aea('0x7')](),controller[_0x0aea('0x15')]);router['post'](_0x0aea('0x16'),auth[_0x0aea('0x7')](),controller['addDisposition']);router[_0x0aea('0x14')](_0x0aea('0x17'),auth[_0x0aea('0x7')](),controller[_0x0aea('0x18')]);router['post'](_0x0aea('0xd'),auth['isAuthenticated'](),controller[_0x0aea('0x19')]);router['post'](_0x0aea('0xf'),auth[_0x0aea('0x7')](),controller[_0x0aea('0x1a')]);router[_0x0aea('0x14')](_0x0aea('0x1b'),auth[_0x0aea('0x7')](),controller[_0x0aea('0x1c')]);router['post']('/updateaccountapplications',auth[_0x0aea('0x7')](),controller[_0x0aea('0x1d')]);router[_0x0aea('0x14')](_0x0aea('0x1e'),auth[_0x0aea('0x7')](),controller[_0x0aea('0x1f')]);router[_0x0aea('0x14')](_0x0aea('0x12'),auth[_0x0aea('0x7')](),controller['addAgents']);router[_0x0aea('0x20')](_0x0aea('0xa'),auth[_0x0aea('0x7')](),controller['update']);router[_0x0aea('0x21')](_0x0aea('0xa'),auth['isAuthenticated'](),controller[_0x0aea('0x22')]);router[_0x0aea('0x21')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x0aea('0x23')]);router[_0x0aea('0x21')](_0x0aea('0x17'),auth[_0x0aea('0x7')](),controller['removeAnswers']);router[_0x0aea('0x21')](_0x0aea('0x12'),auth[_0x0aea('0x7')](),controller[_0x0aea('0x24')]);module[_0x0aea('0x25')]=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index 04c6c4b..8b07cb2 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 _0x9dfc=['sequelize','noop','TEXT','STRING','*,*,*,*'];(function(_0x4c445a,_0x4ee80f){var _0x2f611c=function(_0x4f3699){while(--_0x4f3699){_0x4c445a['push'](_0x4c445a['shift']());}};_0x2f611c(++_0x4ee80f);}(_0x9dfc,0x140));var _0xc9df=function(_0x35e2fa,_0x196e23){_0x35e2fa=_0x35e2fa-0x0;var _0xdfe41b=_0x9dfc[_0x35e2fa];return _0xdfe41b;};'use strict';var Sequelize=require(_0xc9df('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xc9df('0x1')},'appdata':{'type':Sequelize[_0xc9df('0x2')]()},'description':{'type':Sequelize[_0xc9df('0x3')]},'interval':{'type':Sequelize[_0xc9df('0x3')],'defaultValue':_0xc9df('0x4')}}; \ No newline at end of file +var _0x6a95=['TEXT','sequelize','exports','INTEGER','STRING','noop'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x6a95,0x1db));var _0x56a9=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0x6a95[_0x3b5250];return _0xc844a1;};'use strict';var Sequelize=require(_0x56a9('0x0'));module[_0x56a9('0x1')]={'priority':{'type':Sequelize[_0x56a9('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x56a9('0x3')],'allowNull':![],'defaultValue':_0x56a9('0x4')},'appdata':{'type':Sequelize[_0x56a9('0x5')]()},'description':{'type':Sequelize[_0x56a9('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index b6bd1d6..6c7ee8e 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 _0xf23b=['includeAll','include','findAll','rows','catch','merge','FaxApplication','find','create','body','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','count','offset','set','Content-Range','apply','reject','update','destroy','then','sendStatus','error','stack','name','send','index','map','rawAttributes','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','where','VIRTUAL','filter','options'];(function(_0x1f670c,_0xabbdd6){var _0x247991=function(_0x55331e){while(--_0x55331e){_0x1f670c['push'](_0x1f670c['shift']());}};_0x247991(++_0xabbdd6);}(_0xf23b,0x133));var _0xbf23=function(_0x4d521c,_0x32baf3){_0x4d521c=_0x4d521c-0x0;var _0x417317=_0xf23b[_0x4d521c];return _0x417317;};'use strict';var pdf=require(_0xbf23('0x0'));var emlformat=require(_0xbf23('0x1'));var rimraf=require(_0xbf23('0x2'));var zipdir=require(_0xbf23('0x3'));var jsonpatch=require(_0xbf23('0x4'));var rp=require('request-promise');var moment=require(_0xbf23('0x5'));var BPromise=require(_0xbf23('0x6'));var Mustache=require(_0xbf23('0x7'));var util=require('util');var path=require(_0xbf23('0x8'));var sox=require(_0xbf23('0x9'));var csv=require(_0xbf23('0xa'));var ejs=require(_0xbf23('0xb'));var fs=require('fs');var _=require(_0xbf23('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xbf23('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xbf23('0xa'));var querystring=require(_0xbf23('0xe'));var Papa=require(_0xbf23('0xf'));var Redis=require(_0xbf23('0x10'));var authService=require(_0xbf23('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xbf23('0x12'));var hardwareService=require(_0xbf23('0x13'));var logger=require(_0xbf23('0x14'))(_0xbf23('0x15'));var utils=require(_0xbf23('0x16'));var config=require(_0xbf23('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2d4b94,_0x51e816){_0x51e816=_0x51e816||0xcc;return function(_0xd01a98){if(_0xd01a98){return _0x2d4b94['sendStatus'](_0x51e816);}return _0x2d4b94[_0xbf23('0x18')](_0x51e816)[_0xbf23('0x19')]();};}function respondWithResult(_0x4deb64,_0xb6880){_0xb6880=_0xb6880||0xc8;return function(_0x5a738f){if(_0x5a738f){return _0x4deb64['status'](_0xb6880)[_0xbf23('0x1a')](_0x5a738f);}};}function respondWithFilteredResult(_0x2fcf39,_0x5dd4f9){return function(_0x4cb2a8){if(_0x4cb2a8){var _0x1cc52b=_0x4cb2a8[_0xbf23('0x1b')],_0x581f9a=_0x5dd4f9[_0xbf23('0x1c')],_0x46ef3b=_0x5dd4f9['offset']+_0x5dd4f9['limit'],_0x14e587;if(_0x46ef3b>=_0x1cc52b){_0x46ef3b=_0x1cc52b;_0x14e587=0xc8;}else{_0x14e587=0xce;}_0x2fcf39['status'](_0x14e587);return _0x2fcf39[_0xbf23('0x1d')](_0xbf23('0x1e'),_0x581f9a+'-'+_0x46ef3b+'/'+_0x1cc52b)[_0xbf23('0x1a')](_0x4cb2a8);}return null;};}function patchUpdates(_0xf3c001){return function(_0x53f82c){try{jsonpatch[_0xbf23('0x1f')](_0x53f82c,_0xf3c001,!![]);}catch(_0x1b03b6){return BPromise[_0xbf23('0x20')](_0x1b03b6);}return _0x53f82c['save']();};}function saveUpdates(_0xcd02e6,_0x3b6f7e){return function(_0x2bc340){if(_0x2bc340){return _0x2bc340[_0xbf23('0x21')](_0xcd02e6)['then'](function(_0x2307f8){return _0x2307f8;});}return null;};}function removeEntity(_0x4ea717,_0xc683e8){return function(_0x5858c7){if(_0x5858c7){return _0x5858c7[_0xbf23('0x22')]()[_0xbf23('0x23')](function(){_0x4ea717[_0xbf23('0x18')](0xcc)[_0xbf23('0x19')]();});}};}function handleEntityNotFound(_0x5a4852,_0x5e65c8){return function(_0x5c6e8c){if(!_0x5c6e8c){_0x5a4852[_0xbf23('0x24')](0x194);}return _0x5c6e8c;};}function handleError(_0x1bf039,_0x5195bd){_0x5195bd=_0x5195bd||0x1f4;return function(_0x53fda2){logger[_0xbf23('0x25')](_0x53fda2[_0xbf23('0x26')]);if(_0x53fda2[_0xbf23('0x27')]){delete _0x53fda2[_0xbf23('0x27')];}_0x1bf039[_0xbf23('0x18')](_0x5195bd)[_0xbf23('0x28')](_0x53fda2);};}exports[_0xbf23('0x29')]=function(_0x224fa4,_0x3caf3a){var _0x177070={},_0x16b9ec={},_0x489a2e={'count':0x0,'rows':[]};var _0x5d3f5b=_[_0xbf23('0x2a')](db['FaxApplication'][_0xbf23('0x2b')],function(_0x16189f){return{'name':_0x16189f['fieldName'],'type':_0x16189f[_0xbf23('0x2c')]['key']};});_0x16b9ec['model']=_[_0xbf23('0x2a')](_0x5d3f5b,'name');_0x16b9ec[_0xbf23('0x2d')]=_[_0xbf23('0x2e')](_0x224fa4[_0xbf23('0x2d')]);_0x16b9ec[_0xbf23('0x2f')]=_[_0xbf23('0x30')](_0x16b9ec[_0xbf23('0x31')],_0x16b9ec[_0xbf23('0x2d')]);_0x177070[_0xbf23('0x32')]=_['intersection'](_0x16b9ec[_0xbf23('0x31')],qs[_0xbf23('0x33')](_0x224fa4['query']['fields']));_0x177070[_0xbf23('0x32')]=_0x177070['attributes'][_0xbf23('0x34')]?_0x177070[_0xbf23('0x32')]:_0x16b9ec[_0xbf23('0x31')];if(!_0x224fa4[_0xbf23('0x2d')][_0xbf23('0x35')](_0xbf23('0x36'))){_0x177070['limit']=qs['limit'](_0x224fa4[_0xbf23('0x2d')][_0xbf23('0x37')]);_0x177070['offset']=qs[_0xbf23('0x1c')](_0x224fa4['query']['offset']);}_0x177070[_0xbf23('0x38')]=qs[_0xbf23('0x39')](_0x224fa4[_0xbf23('0x2d')][_0xbf23('0x39')]);_0x177070['where']=qs[_0xbf23('0x2f')](_[_0xbf23('0x3a')](_0x224fa4[_0xbf23('0x2d')],_0x16b9ec[_0xbf23('0x2f')]));if(_0x224fa4[_0xbf23('0x2d')]['filter']){_0x177070['where']=_['merge'](_0x177070[_0xbf23('0x3b')],{'$or':_[_0xbf23('0x2a')](_0x5d3f5b,function(_0x481d8f){if(_0x481d8f['type']!==_0xbf23('0x3c')){var _0x11b3b0={};_0x11b3b0[_0x481d8f['name']]={'$like':'%'+_0x224fa4[_0xbf23('0x2d')][_0xbf23('0x3d')]+'%'};return _0x11b3b0;}})});}_0x177070=_['merge']({},_0x177070,_0x224fa4[_0xbf23('0x3e')]);var _0x132d3c={'where':_0x177070[_0xbf23('0x3b')]};return db['FaxApplication']['count'](_0x132d3c)[_0xbf23('0x23')](function(_0x24c3fb){_0x489a2e[_0xbf23('0x1b')]=_0x24c3fb;if(_0x224fa4[_0xbf23('0x2d')][_0xbf23('0x3f')]){_0x177070[_0xbf23('0x40')]=[{'all':!![]}];}return db['FaxApplication'][_0xbf23('0x41')](_0x177070);})['then'](function(_0xb53f8c){_0x489a2e[_0xbf23('0x42')]=_0xb53f8c;return _0x489a2e;})[_0xbf23('0x23')](respondWithFilteredResult(_0x3caf3a,_0x177070))[_0xbf23('0x43')](handleError(_0x3caf3a,null));};exports['show']=function(_0x4fb1f4,_0x495a74){var _0x5614b3={'raw':!![],'where':{'id':_0x4fb1f4['params']['id']}},_0x416c17={};_0x416c17[_0xbf23('0x31')]=_[_0xbf23('0x2e')](db['FaxApplication'][_0xbf23('0x2b')]);_0x416c17[_0xbf23('0x2d')]=_[_0xbf23('0x2e')](_0x4fb1f4[_0xbf23('0x2d')]);_0x416c17[_0xbf23('0x2f')]=_[_0xbf23('0x30')](_0x416c17['model'],_0x416c17['query']);_0x5614b3[_0xbf23('0x32')]=_[_0xbf23('0x30')](_0x416c17[_0xbf23('0x31')],qs[_0xbf23('0x33')](_0x4fb1f4['query']['fields']));_0x5614b3['attributes']=_0x5614b3[_0xbf23('0x32')][_0xbf23('0x34')]?_0x5614b3[_0xbf23('0x32')]:_0x416c17[_0xbf23('0x31')];if(_0x4fb1f4[_0xbf23('0x2d')][_0xbf23('0x3f')]){_0x5614b3['include']=[{'all':!![]}];}_0x5614b3=_[_0xbf23('0x44')]({},_0x5614b3,_0x4fb1f4['options']);return db[_0xbf23('0x45')][_0xbf23('0x46')](_0x5614b3)[_0xbf23('0x23')](handleEntityNotFound(_0x495a74,null))[_0xbf23('0x23')](respondWithResult(_0x495a74,null))[_0xbf23('0x43')](handleError(_0x495a74,null));};exports[_0xbf23('0x47')]=function(_0x3e24ac,_0x1bb23a){return db['FaxApplication'][_0xbf23('0x47')](_0x3e24ac['body'],{})[_0xbf23('0x23')](respondWithResult(_0x1bb23a,0xc9))[_0xbf23('0x43')](handleError(_0x1bb23a,null));};exports[_0xbf23('0x21')]=function(_0x5dc245,_0x81e0c9){if(_0x5dc245[_0xbf23('0x48')]['id']){delete _0x5dc245[_0xbf23('0x48')]['id'];}return db['FaxApplication'][_0xbf23('0x46')]({'where':{'id':_0x5dc245[_0xbf23('0x49')]['id']}})['then'](handleEntityNotFound(_0x81e0c9,null))['then'](saveUpdates(_0x5dc245[_0xbf23('0x48')],null))[_0xbf23('0x23')](respondWithResult(_0x81e0c9,null))[_0xbf23('0x43')](handleError(_0x81e0c9,null));};exports[_0xbf23('0x22')]=function(_0x11393d,_0x4bdfc0){return db[_0xbf23('0x45')]['find']({'where':{'id':_0x11393d['params']['id']}})[_0xbf23('0x23')](handleEntityNotFound(_0x4bdfc0,null))[_0xbf23('0x23')](removeEntity(_0x4bdfc0,null))[_0xbf23('0x43')](handleError(_0x4bdfc0,null));}; \ No newline at end of file +var _0x4a25=['attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','create','body','params','find','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','set','apply','reject','save','update','destroy','then','error','name','send','index','map','FaxApplication','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model'];(function(_0x408658,_0x333430){var _0x1a37ca=function(_0x50e8a6){while(--_0x50e8a6){_0x408658['push'](_0x408658['shift']());}};_0x1a37ca(++_0x333430);}(_0x4a25,0x1d4));var _0x54a2=function(_0x1ebce2,_0x10e903){_0x1ebce2=_0x1ebce2-0x0;var _0x4a330c=_0x4a25[_0x1ebce2];return _0x4a330c;};'use strict';var pdf=require(_0x54a2('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x54a2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x54a2('0x2'));var rp=require(_0x54a2('0x3'));var moment=require(_0x54a2('0x4'));var BPromise=require(_0x54a2('0x5'));var Mustache=require('mustache');var util=require(_0x54a2('0x6'));var path=require(_0x54a2('0x7'));var sox=require(_0x54a2('0x8'));var csv=require(_0x54a2('0x9'));var ejs=require(_0x54a2('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x54a2('0xb'));var crypto=require(_0x54a2('0xc'));var jsforce=require(_0x54a2('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x54a2('0xe'));var Papa=require('papaparse');var Redis=require(_0x54a2('0xf'));var authService=require(_0x54a2('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x54a2('0x11'));var hardwareService=require(_0x54a2('0x12'));var logger=require('../../config/logger')(_0x54a2('0x13'));var utils=require(_0x54a2('0x14'));var config=require('../../config/environment');var db=require(_0x54a2('0x15'))['db'];function respondWithStatusCode(_0x1ec864,_0xd01a3b){_0xd01a3b=_0xd01a3b||0xcc;return function(_0x3a76b1){if(_0x3a76b1){return _0x1ec864[_0x54a2('0x16')](_0xd01a3b);}return _0x1ec864[_0x54a2('0x17')](_0xd01a3b)[_0x54a2('0x18')]();};}function respondWithResult(_0x2319bd,_0x5e5786){_0x5e5786=_0x5e5786||0xc8;return function(_0x348e31){if(_0x348e31){return _0x2319bd['status'](_0x5e5786)[_0x54a2('0x19')](_0x348e31);}};}function respondWithFilteredResult(_0x259a7a,_0xb61800){return function(_0x1fcc41){if(_0x1fcc41){var _0x38beb0=_0x1fcc41[_0x54a2('0x1a')],_0xc45719=_0xb61800[_0x54a2('0x1b')],_0x740ad=_0xb61800['offset']+_0xb61800['limit'],_0x3fbae6;if(_0x740ad>=_0x38beb0){_0x740ad=_0x38beb0;_0x3fbae6=0xc8;}else{_0x3fbae6=0xce;}_0x259a7a['status'](_0x3fbae6);return _0x259a7a[_0x54a2('0x1c')]('Content-Range',_0xc45719+'-'+_0x740ad+'/'+_0x38beb0)['json'](_0x1fcc41);}return null;};}function patchUpdates(_0x4b4301){return function(_0x54543e){try{jsonpatch[_0x54a2('0x1d')](_0x54543e,_0x4b4301,!![]);}catch(_0x459962){return BPromise[_0x54a2('0x1e')](_0x459962);}return _0x54543e[_0x54a2('0x1f')]();};}function saveUpdates(_0xd9a51d,_0x369d1b){return function(_0x466a5b){if(_0x466a5b){return _0x466a5b[_0x54a2('0x20')](_0xd9a51d)['then'](function(_0x57efab){return _0x57efab;});}return null;};}function removeEntity(_0x12e7e0,_0x25ab61){return function(_0x506485){if(_0x506485){return _0x506485[_0x54a2('0x21')]()[_0x54a2('0x22')](function(){_0x12e7e0['status'](0xcc)[_0x54a2('0x18')]();});}};}function handleEntityNotFound(_0x22b6ed,_0x5da059){return function(_0x5f955){if(!_0x5f955){_0x22b6ed[_0x54a2('0x16')](0x194);}return _0x5f955;};}function handleError(_0x1a6ae5,_0x2e2f7b){_0x2e2f7b=_0x2e2f7b||0x1f4;return function(_0x35b3f2){logger[_0x54a2('0x23')](_0x35b3f2['stack']);if(_0x35b3f2[_0x54a2('0x24')]){delete _0x35b3f2[_0x54a2('0x24')];}_0x1a6ae5['status'](_0x2e2f7b)[_0x54a2('0x25')](_0x35b3f2);};}exports[_0x54a2('0x26')]=function(_0xa8bf94,_0x423870){var _0x1be632={},_0x53856e={},_0xc8f32d={'count':0x0,'rows':[]};var _0x200c2e=_[_0x54a2('0x27')](db[_0x54a2('0x28')][_0x54a2('0x29')],function(_0x1737c8){return{'name':_0x1737c8[_0x54a2('0x2a')],'type':_0x1737c8[_0x54a2('0x2b')][_0x54a2('0x2c')]};});_0x53856e['model']=_[_0x54a2('0x27')](_0x200c2e,'name');_0x53856e['query']=_[_0x54a2('0x2d')](_0xa8bf94[_0x54a2('0x2e')]);_0x53856e[_0x54a2('0x2f')]=_[_0x54a2('0x30')](_0x53856e[_0x54a2('0x31')],_0x53856e[_0x54a2('0x2e')]);_0x1be632[_0x54a2('0x32')]=_['intersection'](_0x53856e[_0x54a2('0x31')],qs['fields'](_0xa8bf94['query'][_0x54a2('0x33')]));_0x1be632[_0x54a2('0x32')]=_0x1be632[_0x54a2('0x32')][_0x54a2('0x34')]?_0x1be632['attributes']:_0x53856e['model'];if(!_0xa8bf94['query'][_0x54a2('0x35')](_0x54a2('0x36'))){_0x1be632['limit']=qs[_0x54a2('0x37')](_0xa8bf94[_0x54a2('0x2e')]['limit']);_0x1be632[_0x54a2('0x1b')]=qs[_0x54a2('0x1b')](_0xa8bf94[_0x54a2('0x2e')]['offset']);}_0x1be632[_0x54a2('0x38')]=qs[_0x54a2('0x39')](_0xa8bf94['query'][_0x54a2('0x39')]);_0x1be632[_0x54a2('0x3a')]=qs['filters'](_[_0x54a2('0x3b')](_0xa8bf94[_0x54a2('0x2e')],_0x53856e[_0x54a2('0x2f')]));if(_0xa8bf94['query'][_0x54a2('0x3c')]){_0x1be632['where']=_[_0x54a2('0x3d')](_0x1be632[_0x54a2('0x3a')],{'$or':_[_0x54a2('0x27')](_0x200c2e,function(_0x1b1893){if(_0x1b1893[_0x54a2('0x2b')]!==_0x54a2('0x3e')){var _0x58611f={};_0x58611f[_0x1b1893[_0x54a2('0x24')]]={'$like':'%'+_0xa8bf94[_0x54a2('0x2e')]['filter']+'%'};return _0x58611f;}})});}_0x1be632=_[_0x54a2('0x3d')]({},_0x1be632,_0xa8bf94[_0x54a2('0x3f')]);var _0x1a74e6={'where':_0x1be632[_0x54a2('0x3a')]};return db[_0x54a2('0x28')][_0x54a2('0x1a')](_0x1a74e6)[_0x54a2('0x22')](function(_0x39e4c8){_0xc8f32d['count']=_0x39e4c8;if(_0xa8bf94['query'][_0x54a2('0x40')]){_0x1be632[_0x54a2('0x41')]=[{'all':!![]}];}return db[_0x54a2('0x28')][_0x54a2('0x42')](_0x1be632);})[_0x54a2('0x22')](function(_0x4549b1){_0xc8f32d[_0x54a2('0x43')]=_0x4549b1;return _0xc8f32d;})['then'](respondWithFilteredResult(_0x423870,_0x1be632))[_0x54a2('0x44')](handleError(_0x423870,null));};exports[_0x54a2('0x45')]=function(_0x21b10d,_0x2acd62){var _0x7dc326={'raw':!![],'where':{'id':_0x21b10d['params']['id']}},_0x3e2c81={};_0x3e2c81[_0x54a2('0x31')]=_[_0x54a2('0x2d')](db[_0x54a2('0x28')][_0x54a2('0x29')]);_0x3e2c81[_0x54a2('0x2e')]=_[_0x54a2('0x2d')](_0x21b10d[_0x54a2('0x2e')]);_0x3e2c81['filters']=_[_0x54a2('0x30')](_0x3e2c81[_0x54a2('0x31')],_0x3e2c81[_0x54a2('0x2e')]);_0x7dc326[_0x54a2('0x32')]=_[_0x54a2('0x30')](_0x3e2c81['model'],qs[_0x54a2('0x33')](_0x21b10d[_0x54a2('0x2e')][_0x54a2('0x33')]));_0x7dc326[_0x54a2('0x32')]=_0x7dc326[_0x54a2('0x32')][_0x54a2('0x34')]?_0x7dc326[_0x54a2('0x32')]:_0x3e2c81[_0x54a2('0x31')];if(_0x21b10d['query'][_0x54a2('0x40')]){_0x7dc326[_0x54a2('0x41')]=[{'all':!![]}];}_0x7dc326=_[_0x54a2('0x3d')]({},_0x7dc326,_0x21b10d['options']);return db[_0x54a2('0x28')]['find'](_0x7dc326)[_0x54a2('0x22')](handleEntityNotFound(_0x2acd62,null))[_0x54a2('0x22')](respondWithResult(_0x2acd62,null))[_0x54a2('0x44')](handleError(_0x2acd62,null));};exports[_0x54a2('0x46')]=function(_0x4f5fda,_0x4a1dbc){return db['FaxApplication'][_0x54a2('0x46')](_0x4f5fda[_0x54a2('0x47')],{})[_0x54a2('0x22')](respondWithResult(_0x4a1dbc,0xc9))[_0x54a2('0x44')](handleError(_0x4a1dbc,null));};exports[_0x54a2('0x20')]=function(_0x4fcad7,_0x556835){if(_0x4fcad7[_0x54a2('0x47')]['id']){delete _0x4fcad7[_0x54a2('0x47')]['id'];}return db[_0x54a2('0x28')]['find']({'where':{'id':_0x4fcad7[_0x54a2('0x48')]['id']}})[_0x54a2('0x22')](handleEntityNotFound(_0x556835,null))[_0x54a2('0x22')](saveUpdates(_0x4fcad7[_0x54a2('0x47')],null))[_0x54a2('0x22')](respondWithResult(_0x556835,null))[_0x54a2('0x44')](handleError(_0x556835,null));};exports[_0x54a2('0x21')]=function(_0x2b64c3,_0x255430){return db[_0x54a2('0x28')][_0x54a2('0x49')]({'where':{'id':_0x2b64c3[_0x54a2('0x48')]['id']}})[_0x54a2('0x22')](handleEntityNotFound(_0x255430,null))[_0x54a2('0x22')](removeEntity(_0x255430,null))[_0x54a2('0x44')](handleError(_0x255430,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 22b8553..ddcf162 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 _0x77a2=['rimraf','../../config/environment','define','FaxApplication','util','../../config/logger','moment','path'];(function(_0x3aebd0,_0x1ad8a7){var _0xcda4c0=function(_0x2865c8){while(--_0x2865c8){_0x3aebd0['push'](_0x3aebd0['shift']());}};_0xcda4c0(++_0x1ad8a7);}(_0x77a2,0x74));var _0x277a=function(_0x4e111b,_0x15928e){_0x4e111b=_0x4e111b-0x0;var _0x55c843=_0x77a2[_0x4e111b];return _0x55c843;};'use strict';var _=require('lodash');var util=require(_0x277a('0x0'));var logger=require(_0x277a('0x1'))('api');var moment=require(_0x277a('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x277a('0x3'));var rimraf=require(_0x277a('0x4'));var config=require(_0x277a('0x5'));var attributes=require('./faxApplication.attributes');module['exports']=function(_0xb8e98b,_0x4f93ca){return _0xb8e98b[_0x277a('0x6')](_0x277a('0x7'),attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x7055=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./faxApplication.attributes','FaxApplication','fax_applications'];(function(_0x5b95ec,_0x16e0d0){var _0x2af647=function(_0x4f7a18){while(--_0x4f7a18){_0x5b95ec['push'](_0x5b95ec['shift']());}};_0x2af647(++_0x16e0d0);}(_0x7055,0x1e3));var _0x5705=function(_0x13b392,_0x3481f2){_0x13b392=_0x13b392-0x0;var _0x39db24=_0x7055[_0x13b392];return _0x39db24;};'use strict';var _=require(_0x5705('0x0'));var util=require(_0x5705('0x1'));var logger=require(_0x5705('0x2'))('api');var moment=require('moment');var BPromise=require(_0x5705('0x3'));var rp=require(_0x5705('0x4'));var fs=require('fs');var path=require(_0x5705('0x5'));var rimraf=require(_0x5705('0x6'));var config=require(_0x5705('0x7'));var attributes=require(_0x5705('0x8'));module['exports']=function(_0x27b3cb,_0x8f8478){return _0x27b3cb['define'](_0x5705('0x9'),attributes,{'tableName':_0x5705('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5705('0xb'),'collate':_0x5705('0xc')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 7c07ca7..cb5dd58 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 _0xe843=['where','attributes','limit','then','lodash','util','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','UpdateFaxApplication','update','body','options'];(function(_0x2d5bcf,_0x5bf682){var _0x32f2e8=function(_0x234c9a){while(--_0x234c9a){_0x2d5bcf['push'](_0x2d5bcf['shift']());}};_0x32f2e8(++_0x5bf682);}(_0xe843,0x170));var _0x3e84=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xe843[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x3e84('0x0'));var util=require(_0x3e84('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3e84('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3e84('0x3'))(_0x3e84('0x4'));var config=require(_0x3e84('0x5'));var jayson=require(_0x3e84('0x6'));var client=jayson['client'][_0x3e84('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5301c3,_0x402394,_0x249733){return new BPromise(function(_0x67e57f,_0x30ee9c){return client[_0x3e84('0x8')](_0x5301c3,_0x249733)['then'](function(_0x1f75ea){logger[_0x3e84('0x9')](_0x3e84('0xa'),_0x402394,_0x3e84('0xb'));logger[_0x3e84('0xc')](_0x3e84('0xd'),_0x402394,_0x3e84('0xb'),JSON[_0x3e84('0xe')](_0x1f75ea));if(_0x1f75ea[_0x3e84('0xf')]){if(_0x1f75ea['error']['code']===0x1f4){logger[_0x3e84('0xf')](_0x3e84('0xa'),_0x402394,_0x1f75ea[_0x3e84('0xf')]['message']);return _0x30ee9c(_0x1f75ea[_0x3e84('0xf')][_0x3e84('0x10')]);}logger[_0x3e84('0xf')](_0x3e84('0xa'),_0x402394,_0x1f75ea[_0x3e84('0xf')]['message']);return _0x67e57f(_0x1f75ea[_0x3e84('0xf')][_0x3e84('0x10')]);}else{logger['info'](_0x3e84('0xa'),_0x402394,_0x3e84('0xb'));_0x67e57f(_0x1f75ea['result'][_0x3e84('0x10')]);}})[_0x3e84('0x11')](function(_0x197772){logger[_0x3e84('0xf')](_0x3e84('0xa'),_0x402394,_0x197772);_0x30ee9c(_0x197772);});});}exports[_0x3e84('0x12')]=function(_0x524a69){var _0x2ec6ae=this;return new Promise(function(_0x39fac1,_0x454e3d){return db['FaxApplication'][_0x3e84('0x13')](_0x524a69[_0x3e84('0x14')],{'raw':_0x524a69['options']?_0x524a69[_0x3e84('0x15')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x524a69[_0x3e84('0x15')]?_0x524a69[_0x3e84('0x15')][_0x3e84('0x16')]||null:null,'attributes':_0x524a69[_0x3e84('0x15')]?_0x524a69['options'][_0x3e84('0x17')]||null:null,'limit':_0x524a69[_0x3e84('0x15')]?_0x524a69['options'][_0x3e84('0x18')]||null:null})[_0x3e84('0x19')](function(_0x37adf4){logger[_0x3e84('0x9')](_0x3e84('0x12'),_0x524a69);logger[_0x3e84('0xc')]('UpdateFaxApplication',_0x524a69,JSON['stringify'](_0x37adf4));_0x39fac1(_0x37adf4);})[_0x3e84('0x11')](function(_0x55f001){logger['error'](_0x3e84('0x12'),_0x55f001['message'],_0x524a69);_0x454e3d(_0x2ec6ae[_0x3e84('0xf')](0x1f4,_0x55f001[_0x3e84('0x10')]));});});}; \ No newline at end of file +var _0x57ef=['FaxApplication,\x20%s,\x20%s,\x20%s','stringify','code','error','message','request\x20sent','result','catch','UpdateFaxApplication','FaxApplication','body','options','raw','where','attributes','debug','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','FaxApplication,\x20%s,\x20%s'];(function(_0x17406a,_0x1e2320){var _0x1501ff=function(_0x4b075a){while(--_0x4b075a){_0x17406a['push'](_0x17406a['shift']());}};_0x1501ff(++_0x1e2320);}(_0x57ef,0xab));var _0xf57e=function(_0x48f7a3,_0x354eb7){_0x48f7a3=_0x48f7a3-0x0;var _0x58e5d7=_0x57ef[_0x48f7a3];return _0x58e5d7;};'use strict';var _=require(_0xf57e('0x0'));var util=require('util');var moment=require(_0xf57e('0x1'));var BPromise=require(_0xf57e('0x2'));var rs=require(_0xf57e('0x3'));var fs=require('fs');var Redis=require(_0xf57e('0x4'));var db=require(_0xf57e('0x5'))['db'];var utils=require(_0xf57e('0x6'));var logger=require(_0xf57e('0x7'))('rpc');var config=require(_0xf57e('0x8'));var jayson=require(_0xf57e('0x9'));var client=jayson[_0xf57e('0xa')][_0xf57e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3f118d,_0x5c1ca2,_0x23884b){return new BPromise(function(_0xb1e009,_0x438002){return client['request'](_0x3f118d,_0x23884b)[_0xf57e('0xc')](function(_0x1d63ec){logger[_0xf57e('0xd')](_0xf57e('0xe'),_0x5c1ca2,'request\x20sent');logger['debug'](_0xf57e('0xf'),_0x5c1ca2,'request\x20sent',JSON[_0xf57e('0x10')](_0x1d63ec));if(_0x1d63ec['error']){if(_0x1d63ec['error'][_0xf57e('0x11')]===0x1f4){logger[_0xf57e('0x12')](_0xf57e('0xe'),_0x5c1ca2,_0x1d63ec[_0xf57e('0x12')][_0xf57e('0x13')]);return _0x438002(_0x1d63ec[_0xf57e('0x12')]['message']);}logger['error'](_0xf57e('0xe'),_0x5c1ca2,_0x1d63ec['error'][_0xf57e('0x13')]);return _0xb1e009(_0x1d63ec[_0xf57e('0x12')][_0xf57e('0x13')]);}else{logger[_0xf57e('0xd')]('FaxApplication,\x20%s,\x20%s',_0x5c1ca2,_0xf57e('0x14'));_0xb1e009(_0x1d63ec[_0xf57e('0x15')]['message']);}})[_0xf57e('0x16')](function(_0x50e455){logger[_0xf57e('0x12')](_0xf57e('0xe'),_0x5c1ca2,_0x50e455);_0x438002(_0x50e455);});});}exports[_0xf57e('0x17')]=function(_0x224476){var _0xbcec03=this;return new Promise(function(_0x543685,_0x30ad64){return db[_0xf57e('0x18')]['update'](_0x224476[_0xf57e('0x19')],{'raw':_0x224476[_0xf57e('0x1a')]?_0x224476['options'][_0xf57e('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x224476[_0xf57e('0x1a')]?_0x224476[_0xf57e('0x1a')][_0xf57e('0x1c')]||null:null,'attributes':_0x224476[_0xf57e('0x1a')]?_0x224476[_0xf57e('0x1a')][_0xf57e('0x1d')]||null:null,'limit':_0x224476[_0xf57e('0x1a')]?_0x224476['options']['limit']||null:null})['then'](function(_0x4080b2){logger['info']('UpdateFaxApplication',_0x224476);logger[_0xf57e('0x1e')](_0xf57e('0x17'),_0x224476,JSON[_0xf57e('0x10')](_0x4080b2));_0x543685(_0x4080b2);})[_0xf57e('0x16')](function(_0x532a06){logger[_0xf57e('0x12')](_0xf57e('0x17'),_0x532a06['message'],_0x224476);_0x30ad64(_0xbcec03[_0xf57e('0x12')](0x1f4,_0x532a06[_0xf57e('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 3081267..9b57b51 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 _0x5fc3=['post','create','put','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./faxApplication.controller','get','isAuthenticated','/:id','show'];(function(_0x2fbf1d,_0x6ca410){var _0x1c1c28=function(_0x3ac4b6){while(--_0x3ac4b6){_0x2fbf1d['push'](_0x2fbf1d['shift']());}};_0x1c1c28(++_0x6ca410);}(_0x5fc3,0xa8));var _0x35fc=function(_0x5a7d41,_0x4447e2){_0x5a7d41=_0x5a7d41-0x0;var _0x98d8fa=_0x5fc3[_0x5a7d41];return _0x98d8fa;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var auth=require(_0x35fc('0x5'));var interaction=require(_0x35fc('0x6'));var config=require('../../config/environment');var controller=require(_0x35fc('0x7'));router[_0x35fc('0x8')]('/',auth[_0x35fc('0x9')](),controller['index']);router['get'](_0x35fc('0xa'),auth['isAuthenticated'](),controller[_0x35fc('0xb')]);router[_0x35fc('0xc')]('/',auth[_0x35fc('0x9')](),controller[_0x35fc('0xd')]);router[_0x35fc('0xe')](_0x35fc('0xa'),auth[_0x35fc('0x9')](),controller['update']);router[_0x35fc('0xf')](_0x35fc('0xa'),auth['isAuthenticated'](),controller[_0x35fc('0x10')]);module[_0x35fc('0x11')]=router; \ No newline at end of file +var _0x8958=['isAuthenticated','show','create','put','update','delete','destroy','util','../../components/auth/service','../../config/environment','./faxApplication.controller','get','index','/:id'];(function(_0xae426f,_0x1894c2){var _0x9f2fe9=function(_0x396acc){while(--_0x396acc){_0xae426f['push'](_0xae426f['shift']());}};_0x9f2fe9(++_0x1894c2);}(_0x8958,0x93));var _0x8895=function(_0x18e03c,_0x37c800){_0x18e03c=_0x18e03c-0x0;var _0x17b618=_0x8958[_0x18e03c];return _0x17b618;};'use strict';var multer=require('multer');var util=require(_0x8895('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0x8895('0x1'));var interaction=require('../../components/interaction/service');var config=require(_0x8895('0x2'));var controller=require(_0x8895('0x3'));router[_0x8895('0x4')]('/',auth['isAuthenticated'](),controller[_0x8895('0x5')]);router[_0x8895('0x4')](_0x8895('0x6'),auth[_0x8895('0x7')](),controller[_0x8895('0x8')]);router['post']('/',auth[_0x8895('0x7')](),controller[_0x8895('0x9')]);router[_0x8895('0xa')](_0x8895('0x6'),auth[_0x8895('0x7')](),controller[_0x8895('0xb')]);router[_0x8895('0xc')](_0x8895('0x6'),auth[_0x8895('0x7')](),controller[_0x8895('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 55ba1de..79fcbee 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 _0x1eff=['ENUM','out','BOOLEAN','DATE','STRING'];(function(_0x1abcb5,_0x237039){var _0x51d039=function(_0xe213a9){while(--_0xe213a9){_0x1abcb5['push'](_0x1abcb5['shift']());}};_0x51d039(++_0x237039);}(_0x1eff,0x142));var _0xf1ef=function(_0x467fe3,_0x2c468f){_0x467fe3=_0x467fe3-0x0;var _0x17ae9a=_0x1eff[_0x467fe3];return _0x17ae9a;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0xf1ef('0x0')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xf1ef('0x1')]},'disposition':{'type':Sequelize[_0xf1ef('0x2')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize[_0xf1ef('0x2')]},'firstMsgDirection':{'type':Sequelize[_0xf1ef('0x3')]('in',_0xf1ef('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xf1ef('0x1')]},'lastMsgDirection':{'type':Sequelize[_0xf1ef('0x3')]('in',_0xf1ef('0x4')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0xc5b2=['exports','BOOLEAN','DATE','STRING','ENUM','out','sequelize'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xc5b2,0x1b8));var _0x2c5b=function(_0x2dca0d,_0x25d80b){_0x2dca0d=_0x2dca0d-0x0;var _0x48488d=_0xc5b2[_0x2dca0d];return _0x48488d;};'use strict';var Sequelize=require(_0x2c5b('0x0'));module[_0x2c5b('0x1')]={'closed':{'type':Sequelize[_0x2c5b('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x2c5b('0x3')]},'disposition':{'type':Sequelize[_0x2c5b('0x4')]},'note':{'type':Sequelize[_0x2c5b('0x4')]},'read1stAt':{'type':Sequelize[_0x2c5b('0x3')]},'fax':{'type':Sequelize[_0x2c5b('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x2c5b('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x2c5b('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x2c5b('0x5')]('in',_0x2c5b('0x6')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index 3200d46..bb556a4 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 _0xde2b=['conditions','find','unreadMessages','value','having','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','some','compact','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20>\x200','tag','filter','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','QueryTypes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','journey','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','i.FaxAccountId\x20IS\x20NULL','toString','sequelize','keyBy','merge','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','rows','show','params','includeAll','options','create','body','describe','FaxMessage','addMessage','ids','getMessages','format','YYYY-MM-DD\x20HH:mm:ss','include','findAll','setTags','spread','emit','removeTags','download','unix','join','root','files','tmp','server','transcript-%d-%s.zip','Attachment','Messages','get','mkdirSync','basename','existsSync','pipe','createWriteStream','log','err','unlinkSync','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','status','json','count','offset','set','Content-Range','apply','reject','update','end','sendStatus','error','stack','name','send','Users','map','TagIds','Tags','split','forEach','push','then','catch','index','FaxInteraction','fieldName','type','key','keys','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','limit','order','sort','where','pick','select','field','color','from','tools_tags','u.id','ui.FaxInteractionId','user_has_fax_interactions','left_join','u.id\x20=\x20ui.UserId','fax_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','fax_accounts','fax_messages','me.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xde2b,0x72));var _0xbde2=function(_0x1d2ed2,_0x32c0d2){_0x1d2ed2=_0x1d2ed2-0x0;var _0x1a9451=_0xde2b[_0x1d2ed2];return _0x1a9451;};'use strict';var pdf=require(_0xbde2('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbde2('0x1'));var zipdir=require(_0xbde2('0x2'));var jsonpatch=require(_0xbde2('0x3'));var rp=require('request-promise');var moment=require(_0xbde2('0x4'));var BPromise=require(_0xbde2('0x5'));var Mustache=require(_0xbde2('0x6'));var util=require(_0xbde2('0x7'));var path=require(_0xbde2('0x8'));var sox=require(_0xbde2('0x9'));var csv=require(_0xbde2('0xa'));var ejs=require(_0xbde2('0xb'));var fs=require('fs');var _=require(_0xbde2('0xc'));var squel=require(_0xbde2('0xd'));var crypto=require(_0xbde2('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xbde2('0xf'));var toCsv=require(_0xbde2('0xa'));var querystring=require(_0xbde2('0x10'));var Papa=require('papaparse');var Redis=require(_0xbde2('0x11'));var authService=require(_0xbde2('0x12'));var qs=require(_0xbde2('0x13'));var as=require(_0xbde2('0x14'));var hardwareService=require(_0xbde2('0x15'));var logger=require(_0xbde2('0x16'))(_0xbde2('0x17'));var utils=require(_0xbde2('0x18'));var config=require(_0xbde2('0x19'));var db=require(_0xbde2('0x1a'))['db'];config[_0xbde2('0x1b')]=_[_0xbde2('0x1c')](config[_0xbde2('0x1b')],{'host':_0xbde2('0x1d'),'port':0x18eb});var socket=require(_0xbde2('0x1e'))(new Redis(config[_0xbde2('0x1b')]));require(_0xbde2('0x1f'))['register'](socket);function respondWithStatusCode(_0x153c12,_0x550c18){_0x550c18=_0x550c18||0xcc;return function(_0x21c650){if(_0x21c650){return _0x153c12['sendStatus'](_0x550c18);}return _0x153c12[_0xbde2('0x20')](_0x550c18)['end']();};}function respondWithResult(_0x46e88a,_0x40e538){_0x40e538=_0x40e538||0xc8;return function(_0x298503){if(_0x298503){return _0x46e88a[_0xbde2('0x20')](_0x40e538)[_0xbde2('0x21')](_0x298503);}};}function respondWithFilteredResult(_0x2ce862,_0x22cf88){return function(_0x2d47ff){if(_0x2d47ff){var _0x17de7e=_0x2d47ff[_0xbde2('0x22')],_0x4fbe94=_0x22cf88[_0xbde2('0x23')],_0x46eb1d=_0x22cf88[_0xbde2('0x23')]+_0x22cf88['limit'],_0x4e438a;if(_0x46eb1d>=_0x17de7e){_0x46eb1d=_0x17de7e;_0x4e438a=0xc8;}else{_0x4e438a=0xce;}_0x2ce862['status'](_0x4e438a);return _0x2ce862[_0xbde2('0x24')](_0xbde2('0x25'),_0x4fbe94+'-'+_0x46eb1d+'/'+_0x17de7e)['json'](_0x2d47ff);}return null;};}function patchUpdates(_0xe49a44){return function(_0xcc72cb){try{jsonpatch[_0xbde2('0x26')](_0xcc72cb,_0xe49a44,!![]);}catch(_0x4fadc0){return BPromise[_0xbde2('0x27')](_0x4fadc0);}return _0xcc72cb['save']();};}function saveUpdates(_0x510cd5,_0x313cfe){return function(_0x34140a){if(_0x34140a){return _0x34140a[_0xbde2('0x28')](_0x510cd5)['then'](function(_0x54c07d){return _0x54c07d;});}return null;};}function removeEntity(_0x5ed4f9,_0x157498){return function(_0x27cc3e){if(_0x27cc3e){return _0x27cc3e['destroy']()['then'](function(){_0x5ed4f9['status'](0xcc)[_0xbde2('0x29')]();});}};}function handleEntityNotFound(_0x5a62a5,_0x1c16a3){return function(_0x366e4b){if(!_0x366e4b){_0x5a62a5[_0xbde2('0x2a')](0x194);}return _0x366e4b;};}function handleError(_0x53c232,_0x5ed965){_0x5ed965=_0x5ed965||0x1f4;return function(_0x43e3fb){logger[_0xbde2('0x2b')](_0x43e3fb[_0xbde2('0x2c')]);if(_0x43e3fb[_0xbde2('0x2d')]){delete _0x43e3fb[_0xbde2('0x2d')];}_0x53c232[_0xbde2('0x20')](_0x5ed965)[_0xbde2('0x2e')](_0x43e3fb);};}function getInteractionUsers(_0x5cc866,_0x58e697){return new BPromise(function(_0x5222c3,_0x444096){try{if(_0x58e697[_0x5cc866['id']]){_0x5cc866[_0xbde2('0x2f')]=_[_0xbde2('0x30')](_0x58e697[_0x5cc866['id']],function(_0x35df73){return{'id':_0x35df73['id'],'fullname':_0x35df73['fullname']};});}}catch(_0x5dfd0c){_0x444096(_0x5dfd0c);}_0x5222c3(_0x5cc866);});}function getInteractionTags(_0x3df325,_0x54405b){return new BPromise(function(_0x258f50,_0x368f78){try{if(_0x3df325[_0xbde2('0x31')]){_0x3df325[_0xbde2('0x32')]=[];_0x3df325[_0xbde2('0x31')][_0xbde2('0x33')](',')[_0xbde2('0x34')](function(_0x30d829){_0x3df325[_0xbde2('0x32')][_0xbde2('0x35')](_0x54405b[_0x30d829]);});}delete _0x3df325[_0xbde2('0x31')];}catch(_0x23d534){_0x368f78(_0x23d534);}_0x258f50(_0x3df325);});}function updateFaxInteraction(_0x38188c,_0x3a8e1b,_0x3f7b01){return new BPromise(function(_0xe0bd81,_0x185e2f){return getInteractionUsers(_0x38188c,_0x3f7b01)[_0xbde2('0x36')](function(_0x1f3851){return getInteractionTags(_0x1f3851,_0x3a8e1b);})['then'](function(_0x20a173){_0xe0bd81(_0x20a173);})[_0xbde2('0x37')](function(_0x48c2ba){_0x185e2f(_0x48c2ba);});});}exports[_0xbde2('0x38')]=function(_0x592840,_0x397721){var _0x1ac72a={},_0x31016={},_0x35129a={'count':0x0,'rows':[]};var _0x3107f4=_['map'](db[_0xbde2('0x39')]['rawAttributes'],function(_0x117de5){return{'name':_0x117de5[_0xbde2('0x3a')],'type':_0x117de5[_0xbde2('0x3b')][_0xbde2('0x3c')]};});_0x31016['model']=_['map'](_0x3107f4,_0xbde2('0x2d'));_0x31016['query']=_[_0xbde2('0x3d')](_0x592840[_0xbde2('0x3e')]);_0x31016[_0xbde2('0x3f')]=_[_0xbde2('0x40')](_0x31016['model'],_0x31016[_0xbde2('0x3e')]);_0x1ac72a[_0xbde2('0x41')]=_[_0xbde2('0x40')](_0x31016['model'],qs[_0xbde2('0x42')](_0x592840[_0xbde2('0x3e')]['fields']));_0x1ac72a[_0xbde2('0x41')]=_0x1ac72a['attributes'][_0xbde2('0x43')]?_0x1ac72a['attributes']:_0x31016[_0xbde2('0x44')];if(!_0x592840['query'][_0xbde2('0x45')](_0xbde2('0x46'))){_0x1ac72a[_0xbde2('0x47')]=qs[_0xbde2('0x47')](_0x592840[_0xbde2('0x3e')][_0xbde2('0x47')]);_0x1ac72a['offset']=qs[_0xbde2('0x23')](_0x592840[_0xbde2('0x3e')][_0xbde2('0x23')]);}_0x1ac72a[_0xbde2('0x48')]=qs[_0xbde2('0x49')](_0x592840[_0xbde2('0x3e')][_0xbde2('0x49')]);_0x1ac72a[_0xbde2('0x4a')]=qs[_0xbde2('0x3f')](_[_0xbde2('0x4b')](_0x592840[_0xbde2('0x3e')],_0x31016['filters']));var _0x5eb498=[];var _0x49dbc9=squel[_0xbde2('0x4c')]()[_0xbde2('0x4d')]('id')[_0xbde2('0x4d')](_0xbde2('0x2d'))[_0xbde2('0x4d')](_0xbde2('0x4e'))[_0xbde2('0x4f')](_0xbde2('0x50'));var _0x4e526e=squel['select']()[_0xbde2('0x4d')](_0xbde2('0x51'))[_0xbde2('0x4d')]('u.fullname')[_0xbde2('0x4d')](_0xbde2('0x52'))[_0xbde2('0x4f')](_0xbde2('0x53'),'ui')[_0xbde2('0x54')]('users','u',_0xbde2('0x55'));var _0x4e0b0f=squel[_0xbde2('0x4c')]()[_0xbde2('0x4f')](_0xbde2('0x56'),'i')[_0xbde2('0x54')]('cm_contacts','c',_0xbde2('0x57'))[_0xbde2('0x54')](_0xbde2('0x58'),'o','o.id\x20=\x20i.UserId')[_0xbde2('0x54')](_0xbde2('0x59'),'a','a.id\x20=\x20i.FaxAccountId')[_0xbde2('0x54')](_0xbde2('0x5a'),'me',_0xbde2('0x5b'))[_0xbde2('0x54')]('fax_interaction_has_tags','it','it.FaxInteractionId\x20=\x20i.id')[_0xbde2('0x54')](_0xbde2('0x50'),'t',_0xbde2('0x5c'));var _0x2bf9d8=squel[_0xbde2('0x5d')]();var _0x48ae72=[];var _0x4ad713=squel[_0xbde2('0x5d')]();var _0x27bc99;if(_0x592840[_0xbde2('0x3e')]['search']){_0x27bc99=as[_0xbde2('0x5e')](_0x592840[_0xbde2('0x3e')][_0xbde2('0x5f')]);var _0x5d0c1b=_0x27bc99['sqlOperator'];for(var _0x185940=0x0;_0x185940<_0x27bc99[_0xbde2('0x60')][_0xbde2('0x43')];_0x185940++){var _0x13cabc=_0x27bc99[_0xbde2('0x60')][_0x185940];var _0x39daa1='i';var _0x11d8fc=_[_0xbde2('0x61')](_0x3107f4,[_0xbde2('0x2d'),_0x13cabc[_0xbde2('0x4d')]]);if(!_0x11d8fc){switch(_0x13cabc['field']){case _0xbde2('0x62'):if(_0x13cabc[_0xbde2('0x63')]==0x1){_0x4e0b0f[_0xbde2('0x64')]('`'+_0x13cabc['field']+'`\x20=\x200');}else{_0x4e0b0f[_0xbde2('0x64')]('`'+_0x13cabc['field']+'`\x20>\x200');}break;case _0xbde2('0x65'):if(_0x13cabc[_0xbde2('0x66')]===_0xbde2('0x67')){if(_0x13cabc['value'][_0xbde2('0x33')]('\x20')[_0xbde2('0x43')]>0x1){_0x2bf9d8[_0x5d0c1b](_0xbde2('0x68'),qs[_0xbde2('0x69')](_0x13cabc[_0xbde2('0x63')]),null);}else{var _0x7cb80a='%'+_0x13cabc[_0xbde2('0x63')]+'%';_0x2bf9d8[_0x5d0c1b](_0xbde2('0x6a'),_0x7cb80a,_0x7cb80a,_0x7cb80a);}}else{_0x11d8fc=_[_0xbde2('0x61')](_0x3107f4,[_0xbde2('0x2d'),'ContactId']);_0x13cabc['field']=_0xbde2('0x6b');_0x2452d3=as[_0xbde2('0x6c')](_0x39daa1,_0x11d8fc['type'],_0x13cabc);_0x2bf9d8[_0x5d0c1b](_0x2452d3[_0xbde2('0x6d')],_0x2452d3[_0xbde2('0x63')][_0xbde2('0x6e')],_0x2452d3[_0xbde2('0x63')]['end']);}break;case _0xbde2('0x6f'):var _0x5ec7ec=_0x13cabc[_0xbde2('0x63')]['split'](',')['map'](function(_0x1210bd){return Number(_0x1210bd);});_0x5ec7ec[_0xbde2('0x34')](function(_0x2780cc){_0x4ad713['or'](_0xbde2('0x70'),'%,'+_0x2780cc+',%');});_0x48ae72=_[_0xbde2('0x71')](_0x48ae72,_0x5ec7ec);break;case'User':if(_0x13cabc[_0xbde2('0x66')]==='$substring'){_0x2bf9d8[_0x5d0c1b](_0xbde2('0x72'),'%'+_0x13cabc[_0xbde2('0x63')]+'%',null);}else{_0x11d8fc=_['find'](_0x3107f4,[_0xbde2('0x2d'),_0xbde2('0x73')]);_0x13cabc[_0xbde2('0x4d')]=_0xbde2('0x73');_0x2452d3=as[_0xbde2('0x6c')](_0x39daa1,_0x11d8fc[_0xbde2('0x3b')],_0x13cabc);_0x2bf9d8[_0x5d0c1b](_0x2452d3[_0xbde2('0x6d')],_0x2452d3['value'][_0xbde2('0x6e')],_0x2452d3[_0xbde2('0x63')]['end']);}break;case'body':_0x2452d3=as[_0xbde2('0x6c')]('me',null,_0x13cabc);_0x2bf9d8[_0x5d0c1b](_0x2452d3['text'],_0x2452d3[_0xbde2('0x63')][_0xbde2('0x6e')],_0x2452d3[_0xbde2('0x63')][_0xbde2('0x29')]);break;}}else{var _0x2452d3=as['buildExpression'](_0x39daa1,_0x11d8fc[_0xbde2('0x3b')],_0x13cabc);_0x2bf9d8[_0x5d0c1b](_0x2452d3[_0xbde2('0x6d')],_0x2452d3[_0xbde2('0x63')][_0xbde2('0x6e')],_0x2452d3[_0xbde2('0x63')][_0xbde2('0x29')]);}}}else{var _0x360b90=_(_0x592840[_0xbde2('0x3e')])[_0xbde2('0x3d')]()[_0xbde2('0x30')](function(_0x25e7fc){return _[_0xbde2('0x74')](_0x3107f4,[_0xbde2('0x2d'),_0x25e7fc])?_0x25e7fc:undefined;})[_0xbde2('0x75')]()[_0xbde2('0x63')]();if(!_[_0xbde2('0x76')](_0x360b90)){_0x360b90['forEach'](function(_0x55b015){if(_0x55b015===_0xbde2('0x77')){_0x4e0b0f[_0xbde2('0x4a')](_0xbde2('0x78'),[]['concat'](_0x592840['query'][_0x55b015]));}else if(_0x55b015===_0xbde2('0x79')){var _0x343336=JSON[_0xbde2('0x7a')](_0x592840[_0xbde2('0x3e')][_0x55b015])[_0xbde2('0x7b')];var _0x3194bb=JSON[_0xbde2('0x7a')](_0x592840['query'][_0x55b015])[_0xbde2('0x7c')];_0x4e0b0f['where'](_0xbde2('0x7d'),_0x343336,_0x3194bb);}else{if(_0x592840['query'][_0x55b015]===_0xbde2('0x7e')){_0x4e0b0f[_0xbde2('0x4a')]('i.'+_0x55b015+_0xbde2('0x7f'));}else{_0x4e0b0f[_0xbde2('0x4a')]('i.'+_0x55b015+'\x20=\x20?',_0x592840['query'][_0x55b015]);}}});}if(_0x592840[_0xbde2('0x3e')][_0xbde2('0x80')]){if(_0x592840['query'][_0xbde2('0x80')]==0x1){_0x4e0b0f['having']('`unreadMessages`\x20=\x200');}else{_0x4e0b0f['having'](_0xbde2('0x81'));}}if(_0x592840[_0xbde2('0x3e')]['tag']){_0x48ae72=_['isArray'](_0x592840['query'][_0xbde2('0x82')])?_0x592840[_0xbde2('0x3e')][_0xbde2('0x82')]:new Array(_0x592840[_0xbde2('0x3e')][_0xbde2('0x82')]);_0x48ae72[_0xbde2('0x34')](function(_0x256093){_0x4ad713['or'](_0xbde2('0x70'),'%,'+_0x256093+',%');});}if(_0x592840[_0xbde2('0x3e')][_0xbde2('0x83')]){var _0x116800=_0x592840['query'][_0xbde2('0x83')]['replace']('\x5c','\x5c\x5c')['replace']('\x27\x27',_0xbde2('0x84'));if(qs[_0xbde2('0x85')](_0x116800)){_0x2bf9d8['or'](_0xbde2('0x86'),_0x116800+'%')['or']('i.fax\x20LIKE\x20?',_0x116800+'%');}_0x2bf9d8['or'](_0xbde2('0x87'),_0x116800+'%');}}_0x4e0b0f[_0xbde2('0x4a')](_0x2bf9d8);_0x4e0b0f['group'](_0xbde2('0x88'));var _0x3080ea={'type':db[_0xbde2('0x89')][_0xbde2('0x8a')]['SELECT'],'raw':!![]};var _0x51da22=_0x4e0b0f['clone']();_0x51da22[_0xbde2('0x4d')](_0xbde2('0x88'));_0x51da22[_0xbde2('0x4d')](_0xbde2('0x8b'),_0xbde2('0x62'));if(_0x1ac72a[_0xbde2('0x48')]){_0x1ac72a[_0xbde2('0x48')]['forEach'](function(_0x2c72b5){_0x4e0b0f[_0xbde2('0x48')]('i.'+_0x2c72b5[0x0],_0x2c72b5[0x1]===_0xbde2('0x8c')?![]:!![]);});}if(!_[_0xbde2('0x76')](_0x48ae72)){_0x4e0b0f[_0xbde2('0x64')](_0x4ad713);_0x51da22[_0xbde2('0x4a')](_0xbde2('0x8d'),_0x48ae72);}BPromise[_0xbde2('0x8e')]()['then'](function(){if(!_0x27bc99){if(_0x592840[_0xbde2('0x3e')][_0xbde2('0x77')]||_0x592840[_0xbde2('0x3e')][_0xbde2('0x8f')])return;_0x51da22[_0xbde2('0x4a')](_0xbde2('0x90'));_0x4e0b0f[_0xbde2('0x4a')](_0xbde2('0x90'));return;}return _0x592840[_0xbde2('0x91')]['getFaxAccounts']({'attributes':['id'],'raw':!![]})[_0xbde2('0x36')](function(_0x361bbc){if(_[_0xbde2('0x76')](_0x361bbc)){_0x51da22[_0xbde2('0x4a')](_0xbde2('0x92'));_0x4e0b0f[_0xbde2('0x4a')]('i.FaxAccountId\x20IS\x20NULL');}else{_0x51da22[_0xbde2('0x4a')](_0xbde2('0x78'),_[_0xbde2('0x30')](_0x361bbc,'id'));_0x4e0b0f[_0xbde2('0x4a')](_0xbde2('0x78'),_[_0xbde2('0x30')](_0x361bbc,'id'));}});})['then'](function(){db['sequelize'][_0xbde2('0x3e')](_0x51da22[_0xbde2('0x93')](),_0x3080ea)[_0xbde2('0x36')](function(_0x2449f2){_0x35129a[_0xbde2('0x22')]=_0x2449f2[_0xbde2('0x43')];if(_0x35129a[_0xbde2('0x22')]===0x0)return[];return db[_0xbde2('0x94')][_0xbde2('0x3e')](_0x49dbc9[_0xbde2('0x93')](),_0x3080ea)[_0xbde2('0x36')](function(_0x18c29c){_0x5eb498=_[_0xbde2('0x95')](_0x18c29c,'id');_0x3080ea=_[_0xbde2('0x96')](_0x3080ea,{'model':db['FaxInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x592840['query'][_0xbde2('0x42')]){_0x1ac72a['attributes'][_0xbde2('0x34')](function(_0x30cd04){_0x4e0b0f[_0xbde2('0x4d')]('i.'+_0x30cd04);});}else{_0x4e0b0f[_0xbde2('0x4d')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xbde2('0x62'));_0x4e0b0f[_0xbde2('0x4d')]('a.key',_0xbde2('0x97'));_0x4e0b0f['field'](_0xbde2('0x98'),_0xbde2('0x99'));_0x4e0b0f[_0xbde2('0x4d')](_0xbde2('0x9a'));_0x4e0b0f[_0xbde2('0x4d')](_0xbde2('0x9b'),'Contact.firstName');_0x4e0b0f[_0xbde2('0x4d')](_0xbde2('0x9c'),_0xbde2('0x9d'));_0x4e0b0f[_0xbde2('0x4d')](_0xbde2('0x9e'),_0xbde2('0x9f'));_0x4e0b0f[_0xbde2('0x4d')](_0xbde2('0xa0'),_0xbde2('0xa1'));_0x4e0b0f['field'](_0xbde2('0xa2'),_0xbde2('0xa3'));_0x4e0b0f[_0xbde2('0x4d')]('c.fax',_0xbde2('0xa4'));_0x4e0b0f[_0xbde2('0x4d')]('o.fullname',_0xbde2('0xa5'));_0x4e0b0f[_0xbde2('0x4d')](_0xbde2('0xa6'),'Owner.internal');_0x4e0b0f[_0xbde2('0x4d')](_0xbde2('0xa7'),_0xbde2('0x31'));}_0x4e0b0f[_0xbde2('0x47')](_0x1ac72a[_0xbde2('0x47')]);_0x4e0b0f[_0xbde2('0x23')](_0x1ac72a[_0xbde2('0x23')]);return db['sequelize'][_0xbde2('0x3e')](_0x4e0b0f[_0xbde2('0x93')](),_0x3080ea);})[_0xbde2('0x36')](function(_0xcfce62){_0x4e526e['where'](_0xbde2('0xa8'),_[_0xbde2('0x30')](_0xcfce62,'id'));return db[_0xbde2('0x94')]['query'](_0x4e526e[_0xbde2('0x93')](),_0x3080ea)[_0xbde2('0x36')](function(_0xf60aa2){var _0x20fb79=_[_0xbde2('0xa9')](_0xf60aa2,_0xbde2('0xaa'));var _0x52ade6=[];_0xcfce62[_0xbde2('0x34')](function(_0x18be5c){_0x52ade6[_0xbde2('0x35')](updateFaxInteraction(_0x18be5c,_0x5eb498,_0x20fb79));});return BPromise['all'](_0x52ade6);});});})[_0xbde2('0x36')](function(_0xcd3ed1){_0x35129a[_0xbde2('0xab')]=_0xcd3ed1;return _0x35129a;})[_0xbde2('0x36')](respondWithFilteredResult(_0x397721,_0x1ac72a));})[_0xbde2('0x37')](handleError(_0x397721,null));};exports[_0xbde2('0xac')]=function(_0xb4547d,_0x2721fe){var _0x57a909={'raw':![],'where':{'id':_0xb4547d[_0xbde2('0xad')]['id']}},_0x4d95e4={};_0x4d95e4['model']=_[_0xbde2('0x3d')](db[_0xbde2('0x39')]['rawAttributes']);_0x4d95e4[_0xbde2('0x3e')]=_[_0xbde2('0x3d')](_0xb4547d['query']);_0x4d95e4[_0xbde2('0x3f')]=_['intersection'](_0x4d95e4[_0xbde2('0x44')],_0x4d95e4[_0xbde2('0x3e')]);_0x57a909['attributes']=_[_0xbde2('0x40')](_0x4d95e4['model'],qs[_0xbde2('0x42')](_0xb4547d[_0xbde2('0x3e')][_0xbde2('0x42')]));_0x57a909[_0xbde2('0x41')]=_0x57a909['attributes']['length']?_0x57a909[_0xbde2('0x41')]:_0x4d95e4[_0xbde2('0x44')];if(_0xb4547d['query'][_0xbde2('0xae')]){_0x57a909['include']=[{'all':!![]}];}_0x57a909=_[_0xbde2('0x96')]({},_0x57a909,_0xb4547d[_0xbde2('0xaf')]);return db['FaxInteraction'][_0xbde2('0x61')](_0x57a909)[_0xbde2('0x36')](handleEntityNotFound(_0x2721fe,null))[_0xbde2('0x36')](respondWithResult(_0x2721fe,null))[_0xbde2('0x37')](handleError(_0x2721fe,null));};exports[_0xbde2('0xb0')]=function(_0x450923,_0x36b671){return db[_0xbde2('0x39')][_0xbde2('0xb0')](_0x450923[_0xbde2('0xb1')],{})['then'](respondWithResult(_0x36b671,0xc9))[_0xbde2('0x37')](handleError(_0x36b671,null));};exports[_0xbde2('0x28')]=function(_0x4c7dc9,_0x4e29f1){if(_0x4c7dc9[_0xbde2('0xb1')]['id']){delete _0x4c7dc9[_0xbde2('0xb1')]['id'];}return db[_0xbde2('0x39')][_0xbde2('0x61')]({'where':{'id':_0x4c7dc9[_0xbde2('0xad')]['id']}})['then'](handleEntityNotFound(_0x4e29f1,null))[_0xbde2('0x36')](saveUpdates(_0x4c7dc9['body'],null))[_0xbde2('0x36')](respondWithResult(_0x4e29f1,null))['catch'](handleError(_0x4e29f1,null));};exports['destroy']=function(_0x58ac57,_0x49aab2){return db[_0xbde2('0x39')][_0xbde2('0x61')]({'where':{'id':_0x58ac57[_0xbde2('0xad')]['id']}})[_0xbde2('0x36')](handleEntityNotFound(_0x49aab2,null))[_0xbde2('0x36')](removeEntity(_0x49aab2,null))[_0xbde2('0x37')](handleError(_0x49aab2,null));};exports[_0xbde2('0xb2')]=function(_0x5dc6f7,_0x411191){return db['FaxInteraction'][_0xbde2('0xb2')]()[_0xbde2('0x36')](respondWithResult(_0x411191,null))[_0xbde2('0x37')](handleError(_0x411191,null));};exports['addMessage']=function(_0x339a6b,_0x544c1c,_0x122cb0){return db[_0xbde2('0xb3')][_0xbde2('0x61')]({'where':{'id':_0x339a6b[_0xbde2('0xad')]['id']}})[_0xbde2('0x36')](handleEntityNotFound(_0x544c1c,null))[_0xbde2('0x36')](function(_0x1c2181){if(_0x1c2181){return _0x1c2181[_0xbde2('0xb4')](_0x339a6b['body'][_0xbde2('0xb5')],_['omit'](_0x339a6b[_0xbde2('0xb1')],[_0xbde2('0xb5'),'id'])||{});}})[_0xbde2('0x36')](respondWithResult(_0x544c1c,null))[_0xbde2('0x37')](handleError(_0x544c1c,null));};exports[_0xbde2('0xb6')]=function(_0x1537d5,_0x4921f4,_0x1e6cfc){var _0x39afbb={'raw':![],'where':{}};var _0x112ed0={};var _0x170528={'count':0x0,'rows':[]};return db[_0xbde2('0x39')]['findOne']({'where':{'id':_0x1537d5[_0xbde2('0xad')]['id']}})[_0xbde2('0x36')](handleEntityNotFound(_0x4921f4,null))[_0xbde2('0x36')](function(_0x253547){if(_0x253547){_0x112ed0[_0xbde2('0x44')]=_['keys'](db[_0xbde2('0xb3')]['rawAttributes']);_0x112ed0[_0xbde2('0x3e')]=_[_0xbde2('0x3d')](_0x1537d5[_0xbde2('0x3e')]);_0x112ed0['filters']=_[_0xbde2('0x40')](_0x112ed0[_0xbde2('0x44')],_0x112ed0['query']);_0x39afbb[_0xbde2('0x41')]=_[_0xbde2('0x40')](_0x112ed0['model'],qs[_0xbde2('0x42')](_0x1537d5[_0xbde2('0x3e')][_0xbde2('0x42')]));_0x39afbb[_0xbde2('0x41')]=_0x39afbb['attributes'][_0xbde2('0x43')]?_0x39afbb[_0xbde2('0x41')]:_0x112ed0[_0xbde2('0x44')];if(!_0x1537d5[_0xbde2('0x3e')]['hasOwnProperty'](_0xbde2('0x46'))){_0x39afbb[_0xbde2('0x47')]=qs[_0xbde2('0x47')](_0x1537d5[_0xbde2('0x3e')][_0xbde2('0x47')]);_0x39afbb[_0xbde2('0x23')]=qs['offset'](_0x1537d5['query'][_0xbde2('0x23')]);}_0x39afbb[_0xbde2('0x48')]=qs[_0xbde2('0x49')](_0x1537d5[_0xbde2('0x3e')][_0xbde2('0x49')]);_0x39afbb[_0xbde2('0x4a')]=qs['filters'](_['pick'](_0x1537d5[_0xbde2('0x3e')],_0x112ed0[_0xbde2('0x3f')]));_0x39afbb[_0xbde2('0x4a')][_0xbde2('0xaa')]=_0x253547['id'];if(_0x1537d5[_0xbde2('0x3e')][_0xbde2('0x83')]){_0x39afbb[_0xbde2('0x4a')]=_['merge'](_0x39afbb['where'],{'$or':_[_0xbde2('0x30')](_0x39afbb[_0xbde2('0x41')],function(_0x3a49ea){var _0xff43ad={};_0xff43ad[_0x3a49ea]={'$like':'%'+_0x1537d5['query'][_0xbde2('0x83')]+'%'};return _0xff43ad;})});}if(_0x1537d5[_0xbde2('0x3e')][_0xbde2('0x7b')]){var _0x34ea08=_0x1537d5[_0xbde2('0x3e')][_0xbde2('0x7b')][_0xbde2('0x33')](',');var _0xf0e676={};_0xf0e676[_0x34ea08[0x0]]={'$gte':moment(_0x34ea08[0x1])[_0xbde2('0xb7')](_0xbde2('0xb8'))};_0x39afbb[_0xbde2('0x4a')]=_[_0xbde2('0x96')](_0x39afbb[_0xbde2('0x4a')],_0xf0e676);}_0x39afbb=_['merge']({},_0x39afbb,_0x1537d5[_0xbde2('0xaf')]);return db[_0xbde2('0xb3')][_0xbde2('0x22')]({'where':_0x39afbb[_0xbde2('0x4a')]})[_0xbde2('0x36')](function(_0x70e07e){_0x170528[_0xbde2('0x22')]=_0x70e07e;if(_0x1537d5['query'][_0xbde2('0xae')]){_0x39afbb[_0xbde2('0xb9')]=[{'all':!![]}];}return db[_0xbde2('0xb3')][_0xbde2('0xba')](_0x39afbb);})[_0xbde2('0x36')](function(_0x58793d){_0x170528[_0xbde2('0xab')]=_0x58793d;return _0x170528;});}})[_0xbde2('0x36')](respondWithFilteredResult(_0x4921f4,_0x39afbb))[_0xbde2('0x37')](handleError(_0x4921f4,null));};exports['addTags']=function(_0x1efb8b,_0x2cd16f,_0x51bff9){return db[_0xbde2('0x39')][_0xbde2('0x61')]({'where':{'id':_0x1efb8b[_0xbde2('0xad')]['id']}})[_0xbde2('0x36')](handleEntityNotFound(_0x2cd16f,null))[_0xbde2('0x36')](function(_0x4954a3){if(_0x4954a3){return _0x4954a3[_0xbde2('0xbb')](_0x1efb8b[_0xbde2('0xb1')][_0xbde2('0xb5')],_['omit'](_0x1efb8b['body'],['ids','id'])||{})[_0xbde2('0xbc')](function(){return db[_0xbde2('0x6f')][_0xbde2('0xba')]({'attributes':['id','name',_0xbde2('0x4e')],'where':{'id':_0x1efb8b[_0xbde2('0xb1')][_0xbde2('0xb5')]}});})[_0xbde2('0x36')](function(_0x57676e){socket[_0xbde2('0xbd')]('faxInteractionTags:save',{'id':Number(_0x1efb8b[_0xbde2('0xad')]['id']),'tags':_0x57676e||[]});return{'id':Number(_0x1efb8b[_0xbde2('0xad')]['id']),'tags':_0x57676e||[]};});}})[_0xbde2('0x36')](respondWithResult(_0x2cd16f,null))[_0xbde2('0x37')](handleError(_0x2cd16f,null));};exports[_0xbde2('0xbe')]=function(_0x469b71,_0x3f40c0,_0x4fe0ef){return db[_0xbde2('0x39')][_0xbde2('0x61')]({'where':{'id':_0x469b71['params']['id']}})[_0xbde2('0x36')](handleEntityNotFound(_0x3f40c0,null))[_0xbde2('0x36')](function(_0x196d6d){if(_0x196d6d){return _0x196d6d[_0xbde2('0xbe')](_0x469b71['query'][_0xbde2('0xb5')]);}})[_0xbde2('0x36')](respondWithStatusCode(_0x3f40c0,null))[_0xbde2('0x37')](handleError(_0x3f40c0,null));};exports[_0xbde2('0xbf')]=function(_0x3c24e8,_0xfd93da){var _0x46c696=moment()[_0xbde2('0xc0')]()['toString']();var _0x5368ca=path[_0xbde2('0xc1')](config[_0xbde2('0xc2')],'server',_0xbde2('0xc3'),_0xbde2('0xc4'));var _0x4c001d=path[_0xbde2('0xc1')](config[_0xbde2('0xc2')],_0xbde2('0xc5'),_0xbde2('0xc3'),'attachments');var _0x5d5e6c=path['join'](_0x5368ca,_0x46c696);var _0x4d453d=util[_0xbde2('0xb7')](_0xbde2('0xc6'),_0x3c24e8[_0xbde2('0xad')]['id'],_0x46c696);var _0x25193e=path[_0xbde2('0xc1')](_0x5368ca,_0x4d453d);var _0x27fc19=[];_0x27fc19[_0xbde2('0x35')]({'model':db[_0xbde2('0xc7')],'as':_0xbde2('0xc7'),'raw':!![]});var _0x233015=[{'model':db[_0xbde2('0xb3')],'as':_0xbde2('0xc8'),'attributes':['id',_0xbde2('0xb1'),_0xbde2('0x79')],'include':_0x27fc19}];return db[_0xbde2('0x39')][_0xbde2('0x61')]({'where':{'id':_0x3c24e8['params']['id']},'include':_0x233015})[_0xbde2('0x36')](handleEntityNotFound(_0xfd93da,null))['then'](function(_0x220eb0){if(_0x220eb0&&_0x220eb0[_0xbde2('0xc8')]){var _0x6217ae=_0x220eb0[_0xbde2('0xc9')]({'plain':!![]});fs[_0xbde2('0xca')](_0x5d5e6c);for(var _0x358e5a=0x0;_0x358e5a<_0x6217ae[_0xbde2('0xc8')][_0xbde2('0x43')];_0x358e5a++){var _0x3c0bc8=_0x6217ae['Messages'][_0x358e5a][_0xbde2('0xc7')];if(_0x3c0bc8){var _0x41fe07=path['join'](_0x4c001d,_0x3c0bc8[_0xbde2('0xcb')]);if(fs[_0xbde2('0xcc')](_0x41fe07)){fs['createReadStream'](_0x41fe07)[_0xbde2('0xcd')](fs[_0xbde2('0xce')](path['join'](_0x5d5e6c,_0x3c0bc8[_0xbde2('0xcb')])));}}}return BPromise['resolve']()['then'](function(){return new BPromise(function(_0x18fbde,_0x459907){zipdir(_0x5d5e6c,{'saveTo':_0x25193e},function(_0x50bdcc,_0x1c102e){if(_0x50bdcc)return _0x459907(_0x50bdcc);return _0x18fbde(_0x1c102e);});})[_0xbde2('0x36')](function(){return new BPromise(function(_0x120e0d,_0x16d692){rimraf(_0x5d5e6c,function(_0x12203a){if(_0x12203a)_0x16d692(_0x12203a);return _0x120e0d();});});})[_0xbde2('0x36')](function(){return _0xfd93da[_0xbde2('0xbf')](_0x25193e,_0x4d453d,function(_0x181dd0){if(_0x181dd0){console[_0xbde2('0xcf')](_0xbde2('0xd0'),_0x181dd0);}else{fs[_0xbde2('0xd1')](_0x25193e);}});});});}else{return _0xfd93da[_0xbde2('0x2a')](0xc8);}})[_0xbde2('0x37')](handleError(_0xfd93da,null));}; \ No newline at end of file +var _0x125c=['key','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','select','field','from','tools_tags','u.id','u.fullname','ui.FaxInteractionId','user_has_fax_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.FaxAccountId','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','having','`\x20=\x200','Contact','operator','$substring','value','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','UserId','body','some','compact','isEmpty','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','\x27\x27\x27\x27','isNumeric','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','unreadMessages','DESC','resolve','journey','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','FaxInteraction','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','c.email','c.phone','Contact.phone','Contact.mobile','c.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','FaxInteractionId','rows','catch','rawAttributes','includeAll','options','create','describe','addMessage','FaxMessage','params','ids','omit','getMessages','nolimit','pick','format','YYYY-MM-DD\x20HH:mm:ss','include','findAll','addTags','setTags','emit','faxInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','Attachment','Messages','mkdirSync','basename','existsSync','createReadStream','pipe','createWriteStream','log','err','unlinkSync','zip-dir','fast-json-patch','bluebird','mustache','path','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','./faxInteraction.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','update','then','destroy','stack','name','Users','fullname','TagIds','Tags','split','forEach','push','index','map','type'];(function(_0x2bda69,_0xe895b4){var _0x2b83d1=function(_0x3d3692){while(--_0x3d3692){_0x2bda69['push'](_0x2bda69['shift']());}};_0x2b83d1(++_0xe895b4);}(_0x125c,0x9f));var _0xc125=function(_0x4416ef,_0x19105d){_0x4416ef=_0x4416ef-0x0;var _0x235cdd=_0x125c[_0x4416ef];return _0x235cdd;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc125('0x0'));var jsonpatch=require(_0xc125('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc125('0x2'));var Mustache=require(_0xc125('0x3'));var util=require('util');var path=require(_0xc125('0x4'));var sox=require('sox');var csv=require(_0xc125('0x5'));var ejs=require(_0xc125('0x6'));var fs=require('fs');var _=require(_0xc125('0x7'));var squel=require('squel');var crypto=require(_0xc125('0x8'));var jsforce=require('jsforce');var deskjs=require(_0xc125('0x9'));var toCsv=require(_0xc125('0x5'));var querystring=require(_0xc125('0xa'));var Papa=require(_0xc125('0xb'));var Redis=require(_0xc125('0xc'));var authService=require(_0xc125('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xc125('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc125('0xf'))('api');var utils=require('../../config/utils');var config=require(_0xc125('0x10'));var db=require(_0xc125('0x11'))['db'];config[_0xc125('0x12')]=_[_0xc125('0x13')](config[_0xc125('0x12')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xc125('0x14'))[_0xc125('0x15')](socket);function respondWithStatusCode(_0x3c653e,_0x25e83a){_0x25e83a=_0x25e83a||0xcc;return function(_0x6b241e){if(_0x6b241e){return _0x3c653e[_0xc125('0x16')](_0x25e83a);}return _0x3c653e[_0xc125('0x17')](_0x25e83a)[_0xc125('0x18')]();};}function respondWithResult(_0x41cb59,_0x283b8a){_0x283b8a=_0x283b8a||0xc8;return function(_0x57f49a){if(_0x57f49a){return _0x41cb59[_0xc125('0x17')](_0x283b8a)[_0xc125('0x19')](_0x57f49a);}};}function respondWithFilteredResult(_0x3e470d,_0x2eeb88){return function(_0x230e9d){if(_0x230e9d){var _0x12f223=_0x230e9d[_0xc125('0x1a')],_0x3c78f9=_0x2eeb88[_0xc125('0x1b')],_0x16d1d5=_0x2eeb88[_0xc125('0x1b')]+_0x2eeb88[_0xc125('0x1c')],_0x196157;if(_0x16d1d5>=_0x12f223){_0x16d1d5=_0x12f223;_0x196157=0xc8;}else{_0x196157=0xce;}_0x3e470d[_0xc125('0x17')](_0x196157);return _0x3e470d[_0xc125('0x1d')](_0xc125('0x1e'),_0x3c78f9+'-'+_0x16d1d5+'/'+_0x12f223)[_0xc125('0x19')](_0x230e9d);}return null;};}function patchUpdates(_0x27fc7f){return function(_0x959edd){try{jsonpatch['apply'](_0x959edd,_0x27fc7f,!![]);}catch(_0x1558cc){return BPromise[_0xc125('0x1f')](_0x1558cc);}return _0x959edd['save']();};}function saveUpdates(_0x9d8c41,_0x59bcc0){return function(_0x5a029c){if(_0x5a029c){return _0x5a029c[_0xc125('0x20')](_0x9d8c41)[_0xc125('0x21')](function(_0x4edb5d){return _0x4edb5d;});}return null;};}function removeEntity(_0x17828b,_0x377616){return function(_0x1d994c){if(_0x1d994c){return _0x1d994c[_0xc125('0x22')]()['then'](function(){_0x17828b[_0xc125('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2de3db,_0x2d453f){return function(_0x58cf3){if(!_0x58cf3){_0x2de3db[_0xc125('0x16')](0x194);}return _0x58cf3;};}function handleError(_0x3a2485,_0x4135dd){_0x4135dd=_0x4135dd||0x1f4;return function(_0x3215aa){logger['error'](_0x3215aa[_0xc125('0x23')]);if(_0x3215aa[_0xc125('0x24')]){delete _0x3215aa[_0xc125('0x24')];}_0x3a2485['status'](_0x4135dd)['send'](_0x3215aa);};}function getInteractionUsers(_0x38c65d,_0x5ece57){return new BPromise(function(_0x220943,_0x58726e){try{if(_0x5ece57[_0x38c65d['id']]){_0x38c65d[_0xc125('0x25')]=_['map'](_0x5ece57[_0x38c65d['id']],function(_0x573302){return{'id':_0x573302['id'],'fullname':_0x573302[_0xc125('0x26')]};});}}catch(_0x4affcd){_0x58726e(_0x4affcd);}_0x220943(_0x38c65d);});}function getInteractionTags(_0x442bfc,_0x258393){return new BPromise(function(_0xf7e1b2,_0x2019bc){try{if(_0x442bfc[_0xc125('0x27')]){_0x442bfc[_0xc125('0x28')]=[];_0x442bfc['TagIds'][_0xc125('0x29')](',')[_0xc125('0x2a')](function(_0x4d7e68){_0x442bfc[_0xc125('0x28')][_0xc125('0x2b')](_0x258393[_0x4d7e68]);});}delete _0x442bfc[_0xc125('0x27')];}catch(_0x240c95){_0x2019bc(_0x240c95);}_0xf7e1b2(_0x442bfc);});}function updateFaxInteraction(_0x3996c4,_0xc1df04,_0x265c5b){return new BPromise(function(_0x453362,_0x155cae){return getInteractionUsers(_0x3996c4,_0x265c5b)[_0xc125('0x21')](function(_0x38684a){return getInteractionTags(_0x38684a,_0xc1df04);})[_0xc125('0x21')](function(_0x3f72ab){_0x453362(_0x3f72ab);})['catch'](function(_0x11ada1){_0x155cae(_0x11ada1);});});}exports[_0xc125('0x2c')]=function(_0x1868fc,_0x3ec9dd){var _0x1a1207={},_0x212340={},_0x16a9ef={'count':0x0,'rows':[]};var _0x46b4a7=_[_0xc125('0x2d')](db['FaxInteraction']['rawAttributes'],function(_0x52473a){return{'name':_0x52473a['fieldName'],'type':_0x52473a[_0xc125('0x2e')][_0xc125('0x2f')]};});_0x212340['model']=_[_0xc125('0x2d')](_0x46b4a7,_0xc125('0x24'));_0x212340['query']=_[_0xc125('0x30')](_0x1868fc[_0xc125('0x31')]);_0x212340[_0xc125('0x32')]=_[_0xc125('0x33')](_0x212340[_0xc125('0x34')],_0x212340['query']);_0x1a1207['attributes']=_[_0xc125('0x33')](_0x212340['model'],qs['fields'](_0x1868fc['query'][_0xc125('0x35')]));_0x1a1207[_0xc125('0x36')]=_0x1a1207[_0xc125('0x36')][_0xc125('0x37')]?_0x1a1207[_0xc125('0x36')]:_0x212340[_0xc125('0x34')];if(!_0x1868fc[_0xc125('0x31')][_0xc125('0x38')]('nolimit')){_0x1a1207[_0xc125('0x1c')]=qs[_0xc125('0x1c')](_0x1868fc[_0xc125('0x31')][_0xc125('0x1c')]);_0x1a1207[_0xc125('0x1b')]=qs['offset'](_0x1868fc[_0xc125('0x31')][_0xc125('0x1b')]);}_0x1a1207[_0xc125('0x39')]=qs[_0xc125('0x3a')](_0x1868fc['query'][_0xc125('0x3a')]);_0x1a1207[_0xc125('0x3b')]=qs['filters'](_['pick'](_0x1868fc[_0xc125('0x31')],_0x212340['filters']));var _0x249d27=[];var _0x15faef=squel[_0xc125('0x3c')]()[_0xc125('0x3d')]('id')['field'](_0xc125('0x24'))[_0xc125('0x3d')]('color')[_0xc125('0x3e')](_0xc125('0x3f'));var _0x350e2f=squel[_0xc125('0x3c')]()[_0xc125('0x3d')](_0xc125('0x40'))[_0xc125('0x3d')](_0xc125('0x41'))[_0xc125('0x3d')](_0xc125('0x42'))[_0xc125('0x3e')](_0xc125('0x43'),'ui')[_0xc125('0x44')](_0xc125('0x45'),'u',_0xc125('0x46'));var _0x41147b=squel[_0xc125('0x3c')]()['from']('fax_interactions','i')['left_join'](_0xc125('0x47'),'c',_0xc125('0x48'))[_0xc125('0x44')](_0xc125('0x45'),'o',_0xc125('0x49'))[_0xc125('0x44')]('fax_accounts','a',_0xc125('0x4a'))[_0xc125('0x44')]('fax_messages','me',_0xc125('0x4b'))['left_join'](_0xc125('0x4c'),'it',_0xc125('0x4d'))[_0xc125('0x44')](_0xc125('0x3f'),'t',_0xc125('0x4e'));var _0x31d760=squel[_0xc125('0x4f')]();var _0x4cdb0a=[];var _0x227d7a=squel[_0xc125('0x4f')]();var _0x2ce803;if(_0x1868fc[_0xc125('0x31')][_0xc125('0x50')]){_0x2ce803=as[_0xc125('0x51')](_0x1868fc[_0xc125('0x31')][_0xc125('0x50')]);var _0x4b0761=_0x2ce803[_0xc125('0x52')];for(var _0x3c2103=0x0;_0x3c2103<_0x2ce803[_0xc125('0x53')]['length'];_0x3c2103++){var _0x2f44c5=_0x2ce803[_0xc125('0x53')][_0x3c2103];var _0x5d18f5='i';var _0x1d742b=_[_0xc125('0x54')](_0x46b4a7,[_0xc125('0x24'),_0x2f44c5[_0xc125('0x3d')]]);if(!_0x1d742b){switch(_0x2f44c5['field']){case'unreadMessages':if(_0x2f44c5['value']==0x1){_0x41147b[_0xc125('0x55')]('`'+_0x2f44c5['field']+_0xc125('0x56'));}else{_0x41147b[_0xc125('0x55')]('`'+_0x2f44c5[_0xc125('0x3d')]+'`\x20>\x200');}break;case _0xc125('0x57'):if(_0x2f44c5[_0xc125('0x58')]===_0xc125('0x59')){if(_0x2f44c5[_0xc125('0x5a')][_0xc125('0x29')]('\x20')[_0xc125('0x37')]>0x1){_0x31d760[_0x4b0761]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xc125('0x5b')](_0x2f44c5[_0xc125('0x5a')]),null);}else{var _0x4a9910='%'+_0x2f44c5[_0xc125('0x5a')]+'%';_0x31d760[_0x4b0761](_0xc125('0x5c'),_0x4a9910,_0x4a9910,_0x4a9910);}}else{_0x1d742b=_[_0xc125('0x54')](_0x46b4a7,[_0xc125('0x24'),_0xc125('0x5d')]);_0x2f44c5[_0xc125('0x3d')]=_0xc125('0x5d');_0x181aad=as[_0xc125('0x5e')](_0x5d18f5,_0x1d742b['type'],_0x2f44c5);_0x31d760[_0x4b0761](_0x181aad[_0xc125('0x5f')],_0x181aad[_0xc125('0x5a')][_0xc125('0x60')],_0x181aad['value'][_0xc125('0x18')]);}break;case'Tag':var _0x246a70=_0x2f44c5['value'][_0xc125('0x29')](',')[_0xc125('0x2d')](function(_0x60924){return Number(_0x60924);});_0x246a70['forEach'](function(_0x4ced7c){_0x227d7a['or'](_0xc125('0x61'),'%,'+_0x4ced7c+',%');});_0x4cdb0a=_[_0xc125('0x62')](_0x4cdb0a,_0x246a70);break;case _0xc125('0x63'):if(_0x2f44c5['operator']===_0xc125('0x59')){_0x31d760[_0x4b0761]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x2f44c5[_0xc125('0x5a')]+'%',null);}else{_0x1d742b=_[_0xc125('0x54')](_0x46b4a7,[_0xc125('0x24'),_0xc125('0x64')]);_0x2f44c5[_0xc125('0x3d')]=_0xc125('0x64');_0x181aad=as['buildExpression'](_0x5d18f5,_0x1d742b[_0xc125('0x2e')],_0x2f44c5);_0x31d760[_0x4b0761](_0x181aad[_0xc125('0x5f')],_0x181aad[_0xc125('0x5a')][_0xc125('0x60')],_0x181aad[_0xc125('0x5a')][_0xc125('0x18')]);}break;case _0xc125('0x65'):_0x181aad=as[_0xc125('0x5e')]('me',null,_0x2f44c5);_0x31d760[_0x4b0761](_0x181aad['text'],_0x181aad['value'][_0xc125('0x60')],_0x181aad[_0xc125('0x5a')]['end']);break;}}else{var _0x181aad=as[_0xc125('0x5e')](_0x5d18f5,_0x1d742b[_0xc125('0x2e')],_0x2f44c5);_0x31d760[_0x4b0761](_0x181aad[_0xc125('0x5f')],_0x181aad[_0xc125('0x5a')][_0xc125('0x60')],_0x181aad[_0xc125('0x5a')][_0xc125('0x18')]);}}}else{var _0x493103=_(_0x1868fc[_0xc125('0x31')])[_0xc125('0x30')]()['map'](function(_0x3c181e){return _[_0xc125('0x66')](_0x46b4a7,[_0xc125('0x24'),_0x3c181e])?_0x3c181e:undefined;})[_0xc125('0x67')]()['value']();if(!_[_0xc125('0x68')](_0x493103)){_0x493103[_0xc125('0x2a')](function(_0xc42611){if(_0xc42611==='FaxAccountId'){_0x41147b[_0xc125('0x3b')](_0xc125('0x69'),[][_0xc125('0x6a')](_0x1868fc[_0xc125('0x31')][_0xc42611]));}else if(_0xc42611===_0xc125('0x6b')){var _0x22c6d9=JSON[_0xc125('0x6c')](_0x1868fc[_0xc125('0x31')][_0xc42611])[_0xc125('0x6d')];var _0x3d20ce=JSON['parse'](_0x1868fc[_0xc125('0x31')][_0xc42611])[_0xc125('0x6e')];_0x41147b[_0xc125('0x3b')](_0xc125('0x6f'),_0x22c6d9,_0x3d20ce);}else{if(_0x1868fc[_0xc125('0x31')][_0xc42611]===_0xc125('0x70')){_0x41147b[_0xc125('0x3b')]('i.'+_0xc42611+_0xc125('0x71'));}else{_0x41147b[_0xc125('0x3b')]('i.'+_0xc42611+_0xc125('0x72'),_0x1868fc[_0xc125('0x31')][_0xc42611]);}}});}if(_0x1868fc['query'][_0xc125('0x73')]){if(_0x1868fc['query'][_0xc125('0x73')]==0x1){_0x41147b[_0xc125('0x55')](_0xc125('0x74'));}else{_0x41147b[_0xc125('0x55')](_0xc125('0x75'));}}if(_0x1868fc[_0xc125('0x31')][_0xc125('0x76')]){_0x4cdb0a=_['isArray'](_0x1868fc[_0xc125('0x31')]['tag'])?_0x1868fc['query'][_0xc125('0x76')]:new Array(_0x1868fc[_0xc125('0x31')][_0xc125('0x76')]);_0x4cdb0a[_0xc125('0x2a')](function(_0x52d78b){_0x227d7a['or'](_0xc125('0x61'),'%,'+_0x52d78b+',%');});}if(_0x1868fc['query']['filter']){var _0x5f4ff3=_0x1868fc[_0xc125('0x31')][_0xc125('0x77')][_0xc125('0x78')]('\x5c','\x5c\x5c')[_0xc125('0x78')]('\x27\x27',_0xc125('0x79'));if(qs[_0xc125('0x7a')](_0x5f4ff3)){_0x31d760['or']('i.id\x20LIKE\x20?',_0x5f4ff3+'%')['or']('i.fax\x20LIKE\x20?',_0x5f4ff3+'%');}_0x31d760['or'](_0xc125('0x7b'),_0x5f4ff3+'%');}}_0x41147b['where'](_0x31d760);_0x41147b[_0xc125('0x7c')](_0xc125('0x7d'));var _0x11ca2d={'type':db[_0xc125('0x7e')][_0xc125('0x7f')][_0xc125('0x80')],'raw':!![]};var _0x438b1d=_0x41147b[_0xc125('0x81')]();_0x438b1d[_0xc125('0x3d')](_0xc125('0x7d'));_0x438b1d[_0xc125('0x3d')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xc125('0x82'));if(_0x1a1207[_0xc125('0x39')]){_0x1a1207[_0xc125('0x39')]['forEach'](function(_0x2b79ef){_0x41147b[_0xc125('0x39')]('i.'+_0x2b79ef[0x0],_0x2b79ef[0x1]===_0xc125('0x83')?![]:!![]);});}if(!_[_0xc125('0x68')](_0x4cdb0a)){_0x41147b['having'](_0x227d7a);_0x438b1d[_0xc125('0x3b')]('t.id\x20IN\x20?',_0x4cdb0a);}BPromise[_0xc125('0x84')]()[_0xc125('0x21')](function(){if(!_0x2ce803){if(_0x1868fc[_0xc125('0x31')]['FaxAccountId']||_0x1868fc[_0xc125('0x31')][_0xc125('0x85')])return;_0x438b1d[_0xc125('0x3b')]('i.FaxAccountId\x20IS\x20NOT\x20NULL');_0x41147b[_0xc125('0x3b')](_0xc125('0x86'));return;}return _0x1868fc[_0xc125('0x87')][_0xc125('0x88')]({'attributes':['id'],'raw':!![]})[_0xc125('0x21')](function(_0x296bc8){if(_['isEmpty'](_0x296bc8)){_0x438b1d['where'](_0xc125('0x89'));_0x41147b[_0xc125('0x3b')]('i.FaxAccountId\x20IS\x20NULL');}else{_0x438b1d['where'](_0xc125('0x69'),_['map'](_0x296bc8,'id'));_0x41147b[_0xc125('0x3b')](_0xc125('0x69'),_[_0xc125('0x2d')](_0x296bc8,'id'));}});})[_0xc125('0x21')](function(){db[_0xc125('0x8a')][_0xc125('0x31')](_0x438b1d[_0xc125('0x8b')](),_0x11ca2d)['then'](function(_0x4c423f){_0x16a9ef[_0xc125('0x1a')]=_0x4c423f[_0xc125('0x37')];if(_0x16a9ef[_0xc125('0x1a')]===0x0)return[];return db[_0xc125('0x8a')]['query'](_0x15faef['toString'](),_0x11ca2d)['then'](function(_0xe9c472){_0x249d27=_[_0xc125('0x8c')](_0xe9c472,'id');_0x11ca2d=_[_0xc125('0x8d')](_0x11ca2d,{'model':db[_0xc125('0x8e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1868fc[_0xc125('0x31')][_0xc125('0x35')]){_0x1a1207['attributes'][_0xc125('0x2a')](function(_0x26f3a2){_0x41147b['field']('i.'+_0x26f3a2);});}else{_0x41147b['field'](_0xc125('0x8f'),_0xc125('0x82'));_0x41147b[_0xc125('0x3d')](_0xc125('0x90'),'Account.key');_0x41147b['field'](_0xc125('0x91'),_0xc125('0x92'));_0x41147b[_0xc125('0x3d')](_0xc125('0x93'));_0x41147b[_0xc125('0x3d')](_0xc125('0x94'),_0xc125('0x95'));_0x41147b[_0xc125('0x3d')](_0xc125('0x96'),'Contact.lastName');_0x41147b[_0xc125('0x3d')](_0xc125('0x97'),'Contact.email');_0x41147b[_0xc125('0x3d')](_0xc125('0x98'),_0xc125('0x99'));_0x41147b[_0xc125('0x3d')]('c.mobile',_0xc125('0x9a'));_0x41147b[_0xc125('0x3d')](_0xc125('0x9b'),'Contact.fax');_0x41147b[_0xc125('0x3d')]('o.fullname',_0xc125('0x9c'));_0x41147b[_0xc125('0x3d')](_0xc125('0x9d'),_0xc125('0x9e'));_0x41147b[_0xc125('0x3d')](_0xc125('0x9f'),_0xc125('0x27'));}_0x41147b[_0xc125('0x1c')](_0x1a1207[_0xc125('0x1c')]);_0x41147b[_0xc125('0x1b')](_0x1a1207['offset']);return db[_0xc125('0x8a')]['query'](_0x41147b[_0xc125('0x8b')](),_0x11ca2d);})[_0xc125('0x21')](function(_0x50e6fc){_0x350e2f[_0xc125('0x3b')]('ui.FaxInteractionId\x20IN\x20?',_[_0xc125('0x2d')](_0x50e6fc,'id'));return db['sequelize']['query'](_0x350e2f[_0xc125('0x8b')](),_0x11ca2d)[_0xc125('0x21')](function(_0x91061a){var _0x3244cc=_[_0xc125('0xa0')](_0x91061a,_0xc125('0xa1'));var _0x4c1307=[];_0x50e6fc['forEach'](function(_0x3f51f0){_0x4c1307['push'](updateFaxInteraction(_0x3f51f0,_0x249d27,_0x3244cc));});return BPromise['all'](_0x4c1307);});});})[_0xc125('0x21')](function(_0x3b83d6){_0x16a9ef[_0xc125('0xa2')]=_0x3b83d6;return _0x16a9ef;})[_0xc125('0x21')](respondWithFilteredResult(_0x3ec9dd,_0x1a1207));})[_0xc125('0xa3')](handleError(_0x3ec9dd,null));};exports['show']=function(_0x463ee2,_0x274e2b){var _0x14b9b2={'raw':![],'where':{'id':_0x463ee2['params']['id']}},_0x450998={};_0x450998[_0xc125('0x34')]=_['keys'](db[_0xc125('0x8e')][_0xc125('0xa4')]);_0x450998[_0xc125('0x31')]=_['keys'](_0x463ee2['query']);_0x450998[_0xc125('0x32')]=_['intersection'](_0x450998[_0xc125('0x34')],_0x450998[_0xc125('0x31')]);_0x14b9b2['attributes']=_[_0xc125('0x33')](_0x450998[_0xc125('0x34')],qs[_0xc125('0x35')](_0x463ee2[_0xc125('0x31')]['fields']));_0x14b9b2[_0xc125('0x36')]=_0x14b9b2['attributes'][_0xc125('0x37')]?_0x14b9b2['attributes']:_0x450998[_0xc125('0x34')];if(_0x463ee2[_0xc125('0x31')][_0xc125('0xa5')]){_0x14b9b2['include']=[{'all':!![]}];}_0x14b9b2=_[_0xc125('0x8d')]({},_0x14b9b2,_0x463ee2[_0xc125('0xa6')]);return db[_0xc125('0x8e')][_0xc125('0x54')](_0x14b9b2)[_0xc125('0x21')](handleEntityNotFound(_0x274e2b,null))[_0xc125('0x21')](respondWithResult(_0x274e2b,null))[_0xc125('0xa3')](handleError(_0x274e2b,null));};exports[_0xc125('0xa7')]=function(_0x3d1c5a,_0x30660f){return db['FaxInteraction']['create'](_0x3d1c5a[_0xc125('0x65')],{})['then'](respondWithResult(_0x30660f,0xc9))[_0xc125('0xa3')](handleError(_0x30660f,null));};exports[_0xc125('0x20')]=function(_0x1f3e90,_0x171f6e){if(_0x1f3e90[_0xc125('0x65')]['id']){delete _0x1f3e90[_0xc125('0x65')]['id'];}return db['FaxInteraction'][_0xc125('0x54')]({'where':{'id':_0x1f3e90['params']['id']}})[_0xc125('0x21')](handleEntityNotFound(_0x171f6e,null))['then'](saveUpdates(_0x1f3e90['body'],null))['then'](respondWithResult(_0x171f6e,null))[_0xc125('0xa3')](handleError(_0x171f6e,null));};exports['destroy']=function(_0x25ef14,_0x26ef84){return db[_0xc125('0x8e')][_0xc125('0x54')]({'where':{'id':_0x25ef14['params']['id']}})[_0xc125('0x21')](handleEntityNotFound(_0x26ef84,null))['then'](removeEntity(_0x26ef84,null))['catch'](handleError(_0x26ef84,null));};exports[_0xc125('0xa8')]=function(_0x25fc37,_0xb0351d){return db['FaxInteraction'][_0xc125('0xa8')]()[_0xc125('0x21')](respondWithResult(_0xb0351d,null))[_0xc125('0xa3')](handleError(_0xb0351d,null));};exports[_0xc125('0xa9')]=function(_0x5e88ac,_0x22c6ba,_0x3e4c09){return db[_0xc125('0xaa')][_0xc125('0x54')]({'where':{'id':_0x5e88ac[_0xc125('0xab')]['id']}})['then'](handleEntityNotFound(_0x22c6ba,null))[_0xc125('0x21')](function(_0x2277b1){if(_0x2277b1){return _0x2277b1['addMessage'](_0x5e88ac[_0xc125('0x65')][_0xc125('0xac')],_[_0xc125('0xad')](_0x5e88ac[_0xc125('0x65')],[_0xc125('0xac'),'id'])||{});}})[_0xc125('0x21')](respondWithResult(_0x22c6ba,null))[_0xc125('0xa3')](handleError(_0x22c6ba,null));};exports[_0xc125('0xae')]=function(_0x1cd846,_0x579842,_0x5ddc87){var _0x9d7c69={'raw':![],'where':{}};var _0x18a462={};var _0x1b43e6={'count':0x0,'rows':[]};return db['FaxInteraction']['findOne']({'where':{'id':_0x1cd846[_0xc125('0xab')]['id']}})['then'](handleEntityNotFound(_0x579842,null))[_0xc125('0x21')](function(_0x5b126e){if(_0x5b126e){_0x18a462['model']=_[_0xc125('0x30')](db[_0xc125('0xaa')]['rawAttributes']);_0x18a462[_0xc125('0x31')]=_[_0xc125('0x30')](_0x1cd846['query']);_0x18a462[_0xc125('0x32')]=_[_0xc125('0x33')](_0x18a462[_0xc125('0x34')],_0x18a462[_0xc125('0x31')]);_0x9d7c69['attributes']=_[_0xc125('0x33')](_0x18a462[_0xc125('0x34')],qs[_0xc125('0x35')](_0x1cd846[_0xc125('0x31')][_0xc125('0x35')]));_0x9d7c69[_0xc125('0x36')]=_0x9d7c69[_0xc125('0x36')][_0xc125('0x37')]?_0x9d7c69[_0xc125('0x36')]:_0x18a462[_0xc125('0x34')];if(!_0x1cd846[_0xc125('0x31')][_0xc125('0x38')](_0xc125('0xaf'))){_0x9d7c69['limit']=qs[_0xc125('0x1c')](_0x1cd846['query'][_0xc125('0x1c')]);_0x9d7c69[_0xc125('0x1b')]=qs['offset'](_0x1cd846['query'][_0xc125('0x1b')]);}_0x9d7c69['order']=qs['sort'](_0x1cd846[_0xc125('0x31')][_0xc125('0x3a')]);_0x9d7c69['where']=qs[_0xc125('0x32')](_[_0xc125('0xb0')](_0x1cd846[_0xc125('0x31')],_0x18a462['filters']));_0x9d7c69[_0xc125('0x3b')][_0xc125('0xa1')]=_0x5b126e['id'];if(_0x1cd846[_0xc125('0x31')][_0xc125('0x77')]){_0x9d7c69[_0xc125('0x3b')]=_['merge'](_0x9d7c69[_0xc125('0x3b')],{'$or':_[_0xc125('0x2d')](_0x9d7c69[_0xc125('0x36')],function(_0x3855c1){var _0x434958={};_0x434958[_0x3855c1]={'$like':'%'+_0x1cd846[_0xc125('0x31')][_0xc125('0x77')]+'%'};return _0x434958;})});}if(_0x1cd846['query']['$gte']){var _0x3f66fc=_0x1cd846[_0xc125('0x31')][_0xc125('0x6d')][_0xc125('0x29')](',');var _0x1c58c7={};_0x1c58c7[_0x3f66fc[0x0]]={'$gte':moment(_0x3f66fc[0x1])[_0xc125('0xb1')](_0xc125('0xb2'))};_0x9d7c69[_0xc125('0x3b')]=_[_0xc125('0x8d')](_0x9d7c69['where'],_0x1c58c7);}_0x9d7c69=_['merge']({},_0x9d7c69,_0x1cd846[_0xc125('0xa6')]);return db[_0xc125('0xaa')][_0xc125('0x1a')]({'where':_0x9d7c69[_0xc125('0x3b')]})[_0xc125('0x21')](function(_0x19e788){_0x1b43e6[_0xc125('0x1a')]=_0x19e788;if(_0x1cd846[_0xc125('0x31')][_0xc125('0xa5')]){_0x9d7c69[_0xc125('0xb3')]=[{'all':!![]}];}return db[_0xc125('0xaa')][_0xc125('0xb4')](_0x9d7c69);})[_0xc125('0x21')](function(_0xfc1dc7){_0x1b43e6[_0xc125('0xa2')]=_0xfc1dc7;return _0x1b43e6;});}})[_0xc125('0x21')](respondWithFilteredResult(_0x579842,_0x9d7c69))[_0xc125('0xa3')](handleError(_0x579842,null));};exports[_0xc125('0xb5')]=function(_0x4e0070,_0x2f930f,_0x3ef8a9){return db[_0xc125('0x8e')][_0xc125('0x54')]({'where':{'id':_0x4e0070['params']['id']}})[_0xc125('0x21')](handleEntityNotFound(_0x2f930f,null))[_0xc125('0x21')](function(_0x2bc494){if(_0x2bc494){return _0x2bc494[_0xc125('0xb6')](_0x4e0070[_0xc125('0x65')][_0xc125('0xac')],_[_0xc125('0xad')](_0x4e0070[_0xc125('0x65')],[_0xc125('0xac'),'id'])||{})['spread'](function(){return db['Tag'][_0xc125('0xb4')]({'attributes':['id','name','color'],'where':{'id':_0x4e0070[_0xc125('0x65')][_0xc125('0xac')]}});})[_0xc125('0x21')](function(_0xd87fb8){socket[_0xc125('0xb7')](_0xc125('0xb8'),{'id':Number(_0x4e0070['params']['id']),'tags':_0xd87fb8||[]});return{'id':Number(_0x4e0070[_0xc125('0xab')]['id']),'tags':_0xd87fb8||[]};});}})[_0xc125('0x21')](respondWithResult(_0x2f930f,null))['catch'](handleError(_0x2f930f,null));};exports[_0xc125('0xb9')]=function(_0x3e2140,_0x9a2e56,_0x3d3506){return db['FaxInteraction']['find']({'where':{'id':_0x3e2140[_0xc125('0xab')]['id']}})[_0xc125('0x21')](handleEntityNotFound(_0x9a2e56,null))[_0xc125('0x21')](function(_0xefa812){if(_0xefa812){return _0xefa812['removeTags'](_0x3e2140[_0xc125('0x31')]['ids']);}})[_0xc125('0x21')](respondWithStatusCode(_0x9a2e56,null))[_0xc125('0xa3')](handleError(_0x9a2e56,null));};exports[_0xc125('0xba')]=function(_0x5745be,_0x1f705c){var _0x2cd49b=moment()[_0xc125('0xbb')]()[_0xc125('0x8b')]();var _0x2643e7=path[_0xc125('0xbc')](config[_0xc125('0xbd')],_0xc125('0xbe'),_0xc125('0xbf'),_0xc125('0xc0'));var _0x26d5f2=path[_0xc125('0xbc')](config[_0xc125('0xbd')],_0xc125('0xbe'),_0xc125('0xbf'),_0xc125('0xc1'));var _0x5410e5=path[_0xc125('0xbc')](_0x2643e7,_0x2cd49b);var _0x528d2e=util['format'](_0xc125('0xc2'),_0x5745be[_0xc125('0xab')]['id'],_0x2cd49b);var _0x13c68a=path[_0xc125('0xbc')](_0x2643e7,_0x528d2e);var _0x9daddd=[];_0x9daddd[_0xc125('0x2b')]({'model':db[_0xc125('0xc3')],'as':_0xc125('0xc3'),'raw':!![]});var _0x4da07b=[{'model':db[_0xc125('0xaa')],'as':_0xc125('0xc4'),'attributes':['id',_0xc125('0x65'),_0xc125('0x6b')],'include':_0x9daddd}];return db[_0xc125('0x8e')][_0xc125('0x54')]({'where':{'id':_0x5745be['params']['id']},'include':_0x4da07b})['then'](handleEntityNotFound(_0x1f705c,null))['then'](function(_0xba136c){if(_0xba136c&&_0xba136c[_0xc125('0xc4')]){var _0x519d5f=_0xba136c['get']({'plain':!![]});fs[_0xc125('0xc5')](_0x5410e5);for(var _0x30099d=0x0;_0x30099d<_0x519d5f[_0xc125('0xc4')][_0xc125('0x37')];_0x30099d++){var _0x2857fd=_0x519d5f[_0xc125('0xc4')][_0x30099d][_0xc125('0xc3')];if(_0x2857fd){var _0x3756bf=path[_0xc125('0xbc')](_0x26d5f2,_0x2857fd[_0xc125('0xc6')]);if(fs[_0xc125('0xc7')](_0x3756bf)){fs[_0xc125('0xc8')](_0x3756bf)[_0xc125('0xc9')](fs[_0xc125('0xca')](path[_0xc125('0xbc')](_0x5410e5,_0x2857fd[_0xc125('0xc6')])));}}}return BPromise[_0xc125('0x84')]()[_0xc125('0x21')](function(){return new BPromise(function(_0x59d8cc,_0x43c14c){zipdir(_0x5410e5,{'saveTo':_0x13c68a},function(_0x3feae6,_0x1258ee){if(_0x3feae6)return _0x43c14c(_0x3feae6);return _0x59d8cc(_0x1258ee);});})[_0xc125('0x21')](function(){return new BPromise(function(_0x5bccf1,_0x20c9ba){rimraf(_0x5410e5,function(_0x28fd7e){if(_0x28fd7e)_0x20c9ba(_0x28fd7e);return _0x5bccf1();});});})[_0xc125('0x21')](function(){return _0x1f705c[_0xc125('0xba')](_0x13c68a,_0x528d2e,function(_0x51544a){if(_0x51544a){console[_0xc125('0xcb')](_0xc125('0xcc'),_0x51544a);}else{fs[_0xc125('0xcd')](_0x13c68a);}});});});}else{return _0x1f705c[_0xc125('0x16')](0xc8);}})[_0xc125('0xa3')](handleError(_0x1f705c,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index ec5d080..6006a0c 100644 --- a/server/api/faxInteraction/faxInteraction.events.js +++ b/server/api/faxInteraction/faxInteraction.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x814b=['then','Users','map','findAll','setDataValue','unreadMessages','length','emit','hasOwnProperty','exports','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','update','remove'];(function(_0x4a1b94,_0x1472b5){var _0x125a56=function(_0xebea60){while(--_0xebea60){_0x4a1b94['push'](_0x4a1b94['shift']());}};_0x125a56(++_0x1472b5);}(_0x814b,0x1a2));var _0xb814=function(_0x169e53,_0x46be55){_0x169e53=_0x169e53-0x0;var _0x252bb3=_0x814b[_0x169e53];return _0x252bb3;};'use strict';var EventEmitter=require(_0xb814('0x0'));var FaxInteraction=require(_0xb814('0x1'))['db'][_0xb814('0x2')];var FaxMessage=require(_0xb814('0x1'))['db'][_0xb814('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xb814('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb814('0x5'),'afterDestroy':_0xb814('0x6')};function emitEvent(_0x258866){return function(_0x4237bc,_0x44931c,_0x322a70){_0x4237bc['getUsers']({'attributes':['id'],'raw':!![]})[_0xb814('0x7')](function(_0x2e6272){_0x4237bc['setDataValue'](_0xb814('0x8'),_0x2e6272[_0xb814('0x9')](function(_0x186d5a){return{'id':_0x186d5a['id']};}));return FaxMessage[_0xb814('0xa')]({'where':{'FaxInteractionId':_0x4237bc['id'],'direction':'in','read':![]},'raw':!![]});})[_0xb814('0x7')](function(_0x21d4a5){_0x4237bc[_0xb814('0xb')](_0xb814('0xc'),_0x21d4a5[_0xb814('0xd')]);FaxInteractionEvents[_0xb814('0xe')](_0x258866+':'+_0x4237bc['id'],_0x4237bc);FaxInteractionEvents[_0xb814('0xe')](_0x258866,_0x4237bc);_0x322a70(null);})['catch'](_0x322a70(null));};}for(var e in events){if(events[_0xb814('0xf')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0xb814('0x10')]=FaxInteractionEvents; \ No newline at end of file +var _0xc4aa=['unreadMessages','length','emit','hasOwnProperty','exports','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','getUsers','then','setDataValue','findAll'];(function(_0x238671,_0x34aea0){var _0x474844=function(_0x26cab4){while(--_0x26cab4){_0x238671['push'](_0x238671['shift']());}};_0x474844(++_0x34aea0);}(_0xc4aa,0x1b7));var _0xac4a=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xc4aa[_0xfae23b];return _0x200640;};'use strict';var EventEmitter=require(_0xac4a('0x0'));var FaxInteraction=require(_0xac4a('0x1'))['db'][_0xac4a('0x2')];var FaxMessage=require(_0xac4a('0x1'))['db'][_0xac4a('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xac4a('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2f48ed){return function(_0x15b967,_0x730a38,_0x215f39){_0x15b967[_0xac4a('0x5')]({'attributes':['id'],'raw':!![]})[_0xac4a('0x6')](function(_0x3ef77c){_0x15b967[_0xac4a('0x7')]('Users',_0x3ef77c['map'](function(_0x1aba6d){return{'id':_0x1aba6d['id']};}));return FaxMessage[_0xac4a('0x8')]({'where':{'FaxInteractionId':_0x15b967['id'],'direction':'in','read':![]},'raw':!![]});})[_0xac4a('0x6')](function(_0x4f4146){_0x15b967[_0xac4a('0x7')](_0xac4a('0x9'),_0x4f4146[_0xac4a('0xa')]);FaxInteractionEvents['emit'](_0x2f48ed+':'+_0x15b967['id'],_0x15b967);FaxInteractionEvents[_0xac4a('0xb')](_0x2f48ed,_0x15b967);_0x215f39(null);})['catch'](_0x215f39(null));};}for(var e in events){if(events[_0xac4a('0xc')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0xac4a('0xd')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index eefe67e..53f4613 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 _0x8c21=['./faxInteraction.attributes','define','FaxInteraction','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','path','rimraf'];(function(_0x4f561f,_0x369777){var _0x4b18b1=function(_0x12a7b4){while(--_0x12a7b4){_0x4f561f['push'](_0x4f561f['shift']());}};_0x4b18b1(++_0x369777);}(_0x8c21,0x78));var _0x18c2=function(_0x572ff8,_0x554866){_0x572ff8=_0x572ff8-0x0;var _0x2ecee5=_0x8c21[_0x572ff8];return _0x2ecee5;};'use strict';var _=require(_0x18c2('0x0'));var util=require(_0x18c2('0x1'));var logger=require(_0x18c2('0x2'))('api');var moment=require(_0x18c2('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x18c2('0x4'));var rimraf=require(_0x18c2('0x5'));var config=require('../../config/environment');var attributes=require(_0x18c2('0x6'));module['exports']=function(_0x39ad63,_0x209207){return _0x39ad63[_0x18c2('0x7')](_0x18c2('0x8'),attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x520dcf,_0xe889eb,_0x1ca4df){if(_0x520dcf[_0x18c2('0x9')](_0x18c2('0xa'))){_0x520dcf[_0x18c2('0xb')]=moment()[_0x18c2('0xc')](_0x18c2('0xd'));}_0x1ca4df(null,_0x520dcf);}}});}; \ No newline at end of file +var _0x1f63=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxInteraction.attributes','exports','define','FaxInteraction','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0x1f63,0x176));var _0x31f6=function(_0x29cd03,_0x48a8d1){_0x29cd03=_0x29cd03-0x0;var _0x1d345d=_0x1f63[_0x29cd03];return _0x1d345d;};'use strict';var _=require(_0x31f6('0x0'));var util=require(_0x31f6('0x1'));var logger=require('../../config/logger')(_0x31f6('0x2'));var moment=require(_0x31f6('0x3'));var BPromise=require(_0x31f6('0x4'));var rp=require(_0x31f6('0x5'));var fs=require('fs');var path=require(_0x31f6('0x6'));var rimraf=require(_0x31f6('0x7'));var config=require(_0x31f6('0x8'));var attributes=require(_0x31f6('0x9'));module[_0x31f6('0xa')]=function(_0x5c91e4,_0x599f36){return _0x5c91e4[_0x31f6('0xb')](_0x31f6('0xc'),attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4a024e,_0x186132,_0x5ca024){if(_0x4a024e[_0x31f6('0xd')](_0x31f6('0xe'))){_0x4a024e['closedAt']=moment()[_0x31f6('0xf')](_0x31f6('0x10'));}_0x5ca024(null,_0x4a024e);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index ddefdab..c5a06f5 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 _0x4b1c=['debug','FaxInteraction,\x20%s,\x20%s,\x20%s','code','error','message','catch','FaxInteraction','update','body','options','raw','where','attributes','limit','UpdateFaxInteraction','stringify','AddTagsToFaxInteraction','find','addTags','ids','omit','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','redis','defaults','localhost','./faxInteraction.socket','register','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4b1c,0xbe));var _0xc4b1=function(_0x3687c9,_0x503796){_0x3687c9=_0x3687c9-0x0;var _0x238b39=_0x4b1c[_0x3687c9];return _0x238b39;};'use strict';var _=require(_0xc4b1('0x0'));var util=require(_0xc4b1('0x1'));var moment=require(_0xc4b1('0x2'));var BPromise=require(_0xc4b1('0x3'));var rs=require(_0xc4b1('0x4'));var fs=require('fs');var Redis=require(_0xc4b1('0x5'));var db=require(_0xc4b1('0x6'))['db'];var utils=require(_0xc4b1('0x7'));var logger=require(_0xc4b1('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc4b1('0x9'));var client=jayson['client'][_0xc4b1('0xa')]({'port':0x232a});config[_0xc4b1('0xb')]=_[_0xc4b1('0xc')](config[_0xc4b1('0xb')],{'host':_0xc4b1('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc4b1('0xb')]));require(_0xc4b1('0xe'))[_0xc4b1('0xf')](socket);function respondWithRpcPromise(_0x17d002,_0x478be8,_0x4db6f3){return new BPromise(function(_0x4bc19a,_0x1647e4){return client['request'](_0x17d002,_0x4db6f3)[_0xc4b1('0x10')](function(_0x3c4d39){logger[_0xc4b1('0x11')](_0xc4b1('0x12'),_0x478be8,_0xc4b1('0x13'));logger[_0xc4b1('0x14')](_0xc4b1('0x15'),_0x478be8,_0xc4b1('0x13'),JSON['stringify'](_0x3c4d39));if(_0x3c4d39['error']){if(_0x3c4d39['error'][_0xc4b1('0x16')]===0x1f4){logger[_0xc4b1('0x17')](_0xc4b1('0x12'),_0x478be8,_0x3c4d39[_0xc4b1('0x17')][_0xc4b1('0x18')]);return _0x1647e4(_0x3c4d39[_0xc4b1('0x17')][_0xc4b1('0x18')]);}logger[_0xc4b1('0x17')](_0xc4b1('0x12'),_0x478be8,_0x3c4d39[_0xc4b1('0x17')][_0xc4b1('0x18')]);return _0x4bc19a(_0x3c4d39['error'][_0xc4b1('0x18')]);}else{logger[_0xc4b1('0x11')](_0xc4b1('0x12'),_0x478be8,_0xc4b1('0x13'));_0x4bc19a(_0x3c4d39['result'][_0xc4b1('0x18')]);}})[_0xc4b1('0x19')](function(_0x3c3d4b){logger[_0xc4b1('0x17')]('FaxInteraction,\x20%s,\x20%s',_0x478be8,_0x3c3d4b);_0x1647e4(_0x3c3d4b);});});}exports['UpdateFaxInteraction']=function(_0x119538){var _0x5ca9a1=this;return new Promise(function(_0x37ca6a,_0x1fd38c){return db[_0xc4b1('0x1a')][_0xc4b1('0x1b')](_0x119538[_0xc4b1('0x1c')],{'raw':_0x119538[_0xc4b1('0x1d')]?_0x119538['options'][_0xc4b1('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x119538[_0xc4b1('0x1d')]?_0x119538[_0xc4b1('0x1d')][_0xc4b1('0x1f')]||null:null,'attributes':_0x119538[_0xc4b1('0x1d')]?_0x119538[_0xc4b1('0x1d')][_0xc4b1('0x20')]||null:null,'limit':_0x119538[_0xc4b1('0x1d')]?_0x119538[_0xc4b1('0x1d')][_0xc4b1('0x21')]||null:null})['then'](function(_0x4d0557){logger[_0xc4b1('0x11')](_0xc4b1('0x22'),_0x119538);logger[_0xc4b1('0x14')]('UpdateFaxInteraction',_0x119538,JSON[_0xc4b1('0x23')](_0x4d0557));_0x37ca6a(_0x4d0557);})[_0xc4b1('0x19')](function(_0x205ef5){logger[_0xc4b1('0x17')]('UpdateFaxInteraction',_0x205ef5[_0xc4b1('0x18')],_0x119538);_0x1fd38c(_0x5ca9a1[_0xc4b1('0x17')](0x1f4,_0x205ef5[_0xc4b1('0x18')]));});});};exports[_0xc4b1('0x24')]=function(_0x5ae3f4){return new Promise(function(_0x359afa,_0x4d704c){return db['FaxInteraction'][_0xc4b1('0x25')]({'where':_0x5ae3f4[_0xc4b1('0x1d')]?_0x5ae3f4[_0xc4b1('0x1d')][_0xc4b1('0x1f')]||null:null})[_0xc4b1('0x10')](function(_0x1cf1c7){if(_0x1cf1c7){return _0x1cf1c7[_0xc4b1('0x26')](_0x5ae3f4[_0xc4b1('0x1c')][_0xc4b1('0x27')],_[_0xc4b1('0x28')](_0x5ae3f4[_0xc4b1('0x1c')],[_0xc4b1('0x27'),'id'])||{});}})['spread'](function(_0x21d04c){logger['info'](_0xc4b1('0x29'),_0x5ae3f4);logger[_0xc4b1('0x14')](_0xc4b1('0x29'),_0x5ae3f4,JSON[_0xc4b1('0x23')](_0x21d04c));_0x359afa(_0x21d04c);})['catch'](function(_0x4446db){logger[_0xc4b1('0x17')](_0xc4b1('0x29'),_0x4446db['message'],_0x5ae3f4);_0x4d704c(_this['error'](0x1f4,_0x4446db[_0xc4b1('0x18')]));});});}; \ No newline at end of file +var _0xd7b4=['FaxInteraction,\x20%s,\x20%s','FaxInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateFaxInteraction','FaxInteraction','options','where','attributes','then','debug','AddTagsToFaxInteraction','find','body','ids','omit','spread','AddTags','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','register','info'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd7b4,0xda));var _0x4d7b=function(_0x181dfe,_0xf84557){_0x181dfe=_0x181dfe-0x0;var _0x40c38f=_0xd7b4[_0x181dfe];return _0x40c38f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4d7b('0x0'));var BPromise=require(_0x4d7b('0x1'));var rs=require(_0x4d7b('0x2'));var fs=require('fs');var Redis=require(_0x4d7b('0x3'));var db=require(_0x4d7b('0x4'))['db'];var utils=require(_0x4d7b('0x5'));var logger=require(_0x4d7b('0x6'))(_0x4d7b('0x7'));var config=require(_0x4d7b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x4d7b('0x9')][_0x4d7b('0xa')]({'port':0x232a});config[_0x4d7b('0xb')]=_['defaults'](config[_0x4d7b('0xb')],{'host':_0x4d7b('0xc'),'port':0x18eb});var socket=require(_0x4d7b('0xd'))(new Redis(config[_0x4d7b('0xb')]));require('./faxInteraction.socket')[_0x4d7b('0xe')](socket);function respondWithRpcPromise(_0x480a35,_0x304b88,_0x5a9d90){return new BPromise(function(_0x263b7a,_0xb06898){return client['request'](_0x480a35,_0x5a9d90)['then'](function(_0x518413){logger[_0x4d7b('0xf')](_0x4d7b('0x10'),_0x304b88,'request\x20sent');logger['debug'](_0x4d7b('0x11'),_0x304b88,_0x4d7b('0x12'),JSON[_0x4d7b('0x13')](_0x518413));if(_0x518413['error']){if(_0x518413[_0x4d7b('0x14')][_0x4d7b('0x15')]===0x1f4){logger[_0x4d7b('0x14')](_0x4d7b('0x10'),_0x304b88,_0x518413[_0x4d7b('0x14')][_0x4d7b('0x16')]);return _0xb06898(_0x518413[_0x4d7b('0x14')]['message']);}logger[_0x4d7b('0x14')]('FaxInteraction,\x20%s,\x20%s',_0x304b88,_0x518413[_0x4d7b('0x14')][_0x4d7b('0x16')]);return _0x263b7a(_0x518413['error']['message']);}else{logger[_0x4d7b('0xf')](_0x4d7b('0x10'),_0x304b88,_0x4d7b('0x12'));_0x263b7a(_0x518413[_0x4d7b('0x17')][_0x4d7b('0x16')]);}})[_0x4d7b('0x18')](function(_0x11f6d3){logger[_0x4d7b('0x14')](_0x4d7b('0x10'),_0x304b88,_0x11f6d3);_0xb06898(_0x11f6d3);});});}exports[_0x4d7b('0x19')]=function(_0x1ed76b){var _0x528d63=this;return new Promise(function(_0x438844,_0xa78945){return db[_0x4d7b('0x1a')]['update'](_0x1ed76b['body'],{'raw':_0x1ed76b[_0x4d7b('0x1b')]?_0x1ed76b[_0x4d7b('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ed76b['options']?_0x1ed76b['options'][_0x4d7b('0x1c')]||null:null,'attributes':_0x1ed76b[_0x4d7b('0x1b')]?_0x1ed76b[_0x4d7b('0x1b')][_0x4d7b('0x1d')]||null:null,'limit':_0x1ed76b['options']?_0x1ed76b[_0x4d7b('0x1b')]['limit']||null:null})[_0x4d7b('0x1e')](function(_0x1eb91b){logger[_0x4d7b('0xf')](_0x4d7b('0x19'),_0x1ed76b);logger[_0x4d7b('0x1f')](_0x4d7b('0x19'),_0x1ed76b,JSON['stringify'](_0x1eb91b));_0x438844(_0x1eb91b);})[_0x4d7b('0x18')](function(_0x2d61f1){logger[_0x4d7b('0x14')](_0x4d7b('0x19'),_0x2d61f1['message'],_0x1ed76b);_0xa78945(_0x528d63[_0x4d7b('0x14')](0x1f4,_0x2d61f1[_0x4d7b('0x16')]));});});};exports[_0x4d7b('0x20')]=function(_0x3ec216){return new Promise(function(_0x31f051,_0x5d9b97){return db[_0x4d7b('0x1a')][_0x4d7b('0x21')]({'where':_0x3ec216[_0x4d7b('0x1b')]?_0x3ec216[_0x4d7b('0x1b')]['where']||null:null})[_0x4d7b('0x1e')](function(_0x2b6a49){if(_0x2b6a49){return _0x2b6a49['addTags'](_0x3ec216[_0x4d7b('0x22')][_0x4d7b('0x23')],_[_0x4d7b('0x24')](_0x3ec216[_0x4d7b('0x22')],[_0x4d7b('0x23'),'id'])||{});}})[_0x4d7b('0x25')](function(_0x157064){logger[_0x4d7b('0xf')](_0x4d7b('0x26'),_0x3ec216);logger[_0x4d7b('0x1f')](_0x4d7b('0x26'),_0x3ec216,JSON[_0x4d7b('0x13')](_0x157064));_0x31f051(_0x157064);})[_0x4d7b('0x18')](function(_0x1268e4){logger[_0x4d7b('0x14')]('AddTags',_0x1268e4[_0x4d7b('0x16')],_0x3ec216);_0x5d9b97(_this[_0x4d7b('0x14')](0x1f4,_0x1268e4[_0x4d7b('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index fe56b47..342d485 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 _0xe5ea=['length','./faxInteraction.events','remove','emit','removeListener','register'];(function(_0x3bcf23,_0x181f3b){var _0x2cedc4=function(_0x142c84){while(--_0x142c84){_0x3bcf23['push'](_0x3bcf23['shift']());}};_0x2cedc4(++_0x181f3b);}(_0xe5ea,0xfd));var _0xae5e=function(_0x27ede4,_0x171842){_0x27ede4=_0x27ede4-0x0;var _0x30734a=_0xe5ea[_0x27ede4];return _0x30734a;};'use strict';var FaxInteractionEvents=require(_0xae5e('0x0'));var events=['save',_0xae5e('0x1'),'update'];function createListener(_0x27c25b,_0x5511af){return function(_0x207414){_0x5511af[_0xae5e('0x2')](_0x27c25b,_0x207414);};}function removeListener(_0x9d13af,_0x47ea8e){return function(){FaxInteractionEvents[_0xae5e('0x3')](_0x9d13af,_0x47ea8e);};}exports[_0xae5e('0x4')]=function(_0x221dcb){for(var _0x4f76c2=0x0,_0x71dd8f=events[_0xae5e('0x5')];_0x4f76c2<_0x71dd8f;_0x4f76c2++){var _0x4c236f=events[_0x4f76c2];var _0x510fd7=createListener('faxInteraction:'+_0x4c236f,_0x221dcb);FaxInteractionEvents['on'](_0x4c236f,_0x510fd7);}}; \ No newline at end of file +var _0x70d9=['save','remove','update','emit','removeListener','register','length','faxInteraction:','./faxInteraction.events'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x70d9,0xb3));var _0x970d=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x70d9[_0x13d07a];return _0x5ee0ee;};'use strict';var FaxInteractionEvents=require(_0x970d('0x0'));var events=[_0x970d('0x1'),_0x970d('0x2'),_0x970d('0x3')];function createListener(_0x3f9f3d,_0x488dd0){return function(_0x305b5c){_0x488dd0[_0x970d('0x4')](_0x3f9f3d,_0x305b5c);};}function removeListener(_0x34fc1e,_0x34e86b){return function(){FaxInteractionEvents[_0x970d('0x5')](_0x34fc1e,_0x34e86b);};}exports[_0x970d('0x6')]=function(_0x526e63){for(var _0xcb8a22=0x0,_0x2b8af6=events[_0x970d('0x7')];_0xcb8a22<_0x2b8af6;_0xcb8a22++){var _0x4012dd=events[_0xcb8a22];var _0x18542d=createListener(_0x970d('0x8')+_0x4012dd,_0x526e63);FaxInteractionEvents['on'](_0x4012dd,_0x18542d);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index fd7ac82..5d01cd6 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 _0xaca4=['multer','util','path','Router','./faxInteraction.controller','get','isAuthenticated','index','/describe','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','faxinteraction:addtags','addTags','/:id','fax','faxinteraction:update','faxinteraction:destroy','destroy','delete','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xaca4,0xbd));var _0x4aca=function(_0x332aea,_0x390c5f){_0x332aea=_0x332aea-0x0;var _0x1125db=_0xaca4[_0x332aea];return _0x1125db;};'use strict';var multer=require(_0x4aca('0x0'));var util=require(_0x4aca('0x1'));var path=require(_0x4aca('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4aca('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4aca('0x4'));router[_0x4aca('0x5')]('/',auth[_0x4aca('0x6')](),controller[_0x4aca('0x7')]);router[_0x4aca('0x5')](_0x4aca('0x8'),auth['isAuthenticated'](),controller['describe']);router[_0x4aca('0x5')]('/:id',auth[_0x4aca('0x6')](),controller['show']);router[_0x4aca('0x5')](_0x4aca('0x9'),auth[_0x4aca('0x6')](),controller[_0x4aca('0xa')]);router['get'](_0x4aca('0xb'),auth['isAuthenticated'](),controller[_0x4aca('0xc')]);router[_0x4aca('0xd')]('/',auth[_0x4aca('0x6')](),controller[_0x4aca('0xe')]);router[_0x4aca('0xd')]('/:id/messages',auth[_0x4aca('0x6')](),controller[_0x4aca('0xf')]);router[_0x4aca('0xd')](_0x4aca('0x10'),auth[_0x4aca('0x6')](),interaction[_0x4aca('0x11')]('fax',_0x4aca('0x12')),controller[_0x4aca('0x13')]);router['put'](_0x4aca('0x14'),auth['isAuthenticated'](),interaction[_0x4aca('0x11')](_0x4aca('0x15'),_0x4aca('0x16')),controller['update']);router['delete'](_0x4aca('0x14'),auth['isAuthenticated'](),interaction['tracked'](_0x4aca('0x15'),_0x4aca('0x17')),controller[_0x4aca('0x18')]);router[_0x4aca('0x19')](_0x4aca('0x10'),auth['isAuthenticated'](),controller['removeTags']);module[_0x4aca('0x1a')]=router; \ No newline at end of file +var _0x67b4=['faxinteraction:update','update','delete','faxinteraction:destroy','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','/:id/tags','tracked','fax','faxinteraction:addtags','addTags','put'];(function(_0x64edb0,_0x4dd13c){var _0x580a4b=function(_0x3e6636){while(--_0x3e6636){_0x64edb0['push'](_0x64edb0['shift']());}};_0x580a4b(++_0x4dd13c);}(_0x67b4,0x1d7));var _0x467b=function(_0x8a969d,_0x339d9f){_0x8a969d=_0x8a969d-0x0;var _0x1d8dc7=_0x67b4[_0x8a969d];return _0x1d8dc7;};'use strict';var multer=require(_0x467b('0x0'));var util=require('util');var path=require(_0x467b('0x1'));var timeout=require('connect-timeout');var express=require(_0x467b('0x2'));var router=express[_0x467b('0x3')]();var auth=require(_0x467b('0x4'));var interaction=require(_0x467b('0x5'));var config=require(_0x467b('0x6'));var controller=require('./faxInteraction.controller');router[_0x467b('0x7')]('/',auth[_0x467b('0x8')](),controller[_0x467b('0x9')]);router['get'](_0x467b('0xa'),auth[_0x467b('0x8')](),controller[_0x467b('0xb')]);router[_0x467b('0x7')](_0x467b('0xc'),auth[_0x467b('0x8')](),controller[_0x467b('0xd')]);router['get'](_0x467b('0xe'),auth[_0x467b('0x8')](),controller[_0x467b('0xf')]);router['get'](_0x467b('0x10'),auth[_0x467b('0x8')](),controller[_0x467b('0x11')]);router[_0x467b('0x12')]('/',auth[_0x467b('0x8')](),controller['create']);router[_0x467b('0x12')]('/:id/messages',auth[_0x467b('0x8')](),controller['addMessage']);router[_0x467b('0x12')](_0x467b('0x13'),auth[_0x467b('0x8')](),interaction[_0x467b('0x14')](_0x467b('0x15'),_0x467b('0x16')),controller[_0x467b('0x17')]);router[_0x467b('0x18')]('/:id',auth[_0x467b('0x8')](),interaction[_0x467b('0x14')](_0x467b('0x15'),_0x467b('0x19')),controller[_0x467b('0x1a')]);router[_0x467b('0x1b')](_0x467b('0xc'),auth[_0x467b('0x8')](),interaction[_0x467b('0x14')]('fax',_0x467b('0x1c')),controller[_0x467b('0x1d')]);router[_0x467b('0x1b')](_0x467b('0x13'),auth[_0x467b('0x8')](),controller['removeTags']);module[_0x467b('0x1e')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 3d2282f..0975cb6 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 _0xbf43=['medium','out','DATE','sequelize','exports','TEXT'];(function(_0x362733,_0x46e9fa){var _0x4fccca=function(_0x57289e){while(--_0x57289e){_0x362733['push'](_0x362733['shift']());}};_0x4fccca(++_0x46e9fa);}(_0xbf43,0x10b));var _0x3bf4=function(_0x1805b8,_0x3abba1){_0x1805b8=_0x1805b8-0x0;var _0x2f27c4=_0xbf43[_0x1805b8];return _0x2f27c4;};'use strict';var Sequelize=require(_0x3bf4('0x0'));module[_0x3bf4('0x1')]={'body':{'type':Sequelize[_0x3bf4('0x2')](_0x3bf4('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x3bf4('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0x3bf4('0x5')]}}; \ No newline at end of file +var _0x9882=['exports','TEXT','medium','BOOLEAN','ENUM','DATE','sequelize'];(function(_0x1dc137,_0x8ad419){var _0x2976c3=function(_0x2c8bca){while(--_0x2c8bca){_0x1dc137['push'](_0x1dc137['shift']());}};_0x2976c3(++_0x8ad419);}(_0x9882,0x1a3));var _0x2988=function(_0x148496,_0x504a82){_0x148496=_0x148496-0x0;var _0xfe36e6=_0x9882[_0x148496];return _0xfe36e6;};'use strict';var Sequelize=require(_0x2988('0x0'));module[_0x2988('0x1')]={'body':{'type':Sequelize[_0x2988('0x2')](_0x2988('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x2988('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x2988('0x5')]('in','out'),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize[_0x2988('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0x2988('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 6ff4edc..7346210 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 _0xb10b=['read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','manual','interface','channel','EventManager','acceptmessage','fax','agent','FaxInteractionId','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','event','create','Attachment','findOne','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','join','root','server','attachments','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','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','sendStatus','end','status','json','count','limit','Content-Range','apply','reject','update','stack','name','send','index','FaxMessage','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','offset','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','includeAll','include','find','body','destroy','describe','fax-interactions','accept','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','get','FaxInteraction','isNil'];(function(_0x15bc6a,_0x30f8f7){var _0x49c524=function(_0x1665de){while(--_0x1665de){_0x15bc6a['push'](_0x15bc6a['shift']());}};_0x49c524(++_0x30f8f7);}(_0xb10b,0x12a));var _0xbb10=function(_0x265c81,_0x4d539a){_0x265c81=_0x265c81-0x0;var _0x3e63d1=_0xb10b[_0x265c81];return _0x3e63d1;};'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'];config[_0xbb10('0x18')]=_[_0xbb10('0x19')](config[_0xbb10('0x18')],{'host':_0xbb10('0x1a'),'port':0x18eb});var socket=require(_0xbb10('0x1b'))(new Redis(config[_0xbb10('0x18')]));require('./faxMessage.socket')[_0xbb10('0x1c')](socket);var jayson=require(_0xbb10('0x1d'));var client=jayson[_0xbb10('0x1e')][_0xbb10('0x1f')]({'port':0x232c});var client9002=jayson[_0xbb10('0x1e')][_0xbb10('0x1f')]({'port':0x232a});function checkPasswordPattern(_0x24a57b,_0x36b5e8,_0x3e26f4){if(_0x3e26f4){var _0x2b184e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2b184e['test'](_0x36b5e8)){return _0x24a57b;}else{throw new db[(_0xbb10('0x20'))][(_0xbb10('0x21'))](_0xbb10('0x22'));}}else{return _0x24a57b;}}function respondWithRpcPromise(_0x42db98,_0x378da8,_0x1682a4,_0x575cca){return new BPromise(function(_0x30efc6,_0xbf2906){var _0xe1c665=_0x575cca||client;return _0xe1c665['request'](_0x42db98,_0x1682a4)[_0xbb10('0x23')](function(_0x19f48d){logger[_0xbb10('0x24')](_0xbb10('0x25'),_0x378da8,_0xbb10('0x26'));logger[_0xbb10('0x27')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x378da8,_0xbb10('0x26'),JSON[_0xbb10('0x28')](_0x19f48d));if(_0x19f48d['error']){if(_0x19f48d['error'][_0xbb10('0x29')]===0x1f4){logger[_0xbb10('0x2a')](_0xbb10('0x25'),_0x378da8,_0x19f48d[_0xbb10('0x2a')][_0xbb10('0x2b')]);return _0xbf2906(_0x19f48d[_0xbb10('0x2a')][_0xbb10('0x2b')]);}logger[_0xbb10('0x2a')](_0xbb10('0x25'),_0x378da8,_0x19f48d[_0xbb10('0x2a')][_0xbb10('0x2b')]);return _0x30efc6(_0x19f48d[_0xbb10('0x2a')]['message']);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x378da8,_0xbb10('0x26'));_0x30efc6(_0x19f48d[_0xbb10('0x2c')][_0xbb10('0x2b')]);}})['catch'](function(_0x2fdde9){logger[_0xbb10('0x2a')](_0xbb10('0x25'),_0x378da8,_0x2fdde9);_0xbf2906(_0x2fdde9);});});}function respondWithStatusCode(_0x1d5e95,_0x1acce9){_0x1acce9=_0x1acce9||0xcc;return function(_0x20d946){if(_0x20d946){return _0x1d5e95[_0xbb10('0x2d')](_0x1acce9);}return _0x1d5e95['status'](_0x1acce9)[_0xbb10('0x2e')]();};}function respondWithResult(_0x21ac54,_0xfc3595){_0xfc3595=_0xfc3595||0xc8;return function(_0x2e0249){if(_0x2e0249){return _0x21ac54[_0xbb10('0x2f')](_0xfc3595)[_0xbb10('0x30')](_0x2e0249);}};}function respondWithFilteredResult(_0x5d5c80,_0x221624){return function(_0x4ee02e){if(_0x4ee02e){var _0x448d5c=_0x4ee02e[_0xbb10('0x31')],_0x56f2da=_0x221624['offset'],_0x16ad2a=_0x221624['offset']+_0x221624[_0xbb10('0x32')],_0x1dcc9c;if(_0x16ad2a>=_0x448d5c){_0x16ad2a=_0x448d5c;_0x1dcc9c=0xc8;}else{_0x1dcc9c=0xce;}_0x5d5c80[_0xbb10('0x2f')](_0x1dcc9c);return _0x5d5c80['set'](_0xbb10('0x33'),_0x56f2da+'-'+_0x16ad2a+'/'+_0x448d5c)[_0xbb10('0x30')](_0x4ee02e);}return null;};}function patchUpdates(_0x2f653f){return function(_0x1c0b57){try{jsonpatch[_0xbb10('0x34')](_0x1c0b57,_0x2f653f,!![]);}catch(_0x138bc6){return BPromise[_0xbb10('0x35')](_0x138bc6);}return _0x1c0b57['save']();};}function saveUpdates(_0x25acb3,_0x1da9c9){return function(_0x441d15){if(_0x441d15){return _0x441d15[_0xbb10('0x36')](_0x25acb3)[_0xbb10('0x23')](function(_0x9de708){return _0x9de708;});}return null;};}function removeEntity(_0x188cbd,_0x10202c){return function(_0x3c8d7d){if(_0x3c8d7d){return _0x3c8d7d['destroy']()[_0xbb10('0x23')](function(){_0x188cbd[_0xbb10('0x2f')](0xcc)[_0xbb10('0x2e')]();});}};}function handleEntityNotFound(_0x3c3c45,_0x570f5a){return function(_0x111762){if(!_0x111762){_0x3c3c45['sendStatus'](0x194);}return _0x111762;};}function handleError(_0x4e2754,_0x3eb3cc){_0x3eb3cc=_0x3eb3cc||0x1f4;return function(_0x40c164){logger[_0xbb10('0x2a')](_0x40c164[_0xbb10('0x37')]);if(_0x40c164[_0xbb10('0x38')]){delete _0x40c164[_0xbb10('0x38')];}_0x4e2754['status'](_0x3eb3cc)[_0xbb10('0x39')](_0x40c164);};}exports[_0xbb10('0x3a')]=function(_0x52de31,_0x5e3fbd){var _0x5cd55f={},_0x31bee3={},_0x2b0b45={'count':0x0,'rows':[]};var _0x2b658a=_['map'](db[_0xbb10('0x3b')][_0xbb10('0x3c')],function(_0x4345f3){return{'name':_0x4345f3['fieldName'],'type':_0x4345f3[_0xbb10('0x3d')][_0xbb10('0x3e')]};});_0x31bee3[_0xbb10('0x3f')]=_[_0xbb10('0x40')](_0x2b658a,'name');_0x31bee3[_0xbb10('0x41')]=_[_0xbb10('0x42')](_0x52de31['query']);_0x31bee3[_0xbb10('0x43')]=_[_0xbb10('0x44')](_0x31bee3[_0xbb10('0x3f')],_0x31bee3[_0xbb10('0x41')]);_0x5cd55f[_0xbb10('0x45')]=_[_0xbb10('0x44')](_0x31bee3['model'],qs[_0xbb10('0x46')](_0x52de31[_0xbb10('0x41')][_0xbb10('0x46')]));_0x5cd55f[_0xbb10('0x45')]=_0x5cd55f['attributes'][_0xbb10('0x47')]?_0x5cd55f[_0xbb10('0x45')]:_0x31bee3[_0xbb10('0x3f')];if(!_0x52de31[_0xbb10('0x41')]['hasOwnProperty'](_0xbb10('0x48'))){_0x5cd55f[_0xbb10('0x32')]=qs['limit'](_0x52de31['query'][_0xbb10('0x32')]);_0x5cd55f['offset']=qs[_0xbb10('0x49')](_0x52de31[_0xbb10('0x41')]['offset']);}_0x5cd55f[_0xbb10('0x4a')]=qs[_0xbb10('0x4b')](_0x52de31[_0xbb10('0x41')]['sort']);_0x5cd55f[_0xbb10('0x4c')]=qs[_0xbb10('0x43')](_[_0xbb10('0x4d')](_0x52de31[_0xbb10('0x41')],_0x31bee3[_0xbb10('0x43')]));if(_0x52de31[_0xbb10('0x41')][_0xbb10('0x4e')]){_0x5cd55f[_0xbb10('0x4c')]=_[_0xbb10('0x4f')](_0x5cd55f[_0xbb10('0x4c')],{'$or':_[_0xbb10('0x40')](_0x2b658a,function(_0x1eadd2){if(_0x1eadd2['type']!==_0xbb10('0x50')){var _0x41bbf8={};_0x41bbf8[_0x1eadd2['name']]={'$like':'%'+_0x52de31[_0xbb10('0x41')][_0xbb10('0x4e')]+'%'};return _0x41bbf8;}})});}_0x5cd55f=_[_0xbb10('0x4f')]({},_0x5cd55f,_0x52de31[_0xbb10('0x51')]);var _0x41ea91={'where':_0x5cd55f[_0xbb10('0x4c')]};return db[_0xbb10('0x3b')]['count'](_0x41ea91)['then'](function(_0xcb3354){_0x2b0b45[_0xbb10('0x31')]=_0xcb3354;if(_0x52de31[_0xbb10('0x41')]['includeAll']){_0x5cd55f['include']=[{'all':!![]}];}return db[_0xbb10('0x3b')][_0xbb10('0x52')](_0x5cd55f);})[_0xbb10('0x23')](function(_0xf820fe){_0x2b0b45[_0xbb10('0x53')]=_0xf820fe;return _0x2b0b45;})[_0xbb10('0x23')](respondWithFilteredResult(_0x5e3fbd,_0x5cd55f))[_0xbb10('0x54')](handleError(_0x5e3fbd,null));};exports[_0xbb10('0x55')]=function(_0x2626d8,_0x3d7e7e){var _0x550111={'raw':!![],'where':{'id':_0x2626d8[_0xbb10('0x56')]['id']}},_0x5eafac={};_0x5eafac[_0xbb10('0x3f')]=_[_0xbb10('0x42')](db[_0xbb10('0x3b')][_0xbb10('0x3c')]);_0x5eafac[_0xbb10('0x41')]=_[_0xbb10('0x42')](_0x2626d8[_0xbb10('0x41')]);_0x5eafac[_0xbb10('0x43')]=_[_0xbb10('0x44')](_0x5eafac[_0xbb10('0x3f')],_0x5eafac[_0xbb10('0x41')]);_0x550111[_0xbb10('0x45')]=_[_0xbb10('0x44')](_0x5eafac[_0xbb10('0x3f')],qs['fields'](_0x2626d8[_0xbb10('0x41')]['fields']));_0x550111[_0xbb10('0x45')]=_0x550111[_0xbb10('0x45')][_0xbb10('0x47')]?_0x550111[_0xbb10('0x45')]:_0x5eafac[_0xbb10('0x3f')];if(_0x2626d8[_0xbb10('0x41')][_0xbb10('0x57')]){_0x550111[_0xbb10('0x58')]=[{'all':!![]}];}_0x550111=_[_0xbb10('0x4f')]({},_0x550111,_0x2626d8[_0xbb10('0x51')]);return db[_0xbb10('0x3b')][_0xbb10('0x59')](_0x550111)[_0xbb10('0x23')](handleEntityNotFound(_0x3d7e7e,null))[_0xbb10('0x23')](respondWithResult(_0x3d7e7e,null))[_0xbb10('0x54')](handleError(_0x3d7e7e,null));};exports['update']=function(_0x4571b6,_0x466eb7){if(_0x4571b6[_0xbb10('0x5a')]['id']){delete _0x4571b6[_0xbb10('0x5a')]['id'];}return db[_0xbb10('0x3b')][_0xbb10('0x59')]({'where':{'id':_0x4571b6['params']['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0x466eb7,null))[_0xbb10('0x23')](saveUpdates(_0x4571b6[_0xbb10('0x5a')],null))[_0xbb10('0x23')](respondWithResult(_0x466eb7,null))[_0xbb10('0x54')](handleError(_0x466eb7,null));};exports[_0xbb10('0x5b')]=function(_0x175872,_0x12ec18){return db[_0xbb10('0x3b')][_0xbb10('0x59')]({'where':{'id':_0x175872[_0xbb10('0x56')]['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0x12ec18,null))[_0xbb10('0x23')](removeEntity(_0x12ec18,null))['catch'](handleError(_0x12ec18,null));};exports['describe']=function(_0x16272d,_0x3e6338){return db[_0xbb10('0x3b')][_0xbb10('0x5c')]()['then'](respondWithResult(_0x3e6338,null))['catch'](handleError(_0x3e6338,null));};var interaction_log=require(_0xbb10('0x15'))(_0xbb10('0x5d'));exports[_0xbb10('0x5e')]=function(_0x2dd150,_0x412f13,_0x3e9753){var _0x45c0dc={'channel':'fax'};if(_0x2dd150[_0xbb10('0x5a')]['id']){delete _0x2dd150[_0xbb10('0x5a')]['id'];}_0x2dd150['body']['read']=!![];_0x2dd150['body'][_0xbb10('0x5f')]=moment()[_0xbb10('0x60')](_0xbb10('0x61'));_0x2dd150['body']['UserId']=_0x2dd150['body'][_0xbb10('0x62')]||_0x2dd150[_0xbb10('0x63')]['id'];return db[_0xbb10('0x3b')]['find']({'where':{'id':_0x2dd150[_0xbb10('0x56')]['id'],'UserId':null},'include':[{'model':db[_0xbb10('0x64')],'as':'Contact'}]})['then'](handleEntityNotFound(_0x412f13,null))[_0xbb10('0x23')](saveUpdates(_0x2dd150[_0xbb10('0x5a')],null))[_0xbb10('0x23')](function(_0x237246){if(_0x237246){_0x45c0dc['message']=_0x237246[_0xbb10('0x65')]({'plain':!![]});return db[_0xbb10('0x66')][_0xbb10('0x59')]({'where':{'id':_0x237246['FaxInteractionId']}});}return null;})[_0xbb10('0x23')](handleEntityNotFound(_0x412f13,null))[_0xbb10('0x23')](function(_0x3e3617){if(_0x3e3617){return _0x3e3617['update']({'UserId':_0x2dd150[_0xbb10('0x5a')][_0xbb10('0x62')],'read1stAt':_[_0xbb10('0x67')](_0x3e3617[_0xbb10('0x68')])?moment()['format'](_0xbb10('0x61')):undefined});}return null;})[_0xbb10('0x23')](function(_0x108e5b){if(_0x108e5b){_0x45c0dc[_0xbb10('0x69')]=_0x108e5b['get']({'plain':!![]});interaction_log[_0xbb10('0x24')](_0xbb10('0x6a'),_0x2dd150[_0xbb10('0x63')]['id'],_0x2dd150[_0xbb10('0x63')][_0xbb10('0x38')],_0x2dd150[_0xbb10('0x63')][_0xbb10('0x6b')],_0x45c0dc['interaction']['id'],_0x2dd150['body']?JSON['stringify'](_0x2dd150[_0xbb10('0x5a')]):_0xbb10('0x6c'));return respondWithRpcPromise(_0xbb10('0x6d'),'acceptMessage',_0x45c0dc);}return null;})['then'](function(_0x46f462){if(_0x46f462){if(_0x2dd150[_0xbb10('0x5a')][_0xbb10('0x6e')]){_0x45c0dc[_0xbb10('0x2b')][_0xbb10('0x6f')]=util[_0xbb10('0x60')]('SIP/%s',_0x2dd150[_0xbb10('0x63')][_0xbb10('0x38')]);_0x45c0dc[_0xbb10('0x2b')][_0xbb10('0x70')]=_0x45c0dc[_0xbb10('0x70')];_0x45c0dc['message']['event']='accept';return respondWithRpcPromise(_0xbb10('0x71'),_0xbb10('0x71'),{'event':_0xbb10('0x72'),'message':_0x45c0dc[_0xbb10('0x2b')]},client9002)[_0xbb10('0x23')](function(){return _0x45c0dc;});}return _0x45c0dc;}return null;})[_0xbb10('0x23')](respondWithResult(_0x412f13,null))['catch'](handleError(_0x412f13,null));};var interaction_log=require(_0xbb10('0x15'))('fax-interactions');exports['reject']=function(_0x519a54,_0xdf634f,_0x13040d){var _0x23b1d5={'agent':{},'channel':_0xbb10('0x73')};if(_0x519a54['body']['id']){delete _0x519a54[_0xbb10('0x5a')]['id'];}_0x519a54['body']['UserId']=_0x519a54[_0xbb10('0x5a')][_0xbb10('0x62')]||_0x519a54[_0xbb10('0x63')]['id'];_0x23b1d5[_0xbb10('0x74')]['id']=_0x519a54[_0xbb10('0x5a')]['UserId'];return db[_0xbb10('0x3b')][_0xbb10('0x59')]({'where':{'id':_0x519a54[_0xbb10('0x56')]['id'],'UserId':null}})[_0xbb10('0x23')](handleEntityNotFound(_0xdf634f,null))[_0xbb10('0x23')](function(_0x27f42f){if(_0x27f42f){_0x23b1d5[_0xbb10('0x2b')]=_0x27f42f['get']({'plain':!![]});return db[_0xbb10('0x66')][_0xbb10('0x59')]({'where':{'id':_0x27f42f[_0xbb10('0x75')]}});}return null;})[_0xbb10('0x23')](handleEntityNotFound(_0xdf634f,null))[_0xbb10('0x23')](function(_0x172be3){if(_0x172be3){_0x23b1d5[_0xbb10('0x69')]=_0x172be3[_0xbb10('0x65')]({'plain':!![]});interaction_log['info'](_0xbb10('0x76'),_0x519a54[_0xbb10('0x63')]['id'],_0x519a54[_0xbb10('0x63')]['name'],_0x519a54['user']['role'],_0x23b1d5[_0xbb10('0x69')]['id'],_0x519a54['body']?JSON['stringify'](_0x519a54[_0xbb10('0x5a')]):_0xbb10('0x6c'));return respondWithRpcPromise(_0xbb10('0x77'),_0xbb10('0x78'),_0x23b1d5);}return null;})[_0xbb10('0x23')](function(_0x24dca6){if(_0x24dca6){_0x24dca6[_0xbb10('0x2b')][_0xbb10('0x6f')]=util[_0xbb10('0x60')]('SIP/%s',_0x519a54[_0xbb10('0x63')][_0xbb10('0x38')]);_0x24dca6[_0xbb10('0x2b')][_0xbb10('0x70')]=_0x23b1d5['channel'];_0x24dca6['message'][_0xbb10('0x79')]=_0xbb10('0x35');respondWithRpcPromise(_0xbb10('0x71'),_0xbb10('0x71'),{'event':'rejectmessage','message':_0x24dca6[_0xbb10('0x2b')]},client9002);return _0x23b1d5;}return null;})[_0xbb10('0x23')](respondWithResult(_0xdf634f,null))[_0xbb10('0x54')](handleError(_0xdf634f,null));};exports[_0xbb10('0x7a')]=function(_0x35c1e8,_0x517185){var _0x5f0691;return db[_0xbb10('0x3b')][_0xbb10('0x7a')](_0x35c1e8[_0xbb10('0x5a')],{})['then'](function(_0x256b35){_0x5f0691=_0x256b35;return db[_0xbb10('0x64')]['findOne']({'where':{'id':_0x5f0691['ContactId']}});})[_0xbb10('0x23')](function(_0x26d0dd){if(_[_0xbb10('0x67')](_0x26d0dd)){return;}else{_0x5f0691['fax']=_0x26d0dd[_0xbb10('0x73')];return db[_0xbb10('0x7b')][_0xbb10('0x7c')]({'where':{'id':_0x5f0691[_0xbb10('0x7d')]}});}})[_0xbb10('0x23')](function(_0x5de006){return respondWithRpcPromise(_0xbb10('0x7e'),_0xbb10('0x7e'),{'FaxAccountId':_[_0xbb10('0x67')](_0x35c1e8['body'])?undefined:_0x35c1e8[_0xbb10('0x5a')][_0xbb10('0x7f')],'path':_[_0xbb10('0x67')](_0x5de006)?undefined:util[_0xbb10('0x60')](_0xbb10('0x80'),_0x5de006[_0xbb10('0x81')]),'fax':_[_0xbb10('0x67')](_0x5f0691[_0xbb10('0x73')])?undefined:_0x5f0691[_0xbb10('0x73')],'AttachmentId':_0x5f0691[_0xbb10('0x7d')]},client9002);})[_0xbb10('0x23')](respondWithResult(_0x517185,0xc9))[_0xbb10('0x54')](handleError(_0x517185,null));};exports['download']=function(_0x51f106,_0xe1fc51){var _0x3fa344=path[_0xbb10('0x82')](config[_0xbb10('0x83')],_0xbb10('0x84'),'files',_0xbb10('0x85'));return db[_0xbb10('0x3b')][_0xbb10('0x59')]({'where':{'id':_0x51f106[_0xbb10('0x56')]['id']},'include':[{'model':db[_0xbb10('0x7b')],'as':_0xbb10('0x7b')}]})['then'](handleEntityNotFound(_0xe1fc51,null))[_0xbb10('0x23')](function(_0x742e10){if(_0x742e10){return _0xe1fc51['download'](path[_0xbb10('0x82')](_0x3fa344,_0x742e10['Attachment'][_0xbb10('0x81')]));}})[_0xbb10('0x54')](handleError(_0xe1fc51,null));}; \ No newline at end of file +var _0xa9e0=['format','get','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','stringify','null','AcceptMessage','acceptMessage','interface','channel','event','agent','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','EventManager','rejectmessage','create','findOne','AttachmentId','SendFax','/var/opt/motion2/server/files/attachments/%s','basename','join','server','files','attachments','Attachment','download','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','stack','index','map','rawAttributes','fieldName','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','name','options','FaxMessage','includeAll','include','findAll','rows','show','intersection','find','body','params','describe','../../config/logger','fax-interactions','accept','fax','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','FaxInteraction','isNil','read1stAt'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xa9e0[_0x1b349a];return _0x5d1f7c;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];config[_0x0a9e('0x14')]=_[_0x0a9e('0x15')](config[_0x0a9e('0x14')],{'host':_0x0a9e('0x16'),'port':0x18eb});var socket=require(_0x0a9e('0x17'))(new Redis(config['redis']));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);var jayson=require(_0x0a9e('0x1a'));var client=jayson[_0x0a9e('0x1b')][_0x0a9e('0x1c')]({'port':0x232c});var client9002=jayson[_0x0a9e('0x1b')]['http']({'port':0x232a});function checkPasswordPattern(_0x22dccb,_0x5d0880,_0x1985b6){if(_0x1985b6){var _0x519dfd=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x519dfd[_0x0a9e('0x1d')](_0x5d0880)){return _0x22dccb;}else{throw new db[(_0x0a9e('0x1e'))]['ValidationError'](_0x0a9e('0x1f'));}}else{return _0x22dccb;}}function respondWithRpcPromise(_0x5a0a06,_0x459eb1,_0x478723,_0x106033){return new BPromise(function(_0x205fd6,_0x31b1ca){var _0x2eb11f=_0x106033||client;return _0x2eb11f[_0x0a9e('0x20')](_0x5a0a06,_0x478723)[_0x0a9e('0x21')](function(_0x1314ae){logger[_0x0a9e('0x22')](_0x0a9e('0x23'),_0x459eb1,_0x0a9e('0x24'));logger['debug'](_0x0a9e('0x25'),_0x459eb1,_0x0a9e('0x24'),JSON['stringify'](_0x1314ae));if(_0x1314ae[_0x0a9e('0x26')]){if(_0x1314ae['error']['code']===0x1f4){logger[_0x0a9e('0x26')](_0x0a9e('0x23'),_0x459eb1,_0x1314ae[_0x0a9e('0x26')][_0x0a9e('0x27')]);return _0x31b1ca(_0x1314ae['error'][_0x0a9e('0x27')]);}logger[_0x0a9e('0x26')](_0x0a9e('0x23'),_0x459eb1,_0x1314ae[_0x0a9e('0x26')][_0x0a9e('0x27')]);return _0x205fd6(_0x1314ae[_0x0a9e('0x26')][_0x0a9e('0x27')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x459eb1,_0x0a9e('0x24'));_0x205fd6(_0x1314ae[_0x0a9e('0x28')][_0x0a9e('0x27')]);}})[_0x0a9e('0x29')](function(_0x526cf3){logger[_0x0a9e('0x26')]('FaxMessage,\x20%s,\x20%s',_0x459eb1,_0x526cf3);_0x31b1ca(_0x526cf3);});});}function respondWithStatusCode(_0x45a1e7,_0x5bfb33){_0x5bfb33=_0x5bfb33||0xcc;return function(_0x1dc186){if(_0x1dc186){return _0x45a1e7[_0x0a9e('0x2a')](_0x5bfb33);}return _0x45a1e7[_0x0a9e('0x2b')](_0x5bfb33)[_0x0a9e('0x2c')]();};}function respondWithResult(_0x140511,_0x1538a4){_0x1538a4=_0x1538a4||0xc8;return function(_0x11c3b6){if(_0x11c3b6){return _0x140511[_0x0a9e('0x2b')](_0x1538a4)['json'](_0x11c3b6);}};}function respondWithFilteredResult(_0x3652a7,_0x468813){return function(_0x2b1f27){if(_0x2b1f27){var _0x2ec755=_0x2b1f27[_0x0a9e('0x2d')],_0x5c877d=_0x468813[_0x0a9e('0x2e')],_0x15b200=_0x468813[_0x0a9e('0x2e')]+_0x468813[_0x0a9e('0x2f')],_0x40e7a3;if(_0x15b200>=_0x2ec755){_0x15b200=_0x2ec755;_0x40e7a3=0xc8;}else{_0x40e7a3=0xce;}_0x3652a7[_0x0a9e('0x2b')](_0x40e7a3);return _0x3652a7[_0x0a9e('0x30')](_0x0a9e('0x31'),_0x5c877d+'-'+_0x15b200+'/'+_0x2ec755)['json'](_0x2b1f27);}return null;};}function patchUpdates(_0x426950){return function(_0x5d1e0e){try{jsonpatch[_0x0a9e('0x32')](_0x5d1e0e,_0x426950,!![]);}catch(_0x3ae878){return BPromise[_0x0a9e('0x33')](_0x3ae878);}return _0x5d1e0e[_0x0a9e('0x34')]();};}function saveUpdates(_0x25ce3a,_0x5180f1){return function(_0x66c1d2){if(_0x66c1d2){return _0x66c1d2[_0x0a9e('0x35')](_0x25ce3a)[_0x0a9e('0x21')](function(_0x2da5c0){return _0x2da5c0;});}return null;};}function removeEntity(_0x2b45ea,_0x409319){return function(_0x332d35){if(_0x332d35){return _0x332d35[_0x0a9e('0x36')]()['then'](function(){_0x2b45ea[_0x0a9e('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2cc7a0,_0x14b13f){return function(_0x2b7e7f){if(!_0x2b7e7f){_0x2cc7a0[_0x0a9e('0x2a')](0x194);}return _0x2b7e7f;};}function handleError(_0x567193,_0x191e91){_0x191e91=_0x191e91||0x1f4;return function(_0xd1836d){logger[_0x0a9e('0x26')](_0xd1836d[_0x0a9e('0x37')]);if(_0xd1836d['name']){delete _0xd1836d['name'];}_0x567193[_0x0a9e('0x2b')](_0x191e91)['send'](_0xd1836d);};}exports[_0x0a9e('0x38')]=function(_0x3d9717,_0x381c37){var _0x1ef87a={},_0x4f41ae={},_0x31916f={'count':0x0,'rows':[]};var _0x3bfce8=_[_0x0a9e('0x39')](db['FaxMessage'][_0x0a9e('0x3a')],function(_0x1a180b){return{'name':_0x1a180b[_0x0a9e('0x3b')],'type':_0x1a180b['type']['key']};});_0x4f41ae[_0x0a9e('0x3c')]=_[_0x0a9e('0x39')](_0x3bfce8,'name');_0x4f41ae[_0x0a9e('0x3d')]=_[_0x0a9e('0x3e')](_0x3d9717[_0x0a9e('0x3d')]);_0x4f41ae[_0x0a9e('0x3f')]=_['intersection'](_0x4f41ae['model'],_0x4f41ae[_0x0a9e('0x3d')]);_0x1ef87a[_0x0a9e('0x40')]=_['intersection'](_0x4f41ae[_0x0a9e('0x3c')],qs[_0x0a9e('0x41')](_0x3d9717[_0x0a9e('0x3d')]['fields']));_0x1ef87a[_0x0a9e('0x40')]=_0x1ef87a[_0x0a9e('0x40')][_0x0a9e('0x42')]?_0x1ef87a[_0x0a9e('0x40')]:_0x4f41ae[_0x0a9e('0x3c')];if(!_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x43')](_0x0a9e('0x44'))){_0x1ef87a[_0x0a9e('0x2f')]=qs[_0x0a9e('0x2f')](_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x2f')]);_0x1ef87a[_0x0a9e('0x2e')]=qs[_0x0a9e('0x2e')](_0x3d9717[_0x0a9e('0x3d')]['offset']);}_0x1ef87a['order']=qs[_0x0a9e('0x45')](_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x45')]);_0x1ef87a[_0x0a9e('0x46')]=qs[_0x0a9e('0x3f')](_[_0x0a9e('0x47')](_0x3d9717[_0x0a9e('0x3d')],_0x4f41ae[_0x0a9e('0x3f')]));if(_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x48')]){_0x1ef87a[_0x0a9e('0x46')]=_[_0x0a9e('0x49')](_0x1ef87a['where'],{'$or':_[_0x0a9e('0x39')](_0x3bfce8,function(_0x138b8b){if(_0x138b8b[_0x0a9e('0x4a')]!==_0x0a9e('0x4b')){var _0x2e8caf={};_0x2e8caf[_0x138b8b[_0x0a9e('0x4c')]]={'$like':'%'+_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x48')]+'%'};return _0x2e8caf;}})});}_0x1ef87a=_['merge']({},_0x1ef87a,_0x3d9717[_0x0a9e('0x4d')]);var _0x48fd45={'where':_0x1ef87a[_0x0a9e('0x46')]};return db[_0x0a9e('0x4e')][_0x0a9e('0x2d')](_0x48fd45)['then'](function(_0x14bec2){_0x31916f[_0x0a9e('0x2d')]=_0x14bec2;if(_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x4f')]){_0x1ef87a[_0x0a9e('0x50')]=[{'all':!![]}];}return db[_0x0a9e('0x4e')][_0x0a9e('0x51')](_0x1ef87a);})['then'](function(_0x13f44d){_0x31916f[_0x0a9e('0x52')]=_0x13f44d;return _0x31916f;})[_0x0a9e('0x21')](respondWithFilteredResult(_0x381c37,_0x1ef87a))[_0x0a9e('0x29')](handleError(_0x381c37,null));};exports[_0x0a9e('0x53')]=function(_0x992c77,_0x6054ee){var _0x19383e={'raw':!![],'where':{'id':_0x992c77['params']['id']}},_0x34febd={};_0x34febd[_0x0a9e('0x3c')]=_[_0x0a9e('0x3e')](db['FaxMessage']['rawAttributes']);_0x34febd['query']=_[_0x0a9e('0x3e')](_0x992c77[_0x0a9e('0x3d')]);_0x34febd[_0x0a9e('0x3f')]=_[_0x0a9e('0x54')](_0x34febd[_0x0a9e('0x3c')],_0x34febd[_0x0a9e('0x3d')]);_0x19383e[_0x0a9e('0x40')]=_[_0x0a9e('0x54')](_0x34febd['model'],qs['fields'](_0x992c77['query'][_0x0a9e('0x41')]));_0x19383e[_0x0a9e('0x40')]=_0x19383e[_0x0a9e('0x40')]['length']?_0x19383e[_0x0a9e('0x40')]:_0x34febd[_0x0a9e('0x3c')];if(_0x992c77['query']['includeAll']){_0x19383e[_0x0a9e('0x50')]=[{'all':!![]}];}_0x19383e=_['merge']({},_0x19383e,_0x992c77[_0x0a9e('0x4d')]);return db['FaxMessage'][_0x0a9e('0x55')](_0x19383e)[_0x0a9e('0x21')](handleEntityNotFound(_0x6054ee,null))[_0x0a9e('0x21')](respondWithResult(_0x6054ee,null))['catch'](handleError(_0x6054ee,null));};exports[_0x0a9e('0x35')]=function(_0x1bf38a,_0x508b47){if(_0x1bf38a['body']['id']){delete _0x1bf38a[_0x0a9e('0x56')]['id'];}return db[_0x0a9e('0x4e')]['find']({'where':{'id':_0x1bf38a[_0x0a9e('0x57')]['id']}})['then'](handleEntityNotFound(_0x508b47,null))[_0x0a9e('0x21')](saveUpdates(_0x1bf38a['body'],null))[_0x0a9e('0x21')](respondWithResult(_0x508b47,null))['catch'](handleError(_0x508b47,null));};exports['destroy']=function(_0x5df0ad,_0x2da03c){return db['FaxMessage'][_0x0a9e('0x55')]({'where':{'id':_0x5df0ad[_0x0a9e('0x57')]['id']}})[_0x0a9e('0x21')](handleEntityNotFound(_0x2da03c,null))[_0x0a9e('0x21')](removeEntity(_0x2da03c,null))[_0x0a9e('0x29')](handleError(_0x2da03c,null));};exports[_0x0a9e('0x58')]=function(_0xd10662,_0x28d814){return db['FaxMessage'][_0x0a9e('0x58')]()[_0x0a9e('0x21')](respondWithResult(_0x28d814,null))[_0x0a9e('0x29')](handleError(_0x28d814,null));};var interaction_log=require(_0x0a9e('0x59'))(_0x0a9e('0x5a'));exports[_0x0a9e('0x5b')]=function(_0x5d86e9,_0x956fbe,_0x26bc80){var _0x5239ef={'channel':_0x0a9e('0x5c')};if(_0x5d86e9['body']['id']){delete _0x5d86e9[_0x0a9e('0x56')]['id'];}_0x5d86e9['body']['read']=!![];_0x5d86e9['body'][_0x0a9e('0x5d')]=moment()['format'](_0x0a9e('0x5e'));_0x5d86e9[_0x0a9e('0x56')][_0x0a9e('0x5f')]=_0x5d86e9[_0x0a9e('0x56')][_0x0a9e('0x5f')]||_0x5d86e9[_0x0a9e('0x60')]['id'];return db['FaxMessage'][_0x0a9e('0x55')]({'where':{'id':_0x5d86e9['params']['id'],'UserId':null},'include':[{'model':db[_0x0a9e('0x61')],'as':_0x0a9e('0x62')}]})[_0x0a9e('0x21')](handleEntityNotFound(_0x956fbe,null))['then'](saveUpdates(_0x5d86e9[_0x0a9e('0x56')],null))[_0x0a9e('0x21')](function(_0x119677){if(_0x119677){_0x5239ef[_0x0a9e('0x27')]=_0x119677['get']({'plain':!![]});return db[_0x0a9e('0x63')][_0x0a9e('0x55')]({'where':{'id':_0x119677['FaxInteractionId']}});}return null;})[_0x0a9e('0x21')](handleEntityNotFound(_0x956fbe,null))[_0x0a9e('0x21')](function(_0x88dcbf){if(_0x88dcbf){return _0x88dcbf[_0x0a9e('0x35')]({'UserId':_0x5d86e9[_0x0a9e('0x56')]['UserId'],'read1stAt':_[_0x0a9e('0x64')](_0x88dcbf[_0x0a9e('0x65')])?moment()[_0x0a9e('0x66')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x0a9e('0x21')](function(_0x4f1e60){if(_0x4f1e60){_0x5239ef['interaction']=_0x4f1e60[_0x0a9e('0x67')]({'plain':!![]});interaction_log[_0x0a9e('0x22')](_0x0a9e('0x68'),_0x5d86e9[_0x0a9e('0x60')]['id'],_0x5d86e9[_0x0a9e('0x60')][_0x0a9e('0x4c')],_0x5d86e9[_0x0a9e('0x60')][_0x0a9e('0x69')],_0x5239ef[_0x0a9e('0x6a')]['id'],_0x5d86e9[_0x0a9e('0x56')]?JSON[_0x0a9e('0x6b')](_0x5d86e9[_0x0a9e('0x56')]):_0x0a9e('0x6c'));return respondWithRpcPromise(_0x0a9e('0x6d'),_0x0a9e('0x6e'),_0x5239ef);}return null;})[_0x0a9e('0x21')](function(_0x2a28c0){if(_0x2a28c0){if(_0x5d86e9[_0x0a9e('0x56')]['manual']){_0x5239ef[_0x0a9e('0x27')][_0x0a9e('0x6f')]=util[_0x0a9e('0x66')]('SIP/%s',_0x5d86e9[_0x0a9e('0x60')][_0x0a9e('0x4c')]);_0x5239ef['message'][_0x0a9e('0x70')]=_0x5239ef[_0x0a9e('0x70')];_0x5239ef[_0x0a9e('0x27')][_0x0a9e('0x71')]=_0x0a9e('0x5b');return respondWithRpcPromise('EventManager','EventManager',{'event':'acceptmessage','message':_0x5239ef[_0x0a9e('0x27')]},client9002)[_0x0a9e('0x21')](function(){return _0x5239ef;});}return _0x5239ef;}return null;})[_0x0a9e('0x21')](respondWithResult(_0x956fbe,null))[_0x0a9e('0x29')](handleError(_0x956fbe,null));};var interaction_log=require(_0x0a9e('0x59'))(_0x0a9e('0x5a'));exports[_0x0a9e('0x33')]=function(_0x1a0677,_0x5512d1,_0x235f8f){var _0xcbc8b2={'agent':{},'channel':_0x0a9e('0x5c')};if(_0x1a0677['body']['id']){delete _0x1a0677[_0x0a9e('0x56')]['id'];}_0x1a0677['body'][_0x0a9e('0x5f')]=_0x1a0677[_0x0a9e('0x56')]['UserId']||_0x1a0677[_0x0a9e('0x60')]['id'];_0xcbc8b2[_0x0a9e('0x72')]['id']=_0x1a0677[_0x0a9e('0x56')][_0x0a9e('0x5f')];return db['FaxMessage'][_0x0a9e('0x55')]({'where':{'id':_0x1a0677[_0x0a9e('0x57')]['id'],'UserId':null}})[_0x0a9e('0x21')](handleEntityNotFound(_0x5512d1,null))[_0x0a9e('0x21')](function(_0x5b7fc3){if(_0x5b7fc3){_0xcbc8b2[_0x0a9e('0x27')]=_0x5b7fc3[_0x0a9e('0x67')]({'plain':!![]});return db[_0x0a9e('0x63')][_0x0a9e('0x55')]({'where':{'id':_0x5b7fc3['FaxInteractionId']}});}return null;})[_0x0a9e('0x21')](handleEntityNotFound(_0x5512d1,null))[_0x0a9e('0x21')](function(_0x30a4c7){if(_0x30a4c7){_0xcbc8b2[_0x0a9e('0x6a')]=_0x30a4c7[_0x0a9e('0x67')]({'plain':!![]});interaction_log[_0x0a9e('0x22')](_0x0a9e('0x73'),_0x1a0677[_0x0a9e('0x60')]['id'],_0x1a0677[_0x0a9e('0x60')][_0x0a9e('0x4c')],_0x1a0677[_0x0a9e('0x60')][_0x0a9e('0x69')],_0xcbc8b2[_0x0a9e('0x6a')]['id'],_0x1a0677[_0x0a9e('0x56')]?JSON['stringify'](_0x1a0677[_0x0a9e('0x56')]):_0x0a9e('0x6c'));return respondWithRpcPromise(_0x0a9e('0x74'),'rejectMessage',_0xcbc8b2);}return null;})[_0x0a9e('0x21')](function(_0x33dda0){if(_0x33dda0){_0x33dda0[_0x0a9e('0x27')][_0x0a9e('0x6f')]=util['format']('SIP/%s',_0x1a0677[_0x0a9e('0x60')][_0x0a9e('0x4c')]);_0x33dda0['message'][_0x0a9e('0x70')]=_0xcbc8b2['channel'];_0x33dda0[_0x0a9e('0x27')][_0x0a9e('0x71')]='reject';respondWithRpcPromise(_0x0a9e('0x75'),_0x0a9e('0x75'),{'event':_0x0a9e('0x76'),'message':_0x33dda0[_0x0a9e('0x27')]},client9002);return _0xcbc8b2;}return null;})[_0x0a9e('0x21')](respondWithResult(_0x5512d1,null))[_0x0a9e('0x29')](handleError(_0x5512d1,null));};exports[_0x0a9e('0x77')]=function(_0x482ca2,_0x2973d3){var _0x3ca9b9;return db[_0x0a9e('0x4e')][_0x0a9e('0x77')](_0x482ca2['body'],{})[_0x0a9e('0x21')](function(_0xf0db1){_0x3ca9b9=_0xf0db1;return db['CmContact'][_0x0a9e('0x78')]({'where':{'id':_0x3ca9b9['ContactId']}});})[_0x0a9e('0x21')](function(_0x2bb25a){if(_[_0x0a9e('0x64')](_0x2bb25a)){return;}else{_0x3ca9b9[_0x0a9e('0x5c')]=_0x2bb25a['fax'];return db['Attachment'][_0x0a9e('0x78')]({'where':{'id':_0x3ca9b9[_0x0a9e('0x79')]}});}})[_0x0a9e('0x21')](function(_0x5ac73d){return respondWithRpcPromise(_0x0a9e('0x7a'),_0x0a9e('0x7a'),{'FaxAccountId':_['isNil'](_0x482ca2['body'])?undefined:_0x482ca2[_0x0a9e('0x56')]['FaxAccountId'],'path':_['isNil'](_0x5ac73d)?undefined:util['format'](_0x0a9e('0x7b'),_0x5ac73d[_0x0a9e('0x7c')]),'fax':_[_0x0a9e('0x64')](_0x3ca9b9[_0x0a9e('0x5c')])?undefined:_0x3ca9b9[_0x0a9e('0x5c')],'AttachmentId':_0x3ca9b9[_0x0a9e('0x79')]},client9002);})['then'](respondWithResult(_0x2973d3,0xc9))[_0x0a9e('0x29')](handleError(_0x2973d3,null));};exports['download']=function(_0x2871c1,_0x2aabab){var _0x18ad56=path[_0x0a9e('0x7d')](config['root'],_0x0a9e('0x7e'),_0x0a9e('0x7f'),_0x0a9e('0x80'));return db['FaxMessage'][_0x0a9e('0x55')]({'where':{'id':_0x2871c1[_0x0a9e('0x57')]['id']},'include':[{'model':db[_0x0a9e('0x81')],'as':_0x0a9e('0x81')}]})[_0x0a9e('0x21')](handleEntityNotFound(_0x2aabab,null))[_0x0a9e('0x21')](function(_0x32b9bd){if(_0x32b9bd){return _0x2aabab[_0x0a9e('0x82')](path['join'](_0x18ad56,_0x32b9bd[_0x0a9e('0x81')][_0x0a9e('0x7c')]));}})['catch'](handleError(_0x2aabab,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index e5a0938..4a16791 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 _0xe14b=['hasOwnProperty','hook','exports','events','../../mysqldb','save','update','emit'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xe14b,0x93));var _0xbe14=function(_0x1a565b,_0x381c2f){_0x1a565b=_0x1a565b-0x0;var _0x659336=_0xe14b[_0x1a565b];return _0x659336;};'use strict';var EventEmitter=require(_0xbe14('0x0'));var FaxMessage=require(_0xbe14('0x1'))['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbe14('0x2'),'afterUpdate':_0xbe14('0x3'),'afterDestroy':'remove'};function emitEvent(_0x7d3665){return function(_0x5ce8fb,_0x496c04,_0x1833e3){FaxMessageEvents[_0xbe14('0x4')](_0x7d3665+':'+_0x5ce8fb['id'],_0x5ce8fb);FaxMessageEvents[_0xbe14('0x4')](_0x7d3665,_0x5ce8fb);_0x1833e3(null);};}for(var e in events){if(events[_0xbe14('0x5')](e)){var event=events[e];FaxMessage[_0xbe14('0x6')](e,emitEvent(event));}}module[_0xbe14('0x7')]=FaxMessageEvents; \ No newline at end of file +var _0x3e74=['hasOwnProperty','exports','events','FaxMessage','setMaxListeners','save','emit'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x3e74,0x175));var _0x43e7=function(_0x27b9dc,_0x5f32fd){_0x27b9dc=_0x27b9dc-0x0;var _0x44f6f6=_0x3e74[_0x27b9dc];return _0x44f6f6;};'use strict';var EventEmitter=require(_0x43e7('0x0'));var FaxMessage=require('../../mysqldb')['db'][_0x43e7('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x43e7('0x2')](0x0);var events={'afterCreate':_0x43e7('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xc58479){return function(_0x4f9bbe,_0x128b0f,_0xe838b4){FaxMessageEvents[_0x43e7('0x4')](_0xc58479+':'+_0x4f9bbe['id'],_0x4f9bbe);FaxMessageEvents[_0x43e7('0x4')](_0xc58479,_0x4f9bbe);_0xe838b4(null);};}for(var e in events){if(events[_0x43e7('0x5')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0x43e7('0x6')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 4c9655c..a000ba6 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 _0x0955=['../../config/logger','moment','bluebird','path','rimraf','./faxMessage.attributes','exports','define','FaxMessage','fax_messages','fti_fax_messages','body','models','get','direction','toLowerCase','out','secret','isNil','findOne','FaxInteractionId','then','update','createdAt','catch','lodash','util'];(function(_0x38a815,_0x69d49f){var _0x356b5a=function(_0x12ad0b){while(--_0x12ad0b){_0x38a815['push'](_0x38a815['shift']());}};_0x356b5a(++_0x69d49f);}(_0x0955,0x178));var _0x5095=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0x0955[_0x243b59];return _0x3e1676;};'use strict';var _=require(_0x5095('0x0'));var util=require(_0x5095('0x1'));var logger=require(_0x5095('0x2'))('api');var moment=require(_0x5095('0x3'));var BPromise=require(_0x5095('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5095('0x5'));var rimraf=require(_0x5095('0x6'));var config=require('../../config/environment');var attributes=require(_0x5095('0x7'));module[_0x5095('0x8')]=function(_0x3ff996,_0x297593){return _0x3ff996[_0x5095('0x9')](_0x5095('0xa'),attributes,{'tableName':_0x5095('0xb'),'paranoid':![],'indexes':[{'name':_0x5095('0xc'),'fields':[_0x5095('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5f1831,_0x36135a,_0x40c21f){var _0x6666a3=_0x3ff996[_0x5095('0xe')];var _0x2c28c6=_0x5f1831[_0x5095('0xf')]({'plain':!![]});if(_0x2c28c6[_0x5095('0x10')][_0x5095('0x11')]()==='in'||_0x2c28c6[_0x5095('0x10')][_0x5095('0x11')]()===_0x5095('0x12')&&!_0x2c28c6[_0x5095('0x13')]&&!_[_0x5095('0x14')](_0x2c28c6['UserId'])){_0x6666a3['FaxInteraction'][_0x5095('0x15')]({'where':{'id':_0x2c28c6[_0x5095('0x16')]}})[_0x5095('0x17')](function(_0x52fb4d){if(_0x52fb4d){_0x52fb4d[_0x5095('0x18')]({'lastMsgAt':_0x2c28c6[_0x5095('0x19')],'lastMsgDirection':_0x2c28c6[_0x5095('0x10')]['toLowerCase']()});}})[_0x5095('0x1a')](function(_0x34419e){console['error'](_0x34419e);});}_0x40c21f();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x4659=['./faxMessage.attributes','exports','define','FaxMessage','fax_messages','body','FULLTEXT','get','toLowerCase','out','isNil','UserId','FaxInteraction','then','update','createdAt','direction','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','path','rimraf','../../config/environment'];(function(_0x308950,_0x1e3dba){var _0x147cb6=function(_0x5d5bc2){while(--_0x5d5bc2){_0x308950['push'](_0x308950['shift']());}};_0x147cb6(++_0x1e3dba);}(_0x4659,0x149));var _0x9465=function(_0x498c78,_0xfaae13){_0x498c78=_0x498c78-0x0;var _0x537dac=_0x4659[_0x498c78];return _0x537dac;};'use strict';var _=require(_0x9465('0x0'));var util=require(_0x9465('0x1'));var logger=require(_0x9465('0x2'))('api');var moment=require(_0x9465('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9465('0x4'));var rimraf=require(_0x9465('0x5'));var config=require(_0x9465('0x6'));var attributes=require(_0x9465('0x7'));module[_0x9465('0x8')]=function(_0xcf6ae3,_0xb5d0a6){return _0xcf6ae3[_0x9465('0x9')](_0x9465('0xa'),attributes,{'tableName':_0x9465('0xb'),'paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0x9465('0xc')],'type':_0x9465('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x36940a,_0x55ed46,_0xf01e1a){var _0x27b6de=_0xcf6ae3['models'];var _0x2ae35e=_0x36940a[_0x9465('0xe')]({'plain':!![]});if(_0x2ae35e['direction'][_0x9465('0xf')]()==='in'||_0x2ae35e['direction']['toLowerCase']()===_0x9465('0x10')&&!_0x2ae35e['secret']&&!_[_0x9465('0x11')](_0x2ae35e[_0x9465('0x12')])){_0x27b6de[_0x9465('0x13')]['findOne']({'where':{'id':_0x2ae35e['FaxInteractionId']}})[_0x9465('0x14')](function(_0x1d7457){if(_0x1d7457){_0x1d7457[_0x9465('0x15')]({'lastMsgAt':_0x2ae35e[_0x9465('0x16')],'lastMsgDirection':_0x2ae35e[_0x9465('0x17')][_0x9465('0xf')]()});}})[_0x9465('0x18')](function(_0x50f9d1){console[_0x9465('0x19')](_0x50f9d1);});}_0xf01e1a();}},'charset':_0x9465('0x1a'),'collate':_0x9465('0x1b')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 124393f..283ee67 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 _0x65d9=['client','http','redis','localhost','socket.io-emitter','./faxMessage.socket','register','request','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateFaxMessage','create','body','options','raw','then','UpdateFaxMessage','update','where','attributes','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x65d9,0x1bf));var _0x965d=function(_0x4add51,_0x462d46){_0x4add51=_0x4add51-0x0;var _0x5d85a7=_0x65d9[_0x4add51];return _0x5d85a7;};'use strict';var _=require(_0x965d('0x0'));var util=require(_0x965d('0x1'));var moment=require(_0x965d('0x2'));var BPromise=require('bluebird');var rs=require(_0x965d('0x3'));var fs=require('fs');var Redis=require(_0x965d('0x4'));var db=require(_0x965d('0x5'))['db'];var utils=require(_0x965d('0x6'));var logger=require(_0x965d('0x7'))('rpc');var config=require(_0x965d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x965d('0x9')][_0x965d('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x965d('0xb')],{'host':_0x965d('0xc'),'port':0x18eb});var socket=require(_0x965d('0xd'))(new Redis(config[_0x965d('0xb')]));require(_0x965d('0xe'))[_0x965d('0xf')](socket);function respondWithRpcPromise(_0x46d59f,_0x598e10,_0x4bdc10){return new BPromise(function(_0x100851,_0x35f32b){return client[_0x965d('0x10')](_0x46d59f,_0x4bdc10)['then'](function(_0x432ad6){logger[_0x965d('0x11')](_0x965d('0x12'),_0x598e10,_0x965d('0x13'));logger[_0x965d('0x14')](_0x965d('0x15'),_0x598e10,_0x965d('0x13'),JSON[_0x965d('0x16')](_0x432ad6));if(_0x432ad6['error']){if(_0x432ad6[_0x965d('0x17')][_0x965d('0x18')]===0x1f4){logger['error'](_0x965d('0x12'),_0x598e10,_0x432ad6[_0x965d('0x17')][_0x965d('0x19')]);return _0x35f32b(_0x432ad6[_0x965d('0x17')][_0x965d('0x19')]);}logger[_0x965d('0x17')](_0x965d('0x12'),_0x598e10,_0x432ad6[_0x965d('0x17')][_0x965d('0x19')]);return _0x100851(_0x432ad6[_0x965d('0x17')][_0x965d('0x19')]);}else{logger[_0x965d('0x11')](_0x965d('0x12'),_0x598e10,'request\x20sent');_0x100851(_0x432ad6[_0x965d('0x1a')][_0x965d('0x19')]);}})[_0x965d('0x1b')](function(_0xfe637b){logger['error'](_0x965d('0x12'),_0x598e10,_0xfe637b);_0x35f32b(_0xfe637b);});});}exports[_0x965d('0x1c')]=function(_0x594e16){var _0x890189=this;return new Promise(function(_0x68e04,_0x2fed69){return db['FaxMessage'][_0x965d('0x1d')](_0x594e16[_0x965d('0x1e')],{'raw':_0x594e16[_0x965d('0x1f')]?_0x594e16[_0x965d('0x1f')][_0x965d('0x20')]===undefined?!![]:![]:!![]})[_0x965d('0x21')](function(_0x553e00){logger[_0x965d('0x11')](_0x965d('0x1c'),_0x594e16);logger[_0x965d('0x14')](_0x965d('0x1c'),_0x594e16,JSON['stringify'](_0x553e00));_0x68e04(_0x553e00);})[_0x965d('0x1b')](function(_0x37e1b4){logger[_0x965d('0x17')]('CreateFaxMessage',_0x37e1b4[_0x965d('0x19')],_0x594e16);_0x2fed69(_0x890189[_0x965d('0x17')](0x1f4,_0x37e1b4[_0x965d('0x19')]));});});};exports[_0x965d('0x22')]=function(_0x3224d6){var _0x12e75d=this;return new Promise(function(_0x133350,_0x44f673){return db['FaxMessage'][_0x965d('0x23')](_0x3224d6[_0x965d('0x1e')],{'raw':_0x3224d6[_0x965d('0x1f')]?_0x3224d6[_0x965d('0x1f')][_0x965d('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3224d6[_0x965d('0x1f')]?_0x3224d6['options'][_0x965d('0x24')]||null:null,'attributes':_0x3224d6['options']?_0x3224d6[_0x965d('0x1f')][_0x965d('0x25')]||null:null,'limit':_0x3224d6[_0x965d('0x1f')]?_0x3224d6['options']['limit']||null:null})[_0x965d('0x21')](function(_0x346901){logger[_0x965d('0x11')]('UpdateFaxMessage',_0x3224d6);logger['debug'](_0x965d('0x22'),_0x3224d6,JSON['stringify'](_0x346901));_0x133350(_0x346901);})[_0x965d('0x1b')](function(_0x1af08b){logger['error'](_0x965d('0x22'),_0x1af08b[_0x965d('0x19')],_0x3224d6);_0x44f673(_0x12e75d['error'](0x1f4,_0x1af08b['message']));});});}; \ No newline at end of file +var _0xf45e=['CreateFaxMessage','create','body','options','raw','stringify','catch','UpdateFaxMessage','update','where','attributes','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','request','then','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','error','message','result'];(function(_0x46ec66,_0x5bbca8){var _0x5e4919=function(_0x3d5a20){while(--_0x3d5a20){_0x46ec66['push'](_0x46ec66['shift']());}};_0x5e4919(++_0x5bbca8);}(_0xf45e,0x115));var _0xef45=function(_0x4c2bac,_0x5750d4){_0x4c2bac=_0x4c2bac-0x0;var _0x3bc1dc=_0xf45e[_0x4c2bac];return _0x3bc1dc;};'use strict';var _=require(_0xef45('0x0'));var util=require('util');var moment=require(_0xef45('0x1'));var BPromise=require('bluebird');var rs=require(_0xef45('0x2'));var fs=require('fs');var Redis=require(_0xef45('0x3'));var db=require(_0xef45('0x4'))['db'];var utils=require(_0xef45('0x5'));var logger=require(_0xef45('0x6'))(_0xef45('0x7'));var config=require(_0xef45('0x8'));var jayson=require(_0xef45('0x9'));var client=jayson[_0xef45('0xa')][_0xef45('0xb')]({'port':0x232a});config[_0xef45('0xc')]=_[_0xef45('0xd')](config[_0xef45('0xc')],{'host':_0xef45('0xe'),'port':0x18eb});var socket=require(_0xef45('0xf'))(new Redis(config[_0xef45('0xc')]));require(_0xef45('0x10'))[_0xef45('0x11')](socket);function respondWithRpcPromise(_0xdac512,_0x4d5cc7,_0x3e852f){return new BPromise(function(_0x400d25,_0x46cfeb){return client[_0xef45('0x12')](_0xdac512,_0x3e852f)[_0xef45('0x13')](function(_0x2b429f){logger['info'](_0xef45('0x14'),_0x4d5cc7,_0xef45('0x15'));logger[_0xef45('0x16')](_0xef45('0x17'),_0x4d5cc7,_0xef45('0x15'),JSON['stringify'](_0x2b429f));if(_0x2b429f['error']){if(_0x2b429f[_0xef45('0x18')]['code']===0x1f4){logger[_0xef45('0x18')](_0xef45('0x14'),_0x4d5cc7,_0x2b429f[_0xef45('0x18')]['message']);return _0x46cfeb(_0x2b429f['error'][_0xef45('0x19')]);}logger['error'](_0xef45('0x14'),_0x4d5cc7,_0x2b429f[_0xef45('0x18')][_0xef45('0x19')]);return _0x400d25(_0x2b429f[_0xef45('0x18')]['message']);}else{logger['info'](_0xef45('0x14'),_0x4d5cc7,_0xef45('0x15'));_0x400d25(_0x2b429f[_0xef45('0x1a')][_0xef45('0x19')]);}})['catch'](function(_0x562955){logger[_0xef45('0x18')](_0xef45('0x14'),_0x4d5cc7,_0x562955);_0x46cfeb(_0x562955);});});}exports[_0xef45('0x1b')]=function(_0x30a2ea){var _0x1df5df=this;return new Promise(function(_0xde347f,_0x375cbd){return db['FaxMessage'][_0xef45('0x1c')](_0x30a2ea[_0xef45('0x1d')],{'raw':_0x30a2ea[_0xef45('0x1e')]?_0x30a2ea[_0xef45('0x1e')][_0xef45('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x40abc8){logger['info']('CreateFaxMessage',_0x30a2ea);logger[_0xef45('0x16')](_0xef45('0x1b'),_0x30a2ea,JSON[_0xef45('0x20')](_0x40abc8));_0xde347f(_0x40abc8);})[_0xef45('0x21')](function(_0x839eff){logger[_0xef45('0x18')](_0xef45('0x1b'),_0x839eff['message'],_0x30a2ea);_0x375cbd(_0x1df5df[_0xef45('0x18')](0x1f4,_0x839eff['message']));});});};exports[_0xef45('0x22')]=function(_0xdbb42d){var _0x578f03=this;return new Promise(function(_0x46e423,_0x2c356d){return db['FaxMessage'][_0xef45('0x23')](_0xdbb42d['body'],{'raw':_0xdbb42d['options']?_0xdbb42d['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xdbb42d[_0xef45('0x1e')]?_0xdbb42d[_0xef45('0x1e')][_0xef45('0x24')]||null:null,'attributes':_0xdbb42d[_0xef45('0x1e')]?_0xdbb42d['options'][_0xef45('0x25')]||null:null,'limit':_0xdbb42d['options']?_0xdbb42d[_0xef45('0x1e')]['limit']||null:null})[_0xef45('0x13')](function(_0x5bfd2d){logger['info'](_0xef45('0x22'),_0xdbb42d);logger[_0xef45('0x16')](_0xef45('0x22'),_0xdbb42d,JSON[_0xef45('0x20')](_0x5bfd2d));_0x46e423(_0x5bfd2d);})[_0xef45('0x21')](function(_0x5d56ae){logger['error']('UpdateFaxMessage',_0x5d56ae[_0xef45('0x19')],_0xdbb42d);_0x2c356d(_0x578f03[_0xef45('0x18')](0x1f4,_0x5d56ae[_0xef45('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 6b6b0ec..95c8540 100644 --- a/server/api/faxMessage/faxMessage.socket.js +++ b/server/api/faxMessage/faxMessage.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['register','length','faxMessage:','./faxMessage.events','save','remove','update','emit','removeListener'];(function(_0x4fbb86,_0x374ed0){var _0xb141fe=function(_0x382195){while(--_0x382195){_0x4fbb86['push'](_0x4fbb86['shift']());}};_0xb141fe(++_0x374ed0);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var FaxMessageEvents=require(_0x7995('0x0'));var events=[_0x7995('0x1'),_0x7995('0x2'),_0x7995('0x3')];function createListener(_0x5b96eb,_0x86c128){return function(_0x3c58eb){_0x86c128[_0x7995('0x4')](_0x5b96eb,_0x3c58eb);};}function removeListener(_0x462a03,_0x576d89){return function(){FaxMessageEvents[_0x7995('0x5')](_0x462a03,_0x576d89);};}exports[_0x7995('0x6')]=function(_0x137b6b){for(var _0x219534=0x0,_0xbda126=events[_0x7995('0x7')];_0x219534<_0xbda126;_0x219534++){var _0x4996ca=events[_0x219534];var _0x465276=createListener(_0x7995('0x8')+_0x4996ca,_0x137b6b);FaxMessageEvents['on'](_0x4996ca,_0x465276);}}; \ No newline at end of file +var _0xa9e0=['register','length','faxMessage:','./faxMessage.events','save','remove','emit','removeListener'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'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 981fe9a..32e67c3 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 _0x0962=['faxmessage:create','put','/:id/accept','accept','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./faxMessage.controller','get','index','/describe','/:id','isAuthenticated','show','/:id/download','download','post','tracked'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0962,0x116));var _0x2096=function(_0x5e09d7,_0x3e34e7){_0x5e09d7=_0x5e09d7-0x0;var _0x444a65=_0x0962[_0x5e09d7];return _0x444a65;};'use strict';var multer=require(_0x2096('0x0'));var util=require(_0x2096('0x1'));var path=require(_0x2096('0x2'));var timeout=require(_0x2096('0x3'));var express=require(_0x2096('0x4'));var router=express[_0x2096('0x5')]();var auth=require(_0x2096('0x6'));var interaction=require(_0x2096('0x7'));var config=require('../../config/environment');var controller=require(_0x2096('0x8'));router[_0x2096('0x9')]('/',auth['isAuthenticated'](),controller[_0x2096('0xa')]);router[_0x2096('0x9')](_0x2096('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x2096('0x9')](_0x2096('0xc'),auth[_0x2096('0xd')](),controller[_0x2096('0xe')]);router['get'](_0x2096('0xf'),auth[_0x2096('0xd')](),controller[_0x2096('0x10')]);router[_0x2096('0x11')]('/',auth['isAuthenticated'](),interaction[_0x2096('0x12')]('fax',_0x2096('0x13')),controller['create']);router['put']('/:id',auth[_0x2096('0xd')](),controller['update']);router[_0x2096('0x14')](_0x2096('0x15'),auth[_0x2096('0xd')](),controller[_0x2096('0x16')]);router['put']('/:id/reject',auth[_0x2096('0xd')](),controller[_0x2096('0x17')]);router[_0x2096('0x18')](_0x2096('0xc'),auth[_0x2096('0xd')](),controller[_0x2096('0x19')]);module[_0x2096('0x1a')]=router; \ No newline at end of file +var _0x8aae=['multer','util','path','express','Router','../../components/auth/service','./faxMessage.controller','get','isAuthenticated','index','/describe','/:id','/:id/download','post','faxmessage:create','create','put','update','/:id/accept','accept','/:id/reject','delete','destroy','exports'];(function(_0x266244,_0x4d55a4){var _0x187672=function(_0x2b63d7){while(--_0x2b63d7){_0x266244['push'](_0x266244['shift']());}};_0x187672(++_0x4d55a4);}(_0x8aae,0x138));var _0xe8aa=function(_0x3b1d1e,_0x2d20b9){_0x3b1d1e=_0x3b1d1e-0x0;var _0x1d22eb=_0x8aae[_0x3b1d1e];return _0x1d22eb;};'use strict';var multer=require(_0xe8aa('0x0'));var util=require(_0xe8aa('0x1'));var path=require(_0xe8aa('0x2'));var timeout=require('connect-timeout');var express=require(_0xe8aa('0x3'));var router=express[_0xe8aa('0x4')]();var auth=require(_0xe8aa('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe8aa('0x6'));router[_0xe8aa('0x7')]('/',auth[_0xe8aa('0x8')](),controller[_0xe8aa('0x9')]);router[_0xe8aa('0x7')](_0xe8aa('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0xe8aa('0x7')](_0xe8aa('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xe8aa('0x7')](_0xe8aa('0xc'),auth[_0xe8aa('0x8')](),controller['download']);router[_0xe8aa('0xd')]('/',auth['isAuthenticated'](),interaction['tracked']('fax',_0xe8aa('0xe')),controller[_0xe8aa('0xf')]);router[_0xe8aa('0x10')](_0xe8aa('0xb'),auth['isAuthenticated'](),controller[_0xe8aa('0x11')]);router['put'](_0xe8aa('0x12'),auth['isAuthenticated'](),controller[_0xe8aa('0x13')]);router[_0xe8aa('0x10')](_0xe8aa('0x14'),auth[_0xe8aa('0x8')](),controller['reject']);router[_0xe8aa('0x15')]('/:id',auth['isAuthenticated'](),controller[_0xe8aa('0x16')]);module[_0xe8aa('0x17')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 32725c3..4278dfa 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 _0x49f2=['roundrobin','sequelize','exports','STRING','INTEGER','ENUM','beepall'];(function(_0x13f6e3,_0x518fad){var _0x42cb40=function(_0x343224){while(--_0x343224){_0x13f6e3['push'](_0x13f6e3['shift']());}};_0x42cb40(++_0x518fad);}(_0x49f2,0x86));var _0x249f=function(_0x2f40e9,_0x2fe423){_0x2f40e9=_0x2f40e9-0x0;var _0x22254d=_0x49f2[_0x2f40e9];return _0x22254d;};'use strict';var Sequelize=require(_0x249f('0x0'));module[_0x249f('0x1')]={'name':{'type':Sequelize[_0x249f('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x249f('0x2')]},'timeout':{'type':Sequelize[_0x249f('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x249f('0x4')]('rrmemory',_0x249f('0x5'),_0x249f('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x249f('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb2ae=['roundrobin','INTEGER','sequelize','exports','STRING','name','rrmemory','beepall'];(function(_0x8a7e38,_0x473a5d){var _0x228609=function(_0x5dcb5c){while(--_0x5dcb5c){_0x8a7e38['push'](_0x8a7e38['shift']());}};_0x228609(++_0x473a5d);}(_0xb2ae,0x15a));var _0xeb2a=function(_0x1370b8,_0x20b4f7){_0x1370b8=_0x1370b8-0x0;var _0x2db439=_0xb2ae[_0x1370b8];return _0x2db439;};'use strict';var Sequelize=require(_0xeb2a('0x0'));module[_0xeb2a('0x1')]={'name':{'type':Sequelize[_0xeb2a('0x2')],'unique':_0xeb2a('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xeb2a('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xeb2a('0x4'),_0xeb2a('0x5'),_0xeb2a('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xeb2a('0x7')],'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 dc40c26..02f14b5 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 _0x0ffc=['toString','sequelize','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','emit','addAgents','spread','userFaxQueue:save','userFaxQueue:remove','getAgents','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','FaxQueues','sendStatus','error','send','index','map','FaxQueue','rawAttributes','type','name','keys','query','filters','intersection','model','attributes','fields','length','nolimit','limit','order','sort','pick','filter','VIRTUAL','merge','options','where','includeAll','include','catch','show','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','UserFaxQueue','hasOwnProperty','FaxQueueId','findAll','User','findAndCountAll','UserId','agent','faxPause','updatedAt','rows','%s/%s','SIP','createdAt','getTeams','findOne','addTeams','ids','Team','Agents','voicePause','transaction','each','findOrCreate','forEach','removeTeams','select','field','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push'];(function(_0x35d4e9,_0x298c61){var _0x5c2770=function(_0x2f326a){while(--_0x2f326a){_0x35d4e9['push'](_0x35d4e9['shift']());}};_0x5c2770(++_0x298c61);}(_0x0ffc,0x9e));var _0xc0ff=function(_0x41a37a,_0x1d68cc){_0x41a37a=_0x41a37a-0x0;var _0x1cd56a=_0x0ffc[_0x41a37a];return _0x1cd56a;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xc0ff('0x0'));var rimraf=require(_0xc0ff('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc0ff('0x2'));var rp=require('request-promise');var moment=require(_0xc0ff('0x3'));var BPromise=require(_0xc0ff('0x4'));var Mustache=require(_0xc0ff('0x5'));var util=require(_0xc0ff('0x6'));var path=require(_0xc0ff('0x7'));var sox=require(_0xc0ff('0x8'));var csv=require(_0xc0ff('0x9'));var ejs=require(_0xc0ff('0xa'));var fs=require('fs');var _=require(_0xc0ff('0xb'));var squel=require('squel');var crypto=require(_0xc0ff('0xc'));var jsforce=require(_0xc0ff('0xd'));var deskjs=require(_0xc0ff('0xe'));var toCsv=require(_0xc0ff('0x9'));var querystring=require(_0xc0ff('0xf'));var Papa=require(_0xc0ff('0x10'));var Redis=require(_0xc0ff('0x11'));var authService=require(_0xc0ff('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc0ff('0x13'));var logger=require('../../config/logger')(_0xc0ff('0x14'));var utils=require(_0xc0ff('0x15'));var config=require(_0xc0ff('0x16'));var db=require(_0xc0ff('0x17'))['db'];config['redis']=_[_0xc0ff('0x18')](config[_0xc0ff('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xc0ff('0x1a'))(new Redis(config['redis']));require('./faxQueue.socket')['register'](socket);function respondWithStatusCode(_0x2384b0,_0xa91369){_0xa91369=_0xa91369||0xcc;return function(_0x22c91d){if(_0x22c91d){return _0x2384b0['sendStatus'](_0xa91369);}return _0x2384b0[_0xc0ff('0x1b')](_0xa91369)[_0xc0ff('0x1c')]();};}function respondWithResult(_0x2ddf56,_0x3ab92b){_0x3ab92b=_0x3ab92b||0xc8;return function(_0x2752f1){if(_0x2752f1){return _0x2ddf56[_0xc0ff('0x1b')](_0x3ab92b)[_0xc0ff('0x1d')](_0x2752f1);}};}function respondWithFilteredResult(_0x33c72a,_0x136b31){return function(_0x11014a){if(_0x11014a){var _0x265a63=_0x11014a[_0xc0ff('0x1e')],_0x4e8a36=_0x136b31[_0xc0ff('0x1f')],_0x21b852=_0x136b31[_0xc0ff('0x1f')]+_0x136b31['limit'],_0x5939e9;if(_0x21b852>=_0x265a63){_0x21b852=_0x265a63;_0x5939e9=0xc8;}else{_0x5939e9=0xce;}_0x33c72a[_0xc0ff('0x1b')](_0x5939e9);return _0x33c72a[_0xc0ff('0x20')](_0xc0ff('0x21'),_0x4e8a36+'-'+_0x21b852+'/'+_0x265a63)[_0xc0ff('0x1d')](_0x11014a);}return null;};}function patchUpdates(_0x362db7){return function(_0x1fd7ad){try{jsonpatch[_0xc0ff('0x22')](_0x1fd7ad,_0x362db7,!![]);}catch(_0x23b2a0){return BPromise[_0xc0ff('0x23')](_0x23b2a0);}return _0x1fd7ad[_0xc0ff('0x24')]();};}function saveUpdates(_0x153850,_0x219be9){return function(_0xee982d){if(_0xee982d){return _0xee982d[_0xc0ff('0x25')](_0x153850)[_0xc0ff('0x26')](function(_0x26ce8a){return _0x26ce8a;});}return null;};}function removeEntity(_0x5ce43e,_0x4200d4){return function(_0x5ba2c3){if(_0x5ba2c3){return _0x5ba2c3[_0xc0ff('0x27')]()[_0xc0ff('0x26')](function(){var _0x421924=_0x5ba2c3[_0xc0ff('0x28')]({'plain':!![]});var _0x25f8a0=_0xc0ff('0x29');return db['UserProfileResource'][_0xc0ff('0x27')]({'where':{'type':_0x25f8a0,'resourceId':_0x421924['id']}})[_0xc0ff('0x26')](function(){return _0x5ba2c3;});})['then'](function(){_0x5ce43e['status'](0xcc)[_0xc0ff('0x1c')]();});}};}function handleEntityNotFound(_0x1ea3a9,_0x2509ce){return function(_0x1b0fe2){if(!_0x1b0fe2){_0x1ea3a9[_0xc0ff('0x2a')](0x194);}return _0x1b0fe2;};}function handleError(_0xd0115e,_0x3d5699){_0x3d5699=_0x3d5699||0x1f4;return function(_0xed7156){logger[_0xc0ff('0x2b')](_0xed7156['stack']);if(_0xed7156['name']){delete _0xed7156['name'];}_0xd0115e[_0xc0ff('0x1b')](_0x3d5699)[_0xc0ff('0x2c')](_0xed7156);};}exports[_0xc0ff('0x2d')]=function(_0xf60f5a,_0x5c17ff){var _0x773814={},_0x1cd2d4={},_0x327822={'count':0x0,'rows':[]};var _0x22c943=_[_0xc0ff('0x2e')](db[_0xc0ff('0x2f')][_0xc0ff('0x30')],function(_0xb99550){return{'name':_0xb99550['fieldName'],'type':_0xb99550[_0xc0ff('0x31')]['key']};});_0x1cd2d4['model']=_[_0xc0ff('0x2e')](_0x22c943,_0xc0ff('0x32'));_0x1cd2d4['query']=_[_0xc0ff('0x33')](_0xf60f5a[_0xc0ff('0x34')]);_0x1cd2d4[_0xc0ff('0x35')]=_[_0xc0ff('0x36')](_0x1cd2d4[_0xc0ff('0x37')],_0x1cd2d4[_0xc0ff('0x34')]);_0x773814[_0xc0ff('0x38')]=_['intersection'](_0x1cd2d4[_0xc0ff('0x37')],qs[_0xc0ff('0x39')](_0xf60f5a['query'][_0xc0ff('0x39')]));_0x773814[_0xc0ff('0x38')]=_0x773814[_0xc0ff('0x38')][_0xc0ff('0x3a')]?_0x773814[_0xc0ff('0x38')]:_0x1cd2d4['model'];if(!_0xf60f5a['query']['hasOwnProperty'](_0xc0ff('0x3b'))){_0x773814[_0xc0ff('0x3c')]=qs[_0xc0ff('0x3c')](_0xf60f5a[_0xc0ff('0x34')][_0xc0ff('0x3c')]);_0x773814['offset']=qs[_0xc0ff('0x1f')](_0xf60f5a['query']['offset']);}_0x773814[_0xc0ff('0x3d')]=qs[_0xc0ff('0x3e')](_0xf60f5a['query'][_0xc0ff('0x3e')]);_0x773814['where']=qs[_0xc0ff('0x35')](_[_0xc0ff('0x3f')](_0xf60f5a[_0xc0ff('0x34')],_0x1cd2d4[_0xc0ff('0x35')]));if(_0xf60f5a[_0xc0ff('0x34')][_0xc0ff('0x40')]){_0x773814['where']=_['merge'](_0x773814['where'],{'$or':_[_0xc0ff('0x2e')](_0x22c943,function(_0x135014){if(_0x135014[_0xc0ff('0x31')]!==_0xc0ff('0x41')){var _0x39e678={};_0x39e678[_0x135014['name']]={'$like':'%'+_0xf60f5a[_0xc0ff('0x34')][_0xc0ff('0x40')]+'%'};return _0x39e678;}})});}_0x773814=_[_0xc0ff('0x42')]({},_0x773814,_0xf60f5a[_0xc0ff('0x43')]);var _0x294bf3={'where':_0x773814[_0xc0ff('0x44')]};return db[_0xc0ff('0x2f')][_0xc0ff('0x1e')](_0x294bf3)[_0xc0ff('0x26')](function(_0x2e5c8b){_0x327822[_0xc0ff('0x1e')]=_0x2e5c8b;if(_0xf60f5a[_0xc0ff('0x34')][_0xc0ff('0x45')]){_0x773814[_0xc0ff('0x46')]=[{'all':!![]}];}return db[_0xc0ff('0x2f')]['findAll'](_0x773814);})[_0xc0ff('0x26')](function(_0x3e9336){_0x327822['rows']=_0x3e9336;return _0x327822;})[_0xc0ff('0x26')](respondWithFilteredResult(_0x5c17ff,_0x773814))[_0xc0ff('0x47')](handleError(_0x5c17ff,null));};exports[_0xc0ff('0x48')]=function(_0x1bd6a1,_0x3bc88d){var _0x125335={'raw':!![],'where':{'id':_0x1bd6a1['params']['id']}},_0x31e6cb={};_0x31e6cb[_0xc0ff('0x37')]=_[_0xc0ff('0x33')](db[_0xc0ff('0x2f')][_0xc0ff('0x30')]);_0x31e6cb[_0xc0ff('0x34')]=_[_0xc0ff('0x33')](_0x1bd6a1['query']);_0x31e6cb[_0xc0ff('0x35')]=_[_0xc0ff('0x36')](_0x31e6cb[_0xc0ff('0x37')],_0x31e6cb[_0xc0ff('0x34')]);_0x125335[_0xc0ff('0x38')]=_[_0xc0ff('0x36')](_0x31e6cb[_0xc0ff('0x37')],qs[_0xc0ff('0x39')](_0x1bd6a1[_0xc0ff('0x34')][_0xc0ff('0x39')]));_0x125335[_0xc0ff('0x38')]=_0x125335[_0xc0ff('0x38')][_0xc0ff('0x3a')]?_0x125335[_0xc0ff('0x38')]:_0x31e6cb[_0xc0ff('0x37')];if(_0x1bd6a1['query'][_0xc0ff('0x45')]){_0x125335[_0xc0ff('0x46')]=[{'all':!![]}];}_0x125335=_['merge']({},_0x125335,_0x1bd6a1[_0xc0ff('0x43')]);return db[_0xc0ff('0x2f')][_0xc0ff('0x49')](_0x125335)[_0xc0ff('0x26')](handleEntityNotFound(_0x3bc88d,null))[_0xc0ff('0x26')](respondWithResult(_0x3bc88d,null))['catch'](handleError(_0x3bc88d,null));};exports[_0xc0ff('0x4a')]=function(_0xf67716,_0x4cf99e){return db[_0xc0ff('0x2f')]['create'](_0xf67716[_0xc0ff('0x4b')],{})['then'](function(_0x3eca5e){var _0x3d9159=_0xf67716['user'][_0xc0ff('0x28')]({'plain':!![]});if(!_0x3d9159)throw new Error(_0xc0ff('0x4c'));if(_0x3d9159[_0xc0ff('0x4d')]===_0xc0ff('0x4e')){var _0x436ef2=_0x3eca5e['get']({'plain':!![]});var _0x196e46=_0xc0ff('0x29');return db['UserProfileSection'][_0xc0ff('0x49')]({'where':{'name':_0x196e46,'userProfileId':_0x3d9159[_0xc0ff('0x4f')]},'raw':!![]})[_0xc0ff('0x26')](function(_0x49a00f){if(_0x49a00f&&_0x49a00f[_0xc0ff('0x50')]===0x0){return db['UserProfileResource'][_0xc0ff('0x4a')]({'name':_0x436ef2[_0xc0ff('0x32')],'resourceId':_0x436ef2['id'],'type':_0x49a00f[_0xc0ff('0x32')],'sectionId':_0x49a00f['id']},{})[_0xc0ff('0x26')](function(){return _0x3eca5e;});}else{return _0x3eca5e;}})[_0xc0ff('0x47')](function(_0x1a186f){logger[_0xc0ff('0x2b')](_0xc0ff('0x51'),_0x1a186f);throw _0x1a186f;});}return _0x3eca5e;})[_0xc0ff('0x26')](respondWithResult(_0x4cf99e,0xc9))[_0xc0ff('0x47')](handleError(_0x4cf99e,null));};exports[_0xc0ff('0x25')]=function(_0x3b7825,_0x210ffb){if(_0x3b7825[_0xc0ff('0x4b')]['id']){delete _0x3b7825['body']['id'];}return db[_0xc0ff('0x2f')][_0xc0ff('0x49')]({'where':{'id':_0x3b7825[_0xc0ff('0x52')]['id']}})[_0xc0ff('0x26')](handleEntityNotFound(_0x210ffb,null))[_0xc0ff('0x26')](saveUpdates(_0x3b7825['body'],null))[_0xc0ff('0x26')](respondWithResult(_0x210ffb,null))[_0xc0ff('0x47')](handleError(_0x210ffb,null));};exports[_0xc0ff('0x27')]=function(_0x2be1cc,_0x350665){return db[_0xc0ff('0x2f')]['find']({'where':{'id':_0x2be1cc['params']['id']}})[_0xc0ff('0x26')](handleEntityNotFound(_0x350665,null))[_0xc0ff('0x26')](removeEntity(_0x350665,null))[_0xc0ff('0x47')](handleError(_0x350665,null));};exports[_0xc0ff('0x53')]=function(_0x51f38e,_0x27a18d){return db['FaxQueue'][_0xc0ff('0x53')]()[_0xc0ff('0x26')](respondWithResult(_0x27a18d,null))[_0xc0ff('0x47')](handleError(_0x27a18d,null));};exports[_0xc0ff('0x54')]=function(_0x22be6c,_0x568de9,_0x16cfa6){var _0x43c2f7={'raw':!![],'where':{}},_0x2f8122={},_0x2ab795;return db[_0xc0ff('0x2f')]['findOne']({'where':{'id':_0x22be6c[_0xc0ff('0x52')]['id']}})[_0xc0ff('0x26')](handleEntityNotFound(_0x568de9,null))['then'](function(_0x2cda14){if(_0x2cda14){_0x2ab795=_0x2cda14['get']({'plain':!![]});_0x2f8122[_0xc0ff('0x37')]=_[_0xc0ff('0x33')](db[_0xc0ff('0x55')][_0xc0ff('0x30')]);_0x2f8122[_0xc0ff('0x34')]=_[_0xc0ff('0x33')](_0x22be6c[_0xc0ff('0x34')]);_0x2f8122[_0xc0ff('0x35')]=_[_0xc0ff('0x36')](_0x2f8122[_0xc0ff('0x37')],_0x2f8122['query']);_0x43c2f7['attributes']=_[_0xc0ff('0x36')](_0x2f8122['model'],qs[_0xc0ff('0x39')](_0x22be6c[_0xc0ff('0x34')][_0xc0ff('0x39')]));_0x43c2f7[_0xc0ff('0x38')]=_0x43c2f7[_0xc0ff('0x38')][_0xc0ff('0x3a')]?_0x43c2f7[_0xc0ff('0x38')]:_0x2f8122['model'];if(!_0x22be6c['query'][_0xc0ff('0x56')]('nolimit')){_0x43c2f7[_0xc0ff('0x3c')]=qs[_0xc0ff('0x3c')](_0x22be6c['query'][_0xc0ff('0x3c')]);_0x43c2f7[_0xc0ff('0x1f')]=qs['offset'](_0x22be6c[_0xc0ff('0x34')][_0xc0ff('0x1f')]);}_0x43c2f7[_0xc0ff('0x3d')]=qs[_0xc0ff('0x3e')](_0x22be6c[_0xc0ff('0x34')]['sort']);_0x43c2f7['where']=qs[_0xc0ff('0x35')](_[_0xc0ff('0x3f')](_0x22be6c[_0xc0ff('0x34')],_0x2f8122[_0xc0ff('0x35')]));_0x43c2f7[_0xc0ff('0x44')][_0xc0ff('0x57')]=_0x2cda14['id'];if(_0x22be6c[_0xc0ff('0x34')][_0xc0ff('0x40')]){_0x43c2f7[_0xc0ff('0x44')]=_[_0xc0ff('0x42')](_0x43c2f7[_0xc0ff('0x44')],{'$or':_[_0xc0ff('0x2e')](_0x43c2f7['attributes'],function(_0x5261fc){var _0x1ecb4b={};_0x1ecb4b[_0x5261fc]={'$like':'%'+_0x22be6c[_0xc0ff('0x34')]['filter']+'%'};return _0x1ecb4b;})});}_0x43c2f7=_['merge']({},_0x43c2f7,_0x22be6c[_0xc0ff('0x43')]);return db[_0xc0ff('0x55')][_0xc0ff('0x58')](_0x43c2f7);}})[_0xc0ff('0x26')](function(_0x297dbe){if(_0x297dbe){return db[_0xc0ff('0x59')][_0xc0ff('0x5a')]({'where':{'id':_[_0xc0ff('0x2e')](_0x297dbe,_0xc0ff('0x5b')),'role':_0xc0ff('0x5c')},'attributes':['id','name',_0xc0ff('0x5d'),_0xc0ff('0x5e'),'createdAt']});}})[_0xc0ff('0x26')](function(_0x3c78f9){if(_0x3c78f9){return{'count':_0x3c78f9[_0xc0ff('0x1e')],'rows':_[_0xc0ff('0x2e')](_0x3c78f9[_0xc0ff('0x5f')],function(_0x5a359b){return{'membername':_0x5a359b['name'],'UserId':_0x5a359b['id'],'queue_name':_0x2ab795[_0xc0ff('0x32')],'FaxQueueId':_0x2ab795['id'],'interface':util['format'](_0xc0ff('0x60'),_0xc0ff('0x61'),_0x5a359b[_0xc0ff('0x32')]),'penalty':0x0,'paused':_0x5a359b[_0xc0ff('0x5d')],'createdAt':_0x5a359b[_0xc0ff('0x62')],'updatedAt':_0x5a359b['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x568de9,_0x43c2f7))[_0xc0ff('0x47')](handleError(_0x568de9,null));};exports[_0xc0ff('0x63')]=function(_0x5c3bac,_0x48df87,_0x344a23){var _0x39bd8f={};var _0xfa4855={};var _0x428d01;var _0x25a162;return db[_0xc0ff('0x2f')][_0xc0ff('0x64')]({'where':{'id':_0x5c3bac[_0xc0ff('0x52')]['id']}})[_0xc0ff('0x26')](handleEntityNotFound(_0x48df87,null))[_0xc0ff('0x26')](function(_0x1f799c){if(_0x1f799c){_0x428d01=_0x1f799c;_0xfa4855[_0xc0ff('0x37')]=_[_0xc0ff('0x33')](db['Team'][_0xc0ff('0x30')]);_0xfa4855[_0xc0ff('0x34')]=_[_0xc0ff('0x33')](_0x5c3bac['query']);_0xfa4855[_0xc0ff('0x35')]=_['intersection'](_0xfa4855[_0xc0ff('0x37')],_0xfa4855['query']);_0x39bd8f[_0xc0ff('0x38')]=_[_0xc0ff('0x36')](_0xfa4855[_0xc0ff('0x37')],qs['fields'](_0x5c3bac[_0xc0ff('0x34')][_0xc0ff('0x39')]));_0x39bd8f['attributes']=_0x39bd8f[_0xc0ff('0x38')]['length']?_0x39bd8f[_0xc0ff('0x38')]:_0xfa4855['model'];_0x39bd8f['order']=qs[_0xc0ff('0x3e')](_0x5c3bac[_0xc0ff('0x34')]['sort']);_0x39bd8f[_0xc0ff('0x44')]=qs[_0xc0ff('0x35')](_['pick'](_0x5c3bac[_0xc0ff('0x34')],_0xfa4855['filters']));if(_0x5c3bac[_0xc0ff('0x34')][_0xc0ff('0x40')]){_0x39bd8f['where']=_[_0xc0ff('0x42')](_0x39bd8f['where'],{'$or':_[_0xc0ff('0x2e')](_0x39bd8f['attributes'],function(_0x288ba5){var _0x20da33={};_0x20da33[_0x288ba5]={'$like':'%'+_0x5c3bac[_0xc0ff('0x34')][_0xc0ff('0x40')]+'%'};return _0x20da33;})});}_0x39bd8f=_[_0xc0ff('0x42')]({},_0x39bd8f,_0x5c3bac['options']);return _0x428d01[_0xc0ff('0x63')](_0x39bd8f);}})['then'](function(_0x72d3b0){if(_0x72d3b0){_0x25a162=_0x72d3b0['length'];if(!_0x5c3bac[_0xc0ff('0x34')][_0xc0ff('0x56')](_0xc0ff('0x3b'))){_0x39bd8f[_0xc0ff('0x3c')]=qs[_0xc0ff('0x3c')](_0x5c3bac[_0xc0ff('0x34')][_0xc0ff('0x3c')]);_0x39bd8f[_0xc0ff('0x1f')]=qs[_0xc0ff('0x1f')](_0x5c3bac[_0xc0ff('0x34')][_0xc0ff('0x1f')]);}return _0x428d01[_0xc0ff('0x63')](_0x39bd8f);}})[_0xc0ff('0x26')](function(_0x2f5e67){if(_0x2f5e67){return _0x2f5e67?{'count':_0x25a162,'rows':_0x2f5e67}:null;}})['then'](respondWithResult(_0x48df87,null))[_0xc0ff('0x47')](handleError(_0x48df87,null));};exports[_0xc0ff('0x65')]=function(_0x52e581,_0x2bd936,_0x3804eb){var _0x3f78d6=_0x52e581[_0xc0ff('0x4b')][_0xc0ff('0x66')];return db[_0xc0ff('0x67')]['findAll']({'where':{'id':_0x3f78d6},'attributes':['id'],'include':[{'model':db[_0xc0ff('0x59')],'as':_0xc0ff('0x68'),'attributes':['id',_0xc0ff('0x32'),'online',_0xc0ff('0x69'),'interface'],'raw':!![]}]})[_0xc0ff('0x26')](function(_0x4e302c){if(_0x4e302c){var _0x2ca0cc=_['flatMap'](_0x4e302c,function(_0x238e4a){var _0x4031d9=_0x238e4a['get']({'plain':!![]});return _0x4031d9[_0xc0ff('0x68')];});return db[_0xc0ff('0x2f')][_0xc0ff('0x49')]({'where':{'id':_0x52e581[_0xc0ff('0x52')]['id']}})[_0xc0ff('0x26')](function(_0x3e11e2){return db['sequelize'][_0xc0ff('0x6a')](function(_0x1d39c4){return _0x3e11e2[_0xc0ff('0x65')](_0x3f78d6,{'transaction':_0x1d39c4})[_0xc0ff('0x26')](function(){return BPromise[_0xc0ff('0x6b')](_0x2ca0cc,function(_0x474683){return db[_0xc0ff('0x55')][_0xc0ff('0x6c')]({'where':{'UserId':_0x474683['id'],'FaxQueueId':_0x52e581['params']['id']},'transaction':_0x1d39c4});});})[_0xc0ff('0x26')](function(){_0x2ca0cc[_0xc0ff('0x6d')](function(_0x5dbd4f){socket['emit']('userFaxQueue:save',{'UserId':_0x5dbd4f['id'],'FaxQueueId':_0x3e11e2['id']});});});});});}})[_0xc0ff('0x26')](respondWithStatusCode(_0x2bd936,null))[_0xc0ff('0x47')](handleError(_0x2bd936,null));};exports[_0xc0ff('0x6e')]=function(_0x302850,_0x4e3543,_0x41dfe6){return db[_0xc0ff('0x67')][_0xc0ff('0x58')]({'where':{'id':_0x302850[_0xc0ff('0x34')][_0xc0ff('0x66')]},'attributes':['id'],'include':[{'model':db[_0xc0ff('0x59')],'as':_0xc0ff('0x68'),'attributes':['id'],'raw':!![]}]})[_0xc0ff('0x26')](handleEntityNotFound(_0x4e3543,null))[_0xc0ff('0x26')](function(_0xa7e379){var _0x556546=_['map'](_0xa7e379,'id');var _0x4fa9ca=[];var _0x85ddb7=[];var _0x59d9da=squel[_0xc0ff('0x6f')]();_0x59d9da[_0xc0ff('0x70')](_0xc0ff('0x71'))[_0xc0ff('0x72')](_0xc0ff('0x73'),'tq')[_0xc0ff('0x74')](_0xc0ff('0x75'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0xc0ff('0x76'),_0x302850['params']['id']);for(var _0x1f1658=0x0;_0x1f1658<_0xa7e379['length'];_0x1f1658+=0x1){let _0x20d27b=_0xa7e379[_0x1f1658];for(var _0x341871=0x0;_0x341871<_0x20d27b[_0xc0ff('0x68')][_0xc0ff('0x3a')];_0x341871+=0x1){let _0x11824c=_0x20d27b[_0xc0ff('0x68')][_0x341871];var _0x1d6e1d=_0x59d9da[_0xc0ff('0x77')]();_0x1d6e1d[_0xc0ff('0x44')](_0xc0ff('0x78'),_0x11824c['id']);_0x85ddb7[_0xc0ff('0x79')](db['sequelize'][_0xc0ff('0x34')](_0x1d6e1d[_0xc0ff('0x7a')](),{'type':db[_0xc0ff('0x7b')]['QueryTypes'][_0xc0ff('0x7c')]})[_0xc0ff('0x26')](function(_0x21a656){if(_0x21a656[_0xc0ff('0x3a')]===0x1){return _0x11824c['id'];}else{var _0x1f20a1=_[_0xc0ff('0x7d')](_[_0xc0ff('0x2e')](_0x21a656,_0xc0ff('0x7e')),function(_0x1a66e9){return _[_0xc0ff('0x7f')](_0x556546,_0x1a66e9);});if(_0x1f20a1){return _0x11824c['id'];}}}));}}return BPromise[_0xc0ff('0x80')](_0x85ddb7)['then'](function(_0x2fad96){_0x4fa9ca=_(_0x4fa9ca)[_0xc0ff('0x81')](_0x2fad96)[_0xc0ff('0x82')]()[_0xc0ff('0x83')]();return db['FaxQueue'][_0xc0ff('0x49')]({'where':{'id':_0x302850['params']['id']}})['then'](function(_0x2a64eb){return db[_0xc0ff('0x7b')][_0xc0ff('0x6a')](function(_0x1665b3){return _0x2a64eb['removeTeams'](_0x302850[_0xc0ff('0x34')]['ids'],{'transaction':_0x1665b3})[_0xc0ff('0x26')](function(){if(!_[_0xc0ff('0x84')](_0x4fa9ca)){return _0x2a64eb[_0xc0ff('0x85')](_0x4fa9ca,{'transaction':_0x1665b3});}})[_0xc0ff('0x26')](function(){_0x4fa9ca['forEach'](function(_0x50616d){socket[_0xc0ff('0x86')]('userFaxQueue:remove',{'UserId':_0x50616d,'FaxQueueId':_0x2a64eb['id']});});});});});});})[_0xc0ff('0x26')](respondWithStatusCode(_0x4e3543,null))[_0xc0ff('0x47')](handleError(_0x4e3543,null));};exports[_0xc0ff('0x87')]=function(_0x331950,_0x2e357c,_0x3c3e43){return db[_0xc0ff('0x2f')][_0xc0ff('0x49')]({'where':{'id':_0x331950[_0xc0ff('0x52')]['id']}})[_0xc0ff('0x26')](handleEntityNotFound(_0x2e357c,null))[_0xc0ff('0x26')](function(_0x1d5b86){if(_0x1d5b86){return _0x1d5b86['addAgents'](_0x331950[_0xc0ff('0x4b')][_0xc0ff('0x66')],_['omit'](_0x331950[_0xc0ff('0x4b')],[_0xc0ff('0x66'),'id'])||{})[_0xc0ff('0x88')](function(_0x5bf4b7){for(var _0x1aaed4=0x0;_0x1aaed4<_0x331950[_0xc0ff('0x4b')][_0xc0ff('0x66')]['length'];_0x1aaed4+=0x1){socket[_0xc0ff('0x86')](_0xc0ff('0x89'),{'UserId':_0x331950[_0xc0ff('0x4b')][_0xc0ff('0x66')][_0x1aaed4],'FaxQueueId':_0x331950['params']['id']});}return _0x5bf4b7;});}})[_0xc0ff('0x26')](respondWithResult(_0x2e357c,null))[_0xc0ff('0x47')](handleError(_0x2e357c,null));};exports[_0xc0ff('0x85')]=function(_0xe309f4,_0x2b36dd,_0x408a51){return db[_0xc0ff('0x2f')][_0xc0ff('0x49')]({'where':{'id':_0xe309f4[_0xc0ff('0x52')]['id']}})[_0xc0ff('0x26')](handleEntityNotFound(_0x2b36dd,null))[_0xc0ff('0x26')](function(_0x1da5c1){if(_0x1da5c1){return _0x1da5c1[_0xc0ff('0x85')](_0xe309f4[_0xc0ff('0x34')][_0xc0ff('0x66')])[_0xc0ff('0x26')](function(){if(_['isArray'](_0xe309f4[_0xc0ff('0x34')]['ids'])){for(var _0x50c780=0x0;_0x50c780<_0xe309f4[_0xc0ff('0x34')][_0xc0ff('0x66')][_0xc0ff('0x3a')];_0x50c780+=0x1){socket[_0xc0ff('0x86')]('userFaxQueue:remove',{'UserId':Number(_0xe309f4[_0xc0ff('0x34')][_0xc0ff('0x66')][_0x50c780]),'FaxQueueId':Number(_0xe309f4[_0xc0ff('0x52')]['id'])});}}else{socket[_0xc0ff('0x86')](_0xc0ff('0x8a'),{'UserId':Number(_0xe309f4[_0xc0ff('0x34')][_0xc0ff('0x66')]),'FaxQueueId':Number(_0xe309f4['params']['id'])});}});}})[_0xc0ff('0x26')](respondWithStatusCode(_0x2b36dd,null))[_0xc0ff('0x47')](handleError(_0x2b36dd,null));};exports[_0xc0ff('0x8b')]=function(_0x27853f,_0x2d3332,_0x28dc94){var _0x45bb15={};var _0x4723ac={};var _0x448a6e;var _0x336ab9;return db[_0xc0ff('0x2f')][_0xc0ff('0x64')]({'where':{'id':_0x27853f[_0xc0ff('0x52')]['id']}})[_0xc0ff('0x26')](handleEntityNotFound(_0x2d3332,null))[_0xc0ff('0x26')](function(_0x2b2cf7){if(_0x2b2cf7){_0x448a6e=_0x2b2cf7;_0x4723ac['model']=_['keys'](db['User'][_0xc0ff('0x30')]);_0x4723ac[_0xc0ff('0x34')]=_[_0xc0ff('0x33')](_0x27853f[_0xc0ff('0x34')]);_0x4723ac[_0xc0ff('0x35')]=_[_0xc0ff('0x36')](_0x4723ac[_0xc0ff('0x37')],_0x4723ac['query']);_0x45bb15[_0xc0ff('0x38')]=_['intersection'](_0x4723ac['model'],qs[_0xc0ff('0x39')](_0x27853f[_0xc0ff('0x34')]['fields']));_0x45bb15['attributes']=_0x45bb15['attributes'][_0xc0ff('0x3a')]?_0x45bb15[_0xc0ff('0x38')]:_0x4723ac[_0xc0ff('0x37')];_0x45bb15['order']=qs[_0xc0ff('0x3e')](_0x27853f[_0xc0ff('0x34')][_0xc0ff('0x3e')]);_0x45bb15[_0xc0ff('0x44')]=qs[_0xc0ff('0x35')](_[_0xc0ff('0x3f')](_0x27853f[_0xc0ff('0x34')],_0x4723ac[_0xc0ff('0x35')]));if(_0x27853f['query'][_0xc0ff('0x40')]){_0x45bb15['where']=_['merge'](_0x45bb15[_0xc0ff('0x44')],{'$or':_['map'](_0x45bb15[_0xc0ff('0x38')],function(_0x3b2fab){var _0x31874a={};_0x31874a[_0x3b2fab]={'$like':'%'+_0x27853f[_0xc0ff('0x34')][_0xc0ff('0x40')]+'%'};return _0x31874a;})});}_0x45bb15=_[_0xc0ff('0x42')]({},_0x45bb15,_0x27853f[_0xc0ff('0x43')]);return _0x448a6e['getAgents'](_0x45bb15);}})[_0xc0ff('0x26')](function(_0x412c0c){if(_0x412c0c){_0x336ab9=_0x412c0c[_0xc0ff('0x3a')];if(!_0x27853f['query']['hasOwnProperty'](_0xc0ff('0x3b'))){_0x45bb15[_0xc0ff('0x3c')]=qs[_0xc0ff('0x3c')](_0x27853f[_0xc0ff('0x34')]['limit']);_0x45bb15[_0xc0ff('0x1f')]=qs[_0xc0ff('0x1f')](_0x27853f[_0xc0ff('0x34')][_0xc0ff('0x1f')]);}return _0x448a6e[_0xc0ff('0x8b')](_0x45bb15);}})[_0xc0ff('0x26')](function(_0xa9fe39){if(_0xa9fe39){return _0xa9fe39?{'count':_0x336ab9,'rows':_0xa9fe39}:null;}})[_0xc0ff('0x26')](respondWithResult(_0x2d3332,null))[_0xc0ff('0x47')](handleError(_0x2d3332,null));}; \ No newline at end of file +var _0xceef=['end','json','count','offset','set','Content-Range','apply','reject','update','then','destroy','get','FaxQueues','UserProfileResource','stack','name','send','index','map','FaxQueue','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','error','body','describe','getMembers','findOne','pick','User','findAndCountAll','UserId','faxPause','updatedAt','createdAt','SIP','getTeams','Team','Agents','online','voicePause','interface','flatMap','transaction','addTeams','each','findOrCreate','forEach','removeTeams','ids','select','field','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','SELECT','every','TeamId','includes','all','union','value','removeAgents','userFaxQueue:remove','omit','spread','userFaxQueue:save','isArray','emit','getAgents','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./faxQueue.socket','sendStatus','status'];(function(_0x44653b,_0x280fe3){var _0x1af7e6=function(_0x323f50){while(--_0x323f50){_0x44653b['push'](_0x44653b['shift']());}};_0x1af7e6(++_0x280fe3);}(_0xceef,0xf6));var _0xfcee=function(_0x4d69a6,_0x44cbe8){_0x4d69a6=_0x4d69a6-0x0;var _0x56739a=_0xceef[_0x4d69a6];return _0x56739a;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xfcee('0x0'));var zipdir=require(_0xfcee('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfcee('0x2'));var moment=require('moment');var BPromise=require(_0xfcee('0x3'));var Mustache=require(_0xfcee('0x4'));var util=require('util');var path=require(_0xfcee('0x5'));var sox=require(_0xfcee('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xfcee('0x7'));var squel=require(_0xfcee('0x8'));var crypto=require(_0xfcee('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xfcee('0xa'));var querystring=require(_0xfcee('0xb'));var Papa=require(_0xfcee('0xc'));var Redis=require(_0xfcee('0xd'));var authService=require(_0xfcee('0xe'));var qs=require(_0xfcee('0xf'));var as=require(_0xfcee('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfcee('0x11'))(_0xfcee('0x12'));var utils=require(_0xfcee('0x13'));var config=require(_0xfcee('0x14'));var db=require(_0xfcee('0x15'))['db'];config[_0xfcee('0x16')]=_[_0xfcee('0x17')](config[_0xfcee('0x16')],{'host':_0xfcee('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfcee('0x16')]));require(_0xfcee('0x19'))['register'](socket);function respondWithStatusCode(_0x49f23b,_0x260897){_0x260897=_0x260897||0xcc;return function(_0x39e61b){if(_0x39e61b){return _0x49f23b[_0xfcee('0x1a')](_0x260897);}return _0x49f23b[_0xfcee('0x1b')](_0x260897)[_0xfcee('0x1c')]();};}function respondWithResult(_0x2dded0,_0x486334){_0x486334=_0x486334||0xc8;return function(_0x50543a){if(_0x50543a){return _0x2dded0[_0xfcee('0x1b')](_0x486334)[_0xfcee('0x1d')](_0x50543a);}};}function respondWithFilteredResult(_0x520d4a,_0x12a9b6){return function(_0x380c59){if(_0x380c59){var _0x45c690=_0x380c59[_0xfcee('0x1e')],_0x47ddd8=_0x12a9b6[_0xfcee('0x1f')],_0x37fa9c=_0x12a9b6['offset']+_0x12a9b6['limit'],_0x13ec8b;if(_0x37fa9c>=_0x45c690){_0x37fa9c=_0x45c690;_0x13ec8b=0xc8;}else{_0x13ec8b=0xce;}_0x520d4a[_0xfcee('0x1b')](_0x13ec8b);return _0x520d4a[_0xfcee('0x20')](_0xfcee('0x21'),_0x47ddd8+'-'+_0x37fa9c+'/'+_0x45c690)[_0xfcee('0x1d')](_0x380c59);}return null;};}function patchUpdates(_0xe3d469){return function(_0xb5f3db){try{jsonpatch[_0xfcee('0x22')](_0xb5f3db,_0xe3d469,!![]);}catch(_0x51eada){return BPromise[_0xfcee('0x23')](_0x51eada);}return _0xb5f3db['save']();};}function saveUpdates(_0x5d8b52,_0x1c9556){return function(_0x46b1de){if(_0x46b1de){return _0x46b1de[_0xfcee('0x24')](_0x5d8b52)[_0xfcee('0x25')](function(_0x4fb8cb){return _0x4fb8cb;});}return null;};}function removeEntity(_0x463df4,_0x17694f){return function(_0x3cf678){if(_0x3cf678){return _0x3cf678[_0xfcee('0x26')]()[_0xfcee('0x25')](function(){var _0x384a8f=_0x3cf678[_0xfcee('0x27')]({'plain':!![]});var _0x15acda=_0xfcee('0x28');return db[_0xfcee('0x29')]['destroy']({'where':{'type':_0x15acda,'resourceId':_0x384a8f['id']}})['then'](function(){return _0x3cf678;});})['then'](function(){_0x463df4[_0xfcee('0x1b')](0xcc)[_0xfcee('0x1c')]();});}};}function handleEntityNotFound(_0x37b331,_0x2e7e74){return function(_0x20a81d){if(!_0x20a81d){_0x37b331[_0xfcee('0x1a')](0x194);}return _0x20a81d;};}function handleError(_0xb30144,_0x3a2ae2){_0x3a2ae2=_0x3a2ae2||0x1f4;return function(_0x2869ee){logger['error'](_0x2869ee[_0xfcee('0x2a')]);if(_0x2869ee[_0xfcee('0x2b')]){delete _0x2869ee[_0xfcee('0x2b')];}_0xb30144[_0xfcee('0x1b')](_0x3a2ae2)[_0xfcee('0x2c')](_0x2869ee);};}exports[_0xfcee('0x2d')]=function(_0x16536e,_0x5ed336){var _0x329ff0={},_0x27c6fc={},_0x397629={'count':0x0,'rows':[]};var _0x12c7df=_[_0xfcee('0x2e')](db[_0xfcee('0x2f')][_0xfcee('0x30')],function(_0x2ab7d8){return{'name':_0x2ab7d8[_0xfcee('0x31')],'type':_0x2ab7d8[_0xfcee('0x32')]['key']};});_0x27c6fc[_0xfcee('0x33')]=_['map'](_0x12c7df,_0xfcee('0x2b'));_0x27c6fc[_0xfcee('0x34')]=_[_0xfcee('0x35')](_0x16536e['query']);_0x27c6fc['filters']=_[_0xfcee('0x36')](_0x27c6fc['model'],_0x27c6fc[_0xfcee('0x34')]);_0x329ff0[_0xfcee('0x37')]=_[_0xfcee('0x36')](_0x27c6fc[_0xfcee('0x33')],qs[_0xfcee('0x38')](_0x16536e[_0xfcee('0x34')][_0xfcee('0x38')]));_0x329ff0['attributes']=_0x329ff0['attributes'][_0xfcee('0x39')]?_0x329ff0['attributes']:_0x27c6fc[_0xfcee('0x33')];if(!_0x16536e[_0xfcee('0x34')][_0xfcee('0x3a')](_0xfcee('0x3b'))){_0x329ff0[_0xfcee('0x3c')]=qs['limit'](_0x16536e['query'][_0xfcee('0x3c')]);_0x329ff0[_0xfcee('0x1f')]=qs[_0xfcee('0x1f')](_0x16536e[_0xfcee('0x34')][_0xfcee('0x1f')]);}_0x329ff0[_0xfcee('0x3d')]=qs[_0xfcee('0x3e')](_0x16536e['query']['sort']);_0x329ff0[_0xfcee('0x3f')]=qs[_0xfcee('0x40')](_['pick'](_0x16536e['query'],_0x27c6fc[_0xfcee('0x40')]));if(_0x16536e[_0xfcee('0x34')][_0xfcee('0x41')]){_0x329ff0[_0xfcee('0x3f')]=_[_0xfcee('0x42')](_0x329ff0[_0xfcee('0x3f')],{'$or':_['map'](_0x12c7df,function(_0x185c57){if(_0x185c57[_0xfcee('0x32')]!==_0xfcee('0x43')){var _0x99e5b3={};_0x99e5b3[_0x185c57[_0xfcee('0x2b')]]={'$like':'%'+_0x16536e[_0xfcee('0x34')]['filter']+'%'};return _0x99e5b3;}})});}_0x329ff0=_['merge']({},_0x329ff0,_0x16536e[_0xfcee('0x44')]);var _0x1e513b={'where':_0x329ff0[_0xfcee('0x3f')]};return db[_0xfcee('0x2f')]['count'](_0x1e513b)[_0xfcee('0x25')](function(_0x7226f6){_0x397629[_0xfcee('0x1e')]=_0x7226f6;if(_0x16536e[_0xfcee('0x34')][_0xfcee('0x45')]){_0x329ff0[_0xfcee('0x46')]=[{'all':!![]}];}return db['FaxQueue'][_0xfcee('0x47')](_0x329ff0);})[_0xfcee('0x25')](function(_0x4b2bbf){_0x397629[_0xfcee('0x48')]=_0x4b2bbf;return _0x397629;})[_0xfcee('0x25')](respondWithFilteredResult(_0x5ed336,_0x329ff0))[_0xfcee('0x49')](handleError(_0x5ed336,null));};exports['show']=function(_0x220000,_0xa3f00d){var _0x43c391={'raw':!![],'where':{'id':_0x220000[_0xfcee('0x4a')]['id']}},_0x5122fb={};_0x5122fb[_0xfcee('0x33')]=_[_0xfcee('0x35')](db[_0xfcee('0x2f')][_0xfcee('0x30')]);_0x5122fb['query']=_['keys'](_0x220000[_0xfcee('0x34')]);_0x5122fb['filters']=_[_0xfcee('0x36')](_0x5122fb['model'],_0x5122fb[_0xfcee('0x34')]);_0x43c391[_0xfcee('0x37')]=_[_0xfcee('0x36')](_0x5122fb[_0xfcee('0x33')],qs[_0xfcee('0x38')](_0x220000['query'][_0xfcee('0x38')]));_0x43c391[_0xfcee('0x37')]=_0x43c391['attributes'][_0xfcee('0x39')]?_0x43c391[_0xfcee('0x37')]:_0x5122fb[_0xfcee('0x33')];if(_0x220000[_0xfcee('0x34')]['includeAll']){_0x43c391[_0xfcee('0x46')]=[{'all':!![]}];}_0x43c391=_['merge']({},_0x43c391,_0x220000[_0xfcee('0x44')]);return db[_0xfcee('0x2f')][_0xfcee('0x4b')](_0x43c391)['then'](handleEntityNotFound(_0xa3f00d,null))[_0xfcee('0x25')](respondWithResult(_0xa3f00d,null))['catch'](handleError(_0xa3f00d,null));};exports[_0xfcee('0x4c')]=function(_0xbce801,_0x469bf2){return db[_0xfcee('0x2f')][_0xfcee('0x4c')](_0xbce801['body'],{})[_0xfcee('0x25')](function(_0x4d78a5){var _0x37d91c=_0xbce801['user']['get']({'plain':!![]});if(!_0x37d91c)throw new Error(_0xfcee('0x4d'));if(_0x37d91c[_0xfcee('0x4e')]===_0xfcee('0x4f')){var _0xa45d96=_0x4d78a5['get']({'plain':!![]});var _0xaa038c=_0xfcee('0x28');return db[_0xfcee('0x50')]['find']({'where':{'name':_0xaa038c,'userProfileId':_0x37d91c[_0xfcee('0x51')]},'raw':!![]})[_0xfcee('0x25')](function(_0x63622d){if(_0x63622d&&_0x63622d[_0xfcee('0x52')]===0x0){return db[_0xfcee('0x29')][_0xfcee('0x4c')]({'name':_0xa45d96[_0xfcee('0x2b')],'resourceId':_0xa45d96['id'],'type':_0x63622d[_0xfcee('0x2b')],'sectionId':_0x63622d['id']},{})['then'](function(){return _0x4d78a5;});}else{return _0x4d78a5;}})[_0xfcee('0x49')](function(_0x167028){logger[_0xfcee('0x53')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x167028);throw _0x167028;});}return _0x4d78a5;})[_0xfcee('0x25')](respondWithResult(_0x469bf2,0xc9))[_0xfcee('0x49')](handleError(_0x469bf2,null));};exports[_0xfcee('0x24')]=function(_0x3d3bee,_0x1bc1c9){if(_0x3d3bee['body']['id']){delete _0x3d3bee[_0xfcee('0x54')]['id'];}return db[_0xfcee('0x2f')][_0xfcee('0x4b')]({'where':{'id':_0x3d3bee[_0xfcee('0x4a')]['id']}})[_0xfcee('0x25')](handleEntityNotFound(_0x1bc1c9,null))[_0xfcee('0x25')](saveUpdates(_0x3d3bee[_0xfcee('0x54')],null))[_0xfcee('0x25')](respondWithResult(_0x1bc1c9,null))[_0xfcee('0x49')](handleError(_0x1bc1c9,null));};exports[_0xfcee('0x26')]=function(_0x29f453,_0x16371a){return db[_0xfcee('0x2f')][_0xfcee('0x4b')]({'where':{'id':_0x29f453[_0xfcee('0x4a')]['id']}})[_0xfcee('0x25')](handleEntityNotFound(_0x16371a,null))['then'](removeEntity(_0x16371a,null))[_0xfcee('0x49')](handleError(_0x16371a,null));};exports[_0xfcee('0x55')]=function(_0x166aba,_0x9955da){return db[_0xfcee('0x2f')][_0xfcee('0x55')]()[_0xfcee('0x25')](respondWithResult(_0x9955da,null))['catch'](handleError(_0x9955da,null));};exports[_0xfcee('0x56')]=function(_0x1981fc,_0x4f2e59,_0x929d5){var _0x521d0a={'raw':!![],'where':{}},_0x39fc46={},_0x33eb00;return db[_0xfcee('0x2f')][_0xfcee('0x57')]({'where':{'id':_0x1981fc[_0xfcee('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4f2e59,null))['then'](function(_0x13d3eb){if(_0x13d3eb){_0x33eb00=_0x13d3eb[_0xfcee('0x27')]({'plain':!![]});_0x39fc46[_0xfcee('0x33')]=_[_0xfcee('0x35')](db['UserFaxQueue'][_0xfcee('0x30')]);_0x39fc46[_0xfcee('0x34')]=_[_0xfcee('0x35')](_0x1981fc[_0xfcee('0x34')]);_0x39fc46[_0xfcee('0x40')]=_[_0xfcee('0x36')](_0x39fc46[_0xfcee('0x33')],_0x39fc46[_0xfcee('0x34')]);_0x521d0a[_0xfcee('0x37')]=_[_0xfcee('0x36')](_0x39fc46[_0xfcee('0x33')],qs[_0xfcee('0x38')](_0x1981fc['query'][_0xfcee('0x38')]));_0x521d0a['attributes']=_0x521d0a[_0xfcee('0x37')][_0xfcee('0x39')]?_0x521d0a[_0xfcee('0x37')]:_0x39fc46[_0xfcee('0x33')];if(!_0x1981fc[_0xfcee('0x34')][_0xfcee('0x3a')]('nolimit')){_0x521d0a[_0xfcee('0x3c')]=qs[_0xfcee('0x3c')](_0x1981fc[_0xfcee('0x34')][_0xfcee('0x3c')]);_0x521d0a['offset']=qs[_0xfcee('0x1f')](_0x1981fc[_0xfcee('0x34')]['offset']);}_0x521d0a['order']=qs[_0xfcee('0x3e')](_0x1981fc['query'][_0xfcee('0x3e')]);_0x521d0a[_0xfcee('0x3f')]=qs[_0xfcee('0x40')](_[_0xfcee('0x58')](_0x1981fc[_0xfcee('0x34')],_0x39fc46['filters']));_0x521d0a[_0xfcee('0x3f')]['FaxQueueId']=_0x13d3eb['id'];if(_0x1981fc[_0xfcee('0x34')][_0xfcee('0x41')]){_0x521d0a['where']=_[_0xfcee('0x42')](_0x521d0a[_0xfcee('0x3f')],{'$or':_[_0xfcee('0x2e')](_0x521d0a[_0xfcee('0x37')],function(_0xb37517){var _0x8eb4c1={};_0x8eb4c1[_0xb37517]={'$like':'%'+_0x1981fc[_0xfcee('0x34')]['filter']+'%'};return _0x8eb4c1;})});}_0x521d0a=_[_0xfcee('0x42')]({},_0x521d0a,_0x1981fc['options']);return db['UserFaxQueue'][_0xfcee('0x47')](_0x521d0a);}})[_0xfcee('0x25')](function(_0xc4ad60){if(_0xc4ad60){return db[_0xfcee('0x59')][_0xfcee('0x5a')]({'where':{'id':_[_0xfcee('0x2e')](_0xc4ad60,_0xfcee('0x5b')),'role':'agent'},'attributes':['id',_0xfcee('0x2b'),_0xfcee('0x5c'),_0xfcee('0x5d'),_0xfcee('0x5e')]});}})['then'](function(_0x533c47){if(_0x533c47){return{'count':_0x533c47[_0xfcee('0x1e')],'rows':_[_0xfcee('0x2e')](_0x533c47[_0xfcee('0x48')],function(_0x4ada83){return{'membername':_0x4ada83[_0xfcee('0x2b')],'UserId':_0x4ada83['id'],'queue_name':_0x33eb00[_0xfcee('0x2b')],'FaxQueueId':_0x33eb00['id'],'interface':util['format']('%s/%s',_0xfcee('0x5f'),_0x4ada83[_0xfcee('0x2b')]),'penalty':0x0,'paused':_0x4ada83[_0xfcee('0x5c')],'createdAt':_0x4ada83[_0xfcee('0x5e')],'updatedAt':_0x4ada83[_0xfcee('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xfcee('0x25')](respondWithFilteredResult(_0x4f2e59,_0x521d0a))[_0xfcee('0x49')](handleError(_0x4f2e59,null));};exports[_0xfcee('0x60')]=function(_0x4b88a1,_0x2a111b,_0x2dd488){var _0x268a38={};var _0x6d20c8={};var _0x15ffc6;var _0x445779;return db[_0xfcee('0x2f')][_0xfcee('0x57')]({'where':{'id':_0x4b88a1[_0xfcee('0x4a')]['id']}})[_0xfcee('0x25')](handleEntityNotFound(_0x2a111b,null))[_0xfcee('0x25')](function(_0x5096fd){if(_0x5096fd){_0x15ffc6=_0x5096fd;_0x6d20c8[_0xfcee('0x33')]=_['keys'](db[_0xfcee('0x61')][_0xfcee('0x30')]);_0x6d20c8['query']=_[_0xfcee('0x35')](_0x4b88a1[_0xfcee('0x34')]);_0x6d20c8[_0xfcee('0x40')]=_[_0xfcee('0x36')](_0x6d20c8['model'],_0x6d20c8[_0xfcee('0x34')]);_0x268a38[_0xfcee('0x37')]=_[_0xfcee('0x36')](_0x6d20c8['model'],qs['fields'](_0x4b88a1['query']['fields']));_0x268a38[_0xfcee('0x37')]=_0x268a38[_0xfcee('0x37')][_0xfcee('0x39')]?_0x268a38[_0xfcee('0x37')]:_0x6d20c8[_0xfcee('0x33')];_0x268a38[_0xfcee('0x3d')]=qs[_0xfcee('0x3e')](_0x4b88a1[_0xfcee('0x34')][_0xfcee('0x3e')]);_0x268a38[_0xfcee('0x3f')]=qs[_0xfcee('0x40')](_[_0xfcee('0x58')](_0x4b88a1[_0xfcee('0x34')],_0x6d20c8['filters']));if(_0x4b88a1[_0xfcee('0x34')]['filter']){_0x268a38[_0xfcee('0x3f')]=_[_0xfcee('0x42')](_0x268a38[_0xfcee('0x3f')],{'$or':_[_0xfcee('0x2e')](_0x268a38[_0xfcee('0x37')],function(_0x51ea13){var _0x5a774f={};_0x5a774f[_0x51ea13]={'$like':'%'+_0x4b88a1['query'][_0xfcee('0x41')]+'%'};return _0x5a774f;})});}_0x268a38=_[_0xfcee('0x42')]({},_0x268a38,_0x4b88a1[_0xfcee('0x44')]);return _0x15ffc6[_0xfcee('0x60')](_0x268a38);}})['then'](function(_0x629d0b){if(_0x629d0b){_0x445779=_0x629d0b['length'];if(!_0x4b88a1[_0xfcee('0x34')][_0xfcee('0x3a')](_0xfcee('0x3b'))){_0x268a38['limit']=qs[_0xfcee('0x3c')](_0x4b88a1[_0xfcee('0x34')]['limit']);_0x268a38[_0xfcee('0x1f')]=qs['offset'](_0x4b88a1[_0xfcee('0x34')]['offset']);}return _0x15ffc6[_0xfcee('0x60')](_0x268a38);}})[_0xfcee('0x25')](function(_0x1cef4b){if(_0x1cef4b){return _0x1cef4b?{'count':_0x445779,'rows':_0x1cef4b}:null;}})['then'](respondWithResult(_0x2a111b,null))[_0xfcee('0x49')](handleError(_0x2a111b,null));};exports['addTeams']=function(_0x5bcb0d,_0x4d0962,_0x5946dc){var _0x243971=_0x5bcb0d['body']['ids'];return db[_0xfcee('0x61')][_0xfcee('0x47')]({'where':{'id':_0x243971},'attributes':['id'],'include':[{'model':db['User'],'as':_0xfcee('0x62'),'attributes':['id',_0xfcee('0x2b'),_0xfcee('0x63'),_0xfcee('0x64'),_0xfcee('0x65')],'raw':!![]}]})[_0xfcee('0x25')](function(_0x3dda53){if(_0x3dda53){var _0x4f9cdc=_[_0xfcee('0x66')](_0x3dda53,function(_0x21e529){var _0xa3c23d=_0x21e529[_0xfcee('0x27')]({'plain':!![]});return _0xa3c23d[_0xfcee('0x62')];});return db[_0xfcee('0x2f')][_0xfcee('0x4b')]({'where':{'id':_0x5bcb0d[_0xfcee('0x4a')]['id']}})[_0xfcee('0x25')](function(_0x264524){return db['sequelize'][_0xfcee('0x67')](function(_0x404a39){return _0x264524[_0xfcee('0x68')](_0x243971,{'transaction':_0x404a39})['then'](function(){return BPromise[_0xfcee('0x69')](_0x4f9cdc,function(_0x43d91f){return db['UserFaxQueue'][_0xfcee('0x6a')]({'where':{'UserId':_0x43d91f['id'],'FaxQueueId':_0x5bcb0d['params']['id']},'transaction':_0x404a39});});})[_0xfcee('0x25')](function(){_0x4f9cdc[_0xfcee('0x6b')](function(_0x4fc968){socket['emit']('userFaxQueue:save',{'UserId':_0x4fc968['id'],'FaxQueueId':_0x264524['id']});});});});});}})['then'](respondWithStatusCode(_0x4d0962,null))[_0xfcee('0x49')](handleError(_0x4d0962,null));};exports[_0xfcee('0x6c')]=function(_0x934a5,_0x2ccb46,_0x3bc83d){return db[_0xfcee('0x61')][_0xfcee('0x47')]({'where':{'id':_0x934a5['query'][_0xfcee('0x6d')]},'attributes':['id'],'include':[{'model':db[_0xfcee('0x59')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xfcee('0x25')](handleEntityNotFound(_0x2ccb46,null))[_0xfcee('0x25')](function(_0x4e8ea8){var _0x49bff7=_[_0xfcee('0x2e')](_0x4e8ea8,'id');var _0x3319b9=[];var _0x3f8a15=[];var _0x1ee3f3=squel[_0xfcee('0x6e')]();_0x1ee3f3[_0xfcee('0x6f')](_0xfcee('0x70'))[_0xfcee('0x71')](_0xfcee('0x72'),'tq')[_0xfcee('0x73')](_0xfcee('0x74'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xfcee('0x3f')](_0xfcee('0x75'),_0x934a5[_0xfcee('0x4a')]['id']);for(var _0x184d3e=0x0;_0x184d3e<_0x4e8ea8[_0xfcee('0x39')];_0x184d3e+=0x1){let _0x37533b=_0x4e8ea8[_0x184d3e];for(var _0x109a04=0x0;_0x109a04<_0x37533b[_0xfcee('0x62')][_0xfcee('0x39')];_0x109a04+=0x1){let _0x4ce2bb=_0x37533b[_0xfcee('0x62')][_0x109a04];var _0x4f4488=_0x1ee3f3[_0xfcee('0x76')]();_0x4f4488['where'](_0xfcee('0x77'),_0x4ce2bb['id']);_0x3f8a15[_0xfcee('0x78')](db['sequelize'][_0xfcee('0x34')](_0x4f4488['toString'](),{'type':db[_0xfcee('0x79')]['QueryTypes'][_0xfcee('0x7a')]})[_0xfcee('0x25')](function(_0x1c061b){if(_0x1c061b[_0xfcee('0x39')]===0x1){return _0x4ce2bb['id'];}else{var _0x55274d=_[_0xfcee('0x7b')](_[_0xfcee('0x2e')](_0x1c061b,_0xfcee('0x7c')),function(_0x37088f){return _[_0xfcee('0x7d')](_0x49bff7,_0x37088f);});if(_0x55274d){return _0x4ce2bb['id'];}}}));}}return BPromise[_0xfcee('0x7e')](_0x3f8a15)[_0xfcee('0x25')](function(_0x5cd679){_0x3319b9=_(_0x3319b9)[_0xfcee('0x7f')](_0x5cd679)['compact']()[_0xfcee('0x80')]();return db[_0xfcee('0x2f')][_0xfcee('0x4b')]({'where':{'id':_0x934a5[_0xfcee('0x4a')]['id']}})['then'](function(_0x23edfa){return db['sequelize'][_0xfcee('0x67')](function(_0x1e857a){return _0x23edfa[_0xfcee('0x6c')](_0x934a5[_0xfcee('0x34')]['ids'],{'transaction':_0x1e857a})['then'](function(){if(!_['isEmpty'](_0x3319b9)){return _0x23edfa[_0xfcee('0x81')](_0x3319b9,{'transaction':_0x1e857a});}})[_0xfcee('0x25')](function(){_0x3319b9['forEach'](function(_0x4ff6df){socket['emit'](_0xfcee('0x82'),{'UserId':_0x4ff6df,'FaxQueueId':_0x23edfa['id']});});});});});});})[_0xfcee('0x25')](respondWithStatusCode(_0x2ccb46,null))[_0xfcee('0x49')](handleError(_0x2ccb46,null));};exports['addAgents']=function(_0x4c3234,_0x95aafa,_0x3c3965){return db[_0xfcee('0x2f')][_0xfcee('0x4b')]({'where':{'id':_0x4c3234[_0xfcee('0x4a')]['id']}})[_0xfcee('0x25')](handleEntityNotFound(_0x95aafa,null))[_0xfcee('0x25')](function(_0x36f42c){if(_0x36f42c){return _0x36f42c['addAgents'](_0x4c3234[_0xfcee('0x54')][_0xfcee('0x6d')],_[_0xfcee('0x83')](_0x4c3234[_0xfcee('0x54')],[_0xfcee('0x6d'),'id'])||{})[_0xfcee('0x84')](function(_0x28c1af){for(var _0x31888=0x0;_0x31888<_0x4c3234['body'][_0xfcee('0x6d')][_0xfcee('0x39')];_0x31888+=0x1){socket['emit'](_0xfcee('0x85'),{'UserId':_0x4c3234[_0xfcee('0x54')]['ids'][_0x31888],'FaxQueueId':_0x4c3234[_0xfcee('0x4a')]['id']});}return _0x28c1af;});}})[_0xfcee('0x25')](respondWithResult(_0x95aafa,null))[_0xfcee('0x49')](handleError(_0x95aafa,null));};exports['removeAgents']=function(_0x233cd6,_0x47f447,_0x48579b){return db[_0xfcee('0x2f')][_0xfcee('0x4b')]({'where':{'id':_0x233cd6[_0xfcee('0x4a')]['id']}})[_0xfcee('0x25')](handleEntityNotFound(_0x47f447,null))[_0xfcee('0x25')](function(_0x4e8908){if(_0x4e8908){return _0x4e8908[_0xfcee('0x81')](_0x233cd6[_0xfcee('0x34')]['ids'])[_0xfcee('0x25')](function(){if(_[_0xfcee('0x86')](_0x233cd6[_0xfcee('0x34')][_0xfcee('0x6d')])){for(var _0x2e610a=0x0;_0x2e610a<_0x233cd6[_0xfcee('0x34')][_0xfcee('0x6d')][_0xfcee('0x39')];_0x2e610a+=0x1){socket['emit']('userFaxQueue:remove',{'UserId':Number(_0x233cd6[_0xfcee('0x34')][_0xfcee('0x6d')][_0x2e610a]),'FaxQueueId':Number(_0x233cd6[_0xfcee('0x4a')]['id'])});}}else{socket[_0xfcee('0x87')](_0xfcee('0x82'),{'UserId':Number(_0x233cd6[_0xfcee('0x34')][_0xfcee('0x6d')]),'FaxQueueId':Number(_0x233cd6[_0xfcee('0x4a')]['id'])});}});}})[_0xfcee('0x25')](respondWithStatusCode(_0x47f447,null))[_0xfcee('0x49')](handleError(_0x47f447,null));};exports[_0xfcee('0x88')]=function(_0xb11e79,_0x5b90aa,_0x361988){var _0x4b7627={};var _0x21b161={};var _0x21033a;var _0x4c3b44;return db[_0xfcee('0x2f')][_0xfcee('0x57')]({'where':{'id':_0xb11e79['params']['id']}})[_0xfcee('0x25')](handleEntityNotFound(_0x5b90aa,null))['then'](function(_0x55c3c7){if(_0x55c3c7){_0x21033a=_0x55c3c7;_0x21b161[_0xfcee('0x33')]=_[_0xfcee('0x35')](db[_0xfcee('0x59')][_0xfcee('0x30')]);_0x21b161['query']=_[_0xfcee('0x35')](_0xb11e79[_0xfcee('0x34')]);_0x21b161['filters']=_['intersection'](_0x21b161[_0xfcee('0x33')],_0x21b161[_0xfcee('0x34')]);_0x4b7627[_0xfcee('0x37')]=_['intersection'](_0x21b161[_0xfcee('0x33')],qs['fields'](_0xb11e79[_0xfcee('0x34')]['fields']));_0x4b7627['attributes']=_0x4b7627[_0xfcee('0x37')]['length']?_0x4b7627[_0xfcee('0x37')]:_0x21b161['model'];_0x4b7627[_0xfcee('0x3d')]=qs[_0xfcee('0x3e')](_0xb11e79[_0xfcee('0x34')]['sort']);_0x4b7627['where']=qs[_0xfcee('0x40')](_[_0xfcee('0x58')](_0xb11e79[_0xfcee('0x34')],_0x21b161[_0xfcee('0x40')]));if(_0xb11e79[_0xfcee('0x34')]['filter']){_0x4b7627[_0xfcee('0x3f')]=_['merge'](_0x4b7627[_0xfcee('0x3f')],{'$or':_[_0xfcee('0x2e')](_0x4b7627[_0xfcee('0x37')],function(_0x40d096){var _0xe2fedb={};_0xe2fedb[_0x40d096]={'$like':'%'+_0xb11e79[_0xfcee('0x34')]['filter']+'%'};return _0xe2fedb;})});}_0x4b7627=_['merge']({},_0x4b7627,_0xb11e79[_0xfcee('0x44')]);return _0x21033a['getAgents'](_0x4b7627);}})[_0xfcee('0x25')](function(_0x3183dc){if(_0x3183dc){_0x4c3b44=_0x3183dc[_0xfcee('0x39')];if(!_0xb11e79[_0xfcee('0x34')]['hasOwnProperty'](_0xfcee('0x3b'))){_0x4b7627[_0xfcee('0x3c')]=qs[_0xfcee('0x3c')](_0xb11e79['query'][_0xfcee('0x3c')]);_0x4b7627['offset']=qs[_0xfcee('0x1f')](_0xb11e79['query'][_0xfcee('0x1f')]);}return _0x21033a['getAgents'](_0x4b7627);}})[_0xfcee('0x25')](function(_0xe68db6){if(_0xe68db6){return _0xe68db6?{'count':_0x4c3b44,'rows':_0xe68db6}:null;}})[_0xfcee('0x25')](respondWithResult(_0x5b90aa,null))[_0xfcee('0x49')](handleError(_0x5b90aa,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 8320c48..a3ee35c 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 _0xd9f6=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x16f5e2,_0x471271){var _0x495237=function(_0x5ceef2){while(--_0x5ceef2){_0x16f5e2['push'](_0x16f5e2['shift']());}};_0x495237(++_0x471271);}(_0xd9f6,0xee));var _0x6d9f=function(_0x467904,_0x200a6a){_0x467904=_0x467904-0x0;var _0x4613ec=_0xd9f6[_0x467904];return _0x4613ec;};'use strict';var EventEmitter=require(_0x6d9f('0x0'));var FaxQueue=require(_0x6d9f('0x1'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x6d9f('0x2')](0x0);var events={'afterCreate':_0x6d9f('0x3'),'afterUpdate':_0x6d9f('0x4'),'afterDestroy':_0x6d9f('0x5')};function emitEvent(_0xa96f96){return function(_0x7cf204,_0xc11ffb,_0x1e315f){FaxQueueEvents[_0x6d9f('0x6')](_0xa96f96+':'+_0x7cf204['id'],_0x7cf204);FaxQueueEvents[_0x6d9f('0x6')](_0xa96f96,_0x7cf204);_0x1e315f(null);};}for(var e in events){if(events[_0x6d9f('0x7')](e)){var event=events[e];FaxQueue[_0x6d9f('0x8')](e,emitEvent(event));}}module[_0x6d9f('0x9')]=FaxQueueEvents; \ No newline at end of file +var _0x6f0a=['../../mysqldb','FaxQueue','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x49988d,_0x15dae4){var _0x2259f7=function(_0x1c964d){while(--_0x1c964d){_0x49988d['push'](_0x49988d['shift']());}};_0x2259f7(++_0x15dae4);}(_0x6f0a,0x68));var _0xa6f0=function(_0x2ffea9,_0x4f90ae){_0x2ffea9=_0x2ffea9-0x0;var _0x715534=_0x6f0a[_0x2ffea9];return _0x715534;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0xa6f0('0x0'))['db'][_0xa6f0('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa6f0('0x2'),'afterUpdate':'update','afterDestroy':_0xa6f0('0x3')};function emitEvent(_0x3f1c19){return function(_0x49b8f9,_0x11f9f6,_0x449eec){FaxQueueEvents[_0xa6f0('0x4')](_0x3f1c19+':'+_0x49b8f9['id'],_0x49b8f9);FaxQueueEvents[_0xa6f0('0x4')](_0x3f1c19,_0x49b8f9);_0x449eec(null);};}for(var e in events){if(events[_0xa6f0('0x5')](e)){var event=events[e];FaxQueue[_0xa6f0('0x6')](e,emitEvent(event));}}module[_0xa6f0('0x7')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 72d9bbb..02d1911 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 _0x5666=['api','moment','bluebird','path','../../config/environment','./faxQueue.attributes','exports','define','FaxQueue','fax_queues','util','../../config/logger'];(function(_0x58da69,_0x4d73d6){var _0x1e3e9d=function(_0x202b1a){while(--_0x202b1a){_0x58da69['push'](_0x58da69['shift']());}};_0x1e3e9d(++_0x4d73d6);}(_0x5666,0xa6));var _0x6566=function(_0x2c1959,_0x4faa73){_0x2c1959=_0x2c1959-0x0;var _0x1d05b9=_0x5666[_0x2c1959];return _0x1d05b9;};'use strict';var _=require('lodash');var util=require(_0x6566('0x0'));var logger=require(_0x6566('0x1'))(_0x6566('0x2'));var moment=require(_0x6566('0x3'));var BPromise=require(_0x6566('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6566('0x5'));var rimraf=require('rimraf');var config=require(_0x6566('0x6'));var attributes=require(_0x6566('0x7'));module[_0x6566('0x8')]=function(_0xdcf41a,_0x3a0d81){return _0xdcf41a[_0x6566('0x9')](_0x6566('0xa'),attributes,{'tableName':_0x6566('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3f4c=['util','../../config/logger','api','moment','bluebird','path','../../config/environment','./faxQueue.attributes','define','FaxQueue','lodash'];(function(_0x1bda29,_0x4d300f){var _0x706cc1=function(_0x12964c){while(--_0x12964c){_0x1bda29['push'](_0x1bda29['shift']());}};_0x706cc1(++_0x4d300f);}(_0x3f4c,0xd0));var _0xc3f4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3f4c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc3f4('0x0'));var util=require(_0xc3f4('0x1'));var logger=require(_0xc3f4('0x2'))(_0xc3f4('0x3'));var moment=require(_0xc3f4('0x4'));var BPromise=require(_0xc3f4('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc3f4('0x6'));var rimraf=require('rimraf');var config=require(_0xc3f4('0x7'));var attributes=require(_0xc3f4('0x8'));module['exports']=function(_0xd6c31,_0x13de63){return _0xd6c31[_0xc3f4('0x9')](_0xc3f4('0xa'),attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.rpc.js b/server/api/faxQueue/faxQueue.rpc.js index ddd3617..49f19c3 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 _0xd19d=['localhost','socket.io-emitter','redis','./faxQueue.socket','register','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','FaxQueue','findAll','options','raw','where','attributes','map','include','model','GetFaxQueue','ShowFaxQueue','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x41e018,_0x54cb55){var _0x52327d=function(_0x538992){while(--_0x538992){_0x41e018['push'](_0x41e018['shift']());}};_0x52327d(++_0x54cb55);}(_0xd19d,0x1bd));var _0xdd19=function(_0x38275c,_0x23ea90){_0x38275c=_0x38275c-0x0;var _0x183a15=_0xd19d[_0x38275c];return _0x183a15;};'use strict';var _=require(_0xdd19('0x0'));var util=require(_0xdd19('0x1'));var moment=require(_0xdd19('0x2'));var BPromise=require(_0xdd19('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdd19('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xdd19('0x5'));var logger=require('../../config/logger')(_0xdd19('0x6'));var config=require(_0xdd19('0x7'));var jayson=require(_0xdd19('0x8'));var client=jayson[_0xdd19('0x9')][_0xdd19('0xa')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xdd19('0xb'),'port':0x18eb});var socket=require(_0xdd19('0xc'))(new Redis(config[_0xdd19('0xd')]));require(_0xdd19('0xe'))[_0xdd19('0xf')](socket);function respondWithRpcPromise(_0x10f438,_0x3e849a,_0x460799){return new BPromise(function(_0x4c5722,_0x505349){return client['request'](_0x10f438,_0x460799)[_0xdd19('0x10')](function(_0x588bbd){logger[_0xdd19('0x11')](_0xdd19('0x12'),_0x3e849a,_0xdd19('0x13'));logger[_0xdd19('0x14')]('FaxQueue,\x20%s,\x20%s,\x20%s',_0x3e849a,_0xdd19('0x13'),JSON[_0xdd19('0x15')](_0x588bbd));if(_0x588bbd[_0xdd19('0x16')]){if(_0x588bbd['error'][_0xdd19('0x17')]===0x1f4){logger['error']('FaxQueue,\x20%s,\x20%s',_0x3e849a,_0x588bbd[_0xdd19('0x16')][_0xdd19('0x18')]);return _0x505349(_0x588bbd[_0xdd19('0x16')][_0xdd19('0x18')]);}logger[_0xdd19('0x16')]('FaxQueue,\x20%s,\x20%s',_0x3e849a,_0x588bbd['error']['message']);return _0x4c5722(_0x588bbd['error'][_0xdd19('0x18')]);}else{logger[_0xdd19('0x11')](_0xdd19('0x12'),_0x3e849a,_0xdd19('0x13'));_0x4c5722(_0x588bbd[_0xdd19('0x19')][_0xdd19('0x18')]);}})[_0xdd19('0x1a')](function(_0x18697c){logger[_0xdd19('0x16')](_0xdd19('0x12'),_0x3e849a,_0x18697c);_0x505349(_0x18697c);});});}exports['GetFaxQueue']=function(_0xa2823a){var _0x97e6e9=this;return new Promise(function(_0x261d58,_0x5bcfc0){return db[_0xdd19('0x1b')][_0xdd19('0x1c')]({'raw':_0xa2823a[_0xdd19('0x1d')]?_0xa2823a[_0xdd19('0x1d')][_0xdd19('0x1e')]===undefined?!![]:![]:!![],'where':_0xa2823a[_0xdd19('0x1d')]?_0xa2823a[_0xdd19('0x1d')][_0xdd19('0x1f')]||null:null,'attributes':_0xa2823a['options']?_0xa2823a['options'][_0xdd19('0x20')]||null:null,'limit':_0xa2823a['options']?_0xa2823a[_0xdd19('0x1d')]['limit']||null:null,'include':_0xa2823a[_0xdd19('0x1d')]?_0xa2823a['options']['include']?_[_0xdd19('0x21')](_0xa2823a[_0xdd19('0x1d')][_0xdd19('0x22')],function(_0x1adeb3){return{'model':db[_0x1adeb3[_0xdd19('0x23')]],'as':_0x1adeb3['as'],'attributes':_0x1adeb3['attributes'],'include':_0x1adeb3[_0xdd19('0x22')]?_[_0xdd19('0x21')](_0x1adeb3[_0xdd19('0x22')],function(_0x3fa68e){return{'model':db[_0x3fa68e[_0xdd19('0x23')]],'as':_0x3fa68e['as'],'attributes':_0x3fa68e['attributes'],'include':_0x3fa68e['include']?_[_0xdd19('0x21')](_0x3fa68e[_0xdd19('0x22')],function(_0x491e46){return{'model':db[_0x491e46['model']],'as':_0x491e46['as'],'attributes':_0x491e46['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x34dd39){logger[_0xdd19('0x11')](_0xdd19('0x24'),_0xa2823a);logger[_0xdd19('0x14')]('GetFaxQueue',_0xa2823a,JSON[_0xdd19('0x15')](_0x34dd39));_0x261d58(_0x34dd39);})['catch'](function(_0x13d62c){logger[_0xdd19('0x16')]('GetFaxQueue',_0x13d62c[_0xdd19('0x18')],_0xa2823a);_0x5bcfc0(_0x97e6e9[_0xdd19('0x16')](0x1f4,_0x13d62c['message']));});});};exports['ShowFaxQueue']=function(_0x1dce34){var _0x390a7e=this;return new Promise(function(_0x56b8d7,_0x209b53){return db[_0xdd19('0x1b')]['find']({'raw':_0x1dce34[_0xdd19('0x1d')]?_0x1dce34['options'][_0xdd19('0x1e')]===undefined?!![]:![]:!![],'where':_0x1dce34[_0xdd19('0x1d')]?_0x1dce34['options'][_0xdd19('0x1f')]||null:null,'attributes':_0x1dce34['options']?_0x1dce34[_0xdd19('0x1d')][_0xdd19('0x20')]||null:null,'include':_0x1dce34['options']?_0x1dce34[_0xdd19('0x1d')][_0xdd19('0x22')]?_[_0xdd19('0x21')](_0x1dce34['options']['include'],function(_0x3bb4b3){return{'model':db[_0x3bb4b3[_0xdd19('0x23')]],'as':_0x3bb4b3['as'],'attributes':_0x3bb4b3['attributes'],'include':_0x3bb4b3[_0xdd19('0x22')]?_[_0xdd19('0x21')](_0x3bb4b3[_0xdd19('0x22')],function(_0x43919b){return{'model':db[_0x43919b['model']],'as':_0x43919b['as'],'attributes':_0x43919b[_0xdd19('0x20')],'include':_0x43919b[_0xdd19('0x22')]?_[_0xdd19('0x21')](_0x43919b[_0xdd19('0x22')],function(_0x430ae3){return{'model':db[_0x430ae3[_0xdd19('0x23')]],'as':_0x430ae3['as'],'attributes':_0x430ae3[_0xdd19('0x20')]};}):[]};}):[]};}):[]:[]})[_0xdd19('0x10')](function(_0x47b4f8){logger[_0xdd19('0x11')](_0xdd19('0x25'),_0x1dce34);logger['debug'](_0xdd19('0x25'),_0x1dce34,JSON[_0xdd19('0x15')](_0x47b4f8));_0x56b8d7(_0x47b4f8);})[_0xdd19('0x1a')](function(_0x279afb){logger[_0xdd19('0x16')](_0xdd19('0x25'),_0x279afb['message'],_0x1dce34);_0x209b53(_0x390a7e[_0xdd19('0x16')](0x1f4,_0x279afb['message']));});});}; \ No newline at end of file +var _0xd2b1=['code','message','info','result','catch','GetFaxQueue','FaxQueue','options','raw','where','attributes','limit','model','include','map','ShowFaxQueue','find','debug','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','./faxQueue.socket','request','then','FaxQueue,\x20%s,\x20%s','request\x20sent','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x21a8e5,_0x14e256){var _0x42528f=function(_0x71ad77){while(--_0x71ad77){_0x21a8e5['push'](_0x21a8e5['shift']());}};_0x42528f(++_0x14e256);}(_0xd2b1,0xcb));var _0x1d2b=function(_0x4f60e2,_0x481b16){_0x4f60e2=_0x4f60e2-0x0;var _0x100fc8=_0xd2b1[_0x4f60e2];return _0x100fc8;};'use strict';var _=require('lodash');var util=require(_0x1d2b('0x0'));var moment=require(_0x1d2b('0x1'));var BPromise=require('bluebird');var rs=require(_0x1d2b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1d2b('0x3'));var logger=require(_0x1d2b('0x4'))(_0x1d2b('0x5'));var config=require(_0x1d2b('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x1d2b('0x7')][_0x1d2b('0x8')]({'port':0x232a});config[_0x1d2b('0x9')]=_[_0x1d2b('0xa')](config[_0x1d2b('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1d2b('0x9')]));require(_0x1d2b('0xb'))['register'](socket);function respondWithRpcPromise(_0x552a95,_0x4e8325,_0x3cb607){return new BPromise(function(_0x3304d5,_0x5704c2){return client[_0x1d2b('0xc')](_0x552a95,_0x3cb607)[_0x1d2b('0xd')](function(_0x4bd8f1){logger['info'](_0x1d2b('0xe'),_0x4e8325,_0x1d2b('0xf'));logger['debug'](_0x1d2b('0x10'),_0x4e8325,_0x1d2b('0xf'),JSON[_0x1d2b('0x11')](_0x4bd8f1));if(_0x4bd8f1[_0x1d2b('0x12')]){if(_0x4bd8f1[_0x1d2b('0x12')][_0x1d2b('0x13')]===0x1f4){logger[_0x1d2b('0x12')](_0x1d2b('0xe'),_0x4e8325,_0x4bd8f1[_0x1d2b('0x12')][_0x1d2b('0x14')]);return _0x5704c2(_0x4bd8f1[_0x1d2b('0x12')][_0x1d2b('0x14')]);}logger[_0x1d2b('0x12')]('FaxQueue,\x20%s,\x20%s',_0x4e8325,_0x4bd8f1[_0x1d2b('0x12')]['message']);return _0x3304d5(_0x4bd8f1[_0x1d2b('0x12')][_0x1d2b('0x14')]);}else{logger[_0x1d2b('0x15')](_0x1d2b('0xe'),_0x4e8325,'request\x20sent');_0x3304d5(_0x4bd8f1[_0x1d2b('0x16')][_0x1d2b('0x14')]);}})[_0x1d2b('0x17')](function(_0x55a4a0){logger[_0x1d2b('0x12')](_0x1d2b('0xe'),_0x4e8325,_0x55a4a0);_0x5704c2(_0x55a4a0);});});}exports[_0x1d2b('0x18')]=function(_0x53a297){var _0x433955=this;return new Promise(function(_0x2b7654,_0x482c54){return db[_0x1d2b('0x19')]['findAll']({'raw':_0x53a297[_0x1d2b('0x1a')]?_0x53a297['options'][_0x1d2b('0x1b')]===undefined?!![]:![]:!![],'where':_0x53a297[_0x1d2b('0x1a')]?_0x53a297[_0x1d2b('0x1a')][_0x1d2b('0x1c')]||null:null,'attributes':_0x53a297[_0x1d2b('0x1a')]?_0x53a297['options'][_0x1d2b('0x1d')]||null:null,'limit':_0x53a297['options']?_0x53a297[_0x1d2b('0x1a')][_0x1d2b('0x1e')]||null:null,'include':_0x53a297[_0x1d2b('0x1a')]?_0x53a297['options']['include']?_['map'](_0x53a297[_0x1d2b('0x1a')]['include'],function(_0x11ac72){return{'model':db[_0x11ac72[_0x1d2b('0x1f')]],'as':_0x11ac72['as'],'attributes':_0x11ac72['attributes'],'include':_0x11ac72[_0x1d2b('0x20')]?_['map'](_0x11ac72[_0x1d2b('0x20')],function(_0x18f871){return{'model':db[_0x18f871[_0x1d2b('0x1f')]],'as':_0x18f871['as'],'attributes':_0x18f871[_0x1d2b('0x1d')],'include':_0x18f871[_0x1d2b('0x20')]?_[_0x1d2b('0x21')](_0x18f871['include'],function(_0x282786){return{'model':db[_0x282786[_0x1d2b('0x1f')]],'as':_0x282786['as'],'attributes':_0x282786[_0x1d2b('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x1d2b('0xd')](function(_0x52f88d){logger[_0x1d2b('0x15')]('GetFaxQueue',_0x53a297);logger['debug'](_0x1d2b('0x18'),_0x53a297,JSON[_0x1d2b('0x11')](_0x52f88d));_0x2b7654(_0x52f88d);})[_0x1d2b('0x17')](function(_0x5dc629){logger[_0x1d2b('0x12')](_0x1d2b('0x18'),_0x5dc629[_0x1d2b('0x14')],_0x53a297);_0x482c54(_0x433955[_0x1d2b('0x12')](0x1f4,_0x5dc629['message']));});});};exports[_0x1d2b('0x22')]=function(_0x3e50be){var _0x15ccca=this;return new Promise(function(_0x2c6f3a,_0xebb1e7){return db['FaxQueue'][_0x1d2b('0x23')]({'raw':_0x3e50be['options']?_0x3e50be[_0x1d2b('0x1a')][_0x1d2b('0x1b')]===undefined?!![]:![]:!![],'where':_0x3e50be[_0x1d2b('0x1a')]?_0x3e50be[_0x1d2b('0x1a')][_0x1d2b('0x1c')]||null:null,'attributes':_0x3e50be['options']?_0x3e50be['options']['attributes']||null:null,'include':_0x3e50be[_0x1d2b('0x1a')]?_0x3e50be[_0x1d2b('0x1a')]['include']?_[_0x1d2b('0x21')](_0x3e50be[_0x1d2b('0x1a')]['include'],function(_0x5269d3){return{'model':db[_0x5269d3['model']],'as':_0x5269d3['as'],'attributes':_0x5269d3[_0x1d2b('0x1d')],'include':_0x5269d3['include']?_['map'](_0x5269d3[_0x1d2b('0x20')],function(_0x17c8fd){return{'model':db[_0x17c8fd['model']],'as':_0x17c8fd['as'],'attributes':_0x17c8fd[_0x1d2b('0x1d')],'include':_0x17c8fd['include']?_[_0x1d2b('0x21')](_0x17c8fd[_0x1d2b('0x20')],function(_0x4cbdb2){return{'model':db[_0x4cbdb2['model']],'as':_0x4cbdb2['as'],'attributes':_0x4cbdb2[_0x1d2b('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x1d2b('0xd')](function(_0x200936){logger['info'](_0x1d2b('0x22'),_0x3e50be);logger[_0x1d2b('0x24')](_0x1d2b('0x22'),_0x3e50be,JSON[_0x1d2b('0x11')](_0x200936));_0x2c6f3a(_0x200936);})[_0x1d2b('0x17')](function(_0xff011b){logger[_0x1d2b('0x12')](_0x1d2b('0x22'),_0xff011b[_0x1d2b('0x14')],_0x3e50be);_0xebb1e7(_0x15ccca[_0x1d2b('0x12')](0x1f4,_0xff011b[_0x1d2b('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 679f503..502e1af 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 _0xd978=['emit','removeListener','register','length','./faxQueue.events','save'];(function(_0x4715d2,_0x3371b2){var _0x141811=function(_0x520bc6){while(--_0x520bc6){_0x4715d2['push'](_0x4715d2['shift']());}};_0x141811(++_0x3371b2);}(_0xd978,0xfa));var _0x8d97=function(_0x543429,_0x140390){_0x543429=_0x543429-0x0;var _0x112a46=_0xd978[_0x543429];return _0x112a46;};'use strict';var FaxQueueEvents=require(_0x8d97('0x0'));var events=[_0x8d97('0x1'),'remove','update'];function createListener(_0x5e69ed,_0x1e2652){return function(_0x219d28){_0x1e2652[_0x8d97('0x2')](_0x5e69ed,_0x219d28);};}function removeListener(_0x1c6e9b,_0x293957){return function(){FaxQueueEvents[_0x8d97('0x3')](_0x1c6e9b,_0x293957);};}exports[_0x8d97('0x4')]=function(_0x4b8331){for(var _0x93807f=0x0,_0x5b3a33=events[_0x8d97('0x5')];_0x93807f<_0x5b3a33;_0x93807f++){var _0x290c40=events[_0x93807f];var _0x458b2a=createListener('faxQueue:'+_0x290c40,_0x4b8331);FaxQueueEvents['on'](_0x290c40,_0x458b2a);}}; \ No newline at end of file +var _0x4c64=['faxQueue:','remove','update','emit','removeListener','register'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4c64,0xbb));var _0x44c6=function(_0xe35a3,_0x4973eb){_0xe35a3=_0xe35a3-0x0;var _0x4ba2d2=_0x4c64[_0xe35a3];return _0x4ba2d2;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=['save',_0x44c6('0x0'),_0x44c6('0x1')];function createListener(_0x277e81,_0x4d6047){return function(_0x2459bc){_0x4d6047[_0x44c6('0x2')](_0x277e81,_0x2459bc);};}function removeListener(_0x53a1e8,_0xa91c84){return function(){FaxQueueEvents[_0x44c6('0x3')](_0x53a1e8,_0xa91c84);};}exports[_0x44c6('0x4')]=function(_0xc58b28){for(var _0x2d6d59=0x0,_0xebb598=events['length'];_0x2d6d59<_0xebb598;_0x2d6d59++){var _0x2d7ba2=events[_0x2d6d59];var _0x40cd30=createListener(_0x44c6('0x5')+_0x2d7ba2,_0xc58b28);FaxQueueEvents['on'](_0x2d7ba2,_0x40cd30);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 0b93d7a..362ce5e 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 _0xd8b0=['util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','index','get','/describe','describe','isAuthenticated','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','/:id','update','delete','destroy','removeTeams','exports','multer'];(function(_0x14a911,_0x524493){var _0x3219ee=function(_0x348184){while(--_0x348184){_0x14a911['push'](_0x14a911['shift']());}};_0x3219ee(++_0x524493);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var auth=require(_0x0d8b('0x3'));var interaction=require(_0x0d8b('0x4'));var config=require(_0x0d8b('0x5'));var controller=require(_0x0d8b('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x0d8b('0x7')]);router[_0x0d8b('0x8')](_0x0d8b('0x9'),auth['isAuthenticated'](),controller[_0x0d8b('0xa')]);router[_0x0d8b('0x8')]('/:id',auth[_0x0d8b('0xb')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0x8')](_0x0d8b('0xd'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0x8')](_0x0d8b('0xf'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['get'](_0x0d8b('0x11'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x12')]);router[_0x0d8b('0x13')]('/',auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x14')]);router[_0x0d8b('0x13')](_0x0d8b('0xf'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x15')]);router[_0x0d8b('0x13')](_0x0d8b('0x11'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x16')]);router['put'](_0x0d8b('0x17'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x18')]);router[_0x0d8b('0x19')](_0x0d8b('0x17'),auth['isAuthenticated'](),controller[_0x0d8b('0x1a')]);router[_0x0d8b('0x19')](_0x0d8b('0xf'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x1b')]);router[_0x0d8b('0x19')](_0x0d8b('0x11'),auth[_0x0d8b('0xb')](),controller['removeAgents']);module[_0x0d8b('0x1c')]=router; \ No newline at end of file +var _0xb10b=['addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create'];(function(_0x1fafa5,_0x1aa281){var _0xcf08c9=function(_0x3af1b4){while(--_0x3af1b4){_0x1fafa5['push'](_0x1fafa5['shift']());}};_0xcf08c9(++_0x1aa281);}(_0xb10b,0x12a));var _0xbb10=function(_0x33403b,_0x5cca9c){_0x33403b=_0x33403b-0x0;var _0x2d8657=_0xb10b[_0x33403b];return _0x2d8657;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var auth=require(_0xbb10('0x4'));var interaction=require(_0xbb10('0x5'));var config=require(_0xbb10('0x6'));var controller=require(_0xbb10('0x7'));router[_0xbb10('0x8')]('/',auth[_0xbb10('0x9')](),controller['index']);router[_0xbb10('0x8')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0xb')]);router[_0xbb10('0x8')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0xd')]);router[_0xbb10('0x8')](_0xbb10('0xe'),auth[_0xbb10('0x9')](),controller['getMembers']);router['get'](_0xbb10('0xf'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x10')]);router['get'](_0xbb10('0x11'),auth['isAuthenticated'](),controller[_0xbb10('0x12')]);router[_0xbb10('0x13')]('/',auth[_0xbb10('0x9')](),controller[_0xbb10('0x14')]);router[_0xbb10('0x13')](_0xbb10('0xf'),auth['isAuthenticated'](),controller[_0xbb10('0x15')]);router[_0xbb10('0x13')](_0xbb10('0x11'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x16')]);router[_0xbb10('0x17')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x18')]);router[_0xbb10('0x19')]('/:id',auth[_0xbb10('0x9')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x19')](_0xbb10('0xf'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x1b')]);router[_0xbb10('0x19')](_0xbb10('0x11'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 6d8518f..3f8103c 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 _0x6bd9=['moment','sequelize','exports','STRING','DATE'];(function(_0x1ae7c8,_0x274e1d){var _0x66aab0=function(_0x3dd2b0){while(--_0x3dd2b0){_0x1ae7c8['push'](_0x1ae7c8['shift']());}};_0x66aab0(++_0x274e1d);}(_0x6bd9,0xaa));var _0x96bd=function(_0x51e795,_0x402f92){_0x51e795=_0x51e795-0x0;var _0x358732=_0x6bd9[_0x51e795];return _0x358732;};'use strict';var moment=require(_0x96bd('0x0'));var Sequelize=require(_0x96bd('0x1'));module[_0x96bd('0x2')]={'uniqueid':{'type':Sequelize[_0x96bd('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x96bd('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x96bd('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x775d=['STRING','DATE','moment','sequelize'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x775d,0xd2));var _0xd775=function(_0x2d7e6d,_0x336360){_0x2d7e6d=_0x2d7e6d-0x0;var _0x14f11a=_0x775d[_0x2d7e6d];return _0x14f11a;};'use strict';var moment=require(_0xd775('0x0'));var Sequelize=require(_0xd775('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xd775('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xd775('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xd775('0x3')]},'exitAt':{'type':Sequelize[_0xd775('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index c609967..7d4d456 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 _0xc42a=['count','offset','set','Content-Range','reject','save','update','then','destroy','end','sendStatus','error','name','send','FaxQueueReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','rows','catch','show','params','create','body','find','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json'];(function(_0x5f1b1e,_0x299f3f){var _0x5170ca=function(_0xcfb2a4){while(--_0xcfb2a4){_0x5f1b1e['push'](_0x5f1b1e['shift']());}};_0x5170ca(++_0x299f3f);}(_0xc42a,0x1a2));var _0xac42=function(_0x2f01e1,_0x51a54c){_0x2f01e1=_0x2f01e1-0x0;var _0x4953f8=_0xc42a[_0x2f01e1];return _0x4953f8;};'use strict';var pdf=require(_0xac42('0x0'));var emlformat=require(_0xac42('0x1'));var rimraf=require(_0xac42('0x2'));var zipdir=require(_0xac42('0x3'));var jsonpatch=require(_0xac42('0x4'));var rp=require(_0xac42('0x5'));var moment=require('moment');var BPromise=require(_0xac42('0x6'));var Mustache=require(_0xac42('0x7'));var util=require(_0xac42('0x8'));var path=require(_0xac42('0x9'));var sox=require(_0xac42('0xa'));var csv=require(_0xac42('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xac42('0xc'));var squel=require('squel');var crypto=require(_0xac42('0xd'));var jsforce=require(_0xac42('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xac42('0xb'));var querystring=require(_0xac42('0xf'));var Papa=require(_0xac42('0x10'));var Redis=require(_0xac42('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xac42('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac42('0x13'))(_0xac42('0x14'));var utils=require(_0xac42('0x15'));var config=require(_0xac42('0x16'));var db=require(_0xac42('0x17'))['db'];function respondWithStatusCode(_0x243221,_0x3d93c3){_0x3d93c3=_0x3d93c3||0xcc;return function(_0x49f8f6){if(_0x49f8f6){return _0x243221['sendStatus'](_0x3d93c3);}return _0x243221[_0xac42('0x18')](_0x3d93c3)['end']();};}function respondWithResult(_0x22c28e,_0x563020){_0x563020=_0x563020||0xc8;return function(_0x471838){if(_0x471838){return _0x22c28e[_0xac42('0x18')](_0x563020)[_0xac42('0x19')](_0x471838);}};}function respondWithFilteredResult(_0x3174f4,_0x2d5828){return function(_0x34ebd0){if(_0x34ebd0){var _0x528c00=_0x34ebd0[_0xac42('0x1a')],_0xb58f6f=_0x2d5828[_0xac42('0x1b')],_0xefd5fd=_0x2d5828['offset']+_0x2d5828['limit'],_0xd523ec;if(_0xefd5fd>=_0x528c00){_0xefd5fd=_0x528c00;_0xd523ec=0xc8;}else{_0xd523ec=0xce;}_0x3174f4[_0xac42('0x18')](_0xd523ec);return _0x3174f4[_0xac42('0x1c')](_0xac42('0x1d'),_0xb58f6f+'-'+_0xefd5fd+'/'+_0x528c00)[_0xac42('0x19')](_0x34ebd0);}return null;};}function patchUpdates(_0xa5c895){return function(_0x9667e7){try{jsonpatch['apply'](_0x9667e7,_0xa5c895,!![]);}catch(_0x49dd82){return BPromise[_0xac42('0x1e')](_0x49dd82);}return _0x9667e7[_0xac42('0x1f')]();};}function saveUpdates(_0x57a812,_0x5108a7){return function(_0xc4574e){if(_0xc4574e){return _0xc4574e[_0xac42('0x20')](_0x57a812)[_0xac42('0x21')](function(_0x5c1ef0){return _0x5c1ef0;});}return null;};}function removeEntity(_0xb3cb60,_0x1f25ea){return function(_0x32c50e){if(_0x32c50e){return _0x32c50e[_0xac42('0x22')]()['then'](function(){_0xb3cb60[_0xac42('0x18')](0xcc)[_0xac42('0x23')]();});}};}function handleEntityNotFound(_0x491886,_0xb8024e){return function(_0x371518){if(!_0x371518){_0x491886[_0xac42('0x24')](0x194);}return _0x371518;};}function handleError(_0x562684,_0x342de7){_0x342de7=_0x342de7||0x1f4;return function(_0x379b00){logger[_0xac42('0x25')](_0x379b00['stack']);if(_0x379b00[_0xac42('0x26')]){delete _0x379b00[_0xac42('0x26')];}_0x562684[_0xac42('0x18')](_0x342de7)[_0xac42('0x27')](_0x379b00);};}exports['index']=function(_0x2f6aff,_0x494fa4){var _0x4ba7c0={},_0x2593b2={},_0x373852={'count':0x0,'rows':[]};var _0x181c4c=_['map'](db[_0xac42('0x28')][_0xac42('0x29')],function(_0x29e3df){return{'name':_0x29e3df[_0xac42('0x2a')],'type':_0x29e3df[_0xac42('0x2b')][_0xac42('0x2c')]};});_0x2593b2[_0xac42('0x2d')]=_['map'](_0x181c4c,'name');_0x2593b2['query']=_[_0xac42('0x2e')](_0x2f6aff[_0xac42('0x2f')]);_0x2593b2[_0xac42('0x30')]=_[_0xac42('0x31')](_0x2593b2[_0xac42('0x2d')],_0x2593b2['query']);_0x4ba7c0['attributes']=_[_0xac42('0x31')](_0x2593b2['model'],qs[_0xac42('0x32')](_0x2f6aff[_0xac42('0x2f')][_0xac42('0x32')]));_0x4ba7c0[_0xac42('0x33')]=_0x4ba7c0[_0xac42('0x33')][_0xac42('0x34')]?_0x4ba7c0[_0xac42('0x33')]:_0x2593b2[_0xac42('0x2d')];if(!_0x2f6aff[_0xac42('0x2f')][_0xac42('0x35')](_0xac42('0x36'))){_0x4ba7c0[_0xac42('0x37')]=qs[_0xac42('0x37')](_0x2f6aff['query'][_0xac42('0x37')]);_0x4ba7c0[_0xac42('0x1b')]=qs[_0xac42('0x1b')](_0x2f6aff[_0xac42('0x2f')][_0xac42('0x1b')]);}_0x4ba7c0[_0xac42('0x38')]=qs['sort'](_0x2f6aff[_0xac42('0x2f')]['sort']);_0x4ba7c0[_0xac42('0x39')]=qs[_0xac42('0x30')](_[_0xac42('0x3a')](_0x2f6aff[_0xac42('0x2f')],_0x2593b2['filters']));if(_0x2f6aff[_0xac42('0x2f')][_0xac42('0x3b')]){_0x4ba7c0['where']=_[_0xac42('0x3c')](_0x4ba7c0[_0xac42('0x39')],{'$or':_[_0xac42('0x3d')](_0x181c4c,function(_0x50d6a3){if(_0x50d6a3[_0xac42('0x2b')]!==_0xac42('0x3e')){var _0x946954={};_0x946954[_0x50d6a3[_0xac42('0x26')]]={'$like':'%'+_0x2f6aff[_0xac42('0x2f')][_0xac42('0x3b')]+'%'};return _0x946954;}})});}_0x4ba7c0=_[_0xac42('0x3c')]({},_0x4ba7c0,_0x2f6aff[_0xac42('0x3f')]);var _0x30ca0a={'where':_0x4ba7c0[_0xac42('0x39')]};return db['FaxQueueReport'][_0xac42('0x1a')](_0x30ca0a)['then'](function(_0x288653){_0x373852[_0xac42('0x1a')]=_0x288653;if(_0x2f6aff['query'][_0xac42('0x40')]){_0x4ba7c0[_0xac42('0x41')]=[{'all':!![]}];}return db['FaxQueueReport']['findAll'](_0x4ba7c0);})['then'](function(_0x5928ec){_0x373852[_0xac42('0x42')]=_0x5928ec;return _0x373852;})[_0xac42('0x21')](respondWithFilteredResult(_0x494fa4,_0x4ba7c0))[_0xac42('0x43')](handleError(_0x494fa4,null));};exports[_0xac42('0x44')]=function(_0x47de50,_0x111bff){var _0x5237c5={'raw':!![],'where':{'id':_0x47de50[_0xac42('0x45')]['id']}},_0x211e24={};_0x211e24['model']=_[_0xac42('0x2e')](db[_0xac42('0x28')][_0xac42('0x29')]);_0x211e24[_0xac42('0x2f')]=_[_0xac42('0x2e')](_0x47de50['query']);_0x211e24['filters']=_[_0xac42('0x31')](_0x211e24[_0xac42('0x2d')],_0x211e24['query']);_0x5237c5[_0xac42('0x33')]=_[_0xac42('0x31')](_0x211e24[_0xac42('0x2d')],qs[_0xac42('0x32')](_0x47de50['query'][_0xac42('0x32')]));_0x5237c5[_0xac42('0x33')]=_0x5237c5[_0xac42('0x33')][_0xac42('0x34')]?_0x5237c5[_0xac42('0x33')]:_0x211e24[_0xac42('0x2d')];if(_0x47de50['query'][_0xac42('0x40')]){_0x5237c5[_0xac42('0x41')]=[{'all':!![]}];}_0x5237c5=_[_0xac42('0x3c')]({},_0x5237c5,_0x47de50['options']);return db[_0xac42('0x28')]['find'](_0x5237c5)[_0xac42('0x21')](handleEntityNotFound(_0x111bff,null))[_0xac42('0x21')](respondWithResult(_0x111bff,null))[_0xac42('0x43')](handleError(_0x111bff,null));};exports[_0xac42('0x46')]=function(_0x54cf41,_0x43563a){return db['FaxQueueReport'][_0xac42('0x46')](_0x54cf41[_0xac42('0x47')],{})[_0xac42('0x21')](respondWithResult(_0x43563a,0xc9))['catch'](handleError(_0x43563a,null));};exports['update']=function(_0x4876f7,_0x3fa7e3){if(_0x4876f7[_0xac42('0x47')]['id']){delete _0x4876f7['body']['id'];}return db[_0xac42('0x28')][_0xac42('0x48')]({'where':{'id':_0x4876f7['params']['id']}})[_0xac42('0x21')](handleEntityNotFound(_0x3fa7e3,null))[_0xac42('0x21')](saveUpdates(_0x4876f7[_0xac42('0x47')],null))[_0xac42('0x21')](respondWithResult(_0x3fa7e3,null))[_0xac42('0x43')](handleError(_0x3fa7e3,null));};exports['destroy']=function(_0x4fe374,_0xf8e91c){return db[_0xac42('0x28')]['find']({'where':{'id':_0x4fe374[_0xac42('0x45')]['id']}})['then'](handleEntityNotFound(_0xf8e91c,null))[_0xac42('0x21')](removeEntity(_0xf8e91c,null))[_0xac42('0x43')](handleError(_0xf8e91c,null));};exports[_0xac42('0x49')]=function(_0x58ccfc,_0x54bd20){return db[_0xac42('0x28')][_0xac42('0x49')]()[_0xac42('0x21')](respondWithResult(_0x54bd20,null))[_0xac42('0x43')](handleError(_0x54bd20,null));}; \ No newline at end of file +var _0xf97d=['querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','then','destroy','end','error','stack','name','send','map','FaxQueueReport','fieldName','type','key','model','query','attributes','intersection','fields','length','sort','filters','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','create','body','find','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','lodash','squel','crypto'];(function(_0xde2d49,_0x3afb54){var _0x4b7cf9=function(_0x59e53e){while(--_0x59e53e){_0xde2d49['push'](_0xde2d49['shift']());}};_0x4b7cf9(++_0x3afb54);}(_0xf97d,0x15b));var _0xdf97=function(_0x9a2f5,_0x6095ba){_0x9a2f5=_0x9a2f5-0x0;var _0x1b9757=_0xf97d[_0x9a2f5];return _0x1b9757;};'use strict';var pdf=require(_0xdf97('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xdf97('0x1'));var zipdir=require(_0xdf97('0x2'));var jsonpatch=require(_0xdf97('0x3'));var rp=require(_0xdf97('0x4'));var moment=require(_0xdf97('0x5'));var BPromise=require(_0xdf97('0x6'));var Mustache=require(_0xdf97('0x7'));var util=require('util');var path=require('path');var sox=require(_0xdf97('0x8'));var csv=require('to-csv');var ejs=require(_0xdf97('0x9'));var fs=require('fs');var _=require(_0xdf97('0xa'));var squel=require(_0xdf97('0xb'));var crypto=require(_0xdf97('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xdf97('0xd'));var Papa=require('papaparse');var Redis=require(_0xdf97('0xe'));var authService=require(_0xdf97('0xf'));var qs=require(_0xdf97('0x10'));var as=require(_0xdf97('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdf97('0x12'))(_0xdf97('0x13'));var utils=require(_0xdf97('0x14'));var config=require(_0xdf97('0x15'));var db=require(_0xdf97('0x16'))['db'];function respondWithStatusCode(_0x15641b,_0x37e2a7){_0x37e2a7=_0x37e2a7||0xcc;return function(_0x1ae8a9){if(_0x1ae8a9){return _0x15641b[_0xdf97('0x17')](_0x37e2a7);}return _0x15641b['status'](_0x37e2a7)['end']();};}function respondWithResult(_0x3f3f62,_0x483347){_0x483347=_0x483347||0xc8;return function(_0x347ddb){if(_0x347ddb){return _0x3f3f62[_0xdf97('0x18')](_0x483347)[_0xdf97('0x19')](_0x347ddb);}};}function respondWithFilteredResult(_0x24a493,_0x113157){return function(_0x27abbf){if(_0x27abbf){var _0x48dbc4=_0x27abbf[_0xdf97('0x1a')],_0xf0851b=_0x113157[_0xdf97('0x1b')],_0x246d4d=_0x113157[_0xdf97('0x1b')]+_0x113157[_0xdf97('0x1c')],_0x38a165;if(_0x246d4d>=_0x48dbc4){_0x246d4d=_0x48dbc4;_0x38a165=0xc8;}else{_0x38a165=0xce;}_0x24a493[_0xdf97('0x18')](_0x38a165);return _0x24a493[_0xdf97('0x1d')](_0xdf97('0x1e'),_0xf0851b+'-'+_0x246d4d+'/'+_0x48dbc4)[_0xdf97('0x19')](_0x27abbf);}return null;};}function patchUpdates(_0x3cf25a){return function(_0x3c4c5c){try{jsonpatch[_0xdf97('0x1f')](_0x3c4c5c,_0x3cf25a,!![]);}catch(_0x2bb110){return BPromise['reject'](_0x2bb110);}return _0x3c4c5c[_0xdf97('0x20')]();};}function saveUpdates(_0x51a01a,_0x7ff95){return function(_0x523333){if(_0x523333){return _0x523333['update'](_0x51a01a)[_0xdf97('0x21')](function(_0x30400b){return _0x30400b;});}return null;};}function removeEntity(_0x54e720,_0x454541){return function(_0x117176){if(_0x117176){return _0x117176[_0xdf97('0x22')]()[_0xdf97('0x21')](function(){_0x54e720['status'](0xcc)[_0xdf97('0x23')]();});}};}function handleEntityNotFound(_0x50d56d,_0x3b384e){return function(_0x451009){if(!_0x451009){_0x50d56d[_0xdf97('0x17')](0x194);}return _0x451009;};}function handleError(_0x5e64c2,_0x1c66ab){_0x1c66ab=_0x1c66ab||0x1f4;return function(_0x436c88){logger[_0xdf97('0x24')](_0x436c88[_0xdf97('0x25')]);if(_0x436c88[_0xdf97('0x26')]){delete _0x436c88['name'];}_0x5e64c2[_0xdf97('0x18')](_0x1c66ab)[_0xdf97('0x27')](_0x436c88);};}exports['index']=function(_0x559ab0,_0x2fddae){var _0x2e73e5={},_0x41b4b0={},_0x254828={'count':0x0,'rows':[]};var _0x11fb1b=_[_0xdf97('0x28')](db[_0xdf97('0x29')]['rawAttributes'],function(_0x1328db){return{'name':_0x1328db[_0xdf97('0x2a')],'type':_0x1328db[_0xdf97('0x2b')][_0xdf97('0x2c')]};});_0x41b4b0[_0xdf97('0x2d')]=_[_0xdf97('0x28')](_0x11fb1b,'name');_0x41b4b0['query']=_['keys'](_0x559ab0[_0xdf97('0x2e')]);_0x41b4b0['filters']=_['intersection'](_0x41b4b0[_0xdf97('0x2d')],_0x41b4b0[_0xdf97('0x2e')]);_0x2e73e5[_0xdf97('0x2f')]=_[_0xdf97('0x30')](_0x41b4b0['model'],qs[_0xdf97('0x31')](_0x559ab0[_0xdf97('0x2e')][_0xdf97('0x31')]));_0x2e73e5[_0xdf97('0x2f')]=_0x2e73e5[_0xdf97('0x2f')][_0xdf97('0x32')]?_0x2e73e5[_0xdf97('0x2f')]:_0x41b4b0[_0xdf97('0x2d')];if(!_0x559ab0[_0xdf97('0x2e')]['hasOwnProperty']('nolimit')){_0x2e73e5[_0xdf97('0x1c')]=qs[_0xdf97('0x1c')](_0x559ab0[_0xdf97('0x2e')][_0xdf97('0x1c')]);_0x2e73e5['offset']=qs[_0xdf97('0x1b')](_0x559ab0[_0xdf97('0x2e')]['offset']);}_0x2e73e5['order']=qs['sort'](_0x559ab0['query'][_0xdf97('0x33')]);_0x2e73e5['where']=qs[_0xdf97('0x34')](_[_0xdf97('0x35')](_0x559ab0[_0xdf97('0x2e')],_0x41b4b0[_0xdf97('0x34')]));if(_0x559ab0[_0xdf97('0x2e')][_0xdf97('0x36')]){_0x2e73e5['where']=_[_0xdf97('0x37')](_0x2e73e5[_0xdf97('0x38')],{'$or':_[_0xdf97('0x28')](_0x11fb1b,function(_0x6b0668){if(_0x6b0668['type']!==_0xdf97('0x39')){var _0x177d7d={};_0x177d7d[_0x6b0668[_0xdf97('0x26')]]={'$like':'%'+_0x559ab0[_0xdf97('0x2e')][_0xdf97('0x36')]+'%'};return _0x177d7d;}})});}_0x2e73e5=_[_0xdf97('0x37')]({},_0x2e73e5,_0x559ab0[_0xdf97('0x3a')]);var _0x4b9ebd={'where':_0x2e73e5[_0xdf97('0x38')]};return db[_0xdf97('0x29')]['count'](_0x4b9ebd)[_0xdf97('0x21')](function(_0x1cfeee){_0x254828[_0xdf97('0x1a')]=_0x1cfeee;if(_0x559ab0[_0xdf97('0x2e')][_0xdf97('0x3b')]){_0x2e73e5[_0xdf97('0x3c')]=[{'all':!![]}];}return db[_0xdf97('0x29')][_0xdf97('0x3d')](_0x2e73e5);})[_0xdf97('0x21')](function(_0x5648f8){_0x254828[_0xdf97('0x3e')]=_0x5648f8;return _0x254828;})[_0xdf97('0x21')](respondWithFilteredResult(_0x2fddae,_0x2e73e5))[_0xdf97('0x3f')](handleError(_0x2fddae,null));};exports[_0xdf97('0x40')]=function(_0x56cf09,_0x5b129f){var _0x2afddb={'raw':!![],'where':{'id':_0x56cf09[_0xdf97('0x41')]['id']}},_0x3a8723={};_0x3a8723['model']=_[_0xdf97('0x42')](db[_0xdf97('0x29')][_0xdf97('0x43')]);_0x3a8723['query']=_['keys'](_0x56cf09[_0xdf97('0x2e')]);_0x3a8723[_0xdf97('0x34')]=_[_0xdf97('0x30')](_0x3a8723[_0xdf97('0x2d')],_0x3a8723[_0xdf97('0x2e')]);_0x2afddb[_0xdf97('0x2f')]=_[_0xdf97('0x30')](_0x3a8723[_0xdf97('0x2d')],qs['fields'](_0x56cf09[_0xdf97('0x2e')][_0xdf97('0x31')]));_0x2afddb[_0xdf97('0x2f')]=_0x2afddb['attributes'][_0xdf97('0x32')]?_0x2afddb[_0xdf97('0x2f')]:_0x3a8723['model'];if(_0x56cf09[_0xdf97('0x2e')]['includeAll']){_0x2afddb[_0xdf97('0x3c')]=[{'all':!![]}];}_0x2afddb=_['merge']({},_0x2afddb,_0x56cf09[_0xdf97('0x3a')]);return db[_0xdf97('0x29')]['find'](_0x2afddb)['then'](handleEntityNotFound(_0x5b129f,null))[_0xdf97('0x21')](respondWithResult(_0x5b129f,null))['catch'](handleError(_0x5b129f,null));};exports[_0xdf97('0x44')]=function(_0x5653af,_0x3d938f){return db[_0xdf97('0x29')]['create'](_0x5653af[_0xdf97('0x45')],{})[_0xdf97('0x21')](respondWithResult(_0x3d938f,0xc9))[_0xdf97('0x3f')](handleError(_0x3d938f,null));};exports['update']=function(_0x525e1f,_0x1922f5){if(_0x525e1f[_0xdf97('0x45')]['id']){delete _0x525e1f[_0xdf97('0x45')]['id'];}return db['FaxQueueReport']['find']({'where':{'id':_0x525e1f['params']['id']}})[_0xdf97('0x21')](handleEntityNotFound(_0x1922f5,null))[_0xdf97('0x21')](saveUpdates(_0x525e1f[_0xdf97('0x45')],null))[_0xdf97('0x21')](respondWithResult(_0x1922f5,null))[_0xdf97('0x3f')](handleError(_0x1922f5,null));};exports[_0xdf97('0x22')]=function(_0x5f49b9,_0x582c6d){return db[_0xdf97('0x29')][_0xdf97('0x46')]({'where':{'id':_0x5f49b9['params']['id']}})[_0xdf97('0x21')](handleEntityNotFound(_0x582c6d,null))['then'](removeEntity(_0x582c6d,null))[_0xdf97('0x3f')](handleError(_0x582c6d,null));};exports[_0xdf97('0x47')]=function(_0x5eaff9,_0x406ef3){return db['FaxQueueReport'][_0xdf97('0x47')]()[_0xdf97('0x21')](respondWithResult(_0x406ef3,null))[_0xdf97('0x3f')](handleError(_0x406ef3,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 5dc2bb7..3606167 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 _0x52ed=['report_fax_queue','uniqueid','lodash','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport'];(function(_0x4df557,_0x27a29e){var _0x50c0df=function(_0x47c5c5){while(--_0x47c5c5){_0x4df557['push'](_0x4df557['shift']());}};_0x50c0df(++_0x27a29e);}(_0x52ed,0xec));var _0xd52e=function(_0x4dc35f,_0x377c51){_0x4dc35f=_0x4dc35f-0x0;var _0x1f8820=_0x52ed[_0x4dc35f];return _0x1f8820;};'use strict';var _=require(_0xd52e('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xd52e('0x1'));var BPromise=require(_0xd52e('0x2'));var rp=require(_0xd52e('0x3'));var fs=require('fs');var path=require(_0xd52e('0x4'));var rimraf=require(_0xd52e('0x5'));var config=require(_0xd52e('0x6'));var attributes=require(_0xd52e('0x7'));module[_0xd52e('0x8')]=function(_0x56b40e,_0x27a9ce){return _0x56b40e[_0xd52e('0x9')](_0xd52e('0xa'),attributes,{'tableName':_0xd52e('0xb'),'paranoid':![],'indexes':[{'name':_0xd52e('0xc'),'fields':[_0xd52e('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x63ce=['../../config/environment','./faxQueueReport.attributes','exports','FaxQueueReport','report_fax_queue','uniqueid','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x5172a3,_0x59b232){var _0x457286=function(_0x452d35){while(--_0x452d35){_0x5172a3['push'](_0x5172a3['shift']());}};_0x457286(++_0x59b232);}(_0x63ce,0x18e));var _0xe63c=function(_0x1bbc08,_0x444008){_0x1bbc08=_0x1bbc08-0x0;var _0x5d825b=_0x63ce[_0x1bbc08];return _0x5d825b;};'use strict';var _=require(_0xe63c('0x0'));var util=require(_0xe63c('0x1'));var logger=require('../../config/logger')(_0xe63c('0x2'));var moment=require(_0xe63c('0x3'));var BPromise=require(_0xe63c('0x4'));var rp=require(_0xe63c('0x5'));var fs=require('fs');var path=require(_0xe63c('0x6'));var rimraf=require(_0xe63c('0x7'));var config=require(_0xe63c('0x8'));var attributes=require(_0xe63c('0x9'));module[_0xe63c('0xa')]=function(_0x4ade9f,_0x3a5c58){return _0x4ade9f['define'](_0xe63c('0xb'),attributes,{'tableName':_0xe63c('0xc'),'paranoid':![],'indexes':[{'name':_0xe63c('0xd'),'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 418ba7b..e538ee5 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 _0x842d=['bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','FaxQueueReport,\x20%s,\x20%s','FaxQueueReport','body','options','raw','CreateFaxQueueReport','UpdateFaxQueueReport','update','where','attributes','limit','catch','lodash','moment'];(function(_0x58fd8d,_0x3aea71){var _0x5c975b=function(_0x4ef743){while(--_0x4ef743){_0x58fd8d['push'](_0x58fd8d['shift']());}};_0x5c975b(++_0x3aea71);}(_0x842d,0x1ee));var _0xd842=function(_0x22a8c4,_0x51c09a){_0x22a8c4=_0x22a8c4-0x0;var _0x104c6d=_0x842d[_0x22a8c4];return _0x104c6d;};'use strict';var _=require(_0xd842('0x0'));var util=require('util');var moment=require(_0xd842('0x1'));var BPromise=require(_0xd842('0x2'));var rs=require(_0xd842('0x3'));var fs=require('fs');var Redis=require(_0xd842('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd842('0x5'))(_0xd842('0x6'));var config=require(_0xd842('0x7'));var jayson=require(_0xd842('0x8'));var client=jayson[_0xd842('0x9')][_0xd842('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x8a7818,_0x1ba775,_0xc709ab){return new BPromise(function(_0x3b9add,_0x4a7f31){return client['request'](_0x8a7818,_0xc709ab)[_0xd842('0xb')](function(_0x4da1e9){logger[_0xd842('0xc')]('FaxQueueReport,\x20%s,\x20%s',_0x1ba775,_0xd842('0xd'));logger[_0xd842('0xe')](_0xd842('0xf'),_0x1ba775,_0xd842('0xd'),JSON[_0xd842('0x10')](_0x4da1e9));if(_0x4da1e9[_0xd842('0x11')]){if(_0x4da1e9[_0xd842('0x11')]['code']===0x1f4){logger[_0xd842('0x11')]('FaxQueueReport,\x20%s,\x20%s',_0x1ba775,_0x4da1e9[_0xd842('0x11')][_0xd842('0x12')]);return _0x4a7f31(_0x4da1e9['error'][_0xd842('0x12')]);}logger[_0xd842('0x11')](_0xd842('0x13'),_0x1ba775,_0x4da1e9['error'][_0xd842('0x12')]);return _0x3b9add(_0x4da1e9[_0xd842('0x11')]['message']);}else{logger['info'](_0xd842('0x13'),_0x1ba775,_0xd842('0xd'));_0x3b9add(_0x4da1e9['result'][_0xd842('0x12')]);}})['catch'](function(_0x6c6697){logger[_0xd842('0x11')]('FaxQueueReport,\x20%s,\x20%s',_0x1ba775,_0x6c6697);_0x4a7f31(_0x6c6697);});});}exports['CreateFaxQueueReport']=function(_0x585dde){var _0x3a358f=this;return new Promise(function(_0x3f69e3,_0x27bd2a){return db[_0xd842('0x14')]['create'](_0x585dde[_0xd842('0x15')],{'raw':_0x585dde[_0xd842('0x16')]?_0x585dde['options'][_0xd842('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0xc0ecdb){logger[_0xd842('0xc')](_0xd842('0x18'),_0x585dde);logger['debug'](_0xd842('0x18'),_0x585dde,JSON[_0xd842('0x10')](_0xc0ecdb));_0x3f69e3(_0xc0ecdb);})['catch'](function(_0x52bebf){logger['error']('CreateFaxQueueReport',_0x52bebf[_0xd842('0x12')],_0x585dde);_0x27bd2a(_0x3a358f['error'](0x1f4,_0x52bebf['message']));});});};exports[_0xd842('0x19')]=function(_0x5e3b12){var _0x3dfc1f=this;return new Promise(function(_0x2616c0,_0x33d257){return db[_0xd842('0x14')][_0xd842('0x1a')](_0x5e3b12[_0xd842('0x15')],{'raw':_0x5e3b12[_0xd842('0x16')]?_0x5e3b12[_0xd842('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5e3b12[_0xd842('0x16')]?_0x5e3b12['options'][_0xd842('0x1b')]||null:null,'attributes':_0x5e3b12[_0xd842('0x16')]?_0x5e3b12[_0xd842('0x16')][_0xd842('0x1c')]||null:null,'limit':_0x5e3b12[_0xd842('0x16')]?_0x5e3b12[_0xd842('0x16')][_0xd842('0x1d')]||null:null})[_0xd842('0xb')](function(_0x4a9b3b){logger[_0xd842('0xc')]('UpdateFaxQueueReport',_0x5e3b12);logger[_0xd842('0xe')](_0xd842('0x19'),_0x5e3b12,JSON[_0xd842('0x10')](_0x4a9b3b));_0x2616c0(_0x4a9b3b);})[_0xd842('0x1e')](function(_0x22f2d3){logger[_0xd842('0x11')](_0xd842('0x19'),_0x22f2d3[_0xd842('0x12')],_0x5e3b12);_0x33d257(_0x3dfc1f[_0xd842('0x11')](0x1f4,_0x22f2d3[_0xd842('0x12')]));});});}; \ No newline at end of file +var _0xa3bd=['limit','stringify','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','FaxQueueReport,\x20%s,\x20%s','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','CreateFaxQueueReport','FaxQueueReport','body','options','raw','UpdateFaxQueueReport'];(function(_0x1cef67,_0x7311d5){var _0x1fa5bd=function(_0x3c4e8c){while(--_0x3c4e8c){_0x1cef67['push'](_0x1cef67['shift']());}};_0x1fa5bd(++_0x7311d5);}(_0xa3bd,0x1d3));var _0xda3b=function(_0x250873,_0x3e8932){_0x250873=_0x250873-0x0;var _0x437de2=_0xa3bd[_0x250873];return _0x437de2;};'use strict';var _=require('lodash');var util=require(_0xda3b('0x0'));var moment=require(_0xda3b('0x1'));var BPromise=require(_0xda3b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xda3b('0x3'));var db=require(_0xda3b('0x4'))['db'];var utils=require(_0xda3b('0x5'));var logger=require(_0xda3b('0x6'))(_0xda3b('0x7'));var config=require('../../config/environment');var jayson=require(_0xda3b('0x8'));var client=jayson[_0xda3b('0x9')][_0xda3b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x434c7e,_0x24a887,_0x3e12dc){return new BPromise(function(_0x46fbad,_0x21b514){return client[_0xda3b('0xb')](_0x434c7e,_0x3e12dc)[_0xda3b('0xc')](function(_0x2ed893){logger[_0xda3b('0xd')](_0xda3b('0xe'),_0x24a887,'request\x20sent');logger[_0xda3b('0xf')](_0xda3b('0x10'),_0x24a887,_0xda3b('0x11'),JSON['stringify'](_0x2ed893));if(_0x2ed893[_0xda3b('0x12')]){if(_0x2ed893[_0xda3b('0x12')][_0xda3b('0x13')]===0x1f4){logger[_0xda3b('0x12')]('FaxQueueReport,\x20%s,\x20%s',_0x24a887,_0x2ed893[_0xda3b('0x12')][_0xda3b('0x14')]);return _0x21b514(_0x2ed893[_0xda3b('0x12')][_0xda3b('0x14')]);}logger[_0xda3b('0x12')](_0xda3b('0xe'),_0x24a887,_0x2ed893[_0xda3b('0x12')][_0xda3b('0x14')]);return _0x46fbad(_0x2ed893[_0xda3b('0x12')][_0xda3b('0x14')]);}else{logger['info'](_0xda3b('0xe'),_0x24a887,_0xda3b('0x11'));_0x46fbad(_0x2ed893[_0xda3b('0x15')][_0xda3b('0x14')]);}})[_0xda3b('0x16')](function(_0x5e2f97){logger[_0xda3b('0x12')](_0xda3b('0xe'),_0x24a887,_0x5e2f97);_0x21b514(_0x5e2f97);});});}exports[_0xda3b('0x17')]=function(_0x349da4){var _0x331582=this;return new Promise(function(_0x4fcb13,_0xfb2d20){return db[_0xda3b('0x18')]['create'](_0x349da4[_0xda3b('0x19')],{'raw':_0x349da4[_0xda3b('0x1a')]?_0x349da4[_0xda3b('0x1a')][_0xda3b('0x1b')]===undefined?!![]:![]:!![]})[_0xda3b('0xc')](function(_0x2fa34e){logger['info'](_0xda3b('0x17'),_0x349da4);logger[_0xda3b('0xf')](_0xda3b('0x17'),_0x349da4,JSON['stringify'](_0x2fa34e));_0x4fcb13(_0x2fa34e);})[_0xda3b('0x16')](function(_0x338437){logger['error']('CreateFaxQueueReport',_0x338437[_0xda3b('0x14')],_0x349da4);_0xfb2d20(_0x331582[_0xda3b('0x12')](0x1f4,_0x338437[_0xda3b('0x14')]));});});};exports[_0xda3b('0x1c')]=function(_0x1cd424){var _0x1d4b27=this;return new Promise(function(_0x214e6b,_0x58abbd){return db[_0xda3b('0x18')]['update'](_0x1cd424['body'],{'raw':_0x1cd424[_0xda3b('0x1a')]?_0x1cd424[_0xda3b('0x1a')][_0xda3b('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1cd424[_0xda3b('0x1a')]?_0x1cd424['options']['where']||null:null,'attributes':_0x1cd424['options']?_0x1cd424[_0xda3b('0x1a')]['attributes']||null:null,'limit':_0x1cd424[_0xda3b('0x1a')]?_0x1cd424[_0xda3b('0x1a')][_0xda3b('0x1d')]||null:null})[_0xda3b('0xc')](function(_0x171cea){logger[_0xda3b('0xd')](_0xda3b('0x1c'),_0x1cd424);logger[_0xda3b('0xf')](_0xda3b('0x1c'),_0x1cd424,JSON[_0xda3b('0x1e')](_0x171cea));_0x214e6b(_0x171cea);})[_0xda3b('0x16')](function(_0x2eedbd){logger[_0xda3b('0x12')](_0xda3b('0x1c'),_0x2eedbd['message'],_0x1cd424);_0x58abbd(_0x1d4b27[_0xda3b('0x12')](0x1f4,_0x2eedbd['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 39f27ee..4a80f58 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 _0x5e7e=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','put','destroy','util','path'];(function(_0x5626a9,_0x9e64ed){var _0x46fe57=function(_0x4bfd99){while(--_0x4bfd99){_0x5626a9['push'](_0x5626a9['shift']());}};_0x46fe57(++_0x9e64ed);}(_0x5e7e,0x141));var _0xe5e7=function(_0x48740b,_0x893fd8){_0x48740b=_0x48740b-0x0;var _0xb868f2=_0x5e7e[_0x48740b];return _0xb868f2;};'use strict';var multer=require('multer');var util=require(_0xe5e7('0x0'));var path=require(_0xe5e7('0x1'));var timeout=require(_0xe5e7('0x2'));var express=require(_0xe5e7('0x3'));var router=express['Router']();var auth=require(_0xe5e7('0x4'));var interaction=require(_0xe5e7('0x5'));var config=require(_0xe5e7('0x6'));var controller=require(_0xe5e7('0x7'));router[_0xe5e7('0x8')]('/',auth[_0xe5e7('0x9')](),controller[_0xe5e7('0xa')]);router[_0xe5e7('0x8')](_0xe5e7('0xb'),auth[_0xe5e7('0x9')](),controller[_0xe5e7('0xc')]);router[_0xe5e7('0x8')](_0xe5e7('0xd'),auth['isAuthenticated'](),controller[_0xe5e7('0xe')]);router['post']('/',auth[_0xe5e7('0x9')](),controller['create']);router[_0xe5e7('0xf')]('/:id',auth[_0xe5e7('0x9')](),controller['update']);router['delete']('/:id',auth[_0xe5e7('0x9')](),controller[_0xe5e7('0x10')]);module['exports']=router; \ No newline at end of file +var _0x43b0=['isAuthenticated','show','create','put','update','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','/describe','/:id'];(function(_0x3886d3,_0x295247){var _0xbe22ed=function(_0xa9b9f1){while(--_0xa9b9f1){_0x3886d3['push'](_0x3886d3['shift']());}};_0xbe22ed(++_0x295247);}(_0x43b0,0x8c));var _0x043b=function(_0x1b0652,_0x3adbac){_0x1b0652=_0x1b0652-0x0;var _0x2bf739=_0x43b0[_0x1b0652];return _0x2bf739;};'use strict';var multer=require('multer');var util=require(_0x043b('0x0'));var path=require(_0x043b('0x1'));var timeout=require(_0x043b('0x2'));var express=require(_0x043b('0x3'));var router=express[_0x043b('0x4')]();var auth=require(_0x043b('0x5'));var interaction=require(_0x043b('0x6'));var config=require(_0x043b('0x7'));var controller=require(_0x043b('0x8'));router[_0x043b('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x043b('0x9')](_0x043b('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x043b('0x9')](_0x043b('0xb'),auth[_0x043b('0xc')](),controller[_0x043b('0xd')]);router['post']('/',auth[_0x043b('0xc')](),controller[_0x043b('0xe')]);router[_0x043b('0xf')](_0x043b('0xb'),auth[_0x043b('0xc')](),controller[_0x043b('0x10')]);router['delete'](_0x043b('0xb'),auth[_0x043b('0xc')](),controller[_0x043b('0x11')]);module[_0x043b('0x12')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 0ebffa2..ece39b9 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 _0x9047=['account','agent','queue','DATE','NOW','sequelize','exports','ENUM'];(function(_0x5ce8b9,_0x5cded8){var _0xe34be0=function(_0xe3d4e5){while(--_0xe3d4e5){_0x5ce8b9['push'](_0x5ce8b9['shift']());}};_0xe34be0(++_0x5cded8);}(_0x9047,0x115));var _0x7904=function(_0x1b69f0,_0x3ca093){_0x1b69f0=_0x1b69f0-0x0;var _0x55ff4e=_0x9047[_0x1b69f0];return _0x55ff4e;};'use strict';var moment=require('moment');var Sequelize=require(_0x7904('0x0'));module[_0x7904('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x7904('0x2')](_0x7904('0x3'),_0x7904('0x4'),_0x7904('0x5')),'allowNull':![],'defaultValue':_0x7904('0x5')},'transferredAt':{'type':Sequelize[_0x7904('0x6')],'allowNull':![],'defaultValue':Sequelize[_0x7904('0x7')]}}; \ No newline at end of file +var _0x56c0=['ENUM','account','agent','queue','DATE','NOW','moment','sequelize'];(function(_0x4e6747,_0xce5415){var _0x495275=function(_0x871c5c){while(--_0x871c5c){_0x4e6747['push'](_0x4e6747['shift']());}};_0x495275(++_0xce5415);}(_0x56c0,0xce));var _0x056c=function(_0x4dc0c4,_0x3ed069){_0x4dc0c4=_0x4dc0c4-0x0;var _0x3669f3=_0x56c0[_0x4dc0c4];return _0x3669f3;};'use strict';var moment=require(_0x056c('0x0'));var Sequelize=require(_0x056c('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x056c('0x2')](_0x056c('0x3'),_0x056c('0x4'),'queue'),'allowNull':![],'defaultValue':_0x056c('0x5')},'transferredAt':{'type':Sequelize[_0x056c('0x6')],'allowNull':![],'defaultValue':Sequelize[_0x056c('0x7')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index b7e81c0..b3110b5 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 _0x6a72=['filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','find','body','describe','rimraf','zip-dir','moment','bluebird','mustache','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','sendStatus','status','end','count','offset','limit','reject','save','update','destroy','then','error','name','send','map','FaxTransferReport','rawAttributes','fieldName','key','model','query','keys'];(function(_0x15bca7,_0x2112ea){var _0x445cc2=function(_0x3ced2c){while(--_0x3ced2c){_0x15bca7['push'](_0x15bca7['shift']());}};_0x445cc2(++_0x2112ea);}(_0x6a72,0xa3));var _0x26a7=function(_0x6ec1fe,_0x3e820c){_0x6ec1fe=_0x6ec1fe-0x0;var _0x16d021=_0x6a72[_0x6ec1fe];return _0x16d021;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x26a7('0x0'));var zipdir=require(_0x26a7('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x26a7('0x2'));var BPromise=require(_0x26a7('0x3'));var Mustache=require(_0x26a7('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x26a7('0x5'));var ejs=require(_0x26a7('0x6'));var fs=require('fs');var _=require(_0x26a7('0x7'));var squel=require(_0x26a7('0x8'));var crypto=require(_0x26a7('0x9'));var jsforce=require(_0x26a7('0xa'));var deskjs=require(_0x26a7('0xb'));var toCsv=require(_0x26a7('0x5'));var querystring=require(_0x26a7('0xc'));var Papa=require('papaparse');var Redis=require(_0x26a7('0xd'));var authService=require(_0x26a7('0xe'));var qs=require(_0x26a7('0xf'));var as=require(_0x26a7('0x10'));var hardwareService=require(_0x26a7('0x11'));var logger=require(_0x26a7('0x12'))(_0x26a7('0x13'));var utils=require(_0x26a7('0x14'));var config=require(_0x26a7('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x476c54,_0x32a442){_0x32a442=_0x32a442||0xcc;return function(_0x1b8b48){if(_0x1b8b48){return _0x476c54[_0x26a7('0x16')](_0x32a442);}return _0x476c54[_0x26a7('0x17')](_0x32a442)[_0x26a7('0x18')]();};}function respondWithResult(_0x445117,_0x5d3e41){_0x5d3e41=_0x5d3e41||0xc8;return function(_0x35c0c2){if(_0x35c0c2){return _0x445117[_0x26a7('0x17')](_0x5d3e41)['json'](_0x35c0c2);}};}function respondWithFilteredResult(_0x71c7a2,_0x4ec873){return function(_0x38d423){if(_0x38d423){var _0x361476=_0x38d423[_0x26a7('0x19')],_0x57e889=_0x4ec873[_0x26a7('0x1a')],_0xf129d7=_0x4ec873[_0x26a7('0x1a')]+_0x4ec873[_0x26a7('0x1b')],_0x1b4ff6;if(_0xf129d7>=_0x361476){_0xf129d7=_0x361476;_0x1b4ff6=0xc8;}else{_0x1b4ff6=0xce;}_0x71c7a2[_0x26a7('0x17')](_0x1b4ff6);return _0x71c7a2['set']('Content-Range',_0x57e889+'-'+_0xf129d7+'/'+_0x361476)['json'](_0x38d423);}return null;};}function patchUpdates(_0x1f71ec){return function(_0x54a064){try{jsonpatch['apply'](_0x54a064,_0x1f71ec,!![]);}catch(_0x17c930){return BPromise[_0x26a7('0x1c')](_0x17c930);}return _0x54a064[_0x26a7('0x1d')]();};}function saveUpdates(_0x2ecc37,_0x7f0d8b){return function(_0x55f4b5){if(_0x55f4b5){return _0x55f4b5[_0x26a7('0x1e')](_0x2ecc37)['then'](function(_0x4e4ec4){return _0x4e4ec4;});}return null;};}function removeEntity(_0x18b5e8,_0x270d29){return function(_0x377b89){if(_0x377b89){return _0x377b89[_0x26a7('0x1f')]()[_0x26a7('0x20')](function(){_0x18b5e8[_0x26a7('0x17')](0xcc)[_0x26a7('0x18')]();});}};}function handleEntityNotFound(_0x2ff89e,_0x518cfb){return function(_0x571d1f){if(!_0x571d1f){_0x2ff89e[_0x26a7('0x16')](0x194);}return _0x571d1f;};}function handleError(_0x2af95d,_0x471352){_0x471352=_0x471352||0x1f4;return function(_0x29cf11){logger[_0x26a7('0x21')](_0x29cf11['stack']);if(_0x29cf11[_0x26a7('0x22')]){delete _0x29cf11[_0x26a7('0x22')];}_0x2af95d['status'](_0x471352)[_0x26a7('0x23')](_0x29cf11);};}exports['index']=function(_0x289ea0,_0x27c3c6){var _0x475b75={},_0x1b3d68={},_0x1e614b={'count':0x0,'rows':[]};var _0x49c853=_[_0x26a7('0x24')](db[_0x26a7('0x25')][_0x26a7('0x26')],function(_0xd775b1){return{'name':_0xd775b1[_0x26a7('0x27')],'type':_0xd775b1['type'][_0x26a7('0x28')]};});_0x1b3d68[_0x26a7('0x29')]=_[_0x26a7('0x24')](_0x49c853,_0x26a7('0x22'));_0x1b3d68[_0x26a7('0x2a')]=_[_0x26a7('0x2b')](_0x289ea0[_0x26a7('0x2a')]);_0x1b3d68[_0x26a7('0x2c')]=_[_0x26a7('0x2d')](_0x1b3d68[_0x26a7('0x29')],_0x1b3d68[_0x26a7('0x2a')]);_0x475b75['attributes']=_[_0x26a7('0x2d')](_0x1b3d68[_0x26a7('0x29')],qs['fields'](_0x289ea0[_0x26a7('0x2a')][_0x26a7('0x2e')]));_0x475b75[_0x26a7('0x2f')]=_0x475b75[_0x26a7('0x2f')][_0x26a7('0x30')]?_0x475b75[_0x26a7('0x2f')]:_0x1b3d68[_0x26a7('0x29')];if(!_0x289ea0[_0x26a7('0x2a')][_0x26a7('0x31')](_0x26a7('0x32'))){_0x475b75[_0x26a7('0x1b')]=qs[_0x26a7('0x1b')](_0x289ea0[_0x26a7('0x2a')][_0x26a7('0x1b')]);_0x475b75[_0x26a7('0x1a')]=qs['offset'](_0x289ea0['query'][_0x26a7('0x1a')]);}_0x475b75[_0x26a7('0x33')]=qs['sort'](_0x289ea0[_0x26a7('0x2a')][_0x26a7('0x34')]);_0x475b75[_0x26a7('0x35')]=qs[_0x26a7('0x2c')](_[_0x26a7('0x36')](_0x289ea0[_0x26a7('0x2a')],_0x1b3d68[_0x26a7('0x2c')]));if(_0x289ea0[_0x26a7('0x2a')]['filter']){_0x475b75[_0x26a7('0x35')]=_[_0x26a7('0x37')](_0x475b75['where'],{'$or':_['map'](_0x49c853,function(_0x246312){if(_0x246312[_0x26a7('0x38')]!==_0x26a7('0x39')){var _0x192242={};_0x192242[_0x246312[_0x26a7('0x22')]]={'$like':'%'+_0x289ea0['query'][_0x26a7('0x3a')]+'%'};return _0x192242;}})});}_0x475b75=_[_0x26a7('0x37')]({},_0x475b75,_0x289ea0[_0x26a7('0x3b')]);var _0x482b82={'where':_0x475b75[_0x26a7('0x35')]};return db[_0x26a7('0x25')][_0x26a7('0x19')](_0x482b82)['then'](function(_0x357791){_0x1e614b[_0x26a7('0x19')]=_0x357791;if(_0x289ea0['query'][_0x26a7('0x3c')]){_0x475b75[_0x26a7('0x3d')]=[{'all':!![]}];}return db['FaxTransferReport'][_0x26a7('0x3e')](_0x475b75);})[_0x26a7('0x20')](function(_0x2b61b5){_0x1e614b['rows']=_0x2b61b5;return _0x1e614b;})['then'](respondWithFilteredResult(_0x27c3c6,_0x475b75))[_0x26a7('0x3f')](handleError(_0x27c3c6,null));};exports[_0x26a7('0x40')]=function(_0x59a183,_0x39b66d){var _0x37ef9a={'raw':!![],'where':{'id':_0x59a183[_0x26a7('0x41')]['id']}},_0x53c6ff={};_0x53c6ff['model']=_[_0x26a7('0x2b')](db[_0x26a7('0x25')]['rawAttributes']);_0x53c6ff[_0x26a7('0x2a')]=_[_0x26a7('0x2b')](_0x59a183[_0x26a7('0x2a')]);_0x53c6ff[_0x26a7('0x2c')]=_[_0x26a7('0x2d')](_0x53c6ff[_0x26a7('0x29')],_0x53c6ff[_0x26a7('0x2a')]);_0x37ef9a[_0x26a7('0x2f')]=_[_0x26a7('0x2d')](_0x53c6ff[_0x26a7('0x29')],qs[_0x26a7('0x2e')](_0x59a183[_0x26a7('0x2a')][_0x26a7('0x2e')]));_0x37ef9a[_0x26a7('0x2f')]=_0x37ef9a[_0x26a7('0x2f')]['length']?_0x37ef9a['attributes']:_0x53c6ff[_0x26a7('0x29')];if(_0x59a183[_0x26a7('0x2a')]['includeAll']){_0x37ef9a[_0x26a7('0x3d')]=[{'all':!![]}];}_0x37ef9a=_[_0x26a7('0x37')]({},_0x37ef9a,_0x59a183['options']);return db[_0x26a7('0x25')][_0x26a7('0x42')](_0x37ef9a)[_0x26a7('0x20')](handleEntityNotFound(_0x39b66d,null))[_0x26a7('0x20')](respondWithResult(_0x39b66d,null))[_0x26a7('0x3f')](handleError(_0x39b66d,null));};exports['create']=function(_0x6eb48c,_0x569426){return db[_0x26a7('0x25')]['create'](_0x6eb48c[_0x26a7('0x43')],{})['then'](respondWithResult(_0x569426,0xc9))['catch'](handleError(_0x569426,null));};exports[_0x26a7('0x1e')]=function(_0x1b4fc1,_0x1656a6){if(_0x1b4fc1[_0x26a7('0x43')]['id']){delete _0x1b4fc1[_0x26a7('0x43')]['id'];}return db[_0x26a7('0x25')]['find']({'where':{'id':_0x1b4fc1[_0x26a7('0x41')]['id']}})[_0x26a7('0x20')](handleEntityNotFound(_0x1656a6,null))[_0x26a7('0x20')](saveUpdates(_0x1b4fc1[_0x26a7('0x43')],null))[_0x26a7('0x20')](respondWithResult(_0x1656a6,null))[_0x26a7('0x3f')](handleError(_0x1656a6,null));};exports[_0x26a7('0x1f')]=function(_0x3bff63,_0x2ae97b){return db[_0x26a7('0x25')][_0x26a7('0x42')]({'where':{'id':_0x3bff63['params']['id']}})[_0x26a7('0x20')](handleEntityNotFound(_0x2ae97b,null))[_0x26a7('0x20')](removeEntity(_0x2ae97b,null))[_0x26a7('0x3f')](handleError(_0x2ae97b,null));};exports[_0x26a7('0x44')]=function(_0x1dde90,_0x1f3f7c){return db[_0x26a7('0x25')][_0x26a7('0x44')]()['then'](respondWithResult(_0x1f3f7c,null))[_0x26a7('0x3f')](handleError(_0x1f3f7c,null));}; \ No newline at end of file +var _0x55aa=['count','offset','limit','set','apply','reject','save','update','then','destroy','stack','name','send','map','FaxTransferReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','rawAttributes','length','body','find','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x55aa,0x10f));var _0xa55a=function(_0x46bb97,_0xf09383){_0x46bb97=_0x46bb97-0x0;var _0x42ec2e=_0x55aa[_0x46bb97];return _0x42ec2e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa55a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa55a('0x1'));var jsonpatch=require(_0xa55a('0x2'));var rp=require(_0xa55a('0x3'));var moment=require(_0xa55a('0x4'));var BPromise=require(_0xa55a('0x5'));var Mustache=require(_0xa55a('0x6'));var util=require(_0xa55a('0x7'));var path=require(_0xa55a('0x8'));var sox=require(_0xa55a('0x9'));var csv=require('to-csv');var ejs=require(_0xa55a('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xa55a('0xb'));var crypto=require(_0xa55a('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xa55a('0xd'));var toCsv=require(_0xa55a('0xe'));var querystring=require(_0xa55a('0xf'));var Papa=require(_0xa55a('0x10'));var Redis=require(_0xa55a('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xa55a('0x12'));var as=require(_0xa55a('0x13'));var hardwareService=require(_0xa55a('0x14'));var logger=require(_0xa55a('0x15'))(_0xa55a('0x16'));var utils=require(_0xa55a('0x17'));var config=require('../../config/environment');var db=require(_0xa55a('0x18'))['db'];function respondWithStatusCode(_0x3e9c47,_0x56c800){_0x56c800=_0x56c800||0xcc;return function(_0x44bfe4){if(_0x44bfe4){return _0x3e9c47[_0xa55a('0x19')](_0x56c800);}return _0x3e9c47[_0xa55a('0x1a')](_0x56c800)[_0xa55a('0x1b')]();};}function respondWithResult(_0x258e8e,_0x28713e){_0x28713e=_0x28713e||0xc8;return function(_0x369408){if(_0x369408){return _0x258e8e['status'](_0x28713e)[_0xa55a('0x1c')](_0x369408);}};}function respondWithFilteredResult(_0x55ed34,_0x21279a){return function(_0x4fb188){if(_0x4fb188){var _0x4e0cac=_0x4fb188[_0xa55a('0x1d')],_0x163591=_0x21279a['offset'],_0x221696=_0x21279a[_0xa55a('0x1e')]+_0x21279a[_0xa55a('0x1f')],_0x2ad07c;if(_0x221696>=_0x4e0cac){_0x221696=_0x4e0cac;_0x2ad07c=0xc8;}else{_0x2ad07c=0xce;}_0x55ed34[_0xa55a('0x1a')](_0x2ad07c);return _0x55ed34[_0xa55a('0x20')]('Content-Range',_0x163591+'-'+_0x221696+'/'+_0x4e0cac)[_0xa55a('0x1c')](_0x4fb188);}return null;};}function patchUpdates(_0x275f2c){return function(_0x500abf){try{jsonpatch[_0xa55a('0x21')](_0x500abf,_0x275f2c,!![]);}catch(_0x552a33){return BPromise[_0xa55a('0x22')](_0x552a33);}return _0x500abf[_0xa55a('0x23')]();};}function saveUpdates(_0x5b050f,_0x3963e3){return function(_0x1e76ad){if(_0x1e76ad){return _0x1e76ad[_0xa55a('0x24')](_0x5b050f)[_0xa55a('0x25')](function(_0x20858a){return _0x20858a;});}return null;};}function removeEntity(_0x315e08,_0x1c9b53){return function(_0x435504){if(_0x435504){return _0x435504[_0xa55a('0x26')]()[_0xa55a('0x25')](function(){_0x315e08[_0xa55a('0x1a')](0xcc)[_0xa55a('0x1b')]();});}};}function handleEntityNotFound(_0x45d36a,_0x30583e){return function(_0xcd0e4d){if(!_0xcd0e4d){_0x45d36a[_0xa55a('0x19')](0x194);}return _0xcd0e4d;};}function handleError(_0x56259b,_0x384887){_0x384887=_0x384887||0x1f4;return function(_0x5c05ba){logger['error'](_0x5c05ba[_0xa55a('0x27')]);if(_0x5c05ba[_0xa55a('0x28')]){delete _0x5c05ba['name'];}_0x56259b[_0xa55a('0x1a')](_0x384887)[_0xa55a('0x29')](_0x5c05ba);};}exports['index']=function(_0x483f77,_0x5ce34b){var _0x2c63e4={},_0x53cccd={},_0x5238b9={'count':0x0,'rows':[]};var _0x50d861=_[_0xa55a('0x2a')](db[_0xa55a('0x2b')]['rawAttributes'],function(_0x3c8ee6){return{'name':_0x3c8ee6[_0xa55a('0x2c')],'type':_0x3c8ee6[_0xa55a('0x2d')][_0xa55a('0x2e')]};});_0x53cccd[_0xa55a('0x2f')]=_[_0xa55a('0x2a')](_0x50d861,_0xa55a('0x28'));_0x53cccd[_0xa55a('0x30')]=_[_0xa55a('0x31')](_0x483f77['query']);_0x53cccd[_0xa55a('0x32')]=_[_0xa55a('0x33')](_0x53cccd[_0xa55a('0x2f')],_0x53cccd[_0xa55a('0x30')]);_0x2c63e4[_0xa55a('0x34')]=_['intersection'](_0x53cccd['model'],qs[_0xa55a('0x35')](_0x483f77[_0xa55a('0x30')][_0xa55a('0x35')]));_0x2c63e4[_0xa55a('0x34')]=_0x2c63e4[_0xa55a('0x34')]['length']?_0x2c63e4[_0xa55a('0x34')]:_0x53cccd[_0xa55a('0x2f')];if(!_0x483f77[_0xa55a('0x30')][_0xa55a('0x36')](_0xa55a('0x37'))){_0x2c63e4[_0xa55a('0x1f')]=qs[_0xa55a('0x1f')](_0x483f77['query'][_0xa55a('0x1f')]);_0x2c63e4[_0xa55a('0x1e')]=qs[_0xa55a('0x1e')](_0x483f77['query'][_0xa55a('0x1e')]);}_0x2c63e4[_0xa55a('0x38')]=qs[_0xa55a('0x39')](_0x483f77[_0xa55a('0x30')][_0xa55a('0x39')]);_0x2c63e4[_0xa55a('0x3a')]=qs[_0xa55a('0x32')](_[_0xa55a('0x3b')](_0x483f77[_0xa55a('0x30')],_0x53cccd['filters']));if(_0x483f77[_0xa55a('0x30')][_0xa55a('0x3c')]){_0x2c63e4[_0xa55a('0x3a')]=_[_0xa55a('0x3d')](_0x2c63e4['where'],{'$or':_[_0xa55a('0x2a')](_0x50d861,function(_0x3a9541){if(_0x3a9541[_0xa55a('0x2d')]!==_0xa55a('0x3e')){var _0x20a2bd={};_0x20a2bd[_0x3a9541[_0xa55a('0x28')]]={'$like':'%'+_0x483f77[_0xa55a('0x30')][_0xa55a('0x3c')]+'%'};return _0x20a2bd;}})});}_0x2c63e4=_[_0xa55a('0x3d')]({},_0x2c63e4,_0x483f77[_0xa55a('0x3f')]);var _0x3b34e4={'where':_0x2c63e4[_0xa55a('0x3a')]};return db[_0xa55a('0x2b')]['count'](_0x3b34e4)['then'](function(_0x4e102a){_0x5238b9[_0xa55a('0x1d')]=_0x4e102a;if(_0x483f77[_0xa55a('0x30')][_0xa55a('0x40')]){_0x2c63e4[_0xa55a('0x41')]=[{'all':!![]}];}return db[_0xa55a('0x2b')][_0xa55a('0x42')](_0x2c63e4);})[_0xa55a('0x25')](function(_0x235172){_0x5238b9[_0xa55a('0x43')]=_0x235172;return _0x5238b9;})['then'](respondWithFilteredResult(_0x5ce34b,_0x2c63e4))[_0xa55a('0x44')](handleError(_0x5ce34b,null));};exports['show']=function(_0x2dd88a,_0x9101e4){var _0x3138de={'raw':!![],'where':{'id':_0x2dd88a['params']['id']}},_0x632a82={};_0x632a82[_0xa55a('0x2f')]=_[_0xa55a('0x31')](db[_0xa55a('0x2b')][_0xa55a('0x45')]);_0x632a82[_0xa55a('0x30')]=_[_0xa55a('0x31')](_0x2dd88a['query']);_0x632a82[_0xa55a('0x32')]=_[_0xa55a('0x33')](_0x632a82[_0xa55a('0x2f')],_0x632a82[_0xa55a('0x30')]);_0x3138de[_0xa55a('0x34')]=_[_0xa55a('0x33')](_0x632a82[_0xa55a('0x2f')],qs[_0xa55a('0x35')](_0x2dd88a[_0xa55a('0x30')][_0xa55a('0x35')]));_0x3138de[_0xa55a('0x34')]=_0x3138de[_0xa55a('0x34')][_0xa55a('0x46')]?_0x3138de[_0xa55a('0x34')]:_0x632a82[_0xa55a('0x2f')];if(_0x2dd88a['query'][_0xa55a('0x40')]){_0x3138de[_0xa55a('0x41')]=[{'all':!![]}];}_0x3138de=_[_0xa55a('0x3d')]({},_0x3138de,_0x2dd88a[_0xa55a('0x3f')]);return db[_0xa55a('0x2b')]['find'](_0x3138de)['then'](handleEntityNotFound(_0x9101e4,null))[_0xa55a('0x25')](respondWithResult(_0x9101e4,null))[_0xa55a('0x44')](handleError(_0x9101e4,null));};exports['create']=function(_0x318d19,_0x16ee96){return db[_0xa55a('0x2b')]['create'](_0x318d19['body'],{})[_0xa55a('0x25')](respondWithResult(_0x16ee96,0xc9))[_0xa55a('0x44')](handleError(_0x16ee96,null));};exports[_0xa55a('0x24')]=function(_0x386475,_0x3fed34){if(_0x386475[_0xa55a('0x47')]['id']){delete _0x386475[_0xa55a('0x47')]['id'];}return db[_0xa55a('0x2b')][_0xa55a('0x48')]({'where':{'id':_0x386475[_0xa55a('0x49')]['id']}})[_0xa55a('0x25')](handleEntityNotFound(_0x3fed34,null))[_0xa55a('0x25')](saveUpdates(_0x386475['body'],null))[_0xa55a('0x25')](respondWithResult(_0x3fed34,null))[_0xa55a('0x44')](handleError(_0x3fed34,null));};exports['destroy']=function(_0x31d1cb,_0x111c9f){return db[_0xa55a('0x2b')][_0xa55a('0x48')]({'where':{'id':_0x31d1cb['params']['id']}})['then'](handleEntityNotFound(_0x111c9f,null))[_0xa55a('0x25')](removeEntity(_0x111c9f,null))[_0xa55a('0x44')](handleError(_0x111c9f,null));};exports['describe']=function(_0x47c0b5,_0x237ebc){return db[_0xa55a('0x2b')][_0xa55a('0x4a')]()[_0xa55a('0x25')](respondWithResult(_0x237ebc,null))['catch'](handleError(_0x237ebc,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 5603d3a..02e6240 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 _0x74d0=['../../config/environment','./faxTransferReport.attributes','define','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x1d819f,_0x3456c7){var _0x40c01d=function(_0x29ab93){while(--_0x29ab93){_0x1d819f['push'](_0x1d819f['shift']());}};_0x40c01d(++_0x3456c7);}(_0x74d0,0x88));var _0x074d=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x74d0[_0x5b561d];return _0x431060;};'use strict';var _=require(_0x074d('0x0'));var util=require(_0x074d('0x1'));var logger=require(_0x074d('0x2'))(_0x074d('0x3'));var moment=require('moment');var BPromise=require(_0x074d('0x4'));var rp=require(_0x074d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x074d('0x6'));var config=require(_0x074d('0x7'));var attributes=require(_0x074d('0x8'));module['exports']=function(_0x125386,_0x511095){return _0x125386[_0x074d('0x9')]('FaxTransferReport',attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':_0x074d('0xa'),'fields':[_0x074d('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8dcc=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxTransferReport.attributes','exports','define','FaxTransferReport','uniqueid','lodash'];(function(_0x57408b,_0xb7cbc5){var _0x31a897=function(_0x5810ac){while(--_0x5810ac){_0x57408b['push'](_0x57408b['shift']());}};_0x31a897(++_0xb7cbc5);}(_0x8dcc,0x109));var _0xc8dc=function(_0x26434e,_0xd7e437){_0x26434e=_0x26434e-0x0;var _0x17d3a9=_0x8dcc[_0x26434e];return _0x17d3a9;};'use strict';var _=require(_0xc8dc('0x0'));var util=require(_0xc8dc('0x1'));var logger=require(_0xc8dc('0x2'))('api');var moment=require(_0xc8dc('0x3'));var BPromise=require(_0xc8dc('0x4'));var rp=require(_0xc8dc('0x5'));var fs=require('fs');var path=require(_0xc8dc('0x6'));var rimraf=require(_0xc8dc('0x7'));var config=require(_0xc8dc('0x8'));var attributes=require(_0xc8dc('0x9'));module[_0xc8dc('0xa')]=function(_0x1b3369,_0x41590e){return _0x1b3369[_0xc8dc('0xb')](_0xc8dc('0xc'),attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':_0xc8dc('0xd'),'fields':[_0xc8dc('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 41faed7..fc06e5e 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 _0xd321=['request\x20sent','debug','stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','client','http','request','info','FaxTransferReport,\x20%s,\x20%s'];(function(_0x2fbba8,_0x1ec63b){var _0x1165bb=function(_0xcdb853){while(--_0xcdb853){_0x2fbba8['push'](_0x2fbba8['shift']());}};_0x1165bb(++_0x1ec63b);}(_0xd321,0xfe));var _0x1d32=function(_0x35fba8,_0x41eccb){_0x35fba8=_0x35fba8-0x0;var _0x2c18e7=_0xd321[_0x35fba8];return _0x2c18e7;};'use strict';var _=require(_0x1d32('0x0'));var util=require(_0x1d32('0x1'));var moment=require(_0x1d32('0x2'));var BPromise=require('bluebird');var rs=require(_0x1d32('0x3'));var fs=require('fs');var Redis=require(_0x1d32('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1d32('0x5'))(_0x1d32('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1d32('0x7')][_0x1d32('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x525545,_0x52f370,_0x5c18a9){return new BPromise(function(_0x4706d2,_0x3d8e94){return client[_0x1d32('0x9')](_0x525545,_0x5c18a9)['then'](function(_0x4b55c4){logger[_0x1d32('0xa')](_0x1d32('0xb'),_0x52f370,_0x1d32('0xc'));logger[_0x1d32('0xd')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x52f370,'request\x20sent',JSON[_0x1d32('0xe')](_0x4b55c4));if(_0x4b55c4[_0x1d32('0xf')]){if(_0x4b55c4[_0x1d32('0xf')]['code']===0x1f4){logger[_0x1d32('0xf')]('FaxTransferReport,\x20%s,\x20%s',_0x52f370,_0x4b55c4['error'][_0x1d32('0x10')]);return _0x3d8e94(_0x4b55c4[_0x1d32('0xf')]['message']);}logger[_0x1d32('0xf')]('FaxTransferReport,\x20%s,\x20%s',_0x52f370,_0x4b55c4[_0x1d32('0xf')][_0x1d32('0x10')]);return _0x4706d2(_0x4b55c4[_0x1d32('0xf')]['message']);}else{logger[_0x1d32('0xa')](_0x1d32('0xb'),_0x52f370,'request\x20sent');_0x4706d2(_0x4b55c4[_0x1d32('0x11')]['message']);}})[_0x1d32('0x12')](function(_0x31dbcd){logger[_0x1d32('0xf')](_0x1d32('0xb'),_0x52f370,_0x31dbcd);_0x3d8e94(_0x31dbcd);});});} \ No newline at end of file +var _0xdb56=['util','moment','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','FaxTransferReport,\x20%s,\x20%s','message','result','catch'];(function(_0x18c2d7,_0x2bc5f3){var _0x881d17=function(_0x3bf0aa){while(--_0x3bf0aa){_0x18c2d7['push'](_0x18c2d7['shift']());}};_0x881d17(++_0x2bc5f3);}(_0xdb56,0x13b));var _0x6db5=function(_0x44ff66,_0x27f548){_0x44ff66=_0x44ff66-0x0;var _0x136331=_0xdb56[_0x44ff66];return _0x136331;};'use strict';var _=require('lodash');var util=require(_0x6db5('0x0'));var moment=require(_0x6db5('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6db5('0x2'))['db'];var utils=require(_0x6db5('0x3'));var logger=require(_0x6db5('0x4'))('rpc');var config=require(_0x6db5('0x5'));var jayson=require(_0x6db5('0x6'));var client=jayson[_0x6db5('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x426a9f,_0x154f9f,_0xd233e9){return new BPromise(function(_0x518a41,_0xa48691){return client[_0x6db5('0x8')](_0x426a9f,_0xd233e9)[_0x6db5('0x9')](function(_0x309289){logger[_0x6db5('0xa')]('FaxTransferReport,\x20%s,\x20%s',_0x154f9f,'request\x20sent');logger[_0x6db5('0xb')](_0x6db5('0xc'),_0x154f9f,_0x6db5('0xd'),JSON[_0x6db5('0xe')](_0x309289));if(_0x309289['error']){if(_0x309289[_0x6db5('0xf')][_0x6db5('0x10')]===0x1f4){logger[_0x6db5('0xf')](_0x6db5('0x11'),_0x154f9f,_0x309289[_0x6db5('0xf')][_0x6db5('0x12')]);return _0xa48691(_0x309289[_0x6db5('0xf')]['message']);}logger[_0x6db5('0xf')](_0x6db5('0x11'),_0x154f9f,_0x309289['error'][_0x6db5('0x12')]);return _0x518a41(_0x309289[_0x6db5('0xf')][_0x6db5('0x12')]);}else{logger['info'](_0x6db5('0x11'),_0x154f9f,'request\x20sent');_0x518a41(_0x309289[_0x6db5('0x13')][_0x6db5('0x12')]);}})[_0x6db5('0x14')](function(_0x127874){logger[_0x6db5('0xf')](_0x6db5('0x11'),_0x154f9f,_0x127874);_0xa48691(_0x127874);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 7db2fae..64265d0 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 _0xe484=['./faxTransferReport.controller','get','index','/describe','isAuthenticated','/:id','show','post','create','put','update','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x38c652,_0x1ea1b7){var _0x218a37=function(_0x5dcb2a){while(--_0x5dcb2a){_0x38c652['push'](_0x38c652['shift']());}};_0x218a37(++_0x1ea1b7);}(_0xe484,0x1c2));var _0x4e48=function(_0x242491,_0x25ad0d){_0x242491=_0x242491-0x0;var _0x3f5c33=_0xe484[_0x242491];return _0x3f5c33;};'use strict';var multer=require(_0x4e48('0x0'));var util=require(_0x4e48('0x1'));var path=require(_0x4e48('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4e48('0x3')]();var auth=require(_0x4e48('0x4'));var interaction=require(_0x4e48('0x5'));var config=require('../../config/environment');var controller=require(_0x4e48('0x6'));router[_0x4e48('0x7')]('/',auth['isAuthenticated'](),controller[_0x4e48('0x8')]);router[_0x4e48('0x7')](_0x4e48('0x9'),auth[_0x4e48('0xa')](),controller['describe']);router[_0x4e48('0x7')](_0x4e48('0xb'),auth[_0x4e48('0xa')](),controller[_0x4e48('0xc')]);router[_0x4e48('0xd')]('/',auth['isAuthenticated'](),controller[_0x4e48('0xe')]);router[_0x4e48('0xf')](_0x4e48('0xb'),auth[_0x4e48('0xa')](),controller[_0x4e48('0x10')]);router['delete'](_0x4e48('0xb'),auth['isAuthenticated'](),controller[_0x4e48('0x11')]);module[_0x4e48('0x12')]=router; \ No newline at end of file +var _0x6831=['index','/describe','describe','/:id','show','post','create','put','update','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated'];(function(_0x5b8b7f,_0x538e28){var _0x4f9c7e=function(_0x505829){while(--_0x505829){_0x5b8b7f['push'](_0x5b8b7f['shift']());}};_0x4f9c7e(++_0x538e28);}(_0x6831,0xc8));var _0x1683=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x6831[_0x40a045];return _0x1a687c;};'use strict';var multer=require(_0x1683('0x0'));var util=require('util');var path=require(_0x1683('0x1'));var timeout=require('connect-timeout');var express=require(_0x1683('0x2'));var router=express[_0x1683('0x3')]();var auth=require(_0x1683('0x4'));var interaction=require(_0x1683('0x5'));var config=require(_0x1683('0x6'));var controller=require(_0x1683('0x7'));router[_0x1683('0x8')]('/',auth[_0x1683('0x9')](),controller[_0x1683('0xa')]);router[_0x1683('0x8')](_0x1683('0xb'),auth[_0x1683('0x9')](),controller[_0x1683('0xc')]);router['get'](_0x1683('0xd'),auth[_0x1683('0x9')](),controller[_0x1683('0xe')]);router[_0x1683('0xf')]('/',auth[_0x1683('0x9')](),controller[_0x1683('0x10')]);router[_0x1683('0x11')](_0x1683('0xd'),auth[_0x1683('0x9')](),controller[_0x1683('0x12')]);router['delete'](_0x1683('0xd'),auth[_0x1683('0x9')](),controller[_0x1683('0x13')]);module[_0x1683('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 8af8954..deb52fd 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 _0x826a=['getFields','post','create','addConfiguration','put','update','destroy','exports','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields'];(function(_0x577f15,_0x3813f8){var _0x1e8fb8=function(_0x42f461){while(--_0x42f461){_0x577f15['push'](_0x577f15['shift']());}};_0x1e8fb8(++_0x3813f8);}(_0x826a,0x1aa));var _0xa826=function(_0x436901,_0x28598e){_0x436901=_0x436901-0x0;var _0x283ea9=_0x826a[_0x436901];return _0x283ea9;};'use strict';var multer=require('multer');var util=require(_0xa826('0x0'));var path=require('path');var timeout=require(_0xa826('0x1'));var express=require('express');var router=express[_0xa826('0x2')]();var auth=require(_0xa826('0x3'));var interaction=require(_0xa826('0x4'));var config=require(_0xa826('0x5'));var controller=require('./intDeskAccount.controller');router[_0xa826('0x6')]('/',auth[_0xa826('0x7')](),controller[_0xa826('0x8')]);router[_0xa826('0x6')](_0xa826('0x9'),auth[_0xa826('0x7')](),controller[_0xa826('0xa')]);router[_0xa826('0x6')](_0xa826('0xb'),auth[_0xa826('0x7')](),controller[_0xa826('0xc')]);router[_0xa826('0x6')](_0xa826('0xd'),auth[_0xa826('0x7')](),controller[_0xa826('0xe')]);router[_0xa826('0xf')]('/',auth['isAuthenticated'](),controller[_0xa826('0x10')]);router['post'](_0xa826('0xb'),auth[_0xa826('0x7')](),controller[_0xa826('0x11')]);router[_0xa826('0x12')](_0xa826('0x9'),auth[_0xa826('0x7')](),controller[_0xa826('0x13')]);router['delete'](_0xa826('0x9'),auth['isAuthenticated'](),controller[_0xa826('0x14')]);module[_0xa826('0x15')]=router; \ No newline at end of file +var _0x90b5=['/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../config/environment','./intDeskAccount.controller','isAuthenticated','index','get','show','/:id/configurations','getConfigurations','/:id/fields','post','addConfiguration','put'];(function(_0x559c16,_0x29e04e){var _0xa18fa8=function(_0x14a26f){while(--_0x14a26f){_0x559c16['push'](_0x559c16['shift']());}};_0xa18fa8(++_0x29e04e);}(_0x90b5,0x139));var _0x590b=function(_0x357bd7,_0x1c30bb){_0x357bd7=_0x357bd7-0x0;var _0x549a9e=_0x90b5[_0x357bd7];return _0x549a9e;};'use strict';var multer=require(_0x590b('0x0'));var util=require('util');var path=require(_0x590b('0x1'));var timeout=require(_0x590b('0x2'));var express=require(_0x590b('0x3'));var router=express[_0x590b('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x590b('0x5'));var controller=require(_0x590b('0x6'));router['get']('/',auth[_0x590b('0x7')](),controller[_0x590b('0x8')]);router[_0x590b('0x9')]('/:id',auth[_0x590b('0x7')](),controller[_0x590b('0xa')]);router[_0x590b('0x9')](_0x590b('0xb'),auth[_0x590b('0x7')](),controller[_0x590b('0xc')]);router[_0x590b('0x9')](_0x590b('0xd'),auth[_0x590b('0x7')](),controller['getFields']);router[_0x590b('0xe')]('/',auth[_0x590b('0x7')](),controller['create']);router[_0x590b('0xe')]('/:id/configurations',auth[_0x590b('0x7')](),controller[_0x590b('0xf')]);router[_0x590b('0x10')](_0x590b('0x11'),auth['isAuthenticated'](),controller[_0x590b('0x12')]);router[_0x590b('0x13')](_0x590b('0x11'),auth[_0x590b('0x7')](),controller[_0x590b('0x14')]);module[_0x590b('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 6b507e1..c5b04c8 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 _0x5f8e=['basic','ENUM','integrationTab','newTab','sequelize','exports','STRING'];(function(_0x584308,_0x1379b3){var _0x45865b=function(_0x145a82){while(--_0x145a82){_0x584308['push'](_0x584308['shift']());}};_0x45865b(++_0x1379b3);}(_0x5f8e,0x131));var _0xe5f8=function(_0x40f9a0,_0x3458cc){_0x40f9a0=_0x40f9a0-0x0;var _0x3e3144=_0x5f8e[_0x40f9a0];return _0x3e3144;};'use strict';var Sequelize=require(_0xe5f8('0x0'));module[_0xe5f8('0x1')]={'name':{'type':Sequelize[_0xe5f8('0x2')]},'description':{'type':Sequelize[_0xe5f8('0x2')]},'username':{'type':Sequelize[_0xe5f8('0x2')]},'remoteUri':{'type':Sequelize[_0xe5f8('0x2')]},'authType':{'type':Sequelize['ENUM']('basic'),'defaultValue':_0xe5f8('0x3')},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize[_0xe5f8('0x2')]},'consumerSecret':{'type':Sequelize[_0xe5f8('0x2')]},'token':{'type':Sequelize[_0xe5f8('0x2')]},'tokenSecret':{'type':Sequelize[_0xe5f8('0x2')]},'serverUrl':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xe5f8('0x4')](_0xe5f8('0x5'),_0xe5f8('0x6')),'defaultValue':_0xe5f8('0x5')}}; \ No newline at end of file +var _0x0bdd=['exports','STRING','ENUM','basic','integrationTab','sequelize'];(function(_0x37ceb4,_0x57e9a4){var _0x2f1ad8=function(_0x400a11){while(--_0x400a11){_0x37ceb4['push'](_0x37ceb4['shift']());}};_0x2f1ad8(++_0x57e9a4);}(_0x0bdd,0x8f));var _0xd0bd=function(_0x44ad4b,_0x13ccad){_0x44ad4b=_0x44ad4b-0x0;var _0x4c0516=_0x0bdd[_0x44ad4b];return _0x4c0516;};'use strict';var Sequelize=require(_0xd0bd('0x0'));module[_0xd0bd('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xd0bd('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize[_0xd0bd('0x3')](_0xd0bd('0x4')),'defaultValue':'basic'},'password':{'type':Sequelize[_0xd0bd('0x2')]},'consumerKey':{'type':Sequelize[_0xd0bd('0x2')]},'consumerSecret':{'type':Sequelize[_0xd0bd('0x2')]},'token':{'type':Sequelize[_0xd0bd('0x2')]},'tokenSecret':{'type':Sequelize[_0xd0bd('0x2')]},'serverUrl':{'type':Sequelize[_0xd0bd('0x2')]},'type':{'type':Sequelize[_0xd0bd('0x3')](_0xd0bd('0x5'),'newTab'),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index b6445a8..6236729 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 _0x4a70=['moment','bluebird','mustache','util','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','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','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','sendStatus','status','end','count','offset','limit','Content-Range','json','apply','reject','save','update','name','send','index','map','DeskAccount','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','find','create','body','destroy','getConfigurations','findOne','DeskConfiguration','rawAttributes','hasOwnProperty','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','DeskField','getFields','priority','remoteUri','authType','username','consumerKey','consumerSecret','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','headers','Authorization','%s:%s','password','toString','concat','_embedded','label','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','eml-format','rimraf','fast-json-patch'];(function(_0x3eaa42,_0x340128){var _0x2fb1bd=function(_0x1da511){while(--_0x1da511){_0x3eaa42['push'](_0x3eaa42['shift']());}};_0x2fb1bd(++_0x340128);}(_0x4a70,0x77));var _0x04a7=function(_0x1ee0a1,_0x51058e){_0x1ee0a1=_0x1ee0a1-0x0;var _0x1d2d5b=_0x4a70[_0x1ee0a1];return _0x1d2d5b;};'use strict';var pdf=require(_0x04a7('0x0'));var emlformat=require(_0x04a7('0x1'));var rimraf=require(_0x04a7('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x04a7('0x3'));var rp=require('request-promise');var moment=require(_0x04a7('0x4'));var BPromise=require(_0x04a7('0x5'));var Mustache=require(_0x04a7('0x6'));var util=require(_0x04a7('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x04a7('0x8'));var fs=require('fs');var _=require(_0x04a7('0x9'));var squel=require(_0x04a7('0xa'));var crypto=require('crypto');var jsforce=require(_0x04a7('0xb'));var deskjs=require(_0x04a7('0xc'));var toCsv=require(_0x04a7('0xd'));var querystring=require(_0x04a7('0xe'));var Papa=require(_0x04a7('0xf'));var Redis=require('ioredis');var authService=require(_0x04a7('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x04a7('0x11'));var hardwareService=require(_0x04a7('0x12'));var logger=require(_0x04a7('0x13'))(_0x04a7('0x14'));var utils=require(_0x04a7('0x15'));var config=require(_0x04a7('0x16'));var db=require(_0x04a7('0x17'))['db'];var integrations=require(_0x04a7('0x18'));var jayson=require(_0x04a7('0x19'));var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x1c95f1,_0x3296a4,_0x5a3008){if(_0x5a3008){var _0x1e3e5c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1e3e5c[_0x04a7('0x1a')](_0x3296a4)){return _0x1c95f1;}else{throw new db[(_0x04a7('0x1b'))]['ValidationError'](_0x04a7('0x1c'));}}else{return _0x1c95f1;}}function respondWithRpcPromise(_0x2d3648,_0x4c73a7,_0xd6f6e2,_0x51a269){return new BPromise(function(_0x4bbeec,_0x3177a3){var _0x251741=_0x51a269||client;return _0x251741['request'](_0x2d3648,_0xd6f6e2)[_0x04a7('0x1d')](function(_0x416d87){logger['info'](_0x04a7('0x1e'),_0x4c73a7,_0x04a7('0x1f'));logger[_0x04a7('0x20')](_0x04a7('0x21'),_0x4c73a7,_0x04a7('0x1f'),JSON[_0x04a7('0x22')](_0x416d87));if(_0x416d87['error']){if(_0x416d87['error'][_0x04a7('0x23')]===0x1f4){logger[_0x04a7('0x24')]('DeskAccount,\x20%s,\x20%s',_0x4c73a7,_0x416d87[_0x04a7('0x24')]['message']);return _0x3177a3(_0x416d87[_0x04a7('0x24')]['message']);}logger[_0x04a7('0x24')]('DeskAccount,\x20%s,\x20%s',_0x4c73a7,_0x416d87[_0x04a7('0x24')]['message']);return _0x4bbeec(_0x416d87[_0x04a7('0x24')][_0x04a7('0x25')]);}else{logger[_0x04a7('0x26')](_0x04a7('0x1e'),_0x4c73a7,_0x04a7('0x1f'));_0x4bbeec(_0x416d87[_0x04a7('0x27')][_0x04a7('0x25')]);}})[_0x04a7('0x28')](function(_0x1aa91f){logger[_0x04a7('0x24')]('DeskAccount,\x20%s,\x20%s',_0x4c73a7,_0x1aa91f);_0x3177a3(_0x1aa91f);});});}function respondWithStatusCode(_0x2aa71e,_0x574b88){_0x574b88=_0x574b88||0xcc;return function(_0x274bc8){if(_0x274bc8){return _0x2aa71e[_0x04a7('0x29')](_0x574b88);}return _0x2aa71e[_0x04a7('0x2a')](_0x574b88)[_0x04a7('0x2b')]();};}function respondWithResult(_0x2d9e1d,_0x1be6fc){_0x1be6fc=_0x1be6fc||0xc8;return function(_0x183c61){if(_0x183c61){return _0x2d9e1d[_0x04a7('0x2a')](_0x1be6fc)['json'](_0x183c61);}};}function respondWithFilteredResult(_0x1643db,_0x16fd48){return function(_0x40d1c5){if(_0x40d1c5){var _0x2eea0c=_0x40d1c5[_0x04a7('0x2c')],_0x241037=_0x16fd48[_0x04a7('0x2d')],_0x49d12e=_0x16fd48['offset']+_0x16fd48[_0x04a7('0x2e')],_0x564df8;if(_0x49d12e>=_0x2eea0c){_0x49d12e=_0x2eea0c;_0x564df8=0xc8;}else{_0x564df8=0xce;}_0x1643db[_0x04a7('0x2a')](_0x564df8);return _0x1643db['set'](_0x04a7('0x2f'),_0x241037+'-'+_0x49d12e+'/'+_0x2eea0c)[_0x04a7('0x30')](_0x40d1c5);}return null;};}function patchUpdates(_0x4a56c2){return function(_0x3f2f75){try{jsonpatch[_0x04a7('0x31')](_0x3f2f75,_0x4a56c2,!![]);}catch(_0xe2759a){return BPromise[_0x04a7('0x32')](_0xe2759a);}return _0x3f2f75[_0x04a7('0x33')]();};}function saveUpdates(_0x249209,_0xd1cd45){return function(_0xafe970){if(_0xafe970){return _0xafe970[_0x04a7('0x34')](_0x249209)[_0x04a7('0x1d')](function(_0x25adc3){return _0x25adc3;});}return null;};}function removeEntity(_0xb047e,_0x1d0799){return function(_0x3becc8){if(_0x3becc8){return _0x3becc8['destroy']()[_0x04a7('0x1d')](function(){_0xb047e[_0x04a7('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41dbde,_0x5d5c2c){return function(_0x54a8a2){if(!_0x54a8a2){_0x41dbde['sendStatus'](0x194);}return _0x54a8a2;};}function handleError(_0x2be23c,_0x44cf0e){_0x44cf0e=_0x44cf0e||0x1f4;return function(_0x3ad282){logger[_0x04a7('0x24')](_0x3ad282['stack']);if(_0x3ad282[_0x04a7('0x35')]){delete _0x3ad282['name'];}_0x2be23c[_0x04a7('0x2a')](_0x44cf0e)[_0x04a7('0x36')](_0x3ad282);};}exports[_0x04a7('0x37')]=function(_0x1f7e27,_0x117226){var _0x1680a4={},_0x4c0d94={},_0x4d7694={'count':0x0,'rows':[]};var _0xea7fd5=_[_0x04a7('0x38')](db[_0x04a7('0x39')]['rawAttributes'],function(_0x1ec717){return{'name':_0x1ec717[_0x04a7('0x3a')],'type':_0x1ec717[_0x04a7('0x3b')][_0x04a7('0x3c')]};});_0x4c0d94[_0x04a7('0x3d')]=_['map'](_0xea7fd5,_0x04a7('0x35'));_0x4c0d94[_0x04a7('0x3e')]=_[_0x04a7('0x3f')](_0x1f7e27[_0x04a7('0x3e')]);_0x4c0d94[_0x04a7('0x40')]=_['intersection'](_0x4c0d94[_0x04a7('0x3d')],_0x4c0d94[_0x04a7('0x3e')]);_0x1680a4['attributes']=_[_0x04a7('0x41')](_0x4c0d94['model'],qs[_0x04a7('0x42')](_0x1f7e27[_0x04a7('0x3e')][_0x04a7('0x42')]));_0x1680a4[_0x04a7('0x43')]=_0x1680a4['attributes'][_0x04a7('0x44')]?_0x1680a4[_0x04a7('0x43')]:_0x4c0d94[_0x04a7('0x3d')];if(!_0x1f7e27[_0x04a7('0x3e')]['hasOwnProperty'](_0x04a7('0x45'))){_0x1680a4['limit']=qs[_0x04a7('0x2e')](_0x1f7e27['query']['limit']);_0x1680a4[_0x04a7('0x2d')]=qs[_0x04a7('0x2d')](_0x1f7e27['query'][_0x04a7('0x2d')]);}_0x1680a4[_0x04a7('0x46')]=qs['sort'](_0x1f7e27[_0x04a7('0x3e')][_0x04a7('0x47')]);_0x1680a4['where']=qs['filters'](_[_0x04a7('0x48')](_0x1f7e27[_0x04a7('0x3e')],_0x4c0d94['filters']));if(_0x1f7e27[_0x04a7('0x3e')][_0x04a7('0x49')]){_0x1680a4[_0x04a7('0x4a')]=_['merge'](_0x1680a4[_0x04a7('0x4a')],{'$or':_['map'](_0xea7fd5,function(_0x3bdf84){if(_0x3bdf84['type']!==_0x04a7('0x4b')){var _0x555375={};_0x555375[_0x3bdf84[_0x04a7('0x35')]]={'$like':'%'+_0x1f7e27[_0x04a7('0x3e')]['filter']+'%'};return _0x555375;}})});}_0x1680a4=_[_0x04a7('0x4c')]({},_0x1680a4,_0x1f7e27[_0x04a7('0x4d')]);var _0x1988d5={'where':_0x1680a4[_0x04a7('0x4a')]};return db[_0x04a7('0x39')][_0x04a7('0x2c')](_0x1988d5)[_0x04a7('0x1d')](function(_0x183511){_0x4d7694['count']=_0x183511;if(_0x1f7e27[_0x04a7('0x3e')][_0x04a7('0x4e')]){_0x1680a4[_0x04a7('0x4f')]=[{'all':!![]}];}return db[_0x04a7('0x39')][_0x04a7('0x50')](_0x1680a4);})[_0x04a7('0x1d')](function(_0x5bef4a){_0x4d7694[_0x04a7('0x51')]=_0x5bef4a;return _0x4d7694;})[_0x04a7('0x1d')](respondWithFilteredResult(_0x117226,_0x1680a4))['catch'](handleError(_0x117226,null));};exports[_0x04a7('0x52')]=function(_0x959fcd,_0x2302c7){var _0x9d1b52={'raw':![],'where':{'id':_0x959fcd[_0x04a7('0x53')]['id']}},_0x3f1376={};_0x3f1376[_0x04a7('0x3d')]=_['keys'](db[_0x04a7('0x39')]['rawAttributes']);_0x3f1376[_0x04a7('0x3e')]=_[_0x04a7('0x3f')](_0x959fcd[_0x04a7('0x3e')]);_0x3f1376['filters']=_[_0x04a7('0x41')](_0x3f1376[_0x04a7('0x3d')],_0x3f1376['query']);_0x9d1b52[_0x04a7('0x43')]=_[_0x04a7('0x41')](_0x3f1376[_0x04a7('0x3d')],qs[_0x04a7('0x42')](_0x959fcd[_0x04a7('0x3e')][_0x04a7('0x42')]));_0x9d1b52[_0x04a7('0x43')]=_0x9d1b52[_0x04a7('0x43')][_0x04a7('0x44')]?_0x9d1b52[_0x04a7('0x43')]:_0x3f1376[_0x04a7('0x3d')];if(_0x959fcd[_0x04a7('0x3e')][_0x04a7('0x4e')]){_0x9d1b52[_0x04a7('0x4f')]=[{'all':!![]}];}_0x9d1b52=_[_0x04a7('0x4c')]({},_0x9d1b52,_0x959fcd[_0x04a7('0x4d')]);return db[_0x04a7('0x39')][_0x04a7('0x54')](_0x9d1b52)[_0x04a7('0x1d')](handleEntityNotFound(_0x2302c7,null))[_0x04a7('0x1d')](respondWithResult(_0x2302c7,null))['catch'](handleError(_0x2302c7,null));};exports[_0x04a7('0x55')]=function(_0x562448,_0x1c9f97){return db[_0x04a7('0x39')][_0x04a7('0x55')](_0x562448[_0x04a7('0x56')],{})[_0x04a7('0x1d')](respondWithResult(_0x1c9f97,0xc9))[_0x04a7('0x28')](handleError(_0x1c9f97,null));};exports['update']=function(_0x422e9b,_0x4627fa){if(_0x422e9b[_0x04a7('0x56')]['id']){delete _0x422e9b['body']['id'];}return db[_0x04a7('0x39')][_0x04a7('0x54')]({'where':{'id':_0x422e9b[_0x04a7('0x53')]['id']}})[_0x04a7('0x1d')](handleEntityNotFound(_0x4627fa,null))[_0x04a7('0x1d')](saveUpdates(_0x422e9b[_0x04a7('0x56')],null))[_0x04a7('0x1d')](respondWithResult(_0x4627fa,null))[_0x04a7('0x28')](handleError(_0x4627fa,null));};exports[_0x04a7('0x57')]=function(_0x49b59f,_0x274822){return db[_0x04a7('0x39')][_0x04a7('0x54')]({'where':{'id':_0x49b59f[_0x04a7('0x53')]['id']}})[_0x04a7('0x1d')](handleEntityNotFound(_0x274822,null))[_0x04a7('0x1d')](removeEntity(_0x274822,null))[_0x04a7('0x28')](handleError(_0x274822,null));};exports[_0x04a7('0x58')]=function(_0x24cdaa,_0x3d647a,_0x4c8e99){var _0x449102={};var _0x5c0c3c={};var _0x436c97;var _0x1668b1;return db[_0x04a7('0x39')][_0x04a7('0x59')]({'where':{'id':_0x24cdaa[_0x04a7('0x53')]['id']}})[_0x04a7('0x1d')](handleEntityNotFound(_0x3d647a,null))[_0x04a7('0x1d')](function(_0x552061){if(_0x552061){_0x436c97=_0x552061;_0x5c0c3c['model']=_['keys'](db[_0x04a7('0x5a')][_0x04a7('0x5b')]);_0x5c0c3c[_0x04a7('0x3e')]=_[_0x04a7('0x3f')](_0x24cdaa['query']);_0x5c0c3c[_0x04a7('0x40')]=_[_0x04a7('0x41')](_0x5c0c3c[_0x04a7('0x3d')],_0x5c0c3c[_0x04a7('0x3e')]);_0x449102['attributes']=_[_0x04a7('0x41')](_0x5c0c3c['model'],qs['fields'](_0x24cdaa[_0x04a7('0x3e')][_0x04a7('0x42')]));_0x449102['attributes']=_0x449102['attributes']['length']?_0x449102[_0x04a7('0x43')]:_0x5c0c3c[_0x04a7('0x3d')];_0x449102[_0x04a7('0x46')]=qs['sort'](_0x24cdaa[_0x04a7('0x3e')][_0x04a7('0x47')]);_0x449102[_0x04a7('0x4a')]=qs['filters'](_['pick'](_0x24cdaa[_0x04a7('0x3e')],_0x5c0c3c[_0x04a7('0x40')]));if(_0x24cdaa[_0x04a7('0x3e')]['filter']){_0x449102[_0x04a7('0x4a')]=_[_0x04a7('0x4c')](_0x449102[_0x04a7('0x4a')],{'$or':_['map'](_0x449102[_0x04a7('0x43')],function(_0x17b0ca){var _0x40f915={};_0x40f915[_0x17b0ca]={'$like':'%'+_0x24cdaa[_0x04a7('0x3e')][_0x04a7('0x49')]+'%'};return _0x40f915;})});}_0x449102=_[_0x04a7('0x4c')]({},_0x449102,_0x24cdaa[_0x04a7('0x4d')]);return _0x436c97[_0x04a7('0x58')](_0x449102);}})['then'](function(_0x5968be){if(_0x5968be){_0x1668b1=_0x5968be[_0x04a7('0x44')];if(!_0x24cdaa[_0x04a7('0x3e')][_0x04a7('0x5c')](_0x04a7('0x45'))){_0x449102[_0x04a7('0x2e')]=qs[_0x04a7('0x2e')](_0x24cdaa[_0x04a7('0x3e')][_0x04a7('0x2e')]);_0x449102[_0x04a7('0x2d')]=qs[_0x04a7('0x2d')](_0x24cdaa[_0x04a7('0x3e')]['offset']);}return _0x436c97['getConfigurations'](_0x449102);}})['then'](function(_0x47a26f){if(_0x47a26f){return _0x47a26f?{'count':_0x1668b1,'rows':_0x47a26f}:null;}})[_0x04a7('0x1d')](respondWithResult(_0x3d647a,null))[_0x04a7('0x28')](handleError(_0x3d647a,null));};exports[_0x04a7('0x5d')]=function(_0x1043e6,_0x2cf2ad,_0x1f2b2c){if(_0x1043e6[_0x04a7('0x56')]['id']){delete _0x1043e6[_0x04a7('0x56')]['id'];}return db['DeskAccount']['findOne']({'where':{'id':_0x1043e6['params']['id']}})[_0x04a7('0x1d')](handleEntityNotFound(_0x2cf2ad,null))[_0x04a7('0x1d')](function(_0x58a1a9){if(_0x58a1a9){_0x1043e6['body']['AccountId']=_0x58a1a9['id'];_0x1043e6['body'][_0x04a7('0x5e')]=integrations[_0x04a7('0x5f')](_0x1043e6[_0x04a7('0x56')][_0x04a7('0x60')],_0x1043e6[_0x04a7('0x56')][_0x04a7('0x3b')]);_0x1043e6[_0x04a7('0x56')][_0x04a7('0x61')]=integrations[_0x04a7('0x62')](_0x1043e6[_0x04a7('0x56')][_0x04a7('0x60')],_0x1043e6[_0x04a7('0x56')]['type']);return db[_0x04a7('0x5a')][_0x04a7('0x55')](_0x1043e6[_0x04a7('0x56')],{'include':[{'model':db[_0x04a7('0x63')],'as':_0x04a7('0x5e')},{'model':db[_0x04a7('0x63')],'as':_0x04a7('0x61')}]});}return null;})[_0x04a7('0x1d')](respondWithResult(_0x2cf2ad,null))[_0x04a7('0x28')](handleError(_0x2cf2ad,null));};exports[_0x04a7('0x64')]=function(_0x22e7e5,_0xac53ec,_0xc7fe8b){var _0x399882=[{'name':'priority','label':_0x04a7('0x65'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0xce36be='';return db['DeskAccount'][_0x04a7('0x59')]({'where':{'id':_0x22e7e5[_0x04a7('0x53')]['id']},'attributes':['id',_0x04a7('0x66'),_0x04a7('0x67'),_0x04a7('0x68'),'password',_0x04a7('0x69'),_0x04a7('0x6a'),'token','tokenSecret']})[_0x04a7('0x1d')](handleEntityNotFound(_0xac53ec,null))['then'](function(_0x1328b9){if(_0x1328b9){_0xce36be=_0x1328b9[_0x04a7('0x66')];var _0x283e1a=_0xce36be['slice'](-0x1);if(_0x283e1a==='/'){_0xce36be=_0xce36be['substring'](0x0,_0xce36be[_0x04a7('0x6b')](_0x283e1a));}var _0x3258a4={'method':_0x04a7('0x6c'),'uri':util[_0x04a7('0x6d')](_0x04a7('0x6e'),_0xce36be),'headers':{'Content-Type':_0x04a7('0x6f'),'Accept':_0x04a7('0x6f')},'json':!![]};if(_0x1328b9[_0x04a7('0x67')]===_0x04a7('0x70')){_0x3258a4[_0x04a7('0x71')][_0x04a7('0x72')]=util['format']('Basic\x20%s',new Buffer(util[_0x04a7('0x6d')](_0x04a7('0x73'),_0x1328b9[_0x04a7('0x68')],_0x1328b9[_0x04a7('0x74')]))[_0x04a7('0x75')]('base64'));}return rp(_0x3258a4)[_0x04a7('0x1d')](function(_0xdb54ea){return _0x399882[_0x04a7('0x76')](_[_0x04a7('0x38')](_0xdb54ea[_0x04a7('0x77')]['entries'],function(_0x864a17){return{'id':_0x864a17[_0x04a7('0x35')],'name':_0x864a17['name'],'type':_0x864a17[_0x04a7('0x3b')],'active':_0x864a17['active'],'label':_0x864a17[_0x04a7('0x78')],'custom':!![]};}));});}})[_0x04a7('0x1d')](function(_0x230467){return{'count':_0x230467[_0x04a7('0x44')],'rows':_0x230467};})[_0x04a7('0x1d')](respondWithResult(_0xac53ec,null))['catch'](function(_0x4c7eba){var _0xba922=_0x22e7e5[_0x04a7('0x3e')][_0x04a7('0x1a')]?0x1f4:_0x4c7eba['statusCode']||0x1f4;logger[_0x04a7('0x24')](_0x04a7('0x79'),_0x04a7('0x64'),_0xba922,JSON['stringify'](_0x4c7eba));delete _0x4c7eba[_0x04a7('0x35')];if(_0xba922===0x191){_0xba922=0x190;}_0xac53ec['status'](_0xba922)['send'](_0x22e7e5['query']['test']?{'message':_0x04a7('0x7a'),'statusCode':_0x4c7eba['statusCode']}:_0x4c7eba);});}; \ No newline at end of file +var _0x5ba0=['lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','../../components/integrations/configuration','client','http','test','Sequelize','ValidationError','request','request\x20sent','DeskAccount,\x20%s,\x20%s,\x20%s','code','error','DeskAccount,\x20%s,\x20%s','message','info','result','catch','status','count','offset','set','Content-Range','json','apply','reject','save','update','then','end','sendStatus','stack','name','send','index','map','DeskAccount','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','show','params','rawAttributes','find','create','body','destroy','getConfigurations','findOne','DeskConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','DeskField','getFields','priority','remoteUri','authType','username','password','consumerKey','consumerSecret','token','GET','format','%s/custom_fields','application/json','basic','headers','Authorization','Basic\x20%s','%s:%s','toString','base64','_embedded','entries','active','label','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0x5ba0,0x16e));var _0x05ba=function(_0x32cd15,_0x3a2370){_0x32cd15=_0x32cd15-0x0;var _0x280576=_0x5ba0[_0x32cd15];return _0x280576;};'use strict';var pdf=require(_0x05ba('0x0'));var emlformat=require(_0x05ba('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x05ba('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x05ba('0x3'));var moment=require(_0x05ba('0x4'));var BPromise=require(_0x05ba('0x5'));var Mustache=require(_0x05ba('0x6'));var util=require(_0x05ba('0x7'));var path=require(_0x05ba('0x8'));var sox=require(_0x05ba('0x9'));var csv=require(_0x05ba('0xa'));var ejs=require(_0x05ba('0xb'));var fs=require('fs');var _=require(_0x05ba('0xc'));var squel=require(_0x05ba('0xd'));var crypto=require('crypto');var jsforce=require(_0x05ba('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x05ba('0xf'));var Papa=require('papaparse');var Redis=require(_0x05ba('0x10'));var authService=require(_0x05ba('0x11'));var qs=require(_0x05ba('0x12'));var as=require(_0x05ba('0x13'));var hardwareService=require(_0x05ba('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x05ba('0x15'))['db'];var integrations=require(_0x05ba('0x16'));var jayson=require('jayson/promise');var client=jayson[_0x05ba('0x17')][_0x05ba('0x18')]({'port':0x232a});function checkPasswordPattern(_0x320f06,_0x1e30dd,_0x530c1a){if(_0x530c1a){var _0x31c4b5=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x31c4b5[_0x05ba('0x19')](_0x1e30dd)){return _0x320f06;}else{throw new db[(_0x05ba('0x1a'))][(_0x05ba('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 _0x320f06;}}function respondWithRpcPromise(_0x515c31,_0x38cb6f,_0x5b7ba0,_0x5bacce){return new BPromise(function(_0x7db4b7,_0x14551b){var _0x4dbf07=_0x5bacce||client;return _0x4dbf07[_0x05ba('0x1c')](_0x515c31,_0x5b7ba0)['then'](function(_0x1b0d09){logger['info']('DeskAccount,\x20%s,\x20%s',_0x38cb6f,_0x05ba('0x1d'));logger['debug'](_0x05ba('0x1e'),_0x38cb6f,_0x05ba('0x1d'),JSON['stringify'](_0x1b0d09));if(_0x1b0d09['error']){if(_0x1b0d09['error'][_0x05ba('0x1f')]===0x1f4){logger[_0x05ba('0x20')](_0x05ba('0x21'),_0x38cb6f,_0x1b0d09[_0x05ba('0x20')][_0x05ba('0x22')]);return _0x14551b(_0x1b0d09[_0x05ba('0x20')][_0x05ba('0x22')]);}logger['error']('DeskAccount,\x20%s,\x20%s',_0x38cb6f,_0x1b0d09[_0x05ba('0x20')]['message']);return _0x7db4b7(_0x1b0d09['error']['message']);}else{logger[_0x05ba('0x23')](_0x05ba('0x21'),_0x38cb6f,_0x05ba('0x1d'));_0x7db4b7(_0x1b0d09[_0x05ba('0x24')][_0x05ba('0x22')]);}})[_0x05ba('0x25')](function(_0x31c18c){logger['error'](_0x05ba('0x21'),_0x38cb6f,_0x31c18c);_0x14551b(_0x31c18c);});});}function respondWithStatusCode(_0x58c750,_0x5e2650){_0x5e2650=_0x5e2650||0xcc;return function(_0x2528a8){if(_0x2528a8){return _0x58c750['sendStatus'](_0x5e2650);}return _0x58c750['status'](_0x5e2650)['end']();};}function respondWithResult(_0xaeae84,_0x1b32b3){_0x1b32b3=_0x1b32b3||0xc8;return function(_0x7c3381){if(_0x7c3381){return _0xaeae84[_0x05ba('0x26')](_0x1b32b3)['json'](_0x7c3381);}};}function respondWithFilteredResult(_0x544f03,_0xda24cc){return function(_0x4eaa03){if(_0x4eaa03){var _0x59744d=_0x4eaa03[_0x05ba('0x27')],_0x48cf72=_0xda24cc[_0x05ba('0x28')],_0x1fa68f=_0xda24cc[_0x05ba('0x28')]+_0xda24cc['limit'],_0x29bc39;if(_0x1fa68f>=_0x59744d){_0x1fa68f=_0x59744d;_0x29bc39=0xc8;}else{_0x29bc39=0xce;}_0x544f03['status'](_0x29bc39);return _0x544f03[_0x05ba('0x29')](_0x05ba('0x2a'),_0x48cf72+'-'+_0x1fa68f+'/'+_0x59744d)[_0x05ba('0x2b')](_0x4eaa03);}return null;};}function patchUpdates(_0x10c578){return function(_0x2a6219){try{jsonpatch[_0x05ba('0x2c')](_0x2a6219,_0x10c578,!![]);}catch(_0x335547){return BPromise[_0x05ba('0x2d')](_0x335547);}return _0x2a6219[_0x05ba('0x2e')]();};}function saveUpdates(_0x5e1587,_0x457a84){return function(_0x4def7e){if(_0x4def7e){return _0x4def7e[_0x05ba('0x2f')](_0x5e1587)[_0x05ba('0x30')](function(_0x3604ae){return _0x3604ae;});}return null;};}function removeEntity(_0x17d860,_0x4e117f){return function(_0x454c8f){if(_0x454c8f){return _0x454c8f['destroy']()[_0x05ba('0x30')](function(){_0x17d860[_0x05ba('0x26')](0xcc)[_0x05ba('0x31')]();});}};}function handleEntityNotFound(_0x2b5f0a,_0x85af0d){return function(_0x39e6a8){if(!_0x39e6a8){_0x2b5f0a[_0x05ba('0x32')](0x194);}return _0x39e6a8;};}function handleError(_0x2ad25a,_0x578812){_0x578812=_0x578812||0x1f4;return function(_0x12510c){logger[_0x05ba('0x20')](_0x12510c[_0x05ba('0x33')]);if(_0x12510c[_0x05ba('0x34')]){delete _0x12510c[_0x05ba('0x34')];}_0x2ad25a[_0x05ba('0x26')](_0x578812)[_0x05ba('0x35')](_0x12510c);};}exports[_0x05ba('0x36')]=function(_0x4e58e6,_0x426d97){var _0x15a90c={},_0x5b075a={},_0x6018af={'count':0x0,'rows':[]};var _0x167d4d=_[_0x05ba('0x37')](db[_0x05ba('0x38')]['rawAttributes'],function(_0x7b1781){return{'name':_0x7b1781['fieldName'],'type':_0x7b1781['type'][_0x05ba('0x39')]};});_0x5b075a[_0x05ba('0x3a')]=_['map'](_0x167d4d,_0x05ba('0x34'));_0x5b075a['query']=_[_0x05ba('0x3b')](_0x4e58e6[_0x05ba('0x3c')]);_0x5b075a[_0x05ba('0x3d')]=_[_0x05ba('0x3e')](_0x5b075a[_0x05ba('0x3a')],_0x5b075a[_0x05ba('0x3c')]);_0x15a90c['attributes']=_[_0x05ba('0x3e')](_0x5b075a[_0x05ba('0x3a')],qs[_0x05ba('0x3f')](_0x4e58e6[_0x05ba('0x3c')][_0x05ba('0x3f')]));_0x15a90c[_0x05ba('0x40')]=_0x15a90c[_0x05ba('0x40')][_0x05ba('0x41')]?_0x15a90c['attributes']:_0x5b075a[_0x05ba('0x3a')];if(!_0x4e58e6[_0x05ba('0x3c')][_0x05ba('0x42')](_0x05ba('0x43'))){_0x15a90c[_0x05ba('0x44')]=qs[_0x05ba('0x44')](_0x4e58e6['query'][_0x05ba('0x44')]);_0x15a90c[_0x05ba('0x28')]=qs[_0x05ba('0x28')](_0x4e58e6['query'][_0x05ba('0x28')]);}_0x15a90c[_0x05ba('0x45')]=qs[_0x05ba('0x46')](_0x4e58e6[_0x05ba('0x3c')][_0x05ba('0x46')]);_0x15a90c['where']=qs[_0x05ba('0x3d')](_[_0x05ba('0x47')](_0x4e58e6['query'],_0x5b075a['filters']));if(_0x4e58e6[_0x05ba('0x3c')][_0x05ba('0x48')]){_0x15a90c[_0x05ba('0x49')]=_[_0x05ba('0x4a')](_0x15a90c['where'],{'$or':_[_0x05ba('0x37')](_0x167d4d,function(_0x155268){if(_0x155268[_0x05ba('0x4b')]!==_0x05ba('0x4c')){var _0x4ba5fc={};_0x4ba5fc[_0x155268[_0x05ba('0x34')]]={'$like':'%'+_0x4e58e6['query'][_0x05ba('0x48')]+'%'};return _0x4ba5fc;}})});}_0x15a90c=_[_0x05ba('0x4a')]({},_0x15a90c,_0x4e58e6[_0x05ba('0x4d')]);var _0xb91a53={'where':_0x15a90c[_0x05ba('0x49')]};return db[_0x05ba('0x38')][_0x05ba('0x27')](_0xb91a53)['then'](function(_0xecd45c){_0x6018af[_0x05ba('0x27')]=_0xecd45c;if(_0x4e58e6['query'][_0x05ba('0x4e')]){_0x15a90c[_0x05ba('0x4f')]=[{'all':!![]}];}return db[_0x05ba('0x38')]['findAll'](_0x15a90c);})[_0x05ba('0x30')](function(_0x299d6b){_0x6018af['rows']=_0x299d6b;return _0x6018af;})['then'](respondWithFilteredResult(_0x426d97,_0x15a90c))[_0x05ba('0x25')](handleError(_0x426d97,null));};exports[_0x05ba('0x50')]=function(_0x3efdb4,_0x568778){var _0x1d76a5={'raw':![],'where':{'id':_0x3efdb4[_0x05ba('0x51')]['id']}},_0x550f91={};_0x550f91[_0x05ba('0x3a')]=_[_0x05ba('0x3b')](db[_0x05ba('0x38')][_0x05ba('0x52')]);_0x550f91[_0x05ba('0x3c')]=_[_0x05ba('0x3b')](_0x3efdb4[_0x05ba('0x3c')]);_0x550f91[_0x05ba('0x3d')]=_[_0x05ba('0x3e')](_0x550f91[_0x05ba('0x3a')],_0x550f91[_0x05ba('0x3c')]);_0x1d76a5[_0x05ba('0x40')]=_[_0x05ba('0x3e')](_0x550f91[_0x05ba('0x3a')],qs['fields'](_0x3efdb4['query'][_0x05ba('0x3f')]));_0x1d76a5[_0x05ba('0x40')]=_0x1d76a5[_0x05ba('0x40')][_0x05ba('0x41')]?_0x1d76a5[_0x05ba('0x40')]:_0x550f91['model'];if(_0x3efdb4['query'][_0x05ba('0x4e')]){_0x1d76a5[_0x05ba('0x4f')]=[{'all':!![]}];}_0x1d76a5=_[_0x05ba('0x4a')]({},_0x1d76a5,_0x3efdb4[_0x05ba('0x4d')]);return db[_0x05ba('0x38')][_0x05ba('0x53')](_0x1d76a5)[_0x05ba('0x30')](handleEntityNotFound(_0x568778,null))[_0x05ba('0x30')](respondWithResult(_0x568778,null))[_0x05ba('0x25')](handleError(_0x568778,null));};exports[_0x05ba('0x54')]=function(_0x1c98c8,_0x12662f){return db[_0x05ba('0x38')][_0x05ba('0x54')](_0x1c98c8[_0x05ba('0x55')],{})['then'](respondWithResult(_0x12662f,0xc9))['catch'](handleError(_0x12662f,null));};exports[_0x05ba('0x2f')]=function(_0x177a97,_0x446b3d){if(_0x177a97[_0x05ba('0x55')]['id']){delete _0x177a97['body']['id'];}return db[_0x05ba('0x38')][_0x05ba('0x53')]({'where':{'id':_0x177a97['params']['id']}})['then'](handleEntityNotFound(_0x446b3d,null))[_0x05ba('0x30')](saveUpdates(_0x177a97[_0x05ba('0x55')],null))[_0x05ba('0x30')](respondWithResult(_0x446b3d,null))[_0x05ba('0x25')](handleError(_0x446b3d,null));};exports[_0x05ba('0x56')]=function(_0x1d0a1b,_0x33dc69){return db[_0x05ba('0x38')]['find']({'where':{'id':_0x1d0a1b['params']['id']}})['then'](handleEntityNotFound(_0x33dc69,null))[_0x05ba('0x30')](removeEntity(_0x33dc69,null))['catch'](handleError(_0x33dc69,null));};exports[_0x05ba('0x57')]=function(_0x2fcce9,_0x2e709f,_0x10bcba){var _0x3b3819={};var _0x9bdb1d={};var _0x5eb152;var _0x51d20c;return db[_0x05ba('0x38')][_0x05ba('0x58')]({'where':{'id':_0x2fcce9['params']['id']}})[_0x05ba('0x30')](handleEntityNotFound(_0x2e709f,null))[_0x05ba('0x30')](function(_0x33bd94){if(_0x33bd94){_0x5eb152=_0x33bd94;_0x9bdb1d[_0x05ba('0x3a')]=_[_0x05ba('0x3b')](db[_0x05ba('0x59')][_0x05ba('0x52')]);_0x9bdb1d[_0x05ba('0x3c')]=_['keys'](_0x2fcce9[_0x05ba('0x3c')]);_0x9bdb1d[_0x05ba('0x3d')]=_[_0x05ba('0x3e')](_0x9bdb1d[_0x05ba('0x3a')],_0x9bdb1d[_0x05ba('0x3c')]);_0x3b3819[_0x05ba('0x40')]=_[_0x05ba('0x3e')](_0x9bdb1d[_0x05ba('0x3a')],qs[_0x05ba('0x3f')](_0x2fcce9[_0x05ba('0x3c')][_0x05ba('0x3f')]));_0x3b3819[_0x05ba('0x40')]=_0x3b3819[_0x05ba('0x40')]['length']?_0x3b3819['attributes']:_0x9bdb1d[_0x05ba('0x3a')];_0x3b3819[_0x05ba('0x45')]=qs[_0x05ba('0x46')](_0x2fcce9[_0x05ba('0x3c')]['sort']);_0x3b3819[_0x05ba('0x49')]=qs[_0x05ba('0x3d')](_[_0x05ba('0x47')](_0x2fcce9[_0x05ba('0x3c')],_0x9bdb1d[_0x05ba('0x3d')]));if(_0x2fcce9[_0x05ba('0x3c')][_0x05ba('0x48')]){_0x3b3819['where']=_['merge'](_0x3b3819[_0x05ba('0x49')],{'$or':_[_0x05ba('0x37')](_0x3b3819[_0x05ba('0x40')],function(_0x4211f9){var _0x4b39f8={};_0x4b39f8[_0x4211f9]={'$like':'%'+_0x2fcce9[_0x05ba('0x3c')][_0x05ba('0x48')]+'%'};return _0x4b39f8;})});}_0x3b3819=_[_0x05ba('0x4a')]({},_0x3b3819,_0x2fcce9[_0x05ba('0x4d')]);return _0x5eb152['getConfigurations'](_0x3b3819);}})[_0x05ba('0x30')](function(_0x11a8dc){if(_0x11a8dc){_0x51d20c=_0x11a8dc['length'];if(!_0x2fcce9['query'][_0x05ba('0x42')](_0x05ba('0x43'))){_0x3b3819[_0x05ba('0x44')]=qs[_0x05ba('0x44')](_0x2fcce9[_0x05ba('0x3c')]['limit']);_0x3b3819[_0x05ba('0x28')]=qs[_0x05ba('0x28')](_0x2fcce9[_0x05ba('0x3c')][_0x05ba('0x28')]);}return _0x5eb152[_0x05ba('0x57')](_0x3b3819);}})['then'](function(_0x558c33){if(_0x558c33){return _0x558c33?{'count':_0x51d20c,'rows':_0x558c33}:null;}})['then'](respondWithResult(_0x2e709f,null))[_0x05ba('0x25')](handleError(_0x2e709f,null));};exports[_0x05ba('0x5a')]=function(_0x87d12b,_0x419496,_0x22ae7c){if(_0x87d12b['body']['id']){delete _0x87d12b[_0x05ba('0x55')]['id'];}return db[_0x05ba('0x38')][_0x05ba('0x58')]({'where':{'id':_0x87d12b[_0x05ba('0x51')]['id']}})[_0x05ba('0x30')](handleEntityNotFound(_0x419496,null))[_0x05ba('0x30')](function(_0x33744f){if(_0x33744f){_0x87d12b[_0x05ba('0x55')][_0x05ba('0x5b')]=_0x33744f['id'];_0x87d12b[_0x05ba('0x55')][_0x05ba('0x5c')]=integrations[_0x05ba('0x5d')](_0x87d12b[_0x05ba('0x55')][_0x05ba('0x5e')],_0x87d12b[_0x05ba('0x55')][_0x05ba('0x4b')]);_0x87d12b['body'][_0x05ba('0x5f')]=integrations[_0x05ba('0x60')](_0x87d12b[_0x05ba('0x55')][_0x05ba('0x5e')],_0x87d12b[_0x05ba('0x55')][_0x05ba('0x4b')]);return db[_0x05ba('0x59')][_0x05ba('0x54')](_0x87d12b['body'],{'include':[{'model':db[_0x05ba('0x61')],'as':_0x05ba('0x5c')},{'model':db[_0x05ba('0x61')],'as':_0x05ba('0x5f')}]});}return null;})[_0x05ba('0x30')](respondWithResult(_0x419496,null))[_0x05ba('0x25')](handleError(_0x419496,null));};exports[_0x05ba('0x62')]=function(_0x12406b,_0x5e7ed3,_0x241a3c){var _0x4c3be5=[{'name':_0x05ba('0x63'),'label':_0x05ba('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 _0x5a304b='';return db[_0x05ba('0x38')][_0x05ba('0x58')]({'where':{'id':_0x12406b[_0x05ba('0x51')]['id']},'attributes':['id',_0x05ba('0x64'),_0x05ba('0x65'),_0x05ba('0x66'),_0x05ba('0x67'),_0x05ba('0x68'),_0x05ba('0x69'),_0x05ba('0x6a'),'tokenSecret']})[_0x05ba('0x30')](handleEntityNotFound(_0x5e7ed3,null))[_0x05ba('0x30')](function(_0xaf5cd3){if(_0xaf5cd3){_0x5a304b=_0xaf5cd3[_0x05ba('0x64')];var _0x5605a7=_0x5a304b['slice'](-0x1);if(_0x5605a7==='/'){_0x5a304b=_0x5a304b['substring'](0x0,_0x5a304b['lastIndexOf'](_0x5605a7));}var _0x3dee63={'method':_0x05ba('0x6b'),'uri':util[_0x05ba('0x6c')](_0x05ba('0x6d'),_0x5a304b),'headers':{'Content-Type':_0x05ba('0x6e'),'Accept':_0x05ba('0x6e')},'json':!![]};if(_0xaf5cd3[_0x05ba('0x65')]===_0x05ba('0x6f')){_0x3dee63[_0x05ba('0x70')][_0x05ba('0x71')]=util[_0x05ba('0x6c')](_0x05ba('0x72'),new Buffer(util[_0x05ba('0x6c')](_0x05ba('0x73'),_0xaf5cd3[_0x05ba('0x66')],_0xaf5cd3[_0x05ba('0x67')]))[_0x05ba('0x74')](_0x05ba('0x75')));}return rp(_0x3dee63)['then'](function(_0x2cb78e){return _0x4c3be5['concat'](_['map'](_0x2cb78e[_0x05ba('0x76')][_0x05ba('0x77')],function(_0x32b54b){return{'id':_0x32b54b[_0x05ba('0x34')],'name':_0x32b54b['name'],'type':_0x32b54b[_0x05ba('0x4b')],'active':_0x32b54b[_0x05ba('0x78')],'label':_0x32b54b[_0x05ba('0x79')],'custom':!![]};}));});}})[_0x05ba('0x30')](function(_0x24b938){return{'count':_0x24b938['length'],'rows':_0x24b938};})[_0x05ba('0x30')](respondWithResult(_0x5e7ed3,null))['catch'](function(_0x5f2cd1){var _0x5c494d=_0x12406b['query'][_0x05ba('0x19')]?0x1f4:_0x5f2cd1[_0x05ba('0x7a')]||0x1f4;logger[_0x05ba('0x20')](_0x05ba('0x7b'),_0x05ba('0x62'),_0x5c494d,JSON[_0x05ba('0x7c')](_0x5f2cd1));delete _0x5f2cd1[_0x05ba('0x34')];if(_0x5c494d===0x191){_0x5c494d=0x190;}_0x5e7ed3[_0x05ba('0x26')](_0x5c494d)['send'](_0x12406b[_0x05ba('0x3c')][_0x05ba('0x19')]?{'message':_0x05ba('0x7d'),'statusCode':_0x5f2cd1[_0x05ba('0x7a')]}:_0x5f2cd1);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index daab655..eec6dd8 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 _0x3730=['exports','DeskAccount','int_desk_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./intDeskAccount.attributes'];(function(_0x518e55,_0x162a8c){var _0x21995b=function(_0x4b7db1){while(--_0x4b7db1){_0x518e55['push'](_0x518e55['shift']());}};_0x21995b(++_0x162a8c);}(_0x3730,0x87));var _0x0373=function(_0x3a8ae5,_0x32687a){_0x3a8ae5=_0x3a8ae5-0x0;var _0x550f6d=_0x3730[_0x3a8ae5];return _0x550f6d;};'use strict';var _=require(_0x0373('0x0'));var util=require(_0x0373('0x1'));var logger=require(_0x0373('0x2'))(_0x0373('0x3'));var moment=require(_0x0373('0x4'));var BPromise=require(_0x0373('0x5'));var rp=require(_0x0373('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0373('0x7'));var integrations=require('../../components/integrations/configuration');module[_0x0373('0x8')]=function(_0x4c7f42,_0x2d10d9){return _0x4c7f42['define'](_0x0373('0x9'),attributes,{'tableName':_0x0373('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd5d2=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','DeskAccount','int_desk_accounts','util','../../config/logger'];(function(_0x3bcfb0,_0xffe700){var _0x5c47ab=function(_0x2cf5c2){while(--_0x2cf5c2){_0x3bcfb0['push'](_0x3bcfb0['shift']());}};_0x5c47ab(++_0xffe700);}(_0xd5d2,0x15d));var _0x2d5d=function(_0x4aaf2f,_0x6c7973){_0x4aaf2f=_0x4aaf2f-0x0;var _0x482286=_0xd5d2[_0x4aaf2f];return _0x482286;};'use strict';var _=require('lodash');var util=require(_0x2d5d('0x0'));var logger=require(_0x2d5d('0x1'))(_0x2d5d('0x2'));var moment=require(_0x2d5d('0x3'));var BPromise=require(_0x2d5d('0x4'));var rp=require(_0x2d5d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2d5d('0x6'));var config=require(_0x2d5d('0x7'));var attributes=require(_0x2d5d('0x8'));var integrations=require(_0x2d5d('0x9'));module[_0x2d5d('0xa')]=function(_0x24c126,_0x2b447e){return _0x24c126['define'](_0x2d5d('0xb'),attributes,{'tableName':_0x2d5d('0xc'),'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 50c35da..90a0480 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 _0x34d9=['jayson/promise','client','http','request','then','info','request\x20sent','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','DeskAccount,\x20%s,\x20%s','GetDeskAccount','DeskAccount','findAll','options','raw','attributes','limit','map','include','model','debug','ShowDeskAccount','find','where','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x1d393d,_0x5eb1c6){var _0x32a3d0=function(_0x275205){while(--_0x275205){_0x1d393d['push'](_0x1d393d['shift']());}};_0x32a3d0(++_0x5eb1c6);}(_0x34d9,0x1f0));var _0x934d=function(_0x4dc837,_0x4d859a){_0x4dc837=_0x4dc837-0x0;var _0x27bd83=_0x34d9[_0x4dc837];return _0x27bd83;};'use strict';var _=require(_0x934d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x934d('0x1'));var rs=require(_0x934d('0x2'));var fs=require('fs');var Redis=require(_0x934d('0x3'));var db=require(_0x934d('0x4'))['db'];var utils=require(_0x934d('0x5'));var logger=require('../../config/logger')(_0x934d('0x6'));var config=require(_0x934d('0x7'));var jayson=require(_0x934d('0x8'));var client=jayson[_0x934d('0x9')][_0x934d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x21b4d0,_0x282d30,_0x111afc){return new BPromise(function(_0x95fe04,_0x51f122){return client[_0x934d('0xb')](_0x21b4d0,_0x111afc)[_0x934d('0xc')](function(_0x41b02f){logger[_0x934d('0xd')]('DeskAccount,\x20%s,\x20%s',_0x282d30,_0x934d('0xe'));logger['debug'](_0x934d('0xf'),_0x282d30,_0x934d('0xe'),JSON[_0x934d('0x10')](_0x41b02f));if(_0x41b02f[_0x934d('0x11')]){if(_0x41b02f[_0x934d('0x11')]['code']===0x1f4){logger['error']('DeskAccount,\x20%s,\x20%s',_0x282d30,_0x41b02f[_0x934d('0x11')][_0x934d('0x12')]);return _0x51f122(_0x41b02f[_0x934d('0x11')][_0x934d('0x12')]);}logger['error']('DeskAccount,\x20%s,\x20%s',_0x282d30,_0x41b02f[_0x934d('0x11')][_0x934d('0x12')]);return _0x95fe04(_0x41b02f[_0x934d('0x11')][_0x934d('0x12')]);}else{logger[_0x934d('0xd')]('DeskAccount,\x20%s,\x20%s',_0x282d30,_0x934d('0xe'));_0x95fe04(_0x41b02f[_0x934d('0x13')][_0x934d('0x12')]);}})[_0x934d('0x14')](function(_0x489b22){logger['error'](_0x934d('0x15'),_0x282d30,_0x489b22);_0x51f122(_0x489b22);});});}exports[_0x934d('0x16')]=function(_0x1fb8c2){var _0x5ebe3a=this;return new Promise(function(_0x57ba17,_0x58815f){return db[_0x934d('0x17')][_0x934d('0x18')]({'raw':_0x1fb8c2['options']?_0x1fb8c2[_0x934d('0x19')][_0x934d('0x1a')]===undefined?!![]:![]:!![],'where':_0x1fb8c2[_0x934d('0x19')]?_0x1fb8c2[_0x934d('0x19')]['where']||null:null,'attributes':_0x1fb8c2['options']?_0x1fb8c2[_0x934d('0x19')][_0x934d('0x1b')]||null:null,'limit':_0x1fb8c2['options']?_0x1fb8c2[_0x934d('0x19')][_0x934d('0x1c')]||null:null,'include':_0x1fb8c2['options']?_0x1fb8c2['options']['include']?_[_0x934d('0x1d')](_0x1fb8c2[_0x934d('0x19')][_0x934d('0x1e')],function(_0x1f8628){return{'model':db[_0x1f8628[_0x934d('0x1f')]],'as':_0x1f8628['as'],'attributes':_0x1f8628[_0x934d('0x1b')],'include':_0x1f8628[_0x934d('0x1e')]?_[_0x934d('0x1d')](_0x1f8628['include'],function(_0x3cc435){return{'model':db[_0x3cc435[_0x934d('0x1f')]],'as':_0x3cc435['as'],'attributes':_0x3cc435[_0x934d('0x1b')],'include':_0x3cc435[_0x934d('0x1e')]?_[_0x934d('0x1d')](_0x3cc435[_0x934d('0x1e')],function(_0x5bf7ba){return{'model':db[_0x5bf7ba[_0x934d('0x1f')]],'as':_0x5bf7ba['as'],'attributes':_0x5bf7ba[_0x934d('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x934d('0xc')](function(_0x297206){logger[_0x934d('0xd')](_0x934d('0x16'),_0x1fb8c2);logger[_0x934d('0x20')](_0x934d('0x16'),_0x1fb8c2,JSON['stringify'](_0x297206));_0x57ba17(_0x297206);})[_0x934d('0x14')](function(_0x23d814){logger['error'](_0x934d('0x16'),_0x23d814[_0x934d('0x12')],_0x1fb8c2);_0x58815f(_0x5ebe3a[_0x934d('0x11')](0x1f4,_0x23d814[_0x934d('0x12')]));});});};exports[_0x934d('0x21')]=function(_0x3ed2bb){var _0x5433a7=this;return new Promise(function(_0x1fccef,_0x40c9a1){return db[_0x934d('0x17')][_0x934d('0x22')]({'raw':_0x3ed2bb[_0x934d('0x19')]?_0x3ed2bb['options']['raw']===undefined?!![]:![]:!![],'where':_0x3ed2bb[_0x934d('0x19')]?_0x3ed2bb[_0x934d('0x19')][_0x934d('0x23')]||null:null,'attributes':_0x3ed2bb[_0x934d('0x19')]?_0x3ed2bb[_0x934d('0x19')][_0x934d('0x1b')]||null:null,'include':_0x3ed2bb[_0x934d('0x19')]?_0x3ed2bb['options']['include']?_[_0x934d('0x1d')](_0x3ed2bb['options'][_0x934d('0x1e')],function(_0x47d26b){return{'model':db[_0x47d26b[_0x934d('0x1f')]],'as':_0x47d26b['as'],'attributes':_0x47d26b[_0x934d('0x1b')],'include':_0x47d26b['include']?_[_0x934d('0x1d')](_0x47d26b[_0x934d('0x1e')],function(_0x46ff27){return{'model':db[_0x46ff27[_0x934d('0x1f')]],'as':_0x46ff27['as'],'attributes':_0x46ff27[_0x934d('0x1b')],'include':_0x46ff27[_0x934d('0x1e')]?_[_0x934d('0x1d')](_0x46ff27['include'],function(_0x13322d){return{'model':db[_0x13322d[_0x934d('0x1f')]],'as':_0x13322d['as'],'attributes':_0x13322d[_0x934d('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x934d('0xc')](function(_0x1b41d5){logger[_0x934d('0xd')](_0x934d('0x21'),_0x3ed2bb);logger[_0x934d('0x20')](_0x934d('0x21'),_0x3ed2bb,JSON['stringify'](_0x1b41d5));_0x1fccef(_0x1b41d5);})[_0x934d('0x14')](function(_0x163361){logger[_0x934d('0x11')](_0x934d('0x21'),_0x163361[_0x934d('0x12')],_0x3ed2bb);_0x40c9a1(_0x5433a7[_0x934d('0x11')](0x1f4,_0x163361[_0x934d('0x12')]));});});}; \ No newline at end of file +var _0xc4b7=['randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','DeskAccount,\x20%s,\x20%s','request\x20sent','DeskAccount,\x20%s,\x20%s,\x20%s','code','error','message','info','result','catch','GetDeskAccount','DeskAccount','options','raw','where','attributes','limit','include','map','model','then','debug','stringify','find','ShowDeskAccount','lodash','moment'];(function(_0x2a3373,_0x56df99){var _0x3bd188=function(_0x1dd8d9){while(--_0x1dd8d9){_0x2a3373['push'](_0x2a3373['shift']());}};_0x3bd188(++_0x56df99);}(_0xc4b7,0x10e));var _0x7c4b=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0xc4b7[_0x49b207];return _0x2dc8fa;};'use strict';var _=require(_0x7c4b('0x0'));var util=require('util');var moment=require(_0x7c4b('0x1'));var BPromise=require('bluebird');var rs=require(_0x7c4b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7c4b('0x3'));var logger=require(_0x7c4b('0x4'))('rpc');var config=require(_0x7c4b('0x5'));var jayson=require(_0x7c4b('0x6'));var client=jayson[_0x7c4b('0x7')][_0x7c4b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2379ac,_0xcc5ac9,_0x43eff7){return new BPromise(function(_0x455e51,_0x196037){return client[_0x7c4b('0x9')](_0x2379ac,_0x43eff7)['then'](function(_0x30adbc){logger['info'](_0x7c4b('0xa'),_0xcc5ac9,_0x7c4b('0xb'));logger['debug'](_0x7c4b('0xc'),_0xcc5ac9,'request\x20sent',JSON['stringify'](_0x30adbc));if(_0x30adbc['error']){if(_0x30adbc['error'][_0x7c4b('0xd')]===0x1f4){logger[_0x7c4b('0xe')](_0x7c4b('0xa'),_0xcc5ac9,_0x30adbc[_0x7c4b('0xe')][_0x7c4b('0xf')]);return _0x196037(_0x30adbc[_0x7c4b('0xe')][_0x7c4b('0xf')]);}logger[_0x7c4b('0xe')](_0x7c4b('0xa'),_0xcc5ac9,_0x30adbc['error'][_0x7c4b('0xf')]);return _0x455e51(_0x30adbc[_0x7c4b('0xe')][_0x7c4b('0xf')]);}else{logger[_0x7c4b('0x10')]('DeskAccount,\x20%s,\x20%s',_0xcc5ac9,'request\x20sent');_0x455e51(_0x30adbc[_0x7c4b('0x11')][_0x7c4b('0xf')]);}})[_0x7c4b('0x12')](function(_0x1946ec){logger[_0x7c4b('0xe')](_0x7c4b('0xa'),_0xcc5ac9,_0x1946ec);_0x196037(_0x1946ec);});});}exports[_0x7c4b('0x13')]=function(_0x19d5a5){var _0x4a8650=this;return new Promise(function(_0x58b0cd,_0x3a1e9b){return db[_0x7c4b('0x14')]['findAll']({'raw':_0x19d5a5[_0x7c4b('0x15')]?_0x19d5a5[_0x7c4b('0x15')][_0x7c4b('0x16')]===undefined?!![]:![]:!![],'where':_0x19d5a5[_0x7c4b('0x15')]?_0x19d5a5[_0x7c4b('0x15')][_0x7c4b('0x17')]||null:null,'attributes':_0x19d5a5[_0x7c4b('0x15')]?_0x19d5a5[_0x7c4b('0x15')][_0x7c4b('0x18')]||null:null,'limit':_0x19d5a5[_0x7c4b('0x15')]?_0x19d5a5[_0x7c4b('0x15')][_0x7c4b('0x19')]||null:null,'include':_0x19d5a5[_0x7c4b('0x15')]?_0x19d5a5[_0x7c4b('0x15')][_0x7c4b('0x1a')]?_[_0x7c4b('0x1b')](_0x19d5a5[_0x7c4b('0x15')]['include'],function(_0x889405){return{'model':db[_0x889405[_0x7c4b('0x1c')]],'as':_0x889405['as'],'attributes':_0x889405[_0x7c4b('0x18')],'include':_0x889405[_0x7c4b('0x1a')]?_[_0x7c4b('0x1b')](_0x889405[_0x7c4b('0x1a')],function(_0x3e6c19){return{'model':db[_0x3e6c19['model']],'as':_0x3e6c19['as'],'attributes':_0x3e6c19[_0x7c4b('0x18')],'include':_0x3e6c19[_0x7c4b('0x1a')]?_[_0x7c4b('0x1b')](_0x3e6c19[_0x7c4b('0x1a')],function(_0x477c10){return{'model':db[_0x477c10['model']],'as':_0x477c10['as'],'attributes':_0x477c10[_0x7c4b('0x18')]};}):[]};}):[]};}):[]:[]})[_0x7c4b('0x1d')](function(_0x5965a8){logger[_0x7c4b('0x10')]('GetDeskAccount',_0x19d5a5);logger[_0x7c4b('0x1e')](_0x7c4b('0x13'),_0x19d5a5,JSON[_0x7c4b('0x1f')](_0x5965a8));_0x58b0cd(_0x5965a8);})[_0x7c4b('0x12')](function(_0x4e4722){logger[_0x7c4b('0xe')](_0x7c4b('0x13'),_0x4e4722[_0x7c4b('0xf')],_0x19d5a5);_0x3a1e9b(_0x4a8650[_0x7c4b('0xe')](0x1f4,_0x4e4722[_0x7c4b('0xf')]));});});};exports['ShowDeskAccount']=function(_0x385605){var _0x4c4530=this;return new Promise(function(_0x3a1802,_0x30d4cc){return db[_0x7c4b('0x14')][_0x7c4b('0x20')]({'raw':_0x385605[_0x7c4b('0x15')]?_0x385605[_0x7c4b('0x15')][_0x7c4b('0x16')]===undefined?!![]:![]:!![],'where':_0x385605[_0x7c4b('0x15')]?_0x385605['options']['where']||null:null,'attributes':_0x385605['options']?_0x385605[_0x7c4b('0x15')][_0x7c4b('0x18')]||null:null,'include':_0x385605[_0x7c4b('0x15')]?_0x385605['options']['include']?_[_0x7c4b('0x1b')](_0x385605[_0x7c4b('0x15')][_0x7c4b('0x1a')],function(_0x3c76ca){return{'model':db[_0x3c76ca[_0x7c4b('0x1c')]],'as':_0x3c76ca['as'],'attributes':_0x3c76ca[_0x7c4b('0x18')],'include':_0x3c76ca[_0x7c4b('0x1a')]?_[_0x7c4b('0x1b')](_0x3c76ca[_0x7c4b('0x1a')],function(_0x7bf4c0){return{'model':db[_0x7bf4c0[_0x7c4b('0x1c')]],'as':_0x7bf4c0['as'],'attributes':_0x7bf4c0[_0x7c4b('0x18')],'include':_0x7bf4c0[_0x7c4b('0x1a')]?_[_0x7c4b('0x1b')](_0x7bf4c0[_0x7c4b('0x1a')],function(_0x2c603c){return{'model':db[_0x2c603c['model']],'as':_0x2c603c['as'],'attributes':_0x2c603c['attributes']};}):[]};}):[]};}):[]:[]})[_0x7c4b('0x1d')](function(_0x237691){logger[_0x7c4b('0x10')]('ShowDeskAccount',_0x385605);logger['debug'](_0x7c4b('0x21'),_0x385605,JSON[_0x7c4b('0x1f')](_0x237691));_0x3a1802(_0x237691);})[_0x7c4b('0x12')](function(_0x1bcf27){logger['error']('ShowDeskAccount',_0x1bcf27[_0x7c4b('0xf')],_0x385605);_0x30d4cc(_0x4c4530[_0x7c4b('0xe')](0x1f4,_0x1bcf27[_0x7c4b('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 10a5aeb..c204e60 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 _0x23bb=['getDescriptions','getTags','post','create','/:id/tags','setTags','put','/:id','update','delete','destroy','multer','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','/:id/subjects','getSubjects'];(function(_0x20752e,_0x25627c){var _0x36f5f4=function(_0xcf6596){while(--_0xcf6596){_0x20752e['push'](_0x20752e['shift']());}};_0x36f5f4(++_0x25627c);}(_0x23bb,0x79));var _0xb23b=function(_0x57252a,_0x1ceae9){_0x57252a=_0x57252a-0x0;var _0x2733a8=_0x23bb[_0x57252a];return _0x2733a8;};'use strict';var multer=require(_0xb23b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xb23b('0x1'));var express=require(_0xb23b('0x2'));var router=express[_0xb23b('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xb23b('0x4'));var config=require(_0xb23b('0x5'));var controller=require(_0xb23b('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xb23b('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xb23b('0x7')]('/:id/fields',auth[_0xb23b('0x8')](),controller['getFields']);router[_0xb23b('0x7')](_0xb23b('0x9'),auth['isAuthenticated'](),controller[_0xb23b('0xa')]);router[_0xb23b('0x7')]('/:id/descriptions',auth[_0xb23b('0x8')](),controller[_0xb23b('0xb')]);router[_0xb23b('0x7')]('/:id/tags',auth[_0xb23b('0x8')](),controller[_0xb23b('0xc')]);router[_0xb23b('0xd')]('/',auth[_0xb23b('0x8')](),controller[_0xb23b('0xe')]);router[_0xb23b('0xd')](_0xb23b('0xf'),auth[_0xb23b('0x8')](),controller[_0xb23b('0x10')]);router[_0xb23b('0x11')](_0xb23b('0x12'),auth[_0xb23b('0x8')](),controller[_0xb23b('0x13')]);router[_0xb23b('0x14')](_0xb23b('0x12'),auth[_0xb23b('0x8')](),controller[_0xb23b('0x15')]);module['exports']=router; \ No newline at end of file +var _0xca84=['../../components/interaction/service','../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','create','update','delete','destroy','exports','multer','util','path','express','Router'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xca84,0xf5));var _0x4ca8=function(_0x1f0d64,_0x510940){_0x1f0d64=_0x1f0d64-0x0;var _0x4f2761=_0xca84[_0x1f0d64];return _0x4f2761;};'use strict';var multer=require(_0x4ca8('0x0'));var util=require(_0x4ca8('0x1'));var path=require(_0x4ca8('0x2'));var timeout=require('connect-timeout');var express=require(_0x4ca8('0x3'));var router=express[_0x4ca8('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x4ca8('0x5'));var config=require(_0x4ca8('0x6'));var controller=require(_0x4ca8('0x7'));router[_0x4ca8('0x8')]('/',auth[_0x4ca8('0x9')](),controller[_0x4ca8('0xa')]);router[_0x4ca8('0x8')](_0x4ca8('0xb'),auth[_0x4ca8('0x9')](),controller[_0x4ca8('0xc')]);router['get'](_0x4ca8('0xd'),auth['isAuthenticated'](),controller[_0x4ca8('0xe')]);router['get'](_0x4ca8('0xf'),auth['isAuthenticated'](),controller[_0x4ca8('0x10')]);router[_0x4ca8('0x8')](_0x4ca8('0x11'),auth[_0x4ca8('0x9')](),controller[_0x4ca8('0x12')]);router[_0x4ca8('0x8')](_0x4ca8('0x13'),auth['isAuthenticated'](),controller['getTags']);router['post']('/',auth['isAuthenticated'](),controller[_0x4ca8('0x14')]);router['post'](_0x4ca8('0x13'),auth[_0x4ca8('0x9')](),controller['setTags']);router['put'](_0x4ca8('0xb'),auth[_0x4ca8('0x9')](),controller[_0x4ca8('0x15')]);router[_0x4ca8('0x16')](_0x4ca8('0xb'),auth[_0x4ca8('0x9')](),controller[_0x4ca8('0x17')]);module[_0x4ca8('0x18')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 1d4249b..26fc703 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 _0xdb18=['STRING'];(function(_0x18dce0,_0x12947d){var _0x214321=function(_0x2e2086){while(--_0x2e2086){_0x18dce0['push'](_0x18dce0['shift']());}};_0x214321(++_0x12947d);}(_0xdb18,0x1a0));var _0x8db1=function(_0x9698a8,_0x369203){_0x9698a8=_0x9698a8-0x0;var _0x22902a=_0xdb18[_0x9698a8];return _0x22902a;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x8db1('0x0')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x5a2e=['sequelize','STRING'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x5a2e,0x1e0));var _0xe5a2=function(_0x4e438d,_0x5ed6fc){_0x4e438d=_0x4e438d-0x0;var _0x130201=_0x5a2e[_0x4e438d];return _0x130201;};'use strict';var Sequelize=require(_0xe5a2('0x0'));module['exports']={'name':{'type':Sequelize[_0xe5a2('0x1')]},'description':{'type':Sequelize[_0xe5a2('0x1')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 95ebc85..9ff42eb 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 _0x7979=['eml-format','zip-dir','fast-json-patch','moment','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../mysqldb','jayson/promise','http','Sequelize','ValidationError','DeskConfiguration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','sendStatus','end','status','json','offset','limit','set','Content-Range','reject','save','update','destroy','stack','name','send','index','DeskConfiguration','rawAttributes','fieldName','type','key','map','query','filters','intersection','model','attributes','fields','length','order','sort','where','pick','filter','merge','count','then','includeAll','include','findAll','show','keys','create','body','params','find','getFields','DeskField','options','getSubjects','findOne','hasOwnProperty','getDescriptions','nolimit','getTags','Tag','setTags','ids','html-pdf'];(function(_0x125436,_0x17384b){var _0x12bcfe=function(_0x594a22){while(--_0x594a22){_0x125436['push'](_0x125436['shift']());}};_0x12bcfe(++_0x17384b);}(_0x7979,0xb9));var _0x9797=function(_0xf88549,_0x29b6ca){_0xf88549=_0xf88549-0x0;var _0x2e64d2=_0x7979[_0xf88549];return _0x2e64d2;};'use strict';var pdf=require(_0x9797('0x0'));var emlformat=require(_0x9797('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x9797('0x2'));var jsonpatch=require(_0x9797('0x3'));var rp=require('request-promise');var moment=require(_0x9797('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9797('0x5'));var path=require(_0x9797('0x6'));var sox=require(_0x9797('0x7'));var csv=require('to-csv');var ejs=require(_0x9797('0x8'));var fs=require('fs');var _=require(_0x9797('0x9'));var squel=require(_0x9797('0xa'));var crypto=require('crypto');var jsforce=require(_0x9797('0xb'));var deskjs=require(_0x9797('0xc'));var toCsv=require(_0x9797('0xd'));var querystring=require(_0x9797('0xe'));var Papa=require(_0x9797('0xf'));var Redis=require('ioredis');var authService=require(_0x9797('0x10'));var qs=require(_0x9797('0x11'));var as=require(_0x9797('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x9797('0x13'));var config=require('../../config/environment');var db=require(_0x9797('0x14'))['db'];var jayson=require(_0x9797('0x15'));var client=jayson['client'][_0x9797('0x16')]({'port':0x232a});function checkPasswordPattern(_0x29bcce,_0x424cb4,_0x2060a2){if(_0x2060a2){var _0x57bd54=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x57bd54['test'](_0x424cb4)){return _0x29bcce;}else{throw new db[(_0x9797('0x17'))][(_0x9797('0x18'))]('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 _0x29bcce;}}function respondWithRpcPromise(_0x20e49e,_0x47d2b5,_0x1571cb,_0x29d6a6){return new BPromise(function(_0x1d9907,_0x40643a){var _0x2a3f13=_0x29d6a6||client;return _0x2a3f13['request'](_0x20e49e,_0x1571cb)['then'](function(_0x4f3121){logger['info'](_0x9797('0x19'),_0x47d2b5,'request\x20sent');logger[_0x9797('0x1a')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x47d2b5,_0x9797('0x1b'),JSON[_0x9797('0x1c')](_0x4f3121));if(_0x4f3121[_0x9797('0x1d')]){if(_0x4f3121[_0x9797('0x1d')][_0x9797('0x1e')]===0x1f4){logger[_0x9797('0x1d')](_0x9797('0x19'),_0x47d2b5,_0x4f3121['error'][_0x9797('0x1f')]);return _0x40643a(_0x4f3121[_0x9797('0x1d')][_0x9797('0x1f')]);}logger['error'](_0x9797('0x19'),_0x47d2b5,_0x4f3121['error'][_0x9797('0x1f')]);return _0x1d9907(_0x4f3121['error'][_0x9797('0x1f')]);}else{logger[_0x9797('0x20')](_0x9797('0x19'),_0x47d2b5,_0x9797('0x1b'));_0x1d9907(_0x4f3121[_0x9797('0x21')][_0x9797('0x1f')]);}})[_0x9797('0x22')](function(_0x76bc0d){logger['error'](_0x9797('0x19'),_0x47d2b5,_0x76bc0d);_0x40643a(_0x76bc0d);});});}function respondWithStatusCode(_0x1519c3,_0x2d39dd){_0x2d39dd=_0x2d39dd||0xcc;return function(_0x2939e2){if(_0x2939e2){return _0x1519c3[_0x9797('0x23')](_0x2d39dd);}return _0x1519c3['status'](_0x2d39dd)[_0x9797('0x24')]();};}function respondWithResult(_0x2d4834,_0xb013c6){_0xb013c6=_0xb013c6||0xc8;return function(_0x39fa9a){if(_0x39fa9a){return _0x2d4834[_0x9797('0x25')](_0xb013c6)[_0x9797('0x26')](_0x39fa9a);}};}function respondWithFilteredResult(_0x39ba56,_0x1e3963){return function(_0x11be6e){if(_0x11be6e){var _0x26a233=_0x11be6e['count'],_0x3e4353=_0x1e3963['offset'],_0x477ab6=_0x1e3963[_0x9797('0x27')]+_0x1e3963[_0x9797('0x28')],_0x3df191;if(_0x477ab6>=_0x26a233){_0x477ab6=_0x26a233;_0x3df191=0xc8;}else{_0x3df191=0xce;}_0x39ba56[_0x9797('0x25')](_0x3df191);return _0x39ba56[_0x9797('0x29')](_0x9797('0x2a'),_0x3e4353+'-'+_0x477ab6+'/'+_0x26a233)[_0x9797('0x26')](_0x11be6e);}return null;};}function patchUpdates(_0xba37c3){return function(_0x3cf4b3){try{jsonpatch['apply'](_0x3cf4b3,_0xba37c3,!![]);}catch(_0x27102c){return BPromise[_0x9797('0x2b')](_0x27102c);}return _0x3cf4b3[_0x9797('0x2c')]();};}function saveUpdates(_0x4e4e6d,_0x39071b){return function(_0x842f02){if(_0x842f02){return _0x842f02[_0x9797('0x2d')](_0x4e4e6d)['then'](function(_0xb45daa){return _0xb45daa;});}return null;};}function removeEntity(_0x117bac,_0x2521bb){return function(_0x3fb4f1){if(_0x3fb4f1){return _0x3fb4f1[_0x9797('0x2e')]()['then'](function(){_0x117bac['status'](0xcc)[_0x9797('0x24')]();});}};}function handleEntityNotFound(_0xed8735,_0x63032f){return function(_0x48bd91){if(!_0x48bd91){_0xed8735[_0x9797('0x23')](0x194);}return _0x48bd91;};}function handleError(_0x3d8034,_0x3c7319){_0x3c7319=_0x3c7319||0x1f4;return function(_0x3decab){logger[_0x9797('0x1d')](_0x3decab[_0x9797('0x2f')]);if(_0x3decab['name']){delete _0x3decab[_0x9797('0x30')];}_0x3d8034[_0x9797('0x25')](_0x3c7319)[_0x9797('0x31')](_0x3decab);};}exports[_0x9797('0x32')]=function(_0x1493df,_0x4eeb92){var _0x1a480e={},_0x37ad30={},_0x240e8d={'count':0x0,'rows':[]};var _0x3eb6a2=_['map'](db[_0x9797('0x33')][_0x9797('0x34')],function(_0x1236e9){return{'name':_0x1236e9[_0x9797('0x35')],'type':_0x1236e9[_0x9797('0x36')][_0x9797('0x37')]};});_0x37ad30['model']=_[_0x9797('0x38')](_0x3eb6a2,_0x9797('0x30'));_0x37ad30[_0x9797('0x39')]=_['keys'](_0x1493df[_0x9797('0x39')]);_0x37ad30[_0x9797('0x3a')]=_[_0x9797('0x3b')](_0x37ad30[_0x9797('0x3c')],_0x37ad30['query']);_0x1a480e[_0x9797('0x3d')]=_[_0x9797('0x3b')](_0x37ad30[_0x9797('0x3c')],qs[_0x9797('0x3e')](_0x1493df['query'][_0x9797('0x3e')]));_0x1a480e['attributes']=_0x1a480e[_0x9797('0x3d')][_0x9797('0x3f')]?_0x1a480e[_0x9797('0x3d')]:_0x37ad30['model'];if(!_0x1493df[_0x9797('0x39')]['hasOwnProperty']('nolimit')){_0x1a480e[_0x9797('0x28')]=qs[_0x9797('0x28')](_0x1493df[_0x9797('0x39')][_0x9797('0x28')]);_0x1a480e[_0x9797('0x27')]=qs['offset'](_0x1493df['query']['offset']);}_0x1a480e[_0x9797('0x40')]=qs[_0x9797('0x41')](_0x1493df[_0x9797('0x39')][_0x9797('0x41')]);_0x1a480e[_0x9797('0x42')]=qs['filters'](_[_0x9797('0x43')](_0x1493df['query'],_0x37ad30[_0x9797('0x3a')]));if(_0x1493df[_0x9797('0x39')][_0x9797('0x44')]){_0x1a480e[_0x9797('0x42')]=_[_0x9797('0x45')](_0x1a480e[_0x9797('0x42')],{'$or':_[_0x9797('0x38')](_0x3eb6a2,function(_0x29572c){if(_0x29572c[_0x9797('0x36')]!=='VIRTUAL'){var _0x1f094a={};_0x1f094a[_0x29572c[_0x9797('0x30')]]={'$like':'%'+_0x1493df[_0x9797('0x39')][_0x9797('0x44')]+'%'};return _0x1f094a;}})});}_0x1a480e=_['merge']({},_0x1a480e,_0x1493df['options']);var _0x1c481d={'where':_0x1a480e[_0x9797('0x42')]};return db[_0x9797('0x33')][_0x9797('0x46')](_0x1c481d)[_0x9797('0x47')](function(_0x461846){_0x240e8d[_0x9797('0x46')]=_0x461846;if(_0x1493df['query'][_0x9797('0x48')]){_0x1a480e[_0x9797('0x49')]=[{'all':!![]}];}return db['DeskConfiguration'][_0x9797('0x4a')](_0x1a480e);})[_0x9797('0x47')](function(_0x19df3f){_0x240e8d['rows']=_0x19df3f;return _0x240e8d;})[_0x9797('0x47')](respondWithFilteredResult(_0x4eeb92,_0x1a480e))[_0x9797('0x22')](handleError(_0x4eeb92,null));};exports[_0x9797('0x4b')]=function(_0x96d723,_0x4dd3b8){var _0x58b7c5={'raw':![],'where':{'id':_0x96d723['params']['id']}},_0x229c7a={};_0x229c7a[_0x9797('0x3c')]=_[_0x9797('0x4c')](db[_0x9797('0x33')][_0x9797('0x34')]);_0x229c7a[_0x9797('0x39')]=_[_0x9797('0x4c')](_0x96d723['query']);_0x229c7a[_0x9797('0x3a')]=_[_0x9797('0x3b')](_0x229c7a['model'],_0x229c7a[_0x9797('0x39')]);_0x58b7c5[_0x9797('0x3d')]=_[_0x9797('0x3b')](_0x229c7a[_0x9797('0x3c')],qs[_0x9797('0x3e')](_0x96d723[_0x9797('0x39')][_0x9797('0x3e')]));_0x58b7c5[_0x9797('0x3d')]=_0x58b7c5[_0x9797('0x3d')][_0x9797('0x3f')]?_0x58b7c5['attributes']:_0x229c7a[_0x9797('0x3c')];if(_0x96d723['query'][_0x9797('0x48')]){_0x58b7c5[_0x9797('0x49')]=[{'all':!![]}];}_0x58b7c5=_['merge']({},_0x58b7c5,_0x96d723['options']);return db[_0x9797('0x33')]['find'](_0x58b7c5)['then'](handleEntityNotFound(_0x4dd3b8,null))[_0x9797('0x47')](respondWithResult(_0x4dd3b8,null))['catch'](handleError(_0x4dd3b8,null));};exports['create']=function(_0x842936,_0x36ad6a){return db[_0x9797('0x33')][_0x9797('0x4d')](_0x842936[_0x9797('0x4e')],{})[_0x9797('0x47')](respondWithResult(_0x36ad6a,0xc9))[_0x9797('0x22')](handleError(_0x36ad6a,null));};exports[_0x9797('0x2d')]=function(_0x50d23a,_0x51037a){if(_0x50d23a[_0x9797('0x4e')]['id']){delete _0x50d23a[_0x9797('0x4e')]['id'];}return db['DeskConfiguration']['find']({'where':{'id':_0x50d23a[_0x9797('0x4f')]['id']}})[_0x9797('0x47')](handleEntityNotFound(_0x51037a,null))[_0x9797('0x47')](saveUpdates(_0x50d23a[_0x9797('0x4e')],null))[_0x9797('0x47')](respondWithResult(_0x51037a,null))['catch'](handleError(_0x51037a,null));};exports[_0x9797('0x2e')]=function(_0x58809d,_0x4bb0b1){return db[_0x9797('0x33')][_0x9797('0x50')]({'where':{'id':_0x58809d[_0x9797('0x4f')]['id']}})[_0x9797('0x47')](handleEntityNotFound(_0x4bb0b1,null))[_0x9797('0x47')](removeEntity(_0x4bb0b1,null))[_0x9797('0x22')](handleError(_0x4bb0b1,null));};exports[_0x9797('0x51')]=function(_0x1cdb9b,_0x22753c,_0x567611){var _0x47a956={};var _0x41257a={};var _0x3b6f0f;var _0x26967b;return db[_0x9797('0x33')]['findOne']({'where':{'id':_0x1cdb9b[_0x9797('0x4f')]['id']}})[_0x9797('0x47')](handleEntityNotFound(_0x22753c,null))[_0x9797('0x47')](function(_0x420c6a){if(_0x420c6a){_0x3b6f0f=_0x420c6a;_0x41257a[_0x9797('0x3c')]=_[_0x9797('0x4c')](db[_0x9797('0x52')][_0x9797('0x34')]);_0x41257a[_0x9797('0x39')]=_[_0x9797('0x4c')](_0x1cdb9b[_0x9797('0x39')]);_0x41257a[_0x9797('0x3a')]=_['intersection'](_0x41257a[_0x9797('0x3c')],_0x41257a[_0x9797('0x39')]);_0x47a956['attributes']=_['intersection'](_0x41257a[_0x9797('0x3c')],qs[_0x9797('0x3e')](_0x1cdb9b[_0x9797('0x39')][_0x9797('0x3e')]));_0x47a956[_0x9797('0x3d')]=_0x47a956[_0x9797('0x3d')][_0x9797('0x3f')]?_0x47a956[_0x9797('0x3d')]:_0x41257a['model'];_0x47a956[_0x9797('0x40')]=qs[_0x9797('0x41')](_0x1cdb9b[_0x9797('0x39')][_0x9797('0x41')]);_0x47a956['where']=qs[_0x9797('0x3a')](_['pick'](_0x1cdb9b[_0x9797('0x39')],_0x41257a[_0x9797('0x3a')]));if(_0x1cdb9b[_0x9797('0x39')][_0x9797('0x44')]){_0x47a956['where']=_[_0x9797('0x45')](_0x47a956[_0x9797('0x42')],{'$or':_[_0x9797('0x38')](_0x47a956[_0x9797('0x3d')],function(_0x3e9bf1){var _0x25a0ff={};_0x25a0ff[_0x3e9bf1]={'$like':'%'+_0x1cdb9b[_0x9797('0x39')][_0x9797('0x44')]+'%'};return _0x25a0ff;})});}_0x47a956=_[_0x9797('0x45')]({},_0x47a956,_0x1cdb9b[_0x9797('0x53')]);return _0x3b6f0f[_0x9797('0x51')](_0x47a956);}})[_0x9797('0x47')](function(_0x54f027){if(_0x54f027){_0x26967b=_0x54f027[_0x9797('0x3f')];if(!_0x1cdb9b[_0x9797('0x39')]['hasOwnProperty']('nolimit')){_0x47a956['limit']=qs['limit'](_0x1cdb9b['query'][_0x9797('0x28')]);_0x47a956['offset']=qs[_0x9797('0x27')](_0x1cdb9b[_0x9797('0x39')][_0x9797('0x27')]);}return _0x3b6f0f[_0x9797('0x51')](_0x47a956);}})['then'](function(_0x5bf567){if(_0x5bf567){return _0x5bf567?{'count':_0x26967b,'rows':_0x5bf567}:null;}})[_0x9797('0x47')](respondWithResult(_0x22753c,null))[_0x9797('0x22')](handleError(_0x22753c,null));};exports[_0x9797('0x54')]=function(_0x3cda8e,_0xd6e6b4,_0x49f573){var _0x26a11a={};var _0x41e02f={};var _0x249edc;var _0x1055ea;return db[_0x9797('0x33')][_0x9797('0x55')]({'where':{'id':_0x3cda8e[_0x9797('0x4f')]['id']}})[_0x9797('0x47')](handleEntityNotFound(_0xd6e6b4,null))[_0x9797('0x47')](function(_0x3da5f3){if(_0x3da5f3){_0x249edc=_0x3da5f3;_0x41e02f[_0x9797('0x3c')]=_['keys'](db[_0x9797('0x52')]['rawAttributes']);_0x41e02f[_0x9797('0x39')]=_[_0x9797('0x4c')](_0x3cda8e[_0x9797('0x39')]);_0x41e02f[_0x9797('0x3a')]=_['intersection'](_0x41e02f[_0x9797('0x3c')],_0x41e02f['query']);_0x26a11a[_0x9797('0x3d')]=_[_0x9797('0x3b')](_0x41e02f[_0x9797('0x3c')],qs[_0x9797('0x3e')](_0x3cda8e['query'][_0x9797('0x3e')]));_0x26a11a['attributes']=_0x26a11a[_0x9797('0x3d')][_0x9797('0x3f')]?_0x26a11a[_0x9797('0x3d')]:_0x41e02f['model'];_0x26a11a[_0x9797('0x40')]=qs[_0x9797('0x41')](_0x3cda8e[_0x9797('0x39')][_0x9797('0x41')]);_0x26a11a['where']=qs[_0x9797('0x3a')](_[_0x9797('0x43')](_0x3cda8e[_0x9797('0x39')],_0x41e02f[_0x9797('0x3a')]));if(_0x3cda8e['query'][_0x9797('0x44')]){_0x26a11a['where']=_[_0x9797('0x45')](_0x26a11a[_0x9797('0x42')],{'$or':_[_0x9797('0x38')](_0x26a11a[_0x9797('0x3d')],function(_0x46cc80){var _0x21a853={};_0x21a853[_0x46cc80]={'$like':'%'+_0x3cda8e['query']['filter']+'%'};return _0x21a853;})});}_0x26a11a=_[_0x9797('0x45')]({},_0x26a11a,_0x3cda8e[_0x9797('0x53')]);return _0x249edc[_0x9797('0x54')](_0x26a11a);}})[_0x9797('0x47')](function(_0x5adddb){if(_0x5adddb){_0x1055ea=_0x5adddb[_0x9797('0x3f')];if(!_0x3cda8e[_0x9797('0x39')][_0x9797('0x56')]('nolimit')){_0x26a11a[_0x9797('0x28')]=qs[_0x9797('0x28')](_0x3cda8e['query'][_0x9797('0x28')]);_0x26a11a['offset']=qs[_0x9797('0x27')](_0x3cda8e['query']['offset']);}return _0x249edc['getSubjects'](_0x26a11a);}})[_0x9797('0x47')](function(_0x3c7ef1){if(_0x3c7ef1){return _0x3c7ef1?{'count':_0x1055ea,'rows':_0x3c7ef1}:null;}})[_0x9797('0x47')](respondWithResult(_0xd6e6b4,null))[_0x9797('0x22')](handleError(_0xd6e6b4,null));};exports['getDescriptions']=function(_0x2f3202,_0x552681,_0x4a5541){var _0xe37b9={};var _0x150e99={};var _0x40c1e3;var _0x564a8f;return db['DeskConfiguration']['findOne']({'where':{'id':_0x2f3202[_0x9797('0x4f')]['id']}})[_0x9797('0x47')](handleEntityNotFound(_0x552681,null))['then'](function(_0x2a4a21){if(_0x2a4a21){_0x40c1e3=_0x2a4a21;_0x150e99[_0x9797('0x3c')]=_[_0x9797('0x4c')](db['DeskField'][_0x9797('0x34')]);_0x150e99[_0x9797('0x39')]=_['keys'](_0x2f3202[_0x9797('0x39')]);_0x150e99[_0x9797('0x3a')]=_[_0x9797('0x3b')](_0x150e99[_0x9797('0x3c')],_0x150e99['query']);_0xe37b9['attributes']=_[_0x9797('0x3b')](_0x150e99['model'],qs[_0x9797('0x3e')](_0x2f3202[_0x9797('0x39')][_0x9797('0x3e')]));_0xe37b9[_0x9797('0x3d')]=_0xe37b9['attributes']['length']?_0xe37b9[_0x9797('0x3d')]:_0x150e99[_0x9797('0x3c')];_0xe37b9['order']=qs[_0x9797('0x41')](_0x2f3202[_0x9797('0x39')][_0x9797('0x41')]);_0xe37b9[_0x9797('0x42')]=qs[_0x9797('0x3a')](_[_0x9797('0x43')](_0x2f3202[_0x9797('0x39')],_0x150e99[_0x9797('0x3a')]));if(_0x2f3202[_0x9797('0x39')][_0x9797('0x44')]){_0xe37b9[_0x9797('0x42')]=_[_0x9797('0x45')](_0xe37b9[_0x9797('0x42')],{'$or':_[_0x9797('0x38')](_0xe37b9[_0x9797('0x3d')],function(_0x345125){var _0x5ee0fc={};_0x5ee0fc[_0x345125]={'$like':'%'+_0x2f3202[_0x9797('0x39')][_0x9797('0x44')]+'%'};return _0x5ee0fc;})});}_0xe37b9=_[_0x9797('0x45')]({},_0xe37b9,_0x2f3202['options']);return _0x40c1e3[_0x9797('0x57')](_0xe37b9);}})[_0x9797('0x47')](function(_0x3423e7){if(_0x3423e7){_0x564a8f=_0x3423e7[_0x9797('0x3f')];if(!_0x2f3202[_0x9797('0x39')][_0x9797('0x56')](_0x9797('0x58'))){_0xe37b9[_0x9797('0x28')]=qs['limit'](_0x2f3202[_0x9797('0x39')]['limit']);_0xe37b9['offset']=qs[_0x9797('0x27')](_0x2f3202[_0x9797('0x39')][_0x9797('0x27')]);}return _0x40c1e3['getDescriptions'](_0xe37b9);}})[_0x9797('0x47')](function(_0x4dd441){if(_0x4dd441){return _0x4dd441?{'count':_0x564a8f,'rows':_0x4dd441}:null;}})['then'](respondWithResult(_0x552681,null))['catch'](handleError(_0x552681,null));};exports[_0x9797('0x59')]=function(_0x478964,_0x45ead3,_0x3790dc){var _0x19a4a0={};var _0x563fa6={};var _0x27cc9b;var _0x2ace9d;return db['DeskConfiguration'][_0x9797('0x55')]({'where':{'id':_0x478964['params']['id']}})['then'](handleEntityNotFound(_0x45ead3,null))[_0x9797('0x47')](function(_0x5e11f6){if(_0x5e11f6){_0x27cc9b=_0x5e11f6;_0x563fa6[_0x9797('0x3c')]=_[_0x9797('0x4c')](db[_0x9797('0x5a')][_0x9797('0x34')]);_0x563fa6[_0x9797('0x39')]=_[_0x9797('0x4c')](_0x478964[_0x9797('0x39')]);_0x563fa6[_0x9797('0x3a')]=_[_0x9797('0x3b')](_0x563fa6[_0x9797('0x3c')],_0x563fa6['query']);_0x19a4a0[_0x9797('0x3d')]=_[_0x9797('0x3b')](_0x563fa6[_0x9797('0x3c')],qs[_0x9797('0x3e')](_0x478964['query'][_0x9797('0x3e')]));_0x19a4a0['attributes']=_0x19a4a0[_0x9797('0x3d')][_0x9797('0x3f')]?_0x19a4a0[_0x9797('0x3d')]:_0x563fa6[_0x9797('0x3c')];_0x19a4a0[_0x9797('0x40')]=qs[_0x9797('0x41')](_0x478964[_0x9797('0x39')][_0x9797('0x41')]);_0x19a4a0[_0x9797('0x42')]=qs['filters'](_[_0x9797('0x43')](_0x478964[_0x9797('0x39')],_0x563fa6[_0x9797('0x3a')]));if(_0x478964[_0x9797('0x39')]['filter']){_0x19a4a0[_0x9797('0x42')]=_[_0x9797('0x45')](_0x19a4a0[_0x9797('0x42')],{'$or':_[_0x9797('0x38')](_0x19a4a0[_0x9797('0x3d')],function(_0x259dfd){var _0x50cbc6={};_0x50cbc6[_0x259dfd]={'$like':'%'+_0x478964['query'][_0x9797('0x44')]+'%'};return _0x50cbc6;})});}_0x19a4a0=_[_0x9797('0x45')]({},_0x19a4a0,_0x478964['options']);return _0x27cc9b[_0x9797('0x59')](_0x19a4a0);}})['then'](function(_0x51de69){if(_0x51de69){_0x2ace9d=_0x51de69['length'];if(!_0x478964[_0x9797('0x39')][_0x9797('0x56')](_0x9797('0x58'))){_0x19a4a0['limit']=qs[_0x9797('0x28')](_0x478964[_0x9797('0x39')][_0x9797('0x28')]);_0x19a4a0[_0x9797('0x27')]=qs[_0x9797('0x27')](_0x478964[_0x9797('0x39')][_0x9797('0x27')]);}return _0x27cc9b[_0x9797('0x59')](_0x19a4a0);}})[_0x9797('0x47')](function(_0x99c10a){if(_0x99c10a){return _0x99c10a?{'count':_0x2ace9d,'rows':_0x99c10a}:null;}})[_0x9797('0x47')](respondWithResult(_0x45ead3,null))[_0x9797('0x22')](handleError(_0x45ead3,null));};exports[_0x9797('0x5b')]=function(_0x119f6d,_0x4b922e,_0x42531e){if(_0x119f6d[_0x9797('0x4e')]['id']){delete _0x119f6d[_0x9797('0x4e')]['id'];}return db['DeskConfiguration'][_0x9797('0x55')]({'where':{'id':_0x119f6d['params']['id']}})[_0x9797('0x47')](handleEntityNotFound(_0x4b922e,null))[_0x9797('0x47')](function(_0xc9a75e){if(_0xc9a75e){return _0xc9a75e[_0x9797('0x5b')](_0x119f6d['body'][_0x9797('0x5c')]||[]);}return null;})['then'](respondWithResult(_0x4b922e,null))[_0x9797('0x22')](handleError(_0x4b922e,null));}; \ No newline at end of file +var _0xb03b=['rawAttributes','length','include','options','find','create','body','update','findOne','DeskField','getFields','getSubjects','getDescriptions','getTags','setTags','ids','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../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~!@#$%^&-_=+[{]}.','request','info','DeskConfiguration,\x20%s,\x20%s','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','json','offset','limit','set','apply','then','destroy','end','stack','name','DeskConfiguration','fieldName','type','key','model','map','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','VIRTUAL','filter','count','includeAll','rows','show','params'];(function(_0x5e6ea0,_0x8e1c64){var _0x42a2fd=function(_0x608296){while(--_0x608296){_0x5e6ea0['push'](_0x5e6ea0['shift']());}};_0x42a2fd(++_0x8e1c64);}(_0xb03b,0x6f));var _0xbb03=function(_0x5dd951,_0x2ba5cb){_0x5dd951=_0x5dd951-0x0;var _0x7458e0=_0xb03b[_0x5dd951];return _0x7458e0;};'use strict';var pdf=require(_0xbb03('0x0'));var emlformat=require(_0xbb03('0x1'));var rimraf=require(_0xbb03('0x2'));var zipdir=require(_0xbb03('0x3'));var jsonpatch=require(_0xbb03('0x4'));var rp=require(_0xbb03('0x5'));var moment=require(_0xbb03('0x6'));var BPromise=require(_0xbb03('0x7'));var Mustache=require('mustache');var util=require('util');var path=require(_0xbb03('0x8'));var sox=require(_0xbb03('0x9'));var csv=require(_0xbb03('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xbb03('0xb'));var squel=require(_0xbb03('0xc'));var crypto=require(_0xbb03('0xd'));var jsforce=require(_0xbb03('0xe'));var deskjs=require(_0xbb03('0xf'));var toCsv=require(_0xbb03('0xa'));var querystring=require('querystring');var Papa=require(_0xbb03('0x10'));var Redis=require(_0xbb03('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xbb03('0x12'));var as=require(_0xbb03('0x13'));var hardwareService=require(_0xbb03('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xbb03('0x15'));var config=require('../../config/environment');var db=require(_0xbb03('0x16'))['db'];var jayson=require(_0xbb03('0x17'));var client=jayson[_0xbb03('0x18')][_0xbb03('0x19')]({'port':0x232a});function checkPasswordPattern(_0x5afaa7,_0x1954a5,_0x3b8f16){if(_0x3b8f16){var _0x5386aa=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5386aa['test'](_0x1954a5)){return _0x5afaa7;}else{throw new db[(_0xbb03('0x1a'))][(_0xbb03('0x1b'))](_0xbb03('0x1c'));}}else{return _0x5afaa7;}}function respondWithRpcPromise(_0x2f249b,_0x23467f,_0x51b984,_0x1ebb83){return new BPromise(function(_0x10d1a6,_0x1338c1){var _0x285db2=_0x1ebb83||client;return _0x285db2[_0xbb03('0x1d')](_0x2f249b,_0x51b984)['then'](function(_0x4f4416){logger[_0xbb03('0x1e')](_0xbb03('0x1f'),_0x23467f,'request\x20sent');logger[_0xbb03('0x20')](_0xbb03('0x21'),_0x23467f,_0xbb03('0x22'),JSON[_0xbb03('0x23')](_0x4f4416));if(_0x4f4416[_0xbb03('0x24')]){if(_0x4f4416[_0xbb03('0x24')][_0xbb03('0x25')]===0x1f4){logger[_0xbb03('0x24')]('DeskConfiguration,\x20%s,\x20%s',_0x23467f,_0x4f4416['error'][_0xbb03('0x26')]);return _0x1338c1(_0x4f4416[_0xbb03('0x24')][_0xbb03('0x26')]);}logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x23467f,_0x4f4416[_0xbb03('0x24')][_0xbb03('0x26')]);return _0x10d1a6(_0x4f4416[_0xbb03('0x24')][_0xbb03('0x26')]);}else{logger[_0xbb03('0x1e')](_0xbb03('0x1f'),_0x23467f,'request\x20sent');_0x10d1a6(_0x4f4416[_0xbb03('0x27')][_0xbb03('0x26')]);}})[_0xbb03('0x28')](function(_0xc0b5e8){logger[_0xbb03('0x24')](_0xbb03('0x1f'),_0x23467f,_0xc0b5e8);_0x1338c1(_0xc0b5e8);});});}function respondWithStatusCode(_0x8b5fab,_0x490859){_0x490859=_0x490859||0xcc;return function(_0x58b031){if(_0x58b031){return _0x8b5fab[_0xbb03('0x29')](_0x490859);}return _0x8b5fab[_0xbb03('0x2a')](_0x490859)['end']();};}function respondWithResult(_0x4273d6,_0x57beb4){_0x57beb4=_0x57beb4||0xc8;return function(_0x16ab80){if(_0x16ab80){return _0x4273d6['status'](_0x57beb4)[_0xbb03('0x2b')](_0x16ab80);}};}function respondWithFilteredResult(_0x5b3594,_0x412f18){return function(_0xadfcdb){if(_0xadfcdb){var _0x1658d4=_0xadfcdb['count'],_0x48db3d=_0x412f18[_0xbb03('0x2c')],_0x94e9dd=_0x412f18['offset']+_0x412f18[_0xbb03('0x2d')],_0x264276;if(_0x94e9dd>=_0x1658d4){_0x94e9dd=_0x1658d4;_0x264276=0xc8;}else{_0x264276=0xce;}_0x5b3594[_0xbb03('0x2a')](_0x264276);return _0x5b3594[_0xbb03('0x2e')]('Content-Range',_0x48db3d+'-'+_0x94e9dd+'/'+_0x1658d4)[_0xbb03('0x2b')](_0xadfcdb);}return null;};}function patchUpdates(_0x4b0173){return function(_0x2d8c34){try{jsonpatch[_0xbb03('0x2f')](_0x2d8c34,_0x4b0173,!![]);}catch(_0x56fe81){return BPromise['reject'](_0x56fe81);}return _0x2d8c34['save']();};}function saveUpdates(_0x3c0c71,_0x65d176){return function(_0x356e82){if(_0x356e82){return _0x356e82['update'](_0x3c0c71)[_0xbb03('0x30')](function(_0x2df664){return _0x2df664;});}return null;};}function removeEntity(_0x18a03d,_0x415f2c){return function(_0x707cb){if(_0x707cb){return _0x707cb[_0xbb03('0x31')]()[_0xbb03('0x30')](function(){_0x18a03d[_0xbb03('0x2a')](0xcc)[_0xbb03('0x32')]();});}};}function handleEntityNotFound(_0x21455a,_0x226d52){return function(_0x460a53){if(!_0x460a53){_0x21455a[_0xbb03('0x29')](0x194);}return _0x460a53;};}function handleError(_0x28864b,_0x41859f){_0x41859f=_0x41859f||0x1f4;return function(_0x2dcb86){logger[_0xbb03('0x24')](_0x2dcb86[_0xbb03('0x33')]);if(_0x2dcb86[_0xbb03('0x34')]){delete _0x2dcb86[_0xbb03('0x34')];}_0x28864b[_0xbb03('0x2a')](_0x41859f)['send'](_0x2dcb86);};}exports['index']=function(_0x551e1a,_0x39d3d4){var _0x2d48bf={},_0x3b9d6e={},_0x5817a2={'count':0x0,'rows':[]};var _0x2b5837=_['map'](db[_0xbb03('0x35')]['rawAttributes'],function(_0x553ed9){return{'name':_0x553ed9[_0xbb03('0x36')],'type':_0x553ed9[_0xbb03('0x37')][_0xbb03('0x38')]};});_0x3b9d6e[_0xbb03('0x39')]=_[_0xbb03('0x3a')](_0x2b5837,_0xbb03('0x34'));_0x3b9d6e['query']=_[_0xbb03('0x3b')](_0x551e1a[_0xbb03('0x3c')]);_0x3b9d6e['filters']=_[_0xbb03('0x3d')](_0x3b9d6e[_0xbb03('0x39')],_0x3b9d6e['query']);_0x2d48bf[_0xbb03('0x3e')]=_[_0xbb03('0x3d')](_0x3b9d6e[_0xbb03('0x39')],qs[_0xbb03('0x3f')](_0x551e1a[_0xbb03('0x3c')][_0xbb03('0x3f')]));_0x2d48bf[_0xbb03('0x3e')]=_0x2d48bf['attributes']['length']?_0x2d48bf[_0xbb03('0x3e')]:_0x3b9d6e[_0xbb03('0x39')];if(!_0x551e1a[_0xbb03('0x3c')][_0xbb03('0x40')](_0xbb03('0x41'))){_0x2d48bf[_0xbb03('0x2d')]=qs[_0xbb03('0x2d')](_0x551e1a[_0xbb03('0x3c')][_0xbb03('0x2d')]);_0x2d48bf[_0xbb03('0x2c')]=qs[_0xbb03('0x2c')](_0x551e1a[_0xbb03('0x3c')][_0xbb03('0x2c')]);}_0x2d48bf[_0xbb03('0x42')]=qs[_0xbb03('0x43')](_0x551e1a[_0xbb03('0x3c')][_0xbb03('0x43')]);_0x2d48bf[_0xbb03('0x44')]=qs['filters'](_[_0xbb03('0x45')](_0x551e1a[_0xbb03('0x3c')],_0x3b9d6e[_0xbb03('0x46')]));if(_0x551e1a[_0xbb03('0x3c')]['filter']){_0x2d48bf[_0xbb03('0x44')]=_[_0xbb03('0x47')](_0x2d48bf['where'],{'$or':_[_0xbb03('0x3a')](_0x2b5837,function(_0x4a883f){if(_0x4a883f[_0xbb03('0x37')]!==_0xbb03('0x48')){var _0x309166={};_0x309166[_0x4a883f[_0xbb03('0x34')]]={'$like':'%'+_0x551e1a['query'][_0xbb03('0x49')]+'%'};return _0x309166;}})});}_0x2d48bf=_['merge']({},_0x2d48bf,_0x551e1a['options']);var _0x5ef930={'where':_0x2d48bf[_0xbb03('0x44')]};return db[_0xbb03('0x35')]['count'](_0x5ef930)[_0xbb03('0x30')](function(_0x2f5427){_0x5817a2[_0xbb03('0x4a')]=_0x2f5427;if(_0x551e1a[_0xbb03('0x3c')][_0xbb03('0x4b')]){_0x2d48bf['include']=[{'all':!![]}];}return db[_0xbb03('0x35')]['findAll'](_0x2d48bf);})[_0xbb03('0x30')](function(_0x20658e){_0x5817a2[_0xbb03('0x4c')]=_0x20658e;return _0x5817a2;})[_0xbb03('0x30')](respondWithFilteredResult(_0x39d3d4,_0x2d48bf))['catch'](handleError(_0x39d3d4,null));};exports[_0xbb03('0x4d')]=function(_0x25e629,_0x1cb6d6){var _0x398b0a={'raw':![],'where':{'id':_0x25e629[_0xbb03('0x4e')]['id']}},_0x27f28e={};_0x27f28e[_0xbb03('0x39')]=_[_0xbb03('0x3b')](db['DeskConfiguration'][_0xbb03('0x4f')]);_0x27f28e[_0xbb03('0x3c')]=_[_0xbb03('0x3b')](_0x25e629[_0xbb03('0x3c')]);_0x27f28e[_0xbb03('0x46')]=_[_0xbb03('0x3d')](_0x27f28e[_0xbb03('0x39')],_0x27f28e[_0xbb03('0x3c')]);_0x398b0a['attributes']=_['intersection'](_0x27f28e[_0xbb03('0x39')],qs[_0xbb03('0x3f')](_0x25e629['query']['fields']));_0x398b0a[_0xbb03('0x3e')]=_0x398b0a[_0xbb03('0x3e')][_0xbb03('0x50')]?_0x398b0a['attributes']:_0x27f28e['model'];if(_0x25e629['query'][_0xbb03('0x4b')]){_0x398b0a[_0xbb03('0x51')]=[{'all':!![]}];}_0x398b0a=_[_0xbb03('0x47')]({},_0x398b0a,_0x25e629[_0xbb03('0x52')]);return db['DeskConfiguration'][_0xbb03('0x53')](_0x398b0a)[_0xbb03('0x30')](handleEntityNotFound(_0x1cb6d6,null))[_0xbb03('0x30')](respondWithResult(_0x1cb6d6,null))[_0xbb03('0x28')](handleError(_0x1cb6d6,null));};exports[_0xbb03('0x54')]=function(_0x487803,_0x578543){return db[_0xbb03('0x35')][_0xbb03('0x54')](_0x487803[_0xbb03('0x55')],{})[_0xbb03('0x30')](respondWithResult(_0x578543,0xc9))[_0xbb03('0x28')](handleError(_0x578543,null));};exports[_0xbb03('0x56')]=function(_0x4c8247,_0x4f1a62){if(_0x4c8247[_0xbb03('0x55')]['id']){delete _0x4c8247[_0xbb03('0x55')]['id'];}return db['DeskConfiguration']['find']({'where':{'id':_0x4c8247[_0xbb03('0x4e')]['id']}})[_0xbb03('0x30')](handleEntityNotFound(_0x4f1a62,null))[_0xbb03('0x30')](saveUpdates(_0x4c8247[_0xbb03('0x55')],null))[_0xbb03('0x30')](respondWithResult(_0x4f1a62,null))[_0xbb03('0x28')](handleError(_0x4f1a62,null));};exports[_0xbb03('0x31')]=function(_0x58af3f,_0x1f4ecf){return db[_0xbb03('0x35')]['find']({'where':{'id':_0x58af3f[_0xbb03('0x4e')]['id']}})['then'](handleEntityNotFound(_0x1f4ecf,null))['then'](removeEntity(_0x1f4ecf,null))[_0xbb03('0x28')](handleError(_0x1f4ecf,null));};exports['getFields']=function(_0x415f20,_0x26744f,_0x4badf8){var _0x159615={};var _0x1367a3={};var _0x5c2355;var _0x51563c;return db[_0xbb03('0x35')][_0xbb03('0x57')]({'where':{'id':_0x415f20[_0xbb03('0x4e')]['id']}})[_0xbb03('0x30')](handleEntityNotFound(_0x26744f,null))[_0xbb03('0x30')](function(_0x176990){if(_0x176990){_0x5c2355=_0x176990;_0x1367a3[_0xbb03('0x39')]=_[_0xbb03('0x3b')](db[_0xbb03('0x58')]['rawAttributes']);_0x1367a3[_0xbb03('0x3c')]=_[_0xbb03('0x3b')](_0x415f20['query']);_0x1367a3['filters']=_[_0xbb03('0x3d')](_0x1367a3[_0xbb03('0x39')],_0x1367a3['query']);_0x159615[_0xbb03('0x3e')]=_['intersection'](_0x1367a3[_0xbb03('0x39')],qs[_0xbb03('0x3f')](_0x415f20[_0xbb03('0x3c')][_0xbb03('0x3f')]));_0x159615['attributes']=_0x159615[_0xbb03('0x3e')][_0xbb03('0x50')]?_0x159615[_0xbb03('0x3e')]:_0x1367a3[_0xbb03('0x39')];_0x159615['order']=qs[_0xbb03('0x43')](_0x415f20[_0xbb03('0x3c')]['sort']);_0x159615[_0xbb03('0x44')]=qs[_0xbb03('0x46')](_[_0xbb03('0x45')](_0x415f20[_0xbb03('0x3c')],_0x1367a3['filters']));if(_0x415f20[_0xbb03('0x3c')][_0xbb03('0x49')]){_0x159615[_0xbb03('0x44')]=_['merge'](_0x159615[_0xbb03('0x44')],{'$or':_['map'](_0x159615[_0xbb03('0x3e')],function(_0x86a6df){var _0x2fbe4f={};_0x2fbe4f[_0x86a6df]={'$like':'%'+_0x415f20[_0xbb03('0x3c')][_0xbb03('0x49')]+'%'};return _0x2fbe4f;})});}_0x159615=_[_0xbb03('0x47')]({},_0x159615,_0x415f20[_0xbb03('0x52')]);return _0x5c2355[_0xbb03('0x59')](_0x159615);}})[_0xbb03('0x30')](function(_0x5546d1){if(_0x5546d1){_0x51563c=_0x5546d1[_0xbb03('0x50')];if(!_0x415f20[_0xbb03('0x3c')][_0xbb03('0x40')]('nolimit')){_0x159615[_0xbb03('0x2d')]=qs[_0xbb03('0x2d')](_0x415f20[_0xbb03('0x3c')][_0xbb03('0x2d')]);_0x159615[_0xbb03('0x2c')]=qs[_0xbb03('0x2c')](_0x415f20[_0xbb03('0x3c')][_0xbb03('0x2c')]);}return _0x5c2355[_0xbb03('0x59')](_0x159615);}})['then'](function(_0x17c968){if(_0x17c968){return _0x17c968?{'count':_0x51563c,'rows':_0x17c968}:null;}})['then'](respondWithResult(_0x26744f,null))['catch'](handleError(_0x26744f,null));};exports['getSubjects']=function(_0x46d9f0,_0x3fabe5,_0x38bea7){var _0x12be50={};var _0x5b28d3={};var _0x1f0770;var _0x26d7f1;return db['DeskConfiguration']['findOne']({'where':{'id':_0x46d9f0[_0xbb03('0x4e')]['id']}})[_0xbb03('0x30')](handleEntityNotFound(_0x3fabe5,null))['then'](function(_0x5689c4){if(_0x5689c4){_0x1f0770=_0x5689c4;_0x5b28d3['model']=_[_0xbb03('0x3b')](db['DeskField']['rawAttributes']);_0x5b28d3['query']=_['keys'](_0x46d9f0['query']);_0x5b28d3[_0xbb03('0x46')]=_[_0xbb03('0x3d')](_0x5b28d3[_0xbb03('0x39')],_0x5b28d3[_0xbb03('0x3c')]);_0x12be50[_0xbb03('0x3e')]=_[_0xbb03('0x3d')](_0x5b28d3[_0xbb03('0x39')],qs['fields'](_0x46d9f0[_0xbb03('0x3c')]['fields']));_0x12be50[_0xbb03('0x3e')]=_0x12be50[_0xbb03('0x3e')][_0xbb03('0x50')]?_0x12be50[_0xbb03('0x3e')]:_0x5b28d3[_0xbb03('0x39')];_0x12be50['order']=qs[_0xbb03('0x43')](_0x46d9f0[_0xbb03('0x3c')][_0xbb03('0x43')]);_0x12be50[_0xbb03('0x44')]=qs[_0xbb03('0x46')](_[_0xbb03('0x45')](_0x46d9f0[_0xbb03('0x3c')],_0x5b28d3[_0xbb03('0x46')]));if(_0x46d9f0['query'][_0xbb03('0x49')]){_0x12be50[_0xbb03('0x44')]=_['merge'](_0x12be50['where'],{'$or':_['map'](_0x12be50[_0xbb03('0x3e')],function(_0x23ad19){var _0x5fedcb={};_0x5fedcb[_0x23ad19]={'$like':'%'+_0x46d9f0['query']['filter']+'%'};return _0x5fedcb;})});}_0x12be50=_[_0xbb03('0x47')]({},_0x12be50,_0x46d9f0[_0xbb03('0x52')]);return _0x1f0770[_0xbb03('0x5a')](_0x12be50);}})['then'](function(_0x244926){if(_0x244926){_0x26d7f1=_0x244926['length'];if(!_0x46d9f0['query'][_0xbb03('0x40')](_0xbb03('0x41'))){_0x12be50[_0xbb03('0x2d')]=qs['limit'](_0x46d9f0[_0xbb03('0x3c')][_0xbb03('0x2d')]);_0x12be50[_0xbb03('0x2c')]=qs[_0xbb03('0x2c')](_0x46d9f0[_0xbb03('0x3c')][_0xbb03('0x2c')]);}return _0x1f0770[_0xbb03('0x5a')](_0x12be50);}})[_0xbb03('0x30')](function(_0x11da77){if(_0x11da77){return _0x11da77?{'count':_0x26d7f1,'rows':_0x11da77}:null;}})['then'](respondWithResult(_0x3fabe5,null))[_0xbb03('0x28')](handleError(_0x3fabe5,null));};exports[_0xbb03('0x5b')]=function(_0x584f17,_0x4a39a7,_0x58a6c0){var _0x520f6a={};var _0x3424c7={};var _0x19e57b;var _0x2ea8a2;return db['DeskConfiguration'][_0xbb03('0x57')]({'where':{'id':_0x584f17[_0xbb03('0x4e')]['id']}})[_0xbb03('0x30')](handleEntityNotFound(_0x4a39a7,null))[_0xbb03('0x30')](function(_0xaf5aa4){if(_0xaf5aa4){_0x19e57b=_0xaf5aa4;_0x3424c7['model']=_[_0xbb03('0x3b')](db['DeskField']['rawAttributes']);_0x3424c7[_0xbb03('0x3c')]=_[_0xbb03('0x3b')](_0x584f17[_0xbb03('0x3c')]);_0x3424c7[_0xbb03('0x46')]=_[_0xbb03('0x3d')](_0x3424c7[_0xbb03('0x39')],_0x3424c7[_0xbb03('0x3c')]);_0x520f6a[_0xbb03('0x3e')]=_[_0xbb03('0x3d')](_0x3424c7[_0xbb03('0x39')],qs[_0xbb03('0x3f')](_0x584f17[_0xbb03('0x3c')][_0xbb03('0x3f')]));_0x520f6a[_0xbb03('0x3e')]=_0x520f6a['attributes'][_0xbb03('0x50')]?_0x520f6a[_0xbb03('0x3e')]:_0x3424c7[_0xbb03('0x39')];_0x520f6a[_0xbb03('0x42')]=qs['sort'](_0x584f17[_0xbb03('0x3c')][_0xbb03('0x43')]);_0x520f6a[_0xbb03('0x44')]=qs[_0xbb03('0x46')](_[_0xbb03('0x45')](_0x584f17[_0xbb03('0x3c')],_0x3424c7[_0xbb03('0x46')]));if(_0x584f17[_0xbb03('0x3c')][_0xbb03('0x49')]){_0x520f6a[_0xbb03('0x44')]=_[_0xbb03('0x47')](_0x520f6a[_0xbb03('0x44')],{'$or':_[_0xbb03('0x3a')](_0x520f6a[_0xbb03('0x3e')],function(_0x60b9d3){var _0x3437be={};_0x3437be[_0x60b9d3]={'$like':'%'+_0x584f17[_0xbb03('0x3c')]['filter']+'%'};return _0x3437be;})});}_0x520f6a=_[_0xbb03('0x47')]({},_0x520f6a,_0x584f17['options']);return _0x19e57b['getDescriptions'](_0x520f6a);}})[_0xbb03('0x30')](function(_0x3de185){if(_0x3de185){_0x2ea8a2=_0x3de185['length'];if(!_0x584f17[_0xbb03('0x3c')][_0xbb03('0x40')](_0xbb03('0x41'))){_0x520f6a[_0xbb03('0x2d')]=qs[_0xbb03('0x2d')](_0x584f17[_0xbb03('0x3c')][_0xbb03('0x2d')]);_0x520f6a[_0xbb03('0x2c')]=qs[_0xbb03('0x2c')](_0x584f17[_0xbb03('0x3c')]['offset']);}return _0x19e57b[_0xbb03('0x5b')](_0x520f6a);}})[_0xbb03('0x30')](function(_0x65ffae){if(_0x65ffae){return _0x65ffae?{'count':_0x2ea8a2,'rows':_0x65ffae}:null;}})[_0xbb03('0x30')](respondWithResult(_0x4a39a7,null))[_0xbb03('0x28')](handleError(_0x4a39a7,null));};exports['getTags']=function(_0x20aba6,_0x32657c,_0x502552){var _0x13a3be={};var _0x361792={};var _0x233028;var _0x4e409e;return db[_0xbb03('0x35')][_0xbb03('0x57')]({'where':{'id':_0x20aba6[_0xbb03('0x4e')]['id']}})['then'](handleEntityNotFound(_0x32657c,null))[_0xbb03('0x30')](function(_0x204ed1){if(_0x204ed1){_0x233028=_0x204ed1;_0x361792[_0xbb03('0x39')]=_[_0xbb03('0x3b')](db['Tag'][_0xbb03('0x4f')]);_0x361792[_0xbb03('0x3c')]=_[_0xbb03('0x3b')](_0x20aba6[_0xbb03('0x3c')]);_0x361792['filters']=_[_0xbb03('0x3d')](_0x361792[_0xbb03('0x39')],_0x361792[_0xbb03('0x3c')]);_0x13a3be['attributes']=_[_0xbb03('0x3d')](_0x361792[_0xbb03('0x39')],qs[_0xbb03('0x3f')](_0x20aba6[_0xbb03('0x3c')]['fields']));_0x13a3be[_0xbb03('0x3e')]=_0x13a3be[_0xbb03('0x3e')]['length']?_0x13a3be[_0xbb03('0x3e')]:_0x361792[_0xbb03('0x39')];_0x13a3be[_0xbb03('0x42')]=qs[_0xbb03('0x43')](_0x20aba6[_0xbb03('0x3c')]['sort']);_0x13a3be[_0xbb03('0x44')]=qs[_0xbb03('0x46')](_['pick'](_0x20aba6[_0xbb03('0x3c')],_0x361792['filters']));if(_0x20aba6[_0xbb03('0x3c')][_0xbb03('0x49')]){_0x13a3be['where']=_[_0xbb03('0x47')](_0x13a3be[_0xbb03('0x44')],{'$or':_['map'](_0x13a3be[_0xbb03('0x3e')],function(_0x2bf3d2){var _0x2e9880={};_0x2e9880[_0x2bf3d2]={'$like':'%'+_0x20aba6['query']['filter']+'%'};return _0x2e9880;})});}_0x13a3be=_['merge']({},_0x13a3be,_0x20aba6['options']);return _0x233028[_0xbb03('0x5c')](_0x13a3be);}})[_0xbb03('0x30')](function(_0x534cd4){if(_0x534cd4){_0x4e409e=_0x534cd4[_0xbb03('0x50')];if(!_0x20aba6[_0xbb03('0x3c')][_0xbb03('0x40')](_0xbb03('0x41'))){_0x13a3be[_0xbb03('0x2d')]=qs['limit'](_0x20aba6[_0xbb03('0x3c')][_0xbb03('0x2d')]);_0x13a3be[_0xbb03('0x2c')]=qs['offset'](_0x20aba6[_0xbb03('0x3c')]['offset']);}return _0x233028[_0xbb03('0x5c')](_0x13a3be);}})[_0xbb03('0x30')](function(_0x272eef){if(_0x272eef){return _0x272eef?{'count':_0x4e409e,'rows':_0x272eef}:null;}})[_0xbb03('0x30')](respondWithResult(_0x32657c,null))[_0xbb03('0x28')](handleError(_0x32657c,null));};exports[_0xbb03('0x5d')]=function(_0x4cb2c2,_0x67b430,_0x13137d){if(_0x4cb2c2[_0xbb03('0x55')]['id']){delete _0x4cb2c2[_0xbb03('0x55')]['id'];}return db[_0xbb03('0x35')][_0xbb03('0x57')]({'where':{'id':_0x4cb2c2[_0xbb03('0x4e')]['id']}})['then'](handleEntityNotFound(_0x67b430,null))[_0xbb03('0x30')](function(_0x910596){if(_0x910596){return _0x910596[_0xbb03('0x5d')](_0x4cb2c2[_0xbb03('0x55')][_0xbb03('0x5e')]||[]);}return null;})[_0xbb03('0x30')](respondWithResult(_0x67b430,null))[_0xbb03('0x28')](handleError(_0x67b430,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 6443b1a..f1a1e7c 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 _0x954d=['api','bluebird','path','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','define','DeskConfiguration','int_desk_configurations','lodash','util'];(function(_0x216f7d,_0x496249){var _0xc49d7f=function(_0x27be52){while(--_0x27be52){_0x216f7d['push'](_0x216f7d['shift']());}};_0xc49d7f(++_0x496249);}(_0x954d,0xbe));var _0xd954=function(_0x5a70a2,_0xf1e7f9){_0x5a70a2=_0x5a70a2-0x0;var _0x1c88fd=_0x954d[_0x5a70a2];return _0x1c88fd;};'use strict';var _=require(_0xd954('0x0'));var util=require(_0xd954('0x1'));var logger=require('../../config/logger')(_0xd954('0x2'));var moment=require('moment');var BPromise=require(_0xd954('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd954('0x4'));var rimraf=require(_0xd954('0x5'));var config=require(_0xd954('0x6'));var attributes=require(_0xd954('0x7'));module[_0xd954('0x8')]=function(_0xc650c8,_0x586a7d){return _0xc650c8[_0xd954('0x9')](_0xd954('0xa'),attributes,{'tableName':_0xd954('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcace=['define','DeskConfiguration','lodash','util','../../config/logger','api','moment','request-promise','./intDeskConfiguration.attributes','exports'];(function(_0x3253ca,_0x39efb8){var _0x30134d=function(_0x5a9753){while(--_0x5a9753){_0x3253ca['push'](_0x3253ca['shift']());}};_0x30134d(++_0x39efb8);}(_0xcace,0xca));var _0xecac=function(_0x56aad3,_0x3d48bc){_0x56aad3=_0x56aad3-0x0;var _0x1d165a=_0xcace[_0x56aad3];return _0x1d165a;};'use strict';var _=require(_0xecac('0x0'));var util=require(_0xecac('0x1'));var logger=require(_0xecac('0x2'))(_0xecac('0x3'));var moment=require(_0xecac('0x4'));var BPromise=require('bluebird');var rp=require(_0xecac('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xecac('0x6'));module[_0xecac('0x7')]=function(_0x283906,_0x46c02a){return _0x283906[_0xecac('0x8')](_0xecac('0x9'),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 eb2585b..c7d65b0 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 _0x6ff1=['result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x494367,_0x28026e){var _0x5eabc2=function(_0x4a4339){while(--_0x4a4339){_0x494367['push'](_0x494367['shift']());}};_0x5eabc2(++_0x28026e);}(_0x6ff1,0x10a));var _0x16ff=function(_0x4097c8,_0x3f3c36){_0x4097c8=_0x4097c8-0x0;var _0x1506d3=_0x6ff1[_0x4097c8];return _0x1506d3;};'use strict';var _=require(_0x16ff('0x0'));var util=require(_0x16ff('0x1'));var moment=require(_0x16ff('0x2'));var BPromise=require(_0x16ff('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x16ff('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x16ff('0x5'))(_0x16ff('0x6'));var config=require(_0x16ff('0x7'));var jayson=require(_0x16ff('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x560612,_0x4e6fbf,_0x133612){return new BPromise(function(_0x218c28,_0x3b368c){return client[_0x16ff('0x9')](_0x560612,_0x133612)[_0x16ff('0xa')](function(_0xc1a41){logger[_0x16ff('0xb')](_0x16ff('0xc'),_0x4e6fbf,_0x16ff('0xd'));logger[_0x16ff('0xe')](_0x16ff('0xf'),_0x4e6fbf,_0x16ff('0xd'),JSON[_0x16ff('0x10')](_0xc1a41));if(_0xc1a41[_0x16ff('0x11')]){if(_0xc1a41[_0x16ff('0x11')][_0x16ff('0x12')]===0x1f4){logger[_0x16ff('0x11')](_0x16ff('0xc'),_0x4e6fbf,_0xc1a41[_0x16ff('0x11')][_0x16ff('0x13')]);return _0x3b368c(_0xc1a41['error']['message']);}logger[_0x16ff('0x11')](_0x16ff('0xc'),_0x4e6fbf,_0xc1a41[_0x16ff('0x11')][_0x16ff('0x13')]);return _0x218c28(_0xc1a41[_0x16ff('0x11')][_0x16ff('0x13')]);}else{logger['info'](_0x16ff('0xc'),_0x4e6fbf,_0x16ff('0xd'));_0x218c28(_0xc1a41[_0x16ff('0x14')]['message']);}})[_0x16ff('0x15')](function(_0x43b519){logger[_0x16ff('0x11')]('DeskConfiguration,\x20%s,\x20%s',_0x4e6fbf,_0x43b519);_0x3b368c(_0x43b519);});});} \ No newline at end of file +var _0x48d0=['client','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x55d64e,_0x3d844c){var _0x4eefea=function(_0x157c2d){while(--_0x157c2d){_0x55d64e['push'](_0x55d64e['shift']());}};_0x4eefea(++_0x3d844c);}(_0x48d0,0xd3));var _0x048d=function(_0x316434,_0x170dae){_0x316434=_0x316434-0x0;var _0x5857ae=_0x48d0[_0x316434];return _0x5857ae;};'use strict';var _=require(_0x048d('0x0'));var util=require(_0x048d('0x1'));var moment=require('moment');var BPromise=require(_0x048d('0x2'));var rs=require(_0x048d('0x3'));var fs=require('fs');var Redis=require(_0x048d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x048d('0x5'));var logger=require(_0x048d('0x6'))('rpc');var config=require(_0x048d('0x7'));var jayson=require(_0x048d('0x8'));var client=jayson[_0x048d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x16b9b6,_0x339f60,_0x54a5f3){return new BPromise(function(_0x3939cb,_0x8e095d){return client[_0x048d('0xa')](_0x16b9b6,_0x54a5f3)[_0x048d('0xb')](function(_0x2c8091){logger[_0x048d('0xc')](_0x048d('0xd'),_0x339f60,_0x048d('0xe'));logger[_0x048d('0xf')](_0x048d('0x10'),_0x339f60,_0x048d('0xe'),JSON[_0x048d('0x11')](_0x2c8091));if(_0x2c8091['error']){if(_0x2c8091[_0x048d('0x12')]['code']===0x1f4){logger[_0x048d('0x12')](_0x048d('0xd'),_0x339f60,_0x2c8091[_0x048d('0x12')]['message']);return _0x8e095d(_0x2c8091[_0x048d('0x12')]['message']);}logger[_0x048d('0x12')](_0x048d('0xd'),_0x339f60,_0x2c8091[_0x048d('0x12')][_0x048d('0x13')]);return _0x3939cb(_0x2c8091['error'][_0x048d('0x13')]);}else{logger[_0x048d('0xc')](_0x048d('0xd'),_0x339f60,_0x048d('0xe'));_0x3939cb(_0x2c8091[_0x048d('0x14')][_0x048d('0x13')]);}})[_0x048d('0x15')](function(_0x5bed7f){logger[_0x048d('0x12')](_0x048d('0xd'),_0x339f60,_0x5bed7f);_0x8e095d(_0x5bed7f);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index e6e79a2..1d13d25 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 _0x13a8=['get','isAuthenticated','/:id','show','create','delete','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x369cd2,_0x2a70bf){var _0x527087=function(_0x2f167a){while(--_0x2f167a){_0x369cd2['push'](_0x369cd2['shift']());}};_0x527087(++_0x2a70bf);}(_0x13a8,0xbe));var _0x813a=function(_0x32eec1,_0x5563cc){_0x32eec1=_0x32eec1-0x0;var _0x45987d=_0x13a8[_0x32eec1];return _0x45987d;};'use strict';var multer=require('multer');var util=require(_0x813a('0x0'));var path=require(_0x813a('0x1'));var timeout=require(_0x813a('0x2'));var express=require(_0x813a('0x3'));var router=express['Router']();var auth=require(_0x813a('0x4'));var interaction=require(_0x813a('0x5'));var config=require('../../config/environment');var controller=require('./intDeskField.controller');router[_0x813a('0x6')]('/',auth[_0x813a('0x7')](),controller['index']);router[_0x813a('0x6')](_0x813a('0x8'),auth[_0x813a('0x7')](),controller[_0x813a('0x9')]);router['post']('/',auth[_0x813a('0x7')](),controller[_0x813a('0xa')]);router['put'](_0x813a('0x8'),auth[_0x813a('0x7')](),controller['update']);router[_0x813a('0xb')](_0x813a('0x8'),auth[_0x813a('0x7')](),controller[_0x813a('0xc')]);module[_0x813a('0xd')]=router; \ No newline at end of file +var _0x202e=['isAuthenticated','index','show','post','create','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intDeskField.controller','get'];(function(_0x271664,_0xcdcfc6){var _0x1a61d3=function(_0x52da69){while(--_0x52da69){_0x271664['push'](_0x271664['shift']());}};_0x1a61d3(++_0xcdcfc6);}(_0x202e,0xbe));var _0xe202=function(_0x2dcae4,_0x3b2545){_0x2dcae4=_0x2dcae4-0x0;var _0x2f4105=_0x202e[_0x2dcae4];return _0x2f4105;};'use strict';var multer=require(_0xe202('0x0'));var util=require(_0xe202('0x1'));var path=require(_0xe202('0x2'));var timeout=require(_0xe202('0x3'));var express=require(_0xe202('0x4'));var router=express[_0xe202('0x5')]();var auth=require(_0xe202('0x6'));var interaction=require(_0xe202('0x7'));var config=require('../../config/environment');var controller=require(_0xe202('0x8'));router[_0xe202('0x9')]('/',auth[_0xe202('0xa')](),controller[_0xe202('0xb')]);router['get']('/:id',auth[_0xe202('0xa')](),controller[_0xe202('0xc')]);router[_0xe202('0xd')]('/',auth[_0xe202('0xa')](),controller[_0xe202('0xe')]);router['put'](_0xe202('0xf'),auth['isAuthenticated'](),controller[_0xe202('0x10')]);router[_0xe202('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xe202('0x12')]);module[_0xe202('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 75cdc7e..8c521ea 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 _0x1d2e=['STRING','exports','ENUM','string','variable','customVariable'];(function(_0x21f133,_0x325cef){var _0x596b68=function(_0x2ba306){while(--_0x2ba306){_0x21f133['push'](_0x21f133['shift']());}};_0x596b68(++_0x325cef);}(_0x1d2e,0x187));var _0xe1d2=function(_0x2a6e8c,_0x34b0da){_0x2a6e8c=_0x2a6e8c-0x0;var _0x44f28b=_0x1d2e[_0x2a6e8c];return _0x44f28b;};'use strict';var Sequelize=require('sequelize');module[_0xe1d2('0x0')]={'type':{'type':Sequelize[_0xe1d2('0x1')](_0xe1d2('0x2'),_0xe1d2('0x3'),_0xe1d2('0x4'),'keyValue'),'defaultValue':_0xe1d2('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xe1d2('0x5')]},'keyType':{'type':Sequelize[_0xe1d2('0x1')]('string',_0xe1d2('0x3'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xe1d2('0x5')]},'nameField':{'type':Sequelize[_0xe1d2('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x96da=['STRING','ENUM','BOOLEAN','sequelize','exports','string','variable','customVariable'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x96da,0x19b));var _0xa96d=function(_0x263662,_0x28d46a){_0x263662=_0x263662-0x0;var _0x199a90=_0x96da[_0x263662];return _0x199a90;};'use strict';var Sequelize=require(_0xa96d('0x0'));module[_0xa96d('0x1')]={'type':{'type':Sequelize['ENUM'](_0xa96d('0x2'),_0xa96d('0x3'),_0xa96d('0x4'),'keyValue'),'defaultValue':_0xa96d('0x2')},'content':{'type':Sequelize[_0xa96d('0x5')]},'key':{'type':Sequelize[_0xa96d('0x5')]},'keyType':{'type':Sequelize[_0xa96d('0x6')](_0xa96d('0x2'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0xa96d('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xa96d('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa96d('0x5')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 09adbf1..883a3da 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 _0xdb94=['where','filters','filter','merge','type','options','includeAll','include','findAll','rows','catch','show','params','length','find','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','apply','reject','save','update','then','destroy','error','stack','name','send','map','DeskField','rawAttributes','fieldName','key','query','keys','intersection','model','attributes','fields','nolimit','order','sort'];(function(_0x32f074,_0x50355b){var _0x5d932f=function(_0x57c38f){while(--_0x57c38f){_0x32f074['push'](_0x32f074['shift']());}};_0x5d932f(++_0x50355b);}(_0xdb94,0xe5));var _0x4db9=function(_0x3e6262,_0x4c5785){_0x3e6262=_0x3e6262-0x0;var _0x365036=_0xdb94[_0x3e6262];return _0x365036;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x4db9('0x0'));var rimraf=require(_0x4db9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4db9('0x2'));var rp=require(_0x4db9('0x3'));var moment=require(_0x4db9('0x4'));var BPromise=require(_0x4db9('0x5'));var Mustache=require(_0x4db9('0x6'));var util=require('util');var path=require(_0x4db9('0x7'));var sox=require('sox');var csv=require(_0x4db9('0x8'));var ejs=require(_0x4db9('0x9'));var fs=require('fs');var _=require(_0x4db9('0xa'));var squel=require(_0x4db9('0xb'));var crypto=require(_0x4db9('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x4db9('0xd'));var toCsv=require(_0x4db9('0x8'));var querystring=require(_0x4db9('0xe'));var Papa=require(_0x4db9('0xf'));var Redis=require(_0x4db9('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x4db9('0x11'));var as=require(_0x4db9('0x12'));var hardwareService=require(_0x4db9('0x13'));var logger=require(_0x4db9('0x14'))(_0x4db9('0x15'));var utils=require(_0x4db9('0x16'));var config=require('../../config/environment');var db=require(_0x4db9('0x17'))['db'];function respondWithStatusCode(_0x4397fc,_0x59f01c){_0x59f01c=_0x59f01c||0xcc;return function(_0x549c92){if(_0x549c92){return _0x4397fc[_0x4db9('0x18')](_0x59f01c);}return _0x4397fc[_0x4db9('0x19')](_0x59f01c)[_0x4db9('0x1a')]();};}function respondWithResult(_0x4d4046,_0x1a93be){_0x1a93be=_0x1a93be||0xc8;return function(_0x3dde55){if(_0x3dde55){return _0x4d4046[_0x4db9('0x19')](_0x1a93be)[_0x4db9('0x1b')](_0x3dde55);}};}function respondWithFilteredResult(_0x2d89a7,_0x585230){return function(_0x1b1062){if(_0x1b1062){var _0x1a5a9c=_0x1b1062[_0x4db9('0x1c')],_0x5d4d70=_0x585230['offset'],_0x27b387=_0x585230[_0x4db9('0x1d')]+_0x585230[_0x4db9('0x1e')],_0x7df575;if(_0x27b387>=_0x1a5a9c){_0x27b387=_0x1a5a9c;_0x7df575=0xc8;}else{_0x7df575=0xce;}_0x2d89a7['status'](_0x7df575);return _0x2d89a7['set']('Content-Range',_0x5d4d70+'-'+_0x27b387+'/'+_0x1a5a9c)[_0x4db9('0x1b')](_0x1b1062);}return null;};}function patchUpdates(_0x4235ab){return function(_0x48ff99){try{jsonpatch[_0x4db9('0x1f')](_0x48ff99,_0x4235ab,!![]);}catch(_0x1f6b24){return BPromise[_0x4db9('0x20')](_0x1f6b24);}return _0x48ff99[_0x4db9('0x21')]();};}function saveUpdates(_0x439433,_0x28b7f6){return function(_0x34a6ed){if(_0x34a6ed){return _0x34a6ed[_0x4db9('0x22')](_0x439433)[_0x4db9('0x23')](function(_0x41d0c1){return _0x41d0c1;});}return null;};}function removeEntity(_0x29b4ff,_0x102402){return function(_0x4d56a1){if(_0x4d56a1){return _0x4d56a1[_0x4db9('0x24')]()[_0x4db9('0x23')](function(){_0x29b4ff['status'](0xcc)[_0x4db9('0x1a')]();});}};}function handleEntityNotFound(_0x3f4931,_0x4419af){return function(_0x402898){if(!_0x402898){_0x3f4931['sendStatus'](0x194);}return _0x402898;};}function handleError(_0xe3dbe,_0x506cc9){_0x506cc9=_0x506cc9||0x1f4;return function(_0x1cf805){logger[_0x4db9('0x25')](_0x1cf805[_0x4db9('0x26')]);if(_0x1cf805[_0x4db9('0x27')]){delete _0x1cf805[_0x4db9('0x27')];}_0xe3dbe[_0x4db9('0x19')](_0x506cc9)[_0x4db9('0x28')](_0x1cf805);};}exports['index']=function(_0x5f59be,_0x1b2647){var _0x5ce6cc={},_0x910137={},_0x2653be={'count':0x0,'rows':[]};var _0x38d5e2=_[_0x4db9('0x29')](db[_0x4db9('0x2a')][_0x4db9('0x2b')],function(_0x1d0dc2){return{'name':_0x1d0dc2[_0x4db9('0x2c')],'type':_0x1d0dc2['type'][_0x4db9('0x2d')]};});_0x910137['model']=_[_0x4db9('0x29')](_0x38d5e2,_0x4db9('0x27'));_0x910137[_0x4db9('0x2e')]=_[_0x4db9('0x2f')](_0x5f59be[_0x4db9('0x2e')]);_0x910137['filters']=_[_0x4db9('0x30')](_0x910137[_0x4db9('0x31')],_0x910137[_0x4db9('0x2e')]);_0x5ce6cc[_0x4db9('0x32')]=_['intersection'](_0x910137['model'],qs[_0x4db9('0x33')](_0x5f59be[_0x4db9('0x2e')]['fields']));_0x5ce6cc['attributes']=_0x5ce6cc[_0x4db9('0x32')]['length']?_0x5ce6cc['attributes']:_0x910137[_0x4db9('0x31')];if(!_0x5f59be[_0x4db9('0x2e')]['hasOwnProperty'](_0x4db9('0x34'))){_0x5ce6cc[_0x4db9('0x1e')]=qs[_0x4db9('0x1e')](_0x5f59be[_0x4db9('0x2e')]['limit']);_0x5ce6cc[_0x4db9('0x1d')]=qs['offset'](_0x5f59be['query']['offset']);}_0x5ce6cc[_0x4db9('0x35')]=qs[_0x4db9('0x36')](_0x5f59be['query'][_0x4db9('0x36')]);_0x5ce6cc[_0x4db9('0x37')]=qs['filters'](_['pick'](_0x5f59be['query'],_0x910137[_0x4db9('0x38')]));if(_0x5f59be['query'][_0x4db9('0x39')]){_0x5ce6cc['where']=_[_0x4db9('0x3a')](_0x5ce6cc[_0x4db9('0x37')],{'$or':_[_0x4db9('0x29')](_0x38d5e2,function(_0x10ccbc){if(_0x10ccbc[_0x4db9('0x3b')]!=='VIRTUAL'){var _0x1cf917={};_0x1cf917[_0x10ccbc['name']]={'$like':'%'+_0x5f59be[_0x4db9('0x2e')][_0x4db9('0x39')]+'%'};return _0x1cf917;}})});}_0x5ce6cc=_[_0x4db9('0x3a')]({},_0x5ce6cc,_0x5f59be[_0x4db9('0x3c')]);var _0x146850={'where':_0x5ce6cc[_0x4db9('0x37')]};return db['DeskField'][_0x4db9('0x1c')](_0x146850)[_0x4db9('0x23')](function(_0x5ba7df){_0x2653be['count']=_0x5ba7df;if(_0x5f59be[_0x4db9('0x2e')][_0x4db9('0x3d')]){_0x5ce6cc[_0x4db9('0x3e')]=[{'all':!![]}];}return db[_0x4db9('0x2a')][_0x4db9('0x3f')](_0x5ce6cc);})[_0x4db9('0x23')](function(_0x1a9fe7){_0x2653be[_0x4db9('0x40')]=_0x1a9fe7;return _0x2653be;})[_0x4db9('0x23')](respondWithFilteredResult(_0x1b2647,_0x5ce6cc))[_0x4db9('0x41')](handleError(_0x1b2647,null));};exports[_0x4db9('0x42')]=function(_0x3254d1,_0x489967){var _0x2716d6={'raw':!![],'where':{'id':_0x3254d1[_0x4db9('0x43')]['id']}},_0x4a2121={};_0x4a2121[_0x4db9('0x31')]=_['keys'](db['DeskField'][_0x4db9('0x2b')]);_0x4a2121[_0x4db9('0x2e')]=_[_0x4db9('0x2f')](_0x3254d1['query']);_0x4a2121[_0x4db9('0x38')]=_['intersection'](_0x4a2121[_0x4db9('0x31')],_0x4a2121[_0x4db9('0x2e')]);_0x2716d6[_0x4db9('0x32')]=_[_0x4db9('0x30')](_0x4a2121[_0x4db9('0x31')],qs['fields'](_0x3254d1[_0x4db9('0x2e')][_0x4db9('0x33')]));_0x2716d6[_0x4db9('0x32')]=_0x2716d6[_0x4db9('0x32')][_0x4db9('0x44')]?_0x2716d6['attributes']:_0x4a2121[_0x4db9('0x31')];if(_0x3254d1[_0x4db9('0x2e')][_0x4db9('0x3d')]){_0x2716d6[_0x4db9('0x3e')]=[{'all':!![]}];}_0x2716d6=_[_0x4db9('0x3a')]({},_0x2716d6,_0x3254d1[_0x4db9('0x3c')]);return db[_0x4db9('0x2a')][_0x4db9('0x45')](_0x2716d6)[_0x4db9('0x23')](handleEntityNotFound(_0x489967,null))['then'](respondWithResult(_0x489967,null))[_0x4db9('0x41')](handleError(_0x489967,null));};exports['create']=function(_0x53f3bb,_0x21d18d){return db[_0x4db9('0x2a')]['create'](_0x53f3bb['body'],{})[_0x4db9('0x23')](respondWithResult(_0x21d18d,0xc9))[_0x4db9('0x41')](handleError(_0x21d18d,null));};exports[_0x4db9('0x22')]=function(_0x7f0aac,_0x2c2c17){if(_0x7f0aac[_0x4db9('0x46')]['id']){delete _0x7f0aac[_0x4db9('0x46')]['id'];}return db[_0x4db9('0x2a')][_0x4db9('0x45')]({'where':{'id':_0x7f0aac[_0x4db9('0x43')]['id']}})[_0x4db9('0x23')](handleEntityNotFound(_0x2c2c17,null))['then'](saveUpdates(_0x7f0aac[_0x4db9('0x46')],null))[_0x4db9('0x23')](respondWithResult(_0x2c2c17,null))['catch'](handleError(_0x2c2c17,null));};exports[_0x4db9('0x24')]=function(_0x5a461d,_0x26ae1a){return db[_0x4db9('0x2a')][_0x4db9('0x45')]({'where':{'id':_0x5a461d[_0x4db9('0x43')]['id']}})[_0x4db9('0x23')](handleEntityNotFound(_0x26ae1a,null))[_0x4db9('0x23')](removeEntity(_0x26ae1a,null))[_0x4db9('0x41')](handleError(_0x26ae1a,null));}; \ No newline at end of file +var _0xe198=['apply','save','update','then','destroy','sendStatus','error','stack','name','send','map','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','DeskField','findAll','catch','include','find','create','body','params','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','json','count','offset','limit','status','set','Content-Range'];(function(_0x13fe0e,_0x583e6f){var _0x5879d1=function(_0x290b0e){while(--_0x290b0e){_0x13fe0e['push'](_0x13fe0e['shift']());}};_0x5879d1(++_0x583e6f);}(_0xe198,0x6f));var _0x8e19=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0xe198[_0x2064e5];return _0x21a233;};'use strict';var pdf=require(_0x8e19('0x0'));var emlformat=require(_0x8e19('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8e19('0x2'));var rp=require(_0x8e19('0x3'));var moment=require(_0x8e19('0x4'));var BPromise=require(_0x8e19('0x5'));var Mustache=require(_0x8e19('0x6'));var util=require('util');var path=require(_0x8e19('0x7'));var sox=require(_0x8e19('0x8'));var csv=require(_0x8e19('0x9'));var ejs=require(_0x8e19('0xa'));var fs=require('fs');var _=require(_0x8e19('0xb'));var squel=require(_0x8e19('0xc'));var crypto=require(_0x8e19('0xd'));var jsforce=require(_0x8e19('0xe'));var deskjs=require(_0x8e19('0xf'));var toCsv=require(_0x8e19('0x9'));var querystring=require(_0x8e19('0x10'));var Papa=require(_0x8e19('0x11'));var Redis=require(_0x8e19('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x8e19('0x13'));var as=require(_0x8e19('0x14'));var hardwareService=require(_0x8e19('0x15'));var logger=require(_0x8e19('0x16'))(_0x8e19('0x17'));var utils=require(_0x8e19('0x18'));var config=require(_0x8e19('0x19'));var db=require(_0x8e19('0x1a'))['db'];function respondWithStatusCode(_0x48433d,_0x51a0c4){_0x51a0c4=_0x51a0c4||0xcc;return function(_0x3f4a6d){if(_0x3f4a6d){return _0x48433d['sendStatus'](_0x51a0c4);}return _0x48433d['status'](_0x51a0c4)[_0x8e19('0x1b')]();};}function respondWithResult(_0x2c2d05,_0x16b584){_0x16b584=_0x16b584||0xc8;return function(_0x76ccdb){if(_0x76ccdb){return _0x2c2d05['status'](_0x16b584)[_0x8e19('0x1c')](_0x76ccdb);}};}function respondWithFilteredResult(_0x32f3ef,_0x5c474d){return function(_0x34a7c9){if(_0x34a7c9){var _0x319971=_0x34a7c9[_0x8e19('0x1d')],_0x4b2c05=_0x5c474d[_0x8e19('0x1e')],_0x325f54=_0x5c474d[_0x8e19('0x1e')]+_0x5c474d[_0x8e19('0x1f')],_0x33c590;if(_0x325f54>=_0x319971){_0x325f54=_0x319971;_0x33c590=0xc8;}else{_0x33c590=0xce;}_0x32f3ef[_0x8e19('0x20')](_0x33c590);return _0x32f3ef[_0x8e19('0x21')](_0x8e19('0x22'),_0x4b2c05+'-'+_0x325f54+'/'+_0x319971)[_0x8e19('0x1c')](_0x34a7c9);}return null;};}function patchUpdates(_0x18a9d0){return function(_0x1118f2){try{jsonpatch[_0x8e19('0x23')](_0x1118f2,_0x18a9d0,!![]);}catch(_0xba6a62){return BPromise['reject'](_0xba6a62);}return _0x1118f2[_0x8e19('0x24')]();};}function saveUpdates(_0x8d132c,_0x142265){return function(_0x314798){if(_0x314798){return _0x314798[_0x8e19('0x25')](_0x8d132c)[_0x8e19('0x26')](function(_0xed03e0){return _0xed03e0;});}return null;};}function removeEntity(_0x3db765,_0x473d03){return function(_0x1223c9){if(_0x1223c9){return _0x1223c9[_0x8e19('0x27')]()[_0x8e19('0x26')](function(){_0x3db765[_0x8e19('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x33d921,_0x556f61){return function(_0x54cd89){if(!_0x54cd89){_0x33d921[_0x8e19('0x28')](0x194);}return _0x54cd89;};}function handleError(_0x1d2e25,_0x157cca){_0x157cca=_0x157cca||0x1f4;return function(_0x4f7bed){logger[_0x8e19('0x29')](_0x4f7bed[_0x8e19('0x2a')]);if(_0x4f7bed[_0x8e19('0x2b')]){delete _0x4f7bed[_0x8e19('0x2b')];}_0x1d2e25[_0x8e19('0x20')](_0x157cca)[_0x8e19('0x2c')](_0x4f7bed);};}exports['index']=function(_0x43a860,_0x168cd3){var _0x25dd6b={},_0x2866cd={},_0x551feb={'count':0x0,'rows':[]};var _0x3a7557=_[_0x8e19('0x2d')](db['DeskField']['rawAttributes'],function(_0x329421){return{'name':_0x329421[_0x8e19('0x2e')],'type':_0x329421[_0x8e19('0x2f')][_0x8e19('0x30')]};});_0x2866cd[_0x8e19('0x31')]=_[_0x8e19('0x2d')](_0x3a7557,'name');_0x2866cd['query']=_[_0x8e19('0x32')](_0x43a860['query']);_0x2866cd[_0x8e19('0x33')]=_[_0x8e19('0x34')](_0x2866cd[_0x8e19('0x31')],_0x2866cd[_0x8e19('0x35')]);_0x25dd6b['attributes']=_[_0x8e19('0x34')](_0x2866cd[_0x8e19('0x31')],qs['fields'](_0x43a860['query'][_0x8e19('0x36')]));_0x25dd6b[_0x8e19('0x37')]=_0x25dd6b[_0x8e19('0x37')][_0x8e19('0x38')]?_0x25dd6b[_0x8e19('0x37')]:_0x2866cd[_0x8e19('0x31')];if(!_0x43a860[_0x8e19('0x35')][_0x8e19('0x39')]('nolimit')){_0x25dd6b[_0x8e19('0x1f')]=qs[_0x8e19('0x1f')](_0x43a860['query'][_0x8e19('0x1f')]);_0x25dd6b[_0x8e19('0x1e')]=qs[_0x8e19('0x1e')](_0x43a860[_0x8e19('0x35')][_0x8e19('0x1e')]);}_0x25dd6b[_0x8e19('0x3a')]=qs[_0x8e19('0x3b')](_0x43a860['query'][_0x8e19('0x3b')]);_0x25dd6b[_0x8e19('0x3c')]=qs[_0x8e19('0x33')](_[_0x8e19('0x3d')](_0x43a860[_0x8e19('0x35')],_0x2866cd[_0x8e19('0x33')]));if(_0x43a860[_0x8e19('0x35')][_0x8e19('0x3e')]){_0x25dd6b[_0x8e19('0x3c')]=_[_0x8e19('0x3f')](_0x25dd6b[_0x8e19('0x3c')],{'$or':_[_0x8e19('0x2d')](_0x3a7557,function(_0x518b89){if(_0x518b89[_0x8e19('0x2f')]!=='VIRTUAL'){var _0x4bab63={};_0x4bab63[_0x518b89['name']]={'$like':'%'+_0x43a860['query'][_0x8e19('0x3e')]+'%'};return _0x4bab63;}})});}_0x25dd6b=_[_0x8e19('0x3f')]({},_0x25dd6b,_0x43a860[_0x8e19('0x40')]);var _0xc15b5={'where':_0x25dd6b['where']};return db[_0x8e19('0x41')][_0x8e19('0x1d')](_0xc15b5)[_0x8e19('0x26')](function(_0x39aee0){_0x551feb[_0x8e19('0x1d')]=_0x39aee0;if(_0x43a860[_0x8e19('0x35')]['includeAll']){_0x25dd6b['include']=[{'all':!![]}];}return db[_0x8e19('0x41')][_0x8e19('0x42')](_0x25dd6b);})[_0x8e19('0x26')](function(_0x15b8be){_0x551feb['rows']=_0x15b8be;return _0x551feb;})[_0x8e19('0x26')](respondWithFilteredResult(_0x168cd3,_0x25dd6b))[_0x8e19('0x43')](handleError(_0x168cd3,null));};exports['show']=function(_0x860d35,_0x3ced59){var _0x4577db={'raw':!![],'where':{'id':_0x860d35['params']['id']}},_0x59d9c0={};_0x59d9c0[_0x8e19('0x31')]=_[_0x8e19('0x32')](db[_0x8e19('0x41')]['rawAttributes']);_0x59d9c0[_0x8e19('0x35')]=_[_0x8e19('0x32')](_0x860d35[_0x8e19('0x35')]);_0x59d9c0[_0x8e19('0x33')]=_['intersection'](_0x59d9c0[_0x8e19('0x31')],_0x59d9c0[_0x8e19('0x35')]);_0x4577db[_0x8e19('0x37')]=_[_0x8e19('0x34')](_0x59d9c0['model'],qs[_0x8e19('0x36')](_0x860d35[_0x8e19('0x35')][_0x8e19('0x36')]));_0x4577db[_0x8e19('0x37')]=_0x4577db[_0x8e19('0x37')][_0x8e19('0x38')]?_0x4577db[_0x8e19('0x37')]:_0x59d9c0[_0x8e19('0x31')];if(_0x860d35[_0x8e19('0x35')]['includeAll']){_0x4577db[_0x8e19('0x44')]=[{'all':!![]}];}_0x4577db=_['merge']({},_0x4577db,_0x860d35[_0x8e19('0x40')]);return db[_0x8e19('0x41')][_0x8e19('0x45')](_0x4577db)[_0x8e19('0x26')](handleEntityNotFound(_0x3ced59,null))[_0x8e19('0x26')](respondWithResult(_0x3ced59,null))[_0x8e19('0x43')](handleError(_0x3ced59,null));};exports[_0x8e19('0x46')]=function(_0x426ac7,_0x504007){return db[_0x8e19('0x41')][_0x8e19('0x46')](_0x426ac7[_0x8e19('0x47')],{})[_0x8e19('0x26')](respondWithResult(_0x504007,0xc9))[_0x8e19('0x43')](handleError(_0x504007,null));};exports[_0x8e19('0x25')]=function(_0x1bb5c8,_0x3edb29){if(_0x1bb5c8[_0x8e19('0x47')]['id']){delete _0x1bb5c8['body']['id'];}return db[_0x8e19('0x41')][_0x8e19('0x45')]({'where':{'id':_0x1bb5c8[_0x8e19('0x48')]['id']}})[_0x8e19('0x26')](handleEntityNotFound(_0x3edb29,null))[_0x8e19('0x26')](saveUpdates(_0x1bb5c8[_0x8e19('0x47')],null))[_0x8e19('0x26')](respondWithResult(_0x3edb29,null))['catch'](handleError(_0x3edb29,null));};exports['destroy']=function(_0x511c11,_0x22f71b){return db[_0x8e19('0x41')][_0x8e19('0x45')]({'where':{'id':_0x511c11[_0x8e19('0x48')]['id']}})[_0x8e19('0x26')](handleEntityNotFound(_0x22f71b,null))['then'](removeEntity(_0x22f71b,null))[_0x8e19('0x43')](handleError(_0x22f71b,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 84184da..2cbf0d9 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 _0x090a=['int_desk_fields','desk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./intDeskField.attributes','define'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0x090a,0xc8));var _0xa090=function(_0x463a3c,_0x47c2ae){_0x463a3c=_0x463a3c-0x0;var _0x41186b=_0x090a[_0x463a3c];return _0x41186b;};'use strict';var _=require(_0xa090('0x0'));var util=require(_0xa090('0x1'));var logger=require(_0xa090('0x2'))(_0xa090('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa090('0x4'));var fs=require('fs');var path=require(_0xa090('0x5'));var rimraf=require(_0xa090('0x6'));var config=require(_0xa090('0x7'));var attributes=require(_0xa090('0x8'));module['exports']=function(_0x123e6b,_0x7bcfed){return _0x123e6b[_0xa090('0x9')]('DeskField',attributes,{'tableName':_0xa090('0xa'),'paranoid':![],'indexes':[{'name':_0xa090('0xb'),'fields':[_0xa090('0xc'),_0xa090('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf547=['moment','path','./intDeskField.attributes','define','DeskField','int_desk_fields','idField','FieldId','lodash','util','../../config/logger','api'];(function(_0x230009,_0x1789f8){var _0x1e795a=function(_0x1d2afd){while(--_0x1d2afd){_0x230009['push'](_0x230009['shift']());}};_0x1e795a(++_0x1789f8);}(_0xf547,0x134));var _0x7f54=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xf547[_0x481bf7];return _0x461787;};'use strict';var _=require(_0x7f54('0x0'));var util=require(_0x7f54('0x1'));var logger=require(_0x7f54('0x2'))(_0x7f54('0x3'));var moment=require(_0x7f54('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7f54('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7f54('0x6'));module['exports']=function(_0x220fb8,_0x2082fc){return _0x220fb8[_0x7f54('0x7')](_0x7f54('0x8'),attributes,{'tableName':_0x7f54('0x9'),'paranoid':![],'indexes':[{'name':'desk_unique_index','fields':[_0x7f54('0xa'),_0x7f54('0xb')],'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 0dcfeaf..c43b88d 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 _0xe10a=['../../config/environment','jayson/promise','client','request','DeskField,\x20%s,\x20%s','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x373cd0,_0x1ba136){var _0x31c43a=function(_0x5b0662){while(--_0x5b0662){_0x373cd0['push'](_0x373cd0['shift']());}};_0x31c43a(++_0x1ba136);}(_0xe10a,0x66));var _0xae10=function(_0xc5ab53,_0x25bfcc){_0xc5ab53=_0xc5ab53-0x0;var _0x1ccec9=_0xe10a[_0xc5ab53];return _0x1ccec9;};'use strict';var _=require(_0xae10('0x0'));var util=require('util');var moment=require(_0xae10('0x1'));var BPromise=require('bluebird');var rs=require(_0xae10('0x2'));var fs=require('fs');var Redis=require(_0xae10('0x3'));var db=require(_0xae10('0x4'))['db'];var utils=require(_0xae10('0x5'));var logger=require(_0xae10('0x6'))(_0xae10('0x7'));var config=require(_0xae10('0x8'));var jayson=require(_0xae10('0x9'));var client=jayson[_0xae10('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x18391b,_0x10deab,_0x4a0d40){return new BPromise(function(_0x2510b3,_0xbae60a){return client[_0xae10('0xb')](_0x18391b,_0x4a0d40)['then'](function(_0x2c0733){logger['info'](_0xae10('0xc'),_0x10deab,'request\x20sent');logger[_0xae10('0xd')](_0xae10('0xe'),_0x10deab,'request\x20sent',JSON[_0xae10('0xf')](_0x2c0733));if(_0x2c0733[_0xae10('0x10')]){if(_0x2c0733[_0xae10('0x10')][_0xae10('0x11')]===0x1f4){logger[_0xae10('0x10')](_0xae10('0xc'),_0x10deab,_0x2c0733[_0xae10('0x10')][_0xae10('0x12')]);return _0xbae60a(_0x2c0733['error']['message']);}logger[_0xae10('0x10')](_0xae10('0xc'),_0x10deab,_0x2c0733['error'][_0xae10('0x12')]);return _0x2510b3(_0x2c0733[_0xae10('0x10')][_0xae10('0x12')]);}else{logger[_0xae10('0x13')](_0xae10('0xc'),_0x10deab,_0xae10('0x14'));_0x2510b3(_0x2c0733['result'][_0xae10('0x12')]);}})[_0xae10('0x15')](function(_0x4f510f){logger[_0xae10('0x10')]('DeskField,\x20%s,\x20%s',_0x10deab,_0x4f510f);_0xbae60a(_0x4f510f);});});} \ No newline at end of file +var _0x6779=['stringify','error','DeskField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s'];(function(_0x9c2427,_0x17c865){var _0x51984f=function(_0x177af6){while(--_0x177af6){_0x9c2427['push'](_0x9c2427['shift']());}};_0x51984f(++_0x17c865);}(_0x6779,0x156));var _0x9677=function(_0x28c3c9,_0x1c53f7){_0x28c3c9=_0x28c3c9-0x0;var _0x132451=_0x6779[_0x28c3c9];return _0x132451;};'use strict';var _=require(_0x9677('0x0'));var util=require(_0x9677('0x1'));var moment=require(_0x9677('0x2'));var BPromise=require(_0x9677('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9677('0x4'));var db=require(_0x9677('0x5'))['db'];var utils=require(_0x9677('0x6'));var logger=require(_0x9677('0x7'))(_0x9677('0x8'));var config=require(_0x9677('0x9'));var jayson=require(_0x9677('0xa'));var client=jayson[_0x9677('0xb')][_0x9677('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4e4088,_0xd18a1f,_0x1816bd){return new BPromise(function(_0x511d82,_0x52785a){return client['request'](_0x4e4088,_0x1816bd)[_0x9677('0xd')](function(_0x230f92){logger[_0x9677('0xe')]('DeskField,\x20%s,\x20%s',_0xd18a1f,_0x9677('0xf'));logger[_0x9677('0x10')](_0x9677('0x11'),_0xd18a1f,'request\x20sent',JSON[_0x9677('0x12')](_0x230f92));if(_0x230f92[_0x9677('0x13')]){if(_0x230f92[_0x9677('0x13')]['code']===0x1f4){logger[_0x9677('0x13')](_0x9677('0x14'),_0xd18a1f,_0x230f92[_0x9677('0x13')][_0x9677('0x15')]);return _0x52785a(_0x230f92[_0x9677('0x13')][_0x9677('0x15')]);}logger[_0x9677('0x13')]('DeskField,\x20%s,\x20%s',_0xd18a1f,_0x230f92[_0x9677('0x13')][_0x9677('0x15')]);return _0x511d82(_0x230f92[_0x9677('0x13')][_0x9677('0x15')]);}else{logger[_0x9677('0xe')]('DeskField,\x20%s,\x20%s',_0xd18a1f,_0x9677('0xf'));_0x511d82(_0x230f92[_0x9677('0x16')][_0x9677('0x15')]);}})[_0x9677('0x17')](function(_0xea5ce4){logger[_0x9677('0x13')](_0x9677('0x14'),_0xd18a1f,_0xea5ce4);_0x52785a(_0xea5ce4);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 104aded..81e8b61 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 _0xd4d4=['./intDynamics365Account.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','update','delete','exports','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd4d4,0x177));var _0x4d4d=function(_0x4fd423,_0xa6f26b){_0x4fd423=_0x4fd423-0x0;var _0x48289a=_0xd4d4[_0x4fd423];return _0x48289a;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x4d4d('0x0'));var express=require(_0x4d4d('0x1'));var router=express[_0x4d4d('0x2')]();var auth=require(_0x4d4d('0x3'));var interaction=require(_0x4d4d('0x4'));var config=require('../../config/environment');var controller=require(_0x4d4d('0x5'));router[_0x4d4d('0x6')]('/',auth[_0x4d4d('0x7')](),controller[_0x4d4d('0x8')]);router[_0x4d4d('0x6')](_0x4d4d('0x9'),auth[_0x4d4d('0x7')](),controller['show']);router[_0x4d4d('0x6')](_0x4d4d('0xa'),auth[_0x4d4d('0x7')](),controller[_0x4d4d('0xb')]);router[_0x4d4d('0x6')](_0x4d4d('0xc'),auth[_0x4d4d('0x7')](),controller[_0x4d4d('0xd')]);router[_0x4d4d('0xe')]('/',auth[_0x4d4d('0x7')](),controller['create']);router[_0x4d4d('0xe')](_0x4d4d('0xa'),auth['isAuthenticated'](),controller[_0x4d4d('0xf')]);router['put'](_0x4d4d('0x9'),auth[_0x4d4d('0x7')](),controller[_0x4d4d('0x10')]);router[_0x4d4d('0x11')](_0x4d4d('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x4d4d('0x12')]=router; \ No newline at end of file +var _0xf32d=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','getConfigurations','getFields','post','create','/:id/configurations','addConfiguration','update','destroy','multer','util','express','../../components/auth/service'];(function(_0x13caa1,_0x4efa0e){var _0xec68be=function(_0x3acd62){while(--_0x3acd62){_0x13caa1['push'](_0x13caa1['shift']());}};_0xec68be(++_0x4efa0e);}(_0xf32d,0xe6));var _0xdf32=function(_0x37ea19,_0x22a4ea){_0x37ea19=_0x37ea19-0x0;var _0x4ced04=_0xf32d[_0x37ea19];return _0x4ced04;};'use strict';var multer=require(_0xdf32('0x0'));var util=require(_0xdf32('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xdf32('0x2'));var router=express['Router']();var auth=require(_0xdf32('0x3'));var interaction=require(_0xdf32('0x4'));var config=require(_0xdf32('0x5'));var controller=require('./intDynamics365Account.controller');router[_0xdf32('0x6')]('/',auth[_0xdf32('0x7')](),controller[_0xdf32('0x8')]);router[_0xdf32('0x6')](_0xdf32('0x9'),auth[_0xdf32('0x7')](),controller['show']);router['get']('/:id/configurations',auth[_0xdf32('0x7')](),controller[_0xdf32('0xa')]);router['get']('/:id/fields',auth[_0xdf32('0x7')](),controller[_0xdf32('0xb')]);router[_0xdf32('0xc')]('/',auth['isAuthenticated'](),controller[_0xdf32('0xd')]);router[_0xdf32('0xc')](_0xdf32('0xe'),auth[_0xdf32('0x7')](),controller[_0xdf32('0xf')]);router['put'](_0xdf32('0x9'),auth[_0xdf32('0x7')](),controller[_0xdf32('0x10')]);router['delete'](_0xdf32('0x9'),auth[_0xdf32('0x7')](),controller[_0xdf32('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index ccc7429..9d7d3bb 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 _0xabd8=['STRING','sequelize','exports'];(function(_0x4c7645,_0x49d3ab){var _0x59d1fc=function(_0xb7553f){while(--_0xb7553f){_0x4c7645['push'](_0x4c7645['shift']());}};_0x59d1fc(++_0x49d3ab);}(_0xabd8,0x184));var _0x8abd=function(_0x44216d,_0x4938a7){_0x44216d=_0x44216d-0x0;var _0xeca523=_0xabd8[_0x44216d];return _0xeca523;};'use strict';var Sequelize=require(_0x8abd('0x0'));module[_0x8abd('0x1')]={'name':{'type':Sequelize[_0x8abd('0x2')]},'username':{'type':Sequelize[_0x8abd('0x2')]},'password':{'type':Sequelize[_0x8abd('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize[_0x8abd('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x8abd('0x2')]},'serverUrl':{'type':Sequelize[_0x8abd('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf22d=['exports','STRING','sequelize'];(function(_0x51288f,_0xfb4a61){var _0x50dbe7=function(_0x96eff){while(--_0x96eff){_0x51288f['push'](_0x51288f['shift']());}};_0x50dbe7(++_0xfb4a61);}(_0xf22d,0x1d3));var _0xdf22=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0xf22d[_0x13e741];return _0x3f8bb3;};'use strict';var Sequelize=require(_0xdf22('0x0'));module[_0xdf22('0x1')]={'name':{'type':Sequelize[_0xdf22('0x2')]},'username':{'type':Sequelize[_0xdf22('0x2')]},'password':{'type':Sequelize[_0xdf22('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize[_0xdf22('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0xdf22('0x2')]},'serverUrl':{'type':Sequelize[_0xdf22('0x2')]},'description':{'type':Sequelize[_0xdf22('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 826e27e..51c810e 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 _0x8107=['Label','UserLocalizedLabel','Value','LogicalName','OptionSet','FalseOption','false','DisplayName','?$select=DisplayName,LogicalName','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','Dynamics365Account,\x20%s,\x20%s','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','json','offset','limit','status','set','Content-Range','reject','save','update','destroy','stack','name','send','map','Dynamics365Account','fieldName','key','keys','filters','intersection','model','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','VIRTUAL','count','include','findAll','rows','show','rawAttributes','includeAll','create','body','params','find','getConfigurations','findOne','merge','options','addConfiguration','getSubjects','channel','Descriptions','Dynamics365Configuration','Dynamics365Field','getFields','ticketType','incident','Incident','title','description','customerid','ownerid','caseorigincode','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyyominame','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','modifiedbyexternalpartyname','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','onholdtime','overriddencreatedon','owneridname','owneridtype','primarycontactidname','prioritycodename','productserialnumber','resolveby','resolvebykpiidname','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','ticketnumber','timezoneruleversionnumber','utcconversiontimezonecode','versionnumber','concat','username','tenantId','clientId','remoteUri','slice','lastIndexOf','format','POST','https://login.microsoftonline.com/','/oauth2/token','password','clientSecret','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','MetadataId','GET','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','includes','forEach','@odata.type','substring','PicklistAttributeMetadata','all','isNil','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','push','test','statusCode','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','Options'];(function(_0x49fb35,_0x121edc){var _0xd05ed7=function(_0x593b7d){while(--_0x593b7d){_0x49fb35['push'](_0x49fb35['shift']());}};_0xd05ed7(++_0x121edc);}(_0x8107,0x1bd));var _0x7810=function(_0x592a9d,_0x434abb){_0x592a9d=_0x592a9d-0x0;var _0x59d2b3=_0x8107[_0x592a9d];return _0x59d2b3;};'use strict';var pdf=require(_0x7810('0x0'));var emlformat=require(_0x7810('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x7810('0x2'));var jsonpatch=require(_0x7810('0x3'));var rp=require(_0x7810('0x4'));var moment=require(_0x7810('0x5'));var BPromise=require(_0x7810('0x6'));var Mustache=require(_0x7810('0x7'));var util=require(_0x7810('0x8'));var path=require('path');var sox=require(_0x7810('0x9'));var csv=require(_0x7810('0xa'));var ejs=require(_0x7810('0xb'));var fs=require('fs');var _=require(_0x7810('0xc'));var squel=require(_0x7810('0xd'));var crypto=require(_0x7810('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x7810('0xf'));var toCsv=require(_0x7810('0xa'));var querystring=require(_0x7810('0x10'));var Papa=require('papaparse');var Redis=require(_0x7810('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x7810('0x12'));var as=require(_0x7810('0x13'));var hardwareService=require(_0x7810('0x14'));var logger=require(_0x7810('0x15'))(_0x7810('0x16'));var utils=require(_0x7810('0x17'));var config=require(_0x7810('0x18'));var db=require(_0x7810('0x19'))['db'];var integrations=require(_0x7810('0x1a'));var jayson=require(_0x7810('0x1b'));var client=jayson[_0x7810('0x1c')]['http']({'port':0x232a});function checkPasswordPattern(_0x192a6d,_0x2f8b7b,_0x1405b9){if(_0x1405b9){var _0x474708=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x474708['test'](_0x2f8b7b)){return _0x192a6d;}else{throw new db[(_0x7810('0x1d'))][(_0x7810('0x1e'))](_0x7810('0x1f'));}}else{return _0x192a6d;}}function respondWithRpcPromise(_0x531e31,_0x2d64a4,_0x828bb5,_0x309493){return new BPromise(function(_0x93e73f,_0x111132){var _0x1c9813=_0x309493||client;return _0x1c9813[_0x7810('0x20')](_0x531e31,_0x828bb5)[_0x7810('0x21')](function(_0x33f1e1){logger['info'](_0x7810('0x22'),_0x2d64a4,_0x7810('0x23'));logger['debug'](_0x7810('0x24'),_0x2d64a4,_0x7810('0x23'),JSON[_0x7810('0x25')](_0x33f1e1));if(_0x33f1e1['error']){if(_0x33f1e1[_0x7810('0x26')][_0x7810('0x27')]===0x1f4){logger[_0x7810('0x26')]('Dynamics365Account,\x20%s,\x20%s',_0x2d64a4,_0x33f1e1[_0x7810('0x26')]['message']);return _0x111132(_0x33f1e1[_0x7810('0x26')][_0x7810('0x28')]);}logger[_0x7810('0x26')]('Dynamics365Account,\x20%s,\x20%s',_0x2d64a4,_0x33f1e1[_0x7810('0x26')][_0x7810('0x28')]);return _0x93e73f(_0x33f1e1[_0x7810('0x26')][_0x7810('0x28')]);}else{logger['info'](_0x7810('0x22'),_0x2d64a4,_0x7810('0x23'));_0x93e73f(_0x33f1e1[_0x7810('0x29')][_0x7810('0x28')]);}})[_0x7810('0x2a')](function(_0x56eaf7){logger[_0x7810('0x26')](_0x7810('0x22'),_0x2d64a4,_0x56eaf7);_0x111132(_0x56eaf7);});});}function respondWithStatusCode(_0x552325,_0x21a563){_0x21a563=_0x21a563||0xcc;return function(_0x363b66){if(_0x363b66){return _0x552325[_0x7810('0x2b')](_0x21a563);}return _0x552325['status'](_0x21a563)[_0x7810('0x2c')]();};}function respondWithResult(_0x459709,_0x2cf8f6){_0x2cf8f6=_0x2cf8f6||0xc8;return function(_0x1a0324){if(_0x1a0324){return _0x459709['status'](_0x2cf8f6)[_0x7810('0x2d')](_0x1a0324);}};}function respondWithFilteredResult(_0x57aa10,_0x555b44){return function(_0x5165aa){if(_0x5165aa){var _0x49897f=_0x5165aa['count'],_0x15d473=_0x555b44[_0x7810('0x2e')],_0x1362d8=_0x555b44[_0x7810('0x2e')]+_0x555b44[_0x7810('0x2f')],_0x2878dc;if(_0x1362d8>=_0x49897f){_0x1362d8=_0x49897f;_0x2878dc=0xc8;}else{_0x2878dc=0xce;}_0x57aa10[_0x7810('0x30')](_0x2878dc);return _0x57aa10[_0x7810('0x31')](_0x7810('0x32'),_0x15d473+'-'+_0x1362d8+'/'+_0x49897f)[_0x7810('0x2d')](_0x5165aa);}return null;};}function patchUpdates(_0x3faa59){return function(_0x3a785c){try{jsonpatch['apply'](_0x3a785c,_0x3faa59,!![]);}catch(_0x348971){return BPromise[_0x7810('0x33')](_0x348971);}return _0x3a785c[_0x7810('0x34')]();};}function saveUpdates(_0x5d7ca7,_0xc6680e){return function(_0x491bda){if(_0x491bda){return _0x491bda[_0x7810('0x35')](_0x5d7ca7)[_0x7810('0x21')](function(_0x36923c){return _0x36923c;});}return null;};}function removeEntity(_0xe9a51e,_0x384e16){return function(_0x47ff5e){if(_0x47ff5e){return _0x47ff5e[_0x7810('0x36')]()[_0x7810('0x21')](function(){_0xe9a51e[_0x7810('0x30')](0xcc)[_0x7810('0x2c')]();});}};}function handleEntityNotFound(_0x69b430,_0xe3434c){return function(_0x3fea25){if(!_0x3fea25){_0x69b430['sendStatus'](0x194);}return _0x3fea25;};}function handleError(_0x4850af,_0x404df0){_0x404df0=_0x404df0||0x1f4;return function(_0xc2112e){logger['error'](_0xc2112e[_0x7810('0x37')]);if(_0xc2112e[_0x7810('0x38')]){delete _0xc2112e[_0x7810('0x38')];}_0x4850af[_0x7810('0x30')](_0x404df0)[_0x7810('0x39')](_0xc2112e);};}exports['index']=function(_0x2b9f80,_0x24d01a){var _0x2c9977={},_0x319f5e={},_0x95433c={'count':0x0,'rows':[]};var _0x5d81d5=_[_0x7810('0x3a')](db[_0x7810('0x3b')]['rawAttributes'],function(_0x8705d4){return{'name':_0x8705d4[_0x7810('0x3c')],'type':_0x8705d4['type'][_0x7810('0x3d')]};});_0x319f5e['model']=_[_0x7810('0x3a')](_0x5d81d5,_0x7810('0x38'));_0x319f5e['query']=_[_0x7810('0x3e')](_0x2b9f80['query']);_0x319f5e[_0x7810('0x3f')]=_[_0x7810('0x40')](_0x319f5e[_0x7810('0x41')],_0x319f5e[_0x7810('0x42')]);_0x2c9977['attributes']=_[_0x7810('0x40')](_0x319f5e[_0x7810('0x41')],qs[_0x7810('0x43')](_0x2b9f80[_0x7810('0x42')][_0x7810('0x43')]));_0x2c9977[_0x7810('0x44')]=_0x2c9977[_0x7810('0x44')][_0x7810('0x45')]?_0x2c9977['attributes']:_0x319f5e[_0x7810('0x41')];if(!_0x2b9f80[_0x7810('0x42')][_0x7810('0x46')](_0x7810('0x47'))){_0x2c9977[_0x7810('0x2f')]=qs['limit'](_0x2b9f80[_0x7810('0x42')][_0x7810('0x2f')]);_0x2c9977[_0x7810('0x2e')]=qs[_0x7810('0x2e')](_0x2b9f80[_0x7810('0x42')][_0x7810('0x2e')]);}_0x2c9977[_0x7810('0x48')]=qs[_0x7810('0x49')](_0x2b9f80[_0x7810('0x42')][_0x7810('0x49')]);_0x2c9977['where']=qs[_0x7810('0x3f')](_[_0x7810('0x4a')](_0x2b9f80[_0x7810('0x42')],_0x319f5e[_0x7810('0x3f')]));if(_0x2b9f80[_0x7810('0x42')][_0x7810('0x4b')]){_0x2c9977[_0x7810('0x4c')]=_['merge'](_0x2c9977[_0x7810('0x4c')],{'$or':_[_0x7810('0x3a')](_0x5d81d5,function(_0x5c4669){if(_0x5c4669[_0x7810('0x4d')]!==_0x7810('0x4e')){var _0x75a0d6={};_0x75a0d6[_0x5c4669[_0x7810('0x38')]]={'$like':'%'+_0x2b9f80[_0x7810('0x42')][_0x7810('0x4b')]+'%'};return _0x75a0d6;}})});}_0x2c9977=_['merge']({},_0x2c9977,_0x2b9f80['options']);var _0x164e8b={'where':_0x2c9977[_0x7810('0x4c')]};return db[_0x7810('0x3b')][_0x7810('0x4f')](_0x164e8b)[_0x7810('0x21')](function(_0x318536){_0x95433c[_0x7810('0x4f')]=_0x318536;if(_0x2b9f80[_0x7810('0x42')]['includeAll']){_0x2c9977[_0x7810('0x50')]=[{'all':!![]}];}return db[_0x7810('0x3b')][_0x7810('0x51')](_0x2c9977);})[_0x7810('0x21')](function(_0x1528c3){_0x95433c[_0x7810('0x52')]=_0x1528c3;return _0x95433c;})[_0x7810('0x21')](respondWithFilteredResult(_0x24d01a,_0x2c9977))[_0x7810('0x2a')](handleError(_0x24d01a,null));};exports[_0x7810('0x53')]=function(_0x55406d,_0x36ecbf){var _0x495fdb={'raw':![],'where':{'id':_0x55406d['params']['id']}},_0x33d731={};_0x33d731['model']=_[_0x7810('0x3e')](db['Dynamics365Account'][_0x7810('0x54')]);_0x33d731[_0x7810('0x42')]=_['keys'](_0x55406d[_0x7810('0x42')]);_0x33d731['filters']=_[_0x7810('0x40')](_0x33d731[_0x7810('0x41')],_0x33d731[_0x7810('0x42')]);_0x495fdb[_0x7810('0x44')]=_[_0x7810('0x40')](_0x33d731[_0x7810('0x41')],qs[_0x7810('0x43')](_0x55406d[_0x7810('0x42')][_0x7810('0x43')]));_0x495fdb[_0x7810('0x44')]=_0x495fdb[_0x7810('0x44')][_0x7810('0x45')]?_0x495fdb[_0x7810('0x44')]:_0x33d731[_0x7810('0x41')];if(_0x55406d['query'][_0x7810('0x55')]){_0x495fdb[_0x7810('0x50')]=[{'all':!![]}];}_0x495fdb=_['merge']({},_0x495fdb,_0x55406d['options']);return db[_0x7810('0x3b')]['find'](_0x495fdb)['then'](handleEntityNotFound(_0x36ecbf,null))['then'](respondWithResult(_0x36ecbf,null))[_0x7810('0x2a')](handleError(_0x36ecbf,null));};exports[_0x7810('0x56')]=function(_0x281a0a,_0x31fe31){return db[_0x7810('0x3b')][_0x7810('0x56')](_0x281a0a[_0x7810('0x57')],{})[_0x7810('0x21')](respondWithResult(_0x31fe31,0xc9))[_0x7810('0x2a')](handleError(_0x31fe31,null));};exports[_0x7810('0x35')]=function(_0x1d16cb,_0x335e16){if(_0x1d16cb[_0x7810('0x57')]['id']){delete _0x1d16cb[_0x7810('0x57')]['id'];}return db['Dynamics365Account']['find']({'where':{'id':_0x1d16cb[_0x7810('0x58')]['id']}})[_0x7810('0x21')](handleEntityNotFound(_0x335e16,null))[_0x7810('0x21')](saveUpdates(_0x1d16cb['body'],null))['then'](respondWithResult(_0x335e16,null))[_0x7810('0x2a')](handleError(_0x335e16,null));};exports[_0x7810('0x36')]=function(_0x4315bf,_0xe5708){return db[_0x7810('0x3b')][_0x7810('0x59')]({'where':{'id':_0x4315bf[_0x7810('0x58')]['id']}})[_0x7810('0x21')](handleEntityNotFound(_0xe5708,null))['then'](removeEntity(_0xe5708,null))[_0x7810('0x2a')](handleError(_0xe5708,null));};exports[_0x7810('0x5a')]=function(_0x441e61,_0x9adf03,_0xeb40fe){var _0x7e5dae={};var _0x4463d3={};var _0x335d72;var _0x27daec;return db[_0x7810('0x3b')][_0x7810('0x5b')]({'where':{'id':_0x441e61['params']['id']}})[_0x7810('0x21')](handleEntityNotFound(_0x9adf03,null))[_0x7810('0x21')](function(_0x5a70bb){if(_0x5a70bb){_0x335d72=_0x5a70bb;_0x4463d3[_0x7810('0x41')]=_[_0x7810('0x3e')](db['Dynamics365Configuration'][_0x7810('0x54')]);_0x4463d3[_0x7810('0x42')]=_[_0x7810('0x3e')](_0x441e61[_0x7810('0x42')]);_0x4463d3[_0x7810('0x3f')]=_['intersection'](_0x4463d3[_0x7810('0x41')],_0x4463d3[_0x7810('0x42')]);_0x7e5dae[_0x7810('0x44')]=_['intersection'](_0x4463d3['model'],qs['fields'](_0x441e61[_0x7810('0x42')][_0x7810('0x43')]));_0x7e5dae['attributes']=_0x7e5dae['attributes'][_0x7810('0x45')]?_0x7e5dae[_0x7810('0x44')]:_0x4463d3[_0x7810('0x41')];_0x7e5dae['order']=qs[_0x7810('0x49')](_0x441e61['query'][_0x7810('0x49')]);_0x7e5dae['where']=qs['filters'](_['pick'](_0x441e61['query'],_0x4463d3[_0x7810('0x3f')]));if(_0x441e61[_0x7810('0x42')][_0x7810('0x4b')]){_0x7e5dae['where']=_[_0x7810('0x5c')](_0x7e5dae['where'],{'$or':_[_0x7810('0x3a')](_0x7e5dae[_0x7810('0x44')],function(_0x408818){var _0x4d1448={};_0x4d1448[_0x408818]={'$like':'%'+_0x441e61[_0x7810('0x42')][_0x7810('0x4b')]+'%'};return _0x4d1448;})});}_0x7e5dae=_[_0x7810('0x5c')]({},_0x7e5dae,_0x441e61[_0x7810('0x5d')]);return _0x335d72[_0x7810('0x5a')](_0x7e5dae);}})['then'](function(_0x57c615){if(_0x57c615){_0x27daec=_0x57c615[_0x7810('0x45')];if(!_0x441e61[_0x7810('0x42')][_0x7810('0x46')](_0x7810('0x47'))){_0x7e5dae['limit']=qs[_0x7810('0x2f')](_0x441e61[_0x7810('0x42')][_0x7810('0x2f')]);_0x7e5dae[_0x7810('0x2e')]=qs[_0x7810('0x2e')](_0x441e61[_0x7810('0x42')][_0x7810('0x2e')]);}return _0x335d72[_0x7810('0x5a')](_0x7e5dae);}})[_0x7810('0x21')](function(_0x55b711){if(_0x55b711){return _0x55b711?{'count':_0x27daec,'rows':_0x55b711}:null;}})[_0x7810('0x21')](respondWithResult(_0x9adf03,null))[_0x7810('0x2a')](handleError(_0x9adf03,null));};exports[_0x7810('0x5e')]=function(_0x16885f,_0x27ebf7,_0x2fc414){if(_0x16885f[_0x7810('0x57')]['id']){delete _0x16885f[_0x7810('0x57')]['id'];}return db[_0x7810('0x3b')][_0x7810('0x5b')]({'where':{'id':_0x16885f[_0x7810('0x58')]['id']}})['then'](handleEntityNotFound(_0x27ebf7,null))[_0x7810('0x21')](function(_0x1282a6){if(_0x1282a6){_0x16885f[_0x7810('0x57')]['AccountId']=_0x1282a6['id'];_0x16885f[_0x7810('0x57')]['Subjects']=integrations[_0x7810('0x5f')](_0x16885f[_0x7810('0x57')][_0x7810('0x60')],_0x16885f[_0x7810('0x57')][_0x7810('0x4d')]);_0x16885f['body'][_0x7810('0x61')]=integrations['getDescriptions'](_0x16885f[_0x7810('0x57')][_0x7810('0x60')],_0x16885f[_0x7810('0x57')][_0x7810('0x4d')]);return db[_0x7810('0x62')][_0x7810('0x56')](_0x16885f[_0x7810('0x57')],{'include':[{'model':db[_0x7810('0x63')],'as':'Subjects'},{'model':db[_0x7810('0x63')],'as':_0x7810('0x61')}]});}return null;})[_0x7810('0x21')](respondWithResult(_0x27ebf7,null))['catch'](handleError(_0x27ebf7,null));};exports[_0x7810('0x64')]=function(_0x9d05b7,_0x2ebad7,_0x21cac2){var _0x3df493=_0x9d05b7[_0x7810('0x42')][_0x7810('0x65')];var _0x5d56b7=_0x3df493===_0x7810('0x66')?_0x7810('0x67'):'PhoneCall';var _0x247025='';var _0x7ffed2='';var _0x39ab85='';var _0x299e95='';var _0x53289b='';var _0x5061f0='';var _0x33def1='';var _0x54d5c7='';var _0x554719=[_0x7810('0x68'),_0x7810('0x69'),_0x7810('0x6a'),_0x7810('0x6b'),_0x7810('0x6c'),'subject',_0x7810('0x6d'),_0x7810('0x6e'),_0x7810('0x6f'),_0x7810('0x70')];var _0x4f0f9f=[_0x7810('0x71'),_0x7810('0x72'),_0x7810('0x73'),_0x7810('0x74'),_0x7810('0x75'),_0x7810('0x76'),'contractdetailidname',_0x7810('0x77'),_0x7810('0x78'),_0x7810('0x79'),'createdbyname',_0x7810('0x7a'),'createdon','createdonbehalfbyname',_0x7810('0x7b'),_0x7810('0x7c'),_0x7810('0x7d'),_0x7810('0x7e'),_0x7810('0x7f'),_0x7810('0x80'),_0x7810('0x81'),'entityimage_url','escalatedon',_0x7810('0x82'),_0x7810('0x83'),_0x7810('0x84'),_0x7810('0x85'),_0x7810('0x86'),_0x7810('0x87'),_0x7810('0x88'),'masteridname',_0x7810('0x89'),'modifiedbyexternalpartyyominame',_0x7810('0x8a'),_0x7810('0x8b'),_0x7810('0x8c'),_0x7810('0x8d'),_0x7810('0x8e'),_0x7810('0x8f'),_0x7810('0x90'),'numberofchildincidents',_0x7810('0x91'),_0x7810('0x92'),_0x7810('0x93'),_0x7810('0x94'),'owneridyominame','parentcaseidname',_0x7810('0x95'),'primarycontactidyominame',_0x7810('0x96'),'productidname',_0x7810('0x97'),_0x7810('0x98'),_0x7810('0x99'),'responseby',_0x7810('0x9a'),_0x7810('0x9b'),_0x7810('0x9c'),_0x7810('0x9d'),_0x7810('0x9e'),_0x7810('0x9f'),_0x7810('0xa0'),_0x7810('0xa1'),'subjectidname',_0x7810('0xa2'),_0x7810('0xa3'),'transactioncurrencyidname','traversedpath',_0x7810('0xa4'),_0x7810('0xa5')];var _0x343899=_0x554719[_0x7810('0xa6')](_0x4f0f9f);return db[_0x7810('0x3b')][_0x7810('0x5b')]({'where':{'id':_0x9d05b7['params']['id']},'attributes':['id',_0x7810('0xa7'),'password','remoteUri',_0x7810('0xa8'),_0x7810('0xa9'),'clientSecret']})['then'](handleEntityNotFound(_0x2ebad7,null))[_0x7810('0x21')](function(_0x50a64a){if(_0x50a64a){_0x54d5c7=_0x50a64a[_0x7810('0xaa')];var _0x132251=_0x54d5c7[_0x7810('0xab')](-0x1);if(_0x132251==='/'){_0x54d5c7=_0x54d5c7['substring'](0x0,_0x54d5c7[_0x7810('0xac')](_0x132251));}_0x33def1=util[_0x7810('0xad')]('%s/api/data/v9.0/',_0x54d5c7);var _0x1789de={'method':_0x7810('0xae'),'uri':_0x7810('0xaf')+_0x50a64a[_0x7810('0xa8')]+_0x7810('0xb0'),'form':{'client_id':_0x50a64a[_0x7810('0xa9')],'resource':_0x54d5c7,'username':_0x50a64a[_0x7810('0xa7')],'password':_0x50a64a[_0x7810('0xb1')],'grant_type':_0x7810('0xb1'),'client_secret':_0x50a64a[_0x7810('0xb2')]},'json':!![]};return rp(_0x1789de);}})[_0x7810('0x21')](function(_0x590a38){_0x5061f0=_0x590a38['access_token'];var _0x4f42f4={'method':'GET','uri':encodeURI(_0x33def1+_0x7810('0xb3')+_0x5d56b7+'\x27'),'headers':{'Authorization':_0x7810('0xb4')+_0x5061f0,'If-None-Match':null,'OData-Version':_0x7810('0xb5')},'json':!![]};return rp(_0x4f42f4);})[_0x7810('0x21')](function(_0x4dbf89){var _0x236707=_0x4dbf89['value'][0x0];var _0x414002=_0x236707[_0x7810('0xb6')];var _0x3bf916={'method':_0x7810('0xb7'),'uri':_0x33def1+_0x7810('0xb8')+_0x414002+_0x7810('0xb9'),'headers':{'Authorization':_0x7810('0xb4')+_0x5061f0,'If-None-Match':null,'OData-Version':_0x7810('0xb5')},'json':!![]};return rp(_0x3bf916);})[_0x7810('0x21')](function(_0x16f622){_0x247025=_0x16f622;_0x7ffed2=_0x247025[_0x7810('0xba')];_0x7ffed2=_[_0x7810('0xbb')](_0x7ffed2,function(_0x57ba06){return!_0x343899[_0x7810('0xbc')](_0x57ba06['LogicalName']);});var _0x48319a=[];var _0x4a5b2d=[];_0x7ffed2[_0x7810('0xbd')](function(_0x12e16d){if(_0x12e16d[_0x7810('0xbe')]){var _0x1c6ef7=_0x12e16d[_0x7810('0xbe')][_0x7810('0xbf')](_0x12e16d[_0x7810('0xbe')][_0x7810('0xac')]('.')+0x1);if(_0x1c6ef7===_0x7810('0xc0')){_0x48319a['push'](getSelectList(_0x33def1,_0x3df493,_0x4a5b2d,_0x247025[_0x7810('0xb6')],_0x12e16d[_0x7810('0xb6')],_0x5061f0));}}});return Promise[_0x7810('0xc1')](_0x48319a);})[_0x7810('0x21')](function(_0x514155){_0x39ab85=_0x514155[0x0];var _0x467f84=[];var _0xaabd24=[];_0x7ffed2[_0x7810('0xbd')](function(_0x1c977a){if(!_[_0x7810('0xc2')](_0x1c977a[_0x7810('0xbe')])){var _0x2a424f=_0x1c977a[_0x7810('0xbe')][_0x7810('0xbf')](_0x1c977a['@odata.type'][_0x7810('0xac')]('.')+0x1);if(_0x2a424f==='BooleanAttributeMetadata'){_0x467f84['push'](getBooleanList(_0x33def1,_0x3df493,_0xaabd24,_0x247025[_0x7810('0xb6')],_0x1c977a[_0x7810('0xb6')],_0x5061f0));}}});return Promise[_0x7810('0xc1')](_0x467f84);})[_0x7810('0x21')](function(_0x16b5b0){_0x299e95=_0x16b5b0[0x0];var _0x56c33c=[];var _0x1891b9=[];_0x7ffed2[_0x7810('0xbd')](function(_0x235e97){if(_0x235e97[_0x7810('0xbe')]){var _0x5c063e=_0x235e97[_0x7810('0xbe')][_0x7810('0xbf')](_0x235e97[_0x7810('0xbe')]['lastIndexOf']('.')+0x1);if(_0x5c063e==='StringAttributeMetadata'||_0x5c063e==='DoubleAttributeMetadata'||_0x5c063e==='BigIntAttributeMetadata'||_0x5c063e===_0x7810('0xc3')||_0x5c063e===_0x7810('0xc4')||_0x5c063e===_0x7810('0xc5')||_0x5c063e===_0x7810('0xc6')||_0x5c063e===_0x7810('0xc7')||_0x5c063e===_0x7810('0xc8')||_0x5c063e===_0x7810('0xc9')){_0x56c33c[_0x7810('0xca')](getInputList(_0x33def1,_0x3df493,_0x5c063e,_0x1891b9,_0x247025[_0x7810('0xb6')],_0x235e97[_0x7810('0xb6')],_0x5061f0));}}});return Promise[_0x7810('0xc1')](_0x56c33c);})[_0x7810('0x21')](function(_0x5ca6c2){_0x53289b=_0x5ca6c2[0x0];var _0x392383=_0x39ab85[_0x7810('0xa6')](_0x299e95)[_0x7810('0xa6')](_0x53289b);var _0x10df2c={'count':_0x392383[_0x7810('0x45')],'rows':_0x392383};return _0x10df2c;})['then'](respondWithResult(_0x2ebad7,null))[_0x7810('0x2a')](function(_0x3e7430){var _0x3d9124=_0x9d05b7['query'][_0x7810('0xcb')]?0x1f4:_0x3e7430[_0x7810('0xcc')]||0x1f4;logger['error'](_0x3e7430[_0x7810('0x37')]);delete _0x3e7430['name'];if(_0x3d9124===0x191){_0x3d9124=0x190;}_0x2ebad7[_0x7810('0x30')](_0x3d9124)[_0x7810('0x39')](_0x9d05b7[_0x7810('0x42')][_0x7810('0xcb')]?{'message':_0x7810('0xcd'),'statusCode':_0x3e7430[_0x7810('0xcc')]}:_0x3e7430);});};function getSelectList(_0xcee4d1,_0x399faa,_0x173fd9,_0x2d4e33,_0x5356eb,_0x22371e){var _0x3e9fb5={'method':_0x7810('0xb7'),'uri':_0xcee4d1+_0x7810('0xb8')+_0x2d4e33+_0x7810('0xce')+_0x5356eb+_0x7810('0xcf')+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':'Bearer\x20'+_0x22371e,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x3e9fb5)[_0x7810('0x21')](function(_0x32b6ce){var _0x3bfdb7=[];var _0x4c8871=_0x32b6ce['OptionSet'][_0x7810('0xd0')];_0x4c8871['forEach'](function(_0x9c1fbf){_0x3bfdb7['push']({'name':_0x9c1fbf[_0x7810('0xd1')][_0x7810('0xd2')]['Label'],'value':String(_0x9c1fbf[_0x7810('0xd3')])});});var _0x3f72b1={'id':_0x399faa+'_'+_0x32b6ce[_0x7810('0xd4')],'name':_0x32b6ce['DisplayName']['UserLocalizedLabel'][_0x7810('0xd1')],'custom':![],'options':_0x3bfdb7};_0x173fd9[_0x7810('0xca')](_0x3f72b1);return _0x173fd9;});}function getBooleanList(_0x49724e,_0x507cba,_0x3476bf,_0xe8dad2,_0x1f12b1,_0x20d4a5){var _0x2949d2={'method':'GET','uri':_0x49724e+_0x7810('0xb8')+_0xe8dad2+_0x7810('0xce')+_0x1f12b1+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':'Bearer\x20'+_0x20d4a5,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x2949d2)[_0x7810('0x21')](function(_0x52ede8){var _0x5bc607=[];_0x5bc607['push']({'name':_0x52ede8[_0x7810('0xd5')]['TrueOption'][_0x7810('0xd1')][_0x7810('0xd2')][_0x7810('0xd1')],'value':'true'},{'name':_0x52ede8[_0x7810('0xd5')][_0x7810('0xd6')]['Label'][_0x7810('0xd2')][_0x7810('0xd1')],'value':_0x7810('0xd7')});var _0x4a3d2d={'id':_0x507cba+'_'+_0x52ede8['LogicalName'],'name':_0x52ede8[_0x7810('0xd8')][_0x7810('0xd2')][_0x7810('0xd1')],'custom':![],'options':_0x5bc607};_0x3476bf['push'](_0x4a3d2d);return _0x3476bf;});}function getInputList(_0x2a3801,_0x53a88c,_0x5e8adf,_0x2461d3,_0x36c01d,_0x35e878,_0x12da6d){var _0x4a0dfb={'method':_0x7810('0xb7'),'uri':_0x2a3801+_0x7810('0xb8')+_0x36c01d+')/Attributes('+_0x35e878+')/Microsoft.Dynamics.CRM.'+_0x5e8adf+_0x7810('0xd9'),'headers':{'Authorization':'Bearer\x20'+_0x12da6d,'If-None-Match':null,'OData-Version':_0x7810('0xb5')},'json':!![]};return rp(_0x4a0dfb)[_0x7810('0x21')](function(_0x385aa6){var _0x2528ef={'id':_0x53a88c+'_'+_0x385aa6[_0x7810('0xd4')],'name':_0x385aa6[_0x7810('0xd8')][_0x7810('0xd2')]?_0x385aa6[_0x7810('0xd8')][_0x7810('0xd2')][_0x7810('0xd1')]:_0x385aa6[_0x7810('0xd4')],'custom':![],'options':[]};_0x2461d3[_0x7810('0xca')](_0x2528ef);return _0x2461d3;});} \ No newline at end of file +var _0x0efb=['pick','filter','where','merge','map','VIRTUAL','options','include','findAll','rows','show','params','filters','intersection','includeAll','create','body','find','findOne','Dynamics365Configuration','order','nolimit','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','type','Descriptions','getDescriptions','Dynamics365Field','getFields','ticketType','incident','Incident','PhoneCall','title','description','customerid','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','accountidname','accountidyominame','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdonbehalfbyname','customeridtype','customeridyominame','entitlementidname','entityimage_timestamp','entityimage_url','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','masteridname','modifiedbyexternalpartyname','modifiedbyname','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','resolveby','resolvebykpiidname','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','statecode','statuscode','subjectidname','ticketnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','concat','password','remoteUri','tenantId','substring','lastIndexOf','format','https://login.microsoftonline.com/','/oauth2/token','username','clientSecret','access_token','GET','Bearer\x20','4.0','value','MetadataId','EntityDefinitions(','remove','LogicalName','@odata.type','PicklistAttributeMetadata','push','all','isNil','forEach','StringAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','statusCode',')/Attributes(','OptionSet','Options','UserLocalizedLabel','Label','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','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','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','Dynamics365Account,\x20%s,\x20%s','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','code','error','message','info','request\x20sent','result','catch','sendStatus','status','count','offset','set','Content-Range','json','apply','reject','save','update','destroy','end','stack','name','send','index','Dynamics365Account','rawAttributes','fieldName','key','query','keys','attributes','model','fields','length','hasOwnProperty','limit','sort'];(function(_0x3fae84,_0x5e71a9){var _0x1e16d2=function(_0x1f0c01){while(--_0x1f0c01){_0x3fae84['push'](_0x3fae84['shift']());}};_0x1e16d2(++_0x5e71a9);}(_0x0efb,0x163));var _0xb0ef=function(_0x55d58f,_0x2bea83){_0x55d58f=_0x55d58f-0x0;var _0x1ad6e6=_0x0efb[_0x55d58f];return _0x1ad6e6;};'use strict';var pdf=require(_0xb0ef('0x0'));var emlformat=require(_0xb0ef('0x1'));var rimraf=require(_0xb0ef('0x2'));var zipdir=require(_0xb0ef('0x3'));var jsonpatch=require(_0xb0ef('0x4'));var rp=require('request-promise');var moment=require(_0xb0ef('0x5'));var BPromise=require(_0xb0ef('0x6'));var Mustache=require('mustache');var util=require(_0xb0ef('0x7'));var path=require('path');var sox=require(_0xb0ef('0x8'));var csv=require(_0xb0ef('0x9'));var ejs=require(_0xb0ef('0xa'));var fs=require('fs');var _=require(_0xb0ef('0xb'));var squel=require(_0xb0ef('0xc'));var crypto=require(_0xb0ef('0xd'));var jsforce=require(_0xb0ef('0xe'));var deskjs=require(_0xb0ef('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb0ef('0x10'));var Redis=require(_0xb0ef('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xb0ef('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb0ef('0x13'));var logger=require(_0xb0ef('0x14'))(_0xb0ef('0x15'));var utils=require(_0xb0ef('0x16'));var config=require(_0xb0ef('0x17'));var db=require(_0xb0ef('0x18'))['db'];var integrations=require(_0xb0ef('0x19'));var jayson=require('jayson/promise');var client=jayson['client'][_0xb0ef('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x52d69a,_0x15b130,_0x112db1){if(_0x112db1){var _0x12e5fe=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x12e5fe['test'](_0x15b130)){return _0x52d69a;}else{throw new db['Sequelize'][(_0xb0ef('0x1b'))](_0xb0ef('0x1c'));}}else{return _0x52d69a;}}function respondWithRpcPromise(_0x4d5f56,_0x39a28,_0x33fc1c,_0x24256f){return new BPromise(function(_0x2b5c1d,_0x2732a1){var _0x455e4c=_0x24256f||client;return _0x455e4c[_0xb0ef('0x1d')](_0x4d5f56,_0x33fc1c)[_0xb0ef('0x1e')](function(_0x25d849){logger['info'](_0xb0ef('0x1f'),_0x39a28,'request\x20sent');logger[_0xb0ef('0x20')](_0xb0ef('0x21'),_0x39a28,'request\x20sent',JSON['stringify'](_0x25d849));if(_0x25d849['error']){if(_0x25d849['error'][_0xb0ef('0x22')]===0x1f4){logger[_0xb0ef('0x23')](_0xb0ef('0x1f'),_0x39a28,_0x25d849[_0xb0ef('0x23')][_0xb0ef('0x24')]);return _0x2732a1(_0x25d849[_0xb0ef('0x23')][_0xb0ef('0x24')]);}logger[_0xb0ef('0x23')](_0xb0ef('0x1f'),_0x39a28,_0x25d849[_0xb0ef('0x23')][_0xb0ef('0x24')]);return _0x2b5c1d(_0x25d849[_0xb0ef('0x23')][_0xb0ef('0x24')]);}else{logger[_0xb0ef('0x25')]('Dynamics365Account,\x20%s,\x20%s',_0x39a28,_0xb0ef('0x26'));_0x2b5c1d(_0x25d849[_0xb0ef('0x27')]['message']);}})[_0xb0ef('0x28')](function(_0x2d6edb){logger[_0xb0ef('0x23')](_0xb0ef('0x1f'),_0x39a28,_0x2d6edb);_0x2732a1(_0x2d6edb);});});}function respondWithStatusCode(_0x3a7db4,_0x222144){_0x222144=_0x222144||0xcc;return function(_0x4f4feb){if(_0x4f4feb){return _0x3a7db4[_0xb0ef('0x29')](_0x222144);}return _0x3a7db4[_0xb0ef('0x2a')](_0x222144)['end']();};}function respondWithResult(_0x58625c,_0x5139bc){_0x5139bc=_0x5139bc||0xc8;return function(_0x7a8ed3){if(_0x7a8ed3){return _0x58625c[_0xb0ef('0x2a')](_0x5139bc)['json'](_0x7a8ed3);}};}function respondWithFilteredResult(_0x4597fe,_0x2271a0){return function(_0x423f97){if(_0x423f97){var _0x4770aa=_0x423f97[_0xb0ef('0x2b')],_0x28c509=_0x2271a0[_0xb0ef('0x2c')],_0x4ebd02=_0x2271a0['offset']+_0x2271a0['limit'],_0xbf123e;if(_0x4ebd02>=_0x4770aa){_0x4ebd02=_0x4770aa;_0xbf123e=0xc8;}else{_0xbf123e=0xce;}_0x4597fe[_0xb0ef('0x2a')](_0xbf123e);return _0x4597fe[_0xb0ef('0x2d')](_0xb0ef('0x2e'),_0x28c509+'-'+_0x4ebd02+'/'+_0x4770aa)[_0xb0ef('0x2f')](_0x423f97);}return null;};}function patchUpdates(_0x12a2bd){return function(_0x14c20d){try{jsonpatch[_0xb0ef('0x30')](_0x14c20d,_0x12a2bd,!![]);}catch(_0x3dc05b){return BPromise[_0xb0ef('0x31')](_0x3dc05b);}return _0x14c20d[_0xb0ef('0x32')]();};}function saveUpdates(_0x1d6359,_0x52c8b9){return function(_0x3c33d1){if(_0x3c33d1){return _0x3c33d1[_0xb0ef('0x33')](_0x1d6359)[_0xb0ef('0x1e')](function(_0x4c93b5){return _0x4c93b5;});}return null;};}function removeEntity(_0x2621cc,_0xcb1a04){return function(_0x4c592d){if(_0x4c592d){return _0x4c592d[_0xb0ef('0x34')]()['then'](function(){_0x2621cc['status'](0xcc)[_0xb0ef('0x35')]();});}};}function handleEntityNotFound(_0x588bf9,_0x3efb01){return function(_0x403d33){if(!_0x403d33){_0x588bf9['sendStatus'](0x194);}return _0x403d33;};}function handleError(_0x234cd6,_0x3b061c){_0x3b061c=_0x3b061c||0x1f4;return function(_0x4d895d){logger[_0xb0ef('0x23')](_0x4d895d[_0xb0ef('0x36')]);if(_0x4d895d[_0xb0ef('0x37')]){delete _0x4d895d[_0xb0ef('0x37')];}_0x234cd6['status'](_0x3b061c)[_0xb0ef('0x38')](_0x4d895d);};}exports[_0xb0ef('0x39')]=function(_0xbd0a2e,_0x3a6e4f){var _0x2a56b3={},_0x10f97d={},_0x43ea3f={'count':0x0,'rows':[]};var _0x51bacf=_['map'](db[_0xb0ef('0x3a')][_0xb0ef('0x3b')],function(_0xf0609e){return{'name':_0xf0609e[_0xb0ef('0x3c')],'type':_0xf0609e['type'][_0xb0ef('0x3d')]};});_0x10f97d['model']=_['map'](_0x51bacf,'name');_0x10f97d[_0xb0ef('0x3e')]=_[_0xb0ef('0x3f')](_0xbd0a2e[_0xb0ef('0x3e')]);_0x10f97d['filters']=_['intersection'](_0x10f97d['model'],_0x10f97d[_0xb0ef('0x3e')]);_0x2a56b3[_0xb0ef('0x40')]=_['intersection'](_0x10f97d[_0xb0ef('0x41')],qs[_0xb0ef('0x42')](_0xbd0a2e[_0xb0ef('0x3e')]['fields']));_0x2a56b3['attributes']=_0x2a56b3[_0xb0ef('0x40')][_0xb0ef('0x43')]?_0x2a56b3['attributes']:_0x10f97d[_0xb0ef('0x41')];if(!_0xbd0a2e[_0xb0ef('0x3e')][_0xb0ef('0x44')]('nolimit')){_0x2a56b3['limit']=qs[_0xb0ef('0x45')](_0xbd0a2e[_0xb0ef('0x3e')][_0xb0ef('0x45')]);_0x2a56b3[_0xb0ef('0x2c')]=qs[_0xb0ef('0x2c')](_0xbd0a2e[_0xb0ef('0x3e')][_0xb0ef('0x2c')]);}_0x2a56b3['order']=qs[_0xb0ef('0x46')](_0xbd0a2e[_0xb0ef('0x3e')]['sort']);_0x2a56b3['where']=qs['filters'](_[_0xb0ef('0x47')](_0xbd0a2e[_0xb0ef('0x3e')],_0x10f97d['filters']));if(_0xbd0a2e[_0xb0ef('0x3e')][_0xb0ef('0x48')]){_0x2a56b3[_0xb0ef('0x49')]=_[_0xb0ef('0x4a')](_0x2a56b3[_0xb0ef('0x49')],{'$or':_[_0xb0ef('0x4b')](_0x51bacf,function(_0x5721e9){if(_0x5721e9['type']!==_0xb0ef('0x4c')){var _0x7fd33={};_0x7fd33[_0x5721e9['name']]={'$like':'%'+_0xbd0a2e[_0xb0ef('0x3e')]['filter']+'%'};return _0x7fd33;}})});}_0x2a56b3=_['merge']({},_0x2a56b3,_0xbd0a2e[_0xb0ef('0x4d')]);var _0x18cb73={'where':_0x2a56b3[_0xb0ef('0x49')]};return db[_0xb0ef('0x3a')][_0xb0ef('0x2b')](_0x18cb73)[_0xb0ef('0x1e')](function(_0x2ca0ee){_0x43ea3f[_0xb0ef('0x2b')]=_0x2ca0ee;if(_0xbd0a2e[_0xb0ef('0x3e')]['includeAll']){_0x2a56b3[_0xb0ef('0x4e')]=[{'all':!![]}];}return db['Dynamics365Account'][_0xb0ef('0x4f')](_0x2a56b3);})[_0xb0ef('0x1e')](function(_0x2fc5e6){_0x43ea3f[_0xb0ef('0x50')]=_0x2fc5e6;return _0x43ea3f;})[_0xb0ef('0x1e')](respondWithFilteredResult(_0x3a6e4f,_0x2a56b3))[_0xb0ef('0x28')](handleError(_0x3a6e4f,null));};exports[_0xb0ef('0x51')]=function(_0x2c2922,_0x1c2881){var _0x42a49d={'raw':![],'where':{'id':_0x2c2922[_0xb0ef('0x52')]['id']}},_0x263461={};_0x263461['model']=_[_0xb0ef('0x3f')](db[_0xb0ef('0x3a')]['rawAttributes']);_0x263461['query']=_['keys'](_0x2c2922[_0xb0ef('0x3e')]);_0x263461[_0xb0ef('0x53')]=_[_0xb0ef('0x54')](_0x263461[_0xb0ef('0x41')],_0x263461[_0xb0ef('0x3e')]);_0x42a49d[_0xb0ef('0x40')]=_[_0xb0ef('0x54')](_0x263461[_0xb0ef('0x41')],qs['fields'](_0x2c2922[_0xb0ef('0x3e')]['fields']));_0x42a49d[_0xb0ef('0x40')]=_0x42a49d[_0xb0ef('0x40')][_0xb0ef('0x43')]?_0x42a49d[_0xb0ef('0x40')]:_0x263461[_0xb0ef('0x41')];if(_0x2c2922['query'][_0xb0ef('0x55')]){_0x42a49d[_0xb0ef('0x4e')]=[{'all':!![]}];}_0x42a49d=_[_0xb0ef('0x4a')]({},_0x42a49d,_0x2c2922[_0xb0ef('0x4d')]);return db['Dynamics365Account']['find'](_0x42a49d)[_0xb0ef('0x1e')](handleEntityNotFound(_0x1c2881,null))[_0xb0ef('0x1e')](respondWithResult(_0x1c2881,null))[_0xb0ef('0x28')](handleError(_0x1c2881,null));};exports[_0xb0ef('0x56')]=function(_0x325942,_0x1c2a05){return db[_0xb0ef('0x3a')][_0xb0ef('0x56')](_0x325942['body'],{})['then'](respondWithResult(_0x1c2a05,0xc9))[_0xb0ef('0x28')](handleError(_0x1c2a05,null));};exports[_0xb0ef('0x33')]=function(_0x588450,_0x431489){if(_0x588450[_0xb0ef('0x57')]['id']){delete _0x588450[_0xb0ef('0x57')]['id'];}return db[_0xb0ef('0x3a')]['find']({'where':{'id':_0x588450['params']['id']}})['then'](handleEntityNotFound(_0x431489,null))[_0xb0ef('0x1e')](saveUpdates(_0x588450[_0xb0ef('0x57')],null))[_0xb0ef('0x1e')](respondWithResult(_0x431489,null))['catch'](handleError(_0x431489,null));};exports[_0xb0ef('0x34')]=function(_0x4d42d4,_0xc22e4a){return db[_0xb0ef('0x3a')][_0xb0ef('0x58')]({'where':{'id':_0x4d42d4[_0xb0ef('0x52')]['id']}})[_0xb0ef('0x1e')](handleEntityNotFound(_0xc22e4a,null))[_0xb0ef('0x1e')](removeEntity(_0xc22e4a,null))[_0xb0ef('0x28')](handleError(_0xc22e4a,null));};exports['getConfigurations']=function(_0x29328f,_0x572c62,_0x3aa512){var _0x53d75a={};var _0x5f4e5b={};var _0x17af59;var _0x258d2f;return db[_0xb0ef('0x3a')][_0xb0ef('0x59')]({'where':{'id':_0x29328f[_0xb0ef('0x52')]['id']}})[_0xb0ef('0x1e')](handleEntityNotFound(_0x572c62,null))[_0xb0ef('0x1e')](function(_0x34b884){if(_0x34b884){_0x17af59=_0x34b884;_0x5f4e5b[_0xb0ef('0x41')]=_[_0xb0ef('0x3f')](db[_0xb0ef('0x5a')]['rawAttributes']);_0x5f4e5b[_0xb0ef('0x3e')]=_[_0xb0ef('0x3f')](_0x29328f['query']);_0x5f4e5b[_0xb0ef('0x53')]=_[_0xb0ef('0x54')](_0x5f4e5b[_0xb0ef('0x41')],_0x5f4e5b['query']);_0x53d75a[_0xb0ef('0x40')]=_[_0xb0ef('0x54')](_0x5f4e5b[_0xb0ef('0x41')],qs['fields'](_0x29328f[_0xb0ef('0x3e')]['fields']));_0x53d75a[_0xb0ef('0x40')]=_0x53d75a[_0xb0ef('0x40')][_0xb0ef('0x43')]?_0x53d75a[_0xb0ef('0x40')]:_0x5f4e5b[_0xb0ef('0x41')];_0x53d75a[_0xb0ef('0x5b')]=qs[_0xb0ef('0x46')](_0x29328f['query'][_0xb0ef('0x46')]);_0x53d75a[_0xb0ef('0x49')]=qs[_0xb0ef('0x53')](_[_0xb0ef('0x47')](_0x29328f[_0xb0ef('0x3e')],_0x5f4e5b[_0xb0ef('0x53')]));if(_0x29328f[_0xb0ef('0x3e')][_0xb0ef('0x48')]){_0x53d75a[_0xb0ef('0x49')]=_['merge'](_0x53d75a['where'],{'$or':_['map'](_0x53d75a[_0xb0ef('0x40')],function(_0x24a6ff){var _0x2bdf64={};_0x2bdf64[_0x24a6ff]={'$like':'%'+_0x29328f[_0xb0ef('0x3e')]['filter']+'%'};return _0x2bdf64;})});}_0x53d75a=_[_0xb0ef('0x4a')]({},_0x53d75a,_0x29328f[_0xb0ef('0x4d')]);return _0x17af59['getConfigurations'](_0x53d75a);}})[_0xb0ef('0x1e')](function(_0x460957){if(_0x460957){_0x258d2f=_0x460957['length'];if(!_0x29328f[_0xb0ef('0x3e')][_0xb0ef('0x44')](_0xb0ef('0x5c'))){_0x53d75a[_0xb0ef('0x45')]=qs[_0xb0ef('0x45')](_0x29328f[_0xb0ef('0x3e')][_0xb0ef('0x45')]);_0x53d75a[_0xb0ef('0x2c')]=qs[_0xb0ef('0x2c')](_0x29328f[_0xb0ef('0x3e')]['offset']);}return _0x17af59[_0xb0ef('0x5d')](_0x53d75a);}})[_0xb0ef('0x1e')](function(_0x376ec0){if(_0x376ec0){return _0x376ec0?{'count':_0x258d2f,'rows':_0x376ec0}:null;}})['then'](respondWithResult(_0x572c62,null))['catch'](handleError(_0x572c62,null));};exports[_0xb0ef('0x5e')]=function(_0x189d7c,_0x3533a7,_0x19883b){if(_0x189d7c[_0xb0ef('0x57')]['id']){delete _0x189d7c[_0xb0ef('0x57')]['id'];}return db[_0xb0ef('0x3a')][_0xb0ef('0x59')]({'where':{'id':_0x189d7c[_0xb0ef('0x52')]['id']}})['then'](handleEntityNotFound(_0x3533a7,null))[_0xb0ef('0x1e')](function(_0x250607){if(_0x250607){_0x189d7c[_0xb0ef('0x57')][_0xb0ef('0x5f')]=_0x250607['id'];_0x189d7c[_0xb0ef('0x57')][_0xb0ef('0x60')]=integrations[_0xb0ef('0x61')](_0x189d7c[_0xb0ef('0x57')][_0xb0ef('0x62')],_0x189d7c['body'][_0xb0ef('0x63')]);_0x189d7c[_0xb0ef('0x57')][_0xb0ef('0x64')]=integrations[_0xb0ef('0x65')](_0x189d7c[_0xb0ef('0x57')][_0xb0ef('0x62')],_0x189d7c[_0xb0ef('0x57')]['type']);return db[_0xb0ef('0x5a')][_0xb0ef('0x56')](_0x189d7c[_0xb0ef('0x57')],{'include':[{'model':db[_0xb0ef('0x66')],'as':'Subjects'},{'model':db[_0xb0ef('0x66')],'as':_0xb0ef('0x64')}]});}return null;})[_0xb0ef('0x1e')](respondWithResult(_0x3533a7,null))['catch'](handleError(_0x3533a7,null));};exports[_0xb0ef('0x67')]=function(_0x3e1821,_0x39e927,_0x1ef110){var _0x2ec9c2=_0x3e1821['query'][_0xb0ef('0x68')];var _0xa359fc=_0x2ec9c2===_0xb0ef('0x69')?_0xb0ef('0x6a'):_0xb0ef('0x6b');var _0x1dc88a='';var _0x27af22='';var _0x23502e='';var _0x1075a5='';var _0x2c3ec2='';var _0x51a1ed='';var _0x53190a='';var _0x2e850c='';var _0x28866c=[_0xb0ef('0x6c'),_0xb0ef('0x6d'),_0xb0ef('0x6e'),_0xb0ef('0x6f'),_0xb0ef('0x70'),_0xb0ef('0x71'),_0xb0ef('0x72'),_0xb0ef('0x73'),'directioncode','phonecall_activity_parties'];var _0xbe79f4=[_0xb0ef('0x74'),_0xb0ef('0x75'),'actualserviceunits',_0xb0ef('0x76'),_0xb0ef('0x77'),_0xb0ef('0x78'),_0xb0ef('0x79'),_0xb0ef('0x7a'),'createdbyexternalpartyname',_0xb0ef('0x7b'),_0xb0ef('0x7c'),_0xb0ef('0x7d'),'createdon',_0xb0ef('0x7e'),'createdonbehalfbyyominame','customeridname',_0xb0ef('0x7f'),_0xb0ef('0x80'),'emailaddress',_0xb0ef('0x81'),_0xb0ef('0x82'),_0xb0ef('0x83'),'escalatedon',_0xb0ef('0x84'),_0xb0ef('0x85'),_0xb0ef('0x86'),_0xb0ef('0x87'),_0xb0ef('0x88'),'kbarticleidname','lastonholdtime',_0xb0ef('0x89'),_0xb0ef('0x8a'),'modifiedbyexternalpartyyominame',_0xb0ef('0x8b'),'modifiedbyyominame','modifiedon',_0xb0ef('0x8c'),_0xb0ef('0x8d'),_0xb0ef('0x8e'),'msdyn_iotalertname','numberofchildincidents','onholdtime',_0xb0ef('0x8f'),_0xb0ef('0x90'),_0xb0ef('0x91'),_0xb0ef('0x92'),_0xb0ef('0x93'),_0xb0ef('0x94'),_0xb0ef('0x95'),_0xb0ef('0x96'),_0xb0ef('0x97'),'productserialnumber',_0xb0ef('0x98'),_0xb0ef('0x99'),'responseby',_0xb0ef('0x9a'),_0xb0ef('0x9b'),_0xb0ef('0x9c'),_0xb0ef('0x9d'),_0xb0ef('0x9e'),'socialprofileidname',_0xb0ef('0x9f'),_0xb0ef('0xa0'),_0xb0ef('0xa1'),_0xb0ef('0xa2'),'timezoneruleversionnumber',_0xb0ef('0xa3'),_0xb0ef('0xa4'),_0xb0ef('0xa5'),'versionnumber'];var _0x5af540=_0x28866c[_0xb0ef('0xa6')](_0xbe79f4);return db[_0xb0ef('0x3a')][_0xb0ef('0x59')]({'where':{'id':_0x3e1821['params']['id']},'attributes':['id','username',_0xb0ef('0xa7'),_0xb0ef('0xa8'),_0xb0ef('0xa9'),'clientId','clientSecret']})[_0xb0ef('0x1e')](handleEntityNotFound(_0x39e927,null))[_0xb0ef('0x1e')](function(_0x2d881b){if(_0x2d881b){_0x2e850c=_0x2d881b['remoteUri'];var _0x457f78=_0x2e850c['slice'](-0x1);if(_0x457f78==='/'){_0x2e850c=_0x2e850c[_0xb0ef('0xaa')](0x0,_0x2e850c[_0xb0ef('0xab')](_0x457f78));}_0x53190a=util[_0xb0ef('0xac')]('%s/api/data/v9.0/',_0x2e850c);var _0x47359e={'method':'POST','uri':_0xb0ef('0xad')+_0x2d881b[_0xb0ef('0xa9')]+_0xb0ef('0xae'),'form':{'client_id':_0x2d881b['clientId'],'resource':_0x2e850c,'username':_0x2d881b[_0xb0ef('0xaf')],'password':_0x2d881b[_0xb0ef('0xa7')],'grant_type':_0xb0ef('0xa7'),'client_secret':_0x2d881b[_0xb0ef('0xb0')]},'json':!![]};return rp(_0x47359e);}})[_0xb0ef('0x1e')](function(_0x5ce643){_0x51a1ed=_0x5ce643[_0xb0ef('0xb1')];var _0x408db2={'method':_0xb0ef('0xb2'),'uri':encodeURI(_0x53190a+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0xa359fc+'\x27'),'headers':{'Authorization':_0xb0ef('0xb3')+_0x51a1ed,'If-None-Match':null,'OData-Version':_0xb0ef('0xb4')},'json':!![]};return rp(_0x408db2);})[_0xb0ef('0x1e')](function(_0x2647e5){var _0x317f7c=_0x2647e5[_0xb0ef('0xb5')][0x0];var _0x4f229d=_0x317f7c[_0xb0ef('0xb6')];var _0x1ccc30={'method':_0xb0ef('0xb2'),'uri':_0x53190a+_0xb0ef('0xb7')+_0x4f229d+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':'Bearer\x20'+_0x51a1ed,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x1ccc30);})[_0xb0ef('0x1e')](function(_0x1b96ee){_0x1dc88a=_0x1b96ee;_0x27af22=_0x1dc88a['Attributes'];_0x27af22=_[_0xb0ef('0xb8')](_0x27af22,function(_0xe1d916){return!_0x5af540['includes'](_0xe1d916[_0xb0ef('0xb9')]);});var _0x4c6af3=[];var _0x36752b=[];_0x27af22['forEach'](function(_0x5d492a){if(_0x5d492a['@odata.type']){var _0x453786=_0x5d492a[_0xb0ef('0xba')][_0xb0ef('0xaa')](_0x5d492a['@odata.type']['lastIndexOf']('.')+0x1);if(_0x453786===_0xb0ef('0xbb')){_0x4c6af3[_0xb0ef('0xbc')](getSelectList(_0x53190a,_0x2ec9c2,_0x36752b,_0x1dc88a[_0xb0ef('0xb6')],_0x5d492a[_0xb0ef('0xb6')],_0x51a1ed));}}});return Promise[_0xb0ef('0xbd')](_0x4c6af3);})[_0xb0ef('0x1e')](function(_0x3ab3ea){_0x23502e=_0x3ab3ea[0x0];var _0x333ef0=[];var _0xb0c560=[];_0x27af22['forEach'](function(_0x52544f){if(!_[_0xb0ef('0xbe')](_0x52544f[_0xb0ef('0xba')])){var _0x19b5b6=_0x52544f[_0xb0ef('0xba')][_0xb0ef('0xaa')](_0x52544f[_0xb0ef('0xba')]['lastIndexOf']('.')+0x1);if(_0x19b5b6==='BooleanAttributeMetadata'){_0x333ef0[_0xb0ef('0xbc')](getBooleanList(_0x53190a,_0x2ec9c2,_0xb0c560,_0x1dc88a['MetadataId'],_0x52544f['MetadataId'],_0x51a1ed));}}});return Promise[_0xb0ef('0xbd')](_0x333ef0);})[_0xb0ef('0x1e')](function(_0x4ec417){_0x1075a5=_0x4ec417[0x0];var _0x242cb8=[];var _0x581312=[];_0x27af22[_0xb0ef('0xbf')](function(_0x172f23){if(_0x172f23[_0xb0ef('0xba')]){var _0x999bb0=_0x172f23[_0xb0ef('0xba')][_0xb0ef('0xaa')](_0x172f23[_0xb0ef('0xba')][_0xb0ef('0xab')]('.')+0x1);if(_0x999bb0===_0xb0ef('0xc0')||_0x999bb0==='DoubleAttributeMetadata'||_0x999bb0===_0xb0ef('0xc1')||_0x999bb0===_0xb0ef('0xc2')||_0x999bb0==='MemoAttributeMetadata'||_0x999bb0==='DateTimeAttributeMetadata'||_0x999bb0==='StatusAttributeMetadata'||_0x999bb0===_0xb0ef('0xc3')||_0x999bb0===_0xb0ef('0xc4')||_0x999bb0===_0xb0ef('0xc5')){_0x242cb8[_0xb0ef('0xbc')](getInputList(_0x53190a,_0x2ec9c2,_0x999bb0,_0x581312,_0x1dc88a[_0xb0ef('0xb6')],_0x172f23[_0xb0ef('0xb6')],_0x51a1ed));}}});return Promise['all'](_0x242cb8);})['then'](function(_0x24c348){_0x2c3ec2=_0x24c348[0x0];var _0x4f68db=_0x23502e[_0xb0ef('0xa6')](_0x1075a5)[_0xb0ef('0xa6')](_0x2c3ec2);var _0xe1abb={'count':_0x4f68db[_0xb0ef('0x43')],'rows':_0x4f68db};return _0xe1abb;})[_0xb0ef('0x1e')](respondWithResult(_0x39e927,null))[_0xb0ef('0x28')](function(_0x47b99c){var _0x39e165=_0x3e1821[_0xb0ef('0x3e')][_0xb0ef('0xc6')]?0x1f4:_0x47b99c[_0xb0ef('0xc7')]||0x1f4;logger[_0xb0ef('0x23')](_0x47b99c['stack']);delete _0x47b99c['name'];if(_0x39e165===0x191){_0x39e165=0x190;}_0x39e927[_0xb0ef('0x2a')](_0x39e165)[_0xb0ef('0x38')](_0x3e1821['query']['test']?{'message':'Wrong\x20credentials','statusCode':_0x47b99c[_0xb0ef('0xc7')]}:_0x47b99c);});};function getSelectList(_0x6ca8c6,_0x2e18e4,_0x54f8b2,_0x4dc723,_0x47706d,_0xb49f98){var _0x1e50cc={'method':_0xb0ef('0xb2'),'uri':_0x6ca8c6+'EntityDefinitions('+_0x4dc723+_0xb0ef('0xc8')+_0x47706d+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':_0xb0ef('0xb3')+_0xb49f98,'If-None-Match':null,'OData-Version':_0xb0ef('0xb4')},'json':!![]};return rp(_0x1e50cc)[_0xb0ef('0x1e')](function(_0x5f208b){var _0x1289f9=[];var _0x4492e4=_0x5f208b[_0xb0ef('0xc9')][_0xb0ef('0xca')];_0x4492e4[_0xb0ef('0xbf')](function(_0xb03594){_0x1289f9[_0xb0ef('0xbc')]({'name':_0xb03594['Label'][_0xb0ef('0xcb')][_0xb0ef('0xcc')],'value':String(_0xb03594['Value'])});});var _0x5b33fb={'id':_0x2e18e4+'_'+_0x5f208b['LogicalName'],'name':_0x5f208b[_0xb0ef('0xcd')]['UserLocalizedLabel'][_0xb0ef('0xcc')],'custom':![],'options':_0x1289f9};_0x54f8b2[_0xb0ef('0xbc')](_0x5b33fb);return _0x54f8b2;});}function getBooleanList(_0x4be91b,_0x29ab6c,_0x40dba5,_0x84c025,_0x338b69,_0x6b3e2a){var _0x34c841={'method':_0xb0ef('0xb2'),'uri':_0x4be91b+'EntityDefinitions('+_0x84c025+_0xb0ef('0xc8')+_0x338b69+_0xb0ef('0xce'),'headers':{'Authorization':_0xb0ef('0xb3')+_0x6b3e2a,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x34c841)[_0xb0ef('0x1e')](function(_0xab060e){var _0x589d3f=[];_0x589d3f['push']({'name':_0xab060e[_0xb0ef('0xc9')][_0xb0ef('0xcf')][_0xb0ef('0xcc')]['UserLocalizedLabel'][_0xb0ef('0xcc')],'value':_0xb0ef('0xd0')},{'name':_0xab060e[_0xb0ef('0xc9')][_0xb0ef('0xd1')]['Label'][_0xb0ef('0xcb')][_0xb0ef('0xcc')],'value':_0xb0ef('0xd2')});var _0x23f82d={'id':_0x29ab6c+'_'+_0xab060e[_0xb0ef('0xb9')],'name':_0xab060e[_0xb0ef('0xcd')][_0xb0ef('0xcb')][_0xb0ef('0xcc')],'custom':![],'options':_0x589d3f};_0x40dba5[_0xb0ef('0xbc')](_0x23f82d);return _0x40dba5;});}function getInputList(_0x5a99f7,_0x41ee0a,_0x25bb5e,_0x557a80,_0x1c1f99,_0x5eec94,_0x23ae70){var _0x555646={'method':_0xb0ef('0xb2'),'uri':_0x5a99f7+_0xb0ef('0xb7')+_0x1c1f99+_0xb0ef('0xc8')+_0x5eec94+_0xb0ef('0xd3')+_0x25bb5e+_0xb0ef('0xd4'),'headers':{'Authorization':_0xb0ef('0xb3')+_0x23ae70,'If-None-Match':null,'OData-Version':_0xb0ef('0xb4')},'json':!![]};return rp(_0x555646)[_0xb0ef('0x1e')](function(_0x28773b){var _0x4c6301={'id':_0x41ee0a+'_'+_0x28773b[_0xb0ef('0xb9')],'name':_0x28773b[_0xb0ef('0xcd')][_0xb0ef('0xcb')]?_0x28773b[_0xb0ef('0xcd')][_0xb0ef('0xcb')]['Label']:_0x28773b[_0xb0ef('0xb9')],'custom':![],'options':[]};_0x557a80['push'](_0x4c6301);return _0x557a80;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index c8a1409..a2a0651 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 _0x3c46=['api','moment','request-promise','path','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','define','int_dynamics365_accounts','lodash','util'];(function(_0x104504,_0x443c9b){var _0x2f3e8f=function(_0x31c8ca){while(--_0x31c8ca){_0x104504['push'](_0x104504['shift']());}};_0x2f3e8f(++_0x443c9b);}(_0x3c46,0x82));var _0x63c4=function(_0xc7e035,_0x1e62ea){_0xc7e035=_0xc7e035-0x0;var _0x3a0bc3=_0x3c46[_0xc7e035];return _0x3a0bc3;};'use strict';var _=require(_0x63c4('0x0'));var util=require(_0x63c4('0x1'));var logger=require('../../config/logger')(_0x63c4('0x2'));var moment=require(_0x63c4('0x3'));var BPromise=require('bluebird');var rp=require(_0x63c4('0x4'));var fs=require('fs');var path=require(_0x63c4('0x5'));var rimraf=require('rimraf');var config=require(_0x63c4('0x6'));var attributes=require(_0x63c4('0x7'));var integrations=require(_0x63c4('0x8'));module['exports']=function(_0x2fe0e6,_0x137d90){return _0x2fe0e6[_0x63c4('0x9')]('Dynamics365Account',attributes,{'tableName':_0x63c4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x35eb=['define','Dynamics365Account','int_dynamics365_accounts','lodash','api','moment','request-promise','../../config/environment','exports'];(function(_0x54b396,_0x3612ee){var _0x532e6d=function(_0xc8286e){while(--_0xc8286e){_0x54b396['push'](_0x54b396['shift']());}};_0x532e6d(++_0x3612ee);}(_0x35eb,0x174));var _0xb35e=function(_0x3dea7d,_0x2cd4ea){_0x3dea7d=_0x3dea7d-0x0;var _0x53919a=_0x35eb[_0x3dea7d];return _0x53919a;};'use strict';var _=require(_0xb35e('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb35e('0x1'));var moment=require(_0xb35e('0x2'));var BPromise=require('bluebird');var rp=require(_0xb35e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb35e('0x4'));var attributes=require('./intDynamics365Account.attributes');var integrations=require('../../components/integrations/configuration');module[_0xb35e('0x5')]=function(_0x38b7be,_0x852230){return _0x38b7be[_0xb35e('0x6')](_0xb35e('0x7'),attributes,{'tableName':_0xb35e('0x8'),'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 9883cfd..09d2b64 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 _0x16ce=['debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetDynamics365Account','Dynamics365Account','raw','options','where','limit','include','map','model','attributes','then','find','ShowDynamics365Account','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','client','http','request','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent'];(function(_0x4c06a3,_0x1e6b6f){var _0x7ff53c=function(_0x559eff){while(--_0x559eff){_0x4c06a3['push'](_0x4c06a3['shift']());}};_0x7ff53c(++_0x1e6b6f);}(_0x16ce,0xfb));var _0xe16c=function(_0x22da60,_0x35eb4a){_0x22da60=_0x22da60-0x0;var _0x5cff56=_0x16ce[_0x22da60];return _0x5cff56;};'use strict';var _=require('lodash');var util=require(_0xe16c('0x0'));var moment=require(_0xe16c('0x1'));var BPromise=require(_0xe16c('0x2'));var rs=require(_0xe16c('0x3'));var fs=require('fs');var Redis=require(_0xe16c('0x4'));var db=require(_0xe16c('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xe16c('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xe16c('0x7')][_0xe16c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3b149c,_0x1cf3f9,_0x1d8b72){return new BPromise(function(_0x14d6d4,_0x37f822){return client[_0xe16c('0x9')](_0x3b149c,_0x1d8b72)['then'](function(_0x30feb4){logger[_0xe16c('0xa')](_0xe16c('0xb'),_0x1cf3f9,_0xe16c('0xc'));logger[_0xe16c('0xd')](_0xe16c('0xe'),_0x1cf3f9,_0xe16c('0xc'),JSON[_0xe16c('0xf')](_0x30feb4));if(_0x30feb4[_0xe16c('0x10')]){if(_0x30feb4[_0xe16c('0x10')][_0xe16c('0x11')]===0x1f4){logger['error'](_0xe16c('0xb'),_0x1cf3f9,_0x30feb4[_0xe16c('0x10')][_0xe16c('0x12')]);return _0x37f822(_0x30feb4[_0xe16c('0x10')]['message']);}logger['error'](_0xe16c('0xb'),_0x1cf3f9,_0x30feb4[_0xe16c('0x10')][_0xe16c('0x12')]);return _0x14d6d4(_0x30feb4[_0xe16c('0x10')]['message']);}else{logger[_0xe16c('0xa')]('Dynamics365Account,\x20%s,\x20%s',_0x1cf3f9,_0xe16c('0xc'));_0x14d6d4(_0x30feb4[_0xe16c('0x13')][_0xe16c('0x12')]);}})['catch'](function(_0x72f37f){logger[_0xe16c('0x10')](_0xe16c('0xb'),_0x1cf3f9,_0x72f37f);_0x37f822(_0x72f37f);});});}exports[_0xe16c('0x14')]=function(_0x2afddf){var _0x5121f8=this;return new Promise(function(_0x99130d,_0x7867db){return db[_0xe16c('0x15')]['findAll']({'raw':_0x2afddf['options']?_0x2afddf['options'][_0xe16c('0x16')]===undefined?!![]:![]:!![],'where':_0x2afddf[_0xe16c('0x17')]?_0x2afddf[_0xe16c('0x17')][_0xe16c('0x18')]||null:null,'attributes':_0x2afddf[_0xe16c('0x17')]?_0x2afddf[_0xe16c('0x17')]['attributes']||null:null,'limit':_0x2afddf[_0xe16c('0x17')]?_0x2afddf[_0xe16c('0x17')][_0xe16c('0x19')]||null:null,'include':_0x2afddf[_0xe16c('0x17')]?_0x2afddf['options'][_0xe16c('0x1a')]?_[_0xe16c('0x1b')](_0x2afddf[_0xe16c('0x17')][_0xe16c('0x1a')],function(_0x461744){return{'model':db[_0x461744[_0xe16c('0x1c')]],'as':_0x461744['as'],'attributes':_0x461744[_0xe16c('0x1d')],'include':_0x461744[_0xe16c('0x1a')]?_['map'](_0x461744[_0xe16c('0x1a')],function(_0x9fd053){return{'model':db[_0x9fd053['model']],'as':_0x9fd053['as'],'attributes':_0x9fd053[_0xe16c('0x1d')],'include':_0x9fd053['include']?_[_0xe16c('0x1b')](_0x9fd053['include'],function(_0x27cc66){return{'model':db[_0x27cc66[_0xe16c('0x1c')]],'as':_0x27cc66['as'],'attributes':_0x27cc66[_0xe16c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xe16c('0x1e')](function(_0x473025){logger[_0xe16c('0xa')](_0xe16c('0x14'),_0x2afddf);logger[_0xe16c('0xd')](_0xe16c('0x14'),_0x2afddf,JSON[_0xe16c('0xf')](_0x473025));_0x99130d(_0x473025);})['catch'](function(_0x2bd23b){logger[_0xe16c('0x10')](_0xe16c('0x14'),_0x2bd23b['message'],_0x2afddf);_0x7867db(_0x5121f8[_0xe16c('0x10')](0x1f4,_0x2bd23b[_0xe16c('0x12')]));});});};exports['ShowDynamics365Account']=function(_0x1ce8f5){var _0x25ec64=this;return new Promise(function(_0x4ee06e,_0x3e0e51){return db[_0xe16c('0x15')][_0xe16c('0x1f')]({'raw':_0x1ce8f5[_0xe16c('0x17')]?_0x1ce8f5[_0xe16c('0x17')][_0xe16c('0x16')]===undefined?!![]:![]:!![],'where':_0x1ce8f5['options']?_0x1ce8f5[_0xe16c('0x17')][_0xe16c('0x18')]||null:null,'attributes':_0x1ce8f5['options']?_0x1ce8f5[_0xe16c('0x17')][_0xe16c('0x1d')]||null:null,'include':_0x1ce8f5[_0xe16c('0x17')]?_0x1ce8f5[_0xe16c('0x17')][_0xe16c('0x1a')]?_[_0xe16c('0x1b')](_0x1ce8f5[_0xe16c('0x17')]['include'],function(_0x290bd4){return{'model':db[_0x290bd4[_0xe16c('0x1c')]],'as':_0x290bd4['as'],'attributes':_0x290bd4[_0xe16c('0x1d')],'include':_0x290bd4[_0xe16c('0x1a')]?_[_0xe16c('0x1b')](_0x290bd4[_0xe16c('0x1a')],function(_0x15564e){return{'model':db[_0x15564e[_0xe16c('0x1c')]],'as':_0x15564e['as'],'attributes':_0x15564e[_0xe16c('0x1d')],'include':_0x15564e[_0xe16c('0x1a')]?_[_0xe16c('0x1b')](_0x15564e[_0xe16c('0x1a')],function(_0x1f4fe5){return{'model':db[_0x1f4fe5[_0xe16c('0x1c')]],'as':_0x1f4fe5['as'],'attributes':_0x1f4fe5[_0xe16c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xe16c('0x1e')](function(_0x5a3351){logger[_0xe16c('0xa')](_0xe16c('0x20'),_0x1ce8f5);logger[_0xe16c('0xd')](_0xe16c('0x20'),_0x1ce8f5,JSON[_0xe16c('0xf')](_0x5a3351));_0x4ee06e(_0x5a3351);})['catch'](function(_0x4e9b4a){logger[_0xe16c('0x10')](_0xe16c('0x20'),_0x4e9b4a[_0xe16c('0x12')],_0x1ce8f5);_0x3e0e51(_0x25ec64[_0xe16c('0x10')](0x1f4,_0x4e9b4a[_0xe16c('0x12')]));});});}; \ No newline at end of file +var _0x236d=['../../config/logger','jayson/promise','client','http','then','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','GetDynamics365Account','Dynamics365Account','options','raw','where','attributes','limit','include','model','map','ShowDynamics365Account','find','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x236d,0x7e));var _0xd236=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x236d[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xd236('0x0'));var util=require(_0xd236('0x1'));var moment=require('moment');var BPromise=require(_0xd236('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd236('0x3'));var db=require(_0xd236('0x4'))['db'];var utils=require(_0xd236('0x5'));var logger=require(_0xd236('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd236('0x7'));var client=jayson[_0xd236('0x8')][_0xd236('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1aedc6,_0x58c59e,_0x54ac9c){return new BPromise(function(_0x2d9025,_0x18d969){return client['request'](_0x1aedc6,_0x54ac9c)[_0xd236('0xa')](function(_0x110545){logger['info'](_0xd236('0xb'),_0x58c59e,_0xd236('0xc'));logger[_0xd236('0xd')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x58c59e,_0xd236('0xc'),JSON[_0xd236('0xe')](_0x110545));if(_0x110545[_0xd236('0xf')]){if(_0x110545['error'][_0xd236('0x10')]===0x1f4){logger[_0xd236('0xf')](_0xd236('0xb'),_0x58c59e,_0x110545[_0xd236('0xf')][_0xd236('0x11')]);return _0x18d969(_0x110545[_0xd236('0xf')][_0xd236('0x11')]);}logger[_0xd236('0xf')](_0xd236('0xb'),_0x58c59e,_0x110545[_0xd236('0xf')][_0xd236('0x11')]);return _0x2d9025(_0x110545[_0xd236('0xf')][_0xd236('0x11')]);}else{logger[_0xd236('0x12')](_0xd236('0xb'),_0x58c59e,_0xd236('0xc'));_0x2d9025(_0x110545[_0xd236('0x13')][_0xd236('0x11')]);}})[_0xd236('0x14')](function(_0x1956a4){logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x58c59e,_0x1956a4);_0x18d969(_0x1956a4);});});}exports[_0xd236('0x15')]=function(_0x1b02a5){var _0x5346f1=this;return new Promise(function(_0x11c6ec,_0x3484fb){return db[_0xd236('0x16')]['findAll']({'raw':_0x1b02a5[_0xd236('0x17')]?_0x1b02a5[_0xd236('0x17')][_0xd236('0x18')]===undefined?!![]:![]:!![],'where':_0x1b02a5['options']?_0x1b02a5[_0xd236('0x17')][_0xd236('0x19')]||null:null,'attributes':_0x1b02a5[_0xd236('0x17')]?_0x1b02a5[_0xd236('0x17')][_0xd236('0x1a')]||null:null,'limit':_0x1b02a5['options']?_0x1b02a5[_0xd236('0x17')][_0xd236('0x1b')]||null:null,'include':_0x1b02a5[_0xd236('0x17')]?_0x1b02a5[_0xd236('0x17')][_0xd236('0x1c')]?_['map'](_0x1b02a5['options'][_0xd236('0x1c')],function(_0x4be5ac){return{'model':db[_0x4be5ac[_0xd236('0x1d')]],'as':_0x4be5ac['as'],'attributes':_0x4be5ac['attributes'],'include':_0x4be5ac[_0xd236('0x1c')]?_[_0xd236('0x1e')](_0x4be5ac[_0xd236('0x1c')],function(_0x49d822){return{'model':db[_0x49d822[_0xd236('0x1d')]],'as':_0x49d822['as'],'attributes':_0x49d822[_0xd236('0x1a')],'include':_0x49d822[_0xd236('0x1c')]?_[_0xd236('0x1e')](_0x49d822[_0xd236('0x1c')],function(_0x17f927){return{'model':db[_0x17f927[_0xd236('0x1d')]],'as':_0x17f927['as'],'attributes':_0x17f927[_0xd236('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xd236('0xa')](function(_0x2be500){logger[_0xd236('0x12')](_0xd236('0x15'),_0x1b02a5);logger[_0xd236('0xd')](_0xd236('0x15'),_0x1b02a5,JSON[_0xd236('0xe')](_0x2be500));_0x11c6ec(_0x2be500);})[_0xd236('0x14')](function(_0x436a19){logger[_0xd236('0xf')](_0xd236('0x15'),_0x436a19[_0xd236('0x11')],_0x1b02a5);_0x3484fb(_0x5346f1[_0xd236('0xf')](0x1f4,_0x436a19[_0xd236('0x11')]));});});};exports[_0xd236('0x1f')]=function(_0x36f8d4){var _0xdd34a4=this;return new Promise(function(_0x1c50ae,_0xed1acb){return db[_0xd236('0x16')][_0xd236('0x20')]({'raw':_0x36f8d4['options']?_0x36f8d4[_0xd236('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x36f8d4[_0xd236('0x17')]?_0x36f8d4[_0xd236('0x17')][_0xd236('0x19')]||null:null,'attributes':_0x36f8d4['options']?_0x36f8d4[_0xd236('0x17')][_0xd236('0x1a')]||null:null,'include':_0x36f8d4[_0xd236('0x17')]?_0x36f8d4[_0xd236('0x17')][_0xd236('0x1c')]?_[_0xd236('0x1e')](_0x36f8d4[_0xd236('0x17')]['include'],function(_0x2fa782){return{'model':db[_0x2fa782['model']],'as':_0x2fa782['as'],'attributes':_0x2fa782[_0xd236('0x1a')],'include':_0x2fa782['include']?_[_0xd236('0x1e')](_0x2fa782[_0xd236('0x1c')],function(_0x366128){return{'model':db[_0x366128[_0xd236('0x1d')]],'as':_0x366128['as'],'attributes':_0x366128[_0xd236('0x1a')],'include':_0x366128[_0xd236('0x1c')]?_[_0xd236('0x1e')](_0x366128[_0xd236('0x1c')],function(_0x450217){return{'model':db[_0x450217[_0xd236('0x1d')]],'as':_0x450217['as'],'attributes':_0x450217[_0xd236('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xd236('0xa')](function(_0x2d02ac){logger['info'](_0xd236('0x1f'),_0x36f8d4);logger[_0xd236('0xd')](_0xd236('0x1f'),_0x36f8d4,JSON['stringify'](_0x2d02ac));_0x1c50ae(_0x2d02ac);})[_0xd236('0x14')](function(_0xb31e29){logger[_0xd236('0xf')](_0xd236('0x1f'),_0xb31e29[_0xd236('0x11')],_0x36f8d4);_0xed1acb(_0xdd34a4[_0xd236('0xf')](0x1f4,_0xb31e29['message']));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 62c31bf..b9602cc 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 _0x7438=['getDescriptions','post','create','put','update','destroy','exports','util','connect-timeout','Router','../../components/auth/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions'];(function(_0x2fb2dc,_0x3471da){var _0xdc9483=function(_0x58e79f){while(--_0x58e79f){_0x2fb2dc['push'](_0x2fb2dc['shift']());}};_0xdc9483(++_0x3471da);}(_0x7438,0x1a9));var _0x8743=function(_0x2ced26,_0x46247e){_0x2ced26=_0x2ced26-0x0;var _0x46b6eb=_0x7438[_0x2ced26];return _0x46b6eb;};'use strict';var multer=require('multer');var util=require(_0x8743('0x0'));var path=require('path');var timeout=require(_0x8743('0x1'));var express=require('express');var router=express[_0x8743('0x2')]();var auth=require(_0x8743('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x8743('0x4'));var controller=require(_0x8743('0x5'));router[_0x8743('0x6')]('/',auth[_0x8743('0x7')](),controller[_0x8743('0x8')]);router['get'](_0x8743('0x9'),auth[_0x8743('0x7')](),controller[_0x8743('0xa')]);router[_0x8743('0x6')](_0x8743('0xb'),auth[_0x8743('0x7')](),controller['getFields']);router[_0x8743('0x6')](_0x8743('0xc'),auth['isAuthenticated'](),controller[_0x8743('0xd')]);router[_0x8743('0x6')](_0x8743('0xe'),auth['isAuthenticated'](),controller[_0x8743('0xf')]);router[_0x8743('0x10')]('/',auth[_0x8743('0x7')](),controller[_0x8743('0x11')]);router[_0x8743('0x12')](_0x8743('0x9'),auth['isAuthenticated'](),controller[_0x8743('0x13')]);router['delete']('/:id',auth[_0x8743('0x7')](),controller[_0x8743('0x14')]);module[_0x8743('0x15')]=router; \ No newline at end of file +var _0xa5f5=['create','put','update','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','post'];(function(_0x2103c1,_0x49fc3c){var _0x19cb9e=function(_0x4e8aed){while(--_0x4e8aed){_0x2103c1['push'](_0x2103c1['shift']());}};_0x19cb9e(++_0x49fc3c);}(_0xa5f5,0x8f));var _0x5a5f=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xa5f5[_0x57b54c];return _0x59cc19;};'use strict';var multer=require('multer');var util=require(_0x5a5f('0x0'));var path=require(_0x5a5f('0x1'));var timeout=require(_0x5a5f('0x2'));var express=require(_0x5a5f('0x3'));var router=express[_0x5a5f('0x4')]();var auth=require(_0x5a5f('0x5'));var interaction=require(_0x5a5f('0x6'));var config=require(_0x5a5f('0x7'));var controller=require('./intDynamics365Configuration.controller');router[_0x5a5f('0x8')]('/',auth[_0x5a5f('0x9')](),controller[_0x5a5f('0xa')]);router['get'](_0x5a5f('0xb'),auth[_0x5a5f('0x9')](),controller[_0x5a5f('0xc')]);router[_0x5a5f('0x8')]('/:id/fields',auth[_0x5a5f('0x9')](),controller[_0x5a5f('0xd')]);router[_0x5a5f('0x8')](_0x5a5f('0xe'),auth[_0x5a5f('0x9')](),controller[_0x5a5f('0xf')]);router['get'](_0x5a5f('0x10'),auth[_0x5a5f('0x9')](),controller['getDescriptions']);router[_0x5a5f('0x11')]('/',auth['isAuthenticated'](),controller[_0x5a5f('0x12')]);router[_0x5a5f('0x13')](_0x5a5f('0xb'),auth[_0x5a5f('0x9')](),controller[_0x5a5f('0x14')]);router['delete'](_0x5a5f('0xb'),auth[_0x5a5f('0x9')](),controller[_0x5a5f('0x15')]);module[_0x5a5f('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index c76eed9..3be988b 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 _0xe80b=['sequelize','exports','STRING','ENUM','incident','phonecall'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xe80b,0x150));var _0xbe80=function(_0x559ee8,_0x482a67){_0x559ee8=_0x559ee8-0x0;var _0x3f14a9=_0xe80b[_0x559ee8];return _0x3f14a9;};'use strict';var Sequelize=require(_0xbe80('0x0'));module[_0xbe80('0x1')]={'name':{'type':Sequelize[_0xbe80('0x2')]},'description':{'type':Sequelize[_0xbe80('0x2')]},'ticketType':{'type':Sequelize[_0xbe80('0x3')](_0xbe80('0x4'),_0xbe80('0x5')),'defaultValue':_0xbe80('0x4')}}; \ No newline at end of file +var _0xe33f=['exports','STRING','incident','phonecall'];(function(_0x4d05a0,_0x53aa7e){var _0x4c999c=function(_0x358867){while(--_0x358867){_0x4d05a0['push'](_0x4d05a0['shift']());}};_0x4c999c(++_0x53aa7e);}(_0xe33f,0x190));var _0xfe33=function(_0x2b58ad,_0x44bcd9){_0x2b58ad=_0x2b58ad-0x0;var _0x1002e2=_0xe33f[_0x2b58ad];return _0x1002e2;};'use strict';var Sequelize=require('sequelize');module[_0xfe33('0x0')]={'name':{'type':Sequelize[_0xfe33('0x1')]},'description':{'type':Sequelize[_0xfe33('0x1')]},'ticketType':{'type':Sequelize['ENUM'](_0xfe33('0x2'),_0xfe33('0x3')),'defaultValue':_0xfe33('0x2')}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index e6c3e67..6b0b4dc 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 _0x9b69=['desk.js','querystring','papaparse','../../components/auth/service','../../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','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','status','end','json','count','limit','set','Content-Range','apply','reject','save','destroy','name','send','index','map','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','offset','sort','where','filters','pick','filter','merge','VIRTUAL','Dynamics365Configuration','includeAll','include','findAll','rows','show','rawAttributes','options','body','update','find','params','getFields','findOne','getSubjects','Dynamics365Field','order','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce'];(function(_0x9d14e3,_0x5a6072){var _0x19bf32=function(_0x19da07){while(--_0x19da07){_0x9d14e3['push'](_0x9d14e3['shift']());}};_0x19bf32(++_0x5a6072);}(_0x9b69,0x1d9));var _0x99b6=function(_0xb36d7,_0x329cab){_0xb36d7=_0xb36d7-0x0;var _0x38007e=_0x9b69[_0xb36d7];return _0x38007e;};'use strict';var pdf=require(_0x99b6('0x0'));var emlformat=require(_0x99b6('0x1'));var rimraf=require(_0x99b6('0x2'));var zipdir=require(_0x99b6('0x3'));var jsonpatch=require(_0x99b6('0x4'));var rp=require(_0x99b6('0x5'));var moment=require(_0x99b6('0x6'));var BPromise=require(_0x99b6('0x7'));var Mustache=require(_0x99b6('0x8'));var util=require(_0x99b6('0x9'));var path=require('path');var sox=require(_0x99b6('0xa'));var csv=require(_0x99b6('0xb'));var ejs=require(_0x99b6('0xc'));var fs=require('fs');var _=require(_0x99b6('0xd'));var squel=require(_0x99b6('0xe'));var crypto=require(_0x99b6('0xf'));var jsforce=require(_0x99b6('0x10'));var deskjs=require(_0x99b6('0x11'));var toCsv=require(_0x99b6('0xb'));var querystring=require(_0x99b6('0x12'));var Papa=require(_0x99b6('0x13'));var Redis=require('ioredis');var authService=require(_0x99b6('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x99b6('0x15'));var hardwareService=require(_0x99b6('0x16'));var logger=require(_0x99b6('0x17'))(_0x99b6('0x18'));var utils=require(_0x99b6('0x19'));var config=require(_0x99b6('0x1a'));var db=require(_0x99b6('0x1b'))['db'];var jayson=require(_0x99b6('0x1c'));var client=jayson[_0x99b6('0x1d')][_0x99b6('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x68e3ab,_0x2a9a1f,_0x55a2d8){if(_0x55a2d8){var _0x2da857=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2da857[_0x99b6('0x1f')](_0x2a9a1f)){return _0x68e3ab;}else{throw new db[(_0x99b6('0x20'))][(_0x99b6('0x21'))](_0x99b6('0x22'));}}else{return _0x68e3ab;}}function respondWithRpcPromise(_0x2da2b9,_0x246a53,_0x39ae1c,_0xc3ba27){return new BPromise(function(_0x24424a,_0x5dd405){var _0x2fe070=_0xc3ba27||client;return _0x2fe070['request'](_0x2da2b9,_0x39ae1c)[_0x99b6('0x23')](function(_0x2a1b10){logger[_0x99b6('0x24')](_0x99b6('0x25'),_0x246a53,'request\x20sent');logger['debug']('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x246a53,_0x99b6('0x26'),JSON[_0x99b6('0x27')](_0x2a1b10));if(_0x2a1b10['error']){if(_0x2a1b10['error']['code']===0x1f4){logger[_0x99b6('0x28')](_0x99b6('0x25'),_0x246a53,_0x2a1b10['error'][_0x99b6('0x29')]);return _0x5dd405(_0x2a1b10['error'][_0x99b6('0x29')]);}logger[_0x99b6('0x28')](_0x99b6('0x25'),_0x246a53,_0x2a1b10[_0x99b6('0x28')][_0x99b6('0x29')]);return _0x24424a(_0x2a1b10[_0x99b6('0x28')][_0x99b6('0x29')]);}else{logger[_0x99b6('0x24')]('Dynamics365Configuration,\x20%s,\x20%s',_0x246a53,_0x99b6('0x26'));_0x24424a(_0x2a1b10[_0x99b6('0x2a')]['message']);}})[_0x99b6('0x2b')](function(_0x1f22d4){logger['error'](_0x99b6('0x25'),_0x246a53,_0x1f22d4);_0x5dd405(_0x1f22d4);});});}function respondWithStatusCode(_0xc56cf5,_0x182258){_0x182258=_0x182258||0xcc;return function(_0x236769){if(_0x236769){return _0xc56cf5[_0x99b6('0x2c')](_0x182258);}return _0xc56cf5[_0x99b6('0x2d')](_0x182258)[_0x99b6('0x2e')]();};}function respondWithResult(_0x548e98,_0x42ee5c){_0x42ee5c=_0x42ee5c||0xc8;return function(_0x391d27){if(_0x391d27){return _0x548e98[_0x99b6('0x2d')](_0x42ee5c)[_0x99b6('0x2f')](_0x391d27);}};}function respondWithFilteredResult(_0x30fdc5,_0x108064){return function(_0x46b1c4){if(_0x46b1c4){var _0x396c89=_0x46b1c4[_0x99b6('0x30')],_0x30697f=_0x108064['offset'],_0x75b28a=_0x108064['offset']+_0x108064[_0x99b6('0x31')],_0x3e3084;if(_0x75b28a>=_0x396c89){_0x75b28a=_0x396c89;_0x3e3084=0xc8;}else{_0x3e3084=0xce;}_0x30fdc5[_0x99b6('0x2d')](_0x3e3084);return _0x30fdc5[_0x99b6('0x32')](_0x99b6('0x33'),_0x30697f+'-'+_0x75b28a+'/'+_0x396c89)[_0x99b6('0x2f')](_0x46b1c4);}return null;};}function patchUpdates(_0x276492){return function(_0x5c8f08){try{jsonpatch[_0x99b6('0x34')](_0x5c8f08,_0x276492,!![]);}catch(_0xd03c08){return BPromise[_0x99b6('0x35')](_0xd03c08);}return _0x5c8f08[_0x99b6('0x36')]();};}function saveUpdates(_0x331ef9,_0x153f14){return function(_0x1be592){if(_0x1be592){return _0x1be592['update'](_0x331ef9)['then'](function(_0x39c707){return _0x39c707;});}return null;};}function removeEntity(_0x9e25d2,_0x47b769){return function(_0x26aa2e){if(_0x26aa2e){return _0x26aa2e[_0x99b6('0x37')]()[_0x99b6('0x23')](function(){_0x9e25d2[_0x99b6('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x23ec54,_0x5d5493){return function(_0x511daa){if(!_0x511daa){_0x23ec54[_0x99b6('0x2c')](0x194);}return _0x511daa;};}function handleError(_0x29a7da,_0x234314){_0x234314=_0x234314||0x1f4;return function(_0x4eed33){logger['error'](_0x4eed33['stack']);if(_0x4eed33[_0x99b6('0x38')]){delete _0x4eed33['name'];}_0x29a7da[_0x99b6('0x2d')](_0x234314)[_0x99b6('0x39')](_0x4eed33);};}exports[_0x99b6('0x3a')]=function(_0x2757ee,_0xa9c81c){var _0x3d79d7={},_0x2e0d12={},_0x155241={'count':0x0,'rows':[]};var _0x4d26b1=_[_0x99b6('0x3b')](db['Dynamics365Configuration']['rawAttributes'],function(_0x329d62){return{'name':_0x329d62[_0x99b6('0x3c')],'type':_0x329d62[_0x99b6('0x3d')][_0x99b6('0x3e')]};});_0x2e0d12[_0x99b6('0x3f')]=_[_0x99b6('0x3b')](_0x4d26b1,_0x99b6('0x38'));_0x2e0d12[_0x99b6('0x40')]=_[_0x99b6('0x41')](_0x2757ee[_0x99b6('0x40')]);_0x2e0d12['filters']=_[_0x99b6('0x42')](_0x2e0d12[_0x99b6('0x3f')],_0x2e0d12['query']);_0x3d79d7['attributes']=_['intersection'](_0x2e0d12[_0x99b6('0x3f')],qs[_0x99b6('0x43')](_0x2757ee[_0x99b6('0x40')][_0x99b6('0x43')]));_0x3d79d7[_0x99b6('0x44')]=_0x3d79d7[_0x99b6('0x44')][_0x99b6('0x45')]?_0x3d79d7[_0x99b6('0x44')]:_0x2e0d12['model'];if(!_0x2757ee[_0x99b6('0x40')][_0x99b6('0x46')](_0x99b6('0x47'))){_0x3d79d7[_0x99b6('0x31')]=qs['limit'](_0x2757ee[_0x99b6('0x40')][_0x99b6('0x31')]);_0x3d79d7[_0x99b6('0x48')]=qs['offset'](_0x2757ee['query'][_0x99b6('0x48')]);}_0x3d79d7['order']=qs[_0x99b6('0x49')](_0x2757ee[_0x99b6('0x40')][_0x99b6('0x49')]);_0x3d79d7[_0x99b6('0x4a')]=qs[_0x99b6('0x4b')](_[_0x99b6('0x4c')](_0x2757ee[_0x99b6('0x40')],_0x2e0d12[_0x99b6('0x4b')]));if(_0x2757ee[_0x99b6('0x40')][_0x99b6('0x4d')]){_0x3d79d7[_0x99b6('0x4a')]=_[_0x99b6('0x4e')](_0x3d79d7[_0x99b6('0x4a')],{'$or':_[_0x99b6('0x3b')](_0x4d26b1,function(_0x270c4d){if(_0x270c4d['type']!==_0x99b6('0x4f')){var _0x2c3fa4={};_0x2c3fa4[_0x270c4d[_0x99b6('0x38')]]={'$like':'%'+_0x2757ee['query']['filter']+'%'};return _0x2c3fa4;}})});}_0x3d79d7=_[_0x99b6('0x4e')]({},_0x3d79d7,_0x2757ee['options']);var _0x598f41={'where':_0x3d79d7[_0x99b6('0x4a')]};return db[_0x99b6('0x50')][_0x99b6('0x30')](_0x598f41)[_0x99b6('0x23')](function(_0x554505){_0x155241['count']=_0x554505;if(_0x2757ee[_0x99b6('0x40')][_0x99b6('0x51')]){_0x3d79d7[_0x99b6('0x52')]=[{'all':!![]}];}return db['Dynamics365Configuration'][_0x99b6('0x53')](_0x3d79d7);})[_0x99b6('0x23')](function(_0x3371cf){_0x155241[_0x99b6('0x54')]=_0x3371cf;return _0x155241;})['then'](respondWithFilteredResult(_0xa9c81c,_0x3d79d7))[_0x99b6('0x2b')](handleError(_0xa9c81c,null));};exports[_0x99b6('0x55')]=function(_0x2a1cda,_0x5bfb32){var _0x59b17d={'raw':![],'where':{'id':_0x2a1cda['params']['id']}},_0x457614={};_0x457614[_0x99b6('0x3f')]=_[_0x99b6('0x41')](db[_0x99b6('0x50')][_0x99b6('0x56')]);_0x457614[_0x99b6('0x40')]=_['keys'](_0x2a1cda[_0x99b6('0x40')]);_0x457614[_0x99b6('0x4b')]=_['intersection'](_0x457614[_0x99b6('0x3f')],_0x457614[_0x99b6('0x40')]);_0x59b17d[_0x99b6('0x44')]=_[_0x99b6('0x42')](_0x457614['model'],qs[_0x99b6('0x43')](_0x2a1cda[_0x99b6('0x40')][_0x99b6('0x43')]));_0x59b17d[_0x99b6('0x44')]=_0x59b17d[_0x99b6('0x44')][_0x99b6('0x45')]?_0x59b17d['attributes']:_0x457614['model'];if(_0x2a1cda[_0x99b6('0x40')][_0x99b6('0x51')]){_0x59b17d['include']=[{'all':!![]}];}_0x59b17d=_[_0x99b6('0x4e')]({},_0x59b17d,_0x2a1cda[_0x99b6('0x57')]);return db[_0x99b6('0x50')]['find'](_0x59b17d)[_0x99b6('0x23')](handleEntityNotFound(_0x5bfb32,null))['then'](respondWithResult(_0x5bfb32,null))[_0x99b6('0x2b')](handleError(_0x5bfb32,null));};exports['create']=function(_0x4db855,_0xbf260){return db[_0x99b6('0x50')]['create'](_0x4db855[_0x99b6('0x58')],{})[_0x99b6('0x23')](respondWithResult(_0xbf260,0xc9))['catch'](handleError(_0xbf260,null));};exports[_0x99b6('0x59')]=function(_0x4909ea,_0x33dcb3){if(_0x4909ea[_0x99b6('0x58')]['id']){delete _0x4909ea[_0x99b6('0x58')]['id'];}return db[_0x99b6('0x50')][_0x99b6('0x5a')]({'where':{'id':_0x4909ea['params']['id']}})['then'](handleEntityNotFound(_0x33dcb3,null))['then'](saveUpdates(_0x4909ea[_0x99b6('0x58')],null))['then'](respondWithResult(_0x33dcb3,null))[_0x99b6('0x2b')](handleError(_0x33dcb3,null));};exports[_0x99b6('0x37')]=function(_0x324736,_0x36e1b2){return db[_0x99b6('0x50')][_0x99b6('0x5a')]({'where':{'id':_0x324736[_0x99b6('0x5b')]['id']}})['then'](handleEntityNotFound(_0x36e1b2,null))[_0x99b6('0x23')](removeEntity(_0x36e1b2,null))[_0x99b6('0x2b')](handleError(_0x36e1b2,null));};exports[_0x99b6('0x5c')]=function(_0x372201,_0x55a1bf,_0x22cdd4){var _0x49272d={};var _0x2d5b72={};var _0x3a276f;var _0x29c62d;return db[_0x99b6('0x50')][_0x99b6('0x5d')]({'where':{'id':_0x372201[_0x99b6('0x5b')]['id']}})['then'](handleEntityNotFound(_0x55a1bf,null))[_0x99b6('0x23')](function(_0x45dc85){if(_0x45dc85){_0x3a276f=_0x45dc85;_0x2d5b72[_0x99b6('0x3f')]=_[_0x99b6('0x41')](db['Dynamics365Field'][_0x99b6('0x56')]);_0x2d5b72[_0x99b6('0x40')]=_[_0x99b6('0x41')](_0x372201[_0x99b6('0x40')]);_0x2d5b72[_0x99b6('0x4b')]=_[_0x99b6('0x42')](_0x2d5b72[_0x99b6('0x3f')],_0x2d5b72['query']);_0x49272d[_0x99b6('0x44')]=_[_0x99b6('0x42')](_0x2d5b72[_0x99b6('0x3f')],qs['fields'](_0x372201[_0x99b6('0x40')]['fields']));_0x49272d['attributes']=_0x49272d['attributes'][_0x99b6('0x45')]?_0x49272d['attributes']:_0x2d5b72[_0x99b6('0x3f')];_0x49272d['order']=qs[_0x99b6('0x49')](_0x372201['query'][_0x99b6('0x49')]);_0x49272d[_0x99b6('0x4a')]=qs[_0x99b6('0x4b')](_['pick'](_0x372201[_0x99b6('0x40')],_0x2d5b72[_0x99b6('0x4b')]));if(_0x372201[_0x99b6('0x40')]['filter']){_0x49272d[_0x99b6('0x4a')]=_[_0x99b6('0x4e')](_0x49272d[_0x99b6('0x4a')],{'$or':_[_0x99b6('0x3b')](_0x49272d[_0x99b6('0x44')],function(_0x27f58e){var _0x57a1f7={};_0x57a1f7[_0x27f58e]={'$like':'%'+_0x372201[_0x99b6('0x40')][_0x99b6('0x4d')]+'%'};return _0x57a1f7;})});}_0x49272d=_[_0x99b6('0x4e')]({},_0x49272d,_0x372201[_0x99b6('0x57')]);return _0x3a276f['getFields'](_0x49272d);}})[_0x99b6('0x23')](function(_0x1f4af8){if(_0x1f4af8){_0x29c62d=_0x1f4af8[_0x99b6('0x45')];if(!_0x372201[_0x99b6('0x40')][_0x99b6('0x46')](_0x99b6('0x47'))){_0x49272d['limit']=qs['limit'](_0x372201[_0x99b6('0x40')][_0x99b6('0x31')]);_0x49272d['offset']=qs[_0x99b6('0x48')](_0x372201['query'][_0x99b6('0x48')]);}return _0x3a276f[_0x99b6('0x5c')](_0x49272d);}})[_0x99b6('0x23')](function(_0x2c8fc4){if(_0x2c8fc4){return _0x2c8fc4?{'count':_0x29c62d,'rows':_0x2c8fc4}:null;}})[_0x99b6('0x23')](respondWithResult(_0x55a1bf,null))[_0x99b6('0x2b')](handleError(_0x55a1bf,null));};exports[_0x99b6('0x5e')]=function(_0x2221b5,_0x52ea5c,_0x50882d){var _0x3adf8d={};var _0x4c44c5={};var _0x1b7b92;var _0xd1e790;return db['Dynamics365Configuration'][_0x99b6('0x5d')]({'where':{'id':_0x2221b5[_0x99b6('0x5b')]['id']}})[_0x99b6('0x23')](handleEntityNotFound(_0x52ea5c,null))[_0x99b6('0x23')](function(_0x1f1e28){if(_0x1f1e28){_0x1b7b92=_0x1f1e28;_0x4c44c5[_0x99b6('0x3f')]=_[_0x99b6('0x41')](db[_0x99b6('0x5f')][_0x99b6('0x56')]);_0x4c44c5[_0x99b6('0x40')]=_[_0x99b6('0x41')](_0x2221b5[_0x99b6('0x40')]);_0x4c44c5[_0x99b6('0x4b')]=_[_0x99b6('0x42')](_0x4c44c5[_0x99b6('0x3f')],_0x4c44c5[_0x99b6('0x40')]);_0x3adf8d[_0x99b6('0x44')]=_[_0x99b6('0x42')](_0x4c44c5[_0x99b6('0x3f')],qs['fields'](_0x2221b5[_0x99b6('0x40')][_0x99b6('0x43')]));_0x3adf8d[_0x99b6('0x44')]=_0x3adf8d[_0x99b6('0x44')][_0x99b6('0x45')]?_0x3adf8d[_0x99b6('0x44')]:_0x4c44c5[_0x99b6('0x3f')];_0x3adf8d[_0x99b6('0x60')]=qs[_0x99b6('0x49')](_0x2221b5[_0x99b6('0x40')][_0x99b6('0x49')]);_0x3adf8d['where']=qs[_0x99b6('0x4b')](_[_0x99b6('0x4c')](_0x2221b5[_0x99b6('0x40')],_0x4c44c5[_0x99b6('0x4b')]));if(_0x2221b5[_0x99b6('0x40')][_0x99b6('0x4d')]){_0x3adf8d[_0x99b6('0x4a')]=_['merge'](_0x3adf8d[_0x99b6('0x4a')],{'$or':_[_0x99b6('0x3b')](_0x3adf8d[_0x99b6('0x44')],function(_0x338b46){var _0x3e6da9={};_0x3e6da9[_0x338b46]={'$like':'%'+_0x2221b5['query'][_0x99b6('0x4d')]+'%'};return _0x3e6da9;})});}_0x3adf8d=_['merge']({},_0x3adf8d,_0x2221b5[_0x99b6('0x57')]);return _0x1b7b92['getSubjects'](_0x3adf8d);}})['then'](function(_0x447d75){if(_0x447d75){_0xd1e790=_0x447d75['length'];if(!_0x2221b5[_0x99b6('0x40')]['hasOwnProperty']('nolimit')){_0x3adf8d[_0x99b6('0x31')]=qs[_0x99b6('0x31')](_0x2221b5[_0x99b6('0x40')][_0x99b6('0x31')]);_0x3adf8d[_0x99b6('0x48')]=qs['offset'](_0x2221b5[_0x99b6('0x40')][_0x99b6('0x48')]);}return _0x1b7b92[_0x99b6('0x5e')](_0x3adf8d);}})[_0x99b6('0x23')](function(_0x309ee5){if(_0x309ee5){return _0x309ee5?{'count':_0xd1e790,'rows':_0x309ee5}:null;}})['then'](respondWithResult(_0x52ea5c,null))['catch'](handleError(_0x52ea5c,null));};exports['getDescriptions']=function(_0x124ff4,_0x2be6e7,_0x18dc86){var _0xb3e34f={};var _0x3decd4={};var _0x147a81;var _0x18da44;return db[_0x99b6('0x50')][_0x99b6('0x5d')]({'where':{'id':_0x124ff4[_0x99b6('0x5b')]['id']}})[_0x99b6('0x23')](handleEntityNotFound(_0x2be6e7,null))[_0x99b6('0x23')](function(_0x43e8eb){if(_0x43e8eb){_0x147a81=_0x43e8eb;_0x3decd4[_0x99b6('0x3f')]=_[_0x99b6('0x41')](db['Dynamics365Field'][_0x99b6('0x56')]);_0x3decd4['query']=_['keys'](_0x124ff4[_0x99b6('0x40')]);_0x3decd4[_0x99b6('0x4b')]=_['intersection'](_0x3decd4[_0x99b6('0x3f')],_0x3decd4[_0x99b6('0x40')]);_0xb3e34f[_0x99b6('0x44')]=_[_0x99b6('0x42')](_0x3decd4['model'],qs[_0x99b6('0x43')](_0x124ff4['query']['fields']));_0xb3e34f['attributes']=_0xb3e34f['attributes']['length']?_0xb3e34f[_0x99b6('0x44')]:_0x3decd4[_0x99b6('0x3f')];_0xb3e34f[_0x99b6('0x60')]=qs[_0x99b6('0x49')](_0x124ff4[_0x99b6('0x40')][_0x99b6('0x49')]);_0xb3e34f[_0x99b6('0x4a')]=qs['filters'](_[_0x99b6('0x4c')](_0x124ff4[_0x99b6('0x40')],_0x3decd4[_0x99b6('0x4b')]));if(_0x124ff4['query'][_0x99b6('0x4d')]){_0xb3e34f[_0x99b6('0x4a')]=_['merge'](_0xb3e34f['where'],{'$or':_['map'](_0xb3e34f['attributes'],function(_0x5f4542){var _0x425b43={};_0x425b43[_0x5f4542]={'$like':'%'+_0x124ff4[_0x99b6('0x40')]['filter']+'%'};return _0x425b43;})});}_0xb3e34f=_[_0x99b6('0x4e')]({},_0xb3e34f,_0x124ff4[_0x99b6('0x57')]);return _0x147a81[_0x99b6('0x61')](_0xb3e34f);}})[_0x99b6('0x23')](function(_0x300856){if(_0x300856){_0x18da44=_0x300856[_0x99b6('0x45')];if(!_0x124ff4[_0x99b6('0x40')]['hasOwnProperty'](_0x99b6('0x47'))){_0xb3e34f[_0x99b6('0x31')]=qs[_0x99b6('0x31')](_0x124ff4['query']['limit']);_0xb3e34f[_0x99b6('0x48')]=qs[_0x99b6('0x48')](_0x124ff4[_0x99b6('0x40')]['offset']);}return _0x147a81[_0x99b6('0x61')](_0xb3e34f);}})['then'](function(_0x250b76){if(_0x250b76){return _0x250b76?{'count':_0x18da44,'rows':_0x250b76}:null;}})[_0x99b6('0x23')](respondWithResult(_0x2be6e7,null))[_0x99b6('0x2b')](handleError(_0x2be6e7,null));}; \ No newline at end of file +var _0x53c9=['where','filters','filter','merge','VIRTUAL','options','count','include','findAll','rows','params','length','includeAll','find','create','body','getFields','findOne','order','pick','hasOwnProperty','nolimit','getSubjects','Dynamics365Field','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','error','message','result','catch','status','end','json','offset','limit','set','Content-Range','apply','save','update','destroy','sendStatus','stack','name','send','map','Dynamics365Configuration','rawAttributes','type','key','keys','query','intersection','attributes','fields','model','sort'];(function(_0x5d0285,_0x253d9b){var _0x21c866=function(_0x5e38f6){while(--_0x5e38f6){_0x5d0285['push'](_0x5d0285['shift']());}};_0x21c866(++_0x253d9b);}(_0x53c9,0xcf));var _0x953c=function(_0x4fe526,_0x34b040){_0x4fe526=_0x4fe526-0x0;var _0x1c4ba0=_0x53c9[_0x4fe526];return _0x1c4ba0;};'use strict';var pdf=require(_0x953c('0x0'));var emlformat=require(_0x953c('0x1'));var rimraf=require(_0x953c('0x2'));var zipdir=require(_0x953c('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x953c('0x4'));var BPromise=require(_0x953c('0x5'));var Mustache=require(_0x953c('0x6'));var util=require(_0x953c('0x7'));var path=require(_0x953c('0x8'));var sox=require(_0x953c('0x9'));var csv=require(_0x953c('0xa'));var ejs=require(_0x953c('0xb'));var fs=require('fs');var _=require(_0x953c('0xc'));var squel=require(_0x953c('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x953c('0xe'));var toCsv=require(_0x953c('0xa'));var querystring=require(_0x953c('0xf'));var Papa=require('papaparse');var Redis=require(_0x953c('0x10'));var authService=require(_0x953c('0x11'));var qs=require(_0x953c('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x953c('0x13'));var logger=require(_0x953c('0x14'))('api');var utils=require(_0x953c('0x15'));var config=require(_0x953c('0x16'));var db=require(_0x953c('0x17'))['db'];var jayson=require(_0x953c('0x18'));var client=jayson[_0x953c('0x19')][_0x953c('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x7d7ce3,_0x4d8bbe,_0x4e7120){if(_0x4e7120){var _0x3eb4fd=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3eb4fd['test'](_0x4d8bbe)){return _0x7d7ce3;}else{throw new db['Sequelize'][(_0x953c('0x1b'))](_0x953c('0x1c'));}}else{return _0x7d7ce3;}}function respondWithRpcPromise(_0x2cc894,_0x40916f,_0x163472,_0x46b091){return new BPromise(function(_0x4cefc3,_0x26d636){var _0x41f397=_0x46b091||client;return _0x41f397['request'](_0x2cc894,_0x163472)[_0x953c('0x1d')](function(_0x43c53d){logger[_0x953c('0x1e')](_0x953c('0x1f'),_0x40916f,_0x953c('0x20'));logger[_0x953c('0x21')](_0x953c('0x22'),_0x40916f,_0x953c('0x20'),JSON['stringify'](_0x43c53d));if(_0x43c53d[_0x953c('0x23')]){if(_0x43c53d[_0x953c('0x23')]['code']===0x1f4){logger[_0x953c('0x23')]('Dynamics365Configuration,\x20%s,\x20%s',_0x40916f,_0x43c53d[_0x953c('0x23')]['message']);return _0x26d636(_0x43c53d[_0x953c('0x23')]['message']);}logger[_0x953c('0x23')](_0x953c('0x1f'),_0x40916f,_0x43c53d[_0x953c('0x23')][_0x953c('0x24')]);return _0x4cefc3(_0x43c53d[_0x953c('0x23')][_0x953c('0x24')]);}else{logger[_0x953c('0x1e')]('Dynamics365Configuration,\x20%s,\x20%s',_0x40916f,_0x953c('0x20'));_0x4cefc3(_0x43c53d[_0x953c('0x25')]['message']);}})[_0x953c('0x26')](function(_0xf08194){logger['error'](_0x953c('0x1f'),_0x40916f,_0xf08194);_0x26d636(_0xf08194);});});}function respondWithStatusCode(_0x1ba5d2,_0x3d1bd5){_0x3d1bd5=_0x3d1bd5||0xcc;return function(_0x2156e8){if(_0x2156e8){return _0x1ba5d2['sendStatus'](_0x3d1bd5);}return _0x1ba5d2[_0x953c('0x27')](_0x3d1bd5)[_0x953c('0x28')]();};}function respondWithResult(_0x23a0fd,_0x105b97){_0x105b97=_0x105b97||0xc8;return function(_0x2e91d3){if(_0x2e91d3){return _0x23a0fd[_0x953c('0x27')](_0x105b97)[_0x953c('0x29')](_0x2e91d3);}};}function respondWithFilteredResult(_0x4e37d1,_0x194afd){return function(_0xdae41a){if(_0xdae41a){var _0x158b0c=_0xdae41a['count'],_0x5c029d=_0x194afd[_0x953c('0x2a')],_0x3821d2=_0x194afd[_0x953c('0x2a')]+_0x194afd[_0x953c('0x2b')],_0x5e9070;if(_0x3821d2>=_0x158b0c){_0x3821d2=_0x158b0c;_0x5e9070=0xc8;}else{_0x5e9070=0xce;}_0x4e37d1[_0x953c('0x27')](_0x5e9070);return _0x4e37d1[_0x953c('0x2c')](_0x953c('0x2d'),_0x5c029d+'-'+_0x3821d2+'/'+_0x158b0c)[_0x953c('0x29')](_0xdae41a);}return null;};}function patchUpdates(_0x5af772){return function(_0x5d45b4){try{jsonpatch[_0x953c('0x2e')](_0x5d45b4,_0x5af772,!![]);}catch(_0x1afec5){return BPromise['reject'](_0x1afec5);}return _0x5d45b4[_0x953c('0x2f')]();};}function saveUpdates(_0xe497b,_0x454cc7){return function(_0x578604){if(_0x578604){return _0x578604[_0x953c('0x30')](_0xe497b)[_0x953c('0x1d')](function(_0xb6167){return _0xb6167;});}return null;};}function removeEntity(_0x238062,_0x1c23b8){return function(_0x58faae){if(_0x58faae){return _0x58faae[_0x953c('0x31')]()[_0x953c('0x1d')](function(){_0x238062[_0x953c('0x27')](0xcc)[_0x953c('0x28')]();});}};}function handleEntityNotFound(_0x40189f,_0x1d47fa){return function(_0x1d5c3e){if(!_0x1d5c3e){_0x40189f[_0x953c('0x32')](0x194);}return _0x1d5c3e;};}function handleError(_0x51d4e5,_0x16ea4d){_0x16ea4d=_0x16ea4d||0x1f4;return function(_0x3b0f60){logger['error'](_0x3b0f60[_0x953c('0x33')]);if(_0x3b0f60[_0x953c('0x34')]){delete _0x3b0f60[_0x953c('0x34')];}_0x51d4e5[_0x953c('0x27')](_0x16ea4d)[_0x953c('0x35')](_0x3b0f60);};}exports['index']=function(_0x1c84bb,_0x4ccc0b){var _0x243e3d={},_0x504070={},_0x5c2442={'count':0x0,'rows':[]};var _0x3620d0=_[_0x953c('0x36')](db[_0x953c('0x37')][_0x953c('0x38')],function(_0x220527){return{'name':_0x220527['fieldName'],'type':_0x220527[_0x953c('0x39')][_0x953c('0x3a')]};});_0x504070['model']=_['map'](_0x3620d0,_0x953c('0x34'));_0x504070['query']=_[_0x953c('0x3b')](_0x1c84bb[_0x953c('0x3c')]);_0x504070['filters']=_[_0x953c('0x3d')](_0x504070['model'],_0x504070[_0x953c('0x3c')]);_0x243e3d[_0x953c('0x3e')]=_[_0x953c('0x3d')](_0x504070['model'],qs['fields'](_0x1c84bb[_0x953c('0x3c')][_0x953c('0x3f')]));_0x243e3d[_0x953c('0x3e')]=_0x243e3d[_0x953c('0x3e')]['length']?_0x243e3d[_0x953c('0x3e')]:_0x504070[_0x953c('0x40')];if(!_0x1c84bb['query']['hasOwnProperty']('nolimit')){_0x243e3d[_0x953c('0x2b')]=qs[_0x953c('0x2b')](_0x1c84bb[_0x953c('0x3c')][_0x953c('0x2b')]);_0x243e3d[_0x953c('0x2a')]=qs['offset'](_0x1c84bb[_0x953c('0x3c')][_0x953c('0x2a')]);}_0x243e3d['order']=qs[_0x953c('0x41')](_0x1c84bb[_0x953c('0x3c')][_0x953c('0x41')]);_0x243e3d[_0x953c('0x42')]=qs[_0x953c('0x43')](_['pick'](_0x1c84bb['query'],_0x504070[_0x953c('0x43')]));if(_0x1c84bb[_0x953c('0x3c')][_0x953c('0x44')]){_0x243e3d[_0x953c('0x42')]=_[_0x953c('0x45')](_0x243e3d['where'],{'$or':_[_0x953c('0x36')](_0x3620d0,function(_0x44fea6){if(_0x44fea6[_0x953c('0x39')]!==_0x953c('0x46')){var _0x5a8c24={};_0x5a8c24[_0x44fea6[_0x953c('0x34')]]={'$like':'%'+_0x1c84bb[_0x953c('0x3c')][_0x953c('0x44')]+'%'};return _0x5a8c24;}})});}_0x243e3d=_[_0x953c('0x45')]({},_0x243e3d,_0x1c84bb[_0x953c('0x47')]);var _0x24d7a7={'where':_0x243e3d[_0x953c('0x42')]};return db[_0x953c('0x37')][_0x953c('0x48')](_0x24d7a7)[_0x953c('0x1d')](function(_0x287d62){_0x5c2442[_0x953c('0x48')]=_0x287d62;if(_0x1c84bb[_0x953c('0x3c')]['includeAll']){_0x243e3d[_0x953c('0x49')]=[{'all':!![]}];}return db[_0x953c('0x37')][_0x953c('0x4a')](_0x243e3d);})[_0x953c('0x1d')](function(_0x2b11bc){_0x5c2442[_0x953c('0x4b')]=_0x2b11bc;return _0x5c2442;})[_0x953c('0x1d')](respondWithFilteredResult(_0x4ccc0b,_0x243e3d))[_0x953c('0x26')](handleError(_0x4ccc0b,null));};exports['show']=function(_0xde677,_0x5db0ea){var _0x18a726={'raw':![],'where':{'id':_0xde677[_0x953c('0x4c')]['id']}},_0x5d259a={};_0x5d259a['model']=_[_0x953c('0x3b')](db['Dynamics365Configuration'][_0x953c('0x38')]);_0x5d259a[_0x953c('0x3c')]=_['keys'](_0xde677[_0x953c('0x3c')]);_0x5d259a[_0x953c('0x43')]=_[_0x953c('0x3d')](_0x5d259a[_0x953c('0x40')],_0x5d259a[_0x953c('0x3c')]);_0x18a726[_0x953c('0x3e')]=_[_0x953c('0x3d')](_0x5d259a[_0x953c('0x40')],qs[_0x953c('0x3f')](_0xde677[_0x953c('0x3c')]['fields']));_0x18a726[_0x953c('0x3e')]=_0x18a726[_0x953c('0x3e')][_0x953c('0x4d')]?_0x18a726['attributes']:_0x5d259a[_0x953c('0x40')];if(_0xde677[_0x953c('0x3c')][_0x953c('0x4e')]){_0x18a726['include']=[{'all':!![]}];}_0x18a726=_['merge']({},_0x18a726,_0xde677['options']);return db[_0x953c('0x37')][_0x953c('0x4f')](_0x18a726)[_0x953c('0x1d')](handleEntityNotFound(_0x5db0ea,null))[_0x953c('0x1d')](respondWithResult(_0x5db0ea,null))[_0x953c('0x26')](handleError(_0x5db0ea,null));};exports[_0x953c('0x50')]=function(_0x46a7e3,_0x5024ea){return db[_0x953c('0x37')][_0x953c('0x50')](_0x46a7e3[_0x953c('0x51')],{})[_0x953c('0x1d')](respondWithResult(_0x5024ea,0xc9))[_0x953c('0x26')](handleError(_0x5024ea,null));};exports['update']=function(_0x407eb2,_0x2db5a4){if(_0x407eb2[_0x953c('0x51')]['id']){delete _0x407eb2['body']['id'];}return db[_0x953c('0x37')][_0x953c('0x4f')]({'where':{'id':_0x407eb2[_0x953c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2db5a4,null))[_0x953c('0x1d')](saveUpdates(_0x407eb2['body'],null))['then'](respondWithResult(_0x2db5a4,null))[_0x953c('0x26')](handleError(_0x2db5a4,null));};exports[_0x953c('0x31')]=function(_0x33326a,_0x4d9df){return db[_0x953c('0x37')][_0x953c('0x4f')]({'where':{'id':_0x33326a[_0x953c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4d9df,null))[_0x953c('0x1d')](removeEntity(_0x4d9df,null))[_0x953c('0x26')](handleError(_0x4d9df,null));};exports[_0x953c('0x52')]=function(_0x59cc6e,_0x4faebb,_0x2ffd41){var _0x3ea68b={};var _0x3fe8aa={};var _0x7aa703;var _0x263d42;return db[_0x953c('0x37')][_0x953c('0x53')]({'where':{'id':_0x59cc6e[_0x953c('0x4c')]['id']}})[_0x953c('0x1d')](handleEntityNotFound(_0x4faebb,null))[_0x953c('0x1d')](function(_0x5ace41){if(_0x5ace41){_0x7aa703=_0x5ace41;_0x3fe8aa[_0x953c('0x40')]=_[_0x953c('0x3b')](db['Dynamics365Field'][_0x953c('0x38')]);_0x3fe8aa[_0x953c('0x3c')]=_['keys'](_0x59cc6e[_0x953c('0x3c')]);_0x3fe8aa[_0x953c('0x43')]=_['intersection'](_0x3fe8aa['model'],_0x3fe8aa['query']);_0x3ea68b[_0x953c('0x3e')]=_['intersection'](_0x3fe8aa[_0x953c('0x40')],qs[_0x953c('0x3f')](_0x59cc6e[_0x953c('0x3c')][_0x953c('0x3f')]));_0x3ea68b[_0x953c('0x3e')]=_0x3ea68b[_0x953c('0x3e')][_0x953c('0x4d')]?_0x3ea68b[_0x953c('0x3e')]:_0x3fe8aa[_0x953c('0x40')];_0x3ea68b[_0x953c('0x54')]=qs[_0x953c('0x41')](_0x59cc6e['query'][_0x953c('0x41')]);_0x3ea68b['where']=qs[_0x953c('0x43')](_[_0x953c('0x55')](_0x59cc6e['query'],_0x3fe8aa[_0x953c('0x43')]));if(_0x59cc6e[_0x953c('0x3c')]['filter']){_0x3ea68b['where']=_[_0x953c('0x45')](_0x3ea68b[_0x953c('0x42')],{'$or':_[_0x953c('0x36')](_0x3ea68b[_0x953c('0x3e')],function(_0x43640c){var _0x3478c6={};_0x3478c6[_0x43640c]={'$like':'%'+_0x59cc6e[_0x953c('0x3c')][_0x953c('0x44')]+'%'};return _0x3478c6;})});}_0x3ea68b=_['merge']({},_0x3ea68b,_0x59cc6e[_0x953c('0x47')]);return _0x7aa703[_0x953c('0x52')](_0x3ea68b);}})['then'](function(_0x1d25a8){if(_0x1d25a8){_0x263d42=_0x1d25a8[_0x953c('0x4d')];if(!_0x59cc6e['query'][_0x953c('0x56')](_0x953c('0x57'))){_0x3ea68b['limit']=qs[_0x953c('0x2b')](_0x59cc6e['query'][_0x953c('0x2b')]);_0x3ea68b[_0x953c('0x2a')]=qs[_0x953c('0x2a')](_0x59cc6e[_0x953c('0x3c')][_0x953c('0x2a')]);}return _0x7aa703[_0x953c('0x52')](_0x3ea68b);}})[_0x953c('0x1d')](function(_0x2a2bd6){if(_0x2a2bd6){return _0x2a2bd6?{'count':_0x263d42,'rows':_0x2a2bd6}:null;}})[_0x953c('0x1d')](respondWithResult(_0x4faebb,null))[_0x953c('0x26')](handleError(_0x4faebb,null));};exports[_0x953c('0x58')]=function(_0x267697,_0x17f64a,_0x2dd9c9){var _0x5739fb={};var _0x49dd1f={};var _0xfcbb02;var _0x3b58fd;return db['Dynamics365Configuration'][_0x953c('0x53')]({'where':{'id':_0x267697[_0x953c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x17f64a,null))['then'](function(_0x449761){if(_0x449761){_0xfcbb02=_0x449761;_0x49dd1f[_0x953c('0x40')]=_[_0x953c('0x3b')](db[_0x953c('0x59')][_0x953c('0x38')]);_0x49dd1f[_0x953c('0x3c')]=_[_0x953c('0x3b')](_0x267697[_0x953c('0x3c')]);_0x49dd1f[_0x953c('0x43')]=_[_0x953c('0x3d')](_0x49dd1f['model'],_0x49dd1f[_0x953c('0x3c')]);_0x5739fb[_0x953c('0x3e')]=_['intersection'](_0x49dd1f[_0x953c('0x40')],qs[_0x953c('0x3f')](_0x267697['query'][_0x953c('0x3f')]));_0x5739fb[_0x953c('0x3e')]=_0x5739fb[_0x953c('0x3e')][_0x953c('0x4d')]?_0x5739fb['attributes']:_0x49dd1f[_0x953c('0x40')];_0x5739fb['order']=qs[_0x953c('0x41')](_0x267697[_0x953c('0x3c')][_0x953c('0x41')]);_0x5739fb[_0x953c('0x42')]=qs['filters'](_['pick'](_0x267697[_0x953c('0x3c')],_0x49dd1f[_0x953c('0x43')]));if(_0x267697[_0x953c('0x3c')][_0x953c('0x44')]){_0x5739fb[_0x953c('0x42')]=_[_0x953c('0x45')](_0x5739fb[_0x953c('0x42')],{'$or':_[_0x953c('0x36')](_0x5739fb[_0x953c('0x3e')],function(_0x47a972){var _0x348088={};_0x348088[_0x47a972]={'$like':'%'+_0x267697[_0x953c('0x3c')][_0x953c('0x44')]+'%'};return _0x348088;})});}_0x5739fb=_[_0x953c('0x45')]({},_0x5739fb,_0x267697[_0x953c('0x47')]);return _0xfcbb02[_0x953c('0x58')](_0x5739fb);}})['then'](function(_0x22e6b9){if(_0x22e6b9){_0x3b58fd=_0x22e6b9[_0x953c('0x4d')];if(!_0x267697['query'][_0x953c('0x56')](_0x953c('0x57'))){_0x5739fb[_0x953c('0x2b')]=qs[_0x953c('0x2b')](_0x267697['query'][_0x953c('0x2b')]);_0x5739fb[_0x953c('0x2a')]=qs[_0x953c('0x2a')](_0x267697[_0x953c('0x3c')][_0x953c('0x2a')]);}return _0xfcbb02[_0x953c('0x58')](_0x5739fb);}})['then'](function(_0x2f3d97){if(_0x2f3d97){return _0x2f3d97?{'count':_0x3b58fd,'rows':_0x2f3d97}:null;}})['then'](respondWithResult(_0x17f64a,null))[_0x953c('0x26')](handleError(_0x17f64a,null));};exports[_0x953c('0x5a')]=function(_0x56752d,_0x343456,_0x619dee){var _0x762368={};var _0x1ba641={};var _0x472afa;var _0x3140ca;return db[_0x953c('0x37')][_0x953c('0x53')]({'where':{'id':_0x56752d['params']['id']}})[_0x953c('0x1d')](handleEntityNotFound(_0x343456,null))[_0x953c('0x1d')](function(_0x2aa92b){if(_0x2aa92b){_0x472afa=_0x2aa92b;_0x1ba641[_0x953c('0x40')]=_['keys'](db[_0x953c('0x59')]['rawAttributes']);_0x1ba641[_0x953c('0x3c')]=_['keys'](_0x56752d[_0x953c('0x3c')]);_0x1ba641[_0x953c('0x43')]=_[_0x953c('0x3d')](_0x1ba641[_0x953c('0x40')],_0x1ba641['query']);_0x762368[_0x953c('0x3e')]=_[_0x953c('0x3d')](_0x1ba641[_0x953c('0x40')],qs['fields'](_0x56752d['query'][_0x953c('0x3f')]));_0x762368['attributes']=_0x762368[_0x953c('0x3e')][_0x953c('0x4d')]?_0x762368[_0x953c('0x3e')]:_0x1ba641['model'];_0x762368[_0x953c('0x54')]=qs[_0x953c('0x41')](_0x56752d['query']['sort']);_0x762368[_0x953c('0x42')]=qs['filters'](_['pick'](_0x56752d[_0x953c('0x3c')],_0x1ba641[_0x953c('0x43')]));if(_0x56752d['query'][_0x953c('0x44')]){_0x762368[_0x953c('0x42')]=_['merge'](_0x762368[_0x953c('0x42')],{'$or':_[_0x953c('0x36')](_0x762368[_0x953c('0x3e')],function(_0x32ec36){var _0x22e4a2={};_0x22e4a2[_0x32ec36]={'$like':'%'+_0x56752d['query']['filter']+'%'};return _0x22e4a2;})});}_0x762368=_[_0x953c('0x45')]({},_0x762368,_0x56752d['options']);return _0x472afa[_0x953c('0x5a')](_0x762368);}})['then'](function(_0x3b6e6d){if(_0x3b6e6d){_0x3140ca=_0x3b6e6d[_0x953c('0x4d')];if(!_0x56752d[_0x953c('0x3c')][_0x953c('0x56')](_0x953c('0x57'))){_0x762368[_0x953c('0x2b')]=qs[_0x953c('0x2b')](_0x56752d[_0x953c('0x3c')][_0x953c('0x2b')]);_0x762368['offset']=qs['offset'](_0x56752d[_0x953c('0x3c')]['offset']);}return _0x472afa[_0x953c('0x5a')](_0x762368);}})[_0x953c('0x1d')](function(_0x59aea0){if(_0x59aea0){return _0x59aea0?{'count':_0x3140ca,'rows':_0x59aea0}:null;}})[_0x953c('0x1d')](respondWithResult(_0x343456,null))['catch'](handleError(_0x343456,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 270904c..5d6160b 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 _0x4a8c=['api','moment','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','util','../../config/logger'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x4a8c,0x14e));var _0xc4a8=function(_0x22f1e8,_0x1ba477){_0x22f1e8=_0x22f1e8-0x0;var _0x20e9ac=_0x4a8c[_0x22f1e8];return _0x20e9ac;};'use strict';var _=require('lodash');var util=require(_0xc4a8('0x0'));var logger=require(_0xc4a8('0x1'))(_0xc4a8('0x2'));var moment=require(_0xc4a8('0x3'));var BPromise=require('bluebird');var rp=require(_0xc4a8('0x4'));var fs=require('fs');var path=require(_0xc4a8('0x5'));var rimraf=require(_0xc4a8('0x6'));var config=require(_0xc4a8('0x7'));var attributes=require(_0xc4a8('0x8'));module[_0xc4a8('0x9')]=function(_0x5bc7c9,_0x4e8576){return _0x5bc7c9[_0xc4a8('0xa')](_0xc4a8('0xb'),attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6c84=['./intDynamics365Configuration.attributes','exports','Dynamics365Configuration','int_dynamics365_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x23c9e4,_0x4dfd62){var _0x2be093=function(_0x42f85e){while(--_0x42f85e){_0x23c9e4['push'](_0x23c9e4['shift']());}};_0x2be093(++_0x4dfd62);}(_0x6c84,0x149));var _0x46c8=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x6c84[_0x4c12ec];return _0x3ae42c;};'use strict';var _=require(_0x46c8('0x0'));var util=require(_0x46c8('0x1'));var logger=require(_0x46c8('0x2'))(_0x46c8('0x3'));var moment=require(_0x46c8('0x4'));var BPromise=require(_0x46c8('0x5'));var rp=require(_0x46c8('0x6'));var fs=require('fs');var path=require(_0x46c8('0x7'));var rimraf=require('rimraf');var config=require(_0x46c8('0x8'));var attributes=require(_0x46c8('0x9'));module[_0x46c8('0xa')]=function(_0x4c154a,_0x4d07eb){return _0x4c154a['define'](_0x46c8('0xb'),attributes,{'tableName':_0x46c8('0xc'),'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 232e41c..58ecdea 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 _0x252b=['catch','util','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x5d60d1,_0x325ad0){var _0x5e94a7=function(_0x40fb9c){while(--_0x40fb9c){_0x5d60d1['push'](_0x5d60d1['shift']());}};_0x5e94a7(++_0x325ad0);}(_0x252b,0x7f));var _0xb252=function(_0x138975,_0x319d77){_0x138975=_0x138975-0x0;var _0x2ff39a=_0x252b[_0x138975];return _0x2ff39a;};'use strict';var _=require('lodash');var util=require(_0xb252('0x0'));var moment=require('moment');var BPromise=require(_0xb252('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb252('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb252('0x3'))(_0xb252('0x4'));var config=require(_0xb252('0x5'));var jayson=require(_0xb252('0x6'));var client=jayson[_0xb252('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x17eb30,_0x4bd841,_0x4cc8d8){return new BPromise(function(_0x38e4e2,_0x12f32f){return client['request'](_0x17eb30,_0x4cc8d8)[_0xb252('0x8')](function(_0x35f500){logger['info'](_0xb252('0x9'),_0x4bd841,_0xb252('0xa'));logger[_0xb252('0xb')](_0xb252('0xc'),_0x4bd841,_0xb252('0xa'),JSON[_0xb252('0xd')](_0x35f500));if(_0x35f500[_0xb252('0xe')]){if(_0x35f500[_0xb252('0xe')]['code']===0x1f4){logger[_0xb252('0xe')](_0xb252('0x9'),_0x4bd841,_0x35f500[_0xb252('0xe')][_0xb252('0xf')]);return _0x12f32f(_0x35f500[_0xb252('0xe')]['message']);}logger['error'](_0xb252('0x9'),_0x4bd841,_0x35f500[_0xb252('0xe')]['message']);return _0x38e4e2(_0x35f500[_0xb252('0xe')]['message']);}else{logger['info'](_0xb252('0x9'),_0x4bd841,_0xb252('0xa'));_0x38e4e2(_0x35f500[_0xb252('0x10')]['message']);}})[_0xb252('0x11')](function(_0x1cc346){logger[_0xb252('0xe')]('Dynamics365Configuration,\x20%s,\x20%s',_0x4bd841,_0x1cc346);_0x12f32f(_0x1cc346);});});} \ No newline at end of file +var _0x9ec8=['Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','Dynamics365Configuration,\x20%s,\x20%s','message','request\x20sent','catch','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','debug'];(function(_0x44e333,_0x4cdb9c){var _0x4e3f9b=function(_0x1264ed){while(--_0x1264ed){_0x44e333['push'](_0x44e333['shift']());}};_0x4e3f9b(++_0x4cdb9c);}(_0x9ec8,0x196));var _0x89ec=function(_0x586337,_0x3c82e4){_0x586337=_0x586337-0x0;var _0x151134=_0x9ec8[_0x586337];return _0x151134;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x89ec('0x0'));var rs=require(_0x89ec('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x89ec('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x89ec('0x3'))('rpc');var config=require(_0x89ec('0x4'));var jayson=require(_0x89ec('0x5'));var client=jayson[_0x89ec('0x6')][_0x89ec('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x214a44,_0x41ce30,_0xcfabfc){return new BPromise(function(_0x50c06f,_0x43d9d7){return client[_0x89ec('0x8')](_0x214a44,_0xcfabfc)[_0x89ec('0x9')](function(_0x4f0aa8){logger[_0x89ec('0xa')]('Dynamics365Configuration,\x20%s,\x20%s',_0x41ce30,'request\x20sent');logger[_0x89ec('0xb')](_0x89ec('0xc'),_0x41ce30,'request\x20sent',JSON[_0x89ec('0xd')](_0x4f0aa8));if(_0x4f0aa8['error']){if(_0x4f0aa8[_0x89ec('0xe')]['code']===0x1f4){logger[_0x89ec('0xe')]('Dynamics365Configuration,\x20%s,\x20%s',_0x41ce30,_0x4f0aa8[_0x89ec('0xe')]['message']);return _0x43d9d7(_0x4f0aa8[_0x89ec('0xe')]['message']);}logger[_0x89ec('0xe')](_0x89ec('0xf'),_0x41ce30,_0x4f0aa8[_0x89ec('0xe')][_0x89ec('0x10')]);return _0x50c06f(_0x4f0aa8[_0x89ec('0xe')][_0x89ec('0x10')]);}else{logger[_0x89ec('0xa')](_0x89ec('0xf'),_0x41ce30,_0x89ec('0x11'));_0x50c06f(_0x4f0aa8['result'][_0x89ec('0x10')]);}})[_0x89ec('0x12')](function(_0xada795){logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x41ce30,_0xada795);_0x43d9d7(_0xada795);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 7db0a44..60301f8 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 _0xaf80=['util','path','connect-timeout','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index','post','create','/:id','update','destroy','exports','multer'];(function(_0x190fd2,_0x4daf50){var _0x1abb5c=function(_0x3a0b17){while(--_0x3a0b17){_0x190fd2['push'](_0x190fd2['shift']());}};_0x1abb5c(++_0x4daf50);}(_0xaf80,0x1ef));var _0x0af8=function(_0x33ebc8,_0x1dfb83){_0x33ebc8=_0x33ebc8-0x0;var _0x4882f4=_0xaf80[_0x33ebc8];return _0x4882f4;};'use strict';var multer=require(_0x0af8('0x0'));var util=require(_0x0af8('0x1'));var path=require(_0x0af8('0x2'));var timeout=require(_0x0af8('0x3'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x0af8('0x4'));var config=require(_0x0af8('0x5'));var controller=require(_0x0af8('0x6'));router[_0x0af8('0x7')]('/',auth[_0x0af8('0x8')](),controller[_0x0af8('0x9')]);router['get']('/:id',auth[_0x0af8('0x8')](),controller['show']);router[_0x0af8('0xa')]('/',auth[_0x0af8('0x8')](),controller[_0x0af8('0xb')]);router['put'](_0x0af8('0xc'),auth[_0x0af8('0x8')](),controller[_0x0af8('0xd')]);router['delete']('/:id',auth[_0x0af8('0x8')](),controller[_0x0af8('0xe')]);module[_0x0af8('0xf')]=router; \ No newline at end of file +var _0x57f8=['/:id','show','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index'];(function(_0x307d86,_0x9264f2){var _0x361745=function(_0x1b64e1){while(--_0x1b64e1){_0x307d86['push'](_0x307d86['shift']());}};_0x361745(++_0x9264f2);}(_0x57f8,0x198));var _0x857f=function(_0xbe31d1,_0x126345){_0xbe31d1=_0xbe31d1-0x0;var _0x7bd03=_0x57f8[_0xbe31d1];return _0x7bd03;};'use strict';var multer=require('multer');var util=require(_0x857f('0x0'));var path=require(_0x857f('0x1'));var timeout=require(_0x857f('0x2'));var express=require(_0x857f('0x3'));var router=express[_0x857f('0x4')]();var auth=require(_0x857f('0x5'));var interaction=require(_0x857f('0x6'));var config=require(_0x857f('0x7'));var controller=require(_0x857f('0x8'));router[_0x857f('0x9')]('/',auth[_0x857f('0xa')](),controller[_0x857f('0xb')]);router['get'](_0x857f('0xc'),auth[_0x857f('0xa')](),controller[_0x857f('0xd')]);router['post']('/',auth[_0x857f('0xa')](),controller[_0x857f('0xe')]);router[_0x857f('0xf')]('/:id',auth[_0x857f('0xa')](),controller[_0x857f('0x10')]);router[_0x857f('0x11')]('/:id',auth[_0x857f('0xa')](),controller[_0x857f('0x12')]);module[_0x857f('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 1545589..fb98d26 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 _0xbfc0=['customVariable','keyValue','STRING','ENUM','BOOLEAN','sequelize','exports','string'];(function(_0x27c068,_0x342981){var _0xe5a67f=function(_0x20658a){while(--_0x20658a){_0x27c068['push'](_0x27c068['shift']());}};_0xe5a67f(++_0x342981);}(_0xbfc0,0x115));var _0x0bfc=function(_0x57bb3a,_0x237ede){_0x57bb3a=_0x57bb3a-0x0;var _0x5decaa=_0xbfc0[_0x57bb3a];return _0x5decaa;};'use strict';var Sequelize=require(_0x0bfc('0x0'));module[_0x0bfc('0x1')]={'type':{'type':Sequelize['ENUM'](_0x0bfc('0x2'),'variable',_0x0bfc('0x3'),_0x0bfc('0x4')),'defaultValue':_0x0bfc('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x0bfc('0x5')]},'keyType':{'type':Sequelize[_0x0bfc('0x6')]('string','variable','customVariable')},'keyContent':{'type':Sequelize[_0x0bfc('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x0bfc('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x340c=['string','customVariable','keyValue','STRING','variable','sequelize','exports','ENUM'];(function(_0x1e3c2f,_0x53b8d1){var _0x40ac24=function(_0x418cbc){while(--_0x418cbc){_0x1e3c2f['push'](_0x1e3c2f['shift']());}};_0x40ac24(++_0x53b8d1);}(_0x340c,0xe5));var _0xc340=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x340c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xc340('0x0'));module[_0xc340('0x1')]={'type':{'type':Sequelize[_0xc340('0x2')](_0xc340('0x3'),'variable',_0xc340('0x4'),_0xc340('0x5')),'defaultValue':_0xc340('0x3')},'content':{'type':Sequelize[_0xc340('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xc340('0x2')](_0xc340('0x3'),_0xc340('0x7'),_0xc340('0x4'))},'keyContent':{'type':Sequelize[_0xc340('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc340('0x6')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 5f8fd63..85917ba 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 _0x6f44=['intersection','fields','attributes','hasOwnProperty','nolimit','limit','offset','order','sort','filters','pick','filter','where','VIRTUAL','merge','options','Dynamics365Field','includeAll','include','findAll','rows','catch','show','params','length','create','body','find','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','set','Content-Range','apply','save','update','then','end','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys'];(function(_0x595bd1,_0xb1e7a){var _0xd0344f=function(_0x5eb2fd){while(--_0x5eb2fd){_0x595bd1['push'](_0x595bd1['shift']());}};_0xd0344f(++_0xb1e7a);}(_0x6f44,0x1ea));var _0x46f4=function(_0x5886f0,_0x2f2ef0){_0x5886f0=_0x5886f0-0x0;var _0x132861=_0x6f44[_0x5886f0];return _0x132861;};'use strict';var pdf=require(_0x46f4('0x0'));var emlformat=require(_0x46f4('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x46f4('0x2'));var jsonpatch=require(_0x46f4('0x3'));var rp=require(_0x46f4('0x4'));var moment=require(_0x46f4('0x5'));var BPromise=require(_0x46f4('0x6'));var Mustache=require(_0x46f4('0x7'));var util=require(_0x46f4('0x8'));var path=require(_0x46f4('0x9'));var sox=require(_0x46f4('0xa'));var csv=require('to-csv');var ejs=require(_0x46f4('0xb'));var fs=require('fs');var _=require(_0x46f4('0xc'));var squel=require(_0x46f4('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x46f4('0xe'));var toCsv=require(_0x46f4('0xf'));var querystring=require('querystring');var Papa=require(_0x46f4('0x10'));var Redis=require('ioredis');var authService=require(_0x46f4('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x46f4('0x12'));var hardwareService=require(_0x46f4('0x13'));var logger=require(_0x46f4('0x14'))(_0x46f4('0x15'));var utils=require(_0x46f4('0x16'));var config=require(_0x46f4('0x17'));var db=require(_0x46f4('0x18'))['db'];function respondWithStatusCode(_0x3c22e0,_0x21d4a6){_0x21d4a6=_0x21d4a6||0xcc;return function(_0x1f4748){if(_0x1f4748){return _0x3c22e0[_0x46f4('0x19')](_0x21d4a6);}return _0x3c22e0[_0x46f4('0x1a')](_0x21d4a6)['end']();};}function respondWithResult(_0x3b3b92,_0x33f73c){_0x33f73c=_0x33f73c||0xc8;return function(_0x52db86){if(_0x52db86){return _0x3b3b92[_0x46f4('0x1a')](_0x33f73c)[_0x46f4('0x1b')](_0x52db86);}};}function respondWithFilteredResult(_0x1a1649,_0x4dd2fb){return function(_0x3dc516){if(_0x3dc516){var _0x4e0661=_0x3dc516[_0x46f4('0x1c')],_0x4e84ce=_0x4dd2fb['offset'],_0x45917e=_0x4dd2fb['offset']+_0x4dd2fb['limit'],_0xf082a9;if(_0x45917e>=_0x4e0661){_0x45917e=_0x4e0661;_0xf082a9=0xc8;}else{_0xf082a9=0xce;}_0x1a1649['status'](_0xf082a9);return _0x1a1649[_0x46f4('0x1d')](_0x46f4('0x1e'),_0x4e84ce+'-'+_0x45917e+'/'+_0x4e0661)['json'](_0x3dc516);}return null;};}function patchUpdates(_0x22209b){return function(_0x108e6d){try{jsonpatch[_0x46f4('0x1f')](_0x108e6d,_0x22209b,!![]);}catch(_0x33521e){return BPromise['reject'](_0x33521e);}return _0x108e6d[_0x46f4('0x20')]();};}function saveUpdates(_0x390137,_0x1627db){return function(_0x6476f0){if(_0x6476f0){return _0x6476f0[_0x46f4('0x21')](_0x390137)[_0x46f4('0x22')](function(_0x47e1fa){return _0x47e1fa;});}return null;};}function removeEntity(_0x4bae60,_0x2b88d3){return function(_0x39760b){if(_0x39760b){return _0x39760b['destroy']()[_0x46f4('0x22')](function(){_0x4bae60[_0x46f4('0x1a')](0xcc)[_0x46f4('0x23')]();});}};}function handleEntityNotFound(_0x47528b,_0x36092e){return function(_0x41be5e){if(!_0x41be5e){_0x47528b[_0x46f4('0x19')](0x194);}return _0x41be5e;};}function handleError(_0x58d27d,_0x39eb2f){_0x39eb2f=_0x39eb2f||0x1f4;return function(_0x301e24){logger[_0x46f4('0x24')](_0x301e24[_0x46f4('0x25')]);if(_0x301e24[_0x46f4('0x26')]){delete _0x301e24['name'];}_0x58d27d[_0x46f4('0x1a')](_0x39eb2f)[_0x46f4('0x27')](_0x301e24);};}exports[_0x46f4('0x28')]=function(_0x30d302,_0x57eb00){var _0x33a7c5={},_0x531aef={},_0x13573d={'count':0x0,'rows':[]};var _0x552ab0=_['map'](db['Dynamics365Field'][_0x46f4('0x29')],function(_0x57ff78){return{'name':_0x57ff78[_0x46f4('0x2a')],'type':_0x57ff78[_0x46f4('0x2b')][_0x46f4('0x2c')]};});_0x531aef[_0x46f4('0x2d')]=_[_0x46f4('0x2e')](_0x552ab0,'name');_0x531aef[_0x46f4('0x2f')]=_[_0x46f4('0x30')](_0x30d302[_0x46f4('0x2f')]);_0x531aef['filters']=_[_0x46f4('0x31')](_0x531aef[_0x46f4('0x2d')],_0x531aef[_0x46f4('0x2f')]);_0x33a7c5['attributes']=_['intersection'](_0x531aef[_0x46f4('0x2d')],qs[_0x46f4('0x32')](_0x30d302[_0x46f4('0x2f')]['fields']));_0x33a7c5[_0x46f4('0x33')]=_0x33a7c5[_0x46f4('0x33')]['length']?_0x33a7c5[_0x46f4('0x33')]:_0x531aef['model'];if(!_0x30d302[_0x46f4('0x2f')][_0x46f4('0x34')](_0x46f4('0x35'))){_0x33a7c5[_0x46f4('0x36')]=qs[_0x46f4('0x36')](_0x30d302['query'][_0x46f4('0x36')]);_0x33a7c5[_0x46f4('0x37')]=qs['offset'](_0x30d302[_0x46f4('0x2f')][_0x46f4('0x37')]);}_0x33a7c5[_0x46f4('0x38')]=qs[_0x46f4('0x39')](_0x30d302['query'][_0x46f4('0x39')]);_0x33a7c5['where']=qs[_0x46f4('0x3a')](_[_0x46f4('0x3b')](_0x30d302[_0x46f4('0x2f')],_0x531aef[_0x46f4('0x3a')]));if(_0x30d302['query'][_0x46f4('0x3c')]){_0x33a7c5['where']=_['merge'](_0x33a7c5[_0x46f4('0x3d')],{'$or':_['map'](_0x552ab0,function(_0x520f05){if(_0x520f05[_0x46f4('0x2b')]!==_0x46f4('0x3e')){var _0x5ed740={};_0x5ed740[_0x520f05[_0x46f4('0x26')]]={'$like':'%'+_0x30d302['query'][_0x46f4('0x3c')]+'%'};return _0x5ed740;}})});}_0x33a7c5=_[_0x46f4('0x3f')]({},_0x33a7c5,_0x30d302[_0x46f4('0x40')]);var _0x3735d3={'where':_0x33a7c5['where']};return db[_0x46f4('0x41')][_0x46f4('0x1c')](_0x3735d3)[_0x46f4('0x22')](function(_0x5e22ba){_0x13573d['count']=_0x5e22ba;if(_0x30d302['query'][_0x46f4('0x42')]){_0x33a7c5[_0x46f4('0x43')]=[{'all':!![]}];}return db[_0x46f4('0x41')][_0x46f4('0x44')](_0x33a7c5);})['then'](function(_0x448f42){_0x13573d[_0x46f4('0x45')]=_0x448f42;return _0x13573d;})[_0x46f4('0x22')](respondWithFilteredResult(_0x57eb00,_0x33a7c5))[_0x46f4('0x46')](handleError(_0x57eb00,null));};exports[_0x46f4('0x47')]=function(_0x4b2de4,_0xe86eae){var _0x306400={'raw':!![],'where':{'id':_0x4b2de4[_0x46f4('0x48')]['id']}},_0x297cf9={};_0x297cf9[_0x46f4('0x2d')]=_['keys'](db['Dynamics365Field']['rawAttributes']);_0x297cf9[_0x46f4('0x2f')]=_[_0x46f4('0x30')](_0x4b2de4[_0x46f4('0x2f')]);_0x297cf9['filters']=_[_0x46f4('0x31')](_0x297cf9[_0x46f4('0x2d')],_0x297cf9[_0x46f4('0x2f')]);_0x306400[_0x46f4('0x33')]=_[_0x46f4('0x31')](_0x297cf9[_0x46f4('0x2d')],qs[_0x46f4('0x32')](_0x4b2de4[_0x46f4('0x2f')][_0x46f4('0x32')]));_0x306400[_0x46f4('0x33')]=_0x306400[_0x46f4('0x33')][_0x46f4('0x49')]?_0x306400[_0x46f4('0x33')]:_0x297cf9['model'];if(_0x4b2de4[_0x46f4('0x2f')][_0x46f4('0x42')]){_0x306400[_0x46f4('0x43')]=[{'all':!![]}];}_0x306400=_[_0x46f4('0x3f')]({},_0x306400,_0x4b2de4[_0x46f4('0x40')]);return db[_0x46f4('0x41')]['find'](_0x306400)['then'](handleEntityNotFound(_0xe86eae,null))['then'](respondWithResult(_0xe86eae,null))[_0x46f4('0x46')](handleError(_0xe86eae,null));};exports[_0x46f4('0x4a')]=function(_0x20698d,_0x19b357){return db[_0x46f4('0x41')][_0x46f4('0x4a')](_0x20698d[_0x46f4('0x4b')],{})[_0x46f4('0x22')](respondWithResult(_0x19b357,0xc9))[_0x46f4('0x46')](handleError(_0x19b357,null));};exports[_0x46f4('0x21')]=function(_0x21319d,_0x1d1513){if(_0x21319d['body']['id']){delete _0x21319d[_0x46f4('0x4b')]['id'];}return db[_0x46f4('0x41')][_0x46f4('0x4c')]({'where':{'id':_0x21319d['params']['id']}})['then'](handleEntityNotFound(_0x1d1513,null))[_0x46f4('0x22')](saveUpdates(_0x21319d[_0x46f4('0x4b')],null))[_0x46f4('0x22')](respondWithResult(_0x1d1513,null))['catch'](handleError(_0x1d1513,null));};exports['destroy']=function(_0x11f959,_0x1e3551){return db[_0x46f4('0x41')][_0x46f4('0x4c')]({'where':{'id':_0x11f959[_0x46f4('0x48')]['id']}})[_0x46f4('0x22')](handleEntityNotFound(_0x1e3551,null))['then'](removeEntity(_0x1e3551,null))[_0x46f4('0x46')](handleError(_0x1e3551,null));}; \ No newline at end of file +var _0x1203=['mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','Dynamics365Field','rows','catch','length','find','create','body','update','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x3efc2b,_0x30e89e){var _0x143578=function(_0x506c2d){while(--_0x506c2d){_0x3efc2b['push'](_0x3efc2b['shift']());}};_0x143578(++_0x30e89e);}(_0x1203,0x8c));var _0x3120=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1203[_0x14add3];return _0x4a174f;};'use strict';var pdf=require(_0x3120('0x0'));var emlformat=require(_0x3120('0x1'));var rimraf=require(_0x3120('0x2'));var zipdir=require(_0x3120('0x3'));var jsonpatch=require(_0x3120('0x4'));var rp=require(_0x3120('0x5'));var moment=require(_0x3120('0x6'));var BPromise=require(_0x3120('0x7'));var Mustache=require(_0x3120('0x8'));var util=require(_0x3120('0x9'));var path=require(_0x3120('0xa'));var sox=require(_0x3120('0xb'));var csv=require(_0x3120('0xc'));var ejs=require(_0x3120('0xd'));var fs=require('fs');var _=require(_0x3120('0xe'));var squel=require(_0x3120('0xf'));var crypto=require('crypto');var jsforce=require(_0x3120('0x10'));var deskjs=require(_0x3120('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3120('0x12'));var authService=require(_0x3120('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x3120('0x14'));var hardwareService=require(_0x3120('0x15'));var logger=require(_0x3120('0x16'))(_0x3120('0x17'));var utils=require('../../config/utils');var config=require(_0x3120('0x18'));var db=require(_0x3120('0x19'))['db'];function respondWithStatusCode(_0x5db441,_0x4a4312){_0x4a4312=_0x4a4312||0xcc;return function(_0x41a236){if(_0x41a236){return _0x5db441[_0x3120('0x1a')](_0x4a4312);}return _0x5db441[_0x3120('0x1b')](_0x4a4312)[_0x3120('0x1c')]();};}function respondWithResult(_0x2c8686,_0x1f05b6){_0x1f05b6=_0x1f05b6||0xc8;return function(_0x1ef350){if(_0x1ef350){return _0x2c8686['status'](_0x1f05b6)[_0x3120('0x1d')](_0x1ef350);}};}function respondWithFilteredResult(_0x1f2def,_0xcda8){return function(_0x18357e){if(_0x18357e){var _0x1d919e=_0x18357e[_0x3120('0x1e')],_0x335d6b=_0xcda8['offset'],_0x3ee12d=_0xcda8[_0x3120('0x1f')]+_0xcda8[_0x3120('0x20')],_0x571f6f;if(_0x3ee12d>=_0x1d919e){_0x3ee12d=_0x1d919e;_0x571f6f=0xc8;}else{_0x571f6f=0xce;}_0x1f2def[_0x3120('0x1b')](_0x571f6f);return _0x1f2def[_0x3120('0x21')](_0x3120('0x22'),_0x335d6b+'-'+_0x3ee12d+'/'+_0x1d919e)[_0x3120('0x1d')](_0x18357e);}return null;};}function patchUpdates(_0x50429){return function(_0x5142db){try{jsonpatch[_0x3120('0x23')](_0x5142db,_0x50429,!![]);}catch(_0x5e3e90){return BPromise[_0x3120('0x24')](_0x5e3e90);}return _0x5142db[_0x3120('0x25')]();};}function saveUpdates(_0x3bc524,_0x5bfd37){return function(_0x5a0bce){if(_0x5a0bce){return _0x5a0bce['update'](_0x3bc524)[_0x3120('0x26')](function(_0x16e816){return _0x16e816;});}return null;};}function removeEntity(_0x5edd47,_0x1358e0){return function(_0x2cf3be){if(_0x2cf3be){return _0x2cf3be[_0x3120('0x27')]()[_0x3120('0x26')](function(){_0x5edd47['status'](0xcc)[_0x3120('0x1c')]();});}};}function handleEntityNotFound(_0x5977b2,_0x444b3b){return function(_0xb762e2){if(!_0xb762e2){_0x5977b2[_0x3120('0x1a')](0x194);}return _0xb762e2;};}function handleError(_0x56fc9f,_0x5454f2){_0x5454f2=_0x5454f2||0x1f4;return function(_0xf5b2c6){logger[_0x3120('0x28')](_0xf5b2c6['stack']);if(_0xf5b2c6[_0x3120('0x29')]){delete _0xf5b2c6[_0x3120('0x29')];}_0x56fc9f[_0x3120('0x1b')](_0x5454f2)['send'](_0xf5b2c6);};}exports[_0x3120('0x2a')]=function(_0x4597a6,_0x4412f9){var _0x7f5e4b={},_0x4b343b={},_0x505a41={'count':0x0,'rows':[]};var _0x5b3050=_[_0x3120('0x2b')](db['Dynamics365Field'][_0x3120('0x2c')],function(_0x303055){return{'name':_0x303055[_0x3120('0x2d')],'type':_0x303055[_0x3120('0x2e')][_0x3120('0x2f')]};});_0x4b343b[_0x3120('0x30')]=_['map'](_0x5b3050,_0x3120('0x29'));_0x4b343b[_0x3120('0x31')]=_[_0x3120('0x32')](_0x4597a6[_0x3120('0x31')]);_0x4b343b[_0x3120('0x33')]=_[_0x3120('0x34')](_0x4b343b[_0x3120('0x30')],_0x4b343b[_0x3120('0x31')]);_0x7f5e4b['attributes']=_['intersection'](_0x4b343b[_0x3120('0x30')],qs[_0x3120('0x35')](_0x4597a6[_0x3120('0x31')][_0x3120('0x35')]));_0x7f5e4b[_0x3120('0x36')]=_0x7f5e4b[_0x3120('0x36')]['length']?_0x7f5e4b[_0x3120('0x36')]:_0x4b343b[_0x3120('0x30')];if(!_0x4597a6[_0x3120('0x31')][_0x3120('0x37')](_0x3120('0x38'))){_0x7f5e4b[_0x3120('0x20')]=qs[_0x3120('0x20')](_0x4597a6['query'][_0x3120('0x20')]);_0x7f5e4b[_0x3120('0x1f')]=qs[_0x3120('0x1f')](_0x4597a6[_0x3120('0x31')][_0x3120('0x1f')]);}_0x7f5e4b[_0x3120('0x39')]=qs[_0x3120('0x3a')](_0x4597a6[_0x3120('0x31')][_0x3120('0x3a')]);_0x7f5e4b[_0x3120('0x3b')]=qs[_0x3120('0x33')](_[_0x3120('0x3c')](_0x4597a6[_0x3120('0x31')],_0x4b343b['filters']));if(_0x4597a6['query'][_0x3120('0x3d')]){_0x7f5e4b[_0x3120('0x3b')]=_[_0x3120('0x3e')](_0x7f5e4b['where'],{'$or':_[_0x3120('0x2b')](_0x5b3050,function(_0x39dbf7){if(_0x39dbf7[_0x3120('0x2e')]!=='VIRTUAL'){var _0x2a3209={};_0x2a3209[_0x39dbf7[_0x3120('0x29')]]={'$like':'%'+_0x4597a6[_0x3120('0x31')][_0x3120('0x3d')]+'%'};return _0x2a3209;}})});}_0x7f5e4b=_[_0x3120('0x3e')]({},_0x7f5e4b,_0x4597a6[_0x3120('0x3f')]);var _0x4bbc5d={'where':_0x7f5e4b['where']};return db['Dynamics365Field'][_0x3120('0x1e')](_0x4bbc5d)['then'](function(_0x334cee){_0x505a41[_0x3120('0x1e')]=_0x334cee;if(_0x4597a6[_0x3120('0x31')][_0x3120('0x40')]){_0x7f5e4b['include']=[{'all':!![]}];}return db[_0x3120('0x41')]['findAll'](_0x7f5e4b);})[_0x3120('0x26')](function(_0x4b7ec4){_0x505a41[_0x3120('0x42')]=_0x4b7ec4;return _0x505a41;})[_0x3120('0x26')](respondWithFilteredResult(_0x4412f9,_0x7f5e4b))[_0x3120('0x43')](handleError(_0x4412f9,null));};exports['show']=function(_0x3debf2,_0x2a9bc4){var _0x19a317={'raw':!![],'where':{'id':_0x3debf2['params']['id']}},_0x3c8a23={};_0x3c8a23[_0x3120('0x30')]=_[_0x3120('0x32')](db['Dynamics365Field'][_0x3120('0x2c')]);_0x3c8a23[_0x3120('0x31')]=_[_0x3120('0x32')](_0x3debf2['query']);_0x3c8a23[_0x3120('0x33')]=_[_0x3120('0x34')](_0x3c8a23['model'],_0x3c8a23[_0x3120('0x31')]);_0x19a317[_0x3120('0x36')]=_['intersection'](_0x3c8a23['model'],qs[_0x3120('0x35')](_0x3debf2[_0x3120('0x31')][_0x3120('0x35')]));_0x19a317[_0x3120('0x36')]=_0x19a317[_0x3120('0x36')][_0x3120('0x44')]?_0x19a317[_0x3120('0x36')]:_0x3c8a23[_0x3120('0x30')];if(_0x3debf2[_0x3120('0x31')][_0x3120('0x40')]){_0x19a317['include']=[{'all':!![]}];}_0x19a317=_[_0x3120('0x3e')]({},_0x19a317,_0x3debf2[_0x3120('0x3f')]);return db[_0x3120('0x41')][_0x3120('0x45')](_0x19a317)['then'](handleEntityNotFound(_0x2a9bc4,null))['then'](respondWithResult(_0x2a9bc4,null))[_0x3120('0x43')](handleError(_0x2a9bc4,null));};exports['create']=function(_0x41ee3f,_0x3a66f7){return db[_0x3120('0x41')][_0x3120('0x46')](_0x41ee3f[_0x3120('0x47')],{})[_0x3120('0x26')](respondWithResult(_0x3a66f7,0xc9))[_0x3120('0x43')](handleError(_0x3a66f7,null));};exports[_0x3120('0x48')]=function(_0x5a741c,_0x1e1df7){if(_0x5a741c[_0x3120('0x47')]['id']){delete _0x5a741c[_0x3120('0x47')]['id'];}return db[_0x3120('0x41')][_0x3120('0x45')]({'where':{'id':_0x5a741c['params']['id']}})['then'](handleEntityNotFound(_0x1e1df7,null))['then'](saveUpdates(_0x5a741c[_0x3120('0x47')],null))[_0x3120('0x26')](respondWithResult(_0x1e1df7,null))[_0x3120('0x43')](handleError(_0x1e1df7,null));};exports[_0x3120('0x27')]=function(_0x4b41b8,_0x21f301){return db[_0x3120('0x41')][_0x3120('0x45')]({'where':{'id':_0x4b41b8[_0x3120('0x49')]['id']}})[_0x3120('0x26')](handleEntityNotFound(_0x21f301,null))[_0x3120('0x26')](removeEntity(_0x21f301,null))[_0x3120('0x43')](handleError(_0x21f301,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index dbb4e94..2e3de22 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 _0x4bdf=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','lodash','util'];(function(_0x43a5c7,_0x2286bf){var _0x3b12a2=function(_0x1f8f53){while(--_0x1f8f53){_0x43a5c7['push'](_0x43a5c7['shift']());}};_0x3b12a2(++_0x2286bf);}(_0x4bdf,0x1be));var _0xf4bd=function(_0xaaa4df,_0x77d473){_0xaaa4df=_0xaaa4df-0x0;var _0x166419=_0x4bdf[_0xaaa4df];return _0x166419;};'use strict';var _=require(_0xf4bd('0x0'));var util=require(_0xf4bd('0x1'));var logger=require(_0xf4bd('0x2'))(_0xf4bd('0x3'));var moment=require(_0xf4bd('0x4'));var BPromise=require(_0xf4bd('0x5'));var rp=require(_0xf4bd('0x6'));var fs=require('fs');var path=require(_0xf4bd('0x7'));var rimraf=require(_0xf4bd('0x8'));var config=require(_0xf4bd('0x9'));var attributes=require(_0xf4bd('0xa'));module[_0xf4bd('0xb')]=function(_0xb9702d,_0x225fdb){return _0xb9702d[_0xf4bd('0xc')](_0xf4bd('0xd'),attributes,{'tableName':_0xf4bd('0xe'),'paranoid':![],'indexes':[{'name':_0xf4bd('0xf'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5bf0=['Dynamics365Field','FieldId','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intDynamics365Field.attributes'];(function(_0x3b5250,_0x7a0b2c){var _0xc844a1=function(_0x2fbc98){while(--_0x2fbc98){_0x3b5250['push'](_0x3b5250['shift']());}};_0xc844a1(++_0x7a0b2c);}(_0x5bf0,0xda));var _0x05bf=function(_0x194a4f,_0x417e14){_0x194a4f=_0x194a4f-0x0;var _0x9f334e=_0x5bf0[_0x194a4f];return _0x9f334e;};'use strict';var _=require(_0x05bf('0x0'));var util=require(_0x05bf('0x1'));var logger=require(_0x05bf('0x2'))(_0x05bf('0x3'));var moment=require(_0x05bf('0x4'));var BPromise=require(_0x05bf('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x05bf('0x6'));var rimraf=require(_0x05bf('0x7'));var config=require(_0x05bf('0x8'));var attributes=require(_0x05bf('0x9'));module['exports']=function(_0x2f7273,_0x582657){return _0x2f7273['define'](_0x05bf('0xa'),attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':['idField',_0x05bf('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.rpc.js b/server/api/intDynamics365Field/intDynamics365Field.rpc.js index 9f194d3..a2356c9 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 _0xbb67=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x4475c5,_0x27b79c){var _0x3aec71=function(_0x3f3bb8){while(--_0x3f3bb8){_0x4475c5['push'](_0x4475c5['shift']());}};_0x3aec71(++_0x27b79c);}(_0xbb67,0x161));var _0x7bb6=function(_0x22b95a,_0x23d8b1){_0x22b95a=_0x22b95a-0x0;var _0xda8e7b=_0xbb67[_0x22b95a];return _0xda8e7b;};'use strict';var _=require('lodash');var util=require(_0x7bb6('0x0'));var moment=require(_0x7bb6('0x1'));var BPromise=require(_0x7bb6('0x2'));var rs=require(_0x7bb6('0x3'));var fs=require('fs');var Redis=require(_0x7bb6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7bb6('0x5'));var logger=require(_0x7bb6('0x6'))(_0x7bb6('0x7'));var config=require(_0x7bb6('0x8'));var jayson=require(_0x7bb6('0x9'));var client=jayson[_0x7bb6('0xa')][_0x7bb6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2a059b,_0x5f1898,_0x45441a){return new BPromise(function(_0x15fb32,_0x214244){return client[_0x7bb6('0xc')](_0x2a059b,_0x45441a)[_0x7bb6('0xd')](function(_0x168bb6){logger[_0x7bb6('0xe')](_0x7bb6('0xf'),_0x5f1898,_0x7bb6('0x10'));logger['debug'](_0x7bb6('0x11'),_0x5f1898,_0x7bb6('0x10'),JSON[_0x7bb6('0x12')](_0x168bb6));if(_0x168bb6[_0x7bb6('0x13')]){if(_0x168bb6[_0x7bb6('0x13')][_0x7bb6('0x14')]===0x1f4){logger[_0x7bb6('0x13')](_0x7bb6('0xf'),_0x5f1898,_0x168bb6[_0x7bb6('0x13')]['message']);return _0x214244(_0x168bb6['error'][_0x7bb6('0x15')]);}logger[_0x7bb6('0x13')]('Dynamics365Field,\x20%s,\x20%s',_0x5f1898,_0x168bb6[_0x7bb6('0x13')][_0x7bb6('0x15')]);return _0x15fb32(_0x168bb6[_0x7bb6('0x13')][_0x7bb6('0x15')]);}else{logger[_0x7bb6('0xe')](_0x7bb6('0xf'),_0x5f1898,'request\x20sent');_0x15fb32(_0x168bb6[_0x7bb6('0x16')][_0x7bb6('0x15')]);}})[_0x7bb6('0x17')](function(_0x4095a1){logger[_0x7bb6('0x13')](_0x7bb6('0xf'),_0x5f1898,_0x4095a1);_0x214244(_0x4095a1);});});} \ No newline at end of file +var _0x6d19=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','Dynamics365Field,\x20%s,\x20%s','message','request\x20sent'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x6d19,0x160));var _0x96d1=function(_0x5235a6,_0x680b76){_0x5235a6=_0x5235a6-0x0;var _0x1cf37e=_0x6d19[_0x5235a6];return _0x1cf37e;};'use strict';var _=require(_0x96d1('0x0'));var util=require(_0x96d1('0x1'));var moment=require(_0x96d1('0x2'));var BPromise=require(_0x96d1('0x3'));var rs=require(_0x96d1('0x4'));var fs=require('fs');var Redis=require(_0x96d1('0x5'));var db=require(_0x96d1('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x96d1('0x7'))(_0x96d1('0x8'));var config=require(_0x96d1('0x9'));var jayson=require(_0x96d1('0xa'));var client=jayson['client'][_0x96d1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x230638,_0x61e0f5,_0x58ade3){return new BPromise(function(_0xba2d03,_0x3f7a36){return client[_0x96d1('0xc')](_0x230638,_0x58ade3)[_0x96d1('0xd')](function(_0x37b251){logger[_0x96d1('0xe')]('Dynamics365Field,\x20%s,\x20%s',_0x61e0f5,'request\x20sent');logger[_0x96d1('0xf')](_0x96d1('0x10'),_0x61e0f5,'request\x20sent',JSON[_0x96d1('0x11')](_0x37b251));if(_0x37b251['error']){if(_0x37b251[_0x96d1('0x12')][_0x96d1('0x13')]===0x1f4){logger[_0x96d1('0x12')](_0x96d1('0x14'),_0x61e0f5,_0x37b251[_0x96d1('0x12')][_0x96d1('0x15')]);return _0x3f7a36(_0x37b251['error'][_0x96d1('0x15')]);}logger[_0x96d1('0x12')](_0x96d1('0x14'),_0x61e0f5,_0x37b251[_0x96d1('0x12')][_0x96d1('0x15')]);return _0xba2d03(_0x37b251['error']['message']);}else{logger[_0x96d1('0xe')](_0x96d1('0x14'),_0x61e0f5,_0x96d1('0x16'));_0xba2d03(_0x37b251[_0x96d1('0x17')][_0x96d1('0x15')]);}})[_0x96d1('0x18')](function(_0x45dc6f){logger[_0x96d1('0x12')](_0x96d1('0x14'),_0x61e0f5,_0x45dc6f);_0x3f7a36(_0x45dc6f);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 705e3f3..4c6075d 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 _0x41be=['delete','exports','multer','util','express','Router','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','index','/:id','/:id/fields','getFields','post','create','/:id/configurations','put','update'];(function(_0x203f65,_0x322710){var _0x148b03=function(_0x406d03){while(--_0x406d03){_0x203f65['push'](_0x203f65['shift']());}};_0x148b03(++_0x322710);}(_0x41be,0xa2));var _0xe41b=function(_0x53afe9,_0x2c9f40){_0x53afe9=_0x53afe9-0x0;var _0x396396=_0x41be[_0x53afe9];return _0x396396;};'use strict';var multer=require(_0xe41b('0x0'));var util=require(_0xe41b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe41b('0x2'));var router=express[_0xe41b('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xe41b('0x4'));var config=require(_0xe41b('0x5'));var controller=require(_0xe41b('0x6'));router[_0xe41b('0x7')]('/',auth[_0xe41b('0x8')](),controller[_0xe41b('0x9')]);router[_0xe41b('0x7')](_0xe41b('0xa'),auth[_0xe41b('0x8')](),controller['show']);router['get']('/:id/configurations',auth[_0xe41b('0x8')](),controller['getConfigurations']);router['get'](_0xe41b('0xb'),auth[_0xe41b('0x8')](),controller[_0xe41b('0xc')]);router[_0xe41b('0xd')]('/',auth[_0xe41b('0x8')](),controller[_0xe41b('0xe')]);router[_0xe41b('0xd')](_0xe41b('0xf'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0xe41b('0x10')]('/:id',auth[_0xe41b('0x8')](),controller[_0xe41b('0x11')]);router[_0xe41b('0x12')](_0xe41b('0xa'),auth[_0xe41b('0x8')](),controller['destroy']);module[_0xe41b('0x13')]=router; \ No newline at end of file +var _0x4547=['get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','getFields','post','put','delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4316a2,_0x15ca2a){var _0x38d20d=function(_0x305a8a){while(--_0x305a8a){_0x4316a2['push'](_0x4316a2['shift']());}};_0x38d20d(++_0x15ca2a);}(_0x4547,0x70));var _0x7454=function(_0x4f8f3b,_0x43281b){_0x4f8f3b=_0x4f8f3b-0x0;var _0x4c250c=_0x4547[_0x4f8f3b];return _0x4c250c;};'use strict';var multer=require(_0x7454('0x0'));var util=require(_0x7454('0x1'));var path=require('path');var timeout=require(_0x7454('0x2'));var express=require(_0x7454('0x3'));var router=express[_0x7454('0x4')]();var auth=require(_0x7454('0x5'));var interaction=require(_0x7454('0x6'));var config=require(_0x7454('0x7'));var controller=require('./intFreshdeskAccount.controller');router[_0x7454('0x8')]('/',auth[_0x7454('0x9')](),controller[_0x7454('0xa')]);router[_0x7454('0x8')](_0x7454('0xb'),auth[_0x7454('0x9')](),controller[_0x7454('0xc')]);router[_0x7454('0x8')](_0x7454('0xd'),auth['isAuthenticated'](),controller['getConfigurations']);router['get'](_0x7454('0xe'),auth[_0x7454('0x9')](),controller[_0x7454('0xf')]);router[_0x7454('0x10')]('/',auth[_0x7454('0x9')](),controller['create']);router[_0x7454('0x10')]('/:id/configurations',auth[_0x7454('0x9')](),controller['addConfiguration']);router[_0x7454('0x11')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x7454('0x12')](_0x7454('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x7454('0x13')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 6adfeff..307f588 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 _0xc891=['STRING','username','sequelize'];(function(_0x4fb425,_0x1e8c0e){var _0x3a1ff8=function(_0x5f213a){while(--_0x5f213a){_0x4fb425['push'](_0x4fb425['shift']());}};_0x3a1ff8(++_0x1e8c0e);}(_0xc891,0x152));var _0x1c89=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xc891[_0x491a7f];return _0x3d8f44;};'use strict';var Sequelize=require(_0x1c89('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1c89('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x1c89('0x2')},'apiKey':{'type':Sequelize[_0x1c89('0x1')]},'remoteUri':{'type':Sequelize[_0x1c89('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x1c89('0x1')]}}; \ No newline at end of file +var _0x078a=['remoteUri','sequelize','exports','STRING','username'];(function(_0xf0100d,_0x3b4ae1){var _0x7bbcc1=function(_0x17e15f){while(--_0x17e15f){_0xf0100d['push'](_0xf0100d['shift']());}};_0x7bbcc1(++_0x3b4ae1);}(_0x078a,0x12d));var _0xa078=function(_0x1f7d75,_0x4b6832){_0x1f7d75=_0x1f7d75-0x0;var _0x40f55e=_0x078a[_0x1f7d75];return _0x40f55e;};'use strict';var Sequelize=require(_0xa078('0x0'));module[_0xa078('0x1')]={'name':{'type':Sequelize[_0xa078('0x2')]},'description':{'type':Sequelize[_0xa078('0x2')]},'username':{'type':Sequelize[_0xa078('0x2')],'unique':_0xa078('0x3')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xa078('0x2')],'unique':_0xa078('0x4')},'serverUrl':{'type':Sequelize[_0xa078('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 8051d78..77305cd 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 _0x1106=['filter','map','VIRTUAL','merge','include','findAll','rows','rawAttributes','intersection','includeAll','options','find','create','body','params','getConfigurations','findOne','FreshdeskConfiguration','addConfiguration','AccountId','Subjects','Descriptions','getDescriptions','FreshdeskField','getFields','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','%s/%s','Basic\x20%s','%s:X','base64','subject','agent','priority','group','source','company','remove','includes','custom_text','custom_dropdown','label','default','capitalize','Wrong\x20credentials','statusCode','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../components/integrations/configuration','jayson/promise','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','FreshdeskAccount,\x20%s,\x20%s','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','sendStatus','end','status','json','count','offset','limit','set','reject','save','update','destroy','then','name','send','index','FreshdeskAccount','fieldName','type','model','query','keys','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters'];(function(_0x1b5a05,_0x2c80de){var _0x347931=function(_0xd39454){while(--_0xd39454){_0x1b5a05['push'](_0x1b5a05['shift']());}};_0x347931(++_0x2c80de);}(_0x1106,0xb0));var _0x6110=function(_0x151b4b,_0x1dd44f){_0x151b4b=_0x151b4b-0x0;var _0x175eaa=_0x1106[_0x151b4b];return _0x175eaa;};'use strict';var pdf=require(_0x6110('0x0'));var emlformat=require(_0x6110('0x1'));var rimraf=require(_0x6110('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6110('0x3'));var rp=require(_0x6110('0x4'));var moment=require(_0x6110('0x5'));var BPromise=require(_0x6110('0x6'));var Mustache=require(_0x6110('0x7'));var util=require('util');var path=require(_0x6110('0x8'));var sox=require('sox');var csv=require(_0x6110('0x9'));var ejs=require(_0x6110('0xa'));var fs=require('fs');var _=require(_0x6110('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6110('0xc'));var deskjs=require(_0x6110('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6110('0xe'));var authService=require(_0x6110('0xf'));var qs=require(_0x6110('0x10'));var as=require(_0x6110('0x11'));var hardwareService=require(_0x6110('0x12'));var logger=require(_0x6110('0x13'))(_0x6110('0x14'));var utils=require(_0x6110('0x15'));var config=require(_0x6110('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0x6110('0x17'));var jayson=require(_0x6110('0x18'));var client=jayson[_0x6110('0x19')][_0x6110('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x57bd61,_0x47090a,_0x3ac26b){if(_0x3ac26b){var _0x53193f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x53193f[_0x6110('0x1b')](_0x47090a)){return _0x57bd61;}else{throw new db[(_0x6110('0x1c'))]['ValidationError'](_0x6110('0x1d'));}}else{return _0x57bd61;}}function respondWithRpcPromise(_0x6e8924,_0x5e2050,_0x511fc2,_0x182f67){return new BPromise(function(_0x9cf5f5,_0x2a5bb3){var _0x1e0a6c=_0x182f67||client;return _0x1e0a6c[_0x6110('0x1e')](_0x6e8924,_0x511fc2)['then'](function(_0x45ed81){logger['info'](_0x6110('0x1f'),_0x5e2050,'request\x20sent');logger[_0x6110('0x20')](_0x6110('0x21'),_0x5e2050,_0x6110('0x22'),JSON[_0x6110('0x23')](_0x45ed81));if(_0x45ed81[_0x6110('0x24')]){if(_0x45ed81[_0x6110('0x24')][_0x6110('0x25')]===0x1f4){logger[_0x6110('0x24')](_0x6110('0x1f'),_0x5e2050,_0x45ed81[_0x6110('0x24')][_0x6110('0x26')]);return _0x2a5bb3(_0x45ed81[_0x6110('0x24')][_0x6110('0x26')]);}logger[_0x6110('0x24')](_0x6110('0x1f'),_0x5e2050,_0x45ed81[_0x6110('0x24')]['message']);return _0x9cf5f5(_0x45ed81[_0x6110('0x24')][_0x6110('0x26')]);}else{logger[_0x6110('0x27')](_0x6110('0x1f'),_0x5e2050,'request\x20sent');_0x9cf5f5(_0x45ed81[_0x6110('0x28')]['message']);}})[_0x6110('0x29')](function(_0x46abe8){logger[_0x6110('0x24')](_0x6110('0x1f'),_0x5e2050,_0x46abe8);_0x2a5bb3(_0x46abe8);});});}function respondWithStatusCode(_0x1ae93e,_0x4d77eb){_0x4d77eb=_0x4d77eb||0xcc;return function(_0x20e42c){if(_0x20e42c){return _0x1ae93e[_0x6110('0x2a')](_0x4d77eb);}return _0x1ae93e['status'](_0x4d77eb)[_0x6110('0x2b')]();};}function respondWithResult(_0x166143,_0xe9e281){_0xe9e281=_0xe9e281||0xc8;return function(_0xb771c0){if(_0xb771c0){return _0x166143[_0x6110('0x2c')](_0xe9e281)[_0x6110('0x2d')](_0xb771c0);}};}function respondWithFilteredResult(_0x16d292,_0x9fed17){return function(_0x5deba6){if(_0x5deba6){var _0xc370b2=_0x5deba6[_0x6110('0x2e')],_0x2788bb=_0x9fed17['offset'],_0x497c40=_0x9fed17[_0x6110('0x2f')]+_0x9fed17[_0x6110('0x30')],_0x2b3089;if(_0x497c40>=_0xc370b2){_0x497c40=_0xc370b2;_0x2b3089=0xc8;}else{_0x2b3089=0xce;}_0x16d292[_0x6110('0x2c')](_0x2b3089);return _0x16d292[_0x6110('0x31')]('Content-Range',_0x2788bb+'-'+_0x497c40+'/'+_0xc370b2)['json'](_0x5deba6);}return null;};}function patchUpdates(_0x37241c){return function(_0x5d0601){try{jsonpatch['apply'](_0x5d0601,_0x37241c,!![]);}catch(_0x3b4c9a){return BPromise[_0x6110('0x32')](_0x3b4c9a);}return _0x5d0601[_0x6110('0x33')]();};}function saveUpdates(_0xb4ef3b,_0xe897ed){return function(_0x5cc7b9){if(_0x5cc7b9){return _0x5cc7b9[_0x6110('0x34')](_0xb4ef3b)['then'](function(_0x1ff53a){return _0x1ff53a;});}return null;};}function removeEntity(_0x233009,_0x5b309c){return function(_0x22ab74){if(_0x22ab74){return _0x22ab74[_0x6110('0x35')]()[_0x6110('0x36')](function(){_0x233009[_0x6110('0x2c')](0xcc)[_0x6110('0x2b')]();});}};}function handleEntityNotFound(_0x568f2d,_0x5c8601){return function(_0x845a10){if(!_0x845a10){_0x568f2d[_0x6110('0x2a')](0x194);}return _0x845a10;};}function handleError(_0x134273,_0xd361ee){_0xd361ee=_0xd361ee||0x1f4;return function(_0x37c592){logger[_0x6110('0x24')](_0x37c592['stack']);if(_0x37c592[_0x6110('0x37')]){delete _0x37c592['name'];}_0x134273['status'](_0xd361ee)[_0x6110('0x38')](_0x37c592);};}exports[_0x6110('0x39')]=function(_0x2a306a,_0x6de1cb){var _0x14d6d7={},_0x2db9fb={},_0x200971={'count':0x0,'rows':[]};var _0x1c0bf6=_['map'](db[_0x6110('0x3a')]['rawAttributes'],function(_0x307fc0){return{'name':_0x307fc0[_0x6110('0x3b')],'type':_0x307fc0[_0x6110('0x3c')]['key']};});_0x2db9fb[_0x6110('0x3d')]=_['map'](_0x1c0bf6,_0x6110('0x37'));_0x2db9fb[_0x6110('0x3e')]=_[_0x6110('0x3f')](_0x2a306a[_0x6110('0x3e')]);_0x2db9fb['filters']=_['intersection'](_0x2db9fb[_0x6110('0x3d')],_0x2db9fb[_0x6110('0x3e')]);_0x14d6d7[_0x6110('0x40')]=_['intersection'](_0x2db9fb[_0x6110('0x3d')],qs['fields'](_0x2a306a['query'][_0x6110('0x41')]));_0x14d6d7['attributes']=_0x14d6d7['attributes'][_0x6110('0x42')]?_0x14d6d7[_0x6110('0x40')]:_0x2db9fb['model'];if(!_0x2a306a['query'][_0x6110('0x43')](_0x6110('0x44'))){_0x14d6d7['limit']=qs['limit'](_0x2a306a[_0x6110('0x3e')][_0x6110('0x30')]);_0x14d6d7[_0x6110('0x2f')]=qs['offset'](_0x2a306a['query'][_0x6110('0x2f')]);}_0x14d6d7[_0x6110('0x45')]=qs[_0x6110('0x46')](_0x2a306a[_0x6110('0x3e')][_0x6110('0x46')]);_0x14d6d7[_0x6110('0x47')]=qs['filters'](_[_0x6110('0x48')](_0x2a306a[_0x6110('0x3e')],_0x2db9fb[_0x6110('0x49')]));if(_0x2a306a[_0x6110('0x3e')][_0x6110('0x4a')]){_0x14d6d7[_0x6110('0x47')]=_['merge'](_0x14d6d7['where'],{'$or':_[_0x6110('0x4b')](_0x1c0bf6,function(_0x4bfa08){if(_0x4bfa08['type']!==_0x6110('0x4c')){var _0xa95c59={};_0xa95c59[_0x4bfa08[_0x6110('0x37')]]={'$like':'%'+_0x2a306a['query'][_0x6110('0x4a')]+'%'};return _0xa95c59;}})});}_0x14d6d7=_[_0x6110('0x4d')]({},_0x14d6d7,_0x2a306a['options']);var _0x58a189={'where':_0x14d6d7[_0x6110('0x47')]};return db['FreshdeskAccount'][_0x6110('0x2e')](_0x58a189)['then'](function(_0x245e48){_0x200971[_0x6110('0x2e')]=_0x245e48;if(_0x2a306a[_0x6110('0x3e')]['includeAll']){_0x14d6d7[_0x6110('0x4e')]=[{'all':!![]}];}return db[_0x6110('0x3a')][_0x6110('0x4f')](_0x14d6d7);})['then'](function(_0x230e6a){_0x200971[_0x6110('0x50')]=_0x230e6a;return _0x200971;})[_0x6110('0x36')](respondWithFilteredResult(_0x6de1cb,_0x14d6d7))['catch'](handleError(_0x6de1cb,null));};exports['show']=function(_0x4a8818,_0x5cc654){var _0x28c887={'raw':![],'where':{'id':_0x4a8818['params']['id']}},_0x2d321a={};_0x2d321a[_0x6110('0x3d')]=_['keys'](db['FreshdeskAccount'][_0x6110('0x51')]);_0x2d321a[_0x6110('0x3e')]=_[_0x6110('0x3f')](_0x4a8818['query']);_0x2d321a[_0x6110('0x49')]=_[_0x6110('0x52')](_0x2d321a[_0x6110('0x3d')],_0x2d321a[_0x6110('0x3e')]);_0x28c887[_0x6110('0x40')]=_[_0x6110('0x52')](_0x2d321a[_0x6110('0x3d')],qs[_0x6110('0x41')](_0x4a8818[_0x6110('0x3e')][_0x6110('0x41')]));_0x28c887[_0x6110('0x40')]=_0x28c887['attributes'][_0x6110('0x42')]?_0x28c887[_0x6110('0x40')]:_0x2d321a[_0x6110('0x3d')];if(_0x4a8818[_0x6110('0x3e')][_0x6110('0x53')]){_0x28c887['include']=[{'all':!![]}];}_0x28c887=_[_0x6110('0x4d')]({},_0x28c887,_0x4a8818[_0x6110('0x54')]);return db[_0x6110('0x3a')][_0x6110('0x55')](_0x28c887)[_0x6110('0x36')](handleEntityNotFound(_0x5cc654,null))['then'](respondWithResult(_0x5cc654,null))[_0x6110('0x29')](handleError(_0x5cc654,null));};exports[_0x6110('0x56')]=function(_0xb2245b,_0x4fbd71){return db[_0x6110('0x3a')][_0x6110('0x56')](_0xb2245b[_0x6110('0x57')],{})[_0x6110('0x36')](respondWithResult(_0x4fbd71,0xc9))[_0x6110('0x29')](handleError(_0x4fbd71,null));};exports['update']=function(_0x463535,_0x46228d){if(_0x463535[_0x6110('0x57')]['id']){delete _0x463535[_0x6110('0x57')]['id'];}return db[_0x6110('0x3a')][_0x6110('0x55')]({'where':{'id':_0x463535[_0x6110('0x58')]['id']}})[_0x6110('0x36')](handleEntityNotFound(_0x46228d,null))[_0x6110('0x36')](saveUpdates(_0x463535[_0x6110('0x57')],null))['then'](respondWithResult(_0x46228d,null))['catch'](handleError(_0x46228d,null));};exports[_0x6110('0x35')]=function(_0x5056d7,_0x59d235){return db[_0x6110('0x3a')][_0x6110('0x55')]({'where':{'id':_0x5056d7[_0x6110('0x58')]['id']}})[_0x6110('0x36')](handleEntityNotFound(_0x59d235,null))[_0x6110('0x36')](removeEntity(_0x59d235,null))[_0x6110('0x29')](handleError(_0x59d235,null));};exports[_0x6110('0x59')]=function(_0x161542,_0x238efa,_0x988f51){var _0xc2c064={};var _0x518723={};var _0x75a951;var _0x5d9d4d;return db[_0x6110('0x3a')][_0x6110('0x5a')]({'where':{'id':_0x161542[_0x6110('0x58')]['id']}})['then'](handleEntityNotFound(_0x238efa,null))[_0x6110('0x36')](function(_0x5b356a){if(_0x5b356a){_0x75a951=_0x5b356a;_0x518723[_0x6110('0x3d')]=_[_0x6110('0x3f')](db[_0x6110('0x5b')]['rawAttributes']);_0x518723['query']=_[_0x6110('0x3f')](_0x161542[_0x6110('0x3e')]);_0x518723[_0x6110('0x49')]=_[_0x6110('0x52')](_0x518723['model'],_0x518723[_0x6110('0x3e')]);_0xc2c064[_0x6110('0x40')]=_[_0x6110('0x52')](_0x518723['model'],qs[_0x6110('0x41')](_0x161542['query']['fields']));_0xc2c064['attributes']=_0xc2c064[_0x6110('0x40')][_0x6110('0x42')]?_0xc2c064[_0x6110('0x40')]:_0x518723[_0x6110('0x3d')];_0xc2c064[_0x6110('0x45')]=qs[_0x6110('0x46')](_0x161542[_0x6110('0x3e')][_0x6110('0x46')]);_0xc2c064[_0x6110('0x47')]=qs[_0x6110('0x49')](_[_0x6110('0x48')](_0x161542[_0x6110('0x3e')],_0x518723[_0x6110('0x49')]));if(_0x161542[_0x6110('0x3e')][_0x6110('0x4a')]){_0xc2c064['where']=_[_0x6110('0x4d')](_0xc2c064[_0x6110('0x47')],{'$or':_[_0x6110('0x4b')](_0xc2c064['attributes'],function(_0x47351f){var _0x33ba90={};_0x33ba90[_0x47351f]={'$like':'%'+_0x161542[_0x6110('0x3e')][_0x6110('0x4a')]+'%'};return _0x33ba90;})});}_0xc2c064=_['merge']({},_0xc2c064,_0x161542[_0x6110('0x54')]);return _0x75a951[_0x6110('0x59')](_0xc2c064);}})[_0x6110('0x36')](function(_0xef4437){if(_0xef4437){_0x5d9d4d=_0xef4437['length'];if(!_0x161542[_0x6110('0x3e')]['hasOwnProperty'](_0x6110('0x44'))){_0xc2c064[_0x6110('0x30')]=qs[_0x6110('0x30')](_0x161542[_0x6110('0x3e')][_0x6110('0x30')]);_0xc2c064[_0x6110('0x2f')]=qs[_0x6110('0x2f')](_0x161542[_0x6110('0x3e')][_0x6110('0x2f')]);}return _0x75a951['getConfigurations'](_0xc2c064);}})[_0x6110('0x36')](function(_0x2bbe9a){if(_0x2bbe9a){return _0x2bbe9a?{'count':_0x5d9d4d,'rows':_0x2bbe9a}:null;}})[_0x6110('0x36')](respondWithResult(_0x238efa,null))[_0x6110('0x29')](handleError(_0x238efa,null));};exports[_0x6110('0x5c')]=function(_0x1f8b9c,_0x647f02,_0x4f4908){if(_0x1f8b9c[_0x6110('0x57')]['id']){delete _0x1f8b9c[_0x6110('0x57')]['id'];}return db['FreshdeskAccount'][_0x6110('0x5a')]({'where':{'id':_0x1f8b9c['params']['id']}})[_0x6110('0x36')](handleEntityNotFound(_0x647f02,null))['then'](function(_0x13930d){if(_0x13930d){_0x1f8b9c[_0x6110('0x57')][_0x6110('0x5d')]=_0x13930d['id'];_0x1f8b9c[_0x6110('0x57')][_0x6110('0x5e')]=integrations['getSubjects'](_0x1f8b9c['body']['channel'],_0x1f8b9c[_0x6110('0x57')][_0x6110('0x3c')]);_0x1f8b9c[_0x6110('0x57')][_0x6110('0x5f')]=integrations[_0x6110('0x60')](_0x1f8b9c[_0x6110('0x57')]['channel'],_0x1f8b9c[_0x6110('0x57')][_0x6110('0x3c')]);return db['FreshdeskConfiguration']['create'](_0x1f8b9c[_0x6110('0x57')],{'include':[{'model':db[_0x6110('0x61')],'as':'Subjects'},{'model':db[_0x6110('0x61')],'as':_0x6110('0x5f')}]});}return null;})['then'](respondWithResult(_0x647f02,null))['catch'](handleError(_0x647f02,null));};exports[_0x6110('0x62')]=function(_0x567479,_0x54ec4e,_0x35c45c){var _0x472b3b='';return db[_0x6110('0x3a')]['findOne']({'where':{'id':_0x567479['params']['id']},'attributes':['id',_0x6110('0x63'),_0x6110('0x64')]})[_0x6110('0x36')](handleEntityNotFound(_0x54ec4e,null))[_0x6110('0x36')](function(_0x590a88){if(_0x590a88){_0x472b3b=_0x590a88[_0x6110('0x63')];var _0xda7386=_0x472b3b[_0x6110('0x65')](-0x1);if(_0xda7386==='/'){_0x472b3b=_0x472b3b[_0x6110('0x66')](0x0,_0x472b3b[_0x6110('0x67')](_0xda7386));}return rp({'method':_0x6110('0x68'),'uri':util[_0x6110('0x69')](_0x6110('0x6a'),_0x472b3b,'api/v2/ticket_fields'),'headers':{'Authorization':util['format'](_0x6110('0x6b'),new Buffer(util[_0x6110('0x69')](_0x6110('0x6c'),_0x590a88[_0x6110('0x64')]))['toString'](_0x6110('0x6d')))},'json':!![]});}})[_0x6110('0x36')](function(_0x1bb1a8){if(_0x1bb1a8){var _0xd6a059=['requester',_0x6110('0x6e'),_0x6110('0x6f'),'description',_0x6110('0x2c'),_0x6110('0x70'),_0x6110('0x71'),_0x6110('0x72'),'ticket_type',_0x6110('0x71'),_0x6110('0x73')];_[_0x6110('0x74')](_0x1bb1a8,function(_0x33f635){return _0xd6a059[_0x6110('0x75')](_0x33f635['name'])||!_0x33f635['default']&&_0x33f635[_0x6110('0x3c')]!==_0x6110('0x76')&&_0x33f635[_0x6110('0x3c')]!==_0x6110('0x77');});return{'count':_0x1bb1a8['length'],'rows':_['map'](_0x1bb1a8,function(_0x610f44){return{'id':_0x610f44[_0x6110('0x37')],'name':_0x610f44[_0x6110('0x78')],'custom':!_0x610f44[_0x6110('0x79')],'options':_0x610f44['choices']?_[_0x6110('0x4b')](_0x610f44['choices'],function(_0x40dfec){return{'name':_[_0x6110('0x7a')](_0x40dfec),'value':_0x40dfec};}):[]};})};}})['then'](respondWithResult(_0x54ec4e,null))['catch'](function(_0xc1a787){var _0x27841d=_0x567479[_0x6110('0x3e')][_0x6110('0x1b')]?0x1f4:_0xc1a787['statusCode']||0x1f4;logger[_0x6110('0x24')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x27841d,JSON[_0x6110('0x23')](_0xc1a787));delete _0xc1a787[_0x6110('0x37')];if(_0x27841d===0x191){_0x27841d=0x190;}_0x54ec4e['status'](_0x27841d)[_0x6110('0x38')](_0x567479[_0x6110('0x3e')][_0x6110('0x1b')]?{'message':_0x6110('0x7b'),'statusCode':_0xc1a787[_0x6110('0x7c')]}:_0xc1a787);});}; \ No newline at end of file +var _0xa245=['moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','stack','name','index','map','FreshdeskAccount','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','fields','include','find','body','getConfigurations','findOne','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','create','FreshdeskField','getFields','remoteUri','apiKey','slice','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','toString','requester','subject','description','priority','group','source','ticket_type','company','remove','includes','default','custom_text','custom_dropdown','label','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise'];(function(_0x25cd6d,_0x30a718){var _0x7811e1=function(_0x29c1a1){while(--_0x29c1a1){_0x25cd6d['push'](_0x25cd6d['shift']());}};_0x7811e1(++_0x30a718);}(_0xa245,0x81));var _0x5a24=function(_0x2cddb1,_0x28059d){_0x2cddb1=_0x2cddb1-0x0;var _0x32eaf6=_0xa245[_0x2cddb1];return _0x32eaf6;};'use strict';var pdf=require(_0x5a24('0x0'));var emlformat=require(_0x5a24('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x5a24('0x2'));var jsonpatch=require(_0x5a24('0x3'));var rp=require(_0x5a24('0x4'));var moment=require(_0x5a24('0x5'));var BPromise=require(_0x5a24('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5a24('0x7'));var sox=require(_0x5a24('0x8'));var csv=require(_0x5a24('0x9'));var ejs=require(_0x5a24('0xa'));var fs=require('fs');var _=require(_0x5a24('0xb'));var squel=require(_0x5a24('0xc'));var crypto=require(_0x5a24('0xd'));var jsforce=require(_0x5a24('0xe'));var deskjs=require(_0x5a24('0xf'));var toCsv=require(_0x5a24('0x9'));var querystring=require(_0x5a24('0x10'));var Papa=require(_0x5a24('0x11'));var Redis=require('ioredis');var authService=require(_0x5a24('0x12'));var qs=require(_0x5a24('0x13'));var as=require(_0x5a24('0x14'));var hardwareService=require(_0x5a24('0x15'));var logger=require(_0x5a24('0x16'))(_0x5a24('0x17'));var utils=require(_0x5a24('0x18'));var config=require(_0x5a24('0x19'));var db=require(_0x5a24('0x1a'))['db'];var integrations=require(_0x5a24('0x1b'));var jayson=require(_0x5a24('0x1c'));var client=jayson[_0x5a24('0x1d')][_0x5a24('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x419552,_0x3b72a0,_0x151f5d){if(_0x151f5d){var _0x309812=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x309812['test'](_0x3b72a0)){return _0x419552;}else{throw new db['Sequelize']['ValidationError'](_0x5a24('0x1f'));}}else{return _0x419552;}}function respondWithRpcPromise(_0x42b584,_0x486113,_0x22cf3b,_0x4486de){return new BPromise(function(_0x306928,_0x473ff7){var _0xc02789=_0x4486de||client;return _0xc02789['request'](_0x42b584,_0x22cf3b)[_0x5a24('0x20')](function(_0x3f454){logger[_0x5a24('0x21')](_0x5a24('0x22'),_0x486113,_0x5a24('0x23'));logger[_0x5a24('0x24')](_0x5a24('0x25'),_0x486113,_0x5a24('0x23'),JSON[_0x5a24('0x26')](_0x3f454));if(_0x3f454[_0x5a24('0x27')]){if(_0x3f454['error'][_0x5a24('0x28')]===0x1f4){logger[_0x5a24('0x27')]('FreshdeskAccount,\x20%s,\x20%s',_0x486113,_0x3f454[_0x5a24('0x27')][_0x5a24('0x29')]);return _0x473ff7(_0x3f454['error'][_0x5a24('0x29')]);}logger[_0x5a24('0x27')](_0x5a24('0x22'),_0x486113,_0x3f454[_0x5a24('0x27')][_0x5a24('0x29')]);return _0x306928(_0x3f454[_0x5a24('0x27')][_0x5a24('0x29')]);}else{logger[_0x5a24('0x21')](_0x5a24('0x22'),_0x486113,_0x5a24('0x23'));_0x306928(_0x3f454['result'][_0x5a24('0x29')]);}})[_0x5a24('0x2a')](function(_0x36d69b){logger[_0x5a24('0x27')](_0x5a24('0x22'),_0x486113,_0x36d69b);_0x473ff7(_0x36d69b);});});}function respondWithStatusCode(_0x4f8ca1,_0x330237){_0x330237=_0x330237||0xcc;return function(_0x41e9e4){if(_0x41e9e4){return _0x4f8ca1[_0x5a24('0x2b')](_0x330237);}return _0x4f8ca1[_0x5a24('0x2c')](_0x330237)[_0x5a24('0x2d')]();};}function respondWithResult(_0xd95369,_0x23829e){_0x23829e=_0x23829e||0xc8;return function(_0x2ddf51){if(_0x2ddf51){return _0xd95369[_0x5a24('0x2c')](_0x23829e)[_0x5a24('0x2e')](_0x2ddf51);}};}function respondWithFilteredResult(_0x13d364,_0x309d13){return function(_0x191582){if(_0x191582){var _0x56896e=_0x191582[_0x5a24('0x2f')],_0x1e6895=_0x309d13[_0x5a24('0x30')],_0x4af6aa=_0x309d13['offset']+_0x309d13[_0x5a24('0x31')],_0x195226;if(_0x4af6aa>=_0x56896e){_0x4af6aa=_0x56896e;_0x195226=0xc8;}else{_0x195226=0xce;}_0x13d364[_0x5a24('0x2c')](_0x195226);return _0x13d364[_0x5a24('0x32')](_0x5a24('0x33'),_0x1e6895+'-'+_0x4af6aa+'/'+_0x56896e)['json'](_0x191582);}return null;};}function patchUpdates(_0x541c1a){return function(_0x271bac){try{jsonpatch['apply'](_0x271bac,_0x541c1a,!![]);}catch(_0x14000f){return BPromise[_0x5a24('0x34')](_0x14000f);}return _0x271bac[_0x5a24('0x35')]();};}function saveUpdates(_0x27e880,_0xec2faf){return function(_0x3d428d){if(_0x3d428d){return _0x3d428d[_0x5a24('0x36')](_0x27e880)[_0x5a24('0x20')](function(_0x555e54){return _0x555e54;});}return null;};}function removeEntity(_0x1ab280,_0x101c77){return function(_0x69393e){if(_0x69393e){return _0x69393e[_0x5a24('0x37')]()['then'](function(){_0x1ab280['status'](0xcc)[_0x5a24('0x2d')]();});}};}function handleEntityNotFound(_0x14f21c,_0xfe8043){return function(_0x4471d9){if(!_0x4471d9){_0x14f21c['sendStatus'](0x194);}return _0x4471d9;};}function handleError(_0x1e1656,_0x4ee82f){_0x4ee82f=_0x4ee82f||0x1f4;return function(_0x3a2dc3){logger['error'](_0x3a2dc3[_0x5a24('0x38')]);if(_0x3a2dc3[_0x5a24('0x39')]){delete _0x3a2dc3[_0x5a24('0x39')];}_0x1e1656[_0x5a24('0x2c')](_0x4ee82f)['send'](_0x3a2dc3);};}exports[_0x5a24('0x3a')]=function(_0x4b9761,_0x157834){var _0x2c35dc={},_0x203385={},_0x237443={'count':0x0,'rows':[]};var _0x17d9bc=_[_0x5a24('0x3b')](db[_0x5a24('0x3c')][_0x5a24('0x3d')],function(_0xab638){return{'name':_0xab638[_0x5a24('0x3e')],'type':_0xab638[_0x5a24('0x3f')]['key']};});_0x203385[_0x5a24('0x40')]=_[_0x5a24('0x3b')](_0x17d9bc,_0x5a24('0x39'));_0x203385[_0x5a24('0x41')]=_[_0x5a24('0x42')](_0x4b9761[_0x5a24('0x41')]);_0x203385['filters']=_[_0x5a24('0x43')](_0x203385[_0x5a24('0x40')],_0x203385[_0x5a24('0x41')]);_0x2c35dc['attributes']=_[_0x5a24('0x43')](_0x203385[_0x5a24('0x40')],qs['fields'](_0x4b9761[_0x5a24('0x41')]['fields']));_0x2c35dc[_0x5a24('0x44')]=_0x2c35dc[_0x5a24('0x44')][_0x5a24('0x45')]?_0x2c35dc[_0x5a24('0x44')]:_0x203385[_0x5a24('0x40')];if(!_0x4b9761[_0x5a24('0x41')][_0x5a24('0x46')](_0x5a24('0x47'))){_0x2c35dc[_0x5a24('0x31')]=qs[_0x5a24('0x31')](_0x4b9761[_0x5a24('0x41')][_0x5a24('0x31')]);_0x2c35dc[_0x5a24('0x30')]=qs['offset'](_0x4b9761['query']['offset']);}_0x2c35dc[_0x5a24('0x48')]=qs[_0x5a24('0x49')](_0x4b9761[_0x5a24('0x41')]['sort']);_0x2c35dc[_0x5a24('0x4a')]=qs['filters'](_[_0x5a24('0x4b')](_0x4b9761[_0x5a24('0x41')],_0x203385[_0x5a24('0x4c')]));if(_0x4b9761['query'][_0x5a24('0x4d')]){_0x2c35dc[_0x5a24('0x4a')]=_[_0x5a24('0x4e')](_0x2c35dc[_0x5a24('0x4a')],{'$or':_['map'](_0x17d9bc,function(_0x168b08){if(_0x168b08[_0x5a24('0x3f')]!==_0x5a24('0x4f')){var _0x57252e={};_0x57252e[_0x168b08[_0x5a24('0x39')]]={'$like':'%'+_0x4b9761['query'][_0x5a24('0x4d')]+'%'};return _0x57252e;}})});}_0x2c35dc=_['merge']({},_0x2c35dc,_0x4b9761[_0x5a24('0x50')]);var _0x3ff318={'where':_0x2c35dc[_0x5a24('0x4a')]};return db[_0x5a24('0x3c')][_0x5a24('0x2f')](_0x3ff318)[_0x5a24('0x20')](function(_0x5de383){_0x237443[_0x5a24('0x2f')]=_0x5de383;if(_0x4b9761[_0x5a24('0x41')][_0x5a24('0x51')]){_0x2c35dc['include']=[{'all':!![]}];}return db[_0x5a24('0x3c')][_0x5a24('0x52')](_0x2c35dc);})[_0x5a24('0x20')](function(_0x3e1363){_0x237443[_0x5a24('0x53')]=_0x3e1363;return _0x237443;})['then'](respondWithFilteredResult(_0x157834,_0x2c35dc))[_0x5a24('0x2a')](handleError(_0x157834,null));};exports[_0x5a24('0x54')]=function(_0x55a883,_0x5137db){var _0x231f43={'raw':![],'where':{'id':_0x55a883[_0x5a24('0x55')]['id']}},_0x4d4e29={};_0x4d4e29['model']=_[_0x5a24('0x42')](db[_0x5a24('0x3c')][_0x5a24('0x3d')]);_0x4d4e29['query']=_[_0x5a24('0x42')](_0x55a883[_0x5a24('0x41')]);_0x4d4e29[_0x5a24('0x4c')]=_[_0x5a24('0x43')](_0x4d4e29[_0x5a24('0x40')],_0x4d4e29[_0x5a24('0x41')]);_0x231f43['attributes']=_[_0x5a24('0x43')](_0x4d4e29[_0x5a24('0x40')],qs[_0x5a24('0x56')](_0x55a883[_0x5a24('0x41')][_0x5a24('0x56')]));_0x231f43[_0x5a24('0x44')]=_0x231f43[_0x5a24('0x44')][_0x5a24('0x45')]?_0x231f43[_0x5a24('0x44')]:_0x4d4e29['model'];if(_0x55a883[_0x5a24('0x41')]['includeAll']){_0x231f43[_0x5a24('0x57')]=[{'all':!![]}];}_0x231f43=_[_0x5a24('0x4e')]({},_0x231f43,_0x55a883[_0x5a24('0x50')]);return db[_0x5a24('0x3c')][_0x5a24('0x58')](_0x231f43)['then'](handleEntityNotFound(_0x5137db,null))[_0x5a24('0x20')](respondWithResult(_0x5137db,null))[_0x5a24('0x2a')](handleError(_0x5137db,null));};exports['create']=function(_0x1fa131,_0x255ca0){return db[_0x5a24('0x3c')]['create'](_0x1fa131[_0x5a24('0x59')],{})[_0x5a24('0x20')](respondWithResult(_0x255ca0,0xc9))['catch'](handleError(_0x255ca0,null));};exports['update']=function(_0x5a8c03,_0x59b959){if(_0x5a8c03['body']['id']){delete _0x5a8c03['body']['id'];}return db[_0x5a24('0x3c')]['find']({'where':{'id':_0x5a8c03['params']['id']}})['then'](handleEntityNotFound(_0x59b959,null))[_0x5a24('0x20')](saveUpdates(_0x5a8c03[_0x5a24('0x59')],null))[_0x5a24('0x20')](respondWithResult(_0x59b959,null))[_0x5a24('0x2a')](handleError(_0x59b959,null));};exports[_0x5a24('0x37')]=function(_0x2ae2cb,_0xb352ba){return db[_0x5a24('0x3c')][_0x5a24('0x58')]({'where':{'id':_0x2ae2cb[_0x5a24('0x55')]['id']}})[_0x5a24('0x20')](handleEntityNotFound(_0xb352ba,null))[_0x5a24('0x20')](removeEntity(_0xb352ba,null))[_0x5a24('0x2a')](handleError(_0xb352ba,null));};exports[_0x5a24('0x5a')]=function(_0x5a0a43,_0x45fa57,_0xa73c6){var _0x3bf519={};var _0x28b3a5={};var _0x28d563;var _0x375b49;return db[_0x5a24('0x3c')][_0x5a24('0x5b')]({'where':{'id':_0x5a0a43[_0x5a24('0x55')]['id']}})[_0x5a24('0x20')](handleEntityNotFound(_0x45fa57,null))[_0x5a24('0x20')](function(_0x5e411d){if(_0x5e411d){_0x28d563=_0x5e411d;_0x28b3a5['model']=_[_0x5a24('0x42')](db['FreshdeskConfiguration']['rawAttributes']);_0x28b3a5[_0x5a24('0x41')]=_[_0x5a24('0x42')](_0x5a0a43[_0x5a24('0x41')]);_0x28b3a5[_0x5a24('0x4c')]=_[_0x5a24('0x43')](_0x28b3a5[_0x5a24('0x40')],_0x28b3a5[_0x5a24('0x41')]);_0x3bf519[_0x5a24('0x44')]=_['intersection'](_0x28b3a5['model'],qs[_0x5a24('0x56')](_0x5a0a43[_0x5a24('0x41')][_0x5a24('0x56')]));_0x3bf519[_0x5a24('0x44')]=_0x3bf519[_0x5a24('0x44')][_0x5a24('0x45')]?_0x3bf519[_0x5a24('0x44')]:_0x28b3a5[_0x5a24('0x40')];_0x3bf519[_0x5a24('0x48')]=qs[_0x5a24('0x49')](_0x5a0a43[_0x5a24('0x41')][_0x5a24('0x49')]);_0x3bf519[_0x5a24('0x4a')]=qs['filters'](_[_0x5a24('0x4b')](_0x5a0a43[_0x5a24('0x41')],_0x28b3a5['filters']));if(_0x5a0a43[_0x5a24('0x41')][_0x5a24('0x4d')]){_0x3bf519[_0x5a24('0x4a')]=_['merge'](_0x3bf519[_0x5a24('0x4a')],{'$or':_[_0x5a24('0x3b')](_0x3bf519['attributes'],function(_0xcd82c7){var _0x4624c6={};_0x4624c6[_0xcd82c7]={'$like':'%'+_0x5a0a43[_0x5a24('0x41')][_0x5a24('0x4d')]+'%'};return _0x4624c6;})});}_0x3bf519=_[_0x5a24('0x4e')]({},_0x3bf519,_0x5a0a43[_0x5a24('0x50')]);return _0x28d563[_0x5a24('0x5a')](_0x3bf519);}})[_0x5a24('0x20')](function(_0x38b268){if(_0x38b268){_0x375b49=_0x38b268[_0x5a24('0x45')];if(!_0x5a0a43['query'][_0x5a24('0x46')](_0x5a24('0x47'))){_0x3bf519['limit']=qs[_0x5a24('0x31')](_0x5a0a43[_0x5a24('0x41')]['limit']);_0x3bf519[_0x5a24('0x30')]=qs['offset'](_0x5a0a43[_0x5a24('0x41')][_0x5a24('0x30')]);}return _0x28d563[_0x5a24('0x5a')](_0x3bf519);}})[_0x5a24('0x20')](function(_0x2c1f31){if(_0x2c1f31){return _0x2c1f31?{'count':_0x375b49,'rows':_0x2c1f31}:null;}})[_0x5a24('0x20')](respondWithResult(_0x45fa57,null))[_0x5a24('0x2a')](handleError(_0x45fa57,null));};exports[_0x5a24('0x5c')]=function(_0x9d2189,_0x32786a,_0x24ca1a){if(_0x9d2189[_0x5a24('0x59')]['id']){delete _0x9d2189['body']['id'];}return db['FreshdeskAccount'][_0x5a24('0x5b')]({'where':{'id':_0x9d2189[_0x5a24('0x55')]['id']}})[_0x5a24('0x20')](handleEntityNotFound(_0x32786a,null))[_0x5a24('0x20')](function(_0x2d824f){if(_0x2d824f){_0x9d2189['body'][_0x5a24('0x5d')]=_0x2d824f['id'];_0x9d2189[_0x5a24('0x59')][_0x5a24('0x5e')]=integrations[_0x5a24('0x5f')](_0x9d2189['body'][_0x5a24('0x60')],_0x9d2189['body'][_0x5a24('0x3f')]);_0x9d2189['body'][_0x5a24('0x61')]=integrations[_0x5a24('0x62')](_0x9d2189['body']['channel'],_0x9d2189[_0x5a24('0x59')][_0x5a24('0x3f')]);return db['FreshdeskConfiguration'][_0x5a24('0x63')](_0x9d2189['body'],{'include':[{'model':db[_0x5a24('0x64')],'as':_0x5a24('0x5e')},{'model':db[_0x5a24('0x64')],'as':_0x5a24('0x61')}]});}return null;})['then'](respondWithResult(_0x32786a,null))['catch'](handleError(_0x32786a,null));};exports[_0x5a24('0x65')]=function(_0x70141a,_0x596e75,_0x2196e4){var _0x2d17c8='';return db['FreshdeskAccount']['findOne']({'where':{'id':_0x70141a[_0x5a24('0x55')]['id']},'attributes':['id',_0x5a24('0x66'),_0x5a24('0x67')]})[_0x5a24('0x20')](handleEntityNotFound(_0x596e75,null))[_0x5a24('0x20')](function(_0x30f756){if(_0x30f756){_0x2d17c8=_0x30f756[_0x5a24('0x66')];var _0x1b7b59=_0x2d17c8[_0x5a24('0x68')](-0x1);if(_0x1b7b59==='/'){_0x2d17c8=_0x2d17c8['substring'](0x0,_0x2d17c8[_0x5a24('0x69')](_0x1b7b59));}return rp({'method':_0x5a24('0x6a'),'uri':util[_0x5a24('0x6b')](_0x5a24('0x6c'),_0x2d17c8,_0x5a24('0x6d')),'headers':{'Authorization':util[_0x5a24('0x6b')](_0x5a24('0x6e'),new Buffer(util[_0x5a24('0x6b')](_0x5a24('0x6f'),_0x30f756[_0x5a24('0x67')]))[_0x5a24('0x70')]('base64'))},'json':!![]});}})['then'](function(_0x1c563d){if(_0x1c563d){var _0x951c6e=[_0x5a24('0x71'),_0x5a24('0x72'),'agent',_0x5a24('0x73'),_0x5a24('0x2c'),_0x5a24('0x74'),_0x5a24('0x75'),_0x5a24('0x76'),_0x5a24('0x77'),'group',_0x5a24('0x78')];_[_0x5a24('0x79')](_0x1c563d,function(_0x12b3ac){return _0x951c6e[_0x5a24('0x7a')](_0x12b3ac[_0x5a24('0x39')])||!_0x12b3ac[_0x5a24('0x7b')]&&_0x12b3ac[_0x5a24('0x3f')]!==_0x5a24('0x7c')&&_0x12b3ac[_0x5a24('0x3f')]!==_0x5a24('0x7d');});return{'count':_0x1c563d[_0x5a24('0x45')],'rows':_[_0x5a24('0x3b')](_0x1c563d,function(_0x1b0b90){return{'id':_0x1b0b90[_0x5a24('0x39')],'name':_0x1b0b90[_0x5a24('0x7e')],'custom':!_0x1b0b90[_0x5a24('0x7b')],'options':_0x1b0b90[_0x5a24('0x7f')]?_[_0x5a24('0x3b')](_0x1b0b90['choices'],function(_0x1693cb){return{'name':_[_0x5a24('0x80')](_0x1693cb),'value':_0x1693cb};}):[]};})};}})[_0x5a24('0x20')](respondWithResult(_0x596e75,null))[_0x5a24('0x2a')](function(_0x3fce70){var _0x49c532=_0x70141a[_0x5a24('0x41')][_0x5a24('0x81')]?0x1f4:_0x3fce70[_0x5a24('0x82')]||0x1f4;logger[_0x5a24('0x27')](_0x5a24('0x83'),'getFields',_0x49c532,JSON[_0x5a24('0x26')](_0x3fce70));delete _0x3fce70[_0x5a24('0x39')];if(_0x49c532===0x191){_0x49c532=0x190;}_0x596e75[_0x5a24('0x2c')](_0x49c532)[_0x5a24('0x84')](_0x70141a[_0x5a24('0x41')]['test']?{'message':_0x5a24('0x85'),'statusCode':_0x3fce70['statusCode']}:_0x3fce70);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 16b30ae..da87460 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 _0x04ff=['int_freshdesk_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','define'];(function(_0x24f4ee,_0x21a959){var _0x4c2f97=function(_0x23a41a){while(--_0x23a41a){_0x24f4ee['push'](_0x24f4ee['shift']());}};_0x4c2f97(++_0x21a959);}(_0x04ff,0x153));var _0xf04f=function(_0x549a2c,_0x13bd03){_0x549a2c=_0x549a2c-0x0;var _0x16b56b=_0x04ff[_0x549a2c];return _0x16b56b;};'use strict';var _=require(_0xf04f('0x0'));var util=require(_0xf04f('0x1'));var logger=require(_0xf04f('0x2'))(_0xf04f('0x3'));var moment=require(_0xf04f('0x4'));var BPromise=require(_0xf04f('0x5'));var rp=require(_0xf04f('0x6'));var fs=require('fs');var path=require(_0xf04f('0x7'));var rimraf=require(_0xf04f('0x8'));var config=require(_0xf04f('0x9'));var attributes=require(_0xf04f('0xa'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x2acb40,_0x26809e){return _0x2acb40[_0xf04f('0xb')]('FreshdeskAccount',attributes,{'tableName':_0xf04f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1c6e=['../../components/integrations/configuration','define','int_freshdesk_accounts','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes'];(function(_0x307d86,_0x9264f2){var _0x361745=function(_0x1b64e1){while(--_0x1b64e1){_0x307d86['push'](_0x307d86['shift']());}};_0x361745(++_0x9264f2);}(_0x1c6e,0x17f));var _0xe1c6=function(_0xd02def,_0x144f25){_0xd02def=_0xd02def-0x0;var _0x2e8374=_0x1c6e[_0xd02def];return _0x2e8374;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe1c6('0x0'))('api');var moment=require('moment');var BPromise=require(_0xe1c6('0x1'));var rp=require(_0xe1c6('0x2'));var fs=require('fs');var path=require(_0xe1c6('0x3'));var rimraf=require(_0xe1c6('0x4'));var config=require(_0xe1c6('0x5'));var attributes=require(_0xe1c6('0x6'));var integrations=require(_0xe1c6('0x7'));module['exports']=function(_0x1a297b,_0x319267){return _0x1a297b[_0xe1c6('0x8')]('FreshdeskAccount',attributes,{'tableName':_0xe1c6('0x9'),'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 0d7182f..19d7fe3 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 _0xf33f=['FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','result','message','catch','findAll','options','raw','where','attributes','limit','include','map','model','then','GetFreshdeskAccount','ShowFreshdeskAccount','FreshdeskAccount','find','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','info'];(function(_0x26019e,_0x96c8c4){var _0x451cad=function(_0x1b0d41){while(--_0x1b0d41){_0x26019e['push'](_0x26019e['shift']());}};_0x451cad(++_0x96c8c4);}(_0xf33f,0x18e));var _0xff33=function(_0xd4ad90,_0x5f3886){_0xd4ad90=_0xd4ad90-0x0;var _0x520b19=_0xf33f[_0xd4ad90];return _0x520b19;};'use strict';var _=require(_0xff33('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xff33('0x1'));var rs=require(_0xff33('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xff33('0x3'))['db'];var utils=require(_0xff33('0x4'));var logger=require(_0xff33('0x5'))(_0xff33('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xff33('0x7')][_0xff33('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x10af02,_0x3a9e83,_0x754c4d){return new BPromise(function(_0x70888b,_0x4032fc){return client['request'](_0x10af02,_0x754c4d)['then'](function(_0x216000){logger[_0xff33('0x9')](_0xff33('0xa'),_0x3a9e83,_0xff33('0xb'));logger[_0xff33('0xc')](_0xff33('0xd'),_0x3a9e83,_0xff33('0xb'),JSON[_0xff33('0xe')](_0x216000));if(_0x216000[_0xff33('0xf')]){if(_0x216000[_0xff33('0xf')][_0xff33('0x10')]===0x1f4){logger[_0xff33('0xf')](_0xff33('0xa'),_0x3a9e83,_0x216000[_0xff33('0xf')]['message']);return _0x4032fc(_0x216000[_0xff33('0xf')]['message']);}logger['error'](_0xff33('0xa'),_0x3a9e83,_0x216000[_0xff33('0xf')]['message']);return _0x70888b(_0x216000[_0xff33('0xf')]['message']);}else{logger[_0xff33('0x9')](_0xff33('0xa'),_0x3a9e83,_0xff33('0xb'));_0x70888b(_0x216000[_0xff33('0x11')][_0xff33('0x12')]);}})[_0xff33('0x13')](function(_0x32feac){logger['error'](_0xff33('0xa'),_0x3a9e83,_0x32feac);_0x4032fc(_0x32feac);});});}exports['GetFreshdeskAccount']=function(_0x53cff2){var _0x507c44=this;return new Promise(function(_0x5ba836,_0x388c65){return db['FreshdeskAccount'][_0xff33('0x14')]({'raw':_0x53cff2[_0xff33('0x15')]?_0x53cff2[_0xff33('0x15')][_0xff33('0x16')]===undefined?!![]:![]:!![],'where':_0x53cff2[_0xff33('0x15')]?_0x53cff2['options'][_0xff33('0x17')]||null:null,'attributes':_0x53cff2[_0xff33('0x15')]?_0x53cff2[_0xff33('0x15')][_0xff33('0x18')]||null:null,'limit':_0x53cff2['options']?_0x53cff2[_0xff33('0x15')][_0xff33('0x19')]||null:null,'include':_0x53cff2[_0xff33('0x15')]?_0x53cff2[_0xff33('0x15')][_0xff33('0x1a')]?_['map'](_0x53cff2[_0xff33('0x15')][_0xff33('0x1a')],function(_0x3c9120){return{'model':db[_0x3c9120['model']],'as':_0x3c9120['as'],'attributes':_0x3c9120[_0xff33('0x18')],'include':_0x3c9120[_0xff33('0x1a')]?_[_0xff33('0x1b')](_0x3c9120[_0xff33('0x1a')],function(_0x3155fc){return{'model':db[_0x3155fc[_0xff33('0x1c')]],'as':_0x3155fc['as'],'attributes':_0x3155fc[_0xff33('0x18')],'include':_0x3155fc[_0xff33('0x1a')]?_[_0xff33('0x1b')](_0x3155fc[_0xff33('0x1a')],function(_0x4238dc){return{'model':db[_0x4238dc[_0xff33('0x1c')]],'as':_0x4238dc['as'],'attributes':_0x4238dc[_0xff33('0x18')]};}):[]};}):[]};}):[]:[]})[_0xff33('0x1d')](function(_0x2e44f5){logger[_0xff33('0x9')]('GetFreshdeskAccount',_0x53cff2);logger[_0xff33('0xc')]('GetFreshdeskAccount',_0x53cff2,JSON[_0xff33('0xe')](_0x2e44f5));_0x5ba836(_0x2e44f5);})[_0xff33('0x13')](function(_0x1de491){logger[_0xff33('0xf')](_0xff33('0x1e'),_0x1de491[_0xff33('0x12')],_0x53cff2);_0x388c65(_0x507c44[_0xff33('0xf')](0x1f4,_0x1de491['message']));});});};exports[_0xff33('0x1f')]=function(_0x24c23a){var _0x19fa12=this;return new Promise(function(_0x4dc9ae,_0x3de0bf){return db[_0xff33('0x20')][_0xff33('0x21')]({'raw':_0x24c23a[_0xff33('0x15')]?_0x24c23a[_0xff33('0x15')][_0xff33('0x16')]===undefined?!![]:![]:!![],'where':_0x24c23a[_0xff33('0x15')]?_0x24c23a[_0xff33('0x15')]['where']||null:null,'attributes':_0x24c23a[_0xff33('0x15')]?_0x24c23a[_0xff33('0x15')][_0xff33('0x18')]||null:null,'include':_0x24c23a[_0xff33('0x15')]?_0x24c23a[_0xff33('0x15')][_0xff33('0x1a')]?_[_0xff33('0x1b')](_0x24c23a[_0xff33('0x15')][_0xff33('0x1a')],function(_0x141588){return{'model':db[_0x141588['model']],'as':_0x141588['as'],'attributes':_0x141588[_0xff33('0x18')],'include':_0x141588[_0xff33('0x1a')]?_[_0xff33('0x1b')](_0x141588['include'],function(_0x366369){return{'model':db[_0x366369['model']],'as':_0x366369['as'],'attributes':_0x366369[_0xff33('0x18')],'include':_0x366369[_0xff33('0x1a')]?_[_0xff33('0x1b')](_0x366369[_0xff33('0x1a')],function(_0x4ebcf2){return{'model':db[_0x4ebcf2[_0xff33('0x1c')]],'as':_0x4ebcf2['as'],'attributes':_0x4ebcf2[_0xff33('0x18')]};}):[]};}):[]};}):[]:[]})[_0xff33('0x1d')](function(_0x413f69){logger['info']('ShowFreshdeskAccount',_0x24c23a);logger[_0xff33('0xc')]('ShowFreshdeskAccount',_0x24c23a,JSON[_0xff33('0xe')](_0x413f69));_0x4dc9ae(_0x413f69);})[_0xff33('0x13')](function(_0x285a50){logger[_0xff33('0xf')]('ShowFreshdeskAccount',_0x285a50[_0xff33('0x12')],_0x24c23a);_0x3de0bf(_0x19fa12[_0xff33('0xf')](0x1f4,_0x285a50[_0xff33('0x12')]));});});}; \ No newline at end of file +var _0xede4=['bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','find','ShowFreshdeskAccount','lodash','moment'];(function(_0x1df7b8,_0x2fe5e5){var _0x29d911=function(_0x340121){while(--_0x340121){_0x1df7b8['push'](_0x1df7b8['shift']());}};_0x29d911(++_0x2fe5e5);}(_0xede4,0x1cc));var _0x4ede=function(_0x2137bc,_0x5cc326){_0x2137bc=_0x2137bc-0x0;var _0x2e24f8=_0xede4[_0x2137bc];return _0x2e24f8;};'use strict';var _=require(_0x4ede('0x0'));var util=require('util');var moment=require(_0x4ede('0x1'));var BPromise=require(_0x4ede('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4ede('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x4ede('0x4'))(_0x4ede('0x5'));var config=require(_0x4ede('0x6'));var jayson=require(_0x4ede('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x346b43,_0x4a91d6,_0x305d3a){return new BPromise(function(_0x53fad1,_0x46ed82){return client['request'](_0x346b43,_0x305d3a)[_0x4ede('0x8')](function(_0x23648e){logger[_0x4ede('0x9')](_0x4ede('0xa'),_0x4a91d6,_0x4ede('0xb'));logger[_0x4ede('0xc')](_0x4ede('0xd'),_0x4a91d6,_0x4ede('0xb'),JSON[_0x4ede('0xe')](_0x23648e));if(_0x23648e['error']){if(_0x23648e['error'][_0x4ede('0xf')]===0x1f4){logger[_0x4ede('0x10')](_0x4ede('0xa'),_0x4a91d6,_0x23648e[_0x4ede('0x10')][_0x4ede('0x11')]);return _0x46ed82(_0x23648e[_0x4ede('0x10')][_0x4ede('0x11')]);}logger[_0x4ede('0x10')](_0x4ede('0xa'),_0x4a91d6,_0x23648e['error'][_0x4ede('0x11')]);return _0x53fad1(_0x23648e['error'][_0x4ede('0x11')]);}else{logger[_0x4ede('0x9')]('FreshdeskAccount,\x20%s,\x20%s',_0x4a91d6,_0x4ede('0xb'));_0x53fad1(_0x23648e[_0x4ede('0x12')][_0x4ede('0x11')]);}})[_0x4ede('0x13')](function(_0x5297fb){logger[_0x4ede('0x10')](_0x4ede('0xa'),_0x4a91d6,_0x5297fb);_0x46ed82(_0x5297fb);});});}exports[_0x4ede('0x14')]=function(_0xe06971){var _0x1f15ea=this;return new Promise(function(_0x30e317,_0x3c03e0){return db[_0x4ede('0x15')][_0x4ede('0x16')]({'raw':_0xe06971['options']?_0xe06971[_0x4ede('0x17')][_0x4ede('0x18')]===undefined?!![]:![]:!![],'where':_0xe06971[_0x4ede('0x17')]?_0xe06971['options'][_0x4ede('0x19')]||null:null,'attributes':_0xe06971[_0x4ede('0x17')]?_0xe06971[_0x4ede('0x17')][_0x4ede('0x1a')]||null:null,'limit':_0xe06971['options']?_0xe06971[_0x4ede('0x17')][_0x4ede('0x1b')]||null:null,'include':_0xe06971[_0x4ede('0x17')]?_0xe06971['options'][_0x4ede('0x1c')]?_[_0x4ede('0x1d')](_0xe06971[_0x4ede('0x17')][_0x4ede('0x1c')],function(_0x53c981){return{'model':db[_0x53c981[_0x4ede('0x1e')]],'as':_0x53c981['as'],'attributes':_0x53c981[_0x4ede('0x1a')],'include':_0x53c981[_0x4ede('0x1c')]?_[_0x4ede('0x1d')](_0x53c981[_0x4ede('0x1c')],function(_0x10ff39){return{'model':db[_0x10ff39[_0x4ede('0x1e')]],'as':_0x10ff39['as'],'attributes':_0x10ff39[_0x4ede('0x1a')],'include':_0x10ff39[_0x4ede('0x1c')]?_['map'](_0x10ff39[_0x4ede('0x1c')],function(_0x599a7d){return{'model':db[_0x599a7d[_0x4ede('0x1e')]],'as':_0x599a7d['as'],'attributes':_0x599a7d['attributes']};}):[]};}):[]};}):[]:[]})[_0x4ede('0x8')](function(_0x18781c){logger['info']('GetFreshdeskAccount',_0xe06971);logger[_0x4ede('0xc')](_0x4ede('0x14'),_0xe06971,JSON[_0x4ede('0xe')](_0x18781c));_0x30e317(_0x18781c);})[_0x4ede('0x13')](function(_0x1ac4b8){logger[_0x4ede('0x10')]('GetFreshdeskAccount',_0x1ac4b8[_0x4ede('0x11')],_0xe06971);_0x3c03e0(_0x1f15ea[_0x4ede('0x10')](0x1f4,_0x1ac4b8[_0x4ede('0x11')]));});});};exports['ShowFreshdeskAccount']=function(_0x20b895){var _0x1e865f=this;return new Promise(function(_0x5e968d,_0x3ae696){return db[_0x4ede('0x15')][_0x4ede('0x1f')]({'raw':_0x20b895['options']?_0x20b895[_0x4ede('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x20b895['options']?_0x20b895[_0x4ede('0x17')][_0x4ede('0x19')]||null:null,'attributes':_0x20b895[_0x4ede('0x17')]?_0x20b895[_0x4ede('0x17')]['attributes']||null:null,'include':_0x20b895[_0x4ede('0x17')]?_0x20b895['options'][_0x4ede('0x1c')]?_[_0x4ede('0x1d')](_0x20b895[_0x4ede('0x17')][_0x4ede('0x1c')],function(_0x369394){return{'model':db[_0x369394[_0x4ede('0x1e')]],'as':_0x369394['as'],'attributes':_0x369394[_0x4ede('0x1a')],'include':_0x369394['include']?_[_0x4ede('0x1d')](_0x369394['include'],function(_0x5e0fa3){return{'model':db[_0x5e0fa3[_0x4ede('0x1e')]],'as':_0x5e0fa3['as'],'attributes':_0x5e0fa3[_0x4ede('0x1a')],'include':_0x5e0fa3[_0x4ede('0x1c')]?_['map'](_0x5e0fa3[_0x4ede('0x1c')],function(_0x35f573){return{'model':db[_0x35f573['model']],'as':_0x35f573['as'],'attributes':_0x35f573[_0x4ede('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x4ede('0x8')](function(_0xe9d3f9){logger[_0x4ede('0x9')](_0x4ede('0x20'),_0x20b895);logger[_0x4ede('0xc')](_0x4ede('0x20'),_0x20b895,JSON[_0x4ede('0xe')](_0xe9d3f9));_0x5e968d(_0xe9d3f9);})[_0x4ede('0x13')](function(_0x45c73e){logger['error']('ShowFreshdeskAccount',_0x45c73e[_0x4ede('0x11')],_0x20b895);_0x3ae696(_0x1e865f[_0x4ede('0x10')](0x1f4,_0x45c73e[_0x4ede('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index dfc5caf..7fa2acb 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 _0xc2c5=['show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/tags','getTags','create','setTags','put','update','delete','destroy','multer','util','path','express','Router','../../components/auth/service','./intFreshdeskConfiguration.controller','get','/:id','isAuthenticated'];(function(_0x1f568f,_0x188a64){var _0x1cac56=function(_0x3a1652){while(--_0x3a1652){_0x1f568f['push'](_0x1f568f['shift']());}};_0x1cac56(++_0x188a64);}(_0xc2c5,0x1d9));var _0x5c2c=function(_0x303d9f,_0x1eeb62){_0x303d9f=_0x303d9f-0x0;var _0x37eccf=_0xc2c5[_0x303d9f];return _0x37eccf;};'use strict';var multer=require(_0x5c2c('0x0'));var util=require(_0x5c2c('0x1'));var path=require(_0x5c2c('0x2'));var timeout=require('connect-timeout');var express=require(_0x5c2c('0x3'));var router=express[_0x5c2c('0x4')]();var auth=require(_0x5c2c('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x5c2c('0x6'));router[_0x5c2c('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5c2c('0x7')](_0x5c2c('0x8'),auth[_0x5c2c('0x9')](),controller[_0x5c2c('0xa')]);router[_0x5c2c('0x7')](_0x5c2c('0xb'),auth['isAuthenticated'](),controller[_0x5c2c('0xc')]);router[_0x5c2c('0x7')](_0x5c2c('0xd'),auth[_0x5c2c('0x9')](),controller[_0x5c2c('0xe')]);router['get']('/:id/descriptions',auth[_0x5c2c('0x9')](),controller['getDescriptions']);router[_0x5c2c('0x7')](_0x5c2c('0xf'),auth[_0x5c2c('0x9')](),controller[_0x5c2c('0x10')]);router['post']('/',auth[_0x5c2c('0x9')](),controller[_0x5c2c('0x11')]);router['post'](_0x5c2c('0xf'),auth[_0x5c2c('0x9')](),controller[_0x5c2c('0x12')]);router[_0x5c2c('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x5c2c('0x14')]);router[_0x5c2c('0x15')](_0x5c2c('0x8'),auth['isAuthenticated'](),controller[_0x5c2c('0x16')]);module['exports']=router; \ No newline at end of file +var _0x51de=['setTags','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','index','/:id','show','isAuthenticated','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','create','post'];(function(_0x44fc3f,_0x4774d1){var _0x926ba3=function(_0x2af2a9){while(--_0x2af2a9){_0x44fc3f['push'](_0x44fc3f['shift']());}};_0x926ba3(++_0x4774d1);}(_0x51de,0x12e));var _0xe51d=function(_0x1500d4,_0x5c1f18){_0x1500d4=_0x1500d4-0x0;var _0x39a961=_0x51de[_0x1500d4];return _0x39a961;};'use strict';var multer=require(_0xe51d('0x0'));var util=require(_0xe51d('0x1'));var path=require(_0xe51d('0x2'));var timeout=require(_0xe51d('0x3'));var express=require(_0xe51d('0x4'));var router=express[_0xe51d('0x5')]();var auth=require(_0xe51d('0x6'));var interaction=require(_0xe51d('0x7'));var config=require(_0xe51d('0x8'));var controller=require(_0xe51d('0x9'));router[_0xe51d('0xa')]('/',auth['isAuthenticated'](),controller[_0xe51d('0xb')]);router[_0xe51d('0xa')](_0xe51d('0xc'),auth['isAuthenticated'](),controller[_0xe51d('0xd')]);router[_0xe51d('0xa')]('/:id/fields',auth[_0xe51d('0xe')](),controller['getFields']);router[_0xe51d('0xa')](_0xe51d('0xf'),auth[_0xe51d('0xe')](),controller[_0xe51d('0x10')]);router[_0xe51d('0xa')](_0xe51d('0x11'),auth['isAuthenticated'](),controller[_0xe51d('0x12')]);router['get'](_0xe51d('0x13'),auth[_0xe51d('0xe')](),controller['getTags']);router['post']('/',auth[_0xe51d('0xe')](),controller[_0xe51d('0x14')]);router[_0xe51d('0x15')](_0xe51d('0x13'),auth[_0xe51d('0xe')](),controller[_0xe51d('0x16')]);router[_0xe51d('0x17')](_0xe51d('0xc'),auth[_0xe51d('0xe')](),controller[_0xe51d('0x18')]);router['delete']('/:id',auth[_0xe51d('0xe')](),controller[_0xe51d('0x19')]);module[_0xe51d('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index db101d1..1063247 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 _0xa3b6=['STRING','sequelize','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa3b6,0x85));var _0x6a3b=function(_0x4eb60d,_0x3391df){_0x4eb60d=_0x4eb60d-0x0;var _0x3e8218=_0xa3b6[_0x4eb60d];return _0x3e8218;};'use strict';var Sequelize=require(_0x6a3b('0x0'));module[_0x6a3b('0x1')]={'name':{'type':Sequelize[_0x6a3b('0x2')]},'description':{'type':Sequelize[_0x6a3b('0x2')]}}; \ No newline at end of file +var _0x5233=['STRING','sequelize','exports'];(function(_0x2295a2,_0x1ad405){var _0x371f46=function(_0x37fbdf){while(--_0x37fbdf){_0x2295a2['push'](_0x2295a2['shift']());}};_0x371f46(++_0x1ad405);}(_0x5233,0x73));var _0x3523=function(_0x5ec94d,_0x2d24ef){_0x5ec94d=_0x5ec94d-0x0;var _0x55a282=_0x5233[_0x5ec94d];return _0x55a282;};'use strict';var Sequelize=require(_0x3523('0x0'));module[_0x3523('0x1')]={'name':{'type':Sequelize[_0x3523('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 44fb19b..b031a49 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 _0x340e=['squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','Sequelize','ValidationError','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','count','offset','set','Content-Range','apply','save','destroy','stack','name','send','index','map','FreshdeskConfiguration','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','show','keys','rawAttributes','find','create','body','update','params','getFields','findOne','FreshdeskField','getSubjects','nolimit','getDescriptions','getTags','Tag','setTags','ids','html-pdf','rimraf','request-promise','moment','mustache','util','path','to-csv','lodash'];(function(_0x218e76,_0x5f0903){var _0x4269bb=function(_0x3881db){while(--_0x3881db){_0x218e76['push'](_0x218e76['shift']());}};_0x4269bb(++_0x5f0903);}(_0x340e,0x1dc));var _0xe340=function(_0x219289,_0x1ba487){_0x219289=_0x219289-0x0;var _0x2d7c18=_0x340e[_0x219289];return _0x2d7c18;};'use strict';var pdf=require(_0xe340('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xe340('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe340('0x2'));var moment=require(_0xe340('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe340('0x4'));var util=require(_0xe340('0x5'));var path=require(_0xe340('0x6'));var sox=require('sox');var csv=require(_0xe340('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xe340('0x8'));var squel=require(_0xe340('0x9'));var crypto=require(_0xe340('0xa'));var jsforce=require(_0xe340('0xb'));var deskjs=require(_0xe340('0xc'));var toCsv=require('to-csv');var querystring=require(_0xe340('0xd'));var Papa=require(_0xe340('0xe'));var Redis=require(_0xe340('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xe340('0x10'));var as=require(_0xe340('0x11'));var hardwareService=require(_0xe340('0x12'));var logger=require(_0xe340('0x13'))('api');var utils=require(_0xe340('0x14'));var config=require(_0xe340('0x15'));var db=require(_0xe340('0x16'))['db'];var jayson=require(_0xe340('0x17'));var client=jayson[_0xe340('0x18')][_0xe340('0x19')]({'port':0x232a});function checkPasswordPattern(_0x326c9b,_0x5cabda,_0x10bfbc){if(_0x10bfbc){var _0x247af2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x247af2[_0xe340('0x1a')](_0x5cabda)){return _0x326c9b;}else{throw new db[(_0xe340('0x1b'))][(_0xe340('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 _0x326c9b;}}function respondWithRpcPromise(_0xd2d22a,_0xd401cd,_0x5f12d0,_0xc2784a){return new BPromise(function(_0x335ab9,_0x3b3eeb){var _0x367a47=_0xc2784a||client;return _0x367a47[_0xe340('0x1d')](_0xd2d22a,_0x5f12d0)[_0xe340('0x1e')](function(_0x1d749b){logger[_0xe340('0x1f')](_0xe340('0x20'),_0xd401cd,_0xe340('0x21'));logger['debug'](_0xe340('0x22'),_0xd401cd,_0xe340('0x21'),JSON[_0xe340('0x23')](_0x1d749b));if(_0x1d749b[_0xe340('0x24')]){if(_0x1d749b[_0xe340('0x24')]['code']===0x1f4){logger[_0xe340('0x24')](_0xe340('0x20'),_0xd401cd,_0x1d749b[_0xe340('0x24')][_0xe340('0x25')]);return _0x3b3eeb(_0x1d749b[_0xe340('0x24')]['message']);}logger[_0xe340('0x24')](_0xe340('0x20'),_0xd401cd,_0x1d749b[_0xe340('0x24')][_0xe340('0x25')]);return _0x335ab9(_0x1d749b[_0xe340('0x24')][_0xe340('0x25')]);}else{logger[_0xe340('0x1f')](_0xe340('0x20'),_0xd401cd,_0xe340('0x21'));_0x335ab9(_0x1d749b[_0xe340('0x26')][_0xe340('0x25')]);}})[_0xe340('0x27')](function(_0x4feb29){logger[_0xe340('0x24')](_0xe340('0x20'),_0xd401cd,_0x4feb29);_0x3b3eeb(_0x4feb29);});});}function respondWithStatusCode(_0x487b36,_0x1e160f){_0x1e160f=_0x1e160f||0xcc;return function(_0x3fe91e){if(_0x3fe91e){return _0x487b36[_0xe340('0x28')](_0x1e160f);}return _0x487b36[_0xe340('0x29')](_0x1e160f)[_0xe340('0x2a')]();};}function respondWithResult(_0x3792db,_0x531bd4){_0x531bd4=_0x531bd4||0xc8;return function(_0x1eedcc){if(_0x1eedcc){return _0x3792db['status'](_0x531bd4)[_0xe340('0x2b')](_0x1eedcc);}};}function respondWithFilteredResult(_0xdc89e5,_0x2e3c82){return function(_0x323324){if(_0x323324){var _0x131584=_0x323324[_0xe340('0x2c')],_0x376446=_0x2e3c82[_0xe340('0x2d')],_0x4ccbf7=_0x2e3c82[_0xe340('0x2d')]+_0x2e3c82['limit'],_0x34342c;if(_0x4ccbf7>=_0x131584){_0x4ccbf7=_0x131584;_0x34342c=0xc8;}else{_0x34342c=0xce;}_0xdc89e5[_0xe340('0x29')](_0x34342c);return _0xdc89e5[_0xe340('0x2e')](_0xe340('0x2f'),_0x376446+'-'+_0x4ccbf7+'/'+_0x131584)[_0xe340('0x2b')](_0x323324);}return null;};}function patchUpdates(_0x358731){return function(_0x5d4d74){try{jsonpatch[_0xe340('0x30')](_0x5d4d74,_0x358731,!![]);}catch(_0x533649){return BPromise['reject'](_0x533649);}return _0x5d4d74[_0xe340('0x31')]();};}function saveUpdates(_0x5b6151,_0x3717fe){return function(_0x2cff00){if(_0x2cff00){return _0x2cff00['update'](_0x5b6151)[_0xe340('0x1e')](function(_0x1e4743){return _0x1e4743;});}return null;};}function removeEntity(_0x3d0502,_0x1219a9){return function(_0x42b323){if(_0x42b323){return _0x42b323[_0xe340('0x32')]()['then'](function(){_0x3d0502[_0xe340('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3814fe,_0x27cd12){return function(_0x30b6bb){if(!_0x30b6bb){_0x3814fe[_0xe340('0x28')](0x194);}return _0x30b6bb;};}function handleError(_0x46f3e1,_0x2efc7c){_0x2efc7c=_0x2efc7c||0x1f4;return function(_0x40e8f2){logger[_0xe340('0x24')](_0x40e8f2[_0xe340('0x33')]);if(_0x40e8f2[_0xe340('0x34')]){delete _0x40e8f2[_0xe340('0x34')];}_0x46f3e1[_0xe340('0x29')](_0x2efc7c)[_0xe340('0x35')](_0x40e8f2);};}exports[_0xe340('0x36')]=function(_0x11a499,_0x367c32){var _0xa287f2={},_0x2d5d59={},_0x5e0242={'count':0x0,'rows':[]};var _0xd02821=_[_0xe340('0x37')](db[_0xe340('0x38')]['rawAttributes'],function(_0xbf7819){return{'name':_0xbf7819[_0xe340('0x39')],'type':_0xbf7819[_0xe340('0x3a')][_0xe340('0x3b')]};});_0x2d5d59[_0xe340('0x3c')]=_['map'](_0xd02821,'name');_0x2d5d59[_0xe340('0x3d')]=_['keys'](_0x11a499['query']);_0x2d5d59[_0xe340('0x3e')]=_['intersection'](_0x2d5d59[_0xe340('0x3c')],_0x2d5d59[_0xe340('0x3d')]);_0xa287f2[_0xe340('0x3f')]=_[_0xe340('0x40')](_0x2d5d59[_0xe340('0x3c')],qs[_0xe340('0x41')](_0x11a499['query'][_0xe340('0x41')]));_0xa287f2['attributes']=_0xa287f2[_0xe340('0x3f')][_0xe340('0x42')]?_0xa287f2[_0xe340('0x3f')]:_0x2d5d59['model'];if(!_0x11a499['query'][_0xe340('0x43')]('nolimit')){_0xa287f2[_0xe340('0x44')]=qs['limit'](_0x11a499[_0xe340('0x3d')]['limit']);_0xa287f2[_0xe340('0x2d')]=qs[_0xe340('0x2d')](_0x11a499[_0xe340('0x3d')]['offset']);}_0xa287f2[_0xe340('0x45')]=qs[_0xe340('0x46')](_0x11a499[_0xe340('0x3d')]['sort']);_0xa287f2[_0xe340('0x47')]=qs[_0xe340('0x3e')](_[_0xe340('0x48')](_0x11a499['query'],_0x2d5d59['filters']));if(_0x11a499[_0xe340('0x3d')][_0xe340('0x49')]){_0xa287f2[_0xe340('0x47')]=_['merge'](_0xa287f2['where'],{'$or':_[_0xe340('0x37')](_0xd02821,function(_0xca6487){if(_0xca6487[_0xe340('0x3a')]!==_0xe340('0x4a')){var _0x5e68fa={};_0x5e68fa[_0xca6487[_0xe340('0x34')]]={'$like':'%'+_0x11a499[_0xe340('0x3d')][_0xe340('0x49')]+'%'};return _0x5e68fa;}})});}_0xa287f2=_[_0xe340('0x4b')]({},_0xa287f2,_0x11a499[_0xe340('0x4c')]);var _0x586156={'where':_0xa287f2[_0xe340('0x47')]};return db[_0xe340('0x38')]['count'](_0x586156)[_0xe340('0x1e')](function(_0x4c3177){_0x5e0242[_0xe340('0x2c')]=_0x4c3177;if(_0x11a499[_0xe340('0x3d')][_0xe340('0x4d')]){_0xa287f2[_0xe340('0x4e')]=[{'all':!![]}];}return db[_0xe340('0x38')]['findAll'](_0xa287f2);})['then'](function(_0x3480e9){_0x5e0242['rows']=_0x3480e9;return _0x5e0242;})[_0xe340('0x1e')](respondWithFilteredResult(_0x367c32,_0xa287f2))['catch'](handleError(_0x367c32,null));};exports[_0xe340('0x4f')]=function(_0x5ca0f8,_0x1b9b92){var _0x4426bc={'raw':![],'where':{'id':_0x5ca0f8['params']['id']}},_0x5b8f5a={};_0x5b8f5a['model']=_[_0xe340('0x50')](db[_0xe340('0x38')][_0xe340('0x51')]);_0x5b8f5a[_0xe340('0x3d')]=_[_0xe340('0x50')](_0x5ca0f8[_0xe340('0x3d')]);_0x5b8f5a['filters']=_[_0xe340('0x40')](_0x5b8f5a[_0xe340('0x3c')],_0x5b8f5a['query']);_0x4426bc['attributes']=_['intersection'](_0x5b8f5a['model'],qs['fields'](_0x5ca0f8[_0xe340('0x3d')][_0xe340('0x41')]));_0x4426bc[_0xe340('0x3f')]=_0x4426bc[_0xe340('0x3f')][_0xe340('0x42')]?_0x4426bc[_0xe340('0x3f')]:_0x5b8f5a[_0xe340('0x3c')];if(_0x5ca0f8[_0xe340('0x3d')][_0xe340('0x4d')]){_0x4426bc['include']=[{'all':!![]}];}_0x4426bc=_[_0xe340('0x4b')]({},_0x4426bc,_0x5ca0f8['options']);return db['FreshdeskConfiguration'][_0xe340('0x52')](_0x4426bc)[_0xe340('0x1e')](handleEntityNotFound(_0x1b9b92,null))[_0xe340('0x1e')](respondWithResult(_0x1b9b92,null))['catch'](handleError(_0x1b9b92,null));};exports[_0xe340('0x53')]=function(_0x15ee9a,_0x4987e0){return db[_0xe340('0x38')][_0xe340('0x53')](_0x15ee9a[_0xe340('0x54')],{})[_0xe340('0x1e')](respondWithResult(_0x4987e0,0xc9))[_0xe340('0x27')](handleError(_0x4987e0,null));};exports[_0xe340('0x55')]=function(_0x24070a,_0x91e7a5){if(_0x24070a['body']['id']){delete _0x24070a[_0xe340('0x54')]['id'];}return db[_0xe340('0x38')]['find']({'where':{'id':_0x24070a[_0xe340('0x56')]['id']}})[_0xe340('0x1e')](handleEntityNotFound(_0x91e7a5,null))[_0xe340('0x1e')](saveUpdates(_0x24070a[_0xe340('0x54')],null))[_0xe340('0x1e')](respondWithResult(_0x91e7a5,null))[_0xe340('0x27')](handleError(_0x91e7a5,null));};exports[_0xe340('0x32')]=function(_0x179d7a,_0x514fe2){return db[_0xe340('0x38')][_0xe340('0x52')]({'where':{'id':_0x179d7a[_0xe340('0x56')]['id']}})[_0xe340('0x1e')](handleEntityNotFound(_0x514fe2,null))[_0xe340('0x1e')](removeEntity(_0x514fe2,null))[_0xe340('0x27')](handleError(_0x514fe2,null));};exports[_0xe340('0x57')]=function(_0x5b9a5e,_0x370779,_0x1d19bf){var _0x158c5f={};var _0x2dfc4a={};var _0x200687;var _0x2fff09;return db[_0xe340('0x38')][_0xe340('0x58')]({'where':{'id':_0x5b9a5e['params']['id']}})[_0xe340('0x1e')](handleEntityNotFound(_0x370779,null))['then'](function(_0x2ab662){if(_0x2ab662){_0x200687=_0x2ab662;_0x2dfc4a['model']=_['keys'](db[_0xe340('0x59')][_0xe340('0x51')]);_0x2dfc4a['query']=_[_0xe340('0x50')](_0x5b9a5e[_0xe340('0x3d')]);_0x2dfc4a['filters']=_[_0xe340('0x40')](_0x2dfc4a['model'],_0x2dfc4a[_0xe340('0x3d')]);_0x158c5f[_0xe340('0x3f')]=_['intersection'](_0x2dfc4a[_0xe340('0x3c')],qs[_0xe340('0x41')](_0x5b9a5e[_0xe340('0x3d')][_0xe340('0x41')]));_0x158c5f[_0xe340('0x3f')]=_0x158c5f[_0xe340('0x3f')]['length']?_0x158c5f['attributes']:_0x2dfc4a['model'];_0x158c5f[_0xe340('0x45')]=qs[_0xe340('0x46')](_0x5b9a5e[_0xe340('0x3d')][_0xe340('0x46')]);_0x158c5f[_0xe340('0x47')]=qs[_0xe340('0x3e')](_[_0xe340('0x48')](_0x5b9a5e[_0xe340('0x3d')],_0x2dfc4a[_0xe340('0x3e')]));if(_0x5b9a5e['query'][_0xe340('0x49')]){_0x158c5f['where']=_['merge'](_0x158c5f[_0xe340('0x47')],{'$or':_[_0xe340('0x37')](_0x158c5f[_0xe340('0x3f')],function(_0x5c99cf){var _0x3ff4e0={};_0x3ff4e0[_0x5c99cf]={'$like':'%'+_0x5b9a5e[_0xe340('0x3d')]['filter']+'%'};return _0x3ff4e0;})});}_0x158c5f=_[_0xe340('0x4b')]({},_0x158c5f,_0x5b9a5e['options']);return _0x200687[_0xe340('0x57')](_0x158c5f);}})['then'](function(_0x460ab2){if(_0x460ab2){_0x2fff09=_0x460ab2[_0xe340('0x42')];if(!_0x5b9a5e[_0xe340('0x3d')][_0xe340('0x43')]('nolimit')){_0x158c5f['limit']=qs[_0xe340('0x44')](_0x5b9a5e['query']['limit']);_0x158c5f[_0xe340('0x2d')]=qs[_0xe340('0x2d')](_0x5b9a5e[_0xe340('0x3d')][_0xe340('0x2d')]);}return _0x200687['getFields'](_0x158c5f);}})[_0xe340('0x1e')](function(_0x1578ea){if(_0x1578ea){return _0x1578ea?{'count':_0x2fff09,'rows':_0x1578ea}:null;}})[_0xe340('0x1e')](respondWithResult(_0x370779,null))[_0xe340('0x27')](handleError(_0x370779,null));};exports[_0xe340('0x5a')]=function(_0x1de7f3,_0x377d4d,_0x28e1a2){var _0x45a9c8={};var _0x35da9d={};var _0xe5f3d0;var _0x5351d4;return db[_0xe340('0x38')]['findOne']({'where':{'id':_0x1de7f3[_0xe340('0x56')]['id']}})['then'](handleEntityNotFound(_0x377d4d,null))['then'](function(_0x6d77a0){if(_0x6d77a0){_0xe5f3d0=_0x6d77a0;_0x35da9d[_0xe340('0x3c')]=_[_0xe340('0x50')](db['FreshdeskField'][_0xe340('0x51')]);_0x35da9d[_0xe340('0x3d')]=_[_0xe340('0x50')](_0x1de7f3[_0xe340('0x3d')]);_0x35da9d['filters']=_[_0xe340('0x40')](_0x35da9d['model'],_0x35da9d[_0xe340('0x3d')]);_0x45a9c8[_0xe340('0x3f')]=_[_0xe340('0x40')](_0x35da9d['model'],qs[_0xe340('0x41')](_0x1de7f3[_0xe340('0x3d')][_0xe340('0x41')]));_0x45a9c8[_0xe340('0x3f')]=_0x45a9c8[_0xe340('0x3f')][_0xe340('0x42')]?_0x45a9c8[_0xe340('0x3f')]:_0x35da9d[_0xe340('0x3c')];_0x45a9c8[_0xe340('0x45')]=qs['sort'](_0x1de7f3['query']['sort']);_0x45a9c8[_0xe340('0x47')]=qs[_0xe340('0x3e')](_[_0xe340('0x48')](_0x1de7f3[_0xe340('0x3d')],_0x35da9d['filters']));if(_0x1de7f3[_0xe340('0x3d')]['filter']){_0x45a9c8[_0xe340('0x47')]=_[_0xe340('0x4b')](_0x45a9c8[_0xe340('0x47')],{'$or':_[_0xe340('0x37')](_0x45a9c8[_0xe340('0x3f')],function(_0x2d9b3c){var _0x538f95={};_0x538f95[_0x2d9b3c]={'$like':'%'+_0x1de7f3[_0xe340('0x3d')][_0xe340('0x49')]+'%'};return _0x538f95;})});}_0x45a9c8=_[_0xe340('0x4b')]({},_0x45a9c8,_0x1de7f3['options']);return _0xe5f3d0[_0xe340('0x5a')](_0x45a9c8);}})[_0xe340('0x1e')](function(_0x378da6){if(_0x378da6){_0x5351d4=_0x378da6['length'];if(!_0x1de7f3[_0xe340('0x3d')][_0xe340('0x43')](_0xe340('0x5b'))){_0x45a9c8[_0xe340('0x44')]=qs[_0xe340('0x44')](_0x1de7f3[_0xe340('0x3d')][_0xe340('0x44')]);_0x45a9c8[_0xe340('0x2d')]=qs[_0xe340('0x2d')](_0x1de7f3[_0xe340('0x3d')][_0xe340('0x2d')]);}return _0xe5f3d0[_0xe340('0x5a')](_0x45a9c8);}})[_0xe340('0x1e')](function(_0x5af084){if(_0x5af084){return _0x5af084?{'count':_0x5351d4,'rows':_0x5af084}:null;}})['then'](respondWithResult(_0x377d4d,null))[_0xe340('0x27')](handleError(_0x377d4d,null));};exports[_0xe340('0x5c')]=function(_0x49c4aa,_0x2e3ff0,_0x35f60b){var _0x2a8631={};var _0x4446b1={};var _0x57fc00;var _0x225e6c;return db[_0xe340('0x38')]['findOne']({'where':{'id':_0x49c4aa[_0xe340('0x56')]['id']}})[_0xe340('0x1e')](handleEntityNotFound(_0x2e3ff0,null))[_0xe340('0x1e')](function(_0x479295){if(_0x479295){_0x57fc00=_0x479295;_0x4446b1[_0xe340('0x3c')]=_['keys'](db['FreshdeskField'][_0xe340('0x51')]);_0x4446b1[_0xe340('0x3d')]=_['keys'](_0x49c4aa['query']);_0x4446b1[_0xe340('0x3e')]=_[_0xe340('0x40')](_0x4446b1[_0xe340('0x3c')],_0x4446b1[_0xe340('0x3d')]);_0x2a8631[_0xe340('0x3f')]=_['intersection'](_0x4446b1['model'],qs[_0xe340('0x41')](_0x49c4aa[_0xe340('0x3d')][_0xe340('0x41')]));_0x2a8631['attributes']=_0x2a8631[_0xe340('0x3f')][_0xe340('0x42')]?_0x2a8631['attributes']:_0x4446b1[_0xe340('0x3c')];_0x2a8631[_0xe340('0x45')]=qs[_0xe340('0x46')](_0x49c4aa[_0xe340('0x3d')][_0xe340('0x46')]);_0x2a8631[_0xe340('0x47')]=qs[_0xe340('0x3e')](_[_0xe340('0x48')](_0x49c4aa[_0xe340('0x3d')],_0x4446b1[_0xe340('0x3e')]));if(_0x49c4aa[_0xe340('0x3d')]['filter']){_0x2a8631[_0xe340('0x47')]=_[_0xe340('0x4b')](_0x2a8631[_0xe340('0x47')],{'$or':_[_0xe340('0x37')](_0x2a8631[_0xe340('0x3f')],function(_0x3bf552){var _0x3fc763={};_0x3fc763[_0x3bf552]={'$like':'%'+_0x49c4aa[_0xe340('0x3d')][_0xe340('0x49')]+'%'};return _0x3fc763;})});}_0x2a8631=_[_0xe340('0x4b')]({},_0x2a8631,_0x49c4aa['options']);return _0x57fc00[_0xe340('0x5c')](_0x2a8631);}})[_0xe340('0x1e')](function(_0x5a91ff){if(_0x5a91ff){_0x225e6c=_0x5a91ff['length'];if(!_0x49c4aa[_0xe340('0x3d')][_0xe340('0x43')](_0xe340('0x5b'))){_0x2a8631[_0xe340('0x44')]=qs[_0xe340('0x44')](_0x49c4aa[_0xe340('0x3d')]['limit']);_0x2a8631[_0xe340('0x2d')]=qs['offset'](_0x49c4aa[_0xe340('0x3d')][_0xe340('0x2d')]);}return _0x57fc00[_0xe340('0x5c')](_0x2a8631);}})[_0xe340('0x1e')](function(_0x575aeb){if(_0x575aeb){return _0x575aeb?{'count':_0x225e6c,'rows':_0x575aeb}:null;}})[_0xe340('0x1e')](respondWithResult(_0x2e3ff0,null))[_0xe340('0x27')](handleError(_0x2e3ff0,null));};exports[_0xe340('0x5d')]=function(_0x30f642,_0x3e8d51,_0x542384){var _0x521bf0={};var _0x48e39e={};var _0x9a41af;var _0x3c9b15;return db[_0xe340('0x38')][_0xe340('0x58')]({'where':{'id':_0x30f642[_0xe340('0x56')]['id']}})[_0xe340('0x1e')](handleEntityNotFound(_0x3e8d51,null))[_0xe340('0x1e')](function(_0x458edd){if(_0x458edd){_0x9a41af=_0x458edd;_0x48e39e['model']=_[_0xe340('0x50')](db[_0xe340('0x5e')]['rawAttributes']);_0x48e39e['query']=_[_0xe340('0x50')](_0x30f642[_0xe340('0x3d')]);_0x48e39e[_0xe340('0x3e')]=_[_0xe340('0x40')](_0x48e39e[_0xe340('0x3c')],_0x48e39e[_0xe340('0x3d')]);_0x521bf0['attributes']=_['intersection'](_0x48e39e['model'],qs[_0xe340('0x41')](_0x30f642[_0xe340('0x3d')][_0xe340('0x41')]));_0x521bf0[_0xe340('0x3f')]=_0x521bf0[_0xe340('0x3f')]['length']?_0x521bf0[_0xe340('0x3f')]:_0x48e39e[_0xe340('0x3c')];_0x521bf0['order']=qs['sort'](_0x30f642[_0xe340('0x3d')][_0xe340('0x46')]);_0x521bf0[_0xe340('0x47')]=qs[_0xe340('0x3e')](_[_0xe340('0x48')](_0x30f642[_0xe340('0x3d')],_0x48e39e[_0xe340('0x3e')]));if(_0x30f642['query']['filter']){_0x521bf0['where']=_[_0xe340('0x4b')](_0x521bf0[_0xe340('0x47')],{'$or':_['map'](_0x521bf0[_0xe340('0x3f')],function(_0x42ab79){var _0x3c0b24={};_0x3c0b24[_0x42ab79]={'$like':'%'+_0x30f642['query']['filter']+'%'};return _0x3c0b24;})});}_0x521bf0=_[_0xe340('0x4b')]({},_0x521bf0,_0x30f642[_0xe340('0x4c')]);return _0x9a41af['getTags'](_0x521bf0);}})[_0xe340('0x1e')](function(_0x3e6ea3){if(_0x3e6ea3){_0x3c9b15=_0x3e6ea3['length'];if(!_0x30f642[_0xe340('0x3d')][_0xe340('0x43')]('nolimit')){_0x521bf0[_0xe340('0x44')]=qs['limit'](_0x30f642['query'][_0xe340('0x44')]);_0x521bf0[_0xe340('0x2d')]=qs['offset'](_0x30f642[_0xe340('0x3d')][_0xe340('0x2d')]);}return _0x9a41af[_0xe340('0x5d')](_0x521bf0);}})['then'](function(_0x2a6675){if(_0x2a6675){return _0x2a6675?{'count':_0x3c9b15,'rows':_0x2a6675}:null;}})[_0xe340('0x1e')](respondWithResult(_0x3e8d51,null))[_0xe340('0x27')](handleError(_0x3e8d51,null));};exports[_0xe340('0x5f')]=function(_0x9a3651,_0x5019f9,_0x291d81){if(_0x9a3651[_0xe340('0x54')]['id']){delete _0x9a3651[_0xe340('0x54')]['id'];}return db[_0xe340('0x38')][_0xe340('0x58')]({'where':{'id':_0x9a3651[_0xe340('0x56')]['id']}})[_0xe340('0x1e')](handleEntityNotFound(_0x5019f9,null))['then'](function(_0x227718){if(_0x227718){return _0x227718[_0xe340('0x5f')](_0x9a3651[_0xe340('0x54')][_0xe340('0x60')]||[]);}return null;})[_0xe340('0x1e')](respondWithResult(_0x5019f9,null))[_0xe340('0x27')](handleError(_0x5019f9,null));}; \ No newline at end of file +var _0xc526=['FreshdeskField','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','FreshdeskConfiguration,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','status','json','count','offset','limit','set','Content-Range','apply','save','destroy','end','sendStatus','stack','name','index','map','FreshdeskConfiguration','fieldName','type','key','query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','intersection','create','body','update','find','getFields','findOne'];(function(_0x5597bd,_0x1cb9d1){var _0x3c9335=function(_0x22a44e){while(--_0x22a44e){_0x5597bd['push'](_0x5597bd['shift']());}};_0x3c9335(++_0x1cb9d1);}(_0xc526,0x124));var _0x6c52=function(_0x3e8a79,_0x300a6d){_0x3e8a79=_0x3e8a79-0x0;var _0x3e893f=_0xc526[_0x3e8a79];return _0x3e893f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6c52('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6c52('0x1'));var jsonpatch=require(_0x6c52('0x2'));var rp=require(_0x6c52('0x3'));var moment=require('moment');var BPromise=require(_0x6c52('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x6c52('0x5'));var csv=require(_0x6c52('0x6'));var ejs=require(_0x6c52('0x7'));var fs=require('fs');var _=require(_0x6c52('0x8'));var squel=require(_0x6c52('0x9'));var crypto=require(_0x6c52('0xa'));var jsforce=require(_0x6c52('0xb'));var deskjs=require(_0x6c52('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6c52('0xd'));var Redis=require(_0x6c52('0xe'));var authService=require(_0x6c52('0xf'));var qs=require(_0x6c52('0x10'));var as=require(_0x6c52('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6c52('0x12'))(_0x6c52('0x13'));var utils=require(_0x6c52('0x14'));var config=require('../../config/environment');var db=require(_0x6c52('0x15'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x6c52('0x16')][_0x6c52('0x17')]({'port':0x232a});function checkPasswordPattern(_0x334f28,_0x1154ff,_0xf04ac){if(_0xf04ac){var _0x25a734=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x25a734[_0x6c52('0x18')](_0x1154ff)){return _0x334f28;}else{throw new db[(_0x6c52('0x19'))][(_0x6c52('0x1a'))](_0x6c52('0x1b'));}}else{return _0x334f28;}}function respondWithRpcPromise(_0x34b9e9,_0x30c946,_0x2f4d80,_0x299f2e){return new BPromise(function(_0x5c6f4f,_0x48f2bd){var _0x2d0c64=_0x299f2e||client;return _0x2d0c64['request'](_0x34b9e9,_0x2f4d80)[_0x6c52('0x1c')](function(_0x24ada3){logger[_0x6c52('0x1d')](_0x6c52('0x1e'),_0x30c946,'request\x20sent');logger['debug']('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x30c946,'request\x20sent',JSON[_0x6c52('0x1f')](_0x24ada3));if(_0x24ada3[_0x6c52('0x20')]){if(_0x24ada3[_0x6c52('0x20')]['code']===0x1f4){logger[_0x6c52('0x20')](_0x6c52('0x1e'),_0x30c946,_0x24ada3[_0x6c52('0x20')][_0x6c52('0x21')]);return _0x48f2bd(_0x24ada3['error'][_0x6c52('0x21')]);}logger[_0x6c52('0x20')](_0x6c52('0x1e'),_0x30c946,_0x24ada3[_0x6c52('0x20')][_0x6c52('0x21')]);return _0x5c6f4f(_0x24ada3['error'][_0x6c52('0x21')]);}else{logger[_0x6c52('0x1d')](_0x6c52('0x1e'),_0x30c946,_0x6c52('0x22'));_0x5c6f4f(_0x24ada3[_0x6c52('0x23')][_0x6c52('0x21')]);}})['catch'](function(_0x26052b){logger['error'](_0x6c52('0x1e'),_0x30c946,_0x26052b);_0x48f2bd(_0x26052b);});});}function respondWithStatusCode(_0x2c3273,_0x5f5904){_0x5f5904=_0x5f5904||0xcc;return function(_0x58cbba){if(_0x58cbba){return _0x2c3273['sendStatus'](_0x5f5904);}return _0x2c3273['status'](_0x5f5904)['end']();};}function respondWithResult(_0x8a3495,_0x17f654){_0x17f654=_0x17f654||0xc8;return function(_0xc26c92){if(_0xc26c92){return _0x8a3495[_0x6c52('0x24')](_0x17f654)[_0x6c52('0x25')](_0xc26c92);}};}function respondWithFilteredResult(_0x8d7f2a,_0x2fe5a3){return function(_0x307d51){if(_0x307d51){var _0x17460f=_0x307d51[_0x6c52('0x26')],_0xc4bf2=_0x2fe5a3[_0x6c52('0x27')],_0x49fd68=_0x2fe5a3[_0x6c52('0x27')]+_0x2fe5a3[_0x6c52('0x28')],_0x4c7edb;if(_0x49fd68>=_0x17460f){_0x49fd68=_0x17460f;_0x4c7edb=0xc8;}else{_0x4c7edb=0xce;}_0x8d7f2a[_0x6c52('0x24')](_0x4c7edb);return _0x8d7f2a[_0x6c52('0x29')](_0x6c52('0x2a'),_0xc4bf2+'-'+_0x49fd68+'/'+_0x17460f)[_0x6c52('0x25')](_0x307d51);}return null;};}function patchUpdates(_0x432c32){return function(_0x25d90c){try{jsonpatch[_0x6c52('0x2b')](_0x25d90c,_0x432c32,!![]);}catch(_0x39b69e){return BPromise['reject'](_0x39b69e);}return _0x25d90c[_0x6c52('0x2c')]();};}function saveUpdates(_0x3dc3fe,_0x1bef95){return function(_0x516928){if(_0x516928){return _0x516928['update'](_0x3dc3fe)[_0x6c52('0x1c')](function(_0xb8eb67){return _0xb8eb67;});}return null;};}function removeEntity(_0x2efd8c,_0x418a12){return function(_0x9132ac){if(_0x9132ac){return _0x9132ac[_0x6c52('0x2d')]()['then'](function(){_0x2efd8c[_0x6c52('0x24')](0xcc)[_0x6c52('0x2e')]();});}};}function handleEntityNotFound(_0x158d19,_0x42020c){return function(_0x3dcb17){if(!_0x3dcb17){_0x158d19[_0x6c52('0x2f')](0x194);}return _0x3dcb17;};}function handleError(_0x4e9bd7,_0x564e6f){_0x564e6f=_0x564e6f||0x1f4;return function(_0x273960){logger[_0x6c52('0x20')](_0x273960[_0x6c52('0x30')]);if(_0x273960[_0x6c52('0x31')]){delete _0x273960[_0x6c52('0x31')];}_0x4e9bd7[_0x6c52('0x24')](_0x564e6f)['send'](_0x273960);};}exports[_0x6c52('0x32')]=function(_0x4f2ef1,_0x5c5885){var _0x4b3766={},_0x1de2cc={},_0x202eef={'count':0x0,'rows':[]};var _0x4738ed=_[_0x6c52('0x33')](db[_0x6c52('0x34')]['rawAttributes'],function(_0xbec9de){return{'name':_0xbec9de[_0x6c52('0x35')],'type':_0xbec9de[_0x6c52('0x36')][_0x6c52('0x37')]};});_0x1de2cc['model']=_[_0x6c52('0x33')](_0x4738ed,'name');_0x1de2cc[_0x6c52('0x38')]=_[_0x6c52('0x39')](_0x4f2ef1['query']);_0x1de2cc[_0x6c52('0x3a')]=_['intersection'](_0x1de2cc[_0x6c52('0x3b')],_0x1de2cc[_0x6c52('0x38')]);_0x4b3766[_0x6c52('0x3c')]=_['intersection'](_0x1de2cc[_0x6c52('0x3b')],qs[_0x6c52('0x3d')](_0x4f2ef1[_0x6c52('0x38')]['fields']));_0x4b3766[_0x6c52('0x3c')]=_0x4b3766['attributes'][_0x6c52('0x3e')]?_0x4b3766[_0x6c52('0x3c')]:_0x1de2cc[_0x6c52('0x3b')];if(!_0x4f2ef1[_0x6c52('0x38')][_0x6c52('0x3f')](_0x6c52('0x40'))){_0x4b3766[_0x6c52('0x28')]=qs['limit'](_0x4f2ef1[_0x6c52('0x38')]['limit']);_0x4b3766['offset']=qs[_0x6c52('0x27')](_0x4f2ef1[_0x6c52('0x38')][_0x6c52('0x27')]);}_0x4b3766[_0x6c52('0x41')]=qs['sort'](_0x4f2ef1['query'][_0x6c52('0x42')]);_0x4b3766[_0x6c52('0x43')]=qs['filters'](_[_0x6c52('0x44')](_0x4f2ef1['query'],_0x1de2cc[_0x6c52('0x3a')]));if(_0x4f2ef1[_0x6c52('0x38')][_0x6c52('0x45')]){_0x4b3766[_0x6c52('0x43')]=_[_0x6c52('0x46')](_0x4b3766['where'],{'$or':_[_0x6c52('0x33')](_0x4738ed,function(_0xdcca78){if(_0xdcca78[_0x6c52('0x36')]!==_0x6c52('0x47')){var _0x4a290c={};_0x4a290c[_0xdcca78[_0x6c52('0x31')]]={'$like':'%'+_0x4f2ef1[_0x6c52('0x38')][_0x6c52('0x45')]+'%'};return _0x4a290c;}})});}_0x4b3766=_[_0x6c52('0x46')]({},_0x4b3766,_0x4f2ef1[_0x6c52('0x48')]);var _0x42f19d={'where':_0x4b3766[_0x6c52('0x43')]};return db[_0x6c52('0x34')][_0x6c52('0x26')](_0x42f19d)[_0x6c52('0x1c')](function(_0x5a97c1){_0x202eef[_0x6c52('0x26')]=_0x5a97c1;if(_0x4f2ef1['query'][_0x6c52('0x49')]){_0x4b3766[_0x6c52('0x4a')]=[{'all':!![]}];}return db[_0x6c52('0x34')][_0x6c52('0x4b')](_0x4b3766);})[_0x6c52('0x1c')](function(_0x4351e5){_0x202eef[_0x6c52('0x4c')]=_0x4351e5;return _0x202eef;})[_0x6c52('0x1c')](respondWithFilteredResult(_0x5c5885,_0x4b3766))[_0x6c52('0x4d')](handleError(_0x5c5885,null));};exports[_0x6c52('0x4e')]=function(_0x44701b,_0x86a134){var _0x189668={'raw':![],'where':{'id':_0x44701b[_0x6c52('0x4f')]['id']}},_0x4ebfe8={};_0x4ebfe8['model']=_[_0x6c52('0x39')](db[_0x6c52('0x34')][_0x6c52('0x50')]);_0x4ebfe8[_0x6c52('0x38')]=_[_0x6c52('0x39')](_0x44701b[_0x6c52('0x38')]);_0x4ebfe8['filters']=_[_0x6c52('0x51')](_0x4ebfe8[_0x6c52('0x3b')],_0x4ebfe8[_0x6c52('0x38')]);_0x189668[_0x6c52('0x3c')]=_['intersection'](_0x4ebfe8[_0x6c52('0x3b')],qs[_0x6c52('0x3d')](_0x44701b[_0x6c52('0x38')]['fields']));_0x189668[_0x6c52('0x3c')]=_0x189668[_0x6c52('0x3c')][_0x6c52('0x3e')]?_0x189668['attributes']:_0x4ebfe8['model'];if(_0x44701b['query'][_0x6c52('0x49')]){_0x189668[_0x6c52('0x4a')]=[{'all':!![]}];}_0x189668=_['merge']({},_0x189668,_0x44701b[_0x6c52('0x48')]);return db[_0x6c52('0x34')]['find'](_0x189668)[_0x6c52('0x1c')](handleEntityNotFound(_0x86a134,null))[_0x6c52('0x1c')](respondWithResult(_0x86a134,null))[_0x6c52('0x4d')](handleError(_0x86a134,null));};exports[_0x6c52('0x52')]=function(_0x269e4e,_0x20a1ad){return db['FreshdeskConfiguration'][_0x6c52('0x52')](_0x269e4e[_0x6c52('0x53')],{})['then'](respondWithResult(_0x20a1ad,0xc9))[_0x6c52('0x4d')](handleError(_0x20a1ad,null));};exports[_0x6c52('0x54')]=function(_0x55a4ed,_0x16e2fe){if(_0x55a4ed[_0x6c52('0x53')]['id']){delete _0x55a4ed[_0x6c52('0x53')]['id'];}return db[_0x6c52('0x34')]['find']({'where':{'id':_0x55a4ed[_0x6c52('0x4f')]['id']}})['then'](handleEntityNotFound(_0x16e2fe,null))[_0x6c52('0x1c')](saveUpdates(_0x55a4ed[_0x6c52('0x53')],null))[_0x6c52('0x1c')](respondWithResult(_0x16e2fe,null))[_0x6c52('0x4d')](handleError(_0x16e2fe,null));};exports[_0x6c52('0x2d')]=function(_0x334d21,_0x17e9f8){return db[_0x6c52('0x34')][_0x6c52('0x55')]({'where':{'id':_0x334d21[_0x6c52('0x4f')]['id']}})['then'](handleEntityNotFound(_0x17e9f8,null))['then'](removeEntity(_0x17e9f8,null))[_0x6c52('0x4d')](handleError(_0x17e9f8,null));};exports[_0x6c52('0x56')]=function(_0x5cd771,_0x253b53,_0x2dd5d2){var _0x288bd0={};var _0x461500={};var _0x60a216;var _0x39980f;return db[_0x6c52('0x34')][_0x6c52('0x57')]({'where':{'id':_0x5cd771[_0x6c52('0x4f')]['id']}})[_0x6c52('0x1c')](handleEntityNotFound(_0x253b53,null))['then'](function(_0x2e8297){if(_0x2e8297){_0x60a216=_0x2e8297;_0x461500[_0x6c52('0x3b')]=_[_0x6c52('0x39')](db[_0x6c52('0x58')][_0x6c52('0x50')]);_0x461500['query']=_[_0x6c52('0x39')](_0x5cd771[_0x6c52('0x38')]);_0x461500[_0x6c52('0x3a')]=_['intersection'](_0x461500['model'],_0x461500['query']);_0x288bd0[_0x6c52('0x3c')]=_[_0x6c52('0x51')](_0x461500[_0x6c52('0x3b')],qs['fields'](_0x5cd771[_0x6c52('0x38')][_0x6c52('0x3d')]));_0x288bd0[_0x6c52('0x3c')]=_0x288bd0['attributes'][_0x6c52('0x3e')]?_0x288bd0[_0x6c52('0x3c')]:_0x461500['model'];_0x288bd0[_0x6c52('0x41')]=qs['sort'](_0x5cd771['query'][_0x6c52('0x42')]);_0x288bd0['where']=qs[_0x6c52('0x3a')](_['pick'](_0x5cd771['query'],_0x461500[_0x6c52('0x3a')]));if(_0x5cd771[_0x6c52('0x38')][_0x6c52('0x45')]){_0x288bd0[_0x6c52('0x43')]=_[_0x6c52('0x46')](_0x288bd0[_0x6c52('0x43')],{'$or':_[_0x6c52('0x33')](_0x288bd0[_0x6c52('0x3c')],function(_0x2843d0){var _0x3998ea={};_0x3998ea[_0x2843d0]={'$like':'%'+_0x5cd771[_0x6c52('0x38')][_0x6c52('0x45')]+'%'};return _0x3998ea;})});}_0x288bd0=_[_0x6c52('0x46')]({},_0x288bd0,_0x5cd771[_0x6c52('0x48')]);return _0x60a216['getFields'](_0x288bd0);}})['then'](function(_0x4000f4){if(_0x4000f4){_0x39980f=_0x4000f4['length'];if(!_0x5cd771[_0x6c52('0x38')][_0x6c52('0x3f')](_0x6c52('0x40'))){_0x288bd0[_0x6c52('0x28')]=qs[_0x6c52('0x28')](_0x5cd771[_0x6c52('0x38')]['limit']);_0x288bd0[_0x6c52('0x27')]=qs[_0x6c52('0x27')](_0x5cd771[_0x6c52('0x38')]['offset']);}return _0x60a216[_0x6c52('0x56')](_0x288bd0);}})['then'](function(_0xd96c05){if(_0xd96c05){return _0xd96c05?{'count':_0x39980f,'rows':_0xd96c05}:null;}})[_0x6c52('0x1c')](respondWithResult(_0x253b53,null))[_0x6c52('0x4d')](handleError(_0x253b53,null));};exports[_0x6c52('0x59')]=function(_0x3b1528,_0x3266a6,_0x342308){var _0x45659b={};var _0x40ca2f={};var _0x185efc;var _0x3cfeab;return db[_0x6c52('0x34')][_0x6c52('0x57')]({'where':{'id':_0x3b1528['params']['id']}})[_0x6c52('0x1c')](handleEntityNotFound(_0x3266a6,null))[_0x6c52('0x1c')](function(_0x35c686){if(_0x35c686){_0x185efc=_0x35c686;_0x40ca2f[_0x6c52('0x3b')]=_[_0x6c52('0x39')](db['FreshdeskField'][_0x6c52('0x50')]);_0x40ca2f[_0x6c52('0x38')]=_[_0x6c52('0x39')](_0x3b1528[_0x6c52('0x38')]);_0x40ca2f[_0x6c52('0x3a')]=_[_0x6c52('0x51')](_0x40ca2f['model'],_0x40ca2f[_0x6c52('0x38')]);_0x45659b[_0x6c52('0x3c')]=_['intersection'](_0x40ca2f['model'],qs[_0x6c52('0x3d')](_0x3b1528[_0x6c52('0x38')]['fields']));_0x45659b[_0x6c52('0x3c')]=_0x45659b[_0x6c52('0x3c')]['length']?_0x45659b[_0x6c52('0x3c')]:_0x40ca2f[_0x6c52('0x3b')];_0x45659b['order']=qs[_0x6c52('0x42')](_0x3b1528[_0x6c52('0x38')]['sort']);_0x45659b[_0x6c52('0x43')]=qs[_0x6c52('0x3a')](_[_0x6c52('0x44')](_0x3b1528['query'],_0x40ca2f[_0x6c52('0x3a')]));if(_0x3b1528[_0x6c52('0x38')]['filter']){_0x45659b[_0x6c52('0x43')]=_[_0x6c52('0x46')](_0x45659b[_0x6c52('0x43')],{'$or':_[_0x6c52('0x33')](_0x45659b[_0x6c52('0x3c')],function(_0x5f4816){var _0x1f3026={};_0x1f3026[_0x5f4816]={'$like':'%'+_0x3b1528['query'][_0x6c52('0x45')]+'%'};return _0x1f3026;})});}_0x45659b=_[_0x6c52('0x46')]({},_0x45659b,_0x3b1528[_0x6c52('0x48')]);return _0x185efc[_0x6c52('0x59')](_0x45659b);}})[_0x6c52('0x1c')](function(_0x59a043){if(_0x59a043){_0x3cfeab=_0x59a043[_0x6c52('0x3e')];if(!_0x3b1528[_0x6c52('0x38')][_0x6c52('0x3f')](_0x6c52('0x40'))){_0x45659b[_0x6c52('0x28')]=qs[_0x6c52('0x28')](_0x3b1528[_0x6c52('0x38')]['limit']);_0x45659b[_0x6c52('0x27')]=qs[_0x6c52('0x27')](_0x3b1528[_0x6c52('0x38')][_0x6c52('0x27')]);}return _0x185efc[_0x6c52('0x59')](_0x45659b);}})['then'](function(_0x5f0b19){if(_0x5f0b19){return _0x5f0b19?{'count':_0x3cfeab,'rows':_0x5f0b19}:null;}})[_0x6c52('0x1c')](respondWithResult(_0x3266a6,null))[_0x6c52('0x4d')](handleError(_0x3266a6,null));};exports[_0x6c52('0x5a')]=function(_0xafe161,_0x5d5b1c,_0x22fa87){var _0xf65dd4={};var _0x578dd5={};var _0x4fa878;var _0x4d2f24;return db[_0x6c52('0x34')][_0x6c52('0x57')]({'where':{'id':_0xafe161[_0x6c52('0x4f')]['id']}})['then'](handleEntityNotFound(_0x5d5b1c,null))['then'](function(_0xecd050){if(_0xecd050){_0x4fa878=_0xecd050;_0x578dd5[_0x6c52('0x3b')]=_['keys'](db['FreshdeskField'][_0x6c52('0x50')]);_0x578dd5[_0x6c52('0x38')]=_[_0x6c52('0x39')](_0xafe161['query']);_0x578dd5[_0x6c52('0x3a')]=_['intersection'](_0x578dd5[_0x6c52('0x3b')],_0x578dd5['query']);_0xf65dd4[_0x6c52('0x3c')]=_[_0x6c52('0x51')](_0x578dd5[_0x6c52('0x3b')],qs[_0x6c52('0x3d')](_0xafe161[_0x6c52('0x38')]['fields']));_0xf65dd4[_0x6c52('0x3c')]=_0xf65dd4[_0x6c52('0x3c')]['length']?_0xf65dd4[_0x6c52('0x3c')]:_0x578dd5[_0x6c52('0x3b')];_0xf65dd4[_0x6c52('0x41')]=qs[_0x6c52('0x42')](_0xafe161[_0x6c52('0x38')][_0x6c52('0x42')]);_0xf65dd4[_0x6c52('0x43')]=qs[_0x6c52('0x3a')](_[_0x6c52('0x44')](_0xafe161['query'],_0x578dd5[_0x6c52('0x3a')]));if(_0xafe161[_0x6c52('0x38')][_0x6c52('0x45')]){_0xf65dd4[_0x6c52('0x43')]=_['merge'](_0xf65dd4[_0x6c52('0x43')],{'$or':_[_0x6c52('0x33')](_0xf65dd4['attributes'],function(_0x4d499c){var _0x5afe45={};_0x5afe45[_0x4d499c]={'$like':'%'+_0xafe161[_0x6c52('0x38')][_0x6c52('0x45')]+'%'};return _0x5afe45;})});}_0xf65dd4=_[_0x6c52('0x46')]({},_0xf65dd4,_0xafe161['options']);return _0x4fa878[_0x6c52('0x5a')](_0xf65dd4);}})[_0x6c52('0x1c')](function(_0x7c555){if(_0x7c555){_0x4d2f24=_0x7c555[_0x6c52('0x3e')];if(!_0xafe161[_0x6c52('0x38')][_0x6c52('0x3f')](_0x6c52('0x40'))){_0xf65dd4[_0x6c52('0x28')]=qs['limit'](_0xafe161[_0x6c52('0x38')][_0x6c52('0x28')]);_0xf65dd4[_0x6c52('0x27')]=qs[_0x6c52('0x27')](_0xafe161[_0x6c52('0x38')]['offset']);}return _0x4fa878['getDescriptions'](_0xf65dd4);}})[_0x6c52('0x1c')](function(_0x220077){if(_0x220077){return _0x220077?{'count':_0x4d2f24,'rows':_0x220077}:null;}})['then'](respondWithResult(_0x5d5b1c,null))[_0x6c52('0x4d')](handleError(_0x5d5b1c,null));};exports[_0x6c52('0x5b')]=function(_0x13bc1d,_0x22289a,_0x55e1da){var _0x2b4d8d={};var _0x344639={};var _0x4a20dd;var _0x50564;return db[_0x6c52('0x34')][_0x6c52('0x57')]({'where':{'id':_0x13bc1d[_0x6c52('0x4f')]['id']}})['then'](handleEntityNotFound(_0x22289a,null))[_0x6c52('0x1c')](function(_0x5493d6){if(_0x5493d6){_0x4a20dd=_0x5493d6;_0x344639[_0x6c52('0x3b')]=_[_0x6c52('0x39')](db[_0x6c52('0x5c')][_0x6c52('0x50')]);_0x344639[_0x6c52('0x38')]=_[_0x6c52('0x39')](_0x13bc1d['query']);_0x344639['filters']=_['intersection'](_0x344639[_0x6c52('0x3b')],_0x344639[_0x6c52('0x38')]);_0x2b4d8d['attributes']=_[_0x6c52('0x51')](_0x344639[_0x6c52('0x3b')],qs[_0x6c52('0x3d')](_0x13bc1d[_0x6c52('0x38')][_0x6c52('0x3d')]));_0x2b4d8d['attributes']=_0x2b4d8d['attributes'][_0x6c52('0x3e')]?_0x2b4d8d['attributes']:_0x344639[_0x6c52('0x3b')];_0x2b4d8d[_0x6c52('0x41')]=qs[_0x6c52('0x42')](_0x13bc1d[_0x6c52('0x38')][_0x6c52('0x42')]);_0x2b4d8d[_0x6c52('0x43')]=qs[_0x6c52('0x3a')](_[_0x6c52('0x44')](_0x13bc1d[_0x6c52('0x38')],_0x344639[_0x6c52('0x3a')]));if(_0x13bc1d[_0x6c52('0x38')][_0x6c52('0x45')]){_0x2b4d8d[_0x6c52('0x43')]=_[_0x6c52('0x46')](_0x2b4d8d[_0x6c52('0x43')],{'$or':_[_0x6c52('0x33')](_0x2b4d8d[_0x6c52('0x3c')],function(_0x3c279b){var _0x3caf7b={};_0x3caf7b[_0x3c279b]={'$like':'%'+_0x13bc1d['query'][_0x6c52('0x45')]+'%'};return _0x3caf7b;})});}_0x2b4d8d=_['merge']({},_0x2b4d8d,_0x13bc1d[_0x6c52('0x48')]);return _0x4a20dd[_0x6c52('0x5b')](_0x2b4d8d);}})[_0x6c52('0x1c')](function(_0x506300){if(_0x506300){_0x50564=_0x506300['length'];if(!_0x13bc1d[_0x6c52('0x38')][_0x6c52('0x3f')](_0x6c52('0x40'))){_0x2b4d8d[_0x6c52('0x28')]=qs[_0x6c52('0x28')](_0x13bc1d[_0x6c52('0x38')][_0x6c52('0x28')]);_0x2b4d8d[_0x6c52('0x27')]=qs[_0x6c52('0x27')](_0x13bc1d[_0x6c52('0x38')][_0x6c52('0x27')]);}return _0x4a20dd[_0x6c52('0x5b')](_0x2b4d8d);}})[_0x6c52('0x1c')](function(_0x29748d){if(_0x29748d){return _0x29748d?{'count':_0x50564,'rows':_0x29748d}:null;}})[_0x6c52('0x1c')](respondWithResult(_0x22289a,null))[_0x6c52('0x4d')](handleError(_0x22289a,null));};exports[_0x6c52('0x5d')]=function(_0xc47de8,_0x350cb7,_0x38c490){if(_0xc47de8[_0x6c52('0x53')]['id']){delete _0xc47de8[_0x6c52('0x53')]['id'];}return db['FreshdeskConfiguration'][_0x6c52('0x57')]({'where':{'id':_0xc47de8[_0x6c52('0x4f')]['id']}})[_0x6c52('0x1c')](handleEntityNotFound(_0x350cb7,null))[_0x6c52('0x1c')](function(_0x1652a0){if(_0x1652a0){return _0x1652a0['setTags'](_0xc47de8['body'][_0x6c52('0x5e')]||[]);}return null;})[_0x6c52('0x1c')](respondWithResult(_0x350cb7,null))[_0x6c52('0x4d')](handleError(_0x350cb7,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 815f2cd..1a0c102 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 _0x4cff=['int_freshdesk_configurations','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4cff,0x191));var _0xf4cf=function(_0x1eee16,_0xe0b93b){_0x1eee16=_0x1eee16-0x0;var _0x433c9c=_0x4cff[_0x1eee16];return _0x433c9c;};'use strict';var _=require(_0xf4cf('0x0'));var util=require(_0xf4cf('0x1'));var logger=require(_0xf4cf('0x2'))(_0xf4cf('0x3'));var moment=require('moment');var BPromise=require(_0xf4cf('0x4'));var rp=require(_0xf4cf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf4cf('0x6'));var config=require(_0xf4cf('0x7'));var attributes=require(_0xf4cf('0x8'));module['exports']=function(_0x2ab6dc,_0x2facb5){return _0x2ab6dc['define']('FreshdeskConfiguration',attributes,{'tableName':_0xf4cf('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x18f7=['rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','exports','int_freshdesk_configurations','lodash','util','api','moment','path'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0x18f7,0x1ef));var _0x718f=function(_0x2adbeb,_0x5581be){_0x2adbeb=_0x2adbeb-0x0;var _0x5e18a6=_0x18f7[_0x2adbeb];return _0x5e18a6;};'use strict';var _=require(_0x718f('0x0'));var util=require(_0x718f('0x1'));var logger=require('../../config/logger')(_0x718f('0x2'));var moment=require(_0x718f('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x718f('0x4'));var rimraf=require(_0x718f('0x5'));var config=require(_0x718f('0x6'));var attributes=require(_0x718f('0x7'));module[_0x718f('0x8')]=function(_0x26d706,_0x20b4e5){return _0x26d706['define']('FreshdeskConfiguration',attributes,{'tableName':_0x718f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js index 53b3ef6..be4f283 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 _0x815a=['bluebird','ioredis','../../config/utils','rpc','jayson/promise','client','http','then','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','lodash','util','moment'];(function(_0xc55d64,_0x133f2d){var _0x4194f6=function(_0x4a38c9){while(--_0x4a38c9){_0xc55d64['push'](_0xc55d64['shift']());}};_0x4194f6(++_0x133f2d);}(_0x815a,0xbb));var _0xa815=function(_0x49c057,_0xc808ed){_0x49c057=_0x49c057-0x0;var _0xd8f0e6=_0x815a[_0x49c057];return _0xd8f0e6;};'use strict';var _=require(_0xa815('0x0'));var util=require(_0xa815('0x1'));var moment=require(_0xa815('0x2'));var BPromise=require(_0xa815('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa815('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa815('0x5'));var logger=require('../../config/logger')(_0xa815('0x6'));var config=require('../../config/environment');var jayson=require(_0xa815('0x7'));var client=jayson[_0xa815('0x8')][_0xa815('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xd78457,_0x5cb63f,_0x2172ab){return new BPromise(function(_0xc15c88,_0x584869){return client['request'](_0xd78457,_0x2172ab)[_0xa815('0xa')](function(_0x48b364){logger['info'](_0xa815('0xb'),_0x5cb63f,_0xa815('0xc'));logger['debug']('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x5cb63f,_0xa815('0xc'),JSON[_0xa815('0xd')](_0x48b364));if(_0x48b364['error']){if(_0x48b364[_0xa815('0xe')][_0xa815('0xf')]===0x1f4){logger[_0xa815('0xe')](_0xa815('0xb'),_0x5cb63f,_0x48b364[_0xa815('0xe')][_0xa815('0x10')]);return _0x584869(_0x48b364[_0xa815('0xe')][_0xa815('0x10')]);}logger[_0xa815('0xe')](_0xa815('0xb'),_0x5cb63f,_0x48b364[_0xa815('0xe')][_0xa815('0x10')]);return _0xc15c88(_0x48b364['error'][_0xa815('0x10')]);}else{logger[_0xa815('0x11')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x5cb63f,'request\x20sent');_0xc15c88(_0x48b364[_0xa815('0x12')][_0xa815('0x10')]);}})['catch'](function(_0x850671){logger[_0xa815('0xe')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x5cb63f,_0x850671);_0x584869(_0x850671);});});} \ No newline at end of file +var _0x0450=['message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','client','http','request','info','FreshdeskConfiguration,\x20%s,\x20%s','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x5ea26d,_0x1d4d5b){var _0x37296d=function(_0x206221){while(--_0x206221){_0x5ea26d['push'](_0x5ea26d['shift']());}};_0x37296d(++_0x1d4d5b);}(_0x0450,0xc1));var _0x0045=function(_0x49af74,_0x2fe583){_0x49af74=_0x49af74-0x0;var _0x140ca5=_0x0450[_0x49af74];return _0x140ca5;};'use strict';var _=require('lodash');var util=require(_0x0045('0x0'));var moment=require(_0x0045('0x1'));var BPromise=require('bluebird');var rs=require(_0x0045('0x2'));var fs=require('fs');var Redis=require(_0x0045('0x3'));var db=require(_0x0045('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0045('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0045('0x6')][_0x0045('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3832ae,_0x4201b8,_0x8a0b68){return new BPromise(function(_0x56f816,_0x4b5bf3){return client[_0x0045('0x8')](_0x3832ae,_0x8a0b68)['then'](function(_0x275ad2){logger[_0x0045('0x9')](_0x0045('0xa'),_0x4201b8,'request\x20sent');logger[_0x0045('0xb')](_0x0045('0xc'),_0x4201b8,_0x0045('0xd'),JSON[_0x0045('0xe')](_0x275ad2));if(_0x275ad2[_0x0045('0xf')]){if(_0x275ad2[_0x0045('0xf')]['code']===0x1f4){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x4201b8,_0x275ad2[_0x0045('0xf')][_0x0045('0x10')]);return _0x4b5bf3(_0x275ad2[_0x0045('0xf')][_0x0045('0x10')]);}logger[_0x0045('0xf')](_0x0045('0xa'),_0x4201b8,_0x275ad2[_0x0045('0xf')]['message']);return _0x56f816(_0x275ad2[_0x0045('0xf')][_0x0045('0x10')]);}else{logger[_0x0045('0x9')](_0x0045('0xa'),_0x4201b8,_0x0045('0xd'));_0x56f816(_0x275ad2[_0x0045('0x11')][_0x0045('0x10')]);}})[_0x0045('0x12')](function(_0x58e073){logger[_0x0045('0xf')](_0x0045('0xa'),_0x4201b8,_0x58e073);_0x4b5bf3(_0x58e073);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index f10c828..bbcce44 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(_0x509bab,_0x317622){var _0x9842ca=function(_0x51970f){while(--_0x51970f){_0x509bab['push'](_0x509bab['shift']());}};_0x9842ca(++_0x317622);}(_0x008c,0x188));var _0xc008=function(_0x25e225,_0x4253fb){_0x25e225=_0x25e225-0x0;var _0x5ce20d=_0x008c[_0x25e225];return _0x5ce20d;};'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 _0x70e0=['create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','show','post','isAuthenticated'];(function(_0x3d34da,_0x3abcc1){var _0xcf6af8=function(_0x300a53){while(--_0x300a53){_0x3d34da['push'](_0x3d34da['shift']());}};_0xcf6af8(++_0x3abcc1);}(_0x70e0,0x17b));var _0x070e=function(_0x114004,_0x206af8){_0x114004=_0x114004-0x0;var _0x328368=_0x70e0[_0x114004];return _0x328368;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var auth=require(_0x070e('0x4'));var interaction=require(_0x070e('0x5'));var config=require(_0x070e('0x6'));var controller=require('./intFreshdeskField.controller');router[_0x070e('0x7')]('/',auth['isAuthenticated'](),controller[_0x070e('0x8')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x070e('0x9')]);router[_0x070e('0xa')]('/',auth[_0x070e('0xb')](),controller[_0x070e('0xc')]);router[_0x070e('0xd')](_0x070e('0xe'),auth[_0x070e('0xb')](),controller['update']);router['delete'](_0x070e('0xe'),auth[_0x070e('0xb')](),controller[_0x070e('0xf')]);module[_0x070e('0x10')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index bceaaf2..c2153dd 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 _0x4350=['STRING','ENUM','sequelize','exports','string','customVariable','keyValue'];(function(_0x2ee96f,_0x21a613){var _0x8f741a=function(_0x6b4b8b){while(--_0x6b4b8b){_0x2ee96f['push'](_0x2ee96f['shift']());}};_0x8f741a(++_0x21a613);}(_0x4350,0x1d0));var _0x0435=function(_0x3f4ed8,_0x32b832){_0x3f4ed8=_0x3f4ed8-0x0;var _0x51e8b7=_0x4350[_0x3f4ed8];return _0x51e8b7;};'use strict';var Sequelize=require(_0x0435('0x0'));module[_0x0435('0x1')]={'type':{'type':Sequelize['ENUM'](_0x0435('0x2'),'variable',_0x0435('0x3'),_0x0435('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x0435('0x5')]},'key':{'type':Sequelize[_0x0435('0x5')]},'keyType':{'type':Sequelize[_0x0435('0x6')](_0x0435('0x2'),'variable',_0x0435('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x0435('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf6c1=['string','variable','keyValue','STRING','customVariable','BOOLEAN','ENUM'];(function(_0x320685,_0x2eab66){var _0x5adb50=function(_0xa958bf){while(--_0xa958bf){_0x320685['push'](_0x320685['shift']());}};_0x5adb50(++_0x2eab66);}(_0xf6c1,0x99));var _0x1f6c=function(_0x1d0d77,_0x5681a1){_0x1d0d77=_0x1d0d77-0x0;var _0x5bda8b=_0xf6c1[_0x1d0d77];return _0x5bda8b;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x1f6c('0x0')](_0x1f6c('0x1'),_0x1f6c('0x2'),'customVariable',_0x1f6c('0x3')),'defaultValue':'string'},'content':{'type':Sequelize[_0x1f6c('0x4')]},'key':{'type':Sequelize[_0x1f6c('0x4')]},'keyType':{'type':Sequelize[_0x1f6c('0x0')](_0x1f6c('0x1'),_0x1f6c('0x2'),_0x1f6c('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x1f6c('0x4')]},'nameField':{'type':Sequelize[_0x1f6c('0x4')]},'customField':{'type':Sequelize[_0x1f6c('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1f6c('0x4')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 333745b..2a9f4d6 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 _0x0b21=['limit','set','json','apply','reject','save','then','end','error','stack','name','send','index','rawAttributes','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','map','merge','options','FreshdeskField','include','findAll','rows','catch','params','includeAll','find','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset'];(function(_0x12d033,_0x25fa2f){var _0x3b4e80=function(_0x46c1f4){while(--_0x46c1f4){_0x12d033['push'](_0x12d033['shift']());}};_0x3b4e80(++_0x25fa2f);}(_0x0b21,0x1cc));var _0x10b2=function(_0x442416,_0x24a1f7){_0x442416=_0x442416-0x0;var _0x30b798=_0x0b21[_0x442416];return _0x30b798;};'use strict';var pdf=require(_0x10b2('0x0'));var emlformat=require(_0x10b2('0x1'));var rimraf=require(_0x10b2('0x2'));var zipdir=require(_0x10b2('0x3'));var jsonpatch=require(_0x10b2('0x4'));var rp=require(_0x10b2('0x5'));var moment=require(_0x10b2('0x6'));var BPromise=require(_0x10b2('0x7'));var Mustache=require(_0x10b2('0x8'));var util=require('util');var path=require(_0x10b2('0x9'));var sox=require('sox');var csv=require(_0x10b2('0xa'));var ejs=require(_0x10b2('0xb'));var fs=require('fs');var _=require(_0x10b2('0xc'));var squel=require(_0x10b2('0xd'));var crypto=require(_0x10b2('0xe'));var jsforce=require(_0x10b2('0xf'));var deskjs=require(_0x10b2('0x10'));var toCsv=require('to-csv');var querystring=require(_0x10b2('0x11'));var Papa=require(_0x10b2('0x12'));var Redis=require(_0x10b2('0x13'));var authService=require(_0x10b2('0x14'));var qs=require(_0x10b2('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x10b2('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x10b2('0x17'));var config=require(_0x10b2('0x18'));var db=require(_0x10b2('0x19'))['db'];function respondWithStatusCode(_0x5b2573,_0xba3af){_0xba3af=_0xba3af||0xcc;return function(_0x4501f4){if(_0x4501f4){return _0x5b2573[_0x10b2('0x1a')](_0xba3af);}return _0x5b2573[_0x10b2('0x1b')](_0xba3af)['end']();};}function respondWithResult(_0x1cdf5d,_0x21aa2e){_0x21aa2e=_0x21aa2e||0xc8;return function(_0x402e29){if(_0x402e29){return _0x1cdf5d[_0x10b2('0x1b')](_0x21aa2e)['json'](_0x402e29);}};}function respondWithFilteredResult(_0x22c33f,_0x279b0d){return function(_0x38a072){if(_0x38a072){var _0x1eb9d5=_0x38a072[_0x10b2('0x1c')],_0x4ec3f8=_0x279b0d[_0x10b2('0x1d')],_0x3c40e9=_0x279b0d['offset']+_0x279b0d[_0x10b2('0x1e')],_0x528291;if(_0x3c40e9>=_0x1eb9d5){_0x3c40e9=_0x1eb9d5;_0x528291=0xc8;}else{_0x528291=0xce;}_0x22c33f[_0x10b2('0x1b')](_0x528291);return _0x22c33f[_0x10b2('0x1f')]('Content-Range',_0x4ec3f8+'-'+_0x3c40e9+'/'+_0x1eb9d5)[_0x10b2('0x20')](_0x38a072);}return null;};}function patchUpdates(_0x54bab8){return function(_0xb1f0f6){try{jsonpatch[_0x10b2('0x21')](_0xb1f0f6,_0x54bab8,!![]);}catch(_0x552ce3){return BPromise[_0x10b2('0x22')](_0x552ce3);}return _0xb1f0f6[_0x10b2('0x23')]();};}function saveUpdates(_0xa50342,_0x520699){return function(_0x1df200){if(_0x1df200){return _0x1df200['update'](_0xa50342)[_0x10b2('0x24')](function(_0x460d6f){return _0x460d6f;});}return null;};}function removeEntity(_0x8d659b,_0x25d533){return function(_0x33a0b6){if(_0x33a0b6){return _0x33a0b6['destroy']()[_0x10b2('0x24')](function(){_0x8d659b[_0x10b2('0x1b')](0xcc)[_0x10b2('0x25')]();});}};}function handleEntityNotFound(_0x1b9cfc,_0x361835){return function(_0x4a0f88){if(!_0x4a0f88){_0x1b9cfc[_0x10b2('0x1a')](0x194);}return _0x4a0f88;};}function handleError(_0x4a16a6,_0x172c49){_0x172c49=_0x172c49||0x1f4;return function(_0x426f88){logger[_0x10b2('0x26')](_0x426f88[_0x10b2('0x27')]);if(_0x426f88[_0x10b2('0x28')]){delete _0x426f88[_0x10b2('0x28')];}_0x4a16a6[_0x10b2('0x1b')](_0x172c49)[_0x10b2('0x29')](_0x426f88);};}exports[_0x10b2('0x2a')]=function(_0x5d7791,_0x1f8831){var _0x1e2baa={},_0x449ba4={},_0x562d4e={'count':0x0,'rows':[]};var _0x106082=_['map'](db['FreshdeskField'][_0x10b2('0x2b')],function(_0x53db7f){return{'name':_0x53db7f['fieldName'],'type':_0x53db7f[_0x10b2('0x2c')]['key']};});_0x449ba4[_0x10b2('0x2d')]=_['map'](_0x106082,'name');_0x449ba4[_0x10b2('0x2e')]=_['keys'](_0x5d7791[_0x10b2('0x2e')]);_0x449ba4[_0x10b2('0x2f')]=_[_0x10b2('0x30')](_0x449ba4[_0x10b2('0x2d')],_0x449ba4[_0x10b2('0x2e')]);_0x1e2baa['attributes']=_['intersection'](_0x449ba4[_0x10b2('0x2d')],qs['fields'](_0x5d7791[_0x10b2('0x2e')][_0x10b2('0x31')]));_0x1e2baa[_0x10b2('0x32')]=_0x1e2baa[_0x10b2('0x32')][_0x10b2('0x33')]?_0x1e2baa[_0x10b2('0x32')]:_0x449ba4['model'];if(!_0x5d7791[_0x10b2('0x2e')][_0x10b2('0x34')](_0x10b2('0x35'))){_0x1e2baa[_0x10b2('0x1e')]=qs[_0x10b2('0x1e')](_0x5d7791['query'][_0x10b2('0x1e')]);_0x1e2baa[_0x10b2('0x1d')]=qs[_0x10b2('0x1d')](_0x5d7791[_0x10b2('0x2e')][_0x10b2('0x1d')]);}_0x1e2baa['order']=qs[_0x10b2('0x36')](_0x5d7791[_0x10b2('0x2e')][_0x10b2('0x36')]);_0x1e2baa[_0x10b2('0x37')]=qs['filters'](_['pick'](_0x5d7791['query'],_0x449ba4[_0x10b2('0x2f')]));if(_0x5d7791['query'][_0x10b2('0x38')]){_0x1e2baa[_0x10b2('0x37')]=_['merge'](_0x1e2baa[_0x10b2('0x37')],{'$or':_[_0x10b2('0x39')](_0x106082,function(_0xe9c9a7){if(_0xe9c9a7[_0x10b2('0x2c')]!=='VIRTUAL'){var _0x3abb6a={};_0x3abb6a[_0xe9c9a7[_0x10b2('0x28')]]={'$like':'%'+_0x5d7791[_0x10b2('0x2e')]['filter']+'%'};return _0x3abb6a;}})});}_0x1e2baa=_[_0x10b2('0x3a')]({},_0x1e2baa,_0x5d7791[_0x10b2('0x3b')]);var _0x2d01d8={'where':_0x1e2baa['where']};return db[_0x10b2('0x3c')][_0x10b2('0x1c')](_0x2d01d8)[_0x10b2('0x24')](function(_0x122d75){_0x562d4e['count']=_0x122d75;if(_0x5d7791[_0x10b2('0x2e')]['includeAll']){_0x1e2baa[_0x10b2('0x3d')]=[{'all':!![]}];}return db[_0x10b2('0x3c')][_0x10b2('0x3e')](_0x1e2baa);})[_0x10b2('0x24')](function(_0x4ba262){_0x562d4e[_0x10b2('0x3f')]=_0x4ba262;return _0x562d4e;})[_0x10b2('0x24')](respondWithFilteredResult(_0x1f8831,_0x1e2baa))[_0x10b2('0x40')](handleError(_0x1f8831,null));};exports['show']=function(_0xb3ed34,_0x31f472){var _0x38d0e3={'raw':!![],'where':{'id':_0xb3ed34[_0x10b2('0x41')]['id']}},_0x51f565={};_0x51f565[_0x10b2('0x2d')]=_['keys'](db[_0x10b2('0x3c')][_0x10b2('0x2b')]);_0x51f565[_0x10b2('0x2e')]=_['keys'](_0xb3ed34[_0x10b2('0x2e')]);_0x51f565[_0x10b2('0x2f')]=_[_0x10b2('0x30')](_0x51f565[_0x10b2('0x2d')],_0x51f565[_0x10b2('0x2e')]);_0x38d0e3[_0x10b2('0x32')]=_[_0x10b2('0x30')](_0x51f565['model'],qs[_0x10b2('0x31')](_0xb3ed34['query'][_0x10b2('0x31')]));_0x38d0e3[_0x10b2('0x32')]=_0x38d0e3[_0x10b2('0x32')][_0x10b2('0x33')]?_0x38d0e3[_0x10b2('0x32')]:_0x51f565[_0x10b2('0x2d')];if(_0xb3ed34[_0x10b2('0x2e')][_0x10b2('0x42')]){_0x38d0e3[_0x10b2('0x3d')]=[{'all':!![]}];}_0x38d0e3=_[_0x10b2('0x3a')]({},_0x38d0e3,_0xb3ed34[_0x10b2('0x3b')]);return db[_0x10b2('0x3c')][_0x10b2('0x43')](_0x38d0e3)[_0x10b2('0x24')](handleEntityNotFound(_0x31f472,null))[_0x10b2('0x24')](respondWithResult(_0x31f472,null))[_0x10b2('0x40')](handleError(_0x31f472,null));};exports[_0x10b2('0x44')]=function(_0x64f5c2,_0x303297){return db[_0x10b2('0x3c')][_0x10b2('0x44')](_0x64f5c2[_0x10b2('0x45')],{})[_0x10b2('0x24')](respondWithResult(_0x303297,0xc9))[_0x10b2('0x40')](handleError(_0x303297,null));};exports['update']=function(_0x25b786,_0x27d7b7){if(_0x25b786[_0x10b2('0x45')]['id']){delete _0x25b786[_0x10b2('0x45')]['id'];}return db[_0x10b2('0x3c')][_0x10b2('0x43')]({'where':{'id':_0x25b786[_0x10b2('0x41')]['id']}})[_0x10b2('0x24')](handleEntityNotFound(_0x27d7b7,null))[_0x10b2('0x24')](saveUpdates(_0x25b786['body'],null))['then'](respondWithResult(_0x27d7b7,null))[_0x10b2('0x40')](handleError(_0x27d7b7,null));};exports['destroy']=function(_0x203cf3,_0x35348c){return db['FreshdeskField'][_0x10b2('0x43')]({'where':{'id':_0x203cf3['params']['id']}})[_0x10b2('0x24')](handleEntityNotFound(_0x35348c,null))[_0x10b2('0x24')](removeEntity(_0x35348c,null))[_0x10b2('0x40')](handleError(_0x35348c,null));}; \ No newline at end of file +var _0xd5e8=['squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','json','count','offset','set','Content-Range','apply','then','destroy','end','sendStatus','stack','name','send','index','map','FreshdeskField','rawAttributes','fieldName','type','key','query','keys','filters','attributes','intersection','model','fields','length','nolimit','limit','sort','where','pick','merge','filter','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','update','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','lodash'];(function(_0x1196b0,_0x36c47a){var _0x111c52=function(_0x5604c7){while(--_0x5604c7){_0x1196b0['push'](_0x1196b0['shift']());}};_0x111c52(++_0x36c47a);}(_0xd5e8,0xcf));var _0x8d5e=function(_0x2b2667,_0x536c81){_0x2b2667=_0x2b2667-0x0;var _0x589e00=_0xd5e8[_0x2b2667];return _0x589e00;};'use strict';var pdf=require(_0x8d5e('0x0'));var emlformat=require(_0x8d5e('0x1'));var rimraf=require(_0x8d5e('0x2'));var zipdir=require(_0x8d5e('0x3'));var jsonpatch=require(_0x8d5e('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8d5e('0x5'));var util=require(_0x8d5e('0x6'));var path=require(_0x8d5e('0x7'));var sox=require(_0x8d5e('0x8'));var csv=require(_0x8d5e('0x9'));var ejs=require(_0x8d5e('0xa'));var fs=require('fs');var _=require(_0x8d5e('0xb'));var squel=require(_0x8d5e('0xc'));var crypto=require(_0x8d5e('0xd'));var jsforce=require(_0x8d5e('0xe'));var deskjs=require(_0x8d5e('0xf'));var toCsv=require(_0x8d5e('0x9'));var querystring=require(_0x8d5e('0x10'));var Papa=require(_0x8d5e('0x11'));var Redis=require(_0x8d5e('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8d5e('0x13'));var hardwareService=require(_0x8d5e('0x14'));var logger=require(_0x8d5e('0x15'))(_0x8d5e('0x16'));var utils=require(_0x8d5e('0x17'));var config=require('../../config/environment');var db=require(_0x8d5e('0x18'))['db'];function respondWithStatusCode(_0x2e978e,_0x1beb34){_0x1beb34=_0x1beb34||0xcc;return function(_0x22479a){if(_0x22479a){return _0x2e978e['sendStatus'](_0x1beb34);}return _0x2e978e[_0x8d5e('0x19')](_0x1beb34)['end']();};}function respondWithResult(_0x54737c,_0x344072){_0x344072=_0x344072||0xc8;return function(_0x123c67){if(_0x123c67){return _0x54737c[_0x8d5e('0x19')](_0x344072)[_0x8d5e('0x1a')](_0x123c67);}};}function respondWithFilteredResult(_0x14c81f,_0x23076b){return function(_0x1d6ba3){if(_0x1d6ba3){var _0x2215a4=_0x1d6ba3[_0x8d5e('0x1b')],_0x542b7e=_0x23076b[_0x8d5e('0x1c')],_0x223d18=_0x23076b[_0x8d5e('0x1c')]+_0x23076b['limit'],_0x426c30;if(_0x223d18>=_0x2215a4){_0x223d18=_0x2215a4;_0x426c30=0xc8;}else{_0x426c30=0xce;}_0x14c81f[_0x8d5e('0x19')](_0x426c30);return _0x14c81f[_0x8d5e('0x1d')](_0x8d5e('0x1e'),_0x542b7e+'-'+_0x223d18+'/'+_0x2215a4)[_0x8d5e('0x1a')](_0x1d6ba3);}return null;};}function patchUpdates(_0x54437c){return function(_0x2dec41){try{jsonpatch[_0x8d5e('0x1f')](_0x2dec41,_0x54437c,!![]);}catch(_0x439de4){return BPromise['reject'](_0x439de4);}return _0x2dec41['save']();};}function saveUpdates(_0x27f7b8,_0x3b4a20){return function(_0x1e8f29){if(_0x1e8f29){return _0x1e8f29['update'](_0x27f7b8)[_0x8d5e('0x20')](function(_0x329484){return _0x329484;});}return null;};}function removeEntity(_0x40735b,_0x1751e4){return function(_0x210ea9){if(_0x210ea9){return _0x210ea9[_0x8d5e('0x21')]()[_0x8d5e('0x20')](function(){_0x40735b[_0x8d5e('0x19')](0xcc)[_0x8d5e('0x22')]();});}};}function handleEntityNotFound(_0xed4b03,_0x4fc1ee){return function(_0x12e77b){if(!_0x12e77b){_0xed4b03[_0x8d5e('0x23')](0x194);}return _0x12e77b;};}function handleError(_0x241b00,_0x2e2eb8){_0x2e2eb8=_0x2e2eb8||0x1f4;return function(_0x58d3bb){logger['error'](_0x58d3bb[_0x8d5e('0x24')]);if(_0x58d3bb[_0x8d5e('0x25')]){delete _0x58d3bb[_0x8d5e('0x25')];}_0x241b00[_0x8d5e('0x19')](_0x2e2eb8)[_0x8d5e('0x26')](_0x58d3bb);};}exports[_0x8d5e('0x27')]=function(_0x3e7ff7,_0x43f8c8){var _0x155f26={},_0xff8a7f={},_0x35a016={'count':0x0,'rows':[]};var _0x51fa55=_[_0x8d5e('0x28')](db[_0x8d5e('0x29')][_0x8d5e('0x2a')],function(_0x2c22b9){return{'name':_0x2c22b9[_0x8d5e('0x2b')],'type':_0x2c22b9[_0x8d5e('0x2c')][_0x8d5e('0x2d')]};});_0xff8a7f['model']=_['map'](_0x51fa55,_0x8d5e('0x25'));_0xff8a7f[_0x8d5e('0x2e')]=_[_0x8d5e('0x2f')](_0x3e7ff7['query']);_0xff8a7f[_0x8d5e('0x30')]=_['intersection'](_0xff8a7f['model'],_0xff8a7f[_0x8d5e('0x2e')]);_0x155f26[_0x8d5e('0x31')]=_[_0x8d5e('0x32')](_0xff8a7f[_0x8d5e('0x33')],qs[_0x8d5e('0x34')](_0x3e7ff7['query'][_0x8d5e('0x34')]));_0x155f26[_0x8d5e('0x31')]=_0x155f26[_0x8d5e('0x31')][_0x8d5e('0x35')]?_0x155f26[_0x8d5e('0x31')]:_0xff8a7f['model'];if(!_0x3e7ff7[_0x8d5e('0x2e')]['hasOwnProperty'](_0x8d5e('0x36'))){_0x155f26[_0x8d5e('0x37')]=qs[_0x8d5e('0x37')](_0x3e7ff7[_0x8d5e('0x2e')][_0x8d5e('0x37')]);_0x155f26[_0x8d5e('0x1c')]=qs[_0x8d5e('0x1c')](_0x3e7ff7['query'][_0x8d5e('0x1c')]);}_0x155f26['order']=qs[_0x8d5e('0x38')](_0x3e7ff7[_0x8d5e('0x2e')][_0x8d5e('0x38')]);_0x155f26[_0x8d5e('0x39')]=qs[_0x8d5e('0x30')](_[_0x8d5e('0x3a')](_0x3e7ff7[_0x8d5e('0x2e')],_0xff8a7f[_0x8d5e('0x30')]));if(_0x3e7ff7['query']['filter']){_0x155f26[_0x8d5e('0x39')]=_[_0x8d5e('0x3b')](_0x155f26[_0x8d5e('0x39')],{'$or':_['map'](_0x51fa55,function(_0x47f683){if(_0x47f683[_0x8d5e('0x2c')]!=='VIRTUAL'){var _0x55b449={};_0x55b449[_0x47f683[_0x8d5e('0x25')]]={'$like':'%'+_0x3e7ff7[_0x8d5e('0x2e')][_0x8d5e('0x3c')]+'%'};return _0x55b449;}})});}_0x155f26=_['merge']({},_0x155f26,_0x3e7ff7[_0x8d5e('0x3d')]);var _0x617506={'where':_0x155f26[_0x8d5e('0x39')]};return db['FreshdeskField'][_0x8d5e('0x1b')](_0x617506)[_0x8d5e('0x20')](function(_0x28ed48){_0x35a016['count']=_0x28ed48;if(_0x3e7ff7[_0x8d5e('0x2e')][_0x8d5e('0x3e')]){_0x155f26[_0x8d5e('0x3f')]=[{'all':!![]}];}return db['FreshdeskField'][_0x8d5e('0x40')](_0x155f26);})[_0x8d5e('0x20')](function(_0x211a88){_0x35a016[_0x8d5e('0x41')]=_0x211a88;return _0x35a016;})['then'](respondWithFilteredResult(_0x43f8c8,_0x155f26))['catch'](handleError(_0x43f8c8,null));};exports[_0x8d5e('0x42')]=function(_0x50e694,_0x35b48f){var _0x1849d5={'raw':!![],'where':{'id':_0x50e694[_0x8d5e('0x43')]['id']}},_0x15b107={};_0x15b107[_0x8d5e('0x33')]=_[_0x8d5e('0x2f')](db[_0x8d5e('0x29')]['rawAttributes']);_0x15b107[_0x8d5e('0x2e')]=_[_0x8d5e('0x2f')](_0x50e694[_0x8d5e('0x2e')]);_0x15b107['filters']=_[_0x8d5e('0x32')](_0x15b107[_0x8d5e('0x33')],_0x15b107[_0x8d5e('0x2e')]);_0x1849d5[_0x8d5e('0x31')]=_[_0x8d5e('0x32')](_0x15b107['model'],qs[_0x8d5e('0x34')](_0x50e694[_0x8d5e('0x2e')][_0x8d5e('0x34')]));_0x1849d5[_0x8d5e('0x31')]=_0x1849d5[_0x8d5e('0x31')][_0x8d5e('0x35')]?_0x1849d5['attributes']:_0x15b107[_0x8d5e('0x33')];if(_0x50e694['query'][_0x8d5e('0x3e')]){_0x1849d5['include']=[{'all':!![]}];}_0x1849d5=_['merge']({},_0x1849d5,_0x50e694[_0x8d5e('0x3d')]);return db['FreshdeskField'][_0x8d5e('0x44')](_0x1849d5)['then'](handleEntityNotFound(_0x35b48f,null))['then'](respondWithResult(_0x35b48f,null))[_0x8d5e('0x45')](handleError(_0x35b48f,null));};exports[_0x8d5e('0x46')]=function(_0x53edf2,_0x4d7a9d){return db[_0x8d5e('0x29')][_0x8d5e('0x46')](_0x53edf2[_0x8d5e('0x47')],{})[_0x8d5e('0x20')](respondWithResult(_0x4d7a9d,0xc9))[_0x8d5e('0x45')](handleError(_0x4d7a9d,null));};exports[_0x8d5e('0x48')]=function(_0x1b7a86,_0x249df7){if(_0x1b7a86[_0x8d5e('0x47')]['id']){delete _0x1b7a86[_0x8d5e('0x47')]['id'];}return db[_0x8d5e('0x29')]['find']({'where':{'id':_0x1b7a86[_0x8d5e('0x43')]['id']}})[_0x8d5e('0x20')](handleEntityNotFound(_0x249df7,null))[_0x8d5e('0x20')](saveUpdates(_0x1b7a86[_0x8d5e('0x47')],null))[_0x8d5e('0x20')](respondWithResult(_0x249df7,null))[_0x8d5e('0x45')](handleError(_0x249df7,null));};exports['destroy']=function(_0x48a503,_0x2262f3){return db['FreshdeskField'][_0x8d5e('0x44')]({'where':{'id':_0x48a503['params']['id']}})[_0x8d5e('0x20')](handleEntityNotFound(_0x2262f3,null))[_0x8d5e('0x20')](removeEntity(_0x2262f3,null))['catch'](handleError(_0x2262f3,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index e4b8d64..91ff136 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 _0xde16=['int_freshdesk_fields','idField','FieldId','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x62c958,_0x2bfdbc){var _0x57ec61=function(_0x5c0094){while(--_0x5c0094){_0x62c958['push'](_0x62c958['shift']());}};_0x57ec61(++_0x2bfdbc);}(_0xde16,0x177));var _0x6de1=function(_0x40f60f,_0x6930d5){_0x40f60f=_0x40f60f-0x0;var _0x307011=_0xde16[_0x40f60f];return _0x307011;};'use strict';var _=require('lodash');var util=require(_0x6de1('0x0'));var logger=require('../../config/logger')(_0x6de1('0x1'));var moment=require(_0x6de1('0x2'));var BPromise=require(_0x6de1('0x3'));var rp=require(_0x6de1('0x4'));var fs=require('fs');var path=require(_0x6de1('0x5'));var rimraf=require(_0x6de1('0x6'));var config=require(_0x6de1('0x7'));var attributes=require('./intFreshdeskField.attributes');module[_0x6de1('0x8')]=function(_0xd2ea51,_0x31e00e){return _0xd2ea51['define']('FreshdeskField',attributes,{'tableName':_0x6de1('0x9'),'paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':[_0x6de1('0xa'),_0x6de1('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd9fd=['FieldId','lodash','util','../../config/logger','api','request-promise','path','rimraf','./intFreshdeskField.attributes','exports','define','int_freshdesk_fields','freshdesk_unique_index','idField'];(function(_0x3888ae,_0x5c8de7){var _0x2e8ad7=function(_0x423ff8){while(--_0x423ff8){_0x3888ae['push'](_0x3888ae['shift']());}};_0x2e8ad7(++_0x5c8de7);}(_0xd9fd,0xc5));var _0xdd9f=function(_0x28488b,_0x5c74e6){_0x28488b=_0x28488b-0x0;var _0x56a65c=_0xd9fd[_0x28488b];return _0x56a65c;};'use strict';var _=require(_0xdd9f('0x0'));var util=require(_0xdd9f('0x1'));var logger=require(_0xdd9f('0x2'))(_0xdd9f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xdd9f('0x4'));var fs=require('fs');var path=require(_0xdd9f('0x5'));var rimraf=require(_0xdd9f('0x6'));var config=require('../../config/environment');var attributes=require(_0xdd9f('0x7'));module[_0xdd9f('0x8')]=function(_0x33a7e7,_0x3c8958){return _0x33a7e7[_0xdd9f('0x9')]('FreshdeskField',attributes,{'tableName':_0xdd9f('0xa'),'paranoid':![],'indexes':[{'name':_0xdd9f('0xb'),'fields':[_0xdd9f('0xc'),_0xdd9f('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 bf2870a..abe0ee5 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(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7a54,0x106));var _0x47a5=function(_0x1f9369,_0x5a2d74){_0x1f9369=_0x1f9369-0x0;var _0x2d9d84=_0x7a54[_0x1f9369];return _0x2d9d84;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0xb10b=['stringify','error','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshdeskField,\x20%s,\x20%s','FreshdeskField,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0xe76211,_0x41e6ea){var _0x4707f6=function(_0x56bfa5){while(--_0x56bfa5){_0xe76211['push'](_0xe76211['shift']());}};_0x4707f6(++_0x41e6ea);}(_0xb10b,0x12a));var _0xbb10=function(_0x4dedd3,_0x175841){_0x4dedd3=_0x4dedd3-0x0;var _0x48f768=_0xb10b[_0x4dedd3];return _0x48f768;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index b30d1d6..e6989eb 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 _0xfb6a=['isAuthenticated','index','/:id','show','/:id/configurations','getFields','post','create','addConfiguration','put','update','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intFreshsalesAccount.controller','get'];(function(_0x2def9e,_0x4c6715){var _0x2adeb9=function(_0xc2d946){while(--_0xc2d946){_0x2def9e['push'](_0x2def9e['shift']());}};_0x2adeb9(++_0x4c6715);}(_0xfb6a,0xa6));var _0xafb6=function(_0x4e7413,_0x5dffb1){_0x4e7413=_0x4e7413-0x0;var _0x11b6de=_0xfb6a[_0x4e7413];return _0x11b6de;};'use strict';var multer=require(_0xafb6('0x0'));var util=require(_0xafb6('0x1'));var path=require(_0xafb6('0x2'));var timeout=require(_0xafb6('0x3'));var express=require(_0xafb6('0x4'));var router=express[_0xafb6('0x5')]();var auth=require(_0xafb6('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xafb6('0x7'));var controller=require(_0xafb6('0x8'));router[_0xafb6('0x9')]('/',auth[_0xafb6('0xa')](),controller[_0xafb6('0xb')]);router[_0xafb6('0x9')](_0xafb6('0xc'),auth[_0xafb6('0xa')](),controller[_0xafb6('0xd')]);router[_0xafb6('0x9')](_0xafb6('0xe'),auth[_0xafb6('0xa')](),controller['getConfigurations']);router[_0xafb6('0x9')]('/:id/fields',auth['isAuthenticated'](),controller[_0xafb6('0xf')]);router[_0xafb6('0x10')]('/',auth[_0xafb6('0xa')](),controller[_0xafb6('0x11')]);router[_0xafb6('0x10')]('/:id/configurations',auth[_0xafb6('0xa')](),controller[_0xafb6('0x12')]);router[_0xafb6('0x13')]('/:id',auth[_0xafb6('0xa')](),controller[_0xafb6('0x14')]);router['delete'](_0xafb6('0xc'),auth[_0xafb6('0xa')](),controller['destroy']);module[_0xafb6('0x15')]=router; \ No newline at end of file +var _0x8174=['util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','create','post','addConfiguration','put','update','delete','exports','multer'];(function(_0x3db8d5,_0x318aea){var _0x4e8f99=function(_0x43f7d6){while(--_0x43f7d6){_0x3db8d5['push'](_0x3db8d5['shift']());}};_0x4e8f99(++_0x318aea);}(_0x8174,0x15f));var _0x4817=function(_0x9ec221,_0x2594a6){_0x9ec221=_0x9ec221-0x0;var _0xdbe55e=_0x8174[_0x9ec221];return _0xdbe55e;};'use strict';var multer=require(_0x4817('0x0'));var util=require(_0x4817('0x1'));var path=require(_0x4817('0x2'));var timeout=require('connect-timeout');var express=require(_0x4817('0x3'));var router=express[_0x4817('0x4')]();var auth=require(_0x4817('0x5'));var interaction=require(_0x4817('0x6'));var config=require(_0x4817('0x7'));var controller=require(_0x4817('0x8'));router[_0x4817('0x9')]('/',auth[_0x4817('0xa')](),controller[_0x4817('0xb')]);router[_0x4817('0x9')](_0x4817('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x4817('0x9')](_0x4817('0xd'),auth['isAuthenticated'](),controller[_0x4817('0xe')]);router[_0x4817('0x9')]('/:id/fields',auth[_0x4817('0xa')](),controller['getFields']);router['post']('/',auth[_0x4817('0xa')](),controller[_0x4817('0xf')]);router[_0x4817('0x10')]('/:id/configurations',auth[_0x4817('0xa')](),controller[_0x4817('0x11')]);router[_0x4817('0x12')]('/:id',auth[_0x4817('0xa')](),controller[_0x4817('0x13')]);router[_0x4817('0x14')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x4817('0x15')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index daf02f0..2c12ca0 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 _0x50a5=['remoteUri','sequelize','exports','STRING'];(function(_0x44813d,_0x2255b1){var _0x2bd336=function(_0x14c994){while(--_0x14c994){_0x44813d['push'](_0x44813d['shift']());}};_0x2bd336(++_0x2255b1);}(_0x50a5,0xd1));var _0x550a=function(_0x2dfe1d,_0x4558ae){_0x2dfe1d=_0x2dfe1d-0x0;var _0x26670d=_0x50a5[_0x2dfe1d];return _0x26670d;};'use strict';var Sequelize=require(_0x550a('0x0'));module[_0x550a('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':'username'},'apiKey':{'type':Sequelize[_0x550a('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x550a('0x3')},'serverUrl':{'type':Sequelize[_0x550a('0x2')]}}; \ No newline at end of file +var _0x72a1=['exports','STRING','username'];(function(_0x555b2f,_0x43b622){var _0x81c0a6=function(_0x4629e6){while(--_0x4629e6){_0x555b2f['push'](_0x555b2f['shift']());}};_0x81c0a6(++_0x43b622);}(_0x72a1,0x1ce));var _0x172a=function(_0x3afd90,_0x555778){_0x3afd90=_0x3afd90-0x0;var _0x45ae56=_0x72a1[_0x3afd90];return _0x45ae56;};'use strict';var Sequelize=require('sequelize');module[_0x172a('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x172a('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x172a('0x2')},'apiKey':{'type':Sequelize[_0x172a('0x1')]},'remoteUri':{'type':Sequelize[_0x172a('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x172a('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index f38bcf0..927575c 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 _0xa9e4=['../../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','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','status','end','json','count','offset','limit','set','apply','reject','update','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','findAll','rows','catch','params','length','include','options','find','create','FreshsalesAccount','body','destroy','getConfigurations','order','findOne','AccountId','Subjects','Descriptions','getDescriptions','channel','FreshsalesConfiguration','FreshsalesField','getFields','username','remoteUri','substring','GET','format','%s%s','Token\x20token=','apiKey','Requested\x20Resource\x20not\x20Found','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','statusCode','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','to-csv','ejs','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils'];(function(_0x65d3db,_0x3e2f20){var _0x4e997e=function(_0xfc2c96){while(--_0xfc2c96){_0x65d3db['push'](_0x65d3db['shift']());}};_0x4e997e(++_0x3e2f20);}(_0xa9e4,0xbb));var _0x4a9e=function(_0x828c94,_0x2861aa){_0x828c94=_0x828c94-0x0;var _0x54c03b=_0xa9e4[_0x828c94];return _0x54c03b;};'use strict';var pdf=require(_0x4a9e('0x0'));var emlformat=require(_0x4a9e('0x1'));var rimraf=require(_0x4a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4a9e('0x3'));var rp=require('request-promise');var moment=require(_0x4a9e('0x4'));var BPromise=require(_0x4a9e('0x5'));var Mustache=require(_0x4a9e('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x4a9e('0x7'));var ejs=require(_0x4a9e('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x4a9e('0x9'));var crypto=require(_0x4a9e('0xa'));var jsforce=require(_0x4a9e('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4a9e('0xc'));var Redis=require(_0x4a9e('0xd'));var authService=require(_0x4a9e('0xe'));var qs=require(_0x4a9e('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4a9e('0x10'))(_0x4a9e('0x11'));var utils=require(_0x4a9e('0x12'));var config=require('../../config/environment');var db=require(_0x4a9e('0x13'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require('jayson/promise');var client=jayson['client'][_0x4a9e('0x14')]({'port':0x232a});function checkPasswordPattern(_0x3aa76d,_0x2cf882,_0x3d43a5){if(_0x3d43a5){var _0x15aa48=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x15aa48[_0x4a9e('0x15')](_0x2cf882)){return _0x3aa76d;}else{throw new db[(_0x4a9e('0x16'))][(_0x4a9e('0x17'))](_0x4a9e('0x18'));}}else{return _0x3aa76d;}}function respondWithRpcPromise(_0x300608,_0xfa3d1e,_0x2f14fb,_0x3ce9ab){return new BPromise(function(_0x5ec7bc,_0x175943){var _0x3699dc=_0x3ce9ab||client;return _0x3699dc[_0x4a9e('0x19')](_0x300608,_0x2f14fb)[_0x4a9e('0x1a')](function(_0x555343){logger[_0x4a9e('0x1b')](_0x4a9e('0x1c'),_0xfa3d1e,_0x4a9e('0x1d'));logger['debug']('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0xfa3d1e,'request\x20sent',JSON[_0x4a9e('0x1e')](_0x555343));if(_0x555343[_0x4a9e('0x1f')]){if(_0x555343[_0x4a9e('0x1f')][_0x4a9e('0x20')]===0x1f4){logger[_0x4a9e('0x1f')]('FreshsalesAccount,\x20%s,\x20%s',_0xfa3d1e,_0x555343[_0x4a9e('0x1f')][_0x4a9e('0x21')]);return _0x175943(_0x555343[_0x4a9e('0x1f')][_0x4a9e('0x21')]);}logger[_0x4a9e('0x1f')](_0x4a9e('0x1c'),_0xfa3d1e,_0x555343[_0x4a9e('0x1f')][_0x4a9e('0x21')]);return _0x5ec7bc(_0x555343[_0x4a9e('0x1f')]['message']);}else{logger['info']('FreshsalesAccount,\x20%s,\x20%s',_0xfa3d1e,_0x4a9e('0x1d'));_0x5ec7bc(_0x555343[_0x4a9e('0x22')][_0x4a9e('0x21')]);}})['catch'](function(_0x3eb5ca){logger[_0x4a9e('0x1f')](_0x4a9e('0x1c'),_0xfa3d1e,_0x3eb5ca);_0x175943(_0x3eb5ca);});});}function respondWithStatusCode(_0x1f8440,_0x402e6d){_0x402e6d=_0x402e6d||0xcc;return function(_0x1a6aee){if(_0x1a6aee){return _0x1f8440[_0x4a9e('0x23')](_0x402e6d);}return _0x1f8440[_0x4a9e('0x24')](_0x402e6d)[_0x4a9e('0x25')]();};}function respondWithResult(_0x2dfb8e,_0x5941fa){_0x5941fa=_0x5941fa||0xc8;return function(_0x38e870){if(_0x38e870){return _0x2dfb8e['status'](_0x5941fa)[_0x4a9e('0x26')](_0x38e870);}};}function respondWithFilteredResult(_0xefb7a,_0x510580){return function(_0x251379){if(_0x251379){var _0x198caa=_0x251379[_0x4a9e('0x27')],_0x7b0b9c=_0x510580[_0x4a9e('0x28')],_0x5dc179=_0x510580['offset']+_0x510580[_0x4a9e('0x29')],_0x569335;if(_0x5dc179>=_0x198caa){_0x5dc179=_0x198caa;_0x569335=0xc8;}else{_0x569335=0xce;}_0xefb7a[_0x4a9e('0x24')](_0x569335);return _0xefb7a[_0x4a9e('0x2a')]('Content-Range',_0x7b0b9c+'-'+_0x5dc179+'/'+_0x198caa)[_0x4a9e('0x26')](_0x251379);}return null;};}function patchUpdates(_0x19571c){return function(_0x5b1104){try{jsonpatch[_0x4a9e('0x2b')](_0x5b1104,_0x19571c,!![]);}catch(_0x22c121){return BPromise[_0x4a9e('0x2c')](_0x22c121);}return _0x5b1104['save']();};}function saveUpdates(_0x5ce131,_0x1b2a29){return function(_0x44da1d){if(_0x44da1d){return _0x44da1d[_0x4a9e('0x2d')](_0x5ce131)[_0x4a9e('0x1a')](function(_0x27faed){return _0x27faed;});}return null;};}function removeEntity(_0x3a2559,_0x968c80){return function(_0x22c7f4){if(_0x22c7f4){return _0x22c7f4['destroy']()[_0x4a9e('0x1a')](function(){_0x3a2559[_0x4a9e('0x24')](0xcc)[_0x4a9e('0x25')]();});}};}function handleEntityNotFound(_0x5b4589,_0x23a0fc){return function(_0x4c68fd){if(!_0x4c68fd){_0x5b4589[_0x4a9e('0x23')](0x194);}return _0x4c68fd;};}function handleError(_0x19da40,_0x4037b1){_0x4037b1=_0x4037b1||0x1f4;return function(_0x24c1a7){logger[_0x4a9e('0x1f')](_0x24c1a7['stack']);if(_0x24c1a7['name']){delete _0x24c1a7[_0x4a9e('0x2e')];}_0x19da40['status'](_0x4037b1)[_0x4a9e('0x2f')](_0x24c1a7);};}exports[_0x4a9e('0x30')]=function(_0x43e1ec,_0x28176d){var _0x525dd0={},_0x378e16={},_0x107172={'count':0x0,'rows':[]};var _0x2d1069=_[_0x4a9e('0x31')](db['FreshsalesAccount'][_0x4a9e('0x32')],function(_0x5b3ebc){return{'name':_0x5b3ebc[_0x4a9e('0x33')],'type':_0x5b3ebc[_0x4a9e('0x34')][_0x4a9e('0x35')]};});_0x378e16[_0x4a9e('0x36')]=_[_0x4a9e('0x31')](_0x2d1069,_0x4a9e('0x2e'));_0x378e16[_0x4a9e('0x37')]=_[_0x4a9e('0x38')](_0x43e1ec['query']);_0x378e16['filters']=_[_0x4a9e('0x39')](_0x378e16[_0x4a9e('0x36')],_0x378e16[_0x4a9e('0x37')]);_0x525dd0[_0x4a9e('0x3a')]=_['intersection'](_0x378e16['model'],qs['fields'](_0x43e1ec[_0x4a9e('0x37')][_0x4a9e('0x3b')]));_0x525dd0[_0x4a9e('0x3a')]=_0x525dd0['attributes']['length']?_0x525dd0[_0x4a9e('0x3a')]:_0x378e16[_0x4a9e('0x36')];if(!_0x43e1ec[_0x4a9e('0x37')][_0x4a9e('0x3c')](_0x4a9e('0x3d'))){_0x525dd0[_0x4a9e('0x29')]=qs[_0x4a9e('0x29')](_0x43e1ec[_0x4a9e('0x37')][_0x4a9e('0x29')]);_0x525dd0['offset']=qs[_0x4a9e('0x28')](_0x43e1ec[_0x4a9e('0x37')][_0x4a9e('0x28')]);}_0x525dd0['order']=qs[_0x4a9e('0x3e')](_0x43e1ec[_0x4a9e('0x37')][_0x4a9e('0x3e')]);_0x525dd0[_0x4a9e('0x3f')]=qs[_0x4a9e('0x40')](_['pick'](_0x43e1ec['query'],_0x378e16[_0x4a9e('0x40')]));if(_0x43e1ec[_0x4a9e('0x37')][_0x4a9e('0x41')]){_0x525dd0['where']=_[_0x4a9e('0x42')](_0x525dd0[_0x4a9e('0x3f')],{'$or':_[_0x4a9e('0x31')](_0x2d1069,function(_0x5c5178){if(_0x5c5178[_0x4a9e('0x34')]!==_0x4a9e('0x43')){var _0x8ef391={};_0x8ef391[_0x5c5178['name']]={'$like':'%'+_0x43e1ec['query']['filter']+'%'};return _0x8ef391;}})});}_0x525dd0=_[_0x4a9e('0x42')]({},_0x525dd0,_0x43e1ec['options']);var _0x4eb486={'where':_0x525dd0['where']};return db['FreshsalesAccount']['count'](_0x4eb486)[_0x4a9e('0x1a')](function(_0x41530b){_0x107172[_0x4a9e('0x27')]=_0x41530b;if(_0x43e1ec[_0x4a9e('0x37')]['includeAll']){_0x525dd0['include']=[{'all':!![]}];}return db['FreshsalesAccount'][_0x4a9e('0x44')](_0x525dd0);})[_0x4a9e('0x1a')](function(_0x334376){_0x107172[_0x4a9e('0x45')]=_0x334376;return _0x107172;})[_0x4a9e('0x1a')](respondWithFilteredResult(_0x28176d,_0x525dd0))[_0x4a9e('0x46')](handleError(_0x28176d,null));};exports['show']=function(_0x56c532,_0x551f4d){var _0x570b39={'raw':![],'where':{'id':_0x56c532[_0x4a9e('0x47')]['id']}},_0x233c3e={};_0x233c3e['model']=_['keys'](db['FreshsalesAccount'][_0x4a9e('0x32')]);_0x233c3e[_0x4a9e('0x37')]=_[_0x4a9e('0x38')](_0x56c532[_0x4a9e('0x37')]);_0x233c3e[_0x4a9e('0x40')]=_[_0x4a9e('0x39')](_0x233c3e[_0x4a9e('0x36')],_0x233c3e[_0x4a9e('0x37')]);_0x570b39[_0x4a9e('0x3a')]=_[_0x4a9e('0x39')](_0x233c3e[_0x4a9e('0x36')],qs['fields'](_0x56c532['query'][_0x4a9e('0x3b')]));_0x570b39[_0x4a9e('0x3a')]=_0x570b39[_0x4a9e('0x3a')][_0x4a9e('0x48')]?_0x570b39[_0x4a9e('0x3a')]:_0x233c3e[_0x4a9e('0x36')];if(_0x56c532['query']['includeAll']){_0x570b39[_0x4a9e('0x49')]=[{'all':!![]}];}_0x570b39=_[_0x4a9e('0x42')]({},_0x570b39,_0x56c532[_0x4a9e('0x4a')]);return db['FreshsalesAccount'][_0x4a9e('0x4b')](_0x570b39)[_0x4a9e('0x1a')](handleEntityNotFound(_0x551f4d,null))[_0x4a9e('0x1a')](respondWithResult(_0x551f4d,null))[_0x4a9e('0x46')](handleError(_0x551f4d,null));};exports[_0x4a9e('0x4c')]=function(_0x9ae2c7,_0x73c037){return db[_0x4a9e('0x4d')][_0x4a9e('0x4c')](_0x9ae2c7[_0x4a9e('0x4e')],{})[_0x4a9e('0x1a')](respondWithResult(_0x73c037,0xc9))['catch'](handleError(_0x73c037,null));};exports[_0x4a9e('0x2d')]=function(_0x1520e4,_0x57f212){if(_0x1520e4[_0x4a9e('0x4e')]['id']){delete _0x1520e4[_0x4a9e('0x4e')]['id'];}return db[_0x4a9e('0x4d')]['find']({'where':{'id':_0x1520e4[_0x4a9e('0x47')]['id']}})[_0x4a9e('0x1a')](handleEntityNotFound(_0x57f212,null))['then'](saveUpdates(_0x1520e4[_0x4a9e('0x4e')],null))[_0x4a9e('0x1a')](respondWithResult(_0x57f212,null))[_0x4a9e('0x46')](handleError(_0x57f212,null));};exports[_0x4a9e('0x4f')]=function(_0x2b74fd,_0x4518ce){return db[_0x4a9e('0x4d')]['find']({'where':{'id':_0x2b74fd[_0x4a9e('0x47')]['id']}})[_0x4a9e('0x1a')](handleEntityNotFound(_0x4518ce,null))[_0x4a9e('0x1a')](removeEntity(_0x4518ce,null))[_0x4a9e('0x46')](handleError(_0x4518ce,null));};exports[_0x4a9e('0x50')]=function(_0x4af143,_0x1d524e,_0x1c5ab0){var _0xe44af2={};var _0xdc54ba={};var _0x571f7e;var _0x2adf49;return db[_0x4a9e('0x4d')]['findOne']({'where':{'id':_0x4af143[_0x4a9e('0x47')]['id']}})[_0x4a9e('0x1a')](handleEntityNotFound(_0x1d524e,null))[_0x4a9e('0x1a')](function(_0x5e3200){if(_0x5e3200){_0x571f7e=_0x5e3200;_0xdc54ba['model']=_[_0x4a9e('0x38')](db['FreshsalesConfiguration'][_0x4a9e('0x32')]);_0xdc54ba['query']=_[_0x4a9e('0x38')](_0x4af143[_0x4a9e('0x37')]);_0xdc54ba[_0x4a9e('0x40')]=_[_0x4a9e('0x39')](_0xdc54ba[_0x4a9e('0x36')],_0xdc54ba[_0x4a9e('0x37')]);_0xe44af2['attributes']=_['intersection'](_0xdc54ba['model'],qs[_0x4a9e('0x3b')](_0x4af143[_0x4a9e('0x37')][_0x4a9e('0x3b')]));_0xe44af2['attributes']=_0xe44af2[_0x4a9e('0x3a')][_0x4a9e('0x48')]?_0xe44af2[_0x4a9e('0x3a')]:_0xdc54ba[_0x4a9e('0x36')];_0xe44af2[_0x4a9e('0x51')]=qs[_0x4a9e('0x3e')](_0x4af143['query'][_0x4a9e('0x3e')]);_0xe44af2['where']=qs[_0x4a9e('0x40')](_['pick'](_0x4af143[_0x4a9e('0x37')],_0xdc54ba[_0x4a9e('0x40')]));if(_0x4af143['query'][_0x4a9e('0x41')]){_0xe44af2[_0x4a9e('0x3f')]=_[_0x4a9e('0x42')](_0xe44af2[_0x4a9e('0x3f')],{'$or':_[_0x4a9e('0x31')](_0xe44af2[_0x4a9e('0x3a')],function(_0x1d3e85){var _0x3af14d={};_0x3af14d[_0x1d3e85]={'$like':'%'+_0x4af143[_0x4a9e('0x37')][_0x4a9e('0x41')]+'%'};return _0x3af14d;})});}_0xe44af2=_[_0x4a9e('0x42')]({},_0xe44af2,_0x4af143['options']);return _0x571f7e[_0x4a9e('0x50')](_0xe44af2);}})[_0x4a9e('0x1a')](function(_0x184755){if(_0x184755){_0x2adf49=_0x184755[_0x4a9e('0x48')];if(!_0x4af143[_0x4a9e('0x37')][_0x4a9e('0x3c')](_0x4a9e('0x3d'))){_0xe44af2[_0x4a9e('0x29')]=qs[_0x4a9e('0x29')](_0x4af143[_0x4a9e('0x37')]['limit']);_0xe44af2['offset']=qs[_0x4a9e('0x28')](_0x4af143['query']['offset']);}return _0x571f7e[_0x4a9e('0x50')](_0xe44af2);}})[_0x4a9e('0x1a')](function(_0x2ccec8){if(_0x2ccec8){return _0x2ccec8?{'count':_0x2adf49,'rows':_0x2ccec8}:null;}})[_0x4a9e('0x1a')](respondWithResult(_0x1d524e,null))[_0x4a9e('0x46')](handleError(_0x1d524e,null));};exports['addConfiguration']=function(_0x7d127a,_0x157928,_0x2c68e9){if(_0x7d127a['body']['id']){delete _0x7d127a[_0x4a9e('0x4e')]['id'];}return db[_0x4a9e('0x4d')][_0x4a9e('0x52')]({'where':{'id':_0x7d127a[_0x4a9e('0x47')]['id']}})[_0x4a9e('0x1a')](handleEntityNotFound(_0x157928,null))[_0x4a9e('0x1a')](function(_0x44c91e){if(_0x44c91e){_0x7d127a['body'][_0x4a9e('0x53')]=_0x44c91e['id'];_0x7d127a[_0x4a9e('0x4e')][_0x4a9e('0x54')]=integrations['getSubjects'](_0x7d127a['body']['channel'],_0x7d127a[_0x4a9e('0x4e')][_0x4a9e('0x34')]);_0x7d127a[_0x4a9e('0x4e')][_0x4a9e('0x55')]=integrations[_0x4a9e('0x56')](_0x7d127a[_0x4a9e('0x4e')][_0x4a9e('0x57')],_0x7d127a['body'][_0x4a9e('0x34')]);return db[_0x4a9e('0x58')][_0x4a9e('0x4c')](_0x7d127a[_0x4a9e('0x4e')],{'include':[{'model':db[_0x4a9e('0x59')],'as':_0x4a9e('0x54')},{'model':db[_0x4a9e('0x59')],'as':'Descriptions'}]});}return null;})[_0x4a9e('0x1a')](respondWithResult(_0x157928,null))[_0x4a9e('0x46')](handleError(_0x157928,null));};exports[_0x4a9e('0x5a')]=function(_0x1313fd,_0x413a91,_0x9fcce7){var _0xd2eb21='';var _0x4ecb85='';return db[_0x4a9e('0x4d')][_0x4a9e('0x52')]({'where':{'id':_0x1313fd[_0x4a9e('0x47')]['id']},'attributes':['id',_0x4a9e('0x5b'),_0x4a9e('0x5c'),'apiKey']})[_0x4a9e('0x1a')](handleEntityNotFound(_0x413a91,null))[_0x4a9e('0x1a')](function(_0x2ab013){if(_0x2ab013){_0x4ecb85=_0x2ab013[_0x4a9e('0x5b')];_0xd2eb21=_0x2ab013[_0x4a9e('0x5c')];var _0x41dc88=_0x2ab013['remoteUri']['slice'](-0x1);if(_0x41dc88==='/'){_0xd2eb21=_0xd2eb21[_0x4a9e('0x5d')](0x0,_0xd2eb21['lastIndexOf'](_0x41dc88));}return rp({'method':_0x4a9e('0x5e'),'uri':util[_0x4a9e('0x5f')](_0x4a9e('0x60'),_0xd2eb21,'/api/selector/owners'),'headers':{'Authorization':_0x4a9e('0x61')+_0x2ab013[_0x4a9e('0x62')]},'json':!![]});}})[_0x4a9e('0x1a')](function(_0x1af2c3){if(_0x1af2c3){var _0x4e5180=_0x1af2c3['users'];var _0x10d520=![];var _0x1bbfa9=null;for(_0x1bbfa9=0x0;_0x1bbfa9<_0x4e5180[_0x4a9e('0x48')];_0x1bbfa9++){if(_0x4e5180[_0x1bbfa9]['email']===_0x4ecb85){_0x10d520=!![];}}if(_0x10d520){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x4a9e('0x63')});}}})[_0x4a9e('0x1a')](respondWithResult(_0x413a91,null))[_0x4a9e('0x46')](function(_0x2334b9){var _0x2eb220=_0x1313fd['query'][_0x4a9e('0x15')]?0x1f4:_0x2334b9['statusCode']||0x1f4;logger[_0x4a9e('0x1f')](_0x4a9e('0x64'),_0x4a9e('0x5a'),_0x2eb220,JSON[_0x4a9e('0x1e')](_0x2334b9));delete _0x2334b9['name'];if(_0x2eb220===0x191){_0x2eb220=0x190;}_0x413a91[_0x4a9e('0x24')](_0x2eb220)['send'](_0x1313fd[_0x4a9e('0x37')][_0x4a9e('0x15')]?{'message':_0x4a9e('0x65'),'statusCode':_0x2334b9[_0x4a9e('0x66')]}:_0x2334b9);});}; \ No newline at end of file +var _0x4e96=['../../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','FreshsalesAccount,\x20%s,\x20%s','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','order','sort','pick','filter','where','merge','options','include','FreshsalesAccount','findAll','show','params','includeAll','find','create','body','getConfigurations','findOne','FreshsalesConfiguration','length','nolimit','addConfiguration','Subjects','getSubjects','FreshsalesField','Descriptions','getFields','username','apiKey','remoteUri','slice','substring','GET','/api/selector/owners','Token\x20token=','users','Requested\x20Resource\x20not\x20Found','statusCode','Wrong\x20credentials','eml-format','rimraf','moment','bluebird','mustache','util','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','api'];(function(_0x1fd563,_0x196466){var _0x4673f3=function(_0x15e015){while(--_0x15e015){_0x1fd563['push'](_0x1fd563['shift']());}};_0x4673f3(++_0x196466);}(_0x4e96,0xca));var _0x64e9=function(_0x442b84,_0x3ebf7f){_0x442b84=_0x442b84-0x0;var _0x2a9b10=_0x4e96[_0x442b84];return _0x2a9b10;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x64e9('0x0'));var rimraf=require(_0x64e9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x64e9('0x2'));var BPromise=require(_0x64e9('0x3'));var Mustache=require(_0x64e9('0x4'));var util=require(_0x64e9('0x5'));var path=require(_0x64e9('0x6'));var sox=require(_0x64e9('0x7'));var csv=require(_0x64e9('0x8'));var ejs=require(_0x64e9('0x9'));var fs=require('fs');var _=require(_0x64e9('0xa'));var squel=require('squel');var crypto=require(_0x64e9('0xb'));var jsforce=require(_0x64e9('0xc'));var deskjs=require(_0x64e9('0xd'));var toCsv=require(_0x64e9('0x8'));var querystring=require(_0x64e9('0xe'));var Papa=require(_0x64e9('0xf'));var Redis=require(_0x64e9('0x10'));var authService=require(_0x64e9('0x11'));var qs=require(_0x64e9('0x12'));var as=require(_0x64e9('0x13'));var hardwareService=require(_0x64e9('0x14'));var logger=require('../../config/logger')(_0x64e9('0x15'));var utils=require(_0x64e9('0x16'));var config=require(_0x64e9('0x17'));var db=require(_0x64e9('0x18'))['db'];var integrations=require(_0x64e9('0x19'));var jayson=require(_0x64e9('0x1a'));var client=jayson[_0x64e9('0x1b')][_0x64e9('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x43e269,_0x27827d,_0x19958b){if(_0x19958b){var _0x2fcae2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2fcae2[_0x64e9('0x1d')](_0x27827d)){return _0x43e269;}else{throw new db[(_0x64e9('0x1e'))][(_0x64e9('0x1f'))](_0x64e9('0x20'));}}else{return _0x43e269;}}function respondWithRpcPromise(_0x426c16,_0x308c2d,_0x5c2ae7,_0x450c8e){return new BPromise(function(_0x66fa8a,_0x53d80c){var _0x44c16b=_0x450c8e||client;return _0x44c16b[_0x64e9('0x21')](_0x426c16,_0x5c2ae7)[_0x64e9('0x22')](function(_0x511e36){logger[_0x64e9('0x23')](_0x64e9('0x24'),_0x308c2d,'request\x20sent');logger[_0x64e9('0x25')](_0x64e9('0x26'),_0x308c2d,_0x64e9('0x27'),JSON[_0x64e9('0x28')](_0x511e36));if(_0x511e36['error']){if(_0x511e36[_0x64e9('0x29')]['code']===0x1f4){logger[_0x64e9('0x29')](_0x64e9('0x24'),_0x308c2d,_0x511e36[_0x64e9('0x29')][_0x64e9('0x2a')]);return _0x53d80c(_0x511e36[_0x64e9('0x29')]['message']);}logger[_0x64e9('0x29')](_0x64e9('0x24'),_0x308c2d,_0x511e36['error']['message']);return _0x66fa8a(_0x511e36[_0x64e9('0x29')][_0x64e9('0x2a')]);}else{logger[_0x64e9('0x23')](_0x64e9('0x24'),_0x308c2d,_0x64e9('0x27'));_0x66fa8a(_0x511e36[_0x64e9('0x2b')]['message']);}})[_0x64e9('0x2c')](function(_0x3ae494){logger['error']('FreshsalesAccount,\x20%s,\x20%s',_0x308c2d,_0x3ae494);_0x53d80c(_0x3ae494);});});}function respondWithStatusCode(_0x3a1c54,_0x5e9fea){_0x5e9fea=_0x5e9fea||0xcc;return function(_0x3e85f3){if(_0x3e85f3){return _0x3a1c54['sendStatus'](_0x5e9fea);}return _0x3a1c54[_0x64e9('0x2d')](_0x5e9fea)[_0x64e9('0x2e')]();};}function respondWithResult(_0x443e47,_0x3250e4){_0x3250e4=_0x3250e4||0xc8;return function(_0x55065d){if(_0x55065d){return _0x443e47[_0x64e9('0x2d')](_0x3250e4)[_0x64e9('0x2f')](_0x55065d);}};}function respondWithFilteredResult(_0x1ce875,_0x52ae82){return function(_0x1e8df4){if(_0x1e8df4){var _0x3d38c1=_0x1e8df4[_0x64e9('0x30')],_0x1fd3e5=_0x52ae82[_0x64e9('0x31')],_0x39e2ce=_0x52ae82['offset']+_0x52ae82[_0x64e9('0x32')],_0x4c90b2;if(_0x39e2ce>=_0x3d38c1){_0x39e2ce=_0x3d38c1;_0x4c90b2=0xc8;}else{_0x4c90b2=0xce;}_0x1ce875[_0x64e9('0x2d')](_0x4c90b2);return _0x1ce875[_0x64e9('0x33')](_0x64e9('0x34'),_0x1fd3e5+'-'+_0x39e2ce+'/'+_0x3d38c1)[_0x64e9('0x2f')](_0x1e8df4);}return null;};}function patchUpdates(_0x1ae6f9){return function(_0x3220c4){try{jsonpatch['apply'](_0x3220c4,_0x1ae6f9,!![]);}catch(_0x266ae1){return BPromise[_0x64e9('0x35')](_0x266ae1);}return _0x3220c4[_0x64e9('0x36')]();};}function saveUpdates(_0xe2157b,_0x38d7ce){return function(_0x2c6b42){if(_0x2c6b42){return _0x2c6b42[_0x64e9('0x37')](_0xe2157b)[_0x64e9('0x22')](function(_0x34518c){return _0x34518c;});}return null;};}function removeEntity(_0x3b282f,_0x20cb40){return function(_0x2c8f3c){if(_0x2c8f3c){return _0x2c8f3c['destroy']()['then'](function(){_0x3b282f['status'](0xcc)[_0x64e9('0x2e')]();});}};}function handleEntityNotFound(_0x2c0651,_0x389cb1){return function(_0x2d8061){if(!_0x2d8061){_0x2c0651[_0x64e9('0x38')](0x194);}return _0x2d8061;};}function handleError(_0x46be97,_0x5cb803){_0x5cb803=_0x5cb803||0x1f4;return function(_0x4a7e90){logger[_0x64e9('0x29')](_0x4a7e90[_0x64e9('0x39')]);if(_0x4a7e90[_0x64e9('0x3a')]){delete _0x4a7e90[_0x64e9('0x3a')];}_0x46be97[_0x64e9('0x2d')](_0x5cb803)[_0x64e9('0x3b')](_0x4a7e90);};}exports[_0x64e9('0x3c')]=function(_0x4d3c06,_0x1fd782){var _0x4f1742={},_0x3a50c7={},_0x4a6b1c={'count':0x0,'rows':[]};var _0x4f3088=_[_0x64e9('0x3d')](db['FreshsalesAccount'][_0x64e9('0x3e')],function(_0x7998db){return{'name':_0x7998db[_0x64e9('0x3f')],'type':_0x7998db[_0x64e9('0x40')]['key']};});_0x3a50c7['model']=_[_0x64e9('0x3d')](_0x4f3088,'name');_0x3a50c7[_0x64e9('0x41')]=_[_0x64e9('0x42')](_0x4d3c06[_0x64e9('0x41')]);_0x3a50c7[_0x64e9('0x43')]=_[_0x64e9('0x44')](_0x3a50c7['model'],_0x3a50c7[_0x64e9('0x41')]);_0x4f1742['attributes']=_[_0x64e9('0x44')](_0x3a50c7[_0x64e9('0x45')],qs[_0x64e9('0x46')](_0x4d3c06[_0x64e9('0x41')][_0x64e9('0x46')]));_0x4f1742[_0x64e9('0x47')]=_0x4f1742[_0x64e9('0x47')]['length']?_0x4f1742['attributes']:_0x3a50c7[_0x64e9('0x45')];if(!_0x4d3c06[_0x64e9('0x41')][_0x64e9('0x48')]('nolimit')){_0x4f1742['limit']=qs[_0x64e9('0x32')](_0x4d3c06[_0x64e9('0x41')]['limit']);_0x4f1742['offset']=qs[_0x64e9('0x31')](_0x4d3c06[_0x64e9('0x41')][_0x64e9('0x31')]);}_0x4f1742[_0x64e9('0x49')]=qs['sort'](_0x4d3c06['query'][_0x64e9('0x4a')]);_0x4f1742['where']=qs[_0x64e9('0x43')](_[_0x64e9('0x4b')](_0x4d3c06[_0x64e9('0x41')],_0x3a50c7['filters']));if(_0x4d3c06[_0x64e9('0x41')][_0x64e9('0x4c')]){_0x4f1742[_0x64e9('0x4d')]=_[_0x64e9('0x4e')](_0x4f1742[_0x64e9('0x4d')],{'$or':_[_0x64e9('0x3d')](_0x4f3088,function(_0x22be82){if(_0x22be82[_0x64e9('0x40')]!=='VIRTUAL'){var _0x108694={};_0x108694[_0x22be82[_0x64e9('0x3a')]]={'$like':'%'+_0x4d3c06[_0x64e9('0x41')][_0x64e9('0x4c')]+'%'};return _0x108694;}})});}_0x4f1742=_[_0x64e9('0x4e')]({},_0x4f1742,_0x4d3c06[_0x64e9('0x4f')]);var _0x17bad7={'where':_0x4f1742[_0x64e9('0x4d')]};return db['FreshsalesAccount']['count'](_0x17bad7)['then'](function(_0x104eb0){_0x4a6b1c['count']=_0x104eb0;if(_0x4d3c06[_0x64e9('0x41')]['includeAll']){_0x4f1742[_0x64e9('0x50')]=[{'all':!![]}];}return db[_0x64e9('0x51')][_0x64e9('0x52')](_0x4f1742);})[_0x64e9('0x22')](function(_0x17dfb2){_0x4a6b1c['rows']=_0x17dfb2;return _0x4a6b1c;})['then'](respondWithFilteredResult(_0x1fd782,_0x4f1742))[_0x64e9('0x2c')](handleError(_0x1fd782,null));};exports[_0x64e9('0x53')]=function(_0x23a365,_0x4574ce){var _0xfaf26e={'raw':![],'where':{'id':_0x23a365[_0x64e9('0x54')]['id']}},_0x595fb8={};_0x595fb8[_0x64e9('0x45')]=_[_0x64e9('0x42')](db[_0x64e9('0x51')][_0x64e9('0x3e')]);_0x595fb8[_0x64e9('0x41')]=_[_0x64e9('0x42')](_0x23a365[_0x64e9('0x41')]);_0x595fb8['filters']=_[_0x64e9('0x44')](_0x595fb8['model'],_0x595fb8['query']);_0xfaf26e[_0x64e9('0x47')]=_['intersection'](_0x595fb8[_0x64e9('0x45')],qs[_0x64e9('0x46')](_0x23a365['query'][_0x64e9('0x46')]));_0xfaf26e['attributes']=_0xfaf26e[_0x64e9('0x47')]['length']?_0xfaf26e['attributes']:_0x595fb8['model'];if(_0x23a365[_0x64e9('0x41')][_0x64e9('0x55')]){_0xfaf26e['include']=[{'all':!![]}];}_0xfaf26e=_[_0x64e9('0x4e')]({},_0xfaf26e,_0x23a365[_0x64e9('0x4f')]);return db[_0x64e9('0x51')][_0x64e9('0x56')](_0xfaf26e)['then'](handleEntityNotFound(_0x4574ce,null))[_0x64e9('0x22')](respondWithResult(_0x4574ce,null))['catch'](handleError(_0x4574ce,null));};exports[_0x64e9('0x57')]=function(_0x4a9112,_0x857fd2){return db[_0x64e9('0x51')][_0x64e9('0x57')](_0x4a9112[_0x64e9('0x58')],{})[_0x64e9('0x22')](respondWithResult(_0x857fd2,0xc9))[_0x64e9('0x2c')](handleError(_0x857fd2,null));};exports[_0x64e9('0x37')]=function(_0x311a0e,_0x4d9e6a){if(_0x311a0e[_0x64e9('0x58')]['id']){delete _0x311a0e[_0x64e9('0x58')]['id'];}return db[_0x64e9('0x51')]['find']({'where':{'id':_0x311a0e['params']['id']}})['then'](handleEntityNotFound(_0x4d9e6a,null))[_0x64e9('0x22')](saveUpdates(_0x311a0e[_0x64e9('0x58')],null))[_0x64e9('0x22')](respondWithResult(_0x4d9e6a,null))[_0x64e9('0x2c')](handleError(_0x4d9e6a,null));};exports['destroy']=function(_0x2b582c,_0x5991e1){return db['FreshsalesAccount']['find']({'where':{'id':_0x2b582c[_0x64e9('0x54')]['id']}})['then'](handleEntityNotFound(_0x5991e1,null))['then'](removeEntity(_0x5991e1,null))[_0x64e9('0x2c')](handleError(_0x5991e1,null));};exports[_0x64e9('0x59')]=function(_0x12c21d,_0x4f05f8,_0x5489f3){var _0x5144c1={};var _0x3ff2bd={};var _0x4ee2f1;var _0x4753ff;return db[_0x64e9('0x51')][_0x64e9('0x5a')]({'where':{'id':_0x12c21d[_0x64e9('0x54')]['id']}})[_0x64e9('0x22')](handleEntityNotFound(_0x4f05f8,null))[_0x64e9('0x22')](function(_0x59f8e4){if(_0x59f8e4){_0x4ee2f1=_0x59f8e4;_0x3ff2bd['model']=_[_0x64e9('0x42')](db[_0x64e9('0x5b')][_0x64e9('0x3e')]);_0x3ff2bd[_0x64e9('0x41')]=_[_0x64e9('0x42')](_0x12c21d[_0x64e9('0x41')]);_0x3ff2bd[_0x64e9('0x43')]=_[_0x64e9('0x44')](_0x3ff2bd[_0x64e9('0x45')],_0x3ff2bd['query']);_0x5144c1[_0x64e9('0x47')]=_[_0x64e9('0x44')](_0x3ff2bd[_0x64e9('0x45')],qs[_0x64e9('0x46')](_0x12c21d['query'][_0x64e9('0x46')]));_0x5144c1['attributes']=_0x5144c1[_0x64e9('0x47')][_0x64e9('0x5c')]?_0x5144c1[_0x64e9('0x47')]:_0x3ff2bd[_0x64e9('0x45')];_0x5144c1['order']=qs[_0x64e9('0x4a')](_0x12c21d[_0x64e9('0x41')]['sort']);_0x5144c1['where']=qs[_0x64e9('0x43')](_[_0x64e9('0x4b')](_0x12c21d[_0x64e9('0x41')],_0x3ff2bd[_0x64e9('0x43')]));if(_0x12c21d[_0x64e9('0x41')]['filter']){_0x5144c1[_0x64e9('0x4d')]=_[_0x64e9('0x4e')](_0x5144c1[_0x64e9('0x4d')],{'$or':_[_0x64e9('0x3d')](_0x5144c1[_0x64e9('0x47')],function(_0x4cf98b){var _0x5d7934={};_0x5d7934[_0x4cf98b]={'$like':'%'+_0x12c21d['query'][_0x64e9('0x4c')]+'%'};return _0x5d7934;})});}_0x5144c1=_[_0x64e9('0x4e')]({},_0x5144c1,_0x12c21d[_0x64e9('0x4f')]);return _0x4ee2f1[_0x64e9('0x59')](_0x5144c1);}})['then'](function(_0x4ab083){if(_0x4ab083){_0x4753ff=_0x4ab083[_0x64e9('0x5c')];if(!_0x12c21d['query'][_0x64e9('0x48')](_0x64e9('0x5d'))){_0x5144c1['limit']=qs[_0x64e9('0x32')](_0x12c21d[_0x64e9('0x41')]['limit']);_0x5144c1[_0x64e9('0x31')]=qs['offset'](_0x12c21d[_0x64e9('0x41')][_0x64e9('0x31')]);}return _0x4ee2f1[_0x64e9('0x59')](_0x5144c1);}})['then'](function(_0x2933ad){if(_0x2933ad){return _0x2933ad?{'count':_0x4753ff,'rows':_0x2933ad}:null;}})[_0x64e9('0x22')](respondWithResult(_0x4f05f8,null))[_0x64e9('0x2c')](handleError(_0x4f05f8,null));};exports[_0x64e9('0x5e')]=function(_0x527bc6,_0x1076a6,_0x4394c1){if(_0x527bc6[_0x64e9('0x58')]['id']){delete _0x527bc6[_0x64e9('0x58')]['id'];}return db[_0x64e9('0x51')][_0x64e9('0x5a')]({'where':{'id':_0x527bc6[_0x64e9('0x54')]['id']}})[_0x64e9('0x22')](handleEntityNotFound(_0x1076a6,null))[_0x64e9('0x22')](function(_0x3f068e){if(_0x3f068e){_0x527bc6[_0x64e9('0x58')]['AccountId']=_0x3f068e['id'];_0x527bc6[_0x64e9('0x58')][_0x64e9('0x5f')]=integrations[_0x64e9('0x60')](_0x527bc6[_0x64e9('0x58')]['channel'],_0x527bc6[_0x64e9('0x58')][_0x64e9('0x40')]);_0x527bc6[_0x64e9('0x58')]['Descriptions']=integrations['getDescriptions'](_0x527bc6[_0x64e9('0x58')]['channel'],_0x527bc6['body'][_0x64e9('0x40')]);return db[_0x64e9('0x5b')][_0x64e9('0x57')](_0x527bc6[_0x64e9('0x58')],{'include':[{'model':db[_0x64e9('0x61')],'as':_0x64e9('0x5f')},{'model':db['FreshsalesField'],'as':_0x64e9('0x62')}]});}return null;})[_0x64e9('0x22')](respondWithResult(_0x1076a6,null))[_0x64e9('0x2c')](handleError(_0x1076a6,null));};exports[_0x64e9('0x63')]=function(_0x3d1cfe,_0x229669,_0x8795e1){var _0x2e8c0e='';var _0x339250='';return db[_0x64e9('0x51')][_0x64e9('0x5a')]({'where':{'id':_0x3d1cfe[_0x64e9('0x54')]['id']},'attributes':['id',_0x64e9('0x64'),'remoteUri',_0x64e9('0x65')]})[_0x64e9('0x22')](handleEntityNotFound(_0x229669,null))[_0x64e9('0x22')](function(_0x57361c){if(_0x57361c){_0x339250=_0x57361c[_0x64e9('0x64')];_0x2e8c0e=_0x57361c['remoteUri'];var _0x22560c=_0x57361c[_0x64e9('0x66')][_0x64e9('0x67')](-0x1);if(_0x22560c==='/'){_0x2e8c0e=_0x2e8c0e[_0x64e9('0x68')](0x0,_0x2e8c0e['lastIndexOf'](_0x22560c));}return rp({'method':_0x64e9('0x69'),'uri':util['format']('%s%s',_0x2e8c0e,_0x64e9('0x6a')),'headers':{'Authorization':_0x64e9('0x6b')+_0x57361c[_0x64e9('0x65')]},'json':!![]});}})[_0x64e9('0x22')](function(_0x10ccfc){if(_0x10ccfc){var _0x19010d=_0x10ccfc[_0x64e9('0x6c')];var _0x402317=![];var _0x575847=null;for(_0x575847=0x0;_0x575847<_0x19010d['length'];_0x575847++){if(_0x19010d[_0x575847]['email']===_0x339250){_0x402317=!![];}}if(_0x402317){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x64e9('0x6d')});}}})[_0x64e9('0x22')](respondWithResult(_0x229669,null))[_0x64e9('0x2c')](function(_0x261efc){var _0x175350=_0x3d1cfe[_0x64e9('0x41')][_0x64e9('0x1d')]?0x1f4:_0x261efc[_0x64e9('0x6e')]||0x1f4;logger[_0x64e9('0x29')]('getFields,\x20%s,\x20%s,\x20%s',_0x64e9('0x63'),_0x175350,JSON[_0x64e9('0x28')](_0x261efc));delete _0x261efc[_0x64e9('0x3a')];if(_0x175350===0x191){_0x175350=0x190;}_0x229669['status'](_0x175350)['send'](_0x3d1cfe[_0x64e9('0x41')]['test']?{'message':_0x64e9('0x6f'),'statusCode':_0x261efc[_0x64e9('0x6e')]}:_0x261efc);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index d2268c0..4e20d40 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 _0xe31a=['./intFreshsalesAccount.attributes','../../components/integrations/configuration','define','FreshsalesAccount','int_freshsales_accounts','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x328d98,_0x4a34a3){var _0x188eb5=function(_0x3133dd){while(--_0x3133dd){_0x328d98['push'](_0x328d98['shift']());}};_0x188eb5(++_0x4a34a3);}(_0xe31a,0x87));var _0xae31=function(_0x411017,_0x4a8117){_0x411017=_0x411017-0x0;var _0x2adeea=_0xe31a[_0x411017];return _0x2adeea;};'use strict';var _=require(_0xae31('0x0'));var util=require(_0xae31('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xae31('0x2'));var BPromise=require(_0xae31('0x3'));var rp=require(_0xae31('0x4'));var fs=require('fs');var path=require(_0xae31('0x5'));var rimraf=require(_0xae31('0x6'));var config=require(_0xae31('0x7'));var attributes=require(_0xae31('0x8'));var integrations=require(_0xae31('0x9'));module['exports']=function(_0x2e494e,_0x35227c){return _0x2e494e[_0xae31('0xa')](_0xae31('0xb'),attributes,{'tableName':_0xae31('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9f89=['./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','int_freshsales_accounts','util','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x387dc1,_0x3ba649){var _0x17567c=function(_0x4690aa){while(--_0x4690aa){_0x387dc1['push'](_0x387dc1['shift']());}};_0x17567c(++_0x3ba649);}(_0x9f89,0x13d));var _0x99f8=function(_0x4dffcd,_0x5148b9){_0x4dffcd=_0x4dffcd-0x0;var _0x3a70f0=_0x9f89[_0x4dffcd];return _0x3a70f0;};'use strict';var _=require('lodash');var util=require(_0x99f8('0x0'));var logger=require('../../config/logger')(_0x99f8('0x1'));var moment=require(_0x99f8('0x2'));var BPromise=require(_0x99f8('0x3'));var rp=require(_0x99f8('0x4'));var fs=require('fs');var path=require(_0x99f8('0x5'));var rimraf=require('rimraf');var config=require(_0x99f8('0x6'));var attributes=require(_0x99f8('0x7'));var integrations=require(_0x99f8('0x8'));module[_0x99f8('0x9')]=function(_0x153726,_0x24c45f){return _0x153726[_0x99f8('0xa')]('FreshsalesAccount',attributes,{'tableName':_0x99f8('0xb'),'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 962a870..84595f2 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 _0xfd58=['info','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','attributes','map','include','model','ShowFreshsalesAccount','find','raw','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','request\x20sent','debug','stringify','error','code','FreshsalesAccount,\x20%s,\x20%s','message'];(function(_0x296c49,_0x43510a){var _0x219a06=function(_0x278948){while(--_0x278948){_0x296c49['push'](_0x296c49['shift']());}};_0x219a06(++_0x43510a);}(_0xfd58,0xb3));var _0x8fd5=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xfd58[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x8fd5('0x0'));var util=require(_0x8fd5('0x1'));var moment=require('moment');var BPromise=require(_0x8fd5('0x2'));var rs=require(_0x8fd5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8fd5('0x4'))['db'];var utils=require(_0x8fd5('0x5'));var logger=require(_0x8fd5('0x6'))(_0x8fd5('0x7'));var config=require('../../config/environment');var jayson=require(_0x8fd5('0x8'));var client=jayson[_0x8fd5('0x9')][_0x8fd5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4e10e4,_0x16ac3f,_0x32bad9){return new BPromise(function(_0x273344,_0x1042a1){return client[_0x8fd5('0xb')](_0x4e10e4,_0x32bad9)['then'](function(_0x462ac4){logger['info']('FreshsalesAccount,\x20%s,\x20%s',_0x16ac3f,_0x8fd5('0xc'));logger[_0x8fd5('0xd')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x16ac3f,_0x8fd5('0xc'),JSON[_0x8fd5('0xe')](_0x462ac4));if(_0x462ac4['error']){if(_0x462ac4[_0x8fd5('0xf')][_0x8fd5('0x10')]===0x1f4){logger['error'](_0x8fd5('0x11'),_0x16ac3f,_0x462ac4[_0x8fd5('0xf')][_0x8fd5('0x12')]);return _0x1042a1(_0x462ac4[_0x8fd5('0xf')]['message']);}logger['error']('FreshsalesAccount,\x20%s,\x20%s',_0x16ac3f,_0x462ac4[_0x8fd5('0xf')][_0x8fd5('0x12')]);return _0x273344(_0x462ac4[_0x8fd5('0xf')][_0x8fd5('0x12')]);}else{logger[_0x8fd5('0x13')](_0x8fd5('0x11'),_0x16ac3f,_0x8fd5('0xc'));_0x273344(_0x462ac4[_0x8fd5('0x14')][_0x8fd5('0x12')]);}})[_0x8fd5('0x15')](function(_0x53b2dd){logger[_0x8fd5('0xf')](_0x8fd5('0x11'),_0x16ac3f,_0x53b2dd);_0x1042a1(_0x53b2dd);});});}exports[_0x8fd5('0x16')]=function(_0x4ab4ec){var _0x4e8e9d=this;return new Promise(function(_0x5daea6,_0x8509c8){return db[_0x8fd5('0x17')][_0x8fd5('0x18')]({'raw':_0x4ab4ec[_0x8fd5('0x19')]?_0x4ab4ec[_0x8fd5('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x4ab4ec['options']?_0x4ab4ec[_0x8fd5('0x19')]['where']||null:null,'attributes':_0x4ab4ec[_0x8fd5('0x19')]?_0x4ab4ec[_0x8fd5('0x19')][_0x8fd5('0x1a')]||null:null,'limit':_0x4ab4ec[_0x8fd5('0x19')]?_0x4ab4ec['options']['limit']||null:null,'include':_0x4ab4ec['options']?_0x4ab4ec[_0x8fd5('0x19')]['include']?_[_0x8fd5('0x1b')](_0x4ab4ec[_0x8fd5('0x19')][_0x8fd5('0x1c')],function(_0x6b7da9){return{'model':db[_0x6b7da9['model']],'as':_0x6b7da9['as'],'attributes':_0x6b7da9[_0x8fd5('0x1a')],'include':_0x6b7da9[_0x8fd5('0x1c')]?_[_0x8fd5('0x1b')](_0x6b7da9[_0x8fd5('0x1c')],function(_0xef4623){return{'model':db[_0xef4623['model']],'as':_0xef4623['as'],'attributes':_0xef4623[_0x8fd5('0x1a')],'include':_0xef4623[_0x8fd5('0x1c')]?_[_0x8fd5('0x1b')](_0xef4623['include'],function(_0x5dd206){return{'model':db[_0x5dd206[_0x8fd5('0x1d')]],'as':_0x5dd206['as'],'attributes':_0x5dd206[_0x8fd5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x17928e){logger[_0x8fd5('0x13')](_0x8fd5('0x16'),_0x4ab4ec);logger[_0x8fd5('0xd')]('GetFreshsalesAccount',_0x4ab4ec,JSON[_0x8fd5('0xe')](_0x17928e));_0x5daea6(_0x17928e);})[_0x8fd5('0x15')](function(_0x4906f1){logger[_0x8fd5('0xf')](_0x8fd5('0x16'),_0x4906f1[_0x8fd5('0x12')],_0x4ab4ec);_0x8509c8(_0x4e8e9d[_0x8fd5('0xf')](0x1f4,_0x4906f1[_0x8fd5('0x12')]));});});};exports[_0x8fd5('0x1e')]=function(_0x56fe65){var _0x266798=this;return new Promise(function(_0x2ce9c9,_0x1c1565){return db['FreshsalesAccount'][_0x8fd5('0x1f')]({'raw':_0x56fe65[_0x8fd5('0x19')]?_0x56fe65[_0x8fd5('0x19')][_0x8fd5('0x20')]===undefined?!![]:![]:!![],'where':_0x56fe65['options']?_0x56fe65['options']['where']||null:null,'attributes':_0x56fe65['options']?_0x56fe65[_0x8fd5('0x19')][_0x8fd5('0x1a')]||null:null,'include':_0x56fe65[_0x8fd5('0x19')]?_0x56fe65[_0x8fd5('0x19')]['include']?_[_0x8fd5('0x1b')](_0x56fe65[_0x8fd5('0x19')][_0x8fd5('0x1c')],function(_0x44729f){return{'model':db[_0x44729f[_0x8fd5('0x1d')]],'as':_0x44729f['as'],'attributes':_0x44729f['attributes'],'include':_0x44729f[_0x8fd5('0x1c')]?_[_0x8fd5('0x1b')](_0x44729f[_0x8fd5('0x1c')],function(_0x35cadd){return{'model':db[_0x35cadd[_0x8fd5('0x1d')]],'as':_0x35cadd['as'],'attributes':_0x35cadd[_0x8fd5('0x1a')],'include':_0x35cadd[_0x8fd5('0x1c')]?_[_0x8fd5('0x1b')](_0x35cadd[_0x8fd5('0x1c')],function(_0xbaa71f){return{'model':db[_0xbaa71f['model']],'as':_0xbaa71f['as'],'attributes':_0xbaa71f[_0x8fd5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x369969){logger[_0x8fd5('0x13')](_0x8fd5('0x1e'),_0x56fe65);logger[_0x8fd5('0xd')](_0x8fd5('0x1e'),_0x56fe65,JSON[_0x8fd5('0xe')](_0x369969));_0x2ce9c9(_0x369969);})['catch'](function(_0x357ef7){logger[_0x8fd5('0xf')]('ShowFreshsalesAccount',_0x357ef7['message'],_0x56fe65);_0x1c1565(_0x266798['error'](0x1f4,_0x357ef7[_0x8fd5('0x12')]));});});}; \ No newline at end of file +var _0xd117=['message','request\x20sent','catch','FreshsalesAccount','options','raw','where','attributes','limit','map','include','model','GetFreshsalesAccount','ShowFreshsalesAccount','find','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','FreshsalesAccount,\x20%s,\x20%s','debug','stringify','code','error'];(function(_0x231f13,_0x273e08){var _0x3b9f91=function(_0x30fd90){while(--_0x30fd90){_0x231f13['push'](_0x231f13['shift']());}};_0x3b9f91(++_0x273e08);}(_0xd117,0x182));var _0x7d11=function(_0x3bbd2d,_0xf8ba3c){_0x3bbd2d=_0x3bbd2d-0x0;var _0x241bd4=_0xd117[_0x3bbd2d];return _0x241bd4;};'use strict';var _=require(_0x7d11('0x0'));var util=require(_0x7d11('0x1'));var moment=require(_0x7d11('0x2'));var BPromise=require(_0x7d11('0x3'));var rs=require(_0x7d11('0x4'));var fs=require('fs');var Redis=require(_0x7d11('0x5'));var db=require(_0x7d11('0x6'))['db'];var utils=require(_0x7d11('0x7'));var logger=require(_0x7d11('0x8'))(_0x7d11('0x9'));var config=require(_0x7d11('0xa'));var jayson=require(_0x7d11('0xb'));var client=jayson[_0x7d11('0xc')][_0x7d11('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x345602,_0x3c8d66,_0x47b5e6){return new BPromise(function(_0x3803b5,_0xffd020){return client[_0x7d11('0xe')](_0x345602,_0x47b5e6)['then'](function(_0x305eef){logger[_0x7d11('0xf')](_0x7d11('0x10'),_0x3c8d66,'request\x20sent');logger[_0x7d11('0x11')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x3c8d66,'request\x20sent',JSON[_0x7d11('0x12')](_0x305eef));if(_0x305eef['error']){if(_0x305eef['error'][_0x7d11('0x13')]===0x1f4){logger['error'](_0x7d11('0x10'),_0x3c8d66,_0x305eef[_0x7d11('0x14')]['message']);return _0xffd020(_0x305eef[_0x7d11('0x14')][_0x7d11('0x15')]);}logger['error'](_0x7d11('0x10'),_0x3c8d66,_0x305eef[_0x7d11('0x14')][_0x7d11('0x15')]);return _0x3803b5(_0x305eef[_0x7d11('0x14')][_0x7d11('0x15')]);}else{logger[_0x7d11('0xf')](_0x7d11('0x10'),_0x3c8d66,_0x7d11('0x16'));_0x3803b5(_0x305eef['result'][_0x7d11('0x15')]);}})[_0x7d11('0x17')](function(_0x169733){logger[_0x7d11('0x14')](_0x7d11('0x10'),_0x3c8d66,_0x169733);_0xffd020(_0x169733);});});}exports['GetFreshsalesAccount']=function(_0x456cb9){var _0x49a34b=this;return new Promise(function(_0x4d1306,_0x5459df){return db[_0x7d11('0x18')]['findAll']({'raw':_0x456cb9[_0x7d11('0x19')]?_0x456cb9['options'][_0x7d11('0x1a')]===undefined?!![]:![]:!![],'where':_0x456cb9[_0x7d11('0x19')]?_0x456cb9[_0x7d11('0x19')][_0x7d11('0x1b')]||null:null,'attributes':_0x456cb9[_0x7d11('0x19')]?_0x456cb9[_0x7d11('0x19')][_0x7d11('0x1c')]||null:null,'limit':_0x456cb9[_0x7d11('0x19')]?_0x456cb9['options'][_0x7d11('0x1d')]||null:null,'include':_0x456cb9['options']?_0x456cb9['options']['include']?_[_0x7d11('0x1e')](_0x456cb9[_0x7d11('0x19')][_0x7d11('0x1f')],function(_0x1a7853){return{'model':db[_0x1a7853[_0x7d11('0x20')]],'as':_0x1a7853['as'],'attributes':_0x1a7853[_0x7d11('0x1c')],'include':_0x1a7853[_0x7d11('0x1f')]?_[_0x7d11('0x1e')](_0x1a7853['include'],function(_0x36c2b4){return{'model':db[_0x36c2b4['model']],'as':_0x36c2b4['as'],'attributes':_0x36c2b4['attributes'],'include':_0x36c2b4['include']?_[_0x7d11('0x1e')](_0x36c2b4['include'],function(_0x180e1e){return{'model':db[_0x180e1e[_0x7d11('0x20')]],'as':_0x180e1e['as'],'attributes':_0x180e1e[_0x7d11('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x46f76a){logger[_0x7d11('0xf')](_0x7d11('0x21'),_0x456cb9);logger['debug'](_0x7d11('0x21'),_0x456cb9,JSON[_0x7d11('0x12')](_0x46f76a));_0x4d1306(_0x46f76a);})[_0x7d11('0x17')](function(_0x38f1be){logger['error'](_0x7d11('0x21'),_0x38f1be['message'],_0x456cb9);_0x5459df(_0x49a34b[_0x7d11('0x14')](0x1f4,_0x38f1be['message']));});});};exports[_0x7d11('0x22')]=function(_0xba4e80){var _0x1e32f6=this;return new Promise(function(_0x4831ed,_0x5e721f){return db[_0x7d11('0x18')][_0x7d11('0x23')]({'raw':_0xba4e80['options']?_0xba4e80[_0x7d11('0x19')][_0x7d11('0x1a')]===undefined?!![]:![]:!![],'where':_0xba4e80[_0x7d11('0x19')]?_0xba4e80['options'][_0x7d11('0x1b')]||null:null,'attributes':_0xba4e80['options']?_0xba4e80['options'][_0x7d11('0x1c')]||null:null,'include':_0xba4e80['options']?_0xba4e80[_0x7d11('0x19')][_0x7d11('0x1f')]?_[_0x7d11('0x1e')](_0xba4e80[_0x7d11('0x19')]['include'],function(_0x11d9e2){return{'model':db[_0x11d9e2[_0x7d11('0x20')]],'as':_0x11d9e2['as'],'attributes':_0x11d9e2['attributes'],'include':_0x11d9e2['include']?_[_0x7d11('0x1e')](_0x11d9e2[_0x7d11('0x1f')],function(_0x5b7d3a){return{'model':db[_0x5b7d3a[_0x7d11('0x20')]],'as':_0x5b7d3a['as'],'attributes':_0x5b7d3a['attributes'],'include':_0x5b7d3a['include']?_[_0x7d11('0x1e')](_0x5b7d3a['include'],function(_0x4e53be){return{'model':db[_0x4e53be[_0x7d11('0x20')]],'as':_0x4e53be['as'],'attributes':_0x4e53be[_0x7d11('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x7d11('0x24')](function(_0x2e426b){logger[_0x7d11('0xf')](_0x7d11('0x22'),_0xba4e80);logger[_0x7d11('0x11')](_0x7d11('0x22'),_0xba4e80,JSON[_0x7d11('0x12')](_0x2e426b));_0x4831ed(_0x2e426b);})[_0x7d11('0x17')](function(_0x1a9f18){logger[_0x7d11('0x14')]('ShowFreshsalesAccount',_0x1a9f18[_0x7d11('0x15')],_0xba4e80);_0x5e721f(_0x1e32f6['error'](0x1f4,_0x1a9f18[_0x7d11('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 9b4366b..886d775 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 _0x7e33=['../../components/auth/service','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','show','/:id/subjects','/:id/descriptions','getDescriptions','/:id/fields','getFields','post','create','put','/:id','delete','exports','multer','util','express','Router'];(function(_0x5c3c0b,_0x4ee35e){var _0x52ecd2=function(_0x3cf575){while(--_0x3cf575){_0x5c3c0b['push'](_0x5c3c0b['shift']());}};_0x52ecd2(++_0x4ee35e);}(_0x7e33,0x7a));var _0x37e3=function(_0xa7d933,_0x2de780){_0xa7d933=_0xa7d933-0x0;var _0x30abca=_0x7e33[_0xa7d933];return _0x30abca;};'use strict';var multer=require(_0x37e3('0x0'));var util=require(_0x37e3('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x37e3('0x2'));var router=express[_0x37e3('0x3')]();var auth=require(_0x37e3('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x37e3('0x5'));router[_0x37e3('0x6')]('/',auth[_0x37e3('0x7')](),controller[_0x37e3('0x8')]);router[_0x37e3('0x6')]('/:id',auth[_0x37e3('0x7')](),controller[_0x37e3('0x9')]);router[_0x37e3('0x6')](_0x37e3('0xa'),auth[_0x37e3('0x7')](),controller['getSubjects']);router['get'](_0x37e3('0xb'),auth[_0x37e3('0x7')](),controller[_0x37e3('0xc')]);router['get'](_0x37e3('0xd'),auth[_0x37e3('0x7')](),controller[_0x37e3('0xe')]);router[_0x37e3('0xf')]('/',auth['isAuthenticated'](),controller[_0x37e3('0x10')]);router[_0x37e3('0x11')](_0x37e3('0x12'),auth[_0x37e3('0x7')](),controller['update']);router[_0x37e3('0x13')](_0x37e3('0x12'),auth[_0x37e3('0x7')](),controller['destroy']);module[_0x37e3('0x14')]=router; \ No newline at end of file +var _0x64c0=['show','getSubjects','getDescriptions','/:id/fields','post','create','put','update','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id'];(function(_0x220e95,_0x4e71f8){var _0x25034b=function(_0x3fece9){while(--_0x3fece9){_0x220e95['push'](_0x220e95['shift']());}};_0x25034b(++_0x4e71f8);}(_0x64c0,0xa0));var _0x064c=function(_0x2c3d82,_0x24cb41){_0x2c3d82=_0x2c3d82-0x0;var _0x17b428=_0x64c0[_0x2c3d82];return _0x17b428;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x064c('0x0'));var timeout=require(_0x064c('0x1'));var express=require(_0x064c('0x2'));var router=express['Router']();var auth=require(_0x064c('0x3'));var interaction=require(_0x064c('0x4'));var config=require(_0x064c('0x5'));var controller=require(_0x064c('0x6'));router[_0x064c('0x7')]('/',auth[_0x064c('0x8')](),controller[_0x064c('0x9')]);router[_0x064c('0x7')](_0x064c('0xa'),auth[_0x064c('0x8')](),controller[_0x064c('0xb')]);router[_0x064c('0x7')]('/:id/subjects',auth[_0x064c('0x8')](),controller[_0x064c('0xc')]);router['get']('/:id/descriptions',auth[_0x064c('0x8')](),controller[_0x064c('0xd')]);router[_0x064c('0x7')](_0x064c('0xe'),auth[_0x064c('0x8')](),controller['getFields']);router[_0x064c('0xf')]('/',auth[_0x064c('0x8')](),controller[_0x064c('0x10')]);router[_0x064c('0x11')](_0x064c('0xa'),auth['isAuthenticated'](),controller[_0x064c('0x12')]);router['delete'](_0x064c('0xa'),auth[_0x064c('0x8')](),controller['destroy']);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 7e31bca..1750c9a 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 _0xfca9=['sequelize','STRING'];(function(_0x110dc0,_0x3a6615){var _0x39aeb1=function(_0x46fa33){while(--_0x46fa33){_0x110dc0['push'](_0x110dc0['shift']());}};_0x39aeb1(++_0x3a6615);}(_0xfca9,0x9e));var _0x9fca=function(_0x1277ca,_0x432b26){_0x1277ca=_0x1277ca-0x0;var _0x15b711=_0xfca9[_0x1277ca];return _0x15b711;};'use strict';var Sequelize=require(_0x9fca('0x0'));module['exports']={'name':{'type':Sequelize[_0x9fca('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4cf8=['STRING','exports'];(function(_0x29344c,_0x48e205){var _0x3fbf73=function(_0x23c5f6){while(--_0x23c5f6){_0x29344c['push'](_0x29344c['shift']());}};_0x3fbf73(++_0x48e205);}(_0x4cf8,0xab));var _0x84cf=function(_0x264b9b,_0xa1181e){_0x264b9b=_0x264b9b-0x0;var _0x4c7a0e=_0x4cf8[_0x264b9b];return _0x4c7a0e;};'use strict';var Sequelize=require('sequelize');module[_0x84cf('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x84cf('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 3ff87b5..3afa55b 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 _0x86f4=['getDescriptions','getFields','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','Sequelize','then','info','FreshsalesConfiguration,\x20%s,\x20%s','FreshsalesConfiguration,\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','reject','save','update','stack','name','send','index','FreshsalesConfiguration','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','show','find','create','body','params','getSubjects','findOne','FreshsalesField'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x86f4,0x18a));var _0x486f=function(_0x272b03,_0x3d8fce){_0x272b03=_0x272b03-0x0;var _0x2c9d4b=_0x86f4[_0x272b03];return _0x2c9d4b;};'use strict';var pdf=require(_0x486f('0x0'));var emlformat=require(_0x486f('0x1'));var rimraf=require(_0x486f('0x2'));var zipdir=require(_0x486f('0x3'));var jsonpatch=require(_0x486f('0x4'));var rp=require(_0x486f('0x5'));var moment=require(_0x486f('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x486f('0x7'));var util=require(_0x486f('0x8'));var path=require('path');var sox=require(_0x486f('0x9'));var csv=require(_0x486f('0xa'));var ejs=require(_0x486f('0xb'));var fs=require('fs');var _=require(_0x486f('0xc'));var squel=require(_0x486f('0xd'));var crypto=require(_0x486f('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x486f('0xf'));var toCsv=require(_0x486f('0xa'));var querystring=require(_0x486f('0x10'));var Papa=require(_0x486f('0x11'));var Redis=require(_0x486f('0x12'));var authService=require(_0x486f('0x13'));var qs=require(_0x486f('0x14'));var as=require(_0x486f('0x15'));var hardwareService=require(_0x486f('0x16'));var logger=require(_0x486f('0x17'))(_0x486f('0x18'));var utils=require(_0x486f('0x19'));var config=require(_0x486f('0x1a'));var db=require(_0x486f('0x1b'))['db'];var jayson=require(_0x486f('0x1c'));var client=jayson[_0x486f('0x1d')][_0x486f('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x4eb4f9,_0x294bed,_0x5cb33a){if(_0x5cb33a){var _0x46d0a9=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x46d0a9[_0x486f('0x1f')](_0x294bed)){return _0x4eb4f9;}else{throw new db[(_0x486f('0x20'))]['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 _0x4eb4f9;}}function respondWithRpcPromise(_0x11c2af,_0x3a4fef,_0x51334f,_0x16830e){return new BPromise(function(_0x2ab753,_0x3ebe6a){var _0x4ec12f=_0x16830e||client;return _0x4ec12f['request'](_0x11c2af,_0x51334f)[_0x486f('0x21')](function(_0x3eeae0){logger[_0x486f('0x22')](_0x486f('0x23'),_0x3a4fef,'request\x20sent');logger['debug'](_0x486f('0x24'),_0x3a4fef,_0x486f('0x25'),JSON[_0x486f('0x26')](_0x3eeae0));if(_0x3eeae0[_0x486f('0x27')]){if(_0x3eeae0[_0x486f('0x27')][_0x486f('0x28')]===0x1f4){logger[_0x486f('0x27')](_0x486f('0x23'),_0x3a4fef,_0x3eeae0[_0x486f('0x27')][_0x486f('0x29')]);return _0x3ebe6a(_0x3eeae0[_0x486f('0x27')][_0x486f('0x29')]);}logger[_0x486f('0x27')](_0x486f('0x23'),_0x3a4fef,_0x3eeae0[_0x486f('0x27')][_0x486f('0x29')]);return _0x2ab753(_0x3eeae0['error'][_0x486f('0x29')]);}else{logger[_0x486f('0x22')](_0x486f('0x23'),_0x3a4fef,_0x486f('0x25'));_0x2ab753(_0x3eeae0[_0x486f('0x2a')][_0x486f('0x29')]);}})[_0x486f('0x2b')](function(_0xbf5f3a){logger[_0x486f('0x27')](_0x486f('0x23'),_0x3a4fef,_0xbf5f3a);_0x3ebe6a(_0xbf5f3a);});});}function respondWithStatusCode(_0x2e983b,_0x71a26f){_0x71a26f=_0x71a26f||0xcc;return function(_0x387462){if(_0x387462){return _0x2e983b[_0x486f('0x2c')](_0x71a26f);}return _0x2e983b[_0x486f('0x2d')](_0x71a26f)[_0x486f('0x2e')]();};}function respondWithResult(_0x6f1e8e,_0x477458){_0x477458=_0x477458||0xc8;return function(_0xdc34ff){if(_0xdc34ff){return _0x6f1e8e[_0x486f('0x2d')](_0x477458)[_0x486f('0x2f')](_0xdc34ff);}};}function respondWithFilteredResult(_0x25531f,_0x5105ee){return function(_0x486b86){if(_0x486b86){var _0x52fb3a=_0x486b86[_0x486f('0x30')],_0x5b4718=_0x5105ee[_0x486f('0x31')],_0x173512=_0x5105ee['offset']+_0x5105ee[_0x486f('0x32')],_0x5c994a;if(_0x173512>=_0x52fb3a){_0x173512=_0x52fb3a;_0x5c994a=0xc8;}else{_0x5c994a=0xce;}_0x25531f['status'](_0x5c994a);return _0x25531f[_0x486f('0x33')](_0x486f('0x34'),_0x5b4718+'-'+_0x173512+'/'+_0x52fb3a)[_0x486f('0x2f')](_0x486b86);}return null;};}function patchUpdates(_0x604ec3){return function(_0x1962c2){try{jsonpatch[_0x486f('0x35')](_0x1962c2,_0x604ec3,!![]);}catch(_0x5613ca){return BPromise[_0x486f('0x36')](_0x5613ca);}return _0x1962c2[_0x486f('0x37')]();};}function saveUpdates(_0xdd39fe,_0x429b8d){return function(_0x168d11){if(_0x168d11){return _0x168d11[_0x486f('0x38')](_0xdd39fe)[_0x486f('0x21')](function(_0x1756d3){return _0x1756d3;});}return null;};}function removeEntity(_0x5764ca,_0x34b842){return function(_0x45aa41){if(_0x45aa41){return _0x45aa41['destroy']()[_0x486f('0x21')](function(){_0x5764ca[_0x486f('0x2d')](0xcc)[_0x486f('0x2e')]();});}};}function handleEntityNotFound(_0xb657e7,_0x4bd2b7){return function(_0x531c16){if(!_0x531c16){_0xb657e7[_0x486f('0x2c')](0x194);}return _0x531c16;};}function handleError(_0x40dd81,_0x1be0da){_0x1be0da=_0x1be0da||0x1f4;return function(_0x202ea8){logger[_0x486f('0x27')](_0x202ea8[_0x486f('0x39')]);if(_0x202ea8[_0x486f('0x3a')]){delete _0x202ea8['name'];}_0x40dd81[_0x486f('0x2d')](_0x1be0da)[_0x486f('0x3b')](_0x202ea8);};}exports[_0x486f('0x3c')]=function(_0x51c5dc,_0x5678d8){var _0x3fbdc6={},_0x115419={},_0x4b80f8={'count':0x0,'rows':[]};var _0x22c18d=_['map'](db[_0x486f('0x3d')][_0x486f('0x3e')],function(_0x5ca543){return{'name':_0x5ca543['fieldName'],'type':_0x5ca543[_0x486f('0x3f')][_0x486f('0x40')]};});_0x115419[_0x486f('0x41')]=_[_0x486f('0x42')](_0x22c18d,_0x486f('0x3a'));_0x115419[_0x486f('0x43')]=_[_0x486f('0x44')](_0x51c5dc[_0x486f('0x43')]);_0x115419[_0x486f('0x45')]=_[_0x486f('0x46')](_0x115419[_0x486f('0x41')],_0x115419[_0x486f('0x43')]);_0x3fbdc6[_0x486f('0x47')]=_[_0x486f('0x46')](_0x115419['model'],qs[_0x486f('0x48')](_0x51c5dc[_0x486f('0x43')]['fields']));_0x3fbdc6[_0x486f('0x47')]=_0x3fbdc6[_0x486f('0x47')][_0x486f('0x49')]?_0x3fbdc6[_0x486f('0x47')]:_0x115419[_0x486f('0x41')];if(!_0x51c5dc[_0x486f('0x43')][_0x486f('0x4a')](_0x486f('0x4b'))){_0x3fbdc6[_0x486f('0x32')]=qs['limit'](_0x51c5dc['query'][_0x486f('0x32')]);_0x3fbdc6[_0x486f('0x31')]=qs[_0x486f('0x31')](_0x51c5dc[_0x486f('0x43')][_0x486f('0x31')]);}_0x3fbdc6[_0x486f('0x4c')]=qs[_0x486f('0x4d')](_0x51c5dc[_0x486f('0x43')][_0x486f('0x4d')]);_0x3fbdc6['where']=qs[_0x486f('0x45')](_[_0x486f('0x4e')](_0x51c5dc[_0x486f('0x43')],_0x115419[_0x486f('0x45')]));if(_0x51c5dc['query'][_0x486f('0x4f')]){_0x3fbdc6['where']=_[_0x486f('0x50')](_0x3fbdc6[_0x486f('0x51')],{'$or':_[_0x486f('0x42')](_0x22c18d,function(_0x1fe73f){if(_0x1fe73f[_0x486f('0x3f')]!==_0x486f('0x52')){var _0x5534b1={};_0x5534b1[_0x1fe73f['name']]={'$like':'%'+_0x51c5dc[_0x486f('0x43')][_0x486f('0x4f')]+'%'};return _0x5534b1;}})});}_0x3fbdc6=_[_0x486f('0x50')]({},_0x3fbdc6,_0x51c5dc[_0x486f('0x53')]);var _0x4dbf30={'where':_0x3fbdc6[_0x486f('0x51')]};return db[_0x486f('0x3d')][_0x486f('0x30')](_0x4dbf30)['then'](function(_0x272a8f){_0x4b80f8[_0x486f('0x30')]=_0x272a8f;if(_0x51c5dc[_0x486f('0x43')][_0x486f('0x54')]){_0x3fbdc6[_0x486f('0x55')]=[{'all':!![]}];}return db[_0x486f('0x3d')][_0x486f('0x56')](_0x3fbdc6);})[_0x486f('0x21')](function(_0x51ca91){_0x4b80f8[_0x486f('0x57')]=_0x51ca91;return _0x4b80f8;})['then'](respondWithFilteredResult(_0x5678d8,_0x3fbdc6))[_0x486f('0x2b')](handleError(_0x5678d8,null));};exports[_0x486f('0x58')]=function(_0x4554f3,_0x1055cf){var _0x34033e={'raw':![],'where':{'id':_0x4554f3['params']['id']}},_0x2e5746={};_0x2e5746[_0x486f('0x41')]=_[_0x486f('0x44')](db[_0x486f('0x3d')][_0x486f('0x3e')]);_0x2e5746[_0x486f('0x43')]=_[_0x486f('0x44')](_0x4554f3[_0x486f('0x43')]);_0x2e5746[_0x486f('0x45')]=_[_0x486f('0x46')](_0x2e5746['model'],_0x2e5746[_0x486f('0x43')]);_0x34033e[_0x486f('0x47')]=_[_0x486f('0x46')](_0x2e5746['model'],qs[_0x486f('0x48')](_0x4554f3[_0x486f('0x43')][_0x486f('0x48')]));_0x34033e['attributes']=_0x34033e[_0x486f('0x47')][_0x486f('0x49')]?_0x34033e[_0x486f('0x47')]:_0x2e5746[_0x486f('0x41')];if(_0x4554f3['query']['includeAll']){_0x34033e[_0x486f('0x55')]=[{'all':!![]}];}_0x34033e=_[_0x486f('0x50')]({},_0x34033e,_0x4554f3[_0x486f('0x53')]);return db[_0x486f('0x3d')][_0x486f('0x59')](_0x34033e)[_0x486f('0x21')](handleEntityNotFound(_0x1055cf,null))[_0x486f('0x21')](respondWithResult(_0x1055cf,null))[_0x486f('0x2b')](handleError(_0x1055cf,null));};exports['create']=function(_0x14820c,_0x5469bb){return db[_0x486f('0x3d')][_0x486f('0x5a')](_0x14820c[_0x486f('0x5b')],{})[_0x486f('0x21')](respondWithResult(_0x5469bb,0xc9))['catch'](handleError(_0x5469bb,null));};exports[_0x486f('0x38')]=function(_0x188e6a,_0x1303f7){if(_0x188e6a[_0x486f('0x5b')]['id']){delete _0x188e6a['body']['id'];}return db[_0x486f('0x3d')][_0x486f('0x59')]({'where':{'id':_0x188e6a[_0x486f('0x5c')]['id']}})[_0x486f('0x21')](handleEntityNotFound(_0x1303f7,null))[_0x486f('0x21')](saveUpdates(_0x188e6a[_0x486f('0x5b')],null))[_0x486f('0x21')](respondWithResult(_0x1303f7,null))[_0x486f('0x2b')](handleError(_0x1303f7,null));};exports['destroy']=function(_0x42778e,_0x4754d6){return db[_0x486f('0x3d')][_0x486f('0x59')]({'where':{'id':_0x42778e['params']['id']}})[_0x486f('0x21')](handleEntityNotFound(_0x4754d6,null))['then'](removeEntity(_0x4754d6,null))[_0x486f('0x2b')](handleError(_0x4754d6,null));};exports[_0x486f('0x5d')]=function(_0x419093,_0x2d2ded,_0x55d41f){var _0x455b85={};var _0xa72483={};var _0x3d0f84;var _0x1f596c;return db['FreshsalesConfiguration'][_0x486f('0x5e')]({'where':{'id':_0x419093[_0x486f('0x5c')]['id']}})[_0x486f('0x21')](handleEntityNotFound(_0x2d2ded,null))[_0x486f('0x21')](function(_0x40ddfe){if(_0x40ddfe){_0x3d0f84=_0x40ddfe;_0xa72483[_0x486f('0x41')]=_[_0x486f('0x44')](db[_0x486f('0x5f')][_0x486f('0x3e')]);_0xa72483[_0x486f('0x43')]=_[_0x486f('0x44')](_0x419093[_0x486f('0x43')]);_0xa72483[_0x486f('0x45')]=_[_0x486f('0x46')](_0xa72483['model'],_0xa72483[_0x486f('0x43')]);_0x455b85['attributes']=_[_0x486f('0x46')](_0xa72483['model'],qs[_0x486f('0x48')](_0x419093[_0x486f('0x43')]['fields']));_0x455b85['attributes']=_0x455b85[_0x486f('0x47')]['length']?_0x455b85[_0x486f('0x47')]:_0xa72483[_0x486f('0x41')];_0x455b85['order']=qs[_0x486f('0x4d')](_0x419093[_0x486f('0x43')][_0x486f('0x4d')]);_0x455b85[_0x486f('0x51')]=qs[_0x486f('0x45')](_[_0x486f('0x4e')](_0x419093['query'],_0xa72483[_0x486f('0x45')]));if(_0x419093[_0x486f('0x43')][_0x486f('0x4f')]){_0x455b85['where']=_[_0x486f('0x50')](_0x455b85['where'],{'$or':_[_0x486f('0x42')](_0x455b85['attributes'],function(_0x17a23){var _0x165595={};_0x165595[_0x17a23]={'$like':'%'+_0x419093[_0x486f('0x43')][_0x486f('0x4f')]+'%'};return _0x165595;})});}_0x455b85=_['merge']({},_0x455b85,_0x419093[_0x486f('0x53')]);return _0x3d0f84[_0x486f('0x5d')](_0x455b85);}})[_0x486f('0x21')](function(_0x53f673){if(_0x53f673){_0x1f596c=_0x53f673[_0x486f('0x49')];if(!_0x419093[_0x486f('0x43')][_0x486f('0x4a')](_0x486f('0x4b'))){_0x455b85['limit']=qs[_0x486f('0x32')](_0x419093[_0x486f('0x43')][_0x486f('0x32')]);_0x455b85['offset']=qs[_0x486f('0x31')](_0x419093[_0x486f('0x43')][_0x486f('0x31')]);}return _0x3d0f84['getSubjects'](_0x455b85);}})[_0x486f('0x21')](function(_0x101334){if(_0x101334){return _0x101334?{'count':_0x1f596c,'rows':_0x101334}:null;}})['then'](respondWithResult(_0x2d2ded,null))['catch'](handleError(_0x2d2ded,null));};exports['getDescriptions']=function(_0x4c4208,_0x3c3a88,_0x36496c){var _0x8c111a={};var _0x3ca472={};var _0x1ecc6f;var _0x1c49d2;return db[_0x486f('0x3d')][_0x486f('0x5e')]({'where':{'id':_0x4c4208['params']['id']}})[_0x486f('0x21')](handleEntityNotFound(_0x3c3a88,null))[_0x486f('0x21')](function(_0x30276d){if(_0x30276d){_0x1ecc6f=_0x30276d;_0x3ca472[_0x486f('0x41')]=_[_0x486f('0x44')](db['FreshsalesField']['rawAttributes']);_0x3ca472[_0x486f('0x43')]=_[_0x486f('0x44')](_0x4c4208['query']);_0x3ca472[_0x486f('0x45')]=_[_0x486f('0x46')](_0x3ca472['model'],_0x3ca472['query']);_0x8c111a[_0x486f('0x47')]=_[_0x486f('0x46')](_0x3ca472[_0x486f('0x41')],qs[_0x486f('0x48')](_0x4c4208[_0x486f('0x43')][_0x486f('0x48')]));_0x8c111a[_0x486f('0x47')]=_0x8c111a['attributes']['length']?_0x8c111a[_0x486f('0x47')]:_0x3ca472['model'];_0x8c111a[_0x486f('0x4c')]=qs['sort'](_0x4c4208[_0x486f('0x43')]['sort']);_0x8c111a['where']=qs[_0x486f('0x45')](_['pick'](_0x4c4208['query'],_0x3ca472[_0x486f('0x45')]));if(_0x4c4208['query'][_0x486f('0x4f')]){_0x8c111a['where']=_[_0x486f('0x50')](_0x8c111a[_0x486f('0x51')],{'$or':_[_0x486f('0x42')](_0x8c111a[_0x486f('0x47')],function(_0x59c308){var _0xf72086={};_0xf72086[_0x59c308]={'$like':'%'+_0x4c4208[_0x486f('0x43')]['filter']+'%'};return _0xf72086;})});}_0x8c111a=_[_0x486f('0x50')]({},_0x8c111a,_0x4c4208['options']);return _0x1ecc6f[_0x486f('0x60')](_0x8c111a);}})['then'](function(_0x30c3f1){if(_0x30c3f1){_0x1c49d2=_0x30c3f1['length'];if(!_0x4c4208['query']['hasOwnProperty'](_0x486f('0x4b'))){_0x8c111a[_0x486f('0x32')]=qs[_0x486f('0x32')](_0x4c4208[_0x486f('0x43')][_0x486f('0x32')]);_0x8c111a[_0x486f('0x31')]=qs[_0x486f('0x31')](_0x4c4208[_0x486f('0x43')][_0x486f('0x31')]);}return _0x1ecc6f[_0x486f('0x60')](_0x8c111a);}})['then'](function(_0x1022de){if(_0x1022de){return _0x1022de?{'count':_0x1c49d2,'rows':_0x1022de}:null;}})[_0x486f('0x21')](respondWithResult(_0x3c3a88,null))[_0x486f('0x2b')](handleError(_0x3c3a88,null));};exports[_0x486f('0x61')]=function(_0x5d3159,_0x48d919,_0x5c2d46){var _0x30d0b9={};var _0xd187c5={};var _0x5cf7e2;var _0x5da4d5;return db['FreshsalesConfiguration'][_0x486f('0x5e')]({'where':{'id':_0x5d3159[_0x486f('0x5c')]['id']}})[_0x486f('0x21')](handleEntityNotFound(_0x48d919,null))['then'](function(_0x4efcec){if(_0x4efcec){_0x5cf7e2=_0x4efcec;_0xd187c5['model']=_[_0x486f('0x44')](db['FreshsalesField'][_0x486f('0x3e')]);_0xd187c5['query']=_[_0x486f('0x44')](_0x5d3159['query']);_0xd187c5[_0x486f('0x45')]=_[_0x486f('0x46')](_0xd187c5[_0x486f('0x41')],_0xd187c5[_0x486f('0x43')]);_0x30d0b9[_0x486f('0x47')]=_[_0x486f('0x46')](_0xd187c5[_0x486f('0x41')],qs[_0x486f('0x48')](_0x5d3159['query'][_0x486f('0x48')]));_0x30d0b9['attributes']=_0x30d0b9[_0x486f('0x47')]['length']?_0x30d0b9[_0x486f('0x47')]:_0xd187c5[_0x486f('0x41')];_0x30d0b9['order']=qs[_0x486f('0x4d')](_0x5d3159[_0x486f('0x43')][_0x486f('0x4d')]);_0x30d0b9['where']=qs[_0x486f('0x45')](_[_0x486f('0x4e')](_0x5d3159[_0x486f('0x43')],_0xd187c5['filters']));if(_0x5d3159['query'][_0x486f('0x4f')]){_0x30d0b9[_0x486f('0x51')]=_['merge'](_0x30d0b9[_0x486f('0x51')],{'$or':_[_0x486f('0x42')](_0x30d0b9[_0x486f('0x47')],function(_0x3437bf){var _0x369f07={};_0x369f07[_0x3437bf]={'$like':'%'+_0x5d3159[_0x486f('0x43')][_0x486f('0x4f')]+'%'};return _0x369f07;})});}_0x30d0b9=_[_0x486f('0x50')]({},_0x30d0b9,_0x5d3159[_0x486f('0x53')]);return _0x5cf7e2[_0x486f('0x61')](_0x30d0b9);}})[_0x486f('0x21')](function(_0x3c1bd3){if(_0x3c1bd3){_0x5da4d5=_0x3c1bd3[_0x486f('0x49')];if(!_0x5d3159[_0x486f('0x43')][_0x486f('0x4a')]('nolimit')){_0x30d0b9[_0x486f('0x32')]=qs['limit'](_0x5d3159[_0x486f('0x43')]['limit']);_0x30d0b9[_0x486f('0x31')]=qs['offset'](_0x5d3159[_0x486f('0x43')][_0x486f('0x31')]);}return _0x5cf7e2[_0x486f('0x61')](_0x30d0b9);}})[_0x486f('0x21')](function(_0x5d66ca){if(_0x5d66ca){return _0x5d66ca?{'count':_0x5da4d5,'rows':_0x5d66ca}:null;}})[_0x486f('0x21')](respondWithResult(_0x48d919,null))[_0x486f('0x2b')](handleError(_0x48d919,null));}; \ No newline at end of file +var _0x5d17=['request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','update','destroy','stack','name','send','index','fieldName','type','key','model','map','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','FreshsalesConfiguration','count','includeAll','include','findAll','rows','show','params','keys','rawAttributes','find','catch','create','body','getSubjects','findOne','FreshsalesField','getDescriptions','getFields','html-pdf','eml-format','fast-json-patch'];(function(_0x251d2b,_0x42c9a1){var _0x23f0d2=function(_0x392f14){while(--_0x392f14){_0x251d2b['push'](_0x251d2b['shift']());}};_0x23f0d2(++_0x42c9a1);}(_0x5d17,0x114));var _0x75d1=function(_0x5189d6,_0x557268){_0x5189d6=_0x5189d6-0x0;var _0xb04855=_0x5d17[_0x5189d6];return _0xb04855;};'use strict';var pdf=require(_0x75d1('0x0'));var emlformat=require(_0x75d1('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x75d1('0x2'));var rp=require(_0x75d1('0x3'));var moment=require(_0x75d1('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x75d1('0x5'));var util=require(_0x75d1('0x6'));var path=require(_0x75d1('0x7'));var sox=require(_0x75d1('0x8'));var csv=require('to-csv');var ejs=require(_0x75d1('0x9'));var fs=require('fs');var _=require(_0x75d1('0xa'));var squel=require(_0x75d1('0xb'));var crypto=require(_0x75d1('0xc'));var jsforce=require(_0x75d1('0xd'));var deskjs=require(_0x75d1('0xe'));var toCsv=require(_0x75d1('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x75d1('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x75d1('0x11'));var hardwareService=require(_0x75d1('0x12'));var logger=require('../../config/logger')(_0x75d1('0x13'));var utils=require(_0x75d1('0x14'));var config=require(_0x75d1('0x15'));var db=require(_0x75d1('0x16'))['db'];var jayson=require(_0x75d1('0x17'));var client=jayson[_0x75d1('0x18')]['http']({'port':0x232a});function checkPasswordPattern(_0x19e825,_0x2d3bfc,_0x3af408){if(_0x3af408){var _0x314a71=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x314a71['test'](_0x2d3bfc)){return _0x19e825;}else{throw new db['Sequelize']['ValidationError'](_0x75d1('0x19'));}}else{return _0x19e825;}}function respondWithRpcPromise(_0x12fa32,_0x2fd022,_0x52e649,_0x1f9620){return new BPromise(function(_0x3fff9b,_0x1d30f3){var _0x269e82=_0x1f9620||client;return _0x269e82[_0x75d1('0x1a')](_0x12fa32,_0x52e649)[_0x75d1('0x1b')](function(_0x2845bc){logger[_0x75d1('0x1c')](_0x75d1('0x1d'),_0x2fd022,_0x75d1('0x1e'));logger[_0x75d1('0x1f')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x2fd022,'request\x20sent',JSON[_0x75d1('0x20')](_0x2845bc));if(_0x2845bc[_0x75d1('0x21')]){if(_0x2845bc['error'][_0x75d1('0x22')]===0x1f4){logger[_0x75d1('0x21')](_0x75d1('0x1d'),_0x2fd022,_0x2845bc[_0x75d1('0x21')][_0x75d1('0x23')]);return _0x1d30f3(_0x2845bc[_0x75d1('0x21')]['message']);}logger[_0x75d1('0x21')](_0x75d1('0x1d'),_0x2fd022,_0x2845bc['error'][_0x75d1('0x23')]);return _0x3fff9b(_0x2845bc[_0x75d1('0x21')]['message']);}else{logger[_0x75d1('0x1c')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x2fd022,_0x75d1('0x1e'));_0x3fff9b(_0x2845bc[_0x75d1('0x24')][_0x75d1('0x23')]);}})['catch'](function(_0x525588){logger[_0x75d1('0x21')](_0x75d1('0x1d'),_0x2fd022,_0x525588);_0x1d30f3(_0x525588);});});}function respondWithStatusCode(_0x315ce5,_0x18184b){_0x18184b=_0x18184b||0xcc;return function(_0x51d043){if(_0x51d043){return _0x315ce5[_0x75d1('0x25')](_0x18184b);}return _0x315ce5[_0x75d1('0x26')](_0x18184b)[_0x75d1('0x27')]();};}function respondWithResult(_0x51138e,_0x54095d){_0x54095d=_0x54095d||0xc8;return function(_0x57efd6){if(_0x57efd6){return _0x51138e[_0x75d1('0x26')](_0x54095d)[_0x75d1('0x28')](_0x57efd6);}};}function respondWithFilteredResult(_0x45c182,_0x468bf0){return function(_0x38653d){if(_0x38653d){var _0x519ceb=_0x38653d['count'],_0x4d292e=_0x468bf0[_0x75d1('0x29')],_0x410e16=_0x468bf0['offset']+_0x468bf0[_0x75d1('0x2a')],_0x197f52;if(_0x410e16>=_0x519ceb){_0x410e16=_0x519ceb;_0x197f52=0xc8;}else{_0x197f52=0xce;}_0x45c182[_0x75d1('0x26')](_0x197f52);return _0x45c182[_0x75d1('0x2b')](_0x75d1('0x2c'),_0x4d292e+'-'+_0x410e16+'/'+_0x519ceb)[_0x75d1('0x28')](_0x38653d);}return null;};}function patchUpdates(_0x506b93){return function(_0x352a4f){try{jsonpatch[_0x75d1('0x2d')](_0x352a4f,_0x506b93,!![]);}catch(_0x466465){return BPromise[_0x75d1('0x2e')](_0x466465);}return _0x352a4f['save']();};}function saveUpdates(_0x75b18a,_0x551824){return function(_0x1b2bbb){if(_0x1b2bbb){return _0x1b2bbb[_0x75d1('0x2f')](_0x75b18a)['then'](function(_0x37df37){return _0x37df37;});}return null;};}function removeEntity(_0x39d0ff,_0x15ff9b){return function(_0x100a4b){if(_0x100a4b){return _0x100a4b[_0x75d1('0x30')]()['then'](function(){_0x39d0ff[_0x75d1('0x26')](0xcc)[_0x75d1('0x27')]();});}};}function handleEntityNotFound(_0x20de89,_0xa0f4c9){return function(_0x4b936c){if(!_0x4b936c){_0x20de89['sendStatus'](0x194);}return _0x4b936c;};}function handleError(_0x551723,_0x3d9275){_0x3d9275=_0x3d9275||0x1f4;return function(_0x29ad6b){logger[_0x75d1('0x21')](_0x29ad6b[_0x75d1('0x31')]);if(_0x29ad6b[_0x75d1('0x32')]){delete _0x29ad6b[_0x75d1('0x32')];}_0x551723[_0x75d1('0x26')](_0x3d9275)[_0x75d1('0x33')](_0x29ad6b);};}exports[_0x75d1('0x34')]=function(_0x534511,_0x1dd3b5){var _0x429c38={},_0x39ac3e={},_0x62b37e={'count':0x0,'rows':[]};var _0x6d48a5=_['map'](db['FreshsalesConfiguration']['rawAttributes'],function(_0x1058b7){return{'name':_0x1058b7[_0x75d1('0x35')],'type':_0x1058b7[_0x75d1('0x36')][_0x75d1('0x37')]};});_0x39ac3e[_0x75d1('0x38')]=_[_0x75d1('0x39')](_0x6d48a5,'name');_0x39ac3e['query']=_['keys'](_0x534511[_0x75d1('0x3a')]);_0x39ac3e['filters']=_['intersection'](_0x39ac3e[_0x75d1('0x38')],_0x39ac3e[_0x75d1('0x3a')]);_0x429c38[_0x75d1('0x3b')]=_[_0x75d1('0x3c')](_0x39ac3e['model'],qs[_0x75d1('0x3d')](_0x534511[_0x75d1('0x3a')][_0x75d1('0x3d')]));_0x429c38[_0x75d1('0x3b')]=_0x429c38[_0x75d1('0x3b')][_0x75d1('0x3e')]?_0x429c38[_0x75d1('0x3b')]:_0x39ac3e[_0x75d1('0x38')];if(!_0x534511[_0x75d1('0x3a')][_0x75d1('0x3f')](_0x75d1('0x40'))){_0x429c38[_0x75d1('0x2a')]=qs[_0x75d1('0x2a')](_0x534511[_0x75d1('0x3a')][_0x75d1('0x2a')]);_0x429c38[_0x75d1('0x29')]=qs[_0x75d1('0x29')](_0x534511[_0x75d1('0x3a')][_0x75d1('0x29')]);}_0x429c38[_0x75d1('0x41')]=qs[_0x75d1('0x42')](_0x534511[_0x75d1('0x3a')]['sort']);_0x429c38['where']=qs[_0x75d1('0x43')](_[_0x75d1('0x44')](_0x534511[_0x75d1('0x3a')],_0x39ac3e[_0x75d1('0x43')]));if(_0x534511['query'][_0x75d1('0x45')]){_0x429c38[_0x75d1('0x46')]=_[_0x75d1('0x47')](_0x429c38[_0x75d1('0x46')],{'$or':_['map'](_0x6d48a5,function(_0x1c5255){if(_0x1c5255[_0x75d1('0x36')]!==_0x75d1('0x48')){var _0x283097={};_0x283097[_0x1c5255['name']]={'$like':'%'+_0x534511[_0x75d1('0x3a')]['filter']+'%'};return _0x283097;}})});}_0x429c38=_[_0x75d1('0x47')]({},_0x429c38,_0x534511[_0x75d1('0x49')]);var _0x9bc1ed={'where':_0x429c38[_0x75d1('0x46')]};return db[_0x75d1('0x4a')][_0x75d1('0x4b')](_0x9bc1ed)['then'](function(_0x366e5b){_0x62b37e['count']=_0x366e5b;if(_0x534511['query'][_0x75d1('0x4c')]){_0x429c38[_0x75d1('0x4d')]=[{'all':!![]}];}return db[_0x75d1('0x4a')][_0x75d1('0x4e')](_0x429c38);})[_0x75d1('0x1b')](function(_0x15567a){_0x62b37e[_0x75d1('0x4f')]=_0x15567a;return _0x62b37e;})['then'](respondWithFilteredResult(_0x1dd3b5,_0x429c38))['catch'](handleError(_0x1dd3b5,null));};exports[_0x75d1('0x50')]=function(_0x8ce3d2,_0x50def3){var _0x2d380d={'raw':![],'where':{'id':_0x8ce3d2[_0x75d1('0x51')]['id']}},_0x2fa44a={};_0x2fa44a['model']=_[_0x75d1('0x52')](db[_0x75d1('0x4a')][_0x75d1('0x53')]);_0x2fa44a[_0x75d1('0x3a')]=_[_0x75d1('0x52')](_0x8ce3d2[_0x75d1('0x3a')]);_0x2fa44a[_0x75d1('0x43')]=_['intersection'](_0x2fa44a[_0x75d1('0x38')],_0x2fa44a[_0x75d1('0x3a')]);_0x2d380d[_0x75d1('0x3b')]=_[_0x75d1('0x3c')](_0x2fa44a[_0x75d1('0x38')],qs[_0x75d1('0x3d')](_0x8ce3d2[_0x75d1('0x3a')]['fields']));_0x2d380d[_0x75d1('0x3b')]=_0x2d380d[_0x75d1('0x3b')][_0x75d1('0x3e')]?_0x2d380d['attributes']:_0x2fa44a[_0x75d1('0x38')];if(_0x8ce3d2[_0x75d1('0x3a')][_0x75d1('0x4c')]){_0x2d380d[_0x75d1('0x4d')]=[{'all':!![]}];}_0x2d380d=_[_0x75d1('0x47')]({},_0x2d380d,_0x8ce3d2[_0x75d1('0x49')]);return db['FreshsalesConfiguration'][_0x75d1('0x54')](_0x2d380d)[_0x75d1('0x1b')](handleEntityNotFound(_0x50def3,null))[_0x75d1('0x1b')](respondWithResult(_0x50def3,null))[_0x75d1('0x55')](handleError(_0x50def3,null));};exports[_0x75d1('0x56')]=function(_0x2f6048,_0x2d1648){return db[_0x75d1('0x4a')][_0x75d1('0x56')](_0x2f6048[_0x75d1('0x57')],{})[_0x75d1('0x1b')](respondWithResult(_0x2d1648,0xc9))[_0x75d1('0x55')](handleError(_0x2d1648,null));};exports['update']=function(_0x5ba7aa,_0x41d54f){if(_0x5ba7aa['body']['id']){delete _0x5ba7aa[_0x75d1('0x57')]['id'];}return db[_0x75d1('0x4a')]['find']({'where':{'id':_0x5ba7aa[_0x75d1('0x51')]['id']}})[_0x75d1('0x1b')](handleEntityNotFound(_0x41d54f,null))[_0x75d1('0x1b')](saveUpdates(_0x5ba7aa[_0x75d1('0x57')],null))[_0x75d1('0x1b')](respondWithResult(_0x41d54f,null))[_0x75d1('0x55')](handleError(_0x41d54f,null));};exports[_0x75d1('0x30')]=function(_0x5048ef,_0x3c5da6){return db[_0x75d1('0x4a')][_0x75d1('0x54')]({'where':{'id':_0x5048ef[_0x75d1('0x51')]['id']}})[_0x75d1('0x1b')](handleEntityNotFound(_0x3c5da6,null))[_0x75d1('0x1b')](removeEntity(_0x3c5da6,null))[_0x75d1('0x55')](handleError(_0x3c5da6,null));};exports[_0x75d1('0x58')]=function(_0x22c75a,_0x349134,_0x4fdcd8){var _0x4e8e50={};var _0x81bd8d={};var _0x1c5720;var _0xd6a332;return db['FreshsalesConfiguration'][_0x75d1('0x59')]({'where':{'id':_0x22c75a['params']['id']}})[_0x75d1('0x1b')](handleEntityNotFound(_0x349134,null))[_0x75d1('0x1b')](function(_0x349852){if(_0x349852){_0x1c5720=_0x349852;_0x81bd8d[_0x75d1('0x38')]=_['keys'](db[_0x75d1('0x5a')]['rawAttributes']);_0x81bd8d['query']=_[_0x75d1('0x52')](_0x22c75a[_0x75d1('0x3a')]);_0x81bd8d[_0x75d1('0x43')]=_[_0x75d1('0x3c')](_0x81bd8d['model'],_0x81bd8d['query']);_0x4e8e50[_0x75d1('0x3b')]=_[_0x75d1('0x3c')](_0x81bd8d[_0x75d1('0x38')],qs[_0x75d1('0x3d')](_0x22c75a[_0x75d1('0x3a')]['fields']));_0x4e8e50[_0x75d1('0x3b')]=_0x4e8e50[_0x75d1('0x3b')][_0x75d1('0x3e')]?_0x4e8e50[_0x75d1('0x3b')]:_0x81bd8d[_0x75d1('0x38')];_0x4e8e50[_0x75d1('0x41')]=qs[_0x75d1('0x42')](_0x22c75a[_0x75d1('0x3a')][_0x75d1('0x42')]);_0x4e8e50[_0x75d1('0x46')]=qs[_0x75d1('0x43')](_['pick'](_0x22c75a[_0x75d1('0x3a')],_0x81bd8d[_0x75d1('0x43')]));if(_0x22c75a[_0x75d1('0x3a')][_0x75d1('0x45')]){_0x4e8e50[_0x75d1('0x46')]=_[_0x75d1('0x47')](_0x4e8e50[_0x75d1('0x46')],{'$or':_['map'](_0x4e8e50['attributes'],function(_0x1b1cc4){var _0x3e6ac3={};_0x3e6ac3[_0x1b1cc4]={'$like':'%'+_0x22c75a[_0x75d1('0x3a')][_0x75d1('0x45')]+'%'};return _0x3e6ac3;})});}_0x4e8e50=_[_0x75d1('0x47')]({},_0x4e8e50,_0x22c75a['options']);return _0x1c5720['getSubjects'](_0x4e8e50);}})[_0x75d1('0x1b')](function(_0x3754d5){if(_0x3754d5){_0xd6a332=_0x3754d5['length'];if(!_0x22c75a[_0x75d1('0x3a')][_0x75d1('0x3f')](_0x75d1('0x40'))){_0x4e8e50[_0x75d1('0x2a')]=qs[_0x75d1('0x2a')](_0x22c75a[_0x75d1('0x3a')]['limit']);_0x4e8e50['offset']=qs[_0x75d1('0x29')](_0x22c75a[_0x75d1('0x3a')]['offset']);}return _0x1c5720[_0x75d1('0x58')](_0x4e8e50);}})['then'](function(_0x37098c){if(_0x37098c){return _0x37098c?{'count':_0xd6a332,'rows':_0x37098c}:null;}})[_0x75d1('0x1b')](respondWithResult(_0x349134,null))[_0x75d1('0x55')](handleError(_0x349134,null));};exports['getDescriptions']=function(_0x254cfe,_0x1f9ac2,_0x290587){var _0x1baaca={};var _0x4553ff={};var _0x50d202;var _0x5482db;return db[_0x75d1('0x4a')]['findOne']({'where':{'id':_0x254cfe[_0x75d1('0x51')]['id']}})[_0x75d1('0x1b')](handleEntityNotFound(_0x1f9ac2,null))[_0x75d1('0x1b')](function(_0x5d0ae6){if(_0x5d0ae6){_0x50d202=_0x5d0ae6;_0x4553ff['model']=_[_0x75d1('0x52')](db['FreshsalesField'][_0x75d1('0x53')]);_0x4553ff[_0x75d1('0x3a')]=_[_0x75d1('0x52')](_0x254cfe['query']);_0x4553ff[_0x75d1('0x43')]=_[_0x75d1('0x3c')](_0x4553ff[_0x75d1('0x38')],_0x4553ff[_0x75d1('0x3a')]);_0x1baaca[_0x75d1('0x3b')]=_[_0x75d1('0x3c')](_0x4553ff[_0x75d1('0x38')],qs[_0x75d1('0x3d')](_0x254cfe[_0x75d1('0x3a')][_0x75d1('0x3d')]));_0x1baaca[_0x75d1('0x3b')]=_0x1baaca[_0x75d1('0x3b')][_0x75d1('0x3e')]?_0x1baaca[_0x75d1('0x3b')]:_0x4553ff['model'];_0x1baaca['order']=qs[_0x75d1('0x42')](_0x254cfe[_0x75d1('0x3a')]['sort']);_0x1baaca[_0x75d1('0x46')]=qs['filters'](_['pick'](_0x254cfe['query'],_0x4553ff[_0x75d1('0x43')]));if(_0x254cfe[_0x75d1('0x3a')][_0x75d1('0x45')]){_0x1baaca[_0x75d1('0x46')]=_[_0x75d1('0x47')](_0x1baaca['where'],{'$or':_[_0x75d1('0x39')](_0x1baaca[_0x75d1('0x3b')],function(_0x1d0f7b){var _0x13f54a={};_0x13f54a[_0x1d0f7b]={'$like':'%'+_0x254cfe[_0x75d1('0x3a')]['filter']+'%'};return _0x13f54a;})});}_0x1baaca=_[_0x75d1('0x47')]({},_0x1baaca,_0x254cfe['options']);return _0x50d202[_0x75d1('0x5b')](_0x1baaca);}})[_0x75d1('0x1b')](function(_0x3d5355){if(_0x3d5355){_0x5482db=_0x3d5355['length'];if(!_0x254cfe['query']['hasOwnProperty'](_0x75d1('0x40'))){_0x1baaca[_0x75d1('0x2a')]=qs[_0x75d1('0x2a')](_0x254cfe[_0x75d1('0x3a')][_0x75d1('0x2a')]);_0x1baaca[_0x75d1('0x29')]=qs['offset'](_0x254cfe[_0x75d1('0x3a')][_0x75d1('0x29')]);}return _0x50d202['getDescriptions'](_0x1baaca);}})[_0x75d1('0x1b')](function(_0x5c16be){if(_0x5c16be){return _0x5c16be?{'count':_0x5482db,'rows':_0x5c16be}:null;}})['then'](respondWithResult(_0x1f9ac2,null))['catch'](handleError(_0x1f9ac2,null));};exports[_0x75d1('0x5c')]=function(_0x55bc53,_0x5852b3,_0x3f582c){var _0x4e546f={};var _0x451828={};var _0x13179c;var _0x739cc2;return db[_0x75d1('0x4a')][_0x75d1('0x59')]({'where':{'id':_0x55bc53[_0x75d1('0x51')]['id']}})[_0x75d1('0x1b')](handleEntityNotFound(_0x5852b3,null))[_0x75d1('0x1b')](function(_0x51b682){if(_0x51b682){_0x13179c=_0x51b682;_0x451828[_0x75d1('0x38')]=_['keys'](db[_0x75d1('0x5a')][_0x75d1('0x53')]);_0x451828[_0x75d1('0x3a')]=_['keys'](_0x55bc53[_0x75d1('0x3a')]);_0x451828[_0x75d1('0x43')]=_[_0x75d1('0x3c')](_0x451828[_0x75d1('0x38')],_0x451828[_0x75d1('0x3a')]);_0x4e546f[_0x75d1('0x3b')]=_[_0x75d1('0x3c')](_0x451828['model'],qs[_0x75d1('0x3d')](_0x55bc53[_0x75d1('0x3a')][_0x75d1('0x3d')]));_0x4e546f[_0x75d1('0x3b')]=_0x4e546f[_0x75d1('0x3b')]['length']?_0x4e546f['attributes']:_0x451828[_0x75d1('0x38')];_0x4e546f['order']=qs[_0x75d1('0x42')](_0x55bc53[_0x75d1('0x3a')][_0x75d1('0x42')]);_0x4e546f[_0x75d1('0x46')]=qs['filters'](_['pick'](_0x55bc53[_0x75d1('0x3a')],_0x451828[_0x75d1('0x43')]));if(_0x55bc53[_0x75d1('0x3a')][_0x75d1('0x45')]){_0x4e546f[_0x75d1('0x46')]=_['merge'](_0x4e546f[_0x75d1('0x46')],{'$or':_[_0x75d1('0x39')](_0x4e546f['attributes'],function(_0x16895a){var _0xda0e31={};_0xda0e31[_0x16895a]={'$like':'%'+_0x55bc53[_0x75d1('0x3a')][_0x75d1('0x45')]+'%'};return _0xda0e31;})});}_0x4e546f=_[_0x75d1('0x47')]({},_0x4e546f,_0x55bc53[_0x75d1('0x49')]);return _0x13179c['getFields'](_0x4e546f);}})[_0x75d1('0x1b')](function(_0x1b026e){if(_0x1b026e){_0x739cc2=_0x1b026e[_0x75d1('0x3e')];if(!_0x55bc53[_0x75d1('0x3a')][_0x75d1('0x3f')](_0x75d1('0x40'))){_0x4e546f['limit']=qs[_0x75d1('0x2a')](_0x55bc53['query'][_0x75d1('0x2a')]);_0x4e546f[_0x75d1('0x29')]=qs[_0x75d1('0x29')](_0x55bc53[_0x75d1('0x3a')][_0x75d1('0x29')]);}return _0x13179c[_0x75d1('0x5c')](_0x4e546f);}})['then'](function(_0x78d88b){if(_0x78d88b){return _0x78d88b?{'count':_0x739cc2,'rows':_0x78d88b}:null;}})[_0x75d1('0x1b')](respondWithResult(_0x5852b3,null))[_0x75d1('0x55')](handleError(_0x5852b3,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index db0765d..9d6e861 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 _0xab02=['exports','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes'];(function(_0x4de9cf,_0x43fadf){var _0x22f258=function(_0x5c64cd){while(--_0x5c64cd){_0x4de9cf['push'](_0x4de9cf['shift']());}};_0x22f258(++_0x43fadf);}(_0xab02,0xc5));var _0x2ab0=function(_0x54167d,_0x5324b4){_0x54167d=_0x54167d-0x0;var _0x292a30=_0xab02[_0x54167d];return _0x292a30;};'use strict';var _=require(_0x2ab0('0x0'));var util=require(_0x2ab0('0x1'));var logger=require(_0x2ab0('0x2'))(_0x2ab0('0x3'));var moment=require(_0x2ab0('0x4'));var BPromise=require(_0x2ab0('0x5'));var rp=require(_0x2ab0('0x6'));var fs=require('fs');var path=require(_0x2ab0('0x7'));var rimraf=require(_0x2ab0('0x8'));var config=require(_0x2ab0('0x9'));var attributes=require(_0x2ab0('0xa'));module[_0x2ab0('0xb')]=function(_0x35197d,_0x4bfdd4){return _0x35197d[_0x2ab0('0xc')]('FreshsalesConfiguration',attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa25d=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration','int_freshsales_configurations','lodash'];(function(_0x42e8,_0x197f0b){var _0x4d7786=function(_0x2b0fb6){while(--_0x2b0fb6){_0x42e8['push'](_0x42e8['shift']());}};_0x4d7786(++_0x197f0b);}(_0xa25d,0x194));var _0xda25=function(_0x38051b,_0x46cf1e){_0x38051b=_0x38051b-0x0;var _0x349422=_0xa25d[_0x38051b];return _0x349422;};'use strict';var _=require(_0xda25('0x0'));var util=require(_0xda25('0x1'));var logger=require(_0xda25('0x2'))(_0xda25('0x3'));var moment=require(_0xda25('0x4'));var BPromise=require(_0xda25('0x5'));var rp=require(_0xda25('0x6'));var fs=require('fs');var path=require(_0xda25('0x7'));var rimraf=require(_0xda25('0x8'));var config=require(_0xda25('0x9'));var attributes=require(_0xda25('0xa'));module[_0xda25('0xb')]=function(_0xace61d,_0x33c4b7){return _0xace61d[_0xda25('0xc')](_0xda25('0xd'),attributes,{'tableName':_0xda25('0xe'),'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 8ffd258..ef488ac 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 _0x86fd=['debug','error','code','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x86fd,0xa7));var _0xd86f=function(_0x539533,_0x59b89b){_0x539533=_0x539533-0x0;var _0x3942f3=_0x86fd[_0x539533];return _0x3942f3;};'use strict';var _=require(_0xd86f('0x0'));var util=require(_0xd86f('0x1'));var moment=require(_0xd86f('0x2'));var BPromise=require(_0xd86f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd86f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd86f('0x5'));var logger=require(_0xd86f('0x6'))('rpc');var config=require(_0xd86f('0x7'));var jayson=require(_0xd86f('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2843b2,_0x500cb8,_0x3f1920){return new BPromise(function(_0x4cd46e,_0x2b4117){return client[_0xd86f('0x9')](_0x2843b2,_0x3f1920)[_0xd86f('0xa')](function(_0x1205ae){logger['info'](_0xd86f('0xb'),_0x500cb8,_0xd86f('0xc'));logger[_0xd86f('0xd')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x500cb8,'request\x20sent',JSON['stringify'](_0x1205ae));if(_0x1205ae['error']){if(_0x1205ae[_0xd86f('0xe')][_0xd86f('0xf')]===0x1f4){logger[_0xd86f('0xe')](_0xd86f('0xb'),_0x500cb8,_0x1205ae['error']['message']);return _0x2b4117(_0x1205ae[_0xd86f('0xe')][_0xd86f('0x10')]);}logger[_0xd86f('0xe')](_0xd86f('0xb'),_0x500cb8,_0x1205ae[_0xd86f('0xe')]['message']);return _0x4cd46e(_0x1205ae['error']['message']);}else{logger[_0xd86f('0x11')](_0xd86f('0xb'),_0x500cb8,_0xd86f('0xc'));_0x4cd46e(_0x1205ae[_0xd86f('0x12')][_0xd86f('0x10')]);}})[_0xd86f('0x13')](function(_0x5cd7c9){logger[_0xd86f('0xe')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x500cb8,_0x5cd7c9);_0x2b4117(_0x5cd7c9);});});} \ No newline at end of file +var _0x4af8=['request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','FreshsalesConfiguration,\x20%s,\x20%s','result','catch','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info'];(function(_0x27e616,_0x52b4ba){var _0x58681b=function(_0x1c0af9){while(--_0x1c0af9){_0x27e616['push'](_0x27e616['shift']());}};_0x58681b(++_0x52b4ba);}(_0x4af8,0x1ad));var _0x84af=function(_0x4bb66f,_0x3cd682){_0x4bb66f=_0x4bb66f-0x0;var _0xf2772f=_0x4af8[_0x4bb66f];return _0xf2772f;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x84af('0x0'));var fs=require('fs');var Redis=require(_0x84af('0x1'));var db=require(_0x84af('0x2'))['db'];var utils=require(_0x84af('0x3'));var logger=require('../../config/logger')(_0x84af('0x4'));var config=require(_0x84af('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x84af('0x6')][_0x84af('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x550ee6,_0x422c5b,_0x294bc8){return new BPromise(function(_0x483ecc,_0x5b5e45){return client[_0x84af('0x8')](_0x550ee6,_0x294bc8)[_0x84af('0x9')](function(_0x479e1b){logger[_0x84af('0xa')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x422c5b,_0x84af('0xb'));logger[_0x84af('0xc')](_0x84af('0xd'),_0x422c5b,_0x84af('0xb'),JSON['stringify'](_0x479e1b));if(_0x479e1b[_0x84af('0xe')]){if(_0x479e1b['error'][_0x84af('0xf')]===0x1f4){logger[_0x84af('0xe')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x422c5b,_0x479e1b[_0x84af('0xe')][_0x84af('0x10')]);return _0x5b5e45(_0x479e1b[_0x84af('0xe')][_0x84af('0x10')]);}logger['error'](_0x84af('0x11'),_0x422c5b,_0x479e1b['error'][_0x84af('0x10')]);return _0x483ecc(_0x479e1b[_0x84af('0xe')]['message']);}else{logger[_0x84af('0xa')](_0x84af('0x11'),_0x422c5b,'request\x20sent');_0x483ecc(_0x479e1b[_0x84af('0x12')]['message']);}})[_0x84af('0x13')](function(_0x33baf1){logger['error']('FreshsalesConfiguration,\x20%s,\x20%s',_0x422c5b,_0x33baf1);_0x5b5e45(_0x33baf1);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index ec9bb2d..ff1a677 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 _0x3fd7=['multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3fd7,0x78));var _0x73fd=function(_0x89f538,_0x1a05d0){_0x89f538=_0x89f538-0x0;var _0x5792f6=_0x3fd7[_0x89f538];return _0x5792f6;};'use strict';var multer=require(_0x73fd('0x0'));var util=require(_0x73fd('0x1'));var path=require(_0x73fd('0x2'));var timeout=require(_0x73fd('0x3'));var express=require('express');var router=express[_0x73fd('0x4')]();var auth=require(_0x73fd('0x5'));var interaction=require(_0x73fd('0x6'));var config=require(_0x73fd('0x7'));var controller=require(_0x73fd('0x8'));router[_0x73fd('0x9')]('/',auth[_0x73fd('0xa')](),controller[_0x73fd('0xb')]);router[_0x73fd('0x9')](_0x73fd('0xc'),auth[_0x73fd('0xa')](),controller[_0x73fd('0xd')]);router[_0x73fd('0xe')]('/',auth['isAuthenticated'](),controller[_0x73fd('0xf')]);router[_0x73fd('0x10')](_0x73fd('0xc'),auth['isAuthenticated'](),controller[_0x73fd('0x11')]);router['delete'](_0x73fd('0xc'),auth['isAuthenticated'](),controller[_0x73fd('0x12')]);module[_0x73fd('0x13')]=router; \ No newline at end of file +var _0x888f=['multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','isAuthenticated','index','get','show','create','/:id','update','delete','destroy','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x888f,0x168));var _0xf888=function(_0x260e76,_0xe073d0){_0x260e76=_0x260e76-0x0;var _0xd9ebac=_0x888f[_0x260e76];return _0xd9ebac;};'use strict';var multer=require(_0xf888('0x0'));var util=require(_0xf888('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf888('0x2'));var router=express[_0xf888('0x3')]();var auth=require(_0xf888('0x4'));var interaction=require(_0xf888('0x5'));var config=require(_0xf888('0x6'));var controller=require(_0xf888('0x7'));router['get']('/',auth[_0xf888('0x8')](),controller[_0xf888('0x9')]);router[_0xf888('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xf888('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xf888('0xc')]);router['put'](_0xf888('0xd'),auth[_0xf888('0x8')](),controller[_0xf888('0xe')]);router[_0xf888('0xf')](_0xf888('0xd'),auth[_0xf888('0x8')](),controller[_0xf888('0x10')]);module[_0xf888('0x11')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 4762129..64c6fd1 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 _0x4ac0=['customVariable','keyValue','string','STRING','sequelize','variable'];(function(_0x1043ea,_0x22d2bb){var _0x3b9cf6=function(_0x418b04){while(--_0x418b04){_0x1043ea['push'](_0x1043ea['shift']());}};_0x3b9cf6(++_0x22d2bb);}(_0x4ac0,0xa0));var _0x04ac=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x4ac0[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require(_0x04ac('0x0'));module['exports']={'type':{'type':Sequelize['ENUM']('string',_0x04ac('0x1'),_0x04ac('0x2'),_0x04ac('0x3')),'defaultValue':_0x04ac('0x4')},'content':{'type':Sequelize[_0x04ac('0x5')]},'key':{'type':Sequelize[_0x04ac('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x04ac('0x4'),'variable',_0x04ac('0x2'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x04ac('0x5')]},'nameField':{'type':Sequelize[_0x04ac('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x04ac('0x5')]}}; \ No newline at end of file +var _0xdb49=['STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue'];(function(_0x59b9d3,_0x384472){var _0x171163=function(_0x251233){while(--_0x251233){_0x59b9d3['push'](_0x59b9d3['shift']());}};_0x171163(++_0x384472);}(_0xdb49,0x122));var _0x9db4=function(_0xe88b2a,_0x5b0441){_0xe88b2a=_0xe88b2a-0x0;var _0x253bff=_0xdb49[_0xe88b2a];return _0x253bff;};'use strict';var Sequelize=require(_0x9db4('0x0'));module[_0x9db4('0x1')]={'type':{'type':Sequelize[_0x9db4('0x2')](_0x9db4('0x3'),_0x9db4('0x4'),_0x9db4('0x5'),_0x9db4('0x6')),'defaultValue':_0x9db4('0x3')},'content':{'type':Sequelize[_0x9db4('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x9db4('0x2')]('string',_0x9db4('0x4'),_0x9db4('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x9db4('0x7')]},'nameField':{'type':Sequelize[_0x9db4('0x7')]},'customField':{'type':Sequelize[_0x9db4('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9db4('0x7')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 4000910..99f90f5 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 _0xa25c=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','error','name','send','index','map','FreshsalesField','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','merge','VIRTUAL','includeAll','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','squel','crypto','jsforce','desk.js','to-csv','ioredis'];(function(_0x3e182f,_0x380ec7){var _0x23edc9=function(_0x3ca65e){while(--_0x3ca65e){_0x3e182f['push'](_0x3e182f['shift']());}};_0x23edc9(++_0x380ec7);}(_0xa25c,0x13f));var _0xca25=function(_0x37a61a,_0x522a83){_0x37a61a=_0x37a61a-0x0;var _0x320494=_0xa25c[_0x37a61a];return _0x320494;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xca25('0x0'));var rimraf=require(_0xca25('0x1'));var zipdir=require(_0xca25('0x2'));var jsonpatch=require(_0xca25('0x3'));var rp=require(_0xca25('0x4'));var moment=require(_0xca25('0x5'));var BPromise=require(_0xca25('0x6'));var Mustache=require(_0xca25('0x7'));var util=require('util');var path=require(_0xca25('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xca25('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xca25('0xa'));var crypto=require(_0xca25('0xb'));var jsforce=require(_0xca25('0xc'));var deskjs=require(_0xca25('0xd'));var toCsv=require(_0xca25('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xca25('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xca25('0x10'));var as=require(_0xca25('0x11'));var hardwareService=require(_0xca25('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xca25('0x13'));var db=require(_0xca25('0x14'))['db'];function respondWithStatusCode(_0x3ced96,_0x5697aa){_0x5697aa=_0x5697aa||0xcc;return function(_0x534bca){if(_0x534bca){return _0x3ced96[_0xca25('0x15')](_0x5697aa);}return _0x3ced96['status'](_0x5697aa)[_0xca25('0x16')]();};}function respondWithResult(_0xc5a21a,_0x35093c){_0x35093c=_0x35093c||0xc8;return function(_0x1a3207){if(_0x1a3207){return _0xc5a21a[_0xca25('0x17')](_0x35093c)[_0xca25('0x18')](_0x1a3207);}};}function respondWithFilteredResult(_0x241b80,_0x33aa25){return function(_0x2a1af3){if(_0x2a1af3){var _0x42bc1e=_0x2a1af3[_0xca25('0x19')],_0x2b5cef=_0x33aa25['offset'],_0x587403=_0x33aa25[_0xca25('0x1a')]+_0x33aa25[_0xca25('0x1b')],_0x3616c3;if(_0x587403>=_0x42bc1e){_0x587403=_0x42bc1e;_0x3616c3=0xc8;}else{_0x3616c3=0xce;}_0x241b80[_0xca25('0x17')](_0x3616c3);return _0x241b80[_0xca25('0x1c')](_0xca25('0x1d'),_0x2b5cef+'-'+_0x587403+'/'+_0x42bc1e)['json'](_0x2a1af3);}return null;};}function patchUpdates(_0x11d7f4){return function(_0x47a74b){try{jsonpatch[_0xca25('0x1e')](_0x47a74b,_0x11d7f4,!![]);}catch(_0x1cf09c){return BPromise[_0xca25('0x1f')](_0x1cf09c);}return _0x47a74b['save']();};}function saveUpdates(_0x2b6ec6,_0x3598c7){return function(_0x235d92){if(_0x235d92){return _0x235d92[_0xca25('0x20')](_0x2b6ec6)[_0xca25('0x21')](function(_0x38d6e6){return _0x38d6e6;});}return null;};}function removeEntity(_0x292c88,_0x54c91a){return function(_0x48fdf5){if(_0x48fdf5){return _0x48fdf5[_0xca25('0x22')]()[_0xca25('0x21')](function(){_0x292c88[_0xca25('0x17')](0xcc)[_0xca25('0x16')]();});}};}function handleEntityNotFound(_0x2615d4,_0x40e5e2){return function(_0x8cec43){if(!_0x8cec43){_0x2615d4[_0xca25('0x15')](0x194);}return _0x8cec43;};}function handleError(_0x2f1f2a,_0x349364){_0x349364=_0x349364||0x1f4;return function(_0x365ba4){logger[_0xca25('0x23')](_0x365ba4['stack']);if(_0x365ba4[_0xca25('0x24')]){delete _0x365ba4[_0xca25('0x24')];}_0x2f1f2a[_0xca25('0x17')](_0x349364)[_0xca25('0x25')](_0x365ba4);};}exports[_0xca25('0x26')]=function(_0x5d60f9,_0x274de1){var _0x41eb3a={},_0x3d7414={},_0xd61524={'count':0x0,'rows':[]};var _0x2ae0e3=_[_0xca25('0x27')](db[_0xca25('0x28')][_0xca25('0x29')],function(_0x3e72cb){return{'name':_0x3e72cb[_0xca25('0x2a')],'type':_0x3e72cb[_0xca25('0x2b')][_0xca25('0x2c')]};});_0x3d7414[_0xca25('0x2d')]=_[_0xca25('0x27')](_0x2ae0e3,_0xca25('0x24'));_0x3d7414[_0xca25('0x2e')]=_[_0xca25('0x2f')](_0x5d60f9[_0xca25('0x2e')]);_0x3d7414['filters']=_[_0xca25('0x30')](_0x3d7414[_0xca25('0x2d')],_0x3d7414[_0xca25('0x2e')]);_0x41eb3a['attributes']=_[_0xca25('0x30')](_0x3d7414[_0xca25('0x2d')],qs[_0xca25('0x31')](_0x5d60f9[_0xca25('0x2e')][_0xca25('0x31')]));_0x41eb3a[_0xca25('0x32')]=_0x41eb3a['attributes'][_0xca25('0x33')]?_0x41eb3a['attributes']:_0x3d7414[_0xca25('0x2d')];if(!_0x5d60f9[_0xca25('0x2e')][_0xca25('0x34')]('nolimit')){_0x41eb3a[_0xca25('0x1b')]=qs[_0xca25('0x1b')](_0x5d60f9[_0xca25('0x2e')][_0xca25('0x1b')]);_0x41eb3a[_0xca25('0x1a')]=qs['offset'](_0x5d60f9[_0xca25('0x2e')][_0xca25('0x1a')]);}_0x41eb3a[_0xca25('0x35')]=qs[_0xca25('0x36')](_0x5d60f9[_0xca25('0x2e')][_0xca25('0x36')]);_0x41eb3a[_0xca25('0x37')]=qs['filters'](_['pick'](_0x5d60f9[_0xca25('0x2e')],_0x3d7414[_0xca25('0x38')]));if(_0x5d60f9['query']['filter']){_0x41eb3a[_0xca25('0x37')]=_[_0xca25('0x39')](_0x41eb3a[_0xca25('0x37')],{'$or':_['map'](_0x2ae0e3,function(_0x9c1ce3){if(_0x9c1ce3[_0xca25('0x2b')]!==_0xca25('0x3a')){var _0x1dc9ca={};_0x1dc9ca[_0x9c1ce3[_0xca25('0x24')]]={'$like':'%'+_0x5d60f9[_0xca25('0x2e')]['filter']+'%'};return _0x1dc9ca;}})});}_0x41eb3a=_[_0xca25('0x39')]({},_0x41eb3a,_0x5d60f9['options']);var _0x4b1460={'where':_0x41eb3a[_0xca25('0x37')]};return db[_0xca25('0x28')][_0xca25('0x19')](_0x4b1460)[_0xca25('0x21')](function(_0xe41645){_0xd61524[_0xca25('0x19')]=_0xe41645;if(_0x5d60f9[_0xca25('0x2e')][_0xca25('0x3b')]){_0x41eb3a['include']=[{'all':!![]}];}return db[_0xca25('0x28')]['findAll'](_0x41eb3a);})[_0xca25('0x21')](function(_0x4a5c10){_0xd61524[_0xca25('0x3c')]=_0x4a5c10;return _0xd61524;})[_0xca25('0x21')](respondWithFilteredResult(_0x274de1,_0x41eb3a))[_0xca25('0x3d')](handleError(_0x274de1,null));};exports[_0xca25('0x3e')]=function(_0x5c5adb,_0x422ba6){var _0x5aafa5={'raw':!![],'where':{'id':_0x5c5adb[_0xca25('0x3f')]['id']}},_0x275e3d={};_0x275e3d['model']=_[_0xca25('0x2f')](db[_0xca25('0x28')][_0xca25('0x29')]);_0x275e3d[_0xca25('0x2e')]=_[_0xca25('0x2f')](_0x5c5adb[_0xca25('0x2e')]);_0x275e3d[_0xca25('0x38')]=_['intersection'](_0x275e3d[_0xca25('0x2d')],_0x275e3d[_0xca25('0x2e')]);_0x5aafa5['attributes']=_['intersection'](_0x275e3d['model'],qs['fields'](_0x5c5adb[_0xca25('0x2e')][_0xca25('0x31')]));_0x5aafa5[_0xca25('0x32')]=_0x5aafa5[_0xca25('0x32')]['length']?_0x5aafa5[_0xca25('0x32')]:_0x275e3d[_0xca25('0x2d')];if(_0x5c5adb[_0xca25('0x2e')][_0xca25('0x3b')]){_0x5aafa5['include']=[{'all':!![]}];}_0x5aafa5=_[_0xca25('0x39')]({},_0x5aafa5,_0x5c5adb['options']);return db[_0xca25('0x28')][_0xca25('0x40')](_0x5aafa5)[_0xca25('0x21')](handleEntityNotFound(_0x422ba6,null))[_0xca25('0x21')](respondWithResult(_0x422ba6,null))[_0xca25('0x3d')](handleError(_0x422ba6,null));};exports[_0xca25('0x41')]=function(_0x5978f4,_0x19b077){return db[_0xca25('0x28')][_0xca25('0x41')](_0x5978f4[_0xca25('0x42')],{})[_0xca25('0x21')](respondWithResult(_0x19b077,0xc9))[_0xca25('0x3d')](handleError(_0x19b077,null));};exports[_0xca25('0x20')]=function(_0x352a17,_0x3ba55c){if(_0x352a17[_0xca25('0x42')]['id']){delete _0x352a17[_0xca25('0x42')]['id'];}return db[_0xca25('0x28')][_0xca25('0x40')]({'where':{'id':_0x352a17[_0xca25('0x3f')]['id']}})[_0xca25('0x21')](handleEntityNotFound(_0x3ba55c,null))[_0xca25('0x21')](saveUpdates(_0x352a17[_0xca25('0x42')],null))[_0xca25('0x21')](respondWithResult(_0x3ba55c,null))['catch'](handleError(_0x3ba55c,null));};exports[_0xca25('0x22')]=function(_0x39d342,_0x9fcba){return db[_0xca25('0x28')]['find']({'where':{'id':_0x39d342[_0xca25('0x3f')]['id']}})[_0xca25('0x21')](handleEntityNotFound(_0x9fcba,null))['then'](removeEntity(_0x9fcba,null))[_0xca25('0x3d')](handleError(_0x9fcba,null));}; \ No newline at end of file +var _0x2e54=['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','sendStatus','status','end','count','offset','limit','set','Content-Range','reject','update','then','destroy','error','stack','map','FreshsalesField','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','where','VIRTUAL','merge','includeAll','include','findAll','catch','show','rawAttributes','options','create','body','find','params','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x3c6d2f,_0x2eb1c7){var _0x4959cc=function(_0x10957c){while(--_0x10957c){_0x3c6d2f['push'](_0x3c6d2f['shift']());}};_0x4959cc(++_0x2eb1c7);}(_0x2e54,0x1dd));var _0x42e5=function(_0x1ac828,_0x320856){_0x1ac828=_0x1ac828-0x0;var _0x4ad611=_0x2e54[_0x1ac828];return _0x4ad611;};'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'];function respondWithStatusCode(_0x3a5189,_0x12385d){_0x12385d=_0x12385d||0xcc;return function(_0x4530ba){if(_0x4530ba){return _0x3a5189[_0x42e5('0x17')](_0x12385d);}return _0x3a5189[_0x42e5('0x18')](_0x12385d)[_0x42e5('0x19')]();};}function respondWithResult(_0x2c18f7,_0x96fae2){_0x96fae2=_0x96fae2||0xc8;return function(_0x447648){if(_0x447648){return _0x2c18f7[_0x42e5('0x18')](_0x96fae2)['json'](_0x447648);}};}function respondWithFilteredResult(_0x3b3dd9,_0x1d8e52){return function(_0x4034bd){if(_0x4034bd){var _0x388300=_0x4034bd[_0x42e5('0x1a')],_0x2f4999=_0x1d8e52[_0x42e5('0x1b')],_0x263a3d=_0x1d8e52[_0x42e5('0x1b')]+_0x1d8e52[_0x42e5('0x1c')],_0x1a26c6;if(_0x263a3d>=_0x388300){_0x263a3d=_0x388300;_0x1a26c6=0xc8;}else{_0x1a26c6=0xce;}_0x3b3dd9[_0x42e5('0x18')](_0x1a26c6);return _0x3b3dd9[_0x42e5('0x1d')](_0x42e5('0x1e'),_0x2f4999+'-'+_0x263a3d+'/'+_0x388300)['json'](_0x4034bd);}return null;};}function patchUpdates(_0x1460c0){return function(_0x4a129e){try{jsonpatch['apply'](_0x4a129e,_0x1460c0,!![]);}catch(_0x14d16d){return BPromise[_0x42e5('0x1f')](_0x14d16d);}return _0x4a129e['save']();};}function saveUpdates(_0x41a823,_0x39a3e2){return function(_0x1c2169){if(_0x1c2169){return _0x1c2169[_0x42e5('0x20')](_0x41a823)[_0x42e5('0x21')](function(_0xa6825e){return _0xa6825e;});}return null;};}function removeEntity(_0x36ca89,_0x58eee5){return function(_0x4da508){if(_0x4da508){return _0x4da508[_0x42e5('0x22')]()['then'](function(){_0x36ca89[_0x42e5('0x18')](0xcc)[_0x42e5('0x19')]();});}};}function handleEntityNotFound(_0x37d10e,_0x49490f){return function(_0x32380f){if(!_0x32380f){_0x37d10e['sendStatus'](0x194);}return _0x32380f;};}function handleError(_0x2e5bb6,_0xf29221){_0xf29221=_0xf29221||0x1f4;return function(_0x14640d){logger[_0x42e5('0x23')](_0x14640d[_0x42e5('0x24')]);if(_0x14640d['name']){delete _0x14640d['name'];}_0x2e5bb6[_0x42e5('0x18')](_0xf29221)['send'](_0x14640d);};}exports['index']=function(_0x1b60be,_0x5b1727){var _0x392c6b={},_0x2d9e65={},_0x4fd119={'count':0x0,'rows':[]};var _0x1c8ee4=_[_0x42e5('0x25')](db[_0x42e5('0x26')]['rawAttributes'],function(_0x3e2ea5){return{'name':_0x3e2ea5[_0x42e5('0x27')],'type':_0x3e2ea5[_0x42e5('0x28')][_0x42e5('0x29')]};});_0x2d9e65[_0x42e5('0x2a')]=_[_0x42e5('0x25')](_0x1c8ee4,_0x42e5('0x2b'));_0x2d9e65[_0x42e5('0x2c')]=_[_0x42e5('0x2d')](_0x1b60be[_0x42e5('0x2c')]);_0x2d9e65[_0x42e5('0x2e')]=_[_0x42e5('0x2f')](_0x2d9e65[_0x42e5('0x2a')],_0x2d9e65['query']);_0x392c6b[_0x42e5('0x30')]=_[_0x42e5('0x2f')](_0x2d9e65[_0x42e5('0x2a')],qs[_0x42e5('0x31')](_0x1b60be['query']['fields']));_0x392c6b[_0x42e5('0x30')]=_0x392c6b['attributes'][_0x42e5('0x32')]?_0x392c6b['attributes']:_0x2d9e65[_0x42e5('0x2a')];if(!_0x1b60be[_0x42e5('0x2c')][_0x42e5('0x33')]('nolimit')){_0x392c6b[_0x42e5('0x1c')]=qs[_0x42e5('0x1c')](_0x1b60be['query'][_0x42e5('0x1c')]);_0x392c6b['offset']=qs[_0x42e5('0x1b')](_0x1b60be[_0x42e5('0x2c')][_0x42e5('0x1b')]);}_0x392c6b[_0x42e5('0x34')]=qs[_0x42e5('0x35')](_0x1b60be[_0x42e5('0x2c')][_0x42e5('0x35')]);_0x392c6b['where']=qs['filters'](_[_0x42e5('0x36')](_0x1b60be[_0x42e5('0x2c')],_0x2d9e65[_0x42e5('0x2e')]));if(_0x1b60be['query']['filter']){_0x392c6b['where']=_['merge'](_0x392c6b[_0x42e5('0x37')],{'$or':_[_0x42e5('0x25')](_0x1c8ee4,function(_0x24958b){if(_0x24958b[_0x42e5('0x28')]!==_0x42e5('0x38')){var _0x2a6e9c={};_0x2a6e9c[_0x24958b[_0x42e5('0x2b')]]={'$like':'%'+_0x1b60be[_0x42e5('0x2c')]['filter']+'%'};return _0x2a6e9c;}})});}_0x392c6b=_[_0x42e5('0x39')]({},_0x392c6b,_0x1b60be['options']);var _0x470338={'where':_0x392c6b[_0x42e5('0x37')]};return db[_0x42e5('0x26')][_0x42e5('0x1a')](_0x470338)[_0x42e5('0x21')](function(_0x162679){_0x4fd119[_0x42e5('0x1a')]=_0x162679;if(_0x1b60be['query'][_0x42e5('0x3a')]){_0x392c6b[_0x42e5('0x3b')]=[{'all':!![]}];}return db['FreshsalesField'][_0x42e5('0x3c')](_0x392c6b);})['then'](function(_0x53b0bd){_0x4fd119['rows']=_0x53b0bd;return _0x4fd119;})[_0x42e5('0x21')](respondWithFilteredResult(_0x5b1727,_0x392c6b))[_0x42e5('0x3d')](handleError(_0x5b1727,null));};exports[_0x42e5('0x3e')]=function(_0x44a98c,_0xef482b){var _0x77aa22={'raw':!![],'where':{'id':_0x44a98c['params']['id']}},_0x1fbde={};_0x1fbde[_0x42e5('0x2a')]=_[_0x42e5('0x2d')](db['FreshsalesField'][_0x42e5('0x3f')]);_0x1fbde[_0x42e5('0x2c')]=_['keys'](_0x44a98c[_0x42e5('0x2c')]);_0x1fbde[_0x42e5('0x2e')]=_[_0x42e5('0x2f')](_0x1fbde[_0x42e5('0x2a')],_0x1fbde[_0x42e5('0x2c')]);_0x77aa22['attributes']=_[_0x42e5('0x2f')](_0x1fbde[_0x42e5('0x2a')],qs[_0x42e5('0x31')](_0x44a98c[_0x42e5('0x2c')]['fields']));_0x77aa22[_0x42e5('0x30')]=_0x77aa22[_0x42e5('0x30')][_0x42e5('0x32')]?_0x77aa22[_0x42e5('0x30')]:_0x1fbde[_0x42e5('0x2a')];if(_0x44a98c[_0x42e5('0x2c')][_0x42e5('0x3a')]){_0x77aa22[_0x42e5('0x3b')]=[{'all':!![]}];}_0x77aa22=_['merge']({},_0x77aa22,_0x44a98c[_0x42e5('0x40')]);return db['FreshsalesField']['find'](_0x77aa22)[_0x42e5('0x21')](handleEntityNotFound(_0xef482b,null))[_0x42e5('0x21')](respondWithResult(_0xef482b,null))[_0x42e5('0x3d')](handleError(_0xef482b,null));};exports[_0x42e5('0x41')]=function(_0x3229d6,_0x9980dc){return db[_0x42e5('0x26')]['create'](_0x3229d6[_0x42e5('0x42')],{})[_0x42e5('0x21')](respondWithResult(_0x9980dc,0xc9))[_0x42e5('0x3d')](handleError(_0x9980dc,null));};exports[_0x42e5('0x20')]=function(_0x1086b2,_0xc8de4d){if(_0x1086b2[_0x42e5('0x42')]['id']){delete _0x1086b2[_0x42e5('0x42')]['id'];}return db['FreshsalesField'][_0x42e5('0x43')]({'where':{'id':_0x1086b2[_0x42e5('0x44')]['id']}})[_0x42e5('0x21')](handleEntityNotFound(_0xc8de4d,null))[_0x42e5('0x21')](saveUpdates(_0x1086b2[_0x42e5('0x42')],null))[_0x42e5('0x21')](respondWithResult(_0xc8de4d,null))[_0x42e5('0x3d')](handleError(_0xc8de4d,null));};exports[_0x42e5('0x22')]=function(_0x2586b0,_0x528ddd){return db[_0x42e5('0x26')]['find']({'where':{'id':_0x2586b0[_0x42e5('0x44')]['id']}})[_0x42e5('0x21')](handleEntityNotFound(_0x528ddd,null))[_0x42e5('0x21')](removeEntity(_0x528ddd,null))['catch'](handleError(_0x528ddd,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 1cd848e..f3a9890 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 _0xbd3c=['path','rimraf','../../config/environment','exports','FreshsalesField','int_freshsales_fields','idField','FieldId','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2e51e7,_0x5a8213){var _0x2f1675=function(_0x562181){while(--_0x562181){_0x2e51e7['push'](_0x2e51e7['shift']());}};_0x2f1675(++_0x5a8213);}(_0xbd3c,0x166));var _0xcbd3=function(_0x427c69,_0x292d18){_0x427c69=_0x427c69-0x0;var _0x21b2a6=_0xbd3c[_0x427c69];return _0x21b2a6;};'use strict';var _=require('lodash');var util=require(_0xcbd3('0x0'));var logger=require(_0xcbd3('0x1'))(_0xcbd3('0x2'));var moment=require(_0xcbd3('0x3'));var BPromise=require(_0xcbd3('0x4'));var rp=require(_0xcbd3('0x5'));var fs=require('fs');var path=require(_0xcbd3('0x6'));var rimraf=require(_0xcbd3('0x7'));var config=require(_0xcbd3('0x8'));var attributes=require('./intFreshsalesField.attributes');module[_0xcbd3('0x9')]=function(_0x143493,_0x11bcab){return _0x143493['define'](_0xcbd3('0xa'),attributes,{'tableName':_0xcbd3('0xb'),'paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0xcbd3('0xc'),_0xcbd3('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x047d=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','FieldId','lodash','util','../../config/logger','api'];(function(_0x14e451,_0x49a121){var _0x283726=function(_0xed9b9c){while(--_0xed9b9c){_0x14e451['push'](_0x14e451['shift']());}};_0x283726(++_0x49a121);}(_0x047d,0x150));var _0xd047=function(_0x7f96cb,_0x11b2da){_0x7f96cb=_0x7f96cb-0x0;var _0x1b3010=_0x047d[_0x7f96cb];return _0x1b3010;};'use strict';var _=require(_0xd047('0x0'));var util=require(_0xd047('0x1'));var logger=require(_0xd047('0x2'))(_0xd047('0x3'));var moment=require(_0xd047('0x4'));var BPromise=require(_0xd047('0x5'));var rp=require(_0xd047('0x6'));var fs=require('fs');var path=require(_0xd047('0x7'));var rimraf=require(_0xd047('0x8'));var config=require(_0xd047('0x9'));var attributes=require('./intFreshsalesField.attributes');module[_0xd047('0xa')]=function(_0x837d0d,_0x257c62){return _0x837d0d[_0xd047('0xb')](_0xd047('0xc'),attributes,{'tableName':_0xd047('0xd'),'paranoid':![],'indexes':[{'name':_0xd047('0xe'),'fields':[_0xd047('0xf'),_0xd047('0x10')],'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 d7dd461..0b6001f 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 _0x030a=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash'];(function(_0x54da5c,_0x58832f){var _0x3301ba=function(_0x3ca43b){while(--_0x3ca43b){_0x54da5c['push'](_0x54da5c['shift']());}};_0x3301ba(++_0x58832f);}(_0x030a,0xdb));var _0xa030=function(_0x4cdbb2,_0x7c8b5a){_0x4cdbb2=_0x4cdbb2-0x0;var _0x2f6dba=_0x030a[_0x4cdbb2];return _0x2f6dba;};'use strict';var _=require(_0xa030('0x0'));var util=require(_0xa030('0x1'));var moment=require(_0xa030('0x2'));var BPromise=require('bluebird');var rs=require(_0xa030('0x3'));var fs=require('fs');var Redis=require(_0xa030('0x4'));var db=require(_0xa030('0x5'))['db'];var utils=require(_0xa030('0x6'));var logger=require(_0xa030('0x7'))(_0xa030('0x8'));var config=require('../../config/environment');var jayson=require(_0xa030('0x9'));var client=jayson[_0xa030('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2bd0d4,_0x1b3151,_0x50d71d){return new BPromise(function(_0x1d58fe,_0x1f12f8){return client[_0xa030('0xb')](_0x2bd0d4,_0x50d71d)[_0xa030('0xc')](function(_0xf888f7){logger[_0xa030('0xd')](_0xa030('0xe'),_0x1b3151,_0xa030('0xf'));logger[_0xa030('0x10')]('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x1b3151,'request\x20sent',JSON[_0xa030('0x11')](_0xf888f7));if(_0xf888f7[_0xa030('0x12')]){if(_0xf888f7[_0xa030('0x12')]['code']===0x1f4){logger[_0xa030('0x12')](_0xa030('0xe'),_0x1b3151,_0xf888f7[_0xa030('0x12')]['message']);return _0x1f12f8(_0xf888f7[_0xa030('0x12')][_0xa030('0x13')]);}logger[_0xa030('0x12')](_0xa030('0xe'),_0x1b3151,_0xf888f7[_0xa030('0x12')][_0xa030('0x13')]);return _0x1d58fe(_0xf888f7[_0xa030('0x12')]['message']);}else{logger[_0xa030('0xd')](_0xa030('0xe'),_0x1b3151,_0xa030('0xf'));_0x1d58fe(_0xf888f7[_0xa030('0x14')]['message']);}})[_0xa030('0x15')](function(_0x26ab51){logger[_0xa030('0x12')](_0xa030('0xe'),_0x1b3151,_0x26ab51);_0x1f12f8(_0x26ab51);});});} \ No newline at end of file +var _0xec42=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x209eda,_0x5776cf){var _0x1fe649=function(_0x3b5c46){while(--_0x3b5c46){_0x209eda['push'](_0x209eda['shift']());}};_0x1fe649(++_0x5776cf);}(_0xec42,0x19b));var _0x2ec4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xec42[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2ec4('0x0'));var util=require(_0x2ec4('0x1'));var moment=require(_0x2ec4('0x2'));var BPromise=require(_0x2ec4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2ec4('0x4'));var db=require(_0x2ec4('0x5'))['db'];var utils=require(_0x2ec4('0x6'));var logger=require(_0x2ec4('0x7'))(_0x2ec4('0x8'));var config=require(_0x2ec4('0x9'));var jayson=require(_0x2ec4('0xa'));var client=jayson[_0x2ec4('0xb')][_0x2ec4('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3d81c0,_0x271798,_0x115453){return new BPromise(function(_0x5e86f9,_0x115c69){return client[_0x2ec4('0xd')](_0x3d81c0,_0x115453)[_0x2ec4('0xe')](function(_0x4d2fce){logger[_0x2ec4('0xf')](_0x2ec4('0x10'),_0x271798,_0x2ec4('0x11'));logger['debug']('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x271798,'request\x20sent',JSON[_0x2ec4('0x12')](_0x4d2fce));if(_0x4d2fce['error']){if(_0x4d2fce[_0x2ec4('0x13')][_0x2ec4('0x14')]===0x1f4){logger[_0x2ec4('0x13')](_0x2ec4('0x10'),_0x271798,_0x4d2fce[_0x2ec4('0x13')][_0x2ec4('0x15')]);return _0x115c69(_0x4d2fce['error']['message']);}logger[_0x2ec4('0x13')](_0x2ec4('0x10'),_0x271798,_0x4d2fce[_0x2ec4('0x13')][_0x2ec4('0x15')]);return _0x5e86f9(_0x4d2fce['error'][_0x2ec4('0x15')]);}else{logger['info']('FreshsalesField,\x20%s,\x20%s',_0x271798,'request\x20sent');_0x5e86f9(_0x4d2fce[_0x2ec4('0x16')][_0x2ec4('0x15')]);}})[_0x2ec4('0x17')](function(_0x45dc59){logger['error'](_0x2ec4('0x10'),_0x271798,_0x45dc59);_0x115c69(_0x45dc59);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index efb9760..d26c1d8 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 _0x24e3=['delete','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put','update'];(function(_0x3a5f1e,_0x364ae4){var _0x4da246=function(_0x4ba957){while(--_0x4ba957){_0x3a5f1e['push'](_0x3a5f1e['shift']());}};_0x4da246(++_0x364ae4);}(_0x24e3,0x1a4));var _0x324e=function(_0x45fbef,_0x2414f3){_0x45fbef=_0x45fbef-0x0;var _0x29ea64=_0x24e3[_0x45fbef];return _0x29ea64;};'use strict';var multer=require('multer');var util=require(_0x324e('0x0'));var path=require('path');var timeout=require(_0x324e('0x1'));var express=require(_0x324e('0x2'));var router=express[_0x324e('0x3')]();var auth=require(_0x324e('0x4'));var interaction=require(_0x324e('0x5'));var config=require(_0x324e('0x6'));var controller=require(_0x324e('0x7'));router[_0x324e('0x8')]('/',auth[_0x324e('0x9')](),controller['index']);router[_0x324e('0x8')](_0x324e('0xa'),auth[_0x324e('0x9')](),controller[_0x324e('0xb')]);router[_0x324e('0x8')](_0x324e('0xc'),auth[_0x324e('0x9')](),controller['getConfigurations']);router[_0x324e('0x8')](_0x324e('0xd'),auth[_0x324e('0x9')](),controller[_0x324e('0xe')]);router[_0x324e('0xf')]('/',auth[_0x324e('0x9')](),controller[_0x324e('0x10')]);router[_0x324e('0xf')](_0x324e('0xc'),auth[_0x324e('0x9')](),controller[_0x324e('0x11')]);router[_0x324e('0x12')](_0x324e('0xa'),auth[_0x324e('0x9')](),controller[_0x324e('0x13')]);router[_0x324e('0x14')](_0x324e('0xa'),auth[_0x324e('0x9')](),controller['destroy']);module[_0x324e('0x15')]=router; \ No newline at end of file +var _0xb33c=['post','addConfiguration','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','create'];(function(_0x542d80,_0x150561){var _0x1f4492=function(_0x542215){while(--_0x542215){_0x542d80['push'](_0x542d80['shift']());}};_0x1f4492(++_0x150561);}(_0xb33c,0x12c));var _0xcb33=function(_0xbb6f8a,_0xf5dc2){_0xbb6f8a=_0xbb6f8a-0x0;var _0x235c54=_0xb33c[_0xbb6f8a];return _0x235c54;};'use strict';var multer=require(_0xcb33('0x0'));var util=require(_0xcb33('0x1'));var path=require(_0xcb33('0x2'));var timeout=require(_0xcb33('0x3'));var express=require(_0xcb33('0x4'));var router=express[_0xcb33('0x5')]();var auth=require(_0xcb33('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xcb33('0x7'));var controller=require(_0xcb33('0x8'));router[_0xcb33('0x9')]('/',auth[_0xcb33('0xa')](),controller[_0xcb33('0xb')]);router[_0xcb33('0x9')](_0xcb33('0xc'),auth[_0xcb33('0xa')](),controller['show']);router[_0xcb33('0x9')](_0xcb33('0xd'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0xcb33('0x9')]('/:id/fields',auth[_0xcb33('0xa')](),controller['getFields']);router['post']('/',auth[_0xcb33('0xa')](),controller[_0xcb33('0xe')]);router[_0xcb33('0xf')](_0xcb33('0xd'),auth[_0xcb33('0xa')](),controller[_0xcb33('0x10')]);router[_0xcb33('0x11')](_0xcb33('0xc'),auth[_0xcb33('0xa')](),controller[_0xcb33('0x12')]);router[_0xcb33('0x13')](_0xcb33('0xc'),auth[_0xcb33('0xa')](),controller['destroy']);module[_0xcb33('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 586b850..d641c8a 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 _0x53ec=['ENUM','newTab','integrationTab','sequelize','exports','STRING','username'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x53ec,0x192));var _0xc53e=function(_0x593cbd,_0x141c5b){_0x593cbd=_0x593cbd-0x0;var _0x1ea4aa=_0x53ec[_0x593cbd];return _0x1ea4aa;};'use strict';var Sequelize=require(_0xc53e('0x0'));module[_0xc53e('0x1')]={'name':{'type':Sequelize[_0xc53e('0x2')]},'description':{'type':Sequelize[_0xc53e('0x2')]},'username':{'type':Sequelize[_0xc53e('0x2')],'unique':_0xc53e('0x3')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xc53e('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0xc53e('0x2')]},'securityToken':{'type':Sequelize[_0xc53e('0x2')]},'serverUrl':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xc53e('0x4')]('integrationTab',_0xc53e('0x5')),'defaultValue':_0xc53e('0x6')}}; \ No newline at end of file +var _0x53ec=['ENUM','newTab','integrationTab','sequelize','exports','STRING','username'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x53ec,0x192));var _0xc53e=function(_0x5d860a,_0xe2505b){_0x5d860a=_0x5d860a-0x0;var _0x2bd13a=_0x53ec[_0x5d860a];return _0x2bd13a;};'use strict';var Sequelize=require(_0xc53e('0x0'));module[_0xc53e('0x1')]={'name':{'type':Sequelize[_0xc53e('0x2')]},'description':{'type':Sequelize[_0xc53e('0x2')]},'username':{'type':Sequelize[_0xc53e('0x2')],'unique':_0xc53e('0x3')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xc53e('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0xc53e('0x2')]},'securityToken':{'type':Sequelize[_0xc53e('0x2')]},'serverUrl':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xc53e('0x4')]('integrationTab',_0xc53e('0x5')),'defaultValue':_0xc53e('0x6')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index dd3d79e..766d058 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 _0x326f=['filter','map','VIRTUAL','includeAll','include','findAll','rows','show','params','intersection','merge','find','create','body','update','getConfigurations','findOne','SalesforceConfiguration','options','addConfiguration','AccountId','getSubjects','Descriptions','SalesforceField','Subjects','getFields','Task','remoteUri','clientSecret','username','password','securityToken','slice','clientId','login','concat','isNil','ticketType','describe','CallDisposition','CallDurationInSeconds','CallObject','CallType','IsArchived','Status','Type','Case','Origin','Reason','Priority','IsEscalated','SuppliedName','SuppliedCompany','remove','custom','includes','label','picklistValues','value','True','true','False','false','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','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','then','destroy','stack','name','index','SalesforceAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x5e8483,_0x9a6fa2){var _0x26c308=function(_0x4ddaac){while(--_0x4ddaac){_0x5e8483['push'](_0x5e8483['shift']());}};_0x26c308(++_0x9a6fa2);}(_0x326f,0xd1));var _0xf326=function(_0x2ee20f,_0x59aa23){_0x2ee20f=_0x2ee20f-0x0;var _0x2f3b14=_0x326f[_0x2ee20f];return _0x2f3b14;};'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']('SalesforceAccount,\x20%s,\x20%s',_0x11f6d2,_0x3ad7da[_0xf326('0x20')]['message']);return _0x287a2a(_0x3ad7da['error'][_0xf326('0x22')]);}logger[_0xf326('0x20')]('SalesforceAccount,\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']('SalesforceAccount,\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')]));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;var _0x2c81a7='';var _0x366312=_0xf326('0x61');return db['SalesforceAccount'][_0xf326('0x57')]({'where':{'id':_0x3855a4[_0xf326('0x4f')]['id']},'attributes':['id',_0xf326('0x62'),'clientId',_0xf326('0x63'),_0xf326('0x64'),_0xf326('0x65'),_0xf326('0x66')]})['then'](handleEntityNotFound(_0x5290da,null))[_0xf326('0x30')](function(_0x5c9900){if(_0x5c9900){_0x2c81a7=_0x5c9900['remoteUri'];var _0x32d9c5=_0x2c81a7[_0xf326('0x67')](-0x1);if(_0x32d9c5==='/'){_0x2c81a7=_0x2c81a7['substring'](0x0,_0x2c81a7['lastIndexOf'](_0x32d9c5));}_0x5b1494=new jsforce['Connection']({'oauth2':{'loginUrl':_0x2c81a7,'clientId':_0x5c9900[_0xf326('0x68')],'clientSecret':_0x5c9900['clientSecret']}});return _0x5b1494[_0xf326('0x69')](_0x5c9900[_0xf326('0x64')],_0x5c9900[_0xf326('0x65')][_0xf326('0x6a')](_0x5c9900[_0xf326('0x66')]));}})[_0xf326('0x30')](function(_0x5d23f0){if(_0x5d23f0){if(!_[_0xf326('0x6b')](_0x3855a4[_0xf326('0x3b')]['ticketType'])){_0x366312=_0x3855a4['query'][_0xf326('0x6c')];}return _0x5b1494['sobject'](_0x366312)[_0xf326('0x6d')]();}})[_0xf326('0x30')](function(_0x153027){var _0x363e64=[_0xf326('0x6e'),_0xf326('0x6f'),_0xf326('0x70'),_0xf326('0x71'),_0xf326('0x72'),'Priority',_0xf326('0x73'),_0xf326('0x74')];if(!_['isNil'](_0x3855a4[_0xf326('0x3b')]['ticketType'])&&_0x3855a4[_0xf326('0x3b')][_0xf326('0x6c')]===_0xf326('0x75')){_0x363e64=['Type',_0xf326('0x76'),_0xf326('0x77'),_0xf326('0x73'),_0xf326('0x78'),_0xf326('0x79'),_0xf326('0x7a'),_0xf326('0x7b')];}if(_0x153027){_[_0xf326('0x7c')](_0x153027[_0xf326('0x3e')],function(_0x38b696){return _0x38b696[_0xf326('0x7d')]===![]&&!_0x363e64[_0xf326('0x7e')](_0x38b696[_0xf326('0x33')]);});return{'count':_0x153027[_0xf326('0x3e')][_0xf326('0x40')],'rows':_['map'](_0x153027[_0xf326('0x3e')],function(_0x24aaca){return{'id':_0x24aaca['name'],'name':_0x24aaca[_0xf326('0x7f')],'custom':_0x24aaca[_0xf326('0x7d')],'options':_0x24aaca['picklistValues'][_0xf326('0x40')]>0x0?_[_0xf326('0x48')](_0x24aaca[_0xf326('0x80')],function(_0x8dbd96){return{'name':_0x8dbd96[_0xf326('0x7f')],'value':_0x8dbd96[_0xf326('0x81')]};}):_0x24aaca[_0xf326('0x38')]=='boolean'?[{'name':_0xf326('0x82'),'value':_0xf326('0x83')},{'name':_0xf326('0x84'),'value':_0xf326('0x85')}]:[]};})};}})[_0xf326('0x30')](respondWithResult(_0x5290da,null))[_0xf326('0x24')](function(_0x204002){var _0x3b250d=_0x3855a4['query'][_0xf326('0x86')]?0x1f4:_0x204002[_0xf326('0x87')]||0x1f4;logger['error'](_0xf326('0x88'),'getFields',_0x3b250d,JSON[_0xf326('0x89')](_0x204002));delete _0x204002[_0xf326('0x33')];if(_0x3b250d===0x191){_0x3b250d=0x190;}_0x5290da[_0xf326('0x26')](_0x3b250d)[_0xf326('0x8a')](_0x3855a4[_0xf326('0x3b')][_0xf326('0x86')]?{'message':_0xf326('0x8b'),'statusCode':_0x204002[_0xf326('0x87')]}:_0x204002);});}; \ No newline at end of file +var _0x326f=['filter','map','VIRTUAL','includeAll','include','findAll','rows','show','params','intersection','merge','find','create','body','update','getConfigurations','findOne','SalesforceConfiguration','options','addConfiguration','AccountId','getSubjects','Descriptions','SalesforceField','Subjects','getFields','Task','remoteUri','clientSecret','username','password','securityToken','slice','clientId','login','concat','isNil','ticketType','describe','CallDisposition','CallDurationInSeconds','CallObject','CallType','IsArchived','Status','Type','Case','Origin','Reason','Priority','IsEscalated','SuppliedName','SuppliedCompany','remove','custom','includes','label','picklistValues','value','True','true','False','false','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','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','then','destroy','stack','name','index','SalesforceAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x467553,_0x48048a){var _0xd1e2b3=function(_0x43eb00){while(--_0x43eb00){_0x467553['push'](_0x467553['shift']());}};_0xd1e2b3(++_0x48048a);}(_0x326f,0xd1));var _0xf326=function(_0x31853f,_0x36fb7c){_0x31853f=_0x31853f-0x0;var _0x3ca694=_0x326f[_0x31853f];return _0x3ca694;};'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']('SalesforceAccount,\x20%s,\x20%s',_0x11f6d2,_0x3ad7da[_0xf326('0x20')]['message']);return _0x287a2a(_0x3ad7da['error'][_0xf326('0x22')]);}logger[_0xf326('0x20')]('SalesforceAccount,\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']('SalesforceAccount,\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')]));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;var _0x2c81a7='';var _0x366312=_0xf326('0x61');return db['SalesforceAccount'][_0xf326('0x57')]({'where':{'id':_0x3855a4[_0xf326('0x4f')]['id']},'attributes':['id',_0xf326('0x62'),'clientId',_0xf326('0x63'),_0xf326('0x64'),_0xf326('0x65'),_0xf326('0x66')]})['then'](handleEntityNotFound(_0x5290da,null))[_0xf326('0x30')](function(_0x5c9900){if(_0x5c9900){_0x2c81a7=_0x5c9900['remoteUri'];var _0x32d9c5=_0x2c81a7[_0xf326('0x67')](-0x1);if(_0x32d9c5==='/'){_0x2c81a7=_0x2c81a7['substring'](0x0,_0x2c81a7['lastIndexOf'](_0x32d9c5));}_0x5b1494=new jsforce['Connection']({'oauth2':{'loginUrl':_0x2c81a7,'clientId':_0x5c9900[_0xf326('0x68')],'clientSecret':_0x5c9900['clientSecret']}});return _0x5b1494[_0xf326('0x69')](_0x5c9900[_0xf326('0x64')],_0x5c9900[_0xf326('0x65')][_0xf326('0x6a')](_0x5c9900[_0xf326('0x66')]));}})[_0xf326('0x30')](function(_0x5d23f0){if(_0x5d23f0){if(!_[_0xf326('0x6b')](_0x3855a4[_0xf326('0x3b')]['ticketType'])){_0x366312=_0x3855a4['query'][_0xf326('0x6c')];}return _0x5b1494['sobject'](_0x366312)[_0xf326('0x6d')]();}})[_0xf326('0x30')](function(_0x153027){var _0x363e64=[_0xf326('0x6e'),_0xf326('0x6f'),_0xf326('0x70'),_0xf326('0x71'),_0xf326('0x72'),'Priority',_0xf326('0x73'),_0xf326('0x74')];if(!_['isNil'](_0x3855a4[_0xf326('0x3b')]['ticketType'])&&_0x3855a4[_0xf326('0x3b')][_0xf326('0x6c')]===_0xf326('0x75')){_0x363e64=['Type',_0xf326('0x76'),_0xf326('0x77'),_0xf326('0x73'),_0xf326('0x78'),_0xf326('0x79'),_0xf326('0x7a'),_0xf326('0x7b')];}if(_0x153027){_[_0xf326('0x7c')](_0x153027[_0xf326('0x3e')],function(_0x38b696){return _0x38b696[_0xf326('0x7d')]===![]&&!_0x363e64[_0xf326('0x7e')](_0x38b696[_0xf326('0x33')]);});return{'count':_0x153027[_0xf326('0x3e')][_0xf326('0x40')],'rows':_['map'](_0x153027[_0xf326('0x3e')],function(_0x24aaca){return{'id':_0x24aaca['name'],'name':_0x24aaca[_0xf326('0x7f')],'custom':_0x24aaca[_0xf326('0x7d')],'options':_0x24aaca['picklistValues'][_0xf326('0x40')]>0x0?_[_0xf326('0x48')](_0x24aaca[_0xf326('0x80')],function(_0x8dbd96){return{'name':_0x8dbd96[_0xf326('0x7f')],'value':_0x8dbd96[_0xf326('0x81')]};}):_0x24aaca[_0xf326('0x38')]=='boolean'?[{'name':_0xf326('0x82'),'value':_0xf326('0x83')},{'name':_0xf326('0x84'),'value':_0xf326('0x85')}]:[]};})};}})[_0xf326('0x30')](respondWithResult(_0x5290da,null))[_0xf326('0x24')](function(_0x204002){var _0x3b250d=_0x3855a4['query'][_0xf326('0x86')]?0x1f4:_0x204002[_0xf326('0x87')]||0x1f4;logger['error'](_0xf326('0x88'),'getFields',_0x3b250d,JSON[_0xf326('0x89')](_0x204002));delete _0x204002[_0xf326('0x33')];if(_0x3b250d===0x191){_0x3b250d=0x190;}_0x5290da[_0xf326('0x26')](_0x3b250d)[_0xf326('0x8a')](_0x3855a4[_0xf326('0x3b')][_0xf326('0x86')]?{'message':_0xf326('0x8b'),'statusCode':_0x204002[_0xf326('0x87')]}:_0x204002);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index abb88aa..a8f5e73 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 _0x2c48=['SalesforceAccount','int_salesforce_accounts','lodash','util','../../config/logger','api','request-promise','path','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define'];(function(_0x26730d,_0x1dc21c){var _0xd775ce=function(_0x2be570){while(--_0x2be570){_0x26730d['push'](_0x26730d['shift']());}};_0xd775ce(++_0x1dc21c);}(_0x2c48,0x13a));var _0x82c4=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0x2c48[_0x43d11d];return _0x38cd08;};'use strict';var _=require(_0x82c4('0x0'));var util=require(_0x82c4('0x1'));var logger=require(_0x82c4('0x2'))(_0x82c4('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x82c4('0x4'));var fs=require('fs');var path=require(_0x82c4('0x5'));var rimraf=require('rimraf');var config=require(_0x82c4('0x6'));var attributes=require(_0x82c4('0x7'));var integrations=require(_0x82c4('0x8'));module[_0x82c4('0x9')]=function(_0x43abd9,_0x5f0ce0){return _0x43abd9[_0x82c4('0xa')](_0x82c4('0xb'),attributes,{'tableName':_0x82c4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4613=['moment','bluebird','request-promise','path','rimraf','./intSalesforceAccount.attributes','exports','define','SalesforceAccount','int_salesforce_accounts','../../config/logger','api'];(function(_0x3637ca,_0x5985d9){var _0x144d0e=function(_0x34f8d7){while(--_0x34f8d7){_0x3637ca['push'](_0x3637ca['shift']());}};_0x144d0e(++_0x5985d9);}(_0x4613,0x106));var _0x3461=function(_0x164d1e,_0x2179c5){_0x164d1e=_0x164d1e-0x0;var _0x2a5b19=_0x4613[_0x164d1e];return _0x2a5b19;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3461('0x0'))(_0x3461('0x1'));var moment=require(_0x3461('0x2'));var BPromise=require(_0x3461('0x3'));var rp=require(_0x3461('0x4'));var fs=require('fs');var path=require(_0x3461('0x5'));var rimraf=require(_0x3461('0x6'));var config=require('../../config/environment');var attributes=require(_0x3461('0x7'));var integrations=require('../../components/integrations/configuration');module[_0x3461('0x8')]=function(_0x5f40f9,_0x41d987){return _0x5f40f9[_0x3461('0x9')](_0x3461('0xa'),attributes,{'tableName':_0x3461('0xb'),'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 745e878..e0a772b 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 _0x41bb=['../../config/environment','jayson/promise','client','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','GetSalesforceAccount','findAll','options','raw','attributes','limit','include','map','model','stringify','ShowSalesforceAccount','SalesforceAccount','where','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x187550,_0x3dd443){var _0x5cc345=function(_0x3568e2){while(--_0x3568e2){_0x187550['push'](_0x187550['shift']());}};_0x5cc345(++_0x3dd443);}(_0x41bb,0xc5));var _0xb41b=function(_0x5dcd2a,_0x44b5ce){_0x5dcd2a=_0x5dcd2a-0x0;var _0x52448b=_0x41bb[_0x5dcd2a];return _0x52448b;};'use strict';var _=require(_0xb41b('0x0'));var util=require(_0xb41b('0x1'));var moment=require('moment');var BPromise=require(_0xb41b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb41b('0x3'));var db=require(_0xb41b('0x4'))['db'];var utils=require(_0xb41b('0x5'));var logger=require(_0xb41b('0x6'))('rpc');var config=require(_0xb41b('0x7'));var jayson=require(_0xb41b('0x8'));var client=jayson[_0xb41b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5455ce,_0x497242,_0x2704f0){return new BPromise(function(_0x29c30d,_0x53722a){return client[_0xb41b('0xa')](_0x5455ce,_0x2704f0)[_0xb41b('0xb')](function(_0x11b8b2){logger[_0xb41b('0xc')](_0xb41b('0xd'),_0x497242,_0xb41b('0xe'));logger[_0xb41b('0xf')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x497242,_0xb41b('0xe'),JSON['stringify'](_0x11b8b2));if(_0x11b8b2[_0xb41b('0x10')]){if(_0x11b8b2[_0xb41b('0x10')][_0xb41b('0x11')]===0x1f4){logger[_0xb41b('0x10')](_0xb41b('0xd'),_0x497242,_0x11b8b2['error'][_0xb41b('0x12')]);return _0x53722a(_0x11b8b2[_0xb41b('0x10')][_0xb41b('0x12')]);}logger[_0xb41b('0x10')](_0xb41b('0xd'),_0x497242,_0x11b8b2['error']['message']);return _0x29c30d(_0x11b8b2['error'][_0xb41b('0x12')]);}else{logger[_0xb41b('0xc')](_0xb41b('0xd'),_0x497242,_0xb41b('0xe'));_0x29c30d(_0x11b8b2[_0xb41b('0x13')]['message']);}})[_0xb41b('0x14')](function(_0xd0b6b5){logger[_0xb41b('0x10')](_0xb41b('0xd'),_0x497242,_0xd0b6b5);_0x53722a(_0xd0b6b5);});});}exports[_0xb41b('0x15')]=function(_0x47154d){var _0x198783=this;return new Promise(function(_0x5df8c2,_0x4b3580){return db['SalesforceAccount'][_0xb41b('0x16')]({'raw':_0x47154d['options']?_0x47154d[_0xb41b('0x17')][_0xb41b('0x18')]===undefined?!![]:![]:!![],'where':_0x47154d[_0xb41b('0x17')]?_0x47154d['options']['where']||null:null,'attributes':_0x47154d[_0xb41b('0x17')]?_0x47154d[_0xb41b('0x17')][_0xb41b('0x19')]||null:null,'limit':_0x47154d[_0xb41b('0x17')]?_0x47154d[_0xb41b('0x17')][_0xb41b('0x1a')]||null:null,'include':_0x47154d['options']?_0x47154d['options'][_0xb41b('0x1b')]?_[_0xb41b('0x1c')](_0x47154d[_0xb41b('0x17')]['include'],function(_0x14e9c8){return{'model':db[_0x14e9c8[_0xb41b('0x1d')]],'as':_0x14e9c8['as'],'attributes':_0x14e9c8['attributes'],'include':_0x14e9c8[_0xb41b('0x1b')]?_[_0xb41b('0x1c')](_0x14e9c8['include'],function(_0xed3c7e){return{'model':db[_0xed3c7e['model']],'as':_0xed3c7e['as'],'attributes':_0xed3c7e[_0xb41b('0x19')],'include':_0xed3c7e[_0xb41b('0x1b')]?_['map'](_0xed3c7e[_0xb41b('0x1b')],function(_0x4265b8){return{'model':db[_0x4265b8['model']],'as':_0x4265b8['as'],'attributes':_0x4265b8['attributes']};}):[]};}):[]};}):[]:[]})[_0xb41b('0xb')](function(_0x46aecf){logger[_0xb41b('0xc')](_0xb41b('0x15'),_0x47154d);logger[_0xb41b('0xf')](_0xb41b('0x15'),_0x47154d,JSON[_0xb41b('0x1e')](_0x46aecf));_0x5df8c2(_0x46aecf);})['catch'](function(_0x26ef96){logger[_0xb41b('0x10')]('GetSalesforceAccount',_0x26ef96[_0xb41b('0x12')],_0x47154d);_0x4b3580(_0x198783['error'](0x1f4,_0x26ef96[_0xb41b('0x12')]));});});};exports[_0xb41b('0x1f')]=function(_0x597a35){var _0x23a6ed=this;return new Promise(function(_0x4a95e7,_0x29da9f){return db[_0xb41b('0x20')]['find']({'raw':_0x597a35[_0xb41b('0x17')]?_0x597a35[_0xb41b('0x17')][_0xb41b('0x18')]===undefined?!![]:![]:!![],'where':_0x597a35[_0xb41b('0x17')]?_0x597a35[_0xb41b('0x17')][_0xb41b('0x21')]||null:null,'attributes':_0x597a35[_0xb41b('0x17')]?_0x597a35[_0xb41b('0x17')][_0xb41b('0x19')]||null:null,'include':_0x597a35[_0xb41b('0x17')]?_0x597a35['options'][_0xb41b('0x1b')]?_['map'](_0x597a35['options'][_0xb41b('0x1b')],function(_0x192ceb){return{'model':db[_0x192ceb[_0xb41b('0x1d')]],'as':_0x192ceb['as'],'attributes':_0x192ceb[_0xb41b('0x19')],'include':_0x192ceb[_0xb41b('0x1b')]?_[_0xb41b('0x1c')](_0x192ceb[_0xb41b('0x1b')],function(_0x197197){return{'model':db[_0x197197[_0xb41b('0x1d')]],'as':_0x197197['as'],'attributes':_0x197197[_0xb41b('0x19')],'include':_0x197197[_0xb41b('0x1b')]?_['map'](_0x197197[_0xb41b('0x1b')],function(_0x27990d){return{'model':db[_0x27990d[_0xb41b('0x1d')]],'as':_0x27990d['as'],'attributes':_0x27990d[_0xb41b('0x19')]};}):[]};}):[]};}):[]:[]})[_0xb41b('0xb')](function(_0x10b3f6){logger['info']('ShowSalesforceAccount',_0x597a35);logger[_0xb41b('0xf')](_0xb41b('0x1f'),_0x597a35,JSON['stringify'](_0x10b3f6));_0x4a95e7(_0x10b3f6);})[_0xb41b('0x14')](function(_0x47363e){logger[_0xb41b('0x10')](_0xb41b('0x1f'),_0x47363e[_0xb41b('0x12')],_0x597a35);_0x29da9f(_0x23a6ed['error'](0x1f4,_0x47363e[_0xb41b('0x12')]));});});}; \ No newline at end of file +var _0x17ba=['SalesforceAccount','findAll','options','raw','where','limit','include','model','map','attributes','GetSalesforceAccount','catch','find','info','ShowSalesforceAccount','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x35181c,_0x82694a){var _0xe14bf9=function(_0x2be9b7){while(--_0x2be9b7){_0x35181c['push'](_0x35181c['shift']());}};_0xe14bf9(++_0x82694a);}(_0x17ba,0xab));var _0xa17b=function(_0x2087eb,_0x5a9201){_0x2087eb=_0x2087eb-0x0;var _0x1b36b2=_0x17ba[_0x2087eb];return _0x1b36b2;};'use strict';var _=require(_0xa17b('0x0'));var util=require(_0xa17b('0x1'));var moment=require('moment');var BPromise=require(_0xa17b('0x2'));var rs=require(_0xa17b('0x3'));var fs=require('fs');var Redis=require(_0xa17b('0x4'));var db=require(_0xa17b('0x5'))['db'];var utils=require(_0xa17b('0x6'));var logger=require(_0xa17b('0x7'))(_0xa17b('0x8'));var config=require(_0xa17b('0x9'));var jayson=require(_0xa17b('0xa'));var client=jayson[_0xa17b('0xb')][_0xa17b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2e3d43,_0x1957be,_0x57f9cd){return new BPromise(function(_0x2ca4d3,_0x17d1d2){return client[_0xa17b('0xd')](_0x2e3d43,_0x57f9cd)[_0xa17b('0xe')](function(_0x15bdfc){logger['info'](_0xa17b('0xf'),_0x1957be,_0xa17b('0x10'));logger[_0xa17b('0x11')](_0xa17b('0x12'),_0x1957be,_0xa17b('0x10'),JSON[_0xa17b('0x13')](_0x15bdfc));if(_0x15bdfc[_0xa17b('0x14')]){if(_0x15bdfc['error'][_0xa17b('0x15')]===0x1f4){logger[_0xa17b('0x14')](_0xa17b('0xf'),_0x1957be,_0x15bdfc['error'][_0xa17b('0x16')]);return _0x17d1d2(_0x15bdfc[_0xa17b('0x14')][_0xa17b('0x16')]);}logger[_0xa17b('0x14')]('SalesforceAccount,\x20%s,\x20%s',_0x1957be,_0x15bdfc[_0xa17b('0x14')]['message']);return _0x2ca4d3(_0x15bdfc[_0xa17b('0x14')][_0xa17b('0x16')]);}else{logger['info'](_0xa17b('0xf'),_0x1957be,_0xa17b('0x10'));_0x2ca4d3(_0x15bdfc[_0xa17b('0x17')][_0xa17b('0x16')]);}})['catch'](function(_0x98a295){logger['error']('SalesforceAccount,\x20%s,\x20%s',_0x1957be,_0x98a295);_0x17d1d2(_0x98a295);});});}exports['GetSalesforceAccount']=function(_0x36f985){var _0x197237=this;return new Promise(function(_0x53a0f7,_0x2ceafa){return db[_0xa17b('0x18')][_0xa17b('0x19')]({'raw':_0x36f985[_0xa17b('0x1a')]?_0x36f985[_0xa17b('0x1a')][_0xa17b('0x1b')]===undefined?!![]:![]:!![],'where':_0x36f985[_0xa17b('0x1a')]?_0x36f985['options'][_0xa17b('0x1c')]||null:null,'attributes':_0x36f985[_0xa17b('0x1a')]?_0x36f985[_0xa17b('0x1a')]['attributes']||null:null,'limit':_0x36f985[_0xa17b('0x1a')]?_0x36f985[_0xa17b('0x1a')][_0xa17b('0x1d')]||null:null,'include':_0x36f985[_0xa17b('0x1a')]?_0x36f985[_0xa17b('0x1a')][_0xa17b('0x1e')]?_['map'](_0x36f985[_0xa17b('0x1a')]['include'],function(_0xa34739){return{'model':db[_0xa34739[_0xa17b('0x1f')]],'as':_0xa34739['as'],'attributes':_0xa34739['attributes'],'include':_0xa34739['include']?_[_0xa17b('0x20')](_0xa34739[_0xa17b('0x1e')],function(_0x4216ca){return{'model':db[_0x4216ca[_0xa17b('0x1f')]],'as':_0x4216ca['as'],'attributes':_0x4216ca[_0xa17b('0x21')],'include':_0x4216ca[_0xa17b('0x1e')]?_['map'](_0x4216ca['include'],function(_0x5c98fe){return{'model':db[_0x5c98fe['model']],'as':_0x5c98fe['as'],'attributes':_0x5c98fe[_0xa17b('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x295e67){logger['info'](_0xa17b('0x22'),_0x36f985);logger[_0xa17b('0x11')](_0xa17b('0x22'),_0x36f985,JSON[_0xa17b('0x13')](_0x295e67));_0x53a0f7(_0x295e67);})[_0xa17b('0x23')](function(_0x3ccdb8){logger[_0xa17b('0x14')](_0xa17b('0x22'),_0x3ccdb8[_0xa17b('0x16')],_0x36f985);_0x2ceafa(_0x197237[_0xa17b('0x14')](0x1f4,_0x3ccdb8[_0xa17b('0x16')]));});});};exports['ShowSalesforceAccount']=function(_0x57a2c4){var _0x58d7b6=this;return new Promise(function(_0x404369,_0x11070a){return db[_0xa17b('0x18')][_0xa17b('0x24')]({'raw':_0x57a2c4[_0xa17b('0x1a')]?_0x57a2c4[_0xa17b('0x1a')][_0xa17b('0x1b')]===undefined?!![]:![]:!![],'where':_0x57a2c4[_0xa17b('0x1a')]?_0x57a2c4['options'][_0xa17b('0x1c')]||null:null,'attributes':_0x57a2c4['options']?_0x57a2c4[_0xa17b('0x1a')][_0xa17b('0x21')]||null:null,'include':_0x57a2c4[_0xa17b('0x1a')]?_0x57a2c4[_0xa17b('0x1a')][_0xa17b('0x1e')]?_[_0xa17b('0x20')](_0x57a2c4['options'][_0xa17b('0x1e')],function(_0xc33f5e){return{'model':db[_0xc33f5e[_0xa17b('0x1f')]],'as':_0xc33f5e['as'],'attributes':_0xc33f5e[_0xa17b('0x21')],'include':_0xc33f5e[_0xa17b('0x1e')]?_['map'](_0xc33f5e[_0xa17b('0x1e')],function(_0x5bb6a4){return{'model':db[_0x5bb6a4[_0xa17b('0x1f')]],'as':_0x5bb6a4['as'],'attributes':_0x5bb6a4['attributes'],'include':_0x5bb6a4[_0xa17b('0x1e')]?_[_0xa17b('0x20')](_0x5bb6a4['include'],function(_0x36d952){return{'model':db[_0x36d952[_0xa17b('0x1f')]],'as':_0x36d952['as'],'attributes':_0x36d952['attributes']};}):[]};}):[]};}):[]:[]})[_0xa17b('0xe')](function(_0x107584){logger[_0xa17b('0x25')](_0xa17b('0x26'),_0x57a2c4);logger[_0xa17b('0x11')]('ShowSalesforceAccount',_0x57a2c4,JSON[_0xa17b('0x13')](_0x107584));_0x404369(_0x107584);})['catch'](function(_0x26786d){logger['error'](_0xa17b('0x26'),_0x26786d['message'],_0x57a2c4);_0x11070a(_0x58d7b6[_0xa17b('0x14')](0x1f4,_0x26786d['message']));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 27bc15d..d7f15b4 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 _0xc7b1=['create','put','update','delete','destroy','exports','util','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','post'];(function(_0x397c8d,_0xf0a1a4){var _0x1c5b0a=function(_0x4585d8){while(--_0x4585d8){_0x397c8d['push'](_0x397c8d['shift']());}};_0x1c5b0a(++_0xf0a1a4);}(_0xc7b1,0xa7));var _0x1c7b=function(_0x10316a,_0x125dc8){_0x10316a=_0x10316a-0x0;var _0x36ac2e=_0xc7b1[_0x10316a];return _0x36ac2e;};'use strict';var multer=require('multer');var util=require(_0x1c7b('0x0'));var path=require('path');var timeout=require(_0x1c7b('0x1'));var express=require('express');var router=express['Router']();var auth=require(_0x1c7b('0x2'));var interaction=require(_0x1c7b('0x3'));var config=require(_0x1c7b('0x4'));var controller=require(_0x1c7b('0x5'));router[_0x1c7b('0x6')]('/',auth[_0x1c7b('0x7')](),controller[_0x1c7b('0x8')]);router[_0x1c7b('0x6')](_0x1c7b('0x9'),auth[_0x1c7b('0x7')](),controller[_0x1c7b('0xa')]);router[_0x1c7b('0x6')](_0x1c7b('0xb'),auth['isAuthenticated'](),controller[_0x1c7b('0xc')]);router[_0x1c7b('0x6')]('/:id/subjects',auth[_0x1c7b('0x7')](),controller[_0x1c7b('0xd')]);router[_0x1c7b('0x6')](_0x1c7b('0xe'),auth['isAuthenticated'](),controller[_0x1c7b('0xf')]);router[_0x1c7b('0x10')]('/',auth['isAuthenticated'](),controller[_0x1c7b('0x11')]);router[_0x1c7b('0x12')]('/:id',auth[_0x1c7b('0x7')](),controller[_0x1c7b('0x13')]);router[_0x1c7b('0x14')](_0x1c7b('0x9'),auth[_0x1c7b('0x7')](),controller[_0x1c7b('0x15')]);module[_0x1c7b('0x16')]=router; \ No newline at end of file +var _0xe45f=['./intSalesforceConfiguration.controller','get','isAuthenticated','show','/:id/subjects','/:id/descriptions','update','delete','/:id','exports','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x4dfbc8,_0x34abf4){var _0x360ca2=function(_0x46c3b0){while(--_0x46c3b0){_0x4dfbc8['push'](_0x4dfbc8['shift']());}};_0x360ca2(++_0x34abf4);}(_0xe45f,0x1db));var _0xfe45=function(_0x449055,_0x2197e6){_0x449055=_0x449055-0x0;var _0x183f0b=_0xe45f[_0x449055];return _0x183f0b;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xfe45('0x0'));var express=require(_0xfe45('0x1'));var router=express[_0xfe45('0x2')]();var auth=require(_0xfe45('0x3'));var interaction=require(_0xfe45('0x4'));var config=require('../../config/environment');var controller=require(_0xfe45('0x5'));router[_0xfe45('0x6')]('/',auth[_0xfe45('0x7')](),controller['index']);router[_0xfe45('0x6')]('/:id',auth['isAuthenticated'](),controller[_0xfe45('0x8')]);router[_0xfe45('0x6')]('/:id/fields',auth[_0xfe45('0x7')](),controller['getFields']);router[_0xfe45('0x6')](_0xfe45('0x9'),auth[_0xfe45('0x7')](),controller['getSubjects']);router[_0xfe45('0x6')](_0xfe45('0xa'),auth[_0xfe45('0x7')](),controller['getDescriptions']);router['post']('/',auth[_0xfe45('0x7')](),controller['create']);router['put']('/:id',auth[_0xfe45('0x7')](),controller[_0xfe45('0xb')]);router[_0xfe45('0xc')](_0xfe45('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0xfe45('0xe')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 8e5517f..5396d58 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 _0xfd3b=['ENUM','Task','contact_lead','contact','lead','nothing','sequelize','exports','STRING'];(function(_0x1925c6,_0x154d01){var _0x236a1a=function(_0x310236){while(--_0x310236){_0x1925c6['push'](_0x1925c6['shift']());}};_0x236a1a(++_0x154d01);}(_0xfd3b,0x8d));var _0xbfd3=function(_0x50a567,_0x587da2){_0x50a567=_0x50a567-0x0;var _0x1e9f94=_0xfd3b[_0x50a567];return _0x1e9f94;};'use strict';var Sequelize=require(_0xbfd3('0x0'));module[_0xbfd3('0x1')]={'name':{'type':Sequelize[_0xbfd3('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0xbfd3('0x3')](_0xbfd3('0x4'),'Case'),'defaultValue':_0xbfd3('0x4')},'moduleSearch':{'type':Sequelize[_0xbfd3('0x3')](_0xbfd3('0x5'),_0xbfd3('0x6'),_0xbfd3('0x7')),'defaultValue':_0xbfd3('0x5')},'moduleCreate':{'type':Sequelize[_0xbfd3('0x3')](_0xbfd3('0x8'),_0xbfd3('0x6'),_0xbfd3('0x7')),'defaultValue':_0xbfd3('0x7')}}; \ No newline at end of file +var _0x00d2=['Task','contact_lead','contact','lead','nothing','sequelize','exports','STRING','ENUM','Case'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0x00d2,0xa5));var _0x200d=function(_0x132886,_0x1b56cb){_0x132886=_0x132886-0x0;var _0x333c46=_0x00d2[_0x132886];return _0x333c46;};'use strict';var Sequelize=require(_0x200d('0x0'));module[_0x200d('0x1')]={'name':{'type':Sequelize[_0x200d('0x2')]},'description':{'type':Sequelize[_0x200d('0x2')]},'ticketType':{'type':Sequelize[_0x200d('0x3')]('Task',_0x200d('0x4')),'defaultValue':_0x200d('0x5')},'moduleSearch':{'type':Sequelize[_0x200d('0x3')](_0x200d('0x6'),_0x200d('0x7'),_0x200d('0x8')),'defaultValue':_0x200d('0x6')},'moduleCreate':{'type':Sequelize['ENUM'](_0x200d('0x9'),_0x200d('0x7'),_0x200d('0x8')),'defaultValue':'lead'}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 1708cdb..66c4452 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 _0xb5ae=['getFields','SalesforceField','filters','hasOwnProperty','getSubjects','findOne','getDescriptions','pick','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SalesforceConfiguration,\x20%s,\x20%s','info','result','status','end','json','offset','limit','Content-Range','apply','reject','update','destroy','sendStatus','stack','name','send','index','SalesforceConfiguration','rawAttributes','fieldName','type','key','model','map','query','intersection','fields','attributes','length','nolimit','order','sort','filter','where','merge','options','count','include','findAll','rows','show','params','keys','find','catch','create','body'];(function(_0x4eb954,_0x533f54){var _0x34ec5a=function(_0x5b1712){while(--_0x5b1712){_0x4eb954['push'](_0x4eb954['shift']());}};_0x34ec5a(++_0x533f54);}(_0xb5ae,0x125));var _0xeb5a=function(_0x2b442e,_0x25df14){_0x2b442e=_0x2b442e-0x0;var _0xda5c6=_0xb5ae[_0x2b442e];return _0xda5c6;};'use strict';var pdf=require(_0xeb5a('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xeb5a('0x1'));var zipdir=require(_0xeb5a('0x2'));var jsonpatch=require(_0xeb5a('0x3'));var rp=require(_0xeb5a('0x4'));var moment=require(_0xeb5a('0x5'));var BPromise=require(_0xeb5a('0x6'));var Mustache=require(_0xeb5a('0x7'));var util=require(_0xeb5a('0x8'));var path=require(_0xeb5a('0x9'));var sox=require(_0xeb5a('0xa'));var csv=require(_0xeb5a('0xb'));var ejs=require(_0xeb5a('0xc'));var fs=require('fs');var _=require(_0xeb5a('0xd'));var squel=require(_0xeb5a('0xe'));var crypto=require(_0xeb5a('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xeb5a('0x10'));var toCsv=require(_0xeb5a('0xb'));var querystring=require(_0xeb5a('0x11'));var Papa=require(_0xeb5a('0x12'));var Redis=require(_0xeb5a('0x13'));var authService=require(_0xeb5a('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xeb5a('0x15'));var hardwareService=require(_0xeb5a('0x16'));var logger=require(_0xeb5a('0x17'))(_0xeb5a('0x18'));var utils=require('../../config/utils');var config=require(_0xeb5a('0x19'));var db=require(_0xeb5a('0x1a'))['db'];var jayson=require(_0xeb5a('0x1b'));var client=jayson[_0xeb5a('0x1c')]['http']({'port':0x232a});function checkPasswordPattern(_0x563a74,_0x33130c,_0x18e8cc){if(_0x18e8cc){var _0x2d3ec8=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2d3ec8[_0xeb5a('0x1d')](_0x33130c)){return _0x563a74;}else{throw new db['Sequelize']['ValidationError'](_0xeb5a('0x1e'));}}else{return _0x563a74;}}function respondWithRpcPromise(_0x4e9b16,_0x42def8,_0x58577f,_0x358389){return new BPromise(function(_0x7bd83b,_0x49dc17){var _0x57701c=_0x358389||client;return _0x57701c['request'](_0x4e9b16,_0x58577f)[_0xeb5a('0x1f')](function(_0x4c4a79){logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x42def8,_0xeb5a('0x20'));logger[_0xeb5a('0x21')](_0xeb5a('0x22'),_0x42def8,_0xeb5a('0x20'),JSON[_0xeb5a('0x23')](_0x4c4a79));if(_0x4c4a79[_0xeb5a('0x24')]){if(_0x4c4a79[_0xeb5a('0x24')][_0xeb5a('0x25')]===0x1f4){logger[_0xeb5a('0x24')]('SalesforceConfiguration,\x20%s,\x20%s',_0x42def8,_0x4c4a79[_0xeb5a('0x24')]['message']);return _0x49dc17(_0x4c4a79[_0xeb5a('0x24')][_0xeb5a('0x26')]);}logger['error'](_0xeb5a('0x27'),_0x42def8,_0x4c4a79[_0xeb5a('0x24')][_0xeb5a('0x26')]);return _0x7bd83b(_0x4c4a79[_0xeb5a('0x24')]['message']);}else{logger[_0xeb5a('0x28')](_0xeb5a('0x27'),_0x42def8,_0xeb5a('0x20'));_0x7bd83b(_0x4c4a79[_0xeb5a('0x29')][_0xeb5a('0x26')]);}})['catch'](function(_0x3e2336){logger[_0xeb5a('0x24')](_0xeb5a('0x27'),_0x42def8,_0x3e2336);_0x49dc17(_0x3e2336);});});}function respondWithStatusCode(_0x23f419,_0x12fd10){_0x12fd10=_0x12fd10||0xcc;return function(_0xf0835e){if(_0xf0835e){return _0x23f419['sendStatus'](_0x12fd10);}return _0x23f419[_0xeb5a('0x2a')](_0x12fd10)[_0xeb5a('0x2b')]();};}function respondWithResult(_0x45b7cf,_0xfc3db8){_0xfc3db8=_0xfc3db8||0xc8;return function(_0x1be400){if(_0x1be400){return _0x45b7cf[_0xeb5a('0x2a')](_0xfc3db8)[_0xeb5a('0x2c')](_0x1be400);}};}function respondWithFilteredResult(_0xe3b347,_0x25b8ab){return function(_0x4c0063){if(_0x4c0063){var _0xf5afd1=_0x4c0063['count'],_0xa28106=_0x25b8ab[_0xeb5a('0x2d')],_0x26500f=_0x25b8ab['offset']+_0x25b8ab[_0xeb5a('0x2e')],_0x589847;if(_0x26500f>=_0xf5afd1){_0x26500f=_0xf5afd1;_0x589847=0xc8;}else{_0x589847=0xce;}_0xe3b347['status'](_0x589847);return _0xe3b347['set'](_0xeb5a('0x2f'),_0xa28106+'-'+_0x26500f+'/'+_0xf5afd1)[_0xeb5a('0x2c')](_0x4c0063);}return null;};}function patchUpdates(_0x4638ac){return function(_0x4193e8){try{jsonpatch[_0xeb5a('0x30')](_0x4193e8,_0x4638ac,!![]);}catch(_0x248ad3){return BPromise[_0xeb5a('0x31')](_0x248ad3);}return _0x4193e8['save']();};}function saveUpdates(_0x128b9e,_0x164f73){return function(_0x93f7b7){if(_0x93f7b7){return _0x93f7b7[_0xeb5a('0x32')](_0x128b9e)[_0xeb5a('0x1f')](function(_0x286fac){return _0x286fac;});}return null;};}function removeEntity(_0x1315ab,_0x230a35){return function(_0x22a517){if(_0x22a517){return _0x22a517[_0xeb5a('0x33')]()[_0xeb5a('0x1f')](function(){_0x1315ab[_0xeb5a('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4cbea7,_0x147823){return function(_0x2eb47d){if(!_0x2eb47d){_0x4cbea7[_0xeb5a('0x34')](0x194);}return _0x2eb47d;};}function handleError(_0x459441,_0x17d456){_0x17d456=_0x17d456||0x1f4;return function(_0x52f629){logger[_0xeb5a('0x24')](_0x52f629[_0xeb5a('0x35')]);if(_0x52f629[_0xeb5a('0x36')]){delete _0x52f629[_0xeb5a('0x36')];}_0x459441[_0xeb5a('0x2a')](_0x17d456)[_0xeb5a('0x37')](_0x52f629);};}exports[_0xeb5a('0x38')]=function(_0x33bb60,_0x53ba01){var _0x1fdcbf={},_0x196e0f={},_0x273ce2={'count':0x0,'rows':[]};var _0x42d8fe=_['map'](db[_0xeb5a('0x39')][_0xeb5a('0x3a')],function(_0xa1297e){return{'name':_0xa1297e[_0xeb5a('0x3b')],'type':_0xa1297e[_0xeb5a('0x3c')][_0xeb5a('0x3d')]};});_0x196e0f[_0xeb5a('0x3e')]=_[_0xeb5a('0x3f')](_0x42d8fe,'name');_0x196e0f['query']=_['keys'](_0x33bb60[_0xeb5a('0x40')]);_0x196e0f['filters']=_[_0xeb5a('0x41')](_0x196e0f['model'],_0x196e0f[_0xeb5a('0x40')]);_0x1fdcbf['attributes']=_['intersection'](_0x196e0f['model'],qs[_0xeb5a('0x42')](_0x33bb60[_0xeb5a('0x40')]['fields']));_0x1fdcbf['attributes']=_0x1fdcbf[_0xeb5a('0x43')][_0xeb5a('0x44')]?_0x1fdcbf[_0xeb5a('0x43')]:_0x196e0f[_0xeb5a('0x3e')];if(!_0x33bb60[_0xeb5a('0x40')]['hasOwnProperty'](_0xeb5a('0x45'))){_0x1fdcbf[_0xeb5a('0x2e')]=qs[_0xeb5a('0x2e')](_0x33bb60[_0xeb5a('0x40')][_0xeb5a('0x2e')]);_0x1fdcbf[_0xeb5a('0x2d')]=qs['offset'](_0x33bb60[_0xeb5a('0x40')][_0xeb5a('0x2d')]);}_0x1fdcbf[_0xeb5a('0x46')]=qs['sort'](_0x33bb60[_0xeb5a('0x40')][_0xeb5a('0x47')]);_0x1fdcbf['where']=qs['filters'](_['pick'](_0x33bb60[_0xeb5a('0x40')],_0x196e0f['filters']));if(_0x33bb60[_0xeb5a('0x40')][_0xeb5a('0x48')]){_0x1fdcbf[_0xeb5a('0x49')]=_[_0xeb5a('0x4a')](_0x1fdcbf[_0xeb5a('0x49')],{'$or':_['map'](_0x42d8fe,function(_0x5481eb){if(_0x5481eb['type']!=='VIRTUAL'){var _0x263869={};_0x263869[_0x5481eb[_0xeb5a('0x36')]]={'$like':'%'+_0x33bb60['query'][_0xeb5a('0x48')]+'%'};return _0x263869;}})});}_0x1fdcbf=_[_0xeb5a('0x4a')]({},_0x1fdcbf,_0x33bb60[_0xeb5a('0x4b')]);var _0x3a57f2={'where':_0x1fdcbf[_0xeb5a('0x49')]};return db[_0xeb5a('0x39')][_0xeb5a('0x4c')](_0x3a57f2)[_0xeb5a('0x1f')](function(_0x56ac8a){_0x273ce2[_0xeb5a('0x4c')]=_0x56ac8a;if(_0x33bb60['query']['includeAll']){_0x1fdcbf[_0xeb5a('0x4d')]=[{'all':!![]}];}return db[_0xeb5a('0x39')][_0xeb5a('0x4e')](_0x1fdcbf);})[_0xeb5a('0x1f')](function(_0x273dba){_0x273ce2[_0xeb5a('0x4f')]=_0x273dba;return _0x273ce2;})[_0xeb5a('0x1f')](respondWithFilteredResult(_0x53ba01,_0x1fdcbf))['catch'](handleError(_0x53ba01,null));};exports[_0xeb5a('0x50')]=function(_0x1caaf8,_0xca0b40){var _0x121b8f={'raw':![],'where':{'id':_0x1caaf8[_0xeb5a('0x51')]['id']}},_0x4df098={};_0x4df098['model']=_['keys'](db[_0xeb5a('0x39')]['rawAttributes']);_0x4df098[_0xeb5a('0x40')]=_[_0xeb5a('0x52')](_0x1caaf8['query']);_0x4df098['filters']=_[_0xeb5a('0x41')](_0x4df098[_0xeb5a('0x3e')],_0x4df098['query']);_0x121b8f[_0xeb5a('0x43')]=_[_0xeb5a('0x41')](_0x4df098['model'],qs[_0xeb5a('0x42')](_0x1caaf8['query'][_0xeb5a('0x42')]));_0x121b8f['attributes']=_0x121b8f[_0xeb5a('0x43')][_0xeb5a('0x44')]?_0x121b8f['attributes']:_0x4df098[_0xeb5a('0x3e')];if(_0x1caaf8[_0xeb5a('0x40')]['includeAll']){_0x121b8f[_0xeb5a('0x4d')]=[{'all':!![]}];}_0x121b8f=_['merge']({},_0x121b8f,_0x1caaf8[_0xeb5a('0x4b')]);return db[_0xeb5a('0x39')][_0xeb5a('0x53')](_0x121b8f)[_0xeb5a('0x1f')](handleEntityNotFound(_0xca0b40,null))[_0xeb5a('0x1f')](respondWithResult(_0xca0b40,null))[_0xeb5a('0x54')](handleError(_0xca0b40,null));};exports[_0xeb5a('0x55')]=function(_0x4e3a22,_0x48d7a3){return db[_0xeb5a('0x39')][_0xeb5a('0x55')](_0x4e3a22[_0xeb5a('0x56')],{})['then'](respondWithResult(_0x48d7a3,0xc9))[_0xeb5a('0x54')](handleError(_0x48d7a3,null));};exports['update']=function(_0x49efdc,_0x55428b){if(_0x49efdc[_0xeb5a('0x56')]['id']){delete _0x49efdc['body']['id'];}return db[_0xeb5a('0x39')]['find']({'where':{'id':_0x49efdc[_0xeb5a('0x51')]['id']}})[_0xeb5a('0x1f')](handleEntityNotFound(_0x55428b,null))[_0xeb5a('0x1f')](saveUpdates(_0x49efdc[_0xeb5a('0x56')],null))['then'](respondWithResult(_0x55428b,null))[_0xeb5a('0x54')](handleError(_0x55428b,null));};exports[_0xeb5a('0x33')]=function(_0x596247,_0x25f1e6){return db[_0xeb5a('0x39')][_0xeb5a('0x53')]({'where':{'id':_0x596247[_0xeb5a('0x51')]['id']}})[_0xeb5a('0x1f')](handleEntityNotFound(_0x25f1e6,null))[_0xeb5a('0x1f')](removeEntity(_0x25f1e6,null))[_0xeb5a('0x54')](handleError(_0x25f1e6,null));};exports[_0xeb5a('0x57')]=function(_0x397561,_0x2c6269,_0x5ab6ae){var _0x533860={};var _0xb660e1={};var _0x26229;var _0x515d1e;return db[_0xeb5a('0x39')]['findOne']({'where':{'id':_0x397561['params']['id']}})[_0xeb5a('0x1f')](handleEntityNotFound(_0x2c6269,null))[_0xeb5a('0x1f')](function(_0x4439a1){if(_0x4439a1){_0x26229=_0x4439a1;_0xb660e1['model']=_['keys'](db[_0xeb5a('0x58')][_0xeb5a('0x3a')]);_0xb660e1[_0xeb5a('0x40')]=_[_0xeb5a('0x52')](_0x397561[_0xeb5a('0x40')]);_0xb660e1[_0xeb5a('0x59')]=_['intersection'](_0xb660e1[_0xeb5a('0x3e')],_0xb660e1[_0xeb5a('0x40')]);_0x533860[_0xeb5a('0x43')]=_[_0xeb5a('0x41')](_0xb660e1[_0xeb5a('0x3e')],qs[_0xeb5a('0x42')](_0x397561['query'][_0xeb5a('0x42')]));_0x533860[_0xeb5a('0x43')]=_0x533860[_0xeb5a('0x43')][_0xeb5a('0x44')]?_0x533860[_0xeb5a('0x43')]:_0xb660e1[_0xeb5a('0x3e')];_0x533860[_0xeb5a('0x46')]=qs[_0xeb5a('0x47')](_0x397561['query']['sort']);_0x533860['where']=qs[_0xeb5a('0x59')](_['pick'](_0x397561[_0xeb5a('0x40')],_0xb660e1[_0xeb5a('0x59')]));if(_0x397561[_0xeb5a('0x40')]['filter']){_0x533860[_0xeb5a('0x49')]=_[_0xeb5a('0x4a')](_0x533860[_0xeb5a('0x49')],{'$or':_[_0xeb5a('0x3f')](_0x533860['attributes'],function(_0x1d9415){var _0x48b4ca={};_0x48b4ca[_0x1d9415]={'$like':'%'+_0x397561[_0xeb5a('0x40')][_0xeb5a('0x48')]+'%'};return _0x48b4ca;})});}_0x533860=_[_0xeb5a('0x4a')]({},_0x533860,_0x397561[_0xeb5a('0x4b')]);return _0x26229[_0xeb5a('0x57')](_0x533860);}})[_0xeb5a('0x1f')](function(_0x3c4156){if(_0x3c4156){_0x515d1e=_0x3c4156['length'];if(!_0x397561[_0xeb5a('0x40')][_0xeb5a('0x5a')]('nolimit')){_0x533860[_0xeb5a('0x2e')]=qs['limit'](_0x397561['query'][_0xeb5a('0x2e')]);_0x533860[_0xeb5a('0x2d')]=qs[_0xeb5a('0x2d')](_0x397561[_0xeb5a('0x40')][_0xeb5a('0x2d')]);}return _0x26229[_0xeb5a('0x57')](_0x533860);}})['then'](function(_0xe0faa4){if(_0xe0faa4){return _0xe0faa4?{'count':_0x515d1e,'rows':_0xe0faa4}:null;}})[_0xeb5a('0x1f')](respondWithResult(_0x2c6269,null))[_0xeb5a('0x54')](handleError(_0x2c6269,null));};exports[_0xeb5a('0x5b')]=function(_0x143563,_0xe5b2d,_0x17ac37){var _0x36df68={};var _0x15ad5d={};var _0x34423d;var _0x53c56c;return db[_0xeb5a('0x39')][_0xeb5a('0x5c')]({'where':{'id':_0x143563[_0xeb5a('0x51')]['id']}})[_0xeb5a('0x1f')](handleEntityNotFound(_0xe5b2d,null))[_0xeb5a('0x1f')](function(_0x154c98){if(_0x154c98){_0x34423d=_0x154c98;_0x15ad5d[_0xeb5a('0x3e')]=_[_0xeb5a('0x52')](db[_0xeb5a('0x58')][_0xeb5a('0x3a')]);_0x15ad5d[_0xeb5a('0x40')]=_['keys'](_0x143563['query']);_0x15ad5d[_0xeb5a('0x59')]=_[_0xeb5a('0x41')](_0x15ad5d[_0xeb5a('0x3e')],_0x15ad5d[_0xeb5a('0x40')]);_0x36df68['attributes']=_[_0xeb5a('0x41')](_0x15ad5d[_0xeb5a('0x3e')],qs[_0xeb5a('0x42')](_0x143563[_0xeb5a('0x40')]['fields']));_0x36df68[_0xeb5a('0x43')]=_0x36df68['attributes']['length']?_0x36df68[_0xeb5a('0x43')]:_0x15ad5d[_0xeb5a('0x3e')];_0x36df68[_0xeb5a('0x46')]=qs[_0xeb5a('0x47')](_0x143563['query'][_0xeb5a('0x47')]);_0x36df68['where']=qs['filters'](_['pick'](_0x143563[_0xeb5a('0x40')],_0x15ad5d[_0xeb5a('0x59')]));if(_0x143563[_0xeb5a('0x40')][_0xeb5a('0x48')]){_0x36df68[_0xeb5a('0x49')]=_['merge'](_0x36df68['where'],{'$or':_[_0xeb5a('0x3f')](_0x36df68[_0xeb5a('0x43')],function(_0xae794b){var _0x52c4fb={};_0x52c4fb[_0xae794b]={'$like':'%'+_0x143563[_0xeb5a('0x40')][_0xeb5a('0x48')]+'%'};return _0x52c4fb;})});}_0x36df68=_[_0xeb5a('0x4a')]({},_0x36df68,_0x143563[_0xeb5a('0x4b')]);return _0x34423d[_0xeb5a('0x5b')](_0x36df68);}})['then'](function(_0x1d9efb){if(_0x1d9efb){_0x53c56c=_0x1d9efb['length'];if(!_0x143563[_0xeb5a('0x40')][_0xeb5a('0x5a')]('nolimit')){_0x36df68[_0xeb5a('0x2e')]=qs[_0xeb5a('0x2e')](_0x143563[_0xeb5a('0x40')][_0xeb5a('0x2e')]);_0x36df68['offset']=qs[_0xeb5a('0x2d')](_0x143563[_0xeb5a('0x40')]['offset']);}return _0x34423d[_0xeb5a('0x5b')](_0x36df68);}})[_0xeb5a('0x1f')](function(_0x59b192){if(_0x59b192){return _0x59b192?{'count':_0x53c56c,'rows':_0x59b192}:null;}})['then'](respondWithResult(_0xe5b2d,null))[_0xeb5a('0x54')](handleError(_0xe5b2d,null));};exports[_0xeb5a('0x5d')]=function(_0x41719c,_0x47e145,_0x7994f1){var _0x4705bb={};var _0x19a9c6={};var _0x1dd82b;var _0x51bb7f;return db[_0xeb5a('0x39')][_0xeb5a('0x5c')]({'where':{'id':_0x41719c['params']['id']}})[_0xeb5a('0x1f')](handleEntityNotFound(_0x47e145,null))[_0xeb5a('0x1f')](function(_0x18322c){if(_0x18322c){_0x1dd82b=_0x18322c;_0x19a9c6[_0xeb5a('0x3e')]=_[_0xeb5a('0x52')](db[_0xeb5a('0x58')][_0xeb5a('0x3a')]);_0x19a9c6['query']=_['keys'](_0x41719c[_0xeb5a('0x40')]);_0x19a9c6[_0xeb5a('0x59')]=_[_0xeb5a('0x41')](_0x19a9c6['model'],_0x19a9c6[_0xeb5a('0x40')]);_0x4705bb[_0xeb5a('0x43')]=_[_0xeb5a('0x41')](_0x19a9c6[_0xeb5a('0x3e')],qs[_0xeb5a('0x42')](_0x41719c[_0xeb5a('0x40')][_0xeb5a('0x42')]));_0x4705bb[_0xeb5a('0x43')]=_0x4705bb[_0xeb5a('0x43')]['length']?_0x4705bb['attributes']:_0x19a9c6[_0xeb5a('0x3e')];_0x4705bb[_0xeb5a('0x46')]=qs[_0xeb5a('0x47')](_0x41719c['query'][_0xeb5a('0x47')]);_0x4705bb[_0xeb5a('0x49')]=qs['filters'](_[_0xeb5a('0x5e')](_0x41719c[_0xeb5a('0x40')],_0x19a9c6['filters']));if(_0x41719c[_0xeb5a('0x40')][_0xeb5a('0x48')]){_0x4705bb[_0xeb5a('0x49')]=_[_0xeb5a('0x4a')](_0x4705bb['where'],{'$or':_['map'](_0x4705bb[_0xeb5a('0x43')],function(_0x5b5ab5){var _0xb5ef00={};_0xb5ef00[_0x5b5ab5]={'$like':'%'+_0x41719c[_0xeb5a('0x40')][_0xeb5a('0x48')]+'%'};return _0xb5ef00;})});}_0x4705bb=_[_0xeb5a('0x4a')]({},_0x4705bb,_0x41719c[_0xeb5a('0x4b')]);return _0x1dd82b[_0xeb5a('0x5d')](_0x4705bb);}})[_0xeb5a('0x1f')](function(_0x37b84f){if(_0x37b84f){_0x51bb7f=_0x37b84f[_0xeb5a('0x44')];if(!_0x41719c[_0xeb5a('0x40')][_0xeb5a('0x5a')](_0xeb5a('0x45'))){_0x4705bb[_0xeb5a('0x2e')]=qs['limit'](_0x41719c[_0xeb5a('0x40')][_0xeb5a('0x2e')]);_0x4705bb['offset']=qs[_0xeb5a('0x2d')](_0x41719c[_0xeb5a('0x40')][_0xeb5a('0x2d')]);}return _0x1dd82b[_0xeb5a('0x5d')](_0x4705bb);}})['then'](function(_0xfa60de){if(_0xfa60de){return _0xfa60de?{'count':_0x51bb7f,'rows':_0xfa60de}:null;}})[_0xeb5a('0x1f')](respondWithResult(_0x47e145,null))['catch'](handleError(_0x47e145,null));}; \ No newline at end of file +var _0x5998=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','crypto','jsforce','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../mysqldb','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','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','SalesforceConfiguration,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','stack','name','send','map','SalesforceConfiguration','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filters','filter','merge','includeAll','findAll','rows','params','create','body','find','findOne','SalesforceField','options','getFields','getSubjects','getDescriptions','html-pdf','eml-format'];(function(_0x201d5e,_0x1bb52c){var _0x584f23=function(_0x44e23a){while(--_0x44e23a){_0x201d5e['push'](_0x201d5e['shift']());}};_0x584f23(++_0x1bb52c);}(_0x5998,0xac));var _0x8599=function(_0x360246,_0x2408e5){_0x360246=_0x360246-0x0;var _0x42e1cb=_0x5998[_0x360246];return _0x42e1cb;};'use strict';var pdf=require(_0x8599('0x0'));var emlformat=require(_0x8599('0x1'));var rimraf=require(_0x8599('0x2'));var zipdir=require(_0x8599('0x3'));var jsonpatch=require(_0x8599('0x4'));var rp=require(_0x8599('0x5'));var moment=require(_0x8599('0x6'));var BPromise=require(_0x8599('0x7'));var Mustache=require(_0x8599('0x8'));var util=require('util');var path=require(_0x8599('0x9'));var sox=require(_0x8599('0xa'));var csv=require(_0x8599('0xb'));var ejs=require(_0x8599('0xc'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x8599('0xd'));var jsforce=require(_0x8599('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8599('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8599('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x8599('0x10'));var as=require(_0x8599('0x11'));var hardwareService=require(_0x8599('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x8599('0x13'));var config=require('../../config/environment');var db=require(_0x8599('0x14'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x8599('0x15')]['http']({'port':0x232a});function checkPasswordPattern(_0x3743bb,_0x209fcc,_0x2a5912){if(_0x2a5912){var _0x44bcb2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x44bcb2[_0x8599('0x16')](_0x209fcc)){return _0x3743bb;}else{throw new db[(_0x8599('0x17'))]['ValidationError'](_0x8599('0x18'));}}else{return _0x3743bb;}}function respondWithRpcPromise(_0xfc001e,_0x18fb1a,_0x19a63e,_0x208695){return new BPromise(function(_0x344d3b,_0x264cb5){var _0x1943dd=_0x208695||client;return _0x1943dd[_0x8599('0x19')](_0xfc001e,_0x19a63e)[_0x8599('0x1a')](function(_0x5e1096){logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x18fb1a,_0x8599('0x1b'));logger[_0x8599('0x1c')](_0x8599('0x1d'),_0x18fb1a,_0x8599('0x1b'),JSON[_0x8599('0x1e')](_0x5e1096));if(_0x5e1096[_0x8599('0x1f')]){if(_0x5e1096[_0x8599('0x1f')]['code']===0x1f4){logger['error'](_0x8599('0x20'),_0x18fb1a,_0x5e1096[_0x8599('0x1f')][_0x8599('0x21')]);return _0x264cb5(_0x5e1096[_0x8599('0x1f')]['message']);}logger['error'](_0x8599('0x20'),_0x18fb1a,_0x5e1096['error'][_0x8599('0x21')]);return _0x344d3b(_0x5e1096['error'][_0x8599('0x21')]);}else{logger[_0x8599('0x22')]('SalesforceConfiguration,\x20%s,\x20%s',_0x18fb1a,_0x8599('0x1b'));_0x344d3b(_0x5e1096[_0x8599('0x23')][_0x8599('0x21')]);}})[_0x8599('0x24')](function(_0x5ee601){logger[_0x8599('0x1f')]('SalesforceConfiguration,\x20%s,\x20%s',_0x18fb1a,_0x5ee601);_0x264cb5(_0x5ee601);});});}function respondWithStatusCode(_0x2b27a6,_0x23f82a){_0x23f82a=_0x23f82a||0xcc;return function(_0x1c252a){if(_0x1c252a){return _0x2b27a6[_0x8599('0x25')](_0x23f82a);}return _0x2b27a6[_0x8599('0x26')](_0x23f82a)[_0x8599('0x27')]();};}function respondWithResult(_0x45719f,_0x3ca7c2){_0x3ca7c2=_0x3ca7c2||0xc8;return function(_0x94239e){if(_0x94239e){return _0x45719f[_0x8599('0x26')](_0x3ca7c2)[_0x8599('0x28')](_0x94239e);}};}function respondWithFilteredResult(_0x327b7b,_0x5c029d){return function(_0x66ad49){if(_0x66ad49){var _0x3c1f01=_0x66ad49[_0x8599('0x29')],_0x5cfee9=_0x5c029d['offset'],_0x889ddb=_0x5c029d[_0x8599('0x2a')]+_0x5c029d['limit'],_0xec3871;if(_0x889ddb>=_0x3c1f01){_0x889ddb=_0x3c1f01;_0xec3871=0xc8;}else{_0xec3871=0xce;}_0x327b7b['status'](_0xec3871);return _0x327b7b[_0x8599('0x2b')](_0x8599('0x2c'),_0x5cfee9+'-'+_0x889ddb+'/'+_0x3c1f01)[_0x8599('0x28')](_0x66ad49);}return null;};}function patchUpdates(_0x3dbc36){return function(_0x2350aa){try{jsonpatch[_0x8599('0x2d')](_0x2350aa,_0x3dbc36,!![]);}catch(_0x3d8699){return BPromise[_0x8599('0x2e')](_0x3d8699);}return _0x2350aa[_0x8599('0x2f')]();};}function saveUpdates(_0x763bc1,_0x364b71){return function(_0x11f8cd){if(_0x11f8cd){return _0x11f8cd[_0x8599('0x30')](_0x763bc1)['then'](function(_0x4e50ea){return _0x4e50ea;});}return null;};}function removeEntity(_0x474f40,_0x46883f){return function(_0x20701c){if(_0x20701c){return _0x20701c['destroy']()[_0x8599('0x1a')](function(){_0x474f40[_0x8599('0x26')](0xcc)[_0x8599('0x27')]();});}};}function handleEntityNotFound(_0x28061f,_0x2e18de){return function(_0x562440){if(!_0x562440){_0x28061f['sendStatus'](0x194);}return _0x562440;};}function handleError(_0x225297,_0x9cb2d9){_0x9cb2d9=_0x9cb2d9||0x1f4;return function(_0x318e5f){logger[_0x8599('0x1f')](_0x318e5f[_0x8599('0x31')]);if(_0x318e5f[_0x8599('0x32')]){delete _0x318e5f[_0x8599('0x32')];}_0x225297['status'](_0x9cb2d9)[_0x8599('0x33')](_0x318e5f);};}exports['index']=function(_0x5c48e2,_0x1f79fd){var _0x4e0de0={},_0x1a3382={},_0x3742d6={'count':0x0,'rows':[]};var _0x2a7b74=_[_0x8599('0x34')](db[_0x8599('0x35')][_0x8599('0x36')],function(_0x2aafc5){return{'name':_0x2aafc5['fieldName'],'type':_0x2aafc5[_0x8599('0x37')][_0x8599('0x38')]};});_0x1a3382[_0x8599('0x39')]=_[_0x8599('0x34')](_0x2a7b74,_0x8599('0x32'));_0x1a3382[_0x8599('0x3a')]=_[_0x8599('0x3b')](_0x5c48e2['query']);_0x1a3382['filters']=_[_0x8599('0x3c')](_0x1a3382[_0x8599('0x39')],_0x1a3382['query']);_0x4e0de0[_0x8599('0x3d')]=_['intersection'](_0x1a3382['model'],qs[_0x8599('0x3e')](_0x5c48e2[_0x8599('0x3a')][_0x8599('0x3e')]));_0x4e0de0[_0x8599('0x3d')]=_0x4e0de0[_0x8599('0x3d')][_0x8599('0x3f')]?_0x4e0de0[_0x8599('0x3d')]:_0x1a3382[_0x8599('0x39')];if(!_0x5c48e2[_0x8599('0x3a')][_0x8599('0x40')](_0x8599('0x41'))){_0x4e0de0[_0x8599('0x42')]=qs['limit'](_0x5c48e2[_0x8599('0x3a')][_0x8599('0x42')]);_0x4e0de0[_0x8599('0x2a')]=qs['offset'](_0x5c48e2[_0x8599('0x3a')][_0x8599('0x2a')]);}_0x4e0de0[_0x8599('0x43')]=qs[_0x8599('0x44')](_0x5c48e2[_0x8599('0x3a')][_0x8599('0x44')]);_0x4e0de0[_0x8599('0x45')]=qs['filters'](_[_0x8599('0x46')](_0x5c48e2[_0x8599('0x3a')],_0x1a3382[_0x8599('0x47')]));if(_0x5c48e2[_0x8599('0x3a')]['filter']){_0x4e0de0[_0x8599('0x45')]=_['merge'](_0x4e0de0[_0x8599('0x45')],{'$or':_['map'](_0x2a7b74,function(_0xea812d){if(_0xea812d[_0x8599('0x37')]!=='VIRTUAL'){var _0x2b07d4={};_0x2b07d4[_0xea812d['name']]={'$like':'%'+_0x5c48e2[_0x8599('0x3a')][_0x8599('0x48')]+'%'};return _0x2b07d4;}})});}_0x4e0de0=_[_0x8599('0x49')]({},_0x4e0de0,_0x5c48e2['options']);var _0xd57464={'where':_0x4e0de0[_0x8599('0x45')]};return db[_0x8599('0x35')][_0x8599('0x29')](_0xd57464)[_0x8599('0x1a')](function(_0x46f4be){_0x3742d6[_0x8599('0x29')]=_0x46f4be;if(_0x5c48e2['query'][_0x8599('0x4a')]){_0x4e0de0['include']=[{'all':!![]}];}return db[_0x8599('0x35')][_0x8599('0x4b')](_0x4e0de0);})['then'](function(_0x3b22aa){_0x3742d6[_0x8599('0x4c')]=_0x3b22aa;return _0x3742d6;})['then'](respondWithFilteredResult(_0x1f79fd,_0x4e0de0))['catch'](handleError(_0x1f79fd,null));};exports['show']=function(_0x4239cd,_0x3ef949){var _0x5846ff={'raw':![],'where':{'id':_0x4239cd[_0x8599('0x4d')]['id']}},_0x376808={};_0x376808[_0x8599('0x39')]=_[_0x8599('0x3b')](db[_0x8599('0x35')][_0x8599('0x36')]);_0x376808[_0x8599('0x3a')]=_['keys'](_0x4239cd['query']);_0x376808[_0x8599('0x47')]=_[_0x8599('0x3c')](_0x376808[_0x8599('0x39')],_0x376808['query']);_0x5846ff[_0x8599('0x3d')]=_['intersection'](_0x376808[_0x8599('0x39')],qs[_0x8599('0x3e')](_0x4239cd[_0x8599('0x3a')][_0x8599('0x3e')]));_0x5846ff['attributes']=_0x5846ff[_0x8599('0x3d')][_0x8599('0x3f')]?_0x5846ff[_0x8599('0x3d')]:_0x376808[_0x8599('0x39')];if(_0x4239cd[_0x8599('0x3a')]['includeAll']){_0x5846ff['include']=[{'all':!![]}];}_0x5846ff=_[_0x8599('0x49')]({},_0x5846ff,_0x4239cd['options']);return db[_0x8599('0x35')]['find'](_0x5846ff)[_0x8599('0x1a')](handleEntityNotFound(_0x3ef949,null))['then'](respondWithResult(_0x3ef949,null))['catch'](handleError(_0x3ef949,null));};exports[_0x8599('0x4e')]=function(_0x492d4b,_0x277eb5){return db[_0x8599('0x35')]['create'](_0x492d4b[_0x8599('0x4f')],{})[_0x8599('0x1a')](respondWithResult(_0x277eb5,0xc9))[_0x8599('0x24')](handleError(_0x277eb5,null));};exports[_0x8599('0x30')]=function(_0xaf9cf9,_0x459b8b){if(_0xaf9cf9[_0x8599('0x4f')]['id']){delete _0xaf9cf9['body']['id'];}return db[_0x8599('0x35')][_0x8599('0x50')]({'where':{'id':_0xaf9cf9[_0x8599('0x4d')]['id']}})['then'](handleEntityNotFound(_0x459b8b,null))[_0x8599('0x1a')](saveUpdates(_0xaf9cf9[_0x8599('0x4f')],null))[_0x8599('0x1a')](respondWithResult(_0x459b8b,null))[_0x8599('0x24')](handleError(_0x459b8b,null));};exports['destroy']=function(_0x39fb06,_0x2e33c3){return db[_0x8599('0x35')][_0x8599('0x50')]({'where':{'id':_0x39fb06['params']['id']}})[_0x8599('0x1a')](handleEntityNotFound(_0x2e33c3,null))[_0x8599('0x1a')](removeEntity(_0x2e33c3,null))[_0x8599('0x24')](handleError(_0x2e33c3,null));};exports['getFields']=function(_0x43b915,_0x58affe,_0x171e42){var _0xd5813f={};var _0x4ee51b={};var _0x4c4f09;var _0x4c7dd0;return db['SalesforceConfiguration'][_0x8599('0x51')]({'where':{'id':_0x43b915[_0x8599('0x4d')]['id']}})[_0x8599('0x1a')](handleEntityNotFound(_0x58affe,null))['then'](function(_0x5723e7){if(_0x5723e7){_0x4c4f09=_0x5723e7;_0x4ee51b[_0x8599('0x39')]=_[_0x8599('0x3b')](db[_0x8599('0x52')][_0x8599('0x36')]);_0x4ee51b[_0x8599('0x3a')]=_['keys'](_0x43b915[_0x8599('0x3a')]);_0x4ee51b['filters']=_[_0x8599('0x3c')](_0x4ee51b[_0x8599('0x39')],_0x4ee51b[_0x8599('0x3a')]);_0xd5813f[_0x8599('0x3d')]=_['intersection'](_0x4ee51b[_0x8599('0x39')],qs['fields'](_0x43b915['query']['fields']));_0xd5813f[_0x8599('0x3d')]=_0xd5813f[_0x8599('0x3d')][_0x8599('0x3f')]?_0xd5813f[_0x8599('0x3d')]:_0x4ee51b[_0x8599('0x39')];_0xd5813f[_0x8599('0x43')]=qs[_0x8599('0x44')](_0x43b915[_0x8599('0x3a')][_0x8599('0x44')]);_0xd5813f[_0x8599('0x45')]=qs[_0x8599('0x47')](_[_0x8599('0x46')](_0x43b915[_0x8599('0x3a')],_0x4ee51b[_0x8599('0x47')]));if(_0x43b915['query'][_0x8599('0x48')]){_0xd5813f['where']=_['merge'](_0xd5813f[_0x8599('0x45')],{'$or':_[_0x8599('0x34')](_0xd5813f[_0x8599('0x3d')],function(_0x435205){var _0x34d6d3={};_0x34d6d3[_0x435205]={'$like':'%'+_0x43b915[_0x8599('0x3a')][_0x8599('0x48')]+'%'};return _0x34d6d3;})});}_0xd5813f=_['merge']({},_0xd5813f,_0x43b915[_0x8599('0x53')]);return _0x4c4f09['getFields'](_0xd5813f);}})[_0x8599('0x1a')](function(_0x50e12a){if(_0x50e12a){_0x4c7dd0=_0x50e12a[_0x8599('0x3f')];if(!_0x43b915[_0x8599('0x3a')]['hasOwnProperty'](_0x8599('0x41'))){_0xd5813f[_0x8599('0x42')]=qs[_0x8599('0x42')](_0x43b915[_0x8599('0x3a')][_0x8599('0x42')]);_0xd5813f[_0x8599('0x2a')]=qs['offset'](_0x43b915[_0x8599('0x3a')][_0x8599('0x2a')]);}return _0x4c4f09[_0x8599('0x54')](_0xd5813f);}})[_0x8599('0x1a')](function(_0x4db858){if(_0x4db858){return _0x4db858?{'count':_0x4c7dd0,'rows':_0x4db858}:null;}})[_0x8599('0x1a')](respondWithResult(_0x58affe,null))[_0x8599('0x24')](handleError(_0x58affe,null));};exports[_0x8599('0x55')]=function(_0x114ed8,_0x4d21bc,_0xa500dd){var _0xa175ed={};var _0x28c68e={};var _0xea6848;var _0xe56989;return db[_0x8599('0x35')][_0x8599('0x51')]({'where':{'id':_0x114ed8[_0x8599('0x4d')]['id']}})[_0x8599('0x1a')](handleEntityNotFound(_0x4d21bc,null))['then'](function(_0x5b67a3){if(_0x5b67a3){_0xea6848=_0x5b67a3;_0x28c68e[_0x8599('0x39')]=_[_0x8599('0x3b')](db[_0x8599('0x52')]['rawAttributes']);_0x28c68e['query']=_[_0x8599('0x3b')](_0x114ed8[_0x8599('0x3a')]);_0x28c68e[_0x8599('0x47')]=_[_0x8599('0x3c')](_0x28c68e[_0x8599('0x39')],_0x28c68e['query']);_0xa175ed[_0x8599('0x3d')]=_[_0x8599('0x3c')](_0x28c68e[_0x8599('0x39')],qs[_0x8599('0x3e')](_0x114ed8[_0x8599('0x3a')][_0x8599('0x3e')]));_0xa175ed[_0x8599('0x3d')]=_0xa175ed[_0x8599('0x3d')][_0x8599('0x3f')]?_0xa175ed[_0x8599('0x3d')]:_0x28c68e['model'];_0xa175ed['order']=qs[_0x8599('0x44')](_0x114ed8[_0x8599('0x3a')][_0x8599('0x44')]);_0xa175ed[_0x8599('0x45')]=qs[_0x8599('0x47')](_[_0x8599('0x46')](_0x114ed8[_0x8599('0x3a')],_0x28c68e[_0x8599('0x47')]));if(_0x114ed8[_0x8599('0x3a')][_0x8599('0x48')]){_0xa175ed[_0x8599('0x45')]=_[_0x8599('0x49')](_0xa175ed[_0x8599('0x45')],{'$or':_[_0x8599('0x34')](_0xa175ed['attributes'],function(_0x2e6573){var _0x4681fa={};_0x4681fa[_0x2e6573]={'$like':'%'+_0x114ed8['query']['filter']+'%'};return _0x4681fa;})});}_0xa175ed=_['merge']({},_0xa175ed,_0x114ed8[_0x8599('0x53')]);return _0xea6848['getSubjects'](_0xa175ed);}})[_0x8599('0x1a')](function(_0x2eb7a6){if(_0x2eb7a6){_0xe56989=_0x2eb7a6[_0x8599('0x3f')];if(!_0x114ed8[_0x8599('0x3a')][_0x8599('0x40')](_0x8599('0x41'))){_0xa175ed[_0x8599('0x42')]=qs['limit'](_0x114ed8[_0x8599('0x3a')][_0x8599('0x42')]);_0xa175ed[_0x8599('0x2a')]=qs[_0x8599('0x2a')](_0x114ed8[_0x8599('0x3a')][_0x8599('0x2a')]);}return _0xea6848[_0x8599('0x55')](_0xa175ed);}})[_0x8599('0x1a')](function(_0x526652){if(_0x526652){return _0x526652?{'count':_0xe56989,'rows':_0x526652}:null;}})[_0x8599('0x1a')](respondWithResult(_0x4d21bc,null))[_0x8599('0x24')](handleError(_0x4d21bc,null));};exports['getDescriptions']=function(_0x2aa3df,_0x5d62a9,_0x313467){var _0x36cd56={};var _0x1cb98a={};var _0x3289a5;var _0x541068;return db['SalesforceConfiguration'][_0x8599('0x51')]({'where':{'id':_0x2aa3df[_0x8599('0x4d')]['id']}})[_0x8599('0x1a')](handleEntityNotFound(_0x5d62a9,null))[_0x8599('0x1a')](function(_0x215a98){if(_0x215a98){_0x3289a5=_0x215a98;_0x1cb98a['model']=_['keys'](db['SalesforceField']['rawAttributes']);_0x1cb98a['query']=_[_0x8599('0x3b')](_0x2aa3df[_0x8599('0x3a')]);_0x1cb98a[_0x8599('0x47')]=_['intersection'](_0x1cb98a[_0x8599('0x39')],_0x1cb98a[_0x8599('0x3a')]);_0x36cd56[_0x8599('0x3d')]=_[_0x8599('0x3c')](_0x1cb98a['model'],qs[_0x8599('0x3e')](_0x2aa3df[_0x8599('0x3a')][_0x8599('0x3e')]));_0x36cd56[_0x8599('0x3d')]=_0x36cd56[_0x8599('0x3d')][_0x8599('0x3f')]?_0x36cd56['attributes']:_0x1cb98a[_0x8599('0x39')];_0x36cd56[_0x8599('0x43')]=qs['sort'](_0x2aa3df['query']['sort']);_0x36cd56[_0x8599('0x45')]=qs[_0x8599('0x47')](_[_0x8599('0x46')](_0x2aa3df['query'],_0x1cb98a[_0x8599('0x47')]));if(_0x2aa3df['query'][_0x8599('0x48')]){_0x36cd56['where']=_[_0x8599('0x49')](_0x36cd56[_0x8599('0x45')],{'$or':_[_0x8599('0x34')](_0x36cd56[_0x8599('0x3d')],function(_0x27c11b){var _0xced74e={};_0xced74e[_0x27c11b]={'$like':'%'+_0x2aa3df[_0x8599('0x3a')][_0x8599('0x48')]+'%'};return _0xced74e;})});}_0x36cd56=_[_0x8599('0x49')]({},_0x36cd56,_0x2aa3df['options']);return _0x3289a5['getDescriptions'](_0x36cd56);}})[_0x8599('0x1a')](function(_0x5eaaf2){if(_0x5eaaf2){_0x541068=_0x5eaaf2[_0x8599('0x3f')];if(!_0x2aa3df[_0x8599('0x3a')][_0x8599('0x40')]('nolimit')){_0x36cd56[_0x8599('0x42')]=qs[_0x8599('0x42')](_0x2aa3df[_0x8599('0x3a')][_0x8599('0x42')]);_0x36cd56['offset']=qs['offset'](_0x2aa3df[_0x8599('0x3a')][_0x8599('0x2a')]);}return _0x3289a5[_0x8599('0x56')](_0x36cd56);}})[_0x8599('0x1a')](function(_0x393687){if(_0x393687){return _0x393687?{'count':_0x541068,'rows':_0x393687}:null;}})[_0x8599('0x1a')](respondWithResult(_0x5d62a9,null))['catch'](handleError(_0x5d62a9,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index d7d82b8..c1179bb 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 _0x8541=['request-promise','path','./intSalesforceConfiguration.attributes','exports','define','SalesforceConfiguration','int_salesforce_configurations','lodash','util','../../config/logger','api','moment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8541,0x17b));var _0x1854=function(_0x54bf54,_0x14fa6e){_0x54bf54=_0x54bf54-0x0;var _0x20a442=_0x8541[_0x54bf54];return _0x20a442;};'use strict';var _=require(_0x1854('0x0'));var util=require(_0x1854('0x1'));var logger=require(_0x1854('0x2'))(_0x1854('0x3'));var moment=require(_0x1854('0x4'));var BPromise=require('bluebird');var rp=require(_0x1854('0x5'));var fs=require('fs');var path=require(_0x1854('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1854('0x7'));module[_0x1854('0x8')]=function(_0x1e1958,_0x3bbb0e){return _0x1e1958[_0x1854('0x9')](_0x1854('0xa'),attributes,{'tableName':_0x1854('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1a2b=['moment','path','exports','define','int_salesforce_configurations','lodash','../../config/logger','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1a2b,0x6d));var _0xb1a2=function(_0x49a60f,_0x518c48){_0x49a60f=_0x49a60f-0x0;var _0x38c29c=_0x1a2b[_0x49a60f];return _0x38c29c;};'use strict';var _=require(_0xb1a2('0x0'));var util=require('util');var logger=require(_0xb1a2('0x1'))(_0xb1a2('0x2'));var moment=require(_0xb1a2('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb1a2('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intSalesforceConfiguration.attributes');module[_0xb1a2('0x5')]=function(_0x42a8a1,_0x3d19ad){return _0x42a8a1[_0xb1a2('0x6')]('SalesforceConfiguration',attributes,{'tableName':_0xb1a2('0x7'),'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 07f3d27..f5aef87 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 _0x7536=['SalesforceConfiguration,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','request\x20sent','stringify','error','code'];(function(_0x36ed3c,_0x44a00a){var _0x52a2e0=function(_0x3f7af9){while(--_0x3f7af9){_0x36ed3c['push'](_0x36ed3c['shift']());}};_0x52a2e0(++_0x44a00a);}(_0x7536,0xe1));var _0x6753=function(_0x2dbce7,_0x57cb8d){_0x2dbce7=_0x2dbce7-0x0;var _0x3a3ed0=_0x7536[_0x2dbce7];return _0x3a3ed0;};'use strict';var _=require(_0x6753('0x0'));var util=require(_0x6753('0x1'));var moment=require(_0x6753('0x2'));var BPromise=require(_0x6753('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6753('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6753('0x5'));var logger=require('../../config/logger')(_0x6753('0x6'));var config=require(_0x6753('0x7'));var jayson=require(_0x6753('0x8'));var client=jayson[_0x6753('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x20af28,_0x3f6d4a,_0x27c014){return new BPromise(function(_0x564cd9,_0x539b47){return client['request'](_0x20af28,_0x27c014)[_0x6753('0xa')](function(_0x5216d7){logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x3f6d4a,_0x6753('0xb'));logger['debug']('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x3f6d4a,'request\x20sent',JSON[_0x6753('0xc')](_0x5216d7));if(_0x5216d7[_0x6753('0xd')]){if(_0x5216d7[_0x6753('0xd')][_0x6753('0xe')]===0x1f4){logger[_0x6753('0xd')](_0x6753('0xf'),_0x3f6d4a,_0x5216d7[_0x6753('0xd')][_0x6753('0x10')]);return _0x539b47(_0x5216d7[_0x6753('0xd')]['message']);}logger[_0x6753('0xd')](_0x6753('0xf'),_0x3f6d4a,_0x5216d7[_0x6753('0xd')][_0x6753('0x10')]);return _0x564cd9(_0x5216d7[_0x6753('0xd')]['message']);}else{logger[_0x6753('0x11')](_0x6753('0xf'),_0x3f6d4a,_0x6753('0xb'));_0x564cd9(_0x5216d7[_0x6753('0x12')][_0x6753('0x10')]);}})[_0x6753('0x13')](function(_0x77d42){logger[_0x6753('0xd')](_0x6753('0xf'),_0x3f6d4a,_0x77d42);_0x539b47(_0x77d42);});});} \ No newline at end of file +var _0xf215=['SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x449689,_0x26d331){var _0x2dc67b=function(_0x4f2f19){while(--_0x4f2f19){_0x449689['push'](_0x449689['shift']());}};_0x2dc67b(++_0x26d331);}(_0xf215,0x176));var _0x5f21=function(_0x532788,_0x232362){_0x532788=_0x532788-0x0;var _0x23c64f=_0xf215[_0x532788];return _0x23c64f;};'use strict';var _=require('lodash');var util=require(_0x5f21('0x0'));var moment=require('moment');var BPromise=require(_0x5f21('0x1'));var rs=require(_0x5f21('0x2'));var fs=require('fs');var Redis=require(_0x5f21('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5f21('0x4'));var logger=require(_0x5f21('0x5'))(_0x5f21('0x6'));var config=require(_0x5f21('0x7'));var jayson=require(_0x5f21('0x8'));var client=jayson[_0x5f21('0x9')][_0x5f21('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1977fc,_0x23221e,_0x591cc6){return new BPromise(function(_0x52dfc3,_0x3f6540){return client[_0x5f21('0xb')](_0x1977fc,_0x591cc6)[_0x5f21('0xc')](function(_0x4a2cfb){logger[_0x5f21('0xd')](_0x5f21('0xe'),_0x23221e,_0x5f21('0xf'));logger[_0x5f21('0x10')](_0x5f21('0x11'),_0x23221e,_0x5f21('0xf'),JSON[_0x5f21('0x12')](_0x4a2cfb));if(_0x4a2cfb[_0x5f21('0x13')]){if(_0x4a2cfb[_0x5f21('0x13')]['code']===0x1f4){logger[_0x5f21('0x13')](_0x5f21('0xe'),_0x23221e,_0x4a2cfb[_0x5f21('0x13')][_0x5f21('0x14')]);return _0x3f6540(_0x4a2cfb[_0x5f21('0x13')][_0x5f21('0x14')]);}logger[_0x5f21('0x13')](_0x5f21('0xe'),_0x23221e,_0x4a2cfb['error'][_0x5f21('0x14')]);return _0x52dfc3(_0x4a2cfb['error'][_0x5f21('0x14')]);}else{logger[_0x5f21('0xd')](_0x5f21('0xe'),_0x23221e,_0x5f21('0xf'));_0x52dfc3(_0x4a2cfb[_0x5f21('0x15')]['message']);}})[_0x5f21('0x16')](function(_0x5a7ee2){logger[_0x5f21('0x13')](_0x5f21('0xe'),_0x23221e,_0x5a7ee2);_0x3f6540(_0x5a7ee2);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 8e3498f..6fb56fe 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 _0x0295=['delete','exports','multer','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index','/:id','put'];(function(_0x126a28,_0x1e5229){var _0x1c2a08=function(_0x35685e){while(--_0x35685e){_0x126a28['push'](_0x126a28['shift']());}};_0x1c2a08(++_0x1e5229);}(_0x0295,0x1f0));var _0x5029=function(_0x2c61a2,_0x40fe37){_0x2c61a2=_0x2c61a2-0x0;var _0x28bf7c=_0x0295[_0x2c61a2];return _0x28bf7c;};'use strict';var multer=require(_0x5029('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5029('0x1'));var express=require('express');var router=express['Router']();var auth=require(_0x5029('0x2'));var interaction=require(_0x5029('0x3'));var config=require(_0x5029('0x4'));var controller=require(_0x5029('0x5'));router[_0x5029('0x6')]('/',auth[_0x5029('0x7')](),controller[_0x5029('0x8')]);router[_0x5029('0x6')](_0x5029('0x9'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x5029('0x7')](),controller['create']);router[_0x5029('0xa')]('/:id',auth[_0x5029('0x7')](),controller['update']);router[_0x5029('0xb')](_0x5029('0x9'),auth[_0x5029('0x7')](),controller['destroy']);module[_0x5029('0xc')]=router; \ No newline at end of file +var _0x5075=['express','Router','../../components/auth/service','../../config/environment','./intSalesforceField.controller','get','/:id','show','post','isAuthenticated','update','delete','destroy','multer','util','path','connect-timeout'];(function(_0x2690f7,_0x194a80){var _0x3e92e8=function(_0x53a8bb){while(--_0x53a8bb){_0x2690f7['push'](_0x2690f7['shift']());}};_0x3e92e8(++_0x194a80);}(_0x5075,0x73));var _0x5507=function(_0x5de97d,_0x1141ee){_0x5de97d=_0x5de97d-0x0;var _0x2da950=_0x5075[_0x5de97d];return _0x2da950;};'use strict';var multer=require(_0x5507('0x0'));var util=require(_0x5507('0x1'));var path=require(_0x5507('0x2'));var timeout=require(_0x5507('0x3'));var express=require(_0x5507('0x4'));var router=express[_0x5507('0x5')]();var auth=require(_0x5507('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5507('0x7'));var controller=require(_0x5507('0x8'));router[_0x5507('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5507('0x9')](_0x5507('0xa'),auth['isAuthenticated'](),controller[_0x5507('0xb')]);router[_0x5507('0xc')]('/',auth[_0x5507('0xd')](),controller['create']);router['put'](_0x5507('0xa'),auth[_0x5507('0xd')](),controller[_0x5507('0xe')]);router[_0x5507('0xf')]('/:id',auth[_0x5507('0xd')](),controller[_0x5507('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index ffa80f8..78713a3 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 _0xd0ac=['customVariable','string','STRING','ENUM','sequelize','exports','variable'];(function(_0x112047,_0x2d0a05){var _0x489afb=function(_0x1f4fde){while(--_0x1f4fde){_0x112047['push'](_0x112047['shift']());}};_0x489afb(++_0x2d0a05);}(_0xd0ac,0x1d2));var _0xcd0a=function(_0x47a4a5,_0x16e288){_0x47a4a5=_0x47a4a5-0x0;var _0x2be2da=_0xd0ac[_0x47a4a5];return _0x2be2da;};'use strict';var Sequelize=require(_0xcd0a('0x0'));module[_0xcd0a('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0xcd0a('0x2'),_0xcd0a('0x3'),'keyValue'),'defaultValue':_0xcd0a('0x4')},'content':{'type':Sequelize[_0xcd0a('0x5')]},'key':{'type':Sequelize[_0xcd0a('0x5')]},'keyType':{'type':Sequelize[_0xcd0a('0x6')](_0xcd0a('0x4'),_0xcd0a('0x2'),_0xcd0a('0x3'))},'keyContent':{'type':Sequelize[_0xcd0a('0x5')]},'idField':{'type':Sequelize[_0xcd0a('0x5')]},'variableName':{'type':Sequelize[_0xcd0a('0x5')]}}; \ No newline at end of file +var _0x2812=['ENUM','customVariable','STRING','string','variable','sequelize','exports'];(function(_0x73f87f,_0x2eb5c5){var _0x11899b=function(_0x5b2560){while(--_0x5b2560){_0x73f87f['push'](_0x73f87f['shift']());}};_0x11899b(++_0x2eb5c5);}(_0x2812,0x178));var _0x2281=function(_0x1ac6ec,_0x1f81fc){_0x1ac6ec=_0x1ac6ec-0x0;var _0x48a489=_0x2812[_0x1ac6ec];return _0x48a489;};'use strict';var Sequelize=require(_0x2281('0x0'));module[_0x2281('0x1')]={'type':{'type':Sequelize[_0x2281('0x2')]('string','variable',_0x2281('0x3'),'keyValue'),'defaultValue':'string'},'content':{'type':Sequelize[_0x2281('0x4')]},'key':{'type':Sequelize[_0x2281('0x4')]},'keyType':{'type':Sequelize[_0x2281('0x2')](_0x2281('0x5'),_0x2281('0x6'),_0x2281('0x3'))},'keyContent':{'type':Sequelize[_0x2281('0x4')]},'idField':{'type':Sequelize[_0x2281('0x4')]},'variableName':{'type':Sequelize[_0x2281('0x4')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 0fc90d0..5327809 100644 --- a/server/api/intSalesforceField/intSalesforceField.controller.js +++ b/server/api/intSalesforceField/intSalesforceField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b0e=['update','then','destroy','end','error','name','index','map','SalesforceField','fieldName','type','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','VIRTUAL','merge','count','includeAll','rows','show','params','rawAttributes','include','find','catch','create','body','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','set','reject'];(function(_0x31881,_0x6841a6){var _0x2f9f3d=function(_0x5f0028){while(--_0x5f0028){_0x31881['push'](_0x31881['shift']());}};_0x2f9f3d(++_0x6841a6);}(_0x0b0e,0x187));var _0xe0b0=function(_0x235f49,_0x2992b4){_0x235f49=_0x235f49-0x0;var _0x551139=_0x0b0e[_0x235f49];return _0x551139;};'use strict';var pdf=require(_0xe0b0('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xe0b0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe0b0('0x2'));var rp=require(_0xe0b0('0x3'));var moment=require(_0xe0b0('0x4'));var BPromise=require(_0xe0b0('0x5'));var Mustache=require(_0xe0b0('0x6'));var util=require(_0xe0b0('0x7'));var path=require(_0xe0b0('0x8'));var sox=require(_0xe0b0('0x9'));var csv=require(_0xe0b0('0xa'));var ejs=require(_0xe0b0('0xb'));var fs=require('fs');var _=require(_0xe0b0('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe0b0('0xd'));var deskjs=require(_0xe0b0('0xe'));var toCsv=require(_0xe0b0('0xa'));var querystring=require(_0xe0b0('0xf'));var Papa=require('papaparse');var Redis=require(_0xe0b0('0x10'));var authService=require(_0xe0b0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe0b0('0x12'));var hardwareService=require(_0xe0b0('0x13'));var logger=require('../../config/logger')(_0xe0b0('0x14'));var utils=require(_0xe0b0('0x15'));var config=require(_0xe0b0('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3068c0,_0x1c358a){_0x1c358a=_0x1c358a||0xcc;return function(_0x3cc19a){if(_0x3cc19a){return _0x3068c0[_0xe0b0('0x17')](_0x1c358a);}return _0x3068c0[_0xe0b0('0x18')](_0x1c358a)['end']();};}function respondWithResult(_0x3782be,_0x154de6){_0x154de6=_0x154de6||0xc8;return function(_0x743318){if(_0x743318){return _0x3782be[_0xe0b0('0x18')](_0x154de6)[_0xe0b0('0x19')](_0x743318);}};}function respondWithFilteredResult(_0x55d884,_0x41a7e2){return function(_0x5adb01){if(_0x5adb01){var _0x35cb40=_0x5adb01['count'],_0xadee6e=_0x41a7e2[_0xe0b0('0x1a')],_0x519ae8=_0x41a7e2[_0xe0b0('0x1a')]+_0x41a7e2['limit'],_0x11fdca;if(_0x519ae8>=_0x35cb40){_0x519ae8=_0x35cb40;_0x11fdca=0xc8;}else{_0x11fdca=0xce;}_0x55d884['status'](_0x11fdca);return _0x55d884[_0xe0b0('0x1b')]('Content-Range',_0xadee6e+'-'+_0x519ae8+'/'+_0x35cb40)['json'](_0x5adb01);}return null;};}function patchUpdates(_0x4bce65){return function(_0x1920ee){try{jsonpatch['apply'](_0x1920ee,_0x4bce65,!![]);}catch(_0x52598b){return BPromise[_0xe0b0('0x1c')](_0x52598b);}return _0x1920ee['save']();};}function saveUpdates(_0x472286,_0x5dba2f){return function(_0x2c84cc){if(_0x2c84cc){return _0x2c84cc[_0xe0b0('0x1d')](_0x472286)[_0xe0b0('0x1e')](function(_0x310a6d){return _0x310a6d;});}return null;};}function removeEntity(_0x2cf6a1,_0x58b804){return function(_0x4cae54){if(_0x4cae54){return _0x4cae54[_0xe0b0('0x1f')]()['then'](function(){_0x2cf6a1[_0xe0b0('0x18')](0xcc)[_0xe0b0('0x20')]();});}};}function handleEntityNotFound(_0x513e63,_0x170ad8){return function(_0x503883){if(!_0x503883){_0x513e63[_0xe0b0('0x17')](0x194);}return _0x503883;};}function handleError(_0x49a727,_0x28586d){_0x28586d=_0x28586d||0x1f4;return function(_0x576352){logger[_0xe0b0('0x21')](_0x576352['stack']);if(_0x576352[_0xe0b0('0x22')]){delete _0x576352['name'];}_0x49a727[_0xe0b0('0x18')](_0x28586d)['send'](_0x576352);};}exports[_0xe0b0('0x23')]=function(_0x3c3bc2,_0x1f1ebd){var _0x1d91ad={},_0x3ec2={},_0x10745d={'count':0x0,'rows':[]};var _0x5200a6=_[_0xe0b0('0x24')](db[_0xe0b0('0x25')]['rawAttributes'],function(_0x15e13b){return{'name':_0x15e13b[_0xe0b0('0x26')],'type':_0x15e13b[_0xe0b0('0x27')][_0xe0b0('0x28')]};});_0x3ec2[_0xe0b0('0x29')]=_[_0xe0b0('0x24')](_0x5200a6,_0xe0b0('0x22'));_0x3ec2['query']=_[_0xe0b0('0x2a')](_0x3c3bc2[_0xe0b0('0x2b')]);_0x3ec2['filters']=_['intersection'](_0x3ec2[_0xe0b0('0x29')],_0x3ec2[_0xe0b0('0x2b')]);_0x1d91ad[_0xe0b0('0x2c')]=_[_0xe0b0('0x2d')](_0x3ec2[_0xe0b0('0x29')],qs['fields'](_0x3c3bc2[_0xe0b0('0x2b')][_0xe0b0('0x2e')]));_0x1d91ad[_0xe0b0('0x2c')]=_0x1d91ad[_0xe0b0('0x2c')][_0xe0b0('0x2f')]?_0x1d91ad['attributes']:_0x3ec2[_0xe0b0('0x29')];if(!_0x3c3bc2[_0xe0b0('0x2b')][_0xe0b0('0x30')](_0xe0b0('0x31'))){_0x1d91ad[_0xe0b0('0x32')]=qs[_0xe0b0('0x32')](_0x3c3bc2[_0xe0b0('0x2b')][_0xe0b0('0x32')]);_0x1d91ad[_0xe0b0('0x1a')]=qs[_0xe0b0('0x1a')](_0x3c3bc2[_0xe0b0('0x2b')][_0xe0b0('0x1a')]);}_0x1d91ad[_0xe0b0('0x33')]=qs[_0xe0b0('0x34')](_0x3c3bc2[_0xe0b0('0x2b')]['sort']);_0x1d91ad[_0xe0b0('0x35')]=qs[_0xe0b0('0x36')](_[_0xe0b0('0x37')](_0x3c3bc2[_0xe0b0('0x2b')],_0x3ec2[_0xe0b0('0x36')]));if(_0x3c3bc2[_0xe0b0('0x2b')][_0xe0b0('0x38')]){_0x1d91ad['where']=_['merge'](_0x1d91ad['where'],{'$or':_['map'](_0x5200a6,function(_0x26137c){if(_0x26137c[_0xe0b0('0x27')]!==_0xe0b0('0x39')){var _0x4e4b20={};_0x4e4b20[_0x26137c[_0xe0b0('0x22')]]={'$like':'%'+_0x3c3bc2[_0xe0b0('0x2b')][_0xe0b0('0x38')]+'%'};return _0x4e4b20;}})});}_0x1d91ad=_[_0xe0b0('0x3a')]({},_0x1d91ad,_0x3c3bc2['options']);var _0xed3226={'where':_0x1d91ad[_0xe0b0('0x35')]};return db[_0xe0b0('0x25')][_0xe0b0('0x3b')](_0xed3226)[_0xe0b0('0x1e')](function(_0x1205db){_0x10745d[_0xe0b0('0x3b')]=_0x1205db;if(_0x3c3bc2[_0xe0b0('0x2b')][_0xe0b0('0x3c')]){_0x1d91ad['include']=[{'all':!![]}];}return db[_0xe0b0('0x25')]['findAll'](_0x1d91ad);})[_0xe0b0('0x1e')](function(_0x2d5f47){_0x10745d[_0xe0b0('0x3d')]=_0x2d5f47;return _0x10745d;})[_0xe0b0('0x1e')](respondWithFilteredResult(_0x1f1ebd,_0x1d91ad))['catch'](handleError(_0x1f1ebd,null));};exports[_0xe0b0('0x3e')]=function(_0x41adcb,_0x33706d){var _0x402a0e={'raw':!![],'where':{'id':_0x41adcb[_0xe0b0('0x3f')]['id']}},_0x19c80e={};_0x19c80e[_0xe0b0('0x29')]=_[_0xe0b0('0x2a')](db['SalesforceField'][_0xe0b0('0x40')]);_0x19c80e[_0xe0b0('0x2b')]=_['keys'](_0x41adcb['query']);_0x19c80e[_0xe0b0('0x36')]=_[_0xe0b0('0x2d')](_0x19c80e['model'],_0x19c80e[_0xe0b0('0x2b')]);_0x402a0e[_0xe0b0('0x2c')]=_[_0xe0b0('0x2d')](_0x19c80e[_0xe0b0('0x29')],qs[_0xe0b0('0x2e')](_0x41adcb['query']['fields']));_0x402a0e['attributes']=_0x402a0e[_0xe0b0('0x2c')][_0xe0b0('0x2f')]?_0x402a0e['attributes']:_0x19c80e[_0xe0b0('0x29')];if(_0x41adcb[_0xe0b0('0x2b')][_0xe0b0('0x3c')]){_0x402a0e[_0xe0b0('0x41')]=[{'all':!![]}];}_0x402a0e=_[_0xe0b0('0x3a')]({},_0x402a0e,_0x41adcb['options']);return db['SalesforceField'][_0xe0b0('0x42')](_0x402a0e)[_0xe0b0('0x1e')](handleEntityNotFound(_0x33706d,null))[_0xe0b0('0x1e')](respondWithResult(_0x33706d,null))[_0xe0b0('0x43')](handleError(_0x33706d,null));};exports[_0xe0b0('0x44')]=function(_0x575c7d,_0x3b1474){return db[_0xe0b0('0x25')]['create'](_0x575c7d['body'],{})['then'](respondWithResult(_0x3b1474,0xc9))[_0xe0b0('0x43')](handleError(_0x3b1474,null));};exports[_0xe0b0('0x1d')]=function(_0x2419ce,_0x364877){if(_0x2419ce['body']['id']){delete _0x2419ce[_0xe0b0('0x45')]['id'];}return db[_0xe0b0('0x25')]['find']({'where':{'id':_0x2419ce['params']['id']}})[_0xe0b0('0x1e')](handleEntityNotFound(_0x364877,null))[_0xe0b0('0x1e')](saveUpdates(_0x2419ce['body'],null))[_0xe0b0('0x1e')](respondWithResult(_0x364877,null))[_0xe0b0('0x43')](handleError(_0x364877,null));};exports['destroy']=function(_0x5cb2b6,_0x123ad2){return db['SalesforceField'][_0xe0b0('0x42')]({'where':{'id':_0x5cb2b6[_0xe0b0('0x3f')]['id']}})[_0xe0b0('0x1e')](handleEntityNotFound(_0x123ad2,null))[_0xe0b0('0x1e')](removeEntity(_0x123ad2,null))[_0xe0b0('0x43')](handleError(_0x123ad2,null));}; \ No newline at end of file +var _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','SalesforceField','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(_0x1cd8cd,_0x3ea8c5){var _0x371520=function(_0x536251){while(--_0x536251){_0x1cd8cd['push'](_0x1cd8cd['shift']());}};_0x371520(++_0x3ea8c5);}(_0x5f2f,0x73));var _0xf5f2=function(_0x34b544,_0x383d8e){_0x34b544=_0x34b544-0x0;var _0x321b90=_0x5f2f[_0x34b544];return _0x321b90;};'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['SalesforceField']['rawAttributes'],function(_0x22c826){return{'name':_0x22c826[_0xf5f2('0x2b')],'type':_0x22c826[_0xf5f2('0x2c')]['key']};});_0x375ca8['model']=_[_0xf5f2('0x2a')](_0x198c73,_0xf5f2('0x27'));_0x375ca8[_0xf5f2('0x2d')]=_[_0xf5f2('0x2e')](_0x4ab014[_0xf5f2('0x2d')]);_0x375ca8['filters']=_['intersection'](_0x375ca8[_0xf5f2('0x2f')],_0x375ca8['query']);_0x102449[_0xf5f2('0x30')]=_['intersection'](_0x375ca8[_0xf5f2('0x2f')],qs[_0xf5f2('0x31')](_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x31')]));_0x102449[_0xf5f2('0x30')]=_0x102449[_0xf5f2('0x30')][_0xf5f2('0x32')]?_0x102449[_0xf5f2('0x30')]:_0x375ca8['model'];if(!_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x33')](_0xf5f2('0x34'))){_0x102449[_0xf5f2('0x1c')]=qs[_0xf5f2('0x1c')](_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x1c')]);_0x102449['offset']=qs[_0xf5f2('0x1b')](_0x4ab014[_0xf5f2('0x2d')]['offset']);}_0x102449[_0xf5f2('0x35')]=qs['sort'](_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x36')]);_0x102449[_0xf5f2('0x37')]=qs[_0xf5f2('0x38')](_['pick'](_0x4ab014['query'],_0x375ca8[_0xf5f2('0x38')]));if(_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x39')]){_0x102449['where']=_[_0xf5f2('0x3a')](_0x102449['where'],{'$or':_[_0xf5f2('0x2a')](_0x198c73,function(_0x566c47){if(_0x566c47[_0xf5f2('0x2c')]!==_0xf5f2('0x3b')){var _0x5337a6={};_0x5337a6[_0x566c47[_0xf5f2('0x27')]]={'$like':'%'+_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x39')]+'%'};return _0x5337a6;}})});}_0x102449=_[_0xf5f2('0x3a')]({},_0x102449,_0x4ab014['options']);var _0x5d2d82={'where':_0x102449[_0xf5f2('0x37')]};return db[_0xf5f2('0x3c')][_0xf5f2('0x1a')](_0x5d2d82)[_0xf5f2('0x3d')](function(_0x2c7f65){_0x31bfcb[_0xf5f2('0x1a')]=_0x2c7f65;if(_0x4ab014[_0xf5f2('0x2d')]['includeAll']){_0x102449[_0xf5f2('0x3e')]=[{'all':!![]}];}return db[_0xf5f2('0x3c')]['findAll'](_0x102449);})[_0xf5f2('0x3d')](function(_0x3f3895){_0x31bfcb[_0xf5f2('0x3f')]=_0x3f3895;return _0x31bfcb;})[_0xf5f2('0x3d')](respondWithFilteredResult(_0xaa2602,_0x102449))[_0xf5f2('0x40')](handleError(_0xaa2602,null));};exports[_0xf5f2('0x41')]=function(_0x462ea3,_0x2083b3){var _0x574f24={'raw':!![],'where':{'id':_0x462ea3[_0xf5f2('0x42')]['id']}},_0x31c3c={};_0x31c3c[_0xf5f2('0x2f')]=_['keys'](db['SalesforceField']['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));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 9b8fe16..8d3fd74 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 _0xe79c=['../../config/environment','./intSalesforceField.attributes','define','SalesforceField','salesforce_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x441327,_0x5c7115){var _0x342d43=function(_0x1db8a2){while(--_0x1db8a2){_0x441327['push'](_0x441327['shift']());}};_0x342d43(++_0x5c7115);}(_0xe79c,0x106));var _0xce79=function(_0x4ffc6b,_0x18313e){_0x4ffc6b=_0x4ffc6b-0x0;var _0x2479b3=_0xe79c[_0x4ffc6b];return _0x2479b3;};'use strict';var _=require(_0xce79('0x0'));var util=require(_0xce79('0x1'));var logger=require(_0xce79('0x2'))(_0xce79('0x3'));var moment=require(_0xce79('0x4'));var BPromise=require(_0xce79('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xce79('0x6'));var rimraf=require(_0xce79('0x7'));var config=require(_0xce79('0x8'));var attributes=require(_0xce79('0x9'));module['exports']=function(_0x1f9d9b,_0x3ce3af){return _0x1f9d9b[_0xce79('0xa')](_0xce79('0xb'),attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':_0xce79('0xc'),'fields':[_0xce79('0xd'),_0xce79('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9e04=['define','SalesforceField','int_salesforce_fields','FieldId','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./intSalesforceField.attributes','exports'];(function(_0x5037ab,_0x43209e){var _0x512adb=function(_0x261783){while(--_0x261783){_0x5037ab['push'](_0x5037ab['shift']());}};_0x512adb(++_0x43209e);}(_0x9e04,0x9e));var _0x49e0=function(_0x546446,_0x548f0d){_0x546446=_0x546446-0x0;var _0x10b05a=_0x9e04[_0x546446];return _0x10b05a;};'use strict';var _=require(_0x49e0('0x0'));var util=require(_0x49e0('0x1'));var logger=require('../../config/logger')(_0x49e0('0x2'));var moment=require(_0x49e0('0x3'));var BPromise=require(_0x49e0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x49e0('0x5'));var rimraf=require(_0x49e0('0x6'));var config=require(_0x49e0('0x7'));var attributes=require(_0x49e0('0x8'));module[_0x49e0('0x9')]=function(_0x1a00ba,_0x3c9ced){return _0x1a00ba[_0x49e0('0xa')](_0x49e0('0xb'),attributes,{'tableName':_0x49e0('0xc'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':['idField',_0x49e0('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.rpc.js b/server/api/intSalesforceField/intSalesforceField.rpc.js index 045ac74..24d8d06 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 _0xf4eb=['SalesforceField,\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(_0x4660b2,_0x17c4d4){var _0xa5e3aa=function(_0x4eda5f){while(--_0x4eda5f){_0x4660b2['push'](_0x4660b2['shift']());}};_0xa5e3aa(++_0x17c4d4);}(_0xf4eb,0xec));var _0xbf4e=function(_0xd291fb,_0xf92998){_0xd291fb=_0xd291fb-0x0;var _0x563780=_0xf4eb[_0xd291fb];return _0x563780;};'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')]('SalesforceField,\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')]('SalesforceField,\x20%s,\x20%s',_0x540736,_0x912fc0);_0x5e23d4(_0x912fc0);});});} \ No newline at end of file +var _0xe5b5=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','SalesforceField,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x4b9dc9,_0x14b3a2){var _0x57b302=function(_0x4f99ff){while(--_0x4f99ff){_0x4b9dc9['push'](_0x4b9dc9['shift']());}};_0x57b302(++_0x14b3a2);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xe5b5[_0x297fd3];return _0x2af381;};'use strict';var _=require(_0x5e5b('0x0'));var util=require(_0x5e5b('0x1'));var moment=require(_0x5e5b('0x2'));var BPromise=require(_0x5e5b('0x3'));var rs=require(_0x5e5b('0x4'));var fs=require('fs');var Redis=require(_0x5e5b('0x5'));var db=require(_0x5e5b('0x6'))['db'];var utils=require(_0x5e5b('0x7'));var logger=require(_0x5e5b('0x8'))(_0x5e5b('0x9'));var config=require(_0x5e5b('0xa'));var jayson=require(_0x5e5b('0xb'));var client=jayson[_0x5e5b('0xc')][_0x5e5b('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x545eb3,_0x29db2c,_0xe089b1){return new BPromise(function(_0xcbd478,_0x258414){return client[_0x5e5b('0xe')](_0x545eb3,_0xe089b1)[_0x5e5b('0xf')](function(_0x3a37db){logger[_0x5e5b('0x10')]('SalesforceField,\x20%s,\x20%s',_0x29db2c,_0x5e5b('0x11'));logger['debug'](_0x5e5b('0x12'),_0x29db2c,_0x5e5b('0x11'),JSON[_0x5e5b('0x13')](_0x3a37db));if(_0x3a37db[_0x5e5b('0x14')]){if(_0x3a37db['error']['code']===0x1f4){logger['error'](_0x5e5b('0x15'),_0x29db2c,_0x3a37db[_0x5e5b('0x14')][_0x5e5b('0x16')]);return _0x258414(_0x3a37db[_0x5e5b('0x14')][_0x5e5b('0x16')]);}logger[_0x5e5b('0x14')](_0x5e5b('0x15'),_0x29db2c,_0x3a37db['error'][_0x5e5b('0x16')]);return _0xcbd478(_0x3a37db[_0x5e5b('0x14')]['message']);}else{logger[_0x5e5b('0x10')]('SalesforceField,\x20%s,\x20%s',_0x29db2c,'request\x20sent');_0xcbd478(_0x3a37db[_0x5e5b('0x17')][_0x5e5b('0x16')]);}})[_0x5e5b('0x18')](function(_0x5c7148){logger[_0x5e5b('0x14')]('SalesforceField,\x20%s,\x20%s',_0x29db2c,_0x5c7148);_0x258414(_0x5c7148);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index e87743f..c357133 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 _0xed1f=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','post','create','addConfiguration','put','exports','multer','util','path','connect-timeout'];(function(_0x1fb1c1,_0x4ebe69){var _0x1622df=function(_0x52b793){while(--_0x52b793){_0x1fb1c1['push'](_0x1fb1c1['shift']());}};_0x1622df(++_0x4ebe69);}(_0xed1f,0x6a));var _0xfed1=function(_0x19b3f9,_0xade753){_0x19b3f9=_0x19b3f9-0x0;var _0x18c3f6=_0xed1f[_0x19b3f9];return _0x18c3f6;};'use strict';var multer=require(_0xfed1('0x0'));var util=require(_0xfed1('0x1'));var path=require(_0xfed1('0x2'));var timeout=require(_0xfed1('0x3'));var express=require(_0xfed1('0x4'));var router=express[_0xfed1('0x5')]();var auth=require(_0xfed1('0x6'));var interaction=require(_0xfed1('0x7'));var config=require(_0xfed1('0x8'));var controller=require(_0xfed1('0x9'));router[_0xfed1('0xa')]('/',auth[_0xfed1('0xb')](),controller[_0xfed1('0xc')]);router[_0xfed1('0xa')](_0xfed1('0xd'),auth[_0xfed1('0xb')](),controller[_0xfed1('0xe')]);router[_0xfed1('0xa')]('/:id/configurations',auth[_0xfed1('0xb')](),controller[_0xfed1('0xf')]);router['get'](_0xfed1('0x10'),auth[_0xfed1('0xb')](),controller['getFields']);router[_0xfed1('0x11')]('/',auth['isAuthenticated'](),controller[_0xfed1('0x12')]);router[_0xfed1('0x11')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xfed1('0x13')]);router[_0xfed1('0x14')]('/:id',auth[_0xfed1('0xb')](),controller['update']);router['delete'](_0xfed1('0xd'),auth[_0xfed1('0xb')](),controller['destroy']);module[_0xfed1('0x15')]=router; \ No newline at end of file +var _0xc8fd=['./intServicenowAccount.controller','isAuthenticated','index','/:id','show','get','/:id/configurations','getConfigurations','post','addConfiguration','put','update','delete','exports','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xb8fd40,_0x23030a){var _0x46fcde=function(_0x1a22ff){while(--_0x1a22ff){_0xb8fd40['push'](_0xb8fd40['shift']());}};_0x46fcde(++_0x23030a);}(_0xc8fd,0x162));var _0xdc8f=function(_0x31aeb0,_0x3419ea){_0x31aeb0=_0x31aeb0-0x0;var _0x4f6c4b=_0xc8fd[_0x31aeb0];return _0x4f6c4b;};'use strict';var multer=require('multer');var util=require(_0xdc8f('0x0'));var path=require(_0xdc8f('0x1'));var timeout=require('connect-timeout');var express=require(_0xdc8f('0x2'));var router=express['Router']();var auth=require(_0xdc8f('0x3'));var interaction=require(_0xdc8f('0x4'));var config=require(_0xdc8f('0x5'));var controller=require(_0xdc8f('0x6'));router['get']('/',auth[_0xdc8f('0x7')](),controller[_0xdc8f('0x8')]);router['get'](_0xdc8f('0x9'),auth['isAuthenticated'](),controller[_0xdc8f('0xa')]);router[_0xdc8f('0xb')](_0xdc8f('0xc'),auth[_0xdc8f('0x7')](),controller[_0xdc8f('0xd')]);router[_0xdc8f('0xb')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xdc8f('0xe')](_0xdc8f('0xc'),auth[_0xdc8f('0x7')](),controller[_0xdc8f('0xf')]);router[_0xdc8f('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xdc8f('0x11')]);router[_0xdc8f('0x12')](_0xdc8f('0x9'),auth[_0xdc8f('0x7')](),controller['destroy']);module[_0xdc8f('0x13')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index cbbf2ac..7c54b19 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 _0x8481=['exports','STRING','remoteUri','sequelize'];(function(_0x2ceefd,_0x2148f9){var _0x5e2706=function(_0xa5c820){while(--_0xa5c820){_0x2ceefd['push'](_0x2ceefd['shift']());}};_0x5e2706(++_0x2148f9);}(_0x8481,0x1bf));var _0x1848=function(_0xadde88,_0x58ad47){_0xadde88=_0xadde88-0x0;var _0x3b8eb6=_0x8481[_0xadde88];return _0x3b8eb6;};'use strict';var Sequelize=require(_0x1848('0x0'));module[_0x1848('0x1')]={'name':{'type':Sequelize[_0x1848('0x2')]},'description':{'type':Sequelize[_0x1848('0x2')]},'username':{'type':Sequelize[_0x1848('0x2')],'unique':'username'},'password':{'type':Sequelize[_0x1848('0x2')]},'email':{'type':Sequelize[_0x1848('0x2')]},'remoteUri':{'type':Sequelize[_0x1848('0x2')],'unique':_0x1848('0x3')},'serverUrl':{'type':Sequelize[_0x1848('0x2')]}}; \ No newline at end of file +var _0x5343=['STRING','username','remoteUri','exports'];(function(_0x6a9557,_0x163211){var _0x636c36=function(_0x15ff46){while(--_0x15ff46){_0x6a9557['push'](_0x6a9557['shift']());}};_0x636c36(++_0x163211);}(_0x5343,0x14f));var _0x3534=function(_0x4a79df,_0x122d88){_0x4a79df=_0x4a79df-0x0;var _0xb8eec9=_0x5343[_0x4a79df];return _0xb8eec9;};'use strict';var Sequelize=require('sequelize');module[_0x3534('0x0')]={'name':{'type':Sequelize[_0x3534('0x1')]},'description':{'type':Sequelize[_0x3534('0x1')]},'username':{'type':Sequelize[_0x3534('0x1')],'unique':_0x3534('0x2')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x3534('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x3534('0x3')},'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 e567a16..7e19ca5 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 _0xe538=['problem_id','reassignment_count','assigned_to','severity','comments','sla_due','approval','due_date','sys_mod_count','upon_approval','correlation_id','location','username','remoteUri','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','password','GET','incident?sysparm_display_value=all','result','log','assign','remove','internalType','push','TCL:\x20_object','includes','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','forEach','label','all','ServiceNow\x20error:\x20','Wrong\x20credentials','statusCode','boolean','True','true','false','inactive','value','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','ejs','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','count','offset','set','Content-Range','apply','save','update','destroy','stack','name','send','map','ServicenowAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','length','limit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','show','params','keys','fields','create','body','find','getConfigurations','findOne','ServicenowConfiguration','hasOwnProperty','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','getFields','made_sla','hold_reason','knowledge','subcategory','notify','incident_state','category','parent','sys_updated_on','approval_history','number','resolved_by','sys_updated_by','opened_by','sys_created_on','sys_domain','state','closed_at','cmdb_ci','delivery_plan','impact','active','priority','sys_domain_path','time_worked','group_list','reopened_time','resolved_at','caller_id','approval_set','work_notes','correlation_display','work_start','assignment_group','business_stc','description','calendar_duration','sys_class_name','close_notes','closed_by','contact_type','reopened_by','urgency'];(function(_0x571431,_0x548636){var _0x3e7682=function(_0x5209f9){while(--_0x5209f9){_0x571431['push'](_0x571431['shift']());}};_0x3e7682(++_0x548636);}(_0xe538,0xe6));var _0x8e53=function(_0xeb0035,_0x2c3d9a){_0xeb0035=_0xeb0035-0x0;var _0x190e57=_0xe538[_0xeb0035];return _0x190e57;};'use strict';var pdf=require(_0x8e53('0x0'));var emlformat=require(_0x8e53('0x1'));var rimraf=require(_0x8e53('0x2'));var zipdir=require(_0x8e53('0x3'));var jsonpatch=require(_0x8e53('0x4'));var rp=require('request-promise');var moment=require(_0x8e53('0x5'));var BPromise=require(_0x8e53('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x8e53('0x7'));var sox=require(_0x8e53('0x8'));var csv=require('to-csv');var ejs=require(_0x8e53('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x8e53('0xa'));var crypto=require(_0x8e53('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x8e53('0xc'));var toCsv=require(_0x8e53('0xd'));var querystring=require(_0x8e53('0xe'));var Papa=require(_0x8e53('0xf'));var Redis=require(_0x8e53('0x10'));var authService=require(_0x8e53('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x8e53('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8e53('0x13'));var utils=require(_0x8e53('0x14'));var config=require(_0x8e53('0x15'));var db=require(_0x8e53('0x16'))['db'];var integrations=require(_0x8e53('0x17'));var jayson=require('jayson/promise');var client=jayson[_0x8e53('0x18')][_0x8e53('0x19')]({'port':0x232a});function checkPasswordPattern(_0x22f8ad,_0x826abf,_0x3a00e5){if(_0x3a00e5){var _0x4500d3=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4500d3[_0x8e53('0x1a')](_0x826abf)){return _0x22f8ad;}else{throw new db[(_0x8e53('0x1b'))][(_0x8e53('0x1c'))](_0x8e53('0x1d'));}}else{return _0x22f8ad;}}function respondWithRpcPromise(_0x3ac14a,_0x1cb5ef,_0x2170da,_0x1cd808){return new BPromise(function(_0x5429ef,_0x1efbd3){var _0xd31567=_0x1cd808||client;return _0xd31567[_0x8e53('0x1e')](_0x3ac14a,_0x2170da)[_0x8e53('0x1f')](function(_0x3e0bea){logger[_0x8e53('0x20')](_0x8e53('0x21'),_0x1cb5ef,_0x8e53('0x22'));logger['debug'](_0x8e53('0x23'),_0x1cb5ef,_0x8e53('0x22'),JSON[_0x8e53('0x24')](_0x3e0bea));if(_0x3e0bea['error']){if(_0x3e0bea[_0x8e53('0x25')][_0x8e53('0x26')]===0x1f4){logger[_0x8e53('0x25')]('ServicenowAccount,\x20%s,\x20%s',_0x1cb5ef,_0x3e0bea[_0x8e53('0x25')][_0x8e53('0x27')]);return _0x1efbd3(_0x3e0bea[_0x8e53('0x25')][_0x8e53('0x27')]);}logger['error'](_0x8e53('0x21'),_0x1cb5ef,_0x3e0bea[_0x8e53('0x25')][_0x8e53('0x27')]);return _0x5429ef(_0x3e0bea['error'][_0x8e53('0x27')]);}else{logger[_0x8e53('0x20')]('ServicenowAccount,\x20%s,\x20%s',_0x1cb5ef,_0x8e53('0x22'));_0x5429ef(_0x3e0bea['result']['message']);}})[_0x8e53('0x28')](function(_0x12a4f2){logger['error'](_0x8e53('0x21'),_0x1cb5ef,_0x12a4f2);_0x1efbd3(_0x12a4f2);});});}function respondWithStatusCode(_0x41d534,_0x36be62){_0x36be62=_0x36be62||0xcc;return function(_0xbdc7ea){if(_0xbdc7ea){return _0x41d534[_0x8e53('0x29')](_0x36be62);}return _0x41d534[_0x8e53('0x2a')](_0x36be62)[_0x8e53('0x2b')]();};}function respondWithResult(_0x57c29d,_0x1cd354){_0x1cd354=_0x1cd354||0xc8;return function(_0x132047){if(_0x132047){return _0x57c29d[_0x8e53('0x2a')](_0x1cd354)[_0x8e53('0x2c')](_0x132047);}};}function respondWithFilteredResult(_0x5e509c,_0x1256ff){return function(_0x494ba8){if(_0x494ba8){var _0xe3c126=_0x494ba8[_0x8e53('0x2d')],_0x39a485=_0x1256ff[_0x8e53('0x2e')],_0x3b3219=_0x1256ff[_0x8e53('0x2e')]+_0x1256ff['limit'],_0x4be2dd;if(_0x3b3219>=_0xe3c126){_0x3b3219=_0xe3c126;_0x4be2dd=0xc8;}else{_0x4be2dd=0xce;}_0x5e509c[_0x8e53('0x2a')](_0x4be2dd);return _0x5e509c[_0x8e53('0x2f')](_0x8e53('0x30'),_0x39a485+'-'+_0x3b3219+'/'+_0xe3c126)['json'](_0x494ba8);}return null;};}function patchUpdates(_0x2f8369){return function(_0x252a0b){try{jsonpatch[_0x8e53('0x31')](_0x252a0b,_0x2f8369,!![]);}catch(_0xe48dd1){return BPromise['reject'](_0xe48dd1);}return _0x252a0b[_0x8e53('0x32')]();};}function saveUpdates(_0x481a1b,_0x463ae5){return function(_0x5657e5){if(_0x5657e5){return _0x5657e5[_0x8e53('0x33')](_0x481a1b)[_0x8e53('0x1f')](function(_0x44cc66){return _0x44cc66;});}return null;};}function removeEntity(_0x1f0a00,_0x3bc25f){return function(_0x25f6f8){if(_0x25f6f8){return _0x25f6f8[_0x8e53('0x34')]()[_0x8e53('0x1f')](function(){_0x1f0a00[_0x8e53('0x2a')](0xcc)[_0x8e53('0x2b')]();});}};}function handleEntityNotFound(_0x538bd0,_0x510396){return function(_0x489528){if(!_0x489528){_0x538bd0[_0x8e53('0x29')](0x194);}return _0x489528;};}function handleError(_0x5f51e5,_0x58f310){_0x58f310=_0x58f310||0x1f4;return function(_0x1271ab){logger[_0x8e53('0x25')](_0x1271ab[_0x8e53('0x35')]);if(_0x1271ab['name']){delete _0x1271ab[_0x8e53('0x36')];}_0x5f51e5[_0x8e53('0x2a')](_0x58f310)[_0x8e53('0x37')](_0x1271ab);};}exports['index']=function(_0x15384d,_0x4a3096){var _0xbd0670={},_0x193a58={},_0x1a2718={'count':0x0,'rows':[]};var _0x26eeee=_[_0x8e53('0x38')](db[_0x8e53('0x39')][_0x8e53('0x3a')],function(_0x2e3ad7){return{'name':_0x2e3ad7[_0x8e53('0x3b')],'type':_0x2e3ad7[_0x8e53('0x3c')][_0x8e53('0x3d')]};});_0x193a58[_0x8e53('0x3e')]=_['map'](_0x26eeee,_0x8e53('0x36'));_0x193a58[_0x8e53('0x3f')]=_['keys'](_0x15384d[_0x8e53('0x3f')]);_0x193a58[_0x8e53('0x40')]=_[_0x8e53('0x41')](_0x193a58[_0x8e53('0x3e')],_0x193a58[_0x8e53('0x3f')]);_0xbd0670[_0x8e53('0x42')]=_[_0x8e53('0x41')](_0x193a58[_0x8e53('0x3e')],qs['fields'](_0x15384d[_0x8e53('0x3f')]['fields']));_0xbd0670['attributes']=_0xbd0670['attributes'][_0x8e53('0x43')]?_0xbd0670[_0x8e53('0x42')]:_0x193a58[_0x8e53('0x3e')];if(!_0x15384d[_0x8e53('0x3f')]['hasOwnProperty']('nolimit')){_0xbd0670[_0x8e53('0x44')]=qs[_0x8e53('0x44')](_0x15384d[_0x8e53('0x3f')][_0x8e53('0x44')]);_0xbd0670[_0x8e53('0x2e')]=qs[_0x8e53('0x2e')](_0x15384d[_0x8e53('0x3f')]['offset']);}_0xbd0670[_0x8e53('0x45')]=qs[_0x8e53('0x46')](_0x15384d[_0x8e53('0x3f')][_0x8e53('0x46')]);_0xbd0670[_0x8e53('0x47')]=qs[_0x8e53('0x40')](_[_0x8e53('0x48')](_0x15384d[_0x8e53('0x3f')],_0x193a58[_0x8e53('0x40')]));if(_0x15384d[_0x8e53('0x3f')]['filter']){_0xbd0670['where']=_[_0x8e53('0x49')](_0xbd0670[_0x8e53('0x47')],{'$or':_[_0x8e53('0x38')](_0x26eeee,function(_0x4c721a){if(_0x4c721a[_0x8e53('0x3c')]!==_0x8e53('0x4a')){var _0x53b6c3={};_0x53b6c3[_0x4c721a[_0x8e53('0x36')]]={'$like':'%'+_0x15384d['query'][_0x8e53('0x4b')]+'%'};return _0x53b6c3;}})});}_0xbd0670=_[_0x8e53('0x49')]({},_0xbd0670,_0x15384d[_0x8e53('0x4c')]);var _0x55c952={'where':_0xbd0670[_0x8e53('0x47')]};return db[_0x8e53('0x39')][_0x8e53('0x2d')](_0x55c952)['then'](function(_0x34feeb){_0x1a2718[_0x8e53('0x2d')]=_0x34feeb;if(_0x15384d[_0x8e53('0x3f')][_0x8e53('0x4d')]){_0xbd0670['include']=[{'all':!![]}];}return db[_0x8e53('0x39')][_0x8e53('0x4e')](_0xbd0670);})[_0x8e53('0x1f')](function(_0x2f240d){_0x1a2718[_0x8e53('0x4f')]=_0x2f240d;return _0x1a2718;})[_0x8e53('0x1f')](respondWithFilteredResult(_0x4a3096,_0xbd0670))[_0x8e53('0x28')](handleError(_0x4a3096,null));};exports[_0x8e53('0x50')]=function(_0x345c7e,_0x4e4263){var _0x71123b={'raw':![],'where':{'id':_0x345c7e[_0x8e53('0x51')]['id']}},_0x22d40b={};_0x22d40b[_0x8e53('0x3e')]=_[_0x8e53('0x52')](db['ServicenowAccount']['rawAttributes']);_0x22d40b['query']=_['keys'](_0x345c7e[_0x8e53('0x3f')]);_0x22d40b[_0x8e53('0x40')]=_[_0x8e53('0x41')](_0x22d40b['model'],_0x22d40b[_0x8e53('0x3f')]);_0x71123b[_0x8e53('0x42')]=_[_0x8e53('0x41')](_0x22d40b[_0x8e53('0x3e')],qs[_0x8e53('0x53')](_0x345c7e[_0x8e53('0x3f')]['fields']));_0x71123b[_0x8e53('0x42')]=_0x71123b[_0x8e53('0x42')][_0x8e53('0x43')]?_0x71123b[_0x8e53('0x42')]:_0x22d40b[_0x8e53('0x3e')];if(_0x345c7e[_0x8e53('0x3f')][_0x8e53('0x4d')]){_0x71123b['include']=[{'all':!![]}];}_0x71123b=_[_0x8e53('0x49')]({},_0x71123b,_0x345c7e[_0x8e53('0x4c')]);return db[_0x8e53('0x39')]['find'](_0x71123b)[_0x8e53('0x1f')](handleEntityNotFound(_0x4e4263,null))['then'](respondWithResult(_0x4e4263,null))[_0x8e53('0x28')](handleError(_0x4e4263,null));};exports[_0x8e53('0x54')]=function(_0x36dc15,_0x3cca75){return db[_0x8e53('0x39')]['create'](_0x36dc15[_0x8e53('0x55')],{})[_0x8e53('0x1f')](respondWithResult(_0x3cca75,0xc9))[_0x8e53('0x28')](handleError(_0x3cca75,null));};exports[_0x8e53('0x33')]=function(_0x1ba1f6,_0x5393ad){if(_0x1ba1f6[_0x8e53('0x55')]['id']){delete _0x1ba1f6[_0x8e53('0x55')]['id'];}return db['ServicenowAccount'][_0x8e53('0x56')]({'where':{'id':_0x1ba1f6['params']['id']}})[_0x8e53('0x1f')](handleEntityNotFound(_0x5393ad,null))['then'](saveUpdates(_0x1ba1f6[_0x8e53('0x55')],null))['then'](respondWithResult(_0x5393ad,null))[_0x8e53('0x28')](handleError(_0x5393ad,null));};exports[_0x8e53('0x34')]=function(_0x19c503,_0x224e08){return db[_0x8e53('0x39')]['find']({'where':{'id':_0x19c503[_0x8e53('0x51')]['id']}})[_0x8e53('0x1f')](handleEntityNotFound(_0x224e08,null))[_0x8e53('0x1f')](removeEntity(_0x224e08,null))['catch'](handleError(_0x224e08,null));};exports[_0x8e53('0x57')]=function(_0x37fbd4,_0x20a776,_0x4231dc){var _0x36b312={};var _0x318583={};var _0xb8bcf1;var _0x367b93;return db[_0x8e53('0x39')][_0x8e53('0x58')]({'where':{'id':_0x37fbd4[_0x8e53('0x51')]['id']}})[_0x8e53('0x1f')](handleEntityNotFound(_0x20a776,null))[_0x8e53('0x1f')](function(_0x554a18){if(_0x554a18){_0xb8bcf1=_0x554a18;_0x318583[_0x8e53('0x3e')]=_[_0x8e53('0x52')](db[_0x8e53('0x59')][_0x8e53('0x3a')]);_0x318583[_0x8e53('0x3f')]=_[_0x8e53('0x52')](_0x37fbd4[_0x8e53('0x3f')]);_0x318583[_0x8e53('0x40')]=_[_0x8e53('0x41')](_0x318583[_0x8e53('0x3e')],_0x318583[_0x8e53('0x3f')]);_0x36b312[_0x8e53('0x42')]=_[_0x8e53('0x41')](_0x318583['model'],qs[_0x8e53('0x53')](_0x37fbd4['query']['fields']));_0x36b312[_0x8e53('0x42')]=_0x36b312[_0x8e53('0x42')][_0x8e53('0x43')]?_0x36b312['attributes']:_0x318583[_0x8e53('0x3e')];_0x36b312[_0x8e53('0x45')]=qs[_0x8e53('0x46')](_0x37fbd4[_0x8e53('0x3f')][_0x8e53('0x46')]);_0x36b312[_0x8e53('0x47')]=qs[_0x8e53('0x40')](_[_0x8e53('0x48')](_0x37fbd4[_0x8e53('0x3f')],_0x318583[_0x8e53('0x40')]));if(_0x37fbd4[_0x8e53('0x3f')]['filter']){_0x36b312[_0x8e53('0x47')]=_['merge'](_0x36b312[_0x8e53('0x47')],{'$or':_[_0x8e53('0x38')](_0x36b312[_0x8e53('0x42')],function(_0x194fc5){var _0x47645a={};_0x47645a[_0x194fc5]={'$like':'%'+_0x37fbd4['query'][_0x8e53('0x4b')]+'%'};return _0x47645a;})});}_0x36b312=_['merge']({},_0x36b312,_0x37fbd4[_0x8e53('0x4c')]);return _0xb8bcf1[_0x8e53('0x57')](_0x36b312);}})[_0x8e53('0x1f')](function(_0x283b20){if(_0x283b20){_0x367b93=_0x283b20[_0x8e53('0x43')];if(!_0x37fbd4[_0x8e53('0x3f')][_0x8e53('0x5a')](_0x8e53('0x5b'))){_0x36b312[_0x8e53('0x44')]=qs['limit'](_0x37fbd4[_0x8e53('0x3f')]['limit']);_0x36b312[_0x8e53('0x2e')]=qs['offset'](_0x37fbd4['query']['offset']);}return _0xb8bcf1[_0x8e53('0x57')](_0x36b312);}})[_0x8e53('0x1f')](function(_0x48c1a5){if(_0x48c1a5){return _0x48c1a5?{'count':_0x367b93,'rows':_0x48c1a5}:null;}})[_0x8e53('0x1f')](respondWithResult(_0x20a776,null))[_0x8e53('0x28')](handleError(_0x20a776,null));};exports[_0x8e53('0x5c')]=function(_0x57036f,_0x2c79f8,_0x10edfa){if(_0x57036f[_0x8e53('0x55')]['id']){delete _0x57036f['body']['id'];}return db[_0x8e53('0x39')][_0x8e53('0x58')]({'where':{'id':_0x57036f[_0x8e53('0x51')]['id']}})[_0x8e53('0x1f')](handleEntityNotFound(_0x2c79f8,null))[_0x8e53('0x1f')](function(_0xaa188){if(_0xaa188){_0x57036f[_0x8e53('0x55')][_0x8e53('0x5d')]=_0xaa188['id'];_0x57036f[_0x8e53('0x55')][_0x8e53('0x5e')]=integrations[_0x8e53('0x5f')](_0x57036f[_0x8e53('0x55')][_0x8e53('0x60')],_0x57036f[_0x8e53('0x55')]['type']);_0x57036f['body'][_0x8e53('0x61')]=integrations[_0x8e53('0x62')](_0x57036f[_0x8e53('0x55')][_0x8e53('0x60')],_0x57036f[_0x8e53('0x55')][_0x8e53('0x3c')]);return db[_0x8e53('0x59')]['create'](_0x57036f[_0x8e53('0x55')],{'include':[{'model':db[_0x8e53('0x63')],'as':_0x8e53('0x5e')},{'model':db['ServicenowField'],'as':_0x8e53('0x61')}]});}return null;})[_0x8e53('0x1f')](respondWithResult(_0x2c79f8,null))[_0x8e53('0x28')](handleError(_0x2c79f8,null));};exports[_0x8e53('0x64')]=function(_0x5c7c89,_0x3c3cf7,_0x241fc7){var _0x36685a=[_0x8e53('0x65'),_0x8e53('0x66'),_0x8e53('0x67'),_0x8e53('0x68'),'close_code',_0x8e53('0x69'),_0x8e53('0x6a'),'severity',_0x8e53('0x6b')];var _0x36c69c=[_0x8e53('0x6c'),_0x8e53('0x65'),'caused_by','watch_list','upon_reject',_0x8e53('0x6d'),'child_incidents',_0x8e53('0x66'),_0x8e53('0x6e'),_0x8e53('0x6f'),_0x8e53('0x70'),_0x8e53('0x71'),_0x8e53('0x72'),'user_input',_0x8e53('0x73'),_0x8e53('0x74'),_0x8e53('0x75'),'sys_created_by','knowledge',_0x8e53('0x45'),'calendar_stc',_0x8e53('0x76'),_0x8e53('0x77'),_0x8e53('0x78'),_0x8e53('0x79'),_0x8e53('0x7a'),'work_notes_list','business_service',_0x8e53('0x7b'),_0x8e53('0x7c'),'rfc',_0x8e53('0x7d'),'expected_start','opened_at','business_duration',_0x8e53('0x7e'),'work_end',_0x8e53('0x7f'),_0x8e53('0x80'),_0x8e53('0x81'),_0x8e53('0x82'),_0x8e53('0x68'),_0x8e53('0x83'),'short_description','close_code',_0x8e53('0x84'),'delivery_task',_0x8e53('0x85'),_0x8e53('0x86'),_0x8e53('0x87'),'additional_assignee_list',_0x8e53('0x88'),_0x8e53('0x89'),_0x8e53('0x69'),_0x8e53('0x8a'),_0x8e53('0x8b'),_0x8e53('0x8c'),'follow_up','parent_incident','sys_id',_0x8e53('0x8d'),_0x8e53('0x8e'),_0x8e53('0x6a'),_0x8e53('0x8f'),_0x8e53('0x90'),'company',_0x8e53('0x91'),'activity_due',_0x8e53('0x92'),_0x8e53('0x93'),_0x8e53('0x94'),_0x8e53('0x95'),_0x8e53('0x96'),'comments_and_work_notes',_0x8e53('0x97'),_0x8e53('0x98'),'reopen_count','sys_tags','escalation',_0x8e53('0x99'),_0x8e53('0x9a'),_0x8e53('0x9b'),_0x8e53('0x6b')];var _0x198efe='';var _0xd46bae='';var _0x20c987=[];var _0x13fc9d='';var _0x62e353='';var _0xd34171=[];var _0x16215c='';var _0x6c1679='';var _0x21e9a0={};var _0xf8b0e9='';return db[_0x8e53('0x39')]['findOne']({'where':{'id':_0x5c7c89[_0x8e53('0x51')]['id']},'attributes':['id',_0x8e53('0x9c'),'password','email',_0x8e53('0x9d'),'serverUrl']})[_0x8e53('0x1f')](handleEntityNotFound(_0x3c3cf7,null))['then'](function(_0x2060a5){if(_0x2060a5){_0xf8b0e9=_0x2060a5['remoteUri'];var _0x47580e=_0xf8b0e9[_0x8e53('0x9e')](-0x1);if(_0x47580e==='/'){_0xf8b0e9=_0xf8b0e9[_0x8e53('0x9f')](0x0,_0xf8b0e9[_0x8e53('0xa0')](_0x47580e));}_0x6c1679=util[_0x8e53('0xa1')](_0x8e53('0xa2'),_0xf8b0e9);_0x16215c=util[_0x8e53('0xa1')]('%s/api/now/table/',_0xf8b0e9);_0x21e9a0={'user':_0x2060a5['username'],'pass':_0x2060a5[_0x8e53('0xa3')]};var _0x4ddda7={'method':_0x8e53('0xa4'),'uri':_0x6c1679+_0x8e53('0xa5'),'auth':_0x21e9a0,'json':!![]};return rp(_0x4ddda7);}})['then'](function(_0x4dca61){if(_0x4dca61[_0x8e53('0xa6')]['length']>0x0){_0x198efe=_0x4dca61[_0x8e53('0xa6')];}console[_0x8e53('0xa7')]('incident\x20table\x20objects',_0x198efe);_0xd34171=[];_0xd46bae=Object[_0x8e53('0xa8')]([],_0x198efe);_[_0x8e53('0xa9')](_0xd46bae,function(_0x100175){return!_0x36685a['includes'](_0x100175[_0x8e53('0x36')]);});_0xd46bae['forEach'](function(_0x2ce69c){var _0x48b962=createFieldObject(_0x16215c,_0x21e9a0,_0x2ce69c[_0x8e53('0xaa')],_0x2ce69c[_0x8e53('0x36')],_0x2ce69c['label'],![]);_0xd34171[_0x8e53('0xab')](_0x48b962);});return Promise['all'](_0xd34171);})[_0x8e53('0x1f')](function(_0x1aaa52){_0x20c987=_0x1aaa52;_0x13fc9d=Object[_0x8e53('0xa8')]([],_0x198efe);console[_0x8e53('0xa7')](_0x8e53('0xac'),_0x198efe);_[_0x8e53('0xa9')](_0x13fc9d,function(_0x140f9d){return _0x36c69c[_0x8e53('0xad')](_0x140f9d[_0x8e53('0x36')]);});console[_0x8e53('0xa7')](_0x8e53('0xae'),_0x13fc9d);_0xd34171=[];_0x13fc9d[_0x8e53('0xaf')](function(_0x3644be){var _0x201270=createFieldObject(_0x16215c,_0x21e9a0,_0x3644be[_0x8e53('0xaa')],_0x3644be[_0x8e53('0x36')],_0x3644be[_0x8e53('0xb0')],!![]);_0xd34171[_0x8e53('0xab')](_0x201270);});return Promise[_0x8e53('0xb1')](_0xd34171);})[_0x8e53('0x1f')](function(_0x4b91ad){_0x62e353=_0x4b91ad;var _0x5aed65=_0x20c987['concat'](_0x62e353);return{'count':_0x5aed65[_0x8e53('0x43')],'rows':_0x5aed65};})['then'](respondWithResult(_0x3c3cf7,null))[_0x8e53('0x28')](function(_0x3356d6){console['log'](_0x8e53('0xb2')+_0x3356d6);var _0x50c2c7=_0x5c7c89[_0x8e53('0x3f')][_0x8e53('0x1a')]?0x1f4:_0x3356d6['statusCode']||0x1f4;logger[_0x8e53('0x25')](_0x3356d6[_0x8e53('0x35')]);delete _0x3356d6[_0x8e53('0x36')];if(_0x50c2c7===0x191){_0x50c2c7=0x190;}_0x3c3cf7[_0x8e53('0x2a')](_0x50c2c7)['send'](_0x5c7c89[_0x8e53('0x3f')][_0x8e53('0x1a')]?{'message':_0x8e53('0xb3'),'statusCode':_0x3356d6[_0x8e53('0xb4')]}:_0x3356d6);});};function createFieldObject(_0x111414,_0x2a5408,_0x3ce352,_0x143b1c,_0x5d0483,_0x2a96fe){return new Promise(function(_0x1f0b85,_0x351e6f){var _0x38633c={'id':_0x143b1c,'name':_0x5d0483,'custom':_0x2a96fe};if(_0x3ce352===_0x8e53('0xb5')){_0x38633c['options']=[{'name':_0x8e53('0xb6'),'value':_0x8e53('0xb7')},{'name':'False','value':_0x8e53('0xb8')}];_0x1f0b85(_0x38633c);}else{var _0x25b45a={'method':_0x8e53('0xa4'),'uri':_0x111414+'sys_choice?sysparm_query=name=incident^element='+_0x143b1c,'auth':_0x2a5408,'json':!![]};return rp(_0x25b45a)[_0x8e53('0x1f')](function(_0x2d5ad7){var _0x31cb6f=[];if(_0x2d5ad7[_0x8e53('0xa6')][_0x8e53('0x43')]>0x0){_0x2d5ad7[_0x8e53('0xa6')][_0x8e53('0xaf')](function(_0x53023d){if(_0x53023d[_0x8e53('0xb9')]===_0x8e53('0xb8')){var _0x562dfe={'name':_0x53023d[_0x8e53('0xb0')],'value':_0x53023d[_0x8e53('0xba')]};_0x31cb6f['push'](_0x562dfe);}});}_0x38633c[_0x8e53('0x4c')]=_0x31cb6f;if(_0x38633c[_0x8e53('0x4c')][_0x8e53('0x43')]>0x0){_0x1f0b85(_0x38633c);}else{if(_0x2a96fe==![]){_0x1f0b85();}else{_0x1f0b85(_0x38633c);}}});}});} \ No newline at end of file +var _0x1daa=['info','result','catch','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','destroy','stack','name','map','ServicenowAccount','rawAttributes','fieldName','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','show','params','create','body','find','getConfigurations','findOne','ServicenowConfiguration','nolimit','addConfiguration','Subjects','channel','Descriptions','getDescriptions','ServicenowField','getFields','made_sla','hold_reason','knowledge','close_code','notify','incident_state','severity','category','parent','caused_by','watch_list','upon_reject','approval_history','number','resolved_by','sys_updated_by','opened_by','sys_domain','state','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','active','business_service','priority','rfc','time_worked','expected_start','opened_at','business_duration','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','subcategory','work_notes','short_description','correlation_display','delivery_task','assignment_group','business_stc','description','calendar_duration','sys_class_name','close_notes','follow_up','parent_incident','sys_id','reopened_by','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','comments','approval','comments_and_work_notes','due_date','reopen_count','sys_tags','escalation','upon_approval','correlation_id','location','username','password','serverUrl','remoteUri','slice','substring','%s/api/now/doc/table/schema/','format','%s/api/now/table/','GET','log','incident\x20table\x20objects','assign','remove','includes','forEach','internalType','label','all','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','concat','statusCode','Wrong\x20credentials','boolean','true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','push','html-pdf','rimraf','zip-dir','bluebird','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','ServicenowAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message'];(function(_0xdd2bfa,_0x5bd304){var _0x55397e=function(_0x196f7d){while(--_0x196f7d){_0xdd2bfa['push'](_0xdd2bfa['shift']());}};_0x55397e(++_0x5bd304);}(_0x1daa,0x164));var _0xa1da=function(_0x31a180,_0x3924b9){_0x31a180=_0x31a180-0x0;var _0x4b0502=_0x1daa[_0x31a180];return _0x4b0502;};'use strict';var pdf=require(_0xa1da('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xa1da('0x1'));var zipdir=require(_0xa1da('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa1da('0x3'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xa1da('0x4'));var csv=require('to-csv');var ejs=require(_0xa1da('0x5'));var fs=require('fs');var _=require(_0xa1da('0x6'));var squel=require('squel');var crypto=require(_0xa1da('0x7'));var jsforce=require(_0xa1da('0x8'));var deskjs=require(_0xa1da('0x9'));var toCsv=require(_0xa1da('0xa'));var querystring=require(_0xa1da('0xb'));var Papa=require(_0xa1da('0xc'));var Redis=require(_0xa1da('0xd'));var authService=require(_0xa1da('0xe'));var qs=require(_0xa1da('0xf'));var as=require(_0xa1da('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa1da('0x11'))(_0xa1da('0x12'));var utils=require(_0xa1da('0x13'));var config=require('../../config/environment');var db=require(_0xa1da('0x14'))['db'];var integrations=require(_0xa1da('0x15'));var jayson=require(_0xa1da('0x16'));var client=jayson[_0xa1da('0x17')]['http']({'port':0x232a});function checkPasswordPattern(_0xa41c64,_0x453e14,_0x39ab92){if(_0x39ab92){var _0x41fc64=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x41fc64['test'](_0x453e14)){return _0xa41c64;}else{throw new db[(_0xa1da('0x18'))][(_0xa1da('0x19'))](_0xa1da('0x1a'));}}else{return _0xa41c64;}}function respondWithRpcPromise(_0x42ab9e,_0x51a145,_0x5b727e,_0x4149b2){return new BPromise(function(_0x2ebf2c,_0x3fb7c7){var _0x5363a5=_0x4149b2||client;return _0x5363a5['request'](_0x42ab9e,_0x5b727e)[_0xa1da('0x1b')](function(_0x366757){logger['info'](_0xa1da('0x1c'),_0x51a145,'request\x20sent');logger[_0xa1da('0x1d')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x51a145,_0xa1da('0x1e'),JSON[_0xa1da('0x1f')](_0x366757));if(_0x366757['error']){if(_0x366757[_0xa1da('0x20')]['code']===0x1f4){logger['error'](_0xa1da('0x1c'),_0x51a145,_0x366757[_0xa1da('0x20')][_0xa1da('0x21')]);return _0x3fb7c7(_0x366757[_0xa1da('0x20')][_0xa1da('0x21')]);}logger[_0xa1da('0x20')]('ServicenowAccount,\x20%s,\x20%s',_0x51a145,_0x366757[_0xa1da('0x20')][_0xa1da('0x21')]);return _0x2ebf2c(_0x366757[_0xa1da('0x20')]['message']);}else{logger[_0xa1da('0x22')](_0xa1da('0x1c'),_0x51a145,'request\x20sent');_0x2ebf2c(_0x366757[_0xa1da('0x23')][_0xa1da('0x21')]);}})[_0xa1da('0x24')](function(_0x303eb9){logger['error'](_0xa1da('0x1c'),_0x51a145,_0x303eb9);_0x3fb7c7(_0x303eb9);});});}function respondWithStatusCode(_0x587d84,_0x476d77){_0x476d77=_0x476d77||0xcc;return function(_0x55ac5e){if(_0x55ac5e){return _0x587d84[_0xa1da('0x25')](_0x476d77);}return _0x587d84[_0xa1da('0x26')](_0x476d77)[_0xa1da('0x27')]();};}function respondWithResult(_0x4a441f,_0x56e308){_0x56e308=_0x56e308||0xc8;return function(_0x564d48){if(_0x564d48){return _0x4a441f[_0xa1da('0x26')](_0x56e308)[_0xa1da('0x28')](_0x564d48);}};}function respondWithFilteredResult(_0x578027,_0x2bda4f){return function(_0x21e166){if(_0x21e166){var _0x5b35d2=_0x21e166[_0xa1da('0x29')],_0x5169fa=_0x2bda4f[_0xa1da('0x2a')],_0x5c8021=_0x2bda4f[_0xa1da('0x2a')]+_0x2bda4f[_0xa1da('0x2b')],_0x48d6ad;if(_0x5c8021>=_0x5b35d2){_0x5c8021=_0x5b35d2;_0x48d6ad=0xc8;}else{_0x48d6ad=0xce;}_0x578027[_0xa1da('0x26')](_0x48d6ad);return _0x578027[_0xa1da('0x2c')]('Content-Range',_0x5169fa+'-'+_0x5c8021+'/'+_0x5b35d2)[_0xa1da('0x28')](_0x21e166);}return null;};}function patchUpdates(_0x6ee222){return function(_0x285100){try{jsonpatch[_0xa1da('0x2d')](_0x285100,_0x6ee222,!![]);}catch(_0x434f3c){return BPromise[_0xa1da('0x2e')](_0x434f3c);}return _0x285100[_0xa1da('0x2f')]();};}function saveUpdates(_0x479c57,_0x3aa441){return function(_0xbc90){if(_0xbc90){return _0xbc90[_0xa1da('0x30')](_0x479c57)[_0xa1da('0x1b')](function(_0x23a9ba){return _0x23a9ba;});}return null;};}function removeEntity(_0x1538d2,_0x4a4792){return function(_0x176bc){if(_0x176bc){return _0x176bc[_0xa1da('0x31')]()[_0xa1da('0x1b')](function(){_0x1538d2[_0xa1da('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x373865,_0x4503ed){return function(_0x2e7700){if(!_0x2e7700){_0x373865[_0xa1da('0x25')](0x194);}return _0x2e7700;};}function handleError(_0xded019,_0x268717){_0x268717=_0x268717||0x1f4;return function(_0x5ad24e){logger['error'](_0x5ad24e[_0xa1da('0x32')]);if(_0x5ad24e[_0xa1da('0x33')]){delete _0x5ad24e['name'];}_0xded019[_0xa1da('0x26')](_0x268717)['send'](_0x5ad24e);};}exports['index']=function(_0x3a3eb8,_0x5da486){var _0x554150={},_0x367914={},_0x143d01={'count':0x0,'rows':[]};var _0x243f7c=_[_0xa1da('0x34')](db[_0xa1da('0x35')][_0xa1da('0x36')],function(_0x211426){return{'name':_0x211426[_0xa1da('0x37')],'type':_0x211426['type'][_0xa1da('0x38')]};});_0x367914[_0xa1da('0x39')]=_[_0xa1da('0x34')](_0x243f7c,_0xa1da('0x33'));_0x367914[_0xa1da('0x3a')]=_[_0xa1da('0x3b')](_0x3a3eb8['query']);_0x367914['filters']=_['intersection'](_0x367914[_0xa1da('0x39')],_0x367914[_0xa1da('0x3a')]);_0x554150[_0xa1da('0x3c')]=_[_0xa1da('0x3d')](_0x367914['model'],qs['fields'](_0x3a3eb8['query'][_0xa1da('0x3e')]));_0x554150[_0xa1da('0x3c')]=_0x554150[_0xa1da('0x3c')][_0xa1da('0x3f')]?_0x554150['attributes']:_0x367914[_0xa1da('0x39')];if(!_0x3a3eb8[_0xa1da('0x3a')][_0xa1da('0x40')]('nolimit')){_0x554150['limit']=qs[_0xa1da('0x2b')](_0x3a3eb8['query'][_0xa1da('0x2b')]);_0x554150[_0xa1da('0x2a')]=qs['offset'](_0x3a3eb8[_0xa1da('0x3a')][_0xa1da('0x2a')]);}_0x554150['order']=qs[_0xa1da('0x41')](_0x3a3eb8['query'][_0xa1da('0x41')]);_0x554150[_0xa1da('0x42')]=qs[_0xa1da('0x43')](_[_0xa1da('0x44')](_0x3a3eb8[_0xa1da('0x3a')],_0x367914[_0xa1da('0x43')]));if(_0x3a3eb8[_0xa1da('0x3a')][_0xa1da('0x45')]){_0x554150[_0xa1da('0x42')]=_[_0xa1da('0x46')](_0x554150[_0xa1da('0x42')],{'$or':_[_0xa1da('0x34')](_0x243f7c,function(_0xc42701){if(_0xc42701[_0xa1da('0x47')]!==_0xa1da('0x48')){var _0x17c339={};_0x17c339[_0xc42701[_0xa1da('0x33')]]={'$like':'%'+_0x3a3eb8['query'][_0xa1da('0x45')]+'%'};return _0x17c339;}})});}_0x554150=_[_0xa1da('0x46')]({},_0x554150,_0x3a3eb8[_0xa1da('0x49')]);var _0x2c1a3d={'where':_0x554150[_0xa1da('0x42')]};return db[_0xa1da('0x35')][_0xa1da('0x29')](_0x2c1a3d)['then'](function(_0x28923b){_0x143d01[_0xa1da('0x29')]=_0x28923b;if(_0x3a3eb8[_0xa1da('0x3a')][_0xa1da('0x4a')]){_0x554150[_0xa1da('0x4b')]=[{'all':!![]}];}return db[_0xa1da('0x35')][_0xa1da('0x4c')](_0x554150);})[_0xa1da('0x1b')](function(_0xb95d12){_0x143d01['rows']=_0xb95d12;return _0x143d01;})[_0xa1da('0x1b')](respondWithFilteredResult(_0x5da486,_0x554150))[_0xa1da('0x24')](handleError(_0x5da486,null));};exports[_0xa1da('0x4d')]=function(_0x5066a4,_0x5a7849){var _0x2c7cd9={'raw':![],'where':{'id':_0x5066a4[_0xa1da('0x4e')]['id']}},_0x23238a={};_0x23238a['model']=_[_0xa1da('0x3b')](db[_0xa1da('0x35')]['rawAttributes']);_0x23238a[_0xa1da('0x3a')]=_[_0xa1da('0x3b')](_0x5066a4[_0xa1da('0x3a')]);_0x23238a[_0xa1da('0x43')]=_[_0xa1da('0x3d')](_0x23238a[_0xa1da('0x39')],_0x23238a[_0xa1da('0x3a')]);_0x2c7cd9[_0xa1da('0x3c')]=_['intersection'](_0x23238a['model'],qs[_0xa1da('0x3e')](_0x5066a4[_0xa1da('0x3a')][_0xa1da('0x3e')]));_0x2c7cd9[_0xa1da('0x3c')]=_0x2c7cd9[_0xa1da('0x3c')][_0xa1da('0x3f')]?_0x2c7cd9['attributes']:_0x23238a[_0xa1da('0x39')];if(_0x5066a4[_0xa1da('0x3a')]['includeAll']){_0x2c7cd9[_0xa1da('0x4b')]=[{'all':!![]}];}_0x2c7cd9=_[_0xa1da('0x46')]({},_0x2c7cd9,_0x5066a4[_0xa1da('0x49')]);return db[_0xa1da('0x35')]['find'](_0x2c7cd9)[_0xa1da('0x1b')](handleEntityNotFound(_0x5a7849,null))['then'](respondWithResult(_0x5a7849,null))[_0xa1da('0x24')](handleError(_0x5a7849,null));};exports[_0xa1da('0x4f')]=function(_0x5444e0,_0x5a30c3){return db[_0xa1da('0x35')][_0xa1da('0x4f')](_0x5444e0[_0xa1da('0x50')],{})[_0xa1da('0x1b')](respondWithResult(_0x5a30c3,0xc9))[_0xa1da('0x24')](handleError(_0x5a30c3,null));};exports[_0xa1da('0x30')]=function(_0x456710,_0x4734b3){if(_0x456710[_0xa1da('0x50')]['id']){delete _0x456710[_0xa1da('0x50')]['id'];}return db[_0xa1da('0x35')][_0xa1da('0x51')]({'where':{'id':_0x456710[_0xa1da('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4734b3,null))[_0xa1da('0x1b')](saveUpdates(_0x456710[_0xa1da('0x50')],null))[_0xa1da('0x1b')](respondWithResult(_0x4734b3,null))[_0xa1da('0x24')](handleError(_0x4734b3,null));};exports[_0xa1da('0x31')]=function(_0x4936e8,_0x1707af){return db['ServicenowAccount'][_0xa1da('0x51')]({'where':{'id':_0x4936e8[_0xa1da('0x4e')]['id']}})[_0xa1da('0x1b')](handleEntityNotFound(_0x1707af,null))[_0xa1da('0x1b')](removeEntity(_0x1707af,null))['catch'](handleError(_0x1707af,null));};exports[_0xa1da('0x52')]=function(_0x498e2e,_0x3b3034,_0x519a71){var _0x18f944={};var _0x58d1e1={};var _0x2064ba;var _0x284624;return db[_0xa1da('0x35')][_0xa1da('0x53')]({'where':{'id':_0x498e2e[_0xa1da('0x4e')]['id']}})[_0xa1da('0x1b')](handleEntityNotFound(_0x3b3034,null))[_0xa1da('0x1b')](function(_0x9e450c){if(_0x9e450c){_0x2064ba=_0x9e450c;_0x58d1e1['model']=_[_0xa1da('0x3b')](db[_0xa1da('0x54')][_0xa1da('0x36')]);_0x58d1e1[_0xa1da('0x3a')]=_[_0xa1da('0x3b')](_0x498e2e[_0xa1da('0x3a')]);_0x58d1e1['filters']=_[_0xa1da('0x3d')](_0x58d1e1[_0xa1da('0x39')],_0x58d1e1[_0xa1da('0x3a')]);_0x18f944[_0xa1da('0x3c')]=_[_0xa1da('0x3d')](_0x58d1e1['model'],qs[_0xa1da('0x3e')](_0x498e2e[_0xa1da('0x3a')]['fields']));_0x18f944['attributes']=_0x18f944[_0xa1da('0x3c')][_0xa1da('0x3f')]?_0x18f944[_0xa1da('0x3c')]:_0x58d1e1[_0xa1da('0x39')];_0x18f944['order']=qs[_0xa1da('0x41')](_0x498e2e[_0xa1da('0x3a')][_0xa1da('0x41')]);_0x18f944[_0xa1da('0x42')]=qs[_0xa1da('0x43')](_[_0xa1da('0x44')](_0x498e2e[_0xa1da('0x3a')],_0x58d1e1[_0xa1da('0x43')]));if(_0x498e2e['query']['filter']){_0x18f944['where']=_[_0xa1da('0x46')](_0x18f944[_0xa1da('0x42')],{'$or':_[_0xa1da('0x34')](_0x18f944[_0xa1da('0x3c')],function(_0x45ef56){var _0x36a523={};_0x36a523[_0x45ef56]={'$like':'%'+_0x498e2e[_0xa1da('0x3a')][_0xa1da('0x45')]+'%'};return _0x36a523;})});}_0x18f944=_[_0xa1da('0x46')]({},_0x18f944,_0x498e2e['options']);return _0x2064ba[_0xa1da('0x52')](_0x18f944);}})[_0xa1da('0x1b')](function(_0x3917eb){if(_0x3917eb){_0x284624=_0x3917eb[_0xa1da('0x3f')];if(!_0x498e2e[_0xa1da('0x3a')][_0xa1da('0x40')](_0xa1da('0x55'))){_0x18f944['limit']=qs[_0xa1da('0x2b')](_0x498e2e[_0xa1da('0x3a')][_0xa1da('0x2b')]);_0x18f944['offset']=qs[_0xa1da('0x2a')](_0x498e2e['query'][_0xa1da('0x2a')]);}return _0x2064ba[_0xa1da('0x52')](_0x18f944);}})['then'](function(_0x166150){if(_0x166150){return _0x166150?{'count':_0x284624,'rows':_0x166150}:null;}})[_0xa1da('0x1b')](respondWithResult(_0x3b3034,null))['catch'](handleError(_0x3b3034,null));};exports[_0xa1da('0x56')]=function(_0x3ab660,_0x63ef4b,_0x2d0d5e){if(_0x3ab660[_0xa1da('0x50')]['id']){delete _0x3ab660[_0xa1da('0x50')]['id'];}return db[_0xa1da('0x35')]['findOne']({'where':{'id':_0x3ab660[_0xa1da('0x4e')]['id']}})[_0xa1da('0x1b')](handleEntityNotFound(_0x63ef4b,null))[_0xa1da('0x1b')](function(_0x88fd47){if(_0x88fd47){_0x3ab660[_0xa1da('0x50')]['AccountId']=_0x88fd47['id'];_0x3ab660[_0xa1da('0x50')][_0xa1da('0x57')]=integrations['getSubjects'](_0x3ab660[_0xa1da('0x50')][_0xa1da('0x58')],_0x3ab660[_0xa1da('0x50')][_0xa1da('0x47')]);_0x3ab660['body'][_0xa1da('0x59')]=integrations[_0xa1da('0x5a')](_0x3ab660[_0xa1da('0x50')][_0xa1da('0x58')],_0x3ab660[_0xa1da('0x50')]['type']);return db[_0xa1da('0x54')][_0xa1da('0x4f')](_0x3ab660[_0xa1da('0x50')],{'include':[{'model':db[_0xa1da('0x5b')],'as':_0xa1da('0x57')},{'model':db['ServicenowField'],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x63ef4b,null))[_0xa1da('0x24')](handleError(_0x63ef4b,null));};exports[_0xa1da('0x5c')]=function(_0x4ae96f,_0x1f8192,_0x39ea51){var _0x4e23fc=[_0xa1da('0x5d'),_0xa1da('0x5e'),_0xa1da('0x5f'),'subcategory',_0xa1da('0x60'),_0xa1da('0x61'),_0xa1da('0x62'),_0xa1da('0x63'),_0xa1da('0x64')];var _0x5c9379=[_0xa1da('0x65'),_0xa1da('0x5d'),_0xa1da('0x66'),_0xa1da('0x67'),_0xa1da('0x68'),'sys_updated_on','child_incidents',_0xa1da('0x5e'),_0xa1da('0x69'),_0xa1da('0x6a'),_0xa1da('0x6b'),_0xa1da('0x6c'),_0xa1da('0x6d'),'user_input','sys_created_on',_0xa1da('0x6e'),_0xa1da('0x6f'),_0xa1da('0x70'),_0xa1da('0x5f'),'order',_0xa1da('0x71'),_0xa1da('0x72'),_0xa1da('0x73'),_0xa1da('0x74'),_0xa1da('0x75'),_0xa1da('0x76'),'work_notes_list',_0xa1da('0x77'),_0xa1da('0x78'),'sys_domain_path',_0xa1da('0x79'),_0xa1da('0x7a'),_0xa1da('0x7b'),_0xa1da('0x7c'),_0xa1da('0x7d'),_0xa1da('0x7e'),_0xa1da('0x7f'),_0xa1da('0x80'),_0xa1da('0x81'),_0xa1da('0x82'),_0xa1da('0x83'),_0xa1da('0x84'),_0xa1da('0x85'),_0xa1da('0x86'),'close_code',_0xa1da('0x87'),_0xa1da('0x88'),'work_start',_0xa1da('0x89'),_0xa1da('0x8a'),'additional_assignee_list',_0xa1da('0x8b'),_0xa1da('0x8c'),_0xa1da('0x61'),_0xa1da('0x8d'),_0xa1da('0x8e'),'closed_by',_0xa1da('0x8f'),_0xa1da('0x90'),_0xa1da('0x91'),'contact_type',_0xa1da('0x92'),_0xa1da('0x62'),_0xa1da('0x93'),_0xa1da('0x94'),_0xa1da('0x95'),_0xa1da('0x96'),_0xa1da('0x97'),_0xa1da('0x98'),_0xa1da('0x63'),_0xa1da('0x99'),'sla_due',_0xa1da('0x9a'),_0xa1da('0x9b'),_0xa1da('0x9c'),'sys_mod_count',_0xa1da('0x9d'),_0xa1da('0x9e'),_0xa1da('0x9f'),_0xa1da('0xa0'),_0xa1da('0xa1'),_0xa1da('0xa2'),_0xa1da('0x64')];var _0x2d8eb6='';var _0x3174d9='';var _0x12376a=[];var _0x44d922='';var _0xf957c5='';var _0x15ea20=[];var _0x72624f='';var _0x3bd39a='';var _0x1e1335={};var _0x47dd44='';return db['ServicenowAccount'][_0xa1da('0x53')]({'where':{'id':_0x4ae96f[_0xa1da('0x4e')]['id']},'attributes':['id',_0xa1da('0xa3'),_0xa1da('0xa4'),'email','remoteUri',_0xa1da('0xa5')]})[_0xa1da('0x1b')](handleEntityNotFound(_0x1f8192,null))[_0xa1da('0x1b')](function(_0x135009){if(_0x135009){_0x47dd44=_0x135009[_0xa1da('0xa6')];var _0x5c8fd5=_0x47dd44[_0xa1da('0xa7')](-0x1);if(_0x5c8fd5==='/'){_0x47dd44=_0x47dd44[_0xa1da('0xa8')](0x0,_0x47dd44['lastIndexOf'](_0x5c8fd5));}_0x3bd39a=util['format'](_0xa1da('0xa9'),_0x47dd44);_0x72624f=util[_0xa1da('0xaa')](_0xa1da('0xab'),_0x47dd44);_0x1e1335={'user':_0x135009['username'],'pass':_0x135009[_0xa1da('0xa4')]};var _0x1cdd28={'method':_0xa1da('0xac'),'uri':_0x3bd39a+'incident?sysparm_display_value=all','auth':_0x1e1335,'json':!![]};return rp(_0x1cdd28);}})['then'](function(_0x525185){if(_0x525185[_0xa1da('0x23')][_0xa1da('0x3f')]>0x0){_0x2d8eb6=_0x525185[_0xa1da('0x23')];}console[_0xa1da('0xad')](_0xa1da('0xae'),_0x2d8eb6);_0x15ea20=[];_0x3174d9=Object[_0xa1da('0xaf')]([],_0x2d8eb6);_[_0xa1da('0xb0')](_0x3174d9,function(_0x350225){return!_0x4e23fc[_0xa1da('0xb1')](_0x350225[_0xa1da('0x33')]);});_0x3174d9[_0xa1da('0xb2')](function(_0x4171b5){var _0x2d0e23=createFieldObject(_0x72624f,_0x1e1335,_0x4171b5[_0xa1da('0xb3')],_0x4171b5['name'],_0x4171b5[_0xa1da('0xb4')],![]);_0x15ea20['push'](_0x2d0e23);});return Promise[_0xa1da('0xb5')](_0x15ea20);})[_0xa1da('0x1b')](function(_0x6ff487){_0x12376a=_0x6ff487;_0x44d922=Object[_0xa1da('0xaf')]([],_0x2d8eb6);console[_0xa1da('0xad')](_0xa1da('0xb6'),_0x2d8eb6);_['remove'](_0x44d922,function(_0x315a9e){return _0x5c9379[_0xa1da('0xb1')](_0x315a9e[_0xa1da('0x33')]);});console['log'](_0xa1da('0xb7'),_0x44d922);_0x15ea20=[];_0x44d922['forEach'](function(_0x59264c){var _0x224e2f=createFieldObject(_0x72624f,_0x1e1335,_0x59264c[_0xa1da('0xb3')],_0x59264c[_0xa1da('0x33')],_0x59264c['label'],!![]);_0x15ea20['push'](_0x224e2f);});return Promise[_0xa1da('0xb5')](_0x15ea20);})['then'](function(_0x5389ff){_0xf957c5=_0x5389ff;var _0x262b27=_0x12376a[_0xa1da('0xb8')](_0xf957c5);return{'count':_0x262b27[_0xa1da('0x3f')],'rows':_0x262b27};})[_0xa1da('0x1b')](respondWithResult(_0x1f8192,null))[_0xa1da('0x24')](function(_0xb7c9da){console[_0xa1da('0xad')]('ServiceNow\x20error:\x20'+_0xb7c9da);var _0x59642a=_0x4ae96f[_0xa1da('0x3a')]['test']?0x1f4:_0xb7c9da[_0xa1da('0xb9')]||0x1f4;logger[_0xa1da('0x20')](_0xb7c9da[_0xa1da('0x32')]);delete _0xb7c9da[_0xa1da('0x33')];if(_0x59642a===0x191){_0x59642a=0x190;}_0x1f8192[_0xa1da('0x26')](_0x59642a)['send'](_0x4ae96f[_0xa1da('0x3a')]['test']?{'message':_0xa1da('0xba'),'statusCode':_0xb7c9da[_0xa1da('0xb9')]}:_0xb7c9da);});};function createFieldObject(_0x4f740a,_0x51b1df,_0x1c944d,_0x374670,_0x278b90,_0x3fe4c8){return new Promise(function(_0x5a7433,_0x58b6d9){var _0x53ab46={'id':_0x374670,'name':_0x278b90,'custom':_0x3fe4c8};if(_0x1c944d===_0xa1da('0xbb')){_0x53ab46[_0xa1da('0x49')]=[{'name':'True','value':_0xa1da('0xbc')},{'name':_0xa1da('0xbd'),'value':_0xa1da('0xbe')}];_0x5a7433(_0x53ab46);}else{var _0x4440ac={'method':'GET','uri':_0x4f740a+_0xa1da('0xbf')+_0x374670,'auth':_0x51b1df,'json':!![]};return rp(_0x4440ac)[_0xa1da('0x1b')](function(_0x2cffc1){var _0x43561f=[];if(_0x2cffc1[_0xa1da('0x23')][_0xa1da('0x3f')]>0x0){_0x2cffc1[_0xa1da('0x23')][_0xa1da('0xb2')](function(_0x2f7dbf){if(_0x2f7dbf[_0xa1da('0xc0')]==='false'){var _0x2c1dd4={'name':_0x2f7dbf['label'],'value':_0x2f7dbf[_0xa1da('0xc1')]};_0x43561f[_0xa1da('0xc2')](_0x2c1dd4);}});}_0x53ab46['options']=_0x43561f;if(_0x53ab46[_0xa1da('0x49')]['length']>0x0){_0x5a7433(_0x53ab46);}else{if(_0x3fe4c8==![]){_0x5a7433();}else{_0x5a7433(_0x53ab46);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 4fedee3..57dc668 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 _0x5162=['../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','define','ServicenowAccount','int_servicenow_accounts','lodash','bluebird','request-promise','path','rimraf'];(function(_0x13ac10,_0x46e79e){var _0x28eda2=function(_0x169ef0){while(--_0x169ef0){_0x13ac10['push'](_0x13ac10['shift']());}};_0x28eda2(++_0x46e79e);}(_0x5162,0x103));var _0x2516=function(_0xf73390,_0x14c109){_0xf73390=_0xf73390-0x0;var _0x4b212f=_0x5162[_0xf73390];return _0x4b212f;};'use strict';var _=require(_0x2516('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x2516('0x1'));var rp=require(_0x2516('0x2'));var fs=require('fs');var path=require(_0x2516('0x3'));var rimraf=require(_0x2516('0x4'));var config=require(_0x2516('0x5'));var attributes=require(_0x2516('0x6'));var integrations=require(_0x2516('0x7'));module['exports']=function(_0x48f411,_0x5beeb3){return _0x48f411[_0x2516('0x8')](_0x2516('0x9'),attributes,{'tableName':_0x2516('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x885a=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','define','int_servicenow_accounts'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x885a,0x180));var _0xa885=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x885a[_0x21a9d9];return _0x46adce;};'use strict';var _=require('lodash');var util=require(_0xa885('0x0'));var logger=require(_0xa885('0x1'))(_0xa885('0x2'));var moment=require(_0xa885('0x3'));var BPromise=require('bluebird');var rp=require(_0xa885('0x4'));var fs=require('fs');var path=require(_0xa885('0x5'));var rimraf=require(_0xa885('0x6'));var config=require(_0xa885('0x7'));var attributes=require(_0xa885('0x8'));var integrations=require(_0xa885('0x9'));module['exports']=function(_0x7ac6bd,_0x1200c7){return _0x7ac6bd[_0xa885('0xa')]('ServicenowAccount',attributes,{'tableName':_0xa885('0xb'),'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 a60b99f..5c1ff61 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 _0xb2f2=['ServicenowAccount','find','where','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetServicenowAccount','findAll','options','raw','limit','map','model','attributes','include','info','stringify','ShowServicenowAccount'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb2f2,0x179));var _0x2b2f=function(_0x2e4975,_0x50350d){_0x2e4975=_0x2e4975-0x0;var _0x553118=_0xb2f2[_0x2e4975];return _0x553118;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x2b2f('0x0'));var rs=require(_0x2b2f('0x1'));var fs=require('fs');var Redis=require(_0x2b2f('0x2'));var db=require(_0x2b2f('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2b2f('0x4'));var config=require(_0x2b2f('0x5'));var jayson=require(_0x2b2f('0x6'));var client=jayson[_0x2b2f('0x7')][_0x2b2f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xa2a0d0,_0x4ca3af,_0x1af7ed){return new BPromise(function(_0x3f0ee4,_0x46a272){return client[_0x2b2f('0x9')](_0xa2a0d0,_0x1af7ed)[_0x2b2f('0xa')](function(_0x520a){logger['info'](_0x2b2f('0xb'),_0x4ca3af,_0x2b2f('0xc'));logger[_0x2b2f('0xd')](_0x2b2f('0xe'),_0x4ca3af,_0x2b2f('0xc'),JSON['stringify'](_0x520a));if(_0x520a[_0x2b2f('0xf')]){if(_0x520a[_0x2b2f('0xf')]['code']===0x1f4){logger['error'](_0x2b2f('0xb'),_0x4ca3af,_0x520a['error'][_0x2b2f('0x10')]);return _0x46a272(_0x520a[_0x2b2f('0xf')][_0x2b2f('0x10')]);}logger[_0x2b2f('0xf')](_0x2b2f('0xb'),_0x4ca3af,_0x520a['error']['message']);return _0x3f0ee4(_0x520a[_0x2b2f('0xf')][_0x2b2f('0x10')]);}else{logger['info']('ServicenowAccount,\x20%s,\x20%s',_0x4ca3af,'request\x20sent');_0x3f0ee4(_0x520a[_0x2b2f('0x11')][_0x2b2f('0x10')]);}})[_0x2b2f('0x12')](function(_0x5873ca){logger[_0x2b2f('0xf')]('ServicenowAccount,\x20%s,\x20%s',_0x4ca3af,_0x5873ca);_0x46a272(_0x5873ca);});});}exports[_0x2b2f('0x13')]=function(_0x51f946){var _0x3d54b1=this;return new Promise(function(_0x6f7d66,_0x9952ed){return db['ServicenowAccount'][_0x2b2f('0x14')]({'raw':_0x51f946[_0x2b2f('0x15')]?_0x51f946[_0x2b2f('0x15')][_0x2b2f('0x16')]===undefined?!![]:![]:!![],'where':_0x51f946['options']?_0x51f946[_0x2b2f('0x15')]['where']||null:null,'attributes':_0x51f946['options']?_0x51f946['options']['attributes']||null:null,'limit':_0x51f946[_0x2b2f('0x15')]?_0x51f946[_0x2b2f('0x15')][_0x2b2f('0x17')]||null:null,'include':_0x51f946[_0x2b2f('0x15')]?_0x51f946['options']['include']?_[_0x2b2f('0x18')](_0x51f946[_0x2b2f('0x15')]['include'],function(_0x944344){return{'model':db[_0x944344[_0x2b2f('0x19')]],'as':_0x944344['as'],'attributes':_0x944344[_0x2b2f('0x1a')],'include':_0x944344[_0x2b2f('0x1b')]?_[_0x2b2f('0x18')](_0x944344[_0x2b2f('0x1b')],function(_0x4e514a){return{'model':db[_0x4e514a['model']],'as':_0x4e514a['as'],'attributes':_0x4e514a[_0x2b2f('0x1a')],'include':_0x4e514a[_0x2b2f('0x1b')]?_[_0x2b2f('0x18')](_0x4e514a[_0x2b2f('0x1b')],function(_0x1b419c){return{'model':db[_0x1b419c['model']],'as':_0x1b419c['as'],'attributes':_0x1b419c[_0x2b2f('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1d0134){logger[_0x2b2f('0x1c')](_0x2b2f('0x13'),_0x51f946);logger['debug'](_0x2b2f('0x13'),_0x51f946,JSON[_0x2b2f('0x1d')](_0x1d0134));_0x6f7d66(_0x1d0134);})['catch'](function(_0x3d4bb3){logger[_0x2b2f('0xf')]('GetServicenowAccount',_0x3d4bb3[_0x2b2f('0x10')],_0x51f946);_0x9952ed(_0x3d54b1[_0x2b2f('0xf')](0x1f4,_0x3d4bb3[_0x2b2f('0x10')]));});});};exports[_0x2b2f('0x1e')]=function(_0x2bd2dd){var _0xbf505=this;return new Promise(function(_0x200085,_0xd11eaa){return db[_0x2b2f('0x1f')][_0x2b2f('0x20')]({'raw':_0x2bd2dd[_0x2b2f('0x15')]?_0x2bd2dd[_0x2b2f('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x2bd2dd['options']?_0x2bd2dd['options'][_0x2b2f('0x21')]||null:null,'attributes':_0x2bd2dd['options']?_0x2bd2dd[_0x2b2f('0x15')]['attributes']||null:null,'include':_0x2bd2dd[_0x2b2f('0x15')]?_0x2bd2dd[_0x2b2f('0x15')]['include']?_['map'](_0x2bd2dd[_0x2b2f('0x15')]['include'],function(_0x3ff29c){return{'model':db[_0x3ff29c['model']],'as':_0x3ff29c['as'],'attributes':_0x3ff29c['attributes'],'include':_0x3ff29c[_0x2b2f('0x1b')]?_[_0x2b2f('0x18')](_0x3ff29c['include'],function(_0xbffc81){return{'model':db[_0xbffc81['model']],'as':_0xbffc81['as'],'attributes':_0xbffc81[_0x2b2f('0x1a')],'include':_0xbffc81['include']?_[_0x2b2f('0x18')](_0xbffc81['include'],function(_0x6f4a0){return{'model':db[_0x6f4a0['model']],'as':_0x6f4a0['as'],'attributes':_0x6f4a0['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x58484e){logger[_0x2b2f('0x1c')]('ShowServicenowAccount',_0x2bd2dd);logger['debug'](_0x2b2f('0x1e'),_0x2bd2dd,JSON[_0x2b2f('0x1d')](_0x58484e));_0x200085(_0x58484e);})[_0x2b2f('0x12')](function(_0x57f38f){logger[_0x2b2f('0xf')]('ShowServicenowAccount',_0x57f38f['message'],_0x2bd2dd);_0xd11eaa(_0xbf505[_0x2b2f('0xf')](0x1f4,_0x57f38f[_0x2b2f('0x10')]));});});}; \ No newline at end of file +var _0x3720=['catch','GetServicenowAccount','options','where','include','model','map','attributes','debug','ShowServicenowAccount','ServicenowAccount','find','raw','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ServicenowAccount,\x20%s,\x20%s','request\x20sent','stringify','error','message','info'];(function(_0x496ac4,_0x37ddea){var _0x331e38=function(_0xc75542){while(--_0xc75542){_0x496ac4['push'](_0x496ac4['shift']());}};_0x331e38(++_0x37ddea);}(_0x3720,0x91));var _0x0372=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0x3720[_0xbb091];return _0x467a04;};'use strict';var _=require(_0x0372('0x0'));var util=require(_0x0372('0x1'));var moment=require(_0x0372('0x2'));var BPromise=require(_0x0372('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0372('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0372('0x5'));var logger=require(_0x0372('0x6'))(_0x0372('0x7'));var config=require(_0x0372('0x8'));var jayson=require(_0x0372('0x9'));var client=jayson[_0x0372('0xa')][_0x0372('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x431758,_0x10051c,_0x4c3feb){return new BPromise(function(_0x4df27f,_0x2be089){return client[_0x0372('0xc')](_0x431758,_0x4c3feb)[_0x0372('0xd')](function(_0xab64ce){logger['info'](_0x0372('0xe'),_0x10051c,_0x0372('0xf'));logger['debug']('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x10051c,_0x0372('0xf'),JSON[_0x0372('0x10')](_0xab64ce));if(_0xab64ce['error']){if(_0xab64ce[_0x0372('0x11')]['code']===0x1f4){logger[_0x0372('0x11')](_0x0372('0xe'),_0x10051c,_0xab64ce[_0x0372('0x11')][_0x0372('0x12')]);return _0x2be089(_0xab64ce[_0x0372('0x11')][_0x0372('0x12')]);}logger['error'](_0x0372('0xe'),_0x10051c,_0xab64ce[_0x0372('0x11')]['message']);return _0x4df27f(_0xab64ce[_0x0372('0x11')]['message']);}else{logger[_0x0372('0x13')](_0x0372('0xe'),_0x10051c,_0x0372('0xf'));_0x4df27f(_0xab64ce['result'][_0x0372('0x12')]);}})[_0x0372('0x14')](function(_0x2129c6){logger[_0x0372('0x11')](_0x0372('0xe'),_0x10051c,_0x2129c6);_0x2be089(_0x2129c6);});});}exports[_0x0372('0x15')]=function(_0x574527){var _0x4bb432=this;return new Promise(function(_0x170fad,_0x4b2e75){return db['ServicenowAccount']['findAll']({'raw':_0x574527[_0x0372('0x16')]?_0x574527[_0x0372('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x574527[_0x0372('0x16')]?_0x574527['options'][_0x0372('0x17')]||null:null,'attributes':_0x574527[_0x0372('0x16')]?_0x574527[_0x0372('0x16')]['attributes']||null:null,'limit':_0x574527[_0x0372('0x16')]?_0x574527[_0x0372('0x16')]['limit']||null:null,'include':_0x574527['options']?_0x574527[_0x0372('0x16')][_0x0372('0x18')]?_['map'](_0x574527[_0x0372('0x16')][_0x0372('0x18')],function(_0x439b34){return{'model':db[_0x439b34[_0x0372('0x19')]],'as':_0x439b34['as'],'attributes':_0x439b34['attributes'],'include':_0x439b34['include']?_[_0x0372('0x1a')](_0x439b34[_0x0372('0x18')],function(_0x408d07){return{'model':db[_0x408d07[_0x0372('0x19')]],'as':_0x408d07['as'],'attributes':_0x408d07[_0x0372('0x1b')],'include':_0x408d07['include']?_['map'](_0x408d07[_0x0372('0x18')],function(_0x30bab0){return{'model':db[_0x30bab0[_0x0372('0x19')]],'as':_0x30bab0['as'],'attributes':_0x30bab0[_0x0372('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0372('0xd')](function(_0xd507ab){logger[_0x0372('0x13')](_0x0372('0x15'),_0x574527);logger[_0x0372('0x1c')](_0x0372('0x15'),_0x574527,JSON[_0x0372('0x10')](_0xd507ab));_0x170fad(_0xd507ab);})[_0x0372('0x14')](function(_0x105ff2){logger[_0x0372('0x11')](_0x0372('0x15'),_0x105ff2[_0x0372('0x12')],_0x574527);_0x4b2e75(_0x4bb432[_0x0372('0x11')](0x1f4,_0x105ff2[_0x0372('0x12')]));});});};exports[_0x0372('0x1d')]=function(_0x55348d){var _0x18cb58=this;return new Promise(function(_0x21ef72,_0x472b87){return db[_0x0372('0x1e')][_0x0372('0x1f')]({'raw':_0x55348d[_0x0372('0x16')]?_0x55348d[_0x0372('0x16')][_0x0372('0x20')]===undefined?!![]:![]:!![],'where':_0x55348d[_0x0372('0x16')]?_0x55348d[_0x0372('0x16')][_0x0372('0x17')]||null:null,'attributes':_0x55348d['options']?_0x55348d[_0x0372('0x16')][_0x0372('0x1b')]||null:null,'include':_0x55348d[_0x0372('0x16')]?_0x55348d[_0x0372('0x16')][_0x0372('0x18')]?_[_0x0372('0x1a')](_0x55348d[_0x0372('0x16')][_0x0372('0x18')],function(_0x44ba53){return{'model':db[_0x44ba53[_0x0372('0x19')]],'as':_0x44ba53['as'],'attributes':_0x44ba53[_0x0372('0x1b')],'include':_0x44ba53[_0x0372('0x18')]?_[_0x0372('0x1a')](_0x44ba53[_0x0372('0x18')],function(_0xef2812){return{'model':db[_0xef2812[_0x0372('0x19')]],'as':_0xef2812['as'],'attributes':_0xef2812[_0x0372('0x1b')],'include':_0xef2812['include']?_[_0x0372('0x1a')](_0xef2812[_0x0372('0x18')],function(_0x220720){return{'model':db[_0x220720[_0x0372('0x19')]],'as':_0x220720['as'],'attributes':_0x220720[_0x0372('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0372('0xd')](function(_0x336a5b){logger[_0x0372('0x13')]('ShowServicenowAccount',_0x55348d);logger['debug'](_0x0372('0x1d'),_0x55348d,JSON[_0x0372('0x10')](_0x336a5b));_0x21ef72(_0x336a5b);})[_0x0372('0x14')](function(_0x5a86fe){logger[_0x0372('0x11')](_0x0372('0x1d'),_0x5a86fe[_0x0372('0x12')],_0x55348d);_0x472b87(_0x18cb58['error'](0x1f4,_0x5a86fe[_0x0372('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 5830570..0e1cda3 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 _0xa539=['put','delete','destroy','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','create'];(function(_0x3f97a7,_0x4732e9){var _0x4cead3=function(_0x4fb68c){while(--_0x4fb68c){_0x3f97a7['push'](_0x3f97a7['shift']());}};_0x4cead3(++_0x4732e9);}(_0xa539,0x143));var _0x9a53=function(_0x3565ed,_0xc8a56a){_0x3565ed=_0x3565ed-0x0;var _0x5b57ef=_0xa539[_0x3565ed];return _0x5b57ef;};'use strict';var multer=require('multer');var util=require(_0x9a53('0x0'));var path=require(_0x9a53('0x1'));var timeout=require('connect-timeout');var express=require(_0x9a53('0x2'));var router=express['Router']();var auth=require(_0x9a53('0x3'));var interaction=require(_0x9a53('0x4'));var config=require(_0x9a53('0x5'));var controller=require(_0x9a53('0x6'));router['get']('/',auth[_0x9a53('0x7')](),controller[_0x9a53('0x8')]);router[_0x9a53('0x9')](_0x9a53('0xa'),auth[_0x9a53('0x7')](),controller[_0x9a53('0xb')]);router[_0x9a53('0x9')](_0x9a53('0xc'),auth['isAuthenticated'](),controller[_0x9a53('0xd')]);router[_0x9a53('0x9')](_0x9a53('0xe'),auth[_0x9a53('0x7')](),controller['getSubjects']);router[_0x9a53('0x9')](_0x9a53('0xf'),auth[_0x9a53('0x7')](),controller['getDescriptions']);router['post']('/',auth[_0x9a53('0x7')](),controller[_0x9a53('0x10')]);router[_0x9a53('0x11')]('/:id',auth[_0x9a53('0x7')](),controller['update']);router[_0x9a53('0x12')]('/:id',auth[_0x9a53('0x7')](),controller[_0x9a53('0x13')]);module['exports']=router; \ No newline at end of file +var _0x228d=['../../config/environment','./intServicenowConfiguration.controller','get','/:id','isAuthenticated','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x53e9f6,_0x1cb849){var _0x19a0ab=function(_0x323f51){while(--_0x323f51){_0x53e9f6['push'](_0x53e9f6['shift']());}};_0x19a0ab(++_0x1cb849);}(_0x228d,0x1d3));var _0xd228=function(_0x54ccd7,_0x3bc3ce){_0x54ccd7=_0x54ccd7-0x0;var _0x4e667b=_0x228d[_0x54ccd7];return _0x4e667b;};'use strict';var multer=require(_0xd228('0x0'));var util=require(_0xd228('0x1'));var path=require(_0xd228('0x2'));var timeout=require(_0xd228('0x3'));var express=require(_0xd228('0x4'));var router=express[_0xd228('0x5')]();var auth=require(_0xd228('0x6'));var interaction=require(_0xd228('0x7'));var config=require(_0xd228('0x8'));var controller=require(_0xd228('0x9'));router[_0xd228('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xd228('0xa')](_0xd228('0xb'),auth[_0xd228('0xc')](),controller[_0xd228('0xd')]);router[_0xd228('0xa')](_0xd228('0xe'),auth[_0xd228('0xc')](),controller[_0xd228('0xf')]);router[_0xd228('0xa')]('/:id/subjects',auth[_0xd228('0xc')](),controller[_0xd228('0x10')]);router[_0xd228('0xa')](_0xd228('0x11'),auth[_0xd228('0xc')](),controller[_0xd228('0x12')]);router['post']('/',auth[_0xd228('0xc')](),controller[_0xd228('0x13')]);router[_0xd228('0x14')](_0xd228('0xb'),auth[_0xd228('0xc')](),controller[_0xd228('0x15')]);router[_0xd228('0x16')](_0xd228('0xb'),auth[_0xd228('0xc')](),controller[_0xd228('0x17')]);module[_0xd228('0x18')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 78d09f1..0396c7d 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 _0xe4c6=['STRING','sequelize','exports'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xe4c6,0x9a));var _0x6e4c=function(_0x5be745,_0x190739){_0x5be745=_0x5be745-0x0;var _0x39eac8=_0xe4c6[_0x5be745];return _0x39eac8;};'use strict';var Sequelize=require(_0x6e4c('0x0'));module[_0x6e4c('0x1')]={'name':{'type':Sequelize[_0x6e4c('0x2')]},'description':{'type':Sequelize[_0x6e4c('0x2')]}}; \ No newline at end of file +var _0xfe1e=['STRING'];(function(_0x50cd41,_0x4874a7){var _0x399475=function(_0x1946da){while(--_0x1946da){_0x50cd41['push'](_0x50cd41['shift']());}};_0x399475(++_0x4874a7);}(_0xfe1e,0xe6));var _0xefe1=function(_0x5dc4f4,_0x392ebc){_0x5dc4f4=_0x5dc4f4-0x0;var _0xe142b3=_0xfe1e[_0x5dc4f4];return _0xe142b3;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xefe1('0x0')]},'description':{'type':Sequelize[_0xefe1('0x0')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 233a813..8431f5a 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 _0x31e2=['getSubjects','pick','getDescriptions','rimraf','fast-json-patch','bluebird','util','path','sox','to-csv','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','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','ServicenowConfiguration,\x20%s,\x20%s','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','end','status','json','count','offset','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','rawAttributes','fieldName','model','map','query','keys','filters','intersection','fields','length','attributes','nolimit','limit','order','sort','where','merge','type','VIRTUAL','filter','options','ServicenowConfiguration','includeAll','include','findAll','rows','show','params','find','create','body','getFields','findOne','ServicenowField','hasOwnProperty'];(function(_0x205de3,_0x50bc59){var _0x6ca7b=function(_0x212253){while(--_0x212253){_0x205de3['push'](_0x205de3['shift']());}};_0x6ca7b(++_0x50bc59);}(_0x31e2,0xb9));var _0x231e=function(_0x38fb8b,_0x70dd0a){_0x38fb8b=_0x38fb8b-0x0;var _0x1ec681=_0x31e2[_0x38fb8b];return _0x1ec681;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x231e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x231e('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x231e('0x2'));var Mustache=require('mustache');var util=require(_0x231e('0x3'));var path=require(_0x231e('0x4'));var sox=require(_0x231e('0x5'));var csv=require(_0x231e('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x231e('0x7'));var jsforce=require(_0x231e('0x8'));var deskjs=require(_0x231e('0x9'));var toCsv=require(_0x231e('0x6'));var querystring=require(_0x231e('0xa'));var Papa=require(_0x231e('0xb'));var Redis=require(_0x231e('0xc'));var authService=require(_0x231e('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x231e('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x231e('0xf'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require(_0x231e('0x10'));var client=jayson[_0x231e('0x11')][_0x231e('0x12')]({'port':0x232a});function checkPasswordPattern(_0x1a63d9,_0xf20b3,_0x1d212c){if(_0x1d212c){var _0x56ea80=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x56ea80[_0x231e('0x13')](_0xf20b3)){return _0x1a63d9;}else{throw new db[(_0x231e('0x14'))][(_0x231e('0x15'))](_0x231e('0x16'));}}else{return _0x1a63d9;}}function respondWithRpcPromise(_0xa5d1f6,_0x23a0d1,_0x247812,_0x566453){return new BPromise(function(_0x13a5f2,_0x31b419){var _0x5e534a=_0x566453||client;return _0x5e534a[_0x231e('0x17')](_0xa5d1f6,_0x247812)[_0x231e('0x18')](function(_0x174d3e){logger[_0x231e('0x19')](_0x231e('0x1a'),_0x23a0d1,'request\x20sent');logger[_0x231e('0x1b')](_0x231e('0x1c'),_0x23a0d1,_0x231e('0x1d'),JSON[_0x231e('0x1e')](_0x174d3e));if(_0x174d3e[_0x231e('0x1f')]){if(_0x174d3e[_0x231e('0x1f')][_0x231e('0x20')]===0x1f4){logger[_0x231e('0x1f')](_0x231e('0x1a'),_0x23a0d1,_0x174d3e[_0x231e('0x1f')][_0x231e('0x21')]);return _0x31b419(_0x174d3e[_0x231e('0x1f')]['message']);}logger[_0x231e('0x1f')]('ServicenowConfiguration,\x20%s,\x20%s',_0x23a0d1,_0x174d3e[_0x231e('0x1f')][_0x231e('0x21')]);return _0x13a5f2(_0x174d3e[_0x231e('0x1f')][_0x231e('0x21')]);}else{logger['info'](_0x231e('0x1a'),_0x23a0d1,_0x231e('0x1d'));_0x13a5f2(_0x174d3e[_0x231e('0x22')][_0x231e('0x21')]);}})[_0x231e('0x23')](function(_0x40a171){logger[_0x231e('0x1f')](_0x231e('0x1a'),_0x23a0d1,_0x40a171);_0x31b419(_0x40a171);});});}function respondWithStatusCode(_0x4448b6,_0x561a97){_0x561a97=_0x561a97||0xcc;return function(_0x150177){if(_0x150177){return _0x4448b6[_0x231e('0x24')](_0x561a97);}return _0x4448b6['status'](_0x561a97)[_0x231e('0x25')]();};}function respondWithResult(_0x53c652,_0x987c02){_0x987c02=_0x987c02||0xc8;return function(_0x3c1f30){if(_0x3c1f30){return _0x53c652[_0x231e('0x26')](_0x987c02)[_0x231e('0x27')](_0x3c1f30);}};}function respondWithFilteredResult(_0x44478b,_0x2045f5){return function(_0x214438){if(_0x214438){var _0x47edab=_0x214438[_0x231e('0x28')],_0x4a357b=_0x2045f5[_0x231e('0x29')],_0x34670c=_0x2045f5[_0x231e('0x29')]+_0x2045f5['limit'],_0x2546e7;if(_0x34670c>=_0x47edab){_0x34670c=_0x47edab;_0x2546e7=0xc8;}else{_0x2546e7=0xce;}_0x44478b[_0x231e('0x26')](_0x2546e7);return _0x44478b[_0x231e('0x2a')](_0x231e('0x2b'),_0x4a357b+'-'+_0x34670c+'/'+_0x47edab)[_0x231e('0x27')](_0x214438);}return null;};}function patchUpdates(_0x458c2e){return function(_0x2027d5){try{jsonpatch[_0x231e('0x2c')](_0x2027d5,_0x458c2e,!![]);}catch(_0x5c3ce8){return BPromise[_0x231e('0x2d')](_0x5c3ce8);}return _0x2027d5[_0x231e('0x2e')]();};}function saveUpdates(_0x2d86f4,_0x27b09a){return function(_0x41325c){if(_0x41325c){return _0x41325c[_0x231e('0x2f')](_0x2d86f4)[_0x231e('0x18')](function(_0x538c10){return _0x538c10;});}return null;};}function removeEntity(_0x5d8610,_0x4f4153){return function(_0x2e7caf){if(_0x2e7caf){return _0x2e7caf[_0x231e('0x30')]()[_0x231e('0x18')](function(){_0x5d8610['status'](0xcc)[_0x231e('0x25')]();});}};}function handleEntityNotFound(_0x1fbae2,_0x2145cb){return function(_0x31bcf5){if(!_0x31bcf5){_0x1fbae2[_0x231e('0x24')](0x194);}return _0x31bcf5;};}function handleError(_0x41e575,_0x2ee46e){_0x2ee46e=_0x2ee46e||0x1f4;return function(_0x10faf6){logger[_0x231e('0x1f')](_0x10faf6[_0x231e('0x31')]);if(_0x10faf6[_0x231e('0x32')]){delete _0x10faf6[_0x231e('0x32')];}_0x41e575[_0x231e('0x26')](_0x2ee46e)[_0x231e('0x33')](_0x10faf6);};}exports[_0x231e('0x34')]=function(_0x4447a3,_0x3afe81){var _0x5ed9c6={},_0x3f92c3={},_0x3448e6={'count':0x0,'rows':[]};var _0x12a428=_['map'](db['ServicenowConfiguration'][_0x231e('0x35')],function(_0x5d077b){return{'name':_0x5d077b[_0x231e('0x36')],'type':_0x5d077b['type']['key']};});_0x3f92c3[_0x231e('0x37')]=_[_0x231e('0x38')](_0x12a428,_0x231e('0x32'));_0x3f92c3[_0x231e('0x39')]=_[_0x231e('0x3a')](_0x4447a3[_0x231e('0x39')]);_0x3f92c3[_0x231e('0x3b')]=_[_0x231e('0x3c')](_0x3f92c3[_0x231e('0x37')],_0x3f92c3[_0x231e('0x39')]);_0x5ed9c6['attributes']=_[_0x231e('0x3c')](_0x3f92c3[_0x231e('0x37')],qs[_0x231e('0x3d')](_0x4447a3[_0x231e('0x39')]['fields']));_0x5ed9c6['attributes']=_0x5ed9c6['attributes'][_0x231e('0x3e')]?_0x5ed9c6[_0x231e('0x3f')]:_0x3f92c3[_0x231e('0x37')];if(!_0x4447a3[_0x231e('0x39')]['hasOwnProperty'](_0x231e('0x40'))){_0x5ed9c6['limit']=qs[_0x231e('0x41')](_0x4447a3[_0x231e('0x39')]['limit']);_0x5ed9c6[_0x231e('0x29')]=qs[_0x231e('0x29')](_0x4447a3[_0x231e('0x39')][_0x231e('0x29')]);}_0x5ed9c6[_0x231e('0x42')]=qs['sort'](_0x4447a3['query'][_0x231e('0x43')]);_0x5ed9c6[_0x231e('0x44')]=qs['filters'](_['pick'](_0x4447a3[_0x231e('0x39')],_0x3f92c3[_0x231e('0x3b')]));if(_0x4447a3[_0x231e('0x39')]['filter']){_0x5ed9c6[_0x231e('0x44')]=_[_0x231e('0x45')](_0x5ed9c6['where'],{'$or':_[_0x231e('0x38')](_0x12a428,function(_0x16eff7){if(_0x16eff7[_0x231e('0x46')]!==_0x231e('0x47')){var _0x5bf64e={};_0x5bf64e[_0x16eff7['name']]={'$like':'%'+_0x4447a3[_0x231e('0x39')][_0x231e('0x48')]+'%'};return _0x5bf64e;}})});}_0x5ed9c6=_[_0x231e('0x45')]({},_0x5ed9c6,_0x4447a3[_0x231e('0x49')]);var _0x36b0e7={'where':_0x5ed9c6[_0x231e('0x44')]};return db[_0x231e('0x4a')]['count'](_0x36b0e7)[_0x231e('0x18')](function(_0x2fdfee){_0x3448e6[_0x231e('0x28')]=_0x2fdfee;if(_0x4447a3['query'][_0x231e('0x4b')]){_0x5ed9c6[_0x231e('0x4c')]=[{'all':!![]}];}return db['ServicenowConfiguration'][_0x231e('0x4d')](_0x5ed9c6);})[_0x231e('0x18')](function(_0x3f8817){_0x3448e6[_0x231e('0x4e')]=_0x3f8817;return _0x3448e6;})['then'](respondWithFilteredResult(_0x3afe81,_0x5ed9c6))[_0x231e('0x23')](handleError(_0x3afe81,null));};exports[_0x231e('0x4f')]=function(_0x45ef2c,_0x5a37df){var _0x55458b={'raw':![],'where':{'id':_0x45ef2c[_0x231e('0x50')]['id']}},_0x5411c8={};_0x5411c8[_0x231e('0x37')]=_[_0x231e('0x3a')](db[_0x231e('0x4a')][_0x231e('0x35')]);_0x5411c8[_0x231e('0x39')]=_[_0x231e('0x3a')](_0x45ef2c[_0x231e('0x39')]);_0x5411c8[_0x231e('0x3b')]=_[_0x231e('0x3c')](_0x5411c8[_0x231e('0x37')],_0x5411c8[_0x231e('0x39')]);_0x55458b[_0x231e('0x3f')]=_[_0x231e('0x3c')](_0x5411c8[_0x231e('0x37')],qs[_0x231e('0x3d')](_0x45ef2c['query'][_0x231e('0x3d')]));_0x55458b['attributes']=_0x55458b[_0x231e('0x3f')][_0x231e('0x3e')]?_0x55458b[_0x231e('0x3f')]:_0x5411c8[_0x231e('0x37')];if(_0x45ef2c[_0x231e('0x39')][_0x231e('0x4b')]){_0x55458b['include']=[{'all':!![]}];}_0x55458b=_[_0x231e('0x45')]({},_0x55458b,_0x45ef2c['options']);return db[_0x231e('0x4a')][_0x231e('0x51')](_0x55458b)[_0x231e('0x18')](handleEntityNotFound(_0x5a37df,null))['then'](respondWithResult(_0x5a37df,null))['catch'](handleError(_0x5a37df,null));};exports[_0x231e('0x52')]=function(_0x1399f1,_0x284270){return db['ServicenowConfiguration'][_0x231e('0x52')](_0x1399f1[_0x231e('0x53')],{})[_0x231e('0x18')](respondWithResult(_0x284270,0xc9))[_0x231e('0x23')](handleError(_0x284270,null));};exports[_0x231e('0x2f')]=function(_0x387fb1,_0x2bae8f){if(_0x387fb1[_0x231e('0x53')]['id']){delete _0x387fb1[_0x231e('0x53')]['id'];}return db['ServicenowConfiguration'][_0x231e('0x51')]({'where':{'id':_0x387fb1[_0x231e('0x50')]['id']}})[_0x231e('0x18')](handleEntityNotFound(_0x2bae8f,null))[_0x231e('0x18')](saveUpdates(_0x387fb1[_0x231e('0x53')],null))[_0x231e('0x18')](respondWithResult(_0x2bae8f,null))[_0x231e('0x23')](handleError(_0x2bae8f,null));};exports['destroy']=function(_0x1caccc,_0x4d0631){return db['ServicenowConfiguration'][_0x231e('0x51')]({'where':{'id':_0x1caccc['params']['id']}})[_0x231e('0x18')](handleEntityNotFound(_0x4d0631,null))[_0x231e('0x18')](removeEntity(_0x4d0631,null))[_0x231e('0x23')](handleError(_0x4d0631,null));};exports[_0x231e('0x54')]=function(_0x2081a6,_0x2c6d11,_0xf2ddb){var _0x275dce={};var _0xf73f2d={};var _0x37627b;var _0x5ec3a8;return db[_0x231e('0x4a')][_0x231e('0x55')]({'where':{'id':_0x2081a6[_0x231e('0x50')]['id']}})[_0x231e('0x18')](handleEntityNotFound(_0x2c6d11,null))[_0x231e('0x18')](function(_0x129842){if(_0x129842){_0x37627b=_0x129842;_0xf73f2d[_0x231e('0x37')]=_[_0x231e('0x3a')](db[_0x231e('0x56')][_0x231e('0x35')]);_0xf73f2d['query']=_[_0x231e('0x3a')](_0x2081a6[_0x231e('0x39')]);_0xf73f2d[_0x231e('0x3b')]=_['intersection'](_0xf73f2d[_0x231e('0x37')],_0xf73f2d[_0x231e('0x39')]);_0x275dce[_0x231e('0x3f')]=_[_0x231e('0x3c')](_0xf73f2d['model'],qs[_0x231e('0x3d')](_0x2081a6['query'][_0x231e('0x3d')]));_0x275dce['attributes']=_0x275dce[_0x231e('0x3f')][_0x231e('0x3e')]?_0x275dce[_0x231e('0x3f')]:_0xf73f2d[_0x231e('0x37')];_0x275dce[_0x231e('0x42')]=qs[_0x231e('0x43')](_0x2081a6['query']['sort']);_0x275dce[_0x231e('0x44')]=qs['filters'](_['pick'](_0x2081a6[_0x231e('0x39')],_0xf73f2d[_0x231e('0x3b')]));if(_0x2081a6['query'][_0x231e('0x48')]){_0x275dce[_0x231e('0x44')]=_['merge'](_0x275dce[_0x231e('0x44')],{'$or':_[_0x231e('0x38')](_0x275dce[_0x231e('0x3f')],function(_0x3e58c1){var _0x2a9966={};_0x2a9966[_0x3e58c1]={'$like':'%'+_0x2081a6[_0x231e('0x39')][_0x231e('0x48')]+'%'};return _0x2a9966;})});}_0x275dce=_[_0x231e('0x45')]({},_0x275dce,_0x2081a6[_0x231e('0x49')]);return _0x37627b['getFields'](_0x275dce);}})[_0x231e('0x18')](function(_0x49983d){if(_0x49983d){_0x5ec3a8=_0x49983d[_0x231e('0x3e')];if(!_0x2081a6[_0x231e('0x39')][_0x231e('0x57')](_0x231e('0x40'))){_0x275dce[_0x231e('0x41')]=qs['limit'](_0x2081a6[_0x231e('0x39')]['limit']);_0x275dce[_0x231e('0x29')]=qs[_0x231e('0x29')](_0x2081a6[_0x231e('0x39')][_0x231e('0x29')]);}return _0x37627b[_0x231e('0x54')](_0x275dce);}})[_0x231e('0x18')](function(_0x4a22d9){if(_0x4a22d9){return _0x4a22d9?{'count':_0x5ec3a8,'rows':_0x4a22d9}:null;}})[_0x231e('0x18')](respondWithResult(_0x2c6d11,null))[_0x231e('0x23')](handleError(_0x2c6d11,null));};exports[_0x231e('0x58')]=function(_0xeb1375,_0x12040e,_0x22ad85){var _0x5c940f={};var _0x4ea164={};var _0x4849c8;var _0x43e869;return db[_0x231e('0x4a')][_0x231e('0x55')]({'where':{'id':_0xeb1375['params']['id']}})[_0x231e('0x18')](handleEntityNotFound(_0x12040e,null))['then'](function(_0x2a88cb){if(_0x2a88cb){_0x4849c8=_0x2a88cb;_0x4ea164[_0x231e('0x37')]=_['keys'](db[_0x231e('0x56')][_0x231e('0x35')]);_0x4ea164[_0x231e('0x39')]=_['keys'](_0xeb1375[_0x231e('0x39')]);_0x4ea164[_0x231e('0x3b')]=_[_0x231e('0x3c')](_0x4ea164[_0x231e('0x37')],_0x4ea164[_0x231e('0x39')]);_0x5c940f[_0x231e('0x3f')]=_['intersection'](_0x4ea164[_0x231e('0x37')],qs[_0x231e('0x3d')](_0xeb1375['query'][_0x231e('0x3d')]));_0x5c940f[_0x231e('0x3f')]=_0x5c940f[_0x231e('0x3f')][_0x231e('0x3e')]?_0x5c940f[_0x231e('0x3f')]:_0x4ea164[_0x231e('0x37')];_0x5c940f[_0x231e('0x42')]=qs[_0x231e('0x43')](_0xeb1375[_0x231e('0x39')][_0x231e('0x43')]);_0x5c940f[_0x231e('0x44')]=qs[_0x231e('0x3b')](_[_0x231e('0x59')](_0xeb1375[_0x231e('0x39')],_0x4ea164[_0x231e('0x3b')]));if(_0xeb1375['query'][_0x231e('0x48')]){_0x5c940f[_0x231e('0x44')]=_[_0x231e('0x45')](_0x5c940f['where'],{'$or':_[_0x231e('0x38')](_0x5c940f[_0x231e('0x3f')],function(_0x3a0c1c){var _0x16fe3d={};_0x16fe3d[_0x3a0c1c]={'$like':'%'+_0xeb1375[_0x231e('0x39')]['filter']+'%'};return _0x16fe3d;})});}_0x5c940f=_[_0x231e('0x45')]({},_0x5c940f,_0xeb1375[_0x231e('0x49')]);return _0x4849c8[_0x231e('0x58')](_0x5c940f);}})[_0x231e('0x18')](function(_0x308c31){if(_0x308c31){_0x43e869=_0x308c31[_0x231e('0x3e')];if(!_0xeb1375[_0x231e('0x39')][_0x231e('0x57')](_0x231e('0x40'))){_0x5c940f['limit']=qs[_0x231e('0x41')](_0xeb1375[_0x231e('0x39')]['limit']);_0x5c940f[_0x231e('0x29')]=qs[_0x231e('0x29')](_0xeb1375[_0x231e('0x39')]['offset']);}return _0x4849c8[_0x231e('0x58')](_0x5c940f);}})[_0x231e('0x18')](function(_0x2e734d){if(_0x2e734d){return _0x2e734d?{'count':_0x43e869,'rows':_0x2e734d}:null;}})[_0x231e('0x18')](respondWithResult(_0x12040e,null))[_0x231e('0x23')](handleError(_0x12040e,null));};exports[_0x231e('0x5a')]=function(_0x11ca7c,_0x486e60,_0x42321c){var _0x3f3de0={};var _0x49a05e={};var _0x51b943;var _0x5d6f69;return db[_0x231e('0x4a')][_0x231e('0x55')]({'where':{'id':_0x11ca7c[_0x231e('0x50')]['id']}})['then'](handleEntityNotFound(_0x486e60,null))[_0x231e('0x18')](function(_0x5129b3){if(_0x5129b3){_0x51b943=_0x5129b3;_0x49a05e['model']=_['keys'](db[_0x231e('0x56')][_0x231e('0x35')]);_0x49a05e[_0x231e('0x39')]=_['keys'](_0x11ca7c[_0x231e('0x39')]);_0x49a05e[_0x231e('0x3b')]=_['intersection'](_0x49a05e[_0x231e('0x37')],_0x49a05e[_0x231e('0x39')]);_0x3f3de0[_0x231e('0x3f')]=_[_0x231e('0x3c')](_0x49a05e[_0x231e('0x37')],qs[_0x231e('0x3d')](_0x11ca7c[_0x231e('0x39')][_0x231e('0x3d')]));_0x3f3de0[_0x231e('0x3f')]=_0x3f3de0['attributes']['length']?_0x3f3de0[_0x231e('0x3f')]:_0x49a05e[_0x231e('0x37')];_0x3f3de0[_0x231e('0x42')]=qs[_0x231e('0x43')](_0x11ca7c['query'][_0x231e('0x43')]);_0x3f3de0[_0x231e('0x44')]=qs[_0x231e('0x3b')](_[_0x231e('0x59')](_0x11ca7c[_0x231e('0x39')],_0x49a05e[_0x231e('0x3b')]));if(_0x11ca7c['query']['filter']){_0x3f3de0[_0x231e('0x44')]=_[_0x231e('0x45')](_0x3f3de0[_0x231e('0x44')],{'$or':_[_0x231e('0x38')](_0x3f3de0[_0x231e('0x3f')],function(_0x4149b8){var _0x206294={};_0x206294[_0x4149b8]={'$like':'%'+_0x11ca7c['query'][_0x231e('0x48')]+'%'};return _0x206294;})});}_0x3f3de0=_[_0x231e('0x45')]({},_0x3f3de0,_0x11ca7c['options']);return _0x51b943['getDescriptions'](_0x3f3de0);}})[_0x231e('0x18')](function(_0x12e92d){if(_0x12e92d){_0x5d6f69=_0x12e92d[_0x231e('0x3e')];if(!_0x11ca7c[_0x231e('0x39')][_0x231e('0x57')]('nolimit')){_0x3f3de0[_0x231e('0x41')]=qs['limit'](_0x11ca7c[_0x231e('0x39')][_0x231e('0x41')]);_0x3f3de0[_0x231e('0x29')]=qs[_0x231e('0x29')](_0x11ca7c['query'][_0x231e('0x29')]);}return _0x51b943[_0x231e('0x5a')](_0x3f3de0);}})['then'](function(_0x2547d6){if(_0x2547d6){return _0x2547d6?{'count':_0x5d6f69,'rows':_0x2547d6}:null;}})['then'](respondWithResult(_0x486e60,null))[_0x231e('0x23')](handleError(_0x486e60,null));}; \ No newline at end of file +var _0x968b=['rawAttributes','type','key','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','count','includeAll','include','show','keys','find','create','body','params','getFields','ServicenowField','order','pick','getSubjects','findOne','getDescriptions','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../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','ServicenowConfiguration,\x20%s,\x20%s','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','sendStatus','end','status','json','offset','limit','Content-Range','apply','reject','update','destroy','name','send','map','ServicenowConfiguration'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x968b,0x133));var _0xb968=function(_0x4c94d1,_0x573a4f){_0x4c94d1=_0x4c94d1-0x0;var _0x48c2c3=_0x968b[_0x4c94d1];return _0x48c2c3;};'use strict';var pdf=require(_0xb968('0x0'));var emlformat=require(_0xb968('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xb968('0x2'));var jsonpatch=require(_0xb968('0x3'));var rp=require(_0xb968('0x4'));var moment=require(_0xb968('0x5'));var BPromise=require(_0xb968('0x6'));var Mustache=require('mustache');var util=require(_0xb968('0x7'));var path=require(_0xb968('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb968('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xb968('0xa'));var crypto=require(_0xb968('0xb'));var jsforce=require(_0xb968('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xb968('0xd'));var querystring=require(_0xb968('0xe'));var Papa=require(_0xb968('0xf'));var Redis=require(_0xb968('0x10'));var authService=require(_0xb968('0x11'));var qs=require(_0xb968('0x12'));var as=require(_0xb968('0x13'));var hardwareService=require(_0xb968('0x14'));var logger=require(_0xb968('0x15'))(_0xb968('0x16'));var utils=require(_0xb968('0x17'));var config=require('../../config/environment');var db=require(_0xb968('0x18'))['db'];var jayson=require(_0xb968('0x19'));var client=jayson[_0xb968('0x1a')][_0xb968('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x5b8cb2,_0x47598d,_0x14ac41){if(_0x14ac41){var _0x3c4b55=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3c4b55['test'](_0x47598d)){return _0x5b8cb2;}else{throw new db[(_0xb968('0x1c'))][(_0xb968('0x1d'))](_0xb968('0x1e'));}}else{return _0x5b8cb2;}}function respondWithRpcPromise(_0x227ce,_0x57c913,_0x1a15a6,_0x4e39e5){return new BPromise(function(_0x4a076f,_0x332336){var _0x3c8e07=_0x4e39e5||client;return _0x3c8e07['request'](_0x227ce,_0x1a15a6)[_0xb968('0x1f')](function(_0x5ea200){logger[_0xb968('0x20')](_0xb968('0x21'),_0x57c913,'request\x20sent');logger[_0xb968('0x22')](_0xb968('0x23'),_0x57c913,'request\x20sent',JSON[_0xb968('0x24')](_0x5ea200));if(_0x5ea200[_0xb968('0x25')]){if(_0x5ea200[_0xb968('0x25')][_0xb968('0x26')]===0x1f4){logger[_0xb968('0x25')](_0xb968('0x21'),_0x57c913,_0x5ea200[_0xb968('0x25')][_0xb968('0x27')]);return _0x332336(_0x5ea200[_0xb968('0x25')][_0xb968('0x27')]);}logger[_0xb968('0x25')](_0xb968('0x21'),_0x57c913,_0x5ea200[_0xb968('0x25')][_0xb968('0x27')]);return _0x4a076f(_0x5ea200[_0xb968('0x25')]['message']);}else{logger['info']('ServicenowConfiguration,\x20%s,\x20%s',_0x57c913,_0xb968('0x28'));_0x4a076f(_0x5ea200['result']['message']);}})[_0xb968('0x29')](function(_0x18e904){logger[_0xb968('0x25')](_0xb968('0x21'),_0x57c913,_0x18e904);_0x332336(_0x18e904);});});}function respondWithStatusCode(_0x446a3c,_0x109a28){_0x109a28=_0x109a28||0xcc;return function(_0x2c16ec){if(_0x2c16ec){return _0x446a3c[_0xb968('0x2a')](_0x109a28);}return _0x446a3c['status'](_0x109a28)[_0xb968('0x2b')]();};}function respondWithResult(_0x262555,_0x482afa){_0x482afa=_0x482afa||0xc8;return function(_0x3adb7c){if(_0x3adb7c){return _0x262555[_0xb968('0x2c')](_0x482afa)[_0xb968('0x2d')](_0x3adb7c);}};}function respondWithFilteredResult(_0x19b59e,_0x2a6a9d){return function(_0x5ef2be){if(_0x5ef2be){var _0x13ddf0=_0x5ef2be['count'],_0x6f8c75=_0x2a6a9d[_0xb968('0x2e')],_0x5a36dc=_0x2a6a9d[_0xb968('0x2e')]+_0x2a6a9d[_0xb968('0x2f')],_0x2dcee9;if(_0x5a36dc>=_0x13ddf0){_0x5a36dc=_0x13ddf0;_0x2dcee9=0xc8;}else{_0x2dcee9=0xce;}_0x19b59e[_0xb968('0x2c')](_0x2dcee9);return _0x19b59e['set'](_0xb968('0x30'),_0x6f8c75+'-'+_0x5a36dc+'/'+_0x13ddf0)[_0xb968('0x2d')](_0x5ef2be);}return null;};}function patchUpdates(_0x598981){return function(_0x25a161){try{jsonpatch[_0xb968('0x31')](_0x25a161,_0x598981,!![]);}catch(_0x304a54){return BPromise[_0xb968('0x32')](_0x304a54);}return _0x25a161['save']();};}function saveUpdates(_0x1a4ef4,_0x4edfb4){return function(_0x38f977){if(_0x38f977){return _0x38f977[_0xb968('0x33')](_0x1a4ef4)['then'](function(_0x16f06d){return _0x16f06d;});}return null;};}function removeEntity(_0x4022a1,_0x3ac93d){return function(_0x30f12e){if(_0x30f12e){return _0x30f12e[_0xb968('0x34')]()[_0xb968('0x1f')](function(){_0x4022a1[_0xb968('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4fe49c,_0x85fc04){return function(_0x4bed7c){if(!_0x4bed7c){_0x4fe49c[_0xb968('0x2a')](0x194);}return _0x4bed7c;};}function handleError(_0x19d1f5,_0x139a80){_0x139a80=_0x139a80||0x1f4;return function(_0x2952b3){logger[_0xb968('0x25')](_0x2952b3['stack']);if(_0x2952b3[_0xb968('0x35')]){delete _0x2952b3[_0xb968('0x35')];}_0x19d1f5[_0xb968('0x2c')](_0x139a80)[_0xb968('0x36')](_0x2952b3);};}exports['index']=function(_0x51a574,_0x1ce8f0){var _0x50d6f6={},_0x38affd={},_0x1b9fa3={'count':0x0,'rows':[]};var _0x4a7d1f=_[_0xb968('0x37')](db[_0xb968('0x38')][_0xb968('0x39')],function(_0x5b4212){return{'name':_0x5b4212['fieldName'],'type':_0x5b4212[_0xb968('0x3a')][_0xb968('0x3b')]};});_0x38affd['model']=_[_0xb968('0x37')](_0x4a7d1f,_0xb968('0x35'));_0x38affd[_0xb968('0x3c')]=_['keys'](_0x51a574['query']);_0x38affd[_0xb968('0x3d')]=_['intersection'](_0x38affd[_0xb968('0x3e')],_0x38affd['query']);_0x50d6f6[_0xb968('0x3f')]=_[_0xb968('0x40')](_0x38affd[_0xb968('0x3e')],qs[_0xb968('0x41')](_0x51a574['query'][_0xb968('0x41')]));_0x50d6f6[_0xb968('0x3f')]=_0x50d6f6[_0xb968('0x3f')][_0xb968('0x42')]?_0x50d6f6[_0xb968('0x3f')]:_0x38affd[_0xb968('0x3e')];if(!_0x51a574[_0xb968('0x3c')][_0xb968('0x43')](_0xb968('0x44'))){_0x50d6f6[_0xb968('0x2f')]=qs[_0xb968('0x2f')](_0x51a574[_0xb968('0x3c')]['limit']);_0x50d6f6[_0xb968('0x2e')]=qs['offset'](_0x51a574[_0xb968('0x3c')][_0xb968('0x2e')]);}_0x50d6f6['order']=qs[_0xb968('0x45')](_0x51a574[_0xb968('0x3c')]['sort']);_0x50d6f6[_0xb968('0x46')]=qs[_0xb968('0x3d')](_['pick'](_0x51a574[_0xb968('0x3c')],_0x38affd[_0xb968('0x3d')]));if(_0x51a574[_0xb968('0x3c')][_0xb968('0x47')]){_0x50d6f6[_0xb968('0x46')]=_[_0xb968('0x48')](_0x50d6f6['where'],{'$or':_[_0xb968('0x37')](_0x4a7d1f,function(_0x3cb4c3){if(_0x3cb4c3['type']!==_0xb968('0x49')){var _0x135e0f={};_0x135e0f[_0x3cb4c3['name']]={'$like':'%'+_0x51a574[_0xb968('0x3c')][_0xb968('0x47')]+'%'};return _0x135e0f;}})});}_0x50d6f6=_[_0xb968('0x48')]({},_0x50d6f6,_0x51a574[_0xb968('0x4a')]);var _0x579962={'where':_0x50d6f6[_0xb968('0x46')]};return db[_0xb968('0x38')][_0xb968('0x4b')](_0x579962)[_0xb968('0x1f')](function(_0x2f91c7){_0x1b9fa3[_0xb968('0x4b')]=_0x2f91c7;if(_0x51a574[_0xb968('0x3c')][_0xb968('0x4c')]){_0x50d6f6[_0xb968('0x4d')]=[{'all':!![]}];}return db['ServicenowConfiguration']['findAll'](_0x50d6f6);})[_0xb968('0x1f')](function(_0x4e3be3){_0x1b9fa3['rows']=_0x4e3be3;return _0x1b9fa3;})[_0xb968('0x1f')](respondWithFilteredResult(_0x1ce8f0,_0x50d6f6))[_0xb968('0x29')](handleError(_0x1ce8f0,null));};exports[_0xb968('0x4e')]=function(_0x2ef368,_0x29b7fa){var _0x30bf25={'raw':![],'where':{'id':_0x2ef368['params']['id']}},_0x181278={};_0x181278[_0xb968('0x3e')]=_[_0xb968('0x4f')](db[_0xb968('0x38')][_0xb968('0x39')]);_0x181278['query']=_[_0xb968('0x4f')](_0x2ef368[_0xb968('0x3c')]);_0x181278[_0xb968('0x3d')]=_['intersection'](_0x181278['model'],_0x181278[_0xb968('0x3c')]);_0x30bf25[_0xb968('0x3f')]=_[_0xb968('0x40')](_0x181278[_0xb968('0x3e')],qs['fields'](_0x2ef368['query'][_0xb968('0x41')]));_0x30bf25[_0xb968('0x3f')]=_0x30bf25[_0xb968('0x3f')][_0xb968('0x42')]?_0x30bf25[_0xb968('0x3f')]:_0x181278[_0xb968('0x3e')];if(_0x2ef368['query'][_0xb968('0x4c')]){_0x30bf25[_0xb968('0x4d')]=[{'all':!![]}];}_0x30bf25=_[_0xb968('0x48')]({},_0x30bf25,_0x2ef368['options']);return db[_0xb968('0x38')][_0xb968('0x50')](_0x30bf25)[_0xb968('0x1f')](handleEntityNotFound(_0x29b7fa,null))['then'](respondWithResult(_0x29b7fa,null))[_0xb968('0x29')](handleError(_0x29b7fa,null));};exports[_0xb968('0x51')]=function(_0xac02f8,_0x559764){return db[_0xb968('0x38')][_0xb968('0x51')](_0xac02f8[_0xb968('0x52')],{})[_0xb968('0x1f')](respondWithResult(_0x559764,0xc9))[_0xb968('0x29')](handleError(_0x559764,null));};exports['update']=function(_0x396f2e,_0x4ca647){if(_0x396f2e[_0xb968('0x52')]['id']){delete _0x396f2e[_0xb968('0x52')]['id'];}return db[_0xb968('0x38')][_0xb968('0x50')]({'where':{'id':_0x396f2e[_0xb968('0x53')]['id']}})[_0xb968('0x1f')](handleEntityNotFound(_0x4ca647,null))['then'](saveUpdates(_0x396f2e[_0xb968('0x52')],null))[_0xb968('0x1f')](respondWithResult(_0x4ca647,null))[_0xb968('0x29')](handleError(_0x4ca647,null));};exports[_0xb968('0x34')]=function(_0x8c5aa1,_0x184664){return db[_0xb968('0x38')]['find']({'where':{'id':_0x8c5aa1[_0xb968('0x53')]['id']}})['then'](handleEntityNotFound(_0x184664,null))[_0xb968('0x1f')](removeEntity(_0x184664,null))[_0xb968('0x29')](handleError(_0x184664,null));};exports[_0xb968('0x54')]=function(_0x4b4756,_0x4c9d0c,_0x18d77c){var _0x231628={};var _0x20d70e={};var _0x352776;var _0x2fbe7f;return db[_0xb968('0x38')]['findOne']({'where':{'id':_0x4b4756['params']['id']}})[_0xb968('0x1f')](handleEntityNotFound(_0x4c9d0c,null))[_0xb968('0x1f')](function(_0x4d7dd6){if(_0x4d7dd6){_0x352776=_0x4d7dd6;_0x20d70e[_0xb968('0x3e')]=_[_0xb968('0x4f')](db[_0xb968('0x55')]['rawAttributes']);_0x20d70e[_0xb968('0x3c')]=_[_0xb968('0x4f')](_0x4b4756[_0xb968('0x3c')]);_0x20d70e[_0xb968('0x3d')]=_[_0xb968('0x40')](_0x20d70e[_0xb968('0x3e')],_0x20d70e['query']);_0x231628['attributes']=_[_0xb968('0x40')](_0x20d70e[_0xb968('0x3e')],qs[_0xb968('0x41')](_0x4b4756[_0xb968('0x3c')][_0xb968('0x41')]));_0x231628[_0xb968('0x3f')]=_0x231628[_0xb968('0x3f')][_0xb968('0x42')]?_0x231628['attributes']:_0x20d70e[_0xb968('0x3e')];_0x231628[_0xb968('0x56')]=qs[_0xb968('0x45')](_0x4b4756[_0xb968('0x3c')]['sort']);_0x231628['where']=qs[_0xb968('0x3d')](_[_0xb968('0x57')](_0x4b4756[_0xb968('0x3c')],_0x20d70e[_0xb968('0x3d')]));if(_0x4b4756[_0xb968('0x3c')][_0xb968('0x47')]){_0x231628[_0xb968('0x46')]=_[_0xb968('0x48')](_0x231628[_0xb968('0x46')],{'$or':_[_0xb968('0x37')](_0x231628[_0xb968('0x3f')],function(_0x259f57){var _0x24cd96={};_0x24cd96[_0x259f57]={'$like':'%'+_0x4b4756[_0xb968('0x3c')][_0xb968('0x47')]+'%'};return _0x24cd96;})});}_0x231628=_[_0xb968('0x48')]({},_0x231628,_0x4b4756[_0xb968('0x4a')]);return _0x352776[_0xb968('0x54')](_0x231628);}})[_0xb968('0x1f')](function(_0x4b1644){if(_0x4b1644){_0x2fbe7f=_0x4b1644[_0xb968('0x42')];if(!_0x4b4756[_0xb968('0x3c')][_0xb968('0x43')](_0xb968('0x44'))){_0x231628['limit']=qs[_0xb968('0x2f')](_0x4b4756[_0xb968('0x3c')][_0xb968('0x2f')]);_0x231628['offset']=qs['offset'](_0x4b4756[_0xb968('0x3c')][_0xb968('0x2e')]);}return _0x352776[_0xb968('0x54')](_0x231628);}})[_0xb968('0x1f')](function(_0x2349fa){if(_0x2349fa){return _0x2349fa?{'count':_0x2fbe7f,'rows':_0x2349fa}:null;}})[_0xb968('0x1f')](respondWithResult(_0x4c9d0c,null))['catch'](handleError(_0x4c9d0c,null));};exports[_0xb968('0x58')]=function(_0x20fd9a,_0x5ed719,_0x2a45a9){var _0x160358={};var _0x4c31b4={};var _0x477968;var _0xfbd7ce;return db[_0xb968('0x38')][_0xb968('0x59')]({'where':{'id':_0x20fd9a['params']['id']}})[_0xb968('0x1f')](handleEntityNotFound(_0x5ed719,null))[_0xb968('0x1f')](function(_0x10dd17){if(_0x10dd17){_0x477968=_0x10dd17;_0x4c31b4[_0xb968('0x3e')]=_[_0xb968('0x4f')](db[_0xb968('0x55')]['rawAttributes']);_0x4c31b4['query']=_[_0xb968('0x4f')](_0x20fd9a[_0xb968('0x3c')]);_0x4c31b4[_0xb968('0x3d')]=_[_0xb968('0x40')](_0x4c31b4['model'],_0x4c31b4[_0xb968('0x3c')]);_0x160358['attributes']=_[_0xb968('0x40')](_0x4c31b4[_0xb968('0x3e')],qs[_0xb968('0x41')](_0x20fd9a[_0xb968('0x3c')]['fields']));_0x160358[_0xb968('0x3f')]=_0x160358['attributes'][_0xb968('0x42')]?_0x160358[_0xb968('0x3f')]:_0x4c31b4[_0xb968('0x3e')];_0x160358[_0xb968('0x56')]=qs[_0xb968('0x45')](_0x20fd9a[_0xb968('0x3c')][_0xb968('0x45')]);_0x160358['where']=qs[_0xb968('0x3d')](_[_0xb968('0x57')](_0x20fd9a[_0xb968('0x3c')],_0x4c31b4[_0xb968('0x3d')]));if(_0x20fd9a[_0xb968('0x3c')][_0xb968('0x47')]){_0x160358[_0xb968('0x46')]=_[_0xb968('0x48')](_0x160358[_0xb968('0x46')],{'$or':_[_0xb968('0x37')](_0x160358['attributes'],function(_0x1e7f20){var _0x28d25d={};_0x28d25d[_0x1e7f20]={'$like':'%'+_0x20fd9a[_0xb968('0x3c')][_0xb968('0x47')]+'%'};return _0x28d25d;})});}_0x160358=_[_0xb968('0x48')]({},_0x160358,_0x20fd9a[_0xb968('0x4a')]);return _0x477968['getSubjects'](_0x160358);}})[_0xb968('0x1f')](function(_0x3cf840){if(_0x3cf840){_0xfbd7ce=_0x3cf840['length'];if(!_0x20fd9a['query']['hasOwnProperty']('nolimit')){_0x160358[_0xb968('0x2f')]=qs[_0xb968('0x2f')](_0x20fd9a[_0xb968('0x3c')][_0xb968('0x2f')]);_0x160358[_0xb968('0x2e')]=qs[_0xb968('0x2e')](_0x20fd9a[_0xb968('0x3c')][_0xb968('0x2e')]);}return _0x477968[_0xb968('0x58')](_0x160358);}})[_0xb968('0x1f')](function(_0xd8ed87){if(_0xd8ed87){return _0xd8ed87?{'count':_0xfbd7ce,'rows':_0xd8ed87}:null;}})[_0xb968('0x1f')](respondWithResult(_0x5ed719,null))[_0xb968('0x29')](handleError(_0x5ed719,null));};exports[_0xb968('0x5a')]=function(_0x22bf6d,_0xd9ade2,_0x44a973){var _0x16737a={};var _0x5b796e={};var _0x4dec36;var _0x9975f3;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0x22bf6d[_0xb968('0x53')]['id']}})[_0xb968('0x1f')](handleEntityNotFound(_0xd9ade2,null))[_0xb968('0x1f')](function(_0x3accee){if(_0x3accee){_0x4dec36=_0x3accee;_0x5b796e['model']=_['keys'](db[_0xb968('0x55')]['rawAttributes']);_0x5b796e[_0xb968('0x3c')]=_[_0xb968('0x4f')](_0x22bf6d[_0xb968('0x3c')]);_0x5b796e[_0xb968('0x3d')]=_['intersection'](_0x5b796e[_0xb968('0x3e')],_0x5b796e[_0xb968('0x3c')]);_0x16737a[_0xb968('0x3f')]=_[_0xb968('0x40')](_0x5b796e[_0xb968('0x3e')],qs[_0xb968('0x41')](_0x22bf6d[_0xb968('0x3c')]['fields']));_0x16737a[_0xb968('0x3f')]=_0x16737a[_0xb968('0x3f')][_0xb968('0x42')]?_0x16737a[_0xb968('0x3f')]:_0x5b796e['model'];_0x16737a[_0xb968('0x56')]=qs[_0xb968('0x45')](_0x22bf6d[_0xb968('0x3c')][_0xb968('0x45')]);_0x16737a[_0xb968('0x46')]=qs[_0xb968('0x3d')](_[_0xb968('0x57')](_0x22bf6d['query'],_0x5b796e[_0xb968('0x3d')]));if(_0x22bf6d[_0xb968('0x3c')][_0xb968('0x47')]){_0x16737a[_0xb968('0x46')]=_['merge'](_0x16737a['where'],{'$or':_[_0xb968('0x37')](_0x16737a[_0xb968('0x3f')],function(_0x3ab50a){var _0x53c6ff={};_0x53c6ff[_0x3ab50a]={'$like':'%'+_0x22bf6d[_0xb968('0x3c')][_0xb968('0x47')]+'%'};return _0x53c6ff;})});}_0x16737a=_['merge']({},_0x16737a,_0x22bf6d[_0xb968('0x4a')]);return _0x4dec36[_0xb968('0x5a')](_0x16737a);}})[_0xb968('0x1f')](function(_0x4e8ada){if(_0x4e8ada){_0x9975f3=_0x4e8ada[_0xb968('0x42')];if(!_0x22bf6d[_0xb968('0x3c')][_0xb968('0x43')]('nolimit')){_0x16737a[_0xb968('0x2f')]=qs[_0xb968('0x2f')](_0x22bf6d[_0xb968('0x3c')]['limit']);_0x16737a[_0xb968('0x2e')]=qs[_0xb968('0x2e')](_0x22bf6d[_0xb968('0x3c')][_0xb968('0x2e')]);}return _0x4dec36[_0xb968('0x5a')](_0x16737a);}})['then'](function(_0x483bd4){if(_0x483bd4){return _0x483bd4?{'count':_0x9975f3,'rows':_0x483bd4}:null;}})[_0xb968('0x1f')](respondWithResult(_0xd9ade2,null))[_0xb968('0x29')](handleError(_0xd9ade2,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 55ac752..197a8af 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 _0x4a28=['request-promise','path','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','define','lodash','util','../../config/logger','api','moment'];(function(_0x17a764,_0x113740){var _0x8de701=function(_0x3e1f49){while(--_0x3e1f49){_0x17a764['push'](_0x17a764['shift']());}};_0x8de701(++_0x113740);}(_0x4a28,0xaf));var _0x84a2=function(_0x5930c1,_0xa26ab2){_0x5930c1=_0x5930c1-0x0;var _0x5a30d4=_0x4a28[_0x5930c1];return _0x5a30d4;};'use strict';var _=require(_0x84a2('0x0'));var util=require(_0x84a2('0x1'));var logger=require(_0x84a2('0x2'))(_0x84a2('0x3'));var moment=require(_0x84a2('0x4'));var BPromise=require('bluebird');var rp=require(_0x84a2('0x5'));var fs=require('fs');var path=require(_0x84a2('0x6'));var rimraf=require(_0x84a2('0x7'));var config=require(_0x84a2('0x8'));var attributes=require(_0x84a2('0x9'));module[_0x84a2('0xa')]=function(_0x2296f6,_0x5b1048){return _0x2296f6[_0x84a2('0xb')]('ServicenowConfiguration',attributes,{'tableName':'int_servicenow_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf492=['api','bluebird','request-promise','path','rimraf','./intServicenowConfiguration.attributes','exports','define','int_servicenow_configurations','lodash','util','../../config/logger'];(function(_0x372515,_0xdd11f){var _0xa3bf4e=function(_0x212cc8){while(--_0x212cc8){_0x372515['push'](_0x372515['shift']());}};_0xa3bf4e(++_0xdd11f);}(_0xf492,0x189));var _0x2f49=function(_0x14dbf4,_0x23d996){_0x14dbf4=_0x14dbf4-0x0;var _0x4986a1=_0xf492[_0x14dbf4];return _0x4986a1;};'use strict';var _=require(_0x2f49('0x0'));var util=require(_0x2f49('0x1'));var logger=require(_0x2f49('0x2'))(_0x2f49('0x3'));var moment=require('moment');var BPromise=require(_0x2f49('0x4'));var rp=require(_0x2f49('0x5'));var fs=require('fs');var path=require(_0x2f49('0x6'));var rimraf=require(_0x2f49('0x7'));var config=require('../../config/environment');var attributes=require(_0x2f49('0x8'));module[_0x2f49('0x9')]=function(_0x77fff1,_0x5ac322){return _0x77fff1[_0x2f49('0xa')]('ServicenowConfiguration',attributes,{'tableName':_0x2f49('0xb'),'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 7bfea7f..44db5a5 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 _0x54f9=['../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x546396,_0x2c9c88){var _0x2bff38=function(_0xfba240){while(--_0xfba240){_0x546396['push'](_0x546396['shift']());}};_0x2bff38(++_0x2c9c88);}(_0x54f9,0x18a));var _0x954f=function(_0x316b74,_0x4440f3){_0x316b74=_0x316b74-0x0;var _0x4c7c94=_0x54f9[_0x316b74];return _0x4c7c94;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x954f('0x0'));var BPromise=require(_0x954f('0x1'));var rs=require(_0x954f('0x2'));var fs=require('fs');var Redis=require(_0x954f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x954f('0x4'));var logger=require(_0x954f('0x5'))('rpc');var config=require(_0x954f('0x6'));var jayson=require(_0x954f('0x7'));var client=jayson[_0x954f('0x8')][_0x954f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x22544c,_0x5c1e82,_0x1a5162){return new BPromise(function(_0x30abbc,_0x56cdc9){return client[_0x954f('0xa')](_0x22544c,_0x1a5162)[_0x954f('0xb')](function(_0x1fcc46){logger[_0x954f('0xc')](_0x954f('0xd'),_0x5c1e82,_0x954f('0xe'));logger[_0x954f('0xf')](_0x954f('0x10'),_0x5c1e82,_0x954f('0xe'),JSON[_0x954f('0x11')](_0x1fcc46));if(_0x1fcc46['error']){if(_0x1fcc46['error']['code']===0x1f4){logger[_0x954f('0x12')](_0x954f('0xd'),_0x5c1e82,_0x1fcc46[_0x954f('0x12')][_0x954f('0x13')]);return _0x56cdc9(_0x1fcc46[_0x954f('0x12')]['message']);}logger[_0x954f('0x12')]('ServicenowConfiguration,\x20%s,\x20%s',_0x5c1e82,_0x1fcc46[_0x954f('0x12')]['message']);return _0x30abbc(_0x1fcc46[_0x954f('0x12')][_0x954f('0x13')]);}else{logger['info']('ServicenowConfiguration,\x20%s,\x20%s',_0x5c1e82,_0x954f('0xe'));_0x30abbc(_0x1fcc46[_0x954f('0x14')]['message']);}})['catch'](function(_0x21a40a){logger[_0x954f('0x12')](_0x954f('0xd'),_0x5c1e82,_0x21a40a);_0x56cdc9(_0x21a40a);});});} \ No newline at end of file +var _0x1b39=['client','http','then','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','ServicenowConfiguration,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise'];(function(_0x1fe79b,_0x3e0f78){var _0x47cd82=function(_0xf5dbc5){while(--_0xf5dbc5){_0x1fe79b['push'](_0x1fe79b['shift']());}};_0x47cd82(++_0x3e0f78);}(_0x1b39,0x10a));var _0x91b3=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x1b39[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x91b3('0x0'));var util=require(_0x91b3('0x1'));var moment=require(_0x91b3('0x2'));var BPromise=require(_0x91b3('0x3'));var rs=require(_0x91b3('0x4'));var fs=require('fs');var Redis=require(_0x91b3('0x5'));var db=require(_0x91b3('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x91b3('0x7'))('rpc');var config=require(_0x91b3('0x8'));var jayson=require(_0x91b3('0x9'));var client=jayson[_0x91b3('0xa')][_0x91b3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1eafb9,_0x3b6e8f,_0x382200){return new BPromise(function(_0x564fd8,_0x1135f9){return client['request'](_0x1eafb9,_0x382200)[_0x91b3('0xc')](function(_0x3792a2){logger['info']('ServicenowConfiguration,\x20%s,\x20%s',_0x3b6e8f,_0x91b3('0xd'));logger[_0x91b3('0xe')](_0x91b3('0xf'),_0x3b6e8f,_0x91b3('0xd'),JSON[_0x91b3('0x10')](_0x3792a2));if(_0x3792a2[_0x91b3('0x11')]){if(_0x3792a2[_0x91b3('0x11')]['code']===0x1f4){logger[_0x91b3('0x11')](_0x91b3('0x12'),_0x3b6e8f,_0x3792a2[_0x91b3('0x11')]['message']);return _0x1135f9(_0x3792a2[_0x91b3('0x11')][_0x91b3('0x13')]);}logger['error'](_0x91b3('0x12'),_0x3b6e8f,_0x3792a2[_0x91b3('0x11')]['message']);return _0x564fd8(_0x3792a2[_0x91b3('0x11')][_0x91b3('0x13')]);}else{logger[_0x91b3('0x14')](_0x91b3('0x12'),_0x3b6e8f,_0x91b3('0xd'));_0x564fd8(_0x3792a2[_0x91b3('0x15')][_0x91b3('0x13')]);}})[_0x91b3('0x16')](function(_0x1db536){logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x3b6e8f,_0x1db536);_0x1135f9(_0x1db536);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 3ad1a01..526fbc0 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 _0x24f7=['./intServicenowField.controller','isAuthenticated','index','get','/:id','post','put','update','delete','destroy','multer','util','path','Router','../../components/auth/service','../../config/environment'];(function(_0x240901,_0x4b5d01){var _0x226b18=function(_0x4da658){while(--_0x4da658){_0x240901['push'](_0x240901['shift']());}};_0x226b18(++_0x4b5d01);}(_0x24f7,0x9a));var _0x724f=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x24f7[_0x21a9d9];return _0x46adce;};'use strict';var multer=require(_0x724f('0x0'));var util=require(_0x724f('0x1'));var path=require(_0x724f('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x724f('0x3')]();var auth=require(_0x724f('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x724f('0x5'));var controller=require(_0x724f('0x6'));router['get']('/',auth[_0x724f('0x7')](),controller[_0x724f('0x8')]);router[_0x724f('0x9')](_0x724f('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x724f('0xb')]('/',auth[_0x724f('0x7')](),controller['create']);router[_0x724f('0xc')](_0x724f('0xa'),auth[_0x724f('0x7')](),controller[_0x724f('0xd')]);router[_0x724f('0xe')](_0x724f('0xa'),auth[_0x724f('0x7')](),controller[_0x724f('0xf')]);module['exports']=router; \ No newline at end of file +var _0xaa54=['util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./intServicenowField.controller','isAuthenticated','index','get','/:id','post','create','put','update','destroy','exports','multer'];(function(_0xce5fcd,_0x4e579c){var _0x462001=function(_0xf57b80){while(--_0xf57b80){_0xce5fcd['push'](_0xce5fcd['shift']());}};_0x462001(++_0x4e579c);}(_0xaa54,0xfb));var _0x4aa5=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0xaa54[_0xbd08b4];return _0x314f1e;};'use strict';var multer=require(_0x4aa5('0x0'));var util=require(_0x4aa5('0x1'));var path=require(_0x4aa5('0x2'));var timeout=require(_0x4aa5('0x3'));var express=require('express');var router=express[_0x4aa5('0x4')]();var auth=require(_0x4aa5('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4aa5('0x6'));var controller=require(_0x4aa5('0x7'));router['get']('/',auth[_0x4aa5('0x8')](),controller[_0x4aa5('0x9')]);router[_0x4aa5('0xa')](_0x4aa5('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x4aa5('0xc')]('/',auth[_0x4aa5('0x8')](),controller[_0x4aa5('0xd')]);router[_0x4aa5('0xe')]('/:id',auth[_0x4aa5('0x8')](),controller[_0x4aa5('0xf')]);router['delete'](_0x4aa5('0xb'),auth[_0x4aa5('0x8')](),controller[_0x4aa5('0x10')]);module[_0x4aa5('0x11')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index f31a679..9bc2890 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 _0xf81b=['ENUM','customVariable','BOOLEAN','sequelize','exports','string','variable','keyValue','STRING'];(function(_0xf0cf28,_0x1a5fe2){var _0x2d367d=function(_0x57362f){while(--_0x57362f){_0xf0cf28['push'](_0xf0cf28['shift']());}};_0x2d367d(++_0x1a5fe2);}(_0xf81b,0x81));var _0xbf81=function(_0x429af2,_0x206ce7){_0x429af2=_0x429af2-0x0;var _0x1866f6=_0xf81b[_0x429af2];return _0x1866f6;};'use strict';var Sequelize=require(_0xbf81('0x0'));module[_0xbf81('0x1')]={'type':{'type':Sequelize['ENUM'](_0xbf81('0x2'),_0xbf81('0x3'),'customVariable',_0xbf81('0x4')),'defaultValue':_0xbf81('0x2')},'content':{'type':Sequelize[_0xbf81('0x5')]},'key':{'type':Sequelize[_0xbf81('0x5')]},'keyType':{'type':Sequelize[_0xbf81('0x6')](_0xbf81('0x2'),_0xbf81('0x3'),_0xbf81('0x7'))},'keyContent':{'type':Sequelize[_0xbf81('0x5')]},'idField':{'type':Sequelize[_0xbf81('0x5')]},'nameField':{'type':Sequelize[_0xbf81('0x5')]},'customField':{'type':Sequelize[_0xbf81('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xbf81('0x5')]}}; \ No newline at end of file +var _0x8d7f=['BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue','STRING'];(function(_0x1956c9,_0x2ad6b4){var _0x499d4=function(_0x2fa03f){while(--_0x2fa03f){_0x1956c9['push'](_0x1956c9['shift']());}};_0x499d4(++_0x2ad6b4);}(_0x8d7f,0x1a8));var _0xf8d7=function(_0x381dc5,_0x46d646){_0x381dc5=_0x381dc5-0x0;var _0x1af70e=_0x8d7f[_0x381dc5];return _0x1af70e;};'use strict';var Sequelize=require(_0xf8d7('0x0'));module[_0xf8d7('0x1')]={'type':{'type':Sequelize[_0xf8d7('0x2')](_0xf8d7('0x3'),_0xf8d7('0x4'),_0xf8d7('0x5'),_0xf8d7('0x6')),'defaultValue':_0xf8d7('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xf8d7('0x2')]('string',_0xf8d7('0x4'),_0xf8d7('0x5'))},'keyContent':{'type':Sequelize[_0xf8d7('0x7')]},'idField':{'type':Sequelize[_0xf8d7('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xf8d7('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf8d7('0x7')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index eaa46a7..3a2beb8 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 _0x5dcf=['mustache','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','reject','save','update','then','destroy','stack','name','send','index','ServicenowField','rawAttributes','fieldName','type','key','model','map','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','filters','pick','filter','where','merge','VIRTUAL','options','count','findAll','rows','catch','keys','length','includeAll','include','find','create','body','params','html-pdf','eml-format','fast-json-patch','request-promise','bluebird'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5dcf,0xd9));var _0xf5dc=function(_0x18f63c,_0x32fcfc){_0x18f63c=_0x18f63c-0x0;var _0x2f3b17=_0x5dcf[_0x18f63c];return _0x2f3b17;};'use strict';var pdf=require(_0xf5dc('0x0'));var emlformat=require(_0xf5dc('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf5dc('0x2'));var rp=require(_0xf5dc('0x3'));var moment=require('moment');var BPromise=require(_0xf5dc('0x4'));var Mustache=require(_0xf5dc('0x5'));var util=require('util');var path=require(_0xf5dc('0x6'));var sox=require('sox');var csv=require(_0xf5dc('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xf5dc('0x8'));var squel=require(_0xf5dc('0x9'));var crypto=require(_0xf5dc('0xa'));var jsforce=require(_0xf5dc('0xb'));var deskjs=require(_0xf5dc('0xc'));var toCsv=require('to-csv');var querystring=require(_0xf5dc('0xd'));var Papa=require(_0xf5dc('0xe'));var Redis=require(_0xf5dc('0xf'));var authService=require(_0xf5dc('0x10'));var qs=require(_0xf5dc('0x11'));var as=require(_0xf5dc('0x12'));var hardwareService=require(_0xf5dc('0x13'));var logger=require(_0xf5dc('0x14'))(_0xf5dc('0x15'));var utils=require(_0xf5dc('0x16'));var config=require(_0xf5dc('0x17'));var db=require(_0xf5dc('0x18'))['db'];function respondWithStatusCode(_0x3c4974,_0x3fca61){_0x3fca61=_0x3fca61||0xcc;return function(_0x1f6fa8){if(_0x1f6fa8){return _0x3c4974[_0xf5dc('0x19')](_0x3fca61);}return _0x3c4974[_0xf5dc('0x1a')](_0x3fca61)[_0xf5dc('0x1b')]();};}function respondWithResult(_0x4864d8,_0x9d846e){_0x9d846e=_0x9d846e||0xc8;return function(_0x1685b7){if(_0x1685b7){return _0x4864d8[_0xf5dc('0x1a')](_0x9d846e)[_0xf5dc('0x1c')](_0x1685b7);}};}function respondWithFilteredResult(_0x66b97a,_0x21741a){return function(_0x19f854){if(_0x19f854){var _0x150931=_0x19f854['count'],_0x466f93=_0x21741a[_0xf5dc('0x1d')],_0x1490a0=_0x21741a[_0xf5dc('0x1d')]+_0x21741a[_0xf5dc('0x1e')],_0x576bb3;if(_0x1490a0>=_0x150931){_0x1490a0=_0x150931;_0x576bb3=0xc8;}else{_0x576bb3=0xce;}_0x66b97a[_0xf5dc('0x1a')](_0x576bb3);return _0x66b97a[_0xf5dc('0x1f')]('Content-Range',_0x466f93+'-'+_0x1490a0+'/'+_0x150931)[_0xf5dc('0x1c')](_0x19f854);}return null;};}function patchUpdates(_0x1b8355){return function(_0x44c8f2){try{jsonpatch['apply'](_0x44c8f2,_0x1b8355,!![]);}catch(_0x3df013){return BPromise[_0xf5dc('0x20')](_0x3df013);}return _0x44c8f2[_0xf5dc('0x21')]();};}function saveUpdates(_0x2db92f,_0x40eaed){return function(_0x1505aa){if(_0x1505aa){return _0x1505aa[_0xf5dc('0x22')](_0x2db92f)[_0xf5dc('0x23')](function(_0x2cd770){return _0x2cd770;});}return null;};}function removeEntity(_0x5b41ec,_0x1926df){return function(_0x42aa5b){if(_0x42aa5b){return _0x42aa5b[_0xf5dc('0x24')]()['then'](function(){_0x5b41ec[_0xf5dc('0x1a')](0xcc)[_0xf5dc('0x1b')]();});}};}function handleEntityNotFound(_0x2c59dc,_0x651e8f){return function(_0x48467a){if(!_0x48467a){_0x2c59dc[_0xf5dc('0x19')](0x194);}return _0x48467a;};}function handleError(_0x11154d,_0x3a9cd2){_0x3a9cd2=_0x3a9cd2||0x1f4;return function(_0x4e1ebf){logger['error'](_0x4e1ebf[_0xf5dc('0x25')]);if(_0x4e1ebf[_0xf5dc('0x26')]){delete _0x4e1ebf['name'];}_0x11154d[_0xf5dc('0x1a')](_0x3a9cd2)[_0xf5dc('0x27')](_0x4e1ebf);};}exports[_0xf5dc('0x28')]=function(_0x4b74b5,_0xf3c4b8){var _0x476258={},_0x299dcc={},_0x379e7e={'count':0x0,'rows':[]};var _0xf76b03=_['map'](db[_0xf5dc('0x29')][_0xf5dc('0x2a')],function(_0x24fe94){return{'name':_0x24fe94[_0xf5dc('0x2b')],'type':_0x24fe94[_0xf5dc('0x2c')][_0xf5dc('0x2d')]};});_0x299dcc[_0xf5dc('0x2e')]=_[_0xf5dc('0x2f')](_0xf76b03,_0xf5dc('0x26'));_0x299dcc[_0xf5dc('0x30')]=_['keys'](_0x4b74b5['query']);_0x299dcc['filters']=_[_0xf5dc('0x31')](_0x299dcc[_0xf5dc('0x2e')],_0x299dcc[_0xf5dc('0x30')]);_0x476258[_0xf5dc('0x32')]=_['intersection'](_0x299dcc[_0xf5dc('0x2e')],qs[_0xf5dc('0x33')](_0x4b74b5[_0xf5dc('0x30')]['fields']));_0x476258[_0xf5dc('0x32')]=_0x476258[_0xf5dc('0x32')]['length']?_0x476258[_0xf5dc('0x32')]:_0x299dcc[_0xf5dc('0x2e')];if(!_0x4b74b5[_0xf5dc('0x30')][_0xf5dc('0x34')](_0xf5dc('0x35'))){_0x476258[_0xf5dc('0x1e')]=qs[_0xf5dc('0x1e')](_0x4b74b5[_0xf5dc('0x30')][_0xf5dc('0x1e')]);_0x476258[_0xf5dc('0x1d')]=qs[_0xf5dc('0x1d')](_0x4b74b5[_0xf5dc('0x30')]['offset']);}_0x476258[_0xf5dc('0x36')]=qs['sort'](_0x4b74b5[_0xf5dc('0x30')]['sort']);_0x476258['where']=qs[_0xf5dc('0x37')](_[_0xf5dc('0x38')](_0x4b74b5[_0xf5dc('0x30')],_0x299dcc[_0xf5dc('0x37')]));if(_0x4b74b5[_0xf5dc('0x30')][_0xf5dc('0x39')]){_0x476258[_0xf5dc('0x3a')]=_[_0xf5dc('0x3b')](_0x476258[_0xf5dc('0x3a')],{'$or':_['map'](_0xf76b03,function(_0xa7107c){if(_0xa7107c[_0xf5dc('0x2c')]!==_0xf5dc('0x3c')){var _0x237e8c={};_0x237e8c[_0xa7107c[_0xf5dc('0x26')]]={'$like':'%'+_0x4b74b5[_0xf5dc('0x30')][_0xf5dc('0x39')]+'%'};return _0x237e8c;}})});}_0x476258=_[_0xf5dc('0x3b')]({},_0x476258,_0x4b74b5[_0xf5dc('0x3d')]);var _0x54b283={'where':_0x476258[_0xf5dc('0x3a')]};return db[_0xf5dc('0x29')][_0xf5dc('0x3e')](_0x54b283)[_0xf5dc('0x23')](function(_0x25e3be){_0x379e7e[_0xf5dc('0x3e')]=_0x25e3be;if(_0x4b74b5['query']['includeAll']){_0x476258['include']=[{'all':!![]}];}return db[_0xf5dc('0x29')][_0xf5dc('0x3f')](_0x476258);})[_0xf5dc('0x23')](function(_0x4a4ae2){_0x379e7e[_0xf5dc('0x40')]=_0x4a4ae2;return _0x379e7e;})['then'](respondWithFilteredResult(_0xf3c4b8,_0x476258))[_0xf5dc('0x41')](handleError(_0xf3c4b8,null));};exports['show']=function(_0xa350b0,_0x4597d7){var _0x4a0eca={'raw':!![],'where':{'id':_0xa350b0['params']['id']}},_0x583c05={};_0x583c05[_0xf5dc('0x2e')]=_['keys'](db[_0xf5dc('0x29')]['rawAttributes']);_0x583c05['query']=_[_0xf5dc('0x42')](_0xa350b0[_0xf5dc('0x30')]);_0x583c05[_0xf5dc('0x37')]=_[_0xf5dc('0x31')](_0x583c05[_0xf5dc('0x2e')],_0x583c05[_0xf5dc('0x30')]);_0x4a0eca['attributes']=_[_0xf5dc('0x31')](_0x583c05['model'],qs['fields'](_0xa350b0[_0xf5dc('0x30')][_0xf5dc('0x33')]));_0x4a0eca[_0xf5dc('0x32')]=_0x4a0eca[_0xf5dc('0x32')][_0xf5dc('0x43')]?_0x4a0eca[_0xf5dc('0x32')]:_0x583c05[_0xf5dc('0x2e')];if(_0xa350b0[_0xf5dc('0x30')][_0xf5dc('0x44')]){_0x4a0eca[_0xf5dc('0x45')]=[{'all':!![]}];}_0x4a0eca=_[_0xf5dc('0x3b')]({},_0x4a0eca,_0xa350b0[_0xf5dc('0x3d')]);return db[_0xf5dc('0x29')][_0xf5dc('0x46')](_0x4a0eca)['then'](handleEntityNotFound(_0x4597d7,null))[_0xf5dc('0x23')](respondWithResult(_0x4597d7,null))[_0xf5dc('0x41')](handleError(_0x4597d7,null));};exports[_0xf5dc('0x47')]=function(_0x597a1f,_0x23d1f1){return db[_0xf5dc('0x29')][_0xf5dc('0x47')](_0x597a1f[_0xf5dc('0x48')],{})[_0xf5dc('0x23')](respondWithResult(_0x23d1f1,0xc9))[_0xf5dc('0x41')](handleError(_0x23d1f1,null));};exports[_0xf5dc('0x22')]=function(_0x124ac3,_0x381fdb){if(_0x124ac3[_0xf5dc('0x48')]['id']){delete _0x124ac3[_0xf5dc('0x48')]['id'];}return db[_0xf5dc('0x29')]['find']({'where':{'id':_0x124ac3[_0xf5dc('0x49')]['id']}})[_0xf5dc('0x23')](handleEntityNotFound(_0x381fdb,null))[_0xf5dc('0x23')](saveUpdates(_0x124ac3[_0xf5dc('0x48')],null))[_0xf5dc('0x23')](respondWithResult(_0x381fdb,null))[_0xf5dc('0x41')](handleError(_0x381fdb,null));};exports[_0xf5dc('0x24')]=function(_0x15829f,_0xc5b426){return db[_0xf5dc('0x29')][_0xf5dc('0x46')]({'where':{'id':_0x15829f[_0xf5dc('0x49')]['id']}})[_0xf5dc('0x23')](handleEntityNotFound(_0xc5b426,null))[_0xf5dc('0x23')](removeEntity(_0xc5b426,null))[_0xf5dc('0x41')](handleError(_0xc5b426,null));}; \ No newline at end of file +var _0x84e2=['zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset','limit','status','set','Content-Range','reject','save','update','then','destroy','error','stack','send','index','map','ServicenowField','type','model','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','html-pdf','eml-format'];(function(_0x55ade0,_0x2bffa9){var _0x2f7e46=function(_0x833c86){while(--_0x833c86){_0x55ade0['push'](_0x55ade0['shift']());}};_0x2f7e46(++_0x2bffa9);}(_0x84e2,0x166));var _0x284e=function(_0x7c0074,_0x1ffdcf){_0x7c0074=_0x7c0074-0x0;var _0x13e95b=_0x84e2[_0x7c0074];return _0x13e95b;};'use strict';var pdf=require(_0x284e('0x0'));var emlformat=require(_0x284e('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x284e('0x2'));var jsonpatch=require(_0x284e('0x3'));var rp=require(_0x284e('0x4'));var moment=require('moment');var BPromise=require(_0x284e('0x5'));var Mustache=require(_0x284e('0x6'));var util=require(_0x284e('0x7'));var path=require(_0x284e('0x8'));var sox=require(_0x284e('0x9'));var csv=require(_0x284e('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x284e('0xb'));var squel=require('squel');var crypto=require(_0x284e('0xc'));var jsforce=require(_0x284e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x284e('0xa'));var querystring=require(_0x284e('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x284e('0xf'));var as=require(_0x284e('0x10'));var hardwareService=require(_0x284e('0x11'));var logger=require(_0x284e('0x12'))(_0x284e('0x13'));var utils=require(_0x284e('0x14'));var config=require(_0x284e('0x15'));var db=require(_0x284e('0x16'))['db'];function respondWithStatusCode(_0x11f138,_0x267de5){_0x267de5=_0x267de5||0xcc;return function(_0x5bd0bc){if(_0x5bd0bc){return _0x11f138[_0x284e('0x17')](_0x267de5);}return _0x11f138['status'](_0x267de5)[_0x284e('0x18')]();};}function respondWithResult(_0x274b97,_0x11f198){_0x11f198=_0x11f198||0xc8;return function(_0x17e35f){if(_0x17e35f){return _0x274b97['status'](_0x11f198)[_0x284e('0x19')](_0x17e35f);}};}function respondWithFilteredResult(_0x3a82a2,_0x4474a3){return function(_0x9e35e3){if(_0x9e35e3){var _0x59afe9=_0x9e35e3['count'],_0x58b148=_0x4474a3[_0x284e('0x1a')],_0x4e62ce=_0x4474a3['offset']+_0x4474a3[_0x284e('0x1b')],_0x588027;if(_0x4e62ce>=_0x59afe9){_0x4e62ce=_0x59afe9;_0x588027=0xc8;}else{_0x588027=0xce;}_0x3a82a2[_0x284e('0x1c')](_0x588027);return _0x3a82a2[_0x284e('0x1d')](_0x284e('0x1e'),_0x58b148+'-'+_0x4e62ce+'/'+_0x59afe9)[_0x284e('0x19')](_0x9e35e3);}return null;};}function patchUpdates(_0x18ac26){return function(_0x300aca){try{jsonpatch['apply'](_0x300aca,_0x18ac26,!![]);}catch(_0x59cb6c){return BPromise[_0x284e('0x1f')](_0x59cb6c);}return _0x300aca[_0x284e('0x20')]();};}function saveUpdates(_0x4293e9,_0x4cf49b){return function(_0x1635b5){if(_0x1635b5){return _0x1635b5[_0x284e('0x21')](_0x4293e9)[_0x284e('0x22')](function(_0x3633c8){return _0x3633c8;});}return null;};}function removeEntity(_0x2df28e,_0x284ac4){return function(_0x3db0f3){if(_0x3db0f3){return _0x3db0f3[_0x284e('0x23')]()[_0x284e('0x22')](function(){_0x2df28e[_0x284e('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x40ac97,_0x417ae6){return function(_0x210eee){if(!_0x210eee){_0x40ac97[_0x284e('0x17')](0x194);}return _0x210eee;};}function handleError(_0x1abac6,_0x51f6ba){_0x51f6ba=_0x51f6ba||0x1f4;return function(_0x4de3e1){logger[_0x284e('0x24')](_0x4de3e1[_0x284e('0x25')]);if(_0x4de3e1['name']){delete _0x4de3e1['name'];}_0x1abac6['status'](_0x51f6ba)[_0x284e('0x26')](_0x4de3e1);};}exports[_0x284e('0x27')]=function(_0x5f5509,_0x41a594){var _0x18010e={},_0x2ff68a={},_0x32d8fa={'count':0x0,'rows':[]};var _0x347e4b=_[_0x284e('0x28')](db[_0x284e('0x29')]['rawAttributes'],function(_0xd85d79){return{'name':_0xd85d79['fieldName'],'type':_0xd85d79[_0x284e('0x2a')]['key']};});_0x2ff68a[_0x284e('0x2b')]=_['map'](_0x347e4b,_0x284e('0x2c'));_0x2ff68a[_0x284e('0x2d')]=_[_0x284e('0x2e')](_0x5f5509[_0x284e('0x2d')]);_0x2ff68a['filters']=_[_0x284e('0x2f')](_0x2ff68a[_0x284e('0x2b')],_0x2ff68a[_0x284e('0x2d')]);_0x18010e[_0x284e('0x30')]=_['intersection'](_0x2ff68a[_0x284e('0x2b')],qs[_0x284e('0x31')](_0x5f5509[_0x284e('0x2d')][_0x284e('0x31')]));_0x18010e[_0x284e('0x30')]=_0x18010e[_0x284e('0x30')][_0x284e('0x32')]?_0x18010e[_0x284e('0x30')]:_0x2ff68a[_0x284e('0x2b')];if(!_0x5f5509[_0x284e('0x2d')][_0x284e('0x33')]('nolimit')){_0x18010e[_0x284e('0x1b')]=qs[_0x284e('0x1b')](_0x5f5509[_0x284e('0x2d')][_0x284e('0x1b')]);_0x18010e['offset']=qs['offset'](_0x5f5509['query'][_0x284e('0x1a')]);}_0x18010e['order']=qs[_0x284e('0x34')](_0x5f5509[_0x284e('0x2d')][_0x284e('0x34')]);_0x18010e[_0x284e('0x35')]=qs[_0x284e('0x36')](_[_0x284e('0x37')](_0x5f5509[_0x284e('0x2d')],_0x2ff68a[_0x284e('0x36')]));if(_0x5f5509[_0x284e('0x2d')][_0x284e('0x38')]){_0x18010e[_0x284e('0x35')]=_[_0x284e('0x39')](_0x18010e[_0x284e('0x35')],{'$or':_[_0x284e('0x28')](_0x347e4b,function(_0x1a382e){if(_0x1a382e[_0x284e('0x2a')]!==_0x284e('0x3a')){var _0x524999={};_0x524999[_0x1a382e[_0x284e('0x2c')]]={'$like':'%'+_0x5f5509['query'][_0x284e('0x38')]+'%'};return _0x524999;}})});}_0x18010e=_['merge']({},_0x18010e,_0x5f5509[_0x284e('0x3b')]);var _0x736ec5={'where':_0x18010e['where']};return db[_0x284e('0x29')][_0x284e('0x3c')](_0x736ec5)['then'](function(_0x1876cd){_0x32d8fa[_0x284e('0x3c')]=_0x1876cd;if(_0x5f5509[_0x284e('0x2d')][_0x284e('0x3d')]){_0x18010e[_0x284e('0x3e')]=[{'all':!![]}];}return db[_0x284e('0x29')][_0x284e('0x3f')](_0x18010e);})[_0x284e('0x22')](function(_0x550393){_0x32d8fa[_0x284e('0x40')]=_0x550393;return _0x32d8fa;})[_0x284e('0x22')](respondWithFilteredResult(_0x41a594,_0x18010e))[_0x284e('0x41')](handleError(_0x41a594,null));};exports[_0x284e('0x42')]=function(_0x1fd5cb,_0x5b3196){var _0x5deecd={'raw':!![],'where':{'id':_0x1fd5cb[_0x284e('0x43')]['id']}},_0x91a841={};_0x91a841[_0x284e('0x2b')]=_[_0x284e('0x2e')](db[_0x284e('0x29')][_0x284e('0x44')]);_0x91a841[_0x284e('0x2d')]=_[_0x284e('0x2e')](_0x1fd5cb[_0x284e('0x2d')]);_0x91a841[_0x284e('0x36')]=_[_0x284e('0x2f')](_0x91a841[_0x284e('0x2b')],_0x91a841[_0x284e('0x2d')]);_0x5deecd[_0x284e('0x30')]=_[_0x284e('0x2f')](_0x91a841['model'],qs[_0x284e('0x31')](_0x1fd5cb['query'][_0x284e('0x31')]));_0x5deecd[_0x284e('0x30')]=_0x5deecd[_0x284e('0x30')][_0x284e('0x32')]?_0x5deecd[_0x284e('0x30')]:_0x91a841[_0x284e('0x2b')];if(_0x1fd5cb[_0x284e('0x2d')]['includeAll']){_0x5deecd['include']=[{'all':!![]}];}_0x5deecd=_[_0x284e('0x39')]({},_0x5deecd,_0x1fd5cb[_0x284e('0x3b')]);return db[_0x284e('0x29')][_0x284e('0x45')](_0x5deecd)[_0x284e('0x22')](handleEntityNotFound(_0x5b3196,null))[_0x284e('0x22')](respondWithResult(_0x5b3196,null))[_0x284e('0x41')](handleError(_0x5b3196,null));};exports[_0x284e('0x46')]=function(_0x41efa4,_0x26d6fa){return db[_0x284e('0x29')]['create'](_0x41efa4[_0x284e('0x47')],{})['then'](respondWithResult(_0x26d6fa,0xc9))[_0x284e('0x41')](handleError(_0x26d6fa,null));};exports[_0x284e('0x21')]=function(_0x1e802c,_0x55f51e){if(_0x1e802c[_0x284e('0x47')]['id']){delete _0x1e802c[_0x284e('0x47')]['id'];}return db[_0x284e('0x29')][_0x284e('0x45')]({'where':{'id':_0x1e802c[_0x284e('0x43')]['id']}})[_0x284e('0x22')](handleEntityNotFound(_0x55f51e,null))['then'](saveUpdates(_0x1e802c[_0x284e('0x47')],null))[_0x284e('0x22')](respondWithResult(_0x55f51e,null))[_0x284e('0x41')](handleError(_0x55f51e,null));};exports['destroy']=function(_0x39c5c5,_0xbdc0c7){return db['ServicenowField']['find']({'where':{'id':_0x39c5c5[_0x284e('0x43')]['id']}})[_0x284e('0x22')](handleEntityNotFound(_0xbdc0c7,null))[_0x284e('0x22')](removeEntity(_0xbdc0c7,null))[_0x284e('0x41')](handleError(_0xbdc0c7,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 7e0338a..5e50834 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 _0xe532=['ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','lodash','util','api','moment','path','rimraf','../../config/environment','./intServicenowField.attributes','exports','define'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0xe532,0x1a8));var _0x2e53=function(_0x504df1,_0x289598){_0x504df1=_0x504df1-0x0;var _0x1063b5=_0xe532[_0x504df1];return _0x1063b5;};'use strict';var _=require(_0x2e53('0x0'));var util=require(_0x2e53('0x1'));var logger=require('../../config/logger')(_0x2e53('0x2'));var moment=require(_0x2e53('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2e53('0x4'));var rimraf=require(_0x2e53('0x5'));var config=require(_0x2e53('0x6'));var attributes=require(_0x2e53('0x7'));module[_0x2e53('0x8')]=function(_0x23f5b9,_0x6bc728){return _0x23f5b9[_0x2e53('0x9')](_0x2e53('0xa'),attributes,{'tableName':_0x2e53('0xb'),'paranoid':![],'indexes':[{'name':_0x2e53('0xc'),'fields':[_0x2e53('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf8e0=['rimraf','exports','define','ServicenowField','int_servicenow_fields','api','moment','bluebird','path'];(function(_0x55f459,_0x20bcad){var _0x3c6690=function(_0x55a0ba){while(--_0x55a0ba){_0x55f459['push'](_0x55f459['shift']());}};_0x3c6690(++_0x20bcad);}(_0xf8e0,0x1e2));var _0x0f8e=function(_0xa3f414,_0xe9c077){_0xa3f414=_0xa3f414-0x0;var _0x17263f=_0xf8e0[_0xa3f414];return _0x17263f;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x0f8e('0x0'));var moment=require(_0x0f8e('0x1'));var BPromise=require(_0x0f8e('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0f8e('0x3'));var rimraf=require(_0x0f8e('0x4'));var config=require('../../config/environment');var attributes=require('./intServicenowField.attributes');module[_0x0f8e('0x5')]=function(_0x1deb89,_0x54a053){return _0x1deb89[_0x0f8e('0x6')](_0x0f8e('0x7'),attributes,{'tableName':_0x0f8e('0x8'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.rpc.js b/server/api/intServicenowField/intServicenowField.rpc.js index c065bd7..8fe07ec 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 _0xba13=['info','ServicenowField,\x20%s,\x20%s','debug','ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x4a2752,_0x31ed0e){var _0x380819=function(_0x4b6ba8){while(--_0x4b6ba8){_0x4a2752['push'](_0x4a2752['shift']());}};_0x380819(++_0x31ed0e);}(_0xba13,0x135));var _0x3ba1=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0xba13[_0x45d55e];return _0x29812a;};'use strict';var _=require(_0x3ba1('0x0'));var util=require('util');var moment=require(_0x3ba1('0x1'));var BPromise=require(_0x3ba1('0x2'));var rs=require(_0x3ba1('0x3'));var fs=require('fs');var Redis=require(_0x3ba1('0x4'));var db=require(_0x3ba1('0x5'))['db'];var utils=require(_0x3ba1('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x3ba1('0x7'));var jayson=require(_0x3ba1('0x8'));var client=jayson[_0x3ba1('0x9')][_0x3ba1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x55a7ae,_0x144b85,_0x3266d0){return new BPromise(function(_0x25fa63,_0x3c0756){return client[_0x3ba1('0xb')](_0x55a7ae,_0x3266d0)[_0x3ba1('0xc')](function(_0x1d9f83){logger[_0x3ba1('0xd')](_0x3ba1('0xe'),_0x144b85,'request\x20sent');logger[_0x3ba1('0xf')](_0x3ba1('0x10'),_0x144b85,_0x3ba1('0x11'),JSON[_0x3ba1('0x12')](_0x1d9f83));if(_0x1d9f83[_0x3ba1('0x13')]){if(_0x1d9f83[_0x3ba1('0x13')][_0x3ba1('0x14')]===0x1f4){logger[_0x3ba1('0x13')](_0x3ba1('0xe'),_0x144b85,_0x1d9f83[_0x3ba1('0x13')][_0x3ba1('0x15')]);return _0x3c0756(_0x1d9f83[_0x3ba1('0x13')][_0x3ba1('0x15')]);}logger['error'](_0x3ba1('0xe'),_0x144b85,_0x1d9f83[_0x3ba1('0x13')]['message']);return _0x25fa63(_0x1d9f83[_0x3ba1('0x13')][_0x3ba1('0x15')]);}else{logger['info'](_0x3ba1('0xe'),_0x144b85,_0x3ba1('0x11'));_0x25fa63(_0x1d9f83['result']['message']);}})[_0x3ba1('0x16')](function(_0x4ef171){logger[_0x3ba1('0x13')](_0x3ba1('0xe'),_0x144b85,_0x4ef171);_0x3c0756(_0x4ef171);});});} \ No newline at end of file +var _0x96f4=['message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','request','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0x96f4,0x1e2));var _0x496f=function(_0x207a02,_0x278c56){_0x207a02=_0x207a02-0x0;var _0xd995c3=_0x96f4[_0x207a02];return _0xd995c3;};'use strict';var _=require(_0x496f('0x0'));var util=require(_0x496f('0x1'));var moment=require(_0x496f('0x2'));var BPromise=require('bluebird');var rs=require(_0x496f('0x3'));var fs=require('fs');var Redis=require(_0x496f('0x4'));var db=require(_0x496f('0x5'))['db'];var utils=require(_0x496f('0x6'));var logger=require(_0x496f('0x7'))(_0x496f('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1f4204,_0xf01dc3,_0x5e4172){return new BPromise(function(_0x39c65f,_0x168125){return client[_0x496f('0x9')](_0x1f4204,_0x5e4172)[_0x496f('0xa')](function(_0x53fece){logger[_0x496f('0xb')](_0x496f('0xc'),_0xf01dc3,_0x496f('0xd'));logger[_0x496f('0xe')]('ServicenowField,\x20%s,\x20%s,\x20%s',_0xf01dc3,_0x496f('0xd'),JSON[_0x496f('0xf')](_0x53fece));if(_0x53fece[_0x496f('0x10')]){if(_0x53fece['error'][_0x496f('0x11')]===0x1f4){logger[_0x496f('0x10')](_0x496f('0xc'),_0xf01dc3,_0x53fece[_0x496f('0x10')][_0x496f('0x12')]);return _0x168125(_0x53fece[_0x496f('0x10')][_0x496f('0x12')]);}logger[_0x496f('0x10')](_0x496f('0xc'),_0xf01dc3,_0x53fece[_0x496f('0x10')][_0x496f('0x12')]);return _0x39c65f(_0x53fece[_0x496f('0x10')]['message']);}else{logger[_0x496f('0xb')](_0x496f('0xc'),_0xf01dc3,_0x496f('0xd'));_0x39c65f(_0x53fece[_0x496f('0x13')][_0x496f('0x12')]);}})['catch'](function(_0x4b2b55){logger['error'](_0x496f('0xc'),_0xf01dc3,_0x4b2b55);_0x168125(_0x4b2b55);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 9f6c9ba..d7f14fb 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 _0xf5e8=['get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','put','update','delete','exports','util','connect-timeout','express','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller'];(function(_0x3eaf8d,_0x591eab){var _0x481f5b=function(_0x397e89){while(--_0x397e89){_0x3eaf8d['push'](_0x3eaf8d['shift']());}};_0x481f5b(++_0x591eab);}(_0xf5e8,0x1b3));var _0x8f5e=function(_0x474c66,_0xbce925){_0x474c66=_0x474c66-0x0;var _0xcbd9bf=_0xf5e8[_0x474c66];return _0xcbd9bf;};'use strict';var multer=require('multer');var util=require(_0x8f5e('0x0'));var path=require('path');var timeout=require(_0x8f5e('0x1'));var express=require(_0x8f5e('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x8f5e('0x3'));var config=require(_0x8f5e('0x4'));var controller=require(_0x8f5e('0x5'));router[_0x8f5e('0x6')]('/',auth[_0x8f5e('0x7')](),controller[_0x8f5e('0x8')]);router[_0x8f5e('0x6')](_0x8f5e('0x9'),auth[_0x8f5e('0x7')](),controller[_0x8f5e('0xa')]);router[_0x8f5e('0x6')](_0x8f5e('0xb'),auth[_0x8f5e('0x7')](),controller[_0x8f5e('0xc')]);router[_0x8f5e('0x6')]('/:id/fields',auth[_0x8f5e('0x7')](),controller[_0x8f5e('0xd')]);router[_0x8f5e('0xe')]('/',auth[_0x8f5e('0x7')](),controller[_0x8f5e('0xf')]);router['post'](_0x8f5e('0xb'),auth[_0x8f5e('0x7')](),controller[_0x8f5e('0x10')]);router[_0x8f5e('0x11')](_0x8f5e('0x9'),auth['isAuthenticated'](),controller[_0x8f5e('0x12')]);router[_0x8f5e('0x13')](_0x8f5e('0x9'),auth[_0x8f5e('0x7')](),controller['destroy']);module[_0x8f5e('0x14')]=router; \ No newline at end of file +var _0xc10e=['../../components/interaction/service','get','index','/:id','isAuthenticated','/:id/configurations','getConfigurations','getFields','post','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0xc10e,0x126));var _0xec10=function(_0x52193e,_0x5191eb){_0x52193e=_0x52193e-0x0;var _0x2ff254=_0xc10e[_0x52193e];return _0x2ff254;};'use strict';var multer=require('multer');var util=require(_0xec10('0x0'));var path=require(_0xec10('0x1'));var timeout=require(_0xec10('0x2'));var express=require(_0xec10('0x3'));var router=express[_0xec10('0x4')]();var auth=require(_0xec10('0x5'));var interaction=require(_0xec10('0x6'));var config=require('../../config/environment');var controller=require('./intSugarcrmAccount.controller');router[_0xec10('0x7')]('/',auth['isAuthenticated'](),controller[_0xec10('0x8')]);router[_0xec10('0x7')](_0xec10('0x9'),auth[_0xec10('0xa')](),controller['show']);router[_0xec10('0x7')](_0xec10('0xb'),auth[_0xec10('0xa')](),controller[_0xec10('0xc')]);router[_0xec10('0x7')]('/:id/fields',auth[_0xec10('0xa')](),controller[_0xec10('0xd')]);router[_0xec10('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xec10('0xe')](_0xec10('0xb'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0xec10('0xf')](_0xec10('0x9'),auth[_0xec10('0xa')](),controller[_0xec10('0x10')]);router[_0xec10('0x11')](_0xec10('0x9'),auth[_0xec10('0xa')](),controller[_0xec10('0x12')]);module[_0xec10('0x13')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index 7ddcc7a..2480e12 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 _0x2860=['STRING','username','sequelize','exports'];(function(_0x4a4e15,_0x565e88){var _0x53e1bf=function(_0x3654e9){while(--_0x3654e9){_0x4a4e15['push'](_0x4a4e15['shift']());}};_0x53e1bf(++_0x565e88);}(_0x2860,0x18e));var _0x0286=function(_0x5c660a,_0x4b5262){_0x5c660a=_0x5c660a-0x0;var _0x3a77a4=_0x2860[_0x5c660a];return _0x3a77a4;};'use strict';var Sequelize=require(_0x0286('0x0'));module[_0x0286('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0286('0x2')]},'username':{'type':Sequelize[_0x0286('0x2')],'unique':_0x0286('0x3')},'password':{'type':Sequelize[_0x0286('0x2')]},'remoteUri':{'type':Sequelize[_0x0286('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x0286('0x2')]}}; \ No newline at end of file +var _0x1154=['remoteUri','exports','STRING','username'];(function(_0x5d437b,_0x3334be){var _0x4a312f=function(_0x462e40){while(--_0x462e40){_0x5d437b['push'](_0x5d437b['shift']());}};_0x4a312f(++_0x3334be);}(_0x1154,0x131));var _0x4115=function(_0x17db71,_0xce6b13){_0x17db71=_0x17db71-0x0;var _0x5a0cf5=_0x1154[_0x17db71];return _0x5a0cf5;};'use strict';var Sequelize=require('sequelize');module[_0x4115('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4115('0x1')]},'username':{'type':Sequelize[_0x4115('0x1')],'unique':_0x4115('0x2')},'password':{'type':Sequelize[_0x4115('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x4115('0x3')},'serverUrl':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js index 7e931f3..d49c9cc 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 _0x80af=['getConfigurations','findOne','SugarcrmConfiguration','addConfiguration','AccountId','getSubjects','Descriptions','getDescriptions','SugarcrmField','Subjects','assigned_user_id','created_by','date_start','duration_hours','parent_id','parent_name','direction','username','password','slice','substring','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','JSON','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','get_module_fields','stringify','Calls','values','module_fields','includes','endsWith','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','Sequelize','ValidationError','request','then','info','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','error','SugarcrmAccount,\x20%s,\x20%s','message','catch','status','end','count','offset','set','Content-Range','json','apply','reject','save','update','destroy','stack','name','send','index','SugarcrmAccount','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','pick','merge','VIRTUAL','filter','options','where','includeAll','findAll','show','params','find','create','body'];(function(_0x2f6f50,_0x1d21a7){var _0x2cf365=function(_0x1c40a7){while(--_0x1c40a7){_0x2f6f50['push'](_0x2f6f50['shift']());}};_0x2cf365(++_0x1d21a7);}(_0x80af,0x12a));var _0xf80a=function(_0x302b3c,_0x59e611){_0x302b3c=_0x302b3c-0x0;var _0x5e2c76=_0x80af[_0x302b3c];return _0x5e2c76;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf80a('0x0'));var rimraf=require(_0xf80a('0x1'));var zipdir=require(_0xf80a('0x2'));var jsonpatch=require(_0xf80a('0x3'));var rp=require('request-promise');var moment=require(_0xf80a('0x4'));var BPromise=require(_0xf80a('0x5'));var Mustache=require(_0xf80a('0x6'));var util=require(_0xf80a('0x7'));var path=require(_0xf80a('0x8'));var sox=require('sox');var csv=require(_0xf80a('0x9'));var ejs=require(_0xf80a('0xa'));var fs=require('fs');var _=require(_0xf80a('0xb'));var squel=require(_0xf80a('0xc'));var crypto=require(_0xf80a('0xd'));var jsforce=require(_0xf80a('0xe'));var deskjs=require(_0xf80a('0xf'));var toCsv=require(_0xf80a('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf80a('0x10'));var authService=require(_0xf80a('0x11'));var qs=require(_0xf80a('0x12'));var as=require(_0xf80a('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xf80a('0x14'));var config=require('../../config/environment');var db=require(_0xf80a('0x15'))['db'];var integrations=require(_0xf80a('0x16'));var jayson=require(_0xf80a('0x17'));var client=jayson[_0xf80a('0x18')][_0xf80a('0x19')]({'port':0x232a});function checkPasswordPattern(_0x4664f1,_0x49eb9d,_0x222d54){if(_0x222d54){var _0x110b97=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x110b97['test'](_0x49eb9d)){return _0x4664f1;}else{throw new db[(_0xf80a('0x1a'))][(_0xf80a('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 _0x4664f1;}}function respondWithRpcPromise(_0x166844,_0xb99a66,_0x50603d,_0x1eb772){return new BPromise(function(_0x258021,_0x5f2bcd){var _0x44e5dc=_0x1eb772||client;return _0x44e5dc[_0xf80a('0x1c')](_0x166844,_0x50603d)[_0xf80a('0x1d')](function(_0xceb62c){logger[_0xf80a('0x1e')]('SugarcrmAccount,\x20%s,\x20%s',_0xb99a66,_0xf80a('0x1f'));logger[_0xf80a('0x20')](_0xf80a('0x21'),_0xb99a66,'request\x20sent',JSON['stringify'](_0xceb62c));if(_0xceb62c[_0xf80a('0x22')]){if(_0xceb62c[_0xf80a('0x22')]['code']===0x1f4){logger[_0xf80a('0x22')](_0xf80a('0x23'),_0xb99a66,_0xceb62c[_0xf80a('0x22')][_0xf80a('0x24')]);return _0x5f2bcd(_0xceb62c[_0xf80a('0x22')]['message']);}logger['error'](_0xf80a('0x23'),_0xb99a66,_0xceb62c[_0xf80a('0x22')][_0xf80a('0x24')]);return _0x258021(_0xceb62c[_0xf80a('0x22')][_0xf80a('0x24')]);}else{logger['info']('SugarcrmAccount,\x20%s,\x20%s',_0xb99a66,'request\x20sent');_0x258021(_0xceb62c['result'][_0xf80a('0x24')]);}})[_0xf80a('0x25')](function(_0x3ef1ca){logger[_0xf80a('0x22')](_0xf80a('0x23'),_0xb99a66,_0x3ef1ca);_0x5f2bcd(_0x3ef1ca);});});}function respondWithStatusCode(_0x1eafa1,_0x16c220){_0x16c220=_0x16c220||0xcc;return function(_0x45cec0){if(_0x45cec0){return _0x1eafa1['sendStatus'](_0x16c220);}return _0x1eafa1[_0xf80a('0x26')](_0x16c220)[_0xf80a('0x27')]();};}function respondWithResult(_0xce02ba,_0x1d9a29){_0x1d9a29=_0x1d9a29||0xc8;return function(_0x3141b0){if(_0x3141b0){return _0xce02ba[_0xf80a('0x26')](_0x1d9a29)['json'](_0x3141b0);}};}function respondWithFilteredResult(_0xb27d38,_0x1cd8be){return function(_0x3df43a){if(_0x3df43a){var _0x346b78=_0x3df43a[_0xf80a('0x28')],_0x71a489=_0x1cd8be['offset'],_0x124cdf=_0x1cd8be[_0xf80a('0x29')]+_0x1cd8be['limit'],_0x594872;if(_0x124cdf>=_0x346b78){_0x124cdf=_0x346b78;_0x594872=0xc8;}else{_0x594872=0xce;}_0xb27d38[_0xf80a('0x26')](_0x594872);return _0xb27d38[_0xf80a('0x2a')](_0xf80a('0x2b'),_0x71a489+'-'+_0x124cdf+'/'+_0x346b78)[_0xf80a('0x2c')](_0x3df43a);}return null;};}function patchUpdates(_0x318f77){return function(_0x4e3855){try{jsonpatch[_0xf80a('0x2d')](_0x4e3855,_0x318f77,!![]);}catch(_0x49536c){return BPromise[_0xf80a('0x2e')](_0x49536c);}return _0x4e3855[_0xf80a('0x2f')]();};}function saveUpdates(_0x10f126,_0x1a8ca6){return function(_0x325e3f){if(_0x325e3f){return _0x325e3f[_0xf80a('0x30')](_0x10f126)[_0xf80a('0x1d')](function(_0x44e0ff){return _0x44e0ff;});}return null;};}function removeEntity(_0x3367b0,_0x35a4fe){return function(_0x590b9e){if(_0x590b9e){return _0x590b9e[_0xf80a('0x31')]()[_0xf80a('0x1d')](function(){_0x3367b0['status'](0xcc)[_0xf80a('0x27')]();});}};}function handleEntityNotFound(_0x511d0c,_0x448095){return function(_0x2b7588){if(!_0x2b7588){_0x511d0c['sendStatus'](0x194);}return _0x2b7588;};}function handleError(_0x5d2423,_0x452128){_0x452128=_0x452128||0x1f4;return function(_0x56146d){logger['error'](_0x56146d[_0xf80a('0x32')]);if(_0x56146d[_0xf80a('0x33')]){delete _0x56146d['name'];}_0x5d2423[_0xf80a('0x26')](_0x452128)[_0xf80a('0x34')](_0x56146d);};}exports[_0xf80a('0x35')]=function(_0x31771a,_0x1d5375){var _0x23b258={},_0x440234={},_0x135162={'count':0x0,'rows':[]};var _0xd5a8a8=_['map'](db[_0xf80a('0x36')][_0xf80a('0x37')],function(_0x4b4b1a){return{'name':_0x4b4b1a[_0xf80a('0x38')],'type':_0x4b4b1a[_0xf80a('0x39')][_0xf80a('0x3a')]};});_0x440234[_0xf80a('0x3b')]=_[_0xf80a('0x3c')](_0xd5a8a8,_0xf80a('0x33'));_0x440234['query']=_[_0xf80a('0x3d')](_0x31771a[_0xf80a('0x3e')]);_0x440234[_0xf80a('0x3f')]=_[_0xf80a('0x40')](_0x440234[_0xf80a('0x3b')],_0x440234[_0xf80a('0x3e')]);_0x23b258['attributes']=_['intersection'](_0x440234['model'],qs[_0xf80a('0x41')](_0x31771a[_0xf80a('0x3e')][_0xf80a('0x41')]));_0x23b258[_0xf80a('0x42')]=_0x23b258[_0xf80a('0x42')][_0xf80a('0x43')]?_0x23b258['attributes']:_0x440234[_0xf80a('0x3b')];if(!_0x31771a['query'][_0xf80a('0x44')](_0xf80a('0x45'))){_0x23b258['limit']=qs[_0xf80a('0x46')](_0x31771a['query'][_0xf80a('0x46')]);_0x23b258['offset']=qs[_0xf80a('0x29')](_0x31771a['query'][_0xf80a('0x29')]);}_0x23b258[_0xf80a('0x47')]=qs[_0xf80a('0x48')](_0x31771a[_0xf80a('0x3e')]['sort']);_0x23b258['where']=qs[_0xf80a('0x3f')](_[_0xf80a('0x49')](_0x31771a[_0xf80a('0x3e')],_0x440234[_0xf80a('0x3f')]));if(_0x31771a[_0xf80a('0x3e')]['filter']){_0x23b258['where']=_[_0xf80a('0x4a')](_0x23b258['where'],{'$or':_[_0xf80a('0x3c')](_0xd5a8a8,function(_0x225f6b){if(_0x225f6b[_0xf80a('0x39')]!==_0xf80a('0x4b')){var _0x2b64fc={};_0x2b64fc[_0x225f6b[_0xf80a('0x33')]]={'$like':'%'+_0x31771a[_0xf80a('0x3e')][_0xf80a('0x4c')]+'%'};return _0x2b64fc;}})});}_0x23b258=_['merge']({},_0x23b258,_0x31771a[_0xf80a('0x4d')]);var _0x162cdc={'where':_0x23b258[_0xf80a('0x4e')]};return db['SugarcrmAccount'][_0xf80a('0x28')](_0x162cdc)[_0xf80a('0x1d')](function(_0x228a7a){_0x135162['count']=_0x228a7a;if(_0x31771a[_0xf80a('0x3e')][_0xf80a('0x4f')]){_0x23b258['include']=[{'all':!![]}];}return db['SugarcrmAccount'][_0xf80a('0x50')](_0x23b258);})[_0xf80a('0x1d')](function(_0x172f48){_0x135162['rows']=_0x172f48;return _0x135162;})[_0xf80a('0x1d')](respondWithFilteredResult(_0x1d5375,_0x23b258))[_0xf80a('0x25')](handleError(_0x1d5375,null));};exports[_0xf80a('0x51')]=function(_0x836619,_0x4d1f52){var _0x277693={'raw':![],'where':{'id':_0x836619[_0xf80a('0x52')]['id']}},_0x527eb5={};_0x527eb5[_0xf80a('0x3b')]=_['keys'](db[_0xf80a('0x36')][_0xf80a('0x37')]);_0x527eb5[_0xf80a('0x3e')]=_[_0xf80a('0x3d')](_0x836619[_0xf80a('0x3e')]);_0x527eb5[_0xf80a('0x3f')]=_[_0xf80a('0x40')](_0x527eb5['model'],_0x527eb5['query']);_0x277693[_0xf80a('0x42')]=_[_0xf80a('0x40')](_0x527eb5[_0xf80a('0x3b')],qs[_0xf80a('0x41')](_0x836619[_0xf80a('0x3e')][_0xf80a('0x41')]));_0x277693[_0xf80a('0x42')]=_0x277693[_0xf80a('0x42')][_0xf80a('0x43')]?_0x277693[_0xf80a('0x42')]:_0x527eb5[_0xf80a('0x3b')];if(_0x836619[_0xf80a('0x3e')][_0xf80a('0x4f')]){_0x277693['include']=[{'all':!![]}];}_0x277693=_['merge']({},_0x277693,_0x836619[_0xf80a('0x4d')]);return db['SugarcrmAccount'][_0xf80a('0x53')](_0x277693)[_0xf80a('0x1d')](handleEntityNotFound(_0x4d1f52,null))[_0xf80a('0x1d')](respondWithResult(_0x4d1f52,null))[_0xf80a('0x25')](handleError(_0x4d1f52,null));};exports[_0xf80a('0x54')]=function(_0x2570c4,_0x299466){return db[_0xf80a('0x36')]['create'](_0x2570c4[_0xf80a('0x55')],{})[_0xf80a('0x1d')](respondWithResult(_0x299466,0xc9))[_0xf80a('0x25')](handleError(_0x299466,null));};exports[_0xf80a('0x30')]=function(_0x5257c9,_0x4c778e){if(_0x5257c9[_0xf80a('0x55')]['id']){delete _0x5257c9[_0xf80a('0x55')]['id'];}return db[_0xf80a('0x36')][_0xf80a('0x53')]({'where':{'id':_0x5257c9[_0xf80a('0x52')]['id']}})[_0xf80a('0x1d')](handleEntityNotFound(_0x4c778e,null))['then'](saveUpdates(_0x5257c9['body'],null))[_0xf80a('0x1d')](respondWithResult(_0x4c778e,null))['catch'](handleError(_0x4c778e,null));};exports[_0xf80a('0x31')]=function(_0x1e2fd3,_0x8b4f8f){return db['SugarcrmAccount'][_0xf80a('0x53')]({'where':{'id':_0x1e2fd3['params']['id']}})[_0xf80a('0x1d')](handleEntityNotFound(_0x8b4f8f,null))[_0xf80a('0x1d')](removeEntity(_0x8b4f8f,null))[_0xf80a('0x25')](handleError(_0x8b4f8f,null));};exports[_0xf80a('0x56')]=function(_0x20847a,_0x389ca8,_0x3b1b4e){var _0x210fd8={};var _0xcf89a6={};var _0x1d8434;var _0x384d1c;return db['SugarcrmAccount'][_0xf80a('0x57')]({'where':{'id':_0x20847a[_0xf80a('0x52')]['id']}})[_0xf80a('0x1d')](handleEntityNotFound(_0x389ca8,null))[_0xf80a('0x1d')](function(_0x32fc78){if(_0x32fc78){_0x1d8434=_0x32fc78;_0xcf89a6[_0xf80a('0x3b')]=_[_0xf80a('0x3d')](db[_0xf80a('0x58')][_0xf80a('0x37')]);_0xcf89a6[_0xf80a('0x3e')]=_[_0xf80a('0x3d')](_0x20847a[_0xf80a('0x3e')]);_0xcf89a6[_0xf80a('0x3f')]=_[_0xf80a('0x40')](_0xcf89a6[_0xf80a('0x3b')],_0xcf89a6[_0xf80a('0x3e')]);_0x210fd8[_0xf80a('0x42')]=_[_0xf80a('0x40')](_0xcf89a6['model'],qs[_0xf80a('0x41')](_0x20847a[_0xf80a('0x3e')][_0xf80a('0x41')]));_0x210fd8[_0xf80a('0x42')]=_0x210fd8['attributes'][_0xf80a('0x43')]?_0x210fd8[_0xf80a('0x42')]:_0xcf89a6[_0xf80a('0x3b')];_0x210fd8['order']=qs[_0xf80a('0x48')](_0x20847a[_0xf80a('0x3e')]['sort']);_0x210fd8[_0xf80a('0x4e')]=qs['filters'](_[_0xf80a('0x49')](_0x20847a[_0xf80a('0x3e')],_0xcf89a6[_0xf80a('0x3f')]));if(_0x20847a[_0xf80a('0x3e')][_0xf80a('0x4c')]){_0x210fd8[_0xf80a('0x4e')]=_[_0xf80a('0x4a')](_0x210fd8[_0xf80a('0x4e')],{'$or':_['map'](_0x210fd8[_0xf80a('0x42')],function(_0x317da0){var _0x4e5862={};_0x4e5862[_0x317da0]={'$like':'%'+_0x20847a['query'][_0xf80a('0x4c')]+'%'};return _0x4e5862;})});}_0x210fd8=_[_0xf80a('0x4a')]({},_0x210fd8,_0x20847a['options']);return _0x1d8434[_0xf80a('0x56')](_0x210fd8);}})['then'](function(_0x30d6c7){if(_0x30d6c7){_0x384d1c=_0x30d6c7['length'];if(!_0x20847a[_0xf80a('0x3e')][_0xf80a('0x44')](_0xf80a('0x45'))){_0x210fd8['limit']=qs['limit'](_0x20847a[_0xf80a('0x3e')][_0xf80a('0x46')]);_0x210fd8[_0xf80a('0x29')]=qs['offset'](_0x20847a[_0xf80a('0x3e')]['offset']);}return _0x1d8434[_0xf80a('0x56')](_0x210fd8);}})[_0xf80a('0x1d')](function(_0x2b9736){if(_0x2b9736){return _0x2b9736?{'count':_0x384d1c,'rows':_0x2b9736}:null;}})[_0xf80a('0x1d')](respondWithResult(_0x389ca8,null))[_0xf80a('0x25')](handleError(_0x389ca8,null));};exports[_0xf80a('0x59')]=function(_0x12c422,_0x1d1469,_0xb338a3){if(_0x12c422[_0xf80a('0x55')]['id']){delete _0x12c422['body']['id'];}return db[_0xf80a('0x36')][_0xf80a('0x57')]({'where':{'id':_0x12c422[_0xf80a('0x52')]['id']}})[_0xf80a('0x1d')](handleEntityNotFound(_0x1d1469,null))[_0xf80a('0x1d')](function(_0x5982b6){if(_0x5982b6){_0x12c422['body'][_0xf80a('0x5a')]=_0x5982b6['id'];_0x12c422[_0xf80a('0x55')]['Subjects']=integrations[_0xf80a('0x5b')](_0x12c422[_0xf80a('0x55')]['channel'],_0x12c422[_0xf80a('0x55')][_0xf80a('0x39')]);_0x12c422[_0xf80a('0x55')][_0xf80a('0x5c')]=integrations[_0xf80a('0x5d')](_0x12c422[_0xf80a('0x55')]['channel'],_0x12c422[_0xf80a('0x55')][_0xf80a('0x39')]);return db[_0xf80a('0x58')]['create'](_0x12c422[_0xf80a('0x55')],{'include':[{'model':db[_0xf80a('0x5e')],'as':_0xf80a('0x5f')},{'model':db[_0xf80a('0x5e')],'as':_0xf80a('0x5c')}]});}return null;})[_0xf80a('0x1d')](respondWithResult(_0x1d1469,null))[_0xf80a('0x25')](handleError(_0x1d1469,null));};exports['getFields']=function(_0x415d7b,_0x4f16ff,_0x2cfda8){var _0x37b7db='';var _0x3d915a=['id','name',_0xf80a('0x60'),_0xf80a('0x61'),'description',_0xf80a('0x62'),_0xf80a('0x63'),'duration_minutes',_0xf80a('0x64'),'parent_type',_0xf80a('0x65'),_0xf80a('0x66')];return db[_0xf80a('0x36')][_0xf80a('0x57')]({'where':{'id':_0x415d7b[_0xf80a('0x52')]['id']},'attributes':['id',_0xf80a('0x67'),_0xf80a('0x68'),'remoteUri']})[_0xf80a('0x1d')](handleEntityNotFound(_0x4f16ff,null))[_0xf80a('0x1d')](function(_0x36af7f){if(_0x36af7f){_0x37b7db=_0x36af7f['remoteUri'];var _0x1b2e9c=_0x37b7db[_0xf80a('0x69')](-0x1);if(_0x1b2e9c==='/'){_0x37b7db=_0x37b7db[_0xf80a('0x6a')](0x0,_0x37b7db[_0xf80a('0x6b')](_0x1b2e9c));}return rp({'method':_0xf80a('0x6c'),'uri':util[_0xf80a('0x6d')](_0xf80a('0x6e'),_0x37b7db,_0xf80a('0x6f')),'json':!![],'form':{'method':'login','input_type':_0xf80a('0x70'),'response_type':_0xf80a('0x70'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x36af7f[_0xf80a('0x67')],'password':_0x36af7f[_0xf80a('0x68')],'encryption':_0xf80a('0x71')},'application':_0xf80a('0x72')})}});}})[_0xf80a('0x1d')](function(_0x582bf9){if(_0x582bf9&&_0x582bf9['name']!==_0xf80a('0x73')&&_0x582bf9['name']!==_0xf80a('0x74')){return rp({'method':_0xf80a('0x6c'),'uri':util['format'](_0xf80a('0x6e'),_0x37b7db,_0xf80a('0x6f')),'json':!![],'form':{'method':_0xf80a('0x75'),'input_type':_0xf80a('0x70'),'response_type':'JSON','rest_data':JSON[_0xf80a('0x76')]({'session':_0x582bf9['id'],'module_name':_0xf80a('0x77')})}})[_0xf80a('0x1d')](function(_0x16a141){if(_0x16a141){var _0x2acd90=_[_0xf80a('0x78')](_0x16a141[_0xf80a('0x79')]);_['remove'](_0x2acd90,function(_0x251748){return _0x3d915a[_0xf80a('0x7a')](_0x251748['name']);});return{'count':_0x2acd90[_0xf80a('0x43')],'rows':_[_0xf80a('0x3c')](_0x2acd90,function(_0x29a5a5){return{'id':_0x29a5a5[_0xf80a('0x33')],'name':_0x29a5a5['label'],'custom':_[_0xf80a('0x7b')](_0x29a5a5[_0xf80a('0x33')],'_c')?!![]:![],'options':_0x29a5a5[_0xf80a('0x4d')]?_[_0xf80a('0x3c')](_[_0xf80a('0x78')](_0x29a5a5[_0xf80a('0x4d')]),function(_0x580cc0){return{'name':_0x580cc0[_0xf80a('0x7c')],'value':_0x580cc0['name']};}):[]};})};}})[_0xf80a('0x1d')](respondWithResult(_0x4f16ff,null))[_0xf80a('0x25')](function(_0x5f15f7){var _0x1cd66b=_0x415d7b[_0xf80a('0x3e')][_0xf80a('0x7d')]?0x1f4:_0x5f15f7[_0xf80a('0x7e')]||0x1f4;logger[_0xf80a('0x22')](_0xf80a('0x7f'),'getFields',_0x1cd66b,JSON[_0xf80a('0x76')](_0x5f15f7));delete _0x5f15f7[_0xf80a('0x33')];if(_0x1cd66b===0x191){_0x1cd66b=0x190;}_0x4f16ff['status'](_0x1cd66b)[_0xf80a('0x34')](_0x415d7b[_0xf80a('0x3e')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x5f15f7[_0xf80a('0x7e')]}:_0x5f15f7);});}else{var _0x32b7fa=0x1f4;_0x4f16ff['status'](_0x32b7fa)[_0xf80a('0x34')]({'message':'Wrong\x20credentials','statusCode':0x190});}});}; \ No newline at end of file +var _0xbfdc=['squel','crypto','desk.js','to-csv','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','SugarcrmAccount,\x20%s,\x20%s','message','result','catch','status','json','count','offset','set','apply','reject','save','update','sendStatus','name','send','index','map','fieldName','type','key','query','intersection','attributes','model','fields','length','limit','order','sort','where','filters','pick','filter','options','SugarcrmAccount','then','findAll','rows','show','params','keys','rawAttributes','includeAll','include','merge','find','create','body','getConfigurations','SugarcrmConfiguration','hasOwnProperty','nolimit','addConfiguration','findOne','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','SugarcrmField','getFields','assigned_user_id','created_by','description','date_start','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','username','remoteUri','substring','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','password','PLAIN','Invalid\x20Login','Password\x20Expired','get_module_fields','Calls','values','remove','value','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox'];(function(_0x3b8240,_0x4cf6d6){var _0x39edd4=function(_0x165de1){while(--_0x165de1){_0x3b8240['push'](_0x3b8240['shift']());}};_0x39edd4(++_0x4cf6d6);}(_0xbfdc,0xf7));var _0xcbfd=function(_0x1b4a3c,_0xe90e0){_0x1b4a3c=_0x1b4a3c-0x0;var _0x524e24=_0xbfdc[_0x1b4a3c];return _0x524e24;};'use strict';var pdf=require(_0xcbfd('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xcbfd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcbfd('0x2'));var rp=require(_0xcbfd('0x3'));var moment=require(_0xcbfd('0x4'));var BPromise=require(_0xcbfd('0x5'));var Mustache=require('mustache');var util=require(_0xcbfd('0x6'));var path=require(_0xcbfd('0x7'));var sox=require(_0xcbfd('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xcbfd('0x9'));var crypto=require(_0xcbfd('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xcbfd('0xb'));var toCsv=require(_0xcbfd('0xc'));var querystring=require('querystring');var Papa=require(_0xcbfd('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xcbfd('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcbfd('0xf'));var logger=require(_0xcbfd('0x10'))(_0xcbfd('0x11'));var utils=require(_0xcbfd('0x12'));var config=require(_0xcbfd('0x13'));var db=require(_0xcbfd('0x14'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0xcbfd('0x15'));var client=jayson[_0xcbfd('0x16')][_0xcbfd('0x17')]({'port':0x232a});function checkPasswordPattern(_0x240c09,_0x4b68a5,_0x133e97){if(_0x133e97){var _0x35694c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x35694c[_0xcbfd('0x18')](_0x4b68a5)){return _0x240c09;}else{throw new db[(_0xcbfd('0x19'))]['ValidationError'](_0xcbfd('0x1a'));}}else{return _0x240c09;}}function respondWithRpcPromise(_0x3e5cb7,_0x151ff7,_0x57b5b5,_0x16f0b5){return new BPromise(function(_0x57b9bc,_0x168d2c){var _0x2269e0=_0x16f0b5||client;return _0x2269e0[_0xcbfd('0x1b')](_0x3e5cb7,_0x57b5b5)['then'](function(_0x41bf5b){logger[_0xcbfd('0x1c')]('SugarcrmAccount,\x20%s,\x20%s',_0x151ff7,'request\x20sent');logger[_0xcbfd('0x1d')](_0xcbfd('0x1e'),_0x151ff7,_0xcbfd('0x1f'),JSON[_0xcbfd('0x20')](_0x41bf5b));if(_0x41bf5b[_0xcbfd('0x21')]){if(_0x41bf5b['error']['code']===0x1f4){logger['error'](_0xcbfd('0x22'),_0x151ff7,_0x41bf5b['error'][_0xcbfd('0x23')]);return _0x168d2c(_0x41bf5b[_0xcbfd('0x21')][_0xcbfd('0x23')]);}logger[_0xcbfd('0x21')]('SugarcrmAccount,\x20%s,\x20%s',_0x151ff7,_0x41bf5b[_0xcbfd('0x21')][_0xcbfd('0x23')]);return _0x57b9bc(_0x41bf5b[_0xcbfd('0x21')][_0xcbfd('0x23')]);}else{logger[_0xcbfd('0x1c')]('SugarcrmAccount,\x20%s,\x20%s',_0x151ff7,_0xcbfd('0x1f'));_0x57b9bc(_0x41bf5b[_0xcbfd('0x24')][_0xcbfd('0x23')]);}})[_0xcbfd('0x25')](function(_0x182b2e){logger[_0xcbfd('0x21')](_0xcbfd('0x22'),_0x151ff7,_0x182b2e);_0x168d2c(_0x182b2e);});});}function respondWithStatusCode(_0x26ac9d,_0x182457){_0x182457=_0x182457||0xcc;return function(_0x16e3b3){if(_0x16e3b3){return _0x26ac9d['sendStatus'](_0x182457);}return _0x26ac9d[_0xcbfd('0x26')](_0x182457)['end']();};}function respondWithResult(_0x4c5916,_0x38e725){_0x38e725=_0x38e725||0xc8;return function(_0x35f4a0){if(_0x35f4a0){return _0x4c5916['status'](_0x38e725)[_0xcbfd('0x27')](_0x35f4a0);}};}function respondWithFilteredResult(_0x3deb4d,_0x420dab){return function(_0x1ae061){if(_0x1ae061){var _0x547af1=_0x1ae061[_0xcbfd('0x28')],_0x44865f=_0x420dab[_0xcbfd('0x29')],_0x4c4b1c=_0x420dab[_0xcbfd('0x29')]+_0x420dab['limit'],_0x33210d;if(_0x4c4b1c>=_0x547af1){_0x4c4b1c=_0x547af1;_0x33210d=0xc8;}else{_0x33210d=0xce;}_0x3deb4d[_0xcbfd('0x26')](_0x33210d);return _0x3deb4d[_0xcbfd('0x2a')]('Content-Range',_0x44865f+'-'+_0x4c4b1c+'/'+_0x547af1)['json'](_0x1ae061);}return null;};}function patchUpdates(_0x3345a4){return function(_0x4cadcb){try{jsonpatch[_0xcbfd('0x2b')](_0x4cadcb,_0x3345a4,!![]);}catch(_0x382f2e){return BPromise[_0xcbfd('0x2c')](_0x382f2e);}return _0x4cadcb[_0xcbfd('0x2d')]();};}function saveUpdates(_0x2a12b5,_0x436aa4){return function(_0x508699){if(_0x508699){return _0x508699[_0xcbfd('0x2e')](_0x2a12b5)['then'](function(_0x40d99e){return _0x40d99e;});}return null;};}function removeEntity(_0x23f706,_0x298889){return function(_0x33ec93){if(_0x33ec93){return _0x33ec93['destroy']()['then'](function(){_0x23f706['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xa57ba0,_0x267394){return function(_0x2acf28){if(!_0x2acf28){_0xa57ba0[_0xcbfd('0x2f')](0x194);}return _0x2acf28;};}function handleError(_0x3c4ecc,_0x34e2a3){_0x34e2a3=_0x34e2a3||0x1f4;return function(_0x209688){logger['error'](_0x209688['stack']);if(_0x209688[_0xcbfd('0x30')]){delete _0x209688[_0xcbfd('0x30')];}_0x3c4ecc['status'](_0x34e2a3)[_0xcbfd('0x31')](_0x209688);};}exports[_0xcbfd('0x32')]=function(_0x14d09e,_0x3f3699){var _0x878242={},_0x435583={},_0x1501f4={'count':0x0,'rows':[]};var _0xa4f638=_[_0xcbfd('0x33')](db['SugarcrmAccount']['rawAttributes'],function(_0x4a1d1c){return{'name':_0x4a1d1c[_0xcbfd('0x34')],'type':_0x4a1d1c[_0xcbfd('0x35')][_0xcbfd('0x36')]};});_0x435583['model']=_[_0xcbfd('0x33')](_0xa4f638,_0xcbfd('0x30'));_0x435583[_0xcbfd('0x37')]=_['keys'](_0x14d09e['query']);_0x435583['filters']=_[_0xcbfd('0x38')](_0x435583['model'],_0x435583[_0xcbfd('0x37')]);_0x878242[_0xcbfd('0x39')]=_[_0xcbfd('0x38')](_0x435583[_0xcbfd('0x3a')],qs[_0xcbfd('0x3b')](_0x14d09e['query']['fields']));_0x878242['attributes']=_0x878242[_0xcbfd('0x39')][_0xcbfd('0x3c')]?_0x878242[_0xcbfd('0x39')]:_0x435583['model'];if(!_0x14d09e[_0xcbfd('0x37')]['hasOwnProperty']('nolimit')){_0x878242[_0xcbfd('0x3d')]=qs[_0xcbfd('0x3d')](_0x14d09e['query']['limit']);_0x878242[_0xcbfd('0x29')]=qs[_0xcbfd('0x29')](_0x14d09e[_0xcbfd('0x37')][_0xcbfd('0x29')]);}_0x878242[_0xcbfd('0x3e')]=qs[_0xcbfd('0x3f')](_0x14d09e[_0xcbfd('0x37')][_0xcbfd('0x3f')]);_0x878242[_0xcbfd('0x40')]=qs[_0xcbfd('0x41')](_[_0xcbfd('0x42')](_0x14d09e[_0xcbfd('0x37')],_0x435583[_0xcbfd('0x41')]));if(_0x14d09e[_0xcbfd('0x37')][_0xcbfd('0x43')]){_0x878242[_0xcbfd('0x40')]=_['merge'](_0x878242[_0xcbfd('0x40')],{'$or':_[_0xcbfd('0x33')](_0xa4f638,function(_0x52072c){if(_0x52072c['type']!=='VIRTUAL'){var _0x4ecb58={};_0x4ecb58[_0x52072c[_0xcbfd('0x30')]]={'$like':'%'+_0x14d09e[_0xcbfd('0x37')][_0xcbfd('0x43')]+'%'};return _0x4ecb58;}})});}_0x878242=_['merge']({},_0x878242,_0x14d09e[_0xcbfd('0x44')]);var _0x1d7c63={'where':_0x878242[_0xcbfd('0x40')]};return db[_0xcbfd('0x45')][_0xcbfd('0x28')](_0x1d7c63)[_0xcbfd('0x46')](function(_0x34bf61){_0x1501f4[_0xcbfd('0x28')]=_0x34bf61;if(_0x14d09e[_0xcbfd('0x37')]['includeAll']){_0x878242['include']=[{'all':!![]}];}return db[_0xcbfd('0x45')][_0xcbfd('0x47')](_0x878242);})['then'](function(_0x5a7aa4){_0x1501f4[_0xcbfd('0x48')]=_0x5a7aa4;return _0x1501f4;})['then'](respondWithFilteredResult(_0x3f3699,_0x878242))[_0xcbfd('0x25')](handleError(_0x3f3699,null));};exports[_0xcbfd('0x49')]=function(_0x3b29f1,_0x2119c1){var _0x188d04={'raw':![],'where':{'id':_0x3b29f1[_0xcbfd('0x4a')]['id']}},_0x3bcf52={};_0x3bcf52[_0xcbfd('0x3a')]=_[_0xcbfd('0x4b')](db[_0xcbfd('0x45')][_0xcbfd('0x4c')]);_0x3bcf52[_0xcbfd('0x37')]=_[_0xcbfd('0x4b')](_0x3b29f1[_0xcbfd('0x37')]);_0x3bcf52[_0xcbfd('0x41')]=_[_0xcbfd('0x38')](_0x3bcf52[_0xcbfd('0x3a')],_0x3bcf52[_0xcbfd('0x37')]);_0x188d04[_0xcbfd('0x39')]=_[_0xcbfd('0x38')](_0x3bcf52[_0xcbfd('0x3a')],qs[_0xcbfd('0x3b')](_0x3b29f1[_0xcbfd('0x37')][_0xcbfd('0x3b')]));_0x188d04[_0xcbfd('0x39')]=_0x188d04[_0xcbfd('0x39')]['length']?_0x188d04[_0xcbfd('0x39')]:_0x3bcf52['model'];if(_0x3b29f1[_0xcbfd('0x37')][_0xcbfd('0x4d')]){_0x188d04[_0xcbfd('0x4e')]=[{'all':!![]}];}_0x188d04=_[_0xcbfd('0x4f')]({},_0x188d04,_0x3b29f1[_0xcbfd('0x44')]);return db['SugarcrmAccount'][_0xcbfd('0x50')](_0x188d04)[_0xcbfd('0x46')](handleEntityNotFound(_0x2119c1,null))[_0xcbfd('0x46')](respondWithResult(_0x2119c1,null))[_0xcbfd('0x25')](handleError(_0x2119c1,null));};exports[_0xcbfd('0x51')]=function(_0x1694e3,_0x5dad53){return db[_0xcbfd('0x45')][_0xcbfd('0x51')](_0x1694e3[_0xcbfd('0x52')],{})['then'](respondWithResult(_0x5dad53,0xc9))['catch'](handleError(_0x5dad53,null));};exports['update']=function(_0x42a939,_0x507e8b){if(_0x42a939[_0xcbfd('0x52')]['id']){delete _0x42a939[_0xcbfd('0x52')]['id'];}return db['SugarcrmAccount']['find']({'where':{'id':_0x42a939[_0xcbfd('0x4a')]['id']}})['then'](handleEntityNotFound(_0x507e8b,null))['then'](saveUpdates(_0x42a939['body'],null))[_0xcbfd('0x46')](respondWithResult(_0x507e8b,null))[_0xcbfd('0x25')](handleError(_0x507e8b,null));};exports['destroy']=function(_0x43c1e3,_0x23f0c6){return db[_0xcbfd('0x45')][_0xcbfd('0x50')]({'where':{'id':_0x43c1e3[_0xcbfd('0x4a')]['id']}})[_0xcbfd('0x46')](handleEntityNotFound(_0x23f0c6,null))[_0xcbfd('0x46')](removeEntity(_0x23f0c6,null))[_0xcbfd('0x25')](handleError(_0x23f0c6,null));};exports[_0xcbfd('0x53')]=function(_0x1430cb,_0x221236,_0x5452e1){var _0x2442c8={};var _0x59e01b={};var _0xef0817;var _0x30c198;return db['SugarcrmAccount']['findOne']({'where':{'id':_0x1430cb[_0xcbfd('0x4a')]['id']}})[_0xcbfd('0x46')](handleEntityNotFound(_0x221236,null))[_0xcbfd('0x46')](function(_0x5a4a23){if(_0x5a4a23){_0xef0817=_0x5a4a23;_0x59e01b[_0xcbfd('0x3a')]=_[_0xcbfd('0x4b')](db[_0xcbfd('0x54')][_0xcbfd('0x4c')]);_0x59e01b[_0xcbfd('0x37')]=_[_0xcbfd('0x4b')](_0x1430cb[_0xcbfd('0x37')]);_0x59e01b['filters']=_[_0xcbfd('0x38')](_0x59e01b[_0xcbfd('0x3a')],_0x59e01b['query']);_0x2442c8[_0xcbfd('0x39')]=_[_0xcbfd('0x38')](_0x59e01b[_0xcbfd('0x3a')],qs[_0xcbfd('0x3b')](_0x1430cb[_0xcbfd('0x37')][_0xcbfd('0x3b')]));_0x2442c8[_0xcbfd('0x39')]=_0x2442c8['attributes'][_0xcbfd('0x3c')]?_0x2442c8['attributes']:_0x59e01b[_0xcbfd('0x3a')];_0x2442c8['order']=qs[_0xcbfd('0x3f')](_0x1430cb['query'][_0xcbfd('0x3f')]);_0x2442c8[_0xcbfd('0x40')]=qs['filters'](_['pick'](_0x1430cb[_0xcbfd('0x37')],_0x59e01b[_0xcbfd('0x41')]));if(_0x1430cb['query'][_0xcbfd('0x43')]){_0x2442c8[_0xcbfd('0x40')]=_[_0xcbfd('0x4f')](_0x2442c8[_0xcbfd('0x40')],{'$or':_[_0xcbfd('0x33')](_0x2442c8[_0xcbfd('0x39')],function(_0xaedf54){var _0x389ae9={};_0x389ae9[_0xaedf54]={'$like':'%'+_0x1430cb[_0xcbfd('0x37')][_0xcbfd('0x43')]+'%'};return _0x389ae9;})});}_0x2442c8=_[_0xcbfd('0x4f')]({},_0x2442c8,_0x1430cb[_0xcbfd('0x44')]);return _0xef0817[_0xcbfd('0x53')](_0x2442c8);}})['then'](function(_0x26cf5d){if(_0x26cf5d){_0x30c198=_0x26cf5d[_0xcbfd('0x3c')];if(!_0x1430cb[_0xcbfd('0x37')][_0xcbfd('0x55')](_0xcbfd('0x56'))){_0x2442c8[_0xcbfd('0x3d')]=qs[_0xcbfd('0x3d')](_0x1430cb['query']['limit']);_0x2442c8[_0xcbfd('0x29')]=qs[_0xcbfd('0x29')](_0x1430cb[_0xcbfd('0x37')][_0xcbfd('0x29')]);}return _0xef0817[_0xcbfd('0x53')](_0x2442c8);}})[_0xcbfd('0x46')](function(_0x15d176){if(_0x15d176){return _0x15d176?{'count':_0x30c198,'rows':_0x15d176}:null;}})[_0xcbfd('0x46')](respondWithResult(_0x221236,null))[_0xcbfd('0x25')](handleError(_0x221236,null));};exports[_0xcbfd('0x57')]=function(_0x5718e3,_0x43e4b5,_0x396cd4){if(_0x5718e3[_0xcbfd('0x52')]['id']){delete _0x5718e3[_0xcbfd('0x52')]['id'];}return db[_0xcbfd('0x45')][_0xcbfd('0x58')]({'where':{'id':_0x5718e3[_0xcbfd('0x4a')]['id']}})[_0xcbfd('0x46')](handleEntityNotFound(_0x43e4b5,null))[_0xcbfd('0x46')](function(_0x1c6445){if(_0x1c6445){_0x5718e3[_0xcbfd('0x52')][_0xcbfd('0x59')]=_0x1c6445['id'];_0x5718e3[_0xcbfd('0x52')][_0xcbfd('0x5a')]=integrations[_0xcbfd('0x5b')](_0x5718e3[_0xcbfd('0x52')]['channel'],_0x5718e3[_0xcbfd('0x52')][_0xcbfd('0x35')]);_0x5718e3[_0xcbfd('0x52')][_0xcbfd('0x5c')]=integrations[_0xcbfd('0x5d')](_0x5718e3[_0xcbfd('0x52')][_0xcbfd('0x5e')],_0x5718e3['body'][_0xcbfd('0x35')]);return db[_0xcbfd('0x54')][_0xcbfd('0x51')](_0x5718e3[_0xcbfd('0x52')],{'include':[{'model':db[_0xcbfd('0x5f')],'as':_0xcbfd('0x5a')},{'model':db[_0xcbfd('0x5f')],'as':_0xcbfd('0x5c')}]});}return null;})[_0xcbfd('0x46')](respondWithResult(_0x43e4b5,null))[_0xcbfd('0x25')](handleError(_0x43e4b5,null));};exports[_0xcbfd('0x60')]=function(_0x4718f3,_0x9d1db6,_0x59949e){var _0x31b8f2='';var _0x34ccfb=['id',_0xcbfd('0x30'),_0xcbfd('0x61'),_0xcbfd('0x62'),_0xcbfd('0x63'),_0xcbfd('0x64'),_0xcbfd('0x65'),_0xcbfd('0x66'),_0xcbfd('0x67'),_0xcbfd('0x68'),_0xcbfd('0x69'),_0xcbfd('0x6a')];return db[_0xcbfd('0x45')][_0xcbfd('0x58')]({'where':{'id':_0x4718f3[_0xcbfd('0x4a')]['id']},'attributes':['id',_0xcbfd('0x6b'),'password',_0xcbfd('0x6c')]})[_0xcbfd('0x46')](handleEntityNotFound(_0x9d1db6,null))[_0xcbfd('0x46')](function(_0x2d7048){if(_0x2d7048){_0x31b8f2=_0x2d7048[_0xcbfd('0x6c')];var _0x3324e3=_0x31b8f2['slice'](-0x1);if(_0x3324e3==='/'){_0x31b8f2=_0x31b8f2[_0xcbfd('0x6d')](0x0,_0x31b8f2['lastIndexOf'](_0x3324e3));}return rp({'method':_0xcbfd('0x6e'),'uri':util[_0xcbfd('0x6f')](_0xcbfd('0x70'),_0x31b8f2,_0xcbfd('0x71')),'json':!![],'form':{'method':_0xcbfd('0x72'),'input_type':_0xcbfd('0x73'),'response_type':_0xcbfd('0x73'),'rest_data':JSON[_0xcbfd('0x20')]({'user_auth':{'user_name':_0x2d7048[_0xcbfd('0x6b')],'password':_0x2d7048[_0xcbfd('0x74')],'encryption':_0xcbfd('0x75')},'application':'xCALLY\x20Motion\x20Integration'})}});}})['then'](function(_0x29bd19){if(_0x29bd19&&_0x29bd19[_0xcbfd('0x30')]!==_0xcbfd('0x76')&&_0x29bd19[_0xcbfd('0x30')]!==_0xcbfd('0x77')){return rp({'method':'POST','uri':util['format'](_0xcbfd('0x70'),_0x31b8f2,_0xcbfd('0x71')),'json':!![],'form':{'method':_0xcbfd('0x78'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0xcbfd('0x20')]({'session':_0x29bd19['id'],'module_name':_0xcbfd('0x79')})}})['then'](function(_0x578ed){if(_0x578ed){var _0x32b9d4=_[_0xcbfd('0x7a')](_0x578ed['module_fields']);_[_0xcbfd('0x7b')](_0x32b9d4,function(_0x4c4f92){return _0x34ccfb['includes'](_0x4c4f92[_0xcbfd('0x30')]);});return{'count':_0x32b9d4[_0xcbfd('0x3c')],'rows':_[_0xcbfd('0x33')](_0x32b9d4,function(_0x48a552){return{'id':_0x48a552['name'],'name':_0x48a552['label'],'custom':_['endsWith'](_0x48a552[_0xcbfd('0x30')],'_c')?!![]:![],'options':_0x48a552[_0xcbfd('0x44')]?_[_0xcbfd('0x33')](_[_0xcbfd('0x7a')](_0x48a552[_0xcbfd('0x44')]),function(_0x5985ee){return{'name':_0x5985ee[_0xcbfd('0x7c')],'value':_0x5985ee['name']};}):[]};})};}})[_0xcbfd('0x46')](respondWithResult(_0x9d1db6,null))['catch'](function(_0x126bce){var _0x398f96=_0x4718f3[_0xcbfd('0x37')]['test']?0x1f4:_0x126bce[_0xcbfd('0x7d')]||0x1f4;logger[_0xcbfd('0x21')](_0xcbfd('0x7e'),_0xcbfd('0x60'),_0x398f96,JSON[_0xcbfd('0x20')](_0x126bce));delete _0x126bce[_0xcbfd('0x30')];if(_0x398f96===0x191){_0x398f96=0x190;}_0x9d1db6[_0xcbfd('0x26')](_0x398f96)[_0xcbfd('0x31')](_0x4718f3[_0xcbfd('0x37')][_0xcbfd('0x18')]?{'message':_0xcbfd('0x7f'),'statusCode':_0x126bce['statusCode']}:_0x126bce);});}else{var _0x2e5f8e=0x1f4;_0x9d1db6[_0xcbfd('0x26')](_0x2e5f8e)[_0xcbfd('0x31')]({'message':_0xcbfd('0x7f'),'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 ab30df0..c457165 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 _0xd2b7=['request-promise','path','rimraf','./intSugarcrmAccount.attributes','exports','define','SugarcrmAccount','int_sugarcrm_accounts','lodash','util','../../config/logger'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0xd2b7,0x97));var _0x7d2b=function(_0x5a4400,_0xfae3b6){_0x5a4400=_0x5a4400-0x0;var _0xf9b532=_0xd2b7[_0x5a4400];return _0xf9b532;};'use strict';var _=require(_0x7d2b('0x0'));var util=require(_0x7d2b('0x1'));var logger=require(_0x7d2b('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7d2b('0x3'));var fs=require('fs');var path=require(_0x7d2b('0x4'));var rimraf=require(_0x7d2b('0x5'));var config=require('../../config/environment');var attributes=require(_0x7d2b('0x6'));var integrations=require('../../components/integrations/configuration');module[_0x7d2b('0x7')]=function(_0x44b50c,_0x47f572){return _0x44b50c[_0x7d2b('0x8')](_0x7d2b('0x9'),attributes,{'tableName':_0x7d2b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6c05=['bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','SugarcrmAccount','int_sugarcrm_accounts','util','../../config/logger','api'];(function(_0x22a735,_0x22be08){var _0x25f5b4=function(_0x337cc9){while(--_0x337cc9){_0x22a735['push'](_0x22a735['shift']());}};_0x25f5b4(++_0x22be08);}(_0x6c05,0x1e7));var _0x56c0=function(_0x3ca717,_0x256ead){_0x3ca717=_0x3ca717-0x0;var _0x2e4ab2=_0x6c05[_0x3ca717];return _0x2e4ab2;};'use strict';var _=require('lodash');var util=require(_0x56c0('0x0'));var logger=require(_0x56c0('0x1'))(_0x56c0('0x2'));var moment=require('moment');var BPromise=require(_0x56c0('0x3'));var rp=require(_0x56c0('0x4'));var fs=require('fs');var path=require(_0x56c0('0x5'));var rimraf=require(_0x56c0('0x6'));var config=require(_0x56c0('0x7'));var attributes=require(_0x56c0('0x8'));var integrations=require(_0x56c0('0x9'));module[_0x56c0('0xa')]=function(_0x5dc8d6,_0x189ab2){return _0x5dc8d6[_0x56c0('0xb')](_0x56c0('0xc'),attributes,{'tableName':_0x56c0('0xd'),'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 3045a53..7de67ce 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 _0xe64a=['findAll','options','where','limit','include','map','model','attributes','catch','ShowSugarcrmAccount','SugarcrmAccount','raw','debug','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','SugarcrmAccount,\x20%s,\x20%s','SugarcrmAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetSugarcrmAccount'];(function(_0x13cb09,_0x2516f4){var _0x5a04af=function(_0x37e1f9){while(--_0x37e1f9){_0x13cb09['push'](_0x13cb09['shift']());}};_0x5a04af(++_0x2516f4);}(_0xe64a,0x79));var _0xae64=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xe64a[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0xae64('0x0'));var util=require('util');var moment=require(_0xae64('0x1'));var BPromise=require(_0xae64('0x2'));var rs=require(_0xae64('0x3'));var fs=require('fs');var Redis=require(_0xae64('0x4'));var db=require(_0xae64('0x5'))['db'];var utils=require(_0xae64('0x6'));var logger=require(_0xae64('0x7'))('rpc');var config=require(_0xae64('0x8'));var jayson=require(_0xae64('0x9'));var client=jayson[_0xae64('0xa')][_0xae64('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x32a594,_0x1f2fb5,_0xe01a26){return new BPromise(function(_0x5e9bb,_0x36408f){return client['request'](_0x32a594,_0xe01a26)[_0xae64('0xc')](function(_0x1601c8){logger[_0xae64('0xd')](_0xae64('0xe'),_0x1f2fb5,'request\x20sent');logger['debug'](_0xae64('0xf'),_0x1f2fb5,_0xae64('0x10'),JSON[_0xae64('0x11')](_0x1601c8));if(_0x1601c8['error']){if(_0x1601c8[_0xae64('0x12')][_0xae64('0x13')]===0x1f4){logger[_0xae64('0x12')](_0xae64('0xe'),_0x1f2fb5,_0x1601c8['error'][_0xae64('0x14')]);return _0x36408f(_0x1601c8[_0xae64('0x12')][_0xae64('0x14')]);}logger[_0xae64('0x12')]('SugarcrmAccount,\x20%s,\x20%s',_0x1f2fb5,_0x1601c8['error'][_0xae64('0x14')]);return _0x5e9bb(_0x1601c8[_0xae64('0x12')][_0xae64('0x14')]);}else{logger[_0xae64('0xd')](_0xae64('0xe'),_0x1f2fb5,_0xae64('0x10'));_0x5e9bb(_0x1601c8[_0xae64('0x15')][_0xae64('0x14')]);}})['catch'](function(_0x22cddd){logger[_0xae64('0x12')]('SugarcrmAccount,\x20%s,\x20%s',_0x1f2fb5,_0x22cddd);_0x36408f(_0x22cddd);});});}exports[_0xae64('0x16')]=function(_0xe000d1){var _0x2baecc=this;return new Promise(function(_0x24b5b3,_0x956e5e){return db['SugarcrmAccount'][_0xae64('0x17')]({'raw':_0xe000d1[_0xae64('0x18')]?_0xe000d1[_0xae64('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0xe000d1['options']?_0xe000d1['options'][_0xae64('0x19')]||null:null,'attributes':_0xe000d1[_0xae64('0x18')]?_0xe000d1[_0xae64('0x18')]['attributes']||null:null,'limit':_0xe000d1[_0xae64('0x18')]?_0xe000d1[_0xae64('0x18')][_0xae64('0x1a')]||null:null,'include':_0xe000d1[_0xae64('0x18')]?_0xe000d1[_0xae64('0x18')][_0xae64('0x1b')]?_[_0xae64('0x1c')](_0xe000d1[_0xae64('0x18')][_0xae64('0x1b')],function(_0x171a12){return{'model':db[_0x171a12[_0xae64('0x1d')]],'as':_0x171a12['as'],'attributes':_0x171a12[_0xae64('0x1e')],'include':_0x171a12[_0xae64('0x1b')]?_[_0xae64('0x1c')](_0x171a12[_0xae64('0x1b')],function(_0x347b29){return{'model':db[_0x347b29['model']],'as':_0x347b29['as'],'attributes':_0x347b29[_0xae64('0x1e')],'include':_0x347b29['include']?_['map'](_0x347b29[_0xae64('0x1b')],function(_0xd1b44d){return{'model':db[_0xd1b44d[_0xae64('0x1d')]],'as':_0xd1b44d['as'],'attributes':_0xd1b44d[_0xae64('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xae64('0xc')](function(_0x4e1cfb){logger[_0xae64('0xd')](_0xae64('0x16'),_0xe000d1);logger['debug']('GetSugarcrmAccount',_0xe000d1,JSON['stringify'](_0x4e1cfb));_0x24b5b3(_0x4e1cfb);})[_0xae64('0x1f')](function(_0x9d9f63){logger[_0xae64('0x12')](_0xae64('0x16'),_0x9d9f63['message'],_0xe000d1);_0x956e5e(_0x2baecc['error'](0x1f4,_0x9d9f63[_0xae64('0x14')]));});});};exports[_0xae64('0x20')]=function(_0x1fce98){var _0x300f7f=this;return new Promise(function(_0x49f392,_0x13e700){return db[_0xae64('0x21')]['find']({'raw':_0x1fce98[_0xae64('0x18')]?_0x1fce98['options'][_0xae64('0x22')]===undefined?!![]:![]:!![],'where':_0x1fce98['options']?_0x1fce98[_0xae64('0x18')][_0xae64('0x19')]||null:null,'attributes':_0x1fce98[_0xae64('0x18')]?_0x1fce98[_0xae64('0x18')][_0xae64('0x1e')]||null:null,'include':_0x1fce98['options']?_0x1fce98[_0xae64('0x18')]['include']?_['map'](_0x1fce98[_0xae64('0x18')][_0xae64('0x1b')],function(_0x465a2d){return{'model':db[_0x465a2d[_0xae64('0x1d')]],'as':_0x465a2d['as'],'attributes':_0x465a2d[_0xae64('0x1e')],'include':_0x465a2d[_0xae64('0x1b')]?_[_0xae64('0x1c')](_0x465a2d[_0xae64('0x1b')],function(_0x47699d){return{'model':db[_0x47699d[_0xae64('0x1d')]],'as':_0x47699d['as'],'attributes':_0x47699d[_0xae64('0x1e')],'include':_0x47699d['include']?_[_0xae64('0x1c')](_0x47699d['include'],function(_0x15adaf){return{'model':db[_0x15adaf[_0xae64('0x1d')]],'as':_0x15adaf['as'],'attributes':_0x15adaf[_0xae64('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5b85b9){logger['info'](_0xae64('0x20'),_0x1fce98);logger[_0xae64('0x23')](_0xae64('0x20'),_0x1fce98,JSON['stringify'](_0x5b85b9));_0x49f392(_0x5b85b9);})[_0xae64('0x1f')](function(_0x5235aa){logger[_0xae64('0x12')](_0xae64('0x20'),_0x5235aa[_0xae64('0x14')],_0x1fce98);_0x13e700(_0x300f7f['error'](0x1f4,_0x5235aa['message']));});});}; \ No newline at end of file +var _0xfc5b=['message','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','find','ShowSugarcrmAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x417ea3,_0x156e87){var _0x18c29d=function(_0x22df4b){while(--_0x22df4b){_0x417ea3['push'](_0x417ea3['shift']());}};_0x18c29d(++_0x156e87);}(_0xfc5b,0x122));var _0xbfc5=function(_0x499b6f,_0x29d153){_0x499b6f=_0x499b6f-0x0;var _0x3cbbf5=_0xfc5b[_0x499b6f];return _0x3cbbf5;};'use strict';var _=require(_0xbfc5('0x0'));var util=require(_0xbfc5('0x1'));var moment=require(_0xbfc5('0x2'));var BPromise=require(_0xbfc5('0x3'));var rs=require(_0xbfc5('0x4'));var fs=require('fs');var Redis=require(_0xbfc5('0x5'));var db=require(_0xbfc5('0x6'))['db'];var utils=require(_0xbfc5('0x7'));var logger=require(_0xbfc5('0x8'))(_0xbfc5('0x9'));var config=require(_0xbfc5('0xa'));var jayson=require(_0xbfc5('0xb'));var client=jayson[_0xbfc5('0xc')][_0xbfc5('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5b9fcf,_0x1c9906,_0x40869e){return new BPromise(function(_0x4e2f24,_0x124d18){return client['request'](_0x5b9fcf,_0x40869e)['then'](function(_0x4331dd){logger[_0xbfc5('0xe')](_0xbfc5('0xf'),_0x1c9906,_0xbfc5('0x10'));logger[_0xbfc5('0x11')](_0xbfc5('0x12'),_0x1c9906,_0xbfc5('0x10'),JSON[_0xbfc5('0x13')](_0x4331dd));if(_0x4331dd[_0xbfc5('0x14')]){if(_0x4331dd[_0xbfc5('0x14')][_0xbfc5('0x15')]===0x1f4){logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x1c9906,_0x4331dd[_0xbfc5('0x14')][_0xbfc5('0x16')]);return _0x124d18(_0x4331dd[_0xbfc5('0x14')][_0xbfc5('0x16')]);}logger[_0xbfc5('0x14')](_0xbfc5('0xf'),_0x1c9906,_0x4331dd['error'][_0xbfc5('0x16')]);return _0x4e2f24(_0x4331dd[_0xbfc5('0x14')]['message']);}else{logger[_0xbfc5('0xe')](_0xbfc5('0xf'),_0x1c9906,_0xbfc5('0x10'));_0x4e2f24(_0x4331dd[_0xbfc5('0x17')][_0xbfc5('0x16')]);}})[_0xbfc5('0x18')](function(_0x23df30){logger[_0xbfc5('0x14')](_0xbfc5('0xf'),_0x1c9906,_0x23df30);_0x124d18(_0x23df30);});});}exports[_0xbfc5('0x19')]=function(_0x541184){var _0x26bcb9=this;return new Promise(function(_0x4da50e,_0xf10a04){return db[_0xbfc5('0x1a')][_0xbfc5('0x1b')]({'raw':_0x541184[_0xbfc5('0x1c')]?_0x541184[_0xbfc5('0x1c')][_0xbfc5('0x1d')]===undefined?!![]:![]:!![],'where':_0x541184[_0xbfc5('0x1c')]?_0x541184[_0xbfc5('0x1c')][_0xbfc5('0x1e')]||null:null,'attributes':_0x541184['options']?_0x541184[_0xbfc5('0x1c')][_0xbfc5('0x1f')]||null:null,'limit':_0x541184[_0xbfc5('0x1c')]?_0x541184['options'][_0xbfc5('0x20')]||null:null,'include':_0x541184['options']?_0x541184['options'][_0xbfc5('0x21')]?_[_0xbfc5('0x22')](_0x541184[_0xbfc5('0x1c')][_0xbfc5('0x21')],function(_0xe26c10){return{'model':db[_0xe26c10['model']],'as':_0xe26c10['as'],'attributes':_0xe26c10[_0xbfc5('0x1f')],'include':_0xe26c10[_0xbfc5('0x21')]?_[_0xbfc5('0x22')](_0xe26c10[_0xbfc5('0x21')],function(_0x5592c0){return{'model':db[_0x5592c0[_0xbfc5('0x23')]],'as':_0x5592c0['as'],'attributes':_0x5592c0[_0xbfc5('0x1f')],'include':_0x5592c0[_0xbfc5('0x21')]?_[_0xbfc5('0x22')](_0x5592c0[_0xbfc5('0x21')],function(_0x43f392){return{'model':db[_0x43f392['model']],'as':_0x43f392['as'],'attributes':_0x43f392[_0xbfc5('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xbfc5('0x24')](function(_0x4efe15){logger[_0xbfc5('0xe')](_0xbfc5('0x19'),_0x541184);logger[_0xbfc5('0x11')](_0xbfc5('0x19'),_0x541184,JSON[_0xbfc5('0x13')](_0x4efe15));_0x4da50e(_0x4efe15);})['catch'](function(_0x3900b0){logger['error']('GetSugarcrmAccount',_0x3900b0[_0xbfc5('0x16')],_0x541184);_0xf10a04(_0x26bcb9[_0xbfc5('0x14')](0x1f4,_0x3900b0['message']));});});};exports['ShowSugarcrmAccount']=function(_0x5ae2ac){var _0x2755c7=this;return new Promise(function(_0x340a96,_0x2c1e6a){return db[_0xbfc5('0x1a')][_0xbfc5('0x25')]({'raw':_0x5ae2ac[_0xbfc5('0x1c')]?_0x5ae2ac[_0xbfc5('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x5ae2ac[_0xbfc5('0x1c')]?_0x5ae2ac[_0xbfc5('0x1c')][_0xbfc5('0x1e')]||null:null,'attributes':_0x5ae2ac['options']?_0x5ae2ac[_0xbfc5('0x1c')][_0xbfc5('0x1f')]||null:null,'include':_0x5ae2ac[_0xbfc5('0x1c')]?_0x5ae2ac[_0xbfc5('0x1c')][_0xbfc5('0x21')]?_[_0xbfc5('0x22')](_0x5ae2ac[_0xbfc5('0x1c')][_0xbfc5('0x21')],function(_0x5c498d){return{'model':db[_0x5c498d[_0xbfc5('0x23')]],'as':_0x5c498d['as'],'attributes':_0x5c498d['attributes'],'include':_0x5c498d['include']?_['map'](_0x5c498d[_0xbfc5('0x21')],function(_0x661514){return{'model':db[_0x661514[_0xbfc5('0x23')]],'as':_0x661514['as'],'attributes':_0x661514[_0xbfc5('0x1f')],'include':_0x661514['include']?_[_0xbfc5('0x22')](_0x661514[_0xbfc5('0x21')],function(_0x55a6db){return{'model':db[_0x55a6db[_0xbfc5('0x23')]],'as':_0x55a6db['as'],'attributes':_0x55a6db['attributes']};}):[]};}):[]};}):[]:[]})[_0xbfc5('0x24')](function(_0x7dfedf){logger[_0xbfc5('0xe')](_0xbfc5('0x26'),_0x5ae2ac);logger['debug'](_0xbfc5('0x26'),_0x5ae2ac,JSON[_0xbfc5('0x13')](_0x7dfedf));_0x340a96(_0x7dfedf);})[_0xbfc5('0x18')](function(_0x4c863c){logger[_0xbfc5('0x14')](_0xbfc5('0x26'),_0x4c863c['message'],_0x5ae2ac);_0x2c1e6a(_0x2755c7[_0xbfc5('0x14')](0x1f4,_0x4c863c[_0xbfc5('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 27fd3d0..3cf57a3 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 _0xd790=['post','put','update','delete','exports','multer','util','path','connect-timeout','Router','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions'];(function(_0x5d6814,_0x1dfdc5){var _0x271a00=function(_0xf9c87c){while(--_0xf9c87c){_0x5d6814['push'](_0x5d6814['shift']());}};_0x271a00(++_0x1dfdc5);}(_0xd790,0x83));var _0x0d79=function(_0x11c5da,_0x5799cf){_0x11c5da=_0x11c5da-0x0;var _0x5cfbf1=_0xd790[_0x11c5da];return _0x5cfbf1;};'use strict';var multer=require(_0x0d79('0x0'));var util=require(_0x0d79('0x1'));var path=require(_0x0d79('0x2'));var timeout=require(_0x0d79('0x3'));var express=require('express');var router=express[_0x0d79('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0d79('0x5'));router[_0x0d79('0x6')]('/',auth[_0x0d79('0x7')](),controller[_0x0d79('0x8')]);router[_0x0d79('0x6')](_0x0d79('0x9'),auth[_0x0d79('0x7')](),controller['show']);router[_0x0d79('0x6')](_0x0d79('0xa'),auth[_0x0d79('0x7')](),controller[_0x0d79('0xb')]);router[_0x0d79('0x6')](_0x0d79('0xc'),auth[_0x0d79('0x7')](),controller[_0x0d79('0xd')]);router[_0x0d79('0x6')](_0x0d79('0xe'),auth[_0x0d79('0x7')](),controller[_0x0d79('0xf')]);router[_0x0d79('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0d79('0x11')](_0x0d79('0x9'),auth[_0x0d79('0x7')](),controller[_0x0d79('0x12')]);router[_0x0d79('0x13')](_0x0d79('0x9'),auth[_0x0d79('0x7')](),controller['destroy']);module[_0x0d79('0x14')]=router; \ No newline at end of file +var _0x045d=['../../config/environment','./intSugarcrmConfiguration.controller','isAuthenticated','index','get','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x20ebb9,_0x3535bb){var _0x1ec31d=function(_0x3afad1){while(--_0x3afad1){_0x20ebb9['push'](_0x20ebb9['shift']());}};_0x1ec31d(++_0x3535bb);}(_0x045d,0xc9));var _0xd045=function(_0x1b3205,_0x3f3005){_0x1b3205=_0x1b3205-0x0;var _0x280da4=_0x045d[_0x1b3205];return _0x280da4;};'use strict';var multer=require(_0xd045('0x0'));var util=require(_0xd045('0x1'));var path=require(_0xd045('0x2'));var timeout=require(_0xd045('0x3'));var express=require(_0xd045('0x4'));var router=express['Router']();var auth=require(_0xd045('0x5'));var interaction=require(_0xd045('0x6'));var config=require(_0xd045('0x7'));var controller=require(_0xd045('0x8'));router['get']('/',auth[_0xd045('0x9')](),controller[_0xd045('0xa')]);router[_0xd045('0xb')]('/:id',auth[_0xd045('0x9')](),controller[_0xd045('0xc')]);router[_0xd045('0xb')]('/:id/fields',auth['isAuthenticated'](),controller[_0xd045('0xd')]);router[_0xd045('0xb')](_0xd045('0xe'),auth[_0xd045('0x9')](),controller[_0xd045('0xf')]);router[_0xd045('0xb')](_0xd045('0x10'),auth['isAuthenticated'](),controller[_0xd045('0x11')]);router[_0xd045('0x12')]('/',auth['isAuthenticated'](),controller[_0xd045('0x13')]);router[_0xd045('0x14')](_0xd045('0x15'),auth[_0xd045('0x9')](),controller[_0xd045('0x16')]);router[_0xd045('0x17')](_0xd045('0x15'),auth[_0xd045('0x9')](),controller[_0xd045('0x18')]);module[_0xd045('0x19')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index ddc949f..5c05b70 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 _0xd1d6=['STRING'];(function(_0x39072d,_0x50c4af){var _0x1e3ab=function(_0x2cb820){while(--_0x2cb820){_0x39072d['push'](_0x39072d['shift']());}};_0x1e3ab(++_0x50c4af);}(_0xd1d6,0x182));var _0x6d1d=function(_0x40358f,_0x36dc38){_0x40358f=_0x40358f-0x0;var _0x5486b6=_0xd1d6[_0x40358f];return _0x5486b6;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x6d1d('0x0')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb78d=['STRING','sequelize'];(function(_0x1c5d53,_0x1029a2){var _0x2ef0f8=function(_0x3f6697){while(--_0x3f6697){_0x1c5d53['push'](_0x1c5d53['shift']());}};_0x2ef0f8(++_0x1029a2);}(_0xb78d,0x8f));var _0xdb78=function(_0x2e56d3,_0x5619a8){_0x2e56d3=_0x2e56d3-0x0;var _0x5a363c=_0xb78d[_0x2e56d3];return _0x5a363c;};'use strict';var Sequelize=require(_0xdb78('0x0'));module['exports']={'name':{'type':Sequelize[_0xdb78('0x1')]},'description':{'type':Sequelize[_0xdb78('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 5fd9a79..dbb0b8e 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 _0x113d=['filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','then','count','includeAll','findAll','rows','show','params','keys','include','create','body','find','destroy','getFields','findOne','SugarcrmField','nolimit','getSubjects','rawAttributes','getDescriptions','html-pdf','eml-format','fast-json-patch','bluebird','util','path','sox','lodash','crypto','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','Sequelize','ValidationError','request','info','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SugarcrmConfiguration,\x20%s,\x20%s','catch','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','stack','name','send','index','SugarcrmConfiguration','fieldName','key','model','map','query'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x113d,0x139));var _0xd113=function(_0x176c7c,_0x575659){_0x176c7c=_0x176c7c-0x0;var _0x401587=_0x113d[_0x176c7c];return _0x401587;};'use strict';var pdf=require(_0xd113('0x0'));var emlformat=require(_0xd113('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd113('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd113('0x3'));var Mustache=require('mustache');var util=require(_0xd113('0x4'));var path=require(_0xd113('0x5'));var sox=require(_0xd113('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xd113('0x7'));var squel=require('squel');var crypto=require(_0xd113('0x8'));var jsforce=require('jsforce');var deskjs=require(_0xd113('0x9'));var toCsv=require(_0xd113('0xa'));var querystring=require(_0xd113('0xb'));var Papa=require('papaparse');var Redis=require(_0xd113('0xc'));var authService=require('../../components/auth/service');var qs=require(_0xd113('0xd'));var as=require(_0xd113('0xe'));var hardwareService=require(_0xd113('0xf'));var logger=require(_0xd113('0x10'))('api');var utils=require(_0xd113('0x11'));var config=require(_0xd113('0x12'));var db=require(_0xd113('0x13'))['db'];var jayson=require(_0xd113('0x14'));var client=jayson[_0xd113('0x15')][_0xd113('0x16')]({'port':0x232a});function checkPasswordPattern(_0x32934f,_0x2f361f,_0x4514e4){if(_0x4514e4){var _0x208cfc=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x208cfc[_0xd113('0x17')](_0x2f361f)){return _0x32934f;}else{throw new db[(_0xd113('0x18'))][(_0xd113('0x19'))]('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 _0x32934f;}}function respondWithRpcPromise(_0x52bb45,_0x15aa5f,_0x1ee360,_0x245fcc){return new BPromise(function(_0x3ba25b,_0x292c49){var _0x43da8f=_0x245fcc||client;return _0x43da8f[_0xd113('0x1a')](_0x52bb45,_0x1ee360)['then'](function(_0x4aaef2){logger[_0xd113('0x1b')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x15aa5f,_0xd113('0x1c'));logger[_0xd113('0x1d')](_0xd113('0x1e'),_0x15aa5f,'request\x20sent',JSON[_0xd113('0x1f')](_0x4aaef2));if(_0x4aaef2[_0xd113('0x20')]){if(_0x4aaef2[_0xd113('0x20')][_0xd113('0x21')]===0x1f4){logger[_0xd113('0x20')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x15aa5f,_0x4aaef2[_0xd113('0x20')][_0xd113('0x22')]);return _0x292c49(_0x4aaef2[_0xd113('0x20')]['message']);}logger[_0xd113('0x20')](_0xd113('0x23'),_0x15aa5f,_0x4aaef2[_0xd113('0x20')][_0xd113('0x22')]);return _0x3ba25b(_0x4aaef2[_0xd113('0x20')][_0xd113('0x22')]);}else{logger[_0xd113('0x1b')](_0xd113('0x23'),_0x15aa5f,_0xd113('0x1c'));_0x3ba25b(_0x4aaef2['result']['message']);}})[_0xd113('0x24')](function(_0x4726a5){logger['error'](_0xd113('0x23'),_0x15aa5f,_0x4726a5);_0x292c49(_0x4726a5);});});}function respondWithStatusCode(_0x3cf128,_0x2fcc6a){_0x2fcc6a=_0x2fcc6a||0xcc;return function(_0x55dc60){if(_0x55dc60){return _0x3cf128[_0xd113('0x25')](_0x2fcc6a);}return _0x3cf128[_0xd113('0x26')](_0x2fcc6a)[_0xd113('0x27')]();};}function respondWithResult(_0x41c79e,_0x277147){_0x277147=_0x277147||0xc8;return function(_0xa4129b){if(_0xa4129b){return _0x41c79e[_0xd113('0x26')](_0x277147)[_0xd113('0x28')](_0xa4129b);}};}function respondWithFilteredResult(_0x3f3718,_0x2ff1fe){return function(_0x1f66b8){if(_0x1f66b8){var _0x8e525e=_0x1f66b8['count'],_0x87db5d=_0x2ff1fe[_0xd113('0x29')],_0xdc2802=_0x2ff1fe['offset']+_0x2ff1fe[_0xd113('0x2a')],_0xd0c75d;if(_0xdc2802>=_0x8e525e){_0xdc2802=_0x8e525e;_0xd0c75d=0xc8;}else{_0xd0c75d=0xce;}_0x3f3718[_0xd113('0x26')](_0xd0c75d);return _0x3f3718[_0xd113('0x2b')](_0xd113('0x2c'),_0x87db5d+'-'+_0xdc2802+'/'+_0x8e525e)[_0xd113('0x28')](_0x1f66b8);}return null;};}function patchUpdates(_0x6f7bff){return function(_0x3475f7){try{jsonpatch[_0xd113('0x2d')](_0x3475f7,_0x6f7bff,!![]);}catch(_0x2fd203){return BPromise[_0xd113('0x2e')](_0x2fd203);}return _0x3475f7[_0xd113('0x2f')]();};}function saveUpdates(_0x86eb57,_0x429371){return function(_0x23c46a){if(_0x23c46a){return _0x23c46a[_0xd113('0x30')](_0x86eb57)['then'](function(_0x5a32c9){return _0x5a32c9;});}return null;};}function removeEntity(_0x5c7a7e,_0x1c0dd8){return function(_0x1bc839){if(_0x1bc839){return _0x1bc839['destroy']()['then'](function(){_0x5c7a7e[_0xd113('0x26')](0xcc)[_0xd113('0x27')]();});}};}function handleEntityNotFound(_0x58b5aa,_0x56f6af){return function(_0x38b4c1){if(!_0x38b4c1){_0x58b5aa['sendStatus'](0x194);}return _0x38b4c1;};}function handleError(_0x56679e,_0x59e094){_0x59e094=_0x59e094||0x1f4;return function(_0x235fb5){logger[_0xd113('0x20')](_0x235fb5[_0xd113('0x31')]);if(_0x235fb5[_0xd113('0x32')]){delete _0x235fb5[_0xd113('0x32')];}_0x56679e[_0xd113('0x26')](_0x59e094)[_0xd113('0x33')](_0x235fb5);};}exports[_0xd113('0x34')]=function(_0x47e13c,_0x1e62cc){var _0x304204={},_0x302d2d={},_0x1f9a4b={'count':0x0,'rows':[]};var _0x361b0d=_['map'](db[_0xd113('0x35')]['rawAttributes'],function(_0x4f2478){return{'name':_0x4f2478[_0xd113('0x36')],'type':_0x4f2478['type'][_0xd113('0x37')]};});_0x302d2d[_0xd113('0x38')]=_[_0xd113('0x39')](_0x361b0d,_0xd113('0x32'));_0x302d2d[_0xd113('0x3a')]=_['keys'](_0x47e13c[_0xd113('0x3a')]);_0x302d2d[_0xd113('0x3b')]=_[_0xd113('0x3c')](_0x302d2d[_0xd113('0x38')],_0x302d2d['query']);_0x304204[_0xd113('0x3d')]=_['intersection'](_0x302d2d[_0xd113('0x38')],qs[_0xd113('0x3e')](_0x47e13c[_0xd113('0x3a')][_0xd113('0x3e')]));_0x304204[_0xd113('0x3d')]=_0x304204[_0xd113('0x3d')][_0xd113('0x3f')]?_0x304204['attributes']:_0x302d2d[_0xd113('0x38')];if(!_0x47e13c[_0xd113('0x3a')][_0xd113('0x40')]('nolimit')){_0x304204[_0xd113('0x2a')]=qs[_0xd113('0x2a')](_0x47e13c[_0xd113('0x3a')][_0xd113('0x2a')]);_0x304204['offset']=qs[_0xd113('0x29')](_0x47e13c['query']['offset']);}_0x304204[_0xd113('0x41')]=qs[_0xd113('0x42')](_0x47e13c[_0xd113('0x3a')]['sort']);_0x304204[_0xd113('0x43')]=qs[_0xd113('0x3b')](_[_0xd113('0x44')](_0x47e13c[_0xd113('0x3a')],_0x302d2d['filters']));if(_0x47e13c['query'][_0xd113('0x45')]){_0x304204['where']=_[_0xd113('0x46')](_0x304204[_0xd113('0x43')],{'$or':_['map'](_0x361b0d,function(_0x4e944f){if(_0x4e944f['type']!==_0xd113('0x47')){var _0x37e825={};_0x37e825[_0x4e944f[_0xd113('0x32')]]={'$like':'%'+_0x47e13c[_0xd113('0x3a')][_0xd113('0x45')]+'%'};return _0x37e825;}})});}_0x304204=_[_0xd113('0x46')]({},_0x304204,_0x47e13c[_0xd113('0x48')]);var _0x141097={'where':_0x304204[_0xd113('0x43')]};return db[_0xd113('0x35')]['count'](_0x141097)[_0xd113('0x49')](function(_0x379250){_0x1f9a4b[_0xd113('0x4a')]=_0x379250;if(_0x47e13c[_0xd113('0x3a')][_0xd113('0x4b')]){_0x304204['include']=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0xd113('0x4c')](_0x304204);})[_0xd113('0x49')](function(_0xc27540){_0x1f9a4b[_0xd113('0x4d')]=_0xc27540;return _0x1f9a4b;})[_0xd113('0x49')](respondWithFilteredResult(_0x1e62cc,_0x304204))[_0xd113('0x24')](handleError(_0x1e62cc,null));};exports[_0xd113('0x4e')]=function(_0x274375,_0x425d76){var _0x408f7e={'raw':![],'where':{'id':_0x274375[_0xd113('0x4f')]['id']}},_0x34562b={};_0x34562b[_0xd113('0x38')]=_[_0xd113('0x50')](db[_0xd113('0x35')]['rawAttributes']);_0x34562b[_0xd113('0x3a')]=_[_0xd113('0x50')](_0x274375['query']);_0x34562b['filters']=_[_0xd113('0x3c')](_0x34562b[_0xd113('0x38')],_0x34562b[_0xd113('0x3a')]);_0x408f7e[_0xd113('0x3d')]=_[_0xd113('0x3c')](_0x34562b['model'],qs[_0xd113('0x3e')](_0x274375[_0xd113('0x3a')][_0xd113('0x3e')]));_0x408f7e[_0xd113('0x3d')]=_0x408f7e[_0xd113('0x3d')][_0xd113('0x3f')]?_0x408f7e[_0xd113('0x3d')]:_0x34562b[_0xd113('0x38')];if(_0x274375[_0xd113('0x3a')]['includeAll']){_0x408f7e[_0xd113('0x51')]=[{'all':!![]}];}_0x408f7e=_[_0xd113('0x46')]({},_0x408f7e,_0x274375[_0xd113('0x48')]);return db[_0xd113('0x35')]['find'](_0x408f7e)[_0xd113('0x49')](handleEntityNotFound(_0x425d76,null))[_0xd113('0x49')](respondWithResult(_0x425d76,null))[_0xd113('0x24')](handleError(_0x425d76,null));};exports[_0xd113('0x52')]=function(_0x105fcc,_0x38d8b6){return db['SugarcrmConfiguration'][_0xd113('0x52')](_0x105fcc['body'],{})[_0xd113('0x49')](respondWithResult(_0x38d8b6,0xc9))['catch'](handleError(_0x38d8b6,null));};exports[_0xd113('0x30')]=function(_0x575dfc,_0x293c19){if(_0x575dfc[_0xd113('0x53')]['id']){delete _0x575dfc['body']['id'];}return db['SugarcrmConfiguration'][_0xd113('0x54')]({'where':{'id':_0x575dfc[_0xd113('0x4f')]['id']}})[_0xd113('0x49')](handleEntityNotFound(_0x293c19,null))[_0xd113('0x49')](saveUpdates(_0x575dfc['body'],null))[_0xd113('0x49')](respondWithResult(_0x293c19,null))[_0xd113('0x24')](handleError(_0x293c19,null));};exports[_0xd113('0x55')]=function(_0x3fbfd1,_0x37e110){return db[_0xd113('0x35')]['find']({'where':{'id':_0x3fbfd1[_0xd113('0x4f')]['id']}})[_0xd113('0x49')](handleEntityNotFound(_0x37e110,null))[_0xd113('0x49')](removeEntity(_0x37e110,null))[_0xd113('0x24')](handleError(_0x37e110,null));};exports[_0xd113('0x56')]=function(_0x562d53,_0x253785,_0x113216){var _0x5cfed9={};var _0x55441e={};var _0x52a447;var _0x366583;return db['SugarcrmConfiguration'][_0xd113('0x57')]({'where':{'id':_0x562d53['params']['id']}})[_0xd113('0x49')](handleEntityNotFound(_0x253785,null))[_0xd113('0x49')](function(_0x17801a){if(_0x17801a){_0x52a447=_0x17801a;_0x55441e[_0xd113('0x38')]=_[_0xd113('0x50')](db[_0xd113('0x58')]['rawAttributes']);_0x55441e[_0xd113('0x3a')]=_[_0xd113('0x50')](_0x562d53[_0xd113('0x3a')]);_0x55441e[_0xd113('0x3b')]=_[_0xd113('0x3c')](_0x55441e[_0xd113('0x38')],_0x55441e[_0xd113('0x3a')]);_0x5cfed9[_0xd113('0x3d')]=_['intersection'](_0x55441e['model'],qs[_0xd113('0x3e')](_0x562d53['query']['fields']));_0x5cfed9['attributes']=_0x5cfed9['attributes'][_0xd113('0x3f')]?_0x5cfed9[_0xd113('0x3d')]:_0x55441e[_0xd113('0x38')];_0x5cfed9[_0xd113('0x41')]=qs[_0xd113('0x42')](_0x562d53[_0xd113('0x3a')][_0xd113('0x42')]);_0x5cfed9[_0xd113('0x43')]=qs[_0xd113('0x3b')](_['pick'](_0x562d53[_0xd113('0x3a')],_0x55441e[_0xd113('0x3b')]));if(_0x562d53[_0xd113('0x3a')]['filter']){_0x5cfed9['where']=_['merge'](_0x5cfed9[_0xd113('0x43')],{'$or':_[_0xd113('0x39')](_0x5cfed9[_0xd113('0x3d')],function(_0x585884){var _0x33c718={};_0x33c718[_0x585884]={'$like':'%'+_0x562d53[_0xd113('0x3a')][_0xd113('0x45')]+'%'};return _0x33c718;})});}_0x5cfed9=_['merge']({},_0x5cfed9,_0x562d53['options']);return _0x52a447['getFields'](_0x5cfed9);}})[_0xd113('0x49')](function(_0x4bf95f){if(_0x4bf95f){_0x366583=_0x4bf95f[_0xd113('0x3f')];if(!_0x562d53[_0xd113('0x3a')][_0xd113('0x40')](_0xd113('0x59'))){_0x5cfed9[_0xd113('0x2a')]=qs[_0xd113('0x2a')](_0x562d53[_0xd113('0x3a')][_0xd113('0x2a')]);_0x5cfed9[_0xd113('0x29')]=qs[_0xd113('0x29')](_0x562d53[_0xd113('0x3a')][_0xd113('0x29')]);}return _0x52a447['getFields'](_0x5cfed9);}})[_0xd113('0x49')](function(_0x4e9d0d){if(_0x4e9d0d){return _0x4e9d0d?{'count':_0x366583,'rows':_0x4e9d0d}:null;}})[_0xd113('0x49')](respondWithResult(_0x253785,null))[_0xd113('0x24')](handleError(_0x253785,null));};exports[_0xd113('0x5a')]=function(_0x146bb0,_0x47972c,_0x2dea55){var _0x34885e={};var _0x5824ab={};var _0x5bb7a1;var _0x10886f;return db[_0xd113('0x35')][_0xd113('0x57')]({'where':{'id':_0x146bb0[_0xd113('0x4f')]['id']}})['then'](handleEntityNotFound(_0x47972c,null))[_0xd113('0x49')](function(_0x294cb7){if(_0x294cb7){_0x5bb7a1=_0x294cb7;_0x5824ab[_0xd113('0x38')]=_['keys'](db[_0xd113('0x58')][_0xd113('0x5b')]);_0x5824ab[_0xd113('0x3a')]=_['keys'](_0x146bb0['query']);_0x5824ab[_0xd113('0x3b')]=_[_0xd113('0x3c')](_0x5824ab[_0xd113('0x38')],_0x5824ab[_0xd113('0x3a')]);_0x34885e[_0xd113('0x3d')]=_['intersection'](_0x5824ab[_0xd113('0x38')],qs['fields'](_0x146bb0['query']['fields']));_0x34885e[_0xd113('0x3d')]=_0x34885e['attributes']['length']?_0x34885e['attributes']:_0x5824ab[_0xd113('0x38')];_0x34885e[_0xd113('0x41')]=qs[_0xd113('0x42')](_0x146bb0['query']['sort']);_0x34885e[_0xd113('0x43')]=qs[_0xd113('0x3b')](_[_0xd113('0x44')](_0x146bb0[_0xd113('0x3a')],_0x5824ab[_0xd113('0x3b')]));if(_0x146bb0['query']['filter']){_0x34885e[_0xd113('0x43')]=_[_0xd113('0x46')](_0x34885e[_0xd113('0x43')],{'$or':_[_0xd113('0x39')](_0x34885e[_0xd113('0x3d')],function(_0x3878c7){var _0x28904d={};_0x28904d[_0x3878c7]={'$like':'%'+_0x146bb0[_0xd113('0x3a')][_0xd113('0x45')]+'%'};return _0x28904d;})});}_0x34885e=_['merge']({},_0x34885e,_0x146bb0['options']);return _0x5bb7a1[_0xd113('0x5a')](_0x34885e);}})[_0xd113('0x49')](function(_0x404eb7){if(_0x404eb7){_0x10886f=_0x404eb7[_0xd113('0x3f')];if(!_0x146bb0[_0xd113('0x3a')][_0xd113('0x40')](_0xd113('0x59'))){_0x34885e[_0xd113('0x2a')]=qs[_0xd113('0x2a')](_0x146bb0[_0xd113('0x3a')]['limit']);_0x34885e[_0xd113('0x29')]=qs[_0xd113('0x29')](_0x146bb0[_0xd113('0x3a')]['offset']);}return _0x5bb7a1['getSubjects'](_0x34885e);}})['then'](function(_0x135ec0){if(_0x135ec0){return _0x135ec0?{'count':_0x10886f,'rows':_0x135ec0}:null;}})['then'](respondWithResult(_0x47972c,null))['catch'](handleError(_0x47972c,null));};exports[_0xd113('0x5c')]=function(_0x3a345f,_0x752488,_0x131c80){var _0x28f82a={};var _0x2f86dd={};var _0x2cd5ca;var _0x41695d;return db[_0xd113('0x35')][_0xd113('0x57')]({'where':{'id':_0x3a345f[_0xd113('0x4f')]['id']}})[_0xd113('0x49')](handleEntityNotFound(_0x752488,null))[_0xd113('0x49')](function(_0x4e9c0d){if(_0x4e9c0d){_0x2cd5ca=_0x4e9c0d;_0x2f86dd[_0xd113('0x38')]=_[_0xd113('0x50')](db[_0xd113('0x58')][_0xd113('0x5b')]);_0x2f86dd[_0xd113('0x3a')]=_[_0xd113('0x50')](_0x3a345f[_0xd113('0x3a')]);_0x2f86dd['filters']=_[_0xd113('0x3c')](_0x2f86dd['model'],_0x2f86dd[_0xd113('0x3a')]);_0x28f82a[_0xd113('0x3d')]=_[_0xd113('0x3c')](_0x2f86dd[_0xd113('0x38')],qs[_0xd113('0x3e')](_0x3a345f[_0xd113('0x3a')][_0xd113('0x3e')]));_0x28f82a[_0xd113('0x3d')]=_0x28f82a['attributes']['length']?_0x28f82a['attributes']:_0x2f86dd[_0xd113('0x38')];_0x28f82a[_0xd113('0x41')]=qs[_0xd113('0x42')](_0x3a345f[_0xd113('0x3a')]['sort']);_0x28f82a[_0xd113('0x43')]=qs[_0xd113('0x3b')](_['pick'](_0x3a345f[_0xd113('0x3a')],_0x2f86dd[_0xd113('0x3b')]));if(_0x3a345f['query'][_0xd113('0x45')]){_0x28f82a['where']=_['merge'](_0x28f82a[_0xd113('0x43')],{'$or':_[_0xd113('0x39')](_0x28f82a[_0xd113('0x3d')],function(_0x4a45f3){var _0x2e761a={};_0x2e761a[_0x4a45f3]={'$like':'%'+_0x3a345f[_0xd113('0x3a')][_0xd113('0x45')]+'%'};return _0x2e761a;})});}_0x28f82a=_[_0xd113('0x46')]({},_0x28f82a,_0x3a345f[_0xd113('0x48')]);return _0x2cd5ca['getDescriptions'](_0x28f82a);}})[_0xd113('0x49')](function(_0x450f1e){if(_0x450f1e){_0x41695d=_0x450f1e[_0xd113('0x3f')];if(!_0x3a345f[_0xd113('0x3a')]['hasOwnProperty'](_0xd113('0x59'))){_0x28f82a[_0xd113('0x2a')]=qs['limit'](_0x3a345f['query'][_0xd113('0x2a')]);_0x28f82a[_0xd113('0x29')]=qs[_0xd113('0x29')](_0x3a345f[_0xd113('0x3a')][_0xd113('0x29')]);}return _0x2cd5ca[_0xd113('0x5c')](_0x28f82a);}})[_0xd113('0x49')](function(_0x3a9551){if(_0x3a9551){return _0x3a9551?{'count':_0x41695d,'rows':_0x3a9551}:null;}})['then'](respondWithResult(_0x752488,null))[_0xd113('0x24')](handleError(_0x752488,null));}; \ No newline at end of file +var _0xb2f9=['include','SugarcrmConfiguration','findAll','rows','catch','show','find','create','body','params','getFields','findOne','SugarcrmField','order','pick','hasOwnProperty','getSubjects','getDescriptions','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','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~!@#$%^&-_=+[{]}.','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','stack','name','send','index','map','rawAttributes','query','keys','filters','intersection','model','attributes','fields','length','nolimit','sort','where','filter','merge','type','VIRTUAL','options','includeAll'];(function(_0x3a4652,_0x1737ee){var _0x342598=function(_0x2e41da){while(--_0x2e41da){_0x3a4652['push'](_0x3a4652['shift']());}};_0x342598(++_0x1737ee);}(_0xb2f9,0x6b));var _0x9b2f=function(_0xb7ceee,_0x186d1e){_0xb7ceee=_0xb7ceee-0x0;var _0x282858=_0xb2f9[_0xb7ceee];return _0x282858;};'use strict';var pdf=require(_0x9b2f('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x9b2f('0x1'));var zipdir=require(_0x9b2f('0x2'));var jsonpatch=require(_0x9b2f('0x3'));var rp=require(_0x9b2f('0x4'));var moment=require(_0x9b2f('0x5'));var BPromise=require(_0x9b2f('0x6'));var Mustache=require('mustache');var util=require(_0x9b2f('0x7'));var path=require(_0x9b2f('0x8'));var sox=require(_0x9b2f('0x9'));var csv=require(_0x9b2f('0xa'));var ejs=require(_0x9b2f('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x9b2f('0xc'));var jsforce=require(_0x9b2f('0xd'));var deskjs=require(_0x9b2f('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9b2f('0xf'));var qs=require(_0x9b2f('0x10'));var as=require(_0x9b2f('0x11'));var hardwareService=require(_0x9b2f('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x9b2f('0x13'));var config=require(_0x9b2f('0x14'));var db=require('../../mysqldb')['db'];var jayson=require(_0x9b2f('0x15'));var client=jayson[_0x9b2f('0x16')]['http']({'port':0x232a});function checkPasswordPattern(_0x459e29,_0x9ec150,_0x228cc3){if(_0x228cc3){var _0x733516=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x733516[_0x9b2f('0x17')](_0x9ec150)){return _0x459e29;}else{throw new db[(_0x9b2f('0x18'))]['ValidationError'](_0x9b2f('0x19'));}}else{return _0x459e29;}}function respondWithRpcPromise(_0xbb875b,_0x103480,_0x1a0736,_0x4e0dfd){return new BPromise(function(_0x4d335d,_0x549c9f){var _0x6f780d=_0x4e0dfd||client;return _0x6f780d['request'](_0xbb875b,_0x1a0736)[_0x9b2f('0x1a')](function(_0xfd0aa2){logger[_0x9b2f('0x1b')](_0x9b2f('0x1c'),_0x103480,_0x9b2f('0x1d'));logger['debug'](_0x9b2f('0x1e'),_0x103480,_0x9b2f('0x1d'),JSON['stringify'](_0xfd0aa2));if(_0xfd0aa2[_0x9b2f('0x1f')]){if(_0xfd0aa2[_0x9b2f('0x1f')][_0x9b2f('0x20')]===0x1f4){logger[_0x9b2f('0x1f')](_0x9b2f('0x1c'),_0x103480,_0xfd0aa2[_0x9b2f('0x1f')][_0x9b2f('0x21')]);return _0x549c9f(_0xfd0aa2[_0x9b2f('0x1f')][_0x9b2f('0x21')]);}logger[_0x9b2f('0x1f')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x103480,_0xfd0aa2['error']['message']);return _0x4d335d(_0xfd0aa2[_0x9b2f('0x1f')][_0x9b2f('0x21')]);}else{logger[_0x9b2f('0x1b')](_0x9b2f('0x1c'),_0x103480,_0x9b2f('0x1d'));_0x4d335d(_0xfd0aa2[_0x9b2f('0x22')][_0x9b2f('0x21')]);}})['catch'](function(_0x2a5665){logger[_0x9b2f('0x1f')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x103480,_0x2a5665);_0x549c9f(_0x2a5665);});});}function respondWithStatusCode(_0x13cdbf,_0x15e960){_0x15e960=_0x15e960||0xcc;return function(_0x1ce65c){if(_0x1ce65c){return _0x13cdbf[_0x9b2f('0x23')](_0x15e960);}return _0x13cdbf[_0x9b2f('0x24')](_0x15e960)[_0x9b2f('0x25')]();};}function respondWithResult(_0xa5fb57,_0x3d89ec){_0x3d89ec=_0x3d89ec||0xc8;return function(_0x520d2f){if(_0x520d2f){return _0xa5fb57[_0x9b2f('0x24')](_0x3d89ec)[_0x9b2f('0x26')](_0x520d2f);}};}function respondWithFilteredResult(_0x101b88,_0x2ec7d6){return function(_0xa8cedb){if(_0xa8cedb){var _0x210dc3=_0xa8cedb[_0x9b2f('0x27')],_0x1ec5f4=_0x2ec7d6['offset'],_0x364993=_0x2ec7d6[_0x9b2f('0x28')]+_0x2ec7d6[_0x9b2f('0x29')],_0x27edca;if(_0x364993>=_0x210dc3){_0x364993=_0x210dc3;_0x27edca=0xc8;}else{_0x27edca=0xce;}_0x101b88[_0x9b2f('0x24')](_0x27edca);return _0x101b88[_0x9b2f('0x2a')](_0x9b2f('0x2b'),_0x1ec5f4+'-'+_0x364993+'/'+_0x210dc3)[_0x9b2f('0x26')](_0xa8cedb);}return null;};}function patchUpdates(_0x2fa507){return function(_0x2f05a3){try{jsonpatch['apply'](_0x2f05a3,_0x2fa507,!![]);}catch(_0x185fc9){return BPromise[_0x9b2f('0x2c')](_0x185fc9);}return _0x2f05a3[_0x9b2f('0x2d')]();};}function saveUpdates(_0x355655,_0x13d778){return function(_0x5f309a){if(_0x5f309a){return _0x5f309a[_0x9b2f('0x2e')](_0x355655)['then'](function(_0x434137){return _0x434137;});}return null;};}function removeEntity(_0x3e5a46,_0x28ee1d){return function(_0xfd7c65){if(_0xfd7c65){return _0xfd7c65[_0x9b2f('0x2f')]()[_0x9b2f('0x1a')](function(){_0x3e5a46[_0x9b2f('0x24')](0xcc)[_0x9b2f('0x25')]();});}};}function handleEntityNotFound(_0x25bd6c,_0x5eceff){return function(_0x154f43){if(!_0x154f43){_0x25bd6c[_0x9b2f('0x23')](0x194);}return _0x154f43;};}function handleError(_0x2d31a7,_0x10fdd6){_0x10fdd6=_0x10fdd6||0x1f4;return function(_0x48c269){logger[_0x9b2f('0x1f')](_0x48c269[_0x9b2f('0x30')]);if(_0x48c269['name']){delete _0x48c269[_0x9b2f('0x31')];}_0x2d31a7['status'](_0x10fdd6)[_0x9b2f('0x32')](_0x48c269);};}exports[_0x9b2f('0x33')]=function(_0x1642bb,_0x542c98){var _0x158ac6={},_0x2dd27d={},_0x27583b={'count':0x0,'rows':[]};var _0x3cea90=_[_0x9b2f('0x34')](db['SugarcrmConfiguration'][_0x9b2f('0x35')],function(_0x2b71c1){return{'name':_0x2b71c1['fieldName'],'type':_0x2b71c1['type']['key']};});_0x2dd27d['model']=_['map'](_0x3cea90,'name');_0x2dd27d[_0x9b2f('0x36')]=_[_0x9b2f('0x37')](_0x1642bb['query']);_0x2dd27d[_0x9b2f('0x38')]=_[_0x9b2f('0x39')](_0x2dd27d[_0x9b2f('0x3a')],_0x2dd27d[_0x9b2f('0x36')]);_0x158ac6[_0x9b2f('0x3b')]=_[_0x9b2f('0x39')](_0x2dd27d[_0x9b2f('0x3a')],qs['fields'](_0x1642bb['query'][_0x9b2f('0x3c')]));_0x158ac6[_0x9b2f('0x3b')]=_0x158ac6[_0x9b2f('0x3b')][_0x9b2f('0x3d')]?_0x158ac6[_0x9b2f('0x3b')]:_0x2dd27d['model'];if(!_0x1642bb[_0x9b2f('0x36')]['hasOwnProperty'](_0x9b2f('0x3e'))){_0x158ac6[_0x9b2f('0x29')]=qs[_0x9b2f('0x29')](_0x1642bb['query'][_0x9b2f('0x29')]);_0x158ac6['offset']=qs['offset'](_0x1642bb['query'][_0x9b2f('0x28')]);}_0x158ac6['order']=qs['sort'](_0x1642bb[_0x9b2f('0x36')][_0x9b2f('0x3f')]);_0x158ac6[_0x9b2f('0x40')]=qs[_0x9b2f('0x38')](_['pick'](_0x1642bb['query'],_0x2dd27d[_0x9b2f('0x38')]));if(_0x1642bb[_0x9b2f('0x36')][_0x9b2f('0x41')]){_0x158ac6[_0x9b2f('0x40')]=_[_0x9b2f('0x42')](_0x158ac6[_0x9b2f('0x40')],{'$or':_[_0x9b2f('0x34')](_0x3cea90,function(_0xbb4bee){if(_0xbb4bee[_0x9b2f('0x43')]!==_0x9b2f('0x44')){var _0x2f72e9={};_0x2f72e9[_0xbb4bee[_0x9b2f('0x31')]]={'$like':'%'+_0x1642bb['query'][_0x9b2f('0x41')]+'%'};return _0x2f72e9;}})});}_0x158ac6=_[_0x9b2f('0x42')]({},_0x158ac6,_0x1642bb[_0x9b2f('0x45')]);var _0x16a47c={'where':_0x158ac6[_0x9b2f('0x40')]};return db['SugarcrmConfiguration']['count'](_0x16a47c)[_0x9b2f('0x1a')](function(_0x58f2ca){_0x27583b[_0x9b2f('0x27')]=_0x58f2ca;if(_0x1642bb[_0x9b2f('0x36')][_0x9b2f('0x46')]){_0x158ac6[_0x9b2f('0x47')]=[{'all':!![]}];}return db[_0x9b2f('0x48')][_0x9b2f('0x49')](_0x158ac6);})[_0x9b2f('0x1a')](function(_0x22fc22){_0x27583b[_0x9b2f('0x4a')]=_0x22fc22;return _0x27583b;})[_0x9b2f('0x1a')](respondWithFilteredResult(_0x542c98,_0x158ac6))[_0x9b2f('0x4b')](handleError(_0x542c98,null));};exports[_0x9b2f('0x4c')]=function(_0xbc19bd,_0x1bd349){var _0x12ebbe={'raw':![],'where':{'id':_0xbc19bd['params']['id']}},_0x3299c8={};_0x3299c8[_0x9b2f('0x3a')]=_['keys'](db[_0x9b2f('0x48')][_0x9b2f('0x35')]);_0x3299c8[_0x9b2f('0x36')]=_[_0x9b2f('0x37')](_0xbc19bd[_0x9b2f('0x36')]);_0x3299c8[_0x9b2f('0x38')]=_[_0x9b2f('0x39')](_0x3299c8[_0x9b2f('0x3a')],_0x3299c8[_0x9b2f('0x36')]);_0x12ebbe[_0x9b2f('0x3b')]=_[_0x9b2f('0x39')](_0x3299c8[_0x9b2f('0x3a')],qs[_0x9b2f('0x3c')](_0xbc19bd['query'][_0x9b2f('0x3c')]));_0x12ebbe[_0x9b2f('0x3b')]=_0x12ebbe[_0x9b2f('0x3b')]['length']?_0x12ebbe[_0x9b2f('0x3b')]:_0x3299c8[_0x9b2f('0x3a')];if(_0xbc19bd[_0x9b2f('0x36')][_0x9b2f('0x46')]){_0x12ebbe[_0x9b2f('0x47')]=[{'all':!![]}];}_0x12ebbe=_[_0x9b2f('0x42')]({},_0x12ebbe,_0xbc19bd[_0x9b2f('0x45')]);return db[_0x9b2f('0x48')][_0x9b2f('0x4d')](_0x12ebbe)[_0x9b2f('0x1a')](handleEntityNotFound(_0x1bd349,null))[_0x9b2f('0x1a')](respondWithResult(_0x1bd349,null))['catch'](handleError(_0x1bd349,null));};exports[_0x9b2f('0x4e')]=function(_0x230ccb,_0x43e123){return db[_0x9b2f('0x48')][_0x9b2f('0x4e')](_0x230ccb[_0x9b2f('0x4f')],{})['then'](respondWithResult(_0x43e123,0xc9))[_0x9b2f('0x4b')](handleError(_0x43e123,null));};exports[_0x9b2f('0x2e')]=function(_0x245fb0,_0x496f5b){if(_0x245fb0[_0x9b2f('0x4f')]['id']){delete _0x245fb0[_0x9b2f('0x4f')]['id'];}return db[_0x9b2f('0x48')][_0x9b2f('0x4d')]({'where':{'id':_0x245fb0[_0x9b2f('0x50')]['id']}})[_0x9b2f('0x1a')](handleEntityNotFound(_0x496f5b,null))[_0x9b2f('0x1a')](saveUpdates(_0x245fb0['body'],null))[_0x9b2f('0x1a')](respondWithResult(_0x496f5b,null))[_0x9b2f('0x4b')](handleError(_0x496f5b,null));};exports[_0x9b2f('0x2f')]=function(_0xd3e8da,_0x1ed27d){return db[_0x9b2f('0x48')]['find']({'where':{'id':_0xd3e8da[_0x9b2f('0x50')]['id']}})['then'](handleEntityNotFound(_0x1ed27d,null))[_0x9b2f('0x1a')](removeEntity(_0x1ed27d,null))[_0x9b2f('0x4b')](handleError(_0x1ed27d,null));};exports[_0x9b2f('0x51')]=function(_0x39f6d4,_0x43b194,_0x585821){var _0x47bb97={};var _0x3b1e9f={};var _0x5ad847;var _0x364528;return db[_0x9b2f('0x48')][_0x9b2f('0x52')]({'where':{'id':_0x39f6d4['params']['id']}})[_0x9b2f('0x1a')](handleEntityNotFound(_0x43b194,null))[_0x9b2f('0x1a')](function(_0x3f26cf){if(_0x3f26cf){_0x5ad847=_0x3f26cf;_0x3b1e9f['model']=_['keys'](db[_0x9b2f('0x53')][_0x9b2f('0x35')]);_0x3b1e9f['query']=_[_0x9b2f('0x37')](_0x39f6d4[_0x9b2f('0x36')]);_0x3b1e9f['filters']=_['intersection'](_0x3b1e9f[_0x9b2f('0x3a')],_0x3b1e9f['query']);_0x47bb97[_0x9b2f('0x3b')]=_[_0x9b2f('0x39')](_0x3b1e9f[_0x9b2f('0x3a')],qs[_0x9b2f('0x3c')](_0x39f6d4[_0x9b2f('0x36')][_0x9b2f('0x3c')]));_0x47bb97[_0x9b2f('0x3b')]=_0x47bb97['attributes'][_0x9b2f('0x3d')]?_0x47bb97[_0x9b2f('0x3b')]:_0x3b1e9f[_0x9b2f('0x3a')];_0x47bb97[_0x9b2f('0x54')]=qs[_0x9b2f('0x3f')](_0x39f6d4['query'][_0x9b2f('0x3f')]);_0x47bb97[_0x9b2f('0x40')]=qs[_0x9b2f('0x38')](_[_0x9b2f('0x55')](_0x39f6d4[_0x9b2f('0x36')],_0x3b1e9f[_0x9b2f('0x38')]));if(_0x39f6d4['query']['filter']){_0x47bb97[_0x9b2f('0x40')]=_[_0x9b2f('0x42')](_0x47bb97[_0x9b2f('0x40')],{'$or':_['map'](_0x47bb97[_0x9b2f('0x3b')],function(_0x4a6242){var _0x13950c={};_0x13950c[_0x4a6242]={'$like':'%'+_0x39f6d4[_0x9b2f('0x36')][_0x9b2f('0x41')]+'%'};return _0x13950c;})});}_0x47bb97=_[_0x9b2f('0x42')]({},_0x47bb97,_0x39f6d4['options']);return _0x5ad847['getFields'](_0x47bb97);}})[_0x9b2f('0x1a')](function(_0x1e029a){if(_0x1e029a){_0x364528=_0x1e029a[_0x9b2f('0x3d')];if(!_0x39f6d4['query'][_0x9b2f('0x56')]('nolimit')){_0x47bb97[_0x9b2f('0x29')]=qs[_0x9b2f('0x29')](_0x39f6d4[_0x9b2f('0x36')][_0x9b2f('0x29')]);_0x47bb97[_0x9b2f('0x28')]=qs[_0x9b2f('0x28')](_0x39f6d4[_0x9b2f('0x36')]['offset']);}return _0x5ad847['getFields'](_0x47bb97);}})[_0x9b2f('0x1a')](function(_0x5d7c29){if(_0x5d7c29){return _0x5d7c29?{'count':_0x364528,'rows':_0x5d7c29}:null;}})[_0x9b2f('0x1a')](respondWithResult(_0x43b194,null))[_0x9b2f('0x4b')](handleError(_0x43b194,null));};exports[_0x9b2f('0x57')]=function(_0x43a087,_0x1c8957,_0x42395f){var _0x212839={};var _0x1c71a3={};var _0x41a227;var _0x20a2be;return db[_0x9b2f('0x48')]['findOne']({'where':{'id':_0x43a087['params']['id']}})[_0x9b2f('0x1a')](handleEntityNotFound(_0x1c8957,null))[_0x9b2f('0x1a')](function(_0x5325eb){if(_0x5325eb){_0x41a227=_0x5325eb;_0x1c71a3[_0x9b2f('0x3a')]=_[_0x9b2f('0x37')](db[_0x9b2f('0x53')][_0x9b2f('0x35')]);_0x1c71a3[_0x9b2f('0x36')]=_[_0x9b2f('0x37')](_0x43a087[_0x9b2f('0x36')]);_0x1c71a3[_0x9b2f('0x38')]=_[_0x9b2f('0x39')](_0x1c71a3[_0x9b2f('0x3a')],_0x1c71a3[_0x9b2f('0x36')]);_0x212839[_0x9b2f('0x3b')]=_['intersection'](_0x1c71a3['model'],qs['fields'](_0x43a087[_0x9b2f('0x36')][_0x9b2f('0x3c')]));_0x212839[_0x9b2f('0x3b')]=_0x212839['attributes']['length']?_0x212839[_0x9b2f('0x3b')]:_0x1c71a3[_0x9b2f('0x3a')];_0x212839['order']=qs[_0x9b2f('0x3f')](_0x43a087['query'][_0x9b2f('0x3f')]);_0x212839['where']=qs[_0x9b2f('0x38')](_[_0x9b2f('0x55')](_0x43a087[_0x9b2f('0x36')],_0x1c71a3[_0x9b2f('0x38')]));if(_0x43a087[_0x9b2f('0x36')][_0x9b2f('0x41')]){_0x212839[_0x9b2f('0x40')]=_[_0x9b2f('0x42')](_0x212839['where'],{'$or':_['map'](_0x212839[_0x9b2f('0x3b')],function(_0x2e4dad){var _0x462800={};_0x462800[_0x2e4dad]={'$like':'%'+_0x43a087[_0x9b2f('0x36')]['filter']+'%'};return _0x462800;})});}_0x212839=_['merge']({},_0x212839,_0x43a087['options']);return _0x41a227['getSubjects'](_0x212839);}})[_0x9b2f('0x1a')](function(_0x48dffa){if(_0x48dffa){_0x20a2be=_0x48dffa['length'];if(!_0x43a087[_0x9b2f('0x36')][_0x9b2f('0x56')](_0x9b2f('0x3e'))){_0x212839[_0x9b2f('0x29')]=qs['limit'](_0x43a087[_0x9b2f('0x36')]['limit']);_0x212839[_0x9b2f('0x28')]=qs[_0x9b2f('0x28')](_0x43a087[_0x9b2f('0x36')]['offset']);}return _0x41a227[_0x9b2f('0x57')](_0x212839);}})['then'](function(_0x57d447){if(_0x57d447){return _0x57d447?{'count':_0x20a2be,'rows':_0x57d447}:null;}})[_0x9b2f('0x1a')](respondWithResult(_0x1c8957,null))[_0x9b2f('0x4b')](handleError(_0x1c8957,null));};exports[_0x9b2f('0x58')]=function(_0xf7cb3e,_0x3efa63,_0x5dc37d){var _0x33a73f={};var _0x4b5688={};var _0x4a6f34;var _0x4d8a50;return db[_0x9b2f('0x48')][_0x9b2f('0x52')]({'where':{'id':_0xf7cb3e['params']['id']}})[_0x9b2f('0x1a')](handleEntityNotFound(_0x3efa63,null))[_0x9b2f('0x1a')](function(_0x23498c){if(_0x23498c){_0x4a6f34=_0x23498c;_0x4b5688['model']=_[_0x9b2f('0x37')](db[_0x9b2f('0x53')]['rawAttributes']);_0x4b5688['query']=_[_0x9b2f('0x37')](_0xf7cb3e[_0x9b2f('0x36')]);_0x4b5688['filters']=_[_0x9b2f('0x39')](_0x4b5688[_0x9b2f('0x3a')],_0x4b5688['query']);_0x33a73f[_0x9b2f('0x3b')]=_[_0x9b2f('0x39')](_0x4b5688[_0x9b2f('0x3a')],qs[_0x9b2f('0x3c')](_0xf7cb3e[_0x9b2f('0x36')]['fields']));_0x33a73f[_0x9b2f('0x3b')]=_0x33a73f[_0x9b2f('0x3b')][_0x9b2f('0x3d')]?_0x33a73f[_0x9b2f('0x3b')]:_0x4b5688[_0x9b2f('0x3a')];_0x33a73f[_0x9b2f('0x54')]=qs[_0x9b2f('0x3f')](_0xf7cb3e['query']['sort']);_0x33a73f['where']=qs[_0x9b2f('0x38')](_[_0x9b2f('0x55')](_0xf7cb3e[_0x9b2f('0x36')],_0x4b5688[_0x9b2f('0x38')]));if(_0xf7cb3e['query'][_0x9b2f('0x41')]){_0x33a73f['where']=_['merge'](_0x33a73f[_0x9b2f('0x40')],{'$or':_[_0x9b2f('0x34')](_0x33a73f[_0x9b2f('0x3b')],function(_0x31f867){var _0x179909={};_0x179909[_0x31f867]={'$like':'%'+_0xf7cb3e[_0x9b2f('0x36')][_0x9b2f('0x41')]+'%'};return _0x179909;})});}_0x33a73f=_[_0x9b2f('0x42')]({},_0x33a73f,_0xf7cb3e['options']);return _0x4a6f34[_0x9b2f('0x58')](_0x33a73f);}})[_0x9b2f('0x1a')](function(_0x1dbce6){if(_0x1dbce6){_0x4d8a50=_0x1dbce6['length'];if(!_0xf7cb3e[_0x9b2f('0x36')]['hasOwnProperty'](_0x9b2f('0x3e'))){_0x33a73f[_0x9b2f('0x29')]=qs['limit'](_0xf7cb3e[_0x9b2f('0x36')][_0x9b2f('0x29')]);_0x33a73f[_0x9b2f('0x28')]=qs[_0x9b2f('0x28')](_0xf7cb3e[_0x9b2f('0x36')][_0x9b2f('0x28')]);}return _0x4a6f34[_0x9b2f('0x58')](_0x33a73f);}})[_0x9b2f('0x1a')](function(_0x4acca0){if(_0x4acca0){return _0x4acca0?{'count':_0x4d8a50,'rows':_0x4acca0}:null;}})[_0x9b2f('0x1a')](respondWithResult(_0x3efa63,null))[_0x9b2f('0x4b')](handleError(_0x3efa63,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 2f3eb10..0a9a76f 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 _0xd270=['../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0xd62041,_0x6fdb24){var _0x4483fa=function(_0x354d2d){while(--_0x354d2d){_0xd62041['push'](_0xd62041['shift']());}};_0x4483fa(++_0x6fdb24);}(_0xd270,0x156));var _0x0d27=function(_0x40396c,_0x19cd07){_0x40396c=_0x40396c-0x0;var _0x587fa6=_0xd270[_0x40396c];return _0x587fa6;};'use strict';var _=require(_0x0d27('0x0'));var util=require(_0x0d27('0x1'));var logger=require(_0x0d27('0x2'))(_0x0d27('0x3'));var moment=require(_0x0d27('0x4'));var BPromise=require('bluebird');var rp=require(_0x0d27('0x5'));var fs=require('fs');var path=require(_0x0d27('0x6'));var rimraf=require(_0x0d27('0x7'));var config=require(_0x0d27('0x8'));var attributes=require(_0x0d27('0x9'));module[_0x0d27('0xa')]=function(_0x40a7df,_0x3e0920){return _0x40a7df[_0x0d27('0xb')](_0x0d27('0xc'),attributes,{'tableName':_0x0d27('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5761=['SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x36d0a5,_0x21fe53){var _0x1109bf=function(_0xe04aa6){while(--_0xe04aa6){_0x36d0a5['push'](_0x36d0a5['shift']());}};_0x1109bf(++_0x21fe53);}(_0x5761,0x120));var _0x1576=function(_0x3257a4,_0x5e9eda){_0x3257a4=_0x3257a4-0x0;var _0x4edaba=_0x5761[_0x3257a4];return _0x4edaba;};'use strict';var _=require(_0x1576('0x0'));var util=require(_0x1576('0x1'));var logger=require(_0x1576('0x2'))(_0x1576('0x3'));var moment=require(_0x1576('0x4'));var BPromise=require(_0x1576('0x5'));var rp=require(_0x1576('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1576('0x7'));var config=require(_0x1576('0x8'));var attributes=require('./intSugarcrmConfiguration.attributes');module['exports']=function(_0x586cff,_0x4514f3){return _0x586cff['define'](_0x1576('0x9'),attributes,{'tableName':_0x1576('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index dd7bb3d..5083428 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 _0x9f66=['rpc','client','http','request','then','info','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','SugarcrmConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x3215b8,_0x271e86){var _0x400428=function(_0x2cec07){while(--_0x2cec07){_0x3215b8['push'](_0x3215b8['shift']());}};_0x400428(++_0x271e86);}(_0x9f66,0x196));var _0x69f6=function(_0x4f00ef,_0x56541c){_0x4f00ef=_0x4f00ef-0x0;var _0x3a8766=_0x9f66[_0x4f00ef];return _0x3a8766;};'use strict';var _=require(_0x69f6('0x0'));var util=require(_0x69f6('0x1'));var moment=require(_0x69f6('0x2'));var BPromise=require(_0x69f6('0x3'));var rs=require(_0x69f6('0x4'));var fs=require('fs');var Redis=require(_0x69f6('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x69f6('0x6'));var logger=require(_0x69f6('0x7'))(_0x69f6('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x69f6('0x9')][_0x69f6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x8f13a0,_0x1ea689,_0x50b9db){return new BPromise(function(_0x3bb173,_0x53a3d5){return client[_0x69f6('0xb')](_0x8f13a0,_0x50b9db)[_0x69f6('0xc')](function(_0x33d504){logger[_0x69f6('0xd')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x1ea689,_0x69f6('0xe'));logger[_0x69f6('0xf')](_0x69f6('0x10'),_0x1ea689,_0x69f6('0xe'),JSON[_0x69f6('0x11')](_0x33d504));if(_0x33d504[_0x69f6('0x12')]){if(_0x33d504[_0x69f6('0x12')]['code']===0x1f4){logger['error'](_0x69f6('0x13'),_0x1ea689,_0x33d504[_0x69f6('0x12')]['message']);return _0x53a3d5(_0x33d504[_0x69f6('0x12')][_0x69f6('0x14')]);}logger[_0x69f6('0x12')](_0x69f6('0x13'),_0x1ea689,_0x33d504[_0x69f6('0x12')][_0x69f6('0x14')]);return _0x3bb173(_0x33d504['error'][_0x69f6('0x14')]);}else{logger[_0x69f6('0xd')](_0x69f6('0x13'),_0x1ea689,_0x69f6('0xe'));_0x3bb173(_0x33d504[_0x69f6('0x15')]['message']);}})[_0x69f6('0x16')](function(_0x184ed0){logger[_0x69f6('0x12')](_0x69f6('0x13'),_0x1ea689,_0x184ed0);_0x53a3d5(_0x184ed0);});});} \ No newline at end of file +var _0x74d0=['request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x1c9b4d,_0x5c0f71){var _0x42b672=function(_0x6e7fd2){while(--_0x6e7fd2){_0x1c9b4d['push'](_0x1c9b4d['shift']());}};_0x42b672(++_0x5c0f71);}(_0x74d0,0xa6));var _0x074d=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0x74d0[_0x2b10c6];return _0x3789d2;};'use strict';var _=require(_0x074d('0x0'));var util=require('util');var moment=require(_0x074d('0x1'));var BPromise=require(_0x074d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x074d('0x3'))['db'];var utils=require(_0x074d('0x4'));var logger=require('../../config/logger')(_0x074d('0x5'));var config=require(_0x074d('0x6'));var jayson=require(_0x074d('0x7'));var client=jayson[_0x074d('0x8')][_0x074d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3e7e21,_0x383840,_0x214f56){return new BPromise(function(_0x802586,_0xf88685){return client[_0x074d('0xa')](_0x3e7e21,_0x214f56)[_0x074d('0xb')](function(_0x4c43f5){logger[_0x074d('0xc')](_0x074d('0xd'),_0x383840,_0x074d('0xe'));logger[_0x074d('0xf')](_0x074d('0x10'),_0x383840,'request\x20sent',JSON[_0x074d('0x11')](_0x4c43f5));if(_0x4c43f5[_0x074d('0x12')]){if(_0x4c43f5['error'][_0x074d('0x13')]===0x1f4){logger[_0x074d('0x12')](_0x074d('0xd'),_0x383840,_0x4c43f5[_0x074d('0x12')][_0x074d('0x14')]);return _0xf88685(_0x4c43f5[_0x074d('0x12')]['message']);}logger['error'](_0x074d('0xd'),_0x383840,_0x4c43f5['error'][_0x074d('0x14')]);return _0x802586(_0x4c43f5['error'][_0x074d('0x14')]);}else{logger[_0x074d('0xc')](_0x074d('0xd'),_0x383840,_0x074d('0xe'));_0x802586(_0x4c43f5['result']['message']);}})[_0x074d('0x15')](function(_0x45bdb3){logger[_0x074d('0x12')](_0x074d('0xd'),_0x383840,_0x45bdb3);_0xf88685(_0x45bdb3);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index c6b6d9b..c79ff50 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 _0x38cc=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index','/:id','show','post','create','put','destroy','multer','path','connect-timeout','express'];(function(_0x308374,_0x550e85){var _0x1f71e0=function(_0x18377d){while(--_0x18377d){_0x308374['push'](_0x308374['shift']());}};_0x1f71e0(++_0x550e85);}(_0x38cc,0x19a));var _0xc38c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x38cc[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xc38c('0x0'));var util=require('util');var path=require(_0xc38c('0x1'));var timeout=require(_0xc38c('0x2'));var express=require(_0xc38c('0x3'));var router=express[_0xc38c('0x4')]();var auth=require(_0xc38c('0x5'));var interaction=require(_0xc38c('0x6'));var config=require(_0xc38c('0x7'));var controller=require(_0xc38c('0x8'));router[_0xc38c('0x9')]('/',auth[_0xc38c('0xa')](),controller[_0xc38c('0xb')]);router[_0xc38c('0x9')](_0xc38c('0xc'),auth[_0xc38c('0xa')](),controller[_0xc38c('0xd')]);router[_0xc38c('0xe')]('/',auth['isAuthenticated'](),controller[_0xc38c('0xf')]);router[_0xc38c('0x10')]('/:id',auth[_0xc38c('0xa')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xc38c('0x11')]);module['exports']=router; \ No newline at end of file +var _0xf74f=['put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intSugarcrmField.controller','get','index','isAuthenticated','post'];(function(_0x590b61,_0x4c4335){var _0x1a14dc=function(_0x2ff4f6){while(--_0x2ff4f6){_0x590b61['push'](_0x590b61['shift']());}};_0x1a14dc(++_0x4c4335);}(_0xf74f,0x16d));var _0xff74=function(_0x55eb2d,_0x4a651a){_0x55eb2d=_0x55eb2d-0x0;var _0xa231=_0xf74f[_0x55eb2d];return _0xa231;};'use strict';var multer=require(_0xff74('0x0'));var util=require(_0xff74('0x1'));var path=require(_0xff74('0x2'));var timeout=require(_0xff74('0x3'));var express=require(_0xff74('0x4'));var router=express[_0xff74('0x5')]();var auth=require(_0xff74('0x6'));var interaction=require(_0xff74('0x7'));var config=require('../../config/environment');var controller=require(_0xff74('0x8'));router[_0xff74('0x9')]('/',auth['isAuthenticated'](),controller[_0xff74('0xa')]);router['get']('/:id',auth[_0xff74('0xb')](),controller['show']);router[_0xff74('0xc')]('/',auth[_0xff74('0xb')](),controller['create']);router[_0xff74('0xd')](_0xff74('0xe'),auth[_0xff74('0xb')](),controller[_0xff74('0xf')]);router['delete'](_0xff74('0xe'),auth[_0xff74('0xb')](),controller[_0xff74('0x10')]);module[_0xff74('0x11')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 4a5cd07..b3f0e17 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 _0x3937=['variable','BOOLEAN','sequelize','ENUM','string','customVariable','STRING'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x3937,0xbf));var _0x7393=function(_0x3086b0,_0x30c203){_0x3086b0=_0x3086b0-0x0;var _0x25e82e=_0x3937[_0x3086b0];return _0x25e82e;};'use strict';var Sequelize=require(_0x7393('0x0'));module['exports']={'type':{'type':Sequelize[_0x7393('0x1')](_0x7393('0x2'),'variable',_0x7393('0x3'),'keyValue'),'defaultValue':_0x7393('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x7393('0x4')]},'keyType':{'type':Sequelize[_0x7393('0x1')](_0x7393('0x2'),_0x7393('0x5'),_0x7393('0x3'))},'keyContent':{'type':Sequelize[_0x7393('0x4')]},'idField':{'type':Sequelize[_0x7393('0x4')]},'nameField':{'type':Sequelize[_0x7393('0x4')]},'customField':{'type':Sequelize[_0x7393('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x17ba=['sequelize','exports','string','variable','customVariable','keyValue','STRING','ENUM','BOOLEAN'];(function(_0x2a194b,_0x30384d){var _0x4ed28e=function(_0x14e0f0){while(--_0x14e0f0){_0x2a194b['push'](_0x2a194b['shift']());}};_0x4ed28e(++_0x30384d);}(_0x17ba,0xab));var _0xa17b=function(_0x3e5ee6,_0x31da0e){_0x3e5ee6=_0x3e5ee6-0x0;var _0x112d04=_0x17ba[_0x3e5ee6];return _0x112d04;};'use strict';var Sequelize=require(_0xa17b('0x0'));module[_0xa17b('0x1')]={'type':{'type':Sequelize['ENUM'](_0xa17b('0x2'),_0xa17b('0x3'),_0xa17b('0x4'),_0xa17b('0x5')),'defaultValue':_0xa17b('0x2')},'content':{'type':Sequelize[_0xa17b('0x6')]},'key':{'type':Sequelize[_0xa17b('0x6')]},'keyType':{'type':Sequelize[_0xa17b('0x7')](_0xa17b('0x2'),_0xa17b('0x3'),_0xa17b('0x4'))},'keyContent':{'type':Sequelize[_0xa17b('0x6')]},'idField':{'type':Sequelize[_0xa17b('0x6')]},'nameField':{'type':Sequelize[_0xa17b('0x6')]},'customField':{'type':Sequelize[_0xa17b('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa17b('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 22b46e1..0ce0014 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 _0x4dca=['desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','set','Content-Range','apply','save','then','destroy','error','stack','name','send','index','SugarcrmField','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','nolimit','limit','order','sort','where','filters','pick','filter','VIRTUAL','findAll','rows','catch','params','includeAll','merge','options','find','create','body','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','squel','crypto'];(function(_0x1e8d9c,_0x5f50cb){var _0x56a51b=function(_0x48a947){while(--_0x48a947){_0x1e8d9c['push'](_0x1e8d9c['shift']());}};_0x56a51b(++_0x5f50cb);}(_0x4dca,0x84));var _0xa4dc=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4dca[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require(_0xa4dc('0x0'));var emlformat=require(_0xa4dc('0x1'));var rimraf=require(_0xa4dc('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa4dc('0x3'));var rp=require(_0xa4dc('0x4'));var moment=require(_0xa4dc('0x5'));var BPromise=require(_0xa4dc('0x6'));var Mustache=require(_0xa4dc('0x7'));var util=require(_0xa4dc('0x8'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa4dc('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xa4dc('0xa'));var crypto=require(_0xa4dc('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xa4dc('0xc'));var toCsv=require(_0xa4dc('0xd'));var querystring=require(_0xa4dc('0xe'));var Papa=require(_0xa4dc('0xf'));var Redis=require(_0xa4dc('0x10'));var authService=require(_0xa4dc('0x11'));var qs=require(_0xa4dc('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa4dc('0x13'));var logger=require('../../config/logger')(_0xa4dc('0x14'));var utils=require(_0xa4dc('0x15'));var config=require(_0xa4dc('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3618a5,_0x34c902){_0x34c902=_0x34c902||0xcc;return function(_0x18d010){if(_0x18d010){return _0x3618a5[_0xa4dc('0x17')](_0x34c902);}return _0x3618a5[_0xa4dc('0x18')](_0x34c902)[_0xa4dc('0x19')]();};}function respondWithResult(_0x2f2d1a,_0x21af68){_0x21af68=_0x21af68||0xc8;return function(_0x169d43){if(_0x169d43){return _0x2f2d1a[_0xa4dc('0x18')](_0x21af68)[_0xa4dc('0x1a')](_0x169d43);}};}function respondWithFilteredResult(_0x12b43a,_0x5b9d8d){return function(_0x55f0d9){if(_0x55f0d9){var _0x47f3a0=_0x55f0d9[_0xa4dc('0x1b')],_0xb2afcf=_0x5b9d8d[_0xa4dc('0x1c')],_0xcb4822=_0x5b9d8d['offset']+_0x5b9d8d['limit'],_0x248223;if(_0xcb4822>=_0x47f3a0){_0xcb4822=_0x47f3a0;_0x248223=0xc8;}else{_0x248223=0xce;}_0x12b43a['status'](_0x248223);return _0x12b43a[_0xa4dc('0x1d')](_0xa4dc('0x1e'),_0xb2afcf+'-'+_0xcb4822+'/'+_0x47f3a0)[_0xa4dc('0x1a')](_0x55f0d9);}return null;};}function patchUpdates(_0x3b8b15){return function(_0x3e0520){try{jsonpatch[_0xa4dc('0x1f')](_0x3e0520,_0x3b8b15,!![]);}catch(_0xf40ac6){return BPromise['reject'](_0xf40ac6);}return _0x3e0520[_0xa4dc('0x20')]();};}function saveUpdates(_0x13bb00,_0x14c045){return function(_0x142275){if(_0x142275){return _0x142275['update'](_0x13bb00)[_0xa4dc('0x21')](function(_0x556eaa){return _0x556eaa;});}return null;};}function removeEntity(_0x5acead,_0x49fc79){return function(_0xed9656){if(_0xed9656){return _0xed9656[_0xa4dc('0x22')]()['then'](function(){_0x5acead[_0xa4dc('0x18')](0xcc)[_0xa4dc('0x19')]();});}};}function handleEntityNotFound(_0x3d611a,_0x401dc4){return function(_0x17ff42){if(!_0x17ff42){_0x3d611a['sendStatus'](0x194);}return _0x17ff42;};}function handleError(_0x6e372f,_0x45d34d){_0x45d34d=_0x45d34d||0x1f4;return function(_0x302471){logger[_0xa4dc('0x23')](_0x302471[_0xa4dc('0x24')]);if(_0x302471[_0xa4dc('0x25')]){delete _0x302471['name'];}_0x6e372f[_0xa4dc('0x18')](_0x45d34d)[_0xa4dc('0x26')](_0x302471);};}exports[_0xa4dc('0x27')]=function(_0x39aee9,_0x306d62){var _0x5929ac={},_0x5abe10={},_0x47f0fc={'count':0x0,'rows':[]};var _0x4ad1db=_['map'](db[_0xa4dc('0x28')][_0xa4dc('0x29')],function(_0x5092a5){return{'name':_0x5092a5[_0xa4dc('0x2a')],'type':_0x5092a5[_0xa4dc('0x2b')][_0xa4dc('0x2c')]};});_0x5abe10[_0xa4dc('0x2d')]=_[_0xa4dc('0x2e')](_0x4ad1db,_0xa4dc('0x25'));_0x5abe10[_0xa4dc('0x2f')]=_[_0xa4dc('0x30')](_0x39aee9[_0xa4dc('0x2f')]);_0x5abe10['filters']=_[_0xa4dc('0x31')](_0x5abe10[_0xa4dc('0x2d')],_0x5abe10[_0xa4dc('0x2f')]);_0x5929ac[_0xa4dc('0x32')]=_[_0xa4dc('0x31')](_0x5abe10[_0xa4dc('0x2d')],qs[_0xa4dc('0x33')](_0x39aee9['query'][_0xa4dc('0x33')]));_0x5929ac[_0xa4dc('0x32')]=_0x5929ac[_0xa4dc('0x32')][_0xa4dc('0x34')]?_0x5929ac[_0xa4dc('0x32')]:_0x5abe10['model'];if(!_0x39aee9['query']['hasOwnProperty'](_0xa4dc('0x35'))){_0x5929ac['limit']=qs[_0xa4dc('0x36')](_0x39aee9['query'][_0xa4dc('0x36')]);_0x5929ac[_0xa4dc('0x1c')]=qs[_0xa4dc('0x1c')](_0x39aee9[_0xa4dc('0x2f')][_0xa4dc('0x1c')]);}_0x5929ac[_0xa4dc('0x37')]=qs['sort'](_0x39aee9[_0xa4dc('0x2f')][_0xa4dc('0x38')]);_0x5929ac[_0xa4dc('0x39')]=qs[_0xa4dc('0x3a')](_[_0xa4dc('0x3b')](_0x39aee9[_0xa4dc('0x2f')],_0x5abe10[_0xa4dc('0x3a')]));if(_0x39aee9[_0xa4dc('0x2f')][_0xa4dc('0x3c')]){_0x5929ac[_0xa4dc('0x39')]=_['merge'](_0x5929ac[_0xa4dc('0x39')],{'$or':_['map'](_0x4ad1db,function(_0x3f6851){if(_0x3f6851[_0xa4dc('0x2b')]!==_0xa4dc('0x3d')){var _0x11fd98={};_0x11fd98[_0x3f6851[_0xa4dc('0x25')]]={'$like':'%'+_0x39aee9['query'][_0xa4dc('0x3c')]+'%'};return _0x11fd98;}})});}_0x5929ac=_['merge']({},_0x5929ac,_0x39aee9['options']);var _0x109a1d={'where':_0x5929ac[_0xa4dc('0x39')]};return db[_0xa4dc('0x28')][_0xa4dc('0x1b')](_0x109a1d)[_0xa4dc('0x21')](function(_0x35947d){_0x47f0fc['count']=_0x35947d;if(_0x39aee9[_0xa4dc('0x2f')]['includeAll']){_0x5929ac['include']=[{'all':!![]}];}return db[_0xa4dc('0x28')][_0xa4dc('0x3e')](_0x5929ac);})[_0xa4dc('0x21')](function(_0x320127){_0x47f0fc[_0xa4dc('0x3f')]=_0x320127;return _0x47f0fc;})[_0xa4dc('0x21')](respondWithFilteredResult(_0x306d62,_0x5929ac))[_0xa4dc('0x40')](handleError(_0x306d62,null));};exports['show']=function(_0x2465ad,_0x99138c){var _0x54e6d7={'raw':!![],'where':{'id':_0x2465ad[_0xa4dc('0x41')]['id']}},_0x57386e={};_0x57386e[_0xa4dc('0x2d')]=_[_0xa4dc('0x30')](db['SugarcrmField'][_0xa4dc('0x29')]);_0x57386e['query']=_[_0xa4dc('0x30')](_0x2465ad[_0xa4dc('0x2f')]);_0x57386e[_0xa4dc('0x3a')]=_['intersection'](_0x57386e['model'],_0x57386e[_0xa4dc('0x2f')]);_0x54e6d7['attributes']=_[_0xa4dc('0x31')](_0x57386e[_0xa4dc('0x2d')],qs[_0xa4dc('0x33')](_0x2465ad[_0xa4dc('0x2f')][_0xa4dc('0x33')]));_0x54e6d7[_0xa4dc('0x32')]=_0x54e6d7[_0xa4dc('0x32')][_0xa4dc('0x34')]?_0x54e6d7[_0xa4dc('0x32')]:_0x57386e['model'];if(_0x2465ad['query'][_0xa4dc('0x42')]){_0x54e6d7['include']=[{'all':!![]}];}_0x54e6d7=_[_0xa4dc('0x43')]({},_0x54e6d7,_0x2465ad[_0xa4dc('0x44')]);return db['SugarcrmField'][_0xa4dc('0x45')](_0x54e6d7)[_0xa4dc('0x21')](handleEntityNotFound(_0x99138c,null))[_0xa4dc('0x21')](respondWithResult(_0x99138c,null))[_0xa4dc('0x40')](handleError(_0x99138c,null));};exports['create']=function(_0x35058d,_0x28c2ff){return db[_0xa4dc('0x28')][_0xa4dc('0x46')](_0x35058d['body'],{})[_0xa4dc('0x21')](respondWithResult(_0x28c2ff,0xc9))[_0xa4dc('0x40')](handleError(_0x28c2ff,null));};exports['update']=function(_0x5f2eaa,_0x1aba90){if(_0x5f2eaa[_0xa4dc('0x47')]['id']){delete _0x5f2eaa[_0xa4dc('0x47')]['id'];}return db[_0xa4dc('0x28')][_0xa4dc('0x45')]({'where':{'id':_0x5f2eaa[_0xa4dc('0x41')]['id']}})[_0xa4dc('0x21')](handleEntityNotFound(_0x1aba90,null))[_0xa4dc('0x21')](saveUpdates(_0x5f2eaa['body'],null))['then'](respondWithResult(_0x1aba90,null))[_0xa4dc('0x40')](handleError(_0x1aba90,null));};exports[_0xa4dc('0x22')]=function(_0x33a30e,_0x58ab2b){return db[_0xa4dc('0x28')][_0xa4dc('0x45')]({'where':{'id':_0x33a30e[_0xa4dc('0x41')]['id']}})[_0xa4dc('0x21')](handleEntityNotFound(_0x58ab2b,null))[_0xa4dc('0x21')](removeEntity(_0x58ab2b,null))[_0xa4dc('0x40')](handleError(_0x58ab2b,null));}; \ No newline at end of file +var _0xddc8=['params','length','includeAll','options','create','body','update','find','destroy','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','sendStatus','error','stack','name','send','index','rawAttributes','type','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','where','pick','filter','VIRTUAL','merge','SugarcrmField','include','findAll','catch','show'];(function(_0x22e3ea,_0x57d13c){var _0x58a537=function(_0xedf300){while(--_0xedf300){_0x22e3ea['push'](_0x22e3ea['shift']());}};_0x58a537(++_0x57d13c);}(_0xddc8,0xde));var _0x8ddc=function(_0x5a9b22,_0x3fd83f){_0x5a9b22=_0x5a9b22-0x0;var _0x289276=_0xddc8[_0x5a9b22];return _0x289276;};'use strict';var pdf=require(_0x8ddc('0x0'));var emlformat=require(_0x8ddc('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8ddc('0x2'));var rp=require(_0x8ddc('0x3'));var moment=require(_0x8ddc('0x4'));var BPromise=require(_0x8ddc('0x5'));var Mustache=require(_0x8ddc('0x6'));var util=require('util');var path=require('path');var sox=require(_0x8ddc('0x7'));var csv=require(_0x8ddc('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x8ddc('0x9'));var squel=require(_0x8ddc('0xa'));var crypto=require(_0x8ddc('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x8ddc('0xc'));var toCsv=require(_0x8ddc('0x8'));var querystring=require(_0x8ddc('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8ddc('0xe'));var qs=require(_0x8ddc('0xf'));var as=require(_0x8ddc('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8ddc('0x11'))(_0x8ddc('0x12'));var utils=require(_0x8ddc('0x13'));var config=require(_0x8ddc('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x11add2,_0x3e4208){_0x3e4208=_0x3e4208||0xcc;return function(_0x401613){if(_0x401613){return _0x11add2['sendStatus'](_0x3e4208);}return _0x11add2[_0x8ddc('0x15')](_0x3e4208)[_0x8ddc('0x16')]();};}function respondWithResult(_0x203229,_0x436cdc){_0x436cdc=_0x436cdc||0xc8;return function(_0x122a2b){if(_0x122a2b){return _0x203229[_0x8ddc('0x15')](_0x436cdc)[_0x8ddc('0x17')](_0x122a2b);}};}function respondWithFilteredResult(_0x4bff9a,_0x4179e2){return function(_0x2bf957){if(_0x2bf957){var _0x473ad8=_0x2bf957[_0x8ddc('0x18')],_0x3c93ce=_0x4179e2[_0x8ddc('0x19')],_0x3ad6ef=_0x4179e2[_0x8ddc('0x19')]+_0x4179e2[_0x8ddc('0x1a')],_0x2b7716;if(_0x3ad6ef>=_0x473ad8){_0x3ad6ef=_0x473ad8;_0x2b7716=0xc8;}else{_0x2b7716=0xce;}_0x4bff9a[_0x8ddc('0x15')](_0x2b7716);return _0x4bff9a[_0x8ddc('0x1b')](_0x8ddc('0x1c'),_0x3c93ce+'-'+_0x3ad6ef+'/'+_0x473ad8)[_0x8ddc('0x17')](_0x2bf957);}return null;};}function patchUpdates(_0xcb8518){return function(_0x4fbb18){try{jsonpatch[_0x8ddc('0x1d')](_0x4fbb18,_0xcb8518,!![]);}catch(_0x359f57){return BPromise[_0x8ddc('0x1e')](_0x359f57);}return _0x4fbb18[_0x8ddc('0x1f')]();};}function saveUpdates(_0x680f5d,_0x3c5807){return function(_0x362545){if(_0x362545){return _0x362545['update'](_0x680f5d)['then'](function(_0x1b0e35){return _0x1b0e35;});}return null;};}function removeEntity(_0x5f5505,_0x1f9f7b){return function(_0x74430b){if(_0x74430b){return _0x74430b['destroy']()[_0x8ddc('0x20')](function(){_0x5f5505[_0x8ddc('0x15')](0xcc)[_0x8ddc('0x16')]();});}};}function handleEntityNotFound(_0x459ba6,_0x2592d5){return function(_0x21ea76){if(!_0x21ea76){_0x459ba6[_0x8ddc('0x21')](0x194);}return _0x21ea76;};}function handleError(_0x1676eb,_0x56ebd0){_0x56ebd0=_0x56ebd0||0x1f4;return function(_0x5f3dd3){logger[_0x8ddc('0x22')](_0x5f3dd3[_0x8ddc('0x23')]);if(_0x5f3dd3[_0x8ddc('0x24')]){delete _0x5f3dd3[_0x8ddc('0x24')];}_0x1676eb[_0x8ddc('0x15')](_0x56ebd0)[_0x8ddc('0x25')](_0x5f3dd3);};}exports[_0x8ddc('0x26')]=function(_0x21d080,_0x1c156a){var _0x253a66={},_0x15a501={},_0x510bed={'count':0x0,'rows':[]};var _0x267d75=_['map'](db['SugarcrmField'][_0x8ddc('0x27')],function(_0x3e7c92){return{'name':_0x3e7c92['fieldName'],'type':_0x3e7c92[_0x8ddc('0x28')]['key']};});_0x15a501[_0x8ddc('0x29')]=_[_0x8ddc('0x2a')](_0x267d75,'name');_0x15a501[_0x8ddc('0x2b')]=_[_0x8ddc('0x2c')](_0x21d080[_0x8ddc('0x2b')]);_0x15a501[_0x8ddc('0x2d')]=_[_0x8ddc('0x2e')](_0x15a501[_0x8ddc('0x29')],_0x15a501[_0x8ddc('0x2b')]);_0x253a66['attributes']=_[_0x8ddc('0x2e')](_0x15a501[_0x8ddc('0x29')],qs['fields'](_0x21d080[_0x8ddc('0x2b')][_0x8ddc('0x2f')]));_0x253a66['attributes']=_0x253a66['attributes']['length']?_0x253a66[_0x8ddc('0x30')]:_0x15a501[_0x8ddc('0x29')];if(!_0x21d080[_0x8ddc('0x2b')][_0x8ddc('0x31')](_0x8ddc('0x32'))){_0x253a66[_0x8ddc('0x1a')]=qs[_0x8ddc('0x1a')](_0x21d080[_0x8ddc('0x2b')][_0x8ddc('0x1a')]);_0x253a66[_0x8ddc('0x19')]=qs[_0x8ddc('0x19')](_0x21d080['query'][_0x8ddc('0x19')]);}_0x253a66[_0x8ddc('0x33')]=qs['sort'](_0x21d080[_0x8ddc('0x2b')]['sort']);_0x253a66[_0x8ddc('0x34')]=qs['filters'](_[_0x8ddc('0x35')](_0x21d080[_0x8ddc('0x2b')],_0x15a501[_0x8ddc('0x2d')]));if(_0x21d080[_0x8ddc('0x2b')][_0x8ddc('0x36')]){_0x253a66['where']=_['merge'](_0x253a66[_0x8ddc('0x34')],{'$or':_[_0x8ddc('0x2a')](_0x267d75,function(_0x46dccb){if(_0x46dccb[_0x8ddc('0x28')]!==_0x8ddc('0x37')){var _0x21aa54={};_0x21aa54[_0x46dccb[_0x8ddc('0x24')]]={'$like':'%'+_0x21d080[_0x8ddc('0x2b')][_0x8ddc('0x36')]+'%'};return _0x21aa54;}})});}_0x253a66=_[_0x8ddc('0x38')]({},_0x253a66,_0x21d080['options']);var _0x221c4f={'where':_0x253a66[_0x8ddc('0x34')]};return db[_0x8ddc('0x39')][_0x8ddc('0x18')](_0x221c4f)['then'](function(_0x319393){_0x510bed[_0x8ddc('0x18')]=_0x319393;if(_0x21d080['query']['includeAll']){_0x253a66[_0x8ddc('0x3a')]=[{'all':!![]}];}return db[_0x8ddc('0x39')][_0x8ddc('0x3b')](_0x253a66);})[_0x8ddc('0x20')](function(_0x3c254b){_0x510bed['rows']=_0x3c254b;return _0x510bed;})[_0x8ddc('0x20')](respondWithFilteredResult(_0x1c156a,_0x253a66))[_0x8ddc('0x3c')](handleError(_0x1c156a,null));};exports[_0x8ddc('0x3d')]=function(_0x328260,_0x5aa440){var _0x895548={'raw':!![],'where':{'id':_0x328260[_0x8ddc('0x3e')]['id']}},_0x3d2bfd={};_0x3d2bfd[_0x8ddc('0x29')]=_[_0x8ddc('0x2c')](db[_0x8ddc('0x39')][_0x8ddc('0x27')]);_0x3d2bfd[_0x8ddc('0x2b')]=_[_0x8ddc('0x2c')](_0x328260[_0x8ddc('0x2b')]);_0x3d2bfd[_0x8ddc('0x2d')]=_['intersection'](_0x3d2bfd[_0x8ddc('0x29')],_0x3d2bfd[_0x8ddc('0x2b')]);_0x895548['attributes']=_[_0x8ddc('0x2e')](_0x3d2bfd[_0x8ddc('0x29')],qs[_0x8ddc('0x2f')](_0x328260[_0x8ddc('0x2b')][_0x8ddc('0x2f')]));_0x895548[_0x8ddc('0x30')]=_0x895548[_0x8ddc('0x30')][_0x8ddc('0x3f')]?_0x895548[_0x8ddc('0x30')]:_0x3d2bfd['model'];if(_0x328260[_0x8ddc('0x2b')][_0x8ddc('0x40')]){_0x895548['include']=[{'all':!![]}];}_0x895548=_[_0x8ddc('0x38')]({},_0x895548,_0x328260[_0x8ddc('0x41')]);return db['SugarcrmField']['find'](_0x895548)[_0x8ddc('0x20')](handleEntityNotFound(_0x5aa440,null))[_0x8ddc('0x20')](respondWithResult(_0x5aa440,null))[_0x8ddc('0x3c')](handleError(_0x5aa440,null));};exports[_0x8ddc('0x42')]=function(_0x1972af,_0x153eb3){return db[_0x8ddc('0x39')][_0x8ddc('0x42')](_0x1972af[_0x8ddc('0x43')],{})[_0x8ddc('0x20')](respondWithResult(_0x153eb3,0xc9))[_0x8ddc('0x3c')](handleError(_0x153eb3,null));};exports[_0x8ddc('0x44')]=function(_0x4d0eab,_0x2a8d00){if(_0x4d0eab[_0x8ddc('0x43')]['id']){delete _0x4d0eab[_0x8ddc('0x43')]['id'];}return db[_0x8ddc('0x39')][_0x8ddc('0x45')]({'where':{'id':_0x4d0eab[_0x8ddc('0x3e')]['id']}})['then'](handleEntityNotFound(_0x2a8d00,null))[_0x8ddc('0x20')](saveUpdates(_0x4d0eab['body'],null))['then'](respondWithResult(_0x2a8d00,null))['catch'](handleError(_0x2a8d00,null));};exports[_0x8ddc('0x46')]=function(_0x1852ed,_0x15983){return db[_0x8ddc('0x39')][_0x8ddc('0x45')]({'where':{'id':_0x1852ed[_0x8ddc('0x3e')]['id']}})[_0x8ddc('0x20')](handleEntityNotFound(_0x15983,null))[_0x8ddc('0x20')](removeEntity(_0x15983,null))['catch'](handleError(_0x15983,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 6cff39e..08b268c 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 _0x146a=['exports','define','SugarcrmField','sugarcrm_unique_index','idField','FieldId','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./intSugarcrmField.attributes'];(function(_0x29c934,_0x3c30e2){var _0x4302de=function(_0x179a5a){while(--_0x179a5a){_0x29c934['push'](_0x29c934['shift']());}};_0x4302de(++_0x3c30e2);}(_0x146a,0xa0));var _0xa146=function(_0x201043,_0x57e46b){_0x201043=_0x201043-0x0;var _0x29e5f2=_0x146a[_0x201043];return _0x29e5f2;};'use strict';var _=require(_0xa146('0x0'));var util=require(_0xa146('0x1'));var logger=require(_0xa146('0x2'))('api');var moment=require('moment');var BPromise=require(_0xa146('0x3'));var rp=require(_0xa146('0x4'));var fs=require('fs');var path=require(_0xa146('0x5'));var rimraf=require(_0xa146('0x6'));var config=require('../../config/environment');var attributes=require(_0xa146('0x7'));module[_0xa146('0x8')]=function(_0x202ee6,_0x424acf){return _0x202ee6[_0xa146('0x9')](_0xa146('0xa'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':_0xa146('0xb'),'fields':[_0xa146('0xc'),_0xa146('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x22f0=['bluebird','request-promise','rimraf','./intSugarcrmField.attributes','exports','define','SugarcrmField','sugarcrm_unique_index','idField','FieldId','../../config/logger','api','moment'];(function(_0x286bfb,_0x46ac3c){var _0x52b683=function(_0x3e7fb1){while(--_0x3e7fb1){_0x286bfb['push'](_0x286bfb['shift']());}};_0x52b683(++_0x46ac3c);}(_0x22f0,0x142));var _0x022f=function(_0x491468,_0x42f169){_0x491468=_0x491468-0x0;var _0x5b8c22=_0x22f0[_0x491468];return _0x5b8c22;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x022f('0x0'))(_0x022f('0x1'));var moment=require(_0x022f('0x2'));var BPromise=require(_0x022f('0x3'));var rp=require(_0x022f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x022f('0x5'));var config=require('../../config/environment');var attributes=require(_0x022f('0x6'));module[_0x022f('0x7')]=function(_0x42e8e6,_0x7cb50){return _0x42e8e6[_0x022f('0x8')](_0x022f('0x9'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':_0x022f('0xa'),'fields':[_0x022f('0xb'),_0x022f('0xc')],'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 8027ec8..0bbc861 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 _0x0b0e=['SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmField,\x20%s,\x20%s','debug'];(function(_0x4cb095,_0x58da07){var _0x2b565d=function(_0x4d41b3){while(--_0x4d41b3){_0x4cb095['push'](_0x4cb095['shift']());}};_0x2b565d(++_0x58da07);}(_0x0b0e,0x187));var _0xe0b0=function(_0x644ecd,_0x397f36){_0x644ecd=_0x644ecd-0x0;var _0x1c66ce=_0x0b0e[_0x644ecd];return _0x1c66ce;};'use strict';var _=require(_0xe0b0('0x0'));var util=require('util');var moment=require(_0xe0b0('0x1'));var BPromise=require('bluebird');var rs=require(_0xe0b0('0x2'));var fs=require('fs');var Redis=require(_0xe0b0('0x3'));var db=require(_0xe0b0('0x4'))['db'];var utils=require(_0xe0b0('0x5'));var logger=require(_0xe0b0('0x6'))(_0xe0b0('0x7'));var config=require(_0xe0b0('0x8'));var jayson=require(_0xe0b0('0x9'));var client=jayson[_0xe0b0('0xa')][_0xe0b0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x219b1c,_0x5cf9cc,_0x50be7f){return new BPromise(function(_0x11effc,_0x435060){return client[_0xe0b0('0xc')](_0x219b1c,_0x50be7f)[_0xe0b0('0xd')](function(_0x4c24f9){logger[_0xe0b0('0xe')](_0xe0b0('0xf'),_0x5cf9cc,'request\x20sent');logger[_0xe0b0('0x10')](_0xe0b0('0x11'),_0x5cf9cc,'request\x20sent',JSON[_0xe0b0('0x12')](_0x4c24f9));if(_0x4c24f9[_0xe0b0('0x13')]){if(_0x4c24f9[_0xe0b0('0x13')]['code']===0x1f4){logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4c24f9[_0xe0b0('0x13')][_0xe0b0('0x14')]);return _0x435060(_0x4c24f9[_0xe0b0('0x13')]['message']);}logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4c24f9[_0xe0b0('0x13')][_0xe0b0('0x14')]);return _0x11effc(_0x4c24f9[_0xe0b0('0x13')]['message']);}else{logger[_0xe0b0('0xe')]('SugarcrmField,\x20%s,\x20%s',_0x5cf9cc,_0xe0b0('0x15'));_0x11effc(_0x4c24f9[_0xe0b0('0x16')]['message']);}})[_0xe0b0('0x17')](function(_0x4a4cc0){logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4a4cc0);_0x435060(_0x4a4cc0);});});} \ No newline at end of file +var _0x757a=['request','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\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(_0x46add2,_0x4346d4){var _0x226d64=function(_0x11ae18){while(--_0x11ae18){_0x46add2['push'](_0x46add2['shift']());}};_0x226d64(++_0x4346d4);}(_0x757a,0xde));var _0xa757=function(_0x158e86,_0x546801){_0x158e86=_0x158e86-0x0;var _0xb86676=_0x757a[_0x158e86];return _0xb86676;};'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']('SugarcrmField,\x20%s,\x20%s',_0x53be0e,_0x5aef8a[_0xa757('0x11')]['message']);return _0x447344(_0x5aef8a['error'][_0xa757('0x12')]);}logger['error']('SugarcrmField,\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/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 1b61d23..9acdc10 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 _0xb0b9=['express','Router','../../components/interaction/service','get','index','/:id','/:id/configurations','isAuthenticated','getConfigurations','getFields','post','create','addConfiguration','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x531c5d,_0x72b29f){var _0x162d86=function(_0x43ba55){while(--_0x43ba55){_0x531c5d['push'](_0x531c5d['shift']());}};_0x162d86(++_0x72b29f);}(_0xb0b9,0x176));var _0x9b0b=function(_0x2bbfe0,_0x42d6cc){_0x2bbfe0=_0x2bbfe0-0x0;var _0x23d8b9=_0xb0b9[_0x2bbfe0];return _0x23d8b9;};'use strict';var multer=require(_0x9b0b('0x0'));var util=require(_0x9b0b('0x1'));var path=require(_0x9b0b('0x2'));var timeout=require(_0x9b0b('0x3'));var express=require(_0x9b0b('0x4'));var router=express[_0x9b0b('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x9b0b('0x6'));var config=require('../../config/environment');var controller=require('./intVtigerAccount.controller');router[_0x9b0b('0x7')]('/',auth['isAuthenticated'](),controller[_0x9b0b('0x8')]);router[_0x9b0b('0x7')](_0x9b0b('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x9b0b('0x7')](_0x9b0b('0xa'),auth[_0x9b0b('0xb')](),controller[_0x9b0b('0xc')]);router['get']('/:id/fields',auth['isAuthenticated'](),controller[_0x9b0b('0xd')]);router[_0x9b0b('0xe')]('/',auth[_0x9b0b('0xb')](),controller[_0x9b0b('0xf')]);router[_0x9b0b('0xe')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x9b0b('0x10')]);router['put'](_0x9b0b('0x9'),auth[_0x9b0b('0xb')](),controller[_0x9b0b('0x11')]);router[_0x9b0b('0x12')](_0x9b0b('0x9'),auth[_0x9b0b('0xb')](),controller[_0x9b0b('0x13')]);module[_0x9b0b('0x14')]=router; \ No newline at end of file +var _0x4fb4=['destroy','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','get','index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','delete'];(function(_0x53a158,_0x497e1a){var _0xcf6a26=function(_0x42027d){while(--_0x42027d){_0x53a158['push'](_0x53a158['shift']());}};_0xcf6a26(++_0x497e1a);}(_0x4fb4,0x14c));var _0x44fb=function(_0x146d4e,_0x373e3a){_0x146d4e=_0x146d4e-0x0;var _0x10bbf4=_0x4fb4[_0x146d4e];return _0x10bbf4;};'use strict';var multer=require(_0x44fb('0x0'));var util=require(_0x44fb('0x1'));var path=require(_0x44fb('0x2'));var timeout=require(_0x44fb('0x3'));var express=require(_0x44fb('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x44fb('0x5'));var config=require('../../config/environment');var controller=require('./intVtigerAccount.controller');router[_0x44fb('0x6')]('/',auth['isAuthenticated'](),controller[_0x44fb('0x7')]);router[_0x44fb('0x6')](_0x44fb('0x8'),auth[_0x44fb('0x9')](),controller[_0x44fb('0xa')]);router[_0x44fb('0x6')](_0x44fb('0xb'),auth[_0x44fb('0x9')](),controller[_0x44fb('0xc')]);router[_0x44fb('0x6')](_0x44fb('0xd'),auth[_0x44fb('0x9')](),controller[_0x44fb('0xe')]);router[_0x44fb('0xf')]('/',auth[_0x44fb('0x9')](),controller[_0x44fb('0x10')]);router['post'](_0x44fb('0xb'),auth[_0x44fb('0x9')](),controller[_0x44fb('0x11')]);router[_0x44fb('0x12')](_0x44fb('0x8'),auth[_0x44fb('0x9')](),controller['update']);router[_0x44fb('0x13')]('/:id',auth[_0x44fb('0x9')](),controller[_0x44fb('0x14')]);module[_0x44fb('0x15')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 033fc73..7dc2d97 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 _0x8414=['HelpDesk','sequelize','exports','STRING'];(function(_0x4a9808,_0x33568c){var _0x55aace=function(_0x393d04){while(--_0x393d04){_0x4a9808['push'](_0x4a9808['shift']());}};_0x55aace(++_0x33568c);}(_0x8414,0x119));var _0x4841=function(_0x2c6120,_0x1f3e60){_0x2c6120=_0x2c6120-0x0;var _0x5fb114=_0x8414[_0x2c6120];return _0x5fb114;};'use strict';var Sequelize=require(_0x4841('0x0'));module[_0x4841('0x1')]={'name':{'type':Sequelize[_0x4841('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x4841('0x2')]},'username':{'type':Sequelize[_0x4841('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x4841('0x2')],'allowNull':![],'defaultValue':_0x4841('0x3')},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING']},'accessKey':{'type':Sequelize[_0x4841('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x6775=['sequelize','STRING','HelpDesk'];(function(_0x15602d,_0x26f403){var _0x715144=function(_0xf9ea91){while(--_0xf9ea91){_0x15602d['push'](_0x15602d['shift']());}};_0x715144(++_0x26f403);}(_0x6775,0x168));var _0x5677=function(_0x2c8c59,_0x2637bd){_0x2c8c59=_0x2c8c59-0x0;var _0x3316c1=_0x6775[_0x2c8c59];return _0x3316c1;};'use strict';var Sequelize=require(_0x5677('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize[_0x5677('0x1')],'allowNull':![],'defaultValue':_0x5677('0x2')},'remoteUri':{'type':Sequelize[_0x5677('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING']},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index d61892d..a59d724 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 _0x8d9e=['count','offset','set','Content-Range','save','update','end','stack','map','VtigerAccount','rawAttributes','type','name','query','keys','intersection','model','fields','attributes','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','find','create','body','params','destroy','getConfigurations','findOne','VtigerConfiguration','length','AccountId','Subjects','getSubjects','channel','getDescriptions','VtigerField','md5','getFields','username','moduleName','remoteUri','serverUrl','accessKey','slice','substring','format','%s/webservice.php','success','POST','login','result','token','GET','describe','sessionName','owner','remove','includes','editable','false','startsWith','picklistValues','label','value','vTiger\x20error:\x20','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','sendStatus','status','json'];(function(_0x35d840,_0x2a1192){var _0x9cd8b1=function(_0x2e3fb8){while(--_0x2e3fb8){_0x35d840['push'](_0x35d840['shift']());}};_0x9cd8b1(++_0x2a1192);}(_0x8d9e,0x150));var _0xe8d9=function(_0xe672c8,_0x3ae505){_0xe672c8=_0xe672c8-0x0;var _0x104b7f=_0x8d9e[_0xe672c8];return _0x104b7f;};'use strict';var pdf=require(_0xe8d9('0x0'));var emlformat=require(_0xe8d9('0x1'));var rimraf=require(_0xe8d9('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe8d9('0x3'));var rp=require(_0xe8d9('0x4'));var moment=require(_0xe8d9('0x5'));var BPromise=require(_0xe8d9('0x6'));var Mustache=require(_0xe8d9('0x7'));var util=require(_0xe8d9('0x8'));var path=require(_0xe8d9('0x9'));var sox=require('sox');var csv=require(_0xe8d9('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xe8d9('0xb'));var crypto=require(_0xe8d9('0xc'));var jsforce=require(_0xe8d9('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe8d9('0xe'));var Papa=require(_0xe8d9('0xf'));var Redis=require(_0xe8d9('0x10'));var authService=require(_0xe8d9('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe8d9('0x12'));var hardwareService=require(_0xe8d9('0x13'));var logger=require(_0xe8d9('0x14'))(_0xe8d9('0x15'));var utils=require(_0xe8d9('0x16'));var config=require(_0xe8d9('0x17'));var db=require(_0xe8d9('0x18'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0xe8d9('0x19'));var client=jayson[_0xe8d9('0x1a')]['http']({'port':0x232a});function checkPasswordPattern(_0x7470,_0x25dae7,_0x21a91e){if(_0x21a91e){var _0x1c4424=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1c4424[_0xe8d9('0x1b')](_0x25dae7)){return _0x7470;}else{throw new db[(_0xe8d9('0x1c'))][(_0xe8d9('0x1d'))](_0xe8d9('0x1e'));}}else{return _0x7470;}}function respondWithRpcPromise(_0x25809b,_0x12461e,_0x1410ac,_0xc368c0){return new BPromise(function(_0x1f5bb9,_0x43c13e){var _0x6700ea=_0xc368c0||client;return _0x6700ea[_0xe8d9('0x1f')](_0x25809b,_0x1410ac)[_0xe8d9('0x20')](function(_0x41eae4){logger['info'](_0xe8d9('0x21'),_0x12461e,_0xe8d9('0x22'));logger[_0xe8d9('0x23')](_0xe8d9('0x24'),_0x12461e,_0xe8d9('0x22'),JSON['stringify'](_0x41eae4));if(_0x41eae4['error']){if(_0x41eae4[_0xe8d9('0x25')][_0xe8d9('0x26')]===0x1f4){logger[_0xe8d9('0x25')](_0xe8d9('0x21'),_0x12461e,_0x41eae4[_0xe8d9('0x25')][_0xe8d9('0x27')]);return _0x43c13e(_0x41eae4['error']['message']);}logger['error'](_0xe8d9('0x21'),_0x12461e,_0x41eae4['error'][_0xe8d9('0x27')]);return _0x1f5bb9(_0x41eae4['error']['message']);}else{logger[_0xe8d9('0x28')](_0xe8d9('0x21'),_0x12461e,_0xe8d9('0x22'));_0x1f5bb9(_0x41eae4['result'][_0xe8d9('0x27')]);}})[_0xe8d9('0x29')](function(_0x3efdee){logger['error'](_0xe8d9('0x21'),_0x12461e,_0x3efdee);_0x43c13e(_0x3efdee);});});}function respondWithStatusCode(_0x1f31a9,_0x56c2bd){_0x56c2bd=_0x56c2bd||0xcc;return function(_0x501421){if(_0x501421){return _0x1f31a9[_0xe8d9('0x2a')](_0x56c2bd);}return _0x1f31a9[_0xe8d9('0x2b')](_0x56c2bd)['end']();};}function respondWithResult(_0xf7ecbe,_0x497bd5){_0x497bd5=_0x497bd5||0xc8;return function(_0x9ae21c){if(_0x9ae21c){return _0xf7ecbe['status'](_0x497bd5)[_0xe8d9('0x2c')](_0x9ae21c);}};}function respondWithFilteredResult(_0x113929,_0x41a736){return function(_0x441218){if(_0x441218){var _0xd1903f=_0x441218[_0xe8d9('0x2d')],_0x58dec1=_0x41a736['offset'],_0x5e9559=_0x41a736[_0xe8d9('0x2e')]+_0x41a736['limit'],_0x29b476;if(_0x5e9559>=_0xd1903f){_0x5e9559=_0xd1903f;_0x29b476=0xc8;}else{_0x29b476=0xce;}_0x113929[_0xe8d9('0x2b')](_0x29b476);return _0x113929[_0xe8d9('0x2f')](_0xe8d9('0x30'),_0x58dec1+'-'+_0x5e9559+'/'+_0xd1903f)['json'](_0x441218);}return null;};}function patchUpdates(_0x3ded1d){return function(_0x13a7b2){try{jsonpatch['apply'](_0x13a7b2,_0x3ded1d,!![]);}catch(_0x31764f){return BPromise['reject'](_0x31764f);}return _0x13a7b2[_0xe8d9('0x31')]();};}function saveUpdates(_0x4bbc06,_0x449e12){return function(_0xe1b957){if(_0xe1b957){return _0xe1b957[_0xe8d9('0x32')](_0x4bbc06)[_0xe8d9('0x20')](function(_0x129551){return _0x129551;});}return null;};}function removeEntity(_0x2ab36c,_0x175f85){return function(_0x95ed7c){if(_0x95ed7c){return _0x95ed7c['destroy']()[_0xe8d9('0x20')](function(){_0x2ab36c[_0xe8d9('0x2b')](0xcc)[_0xe8d9('0x33')]();});}};}function handleEntityNotFound(_0x5ebe7b,_0xcc58f){return function(_0x4a061c){if(!_0x4a061c){_0x5ebe7b[_0xe8d9('0x2a')](0x194);}return _0x4a061c;};}function handleError(_0x437d53,_0x1b10dd){_0x1b10dd=_0x1b10dd||0x1f4;return function(_0x3f8cd6){logger[_0xe8d9('0x25')](_0x3f8cd6[_0xe8d9('0x34')]);if(_0x3f8cd6['name']){delete _0x3f8cd6['name'];}_0x437d53[_0xe8d9('0x2b')](_0x1b10dd)['send'](_0x3f8cd6);};}exports['index']=function(_0x245662,_0x511a9a){var _0x380561={},_0x4f85d2={},_0x3b7845={'count':0x0,'rows':[]};var _0x18ecdc=_[_0xe8d9('0x35')](db[_0xe8d9('0x36')][_0xe8d9('0x37')],function(_0x453568){return{'name':_0x453568['fieldName'],'type':_0x453568[_0xe8d9('0x38')]['key']};});_0x4f85d2['model']=_['map'](_0x18ecdc,_0xe8d9('0x39'));_0x4f85d2[_0xe8d9('0x3a')]=_[_0xe8d9('0x3b')](_0x245662[_0xe8d9('0x3a')]);_0x4f85d2['filters']=_[_0xe8d9('0x3c')](_0x4f85d2['model'],_0x4f85d2[_0xe8d9('0x3a')]);_0x380561['attributes']=_[_0xe8d9('0x3c')](_0x4f85d2[_0xe8d9('0x3d')],qs[_0xe8d9('0x3e')](_0x245662[_0xe8d9('0x3a')][_0xe8d9('0x3e')]));_0x380561[_0xe8d9('0x3f')]=_0x380561[_0xe8d9('0x3f')]['length']?_0x380561[_0xe8d9('0x3f')]:_0x4f85d2[_0xe8d9('0x3d')];if(!_0x245662['query']['hasOwnProperty'](_0xe8d9('0x40'))){_0x380561[_0xe8d9('0x41')]=qs[_0xe8d9('0x41')](_0x245662[_0xe8d9('0x3a')][_0xe8d9('0x41')]);_0x380561[_0xe8d9('0x2e')]=qs[_0xe8d9('0x2e')](_0x245662['query'][_0xe8d9('0x2e')]);}_0x380561[_0xe8d9('0x42')]=qs[_0xe8d9('0x43')](_0x245662['query'][_0xe8d9('0x43')]);_0x380561[_0xe8d9('0x44')]=qs[_0xe8d9('0x45')](_[_0xe8d9('0x46')](_0x245662[_0xe8d9('0x3a')],_0x4f85d2['filters']));if(_0x245662[_0xe8d9('0x3a')][_0xe8d9('0x47')]){_0x380561[_0xe8d9('0x44')]=_[_0xe8d9('0x48')](_0x380561[_0xe8d9('0x44')],{'$or':_[_0xe8d9('0x35')](_0x18ecdc,function(_0x5508e8){if(_0x5508e8[_0xe8d9('0x38')]!==_0xe8d9('0x49')){var _0x198115={};_0x198115[_0x5508e8[_0xe8d9('0x39')]]={'$like':'%'+_0x245662[_0xe8d9('0x3a')][_0xe8d9('0x47')]+'%'};return _0x198115;}})});}_0x380561=_[_0xe8d9('0x48')]({},_0x380561,_0x245662['options']);var _0x16c9d9={'where':_0x380561[_0xe8d9('0x44')]};return db['VtigerAccount']['count'](_0x16c9d9)['then'](function(_0x4bccd9){_0x3b7845[_0xe8d9('0x2d')]=_0x4bccd9;if(_0x245662[_0xe8d9('0x3a')][_0xe8d9('0x4a')]){_0x380561[_0xe8d9('0x4b')]=[{'all':!![]}];}return db[_0xe8d9('0x36')][_0xe8d9('0x4c')](_0x380561);})['then'](function(_0x404b4d){_0x3b7845[_0xe8d9('0x4d')]=_0x404b4d;return _0x3b7845;})[_0xe8d9('0x20')](respondWithFilteredResult(_0x511a9a,_0x380561))[_0xe8d9('0x29')](handleError(_0x511a9a,null));};exports[_0xe8d9('0x4e')]=function(_0x4d4ba5,_0x2fc897){var _0x511e8c={'raw':![],'where':{'id':_0x4d4ba5['params']['id']}},_0x2f28dc={};_0x2f28dc['model']=_['keys'](db[_0xe8d9('0x36')][_0xe8d9('0x37')]);_0x2f28dc[_0xe8d9('0x3a')]=_[_0xe8d9('0x3b')](_0x4d4ba5[_0xe8d9('0x3a')]);_0x2f28dc['filters']=_['intersection'](_0x2f28dc[_0xe8d9('0x3d')],_0x2f28dc[_0xe8d9('0x3a')]);_0x511e8c[_0xe8d9('0x3f')]=_[_0xe8d9('0x3c')](_0x2f28dc['model'],qs[_0xe8d9('0x3e')](_0x4d4ba5[_0xe8d9('0x3a')][_0xe8d9('0x3e')]));_0x511e8c[_0xe8d9('0x3f')]=_0x511e8c[_0xe8d9('0x3f')]['length']?_0x511e8c['attributes']:_0x2f28dc[_0xe8d9('0x3d')];if(_0x4d4ba5[_0xe8d9('0x3a')][_0xe8d9('0x4a')]){_0x511e8c[_0xe8d9('0x4b')]=[{'all':!![]}];}_0x511e8c=_['merge']({},_0x511e8c,_0x4d4ba5['options']);return db['VtigerAccount'][_0xe8d9('0x4f')](_0x511e8c)[_0xe8d9('0x20')](handleEntityNotFound(_0x2fc897,null))[_0xe8d9('0x20')](respondWithResult(_0x2fc897,null))[_0xe8d9('0x29')](handleError(_0x2fc897,null));};exports['create']=function(_0x496eb3,_0x947e45){return db[_0xe8d9('0x36')][_0xe8d9('0x50')](_0x496eb3[_0xe8d9('0x51')],{})[_0xe8d9('0x20')](respondWithResult(_0x947e45,0xc9))[_0xe8d9('0x29')](handleError(_0x947e45,null));};exports[_0xe8d9('0x32')]=function(_0x310eb4,_0x33a35e){if(_0x310eb4[_0xe8d9('0x51')]['id']){delete _0x310eb4['body']['id'];}return db[_0xe8d9('0x36')][_0xe8d9('0x4f')]({'where':{'id':_0x310eb4[_0xe8d9('0x52')]['id']}})[_0xe8d9('0x20')](handleEntityNotFound(_0x33a35e,null))[_0xe8d9('0x20')](saveUpdates(_0x310eb4[_0xe8d9('0x51')],null))['then'](respondWithResult(_0x33a35e,null))[_0xe8d9('0x29')](handleError(_0x33a35e,null));};exports[_0xe8d9('0x53')]=function(_0x48bbdc,_0x18e46d){return db['VtigerAccount'][_0xe8d9('0x4f')]({'where':{'id':_0x48bbdc[_0xe8d9('0x52')]['id']}})[_0xe8d9('0x20')](handleEntityNotFound(_0x18e46d,null))[_0xe8d9('0x20')](removeEntity(_0x18e46d,null))[_0xe8d9('0x29')](handleError(_0x18e46d,null));};exports[_0xe8d9('0x54')]=function(_0x378d41,_0x58e039,_0x7e2099){var _0x52827d={};var _0x3b393a={};var _0x4248ff;var _0x55b4a7;return db[_0xe8d9('0x36')][_0xe8d9('0x55')]({'where':{'id':_0x378d41[_0xe8d9('0x52')]['id']}})[_0xe8d9('0x20')](handleEntityNotFound(_0x58e039,null))['then'](function(_0x2ba21f){if(_0x2ba21f){_0x4248ff=_0x2ba21f;_0x3b393a[_0xe8d9('0x3d')]=_[_0xe8d9('0x3b')](db[_0xe8d9('0x56')][_0xe8d9('0x37')]);_0x3b393a['query']=_['keys'](_0x378d41[_0xe8d9('0x3a')]);_0x3b393a[_0xe8d9('0x45')]=_['intersection'](_0x3b393a[_0xe8d9('0x3d')],_0x3b393a[_0xe8d9('0x3a')]);_0x52827d['attributes']=_[_0xe8d9('0x3c')](_0x3b393a[_0xe8d9('0x3d')],qs[_0xe8d9('0x3e')](_0x378d41[_0xe8d9('0x3a')][_0xe8d9('0x3e')]));_0x52827d['attributes']=_0x52827d['attributes'][_0xe8d9('0x57')]?_0x52827d[_0xe8d9('0x3f')]:_0x3b393a[_0xe8d9('0x3d')];_0x52827d[_0xe8d9('0x42')]=qs['sort'](_0x378d41[_0xe8d9('0x3a')][_0xe8d9('0x43')]);_0x52827d[_0xe8d9('0x44')]=qs[_0xe8d9('0x45')](_['pick'](_0x378d41[_0xe8d9('0x3a')],_0x3b393a[_0xe8d9('0x45')]));if(_0x378d41[_0xe8d9('0x3a')][_0xe8d9('0x47')]){_0x52827d[_0xe8d9('0x44')]=_['merge'](_0x52827d[_0xe8d9('0x44')],{'$or':_['map'](_0x52827d[_0xe8d9('0x3f')],function(_0x524863){var _0x1bb53a={};_0x1bb53a[_0x524863]={'$like':'%'+_0x378d41[_0xe8d9('0x3a')][_0xe8d9('0x47')]+'%'};return _0x1bb53a;})});}_0x52827d=_[_0xe8d9('0x48')]({},_0x52827d,_0x378d41['options']);return _0x4248ff[_0xe8d9('0x54')](_0x52827d);}})[_0xe8d9('0x20')](function(_0x36d544){if(_0x36d544){_0x55b4a7=_0x36d544[_0xe8d9('0x57')];if(!_0x378d41[_0xe8d9('0x3a')]['hasOwnProperty'](_0xe8d9('0x40'))){_0x52827d[_0xe8d9('0x41')]=qs[_0xe8d9('0x41')](_0x378d41['query'][_0xe8d9('0x41')]);_0x52827d['offset']=qs['offset'](_0x378d41[_0xe8d9('0x3a')]['offset']);}return _0x4248ff['getConfigurations'](_0x52827d);}})[_0xe8d9('0x20')](function(_0x1f0cda){if(_0x1f0cda){return _0x1f0cda?{'count':_0x55b4a7,'rows':_0x1f0cda}:null;}})[_0xe8d9('0x20')](respondWithResult(_0x58e039,null))['catch'](handleError(_0x58e039,null));};exports['addConfiguration']=function(_0x38036e,_0x51eec4,_0x13b831){if(_0x38036e[_0xe8d9('0x51')]['id']){delete _0x38036e[_0xe8d9('0x51')]['id'];}return db[_0xe8d9('0x36')]['findOne']({'where':{'id':_0x38036e['params']['id']}})[_0xe8d9('0x20')](handleEntityNotFound(_0x51eec4,null))[_0xe8d9('0x20')](function(_0x5dedc4){if(_0x5dedc4){_0x38036e[_0xe8d9('0x51')][_0xe8d9('0x58')]=_0x5dedc4['id'];_0x38036e[_0xe8d9('0x51')][_0xe8d9('0x59')]=integrations[_0xe8d9('0x5a')](_0x38036e[_0xe8d9('0x51')][_0xe8d9('0x5b')],_0x38036e[_0xe8d9('0x51')][_0xe8d9('0x38')]);_0x38036e[_0xe8d9('0x51')]['Descriptions']=integrations[_0xe8d9('0x5c')](_0x38036e[_0xe8d9('0x51')]['channel'],_0x38036e[_0xe8d9('0x51')][_0xe8d9('0x38')]);return db[_0xe8d9('0x56')][_0xe8d9('0x50')](_0x38036e['body'],{'include':[{'model':db[_0xe8d9('0x5d')],'as':_0xe8d9('0x59')},{'model':db[_0xe8d9('0x5d')],'as':'Descriptions'}]});}return null;})[_0xe8d9('0x20')](respondWithResult(_0x51eec4,null))[_0xe8d9('0x29')](handleError(_0x51eec4,null));};var md5=require(_0xe8d9('0x5e'));exports[_0xe8d9('0x5f')]=function(_0x424b3a,_0x45b7ed,_0x39e736){var _0x164cef=null;var _0x319017=null;var _0x34b064=null;var _0x4c5dd4=null;var _0x1089cc='';return db[_0xe8d9('0x36')][_0xe8d9('0x55')]({'where':{'id':_0x424b3a[_0xe8d9('0x52')]['id']},'attributes':['id','name',_0xe8d9('0x60'),'description',_0xe8d9('0x61'),_0xe8d9('0x62'),_0xe8d9('0x63'),_0xe8d9('0x64')]})[_0xe8d9('0x20')](handleEntityNotFound(_0x45b7ed,null))[_0xe8d9('0x20')](function(_0x2ea3d3){if(_0x2ea3d3){_0x164cef=_0x2ea3d3['username'];_0x319017=_0x2ea3d3[_0xe8d9('0x64')];_0x34b064=_0x2ea3d3[_0xe8d9('0x61')];_0x1089cc=_0x2ea3d3[_0xe8d9('0x62')];var _0x2b6890=_0x1089cc[_0xe8d9('0x65')](-0x1);if(_0x2b6890==='/'){_0x1089cc=_0x1089cc[_0xe8d9('0x66')](0x0,_0x1089cc['lastIndexOf'](_0x2b6890));}_0x4c5dd4=util[_0xe8d9('0x67')](_0xe8d9('0x68'),_0x1089cc);var _0x43d94f={'method':'GET','uri':_0x4c5dd4,'qs':{'operation':'getchallenge','username':_0x2ea3d3[_0xe8d9('0x60')]},'json':!![]};return rp(_0x43d94f);}})['then'](function(_0x4c7a9e){if(_0x4c7a9e[_0xe8d9('0x69')]){var _0x1fe828={'method':_0xe8d9('0x6a'),'uri':_0x4c5dd4,'form':{'operation':_0xe8d9('0x6b'),'username':_0x164cef,'accessKey':md5(_0x4c7a9e[_0xe8d9('0x6c')][_0xe8d9('0x6d')]+_0x319017)},'json':!![]};return rp(_0x1fe828);}})[_0xe8d9('0x20')](function(_0x5e371d){if(_0x5e371d[_0xe8d9('0x69')]){var _0x186114={'method':_0xe8d9('0x6e'),'uri':_0x4c5dd4,'qs':{'operation':_0xe8d9('0x6f'),'username':_0x164cef,'sessionName':_0x5e371d[_0xe8d9('0x6c')][_0xe8d9('0x70')],'elementType':_0x34b064},'json':!![]};return rp(_0x186114);}})['then'](function(_0x2abcde){if(_0x2abcde[_0xe8d9('0x69')]){var _0x19205e=['autogenerated','reference',_0xe8d9('0x71')];_[_0xe8d9('0x72')](_0x2abcde[_0xe8d9('0x6c')][_0xe8d9('0x3e')],function(_0x286102){return _0x19205e[_0xe8d9('0x73')](_0x286102[_0xe8d9('0x38')][_0xe8d9('0x39')]);});_[_0xe8d9('0x72')](_0x2abcde['result'][_0xe8d9('0x3e')],function(_0x156e8e){return _0x156e8e[_0xe8d9('0x74')]===_0xe8d9('0x75');});return{'count':_0x2abcde['result']['fields'][_0xe8d9('0x57')],'rows':_[_0xe8d9('0x35')](_0x2abcde[_0xe8d9('0x6c')][_0xe8d9('0x3e')],function(_0x110084){return{'id':_0x110084[_0xe8d9('0x39')],'name':_0x110084['label'],'custom':_[_0xe8d9('0x76')](_0x110084[_0xe8d9('0x39')],'cf_')?!![]:![],'options':_0x110084[_0xe8d9('0x38')]['name']==='picklist'&&_0x110084[_0xe8d9('0x38')][_0xe8d9('0x77')][_0xe8d9('0x57')]>0x0?_[_0xe8d9('0x35')](_0x110084[_0xe8d9('0x38')][_0xe8d9('0x77')],function(_0x2b1866){return{'name':_0x2b1866[_0xe8d9('0x78')],'value':_0x2b1866[_0xe8d9('0x79')]};}):[]};})};}})[_0xe8d9('0x20')](respondWithResult(_0x45b7ed,null))[_0xe8d9('0x29')](function(_0x57b4e1){console['log'](_0xe8d9('0x7a')+_0x57b4e1);var _0x1d63ef=_0x424b3a[_0xe8d9('0x3a')][_0xe8d9('0x1b')]?0x1f4:_0x57b4e1[_0xe8d9('0x7b')]||0x1f4;logger[_0xe8d9('0x25')](_0xe8d9('0x7c'),_0xe8d9('0x5f'),_0x1d63ef,JSON[_0xe8d9('0x7d')](_0x57b4e1));delete _0x57b4e1[_0xe8d9('0x39')];if(_0x1d63ef===0x191){_0x1d63ef=0x190;}_0x45b7ed[_0xe8d9('0x2b')](_0x1d63ef)[_0xe8d9('0x7e')](_0x424b3a[_0xe8d9('0x3a')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x57b4e1[_0xe8d9('0x7b')]}:_0x57b4e1);});}; \ No newline at end of file +var _0x49f5=['zip-dir','fast-json-patch','request-promise','util','path','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','jayson/promise','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','end','status','json','count','offset','set','update','then','destroy','sendStatus','stack','name','send','map','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','filter','merge','where','VIRTUAL','options','includeAll','include','VtigerAccount','params','rawAttributes','find','create','body','getConfigurations','pick','length','addConfiguration','findOne','AccountId','Subjects','getSubjects','VtigerConfiguration','VtigerField','Descriptions','getFields','moduleName','serverUrl','accessKey','username','slice','substring','lastIndexOf','success','POST','login','token','describe','sessionName','reference','owner','remove','includes','false','label','startsWith','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','html-pdf','rimraf'];(function(_0x4445e9,_0x34a02a){var _0x5098fc=function(_0x58f6f9){while(--_0x58f6f9){_0x4445e9['push'](_0x4445e9['shift']());}};_0x5098fc(++_0x34a02a);}(_0x49f5,0xf0));var _0x549f=function(_0x4efe55,_0x6174ea){_0x4efe55=_0x4efe55-0x0;var _0x3a15da=_0x49f5[_0x4efe55];return _0x3a15da;};'use strict';var pdf=require(_0x549f('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x549f('0x1'));var zipdir=require(_0x549f('0x2'));var jsonpatch=require(_0x549f('0x3'));var rp=require(_0x549f('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x549f('0x5'));var path=require(_0x549f('0x6'));var sox=require('sox');var csv=require(_0x549f('0x7'));var ejs=require(_0x549f('0x8'));var fs=require('fs');var _=require(_0x549f('0x9'));var squel=require('squel');var crypto=require(_0x549f('0xa'));var jsforce=require(_0x549f('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x549f('0x7'));var querystring=require(_0x549f('0xc'));var Papa=require(_0x549f('0xd'));var Redis=require(_0x549f('0xe'));var authService=require(_0x549f('0xf'));var qs=require(_0x549f('0x10'));var as=require(_0x549f('0x11'));var hardwareService=require(_0x549f('0x12'));var logger=require(_0x549f('0x13'))(_0x549f('0x14'));var utils=require(_0x549f('0x15'));var config=require('../../config/environment');var db=require(_0x549f('0x16'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x549f('0x17'));var client=jayson['client'][_0x549f('0x18')]({'port':0x232a});function checkPasswordPattern(_0x2eb108,_0x1da4ec,_0x1da8ed){if(_0x1da8ed){var _0x41a248=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x41a248['test'](_0x1da4ec)){return _0x2eb108;}else{throw new db[(_0x549f('0x19'))][(_0x549f('0x1a'))](_0x549f('0x1b'));}}else{return _0x2eb108;}}function respondWithRpcPromise(_0x5ed132,_0x29a118,_0x5b9026,_0x208b26){return new BPromise(function(_0x32a701,_0x2f9711){var _0x1286e8=_0x208b26||client;return _0x1286e8['request'](_0x5ed132,_0x5b9026)['then'](function(_0x4e65ee){logger[_0x549f('0x1c')](_0x549f('0x1d'),_0x29a118,_0x549f('0x1e'));logger['debug'](_0x549f('0x1f'),_0x29a118,_0x549f('0x1e'),JSON[_0x549f('0x20')](_0x4e65ee));if(_0x4e65ee[_0x549f('0x21')]){if(_0x4e65ee[_0x549f('0x21')][_0x549f('0x22')]===0x1f4){logger[_0x549f('0x21')](_0x549f('0x1d'),_0x29a118,_0x4e65ee['error'][_0x549f('0x23')]);return _0x2f9711(_0x4e65ee[_0x549f('0x21')]['message']);}logger[_0x549f('0x21')](_0x549f('0x1d'),_0x29a118,_0x4e65ee[_0x549f('0x21')][_0x549f('0x23')]);return _0x32a701(_0x4e65ee[_0x549f('0x21')][_0x549f('0x23')]);}else{logger[_0x549f('0x1c')](_0x549f('0x1d'),_0x29a118,_0x549f('0x1e'));_0x32a701(_0x4e65ee[_0x549f('0x24')]['message']);}})[_0x549f('0x25')](function(_0x2a7a13){logger[_0x549f('0x21')](_0x549f('0x1d'),_0x29a118,_0x2a7a13);_0x2f9711(_0x2a7a13);});});}function respondWithStatusCode(_0x287a32,_0x33932a){_0x33932a=_0x33932a||0xcc;return function(_0x377b4d){if(_0x377b4d){return _0x287a32['sendStatus'](_0x33932a);}return _0x287a32['status'](_0x33932a)[_0x549f('0x26')]();};}function respondWithResult(_0x140a28,_0x49990b){_0x49990b=_0x49990b||0xc8;return function(_0x1c78c6){if(_0x1c78c6){return _0x140a28[_0x549f('0x27')](_0x49990b)[_0x549f('0x28')](_0x1c78c6);}};}function respondWithFilteredResult(_0x57abe5,_0x1de76c){return function(_0x586268){if(_0x586268){var _0x429d3f=_0x586268[_0x549f('0x29')],_0x641f45=_0x1de76c[_0x549f('0x2a')],_0x39157a=_0x1de76c[_0x549f('0x2a')]+_0x1de76c['limit'],_0x4f33b3;if(_0x39157a>=_0x429d3f){_0x39157a=_0x429d3f;_0x4f33b3=0xc8;}else{_0x4f33b3=0xce;}_0x57abe5[_0x549f('0x27')](_0x4f33b3);return _0x57abe5[_0x549f('0x2b')]('Content-Range',_0x641f45+'-'+_0x39157a+'/'+_0x429d3f)[_0x549f('0x28')](_0x586268);}return null;};}function patchUpdates(_0x3550bd){return function(_0x142240){try{jsonpatch['apply'](_0x142240,_0x3550bd,!![]);}catch(_0xcec708){return BPromise['reject'](_0xcec708);}return _0x142240['save']();};}function saveUpdates(_0x126dd5,_0x18be41){return function(_0x24f188){if(_0x24f188){return _0x24f188[_0x549f('0x2c')](_0x126dd5)[_0x549f('0x2d')](function(_0x2fdb87){return _0x2fdb87;});}return null;};}function removeEntity(_0x239bb9,_0x1bff85){return function(_0x3b5ab8){if(_0x3b5ab8){return _0x3b5ab8[_0x549f('0x2e')]()[_0x549f('0x2d')](function(){_0x239bb9[_0x549f('0x27')](0xcc)[_0x549f('0x26')]();});}};}function handleEntityNotFound(_0x4aa17b,_0x297ce9){return function(_0x5ca8f4){if(!_0x5ca8f4){_0x4aa17b[_0x549f('0x2f')](0x194);}return _0x5ca8f4;};}function handleError(_0x534317,_0x25bf8e){_0x25bf8e=_0x25bf8e||0x1f4;return function(_0x4d0ec1){logger[_0x549f('0x21')](_0x4d0ec1[_0x549f('0x30')]);if(_0x4d0ec1[_0x549f('0x31')]){delete _0x4d0ec1[_0x549f('0x31')];}_0x534317[_0x549f('0x27')](_0x25bf8e)[_0x549f('0x32')](_0x4d0ec1);};}exports['index']=function(_0x26fed6,_0x3f2df9){var _0xcd83ec={},_0x157ef4={},_0x2efd95={'count':0x0,'rows':[]};var _0x4be70d=_[_0x549f('0x33')](db['VtigerAccount']['rawAttributes'],function(_0x43b9ab){return{'name':_0x43b9ab[_0x549f('0x34')],'type':_0x43b9ab[_0x549f('0x35')][_0x549f('0x36')]};});_0x157ef4[_0x549f('0x37')]=_['map'](_0x4be70d,_0x549f('0x31'));_0x157ef4['query']=_[_0x549f('0x38')](_0x26fed6[_0x549f('0x39')]);_0x157ef4[_0x549f('0x3a')]=_[_0x549f('0x3b')](_0x157ef4[_0x549f('0x37')],_0x157ef4['query']);_0xcd83ec[_0x549f('0x3c')]=_['intersection'](_0x157ef4['model'],qs[_0x549f('0x3d')](_0x26fed6[_0x549f('0x39')][_0x549f('0x3d')]));_0xcd83ec[_0x549f('0x3c')]=_0xcd83ec[_0x549f('0x3c')]['length']?_0xcd83ec[_0x549f('0x3c')]:_0x157ef4[_0x549f('0x37')];if(!_0x26fed6['query'][_0x549f('0x3e')](_0x549f('0x3f'))){_0xcd83ec[_0x549f('0x40')]=qs[_0x549f('0x40')](_0x26fed6[_0x549f('0x39')][_0x549f('0x40')]);_0xcd83ec['offset']=qs[_0x549f('0x2a')](_0x26fed6[_0x549f('0x39')][_0x549f('0x2a')]);}_0xcd83ec[_0x549f('0x41')]=qs['sort'](_0x26fed6[_0x549f('0x39')][_0x549f('0x42')]);_0xcd83ec['where']=qs['filters'](_['pick'](_0x26fed6[_0x549f('0x39')],_0x157ef4['filters']));if(_0x26fed6[_0x549f('0x39')][_0x549f('0x43')]){_0xcd83ec['where']=_[_0x549f('0x44')](_0xcd83ec[_0x549f('0x45')],{'$or':_[_0x549f('0x33')](_0x4be70d,function(_0x1f6ac1){if(_0x1f6ac1['type']!==_0x549f('0x46')){var _0x31357c={};_0x31357c[_0x1f6ac1['name']]={'$like':'%'+_0x26fed6[_0x549f('0x39')][_0x549f('0x43')]+'%'};return _0x31357c;}})});}_0xcd83ec=_[_0x549f('0x44')]({},_0xcd83ec,_0x26fed6[_0x549f('0x47')]);var _0x3c2944={'where':_0xcd83ec[_0x549f('0x45')]};return db['VtigerAccount']['count'](_0x3c2944)[_0x549f('0x2d')](function(_0x2253dc){_0x2efd95['count']=_0x2253dc;if(_0x26fed6[_0x549f('0x39')][_0x549f('0x48')]){_0xcd83ec[_0x549f('0x49')]=[{'all':!![]}];}return db[_0x549f('0x4a')]['findAll'](_0xcd83ec);})[_0x549f('0x2d')](function(_0x44a893){_0x2efd95['rows']=_0x44a893;return _0x2efd95;})[_0x549f('0x2d')](respondWithFilteredResult(_0x3f2df9,_0xcd83ec))['catch'](handleError(_0x3f2df9,null));};exports['show']=function(_0x2a5fd6,_0x11986c){var _0x2bc62e={'raw':![],'where':{'id':_0x2a5fd6[_0x549f('0x4b')]['id']}},_0xb4f75a={};_0xb4f75a[_0x549f('0x37')]=_['keys'](db[_0x549f('0x4a')][_0x549f('0x4c')]);_0xb4f75a[_0x549f('0x39')]=_['keys'](_0x2a5fd6[_0x549f('0x39')]);_0xb4f75a[_0x549f('0x3a')]=_[_0x549f('0x3b')](_0xb4f75a[_0x549f('0x37')],_0xb4f75a[_0x549f('0x39')]);_0x2bc62e[_0x549f('0x3c')]=_[_0x549f('0x3b')](_0xb4f75a['model'],qs[_0x549f('0x3d')](_0x2a5fd6[_0x549f('0x39')][_0x549f('0x3d')]));_0x2bc62e[_0x549f('0x3c')]=_0x2bc62e[_0x549f('0x3c')]['length']?_0x2bc62e['attributes']:_0xb4f75a[_0x549f('0x37')];if(_0x2a5fd6[_0x549f('0x39')][_0x549f('0x48')]){_0x2bc62e[_0x549f('0x49')]=[{'all':!![]}];}_0x2bc62e=_['merge']({},_0x2bc62e,_0x2a5fd6['options']);return db['VtigerAccount'][_0x549f('0x4d')](_0x2bc62e)[_0x549f('0x2d')](handleEntityNotFound(_0x11986c,null))[_0x549f('0x2d')](respondWithResult(_0x11986c,null))[_0x549f('0x25')](handleError(_0x11986c,null));};exports[_0x549f('0x4e')]=function(_0x29120a,_0x2cdc4f){return db[_0x549f('0x4a')]['create'](_0x29120a[_0x549f('0x4f')],{})[_0x549f('0x2d')](respondWithResult(_0x2cdc4f,0xc9))[_0x549f('0x25')](handleError(_0x2cdc4f,null));};exports[_0x549f('0x2c')]=function(_0x516c67,_0x2102e7){if(_0x516c67[_0x549f('0x4f')]['id']){delete _0x516c67[_0x549f('0x4f')]['id'];}return db['VtigerAccount'][_0x549f('0x4d')]({'where':{'id':_0x516c67[_0x549f('0x4b')]['id']}})[_0x549f('0x2d')](handleEntityNotFound(_0x2102e7,null))[_0x549f('0x2d')](saveUpdates(_0x516c67[_0x549f('0x4f')],null))[_0x549f('0x2d')](respondWithResult(_0x2102e7,null))['catch'](handleError(_0x2102e7,null));};exports[_0x549f('0x2e')]=function(_0x11dc7a,_0x4bca29){return db[_0x549f('0x4a')][_0x549f('0x4d')]({'where':{'id':_0x11dc7a[_0x549f('0x4b')]['id']}})[_0x549f('0x2d')](handleEntityNotFound(_0x4bca29,null))[_0x549f('0x2d')](removeEntity(_0x4bca29,null))[_0x549f('0x25')](handleError(_0x4bca29,null));};exports[_0x549f('0x50')]=function(_0x1c6111,_0x1664db,_0x29af55){var _0x9fc027={};var _0x3c64cd={};var _0x128a5c;var _0x4910de;return db['VtigerAccount']['findOne']({'where':{'id':_0x1c6111[_0x549f('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1664db,null))['then'](function(_0x380503){if(_0x380503){_0x128a5c=_0x380503;_0x3c64cd[_0x549f('0x37')]=_[_0x549f('0x38')](db['VtigerConfiguration'][_0x549f('0x4c')]);_0x3c64cd[_0x549f('0x39')]=_[_0x549f('0x38')](_0x1c6111[_0x549f('0x39')]);_0x3c64cd[_0x549f('0x3a')]=_[_0x549f('0x3b')](_0x3c64cd[_0x549f('0x37')],_0x3c64cd[_0x549f('0x39')]);_0x9fc027[_0x549f('0x3c')]=_[_0x549f('0x3b')](_0x3c64cd[_0x549f('0x37')],qs[_0x549f('0x3d')](_0x1c6111[_0x549f('0x39')][_0x549f('0x3d')]));_0x9fc027[_0x549f('0x3c')]=_0x9fc027[_0x549f('0x3c')]['length']?_0x9fc027[_0x549f('0x3c')]:_0x3c64cd[_0x549f('0x37')];_0x9fc027[_0x549f('0x41')]=qs['sort'](_0x1c6111[_0x549f('0x39')]['sort']);_0x9fc027['where']=qs[_0x549f('0x3a')](_[_0x549f('0x51')](_0x1c6111[_0x549f('0x39')],_0x3c64cd['filters']));if(_0x1c6111[_0x549f('0x39')]['filter']){_0x9fc027[_0x549f('0x45')]=_[_0x549f('0x44')](_0x9fc027['where'],{'$or':_[_0x549f('0x33')](_0x9fc027['attributes'],function(_0x109321){var _0x20fa46={};_0x20fa46[_0x109321]={'$like':'%'+_0x1c6111[_0x549f('0x39')][_0x549f('0x43')]+'%'};return _0x20fa46;})});}_0x9fc027=_[_0x549f('0x44')]({},_0x9fc027,_0x1c6111['options']);return _0x128a5c['getConfigurations'](_0x9fc027);}})[_0x549f('0x2d')](function(_0x29898c){if(_0x29898c){_0x4910de=_0x29898c[_0x549f('0x52')];if(!_0x1c6111['query'][_0x549f('0x3e')]('nolimit')){_0x9fc027[_0x549f('0x40')]=qs['limit'](_0x1c6111[_0x549f('0x39')][_0x549f('0x40')]);_0x9fc027[_0x549f('0x2a')]=qs[_0x549f('0x2a')](_0x1c6111[_0x549f('0x39')]['offset']);}return _0x128a5c['getConfigurations'](_0x9fc027);}})[_0x549f('0x2d')](function(_0x54b543){if(_0x54b543){return _0x54b543?{'count':_0x4910de,'rows':_0x54b543}:null;}})[_0x549f('0x2d')](respondWithResult(_0x1664db,null))['catch'](handleError(_0x1664db,null));};exports[_0x549f('0x53')]=function(_0x2447c8,_0x251d17,_0x3ed5dd){if(_0x2447c8[_0x549f('0x4f')]['id']){delete _0x2447c8[_0x549f('0x4f')]['id'];}return db[_0x549f('0x4a')][_0x549f('0x54')]({'where':{'id':_0x2447c8[_0x549f('0x4b')]['id']}})[_0x549f('0x2d')](handleEntityNotFound(_0x251d17,null))[_0x549f('0x2d')](function(_0x4c56ed){if(_0x4c56ed){_0x2447c8[_0x549f('0x4f')][_0x549f('0x55')]=_0x4c56ed['id'];_0x2447c8[_0x549f('0x4f')][_0x549f('0x56')]=integrations[_0x549f('0x57')](_0x2447c8[_0x549f('0x4f')]['channel'],_0x2447c8[_0x549f('0x4f')][_0x549f('0x35')]);_0x2447c8['body']['Descriptions']=integrations['getDescriptions'](_0x2447c8[_0x549f('0x4f')]['channel'],_0x2447c8[_0x549f('0x4f')][_0x549f('0x35')]);return db[_0x549f('0x58')]['create'](_0x2447c8[_0x549f('0x4f')],{'include':[{'model':db[_0x549f('0x59')],'as':'Subjects'},{'model':db[_0x549f('0x59')],'as':_0x549f('0x5a')}]});}return null;})['then'](respondWithResult(_0x251d17,null))[_0x549f('0x25')](handleError(_0x251d17,null));};var md5=require('md5');exports[_0x549f('0x5b')]=function(_0x3651fc,_0x245e6d,_0x26b9d4){var _0x135a2d=null;var _0x43d939=null;var _0x36962d=null;var _0x28d2ff=null;var _0x57aeb0='';return db[_0x549f('0x4a')]['findOne']({'where':{'id':_0x3651fc[_0x549f('0x4b')]['id']},'attributes':['id',_0x549f('0x31'),'username','description',_0x549f('0x5c'),'remoteUri',_0x549f('0x5d'),_0x549f('0x5e')]})[_0x549f('0x2d')](handleEntityNotFound(_0x245e6d,null))[_0x549f('0x2d')](function(_0x2642e8){if(_0x2642e8){_0x135a2d=_0x2642e8[_0x549f('0x5f')];_0x43d939=_0x2642e8[_0x549f('0x5e')];_0x36962d=_0x2642e8[_0x549f('0x5c')];_0x57aeb0=_0x2642e8['remoteUri'];var _0x292478=_0x57aeb0[_0x549f('0x60')](-0x1);if(_0x292478==='/'){_0x57aeb0=_0x57aeb0[_0x549f('0x61')](0x0,_0x57aeb0[_0x549f('0x62')](_0x292478));}_0x28d2ff=util['format']('%s/webservice.php',_0x57aeb0);var _0xf45079={'method':'GET','uri':_0x28d2ff,'qs':{'operation':'getchallenge','username':_0x2642e8[_0x549f('0x5f')]},'json':!![]};return rp(_0xf45079);}})[_0x549f('0x2d')](function(_0x5738c9){if(_0x5738c9[_0x549f('0x63')]){var _0x4c33a4={'method':_0x549f('0x64'),'uri':_0x28d2ff,'form':{'operation':_0x549f('0x65'),'username':_0x135a2d,'accessKey':md5(_0x5738c9[_0x549f('0x24')][_0x549f('0x66')]+_0x43d939)},'json':!![]};return rp(_0x4c33a4);}})[_0x549f('0x2d')](function(_0x40d6d8){if(_0x40d6d8['success']){var _0x3efdd0={'method':'GET','uri':_0x28d2ff,'qs':{'operation':_0x549f('0x67'),'username':_0x135a2d,'sessionName':_0x40d6d8[_0x549f('0x24')][_0x549f('0x68')],'elementType':_0x36962d},'json':!![]};return rp(_0x3efdd0);}})[_0x549f('0x2d')](function(_0x4a6a23){if(_0x4a6a23[_0x549f('0x63')]){var _0x446f4d=['autogenerated',_0x549f('0x69'),_0x549f('0x6a')];_[_0x549f('0x6b')](_0x4a6a23[_0x549f('0x24')][_0x549f('0x3d')],function(_0x6ab539){return _0x446f4d[_0x549f('0x6c')](_0x6ab539[_0x549f('0x35')][_0x549f('0x31')]);});_[_0x549f('0x6b')](_0x4a6a23[_0x549f('0x24')][_0x549f('0x3d')],function(_0x4b3b7e){return _0x4b3b7e['editable']===_0x549f('0x6d');});return{'count':_0x4a6a23[_0x549f('0x24')][_0x549f('0x3d')][_0x549f('0x52')],'rows':_[_0x549f('0x33')](_0x4a6a23[_0x549f('0x24')][_0x549f('0x3d')],function(_0x3ce009){return{'id':_0x3ce009[_0x549f('0x31')],'name':_0x3ce009[_0x549f('0x6e')],'custom':_[_0x549f('0x6f')](_0x3ce009[_0x549f('0x31')],_0x549f('0x70'))?!![]:![],'options':_0x3ce009[_0x549f('0x35')][_0x549f('0x31')]===_0x549f('0x71')&&_0x3ce009[_0x549f('0x35')][_0x549f('0x72')][_0x549f('0x52')]>0x0?_[_0x549f('0x33')](_0x3ce009[_0x549f('0x35')][_0x549f('0x72')],function(_0x5c68a2){return{'name':_0x5c68a2[_0x549f('0x6e')],'value':_0x5c68a2[_0x549f('0x73')]};}):[]};})};}})['then'](respondWithResult(_0x245e6d,null))['catch'](function(_0x4ce75d){console[_0x549f('0x74')](_0x549f('0x75')+_0x4ce75d);var _0x351cba=_0x3651fc[_0x549f('0x39')][_0x549f('0x76')]?0x1f4:_0x4ce75d[_0x549f('0x77')]||0x1f4;logger[_0x549f('0x21')](_0x549f('0x78'),_0x549f('0x5b'),_0x351cba,JSON[_0x549f('0x20')](_0x4ce75d));delete _0x4ce75d[_0x549f('0x31')];if(_0x351cba===0x191){_0x351cba=0x190;}_0x245e6d[_0x549f('0x27')](_0x351cba)[_0x549f('0x32')](_0x3651fc['query'][_0x549f('0x76')]?{'message':'Wrong\x20credentials','statusCode':_0x4ce75d[_0x549f('0x77')]}:_0x4ce75d);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 5454e36..df714e8 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 _0xc724=['path','rimraf','exports','define','VtigerAccount','util','../../config/logger','moment','request-promise'];(function(_0x4eb832,_0x324bff){var _0x2e5927=function(_0x4687ce){while(--_0x4687ce){_0x4eb832['push'](_0x4eb832['shift']());}};_0x2e5927(++_0x324bff);}(_0xc724,0x19a));var _0x4c72=function(_0x4d0b60,_0x4ccc29){_0x4d0b60=_0x4d0b60-0x0;var _0x4efdc4=_0xc724[_0x4d0b60];return _0x4efdc4;};'use strict';var _=require('lodash');var util=require(_0x4c72('0x0'));var logger=require(_0x4c72('0x1'))('api');var moment=require(_0x4c72('0x2'));var BPromise=require('bluebird');var rp=require(_0x4c72('0x3'));var fs=require('fs');var path=require(_0x4c72('0x4'));var rimraf=require(_0x4c72('0x5'));var config=require('../../config/environment');var attributes=require('./intVtigerAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x4c72('0x6')]=function(_0x4346af,_0xe05ada){return _0x4346af[_0x4c72('0x7')](_0x4c72('0x8'),attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1b1a=['int_vtiger_accounts','lodash','api','moment','request-promise','path','rimraf','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x1b1a,0xa6));var _0xa1b1=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0x1b1a[_0x37c22c];return _0x119d79;};'use strict';var _=require(_0xa1b1('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa1b1('0x1'));var moment=require(_0xa1b1('0x2'));var BPromise=require('bluebird');var rp=require(_0xa1b1('0x3'));var fs=require('fs');var path=require(_0xa1b1('0x4'));var rimraf=require(_0xa1b1('0x5'));var config=require('../../config/environment');var attributes=require(_0xa1b1('0x6'));var integrations=require(_0xa1b1('0x7'));module[_0xa1b1('0x8')]=function(_0x521a38,_0x1a344d){return _0x521a38[_0xa1b1('0x9')]('VtigerAccount',attributes,{'tableName':_0xa1b1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js index 025e72b..74f1f2f 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 _0xbdd7=['result','catch','GetVtigerAccount','VtigerAccount','findAll','options','raw','where','include','map','model','attributes','stringify','find','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x15ec41,_0x48dd45){var _0x2fa788=function(_0x91af32){while(--_0x91af32){_0x15ec41['push'](_0x15ec41['shift']());}};_0x2fa788(++_0x48dd45);}(_0xbdd7,0x152));var _0x7bdd=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xbdd7[_0x432682];return _0x463d05;};'use strict';var _=require(_0x7bdd('0x0'));var util=require(_0x7bdd('0x1'));var moment=require(_0x7bdd('0x2'));var BPromise=require(_0x7bdd('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7bdd('0x4'))['db'];var utils=require(_0x7bdd('0x5'));var logger=require(_0x7bdd('0x6'))(_0x7bdd('0x7'));var config=require(_0x7bdd('0x8'));var jayson=require(_0x7bdd('0x9'));var client=jayson[_0x7bdd('0xa')][_0x7bdd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x49b3f2,_0x364c7b,_0x4c5a10){return new BPromise(function(_0xa2111f,_0x818ab5){return client[_0x7bdd('0xc')](_0x49b3f2,_0x4c5a10)[_0x7bdd('0xd')](function(_0x48e52c){logger[_0x7bdd('0xe')](_0x7bdd('0xf'),_0x364c7b,_0x7bdd('0x10'));logger[_0x7bdd('0x11')](_0x7bdd('0x12'),_0x364c7b,'request\x20sent',JSON['stringify'](_0x48e52c));if(_0x48e52c[_0x7bdd('0x13')]){if(_0x48e52c[_0x7bdd('0x13')][_0x7bdd('0x14')]===0x1f4){logger[_0x7bdd('0x13')](_0x7bdd('0xf'),_0x364c7b,_0x48e52c[_0x7bdd('0x13')][_0x7bdd('0x15')]);return _0x818ab5(_0x48e52c['error'][_0x7bdd('0x15')]);}logger[_0x7bdd('0x13')]('VtigerAccount,\x20%s,\x20%s',_0x364c7b,_0x48e52c[_0x7bdd('0x13')][_0x7bdd('0x15')]);return _0xa2111f(_0x48e52c[_0x7bdd('0x13')][_0x7bdd('0x15')]);}else{logger[_0x7bdd('0xe')](_0x7bdd('0xf'),_0x364c7b,_0x7bdd('0x10'));_0xa2111f(_0x48e52c[_0x7bdd('0x16')][_0x7bdd('0x15')]);}})[_0x7bdd('0x17')](function(_0x83f359){logger[_0x7bdd('0x13')](_0x7bdd('0xf'),_0x364c7b,_0x83f359);_0x818ab5(_0x83f359);});});}exports[_0x7bdd('0x18')]=function(_0xb184ba){var _0x197164=this;return new Promise(function(_0x1eeb64,_0x45e44d){return db[_0x7bdd('0x19')][_0x7bdd('0x1a')]({'raw':_0xb184ba[_0x7bdd('0x1b')]?_0xb184ba[_0x7bdd('0x1b')][_0x7bdd('0x1c')]===undefined?!![]:![]:!![],'where':_0xb184ba[_0x7bdd('0x1b')]?_0xb184ba['options'][_0x7bdd('0x1d')]||null:null,'attributes':_0xb184ba[_0x7bdd('0x1b')]?_0xb184ba[_0x7bdd('0x1b')]['attributes']||null:null,'limit':_0xb184ba[_0x7bdd('0x1b')]?_0xb184ba[_0x7bdd('0x1b')]['limit']||null:null,'include':_0xb184ba[_0x7bdd('0x1b')]?_0xb184ba[_0x7bdd('0x1b')][_0x7bdd('0x1e')]?_[_0x7bdd('0x1f')](_0xb184ba[_0x7bdd('0x1b')][_0x7bdd('0x1e')],function(_0x30d473){return{'model':db[_0x30d473[_0x7bdd('0x20')]],'as':_0x30d473['as'],'attributes':_0x30d473[_0x7bdd('0x21')],'include':_0x30d473[_0x7bdd('0x1e')]?_[_0x7bdd('0x1f')](_0x30d473[_0x7bdd('0x1e')],function(_0x1c9e8e){return{'model':db[_0x1c9e8e[_0x7bdd('0x20')]],'as':_0x1c9e8e['as'],'attributes':_0x1c9e8e['attributes'],'include':_0x1c9e8e[_0x7bdd('0x1e')]?_[_0x7bdd('0x1f')](_0x1c9e8e[_0x7bdd('0x1e')],function(_0xaa090f){return{'model':db[_0xaa090f[_0x7bdd('0x20')]],'as':_0xaa090f['as'],'attributes':_0xaa090f['attributes']};}):[]};}):[]};}):[]:[]})[_0x7bdd('0xd')](function(_0x343301){logger[_0x7bdd('0xe')](_0x7bdd('0x18'),_0xb184ba);logger[_0x7bdd('0x11')](_0x7bdd('0x18'),_0xb184ba,JSON[_0x7bdd('0x22')](_0x343301));_0x1eeb64(_0x343301);})[_0x7bdd('0x17')](function(_0x253089){logger[_0x7bdd('0x13')]('GetVtigerAccount',_0x253089[_0x7bdd('0x15')],_0xb184ba);_0x45e44d(_0x197164[_0x7bdd('0x13')](0x1f4,_0x253089[_0x7bdd('0x15')]));});});};exports['ShowVtigerAccount']=function(_0x5ca6b4){var _0x6ecd45=this;return new Promise(function(_0x67d7d8,_0x265045){return db[_0x7bdd('0x19')][_0x7bdd('0x23')]({'raw':_0x5ca6b4['options']?_0x5ca6b4[_0x7bdd('0x1b')][_0x7bdd('0x1c')]===undefined?!![]:![]:!![],'where':_0x5ca6b4[_0x7bdd('0x1b')]?_0x5ca6b4[_0x7bdd('0x1b')][_0x7bdd('0x1d')]||null:null,'attributes':_0x5ca6b4[_0x7bdd('0x1b')]?_0x5ca6b4[_0x7bdd('0x1b')][_0x7bdd('0x21')]||null:null,'include':_0x5ca6b4[_0x7bdd('0x1b')]?_0x5ca6b4[_0x7bdd('0x1b')][_0x7bdd('0x1e')]?_[_0x7bdd('0x1f')](_0x5ca6b4[_0x7bdd('0x1b')][_0x7bdd('0x1e')],function(_0x39009a){return{'model':db[_0x39009a['model']],'as':_0x39009a['as'],'attributes':_0x39009a['attributes'],'include':_0x39009a['include']?_[_0x7bdd('0x1f')](_0x39009a[_0x7bdd('0x1e')],function(_0x384c17){return{'model':db[_0x384c17[_0x7bdd('0x20')]],'as':_0x384c17['as'],'attributes':_0x384c17[_0x7bdd('0x21')],'include':_0x384c17[_0x7bdd('0x1e')]?_[_0x7bdd('0x1f')](_0x384c17[_0x7bdd('0x1e')],function(_0x22d374){return{'model':db[_0x22d374['model']],'as':_0x22d374['as'],'attributes':_0x22d374['attributes']};}):[]};}):[]};}):[]:[]})[_0x7bdd('0xd')](function(_0x180bae){logger[_0x7bdd('0xe')]('ShowVtigerAccount',_0x5ca6b4);logger[_0x7bdd('0x11')]('ShowVtigerAccount',_0x5ca6b4,JSON['stringify'](_0x180bae));_0x67d7d8(_0x180bae);})[_0x7bdd('0x17')](function(_0x4dd140){logger['error']('ShowVtigerAccount',_0x4dd140[_0x7bdd('0x15')],_0x5ca6b4);_0x265045(_0x6ecd45['error'](0x1f4,_0x4dd140[_0x7bdd('0x15')]));});});}; \ No newline at end of file +var _0xf40f=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVtigerAccount','VtigerAccount','findAll','options','include','model','attributes','map','find','raw','ShowVtigerAccount','util'];(function(_0x535498,_0x115feb){var _0x4502c6=function(_0x454744){while(--_0x454744){_0x535498['push'](_0x535498['shift']());}};_0x4502c6(++_0x115feb);}(_0xf40f,0x13a));var _0xff40=function(_0x1da2a7,_0x260c61){_0x1da2a7=_0x1da2a7-0x0;var _0x11bfb5=_0xf40f[_0x1da2a7];return _0x11bfb5;};'use strict';var _=require('lodash');var util=require(_0xff40('0x0'));var moment=require(_0xff40('0x1'));var BPromise=require(_0xff40('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xff40('0x3'));var db=require(_0xff40('0x4'))['db'];var utils=require(_0xff40('0x5'));var logger=require(_0xff40('0x6'))('rpc');var config=require(_0xff40('0x7'));var jayson=require(_0xff40('0x8'));var client=jayson[_0xff40('0x9')][_0xff40('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x570d5d,_0x233cb0,_0x5c321f){return new BPromise(function(_0x427f70,_0x105cc8){return client[_0xff40('0xb')](_0x570d5d,_0x5c321f)[_0xff40('0xc')](function(_0x312d9b){logger[_0xff40('0xd')](_0xff40('0xe'),_0x233cb0,_0xff40('0xf'));logger[_0xff40('0x10')](_0xff40('0x11'),_0x233cb0,_0xff40('0xf'),JSON[_0xff40('0x12')](_0x312d9b));if(_0x312d9b['error']){if(_0x312d9b[_0xff40('0x13')][_0xff40('0x14')]===0x1f4){logger[_0xff40('0x13')](_0xff40('0xe'),_0x233cb0,_0x312d9b[_0xff40('0x13')][_0xff40('0x15')]);return _0x105cc8(_0x312d9b[_0xff40('0x13')][_0xff40('0x15')]);}logger[_0xff40('0x13')](_0xff40('0xe'),_0x233cb0,_0x312d9b['error'][_0xff40('0x15')]);return _0x427f70(_0x312d9b[_0xff40('0x13')][_0xff40('0x15')]);}else{logger[_0xff40('0xd')](_0xff40('0xe'),_0x233cb0,_0xff40('0xf'));_0x427f70(_0x312d9b[_0xff40('0x16')][_0xff40('0x15')]);}})[_0xff40('0x17')](function(_0x40ae4e){logger[_0xff40('0x13')](_0xff40('0xe'),_0x233cb0,_0x40ae4e);_0x105cc8(_0x40ae4e);});});}exports[_0xff40('0x18')]=function(_0x52a3b5){var _0x3cab8b=this;return new Promise(function(_0x2054fa,_0x10e5d3){return db[_0xff40('0x19')][_0xff40('0x1a')]({'raw':_0x52a3b5[_0xff40('0x1b')]?_0x52a3b5[_0xff40('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x52a3b5[_0xff40('0x1b')]?_0x52a3b5['options']['where']||null:null,'attributes':_0x52a3b5[_0xff40('0x1b')]?_0x52a3b5[_0xff40('0x1b')]['attributes']||null:null,'limit':_0x52a3b5[_0xff40('0x1b')]?_0x52a3b5[_0xff40('0x1b')]['limit']||null:null,'include':_0x52a3b5[_0xff40('0x1b')]?_0x52a3b5[_0xff40('0x1b')][_0xff40('0x1c')]?_['map'](_0x52a3b5[_0xff40('0x1b')]['include'],function(_0x353058){return{'model':db[_0x353058[_0xff40('0x1d')]],'as':_0x353058['as'],'attributes':_0x353058[_0xff40('0x1e')],'include':_0x353058[_0xff40('0x1c')]?_['map'](_0x353058[_0xff40('0x1c')],function(_0x23df3b){return{'model':db[_0x23df3b[_0xff40('0x1d')]],'as':_0x23df3b['as'],'attributes':_0x23df3b[_0xff40('0x1e')],'include':_0x23df3b['include']?_[_0xff40('0x1f')](_0x23df3b[_0xff40('0x1c')],function(_0x4ed643){return{'model':db[_0x4ed643[_0xff40('0x1d')]],'as':_0x4ed643['as'],'attributes':_0x4ed643[_0xff40('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x445820){logger['info'](_0xff40('0x18'),_0x52a3b5);logger[_0xff40('0x10')](_0xff40('0x18'),_0x52a3b5,JSON['stringify'](_0x445820));_0x2054fa(_0x445820);})['catch'](function(_0x55f07d){logger[_0xff40('0x13')](_0xff40('0x18'),_0x55f07d['message'],_0x52a3b5);_0x10e5d3(_0x3cab8b[_0xff40('0x13')](0x1f4,_0x55f07d[_0xff40('0x15')]));});});};exports['ShowVtigerAccount']=function(_0x6424c4){var _0xada425=this;return new Promise(function(_0x554b24,_0x253c23){return db['VtigerAccount'][_0xff40('0x20')]({'raw':_0x6424c4[_0xff40('0x1b')]?_0x6424c4[_0xff40('0x1b')][_0xff40('0x21')]===undefined?!![]:![]:!![],'where':_0x6424c4[_0xff40('0x1b')]?_0x6424c4[_0xff40('0x1b')]['where']||null:null,'attributes':_0x6424c4[_0xff40('0x1b')]?_0x6424c4[_0xff40('0x1b')][_0xff40('0x1e')]||null:null,'include':_0x6424c4['options']?_0x6424c4[_0xff40('0x1b')][_0xff40('0x1c')]?_[_0xff40('0x1f')](_0x6424c4[_0xff40('0x1b')]['include'],function(_0x2bf452){return{'model':db[_0x2bf452['model']],'as':_0x2bf452['as'],'attributes':_0x2bf452[_0xff40('0x1e')],'include':_0x2bf452[_0xff40('0x1c')]?_['map'](_0x2bf452[_0xff40('0x1c')],function(_0x1e08e7){return{'model':db[_0x1e08e7[_0xff40('0x1d')]],'as':_0x1e08e7['as'],'attributes':_0x1e08e7[_0xff40('0x1e')],'include':_0x1e08e7[_0xff40('0x1c')]?_[_0xff40('0x1f')](_0x1e08e7[_0xff40('0x1c')],function(_0x1cb150){return{'model':db[_0x1cb150['model']],'as':_0x1cb150['as'],'attributes':_0x1cb150[_0xff40('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xff40('0xc')](function(_0x512134){logger[_0xff40('0xd')](_0xff40('0x22'),_0x6424c4);logger['debug'](_0xff40('0x22'),_0x6424c4,JSON[_0xff40('0x12')](_0x512134));_0x554b24(_0x512134);})[_0xff40('0x17')](function(_0x29b037){logger[_0xff40('0x13')](_0xff40('0x22'),_0x29b037[_0xff40('0x15')],_0x6424c4);_0x253c23(_0xada425['error'](0x1f4,_0x29b037[_0xff40('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 4ee9edb..55fe6f0 100644 --- a/server/api/intVtigerConfiguration/index.js +++ b/server/api/intVtigerConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated'];(function(_0x3d3650,_0x1ae5c5){var _0x389435=function(_0x5e252c){while(--_0x5e252c){_0x3d3650['push'](_0x3d3650['shift']());}};_0x389435(++_0x1ae5c5);}(_0xb10b,0x12a));var _0xbb10=function(_0x1ae139,_0x529c60){_0x1ae139=_0x1ae139-0x0;var _0x5e0de7=_0xb10b[_0x1ae139];return _0x5e0de7;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var auth=require(_0xbb10('0x4'));var interaction=require(_0xbb10('0x5'));var config=require(_0xbb10('0x6'));var controller=require(_0xbb10('0x7'));router[_0xbb10('0x8')]('/',auth[_0xbb10('0x9')](),controller['index']);router[_0xbb10('0x8')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0xb')]);router[_0xbb10('0x8')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0xd')]);router[_0xbb10('0x8')](_0xbb10('0xe'),auth[_0xbb10('0x9')](),controller['getSubjects']);router['get'](_0xbb10('0xf'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x10')]);router['post']('/',auth[_0xbb10('0x9')](),controller['create']);router[_0xbb10('0x11')](_0xbb10('0xa'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x12')]);router[_0xbb10('0x13')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0x14')]);module[_0xbb10('0x15')]=router; \ No newline at end of file +var _0xb10b=['/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated'];(function(_0x36e4ed,_0x2e480a){var _0x49ac4e=function(_0x44bb23){while(--_0x44bb23){_0x36e4ed['push'](_0x36e4ed['shift']());}};_0x49ac4e(++_0x2e480a);}(_0xb10b,0x12a));var _0xbb10=function(_0x5a84d1,_0x4a330f){_0x5a84d1=_0x5a84d1-0x0;var _0x4b656c=_0xb10b[_0x5a84d1];return _0x4b656c;};'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 9e5f62b..2d6d3ab 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 _0x3cfd=['sequelize','STRING'];(function(_0x5e3a9a,_0x5e15c0){var _0xdcf034=function(_0x509774){while(--_0x509774){_0x5e3a9a['push'](_0x5e3a9a['shift']());}};_0xdcf034(++_0x5e15c0);}(_0x3cfd,0x15e));var _0xd3cf=function(_0x68b52e,_0xe1abf9){_0x68b52e=_0x68b52e-0x0;var _0x4278c3=_0x3cfd[_0x68b52e];return _0x4278c3;};'use strict';var Sequelize=require(_0xd3cf('0x0'));module['exports']={'name':{'type':Sequelize[_0xd3cf('0x1')]},'description':{'type':Sequelize[_0xd3cf('0x1')]}}; \ No newline at end of file +var _0x1c3d=['STRING','sequelize'];(function(_0x3b150c,_0x2f93f8){var _0x5cd414=function(_0x26305e){while(--_0x26305e){_0x3b150c['push'](_0x3b150c['shift']());}};_0x5cd414(++_0x2f93f8);}(_0x1c3d,0x19b));var _0xd1c3=function(_0x4e9bf9,_0x1b68f8){_0x4e9bf9=_0x4e9bf9-0x0;var _0x556466=_0x1c3d[_0x4e9bf9];return _0x556466;};'use strict';var Sequelize=require(_0xd1c3('0x0'));module['exports']={'name':{'type':Sequelize[_0xd1c3('0x1')]},'description':{'type':Sequelize[_0xd1c3('0x1')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 03a0ae8..e81f36f 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 _0x6236=['mustache','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','../../config/utils','../../config/environment','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','status','end','offset','limit','set','Content-Range','reject','save','update','destroy','sendStatus','stack','name','send','map','VtigerConfiguration','rawAttributes','type','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','show','length','find','create','body','params','getFields','findOne','VtigerField','pick','nolimit','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird'];(function(_0x5045b5,_0x2840eb){var _0x564757=function(_0x3d0d5c){while(--_0x3d0d5c){_0x5045b5['push'](_0x5045b5['shift']());}};_0x564757(++_0x2840eb);}(_0x6236,0x1c6));var _0x6623=function(_0x4780d6,_0x9df294){_0x4780d6=_0x4780d6-0x0;var _0x444777=_0x6236[_0x4780d6];return _0x444777;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6623('0x0'));var rimraf=require(_0x6623('0x1'));var zipdir=require(_0x6623('0x2'));var jsonpatch=require(_0x6623('0x3'));var rp=require(_0x6623('0x4'));var moment=require('moment');var BPromise=require(_0x6623('0x5'));var Mustache=require(_0x6623('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x6623('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x6623('0x8'));var squel=require(_0x6623('0x9'));var crypto=require(_0x6623('0xa'));var jsforce=require(_0x6623('0xb'));var deskjs=require(_0x6623('0xc'));var toCsv=require(_0x6623('0x7'));var querystring=require(_0x6623('0xd'));var Papa=require(_0x6623('0xe'));var Redis=require(_0x6623('0xf'));var authService=require(_0x6623('0x10'));var qs=require(_0x6623('0x11'));var as=require(_0x6623('0x12'));var hardwareService=require(_0x6623('0x13'));var logger=require(_0x6623('0x14'))('api');var utils=require(_0x6623('0x15'));var config=require(_0x6623('0x16'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0x6623('0x17')][_0x6623('0x18')]({'port':0x232a});function checkPasswordPattern(_0xdd7ab1,_0x20a135,_0x10999d){if(_0x10999d){var _0x32e7af=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x32e7af[_0x6623('0x19')](_0x20a135)){return _0xdd7ab1;}else{throw new db[(_0x6623('0x1a'))][(_0x6623('0x1b'))](_0x6623('0x1c'));}}else{return _0xdd7ab1;}}function respondWithRpcPromise(_0x44f2a4,_0x1cb6fb,_0x3746a4,_0x5db2e2){return new BPromise(function(_0x11bc67,_0x34d8f4){var _0x58c48d=_0x5db2e2||client;return _0x58c48d[_0x6623('0x1d')](_0x44f2a4,_0x3746a4)[_0x6623('0x1e')](function(_0x21989f){logger[_0x6623('0x1f')](_0x6623('0x20'),_0x1cb6fb,_0x6623('0x21'));logger[_0x6623('0x22')](_0x6623('0x23'),_0x1cb6fb,_0x6623('0x21'),JSON['stringify'](_0x21989f));if(_0x21989f[_0x6623('0x24')]){if(_0x21989f[_0x6623('0x24')][_0x6623('0x25')]===0x1f4){logger[_0x6623('0x24')](_0x6623('0x20'),_0x1cb6fb,_0x21989f[_0x6623('0x24')][_0x6623('0x26')]);return _0x34d8f4(_0x21989f[_0x6623('0x24')][_0x6623('0x26')]);}logger[_0x6623('0x24')]('VtigerConfiguration,\x20%s,\x20%s',_0x1cb6fb,_0x21989f[_0x6623('0x24')][_0x6623('0x26')]);return _0x11bc67(_0x21989f['error']['message']);}else{logger['info'](_0x6623('0x20'),_0x1cb6fb,_0x6623('0x21'));_0x11bc67(_0x21989f[_0x6623('0x27')]['message']);}})[_0x6623('0x28')](function(_0x20bdfa){logger['error'](_0x6623('0x20'),_0x1cb6fb,_0x20bdfa);_0x34d8f4(_0x20bdfa);});});}function respondWithStatusCode(_0x4687ea,_0x5a3182){_0x5a3182=_0x5a3182||0xcc;return function(_0x37c277){if(_0x37c277){return _0x4687ea['sendStatus'](_0x5a3182);}return _0x4687ea[_0x6623('0x29')](_0x5a3182)[_0x6623('0x2a')]();};}function respondWithResult(_0x23b962,_0x185caf){_0x185caf=_0x185caf||0xc8;return function(_0x3a8e53){if(_0x3a8e53){return _0x23b962[_0x6623('0x29')](_0x185caf)['json'](_0x3a8e53);}};}function respondWithFilteredResult(_0x14207a,_0x16668e){return function(_0x3d27e6){if(_0x3d27e6){var _0x16dc9e=_0x3d27e6['count'],_0x1df76d=_0x16668e[_0x6623('0x2b')],_0x3833e4=_0x16668e[_0x6623('0x2b')]+_0x16668e[_0x6623('0x2c')],_0x124327;if(_0x3833e4>=_0x16dc9e){_0x3833e4=_0x16dc9e;_0x124327=0xc8;}else{_0x124327=0xce;}_0x14207a['status'](_0x124327);return _0x14207a[_0x6623('0x2d')](_0x6623('0x2e'),_0x1df76d+'-'+_0x3833e4+'/'+_0x16dc9e)['json'](_0x3d27e6);}return null;};}function patchUpdates(_0x3ee16a){return function(_0x628f6d){try{jsonpatch['apply'](_0x628f6d,_0x3ee16a,!![]);}catch(_0x4d8edf){return BPromise[_0x6623('0x2f')](_0x4d8edf);}return _0x628f6d[_0x6623('0x30')]();};}function saveUpdates(_0x520cc2,_0x11c86f){return function(_0x1765d2){if(_0x1765d2){return _0x1765d2[_0x6623('0x31')](_0x520cc2)[_0x6623('0x1e')](function(_0x3c3dde){return _0x3c3dde;});}return null;};}function removeEntity(_0x13a919,_0x2252e6){return function(_0x4291ff){if(_0x4291ff){return _0x4291ff[_0x6623('0x32')]()['then'](function(){_0x13a919[_0x6623('0x29')](0xcc)[_0x6623('0x2a')]();});}};}function handleEntityNotFound(_0x234b4d,_0x5b5af5){return function(_0x2c1ccf){if(!_0x2c1ccf){_0x234b4d[_0x6623('0x33')](0x194);}return _0x2c1ccf;};}function handleError(_0x37dc26,_0x99a110){_0x99a110=_0x99a110||0x1f4;return function(_0x5bfbd5){logger[_0x6623('0x24')](_0x5bfbd5[_0x6623('0x34')]);if(_0x5bfbd5[_0x6623('0x35')]){delete _0x5bfbd5['name'];}_0x37dc26[_0x6623('0x29')](_0x99a110)[_0x6623('0x36')](_0x5bfbd5);};}exports['index']=function(_0x2d9c9a,_0x202715){var _0x39e8de={},_0x2cf09b={},_0x3de9fc={'count':0x0,'rows':[]};var _0x2c8e45=_[_0x6623('0x37')](db[_0x6623('0x38')][_0x6623('0x39')],function(_0x631a53){return{'name':_0x631a53['fieldName'],'type':_0x631a53[_0x6623('0x3a')]['key']};});_0x2cf09b['model']=_[_0x6623('0x37')](_0x2c8e45,'name');_0x2cf09b[_0x6623('0x3b')]=_[_0x6623('0x3c')](_0x2d9c9a[_0x6623('0x3b')]);_0x2cf09b[_0x6623('0x3d')]=_[_0x6623('0x3e')](_0x2cf09b['model'],_0x2cf09b['query']);_0x39e8de[_0x6623('0x3f')]=_[_0x6623('0x3e')](_0x2cf09b[_0x6623('0x40')],qs['fields'](_0x2d9c9a[_0x6623('0x3b')][_0x6623('0x41')]));_0x39e8de[_0x6623('0x3f')]=_0x39e8de['attributes']['length']?_0x39e8de[_0x6623('0x3f')]:_0x2cf09b[_0x6623('0x40')];if(!_0x2d9c9a[_0x6623('0x3b')][_0x6623('0x42')]('nolimit')){_0x39e8de['limit']=qs[_0x6623('0x2c')](_0x2d9c9a[_0x6623('0x3b')][_0x6623('0x2c')]);_0x39e8de[_0x6623('0x2b')]=qs['offset'](_0x2d9c9a[_0x6623('0x3b')][_0x6623('0x2b')]);}_0x39e8de[_0x6623('0x43')]=qs['sort'](_0x2d9c9a[_0x6623('0x3b')][_0x6623('0x44')]);_0x39e8de[_0x6623('0x45')]=qs[_0x6623('0x3d')](_['pick'](_0x2d9c9a[_0x6623('0x3b')],_0x2cf09b['filters']));if(_0x2d9c9a['query'][_0x6623('0x46')]){_0x39e8de[_0x6623('0x45')]=_[_0x6623('0x47')](_0x39e8de[_0x6623('0x45')],{'$or':_[_0x6623('0x37')](_0x2c8e45,function(_0x3fceb0){if(_0x3fceb0[_0x6623('0x3a')]!==_0x6623('0x48')){var _0x4b4bda={};_0x4b4bda[_0x3fceb0[_0x6623('0x35')]]={'$like':'%'+_0x2d9c9a['query'][_0x6623('0x46')]+'%'};return _0x4b4bda;}})});}_0x39e8de=_[_0x6623('0x47')]({},_0x39e8de,_0x2d9c9a[_0x6623('0x49')]);var _0x55013f={'where':_0x39e8de[_0x6623('0x45')]};return db[_0x6623('0x38')][_0x6623('0x4a')](_0x55013f)[_0x6623('0x1e')](function(_0x3beb90){_0x3de9fc[_0x6623('0x4a')]=_0x3beb90;if(_0x2d9c9a[_0x6623('0x3b')][_0x6623('0x4b')]){_0x39e8de[_0x6623('0x4c')]=[{'all':!![]}];}return db[_0x6623('0x38')][_0x6623('0x4d')](_0x39e8de);})['then'](function(_0x33a036){_0x3de9fc[_0x6623('0x4e')]=_0x33a036;return _0x3de9fc;})[_0x6623('0x1e')](respondWithFilteredResult(_0x202715,_0x39e8de))[_0x6623('0x28')](handleError(_0x202715,null));};exports[_0x6623('0x4f')]=function(_0x203b66,_0x188e71){var _0x317c78={'raw':![],'where':{'id':_0x203b66['params']['id']}},_0x3e4c95={};_0x3e4c95[_0x6623('0x40')]=_[_0x6623('0x3c')](db['VtigerConfiguration']['rawAttributes']);_0x3e4c95['query']=_[_0x6623('0x3c')](_0x203b66[_0x6623('0x3b')]);_0x3e4c95[_0x6623('0x3d')]=_[_0x6623('0x3e')](_0x3e4c95[_0x6623('0x40')],_0x3e4c95[_0x6623('0x3b')]);_0x317c78[_0x6623('0x3f')]=_['intersection'](_0x3e4c95['model'],qs[_0x6623('0x41')](_0x203b66[_0x6623('0x3b')][_0x6623('0x41')]));_0x317c78['attributes']=_0x317c78[_0x6623('0x3f')][_0x6623('0x50')]?_0x317c78[_0x6623('0x3f')]:_0x3e4c95['model'];if(_0x203b66[_0x6623('0x3b')][_0x6623('0x4b')]){_0x317c78[_0x6623('0x4c')]=[{'all':!![]}];}_0x317c78=_[_0x6623('0x47')]({},_0x317c78,_0x203b66[_0x6623('0x49')]);return db['VtigerConfiguration'][_0x6623('0x51')](_0x317c78)[_0x6623('0x1e')](handleEntityNotFound(_0x188e71,null))[_0x6623('0x1e')](respondWithResult(_0x188e71,null))['catch'](handleError(_0x188e71,null));};exports[_0x6623('0x52')]=function(_0x5e3a06,_0x4d6747){return db[_0x6623('0x38')][_0x6623('0x52')](_0x5e3a06[_0x6623('0x53')],{})[_0x6623('0x1e')](respondWithResult(_0x4d6747,0xc9))[_0x6623('0x28')](handleError(_0x4d6747,null));};exports['update']=function(_0x3f8ee7,_0x2a5057){if(_0x3f8ee7[_0x6623('0x53')]['id']){delete _0x3f8ee7[_0x6623('0x53')]['id'];}return db[_0x6623('0x38')][_0x6623('0x51')]({'where':{'id':_0x3f8ee7[_0x6623('0x54')]['id']}})[_0x6623('0x1e')](handleEntityNotFound(_0x2a5057,null))[_0x6623('0x1e')](saveUpdates(_0x3f8ee7['body'],null))[_0x6623('0x1e')](respondWithResult(_0x2a5057,null))[_0x6623('0x28')](handleError(_0x2a5057,null));};exports[_0x6623('0x32')]=function(_0x39f1a1,_0x1e8278){return db[_0x6623('0x38')]['find']({'where':{'id':_0x39f1a1[_0x6623('0x54')]['id']}})[_0x6623('0x1e')](handleEntityNotFound(_0x1e8278,null))[_0x6623('0x1e')](removeEntity(_0x1e8278,null))[_0x6623('0x28')](handleError(_0x1e8278,null));};exports[_0x6623('0x55')]=function(_0x294762,_0x4a0efd,_0x2e77a0){var _0x31931c={};var _0x36b17a={};var _0x58244a;var _0x3c908b;return db[_0x6623('0x38')][_0x6623('0x56')]({'where':{'id':_0x294762[_0x6623('0x54')]['id']}})[_0x6623('0x1e')](handleEntityNotFound(_0x4a0efd,null))[_0x6623('0x1e')](function(_0x55e010){if(_0x55e010){_0x58244a=_0x55e010;_0x36b17a[_0x6623('0x40')]=_[_0x6623('0x3c')](db[_0x6623('0x57')][_0x6623('0x39')]);_0x36b17a[_0x6623('0x3b')]=_['keys'](_0x294762['query']);_0x36b17a[_0x6623('0x3d')]=_[_0x6623('0x3e')](_0x36b17a['model'],_0x36b17a[_0x6623('0x3b')]);_0x31931c['attributes']=_[_0x6623('0x3e')](_0x36b17a[_0x6623('0x40')],qs['fields'](_0x294762[_0x6623('0x3b')][_0x6623('0x41')]));_0x31931c['attributes']=_0x31931c[_0x6623('0x3f')][_0x6623('0x50')]?_0x31931c[_0x6623('0x3f')]:_0x36b17a['model'];_0x31931c[_0x6623('0x43')]=qs[_0x6623('0x44')](_0x294762[_0x6623('0x3b')][_0x6623('0x44')]);_0x31931c[_0x6623('0x45')]=qs[_0x6623('0x3d')](_[_0x6623('0x58')](_0x294762[_0x6623('0x3b')],_0x36b17a['filters']));if(_0x294762[_0x6623('0x3b')][_0x6623('0x46')]){_0x31931c[_0x6623('0x45')]=_[_0x6623('0x47')](_0x31931c[_0x6623('0x45')],{'$or':_[_0x6623('0x37')](_0x31931c[_0x6623('0x3f')],function(_0x250f31){var _0x56a7a9={};_0x56a7a9[_0x250f31]={'$like':'%'+_0x294762[_0x6623('0x3b')][_0x6623('0x46')]+'%'};return _0x56a7a9;})});}_0x31931c=_[_0x6623('0x47')]({},_0x31931c,_0x294762[_0x6623('0x49')]);return _0x58244a['getFields'](_0x31931c);}})[_0x6623('0x1e')](function(_0xa2278c){if(_0xa2278c){_0x3c908b=_0xa2278c[_0x6623('0x50')];if(!_0x294762[_0x6623('0x3b')][_0x6623('0x42')](_0x6623('0x59'))){_0x31931c[_0x6623('0x2c')]=qs['limit'](_0x294762[_0x6623('0x3b')]['limit']);_0x31931c[_0x6623('0x2b')]=qs[_0x6623('0x2b')](_0x294762[_0x6623('0x3b')]['offset']);}return _0x58244a[_0x6623('0x55')](_0x31931c);}})[_0x6623('0x1e')](function(_0x1d2ec0){if(_0x1d2ec0){return _0x1d2ec0?{'count':_0x3c908b,'rows':_0x1d2ec0}:null;}})[_0x6623('0x1e')](respondWithResult(_0x4a0efd,null))[_0x6623('0x28')](handleError(_0x4a0efd,null));};exports[_0x6623('0x5a')]=function(_0x5f4de8,_0x167468,_0x14dec2){var _0x19699={};var _0x3538db={};var _0xf68f9c;var _0x1c58f1;return db[_0x6623('0x38')]['findOne']({'where':{'id':_0x5f4de8['params']['id']}})['then'](handleEntityNotFound(_0x167468,null))['then'](function(_0x376f42){if(_0x376f42){_0xf68f9c=_0x376f42;_0x3538db[_0x6623('0x40')]=_['keys'](db['VtigerField'][_0x6623('0x39')]);_0x3538db[_0x6623('0x3b')]=_[_0x6623('0x3c')](_0x5f4de8[_0x6623('0x3b')]);_0x3538db[_0x6623('0x3d')]=_[_0x6623('0x3e')](_0x3538db['model'],_0x3538db[_0x6623('0x3b')]);_0x19699['attributes']=_[_0x6623('0x3e')](_0x3538db[_0x6623('0x40')],qs['fields'](_0x5f4de8[_0x6623('0x3b')][_0x6623('0x41')]));_0x19699[_0x6623('0x3f')]=_0x19699[_0x6623('0x3f')][_0x6623('0x50')]?_0x19699[_0x6623('0x3f')]:_0x3538db['model'];_0x19699[_0x6623('0x43')]=qs[_0x6623('0x44')](_0x5f4de8[_0x6623('0x3b')][_0x6623('0x44')]);_0x19699[_0x6623('0x45')]=qs[_0x6623('0x3d')](_['pick'](_0x5f4de8[_0x6623('0x3b')],_0x3538db[_0x6623('0x3d')]));if(_0x5f4de8['query']['filter']){_0x19699['where']=_[_0x6623('0x47')](_0x19699[_0x6623('0x45')],{'$or':_[_0x6623('0x37')](_0x19699[_0x6623('0x3f')],function(_0x2bb588){var _0x29bf4e={};_0x29bf4e[_0x2bb588]={'$like':'%'+_0x5f4de8['query'][_0x6623('0x46')]+'%'};return _0x29bf4e;})});}_0x19699=_[_0x6623('0x47')]({},_0x19699,_0x5f4de8[_0x6623('0x49')]);return _0xf68f9c[_0x6623('0x5a')](_0x19699);}})[_0x6623('0x1e')](function(_0x54313f){if(_0x54313f){_0x1c58f1=_0x54313f[_0x6623('0x50')];if(!_0x5f4de8['query'][_0x6623('0x42')](_0x6623('0x59'))){_0x19699[_0x6623('0x2c')]=qs[_0x6623('0x2c')](_0x5f4de8[_0x6623('0x3b')][_0x6623('0x2c')]);_0x19699[_0x6623('0x2b')]=qs[_0x6623('0x2b')](_0x5f4de8[_0x6623('0x3b')]['offset']);}return _0xf68f9c[_0x6623('0x5a')](_0x19699);}})[_0x6623('0x1e')](function(_0x448751){if(_0x448751){return _0x448751?{'count':_0x1c58f1,'rows':_0x448751}:null;}})[_0x6623('0x1e')](respondWithResult(_0x167468,null))[_0x6623('0x28')](handleError(_0x167468,null));};exports[_0x6623('0x5b')]=function(_0x29112e,_0x23fb3a,_0x4cf4f2){var _0x13cc56={};var _0x1af48a={};var _0x4be277;var _0x132330;return db[_0x6623('0x38')]['findOne']({'where':{'id':_0x29112e['params']['id']}})[_0x6623('0x1e')](handleEntityNotFound(_0x23fb3a,null))[_0x6623('0x1e')](function(_0x49e497){if(_0x49e497){_0x4be277=_0x49e497;_0x1af48a['model']=_['keys'](db[_0x6623('0x57')][_0x6623('0x39')]);_0x1af48a['query']=_[_0x6623('0x3c')](_0x29112e[_0x6623('0x3b')]);_0x1af48a[_0x6623('0x3d')]=_['intersection'](_0x1af48a[_0x6623('0x40')],_0x1af48a[_0x6623('0x3b')]);_0x13cc56[_0x6623('0x3f')]=_[_0x6623('0x3e')](_0x1af48a[_0x6623('0x40')],qs[_0x6623('0x41')](_0x29112e['query'][_0x6623('0x41')]));_0x13cc56['attributes']=_0x13cc56[_0x6623('0x3f')][_0x6623('0x50')]?_0x13cc56[_0x6623('0x3f')]:_0x1af48a[_0x6623('0x40')];_0x13cc56[_0x6623('0x43')]=qs['sort'](_0x29112e[_0x6623('0x3b')][_0x6623('0x44')]);_0x13cc56[_0x6623('0x45')]=qs[_0x6623('0x3d')](_[_0x6623('0x58')](_0x29112e[_0x6623('0x3b')],_0x1af48a[_0x6623('0x3d')]));if(_0x29112e[_0x6623('0x3b')][_0x6623('0x46')]){_0x13cc56[_0x6623('0x45')]=_[_0x6623('0x47')](_0x13cc56['where'],{'$or':_['map'](_0x13cc56[_0x6623('0x3f')],function(_0x5dd19d){var _0x392f92={};_0x392f92[_0x5dd19d]={'$like':'%'+_0x29112e[_0x6623('0x3b')]['filter']+'%'};return _0x392f92;})});}_0x13cc56=_[_0x6623('0x47')]({},_0x13cc56,_0x29112e[_0x6623('0x49')]);return _0x4be277[_0x6623('0x5b')](_0x13cc56);}})[_0x6623('0x1e')](function(_0x665e16){if(_0x665e16){_0x132330=_0x665e16[_0x6623('0x50')];if(!_0x29112e['query']['hasOwnProperty'](_0x6623('0x59'))){_0x13cc56[_0x6623('0x2c')]=qs[_0x6623('0x2c')](_0x29112e['query'][_0x6623('0x2c')]);_0x13cc56[_0x6623('0x2b')]=qs[_0x6623('0x2b')](_0x29112e[_0x6623('0x3b')][_0x6623('0x2b')]);}return _0x4be277[_0x6623('0x5b')](_0x13cc56);}})['then'](function(_0x5e6233){if(_0x5e6233){return _0x5e6233?{'count':_0x132330,'rows':_0x5e6233}:null;}})[_0x6623('0x1e')](respondWithResult(_0x23fb3a,null))['catch'](handleError(_0x23fb3a,null));}; \ No newline at end of file +var _0x33a4=['find','create','body','getFields','findOne','pick','nolimit','getSubjects','getDescriptions','VtigerField','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','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','then','info','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerConfiguration,\x20%s,\x20%s','message','result','sendStatus','status','end','json','offset','set','Content-Range','apply','reject','save','update','destroy','name','send','index','map','VtigerConfiguration','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','filter','where','type','VIRTUAL','merge','options','count','include','findAll','rows','catch','params','includeAll'];(function(_0x4e7e2c,_0x44ec66){var _0x160310=function(_0x1bc4a8){while(--_0x1bc4a8){_0x4e7e2c['push'](_0x4e7e2c['shift']());}};_0x160310(++_0x44ec66);}(_0x33a4,0x19a));var _0x433a=function(_0x24492c,_0xccfbea){_0x24492c=_0x24492c-0x0;var _0x5c2cef=_0x33a4[_0x24492c];return _0x5c2cef;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x433a('0x0'));var rimraf=require(_0x433a('0x1'));var zipdir=require(_0x433a('0x2'));var jsonpatch=require(_0x433a('0x3'));var rp=require('request-promise');var moment=require(_0x433a('0x4'));var BPromise=require(_0x433a('0x5'));var Mustache=require(_0x433a('0x6'));var util=require(_0x433a('0x7'));var path=require(_0x433a('0x8'));var sox=require(_0x433a('0x9'));var csv=require(_0x433a('0xa'));var ejs=require(_0x433a('0xb'));var fs=require('fs');var _=require(_0x433a('0xc'));var squel=require(_0x433a('0xd'));var crypto=require(_0x433a('0xe'));var jsforce=require(_0x433a('0xf'));var deskjs=require(_0x433a('0x10'));var toCsv=require(_0x433a('0xa'));var querystring=require(_0x433a('0x11'));var Papa=require(_0x433a('0x12'));var Redis=require('ioredis');var authService=require(_0x433a('0x13'));var qs=require(_0x433a('0x14'));var as=require(_0x433a('0x15'));var hardwareService=require(_0x433a('0x16'));var logger=require(_0x433a('0x17'))(_0x433a('0x18'));var utils=require(_0x433a('0x19'));var config=require(_0x433a('0x1a'));var db=require(_0x433a('0x1b'))['db'];var jayson=require(_0x433a('0x1c'));var client=jayson[_0x433a('0x1d')][_0x433a('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x3b2706,_0xa82ac9,_0x3c9684){if(_0x3c9684){var _0x350d39=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x350d39['test'](_0xa82ac9)){return _0x3b2706;}else{throw new db[(_0x433a('0x1f'))][(_0x433a('0x20'))](_0x433a('0x21'));}}else{return _0x3b2706;}}function respondWithRpcPromise(_0x515fda,_0x1972cc,_0x425cee,_0x3428a3){return new BPromise(function(_0x13cca2,_0x29252a){var _0x171e7e=_0x3428a3||client;return _0x171e7e[_0x433a('0x22')](_0x515fda,_0x425cee)[_0x433a('0x23')](function(_0x24c0b7){logger[_0x433a('0x24')]('VtigerConfiguration,\x20%s,\x20%s',_0x1972cc,_0x433a('0x25'));logger[_0x433a('0x26')](_0x433a('0x27'),_0x1972cc,_0x433a('0x25'),JSON[_0x433a('0x28')](_0x24c0b7));if(_0x24c0b7[_0x433a('0x29')]){if(_0x24c0b7[_0x433a('0x29')][_0x433a('0x2a')]===0x1f4){logger[_0x433a('0x29')](_0x433a('0x2b'),_0x1972cc,_0x24c0b7[_0x433a('0x29')]['message']);return _0x29252a(_0x24c0b7['error']['message']);}logger[_0x433a('0x29')](_0x433a('0x2b'),_0x1972cc,_0x24c0b7[_0x433a('0x29')][_0x433a('0x2c')]);return _0x13cca2(_0x24c0b7[_0x433a('0x29')][_0x433a('0x2c')]);}else{logger[_0x433a('0x24')](_0x433a('0x2b'),_0x1972cc,_0x433a('0x25'));_0x13cca2(_0x24c0b7[_0x433a('0x2d')][_0x433a('0x2c')]);}})['catch'](function(_0x2d4214){logger[_0x433a('0x29')](_0x433a('0x2b'),_0x1972cc,_0x2d4214);_0x29252a(_0x2d4214);});});}function respondWithStatusCode(_0x5be242,_0x53e17a){_0x53e17a=_0x53e17a||0xcc;return function(_0x10dc7e){if(_0x10dc7e){return _0x5be242[_0x433a('0x2e')](_0x53e17a);}return _0x5be242[_0x433a('0x2f')](_0x53e17a)[_0x433a('0x30')]();};}function respondWithResult(_0x110127,_0x28d810){_0x28d810=_0x28d810||0xc8;return function(_0x1ff8d9){if(_0x1ff8d9){return _0x110127[_0x433a('0x2f')](_0x28d810)[_0x433a('0x31')](_0x1ff8d9);}};}function respondWithFilteredResult(_0x548781,_0x4f6cbb){return function(_0x51bf4b){if(_0x51bf4b){var _0x1e810f=_0x51bf4b['count'],_0x2f8bed=_0x4f6cbb[_0x433a('0x32')],_0x1190b2=_0x4f6cbb[_0x433a('0x32')]+_0x4f6cbb['limit'],_0x430412;if(_0x1190b2>=_0x1e810f){_0x1190b2=_0x1e810f;_0x430412=0xc8;}else{_0x430412=0xce;}_0x548781[_0x433a('0x2f')](_0x430412);return _0x548781[_0x433a('0x33')](_0x433a('0x34'),_0x2f8bed+'-'+_0x1190b2+'/'+_0x1e810f)['json'](_0x51bf4b);}return null;};}function patchUpdates(_0x4d28bb){return function(_0x233e3e){try{jsonpatch[_0x433a('0x35')](_0x233e3e,_0x4d28bb,!![]);}catch(_0x5f5376){return BPromise[_0x433a('0x36')](_0x5f5376);}return _0x233e3e[_0x433a('0x37')]();};}function saveUpdates(_0x40622c,_0x3a3c61){return function(_0x3b8b64){if(_0x3b8b64){return _0x3b8b64[_0x433a('0x38')](_0x40622c)[_0x433a('0x23')](function(_0x3265c1){return _0x3265c1;});}return null;};}function removeEntity(_0x1ce12a,_0x2182f1){return function(_0x465871){if(_0x465871){return _0x465871[_0x433a('0x39')]()[_0x433a('0x23')](function(){_0x1ce12a[_0x433a('0x2f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1715b6,_0x4a7dd9){return function(_0x14f6fa){if(!_0x14f6fa){_0x1715b6['sendStatus'](0x194);}return _0x14f6fa;};}function handleError(_0x7984b5,_0x249dd4){_0x249dd4=_0x249dd4||0x1f4;return function(_0x32e09b){logger[_0x433a('0x29')](_0x32e09b['stack']);if(_0x32e09b[_0x433a('0x3a')]){delete _0x32e09b[_0x433a('0x3a')];}_0x7984b5[_0x433a('0x2f')](_0x249dd4)[_0x433a('0x3b')](_0x32e09b);};}exports[_0x433a('0x3c')]=function(_0xadde21,_0x5e7b6d){var _0x5a3334={},_0xd82f11={},_0x24419a={'count':0x0,'rows':[]};var _0x41f7d7=_[_0x433a('0x3d')](db[_0x433a('0x3e')][_0x433a('0x3f')],function(_0xac186a){return{'name':_0xac186a['fieldName'],'type':_0xac186a['type'][_0x433a('0x40')]};});_0xd82f11[_0x433a('0x41')]=_[_0x433a('0x3d')](_0x41f7d7,_0x433a('0x3a'));_0xd82f11[_0x433a('0x42')]=_[_0x433a('0x43')](_0xadde21[_0x433a('0x42')]);_0xd82f11[_0x433a('0x44')]=_[_0x433a('0x45')](_0xd82f11[_0x433a('0x41')],_0xd82f11[_0x433a('0x42')]);_0x5a3334[_0x433a('0x46')]=_[_0x433a('0x45')](_0xd82f11[_0x433a('0x41')],qs['fields'](_0xadde21[_0x433a('0x42')][_0x433a('0x47')]));_0x5a3334['attributes']=_0x5a3334[_0x433a('0x46')][_0x433a('0x48')]?_0x5a3334[_0x433a('0x46')]:_0xd82f11[_0x433a('0x41')];if(!_0xadde21[_0x433a('0x42')][_0x433a('0x49')]('nolimit')){_0x5a3334[_0x433a('0x4a')]=qs[_0x433a('0x4a')](_0xadde21[_0x433a('0x42')][_0x433a('0x4a')]);_0x5a3334[_0x433a('0x32')]=qs['offset'](_0xadde21[_0x433a('0x42')]['offset']);}_0x5a3334[_0x433a('0x4b')]=qs[_0x433a('0x4c')](_0xadde21[_0x433a('0x42')]['sort']);_0x5a3334['where']=qs['filters'](_['pick'](_0xadde21[_0x433a('0x42')],_0xd82f11[_0x433a('0x44')]));if(_0xadde21[_0x433a('0x42')][_0x433a('0x4d')]){_0x5a3334[_0x433a('0x4e')]=_['merge'](_0x5a3334['where'],{'$or':_[_0x433a('0x3d')](_0x41f7d7,function(_0x51648c){if(_0x51648c[_0x433a('0x4f')]!==_0x433a('0x50')){var _0x383a8d={};_0x383a8d[_0x51648c[_0x433a('0x3a')]]={'$like':'%'+_0xadde21['query']['filter']+'%'};return _0x383a8d;}})});}_0x5a3334=_[_0x433a('0x51')]({},_0x5a3334,_0xadde21[_0x433a('0x52')]);var _0x33c048={'where':_0x5a3334[_0x433a('0x4e')]};return db[_0x433a('0x3e')][_0x433a('0x53')](_0x33c048)['then'](function(_0x125d02){_0x24419a[_0x433a('0x53')]=_0x125d02;if(_0xadde21[_0x433a('0x42')]['includeAll']){_0x5a3334[_0x433a('0x54')]=[{'all':!![]}];}return db[_0x433a('0x3e')][_0x433a('0x55')](_0x5a3334);})['then'](function(_0x27a413){_0x24419a[_0x433a('0x56')]=_0x27a413;return _0x24419a;})[_0x433a('0x23')](respondWithFilteredResult(_0x5e7b6d,_0x5a3334))[_0x433a('0x57')](handleError(_0x5e7b6d,null));};exports['show']=function(_0x6eb8a,_0x37ad6c){var _0x5d5b50={'raw':![],'where':{'id':_0x6eb8a[_0x433a('0x58')]['id']}},_0x5292d0={};_0x5292d0[_0x433a('0x41')]=_[_0x433a('0x43')](db['VtigerConfiguration'][_0x433a('0x3f')]);_0x5292d0['query']=_[_0x433a('0x43')](_0x6eb8a[_0x433a('0x42')]);_0x5292d0['filters']=_[_0x433a('0x45')](_0x5292d0[_0x433a('0x41')],_0x5292d0[_0x433a('0x42')]);_0x5d5b50[_0x433a('0x46')]=_[_0x433a('0x45')](_0x5292d0[_0x433a('0x41')],qs[_0x433a('0x47')](_0x6eb8a[_0x433a('0x42')]['fields']));_0x5d5b50[_0x433a('0x46')]=_0x5d5b50[_0x433a('0x46')][_0x433a('0x48')]?_0x5d5b50[_0x433a('0x46')]:_0x5292d0['model'];if(_0x6eb8a['query'][_0x433a('0x59')]){_0x5d5b50[_0x433a('0x54')]=[{'all':!![]}];}_0x5d5b50=_['merge']({},_0x5d5b50,_0x6eb8a[_0x433a('0x52')]);return db['VtigerConfiguration'][_0x433a('0x5a')](_0x5d5b50)[_0x433a('0x23')](handleEntityNotFound(_0x37ad6c,null))[_0x433a('0x23')](respondWithResult(_0x37ad6c,null))['catch'](handleError(_0x37ad6c,null));};exports[_0x433a('0x5b')]=function(_0x4cd35f,_0x2694a2){return db[_0x433a('0x3e')][_0x433a('0x5b')](_0x4cd35f[_0x433a('0x5c')],{})['then'](respondWithResult(_0x2694a2,0xc9))['catch'](handleError(_0x2694a2,null));};exports['update']=function(_0xcc62fe,_0x496a84){if(_0xcc62fe[_0x433a('0x5c')]['id']){delete _0xcc62fe['body']['id'];}return db[_0x433a('0x3e')][_0x433a('0x5a')]({'where':{'id':_0xcc62fe[_0x433a('0x58')]['id']}})[_0x433a('0x23')](handleEntityNotFound(_0x496a84,null))[_0x433a('0x23')](saveUpdates(_0xcc62fe[_0x433a('0x5c')],null))[_0x433a('0x23')](respondWithResult(_0x496a84,null))['catch'](handleError(_0x496a84,null));};exports[_0x433a('0x39')]=function(_0x217c11,_0x9cc196){return db['VtigerConfiguration'][_0x433a('0x5a')]({'where':{'id':_0x217c11[_0x433a('0x58')]['id']}})[_0x433a('0x23')](handleEntityNotFound(_0x9cc196,null))[_0x433a('0x23')](removeEntity(_0x9cc196,null))[_0x433a('0x57')](handleError(_0x9cc196,null));};exports[_0x433a('0x5d')]=function(_0x59c9e0,_0x56fbf4,_0x5bab33){var _0x3a9569={};var _0x1087c2={};var _0x14b0b4;var _0x451fa9;return db[_0x433a('0x3e')][_0x433a('0x5e')]({'where':{'id':_0x59c9e0[_0x433a('0x58')]['id']}})[_0x433a('0x23')](handleEntityNotFound(_0x56fbf4,null))[_0x433a('0x23')](function(_0x575975){if(_0x575975){_0x14b0b4=_0x575975;_0x1087c2[_0x433a('0x41')]=_[_0x433a('0x43')](db['VtigerField'][_0x433a('0x3f')]);_0x1087c2[_0x433a('0x42')]=_[_0x433a('0x43')](_0x59c9e0[_0x433a('0x42')]);_0x1087c2[_0x433a('0x44')]=_[_0x433a('0x45')](_0x1087c2['model'],_0x1087c2['query']);_0x3a9569['attributes']=_[_0x433a('0x45')](_0x1087c2[_0x433a('0x41')],qs['fields'](_0x59c9e0[_0x433a('0x42')][_0x433a('0x47')]));_0x3a9569[_0x433a('0x46')]=_0x3a9569['attributes'][_0x433a('0x48')]?_0x3a9569['attributes']:_0x1087c2[_0x433a('0x41')];_0x3a9569[_0x433a('0x4b')]=qs[_0x433a('0x4c')](_0x59c9e0[_0x433a('0x42')][_0x433a('0x4c')]);_0x3a9569[_0x433a('0x4e')]=qs['filters'](_[_0x433a('0x5f')](_0x59c9e0['query'],_0x1087c2[_0x433a('0x44')]));if(_0x59c9e0['query'][_0x433a('0x4d')]){_0x3a9569[_0x433a('0x4e')]=_['merge'](_0x3a9569[_0x433a('0x4e')],{'$or':_[_0x433a('0x3d')](_0x3a9569[_0x433a('0x46')],function(_0x5ade27){var _0x2efbee={};_0x2efbee[_0x5ade27]={'$like':'%'+_0x59c9e0[_0x433a('0x42')]['filter']+'%'};return _0x2efbee;})});}_0x3a9569=_['merge']({},_0x3a9569,_0x59c9e0[_0x433a('0x52')]);return _0x14b0b4[_0x433a('0x5d')](_0x3a9569);}})['then'](function(_0x37486f){if(_0x37486f){_0x451fa9=_0x37486f['length'];if(!_0x59c9e0[_0x433a('0x42')][_0x433a('0x49')](_0x433a('0x60'))){_0x3a9569[_0x433a('0x4a')]=qs['limit'](_0x59c9e0[_0x433a('0x42')][_0x433a('0x4a')]);_0x3a9569[_0x433a('0x32')]=qs[_0x433a('0x32')](_0x59c9e0[_0x433a('0x42')][_0x433a('0x32')]);}return _0x14b0b4[_0x433a('0x5d')](_0x3a9569);}})['then'](function(_0x1e7ced){if(_0x1e7ced){return _0x1e7ced?{'count':_0x451fa9,'rows':_0x1e7ced}:null;}})['then'](respondWithResult(_0x56fbf4,null))['catch'](handleError(_0x56fbf4,null));};exports[_0x433a('0x61')]=function(_0x11a77d,_0x25e03f,_0x3e4485){var _0x585973={};var _0x52a443={};var _0x131184;var _0xd51f5;return db[_0x433a('0x3e')]['findOne']({'where':{'id':_0x11a77d[_0x433a('0x58')]['id']}})[_0x433a('0x23')](handleEntityNotFound(_0x25e03f,null))[_0x433a('0x23')](function(_0x4cd687){if(_0x4cd687){_0x131184=_0x4cd687;_0x52a443[_0x433a('0x41')]=_['keys'](db['VtigerField'][_0x433a('0x3f')]);_0x52a443['query']=_[_0x433a('0x43')](_0x11a77d[_0x433a('0x42')]);_0x52a443[_0x433a('0x44')]=_['intersection'](_0x52a443[_0x433a('0x41')],_0x52a443[_0x433a('0x42')]);_0x585973[_0x433a('0x46')]=_['intersection'](_0x52a443[_0x433a('0x41')],qs['fields'](_0x11a77d[_0x433a('0x42')][_0x433a('0x47')]));_0x585973[_0x433a('0x46')]=_0x585973[_0x433a('0x46')]['length']?_0x585973[_0x433a('0x46')]:_0x52a443[_0x433a('0x41')];_0x585973[_0x433a('0x4b')]=qs['sort'](_0x11a77d[_0x433a('0x42')][_0x433a('0x4c')]);_0x585973[_0x433a('0x4e')]=qs[_0x433a('0x44')](_[_0x433a('0x5f')](_0x11a77d[_0x433a('0x42')],_0x52a443[_0x433a('0x44')]));if(_0x11a77d[_0x433a('0x42')][_0x433a('0x4d')]){_0x585973['where']=_[_0x433a('0x51')](_0x585973[_0x433a('0x4e')],{'$or':_[_0x433a('0x3d')](_0x585973[_0x433a('0x46')],function(_0xe5bbe8){var _0x334c86={};_0x334c86[_0xe5bbe8]={'$like':'%'+_0x11a77d[_0x433a('0x42')][_0x433a('0x4d')]+'%'};return _0x334c86;})});}_0x585973=_[_0x433a('0x51')]({},_0x585973,_0x11a77d[_0x433a('0x52')]);return _0x131184[_0x433a('0x61')](_0x585973);}})[_0x433a('0x23')](function(_0x465286){if(_0x465286){_0xd51f5=_0x465286[_0x433a('0x48')];if(!_0x11a77d['query'][_0x433a('0x49')](_0x433a('0x60'))){_0x585973[_0x433a('0x4a')]=qs[_0x433a('0x4a')](_0x11a77d[_0x433a('0x42')][_0x433a('0x4a')]);_0x585973[_0x433a('0x32')]=qs[_0x433a('0x32')](_0x11a77d['query']['offset']);}return _0x131184[_0x433a('0x61')](_0x585973);}})[_0x433a('0x23')](function(_0x4f0efa){if(_0x4f0efa){return _0x4f0efa?{'count':_0xd51f5,'rows':_0x4f0efa}:null;}})['then'](respondWithResult(_0x25e03f,null))['catch'](handleError(_0x25e03f,null));};exports[_0x433a('0x62')]=function(_0x3c0e8d,_0x54aeab,_0x19c20d){var _0x380b16={};var _0x57db9a={};var _0x3732c3;var _0x423c0f;return db[_0x433a('0x3e')][_0x433a('0x5e')]({'where':{'id':_0x3c0e8d[_0x433a('0x58')]['id']}})[_0x433a('0x23')](handleEntityNotFound(_0x54aeab,null))[_0x433a('0x23')](function(_0x2cde23){if(_0x2cde23){_0x3732c3=_0x2cde23;_0x57db9a[_0x433a('0x41')]=_['keys'](db[_0x433a('0x63')][_0x433a('0x3f')]);_0x57db9a[_0x433a('0x42')]=_['keys'](_0x3c0e8d[_0x433a('0x42')]);_0x57db9a[_0x433a('0x44')]=_[_0x433a('0x45')](_0x57db9a[_0x433a('0x41')],_0x57db9a[_0x433a('0x42')]);_0x380b16[_0x433a('0x46')]=_[_0x433a('0x45')](_0x57db9a[_0x433a('0x41')],qs[_0x433a('0x47')](_0x3c0e8d[_0x433a('0x42')][_0x433a('0x47')]));_0x380b16[_0x433a('0x46')]=_0x380b16[_0x433a('0x46')][_0x433a('0x48')]?_0x380b16[_0x433a('0x46')]:_0x57db9a[_0x433a('0x41')];_0x380b16[_0x433a('0x4b')]=qs[_0x433a('0x4c')](_0x3c0e8d[_0x433a('0x42')][_0x433a('0x4c')]);_0x380b16[_0x433a('0x4e')]=qs[_0x433a('0x44')](_[_0x433a('0x5f')](_0x3c0e8d['query'],_0x57db9a[_0x433a('0x44')]));if(_0x3c0e8d[_0x433a('0x42')][_0x433a('0x4d')]){_0x380b16['where']=_[_0x433a('0x51')](_0x380b16[_0x433a('0x4e')],{'$or':_[_0x433a('0x3d')](_0x380b16['attributes'],function(_0x4ec6e4){var _0x127a09={};_0x127a09[_0x4ec6e4]={'$like':'%'+_0x3c0e8d[_0x433a('0x42')][_0x433a('0x4d')]+'%'};return _0x127a09;})});}_0x380b16=_[_0x433a('0x51')]({},_0x380b16,_0x3c0e8d[_0x433a('0x52')]);return _0x3732c3[_0x433a('0x62')](_0x380b16);}})[_0x433a('0x23')](function(_0x418dc5){if(_0x418dc5){_0x423c0f=_0x418dc5['length'];if(!_0x3c0e8d['query'][_0x433a('0x49')](_0x433a('0x60'))){_0x380b16[_0x433a('0x4a')]=qs[_0x433a('0x4a')](_0x3c0e8d['query']['limit']);_0x380b16[_0x433a('0x32')]=qs[_0x433a('0x32')](_0x3c0e8d[_0x433a('0x42')]['offset']);}return _0x3732c3[_0x433a('0x62')](_0x380b16);}})[_0x433a('0x23')](function(_0x52afe7){if(_0x52afe7){return _0x52afe7?{'count':_0x423c0f,'rows':_0x52afe7}:null;}})['then'](respondWithResult(_0x54aeab,null))['catch'](handleError(_0x54aeab,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 4dd2423..a4ae6ad 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 _0x548f=['VtigerConfiguration','int_vtiger_configurations','util','../../config/logger','api','moment','request-promise','../../config/environment','exports','define'];(function(_0x224022,_0x638fe1){var _0x4359a6=function(_0x493033){while(--_0x493033){_0x224022['push'](_0x224022['shift']());}};_0x4359a6(++_0x638fe1);}(_0x548f,0x11a));var _0xf548=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x548f[_0x2070da];return _0x4f9fe1;};'use strict';var _=require('lodash');var util=require(_0xf548('0x0'));var logger=require(_0xf548('0x1'))(_0xf548('0x2'));var moment=require(_0xf548('0x3'));var BPromise=require('bluebird');var rp=require(_0xf548('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf548('0x5'));var attributes=require('./intVtigerConfiguration.attributes');module[_0xf548('0x6')]=function(_0x187a11,_0x4cd8c9){return _0x187a11[_0xf548('0x7')](_0xf548('0x8'),attributes,{'tableName':_0xf548('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1439=['rimraf','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','int_vtiger_configurations','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x45f951,_0x2750c8){var _0x24756c=function(_0x31c931){while(--_0x31c931){_0x45f951['push'](_0x45f951['shift']());}};_0x24756c(++_0x2750c8);}(_0x1439,0x88));var _0x9143=function(_0x20ab0e,_0x50b74e){_0x20ab0e=_0x20ab0e-0x0;var _0x3035b2=_0x1439[_0x20ab0e];return _0x3035b2;};'use strict';var _=require(_0x9143('0x0'));var util=require(_0x9143('0x1'));var logger=require(_0x9143('0x2'))(_0x9143('0x3'));var moment=require(_0x9143('0x4'));var BPromise=require(_0x9143('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9143('0x6'));var rimraf=require(_0x9143('0x7'));var config=require('../../config/environment');var attributes=require(_0x9143('0x8'));module[_0x9143('0x9')]=function(_0x170e8f,_0x15e7c8){return _0x170e8f[_0x9143('0xa')](_0x9143('0xb'),attributes,{'tableName':_0x9143('0xc'),'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 40cd622..b786fea 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 _0x687a=['result','catch','util','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','request\x20sent','stringify','error','code','VtigerConfiguration,\x20%s,\x20%s','message','info'];(function(_0x4081e3,_0x5edd4e){var _0x410872=function(_0x4c5a22){while(--_0x4c5a22){_0x4081e3['push'](_0x4081e3['shift']());}};_0x410872(++_0x5edd4e);}(_0x687a,0x1ca));var _0xa687=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x687a[_0x4b369d];return _0x571a98;};'use strict';var _=require('lodash');var util=require(_0xa687('0x0'));var moment=require(_0xa687('0x1'));var BPromise=require('bluebird');var rs=require(_0xa687('0x2'));var fs=require('fs');var Redis=require(_0xa687('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa687('0x4'))(_0xa687('0x5'));var config=require(_0xa687('0x6'));var jayson=require(_0xa687('0x7'));var client=jayson[_0xa687('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x29ed84,_0x5d70d3,_0x56d18f){return new BPromise(function(_0x37d2bb,_0x5644d5){return client[_0xa687('0x9')](_0x29ed84,_0x56d18f)['then'](function(_0x2806b7){logger['info']('VtigerConfiguration,\x20%s,\x20%s',_0x5d70d3,_0xa687('0xa'));logger['debug']('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x5d70d3,'request\x20sent',JSON[_0xa687('0xb')](_0x2806b7));if(_0x2806b7[_0xa687('0xc')]){if(_0x2806b7[_0xa687('0xc')][_0xa687('0xd')]===0x1f4){logger[_0xa687('0xc')](_0xa687('0xe'),_0x5d70d3,_0x2806b7['error'][_0xa687('0xf')]);return _0x5644d5(_0x2806b7[_0xa687('0xc')][_0xa687('0xf')]);}logger[_0xa687('0xc')](_0xa687('0xe'),_0x5d70d3,_0x2806b7[_0xa687('0xc')][_0xa687('0xf')]);return _0x37d2bb(_0x2806b7[_0xa687('0xc')][_0xa687('0xf')]);}else{logger[_0xa687('0x10')](_0xa687('0xe'),_0x5d70d3,_0xa687('0xa'));_0x37d2bb(_0x2806b7[_0xa687('0x11')][_0xa687('0xf')]);}})[_0xa687('0x12')](function(_0x1ce859){logger['error'](_0xa687('0xe'),_0x5d70d3,_0x1ce859);_0x5644d5(_0x1ce859);});});} \ No newline at end of file +var _0xbd83=['catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','stringify','error','code','VtigerConfiguration,\x20%s,\x20%s','message','result'];(function(_0x5d3ee5,_0x2a2f77){var _0x5c9dbf=function(_0x26b931){while(--_0x26b931){_0x5d3ee5['push'](_0x5d3ee5['shift']());}};_0x5c9dbf(++_0x2a2f77);}(_0xbd83,0x151));var _0x3bd8=function(_0x53c4f8,_0x44ccaf){_0x53c4f8=_0x53c4f8-0x0;var _0x416458=_0xbd83[_0x53c4f8];return _0x416458;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3bd8('0x0'));var BPromise=require(_0x3bd8('0x1'));var rs=require(_0x3bd8('0x2'));var fs=require('fs');var Redis=require(_0x3bd8('0x3'));var db=require(_0x3bd8('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3bd8('0x5'))(_0x3bd8('0x6'));var config=require(_0x3bd8('0x7'));var jayson=require(_0x3bd8('0x8'));var client=jayson[_0x3bd8('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cd88,_0x28c579,_0x23065d){return new BPromise(function(_0x4a933b,_0x19746d){return client[_0x3bd8('0xa')](_0x1cd88,_0x23065d)[_0x3bd8('0xb')](function(_0x3979bd){logger['info']('VtigerConfiguration,\x20%s,\x20%s',_0x28c579,_0x3bd8('0xc'));logger[_0x3bd8('0xd')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x28c579,_0x3bd8('0xc'),JSON[_0x3bd8('0xe')](_0x3979bd));if(_0x3979bd[_0x3bd8('0xf')]){if(_0x3979bd[_0x3bd8('0xf')][_0x3bd8('0x10')]===0x1f4){logger[_0x3bd8('0xf')]('VtigerConfiguration,\x20%s,\x20%s',_0x28c579,_0x3979bd[_0x3bd8('0xf')]['message']);return _0x19746d(_0x3979bd['error']['message']);}logger['error'](_0x3bd8('0x11'),_0x28c579,_0x3979bd[_0x3bd8('0xf')][_0x3bd8('0x12')]);return _0x4a933b(_0x3979bd[_0x3bd8('0xf')]['message']);}else{logger['info'](_0x3bd8('0x11'),_0x28c579,_0x3bd8('0xc'));_0x4a933b(_0x3979bd[_0x3bd8('0x13')][_0x3bd8('0x12')]);}})[_0x3bd8('0x14')](function(_0x29e272){logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x28c579,_0x29e272);_0x19746d(_0x29e272);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 2ffda4c..53011e8 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 _0x1915=['get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','./intVtigerField.controller'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x1915,0x150));var _0x5191=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x1915[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x5191('0x0'));var util=require(_0x5191('0x1'));var path=require(_0x5191('0x2'));var timeout=require(_0x5191('0x3'));var express=require(_0x5191('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x5191('0x5'));router[_0x5191('0x6')]('/',auth[_0x5191('0x7')](),controller[_0x5191('0x8')]);router['get'](_0x5191('0x9'),auth['isAuthenticated'](),controller[_0x5191('0xa')]);router[_0x5191('0xb')]('/',auth[_0x5191('0x7')](),controller[_0x5191('0xc')]);router[_0x5191('0xd')](_0x5191('0x9'),auth[_0x5191('0x7')](),controller[_0x5191('0xe')]);router[_0x5191('0xf')](_0x5191('0x9'),auth[_0x5191('0x7')](),controller[_0x5191('0x10')]);module[_0x5191('0x11')]=router; \ No newline at end of file +var _0xc6b3=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intVtigerField.controller','get','isAuthenticated','index','/:id','put','destroy','multer'];(function(_0x22b9fd,_0x153e1c){var _0xb61e57=function(_0x188a38){while(--_0x188a38){_0x22b9fd['push'](_0x22b9fd['shift']());}};_0xb61e57(++_0x153e1c);}(_0xc6b3,0x167));var _0x3c6b=function(_0x5a27e8,_0x492a2f){_0x5a27e8=_0x5a27e8-0x0;var _0x4e38f7=_0xc6b3[_0x5a27e8];return _0x4e38f7;};'use strict';var multer=require(_0x3c6b('0x0'));var util=require(_0x3c6b('0x1'));var path=require(_0x3c6b('0x2'));var timeout=require(_0x3c6b('0x3'));var express=require(_0x3c6b('0x4'));var router=express[_0x3c6b('0x5')]();var auth=require(_0x3c6b('0x6'));var interaction=require(_0x3c6b('0x7'));var config=require('../../config/environment');var controller=require(_0x3c6b('0x8'));router[_0x3c6b('0x9')]('/',auth[_0x3c6b('0xa')](),controller[_0x3c6b('0xb')]);router['get'](_0x3c6b('0xc'),auth[_0x3c6b('0xa')](),controller['show']);router['post']('/',auth[_0x3c6b('0xa')](),controller['create']);router[_0x3c6b('0xd')](_0x3c6b('0xc'),auth[_0x3c6b('0xa')](),controller['update']);router['delete']('/:id',auth[_0x3c6b('0xa')](),controller[_0x3c6b('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 67bf55e..0d744ef 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 _0x9b6d=['keyValue','STRING','exports','ENUM','string','variable','customVariable'];(function(_0x576dd3,_0x1bd733){var _0x41100d=function(_0x528d1a){while(--_0x528d1a){_0x576dd3['push'](_0x576dd3['shift']());}};_0x41100d(++_0x1bd733);}(_0x9b6d,0x105));var _0xd9b6=function(_0x5339e8,_0x36ef5e){_0x5339e8=_0x5339e8-0x0;var _0x59a010=_0x9b6d[_0x5339e8];return _0x59a010;};'use strict';var Sequelize=require('sequelize');module[_0xd9b6('0x0')]={'type':{'type':Sequelize[_0xd9b6('0x1')](_0xd9b6('0x2'),_0xd9b6('0x3'),_0xd9b6('0x4'),_0xd9b6('0x5')),'defaultValue':_0xd9b6('0x2')},'content':{'type':Sequelize[_0xd9b6('0x6')]},'key':{'type':Sequelize[_0xd9b6('0x6')]},'keyType':{'type':Sequelize[_0xd9b6('0x1')](_0xd9b6('0x2'),'variable',_0xd9b6('0x4'))},'keyContent':{'type':Sequelize[_0xd9b6('0x6')]},'idField':{'type':Sequelize[_0xd9b6('0x6')]},'nameField':{'type':Sequelize[_0xd9b6('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd9b6('0x6')]}}; \ No newline at end of file +var _0x7da7=['exports','ENUM','customVariable','keyValue','STRING','string','variable','BOOLEAN','sequelize'];(function(_0x5bb308,_0x3c2dfb){var _0x4fd92c=function(_0x4a15c5){while(--_0x4a15c5){_0x5bb308['push'](_0x5bb308['shift']());}};_0x4fd92c(++_0x3c2dfb);}(_0x7da7,0x10d));var _0x77da=function(_0x3efe87,_0x35ad48){_0x3efe87=_0x3efe87-0x0;var _0x56a4cc=_0x7da7[_0x3efe87];return _0x56a4cc;};'use strict';var Sequelize=require(_0x77da('0x0'));module[_0x77da('0x1')]={'type':{'type':Sequelize[_0x77da('0x2')]('string','variable',_0x77da('0x3'),_0x77da('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x77da('0x5')]},'key':{'type':Sequelize[_0x77da('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x77da('0x6'),_0x77da('0x7'),'customVariable')},'keyContent':{'type':Sequelize[_0x77da('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x77da('0x5')]},'customField':{'type':Sequelize[_0x77da('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x77da('0x5')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index c1c3e06..8013343 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 _0x683e=['filters','intersection','attributes','fields','model','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','findAll','show','params','length','include','find','catch','create','body','html-pdf','eml-format','rimraf','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','count','offset','limit','set','apply','reject','update','then','sendStatus','stack','name','index','map','VtigerField','rawAttributes','type','query','keys'];(function(_0x198d29,_0x1171a8){var _0x5dfeb8=function(_0x364e07){while(--_0x364e07){_0x198d29['push'](_0x198d29['shift']());}};_0x5dfeb8(++_0x1171a8);}(_0x683e,0xa6));var _0xe683=function(_0x2f7e15,_0x6e0949){_0x2f7e15=_0x2f7e15-0x0;var _0xbf1bf1=_0x683e[_0x2f7e15];return _0xbf1bf1;};'use strict';var pdf=require(_0xe683('0x0'));var emlformat=require(_0xe683('0x1'));var rimraf=require(_0xe683('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe683('0x3'));var BPromise=require(_0xe683('0x4'));var Mustache=require(_0xe683('0x5'));var util=require(_0xe683('0x6'));var path=require(_0xe683('0x7'));var sox=require(_0xe683('0x8'));var csv=require('to-csv');var ejs=require(_0xe683('0x9'));var fs=require('fs');var _=require(_0xe683('0xa'));var squel=require(_0xe683('0xb'));var crypto=require(_0xe683('0xc'));var jsforce=require(_0xe683('0xd'));var deskjs=require(_0xe683('0xe'));var toCsv=require(_0xe683('0xf'));var querystring=require(_0xe683('0x10'));var Papa=require(_0xe683('0x11'));var Redis=require(_0xe683('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xe683('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe683('0x14'));var logger=require(_0xe683('0x15'))(_0xe683('0x16'));var utils=require(_0xe683('0x17'));var config=require(_0xe683('0x18'));var db=require(_0xe683('0x19'))['db'];function respondWithStatusCode(_0x44752b,_0x5a652e){_0x5a652e=_0x5a652e||0xcc;return function(_0x5650d6){if(_0x5650d6){return _0x44752b['sendStatus'](_0x5a652e);}return _0x44752b['status'](_0x5a652e)[_0xe683('0x1a')]();};}function respondWithResult(_0x314715,_0x27b404){_0x27b404=_0x27b404||0xc8;return function(_0x2cfe04){if(_0x2cfe04){return _0x314715[_0xe683('0x1b')](_0x27b404)[_0xe683('0x1c')](_0x2cfe04);}};}function respondWithFilteredResult(_0x279c4f,_0x486327){return function(_0x48ea44){if(_0x48ea44){var _0x50527c=_0x48ea44[_0xe683('0x1d')],_0x1f874a=_0x486327[_0xe683('0x1e')],_0xbc0223=_0x486327[_0xe683('0x1e')]+_0x486327[_0xe683('0x1f')],_0x3cd74d;if(_0xbc0223>=_0x50527c){_0xbc0223=_0x50527c;_0x3cd74d=0xc8;}else{_0x3cd74d=0xce;}_0x279c4f[_0xe683('0x1b')](_0x3cd74d);return _0x279c4f[_0xe683('0x20')]('Content-Range',_0x1f874a+'-'+_0xbc0223+'/'+_0x50527c)[_0xe683('0x1c')](_0x48ea44);}return null;};}function patchUpdates(_0x4c0b76){return function(_0x4d7299){try{jsonpatch[_0xe683('0x21')](_0x4d7299,_0x4c0b76,!![]);}catch(_0x566ee3){return BPromise[_0xe683('0x22')](_0x566ee3);}return _0x4d7299['save']();};}function saveUpdates(_0xdc7a48,_0x3935e0){return function(_0x52975){if(_0x52975){return _0x52975[_0xe683('0x23')](_0xdc7a48)[_0xe683('0x24')](function(_0x38f3e0){return _0x38f3e0;});}return null;};}function removeEntity(_0x358455,_0x2073cf){return function(_0x71e16d){if(_0x71e16d){return _0x71e16d['destroy']()['then'](function(){_0x358455['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x180674,_0x12ed5a){return function(_0x40c080){if(!_0x40c080){_0x180674[_0xe683('0x25')](0x194);}return _0x40c080;};}function handleError(_0x5509b9,_0x6c268e){_0x6c268e=_0x6c268e||0x1f4;return function(_0x303f7d){logger['error'](_0x303f7d[_0xe683('0x26')]);if(_0x303f7d[_0xe683('0x27')]){delete _0x303f7d[_0xe683('0x27')];}_0x5509b9['status'](_0x6c268e)['send'](_0x303f7d);};}exports[_0xe683('0x28')]=function(_0x52f025,_0x301e60){var _0x344401={},_0x41eebe={},_0x58c218={'count':0x0,'rows':[]};var _0x57ef7f=_[_0xe683('0x29')](db[_0xe683('0x2a')][_0xe683('0x2b')],function(_0x1aeee4){return{'name':_0x1aeee4['fieldName'],'type':_0x1aeee4[_0xe683('0x2c')]['key']};});_0x41eebe['model']=_[_0xe683('0x29')](_0x57ef7f,_0xe683('0x27'));_0x41eebe[_0xe683('0x2d')]=_[_0xe683('0x2e')](_0x52f025[_0xe683('0x2d')]);_0x41eebe[_0xe683('0x2f')]=_[_0xe683('0x30')](_0x41eebe['model'],_0x41eebe[_0xe683('0x2d')]);_0x344401[_0xe683('0x31')]=_['intersection'](_0x41eebe['model'],qs[_0xe683('0x32')](_0x52f025[_0xe683('0x2d')][_0xe683('0x32')]));_0x344401['attributes']=_0x344401[_0xe683('0x31')]['length']?_0x344401[_0xe683('0x31')]:_0x41eebe[_0xe683('0x33')];if(!_0x52f025[_0xe683('0x2d')][_0xe683('0x34')](_0xe683('0x35'))){_0x344401['limit']=qs[_0xe683('0x1f')](_0x52f025[_0xe683('0x2d')][_0xe683('0x1f')]);_0x344401[_0xe683('0x1e')]=qs[_0xe683('0x1e')](_0x52f025[_0xe683('0x2d')][_0xe683('0x1e')]);}_0x344401[_0xe683('0x36')]=qs[_0xe683('0x37')](_0x52f025['query'][_0xe683('0x37')]);_0x344401[_0xe683('0x38')]=qs[_0xe683('0x2f')](_[_0xe683('0x39')](_0x52f025[_0xe683('0x2d')],_0x41eebe[_0xe683('0x2f')]));if(_0x52f025[_0xe683('0x2d')][_0xe683('0x3a')]){_0x344401['where']=_['merge'](_0x344401[_0xe683('0x38')],{'$or':_[_0xe683('0x29')](_0x57ef7f,function(_0x9214ab){if(_0x9214ab[_0xe683('0x2c')]!==_0xe683('0x3b')){var _0xcb0981={};_0xcb0981[_0x9214ab[_0xe683('0x27')]]={'$like':'%'+_0x52f025['query'][_0xe683('0x3a')]+'%'};return _0xcb0981;}})});}_0x344401=_[_0xe683('0x3c')]({},_0x344401,_0x52f025[_0xe683('0x3d')]);var _0x1794cf={'where':_0x344401['where']};return db[_0xe683('0x2a')][_0xe683('0x1d')](_0x1794cf)[_0xe683('0x24')](function(_0xc7cf5e){_0x58c218[_0xe683('0x1d')]=_0xc7cf5e;if(_0x52f025[_0xe683('0x2d')]['includeAll']){_0x344401['include']=[{'all':!![]}];}return db[_0xe683('0x2a')][_0xe683('0x3e')](_0x344401);})[_0xe683('0x24')](function(_0x12f67b){_0x58c218['rows']=_0x12f67b;return _0x58c218;})[_0xe683('0x24')](respondWithFilteredResult(_0x301e60,_0x344401))['catch'](handleError(_0x301e60,null));};exports[_0xe683('0x3f')]=function(_0x5b723c,_0x185e44){var _0x1bdeaf={'raw':!![],'where':{'id':_0x5b723c[_0xe683('0x40')]['id']}},_0x7a3608={};_0x7a3608[_0xe683('0x33')]=_['keys'](db[_0xe683('0x2a')]['rawAttributes']);_0x7a3608[_0xe683('0x2d')]=_[_0xe683('0x2e')](_0x5b723c[_0xe683('0x2d')]);_0x7a3608[_0xe683('0x2f')]=_[_0xe683('0x30')](_0x7a3608[_0xe683('0x33')],_0x7a3608['query']);_0x1bdeaf['attributes']=_['intersection'](_0x7a3608[_0xe683('0x33')],qs[_0xe683('0x32')](_0x5b723c[_0xe683('0x2d')]['fields']));_0x1bdeaf['attributes']=_0x1bdeaf[_0xe683('0x31')][_0xe683('0x41')]?_0x1bdeaf[_0xe683('0x31')]:_0x7a3608[_0xe683('0x33')];if(_0x5b723c['query']['includeAll']){_0x1bdeaf[_0xe683('0x42')]=[{'all':!![]}];}_0x1bdeaf=_[_0xe683('0x3c')]({},_0x1bdeaf,_0x5b723c[_0xe683('0x3d')]);return db[_0xe683('0x2a')][_0xe683('0x43')](_0x1bdeaf)[_0xe683('0x24')](handleEntityNotFound(_0x185e44,null))[_0xe683('0x24')](respondWithResult(_0x185e44,null))[_0xe683('0x44')](handleError(_0x185e44,null));};exports[_0xe683('0x45')]=function(_0x381116,_0x556e3c){return db[_0xe683('0x2a')][_0xe683('0x45')](_0x381116[_0xe683('0x46')],{})[_0xe683('0x24')](respondWithResult(_0x556e3c,0xc9))[_0xe683('0x44')](handleError(_0x556e3c,null));};exports[_0xe683('0x23')]=function(_0x3fec75,_0x1243b7){if(_0x3fec75[_0xe683('0x46')]['id']){delete _0x3fec75['body']['id'];}return db[_0xe683('0x2a')][_0xe683('0x43')]({'where':{'id':_0x3fec75[_0xe683('0x40')]['id']}})[_0xe683('0x24')](handleEntityNotFound(_0x1243b7,null))['then'](saveUpdates(_0x3fec75[_0xe683('0x46')],null))[_0xe683('0x24')](respondWithResult(_0x1243b7,null))[_0xe683('0x44')](handleError(_0x1243b7,null));};exports['destroy']=function(_0x1ae3f2,_0x286092){return db[_0xe683('0x2a')]['find']({'where':{'id':_0x1ae3f2[_0xe683('0x40')]['id']}})[_0xe683('0x24')](handleEntityNotFound(_0x286092,null))[_0xe683('0x24')](removeEntity(_0x286092,null))[_0xe683('0x44')](handleError(_0x286092,null));}; \ No newline at end of file +var _0xa238=['../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','then','error','stack','name','send','map','rawAttributes','fieldName','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','VtigerField','include','findAll','rows','catch','params','length','includeAll','find','create','body','update','destroy','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa238,0x106));var _0x8a23=function(_0x37069a,_0x18322b){_0x37069a=_0x37069a-0x0;var _0x454091=_0xa238[_0x37069a];return _0x454091;};'use strict';var pdf=require(_0x8a23('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x8a23('0x1'));var zipdir=require(_0x8a23('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8a23('0x3'));var moment=require(_0x8a23('0x4'));var BPromise=require(_0x8a23('0x5'));var Mustache=require(_0x8a23('0x6'));var util=require(_0x8a23('0x7'));var path=require(_0x8a23('0x8'));var sox=require(_0x8a23('0x9'));var csv=require('to-csv');var ejs=require(_0x8a23('0xa'));var fs=require('fs');var _=require(_0x8a23('0xb'));var squel=require(_0x8a23('0xc'));var crypto=require(_0x8a23('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x8a23('0xe'));var toCsv=require(_0x8a23('0xf'));var querystring=require(_0x8a23('0x10'));var Papa=require('papaparse');var Redis=require(_0x8a23('0x11'));var authService=require(_0x8a23('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8a23('0x13'));var logger=require('../../config/logger')(_0x8a23('0x14'));var utils=require('../../config/utils');var config=require(_0x8a23('0x15'));var db=require(_0x8a23('0x16'))['db'];function respondWithStatusCode(_0x1c53d2,_0x1acc5d){_0x1acc5d=_0x1acc5d||0xcc;return function(_0x557341){if(_0x557341){return _0x1c53d2[_0x8a23('0x17')](_0x1acc5d);}return _0x1c53d2[_0x8a23('0x18')](_0x1acc5d)[_0x8a23('0x19')]();};}function respondWithResult(_0x377319,_0x1bca9b){_0x1bca9b=_0x1bca9b||0xc8;return function(_0x394666){if(_0x394666){return _0x377319['status'](_0x1bca9b)[_0x8a23('0x1a')](_0x394666);}};}function respondWithFilteredResult(_0x4f79d7,_0x4b04ce){return function(_0x2b203b){if(_0x2b203b){var _0x503bf4=_0x2b203b[_0x8a23('0x1b')],_0x1f639a=_0x4b04ce[_0x8a23('0x1c')],_0x151a40=_0x4b04ce['offset']+_0x4b04ce[_0x8a23('0x1d')],_0xb31651;if(_0x151a40>=_0x503bf4){_0x151a40=_0x503bf4;_0xb31651=0xc8;}else{_0xb31651=0xce;}_0x4f79d7[_0x8a23('0x18')](_0xb31651);return _0x4f79d7[_0x8a23('0x1e')](_0x8a23('0x1f'),_0x1f639a+'-'+_0x151a40+'/'+_0x503bf4)[_0x8a23('0x1a')](_0x2b203b);}return null;};}function patchUpdates(_0x13224a){return function(_0x51aa5c){try{jsonpatch[_0x8a23('0x20')](_0x51aa5c,_0x13224a,!![]);}catch(_0x3493c2){return BPromise[_0x8a23('0x21')](_0x3493c2);}return _0x51aa5c['save']();};}function saveUpdates(_0x2f5822,_0x687c7a){return function(_0x17d21d){if(_0x17d21d){return _0x17d21d['update'](_0x2f5822)[_0x8a23('0x22')](function(_0x5e97e1){return _0x5e97e1;});}return null;};}function removeEntity(_0x2d06c6,_0x44c5d7){return function(_0x10c2e8){if(_0x10c2e8){return _0x10c2e8['destroy']()[_0x8a23('0x22')](function(){_0x2d06c6[_0x8a23('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f4e56,_0x1c38f0){return function(_0x395f08){if(!_0x395f08){_0x1f4e56['sendStatus'](0x194);}return _0x395f08;};}function handleError(_0x44bea0,_0x4a1699){_0x4a1699=_0x4a1699||0x1f4;return function(_0x13c30e){logger[_0x8a23('0x23')](_0x13c30e[_0x8a23('0x24')]);if(_0x13c30e[_0x8a23('0x25')]){delete _0x13c30e[_0x8a23('0x25')];}_0x44bea0[_0x8a23('0x18')](_0x4a1699)[_0x8a23('0x26')](_0x13c30e);};}exports['index']=function(_0x52c41e,_0x47953f){var _0x354c98={},_0x53178f={},_0x14a54a={'count':0x0,'rows':[]};var _0x5732fe=_[_0x8a23('0x27')](db['VtigerField'][_0x8a23('0x28')],function(_0x480147){return{'name':_0x480147[_0x8a23('0x29')],'type':_0x480147['type']['key']};});_0x53178f[_0x8a23('0x2a')]=_[_0x8a23('0x27')](_0x5732fe,'name');_0x53178f[_0x8a23('0x2b')]=_[_0x8a23('0x2c')](_0x52c41e[_0x8a23('0x2b')]);_0x53178f[_0x8a23('0x2d')]=_['intersection'](_0x53178f[_0x8a23('0x2a')],_0x53178f[_0x8a23('0x2b')]);_0x354c98['attributes']=_[_0x8a23('0x2e')](_0x53178f[_0x8a23('0x2a')],qs[_0x8a23('0x2f')](_0x52c41e['query'][_0x8a23('0x2f')]));_0x354c98[_0x8a23('0x30')]=_0x354c98[_0x8a23('0x30')]['length']?_0x354c98[_0x8a23('0x30')]:_0x53178f[_0x8a23('0x2a')];if(!_0x52c41e[_0x8a23('0x2b')][_0x8a23('0x31')](_0x8a23('0x32'))){_0x354c98[_0x8a23('0x1d')]=qs[_0x8a23('0x1d')](_0x52c41e['query'][_0x8a23('0x1d')]);_0x354c98[_0x8a23('0x1c')]=qs[_0x8a23('0x1c')](_0x52c41e[_0x8a23('0x2b')]['offset']);}_0x354c98['order']=qs['sort'](_0x52c41e['query'][_0x8a23('0x33')]);_0x354c98[_0x8a23('0x34')]=qs['filters'](_[_0x8a23('0x35')](_0x52c41e[_0x8a23('0x2b')],_0x53178f[_0x8a23('0x2d')]));if(_0x52c41e['query'][_0x8a23('0x36')]){_0x354c98[_0x8a23('0x34')]=_[_0x8a23('0x37')](_0x354c98[_0x8a23('0x34')],{'$or':_[_0x8a23('0x27')](_0x5732fe,function(_0x3fadca){if(_0x3fadca['type']!==_0x8a23('0x38')){var _0x2e43cd={};_0x2e43cd[_0x3fadca[_0x8a23('0x25')]]={'$like':'%'+_0x52c41e[_0x8a23('0x2b')][_0x8a23('0x36')]+'%'};return _0x2e43cd;}})});}_0x354c98=_['merge']({},_0x354c98,_0x52c41e[_0x8a23('0x39')]);var _0x57d2ba={'where':_0x354c98['where']};return db[_0x8a23('0x3a')][_0x8a23('0x1b')](_0x57d2ba)[_0x8a23('0x22')](function(_0xb88fd7){_0x14a54a[_0x8a23('0x1b')]=_0xb88fd7;if(_0x52c41e[_0x8a23('0x2b')]['includeAll']){_0x354c98[_0x8a23('0x3b')]=[{'all':!![]}];}return db['VtigerField'][_0x8a23('0x3c')](_0x354c98);})[_0x8a23('0x22')](function(_0x2745b4){_0x14a54a[_0x8a23('0x3d')]=_0x2745b4;return _0x14a54a;})['then'](respondWithFilteredResult(_0x47953f,_0x354c98))[_0x8a23('0x3e')](handleError(_0x47953f,null));};exports['show']=function(_0x15bedb,_0x1e3f3a){var _0x3d2973={'raw':!![],'where':{'id':_0x15bedb[_0x8a23('0x3f')]['id']}},_0x501a88={};_0x501a88['model']=_['keys'](db['VtigerField'][_0x8a23('0x28')]);_0x501a88[_0x8a23('0x2b')]=_['keys'](_0x15bedb['query']);_0x501a88[_0x8a23('0x2d')]=_[_0x8a23('0x2e')](_0x501a88[_0x8a23('0x2a')],_0x501a88['query']);_0x3d2973[_0x8a23('0x30')]=_[_0x8a23('0x2e')](_0x501a88[_0x8a23('0x2a')],qs[_0x8a23('0x2f')](_0x15bedb[_0x8a23('0x2b')][_0x8a23('0x2f')]));_0x3d2973[_0x8a23('0x30')]=_0x3d2973[_0x8a23('0x30')][_0x8a23('0x40')]?_0x3d2973[_0x8a23('0x30')]:_0x501a88['model'];if(_0x15bedb[_0x8a23('0x2b')][_0x8a23('0x41')]){_0x3d2973['include']=[{'all':!![]}];}_0x3d2973=_[_0x8a23('0x37')]({},_0x3d2973,_0x15bedb[_0x8a23('0x39')]);return db[_0x8a23('0x3a')][_0x8a23('0x42')](_0x3d2973)[_0x8a23('0x22')](handleEntityNotFound(_0x1e3f3a,null))[_0x8a23('0x22')](respondWithResult(_0x1e3f3a,null))[_0x8a23('0x3e')](handleError(_0x1e3f3a,null));};exports[_0x8a23('0x43')]=function(_0x14567b,_0x3b0383){return db[_0x8a23('0x3a')][_0x8a23('0x43')](_0x14567b[_0x8a23('0x44')],{})[_0x8a23('0x22')](respondWithResult(_0x3b0383,0xc9))['catch'](handleError(_0x3b0383,null));};exports[_0x8a23('0x45')]=function(_0x3accbe,_0x58422a){if(_0x3accbe['body']['id']){delete _0x3accbe['body']['id'];}return db['VtigerField'][_0x8a23('0x42')]({'where':{'id':_0x3accbe['params']['id']}})[_0x8a23('0x22')](handleEntityNotFound(_0x58422a,null))['then'](saveUpdates(_0x3accbe['body'],null))['then'](respondWithResult(_0x58422a,null))[_0x8a23('0x3e')](handleError(_0x58422a,null));};exports[_0x8a23('0x46')]=function(_0x7db6ec,_0x1548ef){return db[_0x8a23('0x3a')]['find']({'where':{'id':_0x7db6ec[_0x8a23('0x3f')]['id']}})[_0x8a23('0x22')](handleEntityNotFound(_0x1548ef,null))[_0x8a23('0x22')](removeEntity(_0x1548ef,null))['catch'](handleError(_0x1548ef,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index c606964..86d4499 100644 --- a/server/api/intVtigerField/intVtigerField.model.js +++ b/server/api/intVtigerField/intVtigerField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['int_vtiger_fields','idField','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intVtigerField.attributes','exports','VtigerField'];(function(_0xb410d6,_0x3ba02a){var _0xd50992=function(_0x28f0a9){while(--_0x28f0a9){_0xb410d6['push'](_0xb410d6['shift']());}};_0xd50992(++_0x3ba02a);}(_0x7a54,0x106));var _0x47a5=function(_0x57e9d5,_0x2c6a19){_0x57e9d5=_0x57e9d5-0x0;var _0x1d07fd=_0x7a54[_0x57e9d5];return _0x1d07fd;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':[_0x47a5('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['int_vtiger_fields','idField','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intVtigerField.attributes','exports','VtigerField'];(function(_0x4815ee,_0x3dbefe){var _0x2be683=function(_0x1dad19){while(--_0x1dad19){_0x4815ee['push'](_0x4815ee['shift']());}};_0x2be683(++_0x3dbefe);}(_0x7a54,0x106));var _0x47a5=function(_0x2c77cf,_0x219e96){_0x2c77cf=_0x2c77cf-0x0;var _0x4d6d9e=_0x7a54[_0x2c77cf];return _0x4d6d9e;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':[_0x47a5('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.rpc.js b/server/api/intVtigerField/intVtigerField.rpc.js index 7c30a64..936debf 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 _0xa478=['http','then','info','request\x20sent','debug','error','code','message','VtigerField,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1635fe,_0x5f1d9f){var _0x3c512a=function(_0x26b53d){while(--_0x26b53d){_0x1635fe['push'](_0x1635fe['shift']());}};_0x3c512a(++_0x5f1d9f);}(_0xa478,0x136));var _0x8a47=function(_0x4b4b0e,_0x6c674){_0x4b4b0e=_0x4b4b0e-0x0;var _0x4c2d91=_0xa478[_0x4b4b0e];return _0x4c2d91;};'use strict';var _=require(_0x8a47('0x0'));var util=require(_0x8a47('0x1'));var moment=require(_0x8a47('0x2'));var BPromise=require(_0x8a47('0x3'));var rs=require(_0x8a47('0x4'));var fs=require('fs');var Redis=require(_0x8a47('0x5'));var db=require(_0x8a47('0x6'))['db'];var utils=require(_0x8a47('0x7'));var logger=require(_0x8a47('0x8'))(_0x8a47('0x9'));var config=require(_0x8a47('0xa'));var jayson=require(_0x8a47('0xb'));var client=jayson['client'][_0x8a47('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2d62a6,_0x3de815,_0x3cb340){return new BPromise(function(_0x56884b,_0x384886){return client['request'](_0x2d62a6,_0x3cb340)[_0x8a47('0xd')](function(_0x369fc9){logger[_0x8a47('0xe')]('VtigerField,\x20%s,\x20%s',_0x3de815,_0x8a47('0xf'));logger[_0x8a47('0x10')]('VtigerField,\x20%s,\x20%s,\x20%s',_0x3de815,_0x8a47('0xf'),JSON['stringify'](_0x369fc9));if(_0x369fc9[_0x8a47('0x11')]){if(_0x369fc9[_0x8a47('0x11')][_0x8a47('0x12')]===0x1f4){logger['error']('VtigerField,\x20%s,\x20%s',_0x3de815,_0x369fc9['error'][_0x8a47('0x13')]);return _0x384886(_0x369fc9[_0x8a47('0x11')]['message']);}logger[_0x8a47('0x11')](_0x8a47('0x14'),_0x3de815,_0x369fc9[_0x8a47('0x11')][_0x8a47('0x13')]);return _0x56884b(_0x369fc9[_0x8a47('0x11')][_0x8a47('0x13')]);}else{logger[_0x8a47('0xe')](_0x8a47('0x14'),_0x3de815,_0x8a47('0xf'));_0x56884b(_0x369fc9[_0x8a47('0x15')][_0x8a47('0x13')]);}})[_0x8a47('0x16')](function(_0x2917d9){logger['error'](_0x8a47('0x14'),_0x3de815,_0x2917d9);_0x384886(_0x2917d9);});});} \ No newline at end of file +var _0xd547=['bluebird','randomstring','ioredis','../../config/logger','../../config/environment','client','http','request','VtigerField,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','info','result','catch','moment'];(function(_0x4f0c95,_0x322ba3){var _0x547afa=function(_0x5a9e3e){while(--_0x5a9e3e){_0x4f0c95['push'](_0x4f0c95['shift']());}};_0x547afa(++_0x322ba3);}(_0xd547,0x1c1));var _0x7d54=function(_0x5e2cb4,_0x592c64){_0x5e2cb4=_0x5e2cb4-0x0;var _0x282902=_0xd547[_0x5e2cb4];return _0x282902;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7d54('0x0'));var BPromise=require(_0x7d54('0x1'));var rs=require(_0x7d54('0x2'));var fs=require('fs');var Redis=require(_0x7d54('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7d54('0x4'))('rpc');var config=require(_0x7d54('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x7d54('0x6')][_0x7d54('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1b7fc1,_0x5186ae,_0x5b0b16){return new BPromise(function(_0x478f9b,_0xb224a9){return client[_0x7d54('0x8')](_0x1b7fc1,_0x5b0b16)['then'](function(_0xa5b980){logger['info'](_0x7d54('0x9'),_0x5186ae,'request\x20sent');logger[_0x7d54('0xa')]('VtigerField,\x20%s,\x20%s,\x20%s',_0x5186ae,_0x7d54('0xb'),JSON[_0x7d54('0xc')](_0xa5b980));if(_0xa5b980['error']){if(_0xa5b980['error']['code']===0x1f4){logger[_0x7d54('0xd')](_0x7d54('0x9'),_0x5186ae,_0xa5b980[_0x7d54('0xd')]['message']);return _0xb224a9(_0xa5b980[_0x7d54('0xd')]['message']);}logger[_0x7d54('0xd')]('VtigerField,\x20%s,\x20%s',_0x5186ae,_0xa5b980[_0x7d54('0xd')][_0x7d54('0xe')]);return _0x478f9b(_0xa5b980['error'][_0x7d54('0xe')]);}else{logger[_0x7d54('0xf')](_0x7d54('0x9'),_0x5186ae,'request\x20sent');_0x478f9b(_0xa5b980[_0x7d54('0x10')][_0x7d54('0xe')]);}})[_0x7d54('0x11')](function(_0x12c48d){logger[_0x7d54('0xd')](_0x7d54('0x9'),_0x5186ae,_0x12c48d);_0xb224a9(_0x12c48d);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 06544ec..1ab25f2 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 _0x97c0=['./intZendeskAccount.controller','get','index','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields','post','addConfiguration','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0x97c0,0x189));var _0x097c=function(_0xfc9617,_0xfa8998){_0xfc9617=_0xfc9617-0x0;var _0x596b4d=_0x97c0[_0xfc9617];return _0x596b4d;};'use strict';var multer=require(_0x097c('0x0'));var util=require(_0x097c('0x1'));var path=require(_0x097c('0x2'));var timeout=require(_0x097c('0x3'));var express=require(_0x097c('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x097c('0x5'));var config=require(_0x097c('0x6'));var controller=require(_0x097c('0x7'));router[_0x097c('0x8')]('/',auth['isAuthenticated'](),controller[_0x097c('0x9')]);router[_0x097c('0x8')]('/:id',auth[_0x097c('0xa')](),controller['show']);router['get'](_0x097c('0xb'),auth['isAuthenticated'](),controller[_0x097c('0xc')]);router[_0x097c('0x8')](_0x097c('0xd'),auth[_0x097c('0xa')](),controller['getFields']);router[_0x097c('0xe')]('/',auth[_0x097c('0xa')](),controller['create']);router[_0x097c('0xe')](_0x097c('0xb'),auth[_0x097c('0xa')](),controller[_0x097c('0xf')]);router['put'](_0x097c('0x10'),auth[_0x097c('0xa')](),controller['update']);router[_0x097c('0x11')](_0x097c('0x10'),auth['isAuthenticated'](),controller[_0x097c('0x12')]);module[_0x097c('0x13')]=router; \ No newline at end of file +var _0xcc94=['delete','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','update'];(function(_0xd0b220,_0x404207){var _0x2a029b=function(_0x328c3f){while(--_0x328c3f){_0xd0b220['push'](_0xd0b220['shift']());}};_0x2a029b(++_0x404207);}(_0xcc94,0x128));var _0x4cc9=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xcc94[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x4cc9('0x0'));var util=require(_0x4cc9('0x1'));var path=require(_0x4cc9('0x2'));var timeout=require(_0x4cc9('0x3'));var express=require('express');var router=express[_0x4cc9('0x4')]();var auth=require(_0x4cc9('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4cc9('0x6'));var controller=require(_0x4cc9('0x7'));router[_0x4cc9('0x8')]('/',auth[_0x4cc9('0x9')](),controller['index']);router[_0x4cc9('0x8')](_0x4cc9('0xa'),auth[_0x4cc9('0x9')](),controller[_0x4cc9('0xb')]);router['get'](_0x4cc9('0xc'),auth[_0x4cc9('0x9')](),controller[_0x4cc9('0xd')]);router[_0x4cc9('0x8')]('/:id/fields',auth[_0x4cc9('0x9')](),controller[_0x4cc9('0xe')]);router[_0x4cc9('0xf')]('/',auth[_0x4cc9('0x9')](),controller[_0x4cc9('0x10')]);router[_0x4cc9('0xf')](_0x4cc9('0xc'),auth[_0x4cc9('0x9')](),controller[_0x4cc9('0x11')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x4cc9('0x12')]);router[_0x4cc9('0x13')]('/:id',auth[_0x4cc9('0x9')](),controller[_0x4cc9('0x14')]);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 93a2236..0bc8066 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 _0x5420=['remoteUri','password','token','ENUM','integrationTab','newTab','sequelize','exports','STRING'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x5420,0x192));var _0x0542=function(_0x58e503,_0xe7312a){_0x58e503=_0x58e503-0x0;var _0x1183da=_0x5420[_0x58e503];return _0x1183da;};'use strict';var Sequelize=require(_0x0542('0x0'));module[_0x0542('0x1')]={'name':{'type':Sequelize[_0x0542('0x2')]},'description':{'type':Sequelize[_0x0542('0x2')]},'username':{'type':Sequelize[_0x0542('0x2')],'unique':'username'},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x0542('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x0542('0x3')},'authType':{'type':Sequelize['ENUM'](_0x0542('0x4'),_0x0542('0x5')),'defaultValue':_0x0542('0x4')},'serverUrl':{'type':Sequelize[_0x0542('0x2')]},'type':{'type':Sequelize[_0x0542('0x6')](_0x0542('0x7'),_0x0542('0x8')),'defaultValue':_0x0542('0x7')}}; \ No newline at end of file +var _0x09fb=['remoteUri','ENUM','password','token','newTab','integrationTab','STRING','username'];(function(_0x3fa018,_0x212100){var _0x3073c0=function(_0x5a02a4){while(--_0x5a02a4){_0x3fa018['push'](_0x3fa018['shift']());}};_0x3073c0(++_0x212100);}(_0x09fb,0xae));var _0xb09f=function(_0x117be5,_0x5bd5fe){_0x117be5=_0x117be5-0x0;var _0xa0a16=_0x09fb[_0x117be5];return _0xa0a16;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xb09f('0x0')]},'description':{'type':Sequelize[_0xb09f('0x0')]},'username':{'type':Sequelize[_0xb09f('0x0')],'unique':_0xb09f('0x1')},'password':{'type':Sequelize[_0xb09f('0x0')]},'token':{'type':Sequelize[_0xb09f('0x0')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xb09f('0x2')},'authType':{'type':Sequelize[_0xb09f('0x3')](_0xb09f('0x4'),_0xb09f('0x5')),'defaultValue':_0xb09f('0x4')},'serverUrl':{'type':Sequelize[_0xb09f('0x0')]},'type':{'type':Sequelize[_0xb09f('0x3')]('integrationTab',_0xb09f('0x6')),'defaultValue':_0xb09f('0x7')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 17b3a96..9382403 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 _0xe5a6=['attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','options','findAll','show','params','keys','fields','includeAll','find','create','body','getConfigurations','findOne','ZendeskConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','ZendeskField','Descriptions','getFields','password','token','authType','remoteUri','slice','lastIndexOf','format','%s/%s','ticket_fields','Basic\x20%s','%s:%s','username','toString','base64','%s/token:%s','Unknown\x20authentication\x20type','subject','description','group','remove','includes','position','title','system_field_options','custom_field_options','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','ZendeskAccount,\x20%s,\x20%s','message','catch','sendStatus','status','json','count','offset','set','Content-Range','apply','update','then','destroy','end','stack','name','send','index','ZendeskAccount','fieldName','key','model','map','query','filters','intersection'];(function(_0x47a491,_0x45e171){var _0x3b176b=function(_0x8c826){while(--_0x8c826){_0x47a491['push'](_0x47a491['shift']());}};_0x3b176b(++_0x45e171);}(_0xe5a6,0x1bb));var _0x6e5a=function(_0x522ae8,_0x3b637e){_0x522ae8=_0x522ae8-0x0;var _0x3189b9=_0xe5a6[_0x522ae8];return _0x3189b9;};'use strict';var pdf=require(_0x6e5a('0x0'));var emlformat=require(_0x6e5a('0x1'));var rimraf=require(_0x6e5a('0x2'));var zipdir=require(_0x6e5a('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6e5a('0x4'));var moment=require(_0x6e5a('0x5'));var BPromise=require(_0x6e5a('0x6'));var Mustache=require(_0x6e5a('0x7'));var util=require(_0x6e5a('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x6e5a('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x6e5a('0xa'));var crypto=require(_0x6e5a('0xb'));var jsforce=require(_0x6e5a('0xc'));var deskjs=require(_0x6e5a('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6e5a('0xe'));var Papa=require(_0x6e5a('0xf'));var Redis=require(_0x6e5a('0x10'));var authService=require(_0x6e5a('0x11'));var qs=require(_0x6e5a('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6e5a('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x6e5a('0x14'));var config=require(_0x6e5a('0x15'));var db=require(_0x6e5a('0x16'))['db'];var integrations=require(_0x6e5a('0x17'));var jayson=require('jayson/promise');var client=jayson[_0x6e5a('0x18')][_0x6e5a('0x19')]({'port':0x232a});function checkPasswordPattern(_0x392ca7,_0x376d63,_0x3c719d){if(_0x3c719d){var _0x395fd2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x395fd2[_0x6e5a('0x1a')](_0x376d63)){return _0x392ca7;}else{throw new db[(_0x6e5a('0x1b'))][(_0x6e5a('0x1c'))](_0x6e5a('0x1d'));}}else{return _0x392ca7;}}function respondWithRpcPromise(_0x3f09ec,_0x20be1e,_0x57ba63,_0x20d310){return new BPromise(function(_0x481f1d,_0x4d99e9){var _0x699b6e=_0x20d310||client;return _0x699b6e[_0x6e5a('0x1e')](_0x3f09ec,_0x57ba63)['then'](function(_0x590eee){logger[_0x6e5a('0x1f')]('ZendeskAccount,\x20%s,\x20%s',_0x20be1e,_0x6e5a('0x20'));logger[_0x6e5a('0x21')](_0x6e5a('0x22'),_0x20be1e,_0x6e5a('0x20'),JSON[_0x6e5a('0x23')](_0x590eee));if(_0x590eee[_0x6e5a('0x24')]){if(_0x590eee['error'][_0x6e5a('0x25')]===0x1f4){logger[_0x6e5a('0x24')](_0x6e5a('0x26'),_0x20be1e,_0x590eee['error'][_0x6e5a('0x27')]);return _0x4d99e9(_0x590eee[_0x6e5a('0x24')][_0x6e5a('0x27')]);}logger['error']('ZendeskAccount,\x20%s,\x20%s',_0x20be1e,_0x590eee[_0x6e5a('0x24')]['message']);return _0x481f1d(_0x590eee[_0x6e5a('0x24')][_0x6e5a('0x27')]);}else{logger[_0x6e5a('0x1f')](_0x6e5a('0x26'),_0x20be1e,_0x6e5a('0x20'));_0x481f1d(_0x590eee['result'][_0x6e5a('0x27')]);}})[_0x6e5a('0x28')](function(_0x2a7c7f){logger[_0x6e5a('0x24')]('ZendeskAccount,\x20%s,\x20%s',_0x20be1e,_0x2a7c7f);_0x4d99e9(_0x2a7c7f);});});}function respondWithStatusCode(_0x29a9c7,_0x497e5a){_0x497e5a=_0x497e5a||0xcc;return function(_0x4ec610){if(_0x4ec610){return _0x29a9c7[_0x6e5a('0x29')](_0x497e5a);}return _0x29a9c7['status'](_0x497e5a)['end']();};}function respondWithResult(_0xe41c1,_0x20397c){_0x20397c=_0x20397c||0xc8;return function(_0x3fcc9e){if(_0x3fcc9e){return _0xe41c1[_0x6e5a('0x2a')](_0x20397c)[_0x6e5a('0x2b')](_0x3fcc9e);}};}function respondWithFilteredResult(_0x3cd6f9,_0x1de627){return function(_0x133b4b){if(_0x133b4b){var _0x45a1df=_0x133b4b[_0x6e5a('0x2c')],_0x48fc6e=_0x1de627[_0x6e5a('0x2d')],_0x5e9017=_0x1de627[_0x6e5a('0x2d')]+_0x1de627['limit'],_0x42f232;if(_0x5e9017>=_0x45a1df){_0x5e9017=_0x45a1df;_0x42f232=0xc8;}else{_0x42f232=0xce;}_0x3cd6f9[_0x6e5a('0x2a')](_0x42f232);return _0x3cd6f9[_0x6e5a('0x2e')](_0x6e5a('0x2f'),_0x48fc6e+'-'+_0x5e9017+'/'+_0x45a1df)[_0x6e5a('0x2b')](_0x133b4b);}return null;};}function patchUpdates(_0x3ec6c7){return function(_0x5f5bc2){try{jsonpatch[_0x6e5a('0x30')](_0x5f5bc2,_0x3ec6c7,!![]);}catch(_0x741d60){return BPromise['reject'](_0x741d60);}return _0x5f5bc2['save']();};}function saveUpdates(_0x17148e,_0x4f562a){return function(_0x533e81){if(_0x533e81){return _0x533e81[_0x6e5a('0x31')](_0x17148e)[_0x6e5a('0x32')](function(_0x1919ac){return _0x1919ac;});}return null;};}function removeEntity(_0x16c8ea,_0x609205){return function(_0x2437a7){if(_0x2437a7){return _0x2437a7[_0x6e5a('0x33')]()[_0x6e5a('0x32')](function(){_0x16c8ea[_0x6e5a('0x2a')](0xcc)[_0x6e5a('0x34')]();});}};}function handleEntityNotFound(_0x1e6af8,_0x1e788d){return function(_0x14e6bf){if(!_0x14e6bf){_0x1e6af8[_0x6e5a('0x29')](0x194);}return _0x14e6bf;};}function handleError(_0x438038,_0x1da33b){_0x1da33b=_0x1da33b||0x1f4;return function(_0xd5bc92){logger[_0x6e5a('0x24')](_0xd5bc92[_0x6e5a('0x35')]);if(_0xd5bc92['name']){delete _0xd5bc92[_0x6e5a('0x36')];}_0x438038[_0x6e5a('0x2a')](_0x1da33b)[_0x6e5a('0x37')](_0xd5bc92);};}exports[_0x6e5a('0x38')]=function(_0x15acb0,_0x2dd17f){var _0x4d2871={},_0x1a8173={},_0x1bf0d7={'count':0x0,'rows':[]};var _0x3b6986=_['map'](db[_0x6e5a('0x39')]['rawAttributes'],function(_0x3daf1a){return{'name':_0x3daf1a[_0x6e5a('0x3a')],'type':_0x3daf1a['type'][_0x6e5a('0x3b')]};});_0x1a8173[_0x6e5a('0x3c')]=_[_0x6e5a('0x3d')](_0x3b6986,_0x6e5a('0x36'));_0x1a8173[_0x6e5a('0x3e')]=_['keys'](_0x15acb0['query']);_0x1a8173[_0x6e5a('0x3f')]=_[_0x6e5a('0x40')](_0x1a8173[_0x6e5a('0x3c')],_0x1a8173[_0x6e5a('0x3e')]);_0x4d2871[_0x6e5a('0x41')]=_['intersection'](_0x1a8173[_0x6e5a('0x3c')],qs['fields'](_0x15acb0[_0x6e5a('0x3e')]['fields']));_0x4d2871[_0x6e5a('0x41')]=_0x4d2871[_0x6e5a('0x41')][_0x6e5a('0x42')]?_0x4d2871[_0x6e5a('0x41')]:_0x1a8173[_0x6e5a('0x3c')];if(!_0x15acb0['query'][_0x6e5a('0x43')](_0x6e5a('0x44'))){_0x4d2871[_0x6e5a('0x45')]=qs[_0x6e5a('0x45')](_0x15acb0[_0x6e5a('0x3e')][_0x6e5a('0x45')]);_0x4d2871[_0x6e5a('0x2d')]=qs[_0x6e5a('0x2d')](_0x15acb0[_0x6e5a('0x3e')][_0x6e5a('0x2d')]);}_0x4d2871[_0x6e5a('0x46')]=qs['sort'](_0x15acb0[_0x6e5a('0x3e')][_0x6e5a('0x47')]);_0x4d2871[_0x6e5a('0x48')]=qs['filters'](_[_0x6e5a('0x49')](_0x15acb0[_0x6e5a('0x3e')],_0x1a8173[_0x6e5a('0x3f')]));if(_0x15acb0['query'][_0x6e5a('0x4a')]){_0x4d2871[_0x6e5a('0x48')]=_[_0x6e5a('0x4b')](_0x4d2871[_0x6e5a('0x48')],{'$or':_[_0x6e5a('0x3d')](_0x3b6986,function(_0x3d7578){if(_0x3d7578[_0x6e5a('0x4c')]!=='VIRTUAL'){var _0x5a87da={};_0x5a87da[_0x3d7578[_0x6e5a('0x36')]]={'$like':'%'+_0x15acb0['query'][_0x6e5a('0x4a')]+'%'};return _0x5a87da;}})});}_0x4d2871=_[_0x6e5a('0x4b')]({},_0x4d2871,_0x15acb0[_0x6e5a('0x4d')]);var _0x24e9ec={'where':_0x4d2871[_0x6e5a('0x48')]};return db['ZendeskAccount'][_0x6e5a('0x2c')](_0x24e9ec)[_0x6e5a('0x32')](function(_0x244e32){_0x1bf0d7['count']=_0x244e32;if(_0x15acb0[_0x6e5a('0x3e')]['includeAll']){_0x4d2871['include']=[{'all':!![]}];}return db[_0x6e5a('0x39')][_0x6e5a('0x4e')](_0x4d2871);})['then'](function(_0x4e1cef){_0x1bf0d7['rows']=_0x4e1cef;return _0x1bf0d7;})['then'](respondWithFilteredResult(_0x2dd17f,_0x4d2871))['catch'](handleError(_0x2dd17f,null));};exports[_0x6e5a('0x4f')]=function(_0x26350c,_0x248a30){var _0x4d6814={'raw':![],'where':{'id':_0x26350c[_0x6e5a('0x50')]['id']}},_0x2904b1={};_0x2904b1[_0x6e5a('0x3c')]=_[_0x6e5a('0x51')](db['ZendeskAccount']['rawAttributes']);_0x2904b1['query']=_[_0x6e5a('0x51')](_0x26350c[_0x6e5a('0x3e')]);_0x2904b1[_0x6e5a('0x3f')]=_[_0x6e5a('0x40')](_0x2904b1['model'],_0x2904b1[_0x6e5a('0x3e')]);_0x4d6814[_0x6e5a('0x41')]=_[_0x6e5a('0x40')](_0x2904b1[_0x6e5a('0x3c')],qs[_0x6e5a('0x52')](_0x26350c['query'][_0x6e5a('0x52')]));_0x4d6814['attributes']=_0x4d6814['attributes'][_0x6e5a('0x42')]?_0x4d6814[_0x6e5a('0x41')]:_0x2904b1[_0x6e5a('0x3c')];if(_0x26350c[_0x6e5a('0x3e')][_0x6e5a('0x53')]){_0x4d6814['include']=[{'all':!![]}];}_0x4d6814=_[_0x6e5a('0x4b')]({},_0x4d6814,_0x26350c[_0x6e5a('0x4d')]);return db['ZendeskAccount'][_0x6e5a('0x54')](_0x4d6814)[_0x6e5a('0x32')](handleEntityNotFound(_0x248a30,null))[_0x6e5a('0x32')](respondWithResult(_0x248a30,null))[_0x6e5a('0x28')](handleError(_0x248a30,null));};exports[_0x6e5a('0x55')]=function(_0x3dad1f,_0x4f790f){return db[_0x6e5a('0x39')]['create'](_0x3dad1f[_0x6e5a('0x56')],{})[_0x6e5a('0x32')](respondWithResult(_0x4f790f,0xc9))[_0x6e5a('0x28')](handleError(_0x4f790f,null));};exports[_0x6e5a('0x31')]=function(_0x1aa8b6,_0x4a8617){if(_0x1aa8b6[_0x6e5a('0x56')]['id']){delete _0x1aa8b6[_0x6e5a('0x56')]['id'];}return db[_0x6e5a('0x39')]['find']({'where':{'id':_0x1aa8b6['params']['id']}})[_0x6e5a('0x32')](handleEntityNotFound(_0x4a8617,null))[_0x6e5a('0x32')](saveUpdates(_0x1aa8b6['body'],null))[_0x6e5a('0x32')](respondWithResult(_0x4a8617,null))[_0x6e5a('0x28')](handleError(_0x4a8617,null));};exports[_0x6e5a('0x33')]=function(_0x114447,_0x20badf){return db[_0x6e5a('0x39')]['find']({'where':{'id':_0x114447[_0x6e5a('0x50')]['id']}})['then'](handleEntityNotFound(_0x20badf,null))['then'](removeEntity(_0x20badf,null))[_0x6e5a('0x28')](handleError(_0x20badf,null));};exports[_0x6e5a('0x57')]=function(_0x3c216f,_0x2920ae,_0x42c498){var _0x117047={};var _0x5cf147={};var _0x46d92c;var _0x1f32e7;return db[_0x6e5a('0x39')][_0x6e5a('0x58')]({'where':{'id':_0x3c216f[_0x6e5a('0x50')]['id']}})[_0x6e5a('0x32')](handleEntityNotFound(_0x2920ae,null))[_0x6e5a('0x32')](function(_0x21af27){if(_0x21af27){_0x46d92c=_0x21af27;_0x5cf147[_0x6e5a('0x3c')]=_[_0x6e5a('0x51')](db[_0x6e5a('0x59')]['rawAttributes']);_0x5cf147[_0x6e5a('0x3e')]=_[_0x6e5a('0x51')](_0x3c216f[_0x6e5a('0x3e')]);_0x5cf147[_0x6e5a('0x3f')]=_[_0x6e5a('0x40')](_0x5cf147[_0x6e5a('0x3c')],_0x5cf147[_0x6e5a('0x3e')]);_0x117047[_0x6e5a('0x41')]=_[_0x6e5a('0x40')](_0x5cf147[_0x6e5a('0x3c')],qs[_0x6e5a('0x52')](_0x3c216f[_0x6e5a('0x3e')]['fields']));_0x117047['attributes']=_0x117047['attributes']['length']?_0x117047[_0x6e5a('0x41')]:_0x5cf147[_0x6e5a('0x3c')];_0x117047[_0x6e5a('0x46')]=qs[_0x6e5a('0x47')](_0x3c216f['query'][_0x6e5a('0x47')]);_0x117047['where']=qs['filters'](_[_0x6e5a('0x49')](_0x3c216f[_0x6e5a('0x3e')],_0x5cf147[_0x6e5a('0x3f')]));if(_0x3c216f[_0x6e5a('0x3e')]['filter']){_0x117047[_0x6e5a('0x48')]=_[_0x6e5a('0x4b')](_0x117047['where'],{'$or':_[_0x6e5a('0x3d')](_0x117047['attributes'],function(_0x12fa28){var _0x233fc1={};_0x233fc1[_0x12fa28]={'$like':'%'+_0x3c216f[_0x6e5a('0x3e')]['filter']+'%'};return _0x233fc1;})});}_0x117047=_[_0x6e5a('0x4b')]({},_0x117047,_0x3c216f[_0x6e5a('0x4d')]);return _0x46d92c[_0x6e5a('0x57')](_0x117047);}})[_0x6e5a('0x32')](function(_0x1ff0fb){if(_0x1ff0fb){_0x1f32e7=_0x1ff0fb[_0x6e5a('0x42')];if(!_0x3c216f[_0x6e5a('0x3e')][_0x6e5a('0x43')]('nolimit')){_0x117047[_0x6e5a('0x45')]=qs['limit'](_0x3c216f['query'][_0x6e5a('0x45')]);_0x117047[_0x6e5a('0x2d')]=qs[_0x6e5a('0x2d')](_0x3c216f[_0x6e5a('0x3e')][_0x6e5a('0x2d')]);}return _0x46d92c[_0x6e5a('0x57')](_0x117047);}})[_0x6e5a('0x32')](function(_0x24a88f){if(_0x24a88f){return _0x24a88f?{'count':_0x1f32e7,'rows':_0x24a88f}:null;}})[_0x6e5a('0x32')](respondWithResult(_0x2920ae,null))[_0x6e5a('0x28')](handleError(_0x2920ae,null));};exports[_0x6e5a('0x5a')]=function(_0x4e8c29,_0x1ee99c,_0x1ef150){if(_0x4e8c29[_0x6e5a('0x56')]['id']){delete _0x4e8c29[_0x6e5a('0x56')]['id'];}return db[_0x6e5a('0x39')][_0x6e5a('0x58')]({'where':{'id':_0x4e8c29[_0x6e5a('0x50')]['id']}})[_0x6e5a('0x32')](handleEntityNotFound(_0x1ee99c,null))[_0x6e5a('0x32')](function(_0xa83250){if(_0xa83250){_0x4e8c29[_0x6e5a('0x56')][_0x6e5a('0x5b')]=_0xa83250['id'];_0x4e8c29['body'][_0x6e5a('0x5c')]=integrations[_0x6e5a('0x5d')](_0x4e8c29[_0x6e5a('0x56')][_0x6e5a('0x5e')],_0x4e8c29[_0x6e5a('0x56')][_0x6e5a('0x4c')]);_0x4e8c29[_0x6e5a('0x56')]['Descriptions']=integrations[_0x6e5a('0x5f')](_0x4e8c29['body']['channel'],_0x4e8c29[_0x6e5a('0x56')][_0x6e5a('0x4c')]);return db[_0x6e5a('0x59')][_0x6e5a('0x55')](_0x4e8c29[_0x6e5a('0x56')],{'include':[{'model':db[_0x6e5a('0x60')],'as':_0x6e5a('0x5c')},{'model':db[_0x6e5a('0x60')],'as':_0x6e5a('0x61')}]});}return null;})[_0x6e5a('0x32')](respondWithResult(_0x1ee99c,null))['catch'](handleError(_0x1ee99c,null));};exports[_0x6e5a('0x62')]=function(_0x4a9aa4,_0x2b3835,_0x5841a8){var _0x33c596='';return db['ZendeskAccount'][_0x6e5a('0x58')]({'where':{'id':_0x4a9aa4['params']['id']},'attributes':['id','username',_0x6e5a('0x63'),_0x6e5a('0x64'),_0x6e5a('0x65'),_0x6e5a('0x66')]})[_0x6e5a('0x32')](handleEntityNotFound(_0x2b3835,null))['then'](function(_0x180d94){if(_0x180d94){_0x33c596=_0x180d94[_0x6e5a('0x66')];var _0x5107c8=_0x33c596[_0x6e5a('0x67')](-0x1);if(_0x5107c8==='/'){_0x33c596=_0x33c596['substring'](0x0,_0x33c596[_0x6e5a('0x68')](_0x5107c8));}var _0xcb1a28={'method':'GET','uri':util[_0x6e5a('0x69')](_0x6e5a('0x6a'),_0x33c596,_0x6e5a('0x6b')),'json':!![]};switch(_0x180d94[_0x6e5a('0x65')]){case _0x6e5a('0x63'):_0xcb1a28['headers']={'Authorization':util[_0x6e5a('0x69')](_0x6e5a('0x6c'),new Buffer(util['format'](_0x6e5a('0x6d'),_0x180d94[_0x6e5a('0x6e')],_0x180d94['password']))[_0x6e5a('0x6f')](_0x6e5a('0x70')))};break;case _0x6e5a('0x64'):_0xcb1a28['headers']={'Authorization':util[_0x6e5a('0x69')](_0x6e5a('0x6c'),new Buffer(util[_0x6e5a('0x69')](_0x6e5a('0x71'),_0x180d94['username'],_0x180d94[_0x6e5a('0x64')]))[_0x6e5a('0x6f')](_0x6e5a('0x70')))};break;default:throw new db[(_0x6e5a('0x1b'))][(_0x6e5a('0x1c'))](_0x6e5a('0x72'));}return rp(_0xcb1a28);}})[_0x6e5a('0x32')](function(_0x1f6c5d){if(_0x1f6c5d){var _0x4961ff=[_0x6e5a('0x73'),_0x6e5a('0x74'),_0x6e5a('0x75'),'assignee'];_[_0x6e5a('0x76')](_0x1f6c5d['ticket_fields'],function(_0xd3284b){return _0x4961ff[_0x6e5a('0x77')](_0xd3284b['type']);});return{'count':_0x1f6c5d['ticket_fields'][_0x6e5a('0x42')],'rows':_[_0x6e5a('0x3d')](_0x1f6c5d[_0x6e5a('0x6b')],function(_0x2054f5){return{'id':_0x2054f5['id'],'name':_0x2054f5[_0x6e5a('0x78')]>0x7?_0x2054f5[_0x6e5a('0x79')]:_0x2054f5[_0x6e5a('0x4c')],'custom':_0x2054f5[_0x6e5a('0x78')]>0x7?!![]:![],'options':_0x2054f5['system_field_options']?_0x2054f5[_0x6e5a('0x7a')]:_0x2054f5[_0x6e5a('0x7b')]?_0x2054f5['custom_field_options']:[]};})};}})['then'](respondWithResult(_0x2b3835,null))[_0x6e5a('0x28')](function(_0x487161){var _0x49a03d=_0x4a9aa4['query'][_0x6e5a('0x1a')]?0x1f4:_0x487161[_0x6e5a('0x7c')]||0x1f4;logger[_0x6e5a('0x24')](_0x6e5a('0x7d'),'getFields',_0x49a03d,JSON[_0x6e5a('0x23')](_0x487161));delete _0x487161[_0x6e5a('0x36')];if(_0x49a03d===0x191){_0x49a03d=0x190;}_0x2b3835[_0x6e5a('0x2a')](_0x49a03d)[_0x6e5a('0x37')](_0x4a9aa4[_0x6e5a('0x3e')][_0x6e5a('0x1a')]?{'message':_0x6e5a('0x7e'),'statusCode':_0x487161[_0x6e5a('0x7c')]}:_0x487161);});}; \ No newline at end of file +var _0xaa8a=['password','headers','Basic\x20%s','%s:%s','toString','base64','Sequelize','subject','description','group','ticket_fields','includes','position','system_field_options','custom_field_options','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','jsforce','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','save','update','destroy','stack','name','send','index','map','ZendeskAccount','rawAttributes','type','model','intersection','query','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','options','includeAll','rows','show','params','keys','fields','include','find','body','findOne','ZendeskConfiguration','merge','getConfigurations','addConfiguration','AccountId','getSubjects','channel','Descriptions','create','ZendeskField','Subjects','getFields','username','token','remoteUri','slice','substring','lastIndexOf','GET','format','authType'];(function(_0x49beb7,_0x17e479){var _0x48a0c6=function(_0x187f31){while(--_0x187f31){_0x49beb7['push'](_0x49beb7['shift']());}};_0x48a0c6(++_0x17e479);}(_0xaa8a,0x18f));var _0xaaa8=function(_0x264545,_0x214037){_0x264545=_0x264545-0x0;var _0x114d10=_0xaa8a[_0x264545];return _0x114d10;};'use strict';var pdf=require(_0xaaa8('0x0'));var emlformat=require(_0xaaa8('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xaaa8('0x2'));var jsonpatch=require(_0xaaa8('0x3'));var rp=require(_0xaaa8('0x4'));var moment=require(_0xaaa8('0x5'));var BPromise=require(_0xaaa8('0x6'));var Mustache=require(_0xaaa8('0x7'));var util=require(_0xaaa8('0x8'));var path=require(_0xaaa8('0x9'));var sox=require('sox');var csv=require(_0xaaa8('0xa'));var ejs=require(_0xaaa8('0xb'));var fs=require('fs');var _=require(_0xaaa8('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xaaa8('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xaaa8('0xe'));var Papa=require('papaparse');var Redis=require(_0xaaa8('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xaaa8('0x10'));var hardwareService=require(_0xaaa8('0x11'));var logger=require(_0xaaa8('0x12'))(_0xaaa8('0x13'));var utils=require('../../config/utils');var config=require(_0xaaa8('0x14'));var db=require(_0xaaa8('0x15'))['db'];var integrations=require(_0xaaa8('0x16'));var jayson=require(_0xaaa8('0x17'));var client=jayson[_0xaaa8('0x18')][_0xaaa8('0x19')]({'port':0x232a});function checkPasswordPattern(_0x4cc5c1,_0x1f7f83,_0x58363a){if(_0x58363a){var _0x14ac52=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x14ac52[_0xaaa8('0x1a')](_0x1f7f83)){return _0x4cc5c1;}else{throw new db['Sequelize'][(_0xaaa8('0x1b'))](_0xaaa8('0x1c'));}}else{return _0x4cc5c1;}}function respondWithRpcPromise(_0x18e713,_0x3ce488,_0x1ef796,_0xc835cb){return new BPromise(function(_0x4224de,_0x3e6a20){var _0x27b53f=_0xc835cb||client;return _0x27b53f[_0xaaa8('0x1d')](_0x18e713,_0x1ef796)[_0xaaa8('0x1e')](function(_0x319295){logger[_0xaaa8('0x1f')](_0xaaa8('0x20'),_0x3ce488,_0xaaa8('0x21'));logger[_0xaaa8('0x22')](_0xaaa8('0x23'),_0x3ce488,_0xaaa8('0x21'),JSON[_0xaaa8('0x24')](_0x319295));if(_0x319295['error']){if(_0x319295['error'][_0xaaa8('0x25')]===0x1f4){logger[_0xaaa8('0x26')](_0xaaa8('0x20'),_0x3ce488,_0x319295[_0xaaa8('0x26')]['message']);return _0x3e6a20(_0x319295[_0xaaa8('0x26')][_0xaaa8('0x27')]);}logger[_0xaaa8('0x26')](_0xaaa8('0x20'),_0x3ce488,_0x319295[_0xaaa8('0x26')][_0xaaa8('0x27')]);return _0x4224de(_0x319295[_0xaaa8('0x26')][_0xaaa8('0x27')]);}else{logger[_0xaaa8('0x1f')]('ZendeskAccount,\x20%s,\x20%s',_0x3ce488,_0xaaa8('0x21'));_0x4224de(_0x319295[_0xaaa8('0x28')]['message']);}})[_0xaaa8('0x29')](function(_0x555915){logger[_0xaaa8('0x26')](_0xaaa8('0x20'),_0x3ce488,_0x555915);_0x3e6a20(_0x555915);});});}function respondWithStatusCode(_0x36e914,_0x15c472){_0x15c472=_0x15c472||0xcc;return function(_0x3ba189){if(_0x3ba189){return _0x36e914[_0xaaa8('0x2a')](_0x15c472);}return _0x36e914[_0xaaa8('0x2b')](_0x15c472)[_0xaaa8('0x2c')]();};}function respondWithResult(_0x3702d0,_0x40aabe){_0x40aabe=_0x40aabe||0xc8;return function(_0x37de1e){if(_0x37de1e){return _0x3702d0['status'](_0x40aabe)['json'](_0x37de1e);}};}function respondWithFilteredResult(_0x146d27,_0x312074){return function(_0x44aadc){if(_0x44aadc){var _0x3c05de=_0x44aadc[_0xaaa8('0x2d')],_0x4c80d9=_0x312074[_0xaaa8('0x2e')],_0x5e6bed=_0x312074[_0xaaa8('0x2e')]+_0x312074[_0xaaa8('0x2f')],_0x370b6e;if(_0x5e6bed>=_0x3c05de){_0x5e6bed=_0x3c05de;_0x370b6e=0xc8;}else{_0x370b6e=0xce;}_0x146d27[_0xaaa8('0x2b')](_0x370b6e);return _0x146d27[_0xaaa8('0x30')](_0xaaa8('0x31'),_0x4c80d9+'-'+_0x5e6bed+'/'+_0x3c05de)[_0xaaa8('0x32')](_0x44aadc);}return null;};}function patchUpdates(_0x4f9dc5){return function(_0x1bacbe){try{jsonpatch[_0xaaa8('0x33')](_0x1bacbe,_0x4f9dc5,!![]);}catch(_0x4538f0){return BPromise['reject'](_0x4538f0);}return _0x1bacbe[_0xaaa8('0x34')]();};}function saveUpdates(_0x14519c,_0x890d53){return function(_0x418247){if(_0x418247){return _0x418247[_0xaaa8('0x35')](_0x14519c)['then'](function(_0x55f719){return _0x55f719;});}return null;};}function removeEntity(_0x45f134,_0x1224ed){return function(_0x4742ff){if(_0x4742ff){return _0x4742ff[_0xaaa8('0x36')]()[_0xaaa8('0x1e')](function(){_0x45f134['status'](0xcc)[_0xaaa8('0x2c')]();});}};}function handleEntityNotFound(_0x3c5ac4,_0x16cade){return function(_0x59204f){if(!_0x59204f){_0x3c5ac4[_0xaaa8('0x2a')](0x194);}return _0x59204f;};}function handleError(_0x4f513d,_0x31d6ca){_0x31d6ca=_0x31d6ca||0x1f4;return function(_0x51221a){logger[_0xaaa8('0x26')](_0x51221a[_0xaaa8('0x37')]);if(_0x51221a['name']){delete _0x51221a[_0xaaa8('0x38')];}_0x4f513d[_0xaaa8('0x2b')](_0x31d6ca)[_0xaaa8('0x39')](_0x51221a);};}exports[_0xaaa8('0x3a')]=function(_0x4c5179,_0x44e18a){var _0x52eaf9={},_0xaa8502={},_0x38ed03={'count':0x0,'rows':[]};var _0x5ec9a0=_[_0xaaa8('0x3b')](db[_0xaaa8('0x3c')][_0xaaa8('0x3d')],function(_0x47ade5){return{'name':_0x47ade5['fieldName'],'type':_0x47ade5[_0xaaa8('0x3e')]['key']};});_0xaa8502[_0xaaa8('0x3f')]=_[_0xaaa8('0x3b')](_0x5ec9a0,'name');_0xaa8502['query']=_['keys'](_0x4c5179['query']);_0xaa8502['filters']=_[_0xaaa8('0x40')](_0xaa8502['model'],_0xaa8502[_0xaaa8('0x41')]);_0x52eaf9[_0xaaa8('0x42')]=_['intersection'](_0xaa8502[_0xaaa8('0x3f')],qs['fields'](_0x4c5179['query']['fields']));_0x52eaf9[_0xaaa8('0x42')]=_0x52eaf9[_0xaaa8('0x42')][_0xaaa8('0x43')]?_0x52eaf9[_0xaaa8('0x42')]:_0xaa8502[_0xaaa8('0x3f')];if(!_0x4c5179[_0xaaa8('0x41')][_0xaaa8('0x44')](_0xaaa8('0x45'))){_0x52eaf9[_0xaaa8('0x2f')]=qs[_0xaaa8('0x2f')](_0x4c5179[_0xaaa8('0x41')][_0xaaa8('0x2f')]);_0x52eaf9['offset']=qs[_0xaaa8('0x2e')](_0x4c5179[_0xaaa8('0x41')]['offset']);}_0x52eaf9[_0xaaa8('0x46')]=qs[_0xaaa8('0x47')](_0x4c5179[_0xaaa8('0x41')]['sort']);_0x52eaf9[_0xaaa8('0x48')]=qs[_0xaaa8('0x49')](_[_0xaaa8('0x4a')](_0x4c5179['query'],_0xaa8502[_0xaaa8('0x49')]));if(_0x4c5179[_0xaaa8('0x41')][_0xaaa8('0x4b')]){_0x52eaf9[_0xaaa8('0x48')]=_['merge'](_0x52eaf9[_0xaaa8('0x48')],{'$or':_['map'](_0x5ec9a0,function(_0x32330a){if(_0x32330a[_0xaaa8('0x3e')]!==_0xaaa8('0x4c')){var _0x12397e={};_0x12397e[_0x32330a[_0xaaa8('0x38')]]={'$like':'%'+_0x4c5179[_0xaaa8('0x41')][_0xaaa8('0x4b')]+'%'};return _0x12397e;}})});}_0x52eaf9=_['merge']({},_0x52eaf9,_0x4c5179[_0xaaa8('0x4d')]);var _0x4d0e8a={'where':_0x52eaf9['where']};return db[_0xaaa8('0x3c')][_0xaaa8('0x2d')](_0x4d0e8a)['then'](function(_0x32a642){_0x38ed03[_0xaaa8('0x2d')]=_0x32a642;if(_0x4c5179[_0xaaa8('0x41')][_0xaaa8('0x4e')]){_0x52eaf9['include']=[{'all':!![]}];}return db[_0xaaa8('0x3c')]['findAll'](_0x52eaf9);})['then'](function(_0x462947){_0x38ed03[_0xaaa8('0x4f')]=_0x462947;return _0x38ed03;})['then'](respondWithFilteredResult(_0x44e18a,_0x52eaf9))['catch'](handleError(_0x44e18a,null));};exports[_0xaaa8('0x50')]=function(_0x114af9,_0x2eaaf8){var _0x348a34={'raw':![],'where':{'id':_0x114af9[_0xaaa8('0x51')]['id']}},_0x23ad4e={};_0x23ad4e[_0xaaa8('0x3f')]=_[_0xaaa8('0x52')](db['ZendeskAccount'][_0xaaa8('0x3d')]);_0x23ad4e[_0xaaa8('0x41')]=_[_0xaaa8('0x52')](_0x114af9['query']);_0x23ad4e[_0xaaa8('0x49')]=_[_0xaaa8('0x40')](_0x23ad4e[_0xaaa8('0x3f')],_0x23ad4e['query']);_0x348a34[_0xaaa8('0x42')]=_[_0xaaa8('0x40')](_0x23ad4e[_0xaaa8('0x3f')],qs['fields'](_0x114af9[_0xaaa8('0x41')][_0xaaa8('0x53')]));_0x348a34['attributes']=_0x348a34['attributes'][_0xaaa8('0x43')]?_0x348a34[_0xaaa8('0x42')]:_0x23ad4e[_0xaaa8('0x3f')];if(_0x114af9[_0xaaa8('0x41')][_0xaaa8('0x4e')]){_0x348a34[_0xaaa8('0x54')]=[{'all':!![]}];}_0x348a34=_['merge']({},_0x348a34,_0x114af9['options']);return db[_0xaaa8('0x3c')][_0xaaa8('0x55')](_0x348a34)[_0xaaa8('0x1e')](handleEntityNotFound(_0x2eaaf8,null))['then'](respondWithResult(_0x2eaaf8,null))[_0xaaa8('0x29')](handleError(_0x2eaaf8,null));};exports['create']=function(_0x35bea2,_0x5dd58c){return db[_0xaaa8('0x3c')]['create'](_0x35bea2[_0xaaa8('0x56')],{})[_0xaaa8('0x1e')](respondWithResult(_0x5dd58c,0xc9))[_0xaaa8('0x29')](handleError(_0x5dd58c,null));};exports[_0xaaa8('0x35')]=function(_0x23d5cf,_0x3e7c0c){if(_0x23d5cf['body']['id']){delete _0x23d5cf[_0xaaa8('0x56')]['id'];}return db[_0xaaa8('0x3c')]['find']({'where':{'id':_0x23d5cf[_0xaaa8('0x51')]['id']}})[_0xaaa8('0x1e')](handleEntityNotFound(_0x3e7c0c,null))[_0xaaa8('0x1e')](saveUpdates(_0x23d5cf[_0xaaa8('0x56')],null))[_0xaaa8('0x1e')](respondWithResult(_0x3e7c0c,null))[_0xaaa8('0x29')](handleError(_0x3e7c0c,null));};exports[_0xaaa8('0x36')]=function(_0xbd1811,_0x5c4f24){return db[_0xaaa8('0x3c')][_0xaaa8('0x55')]({'where':{'id':_0xbd1811[_0xaaa8('0x51')]['id']}})['then'](handleEntityNotFound(_0x5c4f24,null))[_0xaaa8('0x1e')](removeEntity(_0x5c4f24,null))[_0xaaa8('0x29')](handleError(_0x5c4f24,null));};exports['getConfigurations']=function(_0x38893d,_0xef1928,_0x155aac){var _0x41c6f1={};var _0x3595b5={};var _0x7a226d;var _0x7895f4;return db[_0xaaa8('0x3c')][_0xaaa8('0x57')]({'where':{'id':_0x38893d[_0xaaa8('0x51')]['id']}})[_0xaaa8('0x1e')](handleEntityNotFound(_0xef1928,null))[_0xaaa8('0x1e')](function(_0x27be9a){if(_0x27be9a){_0x7a226d=_0x27be9a;_0x3595b5[_0xaaa8('0x3f')]=_[_0xaaa8('0x52')](db[_0xaaa8('0x58')][_0xaaa8('0x3d')]);_0x3595b5['query']=_[_0xaaa8('0x52')](_0x38893d[_0xaaa8('0x41')]);_0x3595b5['filters']=_['intersection'](_0x3595b5[_0xaaa8('0x3f')],_0x3595b5['query']);_0x41c6f1['attributes']=_['intersection'](_0x3595b5[_0xaaa8('0x3f')],qs[_0xaaa8('0x53')](_0x38893d[_0xaaa8('0x41')][_0xaaa8('0x53')]));_0x41c6f1[_0xaaa8('0x42')]=_0x41c6f1[_0xaaa8('0x42')][_0xaaa8('0x43')]?_0x41c6f1[_0xaaa8('0x42')]:_0x3595b5['model'];_0x41c6f1[_0xaaa8('0x46')]=qs[_0xaaa8('0x47')](_0x38893d[_0xaaa8('0x41')][_0xaaa8('0x47')]);_0x41c6f1[_0xaaa8('0x48')]=qs[_0xaaa8('0x49')](_[_0xaaa8('0x4a')](_0x38893d['query'],_0x3595b5[_0xaaa8('0x49')]));if(_0x38893d[_0xaaa8('0x41')][_0xaaa8('0x4b')]){_0x41c6f1[_0xaaa8('0x48')]=_[_0xaaa8('0x59')](_0x41c6f1['where'],{'$or':_[_0xaaa8('0x3b')](_0x41c6f1[_0xaaa8('0x42')],function(_0x4212b7){var _0x398730={};_0x398730[_0x4212b7]={'$like':'%'+_0x38893d['query'][_0xaaa8('0x4b')]+'%'};return _0x398730;})});}_0x41c6f1=_[_0xaaa8('0x59')]({},_0x41c6f1,_0x38893d[_0xaaa8('0x4d')]);return _0x7a226d[_0xaaa8('0x5a')](_0x41c6f1);}})[_0xaaa8('0x1e')](function(_0x2ec9b0){if(_0x2ec9b0){_0x7895f4=_0x2ec9b0[_0xaaa8('0x43')];if(!_0x38893d[_0xaaa8('0x41')]['hasOwnProperty'](_0xaaa8('0x45'))){_0x41c6f1['limit']=qs['limit'](_0x38893d[_0xaaa8('0x41')][_0xaaa8('0x2f')]);_0x41c6f1[_0xaaa8('0x2e')]=qs[_0xaaa8('0x2e')](_0x38893d['query'][_0xaaa8('0x2e')]);}return _0x7a226d[_0xaaa8('0x5a')](_0x41c6f1);}})['then'](function(_0x425c4d){if(_0x425c4d){return _0x425c4d?{'count':_0x7895f4,'rows':_0x425c4d}:null;}})['then'](respondWithResult(_0xef1928,null))['catch'](handleError(_0xef1928,null));};exports[_0xaaa8('0x5b')]=function(_0x6309a,_0x2c02ee,_0xb12e0){if(_0x6309a[_0xaaa8('0x56')]['id']){delete _0x6309a[_0xaaa8('0x56')]['id'];}return db[_0xaaa8('0x3c')][_0xaaa8('0x57')]({'where':{'id':_0x6309a[_0xaaa8('0x51')]['id']}})[_0xaaa8('0x1e')](handleEntityNotFound(_0x2c02ee,null))[_0xaaa8('0x1e')](function(_0x40b8d8){if(_0x40b8d8){_0x6309a[_0xaaa8('0x56')][_0xaaa8('0x5c')]=_0x40b8d8['id'];_0x6309a[_0xaaa8('0x56')]['Subjects']=integrations[_0xaaa8('0x5d')](_0x6309a[_0xaaa8('0x56')][_0xaaa8('0x5e')],_0x6309a[_0xaaa8('0x56')][_0xaaa8('0x3e')]);_0x6309a['body'][_0xaaa8('0x5f')]=integrations['getDescriptions'](_0x6309a[_0xaaa8('0x56')][_0xaaa8('0x5e')],_0x6309a['body'][_0xaaa8('0x3e')]);return db['ZendeskConfiguration'][_0xaaa8('0x60')](_0x6309a[_0xaaa8('0x56')],{'include':[{'model':db[_0xaaa8('0x61')],'as':_0xaaa8('0x62')},{'model':db[_0xaaa8('0x61')],'as':_0xaaa8('0x5f')}]});}return null;})['then'](respondWithResult(_0x2c02ee,null))[_0xaaa8('0x29')](handleError(_0x2c02ee,null));};exports[_0xaaa8('0x63')]=function(_0x2af22d,_0x1c0777,_0x4f12b2){var _0x5ad418='';return db['ZendeskAccount'][_0xaaa8('0x57')]({'where':{'id':_0x2af22d[_0xaaa8('0x51')]['id']},'attributes':['id',_0xaaa8('0x64'),'password',_0xaaa8('0x65'),'authType',_0xaaa8('0x66')]})[_0xaaa8('0x1e')](handleEntityNotFound(_0x1c0777,null))['then'](function(_0x4ea320){if(_0x4ea320){_0x5ad418=_0x4ea320[_0xaaa8('0x66')];var _0x22d065=_0x5ad418[_0xaaa8('0x67')](-0x1);if(_0x22d065==='/'){_0x5ad418=_0x5ad418[_0xaaa8('0x68')](0x0,_0x5ad418[_0xaaa8('0x69')](_0x22d065));}var _0x37e258={'method':_0xaaa8('0x6a'),'uri':util[_0xaaa8('0x6b')]('%s/%s',_0x5ad418,'ticket_fields'),'json':!![]};switch(_0x4ea320[_0xaaa8('0x6c')]){case _0xaaa8('0x6d'):_0x37e258[_0xaaa8('0x6e')]={'Authorization':util[_0xaaa8('0x6b')](_0xaaa8('0x6f'),new Buffer(util['format'](_0xaaa8('0x70'),_0x4ea320[_0xaaa8('0x64')],_0x4ea320['password']))[_0xaaa8('0x71')](_0xaaa8('0x72')))};break;case _0xaaa8('0x65'):_0x37e258[_0xaaa8('0x6e')]={'Authorization':util[_0xaaa8('0x6b')](_0xaaa8('0x6f'),new Buffer(util[_0xaaa8('0x6b')]('%s/token:%s',_0x4ea320[_0xaaa8('0x64')],_0x4ea320[_0xaaa8('0x65')]))['toString'](_0xaaa8('0x72')))};break;default:throw new db[(_0xaaa8('0x73'))][(_0xaaa8('0x1b'))]('Unknown\x20authentication\x20type');}return rp(_0x37e258);}})[_0xaaa8('0x1e')](function(_0x36258f){if(_0x36258f){var _0x3f6031=[_0xaaa8('0x74'),_0xaaa8('0x75'),_0xaaa8('0x76'),'assignee'];_['remove'](_0x36258f[_0xaaa8('0x77')],function(_0x5ed81e){return _0x3f6031[_0xaaa8('0x78')](_0x5ed81e[_0xaaa8('0x3e')]);});return{'count':_0x36258f[_0xaaa8('0x77')][_0xaaa8('0x43')],'rows':_[_0xaaa8('0x3b')](_0x36258f[_0xaaa8('0x77')],function(_0x40cc66){return{'id':_0x40cc66['id'],'name':_0x40cc66[_0xaaa8('0x79')]>0x7?_0x40cc66['title']:_0x40cc66['type'],'custom':_0x40cc66[_0xaaa8('0x79')]>0x7?!![]:![],'options':_0x40cc66['system_field_options']?_0x40cc66[_0xaaa8('0x7a')]:_0x40cc66[_0xaaa8('0x7b')]?_0x40cc66[_0xaaa8('0x7b')]:[]};})};}})[_0xaaa8('0x1e')](respondWithResult(_0x1c0777,null))[_0xaaa8('0x29')](function(_0x20248c){var _0x51bfe4=_0x2af22d[_0xaaa8('0x41')][_0xaaa8('0x1a')]?0x1f4:_0x20248c[_0xaaa8('0x7c')]||0x1f4;logger[_0xaaa8('0x26')](_0xaaa8('0x7d'),_0xaaa8('0x63'),_0x51bfe4,JSON[_0xaaa8('0x24')](_0x20248c));delete _0x20248c[_0xaaa8('0x38')];if(_0x51bfe4===0x191){_0x51bfe4=0x190;}_0x1c0777['status'](_0x51bfe4)['send'](_0x2af22d['query']['test']?{'message':_0xaaa8('0x7e'),'statusCode':_0x20248c['statusCode']}:_0x20248c);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 2aebd77..5578748 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 _0xa3b7=['./intZendeskAccount.attributes','../../components/integrations/configuration','exports','ZendeskAccount','int_zendesk_accounts','lodash','api','moment','rimraf','../../config/environment'];(function(_0x218efe,_0x475a17){var _0x1ffa33=function(_0x4f7fd0){while(--_0x4f7fd0){_0x218efe['push'](_0x218efe['shift']());}};_0x1ffa33(++_0x475a17);}(_0xa3b7,0x11d));var _0x7a3b=function(_0x4aba15,_0x4e90aa){_0x4aba15=_0x4aba15-0x0;var _0x1c8122=_0xa3b7[_0x4aba15];return _0x1c8122;};'use strict';var _=require(_0x7a3b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x7a3b('0x1'));var moment=require(_0x7a3b('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7a3b('0x3'));var config=require(_0x7a3b('0x4'));var attributes=require(_0x7a3b('0x5'));var integrations=require(_0x7a3b('0x6'));module[_0x7a3b('0x7')]=function(_0x189ade,_0x7f30c6){return _0x189ade['define'](_0x7a3b('0x8'),attributes,{'tableName':_0x7a3b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6e6f=['define','ZendeskAccount','int_zendesk_accounts','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration'];(function(_0x1ea3b9,_0x3c6b2c){var _0x206d41=function(_0x55ef0c){while(--_0x55ef0c){_0x1ea3b9['push'](_0x1ea3b9['shift']());}};_0x206d41(++_0x3c6b2c);}(_0x6e6f,0x1b3));var _0xf6e6=function(_0x5d71fb,_0x5b3f42){_0x5d71fb=_0x5d71fb-0x0;var _0x19bac8=_0x6e6f[_0x5d71fb];return _0x19bac8;};'use strict';var _=require(_0xf6e6('0x0'));var util=require('util');var logger=require(_0xf6e6('0x1'))(_0xf6e6('0x2'));var moment=require(_0xf6e6('0x3'));var BPromise=require('bluebird');var rp=require(_0xf6e6('0x4'));var fs=require('fs');var path=require(_0xf6e6('0x5'));var rimraf=require(_0xf6e6('0x6'));var config=require(_0xf6e6('0x7'));var attributes=require('./intZendeskAccount.attributes');var integrations=require(_0xf6e6('0x8'));module['exports']=function(_0x579bbd,_0x1e82ca){return _0x579bbd[_0xf6e6('0x9')](_0xf6e6('0xa'),attributes,{'tableName':_0xf6e6('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 02ca2c3..e40ecaa 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(_0x29a29f,_0x155ce7){var _0x443ea3=function(_0xe0dd24){while(--_0xe0dd24){_0x29a29f['push'](_0x29a29f['shift']());}};_0x443ea3(++_0x155ce7);}(_0xbaf0,0x12a));var _0x0baf=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xbaf0[_0x465028];return _0xb783d4;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var moment=require(_0x0baf('0x1'));var BPromise=require(_0x0baf('0x2'));var rs=require(_0x0baf('0x3'));var fs=require('fs');var Redis=require(_0x0baf('0x4'));var db=require(_0x0baf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0baf('0x6'))(_0x0baf('0x7'));var config=require(_0x0baf('0x8'));var jayson=require(_0x0baf('0x9'));var client=jayson[_0x0baf('0xa')][_0x0baf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a10b1,_0x2dcaac,_0x1d0a0d){return new BPromise(function(_0x5f5030,_0x11b947){return client['request'](_0x1a10b1,_0x1d0a0d)[_0x0baf('0xc')](function(_0x2c7442){logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,_0x0baf('0xf'));logger[_0x0baf('0x10')](_0x0baf('0x11'),_0x2dcaac,_0x0baf('0xf'),JSON[_0x0baf('0x12')](_0x2c7442));if(_0x2c7442[_0x0baf('0x13')]){if(_0x2c7442[_0x0baf('0x13')]['code']===0x1f4){logger['error'](_0x0baf('0xe'),_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x11b947(_0x2c7442[_0x0baf('0x13')]['message']);}logger[_0x0baf('0x13')]('ZendeskAccount,\x20%s,\x20%s',_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x5f5030(_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);}else{logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,'request\x20sent');_0x5f5030(_0x2c7442['result'][_0x0baf('0x14')]);}})[_0x0baf('0x15')](function(_0x283408){logger[_0x0baf('0x13')](_0x0baf('0xe'),_0x2dcaac,_0x283408);_0x11b947(_0x283408);});});}exports[_0x0baf('0x16')]=function(_0x53c338){var _0x63c820=this;return new Promise(function(_0xfbecec,_0x1ef0e5){return db[_0x0baf('0x17')][_0x0baf('0x18')]({'raw':_0x53c338[_0x0baf('0x19')]?_0x53c338['options']['raw']===undefined?!![]:![]:!![],'where':_0x53c338[_0x0baf('0x19')]?_0x53c338[_0x0baf('0x19')][_0x0baf('0x1a')]||null:null,'attributes':_0x53c338[_0x0baf('0x19')]?_0x53c338[_0x0baf('0x19')][_0x0baf('0x1b')]||null:null,'limit':_0x53c338[_0x0baf('0x19')]?_0x53c338[_0x0baf('0x19')][_0x0baf('0x1c')]||null:null,'include':_0x53c338[_0x0baf('0x19')]?_0x53c338['options'][_0x0baf('0x1d')]?_['map'](_0x53c338[_0x0baf('0x19')]['include'],function(_0x4de74c){return{'model':db[_0x4de74c[_0x0baf('0x1e')]],'as':_0x4de74c['as'],'attributes':_0x4de74c['attributes'],'include':_0x4de74c['include']?_[_0x0baf('0x1f')](_0x4de74c[_0x0baf('0x1d')],function(_0x34e264){return{'model':db[_0x34e264[_0x0baf('0x1e')]],'as':_0x34e264['as'],'attributes':_0x34e264[_0x0baf('0x1b')],'include':_0x34e264['include']?_[_0x0baf('0x1f')](_0x34e264[_0x0baf('0x1d')],function(_0x1ca35a){return{'model':db[_0x1ca35a[_0x0baf('0x1e')]],'as':_0x1ca35a['as'],'attributes':_0x1ca35a[_0x0baf('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0baf('0xc')](function(_0x453525){logger['info'](_0x0baf('0x16'),_0x53c338);logger[_0x0baf('0x10')](_0x0baf('0x16'),_0x53c338,JSON[_0x0baf('0x12')](_0x453525));_0xfbecec(_0x453525);})['catch'](function(_0x29dbdf){logger[_0x0baf('0x13')]('GetZendeskAccount',_0x29dbdf[_0x0baf('0x14')],_0x53c338);_0x1ef0e5(_0x63c820[_0x0baf('0x13')](0x1f4,_0x29dbdf[_0x0baf('0x14')]));});});};exports[_0x0baf('0x20')]=function(_0xd14f0f){var _0x366924=this;return new Promise(function(_0x213a6a,_0x57476f){return db[_0x0baf('0x17')][_0x0baf('0x21')]({'raw':_0xd14f0f[_0x0baf('0x19')]?_0xd14f0f[_0x0baf('0x19')][_0x0baf('0x22')]===undefined?!![]:![]:!![],'where':_0xd14f0f[_0x0baf('0x19')]?_0xd14f0f[_0x0baf('0x19')][_0x0baf('0x1a')]||null:null,'attributes':_0xd14f0f[_0x0baf('0x19')]?_0xd14f0f[_0x0baf('0x19')][_0x0baf('0x1b')]||null:null,'include':_0xd14f0f[_0x0baf('0x19')]?_0xd14f0f[_0x0baf('0x19')][_0x0baf('0x1d')]?_['map'](_0xd14f0f[_0x0baf('0x19')]['include'],function(_0x1aa474){return{'model':db[_0x1aa474[_0x0baf('0x1e')]],'as':_0x1aa474['as'],'attributes':_0x1aa474[_0x0baf('0x1b')],'include':_0x1aa474[_0x0baf('0x1d')]?_['map'](_0x1aa474[_0x0baf('0x1d')],function(_0x1d6575){return{'model':db[_0x1d6575['model']],'as':_0x1d6575['as'],'attributes':_0x1d6575[_0x0baf('0x1b')],'include':_0x1d6575[_0x0baf('0x1d')]?_[_0x0baf('0x1f')](_0x1d6575[_0x0baf('0x1d')],function(_0x1f60bd){return{'model':db[_0x1f60bd[_0x0baf('0x1e')]],'as':_0x1f60bd['as'],'attributes':_0x1f60bd[_0x0baf('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0baf('0xc')](function(_0x4aa6ed){logger[_0x0baf('0xd')](_0x0baf('0x20'),_0xd14f0f);logger['debug'](_0x0baf('0x20'),_0xd14f0f,JSON['stringify'](_0x4aa6ed));_0x213a6a(_0x4aa6ed);})['catch'](function(_0x11bc49){logger[_0x0baf('0x13')]('ShowZendeskAccount',_0x11bc49['message'],_0xd14f0f);_0x57476f(_0x366924[_0x0baf('0x13')](0x1f4,_0x11bc49[_0x0baf('0x14')]));});});}; \ No newline at end of file +var _0x0713=['findAll','options','raw','attributes','limit','include','map','model','ShowZendeskAccount','where','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetZendeskAccount','ZendeskAccount'];(function(_0x3835ce,_0x486271){var _0x38f480=function(_0x56349c){while(--_0x56349c){_0x3835ce['push'](_0x3835ce['shift']());}};_0x38f480(++_0x486271);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('ZendeskAccount,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('ZendeskAccount,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('ZendeskAccount,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});}exports[_0x3071('0x18')]=function(_0x17dbda){var _0x1068d9=this;return new Promise(function(_0x108a83,_0x3acf0e){return db[_0x3071('0x19')][_0x3071('0x1a')]({'raw':_0x17dbda[_0x3071('0x1b')]?_0x17dbda['options'][_0x3071('0x1c')]===undefined?!![]:![]:!![],'where':_0x17dbda[_0x3071('0x1b')]?_0x17dbda[_0x3071('0x1b')]['where']||null:null,'attributes':_0x17dbda[_0x3071('0x1b')]?_0x17dbda['options'][_0x3071('0x1d')]||null:null,'limit':_0x17dbda[_0x3071('0x1b')]?_0x17dbda[_0x3071('0x1b')][_0x3071('0x1e')]||null:null,'include':_0x17dbda[_0x3071('0x1b')]?_0x17dbda[_0x3071('0x1b')][_0x3071('0x1f')]?_[_0x3071('0x20')](_0x17dbda['options']['include'],function(_0x2ce48a){return{'model':db[_0x2ce48a[_0x3071('0x21')]],'as':_0x2ce48a['as'],'attributes':_0x2ce48a[_0x3071('0x1d')],'include':_0x2ce48a[_0x3071('0x1f')]?_[_0x3071('0x20')](_0x2ce48a[_0x3071('0x1f')],function(_0x7a4cb4){return{'model':db[_0x7a4cb4[_0x3071('0x21')]],'as':_0x7a4cb4['as'],'attributes':_0x7a4cb4[_0x3071('0x1d')],'include':_0x7a4cb4['include']?_[_0x3071('0x20')](_0x7a4cb4[_0x3071('0x1f')],function(_0x177138){return{'model':db[_0x177138['model']],'as':_0x177138['as'],'attributes':_0x177138[_0x3071('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3071('0xc')](function(_0x163604){logger[_0x3071('0xd')](_0x3071('0x18'),_0x17dbda);logger[_0x3071('0x10')](_0x3071('0x18'),_0x17dbda,JSON[_0x3071('0x12')](_0x163604));_0x108a83(_0x163604);})[_0x3071('0x17')](function(_0x292205){logger[_0x3071('0x13')]('GetZendeskAccount',_0x292205['message'],_0x17dbda);_0x3acf0e(_0x1068d9[_0x3071('0x13')](0x1f4,_0x292205[_0x3071('0x15')]));});});};exports[_0x3071('0x22')]=function(_0x40be95){var _0x3f6d90=this;return new Promise(function(_0x29538c,_0x32b6b1){return db[_0x3071('0x19')]['find']({'raw':_0x40be95['options']?_0x40be95['options'][_0x3071('0x1c')]===undefined?!![]:![]:!![],'where':_0x40be95[_0x3071('0x1b')]?_0x40be95['options'][_0x3071('0x23')]||null:null,'attributes':_0x40be95[_0x3071('0x1b')]?_0x40be95[_0x3071('0x1b')][_0x3071('0x1d')]||null:null,'include':_0x40be95['options']?_0x40be95[_0x3071('0x1b')][_0x3071('0x1f')]?_[_0x3071('0x20')](_0x40be95[_0x3071('0x1b')][_0x3071('0x1f')],function(_0x2068ce){return{'model':db[_0x2068ce[_0x3071('0x21')]],'as':_0x2068ce['as'],'attributes':_0x2068ce[_0x3071('0x1d')],'include':_0x2068ce['include']?_[_0x3071('0x20')](_0x2068ce['include'],function(_0x4fb1ec){return{'model':db[_0x4fb1ec[_0x3071('0x21')]],'as':_0x4fb1ec['as'],'attributes':_0x4fb1ec[_0x3071('0x1d')],'include':_0x4fb1ec['include']?_[_0x3071('0x20')](_0x4fb1ec[_0x3071('0x1f')],function(_0x265d76){return{'model':db[_0x265d76[_0x3071('0x21')]],'as':_0x265d76['as'],'attributes':_0x265d76[_0x3071('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3071('0xc')](function(_0x5610ab){logger[_0x3071('0xd')](_0x3071('0x22'),_0x40be95);logger['debug'](_0x3071('0x22'),_0x40be95,JSON['stringify'](_0x5610ab));_0x29538c(_0x5610ab);})[_0x3071('0x17')](function(_0x43133a){logger['error']('ShowZendeskAccount',_0x43133a[_0x3071('0x15')],_0x40be95);_0x32b6b1(_0x3f6d90[_0x3071('0x13')](0x1f4,_0x43133a[_0x3071('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index ab0ed37..f0026f8 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 _0x2373=['isAuthenticated','/:id/fields','getFields','getSubjects','getDescriptions','getTags','post','create','setTags','put','update','delete','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2373,0xdb));var _0x3237=function(_0x1775a8,_0x1816c5){_0x1775a8=_0x1775a8-0x0;var _0x1ea6ad=_0x2373[_0x1775a8];return _0x1ea6ad;};'use strict';var multer=require(_0x3237('0x0'));var util=require('util');var path=require(_0x3237('0x1'));var timeout=require(_0x3237('0x2'));var express=require(_0x3237('0x3'));var router=express[_0x3237('0x4')]();var auth=require(_0x3237('0x5'));var interaction=require(_0x3237('0x6'));var config=require(_0x3237('0x7'));var controller=require('./intZendeskConfiguration.controller');router[_0x3237('0x8')]('/',auth['isAuthenticated'](),controller[_0x3237('0x9')]);router['get'](_0x3237('0xa'),auth[_0x3237('0xb')](),controller['show']);router['get'](_0x3237('0xc'),auth[_0x3237('0xb')](),controller[_0x3237('0xd')]);router[_0x3237('0x8')]('/:id/subjects',auth[_0x3237('0xb')](),controller[_0x3237('0xe')]);router[_0x3237('0x8')]('/:id/descriptions',auth[_0x3237('0xb')](),controller[_0x3237('0xf')]);router[_0x3237('0x8')]('/:id/tags',auth[_0x3237('0xb')](),controller[_0x3237('0x10')]);router[_0x3237('0x11')]('/',auth[_0x3237('0xb')](),controller[_0x3237('0x12')]);router[_0x3237('0x11')]('/:id/tags',auth[_0x3237('0xb')](),controller[_0x3237('0x13')]);router[_0x3237('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x3237('0x15')]);router[_0x3237('0x16')](_0x3237('0xa'),auth[_0x3237('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xed52=['delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','index','get','/:id','isAuthenticated','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','/:id/tags','getTags','post','create','setTags','update'];(function(_0x530086,_0x382014){var _0x4e29c2=function(_0x2bc473){while(--_0x2bc473){_0x530086['push'](_0x530086['shift']());}};_0x4e29c2(++_0x382014);}(_0xed52,0x9e));var _0x2ed5=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xed52[_0x2576d7];return _0x16a08c;};'use strict';var multer=require(_0x2ed5('0x0'));var util=require('util');var path=require(_0x2ed5('0x1'));var timeout=require(_0x2ed5('0x2'));var express=require(_0x2ed5('0x3'));var router=express[_0x2ed5('0x4')]();var auth=require(_0x2ed5('0x5'));var interaction=require(_0x2ed5('0x6'));var config=require(_0x2ed5('0x7'));var controller=require(_0x2ed5('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x2ed5('0x9')]);router[_0x2ed5('0xa')](_0x2ed5('0xb'),auth[_0x2ed5('0xc')](),controller['show']);router[_0x2ed5('0xa')](_0x2ed5('0xd'),auth[_0x2ed5('0xc')](),controller[_0x2ed5('0xe')]);router[_0x2ed5('0xa')](_0x2ed5('0xf'),auth['isAuthenticated'](),controller[_0x2ed5('0x10')]);router[_0x2ed5('0xa')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x2ed5('0x11')]);router['get'](_0x2ed5('0x12'),auth[_0x2ed5('0xc')](),controller[_0x2ed5('0x13')]);router[_0x2ed5('0x14')]('/',auth['isAuthenticated'](),controller[_0x2ed5('0x15')]);router['post'](_0x2ed5('0x12'),auth[_0x2ed5('0xc')](),controller[_0x2ed5('0x16')]);router['put'](_0x2ed5('0xb'),auth['isAuthenticated'](),controller[_0x2ed5('0x17')]);router[_0x2ed5('0x18')](_0x2ed5('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x2ed5('0x19')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index b190cf0..bc3a5b8 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 _0xe7ae=['STRING','sequelize','exports'];(function(_0x4ded27,_0x49a18c){var _0x105ecc=function(_0x471060){while(--_0x471060){_0x4ded27['push'](_0x4ded27['shift']());}};_0x105ecc(++_0x49a18c);}(_0xe7ae,0x76));var _0xee7a=function(_0x4b8b81,_0x34f111){_0x4b8b81=_0x4b8b81-0x0;var _0xed7d61=_0xe7ae[_0x4b8b81];return _0xed7d61;};'use strict';var Sequelize=require(_0xee7a('0x0'));module[_0xee7a('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xee7a('0x2')]}}; \ No newline at end of file +var _0x2294=['STRING','sequelize','exports'];(function(_0x54af39,_0x3fa808){var _0x45ea1b=function(_0x1cdd8b){while(--_0x1cdd8b){_0x54af39['push'](_0x54af39['shift']());}};_0x45ea1b(++_0x3fa808);}(_0x2294,0x1a8));var _0x4229=function(_0x5b80d3,_0x466713){_0x5b80d3=_0x5b80d3-0x0;var _0x12324f=_0x2294[_0x5b80d3];return _0x12324f;};'use strict';var Sequelize=require(_0x4229('0x0'));module[_0x4229('0x1')]={'name':{'type':Sequelize[_0x4229('0x2')]},'description':{'type':Sequelize[_0x4229('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 483d391..454a39f 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 _0x1261=['update','then','destroy','stack','name','send','index','map','ZendeskConfiguration','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','count','includeAll','findAll','rows','catch','show','include','create','body','find','params','getFields','findOne','where','options','getSubjects','ZendeskField','getDescriptions','Tag','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../mysqldb','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','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','ZendeskConfiguration,\x20%s,\x20%s','message','request\x20sent','sendStatus','status','offset','limit','set','apply','save'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x1261,0x144));var _0x1126=function(_0x3fea84,_0x3e832f){_0x3fea84=_0x3fea84-0x0;var _0x20778a=_0x1261[_0x3fea84];return _0x20778a;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1126('0x0'));var rimraf=require(_0x1126('0x1'));var zipdir=require(_0x1126('0x2'));var jsonpatch=require(_0x1126('0x3'));var rp=require(_0x1126('0x4'));var moment=require(_0x1126('0x5'));var BPromise=require(_0x1126('0x6'));var Mustache=require(_0x1126('0x7'));var util=require(_0x1126('0x8'));var path=require(_0x1126('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1126('0xa'));var fs=require('fs');var _=require(_0x1126('0xb'));var squel=require('squel');var crypto=require(_0x1126('0xc'));var jsforce=require(_0x1126('0xd'));var deskjs=require(_0x1126('0xe'));var toCsv=require(_0x1126('0xf'));var querystring=require(_0x1126('0x10'));var Papa=require('papaparse');var Redis=require(_0x1126('0x11'));var authService=require(_0x1126('0x12'));var qs=require(_0x1126('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1126('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x1126('0x15'));var config=require('../../config/environment');var db=require(_0x1126('0x16'))['db'];var jayson=require(_0x1126('0x17'));var client=jayson[_0x1126('0x18')][_0x1126('0x19')]({'port':0x232a});function checkPasswordPattern(_0xca0355,_0x3f10e9,_0xd8ca42){if(_0xd8ca42){var _0x2048ad=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2048ad[_0x1126('0x1a')](_0x3f10e9)){return _0xca0355;}else{throw new db['Sequelize']['ValidationError'](_0x1126('0x1b'));}}else{return _0xca0355;}}function respondWithRpcPromise(_0x154e20,_0x279455,_0x4be0c6,_0x45149c){return new BPromise(function(_0x4794a7,_0x35fe9f){var _0x42f379=_0x45149c||client;return _0x42f379[_0x1126('0x1c')](_0x154e20,_0x4be0c6)['then'](function(_0x245cd7){logger[_0x1126('0x1d')]('ZendeskConfiguration,\x20%s,\x20%s',_0x279455,'request\x20sent');logger[_0x1126('0x1e')](_0x1126('0x1f'),_0x279455,'request\x20sent',JSON['stringify'](_0x245cd7));if(_0x245cd7[_0x1126('0x20')]){if(_0x245cd7['error'][_0x1126('0x21')]===0x1f4){logger[_0x1126('0x20')](_0x1126('0x22'),_0x279455,_0x245cd7['error'][_0x1126('0x23')]);return _0x35fe9f(_0x245cd7['error']['message']);}logger[_0x1126('0x20')](_0x1126('0x22'),_0x279455,_0x245cd7[_0x1126('0x20')][_0x1126('0x23')]);return _0x4794a7(_0x245cd7['error'][_0x1126('0x23')]);}else{logger[_0x1126('0x1d')]('ZendeskConfiguration,\x20%s,\x20%s',_0x279455,_0x1126('0x24'));_0x4794a7(_0x245cd7['result']['message']);}})['catch'](function(_0x2199d9){logger[_0x1126('0x20')](_0x1126('0x22'),_0x279455,_0x2199d9);_0x35fe9f(_0x2199d9);});});}function respondWithStatusCode(_0x34bcf1,_0x566c09){_0x566c09=_0x566c09||0xcc;return function(_0x1b07a7){if(_0x1b07a7){return _0x34bcf1[_0x1126('0x25')](_0x566c09);}return _0x34bcf1[_0x1126('0x26')](_0x566c09)['end']();};}function respondWithResult(_0x35eec3,_0x375e59){_0x375e59=_0x375e59||0xc8;return function(_0xa293f4){if(_0xa293f4){return _0x35eec3['status'](_0x375e59)['json'](_0xa293f4);}};}function respondWithFilteredResult(_0xeb7d89,_0x39bf0e){return function(_0x55e195){if(_0x55e195){var _0x2fb797=_0x55e195['count'],_0x23d2bc=_0x39bf0e[_0x1126('0x27')],_0x4a334a=_0x39bf0e['offset']+_0x39bf0e[_0x1126('0x28')],_0x3fa694;if(_0x4a334a>=_0x2fb797){_0x4a334a=_0x2fb797;_0x3fa694=0xc8;}else{_0x3fa694=0xce;}_0xeb7d89['status'](_0x3fa694);return _0xeb7d89[_0x1126('0x29')]('Content-Range',_0x23d2bc+'-'+_0x4a334a+'/'+_0x2fb797)['json'](_0x55e195);}return null;};}function patchUpdates(_0x4a53ab){return function(_0x17646e){try{jsonpatch[_0x1126('0x2a')](_0x17646e,_0x4a53ab,!![]);}catch(_0x1cef48){return BPromise['reject'](_0x1cef48);}return _0x17646e[_0x1126('0x2b')]();};}function saveUpdates(_0x226afb,_0x56f7f8){return function(_0x3dd50e){if(_0x3dd50e){return _0x3dd50e[_0x1126('0x2c')](_0x226afb)[_0x1126('0x2d')](function(_0x29fbfa){return _0x29fbfa;});}return null;};}function removeEntity(_0x5836a2,_0x5ecbc3){return function(_0x2a7edc){if(_0x2a7edc){return _0x2a7edc[_0x1126('0x2e')]()[_0x1126('0x2d')](function(){_0x5836a2[_0x1126('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x145314,_0x6f4312){return function(_0x313ebe){if(!_0x313ebe){_0x145314[_0x1126('0x25')](0x194);}return _0x313ebe;};}function handleError(_0x3b0f79,_0x5df232){_0x5df232=_0x5df232||0x1f4;return function(_0x2a0dfe){logger[_0x1126('0x20')](_0x2a0dfe[_0x1126('0x2f')]);if(_0x2a0dfe[_0x1126('0x30')]){delete _0x2a0dfe['name'];}_0x3b0f79['status'](_0x5df232)[_0x1126('0x31')](_0x2a0dfe);};}exports[_0x1126('0x32')]=function(_0x511e6b,_0xde37cf){var _0xf3c21b={},_0x11b0f6={},_0x5c08b9={'count':0x0,'rows':[]};var _0x4b3859=_[_0x1126('0x33')](db[_0x1126('0x34')][_0x1126('0x35')],function(_0x156554){return{'name':_0x156554['fieldName'],'type':_0x156554[_0x1126('0x36')]['key']};});_0x11b0f6[_0x1126('0x37')]=_[_0x1126('0x33')](_0x4b3859,_0x1126('0x30'));_0x11b0f6[_0x1126('0x38')]=_[_0x1126('0x39')](_0x511e6b['query']);_0x11b0f6[_0x1126('0x3a')]=_[_0x1126('0x3b')](_0x11b0f6[_0x1126('0x37')],_0x11b0f6[_0x1126('0x38')]);_0xf3c21b[_0x1126('0x3c')]=_[_0x1126('0x3b')](_0x11b0f6[_0x1126('0x37')],qs['fields'](_0x511e6b[_0x1126('0x38')][_0x1126('0x3d')]));_0xf3c21b[_0x1126('0x3c')]=_0xf3c21b[_0x1126('0x3c')][_0x1126('0x3e')]?_0xf3c21b['attributes']:_0x11b0f6['model'];if(!_0x511e6b[_0x1126('0x38')][_0x1126('0x3f')](_0x1126('0x40'))){_0xf3c21b[_0x1126('0x28')]=qs[_0x1126('0x28')](_0x511e6b[_0x1126('0x38')]['limit']);_0xf3c21b['offset']=qs['offset'](_0x511e6b[_0x1126('0x38')]['offset']);}_0xf3c21b[_0x1126('0x41')]=qs[_0x1126('0x42')](_0x511e6b[_0x1126('0x38')][_0x1126('0x42')]);_0xf3c21b['where']=qs['filters'](_[_0x1126('0x43')](_0x511e6b[_0x1126('0x38')],_0x11b0f6[_0x1126('0x3a')]));if(_0x511e6b['query'][_0x1126('0x44')]){_0xf3c21b['where']=_[_0x1126('0x45')](_0xf3c21b['where'],{'$or':_[_0x1126('0x33')](_0x4b3859,function(_0xe178b4){if(_0xe178b4[_0x1126('0x36')]!=='VIRTUAL'){var _0xfaa3d8={};_0xfaa3d8[_0xe178b4[_0x1126('0x30')]]={'$like':'%'+_0x511e6b[_0x1126('0x38')]['filter']+'%'};return _0xfaa3d8;}})});}_0xf3c21b=_['merge']({},_0xf3c21b,_0x511e6b['options']);var _0x6e78cf={'where':_0xf3c21b['where']};return db[_0x1126('0x34')]['count'](_0x6e78cf)[_0x1126('0x2d')](function(_0x323499){_0x5c08b9[_0x1126('0x46')]=_0x323499;if(_0x511e6b[_0x1126('0x38')][_0x1126('0x47')]){_0xf3c21b['include']=[{'all':!![]}];}return db[_0x1126('0x34')][_0x1126('0x48')](_0xf3c21b);})['then'](function(_0x1a15f8){_0x5c08b9[_0x1126('0x49')]=_0x1a15f8;return _0x5c08b9;})['then'](respondWithFilteredResult(_0xde37cf,_0xf3c21b))[_0x1126('0x4a')](handleError(_0xde37cf,null));};exports[_0x1126('0x4b')]=function(_0x518e0a,_0x3e4eeb){var _0xbdde58={'raw':![],'where':{'id':_0x518e0a['params']['id']}},_0x213a76={};_0x213a76[_0x1126('0x37')]=_[_0x1126('0x39')](db[_0x1126('0x34')][_0x1126('0x35')]);_0x213a76[_0x1126('0x38')]=_[_0x1126('0x39')](_0x518e0a[_0x1126('0x38')]);_0x213a76[_0x1126('0x3a')]=_['intersection'](_0x213a76[_0x1126('0x37')],_0x213a76['query']);_0xbdde58[_0x1126('0x3c')]=_[_0x1126('0x3b')](_0x213a76['model'],qs['fields'](_0x518e0a[_0x1126('0x38')][_0x1126('0x3d')]));_0xbdde58[_0x1126('0x3c')]=_0xbdde58['attributes'][_0x1126('0x3e')]?_0xbdde58[_0x1126('0x3c')]:_0x213a76[_0x1126('0x37')];if(_0x518e0a[_0x1126('0x38')]['includeAll']){_0xbdde58[_0x1126('0x4c')]=[{'all':!![]}];}_0xbdde58=_[_0x1126('0x45')]({},_0xbdde58,_0x518e0a['options']);return db['ZendeskConfiguration']['find'](_0xbdde58)['then'](handleEntityNotFound(_0x3e4eeb,null))[_0x1126('0x2d')](respondWithResult(_0x3e4eeb,null))[_0x1126('0x4a')](handleError(_0x3e4eeb,null));};exports['create']=function(_0x16552b,_0x1c7a2b){return db[_0x1126('0x34')][_0x1126('0x4d')](_0x16552b[_0x1126('0x4e')],{})['then'](respondWithResult(_0x1c7a2b,0xc9))[_0x1126('0x4a')](handleError(_0x1c7a2b,null));};exports[_0x1126('0x2c')]=function(_0x5d6414,_0x322016){if(_0x5d6414[_0x1126('0x4e')]['id']){delete _0x5d6414[_0x1126('0x4e')]['id'];}return db[_0x1126('0x34')][_0x1126('0x4f')]({'where':{'id':_0x5d6414['params']['id']}})[_0x1126('0x2d')](handleEntityNotFound(_0x322016,null))['then'](saveUpdates(_0x5d6414[_0x1126('0x4e')],null))[_0x1126('0x2d')](respondWithResult(_0x322016,null))[_0x1126('0x4a')](handleError(_0x322016,null));};exports['destroy']=function(_0x427add,_0x2340f8){return db['ZendeskConfiguration'][_0x1126('0x4f')]({'where':{'id':_0x427add[_0x1126('0x50')]['id']}})[_0x1126('0x2d')](handleEntityNotFound(_0x2340f8,null))['then'](removeEntity(_0x2340f8,null))[_0x1126('0x4a')](handleError(_0x2340f8,null));};exports[_0x1126('0x51')]=function(_0x22ab18,_0x308ee4,_0x128c94){var _0x26949c={};var _0x30c848={};var _0x114be2;var _0x47e53d;return db[_0x1126('0x34')][_0x1126('0x52')]({'where':{'id':_0x22ab18[_0x1126('0x50')]['id']}})[_0x1126('0x2d')](handleEntityNotFound(_0x308ee4,null))[_0x1126('0x2d')](function(_0x4f5772){if(_0x4f5772){_0x114be2=_0x4f5772;_0x30c848[_0x1126('0x37')]=_[_0x1126('0x39')](db['ZendeskField'][_0x1126('0x35')]);_0x30c848['query']=_[_0x1126('0x39')](_0x22ab18[_0x1126('0x38')]);_0x30c848['filters']=_[_0x1126('0x3b')](_0x30c848[_0x1126('0x37')],_0x30c848[_0x1126('0x38')]);_0x26949c['attributes']=_[_0x1126('0x3b')](_0x30c848['model'],qs['fields'](_0x22ab18[_0x1126('0x38')][_0x1126('0x3d')]));_0x26949c[_0x1126('0x3c')]=_0x26949c[_0x1126('0x3c')][_0x1126('0x3e')]?_0x26949c[_0x1126('0x3c')]:_0x30c848[_0x1126('0x37')];_0x26949c['order']=qs[_0x1126('0x42')](_0x22ab18[_0x1126('0x38')][_0x1126('0x42')]);_0x26949c[_0x1126('0x53')]=qs[_0x1126('0x3a')](_[_0x1126('0x43')](_0x22ab18['query'],_0x30c848['filters']));if(_0x22ab18[_0x1126('0x38')][_0x1126('0x44')]){_0x26949c['where']=_['merge'](_0x26949c['where'],{'$or':_['map'](_0x26949c[_0x1126('0x3c')],function(_0x37b1ab){var _0x3440c5={};_0x3440c5[_0x37b1ab]={'$like':'%'+_0x22ab18['query'][_0x1126('0x44')]+'%'};return _0x3440c5;})});}_0x26949c=_[_0x1126('0x45')]({},_0x26949c,_0x22ab18[_0x1126('0x54')]);return _0x114be2[_0x1126('0x51')](_0x26949c);}})[_0x1126('0x2d')](function(_0x3f007b){if(_0x3f007b){_0x47e53d=_0x3f007b[_0x1126('0x3e')];if(!_0x22ab18['query'][_0x1126('0x3f')](_0x1126('0x40'))){_0x26949c[_0x1126('0x28')]=qs[_0x1126('0x28')](_0x22ab18[_0x1126('0x38')]['limit']);_0x26949c['offset']=qs[_0x1126('0x27')](_0x22ab18[_0x1126('0x38')]['offset']);}return _0x114be2[_0x1126('0x51')](_0x26949c);}})[_0x1126('0x2d')](function(_0x366675){if(_0x366675){return _0x366675?{'count':_0x47e53d,'rows':_0x366675}:null;}})[_0x1126('0x2d')](respondWithResult(_0x308ee4,null))[_0x1126('0x4a')](handleError(_0x308ee4,null));};exports[_0x1126('0x55')]=function(_0x41ce78,_0x247f12,_0xd20fbe){var _0x3d5e15={};var _0x16e48a={};var _0x1228cf;var _0x3dad39;return db['ZendeskConfiguration'][_0x1126('0x52')]({'where':{'id':_0x41ce78[_0x1126('0x50')]['id']}})[_0x1126('0x2d')](handleEntityNotFound(_0x247f12,null))['then'](function(_0x484881){if(_0x484881){_0x1228cf=_0x484881;_0x16e48a[_0x1126('0x37')]=_[_0x1126('0x39')](db[_0x1126('0x56')][_0x1126('0x35')]);_0x16e48a['query']=_['keys'](_0x41ce78['query']);_0x16e48a[_0x1126('0x3a')]=_[_0x1126('0x3b')](_0x16e48a[_0x1126('0x37')],_0x16e48a[_0x1126('0x38')]);_0x3d5e15['attributes']=_[_0x1126('0x3b')](_0x16e48a['model'],qs[_0x1126('0x3d')](_0x41ce78[_0x1126('0x38')][_0x1126('0x3d')]));_0x3d5e15[_0x1126('0x3c')]=_0x3d5e15[_0x1126('0x3c')][_0x1126('0x3e')]?_0x3d5e15[_0x1126('0x3c')]:_0x16e48a['model'];_0x3d5e15[_0x1126('0x41')]=qs['sort'](_0x41ce78[_0x1126('0x38')][_0x1126('0x42')]);_0x3d5e15['where']=qs[_0x1126('0x3a')](_[_0x1126('0x43')](_0x41ce78['query'],_0x16e48a[_0x1126('0x3a')]));if(_0x41ce78[_0x1126('0x38')]['filter']){_0x3d5e15['where']=_[_0x1126('0x45')](_0x3d5e15[_0x1126('0x53')],{'$or':_[_0x1126('0x33')](_0x3d5e15['attributes'],function(_0x4d007b){var _0x4b0fab={};_0x4b0fab[_0x4d007b]={'$like':'%'+_0x41ce78[_0x1126('0x38')]['filter']+'%'};return _0x4b0fab;})});}_0x3d5e15=_['merge']({},_0x3d5e15,_0x41ce78[_0x1126('0x54')]);return _0x1228cf['getSubjects'](_0x3d5e15);}})[_0x1126('0x2d')](function(_0x288a0c){if(_0x288a0c){_0x3dad39=_0x288a0c['length'];if(!_0x41ce78[_0x1126('0x38')][_0x1126('0x3f')](_0x1126('0x40'))){_0x3d5e15[_0x1126('0x28')]=qs[_0x1126('0x28')](_0x41ce78['query'][_0x1126('0x28')]);_0x3d5e15[_0x1126('0x27')]=qs['offset'](_0x41ce78[_0x1126('0x38')][_0x1126('0x27')]);}return _0x1228cf[_0x1126('0x55')](_0x3d5e15);}})[_0x1126('0x2d')](function(_0x2598a7){if(_0x2598a7){return _0x2598a7?{'count':_0x3dad39,'rows':_0x2598a7}:null;}})[_0x1126('0x2d')](respondWithResult(_0x247f12,null))[_0x1126('0x4a')](handleError(_0x247f12,null));};exports[_0x1126('0x57')]=function(_0xeaf964,_0x9a2af0,_0xbe2a8f){var _0x3af321={};var _0x2010a9={};var _0x3b5384;var _0x8bfa0;return db[_0x1126('0x34')]['findOne']({'where':{'id':_0xeaf964[_0x1126('0x50')]['id']}})[_0x1126('0x2d')](handleEntityNotFound(_0x9a2af0,null))[_0x1126('0x2d')](function(_0x1483f4){if(_0x1483f4){_0x3b5384=_0x1483f4;_0x2010a9[_0x1126('0x37')]=_['keys'](db[_0x1126('0x56')]['rawAttributes']);_0x2010a9['query']=_[_0x1126('0x39')](_0xeaf964[_0x1126('0x38')]);_0x2010a9['filters']=_['intersection'](_0x2010a9[_0x1126('0x37')],_0x2010a9[_0x1126('0x38')]);_0x3af321[_0x1126('0x3c')]=_[_0x1126('0x3b')](_0x2010a9[_0x1126('0x37')],qs[_0x1126('0x3d')](_0xeaf964[_0x1126('0x38')][_0x1126('0x3d')]));_0x3af321[_0x1126('0x3c')]=_0x3af321['attributes'][_0x1126('0x3e')]?_0x3af321[_0x1126('0x3c')]:_0x2010a9[_0x1126('0x37')];_0x3af321[_0x1126('0x41')]=qs[_0x1126('0x42')](_0xeaf964[_0x1126('0x38')]['sort']);_0x3af321[_0x1126('0x53')]=qs[_0x1126('0x3a')](_[_0x1126('0x43')](_0xeaf964[_0x1126('0x38')],_0x2010a9[_0x1126('0x3a')]));if(_0xeaf964[_0x1126('0x38')][_0x1126('0x44')]){_0x3af321[_0x1126('0x53')]=_[_0x1126('0x45')](_0x3af321[_0x1126('0x53')],{'$or':_['map'](_0x3af321['attributes'],function(_0x271d7c){var _0x55496f={};_0x55496f[_0x271d7c]={'$like':'%'+_0xeaf964[_0x1126('0x38')]['filter']+'%'};return _0x55496f;})});}_0x3af321=_[_0x1126('0x45')]({},_0x3af321,_0xeaf964['options']);return _0x3b5384[_0x1126('0x57')](_0x3af321);}})['then'](function(_0x5c5044){if(_0x5c5044){_0x8bfa0=_0x5c5044['length'];if(!_0xeaf964[_0x1126('0x38')][_0x1126('0x3f')]('nolimit')){_0x3af321['limit']=qs[_0x1126('0x28')](_0xeaf964[_0x1126('0x38')][_0x1126('0x28')]);_0x3af321['offset']=qs['offset'](_0xeaf964[_0x1126('0x38')]['offset']);}return _0x3b5384[_0x1126('0x57')](_0x3af321);}})[_0x1126('0x2d')](function(_0x41c7f8){if(_0x41c7f8){return _0x41c7f8?{'count':_0x8bfa0,'rows':_0x41c7f8}:null;}})[_0x1126('0x2d')](respondWithResult(_0x9a2af0,null))[_0x1126('0x4a')](handleError(_0x9a2af0,null));};exports['getTags']=function(_0x591c75,_0x5ae7ac,_0xd808db){var _0xfc9fb4={};var _0x3758fa={};var _0x1b8218;var _0x23bd79;return db[_0x1126('0x34')][_0x1126('0x52')]({'where':{'id':_0x591c75[_0x1126('0x50')]['id']}})[_0x1126('0x2d')](handleEntityNotFound(_0x5ae7ac,null))[_0x1126('0x2d')](function(_0x5119a1){if(_0x5119a1){_0x1b8218=_0x5119a1;_0x3758fa[_0x1126('0x37')]=_['keys'](db[_0x1126('0x58')]['rawAttributes']);_0x3758fa[_0x1126('0x38')]=_[_0x1126('0x39')](_0x591c75[_0x1126('0x38')]);_0x3758fa[_0x1126('0x3a')]=_['intersection'](_0x3758fa[_0x1126('0x37')],_0x3758fa[_0x1126('0x38')]);_0xfc9fb4['attributes']=_['intersection'](_0x3758fa[_0x1126('0x37')],qs[_0x1126('0x3d')](_0x591c75[_0x1126('0x38')]['fields']));_0xfc9fb4[_0x1126('0x3c')]=_0xfc9fb4['attributes'][_0x1126('0x3e')]?_0xfc9fb4[_0x1126('0x3c')]:_0x3758fa['model'];_0xfc9fb4[_0x1126('0x41')]=qs[_0x1126('0x42')](_0x591c75[_0x1126('0x38')][_0x1126('0x42')]);_0xfc9fb4[_0x1126('0x53')]=qs['filters'](_[_0x1126('0x43')](_0x591c75[_0x1126('0x38')],_0x3758fa[_0x1126('0x3a')]));if(_0x591c75['query']['filter']){_0xfc9fb4['where']=_[_0x1126('0x45')](_0xfc9fb4[_0x1126('0x53')],{'$or':_[_0x1126('0x33')](_0xfc9fb4[_0x1126('0x3c')],function(_0x4fcca3){var _0x101553={};_0x101553[_0x4fcca3]={'$like':'%'+_0x591c75[_0x1126('0x38')][_0x1126('0x44')]+'%'};return _0x101553;})});}_0xfc9fb4=_[_0x1126('0x45')]({},_0xfc9fb4,_0x591c75[_0x1126('0x54')]);return _0x1b8218['getTags'](_0xfc9fb4);}})[_0x1126('0x2d')](function(_0x21c487){if(_0x21c487){_0x23bd79=_0x21c487['length'];if(!_0x591c75[_0x1126('0x38')]['hasOwnProperty']('nolimit')){_0xfc9fb4[_0x1126('0x28')]=qs['limit'](_0x591c75[_0x1126('0x38')][_0x1126('0x28')]);_0xfc9fb4[_0x1126('0x27')]=qs[_0x1126('0x27')](_0x591c75[_0x1126('0x38')][_0x1126('0x27')]);}return _0x1b8218[_0x1126('0x59')](_0xfc9fb4);}})[_0x1126('0x2d')](function(_0x3762e0){if(_0x3762e0){return _0x3762e0?{'count':_0x23bd79,'rows':_0x3762e0}:null;}})['then'](respondWithResult(_0x5ae7ac,null))[_0x1126('0x4a')](handleError(_0x5ae7ac,null));};exports[_0x1126('0x5a')]=function(_0x1cda9d,_0x369447,_0x5a96ee){if(_0x1cda9d[_0x1126('0x4e')]['id']){delete _0x1cda9d[_0x1126('0x4e')]['id'];}return db[_0x1126('0x34')][_0x1126('0x52')]({'where':{'id':_0x1cda9d['params']['id']}})['then'](handleEntityNotFound(_0x369447,null))['then'](function(_0x3229ee){if(_0x3229ee){return _0x3229ee['setTags'](_0x1cda9d[_0x1126('0x4e')][_0x1126('0x5b')]||[]);}return null;})['then'](respondWithResult(_0x369447,null))['catch'](handleError(_0x369447,null));}; \ No newline at end of file +var _0xe14b=['code','message','sendStatus','status','count','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','name','map','ZendeskConfiguration','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','find','catch','body','getFields','findOne','ZendeskField','order','getSubjects','getDescriptions','getTags','Tag','setTags','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','jayson/promise','client','http','test','Sequelize','ValidationError','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe14b,0x93));var _0xbe14=function(_0x13c53d,_0x110207){_0x13c53d=_0x13c53d-0x0;var _0x49fcf4=_0xe14b[_0x13c53d];return _0x49fcf4;};'use strict';var pdf=require(_0xbe14('0x0'));var emlformat=require(_0xbe14('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xbe14('0x2'));var rp=require(_0xbe14('0x3'));var moment=require('moment');var BPromise=require(_0xbe14('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xbe14('0x5'));var sox=require(_0xbe14('0x6'));var csv=require(_0xbe14('0x7'));var ejs=require(_0xbe14('0x8'));var fs=require('fs');var _=require(_0xbe14('0x9'));var squel=require(_0xbe14('0xa'));var crypto=require(_0xbe14('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbe14('0xc'));var Papa=require(_0xbe14('0xd'));var Redis=require(_0xbe14('0xe'));var authService=require(_0xbe14('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbe14('0x10'));var logger=require(_0xbe14('0x11'))('api');var utils=require(_0xbe14('0x12'));var config=require(_0xbe14('0x13'));var db=require(_0xbe14('0x14'))['db'];var jayson=require(_0xbe14('0x15'));var client=jayson[_0xbe14('0x16')][_0xbe14('0x17')]({'port':0x232a});function checkPasswordPattern(_0x23a730,_0x2850cb,_0x16893f){if(_0x16893f){var _0xa2cf72=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xa2cf72[_0xbe14('0x18')](_0x2850cb)){return _0x23a730;}else{throw new db[(_0xbe14('0x19'))][(_0xbe14('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 _0x23a730;}}function respondWithRpcPromise(_0x55b3a7,_0x3f58f5,_0x3dc4a9,_0xf4ac9){return new BPromise(function(_0x37ce4e,_0x4e8f34){var _0x21c789=_0xf4ac9||client;return _0x21c789[_0xbe14('0x1b')](_0x55b3a7,_0x3dc4a9)[_0xbe14('0x1c')](function(_0x123ede){logger[_0xbe14('0x1d')](_0xbe14('0x1e'),_0x3f58f5,_0xbe14('0x1f'));logger['debug'](_0xbe14('0x20'),_0x3f58f5,_0xbe14('0x1f'),JSON[_0xbe14('0x21')](_0x123ede));if(_0x123ede[_0xbe14('0x22')]){if(_0x123ede[_0xbe14('0x22')][_0xbe14('0x23')]===0x1f4){logger['error'](_0xbe14('0x1e'),_0x3f58f5,_0x123ede[_0xbe14('0x22')][_0xbe14('0x24')]);return _0x4e8f34(_0x123ede[_0xbe14('0x22')][_0xbe14('0x24')]);}logger['error'](_0xbe14('0x1e'),_0x3f58f5,_0x123ede['error'][_0xbe14('0x24')]);return _0x37ce4e(_0x123ede['error'][_0xbe14('0x24')]);}else{logger['info'](_0xbe14('0x1e'),_0x3f58f5,_0xbe14('0x1f'));_0x37ce4e(_0x123ede['result'][_0xbe14('0x24')]);}})['catch'](function(_0x4587a8){logger['error'](_0xbe14('0x1e'),_0x3f58f5,_0x4587a8);_0x4e8f34(_0x4587a8);});});}function respondWithStatusCode(_0x5fa043,_0x1ee9c1){_0x1ee9c1=_0x1ee9c1||0xcc;return function(_0x39cc81){if(_0x39cc81){return _0x5fa043[_0xbe14('0x25')](_0x1ee9c1);}return _0x5fa043[_0xbe14('0x26')](_0x1ee9c1)['end']();};}function respondWithResult(_0x1822e0,_0x1ba46a){_0x1ba46a=_0x1ba46a||0xc8;return function(_0x391556){if(_0x391556){return _0x1822e0[_0xbe14('0x26')](_0x1ba46a)['json'](_0x391556);}};}function respondWithFilteredResult(_0x16f884,_0x29fc64){return function(_0x59bf34){if(_0x59bf34){var _0x3c3613=_0x59bf34[_0xbe14('0x27')],_0x3b3e84=_0x29fc64[_0xbe14('0x28')],_0x1c7cc7=_0x29fc64[_0xbe14('0x28')]+_0x29fc64[_0xbe14('0x29')],_0x19252f;if(_0x1c7cc7>=_0x3c3613){_0x1c7cc7=_0x3c3613;_0x19252f=0xc8;}else{_0x19252f=0xce;}_0x16f884[_0xbe14('0x26')](_0x19252f);return _0x16f884[_0xbe14('0x2a')](_0xbe14('0x2b'),_0x3b3e84+'-'+_0x1c7cc7+'/'+_0x3c3613)[_0xbe14('0x2c')](_0x59bf34);}return null;};}function patchUpdates(_0x39dc0a){return function(_0x10ae36){try{jsonpatch[_0xbe14('0x2d')](_0x10ae36,_0x39dc0a,!![]);}catch(_0xe6feb2){return BPromise[_0xbe14('0x2e')](_0xe6feb2);}return _0x10ae36[_0xbe14('0x2f')]();};}function saveUpdates(_0x29e76a,_0x14e7c4){return function(_0x581e86){if(_0x581e86){return _0x581e86[_0xbe14('0x30')](_0x29e76a)['then'](function(_0x58f8de){return _0x58f8de;});}return null;};}function removeEntity(_0x46c2d1,_0x4c1e7e){return function(_0x243524){if(_0x243524){return _0x243524[_0xbe14('0x31')]()['then'](function(){_0x46c2d1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x412ad5,_0xa3d24){return function(_0x5f27b6){if(!_0x5f27b6){_0x412ad5[_0xbe14('0x25')](0x194);}return _0x5f27b6;};}function handleError(_0x1faf3e,_0x452635){_0x452635=_0x452635||0x1f4;return function(_0x1aa849){logger[_0xbe14('0x22')](_0x1aa849['stack']);if(_0x1aa849['name']){delete _0x1aa849[_0xbe14('0x32')];}_0x1faf3e['status'](_0x452635)['send'](_0x1aa849);};}exports['index']=function(_0x163ef7,_0x393f6b){var _0x2bb45={},_0x3dbacb={},_0x172e79={'count':0x0,'rows':[]};var _0x29356f=_[_0xbe14('0x33')](db[_0xbe14('0x34')][_0xbe14('0x35')],function(_0x2dfd5a){return{'name':_0x2dfd5a[_0xbe14('0x36')],'type':_0x2dfd5a[_0xbe14('0x37')]['key']};});_0x3dbacb['model']=_[_0xbe14('0x33')](_0x29356f,_0xbe14('0x32'));_0x3dbacb[_0xbe14('0x38')]=_['keys'](_0x163ef7[_0xbe14('0x38')]);_0x3dbacb[_0xbe14('0x39')]=_[_0xbe14('0x3a')](_0x3dbacb[_0xbe14('0x3b')],_0x3dbacb[_0xbe14('0x38')]);_0x2bb45[_0xbe14('0x3c')]=_[_0xbe14('0x3a')](_0x3dbacb[_0xbe14('0x3b')],qs[_0xbe14('0x3d')](_0x163ef7['query'][_0xbe14('0x3d')]));_0x2bb45[_0xbe14('0x3c')]=_0x2bb45[_0xbe14('0x3c')][_0xbe14('0x3e')]?_0x2bb45[_0xbe14('0x3c')]:_0x3dbacb[_0xbe14('0x3b')];if(!_0x163ef7['query'][_0xbe14('0x3f')](_0xbe14('0x40'))){_0x2bb45[_0xbe14('0x29')]=qs[_0xbe14('0x29')](_0x163ef7['query']['limit']);_0x2bb45[_0xbe14('0x28')]=qs[_0xbe14('0x28')](_0x163ef7[_0xbe14('0x38')]['offset']);}_0x2bb45['order']=qs[_0xbe14('0x41')](_0x163ef7['query']['sort']);_0x2bb45[_0xbe14('0x42')]=qs[_0xbe14('0x39')](_[_0xbe14('0x43')](_0x163ef7['query'],_0x3dbacb['filters']));if(_0x163ef7['query'][_0xbe14('0x44')]){_0x2bb45[_0xbe14('0x42')]=_[_0xbe14('0x45')](_0x2bb45['where'],{'$or':_[_0xbe14('0x33')](_0x29356f,function(_0xcb0680){if(_0xcb0680[_0xbe14('0x37')]!==_0xbe14('0x46')){var _0x58351f={};_0x58351f[_0xcb0680['name']]={'$like':'%'+_0x163ef7[_0xbe14('0x38')][_0xbe14('0x44')]+'%'};return _0x58351f;}})});}_0x2bb45=_[_0xbe14('0x45')]({},_0x2bb45,_0x163ef7[_0xbe14('0x47')]);var _0x2550dc={'where':_0x2bb45['where']};return db['ZendeskConfiguration'][_0xbe14('0x27')](_0x2550dc)[_0xbe14('0x1c')](function(_0x238c60){_0x172e79[_0xbe14('0x27')]=_0x238c60;if(_0x163ef7['query'][_0xbe14('0x48')]){_0x2bb45[_0xbe14('0x49')]=[{'all':!![]}];}return db['ZendeskConfiguration'][_0xbe14('0x4a')](_0x2bb45);})[_0xbe14('0x1c')](function(_0x2d6ee8){_0x172e79[_0xbe14('0x4b')]=_0x2d6ee8;return _0x172e79;})['then'](respondWithFilteredResult(_0x393f6b,_0x2bb45))['catch'](handleError(_0x393f6b,null));};exports[_0xbe14('0x4c')]=function(_0x29564b,_0x4a1a37){var _0x5acf90={'raw':![],'where':{'id':_0x29564b[_0xbe14('0x4d')]['id']}},_0xca8cdb={};_0xca8cdb[_0xbe14('0x3b')]=_[_0xbe14('0x4e')](db[_0xbe14('0x34')][_0xbe14('0x35')]);_0xca8cdb[_0xbe14('0x38')]=_['keys'](_0x29564b[_0xbe14('0x38')]);_0xca8cdb[_0xbe14('0x39')]=_[_0xbe14('0x3a')](_0xca8cdb[_0xbe14('0x3b')],_0xca8cdb[_0xbe14('0x38')]);_0x5acf90['attributes']=_[_0xbe14('0x3a')](_0xca8cdb[_0xbe14('0x3b')],qs[_0xbe14('0x3d')](_0x29564b[_0xbe14('0x38')][_0xbe14('0x3d')]));_0x5acf90[_0xbe14('0x3c')]=_0x5acf90['attributes']['length']?_0x5acf90[_0xbe14('0x3c')]:_0xca8cdb[_0xbe14('0x3b')];if(_0x29564b[_0xbe14('0x38')]['includeAll']){_0x5acf90['include']=[{'all':!![]}];}_0x5acf90=_[_0xbe14('0x45')]({},_0x5acf90,_0x29564b[_0xbe14('0x47')]);return db['ZendeskConfiguration'][_0xbe14('0x4f')](_0x5acf90)[_0xbe14('0x1c')](handleEntityNotFound(_0x4a1a37,null))['then'](respondWithResult(_0x4a1a37,null))[_0xbe14('0x50')](handleError(_0x4a1a37,null));};exports['create']=function(_0x41ba58,_0x410c59){return db[_0xbe14('0x34')]['create'](_0x41ba58[_0xbe14('0x51')],{})[_0xbe14('0x1c')](respondWithResult(_0x410c59,0xc9))['catch'](handleError(_0x410c59,null));};exports[_0xbe14('0x30')]=function(_0x42ca15,_0x2210cc){if(_0x42ca15[_0xbe14('0x51')]['id']){delete _0x42ca15[_0xbe14('0x51')]['id'];}return db['ZendeskConfiguration'][_0xbe14('0x4f')]({'where':{'id':_0x42ca15[_0xbe14('0x4d')]['id']}})[_0xbe14('0x1c')](handleEntityNotFound(_0x2210cc,null))[_0xbe14('0x1c')](saveUpdates(_0x42ca15[_0xbe14('0x51')],null))[_0xbe14('0x1c')](respondWithResult(_0x2210cc,null))[_0xbe14('0x50')](handleError(_0x2210cc,null));};exports['destroy']=function(_0x72c875,_0x1b47a4){return db[_0xbe14('0x34')][_0xbe14('0x4f')]({'where':{'id':_0x72c875[_0xbe14('0x4d')]['id']}})[_0xbe14('0x1c')](handleEntityNotFound(_0x1b47a4,null))[_0xbe14('0x1c')](removeEntity(_0x1b47a4,null))[_0xbe14('0x50')](handleError(_0x1b47a4,null));};exports[_0xbe14('0x52')]=function(_0xc61103,_0x358950,_0x4bccfc){var _0x56bcd3={};var _0x58dd79={};var _0x10c0bc;var _0x1bfcbf;return db[_0xbe14('0x34')][_0xbe14('0x53')]({'where':{'id':_0xc61103[_0xbe14('0x4d')]['id']}})[_0xbe14('0x1c')](handleEntityNotFound(_0x358950,null))[_0xbe14('0x1c')](function(_0x22bf69){if(_0x22bf69){_0x10c0bc=_0x22bf69;_0x58dd79[_0xbe14('0x3b')]=_[_0xbe14('0x4e')](db[_0xbe14('0x54')][_0xbe14('0x35')]);_0x58dd79[_0xbe14('0x38')]=_[_0xbe14('0x4e')](_0xc61103[_0xbe14('0x38')]);_0x58dd79[_0xbe14('0x39')]=_[_0xbe14('0x3a')](_0x58dd79[_0xbe14('0x3b')],_0x58dd79[_0xbe14('0x38')]);_0x56bcd3[_0xbe14('0x3c')]=_['intersection'](_0x58dd79[_0xbe14('0x3b')],qs[_0xbe14('0x3d')](_0xc61103[_0xbe14('0x38')][_0xbe14('0x3d')]));_0x56bcd3[_0xbe14('0x3c')]=_0x56bcd3[_0xbe14('0x3c')][_0xbe14('0x3e')]?_0x56bcd3[_0xbe14('0x3c')]:_0x58dd79[_0xbe14('0x3b')];_0x56bcd3[_0xbe14('0x55')]=qs['sort'](_0xc61103[_0xbe14('0x38')][_0xbe14('0x41')]);_0x56bcd3[_0xbe14('0x42')]=qs[_0xbe14('0x39')](_[_0xbe14('0x43')](_0xc61103['query'],_0x58dd79[_0xbe14('0x39')]));if(_0xc61103[_0xbe14('0x38')][_0xbe14('0x44')]){_0x56bcd3[_0xbe14('0x42')]=_[_0xbe14('0x45')](_0x56bcd3['where'],{'$or':_[_0xbe14('0x33')](_0x56bcd3[_0xbe14('0x3c')],function(_0x7ea146){var _0x29bb26={};_0x29bb26[_0x7ea146]={'$like':'%'+_0xc61103[_0xbe14('0x38')][_0xbe14('0x44')]+'%'};return _0x29bb26;})});}_0x56bcd3=_[_0xbe14('0x45')]({},_0x56bcd3,_0xc61103[_0xbe14('0x47')]);return _0x10c0bc['getFields'](_0x56bcd3);}})[_0xbe14('0x1c')](function(_0x33c309){if(_0x33c309){_0x1bfcbf=_0x33c309[_0xbe14('0x3e')];if(!_0xc61103[_0xbe14('0x38')][_0xbe14('0x3f')](_0xbe14('0x40'))){_0x56bcd3[_0xbe14('0x29')]=qs['limit'](_0xc61103['query'][_0xbe14('0x29')]);_0x56bcd3[_0xbe14('0x28')]=qs[_0xbe14('0x28')](_0xc61103[_0xbe14('0x38')][_0xbe14('0x28')]);}return _0x10c0bc[_0xbe14('0x52')](_0x56bcd3);}})[_0xbe14('0x1c')](function(_0x43511e){if(_0x43511e){return _0x43511e?{'count':_0x1bfcbf,'rows':_0x43511e}:null;}})['then'](respondWithResult(_0x358950,null))['catch'](handleError(_0x358950,null));};exports[_0xbe14('0x56')]=function(_0x1c18b6,_0x29aa52,_0x57729f){var _0x76e91e={};var _0x16bca1={};var _0x105be0;var _0x1797dd;return db[_0xbe14('0x34')][_0xbe14('0x53')]({'where':{'id':_0x1c18b6[_0xbe14('0x4d')]['id']}})['then'](handleEntityNotFound(_0x29aa52,null))[_0xbe14('0x1c')](function(_0x3b6ef5){if(_0x3b6ef5){_0x105be0=_0x3b6ef5;_0x16bca1[_0xbe14('0x3b')]=_[_0xbe14('0x4e')](db[_0xbe14('0x54')][_0xbe14('0x35')]);_0x16bca1[_0xbe14('0x38')]=_['keys'](_0x1c18b6[_0xbe14('0x38')]);_0x16bca1[_0xbe14('0x39')]=_[_0xbe14('0x3a')](_0x16bca1[_0xbe14('0x3b')],_0x16bca1[_0xbe14('0x38')]);_0x76e91e[_0xbe14('0x3c')]=_[_0xbe14('0x3a')](_0x16bca1[_0xbe14('0x3b')],qs['fields'](_0x1c18b6[_0xbe14('0x38')][_0xbe14('0x3d')]));_0x76e91e[_0xbe14('0x3c')]=_0x76e91e[_0xbe14('0x3c')][_0xbe14('0x3e')]?_0x76e91e[_0xbe14('0x3c')]:_0x16bca1['model'];_0x76e91e[_0xbe14('0x55')]=qs[_0xbe14('0x41')](_0x1c18b6[_0xbe14('0x38')][_0xbe14('0x41')]);_0x76e91e['where']=qs[_0xbe14('0x39')](_[_0xbe14('0x43')](_0x1c18b6[_0xbe14('0x38')],_0x16bca1[_0xbe14('0x39')]));if(_0x1c18b6[_0xbe14('0x38')][_0xbe14('0x44')]){_0x76e91e[_0xbe14('0x42')]=_['merge'](_0x76e91e[_0xbe14('0x42')],{'$or':_['map'](_0x76e91e[_0xbe14('0x3c')],function(_0x5d85d3){var _0x389822={};_0x389822[_0x5d85d3]={'$like':'%'+_0x1c18b6[_0xbe14('0x38')][_0xbe14('0x44')]+'%'};return _0x389822;})});}_0x76e91e=_['merge']({},_0x76e91e,_0x1c18b6[_0xbe14('0x47')]);return _0x105be0[_0xbe14('0x56')](_0x76e91e);}})[_0xbe14('0x1c')](function(_0x546f22){if(_0x546f22){_0x1797dd=_0x546f22[_0xbe14('0x3e')];if(!_0x1c18b6[_0xbe14('0x38')][_0xbe14('0x3f')](_0xbe14('0x40'))){_0x76e91e['limit']=qs[_0xbe14('0x29')](_0x1c18b6[_0xbe14('0x38')][_0xbe14('0x29')]);_0x76e91e[_0xbe14('0x28')]=qs[_0xbe14('0x28')](_0x1c18b6[_0xbe14('0x38')][_0xbe14('0x28')]);}return _0x105be0['getSubjects'](_0x76e91e);}})[_0xbe14('0x1c')](function(_0x123f4f){if(_0x123f4f){return _0x123f4f?{'count':_0x1797dd,'rows':_0x123f4f}:null;}})[_0xbe14('0x1c')](respondWithResult(_0x29aa52,null))['catch'](handleError(_0x29aa52,null));};exports[_0xbe14('0x57')]=function(_0x420467,_0x1ea305,_0x5bc52b){var _0xa53262={};var _0x1205d1={};var _0x47d7bb;var _0x2be969;return db['ZendeskConfiguration'][_0xbe14('0x53')]({'where':{'id':_0x420467[_0xbe14('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1ea305,null))['then'](function(_0x54045e){if(_0x54045e){_0x47d7bb=_0x54045e;_0x1205d1[_0xbe14('0x3b')]=_[_0xbe14('0x4e')](db['ZendeskField'][_0xbe14('0x35')]);_0x1205d1[_0xbe14('0x38')]=_[_0xbe14('0x4e')](_0x420467[_0xbe14('0x38')]);_0x1205d1['filters']=_['intersection'](_0x1205d1[_0xbe14('0x3b')],_0x1205d1[_0xbe14('0x38')]);_0xa53262[_0xbe14('0x3c')]=_[_0xbe14('0x3a')](_0x1205d1[_0xbe14('0x3b')],qs[_0xbe14('0x3d')](_0x420467[_0xbe14('0x38')]['fields']));_0xa53262[_0xbe14('0x3c')]=_0xa53262['attributes'][_0xbe14('0x3e')]?_0xa53262[_0xbe14('0x3c')]:_0x1205d1[_0xbe14('0x3b')];_0xa53262[_0xbe14('0x55')]=qs['sort'](_0x420467[_0xbe14('0x38')][_0xbe14('0x41')]);_0xa53262[_0xbe14('0x42')]=qs['filters'](_[_0xbe14('0x43')](_0x420467[_0xbe14('0x38')],_0x1205d1[_0xbe14('0x39')]));if(_0x420467[_0xbe14('0x38')][_0xbe14('0x44')]){_0xa53262[_0xbe14('0x42')]=_[_0xbe14('0x45')](_0xa53262[_0xbe14('0x42')],{'$or':_[_0xbe14('0x33')](_0xa53262[_0xbe14('0x3c')],function(_0x2bf94c){var _0x49497e={};_0x49497e[_0x2bf94c]={'$like':'%'+_0x420467[_0xbe14('0x38')][_0xbe14('0x44')]+'%'};return _0x49497e;})});}_0xa53262=_[_0xbe14('0x45')]({},_0xa53262,_0x420467[_0xbe14('0x47')]);return _0x47d7bb[_0xbe14('0x57')](_0xa53262);}})[_0xbe14('0x1c')](function(_0x1679bd){if(_0x1679bd){_0x2be969=_0x1679bd[_0xbe14('0x3e')];if(!_0x420467['query'][_0xbe14('0x3f')]('nolimit')){_0xa53262[_0xbe14('0x29')]=qs[_0xbe14('0x29')](_0x420467[_0xbe14('0x38')][_0xbe14('0x29')]);_0xa53262[_0xbe14('0x28')]=qs['offset'](_0x420467['query'][_0xbe14('0x28')]);}return _0x47d7bb[_0xbe14('0x57')](_0xa53262);}})[_0xbe14('0x1c')](function(_0x42b849){if(_0x42b849){return _0x42b849?{'count':_0x2be969,'rows':_0x42b849}:null;}})['then'](respondWithResult(_0x1ea305,null))[_0xbe14('0x50')](handleError(_0x1ea305,null));};exports[_0xbe14('0x58')]=function(_0x4d6a75,_0x186225,_0x3b8b45){var _0x31fdf2={};var _0x17b3b1={};var _0x4f9936;var _0x3c5241;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x4d6a75[_0xbe14('0x4d')]['id']}})[_0xbe14('0x1c')](handleEntityNotFound(_0x186225,null))[_0xbe14('0x1c')](function(_0x3d890b){if(_0x3d890b){_0x4f9936=_0x3d890b;_0x17b3b1[_0xbe14('0x3b')]=_['keys'](db[_0xbe14('0x59')][_0xbe14('0x35')]);_0x17b3b1['query']=_['keys'](_0x4d6a75[_0xbe14('0x38')]);_0x17b3b1[_0xbe14('0x39')]=_['intersection'](_0x17b3b1[_0xbe14('0x3b')],_0x17b3b1['query']);_0x31fdf2[_0xbe14('0x3c')]=_['intersection'](_0x17b3b1[_0xbe14('0x3b')],qs['fields'](_0x4d6a75[_0xbe14('0x38')]['fields']));_0x31fdf2[_0xbe14('0x3c')]=_0x31fdf2[_0xbe14('0x3c')]['length']?_0x31fdf2['attributes']:_0x17b3b1[_0xbe14('0x3b')];_0x31fdf2['order']=qs['sort'](_0x4d6a75[_0xbe14('0x38')][_0xbe14('0x41')]);_0x31fdf2[_0xbe14('0x42')]=qs[_0xbe14('0x39')](_[_0xbe14('0x43')](_0x4d6a75[_0xbe14('0x38')],_0x17b3b1[_0xbe14('0x39')]));if(_0x4d6a75['query'][_0xbe14('0x44')]){_0x31fdf2[_0xbe14('0x42')]=_[_0xbe14('0x45')](_0x31fdf2[_0xbe14('0x42')],{'$or':_['map'](_0x31fdf2[_0xbe14('0x3c')],function(_0x3c5097){var _0x1a6a91={};_0x1a6a91[_0x3c5097]={'$like':'%'+_0x4d6a75['query'][_0xbe14('0x44')]+'%'};return _0x1a6a91;})});}_0x31fdf2=_[_0xbe14('0x45')]({},_0x31fdf2,_0x4d6a75['options']);return _0x4f9936[_0xbe14('0x58')](_0x31fdf2);}})['then'](function(_0x82cbcf){if(_0x82cbcf){_0x3c5241=_0x82cbcf[_0xbe14('0x3e')];if(!_0x4d6a75[_0xbe14('0x38')]['hasOwnProperty'](_0xbe14('0x40'))){_0x31fdf2['limit']=qs[_0xbe14('0x29')](_0x4d6a75['query']['limit']);_0x31fdf2[_0xbe14('0x28')]=qs['offset'](_0x4d6a75[_0xbe14('0x38')]['offset']);}return _0x4f9936[_0xbe14('0x58')](_0x31fdf2);}})[_0xbe14('0x1c')](function(_0x8a457b){if(_0x8a457b){return _0x8a457b?{'count':_0x3c5241,'rows':_0x8a457b}:null;}})[_0xbe14('0x1c')](respondWithResult(_0x186225,null))[_0xbe14('0x50')](handleError(_0x186225,null));};exports[_0xbe14('0x5a')]=function(_0x43d406,_0x3086f3,_0x466f7f){if(_0x43d406[_0xbe14('0x51')]['id']){delete _0x43d406[_0xbe14('0x51')]['id'];}return db[_0xbe14('0x34')][_0xbe14('0x53')]({'where':{'id':_0x43d406['params']['id']}})[_0xbe14('0x1c')](handleEntityNotFound(_0x3086f3,null))[_0xbe14('0x1c')](function(_0x342992){if(_0x342992){return _0x342992[_0xbe14('0x5a')](_0x43d406[_0xbe14('0x51')]['ids']||[]);}return null;})['then'](respondWithResult(_0x3086f3,null))[_0xbe14('0x50')](handleError(_0x3086f3,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 58d6f42..812f928 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 _0x3fb0=['rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0xd73884,_0x2ca96d){var _0x16b79c=function(_0x1521bc){while(--_0x1521bc){_0xd73884['push'](_0xd73884['shift']());}};_0x16b79c(++_0x2ca96d);}(_0x3fb0,0x1d4));var _0x03fb=function(_0x483d45,_0x4be74b){_0x483d45=_0x483d45-0x0;var _0x1d59e2=_0x3fb0[_0x483d45];return _0x1d59e2;};'use strict';var _=require(_0x03fb('0x0'));var util=require(_0x03fb('0x1'));var logger=require(_0x03fb('0x2'))(_0x03fb('0x3'));var moment=require(_0x03fb('0x4'));var BPromise=require(_0x03fb('0x5'));var rp=require(_0x03fb('0x6'));var fs=require('fs');var path=require(_0x03fb('0x7'));var rimraf=require(_0x03fb('0x8'));var config=require(_0x03fb('0x9'));var attributes=require(_0x03fb('0xa'));module[_0x03fb('0xb')]=function(_0x3a36da,_0x23533a){return _0x3a36da[_0x03fb('0xc')](_0x03fb('0xd'),attributes,{'tableName':'int_zendesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x87c9=['../../config/environment','exports','define','int_zendesk_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x4d82ea,_0x4d459f){var _0x257f4a=function(_0x424c4f){while(--_0x424c4f){_0x4d82ea['push'](_0x4d82ea['shift']());}};_0x257f4a(++_0x4d459f);}(_0x87c9,0x148));var _0x987c=function(_0x3a5b90,_0x4aa2ad){_0x3a5b90=_0x3a5b90-0x0;var _0x2ab7d5=_0x87c9[_0x3a5b90];return _0x2ab7d5;};'use strict';var _=require(_0x987c('0x0'));var util=require(_0x987c('0x1'));var logger=require(_0x987c('0x2'))(_0x987c('0x3'));var moment=require(_0x987c('0x4'));var BPromise=require(_0x987c('0x5'));var rp=require(_0x987c('0x6'));var fs=require('fs');var path=require(_0x987c('0x7'));var rimraf=require('rimraf');var config=require(_0x987c('0x8'));var attributes=require('./intZendeskConfiguration.attributes');module[_0x987c('0x9')]=function(_0x4cd636,_0x34613b){return _0x4cd636[_0x987c('0xa')]('ZendeskConfiguration',attributes,{'tableName':_0x987c('0xb'),'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 cbd65fe..6d35944 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 _0x2b7b=['then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request'];(function(_0x111c6a,_0x394b70){var _0xe21fc9=function(_0x539d3f){while(--_0x539d3f){_0x111c6a['push'](_0x111c6a['shift']());}};_0xe21fc9(++_0x394b70);}(_0x2b7b,0x135));var _0xb2b7=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x2b7b[_0x160c73];return _0xd9302;};'use strict';var _=require(_0xb2b7('0x0'));var util=require(_0xb2b7('0x1'));var moment=require(_0xb2b7('0x2'));var BPromise=require('bluebird');var rs=require(_0xb2b7('0x3'));var fs=require('fs');var Redis=require(_0xb2b7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb2b7('0x5'));var logger=require(_0xb2b7('0x6'))(_0xb2b7('0x7'));var config=require(_0xb2b7('0x8'));var jayson=require(_0xb2b7('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4739cb,_0x3a09cf,_0x5b873d){return new BPromise(function(_0x31bc99,_0x440016){return client[_0xb2b7('0xa')](_0x4739cb,_0x5b873d)[_0xb2b7('0xb')](function(_0x2d1264){logger[_0xb2b7('0xc')](_0xb2b7('0xd'),_0x3a09cf,_0xb2b7('0xe'));logger['debug'](_0xb2b7('0xf'),_0x3a09cf,'request\x20sent',JSON['stringify'](_0x2d1264));if(_0x2d1264['error']){if(_0x2d1264[_0xb2b7('0x10')]['code']===0x1f4){logger[_0xb2b7('0x10')](_0xb2b7('0xd'),_0x3a09cf,_0x2d1264['error'][_0xb2b7('0x11')]);return _0x440016(_0x2d1264[_0xb2b7('0x10')][_0xb2b7('0x11')]);}logger['error'](_0xb2b7('0xd'),_0x3a09cf,_0x2d1264['error'][_0xb2b7('0x11')]);return _0x31bc99(_0x2d1264[_0xb2b7('0x10')][_0xb2b7('0x11')]);}else{logger[_0xb2b7('0xc')](_0xb2b7('0xd'),_0x3a09cf,_0xb2b7('0xe'));_0x31bc99(_0x2d1264[_0xb2b7('0x12')][_0xb2b7('0x11')]);}})[_0xb2b7('0x13')](function(_0x420023){logger['error'](_0xb2b7('0xd'),_0x3a09cf,_0x420023);_0x440016(_0x420023);});});} \ No newline at end of file +var _0xa380=['info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request'];(function(_0x262232,_0x112013){var _0x2c853c=function(_0x6e39de){while(--_0x6e39de){_0x262232['push'](_0x262232['shift']());}};_0x2c853c(++_0x112013);}(_0xa380,0x127));var _0x0a38=function(_0x2f9e6f,_0xa4e3e1){_0x2f9e6f=_0x2f9e6f-0x0;var _0x5038dd=_0xa380[_0x2f9e6f];return _0x5038dd;};'use strict';var _=require(_0x0a38('0x0'));var util=require(_0x0a38('0x1'));var moment=require(_0x0a38('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0a38('0x3'))['db'];var utils=require(_0x0a38('0x4'));var logger=require('../../config/logger')(_0x0a38('0x5'));var config=require(_0x0a38('0x6'));var jayson=require(_0x0a38('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3bb59f,_0x5bf1e4,_0x49181f){return new BPromise(function(_0x8f7145,_0x2e405d){return client[_0x0a38('0x8')](_0x3bb59f,_0x49181f)['then'](function(_0xc89319){logger[_0x0a38('0x9')](_0x0a38('0xa'),_0x5bf1e4,_0x0a38('0xb'));logger['debug'](_0x0a38('0xc'),_0x5bf1e4,_0x0a38('0xb'),JSON[_0x0a38('0xd')](_0xc89319));if(_0xc89319['error']){if(_0xc89319[_0x0a38('0xe')][_0x0a38('0xf')]===0x1f4){logger[_0x0a38('0xe')](_0x0a38('0xa'),_0x5bf1e4,_0xc89319[_0x0a38('0xe')][_0x0a38('0x10')]);return _0x2e405d(_0xc89319[_0x0a38('0xe')][_0x0a38('0x10')]);}logger['error'](_0x0a38('0xa'),_0x5bf1e4,_0xc89319['error'][_0x0a38('0x10')]);return _0x8f7145(_0xc89319[_0x0a38('0xe')][_0x0a38('0x10')]);}else{logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0x5bf1e4,_0x0a38('0xb'));_0x8f7145(_0xc89319[_0x0a38('0x11')]['message']);}})[_0x0a38('0x12')](function(_0x30ade5){logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x5bf1e4,_0x30ade5);_0x2e405d(_0x30ade5);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index d4c13b1..8bb3bc0 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 _0x3442=['multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','post','create','exports'];(function(_0x13f25a,_0x429fad){var _0xd22b3e=function(_0x4ab61c){while(--_0x4ab61c){_0x13f25a['push'](_0x13f25a['shift']());}};_0xd22b3e(++_0x429fad);}(_0x3442,0x118));var _0x2344=function(_0x6ff171,_0x9aa2){_0x6ff171=_0x6ff171-0x0;var _0x396ea1=_0x3442[_0x6ff171];return _0x396ea1;};'use strict';var multer=require(_0x2344('0x0'));var util=require(_0x2344('0x1'));var path=require('path');var timeout=require(_0x2344('0x2'));var express=require(_0x2344('0x3'));var router=express[_0x2344('0x4')]();var auth=require(_0x2344('0x5'));var interaction=require(_0x2344('0x6'));var config=require(_0x2344('0x7'));var controller=require(_0x2344('0x8'));router[_0x2344('0x9')]('/',auth[_0x2344('0xa')](),controller['index']);router[_0x2344('0x9')]('/:id',auth[_0x2344('0xa')](),controller['show']);router[_0x2344('0xb')]('/',auth[_0x2344('0xa')](),controller[_0x2344('0xc')]);router['put']('/:id',auth[_0x2344('0xa')](),controller['update']);router['delete']('/:id',auth[_0x2344('0xa')](),controller['destroy']);module[_0x2344('0xd')]=router; \ No newline at end of file +var _0x8f11=['multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','put','update','delete','destroy'];(function(_0x43eb2a,_0x24da54){var _0x3c280c=function(_0x25be2c){while(--_0x25be2c){_0x43eb2a['push'](_0x43eb2a['shift']());}};_0x3c280c(++_0x24da54);}(_0x8f11,0x69));var _0x18f1=function(_0xf5207e,_0x5e6410){_0xf5207e=_0xf5207e-0x0;var _0x51ee4c=_0x8f11[_0xf5207e];return _0x51ee4c;};'use strict';var multer=require(_0x18f1('0x0'));var util=require(_0x18f1('0x1'));var path=require(_0x18f1('0x2'));var timeout=require(_0x18f1('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x18f1('0x4'));var interaction=require(_0x18f1('0x5'));var config=require(_0x18f1('0x6'));var controller=require('./intZendeskField.controller');router[_0x18f1('0x7')]('/',auth[_0x18f1('0x8')](),controller[_0x18f1('0x9')]);router[_0x18f1('0x7')](_0x18f1('0xa'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x18f1('0x8')](),controller['create']);router[_0x18f1('0xb')](_0x18f1('0xa'),auth['isAuthenticated'](),controller[_0x18f1('0xc')]);router[_0x18f1('0xd')](_0x18f1('0xa'),auth[_0x18f1('0x8')](),controller[_0x18f1('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index b6ba21e..a95305e 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 _0x6bac=['variable','customVariable','STRING','BOOLEAN','sequelize','ENUM','string'];(function(_0x3f9ad6,_0x1b6aef){var _0x58cdb1=function(_0x40d58c){while(--_0x40d58c){_0x3f9ad6['push'](_0x3f9ad6['shift']());}};_0x58cdb1(++_0x1b6aef);}(_0x6bac,0xa5));var _0xc6ba=function(_0x3b244f,_0x24e1d3){_0x3b244f=_0x3b244f-0x0;var _0x537610=_0x6bac[_0x3b244f];return _0x537610;};'use strict';var Sequelize=require(_0xc6ba('0x0'));module['exports']={'type':{'type':Sequelize[_0xc6ba('0x1')](_0xc6ba('0x2'),_0xc6ba('0x3'),_0xc6ba('0x4'),'keyValue'),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xc6ba('0x5')]},'keyType':{'type':Sequelize[_0xc6ba('0x1')]('string',_0xc6ba('0x3'),_0xc6ba('0x4'))},'keyContent':{'type':Sequelize[_0xc6ba('0x5')]},'idField':{'type':Sequelize[_0xc6ba('0x5')]},'nameField':{'type':Sequelize[_0xc6ba('0x5')]},'customField':{'type':Sequelize[_0xc6ba('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6688=['sequelize','exports','ENUM','variable','customVariable','keyValue','string','STRING','BOOLEAN'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6688,0x10e));var _0x8668=function(_0x594f36,_0x3318ac){_0x594f36=_0x594f36-0x0;var _0x295060=_0x6688[_0x594f36];return _0x295060;};'use strict';var Sequelize=require(_0x8668('0x0'));module[_0x8668('0x1')]={'type':{'type':Sequelize[_0x8668('0x2')]('string',_0x8668('0x3'),_0x8668('0x4'),_0x8668('0x5')),'defaultValue':_0x8668('0x6')},'content':{'type':Sequelize[_0x8668('0x7')]},'key':{'type':Sequelize[_0x8668('0x7')]},'keyType':{'type':Sequelize[_0x8668('0x2')]('string',_0x8668('0x3'),_0x8668('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x8668('0x7')]},'nameField':{'type':Sequelize[_0x8668('0x7')]},'customField':{'type':Sequelize[_0x8668('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8668('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index ed86ae1..9ee7e61 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 _0xd746=['params','include','create','body','find','html-pdf','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','json','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','end','error','name','send','index','map','rawAttributes','type','key','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','ZendeskField','includeAll','findAll','catch','show'];(function(_0x16a06b,_0x515f0c){var _0x3b9ca4=function(_0x402aa1){while(--_0x402aa1){_0x16a06b['push'](_0x16a06b['shift']());}};_0x3b9ca4(++_0x515f0c);}(_0xd746,0x159));var _0x6d74=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0xd746[_0x25e7cb];return _0x375d92;};'use strict';var pdf=require(_0x6d74('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6d74('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6d74('0x2'));var BPromise=require(_0x6d74('0x3'));var Mustache=require(_0x6d74('0x4'));var util=require(_0x6d74('0x5'));var path=require(_0x6d74('0x6'));var sox=require('sox');var csv=require(_0x6d74('0x7'));var ejs=require(_0x6d74('0x8'));var fs=require('fs');var _=require(_0x6d74('0x9'));var squel=require(_0x6d74('0xa'));var crypto=require(_0x6d74('0xb'));var jsforce=require(_0x6d74('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6d74('0x7'));var querystring=require('querystring');var Papa=require(_0x6d74('0xd'));var Redis=require(_0x6d74('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6d74('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6d74('0x10'))('api');var utils=require(_0x6d74('0x11'));var config=require(_0x6d74('0x12'));var db=require(_0x6d74('0x13'))['db'];function respondWithStatusCode(_0x481f88,_0x147dd2){_0x147dd2=_0x147dd2||0xcc;return function(_0x39bc6d){if(_0x39bc6d){return _0x481f88['sendStatus'](_0x147dd2);}return _0x481f88[_0x6d74('0x14')](_0x147dd2)['end']();};}function respondWithResult(_0x3431e7,_0xab041c){_0xab041c=_0xab041c||0xc8;return function(_0x3dd9d8){if(_0x3dd9d8){return _0x3431e7[_0x6d74('0x14')](_0xab041c)[_0x6d74('0x15')](_0x3dd9d8);}};}function respondWithFilteredResult(_0x19f0d3,_0x385ef5){return function(_0x4261de){if(_0x4261de){var _0x43639e=_0x4261de[_0x6d74('0x16')],_0x1bef6a=_0x385ef5[_0x6d74('0x17')],_0x25c453=_0x385ef5[_0x6d74('0x17')]+_0x385ef5['limit'],_0x161944;if(_0x25c453>=_0x43639e){_0x25c453=_0x43639e;_0x161944=0xc8;}else{_0x161944=0xce;}_0x19f0d3[_0x6d74('0x14')](_0x161944);return _0x19f0d3[_0x6d74('0x18')](_0x6d74('0x19'),_0x1bef6a+'-'+_0x25c453+'/'+_0x43639e)[_0x6d74('0x15')](_0x4261de);}return null;};}function patchUpdates(_0x9e574b){return function(_0x5ad130){try{jsonpatch[_0x6d74('0x1a')](_0x5ad130,_0x9e574b,!![]);}catch(_0x276fce){return BPromise[_0x6d74('0x1b')](_0x276fce);}return _0x5ad130[_0x6d74('0x1c')]();};}function saveUpdates(_0x530222,_0x41113d){return function(_0x2b4d67){if(_0x2b4d67){return _0x2b4d67[_0x6d74('0x1d')](_0x530222)['then'](function(_0x6b7249){return _0x6b7249;});}return null;};}function removeEntity(_0x4450ae,_0x33568d){return function(_0x2a2198){if(_0x2a2198){return _0x2a2198[_0x6d74('0x1e')]()[_0x6d74('0x1f')](function(){_0x4450ae['status'](0xcc)[_0x6d74('0x20')]();});}};}function handleEntityNotFound(_0x55898a,_0x1b4f22){return function(_0x33f49c){if(!_0x33f49c){_0x55898a['sendStatus'](0x194);}return _0x33f49c;};}function handleError(_0x15cbf7,_0x7407db){_0x7407db=_0x7407db||0x1f4;return function(_0x47f2de){logger[_0x6d74('0x21')](_0x47f2de['stack']);if(_0x47f2de[_0x6d74('0x22')]){delete _0x47f2de[_0x6d74('0x22')];}_0x15cbf7[_0x6d74('0x14')](_0x7407db)[_0x6d74('0x23')](_0x47f2de);};}exports[_0x6d74('0x24')]=function(_0x559df1,_0xe92d0c){var _0x512df1={},_0x528acc={},_0x1806bc={'count':0x0,'rows':[]};var _0xd2bd21=_[_0x6d74('0x25')](db['ZendeskField'][_0x6d74('0x26')],function(_0xe3e5f7){return{'name':_0xe3e5f7['fieldName'],'type':_0xe3e5f7[_0x6d74('0x27')][_0x6d74('0x28')]};});_0x528acc['model']=_[_0x6d74('0x25')](_0xd2bd21,_0x6d74('0x22'));_0x528acc['query']=_[_0x6d74('0x29')](_0x559df1[_0x6d74('0x2a')]);_0x528acc[_0x6d74('0x2b')]=_[_0x6d74('0x2c')](_0x528acc[_0x6d74('0x2d')],_0x528acc[_0x6d74('0x2a')]);_0x512df1[_0x6d74('0x2e')]=_[_0x6d74('0x2c')](_0x528acc[_0x6d74('0x2d')],qs[_0x6d74('0x2f')](_0x559df1[_0x6d74('0x2a')][_0x6d74('0x2f')]));_0x512df1['attributes']=_0x512df1[_0x6d74('0x2e')]['length']?_0x512df1[_0x6d74('0x2e')]:_0x528acc[_0x6d74('0x2d')];if(!_0x559df1[_0x6d74('0x2a')][_0x6d74('0x30')](_0x6d74('0x31'))){_0x512df1[_0x6d74('0x32')]=qs['limit'](_0x559df1[_0x6d74('0x2a')][_0x6d74('0x32')]);_0x512df1[_0x6d74('0x17')]=qs[_0x6d74('0x17')](_0x559df1[_0x6d74('0x2a')][_0x6d74('0x17')]);}_0x512df1[_0x6d74('0x33')]=qs[_0x6d74('0x34')](_0x559df1['query']['sort']);_0x512df1[_0x6d74('0x35')]=qs[_0x6d74('0x2b')](_[_0x6d74('0x36')](_0x559df1[_0x6d74('0x2a')],_0x528acc[_0x6d74('0x2b')]));if(_0x559df1[_0x6d74('0x2a')][_0x6d74('0x37')]){_0x512df1[_0x6d74('0x35')]=_[_0x6d74('0x38')](_0x512df1[_0x6d74('0x35')],{'$or':_['map'](_0xd2bd21,function(_0x1c0785){if(_0x1c0785[_0x6d74('0x27')]!==_0x6d74('0x39')){var _0x2e61da={};_0x2e61da[_0x1c0785[_0x6d74('0x22')]]={'$like':'%'+_0x559df1[_0x6d74('0x2a')][_0x6d74('0x37')]+'%'};return _0x2e61da;}})});}_0x512df1=_[_0x6d74('0x38')]({},_0x512df1,_0x559df1['options']);var _0x173527={'where':_0x512df1[_0x6d74('0x35')]};return db[_0x6d74('0x3a')][_0x6d74('0x16')](_0x173527)[_0x6d74('0x1f')](function(_0xe66207){_0x1806bc[_0x6d74('0x16')]=_0xe66207;if(_0x559df1[_0x6d74('0x2a')][_0x6d74('0x3b')]){_0x512df1['include']=[{'all':!![]}];}return db[_0x6d74('0x3a')][_0x6d74('0x3c')](_0x512df1);})[_0x6d74('0x1f')](function(_0xb972f4){_0x1806bc['rows']=_0xb972f4;return _0x1806bc;})[_0x6d74('0x1f')](respondWithFilteredResult(_0xe92d0c,_0x512df1))[_0x6d74('0x3d')](handleError(_0xe92d0c,null));};exports[_0x6d74('0x3e')]=function(_0x25e54a,_0x51a4d1){var _0x4024a8={'raw':!![],'where':{'id':_0x25e54a[_0x6d74('0x3f')]['id']}},_0x1a0ac6={};_0x1a0ac6[_0x6d74('0x2d')]=_[_0x6d74('0x29')](db[_0x6d74('0x3a')][_0x6d74('0x26')]);_0x1a0ac6[_0x6d74('0x2a')]=_[_0x6d74('0x29')](_0x25e54a[_0x6d74('0x2a')]);_0x1a0ac6['filters']=_[_0x6d74('0x2c')](_0x1a0ac6[_0x6d74('0x2d')],_0x1a0ac6[_0x6d74('0x2a')]);_0x4024a8['attributes']=_[_0x6d74('0x2c')](_0x1a0ac6['model'],qs[_0x6d74('0x2f')](_0x25e54a[_0x6d74('0x2a')]['fields']));_0x4024a8[_0x6d74('0x2e')]=_0x4024a8[_0x6d74('0x2e')]['length']?_0x4024a8[_0x6d74('0x2e')]:_0x1a0ac6[_0x6d74('0x2d')];if(_0x25e54a['query'][_0x6d74('0x3b')]){_0x4024a8[_0x6d74('0x40')]=[{'all':!![]}];}_0x4024a8=_[_0x6d74('0x38')]({},_0x4024a8,_0x25e54a['options']);return db['ZendeskField']['find'](_0x4024a8)[_0x6d74('0x1f')](handleEntityNotFound(_0x51a4d1,null))['then'](respondWithResult(_0x51a4d1,null))[_0x6d74('0x3d')](handleError(_0x51a4d1,null));};exports['create']=function(_0x3de9c5,_0x27d615){return db['ZendeskField'][_0x6d74('0x41')](_0x3de9c5['body'],{})[_0x6d74('0x1f')](respondWithResult(_0x27d615,0xc9))[_0x6d74('0x3d')](handleError(_0x27d615,null));};exports['update']=function(_0x340eb1,_0xb44a24){if(_0x340eb1[_0x6d74('0x42')]['id']){delete _0x340eb1['body']['id'];}return db[_0x6d74('0x3a')]['find']({'where':{'id':_0x340eb1[_0x6d74('0x3f')]['id']}})[_0x6d74('0x1f')](handleEntityNotFound(_0xb44a24,null))[_0x6d74('0x1f')](saveUpdates(_0x340eb1['body'],null))[_0x6d74('0x1f')](respondWithResult(_0xb44a24,null))[_0x6d74('0x3d')](handleError(_0xb44a24,null));};exports['destroy']=function(_0x49dd2d,_0x2fcdee){return db[_0x6d74('0x3a')][_0x6d74('0x43')]({'where':{'id':_0x49dd2d[_0x6d74('0x3f')]['id']}})[_0x6d74('0x1f')](handleEntityNotFound(_0x2fcdee,null))[_0x6d74('0x1f')](removeEntity(_0x2fcdee,null))['catch'](handleError(_0x2fcdee,null));}; \ No newline at end of file +var _0xc780=['destroy','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','json','reject','save','then','stack','send','index','ZendeskField','fieldName','type','key','model','name','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','count','catch','params','rawAttributes','keys','includeAll','include','create','body','update','find'];(function(_0x56ebef,_0x469dee){var _0x6d844c=function(_0x112d85){while(--_0x112d85){_0x56ebef['push'](_0x56ebef['shift']());}};_0x6d844c(++_0x469dee);}(_0xc780,0x87));var _0x0c78=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc780[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0c78('0x0'));var rimraf=require(_0x0c78('0x1'));var zipdir=require(_0x0c78('0x2'));var jsonpatch=require(_0x0c78('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0c78('0x4'));var Mustache=require(_0x0c78('0x5'));var util=require(_0x0c78('0x6'));var path=require(_0x0c78('0x7'));var sox=require(_0x0c78('0x8'));var csv=require(_0x0c78('0x9'));var ejs=require(_0x0c78('0xa'));var fs=require('fs');var _=require(_0x0c78('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0c78('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x0c78('0x9'));var querystring=require(_0x0c78('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0c78('0xe'));var qs=require(_0x0c78('0xf'));var as=require(_0x0c78('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0c78('0x11'))(_0x0c78('0x12'));var utils=require('../../config/utils');var config=require(_0x0c78('0x13'));var db=require(_0x0c78('0x14'))['db'];function respondWithStatusCode(_0x398ffd,_0x3ba29e){_0x3ba29e=_0x3ba29e||0xcc;return function(_0x594c8d){if(_0x594c8d){return _0x398ffd[_0x0c78('0x15')](_0x3ba29e);}return _0x398ffd[_0x0c78('0x16')](_0x3ba29e)[_0x0c78('0x17')]();};}function respondWithResult(_0x2d5716,_0x3699bd){_0x3699bd=_0x3699bd||0xc8;return function(_0x382f23){if(_0x382f23){return _0x2d5716[_0x0c78('0x16')](_0x3699bd)['json'](_0x382f23);}};}function respondWithFilteredResult(_0x534b2c,_0x59820d){return function(_0x2d00b4){if(_0x2d00b4){var _0x4aa7ac=_0x2d00b4['count'],_0x585d47=_0x59820d[_0x0c78('0x18')],_0x382bd9=_0x59820d[_0x0c78('0x18')]+_0x59820d[_0x0c78('0x19')],_0x1b894e;if(_0x382bd9>=_0x4aa7ac){_0x382bd9=_0x4aa7ac;_0x1b894e=0xc8;}else{_0x1b894e=0xce;}_0x534b2c[_0x0c78('0x16')](_0x1b894e);return _0x534b2c['set']('Content-Range',_0x585d47+'-'+_0x382bd9+'/'+_0x4aa7ac)[_0x0c78('0x1a')](_0x2d00b4);}return null;};}function patchUpdates(_0x44fba8){return function(_0x3ebb68){try{jsonpatch['apply'](_0x3ebb68,_0x44fba8,!![]);}catch(_0x5b089e){return BPromise[_0x0c78('0x1b')](_0x5b089e);}return _0x3ebb68[_0x0c78('0x1c')]();};}function saveUpdates(_0x179a57,_0x35d190){return function(_0x5dba36){if(_0x5dba36){return _0x5dba36['update'](_0x179a57)[_0x0c78('0x1d')](function(_0x4bafa6){return _0x4bafa6;});}return null;};}function removeEntity(_0x5d46d9,_0x152dea){return function(_0x1c2434){if(_0x1c2434){return _0x1c2434['destroy']()[_0x0c78('0x1d')](function(){_0x5d46d9[_0x0c78('0x16')](0xcc)[_0x0c78('0x17')]();});}};}function handleEntityNotFound(_0x47c8db,_0x1cce7b){return function(_0x15cdec){if(!_0x15cdec){_0x47c8db[_0x0c78('0x15')](0x194);}return _0x15cdec;};}function handleError(_0xd8095e,_0x39a702){_0x39a702=_0x39a702||0x1f4;return function(_0x12f3f1){logger['error'](_0x12f3f1[_0x0c78('0x1e')]);if(_0x12f3f1['name']){delete _0x12f3f1['name'];}_0xd8095e[_0x0c78('0x16')](_0x39a702)[_0x0c78('0x1f')](_0x12f3f1);};}exports[_0x0c78('0x20')]=function(_0x2e6fdd,_0x2d526b){var _0x46bdf3={},_0x76fccf={},_0x33bdb5={'count':0x0,'rows':[]};var _0x1a1e64=_['map'](db[_0x0c78('0x21')]['rawAttributes'],function(_0xdb4d7a){return{'name':_0xdb4d7a[_0x0c78('0x22')],'type':_0xdb4d7a[_0x0c78('0x23')][_0x0c78('0x24')]};});_0x76fccf[_0x0c78('0x25')]=_['map'](_0x1a1e64,_0x0c78('0x26'));_0x76fccf[_0x0c78('0x27')]=_['keys'](_0x2e6fdd[_0x0c78('0x27')]);_0x76fccf[_0x0c78('0x28')]=_['intersection'](_0x76fccf[_0x0c78('0x25')],_0x76fccf[_0x0c78('0x27')]);_0x46bdf3[_0x0c78('0x29')]=_[_0x0c78('0x2a')](_0x76fccf[_0x0c78('0x25')],qs[_0x0c78('0x2b')](_0x2e6fdd[_0x0c78('0x27')][_0x0c78('0x2b')]));_0x46bdf3[_0x0c78('0x29')]=_0x46bdf3[_0x0c78('0x29')][_0x0c78('0x2c')]?_0x46bdf3['attributes']:_0x76fccf[_0x0c78('0x25')];if(!_0x2e6fdd[_0x0c78('0x27')][_0x0c78('0x2d')](_0x0c78('0x2e'))){_0x46bdf3[_0x0c78('0x19')]=qs[_0x0c78('0x19')](_0x2e6fdd[_0x0c78('0x27')][_0x0c78('0x19')]);_0x46bdf3[_0x0c78('0x18')]=qs['offset'](_0x2e6fdd[_0x0c78('0x27')][_0x0c78('0x18')]);}_0x46bdf3[_0x0c78('0x2f')]=qs[_0x0c78('0x30')](_0x2e6fdd[_0x0c78('0x27')]['sort']);_0x46bdf3[_0x0c78('0x31')]=qs[_0x0c78('0x28')](_[_0x0c78('0x32')](_0x2e6fdd[_0x0c78('0x27')],_0x76fccf[_0x0c78('0x28')]));if(_0x2e6fdd[_0x0c78('0x27')]['filter']){_0x46bdf3[_0x0c78('0x31')]=_[_0x0c78('0x33')](_0x46bdf3[_0x0c78('0x31')],{'$or':_['map'](_0x1a1e64,function(_0x24ff5a){if(_0x24ff5a[_0x0c78('0x23')]!==_0x0c78('0x34')){var _0x45d01a={};_0x45d01a[_0x24ff5a[_0x0c78('0x26')]]={'$like':'%'+_0x2e6fdd['query'][_0x0c78('0x35')]+'%'};return _0x45d01a;}})});}_0x46bdf3=_[_0x0c78('0x33')]({},_0x46bdf3,_0x2e6fdd[_0x0c78('0x36')]);var _0x6ec74e={'where':_0x46bdf3[_0x0c78('0x31')]};return db[_0x0c78('0x21')][_0x0c78('0x37')](_0x6ec74e)[_0x0c78('0x1d')](function(_0xae181){_0x33bdb5[_0x0c78('0x37')]=_0xae181;if(_0x2e6fdd[_0x0c78('0x27')]['includeAll']){_0x46bdf3['include']=[{'all':!![]}];}return db[_0x0c78('0x21')]['findAll'](_0x46bdf3);})['then'](function(_0x1991d8){_0x33bdb5['rows']=_0x1991d8;return _0x33bdb5;})[_0x0c78('0x1d')](respondWithFilteredResult(_0x2d526b,_0x46bdf3))[_0x0c78('0x38')](handleError(_0x2d526b,null));};exports['show']=function(_0xe9c68b,_0xc40e8d){var _0x32f7b7={'raw':!![],'where':{'id':_0xe9c68b[_0x0c78('0x39')]['id']}},_0x5ea4f5={};_0x5ea4f5[_0x0c78('0x25')]=_['keys'](db[_0x0c78('0x21')][_0x0c78('0x3a')]);_0x5ea4f5['query']=_[_0x0c78('0x3b')](_0xe9c68b['query']);_0x5ea4f5[_0x0c78('0x28')]=_[_0x0c78('0x2a')](_0x5ea4f5['model'],_0x5ea4f5[_0x0c78('0x27')]);_0x32f7b7['attributes']=_[_0x0c78('0x2a')](_0x5ea4f5[_0x0c78('0x25')],qs[_0x0c78('0x2b')](_0xe9c68b[_0x0c78('0x27')][_0x0c78('0x2b')]));_0x32f7b7[_0x0c78('0x29')]=_0x32f7b7[_0x0c78('0x29')][_0x0c78('0x2c')]?_0x32f7b7[_0x0c78('0x29')]:_0x5ea4f5[_0x0c78('0x25')];if(_0xe9c68b[_0x0c78('0x27')][_0x0c78('0x3c')]){_0x32f7b7[_0x0c78('0x3d')]=[{'all':!![]}];}_0x32f7b7=_[_0x0c78('0x33')]({},_0x32f7b7,_0xe9c68b[_0x0c78('0x36')]);return db[_0x0c78('0x21')]['find'](_0x32f7b7)['then'](handleEntityNotFound(_0xc40e8d,null))[_0x0c78('0x1d')](respondWithResult(_0xc40e8d,null))[_0x0c78('0x38')](handleError(_0xc40e8d,null));};exports[_0x0c78('0x3e')]=function(_0x4e7fec,_0x4aa272){return db[_0x0c78('0x21')]['create'](_0x4e7fec[_0x0c78('0x3f')],{})[_0x0c78('0x1d')](respondWithResult(_0x4aa272,0xc9))['catch'](handleError(_0x4aa272,null));};exports[_0x0c78('0x40')]=function(_0x11469b,_0x2f02bf){if(_0x11469b['body']['id']){delete _0x11469b[_0x0c78('0x3f')]['id'];}return db[_0x0c78('0x21')][_0x0c78('0x41')]({'where':{'id':_0x11469b['params']['id']}})[_0x0c78('0x1d')](handleEntityNotFound(_0x2f02bf,null))[_0x0c78('0x1d')](saveUpdates(_0x11469b['body'],null))[_0x0c78('0x1d')](respondWithResult(_0x2f02bf,null))[_0x0c78('0x38')](handleError(_0x2f02bf,null));};exports[_0x0c78('0x42')]=function(_0x4a8a96,_0x364af9){return db[_0x0c78('0x21')][_0x0c78('0x41')]({'where':{'id':_0x4a8a96['params']['id']}})[_0x0c78('0x1d')](handleEntityNotFound(_0x364af9,null))[_0x0c78('0x1d')](removeEntity(_0x364af9,null))[_0x0c78('0x38')](handleError(_0x364af9,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 46cbbb1..e00c09e 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 _0x74f0=['int_zendesk_fields','idField','FieldId','util','moment','bluebird','request-promise','path','./intZendeskField.attributes','exports','define','ZendeskField'];(function(_0x1fd6b0,_0x5a40a0){var _0x202a08=function(_0x3a0674){while(--_0x3a0674){_0x1fd6b0['push'](_0x1fd6b0['shift']());}};_0x202a08(++_0x5a40a0);}(_0x74f0,0xf3));var _0x074f=function(_0x1a9390,_0x3339e6){_0x1a9390=_0x1a9390-0x0;var _0x2b4514=_0x74f0[_0x1a9390];return _0x2b4514;};'use strict';var _=require('lodash');var util=require(_0x074f('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x074f('0x1'));var BPromise=require(_0x074f('0x2'));var rp=require(_0x074f('0x3'));var fs=require('fs');var path=require(_0x074f('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x074f('0x5'));module[_0x074f('0x6')]=function(_0x203f47,_0x126607){return _0x203f47[_0x074f('0x7')](_0x074f('0x8'),attributes,{'tableName':_0x074f('0x9'),'paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':[_0x074f('0xa'),_0x074f('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6594=['define','int_zendesk_fields','zendesk_unique_index','idField','FieldId','moment','bluebird','request-promise','path','rimraf','exports'];(function(_0x45c593,_0x30ec84){var _0x31c50e=function(_0x41eb31){while(--_0x41eb31){_0x45c593['push'](_0x45c593['shift']());}};_0x31c50e(++_0x30ec84);}(_0x6594,0xcb));var _0x4659=function(_0x29c9eb,_0x3d680b){_0x29c9eb=_0x29c9eb-0x0;var _0x438352=_0x6594[_0x29c9eb];return _0x438352;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x4659('0x0'));var BPromise=require(_0x4659('0x1'));var rp=require(_0x4659('0x2'));var fs=require('fs');var path=require(_0x4659('0x3'));var rimraf=require(_0x4659('0x4'));var config=require('../../config/environment');var attributes=require('./intZendeskField.attributes');module[_0x4659('0x5')]=function(_0x2f59ce,_0x246729){return _0x2f59ce[_0x4659('0x6')]('ZendeskField',attributes,{'tableName':_0x4659('0x7'),'paranoid':![],'indexes':[{'name':_0x4659('0x8'),'fields':[_0x4659('0x9'),_0x4659('0xa')],'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 ec69c2f..29847d5 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 _0x766e=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x766e,0x14a));var _0xe766=function(_0x568cf0,_0x1a44cb){_0x568cf0=_0x568cf0-0x0;var _0x360f81=_0x766e[_0x568cf0];return _0x360f81;};'use strict';var _=require(_0xe766('0x0'));var util=require(_0xe766('0x1'));var moment=require(_0xe766('0x2'));var BPromise=require('bluebird');var rs=require(_0xe766('0x3'));var fs=require('fs');var Redis=require(_0xe766('0x4'));var db=require(_0xe766('0x5'))['db'];var utils=require(_0xe766('0x6'));var logger=require(_0xe766('0x7'))(_0xe766('0x8'));var config=require(_0xe766('0x9'));var jayson=require(_0xe766('0xa'));var client=jayson['client'][_0xe766('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1e84e7,_0x1e981c,_0x20d3ea){return new BPromise(function(_0x5f3555,_0x254717){return client[_0xe766('0xc')](_0x1e84e7,_0x20d3ea)['then'](function(_0x1ffcbb){logger[_0xe766('0xd')](_0xe766('0xe'),_0x1e981c,_0xe766('0xf'));logger[_0xe766('0x10')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x1e981c,_0xe766('0xf'),JSON[_0xe766('0x11')](_0x1ffcbb));if(_0x1ffcbb['error']){if(_0x1ffcbb[_0xe766('0x12')][_0xe766('0x13')]===0x1f4){logger[_0xe766('0x12')]('ZendeskField,\x20%s,\x20%s',_0x1e981c,_0x1ffcbb[_0xe766('0x12')]['message']);return _0x254717(_0x1ffcbb[_0xe766('0x12')]['message']);}logger['error'](_0xe766('0xe'),_0x1e981c,_0x1ffcbb[_0xe766('0x12')][_0xe766('0x14')]);return _0x5f3555(_0x1ffcbb['error'][_0xe766('0x14')]);}else{logger['info'](_0xe766('0xe'),_0x1e981c,'request\x20sent');_0x5f3555(_0x1ffcbb[_0xe766('0x15')]['message']);}})['catch'](function(_0xd7c5b6){logger['error'](_0xe766('0xe'),_0x1e981c,_0xd7c5b6);_0x254717(_0xd7c5b6);});});} \ No newline at end of file +var _0x24fe=['http','request','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x3ad5d7,_0x17777d){var _0xcd65c2=function(_0x1e7e25){while(--_0x1e7e25){_0x3ad5d7['push'](_0x3ad5d7['shift']());}};_0xcd65c2(++_0x17777d);}(_0x24fe,0x1ad));var _0xe24f=function(_0x6856c4,_0x17d42a){_0x6856c4=_0x6856c4-0x0;var _0x210bd2=_0x24fe[_0x6856c4];return _0x210bd2;};'use strict';var _=require(_0xe24f('0x0'));var util=require(_0xe24f('0x1'));var moment=require(_0xe24f('0x2'));var BPromise=require(_0xe24f('0x3'));var rs=require(_0xe24f('0x4'));var fs=require('fs');var Redis=require(_0xe24f('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xe24f('0x6'));var logger=require(_0xe24f('0x7'))('rpc');var config=require(_0xe24f('0x8'));var jayson=require(_0xe24f('0x9'));var client=jayson[_0xe24f('0xa')][_0xe24f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x133b22,_0x51105c,_0x3ef8f1){return new BPromise(function(_0x5d3213,_0x4090bd){return client[_0xe24f('0xc')](_0x133b22,_0x3ef8f1)['then'](function(_0x5a9e7f){logger['info'](_0xe24f('0xd'),_0x51105c,_0xe24f('0xe'));logger[_0xe24f('0xf')](_0xe24f('0x10'),_0x51105c,_0xe24f('0xe'),JSON[_0xe24f('0x11')](_0x5a9e7f));if(_0x5a9e7f[_0xe24f('0x12')]){if(_0x5a9e7f[_0xe24f('0x12')][_0xe24f('0x13')]===0x1f4){logger[_0xe24f('0x12')](_0xe24f('0xd'),_0x51105c,_0x5a9e7f[_0xe24f('0x12')]['message']);return _0x4090bd(_0x5a9e7f[_0xe24f('0x12')]['message']);}logger['error'](_0xe24f('0xd'),_0x51105c,_0x5a9e7f[_0xe24f('0x12')]['message']);return _0x5d3213(_0x5a9e7f[_0xe24f('0x12')]['message']);}else{logger[_0xe24f('0x14')](_0xe24f('0xd'),_0x51105c,_0xe24f('0xe'));_0x5d3213(_0x5a9e7f[_0xe24f('0x15')]['message']);}})['catch'](function(_0x2ccdf0){logger[_0xe24f('0x12')](_0xe24f('0xd'),_0x51105c,_0x2ccdf0);_0x4090bd(_0x2ccdf0);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 8d99cc5..91deccf 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 _0x31db=['destroy','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','put','update','delete'];(function(_0x425474,_0xe7ddc5){var _0x2f3e4e=function(_0xc6aa6a){while(--_0xc6aa6a){_0x425474['push'](_0x425474['shift']());}};_0x2f3e4e(++_0xe7ddc5);}(_0x31db,0xe7));var _0xb31d=function(_0x3c4a7c,_0x2f4e3c){_0x3c4a7c=_0x3c4a7c-0x0;var _0xf13d1e=_0x31db[_0x3c4a7c];return _0xf13d1e;};'use strict';var multer=require(_0xb31d('0x0'));var util=require('util');var path=require(_0xb31d('0x1'));var timeout=require('connect-timeout');var express=require(_0xb31d('0x2'));var router=express[_0xb31d('0x3')]();var auth=require(_0xb31d('0x4'));var interaction=require(_0xb31d('0x5'));var config=require(_0xb31d('0x6'));var controller=require(_0xb31d('0x7'));router[_0xb31d('0x8')]('/',auth['isAuthenticated'](),controller[_0xb31d('0x9')]);router[_0xb31d('0x8')](_0xb31d('0xa'),auth[_0xb31d('0xb')](),controller[_0xb31d('0xc')]);router[_0xb31d('0x8')](_0xb31d('0xd'),auth[_0xb31d('0xb')](),controller[_0xb31d('0xe')]);router[_0xb31d('0x8')]('/:id/fields',auth[_0xb31d('0xb')](),controller[_0xb31d('0xf')]);router[_0xb31d('0x10')]('/',auth['isAuthenticated'](),controller[_0xb31d('0x11')]);router[_0xb31d('0x10')](_0xb31d('0xd'),auth['isAuthenticated'](),controller[_0xb31d('0x12')]);router[_0xb31d('0x13')](_0xb31d('0xa'),auth[_0xb31d('0xb')](),controller[_0xb31d('0x14')]);router[_0xb31d('0x15')]('/:id',auth[_0xb31d('0xb')](),controller[_0xb31d('0x16')]);module['exports']=router; \ No newline at end of file +var _0x0101=['../../components/auth/service','../../config/environment','./intZohoAccount.controller','get','index','show','/:id/configurations','/:id/fields','isAuthenticated','getFields','post','create','put','/:id','delete','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x1d74e3,_0x57ef44){var _0x376d12=function(_0x38ec83){while(--_0x38ec83){_0x1d74e3['push'](_0x1d74e3['shift']());}};_0x376d12(++_0x57ef44);}(_0x0101,0xed));var _0x1010=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0101[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x1010('0x0'));var util=require(_0x1010('0x1'));var path=require('path');var timeout=require(_0x1010('0x2'));var express=require(_0x1010('0x3'));var router=express[_0x1010('0x4')]();var auth=require(_0x1010('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1010('0x6'));var controller=require(_0x1010('0x7'));router[_0x1010('0x8')]('/',auth['isAuthenticated'](),controller[_0x1010('0x9')]);router[_0x1010('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x1010('0xa')]);router[_0x1010('0x8')](_0x1010('0xb'),auth['isAuthenticated'](),controller['getConfigurations']);router['get'](_0x1010('0xc'),auth[_0x1010('0xd')](),controller[_0x1010('0xe')]);router[_0x1010('0xf')]('/',auth['isAuthenticated'](),controller[_0x1010('0x10')]);router[_0x1010('0xf')](_0x1010('0xb'),auth[_0x1010('0xd')](),controller['addConfiguration']);router[_0x1010('0x11')](_0x1010('0x12'),auth[_0x1010('0xd')](),controller['update']);router[_0x1010('0x13')](_0x1010('0x12'),auth[_0x1010('0xd')](),controller[_0x1010('0x14')]);module[_0x1010('0x15')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 10b2363..592efac 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 _0x1ffc=['STRING','sequelize','exports'];(function(_0x514364,_0x431908){var _0x187ef5=function(_0x3a22f1){while(--_0x3a22f1){_0x514364['push'](_0x514364['shift']());}};_0x187ef5(++_0x431908);}(_0x1ffc,0x8e));var _0xc1ff=function(_0x53f8ae,_0x1955ba){_0x53f8ae=_0x53f8ae-0x0;var _0x131c02=_0x1ffc[_0x53f8ae];return _0x131c02;};'use strict';var Sequelize=require(_0xc1ff('0x0'));module[_0xc1ff('0x1')]={'name':{'type':Sequelize[_0xc1ff('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0xc1ff('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0xc1ff('0x2')]},'serverUrl':{'type':Sequelize['STRING']},'code':{'type':Sequelize[_0xc1ff('0x2')]},'refreshToken':{'type':Sequelize[_0xc1ff('0x2')]}}; \ No newline at end of file +var _0xce8f=['exports','STRING','sequelize'];(function(_0x36881e,_0x10e842){var _0x5cbcac=function(_0x160a8e){while(--_0x160a8e){_0x36881e['push'](_0x36881e['shift']());}};_0x5cbcac(++_0x10e842);}(_0xce8f,0xb6));var _0xfce8=function(_0x4dc44f,_0x510fdf){_0x4dc44f=_0x4dc44f-0x0;var _0x2d0870=_0xce8f[_0x4dc44f];return _0x2d0870;};'use strict';var Sequelize=require(_0xfce8('0x0'));module[_0xfce8('0x1')]={'name':{'type':Sequelize[_0xfce8('0x2')]},'description':{'type':Sequelize[_0xfce8('0x2')]},'host':{'type':Sequelize[_0xfce8('0x2')]},'zone':{'type':Sequelize[_0xfce8('0x2')]},'clientId':{'type':Sequelize[_0xfce8('0x2')]},'clientSecret':{'type':Sequelize[_0xfce8('0x2')]},'serverUrl':{'type':Sequelize[_0xfce8('0x2')]},'code':{'type':Sequelize[_0xfce8('0x2')]},'refreshToken':{'type':Sequelize[_0xfce8('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 1771ff0..b2fba4d 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 _0x21f8=['zip-dir','request-promise','moment','bluebird','mustache','util','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/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','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','sendStatus','end','status','json','offset','limit','set','Content-Range','apply','update','stack','name','send','map','ZohoAccount','rawAttributes','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','findAll','rows','show','keys','include','options','find','catch','create','body','params','destroy','ZohoConfiguration','order','getConfigurations','addConfiguration','AccountId','Subjects','channel','getDescriptions','ZohoField','Descriptions','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','refreshToken','clientId','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','zone','clientSecret','serverUrl','zoho.eu','com','slice','substring','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','response','Owner','Subject','Description','WhoId','Call_Result','Call_Start_Time','Call_Type','remove','includes','api_name','system_mandatory','push','display_label','custom_field','data_type','picklist','pick_list_values','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','eml-format','rimraf'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x21f8,0x119));var _0x821f=function(_0x43de22,_0x1eced6){_0x43de22=_0x43de22-0x0;var _0x4b15ee=_0x21f8[_0x43de22];return _0x4b15ee;};'use strict';var pdf=require(_0x821f('0x0'));var emlformat=require(_0x821f('0x1'));var rimraf=require(_0x821f('0x2'));var zipdir=require(_0x821f('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x821f('0x4'));var moment=require(_0x821f('0x5'));var BPromise=require(_0x821f('0x6'));var Mustache=require(_0x821f('0x7'));var util=require(_0x821f('0x8'));var path=require('path');var sox=require(_0x821f('0x9'));var csv=require(_0x821f('0xa'));var ejs=require(_0x821f('0xb'));var fs=require('fs');var _=require(_0x821f('0xc'));var squel=require(_0x821f('0xd'));var crypto=require('crypto');var jsforce=require(_0x821f('0xe'));var deskjs=require(_0x821f('0xf'));var toCsv=require('to-csv');var querystring=require(_0x821f('0x10'));var Papa=require(_0x821f('0x11'));var Redis=require('ioredis');var authService=require(_0x821f('0x12'));var qs=require(_0x821f('0x13'));var as=require(_0x821f('0x14'));var hardwareService=require(_0x821f('0x15'));var logger=require(_0x821f('0x16'))(_0x821f('0x17'));var utils=require('../../config/utils');var config=require(_0x821f('0x18'));var db=require(_0x821f('0x19'))['db'];var integrations=require(_0x821f('0x1a'));var jayson=require('jayson/promise');var client=jayson['client'][_0x821f('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x12e416,_0x1eb8bd,_0x21cf2a){if(_0x21cf2a){var _0x145f95=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x145f95[_0x821f('0x1c')](_0x1eb8bd)){return _0x12e416;}else{throw new db[(_0x821f('0x1d'))]['ValidationError'](_0x821f('0x1e'));}}else{return _0x12e416;}}function respondWithRpcPromise(_0x31bf9e,_0xf0e8b7,_0x483064,_0x1b47d3){return new BPromise(function(_0x4b7e30,_0x542b6c){var _0x48b503=_0x1b47d3||client;return _0x48b503[_0x821f('0x1f')](_0x31bf9e,_0x483064)[_0x821f('0x20')](function(_0x38f98b){logger[_0x821f('0x21')](_0x821f('0x22'),_0xf0e8b7,'request\x20sent');logger['debug']('ZohoAccount,\x20%s,\x20%s,\x20%s',_0xf0e8b7,_0x821f('0x23'),JSON[_0x821f('0x24')](_0x38f98b));if(_0x38f98b[_0x821f('0x25')]){if(_0x38f98b[_0x821f('0x25')][_0x821f('0x26')]===0x1f4){logger[_0x821f('0x25')]('ZohoAccount,\x20%s,\x20%s',_0xf0e8b7,_0x38f98b['error'][_0x821f('0x27')]);return _0x542b6c(_0x38f98b[_0x821f('0x25')][_0x821f('0x27')]);}logger[_0x821f('0x25')](_0x821f('0x22'),_0xf0e8b7,_0x38f98b[_0x821f('0x25')][_0x821f('0x27')]);return _0x4b7e30(_0x38f98b[_0x821f('0x25')][_0x821f('0x27')]);}else{logger[_0x821f('0x21')](_0x821f('0x22'),_0xf0e8b7,_0x821f('0x23'));_0x4b7e30(_0x38f98b['result']['message']);}})['catch'](function(_0x3d41a0){logger['error'](_0x821f('0x22'),_0xf0e8b7,_0x3d41a0);_0x542b6c(_0x3d41a0);});});}function respondWithStatusCode(_0x4b19ac,_0x5d05cf){_0x5d05cf=_0x5d05cf||0xcc;return function(_0x13fd5c){if(_0x13fd5c){return _0x4b19ac[_0x821f('0x28')](_0x5d05cf);}return _0x4b19ac['status'](_0x5d05cf)[_0x821f('0x29')]();};}function respondWithResult(_0x90348b,_0x1258cc){_0x1258cc=_0x1258cc||0xc8;return function(_0x2ee1fa){if(_0x2ee1fa){return _0x90348b[_0x821f('0x2a')](_0x1258cc)[_0x821f('0x2b')](_0x2ee1fa);}};}function respondWithFilteredResult(_0x2bb3e3,_0x16d780){return function(_0x447e37){if(_0x447e37){var _0x22e166=_0x447e37['count'],_0x28caf5=_0x16d780[_0x821f('0x2c')],_0xe7469d=_0x16d780['offset']+_0x16d780[_0x821f('0x2d')],_0x2ca62a;if(_0xe7469d>=_0x22e166){_0xe7469d=_0x22e166;_0x2ca62a=0xc8;}else{_0x2ca62a=0xce;}_0x2bb3e3[_0x821f('0x2a')](_0x2ca62a);return _0x2bb3e3[_0x821f('0x2e')](_0x821f('0x2f'),_0x28caf5+'-'+_0xe7469d+'/'+_0x22e166)[_0x821f('0x2b')](_0x447e37);}return null;};}function patchUpdates(_0x5ecfaf){return function(_0x3361a1){try{jsonpatch[_0x821f('0x30')](_0x3361a1,_0x5ecfaf,!![]);}catch(_0x19cc33){return BPromise['reject'](_0x19cc33);}return _0x3361a1['save']();};}function saveUpdates(_0x3dc36f,_0x55b10e){return function(_0x373268){if(_0x373268){return _0x373268[_0x821f('0x31')](_0x3dc36f)[_0x821f('0x20')](function(_0x59d5ab){return _0x59d5ab;});}return null;};}function removeEntity(_0x21853c,_0x1b8a05){return function(_0x32deda){if(_0x32deda){return _0x32deda['destroy']()[_0x821f('0x20')](function(){_0x21853c['status'](0xcc)[_0x821f('0x29')]();});}};}function handleEntityNotFound(_0x316aef,_0x22a39b){return function(_0x2cd36a){if(!_0x2cd36a){_0x316aef['sendStatus'](0x194);}return _0x2cd36a;};}function handleError(_0x122775,_0x4f1f0f){_0x4f1f0f=_0x4f1f0f||0x1f4;return function(_0x275029){logger['error'](_0x275029[_0x821f('0x32')]);if(_0x275029[_0x821f('0x33')]){delete _0x275029[_0x821f('0x33')];}_0x122775['status'](_0x4f1f0f)[_0x821f('0x34')](_0x275029);};}exports['index']=function(_0x51ff8d,_0xcbcb8b){var _0x12ebea={},_0x20f4b9={},_0x52e54a={'count':0x0,'rows':[]};var _0xe49c26=_[_0x821f('0x35')](db[_0x821f('0x36')][_0x821f('0x37')],function(_0x364ab7){return{'name':_0x364ab7['fieldName'],'type':_0x364ab7[_0x821f('0x38')][_0x821f('0x39')]};});_0x20f4b9['model']=_[_0x821f('0x35')](_0xe49c26,_0x821f('0x33'));_0x20f4b9['query']=_['keys'](_0x51ff8d[_0x821f('0x3a')]);_0x20f4b9[_0x821f('0x3b')]=_[_0x821f('0x3c')](_0x20f4b9[_0x821f('0x3d')],_0x20f4b9[_0x821f('0x3a')]);_0x12ebea[_0x821f('0x3e')]=_[_0x821f('0x3c')](_0x20f4b9[_0x821f('0x3d')],qs[_0x821f('0x3f')](_0x51ff8d[_0x821f('0x3a')][_0x821f('0x3f')]));_0x12ebea[_0x821f('0x3e')]=_0x12ebea[_0x821f('0x3e')][_0x821f('0x40')]?_0x12ebea[_0x821f('0x3e')]:_0x20f4b9['model'];if(!_0x51ff8d[_0x821f('0x3a')][_0x821f('0x41')](_0x821f('0x42'))){_0x12ebea['limit']=qs[_0x821f('0x2d')](_0x51ff8d[_0x821f('0x3a')]['limit']);_0x12ebea[_0x821f('0x2c')]=qs[_0x821f('0x2c')](_0x51ff8d[_0x821f('0x3a')][_0x821f('0x2c')]);}_0x12ebea['order']=qs['sort'](_0x51ff8d[_0x821f('0x3a')][_0x821f('0x43')]);_0x12ebea[_0x821f('0x44')]=qs['filters'](_[_0x821f('0x45')](_0x51ff8d[_0x821f('0x3a')],_0x20f4b9[_0x821f('0x3b')]));if(_0x51ff8d[_0x821f('0x3a')][_0x821f('0x46')]){_0x12ebea[_0x821f('0x44')]=_[_0x821f('0x47')](_0x12ebea['where'],{'$or':_[_0x821f('0x35')](_0xe49c26,function(_0xd2263f){if(_0xd2263f[_0x821f('0x38')]!==_0x821f('0x48')){var _0x1ed170={};_0x1ed170[_0xd2263f[_0x821f('0x33')]]={'$like':'%'+_0x51ff8d[_0x821f('0x3a')][_0x821f('0x46')]+'%'};return _0x1ed170;}})});}_0x12ebea=_[_0x821f('0x47')]({},_0x12ebea,_0x51ff8d['options']);var _0x33fcd7={'where':_0x12ebea[_0x821f('0x44')]};return db['ZohoAccount']['count'](_0x33fcd7)['then'](function(_0x2c2403){_0x52e54a[_0x821f('0x49')]=_0x2c2403;if(_0x51ff8d[_0x821f('0x3a')][_0x821f('0x4a')]){_0x12ebea['include']=[{'all':!![]}];}return db[_0x821f('0x36')][_0x821f('0x4b')](_0x12ebea);})[_0x821f('0x20')](function(_0x31eeec){_0x52e54a[_0x821f('0x4c')]=_0x31eeec;return _0x52e54a;})['then'](respondWithFilteredResult(_0xcbcb8b,_0x12ebea))['catch'](handleError(_0xcbcb8b,null));};exports[_0x821f('0x4d')]=function(_0x1ac35b,_0x5cfc0f){var _0x1a4ff3={'raw':![],'where':{'id':_0x1ac35b['params']['id']}},_0x4aa66e={};_0x4aa66e[_0x821f('0x3d')]=_['keys'](db[_0x821f('0x36')][_0x821f('0x37')]);_0x4aa66e['query']=_[_0x821f('0x4e')](_0x1ac35b[_0x821f('0x3a')]);_0x4aa66e[_0x821f('0x3b')]=_['intersection'](_0x4aa66e[_0x821f('0x3d')],_0x4aa66e[_0x821f('0x3a')]);_0x1a4ff3[_0x821f('0x3e')]=_[_0x821f('0x3c')](_0x4aa66e[_0x821f('0x3d')],qs[_0x821f('0x3f')](_0x1ac35b[_0x821f('0x3a')][_0x821f('0x3f')]));_0x1a4ff3[_0x821f('0x3e')]=_0x1a4ff3[_0x821f('0x3e')][_0x821f('0x40')]?_0x1a4ff3['attributes']:_0x4aa66e[_0x821f('0x3d')];if(_0x1ac35b['query'][_0x821f('0x4a')]){_0x1a4ff3[_0x821f('0x4f')]=[{'all':!![]}];}_0x1a4ff3=_[_0x821f('0x47')]({},_0x1a4ff3,_0x1ac35b[_0x821f('0x50')]);return db[_0x821f('0x36')][_0x821f('0x51')](_0x1a4ff3)[_0x821f('0x20')](handleEntityNotFound(_0x5cfc0f,null))[_0x821f('0x20')](respondWithResult(_0x5cfc0f,null))[_0x821f('0x52')](handleError(_0x5cfc0f,null));};exports[_0x821f('0x53')]=function(_0x5bad36,_0x33ad73){return db[_0x821f('0x36')][_0x821f('0x53')](_0x5bad36[_0x821f('0x54')],{})[_0x821f('0x20')](respondWithResult(_0x33ad73,0xc9))[_0x821f('0x52')](handleError(_0x33ad73,null));};exports[_0x821f('0x31')]=function(_0x214448,_0xe5ae89){if(_0x214448[_0x821f('0x54')]['id']){delete _0x214448[_0x821f('0x54')]['id'];}return db[_0x821f('0x36')]['find']({'where':{'id':_0x214448[_0x821f('0x55')]['id']}})[_0x821f('0x20')](handleEntityNotFound(_0xe5ae89,null))[_0x821f('0x20')](saveUpdates(_0x214448[_0x821f('0x54')],null))[_0x821f('0x20')](respondWithResult(_0xe5ae89,null))[_0x821f('0x52')](handleError(_0xe5ae89,null));};exports[_0x821f('0x56')]=function(_0x239068,_0x51a1a8){return db['ZohoAccount'][_0x821f('0x51')]({'where':{'id':_0x239068[_0x821f('0x55')]['id']}})['then'](handleEntityNotFound(_0x51a1a8,null))[_0x821f('0x20')](removeEntity(_0x51a1a8,null))['catch'](handleError(_0x51a1a8,null));};exports['getConfigurations']=function(_0x1042ac,_0x1fbc6f,_0x2ee6f9){var _0x32423e={};var _0x34b72c={};var _0x1c2b42;var _0x36f742;return db[_0x821f('0x36')]['findOne']({'where':{'id':_0x1042ac[_0x821f('0x55')]['id']}})[_0x821f('0x20')](handleEntityNotFound(_0x1fbc6f,null))[_0x821f('0x20')](function(_0x441193){if(_0x441193){_0x1c2b42=_0x441193;_0x34b72c[_0x821f('0x3d')]=_[_0x821f('0x4e')](db[_0x821f('0x57')][_0x821f('0x37')]);_0x34b72c[_0x821f('0x3a')]=_[_0x821f('0x4e')](_0x1042ac[_0x821f('0x3a')]);_0x34b72c[_0x821f('0x3b')]=_[_0x821f('0x3c')](_0x34b72c[_0x821f('0x3d')],_0x34b72c[_0x821f('0x3a')]);_0x32423e[_0x821f('0x3e')]=_[_0x821f('0x3c')](_0x34b72c[_0x821f('0x3d')],qs[_0x821f('0x3f')](_0x1042ac['query'][_0x821f('0x3f')]));_0x32423e['attributes']=_0x32423e[_0x821f('0x3e')][_0x821f('0x40')]?_0x32423e[_0x821f('0x3e')]:_0x34b72c['model'];_0x32423e[_0x821f('0x58')]=qs['sort'](_0x1042ac['query'][_0x821f('0x43')]);_0x32423e[_0x821f('0x44')]=qs[_0x821f('0x3b')](_['pick'](_0x1042ac[_0x821f('0x3a')],_0x34b72c[_0x821f('0x3b')]));if(_0x1042ac[_0x821f('0x3a')][_0x821f('0x46')]){_0x32423e[_0x821f('0x44')]=_[_0x821f('0x47')](_0x32423e['where'],{'$or':_[_0x821f('0x35')](_0x32423e['attributes'],function(_0x1eedab){var _0x435ac0={};_0x435ac0[_0x1eedab]={'$like':'%'+_0x1042ac[_0x821f('0x3a')][_0x821f('0x46')]+'%'};return _0x435ac0;})});}_0x32423e=_[_0x821f('0x47')]({},_0x32423e,_0x1042ac[_0x821f('0x50')]);return _0x1c2b42[_0x821f('0x59')](_0x32423e);}})[_0x821f('0x20')](function(_0x96deab){if(_0x96deab){_0x36f742=_0x96deab['length'];if(!_0x1042ac[_0x821f('0x3a')]['hasOwnProperty'](_0x821f('0x42'))){_0x32423e[_0x821f('0x2d')]=qs['limit'](_0x1042ac[_0x821f('0x3a')][_0x821f('0x2d')]);_0x32423e[_0x821f('0x2c')]=qs['offset'](_0x1042ac[_0x821f('0x3a')]['offset']);}return _0x1c2b42[_0x821f('0x59')](_0x32423e);}})[_0x821f('0x20')](function(_0x5d1d4e){if(_0x5d1d4e){return _0x5d1d4e?{'count':_0x36f742,'rows':_0x5d1d4e}:null;}})[_0x821f('0x20')](respondWithResult(_0x1fbc6f,null))[_0x821f('0x52')](handleError(_0x1fbc6f,null));};exports[_0x821f('0x5a')]=function(_0x39756a,_0x24db38,_0xecd9e7){if(_0x39756a[_0x821f('0x54')]['id']){delete _0x39756a['body']['id'];}return db[_0x821f('0x36')]['findOne']({'where':{'id':_0x39756a[_0x821f('0x55')]['id']}})[_0x821f('0x20')](handleEntityNotFound(_0x24db38,null))[_0x821f('0x20')](function(_0x3ee985){if(_0x3ee985){_0x39756a['body'][_0x821f('0x5b')]=_0x3ee985['id'];_0x39756a[_0x821f('0x54')][_0x821f('0x5c')]=integrations['getSubjects'](_0x39756a[_0x821f('0x54')][_0x821f('0x5d')],_0x39756a[_0x821f('0x54')][_0x821f('0x38')]);_0x39756a['body']['Descriptions']=integrations[_0x821f('0x5e')](_0x39756a[_0x821f('0x54')][_0x821f('0x5d')],_0x39756a['body'][_0x821f('0x38')]);return db[_0x821f('0x57')][_0x821f('0x53')](_0x39756a['body'],{'include':[{'model':db['ZohoField'],'as':'Subjects'},{'model':db[_0x821f('0x5f')],'as':_0x821f('0x60')}]});}return null;})[_0x821f('0x20')](respondWithResult(_0x24db38,null))[_0x821f('0x52')](handleError(_0x24db38,null));};function getAccessToken(_0x21f89e){return new Promise(function(_0x4f4ff3,_0x1bccfe){var _0x5cc1a9;switch(_0x21f89e['zone']){case'US':_0x5cc1a9=_0x821f('0x61');break;case'AU':_0x5cc1a9=_0x821f('0x62');break;case'EU':_0x5cc1a9='https://accounts.zoho.eu';break;case'IN':_0x5cc1a9=_0x821f('0x63');break;case'CN':_0x5cc1a9=_0x821f('0x64');break;default:_0x5cc1a9=_0x821f('0x65');break;}var _0x16d618={'method':_0x821f('0x66'),'uri':_0x5cc1a9+_0x821f('0x67'),'qs':{'refresh_token':_0x21f89e[_0x821f('0x68')],'client_id':_0x21f89e[_0x821f('0x69')],'client_secret':_0x21f89e['clientSecret'],'grant_type':_0x821f('0x6a')},'json':!![]};return rp(_0x16d618)[_0x821f('0x20')](function(_0x336ec6){if(_0x336ec6['access_token']){_0x4f4ff3(_0x336ec6[_0x821f('0x6b')]);}else{_0x1bccfe(_0x821f('0x6c'));}})['catch'](function(_0x1af646){_0x1bccfe(_0x1af646);});});}exports[_0x821f('0x6d')]=function(_0x506989,_0x1bf6be,_0x1d103e){var _0x5cf975,_0x48da40,_0x4be16e,_0x4ed585,_0x53083f;return db[_0x821f('0x36')]['findOne']({'where':{'id':_0x506989[_0x821f('0x55')]['id']},'attributes':['id',_0x821f('0x6e'),_0x821f('0x6f'),_0x821f('0x69'),_0x821f('0x70'),_0x821f('0x71'),_0x821f('0x26'),_0x821f('0x68')]})[_0x821f('0x20')](handleEntityNotFound(_0x1bf6be,null))['then'](function(_0x2d032b){_0x53083f=_0x2d032b;_0x5cf975=_0x53083f[_0x821f('0x6e')];_0x48da40=_0x5cf975===_0x821f('0x72')?'eu':_0x821f('0x73');_0x4be16e=_0x53083f[_0x821f('0x71')];var _0x32a3c2=_0x4be16e[_0x821f('0x74')](-0x1);if(_0x32a3c2==='/'||_0x32a3c2==='\x5c'||_0x32a3c2===':'){_0x4be16e=_0x4be16e[_0x821f('0x75')](0x0,_0x4be16e['lastIndexOf'](_0x32a3c2));}if(!_0x53083f[_0x821f('0x68')]){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x53083f);})[_0x821f('0x20')](function(_0xd5b8b8){if(_0xd5b8b8){return rp({'method':_0x821f('0x76'),'uri':util[_0x821f('0x77')](_0x821f('0x78'),_0x48da40),'qs':{'module':'Calls'},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0xd5b8b8},'json':!![]});}})[_0x821f('0x20')](function(_0x2f7d60){if(_0x2f7d60){if(_0x2f7d60[_0x821f('0x79')]&&_0x2f7d60[_0x821f('0x79')][_0x821f('0x25')]){throw new Error(_0x2f7d60[_0x821f('0x79')][_0x821f('0x25')][_0x821f('0x27')]);}var _0x5d6505=[];var _0x1bd77e=[];var _0x44ee0a=[_0x821f('0x7a'),_0x821f('0x7b'),_0x821f('0x7c'),_0x821f('0x7d'),'Call_Duration',_0x821f('0x7e'),_0x821f('0x7f'),_0x821f('0x80')];_0x1bd77e=_[_0x821f('0x81')](_0x2f7d60['fields'],function(_0x500758){return _0x44ee0a[_0x821f('0x82')](_0x500758[_0x821f('0x83')]);});for(var _0x5af55f=0x0;_0x5af55f<_0x1bd77e['length'];_0x5af55f++){if(_0x1bd77e[_0x5af55f][_0x821f('0x84')]===![]){_0x5d6505[_0x821f('0x85')]({'id':_0x1bd77e[_0x5af55f]['id'],'name':_0x1bd77e[_0x5af55f][_0x821f('0x86')],'custom':_0x1bd77e[_0x5af55f][_0x821f('0x87')],'options':_0x1bd77e[_0x5af55f][_0x821f('0x88')]===_0x821f('0x89')&&_0x1bd77e[_0x5af55f][_0x821f('0x8a')][_0x821f('0x40')]>-0x1?_[_0x821f('0x35')](_0x1bd77e[_0x5af55f][_0x821f('0x8a')],function(_0x2e0f99){return{'name':_0x2e0f99,'value':_0x2e0f99};}):[]});}}return{'count':_0x5d6505['length'],'rows':_0x5d6505};}else{return{'count':0x0,'rows':[]};}})[_0x821f('0x20')](respondWithResult(_0x1bf6be,null))[_0x821f('0x52')](function(_0xe89099){var _0x5688bc=_0x506989[_0x821f('0x3a')][_0x821f('0x1c')]?0x1f4:_0xe89099[_0x821f('0x8b')]||0x1f4;logger[_0x821f('0x25')](_0x821f('0x8c'),_0x821f('0x6d'),_0x5688bc,JSON['stringify'](_0xe89099));delete _0xe89099['name'];if(_0x5688bc===0x191){_0x5688bc=0x190;}_0x1bf6be[_0x821f('0x2a')](_0x5688bc)[_0x821f('0x34')](_0x506989[_0x821f('0x3a')][_0x821f('0x1c')]?{'message':_0x821f('0x8d'),'statusCode':_0xe89099['statusCode']}:_0xe89099);});}; \ No newline at end of file +var _0x369c=['find','create','body','params','getConfigurations','findOne','pick','hasOwnProperty','addConfiguration','Subjects','getSubjects','channel','Descriptions','ZohoField','zone','https://accounts.zoho.com.au','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','host','clientId','serverUrl','refreshToken','zoho.eu','com','slice','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Zoho-oauthtoken\x20','response','Owner','Subject','Description','WhoId','Call_Duration','Call_Result','includes','api_name','system_mandatory','push','display_label','data_type','picklist','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','Sequelize','ValidationError','request','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','ZohoAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','sendStatus','end','status','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','stack','name','send','index','map','ZohoAccount','fieldName','type','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','filter','where','merge','VIRTUAL','includeAll','findAll','show','rawAttributes','length','include','options'];(function(_0x2fc1b7,_0x367bb1){var _0x269066=function(_0x3fdc87){while(--_0x3fdc87){_0x2fc1b7['push'](_0x2fc1b7['shift']());}};_0x269066(++_0x367bb1);}(_0x369c,0x151));var _0xc369=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x369c[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xc369('0x0'));var emlformat=require(_0xc369('0x1'));var rimraf=require(_0xc369('0x2'));var zipdir=require(_0xc369('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc369('0x4'));var moment=require(_0xc369('0x5'));var BPromise=require(_0xc369('0x6'));var Mustache=require(_0xc369('0x7'));var util=require(_0xc369('0x8'));var path=require('path');var sox=require(_0xc369('0x9'));var csv=require(_0xc369('0xa'));var ejs=require(_0xc369('0xb'));var fs=require('fs');var _=require(_0xc369('0xc'));var squel=require(_0xc369('0xd'));var crypto=require(_0xc369('0xe'));var jsforce=require(_0xc369('0xf'));var deskjs=require(_0xc369('0x10'));var toCsv=require(_0xc369('0xa'));var querystring=require(_0xc369('0x11'));var Papa=require(_0xc369('0x12'));var Redis=require('ioredis');var authService=require(_0xc369('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xc369('0x14'));var hardwareService=require(_0xc369('0x15'));var logger=require(_0xc369('0x16'))(_0xc369('0x17'));var utils=require(_0xc369('0x18'));var config=require(_0xc369('0x19'));var db=require(_0xc369('0x1a'))['db'];var integrations=require(_0xc369('0x1b'));var jayson=require(_0xc369('0x1c'));var client=jayson[_0xc369('0x1d')][_0xc369('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x30faee,_0x444faf,_0x36d480){if(_0x36d480){var _0x2e1681=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2e1681[_0xc369('0x1f')](_0x444faf)){return _0x30faee;}else{throw new db[(_0xc369('0x20'))][(_0xc369('0x21'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x30faee;}}function respondWithRpcPromise(_0x55fe15,_0x556191,_0x2df765,_0x17122f){return new BPromise(function(_0x559d14,_0x539cfe){var _0x4f8ebf=_0x17122f||client;return _0x4f8ebf[_0xc369('0x22')](_0x55fe15,_0x2df765)['then'](function(_0x331518){logger[_0xc369('0x23')](_0xc369('0x24'),_0x556191,_0xc369('0x25'));logger['debug'](_0xc369('0x26'),_0x556191,_0xc369('0x25'),JSON['stringify'](_0x331518));if(_0x331518[_0xc369('0x27')]){if(_0x331518[_0xc369('0x27')][_0xc369('0x28')]===0x1f4){logger[_0xc369('0x27')](_0xc369('0x24'),_0x556191,_0x331518[_0xc369('0x27')][_0xc369('0x29')]);return _0x539cfe(_0x331518[_0xc369('0x27')][_0xc369('0x29')]);}logger[_0xc369('0x27')](_0xc369('0x24'),_0x556191,_0x331518[_0xc369('0x27')][_0xc369('0x29')]);return _0x559d14(_0x331518['error'][_0xc369('0x29')]);}else{logger[_0xc369('0x23')](_0xc369('0x24'),_0x556191,_0xc369('0x25'));_0x559d14(_0x331518['result'][_0xc369('0x29')]);}})[_0xc369('0x2a')](function(_0x44f980){logger[_0xc369('0x27')](_0xc369('0x24'),_0x556191,_0x44f980);_0x539cfe(_0x44f980);});});}function respondWithStatusCode(_0x4fb790,_0x5f1747){_0x5f1747=_0x5f1747||0xcc;return function(_0x1a9d88){if(_0x1a9d88){return _0x4fb790[_0xc369('0x2b')](_0x5f1747);}return _0x4fb790['status'](_0x5f1747)[_0xc369('0x2c')]();};}function respondWithResult(_0x68ae01,_0x5bbe1a){_0x5bbe1a=_0x5bbe1a||0xc8;return function(_0x59b574){if(_0x59b574){return _0x68ae01[_0xc369('0x2d')](_0x5bbe1a)[_0xc369('0x2e')](_0x59b574);}};}function respondWithFilteredResult(_0xb70ab,_0x5d04f0){return function(_0x1b9135){if(_0x1b9135){var _0x2ac821=_0x1b9135[_0xc369('0x2f')],_0x3a5b4d=_0x5d04f0[_0xc369('0x30')],_0x54acfb=_0x5d04f0['offset']+_0x5d04f0[_0xc369('0x31')],_0x32080f;if(_0x54acfb>=_0x2ac821){_0x54acfb=_0x2ac821;_0x32080f=0xc8;}else{_0x32080f=0xce;}_0xb70ab[_0xc369('0x2d')](_0x32080f);return _0xb70ab[_0xc369('0x32')](_0xc369('0x33'),_0x3a5b4d+'-'+_0x54acfb+'/'+_0x2ac821)[_0xc369('0x2e')](_0x1b9135);}return null;};}function patchUpdates(_0xd76419){return function(_0x1af144){try{jsonpatch['apply'](_0x1af144,_0xd76419,!![]);}catch(_0x24ee5a){return BPromise[_0xc369('0x34')](_0x24ee5a);}return _0x1af144[_0xc369('0x35')]();};}function saveUpdates(_0x26611b,_0x19747e){return function(_0x20a3b1){if(_0x20a3b1){return _0x20a3b1[_0xc369('0x36')](_0x26611b)[_0xc369('0x37')](function(_0x2f9be0){return _0x2f9be0;});}return null;};}function removeEntity(_0x297c46,_0x311a09){return function(_0x385f9d){if(_0x385f9d){return _0x385f9d[_0xc369('0x38')]()[_0xc369('0x37')](function(){_0x297c46[_0xc369('0x2d')](0xcc)[_0xc369('0x2c')]();});}};}function handleEntityNotFound(_0x192c4f,_0xf89462){return function(_0x2b0fde){if(!_0x2b0fde){_0x192c4f['sendStatus'](0x194);}return _0x2b0fde;};}function handleError(_0x5a2336,_0x1bd662){_0x1bd662=_0x1bd662||0x1f4;return function(_0x46c824){logger[_0xc369('0x27')](_0x46c824[_0xc369('0x39')]);if(_0x46c824[_0xc369('0x3a')]){delete _0x46c824[_0xc369('0x3a')];}_0x5a2336['status'](_0x1bd662)[_0xc369('0x3b')](_0x46c824);};}exports[_0xc369('0x3c')]=function(_0x1dbcc4,_0x90d9e6){var _0x547f94={},_0x1631f0={},_0x567c4e={'count':0x0,'rows':[]};var _0x230117=_[_0xc369('0x3d')](db[_0xc369('0x3e')]['rawAttributes'],function(_0x35fa20){return{'name':_0x35fa20[_0xc369('0x3f')],'type':_0x35fa20[_0xc369('0x40')]['key']};});_0x1631f0[_0xc369('0x41')]=_[_0xc369('0x3d')](_0x230117,'name');_0x1631f0[_0xc369('0x42')]=_[_0xc369('0x43')](_0x1dbcc4[_0xc369('0x42')]);_0x1631f0[_0xc369('0x44')]=_[_0xc369('0x45')](_0x1631f0[_0xc369('0x41')],_0x1631f0[_0xc369('0x42')]);_0x547f94[_0xc369('0x46')]=_[_0xc369('0x45')](_0x1631f0[_0xc369('0x41')],qs['fields'](_0x1dbcc4['query'][_0xc369('0x47')]));_0x547f94[_0xc369('0x46')]=_0x547f94[_0xc369('0x46')]['length']?_0x547f94[_0xc369('0x46')]:_0x1631f0[_0xc369('0x41')];if(!_0x1dbcc4[_0xc369('0x42')]['hasOwnProperty'](_0xc369('0x48'))){_0x547f94[_0xc369('0x31')]=qs['limit'](_0x1dbcc4['query'][_0xc369('0x31')]);_0x547f94[_0xc369('0x30')]=qs[_0xc369('0x30')](_0x1dbcc4[_0xc369('0x42')][_0xc369('0x30')]);}_0x547f94[_0xc369('0x49')]=qs[_0xc369('0x4a')](_0x1dbcc4[_0xc369('0x42')][_0xc369('0x4a')]);_0x547f94['where']=qs[_0xc369('0x44')](_['pick'](_0x1dbcc4[_0xc369('0x42')],_0x1631f0['filters']));if(_0x1dbcc4[_0xc369('0x42')][_0xc369('0x4b')]){_0x547f94[_0xc369('0x4c')]=_[_0xc369('0x4d')](_0x547f94[_0xc369('0x4c')],{'$or':_['map'](_0x230117,function(_0x526dcd){if(_0x526dcd[_0xc369('0x40')]!==_0xc369('0x4e')){var _0x113e97={};_0x113e97[_0x526dcd[_0xc369('0x3a')]]={'$like':'%'+_0x1dbcc4[_0xc369('0x42')][_0xc369('0x4b')]+'%'};return _0x113e97;}})});}_0x547f94=_[_0xc369('0x4d')]({},_0x547f94,_0x1dbcc4['options']);var _0x27806e={'where':_0x547f94[_0xc369('0x4c')]};return db[_0xc369('0x3e')][_0xc369('0x2f')](_0x27806e)['then'](function(_0x252355){_0x567c4e['count']=_0x252355;if(_0x1dbcc4['query'][_0xc369('0x4f')]){_0x547f94['include']=[{'all':!![]}];}return db['ZohoAccount'][_0xc369('0x50')](_0x547f94);})[_0xc369('0x37')](function(_0x302f56){_0x567c4e['rows']=_0x302f56;return _0x567c4e;})['then'](respondWithFilteredResult(_0x90d9e6,_0x547f94))[_0xc369('0x2a')](handleError(_0x90d9e6,null));};exports[_0xc369('0x51')]=function(_0x55acbd,_0x5cec32){var _0x400830={'raw':![],'where':{'id':_0x55acbd['params']['id']}},_0x3ecab1={};_0x3ecab1[_0xc369('0x41')]=_[_0xc369('0x43')](db['ZohoAccount'][_0xc369('0x52')]);_0x3ecab1[_0xc369('0x42')]=_['keys'](_0x55acbd['query']);_0x3ecab1[_0xc369('0x44')]=_['intersection'](_0x3ecab1['model'],_0x3ecab1[_0xc369('0x42')]);_0x400830['attributes']=_[_0xc369('0x45')](_0x3ecab1[_0xc369('0x41')],qs[_0xc369('0x47')](_0x55acbd[_0xc369('0x42')][_0xc369('0x47')]));_0x400830[_0xc369('0x46')]=_0x400830['attributes'][_0xc369('0x53')]?_0x400830[_0xc369('0x46')]:_0x3ecab1[_0xc369('0x41')];if(_0x55acbd['query'][_0xc369('0x4f')]){_0x400830[_0xc369('0x54')]=[{'all':!![]}];}_0x400830=_[_0xc369('0x4d')]({},_0x400830,_0x55acbd[_0xc369('0x55')]);return db[_0xc369('0x3e')][_0xc369('0x56')](_0x400830)['then'](handleEntityNotFound(_0x5cec32,null))[_0xc369('0x37')](respondWithResult(_0x5cec32,null))['catch'](handleError(_0x5cec32,null));};exports[_0xc369('0x57')]=function(_0x3d71a1,_0x130392){return db['ZohoAccount'][_0xc369('0x57')](_0x3d71a1[_0xc369('0x58')],{})['then'](respondWithResult(_0x130392,0xc9))['catch'](handleError(_0x130392,null));};exports[_0xc369('0x36')]=function(_0x2e1d55,_0x498bcd){if(_0x2e1d55['body']['id']){delete _0x2e1d55[_0xc369('0x58')]['id'];}return db[_0xc369('0x3e')][_0xc369('0x56')]({'where':{'id':_0x2e1d55[_0xc369('0x59')]['id']}})[_0xc369('0x37')](handleEntityNotFound(_0x498bcd,null))['then'](saveUpdates(_0x2e1d55[_0xc369('0x58')],null))[_0xc369('0x37')](respondWithResult(_0x498bcd,null))[_0xc369('0x2a')](handleError(_0x498bcd,null));};exports['destroy']=function(_0x2e8fcb,_0x527da0){return db['ZohoAccount'][_0xc369('0x56')]({'where':{'id':_0x2e8fcb[_0xc369('0x59')]['id']}})[_0xc369('0x37')](handleEntityNotFound(_0x527da0,null))[_0xc369('0x37')](removeEntity(_0x527da0,null))['catch'](handleError(_0x527da0,null));};exports[_0xc369('0x5a')]=function(_0x1dcd14,_0x177ca7,_0xc0c373){var _0x4753c2={};var _0x454c08={};var _0x4f7cef;var _0x5f3026;return db[_0xc369('0x3e')][_0xc369('0x5b')]({'where':{'id':_0x1dcd14[_0xc369('0x59')]['id']}})['then'](handleEntityNotFound(_0x177ca7,null))[_0xc369('0x37')](function(_0x1c13df){if(_0x1c13df){_0x4f7cef=_0x1c13df;_0x454c08['model']=_[_0xc369('0x43')](db['ZohoConfiguration'][_0xc369('0x52')]);_0x454c08['query']=_['keys'](_0x1dcd14[_0xc369('0x42')]);_0x454c08['filters']=_[_0xc369('0x45')](_0x454c08[_0xc369('0x41')],_0x454c08[_0xc369('0x42')]);_0x4753c2[_0xc369('0x46')]=_[_0xc369('0x45')](_0x454c08[_0xc369('0x41')],qs['fields'](_0x1dcd14['query'][_0xc369('0x47')]));_0x4753c2[_0xc369('0x46')]=_0x4753c2[_0xc369('0x46')]['length']?_0x4753c2[_0xc369('0x46')]:_0x454c08[_0xc369('0x41')];_0x4753c2[_0xc369('0x49')]=qs['sort'](_0x1dcd14['query'][_0xc369('0x4a')]);_0x4753c2[_0xc369('0x4c')]=qs['filters'](_[_0xc369('0x5c')](_0x1dcd14[_0xc369('0x42')],_0x454c08[_0xc369('0x44')]));if(_0x1dcd14[_0xc369('0x42')][_0xc369('0x4b')]){_0x4753c2[_0xc369('0x4c')]=_[_0xc369('0x4d')](_0x4753c2[_0xc369('0x4c')],{'$or':_['map'](_0x4753c2['attributes'],function(_0x84598){var _0xb67aad={};_0xb67aad[_0x84598]={'$like':'%'+_0x1dcd14[_0xc369('0x42')][_0xc369('0x4b')]+'%'};return _0xb67aad;})});}_0x4753c2=_['merge']({},_0x4753c2,_0x1dcd14['options']);return _0x4f7cef[_0xc369('0x5a')](_0x4753c2);}})[_0xc369('0x37')](function(_0x5ab6f7){if(_0x5ab6f7){_0x5f3026=_0x5ab6f7[_0xc369('0x53')];if(!_0x1dcd14[_0xc369('0x42')][_0xc369('0x5d')](_0xc369('0x48'))){_0x4753c2[_0xc369('0x31')]=qs[_0xc369('0x31')](_0x1dcd14[_0xc369('0x42')]['limit']);_0x4753c2[_0xc369('0x30')]=qs[_0xc369('0x30')](_0x1dcd14[_0xc369('0x42')]['offset']);}return _0x4f7cef[_0xc369('0x5a')](_0x4753c2);}})[_0xc369('0x37')](function(_0x2d6ee6){if(_0x2d6ee6){return _0x2d6ee6?{'count':_0x5f3026,'rows':_0x2d6ee6}:null;}})['then'](respondWithResult(_0x177ca7,null))[_0xc369('0x2a')](handleError(_0x177ca7,null));};exports[_0xc369('0x5e')]=function(_0x47d5a6,_0x316f70,_0x5739eb){if(_0x47d5a6['body']['id']){delete _0x47d5a6['body']['id'];}return db[_0xc369('0x3e')][_0xc369('0x5b')]({'where':{'id':_0x47d5a6[_0xc369('0x59')]['id']}})[_0xc369('0x37')](handleEntityNotFound(_0x316f70,null))['then'](function(_0x20f5b1){if(_0x20f5b1){_0x47d5a6[_0xc369('0x58')]['AccountId']=_0x20f5b1['id'];_0x47d5a6[_0xc369('0x58')][_0xc369('0x5f')]=integrations[_0xc369('0x60')](_0x47d5a6[_0xc369('0x58')][_0xc369('0x61')],_0x47d5a6['body'][_0xc369('0x40')]);_0x47d5a6['body'][_0xc369('0x62')]=integrations['getDescriptions'](_0x47d5a6[_0xc369('0x58')][_0xc369('0x61')],_0x47d5a6[_0xc369('0x58')]['type']);return db['ZohoConfiguration']['create'](_0x47d5a6[_0xc369('0x58')],{'include':[{'model':db[_0xc369('0x63')],'as':_0xc369('0x5f')},{'model':db['ZohoField'],'as':'Descriptions'}]});}return null;})[_0xc369('0x37')](respondWithResult(_0x316f70,null))[_0xc369('0x2a')](handleError(_0x316f70,null));};function getAccessToken(_0x55002c){return new Promise(function(_0x388b4f,_0x2dbd0c){var _0x4f3985;switch(_0x55002c[_0xc369('0x64')]){case'US':_0x4f3985='https://accounts.zoho.com';break;case'AU':_0x4f3985=_0xc369('0x65');break;case'EU':_0x4f3985='https://accounts.zoho.eu';break;case'IN':_0x4f3985='https://accounts.zoho.in';break;case'CN':_0x4f3985=_0xc369('0x66');break;default:_0x4f3985=_0xc369('0x67');break;}var _0x503800={'method':_0xc369('0x68'),'uri':_0x4f3985+_0xc369('0x69'),'qs':{'refresh_token':_0x55002c['refreshToken'],'client_id':_0x55002c['clientId'],'client_secret':_0x55002c[_0xc369('0x6a')],'grant_type':_0xc369('0x6b')},'json':!![]};return rp(_0x503800)[_0xc369('0x37')](function(_0x5c0fb6){if(_0x5c0fb6['access_token']){_0x388b4f(_0x5c0fb6[_0xc369('0x6c')]);}else{_0x2dbd0c(_0xc369('0x6d'));}})['catch'](function(_0x51360a){_0x2dbd0c(_0x51360a);});});}exports['getFields']=function(_0x4b2678,_0x39ebb6,_0x1b9ae6){var _0x171c29,_0x63c1bb,_0x2698b1,_0x548f45,_0x4fb095;return db[_0xc369('0x3e')]['findOne']({'where':{'id':_0x4b2678['params']['id']},'attributes':['id',_0xc369('0x6e'),_0xc369('0x64'),_0xc369('0x6f'),_0xc369('0x6a'),_0xc369('0x70'),_0xc369('0x28'),_0xc369('0x71')]})[_0xc369('0x37')](handleEntityNotFound(_0x39ebb6,null))[_0xc369('0x37')](function(_0x14ab5f){_0x4fb095=_0x14ab5f;_0x171c29=_0x4fb095[_0xc369('0x6e')];_0x63c1bb=_0x171c29===_0xc369('0x72')?'eu':_0xc369('0x73');_0x2698b1=_0x4fb095[_0xc369('0x70')];var _0x531783=_0x2698b1[_0xc369('0x74')](-0x1);if(_0x531783==='/'||_0x531783==='\x5c'||_0x531783===':'){_0x2698b1=_0x2698b1['substring'](0x0,_0x2698b1[_0xc369('0x75')](_0x531783));}if(!_0x4fb095[_0xc369('0x71')]){throw new Error(_0xc369('0x76'));}return getAccessToken(_0x4fb095);})[_0xc369('0x37')](function(_0x1ebdf0){if(_0x1ebdf0){return rp({'method':_0xc369('0x77'),'uri':util[_0xc369('0x78')](_0xc369('0x79'),_0x63c1bb),'qs':{'module':'Calls'},'headers':{'Authorization':_0xc369('0x7a')+_0x1ebdf0},'json':!![]});}})['then'](function(_0x42c2e4){if(_0x42c2e4){if(_0x42c2e4['response']&&_0x42c2e4[_0xc369('0x7b')][_0xc369('0x27')]){throw new Error(_0x42c2e4[_0xc369('0x7b')]['error'][_0xc369('0x29')]);}var _0x45ea4d=[];var _0xf7ac61=[];var _0x48d684=[_0xc369('0x7c'),_0xc369('0x7d'),_0xc369('0x7e'),_0xc369('0x7f'),_0xc369('0x80'),_0xc369('0x81'),'Call_Start_Time','Call_Type'];_0xf7ac61=_['remove'](_0x42c2e4['fields'],function(_0x5a2165){return _0x48d684[_0xc369('0x82')](_0x5a2165[_0xc369('0x83')]);});for(var _0x54b7bf=0x0;_0x54b7bf<_0xf7ac61[_0xc369('0x53')];_0x54b7bf++){if(_0xf7ac61[_0x54b7bf][_0xc369('0x84')]===![]){_0x45ea4d[_0xc369('0x85')]({'id':_0xf7ac61[_0x54b7bf]['id'],'name':_0xf7ac61[_0x54b7bf][_0xc369('0x86')],'custom':_0xf7ac61[_0x54b7bf]['custom_field'],'options':_0xf7ac61[_0x54b7bf][_0xc369('0x87')]===_0xc369('0x88')&&_0xf7ac61[_0x54b7bf]['pick_list_values'][_0xc369('0x53')]>-0x1?_[_0xc369('0x3d')](_0xf7ac61[_0x54b7bf]['pick_list_values'],function(_0x3aac6f){return{'name':_0x3aac6f,'value':_0x3aac6f};}):[]});}}return{'count':_0x45ea4d[_0xc369('0x53')],'rows':_0x45ea4d};}else{return{'count':0x0,'rows':[]};}})[_0xc369('0x37')](respondWithResult(_0x39ebb6,null))[_0xc369('0x2a')](function(_0x43ceb3){var _0x11a880=_0x4b2678[_0xc369('0x42')][_0xc369('0x1f')]?0x1f4:_0x43ceb3[_0xc369('0x89')]||0x1f4;logger[_0xc369('0x27')](_0xc369('0x8a'),_0xc369('0x8b'),_0x11a880,JSON[_0xc369('0x8c')](_0x43ceb3));delete _0x43ceb3[_0xc369('0x3a')];if(_0x11a880===0x191){_0x11a880=0x190;}_0x39ebb6[_0xc369('0x2d')](_0x11a880)[_0xc369('0x3b')](_0x4b2678[_0xc369('0x42')][_0xc369('0x1f')]?{'message':'Wrong\x20credentials','statusCode':_0x43ceb3[_0xc369('0x89')]}:_0x43ceb3);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 0d1cc23..0bdb6ea 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 _0x7b11=['serverUrl','clientId','clientSecret','code','host','slice','substring','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','application/x-www-form-urlencoded','then','refresh_token','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','error','parse','catch','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','define','ZohoAccount','int_zoho_accounts','zone','changed'];(function(_0x357e3d,_0x203266){var _0x2e3754=function(_0x46347a){while(--_0x46347a){_0x357e3d['push'](_0x357e3d['shift']());}};_0x2e3754(++_0x203266);}(_0x7b11,0x19f));var _0x17b1=function(_0x2b81fd,_0x6d1870){_0x2b81fd=_0x2b81fd-0x0;var _0x530475=_0x7b11[_0x2b81fd];return _0x530475;};'use strict';var _=require(_0x17b1('0x0'));var util=require(_0x17b1('0x1'));var logger=require(_0x17b1('0x2'))(_0x17b1('0x3'));var moment=require(_0x17b1('0x4'));var BPromise=require(_0x17b1('0x5'));var rp=require(_0x17b1('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x17b1('0x7'));var attributes=require(_0x17b1('0x8'));var integrations=require(_0x17b1('0x9'));module['exports']=function(_0xa0836,_0x4e8b61){return _0xa0836[_0x17b1('0xa')](_0x17b1('0xb'),attributes,{'tableName':_0x17b1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x58b9cb,_0x17fda4,_0x16beca){if(_0x58b9cb['changed'](_0x17b1('0xd'))||_0x58b9cb[_0x17b1('0xe')](_0x17b1('0xf'))||_0x58b9cb[_0x17b1('0xe')](_0x17b1('0x10'))||_0x58b9cb[_0x17b1('0xe')](_0x17b1('0x11'))||_0x58b9cb[_0x17b1('0xe')](_0x17b1('0x12'))||_0x58b9cb[_0x17b1('0xe')](_0x17b1('0x13'))){var _0x50bc88,_0x13d803;_0x50bc88=_0x58b9cb['serverUrl'];var _0x3ca8d6=_0x50bc88[_0x17b1('0x14')](-0x1);if(_0x3ca8d6==='/'||_0x3ca8d6==='\x5c'||_0x3ca8d6===':'){_0x50bc88=_0x50bc88[_0x17b1('0x15')](0x0,_0x50bc88['lastIndexOf'](_0x3ca8d6));}switch(_0x58b9cb['zone']){case'US':_0x13d803=_0x17b1('0x16');break;case'AU':_0x13d803=_0x17b1('0x17');break;case'IN':_0x13d803=_0x17b1('0x18');break;case'CN':_0x13d803=_0x17b1('0x19');break;default:_0x13d803=_0x17b1('0x1a');break;}var _0x29d3f1={'method':_0x17b1('0x1b'),'uri':_0x13d803+_0x17b1('0x1c'),'form':{'grant_type':_0x17b1('0x1d'),'client_id':_0x58b9cb[_0x17b1('0x10')],'client_secret':_0x58b9cb[_0x17b1('0x11')],'redirect_uri':_0x58b9cb[_0x17b1('0xf')],'code':_0x58b9cb[_0x17b1('0x12')]},'headers':{'Content-Type':_0x17b1('0x1e')}};return rp(_0x29d3f1)[_0x17b1('0x1f')](function(_0x51c3f5){var _0x3a2ef4=JSON['parse'](_0x51c3f5);if(_0x3a2ef4[_0x17b1('0x20')]){_0x58b9cb[_0x17b1('0x21')]=_0x3a2ef4[_0x17b1('0x20')];logger[_0x17b1('0x22')](util[_0x17b1('0x23')](_0x17b1('0x24'),_0x58b9cb[_0x17b1('0x25')],_0x58b9cb['id']));}else{logger['error'](util[_0x17b1('0x23')](_0x17b1('0x26'),_0x58b9cb[_0x17b1('0x25')],_0x58b9cb['id']),util[_0x17b1('0x27')](_0x3a2ef4,{'showHidden':![],'depth':null}));}return _0x16beca(null,_0x17fda4);})['catch'](function(_0x46fa95){logger[_0x17b1('0x28')](util[_0x17b1('0x23')](_0x17b1('0x26'),_0x58b9cb['name'],_0x58b9cb['id']),util[_0x17b1('0x27')](parsedResult,{'showHidden':![],'depth':null}));return _0x16beca(_0x46fa95);});}else{return _0x16beca(null,_0x17fda4);}},'beforeUpdate':function(_0x5af52e,_0x467f40,_0x47eee9){if(_0x5af52e[_0x17b1('0xe')](_0x17b1('0xd'))||_0x5af52e[_0x17b1('0xe')]('serverUrl')||_0x5af52e[_0x17b1('0xe')]('clientId')||_0x5af52e[_0x17b1('0xe')](_0x17b1('0x11'))||_0x5af52e[_0x17b1('0xe')](_0x17b1('0x12'))||_0x5af52e[_0x17b1('0xe')](_0x17b1('0x13'))){var _0x5b814f,_0xfdf978;_0x5b814f=_0x5af52e['serverUrl'];var _0x3aa8fc=_0x5b814f[_0x17b1('0x14')](-0x1);if(_0x3aa8fc==='/'||_0x3aa8fc==='\x5c'||_0x3aa8fc===':'){_0x5b814f=_0x5b814f[_0x17b1('0x15')](0x0,_0x5b814f['lastIndexOf'](_0x3aa8fc));}switch(_0x5af52e[_0x17b1('0xd')]){case'US':_0xfdf978='https://accounts.zoho.com';break;case'AU':_0xfdf978=_0x17b1('0x17');break;case'IN':_0xfdf978=_0x17b1('0x18');break;case'CN':_0xfdf978=_0x17b1('0x19');break;default:_0xfdf978='https://accounts.zoho.eu';break;}var _0x51efc2={'method':_0x17b1('0x1b'),'uri':_0xfdf978+'/oauth/v2/token','form':{'grant_type':_0x17b1('0x1d'),'client_id':_0x5af52e[_0x17b1('0x10')],'client_secret':_0x5af52e[_0x17b1('0x11')],'redirect_uri':_0x5af52e[_0x17b1('0xf')],'code':_0x5af52e[_0x17b1('0x12')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x51efc2)[_0x17b1('0x1f')](function(_0x1cb737){var _0x4b8d83=JSON[_0x17b1('0x29')](_0x1cb737);if(_0x4b8d83['refresh_token']){_0x5af52e[_0x17b1('0x21')]=_0x4b8d83[_0x17b1('0x20')];logger[_0x17b1('0x22')](util[_0x17b1('0x23')](_0x17b1('0x24'),_0x5af52e[_0x17b1('0x25')],_0x5af52e['id']));}else{logger[_0x17b1('0x28')](util[_0x17b1('0x23')](_0x17b1('0x26'),_0x5af52e[_0x17b1('0x25')],_0x5af52e['id']),util['inspect'](_0x4b8d83,{'showHidden':![],'depth':null}));}return _0x47eee9(null,_0x467f40);})[_0x17b1('0x2a')](function(_0x5c7643){logger[_0x17b1('0x28')](util[_0x17b1('0x23')](_0x17b1('0x26'),_0x5af52e[_0x17b1('0x25')],_0x5af52e['id']),util[_0x17b1('0x27')](parsedResult,{'showHidden':![],'depth':null}));return _0x47eee9(_0x5c7643);});}else{return _0x47eee9(null,_0x467f40);}}}});}; \ No newline at end of file +var _0xe4a0=['format','name','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','host','lastIndexOf','https://accounts.zoho.com.cn','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','error','util','moment','path','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','int_zoho_accounts','changed','serverUrl','clientId','clientSecret','code','slice','substring','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.eu','POST','authorization_code','application/x-www-form-urlencoded','then','parse','refresh_token','refreshToken','info'];(function(_0x119b3e,_0x588d50){var _0x1169ae=function(_0x377422){while(--_0x377422){_0x119b3e['push'](_0x119b3e['shift']());}};_0x1169ae(++_0x588d50);}(_0xe4a0,0xd2));var _0x0e4a=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xe4a0[_0x53ccf2];return _0x5a2964;};'use strict';var _=require('lodash');var util=require(_0x0e4a('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x0e4a('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0e4a('0x2'));var rimraf=require(_0x0e4a('0x3'));var config=require(_0x0e4a('0x4'));var attributes=require(_0x0e4a('0x5'));var integrations=require(_0x0e4a('0x6'));module[_0x0e4a('0x7')]=function(_0x245c3a,_0x2b0af7){return _0x245c3a[_0x0e4a('0x8')]('ZohoAccount',attributes,{'tableName':_0x0e4a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x21e5a6,_0x242c43,_0x5a3bba){if(_0x21e5a6[_0x0e4a('0xa')]('zone')||_0x21e5a6[_0x0e4a('0xa')](_0x0e4a('0xb'))||_0x21e5a6[_0x0e4a('0xa')](_0x0e4a('0xc'))||_0x21e5a6[_0x0e4a('0xa')](_0x0e4a('0xd'))||_0x21e5a6['changed'](_0x0e4a('0xe'))||_0x21e5a6['changed']('host')){var _0x59fc87,_0x4eae16;_0x59fc87=_0x21e5a6[_0x0e4a('0xb')];var _0x1d335c=_0x59fc87[_0x0e4a('0xf')](-0x1);if(_0x1d335c==='/'||_0x1d335c==='\x5c'||_0x1d335c===':'){_0x59fc87=_0x59fc87[_0x0e4a('0x10')](0x0,_0x59fc87['lastIndexOf'](_0x1d335c));}switch(_0x21e5a6[_0x0e4a('0x11')]){case'US':_0x4eae16=_0x0e4a('0x12');break;case'AU':_0x4eae16=_0x0e4a('0x13');break;case'IN':_0x4eae16=_0x0e4a('0x14');break;case'CN':_0x4eae16='https://accounts.zoho.com.cn';break;default:_0x4eae16=_0x0e4a('0x15');break;}var _0x2a8564={'method':_0x0e4a('0x16'),'uri':_0x4eae16+'/oauth/v2/token','form':{'grant_type':_0x0e4a('0x17'),'client_id':_0x21e5a6['clientId'],'client_secret':_0x21e5a6[_0x0e4a('0xd')],'redirect_uri':_0x21e5a6['serverUrl'],'code':_0x21e5a6[_0x0e4a('0xe')]},'headers':{'Content-Type':_0x0e4a('0x18')}};return rp(_0x2a8564)[_0x0e4a('0x19')](function(_0x2725db){var _0x2b7ab2=JSON[_0x0e4a('0x1a')](_0x2725db);if(_0x2b7ab2[_0x0e4a('0x1b')]){_0x21e5a6[_0x0e4a('0x1c')]=_0x2b7ab2[_0x0e4a('0x1b')];logger[_0x0e4a('0x1d')](util[_0x0e4a('0x1e')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x21e5a6[_0x0e4a('0x1f')],_0x21e5a6['id']));}else{logger['error'](util[_0x0e4a('0x1e')](_0x0e4a('0x20'),_0x21e5a6['name'],_0x21e5a6['id']),util[_0x0e4a('0x21')](_0x2b7ab2,{'showHidden':![],'depth':null}));}return _0x5a3bba(null,_0x242c43);})[_0x0e4a('0x22')](function(_0x4d4870){logger['error'](util[_0x0e4a('0x1e')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x21e5a6[_0x0e4a('0x1f')],_0x21e5a6['id']),util[_0x0e4a('0x21')](parsedResult,{'showHidden':![],'depth':null}));return _0x5a3bba(_0x4d4870);});}else{return _0x5a3bba(null,_0x242c43);}},'beforeUpdate':function(_0x2f4dc7,_0x102b2f,_0x2d28fe){if(_0x2f4dc7[_0x0e4a('0xa')](_0x0e4a('0x11'))||_0x2f4dc7[_0x0e4a('0xa')](_0x0e4a('0xb'))||_0x2f4dc7[_0x0e4a('0xa')](_0x0e4a('0xc'))||_0x2f4dc7['changed'](_0x0e4a('0xd'))||_0x2f4dc7[_0x0e4a('0xa')](_0x0e4a('0xe'))||_0x2f4dc7['changed'](_0x0e4a('0x23'))){var _0x3133ad,_0x4d5b86;_0x3133ad=_0x2f4dc7[_0x0e4a('0xb')];var _0x3a8e0a=_0x3133ad['slice'](-0x1);if(_0x3a8e0a==='/'||_0x3a8e0a==='\x5c'||_0x3a8e0a===':'){_0x3133ad=_0x3133ad[_0x0e4a('0x10')](0x0,_0x3133ad[_0x0e4a('0x24')](_0x3a8e0a));}switch(_0x2f4dc7[_0x0e4a('0x11')]){case'US':_0x4d5b86=_0x0e4a('0x12');break;case'AU':_0x4d5b86='https://accounts.zoho.com.au';break;case'IN':_0x4d5b86=_0x0e4a('0x14');break;case'CN':_0x4d5b86=_0x0e4a('0x25');break;default:_0x4d5b86='https://accounts.zoho.eu';break;}var _0x57a1c7={'method':_0x0e4a('0x16'),'uri':_0x4d5b86+'/oauth/v2/token','form':{'grant_type':_0x0e4a('0x17'),'client_id':_0x2f4dc7[_0x0e4a('0xc')],'client_secret':_0x2f4dc7[_0x0e4a('0xd')],'redirect_uri':_0x2f4dc7[_0x0e4a('0xb')],'code':_0x2f4dc7[_0x0e4a('0xe')]},'headers':{'Content-Type':_0x0e4a('0x18')}};return rp(_0x57a1c7)[_0x0e4a('0x19')](function(_0x15e19f){var _0x2b90d4=JSON[_0x0e4a('0x1a')](_0x15e19f);if(_0x2b90d4[_0x0e4a('0x1b')]){_0x2f4dc7[_0x0e4a('0x1c')]=_0x2b90d4[_0x0e4a('0x1b')];logger[_0x0e4a('0x1d')](util['format'](_0x0e4a('0x26'),_0x2f4dc7[_0x0e4a('0x1f')],_0x2f4dc7['id']));}else{logger[_0x0e4a('0x27')](util[_0x0e4a('0x1e')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x2f4dc7[_0x0e4a('0x1f')],_0x2f4dc7['id']),util[_0x0e4a('0x21')](_0x2b90d4,{'showHidden':![],'depth':null}));}return _0x2d28fe(null,_0x102b2f);})[_0x0e4a('0x22')](function(_0x19b1ee){logger['error'](util[_0x0e4a('0x1e')](_0x0e4a('0x20'),_0x2f4dc7['name'],_0x2f4dc7['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x2d28fe(_0x19b1ee);});}else{return _0x2d28fe(null,_0x102b2f);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 2d3a0d3..9541c18 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 _0xc759=['../../config/utils','../../config/logger','jayson/promise','client','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ZohoAccount','options','raw','where','attributes','limit','map','include','model','GetZohoAccount','ShowZohoAccount','find','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x584852,_0x3e04c0){var _0x52c10b=function(_0x40c857){while(--_0x40c857){_0x584852['push'](_0x584852['shift']());}};_0x52c10b(++_0x3e04c0);}(_0xc759,0xa0));var _0x9c75=function(_0x2a11c6,_0x6f9869){_0x2a11c6=_0x2a11c6-0x0;var _0x4ca876=_0xc759[_0x2a11c6];return _0x4ca876;};'use strict';var _=require('lodash');var util=require(_0x9c75('0x0'));var moment=require(_0x9c75('0x1'));var BPromise=require(_0x9c75('0x2'));var rs=require(_0x9c75('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9c75('0x4'))['db'];var utils=require(_0x9c75('0x5'));var logger=require(_0x9c75('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9c75('0x7'));var client=jayson[_0x9c75('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc6ada5,_0x1bebbf,_0xbc5643){return new BPromise(function(_0x4eaf95,_0x285197){return client[_0x9c75('0x9')](_0xc6ada5,_0xbc5643)[_0x9c75('0xa')](function(_0x53cfe0){logger[_0x9c75('0xb')](_0x9c75('0xc'),_0x1bebbf,_0x9c75('0xd'));logger['debug'](_0x9c75('0xe'),_0x1bebbf,_0x9c75('0xd'),JSON[_0x9c75('0xf')](_0x53cfe0));if(_0x53cfe0[_0x9c75('0x10')]){if(_0x53cfe0[_0x9c75('0x10')][_0x9c75('0x11')]===0x1f4){logger[_0x9c75('0x10')](_0x9c75('0xc'),_0x1bebbf,_0x53cfe0[_0x9c75('0x10')]['message']);return _0x285197(_0x53cfe0[_0x9c75('0x10')][_0x9c75('0x12')]);}logger[_0x9c75('0x10')]('ZohoAccount,\x20%s,\x20%s',_0x1bebbf,_0x53cfe0[_0x9c75('0x10')][_0x9c75('0x12')]);return _0x4eaf95(_0x53cfe0['error'][_0x9c75('0x12')]);}else{logger[_0x9c75('0xb')](_0x9c75('0xc'),_0x1bebbf,_0x9c75('0xd'));_0x4eaf95(_0x53cfe0[_0x9c75('0x13')][_0x9c75('0x12')]);}})[_0x9c75('0x14')](function(_0x84ce10){logger[_0x9c75('0x10')](_0x9c75('0xc'),_0x1bebbf,_0x84ce10);_0x285197(_0x84ce10);});});}exports['GetZohoAccount']=function(_0x25b870){var _0x1b87d5=this;return new Promise(function(_0x4cc6a1,_0x545977){return db[_0x9c75('0x15')]['findAll']({'raw':_0x25b870[_0x9c75('0x16')]?_0x25b870[_0x9c75('0x16')][_0x9c75('0x17')]===undefined?!![]:![]:!![],'where':_0x25b870[_0x9c75('0x16')]?_0x25b870[_0x9c75('0x16')][_0x9c75('0x18')]||null:null,'attributes':_0x25b870[_0x9c75('0x16')]?_0x25b870[_0x9c75('0x16')][_0x9c75('0x19')]||null:null,'limit':_0x25b870['options']?_0x25b870[_0x9c75('0x16')][_0x9c75('0x1a')]||null:null,'include':_0x25b870['options']?_0x25b870[_0x9c75('0x16')]['include']?_[_0x9c75('0x1b')](_0x25b870['options'][_0x9c75('0x1c')],function(_0x4c5e46){return{'model':db[_0x4c5e46[_0x9c75('0x1d')]],'as':_0x4c5e46['as'],'attributes':_0x4c5e46['attributes'],'include':_0x4c5e46[_0x9c75('0x1c')]?_[_0x9c75('0x1b')](_0x4c5e46['include'],function(_0x13e2fc){return{'model':db[_0x13e2fc[_0x9c75('0x1d')]],'as':_0x13e2fc['as'],'attributes':_0x13e2fc['attributes'],'include':_0x13e2fc[_0x9c75('0x1c')]?_[_0x9c75('0x1b')](_0x13e2fc[_0x9c75('0x1c')],function(_0x32751f){return{'model':db[_0x32751f['model']],'as':_0x32751f['as'],'attributes':_0x32751f['attributes']};}):[]};}):[]};}):[]:[]})[_0x9c75('0xa')](function(_0xfa3453){logger[_0x9c75('0xb')]('GetZohoAccount',_0x25b870);logger['debug'](_0x9c75('0x1e'),_0x25b870,JSON[_0x9c75('0xf')](_0xfa3453));_0x4cc6a1(_0xfa3453);})[_0x9c75('0x14')](function(_0x5b4dee){logger[_0x9c75('0x10')](_0x9c75('0x1e'),_0x5b4dee[_0x9c75('0x12')],_0x25b870);_0x545977(_0x1b87d5[_0x9c75('0x10')](0x1f4,_0x5b4dee[_0x9c75('0x12')]));});});};exports[_0x9c75('0x1f')]=function(_0x227766){var _0x35df08=this;return new Promise(function(_0x205435,_0x367aca){return db[_0x9c75('0x15')][_0x9c75('0x20')]({'raw':_0x227766[_0x9c75('0x16')]?_0x227766['options'][_0x9c75('0x17')]===undefined?!![]:![]:!![],'where':_0x227766[_0x9c75('0x16')]?_0x227766[_0x9c75('0x16')]['where']||null:null,'attributes':_0x227766[_0x9c75('0x16')]?_0x227766[_0x9c75('0x16')][_0x9c75('0x19')]||null:null,'include':_0x227766[_0x9c75('0x16')]?_0x227766['options'][_0x9c75('0x1c')]?_[_0x9c75('0x1b')](_0x227766[_0x9c75('0x16')][_0x9c75('0x1c')],function(_0x3916ed){return{'model':db[_0x3916ed[_0x9c75('0x1d')]],'as':_0x3916ed['as'],'attributes':_0x3916ed['attributes'],'include':_0x3916ed[_0x9c75('0x1c')]?_[_0x9c75('0x1b')](_0x3916ed[_0x9c75('0x1c')],function(_0x339e14){return{'model':db[_0x339e14[_0x9c75('0x1d')]],'as':_0x339e14['as'],'attributes':_0x339e14[_0x9c75('0x19')],'include':_0x339e14[_0x9c75('0x1c')]?_[_0x9c75('0x1b')](_0x339e14[_0x9c75('0x1c')],function(_0x1a2ca4){return{'model':db[_0x1a2ca4[_0x9c75('0x1d')]],'as':_0x1a2ca4['as'],'attributes':_0x1a2ca4[_0x9c75('0x19')]};}):[]};}):[]};}):[]:[]})[_0x9c75('0xa')](function(_0x1a7c18){logger['info'](_0x9c75('0x1f'),_0x227766);logger['debug'](_0x9c75('0x1f'),_0x227766,JSON[_0x9c75('0xf')](_0x1a7c18));_0x205435(_0x1a7c18);})['catch'](function(_0x7902b1){logger[_0x9c75('0x10')](_0x9c75('0x1f'),_0x7902b1[_0x9c75('0x12')],_0x227766);_0x367aca(_0x35df08[_0x9c75('0x10')](0x1f4,_0x7902b1[_0x9c75('0x12')]));});});}; \ No newline at end of file +var _0x4cf7=['attributes','limit','include','map','model','GetZohoAccount','stringify','find','ShowZohoAccount','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','ZohoAccount','findAll','options','raw','where'];(function(_0x2567f0,_0x4fa60){var _0x14852a=function(_0x55b95f){while(--_0x55b95f){_0x2567f0['push'](_0x2567f0['shift']());}};_0x14852a(++_0x4fa60);}(_0x4cf7,0x117));var _0x74cf=function(_0x43755a,_0x2d9faf){_0x43755a=_0x43755a-0x0;var _0x5c179a=_0x4cf7[_0x43755a];return _0x5c179a;};'use strict';var _=require('lodash');var util=require(_0x74cf('0x0'));var moment=require(_0x74cf('0x1'));var BPromise=require(_0x74cf('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x74cf('0x3'))['db'];var utils=require(_0x74cf('0x4'));var logger=require(_0x74cf('0x5'))('rpc');var config=require(_0x74cf('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5b9f55,_0x52fba0,_0xb83153){return new BPromise(function(_0x3afcb4,_0x281370){return client['request'](_0x5b9f55,_0xb83153)[_0x74cf('0x7')](function(_0x136f23){logger[_0x74cf('0x8')](_0x74cf('0x9'),_0x52fba0,_0x74cf('0xa'));logger[_0x74cf('0xb')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x52fba0,_0x74cf('0xa'),JSON['stringify'](_0x136f23));if(_0x136f23[_0x74cf('0xc')]){if(_0x136f23['error']['code']===0x1f4){logger['error'](_0x74cf('0x9'),_0x52fba0,_0x136f23[_0x74cf('0xc')]['message']);return _0x281370(_0x136f23[_0x74cf('0xc')][_0x74cf('0xd')]);}logger[_0x74cf('0xc')]('ZohoAccount,\x20%s,\x20%s',_0x52fba0,_0x136f23['error'][_0x74cf('0xd')]);return _0x3afcb4(_0x136f23['error'][_0x74cf('0xd')]);}else{logger[_0x74cf('0x8')](_0x74cf('0x9'),_0x52fba0,_0x74cf('0xa'));_0x3afcb4(_0x136f23[_0x74cf('0xe')][_0x74cf('0xd')]);}})[_0x74cf('0xf')](function(_0x5c2e86){logger[_0x74cf('0xc')](_0x74cf('0x9'),_0x52fba0,_0x5c2e86);_0x281370(_0x5c2e86);});});}exports['GetZohoAccount']=function(_0x5dd5ee){var _0x5cbb1e=this;return new Promise(function(_0x512f4e,_0x923aa7){return db[_0x74cf('0x10')][_0x74cf('0x11')]({'raw':_0x5dd5ee[_0x74cf('0x12')]?_0x5dd5ee['options'][_0x74cf('0x13')]===undefined?!![]:![]:!![],'where':_0x5dd5ee[_0x74cf('0x12')]?_0x5dd5ee[_0x74cf('0x12')][_0x74cf('0x14')]||null:null,'attributes':_0x5dd5ee[_0x74cf('0x12')]?_0x5dd5ee['options'][_0x74cf('0x15')]||null:null,'limit':_0x5dd5ee['options']?_0x5dd5ee['options'][_0x74cf('0x16')]||null:null,'include':_0x5dd5ee[_0x74cf('0x12')]?_0x5dd5ee['options'][_0x74cf('0x17')]?_[_0x74cf('0x18')](_0x5dd5ee[_0x74cf('0x12')][_0x74cf('0x17')],function(_0x59fc97){return{'model':db[_0x59fc97[_0x74cf('0x19')]],'as':_0x59fc97['as'],'attributes':_0x59fc97[_0x74cf('0x15')],'include':_0x59fc97[_0x74cf('0x17')]?_[_0x74cf('0x18')](_0x59fc97[_0x74cf('0x17')],function(_0x1f5b77){return{'model':db[_0x1f5b77[_0x74cf('0x19')]],'as':_0x1f5b77['as'],'attributes':_0x1f5b77[_0x74cf('0x15')],'include':_0x1f5b77[_0x74cf('0x17')]?_[_0x74cf('0x18')](_0x1f5b77['include'],function(_0x181eb8){return{'model':db[_0x181eb8[_0x74cf('0x19')]],'as':_0x181eb8['as'],'attributes':_0x181eb8['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x8ea67f){logger['info'](_0x74cf('0x1a'),_0x5dd5ee);logger[_0x74cf('0xb')](_0x74cf('0x1a'),_0x5dd5ee,JSON[_0x74cf('0x1b')](_0x8ea67f));_0x512f4e(_0x8ea67f);})[_0x74cf('0xf')](function(_0x1c8d05){logger[_0x74cf('0xc')](_0x74cf('0x1a'),_0x1c8d05[_0x74cf('0xd')],_0x5dd5ee);_0x923aa7(_0x5cbb1e[_0x74cf('0xc')](0x1f4,_0x1c8d05['message']));});});};exports['ShowZohoAccount']=function(_0x620ffe){var _0x4f0daf=this;return new Promise(function(_0x55889b,_0x72c900){return db[_0x74cf('0x10')][_0x74cf('0x1c')]({'raw':_0x620ffe[_0x74cf('0x12')]?_0x620ffe[_0x74cf('0x12')]['raw']===undefined?!![]:![]:!![],'where':_0x620ffe[_0x74cf('0x12')]?_0x620ffe[_0x74cf('0x12')][_0x74cf('0x14')]||null:null,'attributes':_0x620ffe['options']?_0x620ffe['options'][_0x74cf('0x15')]||null:null,'include':_0x620ffe['options']?_0x620ffe[_0x74cf('0x12')][_0x74cf('0x17')]?_[_0x74cf('0x18')](_0x620ffe[_0x74cf('0x12')][_0x74cf('0x17')],function(_0x2a1b7c){return{'model':db[_0x2a1b7c[_0x74cf('0x19')]],'as':_0x2a1b7c['as'],'attributes':_0x2a1b7c['attributes'],'include':_0x2a1b7c[_0x74cf('0x17')]?_['map'](_0x2a1b7c['include'],function(_0x78e26e){return{'model':db[_0x78e26e[_0x74cf('0x19')]],'as':_0x78e26e['as'],'attributes':_0x78e26e['attributes'],'include':_0x78e26e[_0x74cf('0x17')]?_[_0x74cf('0x18')](_0x78e26e['include'],function(_0x4b03cd){return{'model':db[_0x4b03cd['model']],'as':_0x4b03cd['as'],'attributes':_0x4b03cd[_0x74cf('0x15')]};}):[]};}):[]};}):[]:[]})[_0x74cf('0x7')](function(_0x2080a3){logger[_0x74cf('0x8')](_0x74cf('0x1d'),_0x620ffe);logger[_0x74cf('0xb')](_0x74cf('0x1d'),_0x620ffe,JSON[_0x74cf('0x1b')](_0x2080a3));_0x55889b(_0x2080a3);})['catch'](function(_0x413d66){logger[_0x74cf('0xc')](_0x74cf('0x1d'),_0x413d66[_0x74cf('0xd')],_0x620ffe);_0x72c900(_0x4f0daf[_0x74cf('0xc')](0x1f4,_0x413d66[_0x74cf('0xd')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 35235e3..90b6b12 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 _0x317b=['../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','put','update','exports','multer','util','connect-timeout','express','../../components/auth/service'];(function(_0x3c115b,_0x74b3f4){var _0xfa4fbd=function(_0x4b845e){while(--_0x4b845e){_0x3c115b['push'](_0x3c115b['shift']());}};_0xfa4fbd(++_0x74b3f4);}(_0x317b,0x1c7));var _0xb317=function(_0x6d6811,_0x1d8a45){_0x6d6811=_0x6d6811-0x0;var _0x159843=_0x317b[_0x6d6811];return _0x159843;};'use strict';var multer=require(_0xb317('0x0'));var util=require(_0xb317('0x1'));var path=require('path');var timeout=require(_0xb317('0x2'));var express=require(_0xb317('0x3'));var router=express['Router']();var auth=require(_0xb317('0x4'));var interaction=require(_0xb317('0x5'));var config=require(_0xb317('0x6'));var controller=require(_0xb317('0x7'));router[_0xb317('0x8')]('/',auth[_0xb317('0x9')](),controller[_0xb317('0xa')]);router[_0xb317('0x8')](_0xb317('0xb'),auth[_0xb317('0x9')](),controller['show']);router[_0xb317('0x8')](_0xb317('0xc'),auth['isAuthenticated'](),controller[_0xb317('0xd')]);router[_0xb317('0x8')](_0xb317('0xe'),auth[_0xb317('0x9')](),controller[_0xb317('0xf')]);router[_0xb317('0x8')]('/:id/descriptions',auth[_0xb317('0x9')](),controller[_0xb317('0x10')]);router['post']('/',auth[_0xb317('0x9')](),controller['create']);router[_0xb317('0x11')](_0xb317('0xb'),auth[_0xb317('0x9')](),controller[_0xb317('0x12')]);router['delete'](_0xb317('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xb317('0x13')]=router; \ No newline at end of file +var _0xd52d=['isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','put','update','destroy','util','path','express','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get'];(function(_0x245ce0,_0x39cc0c){var _0x45f311=function(_0x4b6c74){while(--_0x4b6c74){_0x245ce0['push'](_0x245ce0['shift']());}};_0x45f311(++_0x39cc0c);}(_0xd52d,0x1c7));var _0xdd52=function(_0x3e4fdc,_0x536693){_0x3e4fdc=_0x3e4fdc-0x0;var _0x28687b=_0xd52d[_0x3e4fdc];return _0x28687b;};'use strict';var multer=require('multer');var util=require(_0xdd52('0x0'));var path=require(_0xdd52('0x1'));var timeout=require('connect-timeout');var express=require(_0xdd52('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xdd52('0x3'));var config=require(_0xdd52('0x4'));var controller=require(_0xdd52('0x5'));router[_0xdd52('0x6')]('/',auth[_0xdd52('0x7')](),controller[_0xdd52('0x8')]);router[_0xdd52('0x6')](_0xdd52('0x9'),auth['isAuthenticated'](),controller[_0xdd52('0xa')]);router[_0xdd52('0x6')](_0xdd52('0xb'),auth[_0xdd52('0x7')](),controller[_0xdd52('0xc')]);router[_0xdd52('0x6')](_0xdd52('0xd'),auth[_0xdd52('0x7')](),controller[_0xdd52('0xe')]);router[_0xdd52('0x6')](_0xdd52('0xf'),auth[_0xdd52('0x7')](),controller[_0xdd52('0x10')]);router['post']('/',auth[_0xdd52('0x7')](),controller[_0xdd52('0x11')]);router[_0xdd52('0x12')](_0xdd52('0x9'),auth[_0xdd52('0x7')](),controller[_0xdd52('0x13')]);router['delete'](_0xdd52('0x9'),auth[_0xdd52('0x7')](),controller[_0xdd52('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 0956c72..227c1fa 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 _0xe55c=['contact_lead','contact','sequelize','exports','STRING','lead','ENUM'];(function(_0x1169f6,_0x16df26){var _0x378991=function(_0x41a4c7){while(--_0x41a4c7){_0x1169f6['push'](_0x1169f6['shift']());}};_0x378991(++_0x16df26);}(_0xe55c,0x19f));var _0xce55=function(_0x1f3b92,_0x1ac036){_0x1f3b92=_0x1f3b92-0x0;var _0x5c4a0d=_0xe55c[_0x1f3b92];return _0x5c4a0d;};'use strict';var Sequelize=require(_0xce55('0x0'));module[_0xce55('0x1')]={'name':{'type':Sequelize[_0xce55('0x2')]},'moduleCreate':{'type':Sequelize['ENUM']('lead','contact','nothing'),'defaultValue':_0xce55('0x3')},'moduleSearch':{'type':Sequelize[_0xce55('0x4')](_0xce55('0x5'),_0xce55('0x6'),_0xce55('0x3')),'defaultValue':_0xce55('0x5')},'description':{'type':Sequelize[_0xce55('0x2')]}}; \ No newline at end of file +var _0x272a=['lead','contact','nothing','contact_lead','sequelize','exports','STRING','ENUM'];(function(_0x4c6350,_0x409cd3){var _0x5b6411=function(_0x5043e3){while(--_0x5043e3){_0x4c6350['push'](_0x4c6350['shift']());}};_0x5b6411(++_0x409cd3);}(_0x272a,0x18c));var _0xa272=function(_0x48a3f5,_0x6cb622){_0x48a3f5=_0x48a3f5-0x0;var _0x115df1=_0x272a[_0x48a3f5];return _0x115df1;};'use strict';var Sequelize=require(_0xa272('0x0'));module[_0xa272('0x1')]={'name':{'type':Sequelize[_0xa272('0x2')]},'moduleCreate':{'type':Sequelize[_0xa272('0x3')](_0xa272('0x4'),_0xa272('0x5'),_0xa272('0x6')),'defaultValue':_0xa272('0x4')},'moduleSearch':{'type':Sequelize[_0xa272('0x3')](_0xa272('0x7'),_0xa272('0x5'),_0xa272('0x4')),'defaultValue':_0xa272('0x7')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index e5dfb21..2d9ddf1 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 _0x008c=['save','update','stack','name','send','index','ZohoConfiguration','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','type','merge','options','includeAll','include','findAll','rows','params','create','body','find','getFields','findOne','ZohoField','pick','filter','map','getSubjects','getDescriptions','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','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','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','ZohoConfiguration,\x20%s,\x20%s','error','message','info','request\x20sent','catch','sendStatus','status','end','count','offset','limit','apply','reject'];(function(_0x139120,_0x3766c4){var _0x12e7e5=function(_0x43449e){while(--_0x43449e){_0x139120['push'](_0x139120['shift']());}};_0x12e7e5(++_0x3766c4);}(_0x008c,0x188));var _0xc008=function(_0x1044e5,_0x498e01){_0x1044e5=_0x1044e5-0x0;var _0x5ad0dd=_0x008c[_0x1044e5];return _0x5ad0dd;};'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']('ZohoConfiguration,\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')]('ZohoConfiguration,\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(){_0x596ee8[_0xc008('0x29')](0xcc)[_0xc008('0x2a')]();});}};}function handleEntityNotFound(_0xca0520,_0xd0e05a){return function(_0x3cd878){if(!_0x3cd878){_0xca0520[_0xc008('0x28')](0x194);}return _0x3cd878;};}function handleError(_0x470e79,_0x29d4b3){_0x29d4b3=_0x29d4b3||0x1f4;return function(_0x4f14d2){logger[_0xc008('0x23')](_0x4f14d2[_0xc008('0x32')]);if(_0x4f14d2[_0xc008('0x33')]){delete _0x4f14d2[_0xc008('0x33')];}_0x470e79[_0xc008('0x29')](_0x29d4b3)[_0xc008('0x34')](_0x4f14d2);};}exports[_0xc008('0x35')]=function(_0x5d0e06,_0x35f360){var _0x21763f={},_0x50e1d4={},_0x399b64={'count':0x0,'rows':[]};var _0x15453c=_['map'](db[_0xc008('0x36')][_0xc008('0x37')],function(_0x280e9b){return{'name':_0x280e9b['fieldName'],'type':_0x280e9b['type']['key']};});_0x50e1d4[_0xc008('0x38')]=_['map'](_0x15453c,_0xc008('0x33'));_0x50e1d4[_0xc008('0x39')]=_[_0xc008('0x3a')](_0x5d0e06[_0xc008('0x39')]);_0x50e1d4[_0xc008('0x3b')]=_[_0xc008('0x3c')](_0x50e1d4[_0xc008('0x38')],_0x50e1d4[_0xc008('0x39')]);_0x21763f[_0xc008('0x3d')]=_[_0xc008('0x3c')](_0x50e1d4[_0xc008('0x38')],qs[_0xc008('0x3e')](_0x5d0e06[_0xc008('0x39')][_0xc008('0x3e')]));_0x21763f['attributes']=_0x21763f[_0xc008('0x3d')][_0xc008('0x3f')]?_0x21763f[_0xc008('0x3d')]:_0x50e1d4[_0xc008('0x38')];if(!_0x5d0e06['query'][_0xc008('0x40')](_0xc008('0x41'))){_0x21763f[_0xc008('0x2d')]=qs[_0xc008('0x2d')](_0x5d0e06[_0xc008('0x39')]['limit']);_0x21763f[_0xc008('0x2c')]=qs[_0xc008('0x2c')](_0x5d0e06[_0xc008('0x39')][_0xc008('0x2c')]);}_0x21763f[_0xc008('0x42')]=qs['sort'](_0x5d0e06[_0xc008('0x39')][_0xc008('0x43')]);_0x21763f[_0xc008('0x44')]=qs[_0xc008('0x3b')](_['pick'](_0x5d0e06[_0xc008('0x39')],_0x50e1d4[_0xc008('0x3b')]));if(_0x5d0e06[_0xc008('0x39')]['filter']){_0x21763f[_0xc008('0x44')]=_['merge'](_0x21763f[_0xc008('0x44')],{'$or':_['map'](_0x15453c,function(_0x46fa8f){if(_0x46fa8f[_0xc008('0x45')]!=='VIRTUAL'){var _0x31007c={};_0x31007c[_0x46fa8f[_0xc008('0x33')]]={'$like':'%'+_0x5d0e06[_0xc008('0x39')]['filter']+'%'};return _0x31007c;}})});}_0x21763f=_[_0xc008('0x46')]({},_0x21763f,_0x5d0e06[_0xc008('0x47')]);var _0x200469={'where':_0x21763f[_0xc008('0x44')]};return db[_0xc008('0x36')][_0xc008('0x2b')](_0x200469)['then'](function(_0x47cafa){_0x399b64['count']=_0x47cafa;if(_0x5d0e06[_0xc008('0x39')][_0xc008('0x48')]){_0x21763f[_0xc008('0x49')]=[{'all':!![]}];}return db[_0xc008('0x36')][_0xc008('0x4a')](_0x21763f);})[_0xc008('0x1e')](function(_0x2cf641){_0x399b64[_0xc008('0x4b')]=_0x2cf641;return _0x399b64;})['then'](respondWithFilteredResult(_0x35f360,_0x21763f))['catch'](handleError(_0x35f360,null));};exports['show']=function(_0x2d5a49,_0x2651cf){var _0x158eae={'raw':![],'where':{'id':_0x2d5a49[_0xc008('0x4c')]['id']}},_0x511383={};_0x511383[_0xc008('0x38')]=_[_0xc008('0x3a')](db[_0xc008('0x36')][_0xc008('0x37')]);_0x511383[_0xc008('0x39')]=_[_0xc008('0x3a')](_0x2d5a49[_0xc008('0x39')]);_0x511383[_0xc008('0x3b')]=_[_0xc008('0x3c')](_0x511383['model'],_0x511383['query']);_0x158eae[_0xc008('0x3d')]=_['intersection'](_0x511383[_0xc008('0x38')],qs[_0xc008('0x3e')](_0x2d5a49[_0xc008('0x39')]['fields']));_0x158eae[_0xc008('0x3d')]=_0x158eae[_0xc008('0x3d')][_0xc008('0x3f')]?_0x158eae[_0xc008('0x3d')]:_0x511383[_0xc008('0x38')];if(_0x2d5a49['query'][_0xc008('0x48')]){_0x158eae[_0xc008('0x49')]=[{'all':!![]}];}_0x158eae=_['merge']({},_0x158eae,_0x2d5a49[_0xc008('0x47')]);return db[_0xc008('0x36')]['find'](_0x158eae)['then'](handleEntityNotFound(_0x2651cf,null))[_0xc008('0x1e')](respondWithResult(_0x2651cf,null))[_0xc008('0x27')](handleError(_0x2651cf,null));};exports[_0xc008('0x4d')]=function(_0x30d0aa,_0x14b6a0){return db['ZohoConfiguration']['create'](_0x30d0aa[_0xc008('0x4e')],{})['then'](respondWithResult(_0x14b6a0,0xc9))[_0xc008('0x27')](handleError(_0x14b6a0,null));};exports[_0xc008('0x31')]=function(_0xf94fcb,_0x2f1105){if(_0xf94fcb[_0xc008('0x4e')]['id']){delete _0xf94fcb[_0xc008('0x4e')]['id'];}return db['ZohoConfiguration'][_0xc008('0x4f')]({'where':{'id':_0xf94fcb[_0xc008('0x4c')]['id']}})[_0xc008('0x1e')](handleEntityNotFound(_0x2f1105,null))[_0xc008('0x1e')](saveUpdates(_0xf94fcb[_0xc008('0x4e')],null))['then'](respondWithResult(_0x2f1105,null))[_0xc008('0x27')](handleError(_0x2f1105,null));};exports['destroy']=function(_0x535e6e,_0x5dbfca){return db[_0xc008('0x36')][_0xc008('0x4f')]({'where':{'id':_0x535e6e[_0xc008('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5dbfca,null))[_0xc008('0x1e')](removeEntity(_0x5dbfca,null))[_0xc008('0x27')](handleError(_0x5dbfca,null));};exports[_0xc008('0x50')]=function(_0x47a58b,_0x3587c3,_0x1092cb){var _0x12ba3f={};var _0x1b5a22={};var _0x5baff1;var _0x4022dd;return db['ZohoConfiguration'][_0xc008('0x51')]({'where':{'id':_0x47a58b[_0xc008('0x4c')]['id']}})[_0xc008('0x1e')](handleEntityNotFound(_0x3587c3,null))[_0xc008('0x1e')](function(_0x192c87){if(_0x192c87){_0x5baff1=_0x192c87;_0x1b5a22[_0xc008('0x38')]=_['keys'](db[_0xc008('0x52')]['rawAttributes']);_0x1b5a22['query']=_[_0xc008('0x3a')](_0x47a58b[_0xc008('0x39')]);_0x1b5a22['filters']=_[_0xc008('0x3c')](_0x1b5a22[_0xc008('0x38')],_0x1b5a22[_0xc008('0x39')]);_0x12ba3f[_0xc008('0x3d')]=_[_0xc008('0x3c')](_0x1b5a22[_0xc008('0x38')],qs[_0xc008('0x3e')](_0x47a58b['query'][_0xc008('0x3e')]));_0x12ba3f[_0xc008('0x3d')]=_0x12ba3f[_0xc008('0x3d')][_0xc008('0x3f')]?_0x12ba3f[_0xc008('0x3d')]:_0x1b5a22[_0xc008('0x38')];_0x12ba3f[_0xc008('0x42')]=qs[_0xc008('0x43')](_0x47a58b[_0xc008('0x39')][_0xc008('0x43')]);_0x12ba3f[_0xc008('0x44')]=qs[_0xc008('0x3b')](_[_0xc008('0x53')](_0x47a58b[_0xc008('0x39')],_0x1b5a22['filters']));if(_0x47a58b[_0xc008('0x39')][_0xc008('0x54')]){_0x12ba3f[_0xc008('0x44')]=_['merge'](_0x12ba3f[_0xc008('0x44')],{'$or':_[_0xc008('0x55')](_0x12ba3f['attributes'],function(_0x53765c){var _0x1a03fd={};_0x1a03fd[_0x53765c]={'$like':'%'+_0x47a58b[_0xc008('0x39')][_0xc008('0x54')]+'%'};return _0x1a03fd;})});}_0x12ba3f=_[_0xc008('0x46')]({},_0x12ba3f,_0x47a58b[_0xc008('0x47')]);return _0x5baff1[_0xc008('0x50')](_0x12ba3f);}})[_0xc008('0x1e')](function(_0x38191e){if(_0x38191e){_0x4022dd=_0x38191e[_0xc008('0x3f')];if(!_0x47a58b[_0xc008('0x39')][_0xc008('0x40')]('nolimit')){_0x12ba3f[_0xc008('0x2d')]=qs[_0xc008('0x2d')](_0x47a58b[_0xc008('0x39')][_0xc008('0x2d')]);_0x12ba3f['offset']=qs[_0xc008('0x2c')](_0x47a58b['query'][_0xc008('0x2c')]);}return _0x5baff1[_0xc008('0x50')](_0x12ba3f);}})[_0xc008('0x1e')](function(_0x4ccffe){if(_0x4ccffe){return _0x4ccffe?{'count':_0x4022dd,'rows':_0x4ccffe}:null;}})[_0xc008('0x1e')](respondWithResult(_0x3587c3,null))[_0xc008('0x27')](handleError(_0x3587c3,null));};exports[_0xc008('0x56')]=function(_0x553f5c,_0x35b28a,_0x539fc8){var _0x50ee03={};var _0xee7a85={};var _0x23012c;var _0x6fe732;return db[_0xc008('0x36')]['findOne']({'where':{'id':_0x553f5c[_0xc008('0x4c')]['id']}})[_0xc008('0x1e')](handleEntityNotFound(_0x35b28a,null))['then'](function(_0x3efb77){if(_0x3efb77){_0x23012c=_0x3efb77;_0xee7a85['model']=_[_0xc008('0x3a')](db['ZohoField'][_0xc008('0x37')]);_0xee7a85['query']=_[_0xc008('0x3a')](_0x553f5c[_0xc008('0x39')]);_0xee7a85[_0xc008('0x3b')]=_[_0xc008('0x3c')](_0xee7a85['model'],_0xee7a85[_0xc008('0x39')]);_0x50ee03[_0xc008('0x3d')]=_[_0xc008('0x3c')](_0xee7a85[_0xc008('0x38')],qs[_0xc008('0x3e')](_0x553f5c[_0xc008('0x39')][_0xc008('0x3e')]));_0x50ee03[_0xc008('0x3d')]=_0x50ee03['attributes'][_0xc008('0x3f')]?_0x50ee03['attributes']:_0xee7a85['model'];_0x50ee03['order']=qs[_0xc008('0x43')](_0x553f5c[_0xc008('0x39')][_0xc008('0x43')]);_0x50ee03[_0xc008('0x44')]=qs[_0xc008('0x3b')](_[_0xc008('0x53')](_0x553f5c[_0xc008('0x39')],_0xee7a85[_0xc008('0x3b')]));if(_0x553f5c[_0xc008('0x39')]['filter']){_0x50ee03[_0xc008('0x44')]=_[_0xc008('0x46')](_0x50ee03[_0xc008('0x44')],{'$or':_[_0xc008('0x55')](_0x50ee03[_0xc008('0x3d')],function(_0x3b2669){var _0x23d4ff={};_0x23d4ff[_0x3b2669]={'$like':'%'+_0x553f5c[_0xc008('0x39')][_0xc008('0x54')]+'%'};return _0x23d4ff;})});}_0x50ee03=_[_0xc008('0x46')]({},_0x50ee03,_0x553f5c[_0xc008('0x47')]);return _0x23012c[_0xc008('0x56')](_0x50ee03);}})['then'](function(_0x4e7af3){if(_0x4e7af3){_0x6fe732=_0x4e7af3[_0xc008('0x3f')];if(!_0x553f5c[_0xc008('0x39')][_0xc008('0x40')]('nolimit')){_0x50ee03[_0xc008('0x2d')]=qs[_0xc008('0x2d')](_0x553f5c['query']['limit']);_0x50ee03['offset']=qs[_0xc008('0x2c')](_0x553f5c[_0xc008('0x39')][_0xc008('0x2c')]);}return _0x23012c[_0xc008('0x56')](_0x50ee03);}})[_0xc008('0x1e')](function(_0x44f515){if(_0x44f515){return _0x44f515?{'count':_0x6fe732,'rows':_0x44f515}:null;}})[_0xc008('0x1e')](respondWithResult(_0x35b28a,null))[_0xc008('0x27')](handleError(_0x35b28a,null));};exports[_0xc008('0x57')]=function(_0x1e7a11,_0x52091b,_0x57b8ad){var _0xc644fe={};var _0x31ebde={};var _0x3f3dcf;var _0x3f1e41;return db[_0xc008('0x36')][_0xc008('0x51')]({'where':{'id':_0x1e7a11['params']['id']}})['then'](handleEntityNotFound(_0x52091b,null))[_0xc008('0x1e')](function(_0x391425){if(_0x391425){_0x3f3dcf=_0x391425;_0x31ebde[_0xc008('0x38')]=_['keys'](db['ZohoField']['rawAttributes']);_0x31ebde['query']=_['keys'](_0x1e7a11['query']);_0x31ebde[_0xc008('0x3b')]=_['intersection'](_0x31ebde[_0xc008('0x38')],_0x31ebde['query']);_0xc644fe[_0xc008('0x3d')]=_[_0xc008('0x3c')](_0x31ebde[_0xc008('0x38')],qs['fields'](_0x1e7a11['query'][_0xc008('0x3e')]));_0xc644fe['attributes']=_0xc644fe[_0xc008('0x3d')][_0xc008('0x3f')]?_0xc644fe['attributes']:_0x31ebde[_0xc008('0x38')];_0xc644fe['order']=qs['sort'](_0x1e7a11[_0xc008('0x39')][_0xc008('0x43')]);_0xc644fe['where']=qs[_0xc008('0x3b')](_[_0xc008('0x53')](_0x1e7a11[_0xc008('0x39')],_0x31ebde['filters']));if(_0x1e7a11[_0xc008('0x39')][_0xc008('0x54')]){_0xc644fe[_0xc008('0x44')]=_[_0xc008('0x46')](_0xc644fe[_0xc008('0x44')],{'$or':_[_0xc008('0x55')](_0xc644fe['attributes'],function(_0x6dfd99){var _0xdaff5b={};_0xdaff5b[_0x6dfd99]={'$like':'%'+_0x1e7a11[_0xc008('0x39')]['filter']+'%'};return _0xdaff5b;})});}_0xc644fe=_[_0xc008('0x46')]({},_0xc644fe,_0x1e7a11[_0xc008('0x47')]);return _0x3f3dcf[_0xc008('0x57')](_0xc644fe);}})['then'](function(_0x48c38b){if(_0x48c38b){_0x3f1e41=_0x48c38b['length'];if(!_0x1e7a11[_0xc008('0x39')][_0xc008('0x40')](_0xc008('0x41'))){_0xc644fe[_0xc008('0x2d')]=qs[_0xc008('0x2d')](_0x1e7a11[_0xc008('0x39')][_0xc008('0x2d')]);_0xc644fe[_0xc008('0x2c')]=qs['offset'](_0x1e7a11[_0xc008('0x39')][_0xc008('0x2c')]);}return _0x3f3dcf['getDescriptions'](_0xc644fe);}})['then'](function(_0x2257b0){if(_0x2257b0){return _0x2257b0?{'count':_0x3f1e41,'rows':_0x2257b0}:null;}})[_0xc008('0x1e')](respondWithResult(_0x52091b,null))[_0xc008('0x27')](handleError(_0x52091b,null));}; \ No newline at end of file +var _0xe14b=['info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','count','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','name','map','ZohoConfiguration','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','find','catch','body','getFields','findOne','ZohoField','order','getSubjects','getDescriptions','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','jayson/promise','client','http','test','Sequelize','ValidationError','request','then'];(function(_0x44d869,_0x49425f){var _0x1ed521=function(_0x2c2968){while(--_0x2c2968){_0x44d869['push'](_0x44d869['shift']());}};_0x1ed521(++_0x49425f);}(_0xe14b,0x93));var _0xbe14=function(_0x278494,_0x4d3849){_0x278494=_0x278494-0x0;var _0x451bc3=_0xe14b[_0x278494];return _0x451bc3;};'use strict';var pdf=require(_0xbe14('0x0'));var emlformat=require(_0xbe14('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xbe14('0x2'));var rp=require(_0xbe14('0x3'));var moment=require('moment');var BPromise=require(_0xbe14('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xbe14('0x5'));var sox=require(_0xbe14('0x6'));var csv=require(_0xbe14('0x7'));var ejs=require(_0xbe14('0x8'));var fs=require('fs');var _=require(_0xbe14('0x9'));var squel=require(_0xbe14('0xa'));var crypto=require(_0xbe14('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbe14('0xc'));var Papa=require(_0xbe14('0xd'));var Redis=require(_0xbe14('0xe'));var authService=require(_0xbe14('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbe14('0x10'));var logger=require(_0xbe14('0x11'))('api');var utils=require(_0xbe14('0x12'));var config=require(_0xbe14('0x13'));var db=require(_0xbe14('0x14'))['db'];var jayson=require(_0xbe14('0x15'));var client=jayson[_0xbe14('0x16')][_0xbe14('0x17')]({'port':0x232a});function checkPasswordPattern(_0x23a730,_0x2850cb,_0x16893f){if(_0x16893f){var _0xa2cf72=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xa2cf72[_0xbe14('0x18')](_0x2850cb)){return _0x23a730;}else{throw new db[(_0xbe14('0x19'))][(_0xbe14('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 _0x23a730;}}function respondWithRpcPromise(_0x55b3a7,_0x3f58f5,_0x3dc4a9,_0xf4ac9){return new BPromise(function(_0x37ce4e,_0x4e8f34){var _0x21c789=_0xf4ac9||client;return _0x21c789[_0xbe14('0x1b')](_0x55b3a7,_0x3dc4a9)[_0xbe14('0x1c')](function(_0x123ede){logger[_0xbe14('0x1d')](_0xbe14('0x1e'),_0x3f58f5,_0xbe14('0x1f'));logger['debug'](_0xbe14('0x20'),_0x3f58f5,_0xbe14('0x1f'),JSON[_0xbe14('0x21')](_0x123ede));if(_0x123ede[_0xbe14('0x22')]){if(_0x123ede[_0xbe14('0x22')][_0xbe14('0x23')]===0x1f4){logger['error'](_0xbe14('0x1e'),_0x3f58f5,_0x123ede[_0xbe14('0x22')][_0xbe14('0x24')]);return _0x4e8f34(_0x123ede[_0xbe14('0x22')][_0xbe14('0x24')]);}logger['error'](_0xbe14('0x1e'),_0x3f58f5,_0x123ede['error'][_0xbe14('0x24')]);return _0x37ce4e(_0x123ede['error'][_0xbe14('0x24')]);}else{logger['info'](_0xbe14('0x1e'),_0x3f58f5,_0xbe14('0x1f'));_0x37ce4e(_0x123ede['result'][_0xbe14('0x24')]);}})['catch'](function(_0x4587a8){logger['error'](_0xbe14('0x1e'),_0x3f58f5,_0x4587a8);_0x4e8f34(_0x4587a8);});});}function respondWithStatusCode(_0x5fa043,_0x1ee9c1){_0x1ee9c1=_0x1ee9c1||0xcc;return function(_0x39cc81){if(_0x39cc81){return _0x5fa043[_0xbe14('0x25')](_0x1ee9c1);}return _0x5fa043[_0xbe14('0x26')](_0x1ee9c1)['end']();};}function respondWithResult(_0x1822e0,_0x1ba46a){_0x1ba46a=_0x1ba46a||0xc8;return function(_0x391556){if(_0x391556){return _0x1822e0[_0xbe14('0x26')](_0x1ba46a)['json'](_0x391556);}};}function respondWithFilteredResult(_0x16f884,_0x29fc64){return function(_0x59bf34){if(_0x59bf34){var _0x3c3613=_0x59bf34[_0xbe14('0x27')],_0x3b3e84=_0x29fc64[_0xbe14('0x28')],_0x1c7cc7=_0x29fc64[_0xbe14('0x28')]+_0x29fc64[_0xbe14('0x29')],_0x19252f;if(_0x1c7cc7>=_0x3c3613){_0x1c7cc7=_0x3c3613;_0x19252f=0xc8;}else{_0x19252f=0xce;}_0x16f884[_0xbe14('0x26')](_0x19252f);return _0x16f884[_0xbe14('0x2a')](_0xbe14('0x2b'),_0x3b3e84+'-'+_0x1c7cc7+'/'+_0x3c3613)[_0xbe14('0x2c')](_0x59bf34);}return null;};}function patchUpdates(_0x39dc0a){return function(_0x10ae36){try{jsonpatch[_0xbe14('0x2d')](_0x10ae36,_0x39dc0a,!![]);}catch(_0xe6feb2){return BPromise[_0xbe14('0x2e')](_0xe6feb2);}return _0x10ae36[_0xbe14('0x2f')]();};}function saveUpdates(_0x29e76a,_0x14e7c4){return function(_0x581e86){if(_0x581e86){return _0x581e86[_0xbe14('0x30')](_0x29e76a)['then'](function(_0x58f8de){return _0x58f8de;});}return null;};}function removeEntity(_0x46c2d1,_0x4c1e7e){return function(_0x243524){if(_0x243524){return _0x243524[_0xbe14('0x31')]()['then'](function(){_0x46c2d1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x412ad5,_0xa3d24){return function(_0x5f27b6){if(!_0x5f27b6){_0x412ad5[_0xbe14('0x25')](0x194);}return _0x5f27b6;};}function handleError(_0x1faf3e,_0x452635){_0x452635=_0x452635||0x1f4;return function(_0x1aa849){logger[_0xbe14('0x22')](_0x1aa849['stack']);if(_0x1aa849['name']){delete _0x1aa849[_0xbe14('0x32')];}_0x1faf3e['status'](_0x452635)['send'](_0x1aa849);};}exports['index']=function(_0x163ef7,_0x393f6b){var _0x2bb45={},_0x3dbacb={},_0x172e79={'count':0x0,'rows':[]};var _0x29356f=_[_0xbe14('0x33')](db[_0xbe14('0x34')][_0xbe14('0x35')],function(_0x2dfd5a){return{'name':_0x2dfd5a[_0xbe14('0x36')],'type':_0x2dfd5a[_0xbe14('0x37')]['key']};});_0x3dbacb['model']=_[_0xbe14('0x33')](_0x29356f,_0xbe14('0x32'));_0x3dbacb[_0xbe14('0x38')]=_['keys'](_0x163ef7[_0xbe14('0x38')]);_0x3dbacb[_0xbe14('0x39')]=_[_0xbe14('0x3a')](_0x3dbacb[_0xbe14('0x3b')],_0x3dbacb[_0xbe14('0x38')]);_0x2bb45[_0xbe14('0x3c')]=_[_0xbe14('0x3a')](_0x3dbacb[_0xbe14('0x3b')],qs[_0xbe14('0x3d')](_0x163ef7['query'][_0xbe14('0x3d')]));_0x2bb45[_0xbe14('0x3c')]=_0x2bb45[_0xbe14('0x3c')][_0xbe14('0x3e')]?_0x2bb45[_0xbe14('0x3c')]:_0x3dbacb[_0xbe14('0x3b')];if(!_0x163ef7['query'][_0xbe14('0x3f')](_0xbe14('0x40'))){_0x2bb45[_0xbe14('0x29')]=qs[_0xbe14('0x29')](_0x163ef7['query']['limit']);_0x2bb45[_0xbe14('0x28')]=qs[_0xbe14('0x28')](_0x163ef7[_0xbe14('0x38')]['offset']);}_0x2bb45['order']=qs[_0xbe14('0x41')](_0x163ef7['query']['sort']);_0x2bb45[_0xbe14('0x42')]=qs[_0xbe14('0x39')](_[_0xbe14('0x43')](_0x163ef7['query'],_0x3dbacb['filters']));if(_0x163ef7['query'][_0xbe14('0x44')]){_0x2bb45[_0xbe14('0x42')]=_[_0xbe14('0x45')](_0x2bb45['where'],{'$or':_[_0xbe14('0x33')](_0x29356f,function(_0xcb0680){if(_0xcb0680[_0xbe14('0x37')]!==_0xbe14('0x46')){var _0x58351f={};_0x58351f[_0xcb0680['name']]={'$like':'%'+_0x163ef7[_0xbe14('0x38')][_0xbe14('0x44')]+'%'};return _0x58351f;}})});}_0x2bb45=_[_0xbe14('0x45')]({},_0x2bb45,_0x163ef7[_0xbe14('0x47')]);var _0x2550dc={'where':_0x2bb45['where']};return db['ZohoConfiguration'][_0xbe14('0x27')](_0x2550dc)[_0xbe14('0x1c')](function(_0x238c60){_0x172e79[_0xbe14('0x27')]=_0x238c60;if(_0x163ef7['query'][_0xbe14('0x48')]){_0x2bb45[_0xbe14('0x49')]=[{'all':!![]}];}return db['ZohoConfiguration'][_0xbe14('0x4a')](_0x2bb45);})[_0xbe14('0x1c')](function(_0x2d6ee8){_0x172e79[_0xbe14('0x4b')]=_0x2d6ee8;return _0x172e79;})['then'](respondWithFilteredResult(_0x393f6b,_0x2bb45))['catch'](handleError(_0x393f6b,null));};exports[_0xbe14('0x4c')]=function(_0x29564b,_0x4a1a37){var _0x5acf90={'raw':![],'where':{'id':_0x29564b[_0xbe14('0x4d')]['id']}},_0xca8cdb={};_0xca8cdb[_0xbe14('0x3b')]=_[_0xbe14('0x4e')](db[_0xbe14('0x34')][_0xbe14('0x35')]);_0xca8cdb[_0xbe14('0x38')]=_['keys'](_0x29564b[_0xbe14('0x38')]);_0xca8cdb[_0xbe14('0x39')]=_[_0xbe14('0x3a')](_0xca8cdb[_0xbe14('0x3b')],_0xca8cdb[_0xbe14('0x38')]);_0x5acf90['attributes']=_[_0xbe14('0x3a')](_0xca8cdb[_0xbe14('0x3b')],qs[_0xbe14('0x3d')](_0x29564b[_0xbe14('0x38')][_0xbe14('0x3d')]));_0x5acf90[_0xbe14('0x3c')]=_0x5acf90['attributes']['length']?_0x5acf90[_0xbe14('0x3c')]:_0xca8cdb[_0xbe14('0x3b')];if(_0x29564b[_0xbe14('0x38')]['includeAll']){_0x5acf90['include']=[{'all':!![]}];}_0x5acf90=_[_0xbe14('0x45')]({},_0x5acf90,_0x29564b[_0xbe14('0x47')]);return db['ZohoConfiguration'][_0xbe14('0x4f')](_0x5acf90)[_0xbe14('0x1c')](handleEntityNotFound(_0x4a1a37,null))['then'](respondWithResult(_0x4a1a37,null))[_0xbe14('0x50')](handleError(_0x4a1a37,null));};exports['create']=function(_0x41ba58,_0x410c59){return db[_0xbe14('0x34')]['create'](_0x41ba58[_0xbe14('0x51')],{})[_0xbe14('0x1c')](respondWithResult(_0x410c59,0xc9))['catch'](handleError(_0x410c59,null));};exports[_0xbe14('0x30')]=function(_0x42ca15,_0x2210cc){if(_0x42ca15[_0xbe14('0x51')]['id']){delete _0x42ca15[_0xbe14('0x51')]['id'];}return db['ZohoConfiguration'][_0xbe14('0x4f')]({'where':{'id':_0x42ca15[_0xbe14('0x4d')]['id']}})[_0xbe14('0x1c')](handleEntityNotFound(_0x2210cc,null))[_0xbe14('0x1c')](saveUpdates(_0x42ca15[_0xbe14('0x51')],null))[_0xbe14('0x1c')](respondWithResult(_0x2210cc,null))[_0xbe14('0x50')](handleError(_0x2210cc,null));};exports['destroy']=function(_0x72c875,_0x1b47a4){return db[_0xbe14('0x34')][_0xbe14('0x4f')]({'where':{'id':_0x72c875[_0xbe14('0x4d')]['id']}})[_0xbe14('0x1c')](handleEntityNotFound(_0x1b47a4,null))[_0xbe14('0x1c')](removeEntity(_0x1b47a4,null))[_0xbe14('0x50')](handleError(_0x1b47a4,null));};exports[_0xbe14('0x52')]=function(_0xc61103,_0x358950,_0x4bccfc){var _0x56bcd3={};var _0x58dd79={};var _0x10c0bc;var _0x1bfcbf;return db[_0xbe14('0x34')][_0xbe14('0x53')]({'where':{'id':_0xc61103[_0xbe14('0x4d')]['id']}})[_0xbe14('0x1c')](handleEntityNotFound(_0x358950,null))[_0xbe14('0x1c')](function(_0x22bf69){if(_0x22bf69){_0x10c0bc=_0x22bf69;_0x58dd79[_0xbe14('0x3b')]=_[_0xbe14('0x4e')](db[_0xbe14('0x54')][_0xbe14('0x35')]);_0x58dd79[_0xbe14('0x38')]=_[_0xbe14('0x4e')](_0xc61103[_0xbe14('0x38')]);_0x58dd79[_0xbe14('0x39')]=_[_0xbe14('0x3a')](_0x58dd79[_0xbe14('0x3b')],_0x58dd79[_0xbe14('0x38')]);_0x56bcd3[_0xbe14('0x3c')]=_['intersection'](_0x58dd79[_0xbe14('0x3b')],qs[_0xbe14('0x3d')](_0xc61103[_0xbe14('0x38')][_0xbe14('0x3d')]));_0x56bcd3[_0xbe14('0x3c')]=_0x56bcd3[_0xbe14('0x3c')][_0xbe14('0x3e')]?_0x56bcd3[_0xbe14('0x3c')]:_0x58dd79[_0xbe14('0x3b')];_0x56bcd3[_0xbe14('0x55')]=qs['sort'](_0xc61103[_0xbe14('0x38')][_0xbe14('0x41')]);_0x56bcd3[_0xbe14('0x42')]=qs[_0xbe14('0x39')](_[_0xbe14('0x43')](_0xc61103['query'],_0x58dd79[_0xbe14('0x39')]));if(_0xc61103[_0xbe14('0x38')][_0xbe14('0x44')]){_0x56bcd3[_0xbe14('0x42')]=_[_0xbe14('0x45')](_0x56bcd3['where'],{'$or':_[_0xbe14('0x33')](_0x56bcd3[_0xbe14('0x3c')],function(_0x7ea146){var _0x29bb26={};_0x29bb26[_0x7ea146]={'$like':'%'+_0xc61103[_0xbe14('0x38')][_0xbe14('0x44')]+'%'};return _0x29bb26;})});}_0x56bcd3=_[_0xbe14('0x45')]({},_0x56bcd3,_0xc61103[_0xbe14('0x47')]);return _0x10c0bc['getFields'](_0x56bcd3);}})[_0xbe14('0x1c')](function(_0x33c309){if(_0x33c309){_0x1bfcbf=_0x33c309[_0xbe14('0x3e')];if(!_0xc61103[_0xbe14('0x38')][_0xbe14('0x3f')](_0xbe14('0x40'))){_0x56bcd3[_0xbe14('0x29')]=qs['limit'](_0xc61103['query'][_0xbe14('0x29')]);_0x56bcd3[_0xbe14('0x28')]=qs[_0xbe14('0x28')](_0xc61103[_0xbe14('0x38')][_0xbe14('0x28')]);}return _0x10c0bc[_0xbe14('0x52')](_0x56bcd3);}})[_0xbe14('0x1c')](function(_0x43511e){if(_0x43511e){return _0x43511e?{'count':_0x1bfcbf,'rows':_0x43511e}:null;}})['then'](respondWithResult(_0x358950,null))['catch'](handleError(_0x358950,null));};exports[_0xbe14('0x56')]=function(_0x1c18b6,_0x29aa52,_0x57729f){var _0x76e91e={};var _0x16bca1={};var _0x105be0;var _0x1797dd;return db[_0xbe14('0x34')][_0xbe14('0x53')]({'where':{'id':_0x1c18b6[_0xbe14('0x4d')]['id']}})['then'](handleEntityNotFound(_0x29aa52,null))[_0xbe14('0x1c')](function(_0x3b6ef5){if(_0x3b6ef5){_0x105be0=_0x3b6ef5;_0x16bca1[_0xbe14('0x3b')]=_[_0xbe14('0x4e')](db[_0xbe14('0x54')][_0xbe14('0x35')]);_0x16bca1[_0xbe14('0x38')]=_['keys'](_0x1c18b6[_0xbe14('0x38')]);_0x16bca1[_0xbe14('0x39')]=_[_0xbe14('0x3a')](_0x16bca1[_0xbe14('0x3b')],_0x16bca1[_0xbe14('0x38')]);_0x76e91e[_0xbe14('0x3c')]=_[_0xbe14('0x3a')](_0x16bca1[_0xbe14('0x3b')],qs['fields'](_0x1c18b6[_0xbe14('0x38')][_0xbe14('0x3d')]));_0x76e91e[_0xbe14('0x3c')]=_0x76e91e[_0xbe14('0x3c')][_0xbe14('0x3e')]?_0x76e91e[_0xbe14('0x3c')]:_0x16bca1['model'];_0x76e91e[_0xbe14('0x55')]=qs[_0xbe14('0x41')](_0x1c18b6[_0xbe14('0x38')][_0xbe14('0x41')]);_0x76e91e['where']=qs[_0xbe14('0x39')](_[_0xbe14('0x43')](_0x1c18b6[_0xbe14('0x38')],_0x16bca1[_0xbe14('0x39')]));if(_0x1c18b6[_0xbe14('0x38')][_0xbe14('0x44')]){_0x76e91e[_0xbe14('0x42')]=_['merge'](_0x76e91e[_0xbe14('0x42')],{'$or':_['map'](_0x76e91e[_0xbe14('0x3c')],function(_0x5d85d3){var _0x389822={};_0x389822[_0x5d85d3]={'$like':'%'+_0x1c18b6[_0xbe14('0x38')][_0xbe14('0x44')]+'%'};return _0x389822;})});}_0x76e91e=_['merge']({},_0x76e91e,_0x1c18b6[_0xbe14('0x47')]);return _0x105be0[_0xbe14('0x56')](_0x76e91e);}})[_0xbe14('0x1c')](function(_0x546f22){if(_0x546f22){_0x1797dd=_0x546f22[_0xbe14('0x3e')];if(!_0x1c18b6[_0xbe14('0x38')][_0xbe14('0x3f')](_0xbe14('0x40'))){_0x76e91e['limit']=qs[_0xbe14('0x29')](_0x1c18b6[_0xbe14('0x38')][_0xbe14('0x29')]);_0x76e91e[_0xbe14('0x28')]=qs[_0xbe14('0x28')](_0x1c18b6[_0xbe14('0x38')][_0xbe14('0x28')]);}return _0x105be0['getSubjects'](_0x76e91e);}})[_0xbe14('0x1c')](function(_0x123f4f){if(_0x123f4f){return _0x123f4f?{'count':_0x1797dd,'rows':_0x123f4f}:null;}})[_0xbe14('0x1c')](respondWithResult(_0x29aa52,null))['catch'](handleError(_0x29aa52,null));};exports[_0xbe14('0x57')]=function(_0x420467,_0x1ea305,_0x5bc52b){var _0xa53262={};var _0x1205d1={};var _0x47d7bb;var _0x2be969;return db['ZohoConfiguration'][_0xbe14('0x53')]({'where':{'id':_0x420467[_0xbe14('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1ea305,null))['then'](function(_0x54045e){if(_0x54045e){_0x47d7bb=_0x54045e;_0x1205d1[_0xbe14('0x3b')]=_[_0xbe14('0x4e')](db['ZohoField'][_0xbe14('0x35')]);_0x1205d1[_0xbe14('0x38')]=_[_0xbe14('0x4e')](_0x420467[_0xbe14('0x38')]);_0x1205d1['filters']=_['intersection'](_0x1205d1[_0xbe14('0x3b')],_0x1205d1[_0xbe14('0x38')]);_0xa53262[_0xbe14('0x3c')]=_[_0xbe14('0x3a')](_0x1205d1[_0xbe14('0x3b')],qs[_0xbe14('0x3d')](_0x420467[_0xbe14('0x38')]['fields']));_0xa53262[_0xbe14('0x3c')]=_0xa53262['attributes'][_0xbe14('0x3e')]?_0xa53262[_0xbe14('0x3c')]:_0x1205d1[_0xbe14('0x3b')];_0xa53262[_0xbe14('0x55')]=qs['sort'](_0x420467[_0xbe14('0x38')][_0xbe14('0x41')]);_0xa53262[_0xbe14('0x42')]=qs['filters'](_[_0xbe14('0x43')](_0x420467[_0xbe14('0x38')],_0x1205d1[_0xbe14('0x39')]));if(_0x420467[_0xbe14('0x38')][_0xbe14('0x44')]){_0xa53262[_0xbe14('0x42')]=_[_0xbe14('0x45')](_0xa53262[_0xbe14('0x42')],{'$or':_[_0xbe14('0x33')](_0xa53262[_0xbe14('0x3c')],function(_0x2bf94c){var _0x49497e={};_0x49497e[_0x2bf94c]={'$like':'%'+_0x420467[_0xbe14('0x38')][_0xbe14('0x44')]+'%'};return _0x49497e;})});}_0xa53262=_[_0xbe14('0x45')]({},_0xa53262,_0x420467[_0xbe14('0x47')]);return _0x47d7bb[_0xbe14('0x57')](_0xa53262);}})[_0xbe14('0x1c')](function(_0x1679bd){if(_0x1679bd){_0x2be969=_0x1679bd[_0xbe14('0x3e')];if(!_0x420467['query'][_0xbe14('0x3f')]('nolimit')){_0xa53262[_0xbe14('0x29')]=qs[_0xbe14('0x29')](_0x420467[_0xbe14('0x38')][_0xbe14('0x29')]);_0xa53262[_0xbe14('0x28')]=qs['offset'](_0x420467['query'][_0xbe14('0x28')]);}return _0x47d7bb[_0xbe14('0x57')](_0xa53262);}})[_0xbe14('0x1c')](function(_0x42b849){if(_0x42b849){return _0x42b849?{'count':_0x2be969,'rows':_0x42b849}:null;}})['then'](respondWithResult(_0x1ea305,null))[_0xbe14('0x50')](handleError(_0x1ea305,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 9c0b530..a7fb161 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 _0xf935=['int_zoho_configurations','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration'];(function(_0x13fe07,_0x54713c){var _0x2f2f66=function(_0x3ea80a){while(--_0x3ea80a){_0x13fe07['push'](_0x13fe07['shift']());}};_0x2f2f66(++_0x54713c);}(_0xf935,0x79));var _0x5f93=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xf935[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0x5f93('0x0'));var logger=require(_0x5f93('0x1'))(_0x5f93('0x2'));var moment=require('moment');var BPromise=require(_0x5f93('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5f93('0x4'));var rimraf=require(_0x5f93('0x5'));var config=require(_0x5f93('0x6'));var attributes=require(_0x5f93('0x7'));module[_0x5f93('0x8')]=function(_0x451ffa,_0x1b80c0){return _0x451ffa[_0x5f93('0x9')](_0x5f93('0xa'),attributes,{'tableName':_0x5f93('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x10ae=['lodash','util','moment','bluebird','path','rimraf','../../config/environment','define'];(function(_0x67dc86,_0x2a57f1){var _0x3fe590=function(_0x5cd306){while(--_0x5cd306){_0x67dc86['push'](_0x67dc86['shift']());}};_0x3fe590(++_0x2a57f1);}(_0x10ae,0x138));var _0xe10a=function(_0x5af873,_0x38776f){_0x5af873=_0x5af873-0x0;var _0x390fed=_0x10ae[_0x5af873];return _0x390fed;};'use strict';var _=require(_0xe10a('0x0'));var util=require(_0xe10a('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xe10a('0x2'));var BPromise=require(_0xe10a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe10a('0x4'));var rimraf=require(_0xe10a('0x5'));var config=require(_0xe10a('0x6'));var attributes=require('./intZohoConfiguration.attributes');module['exports']=function(_0x41c03b,_0x51e503){return _0x41c03b[_0xe10a('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 5313e00..9a392f8 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 _0x85fb=['ioredis','../../mysqldb','../../config/logger','jayson/promise','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','randomstring'];(function(_0x111e95,_0x4fbaae){var _0x703e9b=function(_0x2177ba){while(--_0x2177ba){_0x111e95['push'](_0x111e95['shift']());}};_0x703e9b(++_0x4fbaae);}(_0x85fb,0xa8));var _0xb85f=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x85fb[_0x57b54c];return _0x59cc19;};'use strict';var _=require('lodash');var util=require(_0xb85f('0x0'));var moment=require(_0xb85f('0x1'));var BPromise=require('bluebird');var rs=require(_0xb85f('0x2'));var fs=require('fs');var Redis=require(_0xb85f('0x3'));var db=require(_0xb85f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb85f('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb85f('0x6'));var client=jayson['client'][_0xb85f('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xa776e9,_0x245922,_0x127343){return new BPromise(function(_0x1b6546,_0x20ea58){return client[_0xb85f('0x8')](_0xa776e9,_0x127343)[_0xb85f('0x9')](function(_0x2ad400){logger[_0xb85f('0xa')](_0xb85f('0xb'),_0x245922,_0xb85f('0xc'));logger['debug'](_0xb85f('0xd'),_0x245922,_0xb85f('0xc'),JSON[_0xb85f('0xe')](_0x2ad400));if(_0x2ad400['error']){if(_0x2ad400[_0xb85f('0xf')][_0xb85f('0x10')]===0x1f4){logger['error'](_0xb85f('0xb'),_0x245922,_0x2ad400[_0xb85f('0xf')][_0xb85f('0x11')]);return _0x20ea58(_0x2ad400[_0xb85f('0xf')][_0xb85f('0x11')]);}logger[_0xb85f('0xf')]('ZohoConfiguration,\x20%s,\x20%s',_0x245922,_0x2ad400[_0xb85f('0xf')][_0xb85f('0x11')]);return _0x1b6546(_0x2ad400['error']['message']);}else{logger[_0xb85f('0xa')](_0xb85f('0xb'),_0x245922,_0xb85f('0xc'));_0x1b6546(_0x2ad400[_0xb85f('0x12')][_0xb85f('0x11')]);}})['catch'](function(_0x425eae){logger[_0xb85f('0xf')](_0xb85f('0xb'),_0x245922,_0x425eae);_0x20ea58(_0x425eae);});});} \ No newline at end of file +var _0x456e=['error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x281dab,_0xbc3f92){var _0x135d67=function(_0x5584c8){while(--_0x5584c8){_0x281dab['push'](_0x281dab['shift']());}};_0x135d67(++_0xbc3f92);}(_0x456e,0x1d2));var _0xe456=function(_0x3cedbb,_0x2a139e){_0x3cedbb=_0x3cedbb-0x0;var _0x3d7a5c=_0x456e[_0x3cedbb];return _0x3d7a5c;};'use strict';var _=require(_0xe456('0x0'));var util=require(_0xe456('0x1'));var moment=require('moment');var BPromise=require(_0xe456('0x2'));var rs=require(_0xe456('0x3'));var fs=require('fs');var Redis=require(_0xe456('0x4'));var db=require(_0xe456('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe456('0x6'))('rpc');var config=require(_0xe456('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe456('0x8')][_0xe456('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5a09de,_0x46fe61,_0x1073ed){return new BPromise(function(_0x4b97ad,_0x4e06f7){return client[_0xe456('0xa')](_0x5a09de,_0x1073ed)[_0xe456('0xb')](function(_0x491f94){logger[_0xe456('0xc')](_0xe456('0xd'),_0x46fe61,_0xe456('0xe'));logger[_0xe456('0xf')](_0xe456('0x10'),_0x46fe61,'request\x20sent',JSON[_0xe456('0x11')](_0x491f94));if(_0x491f94[_0xe456('0x12')]){if(_0x491f94['error'][_0xe456('0x13')]===0x1f4){logger[_0xe456('0x12')](_0xe456('0xd'),_0x46fe61,_0x491f94[_0xe456('0x12')]['message']);return _0x4e06f7(_0x491f94[_0xe456('0x12')][_0xe456('0x14')]);}logger[_0xe456('0x12')]('ZohoConfiguration,\x20%s,\x20%s',_0x46fe61,_0x491f94[_0xe456('0x12')][_0xe456('0x14')]);return _0x4b97ad(_0x491f94[_0xe456('0x12')][_0xe456('0x14')]);}else{logger[_0xe456('0xc')](_0xe456('0xd'),_0x46fe61,_0xe456('0xe'));_0x4b97ad(_0x491f94[_0xe456('0x15')]['message']);}})['catch'](function(_0x2bbee7){logger[_0xe456('0x12')](_0xe456('0xd'),_0x46fe61,_0x2bbee7);_0x4e06f7(_0x2bbee7);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index b4264da..728f796 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 _0x896e=['isAuthenticated','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','get'];(function(_0x482fc8,_0x4d40ce){var _0x1ba080=function(_0x54a809){while(--_0x54a809){_0x482fc8['push'](_0x482fc8['shift']());}};_0x1ba080(++_0x4d40ce);}(_0x896e,0x1e9));var _0xe896=function(_0x8afb57,_0x409ec3){_0x8afb57=_0x8afb57-0x0;var _0x1c7bf6=_0x896e[_0x8afb57];return _0x1c7bf6;};'use strict';var multer=require(_0xe896('0x0'));var util=require(_0xe896('0x1'));var path=require(_0xe896('0x2'));var timeout=require(_0xe896('0x3'));var express=require(_0xe896('0x4'));var router=express[_0xe896('0x5')]();var auth=require(_0xe896('0x6'));var interaction=require(_0xe896('0x7'));var config=require(_0xe896('0x8'));var controller=require(_0xe896('0x9'));router[_0xe896('0xa')]('/',auth[_0xe896('0xb')](),controller['index']);router[_0xe896('0xa')](_0xe896('0xc'),auth[_0xe896('0xb')](),controller[_0xe896('0xd')]);router[_0xe896('0xe')]('/',auth['isAuthenticated'](),controller[_0xe896('0xf')]);router[_0xe896('0x10')](_0xe896('0xc'),auth['isAuthenticated'](),controller[_0xe896('0x11')]);router['delete'](_0xe896('0xc'),auth['isAuthenticated'](),controller[_0xe896('0x12')]);module[_0xe896('0x13')]=router; \ No newline at end of file +var _0x4991=['get','isAuthenticated','/:id','show','post','create','put','update','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller'];(function(_0x2ea22f,_0x576c80){var _0x2c3ac8=function(_0x792c5e){while(--_0x792c5e){_0x2ea22f['push'](_0x2ea22f['shift']());}};_0x2c3ac8(++_0x576c80);}(_0x4991,0xf7));var _0x1499=function(_0x5a4b24,_0x49c0e6){_0x5a4b24=_0x5a4b24-0x0;var _0x41fc92=_0x4991[_0x5a4b24];return _0x41fc92;};'use strict';var multer=require(_0x1499('0x0'));var util=require('util');var path=require(_0x1499('0x1'));var timeout=require('connect-timeout');var express=require(_0x1499('0x2'));var router=express[_0x1499('0x3')]();var auth=require(_0x1499('0x4'));var interaction=require(_0x1499('0x5'));var config=require(_0x1499('0x6'));var controller=require(_0x1499('0x7'));router[_0x1499('0x8')]('/',auth[_0x1499('0x9')](),controller['index']);router[_0x1499('0x8')](_0x1499('0xa'),auth[_0x1499('0x9')](),controller[_0x1499('0xb')]);router[_0x1499('0xc')]('/',auth[_0x1499('0x9')](),controller[_0x1499('0xd')]);router[_0x1499('0xe')]('/:id',auth[_0x1499('0x9')](),controller[_0x1499('0xf')]);router['delete'](_0x1499('0xa'),auth[_0x1499('0x9')](),controller['destroy']);module[_0x1499('0x10')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 4a0b1a2..4be2e5c 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 _0x8f69=['ENUM','variable','customVariable','keyValue','STRING','string','BOOLEAN','sequelize','exports'];(function(_0x3ad147,_0x1c9fe3){var _0x70dd7c=function(_0x5111a9){while(--_0x5111a9){_0x3ad147['push'](_0x3ad147['shift']());}};_0x70dd7c(++_0x1c9fe3);}(_0x8f69,0xfa));var _0x98f6=function(_0x187279,_0x26d152){_0x187279=_0x187279-0x0;var _0x3da59d=_0x8f69[_0x187279];return _0x3da59d;};'use strict';var Sequelize=require(_0x98f6('0x0'));module[_0x98f6('0x1')]={'type':{'type':Sequelize[_0x98f6('0x2')]('string',_0x98f6('0x3'),_0x98f6('0x4'),_0x98f6('0x5')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x98f6('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x98f6('0x7'),_0x98f6('0x3'),_0x98f6('0x4'))},'keyContent':{'type':Sequelize[_0x98f6('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x98f6('0x6')]},'customField':{'type':Sequelize[_0x98f6('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x98f6('0x6')]}}; \ No newline at end of file +var _0xf185=['string','variable','customVariable','keyValue','STRING','BOOLEAN','sequelize','ENUM'];(function(_0x431fbe,_0x229287){var _0x381400=function(_0x5e174d){while(--_0x5e174d){_0x431fbe['push'](_0x431fbe['shift']());}};_0x381400(++_0x229287);}(_0xf185,0x1be));var _0x5f18=function(_0x247012,_0x2b3fd2){_0x247012=_0x247012-0x0;var _0x289706=_0xf185[_0x247012];return _0x289706;};'use strict';var Sequelize=require(_0x5f18('0x0'));module['exports']={'type':{'type':Sequelize[_0x5f18('0x1')](_0x5f18('0x2'),_0x5f18('0x3'),_0x5f18('0x4'),_0x5f18('0x5')),'defaultValue':_0x5f18('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x5f18('0x6')]},'keyType':{'type':Sequelize[_0x5f18('0x1')](_0x5f18('0x2'),_0x5f18('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x5f18('0x6')]},'idField':{'type':Sequelize[_0x5f18('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x5f18('0x7')],'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 bfbd3e9..ea21662 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 _0x0cc7=['nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','params','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','count','offset','limit','status','set','json','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','map','ZohoField','fieldName','type','key','query','keys','model','attributes','intersection','fields','length'];(function(_0x4e8bf7,_0x51dadc){var _0x42f457=function(_0x4e030f){while(--_0x4e030f){_0x4e8bf7['push'](_0x4e8bf7['shift']());}};_0x42f457(++_0x51dadc);}(_0x0cc7,0x122));var _0x70cc=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x0cc7[_0x1caf6a];return _0x1bf493;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x70cc('0x0'));var zipdir=require(_0x70cc('0x1'));var jsonpatch=require(_0x70cc('0x2'));var rp=require(_0x70cc('0x3'));var moment=require(_0x70cc('0x4'));var BPromise=require(_0x70cc('0x5'));var Mustache=require(_0x70cc('0x6'));var util=require('util');var path=require(_0x70cc('0x7'));var sox=require(_0x70cc('0x8'));var csv=require(_0x70cc('0x9'));var ejs=require(_0x70cc('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x70cc('0xb'));var jsforce=require(_0x70cc('0xc'));var deskjs=require(_0x70cc('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x70cc('0xe'));var authService=require(_0x70cc('0xf'));var qs=require(_0x70cc('0x10'));var as=require(_0x70cc('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x70cc('0x12'))(_0x70cc('0x13'));var utils=require(_0x70cc('0x14'));var config=require(_0x70cc('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x61e984,_0x206215){_0x206215=_0x206215||0xcc;return function(_0x6ce1ac){if(_0x6ce1ac){return _0x61e984['sendStatus'](_0x206215);}return _0x61e984['status'](_0x206215)['end']();};}function respondWithResult(_0x5c7f25,_0x246aa9){_0x246aa9=_0x246aa9||0xc8;return function(_0x408e9f){if(_0x408e9f){return _0x5c7f25['status'](_0x246aa9)['json'](_0x408e9f);}};}function respondWithFilteredResult(_0x3bca06,_0x447573){return function(_0x1b2246){if(_0x1b2246){var _0x400144=_0x1b2246[_0x70cc('0x16')],_0x10010a=_0x447573[_0x70cc('0x17')],_0x497e76=_0x447573[_0x70cc('0x17')]+_0x447573[_0x70cc('0x18')],_0x76e3b1;if(_0x497e76>=_0x400144){_0x497e76=_0x400144;_0x76e3b1=0xc8;}else{_0x76e3b1=0xce;}_0x3bca06[_0x70cc('0x19')](_0x76e3b1);return _0x3bca06[_0x70cc('0x1a')]('Content-Range',_0x10010a+'-'+_0x497e76+'/'+_0x400144)[_0x70cc('0x1b')](_0x1b2246);}return null;};}function patchUpdates(_0x27f1fc){return function(_0x339caf){try{jsonpatch[_0x70cc('0x1c')](_0x339caf,_0x27f1fc,!![]);}catch(_0x10afac){return BPromise[_0x70cc('0x1d')](_0x10afac);}return _0x339caf[_0x70cc('0x1e')]();};}function saveUpdates(_0x360727,_0x140b19){return function(_0x5cde09){if(_0x5cde09){return _0x5cde09[_0x70cc('0x1f')](_0x360727)[_0x70cc('0x20')](function(_0x5726c3){return _0x5726c3;});}return null;};}function removeEntity(_0x3d7b5d,_0x42e860){return function(_0x5ec5c5){if(_0x5ec5c5){return _0x5ec5c5[_0x70cc('0x21')]()['then'](function(){_0x3d7b5d[_0x70cc('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x53a6df,_0x308943){return function(_0x2ddde2){if(!_0x2ddde2){_0x53a6df[_0x70cc('0x22')](0x194);}return _0x2ddde2;};}function handleError(_0x52b8b0,_0x5a22d7){_0x5a22d7=_0x5a22d7||0x1f4;return function(_0x381de){logger['error'](_0x381de[_0x70cc('0x23')]);if(_0x381de[_0x70cc('0x24')]){delete _0x381de['name'];}_0x52b8b0[_0x70cc('0x19')](_0x5a22d7)[_0x70cc('0x25')](_0x381de);};}exports['index']=function(_0x2722f5,_0x5e72d4){var _0x22567d={},_0x2930a1={},_0x4cc392={'count':0x0,'rows':[]};var _0x18dd9b=_[_0x70cc('0x26')](db[_0x70cc('0x27')]['rawAttributes'],function(_0x1fd800){return{'name':_0x1fd800[_0x70cc('0x28')],'type':_0x1fd800[_0x70cc('0x29')][_0x70cc('0x2a')]};});_0x2930a1['model']=_['map'](_0x18dd9b,_0x70cc('0x24'));_0x2930a1[_0x70cc('0x2b')]=_[_0x70cc('0x2c')](_0x2722f5['query']);_0x2930a1['filters']=_['intersection'](_0x2930a1[_0x70cc('0x2d')],_0x2930a1[_0x70cc('0x2b')]);_0x22567d[_0x70cc('0x2e')]=_[_0x70cc('0x2f')](_0x2930a1[_0x70cc('0x2d')],qs[_0x70cc('0x30')](_0x2722f5['query'][_0x70cc('0x30')]));_0x22567d[_0x70cc('0x2e')]=_0x22567d[_0x70cc('0x2e')][_0x70cc('0x31')]?_0x22567d[_0x70cc('0x2e')]:_0x2930a1['model'];if(!_0x2722f5[_0x70cc('0x2b')]['hasOwnProperty'](_0x70cc('0x32'))){_0x22567d[_0x70cc('0x18')]=qs[_0x70cc('0x18')](_0x2722f5[_0x70cc('0x2b')]['limit']);_0x22567d['offset']=qs[_0x70cc('0x17')](_0x2722f5[_0x70cc('0x2b')][_0x70cc('0x17')]);}_0x22567d[_0x70cc('0x33')]=qs['sort'](_0x2722f5[_0x70cc('0x2b')][_0x70cc('0x34')]);_0x22567d[_0x70cc('0x35')]=qs[_0x70cc('0x36')](_[_0x70cc('0x37')](_0x2722f5[_0x70cc('0x2b')],_0x2930a1[_0x70cc('0x36')]));if(_0x2722f5['query'][_0x70cc('0x38')]){_0x22567d[_0x70cc('0x35')]=_[_0x70cc('0x39')](_0x22567d[_0x70cc('0x35')],{'$or':_['map'](_0x18dd9b,function(_0x52b58a){if(_0x52b58a[_0x70cc('0x29')]!==_0x70cc('0x3a')){var _0x34cda7={};_0x34cda7[_0x52b58a[_0x70cc('0x24')]]={'$like':'%'+_0x2722f5[_0x70cc('0x2b')]['filter']+'%'};return _0x34cda7;}})});}_0x22567d=_[_0x70cc('0x39')]({},_0x22567d,_0x2722f5['options']);var _0x25ea60={'where':_0x22567d['where']};return db[_0x70cc('0x27')][_0x70cc('0x16')](_0x25ea60)['then'](function(_0x39380e){_0x4cc392[_0x70cc('0x16')]=_0x39380e;if(_0x2722f5[_0x70cc('0x2b')][_0x70cc('0x3b')]){_0x22567d[_0x70cc('0x3c')]=[{'all':!![]}];}return db[_0x70cc('0x27')]['findAll'](_0x22567d);})[_0x70cc('0x20')](function(_0x5bedd3){_0x4cc392[_0x70cc('0x3d')]=_0x5bedd3;return _0x4cc392;})[_0x70cc('0x20')](respondWithFilteredResult(_0x5e72d4,_0x22567d))[_0x70cc('0x3e')](handleError(_0x5e72d4,null));};exports[_0x70cc('0x3f')]=function(_0x391cbb,_0x41046a){var _0x8124c1={'raw':!![],'where':{'id':_0x391cbb[_0x70cc('0x40')]['id']}},_0x26f4cb={};_0x26f4cb[_0x70cc('0x2d')]=_[_0x70cc('0x2c')](db[_0x70cc('0x27')]['rawAttributes']);_0x26f4cb[_0x70cc('0x2b')]=_[_0x70cc('0x2c')](_0x391cbb[_0x70cc('0x2b')]);_0x26f4cb[_0x70cc('0x36')]=_[_0x70cc('0x2f')](_0x26f4cb[_0x70cc('0x2d')],_0x26f4cb[_0x70cc('0x2b')]);_0x8124c1[_0x70cc('0x2e')]=_['intersection'](_0x26f4cb['model'],qs['fields'](_0x391cbb[_0x70cc('0x2b')][_0x70cc('0x30')]));_0x8124c1[_0x70cc('0x2e')]=_0x8124c1[_0x70cc('0x2e')]['length']?_0x8124c1[_0x70cc('0x2e')]:_0x26f4cb[_0x70cc('0x2d')];if(_0x391cbb[_0x70cc('0x2b')][_0x70cc('0x3b')]){_0x8124c1[_0x70cc('0x3c')]=[{'all':!![]}];}_0x8124c1=_['merge']({},_0x8124c1,_0x391cbb['options']);return db[_0x70cc('0x27')][_0x70cc('0x41')](_0x8124c1)[_0x70cc('0x20')](handleEntityNotFound(_0x41046a,null))[_0x70cc('0x20')](respondWithResult(_0x41046a,null))[_0x70cc('0x3e')](handleError(_0x41046a,null));};exports['create']=function(_0x2244f1,_0x12d333){return db['ZohoField'][_0x70cc('0x42')](_0x2244f1['body'],{})['then'](respondWithResult(_0x12d333,0xc9))[_0x70cc('0x3e')](handleError(_0x12d333,null));};exports[_0x70cc('0x1f')]=function(_0x30c73d,_0x538e04){if(_0x30c73d['body']['id']){delete _0x30c73d[_0x70cc('0x43')]['id'];}return db['ZohoField']['find']({'where':{'id':_0x30c73d[_0x70cc('0x40')]['id']}})[_0x70cc('0x20')](handleEntityNotFound(_0x538e04,null))[_0x70cc('0x20')](saveUpdates(_0x30c73d[_0x70cc('0x43')],null))[_0x70cc('0x20')](respondWithResult(_0x538e04,null))[_0x70cc('0x3e')](handleError(_0x538e04,null));};exports[_0x70cc('0x21')]=function(_0x2bf2b5,_0x450f75){return db['ZohoField'][_0x70cc('0x41')]({'where':{'id':_0x2bf2b5[_0x70cc('0x40')]['id']}})[_0x70cc('0x20')](handleEntityNotFound(_0x450f75,null))[_0x70cc('0x20')](removeEntity(_0x450f75,null))['catch'](handleError(_0x450f75,null));}; \ No newline at end of file +var _0xd612=['bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','offset','limit','set','save','update','then','error','stack','name','send','index','ZohoField','rawAttributes','type','map','filters','intersection','query','attributes','fields','length','model','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','count','includeAll','include','rows','catch','params','keys','find','create','body','destroy','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment'];(function(_0x58ed0e,_0x5040e2){var _0x2dabdc=function(_0x1cfa2f){while(--_0x1cfa2f){_0x58ed0e['push'](_0x58ed0e['shift']());}};_0x2dabdc(++_0x5040e2);}(_0xd612,0xc9));var _0x2d61=function(_0x4418d8,_0x3c6083){_0x4418d8=_0x4418d8-0x0;var _0x354564=_0xd612[_0x4418d8];return _0x354564;};'use strict';var pdf=require(_0x2d61('0x0'));var emlformat=require(_0x2d61('0x1'));var rimraf=require(_0x2d61('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2d61('0x3'));var rp=require(_0x2d61('0x4'));var moment=require(_0x2d61('0x5'));var BPromise=require(_0x2d61('0x6'));var Mustache=require('mustache');var util=require(_0x2d61('0x7'));var path=require('path');var sox=require(_0x2d61('0x8'));var csv=require(_0x2d61('0x9'));var ejs=require(_0x2d61('0xa'));var fs=require('fs');var _=require(_0x2d61('0xb'));var squel=require(_0x2d61('0xc'));var crypto=require(_0x2d61('0xd'));var jsforce=require(_0x2d61('0xe'));var deskjs=require(_0x2d61('0xf'));var toCsv=require(_0x2d61('0x9'));var querystring=require(_0x2d61('0x10'));var Papa=require('papaparse');var Redis=require(_0x2d61('0x11'));var authService=require(_0x2d61('0x12'));var qs=require(_0x2d61('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2d61('0x14'));var logger=require(_0x2d61('0x15'))(_0x2d61('0x16'));var utils=require(_0x2d61('0x17'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4824dd,_0x67bdb5){_0x67bdb5=_0x67bdb5||0xcc;return function(_0x9f19a){if(_0x9f19a){return _0x4824dd[_0x2d61('0x18')](_0x67bdb5);}return _0x4824dd[_0x2d61('0x19')](_0x67bdb5)[_0x2d61('0x1a')]();};}function respondWithResult(_0x2ed50e,_0xa9a5fc){_0xa9a5fc=_0xa9a5fc||0xc8;return function(_0x43fa70){if(_0x43fa70){return _0x2ed50e[_0x2d61('0x19')](_0xa9a5fc)[_0x2d61('0x1b')](_0x43fa70);}};}function respondWithFilteredResult(_0x306eb1,_0x51d5d1){return function(_0x26cb06){if(_0x26cb06){var _0x44abb7=_0x26cb06['count'],_0x55e2a4=_0x51d5d1[_0x2d61('0x1c')],_0x25ac43=_0x51d5d1['offset']+_0x51d5d1[_0x2d61('0x1d')],_0x2d0561;if(_0x25ac43>=_0x44abb7){_0x25ac43=_0x44abb7;_0x2d0561=0xc8;}else{_0x2d0561=0xce;}_0x306eb1[_0x2d61('0x19')](_0x2d0561);return _0x306eb1[_0x2d61('0x1e')]('Content-Range',_0x55e2a4+'-'+_0x25ac43+'/'+_0x44abb7)[_0x2d61('0x1b')](_0x26cb06);}return null;};}function patchUpdates(_0x1cb695){return function(_0x349952){try{jsonpatch['apply'](_0x349952,_0x1cb695,!![]);}catch(_0x3f9357){return BPromise['reject'](_0x3f9357);}return _0x349952[_0x2d61('0x1f')]();};}function saveUpdates(_0x5618cb,_0x1b5461){return function(_0x4869a5){if(_0x4869a5){return _0x4869a5[_0x2d61('0x20')](_0x5618cb)['then'](function(_0x22e0a8){return _0x22e0a8;});}return null;};}function removeEntity(_0xf2f06f,_0x36d023){return function(_0x3f6465){if(_0x3f6465){return _0x3f6465['destroy']()[_0x2d61('0x21')](function(){_0xf2f06f['status'](0xcc)[_0x2d61('0x1a')]();});}};}function handleEntityNotFound(_0x5567da,_0x1557a5){return function(_0x23bf86){if(!_0x23bf86){_0x5567da[_0x2d61('0x18')](0x194);}return _0x23bf86;};}function handleError(_0x1cf56a,_0x2ba86b){_0x2ba86b=_0x2ba86b||0x1f4;return function(_0x49c5da){logger[_0x2d61('0x22')](_0x49c5da[_0x2d61('0x23')]);if(_0x49c5da[_0x2d61('0x24')]){delete _0x49c5da['name'];}_0x1cf56a['status'](_0x2ba86b)[_0x2d61('0x25')](_0x49c5da);};}exports[_0x2d61('0x26')]=function(_0xcf9f5,_0x2585df){var _0x19ed05={},_0x5f5c0f={},_0xfdbaa8={'count':0x0,'rows':[]};var _0x391a25=_['map'](db[_0x2d61('0x27')][_0x2d61('0x28')],function(_0x2fe72f){return{'name':_0x2fe72f['fieldName'],'type':_0x2fe72f[_0x2d61('0x29')]['key']};});_0x5f5c0f['model']=_[_0x2d61('0x2a')](_0x391a25,'name');_0x5f5c0f['query']=_['keys'](_0xcf9f5['query']);_0x5f5c0f[_0x2d61('0x2b')]=_[_0x2d61('0x2c')](_0x5f5c0f['model'],_0x5f5c0f[_0x2d61('0x2d')]);_0x19ed05[_0x2d61('0x2e')]=_[_0x2d61('0x2c')](_0x5f5c0f['model'],qs[_0x2d61('0x2f')](_0xcf9f5['query']['fields']));_0x19ed05[_0x2d61('0x2e')]=_0x19ed05[_0x2d61('0x2e')][_0x2d61('0x30')]?_0x19ed05[_0x2d61('0x2e')]:_0x5f5c0f[_0x2d61('0x31')];if(!_0xcf9f5[_0x2d61('0x2d')][_0x2d61('0x32')](_0x2d61('0x33'))){_0x19ed05[_0x2d61('0x1d')]=qs['limit'](_0xcf9f5[_0x2d61('0x2d')][_0x2d61('0x1d')]);_0x19ed05[_0x2d61('0x1c')]=qs[_0x2d61('0x1c')](_0xcf9f5[_0x2d61('0x2d')][_0x2d61('0x1c')]);}_0x19ed05['order']=qs[_0x2d61('0x34')](_0xcf9f5[_0x2d61('0x2d')][_0x2d61('0x34')]);_0x19ed05[_0x2d61('0x35')]=qs[_0x2d61('0x2b')](_[_0x2d61('0x36')](_0xcf9f5[_0x2d61('0x2d')],_0x5f5c0f[_0x2d61('0x2b')]));if(_0xcf9f5['query']['filter']){_0x19ed05[_0x2d61('0x35')]=_['merge'](_0x19ed05[_0x2d61('0x35')],{'$or':_[_0x2d61('0x2a')](_0x391a25,function(_0x50cc94){if(_0x50cc94[_0x2d61('0x29')]!=='VIRTUAL'){var _0x33bc2d={};_0x33bc2d[_0x50cc94[_0x2d61('0x24')]]={'$like':'%'+_0xcf9f5[_0x2d61('0x2d')][_0x2d61('0x37')]+'%'};return _0x33bc2d;}})});}_0x19ed05=_[_0x2d61('0x38')]({},_0x19ed05,_0xcf9f5[_0x2d61('0x39')]);var _0x2f023c={'where':_0x19ed05[_0x2d61('0x35')]};return db['ZohoField'][_0x2d61('0x3a')](_0x2f023c)[_0x2d61('0x21')](function(_0x29d399){_0xfdbaa8['count']=_0x29d399;if(_0xcf9f5[_0x2d61('0x2d')][_0x2d61('0x3b')]){_0x19ed05[_0x2d61('0x3c')]=[{'all':!![]}];}return db[_0x2d61('0x27')]['findAll'](_0x19ed05);})[_0x2d61('0x21')](function(_0x48e18b){_0xfdbaa8[_0x2d61('0x3d')]=_0x48e18b;return _0xfdbaa8;})[_0x2d61('0x21')](respondWithFilteredResult(_0x2585df,_0x19ed05))[_0x2d61('0x3e')](handleError(_0x2585df,null));};exports['show']=function(_0x33ddc7,_0x225e70){var _0x1c5d9d={'raw':!![],'where':{'id':_0x33ddc7[_0x2d61('0x3f')]['id']}},_0x5e9275={};_0x5e9275['model']=_[_0x2d61('0x40')](db[_0x2d61('0x27')]['rawAttributes']);_0x5e9275[_0x2d61('0x2d')]=_[_0x2d61('0x40')](_0x33ddc7[_0x2d61('0x2d')]);_0x5e9275[_0x2d61('0x2b')]=_[_0x2d61('0x2c')](_0x5e9275[_0x2d61('0x31')],_0x5e9275[_0x2d61('0x2d')]);_0x1c5d9d[_0x2d61('0x2e')]=_[_0x2d61('0x2c')](_0x5e9275[_0x2d61('0x31')],qs[_0x2d61('0x2f')](_0x33ddc7['query'][_0x2d61('0x2f')]));_0x1c5d9d['attributes']=_0x1c5d9d[_0x2d61('0x2e')][_0x2d61('0x30')]?_0x1c5d9d[_0x2d61('0x2e')]:_0x5e9275[_0x2d61('0x31')];if(_0x33ddc7[_0x2d61('0x2d')]['includeAll']){_0x1c5d9d['include']=[{'all':!![]}];}_0x1c5d9d=_[_0x2d61('0x38')]({},_0x1c5d9d,_0x33ddc7[_0x2d61('0x39')]);return db['ZohoField'][_0x2d61('0x41')](_0x1c5d9d)[_0x2d61('0x21')](handleEntityNotFound(_0x225e70,null))[_0x2d61('0x21')](respondWithResult(_0x225e70,null))[_0x2d61('0x3e')](handleError(_0x225e70,null));};exports[_0x2d61('0x42')]=function(_0x328362,_0x370ec4){return db['ZohoField']['create'](_0x328362[_0x2d61('0x43')],{})[_0x2d61('0x21')](respondWithResult(_0x370ec4,0xc9))[_0x2d61('0x3e')](handleError(_0x370ec4,null));};exports[_0x2d61('0x20')]=function(_0x3786df,_0x1f9566){if(_0x3786df[_0x2d61('0x43')]['id']){delete _0x3786df[_0x2d61('0x43')]['id'];}return db[_0x2d61('0x27')][_0x2d61('0x41')]({'where':{'id':_0x3786df[_0x2d61('0x3f')]['id']}})[_0x2d61('0x21')](handleEntityNotFound(_0x1f9566,null))[_0x2d61('0x21')](saveUpdates(_0x3786df[_0x2d61('0x43')],null))[_0x2d61('0x21')](respondWithResult(_0x1f9566,null))[_0x2d61('0x3e')](handleError(_0x1f9566,null));};exports[_0x2d61('0x44')]=function(_0x66beac,_0x4479bf){return db['ZohoField'][_0x2d61('0x41')]({'where':{'id':_0x66beac[_0x2d61('0x3f')]['id']}})[_0x2d61('0x21')](handleEntityNotFound(_0x4479bf,null))[_0x2d61('0x21')](removeEntity(_0x4479bf,null))[_0x2d61('0x3e')](handleError(_0x4479bf,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 5d94c10..eaca7c0 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 _0x071b=['moment','bluebird','../../config/environment','./intZohoField.attributes','exports','define','ZohoField','zoho_unique_index','lodash','util','../../config/logger','api'];(function(_0x45b54c,_0x2db7f8){var _0xb23cbb=function(_0x539f8c){while(--_0x539f8c){_0x45b54c['push'](_0x45b54c['shift']());}};_0xb23cbb(++_0x2db7f8);}(_0x071b,0xc8));var _0xb071=function(_0x3fb961,_0x1e0e94){_0x3fb961=_0x3fb961-0x0;var _0x15c1d2=_0x071b[_0x3fb961];return _0x15c1d2;};'use strict';var _=require(_0xb071('0x0'));var util=require(_0xb071('0x1'));var logger=require(_0xb071('0x2'))(_0xb071('0x3'));var moment=require(_0xb071('0x4'));var BPromise=require(_0xb071('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb071('0x6'));var attributes=require(_0xb071('0x7'));module[_0xb071('0x8')]=function(_0x416856,_0xaf3374){return _0x416856[_0xb071('0x9')](_0xb071('0xa'),attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':_0xb071('0xb'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8449=['define','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./intZohoField.attributes'];(function(_0x87506e,_0x5680ec){var _0x5496a4=function(_0x1e29ab){while(--_0x1e29ab){_0x87506e['push'](_0x87506e['shift']());}};_0x5496a4(++_0x5680ec);}(_0x8449,0x8d));var _0x9844=function(_0x1eda20,_0x1149f4){_0x1eda20=_0x1eda20-0x0;var _0x31b953=_0x8449[_0x1eda20];return _0x31b953;};'use strict';var _=require(_0x9844('0x0'));var util=require(_0x9844('0x1'));var logger=require(_0x9844('0x2'))(_0x9844('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9844('0x4'));var fs=require('fs');var path=require(_0x9844('0x5'));var rimraf=require(_0x9844('0x6'));var config=require(_0x9844('0x7'));var attributes=require(_0x9844('0x8'));module['exports']=function(_0x6d48dd,_0x5454ed){return _0x6d48dd[_0x9844('0x9')](_0x9844('0xa'),attributes,{'tableName':_0x9844('0xb'),'paranoid':![],'indexes':[{'name':_0x9844('0xc'),'fields':[_0x9844('0xd'),_0x9844('0xe')],'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 a7ff275..9a48b54 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 _0xfd28=['error','code','message','info','result','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','ZohoField,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x38b763,_0x4ce22f){var _0x1dbd8c=function(_0x6f8ff9){while(--_0x6f8ff9){_0x38b763['push'](_0x38b763['shift']());}};_0x1dbd8c(++_0x4ce22f);}(_0xfd28,0x148));var _0x8fd2=function(_0x2aecb2,_0x343312){_0x2aecb2=_0x2aecb2-0x0;var _0x3ebb80=_0xfd28[_0x2aecb2];return _0x3ebb80;};'use strict';var _=require('lodash');var util=require(_0x8fd2('0x0'));var moment=require(_0x8fd2('0x1'));var BPromise=require('bluebird');var rs=require(_0x8fd2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8fd2('0x3'))['db'];var utils=require(_0x8fd2('0x4'));var logger=require(_0x8fd2('0x5'))('rpc');var config=require(_0x8fd2('0x6'));var jayson=require(_0x8fd2('0x7'));var client=jayson[_0x8fd2('0x8')][_0x8fd2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2f0afc,_0x4bdc1a,_0x53d938){return new BPromise(function(_0x10fccf,_0x466c3d){return client[_0x8fd2('0xa')](_0x2f0afc,_0x53d938)['then'](function(_0x13cc69){logger['info'](_0x8fd2('0xb'),_0x4bdc1a,'request\x20sent');logger[_0x8fd2('0xc')]('ZohoField,\x20%s,\x20%s,\x20%s',_0x4bdc1a,_0x8fd2('0xd'),JSON['stringify'](_0x13cc69));if(_0x13cc69[_0x8fd2('0xe')]){if(_0x13cc69['error'][_0x8fd2('0xf')]===0x1f4){logger[_0x8fd2('0xe')](_0x8fd2('0xb'),_0x4bdc1a,_0x13cc69[_0x8fd2('0xe')][_0x8fd2('0x10')]);return _0x466c3d(_0x13cc69[_0x8fd2('0xe')][_0x8fd2('0x10')]);}logger[_0x8fd2('0xe')](_0x8fd2('0xb'),_0x4bdc1a,_0x13cc69[_0x8fd2('0xe')][_0x8fd2('0x10')]);return _0x10fccf(_0x13cc69[_0x8fd2('0xe')][_0x8fd2('0x10')]);}else{logger[_0x8fd2('0x11')](_0x8fd2('0xb'),_0x4bdc1a,'request\x20sent');_0x10fccf(_0x13cc69[_0x8fd2('0x12')]['message']);}})['catch'](function(_0x56f75d){logger[_0x8fd2('0xe')](_0x8fd2('0xb'),_0x4bdc1a,_0x56f75d);_0x466c3d(_0x56f75d);});});} \ No newline at end of file +var _0xe14d=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZohoField,\x20%s,\x20%s','debug','ZohoField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x49392e,_0x441b28){var _0xe978bb=function(_0x4404d1){while(--_0x4404d1){_0x49392e['push'](_0x49392e['shift']());}};_0xe978bb(++_0x441b28);}(_0xe14d,0x1ee));var _0xde14=function(_0x34021d,_0x753aa6){_0x34021d=_0x34021d-0x0;var _0x16597b=_0xe14d[_0x34021d];return _0x16597b;};'use strict';var _=require(_0xde14('0x0'));var util=require(_0xde14('0x1'));var moment=require(_0xde14('0x2'));var BPromise=require(_0xde14('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xde14('0x4'));var db=require(_0xde14('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xde14('0x6'))(_0xde14('0x7'));var config=require(_0xde14('0x8'));var jayson=require(_0xde14('0x9'));var client=jayson[_0xde14('0xa')][_0xde14('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b1f6b,_0x5a1344,_0x1bd49d){return new BPromise(function(_0x115b7d,_0x2b0e7c){return client[_0xde14('0xc')](_0x4b1f6b,_0x1bd49d)[_0xde14('0xd')](function(_0x176909){logger[_0xde14('0xe')](_0xde14('0xf'),_0x5a1344,'request\x20sent');logger[_0xde14('0x10')](_0xde14('0x11'),_0x5a1344,_0xde14('0x12'),JSON[_0xde14('0x13')](_0x176909));if(_0x176909[_0xde14('0x14')]){if(_0x176909[_0xde14('0x14')][_0xde14('0x15')]===0x1f4){logger[_0xde14('0x14')](_0xde14('0xf'),_0x5a1344,_0x176909[_0xde14('0x14')][_0xde14('0x16')]);return _0x2b0e7c(_0x176909[_0xde14('0x14')][_0xde14('0x16')]);}logger[_0xde14('0x14')](_0xde14('0xf'),_0x5a1344,_0x176909['error']['message']);return _0x115b7d(_0x176909[_0xde14('0x14')][_0xde14('0x16')]);}else{logger[_0xde14('0xe')]('ZohoField,\x20%s,\x20%s',_0x5a1344,_0xde14('0x12'));_0x115b7d(_0x176909[_0xde14('0x17')][_0xde14('0x16')]);}})[_0xde14('0x18')](function(_0x3de959){logger[_0xde14('0x14')](_0xde14('0xf'),_0x5a1344,_0x3de959);_0x2b0e7c(_0x3de959);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 7f4550e..86fe2a0 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 _0x0e5e=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','exports','multer','util'];(function(_0x4bb67f,_0x46f9e9){var _0x3c93f0=function(_0x349315){while(--_0x349315){_0x4bb67f['push'](_0x4bb67f['shift']());}};_0x3c93f0(++_0x46f9e9);}(_0x0e5e,0x1ce));var _0xe0e5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0e5e[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xe0e5('0x0'));var util=require(_0xe0e5('0x1'));var path=require(_0xe0e5('0x2'));var timeout=require(_0xe0e5('0x3'));var express=require(_0xe0e5('0x4'));var router=express['Router']();var auth=require(_0xe0e5('0x5'));var interaction=require(_0xe0e5('0x6'));var config=require('../../config/environment');module[_0xe0e5('0x7')]=router; \ No newline at end of file +var _0x8051=['../../components/interaction/service','../../config/environment','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x1f77f8,_0x25a5af){var _0x2e74f8=function(_0x1f241c){while(--_0x1f241c){_0x1f77f8['push'](_0x1f77f8['shift']());}};_0x2e74f8(++_0x25a5af);}(_0x8051,0x125));var _0x1805=function(_0x36e4eb,_0x36bf71){_0x36e4eb=_0x36e4eb-0x0;var _0x5a9860=_0x8051[_0x36e4eb];return _0x5a9860;};'use strict';var multer=require(_0x1805('0x0'));var util=require(_0x1805('0x1'));var path=require(_0x1805('0x2'));var timeout=require(_0x1805('0x3'));var express=require(_0x1805('0x4'));var router=express[_0x1805('0x5')]();var auth=require(_0x1805('0x6'));var interaction=require(_0x1805('0x7'));var config=require(_0x1805('0x8'));module[_0x1805('0x9')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 02045a8..236d93e 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 _0x6084=['STRING','unique_name_and_version','app.js','INTEGER','BOOLEAN','state'];(function(_0x374528,_0x2fda7c){var _0x4ba64a=function(_0x12dc0b){while(--_0x12dc0b){_0x374528['push'](_0x374528['shift']());}};_0x4ba64a(++_0x2fda7c);}(_0x6084,0x1b0));var _0x4608=function(_0x250b48,_0xe85ed1){_0x250b48=_0x250b48-0x0;var _0x5bb772=_0x6084[_0x250b48];return _0x5bb772;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0x4608('0x0')],'allowNull':![],'unique':_0x4608('0x1')},'main':{'type':Sequelize[_0x4608('0x0')],'defaultValue':_0x4608('0x2')},'filename':{'type':Sequelize[_0x4608('0x0')]},'path':{'type':Sequelize[_0x4608('0x0')]},'type':{'type':Sequelize[_0x4608('0x0')]},'size':{'type':Sequelize[_0x4608('0x3')]},'active':{'type':Sequelize[_0x4608('0x4')],'defaultValue':![]},'author':{'type':Sequelize[_0x4608('0x0')]},'logo':{'type':Sequelize[_0x4608('0x0')]},'state':{'type':Sequelize[_0x4608('0x0')],'unique':_0x4608('0x5')},'description':{'type':Sequelize[_0x4608('0x0')]},'title':{'type':Sequelize[_0x4608('0x0')]},'remoteUri':{'type':Sequelize[_0x4608('0x0')]},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file +var _0x27c5=['STRING','unique_name_and_version','INTEGER','BOOLEAN','state','sequelize','exports'];(function(_0x5c2293,_0x4e18a9){var _0x9712d8=function(_0x2df28e){while(--_0x2df28e){_0x5c2293['push'](_0x5c2293['shift']());}};_0x9712d8(++_0x4e18a9);}(_0x27c5,0x1cc));var _0x527c=function(_0x2cc437,_0x1b4c3f){_0x2cc437=_0x2cc437-0x0;var _0x2e163a=_0x27c5[_0x2cc437];return _0x2e163a;};'use strict';var Sequelize=require(_0x527c('0x0'));module[_0x527c('0x1')]={'name':{'type':Sequelize[_0x527c('0x2')],'allowNull':![],'unique':_0x527c('0x3')},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x527c('0x3')},'main':{'type':Sequelize[_0x527c('0x2')],'defaultValue':'app.js'},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize[_0x527c('0x2')]},'type':{'type':Sequelize[_0x527c('0x2')]},'size':{'type':Sequelize[_0x527c('0x4')]},'active':{'type':Sequelize[_0x527c('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0x527c('0x2')]},'logo':{'type':Sequelize[_0x527c('0x2')]},'state':{'type':Sequelize[_0x527c('0x2')],'unique':_0x527c('0x6')},'description':{'type':Sequelize[_0x527c('0x2')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x527c('0x2')]},'link':{'type':Sequelize[_0x527c('0x2')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 7ce3c03..99beac7 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 _0xb05b=['pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','params','keys','find','create','body','destroy','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','update','then','stack','send','index','map','Integration','rawAttributes','key','name','filters','intersection','model','attributes','fields','query','length','hasOwnProperty','nolimit','order','where'];(function(_0x295314,_0x17b250){var _0x584b0c=function(_0x51cc84){while(--_0x51cc84){_0x295314['push'](_0x295314['shift']());}};_0x584b0c(++_0x17b250);}(_0xb05b,0x1c0));var _0xbb05=function(_0x46e3ff,_0x50ca39){_0x46e3ff=_0x46e3ff-0x0;var _0x4bf847=_0xb05b[_0x46e3ff];return _0x4bf847;};'use strict';var pdf=require(_0xbb05('0x0'));var emlformat=require(_0xbb05('0x1'));var rimraf=require(_0xbb05('0x2'));var zipdir=require(_0xbb05('0x3'));var jsonpatch=require(_0xbb05('0x4'));var rp=require(_0xbb05('0x5'));var moment=require(_0xbb05('0x6'));var BPromise=require(_0xbb05('0x7'));var Mustache=require(_0xbb05('0x8'));var util=require('util');var path=require('path');var sox=require(_0xbb05('0x9'));var csv=require(_0xbb05('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xbb05('0xb'));var squel=require(_0xbb05('0xc'));var crypto=require(_0xbb05('0xd'));var jsforce=require(_0xbb05('0xe'));var deskjs=require(_0xbb05('0xf'));var toCsv=require(_0xbb05('0xa'));var querystring=require(_0xbb05('0x10'));var Papa=require(_0xbb05('0x11'));var Redis=require('ioredis');var authService=require(_0xbb05('0x12'));var qs=require(_0xbb05('0x13'));var as=require(_0xbb05('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbb05('0x15'))(_0xbb05('0x16'));var utils=require('../../config/utils');var config=require(_0xbb05('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x22b7b8,_0x4ae1ab){_0x4ae1ab=_0x4ae1ab||0xcc;return function(_0x166509){if(_0x166509){return _0x22b7b8[_0xbb05('0x18')](_0x4ae1ab);}return _0x22b7b8['status'](_0x4ae1ab)[_0xbb05('0x19')]();};}function respondWithResult(_0x1a8b98,_0x29c0da){_0x29c0da=_0x29c0da||0xc8;return function(_0x5cab0a){if(_0x5cab0a){return _0x1a8b98[_0xbb05('0x1a')](_0x29c0da)[_0xbb05('0x1b')](_0x5cab0a);}};}function respondWithFilteredResult(_0x3b9215,_0x53acab){return function(_0x493aa8){if(_0x493aa8){var _0x3357b5=_0x493aa8[_0xbb05('0x1c')],_0x34e161=_0x53acab[_0xbb05('0x1d')],_0xe6f640=_0x53acab[_0xbb05('0x1d')]+_0x53acab[_0xbb05('0x1e')],_0x5779fd;if(_0xe6f640>=_0x3357b5){_0xe6f640=_0x3357b5;_0x5779fd=0xc8;}else{_0x5779fd=0xce;}_0x3b9215['status'](_0x5779fd);return _0x3b9215[_0xbb05('0x1f')](_0xbb05('0x20'),_0x34e161+'-'+_0xe6f640+'/'+_0x3357b5)[_0xbb05('0x1b')](_0x493aa8);}return null;};}function patchUpdates(_0x2c7962){return function(_0x1a83c4){try{jsonpatch[_0xbb05('0x21')](_0x1a83c4,_0x2c7962,!![]);}catch(_0x56e5cc){return BPromise[_0xbb05('0x22')](_0x56e5cc);}return _0x1a83c4['save']();};}function saveUpdates(_0x5cc9b0,_0xbc791b){return function(_0x7b3f4f){if(_0x7b3f4f){return _0x7b3f4f[_0xbb05('0x23')](_0x5cc9b0)['then'](function(_0x55c2b5){return _0x55c2b5;});}return null;};}function removeEntity(_0x22ce6a,_0x270738){return function(_0x47d22c){if(_0x47d22c){return _0x47d22c['destroy']()[_0xbb05('0x24')](function(){_0x22ce6a[_0xbb05('0x1a')](0xcc)[_0xbb05('0x19')]();});}};}function handleEntityNotFound(_0x19e42a,_0x1c163d){return function(_0x505b9a){if(!_0x505b9a){_0x19e42a[_0xbb05('0x18')](0x194);}return _0x505b9a;};}function handleError(_0x163191,_0x160818){_0x160818=_0x160818||0x1f4;return function(_0x302ea2){logger['error'](_0x302ea2[_0xbb05('0x25')]);if(_0x302ea2['name']){delete _0x302ea2['name'];}_0x163191[_0xbb05('0x1a')](_0x160818)[_0xbb05('0x26')](_0x302ea2);};}exports[_0xbb05('0x27')]=function(_0x4cdd60,_0x21a3c0){var _0x197ea4={},_0x55373c={},_0x57e83a={'count':0x0,'rows':[]};var _0x152107=_[_0xbb05('0x28')](db[_0xbb05('0x29')][_0xbb05('0x2a')],function(_0x8ced07){return{'name':_0x8ced07['fieldName'],'type':_0x8ced07['type'][_0xbb05('0x2b')]};});_0x55373c['model']=_[_0xbb05('0x28')](_0x152107,_0xbb05('0x2c'));_0x55373c['query']=_['keys'](_0x4cdd60['query']);_0x55373c[_0xbb05('0x2d')]=_[_0xbb05('0x2e')](_0x55373c[_0xbb05('0x2f')],_0x55373c['query']);_0x197ea4[_0xbb05('0x30')]=_[_0xbb05('0x2e')](_0x55373c['model'],qs[_0xbb05('0x31')](_0x4cdd60[_0xbb05('0x32')][_0xbb05('0x31')]));_0x197ea4['attributes']=_0x197ea4['attributes'][_0xbb05('0x33')]?_0x197ea4[_0xbb05('0x30')]:_0x55373c[_0xbb05('0x2f')];if(!_0x4cdd60[_0xbb05('0x32')][_0xbb05('0x34')](_0xbb05('0x35'))){_0x197ea4['limit']=qs['limit'](_0x4cdd60['query'][_0xbb05('0x1e')]);_0x197ea4[_0xbb05('0x1d')]=qs[_0xbb05('0x1d')](_0x4cdd60[_0xbb05('0x32')][_0xbb05('0x1d')]);}_0x197ea4[_0xbb05('0x36')]=qs['sort'](_0x4cdd60[_0xbb05('0x32')]['sort']);_0x197ea4[_0xbb05('0x37')]=qs[_0xbb05('0x2d')](_[_0xbb05('0x38')](_0x4cdd60[_0xbb05('0x32')],_0x55373c[_0xbb05('0x2d')]));if(_0x4cdd60['query'][_0xbb05('0x39')]){_0x197ea4[_0xbb05('0x37')]=_[_0xbb05('0x3a')](_0x197ea4[_0xbb05('0x37')],{'$or':_['map'](_0x152107,function(_0x1edbd8){if(_0x1edbd8[_0xbb05('0x3b')]!==_0xbb05('0x3c')){var _0x39593d={};_0x39593d[_0x1edbd8[_0xbb05('0x2c')]]={'$like':'%'+_0x4cdd60[_0xbb05('0x32')][_0xbb05('0x39')]+'%'};return _0x39593d;}})});}_0x197ea4=_['merge']({},_0x197ea4,_0x4cdd60[_0xbb05('0x3d')]);var _0x25157b={'where':_0x197ea4[_0xbb05('0x37')]};return db[_0xbb05('0x29')]['count'](_0x25157b)[_0xbb05('0x24')](function(_0x499806){_0x57e83a[_0xbb05('0x1c')]=_0x499806;if(_0x4cdd60[_0xbb05('0x32')][_0xbb05('0x3e')]){_0x197ea4[_0xbb05('0x3f')]=[{'all':!![]}];}return db[_0xbb05('0x29')]['findAll'](_0x197ea4);})['then'](function(_0x41d024){_0x57e83a[_0xbb05('0x40')]=_0x41d024;return _0x57e83a;})[_0xbb05('0x24')](respondWithFilteredResult(_0x21a3c0,_0x197ea4))[_0xbb05('0x41')](handleError(_0x21a3c0,null));};exports['show']=function(_0x32f3b5,_0x174ed9){var _0x2bebc5={'raw':![],'where':{'id':_0x32f3b5[_0xbb05('0x42')]['id']}},_0x1d3fd1={};_0x1d3fd1[_0xbb05('0x2f')]=_[_0xbb05('0x43')](db[_0xbb05('0x29')][_0xbb05('0x2a')]);_0x1d3fd1[_0xbb05('0x32')]=_[_0xbb05('0x43')](_0x32f3b5[_0xbb05('0x32')]);_0x1d3fd1[_0xbb05('0x2d')]=_[_0xbb05('0x2e')](_0x1d3fd1['model'],_0x1d3fd1[_0xbb05('0x32')]);_0x2bebc5[_0xbb05('0x30')]=_['intersection'](_0x1d3fd1[_0xbb05('0x2f')],qs[_0xbb05('0x31')](_0x32f3b5[_0xbb05('0x32')]['fields']));_0x2bebc5[_0xbb05('0x30')]=_0x2bebc5[_0xbb05('0x30')][_0xbb05('0x33')]?_0x2bebc5[_0xbb05('0x30')]:_0x1d3fd1['model'];if(_0x32f3b5[_0xbb05('0x32')][_0xbb05('0x3e')]){_0x2bebc5['include']=[{'all':!![]}];}_0x2bebc5=_[_0xbb05('0x3a')]({},_0x2bebc5,_0x32f3b5[_0xbb05('0x3d')]);return db[_0xbb05('0x29')][_0xbb05('0x44')](_0x2bebc5)[_0xbb05('0x24')](handleEntityNotFound(_0x174ed9,null))[_0xbb05('0x24')](respondWithResult(_0x174ed9,null))[_0xbb05('0x41')](handleError(_0x174ed9,null));};exports[_0xbb05('0x45')]=function(_0x311508,_0x56e85d){return db[_0xbb05('0x29')][_0xbb05('0x45')](_0x311508['body'],{})[_0xbb05('0x24')](respondWithResult(_0x56e85d,0xc9))['catch'](handleError(_0x56e85d,null));};exports[_0xbb05('0x23')]=function(_0x1a7937,_0x143dce){if(_0x1a7937[_0xbb05('0x46')]['id']){delete _0x1a7937['body']['id'];}return db['Integration'][_0xbb05('0x44')]({'where':{'id':_0x1a7937[_0xbb05('0x42')]['id']}})[_0xbb05('0x24')](handleEntityNotFound(_0x143dce,null))[_0xbb05('0x24')](saveUpdates(_0x1a7937['body'],null))[_0xbb05('0x24')](respondWithResult(_0x143dce,null))[_0xbb05('0x41')](handleError(_0x143dce,null));};exports[_0xbb05('0x47')]=function(_0x489950,_0x433d39){return db[_0xbb05('0x29')]['find']({'where':{'id':_0x489950['params']['id']}})['then'](handleEntityNotFound(_0x433d39,null))[_0xbb05('0x24')](removeEntity(_0x433d39,null))[_0xbb05('0x41')](handleError(_0x433d39,null));}; \ No newline at end of file +var _0xb1f6=['papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','count','offset','limit','set','json','apply','reject','save','update','then','destroy','sendStatus','name','index','map','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','Integration','includeAll','include','findAll','catch','params','keys','rawAttributes','create','body','find','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'];(function(_0x119b5f,_0x200f75){var _0xad9b2a=function(_0x2882e7){while(--_0x2882e7){_0x119b5f['push'](_0x119b5f['shift']());}};_0xad9b2a(++_0x200f75);}(_0xb1f6,0x156));var _0x6b1f=function(_0x42b126,_0x3c93b6){_0x42b126=_0x42b126-0x0;var _0x298953=_0xb1f6[_0x42b126];return _0x298953;};'use strict';var pdf=require(_0x6b1f('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x6b1f('0x1'));var zipdir=require(_0x6b1f('0x2'));var jsonpatch=require(_0x6b1f('0x3'));var rp=require(_0x6b1f('0x4'));var moment=require(_0x6b1f('0x5'));var BPromise=require(_0x6b1f('0x6'));var Mustache=require(_0x6b1f('0x7'));var util=require(_0x6b1f('0x8'));var path=require(_0x6b1f('0x9'));var sox=require(_0x6b1f('0xa'));var csv=require(_0x6b1f('0xb'));var ejs=require(_0x6b1f('0xc'));var fs=require('fs');var _=require(_0x6b1f('0xd'));var squel=require(_0x6b1f('0xe'));var crypto=require(_0x6b1f('0xf'));var jsforce=require(_0x6b1f('0x10'));var deskjs=require(_0x6b1f('0x11'));var toCsv=require(_0x6b1f('0xb'));var querystring=require('querystring');var Papa=require(_0x6b1f('0x12'));var Redis=require('ioredis');var authService=require(_0x6b1f('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x6b1f('0x14'));var hardwareService=require(_0x6b1f('0x15'));var logger=require(_0x6b1f('0x16'))(_0x6b1f('0x17'));var utils=require(_0x6b1f('0x18'));var config=require('../../config/environment');var db=require(_0x6b1f('0x19'))['db'];function respondWithStatusCode(_0x6b8bb6,_0x3dbf35){_0x3dbf35=_0x3dbf35||0xcc;return function(_0x89b771){if(_0x89b771){return _0x6b8bb6['sendStatus'](_0x3dbf35);}return _0x6b8bb6[_0x6b1f('0x1a')](_0x3dbf35)[_0x6b1f('0x1b')]();};}function respondWithResult(_0xea5258,_0x30b600){_0x30b600=_0x30b600||0xc8;return function(_0x664bef){if(_0x664bef){return _0xea5258[_0x6b1f('0x1a')](_0x30b600)['json'](_0x664bef);}};}function respondWithFilteredResult(_0x368fd0,_0x369b87){return function(_0xfbe3e5){if(_0xfbe3e5){var _0x1c16b7=_0xfbe3e5[_0x6b1f('0x1c')],_0x4bf286=_0x369b87['offset'],_0x46779d=_0x369b87[_0x6b1f('0x1d')]+_0x369b87[_0x6b1f('0x1e')],_0x157e2c;if(_0x46779d>=_0x1c16b7){_0x46779d=_0x1c16b7;_0x157e2c=0xc8;}else{_0x157e2c=0xce;}_0x368fd0[_0x6b1f('0x1a')](_0x157e2c);return _0x368fd0[_0x6b1f('0x1f')]('Content-Range',_0x4bf286+'-'+_0x46779d+'/'+_0x1c16b7)[_0x6b1f('0x20')](_0xfbe3e5);}return null;};}function patchUpdates(_0x19f42e){return function(_0x2d61cf){try{jsonpatch[_0x6b1f('0x21')](_0x2d61cf,_0x19f42e,!![]);}catch(_0x537feb){return BPromise[_0x6b1f('0x22')](_0x537feb);}return _0x2d61cf[_0x6b1f('0x23')]();};}function saveUpdates(_0x1a9be3,_0x2f69bb){return function(_0x45cace){if(_0x45cace){return _0x45cace[_0x6b1f('0x24')](_0x1a9be3)[_0x6b1f('0x25')](function(_0x2b8800){return _0x2b8800;});}return null;};}function removeEntity(_0x4e3c0a,_0x2fd030){return function(_0x5e78b9){if(_0x5e78b9){return _0x5e78b9[_0x6b1f('0x26')]()[_0x6b1f('0x25')](function(){_0x4e3c0a[_0x6b1f('0x1a')](0xcc)[_0x6b1f('0x1b')]();});}};}function handleEntityNotFound(_0x216153,_0x1eaaad){return function(_0x3285bb){if(!_0x3285bb){_0x216153[_0x6b1f('0x27')](0x194);}return _0x3285bb;};}function handleError(_0x5cb8c2,_0x4b7eff){_0x4b7eff=_0x4b7eff||0x1f4;return function(_0x44903a){logger['error'](_0x44903a['stack']);if(_0x44903a[_0x6b1f('0x28')]){delete _0x44903a[_0x6b1f('0x28')];}_0x5cb8c2[_0x6b1f('0x1a')](_0x4b7eff)['send'](_0x44903a);};}exports[_0x6b1f('0x29')]=function(_0x225620,_0x3985d8){var _0x2eb7f4={},_0x398477={},_0x1f1f8c={'count':0x0,'rows':[]};var _0x4d99fe=_[_0x6b1f('0x2a')](db['Integration']['rawAttributes'],function(_0x315a9c){return{'name':_0x315a9c[_0x6b1f('0x2b')],'type':_0x315a9c[_0x6b1f('0x2c')][_0x6b1f('0x2d')]};});_0x398477[_0x6b1f('0x2e')]=_[_0x6b1f('0x2a')](_0x4d99fe,'name');_0x398477[_0x6b1f('0x2f')]=_['keys'](_0x225620[_0x6b1f('0x2f')]);_0x398477[_0x6b1f('0x30')]=_[_0x6b1f('0x31')](_0x398477['model'],_0x398477['query']);_0x2eb7f4[_0x6b1f('0x32')]=_[_0x6b1f('0x31')](_0x398477[_0x6b1f('0x2e')],qs[_0x6b1f('0x33')](_0x225620[_0x6b1f('0x2f')][_0x6b1f('0x33')]));_0x2eb7f4[_0x6b1f('0x32')]=_0x2eb7f4[_0x6b1f('0x32')][_0x6b1f('0x34')]?_0x2eb7f4[_0x6b1f('0x32')]:_0x398477['model'];if(!_0x225620[_0x6b1f('0x2f')]['hasOwnProperty'](_0x6b1f('0x35'))){_0x2eb7f4[_0x6b1f('0x1e')]=qs[_0x6b1f('0x1e')](_0x225620['query'][_0x6b1f('0x1e')]);_0x2eb7f4[_0x6b1f('0x1d')]=qs['offset'](_0x225620[_0x6b1f('0x2f')][_0x6b1f('0x1d')]);}_0x2eb7f4[_0x6b1f('0x36')]=qs[_0x6b1f('0x37')](_0x225620['query'][_0x6b1f('0x37')]);_0x2eb7f4[_0x6b1f('0x38')]=qs[_0x6b1f('0x30')](_[_0x6b1f('0x39')](_0x225620[_0x6b1f('0x2f')],_0x398477['filters']));if(_0x225620[_0x6b1f('0x2f')][_0x6b1f('0x3a')]){_0x2eb7f4['where']=_[_0x6b1f('0x3b')](_0x2eb7f4[_0x6b1f('0x38')],{'$or':_[_0x6b1f('0x2a')](_0x4d99fe,function(_0x235f05){if(_0x235f05[_0x6b1f('0x2c')]!=='VIRTUAL'){var _0x20d643={};_0x20d643[_0x235f05[_0x6b1f('0x28')]]={'$like':'%'+_0x225620['query'][_0x6b1f('0x3a')]+'%'};return _0x20d643;}})});}_0x2eb7f4=_[_0x6b1f('0x3b')]({},_0x2eb7f4,_0x225620[_0x6b1f('0x3c')]);var _0x1928e2={'where':_0x2eb7f4[_0x6b1f('0x38')]};return db[_0x6b1f('0x3d')][_0x6b1f('0x1c')](_0x1928e2)[_0x6b1f('0x25')](function(_0x225160){_0x1f1f8c[_0x6b1f('0x1c')]=_0x225160;if(_0x225620[_0x6b1f('0x2f')][_0x6b1f('0x3e')]){_0x2eb7f4[_0x6b1f('0x3f')]=[{'all':!![]}];}return db[_0x6b1f('0x3d')][_0x6b1f('0x40')](_0x2eb7f4);})['then'](function(_0x44f334){_0x1f1f8c['rows']=_0x44f334;return _0x1f1f8c;})[_0x6b1f('0x25')](respondWithFilteredResult(_0x3985d8,_0x2eb7f4))[_0x6b1f('0x41')](handleError(_0x3985d8,null));};exports['show']=function(_0x158065,_0x137168){var _0x2017ee={'raw':![],'where':{'id':_0x158065[_0x6b1f('0x42')]['id']}},_0x28dc97={};_0x28dc97[_0x6b1f('0x2e')]=_[_0x6b1f('0x43')](db['Integration'][_0x6b1f('0x44')]);_0x28dc97['query']=_[_0x6b1f('0x43')](_0x158065[_0x6b1f('0x2f')]);_0x28dc97['filters']=_[_0x6b1f('0x31')](_0x28dc97['model'],_0x28dc97['query']);_0x2017ee['attributes']=_[_0x6b1f('0x31')](_0x28dc97['model'],qs[_0x6b1f('0x33')](_0x158065[_0x6b1f('0x2f')][_0x6b1f('0x33')]));_0x2017ee['attributes']=_0x2017ee[_0x6b1f('0x32')][_0x6b1f('0x34')]?_0x2017ee[_0x6b1f('0x32')]:_0x28dc97[_0x6b1f('0x2e')];if(_0x158065[_0x6b1f('0x2f')][_0x6b1f('0x3e')]){_0x2017ee['include']=[{'all':!![]}];}_0x2017ee=_[_0x6b1f('0x3b')]({},_0x2017ee,_0x158065[_0x6b1f('0x3c')]);return db[_0x6b1f('0x3d')]['find'](_0x2017ee)[_0x6b1f('0x25')](handleEntityNotFound(_0x137168,null))[_0x6b1f('0x25')](respondWithResult(_0x137168,null))[_0x6b1f('0x41')](handleError(_0x137168,null));};exports[_0x6b1f('0x45')]=function(_0x16943a,_0x5cb8f0){return db[_0x6b1f('0x3d')][_0x6b1f('0x45')](_0x16943a['body'],{})[_0x6b1f('0x25')](respondWithResult(_0x5cb8f0,0xc9))['catch'](handleError(_0x5cb8f0,null));};exports['update']=function(_0x3b55ee,_0x44a33f){if(_0x3b55ee['body']['id']){delete _0x3b55ee[_0x6b1f('0x46')]['id'];}return db[_0x6b1f('0x3d')][_0x6b1f('0x47')]({'where':{'id':_0x3b55ee[_0x6b1f('0x42')]['id']}})[_0x6b1f('0x25')](handleEntityNotFound(_0x44a33f,null))[_0x6b1f('0x25')](saveUpdates(_0x3b55ee[_0x6b1f('0x46')],null))['then'](respondWithResult(_0x44a33f,null))[_0x6b1f('0x41')](handleError(_0x44a33f,null));};exports[_0x6b1f('0x26')]=function(_0x20bb6b,_0x59240f){return db['Integration'][_0x6b1f('0x47')]({'where':{'id':_0x20bb6b[_0x6b1f('0x42')]['id']}})['then'](handleEntityNotFound(_0x59240f,null))[_0x6b1f('0x25')](removeEntity(_0x59240f,null))[_0x6b1f('0x41')](handleError(_0x59240f,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 1e9f44e..6d289d8 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 _0x942e=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./integration.attributes','exports','define','Integration','lodash','../../config/logger'];(function(_0x2c08db,_0x4b5917){var _0x28680d=function(_0x4b2cc4){while(--_0x4b2cc4){_0x2c08db['push'](_0x2c08db['shift']());}};_0x28680d(++_0x4b5917);}(_0x942e,0x1c5));var _0xe942=function(_0x95cee,_0x346b5c){_0x95cee=_0x95cee-0x0;var _0x462bdf=_0x942e[_0x95cee];return _0x462bdf;};'use strict';var _=require(_0xe942('0x0'));var util=require('util');var logger=require(_0xe942('0x1'))(_0xe942('0x2'));var moment=require(_0xe942('0x3'));var BPromise=require(_0xe942('0x4'));var rp=require(_0xe942('0x5'));var fs=require('fs');var path=require(_0xe942('0x6'));var rimraf=require(_0xe942('0x7'));var config=require(_0xe942('0x8'));var attributes=require(_0xe942('0x9'));module[_0xe942('0xa')]=function(_0x1471e5,_0x3b0dd0){return _0x1471e5[_0xe942('0xb')](_0xe942('0xc'),attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb01f=['../../config/environment','define','Integration','integrations','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xb01f,0xd5));var _0xfb01=function(_0x138bda,_0x2eceee){_0x138bda=_0x138bda-0x0;var _0x2e3652=_0xb01f[_0x138bda];return _0x2e3652;};'use strict';var _=require(_0xfb01('0x0'));var util=require(_0xfb01('0x1'));var logger=require(_0xfb01('0x2'))(_0xfb01('0x3'));var moment=require(_0xfb01('0x4'));var BPromise=require(_0xfb01('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfb01('0x6'));var rimraf=require('rimraf');var config=require(_0xfb01('0x7'));var attributes=require('./integration.attributes');module['exports']=function(_0x32fbc6,_0x3ef5aa){return _0x32fbc6[_0xfb01('0x8')](_0xfb01('0x9'),attributes,{'tableName':_0xfb01('0xa'),'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 86895f8..862e5f1 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 _0xfafb=['client','request','then','Integration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x32c647,_0x18f706){var _0x112645=function(_0x142a54){while(--_0x142a54){_0x32c647['push'](_0x32c647['shift']());}};_0x112645(++_0x18f706);}(_0xfafb,0xf2));var _0xbfaf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfafb[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xbfaf('0x0'));var util=require('util');var moment=require(_0xbfaf('0x1'));var BPromise=require(_0xbfaf('0x2'));var rs=require(_0xbfaf('0x3'));var fs=require('fs');var Redis=require(_0xbfaf('0x4'));var db=require(_0xbfaf('0x5'))['db'];var utils=require(_0xbfaf('0x6'));var logger=require(_0xbfaf('0x7'))(_0xbfaf('0x8'));var config=require(_0xbfaf('0x9'));var jayson=require(_0xbfaf('0xa'));var client=jayson[_0xbfaf('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x6bf3e0,_0x4d1b50,_0x26049c){return new BPromise(function(_0x2b07ca,_0x367886){return client[_0xbfaf('0xc')](_0x6bf3e0,_0x26049c)[_0xbfaf('0xd')](function(_0x193782){logger['info'](_0xbfaf('0xe'),_0x4d1b50,'request\x20sent');logger[_0xbfaf('0xf')]('Integration,\x20%s,\x20%s,\x20%s',_0x4d1b50,_0xbfaf('0x10'),JSON[_0xbfaf('0x11')](_0x193782));if(_0x193782[_0xbfaf('0x12')]){if(_0x193782[_0xbfaf('0x12')][_0xbfaf('0x13')]===0x1f4){logger[_0xbfaf('0x12')](_0xbfaf('0xe'),_0x4d1b50,_0x193782[_0xbfaf('0x12')]['message']);return _0x367886(_0x193782[_0xbfaf('0x12')][_0xbfaf('0x14')]);}logger[_0xbfaf('0x12')](_0xbfaf('0xe'),_0x4d1b50,_0x193782[_0xbfaf('0x12')][_0xbfaf('0x14')]);return _0x2b07ca(_0x193782[_0xbfaf('0x12')][_0xbfaf('0x14')]);}else{logger[_0xbfaf('0x15')](_0xbfaf('0xe'),_0x4d1b50,_0xbfaf('0x10'));_0x2b07ca(_0x193782[_0xbfaf('0x16')]['message']);}})['catch'](function(_0x43e2be){logger['error']('Integration,\x20%s,\x20%s',_0x4d1b50,_0x43e2be);_0x367886(_0x43e2be);});});} \ No newline at end of file +var _0xb56f=['request','then','info','Integration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x1c8c28,_0x3ee093){var _0x1f59b4=function(_0x29bcc0){while(--_0x29bcc0){_0x1c8c28['push'](_0x1c8c28['shift']());}};_0x1f59b4(++_0x3ee093);}(_0xb56f,0x113));var _0xfb56=function(_0x1c53b7,_0x2da9ae){_0x1c53b7=_0x1c53b7-0x0;var _0x45a20a=_0xb56f[_0x1c53b7];return _0x45a20a;};'use strict';var _=require(_0xfb56('0x0'));var util=require(_0xfb56('0x1'));var moment=require(_0xfb56('0x2'));var BPromise=require('bluebird');var rs=require(_0xfb56('0x3'));var fs=require('fs');var Redis=require(_0xfb56('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xfb56('0x5'));var logger=require(_0xfb56('0x6'))('rpc');var config=require(_0xfb56('0x7'));var jayson=require(_0xfb56('0x8'));var client=jayson[_0xfb56('0x9')][_0xfb56('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x226095,_0x3ca6e9,_0x47d913){return new BPromise(function(_0x50685b,_0xbcbe76){return client[_0xfb56('0xb')](_0x226095,_0x47d913)[_0xfb56('0xc')](function(_0x18a927){logger[_0xfb56('0xd')](_0xfb56('0xe'),_0x3ca6e9,_0xfb56('0xf'));logger['debug']('Integration,\x20%s,\x20%s,\x20%s',_0x3ca6e9,'request\x20sent',JSON[_0xfb56('0x10')](_0x18a927));if(_0x18a927['error']){if(_0x18a927[_0xfb56('0x11')][_0xfb56('0x12')]===0x1f4){logger[_0xfb56('0x11')](_0xfb56('0xe'),_0x3ca6e9,_0x18a927['error'][_0xfb56('0x13')]);return _0xbcbe76(_0x18a927[_0xfb56('0x11')][_0xfb56('0x13')]);}logger['error'](_0xfb56('0xe'),_0x3ca6e9,_0x18a927['error']['message']);return _0x50685b(_0x18a927[_0xfb56('0x11')][_0xfb56('0x13')]);}else{logger[_0xfb56('0xd')](_0xfb56('0xe'),_0x3ca6e9,_0xfb56('0xf'));_0x50685b(_0x18a927[_0xfb56('0x14')][_0xfb56('0x13')]);}})[_0xfb56('0x15')](function(_0x14c7b7){logger[_0xfb56('0x11')](_0xfb56('0xe'),_0x3ca6e9,_0x14c7b7);_0xbcbe76(_0x14c7b7);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 376debb..58d1d07 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 _0xacd3=['connect-timeout','express','Router','../../components/auth/service','../../config/environment','./integrationReport.controller','get','isAuthenticated','index','/describe','describe','show','put','/:id','update','delete','destroy','multer','util','path'];(function(_0x1b1be2,_0x5d8714){var _0x42d2b2=function(_0x2aeb55){while(--_0x2aeb55){_0x1b1be2['push'](_0x1b1be2['shift']());}};_0x42d2b2(++_0x5d8714);}(_0xacd3,0x115));var _0x3acd=function(_0x36b931,_0x182a48){_0x36b931=_0x36b931-0x0;var _0xea5a78=_0xacd3[_0x36b931];return _0xea5a78;};'use strict';var multer=require(_0x3acd('0x0'));var util=require(_0x3acd('0x1'));var path=require(_0x3acd('0x2'));var timeout=require(_0x3acd('0x3'));var express=require(_0x3acd('0x4'));var router=express[_0x3acd('0x5')]();var auth=require(_0x3acd('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x3acd('0x7'));var controller=require(_0x3acd('0x8'));router[_0x3acd('0x9')]('/',auth[_0x3acd('0xa')](),controller[_0x3acd('0xb')]);router['get'](_0x3acd('0xc'),auth[_0x3acd('0xa')](),controller[_0x3acd('0xd')]);router[_0x3acd('0x9')]('/:id',auth[_0x3acd('0xa')](),controller[_0x3acd('0xe')]);router['post']('/',auth[_0x3acd('0xa')](),controller['create']);router[_0x3acd('0xf')](_0x3acd('0x10'),auth[_0x3acd('0xa')](),controller[_0x3acd('0x11')]);router[_0x3acd('0x12')](_0x3acd('0x10'),auth[_0x3acd('0xa')](),controller[_0x3acd('0x13')]);module['exports']=router; \ No newline at end of file +var _0x1c32=['../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','put','update','delete','destroy','exports','multer','util','path','express','Router'];(function(_0x511b76,_0x4727fa){var _0x5424ff=function(_0x24b7c0){while(--_0x24b7c0){_0x511b76['push'](_0x511b76['shift']());}};_0x5424ff(++_0x4727fa);}(_0x1c32,0xb8));var _0x21c3=function(_0xe6e78c,_0x582369){_0xe6e78c=_0xe6e78c-0x0;var _0x2a09c8=_0x1c32[_0xe6e78c];return _0x2a09c8;};'use strict';var multer=require(_0x21c3('0x0'));var util=require(_0x21c3('0x1'));var path=require(_0x21c3('0x2'));var timeout=require('connect-timeout');var express=require(_0x21c3('0x3'));var router=express[_0x21c3('0x4')]();var auth=require(_0x21c3('0x5'));var interaction=require(_0x21c3('0x6'));var config=require(_0x21c3('0x7'));var controller=require(_0x21c3('0x8'));router[_0x21c3('0x9')]('/',auth[_0x21c3('0xa')](),controller[_0x21c3('0xb')]);router[_0x21c3('0x9')](_0x21c3('0xc'),auth[_0x21c3('0xa')](),controller[_0x21c3('0xd')]);router[_0x21c3('0x9')](_0x21c3('0xe'),auth[_0x21c3('0xa')](),controller['show']);router[_0x21c3('0xf')]('/',auth[_0x21c3('0xa')](),controller['create']);router[_0x21c3('0x10')](_0x21c3('0xe'),auth['isAuthenticated'](),controller[_0x21c3('0x11')]);router[_0x21c3('0x12')](_0x21c3('0xe'),auth[_0x21c3('0xa')](),controller[_0x21c3('0x13')]);module[_0x21c3('0x14')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index eea025d..9202228 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 _0xe9ab=['INTEGER','DATE','BOOLEAN','TEXT','SENDING','RECEIVED','FAILED','sequelize','exports','STRING'];(function(_0x3414fc,_0xdce392){var _0x2b6b17=function(_0x2a65bc){while(--_0x2a65bc){_0x3414fc['push'](_0x3414fc['shift']());}};_0x2b6b17(++_0xdce392);}(_0xe9ab,0xcf));var _0xbe9a=function(_0x20e6c7,_0x49e36a){_0x20e6c7=_0x20e6c7-0x0;var _0x4a1193=_0xe9ab[_0x20e6c7];return _0x4a1193;};'use strict';var Sequelize=require(_0xbe9a('0x0'));module[_0xbe9a('0x1')]={'integration':{'type':Sequelize[_0xbe9a('0x2')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize[_0xbe9a('0x2')]},'ticketId':{'type':Sequelize[_0xbe9a('0x2')]},'integrationId':{'type':Sequelize[_0xbe9a('0x3')]},'contacts':{'type':Sequelize[_0xbe9a('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xbe9a('0x2')]},'calleridname':{'type':Sequelize[_0xbe9a('0x2')]},'queue':{'type':Sequelize[_0xbe9a('0x2')]},'interface':{'type':Sequelize[_0xbe9a('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0xbe9a('0x4')]},'agentconnectAt':{'type':Sequelize[_0xbe9a('0x4')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0xbe9a('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize[_0xbe9a('0x3')]},'agentacw':{'type':Sequelize[_0xbe9a('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xbe9a('0x3')]},'reason':{'type':Sequelize[_0xbe9a('0x2')]},'agentringnoanswer':{'type':Sequelize[_0xbe9a('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xbe9a('0x4')]},'agentdump':{'type':Sequelize[_0xbe9a('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xbe9a('0x4')]},'lastevent':{'type':Sequelize[_0xbe9a('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0xbe9a('0x3')]},'channelstatedesc':{'type':Sequelize[_0xbe9a('0x2')]},'connectedlinenum':{'type':Sequelize[_0xbe9a('0x2')]},'connectedlinename':{'type':Sequelize[_0xbe9a('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xbe9a('0x2')]},'context':{'type':Sequelize[_0xbe9a('0x2')]},'exten':{'type':Sequelize[_0xbe9a('0x2')]},'priority':{'type':Sequelize[_0xbe9a('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xbe9a('0x2')]},'destcalleridnum':{'type':Sequelize[_0xbe9a('0x2')]},'destcalleridname':{'type':Sequelize[_0xbe9a('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xbe9a('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xbe9a('0x2')]},'destlanguage':{'type':Sequelize[_0xbe9a('0x2')]},'destaccountcode':{'type':Sequelize[_0xbe9a('0x2')]},'destcontext':{'type':Sequelize[_0xbe9a('0x2')]},'destexten':{'type':Sequelize[_0xbe9a('0x2')]},'destpriority':{'type':Sequelize[_0xbe9a('0x2')]},'destuniqueid':{'type':Sequelize[_0xbe9a('0x2')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize[_0xbe9a('0x2')]},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0xbe9a('0x2')]},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize[_0xbe9a('0x6')]},'html':{'type':Sequelize[_0xbe9a('0x6')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize['ENUM']('SENT',_0xbe9a('0x7'),_0xbe9a('0x8'),_0xbe9a('0x9'))},'url':{'type':Sequelize[_0xbe9a('0x2')]},'app':{'type':Sequelize[_0xbe9a('0x2')]},'appdata':{'type':Sequelize[_0xbe9a('0x2')]},'projectId':{'type':Sequelize[_0xbe9a('0x3')]}}; \ No newline at end of file +var _0xe957=['INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','SENDING','RECEIVED','sequelize','STRING'];(function(_0x2beb55,_0x5d11bc){var _0x2c0501=function(_0x55364e){while(--_0x55364e){_0x2beb55['push'](_0x2beb55['shift']());}};_0x2c0501(++_0x5d11bc);}(_0xe957,0x1a2));var _0x7e95=function(_0xed272,_0x1dc3dc){_0xed272=_0xed272-0x0;var _0x67edf8=_0xe957[_0xed272];return _0x67edf8;};'use strict';var Sequelize=require(_0x7e95('0x0'));module['exports']={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize[_0x7e95('0x1')]},'exitStatus':{'type':Sequelize[_0x7e95('0x1')]},'ticketId':{'type':Sequelize[_0x7e95('0x1')]},'integrationId':{'type':Sequelize[_0x7e95('0x2')]},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x7e95('0x1')]},'calleridnum':{'type':Sequelize[_0x7e95('0x1')]},'calleridname':{'type':Sequelize[_0x7e95('0x1')]},'queue':{'type':Sequelize[_0x7e95('0x1')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x7e95('0x1')]},'agentcalledAt':{'type':Sequelize[_0x7e95('0x3')]},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x7e95('0x2')]},'agentcomplete':{'type':Sequelize[_0x7e95('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x7e95('0x3')]},'talktime':{'type':Sequelize[_0x7e95('0x2')]},'agentacw':{'type':Sequelize[_0x7e95('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x7e95('0x2')]},'reason':{'type':Sequelize[_0x7e95('0x1')]},'agentringnoanswer':{'type':Sequelize[_0x7e95('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x7e95('0x3')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x7e95('0x3')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x7e95('0x1')]},'language':{'type':Sequelize[_0x7e95('0x1')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x7e95('0x1')]},'exten':{'type':Sequelize[_0x7e95('0x1')]},'priority':{'type':Sequelize[_0x7e95('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x7e95('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x7e95('0x1')]},'destcalleridnum':{'type':Sequelize[_0x7e95('0x1')]},'destcalleridname':{'type':Sequelize[_0x7e95('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x7e95('0x1')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x7e95('0x1')]},'destcontext':{'type':Sequelize[_0x7e95('0x1')]},'destexten':{'type':Sequelize[_0x7e95('0x1')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x7e95('0x1')]},'messageId':{'type':Sequelize[_0x7e95('0x1')]},'inReplyTo':{'type':Sequelize[_0x7e95('0x1')]},'subject':{'type':Sequelize[_0x7e95('0x1')]},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x7e95('0x1')]},'cc':{'type':Sequelize[_0x7e95('0x1')]},'attachment':{'type':Sequelize[_0x7e95('0x5')]},'html':{'type':Sequelize[_0x7e95('0x5')]},'text':{'type':Sequelize[_0x7e95('0x5')]},'status':{'type':Sequelize[_0x7e95('0x6')](_0x7e95('0x7'),_0x7e95('0x8'),_0x7e95('0x9'),'FAILED')},'url':{'type':Sequelize[_0x7e95('0x1')]},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize[_0x7e95('0x1')]},'projectId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index aba6bc5..ff48ce9 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 _0x4c99=['limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','IntegrationReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','html-pdf','rimraf','moment','bluebird','util','path','to-csv','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x4c99,0x1ec));var _0x94c9=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x4c99[_0x199572];return _0x13cfa3;};'use strict';var pdf=require(_0x94c9('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x94c9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x94c9('0x2'));var BPromise=require(_0x94c9('0x3'));var Mustache=require('mustache');var util=require(_0x94c9('0x4'));var path=require(_0x94c9('0x5'));var sox=require('sox');var csv=require(_0x94c9('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x94c9('0x7'));var jsforce=require(_0x94c9('0x8'));var deskjs=require(_0x94c9('0x9'));var toCsv=require(_0x94c9('0x6'));var querystring=require(_0x94c9('0xa'));var Papa=require(_0x94c9('0xb'));var Redis=require(_0x94c9('0xc'));var authService=require(_0x94c9('0xd'));var qs=require(_0x94c9('0xe'));var as=require(_0x94c9('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x94c9('0x10'))(_0x94c9('0x11'));var utils=require(_0x94c9('0x12'));var config=require('../../config/environment');var db=require(_0x94c9('0x13'))['db'];function respondWithStatusCode(_0x10f339,_0x3a5540){_0x3a5540=_0x3a5540||0xcc;return function(_0xadd7ac){if(_0xadd7ac){return _0x10f339[_0x94c9('0x14')](_0x3a5540);}return _0x10f339[_0x94c9('0x15')](_0x3a5540)[_0x94c9('0x16')]();};}function respondWithResult(_0x132e5e,_0x495654){_0x495654=_0x495654||0xc8;return function(_0x5990e8){if(_0x5990e8){return _0x132e5e['status'](_0x495654)[_0x94c9('0x17')](_0x5990e8);}};}function respondWithFilteredResult(_0x33b735,_0x5249d3){return function(_0x210709){if(_0x210709){var _0x3abfa5=_0x210709[_0x94c9('0x18')],_0x372b66=_0x5249d3[_0x94c9('0x19')],_0x56609d=_0x5249d3[_0x94c9('0x19')]+_0x5249d3[_0x94c9('0x1a')],_0x5db248;if(_0x56609d>=_0x3abfa5){_0x56609d=_0x3abfa5;_0x5db248=0xc8;}else{_0x5db248=0xce;}_0x33b735['status'](_0x5db248);return _0x33b735[_0x94c9('0x1b')](_0x94c9('0x1c'),_0x372b66+'-'+_0x56609d+'/'+_0x3abfa5)[_0x94c9('0x17')](_0x210709);}return null;};}function patchUpdates(_0x1ae701){return function(_0x30a237){try{jsonpatch[_0x94c9('0x1d')](_0x30a237,_0x1ae701,!![]);}catch(_0x443d7d){return BPromise['reject'](_0x443d7d);}return _0x30a237[_0x94c9('0x1e')]();};}function saveUpdates(_0x26556f,_0x4d7a9b){return function(_0x35b03c){if(_0x35b03c){return _0x35b03c[_0x94c9('0x1f')](_0x26556f)[_0x94c9('0x20')](function(_0x1bb3f0){return _0x1bb3f0;});}return null;};}function removeEntity(_0x41e653,_0x2892d1){return function(_0x410f00){if(_0x410f00){return _0x410f00[_0x94c9('0x21')]()[_0x94c9('0x20')](function(){_0x41e653[_0x94c9('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f20bd,_0x50ee41){return function(_0xf5ce65){if(!_0xf5ce65){_0x2f20bd['sendStatus'](0x194);}return _0xf5ce65;};}function handleError(_0x21ffd9,_0x12b535){_0x12b535=_0x12b535||0x1f4;return function(_0x2e5398){logger[_0x94c9('0x22')](_0x2e5398[_0x94c9('0x23')]);if(_0x2e5398[_0x94c9('0x24')]){delete _0x2e5398['name'];}_0x21ffd9[_0x94c9('0x15')](_0x12b535)[_0x94c9('0x25')](_0x2e5398);};}exports[_0x94c9('0x26')]=function(_0x4f12f6,_0x2ea850){var _0x514dc1={},_0x586b40={},_0x79575e={'count':0x0,'rows':[]};var _0x254210=_[_0x94c9('0x27')](db[_0x94c9('0x28')][_0x94c9('0x29')],function(_0x5d265f){return{'name':_0x5d265f[_0x94c9('0x2a')],'type':_0x5d265f[_0x94c9('0x2b')][_0x94c9('0x2c')]};});_0x586b40['model']=_[_0x94c9('0x27')](_0x254210,_0x94c9('0x24'));_0x586b40[_0x94c9('0x2d')]=_[_0x94c9('0x2e')](_0x4f12f6['query']);_0x586b40[_0x94c9('0x2f')]=_[_0x94c9('0x30')](_0x586b40['model'],_0x586b40[_0x94c9('0x2d')]);_0x514dc1[_0x94c9('0x31')]=_[_0x94c9('0x30')](_0x586b40[_0x94c9('0x32')],qs[_0x94c9('0x33')](_0x4f12f6[_0x94c9('0x2d')][_0x94c9('0x33')]));_0x514dc1['attributes']=_0x514dc1[_0x94c9('0x31')][_0x94c9('0x34')]?_0x514dc1[_0x94c9('0x31')]:_0x586b40[_0x94c9('0x32')];if(!_0x4f12f6['query'][_0x94c9('0x35')](_0x94c9('0x36'))){_0x514dc1['limit']=qs[_0x94c9('0x1a')](_0x4f12f6[_0x94c9('0x2d')][_0x94c9('0x1a')]);_0x514dc1['offset']=qs[_0x94c9('0x19')](_0x4f12f6[_0x94c9('0x2d')]['offset']);}_0x514dc1[_0x94c9('0x37')]=qs['sort'](_0x4f12f6['query'][_0x94c9('0x38')]);_0x514dc1['where']=qs[_0x94c9('0x2f')](_[_0x94c9('0x39')](_0x4f12f6[_0x94c9('0x2d')],_0x586b40[_0x94c9('0x2f')]));if(_0x4f12f6[_0x94c9('0x2d')][_0x94c9('0x3a')]){_0x514dc1['where']=_[_0x94c9('0x3b')](_0x514dc1[_0x94c9('0x3c')],{'$or':_[_0x94c9('0x27')](_0x254210,function(_0x3491fd){if(_0x3491fd['type']!==_0x94c9('0x3d')){var _0x309b7b={};_0x309b7b[_0x3491fd[_0x94c9('0x24')]]={'$like':'%'+_0x4f12f6[_0x94c9('0x2d')]['filter']+'%'};return _0x309b7b;}})});}_0x514dc1=_[_0x94c9('0x3b')]({},_0x514dc1,_0x4f12f6[_0x94c9('0x3e')]);var _0x46c19d={'where':_0x514dc1['where']};return db[_0x94c9('0x28')][_0x94c9('0x18')](_0x46c19d)[_0x94c9('0x20')](function(_0x3c8a8a){_0x79575e[_0x94c9('0x18')]=_0x3c8a8a;if(_0x4f12f6[_0x94c9('0x2d')][_0x94c9('0x3f')]){_0x514dc1[_0x94c9('0x40')]=[{'all':!![]}];}return db[_0x94c9('0x28')][_0x94c9('0x41')](_0x514dc1);})[_0x94c9('0x20')](function(_0x3516b1){_0x79575e[_0x94c9('0x42')]=_0x3516b1;return _0x79575e;})[_0x94c9('0x20')](respondWithFilteredResult(_0x2ea850,_0x514dc1))[_0x94c9('0x43')](handleError(_0x2ea850,null));};exports[_0x94c9('0x44')]=function(_0x1117cf,_0xbe12c3){var _0x13825d={'raw':![],'where':{'id':_0x1117cf[_0x94c9('0x45')]['id']}},_0xd8f228={};_0xd8f228['model']=_[_0x94c9('0x2e')](db[_0x94c9('0x28')][_0x94c9('0x29')]);_0xd8f228['query']=_[_0x94c9('0x2e')](_0x1117cf['query']);_0xd8f228[_0x94c9('0x2f')]=_[_0x94c9('0x30')](_0xd8f228[_0x94c9('0x32')],_0xd8f228['query']);_0x13825d[_0x94c9('0x31')]=_['intersection'](_0xd8f228[_0x94c9('0x32')],qs[_0x94c9('0x33')](_0x1117cf[_0x94c9('0x2d')][_0x94c9('0x33')]));_0x13825d[_0x94c9('0x31')]=_0x13825d[_0x94c9('0x31')]['length']?_0x13825d['attributes']:_0xd8f228['model'];if(_0x1117cf[_0x94c9('0x2d')][_0x94c9('0x3f')]){_0x13825d[_0x94c9('0x40')]=[{'all':!![]}];}_0x13825d=_['merge']({},_0x13825d,_0x1117cf[_0x94c9('0x3e')]);return db['IntegrationReport'][_0x94c9('0x46')](_0x13825d)[_0x94c9('0x20')](handleEntityNotFound(_0xbe12c3,null))[_0x94c9('0x20')](respondWithResult(_0xbe12c3,null))[_0x94c9('0x43')](handleError(_0xbe12c3,null));};exports[_0x94c9('0x47')]=function(_0x2cfeb7,_0x3b878e){return db['IntegrationReport'][_0x94c9('0x47')](_0x2cfeb7['body'],{})[_0x94c9('0x20')](respondWithResult(_0x3b878e,0xc9))[_0x94c9('0x43')](handleError(_0x3b878e,null));};exports[_0x94c9('0x1f')]=function(_0x9db0af,_0x3ac806){if(_0x9db0af[_0x94c9('0x48')]['id']){delete _0x9db0af[_0x94c9('0x48')]['id'];}return db[_0x94c9('0x28')]['find']({'where':{'id':_0x9db0af[_0x94c9('0x45')]['id']}})[_0x94c9('0x20')](handleEntityNotFound(_0x3ac806,null))[_0x94c9('0x20')](saveUpdates(_0x9db0af[_0x94c9('0x48')],null))[_0x94c9('0x20')](respondWithResult(_0x3ac806,null))['catch'](handleError(_0x3ac806,null));};exports[_0x94c9('0x21')]=function(_0x8a7e8b,_0x5cb82d){return db[_0x94c9('0x28')]['find']({'where':{'id':_0x8a7e8b[_0x94c9('0x45')]['id']}})['then'](handleEntityNotFound(_0x5cb82d,null))['then'](removeEntity(_0x5cb82d,null))[_0x94c9('0x43')](handleError(_0x5cb82d,null));};exports['describe']=function(_0x3582b1,_0x5ed5bc){return db[_0x94c9('0x28')][_0x94c9('0x49')]()[_0x94c9('0x20')](respondWithResult(_0x5ed5bc,null))['catch'](handleError(_0x5ed5bc,null));}; \ No newline at end of file +var _0xaa5e=['limit','order','sort','where','pick','merge','filter','options','includeAll','findAll','rows','catch','show','params','rawAttributes','create','body','find','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','IntegrationReport','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','nolimit'];(function(_0x1626c4,_0x1d4694){var _0x3b5725=function(_0x52f549){while(--_0x52f549){_0x1626c4['push'](_0x1626c4['shift']());}};_0x3b5725(++_0x1d4694);}(_0xaa5e,0xa5));var _0xeaa5=function(_0x1fbc59,_0xdc7dc4){_0x1fbc59=_0x1fbc59-0x0;var _0x2118a4=_0xaa5e[_0x1fbc59];return _0x2118a4;};'use strict';var pdf=require(_0xeaa5('0x0'));var emlformat=require(_0xeaa5('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xeaa5('0x2'));var jsonpatch=require(_0xeaa5('0x3'));var rp=require(_0xeaa5('0x4'));var moment=require(_0xeaa5('0x5'));var BPromise=require(_0xeaa5('0x6'));var Mustache=require('mustache');var util=require(_0xeaa5('0x7'));var path=require(_0xeaa5('0x8'));var sox=require(_0xeaa5('0x9'));var csv=require(_0xeaa5('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xeaa5('0xb'));var crypto=require(_0xeaa5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xeaa5('0xd'));var toCsv=require(_0xeaa5('0xa'));var querystring=require('querystring');var Papa=require(_0xeaa5('0xe'));var Redis=require('ioredis');var authService=require(_0xeaa5('0xf'));var qs=require(_0xeaa5('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xeaa5('0x11'));var logger=require(_0xeaa5('0x12'))(_0xeaa5('0x13'));var utils=require(_0xeaa5('0x14'));var config=require(_0xeaa5('0x15'));var db=require(_0xeaa5('0x16'))['db'];function respondWithStatusCode(_0x119d7f,_0x2c3561){_0x2c3561=_0x2c3561||0xcc;return function(_0x123d6e){if(_0x123d6e){return _0x119d7f['sendStatus'](_0x2c3561);}return _0x119d7f[_0xeaa5('0x17')](_0x2c3561)[_0xeaa5('0x18')]();};}function respondWithResult(_0x3d8b80,_0x21acf9){_0x21acf9=_0x21acf9||0xc8;return function(_0x18ca75){if(_0x18ca75){return _0x3d8b80['status'](_0x21acf9)[_0xeaa5('0x19')](_0x18ca75);}};}function respondWithFilteredResult(_0x4fddfd,_0x5d5884){return function(_0x1f904a){if(_0x1f904a){var _0x1a1abc=_0x1f904a[_0xeaa5('0x1a')],_0x507fb4=_0x5d5884[_0xeaa5('0x1b')],_0x1cc157=_0x5d5884[_0xeaa5('0x1b')]+_0x5d5884['limit'],_0x5a0fed;if(_0x1cc157>=_0x1a1abc){_0x1cc157=_0x1a1abc;_0x5a0fed=0xc8;}else{_0x5a0fed=0xce;}_0x4fddfd[_0xeaa5('0x17')](_0x5a0fed);return _0x4fddfd['set'](_0xeaa5('0x1c'),_0x507fb4+'-'+_0x1cc157+'/'+_0x1a1abc)[_0xeaa5('0x19')](_0x1f904a);}return null;};}function patchUpdates(_0x22f4d3){return function(_0x7b5738){try{jsonpatch['apply'](_0x7b5738,_0x22f4d3,!![]);}catch(_0x1e4fcd){return BPromise[_0xeaa5('0x1d')](_0x1e4fcd);}return _0x7b5738[_0xeaa5('0x1e')]();};}function saveUpdates(_0x56533e,_0x11ace2){return function(_0xa097a5){if(_0xa097a5){return _0xa097a5[_0xeaa5('0x1f')](_0x56533e)[_0xeaa5('0x20')](function(_0x590bbb){return _0x590bbb;});}return null;};}function removeEntity(_0x561a79,_0x3f081e){return function(_0x5f2d83){if(_0x5f2d83){return _0x5f2d83[_0xeaa5('0x21')]()[_0xeaa5('0x20')](function(){_0x561a79[_0xeaa5('0x17')](0xcc)[_0xeaa5('0x18')]();});}};}function handleEntityNotFound(_0x3a98b4,_0x233a5b){return function(_0x355dbd){if(!_0x355dbd){_0x3a98b4[_0xeaa5('0x22')](0x194);}return _0x355dbd;};}function handleError(_0xebce8c,_0x2c4003){_0x2c4003=_0x2c4003||0x1f4;return function(_0x3e27f1){logger[_0xeaa5('0x23')](_0x3e27f1[_0xeaa5('0x24')]);if(_0x3e27f1[_0xeaa5('0x25')]){delete _0x3e27f1[_0xeaa5('0x25')];}_0xebce8c['status'](_0x2c4003)[_0xeaa5('0x26')](_0x3e27f1);};}exports[_0xeaa5('0x27')]=function(_0x565c79,_0x3c2096){var _0x3ab3c4={},_0x304936={},_0x35ca08={'count':0x0,'rows':[]};var _0x1a1ec3=_['map'](db[_0xeaa5('0x28')]['rawAttributes'],function(_0x42e55e){return{'name':_0x42e55e[_0xeaa5('0x29')],'type':_0x42e55e[_0xeaa5('0x2a')][_0xeaa5('0x2b')]};});_0x304936[_0xeaa5('0x2c')]=_[_0xeaa5('0x2d')](_0x1a1ec3,'name');_0x304936[_0xeaa5('0x2e')]=_[_0xeaa5('0x2f')](_0x565c79['query']);_0x304936[_0xeaa5('0x30')]=_['intersection'](_0x304936[_0xeaa5('0x2c')],_0x304936['query']);_0x3ab3c4['attributes']=_[_0xeaa5('0x31')](_0x304936['model'],qs[_0xeaa5('0x32')](_0x565c79['query'][_0xeaa5('0x32')]));_0x3ab3c4[_0xeaa5('0x33')]=_0x3ab3c4[_0xeaa5('0x33')][_0xeaa5('0x34')]?_0x3ab3c4['attributes']:_0x304936[_0xeaa5('0x2c')];if(!_0x565c79['query']['hasOwnProperty'](_0xeaa5('0x35'))){_0x3ab3c4[_0xeaa5('0x36')]=qs['limit'](_0x565c79[_0xeaa5('0x2e')][_0xeaa5('0x36')]);_0x3ab3c4[_0xeaa5('0x1b')]=qs[_0xeaa5('0x1b')](_0x565c79['query']['offset']);}_0x3ab3c4[_0xeaa5('0x37')]=qs[_0xeaa5('0x38')](_0x565c79[_0xeaa5('0x2e')][_0xeaa5('0x38')]);_0x3ab3c4[_0xeaa5('0x39')]=qs[_0xeaa5('0x30')](_[_0xeaa5('0x3a')](_0x565c79['query'],_0x304936[_0xeaa5('0x30')]));if(_0x565c79[_0xeaa5('0x2e')]['filter']){_0x3ab3c4[_0xeaa5('0x39')]=_[_0xeaa5('0x3b')](_0x3ab3c4['where'],{'$or':_['map'](_0x1a1ec3,function(_0x49f9f0){if(_0x49f9f0[_0xeaa5('0x2a')]!=='VIRTUAL'){var _0x2d53ca={};_0x2d53ca[_0x49f9f0['name']]={'$like':'%'+_0x565c79['query'][_0xeaa5('0x3c')]+'%'};return _0x2d53ca;}})});}_0x3ab3c4=_[_0xeaa5('0x3b')]({},_0x3ab3c4,_0x565c79[_0xeaa5('0x3d')]);var _0x28e5a5={'where':_0x3ab3c4[_0xeaa5('0x39')]};return db[_0xeaa5('0x28')]['count'](_0x28e5a5)['then'](function(_0x387816){_0x35ca08['count']=_0x387816;if(_0x565c79[_0xeaa5('0x2e')][_0xeaa5('0x3e')]){_0x3ab3c4['include']=[{'all':!![]}];}return db[_0xeaa5('0x28')][_0xeaa5('0x3f')](_0x3ab3c4);})[_0xeaa5('0x20')](function(_0x491a7a){_0x35ca08[_0xeaa5('0x40')]=_0x491a7a;return _0x35ca08;})['then'](respondWithFilteredResult(_0x3c2096,_0x3ab3c4))[_0xeaa5('0x41')](handleError(_0x3c2096,null));};exports[_0xeaa5('0x42')]=function(_0x5f2c8e,_0x247eab){var _0x43d5a0={'raw':![],'where':{'id':_0x5f2c8e[_0xeaa5('0x43')]['id']}},_0x58f50a={};_0x58f50a[_0xeaa5('0x2c')]=_[_0xeaa5('0x2f')](db[_0xeaa5('0x28')][_0xeaa5('0x44')]);_0x58f50a[_0xeaa5('0x2e')]=_[_0xeaa5('0x2f')](_0x5f2c8e[_0xeaa5('0x2e')]);_0x58f50a[_0xeaa5('0x30')]=_['intersection'](_0x58f50a[_0xeaa5('0x2c')],_0x58f50a[_0xeaa5('0x2e')]);_0x43d5a0[_0xeaa5('0x33')]=_[_0xeaa5('0x31')](_0x58f50a[_0xeaa5('0x2c')],qs[_0xeaa5('0x32')](_0x5f2c8e['query']['fields']));_0x43d5a0[_0xeaa5('0x33')]=_0x43d5a0[_0xeaa5('0x33')][_0xeaa5('0x34')]?_0x43d5a0['attributes']:_0x58f50a[_0xeaa5('0x2c')];if(_0x5f2c8e[_0xeaa5('0x2e')][_0xeaa5('0x3e')]){_0x43d5a0['include']=[{'all':!![]}];}_0x43d5a0=_[_0xeaa5('0x3b')]({},_0x43d5a0,_0x5f2c8e[_0xeaa5('0x3d')]);return db[_0xeaa5('0x28')]['find'](_0x43d5a0)[_0xeaa5('0x20')](handleEntityNotFound(_0x247eab,null))[_0xeaa5('0x20')](respondWithResult(_0x247eab,null))[_0xeaa5('0x41')](handleError(_0x247eab,null));};exports[_0xeaa5('0x45')]=function(_0x32e3f9,_0xdb1b28){return db[_0xeaa5('0x28')][_0xeaa5('0x45')](_0x32e3f9[_0xeaa5('0x46')],{})['then'](respondWithResult(_0xdb1b28,0xc9))[_0xeaa5('0x41')](handleError(_0xdb1b28,null));};exports[_0xeaa5('0x1f')]=function(_0x147d2f,_0xdfe6bf){if(_0x147d2f[_0xeaa5('0x46')]['id']){delete _0x147d2f[_0xeaa5('0x46')]['id'];}return db[_0xeaa5('0x28')][_0xeaa5('0x47')]({'where':{'id':_0x147d2f[_0xeaa5('0x43')]['id']}})['then'](handleEntityNotFound(_0xdfe6bf,null))[_0xeaa5('0x20')](saveUpdates(_0x147d2f[_0xeaa5('0x46')],null))[_0xeaa5('0x20')](respondWithResult(_0xdfe6bf,null))[_0xeaa5('0x41')](handleError(_0xdfe6bf,null));};exports['destroy']=function(_0x173d2a,_0x6bdad2){return db[_0xeaa5('0x28')][_0xeaa5('0x47')]({'where':{'id':_0x173d2a['params']['id']}})[_0xeaa5('0x20')](handleEntityNotFound(_0x6bdad2,null))[_0xeaa5('0x20')](removeEntity(_0x6bdad2,null))[_0xeaa5('0x41')](handleError(_0x6bdad2,null));};exports[_0xeaa5('0x48')]=function(_0x4f0a9c,_0x24eb8e){return db['IntegrationReport']['describe']()[_0xeaa5('0x20')](respondWithResult(_0x24eb8e,null))['catch'](handleError(_0x24eb8e,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 70b03d5..204ab43 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 _0x332c=['define','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./integrationReport.attributes','exports'];(function(_0x857439,_0x4d9d34){var _0x559059=function(_0x2f6d6b){while(--_0x2f6d6b){_0x857439['push'](_0x857439['shift']());}};_0x559059(++_0x4d9d34);}(_0x332c,0x7a));var _0xc332=function(_0x2a4ddb,_0x351833){_0x2a4ddb=_0x2a4ddb-0x0;var _0x4da0ab=_0x332c[_0x2a4ddb];return _0x4da0ab;};'use strict';var _=require(_0xc332('0x0'));var util=require(_0xc332('0x1'));var logger=require(_0xc332('0x2'))(_0xc332('0x3'));var moment=require(_0xc332('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc332('0x5'));var rimraf=require(_0xc332('0x6'));var config=require(_0xc332('0x7'));var attributes=require(_0xc332('0x8'));module[_0xc332('0x9')]=function(_0x257848,_0x3fe63e){return _0x257848[_0xc332('0xa')]('IntegrationReport',attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6520=['exports','define','IntegrationReport','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./integrationReport.attributes'];(function(_0x1b2eb9,_0x2c9873){var _0x364260=function(_0x43d5fb){while(--_0x43d5fb){_0x1b2eb9['push'](_0x1b2eb9['shift']());}};_0x364260(++_0x2c9873);}(_0x6520,0xab));var _0x0652=function(_0x2082ec,_0x584ab4){_0x2082ec=_0x2082ec-0x0;var _0x165143=_0x6520[_0x2082ec];return _0x165143;};'use strict';var _=require(_0x0652('0x0'));var util=require('util');var logger=require(_0x0652('0x1'))(_0x0652('0x2'));var moment=require(_0x0652('0x3'));var BPromise=require(_0x0652('0x4'));var rp=require(_0x0652('0x5'));var fs=require('fs');var path=require(_0x0652('0x6'));var rimraf=require('rimraf');var config=require(_0x0652('0x7'));var attributes=require(_0x0652('0x8'));module[_0x0652('0x9')]=function(_0x4d67f9,_0x33cb9d){return _0x4d67f9[_0x0652('0xa')](_0x0652('0xb'),attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.rpc.js b/server/api/integrationReport/integrationReport.rpc.js index 20fdb75..63144d2 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 _0xbaf0=['client','http','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x387dc1,_0x3ba649){var _0x17567c=function(_0x4690aa){while(--_0x4690aa){_0x387dc1['push'](_0x387dc1['shift']());}};_0x17567c(++_0x3ba649);}(_0xbaf0,0x12a));var _0x0baf=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xbaf0[_0xa464c9];return _0x3d73c4;};'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')]('IntegrationReport,\x20%s,\x20%s',_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x5f5030(_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);}else{logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,'request\x20sent');_0x5f5030(_0x2c7442['result'][_0x0baf('0x14')]);}})[_0x0baf('0x15')](function(_0x283408){logger[_0x0baf('0x13')](_0x0baf('0xe'),_0x2dcaac,_0x283408);_0x11b947(_0x283408);});});} \ No newline at end of file +var _0xb10b=['stringify','error','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','IntegrationReport,\x20%s,\x20%s','IntegrationReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x26fa6b,_0x4aeb13){var _0xd2c9ff=function(_0x3adf37){while(--_0x3adf37){_0x26fa6b['push'](_0x26fa6b['shift']());}};_0xd2c9ff(++_0x4aeb13);}(_0xb10b,0x12a));var _0xbb10=function(_0x590cd0,_0x11bfd4){_0x590cd0=_0x590cd0-0x0;var _0x208eb0=_0xb10b[_0x590cd0];return _0x208eb0;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index afb2b7f..c029630 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 _0x9c44=['../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated','show','/:id/sub_intervals','getIntervals','post','addInterval','addIntervals','put','update','destroy','exports','path','connect-timeout','express','Router'];(function(_0x54c004,_0x3f0783){var _0x1df8be=function(_0x4d8517){while(--_0x4d8517){_0x54c004['push'](_0x54c004['shift']());}};_0x1df8be(++_0x3f0783);}(_0x9c44,0x178));var _0x49c4=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x9c44[_0x4f9b18];return _0x29f20c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var auth=require(_0x49c4('0x4'));var interaction=require(_0x49c4('0x5'));var config=require('../../config/environment');var controller=require('./interval.controller');router[_0x49c4('0x6')]('/',auth['isAuthenticated'](),controller[_0x49c4('0x7')]);router[_0x49c4('0x6')](_0x49c4('0x8'),auth[_0x49c4('0x9')](),controller[_0x49c4('0xa')]);router['get'](_0x49c4('0xb'),auth[_0x49c4('0x9')](),controller[_0x49c4('0xc')]);router[_0x49c4('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x49c4('0xd')](_0x49c4('0xb'),auth['isAuthenticated'](),controller[_0x49c4('0xe')]);router[_0x49c4('0xd')]('/:id/sub_intervals/create_many',auth['isAuthenticated'](),controller[_0x49c4('0xf')]);router[_0x49c4('0x10')]('/:id',auth[_0x49c4('0x9')](),controller[_0x49c4('0x11')]);router['delete'](_0x49c4('0x8'),auth[_0x49c4('0x9')](),controller[_0x49c4('0x12')]);module[_0x49c4('0x13')]=router; \ No newline at end of file +var _0x9c44=['../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated','show','/:id/sub_intervals','getIntervals','post','addInterval','addIntervals','put','update','destroy','exports','path','connect-timeout','express','Router'];(function(_0x5c3f39,_0x20dd63){var _0x11860d=function(_0x36031e){while(--_0x36031e){_0x5c3f39['push'](_0x5c3f39['shift']());}};_0x11860d(++_0x20dd63);}(_0x9c44,0x178));var _0x49c4=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x9c44[_0x4b055c];return _0x4b62bb;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var auth=require(_0x49c4('0x4'));var interaction=require(_0x49c4('0x5'));var config=require('../../config/environment');var controller=require('./interval.controller');router[_0x49c4('0x6')]('/',auth['isAuthenticated'](),controller[_0x49c4('0x7')]);router[_0x49c4('0x6')](_0x49c4('0x8'),auth[_0x49c4('0x9')](),controller[_0x49c4('0xa')]);router['get'](_0x49c4('0xb'),auth[_0x49c4('0x9')](),controller[_0x49c4('0xc')]);router[_0x49c4('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x49c4('0xd')](_0x49c4('0xb'),auth['isAuthenticated'](),controller[_0x49c4('0xe')]);router[_0x49c4('0xd')]('/:id/sub_intervals/create_many',auth['isAuthenticated'](),controller[_0x49c4('0xf')]);router[_0x49c4('0x10')]('/:id',auth[_0x49c4('0x9')](),controller[_0x49c4('0x11')]);router['delete'](_0x49c4('0x8'),auth[_0x49c4('0x9')](),controller[_0x49c4('0x12')]);module[_0x49c4('0x13')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index e8c8ce2..ff6bb56 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 _0xe61c=['STRING'];(function(_0x501ca1,_0x6c6edc){var _0x2a99c4=function(_0x542cad){while(--_0x542cad){_0x501ca1['push'](_0x501ca1['shift']());}};_0x2a99c4(++_0x6c6edc);}(_0xe61c,0xf4));var _0xce61=function(_0x2c1114,_0x2a5c50){_0x2c1114=_0x2c1114-0x0;var _0x2b877c=_0xe61c[_0x2c1114];return _0x2b877c;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xce61('0x0')]},'description':{'type':Sequelize[_0xce61('0x0')]},'interval':{'type':Sequelize[_0xce61('0x0')],'allowNull':!![]}}; \ No newline at end of file +var _0x5a3c=['STRING','sequelize','exports'];(function(_0x25baff,_0x116031){var _0x30f19f=function(_0x5480d3){while(--_0x5480d3){_0x25baff['push'](_0x25baff['shift']());}};_0x30f19f(++_0x116031);}(_0x5a3c,0x1c9));var _0xc5a3=function(_0x75f869,_0x3690d6){_0x75f869=_0x75f869-0x0;var _0x10af8b=_0x5a3c[_0x75f869];return _0x10af8b;};'use strict';var Sequelize=require(_0xc5a3('0x0'));module[_0xc5a3('0x1')]={'name':{'type':Sequelize[_0xc5a3('0x2')]},'description':{'type':Sequelize[_0xc5a3('0x2')]},'interval':{'type':Sequelize[_0xc5a3('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 341dbff..211be17 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 _0x34e8=['Intervals','find','userProfileId','autoAssociation','update','addInterval','IntervalId','getIntervals','findOne','order','hasOwnProperty','nolimit','addIntervals','sequelize','transaction','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','then','destroy','get','UserProfileResource','error','stack','name','map','Interval','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','length','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x380158,_0x599bd1){var _0x39ac68=function(_0x294e50){while(--_0x294e50){_0x380158['push'](_0x380158['shift']());}};_0x39ac68(++_0x599bd1);}(_0x34e8,0x12c));var _0x834e=function(_0x444852,_0xfdbc66){_0x444852=_0x444852-0x0;var _0x19571e=_0x34e8[_0x444852];return _0x19571e;};'use strict';var pdf=require(_0x834e('0x0'));var emlformat=require(_0x834e('0x1'));var rimraf=require(_0x834e('0x2'));var zipdir=require(_0x834e('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x834e('0x4'));var moment=require(_0x834e('0x5'));var BPromise=require(_0x834e('0x6'));var Mustache=require(_0x834e('0x7'));var util=require(_0x834e('0x8'));var path=require(_0x834e('0x9'));var sox=require(_0x834e('0xa'));var csv=require('to-csv');var ejs=require(_0x834e('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x834e('0xc'));var crypto=require(_0x834e('0xd'));var jsforce=require(_0x834e('0xe'));var deskjs=require(_0x834e('0xf'));var toCsv=require(_0x834e('0x10'));var querystring=require(_0x834e('0x11'));var Papa=require(_0x834e('0x12'));var Redis=require(_0x834e('0x13'));var authService=require(_0x834e('0x14'));var qs=require(_0x834e('0x15'));var as=require(_0x834e('0x16'));var hardwareService=require(_0x834e('0x17'));var logger=require(_0x834e('0x18'))(_0x834e('0x19'));var utils=require(_0x834e('0x1a'));var config=require(_0x834e('0x1b'));var db=require(_0x834e('0x1c'))['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x5e5b6d,_0x6cd9b9){_0x6cd9b9=_0x6cd9b9||0xcc;return function(_0x58a27e){if(_0x58a27e){return _0x5e5b6d[_0x834e('0x1d')](_0x6cd9b9);}return _0x5e5b6d[_0x834e('0x1e')](_0x6cd9b9)[_0x834e('0x1f')]();};}function respondWithResult(_0x21cc0a,_0x50e860){_0x50e860=_0x50e860||0xc8;return function(_0x43156c){if(_0x43156c){return _0x21cc0a[_0x834e('0x1e')](_0x50e860)['json'](_0x43156c);}};}function respondWithFilteredResult(_0x316205,_0x4a9cdc){return function(_0x38a8cd){if(_0x38a8cd){var _0x36d443=_0x38a8cd[_0x834e('0x20')],_0x478afe=_0x4a9cdc['offset'],_0x43ac41=_0x4a9cdc[_0x834e('0x21')]+_0x4a9cdc[_0x834e('0x22')],_0x22106e;if(_0x43ac41>=_0x36d443){_0x43ac41=_0x36d443;_0x22106e=0xc8;}else{_0x22106e=0xce;}_0x316205[_0x834e('0x1e')](_0x22106e);return _0x316205[_0x834e('0x23')](_0x834e('0x24'),_0x478afe+'-'+_0x43ac41+'/'+_0x36d443)[_0x834e('0x25')](_0x38a8cd);}return null;};}function patchUpdates(_0x1dd214){return function(_0x595515){try{jsonpatch[_0x834e('0x26')](_0x595515,_0x1dd214,!![]);}catch(_0x1fd2c6){return BPromise[_0x834e('0x27')](_0x1fd2c6);}return _0x595515[_0x834e('0x28')]();};}function saveUpdates(_0x4ab05d,_0x45a630){return function(_0x62f8f1){if(_0x62f8f1){return _0x62f8f1['update'](_0x4ab05d)[_0x834e('0x29')](function(_0x28d687){return _0x28d687;});}return null;};}function removeEntity(_0x8d406e,_0x5c55ca){return function(_0x4e3f48){if(_0x4e3f48){return _0x4e3f48[_0x834e('0x2a')]()[_0x834e('0x29')](function(){var _0x589dde=_0x4e3f48[_0x834e('0x2b')]({'plain':!![]});var _0x1dc1e0='Intervals';return db[_0x834e('0x2c')][_0x834e('0x2a')]({'where':{'type':_0x1dc1e0,'resourceId':_0x589dde['id']}})[_0x834e('0x29')](function(){return _0x4e3f48;});})['then'](function(){_0x8d406e[_0x834e('0x1e')](0xcc)[_0x834e('0x1f')]();});}};}function handleEntityNotFound(_0x5e1cc5,_0x5bef62){return function(_0x1e713a){if(!_0x1e713a){_0x5e1cc5['sendStatus'](0x194);}return _0x1e713a;};}function handleError(_0x2826ec,_0x3f1b0b){_0x3f1b0b=_0x3f1b0b||0x1f4;return function(_0x3db026){logger[_0x834e('0x2d')](_0x3db026[_0x834e('0x2e')]);if(_0x3db026[_0x834e('0x2f')]){delete _0x3db026['name'];}_0x2826ec['status'](_0x3f1b0b)['send'](_0x3db026);};}exports['index']=function(_0x2c7a8d,_0x567cea){var _0x106d6a={},_0x5dacc1={},_0xb5bc06={'count':0x0,'rows':[]};var _0x11f1ce=_[_0x834e('0x30')](db[_0x834e('0x31')][_0x834e('0x32')],function(_0x390119){return{'name':_0x390119[_0x834e('0x33')],'type':_0x390119[_0x834e('0x34')][_0x834e('0x35')]};});_0x5dacc1['model']=_[_0x834e('0x30')](_0x11f1ce,'name');_0x5dacc1[_0x834e('0x36')]=_[_0x834e('0x37')](_0x2c7a8d[_0x834e('0x36')]);_0x5dacc1[_0x834e('0x38')]=_[_0x834e('0x39')](_0x5dacc1[_0x834e('0x3a')],_0x5dacc1[_0x834e('0x36')]);_0x106d6a[_0x834e('0x3b')]=_[_0x834e('0x39')](_0x5dacc1[_0x834e('0x3a')],qs['fields'](_0x2c7a8d[_0x834e('0x36')][_0x834e('0x3c')]));_0x106d6a[_0x834e('0x3b')]=_0x106d6a[_0x834e('0x3b')]['length']?_0x106d6a[_0x834e('0x3b')]:_0x5dacc1[_0x834e('0x3a')];if(!_0x2c7a8d['query']['hasOwnProperty']('nolimit')){_0x106d6a[_0x834e('0x22')]=qs[_0x834e('0x22')](_0x2c7a8d[_0x834e('0x36')][_0x834e('0x22')]);_0x106d6a[_0x834e('0x21')]=qs[_0x834e('0x21')](_0x2c7a8d['query'][_0x834e('0x21')]);}_0x106d6a['order']=qs[_0x834e('0x3d')](_0x2c7a8d[_0x834e('0x36')]['sort']);_0x106d6a[_0x834e('0x3e')]=qs[_0x834e('0x38')](_['pick'](_0x2c7a8d['query'],_0x5dacc1[_0x834e('0x38')]));if(_0x2c7a8d[_0x834e('0x36')][_0x834e('0x3f')]){_0x106d6a[_0x834e('0x3e')]=_[_0x834e('0x40')](_0x106d6a['where'],{'$or':_[_0x834e('0x30')](_0x11f1ce,function(_0x548d1d){if(_0x548d1d['type']!==_0x834e('0x41')){var _0x4a7f76={};_0x4a7f76[_0x548d1d[_0x834e('0x2f')]]={'$like':'%'+_0x2c7a8d[_0x834e('0x36')][_0x834e('0x3f')]+'%'};return _0x4a7f76;}})});}_0x106d6a=_[_0x834e('0x40')]({},_0x106d6a,_0x2c7a8d[_0x834e('0x42')]);var _0x574ea8={'where':_0x106d6a[_0x834e('0x3e')]};return db[_0x834e('0x31')][_0x834e('0x20')](_0x574ea8)['then'](function(_0x35380e){_0xb5bc06[_0x834e('0x20')]=_0x35380e;if(_0x2c7a8d['query'][_0x834e('0x43')]){_0x106d6a['include']=[{'all':!![]}];}return db[_0x834e('0x31')][_0x834e('0x44')](_0x106d6a);})['then'](function(_0x4a6942){_0xb5bc06[_0x834e('0x45')]=_0x4a6942;return _0xb5bc06;})[_0x834e('0x29')](respondWithFilteredResult(_0x567cea,_0x106d6a))[_0x834e('0x46')](handleError(_0x567cea,null));};exports[_0x834e('0x47')]=function(_0x8ad264,_0x23feea){var _0x195204={'raw':!![],'where':{'id':_0x8ad264[_0x834e('0x48')]['id']}},_0x4a3381={};_0x4a3381['model']=_[_0x834e('0x37')](db['Interval'][_0x834e('0x32')]);_0x4a3381['query']=_[_0x834e('0x37')](_0x8ad264[_0x834e('0x36')]);_0x4a3381['filters']=_[_0x834e('0x39')](_0x4a3381[_0x834e('0x3a')],_0x4a3381[_0x834e('0x36')]);_0x195204[_0x834e('0x3b')]=_[_0x834e('0x39')](_0x4a3381[_0x834e('0x3a')],qs[_0x834e('0x3c')](_0x8ad264[_0x834e('0x36')][_0x834e('0x3c')]));_0x195204[_0x834e('0x3b')]=_0x195204['attributes'][_0x834e('0x49')]?_0x195204[_0x834e('0x3b')]:_0x4a3381['model'];if(_0x8ad264[_0x834e('0x36')][_0x834e('0x43')]){_0x195204[_0x834e('0x4a')]=[{'all':!![]}];}_0x195204=_[_0x834e('0x40')]({},_0x195204,_0x8ad264[_0x834e('0x42')]);return db[_0x834e('0x31')]['find'](_0x195204)['then'](handleEntityNotFound(_0x23feea,null))[_0x834e('0x29')](respondWithResult(_0x23feea,null))[_0x834e('0x46')](handleError(_0x23feea,null));};exports[_0x834e('0x4b')]=function(_0x40ff5a,_0x3da408){return db[_0x834e('0x31')][_0x834e('0x4b')](_0x40ff5a[_0x834e('0x4c')],{})[_0x834e('0x29')](function(_0x390c45){var _0xf02f0d=_0x40ff5a[_0x834e('0x4d')][_0x834e('0x2b')]({'plain':!![]});if(!_0xf02f0d)throw new Error(_0x834e('0x4e'));if(_0xf02f0d[_0x834e('0x4f')]===_0x834e('0x4d')){var _0x3df078=_0x390c45[_0x834e('0x2b')]({'plain':!![]});var _0x420841=_0x834e('0x50');return db['UserProfileSection'][_0x834e('0x51')]({'where':{'name':_0x420841,'userProfileId':_0xf02f0d[_0x834e('0x52')]},'raw':!![]})['then'](function(_0x3c00a3){if(_0x3c00a3&&_0x3c00a3[_0x834e('0x53')]===0x0){return db['UserProfileResource'][_0x834e('0x4b')]({'name':_0x3df078[_0x834e('0x2f')],'resourceId':_0x3df078['id'],'type':_0x3c00a3[_0x834e('0x2f')],'sectionId':_0x3c00a3['id']},{})[_0x834e('0x29')](function(){return _0x390c45;});}else{return _0x390c45;}})[_0x834e('0x46')](function(_0xb77aab){logger[_0x834e('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xb77aab);throw _0xb77aab;});}return _0x390c45;})[_0x834e('0x29')](respondWithResult(_0x3da408,0xc9))[_0x834e('0x46')](handleError(_0x3da408,null));};exports[_0x834e('0x54')]=function(_0x363675,_0x86ad2b){if(_0x363675[_0x834e('0x4c')]['id']){delete _0x363675[_0x834e('0x4c')]['id'];}return db[_0x834e('0x31')]['find']({'where':{'id':_0x363675[_0x834e('0x48')]['id']}})['then'](handleEntityNotFound(_0x86ad2b,null))[_0x834e('0x29')](saveUpdates(_0x363675['body'],null))[_0x834e('0x29')](respondWithResult(_0x86ad2b,null))['catch'](handleError(_0x86ad2b,null));};exports['destroy']=function(_0x6c0b29,_0x3e1bee){return db['Interval']['find']({'where':{'id':_0x6c0b29[_0x834e('0x48')]['id']}})[_0x834e('0x29')](handleEntityNotFound(_0x3e1bee,null))[_0x834e('0x29')](removeEntity(_0x3e1bee,null))[_0x834e('0x46')](handleError(_0x3e1bee,null));};exports[_0x834e('0x55')]=function(_0x315858,_0x3d3f2b,_0x4273f1){if(_0x315858['body']['id']){delete _0x315858[_0x834e('0x4c')]['id'];}return db[_0x834e('0x31')]['find']({'where':{'id':_0x315858[_0x834e('0x48')]['id']}})['then'](handleEntityNotFound(_0x3d3f2b,null))[_0x834e('0x29')](function(_0x45eceb){if(_0x45eceb){_0x315858['body'][_0x834e('0x56')]=_0x45eceb['id'];return db[_0x834e('0x31')][_0x834e('0x4b')](_0x315858[_0x834e('0x4c')]);}})['then'](respondWithResult(_0x3d3f2b,null))[_0x834e('0x46')](handleError(_0x3d3f2b,null));};exports[_0x834e('0x57')]=function(_0x1dfd5f,_0x5925ef,_0x246b8e){var _0x1fcae9={};var _0x3a7683={};var _0x1a0cd0;var _0x3183c5;return db[_0x834e('0x31')][_0x834e('0x58')]({'where':{'id':_0x1dfd5f[_0x834e('0x48')]['id']}})[_0x834e('0x29')](handleEntityNotFound(_0x5925ef,null))[_0x834e('0x29')](function(_0x1e4310){if(_0x1e4310){_0x1a0cd0=_0x1e4310;_0x3a7683[_0x834e('0x3a')]=_[_0x834e('0x37')](db[_0x834e('0x31')][_0x834e('0x32')]);_0x3a7683[_0x834e('0x36')]=_[_0x834e('0x37')](_0x1dfd5f[_0x834e('0x36')]);_0x3a7683[_0x834e('0x38')]=_[_0x834e('0x39')](_0x3a7683[_0x834e('0x3a')],_0x3a7683[_0x834e('0x36')]);_0x1fcae9['attributes']=_[_0x834e('0x39')](_0x3a7683[_0x834e('0x3a')],qs[_0x834e('0x3c')](_0x1dfd5f[_0x834e('0x36')]['fields']));_0x1fcae9[_0x834e('0x3b')]=_0x1fcae9['attributes']['length']?_0x1fcae9[_0x834e('0x3b')]:_0x3a7683[_0x834e('0x3a')];_0x1fcae9[_0x834e('0x59')]=qs[_0x834e('0x3d')](_0x1dfd5f[_0x834e('0x36')][_0x834e('0x3d')]);_0x1fcae9[_0x834e('0x3e')]=qs[_0x834e('0x38')](_['pick'](_0x1dfd5f[_0x834e('0x36')],_0x3a7683['filters']));if(_0x1dfd5f[_0x834e('0x36')][_0x834e('0x3f')]){_0x1fcae9['where']=_['merge'](_0x1fcae9[_0x834e('0x3e')],{'$or':_[_0x834e('0x30')](_0x1fcae9[_0x834e('0x3b')],function(_0x2cca07){var _0x2c41bd={};_0x2c41bd[_0x2cca07]={'$like':'%'+_0x1dfd5f['query'][_0x834e('0x3f')]+'%'};return _0x2c41bd;})});}_0x1fcae9=_[_0x834e('0x40')]({},_0x1fcae9,_0x1dfd5f[_0x834e('0x42')]);return _0x1a0cd0[_0x834e('0x57')](_0x1fcae9);}})[_0x834e('0x29')](function(_0x28b5c9){if(_0x28b5c9){_0x3183c5=_0x28b5c9[_0x834e('0x49')];if(!_0x1dfd5f[_0x834e('0x36')][_0x834e('0x5a')](_0x834e('0x5b'))){_0x1fcae9['limit']=qs[_0x834e('0x22')](_0x1dfd5f[_0x834e('0x36')][_0x834e('0x22')]);_0x1fcae9[_0x834e('0x21')]=qs['offset'](_0x1dfd5f[_0x834e('0x36')]['offset']);}return _0x1a0cd0['getIntervals'](_0x1fcae9);}})['then'](function(_0x452f7f){if(_0x452f7f){return _0x452f7f?{'count':_0x3183c5,'rows':_0x452f7f}:null;}})[_0x834e('0x29')](respondWithResult(_0x5925ef,null))['catch'](handleError(_0x5925ef,null));};exports[_0x834e('0x5c')]=function(_0x1b200d,_0x4d4477,_0x353246){return db[_0x834e('0x31')]['findOne']({'where':{'id':_0x1b200d['params']['id']}})[_0x834e('0x29')](handleEntityNotFound(_0x4d4477,null))[_0x834e('0x29')](function(_0x8bc7d9){if(_0x8bc7d9){return db[_0x834e('0x5d')][_0x834e('0x5e')](function(_0x493239){return db[_0x834e('0x31')]['destroy']({'where':{'IntervalId':_0x1b200d[_0x834e('0x48')]['id']},'transaction':_0x493239})[_0x834e('0x29')](function(_0x2c758c){var _0x5afb41=_[_0x834e('0x30')](_0x1b200d[_0x834e('0x4c')],function(_0x48521f){delete _0x48521f['id'];_0x48521f[_0x834e('0x56')]=_0x1b200d[_0x834e('0x48')]['id'];return _0x48521f;});return db[_0x834e('0x31')]['bulkCreate'](_0x5afb41,{'transaction':_0x493239});});})[_0x834e('0x29')](function(){return db[_0x834e('0x31')][_0x834e('0x44')]({'where':{'IntervalId':_0x1b200d[_0x834e('0x48')]['id']}});});}})[_0x834e('0x29')](respondWithResult(_0x4d4477,null))[_0x834e('0x46')](handleError(_0x4d4477,null));}; \ No newline at end of file +var _0x008c=['query','keys','filters','intersection','attributes','fields','length','nolimit','limit','offset','order','sort','pick','where','VIRTUAL','filter','merge','options','Interval','include','findAll','catch','show','params','rawAttributes','includeAll','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Intervals','UserProfileSection','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','addInterval','getIntervals','findOne','hasOwnProperty','sequelize','IntervalId','bulkCreate','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/extensions/rewrite','end','status','json','count','set','Content-Range','save','destroy','then','get','UserProfileResource','sendStatus','name','send','map','fieldName','type','key','model'];(function(_0x1559a0,_0x9b8fd7){var _0x37e36f=function(_0x1bf6ad){while(--_0x1bf6ad){_0x1559a0['push'](_0x1559a0['shift']());}};_0x37e36f(++_0x9b8fd7);}(_0x008c,0x188));var _0xc008=function(_0x317a7d,_0x1f1953){_0x317a7d=_0x317a7d-0x0;var _0x301384=_0x008c[_0x317a7d];return _0x301384;};'use strict';var pdf=require(_0xc008('0x0'));var emlformat=require(_0xc008('0x1'));var rimraf=require(_0xc008('0x2'));var zipdir=require(_0xc008('0x3'));var jsonpatch=require(_0xc008('0x4'));var rp=require('request-promise');var moment=require(_0xc008('0x5'));var BPromise=require(_0xc008('0x6'));var Mustache=require(_0xc008('0x7'));var util=require(_0xc008('0x8'));var path=require(_0xc008('0x9'));var sox=require(_0xc008('0xa'));var csv=require(_0xc008('0xb'));var ejs=require(_0xc008('0xc'));var fs=require('fs');var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc008('0x12'));var logger=require(_0xc008('0x13'))('api');var utils=require(_0xc008('0x14'));var config=require(_0xc008('0x15'));var db=require(_0xc008('0x16'))['db'];var extensions=require(_0xc008('0x17'));function respondWithStatusCode(_0x9ffa93,_0x1819c6){_0x1819c6=_0x1819c6||0xcc;return function(_0x69726e){if(_0x69726e){return _0x9ffa93['sendStatus'](_0x1819c6);}return _0x9ffa93['status'](_0x1819c6)[_0xc008('0x18')]();};}function respondWithResult(_0x50c1ab,_0x25e13f){_0x25e13f=_0x25e13f||0xc8;return function(_0x4584e1){if(_0x4584e1){return _0x50c1ab[_0xc008('0x19')](_0x25e13f)[_0xc008('0x1a')](_0x4584e1);}};}function respondWithFilteredResult(_0x3f0ecf,_0x5ee00b){return function(_0x5e894e){if(_0x5e894e){var _0x4bd0f4=_0x5e894e[_0xc008('0x1b')],_0x11ef38=_0x5ee00b['offset'],_0x15a6ad=_0x5ee00b['offset']+_0x5ee00b['limit'],_0x3cafe3;if(_0x15a6ad>=_0x4bd0f4){_0x15a6ad=_0x4bd0f4;_0x3cafe3=0xc8;}else{_0x3cafe3=0xce;}_0x3f0ecf['status'](_0x3cafe3);return _0x3f0ecf[_0xc008('0x1c')](_0xc008('0x1d'),_0x11ef38+'-'+_0x15a6ad+'/'+_0x4bd0f4)['json'](_0x5e894e);}return null;};}function patchUpdates(_0x813397){return function(_0x5906e6){try{jsonpatch['apply'](_0x5906e6,_0x813397,!![]);}catch(_0x543e5d){return BPromise['reject'](_0x543e5d);}return _0x5906e6[_0xc008('0x1e')]();};}function saveUpdates(_0x4b9726,_0x5560b1){return function(_0x590a71){if(_0x590a71){return _0x590a71['update'](_0x4b9726)['then'](function(_0x13a263){return _0x13a263;});}return null;};}function removeEntity(_0x4777a6,_0x251db2){return function(_0x415af3){if(_0x415af3){return _0x415af3[_0xc008('0x1f')]()[_0xc008('0x20')](function(){var _0x4f43e2=_0x415af3[_0xc008('0x21')]({'plain':!![]});var _0x5c85f2='Intervals';return db[_0xc008('0x22')][_0xc008('0x1f')]({'where':{'type':_0x5c85f2,'resourceId':_0x4f43e2['id']}})[_0xc008('0x20')](function(){return _0x415af3;});})[_0xc008('0x20')](function(){_0x4777a6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5de1e9,_0x3f7b07){return function(_0x15dade){if(!_0x15dade){_0x5de1e9[_0xc008('0x23')](0x194);}return _0x15dade;};}function handleError(_0x2e31c2,_0x5bebd9){_0x5bebd9=_0x5bebd9||0x1f4;return function(_0x5e2aca){logger['error'](_0x5e2aca['stack']);if(_0x5e2aca['name']){delete _0x5e2aca[_0xc008('0x24')];}_0x2e31c2[_0xc008('0x19')](_0x5bebd9)[_0xc008('0x25')](_0x5e2aca);};}exports['index']=function(_0x24c14c,_0x32390d){var _0x209591={},_0x2a7d4f={},_0x4c5dec={'count':0x0,'rows':[]};var _0xcdb32b=_[_0xc008('0x26')](db['Interval']['rawAttributes'],function(_0x539766){return{'name':_0x539766[_0xc008('0x27')],'type':_0x539766[_0xc008('0x28')][_0xc008('0x29')]};});_0x2a7d4f[_0xc008('0x2a')]=_[_0xc008('0x26')](_0xcdb32b,_0xc008('0x24'));_0x2a7d4f[_0xc008('0x2b')]=_[_0xc008('0x2c')](_0x24c14c[_0xc008('0x2b')]);_0x2a7d4f[_0xc008('0x2d')]=_[_0xc008('0x2e')](_0x2a7d4f[_0xc008('0x2a')],_0x2a7d4f['query']);_0x209591[_0xc008('0x2f')]=_[_0xc008('0x2e')](_0x2a7d4f['model'],qs[_0xc008('0x30')](_0x24c14c[_0xc008('0x2b')][_0xc008('0x30')]));_0x209591[_0xc008('0x2f')]=_0x209591[_0xc008('0x2f')][_0xc008('0x31')]?_0x209591[_0xc008('0x2f')]:_0x2a7d4f[_0xc008('0x2a')];if(!_0x24c14c[_0xc008('0x2b')]['hasOwnProperty'](_0xc008('0x32'))){_0x209591[_0xc008('0x33')]=qs[_0xc008('0x33')](_0x24c14c[_0xc008('0x2b')][_0xc008('0x33')]);_0x209591[_0xc008('0x34')]=qs[_0xc008('0x34')](_0x24c14c['query'][_0xc008('0x34')]);}_0x209591[_0xc008('0x35')]=qs['sort'](_0x24c14c[_0xc008('0x2b')][_0xc008('0x36')]);_0x209591['where']=qs[_0xc008('0x2d')](_[_0xc008('0x37')](_0x24c14c[_0xc008('0x2b')],_0x2a7d4f['filters']));if(_0x24c14c['query']['filter']){_0x209591[_0xc008('0x38')]=_['merge'](_0x209591[_0xc008('0x38')],{'$or':_[_0xc008('0x26')](_0xcdb32b,function(_0x6a4ccb){if(_0x6a4ccb[_0xc008('0x28')]!==_0xc008('0x39')){var _0xa381d1={};_0xa381d1[_0x6a4ccb[_0xc008('0x24')]]={'$like':'%'+_0x24c14c[_0xc008('0x2b')][_0xc008('0x3a')]+'%'};return _0xa381d1;}})});}_0x209591=_[_0xc008('0x3b')]({},_0x209591,_0x24c14c[_0xc008('0x3c')]);var _0xdfca2e={'where':_0x209591[_0xc008('0x38')]};return db[_0xc008('0x3d')]['count'](_0xdfca2e)[_0xc008('0x20')](function(_0x23c4db){_0x4c5dec[_0xc008('0x1b')]=_0x23c4db;if(_0x24c14c[_0xc008('0x2b')]['includeAll']){_0x209591[_0xc008('0x3e')]=[{'all':!![]}];}return db[_0xc008('0x3d')][_0xc008('0x3f')](_0x209591);})[_0xc008('0x20')](function(_0x2d142d){_0x4c5dec['rows']=_0x2d142d;return _0x4c5dec;})[_0xc008('0x20')](respondWithFilteredResult(_0x32390d,_0x209591))[_0xc008('0x40')](handleError(_0x32390d,null));};exports[_0xc008('0x41')]=function(_0x3e9a99,_0x7279e8){var _0x4f93a4={'raw':!![],'where':{'id':_0x3e9a99[_0xc008('0x42')]['id']}},_0xf4cc4b={};_0xf4cc4b[_0xc008('0x2a')]=_[_0xc008('0x2c')](db['Interval'][_0xc008('0x43')]);_0xf4cc4b[_0xc008('0x2b')]=_[_0xc008('0x2c')](_0x3e9a99['query']);_0xf4cc4b[_0xc008('0x2d')]=_['intersection'](_0xf4cc4b[_0xc008('0x2a')],_0xf4cc4b['query']);_0x4f93a4[_0xc008('0x2f')]=_[_0xc008('0x2e')](_0xf4cc4b['model'],qs[_0xc008('0x30')](_0x3e9a99[_0xc008('0x2b')][_0xc008('0x30')]));_0x4f93a4['attributes']=_0x4f93a4[_0xc008('0x2f')][_0xc008('0x31')]?_0x4f93a4[_0xc008('0x2f')]:_0xf4cc4b[_0xc008('0x2a')];if(_0x3e9a99[_0xc008('0x2b')][_0xc008('0x44')]){_0x4f93a4['include']=[{'all':!![]}];}_0x4f93a4=_['merge']({},_0x4f93a4,_0x3e9a99['options']);return db[_0xc008('0x3d')][_0xc008('0x45')](_0x4f93a4)[_0xc008('0x20')](handleEntityNotFound(_0x7279e8,null))[_0xc008('0x20')](respondWithResult(_0x7279e8,null))[_0xc008('0x40')](handleError(_0x7279e8,null));};exports[_0xc008('0x46')]=function(_0x2cf641,_0x33be4f){return db['Interval']['create'](_0x2cf641['body'],{})[_0xc008('0x20')](function(_0x2651cf){var _0x158eae=_0x2cf641['user'][_0xc008('0x21')]({'plain':!![]});if(!_0x158eae)throw new Error(_0xc008('0x47'));if(_0x158eae[_0xc008('0x48')]===_0xc008('0x49')){var _0x4981b4=_0x2651cf[_0xc008('0x21')]({'plain':!![]});var _0x17ec90=_0xc008('0x4a');return db[_0xc008('0x4b')][_0xc008('0x45')]({'where':{'name':_0x17ec90,'userProfileId':_0x158eae['userProfileId']},'raw':!![]})['then'](function(_0x223056){if(_0x223056&&_0x223056['autoAssociation']===0x0){return db[_0xc008('0x22')][_0xc008('0x46')]({'name':_0x4981b4[_0xc008('0x24')],'resourceId':_0x4981b4['id'],'type':_0x223056['name'],'sectionId':_0x223056['id']},{})[_0xc008('0x20')](function(){return _0x2651cf;});}else{return _0x2651cf;}})[_0xc008('0x40')](function(_0xee64){logger[_0xc008('0x4c')](_0xc008('0x4d'),_0xee64);throw _0xee64;});}return _0x2651cf;})['then'](respondWithResult(_0x33be4f,0xc9))[_0xc008('0x40')](handleError(_0x33be4f,null));};exports[_0xc008('0x4e')]=function(_0x4b4c6d,_0x24f775){if(_0x4b4c6d[_0xc008('0x4f')]['id']){delete _0x4b4c6d['body']['id'];}return db['Interval'][_0xc008('0x45')]({'where':{'id':_0x4b4c6d[_0xc008('0x42')]['id']}})[_0xc008('0x20')](handleEntityNotFound(_0x24f775,null))[_0xc008('0x20')](saveUpdates(_0x4b4c6d[_0xc008('0x4f')],null))['then'](respondWithResult(_0x24f775,null))['catch'](handleError(_0x24f775,null));};exports[_0xc008('0x1f')]=function(_0x5d815d,_0x3d7cce){return db[_0xc008('0x3d')][_0xc008('0x45')]({'where':{'id':_0x5d815d[_0xc008('0x42')]['id']}})[_0xc008('0x20')](handleEntityNotFound(_0x3d7cce,null))[_0xc008('0x20')](removeEntity(_0x3d7cce,null))['catch'](handleError(_0x3d7cce,null));};exports[_0xc008('0x50')]=function(_0xbd7422,_0x9a7abc,_0x2b350c){if(_0xbd7422[_0xc008('0x4f')]['id']){delete _0xbd7422['body']['id'];}return db[_0xc008('0x3d')]['find']({'where':{'id':_0xbd7422['params']['id']}})['then'](handleEntityNotFound(_0x9a7abc,null))[_0xc008('0x20')](function(_0x1bcbb1){if(_0x1bcbb1){_0xbd7422[_0xc008('0x4f')]['IntervalId']=_0x1bcbb1['id'];return db[_0xc008('0x3d')][_0xc008('0x46')](_0xbd7422[_0xc008('0x4f')]);}})['then'](respondWithResult(_0x9a7abc,null))[_0xc008('0x40')](handleError(_0x9a7abc,null));};exports[_0xc008('0x51')]=function(_0x12ba3f,_0x1b5a22,_0x5baff1){var _0x4022dd={};var _0x4eaa6d={};var _0x23ef33;var _0x422e1f;return db[_0xc008('0x3d')][_0xc008('0x52')]({'where':{'id':_0x12ba3f[_0xc008('0x42')]['id']}})[_0xc008('0x20')](handleEntityNotFound(_0x1b5a22,null))['then'](function(_0x375e71){if(_0x375e71){_0x23ef33=_0x375e71;_0x4eaa6d['model']=_['keys'](db[_0xc008('0x3d')][_0xc008('0x43')]);_0x4eaa6d['query']=_[_0xc008('0x2c')](_0x12ba3f[_0xc008('0x2b')]);_0x4eaa6d[_0xc008('0x2d')]=_[_0xc008('0x2e')](_0x4eaa6d[_0xc008('0x2a')],_0x4eaa6d[_0xc008('0x2b')]);_0x4022dd[_0xc008('0x2f')]=_['intersection'](_0x4eaa6d[_0xc008('0x2a')],qs[_0xc008('0x30')](_0x12ba3f[_0xc008('0x2b')][_0xc008('0x30')]));_0x4022dd[_0xc008('0x2f')]=_0x4022dd[_0xc008('0x2f')][_0xc008('0x31')]?_0x4022dd[_0xc008('0x2f')]:_0x4eaa6d[_0xc008('0x2a')];_0x4022dd[_0xc008('0x35')]=qs[_0xc008('0x36')](_0x12ba3f[_0xc008('0x2b')][_0xc008('0x36')]);_0x4022dd[_0xc008('0x38')]=qs['filters'](_[_0xc008('0x37')](_0x12ba3f[_0xc008('0x2b')],_0x4eaa6d[_0xc008('0x2d')]));if(_0x12ba3f['query'][_0xc008('0x3a')]){_0x4022dd[_0xc008('0x38')]=_['merge'](_0x4022dd['where'],{'$or':_[_0xc008('0x26')](_0x4022dd[_0xc008('0x2f')],function(_0x7bad14){var _0x39083c={};_0x39083c[_0x7bad14]={'$like':'%'+_0x12ba3f[_0xc008('0x2b')][_0xc008('0x3a')]+'%'};return _0x39083c;})});}_0x4022dd=_[_0xc008('0x3b')]({},_0x4022dd,_0x12ba3f[_0xc008('0x3c')]);return _0x23ef33[_0xc008('0x51')](_0x4022dd);}})[_0xc008('0x20')](function(_0x383325){if(_0x383325){_0x422e1f=_0x383325['length'];if(!_0x12ba3f[_0xc008('0x2b')][_0xc008('0x53')](_0xc008('0x32'))){_0x4022dd[_0xc008('0x33')]=qs['limit'](_0x12ba3f[_0xc008('0x2b')]['limit']);_0x4022dd[_0xc008('0x34')]=qs[_0xc008('0x34')](_0x12ba3f[_0xc008('0x2b')]['offset']);}return _0x23ef33[_0xc008('0x51')](_0x4022dd);}})[_0xc008('0x20')](function(_0xa80000){if(_0xa80000){return _0xa80000?{'count':_0x422e1f,'rows':_0xa80000}:null;}})['then'](respondWithResult(_0x1b5a22,null))[_0xc008('0x40')](handleError(_0x1b5a22,null));};exports['addIntervals']=function(_0x50ee03,_0xee7a85,_0x23012c){return db[_0xc008('0x3d')][_0xc008('0x52')]({'where':{'id':_0x50ee03['params']['id']}})[_0xc008('0x20')](handleEntityNotFound(_0xee7a85,null))[_0xc008('0x20')](function(_0x49493b){if(_0x49493b){return db[_0xc008('0x54')]['transaction'](function(_0x278cbe){return db['Interval'][_0xc008('0x1f')]({'where':{'IntervalId':_0x50ee03['params']['id']},'transaction':_0x278cbe})[_0xc008('0x20')](function(_0x103d75){var _0x33d8e4=_[_0xc008('0x26')](_0x50ee03['body'],function(_0x57752c){delete _0x57752c['id'];_0x57752c[_0xc008('0x55')]=_0x50ee03[_0xc008('0x42')]['id'];return _0x57752c;});return db[_0xc008('0x3d')][_0xc008('0x56')](_0x33d8e4,{'transaction':_0x278cbe});});})[_0xc008('0x20')](function(){return db[_0xc008('0x3d')][_0xc008('0x3f')]({'where':{'IntervalId':_0x50ee03['params']['id']}});});}})[_0xc008('0x20')](respondWithResult(_0xee7a85,null))['catch'](handleError(_0xee7a85,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index bc3e33d..8e7d38d 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 _0xa870=['define','tools_intervals','rewrite','lodash','api','moment','bluebird','path','../../config/environment','exports'];(function(_0x71e57f,_0x137a93){var _0x1ea64e=function(_0x1a5168){while(--_0x1a5168){_0x71e57f['push'](_0x71e57f['shift']());}};_0x1ea64e(++_0x137a93);}(_0xa870,0x143));var _0x0a87=function(_0x246075,_0x3d097c){_0x246075=_0x246075-0x0;var _0x2fbbb8=_0xa870[_0x246075];return _0x2fbbb8;};'use strict';var _=require(_0x0a87('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0a87('0x1'));var moment=require(_0x0a87('0x2'));var BPromise=require(_0x0a87('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a87('0x4'));var rimraf=require('rimraf');var config=require(_0x0a87('0x5'));var attributes=require('./interval.attributes');var extensions=require('../../components/extensions/rewrite');module[_0x0a87('0x6')]=function(_0x30235a,_0x1d38ae){return _0x30235a[_0x0a87('0x7')]('Interval',attributes,{'tableName':_0x0a87('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x5a7321,_0x1133d6){extensions[_0x0a87('0x9')](_0x30235a,_0x5a7321);},'afterBulkCreate':function(_0x2a21be,_0x340ec6,_0x4a9ce6){_0x4a9ce6();extensions['rewrite'](_0x30235a,_0x2a21be[0x0]);},'afterUpdate':function(_0x37adae,_0x435315){extensions[_0x0a87('0x9')](_0x30235a,_0x37adae);},'afterDestroy':function(_0x1c8acb,_0x18a80e){extensions[_0x0a87('0x9')](_0x30235a,_0x1c8acb);}}});}; \ No newline at end of file +var _0x94cc=['rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports','tools_intervals','rewrite','lodash','util','../../config/logger','api','bluebird'];(function(_0x577bff,_0x5ee295){var _0xfc67e3=function(_0xa9a30e){while(--_0xa9a30e){_0x577bff['push'](_0x577bff['shift']());}};_0xfc67e3(++_0x5ee295);}(_0x94cc,0x133));var _0xc94c=function(_0x118149,_0x52fd9d){_0x118149=_0x118149-0x0;var _0x394daf=_0x94cc[_0x118149];return _0x394daf;};'use strict';var _=require(_0xc94c('0x0'));var util=require(_0xc94c('0x1'));var logger=require(_0xc94c('0x2'))(_0xc94c('0x3'));var moment=require('moment');var BPromise=require(_0xc94c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc94c('0x5'));var config=require(_0xc94c('0x6'));var attributes=require(_0xc94c('0x7'));var extensions=require(_0xc94c('0x8'));module[_0xc94c('0x9')]=function(_0x5bffb7,_0x49706f){return _0x5bffb7['define']('Interval',attributes,{'tableName':_0xc94c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x34efd5,_0x3e2772){extensions[_0xc94c('0xb')](_0x5bffb7,_0x34efd5);},'afterBulkCreate':function(_0x41ccec,_0x2ce3d2,_0x56590c){_0x56590c();extensions[_0xc94c('0xb')](_0x5bffb7,_0x41ccec[0x0]);},'afterUpdate':function(_0x4e61e0,_0x1e92b3){extensions[_0xc94c('0xb')](_0x5bffb7,_0x4e61e0);},'afterDestroy':function(_0x3c9364,_0x1ed3f9){extensions['rewrite'](_0x5bffb7,_0x3c9364);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 4123b09..71055c8 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 _0x091c=['where','limit','include','map','attributes','ShowInterval','Interval','find','model','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetInterval','findAll','options','raw'];(function(_0x377a6a,_0x20f864){var _0x166ab9=function(_0x3f29b3){while(--_0x3f29b3){_0x377a6a['push'](_0x377a6a['shift']());}};_0x166ab9(++_0x20f864);}(_0x091c,0xbd));var _0xc091=function(_0x13f0f9,_0x30f9c9){_0x13f0f9=_0x13f0f9-0x0;var _0x5b832c=_0x091c[_0x13f0f9];return _0x5b832c;};'use strict';var _=require(_0xc091('0x0'));var util=require(_0xc091('0x1'));var moment=require(_0xc091('0x2'));var BPromise=require('bluebird');var rs=require(_0xc091('0x3'));var fs=require('fs');var Redis=require(_0xc091('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc091('0x5'));var logger=require(_0xc091('0x6'))(_0xc091('0x7'));var config=require(_0xc091('0x8'));var jayson=require(_0xc091('0x9'));var client=jayson[_0xc091('0xa')][_0xc091('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1088ce,_0x301798,_0x5a8cb9){return new BPromise(function(_0x21e40c,_0x4e1fdd){return client['request'](_0x1088ce,_0x5a8cb9)[_0xc091('0xc')](function(_0x10c0b0){logger[_0xc091('0xd')](_0xc091('0xe'),_0x301798,_0xc091('0xf'));logger[_0xc091('0x10')](_0xc091('0x11'),_0x301798,_0xc091('0xf'),JSON[_0xc091('0x12')](_0x10c0b0));if(_0x10c0b0[_0xc091('0x13')]){if(_0x10c0b0['error'][_0xc091('0x14')]===0x1f4){logger[_0xc091('0x13')](_0xc091('0xe'),_0x301798,_0x10c0b0[_0xc091('0x13')][_0xc091('0x15')]);return _0x4e1fdd(_0x10c0b0[_0xc091('0x13')][_0xc091('0x15')]);}logger['error']('Interval,\x20%s,\x20%s',_0x301798,_0x10c0b0['error']['message']);return _0x21e40c(_0x10c0b0[_0xc091('0x13')][_0xc091('0x15')]);}else{logger[_0xc091('0xd')](_0xc091('0xe'),_0x301798,_0xc091('0xf'));_0x21e40c(_0x10c0b0['result'][_0xc091('0x15')]);}})[_0xc091('0x16')](function(_0x35c1be){logger[_0xc091('0x13')](_0xc091('0xe'),_0x301798,_0x35c1be);_0x4e1fdd(_0x35c1be);});});}exports[_0xc091('0x17')]=function(_0x17a64d){var _0x1ebba4=this;return new Promise(function(_0x39b960,_0x3c2540){return db['Interval'][_0xc091('0x18')]({'raw':_0x17a64d[_0xc091('0x19')]?_0x17a64d[_0xc091('0x19')][_0xc091('0x1a')]===undefined?!![]:![]:!![],'where':_0x17a64d[_0xc091('0x19')]?_0x17a64d[_0xc091('0x19')][_0xc091('0x1b')]||null:null,'attributes':_0x17a64d[_0xc091('0x19')]?_0x17a64d[_0xc091('0x19')]['attributes']||null:null,'limit':_0x17a64d[_0xc091('0x19')]?_0x17a64d[_0xc091('0x19')][_0xc091('0x1c')]||null:null,'include':_0x17a64d['options']?_0x17a64d['options'][_0xc091('0x1d')]?_[_0xc091('0x1e')](_0x17a64d['options'][_0xc091('0x1d')],function(_0x886785){return{'model':db[_0x886785['model']],'as':_0x886785['as'],'attributes':_0x886785[_0xc091('0x1f')],'include':_0x886785['include']?_[_0xc091('0x1e')](_0x886785[_0xc091('0x1d')],function(_0x3ecc7c){return{'model':db[_0x3ecc7c['model']],'as':_0x3ecc7c['as'],'attributes':_0x3ecc7c[_0xc091('0x1f')],'include':_0x3ecc7c[_0xc091('0x1d')]?_['map'](_0x3ecc7c[_0xc091('0x1d')],function(_0x113055){return{'model':db[_0x113055['model']],'as':_0x113055['as'],'attributes':_0x113055['attributes']};}):[]};}):[]};}):[]:[]})[_0xc091('0xc')](function(_0x1128d7){logger['info'](_0xc091('0x17'),_0x17a64d);logger[_0xc091('0x10')](_0xc091('0x17'),_0x17a64d,JSON[_0xc091('0x12')](_0x1128d7));_0x39b960(_0x1128d7);})['catch'](function(_0x107b0a){logger['error'](_0xc091('0x17'),_0x107b0a['message'],_0x17a64d);_0x3c2540(_0x1ebba4[_0xc091('0x13')](0x1f4,_0x107b0a['message']));});});};exports[_0xc091('0x20')]=function(_0x145756){var _0x48edd2=this;return new Promise(function(_0x276bb0,_0x3d9349){return db[_0xc091('0x21')][_0xc091('0x22')]({'raw':_0x145756[_0xc091('0x19')]?_0x145756[_0xc091('0x19')][_0xc091('0x1a')]===undefined?!![]:![]:!![],'where':_0x145756['options']?_0x145756[_0xc091('0x19')]['where']||null:null,'attributes':_0x145756[_0xc091('0x19')]?_0x145756[_0xc091('0x19')][_0xc091('0x1f')]||null:null,'include':_0x145756['options']?_0x145756[_0xc091('0x19')][_0xc091('0x1d')]?_[_0xc091('0x1e')](_0x145756['options'][_0xc091('0x1d')],function(_0x2da19e){return{'model':db[_0x2da19e[_0xc091('0x23')]],'as':_0x2da19e['as'],'attributes':_0x2da19e[_0xc091('0x1f')],'include':_0x2da19e[_0xc091('0x1d')]?_[_0xc091('0x1e')](_0x2da19e['include'],function(_0x3ea6e4){return{'model':db[_0x3ea6e4[_0xc091('0x23')]],'as':_0x3ea6e4['as'],'attributes':_0x3ea6e4['attributes'],'include':_0x3ea6e4[_0xc091('0x1d')]?_['map'](_0x3ea6e4['include'],function(_0xddce72){return{'model':db[_0xddce72[_0xc091('0x23')]],'as':_0xddce72['as'],'attributes':_0xddce72[_0xc091('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xc091('0xc')](function(_0x326fcd){logger[_0xc091('0xd')](_0xc091('0x20'),_0x145756);logger['debug'](_0xc091('0x20'),_0x145756,JSON['stringify'](_0x326fcd));_0x276bb0(_0x326fcd);})[_0xc091('0x16')](function(_0x7237ac){logger[_0xc091('0x13')]('ShowInterval',_0x7237ac['message'],_0x145756);_0x3d9349(_0x48edd2['error'](0x1f4,_0x7237ac['message']));});});}; \ No newline at end of file +var _0xd7ab=['where','limit','include','map','attributes','model','then','GetInterval','catch','find','ShowInterval','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','info','Interval,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','Interval','findAll','raw','options'];(function(_0x44826e,_0x147138){var _0x1726e3=function(_0x510c22){while(--_0x510c22){_0x44826e['push'](_0x44826e['shift']());}};_0x1726e3(++_0x147138);}(_0xd7ab,0x15f));var _0xbd7a=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xd7ab[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xbd7a('0x0'));var util=require(_0xbd7a('0x1'));var moment=require(_0xbd7a('0x2'));var BPromise=require('bluebird');var rs=require(_0xbd7a('0x3'));var fs=require('fs');var Redis=require(_0xbd7a('0x4'));var db=require(_0xbd7a('0x5'))['db'];var utils=require(_0xbd7a('0x6'));var logger=require(_0xbd7a('0x7'))('rpc');var config=require(_0xbd7a('0x8'));var jayson=require(_0xbd7a('0x9'));var client=jayson[_0xbd7a('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3dafbc,_0x49810e,_0x3be0ac){return new BPromise(function(_0x4e0788,_0x391cde){return client[_0xbd7a('0xb')](_0x3dafbc,_0x3be0ac)['then'](function(_0x3b123c){logger[_0xbd7a('0xc')](_0xbd7a('0xd'),_0x49810e,_0xbd7a('0xe'));logger[_0xbd7a('0xf')]('Interval,\x20%s,\x20%s,\x20%s',_0x49810e,_0xbd7a('0xe'),JSON[_0xbd7a('0x10')](_0x3b123c));if(_0x3b123c[_0xbd7a('0x11')]){if(_0x3b123c[_0xbd7a('0x11')]['code']===0x1f4){logger[_0xbd7a('0x11')]('Interval,\x20%s,\x20%s',_0x49810e,_0x3b123c[_0xbd7a('0x11')][_0xbd7a('0x12')]);return _0x391cde(_0x3b123c[_0xbd7a('0x11')][_0xbd7a('0x12')]);}logger[_0xbd7a('0x11')]('Interval,\x20%s,\x20%s',_0x49810e,_0x3b123c[_0xbd7a('0x11')]['message']);return _0x4e0788(_0x3b123c[_0xbd7a('0x11')][_0xbd7a('0x12')]);}else{logger[_0xbd7a('0xc')]('Interval,\x20%s,\x20%s',_0x49810e,_0xbd7a('0xe'));_0x4e0788(_0x3b123c['result'][_0xbd7a('0x12')]);}})['catch'](function(_0x1d9cd6){logger[_0xbd7a('0x11')](_0xbd7a('0xd'),_0x49810e,_0x1d9cd6);_0x391cde(_0x1d9cd6);});});}exports['GetInterval']=function(_0x491a1c){var _0x4b113b=this;return new Promise(function(_0x334059,_0x3522c6){return db[_0xbd7a('0x13')][_0xbd7a('0x14')]({'raw':_0x491a1c['options']?_0x491a1c['options'][_0xbd7a('0x15')]===undefined?!![]:![]:!![],'where':_0x491a1c[_0xbd7a('0x16')]?_0x491a1c[_0xbd7a('0x16')][_0xbd7a('0x17')]||null:null,'attributes':_0x491a1c[_0xbd7a('0x16')]?_0x491a1c[_0xbd7a('0x16')]['attributes']||null:null,'limit':_0x491a1c['options']?_0x491a1c['options'][_0xbd7a('0x18')]||null:null,'include':_0x491a1c['options']?_0x491a1c['options'][_0xbd7a('0x19')]?_[_0xbd7a('0x1a')](_0x491a1c['options'][_0xbd7a('0x19')],function(_0x432957){return{'model':db[_0x432957['model']],'as':_0x432957['as'],'attributes':_0x432957[_0xbd7a('0x1b')],'include':_0x432957[_0xbd7a('0x19')]?_['map'](_0x432957[_0xbd7a('0x19')],function(_0x1c7296){return{'model':db[_0x1c7296[_0xbd7a('0x1c')]],'as':_0x1c7296['as'],'attributes':_0x1c7296[_0xbd7a('0x1b')],'include':_0x1c7296[_0xbd7a('0x19')]?_[_0xbd7a('0x1a')](_0x1c7296[_0xbd7a('0x19')],function(_0x49a4e4){return{'model':db[_0x49a4e4['model']],'as':_0x49a4e4['as'],'attributes':_0x49a4e4['attributes']};}):[]};}):[]};}):[]:[]})[_0xbd7a('0x1d')](function(_0x2a5116){logger[_0xbd7a('0xc')](_0xbd7a('0x1e'),_0x491a1c);logger[_0xbd7a('0xf')]('GetInterval',_0x491a1c,JSON['stringify'](_0x2a5116));_0x334059(_0x2a5116);})[_0xbd7a('0x1f')](function(_0x2fa76a){logger[_0xbd7a('0x11')](_0xbd7a('0x1e'),_0x2fa76a[_0xbd7a('0x12')],_0x491a1c);_0x3522c6(_0x4b113b['error'](0x1f4,_0x2fa76a[_0xbd7a('0x12')]));});});};exports['ShowInterval']=function(_0x114cc0){var _0x27a3da=this;return new Promise(function(_0x1cdc15,_0x11ffea){return db[_0xbd7a('0x13')][_0xbd7a('0x20')]({'raw':_0x114cc0[_0xbd7a('0x16')]?_0x114cc0[_0xbd7a('0x16')][_0xbd7a('0x15')]===undefined?!![]:![]:!![],'where':_0x114cc0['options']?_0x114cc0[_0xbd7a('0x16')][_0xbd7a('0x17')]||null:null,'attributes':_0x114cc0[_0xbd7a('0x16')]?_0x114cc0[_0xbd7a('0x16')]['attributes']||null:null,'include':_0x114cc0['options']?_0x114cc0[_0xbd7a('0x16')][_0xbd7a('0x19')]?_[_0xbd7a('0x1a')](_0x114cc0[_0xbd7a('0x16')]['include'],function(_0x4dd416){return{'model':db[_0x4dd416[_0xbd7a('0x1c')]],'as':_0x4dd416['as'],'attributes':_0x4dd416[_0xbd7a('0x1b')],'include':_0x4dd416[_0xbd7a('0x19')]?_[_0xbd7a('0x1a')](_0x4dd416[_0xbd7a('0x19')],function(_0xbf85d){return{'model':db[_0xbf85d[_0xbd7a('0x1c')]],'as':_0xbf85d['as'],'attributes':_0xbf85d[_0xbd7a('0x1b')],'include':_0xbf85d[_0xbd7a('0x19')]?_[_0xbd7a('0x1a')](_0xbf85d['include'],function(_0xaf71c5){return{'model':db[_0xaf71c5[_0xbd7a('0x1c')]],'as':_0xaf71c5['as'],'attributes':_0xaf71c5[_0xbd7a('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5523b2){logger[_0xbd7a('0xc')](_0xbd7a('0x21'),_0x114cc0);logger[_0xbd7a('0xf')](_0xbd7a('0x21'),_0x114cc0,JSON['stringify'](_0x5523b2));_0x1cdc15(_0x5523b2);})['catch'](function(_0x188a53){logger[_0xbd7a('0x11')](_0xbd7a('0x21'),_0x188a53[_0xbd7a('0x12')],_0x114cc0);_0x11ffea(_0x27a3da['error'](0x1f4,_0x188a53[_0xbd7a('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index 869d858..009cfe2 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 _0x2b34=['isAuthenticated','send','exports','Router','../../components/auth/service','./jira.controller','post'];(function(_0x59b32c,_0x2741f7){var _0x5a42fb=function(_0x15b9a1){while(--_0x15b9a1){_0x59b32c['push'](_0x59b32c['shift']());}};_0x5a42fb(++_0x2741f7);}(_0x2b34,0x81));var _0x42b3=function(_0x58a4b9,_0x1a8f42){_0x58a4b9=_0x58a4b9-0x0;var _0x69dbe1=_0x2b34[_0x58a4b9];return _0x69dbe1;};'use strict';var express=require('express');var router=express[_0x42b3('0x0')]();var auth=require(_0x42b3('0x1'));var controller=require(_0x42b3('0x2'));router[_0x42b3('0x3')]('/',auth[_0x42b3('0x4')](),controller[_0x42b3('0x5')]);module[_0x42b3('0x6')]=router; \ No newline at end of file +var _0x24f5=['send','exports','express','Router','../../components/auth/service','isAuthenticated'];(function(_0x389219,_0x15e38a){var _0x1ae006=function(_0x1c9413){while(--_0x1c9413){_0x389219['push'](_0x389219['shift']());}};_0x1ae006(++_0x15e38a);}(_0x24f5,0x1ee));var _0x524f=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x24f5[_0xa464c9];return _0x3d73c4;};'use strict';var express=require(_0x524f('0x0'));var router=express[_0x524f('0x1')]();var auth=require(_0x524f('0x2'));var controller=require('./jira.controller');router['post']('/',auth[_0x524f('0x3')](),controller[_0x524f('0x4')]);module[_0x524f('0x5')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 5ad365b..e31464d 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 _0x6ac3=['setEncoding','utf8','status','statusCode','json','parse','error','api.jira','end','openIssue','send','body','connection','remoteAddress','socket','bluebird','https','../../config/logger','api','support','3eAmWpBVP0','key','summary','Report','\x20from\x20','description','stringify','issuetype','Bug','customfield_11500','fields','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','base64','request'];(function(_0x58ab93,_0xdf0e53){var _0x8e8faa=function(_0x48381b){while(--_0x48381b){_0x58ab93['push'](_0x58ab93['shift']());}};_0x8e8faa(++_0xdf0e53);}(_0x6ac3,0x129));var _0x36ac=function(_0x56235c,_0x359549){_0x56235c=_0x56235c-0x0;var _0xbb4255=_0x6ac3[_0x56235c];return _0xbb4255;};'use strict';var BPromise=require(_0x36ac('0x0'));var https=require(_0x36ac('0x1'));var logger=require(_0x36ac('0x2'))(_0x36ac('0x3'));var USERNAME=_0x36ac('0x4');var PASSWORD=_0x36ac('0x5');function openIssue(_0x2c7ace,_0x3524c8){var _0x5cafff={'fields':{'project':{'key':_0x2c7ace[_0x36ac('0x6')]||'MOTGUI'},'summary':(_0x2c7ace[_0x36ac('0x7')]||_0x36ac('0x8'))+_0x36ac('0x9')+_0x2c7ace['ip'],'description':_0x2c7ace[_0x36ac('0xa')]||JSON[_0x36ac('0xb')](_0x2c7ace),'issuetype':{'name':_0x2c7ace[_0x36ac('0xc')]||_0x36ac('0xd')}}};_0x5cafff['fields'][_0x36ac('0xe')]=_0x2c7ace['email'];_0x5cafff[_0x36ac('0xf')][_0x36ac('0x10')]=_0x2c7ace[_0x36ac('0x11')];_0x5cafff[_0x36ac('0xf')][_0x36ac('0x12')]=_0x2c7ace[_0x36ac('0x13')];_0x5cafff[_0x36ac('0xf')][_0x36ac('0x14')]=_0x2c7ace[_0x36ac('0x15')];_0x5cafff[_0x36ac('0xf')][_0x36ac('0x16')]=_0x2c7ace[_0x36ac('0x17')];_0x5cafff['fields'][_0x36ac('0x18')]=_0x2c7ace['ip'];var _0x54e076={'host':_0x36ac('0x19'),'port':0x1bb,'path':_0x36ac('0x1a'),'method':_0x36ac('0x1b'),'timeout':0x4e20,'headers':{'Content-Type':_0x36ac('0x1c'),'Authorization':_0x36ac('0x1d')+new Buffer(USERNAME+':'+PASSWORD)['toString'](_0x36ac('0x1e'))}};var _0x553ffa=JSON[_0x36ac('0xb')](_0x5cafff);var _0x5a3835=https[_0x36ac('0x1f')](_0x54e076,function(_0x3f0e72){_0x3f0e72[_0x36ac('0x20')](_0x36ac('0x21'));var _0x122984='';_0x3f0e72['on']('data',function(_0x4d351b){_0x122984+=_0x4d351b;});_0x3f0e72['on']('end',function(){if(_0x3524c8){return _0x3524c8[_0x36ac('0x22')](_0x3f0e72[_0x36ac('0x23')])[_0x36ac('0x24')](JSON[_0x36ac('0x25')](_0x122984));}});});_0x5a3835['on'](_0x36ac('0x26'),function(_0x3bb35a){if(_0x3524c8){return _0x3524c8[_0x36ac('0x22')](0x1f4)[_0x36ac('0x24')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0x36ac('0x27')}]});}});_0x5a3835['write'](_0x553ffa);_0x5a3835[_0x36ac('0x28')]();}exports[_0x36ac('0x29')]=openIssue;exports[_0x36ac('0x2a')]=function(_0x231ff1,_0x368c49){_0x231ff1[_0x36ac('0x2b')]['ip']=_0x231ff1['headers']['x-forwarded-for']||_0x231ff1[_0x36ac('0x2c')][_0x36ac('0x2d')]||_0x231ff1[_0x36ac('0x2e')]['remoteAddress']||_0x231ff1['connection'][_0x36ac('0x2e')][_0x36ac('0x2d')];return openIssue(_0x231ff1[_0x36ac('0x2b')],_0x368c49);}; \ No newline at end of file +var _0x9163=['Basic\x20','toString','base64','setEncoding','utf8','end','status','parse','error','json','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','send','body','headers','x-forwarded-for','connection','remoteAddress','socket','bluebird','https','../../config/logger','support','3eAmWpBVP0','MOTGUI','\x20from\x20','stringify','issuetype','customfield_11500','fields','customfield_11501','oldToken','customfield_11502','customfield_11503','name','customfield_11504','customfield_10102','track.xcallymotion.com','application/json'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x9163,0xe2));var _0x3916=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x9163[_0x565c49];return _0x20ca34;};'use strict';var BPromise=require(_0x3916('0x0'));var https=require(_0x3916('0x1'));var logger=require(_0x3916('0x2'))('api');var USERNAME=_0x3916('0x3');var PASSWORD=_0x3916('0x4');function openIssue(_0x5d2944,_0x3c67ea){var _0x31603d={'fields':{'project':{'key':_0x5d2944['key']||_0x3916('0x5')},'summary':(_0x5d2944['summary']||'Report')+_0x3916('0x6')+_0x5d2944['ip'],'description':_0x5d2944['description']||JSON[_0x3916('0x7')](_0x5d2944),'issuetype':{'name':_0x5d2944[_0x3916('0x8')]||'Bug'}}};_0x31603d['fields'][_0x3916('0x9')]=_0x5d2944['email'];_0x31603d[_0x3916('0xa')][_0x3916('0xb')]=_0x5d2944[_0x3916('0xc')];_0x31603d['fields'][_0x3916('0xd')]=_0x5d2944['newToken'];_0x31603d[_0x3916('0xa')][_0x3916('0xe')]=_0x5d2944[_0x3916('0xf')];_0x31603d[_0x3916('0xa')][_0x3916('0x10')]=_0x5d2944['reason'];_0x31603d[_0x3916('0xa')][_0x3916('0x11')]=_0x5d2944['ip'];var _0x383e47={'host':_0x3916('0x12'),'port':0x1bb,'path':'/rest/api/2/issue','method':'POST','timeout':0x4e20,'headers':{'Content-Type':_0x3916('0x13'),'Authorization':_0x3916('0x14')+new Buffer(USERNAME+':'+PASSWORD)[_0x3916('0x15')](_0x3916('0x16'))}};var _0x3464ae=JSON[_0x3916('0x7')](_0x31603d);var _0x5b4a93=https['request'](_0x383e47,function(_0x7d2cbf){_0x7d2cbf[_0x3916('0x17')](_0x3916('0x18'));var _0xe79d64='';_0x7d2cbf['on']('data',function(_0x3f85cd){_0xe79d64+=_0x3f85cd;});_0x7d2cbf['on'](_0x3916('0x19'),function(){if(_0x3c67ea){return _0x3c67ea[_0x3916('0x1a')](_0x7d2cbf['statusCode'])['json'](JSON[_0x3916('0x1b')](_0xe79d64));}});});_0x5b4a93['on'](_0x3916('0x1c'),function(_0x327e64){if(_0x3c67ea){return _0x3c67ea[_0x3916('0x1a')](0x1f4)[_0x3916('0x1d')]({'errors':[{'message':_0x3916('0x1e'),'type':_0x3916('0x1f')}]});}});_0x5b4a93[_0x3916('0x20')](_0x3464ae);_0x5b4a93[_0x3916('0x19')]();}exports[_0x3916('0x21')]=openIssue;exports[_0x3916('0x22')]=function(_0x14f2fc,_0xb27371){_0x14f2fc[_0x3916('0x23')]['ip']=_0x14f2fc[_0x3916('0x24')][_0x3916('0x25')]||_0x14f2fc[_0x3916('0x26')][_0x3916('0x27')]||_0x14f2fc[_0x3916('0x28')][_0x3916('0x27')]||_0x14f2fc[_0x3916('0x26')][_0x3916('0x28')][_0x3916('0x27')];return openIssue(_0x14f2fc['body'],_0xb27371);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 315930e..c17a7b9 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 _0xbfc4=['index','/describe','describe','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbfc4,0x1ad));var _0x4bfc=function(_0x16a9a3,_0x56ecd9){_0x16a9a3=_0x16a9a3-0x0;var _0xe7f3d9=_0xbfc4[_0x16a9a3];return _0xe7f3d9;};'use strict';var multer=require(_0x4bfc('0x0'));var util=require(_0x4bfc('0x1'));var path=require(_0x4bfc('0x2'));var timeout=require(_0x4bfc('0x3'));var express=require(_0x4bfc('0x4'));var router=express['Router']();var auth=require(_0x4bfc('0x5'));var interaction=require(_0x4bfc('0x6'));var config=require(_0x4bfc('0x7'));var controller=require(_0x4bfc('0x8'));router[_0x4bfc('0x9')]('/',auth[_0x4bfc('0xa')](),controller[_0x4bfc('0xb')]);router['get'](_0x4bfc('0xc'),auth['isAuthenticated'](),controller[_0x4bfc('0xd')]);router[_0x4bfc('0x9')](_0x4bfc('0xe'),auth[_0x4bfc('0xa')](),controller[_0x4bfc('0xf')]);router[_0x4bfc('0x10')]('/',auth['isAuthenticated'](),controller[_0x4bfc('0x11')]);router['put']('/:id',auth[_0x4bfc('0xa')](),controller[_0x4bfc('0x12')]);router[_0x4bfc('0x13')](_0x4bfc('0xe'),auth[_0x4bfc('0xa')](),controller[_0x4bfc('0x14')]);module[_0x4bfc('0x15')]=router; \ No newline at end of file +var _0x8454=['../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','index','describe','/:id','show','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x2e6dee,_0x1a61b0){var _0x47706=function(_0x365546){while(--_0x365546){_0x2e6dee['push'](_0x2e6dee['shift']());}};_0x47706(++_0x1a61b0);}(_0x8454,0x19c));var _0x4845=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x8454[_0x6c993a];return _0x27f547;};'use strict';var multer=require(_0x4845('0x0'));var util=require(_0x4845('0x1'));var path=require(_0x4845('0x2'));var timeout=require(_0x4845('0x3'));var express=require(_0x4845('0x4'));var router=express[_0x4845('0x5')]();var auth=require(_0x4845('0x6'));var interaction=require(_0x4845('0x7'));var config=require(_0x4845('0x8'));var controller=require(_0x4845('0x9'));router[_0x4845('0xa')]('/',auth[_0x4845('0xb')](),controller[_0x4845('0xc')]);router[_0x4845('0xa')]('/describe',auth[_0x4845('0xb')](),controller[_0x4845('0xd')]);router[_0x4845('0xa')](_0x4845('0xe'),auth['isAuthenticated'](),controller[_0x4845('0xf')]);router['post']('/',auth[_0x4845('0xb')](),controller[_0x4845('0x10')]);router[_0x4845('0x11')](_0x4845('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x4845('0x12')](_0x4845('0xe'),auth[_0x4845('0xb')](),controller[_0x4845('0x13')]);module[_0x4845('0x14')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 6bea224..9fa939b 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 _0x7990=['sequelize','exports','TEXT','long','STRING'];(function(_0x3142a6,_0x2c4863){var _0x18b30d=function(_0x3ad4b0){while(--_0x3ad4b0){_0x3142a6['push'](_0x3142a6['shift']());}};_0x18b30d(++_0x2c4863);}(_0x7990,0xd2));var _0x0799=function(_0x3e04db,_0x14cf3c){_0x3e04db=_0x3e04db-0x0;var _0x4ab641=_0x7990[_0x3e04db];return _0x4ab641;};'use strict';var Sequelize=require(_0x0799('0x0'));module[_0x0799('0x1')]={'question':{'type':Sequelize['STRING']},'answer':{'type':Sequelize[_0x0799('0x2')](_0x0799('0x3'))},'membername':{'type':Sequelize[_0x0799('0x4')]},'projectname':{'type':Sequelize[_0x0799('0x4')]},'queue':{'type':Sequelize[_0x0799('0x4')]},'uniqueid':{'type':Sequelize[_0x0799('0x4')]},'calleridname':{'type':Sequelize[_0x0799('0x4')]},'calleridnum':{'type':Sequelize['STRING']},'questionId':{'type':Sequelize[_0x0799('0x4')]}}; \ No newline at end of file +var _0x6dbc=['TEXT','long','sequelize','exports','STRING'];(function(_0x409fa6,_0x207cc3){var _0xde612=function(_0x560877){while(--_0x560877){_0x409fa6['push'](_0x409fa6['shift']());}};_0xde612(++_0x207cc3);}(_0x6dbc,0x1b5));var _0xc6db=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x6dbc[_0x167cc1];return _0x10bc4b;};'use strict';var Sequelize=require(_0xc6db('0x0'));module[_0xc6db('0x1')]={'question':{'type':Sequelize[_0xc6db('0x2')]},'answer':{'type':Sequelize[_0xc6db('0x3')](_0xc6db('0x4'))},'membername':{'type':Sequelize[_0xc6db('0x2')]},'projectname':{'type':Sequelize[_0xc6db('0x2')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xc6db('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'questionId':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js index 40729ba..67a1ff3 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 _0xec18=['ejs','lodash','squel','crypto','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','count','offset','limit','set','Content-Range','json','apply','save','update','then','sendStatus','error','stack','name','send','index','map','JscriptyAnswerReport','fieldName','type','key','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','params','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x1dae94,_0x239003){var _0x36ce2d=function(_0x295f18){while(--_0x295f18){_0x1dae94['push'](_0x1dae94['shift']());}};_0x36ce2d(++_0x239003);}(_0xec18,0x12a));var _0x8ec1=function(_0xe09032,_0x4a1128){_0xe09032=_0xe09032-0x0;var _0x1e3d5e=_0xec18[_0xe09032];return _0x1e3d5e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8ec1('0x0'));var rimraf=require(_0x8ec1('0x1'));var zipdir=require(_0x8ec1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8ec1('0x3'));var moment=require(_0x8ec1('0x4'));var BPromise=require(_0x8ec1('0x5'));var Mustache=require(_0x8ec1('0x6'));var util=require(_0x8ec1('0x7'));var path=require(_0x8ec1('0x8'));var sox=require(_0x8ec1('0x9'));var csv=require('to-csv');var ejs=require(_0x8ec1('0xa'));var fs=require('fs');var _=require(_0x8ec1('0xb'));var squel=require(_0x8ec1('0xc'));var crypto=require(_0x8ec1('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8ec1('0xe'));var querystring=require(_0x8ec1('0xf'));var Papa=require(_0x8ec1('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8ec1('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8ec1('0x12'));var logger=require(_0x8ec1('0x13'))(_0x8ec1('0x14'));var utils=require(_0x8ec1('0x15'));var config=require(_0x8ec1('0x16'));var db=require(_0x8ec1('0x17'))['db'];function respondWithStatusCode(_0x37b6f3,_0x483a5e){_0x483a5e=_0x483a5e||0xcc;return function(_0x47f6e2){if(_0x47f6e2){return _0x37b6f3['sendStatus'](_0x483a5e);}return _0x37b6f3[_0x8ec1('0x18')](_0x483a5e)[_0x8ec1('0x19')]();};}function respondWithResult(_0x599157,_0x37a768){_0x37a768=_0x37a768||0xc8;return function(_0x132309){if(_0x132309){return _0x599157[_0x8ec1('0x18')](_0x37a768)['json'](_0x132309);}};}function respondWithFilteredResult(_0x650bca,_0x5e30c9){return function(_0x19814e){if(_0x19814e){var _0x276c28=_0x19814e[_0x8ec1('0x1a')],_0x4b88a9=_0x5e30c9[_0x8ec1('0x1b')],_0x2e6dba=_0x5e30c9['offset']+_0x5e30c9[_0x8ec1('0x1c')],_0x3f5d12;if(_0x2e6dba>=_0x276c28){_0x2e6dba=_0x276c28;_0x3f5d12=0xc8;}else{_0x3f5d12=0xce;}_0x650bca[_0x8ec1('0x18')](_0x3f5d12);return _0x650bca[_0x8ec1('0x1d')](_0x8ec1('0x1e'),_0x4b88a9+'-'+_0x2e6dba+'/'+_0x276c28)[_0x8ec1('0x1f')](_0x19814e);}return null;};}function patchUpdates(_0x4d9ad6){return function(_0x6d5c71){try{jsonpatch[_0x8ec1('0x20')](_0x6d5c71,_0x4d9ad6,!![]);}catch(_0x1a0a94){return BPromise['reject'](_0x1a0a94);}return _0x6d5c71[_0x8ec1('0x21')]();};}function saveUpdates(_0x566d74,_0x44faa5){return function(_0x28ae5b){if(_0x28ae5b){return _0x28ae5b[_0x8ec1('0x22')](_0x566d74)[_0x8ec1('0x23')](function(_0xeb965d){return _0xeb965d;});}return null;};}function removeEntity(_0x510bbb,_0x5a8e7a){return function(_0x39274d){if(_0x39274d){return _0x39274d['destroy']()[_0x8ec1('0x23')](function(){_0x510bbb[_0x8ec1('0x18')](0xcc)[_0x8ec1('0x19')]();});}};}function handleEntityNotFound(_0x460b10,_0x559677){return function(_0x54c041){if(!_0x54c041){_0x460b10[_0x8ec1('0x24')](0x194);}return _0x54c041;};}function handleError(_0x238a56,_0x1a6599){_0x1a6599=_0x1a6599||0x1f4;return function(_0x1add00){logger[_0x8ec1('0x25')](_0x1add00[_0x8ec1('0x26')]);if(_0x1add00[_0x8ec1('0x27')]){delete _0x1add00['name'];}_0x238a56['status'](_0x1a6599)[_0x8ec1('0x28')](_0x1add00);};}exports[_0x8ec1('0x29')]=function(_0x799f1b,_0x995bd4){var _0x10967e={},_0x288b55={},_0x5d4c33={'count':0x0,'rows':[]};var _0x548a5b=_[_0x8ec1('0x2a')](db[_0x8ec1('0x2b')]['rawAttributes'],function(_0x305ab6){return{'name':_0x305ab6[_0x8ec1('0x2c')],'type':_0x305ab6[_0x8ec1('0x2d')][_0x8ec1('0x2e')]};});_0x288b55[_0x8ec1('0x2f')]=_[_0x8ec1('0x2a')](_0x548a5b,_0x8ec1('0x27'));_0x288b55['query']=_[_0x8ec1('0x30')](_0x799f1b['query']);_0x288b55['filters']=_[_0x8ec1('0x31')](_0x288b55[_0x8ec1('0x2f')],_0x288b55[_0x8ec1('0x32')]);_0x10967e[_0x8ec1('0x33')]=_[_0x8ec1('0x31')](_0x288b55[_0x8ec1('0x2f')],qs[_0x8ec1('0x34')](_0x799f1b['query'][_0x8ec1('0x34')]));_0x10967e[_0x8ec1('0x33')]=_0x10967e[_0x8ec1('0x33')][_0x8ec1('0x35')]?_0x10967e[_0x8ec1('0x33')]:_0x288b55[_0x8ec1('0x2f')];if(!_0x799f1b[_0x8ec1('0x32')][_0x8ec1('0x36')](_0x8ec1('0x37'))){_0x10967e[_0x8ec1('0x1c')]=qs[_0x8ec1('0x1c')](_0x799f1b[_0x8ec1('0x32')][_0x8ec1('0x1c')]);_0x10967e[_0x8ec1('0x1b')]=qs[_0x8ec1('0x1b')](_0x799f1b[_0x8ec1('0x32')]['offset']);}_0x10967e[_0x8ec1('0x38')]=qs[_0x8ec1('0x39')](_0x799f1b[_0x8ec1('0x32')][_0x8ec1('0x39')]);_0x10967e['where']=qs['filters'](_[_0x8ec1('0x3a')](_0x799f1b[_0x8ec1('0x32')],_0x288b55[_0x8ec1('0x3b')]));if(_0x799f1b[_0x8ec1('0x32')][_0x8ec1('0x3c')]){_0x10967e[_0x8ec1('0x3d')]=_[_0x8ec1('0x3e')](_0x10967e['where'],{'$or':_[_0x8ec1('0x2a')](_0x548a5b,function(_0x341dab){if(_0x341dab['type']!==_0x8ec1('0x3f')){var _0x43d526={};_0x43d526[_0x341dab[_0x8ec1('0x27')]]={'$like':'%'+_0x799f1b[_0x8ec1('0x32')][_0x8ec1('0x3c')]+'%'};return _0x43d526;}})});}_0x10967e=_[_0x8ec1('0x3e')]({},_0x10967e,_0x799f1b[_0x8ec1('0x40')]);var _0x9460b7={'where':_0x10967e[_0x8ec1('0x3d')]};return db[_0x8ec1('0x2b')][_0x8ec1('0x1a')](_0x9460b7)['then'](function(_0xb562ce){_0x5d4c33[_0x8ec1('0x1a')]=_0xb562ce;if(_0x799f1b['query'][_0x8ec1('0x41')]){_0x10967e[_0x8ec1('0x42')]=[{'all':!![]}];}return db[_0x8ec1('0x2b')][_0x8ec1('0x43')](_0x10967e);})[_0x8ec1('0x23')](function(_0x35c259){_0x5d4c33[_0x8ec1('0x44')]=_0x35c259;return _0x5d4c33;})[_0x8ec1('0x23')](respondWithFilteredResult(_0x995bd4,_0x10967e))[_0x8ec1('0x45')](handleError(_0x995bd4,null));};exports[_0x8ec1('0x46')]=function(_0x143b3d,_0x36e426){var _0x35c32b={'raw':!![],'where':{'id':_0x143b3d['params']['id']}},_0x546c41={};_0x546c41['model']=_[_0x8ec1('0x30')](db[_0x8ec1('0x2b')][_0x8ec1('0x47')]);_0x546c41[_0x8ec1('0x32')]=_[_0x8ec1('0x30')](_0x143b3d[_0x8ec1('0x32')]);_0x546c41[_0x8ec1('0x3b')]=_['intersection'](_0x546c41[_0x8ec1('0x2f')],_0x546c41['query']);_0x35c32b[_0x8ec1('0x33')]=_[_0x8ec1('0x31')](_0x546c41[_0x8ec1('0x2f')],qs['fields'](_0x143b3d[_0x8ec1('0x32')][_0x8ec1('0x34')]));_0x35c32b['attributes']=_0x35c32b[_0x8ec1('0x33')][_0x8ec1('0x35')]?_0x35c32b[_0x8ec1('0x33')]:_0x546c41[_0x8ec1('0x2f')];if(_0x143b3d[_0x8ec1('0x32')]['includeAll']){_0x35c32b['include']=[{'all':!![]}];}_0x35c32b=_[_0x8ec1('0x3e')]({},_0x35c32b,_0x143b3d[_0x8ec1('0x40')]);return db[_0x8ec1('0x2b')][_0x8ec1('0x48')](_0x35c32b)['then'](handleEntityNotFound(_0x36e426,null))['then'](respondWithResult(_0x36e426,null))[_0x8ec1('0x45')](handleError(_0x36e426,null));};exports[_0x8ec1('0x49')]=function(_0xcddffa,_0x4eb845){return db[_0x8ec1('0x2b')]['create'](_0xcddffa['body'],{})[_0x8ec1('0x23')](respondWithResult(_0x4eb845,0xc9))[_0x8ec1('0x45')](handleError(_0x4eb845,null));};exports['update']=function(_0x411053,_0x2a06aa){if(_0x411053[_0x8ec1('0x4a')]['id']){delete _0x411053[_0x8ec1('0x4a')]['id'];}return db[_0x8ec1('0x2b')][_0x8ec1('0x48')]({'where':{'id':_0x411053[_0x8ec1('0x4b')]['id']}})[_0x8ec1('0x23')](handleEntityNotFound(_0x2a06aa,null))['then'](saveUpdates(_0x411053[_0x8ec1('0x4a')],null))[_0x8ec1('0x23')](respondWithResult(_0x2a06aa,null))[_0x8ec1('0x45')](handleError(_0x2a06aa,null));};exports['destroy']=function(_0x253c51,_0x180e3b){return db[_0x8ec1('0x2b')]['find']({'where':{'id':_0x253c51[_0x8ec1('0x4b')]['id']}})[_0x8ec1('0x23')](handleEntityNotFound(_0x180e3b,null))[_0x8ec1('0x23')](removeEntity(_0x180e3b,null))['catch'](handleError(_0x180e3b,null));};exports[_0x8ec1('0x4c')]=function(_0x1f6d4c,_0x28ba9b){return db[_0x8ec1('0x2b')][_0x8ec1('0x4c')]()[_0x8ec1('0x23')](respondWithResult(_0x28ba9b,null))['catch'](handleError(_0x28ba9b,null));}; \ No newline at end of file +var _0x0d11=['merge','options','then','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','limit','set','Content-Range','save','update','status','error','stack','name','send','index','map','JscriptyAnswerReport','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filters','where'];(function(_0x40099c,_0x35d297){var _0x46019e=function(_0x132579){while(--_0x132579){_0x40099c['push'](_0x40099c['shift']());}};_0x46019e(++_0x35d297);}(_0x0d11,0x133));var _0x10d1=function(_0x26d823,_0x3f2031){_0x26d823=_0x26d823-0x0;var _0x5c24b1=_0x0d11[_0x26d823];return _0x5c24b1;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x10d1('0x0'));var rimraf=require(_0x10d1('0x1'));var zipdir=require(_0x10d1('0x2'));var jsonpatch=require(_0x10d1('0x3'));var rp=require(_0x10d1('0x4'));var moment=require('moment');var BPromise=require(_0x10d1('0x5'));var Mustache=require(_0x10d1('0x6'));var util=require(_0x10d1('0x7'));var path=require(_0x10d1('0x8'));var sox=require(_0x10d1('0x9'));var csv=require(_0x10d1('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x10d1('0xb'));var squel=require('squel');var crypto=require(_0x10d1('0xc'));var jsforce=require(_0x10d1('0xd'));var deskjs=require(_0x10d1('0xe'));var toCsv=require(_0x10d1('0xa'));var querystring=require(_0x10d1('0xf'));var Papa=require(_0x10d1('0x10'));var Redis=require('ioredis');var authService=require(_0x10d1('0x11'));var qs=require(_0x10d1('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x10d1('0x13'));var logger=require(_0x10d1('0x14'))(_0x10d1('0x15'));var utils=require(_0x10d1('0x16'));var config=require(_0x10d1('0x17'));var db=require(_0x10d1('0x18'))['db'];function respondWithStatusCode(_0x19a863,_0x1048c1){_0x1048c1=_0x1048c1||0xcc;return function(_0x3fca2e){if(_0x3fca2e){return _0x19a863[_0x10d1('0x19')](_0x1048c1);}return _0x19a863['status'](_0x1048c1)[_0x10d1('0x1a')]();};}function respondWithResult(_0x114517,_0x4ce44f){_0x4ce44f=_0x4ce44f||0xc8;return function(_0xbf8745){if(_0xbf8745){return _0x114517['status'](_0x4ce44f)[_0x10d1('0x1b')](_0xbf8745);}};}function respondWithFilteredResult(_0x2fd15e,_0x411643){return function(_0x14fbea){if(_0x14fbea){var _0xe4817e=_0x14fbea[_0x10d1('0x1c')],_0x439c0d=_0x411643[_0x10d1('0x1d')],_0x5d8e00=_0x411643[_0x10d1('0x1d')]+_0x411643[_0x10d1('0x1e')],_0x3e2ced;if(_0x5d8e00>=_0xe4817e){_0x5d8e00=_0xe4817e;_0x3e2ced=0xc8;}else{_0x3e2ced=0xce;}_0x2fd15e['status'](_0x3e2ced);return _0x2fd15e[_0x10d1('0x1f')](_0x10d1('0x20'),_0x439c0d+'-'+_0x5d8e00+'/'+_0xe4817e)['json'](_0x14fbea);}return null;};}function patchUpdates(_0x32bee7){return function(_0x525454){try{jsonpatch['apply'](_0x525454,_0x32bee7,!![]);}catch(_0x2e60f4){return BPromise['reject'](_0x2e60f4);}return _0x525454[_0x10d1('0x21')]();};}function saveUpdates(_0x57699f,_0x4e889e){return function(_0x40bbe1){if(_0x40bbe1){return _0x40bbe1[_0x10d1('0x22')](_0x57699f)['then'](function(_0x344498){return _0x344498;});}return null;};}function removeEntity(_0x1ed4a3,_0x420f7d){return function(_0x586381){if(_0x586381){return _0x586381['destroy']()['then'](function(){_0x1ed4a3[_0x10d1('0x23')](0xcc)[_0x10d1('0x1a')]();});}};}function handleEntityNotFound(_0x5db670,_0x377064){return function(_0x50184e){if(!_0x50184e){_0x5db670[_0x10d1('0x19')](0x194);}return _0x50184e;};}function handleError(_0x22197c,_0x7f7992){_0x7f7992=_0x7f7992||0x1f4;return function(_0x10cd39){logger[_0x10d1('0x24')](_0x10cd39[_0x10d1('0x25')]);if(_0x10cd39[_0x10d1('0x26')]){delete _0x10cd39[_0x10d1('0x26')];}_0x22197c[_0x10d1('0x23')](_0x7f7992)[_0x10d1('0x27')](_0x10cd39);};}exports[_0x10d1('0x28')]=function(_0x52d8bf,_0x5aa9b1){var _0x15d415={},_0x58f276={},_0x519904={'count':0x0,'rows':[]};var _0x4589b6=_[_0x10d1('0x29')](db[_0x10d1('0x2a')]['rawAttributes'],function(_0x3e158d){return{'name':_0x3e158d[_0x10d1('0x2b')],'type':_0x3e158d['type'][_0x10d1('0x2c')]};});_0x58f276[_0x10d1('0x2d')]=_[_0x10d1('0x29')](_0x4589b6,_0x10d1('0x26'));_0x58f276[_0x10d1('0x2e')]=_[_0x10d1('0x2f')](_0x52d8bf['query']);_0x58f276['filters']=_[_0x10d1('0x30')](_0x58f276['model'],_0x58f276['query']);_0x15d415[_0x10d1('0x31')]=_[_0x10d1('0x30')](_0x58f276[_0x10d1('0x2d')],qs[_0x10d1('0x32')](_0x52d8bf[_0x10d1('0x2e')]['fields']));_0x15d415[_0x10d1('0x31')]=_0x15d415['attributes'][_0x10d1('0x33')]?_0x15d415['attributes']:_0x58f276[_0x10d1('0x2d')];if(!_0x52d8bf[_0x10d1('0x2e')][_0x10d1('0x34')](_0x10d1('0x35'))){_0x15d415[_0x10d1('0x1e')]=qs[_0x10d1('0x1e')](_0x52d8bf[_0x10d1('0x2e')][_0x10d1('0x1e')]);_0x15d415[_0x10d1('0x1d')]=qs[_0x10d1('0x1d')](_0x52d8bf[_0x10d1('0x2e')]['offset']);}_0x15d415['order']=qs[_0x10d1('0x36')](_0x52d8bf[_0x10d1('0x2e')][_0x10d1('0x36')]);_0x15d415['where']=qs['filters'](_[_0x10d1('0x37')](_0x52d8bf[_0x10d1('0x2e')],_0x58f276[_0x10d1('0x38')]));if(_0x52d8bf['query']['filter']){_0x15d415[_0x10d1('0x39')]=_[_0x10d1('0x3a')](_0x15d415[_0x10d1('0x39')],{'$or':_[_0x10d1('0x29')](_0x4589b6,function(_0x1b5eac){if(_0x1b5eac['type']!=='VIRTUAL'){var _0x47facf={};_0x47facf[_0x1b5eac[_0x10d1('0x26')]]={'$like':'%'+_0x52d8bf[_0x10d1('0x2e')]['filter']+'%'};return _0x47facf;}})});}_0x15d415=_[_0x10d1('0x3a')]({},_0x15d415,_0x52d8bf[_0x10d1('0x3b')]);var _0x2c0ab7={'where':_0x15d415[_0x10d1('0x39')]};return db[_0x10d1('0x2a')][_0x10d1('0x1c')](_0x2c0ab7)[_0x10d1('0x3c')](function(_0x40eab6){_0x519904[_0x10d1('0x1c')]=_0x40eab6;if(_0x52d8bf[_0x10d1('0x2e')][_0x10d1('0x3d')]){_0x15d415[_0x10d1('0x3e')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x10d1('0x3f')](_0x15d415);})[_0x10d1('0x3c')](function(_0x227152){_0x519904[_0x10d1('0x40')]=_0x227152;return _0x519904;})['then'](respondWithFilteredResult(_0x5aa9b1,_0x15d415))[_0x10d1('0x41')](handleError(_0x5aa9b1,null));};exports[_0x10d1('0x42')]=function(_0x35d120,_0x215320){var _0x3d438e={'raw':!![],'where':{'id':_0x35d120[_0x10d1('0x43')]['id']}},_0x2c5385={};_0x2c5385[_0x10d1('0x2d')]=_['keys'](db[_0x10d1('0x2a')]['rawAttributes']);_0x2c5385[_0x10d1('0x2e')]=_[_0x10d1('0x2f')](_0x35d120['query']);_0x2c5385[_0x10d1('0x38')]=_[_0x10d1('0x30')](_0x2c5385[_0x10d1('0x2d')],_0x2c5385['query']);_0x3d438e[_0x10d1('0x31')]=_[_0x10d1('0x30')](_0x2c5385[_0x10d1('0x2d')],qs[_0x10d1('0x32')](_0x35d120[_0x10d1('0x2e')][_0x10d1('0x32')]));_0x3d438e[_0x10d1('0x31')]=_0x3d438e[_0x10d1('0x31')][_0x10d1('0x33')]?_0x3d438e[_0x10d1('0x31')]:_0x2c5385[_0x10d1('0x2d')];if(_0x35d120[_0x10d1('0x2e')][_0x10d1('0x3d')]){_0x3d438e['include']=[{'all':!![]}];}_0x3d438e=_[_0x10d1('0x3a')]({},_0x3d438e,_0x35d120[_0x10d1('0x3b')]);return db[_0x10d1('0x2a')][_0x10d1('0x44')](_0x3d438e)[_0x10d1('0x3c')](handleEntityNotFound(_0x215320,null))[_0x10d1('0x3c')](respondWithResult(_0x215320,null))[_0x10d1('0x41')](handleError(_0x215320,null));};exports[_0x10d1('0x45')]=function(_0x693813,_0x22f7d9){return db[_0x10d1('0x2a')]['create'](_0x693813[_0x10d1('0x46')],{})[_0x10d1('0x3c')](respondWithResult(_0x22f7d9,0xc9))['catch'](handleError(_0x22f7d9,null));};exports[_0x10d1('0x22')]=function(_0x114f7f,_0x33f92f){if(_0x114f7f[_0x10d1('0x46')]['id']){delete _0x114f7f['body']['id'];}return db[_0x10d1('0x2a')][_0x10d1('0x44')]({'where':{'id':_0x114f7f[_0x10d1('0x43')]['id']}})['then'](handleEntityNotFound(_0x33f92f,null))[_0x10d1('0x3c')](saveUpdates(_0x114f7f[_0x10d1('0x46')],null))[_0x10d1('0x3c')](respondWithResult(_0x33f92f,null))[_0x10d1('0x41')](handleError(_0x33f92f,null));};exports[_0x10d1('0x47')]=function(_0x2b2dbd,_0x46169a){return db['JscriptyAnswerReport'][_0x10d1('0x44')]({'where':{'id':_0x2b2dbd['params']['id']}})[_0x10d1('0x3c')](handleEntityNotFound(_0x46169a,null))[_0x10d1('0x3c')](removeEntity(_0x46169a,null))['catch'](handleError(_0x46169a,null));};exports[_0x10d1('0x48')]=function(_0x111204,_0x4343d3){return db['JscriptyAnswerReport'][_0x10d1('0x48')]()[_0x10d1('0x3c')](respondWithResult(_0x4343d3,null))['catch'](handleError(_0x4343d3,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index d340253..f9d30ab 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 _0x7b1f=['define','JscriptyAnswerReport','report_jscripty_answers','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./jscriptyAnswerReport.attributes','exports'];(function(_0x149bb0,_0x5215b3){var _0x11499b=function(_0x1f5ac9){while(--_0x1f5ac9){_0x149bb0['push'](_0x149bb0['shift']());}};_0x11499b(++_0x5215b3);}(_0x7b1f,0xab));var _0xf7b1=function(_0x3500d1,_0x571280){_0x3500d1=_0x3500d1-0x0;var _0x5f2b41=_0x7b1f[_0x3500d1];return _0x5f2b41;};'use strict';var _=require(_0xf7b1('0x0'));var util=require(_0xf7b1('0x1'));var logger=require(_0xf7b1('0x2'))(_0xf7b1('0x3'));var moment=require(_0xf7b1('0x4'));var BPromise=require(_0xf7b1('0x5'));var rp=require(_0xf7b1('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf7b1('0x7'));module[_0xf7b1('0x8')]=function(_0x2955b7,_0x331cb9){return _0x2955b7[_0xf7b1('0x9')](_0xf7b1('0xa'),attributes,{'tableName':_0xf7b1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7455=['JscriptyAnswerReport','report_jscripty_answers','lodash','util','../../config/logger','api','moment','bluebird','path','./jscriptyAnswerReport.attributes','exports','define'];(function(_0x5e5284,_0x52f86b){var _0x589562=function(_0x5a6b96){while(--_0x5a6b96){_0x5e5284['push'](_0x5e5284['shift']());}};_0x589562(++_0x52f86b);}(_0x7455,0x1d6));var _0x5745=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7455[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x5745('0x0'));var util=require(_0x5745('0x1'));var logger=require(_0x5745('0x2'))(_0x5745('0x3'));var moment=require(_0x5745('0x4'));var BPromise=require(_0x5745('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5745('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5745('0x7'));module[_0x5745('0x8')]=function(_0x16151e,_0x237f04){return _0x16151e[_0x5745('0x9')](_0x5745('0xa'),attributes,{'tableName':_0x5745('0xb'),'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 a2a3c75..856ebfa 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 _0x1bc0=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','JscriptyAnswerReport,\x20%s,\x20%s','debug','stringify','error','message','request\x20sent','result','catch','lodash','util','moment'];(function(_0x18a68b,_0x5a6b0f){var _0x489ad1=function(_0x37093b){while(--_0x37093b){_0x18a68b['push'](_0x18a68b['shift']());}};_0x489ad1(++_0x5a6b0f);}(_0x1bc0,0x189));var _0x01bc=function(_0x35f55f,_0x10f86c){_0x35f55f=_0x35f55f-0x0;var _0xdb688f=_0x1bc0[_0x35f55f];return _0xdb688f;};'use strict';var _=require(_0x01bc('0x0'));var util=require(_0x01bc('0x1'));var moment=require(_0x01bc('0x2'));var BPromise=require('bluebird');var rs=require(_0x01bc('0x3'));var fs=require('fs');var Redis=require(_0x01bc('0x4'));var db=require(_0x01bc('0x5'))['db'];var utils=require(_0x01bc('0x6'));var logger=require(_0x01bc('0x7'))('rpc');var config=require(_0x01bc('0x8'));var jayson=require(_0x01bc('0x9'));var client=jayson[_0x01bc('0xa')][_0x01bc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3d681b,_0x3609fe,_0xa8a859){return new BPromise(function(_0x2b6302,_0x78ba71){return client['request'](_0x3d681b,_0xa8a859)[_0x01bc('0xc')](function(_0x48a8a8){logger[_0x01bc('0xd')](_0x01bc('0xe'),_0x3609fe,'request\x20sent');logger[_0x01bc('0xf')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x3609fe,'request\x20sent',JSON[_0x01bc('0x10')](_0x48a8a8));if(_0x48a8a8[_0x01bc('0x11')]){if(_0x48a8a8['error']['code']===0x1f4){logger[_0x01bc('0x11')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x3609fe,_0x48a8a8[_0x01bc('0x11')][_0x01bc('0x12')]);return _0x78ba71(_0x48a8a8[_0x01bc('0x11')]['message']);}logger[_0x01bc('0x11')](_0x01bc('0xe'),_0x3609fe,_0x48a8a8[_0x01bc('0x11')][_0x01bc('0x12')]);return _0x2b6302(_0x48a8a8['error'][_0x01bc('0x12')]);}else{logger[_0x01bc('0xd')](_0x01bc('0xe'),_0x3609fe,_0x01bc('0x13'));_0x2b6302(_0x48a8a8[_0x01bc('0x14')][_0x01bc('0x12')]);}})[_0x01bc('0x15')](function(_0x2cb61d){logger[_0x01bc('0x11')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x3609fe,_0x2cb61d);_0x78ba71(_0x2cb61d);});});} \ No newline at end of file +var _0x2659=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','bluebird','randomstring'];(function(_0x2d1baa,_0x440274){var _0xa0b5d5=function(_0x51061e){while(--_0x51061e){_0x2d1baa['push'](_0x2d1baa['shift']());}};_0xa0b5d5(++_0x440274);}(_0x2659,0x172));var _0x9265=function(_0xd5160a,_0x572c4b){_0xd5160a=_0xd5160a-0x0;var _0x576cf9=_0x2659[_0xd5160a];return _0x576cf9;};'use strict';var _=require(_0x9265('0x0'));var util=require(_0x9265('0x1'));var moment=require('moment');var BPromise=require(_0x9265('0x2'));var rs=require(_0x9265('0x3'));var fs=require('fs');var Redis=require(_0x9265('0x4'));var db=require(_0x9265('0x5'))['db'];var utils=require(_0x9265('0x6'));var logger=require('../../config/logger')(_0x9265('0x7'));var config=require(_0x9265('0x8'));var jayson=require(_0x9265('0x9'));var client=jayson[_0x9265('0xa')][_0x9265('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5df7b0,_0x30720f,_0x5be5e5){return new BPromise(function(_0x173132,_0x4b38b9){return client[_0x9265('0xc')](_0x5df7b0,_0x5be5e5)[_0x9265('0xd')](function(_0x2da01d){logger[_0x9265('0xe')](_0x9265('0xf'),_0x30720f,_0x9265('0x10'));logger['debug'](_0x9265('0x11'),_0x30720f,_0x9265('0x10'),JSON['stringify'](_0x2da01d));if(_0x2da01d[_0x9265('0x12')]){if(_0x2da01d[_0x9265('0x12')][_0x9265('0x13')]===0x1f4){logger['error'](_0x9265('0xf'),_0x30720f,_0x2da01d['error'][_0x9265('0x14')]);return _0x4b38b9(_0x2da01d['error'][_0x9265('0x14')]);}logger[_0x9265('0x12')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x30720f,_0x2da01d[_0x9265('0x12')]['message']);return _0x173132(_0x2da01d[_0x9265('0x12')][_0x9265('0x14')]);}else{logger[_0x9265('0xe')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x30720f,_0x9265('0x10'));_0x173132(_0x2da01d['result'][_0x9265('0x14')]);}})[_0x9265('0x15')](function(_0x4f6172){logger[_0x9265('0x12')](_0x9265('0xf'),_0x30720f,_0x4f6172);_0x4b38b9(_0x4f6172);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 2a464ba..63bbc87 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 _0x8738=['../../components/interaction/service','./jscriptyProject.controller','isAuthenticated','index','/:id','show','/:id/sessions','getSessions','/:id/answers','getAnswers','get','30s','getSummary','post','create','/:id/clone','clone','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x231b8d,_0x3adce2){var _0x33d2ac=function(_0x1e495e){while(--_0x1e495e){_0x231b8d['push'](_0x231b8d['shift']());}};_0x33d2ac(++_0x3adce2);}(_0x8738,0x1aa));var _0x8873=function(_0x13cd35,_0x59bdbd){_0x13cd35=_0x13cd35-0x0;var _0x24220e=_0x8738[_0x13cd35];return _0x24220e;};'use strict';var multer=require(_0x8873('0x0'));var util=require('util');var path=require(_0x8873('0x1'));var timeout=require(_0x8873('0x2'));var express=require(_0x8873('0x3'));var router=express[_0x8873('0x4')]();var auth=require(_0x8873('0x5'));var interaction=require(_0x8873('0x6'));var config=require('../../config/environment');var controller=require(_0x8873('0x7'));router['get']('/',auth[_0x8873('0x8')](),controller[_0x8873('0x9')]);router['get'](_0x8873('0xa'),auth[_0x8873('0x8')](),controller[_0x8873('0xb')]);router['get'](_0x8873('0xc'),auth[_0x8873('0x8')](),controller[_0x8873('0xd')]);router['get'](_0x8873('0xe'),auth['isAuthenticated'](),controller[_0x8873('0xf')]);router[_0x8873('0x10')]('/:id/summary',auth[_0x8873('0x8')](),timeout(_0x8873('0x11')),controller[_0x8873('0x12')]);router[_0x8873('0x13')]('/',auth[_0x8873('0x8')](),controller[_0x8873('0x14')]);router[_0x8873('0x13')](_0x8873('0x15'),auth[_0x8873('0x8')](),controller[_0x8873('0x16')]);router[_0x8873('0x17')](_0x8873('0xa'),auth[_0x8873('0x8')](),controller['update']);router[_0x8873('0x18')]('/:id',auth[_0x8873('0x8')](),controller[_0x8873('0x19')]);module[_0x8873('0x1a')]=router; \ No newline at end of file +var _0x0bc6=['util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','index','show','getSessions','/:id/answers','getAnswers','30s','getSummary','post','create','/:id/clone','clone','put','/:id','destroy','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0bc6,0x138));var _0x60bc=function(_0x491b5b,_0x54c27b){_0x491b5b=_0x491b5b-0x0;var _0x11334d=_0x0bc6[_0x491b5b];return _0x11334d;};'use strict';var multer=require('multer');var util=require(_0x60bc('0x0'));var path=require('path');var timeout=require(_0x60bc('0x1'));var express=require(_0x60bc('0x2'));var router=express[_0x60bc('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x60bc('0x4'));var config=require(_0x60bc('0x5'));var controller=require(_0x60bc('0x6'));router[_0x60bc('0x7')]('/',auth[_0x60bc('0x8')](),controller[_0x60bc('0x9')]);router[_0x60bc('0x7')]('/:id',auth[_0x60bc('0x8')](),controller[_0x60bc('0xa')]);router['get']('/:id/sessions',auth[_0x60bc('0x8')](),controller[_0x60bc('0xb')]);router['get'](_0x60bc('0xc'),auth[_0x60bc('0x8')](),controller[_0x60bc('0xd')]);router[_0x60bc('0x7')]('/:id/summary',auth['isAuthenticated'](),timeout(_0x60bc('0xe')),controller[_0x60bc('0xf')]);router[_0x60bc('0x10')]('/',auth['isAuthenticated'](),controller[_0x60bc('0x11')]);router['post'](_0x60bc('0x12'),auth[_0x60bc('0x8')](),controller[_0x60bc('0x13')]);router[_0x60bc('0x14')](_0x60bc('0x15'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x60bc('0x15'),auth['isAuthenticated'](),controller[_0x60bc('0x16')]);module[_0x60bc('0x17')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 4a9800c..2b07293 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 _0x758c=['stringify','isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize','util','STRING','name','TEXT','setDataValue','formData'];(function(_0x1fe8e4,_0x4593ba){var _0x2d6229=function(_0x5587e9){while(--_0x5587e9){_0x1fe8e4['push'](_0x1fe8e4['shift']());}};_0x2d6229(++_0x4593ba);}(_0x758c,0x1d5));var _0xc758=function(_0x517ac3,_0x18addf){_0x517ac3=_0x517ac3-0x0;var _0x1500c1=_0x758c[_0x517ac3];return _0x1500c1;};'use strict';var Sequelize=require(_0xc758('0x0'));var _=require('lodash');var util=require(_0xc758('0x1'));module['exports']={'name':{'type':Sequelize[_0xc758('0x2')],'unique':_0xc758('0x3')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xc758('0x4')]('long'),'set':function(_0x1b7d9b){if(_['isObjectLike'](_0x1b7d9b)){this[_0xc758('0x5')](_0xc758('0x6'),JSON[_0xc758('0x7')](_0x1b7d9b));}else if(_[_0xc758('0x8')](_0x1b7d9b)){this[_0xc758('0x5')](_0xc758('0x6'),_0x1b7d9b);}else{this[_0xc758('0x5')]('formData',util[_0xc758('0x9')](_0xc758('0xa'),this[_0xc758('0xb')]('name')||'',this[_0xc758('0xb')](_0xc758('0xc'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xc758('0xd')],'defaultValue':![]}}; \ No newline at end of file +var _0x3e08=['isObjectLike','setDataValue','isString','formData','format','getDataValue','description','BOOLEAN','sequelize','lodash','util','exports','STRING','name','TEXT','long'];(function(_0x16ba74,_0x2ebcfa){var _0x4333a6=function(_0x13b137){while(--_0x13b137){_0x16ba74['push'](_0x16ba74['shift']());}};_0x4333a6(++_0x2ebcfa);}(_0x3e08,0xb8));var _0x83e0=function(_0x27d10a,_0x35ff44){_0x27d10a=_0x27d10a-0x0;var _0x63302e=_0x3e08[_0x27d10a];return _0x63302e;};'use strict';var Sequelize=require(_0x83e0('0x0'));var _=require(_0x83e0('0x1'));var util=require(_0x83e0('0x2'));module[_0x83e0('0x3')]={'name':{'type':Sequelize[_0x83e0('0x4')],'unique':_0x83e0('0x5')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x83e0('0x6')](_0x83e0('0x7')),'set':function(_0x4190bd){if(_[_0x83e0('0x8')](_0x4190bd)){this[_0x83e0('0x9')]('formData',JSON['stringify'](_0x4190bd));}else if(_[_0x83e0('0xa')](_0x4190bd)){this[_0x83e0('0x9')](_0x83e0('0xb'),_0x4190bd);}else{this[_0x83e0('0x9')](_0x83e0('0xb'),util[_0x83e0('0xc')]('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0x83e0('0xd')](_0x83e0('0x5'))||'',this['getDataValue'](_0x83e0('0xe'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x83e0('0xf')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index 9940be0..cb55bc0 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 _0x42ce=['nolimit','order','sort','where','pick','filter','merge','options','count','include','rows','show','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','includeAll','omit','createdAt','params','getSessions','findOne','JscriptySessionReport','hasOwnProperty','findAll','getAnswers','JscriptyAnswerReport','ProjectId','number','fromCharCode','apply','toString','indexOf','replace','getSummary','startTime','starttime','parse','JscriptyQuestionReport','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','now','writeFileSync','setHeader','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','ejs','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','limit','set','Content-Range','json','reject','update','then','get','Projects','UserProfileResource','destroy','sendStatus','error','stack','name','map','JscriptyProject','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length'];(function(_0x33fa0f,_0x46e4c0){var _0x28e89e=function(_0x48d5e2){while(--_0x48d5e2){_0x33fa0f['push'](_0x33fa0f['shift']());}};_0x28e89e(++_0x46e4c0);}(_0x42ce,0xab));var _0xe42c=function(_0x3ee5df,_0x583073){_0x3ee5df=_0x3ee5df-0x0;var _0x446d24=_0x42ce[_0x3ee5df];return _0x446d24;};'use strict';var pdf=require(_0xe42c('0x0'));var emlformat=require(_0xe42c('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xe42c('0x2'));var jsonpatch=require(_0xe42c('0x3'));var rp=require(_0xe42c('0x4'));var moment=require(_0xe42c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xe42c('0x6'));var util=require(_0xe42c('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe42c('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xe42c('0x9'));var crypto=require('crypto');var jsforce=require(_0xe42c('0xa'));var deskjs=require(_0xe42c('0xb'));var toCsv=require('to-csv');var querystring=require(_0xe42c('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe42c('0xd'));var qs=require(_0xe42c('0xe'));var as=require(_0xe42c('0xf'));var hardwareService=require(_0xe42c('0x10'));var logger=require('../../config/logger')(_0xe42c('0x11'));var utils=require(_0xe42c('0x12'));var config=require(_0xe42c('0x13'));var db=require(_0xe42c('0x14'))['db'];function respondWithStatusCode(_0x504aa6,_0x5c7354){_0x5c7354=_0x5c7354||0xcc;return function(_0x50a867){if(_0x50a867){return _0x504aa6['sendStatus'](_0x5c7354);}return _0x504aa6[_0xe42c('0x15')](_0x5c7354)[_0xe42c('0x16')]();};}function respondWithResult(_0x23fcd2,_0x151e76){_0x151e76=_0x151e76||0xc8;return function(_0x4128d7){if(_0x4128d7){return _0x23fcd2[_0xe42c('0x15')](_0x151e76)['json'](_0x4128d7);}};}function respondWithFilteredResult(_0x1b8b3f,_0x2eb459){return function(_0x5549f5){if(_0x5549f5){var _0x540ab7=_0x5549f5['count'],_0x2b53f3=_0x2eb459['offset'],_0x50d899=_0x2eb459[_0xe42c('0x17')]+_0x2eb459[_0xe42c('0x18')],_0x16495e;if(_0x50d899>=_0x540ab7){_0x50d899=_0x540ab7;_0x16495e=0xc8;}else{_0x16495e=0xce;}_0x1b8b3f['status'](_0x16495e);return _0x1b8b3f[_0xe42c('0x19')](_0xe42c('0x1a'),_0x2b53f3+'-'+_0x50d899+'/'+_0x540ab7)[_0xe42c('0x1b')](_0x5549f5);}return null;};}function patchUpdates(_0x2bb062){return function(_0x43d458){try{jsonpatch['apply'](_0x43d458,_0x2bb062,!![]);}catch(_0x52b11b){return BPromise[_0xe42c('0x1c')](_0x52b11b);}return _0x43d458['save']();};}function saveUpdates(_0x48d606,_0x2fdbc9){return function(_0xf12c1e){if(_0xf12c1e){return _0xf12c1e[_0xe42c('0x1d')](_0x48d606)[_0xe42c('0x1e')](function(_0x3a6747){return _0x3a6747;});}return null;};}function removeEntity(_0x52df6d,_0x5a8e67){return function(_0x15c176){if(_0x15c176){return _0x15c176['destroy']()[_0xe42c('0x1e')](function(){var _0x4d996d=_0x15c176[_0xe42c('0x1f')]({'plain':!![]});var _0x152cd9=_0xe42c('0x20');return db[_0xe42c('0x21')][_0xe42c('0x22')]({'where':{'type':_0x152cd9,'resourceId':_0x4d996d['id']}})[_0xe42c('0x1e')](function(){return _0x15c176;});})[_0xe42c('0x1e')](function(){_0x52df6d[_0xe42c('0x15')](0xcc)[_0xe42c('0x16')]();});}};}function handleEntityNotFound(_0x523a4d,_0x544ec5){return function(_0x10bb95){if(!_0x10bb95){_0x523a4d[_0xe42c('0x23')](0x194);}return _0x10bb95;};}function handleError(_0x68799d,_0x9803f4){_0x9803f4=_0x9803f4||0x1f4;return function(_0x5f385e){logger[_0xe42c('0x24')](_0x5f385e[_0xe42c('0x25')]);if(_0x5f385e[_0xe42c('0x26')]){delete _0x5f385e[_0xe42c('0x26')];}_0x68799d[_0xe42c('0x15')](_0x9803f4)['send'](_0x5f385e);};}exports['index']=function(_0x5814f3,_0x53ff3c){var _0x376b54={},_0x535465={},_0x45f1dc={'count':0x0,'rows':[]};var _0x2c20f9=_[_0xe42c('0x27')](db[_0xe42c('0x28')][_0xe42c('0x29')],function(_0x45f274){return{'name':_0x45f274[_0xe42c('0x2a')],'type':_0x45f274[_0xe42c('0x2b')][_0xe42c('0x2c')]};});_0x535465[_0xe42c('0x2d')]=_[_0xe42c('0x27')](_0x2c20f9,'name');_0x535465[_0xe42c('0x2e')]=_[_0xe42c('0x2f')](_0x5814f3['query']);_0x535465[_0xe42c('0x30')]=_[_0xe42c('0x31')](_0x535465[_0xe42c('0x2d')],_0x535465['query']);_0x376b54[_0xe42c('0x32')]=_[_0xe42c('0x31')](_0x535465[_0xe42c('0x2d')],qs[_0xe42c('0x33')](_0x5814f3[_0xe42c('0x2e')][_0xe42c('0x33')]));_0x376b54[_0xe42c('0x32')]=_0x376b54['attributes'][_0xe42c('0x34')]?_0x376b54['attributes']:_0x535465[_0xe42c('0x2d')];if(!_0x5814f3['query']['hasOwnProperty'](_0xe42c('0x35'))){_0x376b54[_0xe42c('0x18')]=qs[_0xe42c('0x18')](_0x5814f3[_0xe42c('0x2e')][_0xe42c('0x18')]);_0x376b54[_0xe42c('0x17')]=qs[_0xe42c('0x17')](_0x5814f3[_0xe42c('0x2e')][_0xe42c('0x17')]);}_0x376b54[_0xe42c('0x36')]=qs[_0xe42c('0x37')](_0x5814f3[_0xe42c('0x2e')][_0xe42c('0x37')]);_0x376b54[_0xe42c('0x38')]=qs['filters'](_[_0xe42c('0x39')](_0x5814f3[_0xe42c('0x2e')],_0x535465[_0xe42c('0x30')]));if(_0x5814f3[_0xe42c('0x2e')][_0xe42c('0x3a')]){_0x376b54[_0xe42c('0x38')]=_[_0xe42c('0x3b')](_0x376b54[_0xe42c('0x38')],{'$or':_['map'](_0x2c20f9,function(_0xdaac9c){if(_0xdaac9c['type']!=='VIRTUAL'){var _0x9eaf49={};_0x9eaf49[_0xdaac9c[_0xe42c('0x26')]]={'$like':'%'+_0x5814f3[_0xe42c('0x2e')][_0xe42c('0x3a')]+'%'};return _0x9eaf49;}})});}_0x376b54=_[_0xe42c('0x3b')]({},_0x376b54,_0x5814f3[_0xe42c('0x3c')]);var _0x18ac1f={'where':_0x376b54['where']};return db[_0xe42c('0x28')][_0xe42c('0x3d')](_0x18ac1f)[_0xe42c('0x1e')](function(_0x48e5f0){_0x45f1dc['count']=_0x48e5f0;if(_0x5814f3['query']['includeAll']){_0x376b54[_0xe42c('0x3e')]=[{'all':!![]}];}return db['JscriptyProject']['findAll'](_0x376b54);})[_0xe42c('0x1e')](function(_0x5415d7){_0x45f1dc[_0xe42c('0x3f')]=_0x5415d7;return _0x45f1dc;})[_0xe42c('0x1e')](respondWithFilteredResult(_0x53ff3c,_0x376b54))['catch'](handleError(_0x53ff3c,null));};exports[_0xe42c('0x40')]=function(_0x11754d,_0x54e1e6){var _0x4dfd8a={'raw':![],'where':{'id':_0x11754d['params']['id']}},_0x51a493={};_0x51a493[_0xe42c('0x2d')]=_[_0xe42c('0x2f')](db['JscriptyProject'][_0xe42c('0x29')]);_0x51a493[_0xe42c('0x2e')]=_[_0xe42c('0x2f')](_0x11754d['query']);_0x51a493[_0xe42c('0x30')]=_[_0xe42c('0x31')](_0x51a493[_0xe42c('0x2d')],_0x51a493['query']);_0x4dfd8a[_0xe42c('0x32')]=_[_0xe42c('0x31')](_0x51a493[_0xe42c('0x2d')],qs[_0xe42c('0x33')](_0x11754d[_0xe42c('0x2e')][_0xe42c('0x33')]));_0x4dfd8a[_0xe42c('0x32')]=_0x4dfd8a[_0xe42c('0x32')][_0xe42c('0x34')]?_0x4dfd8a['attributes']:_0x51a493[_0xe42c('0x2d')];if(_0x11754d[_0xe42c('0x2e')]['includeAll']){_0x4dfd8a[_0xe42c('0x3e')]=[{'all':!![]}];}_0x4dfd8a=_[_0xe42c('0x3b')]({},_0x4dfd8a,_0x11754d[_0xe42c('0x3c')]);return db[_0xe42c('0x28')][_0xe42c('0x41')](_0x4dfd8a)['then'](handleEntityNotFound(_0x54e1e6,null))[_0xe42c('0x1e')](respondWithResult(_0x54e1e6,null))[_0xe42c('0x42')](handleError(_0x54e1e6,null));};exports[_0xe42c('0x43')]=function(_0x2829f5,_0x465dd3){return db['JscriptyProject'][_0xe42c('0x43')](_0x2829f5[_0xe42c('0x44')],{})['then'](function(_0x17611b){var _0x1460cf=_0x2829f5[_0xe42c('0x45')][_0xe42c('0x1f')]({'plain':!![]});if(!_0x1460cf)throw new Error(_0xe42c('0x46'));if(_0x1460cf[_0xe42c('0x47')]===_0xe42c('0x45')){var _0x236fdb=_0x17611b[_0xe42c('0x1f')]({'plain':!![]});var _0x3db862=_0xe42c('0x20');return db[_0xe42c('0x48')][_0xe42c('0x41')]({'where':{'name':_0x3db862,'userProfileId':_0x1460cf[_0xe42c('0x49')]},'raw':!![]})[_0xe42c('0x1e')](function(_0x159247){if(_0x159247&&_0x159247[_0xe42c('0x4a')]===0x0){return db[_0xe42c('0x21')][_0xe42c('0x43')]({'name':_0x236fdb[_0xe42c('0x26')],'resourceId':_0x236fdb['id'],'type':_0x159247[_0xe42c('0x26')],'sectionId':_0x159247['id']},{})[_0xe42c('0x1e')](function(){return _0x17611b;});}else{return _0x17611b;}})['catch'](function(_0x4705a8){logger[_0xe42c('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4705a8);throw _0x4705a8;});}return _0x17611b;})[_0xe42c('0x1e')](respondWithResult(_0x465dd3,0xc9))[_0xe42c('0x42')](handleError(_0x465dd3,null));};exports['clone']=function(_0x53b506,_0x39e028){var _0x23ebf6={'where':{'id':_0x53b506['params']['id']}},_0x23d6e2={};_0x23d6e2[_0xe42c('0x2d')]=_[_0xe42c('0x2f')](db[_0xe42c('0x28')][_0xe42c('0x29')]);_0x23ebf6[_0xe42c('0x32')]=_[_0xe42c('0x31')](_0x23d6e2[_0xe42c('0x2d')],qs[_0xe42c('0x33')](_0x53b506[_0xe42c('0x2e')][_0xe42c('0x33')]));_0x23ebf6['attributes']=_0x23ebf6[_0xe42c('0x32')][_0xe42c('0x34')]?_0x23ebf6[_0xe42c('0x32')]:_0x23d6e2[_0xe42c('0x2d')];if(_0x53b506[_0xe42c('0x2e')][_0xe42c('0x4b')]){_0x23ebf6[_0xe42c('0x3e')]=[{'all':!![]}];}_0x23ebf6=_[_0xe42c('0x3b')]({},_0x23ebf6,_0x53b506[_0xe42c('0x3c')]);return db[_0xe42c('0x28')][_0xe42c('0x41')](_0x23ebf6)[_0xe42c('0x1e')](handleEntityNotFound(_0x39e028,null))[_0xe42c('0x1e')](function(_0x3a3485){if(_0x3a3485){var _0x46c274=_0x3a3485[_0xe42c('0x1f')]({'plain':!![]});_0x46c274=qs[_0xe42c('0x4c')](_0x46c274,['id',_0xe42c('0x4d'),'updatedAt']);_0x53b506[_0xe42c('0x44')]=_[_0xe42c('0x4c')](_0x53b506[_0xe42c('0x44')],['id',_0xe42c('0x4d'),'updatedAt']);return db[_0xe42c('0x28')]['create'](_[_0xe42c('0x3b')](_0x46c274,_0x53b506[_0xe42c('0x44')]),{'include':_0x53b506[_0xe42c('0x2e')][_0xe42c('0x4b')]?[{'all':!![]}]:undefined})[_0xe42c('0x1e')](function(_0x5408e8){var _0xedc13b=_0x53b506[_0xe42c('0x45')]['get']({'plain':!![]});if(!_0xedc13b)throw new Error(_0xe42c('0x46'));if(_0xedc13b[_0xe42c('0x47')]==='user'){var _0x4ba00a=_0x5408e8[_0xe42c('0x1f')]({'plain':!![]});var _0xca0f91=_0xe42c('0x20');return db[_0xe42c('0x48')]['find']({'where':{'name':_0xca0f91,'userProfileId':_0xedc13b['userProfileId']},'raw':!![]})[_0xe42c('0x1e')](function(_0x63ae33){if(_0x63ae33&&_0x63ae33[_0xe42c('0x4a')]===0x0){return db[_0xe42c('0x21')][_0xe42c('0x43')]({'name':_0x4ba00a[_0xe42c('0x26')],'resourceId':_0x4ba00a['id'],'type':_0x63ae33[_0xe42c('0x26')],'sectionId':_0x63ae33['id']},{})[_0xe42c('0x1e')](function(){return _0x5408e8;});}else{return _0x5408e8;}})['catch'](function(_0x44cdd2){logger[_0xe42c('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x44cdd2);throw _0x44cdd2;});}return _0x5408e8;});}})['then'](respondWithResult(_0x39e028,0xc9))['catch'](handleError(_0x39e028,null));};exports[_0xe42c('0x1d')]=function(_0x1286e7,_0x167080){if(_0x1286e7[_0xe42c('0x44')]['id']){delete _0x1286e7[_0xe42c('0x44')]['id'];}return db[_0xe42c('0x28')][_0xe42c('0x41')]({'where':{'id':_0x1286e7[_0xe42c('0x4e')]['id']}})[_0xe42c('0x1e')](handleEntityNotFound(_0x167080,null))[_0xe42c('0x1e')](saveUpdates(_0x1286e7[_0xe42c('0x44')],null))['then'](respondWithResult(_0x167080,null))[_0xe42c('0x42')](handleError(_0x167080,null));};exports[_0xe42c('0x22')]=function(_0x275384,_0x416497){return db[_0xe42c('0x28')]['find']({'where':{'id':_0x275384[_0xe42c('0x4e')]['id']}})['then'](handleEntityNotFound(_0x416497,null))['then'](removeEntity(_0x416497,null))[_0xe42c('0x42')](handleError(_0x416497,null));};exports[_0xe42c('0x4f')]=function(_0x2b0d24,_0x238a9e,_0x47f16c){var _0x5b5d47={'raw':!![],'where':{}};var _0x6d5c6a={};var _0x16a4d1={'count':0x0,'rows':[]};return db[_0xe42c('0x28')][_0xe42c('0x50')]({'where':{'id':_0x2b0d24[_0xe42c('0x4e')]['id']}})[_0xe42c('0x1e')](handleEntityNotFound(_0x238a9e,null))[_0xe42c('0x1e')](function(_0x31eaf8){if(_0x31eaf8){_0x6d5c6a[_0xe42c('0x2d')]=_[_0xe42c('0x2f')](db[_0xe42c('0x51')][_0xe42c('0x29')]);_0x6d5c6a['query']=_['keys'](_0x2b0d24[_0xe42c('0x2e')]);_0x6d5c6a[_0xe42c('0x30')]=_[_0xe42c('0x31')](_0x6d5c6a['model'],_0x6d5c6a[_0xe42c('0x2e')]);_0x5b5d47[_0xe42c('0x32')]=_['intersection'](_0x6d5c6a['model'],qs[_0xe42c('0x33')](_0x2b0d24[_0xe42c('0x2e')]['fields']));_0x5b5d47['attributes']=_0x5b5d47[_0xe42c('0x32')][_0xe42c('0x34')]?_0x5b5d47[_0xe42c('0x32')]:_0x6d5c6a[_0xe42c('0x2d')];if(!_0x2b0d24[_0xe42c('0x2e')][_0xe42c('0x52')]('nolimit')){_0x5b5d47[_0xe42c('0x18')]=qs[_0xe42c('0x18')](_0x2b0d24[_0xe42c('0x2e')][_0xe42c('0x18')]);_0x5b5d47['offset']=qs['offset'](_0x2b0d24[_0xe42c('0x2e')][_0xe42c('0x17')]);}_0x5b5d47['order']=qs[_0xe42c('0x37')](_0x2b0d24['query'][_0xe42c('0x37')]);_0x5b5d47[_0xe42c('0x38')]=qs[_0xe42c('0x30')](_[_0xe42c('0x39')](_0x2b0d24[_0xe42c('0x2e')],_0x6d5c6a['filters']));_0x5b5d47[_0xe42c('0x38')]['ProjectId']=_0x31eaf8['id'];if(_0x2b0d24[_0xe42c('0x2e')][_0xe42c('0x3a')]){_0x5b5d47[_0xe42c('0x38')]=_[_0xe42c('0x3b')](_0x5b5d47['where'],{'$or':_[_0xe42c('0x27')](_0x5b5d47['attributes'],function(_0x8dce4f){var _0x304864={};_0x304864[_0x8dce4f]={'$like':'%'+_0x2b0d24[_0xe42c('0x2e')]['filter']+'%'};return _0x304864;})});}_0x5b5d47=_[_0xe42c('0x3b')]({},_0x5b5d47,_0x2b0d24[_0xe42c('0x3c')]);return db[_0xe42c('0x51')][_0xe42c('0x3d')]({'where':_0x5b5d47[_0xe42c('0x38')]})[_0xe42c('0x1e')](function(_0x377897){_0x16a4d1[_0xe42c('0x3d')]=_0x377897;if(_0x2b0d24[_0xe42c('0x2e')]['includeAll']){_0x5b5d47[_0xe42c('0x3e')]=[{'all':!![]}];}return db[_0xe42c('0x51')][_0xe42c('0x53')](_0x5b5d47);})[_0xe42c('0x1e')](function(_0x4f723c){_0x16a4d1['rows']=_0x4f723c;return _0x16a4d1;});}})['then'](respondWithFilteredResult(_0x238a9e,_0x5b5d47))[_0xe42c('0x42')](handleError(_0x238a9e,null));};exports[_0xe42c('0x54')]=function(_0x1fda17,_0x3f8718,_0x4ea3ce){var _0x172926={'raw':!![],'where':{}};var _0x39d9bf={};var _0x158ed1={'count':0x0,'rows':[]};return db[_0xe42c('0x28')][_0xe42c('0x50')]({'where':{'id':_0x1fda17[_0xe42c('0x4e')]['id']}})[_0xe42c('0x1e')](handleEntityNotFound(_0x3f8718,null))[_0xe42c('0x1e')](function(_0x591d54){if(_0x591d54){_0x39d9bf[_0xe42c('0x2d')]=_[_0xe42c('0x2f')](db[_0xe42c('0x55')]['rawAttributes']);_0x39d9bf[_0xe42c('0x2e')]=_['keys'](_0x1fda17['query']);_0x39d9bf[_0xe42c('0x30')]=_[_0xe42c('0x31')](_0x39d9bf[_0xe42c('0x2d')],_0x39d9bf[_0xe42c('0x2e')]);_0x172926[_0xe42c('0x32')]=_[_0xe42c('0x31')](_0x39d9bf[_0xe42c('0x2d')],qs[_0xe42c('0x33')](_0x1fda17[_0xe42c('0x2e')][_0xe42c('0x33')]));_0x172926[_0xe42c('0x32')]=_0x172926[_0xe42c('0x32')]['length']?_0x172926['attributes']:_0x39d9bf[_0xe42c('0x2d')];if(!_0x1fda17['query'][_0xe42c('0x52')](_0xe42c('0x35'))){_0x172926[_0xe42c('0x18')]=qs[_0xe42c('0x18')](_0x1fda17['query'][_0xe42c('0x18')]);_0x172926['offset']=qs[_0xe42c('0x17')](_0x1fda17[_0xe42c('0x2e')][_0xe42c('0x17')]);}_0x172926[_0xe42c('0x36')]=qs[_0xe42c('0x37')](_0x1fda17[_0xe42c('0x2e')][_0xe42c('0x37')]);_0x172926[_0xe42c('0x38')]=qs['filters'](_['pick'](_0x1fda17[_0xe42c('0x2e')],_0x39d9bf['filters']));_0x172926[_0xe42c('0x38')][_0xe42c('0x56')]=_0x591d54['id'];if(_0x1fda17[_0xe42c('0x2e')]['filter']){_0x172926['where']=_[_0xe42c('0x3b')](_0x172926[_0xe42c('0x38')],{'$or':_[_0xe42c('0x27')](_0x172926[_0xe42c('0x32')],function(_0xd8e1cd){var _0x413ad4={};_0x413ad4[_0xd8e1cd]={'$like':'%'+_0x1fda17[_0xe42c('0x2e')][_0xe42c('0x3a')]+'%'};return _0x413ad4;})});}_0x172926=_[_0xe42c('0x3b')]({},_0x172926,_0x1fda17['options']);return db[_0xe42c('0x55')][_0xe42c('0x3d')]({'where':_0x172926[_0xe42c('0x38')]})[_0xe42c('0x1e')](function(_0x3cdbbd){_0x158ed1[_0xe42c('0x3d')]=_0x3cdbbd;if(_0x1fda17[_0xe42c('0x2e')][_0xe42c('0x4b')]){_0x172926[_0xe42c('0x3e')]=[{'all':!![]}];}return db[_0xe42c('0x55')][_0xe42c('0x53')](_0x172926);})['then'](function(_0x25bbbb){_0x158ed1[_0xe42c('0x3f')]=_0x25bbbb;return _0x158ed1;});}})[_0xe42c('0x1e')](respondWithFilteredResult(_0x3f8718,_0x172926))['catch'](handleError(_0x3f8718,null));};function char(_0x2d4279){return _0xe42c('0x57')===typeof _0x2d4279?String[_0xe42c('0x58')][_0xe42c('0x59')](null,arguments):_0x2d4279;}function needsEncapsulation(_0x44167a){return!!_0x44167a&&(_0x44167a[_0xe42c('0x5a')]()[_0xe42c('0x5b')](char(0xd))>=0x0||_0x44167a[_0xe42c('0x5a')]()[_0xe42c('0x5b')](char(0xa))>=0x0||_0x44167a[_0xe42c('0x5a')]()[_0xe42c('0x5b')](char(0x2c))>=0x0||_0x44167a[_0xe42c('0x5a')]()['indexOf'](char(0x22))>=0x0);}function encapsulate(_0x57f5ab){var _0x28ec9d=char(0x22),_0x505a6c='\x5c'+char(0x22),_0x53f7f2=_0x57f5ab['toString']()[_0xe42c('0x5c')](new RegExp(_0x28ec9d,'g'),_0x505a6c);return _0x28ec9d+_0x53f7f2+_0x28ec9d;}exports[_0xe42c('0x5d')]=function(_0x4b9b95,_0x4473ac,_0x1e1f7c){var _0x406d12,_0x4858b4;var _0x3d478c={'where':{'ProjectId':_0x4b9b95[_0xe42c('0x4e')]['id']}};if(_0x4b9b95[_0xe42c('0x2e')][_0xe42c('0x5e')]){_0x3d478c[_0xe42c('0x38')][_0xe42c('0x5f')]=JSON[_0xe42c('0x60')](_0x4b9b95[_0xe42c('0x2e')][_0xe42c('0x5e')]);}return db[_0xe42c('0x51')][_0xe42c('0x53')](_0x3d478c)['then'](handleEntityNotFound(_0x4473ac,null))[_0xe42c('0x1e')](function(_0xd2b8fc){if(_0xd2b8fc){_0x406d12=_0xd2b8fc;return db[_0xe42c('0x61')][_0xe42c('0x53')]({'where':{'SessionId':{'$in':_['map'](_0x406d12,'id')},'ProjectId':_0x4b9b95[_0xe42c('0x4e')]['id']},'order':'-createdAt'});}})[_0xe42c('0x1e')](handleEntityNotFound(_0x4473ac,null))[_0xe42c('0x1e')](function(_0x3fdc32){if(_0x3fdc32){_0x4858b4=_0x3fdc32;var _0x2bfd63={};for(var _0x542e8a=0x0,_0x58c306=_0x4858b4[_0xe42c('0x34')];_0x542e8a<_0x58c306;_0x542e8a++){if(!_0x2bfd63[_0xe42c('0x52')](_0x4858b4[_0x542e8a][_0xe42c('0x62')])){_0x2bfd63[_0x4858b4[_0x542e8a]['questionId']]=needsEncapsulation(_0x4858b4[_0x542e8a][_0xe42c('0x63')])?encapsulate(_0x4858b4[_0x542e8a]['question']):_0x4858b4[_0x542e8a][_0xe42c('0x63')];}}var _0x342cae=[],_0x1c7fbb={};for(var _0x3c48a9=0x0,_0x3f60cb=_0x406d12[_0xe42c('0x34')];_0x3c48a9<_0x3f60cb;_0x3c48a9++){_0x1c7fbb={'ProjectId':_0x4b9b95[_0xe42c('0x4e')]['id'],'SessionId':_0x406d12[_0x3c48a9]['id'],'StartTime':moment(_0x406d12[_0x3c48a9]['starttime'])[_0xe42c('0x64')](_0xe42c('0x65'))};for(var _0x49eaaf=0x0,_0x45ae5d=_0x4858b4['length'];_0x49eaaf<_0x45ae5d;_0x49eaaf++){if(_0x4858b4[_0x49eaaf][_0xe42c('0x66')]==_0x406d12[_0x3c48a9]['id']&&_0x2bfd63[_0xe42c('0x52')](_0x4858b4[_0x49eaaf][_0xe42c('0x62')])){_0x1c7fbb[_0x2bfd63[_0x4858b4[_0x49eaaf]['questionId']]]=_0x4858b4[_0x49eaaf][_0xe42c('0x67')];}}for(var _0x4137ae in _0x2bfd63){if(!_0x1c7fbb[_0xe42c('0x52')](_0x2bfd63[_0x4137ae])){_0x1c7fbb[_0x2bfd63[_0x4137ae]]=null;}}_0x342cae[_0xe42c('0x68')](_0x1c7fbb);}return _0x342cae;}})[_0xe42c('0x1e')](function(_0x478ecc){if(!_[_0xe42c('0x69')](_0x478ecc)){var _0x201108=toCsv(_0x478ecc);var _0x5d7bd6=Date[_0xe42c('0x6a')]();fs[_0xe42c('0x6b')](util['format']('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x4b9b95[_0xe42c('0x4e')]['id'],_0x5d7bd6),_0x201108);_0x4473ac[_0xe42c('0x6c')]('Content-disposition',_0xe42c('0x6d')+util[_0xe42c('0x64')](_0xe42c('0x6e'),_0x4b9b95['params']['id'],_0x5d7bd6));_0x4473ac[_0xe42c('0x6c')](_0xe42c('0x6f'),'text/csv');return _0x4473ac['download'](util[_0xe42c('0x64')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x4b9b95['params']['id'],_0x5d7bd6));}else{return _0x4473ac['sendStatus'](0xcc);}})[_0xe42c('0x42')](handleError(_0x4473ac,null));}; \ No newline at end of file +var _0x250f=['apply','reject','save','update','then','destroy','get','Projects','UserProfileResource','sendStatus','stack','name','map','JscriptyProject','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','VIRTUAL','filter','merge','options','includeAll','include','findAll','catch','show','fields','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','params','getSessions','findOne','rawAttributes','JscriptySessionReport','rows','getAnswers','JscriptyAnswerReport','toString','indexOf','replace','getSummary','starttime','startTime','JscriptyQuestionReport','-createdAt','questionId','question','format','SessionId','answer','push','now','writeFileSync','setHeader','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','text/csv','download','/tmp/Jscripty_Project_%d_Summary_%s.csv','html-pdf','request-promise','moment','bluebird','mustache','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../mysqldb','status','end','json','count','offset','limit','set'];(function(_0x595bd1,_0xb1e7a){var _0xd0344f=function(_0x5eb2fd){while(--_0x5eb2fd){_0x595bd1['push'](_0x595bd1['shift']());}};_0xd0344f(++_0xb1e7a);}(_0x250f,0x19e));var _0xf250=function(_0xe5718e,_0x63b6b3){_0xe5718e=_0xe5718e-0x0;var _0x5507c6=_0x250f[_0xe5718e];return _0x5507c6;};'use strict';var pdf=require(_0xf250('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf250('0x1'));var moment=require(_0xf250('0x2'));var BPromise=require(_0xf250('0x3'));var Mustache=require(_0xf250('0x4'));var util=require('util');var path=require('path');var sox=require(_0xf250('0x5'));var csv=require('to-csv');var ejs=require(_0xf250('0x6'));var fs=require('fs');var _=require(_0xf250('0x7'));var squel=require(_0xf250('0x8'));var crypto=require(_0xf250('0x9'));var jsforce=require(_0xf250('0xa'));var deskjs=require(_0xf250('0xb'));var toCsv=require(_0xf250('0xc'));var querystring=require(_0xf250('0xd'));var Papa=require('papaparse');var Redis=require(_0xf250('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xf250('0xf'));var as=require(_0xf250('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xf250('0x11'));var config=require('../../config/environment');var db=require(_0xf250('0x12'))['db'];function respondWithStatusCode(_0x557484,_0x3385d5){_0x3385d5=_0x3385d5||0xcc;return function(_0x457233){if(_0x457233){return _0x557484['sendStatus'](_0x3385d5);}return _0x557484[_0xf250('0x13')](_0x3385d5)[_0xf250('0x14')]();};}function respondWithResult(_0x7176c,_0x138548){_0x138548=_0x138548||0xc8;return function(_0x301bdd){if(_0x301bdd){return _0x7176c['status'](_0x138548)[_0xf250('0x15')](_0x301bdd);}};}function respondWithFilteredResult(_0x36e819,_0x461cb0){return function(_0x8b707f){if(_0x8b707f){var _0x4b6281=_0x8b707f[_0xf250('0x16')],_0x902dda=_0x461cb0[_0xf250('0x17')],_0x17c540=_0x461cb0[_0xf250('0x17')]+_0x461cb0[_0xf250('0x18')],_0x25f0e3;if(_0x17c540>=_0x4b6281){_0x17c540=_0x4b6281;_0x25f0e3=0xc8;}else{_0x25f0e3=0xce;}_0x36e819[_0xf250('0x13')](_0x25f0e3);return _0x36e819[_0xf250('0x19')]('Content-Range',_0x902dda+'-'+_0x17c540+'/'+_0x4b6281)[_0xf250('0x15')](_0x8b707f);}return null;};}function patchUpdates(_0x567120){return function(_0x2f04a2){try{jsonpatch[_0xf250('0x1a')](_0x2f04a2,_0x567120,!![]);}catch(_0x192cdf){return BPromise[_0xf250('0x1b')](_0x192cdf);}return _0x2f04a2[_0xf250('0x1c')]();};}function saveUpdates(_0x416bb8,_0x30d7ec){return function(_0xa4bfc2){if(_0xa4bfc2){return _0xa4bfc2[_0xf250('0x1d')](_0x416bb8)[_0xf250('0x1e')](function(_0x4538ad){return _0x4538ad;});}return null;};}function removeEntity(_0x51f4ee,_0x420775){return function(_0x3b9596){if(_0x3b9596){return _0x3b9596[_0xf250('0x1f')]()[_0xf250('0x1e')](function(){var _0x578e5e=_0x3b9596[_0xf250('0x20')]({'plain':!![]});var _0x205931=_0xf250('0x21');return db[_0xf250('0x22')][_0xf250('0x1f')]({'where':{'type':_0x205931,'resourceId':_0x578e5e['id']}})[_0xf250('0x1e')](function(){return _0x3b9596;});})[_0xf250('0x1e')](function(){_0x51f4ee[_0xf250('0x13')](0xcc)[_0xf250('0x14')]();});}};}function handleEntityNotFound(_0x49987c,_0x1c11dc){return function(_0x2050c6){if(!_0x2050c6){_0x49987c[_0xf250('0x23')](0x194);}return _0x2050c6;};}function handleError(_0x528224,_0x301d75){_0x301d75=_0x301d75||0x1f4;return function(_0x54762b){logger['error'](_0x54762b[_0xf250('0x24')]);if(_0x54762b[_0xf250('0x25')]){delete _0x54762b['name'];}_0x528224['status'](_0x301d75)['send'](_0x54762b);};}exports['index']=function(_0x594a9d,_0x40f14e){var _0x22dc7e={},_0x530548={},_0x10ad2e={'count':0x0,'rows':[]};var _0x14b48d=_[_0xf250('0x26')](db[_0xf250('0x27')]['rawAttributes'],function(_0x26efe4){return{'name':_0x26efe4[_0xf250('0x28')],'type':_0x26efe4[_0xf250('0x29')][_0xf250('0x2a')]};});_0x530548[_0xf250('0x2b')]=_[_0xf250('0x26')](_0x14b48d,_0xf250('0x25'));_0x530548[_0xf250('0x2c')]=_[_0xf250('0x2d')](_0x594a9d[_0xf250('0x2c')]);_0x530548[_0xf250('0x2e')]=_[_0xf250('0x2f')](_0x530548[_0xf250('0x2b')],_0x530548['query']);_0x22dc7e['attributes']=_[_0xf250('0x2f')](_0x530548['model'],qs['fields'](_0x594a9d[_0xf250('0x2c')]['fields']));_0x22dc7e[_0xf250('0x30')]=_0x22dc7e['attributes'][_0xf250('0x31')]?_0x22dc7e[_0xf250('0x30')]:_0x530548[_0xf250('0x2b')];if(!_0x594a9d['query'][_0xf250('0x32')](_0xf250('0x33'))){_0x22dc7e[_0xf250('0x18')]=qs[_0xf250('0x18')](_0x594a9d[_0xf250('0x2c')]['limit']);_0x22dc7e[_0xf250('0x17')]=qs[_0xf250('0x17')](_0x594a9d[_0xf250('0x2c')]['offset']);}_0x22dc7e[_0xf250('0x34')]=qs['sort'](_0x594a9d['query'][_0xf250('0x35')]);_0x22dc7e['where']=qs['filters'](_[_0xf250('0x36')](_0x594a9d[_0xf250('0x2c')],_0x530548[_0xf250('0x2e')]));if(_0x594a9d['query']['filter']){_0x22dc7e['where']=_['merge'](_0x22dc7e[_0xf250('0x37')],{'$or':_[_0xf250('0x26')](_0x14b48d,function(_0x385159){if(_0x385159[_0xf250('0x29')]!==_0xf250('0x38')){var _0x18de12={};_0x18de12[_0x385159[_0xf250('0x25')]]={'$like':'%'+_0x594a9d[_0xf250('0x2c')][_0xf250('0x39')]+'%'};return _0x18de12;}})});}_0x22dc7e=_[_0xf250('0x3a')]({},_0x22dc7e,_0x594a9d[_0xf250('0x3b')]);var _0x33a258={'where':_0x22dc7e[_0xf250('0x37')]};return db['JscriptyProject'][_0xf250('0x16')](_0x33a258)[_0xf250('0x1e')](function(_0x51e93c){_0x10ad2e[_0xf250('0x16')]=_0x51e93c;if(_0x594a9d[_0xf250('0x2c')][_0xf250('0x3c')]){_0x22dc7e[_0xf250('0x3d')]=[{'all':!![]}];}return db[_0xf250('0x27')][_0xf250('0x3e')](_0x22dc7e);})['then'](function(_0xb17e24){_0x10ad2e['rows']=_0xb17e24;return _0x10ad2e;})[_0xf250('0x1e')](respondWithFilteredResult(_0x40f14e,_0x22dc7e))[_0xf250('0x3f')](handleError(_0x40f14e,null));};exports[_0xf250('0x40')]=function(_0x1e95e7,_0x204afb){var _0x18cacb={'raw':![],'where':{'id':_0x1e95e7['params']['id']}},_0x1bb12b={};_0x1bb12b[_0xf250('0x2b')]=_[_0xf250('0x2d')](db[_0xf250('0x27')]['rawAttributes']);_0x1bb12b[_0xf250('0x2c')]=_[_0xf250('0x2d')](_0x1e95e7[_0xf250('0x2c')]);_0x1bb12b[_0xf250('0x2e')]=_[_0xf250('0x2f')](_0x1bb12b[_0xf250('0x2b')],_0x1bb12b[_0xf250('0x2c')]);_0x18cacb[_0xf250('0x30')]=_[_0xf250('0x2f')](_0x1bb12b[_0xf250('0x2b')],qs[_0xf250('0x41')](_0x1e95e7[_0xf250('0x2c')][_0xf250('0x41')]));_0x18cacb[_0xf250('0x30')]=_0x18cacb[_0xf250('0x30')]['length']?_0x18cacb[_0xf250('0x30')]:_0x1bb12b[_0xf250('0x2b')];if(_0x1e95e7['query'][_0xf250('0x3c')]){_0x18cacb[_0xf250('0x3d')]=[{'all':!![]}];}_0x18cacb=_[_0xf250('0x3a')]({},_0x18cacb,_0x1e95e7['options']);return db[_0xf250('0x27')][_0xf250('0x42')](_0x18cacb)['then'](handleEntityNotFound(_0x204afb,null))['then'](respondWithResult(_0x204afb,null))['catch'](handleError(_0x204afb,null));};exports[_0xf250('0x43')]=function(_0x4a0dd7,_0x2df59a){return db[_0xf250('0x27')]['create'](_0x4a0dd7[_0xf250('0x44')],{})[_0xf250('0x1e')](function(_0x2b7a54){var _0x1f3405=_0x4a0dd7[_0xf250('0x45')][_0xf250('0x20')]({'plain':!![]});if(!_0x1f3405)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1f3405[_0xf250('0x46')]===_0xf250('0x45')){var _0x1aa983=_0x2b7a54[_0xf250('0x20')]({'plain':!![]});var _0xc1c1df=_0xf250('0x21');return db[_0xf250('0x47')][_0xf250('0x42')]({'where':{'name':_0xc1c1df,'userProfileId':_0x1f3405[_0xf250('0x48')]},'raw':!![]})[_0xf250('0x1e')](function(_0x2a0e71){if(_0x2a0e71&&_0x2a0e71[_0xf250('0x49')]===0x0){return db[_0xf250('0x22')][_0xf250('0x43')]({'name':_0x1aa983[_0xf250('0x25')],'resourceId':_0x1aa983['id'],'type':_0x2a0e71[_0xf250('0x25')],'sectionId':_0x2a0e71['id']},{})[_0xf250('0x1e')](function(){return _0x2b7a54;});}else{return _0x2b7a54;}})['catch'](function(_0x50d1f9){logger[_0xf250('0x4a')](_0xf250('0x4b'),_0x50d1f9);throw _0x50d1f9;});}return _0x2b7a54;})[_0xf250('0x1e')](respondWithResult(_0x2df59a,0xc9))[_0xf250('0x3f')](handleError(_0x2df59a,null));};exports[_0xf250('0x4c')]=function(_0x510204,_0x219f1e){var _0x444f48={'where':{'id':_0x510204['params']['id']}},_0x370eea={};_0x370eea[_0xf250('0x2b')]=_['keys'](db[_0xf250('0x27')]['rawAttributes']);_0x444f48[_0xf250('0x30')]=_[_0xf250('0x2f')](_0x370eea['model'],qs[_0xf250('0x41')](_0x510204[_0xf250('0x2c')][_0xf250('0x41')]));_0x444f48[_0xf250('0x30')]=_0x444f48[_0xf250('0x30')][_0xf250('0x31')]?_0x444f48['attributes']:_0x370eea[_0xf250('0x2b')];if(_0x510204[_0xf250('0x2c')]['includeAll']){_0x444f48[_0xf250('0x3d')]=[{'all':!![]}];}_0x444f48=_[_0xf250('0x3a')]({},_0x444f48,_0x510204[_0xf250('0x3b')]);return db['JscriptyProject'][_0xf250('0x42')](_0x444f48)[_0xf250('0x1e')](handleEntityNotFound(_0x219f1e,null))[_0xf250('0x1e')](function(_0x20cd02){if(_0x20cd02){var _0x395df9=_0x20cd02[_0xf250('0x20')]({'plain':!![]});_0x395df9=qs[_0xf250('0x4d')](_0x395df9,['id','createdAt',_0xf250('0x4e')]);_0x510204[_0xf250('0x44')]=_[_0xf250('0x4d')](_0x510204[_0xf250('0x44')],['id','createdAt',_0xf250('0x4e')]);return db[_0xf250('0x27')][_0xf250('0x43')](_[_0xf250('0x3a')](_0x395df9,_0x510204['body']),{'include':_0x510204[_0xf250('0x2c')][_0xf250('0x3c')]?[{'all':!![]}]:undefined})[_0xf250('0x1e')](function(_0x3682f2){var _0x3a17ae=_0x510204[_0xf250('0x45')][_0xf250('0x20')]({'plain':!![]});if(!_0x3a17ae)throw new Error(_0xf250('0x4f'));if(_0x3a17ae['role']===_0xf250('0x45')){var _0x91a924=_0x3682f2[_0xf250('0x20')]({'plain':!![]});var _0x51f296=_0xf250('0x21');return db[_0xf250('0x47')]['find']({'where':{'name':_0x51f296,'userProfileId':_0x3a17ae['userProfileId']},'raw':!![]})['then'](function(_0x37ff42){if(_0x37ff42&&_0x37ff42[_0xf250('0x49')]===0x0){return db[_0xf250('0x22')][_0xf250('0x43')]({'name':_0x91a924[_0xf250('0x25')],'resourceId':_0x91a924['id'],'type':_0x37ff42[_0xf250('0x25')],'sectionId':_0x37ff42['id']},{})[_0xf250('0x1e')](function(){return _0x3682f2;});}else{return _0x3682f2;}})[_0xf250('0x3f')](function(_0x33d8a6){logger[_0xf250('0x4a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x33d8a6);throw _0x33d8a6;});}return _0x3682f2;});}})[_0xf250('0x1e')](respondWithResult(_0x219f1e,0xc9))[_0xf250('0x3f')](handleError(_0x219f1e,null));};exports['update']=function(_0x53a6a6,_0x1b8efa){if(_0x53a6a6[_0xf250('0x44')]['id']){delete _0x53a6a6[_0xf250('0x44')]['id'];}return db[_0xf250('0x27')][_0xf250('0x42')]({'where':{'id':_0x53a6a6[_0xf250('0x50')]['id']}})[_0xf250('0x1e')](handleEntityNotFound(_0x1b8efa,null))[_0xf250('0x1e')](saveUpdates(_0x53a6a6[_0xf250('0x44')],null))[_0xf250('0x1e')](respondWithResult(_0x1b8efa,null))[_0xf250('0x3f')](handleError(_0x1b8efa,null));};exports[_0xf250('0x1f')]=function(_0x505b0e,_0x4356a8){return db['JscriptyProject'][_0xf250('0x42')]({'where':{'id':_0x505b0e[_0xf250('0x50')]['id']}})[_0xf250('0x1e')](handleEntityNotFound(_0x4356a8,null))[_0xf250('0x1e')](removeEntity(_0x4356a8,null))[_0xf250('0x3f')](handleError(_0x4356a8,null));};exports[_0xf250('0x51')]=function(_0x397bd1,_0x4b701f,_0x314c15){var _0x125f9f={'raw':!![],'where':{}};var _0x51f39f={};var _0x1fac1d={'count':0x0,'rows':[]};return db[_0xf250('0x27')][_0xf250('0x52')]({'where':{'id':_0x397bd1[_0xf250('0x50')]['id']}})[_0xf250('0x1e')](handleEntityNotFound(_0x4b701f,null))[_0xf250('0x1e')](function(_0x598e62){if(_0x598e62){_0x51f39f['model']=_['keys'](db['JscriptySessionReport'][_0xf250('0x53')]);_0x51f39f['query']=_[_0xf250('0x2d')](_0x397bd1[_0xf250('0x2c')]);_0x51f39f[_0xf250('0x2e')]=_[_0xf250('0x2f')](_0x51f39f['model'],_0x51f39f['query']);_0x125f9f[_0xf250('0x30')]=_[_0xf250('0x2f')](_0x51f39f[_0xf250('0x2b')],qs[_0xf250('0x41')](_0x397bd1['query']['fields']));_0x125f9f['attributes']=_0x125f9f[_0xf250('0x30')][_0xf250('0x31')]?_0x125f9f['attributes']:_0x51f39f['model'];if(!_0x397bd1[_0xf250('0x2c')]['hasOwnProperty'](_0xf250('0x33'))){_0x125f9f[_0xf250('0x18')]=qs[_0xf250('0x18')](_0x397bd1[_0xf250('0x2c')]['limit']);_0x125f9f[_0xf250('0x17')]=qs[_0xf250('0x17')](_0x397bd1[_0xf250('0x2c')][_0xf250('0x17')]);}_0x125f9f['order']=qs[_0xf250('0x35')](_0x397bd1[_0xf250('0x2c')][_0xf250('0x35')]);_0x125f9f[_0xf250('0x37')]=qs['filters'](_['pick'](_0x397bd1[_0xf250('0x2c')],_0x51f39f[_0xf250('0x2e')]));_0x125f9f[_0xf250('0x37')]['ProjectId']=_0x598e62['id'];if(_0x397bd1[_0xf250('0x2c')][_0xf250('0x39')]){_0x125f9f[_0xf250('0x37')]=_[_0xf250('0x3a')](_0x125f9f['where'],{'$or':_['map'](_0x125f9f[_0xf250('0x30')],function(_0x343542){var _0x5567df={};_0x5567df[_0x343542]={'$like':'%'+_0x397bd1[_0xf250('0x2c')]['filter']+'%'};return _0x5567df;})});}_0x125f9f=_[_0xf250('0x3a')]({},_0x125f9f,_0x397bd1['options']);return db[_0xf250('0x54')]['count']({'where':_0x125f9f[_0xf250('0x37')]})[_0xf250('0x1e')](function(_0x5bca3d){_0x1fac1d[_0xf250('0x16')]=_0x5bca3d;if(_0x397bd1['query']['includeAll']){_0x125f9f[_0xf250('0x3d')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0xf250('0x3e')](_0x125f9f);})[_0xf250('0x1e')](function(_0x41ecf3){_0x1fac1d[_0xf250('0x55')]=_0x41ecf3;return _0x1fac1d;});}})['then'](respondWithFilteredResult(_0x4b701f,_0x125f9f))['catch'](handleError(_0x4b701f,null));};exports[_0xf250('0x56')]=function(_0x12b300,_0x5dcd6b,_0x5df748){var _0x1447c6={'raw':!![],'where':{}};var _0x15c931={};var _0x34d904={'count':0x0,'rows':[]};return db[_0xf250('0x27')][_0xf250('0x52')]({'where':{'id':_0x12b300['params']['id']}})['then'](handleEntityNotFound(_0x5dcd6b,null))['then'](function(_0x3f9251){if(_0x3f9251){_0x15c931[_0xf250('0x2b')]=_[_0xf250('0x2d')](db[_0xf250('0x57')][_0xf250('0x53')]);_0x15c931[_0xf250('0x2c')]=_[_0xf250('0x2d')](_0x12b300['query']);_0x15c931[_0xf250('0x2e')]=_[_0xf250('0x2f')](_0x15c931['model'],_0x15c931[_0xf250('0x2c')]);_0x1447c6['attributes']=_[_0xf250('0x2f')](_0x15c931[_0xf250('0x2b')],qs['fields'](_0x12b300[_0xf250('0x2c')]['fields']));_0x1447c6[_0xf250('0x30')]=_0x1447c6[_0xf250('0x30')][_0xf250('0x31')]?_0x1447c6[_0xf250('0x30')]:_0x15c931['model'];if(!_0x12b300[_0xf250('0x2c')][_0xf250('0x32')]('nolimit')){_0x1447c6['limit']=qs[_0xf250('0x18')](_0x12b300[_0xf250('0x2c')]['limit']);_0x1447c6['offset']=qs[_0xf250('0x17')](_0x12b300['query'][_0xf250('0x17')]);}_0x1447c6['order']=qs[_0xf250('0x35')](_0x12b300[_0xf250('0x2c')][_0xf250('0x35')]);_0x1447c6[_0xf250('0x37')]=qs[_0xf250('0x2e')](_['pick'](_0x12b300[_0xf250('0x2c')],_0x15c931[_0xf250('0x2e')]));_0x1447c6[_0xf250('0x37')]['ProjectId']=_0x3f9251['id'];if(_0x12b300[_0xf250('0x2c')][_0xf250('0x39')]){_0x1447c6['where']=_[_0xf250('0x3a')](_0x1447c6[_0xf250('0x37')],{'$or':_[_0xf250('0x26')](_0x1447c6[_0xf250('0x30')],function(_0x4a075d){var _0x383692={};_0x383692[_0x4a075d]={'$like':'%'+_0x12b300[_0xf250('0x2c')][_0xf250('0x39')]+'%'};return _0x383692;})});}_0x1447c6=_['merge']({},_0x1447c6,_0x12b300['options']);return db[_0xf250('0x57')][_0xf250('0x16')]({'where':_0x1447c6[_0xf250('0x37')]})[_0xf250('0x1e')](function(_0x1d765a){_0x34d904['count']=_0x1d765a;if(_0x12b300[_0xf250('0x2c')][_0xf250('0x3c')]){_0x1447c6[_0xf250('0x3d')]=[{'all':!![]}];}return db[_0xf250('0x57')][_0xf250('0x3e')](_0x1447c6);})[_0xf250('0x1e')](function(_0x104169){_0x34d904['rows']=_0x104169;return _0x34d904;});}})['then'](respondWithFilteredResult(_0x5dcd6b,_0x1447c6))[_0xf250('0x3f')](handleError(_0x5dcd6b,null));};function char(_0x38745c){return'number'===typeof _0x38745c?String['fromCharCode'][_0xf250('0x1a')](null,arguments):_0x38745c;}function needsEncapsulation(_0x5487d5){return!!_0x5487d5&&(_0x5487d5[_0xf250('0x58')]()[_0xf250('0x59')](char(0xd))>=0x0||_0x5487d5[_0xf250('0x58')]()[_0xf250('0x59')](char(0xa))>=0x0||_0x5487d5[_0xf250('0x58')]()[_0xf250('0x59')](char(0x2c))>=0x0||_0x5487d5[_0xf250('0x58')]()[_0xf250('0x59')](char(0x22))>=0x0);}function encapsulate(_0x5d7f33){var _0x561076=char(0x22),_0x47d9b6='\x5c'+char(0x22),_0x26e347=_0x5d7f33[_0xf250('0x58')]()[_0xf250('0x5a')](new RegExp(_0x561076,'g'),_0x47d9b6);return _0x561076+_0x26e347+_0x561076;}exports[_0xf250('0x5b')]=function(_0x445e1d,_0x368452,_0x527ed2){var _0x3f6e8e,_0x37d362;var _0x28b258={'where':{'ProjectId':_0x445e1d['params']['id']}};if(_0x445e1d[_0xf250('0x2c')]['startTime']){_0x28b258[_0xf250('0x37')][_0xf250('0x5c')]=JSON['parse'](_0x445e1d[_0xf250('0x2c')][_0xf250('0x5d')]);}return db[_0xf250('0x54')][_0xf250('0x3e')](_0x28b258)[_0xf250('0x1e')](handleEntityNotFound(_0x368452,null))[_0xf250('0x1e')](function(_0x3d611d){if(_0x3d611d){_0x3f6e8e=_0x3d611d;return db[_0xf250('0x5e')][_0xf250('0x3e')]({'where':{'SessionId':{'$in':_[_0xf250('0x26')](_0x3f6e8e,'id')},'ProjectId':_0x445e1d[_0xf250('0x50')]['id']},'order':_0xf250('0x5f')});}})[_0xf250('0x1e')](handleEntityNotFound(_0x368452,null))['then'](function(_0x3fbe5b){if(_0x3fbe5b){_0x37d362=_0x3fbe5b;var _0x4d93d8={};for(var _0x4d963a=0x0,_0x32e642=_0x37d362[_0xf250('0x31')];_0x4d963a<_0x32e642;_0x4d963a++){if(!_0x4d93d8['hasOwnProperty'](_0x37d362[_0x4d963a]['questionId'])){_0x4d93d8[_0x37d362[_0x4d963a][_0xf250('0x60')]]=needsEncapsulation(_0x37d362[_0x4d963a]['question'])?encapsulate(_0x37d362[_0x4d963a][_0xf250('0x61')]):_0x37d362[_0x4d963a][_0xf250('0x61')];}}var _0x1e8da7=[],_0x2ee8b1={};for(var _0x14fa5b=0x0,_0x557d0f=_0x3f6e8e[_0xf250('0x31')];_0x14fa5b<_0x557d0f;_0x14fa5b++){_0x2ee8b1={'ProjectId':_0x445e1d[_0xf250('0x50')]['id'],'SessionId':_0x3f6e8e[_0x14fa5b]['id'],'StartTime':moment(_0x3f6e8e[_0x14fa5b][_0xf250('0x5c')])[_0xf250('0x62')]('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x1b88d5=0x0,_0x1eb1ef=_0x37d362[_0xf250('0x31')];_0x1b88d5<_0x1eb1ef;_0x1b88d5++){if(_0x37d362[_0x1b88d5][_0xf250('0x63')]==_0x3f6e8e[_0x14fa5b]['id']&&_0x4d93d8['hasOwnProperty'](_0x37d362[_0x1b88d5]['questionId'])){_0x2ee8b1[_0x4d93d8[_0x37d362[_0x1b88d5][_0xf250('0x60')]]]=_0x37d362[_0x1b88d5][_0xf250('0x64')];}}for(var _0x39693c in _0x4d93d8){if(!_0x2ee8b1[_0xf250('0x32')](_0x4d93d8[_0x39693c])){_0x2ee8b1[_0x4d93d8[_0x39693c]]=null;}}_0x1e8da7[_0xf250('0x65')](_0x2ee8b1);}return _0x1e8da7;}})[_0xf250('0x1e')](function(_0x3e00c1){if(!_['isEmpty'](_0x3e00c1)){var _0x2534ca=toCsv(_0x3e00c1);var _0x426b87=Date[_0xf250('0x66')]();fs[_0xf250('0x67')](util['format']('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x445e1d[_0xf250('0x50')]['id'],_0x426b87),_0x2534ca);_0x368452[_0xf250('0x68')]('Content-disposition',_0xf250('0x69')+util[_0xf250('0x62')](_0xf250('0x6a'),_0x445e1d[_0xf250('0x50')]['id'],_0x426b87));_0x368452[_0xf250('0x68')]('Content-type',_0xf250('0x6b'));return _0x368452[_0xf250('0x6c')](util[_0xf250('0x62')](_0xf250('0x6d'),_0x445e1d[_0xf250('0x50')]['id'],_0x426b87));}else{return _0x368452['sendStatus'](0xcc);}})[_0xf250('0x3f')](handleError(_0x368452,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 248eee0..b601ef7 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 _0x9af9=['../../config/environment','./jscriptyProject.attributes','exports','define','jscripty_projects','lodash','api','bluebird','request-promise','path','rimraf'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x9af9,0x73));var _0x99af=function(_0x1d2f50,_0x34752f){_0x1d2f50=_0x1d2f50-0x0;var _0x2e4651=_0x9af9[_0x1d2f50];return _0x2e4651;};'use strict';var _=require(_0x99af('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x99af('0x1'));var moment=require('moment');var BPromise=require(_0x99af('0x2'));var rp=require(_0x99af('0x3'));var fs=require('fs');var path=require(_0x99af('0x4'));var rimraf=require(_0x99af('0x5'));var config=require(_0x99af('0x6'));var attributes=require(_0x99af('0x7'));module[_0x99af('0x8')]=function(_0x975145,_0x2c24d1){return _0x975145[_0x99af('0x9')]('JscriptyProject',attributes,{'tableName':_0x99af('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3ee6=['../../config/environment','./jscriptyProject.attributes','exports','define','lodash','util','../../config/logger','moment','request-promise','path','rimraf'];(function(_0x4074d5,_0xa57194){var _0x502cfe=function(_0x345efa){while(--_0x345efa){_0x4074d5['push'](_0x4074d5['shift']());}};_0x502cfe(++_0xa57194);}(_0x3ee6,0x1b1));var _0x63ee=function(_0x34ef57,_0x5f0fd1){_0x34ef57=_0x34ef57-0x0;var _0x4d2bea=_0x3ee6[_0x34ef57];return _0x4d2bea;};'use strict';var _=require(_0x63ee('0x0'));var util=require(_0x63ee('0x1'));var logger=require(_0x63ee('0x2'))('api');var moment=require(_0x63ee('0x3'));var BPromise=require('bluebird');var rp=require(_0x63ee('0x4'));var fs=require('fs');var path=require(_0x63ee('0x5'));var rimraf=require(_0x63ee('0x6'));var config=require(_0x63ee('0x7'));var attributes=require(_0x63ee('0x8'));module[_0x63ee('0x9')]=function(_0x354f1e,_0x505536){return _0x354f1e[_0x63ee('0xa')]('JscriptyProject',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 85c940a..4b6cc4c 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 _0x3bff=['JscriptyProject,\x20%s,\x20%s','debug','JscriptyProject,\x20%s,\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','client','http','request','then','info'];(function(_0x17702f,_0x570158){var _0x3afcb4=function(_0x1c1f97){while(--_0x1c1f97){_0x17702f['push'](_0x17702f['shift']());}};_0x3afcb4(++_0x570158);}(_0x3bff,0x19a));var _0xf3bf=function(_0x295317,_0x46aebf){_0x295317=_0x295317-0x0;var _0x458246=_0x3bff[_0x295317];return _0x458246;};'use strict';var _=require(_0xf3bf('0x0'));var util=require(_0xf3bf('0x1'));var moment=require(_0xf3bf('0x2'));var BPromise=require(_0xf3bf('0x3'));var rs=require(_0xf3bf('0x4'));var fs=require('fs');var Redis=require(_0xf3bf('0x5'));var db=require(_0xf3bf('0x6'))['db'];var utils=require(_0xf3bf('0x7'));var logger=require(_0xf3bf('0x8'))('rpc');var config=require(_0xf3bf('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf3bf('0xa')][_0xf3bf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x83a942,_0x2baaa2,_0x171957){return new BPromise(function(_0x4972d4,_0x4a8647){return client[_0xf3bf('0xc')](_0x83a942,_0x171957)[_0xf3bf('0xd')](function(_0x37ba6d){logger[_0xf3bf('0xe')](_0xf3bf('0xf'),_0x2baaa2,'request\x20sent');logger[_0xf3bf('0x10')](_0xf3bf('0x11'),_0x2baaa2,_0xf3bf('0x12'),JSON[_0xf3bf('0x13')](_0x37ba6d));if(_0x37ba6d[_0xf3bf('0x14')]){if(_0x37ba6d[_0xf3bf('0x14')][_0xf3bf('0x15')]===0x1f4){logger[_0xf3bf('0x14')](_0xf3bf('0xf'),_0x2baaa2,_0x37ba6d[_0xf3bf('0x14')][_0xf3bf('0x16')]);return _0x4a8647(_0x37ba6d[_0xf3bf('0x14')][_0xf3bf('0x16')]);}logger['error'](_0xf3bf('0xf'),_0x2baaa2,_0x37ba6d[_0xf3bf('0x14')][_0xf3bf('0x16')]);return _0x4972d4(_0x37ba6d[_0xf3bf('0x14')][_0xf3bf('0x16')]);}else{logger[_0xf3bf('0xe')](_0xf3bf('0xf'),_0x2baaa2,_0xf3bf('0x12'));_0x4972d4(_0x37ba6d[_0xf3bf('0x17')][_0xf3bf('0x16')]);}})[_0xf3bf('0x18')](function(_0x44b393){logger[_0xf3bf('0x14')](_0xf3bf('0xf'),_0x2baaa2,_0x44b393);_0x4a8647(_0x44b393);});});} \ No newline at end of file +var _0xb47d=['http','then','info','JscriptyProject,\x20%s,\x20%s','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xb47d,0xa7));var _0xdb47=function(_0x3bbbe5,_0xaadd66){_0x3bbbe5=_0x3bbbe5-0x0;var _0x5708bd=_0xb47d[_0x3bbbe5];return _0x5708bd;};'use strict';var _=require(_0xdb47('0x0'));var util=require('util');var moment=require(_0xdb47('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdb47('0x2'))['db'];var utils=require(_0xdb47('0x3'));var logger=require(_0xdb47('0x4'))(_0xdb47('0x5'));var config=require(_0xdb47('0x6'));var jayson=require(_0xdb47('0x7'));var client=jayson[_0xdb47('0x8')][_0xdb47('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x22348d,_0x309a5f,_0x1b3e79){return new BPromise(function(_0x2b6659,_0x2eface){return client['request'](_0x22348d,_0x1b3e79)[_0xdb47('0xa')](function(_0x349ae1){logger[_0xdb47('0xb')](_0xdb47('0xc'),_0x309a5f,'request\x20sent');logger[_0xdb47('0xd')](_0xdb47('0xe'),_0x309a5f,_0xdb47('0xf'),JSON[_0xdb47('0x10')](_0x349ae1));if(_0x349ae1[_0xdb47('0x11')]){if(_0x349ae1[_0xdb47('0x11')][_0xdb47('0x12')]===0x1f4){logger[_0xdb47('0x11')]('JscriptyProject,\x20%s,\x20%s',_0x309a5f,_0x349ae1[_0xdb47('0x11')]['message']);return _0x2eface(_0x349ae1[_0xdb47('0x11')]['message']);}logger[_0xdb47('0x11')](_0xdb47('0xc'),_0x309a5f,_0x349ae1['error']['message']);return _0x2b6659(_0x349ae1[_0xdb47('0x11')][_0xdb47('0x13')]);}else{logger[_0xdb47('0xb')](_0xdb47('0xc'),_0x309a5f,_0xdb47('0xf'));_0x2b6659(_0x349ae1[_0xdb47('0x14')][_0xdb47('0x13')]);}})[_0xdb47('0x15')](function(_0xf5eaf1){logger[_0xdb47('0x11')]('JscriptyProject,\x20%s,\x20%s',_0x309a5f,_0xf5eaf1);_0x2eface(_0xf5eaf1);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 07d42ef..da5556b 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 _0x2b45=['connect-timeout','express','../../components/auth/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','update','delete','destroy','exports','util','path'];(function(_0x3cecfd,_0x560e91){var _0x307e03=function(_0x3db6c0){while(--_0x3db6c0){_0x3cecfd['push'](_0x3cecfd['shift']());}};_0x307e03(++_0x560e91);}(_0x2b45,0x1de));var _0x52b4=function(_0x296e16,_0x15c306){_0x296e16=_0x296e16-0x0;var _0x4efff5=_0x2b45[_0x296e16];return _0x4efff5;};'use strict';var multer=require('multer');var util=require(_0x52b4('0x0'));var path=require(_0x52b4('0x1'));var timeout=require(_0x52b4('0x2'));var express=require(_0x52b4('0x3'));var router=express['Router']();var auth=require(_0x52b4('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x52b4('0x5'));var controller=require(_0x52b4('0x6'));router[_0x52b4('0x7')]('/',auth[_0x52b4('0x8')](),controller[_0x52b4('0x9')]);router['get']('/describe',auth[_0x52b4('0x8')](),controller[_0x52b4('0xa')]);router[_0x52b4('0x7')](_0x52b4('0xb'),auth['isAuthenticated'](),controller[_0x52b4('0xc')]);router[_0x52b4('0xd')]('/',auth['isAuthenticated'](),controller[_0x52b4('0xe')]);router[_0x52b4('0xf')]('/:id',auth[_0x52b4('0x8')](),controller[_0x52b4('0x10')]);router[_0x52b4('0x11')]('/:id',auth[_0x52b4('0x8')](),controller[_0x52b4('0x12')]);module[_0x52b4('0x13')]=router; \ No newline at end of file +var _0x40de=['show','post','create','put','update','delete','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x40de,0x1e7));var _0xe40d=function(_0x5cdf5d,_0x616e66){_0x5cdf5d=_0x5cdf5d-0x0;var _0x2b947a=_0x40de[_0x5cdf5d];return _0x2b947a;};'use strict';var multer=require(_0xe40d('0x0'));var util=require(_0xe40d('0x1'));var path=require(_0xe40d('0x2'));var timeout=require('connect-timeout');var express=require(_0xe40d('0x3'));var router=express[_0xe40d('0x4')]();var auth=require(_0xe40d('0x5'));var interaction=require(_0xe40d('0x6'));var config=require('../../config/environment');var controller=require('./jscriptyQuestionReport.controller');router[_0xe40d('0x7')]('/',auth[_0xe40d('0x8')](),controller[_0xe40d('0x9')]);router[_0xe40d('0x7')](_0xe40d('0xa'),auth[_0xe40d('0x8')](),controller[_0xe40d('0xb')]);router[_0xe40d('0x7')](_0xe40d('0xc'),auth[_0xe40d('0x8')](),controller[_0xe40d('0xd')]);router[_0xe40d('0xe')]('/',auth[_0xe40d('0x8')](),controller[_0xe40d('0xf')]);router[_0xe40d('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xe40d('0x11')]);router[_0xe40d('0x12')]('/:id',auth[_0xe40d('0x8')](),controller['destroy']);module[_0xe40d('0x13')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 69da919..4770c6a 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 _0xaa62=['STRING','TEXT','sequelize'];(function(_0x911353,_0x1648ed){var _0x2f05fa=function(_0x4a00a4){while(--_0x4a00a4){_0x911353['push'](_0x911353['shift']());}};_0x2f05fa(++_0x1648ed);}(_0xaa62,0x16d));var _0x2aa6=function(_0x2e1a12,_0x16cf07){_0x2e1a12=_0x2e1a12-0x0;var _0x7f1afd=_0xaa62[_0x2e1a12];return _0x7f1afd;};'use strict';var Sequelize=require(_0x2aa6('0x0'));module['exports']={'question':{'type':Sequelize[_0x2aa6('0x1')]},'answer':{'type':Sequelize[_0x2aa6('0x2')]('long')},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0x2aa6('0x1')]},'queue':{'type':Sequelize[_0x2aa6('0x1')]},'uniqueid':{'type':Sequelize[_0x2aa6('0x1')]},'calleridname':{'type':Sequelize[_0x2aa6('0x1')]},'calleridnum':{'type':Sequelize[_0x2aa6('0x1')]},'questionId':{'type':Sequelize[_0x2aa6('0x1')]}}; \ No newline at end of file +var _0xf298=['long','sequelize','exports','STRING'];(function(_0xebe75b,_0xdb1fe0){var _0x25abbf=function(_0x3dea8e){while(--_0x3dea8e){_0xebe75b['push'](_0xebe75b['shift']());}};_0x25abbf(++_0xdb1fe0);}(_0xf298,0x1e1));var _0x8f29=function(_0x2b2b30,_0x19334c){_0x2b2b30=_0x2b2b30-0x0;var _0xd04a81=_0xf298[_0x2b2b30];return _0xd04a81;};'use strict';var Sequelize=require(_0x8f29('0x0'));module[_0x8f29('0x1')]={'question':{'type':Sequelize[_0x8f29('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x8f29('0x3'))},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x8f29('0x2')]},'uniqueid':{'type':Sequelize[_0x8f29('0x2')]},'calleridname':{'type':Sequelize[_0x8f29('0x2')]},'calleridnum':{'type':Sequelize[_0x8f29('0x2')]},'questionId':{'type':Sequelize[_0x8f29('0x2')]}}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js index 25372ab..1ad9ead 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 _0xc3b5=['end','error','name','index','map','JscriptyQuestionReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','pick','where','merge','VIRTUAL','options','count','includeAll','findAll','catch','show','params','include','find','create','body','describe','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','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/environment','../../mysqldb','sendStatus','status','offset','limit','set','Content-Range','json','apply','reject','update','destroy','then'];(function(_0x3f5ec9,_0x2ed473){var _0x503ca4=function(_0x16a834){while(--_0x16a834){_0x3f5ec9['push'](_0x3f5ec9['shift']());}};_0x503ca4(++_0x2ed473);}(_0xc3b5,0x103));var _0x5c3b=function(_0x44a735,_0x19f829){_0x44a735=_0x44a735-0x0;var _0x3386e8=_0xc3b5[_0x44a735];return _0x3386e8;};'use strict';var pdf=require(_0x5c3b('0x0'));var emlformat=require(_0x5c3b('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x5c3b('0x2'));var jsonpatch=require(_0x5c3b('0x3'));var rp=require('request-promise');var moment=require(_0x5c3b('0x4'));var BPromise=require(_0x5c3b('0x5'));var Mustache=require(_0x5c3b('0x6'));var util=require(_0x5c3b('0x7'));var path=require(_0x5c3b('0x8'));var sox=require(_0x5c3b('0x9'));var csv=require(_0x5c3b('0xa'));var ejs=require(_0x5c3b('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x5c3b('0xc'));var crypto=require(_0x5c3b('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5c3b('0xe'));var toCsv=require(_0x5c3b('0xa'));var querystring=require(_0x5c3b('0xf'));var Papa=require('papaparse');var Redis=require(_0x5c3b('0x10'));var authService=require(_0x5c3b('0x11'));var qs=require(_0x5c3b('0x12'));var as=require(_0x5c3b('0x13'));var hardwareService=require(_0x5c3b('0x14'));var logger=require(_0x5c3b('0x15'))(_0x5c3b('0x16'));var utils=require('../../config/utils');var config=require(_0x5c3b('0x17'));var db=require(_0x5c3b('0x18'))['db'];function respondWithStatusCode(_0x3194f5,_0x44fdd8){_0x44fdd8=_0x44fdd8||0xcc;return function(_0x3ec6ef){if(_0x3ec6ef){return _0x3194f5[_0x5c3b('0x19')](_0x44fdd8);}return _0x3194f5['status'](_0x44fdd8)['end']();};}function respondWithResult(_0x1120c0,_0x497ae9){_0x497ae9=_0x497ae9||0xc8;return function(_0x3a4d3a){if(_0x3a4d3a){return _0x1120c0[_0x5c3b('0x1a')](_0x497ae9)['json'](_0x3a4d3a);}};}function respondWithFilteredResult(_0xf01881,_0x3099df){return function(_0x118145){if(_0x118145){var _0x2ba056=_0x118145['count'],_0x5ade6f=_0x3099df[_0x5c3b('0x1b')],_0x29cc70=_0x3099df['offset']+_0x3099df[_0x5c3b('0x1c')],_0x2923cb;if(_0x29cc70>=_0x2ba056){_0x29cc70=_0x2ba056;_0x2923cb=0xc8;}else{_0x2923cb=0xce;}_0xf01881[_0x5c3b('0x1a')](_0x2923cb);return _0xf01881[_0x5c3b('0x1d')](_0x5c3b('0x1e'),_0x5ade6f+'-'+_0x29cc70+'/'+_0x2ba056)[_0x5c3b('0x1f')](_0x118145);}return null;};}function patchUpdates(_0x1808f0){return function(_0x9e367c){try{jsonpatch[_0x5c3b('0x20')](_0x9e367c,_0x1808f0,!![]);}catch(_0x43b524){return BPromise[_0x5c3b('0x21')](_0x43b524);}return _0x9e367c['save']();};}function saveUpdates(_0x1ecbe7,_0x1d0a4e){return function(_0x40b8c1){if(_0x40b8c1){return _0x40b8c1[_0x5c3b('0x22')](_0x1ecbe7)['then'](function(_0x1f1577){return _0x1f1577;});}return null;};}function removeEntity(_0xf2e63f,_0x507c04){return function(_0x2ed97f){if(_0x2ed97f){return _0x2ed97f[_0x5c3b('0x23')]()[_0x5c3b('0x24')](function(){_0xf2e63f[_0x5c3b('0x1a')](0xcc)[_0x5c3b('0x25')]();});}};}function handleEntityNotFound(_0x4dd6eb,_0x45f8dd){return function(_0x324f11){if(!_0x324f11){_0x4dd6eb[_0x5c3b('0x19')](0x194);}return _0x324f11;};}function handleError(_0x15e007,_0x25c46d){_0x25c46d=_0x25c46d||0x1f4;return function(_0x5d38d7){logger[_0x5c3b('0x26')](_0x5d38d7['stack']);if(_0x5d38d7['name']){delete _0x5d38d7[_0x5c3b('0x27')];}_0x15e007[_0x5c3b('0x1a')](_0x25c46d)['send'](_0x5d38d7);};}exports[_0x5c3b('0x28')]=function(_0x4be1f9,_0x5437a0){var _0x46190d={},_0x57a2a8={},_0x2d34f0={'count':0x0,'rows':[]};var _0x29ee42=_[_0x5c3b('0x29')](db[_0x5c3b('0x2a')][_0x5c3b('0x2b')],function(_0xbda673){return{'name':_0xbda673[_0x5c3b('0x2c')],'type':_0xbda673[_0x5c3b('0x2d')][_0x5c3b('0x2e')]};});_0x57a2a8[_0x5c3b('0x2f')]=_[_0x5c3b('0x29')](_0x29ee42,_0x5c3b('0x27'));_0x57a2a8[_0x5c3b('0x30')]=_[_0x5c3b('0x31')](_0x4be1f9[_0x5c3b('0x30')]);_0x57a2a8[_0x5c3b('0x32')]=_['intersection'](_0x57a2a8['model'],_0x57a2a8[_0x5c3b('0x30')]);_0x46190d[_0x5c3b('0x33')]=_[_0x5c3b('0x34')](_0x57a2a8['model'],qs[_0x5c3b('0x35')](_0x4be1f9['query'][_0x5c3b('0x35')]));_0x46190d[_0x5c3b('0x33')]=_0x46190d[_0x5c3b('0x33')][_0x5c3b('0x36')]?_0x46190d[_0x5c3b('0x33')]:_0x57a2a8['model'];if(!_0x4be1f9[_0x5c3b('0x30')]['hasOwnProperty'](_0x5c3b('0x37'))){_0x46190d['limit']=qs[_0x5c3b('0x1c')](_0x4be1f9[_0x5c3b('0x30')][_0x5c3b('0x1c')]);_0x46190d[_0x5c3b('0x1b')]=qs[_0x5c3b('0x1b')](_0x4be1f9['query'][_0x5c3b('0x1b')]);}_0x46190d[_0x5c3b('0x38')]=qs[_0x5c3b('0x39')](_0x4be1f9[_0x5c3b('0x30')]['sort']);_0x46190d['where']=qs[_0x5c3b('0x32')](_[_0x5c3b('0x3a')](_0x4be1f9['query'],_0x57a2a8['filters']));if(_0x4be1f9[_0x5c3b('0x30')]['filter']){_0x46190d[_0x5c3b('0x3b')]=_[_0x5c3b('0x3c')](_0x46190d[_0x5c3b('0x3b')],{'$or':_[_0x5c3b('0x29')](_0x29ee42,function(_0x251a5f){if(_0x251a5f[_0x5c3b('0x2d')]!==_0x5c3b('0x3d')){var _0x1fe320={};_0x1fe320[_0x251a5f[_0x5c3b('0x27')]]={'$like':'%'+_0x4be1f9[_0x5c3b('0x30')]['filter']+'%'};return _0x1fe320;}})});}_0x46190d=_[_0x5c3b('0x3c')]({},_0x46190d,_0x4be1f9[_0x5c3b('0x3e')]);var _0x111564={'where':_0x46190d[_0x5c3b('0x3b')]};return db['JscriptyQuestionReport'][_0x5c3b('0x3f')](_0x111564)[_0x5c3b('0x24')](function(_0x39aed5){_0x2d34f0[_0x5c3b('0x3f')]=_0x39aed5;if(_0x4be1f9['query'][_0x5c3b('0x40')]){_0x46190d['include']=[{'all':!![]}];}return db[_0x5c3b('0x2a')][_0x5c3b('0x41')](_0x46190d);})[_0x5c3b('0x24')](function(_0x309397){_0x2d34f0['rows']=_0x309397;return _0x2d34f0;})[_0x5c3b('0x24')](respondWithFilteredResult(_0x5437a0,_0x46190d))[_0x5c3b('0x42')](handleError(_0x5437a0,null));};exports[_0x5c3b('0x43')]=function(_0x406ca2,_0x4218ed){var _0x1f659c={'raw':!![],'where':{'id':_0x406ca2[_0x5c3b('0x44')]['id']}},_0x2e4cc1={};_0x2e4cc1[_0x5c3b('0x2f')]=_[_0x5c3b('0x31')](db[_0x5c3b('0x2a')]['rawAttributes']);_0x2e4cc1['query']=_[_0x5c3b('0x31')](_0x406ca2['query']);_0x2e4cc1[_0x5c3b('0x32')]=_[_0x5c3b('0x34')](_0x2e4cc1[_0x5c3b('0x2f')],_0x2e4cc1[_0x5c3b('0x30')]);_0x1f659c[_0x5c3b('0x33')]=_[_0x5c3b('0x34')](_0x2e4cc1[_0x5c3b('0x2f')],qs[_0x5c3b('0x35')](_0x406ca2[_0x5c3b('0x30')][_0x5c3b('0x35')]));_0x1f659c[_0x5c3b('0x33')]=_0x1f659c[_0x5c3b('0x33')][_0x5c3b('0x36')]?_0x1f659c[_0x5c3b('0x33')]:_0x2e4cc1[_0x5c3b('0x2f')];if(_0x406ca2[_0x5c3b('0x30')][_0x5c3b('0x40')]){_0x1f659c[_0x5c3b('0x45')]=[{'all':!![]}];}_0x1f659c=_[_0x5c3b('0x3c')]({},_0x1f659c,_0x406ca2[_0x5c3b('0x3e')]);return db['JscriptyQuestionReport'][_0x5c3b('0x46')](_0x1f659c)[_0x5c3b('0x24')](handleEntityNotFound(_0x4218ed,null))[_0x5c3b('0x24')](respondWithResult(_0x4218ed,null))[_0x5c3b('0x42')](handleError(_0x4218ed,null));};exports[_0x5c3b('0x47')]=function(_0x44faf9,_0x77977f){return db[_0x5c3b('0x2a')][_0x5c3b('0x47')](_0x44faf9[_0x5c3b('0x48')],{})[_0x5c3b('0x24')](respondWithResult(_0x77977f,0xc9))[_0x5c3b('0x42')](handleError(_0x77977f,null));};exports[_0x5c3b('0x22')]=function(_0x44014c,_0x2bba17){if(_0x44014c[_0x5c3b('0x48')]['id']){delete _0x44014c[_0x5c3b('0x48')]['id'];}return db[_0x5c3b('0x2a')]['find']({'where':{'id':_0x44014c[_0x5c3b('0x44')]['id']}})[_0x5c3b('0x24')](handleEntityNotFound(_0x2bba17,null))[_0x5c3b('0x24')](saveUpdates(_0x44014c['body'],null))[_0x5c3b('0x24')](respondWithResult(_0x2bba17,null))[_0x5c3b('0x42')](handleError(_0x2bba17,null));};exports['destroy']=function(_0x2b7920,_0x2db907){return db['JscriptyQuestionReport'][_0x5c3b('0x46')]({'where':{'id':_0x2b7920[_0x5c3b('0x44')]['id']}})[_0x5c3b('0x24')](handleEntityNotFound(_0x2db907,null))[_0x5c3b('0x24')](removeEntity(_0x2db907,null))[_0x5c3b('0x42')](handleError(_0x2db907,null));};exports[_0x5c3b('0x49')]=function(_0x38c739,_0x3d583d){return db[_0x5c3b('0x2a')][_0x5c3b('0x49')]()[_0x5c3b('0x24')](respondWithResult(_0x3d583d,null))['catch'](handleError(_0x3d583d,null));}; \ No newline at end of file +var _0x27e4=['ejs','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','JscriptyQuestionReport','rawAttributes','fieldName','type','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','params','model','intersection','length','find','catch','create','body','update','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','mustache','path','sox','to-csv'];(function(_0x4afab8,_0x2ffa2a){var _0x14a02d=function(_0x2cb2cd){while(--_0x2cb2cd){_0x4afab8['push'](_0x4afab8['shift']());}};_0x14a02d(++_0x2ffa2a);}(_0x27e4,0x1e1));var _0x427e=function(_0x5018a0,_0x309ea9){_0x5018a0=_0x5018a0-0x0;var _0x58a867=_0x27e4[_0x5018a0];return _0x58a867;};'use strict';var pdf=require(_0x427e('0x0'));var emlformat=require(_0x427e('0x1'));var rimraf=require(_0x427e('0x2'));var zipdir=require(_0x427e('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x427e('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x427e('0x5'));var util=require('util');var path=require(_0x427e('0x6'));var sox=require(_0x427e('0x7'));var csv=require(_0x427e('0x8'));var ejs=require(_0x427e('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x427e('0xa'));var jsforce=require(_0x427e('0xb'));var deskjs=require(_0x427e('0xc'));var toCsv=require(_0x427e('0x8'));var querystring=require(_0x427e('0xd'));var Papa=require(_0x427e('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x427e('0xf'));var as=require(_0x427e('0x10'));var hardwareService=require(_0x427e('0x11'));var logger=require('../../config/logger')(_0x427e('0x12'));var utils=require('../../config/utils');var config=require(_0x427e('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1f39ce,_0x213196){_0x213196=_0x213196||0xcc;return function(_0x17c0af){if(_0x17c0af){return _0x1f39ce[_0x427e('0x14')](_0x213196);}return _0x1f39ce[_0x427e('0x15')](_0x213196)['end']();};}function respondWithResult(_0x4c62b4,_0x4fb92e){_0x4fb92e=_0x4fb92e||0xc8;return function(_0x4563d5){if(_0x4563d5){return _0x4c62b4[_0x427e('0x15')](_0x4fb92e)[_0x427e('0x16')](_0x4563d5);}};}function respondWithFilteredResult(_0x5f04ea,_0x10f53b){return function(_0x40bb64){if(_0x40bb64){var _0x39ac95=_0x40bb64[_0x427e('0x17')],_0x3d19c7=_0x10f53b[_0x427e('0x18')],_0x5946c6=_0x10f53b[_0x427e('0x18')]+_0x10f53b['limit'],_0x54422e;if(_0x5946c6>=_0x39ac95){_0x5946c6=_0x39ac95;_0x54422e=0xc8;}else{_0x54422e=0xce;}_0x5f04ea[_0x427e('0x15')](_0x54422e);return _0x5f04ea[_0x427e('0x19')](_0x427e('0x1a'),_0x3d19c7+'-'+_0x5946c6+'/'+_0x39ac95)[_0x427e('0x16')](_0x40bb64);}return null;};}function patchUpdates(_0x22bf55){return function(_0x5172c8){try{jsonpatch[_0x427e('0x1b')](_0x5172c8,_0x22bf55,!![]);}catch(_0xa39ebf){return BPromise[_0x427e('0x1c')](_0xa39ebf);}return _0x5172c8[_0x427e('0x1d')]();};}function saveUpdates(_0x558105,_0x262978){return function(_0x3daff0){if(_0x3daff0){return _0x3daff0['update'](_0x558105)[_0x427e('0x1e')](function(_0xc3634d){return _0xc3634d;});}return null;};}function removeEntity(_0x1721ea,_0x4c25c2){return function(_0x5bba5e){if(_0x5bba5e){return _0x5bba5e[_0x427e('0x1f')]()[_0x427e('0x1e')](function(){_0x1721ea['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x52ad71,_0x12ec37){return function(_0x29cfc3){if(!_0x29cfc3){_0x52ad71[_0x427e('0x14')](0x194);}return _0x29cfc3;};}function handleError(_0x653a78,_0x267d2c){_0x267d2c=_0x267d2c||0x1f4;return function(_0x2238f8){logger[_0x427e('0x20')](_0x2238f8[_0x427e('0x21')]);if(_0x2238f8[_0x427e('0x22')]){delete _0x2238f8['name'];}_0x653a78['status'](_0x267d2c)[_0x427e('0x23')](_0x2238f8);};}exports[_0x427e('0x24')]=function(_0x50e78c,_0x294402){var _0x4ae690={},_0x2b5ce1={},_0x52ecc2={'count':0x0,'rows':[]};var _0x304455=_[_0x427e('0x25')](db[_0x427e('0x26')][_0x427e('0x27')],function(_0x2adf6d){return{'name':_0x2adf6d[_0x427e('0x28')],'type':_0x2adf6d[_0x427e('0x29')]['key']};});_0x2b5ce1['model']=_[_0x427e('0x25')](_0x304455,'name');_0x2b5ce1[_0x427e('0x2a')]=_[_0x427e('0x2b')](_0x50e78c[_0x427e('0x2a')]);_0x2b5ce1[_0x427e('0x2c')]=_['intersection'](_0x2b5ce1['model'],_0x2b5ce1[_0x427e('0x2a')]);_0x4ae690[_0x427e('0x2d')]=_['intersection'](_0x2b5ce1['model'],qs[_0x427e('0x2e')](_0x50e78c[_0x427e('0x2a')][_0x427e('0x2e')]));_0x4ae690[_0x427e('0x2d')]=_0x4ae690[_0x427e('0x2d')]['length']?_0x4ae690[_0x427e('0x2d')]:_0x2b5ce1['model'];if(!_0x50e78c[_0x427e('0x2a')][_0x427e('0x2f')](_0x427e('0x30'))){_0x4ae690['limit']=qs['limit'](_0x50e78c[_0x427e('0x2a')][_0x427e('0x31')]);_0x4ae690[_0x427e('0x18')]=qs[_0x427e('0x18')](_0x50e78c['query']['offset']);}_0x4ae690[_0x427e('0x32')]=qs[_0x427e('0x33')](_0x50e78c['query'][_0x427e('0x33')]);_0x4ae690['where']=qs[_0x427e('0x2c')](_['pick'](_0x50e78c[_0x427e('0x2a')],_0x2b5ce1[_0x427e('0x2c')]));if(_0x50e78c[_0x427e('0x2a')][_0x427e('0x34')]){_0x4ae690[_0x427e('0x35')]=_[_0x427e('0x36')](_0x4ae690[_0x427e('0x35')],{'$or':_['map'](_0x304455,function(_0x31cb2f){if(_0x31cb2f[_0x427e('0x29')]!==_0x427e('0x37')){var _0x298302={};_0x298302[_0x31cb2f[_0x427e('0x22')]]={'$like':'%'+_0x50e78c[_0x427e('0x2a')]['filter']+'%'};return _0x298302;}})});}_0x4ae690=_[_0x427e('0x36')]({},_0x4ae690,_0x50e78c['options']);var _0x27b4f2={'where':_0x4ae690['where']};return db[_0x427e('0x26')]['count'](_0x27b4f2)[_0x427e('0x1e')](function(_0x4998f5){_0x52ecc2[_0x427e('0x17')]=_0x4998f5;if(_0x50e78c[_0x427e('0x2a')][_0x427e('0x38')]){_0x4ae690[_0x427e('0x39')]=[{'all':!![]}];}return db[_0x427e('0x26')][_0x427e('0x3a')](_0x4ae690);})[_0x427e('0x1e')](function(_0x3e1269){_0x52ecc2[_0x427e('0x3b')]=_0x3e1269;return _0x52ecc2;})[_0x427e('0x1e')](respondWithFilteredResult(_0x294402,_0x4ae690))['catch'](handleError(_0x294402,null));};exports['show']=function(_0x347980,_0x1cc12c){var _0x2f1cc0={'raw':!![],'where':{'id':_0x347980[_0x427e('0x3c')]['id']}},_0x35aef0={};_0x35aef0[_0x427e('0x3d')]=_['keys'](db[_0x427e('0x26')][_0x427e('0x27')]);_0x35aef0[_0x427e('0x2a')]=_[_0x427e('0x2b')](_0x347980['query']);_0x35aef0['filters']=_['intersection'](_0x35aef0[_0x427e('0x3d')],_0x35aef0[_0x427e('0x2a')]);_0x2f1cc0['attributes']=_[_0x427e('0x3e')](_0x35aef0[_0x427e('0x3d')],qs[_0x427e('0x2e')](_0x347980['query'][_0x427e('0x2e')]));_0x2f1cc0[_0x427e('0x2d')]=_0x2f1cc0[_0x427e('0x2d')][_0x427e('0x3f')]?_0x2f1cc0[_0x427e('0x2d')]:_0x35aef0['model'];if(_0x347980['query'][_0x427e('0x38')]){_0x2f1cc0[_0x427e('0x39')]=[{'all':!![]}];}_0x2f1cc0=_[_0x427e('0x36')]({},_0x2f1cc0,_0x347980['options']);return db[_0x427e('0x26')][_0x427e('0x40')](_0x2f1cc0)[_0x427e('0x1e')](handleEntityNotFound(_0x1cc12c,null))['then'](respondWithResult(_0x1cc12c,null))[_0x427e('0x41')](handleError(_0x1cc12c,null));};exports[_0x427e('0x42')]=function(_0x3c2123,_0x441e71){return db[_0x427e('0x26')][_0x427e('0x42')](_0x3c2123[_0x427e('0x43')],{})['then'](respondWithResult(_0x441e71,0xc9))['catch'](handleError(_0x441e71,null));};exports[_0x427e('0x44')]=function(_0x5eba09,_0x48f4b0){if(_0x5eba09[_0x427e('0x43')]['id']){delete _0x5eba09['body']['id'];}return db[_0x427e('0x26')][_0x427e('0x40')]({'where':{'id':_0x5eba09[_0x427e('0x3c')]['id']}})[_0x427e('0x1e')](handleEntityNotFound(_0x48f4b0,null))[_0x427e('0x1e')](saveUpdates(_0x5eba09[_0x427e('0x43')],null))[_0x427e('0x1e')](respondWithResult(_0x48f4b0,null))[_0x427e('0x41')](handleError(_0x48f4b0,null));};exports[_0x427e('0x1f')]=function(_0x1f29ba,_0x377d50){return db['JscriptyQuestionReport'][_0x427e('0x40')]({'where':{'id':_0x1f29ba[_0x427e('0x3c')]['id']}})[_0x427e('0x1e')](handleEntityNotFound(_0x377d50,null))[_0x427e('0x1e')](removeEntity(_0x377d50,null))[_0x427e('0x41')](handleError(_0x377d50,null));};exports[_0x427e('0x45')]=function(_0x4a393f,_0x1dbf0a){return db[_0x427e('0x26')][_0x427e('0x45')]()['then'](respondWithResult(_0x1dbf0a,null))[_0x427e('0x41')](handleError(_0x1dbf0a,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index ff0b5db..b31b775 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 _0x0300=['api','moment','request-promise','path','../../config/environment','exports','JscriptyQuestionReport','report_jscripty_questions','lodash'];(function(_0x56e0e8,_0x16ef91){var _0x2dab50=function(_0x4fe720){while(--_0x4fe720){_0x56e0e8['push'](_0x56e0e8['shift']());}};_0x2dab50(++_0x16ef91);}(_0x0300,0xbc));var _0x0030=function(_0x1fb8d3,_0x4e6853){_0x1fb8d3=_0x1fb8d3-0x0;var _0x2e8009=_0x0300[_0x1fb8d3];return _0x2e8009;};'use strict';var _=require(_0x0030('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0030('0x1'));var moment=require(_0x0030('0x2'));var BPromise=require('bluebird');var rp=require(_0x0030('0x3'));var fs=require('fs');var path=require(_0x0030('0x4'));var rimraf=require('rimraf');var config=require(_0x0030('0x5'));var attributes=require('./jscriptyQuestionReport.attributes');module[_0x0030('0x6')]=function(_0x5137ea,_0x40facc){return _0x5137ea['define'](_0x0030('0x7'),attributes,{'tableName':_0x0030('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x18c2=['util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','report_jscripty_questions','lodash'];(function(_0x2273bd,_0x1ed2a4){var _0xd3b5cf=function(_0x148531){while(--_0x148531){_0x2273bd['push'](_0x2273bd['shift']());}};_0xd3b5cf(++_0x1ed2a4);}(_0x18c2,0xcf));var _0x218c=function(_0x42d233,_0x140ae4){_0x42d233=_0x42d233-0x0;var _0x329de9=_0x18c2[_0x42d233];return _0x329de9;};'use strict';var _=require(_0x218c('0x0'));var util=require(_0x218c('0x1'));var logger=require(_0x218c('0x2'))(_0x218c('0x3'));var moment=require(_0x218c('0x4'));var BPromise=require('bluebird');var rp=require(_0x218c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x218c('0x6'));var config=require(_0x218c('0x7'));var attributes=require(_0x218c('0x8'));module[_0x218c('0x9')]=function(_0x4c878d,_0x2a0707){return _0x4c878d[_0x218c('0xa')](_0x218c('0xb'),attributes,{'tableName':_0x218c('0xc'),'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 5c8d6ab..5e8bcf6 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 _0x6c99=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x57293e,_0x331fdb){var _0x11be6f=function(_0x314906){while(--_0x314906){_0x57293e['push'](_0x57293e['shift']());}};_0x11be6f(++_0x331fdb);}(_0x6c99,0x1b5));var _0x96c9=function(_0x27604f,_0x5ae336){_0x27604f=_0x27604f-0x0;var _0x40d189=_0x6c99[_0x27604f];return _0x40d189;};'use strict';var _=require(_0x96c9('0x0'));var util=require(_0x96c9('0x1'));var moment=require('moment');var BPromise=require(_0x96c9('0x2'));var rs=require(_0x96c9('0x3'));var fs=require('fs');var Redis=require(_0x96c9('0x4'));var db=require(_0x96c9('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x96c9('0x6'));var jayson=require(_0x96c9('0x7'));var client=jayson[_0x96c9('0x8')][_0x96c9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xfbef7a,_0x5d7745,_0x279bf0){return new BPromise(function(_0x34ae62,_0x469eea){return client['request'](_0xfbef7a,_0x279bf0)['then'](function(_0x18bcfb){logger[_0x96c9('0xa')](_0x96c9('0xb'),_0x5d7745,_0x96c9('0xc'));logger[_0x96c9('0xd')](_0x96c9('0xe'),_0x5d7745,_0x96c9('0xc'),JSON[_0x96c9('0xf')](_0x18bcfb));if(_0x18bcfb[_0x96c9('0x10')]){if(_0x18bcfb[_0x96c9('0x10')][_0x96c9('0x11')]===0x1f4){logger['error'](_0x96c9('0xb'),_0x5d7745,_0x18bcfb[_0x96c9('0x10')][_0x96c9('0x12')]);return _0x469eea(_0x18bcfb['error']['message']);}logger[_0x96c9('0x10')](_0x96c9('0xb'),_0x5d7745,_0x18bcfb[_0x96c9('0x10')]['message']);return _0x34ae62(_0x18bcfb[_0x96c9('0x10')]['message']);}else{logger[_0x96c9('0xa')](_0x96c9('0xb'),_0x5d7745,_0x96c9('0xc'));_0x34ae62(_0x18bcfb['result'][_0x96c9('0x12')]);}})['catch'](function(_0x36a69d){logger['error']('JscriptyQuestionReport,\x20%s,\x20%s',_0x5d7745,_0x36a69d);_0x469eea(_0x36a69d);});});} \ No newline at end of file +var _0x3aa5=['randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','moment'];(function(_0x542b10,_0x3fe704){var _0x7dea26=function(_0x48cec0){while(--_0x48cec0){_0x542b10['push'](_0x542b10['shift']());}};_0x7dea26(++_0x3fe704);}(_0x3aa5,0x1ca));var _0x53aa=function(_0x83d516,_0x1c8f68){_0x83d516=_0x83d516-0x0;var _0x394f63=_0x3aa5[_0x83d516];return _0x394f63;};'use strict';var _=require('lodash');var util=require(_0x53aa('0x0'));var moment=require(_0x53aa('0x1'));var BPromise=require('bluebird');var rs=require(_0x53aa('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x53aa('0x3'))['db'];var utils=require(_0x53aa('0x4'));var logger=require('../../config/logger')(_0x53aa('0x5'));var config=require(_0x53aa('0x6'));var jayson=require(_0x53aa('0x7'));var client=jayson[_0x53aa('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x31e301,_0x2600c8,_0x1f6888){return new BPromise(function(_0x37c541,_0xc3874a){return client[_0x53aa('0x9')](_0x31e301,_0x1f6888)[_0x53aa('0xa')](function(_0x294664){logger[_0x53aa('0xb')](_0x53aa('0xc'),_0x2600c8,_0x53aa('0xd'));logger[_0x53aa('0xe')](_0x53aa('0xf'),_0x2600c8,_0x53aa('0xd'),JSON[_0x53aa('0x10')](_0x294664));if(_0x294664['error']){if(_0x294664[_0x53aa('0x11')]['code']===0x1f4){logger['error']('JscriptyQuestionReport,\x20%s,\x20%s',_0x2600c8,_0x294664[_0x53aa('0x11')]['message']);return _0xc3874a(_0x294664[_0x53aa('0x11')][_0x53aa('0x12')]);}logger[_0x53aa('0x11')](_0x53aa('0xc'),_0x2600c8,_0x294664[_0x53aa('0x11')]['message']);return _0x37c541(_0x294664['error']['message']);}else{logger[_0x53aa('0xb')](_0x53aa('0xc'),_0x2600c8,_0x53aa('0xd'));_0x37c541(_0x294664['result'][_0x53aa('0x12')]);}})[_0x53aa('0x13')](function(_0xdacedc){logger[_0x53aa('0x11')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x2600c8,_0xdacedc);_0xc3874a(_0xdacedc);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 77060ed..9866cce 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 _0x9221=['post','put','delete','/:id','util','path','express','Router','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','index','describe','/:id/questions'];(function(_0x2080a3,_0x48acfa){var _0x8d7d17=function(_0x2dbc06){while(--_0x2dbc06){_0x2080a3['push'](_0x2080a3['shift']());}};_0x8d7d17(++_0x48acfa);}(_0x9221,0x64));var _0x1922=function(_0x401b3e,_0xed8de5){_0x401b3e=_0x401b3e-0x0;var _0x4f290f=_0x9221[_0x401b3e];return _0x4f290f;};'use strict';var multer=require('multer');var util=require(_0x1922('0x0'));var path=require(_0x1922('0x1'));var timeout=require('connect-timeout');var express=require(_0x1922('0x2'));var router=express[_0x1922('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x1922('0x4'));var config=require(_0x1922('0x5'));var controller=require(_0x1922('0x6'));router[_0x1922('0x7')]('/',auth[_0x1922('0x8')](),controller[_0x1922('0x9')]);router[_0x1922('0x7')]('/describe',auth[_0x1922('0x8')](),controller[_0x1922('0xa')]);router[_0x1922('0x7')]('/:id',auth[_0x1922('0x8')](),controller['show']);router[_0x1922('0x7')](_0x1922('0xb'),auth[_0x1922('0x8')](),controller['getQuestions']);router[_0x1922('0xc')]('/',auth[_0x1922('0x8')](),controller['create']);router[_0x1922('0xd')]('/:id',auth[_0x1922('0x8')](),controller['update']);router[_0x1922('0xe')](_0x1922('0xf'),auth[_0x1922('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xb205=['multer','util','path','connect-timeout','express','../../components/interaction/service','./jscriptySessionReport.controller','get','index','/describe','describe','show','/:id/questions','isAuthenticated','getQuestions','post','put','/:id','destroy','exports'];(function(_0x42a1c9,_0x22f44b){var _0x5c3ccb=function(_0x51170d){while(--_0x51170d){_0x42a1c9['push'](_0x42a1c9['shift']());}};_0x5c3ccb(++_0x22f44b);}(_0xb205,0xf0));var _0x5b20=function(_0x196af9,_0x15697f){_0x196af9=_0x196af9-0x0;var _0xeafee4=_0xb205[_0x196af9];return _0xeafee4;};'use strict';var multer=require(_0x5b20('0x0'));var util=require(_0x5b20('0x1'));var path=require(_0x5b20('0x2'));var timeout=require(_0x5b20('0x3'));var express=require(_0x5b20('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x5b20('0x5'));var config=require('../../config/environment');var controller=require(_0x5b20('0x6'));router[_0x5b20('0x7')]('/',auth['isAuthenticated'](),controller[_0x5b20('0x8')]);router[_0x5b20('0x7')](_0x5b20('0x9'),auth['isAuthenticated'](),controller[_0x5b20('0xa')]);router[_0x5b20('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x5b20('0xb')]);router[_0x5b20('0x7')](_0x5b20('0xc'),auth[_0x5b20('0xd')](),controller[_0x5b20('0xe')]);router[_0x5b20('0xf')]('/',auth[_0x5b20('0xd')](),controller['create']);router[_0x5b20('0x10')](_0x5b20('0x11'),auth[_0x5b20('0xd')](),controller['update']);router['delete'](_0x5b20('0x11'),auth[_0x5b20('0xd')](),controller[_0x5b20('0x12')]);module[_0x5b20('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 947ded4..f8e6ee9 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 _0x0a38=['YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment','sequelize','exports','setDataValue','starttime'];(function(_0x18cd5b,_0x10240b){var _0x5eaa52=function(_0x2bccad){while(--_0x2bccad){_0x18cd5b['push'](_0x18cd5b['shift']());}};_0x5eaa52(++_0x10240b);}(_0x0a38,0x10b));var _0x80a3=function(_0x182475,_0x59cc18){_0x182475=_0x182475-0x0;var _0x1a2ef6=_0x0a38[_0x182475];return _0x1a2ef6;};'use strict';var moment=require(_0x80a3('0x0'));var Sequelize=require(_0x80a3('0x1'));module[_0x80a3('0x2')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0x22a6a8){this[_0x80a3('0x3')](_0x80a3('0x4'),_0x22a6a8);this[_0x80a3('0x3')]('endtime',moment()['format'](_0x80a3('0x5')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0x80a3('0x6')]},'projectname':{'type':Sequelize[_0x80a3('0x6')]},'queue':{'type':Sequelize[_0x80a3('0x6')]},'uniqueid':{'type':Sequelize[_0x80a3('0x6')]},'calleridname':{'type':Sequelize[_0x80a3('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize[_0x80a3('0x7')],'defaultValue':![]}}; \ No newline at end of file +var _0x7e3a=['setDataValue','starttime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment','sequelize','exports','DATE'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7e3a,0xac));var _0xa7e3=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x7e3a[_0x167cc1];return _0x10bc4b;};'use strict';var moment=require(_0xa7e3('0x0'));var Sequelize=require(_0xa7e3('0x1'));module[_0xa7e3('0x2')]={'starttime':{'type':Sequelize[_0xa7e3('0x3')],'set':function(_0x33588a){this[_0xa7e3('0x4')](_0xa7e3('0x5'),_0x33588a);this['setDataValue'](_0xa7e3('0x6'),moment()[_0xa7e3('0x7')](_0xa7e3('0x8')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0xa7e3('0x9')]},'projectname':{'type':Sequelize[_0xa7e3('0x9')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xa7e3('0x9')]},'calleridname':{'type':Sequelize[_0xa7e3('0x9')]},'calleridnum':{'type':Sequelize[_0xa7e3('0x9')]},'completed':{'type':Sequelize[_0xa7e3('0xa')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index a0a9f07..ee0af4f 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 _0xbe33=['merge','VIRTUAL','options','include','JscriptySessionReport','findAll','rows','catch','show','params','length','includeAll','find','create','body','describe','getQuestions','findOne','order','SessionId','JscriptyQuestionReport','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','error','name','send','index','map','rawAttributes','type','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0xbe33,0xfc));var _0x3be3=function(_0x394c4c,_0x201031){_0x394c4c=_0x394c4c-0x0;var _0x5bfa5a=_0xbe33[_0x394c4c];return _0x5bfa5a;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x3be3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3be3('0x1'));var jsonpatch=require(_0x3be3('0x2'));var rp=require('request-promise');var moment=require(_0x3be3('0x3'));var BPromise=require(_0x3be3('0x4'));var Mustache=require(_0x3be3('0x5'));var util=require(_0x3be3('0x6'));var path=require(_0x3be3('0x7'));var sox=require(_0x3be3('0x8'));var csv=require(_0x3be3('0x9'));var ejs=require(_0x3be3('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x3be3('0xb'));var crypto=require('crypto');var jsforce=require(_0x3be3('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x3be3('0x9'));var querystring=require(_0x3be3('0xd'));var Papa=require(_0x3be3('0xe'));var Redis=require(_0x3be3('0xf'));var authService=require(_0x3be3('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x3be3('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3be3('0x12'))(_0x3be3('0x13'));var utils=require(_0x3be3('0x14'));var config=require('../../config/environment');var db=require(_0x3be3('0x15'))['db'];function respondWithStatusCode(_0x2276fb,_0x58b40f){_0x58b40f=_0x58b40f||0xcc;return function(_0x4fd33b){if(_0x4fd33b){return _0x2276fb[_0x3be3('0x16')](_0x58b40f);}return _0x2276fb[_0x3be3('0x17')](_0x58b40f)[_0x3be3('0x18')]();};}function respondWithResult(_0x4b79c1,_0x29321a){_0x29321a=_0x29321a||0xc8;return function(_0x5d2501){if(_0x5d2501){return _0x4b79c1[_0x3be3('0x17')](_0x29321a)[_0x3be3('0x19')](_0x5d2501);}};}function respondWithFilteredResult(_0x5a4337,_0x4d3641){return function(_0x3b9299){if(_0x3b9299){var _0x93989b=_0x3b9299[_0x3be3('0x1a')],_0x282876=_0x4d3641[_0x3be3('0x1b')],_0x44a53=_0x4d3641[_0x3be3('0x1b')]+_0x4d3641[_0x3be3('0x1c')],_0x35043f;if(_0x44a53>=_0x93989b){_0x44a53=_0x93989b;_0x35043f=0xc8;}else{_0x35043f=0xce;}_0x5a4337[_0x3be3('0x17')](_0x35043f);return _0x5a4337[_0x3be3('0x1d')](_0x3be3('0x1e'),_0x282876+'-'+_0x44a53+'/'+_0x93989b)['json'](_0x3b9299);}return null;};}function patchUpdates(_0x21d4f6){return function(_0x112098){try{jsonpatch[_0x3be3('0x1f')](_0x112098,_0x21d4f6,!![]);}catch(_0x936611){return BPromise['reject'](_0x936611);}return _0x112098[_0x3be3('0x20')]();};}function saveUpdates(_0x44a8fe,_0x28e400){return function(_0x39915b){if(_0x39915b){return _0x39915b[_0x3be3('0x21')](_0x44a8fe)[_0x3be3('0x22')](function(_0x1b5073){return _0x1b5073;});}return null;};}function removeEntity(_0xf406a5,_0x3f46bb){return function(_0x513654){if(_0x513654){return _0x513654[_0x3be3('0x23')]()[_0x3be3('0x22')](function(){_0xf406a5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x12ec79,_0x10e557){return function(_0x842b5b){if(!_0x842b5b){_0x12ec79[_0x3be3('0x16')](0x194);}return _0x842b5b;};}function handleError(_0x12d700,_0x556844){_0x556844=_0x556844||0x1f4;return function(_0xa4df43){logger[_0x3be3('0x24')](_0xa4df43['stack']);if(_0xa4df43[_0x3be3('0x25')]){delete _0xa4df43['name'];}_0x12d700['status'](_0x556844)[_0x3be3('0x26')](_0xa4df43);};}exports[_0x3be3('0x27')]=function(_0x4f578b,_0x4463b7){var _0x34c443={},_0x5e350e={},_0x3f4351={'count':0x0,'rows':[]};var _0x193c85=_[_0x3be3('0x28')](db['JscriptySessionReport'][_0x3be3('0x29')],function(_0x4e5c52){return{'name':_0x4e5c52['fieldName'],'type':_0x4e5c52[_0x3be3('0x2a')]['key']};});_0x5e350e[_0x3be3('0x2b')]=_[_0x3be3('0x28')](_0x193c85,_0x3be3('0x25'));_0x5e350e[_0x3be3('0x2c')]=_[_0x3be3('0x2d')](_0x4f578b[_0x3be3('0x2c')]);_0x5e350e[_0x3be3('0x2e')]=_['intersection'](_0x5e350e[_0x3be3('0x2b')],_0x5e350e['query']);_0x34c443[_0x3be3('0x2f')]=_[_0x3be3('0x30')](_0x5e350e[_0x3be3('0x2b')],qs[_0x3be3('0x31')](_0x4f578b['query'][_0x3be3('0x31')]));_0x34c443['attributes']=_0x34c443[_0x3be3('0x2f')]['length']?_0x34c443[_0x3be3('0x2f')]:_0x5e350e[_0x3be3('0x2b')];if(!_0x4f578b['query'][_0x3be3('0x32')](_0x3be3('0x33'))){_0x34c443[_0x3be3('0x1c')]=qs[_0x3be3('0x1c')](_0x4f578b[_0x3be3('0x2c')][_0x3be3('0x1c')]);_0x34c443[_0x3be3('0x1b')]=qs['offset'](_0x4f578b[_0x3be3('0x2c')]['offset']);}_0x34c443['order']=qs[_0x3be3('0x34')](_0x4f578b[_0x3be3('0x2c')]['sort']);_0x34c443[_0x3be3('0x35')]=qs[_0x3be3('0x2e')](_[_0x3be3('0x36')](_0x4f578b['query'],_0x5e350e[_0x3be3('0x2e')]));if(_0x4f578b[_0x3be3('0x2c')][_0x3be3('0x37')]){_0x34c443[_0x3be3('0x35')]=_[_0x3be3('0x38')](_0x34c443[_0x3be3('0x35')],{'$or':_['map'](_0x193c85,function(_0x200caa){if(_0x200caa[_0x3be3('0x2a')]!==_0x3be3('0x39')){var _0xd69b16={};_0xd69b16[_0x200caa[_0x3be3('0x25')]]={'$like':'%'+_0x4f578b[_0x3be3('0x2c')][_0x3be3('0x37')]+'%'};return _0xd69b16;}})});}_0x34c443=_['merge']({},_0x34c443,_0x4f578b[_0x3be3('0x3a')]);var _0x5a0b5a={'where':_0x34c443[_0x3be3('0x35')]};return db['JscriptySessionReport']['count'](_0x5a0b5a)[_0x3be3('0x22')](function(_0x1881fc){_0x3f4351[_0x3be3('0x1a')]=_0x1881fc;if(_0x4f578b['query']['includeAll']){_0x34c443[_0x3be3('0x3b')]=[{'all':!![]}];}return db[_0x3be3('0x3c')][_0x3be3('0x3d')](_0x34c443);})[_0x3be3('0x22')](function(_0xc7684b){_0x3f4351[_0x3be3('0x3e')]=_0xc7684b;return _0x3f4351;})[_0x3be3('0x22')](respondWithFilteredResult(_0x4463b7,_0x34c443))[_0x3be3('0x3f')](handleError(_0x4463b7,null));};exports[_0x3be3('0x40')]=function(_0x3330c2,_0x261e28){var _0x329d5b={'raw':!![],'where':{'id':_0x3330c2[_0x3be3('0x41')]['id']}},_0x355454={};_0x355454[_0x3be3('0x2b')]=_[_0x3be3('0x2d')](db['JscriptySessionReport'][_0x3be3('0x29')]);_0x355454[_0x3be3('0x2c')]=_[_0x3be3('0x2d')](_0x3330c2[_0x3be3('0x2c')]);_0x355454[_0x3be3('0x2e')]=_[_0x3be3('0x30')](_0x355454['model'],_0x355454['query']);_0x329d5b[_0x3be3('0x2f')]=_[_0x3be3('0x30')](_0x355454['model'],qs[_0x3be3('0x31')](_0x3330c2[_0x3be3('0x2c')][_0x3be3('0x31')]));_0x329d5b['attributes']=_0x329d5b[_0x3be3('0x2f')][_0x3be3('0x42')]?_0x329d5b[_0x3be3('0x2f')]:_0x355454['model'];if(_0x3330c2['query'][_0x3be3('0x43')]){_0x329d5b['include']=[{'all':!![]}];}_0x329d5b=_[_0x3be3('0x38')]({},_0x329d5b,_0x3330c2['options']);return db['JscriptySessionReport'][_0x3be3('0x44')](_0x329d5b)[_0x3be3('0x22')](handleEntityNotFound(_0x261e28,null))['then'](respondWithResult(_0x261e28,null))[_0x3be3('0x3f')](handleError(_0x261e28,null));};exports[_0x3be3('0x45')]=function(_0x234aeb,_0x3d91c0){return db[_0x3be3('0x3c')][_0x3be3('0x45')](_0x234aeb[_0x3be3('0x46')],{})[_0x3be3('0x22')](respondWithResult(_0x3d91c0,0xc9))[_0x3be3('0x3f')](handleError(_0x3d91c0,null));};exports[_0x3be3('0x21')]=function(_0x6e5214,_0x3b09f7){if(_0x6e5214[_0x3be3('0x46')]['id']){delete _0x6e5214[_0x3be3('0x46')]['id'];}return db['JscriptySessionReport'][_0x3be3('0x44')]({'where':{'id':_0x6e5214[_0x3be3('0x41')]['id']}})[_0x3be3('0x22')](handleEntityNotFound(_0x3b09f7,null))['then'](saveUpdates(_0x6e5214[_0x3be3('0x46')],null))[_0x3be3('0x22')](respondWithResult(_0x3b09f7,null))[_0x3be3('0x3f')](handleError(_0x3b09f7,null));};exports['destroy']=function(_0x4c8c75,_0x198d82){return db[_0x3be3('0x3c')][_0x3be3('0x44')]({'where':{'id':_0x4c8c75[_0x3be3('0x41')]['id']}})[_0x3be3('0x22')](handleEntityNotFound(_0x198d82,null))[_0x3be3('0x22')](removeEntity(_0x198d82,null))['catch'](handleError(_0x198d82,null));};exports[_0x3be3('0x47')]=function(_0x424c3e,_0x1a2825){return db['JscriptySessionReport'][_0x3be3('0x47')]()[_0x3be3('0x22')](respondWithResult(_0x1a2825,null))[_0x3be3('0x3f')](handleError(_0x1a2825,null));};exports[_0x3be3('0x48')]=function(_0x45d1ce,_0x3ae045,_0x1ff2d6){var _0x5f00f3={'raw':!![],'where':{}};var _0xb9eeae={};var _0x204d48={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0x3be3('0x49')]({'where':{'id':_0x45d1ce[_0x3be3('0x41')]['id']}})['then'](handleEntityNotFound(_0x3ae045,null))[_0x3be3('0x22')](function(_0x2f4196){if(_0x2f4196){_0xb9eeae['model']=_[_0x3be3('0x2d')](db['JscriptyQuestionReport']['rawAttributes']);_0xb9eeae[_0x3be3('0x2c')]=_['keys'](_0x45d1ce[_0x3be3('0x2c')]);_0xb9eeae[_0x3be3('0x2e')]=_[_0x3be3('0x30')](_0xb9eeae['model'],_0xb9eeae['query']);_0x5f00f3[_0x3be3('0x2f')]=_[_0x3be3('0x30')](_0xb9eeae['model'],qs['fields'](_0x45d1ce[_0x3be3('0x2c')][_0x3be3('0x31')]));_0x5f00f3['attributes']=_0x5f00f3['attributes'][_0x3be3('0x42')]?_0x5f00f3[_0x3be3('0x2f')]:_0xb9eeae[_0x3be3('0x2b')];if(!_0x45d1ce[_0x3be3('0x2c')][_0x3be3('0x32')](_0x3be3('0x33'))){_0x5f00f3[_0x3be3('0x1c')]=qs[_0x3be3('0x1c')](_0x45d1ce[_0x3be3('0x2c')][_0x3be3('0x1c')]);_0x5f00f3[_0x3be3('0x1b')]=qs[_0x3be3('0x1b')](_0x45d1ce[_0x3be3('0x2c')][_0x3be3('0x1b')]);}_0x5f00f3[_0x3be3('0x4a')]=qs[_0x3be3('0x34')](_0x45d1ce[_0x3be3('0x2c')][_0x3be3('0x34')]);_0x5f00f3[_0x3be3('0x35')]=qs[_0x3be3('0x2e')](_[_0x3be3('0x36')](_0x45d1ce[_0x3be3('0x2c')],_0xb9eeae['filters']));_0x5f00f3[_0x3be3('0x35')][_0x3be3('0x4b')]=_0x2f4196['id'];if(_0x45d1ce[_0x3be3('0x2c')][_0x3be3('0x37')]){_0x5f00f3[_0x3be3('0x35')]=_[_0x3be3('0x38')](_0x5f00f3[_0x3be3('0x35')],{'$or':_[_0x3be3('0x28')](_0x5f00f3[_0x3be3('0x2f')],function(_0x5031ca){var _0x387226={};_0x387226[_0x5031ca]={'$like':'%'+_0x45d1ce['query']['filter']+'%'};return _0x387226;})});}_0x5f00f3=_[_0x3be3('0x38')]({},_0x5f00f3,_0x45d1ce[_0x3be3('0x3a')]);return db['JscriptyQuestionReport'][_0x3be3('0x1a')]({'where':_0x5f00f3['where']})['then'](function(_0x44dd8b){_0x204d48[_0x3be3('0x1a')]=_0x44dd8b;if(_0x45d1ce[_0x3be3('0x2c')][_0x3be3('0x43')]){_0x5f00f3[_0x3be3('0x3b')]=[{'all':!![]}];}return db[_0x3be3('0x4c')][_0x3be3('0x3d')](_0x5f00f3);})[_0x3be3('0x22')](function(_0xe4dcc2){_0x204d48[_0x3be3('0x3e')]=_0xe4dcc2;return _0x204d48;});}})[_0x3be3('0x22')](respondWithFilteredResult(_0x3ae045,_0x5f00f3))[_0x3be3('0x3f')](handleError(_0x3ae045,null));}; \ No newline at end of file +var _0xa83b=['crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','JscriptySessionReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','options','count','includeAll','include','findAll','rows','catch','show','params','merge','find','create','body','describe','getQuestions','findOne','SessionId','JscriptyQuestionReport','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel'];(function(_0x49d27a,_0x166543){var _0x3f0b62=function(_0x4eb485){while(--_0x4eb485){_0x49d27a['push'](_0x49d27a['shift']());}};_0x3f0b62(++_0x166543);}(_0xa83b,0xe8));var _0xba83=function(_0x2a6f35,_0x394274){_0x2a6f35=_0x2a6f35-0x0;var _0x4a0e0b=_0xa83b[_0x2a6f35];return _0x4a0e0b;};'use strict';var pdf=require(_0xba83('0x0'));var emlformat=require(_0xba83('0x1'));var rimraf=require(_0xba83('0x2'));var zipdir=require(_0xba83('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xba83('0x4'));var moment=require(_0xba83('0x5'));var BPromise=require(_0xba83('0x6'));var Mustache=require(_0xba83('0x7'));var util=require(_0xba83('0x8'));var path=require('path');var sox=require(_0xba83('0x9'));var csv=require(_0xba83('0xa'));var ejs=require(_0xba83('0xb'));var fs=require('fs');var _=require(_0xba83('0xc'));var squel=require(_0xba83('0xd'));var crypto=require(_0xba83('0xe'));var jsforce=require(_0xba83('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xba83('0x10'));var Redis=require(_0xba83('0x11'));var authService=require(_0xba83('0x12'));var qs=require(_0xba83('0x13'));var as=require(_0xba83('0x14'));var hardwareService=require(_0xba83('0x15'));var logger=require('../../config/logger')(_0xba83('0x16'));var utils=require('../../config/utils');var config=require(_0xba83('0x17'));var db=require(_0xba83('0x18'))['db'];function respondWithStatusCode(_0x59cb7f,_0x3f5308){_0x3f5308=_0x3f5308||0xcc;return function(_0x246305){if(_0x246305){return _0x59cb7f[_0xba83('0x19')](_0x3f5308);}return _0x59cb7f[_0xba83('0x1a')](_0x3f5308)[_0xba83('0x1b')]();};}function respondWithResult(_0x45c14a,_0x504e2f){_0x504e2f=_0x504e2f||0xc8;return function(_0x2dcae6){if(_0x2dcae6){return _0x45c14a[_0xba83('0x1a')](_0x504e2f)['json'](_0x2dcae6);}};}function respondWithFilteredResult(_0x4d7aee,_0x507969){return function(_0x195501){if(_0x195501){var _0x2bbe98=_0x195501['count'],_0x45647e=_0x507969[_0xba83('0x1c')],_0x506abc=_0x507969[_0xba83('0x1c')]+_0x507969['limit'],_0xec465e;if(_0x506abc>=_0x2bbe98){_0x506abc=_0x2bbe98;_0xec465e=0xc8;}else{_0xec465e=0xce;}_0x4d7aee[_0xba83('0x1a')](_0xec465e);return _0x4d7aee[_0xba83('0x1d')](_0xba83('0x1e'),_0x45647e+'-'+_0x506abc+'/'+_0x2bbe98)[_0xba83('0x1f')](_0x195501);}return null;};}function patchUpdates(_0x38062c){return function(_0x4786a0){try{jsonpatch[_0xba83('0x20')](_0x4786a0,_0x38062c,!![]);}catch(_0x45f0b8){return BPromise[_0xba83('0x21')](_0x45f0b8);}return _0x4786a0[_0xba83('0x22')]();};}function saveUpdates(_0xf0fa36,_0x1038c8){return function(_0x4c6e03){if(_0x4c6e03){return _0x4c6e03[_0xba83('0x23')](_0xf0fa36)[_0xba83('0x24')](function(_0x18ddf5){return _0x18ddf5;});}return null;};}function removeEntity(_0x95a158,_0x4a0926){return function(_0x24fdf0){if(_0x24fdf0){return _0x24fdf0[_0xba83('0x25')]()['then'](function(){_0x95a158[_0xba83('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f7097,_0x1f2b74){return function(_0x999ee0){if(!_0x999ee0){_0x4f7097['sendStatus'](0x194);}return _0x999ee0;};}function handleError(_0x11c8fb,_0x4ec6a2){_0x4ec6a2=_0x4ec6a2||0x1f4;return function(_0x5007f7){logger[_0xba83('0x26')](_0x5007f7[_0xba83('0x27')]);if(_0x5007f7[_0xba83('0x28')]){delete _0x5007f7['name'];}_0x11c8fb[_0xba83('0x1a')](_0x4ec6a2)[_0xba83('0x29')](_0x5007f7);};}exports[_0xba83('0x2a')]=function(_0x332b47,_0x4507dc){var _0xfbbb7={},_0x2faa1b={},_0x1edabf={'count':0x0,'rows':[]};var _0x402fef=_[_0xba83('0x2b')](db[_0xba83('0x2c')][_0xba83('0x2d')],function(_0x32c9df){return{'name':_0x32c9df[_0xba83('0x2e')],'type':_0x32c9df[_0xba83('0x2f')]['key']};});_0x2faa1b[_0xba83('0x30')]=_[_0xba83('0x2b')](_0x402fef,_0xba83('0x28'));_0x2faa1b[_0xba83('0x31')]=_[_0xba83('0x32')](_0x332b47[_0xba83('0x31')]);_0x2faa1b[_0xba83('0x33')]=_[_0xba83('0x34')](_0x2faa1b[_0xba83('0x30')],_0x2faa1b[_0xba83('0x31')]);_0xfbbb7[_0xba83('0x35')]=_['intersection'](_0x2faa1b['model'],qs[_0xba83('0x36')](_0x332b47[_0xba83('0x31')]['fields']));_0xfbbb7['attributes']=_0xfbbb7['attributes'][_0xba83('0x37')]?_0xfbbb7[_0xba83('0x35')]:_0x2faa1b[_0xba83('0x30')];if(!_0x332b47[_0xba83('0x31')][_0xba83('0x38')](_0xba83('0x39'))){_0xfbbb7[_0xba83('0x3a')]=qs[_0xba83('0x3a')](_0x332b47[_0xba83('0x31')][_0xba83('0x3a')]);_0xfbbb7[_0xba83('0x1c')]=qs[_0xba83('0x1c')](_0x332b47['query'][_0xba83('0x1c')]);}_0xfbbb7[_0xba83('0x3b')]=qs['sort'](_0x332b47[_0xba83('0x31')][_0xba83('0x3c')]);_0xfbbb7['where']=qs[_0xba83('0x33')](_[_0xba83('0x3d')](_0x332b47[_0xba83('0x31')],_0x2faa1b[_0xba83('0x33')]));if(_0x332b47[_0xba83('0x31')][_0xba83('0x3e')]){_0xfbbb7[_0xba83('0x3f')]=_['merge'](_0xfbbb7[_0xba83('0x3f')],{'$or':_[_0xba83('0x2b')](_0x402fef,function(_0x131eab){if(_0x131eab['type']!=='VIRTUAL'){var _0x1cd1ba={};_0x1cd1ba[_0x131eab[_0xba83('0x28')]]={'$like':'%'+_0x332b47[_0xba83('0x31')][_0xba83('0x3e')]+'%'};return _0x1cd1ba;}})});}_0xfbbb7=_['merge']({},_0xfbbb7,_0x332b47[_0xba83('0x40')]);var _0x4b135d={'where':_0xfbbb7['where']};return db[_0xba83('0x2c')][_0xba83('0x41')](_0x4b135d)[_0xba83('0x24')](function(_0x30c77e){_0x1edabf['count']=_0x30c77e;if(_0x332b47[_0xba83('0x31')][_0xba83('0x42')]){_0xfbbb7[_0xba83('0x43')]=[{'all':!![]}];}return db[_0xba83('0x2c')][_0xba83('0x44')](_0xfbbb7);})[_0xba83('0x24')](function(_0x428937){_0x1edabf[_0xba83('0x45')]=_0x428937;return _0x1edabf;})[_0xba83('0x24')](respondWithFilteredResult(_0x4507dc,_0xfbbb7))[_0xba83('0x46')](handleError(_0x4507dc,null));};exports[_0xba83('0x47')]=function(_0xd78578,_0x104c03){var _0x182f9e={'raw':!![],'where':{'id':_0xd78578[_0xba83('0x48')]['id']}},_0x158be2={};_0x158be2['model']=_['keys'](db['JscriptySessionReport'][_0xba83('0x2d')]);_0x158be2[_0xba83('0x31')]=_[_0xba83('0x32')](_0xd78578[_0xba83('0x31')]);_0x158be2[_0xba83('0x33')]=_[_0xba83('0x34')](_0x158be2[_0xba83('0x30')],_0x158be2[_0xba83('0x31')]);_0x182f9e[_0xba83('0x35')]=_[_0xba83('0x34')](_0x158be2[_0xba83('0x30')],qs[_0xba83('0x36')](_0xd78578[_0xba83('0x31')][_0xba83('0x36')]));_0x182f9e['attributes']=_0x182f9e[_0xba83('0x35')][_0xba83('0x37')]?_0x182f9e[_0xba83('0x35')]:_0x158be2['model'];if(_0xd78578[_0xba83('0x31')][_0xba83('0x42')]){_0x182f9e['include']=[{'all':!![]}];}_0x182f9e=_[_0xba83('0x49')]({},_0x182f9e,_0xd78578[_0xba83('0x40')]);return db[_0xba83('0x2c')][_0xba83('0x4a')](_0x182f9e)[_0xba83('0x24')](handleEntityNotFound(_0x104c03,null))[_0xba83('0x24')](respondWithResult(_0x104c03,null))['catch'](handleError(_0x104c03,null));};exports[_0xba83('0x4b')]=function(_0x278a88,_0x44f6f1){return db['JscriptySessionReport'][_0xba83('0x4b')](_0x278a88[_0xba83('0x4c')],{})['then'](respondWithResult(_0x44f6f1,0xc9))[_0xba83('0x46')](handleError(_0x44f6f1,null));};exports['update']=function(_0x4e27f7,_0x49b679){if(_0x4e27f7['body']['id']){delete _0x4e27f7[_0xba83('0x4c')]['id'];}return db[_0xba83('0x2c')][_0xba83('0x4a')]({'where':{'id':_0x4e27f7['params']['id']}})[_0xba83('0x24')](handleEntityNotFound(_0x49b679,null))['then'](saveUpdates(_0x4e27f7[_0xba83('0x4c')],null))[_0xba83('0x24')](respondWithResult(_0x49b679,null))[_0xba83('0x46')](handleError(_0x49b679,null));};exports['destroy']=function(_0x111c62,_0x2732c1){return db['JscriptySessionReport']['find']({'where':{'id':_0x111c62[_0xba83('0x48')]['id']}})[_0xba83('0x24')](handleEntityNotFound(_0x2732c1,null))[_0xba83('0x24')](removeEntity(_0x2732c1,null))[_0xba83('0x46')](handleError(_0x2732c1,null));};exports[_0xba83('0x4d')]=function(_0x2d630b,_0x2acb83){return db['JscriptySessionReport'][_0xba83('0x4d')]()[_0xba83('0x24')](respondWithResult(_0x2acb83,null))[_0xba83('0x46')](handleError(_0x2acb83,null));};exports[_0xba83('0x4e')]=function(_0x32088f,_0x75b498,_0x590802){var _0x5a6eef={'raw':!![],'where':{}};var _0x2affd1={};var _0x58307e={'count':0x0,'rows':[]};return db[_0xba83('0x2c')][_0xba83('0x4f')]({'where':{'id':_0x32088f[_0xba83('0x48')]['id']}})[_0xba83('0x24')](handleEntityNotFound(_0x75b498,null))[_0xba83('0x24')](function(_0x2e7946){if(_0x2e7946){_0x2affd1[_0xba83('0x30')]=_[_0xba83('0x32')](db['JscriptyQuestionReport']['rawAttributes']);_0x2affd1[_0xba83('0x31')]=_[_0xba83('0x32')](_0x32088f[_0xba83('0x31')]);_0x2affd1[_0xba83('0x33')]=_[_0xba83('0x34')](_0x2affd1['model'],_0x2affd1[_0xba83('0x31')]);_0x5a6eef[_0xba83('0x35')]=_[_0xba83('0x34')](_0x2affd1[_0xba83('0x30')],qs[_0xba83('0x36')](_0x32088f[_0xba83('0x31')]['fields']));_0x5a6eef[_0xba83('0x35')]=_0x5a6eef[_0xba83('0x35')][_0xba83('0x37')]?_0x5a6eef['attributes']:_0x2affd1[_0xba83('0x30')];if(!_0x32088f[_0xba83('0x31')][_0xba83('0x38')](_0xba83('0x39'))){_0x5a6eef[_0xba83('0x3a')]=qs[_0xba83('0x3a')](_0x32088f[_0xba83('0x31')]['limit']);_0x5a6eef[_0xba83('0x1c')]=qs['offset'](_0x32088f[_0xba83('0x31')][_0xba83('0x1c')]);}_0x5a6eef[_0xba83('0x3b')]=qs['sort'](_0x32088f[_0xba83('0x31')][_0xba83('0x3c')]);_0x5a6eef[_0xba83('0x3f')]=qs[_0xba83('0x33')](_[_0xba83('0x3d')](_0x32088f['query'],_0x2affd1[_0xba83('0x33')]));_0x5a6eef[_0xba83('0x3f')][_0xba83('0x50')]=_0x2e7946['id'];if(_0x32088f[_0xba83('0x31')][_0xba83('0x3e')]){_0x5a6eef['where']=_[_0xba83('0x49')](_0x5a6eef[_0xba83('0x3f')],{'$or':_[_0xba83('0x2b')](_0x5a6eef['attributes'],function(_0x59adef){var _0x29a2e9={};_0x29a2e9[_0x59adef]={'$like':'%'+_0x32088f['query'][_0xba83('0x3e')]+'%'};return _0x29a2e9;})});}_0x5a6eef=_[_0xba83('0x49')]({},_0x5a6eef,_0x32088f[_0xba83('0x40')]);return db[_0xba83('0x51')][_0xba83('0x41')]({'where':_0x5a6eef['where']})[_0xba83('0x24')](function(_0x44bb75){_0x58307e[_0xba83('0x41')]=_0x44bb75;if(_0x32088f[_0xba83('0x31')][_0xba83('0x42')]){_0x5a6eef[_0xba83('0x43')]=[{'all':!![]}];}return db[_0xba83('0x51')][_0xba83('0x44')](_0x5a6eef);})[_0xba83('0x24')](function(_0x38febb){_0x58307e[_0xba83('0x45')]=_0x38febb;return _0x58307e;});}})['then'](respondWithFilteredResult(_0x75b498,_0x5a6eef))[_0xba83('0x46')](handleError(_0x75b498,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 77c3e56..c4460fc 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 _0xda95=['define','JscriptySessionReport','report_jscripty_sessions','lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports'];(function(_0x5f4abc,_0x1692ac){var _0x3c29a6=function(_0x46309e){while(--_0x46309e){_0x5f4abc['push'](_0x5f4abc['shift']());}};_0x3c29a6(++_0x1692ac);}(_0xda95,0xff));var _0x5da9=function(_0x622035,_0x1a4b91){_0x622035=_0x622035-0x0;var _0x326cf2=_0xda95[_0x622035];return _0x326cf2;};'use strict';var _=require(_0x5da9('0x0'));var util=require(_0x5da9('0x1'));var logger=require(_0x5da9('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5da9('0x3'));var fs=require('fs');var path=require(_0x5da9('0x4'));var rimraf=require(_0x5da9('0x5'));var config=require(_0x5da9('0x6'));var attributes=require(_0x5da9('0x7'));module[_0x5da9('0x8')]=function(_0x5d0ca7,_0x4ab586){return _0x5d0ca7[_0x5da9('0x9')](_0x5da9('0xa'),attributes,{'tableName':_0x5da9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2a7b=['exports','JscriptySessionReport','report_jscripty_sessions','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./jscriptySessionReport.attributes'];(function(_0x47d6dc,_0xc036cc){var _0x1a1c93=function(_0x18ec96){while(--_0x18ec96){_0x47d6dc['push'](_0x47d6dc['shift']());}};_0x1a1c93(++_0xc036cc);}(_0x2a7b,0x1b3));var _0xb2a7=function(_0x45d735,_0x29fd87){_0x45d735=_0x45d735-0x0;var _0x4dafa1=_0x2a7b[_0x45d735];return _0x4dafa1;};'use strict';var _=require(_0xb2a7('0x0'));var util=require(_0xb2a7('0x1'));var logger=require(_0xb2a7('0x2'))(_0xb2a7('0x3'));var moment=require(_0xb2a7('0x4'));var BPromise=require('bluebird');var rp=require(_0xb2a7('0x5'));var fs=require('fs');var path=require(_0xb2a7('0x6'));var rimraf=require('rimraf');var config=require(_0xb2a7('0x7'));var attributes=require(_0xb2a7('0x8'));module[_0xb2a7('0x9')]=function(_0x42153a,_0x316b4a){return _0x42153a['define'](_0xb2a7('0xa'),attributes,{'tableName':_0xb2a7('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 2c2d4a3..dd150cd 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 _0x8404=['request','then','info','JscriptySessionReport,\x20%s,\x20%s','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xf884be,_0x43f1f0){var _0x493533=function(_0x38df21){while(--_0x38df21){_0xf884be['push'](_0xf884be['shift']());}};_0x493533(++_0x43f1f0);}(_0x8404,0x17b));var _0x4840=function(_0x5358ad,_0x7635d0){_0x5358ad=_0x5358ad-0x0;var _0x57e3ce=_0x8404[_0x5358ad];return _0x57e3ce;};'use strict';var _=require(_0x4840('0x0'));var util=require(_0x4840('0x1'));var moment=require(_0x4840('0x2'));var BPromise=require(_0x4840('0x3'));var rs=require(_0x4840('0x4'));var fs=require('fs');var Redis=require(_0x4840('0x5'));var db=require(_0x4840('0x6'))['db'];var utils=require(_0x4840('0x7'));var logger=require(_0x4840('0x8'))(_0x4840('0x9'));var config=require(_0x4840('0xa'));var jayson=require(_0x4840('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x35e0f2,_0x30208c,_0x438c96){return new BPromise(function(_0x38b628,_0x24b50b){return client[_0x4840('0xc')](_0x35e0f2,_0x438c96)[_0x4840('0xd')](function(_0x3ac36d){logger[_0x4840('0xe')](_0x4840('0xf'),_0x30208c,'request\x20sent');logger[_0x4840('0x10')](_0x4840('0x11'),_0x30208c,'request\x20sent',JSON['stringify'](_0x3ac36d));if(_0x3ac36d['error']){if(_0x3ac36d['error'][_0x4840('0x12')]===0x1f4){logger[_0x4840('0x13')]('JscriptySessionReport,\x20%s,\x20%s',_0x30208c,_0x3ac36d[_0x4840('0x13')]['message']);return _0x24b50b(_0x3ac36d[_0x4840('0x13')][_0x4840('0x14')]);}logger[_0x4840('0x13')](_0x4840('0xf'),_0x30208c,_0x3ac36d[_0x4840('0x13')][_0x4840('0x14')]);return _0x38b628(_0x3ac36d[_0x4840('0x13')][_0x4840('0x14')]);}else{logger[_0x4840('0xe')](_0x4840('0xf'),_0x30208c,'request\x20sent');_0x38b628(_0x3ac36d[_0x4840('0x15')][_0x4840('0x14')]);}})[_0x4840('0x16')](function(_0x4b1388){logger[_0x4840('0x13')](_0x4840('0xf'),_0x30208c,_0x4b1388);_0x24b50b(_0x4b1388);});});} \ No newline at end of file +var _0x16a3=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','JscriptySessionReport,\x20%s,\x20%s','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x2b93c2,_0x26d266){var _0x2db2e5=function(_0x473026){while(--_0x473026){_0x2b93c2['push'](_0x2b93c2['shift']());}};_0x2db2e5(++_0x26d266);}(_0x16a3,0x1e0));var _0x316a=function(_0x5c790c,_0x377980){_0x5c790c=_0x5c790c-0x0;var _0x1b194a=_0x16a3[_0x5c790c];return _0x1b194a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x316a('0x0'));var BPromise=require(_0x316a('0x1'));var rs=require(_0x316a('0x2'));var fs=require('fs');var Redis=require(_0x316a('0x3'));var db=require(_0x316a('0x4'))['db'];var utils=require(_0x316a('0x5'));var logger=require(_0x316a('0x6'))(_0x316a('0x7'));var config=require(_0x316a('0x8'));var jayson=require(_0x316a('0x9'));var client=jayson[_0x316a('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x43fd12,_0x5ada24,_0x537648){return new BPromise(function(_0x2af996,_0x4823a2){return client[_0x316a('0xb')](_0x43fd12,_0x537648)[_0x316a('0xc')](function(_0x56c4f9){logger[_0x316a('0xd')](_0x316a('0xe'),_0x5ada24,'request\x20sent');logger[_0x316a('0xf')](_0x316a('0x10'),_0x5ada24,_0x316a('0x11'),JSON[_0x316a('0x12')](_0x56c4f9));if(_0x56c4f9[_0x316a('0x13')]){if(_0x56c4f9[_0x316a('0x13')][_0x316a('0x14')]===0x1f4){logger['error']('JscriptySessionReport,\x20%s,\x20%s',_0x5ada24,_0x56c4f9['error'][_0x316a('0x15')]);return _0x4823a2(_0x56c4f9[_0x316a('0x13')][_0x316a('0x15')]);}logger['error'](_0x316a('0xe'),_0x5ada24,_0x56c4f9[_0x316a('0x13')][_0x316a('0x15')]);return _0x2af996(_0x56c4f9[_0x316a('0x13')][_0x316a('0x15')]);}else{logger[_0x316a('0xd')](_0x316a('0xe'),_0x5ada24,_0x316a('0x11'));_0x2af996(_0x56c4f9[_0x316a('0x16')]['message']);}})[_0x316a('0x17')](function(_0x1ff161){logger[_0x316a('0x13')](_0x316a('0xe'),_0x5ada24,_0x1ff161);_0x4823a2(_0x1ff161);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index e8af84c..bba8917 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 _0x8299=['./license.controller','get','index','/:id','update','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x14337d,_0x39e998){var _0x4dc5d3=function(_0x2cfc47){while(--_0x2cfc47){_0x14337d['push'](_0x14337d['shift']());}};_0x4dc5d3(++_0x39e998);}(_0x8299,0x11e));var _0x9829=function(_0x5e89bb,_0x1b93f0){_0x5e89bb=_0x5e89bb-0x0;var _0x2d2f9f=_0x8299[_0x5e89bb];return _0x2d2f9f;};'use strict';var multer=require(_0x9829('0x0'));var util=require(_0x9829('0x1'));var path=require(_0x9829('0x2'));var timeout=require(_0x9829('0x3'));var express=require('express');var router=express[_0x9829('0x4')]();var auth=require(_0x9829('0x5'));var interaction=require(_0x9829('0x6'));var config=require(_0x9829('0x7'));var controller=require(_0x9829('0x8'));router[_0x9829('0x9')]('/',controller[_0x9829('0xa')]);router['put'](_0x9829('0xb'),auth['isAuthenticated'](),controller[_0x9829('0xc')]);module[_0x9829('0xd')]=router; \ No newline at end of file +var _0xa2c1=['get','index','put','/:id','update','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./license.controller'];(function(_0x49d19d,_0x245cf5){var _0x4ebef1=function(_0xf0a4e6){while(--_0xf0a4e6){_0x49d19d['push'](_0x49d19d['shift']());}};_0x4ebef1(++_0x245cf5);}(_0xa2c1,0x185));var _0x1a2c=function(_0x66ca61,_0x49453d){_0x66ca61=_0x66ca61-0x0;var _0xa80806=_0xa2c1[_0x66ca61];return _0xa80806;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1a2c('0x0'));var timeout=require(_0x1a2c('0x1'));var express=require(_0x1a2c('0x2'));var router=express[_0x1a2c('0x3')]();var auth=require(_0x1a2c('0x4'));var interaction=require(_0x1a2c('0x5'));var config=require('../../config/environment');var controller=require(_0x1a2c('0x6'));router[_0x1a2c('0x7')]('/',controller[_0x1a2c('0x8')]);router[_0x1a2c('0x9')](_0x1a2c('0xa'),auth['isAuthenticated'](),controller[_0x1a2c('0xb')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 7112c53..dd2edfc 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 _0x2ef3=['INTEGER','sequelize','exports','TEXT','STRING'];(function(_0x1e3829,_0x421085){var _0x5a98fd=function(_0x502da0){while(--_0x502da0){_0x1e3829['push'](_0x1e3829['shift']());}};_0x5a98fd(++_0x421085);}(_0x2ef3,0xba));var _0x32ef=function(_0x46a348,_0x1c94f1){_0x46a348=_0x46a348-0x0;var _0x4d2b04=_0x2ef3[_0x46a348];return _0x4d2b04;};'use strict';var Sequelize=require(_0x32ef('0x0'));module[_0x32ef('0x1')]={'license':{'type':Sequelize[_0x32ef('0x2')]},'data1':{'type':Sequelize[_0x32ef('0x3')]},'data2':{'type':Sequelize[_0x32ef('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0x32ef('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xba34=['STRING','sequelize','exports','TEXT'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xba34,0x119));var _0x4ba3=function(_0x9a1a9e,_0x508e59){_0x9a1a9e=_0x9a1a9e-0x0;var _0xaebabc=_0xba34[_0x9a1a9e];return _0xaebabc;};'use strict';var Sequelize=require(_0x4ba3('0x0'));module[_0x4ba3('0x1')]={'license':{'type':Sequelize[_0x4ba3('0x2')]},'data1':{'type':Sequelize[_0x4ba3('0x3')]},'data2':{'type':Sequelize[_0x4ba3('0x3')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index 9b7926b..28201b6 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 _0x5fd5=['merge','body','License','find','params','get','checkLicense','key','demo','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','json','count','offset','limit','status','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length'];(function(_0x4b7b62,_0x4920a9){var _0x2280df=function(_0x21e1f8){while(--_0x21e1f8){_0x4b7b62['push'](_0x4b7b62['shift']());}};_0x2280df(++_0x4920a9);}(_0x5fd5,0x101));var _0x55fd=function(_0x18175b,_0x4d7376){_0x18175b=_0x18175b-0x0;var _0x210d45=_0x5fd5[_0x18175b];return _0x210d45;};'use strict';var pdf=require(_0x55fd('0x0'));var emlformat=require(_0x55fd('0x1'));var rimraf=require(_0x55fd('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x55fd('0x3'));var rp=require(_0x55fd('0x4'));var moment=require('moment');var BPromise=require(_0x55fd('0x5'));var Mustache=require(_0x55fd('0x6'));var util=require(_0x55fd('0x7'));var path=require(_0x55fd('0x8'));var sox=require(_0x55fd('0x9'));var csv=require(_0x55fd('0xa'));var ejs=require(_0x55fd('0xb'));var fs=require('fs');var _=require(_0x55fd('0xc'));var squel=require('squel');var crypto=require(_0x55fd('0xd'));var jsforce=require(_0x55fd('0xe'));var deskjs=require(_0x55fd('0xf'));var toCsv=require(_0x55fd('0xa'));var querystring=require(_0x55fd('0x10'));var Papa=require('papaparse');var Redis=require(_0x55fd('0x11'));var authService=require(_0x55fd('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x55fd('0x13'));var hardwareService=require(_0x55fd('0x14'));var logger=require('../../config/logger')(_0x55fd('0x15'));var utils=require(_0x55fd('0x16'));var config=require(_0x55fd('0x17'));var db=require(_0x55fd('0x18'))['db'];function respondWithStatusCode(_0x3b2fe3,_0x54de9e){_0x54de9e=_0x54de9e||0xcc;return function(_0x2bb971){if(_0x2bb971){return _0x3b2fe3['sendStatus'](_0x54de9e);}return _0x3b2fe3['status'](_0x54de9e)['end']();};}function respondWithResult(_0x50693d,_0x588f7c){_0x588f7c=_0x588f7c||0xc8;return function(_0x390deb){if(_0x390deb){return _0x50693d['status'](_0x588f7c)[_0x55fd('0x19')](_0x390deb);}};}function respondWithFilteredResult(_0x5c11fb,_0x2320bc){return function(_0x41dd92){if(_0x41dd92){var _0x58ba3f=_0x41dd92[_0x55fd('0x1a')],_0x27f5f7=_0x2320bc['offset'],_0x1794bd=_0x2320bc[_0x55fd('0x1b')]+_0x2320bc[_0x55fd('0x1c')],_0x25c1a6;if(_0x1794bd>=_0x58ba3f){_0x1794bd=_0x58ba3f;_0x25c1a6=0xc8;}else{_0x25c1a6=0xce;}_0x5c11fb[_0x55fd('0x1d')](_0x25c1a6);return _0x5c11fb[_0x55fd('0x1e')](_0x55fd('0x1f'),_0x27f5f7+'-'+_0x1794bd+'/'+_0x58ba3f)[_0x55fd('0x19')](_0x41dd92);}return null;};}function patchUpdates(_0x46e09a){return function(_0x48d3d4){try{jsonpatch[_0x55fd('0x20')](_0x48d3d4,_0x46e09a,!![]);}catch(_0xaed94f){return BPromise[_0x55fd('0x21')](_0xaed94f);}return _0x48d3d4[_0x55fd('0x22')]();};}function saveUpdates(_0x678725,_0x2a365b){return function(_0x162a3f){if(_0x162a3f){return _0x162a3f[_0x55fd('0x23')](_0x678725)[_0x55fd('0x24')](function(_0x35a3ec){return _0x35a3ec;});}return null;};}function removeEntity(_0x29c5d5,_0x130a16){return function(_0x30fdb6){if(_0x30fdb6){return _0x30fdb6[_0x55fd('0x25')]()[_0x55fd('0x24')](function(){_0x29c5d5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2287d2,_0x274118){return function(_0x25c5d3){if(!_0x25c5d3){_0x2287d2[_0x55fd('0x26')](0x194);}return _0x25c5d3;};}function handleError(_0x3e47e8,_0x259486){_0x259486=_0x259486||0x1f4;return function(_0x2fcd08){logger[_0x55fd('0x27')](_0x2fcd08[_0x55fd('0x28')]);if(_0x2fcd08[_0x55fd('0x29')]){delete _0x2fcd08['name'];}_0x3e47e8[_0x55fd('0x1d')](_0x259486)[_0x55fd('0x2a')](_0x2fcd08);};}var utilLicense=require('../../config/license/util');exports[_0x55fd('0x2b')]=function(_0x7244cb,_0x5dc5a9){var _0x4ab836={'raw':!![],'where':{'id':0x1}},_0xe706af={};_0xe706af[_0x55fd('0x2c')]=_[_0x55fd('0x2d')](db['License'][_0x55fd('0x2e')]);_0xe706af[_0x55fd('0x2f')]=_[_0x55fd('0x2d')](_0x7244cb[_0x55fd('0x2f')]);_0xe706af[_0x55fd('0x30')]=_[_0x55fd('0x31')](_0xe706af[_0x55fd('0x2c')],_0xe706af['query']);_0x4ab836[_0x55fd('0x32')]=_[_0x55fd('0x31')](_0xe706af['model'],qs['fields'](_0x7244cb[_0x55fd('0x2f')][_0x55fd('0x33')]));_0x4ab836['attributes']=_0x4ab836[_0x55fd('0x32')][_0x55fd('0x34')]?_0x4ab836[_0x55fd('0x32')]:_0xe706af[_0x55fd('0x2c')];_0x4ab836=_[_0x55fd('0x35')]({},_0x4ab836,_0x7244cb['options']);return utilLicense['getLicense'](_0x4ab836)[_0x55fd('0x24')](respondWithResult(_0x5dc5a9,null))['catch'](handleError(_0x5dc5a9,null));};exports['update']=function(_0x3c4199,_0x1d721a){if(_0x3c4199['body']['id']){delete _0x3c4199[_0x55fd('0x36')]['id'];}return db[_0x55fd('0x37')][_0x55fd('0x38')]({'where':{'id':_0x3c4199[_0x55fd('0x39')]['id']}})[_0x55fd('0x24')](handleEntityNotFound(_0x1d721a,null))[_0x55fd('0x24')](function(_0x165d40){var _0xb04afd=_0x165d40[_0x55fd('0x3a')]({'plain':!![]});return utilLicense[_0x55fd('0x3b')](_0xb04afd,_0x3c4199[_0x55fd('0x36')][_0x55fd('0x3c')]);})[_0x55fd('0x24')](function(_0x2f6249){if(!_0x2f6249[_0x55fd('0x3d')]){return saveUpdates(_0x3c4199[_0x55fd('0x36')],null);}return _0x2f6249;})[_0x55fd('0x24')](respondWithResult(_0x1d721a,null))['catch'](handleError(_0x1d721a,null));}; \ No newline at end of file +var _0x8f68=['../../mysqldb','status','json','count','offset','limit','set','apply','reject','save','update','then','destroy','end','stack','name','send','../../config/license/util','model','keys','License','rawAttributes','query','filters','intersection','fields','attributes','length','merge','options','catch','body','find','key','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x8f68,0xe6));var _0x88f6=function(_0x58acd6,_0x11f86b){_0x58acd6=_0x58acd6-0x0;var _0x3bc938=_0x8f68[_0x58acd6];return _0x3bc938;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x88f6('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x88f6('0x1'));var rp=require(_0x88f6('0x2'));var moment=require(_0x88f6('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x88f6('0x4'));var util=require(_0x88f6('0x5'));var path=require(_0x88f6('0x6'));var sox=require(_0x88f6('0x7'));var csv=require(_0x88f6('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x88f6('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x88f6('0x8'));var querystring=require(_0x88f6('0xa'));var Papa=require('papaparse');var Redis=require(_0x88f6('0xb'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x88f6('0xc'));var hardwareService=require(_0x88f6('0xd'));var logger=require('../../config/logger')('api');var utils=require(_0x88f6('0xe'));var config=require('../../config/environment');var db=require(_0x88f6('0xf'))['db'];function respondWithStatusCode(_0x23db62,_0xf13bc9){_0xf13bc9=_0xf13bc9||0xcc;return function(_0x1acd8c){if(_0x1acd8c){return _0x23db62['sendStatus'](_0xf13bc9);}return _0x23db62[_0x88f6('0x10')](_0xf13bc9)['end']();};}function respondWithResult(_0x172855,_0x1f5978){_0x1f5978=_0x1f5978||0xc8;return function(_0x46e446){if(_0x46e446){return _0x172855['status'](_0x1f5978)[_0x88f6('0x11')](_0x46e446);}};}function respondWithFilteredResult(_0x2a2e59,_0x2c6f3b){return function(_0x16b19a){if(_0x16b19a){var _0x3c6dc0=_0x16b19a[_0x88f6('0x12')],_0x4f04a1=_0x2c6f3b['offset'],_0x28b01f=_0x2c6f3b[_0x88f6('0x13')]+_0x2c6f3b[_0x88f6('0x14')],_0x3fe7b4;if(_0x28b01f>=_0x3c6dc0){_0x28b01f=_0x3c6dc0;_0x3fe7b4=0xc8;}else{_0x3fe7b4=0xce;}_0x2a2e59['status'](_0x3fe7b4);return _0x2a2e59[_0x88f6('0x15')]('Content-Range',_0x4f04a1+'-'+_0x28b01f+'/'+_0x3c6dc0)[_0x88f6('0x11')](_0x16b19a);}return null;};}function patchUpdates(_0xc58613){return function(_0x5f4be3){try{jsonpatch[_0x88f6('0x16')](_0x5f4be3,_0xc58613,!![]);}catch(_0xa3b137){return BPromise[_0x88f6('0x17')](_0xa3b137);}return _0x5f4be3[_0x88f6('0x18')]();};}function saveUpdates(_0x107b2f,_0x1bf0ca){return function(_0x45cafe){if(_0x45cafe){return _0x45cafe[_0x88f6('0x19')](_0x107b2f)[_0x88f6('0x1a')](function(_0x2eae5c){return _0x2eae5c;});}return null;};}function removeEntity(_0x4ed7dd,_0x276945){return function(_0x5f58e2){if(_0x5f58e2){return _0x5f58e2[_0x88f6('0x1b')]()[_0x88f6('0x1a')](function(){_0x4ed7dd[_0x88f6('0x10')](0xcc)[_0x88f6('0x1c')]();});}};}function handleEntityNotFound(_0x56b8db,_0x8d6215){return function(_0x35cda0){if(!_0x35cda0){_0x56b8db['sendStatus'](0x194);}return _0x35cda0;};}function handleError(_0x4d0bfc,_0x3ca821){_0x3ca821=_0x3ca821||0x1f4;return function(_0x4d79a6){logger['error'](_0x4d79a6[_0x88f6('0x1d')]);if(_0x4d79a6[_0x88f6('0x1e')]){delete _0x4d79a6['name'];}_0x4d0bfc[_0x88f6('0x10')](_0x3ca821)[_0x88f6('0x1f')](_0x4d79a6);};}var utilLicense=require(_0x88f6('0x20'));exports['index']=function(_0x10d65e,_0x3ce83a){var _0x9b53fa={'raw':!![],'where':{'id':0x1}},_0x54a059={};_0x54a059[_0x88f6('0x21')]=_[_0x88f6('0x22')](db[_0x88f6('0x23')][_0x88f6('0x24')]);_0x54a059[_0x88f6('0x25')]=_[_0x88f6('0x22')](_0x10d65e['query']);_0x54a059[_0x88f6('0x26')]=_['intersection'](_0x54a059[_0x88f6('0x21')],_0x54a059[_0x88f6('0x25')]);_0x9b53fa['attributes']=_[_0x88f6('0x27')](_0x54a059[_0x88f6('0x21')],qs[_0x88f6('0x28')](_0x10d65e['query']['fields']));_0x9b53fa[_0x88f6('0x29')]=_0x9b53fa[_0x88f6('0x29')][_0x88f6('0x2a')]?_0x9b53fa[_0x88f6('0x29')]:_0x54a059[_0x88f6('0x21')];_0x9b53fa=_[_0x88f6('0x2b')]({},_0x9b53fa,_0x10d65e[_0x88f6('0x2c')]);return utilLicense['getLicense'](_0x9b53fa)[_0x88f6('0x1a')](respondWithResult(_0x3ce83a,null))[_0x88f6('0x2d')](handleError(_0x3ce83a,null));};exports['update']=function(_0x173db9,_0xc45aa8){if(_0x173db9[_0x88f6('0x2e')]['id']){delete _0x173db9[_0x88f6('0x2e')]['id'];}return db[_0x88f6('0x23')][_0x88f6('0x2f')]({'where':{'id':_0x173db9['params']['id']}})['then'](handleEntityNotFound(_0xc45aa8,null))[_0x88f6('0x1a')](function(_0x100345){var _0x158fc6=_0x100345['get']({'plain':!![]});return utilLicense['checkLicense'](_0x158fc6,_0x173db9['body'][_0x88f6('0x30')]);})[_0x88f6('0x1a')](function(_0x393272){if(!_0x393272['demo']){return saveUpdates(_0x173db9[_0x88f6('0x2e')],null);}return _0x393272;})['then'](respondWithResult(_0xc45aa8,null))[_0x88f6('0x2d')](handleError(_0xc45aa8,null));}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 711cc80..83a236f 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 _0xabcb=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./license.attributes','exports','define','License','license','util','../../config/logger','api'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xabcb,0xf9));var _0xbabc=function(_0x545ed6,_0x7ddca6){_0x545ed6=_0x545ed6-0x0;var _0x51704b=_0xabcb[_0x545ed6];return _0x51704b;};'use strict';var _=require('lodash');var util=require(_0xbabc('0x0'));var logger=require(_0xbabc('0x1'))(_0xbabc('0x2'));var moment=require(_0xbabc('0x3'));var BPromise=require(_0xbabc('0x4'));var rp=require(_0xbabc('0x5'));var fs=require('fs');var path=require(_0xbabc('0x6'));var rimraf=require(_0xbabc('0x7'));var config=require(_0xbabc('0x8'));var attributes=require(_0xbabc('0x9'));module[_0xbabc('0xa')]=function(_0x2dd09d,_0x477329){return _0x2dd09d[_0xbabc('0xb')](_0xbabc('0xc'),attributes,{'tableName':_0xbabc('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xab11=['api','moment','request-promise','path','rimraf','../../config/environment','exports','define','License','lodash','../../config/logger'];(function(_0x3eada5,_0x5e3106){var _0x3a5a77=function(_0x69ddc3){while(--_0x69ddc3){_0x3eada5['push'](_0x3eada5['shift']());}};_0x3a5a77(++_0x5e3106);}(_0xab11,0x1cc));var _0x1ab1=function(_0x869827,_0x4c6d64){_0x869827=_0x869827-0x0;var _0x5558ae=_0xab11[_0x869827];return _0x5558ae;};'use strict';var _=require(_0x1ab1('0x0'));var util=require('util');var logger=require(_0x1ab1('0x1'))(_0x1ab1('0x2'));var moment=require(_0x1ab1('0x3'));var BPromise=require('bluebird');var rp=require(_0x1ab1('0x4'));var fs=require('fs');var path=require(_0x1ab1('0x5'));var rimraf=require(_0x1ab1('0x6'));var config=require(_0x1ab1('0x7'));var attributes=require('./license.attributes');module[_0x1ab1('0x8')]=function(_0x5d6a7e,_0x19a77c){return _0x5d6a7e[_0x1ab1('0x9')](_0x1ab1('0xa'),attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js index efedcd5..a34d746 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 _0xad13=['catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','License,\x20%s,\x20%s','debug','License,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result'];(function(_0x35c816,_0x36a2e6){var _0x49981e=function(_0x3a0ec8){while(--_0x3a0ec8){_0x35c816['push'](_0x35c816['shift']());}};_0x49981e(++_0x36a2e6);}(_0xad13,0x79));var _0x3ad1=function(_0x5ab0ba,_0x74ad25){_0x5ab0ba=_0x5ab0ba-0x0;var _0x5a4bb4=_0xad13[_0x5ab0ba];return _0x5a4bb4;};'use strict';var _=require(_0x3ad1('0x0'));var util=require('util');var moment=require(_0x3ad1('0x1'));var BPromise=require(_0x3ad1('0x2'));var rs=require(_0x3ad1('0x3'));var fs=require('fs');var Redis=require(_0x3ad1('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3ad1('0x5'));var logger=require(_0x3ad1('0x6'))(_0x3ad1('0x7'));var config=require(_0x3ad1('0x8'));var jayson=require(_0x3ad1('0x9'));var client=jayson[_0x3ad1('0xa')][_0x3ad1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x23ed63,_0x44fd50,_0x313ad9){return new BPromise(function(_0x4d27b0,_0x2429f4){return client[_0x3ad1('0xc')](_0x23ed63,_0x313ad9)[_0x3ad1('0xd')](function(_0x4e93df){logger[_0x3ad1('0xe')](_0x3ad1('0xf'),_0x44fd50,'request\x20sent');logger[_0x3ad1('0x10')](_0x3ad1('0x11'),_0x44fd50,_0x3ad1('0x12'),JSON[_0x3ad1('0x13')](_0x4e93df));if(_0x4e93df[_0x3ad1('0x14')]){if(_0x4e93df[_0x3ad1('0x14')]['code']===0x1f4){logger['error'](_0x3ad1('0xf'),_0x44fd50,_0x4e93df[_0x3ad1('0x14')][_0x3ad1('0x15')]);return _0x2429f4(_0x4e93df[_0x3ad1('0x14')]['message']);}logger[_0x3ad1('0x14')]('License,\x20%s,\x20%s',_0x44fd50,_0x4e93df[_0x3ad1('0x14')][_0x3ad1('0x15')]);return _0x4d27b0(_0x4e93df[_0x3ad1('0x14')][_0x3ad1('0x15')]);}else{logger[_0x3ad1('0xe')](_0x3ad1('0xf'),_0x44fd50,_0x3ad1('0x12'));_0x4d27b0(_0x4e93df[_0x3ad1('0x16')][_0x3ad1('0x15')]);}})[_0x3ad1('0x17')](function(_0x1d924e){logger[_0x3ad1('0x14')]('License,\x20%s,\x20%s',_0x44fd50,_0x1d924e);_0x2429f4(_0x1d924e);});});} \ No newline at end of file +var _0xde13=['debug','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','License,\x20%s,\x20%s','request\x20sent'];(function(_0x2c750c,_0x27b039){var _0x2a0f33=function(_0x34eaba){while(--_0x34eaba){_0x2c750c['push'](_0x2c750c['shift']());}};_0x2a0f33(++_0x27b039);}(_0xde13,0x146));var _0x3de1=function(_0x3554cb,_0x274943){_0x3554cb=_0x3554cb-0x0;var _0x3992b1=_0xde13[_0x3554cb];return _0x3992b1;};'use strict';var _=require(_0x3de1('0x0'));var util=require(_0x3de1('0x1'));var moment=require(_0x3de1('0x2'));var BPromise=require(_0x3de1('0x3'));var rs=require(_0x3de1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3de1('0x5'))['db'];var utils=require(_0x3de1('0x6'));var logger=require(_0x3de1('0x7'))('rpc');var config=require(_0x3de1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3de1('0x9')][_0x3de1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3d2169,_0x34291a,_0x5f1aff){return new BPromise(function(_0x11df45,_0x41b5bb){return client[_0x3de1('0xb')](_0x3d2169,_0x5f1aff)['then'](function(_0x4eb503){logger['info'](_0x3de1('0xc'),_0x34291a,_0x3de1('0xd'));logger[_0x3de1('0xe')]('License,\x20%s,\x20%s,\x20%s',_0x34291a,_0x3de1('0xd'),JSON[_0x3de1('0xf')](_0x4eb503));if(_0x4eb503[_0x3de1('0x10')]){if(_0x4eb503['error']['code']===0x1f4){logger[_0x3de1('0x10')]('License,\x20%s,\x20%s',_0x34291a,_0x4eb503['error']['message']);return _0x41b5bb(_0x4eb503[_0x3de1('0x10')][_0x3de1('0x11')]);}logger[_0x3de1('0x10')](_0x3de1('0xc'),_0x34291a,_0x4eb503['error'][_0x3de1('0x11')]);return _0x11df45(_0x4eb503['error'][_0x3de1('0x11')]);}else{logger['info'](_0x3de1('0xc'),_0x34291a,_0x3de1('0xd'));_0x11df45(_0x4eb503[_0x3de1('0x12')]['message']);}})[_0x3de1('0x13')](function(_0x25f619){logger[_0x3de1('0x10')](_0x3de1('0xc'),_0x34291a,_0x25f619);_0x41b5bb(_0x25f619);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 0ce3bac..d50e8bd 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 _0x4a38=['show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/in_servers','/:id/interactions','/:id/applications','/:id/messages','getMessages','/:id/verify','verifySmtp','post','addDisposition','addAnswer','create','/:id/out_servers','addSmtp','addInteraction','addApplications','/:id/send','send','/:id/users','addAgents','put','/:id','update','delete','removeImap','removeSmtp','removeAgents','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./mailAccount.controller','get','index','describe','isAuthenticated'];(function(_0x36747b,_0x19c9fc){var _0x586cfd=function(_0x68b3d6){while(--_0x68b3d6){_0x36747b['push'](_0x36747b['shift']());}};_0x586cfd(++_0x19c9fc);}(_0x4a38,0xcb));var _0x84a3=function(_0x1ab156,_0x3e56a7){_0x1ab156=_0x1ab156-0x0;var _0x51addb=_0x4a38[_0x1ab156];return _0x51addb;};'use strict';var multer=require('multer');var util=require(_0x84a3('0x0'));var path=require(_0x84a3('0x1'));var timeout=require(_0x84a3('0x2'));var express=require(_0x84a3('0x3'));var router=express[_0x84a3('0x4')]();var auth=require(_0x84a3('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x84a3('0x6'));var controller=require(_0x84a3('0x7'));router[_0x84a3('0x8')]('/',auth['isAuthenticated'](),controller[_0x84a3('0x9')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x84a3('0xa')]);router['get']('/:id',auth[_0x84a3('0xb')](),controller[_0x84a3('0xc')]);router['get'](_0x84a3('0xd'),auth[_0x84a3('0xb')](),controller['getDispositions']);router[_0x84a3('0x8')](_0x84a3('0xe'),auth[_0x84a3('0xb')](),controller[_0x84a3('0xf')]);router[_0x84a3('0x8')](_0x84a3('0x10'),auth[_0x84a3('0xb')](),controller['getImap']);router[_0x84a3('0x8')]('/:id/out_servers',auth[_0x84a3('0xb')](),controller['getSmtp']);router['get'](_0x84a3('0x11'),auth['isAuthenticated'](),controller['getInteractions']);router[_0x84a3('0x8')](_0x84a3('0x12'),auth[_0x84a3('0xb')](),controller['getApplications']);router[_0x84a3('0x8')](_0x84a3('0x13'),auth[_0x84a3('0xb')](),controller[_0x84a3('0x14')]);router[_0x84a3('0x8')](_0x84a3('0x15'),auth[_0x84a3('0xb')](),controller[_0x84a3('0x16')]);router[_0x84a3('0x8')]('/:id/users',auth[_0x84a3('0xb')](),controller['getAgents']);router[_0x84a3('0x17')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x84a3('0x18')]);router[_0x84a3('0x17')](_0x84a3('0xe'),auth[_0x84a3('0xb')](),controller[_0x84a3('0x19')]);router[_0x84a3('0x17')]('/',auth[_0x84a3('0xb')](),controller[_0x84a3('0x1a')]);router[_0x84a3('0x17')](_0x84a3('0x10'),auth['isAuthenticated'](),controller['addImap']);router['post'](_0x84a3('0x1b'),auth[_0x84a3('0xb')](),controller[_0x84a3('0x1c')]);router[_0x84a3('0x17')](_0x84a3('0x11'),auth[_0x84a3('0xb')](),controller[_0x84a3('0x1d')]);router[_0x84a3('0x17')]('/:id/applications',auth[_0x84a3('0xb')](),controller[_0x84a3('0x1e')]);router[_0x84a3('0x17')](_0x84a3('0x1f'),auth[_0x84a3('0xb')](),controller[_0x84a3('0x20')]);router[_0x84a3('0x17')](_0x84a3('0x21'),auth[_0x84a3('0xb')](),controller[_0x84a3('0x22')]);router[_0x84a3('0x23')](_0x84a3('0x24'),auth[_0x84a3('0xb')](),controller[_0x84a3('0x25')]);router['delete']('/:id/dispositions',auth['isAuthenticated'](),controller['removeDispositions']);router['delete'](_0x84a3('0xe'),auth[_0x84a3('0xb')](),controller['removeAnswers']);router[_0x84a3('0x26')](_0x84a3('0x10'),auth[_0x84a3('0xb')](),controller[_0x84a3('0x27')]);router[_0x84a3('0x26')](_0x84a3('0x1b'),auth[_0x84a3('0xb')](),controller[_0x84a3('0x28')]);router['delete'](_0x84a3('0x24'),auth[_0x84a3('0xb')](),controller['destroy']);router[_0x84a3('0x26')]('/:id/users',auth[_0x84a3('0xb')](),controller[_0x84a3('0x29')]);module[_0x84a3('0x2a')]=router; \ No newline at end of file +var _0x64e5=['/:id/interactions','getInteractions','/:id/applications','verifySmtp','getAgents','addDisposition','post','addAnswer','addImap','addInteraction','addApplications','/:id/send','/:id/users','addAgents','put','/:id','update','delete','removeDispositions','removeImap','removeSmtp','destroy','removeAgents','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./mailAccount.controller','get','/describe','describe','show','/:id/dispositions','isAuthenticated','/:id/canned_answers','/:id/in_servers','/:id/out_servers','getSmtp'];(function(_0x525292,_0x47c9cb){var _0x1452a9=function(_0x578756){while(--_0x578756){_0x525292['push'](_0x525292['shift']());}};_0x1452a9(++_0x47c9cb);}(_0x64e5,0x1bc));var _0x564e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0x64e5[_0x40ac5e];return _0x2839d6;};'use strict';var multer=require(_0x564e('0x0'));var util=require(_0x564e('0x1'));var path=require(_0x564e('0x2'));var timeout=require(_0x564e('0x3'));var express=require(_0x564e('0x4'));var router=express['Router']();var auth=require(_0x564e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x564e('0x6'));var controller=require(_0x564e('0x7'));router[_0x564e('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x564e('0x8')](_0x564e('0x9'),auth['isAuthenticated'](),controller[_0x564e('0xa')]);router[_0x564e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x564e('0xb')]);router[_0x564e('0x8')](_0x564e('0xc'),auth[_0x564e('0xd')](),controller['getDispositions']);router[_0x564e('0x8')](_0x564e('0xe'),auth[_0x564e('0xd')](),controller['getAnswers']);router['get'](_0x564e('0xf'),auth[_0x564e('0xd')](),controller['getImap']);router['get'](_0x564e('0x10'),auth[_0x564e('0xd')](),controller[_0x564e('0x11')]);router[_0x564e('0x8')](_0x564e('0x12'),auth[_0x564e('0xd')](),controller[_0x564e('0x13')]);router[_0x564e('0x8')](_0x564e('0x14'),auth[_0x564e('0xd')](),controller['getApplications']);router[_0x564e('0x8')]('/:id/messages',auth['isAuthenticated'](),controller['getMessages']);router[_0x564e('0x8')]('/:id/verify',auth[_0x564e('0xd')](),controller[_0x564e('0x15')]);router['get']('/:id/users',auth['isAuthenticated'](),controller[_0x564e('0x16')]);router['post'](_0x564e('0xc'),auth[_0x564e('0xd')](),controller[_0x564e('0x17')]);router[_0x564e('0x18')](_0x564e('0xe'),auth[_0x564e('0xd')](),controller[_0x564e('0x19')]);router['post']('/',auth[_0x564e('0xd')](),controller['create']);router[_0x564e('0x18')](_0x564e('0xf'),auth['isAuthenticated'](),controller[_0x564e('0x1a')]);router[_0x564e('0x18')](_0x564e('0x10'),auth[_0x564e('0xd')](),controller['addSmtp']);router[_0x564e('0x18')](_0x564e('0x12'),auth[_0x564e('0xd')](),controller[_0x564e('0x1b')]);router['post'](_0x564e('0x14'),auth[_0x564e('0xd')](),controller[_0x564e('0x1c')]);router['post'](_0x564e('0x1d'),auth[_0x564e('0xd')](),controller['send']);router[_0x564e('0x18')](_0x564e('0x1e'),auth[_0x564e('0xd')](),controller[_0x564e('0x1f')]);router[_0x564e('0x20')](_0x564e('0x21'),auth[_0x564e('0xd')](),controller[_0x564e('0x22')]);router[_0x564e('0x23')](_0x564e('0xc'),auth[_0x564e('0xd')](),controller[_0x564e('0x24')]);router[_0x564e('0x23')](_0x564e('0xe'),auth[_0x564e('0xd')](),controller['removeAnswers']);router[_0x564e('0x23')](_0x564e('0xf'),auth[_0x564e('0xd')](),controller[_0x564e('0x25')]);router[_0x564e('0x23')]('/:id/out_servers',auth[_0x564e('0xd')](),controller[_0x564e('0x26')]);router[_0x564e('0x23')](_0x564e('0x21'),auth['isAuthenticated'](),controller[_0x564e('0x27')]);router[_0x564e('0x23')](_0x564e('0x1e'),auth[_0x564e('0xd')](),controller[_0x564e('0x28')]);module[_0x564e('0x29')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 9c5ec19..9faeb73 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 _0x1b88=['STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition'];(function(_0x2489fe,_0x163637){var _0x2164cc=function(_0x2eccd3){while(--_0x2eccd3){_0x2489fe['push'](_0x2489fe['shift']());}};_0x2164cc(++_0x163637);}(_0x1b88,0x172));var _0x81b8=function(_0x2db12b,_0x30ab1d){_0x2db12b=_0x2db12b-0x0;var _0x20990b=_0x1b88[_0x2db12b];return _0x20990b;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize[_0x81b8('0x0')]},'name':{'type':Sequelize[_0x81b8('0x0')],'allowNull':![]},'service':{'type':Sequelize[_0x81b8('0x1')],'defaultValue':![]},'email':{'type':Sequelize[_0x81b8('0x0')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x81b8('0x1')],'defaultValue':!![]},'key':{'type':Sequelize[_0x81b8('0x0')],'allowNull':![]},'template':{'type':Sequelize[_0x81b8('0x2')]},'markAsUnread':{'type':Sequelize[_0x81b8('0x1')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x81b8('0x0')],'allowNull':![],'defaultValue':_0x81b8('0x3')},'fontSize':{'type':Sequelize[_0x81b8('0x4')](0x2)[_0x81b8('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}';}},'notificationSound':{'type':Sequelize[_0x81b8('0x1')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x81b8('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x81b8('0x1')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x81b8('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x81b8('0x1')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x81b8('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x81b8('0x4')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x81b8('0x1')],'defaultValue':![],'comment':_0x81b8('0x6'),'set':function(_0x453044){if(!_0x453044)this['setDataValue'](_0x81b8('0x7'),null);this[_0x81b8('0x8')](_0x81b8('0x9'),_0x453044);}}}; \ No newline at end of file +var _0xafa1=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','exports','STRING','BOOLEAN','Arial,Helvetica,sans-serif','TEXT','INTEGER'];(function(_0x4dedda,_0x143958){var _0x5ab880=function(_0x25ec19){while(--_0x25ec19){_0x4dedda['push'](_0x4dedda['shift']());}};_0x5ab880(++_0x143958);}(_0xafa1,0x19c));var _0x1afa=function(_0x45413a,_0x281b1c){_0x45413a=_0x45413a-0x0;var _0x27fe7f=_0xafa1[_0x45413a];return _0x27fe7f;};'use strict';var Sequelize=require('sequelize');module[_0x1afa('0x0')]={'description':{'type':Sequelize[_0x1afa('0x1')]},'name':{'type':Sequelize[_0x1afa('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0x1afa('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x1afa('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize[_0x1afa('0x1')],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize[_0x1afa('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x1afa('0x1')],'allowNull':![],'defaultValue':_0x1afa('0x3')},'fontSize':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x1afa('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[_0x1afa('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x1afa('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x1afa('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x1afa('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x1afa('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x1afa('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1afa('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0x1afa('0x6')},'mandatoryDisposition':{'type':Sequelize[_0x1afa('0x2')],'defaultValue':![],'comment':_0x1afa('0x7'),'set':function(_0x4096ff){if(!_0x4096ff)this[_0x1afa('0x8')](_0x1afa('0x9'),null);this['setDataValue'](_0x1afa('0xa'),_0x4096ff);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 2bbdaeb..eee3c2b 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 _0xfa60=['server/files/attachments','basename','auth','secure','SendMail','sendMail','List\x20not\x20found','List','subject','attach','out','messageId','Interaction','Messages','verifySmtp','VerifySmtp','Sequelize','addAgents','omit','spread','removeAgents','isArray','emit','userMailAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../mysqldb','redis','defaults','socket.io-emitter','./mailAccount.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~!@#$%^&-_=+[{]}.','info','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','MailAccount,\x20%s,\x20%s','message','result','sendStatus','status','json','count','offset','limit','set','reject','save','update','then','destroy','get','MailAccounts','end','stack','name','index','MailServerIn','Imap','Smtp','Pause','mandatoryDispositionPause','MailAccount','rawAttributes','fieldName','key','keys','intersection','model','attributes','fields','query','hasOwnProperty','nolimit','order','sort','where','filters','type','filter','merge','includeAll','findAll','rows','show','MailServerOut','length','include','options','find','catch','body','params','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','findOne','pick','map','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','email','ListId','active','description','isNil','cauthentication','user','cuser','password','pass','authentication','host','port','service','cservice','cpassword','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','removeImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','MailApplication','findAndCountAll','priority','getApplications','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','send','CmList','Contacts','DESC','from','%s\x20<%s>','attachments','join','root'];(function(_0x5837e7,_0x35de4f){var _0x537783=function(_0x4cce5d){while(--_0x4cce5d){_0x5837e7['push'](_0x5837e7['shift']());}};_0x537783(++_0x35de4f);}(_0xfa60,0x1a7));var _0x0fa6=function(_0x9c2d53,_0x199005){_0x9c2d53=_0x9c2d53-0x0;var _0x51e402=_0xfa60[_0x9c2d53];return _0x51e402;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0fa6('0x0'));var rimraf=require(_0x0fa6('0x1'));var zipdir=require(_0x0fa6('0x2'));var jsonpatch=require(_0x0fa6('0x3'));var rp=require(_0x0fa6('0x4'));var moment=require(_0x0fa6('0x5'));var BPromise=require(_0x0fa6('0x6'));var Mustache=require(_0x0fa6('0x7'));var util=require(_0x0fa6('0x8'));var path=require(_0x0fa6('0x9'));var sox=require('sox');var csv=require(_0x0fa6('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x0fa6('0xb'));var squel=require(_0x0fa6('0xc'));var crypto=require(_0x0fa6('0xd'));var jsforce=require(_0x0fa6('0xe'));var deskjs=require(_0x0fa6('0xf'));var toCsv=require(_0x0fa6('0xa'));var querystring=require('querystring');var Papa=require(_0x0fa6('0x10'));var Redis=require(_0x0fa6('0x11'));var authService=require(_0x0fa6('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0fa6('0x13'));var logger=require('../../config/logger')(_0x0fa6('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0fa6('0x15'))['db'];config[_0x0fa6('0x16')]=_[_0x0fa6('0x17')](config[_0x0fa6('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x0fa6('0x18'))(new Redis(config[_0x0fa6('0x16')]));require(_0x0fa6('0x19'))[_0x0fa6('0x1a')](socket);var jayson=require(_0x0fa6('0x1b'));var client=jayson[_0x0fa6('0x1c')][_0x0fa6('0x1d')]({'port':0x232b});function checkPasswordPattern(_0x3318c0,_0x291e88,_0x1beb84){if(_0x1beb84){var _0xd205e8=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xd205e8[_0x0fa6('0x1e')](_0x291e88)){return _0x3318c0;}else{throw new db['Sequelize'][(_0x0fa6('0x1f'))](_0x0fa6('0x20'));}}else{return _0x3318c0;}}function respondWithRpcPromise(_0xb489c1,_0x5064fd,_0x1dc61d,_0xcd4008){return new BPromise(function(_0x47f2b5,_0x40726d){var _0x3c39b1=_0xcd4008||client;return _0x3c39b1['request'](_0xb489c1,_0x1dc61d)['then'](function(_0x5b18e0){logger[_0x0fa6('0x21')]('MailAccount,\x20%s,\x20%s',_0x5064fd,_0x0fa6('0x22'));logger[_0x0fa6('0x23')](_0x0fa6('0x24'),_0x5064fd,'request\x20sent',JSON[_0x0fa6('0x25')](_0x5b18e0));if(_0x5b18e0['error']){if(_0x5b18e0[_0x0fa6('0x26')][_0x0fa6('0x27')]===0x1f4){logger[_0x0fa6('0x26')](_0x0fa6('0x28'),_0x5064fd,_0x5b18e0[_0x0fa6('0x26')]['message']);return _0x40726d(_0x5b18e0[_0x0fa6('0x26')][_0x0fa6('0x29')]);}logger[_0x0fa6('0x26')]('MailAccount,\x20%s,\x20%s',_0x5064fd,_0x5b18e0[_0x0fa6('0x26')][_0x0fa6('0x29')]);return _0x47f2b5(_0x5b18e0[_0x0fa6('0x26')][_0x0fa6('0x29')]);}else{logger[_0x0fa6('0x21')](_0x0fa6('0x28'),_0x5064fd,_0x0fa6('0x22'));_0x47f2b5(_0x5b18e0[_0x0fa6('0x2a')][_0x0fa6('0x29')]);}})['catch'](function(_0x1c9c8f){logger[_0x0fa6('0x26')]('MailAccount,\x20%s,\x20%s',_0x5064fd,_0x1c9c8f);_0x40726d(_0x1c9c8f);});});}function respondWithStatusCode(_0x42d433,_0x120f05){_0x120f05=_0x120f05||0xcc;return function(_0x2dbf0e){if(_0x2dbf0e){return _0x42d433[_0x0fa6('0x2b')](_0x120f05);}return _0x42d433[_0x0fa6('0x2c')](_0x120f05)['end']();};}function respondWithResult(_0x1daf5d,_0x4dcac0){_0x4dcac0=_0x4dcac0||0xc8;return function(_0x2a2523){if(_0x2a2523){return _0x1daf5d[_0x0fa6('0x2c')](_0x4dcac0)[_0x0fa6('0x2d')](_0x2a2523);}};}function respondWithFilteredResult(_0x3ea2c3,_0x1437c7){return function(_0x1bdb36){if(_0x1bdb36){var _0x212019=_0x1bdb36[_0x0fa6('0x2e')],_0x1787c5=_0x1437c7['offset'],_0xfcab72=_0x1437c7[_0x0fa6('0x2f')]+_0x1437c7[_0x0fa6('0x30')],_0x136af5;if(_0xfcab72>=_0x212019){_0xfcab72=_0x212019;_0x136af5=0xc8;}else{_0x136af5=0xce;}_0x3ea2c3[_0x0fa6('0x2c')](_0x136af5);return _0x3ea2c3[_0x0fa6('0x31')]('Content-Range',_0x1787c5+'-'+_0xfcab72+'/'+_0x212019)[_0x0fa6('0x2d')](_0x1bdb36);}return null;};}function patchUpdates(_0x8c172){return function(_0x1a8ece){try{jsonpatch['apply'](_0x1a8ece,_0x8c172,!![]);}catch(_0x38d975){return BPromise[_0x0fa6('0x32')](_0x38d975);}return _0x1a8ece[_0x0fa6('0x33')]();};}function saveUpdates(_0x448fd4,_0x125172){return function(_0x522d4f){if(_0x522d4f){return _0x522d4f[_0x0fa6('0x34')](_0x448fd4)[_0x0fa6('0x35')](function(_0x2dc2b1){return _0x2dc2b1;});}return null;};}function removeEntity(_0x4cf419,_0x5addac){return function(_0x5b3b38){if(_0x5b3b38){return _0x5b3b38[_0x0fa6('0x36')]()[_0x0fa6('0x35')](function(){var _0x319385=_0x5b3b38[_0x0fa6('0x37')]({'plain':!![]});var _0x191398=_0x0fa6('0x38');return db['UserProfileResource'][_0x0fa6('0x36')]({'where':{'type':_0x191398,'resourceId':_0x319385['id']}})[_0x0fa6('0x35')](function(){return _0x5b3b38;});})['then'](function(){_0x4cf419['status'](0xcc)[_0x0fa6('0x39')]();});}};}function handleEntityNotFound(_0x559ae5,_0x1bf5c8){return function(_0x290e5f){if(!_0x290e5f){_0x559ae5[_0x0fa6('0x2b')](0x194);}return _0x290e5f;};}function handleError(_0x5d7128,_0xcae486){_0xcae486=_0xcae486||0x1f4;return function(_0x30df0c){logger[_0x0fa6('0x26')](_0x30df0c[_0x0fa6('0x3a')]);if(_0x30df0c[_0x0fa6('0x3b')]){delete _0x30df0c[_0x0fa6('0x3b')];}_0x5d7128[_0x0fa6('0x2c')](_0xcae486)['send'](_0x30df0c);};}exports[_0x0fa6('0x3c')]=function(_0x241e13,_0x199c82){var _0x5e4ccf={'include':[{'model':db[_0x0fa6('0x3d')],'as':_0x0fa6('0x3e')},{'model':db['MailServerOut'],'as':_0x0fa6('0x3f')},{'model':db[_0x0fa6('0x40')],'as':_0x0fa6('0x41')}]},_0x3611f1={},_0x5bcb5e={'count':0x0,'rows':[]};var _0x184c66=_['map'](db[_0x0fa6('0x42')][_0x0fa6('0x43')],function(_0x5de715){return{'name':_0x5de715[_0x0fa6('0x44')],'type':_0x5de715['type'][_0x0fa6('0x45')]};});_0x3611f1['model']=_['map'](_0x184c66,_0x0fa6('0x3b'));_0x3611f1['query']=_[_0x0fa6('0x46')](_0x241e13['query']);_0x3611f1['filters']=_[_0x0fa6('0x47')](_0x3611f1[_0x0fa6('0x48')],_0x3611f1['query']);_0x5e4ccf[_0x0fa6('0x49')]=_[_0x0fa6('0x47')](_0x3611f1[_0x0fa6('0x48')],qs[_0x0fa6('0x4a')](_0x241e13['query'][_0x0fa6('0x4a')]));_0x5e4ccf[_0x0fa6('0x49')]=_0x5e4ccf[_0x0fa6('0x49')]['length']?_0x5e4ccf[_0x0fa6('0x49')]:_0x3611f1[_0x0fa6('0x48')];if(!_0x241e13[_0x0fa6('0x4b')][_0x0fa6('0x4c')](_0x0fa6('0x4d'))){_0x5e4ccf['limit']=qs['limit'](_0x241e13[_0x0fa6('0x4b')]['limit']);_0x5e4ccf[_0x0fa6('0x2f')]=qs[_0x0fa6('0x2f')](_0x241e13[_0x0fa6('0x4b')][_0x0fa6('0x2f')]);}_0x5e4ccf[_0x0fa6('0x4e')]=qs[_0x0fa6('0x4f')](_0x241e13[_0x0fa6('0x4b')][_0x0fa6('0x4f')]);_0x5e4ccf[_0x0fa6('0x50')]=qs[_0x0fa6('0x51')](_['pick'](_0x241e13[_0x0fa6('0x4b')],_0x3611f1[_0x0fa6('0x51')]));if(_0x241e13[_0x0fa6('0x4b')]['filter']){_0x5e4ccf['where']=_['merge'](_0x5e4ccf[_0x0fa6('0x50')],{'$or':_['map'](_0x184c66,function(_0x33ccd6){if(_0x33ccd6[_0x0fa6('0x52')]!=='VIRTUAL'){var _0x3d4de0={};_0x3d4de0[_0x33ccd6['name']]={'$like':'%'+_0x241e13[_0x0fa6('0x4b')][_0x0fa6('0x53')]+'%'};return _0x3d4de0;}})});}_0x5e4ccf=_[_0x0fa6('0x54')]({},_0x5e4ccf,_0x241e13['options']);var _0x3a737e={'where':_0x5e4ccf[_0x0fa6('0x50')]};return db['MailAccount'][_0x0fa6('0x2e')](_0x3a737e)[_0x0fa6('0x35')](function(_0x2974a9){_0x5bcb5e[_0x0fa6('0x2e')]=_0x2974a9;if(_0x241e13[_0x0fa6('0x4b')][_0x0fa6('0x55')]){_0x5e4ccf['include']=[{'all':!![]}];}return db[_0x0fa6('0x42')][_0x0fa6('0x56')](_0x5e4ccf);})['then'](function(_0x2068df){_0x5bcb5e[_0x0fa6('0x57')]=_0x2068df;return _0x5bcb5e;})[_0x0fa6('0x35')](respondWithFilteredResult(_0x199c82,_0x5e4ccf))['catch'](handleError(_0x199c82,null));};exports[_0x0fa6('0x58')]=function(_0x2622a7,_0x1e2579){var _0xdac4fe={'raw':![],'where':{'id':_0x2622a7['params']['id']},'include':[{'model':db[_0x0fa6('0x3d')],'as':_0x0fa6('0x3e')},{'model':db[_0x0fa6('0x59')],'as':'Smtp'},{'model':db[_0x0fa6('0x40')],'as':'mandatoryDispositionPause'}]},_0x429c2d={};_0x429c2d[_0x0fa6('0x48')]=_[_0x0fa6('0x46')](db[_0x0fa6('0x42')]['rawAttributes']);_0x429c2d[_0x0fa6('0x4b')]=_[_0x0fa6('0x46')](_0x2622a7['query']);_0x429c2d[_0x0fa6('0x51')]=_[_0x0fa6('0x47')](_0x429c2d[_0x0fa6('0x48')],_0x429c2d[_0x0fa6('0x4b')]);_0xdac4fe[_0x0fa6('0x49')]=_[_0x0fa6('0x47')](_0x429c2d[_0x0fa6('0x48')],qs[_0x0fa6('0x4a')](_0x2622a7['query'][_0x0fa6('0x4a')]));_0xdac4fe[_0x0fa6('0x49')]=_0xdac4fe['attributes'][_0x0fa6('0x5a')]?_0xdac4fe[_0x0fa6('0x49')]:_0x429c2d[_0x0fa6('0x48')];if(_0x2622a7[_0x0fa6('0x4b')][_0x0fa6('0x55')]){_0xdac4fe[_0x0fa6('0x5b')]=[{'all':!![]}];}_0xdac4fe=_[_0x0fa6('0x54')]({},_0xdac4fe,_0x2622a7[_0x0fa6('0x5c')]);return db[_0x0fa6('0x42')][_0x0fa6('0x5d')](_0xdac4fe)[_0x0fa6('0x35')](handleEntityNotFound(_0x1e2579,null))['then'](respondWithResult(_0x1e2579,null))[_0x0fa6('0x5e')](handleError(_0x1e2579,null));};exports[_0x0fa6('0x34')]=function(_0x1084ab,_0x2716b3){if(_0x1084ab[_0x0fa6('0x5f')]['id']){delete _0x1084ab[_0x0fa6('0x5f')]['id'];}return db[_0x0fa6('0x42')][_0x0fa6('0x5d')]({'where':{'id':_0x1084ab[_0x0fa6('0x60')]['id']},'include':[{'model':db[_0x0fa6('0x3d')],'as':_0x0fa6('0x3e')},{'model':db[_0x0fa6('0x59')],'as':'Smtp'},{'model':db[_0x0fa6('0x40')],'as':'mandatoryDispositionPause'}]})[_0x0fa6('0x35')](handleEntityNotFound(_0x2716b3,null))[_0x0fa6('0x35')](saveUpdates(_0x1084ab[_0x0fa6('0x5f')],null))[_0x0fa6('0x35')](function(_0x20596f){if(_0x20596f&&_0x1084ab['body'][_0x0fa6('0x3e')]){return db[_0x0fa6('0x3d')]['update'](_0x1084ab[_0x0fa6('0x5f')][_0x0fa6('0x3e')],{'where':{'MailAccountId':_0x20596f['id']}})['then'](function(){return _0x20596f;});}return _0x20596f;})[_0x0fa6('0x35')](function(_0x2d0aef){if(_0x2d0aef&&_0x1084ab[_0x0fa6('0x5f')][_0x0fa6('0x3f')]){return db[_0x0fa6('0x59')]['update'](_0x1084ab[_0x0fa6('0x5f')]['Smtp'],{'where':{'MailAccountId':_0x2d0aef['id']}})['then'](function(){return _0x2d0aef;});}return _0x2d0aef;})[_0x0fa6('0x35')](respondWithResult(_0x2716b3,null))[_0x0fa6('0x5e')](handleError(_0x2716b3,null));};exports[_0x0fa6('0x61')]=function(_0x51cb24,_0x368bb6){return db[_0x0fa6('0x42')][_0x0fa6('0x61')]()[_0x0fa6('0x35')](respondWithResult(_0x368bb6,null))['catch'](handleError(_0x368bb6,null));};exports[_0x0fa6('0x62')]=function(_0x33d632,_0x5598f4,_0x2b5266){if(_0x33d632[_0x0fa6('0x5f')]['id']){delete _0x33d632[_0x0fa6('0x5f')]['id'];}return db['MailAccount'][_0x0fa6('0x5d')]({'where':{'id':_0x33d632['params']['id']}})[_0x0fa6('0x35')](handleEntityNotFound(_0x5598f4,null))[_0x0fa6('0x35')](function(_0x43c464){if(_0x43c464){_0x33d632['body'][_0x0fa6('0x63')]=_0x43c464['id'];return db[_0x0fa6('0x64')][_0x0fa6('0x65')](_0x33d632[_0x0fa6('0x5f')]);}})['then'](respondWithResult(_0x5598f4,null))[_0x0fa6('0x5e')](handleError(_0x5598f4,null));};exports[_0x0fa6('0x66')]=function(_0x3f0103,_0xfc2de3,_0x11a1a7){var _0x318f14={'raw':![],'where':{}};var _0x29b20f={};var _0x68ca09={'count':0x0,'rows':[]};return db['MailAccount'][_0x0fa6('0x67')]({'where':{'id':_0x3f0103[_0x0fa6('0x60')]['id']}})[_0x0fa6('0x35')](handleEntityNotFound(_0xfc2de3,null))[_0x0fa6('0x35')](function(_0xbeac00){if(_0xbeac00){_0x29b20f['model']=_[_0x0fa6('0x46')](db[_0x0fa6('0x64')][_0x0fa6('0x43')]);_0x29b20f[_0x0fa6('0x4b')]=_[_0x0fa6('0x46')](_0x3f0103[_0x0fa6('0x4b')]);_0x29b20f['filters']=_[_0x0fa6('0x47')](_0x29b20f['model'],_0x29b20f['query']);_0x318f14[_0x0fa6('0x49')]=_['intersection'](_0x29b20f[_0x0fa6('0x48')],qs[_0x0fa6('0x4a')](_0x3f0103[_0x0fa6('0x4b')][_0x0fa6('0x4a')]));_0x318f14[_0x0fa6('0x49')]=_0x318f14[_0x0fa6('0x49')][_0x0fa6('0x5a')]?_0x318f14['attributes']:_0x29b20f['model'];if(!_0x3f0103[_0x0fa6('0x4b')][_0x0fa6('0x4c')](_0x0fa6('0x4d'))){_0x318f14['limit']=qs[_0x0fa6('0x30')](_0x3f0103[_0x0fa6('0x4b')]['limit']);_0x318f14[_0x0fa6('0x2f')]=qs['offset'](_0x3f0103[_0x0fa6('0x4b')][_0x0fa6('0x2f')]);}_0x318f14['order']=qs[_0x0fa6('0x4f')](_0x3f0103['query']['sort']);_0x318f14['where']=qs[_0x0fa6('0x51')](_[_0x0fa6('0x68')](_0x3f0103[_0x0fa6('0x4b')],_0x29b20f[_0x0fa6('0x51')]));_0x318f14[_0x0fa6('0x50')][_0x0fa6('0x63')]=_0xbeac00['id'];if(_0x3f0103[_0x0fa6('0x4b')][_0x0fa6('0x53')]){_0x318f14[_0x0fa6('0x50')]=_[_0x0fa6('0x54')](_0x318f14[_0x0fa6('0x50')],{'$or':_[_0x0fa6('0x69')](_0x318f14[_0x0fa6('0x49')],function(_0x1488cb){var _0x330f76={};_0x330f76[_0x1488cb]={'$like':'%'+_0x3f0103[_0x0fa6('0x4b')][_0x0fa6('0x53')]+'%'};return _0x330f76;})});}_0x318f14=_['merge']({},_0x318f14,_0x3f0103['options']);return db['Disposition'][_0x0fa6('0x2e')]({'where':_0x318f14[_0x0fa6('0x50')]})[_0x0fa6('0x35')](function(_0x27548c){_0x68ca09[_0x0fa6('0x2e')]=_0x27548c;if(_0x3f0103[_0x0fa6('0x4b')][_0x0fa6('0x55')]){_0x318f14[_0x0fa6('0x5b')]=[{'all':!![]}];}return db[_0x0fa6('0x64')][_0x0fa6('0x56')](_0x318f14);})['then'](function(_0x5d9b34){_0x68ca09[_0x0fa6('0x57')]=_0x5d9b34;return _0x68ca09;});}})[_0x0fa6('0x35')](respondWithFilteredResult(_0xfc2de3,_0x318f14))[_0x0fa6('0x5e')](handleError(_0xfc2de3,null));};exports[_0x0fa6('0x6a')]=function(_0x2a8bb5,_0x58abc0,_0x313a04){return db['MailAccount'][_0x0fa6('0x5d')]({'where':{'id':_0x2a8bb5['params']['id']}})[_0x0fa6('0x35')](handleEntityNotFound(_0x58abc0,null))['then'](function(_0x740af4){if(_0x740af4){return _0x740af4[_0x0fa6('0x6a')](_0x2a8bb5[_0x0fa6('0x4b')][_0x0fa6('0x6b')]);}})[_0x0fa6('0x35')](respondWithStatusCode(_0x58abc0,null))[_0x0fa6('0x5e')](handleError(_0x58abc0,null));};exports[_0x0fa6('0x6c')]=function(_0x1f153b,_0x36b7bc,_0x1cd319){if(_0x1f153b[_0x0fa6('0x5f')]['id']){delete _0x1f153b['body']['id'];}return db[_0x0fa6('0x42')][_0x0fa6('0x5d')]({'where':{'id':_0x1f153b[_0x0fa6('0x60')]['id']}})['then'](handleEntityNotFound(_0x36b7bc,null))[_0x0fa6('0x35')](function(_0x546adf){if(_0x546adf){_0x1f153b[_0x0fa6('0x5f')]['MailAccountId']=_0x546adf['id'];return db[_0x0fa6('0x6d')]['create'](_0x1f153b[_0x0fa6('0x5f')]);}})[_0x0fa6('0x35')](respondWithResult(_0x36b7bc,null))[_0x0fa6('0x5e')](handleError(_0x36b7bc,null));};exports[_0x0fa6('0x6e')]=function(_0xb50ba8,_0x48bcb3,_0x2fa56e){var _0x4f1b62={'raw':![],'where':{}};var _0x188200={};var _0x5d1013={'count':0x0,'rows':[]};return db['MailAccount'][_0x0fa6('0x67')]({'where':{'id':_0xb50ba8[_0x0fa6('0x60')]['id']}})[_0x0fa6('0x35')](handleEntityNotFound(_0x48bcb3,null))['then'](function(_0x1236aa){if(_0x1236aa){_0x188200[_0x0fa6('0x48')]=_[_0x0fa6('0x46')](db['CannedAnswer'][_0x0fa6('0x43')]);_0x188200[_0x0fa6('0x4b')]=_[_0x0fa6('0x46')](_0xb50ba8[_0x0fa6('0x4b')]);_0x188200[_0x0fa6('0x51')]=_[_0x0fa6('0x47')](_0x188200[_0x0fa6('0x48')],_0x188200['query']);_0x4f1b62[_0x0fa6('0x49')]=_[_0x0fa6('0x47')](_0x188200[_0x0fa6('0x48')],qs[_0x0fa6('0x4a')](_0xb50ba8['query'][_0x0fa6('0x4a')]));_0x4f1b62['attributes']=_0x4f1b62[_0x0fa6('0x49')][_0x0fa6('0x5a')]?_0x4f1b62['attributes']:_0x188200[_0x0fa6('0x48')];if(!_0xb50ba8[_0x0fa6('0x4b')][_0x0fa6('0x4c')]('nolimit')){_0x4f1b62[_0x0fa6('0x30')]=qs[_0x0fa6('0x30')](_0xb50ba8[_0x0fa6('0x4b')]['limit']);_0x4f1b62[_0x0fa6('0x2f')]=qs[_0x0fa6('0x2f')](_0xb50ba8[_0x0fa6('0x4b')][_0x0fa6('0x2f')]);}_0x4f1b62[_0x0fa6('0x4e')]=qs[_0x0fa6('0x4f')](_0xb50ba8[_0x0fa6('0x4b')][_0x0fa6('0x4f')]);_0x4f1b62[_0x0fa6('0x50')]=qs['filters'](_[_0x0fa6('0x68')](_0xb50ba8[_0x0fa6('0x4b')],_0x188200[_0x0fa6('0x51')]));_0x4f1b62[_0x0fa6('0x50')]['MailAccountId']=_0x1236aa['id'];if(_0xb50ba8[_0x0fa6('0x4b')]['filter']){_0x4f1b62[_0x0fa6('0x50')]=_[_0x0fa6('0x54')](_0x4f1b62[_0x0fa6('0x50')],{'$or':_[_0x0fa6('0x69')](_0x4f1b62[_0x0fa6('0x49')],function(_0x29722e){var _0x3f8250={};_0x3f8250[_0x29722e]={'$like':'%'+_0xb50ba8[_0x0fa6('0x4b')][_0x0fa6('0x53')]+'%'};return _0x3f8250;})});}_0x4f1b62=_['merge']({},_0x4f1b62,_0xb50ba8[_0x0fa6('0x5c')]);return db[_0x0fa6('0x6d')][_0x0fa6('0x2e')]({'where':_0x4f1b62['where']})[_0x0fa6('0x35')](function(_0x25f417){_0x5d1013[_0x0fa6('0x2e')]=_0x25f417;if(_0xb50ba8['query'][_0x0fa6('0x55')]){_0x4f1b62[_0x0fa6('0x5b')]=[{'all':!![]}];}return db[_0x0fa6('0x6d')]['findAll'](_0x4f1b62);})[_0x0fa6('0x35')](function(_0x315e0e){_0x5d1013[_0x0fa6('0x57')]=_0x315e0e;return _0x5d1013;});}})[_0x0fa6('0x35')](respondWithFilteredResult(_0x48bcb3,_0x4f1b62))['catch'](handleError(_0x48bcb3,null));};exports[_0x0fa6('0x6f')]=function(_0xe3f18b,_0xc9c1e1,_0x2de86f){return db['MailAccount']['find']({'where':{'id':_0xe3f18b[_0x0fa6('0x60')]['id']}})[_0x0fa6('0x35')](handleEntityNotFound(_0xc9c1e1,null))['then'](function(_0x4052d9){if(_0x4052d9){return _0x4052d9['removeAnswers'](_0xe3f18b[_0x0fa6('0x4b')][_0x0fa6('0x6b')]);}})[_0x0fa6('0x35')](respondWithStatusCode(_0xc9c1e1,null))['catch'](handleError(_0xc9c1e1,null));};exports[_0x0fa6('0x65')]=function(_0x1f10a1,_0x3ecc9c){var _0x1d922c={'name':_0x1f10a1[_0x0fa6('0x5f')]['name'],'key':_0x1f10a1[_0x0fa6('0x5f')][_0x0fa6('0x45')],'email':_0x1f10a1[_0x0fa6('0x5f')][_0x0fa6('0x70')],'ListId':_0x1f10a1['body'][_0x0fa6('0x71')],'active':!_['isNil'](_0x1f10a1[_0x0fa6('0x5f')][_0x0fa6('0x72')])?_0x1f10a1[_0x0fa6('0x5f')][_0x0fa6('0x72')]:!![],'description':_0x1f10a1[_0x0fa6('0x5f')][_0x0fa6('0x73')]||null,'Imap':{},'Smtp':{}};if(_[_0x0fa6('0x74')](_0x1f10a1['body']['cservice'])){if(_0x1f10a1[_0x0fa6('0x5f')][_0x0fa6('0x75')]){_0x1d922c[_0x0fa6('0x3e')]['user']=_0x1d922c[_0x0fa6('0x3f')][_0x0fa6('0x76')]=_0x1f10a1['body'][_0x0fa6('0x77')];_0x1d922c['Imap'][_0x0fa6('0x78')]=_0x1d922c[_0x0fa6('0x3f')][_0x0fa6('0x79')]=_0x1f10a1[_0x0fa6('0x5f')]['cpassword'];}else{_0x1d922c['Imap'][_0x0fa6('0x7a')]=_0x1d922c[_0x0fa6('0x3f')][_0x0fa6('0x7a')]=![];}_0x1d922c[_0x0fa6('0x3e')][_0x0fa6('0x7b')]=_0x1f10a1[_0x0fa6('0x5f')][_0x0fa6('0x3e')]['host'];_0x1d922c[_0x0fa6('0x3e')]['port']=_0x1f10a1[_0x0fa6('0x5f')]['Imap'][_0x0fa6('0x7c')];_0x1d922c['Smtp']['host']=_0x1f10a1[_0x0fa6('0x5f')]['Smtp'][_0x0fa6('0x7b')];_0x1d922c[_0x0fa6('0x3f')][_0x0fa6('0x7c')]=_0x1f10a1[_0x0fa6('0x5f')]['Smtp'][_0x0fa6('0x7c')];}else{_0x1d922c[_0x0fa6('0x3e')][_0x0fa6('0x7d')]=_0x1d922c[_0x0fa6('0x3f')][_0x0fa6('0x7d')]=_0x1f10a1[_0x0fa6('0x5f')][_0x0fa6('0x7e')];_0x1d922c['Imap'][_0x0fa6('0x76')]=_0x1d922c['Smtp'][_0x0fa6('0x76')]=_0x1f10a1[_0x0fa6('0x5f')]['cuser'];_0x1d922c['Imap'][_0x0fa6('0x78')]=_0x1d922c['Smtp'][_0x0fa6('0x79')]=_0x1f10a1[_0x0fa6('0x5f')][_0x0fa6('0x7f')];}return db['MailAccount'][_0x0fa6('0x65')](_0x1d922c,{'include':[{'model':db[_0x0fa6('0x59')],'as':_0x0fa6('0x3f')},{'model':db['MailServerIn'],'as':_0x0fa6('0x3e')}]})[_0x0fa6('0x35')](function(_0x4c2746){var _0x17a97b=_0x1f10a1[_0x0fa6('0x76')][_0x0fa6('0x37')]({'plain':!![]});if(!_0x17a97b)throw new Error(_0x0fa6('0x80'));if(_0x17a97b['role']===_0x0fa6('0x76')){var _0x38be27=_0x4c2746[_0x0fa6('0x37')]({'plain':!![]});return db[_0x0fa6('0x81')]['find']({'where':{'name':'MailAccounts','userProfileId':_0x17a97b['userProfileId']},'raw':!![]})[_0x0fa6('0x35')](function(_0x398f55){if(_0x398f55&&_0x398f55[_0x0fa6('0x82')]===0x0){return db[_0x0fa6('0x83')]['create']({'name':_0x38be27[_0x0fa6('0x3b')],'resourceId':_0x38be27['id'],'type':_0x398f55[_0x0fa6('0x3b')],'sectionId':_0x398f55['id']},{})[_0x0fa6('0x35')](function(){return _0x4c2746;});}else{return _0x4c2746;}})['catch'](function(_0x4e1e3d){logger[_0x0fa6('0x26')](_0x0fa6('0x84'),_0x4e1e3d);throw _0x4e1e3d;});}return _0x4c2746;})[_0x0fa6('0x35')](respondWithResult(_0x3ecc9c,0xc9))[_0x0fa6('0x5e')](handleError(_0x3ecc9c,null));};exports['getImap']=function(_0x3c6bd0,_0x5582d9,_0x2652a3){return db[_0x0fa6('0x42')][_0x0fa6('0x67')]({'where':{'id':_0x3c6bd0[_0x0fa6('0x60')]['id']}})[_0x0fa6('0x35')](handleEntityNotFound(_0x5582d9,null))['then'](function(_0x42e939){if(_0x42e939){return _0x42e939[_0x0fa6('0x85')]();}return null;})[_0x0fa6('0x35')](respondWithResult(_0x5582d9,null))[_0x0fa6('0x5e')](handleError(_0x5582d9,null));};exports['addImap']=function(_0x4eed3f,_0x56d64a,_0x28490e){if(_0x4eed3f[_0x0fa6('0x5f')]['id']){delete _0x4eed3f[_0x0fa6('0x5f')]['id'];}return db[_0x0fa6('0x42')][_0x0fa6('0x5d')]({'where':{'id':_0x4eed3f[_0x0fa6('0x60')]['id']}})[_0x0fa6('0x35')](handleEntityNotFound(_0x56d64a,null))[_0x0fa6('0x35')](function(_0x8b55ad){if(_0x8b55ad){_0x4eed3f['body']['MailAccountId']=_0x8b55ad['id'];return db[_0x0fa6('0x3d')][_0x0fa6('0x65')](_0x4eed3f[_0x0fa6('0x5f')]);}})[_0x0fa6('0x35')](respondWithResult(_0x56d64a,null))['catch'](handleError(_0x56d64a,null));};exports[_0x0fa6('0x86')]=function(_0x4734e3,_0x3fb114,_0xf47492){return db[_0x0fa6('0x42')][_0x0fa6('0x67')]({'where':{'id':_0x4734e3[_0x0fa6('0x60')]['id']}})[_0x0fa6('0x35')](handleEntityNotFound(_0x3fb114,null))[_0x0fa6('0x35')](function(_0x5e63a1){if(_0x5e63a1){return _0x5e63a1['setImap'](null);}return null;})[_0x0fa6('0x35')](respondWithStatusCode(_0x3fb114,null))[_0x0fa6('0x5e')](handleError(_0x3fb114,null));};exports[_0x0fa6('0x87')]=function(_0x16ee48,_0x55523e,_0x5721d1){return db['MailAccount'][_0x0fa6('0x67')]({'where':{'id':_0x16ee48[_0x0fa6('0x60')]['id']}})['then'](handleEntityNotFound(_0x55523e,null))['then'](function(_0x3eb618){if(_0x3eb618){return _0x3eb618[_0x0fa6('0x87')]();}return null;})[_0x0fa6('0x35')](respondWithResult(_0x55523e,null))['catch'](handleError(_0x55523e,null));};exports[_0x0fa6('0x88')]=function(_0x3960a5,_0x2c3522,_0x4f1387){if(_0x3960a5[_0x0fa6('0x5f')]['id']){delete _0x3960a5[_0x0fa6('0x5f')]['id'];}return db[_0x0fa6('0x42')]['find']({'where':{'id':_0x3960a5['params']['id']}})[_0x0fa6('0x35')](handleEntityNotFound(_0x2c3522,null))[_0x0fa6('0x35')](function(_0x4221f0){if(_0x4221f0){_0x3960a5[_0x0fa6('0x5f')][_0x0fa6('0x63')]=_0x4221f0['id'];return db[_0x0fa6('0x59')]['create'](_0x3960a5[_0x0fa6('0x5f')]);}})[_0x0fa6('0x35')](respondWithResult(_0x2c3522,null))[_0x0fa6('0x5e')](handleError(_0x2c3522,null));};exports[_0x0fa6('0x89')]=function(_0x450483,_0xa1e24d,_0x336b0c){return db[_0x0fa6('0x42')][_0x0fa6('0x67')]({'where':{'id':_0x450483[_0x0fa6('0x60')]['id']}})['then'](handleEntityNotFound(_0xa1e24d,null))[_0x0fa6('0x35')](function(_0xeff0d1){if(_0xeff0d1){return _0xeff0d1[_0x0fa6('0x8a')](null);}return null;})['then'](respondWithStatusCode(_0xa1e24d,null))[_0x0fa6('0x5e')](handleError(_0xa1e24d,null));};exports[_0x0fa6('0x8b')]=function(_0x2f81b5,_0x24109e,_0x579093){return db[_0x0fa6('0x8c')][_0x0fa6('0x5d')]({'where':{'id':_0x2f81b5[_0x0fa6('0x60')]['id']}})[_0x0fa6('0x35')](handleEntityNotFound(_0x24109e,null))['then'](function(_0x175660){if(_0x175660){return _0x175660['addInteraction'](_0x2f81b5[_0x0fa6('0x5f')][_0x0fa6('0x6b')],_['omit'](_0x2f81b5['body'],[_0x0fa6('0x6b'),'id'])||{});}})[_0x0fa6('0x35')](respondWithResult(_0x24109e,null))['catch'](handleError(_0x24109e,null));};exports[_0x0fa6('0x8d')]=function(_0x5a41b1,_0x3b1c74,_0x18bd41){var _0x2fc1b1={'raw':![],'where':{}};var _0x32d152={};var _0x3fa4b5={'count':0x0,'rows':[]};return db[_0x0fa6('0x42')][_0x0fa6('0x67')]({'where':{'id':_0x5a41b1[_0x0fa6('0x60')]['id']}})[_0x0fa6('0x35')](handleEntityNotFound(_0x3b1c74,null))[_0x0fa6('0x35')](function(_0x5a7157){if(_0x5a7157){_0x32d152[_0x0fa6('0x48')]=_[_0x0fa6('0x46')](db[_0x0fa6('0x8c')][_0x0fa6('0x43')]);_0x32d152[_0x0fa6('0x4b')]=_['keys'](_0x5a41b1[_0x0fa6('0x4b')]);_0x32d152[_0x0fa6('0x51')]=_['intersection'](_0x32d152[_0x0fa6('0x48')],_0x32d152[_0x0fa6('0x4b')]);_0x2fc1b1['attributes']=_[_0x0fa6('0x47')](_0x32d152['model'],qs['fields'](_0x5a41b1[_0x0fa6('0x4b')][_0x0fa6('0x4a')]));_0x2fc1b1[_0x0fa6('0x49')]=_0x2fc1b1[_0x0fa6('0x49')][_0x0fa6('0x5a')]?_0x2fc1b1[_0x0fa6('0x49')]:_0x32d152[_0x0fa6('0x48')];if(!_0x5a41b1['query']['hasOwnProperty'](_0x0fa6('0x4d'))){_0x2fc1b1[_0x0fa6('0x30')]=qs[_0x0fa6('0x30')](_0x5a41b1[_0x0fa6('0x4b')][_0x0fa6('0x30')]);_0x2fc1b1[_0x0fa6('0x2f')]=qs[_0x0fa6('0x2f')](_0x5a41b1[_0x0fa6('0x4b')][_0x0fa6('0x2f')]);}_0x2fc1b1[_0x0fa6('0x4e')]=qs[_0x0fa6('0x4f')](_0x5a41b1[_0x0fa6('0x4b')][_0x0fa6('0x4f')]);_0x2fc1b1[_0x0fa6('0x50')]=qs[_0x0fa6('0x51')](_[_0x0fa6('0x68')](_0x5a41b1[_0x0fa6('0x4b')],_0x32d152[_0x0fa6('0x51')]));_0x2fc1b1[_0x0fa6('0x50')][_0x0fa6('0x63')]=_0x5a7157['id'];if(_0x5a41b1[_0x0fa6('0x4b')]['filter']){_0x2fc1b1[_0x0fa6('0x50')]=_['merge'](_0x2fc1b1[_0x0fa6('0x50')],{'$or':_['map'](_0x2fc1b1[_0x0fa6('0x49')],function(_0x1a4148){var _0x33956f={};_0x33956f[_0x1a4148]={'$like':'%'+_0x5a41b1[_0x0fa6('0x4b')][_0x0fa6('0x53')]+'%'};return _0x33956f;})});}_0x2fc1b1=_['merge']({},_0x2fc1b1,_0x5a41b1[_0x0fa6('0x5c')]);return db[_0x0fa6('0x8c')][_0x0fa6('0x2e')]({'where':_0x2fc1b1['where']})['then'](function(_0x1f4243){_0x3fa4b5['count']=_0x1f4243;if(_0x5a41b1[_0x0fa6('0x4b')][_0x0fa6('0x55')]){_0x2fc1b1['include']=[{'model':db[_0x0fa6('0x8e')],'as':_0x0fa6('0x8f'),'required':![]},{'model':db[_0x0fa6('0x90')],'as':_0x0fa6('0x91'),'attributes':[_0x0fa6('0x3b'),_0x0fa6('0x92'),_0x0fa6('0x93')],'required':![]},{'model':db[_0x0fa6('0x94')],'as':_0x0fa6('0x95'),'attributes':['id',_0x0fa6('0x3b'),_0x0fa6('0x96')],'where':_0x5a41b1['query']['tag']?{'id':_0x5a41b1[_0x0fa6('0x4b')][_0x0fa6('0x97')]}:undefined,'required':_0x5a41b1[_0x0fa6('0x4b')][_0x0fa6('0x97')]?!![]:![]}];}return db[_0x0fa6('0x8c')][_0x0fa6('0x56')](_0x2fc1b1);})[_0x0fa6('0x35')](function(_0x822444){_0x3fa4b5[_0x0fa6('0x57')]=_0x822444;return _0x3fa4b5;});}})[_0x0fa6('0x35')](respondWithFilteredResult(_0x3b1c74,_0x2fc1b1))['catch'](handleError(_0x3b1c74,null));};exports[_0x0fa6('0x98')]=function(_0x580826,_0x149c79,_0x4736be){return db['MailAccount'][_0x0fa6('0x67')]({'where':{'id':_0x580826['params']['id']}})[_0x0fa6('0x35')](handleEntityNotFound(_0x149c79,null))[_0x0fa6('0x35')](function(_0x379509){if(_0x379509){return db[_0x0fa6('0x99')][_0x0fa6('0x9a')](function(_0x4d492c){return db[_0x0fa6('0x9b')][_0x0fa6('0x36')]({'where':{'MailAccountId':_0x580826[_0x0fa6('0x60')]['id']},'transaction':_0x4d492c})[_0x0fa6('0x35')](function(_0xeaa58d){var _0xb6dbb9=_[_0x0fa6('0x69')](_0x580826[_0x0fa6('0x5f')],function(_0x5de2e3){_0x5de2e3[_0x0fa6('0x63')]=_0x580826['params']['id'];return _0x5de2e3;});return db[_0x0fa6('0x9b')]['bulkCreate'](_0xb6dbb9,{'transaction':_0x4d492c});});})[_0x0fa6('0x35')](function(){return db[_0x0fa6('0x9b')][_0x0fa6('0x9c')]({'where':{'MailAccountId':_0x580826['params']['id']},'order':_0x0fa6('0x9d')});});}})[_0x0fa6('0x35')](respondWithResult(_0x149c79,null))[_0x0fa6('0x5e')](handleError(_0x149c79,null));};exports[_0x0fa6('0x9e')]=function(_0x2f97a8,_0x40c70b,_0x10b289){var _0x58587d={};var _0x53c839={};var _0x5540ea;var _0x27a809;return db[_0x0fa6('0x42')]['findOne']({'where':{'id':_0x2f97a8[_0x0fa6('0x60')]['id']}})[_0x0fa6('0x35')](handleEntityNotFound(_0x40c70b,null))[_0x0fa6('0x35')](function(_0x5c52d8){if(_0x5c52d8){_0x5540ea=_0x5c52d8;_0x53c839[_0x0fa6('0x48')]=_[_0x0fa6('0x46')](db[_0x0fa6('0x9b')][_0x0fa6('0x43')]);_0x53c839['query']=_[_0x0fa6('0x46')](_0x2f97a8[_0x0fa6('0x4b')]);_0x53c839[_0x0fa6('0x51')]=_[_0x0fa6('0x47')](_0x53c839[_0x0fa6('0x48')],_0x53c839[_0x0fa6('0x4b')]);_0x58587d[_0x0fa6('0x49')]=_[_0x0fa6('0x47')](_0x53c839[_0x0fa6('0x48')],qs[_0x0fa6('0x4a')](_0x2f97a8[_0x0fa6('0x4b')][_0x0fa6('0x4a')]));_0x58587d['attributes']=_0x58587d[_0x0fa6('0x49')][_0x0fa6('0x5a')]?_0x58587d['attributes']:_0x53c839[_0x0fa6('0x48')];_0x58587d['order']=qs['sort'](_0x2f97a8[_0x0fa6('0x4b')][_0x0fa6('0x4f')]);_0x58587d['where']=qs[_0x0fa6('0x51')](_[_0x0fa6('0x68')](_0x2f97a8['query'],_0x53c839[_0x0fa6('0x51')]));if(_0x2f97a8['query'][_0x0fa6('0x53')]){_0x58587d[_0x0fa6('0x50')]=_[_0x0fa6('0x54')](_0x58587d[_0x0fa6('0x50')],{'$or':_[_0x0fa6('0x69')](_0x58587d[_0x0fa6('0x49')],function(_0x103835){var _0x487b98={};_0x487b98[_0x103835]={'$like':'%'+_0x2f97a8[_0x0fa6('0x4b')][_0x0fa6('0x53')]+'%'};return _0x487b98;})});}_0x58587d=_[_0x0fa6('0x54')]({},_0x58587d,_0x2f97a8['options']);return _0x5540ea['getApplications'](_0x58587d);}})[_0x0fa6('0x35')](function(_0x258991){if(_0x258991){_0x27a809=_0x258991['length'];if(!_0x2f97a8[_0x0fa6('0x4b')][_0x0fa6('0x4c')](_0x0fa6('0x4d'))){_0x58587d[_0x0fa6('0x30')]=qs[_0x0fa6('0x30')](_0x2f97a8[_0x0fa6('0x4b')][_0x0fa6('0x30')]);_0x58587d['offset']=qs[_0x0fa6('0x2f')](_0x2f97a8[_0x0fa6('0x4b')][_0x0fa6('0x2f')]);}return _0x5540ea[_0x0fa6('0x9e')](_0x58587d);}})[_0x0fa6('0x35')](function(_0x630c38){if(_0x630c38){return _0x630c38?{'count':_0x27a809,'rows':_0x630c38}:null;}})[_0x0fa6('0x35')](respondWithResult(_0x40c70b,null))['catch'](handleError(_0x40c70b,null));};exports[_0x0fa6('0x9f')]=function(_0x1c68f5,_0x1d8ca6,_0x2e294f){var _0x3b3e80={'raw':!![],'where':{}};var _0x15c5c3={};var _0x44b483={'count':0x0,'rows':[]};return db[_0x0fa6('0x42')][_0x0fa6('0x67')]({'where':{'id':_0x1c68f5['params']['id']}})[_0x0fa6('0x35')](handleEntityNotFound(_0x1d8ca6,null))[_0x0fa6('0x35')](function(_0x2d9727){if(_0x2d9727){_0x15c5c3['model']=_[_0x0fa6('0x46')](db['MailMessage'][_0x0fa6('0x43')]);_0x15c5c3[_0x0fa6('0x4b')]=_[_0x0fa6('0x46')](_0x1c68f5[_0x0fa6('0x4b')]);_0x15c5c3[_0x0fa6('0x51')]=_[_0x0fa6('0x47')](_0x15c5c3[_0x0fa6('0x48')],_0x15c5c3[_0x0fa6('0x4b')]);_0x3b3e80[_0x0fa6('0x49')]=_['intersection'](_0x15c5c3[_0x0fa6('0x48')],qs['fields'](_0x1c68f5[_0x0fa6('0x4b')]['fields']));_0x3b3e80[_0x0fa6('0x49')]=_0x3b3e80['attributes']['length']?_0x3b3e80[_0x0fa6('0x49')]:_0x15c5c3[_0x0fa6('0x48')];if(!_0x1c68f5[_0x0fa6('0x4b')][_0x0fa6('0x4c')](_0x0fa6('0x4d'))){_0x3b3e80['limit']=qs['limit'](_0x1c68f5[_0x0fa6('0x4b')][_0x0fa6('0x30')]);_0x3b3e80[_0x0fa6('0x2f')]=qs['offset'](_0x1c68f5[_0x0fa6('0x4b')][_0x0fa6('0x2f')]);}_0x3b3e80[_0x0fa6('0x4e')]=qs[_0x0fa6('0x4f')](_0x1c68f5['query'][_0x0fa6('0x4f')]);_0x3b3e80[_0x0fa6('0x50')]=qs[_0x0fa6('0x51')](_['pick'](_0x1c68f5['query'],_0x15c5c3[_0x0fa6('0x51')]));_0x3b3e80[_0x0fa6('0x50')][_0x0fa6('0x63')]=_0x2d9727['id'];if(_0x1c68f5[_0x0fa6('0x4b')]['filter']){_0x3b3e80[_0x0fa6('0x50')]=_[_0x0fa6('0x54')](_0x3b3e80[_0x0fa6('0x50')],{'$or':_['map'](_0x3b3e80[_0x0fa6('0x49')],function(_0x27587f){var _0x586c91={};_0x586c91[_0x27587f]={'$like':'%'+_0x1c68f5[_0x0fa6('0x4b')][_0x0fa6('0x53')]+'%'};return _0x586c91;})});}if(_0x1c68f5[_0x0fa6('0x4b')][_0x0fa6('0xa0')]){var _0x129d87=_0x1c68f5[_0x0fa6('0x4b')][_0x0fa6('0xa0')][_0x0fa6('0xa1')](',');var _0x18a3e6={};_0x18a3e6[_0x129d87[0x0]]={'$gte':moment(_0x129d87[0x1])[_0x0fa6('0xa2')](_0x0fa6('0xa3'))};_0x3b3e80[_0x0fa6('0x50')]=_[_0x0fa6('0x54')](_0x3b3e80[_0x0fa6('0x50')],_0x18a3e6);}_0x3b3e80=_[_0x0fa6('0x54')]({},_0x3b3e80,_0x1c68f5['options']);return db[_0x0fa6('0xa4')][_0x0fa6('0x2e')]({'where':_0x3b3e80['where']})['then'](function(_0x412a7e){_0x44b483[_0x0fa6('0x2e')]=_0x412a7e;if(_0x1c68f5[_0x0fa6('0x4b')]['includeAll']){_0x3b3e80[_0x0fa6('0x5b')]=[{'all':!![]}];}return db[_0x0fa6('0xa4')][_0x0fa6('0x56')](_0x3b3e80);})[_0x0fa6('0x35')](function(_0x306c0f){_0x44b483[_0x0fa6('0x57')]=_0x306c0f;return _0x44b483;});}})['then'](respondWithFilteredResult(_0x1d8ca6,_0x3b3e80))[_0x0fa6('0x5e')](handleError(_0x1d8ca6,null));};exports[_0x0fa6('0xa5')]=function(_0x5be189,_0x482677,_0x7d4031){var _0x97e012,_0x1f5ba1={},_0x5c923d;if(_0x5be189[_0x0fa6('0x5f')]['to']){_0x5c923d=_0x5be189[_0x0fa6('0x5f')]['to']['split'](',')[0x0];}return db[_0x0fa6('0x42')]['find']({'where':{'id':_0x5be189[_0x0fa6('0x60')]['id']},'include':[{'model':db[_0x0fa6('0xa6')],'as':'List','include':[{'model':db['CmContact'],'as':_0x0fa6('0xa7'),'where':{'email':_0x5c923d},'limit':0x1,'order':[['updatedAt',_0x0fa6('0xa8')]]}]},{'model':db[_0x0fa6('0x59')],'as':_0x0fa6('0x3f'),'raw':!![]}]})['then'](handleEntityNotFound(_0x482677,null))[_0x0fa6('0x35')](function(_0x3d3cab){if(_0x3d3cab){_0x97e012=_0x3d3cab;if(_0x3d3cab[_0x0fa6('0x3f')]){if(_['isNil'](_0x5be189[_0x0fa6('0x5f')][_0x0fa6('0xa9')])){_0x5be189[_0x0fa6('0x5f')][_0x0fa6('0xa9')]=util[_0x0fa6('0xa2')](_0x0fa6('0xaa'),_0x3d3cab[_0x0fa6('0x3b')],_0x3d3cab[_0x0fa6('0x70')]||_0x3d3cab[_0x0fa6('0x3f')][_0x0fa6('0x76')]);}if(_0x5be189[_0x0fa6('0x5f')][_0x0fa6('0xab')]&&_0x5be189[_0x0fa6('0x5f')]['attachments'][_0x0fa6('0x5a')]){for(var _0x3473df=0x0;_0x3473df<_0x5be189['body'][_0x0fa6('0xab')][_0x0fa6('0x5a')];_0x3473df+=0x1){_0x5be189['body'][_0x0fa6('0xab')][_0x3473df]={'filename':_0x5be189['body']['attachments'][_0x3473df][_0x0fa6('0x3b')],'path':path[_0x0fa6('0xac')](config[_0x0fa6('0xad')],_0x0fa6('0xae'),_0x5be189['body']['attachments'][_0x3473df][_0x0fa6('0xaf')])};}}var _0x64ec3a={'tls':{'rejectUnauthorized':![]}};if(_[_0x0fa6('0x74')](_0x3d3cab[_0x0fa6('0x3f')][_0x0fa6('0x7d')])){if(_0x3d3cab[_0x0fa6('0x3f')][_0x0fa6('0x7a')]){_0x64ec3a[_0x0fa6('0xb0')]={'user':_0x3d3cab['Smtp']['user'],'pass':_0x3d3cab[_0x0fa6('0x3f')][_0x0fa6('0x79')]};}_0x64ec3a['host']=_0x3d3cab['Smtp'][_0x0fa6('0x7b')];_0x64ec3a[_0x0fa6('0x7c')]=_0x3d3cab[_0x0fa6('0x3f')][_0x0fa6('0x7c')];_0x64ec3a[_0x0fa6('0xb1')]=_0x3d3cab['Smtp'][_0x0fa6('0xb1')];}else{_0x64ec3a[_0x0fa6('0x7d')]=_0x3d3cab[_0x0fa6('0x3f')]['service'];_0x64ec3a[_0x0fa6('0xb0')]={'user':_0x3d3cab[_0x0fa6('0x3f')]['user'],'pass':_0x3d3cab['Smtp']['pass']};}return respondWithRpcPromise(_0x0fa6('0xb2'),_0x0fa6('0xb3'),{'account':_0x64ec3a,'message':_0x5be189[_0x0fa6('0x5f')]});}else{throw new Error(_0x0fa6('0xb4'));}}})['then'](function(_0x1361f9){if(_0x1361f9){_0x1f5ba1=_0x1361f9;if(_0x97e012[_0x0fa6('0xb5')]){if(_0x97e012['List']['Contacts'][_0x0fa6('0x5a')]){return _0x97e012['List'][_0x0fa6('0xa7')][0x0];}else{return db[_0x0fa6('0x8e')][_0x0fa6('0x65')](_[_0x0fa6('0x17')](_0x5be189[_0x0fa6('0x5f')],{'firstName':_0x5be189[_0x0fa6('0x5f')]['to'],'email':_0x5be189[_0x0fa6('0x5f')]['to'],'phone':_0x5be189[_0x0fa6('0x5f')]['to'],'ListId':_0x97e012[_0x0fa6('0x71')]}));}}else{throw new Error(_0x0fa6('0xb4'));}}})[_0x0fa6('0x35')](function(_0x57a8bd){if(_0x57a8bd){var _0xc2cfca={'UserId':_0x5be189[_0x0fa6('0x76')]['id'],'ContactId':_0x57a8bd['id'],'MailAccountId':_0x97e012['id'],'inReplyTo':_0x1f5ba1['messageId'],'to':_0x5be189[_0x0fa6('0x5f')][_0x0fa6('0xa9')],'cc':_0x5be189['body']['cc'],'subject':_0x5be189[_0x0fa6('0x5f')][_0x0fa6('0xb6')],'attach':_0x5be189[_0x0fa6('0x5f')][_0x0fa6('0xb7')],'firstMsgDirection':_0x0fa6('0xb8'),'lastMsgAt':moment()['format'](_0x0fa6('0xa3')),'lastMsgDirection':_0x0fa6('0xb8'),'lastMsgBody':_0x5be189['body'][_0x0fa6('0x5f')],'Messages':[_[_0x0fa6('0x54')](_0x5be189[_0x0fa6('0x5f')],{'messageId':_0x1f5ba1[_0x0fa6('0xb9')],'sentAt':moment()[_0x0fa6('0xa2')](_0x0fa6('0xa3')),'read':!![],'MailAccountId':_0x97e012['id'],'UserId':_0x5be189[_0x0fa6('0x76')]['id'],'ContactId':_0x57a8bd['id']})]};if(_0x5be189[_0x0fa6('0x5f')][_0x0fa6('0xba')]){_0xc2cfca=_[_0x0fa6('0x54')](_0xc2cfca,_0x5be189[_0x0fa6('0x5f')][_0x0fa6('0xba')]);}return db['MailInteraction'][_0x0fa6('0x65')](_0xc2cfca,{'include':[{'model':db[_0x0fa6('0xa4')],'as':_0x0fa6('0xbb')}]});}})[_0x0fa6('0x35')](respondWithResult(_0x482677,null))[_0x0fa6('0x5e')](handleError(_0x482677,null));};exports[_0x0fa6('0xbc')]=function(_0x427f9a,_0x1133e5,_0x11042e){return db[_0x0fa6('0x42')]['find']({'where':{'id':_0x427f9a[_0x0fa6('0x60')]['id']},'include':[{'model':db[_0x0fa6('0x59')],'as':_0x0fa6('0x3f'),'raw':!![]}]})[_0x0fa6('0x35')](handleEntityNotFound(_0x1133e5,null))[_0x0fa6('0x35')](function(_0x41dc76){if(_0x41dc76&&_0x41dc76[_0x0fa6('0x3f')]){var _0x15f575={'id':_0x41dc76['id'],'tls':{'rejectUnauthorized':![]}};if(_0x41dc76[_0x0fa6('0x3f')][_0x0fa6('0x7d')]){_0x15f575['service']=_0x41dc76[_0x0fa6('0x3f')]['service'];}else{_0x15f575[_0x0fa6('0x7b')]=_0x41dc76[_0x0fa6('0x3f')][_0x0fa6('0x7b')];_0x15f575[_0x0fa6('0x7c')]=_0x41dc76[_0x0fa6('0x3f')]['port'];_0x15f575[_0x0fa6('0xb1')]=_0x41dc76['Smtp'][_0x0fa6('0xb1')];}if(_0x41dc76[_0x0fa6('0x3f')][_0x0fa6('0x7a')]){_0x15f575[_0x0fa6('0xb0')]={'user':_0x41dc76[_0x0fa6('0x3f')]['user'],'pass':_0x41dc76[_0x0fa6('0x3f')]['pass']};}return respondWithRpcPromise(_0x0fa6('0xbd'),_0x0fa6('0xbc'),{'account':_0x15f575});}})[_0x0fa6('0x35')](respondWithResult(_0x1133e5,null))[_0x0fa6('0x5e')](handleError(_0x1133e5,null));};exports[_0x0fa6('0x36')]=function(_0x5a46d5,_0x454be6){return db[_0x0fa6('0x42')][_0x0fa6('0x5d')]({'where':{'id':_0x5a46d5[_0x0fa6('0x60')]['id']}})[_0x0fa6('0x35')](handleEntityNotFound(_0x454be6,null))[_0x0fa6('0x35')](function(_0x416ede){if(_0x416ede&&_0x416ede[_0x0fa6('0x7d')]){throw new db[(_0x0fa6('0xbe'))]['ValidationError']('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x416ede;})[_0x0fa6('0x35')](removeEntity(_0x454be6,null))['catch'](handleError(_0x454be6,null));};exports[_0x0fa6('0xbf')]=function(_0x58a38d,_0x3789d,_0x30b26e){return db[_0x0fa6('0x42')][_0x0fa6('0x5d')]({'where':{'id':_0x58a38d[_0x0fa6('0x60')]['id']}})[_0x0fa6('0x35')](handleEntityNotFound(_0x3789d,null))['then'](function(_0x515821){if(_0x515821){return _0x515821['addAgents'](_0x58a38d['body'][_0x0fa6('0x6b')],_[_0x0fa6('0xc0')](_0x58a38d[_0x0fa6('0x5f')],[_0x0fa6('0x6b'),'id'])||{})[_0x0fa6('0xc1')](function(_0x5f2e82){for(var _0xa4c99d=0x0;_0xa4c99d<_0x58a38d[_0x0fa6('0x5f')][_0x0fa6('0x6b')][_0x0fa6('0x5a')];_0xa4c99d+=0x1){socket['emit']('userMailAccount:save',{'UserId':_0x58a38d[_0x0fa6('0x5f')][_0x0fa6('0x6b')][_0xa4c99d],'MailAccountId':_0x58a38d['params']['id']});}return _0x5f2e82;});}})['then'](respondWithResult(_0x3789d,null))['catch'](handleError(_0x3789d,null));};exports[_0x0fa6('0xc2')]=function(_0x4a7c91,_0x2512f8,_0x4b2b7e){return db[_0x0fa6('0x42')][_0x0fa6('0x5d')]({'where':{'id':_0x4a7c91[_0x0fa6('0x60')]['id']}})[_0x0fa6('0x35')](handleEntityNotFound(_0x2512f8,null))[_0x0fa6('0x35')](function(_0x18de33){if(_0x18de33){return _0x18de33[_0x0fa6('0xc2')](_0x4a7c91[_0x0fa6('0x4b')][_0x0fa6('0x6b')])[_0x0fa6('0x35')](function(){if(_[_0x0fa6('0xc3')](_0x4a7c91[_0x0fa6('0x4b')][_0x0fa6('0x6b')])){for(var _0x44df4a=0x0;_0x44df4a<_0x4a7c91[_0x0fa6('0x4b')]['ids'][_0x0fa6('0x5a')];_0x44df4a+=0x1){socket[_0x0fa6('0xc4')](_0x0fa6('0xc5'),{'UserId':Number(_0x4a7c91[_0x0fa6('0x4b')][_0x0fa6('0x6b')][_0x44df4a]),'MailAccountId':Number(_0x4a7c91['params']['id'])});}}else{socket[_0x0fa6('0xc4')]('userMailAccount:remove',{'UserId':Number(_0x4a7c91[_0x0fa6('0x4b')][_0x0fa6('0x6b')]),'MailAccountId':Number(_0x4a7c91[_0x0fa6('0x60')]['id'])});}});}})[_0x0fa6('0x35')](respondWithStatusCode(_0x2512f8,null))[_0x0fa6('0x5e')](handleError(_0x2512f8,null));};exports['getAgents']=function(_0x5f2a09,_0x32f9c7,_0x2e4438){var _0x85c883={};var _0x47b538={};var _0x47b7ba;var _0x299a2f;return db[_0x0fa6('0x42')][_0x0fa6('0x67')]({'where':{'id':_0x5f2a09[_0x0fa6('0x60')]['id']}})[_0x0fa6('0x35')](handleEntityNotFound(_0x32f9c7,null))['then'](function(_0x57e73d){if(_0x57e73d){_0x47b7ba=_0x57e73d;_0x47b538[_0x0fa6('0x48')]=_[_0x0fa6('0x46')](db['User'][_0x0fa6('0x43')]);_0x47b538[_0x0fa6('0x4b')]=_['keys'](_0x5f2a09[_0x0fa6('0x4b')]);_0x47b538[_0x0fa6('0x51')]=_['intersection'](_0x47b538['model'],_0x47b538[_0x0fa6('0x4b')]);_0x85c883['attributes']=_[_0x0fa6('0x47')](_0x47b538[_0x0fa6('0x48')],qs['fields'](_0x5f2a09[_0x0fa6('0x4b')][_0x0fa6('0x4a')]));_0x85c883[_0x0fa6('0x49')]=_0x85c883[_0x0fa6('0x49')][_0x0fa6('0x5a')]?_0x85c883['attributes']:_0x47b538[_0x0fa6('0x48')];_0x85c883[_0x0fa6('0x4e')]=qs[_0x0fa6('0x4f')](_0x5f2a09['query'][_0x0fa6('0x4f')]);_0x85c883[_0x0fa6('0x50')]=qs[_0x0fa6('0x51')](_[_0x0fa6('0x68')](_0x5f2a09[_0x0fa6('0x4b')],_0x47b538['filters']));if(_0x5f2a09['query'][_0x0fa6('0x53')]){_0x85c883[_0x0fa6('0x50')]=_['merge'](_0x85c883[_0x0fa6('0x50')],{'$or':_[_0x0fa6('0x69')](_0x85c883[_0x0fa6('0x49')],function(_0x1af26f){var _0x40dd4d={};_0x40dd4d[_0x1af26f]={'$like':'%'+_0x5f2a09[_0x0fa6('0x4b')][_0x0fa6('0x53')]+'%'};return _0x40dd4d;})});}_0x85c883=_[_0x0fa6('0x54')]({},_0x85c883,_0x5f2a09[_0x0fa6('0x5c')]);return _0x47b7ba[_0x0fa6('0xc6')](_0x85c883);}})[_0x0fa6('0x35')](function(_0x3abfb2){if(_0x3abfb2){_0x299a2f=_0x3abfb2[_0x0fa6('0x5a')];if(!_0x5f2a09[_0x0fa6('0x4b')][_0x0fa6('0x4c')]('nolimit')){_0x85c883[_0x0fa6('0x30')]=qs['limit'](_0x5f2a09['query'][_0x0fa6('0x30')]);_0x85c883[_0x0fa6('0x2f')]=qs[_0x0fa6('0x2f')](_0x5f2a09['query']['offset']);}return _0x47b7ba[_0x0fa6('0xc6')](_0x85c883);}})[_0x0fa6('0x35')](function(_0x8ae9f6){if(_0x8ae9f6){return _0x8ae9f6?{'count':_0x299a2f,'rows':_0x8ae9f6}:null;}})['then'](respondWithResult(_0x32f9c7,null))[_0x0fa6('0x5e')](handleError(_0x32f9c7,null));}; \ No newline at end of file +var _0x0a42=['addDisposition','MailAccountId','create','findOne','Disposition','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','hasOwnProperty','findAll','removeAnswers','email','ListId','active','isNil','cservice','cauthentication','user','password','pass','authentication','host','port','service','cuser','cpassword','role','UserProfileSection','MailAccounts','userProfileId','autoAssociation','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','transaction','MailApplication','bulkCreate','findAndCountAll','priority','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','CmContact','updatedAt','DESC','from','%s\x20<%s>','attachments','join','root','server/files/attachments','basename','auth','sendMail','List\x20not\x20found','Contacts','subject','attach','out','messageId','verifySmtp','secure','VerifySmtp','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','userMailAccount:save','removeAgents','isArray','emit','userMailAccount:remove','getAgents','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','defaults','socket.io-emitter','redis','./mailAccount.socket','register','jayson/promise','client','http','test','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','count','offset','limit','set','Content-Range','json','apply','reject','update','destroy','get','UserProfileResource','end','stack','name','send','MailServerIn','Imap','MailServerOut','Smtp','mandatoryDispositionPause','MailAccount','rawAttributes','type','key','model','map','query','keys','intersection','attributes','fields','nolimit','order','sort','where','filters','pick','filter','merge','options','include','rows','catch','length','includeAll','find','body','params','Pause','describe'];(function(_0x2a4f57,_0x49efc9){var _0xfa8d51=function(_0x1bfa31){while(--_0x1bfa31){_0x2a4f57['push'](_0x2a4f57['shift']());}};_0xfa8d51(++_0x49efc9);}(_0x0a42,0x124));var _0x20a4=function(_0x2f381b,_0x4bc41c){_0x2f381b=_0x2f381b-0x0;var _0x367ffc=_0x0a42[_0x2f381b];return _0x367ffc;};'use strict';var pdf=require(_0x20a4('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x20a4('0x1'));var zipdir=require(_0x20a4('0x2'));var jsonpatch=require(_0x20a4('0x3'));var rp=require(_0x20a4('0x4'));var moment=require(_0x20a4('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x20a4('0x6'));var sox=require(_0x20a4('0x7'));var csv=require(_0x20a4('0x8'));var ejs=require(_0x20a4('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x20a4('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x20a4('0xb'));var toCsv=require(_0x20a4('0x8'));var querystring=require(_0x20a4('0xc'));var Papa=require(_0x20a4('0xd'));var Redis=require(_0x20a4('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x20a4('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x20a4('0x10'));var logger=require(_0x20a4('0x11'))(_0x20a4('0x12'));var utils=require(_0x20a4('0x13'));var config=require(_0x20a4('0x14'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x20a4('0x15')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x20a4('0x16'))(new Redis(config[_0x20a4('0x17')]));require(_0x20a4('0x18'))[_0x20a4('0x19')](socket);var jayson=require(_0x20a4('0x1a'));var client=jayson[_0x20a4('0x1b')][_0x20a4('0x1c')]({'port':0x232b});function checkPasswordPattern(_0x2994b3,_0xa86582,_0x1e9c04){if(_0x1e9c04){var _0x43d7f3=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x43d7f3[_0x20a4('0x1d')](_0xa86582)){return _0x2994b3;}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 _0x2994b3;}}function respondWithRpcPromise(_0x1613a5,_0x434b13,_0x489304,_0xa8472d){return new BPromise(function(_0x408354,_0x46354b){var _0x1a862f=_0xa8472d||client;return _0x1a862f[_0x20a4('0x1e')](_0x1613a5,_0x489304)[_0x20a4('0x1f')](function(_0x1e9771){logger[_0x20a4('0x20')](_0x20a4('0x21'),_0x434b13,_0x20a4('0x22'));logger[_0x20a4('0x23')](_0x20a4('0x24'),_0x434b13,'request\x20sent',JSON[_0x20a4('0x25')](_0x1e9771));if(_0x1e9771[_0x20a4('0x26')]){if(_0x1e9771[_0x20a4('0x26')][_0x20a4('0x27')]===0x1f4){logger['error'](_0x20a4('0x21'),_0x434b13,_0x1e9771[_0x20a4('0x26')][_0x20a4('0x28')]);return _0x46354b(_0x1e9771[_0x20a4('0x26')][_0x20a4('0x28')]);}logger['error']('MailAccount,\x20%s,\x20%s',_0x434b13,_0x1e9771['error']['message']);return _0x408354(_0x1e9771['error'][_0x20a4('0x28')]);}else{logger['info'](_0x20a4('0x21'),_0x434b13,'request\x20sent');_0x408354(_0x1e9771['result'][_0x20a4('0x28')]);}})['catch'](function(_0x3648c5){logger['error'](_0x20a4('0x21'),_0x434b13,_0x3648c5);_0x46354b(_0x3648c5);});});}function respondWithStatusCode(_0x39b0d3,_0x8ec92a){_0x8ec92a=_0x8ec92a||0xcc;return function(_0x14ac37){if(_0x14ac37){return _0x39b0d3[_0x20a4('0x29')](_0x8ec92a);}return _0x39b0d3[_0x20a4('0x2a')](_0x8ec92a)['end']();};}function respondWithResult(_0x4f578a,_0x436e6d){_0x436e6d=_0x436e6d||0xc8;return function(_0x112ba2){if(_0x112ba2){return _0x4f578a[_0x20a4('0x2a')](_0x436e6d)['json'](_0x112ba2);}};}function respondWithFilteredResult(_0x5dbc0d,_0x261f9b){return function(_0x5dc9cd){if(_0x5dc9cd){var _0xb1d5df=_0x5dc9cd[_0x20a4('0x2b')],_0x31b338=_0x261f9b[_0x20a4('0x2c')],_0x3b52b7=_0x261f9b['offset']+_0x261f9b[_0x20a4('0x2d')],_0x16711f;if(_0x3b52b7>=_0xb1d5df){_0x3b52b7=_0xb1d5df;_0x16711f=0xc8;}else{_0x16711f=0xce;}_0x5dbc0d['status'](_0x16711f);return _0x5dbc0d[_0x20a4('0x2e')](_0x20a4('0x2f'),_0x31b338+'-'+_0x3b52b7+'/'+_0xb1d5df)[_0x20a4('0x30')](_0x5dc9cd);}return null;};}function patchUpdates(_0x3856f8){return function(_0x35bb7e){try{jsonpatch[_0x20a4('0x31')](_0x35bb7e,_0x3856f8,!![]);}catch(_0x150bbb){return BPromise[_0x20a4('0x32')](_0x150bbb);}return _0x35bb7e['save']();};}function saveUpdates(_0x5cb485,_0x485351){return function(_0x13e553){if(_0x13e553){return _0x13e553[_0x20a4('0x33')](_0x5cb485)[_0x20a4('0x1f')](function(_0x2f967f){return _0x2f967f;});}return null;};}function removeEntity(_0x3b7420,_0x387a35){return function(_0x1c32a8){if(_0x1c32a8){return _0x1c32a8[_0x20a4('0x34')]()['then'](function(){var _0x332bec=_0x1c32a8[_0x20a4('0x35')]({'plain':!![]});var _0x4b7f1e='MailAccounts';return db[_0x20a4('0x36')]['destroy']({'where':{'type':_0x4b7f1e,'resourceId':_0x332bec['id']}})[_0x20a4('0x1f')](function(){return _0x1c32a8;});})[_0x20a4('0x1f')](function(){_0x3b7420[_0x20a4('0x2a')](0xcc)[_0x20a4('0x37')]();});}};}function handleEntityNotFound(_0x44594b,_0x96c631){return function(_0x430b53){if(!_0x430b53){_0x44594b[_0x20a4('0x29')](0x194);}return _0x430b53;};}function handleError(_0x27dc7d,_0x30e00e){_0x30e00e=_0x30e00e||0x1f4;return function(_0x3a4f7f){logger[_0x20a4('0x26')](_0x3a4f7f[_0x20a4('0x38')]);if(_0x3a4f7f['name']){delete _0x3a4f7f[_0x20a4('0x39')];}_0x27dc7d[_0x20a4('0x2a')](_0x30e00e)[_0x20a4('0x3a')](_0x3a4f7f);};}exports['index']=function(_0x5f28b6,_0x1cf1e6){var _0x41e9d7={'include':[{'model':db[_0x20a4('0x3b')],'as':_0x20a4('0x3c')},{'model':db[_0x20a4('0x3d')],'as':_0x20a4('0x3e')},{'model':db['Pause'],'as':_0x20a4('0x3f')}]},_0x13ce25={},_0x173f81={'count':0x0,'rows':[]};var _0x23fe1b=_['map'](db[_0x20a4('0x40')][_0x20a4('0x41')],function(_0x42ca8e){return{'name':_0x42ca8e['fieldName'],'type':_0x42ca8e[_0x20a4('0x42')][_0x20a4('0x43')]};});_0x13ce25[_0x20a4('0x44')]=_[_0x20a4('0x45')](_0x23fe1b,_0x20a4('0x39'));_0x13ce25[_0x20a4('0x46')]=_[_0x20a4('0x47')](_0x5f28b6['query']);_0x13ce25['filters']=_[_0x20a4('0x48')](_0x13ce25[_0x20a4('0x44')],_0x13ce25[_0x20a4('0x46')]);_0x41e9d7[_0x20a4('0x49')]=_[_0x20a4('0x48')](_0x13ce25[_0x20a4('0x44')],qs[_0x20a4('0x4a')](_0x5f28b6['query']['fields']));_0x41e9d7[_0x20a4('0x49')]=_0x41e9d7[_0x20a4('0x49')]['length']?_0x41e9d7['attributes']:_0x13ce25[_0x20a4('0x44')];if(!_0x5f28b6[_0x20a4('0x46')]['hasOwnProperty'](_0x20a4('0x4b'))){_0x41e9d7[_0x20a4('0x2d')]=qs[_0x20a4('0x2d')](_0x5f28b6[_0x20a4('0x46')][_0x20a4('0x2d')]);_0x41e9d7['offset']=qs[_0x20a4('0x2c')](_0x5f28b6[_0x20a4('0x46')][_0x20a4('0x2c')]);}_0x41e9d7[_0x20a4('0x4c')]=qs[_0x20a4('0x4d')](_0x5f28b6['query'][_0x20a4('0x4d')]);_0x41e9d7[_0x20a4('0x4e')]=qs[_0x20a4('0x4f')](_[_0x20a4('0x50')](_0x5f28b6[_0x20a4('0x46')],_0x13ce25[_0x20a4('0x4f')]));if(_0x5f28b6[_0x20a4('0x46')][_0x20a4('0x51')]){_0x41e9d7['where']=_[_0x20a4('0x52')](_0x41e9d7[_0x20a4('0x4e')],{'$or':_['map'](_0x23fe1b,function(_0x4bf604){if(_0x4bf604[_0x20a4('0x42')]!=='VIRTUAL'){var _0x4a74e4={};_0x4a74e4[_0x4bf604[_0x20a4('0x39')]]={'$like':'%'+_0x5f28b6['query'][_0x20a4('0x51')]+'%'};return _0x4a74e4;}})});}_0x41e9d7=_[_0x20a4('0x52')]({},_0x41e9d7,_0x5f28b6[_0x20a4('0x53')]);var _0x236a2a={'where':_0x41e9d7[_0x20a4('0x4e')]};return db[_0x20a4('0x40')][_0x20a4('0x2b')](_0x236a2a)[_0x20a4('0x1f')](function(_0x16dfc4){_0x173f81[_0x20a4('0x2b')]=_0x16dfc4;if(_0x5f28b6[_0x20a4('0x46')]['includeAll']){_0x41e9d7[_0x20a4('0x54')]=[{'all':!![]}];}return db[_0x20a4('0x40')]['findAll'](_0x41e9d7);})['then'](function(_0x4031ab){_0x173f81[_0x20a4('0x55')]=_0x4031ab;return _0x173f81;})['then'](respondWithFilteredResult(_0x1cf1e6,_0x41e9d7))[_0x20a4('0x56')](handleError(_0x1cf1e6,null));};exports['show']=function(_0x4b60ef,_0x3ed668){var _0x99f191={'raw':![],'where':{'id':_0x4b60ef['params']['id']},'include':[{'model':db[_0x20a4('0x3b')],'as':_0x20a4('0x3c')},{'model':db[_0x20a4('0x3d')],'as':_0x20a4('0x3e')},{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x1b9556={};_0x1b9556[_0x20a4('0x44')]=_[_0x20a4('0x47')](db[_0x20a4('0x40')]['rawAttributes']);_0x1b9556[_0x20a4('0x46')]=_[_0x20a4('0x47')](_0x4b60ef['query']);_0x1b9556['filters']=_[_0x20a4('0x48')](_0x1b9556[_0x20a4('0x44')],_0x1b9556['query']);_0x99f191[_0x20a4('0x49')]=_['intersection'](_0x1b9556[_0x20a4('0x44')],qs[_0x20a4('0x4a')](_0x4b60ef['query'][_0x20a4('0x4a')]));_0x99f191['attributes']=_0x99f191[_0x20a4('0x49')][_0x20a4('0x57')]?_0x99f191[_0x20a4('0x49')]:_0x1b9556['model'];if(_0x4b60ef['query'][_0x20a4('0x58')]){_0x99f191[_0x20a4('0x54')]=[{'all':!![]}];}_0x99f191=_[_0x20a4('0x52')]({},_0x99f191,_0x4b60ef[_0x20a4('0x53')]);return db['MailAccount'][_0x20a4('0x59')](_0x99f191)[_0x20a4('0x1f')](handleEntityNotFound(_0x3ed668,null))[_0x20a4('0x1f')](respondWithResult(_0x3ed668,null))[_0x20a4('0x56')](handleError(_0x3ed668,null));};exports['update']=function(_0x2a416d,_0x1df14a){if(_0x2a416d[_0x20a4('0x5a')]['id']){delete _0x2a416d[_0x20a4('0x5a')]['id'];}return db[_0x20a4('0x40')][_0x20a4('0x59')]({'where':{'id':_0x2a416d[_0x20a4('0x5b')]['id']},'include':[{'model':db['MailServerIn'],'as':_0x20a4('0x3c')},{'model':db[_0x20a4('0x3d')],'as':_0x20a4('0x3e')},{'model':db[_0x20a4('0x5c')],'as':_0x20a4('0x3f')}]})[_0x20a4('0x1f')](handleEntityNotFound(_0x1df14a,null))[_0x20a4('0x1f')](saveUpdates(_0x2a416d['body'],null))[_0x20a4('0x1f')](function(_0x4603d7){if(_0x4603d7&&_0x2a416d[_0x20a4('0x5a')][_0x20a4('0x3c')]){return db[_0x20a4('0x3b')][_0x20a4('0x33')](_0x2a416d[_0x20a4('0x5a')][_0x20a4('0x3c')],{'where':{'MailAccountId':_0x4603d7['id']}})['then'](function(){return _0x4603d7;});}return _0x4603d7;})[_0x20a4('0x1f')](function(_0x120d74){if(_0x120d74&&_0x2a416d[_0x20a4('0x5a')]['Smtp']){return db[_0x20a4('0x3d')][_0x20a4('0x33')](_0x2a416d[_0x20a4('0x5a')][_0x20a4('0x3e')],{'where':{'MailAccountId':_0x120d74['id']}})['then'](function(){return _0x120d74;});}return _0x120d74;})[_0x20a4('0x1f')](respondWithResult(_0x1df14a,null))[_0x20a4('0x56')](handleError(_0x1df14a,null));};exports[_0x20a4('0x5d')]=function(_0x8f4849,_0x35ebec){return db[_0x20a4('0x40')]['describe']()[_0x20a4('0x1f')](respondWithResult(_0x35ebec,null))['catch'](handleError(_0x35ebec,null));};exports[_0x20a4('0x5e')]=function(_0x500f3a,_0x3ce64f,_0x37b19e){if(_0x500f3a[_0x20a4('0x5a')]['id']){delete _0x500f3a['body']['id'];}return db['MailAccount'][_0x20a4('0x59')]({'where':{'id':_0x500f3a[_0x20a4('0x5b')]['id']}})['then'](handleEntityNotFound(_0x3ce64f,null))[_0x20a4('0x1f')](function(_0x30bfce){if(_0x30bfce){_0x500f3a[_0x20a4('0x5a')][_0x20a4('0x5f')]=_0x30bfce['id'];return db['Disposition'][_0x20a4('0x60')](_0x500f3a[_0x20a4('0x5a')]);}})['then'](respondWithResult(_0x3ce64f,null))[_0x20a4('0x56')](handleError(_0x3ce64f,null));};exports['getDispositions']=function(_0x1a5329,_0x3e390b,_0x4b9e7d){var _0x338b24={'raw':![],'where':{}};var _0x414899={};var _0xc58dc4={'count':0x0,'rows':[]};return db[_0x20a4('0x40')][_0x20a4('0x61')]({'where':{'id':_0x1a5329[_0x20a4('0x5b')]['id']}})[_0x20a4('0x1f')](handleEntityNotFound(_0x3e390b,null))['then'](function(_0x58037a){if(_0x58037a){_0x414899[_0x20a4('0x44')]=_[_0x20a4('0x47')](db[_0x20a4('0x62')][_0x20a4('0x41')]);_0x414899[_0x20a4('0x46')]=_[_0x20a4('0x47')](_0x1a5329[_0x20a4('0x46')]);_0x414899[_0x20a4('0x4f')]=_[_0x20a4('0x48')](_0x414899[_0x20a4('0x44')],_0x414899[_0x20a4('0x46')]);_0x338b24['attributes']=_[_0x20a4('0x48')](_0x414899['model'],qs['fields'](_0x1a5329[_0x20a4('0x46')]['fields']));_0x338b24[_0x20a4('0x49')]=_0x338b24[_0x20a4('0x49')][_0x20a4('0x57')]?_0x338b24['attributes']:_0x414899[_0x20a4('0x44')];if(!_0x1a5329['query']['hasOwnProperty'](_0x20a4('0x4b'))){_0x338b24[_0x20a4('0x2d')]=qs[_0x20a4('0x2d')](_0x1a5329[_0x20a4('0x46')][_0x20a4('0x2d')]);_0x338b24['offset']=qs[_0x20a4('0x2c')](_0x1a5329['query'][_0x20a4('0x2c')]);}_0x338b24[_0x20a4('0x4c')]=qs[_0x20a4('0x4d')](_0x1a5329[_0x20a4('0x46')][_0x20a4('0x4d')]);_0x338b24[_0x20a4('0x4e')]=qs[_0x20a4('0x4f')](_[_0x20a4('0x50')](_0x1a5329[_0x20a4('0x46')],_0x414899[_0x20a4('0x4f')]));_0x338b24['where'][_0x20a4('0x5f')]=_0x58037a['id'];if(_0x1a5329['query'][_0x20a4('0x51')]){_0x338b24['where']=_[_0x20a4('0x52')](_0x338b24[_0x20a4('0x4e')],{'$or':_[_0x20a4('0x45')](_0x338b24[_0x20a4('0x49')],function(_0x138afc){var _0x45f5ae={};_0x45f5ae[_0x138afc]={'$like':'%'+_0x1a5329[_0x20a4('0x46')][_0x20a4('0x51')]+'%'};return _0x45f5ae;})});}_0x338b24=_['merge']({},_0x338b24,_0x1a5329[_0x20a4('0x53')]);return db[_0x20a4('0x62')]['count']({'where':_0x338b24[_0x20a4('0x4e')]})[_0x20a4('0x1f')](function(_0x5ad844){_0xc58dc4[_0x20a4('0x2b')]=_0x5ad844;if(_0x1a5329[_0x20a4('0x46')]['includeAll']){_0x338b24[_0x20a4('0x54')]=[{'all':!![]}];}return db[_0x20a4('0x62')]['findAll'](_0x338b24);})['then'](function(_0x48d29a){_0xc58dc4['rows']=_0x48d29a;return _0xc58dc4;});}})[_0x20a4('0x1f')](respondWithFilteredResult(_0x3e390b,_0x338b24))[_0x20a4('0x56')](handleError(_0x3e390b,null));};exports[_0x20a4('0x63')]=function(_0x381ee2,_0x417251,_0x24d88d){return db[_0x20a4('0x40')][_0x20a4('0x59')]({'where':{'id':_0x381ee2[_0x20a4('0x5b')]['id']}})[_0x20a4('0x1f')](handleEntityNotFound(_0x417251,null))[_0x20a4('0x1f')](function(_0xf0aff4){if(_0xf0aff4){return _0xf0aff4['removeDispositions'](_0x381ee2[_0x20a4('0x46')][_0x20a4('0x64')]);}})[_0x20a4('0x1f')](respondWithStatusCode(_0x417251,null))[_0x20a4('0x56')](handleError(_0x417251,null));};exports[_0x20a4('0x65')]=function(_0x436263,_0x40cb2b,_0x87837a){if(_0x436263[_0x20a4('0x5a')]['id']){delete _0x436263[_0x20a4('0x5a')]['id'];}return db[_0x20a4('0x40')][_0x20a4('0x59')]({'where':{'id':_0x436263[_0x20a4('0x5b')]['id']}})[_0x20a4('0x1f')](handleEntityNotFound(_0x40cb2b,null))[_0x20a4('0x1f')](function(_0x9a826a){if(_0x9a826a){_0x436263['body']['MailAccountId']=_0x9a826a['id'];return db['CannedAnswer']['create'](_0x436263['body']);}})['then'](respondWithResult(_0x40cb2b,null))[_0x20a4('0x56')](handleError(_0x40cb2b,null));};exports[_0x20a4('0x66')]=function(_0x231436,_0x325a95,_0x1997da){var _0x222083={'raw':![],'where':{}};var _0xb8ce64={};var _0x370be6={'count':0x0,'rows':[]};return db[_0x20a4('0x40')][_0x20a4('0x61')]({'where':{'id':_0x231436[_0x20a4('0x5b')]['id']}})[_0x20a4('0x1f')](handleEntityNotFound(_0x325a95,null))['then'](function(_0x143499){if(_0x143499){_0xb8ce64['model']=_[_0x20a4('0x47')](db[_0x20a4('0x67')][_0x20a4('0x41')]);_0xb8ce64['query']=_['keys'](_0x231436['query']);_0xb8ce64[_0x20a4('0x4f')]=_[_0x20a4('0x48')](_0xb8ce64['model'],_0xb8ce64[_0x20a4('0x46')]);_0x222083['attributes']=_[_0x20a4('0x48')](_0xb8ce64[_0x20a4('0x44')],qs[_0x20a4('0x4a')](_0x231436[_0x20a4('0x46')]['fields']));_0x222083[_0x20a4('0x49')]=_0x222083['attributes'][_0x20a4('0x57')]?_0x222083[_0x20a4('0x49')]:_0xb8ce64[_0x20a4('0x44')];if(!_0x231436[_0x20a4('0x46')][_0x20a4('0x68')]('nolimit')){_0x222083[_0x20a4('0x2d')]=qs[_0x20a4('0x2d')](_0x231436[_0x20a4('0x46')][_0x20a4('0x2d')]);_0x222083[_0x20a4('0x2c')]=qs[_0x20a4('0x2c')](_0x231436['query'][_0x20a4('0x2c')]);}_0x222083[_0x20a4('0x4c')]=qs[_0x20a4('0x4d')](_0x231436[_0x20a4('0x46')][_0x20a4('0x4d')]);_0x222083[_0x20a4('0x4e')]=qs[_0x20a4('0x4f')](_[_0x20a4('0x50')](_0x231436[_0x20a4('0x46')],_0xb8ce64[_0x20a4('0x4f')]));_0x222083[_0x20a4('0x4e')][_0x20a4('0x5f')]=_0x143499['id'];if(_0x231436[_0x20a4('0x46')][_0x20a4('0x51')]){_0x222083[_0x20a4('0x4e')]=_[_0x20a4('0x52')](_0x222083[_0x20a4('0x4e')],{'$or':_[_0x20a4('0x45')](_0x222083[_0x20a4('0x49')],function(_0x155b0c){var _0x5e790f={};_0x5e790f[_0x155b0c]={'$like':'%'+_0x231436['query'][_0x20a4('0x51')]+'%'};return _0x5e790f;})});}_0x222083=_[_0x20a4('0x52')]({},_0x222083,_0x231436[_0x20a4('0x53')]);return db[_0x20a4('0x67')][_0x20a4('0x2b')]({'where':_0x222083[_0x20a4('0x4e')]})['then'](function(_0x279e77){_0x370be6[_0x20a4('0x2b')]=_0x279e77;if(_0x231436[_0x20a4('0x46')][_0x20a4('0x58')]){_0x222083['include']=[{'all':!![]}];}return db[_0x20a4('0x67')][_0x20a4('0x69')](_0x222083);})[_0x20a4('0x1f')](function(_0x1ad4d0){_0x370be6[_0x20a4('0x55')]=_0x1ad4d0;return _0x370be6;});}})[_0x20a4('0x1f')](respondWithFilteredResult(_0x325a95,_0x222083))[_0x20a4('0x56')](handleError(_0x325a95,null));};exports[_0x20a4('0x6a')]=function(_0x5cc77e,_0x128438,_0x5ab9bc){return db[_0x20a4('0x40')]['find']({'where':{'id':_0x5cc77e[_0x20a4('0x5b')]['id']}})[_0x20a4('0x1f')](handleEntityNotFound(_0x128438,null))[_0x20a4('0x1f')](function(_0x57159a){if(_0x57159a){return _0x57159a[_0x20a4('0x6a')](_0x5cc77e['query'][_0x20a4('0x64')]);}})[_0x20a4('0x1f')](respondWithStatusCode(_0x128438,null))[_0x20a4('0x56')](handleError(_0x128438,null));};exports[_0x20a4('0x60')]=function(_0x1ad60a,_0x2ceaf7){var _0x44b77e={'name':_0x1ad60a[_0x20a4('0x5a')][_0x20a4('0x39')],'key':_0x1ad60a[_0x20a4('0x5a')][_0x20a4('0x43')],'email':_0x1ad60a[_0x20a4('0x5a')][_0x20a4('0x6b')],'ListId':_0x1ad60a[_0x20a4('0x5a')][_0x20a4('0x6c')],'active':!_['isNil'](_0x1ad60a[_0x20a4('0x5a')][_0x20a4('0x6d')])?_0x1ad60a[_0x20a4('0x5a')]['active']:!![],'description':_0x1ad60a[_0x20a4('0x5a')]['description']||null,'Imap':{},'Smtp':{}};if(_[_0x20a4('0x6e')](_0x1ad60a['body'][_0x20a4('0x6f')])){if(_0x1ad60a[_0x20a4('0x5a')][_0x20a4('0x70')]){_0x44b77e[_0x20a4('0x3c')]['user']=_0x44b77e[_0x20a4('0x3e')][_0x20a4('0x71')]=_0x1ad60a['body']['cuser'];_0x44b77e[_0x20a4('0x3c')][_0x20a4('0x72')]=_0x44b77e['Smtp'][_0x20a4('0x73')]=_0x1ad60a['body']['cpassword'];}else{_0x44b77e[_0x20a4('0x3c')]['authentication']=_0x44b77e[_0x20a4('0x3e')][_0x20a4('0x74')]=![];}_0x44b77e[_0x20a4('0x3c')][_0x20a4('0x75')]=_0x1ad60a[_0x20a4('0x5a')][_0x20a4('0x3c')]['host'];_0x44b77e[_0x20a4('0x3c')][_0x20a4('0x76')]=_0x1ad60a['body'][_0x20a4('0x3c')][_0x20a4('0x76')];_0x44b77e[_0x20a4('0x3e')][_0x20a4('0x75')]=_0x1ad60a[_0x20a4('0x5a')]['Smtp'][_0x20a4('0x75')];_0x44b77e[_0x20a4('0x3e')][_0x20a4('0x76')]=_0x1ad60a['body'][_0x20a4('0x3e')][_0x20a4('0x76')];}else{_0x44b77e[_0x20a4('0x3c')]['service']=_0x44b77e[_0x20a4('0x3e')][_0x20a4('0x77')]=_0x1ad60a[_0x20a4('0x5a')][_0x20a4('0x6f')];_0x44b77e['Imap']['user']=_0x44b77e[_0x20a4('0x3e')][_0x20a4('0x71')]=_0x1ad60a[_0x20a4('0x5a')][_0x20a4('0x78')];_0x44b77e[_0x20a4('0x3c')][_0x20a4('0x72')]=_0x44b77e[_0x20a4('0x3e')]['pass']=_0x1ad60a[_0x20a4('0x5a')][_0x20a4('0x79')];}return db[_0x20a4('0x40')][_0x20a4('0x60')](_0x44b77e,{'include':[{'model':db[_0x20a4('0x3d')],'as':_0x20a4('0x3e')},{'model':db[_0x20a4('0x3b')],'as':'Imap'}]})[_0x20a4('0x1f')](function(_0x27e512){var _0x280df6=_0x1ad60a[_0x20a4('0x71')][_0x20a4('0x35')]({'plain':!![]});if(!_0x280df6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x280df6[_0x20a4('0x7a')]==='user'){var _0x4d99cf=_0x27e512[_0x20a4('0x35')]({'plain':!![]});return db[_0x20a4('0x7b')][_0x20a4('0x59')]({'where':{'name':_0x20a4('0x7c'),'userProfileId':_0x280df6[_0x20a4('0x7d')]},'raw':!![]})[_0x20a4('0x1f')](function(_0x2a95c4){if(_0x2a95c4&&_0x2a95c4[_0x20a4('0x7e')]===0x0){return db['UserProfileResource'][_0x20a4('0x60')]({'name':_0x4d99cf[_0x20a4('0x39')],'resourceId':_0x4d99cf['id'],'type':_0x2a95c4[_0x20a4('0x39')],'sectionId':_0x2a95c4['id']},{})[_0x20a4('0x1f')](function(){return _0x27e512;});}else{return _0x27e512;}})[_0x20a4('0x56')](function(_0x3bcd62){logger[_0x20a4('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3bcd62);throw _0x3bcd62;});}return _0x27e512;})[_0x20a4('0x1f')](respondWithResult(_0x2ceaf7,0xc9))[_0x20a4('0x56')](handleError(_0x2ceaf7,null));};exports[_0x20a4('0x7f')]=function(_0x2f7f94,_0x4c441b,_0x5b9a5){return db[_0x20a4('0x40')][_0x20a4('0x61')]({'where':{'id':_0x2f7f94['params']['id']}})[_0x20a4('0x1f')](handleEntityNotFound(_0x4c441b,null))[_0x20a4('0x1f')](function(_0x522e36){if(_0x522e36){return _0x522e36[_0x20a4('0x7f')]();}return null;})[_0x20a4('0x1f')](respondWithResult(_0x4c441b,null))['catch'](handleError(_0x4c441b,null));};exports[_0x20a4('0x80')]=function(_0x300639,_0x2b976f,_0x23cd20){if(_0x300639[_0x20a4('0x5a')]['id']){delete _0x300639[_0x20a4('0x5a')]['id'];}return db[_0x20a4('0x40')][_0x20a4('0x59')]({'where':{'id':_0x300639['params']['id']}})['then'](handleEntityNotFound(_0x2b976f,null))[_0x20a4('0x1f')](function(_0x44508c){if(_0x44508c){_0x300639['body'][_0x20a4('0x5f')]=_0x44508c['id'];return db[_0x20a4('0x3b')][_0x20a4('0x60')](_0x300639[_0x20a4('0x5a')]);}})[_0x20a4('0x1f')](respondWithResult(_0x2b976f,null))[_0x20a4('0x56')](handleError(_0x2b976f,null));};exports[_0x20a4('0x81')]=function(_0x26291f,_0x5ca55e,_0x53dd6f){return db['MailAccount']['findOne']({'where':{'id':_0x26291f[_0x20a4('0x5b')]['id']}})[_0x20a4('0x1f')](handleEntityNotFound(_0x5ca55e,null))[_0x20a4('0x1f')](function(_0x53ed6f){if(_0x53ed6f){return _0x53ed6f[_0x20a4('0x82')](null);}return null;})[_0x20a4('0x1f')](respondWithStatusCode(_0x5ca55e,null))[_0x20a4('0x56')](handleError(_0x5ca55e,null));};exports[_0x20a4('0x83')]=function(_0x2d1f99,_0x2902c3,_0x1561bb){return db[_0x20a4('0x40')][_0x20a4('0x61')]({'where':{'id':_0x2d1f99[_0x20a4('0x5b')]['id']}})[_0x20a4('0x1f')](handleEntityNotFound(_0x2902c3,null))[_0x20a4('0x1f')](function(_0xd1ae54){if(_0xd1ae54){return _0xd1ae54[_0x20a4('0x83')]();}return null;})[_0x20a4('0x1f')](respondWithResult(_0x2902c3,null))[_0x20a4('0x56')](handleError(_0x2902c3,null));};exports[_0x20a4('0x84')]=function(_0x2e1cad,_0x309e09,_0x1e7014){if(_0x2e1cad['body']['id']){delete _0x2e1cad[_0x20a4('0x5a')]['id'];}return db[_0x20a4('0x40')][_0x20a4('0x59')]({'where':{'id':_0x2e1cad[_0x20a4('0x5b')]['id']}})[_0x20a4('0x1f')](handleEntityNotFound(_0x309e09,null))[_0x20a4('0x1f')](function(_0x4cab75){if(_0x4cab75){_0x2e1cad[_0x20a4('0x5a')][_0x20a4('0x5f')]=_0x4cab75['id'];return db[_0x20a4('0x3d')][_0x20a4('0x60')](_0x2e1cad[_0x20a4('0x5a')]);}})['then'](respondWithResult(_0x309e09,null))[_0x20a4('0x56')](handleError(_0x309e09,null));};exports[_0x20a4('0x85')]=function(_0x1cf3fa,_0x4dee69,_0x5d91fb){return db[_0x20a4('0x40')][_0x20a4('0x61')]({'where':{'id':_0x1cf3fa['params']['id']}})[_0x20a4('0x1f')](handleEntityNotFound(_0x4dee69,null))[_0x20a4('0x1f')](function(_0x55d0c1){if(_0x55d0c1){return _0x55d0c1[_0x20a4('0x86')](null);}return null;})['then'](respondWithStatusCode(_0x4dee69,null))[_0x20a4('0x56')](handleError(_0x4dee69,null));};exports[_0x20a4('0x87')]=function(_0x14ca4a,_0x1bb80a,_0xe8349b){return db[_0x20a4('0x88')][_0x20a4('0x59')]({'where':{'id':_0x14ca4a[_0x20a4('0x5b')]['id']}})[_0x20a4('0x1f')](handleEntityNotFound(_0x1bb80a,null))[_0x20a4('0x1f')](function(_0x49fe6a){if(_0x49fe6a){return _0x49fe6a[_0x20a4('0x87')](_0x14ca4a[_0x20a4('0x5a')][_0x20a4('0x64')],_[_0x20a4('0x89')](_0x14ca4a['body'],['ids','id'])||{});}})[_0x20a4('0x1f')](respondWithResult(_0x1bb80a,null))['catch'](handleError(_0x1bb80a,null));};exports[_0x20a4('0x8a')]=function(_0x4ae0f8,_0x2bcd81,_0x7fb3a7){var _0x4990ae={'raw':![],'where':{}};var _0x3267e8={};var _0x29b009={'count':0x0,'rows':[]};return db[_0x20a4('0x40')]['findOne']({'where':{'id':_0x4ae0f8['params']['id']}})[_0x20a4('0x1f')](handleEntityNotFound(_0x2bcd81,null))[_0x20a4('0x1f')](function(_0x58b317){if(_0x58b317){_0x3267e8[_0x20a4('0x44')]=_[_0x20a4('0x47')](db[_0x20a4('0x88')][_0x20a4('0x41')]);_0x3267e8[_0x20a4('0x46')]=_[_0x20a4('0x47')](_0x4ae0f8[_0x20a4('0x46')]);_0x3267e8[_0x20a4('0x4f')]=_[_0x20a4('0x48')](_0x3267e8[_0x20a4('0x44')],_0x3267e8[_0x20a4('0x46')]);_0x4990ae[_0x20a4('0x49')]=_[_0x20a4('0x48')](_0x3267e8['model'],qs['fields'](_0x4ae0f8[_0x20a4('0x46')][_0x20a4('0x4a')]));_0x4990ae[_0x20a4('0x49')]=_0x4990ae[_0x20a4('0x49')][_0x20a4('0x57')]?_0x4990ae[_0x20a4('0x49')]:_0x3267e8[_0x20a4('0x44')];if(!_0x4ae0f8[_0x20a4('0x46')][_0x20a4('0x68')](_0x20a4('0x4b'))){_0x4990ae[_0x20a4('0x2d')]=qs['limit'](_0x4ae0f8[_0x20a4('0x46')][_0x20a4('0x2d')]);_0x4990ae[_0x20a4('0x2c')]=qs[_0x20a4('0x2c')](_0x4ae0f8[_0x20a4('0x46')][_0x20a4('0x2c')]);}_0x4990ae[_0x20a4('0x4c')]=qs[_0x20a4('0x4d')](_0x4ae0f8['query']['sort']);_0x4990ae[_0x20a4('0x4e')]=qs[_0x20a4('0x4f')](_[_0x20a4('0x50')](_0x4ae0f8[_0x20a4('0x46')],_0x3267e8['filters']));_0x4990ae[_0x20a4('0x4e')]['MailAccountId']=_0x58b317['id'];if(_0x4ae0f8[_0x20a4('0x46')]['filter']){_0x4990ae['where']=_[_0x20a4('0x52')](_0x4990ae[_0x20a4('0x4e')],{'$or':_[_0x20a4('0x45')](_0x4990ae[_0x20a4('0x49')],function(_0x4a6e0d){var _0x16514c={};_0x16514c[_0x4a6e0d]={'$like':'%'+_0x4ae0f8[_0x20a4('0x46')]['filter']+'%'};return _0x16514c;})});}_0x4990ae=_['merge']({},_0x4990ae,_0x4ae0f8[_0x20a4('0x53')]);return db[_0x20a4('0x88')]['count']({'where':_0x4990ae[_0x20a4('0x4e')]})[_0x20a4('0x1f')](function(_0x17a0f4){_0x29b009['count']=_0x17a0f4;if(_0x4ae0f8['query'][_0x20a4('0x58')]){_0x4990ae[_0x20a4('0x54')]=[{'model':db['CmContact'],'as':_0x20a4('0x8b'),'required':![]},{'model':db[_0x20a4('0x8c')],'as':_0x20a4('0x8d'),'attributes':['name',_0x20a4('0x8e'),_0x20a4('0x8f')],'required':![]},{'model':db[_0x20a4('0x90')],'as':_0x20a4('0x91'),'attributes':['id','name',_0x20a4('0x92')],'where':_0x4ae0f8[_0x20a4('0x46')][_0x20a4('0x93')]?{'id':_0x4ae0f8[_0x20a4('0x46')]['tag']}:undefined,'required':_0x4ae0f8[_0x20a4('0x46')][_0x20a4('0x93')]?!![]:![]}];}return db[_0x20a4('0x88')][_0x20a4('0x69')](_0x4990ae);})[_0x20a4('0x1f')](function(_0x33109b){_0x29b009[_0x20a4('0x55')]=_0x33109b;return _0x29b009;});}})[_0x20a4('0x1f')](respondWithFilteredResult(_0x2bcd81,_0x4990ae))[_0x20a4('0x56')](handleError(_0x2bcd81,null));};exports[_0x20a4('0x94')]=function(_0xf52142,_0x3e9af7,_0xfc4ed9){return db[_0x20a4('0x40')][_0x20a4('0x61')]({'where':{'id':_0xf52142[_0x20a4('0x5b')]['id']}})[_0x20a4('0x1f')](handleEntityNotFound(_0x3e9af7,null))[_0x20a4('0x1f')](function(_0x587c8f){if(_0x587c8f){return db['sequelize'][_0x20a4('0x95')](function(_0x1122a4){return db[_0x20a4('0x96')][_0x20a4('0x34')]({'where':{'MailAccountId':_0xf52142[_0x20a4('0x5b')]['id']},'transaction':_0x1122a4})[_0x20a4('0x1f')](function(_0xf22557){var _0x526dda=_[_0x20a4('0x45')](_0xf52142[_0x20a4('0x5a')],function(_0x21273d){_0x21273d[_0x20a4('0x5f')]=_0xf52142[_0x20a4('0x5b')]['id'];return _0x21273d;});return db[_0x20a4('0x96')][_0x20a4('0x97')](_0x526dda,{'transaction':_0x1122a4});});})[_0x20a4('0x1f')](function(){return db[_0x20a4('0x96')][_0x20a4('0x98')]({'where':{'MailAccountId':_0xf52142[_0x20a4('0x5b')]['id']},'order':_0x20a4('0x99')});});}})[_0x20a4('0x1f')](respondWithResult(_0x3e9af7,null))[_0x20a4('0x56')](handleError(_0x3e9af7,null));};exports[_0x20a4('0x9a')]=function(_0x111c80,_0x14a32,_0x1bcf7a){var _0x59efb8={};var _0x5f009b={};var _0x27615c;var _0x44d342;return db[_0x20a4('0x40')]['findOne']({'where':{'id':_0x111c80[_0x20a4('0x5b')]['id']}})[_0x20a4('0x1f')](handleEntityNotFound(_0x14a32,null))[_0x20a4('0x1f')](function(_0x330934){if(_0x330934){_0x27615c=_0x330934;_0x5f009b[_0x20a4('0x44')]=_['keys'](db['MailApplication']['rawAttributes']);_0x5f009b['query']=_['keys'](_0x111c80['query']);_0x5f009b[_0x20a4('0x4f')]=_[_0x20a4('0x48')](_0x5f009b[_0x20a4('0x44')],_0x5f009b[_0x20a4('0x46')]);_0x59efb8[_0x20a4('0x49')]=_[_0x20a4('0x48')](_0x5f009b[_0x20a4('0x44')],qs[_0x20a4('0x4a')](_0x111c80[_0x20a4('0x46')]['fields']));_0x59efb8[_0x20a4('0x49')]=_0x59efb8['attributes']['length']?_0x59efb8['attributes']:_0x5f009b['model'];_0x59efb8[_0x20a4('0x4c')]=qs[_0x20a4('0x4d')](_0x111c80[_0x20a4('0x46')][_0x20a4('0x4d')]);_0x59efb8[_0x20a4('0x4e')]=qs['filters'](_[_0x20a4('0x50')](_0x111c80['query'],_0x5f009b['filters']));if(_0x111c80[_0x20a4('0x46')][_0x20a4('0x51')]){_0x59efb8[_0x20a4('0x4e')]=_[_0x20a4('0x52')](_0x59efb8[_0x20a4('0x4e')],{'$or':_[_0x20a4('0x45')](_0x59efb8[_0x20a4('0x49')],function(_0xd8656b){var _0x3f469f={};_0x3f469f[_0xd8656b]={'$like':'%'+_0x111c80[_0x20a4('0x46')][_0x20a4('0x51')]+'%'};return _0x3f469f;})});}_0x59efb8=_['merge']({},_0x59efb8,_0x111c80[_0x20a4('0x53')]);return _0x27615c[_0x20a4('0x9a')](_0x59efb8);}})[_0x20a4('0x1f')](function(_0x2f1481){if(_0x2f1481){_0x44d342=_0x2f1481[_0x20a4('0x57')];if(!_0x111c80[_0x20a4('0x46')][_0x20a4('0x68')](_0x20a4('0x4b'))){_0x59efb8[_0x20a4('0x2d')]=qs['limit'](_0x111c80['query'][_0x20a4('0x2d')]);_0x59efb8[_0x20a4('0x2c')]=qs['offset'](_0x111c80['query'][_0x20a4('0x2c')]);}return _0x27615c[_0x20a4('0x9a')](_0x59efb8);}})[_0x20a4('0x1f')](function(_0x52349){if(_0x52349){return _0x52349?{'count':_0x44d342,'rows':_0x52349}:null;}})[_0x20a4('0x1f')](respondWithResult(_0x14a32,null))[_0x20a4('0x56')](handleError(_0x14a32,null));};exports[_0x20a4('0x9b')]=function(_0x21ea58,_0x4352d2,_0x1bf486){var _0x584708={'raw':!![],'where':{}};var _0x50dec6={};var _0x58c8e0={'count':0x0,'rows':[]};return db[_0x20a4('0x40')][_0x20a4('0x61')]({'where':{'id':_0x21ea58[_0x20a4('0x5b')]['id']}})[_0x20a4('0x1f')](handleEntityNotFound(_0x4352d2,null))['then'](function(_0x1fbe59){if(_0x1fbe59){_0x50dec6[_0x20a4('0x44')]=_[_0x20a4('0x47')](db[_0x20a4('0x9c')][_0x20a4('0x41')]);_0x50dec6[_0x20a4('0x46')]=_[_0x20a4('0x47')](_0x21ea58[_0x20a4('0x46')]);_0x50dec6[_0x20a4('0x4f')]=_[_0x20a4('0x48')](_0x50dec6[_0x20a4('0x44')],_0x50dec6['query']);_0x584708[_0x20a4('0x49')]=_['intersection'](_0x50dec6['model'],qs[_0x20a4('0x4a')](_0x21ea58[_0x20a4('0x46')]['fields']));_0x584708[_0x20a4('0x49')]=_0x584708[_0x20a4('0x49')][_0x20a4('0x57')]?_0x584708['attributes']:_0x50dec6['model'];if(!_0x21ea58[_0x20a4('0x46')][_0x20a4('0x68')]('nolimit')){_0x584708['limit']=qs[_0x20a4('0x2d')](_0x21ea58[_0x20a4('0x46')][_0x20a4('0x2d')]);_0x584708[_0x20a4('0x2c')]=qs[_0x20a4('0x2c')](_0x21ea58[_0x20a4('0x46')][_0x20a4('0x2c')]);}_0x584708[_0x20a4('0x4c')]=qs[_0x20a4('0x4d')](_0x21ea58[_0x20a4('0x46')][_0x20a4('0x4d')]);_0x584708['where']=qs['filters'](_['pick'](_0x21ea58[_0x20a4('0x46')],_0x50dec6[_0x20a4('0x4f')]));_0x584708[_0x20a4('0x4e')]['MailAccountId']=_0x1fbe59['id'];if(_0x21ea58[_0x20a4('0x46')][_0x20a4('0x51')]){_0x584708[_0x20a4('0x4e')]=_[_0x20a4('0x52')](_0x584708[_0x20a4('0x4e')],{'$or':_[_0x20a4('0x45')](_0x584708[_0x20a4('0x49')],function(_0xff5ee6){var _0x1285e7={};_0x1285e7[_0xff5ee6]={'$like':'%'+_0x21ea58[_0x20a4('0x46')][_0x20a4('0x51')]+'%'};return _0x1285e7;})});}if(_0x21ea58[_0x20a4('0x46')][_0x20a4('0x9d')]){var _0x56533b=_0x21ea58[_0x20a4('0x46')]['$gte'][_0x20a4('0x9e')](',');var _0x1f0fc6={};_0x1f0fc6[_0x56533b[0x0]]={'$gte':moment(_0x56533b[0x1])[_0x20a4('0x9f')](_0x20a4('0xa0'))};_0x584708[_0x20a4('0x4e')]=_['merge'](_0x584708[_0x20a4('0x4e')],_0x1f0fc6);}_0x584708=_[_0x20a4('0x52')]({},_0x584708,_0x21ea58['options']);return db[_0x20a4('0x9c')]['count']({'where':_0x584708[_0x20a4('0x4e')]})[_0x20a4('0x1f')](function(_0x558506){_0x58c8e0[_0x20a4('0x2b')]=_0x558506;if(_0x21ea58[_0x20a4('0x46')][_0x20a4('0x58')]){_0x584708[_0x20a4('0x54')]=[{'all':!![]}];}return db[_0x20a4('0x9c')][_0x20a4('0x69')](_0x584708);})['then'](function(_0x1553af){_0x58c8e0['rows']=_0x1553af;return _0x58c8e0;});}})[_0x20a4('0x1f')](respondWithFilteredResult(_0x4352d2,_0x584708))[_0x20a4('0x56')](handleError(_0x4352d2,null));};exports[_0x20a4('0x3a')]=function(_0x2bc057,_0x2c92d0,_0x5f453d){var _0x39a3ca,_0x3b0f14={},_0x297a0c;if(_0x2bc057[_0x20a4('0x5a')]['to']){_0x297a0c=_0x2bc057[_0x20a4('0x5a')]['to'][_0x20a4('0x9e')](',')[0x0];}return db[_0x20a4('0x40')][_0x20a4('0x59')]({'where':{'id':_0x2bc057[_0x20a4('0x5b')]['id']},'include':[{'model':db[_0x20a4('0xa1')],'as':_0x20a4('0xa2'),'include':[{'model':db[_0x20a4('0xa3')],'as':'Contacts','where':{'email':_0x297a0c},'limit':0x1,'order':[[_0x20a4('0xa4'),_0x20a4('0xa5')]]}]},{'model':db['MailServerOut'],'as':_0x20a4('0x3e'),'raw':!![]}]})['then'](handleEntityNotFound(_0x2c92d0,null))[_0x20a4('0x1f')](function(_0x2fd70e){if(_0x2fd70e){_0x39a3ca=_0x2fd70e;if(_0x2fd70e[_0x20a4('0x3e')]){if(_[_0x20a4('0x6e')](_0x2bc057[_0x20a4('0x5a')][_0x20a4('0xa6')])){_0x2bc057[_0x20a4('0x5a')][_0x20a4('0xa6')]=util['format'](_0x20a4('0xa7'),_0x2fd70e['name'],_0x2fd70e[_0x20a4('0x6b')]||_0x2fd70e[_0x20a4('0x3e')]['user']);}if(_0x2bc057[_0x20a4('0x5a')][_0x20a4('0xa8')]&&_0x2bc057[_0x20a4('0x5a')]['attachments'][_0x20a4('0x57')]){for(var _0x3c37e3=0x0;_0x3c37e3<_0x2bc057[_0x20a4('0x5a')][_0x20a4('0xa8')]['length'];_0x3c37e3+=0x1){_0x2bc057['body']['attachments'][_0x3c37e3]={'filename':_0x2bc057[_0x20a4('0x5a')]['attachments'][_0x3c37e3][_0x20a4('0x39')],'path':path[_0x20a4('0xa9')](config[_0x20a4('0xaa')],_0x20a4('0xab'),_0x2bc057[_0x20a4('0x5a')]['attachments'][_0x3c37e3][_0x20a4('0xac')])};}}var _0x2b6e19={'tls':{'rejectUnauthorized':![]}};if(_[_0x20a4('0x6e')](_0x2fd70e[_0x20a4('0x3e')][_0x20a4('0x77')])){if(_0x2fd70e[_0x20a4('0x3e')][_0x20a4('0x74')]){_0x2b6e19[_0x20a4('0xad')]={'user':_0x2fd70e[_0x20a4('0x3e')]['user'],'pass':_0x2fd70e[_0x20a4('0x3e')][_0x20a4('0x73')]};}_0x2b6e19[_0x20a4('0x75')]=_0x2fd70e['Smtp'][_0x20a4('0x75')];_0x2b6e19[_0x20a4('0x76')]=_0x2fd70e[_0x20a4('0x3e')]['port'];_0x2b6e19['secure']=_0x2fd70e[_0x20a4('0x3e')]['secure'];}else{_0x2b6e19[_0x20a4('0x77')]=_0x2fd70e['Smtp'][_0x20a4('0x77')];_0x2b6e19[_0x20a4('0xad')]={'user':_0x2fd70e[_0x20a4('0x3e')][_0x20a4('0x71')],'pass':_0x2fd70e[_0x20a4('0x3e')]['pass']};}return respondWithRpcPromise('SendMail',_0x20a4('0xae'),{'account':_0x2b6e19,'message':_0x2bc057[_0x20a4('0x5a')]});}else{throw new Error(_0x20a4('0xaf'));}}})[_0x20a4('0x1f')](function(_0x408a72){if(_0x408a72){_0x3b0f14=_0x408a72;if(_0x39a3ca[_0x20a4('0xa2')]){if(_0x39a3ca[_0x20a4('0xa2')]['Contacts']['length']){return _0x39a3ca[_0x20a4('0xa2')][_0x20a4('0xb0')][0x0];}else{return db['CmContact'][_0x20a4('0x60')](_['defaults'](_0x2bc057[_0x20a4('0x5a')],{'firstName':_0x2bc057[_0x20a4('0x5a')]['to'],'email':_0x2bc057[_0x20a4('0x5a')]['to'],'phone':_0x2bc057[_0x20a4('0x5a')]['to'],'ListId':_0x39a3ca['ListId']}));}}else{throw new Error(_0x20a4('0xaf'));}}})['then'](function(_0x3d92fa){if(_0x3d92fa){var _0x2bf37f={'UserId':_0x2bc057[_0x20a4('0x71')]['id'],'ContactId':_0x3d92fa['id'],'MailAccountId':_0x39a3ca['id'],'inReplyTo':_0x3b0f14['messageId'],'to':_0x2bc057['body'][_0x20a4('0xa6')],'cc':_0x2bc057[_0x20a4('0x5a')]['cc'],'subject':_0x2bc057[_0x20a4('0x5a')][_0x20a4('0xb1')],'attach':_0x2bc057[_0x20a4('0x5a')][_0x20a4('0xb2')],'firstMsgDirection':'out','lastMsgAt':moment()[_0x20a4('0x9f')](_0x20a4('0xa0')),'lastMsgDirection':_0x20a4('0xb3'),'lastMsgBody':_0x2bc057[_0x20a4('0x5a')][_0x20a4('0x5a')],'Messages':[_[_0x20a4('0x52')](_0x2bc057[_0x20a4('0x5a')],{'messageId':_0x3b0f14[_0x20a4('0xb4')],'sentAt':moment()[_0x20a4('0x9f')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x39a3ca['id'],'UserId':_0x2bc057[_0x20a4('0x71')]['id'],'ContactId':_0x3d92fa['id']})]};if(_0x2bc057[_0x20a4('0x5a')]['Interaction']){_0x2bf37f=_[_0x20a4('0x52')](_0x2bf37f,_0x2bc057[_0x20a4('0x5a')]['Interaction']);}return db['MailInteraction'][_0x20a4('0x60')](_0x2bf37f,{'include':[{'model':db[_0x20a4('0x9c')],'as':'Messages'}]});}})[_0x20a4('0x1f')](respondWithResult(_0x2c92d0,null))[_0x20a4('0x56')](handleError(_0x2c92d0,null));};exports[_0x20a4('0xb5')]=function(_0x29f266,_0x110428,_0x25a003){return db['MailAccount'][_0x20a4('0x59')]({'where':{'id':_0x29f266['params']['id']},'include':[{'model':db[_0x20a4('0x3d')],'as':_0x20a4('0x3e'),'raw':!![]}]})[_0x20a4('0x1f')](handleEntityNotFound(_0x110428,null))[_0x20a4('0x1f')](function(_0x4dc508){if(_0x4dc508&&_0x4dc508['Smtp']){var _0x5d61b3={'id':_0x4dc508['id'],'tls':{'rejectUnauthorized':![]}};if(_0x4dc508[_0x20a4('0x3e')][_0x20a4('0x77')]){_0x5d61b3[_0x20a4('0x77')]=_0x4dc508[_0x20a4('0x3e')][_0x20a4('0x77')];}else{_0x5d61b3[_0x20a4('0x75')]=_0x4dc508[_0x20a4('0x3e')][_0x20a4('0x75')];_0x5d61b3[_0x20a4('0x76')]=_0x4dc508['Smtp'][_0x20a4('0x76')];_0x5d61b3[_0x20a4('0xb6')]=_0x4dc508[_0x20a4('0x3e')][_0x20a4('0xb6')];}if(_0x4dc508[_0x20a4('0x3e')][_0x20a4('0x74')]){_0x5d61b3[_0x20a4('0xad')]={'user':_0x4dc508['Smtp'][_0x20a4('0x71')],'pass':_0x4dc508['Smtp']['pass']};}return respondWithRpcPromise(_0x20a4('0xb7'),_0x20a4('0xb5'),{'account':_0x5d61b3});}})[_0x20a4('0x1f')](respondWithResult(_0x110428,null))['catch'](handleError(_0x110428,null));};exports[_0x20a4('0x34')]=function(_0x5aeff0,_0x59e991){return db[_0x20a4('0x40')][_0x20a4('0x59')]({'where':{'id':_0x5aeff0[_0x20a4('0x5b')]['id']}})[_0x20a4('0x1f')](handleEntityNotFound(_0x59e991,null))[_0x20a4('0x1f')](function(_0x3809d6){if(_0x3809d6&&_0x3809d6[_0x20a4('0x77')]){throw new db['Sequelize'][(_0x20a4('0xb8'))](_0x20a4('0xb9'));}return _0x3809d6;})['then'](removeEntity(_0x59e991,null))[_0x20a4('0x56')](handleError(_0x59e991,null));};exports[_0x20a4('0xba')]=function(_0x5a4d59,_0x3ab67c,_0x3c8694){return db['MailAccount']['find']({'where':{'id':_0x5a4d59['params']['id']}})['then'](handleEntityNotFound(_0x3ab67c,null))[_0x20a4('0x1f')](function(_0x578b58){if(_0x578b58){return _0x578b58[_0x20a4('0xba')](_0x5a4d59['body'][_0x20a4('0x64')],_[_0x20a4('0x89')](_0x5a4d59[_0x20a4('0x5a')],['ids','id'])||{})['spread'](function(_0xdaaac8){for(var _0x243ef9=0x0;_0x243ef9<_0x5a4d59[_0x20a4('0x5a')][_0x20a4('0x64')][_0x20a4('0x57')];_0x243ef9+=0x1){socket['emit'](_0x20a4('0xbb'),{'UserId':_0x5a4d59['body'][_0x20a4('0x64')][_0x243ef9],'MailAccountId':_0x5a4d59[_0x20a4('0x5b')]['id']});}return _0xdaaac8;});}})[_0x20a4('0x1f')](respondWithResult(_0x3ab67c,null))[_0x20a4('0x56')](handleError(_0x3ab67c,null));};exports[_0x20a4('0xbc')]=function(_0x1ec3f3,_0x549698,_0x4c66f5){return db[_0x20a4('0x40')]['find']({'where':{'id':_0x1ec3f3[_0x20a4('0x5b')]['id']}})['then'](handleEntityNotFound(_0x549698,null))[_0x20a4('0x1f')](function(_0x2780e4){if(_0x2780e4){return _0x2780e4[_0x20a4('0xbc')](_0x1ec3f3[_0x20a4('0x46')][_0x20a4('0x64')])['then'](function(){if(_[_0x20a4('0xbd')](_0x1ec3f3['query']['ids'])){for(var _0x1ec8c6=0x0;_0x1ec8c6<_0x1ec3f3[_0x20a4('0x46')][_0x20a4('0x64')]['length'];_0x1ec8c6+=0x1){socket[_0x20a4('0xbe')](_0x20a4('0xbf'),{'UserId':Number(_0x1ec3f3[_0x20a4('0x46')][_0x20a4('0x64')][_0x1ec8c6]),'MailAccountId':Number(_0x1ec3f3['params']['id'])});}}else{socket[_0x20a4('0xbe')](_0x20a4('0xbf'),{'UserId':Number(_0x1ec3f3[_0x20a4('0x46')][_0x20a4('0x64')]),'MailAccountId':Number(_0x1ec3f3[_0x20a4('0x5b')]['id'])});}});}})['then'](respondWithStatusCode(_0x549698,null))[_0x20a4('0x56')](handleError(_0x549698,null));};exports[_0x20a4('0xc0')]=function(_0x157d38,_0x4ec457,_0x29b9f0){var _0x1344b7={};var _0x1fb51a={};var _0x1b613b;var _0x107403;return db[_0x20a4('0x40')][_0x20a4('0x61')]({'where':{'id':_0x157d38[_0x20a4('0x5b')]['id']}})[_0x20a4('0x1f')](handleEntityNotFound(_0x4ec457,null))[_0x20a4('0x1f')](function(_0x276089){if(_0x276089){_0x1b613b=_0x276089;_0x1fb51a['model']=_[_0x20a4('0x47')](db[_0x20a4('0x8c')][_0x20a4('0x41')]);_0x1fb51a[_0x20a4('0x46')]=_[_0x20a4('0x47')](_0x157d38[_0x20a4('0x46')]);_0x1fb51a[_0x20a4('0x4f')]=_['intersection'](_0x1fb51a[_0x20a4('0x44')],_0x1fb51a[_0x20a4('0x46')]);_0x1344b7[_0x20a4('0x49')]=_[_0x20a4('0x48')](_0x1fb51a[_0x20a4('0x44')],qs[_0x20a4('0x4a')](_0x157d38[_0x20a4('0x46')][_0x20a4('0x4a')]));_0x1344b7[_0x20a4('0x49')]=_0x1344b7[_0x20a4('0x49')][_0x20a4('0x57')]?_0x1344b7['attributes']:_0x1fb51a[_0x20a4('0x44')];_0x1344b7['order']=qs[_0x20a4('0x4d')](_0x157d38['query'][_0x20a4('0x4d')]);_0x1344b7[_0x20a4('0x4e')]=qs['filters'](_[_0x20a4('0x50')](_0x157d38['query'],_0x1fb51a[_0x20a4('0x4f')]));if(_0x157d38[_0x20a4('0x46')][_0x20a4('0x51')]){_0x1344b7[_0x20a4('0x4e')]=_[_0x20a4('0x52')](_0x1344b7[_0x20a4('0x4e')],{'$or':_[_0x20a4('0x45')](_0x1344b7['attributes'],function(_0x16d723){var _0x445066={};_0x445066[_0x16d723]={'$like':'%'+_0x157d38[_0x20a4('0x46')]['filter']+'%'};return _0x445066;})});}_0x1344b7=_['merge']({},_0x1344b7,_0x157d38[_0x20a4('0x53')]);return _0x1b613b[_0x20a4('0xc0')](_0x1344b7);}})[_0x20a4('0x1f')](function(_0x29debe){if(_0x29debe){_0x107403=_0x29debe[_0x20a4('0x57')];if(!_0x157d38['query'][_0x20a4('0x68')](_0x20a4('0x4b'))){_0x1344b7[_0x20a4('0x2d')]=qs[_0x20a4('0x2d')](_0x157d38[_0x20a4('0x46')][_0x20a4('0x2d')]);_0x1344b7[_0x20a4('0x2c')]=qs[_0x20a4('0x2c')](_0x157d38[_0x20a4('0x46')][_0x20a4('0x2c')]);}return _0x1b613b[_0x20a4('0xc0')](_0x1344b7);}})[_0x20a4('0x1f')](function(_0x268af8){if(_0x268af8){return _0x268af8?{'count':_0x107403,'rows':_0x268af8}:null;}})[_0x20a4('0x1f')](respondWithResult(_0x4ec457,null))['catch'](handleError(_0x4ec457,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 290a051..35065bf 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 _0x04db=['hook','events','../../mysqldb','MailAccount','save','update','remove','emit','hasOwnProperty'];(function(_0x48c2ae,_0x4cea90){var _0x8f7531=function(_0x126458){while(--_0x126458){_0x48c2ae['push'](_0x48c2ae['shift']());}};_0x8f7531(++_0x4cea90);}(_0x04db,0x157));var _0xb04d=function(_0x37950f,_0x529948){_0x37950f=_0x37950f-0x0;var _0x455801=_0x04db[_0x37950f];return _0x455801;};'use strict';var EventEmitter=require(_0xb04d('0x0'));var MailAccount=require(_0xb04d('0x1'))['db'][_0xb04d('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb04d('0x3'),'afterUpdate':_0xb04d('0x4'),'afterDestroy':_0xb04d('0x5')};function emitEvent(_0x10d61a){return function(_0x48ec5d,_0x8e5327,_0x26af54){MailAccountEvents[_0xb04d('0x6')](_0x10d61a+':'+_0x48ec5d['id'],_0x48ec5d);MailAccountEvents['emit'](_0x10d61a,_0x48ec5d);_0x26af54(null);};}for(var e in events){if(events[_0xb04d('0x7')](e)){var event=events[e];MailAccount[_0xb04d('0x8')](e,emitEvent(event));}}module['exports']=MailAccountEvents; \ No newline at end of file +var _0x4ce7=['exports','events','../../mysqldb','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x4ecf72,_0x324f63){var _0x1af8a3=function(_0x5e8376){while(--_0x5e8376){_0x4ecf72['push'](_0x4ecf72['shift']());}};_0x1af8a3(++_0x324f63);}(_0x4ce7,0x1c3));var _0x74ce=function(_0xc0a403,_0x1b5d86){_0xc0a403=_0xc0a403-0x0;var _0x30453b=_0x4ce7[_0xc0a403];return _0x30453b;};'use strict';var EventEmitter=require(_0x74ce('0x0'));var MailAccount=require(_0x74ce('0x1'))['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x74ce('0x2')](0x0);var events={'afterCreate':_0x74ce('0x3'),'afterUpdate':'update','afterDestroy':_0x74ce('0x4')};function emitEvent(_0x478829){return function(_0x548d2c,_0x487f01,_0x433c10){MailAccountEvents[_0x74ce('0x5')](_0x478829+':'+_0x548d2c['id'],_0x548d2c);MailAccountEvents[_0x74ce('0x5')](_0x478829,_0x548d2c);_0x433c10(null);};}for(var e in events){if(events[_0x74ce('0x6')](e)){var event=events[e];MailAccount[_0x74ce('0x7')](e,emitEvent(event));}}module[_0x74ce('0x8')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index adc7afb..54e5101 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 _0x980c=['path','rimraf','../../config/environment','./mailAccount.attributes','exports','define','mail_accounts','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x3fe042,_0x1106f7){var _0x7d4a1f=function(_0x2df987){while(--_0x2df987){_0x3fe042['push'](_0x3fe042['shift']());}};_0x7d4a1f(++_0x1106f7);}(_0x980c,0x159));var _0xc980=function(_0x5ce200,_0x3d6352){_0x5ce200=_0x5ce200-0x0;var _0x2dfee7=_0x980c[_0x5ce200];return _0x2dfee7;};'use strict';var _=require(_0xc980('0x0'));var util=require(_0xc980('0x1'));var logger=require(_0xc980('0x2'))(_0xc980('0x3'));var moment=require('moment');var BPromise=require(_0xc980('0x4'));var rp=require(_0xc980('0x5'));var fs=require('fs');var path=require(_0xc980('0x6'));var rimraf=require(_0xc980('0x7'));var config=require(_0xc980('0x8'));var attributes=require(_0xc980('0x9'));module[_0xc980('0xa')]=function(_0x5cd1b4,_0x1a3ef1){return _0x5cd1b4[_0xc980('0xb')]('MailAccount',attributes,{'tableName':_0xc980('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeee3=['../../config/environment','./mailAccount.attributes','exports','define','MailAccount','mail_accounts','util','../../config/logger','api','bluebird','rimraf'];(function(_0x1f050b,_0xd36991){var _0x286ba7=function(_0x5e30b2){while(--_0x5e30b2){_0x1f050b['push'](_0x1f050b['shift']());}};_0x286ba7(++_0xd36991);}(_0xeee3,0xb6));var _0x3eee=function(_0x9fb908,_0x5b8911){_0x9fb908=_0x9fb908-0x0;var _0x323fb4=_0xeee3[_0x9fb908];return _0x323fb4;};'use strict';var _=require('lodash');var util=require(_0x3eee('0x0'));var logger=require(_0x3eee('0x1'))(_0x3eee('0x2'));var moment=require('moment');var BPromise=require(_0x3eee('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3eee('0x4'));var config=require(_0x3eee('0x5'));var attributes=require(_0x3eee('0x6'));module[_0x3eee('0x7')]=function(_0x1500c8,_0x338b40){return _0x1500c8[_0x3eee('0x8')](_0x3eee('0x9'),attributes,{'tableName':_0x3eee('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 70963e0..6552e8a 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 _0xe74e=['ShowMailAccount','body','mail','difference','CmContact','rawAttributes','createdAt','updatedAt','ListId','from','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','List','Contacts','DESC','MailApplication','Applications','MailServerOut','Smtp','account','omit','applications','list','orderBy','priority','asc','push','length','close','autoclose','*,*,*,*','defaults','List\x20not\x20found','messageId','subject','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','Messages','MailInteraction','Contact\x20not\x20found','spread','update','attach','interaction','get','created','create','attachments','originCc','bcc','Attachments','User','name','UserId','unshift','agent','waitForTheAssignedAgent','startRouting','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','localhost','socket.io-emitter','request','info','MailAccount,\x20%s,\x20%s','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailAccount','MailAccount','findAll','options','raw','attributes','limit','include','map','model','then','debug'];(function(_0x1ae5ab,_0xc5d441){var _0x1ce001=function(_0x5ef96d){while(--_0x5ef96d){_0x1ae5ab['push'](_0x1ae5ab['shift']());}};_0x1ce001(++_0xc5d441);}(_0xe74e,0x10a));var _0xee74=function(_0x34d346,_0x4c6502){_0x34d346=_0x34d346-0x0;var _0x122d76=_0xe74e[_0x34d346];return _0x122d76;};'use strict';var _=require('lodash');var util=require(_0xee74('0x0'));var moment=require(_0xee74('0x1'));var BPromise=require(_0xee74('0x2'));var rs=require(_0xee74('0x3'));var fs=require('fs');var Redis=require(_0xee74('0x4'));var db=require(_0xee74('0x5'))['db'];var utils=require(_0xee74('0x6'));var logger=require(_0xee74('0x7'))(_0xee74('0x8'));var config=require(_0xee74('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xee74('0xa')]({'port':0x232c});config[_0xee74('0xb')]=_['defaults'](config['redis'],{'host':_0xee74('0xc'),'port':0x18eb});var socket=require(_0xee74('0xd'))(new Redis(config[_0xee74('0xb')]));require('./mailAccount.socket')['register'](socket);function respondWithRpcPromise(_0x12f2b7,_0x28ae0d,_0xe6609e){return new BPromise(function(_0x1c68e8,_0x24128b){return client[_0xee74('0xe')](_0x12f2b7,_0xe6609e)['then'](function(_0x428062){logger[_0xee74('0xf')](_0xee74('0x10'),_0x28ae0d,_0xee74('0x11'));logger['debug'](_0xee74('0x12'),_0x28ae0d,_0xee74('0x11'),JSON[_0xee74('0x13')](_0x428062));if(_0x428062[_0xee74('0x14')]){if(_0x428062['error'][_0xee74('0x15')]===0x1f4){logger[_0xee74('0x14')](_0xee74('0x10'),_0x28ae0d,_0x428062[_0xee74('0x14')][_0xee74('0x16')]);return _0x24128b(_0x428062[_0xee74('0x14')]['message']);}logger[_0xee74('0x14')](_0xee74('0x10'),_0x28ae0d,_0x428062[_0xee74('0x14')]['message']);return _0x1c68e8(_0x428062[_0xee74('0x14')][_0xee74('0x16')]);}else{logger['info']('MailAccount,\x20%s,\x20%s',_0x28ae0d,_0xee74('0x11'));_0x1c68e8(_0x428062[_0xee74('0x17')][_0xee74('0x16')]);}})[_0xee74('0x18')](function(_0x122c05){logger['error'](_0xee74('0x10'),_0x28ae0d,_0x122c05);_0x24128b(_0x122c05);});});}exports[_0xee74('0x19')]=function(_0x585726){var _0x14db93=this;return new Promise(function(_0x267b6a,_0x179cb3){return db[_0xee74('0x1a')][_0xee74('0x1b')]({'raw':_0x585726['options']?_0x585726[_0xee74('0x1c')][_0xee74('0x1d')]===undefined?!![]:![]:!![],'where':_0x585726[_0xee74('0x1c')]?_0x585726[_0xee74('0x1c')]['where']||null:null,'attributes':_0x585726['options']?_0x585726['options'][_0xee74('0x1e')]||null:null,'limit':_0x585726[_0xee74('0x1c')]?_0x585726[_0xee74('0x1c')][_0xee74('0x1f')]||null:null,'include':_0x585726[_0xee74('0x1c')]?_0x585726[_0xee74('0x1c')][_0xee74('0x20')]?_[_0xee74('0x21')](_0x585726[_0xee74('0x1c')][_0xee74('0x20')],function(_0xa21779){return{'model':db[_0xa21779[_0xee74('0x22')]],'as':_0xa21779['as'],'attributes':_0xa21779[_0xee74('0x1e')],'include':_0xa21779[_0xee74('0x20')]?_[_0xee74('0x21')](_0xa21779[_0xee74('0x20')],function(_0x24511e){return{'model':db[_0x24511e[_0xee74('0x22')]],'as':_0x24511e['as'],'attributes':_0x24511e[_0xee74('0x1e')],'include':_0x24511e[_0xee74('0x20')]?_['map'](_0x24511e[_0xee74('0x20')],function(_0x3e62bc){return{'model':db[_0x3e62bc[_0xee74('0x22')]],'as':_0x3e62bc['as'],'attributes':_0x3e62bc[_0xee74('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xee74('0x23')](function(_0x399b50){logger['info'](_0xee74('0x19'),_0x585726);logger[_0xee74('0x24')](_0xee74('0x19'),_0x585726,JSON['stringify'](_0x399b50));_0x267b6a(_0x399b50);})[_0xee74('0x18')](function(_0x25d3c9){logger[_0xee74('0x14')](_0xee74('0x19'),_0x25d3c9[_0xee74('0x16')],_0x585726);_0x179cb3(_0x14db93[_0xee74('0x14')](0x1f4,_0x25d3c9[_0xee74('0x16')]));});});};exports[_0xee74('0x25')]=function(_0x378dbd){var _0x1f6d7c=this;return new Promise(function(_0x5bad7c,_0x2cd414){return db['MailAccount']['find']({'raw':_0x378dbd[_0xee74('0x1c')]?_0x378dbd['options']['raw']===undefined?!![]:![]:!![],'where':_0x378dbd[_0xee74('0x1c')]?_0x378dbd[_0xee74('0x1c')]['where']||null:null,'attributes':_0x378dbd[_0xee74('0x1c')]?_0x378dbd[_0xee74('0x1c')][_0xee74('0x1e')]||null:null,'include':_0x378dbd[_0xee74('0x1c')]?_0x378dbd['options'][_0xee74('0x20')]?_['map'](_0x378dbd[_0xee74('0x1c')][_0xee74('0x20')],function(_0x1a8f71){return{'model':db[_0x1a8f71['model']],'as':_0x1a8f71['as'],'attributes':_0x1a8f71[_0xee74('0x1e')],'include':_0x1a8f71['include']?_['map'](_0x1a8f71[_0xee74('0x20')],function(_0x21f000){return{'model':db[_0x21f000[_0xee74('0x22')]],'as':_0x21f000['as'],'attributes':_0x21f000['attributes'],'include':_0x21f000['include']?_[_0xee74('0x21')](_0x21f000[_0xee74('0x20')],function(_0xb94e4c){return{'model':db[_0xb94e4c[_0xee74('0x22')]],'as':_0xb94e4c['as'],'attributes':_0xb94e4c[_0xee74('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xee74('0x23')](function(_0xf1a11){logger[_0xee74('0xf')](_0xee74('0x25'),_0x378dbd);logger[_0xee74('0x24')]('ShowMailAccount',_0x378dbd,JSON[_0xee74('0x13')](_0xf1a11));_0x5bad7c(_0xf1a11);})[_0xee74('0x18')](function(_0x3724fb){logger['error'](_0xee74('0x25'),_0x3724fb[_0xee74('0x16')],_0x378dbd);_0x2cd414(_0x1f6d7c[_0xee74('0x14')](0x1f4,_0x3724fb[_0xee74('0x16')]));});});};exports['NotifyMailAccount']=function(_0x47b06b){var _0x3369bf=this;return new Promise(function(_0x5db032,_0x381506){var _0x435a7b={'body':_0x47b06b[_0xee74('0x26')],'channel':_0xee74('0x27')};var _0xd7bae=_[_0xee74('0x28')](_['keys'](db[_0xee74('0x29')][_0xee74('0x2a')]),[_0xee74('0x2b'),_0xee74('0x2c'),'CompanyId',_0xee74('0x2d')]);var _0x31d871=![];if(_0x47b06b[_0xee74('0x26')]['id']){delete _0x47b06b[_0xee74('0x26')]['id'];}if(_['isNil'](_0x47b06b['body'][_0xee74('0x2e')])){return _0x381506(_0x3369bf['error'](0x1f4,_0xee74('0x2f')));}if(_[_0xee74('0x30')](_0x47b06b[_0xee74('0x26')]['body'])||_0x47b06b[_0xee74('0x26')]['body']===''){return _0x381506(_0x3369bf[_0xee74('0x14')](0x1f4,_0xee74('0x31')));}if(_[_0xee74('0x30')](_0x47b06b['body'][_0xee74('0x32')])){return _0x381506(_0x3369bf[_0xee74('0x14')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xd7bae));}if(!_[_0xee74('0x33')](_0xd7bae,_0x47b06b[_0xee74('0x26')]['mapKey'])){return _0x381506(_0x3369bf[_0xee74('0x14')](0x1f4,_0xee74('0x34')+_0xd7bae));}var _0x1791ef={};_0x1791ef[_0x47b06b[_0xee74('0x26')]['mapKey']]=_0x47b06b[_0xee74('0x26')][_0xee74('0x2e')];return db['MailAccount'][_0xee74('0x35')]({'where':{'id':_0x47b06b['account']['id']},'include':[{'model':db['CmList'],'as':_0xee74('0x36'),'include':[{'model':db[_0xee74('0x29')],'as':_0xee74('0x37'),'where':_0x1791ef,'limit':0x1,'order':[[_0xee74('0x2c'),_0xee74('0x38')]]}]},{'model':db[_0xee74('0x39')],'as':_0xee74('0x3a')},{'model':db[_0xee74('0x3b')],'as':_0xee74('0x3c')}]})['then'](function(_0x5ad786){if(_0x5ad786&&_0x5ad786[_0xee74('0x36')]){var _0x296272=_0x5ad786['get']({'plain':!![]});_0x435a7b[_0xee74('0x3d')]=_[_0xee74('0x3e')](_0x296272,['Applications',_0xee74('0x36')]);_0x435a7b[_0xee74('0x3f')]=_0x296272[_0xee74('0x3a')];_0x435a7b[_0xee74('0x40')]=_0x296272[_0xee74('0x36')];_0x435a7b[_0xee74('0x3f')]=_[_0xee74('0x41')](_0x435a7b['applications'],[_0xee74('0x42')],[_0xee74('0x43')]);if(_0x435a7b[_0xee74('0x3d')]&&_0x435a7b['account']['autoclose']){_0x435a7b[_0xee74('0x3f')][_0xee74('0x44')]({'id':0x0,'priority':_0x435a7b[_0xee74('0x3f')][_0xee74('0x45')]+0x1,'app':_0xee74('0x46'),'appdata':_0xee74('0x47'),'interval':_0xee74('0x48')});}if(_0x435a7b['account'][_0xee74('0x3a')]){delete _0x435a7b[_0xee74('0x3d')][_0xee74('0x3a')];}if(_0x435a7b[_0xee74('0x3d')][_0xee74('0x36')]){delete _0x435a7b[_0xee74('0x3d')][_0xee74('0x36')];}if(_0x296272['List'][_0xee74('0x37')][_0xee74('0x45')]){return _0x296272[_0xee74('0x36')][_0xee74('0x37')][0x0];}var _0x1e3558=_[_0xee74('0x49')](_0x47b06b[_0xee74('0x26')],{'firstName':_0x47b06b[_0xee74('0x26')]['from'],'ListId':_0x296272[_0xee74('0x2d')]});_0x1e3558[_0x47b06b[_0xee74('0x26')][_0xee74('0x32')]]=_0x47b06b['body'][_0xee74('0x2e')];return db[_0xee74('0x29')]['create'](_0x1e3558);}else{throw new Error(_0xee74('0x4a'));}})[_0xee74('0x23')](function(_0x580b8f){_0x435a7b['contact']=_0x580b8f;if(_0x580b8f){if(!_0x47b06b[_0xee74('0x26')]['message'][_0xee74('0x4b')]){_0x47b06b['body']['message'][_0xee74('0x4b')]=rs['generate']()+'\x20'+_0x47b06b[_0xee74('0x26')][_0xee74('0x16')]['from'];}var _0x530847={'ContactId':_0x580b8f['id'],'MailAccountId':_0x47b06b[_0xee74('0x3d')]['id'],'inReplyTo':_0x47b06b[_0xee74('0x26')]['message']['messageId'],'to':_0x47b06b[_0xee74('0x26')][_0xee74('0x16')][_0xee74('0x2e')],'cc':_0x47b06b[_0xee74('0x26')][_0xee74('0x16')]['cc'],'subject':_0x47b06b[_0xee74('0x26')]['message'][_0xee74('0x4c')],'attach':_0x47b06b[_0xee74('0x26')][_0xee74('0x16')]['attach'],'lastMsgAt':moment()[_0xee74('0x4d')](_0xee74('0x4e')),'lastMsgDirection':'in','lastMsgBody':_0x47b06b[_0xee74('0x26')][_0xee74('0x26')]};return db['MailInteraction'][_0xee74('0x35')]({'where':{'closed':![],'MailAccountId':_0x47b06b[_0xee74('0x3d')]['id']},'include':[{'model':db[_0xee74('0x4f')],'as':_0xee74('0x50'),'attributes':[_0xee74('0x4b')],'where':{'messageId':_0x47b06b[_0xee74('0x26')]['message']['inReplyTo']}}]})['then'](function(_0x2a9ff7){if(_0x2a9ff7){return[_0x2a9ff7,![]];}return db[_0xee74('0x51')]['create'](_0x530847)[_0xee74('0x23')](function(_0x5e18ab){return[_0x5e18ab,!![]];});});}else{throw new Error(_0xee74('0x52'));}})[_0xee74('0x53')](function(_0x260839,_0x40410b){if(_0x260839){_0x31d871=_0x40410b;if(!_0x40410b){return _0x260839[_0xee74('0x54')]({'inReplyTo':_0x47b06b['body'][_0xee74('0x16')][_0xee74('0x4b')],'to':_0x47b06b[_0xee74('0x26')][_0xee74('0x16')][_0xee74('0x2e')],'cc':_0x47b06b['body'][_0xee74('0x16')]['cc'],'subject':_0x47b06b[_0xee74('0x26')][_0xee74('0x16')][_0xee74('0x4c')],'attach':_0x260839[_0xee74('0x55')]?_0x260839[_0xee74('0x55')]:_0x47b06b[_0xee74('0x26')]['message']['attach'],'substatus':null,'substatusAt':moment()[_0xee74('0x4d')](_0xee74('0x4e')),'lastMsgAt':moment()[_0xee74('0x4d')](_0xee74('0x4e')),'lastMsgDirection':'in','lastMsgBody':_0x47b06b['body'][_0xee74('0x26')]});}else{return _0x260839;}}})[_0xee74('0x23')](function(_0x47d2b9){_0x435a7b[_0xee74('0x56')]=_0x47d2b9[_0xee74('0x57')]({'plain':!![]});_0x435a7b[_0xee74('0x56')][_0xee74('0x58')]=_0x31d871;return db['MailMessage'][_0xee74('0x59')]({'body':_0x47b06b[_0xee74('0x26')][_0xee74('0x26')],'MailAccountId':_0x47b06b[_0xee74('0x3d')]['id'],'MailInteractionId':_0x47d2b9['id'],'direction':'in','ContactId':_0x435a7b['contact']['id'],'messageId':_0x47b06b[_0xee74('0x26')][_0xee74('0x16')]['messageId'],'from':_0x47b06b[_0xee74('0x26')][_0xee74('0x16')][_0xee74('0x2e')],'to':_0x47b06b[_0xee74('0x26')]['message']['to'],'cc':_0x47b06b[_0xee74('0x26')][_0xee74('0x16')]['cc'],'subject':_0x47b06b[_0xee74('0x26')]['message'][_0xee74('0x4c')],'attach':_0x47b06b[_0xee74('0x26')][_0xee74('0x16')][_0xee74('0x55')],'Attachments':_0x47b06b[_0xee74('0x26')]['message'][_0xee74('0x5a')],'originTo':_0x47b06b[_0xee74('0x26')][_0xee74('0x16')]['originTo'],'originCc':_0x47b06b[_0xee74('0x26')][_0xee74('0x16')][_0xee74('0x5b')],'bcc':_0x47b06b[_0xee74('0x26')][_0xee74('0x16')][_0xee74('0x5c')]},{'include':[{'model':db['Attachment'],'as':_0xee74('0x5d')}]});})[_0xee74('0x23')](function(_0x1cfb84){_0x435a7b[_0xee74('0x16')]=_0x1cfb84;if(_0x435a7b[_0xee74('0x56')]['UserId']){return db[_0xee74('0x5e')][_0xee74('0x35')]({'attributes':['id',_0xee74('0x5f')],'where':{'id':_0x435a7b[_0xee74('0x56')][_0xee74('0x60')]}})[_0xee74('0x23')](function(_0x364da4){if(_0x364da4){_0x435a7b['applications'][_0xee74('0x61')]({'id':0x0,'priority':0x0,'app':_0xee74('0x62'),'appdata':_0x364da4[_0xee74('0x5f')]+','+(_0x435a7b[_0xee74('0x3d')][_0xee74('0x63')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start','startRouting',_0x435a7b);});}return respondWithRpcPromise('Start',_0xee74('0x64'),_0x435a7b);})['then'](function(_0x216481){_0x5db032(_0x216481);})['catch'](function(_0xa72819){_0x381506(_0x3369bf['error'](0x1f4,_0xa72819[_0xee74('0x16')]));});});}; \ No newline at end of file +var _0xfc65=['Applications','orderBy','priority','autoclose','push','close','*,*,*,*','Contacts','create','List\x20not\x20found','contact','messageId','generate','subject','attach','format','MailInteraction','inReplyTo','Contact\x20not\x20found','spread','update','interaction','created','MailMessage','attachments','originTo','originCc','bcc','Attachment','Attachments','UserId','User','agent','name','Start','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','socket.io-emitter','./mailAccount.socket','info','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','MailAccount','findAll','options','raw','limit','map','include','model','attributes','then','GetMailAccount','find','where','ShowMailAccount','NotifyMailAccount','body','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','CmContact','DESC','MailApplication','MailServerOut','Smtp','get','applications'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xfc65,0x1b4));var _0x5fc6=function(_0x3dfa92,_0x1c5cf1){_0x3dfa92=_0x3dfa92-0x0;var _0x16b44a=_0xfc65[_0x3dfa92];return _0x16b44a;};'use strict';var _=require(_0x5fc6('0x0'));var util=require(_0x5fc6('0x1'));var moment=require(_0x5fc6('0x2'));var BPromise=require(_0x5fc6('0x3'));var rs=require(_0x5fc6('0x4'));var fs=require('fs');var Redis=require(_0x5fc6('0x5'));var db=require(_0x5fc6('0x6'))['db'];var utils=require(_0x5fc6('0x7'));var logger=require(_0x5fc6('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5fc6('0x9'));var client=jayson[_0x5fc6('0xa')][_0x5fc6('0xb')]({'port':0x232c});config[_0x5fc6('0xc')]=_[_0x5fc6('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x5fc6('0xe'))(new Redis(config[_0x5fc6('0xc')]));require(_0x5fc6('0xf'))['register'](socket);function respondWithRpcPromise(_0x3c0c98,_0x4e5f13,_0x49a9c8){return new BPromise(function(_0x6daec,_0x3a0a5c){return client['request'](_0x3c0c98,_0x49a9c8)['then'](function(_0x3caadc){logger[_0x5fc6('0x10')](_0x5fc6('0x11'),_0x4e5f13,'request\x20sent');logger[_0x5fc6('0x12')](_0x5fc6('0x13'),_0x4e5f13,_0x5fc6('0x14'),JSON[_0x5fc6('0x15')](_0x3caadc));if(_0x3caadc[_0x5fc6('0x16')]){if(_0x3caadc[_0x5fc6('0x16')]['code']===0x1f4){logger[_0x5fc6('0x16')]('MailAccount,\x20%s,\x20%s',_0x4e5f13,_0x3caadc[_0x5fc6('0x16')][_0x5fc6('0x17')]);return _0x3a0a5c(_0x3caadc[_0x5fc6('0x16')][_0x5fc6('0x17')]);}logger['error'](_0x5fc6('0x11'),_0x4e5f13,_0x3caadc['error'][_0x5fc6('0x17')]);return _0x6daec(_0x3caadc['error']['message']);}else{logger[_0x5fc6('0x10')](_0x5fc6('0x11'),_0x4e5f13,_0x5fc6('0x14'));_0x6daec(_0x3caadc[_0x5fc6('0x18')][_0x5fc6('0x17')]);}})[_0x5fc6('0x19')](function(_0x47c75b){logger[_0x5fc6('0x16')](_0x5fc6('0x11'),_0x4e5f13,_0x47c75b);_0x3a0a5c(_0x47c75b);});});}exports['GetMailAccount']=function(_0x54855c){var _0x18fe24=this;return new Promise(function(_0x1d39eb,_0x4b3b35){return db[_0x5fc6('0x1a')][_0x5fc6('0x1b')]({'raw':_0x54855c[_0x5fc6('0x1c')]?_0x54855c[_0x5fc6('0x1c')][_0x5fc6('0x1d')]===undefined?!![]:![]:!![],'where':_0x54855c[_0x5fc6('0x1c')]?_0x54855c['options']['where']||null:null,'attributes':_0x54855c['options']?_0x54855c[_0x5fc6('0x1c')]['attributes']||null:null,'limit':_0x54855c['options']?_0x54855c[_0x5fc6('0x1c')][_0x5fc6('0x1e')]||null:null,'include':_0x54855c[_0x5fc6('0x1c')]?_0x54855c['options']['include']?_[_0x5fc6('0x1f')](_0x54855c[_0x5fc6('0x1c')][_0x5fc6('0x20')],function(_0x102d47){return{'model':db[_0x102d47[_0x5fc6('0x21')]],'as':_0x102d47['as'],'attributes':_0x102d47[_0x5fc6('0x22')],'include':_0x102d47[_0x5fc6('0x20')]?_[_0x5fc6('0x1f')](_0x102d47[_0x5fc6('0x20')],function(_0x5029c6){return{'model':db[_0x5029c6[_0x5fc6('0x21')]],'as':_0x5029c6['as'],'attributes':_0x5029c6['attributes'],'include':_0x5029c6[_0x5fc6('0x20')]?_[_0x5fc6('0x1f')](_0x5029c6[_0x5fc6('0x20')],function(_0xec58dc){return{'model':db[_0xec58dc[_0x5fc6('0x21')]],'as':_0xec58dc['as'],'attributes':_0xec58dc[_0x5fc6('0x22')]};}):[]};}):[]};}):[]:[]})[_0x5fc6('0x23')](function(_0x2bef8b){logger[_0x5fc6('0x10')](_0x5fc6('0x24'),_0x54855c);logger[_0x5fc6('0x12')]('GetMailAccount',_0x54855c,JSON[_0x5fc6('0x15')](_0x2bef8b));_0x1d39eb(_0x2bef8b);})[_0x5fc6('0x19')](function(_0x2836f2){logger[_0x5fc6('0x16')]('GetMailAccount',_0x2836f2[_0x5fc6('0x17')],_0x54855c);_0x4b3b35(_0x18fe24[_0x5fc6('0x16')](0x1f4,_0x2836f2[_0x5fc6('0x17')]));});});};exports['ShowMailAccount']=function(_0x17b2d4){var _0x496408=this;return new Promise(function(_0x437640,_0x2e1212){return db[_0x5fc6('0x1a')][_0x5fc6('0x25')]({'raw':_0x17b2d4[_0x5fc6('0x1c')]?_0x17b2d4[_0x5fc6('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x17b2d4[_0x5fc6('0x1c')]?_0x17b2d4['options'][_0x5fc6('0x26')]||null:null,'attributes':_0x17b2d4['options']?_0x17b2d4[_0x5fc6('0x1c')][_0x5fc6('0x22')]||null:null,'include':_0x17b2d4[_0x5fc6('0x1c')]?_0x17b2d4['options'][_0x5fc6('0x20')]?_[_0x5fc6('0x1f')](_0x17b2d4[_0x5fc6('0x1c')][_0x5fc6('0x20')],function(_0x1e05a0){return{'model':db[_0x1e05a0[_0x5fc6('0x21')]],'as':_0x1e05a0['as'],'attributes':_0x1e05a0[_0x5fc6('0x22')],'include':_0x1e05a0[_0x5fc6('0x20')]?_[_0x5fc6('0x1f')](_0x1e05a0[_0x5fc6('0x20')],function(_0x93b69e){return{'model':db[_0x93b69e['model']],'as':_0x93b69e['as'],'attributes':_0x93b69e['attributes'],'include':_0x93b69e[_0x5fc6('0x20')]?_[_0x5fc6('0x1f')](_0x93b69e[_0x5fc6('0x20')],function(_0x48b2b4){return{'model':db[_0x48b2b4[_0x5fc6('0x21')]],'as':_0x48b2b4['as'],'attributes':_0x48b2b4['attributes']};}):[]};}):[]};}):[]:[]})[_0x5fc6('0x23')](function(_0x115ae5){logger[_0x5fc6('0x10')](_0x5fc6('0x27'),_0x17b2d4);logger[_0x5fc6('0x12')]('ShowMailAccount',_0x17b2d4,JSON[_0x5fc6('0x15')](_0x115ae5));_0x437640(_0x115ae5);})['catch'](function(_0x26646a){logger[_0x5fc6('0x16')]('ShowMailAccount',_0x26646a[_0x5fc6('0x17')],_0x17b2d4);_0x2e1212(_0x496408[_0x5fc6('0x16')](0x1f4,_0x26646a['message']));});});};exports[_0x5fc6('0x28')]=function(_0x2b0cf0){var _0x14866d=this;return new Promise(function(_0x5ea30f,_0x19f951){var _0x2fbff0={'body':_0x2b0cf0[_0x5fc6('0x29')],'channel':'mail'};var _0x297f1f=_['difference'](_['keys'](db['CmContact'][_0x5fc6('0x2a')]),[_0x5fc6('0x2b'),_0x5fc6('0x2c'),_0x5fc6('0x2d'),_0x5fc6('0x2e')]);var _0x942444=![];if(_0x2b0cf0['body']['id']){delete _0x2b0cf0['body']['id'];}if(_['isNil'](_0x2b0cf0['body'][_0x5fc6('0x2f')])){return _0x19f951(_0x14866d['error'](0x1f4,_0x5fc6('0x30')));}if(_[_0x5fc6('0x31')](_0x2b0cf0[_0x5fc6('0x29')]['body'])||_0x2b0cf0[_0x5fc6('0x29')][_0x5fc6('0x29')]===''){return _0x19f951(_0x14866d[_0x5fc6('0x16')](0x1f4,_0x5fc6('0x32')));}if(_[_0x5fc6('0x31')](_0x2b0cf0[_0x5fc6('0x29')][_0x5fc6('0x33')])){return _0x19f951(_0x14866d[_0x5fc6('0x16')](0x1f4,_0x5fc6('0x34')+_0x297f1f));}if(!_['includes'](_0x297f1f,_0x2b0cf0[_0x5fc6('0x29')][_0x5fc6('0x33')])){return _0x19f951(_0x14866d[_0x5fc6('0x16')](0x1f4,_0x5fc6('0x35')+_0x297f1f));}var _0x1ed70d={};_0x1ed70d[_0x2b0cf0[_0x5fc6('0x29')][_0x5fc6('0x33')]]=_0x2b0cf0[_0x5fc6('0x29')]['from'];return db['MailAccount']['find']({'where':{'id':_0x2b0cf0[_0x5fc6('0x36')]['id']},'include':[{'model':db[_0x5fc6('0x37')],'as':_0x5fc6('0x38'),'include':[{'model':db[_0x5fc6('0x39')],'as':'Contacts','where':_0x1ed70d,'limit':0x1,'order':[['updatedAt',_0x5fc6('0x3a')]]}]},{'model':db[_0x5fc6('0x3b')],'as':'Applications'},{'model':db[_0x5fc6('0x3c')],'as':_0x5fc6('0x3d')}]})[_0x5fc6('0x23')](function(_0x434618){if(_0x434618&&_0x434618['List']){var _0xb38b73=_0x434618[_0x5fc6('0x3e')]({'plain':!![]});_0x2fbff0[_0x5fc6('0x36')]=_['omit'](_0xb38b73,['Applications','List']);_0x2fbff0[_0x5fc6('0x3f')]=_0xb38b73[_0x5fc6('0x40')];_0x2fbff0['list']=_0xb38b73[_0x5fc6('0x38')];_0x2fbff0[_0x5fc6('0x3f')]=_[_0x5fc6('0x41')](_0x2fbff0['applications'],[_0x5fc6('0x42')],['asc']);if(_0x2fbff0[_0x5fc6('0x36')]&&_0x2fbff0['account'][_0x5fc6('0x43')]){_0x2fbff0[_0x5fc6('0x3f')][_0x5fc6('0x44')]({'id':0x0,'priority':_0x2fbff0[_0x5fc6('0x3f')]['length']+0x1,'app':_0x5fc6('0x45'),'appdata':_0x5fc6('0x43'),'interval':_0x5fc6('0x46')});}if(_0x2fbff0['account'][_0x5fc6('0x40')]){delete _0x2fbff0[_0x5fc6('0x36')][_0x5fc6('0x40')];}if(_0x2fbff0['account']['List']){delete _0x2fbff0['account'][_0x5fc6('0x38')];}if(_0xb38b73[_0x5fc6('0x38')][_0x5fc6('0x47')]['length']){return _0xb38b73[_0x5fc6('0x38')][_0x5fc6('0x47')][0x0];}var _0x40c115=_[_0x5fc6('0xd')](_0x2b0cf0[_0x5fc6('0x29')],{'firstName':_0x2b0cf0[_0x5fc6('0x29')][_0x5fc6('0x2f')],'ListId':_0xb38b73[_0x5fc6('0x2e')]});_0x40c115[_0x2b0cf0[_0x5fc6('0x29')][_0x5fc6('0x33')]]=_0x2b0cf0[_0x5fc6('0x29')][_0x5fc6('0x2f')];return db[_0x5fc6('0x39')][_0x5fc6('0x48')](_0x40c115);}else{throw new Error(_0x5fc6('0x49'));}})[_0x5fc6('0x23')](function(_0xbb6a08){_0x2fbff0[_0x5fc6('0x4a')]=_0xbb6a08;if(_0xbb6a08){if(!_0x2b0cf0[_0x5fc6('0x29')]['message']['messageId']){_0x2b0cf0['body'][_0x5fc6('0x17')][_0x5fc6('0x4b')]=rs[_0x5fc6('0x4c')]()+'\x20'+_0x2b0cf0[_0x5fc6('0x29')][_0x5fc6('0x17')][_0x5fc6('0x2f')];}var _0x5be264={'ContactId':_0xbb6a08['id'],'MailAccountId':_0x2b0cf0[_0x5fc6('0x36')]['id'],'inReplyTo':_0x2b0cf0[_0x5fc6('0x29')][_0x5fc6('0x17')][_0x5fc6('0x4b')],'to':_0x2b0cf0[_0x5fc6('0x29')]['message'][_0x5fc6('0x2f')],'cc':_0x2b0cf0['body'][_0x5fc6('0x17')]['cc'],'subject':_0x2b0cf0[_0x5fc6('0x29')][_0x5fc6('0x17')][_0x5fc6('0x4d')],'attach':_0x2b0cf0[_0x5fc6('0x29')][_0x5fc6('0x17')][_0x5fc6('0x4e')],'lastMsgAt':moment()[_0x5fc6('0x4f')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in','lastMsgBody':_0x2b0cf0[_0x5fc6('0x29')][_0x5fc6('0x29')]};return db[_0x5fc6('0x50')][_0x5fc6('0x25')]({'where':{'closed':![],'MailAccountId':_0x2b0cf0[_0x5fc6('0x36')]['id']},'include':[{'model':db['MailMessage'],'as':'Messages','attributes':[_0x5fc6('0x4b')],'where':{'messageId':_0x2b0cf0['body'][_0x5fc6('0x17')][_0x5fc6('0x51')]}}]})[_0x5fc6('0x23')](function(_0x11ed18){if(_0x11ed18){return[_0x11ed18,![]];}return db[_0x5fc6('0x50')][_0x5fc6('0x48')](_0x5be264)[_0x5fc6('0x23')](function(_0x293216){return[_0x293216,!![]];});});}else{throw new Error(_0x5fc6('0x52'));}})[_0x5fc6('0x53')](function(_0x41e0c6,_0xcdd4c1){if(_0x41e0c6){_0x942444=_0xcdd4c1;if(!_0xcdd4c1){return _0x41e0c6[_0x5fc6('0x54')]({'inReplyTo':_0x2b0cf0[_0x5fc6('0x29')][_0x5fc6('0x17')]['messageId'],'to':_0x2b0cf0['body'][_0x5fc6('0x17')][_0x5fc6('0x2f')],'cc':_0x2b0cf0['body'][_0x5fc6('0x17')]['cc'],'subject':_0x2b0cf0['body'][_0x5fc6('0x17')][_0x5fc6('0x4d')],'attach':_0x41e0c6[_0x5fc6('0x4e')]?_0x41e0c6['attach']:_0x2b0cf0[_0x5fc6('0x29')]['message'][_0x5fc6('0x4e')],'substatus':null,'substatusAt':moment()[_0x5fc6('0x4f')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()[_0x5fc6('0x4f')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in','lastMsgBody':_0x2b0cf0[_0x5fc6('0x29')][_0x5fc6('0x29')]});}else{return _0x41e0c6;}}})[_0x5fc6('0x23')](function(_0x2b90d6){_0x2fbff0[_0x5fc6('0x55')]=_0x2b90d6[_0x5fc6('0x3e')]({'plain':!![]});_0x2fbff0[_0x5fc6('0x55')][_0x5fc6('0x56')]=_0x942444;return db[_0x5fc6('0x57')][_0x5fc6('0x48')]({'body':_0x2b0cf0['body'][_0x5fc6('0x29')],'MailAccountId':_0x2b0cf0['account']['id'],'MailInteractionId':_0x2b90d6['id'],'direction':'in','ContactId':_0x2fbff0['contact']['id'],'messageId':_0x2b0cf0['body'][_0x5fc6('0x17')][_0x5fc6('0x4b')],'from':_0x2b0cf0[_0x5fc6('0x29')][_0x5fc6('0x17')][_0x5fc6('0x2f')],'to':_0x2b0cf0['body'][_0x5fc6('0x17')]['to'],'cc':_0x2b0cf0[_0x5fc6('0x29')]['message']['cc'],'subject':_0x2b0cf0['body'][_0x5fc6('0x17')][_0x5fc6('0x4d')],'attach':_0x2b0cf0[_0x5fc6('0x29')]['message']['attach'],'Attachments':_0x2b0cf0[_0x5fc6('0x29')][_0x5fc6('0x17')][_0x5fc6('0x58')],'originTo':_0x2b0cf0[_0x5fc6('0x29')][_0x5fc6('0x17')][_0x5fc6('0x59')],'originCc':_0x2b0cf0[_0x5fc6('0x29')][_0x5fc6('0x17')][_0x5fc6('0x5a')],'bcc':_0x2b0cf0[_0x5fc6('0x29')]['message'][_0x5fc6('0x5b')]},{'include':[{'model':db[_0x5fc6('0x5c')],'as':_0x5fc6('0x5d')}]});})[_0x5fc6('0x23')](function(_0x5863cb){_0x2fbff0[_0x5fc6('0x17')]=_0x5863cb;if(_0x2fbff0['interaction'][_0x5fc6('0x5e')]){return db[_0x5fc6('0x5f')][_0x5fc6('0x25')]({'attributes':['id','name'],'where':{'id':_0x2fbff0[_0x5fc6('0x55')][_0x5fc6('0x5e')]}})[_0x5fc6('0x23')](function(_0x392583){if(_0x392583){_0x2fbff0[_0x5fc6('0x3f')]['unshift']({'id':0x0,'priority':0x0,'app':_0x5fc6('0x60'),'appdata':_0x392583[_0x5fc6('0x61')]+','+(_0x2fbff0[_0x5fc6('0x36')]['waitForTheAssignedAgent']||0xa),'interval':_0x5fc6('0x46')});}return respondWithRpcPromise(_0x5fc6('0x62'),_0x5fc6('0x63'),_0x2fbff0);});}return respondWithRpcPromise(_0x5fc6('0x62'),_0x5fc6('0x63'),_0x2fbff0);})[_0x5fc6('0x23')](function(_0x2c31d8){_0x5ea30f(_0x2c31d8);})['catch'](function(_0x255504){_0x19f951(_0x14866d[_0x5fc6('0x16')](0x1f4,_0x255504[_0x5fc6('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 5d04d38..4ce4e5c 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 _0x1354=['save','remove','update','removeListener','length','./mailAccount.events'];(function(_0x26aee4,_0x530ead){var _0x2e1048=function(_0x2e92db){while(--_0x2e92db){_0x26aee4['push'](_0x26aee4['shift']());}};_0x2e1048(++_0x530ead);}(_0x1354,0x95));var _0x4135=function(_0x4fe496,_0x1d8673){_0x4fe496=_0x4fe496-0x0;var _0x422b24=_0x1354[_0x4fe496];return _0x422b24;};'use strict';var MailAccountEvents=require(_0x4135('0x0'));var events=[_0x4135('0x1'),_0x4135('0x2'),_0x4135('0x3')];function createListener(_0x41c8f3,_0x435d5e){return function(_0x102fec){_0x435d5e['emit'](_0x41c8f3,_0x102fec);};}function removeListener(_0x2c75a3,_0x4ed434){return function(){MailAccountEvents[_0x4135('0x4')](_0x2c75a3,_0x4ed434);};}exports['register']=function(_0x14ff47){for(var _0x2bcd68=0x0,_0x5e355d=events[_0x4135('0x5')];_0x2bcd68<_0x5e355d;_0x2bcd68++){var _0x1dcce0=events[_0x2bcd68];var _0x3e7ae3=createListener('mailAccount:'+_0x1dcce0,_0x14ff47);MailAccountEvents['on'](_0x1dcce0,_0x3e7ae3);}}; \ No newline at end of file +var _0x3148=['save','update','removeListener','register','mailAccount:','./mailAccount.events'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x3148,0x1d3));var _0x8314=function(_0x18655b,_0xbf5752){_0x18655b=_0x18655b-0x0;var _0x56477e=_0x3148[_0x18655b];return _0x56477e;};'use strict';var MailAccountEvents=require(_0x8314('0x0'));var events=[_0x8314('0x1'),'remove',_0x8314('0x2')];function createListener(_0xf80bf9,_0x1b13ca){return function(_0x63760b){_0x1b13ca['emit'](_0xf80bf9,_0x63760b);};}function removeListener(_0x35ee55,_0x41e9fd){return function(){MailAccountEvents[_0x8314('0x3')](_0x35ee55,_0x41e9fd);};}exports[_0x8314('0x4')]=function(_0x18a30b){for(var _0x9cb271=0x0,_0x1bd913=events['length'];_0x9cb271<_0x1bd913;_0x9cb271++){var _0x837c1f=events[_0x9cb271];var _0x4df2b0=createListener(_0x8314('0x5')+_0x837c1f,_0x18a30b);MailAccountEvents['on'](_0x837c1f,_0x4df2b0);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 8727c0c..e12f39c 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 _0x2f68=['util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./mailApplication.controller','/:id','isAuthenticated','delete','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2f68,0x9a));var _0x82f6=function(_0x16302e,_0x55ce6a){_0x16302e=_0x16302e-0x0;var _0x3c440a=_0x2f68[_0x16302e];return _0x3c440a;};'use strict';var multer=require('multer');var util=require(_0x82f6('0x0'));var path=require(_0x82f6('0x1'));var timeout=require(_0x82f6('0x2'));var express=require(_0x82f6('0x3'));var router=express['Router']();var auth=require(_0x82f6('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x82f6('0x5'));var controller=require(_0x82f6('0x6'));router['get'](_0x82f6('0x7'),auth[_0x82f6('0x8')](),controller['show']);router['put'](_0x82f6('0x7'),auth['isAuthenticated'](),controller['update']);router[_0x82f6('0x9')](_0x82f6('0x7'),auth[_0x82f6('0x8')](),controller['destroy']);module[_0x82f6('0xa')]=router; \ No newline at end of file +var _0xb9a7=['Router','../../components/interaction/service','../../config/environment','./mailApplication.controller','get','/:id','isAuthenticated','show','put','delete','util'];(function(_0x2166bd,_0x188784){var _0x45df93=function(_0x132ba7){while(--_0x132ba7){_0x2166bd['push'](_0x2166bd['shift']());}};_0x45df93(++_0x188784);}(_0xb9a7,0x112));var _0x7b9a=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xb9a7[_0x46698a];return _0x356db0;};'use strict';var multer=require('multer');var util=require(_0x7b9a('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x7b9a('0x1')]();var auth=require('../../components/auth/service');var interaction=require(_0x7b9a('0x2'));var config=require(_0x7b9a('0x3'));var controller=require(_0x7b9a('0x4'));router[_0x7b9a('0x5')](_0x7b9a('0x6'),auth[_0x7b9a('0x7')](),controller[_0x7b9a('0x8')]);router[_0x7b9a('0x9')](_0x7b9a('0x6'),auth[_0x7b9a('0x7')](),controller['update']);router[_0x7b9a('0xa')](_0x7b9a('0x6'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 2639c92..dd9074e 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 _0xa16c=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0xa16c,0x121));var _0xca16=function(_0x449c15,_0x54d69c){_0x449c15=_0x449c15-0x0;var _0x274bcc=_0xa16c[_0x449c15];return _0x274bcc;};'use strict';var Sequelize=require(_0xca16('0x0'));module[_0xca16('0x1')]={'priority':{'type':Sequelize[_0xca16('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xca16('0x3')],'allowNull':![],'defaultValue':_0xca16('0x4')},'appdata':{'type':Sequelize[_0xca16('0x5')]()},'description':{'type':Sequelize[_0xca16('0x3')]},'interval':{'type':Sequelize[_0xca16('0x3')],'defaultValue':_0xca16('0x6')}}; \ No newline at end of file +var _0x3e0a=['STRING','*,*,*,*','sequelize','exports','INTEGER','noop','TEXT'];(function(_0x267f04,_0x18005d){var _0x324621=function(_0x3ef6a9){while(--_0x3ef6a9){_0x267f04['push'](_0x267f04['shift']());}};_0x324621(++_0x18005d);}(_0x3e0a,0xb1));var _0xa3e0=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0x3e0a[_0x36c5b0];return _0xf19333;};'use strict';var Sequelize=require(_0xa3e0('0x0'));module[_0xa3e0('0x1')]={'priority':{'type':Sequelize[_0xa3e0('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xa3e0('0x3')},'appdata':{'type':Sequelize[_0xa3e0('0x4')]()},'description':{'type':Sequelize[_0xa3e0('0x5')]},'interval':{'type':Sequelize[_0xa3e0('0x5')],'defaultValue':_0xa3e0('0x6')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 878b9b3..cfbd93d 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 _0xd333=['bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','stack','name','send','show','params','model','keys','rawAttributes','query','filters','attributes','fields','include','merge','options','catch','body','find','rimraf','zip-dir','request-promise'];(function(_0x417d17,_0x17bb4f){var _0x3224ac=function(_0x4f96d4){while(--_0x4f96d4){_0x417d17['push'](_0x417d17['shift']());}};_0x3224ac(++_0x17bb4f);}(_0xd333,0x106));var _0x3d33=function(_0x1bd68f,_0x2897c0){_0x1bd68f=_0x1bd68f-0x0;var _0x34889f=_0xd333[_0x1bd68f];return _0x34889f;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x3d33('0x0'));var zipdir=require(_0x3d33('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3d33('0x2'));var moment=require('moment');var BPromise=require(_0x3d33('0x3'));var Mustache=require(_0x3d33('0x4'));var util=require(_0x3d33('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x3d33('0x6'));var ejs=require(_0x3d33('0x7'));var fs=require('fs');var _=require(_0x3d33('0x8'));var squel=require(_0x3d33('0x9'));var crypto=require(_0x3d33('0xa'));var jsforce=require(_0x3d33('0xb'));var deskjs=require(_0x3d33('0xc'));var toCsv=require(_0x3d33('0x6'));var querystring=require(_0x3d33('0xd'));var Papa=require(_0x3d33('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3d33('0xf'));var hardwareService=require(_0x3d33('0x10'));var logger=require('../../config/logger')(_0x3d33('0x11'));var utils=require(_0x3d33('0x12'));var config=require(_0x3d33('0x13'));var db=require(_0x3d33('0x14'))['db'];function respondWithStatusCode(_0x3645d1,_0x479e45){_0x479e45=_0x479e45||0xcc;return function(_0x411f8d){if(_0x411f8d){return _0x3645d1[_0x3d33('0x15')](_0x479e45);}return _0x3645d1['status'](_0x479e45)[_0x3d33('0x16')]();};}function respondWithResult(_0x25aeba,_0xa084de){_0xa084de=_0xa084de||0xc8;return function(_0x4e25e5){if(_0x4e25e5){return _0x25aeba[_0x3d33('0x17')](_0xa084de)[_0x3d33('0x18')](_0x4e25e5);}};}function respondWithFilteredResult(_0x3569b7,_0x214369){return function(_0x34aa50){if(_0x34aa50){var _0x499921=_0x34aa50[_0x3d33('0x19')],_0x3d82d0=_0x214369[_0x3d33('0x1a')],_0x1ea80e=_0x214369[_0x3d33('0x1a')]+_0x214369[_0x3d33('0x1b')],_0x5ed840;if(_0x1ea80e>=_0x499921){_0x1ea80e=_0x499921;_0x5ed840=0xc8;}else{_0x5ed840=0xce;}_0x3569b7['status'](_0x5ed840);return _0x3569b7[_0x3d33('0x1c')](_0x3d33('0x1d'),_0x3d82d0+'-'+_0x1ea80e+'/'+_0x499921)[_0x3d33('0x18')](_0x34aa50);}return null;};}function patchUpdates(_0x480ab4){return function(_0x672baa){try{jsonpatch['apply'](_0x672baa,_0x480ab4,!![]);}catch(_0x31c70d){return BPromise[_0x3d33('0x1e')](_0x31c70d);}return _0x672baa[_0x3d33('0x1f')]();};}function saveUpdates(_0x50eca7,_0x5941e6){return function(_0x859aa2){if(_0x859aa2){return _0x859aa2['update'](_0x50eca7)[_0x3d33('0x20')](function(_0xe3cf6f){return _0xe3cf6f;});}return null;};}function removeEntity(_0x55c33d,_0x358af4){return function(_0x33c21e){if(_0x33c21e){return _0x33c21e[_0x3d33('0x21')]()[_0x3d33('0x20')](function(){_0x55c33d[_0x3d33('0x17')](0xcc)[_0x3d33('0x16')]();});}};}function handleEntityNotFound(_0x16bca2,_0x55f502){return function(_0x147474){if(!_0x147474){_0x16bca2[_0x3d33('0x15')](0x194);}return _0x147474;};}function handleError(_0x1d0e53,_0x5ab18c){_0x5ab18c=_0x5ab18c||0x1f4;return function(_0x5b5de5){logger[_0x3d33('0x22')](_0x5b5de5[_0x3d33('0x23')]);if(_0x5b5de5[_0x3d33('0x24')]){delete _0x5b5de5[_0x3d33('0x24')];}_0x1d0e53[_0x3d33('0x17')](_0x5ab18c)[_0x3d33('0x25')](_0x5b5de5);};}exports[_0x3d33('0x26')]=function(_0x51ed5a,_0x10e361){var _0x500f62={'raw':!![],'where':{'id':_0x51ed5a[_0x3d33('0x27')]['id']}},_0x1b38a5={};_0x1b38a5[_0x3d33('0x28')]=_[_0x3d33('0x29')](db['MailApplication'][_0x3d33('0x2a')]);_0x1b38a5[_0x3d33('0x2b')]=_[_0x3d33('0x29')](_0x51ed5a['query']);_0x1b38a5[_0x3d33('0x2c')]=_['intersection'](_0x1b38a5[_0x3d33('0x28')],_0x1b38a5['query']);_0x500f62[_0x3d33('0x2d')]=_['intersection'](_0x1b38a5[_0x3d33('0x28')],qs[_0x3d33('0x2e')](_0x51ed5a[_0x3d33('0x2b')][_0x3d33('0x2e')]));_0x500f62[_0x3d33('0x2d')]=_0x500f62[_0x3d33('0x2d')]['length']?_0x500f62[_0x3d33('0x2d')]:_0x1b38a5['model'];if(_0x51ed5a[_0x3d33('0x2b')]['includeAll']){_0x500f62[_0x3d33('0x2f')]=[{'all':!![]}];}_0x500f62=_[_0x3d33('0x30')]({},_0x500f62,_0x51ed5a[_0x3d33('0x31')]);return db['MailApplication']['find'](_0x500f62)[_0x3d33('0x20')](handleEntityNotFound(_0x10e361,null))[_0x3d33('0x20')](respondWithResult(_0x10e361,null))[_0x3d33('0x32')](handleError(_0x10e361,null));};exports['update']=function(_0x54afb9,_0x706f5e){if(_0x54afb9[_0x3d33('0x33')]['id']){delete _0x54afb9[_0x3d33('0x33')]['id'];}return db['MailApplication']['find']({'where':{'id':_0x54afb9[_0x3d33('0x27')]['id']}})[_0x3d33('0x20')](handleEntityNotFound(_0x706f5e,null))[_0x3d33('0x20')](saveUpdates(_0x54afb9[_0x3d33('0x33')],null))[_0x3d33('0x20')](respondWithResult(_0x706f5e,null))[_0x3d33('0x32')](handleError(_0x706f5e,null));};exports[_0x3d33('0x21')]=function(_0x479b9b,_0x32431b){return db['MailApplication'][_0x3d33('0x34')]({'where':{'id':_0x479b9b[_0x3d33('0x27')]['id']}})[_0x3d33('0x20')](handleEntityNotFound(_0x32431b,null))['then'](removeEntity(_0x32431b,null))[_0x3d33('0x32')](handleError(_0x32431b,null));}; \ No newline at end of file +var _0x56a9=['desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','limit','set','then','destroy','end','error','stack','name','model','MailApplication','rawAttributes','query','keys','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','catch','update','body','params','html-pdf','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce'];(function(_0x12312b,_0x22b892){var _0x3ca924=function(_0x47c7b5){while(--_0x47c7b5){_0x12312b['push'](_0x12312b['shift']());}};_0x3ca924(++_0x22b892);}(_0x56a9,0x1b9));var _0x956a=function(_0x19f9e6,_0x4f59a6){_0x19f9e6=_0x19f9e6-0x0;var _0x45c862=_0x56a9[_0x19f9e6];return _0x45c862;};'use strict';var pdf=require(_0x956a('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x956a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x956a('0x2'));var rp=require(_0x956a('0x3'));var moment=require('moment');var BPromise=require(_0x956a('0x4'));var Mustache=require(_0x956a('0x5'));var util=require(_0x956a('0x6'));var path=require(_0x956a('0x7'));var sox=require(_0x956a('0x8'));var csv=require(_0x956a('0x9'));var ejs=require(_0x956a('0xa'));var fs=require('fs');var _=require(_0x956a('0xb'));var squel=require(_0x956a('0xc'));var crypto=require(_0x956a('0xd'));var jsforce=require(_0x956a('0xe'));var deskjs=require(_0x956a('0xf'));var toCsv=require('to-csv');var querystring=require(_0x956a('0x10'));var Papa=require('papaparse');var Redis=require(_0x956a('0x11'));var authService=require(_0x956a('0x12'));var qs=require(_0x956a('0x13'));var as=require(_0x956a('0x14'));var hardwareService=require(_0x956a('0x15'));var logger=require(_0x956a('0x16'))(_0x956a('0x17'));var utils=require(_0x956a('0x18'));var config=require(_0x956a('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x461508,_0x22ed42){_0x22ed42=_0x22ed42||0xcc;return function(_0x23d873){if(_0x23d873){return _0x461508[_0x956a('0x1a')](_0x22ed42);}return _0x461508[_0x956a('0x1b')](_0x22ed42)['end']();};}function respondWithResult(_0x35a824,_0x52948a){_0x52948a=_0x52948a||0xc8;return function(_0x3e8d3a){if(_0x3e8d3a){return _0x35a824['status'](_0x52948a)[_0x956a('0x1c')](_0x3e8d3a);}};}function respondWithFilteredResult(_0x89a5bb,_0x18380d){return function(_0x55231d){if(_0x55231d){var _0x21790d=_0x55231d['count'],_0xcbcc47=_0x18380d[_0x956a('0x1d')],_0x1906e7=_0x18380d['offset']+_0x18380d[_0x956a('0x1e')],_0x55f704;if(_0x1906e7>=_0x21790d){_0x1906e7=_0x21790d;_0x55f704=0xc8;}else{_0x55f704=0xce;}_0x89a5bb[_0x956a('0x1b')](_0x55f704);return _0x89a5bb[_0x956a('0x1f')]('Content-Range',_0xcbcc47+'-'+_0x1906e7+'/'+_0x21790d)['json'](_0x55231d);}return null;};}function patchUpdates(_0x29dda2){return function(_0x454671){try{jsonpatch['apply'](_0x454671,_0x29dda2,!![]);}catch(_0x484203){return BPromise['reject'](_0x484203);}return _0x454671['save']();};}function saveUpdates(_0x14a631,_0x18e7e5){return function(_0x2d859c){if(_0x2d859c){return _0x2d859c['update'](_0x14a631)[_0x956a('0x20')](function(_0x4faac7){return _0x4faac7;});}return null;};}function removeEntity(_0x52c062,_0x115bd5){return function(_0x48b354){if(_0x48b354){return _0x48b354[_0x956a('0x21')]()['then'](function(){_0x52c062['status'](0xcc)[_0x956a('0x22')]();});}};}function handleEntityNotFound(_0x33022e,_0x80fa02){return function(_0x15389e){if(!_0x15389e){_0x33022e[_0x956a('0x1a')](0x194);}return _0x15389e;};}function handleError(_0x5de68,_0x122f52){_0x122f52=_0x122f52||0x1f4;return function(_0x38681d){logger[_0x956a('0x23')](_0x38681d[_0x956a('0x24')]);if(_0x38681d[_0x956a('0x25')]){delete _0x38681d[_0x956a('0x25')];}_0x5de68['status'](_0x122f52)['send'](_0x38681d);};}exports['show']=function(_0x5bf2a4,_0x2dd1af){var _0x1aceb9={'raw':!![],'where':{'id':_0x5bf2a4['params']['id']}},_0x57d248={};_0x57d248[_0x956a('0x26')]=_['keys'](db[_0x956a('0x27')][_0x956a('0x28')]);_0x57d248[_0x956a('0x29')]=_[_0x956a('0x2a')](_0x5bf2a4[_0x956a('0x29')]);_0x57d248[_0x956a('0x2b')]=_[_0x956a('0x2c')](_0x57d248[_0x956a('0x26')],_0x57d248[_0x956a('0x29')]);_0x1aceb9[_0x956a('0x2d')]=_[_0x956a('0x2c')](_0x57d248[_0x956a('0x26')],qs[_0x956a('0x2e')](_0x5bf2a4[_0x956a('0x29')][_0x956a('0x2e')]));_0x1aceb9['attributes']=_0x1aceb9[_0x956a('0x2d')][_0x956a('0x2f')]?_0x1aceb9[_0x956a('0x2d')]:_0x57d248['model'];if(_0x5bf2a4[_0x956a('0x29')][_0x956a('0x30')]){_0x1aceb9[_0x956a('0x31')]=[{'all':!![]}];}_0x1aceb9=_[_0x956a('0x32')]({},_0x1aceb9,_0x5bf2a4[_0x956a('0x33')]);return db[_0x956a('0x27')][_0x956a('0x34')](_0x1aceb9)[_0x956a('0x20')](handleEntityNotFound(_0x2dd1af,null))[_0x956a('0x20')](respondWithResult(_0x2dd1af,null))[_0x956a('0x35')](handleError(_0x2dd1af,null));};exports[_0x956a('0x36')]=function(_0x4edeb0,_0x104818){if(_0x4edeb0[_0x956a('0x37')]['id']){delete _0x4edeb0[_0x956a('0x37')]['id'];}return db['MailApplication'][_0x956a('0x34')]({'where':{'id':_0x4edeb0[_0x956a('0x38')]['id']}})[_0x956a('0x20')](handleEntityNotFound(_0x104818,null))[_0x956a('0x20')](saveUpdates(_0x4edeb0[_0x956a('0x37')],null))[_0x956a('0x20')](respondWithResult(_0x104818,null))[_0x956a('0x35')](handleError(_0x104818,null));};exports[_0x956a('0x21')]=function(_0x3b01f4,_0x5abf2d){return db[_0x956a('0x27')][_0x956a('0x34')]({'where':{'id':_0x3b01f4['params']['id']}})[_0x956a('0x20')](handleEntityNotFound(_0x5abf2d,null))[_0x956a('0x20')](removeEntity(_0x5abf2d,null))[_0x956a('0x35')](handleError(_0x5abf2d,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 4089c36..689e544 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 _0xc0d7=['request-promise','path','rimraf','../../config/environment','./mailApplication.attributes','exports','define','MailApplication','mail_applications','utf8mb4_unicode_ci','api','moment','bluebird'];(function(_0x30a6d6,_0x603c35){var _0x361ea1=function(_0x4d35a7){while(--_0x4d35a7){_0x30a6d6['push'](_0x30a6d6['shift']());}};_0x361ea1(++_0x603c35);}(_0xc0d7,0x7f));var _0x7c0d=function(_0x35dcf6,_0x5376a9){_0x35dcf6=_0x35dcf6-0x0;var _0x53837c=_0xc0d7[_0x35dcf6];return _0x53837c;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x7c0d('0x0'));var moment=require(_0x7c0d('0x1'));var BPromise=require(_0x7c0d('0x2'));var rp=require(_0x7c0d('0x3'));var fs=require('fs');var path=require(_0x7c0d('0x4'));var rimraf=require(_0x7c0d('0x5'));var config=require(_0x7c0d('0x6'));var attributes=require(_0x7c0d('0x7'));module[_0x7c0d('0x8')]=function(_0x5a6a70,_0x507bc0){return _0x5a6a70[_0x7c0d('0x9')](_0x7c0d('0xa'),attributes,{'tableName':_0x7c0d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x7c0d('0xc')});}; \ No newline at end of file +var _0x6db4=['../../config/environment','./mailApplication.attributes','exports','define','mail_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0xc9c44a,_0xc2cc18){var _0x187c08=function(_0x2d5870){while(--_0x2d5870){_0xc9c44a['push'](_0xc9c44a['shift']());}};_0x187c08(++_0xc2cc18);}(_0x6db4,0x111));var _0x46db=function(_0x2b5c37,_0x57c1a3){_0x2b5c37=_0x2b5c37-0x0;var _0x1c3ec0=_0x6db4[_0x2b5c37];return _0x1c3ec0;};'use strict';var _=require('lodash');var util=require(_0x46db('0x0'));var logger=require(_0x46db('0x1'))(_0x46db('0x2'));var moment=require(_0x46db('0x3'));var BPromise=require(_0x46db('0x4'));var rp=require(_0x46db('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x46db('0x6'));var config=require(_0x46db('0x7'));var attributes=require(_0x46db('0x8'));module[_0x46db('0x9')]=function(_0x331e67,_0x2abfd4){return _0x331e67[_0x46db('0xa')]('MailApplication',attributes,{'tableName':_0x46db('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x46db('0xc'),'collate':_0x46db('0xd')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 943e6a5..d418240 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 _0xbb62=['moment','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateMailApplication','MailApplication','update','body','options','raw','attributes','limit','lodash','util'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xbb62,0x191));var _0x2bb6=function(_0x1a8f86,_0x5ed9c4){_0x1a8f86=_0x1a8f86-0x0;var _0x20d876=_0xbb62[_0x1a8f86];return _0x20d876;};'use strict';var _=require(_0x2bb6('0x0'));var util=require(_0x2bb6('0x1'));var moment=require(_0x2bb6('0x2'));var BPromise=require('bluebird');var rs=require(_0x2bb6('0x3'));var fs=require('fs');var Redis=require(_0x2bb6('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2bb6('0x5'))('rpc');var config=require(_0x2bb6('0x6'));var jayson=require(_0x2bb6('0x7'));var client=jayson[_0x2bb6('0x8')][_0x2bb6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5756c9,_0x284589,_0x29fe0a){return new BPromise(function(_0x38964f,_0x2ef70c){return client[_0x2bb6('0xa')](_0x5756c9,_0x29fe0a)[_0x2bb6('0xb')](function(_0x116f19){logger[_0x2bb6('0xc')](_0x2bb6('0xd'),_0x284589,_0x2bb6('0xe'));logger[_0x2bb6('0xf')](_0x2bb6('0x10'),_0x284589,'request\x20sent',JSON[_0x2bb6('0x11')](_0x116f19));if(_0x116f19[_0x2bb6('0x12')]){if(_0x116f19[_0x2bb6('0x12')][_0x2bb6('0x13')]===0x1f4){logger[_0x2bb6('0x12')]('MailApplication,\x20%s,\x20%s',_0x284589,_0x116f19[_0x2bb6('0x12')][_0x2bb6('0x14')]);return _0x2ef70c(_0x116f19[_0x2bb6('0x12')][_0x2bb6('0x14')]);}logger[_0x2bb6('0x12')](_0x2bb6('0xd'),_0x284589,_0x116f19[_0x2bb6('0x12')][_0x2bb6('0x14')]);return _0x38964f(_0x116f19[_0x2bb6('0x12')]['message']);}else{logger[_0x2bb6('0xc')](_0x2bb6('0xd'),_0x284589,_0x2bb6('0xe'));_0x38964f(_0x116f19[_0x2bb6('0x15')][_0x2bb6('0x14')]);}})[_0x2bb6('0x16')](function(_0x4702be){logger[_0x2bb6('0x12')](_0x2bb6('0xd'),_0x284589,_0x4702be);_0x2ef70c(_0x4702be);});});}exports[_0x2bb6('0x17')]=function(_0x2549d3){var _0x26bc7a=this;return new Promise(function(_0x3c2910,_0x423522){return db[_0x2bb6('0x18')][_0x2bb6('0x19')](_0x2549d3[_0x2bb6('0x1a')],{'raw':_0x2549d3['options']?_0x2549d3[_0x2bb6('0x1b')][_0x2bb6('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2549d3[_0x2bb6('0x1b')]?_0x2549d3['options']['where']||null:null,'attributes':_0x2549d3[_0x2bb6('0x1b')]?_0x2549d3[_0x2bb6('0x1b')][_0x2bb6('0x1d')]||null:null,'limit':_0x2549d3[_0x2bb6('0x1b')]?_0x2549d3[_0x2bb6('0x1b')][_0x2bb6('0x1e')]||null:null})[_0x2bb6('0xb')](function(_0x2964d1){logger[_0x2bb6('0xc')](_0x2bb6('0x17'),_0x2549d3);logger[_0x2bb6('0xf')](_0x2bb6('0x17'),_0x2549d3,JSON[_0x2bb6('0x11')](_0x2964d1));_0x3c2910(_0x2964d1);})['catch'](function(_0x19293e){logger['error'](_0x2bb6('0x17'),_0x19293e['message'],_0x2549d3);_0x423522(_0x26bc7a[_0x2bb6('0x12')](0x1f4,_0x19293e[_0x2bb6('0x14')]));});});}; \ No newline at end of file +var _0xf1ce=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateMailApplication','MailApplication','body','options','where','attributes','limit','util'];(function(_0x4c373b,_0x3f81f3){var _0x24f04a=function(_0x245e33){while(--_0x245e33){_0x4c373b['push'](_0x4c373b['shift']());}};_0x24f04a(++_0x3f81f3);}(_0xf1ce,0x1b2));var _0xef1c=function(_0x3bef71,_0x5590cc){_0x3bef71=_0x3bef71-0x0;var _0x139496=_0xf1ce[_0x3bef71];return _0x139496;};'use strict';var _=require('lodash');var util=require(_0xef1c('0x0'));var moment=require('moment');var BPromise=require(_0xef1c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xef1c('0x2'));var db=require(_0xef1c('0x3'))['db'];var utils=require(_0xef1c('0x4'));var logger=require(_0xef1c('0x5'))('rpc');var config=require(_0xef1c('0x6'));var jayson=require(_0xef1c('0x7'));var client=jayson[_0xef1c('0x8')][_0xef1c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x248148,_0x5a90d0,_0x1a96a3){return new BPromise(function(_0xa05920,_0x4bf6c2){return client[_0xef1c('0xa')](_0x248148,_0x1a96a3)[_0xef1c('0xb')](function(_0x3cb830){logger[_0xef1c('0xc')](_0xef1c('0xd'),_0x5a90d0,_0xef1c('0xe'));logger['debug'](_0xef1c('0xf'),_0x5a90d0,_0xef1c('0xe'),JSON[_0xef1c('0x10')](_0x3cb830));if(_0x3cb830[_0xef1c('0x11')]){if(_0x3cb830['error'][_0xef1c('0x12')]===0x1f4){logger[_0xef1c('0x11')]('MailApplication,\x20%s,\x20%s',_0x5a90d0,_0x3cb830[_0xef1c('0x11')][_0xef1c('0x13')]);return _0x4bf6c2(_0x3cb830[_0xef1c('0x11')][_0xef1c('0x13')]);}logger[_0xef1c('0x11')](_0xef1c('0xd'),_0x5a90d0,_0x3cb830[_0xef1c('0x11')][_0xef1c('0x13')]);return _0xa05920(_0x3cb830['error'][_0xef1c('0x13')]);}else{logger[_0xef1c('0xc')](_0xef1c('0xd'),_0x5a90d0,'request\x20sent');_0xa05920(_0x3cb830[_0xef1c('0x14')][_0xef1c('0x13')]);}})[_0xef1c('0x15')](function(_0x2b255d){logger[_0xef1c('0x11')]('MailApplication,\x20%s,\x20%s',_0x5a90d0,_0x2b255d);_0x4bf6c2(_0x2b255d);});});}exports[_0xef1c('0x16')]=function(_0x501b77){var _0x4a06ca=this;return new Promise(function(_0x5092d2,_0x579eae){return db[_0xef1c('0x17')]['update'](_0x501b77[_0xef1c('0x18')],{'raw':_0x501b77[_0xef1c('0x19')]?_0x501b77['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x501b77['options']?_0x501b77[_0xef1c('0x19')][_0xef1c('0x1a')]||null:null,'attributes':_0x501b77[_0xef1c('0x19')]?_0x501b77['options'][_0xef1c('0x1b')]||null:null,'limit':_0x501b77[_0xef1c('0x19')]?_0x501b77[_0xef1c('0x19')][_0xef1c('0x1c')]||null:null})[_0xef1c('0xb')](function(_0x22f978){logger[_0xef1c('0xc')](_0xef1c('0x16'),_0x501b77);logger['debug']('UpdateMailApplication',_0x501b77,JSON['stringify'](_0x22f978));_0x5092d2(_0x22f978);})['catch'](function(_0x128065){logger[_0xef1c('0x11')](_0xef1c('0x16'),_0x128065[_0xef1c('0x13')],_0x501b77);_0x579eae(_0x4a06ca[_0xef1c('0x11')](0x1f4,_0x128065['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index eeb4a4a..6b4b00c 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 _0xdbce=['isAuthenticated','index','/describe','describe','show','/:id/messages','getMessages','/:id/download','download','post','create','tracked','mail','mailinteraction:addtags','addTags','/:id','mailinteraction:update','update','mailinteraction:destroy','/:id/tags','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','get'];(function(_0x1df6b9,_0x270fd4){var _0x104522=function(_0x48aa52){while(--_0x48aa52){_0x1df6b9['push'](_0x1df6b9['shift']());}};_0x104522(++_0x270fd4);}(_0xdbce,0x1f1));var _0xedbc=function(_0x110782,_0x3a0236){_0x110782=_0x110782-0x0;var _0x20d9d1=_0xdbce[_0x110782];return _0x20d9d1;};'use strict';var multer=require(_0xedbc('0x0'));var util=require('util');var path=require(_0xedbc('0x1'));var timeout=require('connect-timeout');var express=require(_0xedbc('0x2'));var router=express[_0xedbc('0x3')]();var auth=require(_0xedbc('0x4'));var interaction=require(_0xedbc('0x5'));var config=require('../../config/environment');var controller=require('./mailInteraction.controller');router[_0xedbc('0x6')]('/',auth[_0xedbc('0x7')](),controller[_0xedbc('0x8')]);router[_0xedbc('0x6')](_0xedbc('0x9'),auth[_0xedbc('0x7')](),controller[_0xedbc('0xa')]);router[_0xedbc('0x6')]('/:id',auth[_0xedbc('0x7')](),controller[_0xedbc('0xb')]);router[_0xedbc('0x6')](_0xedbc('0xc'),auth[_0xedbc('0x7')](),controller[_0xedbc('0xd')]);router[_0xedbc('0x6')](_0xedbc('0xe'),auth[_0xedbc('0x7')](),controller[_0xedbc('0xf')]);router[_0xedbc('0x10')]('/',auth[_0xedbc('0x7')](),controller[_0xedbc('0x11')]);router[_0xedbc('0x10')](_0xedbc('0xc'),auth[_0xedbc('0x7')](),controller['addMessage']);router['post']('/:id/tags',auth[_0xedbc('0x7')](),interaction[_0xedbc('0x12')](_0xedbc('0x13'),_0xedbc('0x14')),controller[_0xedbc('0x15')]);router['put'](_0xedbc('0x16'),auth[_0xedbc('0x7')](),interaction[_0xedbc('0x12')](_0xedbc('0x13'),_0xedbc('0x17')),controller[_0xedbc('0x18')]);router['delete'](_0xedbc('0x16'),auth[_0xedbc('0x7')](),interaction[_0xedbc('0x12')](_0xedbc('0x13'),_0xedbc('0x19')),controller['destroy']);router['delete'](_0xedbc('0x1a'),auth[_0xedbc('0x7')](),controller['removeTags']);module[_0xedbc('0x1b')]=router; \ No newline at end of file +var _0xaf79=['/describe','describe','/:id','show','/:id/messages','getMessages','download','post','create','/:id/tags','tracked','mail','mailinteraction:addtags','addTags','put','update','delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./mailInteraction.controller','get','isAuthenticated'];(function(_0xb549c2,_0x49b62e){var _0x58cf6e=function(_0x34309f){while(--_0x34309f){_0xb549c2['push'](_0xb549c2['shift']());}};_0x58cf6e(++_0x49b62e);}(_0xaf79,0x82));var _0x9af7=function(_0x3f25a6,_0x5d5d33){_0x3f25a6=_0x3f25a6-0x0;var _0x779fee=_0xaf79[_0x3f25a6];return _0x779fee;};'use strict';var multer=require('multer');var util=require(_0x9af7('0x0'));var path=require(_0x9af7('0x1'));var timeout=require(_0x9af7('0x2'));var express=require(_0x9af7('0x3'));var router=express[_0x9af7('0x4')]();var auth=require(_0x9af7('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9af7('0x6'));var controller=require(_0x9af7('0x7'));router[_0x9af7('0x8')]('/',auth[_0x9af7('0x9')](),controller['index']);router['get'](_0x9af7('0xa'),auth[_0x9af7('0x9')](),controller[_0x9af7('0xb')]);router[_0x9af7('0x8')](_0x9af7('0xc'),auth[_0x9af7('0x9')](),controller[_0x9af7('0xd')]);router[_0x9af7('0x8')](_0x9af7('0xe'),auth[_0x9af7('0x9')](),controller[_0x9af7('0xf')]);router[_0x9af7('0x8')]('/:id/download',auth[_0x9af7('0x9')](),controller[_0x9af7('0x10')]);router[_0x9af7('0x11')]('/',auth[_0x9af7('0x9')](),controller[_0x9af7('0x12')]);router[_0x9af7('0x11')](_0x9af7('0xe'),auth[_0x9af7('0x9')](),controller['addMessage']);router['post'](_0x9af7('0x13'),auth[_0x9af7('0x9')](),interaction[_0x9af7('0x14')](_0x9af7('0x15'),_0x9af7('0x16')),controller[_0x9af7('0x17')]);router[_0x9af7('0x18')]('/:id',auth['isAuthenticated'](),interaction[_0x9af7('0x14')](_0x9af7('0x15'),'mailinteraction:update'),controller[_0x9af7('0x19')]);router[_0x9af7('0x1a')](_0x9af7('0xc'),auth[_0x9af7('0x9')](),interaction[_0x9af7('0x14')](_0x9af7('0x15'),'mailinteraction:destroy'),controller['destroy']);router['delete'](_0x9af7('0x13'),auth[_0x9af7('0x9')](),controller['removeTags']);module[_0x9af7('0x1b')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 58af6ba..48d2552 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 _0x8372=['STRING','long','TEXT','ENUM','out','iconv','exports','BOOLEAN','DATE'];(function(_0x2f8bfc,_0x5b2821){var _0x5979ef=function(_0x3948e4){while(--_0x3948e4){_0x2f8bfc['push'](_0x2f8bfc['shift']());}};_0x5979ef(++_0x5b2821);}(_0x8372,0x7a));var _0x2837=function(_0x542d6d,_0x3acadd){_0x542d6d=_0x542d6d-0x0;var _0xba7f43=_0x8372[_0x542d6d];return _0xba7f43;};'use strict';var Sequelize=require('sequelize');var iconv=require(_0x2837('0x0'));module[_0x2837('0x1')]={'closed':{'type':Sequelize[_0x2837('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x2837('0x3')]},'disposition':{'type':Sequelize[_0x2837('0x4')]},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x2837('0x4')](0x1fe)},'to':{'type':Sequelize[_0x2837('0x4')]},'cc':{'type':Sequelize['TEXT'](_0x2837('0x5'))},'subject':{'type':Sequelize[_0x2837('0x6')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x2837('0x3')]},'substatus':{'type':Sequelize[_0x2837('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0x2837('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x2837('0x7')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x2837('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x2837('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize['TEXT']('long')},'lastMsgText':{'type':Sequelize['TEXT'](_0x2837('0x5'))}}; \ No newline at end of file +var _0x050d=['TEXT','long','ENUM','out','sequelize','iconv','exports','BOOLEAN','DATE','STRING'];(function(_0xfde72e,_0x3847c1){var _0x18ca84=function(_0x3d343e){while(--_0x3d343e){_0xfde72e['push'](_0xfde72e['shift']());}};_0x18ca84(++_0x3847c1);}(_0x050d,0x68));var _0xd050=function(_0x478811,_0x25cd14){_0x478811=_0x478811-0x0;var _0x4947f5=_0x050d[_0x478811];return _0x4947f5;};'use strict';var Sequelize=require(_0xd050('0x0'));var iconv=require(_0xd050('0x1'));module[_0xd050('0x2')]={'closed':{'type':Sequelize[_0xd050('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xd050('0x4')]},'disposition':{'type':Sequelize[_0xd050('0x5')]},'note':{'type':Sequelize[_0xd050('0x5')]},'inReplyTo':{'type':Sequelize[_0xd050('0x5')](0x1fe)},'to':{'type':Sequelize[_0xd050('0x5')]},'cc':{'type':Sequelize[_0xd050('0x6')](_0xd050('0x7'))},'subject':{'type':Sequelize[_0xd050('0x6')]()},'attach':{'type':Sequelize[_0xd050('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xd050('0x4')]},'substatus':{'type':Sequelize[_0xd050('0x5')](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0xd050('0x8')]('in',_0xd050('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xd050('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xd050('0x8')]('in',_0xd050('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize[_0xd050('0x6')](_0xd050('0x7'))},'lastMsgText':{'type':Sequelize['TEXT']('long')}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 286d802..5f5096c 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 _0xf27b=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','u.id','ui.MailInteractionId','user_has_mail_interactions','left_join','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','mail_accounts','mail_messages','mail_interaction_has_tags','expr','parseSearch','search','conditions','find','unreadMessages','value','having','`\x20=\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','plainBody','some','isEmpty','i.MailAccountId\x20IN\x20?','concat','createdAt','$gte','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','group','i.id','QueryTypes','SELECT','clone','DESC','t.id\x20IN\x20?','journey','i.MailAccountId\x20IS\x20NOT\x20NULL','user','getMailAccounts','i.MailAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','Account.mandatoryDisposition','i.createdAt','i.updatedAt','i.closed','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.disposition','i.ContactId','i.MailAccountId','i.UserId','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','findOne','all','rows','params','includeAll','include','options','create','body','update','describe','addMessage','MailMessage','ids','omit','getMessages','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','spread','emit','mailInteractionTags:save','removeTags','download','unix','root','server','files','tmp','join','transcript-%d-%s.zip','attachments','Attachments','Messages','bcc','get','mkdirSync','each','subject','headers','Bcc','basename','existsSync','build','message%d.eml','log','err','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','lodash','crypto','desk.js','html-to-text','ioredis','api','../../config/utils','../../mysqldb','redis','./mailInteraction.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','name','map','TagIds','Tags','split','push','MailInteraction','lastMsgBody','lastMsgText','trimStart','catch','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0xf27b,0x189));var _0xbf27=function(_0x158da6,_0x3cb06d){_0x158da6=_0x158da6-0x0;var _0x429c30=_0xf27b[_0x158da6];return _0x429c30;};'use strict';var pdf=require(_0xbf27('0x0'));var emlformat=require(_0xbf27('0x1'));var rimraf=require(_0xbf27('0x2'));var zipdir=require(_0xbf27('0x3'));var jsonpatch=require(_0xbf27('0x4'));var rp=require(_0xbf27('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xbf27('0x6'));var util=require(_0xbf27('0x7'));var path=require('path');var sox=require(_0xbf27('0x8'));var csv=require(_0xbf27('0x9'));var ejs=require(_0xbf27('0xa'));var fs=require('fs');var _=require(_0xbf27('0xb'));var squel=require('squel');var crypto=require(_0xbf27('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xbf27('0xd'));var toCsv=require(_0xbf27('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var htmlToText=require(_0xbf27('0xe'));var Redis=require(_0xbf27('0xf'));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('../../config/logger')(_0xbf27('0x10'));var utils=require(_0xbf27('0x11'));var config=require('../../config/environment');var db=require(_0xbf27('0x12'))['db'];config[_0xbf27('0x13')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbf27('0x13')]));require(_0xbf27('0x14'))[_0xbf27('0x15')](socket);function respondWithStatusCode(_0x10329d,_0xdfecf1){_0xdfecf1=_0xdfecf1||0xcc;return function(_0x41a379){if(_0x41a379){return _0x10329d[_0xbf27('0x16')](_0xdfecf1);}return _0x10329d[_0xbf27('0x17')](_0xdfecf1)[_0xbf27('0x18')]();};}function respondWithResult(_0x36b4fc,_0x44e0b6){_0x44e0b6=_0x44e0b6||0xc8;return function(_0x1c6f9e){if(_0x1c6f9e){return _0x36b4fc[_0xbf27('0x17')](_0x44e0b6)[_0xbf27('0x19')](_0x1c6f9e);}};}function respondWithFilteredResult(_0x3cc3b5,_0x119db0){return function(_0x467893){if(_0x467893){var _0x4fa1aa=_0x467893[_0xbf27('0x1a')],_0x4eadda=_0x119db0[_0xbf27('0x1b')],_0x551021=_0x119db0['offset']+_0x119db0[_0xbf27('0x1c')],_0xcec6f7;if(_0x551021>=_0x4fa1aa){_0x551021=_0x4fa1aa;_0xcec6f7=0xc8;}else{_0xcec6f7=0xce;}_0x3cc3b5['status'](_0xcec6f7);return _0x3cc3b5[_0xbf27('0x1d')](_0xbf27('0x1e'),_0x4eadda+'-'+_0x551021+'/'+_0x4fa1aa)[_0xbf27('0x19')](_0x467893);}return null;};}function patchUpdates(_0x300ce2){return function(_0x39a5f0){try{jsonpatch[_0xbf27('0x1f')](_0x39a5f0,_0x300ce2,!![]);}catch(_0x4028d0){return BPromise[_0xbf27('0x20')](_0x4028d0);}return _0x39a5f0[_0xbf27('0x21')]();};}function saveUpdates(_0x2ca3f7,_0x13e8d7){return function(_0x18426c){if(_0x18426c){return _0x18426c['update'](_0x2ca3f7)[_0xbf27('0x22')](function(_0x4fc67d){return _0x4fc67d;});}return null;};}function removeEntity(_0x4997aa,_0x2be209){return function(_0x463449){if(_0x463449){return _0x463449[_0xbf27('0x23')]()['then'](function(){_0x4997aa[_0xbf27('0x17')](0xcc)[_0xbf27('0x18')]();});}};}function handleEntityNotFound(_0x49479a,_0x5d4bbe){return function(_0x83dc48){if(!_0x83dc48){_0x49479a[_0xbf27('0x16')](0x194);}return _0x83dc48;};}function handleError(_0x2d80f9,_0xcd9a8b){_0xcd9a8b=_0xcd9a8b||0x1f4;return function(_0x4fa3fe){logger[_0xbf27('0x24')](_0x4fa3fe['stack']);if(_0x4fa3fe[_0xbf27('0x25')]){delete _0x4fa3fe[_0xbf27('0x25')];}_0x2d80f9[_0xbf27('0x17')](_0xcd9a8b)['send'](_0x4fa3fe);};}function getInteractionUsers(_0x400a39,_0x5c2ecd){return new BPromise(function(_0x16cdc8,_0x3d81b2){try{if(_0x5c2ecd[_0x400a39['id']]){_0x400a39['Users']=_[_0xbf27('0x26')](_0x5c2ecd[_0x400a39['id']],function(_0x17f624){return{'id':_0x17f624['id'],'fullname':_0x17f624['fullname']};});}}catch(_0x17cc2d){_0x3d81b2(_0x17cc2d);}_0x16cdc8(_0x400a39);});}function getInteractionTags(_0x37f053,_0x366eec){return new BPromise(function(_0x3e6ea1,_0x2cab57){try{if(_0x37f053[_0xbf27('0x27')]){_0x37f053[_0xbf27('0x28')]=[];_0x37f053[_0xbf27('0x27')][_0xbf27('0x29')](',')['forEach'](function(_0x34443a){_0x37f053[_0xbf27('0x28')][_0xbf27('0x2a')](_0x366eec[_0x34443a]);});}delete _0x37f053['TagIds'];}catch(_0x4ab029){_0x2cab57(_0x4ab029);}_0x3e6ea1(_0x37f053);});}function getLastMessageText(_0x319223){return new BPromise(function(_0x58155c,_0x254d18){return db[_0xbf27('0x2b')]['findOne']({'where':{'id':_0x319223['id']},'attributes':[_0xbf27('0x2c'),_0xbf27('0x2d')],'raw':!![]})[_0xbf27('0x22')](function(_0x4d1de1){if(!_0x4d1de1[_0xbf27('0x2d')]){_0x319223[_0xbf27('0x2d')]=_[_0xbf27('0x2e')](htmlToText['fromString'](_0x4d1de1[_0xbf27('0x2c')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]}));}else{_0x319223[_0xbf27('0x2d')]=_0x4d1de1[_0xbf27('0x2d')];}_0x58155c(_0x319223);})['catch'](function(_0x2709b3){_0x254d18(_0x2709b3);});});}function updateMailInteraction(_0x179884,_0x283f41,_0x5db8ba,_0x288574){return new BPromise(function(_0x326001,_0x1d5490){return getInteractionUsers(_0x179884,_0x5db8ba)[_0xbf27('0x22')](function(_0x3332fa){return getInteractionTags(_0x3332fa,_0x283f41);})[_0xbf27('0x22')](function(_0x3aef6e){if(_0x288574){_0x326001(getLastMessageText(_0x3aef6e));}else{_0x326001(_0x3aef6e);}})[_0xbf27('0x2f')](function(_0x2668d8){_0x1d5490(_0x2668d8);});});}exports['index']=function(_0x2f144f,_0x454aa0){var _0x3ffa09={},_0xe8d011={},_0x2e5cba={'count':0x0,'rows':[]};var _0x2fda38=_[_0xbf27('0x26')](db[_0xbf27('0x2b')][_0xbf27('0x30')],function(_0x5cbd4e){return{'name':_0x5cbd4e[_0xbf27('0x31')],'type':_0x5cbd4e[_0xbf27('0x32')][_0xbf27('0x33')]};});_0xe8d011['model']=_['map'](_0x2fda38,_0xbf27('0x25'));_0xe8d011['query']=_[_0xbf27('0x34')](_0x2f144f[_0xbf27('0x35')]);_0xe8d011[_0xbf27('0x36')]=_[_0xbf27('0x37')](_0xe8d011[_0xbf27('0x38')],_0xe8d011[_0xbf27('0x35')]);_0x3ffa09[_0xbf27('0x39')]=_[_0xbf27('0x37')](_0xe8d011['model'],qs['fields'](_0x2f144f[_0xbf27('0x35')][_0xbf27('0x3a')]));_0x3ffa09['attributes']=_0x3ffa09[_0xbf27('0x39')][_0xbf27('0x3b')]?_0x3ffa09['attributes']:_0xe8d011[_0xbf27('0x38')];if(!_0x2f144f['query'][_0xbf27('0x3c')](_0xbf27('0x3d'))){_0x3ffa09[_0xbf27('0x1c')]=qs[_0xbf27('0x1c')](_0x2f144f[_0xbf27('0x35')][_0xbf27('0x1c')]);_0x3ffa09[_0xbf27('0x1b')]=qs[_0xbf27('0x1b')](_0x2f144f[_0xbf27('0x35')][_0xbf27('0x1b')]);}_0x3ffa09[_0xbf27('0x3e')]=qs[_0xbf27('0x3f')](_0x2f144f[_0xbf27('0x35')][_0xbf27('0x3f')]);_0x3ffa09[_0xbf27('0x40')]=qs['filters'](_[_0xbf27('0x41')](_0x2f144f[_0xbf27('0x35')],_0xe8d011[_0xbf27('0x36')]));var _0x356b4c=[];var _0x24b926=squel[_0xbf27('0x42')]()[_0xbf27('0x43')]('id')[_0xbf27('0x43')]('name')[_0xbf27('0x43')](_0xbf27('0x44'))[_0xbf27('0x45')](_0xbf27('0x46'));var _0x34db75=squel[_0xbf27('0x42')]()[_0xbf27('0x43')](_0xbf27('0x47'))['field']('u.fullname')[_0xbf27('0x43')](_0xbf27('0x48'))[_0xbf27('0x45')](_0xbf27('0x49'),'ui')[_0xbf27('0x4a')]('users','u',_0xbf27('0x4b'));var _0xb85616=squel[_0xbf27('0x42')]()[_0xbf27('0x45')]('mail_interactions','i')[_0xbf27('0x4a')](_0xbf27('0x4c'),'c',_0xbf27('0x4d'))['left_join']('users','o','o.id\x20=\x20i.UserId')[_0xbf27('0x4a')](_0xbf27('0x4e'),'a','a.id\x20=\x20i.MailAccountId')['left_join'](_0xbf27('0x4f'),'me','me.MailInteractionId\x20=\x20i.id')[_0xbf27('0x4a')](_0xbf27('0x50'),'it','it.MailInteractionId\x20=\x20i.id')[_0xbf27('0x4a')](_0xbf27('0x46'),'t','t.id\x20=\x20it.TagId');var _0x5bb50d=squel['expr']();var _0x1e278b=[];var _0xd81f53=squel[_0xbf27('0x51')]();var _0x4562da;if(_0x2f144f[_0xbf27('0x35')]['search']){_0x4562da=as[_0xbf27('0x52')](_0x2f144f[_0xbf27('0x35')][_0xbf27('0x53')]);var _0x235632=_0x4562da['sqlOperator'];for(var _0x1f0a7b=0x0;_0x1f0a7b<_0x4562da[_0xbf27('0x54')][_0xbf27('0x3b')];_0x1f0a7b++){var _0x100ce4=_0x4562da[_0xbf27('0x54')][_0x1f0a7b];var _0x441591='i';var _0x338dc9=_[_0xbf27('0x55')](_0x2fda38,['name',_0x100ce4[_0xbf27('0x43')]]);if(!_0x338dc9){switch(_0x100ce4[_0xbf27('0x43')]){case _0xbf27('0x56'):if(_0x100ce4[_0xbf27('0x57')]==0x1){_0xb85616[_0xbf27('0x58')]('`'+_0x100ce4[_0xbf27('0x43')]+_0xbf27('0x59'));}else{_0xb85616[_0xbf27('0x58')]('`'+_0x100ce4[_0xbf27('0x43')]+'`\x20>\x200');}break;case _0xbf27('0x5a'):if(_0x100ce4[_0xbf27('0x5b')]===_0xbf27('0x5c')){if(_0x100ce4[_0xbf27('0x57')]['split']('\x20')[_0xbf27('0x3b')]>0x1){_0x5bb50d[_0x235632](_0xbf27('0x5d'),qs['getFullTextValue'](_0x100ce4[_0xbf27('0x57')]),null);}else{var _0x44c0be='%'+_0x100ce4[_0xbf27('0x57')]+'%';_0x5bb50d[_0x235632](_0xbf27('0x5e'),_0x44c0be,_0x44c0be,_0x44c0be);}}else{_0x338dc9=_[_0xbf27('0x55')](_0x2fda38,[_0xbf27('0x25'),_0xbf27('0x5f')]);_0x100ce4[_0xbf27('0x43')]=_0xbf27('0x5f');_0x2bcf88=as[_0xbf27('0x60')](_0x441591,_0x338dc9[_0xbf27('0x32')],_0x100ce4);_0x5bb50d[_0x235632](_0x2bcf88[_0xbf27('0x61')],_0x2bcf88['value'][_0xbf27('0x62')],_0x2bcf88[_0xbf27('0x57')][_0xbf27('0x18')]);}break;case _0xbf27('0x63'):var _0x2ededa=_0x100ce4['value'][_0xbf27('0x29')](',')['map'](function(_0x38b2cb){return Number(_0x38b2cb);});_0x2ededa[_0xbf27('0x64')](function(_0x5cbdc8){_0xd81f53['or'](_0xbf27('0x65'),'%,'+_0x5cbdc8+',%');});_0x1e278b=_[_0xbf27('0x66')](_0x1e278b,_0x2ededa);break;case _0xbf27('0x67'):if(_0x100ce4['operator']===_0xbf27('0x5c')){_0x5bb50d[_0x235632](_0xbf27('0x68'),'%'+_0x100ce4[_0xbf27('0x57')]+'%',null);}else{_0x338dc9=_[_0xbf27('0x55')](_0x2fda38,[_0xbf27('0x25'),_0xbf27('0x69')]);_0x100ce4[_0xbf27('0x43')]='UserId';_0x2bcf88=as[_0xbf27('0x60')](_0x441591,_0x338dc9['type'],_0x100ce4);_0x5bb50d[_0x235632](_0x2bcf88['text'],_0x2bcf88[_0xbf27('0x57')]['start'],_0x2bcf88[_0xbf27('0x57')][_0xbf27('0x18')]);}break;case _0xbf27('0x6a'):_0x2bcf88=as[_0xbf27('0x60')]('me',null,_0x100ce4);_0x5bb50d[_0x235632](_0x2bcf88[_0xbf27('0x61')],_0x2bcf88[_0xbf27('0x57')][_0xbf27('0x62')],_0x2bcf88[_0xbf27('0x57')][_0xbf27('0x18')]);break;}}else{var _0x2bcf88=as[_0xbf27('0x60')](_0x441591,_0x338dc9[_0xbf27('0x32')],_0x100ce4);_0x5bb50d[_0x235632](_0x2bcf88[_0xbf27('0x61')],_0x2bcf88[_0xbf27('0x57')][_0xbf27('0x62')],_0x2bcf88[_0xbf27('0x57')][_0xbf27('0x18')]);}}}else{var _0x3f0423=_(_0x2f144f['query'])[_0xbf27('0x34')]()[_0xbf27('0x26')](function(_0x1c867b){return _[_0xbf27('0x6b')](_0x2fda38,['name',_0x1c867b])?_0x1c867b:undefined;})['compact']()[_0xbf27('0x57')]();if(!_[_0xbf27('0x6c')](_0x3f0423)){_0x3f0423[_0xbf27('0x64')](function(_0x20f2be){if(_0x20f2be==='MailAccountId'){_0xb85616['where'](_0xbf27('0x6d'),[][_0xbf27('0x6e')](_0x2f144f[_0xbf27('0x35')][_0x20f2be]));}else if(_0x20f2be===_0xbf27('0x6f')){var _0x498987=JSON['parse'](_0x2f144f['query'][_0x20f2be])[_0xbf27('0x70')];var _0x318436=JSON[_0xbf27('0x71')](_0x2f144f[_0xbf27('0x35')][_0x20f2be])['$lte'];_0xb85616[_0xbf27('0x40')](_0xbf27('0x72'),_0x498987,_0x318436);}else{if(_0x2f144f[_0xbf27('0x35')][_0x20f2be]===_0xbf27('0x73')){_0xb85616['where']('i.'+_0x20f2be+_0xbf27('0x74'));}else{_0xb85616['where']('i.'+_0x20f2be+'\x20=\x20?',_0x2f144f['query'][_0x20f2be]);}}});}if(_0x2f144f[_0xbf27('0x35')]['read']){if(_0x2f144f[_0xbf27('0x35')][_0xbf27('0x75')]==0x1){_0xb85616[_0xbf27('0x58')](_0xbf27('0x76'));}else{_0xb85616['having'](_0xbf27('0x77'));}}if(_0x2f144f[_0xbf27('0x35')][_0xbf27('0x78')]){_0x1e278b=_[_0xbf27('0x79')](_0x2f144f[_0xbf27('0x35')][_0xbf27('0x78')])?_0x2f144f['query'][_0xbf27('0x78')]:new Array(_0x2f144f[_0xbf27('0x35')][_0xbf27('0x78')]);_0x1e278b[_0xbf27('0x64')](function(_0x46dab6){_0xd81f53['or'](_0xbf27('0x65'),'%,'+_0x46dab6+',%');});}if(_0x2f144f[_0xbf27('0x35')]['filter']){var _0xf53c9a=_0x2f144f[_0xbf27('0x35')][_0xbf27('0x7a')][_0xbf27('0x7b')]('\x5c','\x5c\x5c')[_0xbf27('0x7b')]('\x27\x27',_0xbf27('0x7c'));if(qs[_0xbf27('0x7d')](_0xf53c9a)){_0x5bb50d['or'](_0xbf27('0x7e'),_0xf53c9a+'%');}else if(qs['isEmail'](_0xf53c9a)){_0x5bb50d['or'](_0xbf27('0x7f'),_0xf53c9a+'%');}else{_0x5bb50d['or'](_0xbf27('0x80'),qs[_0xbf27('0x81')](_0xf53c9a))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xbf27('0x81')](_0xf53c9a));}}}_0xb85616['where'](_0x5bb50d);_0xb85616[_0xbf27('0x82')](_0xbf27('0x83'));var _0x4d8b17={'type':db['Sequelize'][_0xbf27('0x84')][_0xbf27('0x85')],'raw':!![]};var _0x7d438f=_0xb85616[_0xbf27('0x86')]();_0x7d438f[_0xbf27('0x43')](_0xbf27('0x83'));_0x7d438f['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xbf27('0x56'));if(_0x3ffa09[_0xbf27('0x3e')]){_0x3ffa09[_0xbf27('0x3e')]['forEach'](function(_0x11d3bf){_0xb85616[_0xbf27('0x3e')]('i.'+_0x11d3bf[0x0],_0x11d3bf[0x1]===_0xbf27('0x87')?![]:!![]);});}if(!_[_0xbf27('0x6c')](_0x1e278b)){_0xb85616[_0xbf27('0x58')](_0xd81f53);_0x7d438f[_0xbf27('0x40')](_0xbf27('0x88'),_0x1e278b);}BPromise['resolve']()[_0xbf27('0x22')](function(){if(!_0x4562da){if(_0x2f144f[_0xbf27('0x35')]['MailAccountId']||_0x2f144f[_0xbf27('0x35')][_0xbf27('0x89')])return;_0x7d438f[_0xbf27('0x40')](_0xbf27('0x8a'));_0xb85616[_0xbf27('0x40')]('i.MailAccountId\x20IS\x20NOT\x20NULL');return;}return _0x2f144f[_0xbf27('0x8b')][_0xbf27('0x8c')]({'attributes':['id'],'raw':!![]})[_0xbf27('0x22')](function(_0x31380c){if(_[_0xbf27('0x6c')](_0x31380c)){_0x7d438f[_0xbf27('0x40')]('i.MailAccountId\x20IS\x20NULL');_0xb85616[_0xbf27('0x40')](_0xbf27('0x8d'));}else{_0x7d438f[_0xbf27('0x40')](_0xbf27('0x6d'),_[_0xbf27('0x26')](_0x31380c,'id'));_0xb85616[_0xbf27('0x40')](_0xbf27('0x6d'),_[_0xbf27('0x26')](_0x31380c,'id'));}});})[_0xbf27('0x22')](function(){db[_0xbf27('0x8e')][_0xbf27('0x35')](_0x7d438f[_0xbf27('0x8f')](),_0x4d8b17)[_0xbf27('0x22')](function(_0x432682){_0x2e5cba[_0xbf27('0x1a')]=_0x432682[_0xbf27('0x3b')];if(_0x2e5cba['count']===0x0)return[];return db['sequelize'][_0xbf27('0x35')](_0x24b926[_0xbf27('0x8f')](),_0x4d8b17)[_0xbf27('0x22')](function(_0x1def59){_0x356b4c=_[_0xbf27('0x90')](_0x1def59,'id');_0x4d8b17=_[_0xbf27('0x91')](_0x4d8b17,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2f144f[_0xbf27('0x35')][_0xbf27('0x3a')]){_0x3ffa09[_0xbf27('0x39')][_0xbf27('0x64')](function(_0x1e26bc){_0xb85616['field']('i.'+_0x1e26bc);});}else{_0xb85616['field'](_0xbf27('0x92'),'unreadMessages');_0xb85616[_0xbf27('0x43')]('a.key','Account.key');_0xb85616[_0xbf27('0x43')]('a.mandatoryDisposition',_0xbf27('0x93'));_0xb85616[_0xbf27('0x43')](_0xbf27('0x83'));_0xb85616['field'](_0xbf27('0x94'));_0xb85616['field'](_0xbf27('0x95'));_0xb85616['field'](_0xbf27('0x96'));_0xb85616['field']('i.closedAt');_0xb85616['field'](_0xbf27('0x97'));_0xb85616[_0xbf27('0x43')](_0xbf27('0x98'));_0xb85616[_0xbf27('0x43')](_0xbf27('0x99'));_0xb85616[_0xbf27('0x43')](_0xbf27('0x9a'));_0xb85616['field'](_0xbf27('0x9b'));_0xb85616['field']('i.substatus');_0xb85616[_0xbf27('0x43')]('i.to');_0xb85616[_0xbf27('0x43')](_0xbf27('0x9c'));_0xb85616[_0xbf27('0x43')](_0xbf27('0x9d'));_0xb85616[_0xbf27('0x43')](_0xbf27('0x9e'));_0xb85616[_0xbf27('0x43')](_0xbf27('0x9f'),'Contact.firstName');_0xb85616['field'](_0xbf27('0xa0'),_0xbf27('0xa1'));_0xb85616[_0xbf27('0x43')](_0xbf27('0xa2'),_0xbf27('0xa3'));_0xb85616[_0xbf27('0x43')](_0xbf27('0xa4'),_0xbf27('0xa5'));_0xb85616[_0xbf27('0x43')](_0xbf27('0xa6'),'Contact.mobile');_0xb85616[_0xbf27('0x43')](_0xbf27('0xa7'),'Contact.fax');_0xb85616['field'](_0xbf27('0xa8'),_0xbf27('0xa9'));_0xb85616[_0xbf27('0x43')](_0xbf27('0xaa'),'Owner.internal');_0xb85616[_0xbf27('0x43')](_0xbf27('0xab'),_0xbf27('0x27'));}_0xb85616[_0xbf27('0x1c')](_0x3ffa09['limit']);_0xb85616[_0xbf27('0x1b')](_0x3ffa09[_0xbf27('0x1b')]);return db[_0xbf27('0x8e')]['query'](_0xb85616[_0xbf27('0x8f')](),_0x4d8b17);})['then'](function(_0x7a3730){_0x34db75[_0xbf27('0x40')](_0xbf27('0xac'),_[_0xbf27('0x26')](_0x7a3730,'id'));return db[_0xbf27('0x8e')][_0xbf27('0x35')](_0x34db75['toString'](),_0x4d8b17)['then'](function(_0x56a7aa){var _0x2e135=_[_0xbf27('0xad')](_0x56a7aa,_0xbf27('0xae'));var _0x56607d=[];return db['Setting'][_0xbf27('0xaf')]({'attributes':['enableEmailPreview'],'raw':!![]})['then'](function(_0x3cb4ee){var _0x76d0d8=_0x3cb4ee['enableEmailPreview'];_0x7a3730[_0xbf27('0x64')](function(_0x22aaac){_0x56607d[_0xbf27('0x2a')](updateMailInteraction(_0x22aaac,_0x356b4c,_0x2e135,_0x76d0d8));});return BPromise[_0xbf27('0xb0')](_0x56607d);});});});})[_0xbf27('0x22')](function(_0x190121){_0x2e5cba[_0xbf27('0xb1')]=_0x190121;return _0x2e5cba;})[_0xbf27('0x22')](respondWithFilteredResult(_0x454aa0,_0x3ffa09));})[_0xbf27('0x2f')](handleError(_0x454aa0,null));};exports['show']=function(_0x47932c,_0x329f06){var _0x51ca10={'raw':![],'where':{'id':_0x47932c[_0xbf27('0xb2')]['id']}},_0x2790c2={};_0x2790c2[_0xbf27('0x38')]=_['keys'](db[_0xbf27('0x2b')]['rawAttributes']);_0x2790c2[_0xbf27('0x35')]=_['keys'](_0x47932c[_0xbf27('0x35')]);_0x2790c2[_0xbf27('0x36')]=_['intersection'](_0x2790c2[_0xbf27('0x38')],_0x2790c2[_0xbf27('0x35')]);_0x51ca10['attributes']=_['intersection'](_0x2790c2[_0xbf27('0x38')],qs[_0xbf27('0x3a')](_0x47932c[_0xbf27('0x35')][_0xbf27('0x3a')]));_0x51ca10[_0xbf27('0x39')]=_0x51ca10['attributes'][_0xbf27('0x3b')]?_0x51ca10[_0xbf27('0x39')]:_0x2790c2['model'];if(_0x47932c[_0xbf27('0x35')][_0xbf27('0xb3')]){_0x51ca10[_0xbf27('0xb4')]=[{'all':!![]}];}_0x51ca10=_[_0xbf27('0x91')]({},_0x51ca10,_0x47932c[_0xbf27('0xb5')]);return db['MailInteraction'][_0xbf27('0x55')](_0x51ca10)[_0xbf27('0x22')](handleEntityNotFound(_0x329f06,null))[_0xbf27('0x22')](respondWithResult(_0x329f06,null))[_0xbf27('0x2f')](handleError(_0x329f06,null));};exports[_0xbf27('0xb6')]=function(_0x1d91eb,_0x27146f){return db[_0xbf27('0x2b')][_0xbf27('0xb6')](_0x1d91eb[_0xbf27('0xb7')],{})[_0xbf27('0x22')](respondWithResult(_0x27146f,0xc9))[_0xbf27('0x2f')](handleError(_0x27146f,null));};exports[_0xbf27('0xb8')]=function(_0x3725a7,_0x4e9199){if(_0x3725a7[_0xbf27('0xb7')]['id']){delete _0x3725a7[_0xbf27('0xb7')]['id'];}return db[_0xbf27('0x2b')][_0xbf27('0x55')]({'where':{'id':_0x3725a7[_0xbf27('0xb2')]['id']}})[_0xbf27('0x22')](handleEntityNotFound(_0x4e9199,null))[_0xbf27('0x22')](saveUpdates(_0x3725a7[_0xbf27('0xb7')],null))[_0xbf27('0x22')](respondWithResult(_0x4e9199,null))['catch'](handleError(_0x4e9199,null));};exports['destroy']=function(_0x4ad26d,_0x1e3452){return db[_0xbf27('0x2b')][_0xbf27('0x55')]({'where':{'id':_0x4ad26d[_0xbf27('0xb2')]['id']}})[_0xbf27('0x22')](handleEntityNotFound(_0x1e3452,null))[_0xbf27('0x22')](removeEntity(_0x1e3452,null))[_0xbf27('0x2f')](handleError(_0x1e3452,null));};exports[_0xbf27('0xb9')]=function(_0x2fe310,_0xb1b821){return db[_0xbf27('0x2b')]['describe']()['then'](respondWithResult(_0xb1b821,null))[_0xbf27('0x2f')](handleError(_0xb1b821,null));};exports[_0xbf27('0xba')]=function(_0x1655e2,_0x58e500,_0x4728cf){return db[_0xbf27('0xbb')][_0xbf27('0x55')]({'where':{'id':_0x1655e2[_0xbf27('0xb2')]['id']}})[_0xbf27('0x22')](handleEntityNotFound(_0x58e500,null))['then'](function(_0x2f3a2d){if(_0x2f3a2d){return _0x2f3a2d[_0xbf27('0xba')](_0x1655e2[_0xbf27('0xb7')][_0xbf27('0xbc')],_[_0xbf27('0xbd')](_0x1655e2[_0xbf27('0xb7')],[_0xbf27('0xbc'),'id'])||{});}})['then'](respondWithResult(_0x58e500,null))[_0xbf27('0x2f')](handleError(_0x58e500,null));};exports[_0xbf27('0xbe')]=function(_0x45fa5b,_0x12e826,_0x569fe9){var _0x39feb1={'raw':![],'where':{}};var _0x1f8e06={};var _0x290ab7={'count':0x0,'rows':[]};return db['MailInteraction'][_0xbf27('0xaf')]({'where':{'id':_0x45fa5b['params']['id']}})[_0xbf27('0x22')](handleEntityNotFound(_0x12e826,null))[_0xbf27('0x22')](function(_0x6ce8d7){if(_0x6ce8d7){_0x1f8e06[_0xbf27('0x38')]=_[_0xbf27('0x34')](db[_0xbf27('0xbb')]['rawAttributes']);_0x1f8e06[_0xbf27('0x35')]=_[_0xbf27('0x34')](_0x45fa5b[_0xbf27('0x35')]);_0x1f8e06[_0xbf27('0x36')]=_[_0xbf27('0x37')](_0x1f8e06[_0xbf27('0x38')],_0x1f8e06['query']);_0x39feb1[_0xbf27('0x39')]=_[_0xbf27('0x37')](_0x1f8e06[_0xbf27('0x38')],qs[_0xbf27('0x3a')](_0x45fa5b[_0xbf27('0x35')][_0xbf27('0x3a')]));_0x39feb1['attributes']=_0x39feb1[_0xbf27('0x39')][_0xbf27('0x3b')]?_0x39feb1[_0xbf27('0x39')]:_0x1f8e06[_0xbf27('0x38')];if(!_0x45fa5b[_0xbf27('0x35')][_0xbf27('0x3c')]('nolimit')){_0x39feb1[_0xbf27('0x1c')]=qs[_0xbf27('0x1c')](_0x45fa5b[_0xbf27('0x35')][_0xbf27('0x1c')]);_0x39feb1[_0xbf27('0x1b')]=qs[_0xbf27('0x1b')](_0x45fa5b['query']['offset']);}_0x39feb1[_0xbf27('0x3e')]=qs['sort'](_0x45fa5b[_0xbf27('0x35')][_0xbf27('0x3f')]);_0x39feb1['where']=qs[_0xbf27('0x36')](_['pick'](_0x45fa5b[_0xbf27('0x35')],_0x1f8e06[_0xbf27('0x36')]));_0x39feb1[_0xbf27('0x40')][_0xbf27('0xae')]=_0x6ce8d7['id'];if(_0x45fa5b[_0xbf27('0x35')][_0xbf27('0x7a')]){_0x39feb1[_0xbf27('0x40')]=_['merge'](_0x39feb1['where'],{'$or':_[_0xbf27('0x26')](_0x39feb1[_0xbf27('0x39')],function(_0x60e656){var _0x53fab3={};_0x53fab3[_0x60e656]={'$like':'%'+_0x45fa5b['query'][_0xbf27('0x7a')]+'%'};return _0x53fab3;})});}if(_0x45fa5b['query'][_0xbf27('0x70')]){var _0x36c270=_0x45fa5b[_0xbf27('0x35')][_0xbf27('0x70')]['split'](',');var _0x492368={};_0x492368[_0x36c270[0x0]]={'$gte':moment(_0x36c270[0x1])[_0xbf27('0xbf')](_0xbf27('0xc0'))};_0x39feb1['where']=_[_0xbf27('0x91')](_0x39feb1[_0xbf27('0x40')],_0x492368);}_0x39feb1=_[_0xbf27('0x91')]({},_0x39feb1,_0x45fa5b[_0xbf27('0xb5')]);return db[_0xbf27('0xbb')][_0xbf27('0x1a')]({'where':_0x39feb1[_0xbf27('0x40')]})[_0xbf27('0x22')](function(_0x1a39b4){_0x290ab7[_0xbf27('0x1a')]=_0x1a39b4;if(_0x45fa5b['query'][_0xbf27('0xb3')]){_0x39feb1[_0xbf27('0xb4')]=[{'all':!![]}];}return db[_0xbf27('0xbb')][_0xbf27('0xc1')](_0x39feb1);})['then'](function(_0x3c3297){_0x290ab7['rows']=_0x3c3297;return _0x290ab7;});}})[_0xbf27('0x22')](respondWithFilteredResult(_0x12e826,_0x39feb1))['catch'](handleError(_0x12e826,null));};exports[_0xbf27('0xc2')]=function(_0x5e99d0,_0x516e93,_0x3a14ef){return db[_0xbf27('0x2b')]['find']({'where':{'id':_0x5e99d0[_0xbf27('0xb2')]['id']}})[_0xbf27('0x22')](handleEntityNotFound(_0x516e93,null))[_0xbf27('0x22')](function(_0x3f9ce8){if(_0x3f9ce8){return _0x3f9ce8[_0xbf27('0xc3')](_0x5e99d0[_0xbf27('0xb7')]['ids'],_[_0xbf27('0xbd')](_0x5e99d0[_0xbf27('0xb7')],[_0xbf27('0xbc'),'id'])||{})[_0xbf27('0xc4')](function(){return db['Tag'][_0xbf27('0xc1')]({'attributes':['id',_0xbf27('0x25'),_0xbf27('0x44')],'where':{'id':_0x5e99d0[_0xbf27('0xb7')]['ids']}});})[_0xbf27('0x22')](function(_0x67a36f){socket[_0xbf27('0xc5')](_0xbf27('0xc6'),{'id':Number(_0x5e99d0[_0xbf27('0xb2')]['id']),'tags':_0x67a36f||[]});return{'id':Number(_0x5e99d0['params']['id']),'tags':_0x67a36f||[]};});}})[_0xbf27('0x22')](respondWithResult(_0x516e93,null))[_0xbf27('0x2f')](handleError(_0x516e93,null));};exports[_0xbf27('0xc7')]=function(_0x23a3a8,_0x2d0ed4,_0x1d4d15){return db['MailInteraction'][_0xbf27('0x55')]({'where':{'id':_0x23a3a8[_0xbf27('0xb2')]['id']}})[_0xbf27('0x22')](handleEntityNotFound(_0x2d0ed4,null))[_0xbf27('0x22')](function(_0x3e1e0e){if(_0x3e1e0e){return _0x3e1e0e['removeTags'](_0x23a3a8['query'][_0xbf27('0xbc')]);}})[_0xbf27('0x22')](respondWithStatusCode(_0x2d0ed4,null))['catch'](handleError(_0x2d0ed4,null));};exports[_0xbf27('0xc8')]=function(_0x55f63f,_0x8e7bf9){var _0x2459d5=moment()[_0xbf27('0xc9')]()['toString']();var _0x51640c=path['join'](config[_0xbf27('0xca')],_0xbf27('0xcb'),_0xbf27('0xcc'),_0xbf27('0xcd'));var _0x1b9195=path[_0xbf27('0xce')](config[_0xbf27('0xca')],_0xbf27('0xcb'),_0xbf27('0xcc'),'attachments');var _0x30e617=path[_0xbf27('0xce')](_0x51640c,_0x2459d5);var _0x5b89d6=util[_0xbf27('0xbf')](_0xbf27('0xcf'),_0x55f63f[_0xbf27('0xb2')]['id'],_0x2459d5);var _0x2b2ff7=path[_0xbf27('0xce')](_0x51640c,_0x5b89d6);var _0x5dc960=[];if(_0x55f63f['query'][_0xbf27('0xd0')]){_0x5dc960[_0xbf27('0x2a')]({'model':db['Attachment'],'as':_0xbf27('0xd1'),'raw':!![]});}var _0x56cba2=[{'model':db['MailMessage'],'as':_0xbf27('0xd2'),'attributes':['id',_0xbf27('0xb7'),_0xbf27('0x45'),'to','cc',_0xbf27('0xd3'),'subject',_0xbf27('0x6f')],'where':{'secret':![]},'order':qs[_0xbf27('0x3f')]('id'),'include':_0x5dc960}];return db[_0xbf27('0x2b')][_0xbf27('0x55')]({'where':{'id':_0x55f63f[_0xbf27('0xb2')]['id']},'include':_0x56cba2})[_0xbf27('0x22')](handleEntityNotFound(_0x8e7bf9,null))[_0xbf27('0x22')](function(_0x426fde){if(_0x426fde&&_0x426fde['Messages']){var _0x1a6a16=_0x426fde[_0xbf27('0xd4')]({'plain':!![]});fs[_0xbf27('0xd5')](_0x30e617);return BPromise[_0xbf27('0xd6')](_0x1a6a16[_0xbf27('0xd2')],function(_0xeb1cc,_0x320e5c){var _0x107a2d={'from':_0xeb1cc['from'],'to':_0xeb1cc['to'],'subject':_0xeb1cc[_0xbf27('0xd7')],'html':_0xeb1cc[_0xbf27('0xb7')],'headers':{'Date':moment(_0xeb1cc[_0xbf27('0x6f')])[_0xbf27('0xbf')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0xeb1cc['cc']){_0x107a2d[_0xbf27('0xd8')]['Cc']=_0xeb1cc['cc'];}if(_0xeb1cc[_0xbf27('0xd3')]){_0x107a2d[_0xbf27('0xd8')][_0xbf27('0xd9')]=_0xeb1cc['bcc'];}return new BPromise(function(_0x1a7851,_0x4453ec){if(_0xeb1cc[_0xbf27('0xd1')]){for(var _0x4b8a15=0x0;_0x4b8a15<_0xeb1cc[_0xbf27('0xd1')]['length'];_0x4b8a15++){var _0x34d307=_0xeb1cc['Attachments'][_0x4b8a15];var _0x510f71=path['join'](_0x1b9195,_0x34d307[_0xbf27('0xda')]);if(fs[_0xbf27('0xdb')](_0x510f71)){_0x107a2d[_0xbf27('0xd0')][_0xbf27('0x2a')]({'name':_0x34d307[_0xbf27('0x25')],'contentType':_0x34d307['type'],'data':fs['readFileSync'](_0x510f71)});}}}emlformat[_0xbf27('0xdc')](_0x107a2d,function(_0x26183d,_0x27a793){if(_0x26183d)return _0x4453ec(_0x26183d);fs['writeFileSync'](path[_0xbf27('0xce')](_0x30e617,util[_0xbf27('0xbf')](_0xbf27('0xdd'),_0x320e5c)),_0x27a793);return _0x1a7851(_0x27a793);});});})[_0xbf27('0x22')](function(){return new BPromise(function(_0x5ded79,_0x10e57f){zipdir(_0x30e617,{'saveTo':_0x2b2ff7},function(_0x359c95,_0x2312e8){if(_0x359c95)return _0x10e57f(_0x359c95);return _0x5ded79(_0x2312e8);});})['then'](function(){return new BPromise(function(_0x4fe838,_0x3e6a8f){rimraf(_0x30e617,function(_0x460f7a){if(_0x460f7a)_0x3e6a8f(_0x460f7a);return _0x4fe838();});});})[_0xbf27('0x22')](function(){return _0x8e7bf9['download'](_0x2b2ff7,_0x5b89d6,function(_0x32f3db){if(_0x32f3db){console[_0xbf27('0xde')](_0xbf27('0xdf'),_0x32f3db);}else{fs[_0xbf27('0xe0')](_0x2b2ff7);}});});});}else{return _0x8e7bf9[_0xbf27('0x16')](0xc8);}})[_0xbf27('0x2f')](handleError(_0x8e7bf9,null));}; \ No newline at end of file +var _0xdf1f=['include','options','create','body','destroy','describe','addMessage','ids','getMessages','MailMessage','format','includeAll','findAll','addTags','setTags','spread','emit','mailInteractionTags:save','removeTags','download','join','root','server','tmp','files','transcript-%d-%s.zip','attachments','Messages','bcc','subject','get','createdAt','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments','basename','existsSync','readFileSync','message%d.eml','html-pdf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','html-to-text','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./mailInteraction.socket','register','sendStatus','status','end','count','offset','limit','Content-Range','json','apply','reject','save','update','then','error','stack','name','Users','map','fullname','TagIds','split','Tags','push','MailInteraction','lastMsgText','fromString','lastMsgBody','catch','index','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','field','color','tools_tags','select','u.fullname','ui.MailInteractionId','from','left_join','users','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','search','sqlOperator','conditions','find','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','start','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','text','some','isEmpty','MailAccountId','i.MailAccountId\x20IN\x20?','concat','parse','$gte','$lte','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','filter','replace','\x27\x27\x27\x27','isNumeric','isEmail','c.email\x20LIKE\x20?','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','SELECT','clone','unreadMessages','DESC','resolve','journey','i.MailAccountId\x20IS\x20NOT\x20NULL','getMailAccounts','i.MailAccountId\x20IS\x20NULL','toString','sequelize','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','Account.key','Account.mandatoryDisposition','i.updatedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.disposition','i.substatus','i.to','i.MailAccountId','i.UserId','c.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','ui.MailInteractionId\x20IN\x20?','MailInteractionId','findOne','enableEmailPreview','rows','show','params'];(function(_0x5a6f13,_0x383a9f){var _0xd89867=function(_0x8bd966){while(--_0x8bd966){_0x5a6f13['push'](_0x5a6f13['shift']());}};_0xd89867(++_0x383a9f);}(_0xdf1f,0x1ec));var _0xfdf1=function(_0x43d580,_0x20f616){_0x43d580=_0x43d580-0x0;var _0x62b28e=_0xdf1f[_0x43d580];return _0x62b28e;};'use strict';var pdf=require(_0xfdf1('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xfdf1('0x1'));var jsonpatch=require(_0xfdf1('0x2'));var rp=require(_0xfdf1('0x3'));var moment=require('moment');var BPromise=require(_0xfdf1('0x4'));var Mustache=require('mustache');var util=require(_0xfdf1('0x5'));var path=require(_0xfdf1('0x6'));var sox=require(_0xfdf1('0x7'));var csv=require(_0xfdf1('0x8'));var ejs=require(_0xfdf1('0x9'));var fs=require('fs');var _=require(_0xfdf1('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xfdf1('0xb'));var deskjs=require(_0xfdf1('0xc'));var toCsv=require(_0xfdf1('0x8'));var querystring=require(_0xfdf1('0xd'));var Papa=require('papaparse');var htmlToText=require(_0xfdf1('0xe'));var Redis=require('ioredis');var authService=require(_0xfdf1('0xf'));var qs=require(_0xfdf1('0x10'));var as=require(_0xfdf1('0x11'));var hardwareService=require(_0xfdf1('0x12'));var logger=require(_0xfdf1('0x13'))('api');var utils=require(_0xfdf1('0x14'));var config=require(_0xfdf1('0x15'));var db=require(_0xfdf1('0x16'))['db'];config['redis']=_['defaults'](config[_0xfdf1('0x17')],{'host':_0xfdf1('0x18'),'port':0x18eb});var socket=require(_0xfdf1('0x19'))(new Redis(config[_0xfdf1('0x17')]));require(_0xfdf1('0x1a'))[_0xfdf1('0x1b')](socket);function respondWithStatusCode(_0x3d8470,_0x4403b3){_0x4403b3=_0x4403b3||0xcc;return function(_0x1e15a0){if(_0x1e15a0){return _0x3d8470[_0xfdf1('0x1c')](_0x4403b3);}return _0x3d8470[_0xfdf1('0x1d')](_0x4403b3)[_0xfdf1('0x1e')]();};}function respondWithResult(_0x3a507d,_0x47da5b){_0x47da5b=_0x47da5b||0xc8;return function(_0x232ae8){if(_0x232ae8){return _0x3a507d['status'](_0x47da5b)['json'](_0x232ae8);}};}function respondWithFilteredResult(_0x536012,_0xaee11a){return function(_0x57bf56){if(_0x57bf56){var _0x5a482b=_0x57bf56[_0xfdf1('0x1f')],_0x19058c=_0xaee11a['offset'],_0x48a8fa=_0xaee11a[_0xfdf1('0x20')]+_0xaee11a[_0xfdf1('0x21')],_0x11adf2;if(_0x48a8fa>=_0x5a482b){_0x48a8fa=_0x5a482b;_0x11adf2=0xc8;}else{_0x11adf2=0xce;}_0x536012[_0xfdf1('0x1d')](_0x11adf2);return _0x536012['set'](_0xfdf1('0x22'),_0x19058c+'-'+_0x48a8fa+'/'+_0x5a482b)[_0xfdf1('0x23')](_0x57bf56);}return null;};}function patchUpdates(_0xabbb94){return function(_0x3dba1c){try{jsonpatch[_0xfdf1('0x24')](_0x3dba1c,_0xabbb94,!![]);}catch(_0x2fe80f){return BPromise[_0xfdf1('0x25')](_0x2fe80f);}return _0x3dba1c[_0xfdf1('0x26')]();};}function saveUpdates(_0x585952,_0x37d539){return function(_0x4c1022){if(_0x4c1022){return _0x4c1022[_0xfdf1('0x27')](_0x585952)[_0xfdf1('0x28')](function(_0x449f05){return _0x449f05;});}return null;};}function removeEntity(_0x3f620a,_0x49be71){return function(_0x2fbd80){if(_0x2fbd80){return _0x2fbd80['destroy']()[_0xfdf1('0x28')](function(){_0x3f620a[_0xfdf1('0x1d')](0xcc)[_0xfdf1('0x1e')]();});}};}function handleEntityNotFound(_0x2a051d,_0x3606d8){return function(_0x11a1a8){if(!_0x11a1a8){_0x2a051d['sendStatus'](0x194);}return _0x11a1a8;};}function handleError(_0x3944e6,_0x20d090){_0x20d090=_0x20d090||0x1f4;return function(_0x5cce8f){logger[_0xfdf1('0x29')](_0x5cce8f[_0xfdf1('0x2a')]);if(_0x5cce8f[_0xfdf1('0x2b')]){delete _0x5cce8f[_0xfdf1('0x2b')];}_0x3944e6[_0xfdf1('0x1d')](_0x20d090)['send'](_0x5cce8f);};}function getInteractionUsers(_0x2b7866,_0x583e00){return new BPromise(function(_0x2431c1,_0x54c5b2){try{if(_0x583e00[_0x2b7866['id']]){_0x2b7866[_0xfdf1('0x2c')]=_[_0xfdf1('0x2d')](_0x583e00[_0x2b7866['id']],function(_0x492942){return{'id':_0x492942['id'],'fullname':_0x492942[_0xfdf1('0x2e')]};});}}catch(_0x295714){_0x54c5b2(_0x295714);}_0x2431c1(_0x2b7866);});}function getInteractionTags(_0x594576,_0x272e21){return new BPromise(function(_0x180777,_0x399506){try{if(_0x594576[_0xfdf1('0x2f')]){_0x594576['Tags']=[];_0x594576[_0xfdf1('0x2f')][_0xfdf1('0x30')](',')['forEach'](function(_0x34f6a1){_0x594576[_0xfdf1('0x31')][_0xfdf1('0x32')](_0x272e21[_0x34f6a1]);});}delete _0x594576[_0xfdf1('0x2f')];}catch(_0x31780c){_0x399506(_0x31780c);}_0x180777(_0x594576);});}function getLastMessageText(_0x15b65f){return new BPromise(function(_0x364853,_0x156fd7){return db[_0xfdf1('0x33')]['findOne']({'where':{'id':_0x15b65f['id']},'attributes':['lastMsgBody','lastMsgText'],'raw':!![]})[_0xfdf1('0x28')](function(_0xa23fd){if(!_0xa23fd[_0xfdf1('0x34')]){_0x15b65f[_0xfdf1('0x34')]=_['trimStart'](htmlToText[_0xfdf1('0x35')](_0xa23fd[_0xfdf1('0x36')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]}));}else{_0x15b65f[_0xfdf1('0x34')]=_0xa23fd[_0xfdf1('0x34')];}_0x364853(_0x15b65f);})[_0xfdf1('0x37')](function(_0x4f638b){_0x156fd7(_0x4f638b);});});}function updateMailInteraction(_0xa40469,_0x94897a,_0x21e537,_0x2fa504){return new BPromise(function(_0x170474,_0x1b2f82){return getInteractionUsers(_0xa40469,_0x21e537)[_0xfdf1('0x28')](function(_0x34b8a0){return getInteractionTags(_0x34b8a0,_0x94897a);})['then'](function(_0x34c6af){if(_0x2fa504){_0x170474(getLastMessageText(_0x34c6af));}else{_0x170474(_0x34c6af);}})[_0xfdf1('0x37')](function(_0x2fa05d){_0x1b2f82(_0x2fa05d);});});}exports[_0xfdf1('0x38')]=function(_0x1c2f1b,_0x416053){var _0x1f9f15={},_0x4bed4c={},_0x9ee85f={'count':0x0,'rows':[]};var _0x2f3b08=_[_0xfdf1('0x2d')](db[_0xfdf1('0x33')][_0xfdf1('0x39')],function(_0x505474){return{'name':_0x505474[_0xfdf1('0x3a')],'type':_0x505474[_0xfdf1('0x3b')][_0xfdf1('0x3c')]};});_0x4bed4c[_0xfdf1('0x3d')]=_[_0xfdf1('0x2d')](_0x2f3b08,_0xfdf1('0x2b'));_0x4bed4c[_0xfdf1('0x3e')]=_[_0xfdf1('0x3f')](_0x1c2f1b[_0xfdf1('0x3e')]);_0x4bed4c['filters']=_[_0xfdf1('0x40')](_0x4bed4c[_0xfdf1('0x3d')],_0x4bed4c[_0xfdf1('0x3e')]);_0x1f9f15[_0xfdf1('0x41')]=_[_0xfdf1('0x40')](_0x4bed4c['model'],qs[_0xfdf1('0x42')](_0x1c2f1b[_0xfdf1('0x3e')]['fields']));_0x1f9f15['attributes']=_0x1f9f15['attributes'][_0xfdf1('0x43')]?_0x1f9f15['attributes']:_0x4bed4c[_0xfdf1('0x3d')];if(!_0x1c2f1b[_0xfdf1('0x3e')][_0xfdf1('0x44')](_0xfdf1('0x45'))){_0x1f9f15['limit']=qs[_0xfdf1('0x21')](_0x1c2f1b[_0xfdf1('0x3e')][_0xfdf1('0x21')]);_0x1f9f15[_0xfdf1('0x20')]=qs['offset'](_0x1c2f1b[_0xfdf1('0x3e')]['offset']);}_0x1f9f15[_0xfdf1('0x46')]=qs[_0xfdf1('0x47')](_0x1c2f1b[_0xfdf1('0x3e')]['sort']);_0x1f9f15[_0xfdf1('0x48')]=qs[_0xfdf1('0x49')](_[_0xfdf1('0x4a')](_0x1c2f1b[_0xfdf1('0x3e')],_0x4bed4c[_0xfdf1('0x49')]));var _0x3a2a0f=[];var _0x19b1a3=squel['select']()[_0xfdf1('0x4b')]('id')[_0xfdf1('0x4b')](_0xfdf1('0x2b'))[_0xfdf1('0x4b')](_0xfdf1('0x4c'))['from'](_0xfdf1('0x4d'));var _0x37f0c0=squel[_0xfdf1('0x4e')]()[_0xfdf1('0x4b')]('u.id')[_0xfdf1('0x4b')](_0xfdf1('0x4f'))['field'](_0xfdf1('0x50'))[_0xfdf1('0x51')]('user_has_mail_interactions','ui')[_0xfdf1('0x52')](_0xfdf1('0x53'),'u','u.id\x20=\x20ui.UserId');var _0x24d822=squel[_0xfdf1('0x4e')]()[_0xfdf1('0x51')](_0xfdf1('0x54'),'i')[_0xfdf1('0x52')](_0xfdf1('0x55'),'c',_0xfdf1('0x56'))[_0xfdf1('0x52')](_0xfdf1('0x53'),'o',_0xfdf1('0x57'))[_0xfdf1('0x52')]('mail_accounts','a',_0xfdf1('0x58'))[_0xfdf1('0x52')](_0xfdf1('0x59'),'me',_0xfdf1('0x5a'))[_0xfdf1('0x52')](_0xfdf1('0x5b'),'it',_0xfdf1('0x5c'))['left_join']('tools_tags','t',_0xfdf1('0x5d'));var _0x266fc5=squel['expr']();var _0x5d1b8b=[];var _0x43ed2c=squel['expr']();var _0x301a39;if(_0x1c2f1b[_0xfdf1('0x3e')][_0xfdf1('0x5e')]){_0x301a39=as['parseSearch'](_0x1c2f1b[_0xfdf1('0x3e')][_0xfdf1('0x5e')]);var _0x1e4d56=_0x301a39[_0xfdf1('0x5f')];for(var _0x38ff3c=0x0;_0x38ff3c<_0x301a39['conditions'][_0xfdf1('0x43')];_0x38ff3c++){var _0x4aa4aa=_0x301a39[_0xfdf1('0x60')][_0x38ff3c];var _0x14d521='i';var _0x13d8de=_[_0xfdf1('0x61')](_0x2f3b08,[_0xfdf1('0x2b'),_0x4aa4aa[_0xfdf1('0x4b')]]);if(!_0x13d8de){switch(_0x4aa4aa[_0xfdf1('0x4b')]){case'unreadMessages':if(_0x4aa4aa[_0xfdf1('0x62')]==0x1){_0x24d822[_0xfdf1('0x63')]('`'+_0x4aa4aa[_0xfdf1('0x4b')]+_0xfdf1('0x64'));}else{_0x24d822[_0xfdf1('0x63')]('`'+_0x4aa4aa['field']+_0xfdf1('0x65'));}break;case _0xfdf1('0x66'):if(_0x4aa4aa[_0xfdf1('0x67')]==='$substring'){if(_0x4aa4aa[_0xfdf1('0x62')][_0xfdf1('0x30')]('\x20')[_0xfdf1('0x43')]>0x1){_0x266fc5[_0x1e4d56]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xfdf1('0x68')](_0x4aa4aa[_0xfdf1('0x62')]),null);}else{var _0x4f2052='%'+_0x4aa4aa[_0xfdf1('0x62')]+'%';_0x266fc5[_0x1e4d56](_0xfdf1('0x69'),_0x4f2052,_0x4f2052,_0x4f2052);}}else{_0x13d8de=_[_0xfdf1('0x61')](_0x2f3b08,['name',_0xfdf1('0x6a')]);_0x4aa4aa[_0xfdf1('0x4b')]=_0xfdf1('0x6a');_0x3e8bee=as['buildExpression'](_0x14d521,_0x13d8de[_0xfdf1('0x3b')],_0x4aa4aa);_0x266fc5[_0x1e4d56](_0x3e8bee['text'],_0x3e8bee[_0xfdf1('0x62')][_0xfdf1('0x6b')],_0x3e8bee['value'][_0xfdf1('0x1e')]);}break;case _0xfdf1('0x6c'):var _0x32931e=_0x4aa4aa['value'][_0xfdf1('0x30')](',')[_0xfdf1('0x2d')](function(_0x562893){return Number(_0x562893);});_0x32931e[_0xfdf1('0x6d')](function(_0x37b650){_0x43ed2c['or'](_0xfdf1('0x6e'),'%,'+_0x37b650+',%');});_0x5d1b8b=_[_0xfdf1('0x6f')](_0x5d1b8b,_0x32931e);break;case _0xfdf1('0x70'):if(_0x4aa4aa[_0xfdf1('0x67')]===_0xfdf1('0x71')){_0x266fc5[_0x1e4d56](_0xfdf1('0x72'),'%'+_0x4aa4aa['value']+'%',null);}else{_0x13d8de=_[_0xfdf1('0x61')](_0x2f3b08,[_0xfdf1('0x2b'),_0xfdf1('0x73')]);_0x4aa4aa['field']=_0xfdf1('0x73');_0x3e8bee=as[_0xfdf1('0x74')](_0x14d521,_0x13d8de[_0xfdf1('0x3b')],_0x4aa4aa);_0x266fc5[_0x1e4d56](_0x3e8bee['text'],_0x3e8bee['value'][_0xfdf1('0x6b')],_0x3e8bee[_0xfdf1('0x62')][_0xfdf1('0x1e')]);}break;case'plainBody':_0x3e8bee=as[_0xfdf1('0x74')]('me',null,_0x4aa4aa);_0x266fc5[_0x1e4d56](_0x3e8bee[_0xfdf1('0x75')],_0x3e8bee[_0xfdf1('0x62')][_0xfdf1('0x6b')],_0x3e8bee[_0xfdf1('0x62')][_0xfdf1('0x1e')]);break;}}else{var _0x3e8bee=as[_0xfdf1('0x74')](_0x14d521,_0x13d8de[_0xfdf1('0x3b')],_0x4aa4aa);_0x266fc5[_0x1e4d56](_0x3e8bee['text'],_0x3e8bee[_0xfdf1('0x62')]['start'],_0x3e8bee[_0xfdf1('0x62')][_0xfdf1('0x1e')]);}}}else{var _0x55c5dc=_(_0x1c2f1b[_0xfdf1('0x3e')])[_0xfdf1('0x3f')]()['map'](function(_0x56654b){return _[_0xfdf1('0x76')](_0x2f3b08,[_0xfdf1('0x2b'),_0x56654b])?_0x56654b:undefined;})['compact']()[_0xfdf1('0x62')]();if(!_[_0xfdf1('0x77')](_0x55c5dc)){_0x55c5dc['forEach'](function(_0x2647a2){if(_0x2647a2===_0xfdf1('0x78')){_0x24d822[_0xfdf1('0x48')](_0xfdf1('0x79'),[][_0xfdf1('0x7a')](_0x1c2f1b['query'][_0x2647a2]));}else if(_0x2647a2==='createdAt'){var _0x2e7d5d=JSON[_0xfdf1('0x7b')](_0x1c2f1b['query'][_0x2647a2])[_0xfdf1('0x7c')];var _0x37a409=JSON[_0xfdf1('0x7b')](_0x1c2f1b[_0xfdf1('0x3e')][_0x2647a2])[_0xfdf1('0x7d')];_0x24d822[_0xfdf1('0x48')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x2e7d5d,_0x37a409);}else{if(_0x1c2f1b[_0xfdf1('0x3e')][_0x2647a2]===_0xfdf1('0x7e')){_0x24d822[_0xfdf1('0x48')]('i.'+_0x2647a2+'\x20IS\x20NULL');}else{_0x24d822['where']('i.'+_0x2647a2+_0xfdf1('0x7f'),_0x1c2f1b[_0xfdf1('0x3e')][_0x2647a2]);}}});}if(_0x1c2f1b[_0xfdf1('0x3e')]['read']){if(_0x1c2f1b[_0xfdf1('0x3e')][_0xfdf1('0x80')]==0x1){_0x24d822[_0xfdf1('0x63')](_0xfdf1('0x81'));}else{_0x24d822[_0xfdf1('0x63')]('`unreadMessages`\x20>\x200');}}if(_0x1c2f1b[_0xfdf1('0x3e')]['tag']){_0x5d1b8b=_['isArray'](_0x1c2f1b[_0xfdf1('0x3e')][_0xfdf1('0x82')])?_0x1c2f1b['query'][_0xfdf1('0x82')]:new Array(_0x1c2f1b[_0xfdf1('0x3e')][_0xfdf1('0x82')]);_0x5d1b8b[_0xfdf1('0x6d')](function(_0x19da05){_0x43ed2c['or'](_0xfdf1('0x6e'),'%,'+_0x19da05+',%');});}if(_0x1c2f1b['query']['filter']){var _0x3aba85=_0x1c2f1b[_0xfdf1('0x3e')][_0xfdf1('0x83')][_0xfdf1('0x84')]('\x5c','\x5c\x5c')[_0xfdf1('0x84')]('\x27\x27',_0xfdf1('0x85'));if(qs[_0xfdf1('0x86')](_0x3aba85)){_0x266fc5['or']('i.id\x20LIKE\x20?',_0x3aba85+'%');}else if(qs[_0xfdf1('0x87')](_0x3aba85)){_0x266fc5['or'](_0xfdf1('0x88'),_0x3aba85+'%');}else{_0x266fc5['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xfdf1('0x68')](_0x3aba85))['or'](_0xfdf1('0x89'),qs[_0xfdf1('0x68')](_0x3aba85));}}}_0x24d822[_0xfdf1('0x48')](_0x266fc5);_0x24d822[_0xfdf1('0x8a')](_0xfdf1('0x8b'));var _0x3ca2ee={'type':db[_0xfdf1('0x8c')]['QueryTypes'][_0xfdf1('0x8d')],'raw':!![]};var _0x1adca9=_0x24d822[_0xfdf1('0x8e')]();_0x1adca9[_0xfdf1('0x4b')]('i.id');_0x1adca9[_0xfdf1('0x4b')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xfdf1('0x8f'));if(_0x1f9f15[_0xfdf1('0x46')]){_0x1f9f15['order'][_0xfdf1('0x6d')](function(_0xe88e4b){_0x24d822['order']('i.'+_0xe88e4b[0x0],_0xe88e4b[0x1]===_0xfdf1('0x90')?![]:!![]);});}if(!_[_0xfdf1('0x77')](_0x5d1b8b)){_0x24d822[_0xfdf1('0x63')](_0x43ed2c);_0x1adca9['where']('t.id\x20IN\x20?',_0x5d1b8b);}BPromise[_0xfdf1('0x91')]()[_0xfdf1('0x28')](function(){if(!_0x301a39){if(_0x1c2f1b[_0xfdf1('0x3e')]['MailAccountId']||_0x1c2f1b[_0xfdf1('0x3e')][_0xfdf1('0x92')])return;_0x1adca9[_0xfdf1('0x48')](_0xfdf1('0x93'));_0x24d822[_0xfdf1('0x48')]('i.MailAccountId\x20IS\x20NOT\x20NULL');return;}return _0x1c2f1b['user'][_0xfdf1('0x94')]({'attributes':['id'],'raw':!![]})['then'](function(_0x362cf3){if(_[_0xfdf1('0x77')](_0x362cf3)){_0x1adca9['where'](_0xfdf1('0x95'));_0x24d822['where'](_0xfdf1('0x95'));}else{_0x1adca9[_0xfdf1('0x48')](_0xfdf1('0x79'),_[_0xfdf1('0x2d')](_0x362cf3,'id'));_0x24d822['where'](_0xfdf1('0x79'),_[_0xfdf1('0x2d')](_0x362cf3,'id'));}});})[_0xfdf1('0x28')](function(){db['sequelize'][_0xfdf1('0x3e')](_0x1adca9[_0xfdf1('0x96')](),_0x3ca2ee)[_0xfdf1('0x28')](function(_0x355c6d){_0x9ee85f['count']=_0x355c6d['length'];if(_0x9ee85f[_0xfdf1('0x1f')]===0x0)return[];return db[_0xfdf1('0x97')]['query'](_0x19b1a3[_0xfdf1('0x96')](),_0x3ca2ee)[_0xfdf1('0x28')](function(_0x48d292){_0x3a2a0f=_[_0xfdf1('0x98')](_0x48d292,'id');_0x3ca2ee=_[_0xfdf1('0x99')](_0x3ca2ee,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1c2f1b[_0xfdf1('0x3e')][_0xfdf1('0x42')]){_0x1f9f15[_0xfdf1('0x41')][_0xfdf1('0x6d')](function(_0x14218f){_0x24d822[_0xfdf1('0x4b')]('i.'+_0x14218f);});}else{_0x24d822[_0xfdf1('0x4b')](_0xfdf1('0x9a'),_0xfdf1('0x8f'));_0x24d822[_0xfdf1('0x4b')]('a.key',_0xfdf1('0x9b'));_0x24d822[_0xfdf1('0x4b')]('a.mandatoryDisposition',_0xfdf1('0x9c'));_0x24d822[_0xfdf1('0x4b')](_0xfdf1('0x8b'));_0x24d822[_0xfdf1('0x4b')]('i.createdAt');_0x24d822[_0xfdf1('0x4b')](_0xfdf1('0x9d'));_0x24d822[_0xfdf1('0x4b')]('i.closed');_0x24d822[_0xfdf1('0x4b')]('i.closedAt');_0x24d822[_0xfdf1('0x4b')](_0xfdf1('0x9e'));_0x24d822[_0xfdf1('0x4b')](_0xfdf1('0x9f'));_0x24d822['field'](_0xfdf1('0xa0'));_0x24d822[_0xfdf1('0x4b')](_0xfdf1('0xa1'));_0x24d822[_0xfdf1('0x4b')](_0xfdf1('0xa2'));_0x24d822['field'](_0xfdf1('0xa3'));_0x24d822[_0xfdf1('0x4b')](_0xfdf1('0xa4'));_0x24d822[_0xfdf1('0x4b')]('i.ContactId');_0x24d822[_0xfdf1('0x4b')](_0xfdf1('0xa5'));_0x24d822[_0xfdf1('0x4b')](_0xfdf1('0xa6'));_0x24d822[_0xfdf1('0x4b')](_0xfdf1('0xa7'),'Contact.firstName');_0x24d822[_0xfdf1('0x4b')](_0xfdf1('0xa8'),_0xfdf1('0xa9'));_0x24d822[_0xfdf1('0x4b')](_0xfdf1('0xaa'),'Contact.email');_0x24d822[_0xfdf1('0x4b')](_0xfdf1('0xab'),_0xfdf1('0xac'));_0x24d822[_0xfdf1('0x4b')]('c.mobile',_0xfdf1('0xad'));_0x24d822[_0xfdf1('0x4b')](_0xfdf1('0xae'),_0xfdf1('0xaf'));_0x24d822[_0xfdf1('0x4b')](_0xfdf1('0xb0'),_0xfdf1('0xb1'));_0x24d822['field'](_0xfdf1('0xb2'),'Owner.internal');_0x24d822[_0xfdf1('0x4b')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xfdf1('0x2f'));}_0x24d822['limit'](_0x1f9f15[_0xfdf1('0x21')]);_0x24d822['offset'](_0x1f9f15[_0xfdf1('0x20')]);return db['sequelize'][_0xfdf1('0x3e')](_0x24d822[_0xfdf1('0x96')](),_0x3ca2ee);})[_0xfdf1('0x28')](function(_0x26ddc2){_0x37f0c0['where'](_0xfdf1('0xb3'),_['map'](_0x26ddc2,'id'));return db['sequelize'][_0xfdf1('0x3e')](_0x37f0c0[_0xfdf1('0x96')](),_0x3ca2ee)[_0xfdf1('0x28')](function(_0x1b5b7f){var _0x5c75ec=_['groupBy'](_0x1b5b7f,_0xfdf1('0xb4'));var _0x3b79a0=[];return db['Setting'][_0xfdf1('0xb5')]({'attributes':[_0xfdf1('0xb6')],'raw':!![]})[_0xfdf1('0x28')](function(_0x1edf67){var _0x21c864=_0x1edf67['enableEmailPreview'];_0x26ddc2[_0xfdf1('0x6d')](function(_0x30391f){_0x3b79a0[_0xfdf1('0x32')](updateMailInteraction(_0x30391f,_0x3a2a0f,_0x5c75ec,_0x21c864));});return BPromise['all'](_0x3b79a0);});});});})[_0xfdf1('0x28')](function(_0x513ea3){_0x9ee85f[_0xfdf1('0xb7')]=_0x513ea3;return _0x9ee85f;})['then'](respondWithFilteredResult(_0x416053,_0x1f9f15));})[_0xfdf1('0x37')](handleError(_0x416053,null));};exports[_0xfdf1('0xb8')]=function(_0x39054b,_0x3f4364){var _0xeb982f={'raw':![],'where':{'id':_0x39054b[_0xfdf1('0xb9')]['id']}},_0x3f600d={};_0x3f600d[_0xfdf1('0x3d')]=_[_0xfdf1('0x3f')](db[_0xfdf1('0x33')][_0xfdf1('0x39')]);_0x3f600d[_0xfdf1('0x3e')]=_[_0xfdf1('0x3f')](_0x39054b[_0xfdf1('0x3e')]);_0x3f600d[_0xfdf1('0x49')]=_[_0xfdf1('0x40')](_0x3f600d[_0xfdf1('0x3d')],_0x3f600d['query']);_0xeb982f[_0xfdf1('0x41')]=_['intersection'](_0x3f600d[_0xfdf1('0x3d')],qs[_0xfdf1('0x42')](_0x39054b[_0xfdf1('0x3e')]['fields']));_0xeb982f[_0xfdf1('0x41')]=_0xeb982f[_0xfdf1('0x41')]['length']?_0xeb982f[_0xfdf1('0x41')]:_0x3f600d['model'];if(_0x39054b[_0xfdf1('0x3e')]['includeAll']){_0xeb982f[_0xfdf1('0xba')]=[{'all':!![]}];}_0xeb982f=_[_0xfdf1('0x99')]({},_0xeb982f,_0x39054b[_0xfdf1('0xbb')]);return db[_0xfdf1('0x33')][_0xfdf1('0x61')](_0xeb982f)['then'](handleEntityNotFound(_0x3f4364,null))['then'](respondWithResult(_0x3f4364,null))[_0xfdf1('0x37')](handleError(_0x3f4364,null));};exports[_0xfdf1('0xbc')]=function(_0x583842,_0x58870a){return db[_0xfdf1('0x33')][_0xfdf1('0xbc')](_0x583842[_0xfdf1('0xbd')],{})[_0xfdf1('0x28')](respondWithResult(_0x58870a,0xc9))[_0xfdf1('0x37')](handleError(_0x58870a,null));};exports[_0xfdf1('0x27')]=function(_0xd6e6a5,_0x5e1a9b){if(_0xd6e6a5[_0xfdf1('0xbd')]['id']){delete _0xd6e6a5['body']['id'];}return db[_0xfdf1('0x33')][_0xfdf1('0x61')]({'where':{'id':_0xd6e6a5[_0xfdf1('0xb9')]['id']}})[_0xfdf1('0x28')](handleEntityNotFound(_0x5e1a9b,null))[_0xfdf1('0x28')](saveUpdates(_0xd6e6a5[_0xfdf1('0xbd')],null))['then'](respondWithResult(_0x5e1a9b,null))[_0xfdf1('0x37')](handleError(_0x5e1a9b,null));};exports[_0xfdf1('0xbe')]=function(_0x363a0b,_0x2f2284){return db[_0xfdf1('0x33')][_0xfdf1('0x61')]({'where':{'id':_0x363a0b['params']['id']}})[_0xfdf1('0x28')](handleEntityNotFound(_0x2f2284,null))[_0xfdf1('0x28')](removeEntity(_0x2f2284,null))[_0xfdf1('0x37')](handleError(_0x2f2284,null));};exports['describe']=function(_0x3e376b,_0x1eb85f){return db[_0xfdf1('0x33')][_0xfdf1('0xbf')]()['then'](respondWithResult(_0x1eb85f,null))['catch'](handleError(_0x1eb85f,null));};exports[_0xfdf1('0xc0')]=function(_0x51b5f0,_0x407652,_0x7a295){return db['MailMessage'][_0xfdf1('0x61')]({'where':{'id':_0x51b5f0[_0xfdf1('0xb9')]['id']}})[_0xfdf1('0x28')](handleEntityNotFound(_0x407652,null))[_0xfdf1('0x28')](function(_0xd79a56){if(_0xd79a56){return _0xd79a56[_0xfdf1('0xc0')](_0x51b5f0['body']['ids'],_['omit'](_0x51b5f0[_0xfdf1('0xbd')],[_0xfdf1('0xc1'),'id'])||{});}})['then'](respondWithResult(_0x407652,null))[_0xfdf1('0x37')](handleError(_0x407652,null));};exports[_0xfdf1('0xc2')]=function(_0x3e2d39,_0x971161,_0x5125c1){var _0x367d27={'raw':![],'where':{}};var _0x4f66f9={};var _0x23b45f={'count':0x0,'rows':[]};return db[_0xfdf1('0x33')][_0xfdf1('0xb5')]({'where':{'id':_0x3e2d39[_0xfdf1('0xb9')]['id']}})[_0xfdf1('0x28')](handleEntityNotFound(_0x971161,null))[_0xfdf1('0x28')](function(_0x1d2d04){if(_0x1d2d04){_0x4f66f9[_0xfdf1('0x3d')]=_['keys'](db[_0xfdf1('0xc3')][_0xfdf1('0x39')]);_0x4f66f9[_0xfdf1('0x3e')]=_[_0xfdf1('0x3f')](_0x3e2d39['query']);_0x4f66f9['filters']=_['intersection'](_0x4f66f9[_0xfdf1('0x3d')],_0x4f66f9['query']);_0x367d27[_0xfdf1('0x41')]=_[_0xfdf1('0x40')](_0x4f66f9[_0xfdf1('0x3d')],qs['fields'](_0x3e2d39[_0xfdf1('0x3e')][_0xfdf1('0x42')]));_0x367d27[_0xfdf1('0x41')]=_0x367d27[_0xfdf1('0x41')][_0xfdf1('0x43')]?_0x367d27['attributes']:_0x4f66f9[_0xfdf1('0x3d')];if(!_0x3e2d39[_0xfdf1('0x3e')][_0xfdf1('0x44')]('nolimit')){_0x367d27[_0xfdf1('0x21')]=qs[_0xfdf1('0x21')](_0x3e2d39[_0xfdf1('0x3e')]['limit']);_0x367d27['offset']=qs[_0xfdf1('0x20')](_0x3e2d39[_0xfdf1('0x3e')][_0xfdf1('0x20')]);}_0x367d27['order']=qs[_0xfdf1('0x47')](_0x3e2d39[_0xfdf1('0x3e')][_0xfdf1('0x47')]);_0x367d27['where']=qs[_0xfdf1('0x49')](_[_0xfdf1('0x4a')](_0x3e2d39['query'],_0x4f66f9[_0xfdf1('0x49')]));_0x367d27[_0xfdf1('0x48')]['MailInteractionId']=_0x1d2d04['id'];if(_0x3e2d39[_0xfdf1('0x3e')][_0xfdf1('0x83')]){_0x367d27[_0xfdf1('0x48')]=_['merge'](_0x367d27[_0xfdf1('0x48')],{'$or':_['map'](_0x367d27[_0xfdf1('0x41')],function(_0xd58d8f){var _0x2d483e={};_0x2d483e[_0xd58d8f]={'$like':'%'+_0x3e2d39[_0xfdf1('0x3e')][_0xfdf1('0x83')]+'%'};return _0x2d483e;})});}if(_0x3e2d39[_0xfdf1('0x3e')][_0xfdf1('0x7c')]){var _0x4aa78e=_0x3e2d39['query'][_0xfdf1('0x7c')]['split'](',');var _0x1d52ca={};_0x1d52ca[_0x4aa78e[0x0]]={'$gte':moment(_0x4aa78e[0x1])[_0xfdf1('0xc4')]('YYYY-MM-DD\x20HH:mm:ss')};_0x367d27[_0xfdf1('0x48')]=_[_0xfdf1('0x99')](_0x367d27[_0xfdf1('0x48')],_0x1d52ca);}_0x367d27=_[_0xfdf1('0x99')]({},_0x367d27,_0x3e2d39[_0xfdf1('0xbb')]);return db[_0xfdf1('0xc3')][_0xfdf1('0x1f')]({'where':_0x367d27[_0xfdf1('0x48')]})[_0xfdf1('0x28')](function(_0x3acfce){_0x23b45f[_0xfdf1('0x1f')]=_0x3acfce;if(_0x3e2d39[_0xfdf1('0x3e')][_0xfdf1('0xc5')]){_0x367d27['include']=[{'all':!![]}];}return db['MailMessage'][_0xfdf1('0xc6')](_0x367d27);})['then'](function(_0x5b0323){_0x23b45f[_0xfdf1('0xb7')]=_0x5b0323;return _0x23b45f;});}})[_0xfdf1('0x28')](respondWithFilteredResult(_0x971161,_0x367d27))[_0xfdf1('0x37')](handleError(_0x971161,null));};exports[_0xfdf1('0xc7')]=function(_0x1c3d13,_0x42e182,_0x3cb74c){return db[_0xfdf1('0x33')]['find']({'where':{'id':_0x1c3d13['params']['id']}})[_0xfdf1('0x28')](handleEntityNotFound(_0x42e182,null))[_0xfdf1('0x28')](function(_0x5256f0){if(_0x5256f0){return _0x5256f0[_0xfdf1('0xc8')](_0x1c3d13[_0xfdf1('0xbd')][_0xfdf1('0xc1')],_['omit'](_0x1c3d13[_0xfdf1('0xbd')],[_0xfdf1('0xc1'),'id'])||{})[_0xfdf1('0xc9')](function(){return db[_0xfdf1('0x6c')][_0xfdf1('0xc6')]({'attributes':['id',_0xfdf1('0x2b'),_0xfdf1('0x4c')],'where':{'id':_0x1c3d13[_0xfdf1('0xbd')]['ids']}});})[_0xfdf1('0x28')](function(_0x615c28){socket[_0xfdf1('0xca')](_0xfdf1('0xcb'),{'id':Number(_0x1c3d13[_0xfdf1('0xb9')]['id']),'tags':_0x615c28||[]});return{'id':Number(_0x1c3d13[_0xfdf1('0xb9')]['id']),'tags':_0x615c28||[]};});}})[_0xfdf1('0x28')](respondWithResult(_0x42e182,null))[_0xfdf1('0x37')](handleError(_0x42e182,null));};exports[_0xfdf1('0xcc')]=function(_0x5b96b6,_0x4f1a6e,_0x26a194){return db[_0xfdf1('0x33')]['find']({'where':{'id':_0x5b96b6['params']['id']}})['then'](handleEntityNotFound(_0x4f1a6e,null))[_0xfdf1('0x28')](function(_0x29dd14){if(_0x29dd14){return _0x29dd14[_0xfdf1('0xcc')](_0x5b96b6[_0xfdf1('0x3e')][_0xfdf1('0xc1')]);}})[_0xfdf1('0x28')](respondWithStatusCode(_0x4f1a6e,null))[_0xfdf1('0x37')](handleError(_0x4f1a6e,null));};exports[_0xfdf1('0xcd')]=function(_0x2429ab,_0x4069fa){var _0x3d5b60=moment()['unix']()['toString']();var _0xd94ac8=path[_0xfdf1('0xce')](config[_0xfdf1('0xcf')],_0xfdf1('0xd0'),'files',_0xfdf1('0xd1'));var _0x36ce89=path[_0xfdf1('0xce')](config[_0xfdf1('0xcf')],_0xfdf1('0xd0'),_0xfdf1('0xd2'),'attachments');var _0x1a8dba=path[_0xfdf1('0xce')](_0xd94ac8,_0x3d5b60);var _0x4e5612=util[_0xfdf1('0xc4')](_0xfdf1('0xd3'),_0x2429ab[_0xfdf1('0xb9')]['id'],_0x3d5b60);var _0x32f2bf=path[_0xfdf1('0xce')](_0xd94ac8,_0x4e5612);var _0x4365da=[];if(_0x2429ab[_0xfdf1('0x3e')][_0xfdf1('0xd4')]){_0x4365da[_0xfdf1('0x32')]({'model':db['Attachment'],'as':'Attachments','raw':!![]});}var _0x21d325=[{'model':db[_0xfdf1('0xc3')],'as':_0xfdf1('0xd5'),'attributes':['id',_0xfdf1('0xbd'),_0xfdf1('0x51'),'to','cc',_0xfdf1('0xd6'),_0xfdf1('0xd7'),'createdAt'],'where':{'secret':![]},'order':qs[_0xfdf1('0x47')]('id'),'include':_0x4365da}];return db['MailInteraction'][_0xfdf1('0x61')]({'where':{'id':_0x2429ab['params']['id']},'include':_0x21d325})['then'](handleEntityNotFound(_0x4069fa,null))['then'](function(_0x1f8b5b){if(_0x1f8b5b&&_0x1f8b5b[_0xfdf1('0xd5')]){var _0xd7b9bc=_0x1f8b5b[_0xfdf1('0xd8')]({'plain':!![]});fs['mkdirSync'](_0x1a8dba);return BPromise['each'](_0xd7b9bc[_0xfdf1('0xd5')],function(_0x3cff1d,_0x5e74ee){var _0x5c0896={'from':_0x3cff1d['from'],'to':_0x3cff1d['to'],'subject':_0x3cff1d[_0xfdf1('0xd7')],'html':_0x3cff1d[_0xfdf1('0xbd')],'headers':{'Date':moment(_0x3cff1d[_0xfdf1('0xd9')])['format'](_0xfdf1('0xda'))},'attachments':[]};if(_0x3cff1d['cc']){_0x5c0896[_0xfdf1('0xdb')]['Cc']=_0x3cff1d['cc'];}if(_0x3cff1d['bcc']){_0x5c0896[_0xfdf1('0xdb')][_0xfdf1('0xdc')]=_0x3cff1d[_0xfdf1('0xd6')];}return new BPromise(function(_0x3c3f83,_0x308fc5){if(_0x3cff1d[_0xfdf1('0xdd')]){for(var _0x3943f5=0x0;_0x3943f5<_0x3cff1d['Attachments'][_0xfdf1('0x43')];_0x3943f5++){var _0x6c144b=_0x3cff1d[_0xfdf1('0xdd')][_0x3943f5];var _0x112910=path[_0xfdf1('0xce')](_0x36ce89,_0x6c144b[_0xfdf1('0xde')]);if(fs[_0xfdf1('0xdf')](_0x112910)){_0x5c0896['attachments'][_0xfdf1('0x32')]({'name':_0x6c144b['name'],'contentType':_0x6c144b['type'],'data':fs[_0xfdf1('0xe0')](_0x112910)});}}}emlformat['build'](_0x5c0896,function(_0xbee1ca,_0xf348c3){if(_0xbee1ca)return _0x308fc5(_0xbee1ca);fs['writeFileSync'](path[_0xfdf1('0xce')](_0x1a8dba,util['format'](_0xfdf1('0xe1'),_0x5e74ee)),_0xf348c3);return _0x3c3f83(_0xf348c3);});});})[_0xfdf1('0x28')](function(){return new BPromise(function(_0x5dbf78,_0x45d805){zipdir(_0x1a8dba,{'saveTo':_0x32f2bf},function(_0x42914e,_0xcc9345){if(_0x42914e)return _0x45d805(_0x42914e);return _0x5dbf78(_0xcc9345);});})['then'](function(){return new BPromise(function(_0x461325,_0x2befad){rimraf(_0x1a8dba,function(_0x1c8b4e){if(_0x1c8b4e)_0x2befad(_0x1c8b4e);return _0x461325();});});})[_0xfdf1('0x28')](function(){return _0x4069fa['download'](_0x32f2bf,_0x4e5612,function(_0x936dd7){if(_0x936dd7){console['log']('err',_0x936dd7);}else{fs['unlinkSync'](_0x32f2bf);}});});});}else{return _0x4069fa['sendStatus'](0xc8);}})[_0xfdf1('0x37')](handleError(_0x4069fa,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index f75a96f..97ef6c2 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 _0x6dbc=['Users','length','emit','catch','hasOwnProperty','events','../../mysqldb','MailInteraction','MailMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue'];(function(_0x36bf88,_0x15c459){var _0x332914=function(_0x512adf){while(--_0x512adf){_0x36bf88['push'](_0x36bf88['shift']());}};_0x332914(++_0x15c459);}(_0x6dbc,0x65));var _0xc6db=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x6dbc[_0x465a0c];return _0x1e202e;};'use strict';var EventEmitter=require(_0xc6db('0x0'));var MailInteraction=require(_0xc6db('0x1'))['db'][_0xc6db('0x2')];var MailMessage=require(_0xc6db('0x1'))['db'][_0xc6db('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xc6db('0x4')](0x0);var events={'afterCreate':_0xc6db('0x5'),'afterUpdate':_0xc6db('0x6'),'afterDestroy':_0xc6db('0x7')};function emitEvent(_0x25246b){return function(_0x466d14,_0xd50616,_0x4a0377){_0x466d14[_0xc6db('0x8')]({'attributes':['id'],'raw':!![]})[_0xc6db('0x9')](function(_0x423877){_0x466d14[_0xc6db('0xa')](_0xc6db('0xb'),_0x423877['map'](function(_0xbb5ff){return{'id':_0xbb5ff['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x466d14['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc6db('0x9')](function(_0x2d67a1){_0x466d14[_0xc6db('0xa')]('unreadMessages',_0x2d67a1[_0xc6db('0xc')]);MailInteractionEvents[_0xc6db('0xd')](_0x25246b+':'+_0x466d14['id'],_0x466d14);MailInteractionEvents[_0xc6db('0xd')](_0x25246b,_0x466d14);_0x4a0377(null);})[_0xc6db('0xe')](_0x4a0377(null));};}for(var e in events){if(events[_0xc6db('0xf')](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module['exports']=MailInteractionEvents; \ No newline at end of file +var _0xb3cc=['unreadMessages','emit','catch','hook','exports','events','../../mysqldb','MailInteraction','save','update','remove','getUsers','setDataValue','Users','map','findAll','then'];(function(_0x1ca2b7,_0x4df50e){var _0x64a96b=function(_0x4e9d9e){while(--_0x4e9d9e){_0x1ca2b7['push'](_0x1ca2b7['shift']());}};_0x64a96b(++_0x4df50e);}(_0xb3cc,0x1f2));var _0xcb3c=function(_0x735a49,_0x3da3fd){_0x735a49=_0x735a49-0x0;var _0xee7e9=_0xb3cc[_0x735a49];return _0xee7e9;};'use strict';var EventEmitter=require(_0xcb3c('0x0'));var MailInteraction=require(_0xcb3c('0x1'))['db'][_0xcb3c('0x2')];var MailMessage=require('../../mysqldb')['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xcb3c('0x3'),'afterUpdate':_0xcb3c('0x4'),'afterDestroy':_0xcb3c('0x5')};function emitEvent(_0x5f18f5){return function(_0x3f09b2,_0x543cf3,_0x4e58c2){_0x3f09b2[_0xcb3c('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x5a6e10){_0x3f09b2[_0xcb3c('0x7')](_0xcb3c('0x8'),_0x5a6e10[_0xcb3c('0x9')](function(_0x50ba2a){return{'id':_0x50ba2a['id']};}));return MailMessage[_0xcb3c('0xa')]({'where':{'MailInteractionId':_0x3f09b2['id'],'direction':'in','read':![]},'raw':!![]});})[_0xcb3c('0xb')](function(_0x544139){_0x3f09b2['setDataValue'](_0xcb3c('0xc'),_0x544139['length']);MailInteractionEvents['emit'](_0x5f18f5+':'+_0x3f09b2['id'],_0x3f09b2);MailInteractionEvents[_0xcb3c('0xd')](_0x5f18f5,_0x3f09b2);_0x4e58c2(null);})[_0xcb3c('0xe')](_0x4e58c2(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0xcb3c('0xf')](e,emitEvent(event));}}module[_0xcb3c('0x10')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 16951ed..ded5f2c 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 _0xf429=['request-promise','rimraf','../../config/environment','./mailInteraction.attributes','define','MailInteraction','mail_interactions','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','models','MailMessage','update','catch','utf8mb4','util','../../config/logger','api','bluebird'];(function(_0x158752,_0xe0679a){var _0x5a236d=function(_0x3875ef){while(--_0x3875ef){_0x158752['push'](_0x158752['shift']());}};_0x5a236d(++_0xe0679a);}(_0xf429,0xd4));var _0x9f42=function(_0x3a1b90,_0x3c0158){_0x3a1b90=_0x3a1b90-0x0;var _0xf6de77=_0xf429[_0x3a1b90];return _0xf6de77;};'use strict';var _=require('lodash');var util=require(_0x9f42('0x0'));var logger=require(_0x9f42('0x1'))(_0x9f42('0x2'));var moment=require('moment');var BPromise=require(_0x9f42('0x3'));var rp=require(_0x9f42('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9f42('0x5'));var config=require(_0x9f42('0x6'));var attributes=require(_0x9f42('0x7'));module['exports']=function(_0x4d3ea7,_0x874a2b){return _0x4d3ea7[_0x9f42('0x8')](_0x9f42('0x9'),attributes,{'tableName':_0x9f42('0xa'),'paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':['subject','to'],'type':_0x9f42('0xb')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x583df0,_0x9ebde2,_0x5dde1c){if(_0x583df0[_0x9f42('0xc')]){_0x583df0[_0x9f42('0xd')]=moment()[_0x9f42('0xe')](_0x9f42('0xf'));}if(_0x583df0[_0x9f42('0x10')]){_0x583df0[_0x9f42('0x11')]=moment()['format'](_0x9f42('0xf'));}_0x5dde1c(null,_0x9ebde2);},'beforeUpdate':function(_0x4f8b08,_0x425fa5,_0x78bc2a){if(_0x4f8b08[_0x9f42('0x12')](_0x9f42('0xc'))){_0x4f8b08[_0x9f42('0xd')]=_0x4f8b08[_0x9f42('0xc')]?moment()['format'](_0x9f42('0xf')):null;}if(_0x4f8b08[_0x9f42('0x12')](_0x9f42('0x10'))){_0x4f8b08[_0x9f42('0x11')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x4f8b08[_0x9f42('0xc')]=null;_0x4f8b08[_0x9f42('0xd')]=null;}_0x78bc2a(null,_0x4f8b08);},'afterUpdate':function(_0x50807b,_0x2658aa,_0x3e292d){var _0x3bdae8=_0x4d3ea7[_0x9f42('0x13')];var _0x186ee6=_0x50807b['get']({'plain':!![]});if(_0x186ee6[_0x9f42('0x10')]){return _0x3bdae8[_0x9f42('0x14')][_0x9f42('0x15')]({'read':!![]},{'where':{'MailInteractionId':_0x186ee6['id']}})['then'](function(){_0x3e292d();})[_0x9f42('0x16')](function(_0x299aa4){_0x3e292d(_0x299aa4);});}else{_0x3e292d();}}},'charset':_0x9f42('0x17'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xb945=['utf8mb4_unicode_ci','lodash','../../config/logger','moment','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','define','MailInteraction','mail_interactions','fti_mail_interactions','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','changed','closedAt','models','MailMessage','update','catch'];(function(_0x30a5b5,_0x21e05e){var _0x58e1c4=function(_0x67af6f){while(--_0x67af6f){_0x30a5b5['push'](_0x30a5b5['shift']());}};_0x58e1c4(++_0x21e05e);}(_0xb945,0x97));var _0x5b94=function(_0x22a80c,_0x4b5e06){_0x22a80c=_0x22a80c-0x0;var _0x1c8501=_0xb945[_0x22a80c];return _0x1c8501;};'use strict';var _=require(_0x5b94('0x0'));var util=require('util');var logger=require(_0x5b94('0x1'))('api');var moment=require(_0x5b94('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5b94('0x3'));var rimraf=require(_0x5b94('0x4'));var config=require(_0x5b94('0x5'));var attributes=require(_0x5b94('0x6'));module[_0x5b94('0x7')]=function(_0x4bef06,_0x492388){return _0x4bef06[_0x5b94('0x8')](_0x5b94('0x9'),attributes,{'tableName':_0x5b94('0xa'),'paranoid':![],'indexes':[{'name':_0x5b94('0xb'),'fields':['subject','to'],'type':_0x5b94('0xc')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x57e9fc,_0x3e7695,_0x3e1b21){if(_0x57e9fc[_0x5b94('0xd')]){_0x57e9fc[_0x5b94('0xe')]=moment()[_0x5b94('0xf')](_0x5b94('0x10'));}if(_0x57e9fc[_0x5b94('0x11')]){_0x57e9fc['closedAt']=moment()[_0x5b94('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x3e1b21(null,_0x3e7695);},'beforeUpdate':function(_0x1d420e,_0x774a72,_0x11e65c){if(_0x1d420e[_0x5b94('0x12')](_0x5b94('0xd'))){_0x1d420e['substatusAt']=_0x1d420e[_0x5b94('0xd')]?moment()[_0x5b94('0xf')](_0x5b94('0x10')):null;}if(_0x1d420e[_0x5b94('0x12')]('closed')){_0x1d420e[_0x5b94('0x13')]=moment()['format'](_0x5b94('0x10'));_0x1d420e[_0x5b94('0xd')]=null;_0x1d420e['substatusAt']=null;}_0x11e65c(null,_0x1d420e);},'afterUpdate':function(_0x40fbc7,_0x168640,_0x1b1628){var _0x537c8e=_0x4bef06[_0x5b94('0x14')];var _0x371fce=_0x40fbc7['get']({'plain':!![]});if(_0x371fce[_0x5b94('0x11')]){return _0x537c8e[_0x5b94('0x15')][_0x5b94('0x16')]({'read':!![]},{'where':{'MailInteractionId':_0x371fce['id']}})['then'](function(){_0x1b1628();})[_0x5b94('0x17')](function(_0x1b1f5e){_0x1b1628(_0x1b1f5e);});}else{_0x1b1628();}}},'charset':'utf8mb4','collate':_0x5b94('0x18')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 2686848..85ff051 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 _0xb010=['stringify','error','MailInteraction,\x20%s,\x20%s','message','result','UpdateMailInteraction','MailInteraction','update','body','options','where','limit','catch','AddTagsToMailInteraction','addTags','ids','omit','spread','AddTags','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s'];(function(_0x61b3ab,_0x1fc298){var _0x57097f=function(_0x25970b){while(--_0x25970b){_0x61b3ab['push'](_0x61b3ab['shift']());}};_0x57097f(++_0x1fc298);}(_0xb010,0x8b));var _0x0b01=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0xb010[_0x4ae6ef];return _0x3cbb4e;};'use strict';var _=require('lodash');var util=require(_0x0b01('0x0'));var moment=require('moment');var BPromise=require(_0x0b01('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0b01('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x0b01('0x3'));var logger=require(_0x0b01('0x4'))(_0x0b01('0x5'));var config=require(_0x0b01('0x6'));var jayson=require(_0x0b01('0x7'));var client=jayson[_0x0b01('0x8')][_0x0b01('0x9')]({'port':0x232a});config[_0x0b01('0xa')]=_[_0x0b01('0xb')](config[_0x0b01('0xa')],{'host':_0x0b01('0xc'),'port':0x18eb});var socket=require(_0x0b01('0xd'))(new Redis(config[_0x0b01('0xa')]));require('./mailInteraction.socket')[_0x0b01('0xe')](socket);function respondWithRpcPromise(_0xae6eac,_0x45108e,_0x22d309){return new BPromise(function(_0x36bd93,_0xfcc830){return client[_0x0b01('0xf')](_0xae6eac,_0x22d309)[_0x0b01('0x10')](function(_0x2008aa){logger[_0x0b01('0x11')]('MailInteraction,\x20%s,\x20%s',_0x45108e,_0x0b01('0x12'));logger[_0x0b01('0x13')](_0x0b01('0x14'),_0x45108e,_0x0b01('0x12'),JSON[_0x0b01('0x15')](_0x2008aa));if(_0x2008aa[_0x0b01('0x16')]){if(_0x2008aa[_0x0b01('0x16')]['code']===0x1f4){logger[_0x0b01('0x16')](_0x0b01('0x17'),_0x45108e,_0x2008aa[_0x0b01('0x16')][_0x0b01('0x18')]);return _0xfcc830(_0x2008aa[_0x0b01('0x16')][_0x0b01('0x18')]);}logger[_0x0b01('0x16')](_0x0b01('0x17'),_0x45108e,_0x2008aa[_0x0b01('0x16')][_0x0b01('0x18')]);return _0x36bd93(_0x2008aa[_0x0b01('0x16')][_0x0b01('0x18')]);}else{logger['info'](_0x0b01('0x17'),_0x45108e,_0x0b01('0x12'));_0x36bd93(_0x2008aa[_0x0b01('0x19')]['message']);}})['catch'](function(_0x52ee7a){logger[_0x0b01('0x16')](_0x0b01('0x17'),_0x45108e,_0x52ee7a);_0xfcc830(_0x52ee7a);});});}exports[_0x0b01('0x1a')]=function(_0x1d9227){var _0x2bc872=this;return new Promise(function(_0x2e47b0,_0x5a68c1){return db[_0x0b01('0x1b')][_0x0b01('0x1c')](_0x1d9227[_0x0b01('0x1d')],{'raw':_0x1d9227[_0x0b01('0x1e')]?_0x1d9227[_0x0b01('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d9227['options']?_0x1d9227[_0x0b01('0x1e')][_0x0b01('0x1f')]||null:null,'attributes':_0x1d9227[_0x0b01('0x1e')]?_0x1d9227[_0x0b01('0x1e')]['attributes']||null:null,'limit':_0x1d9227['options']?_0x1d9227['options'][_0x0b01('0x20')]||null:null})['then'](function(_0x4af9f6){logger['info'](_0x0b01('0x1a'),_0x1d9227);logger[_0x0b01('0x13')](_0x0b01('0x1a'),_0x1d9227,JSON[_0x0b01('0x15')](_0x4af9f6));_0x2e47b0(_0x4af9f6);})[_0x0b01('0x21')](function(_0x1c538e){logger[_0x0b01('0x16')](_0x0b01('0x1a'),_0x1c538e['message'],_0x1d9227);_0x5a68c1(_0x2bc872[_0x0b01('0x16')](0x1f4,_0x1c538e[_0x0b01('0x18')]));});});};exports[_0x0b01('0x22')]=function(_0x513f07){return new Promise(function(_0x53b17a,_0x29799c){return db['MailInteraction']['find']({'where':_0x513f07[_0x0b01('0x1e')]?_0x513f07[_0x0b01('0x1e')][_0x0b01('0x1f')]||null:null})['then'](function(_0x3a91bf){if(_0x3a91bf){return _0x3a91bf[_0x0b01('0x23')](_0x513f07[_0x0b01('0x1d')][_0x0b01('0x24')],_[_0x0b01('0x25')](_0x513f07[_0x0b01('0x1d')],[_0x0b01('0x24'),'id'])||{});}})[_0x0b01('0x26')](function(_0x51d668){logger[_0x0b01('0x11')](_0x0b01('0x27'),_0x513f07);logger[_0x0b01('0x13')]('AddTags',_0x513f07,JSON[_0x0b01('0x15')](_0x51d668));_0x53b17a(_0x51d668);})['catch'](function(_0x2f3fb4){logger['error'](_0x0b01('0x27'),_0x2f3fb4['message'],_0x513f07);_0x29799c(_this[_0x0b01('0x16')](0x1f4,_0x2f3fb4[_0x0b01('0x18')]));});});}; \ No newline at end of file +var _0x7914=['options','raw','where','limit','UpdateMailInteraction','AddTagsToMailInteraction','find','addTags','ids','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./mailInteraction.socket','register','request','then','info','request\x20sent','debug','stringify','error','code','MailInteraction,\x20%s,\x20%s','message','result','catch','MailInteraction','body'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7914,0x107));var _0x4791=function(_0xbc512d,_0x44d42a){_0xbc512d=_0xbc512d-0x0;var _0x380885=_0x7914[_0xbc512d];return _0x380885;};'use strict';var _=require(_0x4791('0x0'));var util=require(_0x4791('0x1'));var moment=require('moment');var BPromise=require(_0x4791('0x2'));var rs=require(_0x4791('0x3'));var fs=require('fs');var Redis=require(_0x4791('0x4'));var db=require(_0x4791('0x5'))['db'];var utils=require(_0x4791('0x6'));var logger=require(_0x4791('0x7'))(_0x4791('0x8'));var config=require(_0x4791('0x9'));var jayson=require(_0x4791('0xa'));var client=jayson[_0x4791('0xb')]['http']({'port':0x232a});config[_0x4791('0xc')]=_['defaults'](config[_0x4791('0xc')],{'host':_0x4791('0xd'),'port':0x18eb});var socket=require(_0x4791('0xe'))(new Redis(config[_0x4791('0xc')]));require(_0x4791('0xf'))[_0x4791('0x10')](socket);function respondWithRpcPromise(_0x438679,_0x3790aa,_0x57bb07){return new BPromise(function(_0x20e264,_0x3aa426){return client[_0x4791('0x11')](_0x438679,_0x57bb07)[_0x4791('0x12')](function(_0x876bdd){logger[_0x4791('0x13')]('MailInteraction,\x20%s,\x20%s',_0x3790aa,_0x4791('0x14'));logger[_0x4791('0x15')]('MailInteraction,\x20%s,\x20%s,\x20%s',_0x3790aa,_0x4791('0x14'),JSON[_0x4791('0x16')](_0x876bdd));if(_0x876bdd[_0x4791('0x17')]){if(_0x876bdd[_0x4791('0x17')][_0x4791('0x18')]===0x1f4){logger[_0x4791('0x17')](_0x4791('0x19'),_0x3790aa,_0x876bdd['error'][_0x4791('0x1a')]);return _0x3aa426(_0x876bdd[_0x4791('0x17')]['message']);}logger[_0x4791('0x17')](_0x4791('0x19'),_0x3790aa,_0x876bdd[_0x4791('0x17')][_0x4791('0x1a')]);return _0x20e264(_0x876bdd[_0x4791('0x17')]['message']);}else{logger['info'](_0x4791('0x19'),_0x3790aa,_0x4791('0x14'));_0x20e264(_0x876bdd[_0x4791('0x1b')][_0x4791('0x1a')]);}})[_0x4791('0x1c')](function(_0x59260a){logger[_0x4791('0x17')]('MailInteraction,\x20%s,\x20%s',_0x3790aa,_0x59260a);_0x3aa426(_0x59260a);});});}exports['UpdateMailInteraction']=function(_0x32a7eb){var _0x27a87b=this;return new Promise(function(_0x25286b,_0xcb902f){return db[_0x4791('0x1d')]['update'](_0x32a7eb[_0x4791('0x1e')],{'raw':_0x32a7eb['options']?_0x32a7eb[_0x4791('0x1f')][_0x4791('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x32a7eb['options']?_0x32a7eb[_0x4791('0x1f')][_0x4791('0x21')]||null:null,'attributes':_0x32a7eb[_0x4791('0x1f')]?_0x32a7eb[_0x4791('0x1f')]['attributes']||null:null,'limit':_0x32a7eb[_0x4791('0x1f')]?_0x32a7eb[_0x4791('0x1f')][_0x4791('0x22')]||null:null})['then'](function(_0x49cff7){logger[_0x4791('0x13')]('UpdateMailInteraction',_0x32a7eb);logger[_0x4791('0x15')](_0x4791('0x23'),_0x32a7eb,JSON[_0x4791('0x16')](_0x49cff7));_0x25286b(_0x49cff7);})[_0x4791('0x1c')](function(_0x4338ef){logger[_0x4791('0x17')](_0x4791('0x23'),_0x4338ef[_0x4791('0x1a')],_0x32a7eb);_0xcb902f(_0x27a87b[_0x4791('0x17')](0x1f4,_0x4338ef[_0x4791('0x1a')]));});});};exports[_0x4791('0x24')]=function(_0x5bbba3){return new Promise(function(_0x27387f,_0x55117f){return db[_0x4791('0x1d')][_0x4791('0x25')]({'where':_0x5bbba3[_0x4791('0x1f')]?_0x5bbba3[_0x4791('0x1f')][_0x4791('0x21')]||null:null})[_0x4791('0x12')](function(_0x4a101f){if(_0x4a101f){return _0x4a101f[_0x4791('0x26')](_0x5bbba3[_0x4791('0x1e')][_0x4791('0x27')],_['omit'](_0x5bbba3['body'],[_0x4791('0x27'),'id'])||{});}})[_0x4791('0x28')](function(_0x111202){logger[_0x4791('0x13')](_0x4791('0x29'),_0x5bbba3);logger[_0x4791('0x15')](_0x4791('0x29'),_0x5bbba3,JSON[_0x4791('0x16')](_0x111202));_0x27387f(_0x111202);})[_0x4791('0x1c')](function(_0x43aa3a){logger['error'](_0x4791('0x29'),_0x43aa3a[_0x4791('0x1a')],_0x5bbba3);_0x55117f(_this['error'](0x1f4,_0x43aa3a[_0x4791('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 00d46d0..b25c273 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 _0xcfbe=['mailInteraction:','./mailInteraction.events','save','remove','emit','removeListener','register','length'];(function(_0x36c247,_0x4b2cf7){var _0x4ce559=function(_0x5ec490){while(--_0x5ec490){_0x36c247['push'](_0x36c247['shift']());}};_0x4ce559(++_0x4b2cf7);}(_0xcfbe,0x171));var _0xecfb=function(_0x368250,_0x36d197){_0x368250=_0x368250-0x0;var _0x3acb12=_0xcfbe[_0x368250];return _0x3acb12;};'use strict';var MailInteractionEvents=require(_0xecfb('0x0'));var events=[_0xecfb('0x1'),_0xecfb('0x2'),'update'];function createListener(_0x120395,_0x1a0dc2){return function(_0x46b62f){_0x1a0dc2[_0xecfb('0x3')](_0x120395,_0x46b62f);};}function removeListener(_0x5a7736,_0xd44ea1){return function(){MailInteractionEvents[_0xecfb('0x4')](_0x5a7736,_0xd44ea1);};}exports[_0xecfb('0x5')]=function(_0x7302a2){for(var _0x8f2cc2=0x0,_0x10e75d=events[_0xecfb('0x6')];_0x8f2cc2<_0x10e75d;_0x8f2cc2++){var _0xc92d59=events[_0x8f2cc2];var _0x2fbcee=createListener(_0xecfb('0x7')+_0xc92d59,_0x7302a2);MailInteractionEvents['on'](_0xc92d59,_0x2fbcee);}}; \ No newline at end of file +var _0x42cb=['update','emit','removeListener','register','length','mailInteraction:','./mailInteraction.events','save','remove'];(function(_0x56ee27,_0x44ecd1){var _0x58989a=function(_0x48e2ab){while(--_0x48e2ab){_0x56ee27['push'](_0x56ee27['shift']());}};_0x58989a(++_0x44ecd1);}(_0x42cb,0x114));var _0xb42c=function(_0x5948d9,_0x2ba1ce){_0x5948d9=_0x5948d9-0x0;var _0x2ad522=_0x42cb[_0x5948d9];return _0x2ad522;};'use strict';var MailInteractionEvents=require(_0xb42c('0x0'));var events=[_0xb42c('0x1'),_0xb42c('0x2'),_0xb42c('0x3')];function createListener(_0x4bde55,_0x167cc8){return function(_0x29d89d){_0x167cc8[_0xb42c('0x4')](_0x4bde55,_0x29d89d);};}function removeListener(_0x1e4116,_0x6d03e3){return function(){MailInteractionEvents[_0xb42c('0x5')](_0x1e4116,_0x6d03e3);};}exports[_0xb42c('0x6')]=function(_0x4d12c1){for(var _0x2c5315=0x0,_0xb9369=events[_0xb42c('0x7')];_0x2c5315<_0xb9369;_0x2c5315++){var _0x264043=events[_0x2c5315];var _0x3792eb=createListener(_0xb42c('0x8')+_0x264043,_0x4d12c1);MailInteractionEvents['on'](_0x264043,_0x3792eb);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index d6102ea..858cf08 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 _0x7217=['mailmessage:create','create','put','update','accept','/:id/reject','reject','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','./mailMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','post','tracked','mail'];(function(_0x176148,_0x1ac70f){var _0x3a1f7b=function(_0x26a490){while(--_0x26a490){_0x176148['push'](_0x176148['shift']());}};_0x3a1f7b(++_0x1ac70f);}(_0x7217,0x19e));var _0x7721=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x7217[_0x56482c];return _0x5aae7a;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var auth=require(_0x7721('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7721('0x6'));router[_0x7721('0x7')]('/',auth[_0x7721('0x8')](),controller[_0x7721('0x9')]);router[_0x7721('0x7')](_0x7721('0xa'),auth[_0x7721('0x8')](),controller[_0x7721('0xb')]);router[_0x7721('0x7')](_0x7721('0xc'),auth[_0x7721('0x8')](),controller[_0x7721('0xd')]);router[_0x7721('0x7')](_0x7721('0xe'),auth[_0x7721('0x8')](),controller['download']);router[_0x7721('0xf')]('/',auth[_0x7721('0x8')](),interaction[_0x7721('0x10')](_0x7721('0x11'),_0x7721('0x12')),controller[_0x7721('0x13')]);router[_0x7721('0x14')](_0x7721('0xc'),auth['isAuthenticated'](),controller[_0x7721('0x15')]);router[_0x7721('0x14')]('/:id/accept',auth[_0x7721('0x8')](),controller[_0x7721('0x16')]);router[_0x7721('0x14')](_0x7721('0x17'),auth['isAuthenticated'](),controller[_0x7721('0x18')]);router[_0x7721('0x19')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x7721('0x1a')]=router; \ No newline at end of file +var _0x9f62=['./mailMessage.controller','get','isAuthenticated','/describe','describe','/:id/download','tracked','mailmessage:create','create','put','/:id/accept','accept','/:id/reject','reject','delete','/:id','destroy','exports','util','connect-timeout','express','Router','../../config/environment'];(function(_0x2de81b,_0x322f1d){var _0x3df553=function(_0x551338){while(--_0x551338){_0x2de81b['push'](_0x2de81b['shift']());}};_0x3df553(++_0x322f1d);}(_0x9f62,0x154));var _0x29f6=function(_0x574b69,_0x7af81a){_0x574b69=_0x574b69-0x0;var _0x139ec3=_0x9f62[_0x574b69];return _0x139ec3;};'use strict';var multer=require('multer');var util=require(_0x29f6('0x0'));var path=require('path');var timeout=require(_0x29f6('0x1'));var express=require(_0x29f6('0x2'));var router=express[_0x29f6('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x29f6('0x4'));var controller=require(_0x29f6('0x5'));router[_0x29f6('0x6')]('/',auth[_0x29f6('0x7')](),controller['index']);router[_0x29f6('0x6')](_0x29f6('0x8'),auth[_0x29f6('0x7')](),controller[_0x29f6('0x9')]);router[_0x29f6('0x6')]('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0x29f6('0xa'),auth[_0x29f6('0x7')](),controller['download']);router['post']('/',auth[_0x29f6('0x7')](),interaction[_0x29f6('0xb')]('mail',_0x29f6('0xc')),controller[_0x29f6('0xd')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x29f6('0xe')](_0x29f6('0xf'),auth[_0x29f6('0x7')](),controller[_0x29f6('0x10')]);router[_0x29f6('0xe')](_0x29f6('0x11'),auth[_0x29f6('0x7')](),controller[_0x29f6('0x12')]);router[_0x29f6('0x13')](_0x29f6('0x14'),auth[_0x29f6('0x7')](),controller[_0x29f6('0x15')]);module[_0x29f6('0x16')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index b224ae0..8f6228f 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 _0x6017=['out','STRING','DATE','INTEGER','sequelize','lodash','exports','long','TEXT','BOOLEAN'];(function(_0x16e2a9,_0x3cbc17){var _0x3d1866=function(_0x52f380){while(--_0x52f380){_0x16e2a9['push'](_0x16e2a9['shift']());}};_0x3d1866(++_0x3cbc17);}(_0x6017,0xae));var _0x7601=function(_0x5c4048,_0x137656){_0x5c4048=_0x5c4048-0x0;var _0x49126f=_0x6017[_0x5c4048];return _0x49126f;};'use strict';var Sequelize=require(_0x7601('0x0'));var _=require(_0x7601('0x1'));module[_0x7601('0x2')]={'body':{'type':Sequelize['TEXT'](_0x7601('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x7601('0x4')]('medium')},'read':{'type':Sequelize[_0x7601('0x5')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x7601('0x6')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0x7601('0x7')]},'to':{'type':Sequelize[_0x7601('0x4')](_0x7601('0x3'))},'cc':{'type':Sequelize[_0x7601('0x4')](_0x7601('0x3'))},'bcc':{'type':Sequelize[_0x7601('0x4')]('long')},'subject':{'type':Sequelize[_0x7601('0x4')]},'sentAt':{'type':Sequelize[_0x7601('0x8')]},'attach':{'type':Sequelize[_0x7601('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize[_0x7601('0x8')]},'originTo':{'type':Sequelize[_0x7601('0x4')](_0x7601('0x3'))},'originCc':{'type':Sequelize['TEXT'](_0x7601('0x3'))}}; \ No newline at end of file +var _0x0295=['DATE','sequelize','TEXT','medium','BOOLEAN','ENUM','out','STRING','long'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x0295,0x1f0));var _0x5029=function(_0xa34cd7,_0x589125){_0xa34cd7=_0xa34cd7-0x0;var _0x45bb92=_0x0295[_0xa34cd7];return _0x45bb92;};'use strict';var Sequelize=require(_0x5029('0x0'));var _=require('lodash');module['exports']={'body':{'type':Sequelize[_0x5029('0x1')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x5029('0x2'))},'read':{'type':Sequelize[_0x5029('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x5029('0x4')]('in',_0x5029('0x5')),'defaultValue':_0x5029('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x5029('0x6')](0x1fe)},'from':{'type':Sequelize[_0x5029('0x6')]},'to':{'type':Sequelize[_0x5029('0x1')](_0x5029('0x7'))},'cc':{'type':Sequelize['TEXT']('long')},'bcc':{'type':Sequelize['TEXT'](_0x5029('0x7'))},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize[_0x5029('0x8')]},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize[_0x5029('0x3')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0x5029('0x1')](_0x5029('0x7'))},'originCc':{'type':Sequelize[_0x5029('0x1')]('long')}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 52b99e7..48ada07 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 _0xc41f=['fieldName','type','model','query','keys','intersection','fields','attributes','length','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','rows','show','include','find','body','params','describe','create','direction','secret','MailAccountId','CmList','List','CmContact','Contacts','DESC','Smtp','isNil','service','host','port','secure','authentication','auth','pass','user','attachments','join','root','server/files/attachments','basename','ListId','SendMail','messageId','mail-interactions','accept','mail','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','Contact','get','MailInteraction','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','AcceptMessage','acceptMessage','interface','SIP/%s','channel','EventManager','acceptmessage','reject','agent','MailInteractionId','rejectMessage','event','rejectmessage','download','toString','server','files','tmp','from','bcc','subject','createdAt','Attachment','Attachments','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','push','readFileSync','build','writeFileSync','log','err','rimraf','request-promise','bluebird','mustache','util','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','jayson/promise','client','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','code','error','message','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','destroy','stack','name','send','index','map','MailMessage','rawAttributes'];(function(_0x29c261,_0x3af39a){var _0x1a9335=function(_0x40d1e8){while(--_0x40d1e8){_0x29c261['push'](_0x29c261['shift']());}};_0x1a9335(++_0x3af39a);}(_0xc41f,0x10b));var _0xfc41=function(_0x284807,_0x4be925){_0x284807=_0x284807-0x0;var _0x50c774=_0xc41f[_0x284807];return _0x50c774;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xfc41('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xfc41('0x1'));var moment=require('moment');var BPromise=require(_0xfc41('0x2'));var Mustache=require(_0xfc41('0x3'));var util=require(_0xfc41('0x4'));var path=require('path');var sox=require(_0xfc41('0x5'));var csv=require('to-csv');var ejs=require(_0xfc41('0x6'));var fs=require('fs');var _=require(_0xfc41('0x7'));var squel=require('squel');var crypto=require(_0xfc41('0x8'));var jsforce=require(_0xfc41('0x9'));var deskjs=require(_0xfc41('0xa'));var toCsv=require(_0xfc41('0xb'));var querystring=require(_0xfc41('0xc'));var Papa=require(_0xfc41('0xd'));var Redis=require(_0xfc41('0xe'));var authService=require(_0xfc41('0xf'));var qs=require(_0xfc41('0x10'));var as=require(_0xfc41('0x11'));var hardwareService=require(_0xfc41('0x12'));var logger=require(_0xfc41('0x13'))(_0xfc41('0x14'));var utils=require(_0xfc41('0x15'));var config=require(_0xfc41('0x16'));var db=require(_0xfc41('0x17'))['db'];config[_0xfc41('0x18')]=_[_0xfc41('0x19')](config[_0xfc41('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./mailMessage.socket')['register'](socket);var jayson=require(_0xfc41('0x1a'));var client=jayson[_0xfc41('0x1b')][_0xfc41('0x1c')]({'port':0x232c});var client9003=jayson[_0xfc41('0x1b')][_0xfc41('0x1c')]({'port':0x232b});var client9002=jayson['client'][_0xfc41('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x35d565,_0x447938,_0x5b78a1){if(_0x5b78a1){var _0x20a26a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x20a26a[_0xfc41('0x1d')](_0x447938)){return _0x35d565;}else{throw new db['Sequelize'][(_0xfc41('0x1e'))](_0xfc41('0x1f'));}}else{return _0x35d565;}}function respondWithRpcPromise(_0x334682,_0x111043,_0x721b34,_0x5b8b50){return new BPromise(function(_0x436270,_0x5936f4){var _0x308ed9=_0x5b8b50||client;return _0x308ed9['request'](_0x334682,_0x721b34)[_0xfc41('0x20')](function(_0x2d76e1){logger[_0xfc41('0x21')](_0xfc41('0x22'),_0x111043,_0xfc41('0x23'));logger[_0xfc41('0x24')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x111043,_0xfc41('0x23'),JSON['stringify'](_0x2d76e1));if(_0x2d76e1['error']){if(_0x2d76e1['error'][_0xfc41('0x25')]===0x1f4){logger[_0xfc41('0x26')](_0xfc41('0x22'),_0x111043,_0x2d76e1[_0xfc41('0x26')][_0xfc41('0x27')]);return _0x5936f4(_0x2d76e1[_0xfc41('0x26')][_0xfc41('0x27')]);}logger['error'](_0xfc41('0x22'),_0x111043,_0x2d76e1[_0xfc41('0x26')]['message']);return _0x436270(_0x2d76e1[_0xfc41('0x26')][_0xfc41('0x27')]);}else{logger[_0xfc41('0x21')](_0xfc41('0x22'),_0x111043,'request\x20sent');_0x436270(_0x2d76e1['result'][_0xfc41('0x27')]);}})[_0xfc41('0x28')](function(_0x3341fc){logger[_0xfc41('0x26')]('MailMessage,\x20%s,\x20%s',_0x111043,_0x3341fc);_0x5936f4(_0x3341fc);});});}function respondWithStatusCode(_0x22507f,_0x152520){_0x152520=_0x152520||0xcc;return function(_0x445d8f){if(_0x445d8f){return _0x22507f[_0xfc41('0x29')](_0x152520);}return _0x22507f[_0xfc41('0x2a')](_0x152520)[_0xfc41('0x2b')]();};}function respondWithResult(_0x18259c,_0x3b1437){_0x3b1437=_0x3b1437||0xc8;return function(_0x55e937){if(_0x55e937){return _0x18259c[_0xfc41('0x2a')](_0x3b1437)[_0xfc41('0x2c')](_0x55e937);}};}function respondWithFilteredResult(_0x3ce364,_0x52e514){return function(_0x461578){if(_0x461578){var _0x10bda5=_0x461578[_0xfc41('0x2d')],_0x11bea3=_0x52e514[_0xfc41('0x2e')],_0xc6bda2=_0x52e514[_0xfc41('0x2e')]+_0x52e514[_0xfc41('0x2f')],_0x4f09ac;if(_0xc6bda2>=_0x10bda5){_0xc6bda2=_0x10bda5;_0x4f09ac=0xc8;}else{_0x4f09ac=0xce;}_0x3ce364['status'](_0x4f09ac);return _0x3ce364[_0xfc41('0x30')](_0xfc41('0x31'),_0x11bea3+'-'+_0xc6bda2+'/'+_0x10bda5)['json'](_0x461578);}return null;};}function patchUpdates(_0x46ee28){return function(_0x43dbcc){try{jsonpatch[_0xfc41('0x32')](_0x43dbcc,_0x46ee28,!![]);}catch(_0x42179f){return BPromise['reject'](_0x42179f);}return _0x43dbcc[_0xfc41('0x33')]();};}function saveUpdates(_0x58eb8f,_0x193083){return function(_0x14ee04){if(_0x14ee04){return _0x14ee04[_0xfc41('0x34')](_0x58eb8f)[_0xfc41('0x20')](function(_0x3ff3af){return _0x3ff3af;});}return null;};}function removeEntity(_0x6faa0,_0x7b4c45){return function(_0x3b33df){if(_0x3b33df){return _0x3b33df[_0xfc41('0x35')]()[_0xfc41('0x20')](function(){_0x6faa0[_0xfc41('0x2a')](0xcc)[_0xfc41('0x2b')]();});}};}function handleEntityNotFound(_0x5d6483,_0x17104f){return function(_0x1b01fa){if(!_0x1b01fa){_0x5d6483[_0xfc41('0x29')](0x194);}return _0x1b01fa;};}function handleError(_0x5d9352,_0x22b293){_0x22b293=_0x22b293||0x1f4;return function(_0x134d48){logger[_0xfc41('0x26')](_0x134d48[_0xfc41('0x36')]);if(_0x134d48['name']){delete _0x134d48[_0xfc41('0x37')];}_0x5d9352[_0xfc41('0x2a')](_0x22b293)[_0xfc41('0x38')](_0x134d48);};}exports[_0xfc41('0x39')]=function(_0x47ca36,_0x7fc3c8){var _0x372f07={},_0x3e4aab={},_0x511c82={'count':0x0,'rows':[]};var _0x493711=_[_0xfc41('0x3a')](db[_0xfc41('0x3b')][_0xfc41('0x3c')],function(_0x25b7e1){return{'name':_0x25b7e1[_0xfc41('0x3d')],'type':_0x25b7e1[_0xfc41('0x3e')]['key']};});_0x3e4aab[_0xfc41('0x3f')]=_[_0xfc41('0x3a')](_0x493711,_0xfc41('0x37'));_0x3e4aab[_0xfc41('0x40')]=_[_0xfc41('0x41')](_0x47ca36['query']);_0x3e4aab['filters']=_['intersection'](_0x3e4aab['model'],_0x3e4aab[_0xfc41('0x40')]);_0x372f07['attributes']=_[_0xfc41('0x42')](_0x3e4aab[_0xfc41('0x3f')],qs[_0xfc41('0x43')](_0x47ca36[_0xfc41('0x40')][_0xfc41('0x43')]));_0x372f07[_0xfc41('0x44')]=_0x372f07[_0xfc41('0x44')][_0xfc41('0x45')]?_0x372f07[_0xfc41('0x44')]:_0x3e4aab[_0xfc41('0x3f')];if(!_0x47ca36[_0xfc41('0x40')]['hasOwnProperty'](_0xfc41('0x46'))){_0x372f07[_0xfc41('0x2f')]=qs[_0xfc41('0x2f')](_0x47ca36[_0xfc41('0x40')][_0xfc41('0x2f')]);_0x372f07['offset']=qs[_0xfc41('0x2e')](_0x47ca36[_0xfc41('0x40')]['offset']);}_0x372f07['order']=qs[_0xfc41('0x47')](_0x47ca36[_0xfc41('0x40')][_0xfc41('0x47')]);_0x372f07[_0xfc41('0x48')]=qs[_0xfc41('0x49')](_[_0xfc41('0x4a')](_0x47ca36['query'],_0x3e4aab[_0xfc41('0x49')]));if(_0x47ca36[_0xfc41('0x40')][_0xfc41('0x4b')]){_0x372f07[_0xfc41('0x48')]=_[_0xfc41('0x4c')](_0x372f07['where'],{'$or':_['map'](_0x493711,function(_0x5a73f9){if(_0x5a73f9[_0xfc41('0x3e')]!==_0xfc41('0x4d')){var _0x15639c={};_0x15639c[_0x5a73f9[_0xfc41('0x37')]]={'$like':'%'+_0x47ca36[_0xfc41('0x40')]['filter']+'%'};return _0x15639c;}})});}_0x372f07=_[_0xfc41('0x4c')]({},_0x372f07,_0x47ca36[_0xfc41('0x4e')]);var _0x4052ef={'where':_0x372f07['where']};return db['MailMessage'][_0xfc41('0x2d')](_0x4052ef)[_0xfc41('0x20')](function(_0x54e2cd){_0x511c82[_0xfc41('0x2d')]=_0x54e2cd;if(_0x47ca36[_0xfc41('0x40')][_0xfc41('0x4f')]){_0x372f07['include']=[{'all':!![]}];}return db[_0xfc41('0x3b')]['findAll'](_0x372f07);})[_0xfc41('0x20')](function(_0x2b6c6e){_0x511c82[_0xfc41('0x50')]=_0x2b6c6e;return _0x511c82;})['then'](respondWithFilteredResult(_0x7fc3c8,_0x372f07))[_0xfc41('0x28')](handleError(_0x7fc3c8,null));};exports[_0xfc41('0x51')]=function(_0x1ba0b0,_0x3cb9e3){var _0x2e29b7={'raw':!![],'where':{'id':_0x1ba0b0['params']['id']}},_0x5118db={};_0x5118db[_0xfc41('0x3f')]=_[_0xfc41('0x41')](db[_0xfc41('0x3b')]['rawAttributes']);_0x5118db['query']=_[_0xfc41('0x41')](_0x1ba0b0['query']);_0x5118db[_0xfc41('0x49')]=_[_0xfc41('0x42')](_0x5118db[_0xfc41('0x3f')],_0x5118db['query']);_0x2e29b7['attributes']=_[_0xfc41('0x42')](_0x5118db['model'],qs[_0xfc41('0x43')](_0x1ba0b0[_0xfc41('0x40')][_0xfc41('0x43')]));_0x2e29b7[_0xfc41('0x44')]=_0x2e29b7[_0xfc41('0x44')][_0xfc41('0x45')]?_0x2e29b7[_0xfc41('0x44')]:_0x5118db[_0xfc41('0x3f')];if(_0x1ba0b0['query'][_0xfc41('0x4f')]){_0x2e29b7[_0xfc41('0x52')]=[{'all':!![]}];}_0x2e29b7=_['merge']({},_0x2e29b7,_0x1ba0b0[_0xfc41('0x4e')]);return db[_0xfc41('0x3b')][_0xfc41('0x53')](_0x2e29b7)['then'](handleEntityNotFound(_0x3cb9e3,null))[_0xfc41('0x20')](respondWithResult(_0x3cb9e3,null))[_0xfc41('0x28')](handleError(_0x3cb9e3,null));};exports[_0xfc41('0x34')]=function(_0xc19651,_0x43b101){if(_0xc19651[_0xfc41('0x54')]['id']){delete _0xc19651['body']['id'];}return db['MailMessage']['find']({'where':{'id':_0xc19651[_0xfc41('0x55')]['id']}})[_0xfc41('0x20')](handleEntityNotFound(_0x43b101,null))[_0xfc41('0x20')](saveUpdates(_0xc19651['body'],null))[_0xfc41('0x20')](respondWithResult(_0x43b101,null))[_0xfc41('0x28')](handleError(_0x43b101,null));};exports['destroy']=function(_0x2cc99d,_0x307d30){return db[_0xfc41('0x3b')][_0xfc41('0x53')]({'where':{'id':_0x2cc99d[_0xfc41('0x55')]['id']}})[_0xfc41('0x20')](handleEntityNotFound(_0x307d30,null))[_0xfc41('0x20')](removeEntity(_0x307d30,null))[_0xfc41('0x28')](handleError(_0x307d30,null));};exports[_0xfc41('0x56')]=function(_0x3962b9,_0x58ed4f){return db['MailMessage'][_0xfc41('0x56')]()[_0xfc41('0x20')](respondWithResult(_0x58ed4f,null))[_0xfc41('0x28')](handleError(_0x58ed4f,null));};exports['create']=function(_0x6ac0e1,_0x4c6cf1){return db[_0xfc41('0x3b')][_0xfc41('0x57')](_0x6ac0e1[_0xfc41('0x54')])['then'](function(_0x5686a1){if(_0x5686a1){if(_0x5686a1[_0xfc41('0x58')]==='out'&&!_0x5686a1[_0xfc41('0x59')]){var _0x3299fc,_0x22495f,_0x52cc70;if(_0x6ac0e1['body']['to']){_0x22495f=_0x6ac0e1['body']['to']['split'](',')[0x0];}return db['MailAccount']['findOne']({'where':{'id':_0x5686a1[_0xfc41('0x5a')]},'include':[{'model':db[_0xfc41('0x5b')],'as':_0xfc41('0x5c'),'include':[{'model':db[_0xfc41('0x5d')],'as':_0xfc41('0x5e'),'where':{'email':_0x22495f},'limit':0x1,'order':[['updatedAt',_0xfc41('0x5f')]]}]},{'model':db['MailServerOut'],'as':_0xfc41('0x60'),'raw':!![]}]})[_0xfc41('0x20')](function(_0x5a1e46){_0x3299fc=_0x5a1e46;if(_0x3299fc&&_0x3299fc[_0xfc41('0x60')]){var _0xd8565b={'tls':{'rejectUnauthorized':![]}};if(_[_0xfc41('0x61')](_0x3299fc[_0xfc41('0x60')][_0xfc41('0x62')])){_0xd8565b[_0xfc41('0x63')]=_0x3299fc[_0xfc41('0x60')][_0xfc41('0x63')];_0xd8565b[_0xfc41('0x64')]=_0x3299fc[_0xfc41('0x60')][_0xfc41('0x64')];_0xd8565b[_0xfc41('0x65')]=_0x3299fc[_0xfc41('0x60')]['secure'];if(_0x3299fc['Smtp'][_0xfc41('0x66')]){_0xd8565b[_0xfc41('0x67')]={'user':_0x3299fc[_0xfc41('0x60')]['user'],'pass':_0x3299fc['Smtp'][_0xfc41('0x68')]};}}else{_0xd8565b[_0xfc41('0x62')]=_0x3299fc['Smtp'][_0xfc41('0x62')];_0xd8565b[_0xfc41('0x67')]={'user':_0x3299fc[_0xfc41('0x60')][_0xfc41('0x69')],'pass':_0x3299fc[_0xfc41('0x60')][_0xfc41('0x68')]};_0xd8565b[_0xfc41('0x65')]=_0x3299fc['Smtp'][_0xfc41('0x65')];}if(_0x6ac0e1[_0xfc41('0x54')]['attachments']&&_0x6ac0e1['body'][_0xfc41('0x6a')][_0xfc41('0x45')]){for(var _0x35c8c6=0x0;_0x35c8c6<_0x6ac0e1[_0xfc41('0x54')]['attachments'][_0xfc41('0x45')];_0x35c8c6+=0x1){_0x6ac0e1[_0xfc41('0x54')][_0xfc41('0x6a')][_0x35c8c6]={'filename':_0x6ac0e1[_0xfc41('0x54')][_0xfc41('0x6a')][_0x35c8c6][_0xfc41('0x37')],'path':path[_0xfc41('0x6b')](config[_0xfc41('0x6c')],_0xfc41('0x6d'),_0x6ac0e1[_0xfc41('0x54')][_0xfc41('0x6a')][_0x35c8c6][_0xfc41('0x6e')])};}}_0x52cc70={'account':_0xd8565b,'message':_0x6ac0e1[_0xfc41('0x54')]};return;}})[_0xfc41('0x20')](function(){if(_0x3299fc[_0xfc41('0x5c')]){if(_0x3299fc[_0xfc41('0x5c')][_0xfc41('0x5e')][_0xfc41('0x45')]){return _0x3299fc['List'][_0xfc41('0x5e')][0x0];}else{return db['CmContact'][_0xfc41('0x57')](_[_0xfc41('0x19')](_0x6ac0e1[_0xfc41('0x54')],{'firstName':_0x6ac0e1[_0xfc41('0x54')]['to'],'email':_0x6ac0e1[_0xfc41('0x54')]['to'],'phone':_0x6ac0e1['body']['to'],'ListId':_0x3299fc[_0xfc41('0x6f')]}));}}else{throw new Error('List\x20not\x20found');}})[_0xfc41('0x20')](function(){if(_0x52cc70){return respondWithRpcPromise(_0xfc41('0x70'),'sendMail',_0x52cc70,client9003)[_0xfc41('0x20')](function(_0x1f0830){return _0x5686a1[_0xfc41('0x34')]({'read':!![],'messageId':_0x1f0830[_0xfc41('0x71')],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});})[_0xfc41('0x28')](function(_0x4066a9){logger[_0xfc41('0x26')]('%s',JSON['stringify'](_0x4066a9));return _0x5686a1;});}return _0x5686a1;});}return _0x5686a1;}})[_0xfc41('0x20')](respondWithResult(_0x4c6cf1,0xc9))['catch'](handleError(_0x4c6cf1,null));};var interaction_log=require(_0xfc41('0x13'))(_0xfc41('0x72'));exports[_0xfc41('0x73')]=function(_0x1d3ebb,_0x3bb906,_0x21e01f){var _0x78f3d0={'channel':_0xfc41('0x74')};if(_0x1d3ebb[_0xfc41('0x54')]['id']){delete _0x1d3ebb[_0xfc41('0x54')]['id'];}_0x1d3ebb['body'][_0xfc41('0x75')]=!![];_0x1d3ebb[_0xfc41('0x54')][_0xfc41('0x76')]=moment()[_0xfc41('0x77')](_0xfc41('0x78'));_0x1d3ebb[_0xfc41('0x54')][_0xfc41('0x79')]=_0x1d3ebb[_0xfc41('0x54')][_0xfc41('0x79')]||_0x1d3ebb[_0xfc41('0x69')]['id'];return db[_0xfc41('0x3b')][_0xfc41('0x53')]({'where':{'id':_0x1d3ebb[_0xfc41('0x55')]['id'],'UserId':null},'include':[{'model':db[_0xfc41('0x5d')],'as':_0xfc41('0x7a')}]})[_0xfc41('0x20')](handleEntityNotFound(_0x3bb906,null))[_0xfc41('0x20')](saveUpdates(_0x1d3ebb['body'],null))[_0xfc41('0x20')](function(_0x4ddbd5){if(_0x4ddbd5){_0x78f3d0['message']=_0x4ddbd5[_0xfc41('0x7b')]({'plain':!![]});return db[_0xfc41('0x7c')][_0xfc41('0x53')]({'where':{'id':_0x4ddbd5['MailInteractionId']}});}return null;})[_0xfc41('0x20')](handleEntityNotFound(_0x3bb906,null))[_0xfc41('0x20')](function(_0x479776){if(_0x479776){return _0x479776[_0xfc41('0x34')]({'UserId':_0x1d3ebb['body'][_0xfc41('0x79')],'read1stAt':_['isNil'](_0x479776[_0xfc41('0x7d')])?moment()[_0xfc41('0x77')](_0xfc41('0x78')):undefined});}return null;})['then'](function(_0x26408c){if(_0x26408c){_0x78f3d0[_0xfc41('0x7e')]=_0x26408c[_0xfc41('0x7b')]({'plain':!![]});interaction_log['info'](_0xfc41('0x7f'),_0x1d3ebb[_0xfc41('0x69')]['id'],_0x1d3ebb[_0xfc41('0x69')][_0xfc41('0x37')],_0x1d3ebb[_0xfc41('0x69')][_0xfc41('0x80')],_0x78f3d0[_0xfc41('0x7e')]['id'],_0x1d3ebb[_0xfc41('0x54')]?JSON[_0xfc41('0x81')](_0x1d3ebb[_0xfc41('0x54')]):_0xfc41('0x82'));return respondWithRpcPromise(_0xfc41('0x83'),_0xfc41('0x84'),_0x78f3d0);}return null;})[_0xfc41('0x20')](function(_0x44a274){if(_0x44a274){if(_0x1d3ebb[_0xfc41('0x54')]['manual']){_0x78f3d0[_0xfc41('0x27')][_0xfc41('0x85')]=util[_0xfc41('0x77')](_0xfc41('0x86'),_0x1d3ebb[_0xfc41('0x69')][_0xfc41('0x37')]);_0x78f3d0[_0xfc41('0x27')][_0xfc41('0x87')]=_0x78f3d0[_0xfc41('0x87')];_0x78f3d0[_0xfc41('0x27')]['event']=_0xfc41('0x73');return respondWithRpcPromise(_0xfc41('0x88'),_0xfc41('0x88'),{'event':_0xfc41('0x89'),'message':_0x78f3d0[_0xfc41('0x27')]},client9002)[_0xfc41('0x20')](function(){return _0x78f3d0;});}return _0x78f3d0;}return null;})['then'](respondWithResult(_0x3bb906,null))[_0xfc41('0x28')](handleError(_0x3bb906,null));};var interaction_log=require('../../config/logger')('mail-interactions');exports[_0xfc41('0x8a')]=function(_0x339f9b,_0x140964,_0x3bd4de){var _0x1c8868={'agent':{},'channel':'mail'};if(_0x339f9b['body']['id']){delete _0x339f9b[_0xfc41('0x54')]['id'];}_0x339f9b[_0xfc41('0x54')][_0xfc41('0x79')]=_0x339f9b[_0xfc41('0x54')][_0xfc41('0x79')]||_0x339f9b['user']['id'];_0x1c8868[_0xfc41('0x8b')]['id']=_0x339f9b[_0xfc41('0x54')][_0xfc41('0x79')];return db[_0xfc41('0x3b')][_0xfc41('0x53')]({'where':{'id':_0x339f9b['params']['id'],'UserId':null}})[_0xfc41('0x20')](handleEntityNotFound(_0x140964,null))['then'](function(_0x4bbe3e){if(_0x4bbe3e){_0x1c8868['message']=_0x4bbe3e[_0xfc41('0x7b')]({'plain':!![]});return db[_0xfc41('0x7c')][_0xfc41('0x53')]({'where':{'id':_0x4bbe3e[_0xfc41('0x8c')]}});}return null;})['then'](handleEntityNotFound(_0x140964,null))[_0xfc41('0x20')](function(_0x1d6680){if(_0x1d6680){_0x1c8868[_0xfc41('0x7e')]=_0x1d6680[_0xfc41('0x7b')]({'plain':!![]});interaction_log[_0xfc41('0x21')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x339f9b[_0xfc41('0x69')]['id'],_0x339f9b['user'][_0xfc41('0x37')],_0x339f9b[_0xfc41('0x69')][_0xfc41('0x80')],_0x1c8868[_0xfc41('0x7e')]['id'],_0x339f9b[_0xfc41('0x54')]?JSON[_0xfc41('0x81')](_0x339f9b[_0xfc41('0x54')]):'null');return respondWithRpcPromise('RejectMessage',_0xfc41('0x8d'),_0x1c8868);}return null;})[_0xfc41('0x20')](function(_0x2e2c64){if(_0x2e2c64){_0x2e2c64[_0xfc41('0x27')][_0xfc41('0x85')]=util['format']('SIP/%s',_0x339f9b[_0xfc41('0x69')][_0xfc41('0x37')]);_0x2e2c64['message'][_0xfc41('0x87')]=_0x1c8868[_0xfc41('0x87')];_0x2e2c64['message'][_0xfc41('0x8e')]=_0xfc41('0x8a');respondWithRpcPromise(_0xfc41('0x88'),_0xfc41('0x88'),{'event':_0xfc41('0x8f'),'message':_0x2e2c64[_0xfc41('0x27')]},client9002);return _0x1c8868;}return null;})['then'](respondWithResult(_0x140964,null))['catch'](handleError(_0x140964,null));};exports[_0xfc41('0x90')]=function(_0x3799e2,_0x4d0e5c){var _0x78facb=moment()['unix']()[_0xfc41('0x91')]();var _0x28ccd8=path['join'](config[_0xfc41('0x6c')],_0xfc41('0x92'),_0xfc41('0x93'),_0xfc41('0x94'));var _0x60772b=path[_0xfc41('0x6b')](config[_0xfc41('0x6c')],_0xfc41('0x92'),_0xfc41('0x93'),'attachments');var _0x4ccb72=util['format']('message-%s.eml',_0x78facb);return db['MailMessage'][_0xfc41('0x53')]({'where':{'id':_0x3799e2[_0xfc41('0x55')]['id']},'attributes':['id',_0xfc41('0x54'),_0xfc41('0x95'),'to','cc',_0xfc41('0x96'),_0xfc41('0x97'),_0xfc41('0x98')],'include':_0x3799e2['query']['attachments']?[{'model':db[_0xfc41('0x99')],'as':_0xfc41('0x9a')}]:undefined})[_0xfc41('0x20')](handleEntityNotFound(_0x4d0e5c,null))[_0xfc41('0x20')](function(_0x39f9da){if(_0x39f9da){var _0x437149=_0x39f9da;var _0xa0ad90={'from':_0x437149[_0xfc41('0x95')],'to':_0x437149['to'],'subject':_0x437149[_0xfc41('0x97')],'html':_0x437149[_0xfc41('0x54')],'headers':{'Date':moment(_0x437149[_0xfc41('0x98')])[_0xfc41('0x77')](_0xfc41('0x9b'))},'attachments':[]};if(_0x39f9da['cc']){_0xa0ad90[_0xfc41('0x9c')]['Cc']=_0x39f9da['cc'];}if(_0x39f9da[_0xfc41('0x96')]){_0xa0ad90[_0xfc41('0x9c')][_0xfc41('0x9d')]=_0x39f9da[_0xfc41('0x96')];}return new BPromise(function(_0x26cf3f,_0x21d29d){if(_0x39f9da[_0xfc41('0x9a')]){for(var _0x479210=0x0;_0x479210<_0x39f9da['Attachments'][_0xfc41('0x45')];_0x479210++){var _0x5c8888=_0x39f9da[_0xfc41('0x9a')][_0x479210];var _0x599c08=path[_0xfc41('0x6b')](_0x60772b,_0x5c8888[_0xfc41('0x6e')]);if(fs['existsSync'](_0x599c08)){_0xa0ad90['attachments'][_0xfc41('0x9e')]({'name':_0x5c8888[_0xfc41('0x37')],'contentType':_0x5c8888[_0xfc41('0x3e')],'data':fs[_0xfc41('0x9f')](_0x599c08)});}}}emlformat[_0xfc41('0xa0')](_0xa0ad90,function(_0x206e8b,_0x18b54f){if(_0x206e8b)return _0x21d29d(_0x206e8b);fs[_0xfc41('0xa1')](path['join'](_0x28ccd8,_0x4ccb72),_0x18b54f);return _0x26cf3f(_0x18b54f);});});}})[_0xfc41('0x20')](function(_0x726bb7){if(_0x726bb7){return _0x4d0e5c[_0xfc41('0x90')](path[_0xfc41('0x6b')](_0x28ccd8,_0x4ccb72),_0x4ccb72,function(_0x1f170f){if(_0x1f170f){console[_0xfc41('0xa2')](_0xfc41('0xa3'),_0x1f170f);}else{fs['unlinkSync'](path['join'](_0x28ccd8,_0x4ccb72));}});}})[_0xfc41('0x28')](handleError(_0x4d0e5c,null));}; \ No newline at end of file +var _0x9ed7=['basename','existsSync','push','readFileSync','build','log','err','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','redis','./mailMessage.socket','register','jayson/promise','http','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','info','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus','status','end','json','count','offset','set','apply','reject','save','destroy','stack','name','send','index','map','MailMessage','rawAttributes','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','options','include','rows','show','params','body','find','describe','create','direction','secret','split','findOne','MailAccountId','CmList','List','updatedAt','DESC','Smtp','isNil','host','port','secure','authentication','user','pass','service','attachments','join','root','server/files/attachments','Contacts','CmContact','defaults','ListId','sendMail','update','messageId','YYYY-MM-DD\x20HH:mm:ss','accept','mail','readAt','format','UserId','Contact','get','MailInteraction','MailInteractionId','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','interface','SIP/%s','channel','EventManager','mail-interactions','agent','role','RejectMessage','rejectMessage','rejectmessage','download','unix','toString','tmp','server','files','message-%s.eml','from','bcc','subject','createdAt','Attachment','Attachments','headers'];(function(_0x864736,_0x223c31){var _0x3b8e96=function(_0x43dd98){while(--_0x43dd98){_0x864736['push'](_0x864736['shift']());}};_0x3b8e96(++_0x223c31);}(_0x9ed7,0x14c));var _0x79ed=function(_0x4a93bb,_0x495404){_0x4a93bb=_0x4a93bb-0x0;var _0x208468=_0x9ed7[_0x4a93bb];return _0x208468;};'use strict';var pdf=require(_0x79ed('0x0'));var emlformat=require(_0x79ed('0x1'));var rimraf=require(_0x79ed('0x2'));var zipdir=require(_0x79ed('0x3'));var jsonpatch=require(_0x79ed('0x4'));var rp=require(_0x79ed('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x79ed('0x6'));var path=require(_0x79ed('0x7'));var sox=require(_0x79ed('0x8'));var csv=require(_0x79ed('0x9'));var ejs=require(_0x79ed('0xa'));var fs=require('fs');var _=require(_0x79ed('0xb'));var squel=require(_0x79ed('0xc'));var crypto=require(_0x79ed('0xd'));var jsforce=require(_0x79ed('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x79ed('0x9'));var querystring=require(_0x79ed('0xf'));var Papa=require(_0x79ed('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x79ed('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x79ed('0x12'))('api');var utils=require(_0x79ed('0x13'));var config=require(_0x79ed('0x14'));var db=require('../../mysqldb')['db'];config[_0x79ed('0x15')]=_['defaults'](config[_0x79ed('0x15')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x79ed('0x15')]));require(_0x79ed('0x16'))[_0x79ed('0x17')](socket);var jayson=require(_0x79ed('0x18'));var client=jayson['client'][_0x79ed('0x19')]({'port':0x232c});var client9003=jayson[_0x79ed('0x1a')][_0x79ed('0x19')]({'port':0x232b});var client9002=jayson[_0x79ed('0x1a')][_0x79ed('0x19')]({'port':0x232a});function checkPasswordPattern(_0x1914da,_0x4148e0,_0x17b5b8){if(_0x17b5b8){var _0x3a1cda=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3a1cda[_0x79ed('0x1b')](_0x4148e0)){return _0x1914da;}else{throw new db[(_0x79ed('0x1c'))]['ValidationError'](_0x79ed('0x1d'));}}else{return _0x1914da;}}function respondWithRpcPromise(_0x582a86,_0x496bc6,_0x10ebe2,_0x23a5e0){return new BPromise(function(_0x5e8267,_0x3ebddc){var _0x25c845=_0x23a5e0||client;return _0x25c845[_0x79ed('0x1e')](_0x582a86,_0x10ebe2)[_0x79ed('0x1f')](function(_0x5e29b3){logger[_0x79ed('0x20')](_0x79ed('0x21'),_0x496bc6,_0x79ed('0x22'));logger['debug'](_0x79ed('0x23'),_0x496bc6,_0x79ed('0x22'),JSON[_0x79ed('0x24')](_0x5e29b3));if(_0x5e29b3[_0x79ed('0x25')]){if(_0x5e29b3['error']['code']===0x1f4){logger[_0x79ed('0x25')](_0x79ed('0x21'),_0x496bc6,_0x5e29b3[_0x79ed('0x25')][_0x79ed('0x26')]);return _0x3ebddc(_0x5e29b3[_0x79ed('0x25')][_0x79ed('0x26')]);}logger[_0x79ed('0x25')](_0x79ed('0x21'),_0x496bc6,_0x5e29b3[_0x79ed('0x25')][_0x79ed('0x26')]);return _0x5e8267(_0x5e29b3[_0x79ed('0x25')][_0x79ed('0x26')]);}else{logger['info'](_0x79ed('0x21'),_0x496bc6,'request\x20sent');_0x5e8267(_0x5e29b3['result'][_0x79ed('0x26')]);}})[_0x79ed('0x27')](function(_0x52488e){logger[_0x79ed('0x25')]('MailMessage,\x20%s,\x20%s',_0x496bc6,_0x52488e);_0x3ebddc(_0x52488e);});});}function respondWithStatusCode(_0x596edf,_0x29bcf2){_0x29bcf2=_0x29bcf2||0xcc;return function(_0x21e27f){if(_0x21e27f){return _0x596edf[_0x79ed('0x28')](_0x29bcf2);}return _0x596edf[_0x79ed('0x29')](_0x29bcf2)[_0x79ed('0x2a')]();};}function respondWithResult(_0x34a133,_0x20bfba){_0x20bfba=_0x20bfba||0xc8;return function(_0x110efd){if(_0x110efd){return _0x34a133[_0x79ed('0x29')](_0x20bfba)[_0x79ed('0x2b')](_0x110efd);}};}function respondWithFilteredResult(_0x5775b4,_0xc5a717){return function(_0x41e547){if(_0x41e547){var _0xf0ea25=_0x41e547[_0x79ed('0x2c')],_0x51b104=_0xc5a717['offset'],_0x47301f=_0xc5a717[_0x79ed('0x2d')]+_0xc5a717['limit'],_0x2f5959;if(_0x47301f>=_0xf0ea25){_0x47301f=_0xf0ea25;_0x2f5959=0xc8;}else{_0x2f5959=0xce;}_0x5775b4[_0x79ed('0x29')](_0x2f5959);return _0x5775b4[_0x79ed('0x2e')]('Content-Range',_0x51b104+'-'+_0x47301f+'/'+_0xf0ea25)[_0x79ed('0x2b')](_0x41e547);}return null;};}function patchUpdates(_0x382cb2){return function(_0x1b0857){try{jsonpatch[_0x79ed('0x2f')](_0x1b0857,_0x382cb2,!![]);}catch(_0x4bc818){return BPromise[_0x79ed('0x30')](_0x4bc818);}return _0x1b0857[_0x79ed('0x31')]();};}function saveUpdates(_0x847ad3,_0x53c20e){return function(_0x3e24ee){if(_0x3e24ee){return _0x3e24ee['update'](_0x847ad3)[_0x79ed('0x1f')](function(_0x3587b2){return _0x3587b2;});}return null;};}function removeEntity(_0x551c78,_0x63666e){return function(_0x29b2ca){if(_0x29b2ca){return _0x29b2ca[_0x79ed('0x32')]()[_0x79ed('0x1f')](function(){_0x551c78[_0x79ed('0x29')](0xcc)[_0x79ed('0x2a')]();});}};}function handleEntityNotFound(_0x219cf0,_0x16f843){return function(_0xa0f643){if(!_0xa0f643){_0x219cf0[_0x79ed('0x28')](0x194);}return _0xa0f643;};}function handleError(_0x1d3621,_0x1996fe){_0x1996fe=_0x1996fe||0x1f4;return function(_0x417758){logger[_0x79ed('0x25')](_0x417758[_0x79ed('0x33')]);if(_0x417758[_0x79ed('0x34')]){delete _0x417758['name'];}_0x1d3621[_0x79ed('0x29')](_0x1996fe)[_0x79ed('0x35')](_0x417758);};}exports[_0x79ed('0x36')]=function(_0x141598,_0x324446){var _0x1603ab={},_0x2d16ad={},_0x25e1c8={'count':0x0,'rows':[]};var _0x5cb045=_[_0x79ed('0x37')](db[_0x79ed('0x38')][_0x79ed('0x39')],function(_0x544596){return{'name':_0x544596['fieldName'],'type':_0x544596[_0x79ed('0x3a')][_0x79ed('0x3b')]};});_0x2d16ad['model']=_[_0x79ed('0x37')](_0x5cb045,'name');_0x2d16ad['query']=_[_0x79ed('0x3c')](_0x141598[_0x79ed('0x3d')]);_0x2d16ad[_0x79ed('0x3e')]=_[_0x79ed('0x3f')](_0x2d16ad[_0x79ed('0x40')],_0x2d16ad[_0x79ed('0x3d')]);_0x1603ab[_0x79ed('0x41')]=_[_0x79ed('0x3f')](_0x2d16ad['model'],qs[_0x79ed('0x42')](_0x141598[_0x79ed('0x3d')][_0x79ed('0x42')]));_0x1603ab[_0x79ed('0x41')]=_0x1603ab[_0x79ed('0x41')][_0x79ed('0x43')]?_0x1603ab['attributes']:_0x2d16ad[_0x79ed('0x40')];if(!_0x141598[_0x79ed('0x3d')][_0x79ed('0x44')](_0x79ed('0x45'))){_0x1603ab[_0x79ed('0x46')]=qs[_0x79ed('0x46')](_0x141598[_0x79ed('0x3d')]['limit']);_0x1603ab['offset']=qs[_0x79ed('0x2d')](_0x141598[_0x79ed('0x3d')][_0x79ed('0x2d')]);}_0x1603ab['order']=qs[_0x79ed('0x47')](_0x141598[_0x79ed('0x3d')]['sort']);_0x1603ab[_0x79ed('0x48')]=qs['filters'](_[_0x79ed('0x49')](_0x141598[_0x79ed('0x3d')],_0x2d16ad[_0x79ed('0x3e')]));if(_0x141598[_0x79ed('0x3d')][_0x79ed('0x4a')]){_0x1603ab['where']=_[_0x79ed('0x4b')](_0x1603ab['where'],{'$or':_[_0x79ed('0x37')](_0x5cb045,function(_0x257bee){if(_0x257bee[_0x79ed('0x3a')]!=='VIRTUAL'){var _0x1795e5={};_0x1795e5[_0x257bee['name']]={'$like':'%'+_0x141598[_0x79ed('0x3d')][_0x79ed('0x4a')]+'%'};return _0x1795e5;}})});}_0x1603ab=_['merge']({},_0x1603ab,_0x141598[_0x79ed('0x4c')]);var _0x13d913={'where':_0x1603ab[_0x79ed('0x48')]};return db[_0x79ed('0x38')][_0x79ed('0x2c')](_0x13d913)['then'](function(_0x4ade34){_0x25e1c8[_0x79ed('0x2c')]=_0x4ade34;if(_0x141598[_0x79ed('0x3d')]['includeAll']){_0x1603ab[_0x79ed('0x4d')]=[{'all':!![]}];}return db[_0x79ed('0x38')]['findAll'](_0x1603ab);})[_0x79ed('0x1f')](function(_0xc6bc6b){_0x25e1c8[_0x79ed('0x4e')]=_0xc6bc6b;return _0x25e1c8;})[_0x79ed('0x1f')](respondWithFilteredResult(_0x324446,_0x1603ab))['catch'](handleError(_0x324446,null));};exports[_0x79ed('0x4f')]=function(_0x11c11e,_0x4080ee){var _0x3c206c={'raw':!![],'where':{'id':_0x11c11e[_0x79ed('0x50')]['id']}},_0x4eae57={};_0x4eae57[_0x79ed('0x40')]=_[_0x79ed('0x3c')](db[_0x79ed('0x38')][_0x79ed('0x39')]);_0x4eae57[_0x79ed('0x3d')]=_['keys'](_0x11c11e['query']);_0x4eae57[_0x79ed('0x3e')]=_[_0x79ed('0x3f')](_0x4eae57['model'],_0x4eae57[_0x79ed('0x3d')]);_0x3c206c[_0x79ed('0x41')]=_[_0x79ed('0x3f')](_0x4eae57['model'],qs[_0x79ed('0x42')](_0x11c11e[_0x79ed('0x3d')]['fields']));_0x3c206c['attributes']=_0x3c206c['attributes'][_0x79ed('0x43')]?_0x3c206c[_0x79ed('0x41')]:_0x4eae57[_0x79ed('0x40')];if(_0x11c11e[_0x79ed('0x3d')]['includeAll']){_0x3c206c[_0x79ed('0x4d')]=[{'all':!![]}];}_0x3c206c=_['merge']({},_0x3c206c,_0x11c11e[_0x79ed('0x4c')]);return db[_0x79ed('0x38')]['find'](_0x3c206c)[_0x79ed('0x1f')](handleEntityNotFound(_0x4080ee,null))[_0x79ed('0x1f')](respondWithResult(_0x4080ee,null))[_0x79ed('0x27')](handleError(_0x4080ee,null));};exports['update']=function(_0x40c571,_0x3220ce){if(_0x40c571[_0x79ed('0x51')]['id']){delete _0x40c571['body']['id'];}return db[_0x79ed('0x38')]['find']({'where':{'id':_0x40c571[_0x79ed('0x50')]['id']}})['then'](handleEntityNotFound(_0x3220ce,null))[_0x79ed('0x1f')](saveUpdates(_0x40c571['body'],null))[_0x79ed('0x1f')](respondWithResult(_0x3220ce,null))[_0x79ed('0x27')](handleError(_0x3220ce,null));};exports[_0x79ed('0x32')]=function(_0x10144e,_0x354a9d){return db[_0x79ed('0x38')][_0x79ed('0x52')]({'where':{'id':_0x10144e[_0x79ed('0x50')]['id']}})['then'](handleEntityNotFound(_0x354a9d,null))[_0x79ed('0x1f')](removeEntity(_0x354a9d,null))[_0x79ed('0x27')](handleError(_0x354a9d,null));};exports['describe']=function(_0x13548f,_0x9fbcb2){return db[_0x79ed('0x38')][_0x79ed('0x53')]()[_0x79ed('0x1f')](respondWithResult(_0x9fbcb2,null))['catch'](handleError(_0x9fbcb2,null));};exports[_0x79ed('0x54')]=function(_0x5a3fda,_0x54aac5){return db['MailMessage'][_0x79ed('0x54')](_0x5a3fda[_0x79ed('0x51')])[_0x79ed('0x1f')](function(_0x22f0ae){if(_0x22f0ae){if(_0x22f0ae[_0x79ed('0x55')]==='out'&&!_0x22f0ae[_0x79ed('0x56')]){var _0x5201db,_0x1ebb88,_0x5af9d9;if(_0x5a3fda[_0x79ed('0x51')]['to']){_0x1ebb88=_0x5a3fda['body']['to'][_0x79ed('0x57')](',')[0x0];}return db['MailAccount'][_0x79ed('0x58')]({'where':{'id':_0x22f0ae[_0x79ed('0x59')]},'include':[{'model':db[_0x79ed('0x5a')],'as':_0x79ed('0x5b'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'email':_0x1ebb88},'limit':0x1,'order':[[_0x79ed('0x5c'),_0x79ed('0x5d')]]}]},{'model':db['MailServerOut'],'as':_0x79ed('0x5e'),'raw':!![]}]})[_0x79ed('0x1f')](function(_0x6d8c62){_0x5201db=_0x6d8c62;if(_0x5201db&&_0x5201db[_0x79ed('0x5e')]){var _0x4d5103={'tls':{'rejectUnauthorized':![]}};if(_[_0x79ed('0x5f')](_0x5201db[_0x79ed('0x5e')]['service'])){_0x4d5103[_0x79ed('0x60')]=_0x5201db[_0x79ed('0x5e')][_0x79ed('0x60')];_0x4d5103['port']=_0x5201db[_0x79ed('0x5e')][_0x79ed('0x61')];_0x4d5103[_0x79ed('0x62')]=_0x5201db[_0x79ed('0x5e')][_0x79ed('0x62')];if(_0x5201db[_0x79ed('0x5e')][_0x79ed('0x63')]){_0x4d5103['auth']={'user':_0x5201db[_0x79ed('0x5e')][_0x79ed('0x64')],'pass':_0x5201db[_0x79ed('0x5e')][_0x79ed('0x65')]};}}else{_0x4d5103[_0x79ed('0x66')]=_0x5201db[_0x79ed('0x5e')]['service'];_0x4d5103['auth']={'user':_0x5201db['Smtp'][_0x79ed('0x64')],'pass':_0x5201db[_0x79ed('0x5e')][_0x79ed('0x65')]};_0x4d5103['secure']=_0x5201db[_0x79ed('0x5e')][_0x79ed('0x62')];}if(_0x5a3fda[_0x79ed('0x51')][_0x79ed('0x67')]&&_0x5a3fda['body'][_0x79ed('0x67')][_0x79ed('0x43')]){for(var _0x3537c1=0x0;_0x3537c1<_0x5a3fda['body'][_0x79ed('0x67')][_0x79ed('0x43')];_0x3537c1+=0x1){_0x5a3fda['body'][_0x79ed('0x67')][_0x3537c1]={'filename':_0x5a3fda[_0x79ed('0x51')][_0x79ed('0x67')][_0x3537c1][_0x79ed('0x34')],'path':path[_0x79ed('0x68')](config[_0x79ed('0x69')],_0x79ed('0x6a'),_0x5a3fda[_0x79ed('0x51')][_0x79ed('0x67')][_0x3537c1]['basename'])};}}_0x5af9d9={'account':_0x4d5103,'message':_0x5a3fda['body']};return;}})[_0x79ed('0x1f')](function(){if(_0x5201db[_0x79ed('0x5b')]){if(_0x5201db[_0x79ed('0x5b')]['Contacts'][_0x79ed('0x43')]){return _0x5201db[_0x79ed('0x5b')][_0x79ed('0x6b')][0x0];}else{return db[_0x79ed('0x6c')][_0x79ed('0x54')](_[_0x79ed('0x6d')](_0x5a3fda['body'],{'firstName':_0x5a3fda[_0x79ed('0x51')]['to'],'email':_0x5a3fda['body']['to'],'phone':_0x5a3fda[_0x79ed('0x51')]['to'],'ListId':_0x5201db[_0x79ed('0x6e')]}));}}else{throw new Error('List\x20not\x20found');}})['then'](function(){if(_0x5af9d9){return respondWithRpcPromise('SendMail',_0x79ed('0x6f'),_0x5af9d9,client9003)[_0x79ed('0x1f')](function(_0xbfb321){return _0x22f0ae[_0x79ed('0x70')]({'read':!![],'messageId':_0xbfb321[_0x79ed('0x71')],'sentAt':moment()['format'](_0x79ed('0x72'))});})[_0x79ed('0x27')](function(_0x3f464a){logger['error']('%s',JSON[_0x79ed('0x24')](_0x3f464a));return _0x22f0ae;});}return _0x22f0ae;});}return _0x22f0ae;}})[_0x79ed('0x1f')](respondWithResult(_0x54aac5,0xc9))['catch'](handleError(_0x54aac5,null));};var interaction_log=require(_0x79ed('0x12'))('mail-interactions');exports[_0x79ed('0x73')]=function(_0x1c8309,_0x2d00c9,_0x2fd5ca){var _0x16eaf3={'channel':_0x79ed('0x74')};if(_0x1c8309[_0x79ed('0x51')]['id']){delete _0x1c8309[_0x79ed('0x51')]['id'];}_0x1c8309['body']['read']=!![];_0x1c8309['body'][_0x79ed('0x75')]=moment()[_0x79ed('0x76')](_0x79ed('0x72'));_0x1c8309[_0x79ed('0x51')][_0x79ed('0x77')]=_0x1c8309[_0x79ed('0x51')][_0x79ed('0x77')]||_0x1c8309[_0x79ed('0x64')]['id'];return db[_0x79ed('0x38')][_0x79ed('0x52')]({'where':{'id':_0x1c8309[_0x79ed('0x50')]['id'],'UserId':null},'include':[{'model':db[_0x79ed('0x6c')],'as':_0x79ed('0x78')}]})[_0x79ed('0x1f')](handleEntityNotFound(_0x2d00c9,null))[_0x79ed('0x1f')](saveUpdates(_0x1c8309['body'],null))['then'](function(_0x289f71){if(_0x289f71){_0x16eaf3[_0x79ed('0x26')]=_0x289f71[_0x79ed('0x79')]({'plain':!![]});return db[_0x79ed('0x7a')]['find']({'where':{'id':_0x289f71[_0x79ed('0x7b')]}});}return null;})[_0x79ed('0x1f')](handleEntityNotFound(_0x2d00c9,null))[_0x79ed('0x1f')](function(_0x10f2be){if(_0x10f2be){return _0x10f2be[_0x79ed('0x70')]({'UserId':_0x1c8309[_0x79ed('0x51')][_0x79ed('0x77')],'read1stAt':_[_0x79ed('0x5f')](_0x10f2be[_0x79ed('0x7c')])?moment()[_0x79ed('0x76')](_0x79ed('0x72')):undefined});}return null;})[_0x79ed('0x1f')](function(_0x4a090f){if(_0x4a090f){_0x16eaf3[_0x79ed('0x7d')]=_0x4a090f['get']({'plain':!![]});interaction_log[_0x79ed('0x20')](_0x79ed('0x7e'),_0x1c8309[_0x79ed('0x64')]['id'],_0x1c8309['user'][_0x79ed('0x34')],_0x1c8309[_0x79ed('0x64')]['role'],_0x16eaf3['interaction']['id'],_0x1c8309['body']?JSON[_0x79ed('0x24')](_0x1c8309[_0x79ed('0x51')]):_0x79ed('0x7f'));return respondWithRpcPromise(_0x79ed('0x80'),_0x79ed('0x81'),_0x16eaf3);}return null;})[_0x79ed('0x1f')](function(_0x170161){if(_0x170161){if(_0x1c8309['body']['manual']){_0x16eaf3[_0x79ed('0x26')][_0x79ed('0x82')]=util[_0x79ed('0x76')](_0x79ed('0x83'),_0x1c8309[_0x79ed('0x64')][_0x79ed('0x34')]);_0x16eaf3[_0x79ed('0x26')][_0x79ed('0x84')]=_0x16eaf3['channel'];_0x16eaf3[_0x79ed('0x26')]['event']='accept';return respondWithRpcPromise(_0x79ed('0x85'),_0x79ed('0x85'),{'event':'acceptmessage','message':_0x16eaf3[_0x79ed('0x26')]},client9002)[_0x79ed('0x1f')](function(){return _0x16eaf3;});}return _0x16eaf3;}return null;})['then'](respondWithResult(_0x2d00c9,null))[_0x79ed('0x27')](handleError(_0x2d00c9,null));};var interaction_log=require(_0x79ed('0x12'))(_0x79ed('0x86'));exports['reject']=function(_0x199f01,_0x35728d,_0x446dcb){var _0x2d28c4={'agent':{},'channel':'mail'};if(_0x199f01[_0x79ed('0x51')]['id']){delete _0x199f01[_0x79ed('0x51')]['id'];}_0x199f01[_0x79ed('0x51')][_0x79ed('0x77')]=_0x199f01[_0x79ed('0x51')]['UserId']||_0x199f01['user']['id'];_0x2d28c4[_0x79ed('0x87')]['id']=_0x199f01[_0x79ed('0x51')][_0x79ed('0x77')];return db[_0x79ed('0x38')][_0x79ed('0x52')]({'where':{'id':_0x199f01[_0x79ed('0x50')]['id'],'UserId':null}})[_0x79ed('0x1f')](handleEntityNotFound(_0x35728d,null))[_0x79ed('0x1f')](function(_0x21dbe5){if(_0x21dbe5){_0x2d28c4['message']=_0x21dbe5['get']({'plain':!![]});return db[_0x79ed('0x7a')]['find']({'where':{'id':_0x21dbe5[_0x79ed('0x7b')]}});}return null;})[_0x79ed('0x1f')](handleEntityNotFound(_0x35728d,null))[_0x79ed('0x1f')](function(_0x5cf27d){if(_0x5cf27d){_0x2d28c4['interaction']=_0x5cf27d[_0x79ed('0x79')]({'plain':!![]});interaction_log[_0x79ed('0x20')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x199f01[_0x79ed('0x64')]['id'],_0x199f01[_0x79ed('0x64')][_0x79ed('0x34')],_0x199f01[_0x79ed('0x64')][_0x79ed('0x88')],_0x2d28c4[_0x79ed('0x7d')]['id'],_0x199f01[_0x79ed('0x51')]?JSON[_0x79ed('0x24')](_0x199f01[_0x79ed('0x51')]):_0x79ed('0x7f'));return respondWithRpcPromise(_0x79ed('0x89'),_0x79ed('0x8a'),_0x2d28c4);}return null;})[_0x79ed('0x1f')](function(_0x9eb29e){if(_0x9eb29e){_0x9eb29e['message'][_0x79ed('0x82')]=util['format']('SIP/%s',_0x199f01[_0x79ed('0x64')]['name']);_0x9eb29e['message'][_0x79ed('0x84')]=_0x2d28c4[_0x79ed('0x84')];_0x9eb29e['message']['event']='reject';respondWithRpcPromise('EventManager',_0x79ed('0x85'),{'event':_0x79ed('0x8b'),'message':_0x9eb29e[_0x79ed('0x26')]},client9002);return _0x2d28c4;}return null;})['then'](respondWithResult(_0x35728d,null))[_0x79ed('0x27')](handleError(_0x35728d,null));};exports[_0x79ed('0x8c')]=function(_0x4dfdef,_0x45265){var _0x296c02=moment()[_0x79ed('0x8d')]()[_0x79ed('0x8e')]();var _0x4ae64f=path[_0x79ed('0x68')](config[_0x79ed('0x69')],'server','files',_0x79ed('0x8f'));var _0x399ea9=path[_0x79ed('0x68')](config[_0x79ed('0x69')],_0x79ed('0x90'),_0x79ed('0x91'),_0x79ed('0x67'));var _0x105ac7=util['format'](_0x79ed('0x92'),_0x296c02);return db[_0x79ed('0x38')][_0x79ed('0x52')]({'where':{'id':_0x4dfdef['params']['id']},'attributes':['id',_0x79ed('0x51'),_0x79ed('0x93'),'to','cc',_0x79ed('0x94'),_0x79ed('0x95'),_0x79ed('0x96')],'include':_0x4dfdef[_0x79ed('0x3d')]['attachments']?[{'model':db[_0x79ed('0x97')],'as':_0x79ed('0x98')}]:undefined})[_0x79ed('0x1f')](handleEntityNotFound(_0x45265,null))[_0x79ed('0x1f')](function(_0x502aa6){if(_0x502aa6){var _0x28cde1=_0x502aa6;var _0x394d0a={'from':_0x28cde1[_0x79ed('0x93')],'to':_0x28cde1['to'],'subject':_0x28cde1[_0x79ed('0x95')],'html':_0x28cde1[_0x79ed('0x51')],'headers':{'Date':moment(_0x28cde1[_0x79ed('0x96')])[_0x79ed('0x76')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x502aa6['cc']){_0x394d0a[_0x79ed('0x99')]['Cc']=_0x502aa6['cc'];}if(_0x502aa6['bcc']){_0x394d0a['headers']['Bcc']=_0x502aa6[_0x79ed('0x94')];}return new BPromise(function(_0x173fce,_0x3316fd){if(_0x502aa6[_0x79ed('0x98')]){for(var _0x238400=0x0;_0x238400<_0x502aa6[_0x79ed('0x98')]['length'];_0x238400++){var _0x15fc1b=_0x502aa6[_0x79ed('0x98')][_0x238400];var _0x52c0f1=path['join'](_0x399ea9,_0x15fc1b[_0x79ed('0x9a')]);if(fs[_0x79ed('0x9b')](_0x52c0f1)){_0x394d0a[_0x79ed('0x67')][_0x79ed('0x9c')]({'name':_0x15fc1b[_0x79ed('0x34')],'contentType':_0x15fc1b['type'],'data':fs[_0x79ed('0x9d')](_0x52c0f1)});}}}emlformat[_0x79ed('0x9e')](_0x394d0a,function(_0x6f101d,_0x5e9198){if(_0x6f101d)return _0x3316fd(_0x6f101d);fs['writeFileSync'](path[_0x79ed('0x68')](_0x4ae64f,_0x105ac7),_0x5e9198);return _0x173fce(_0x5e9198);});});}})[_0x79ed('0x1f')](function(_0x2ad5c4){if(_0x2ad5c4){return _0x45265[_0x79ed('0x8c')](path[_0x79ed('0x68')](_0x4ae64f,_0x105ac7),_0x105ac7,function(_0x413fbf){if(_0x413fbf){console[_0x79ed('0x9f')](_0x79ed('0xa0'),_0x413fbf);}else{fs[_0x79ed('0xa1')](path['join'](_0x4ae64f,_0x105ac7));}});}})[_0x79ed('0x27')](handleError(_0x45265,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 3ec249e..ea0e284 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 _0x86f1=['events','../../mysqldb','MailMessage','setMaxListeners','save','update','remove','hasOwnProperty','hook'];(function(_0x40c577,_0x2225f0){var _0x2adcd=function(_0x5a00a8){while(--_0x5a00a8){_0x40c577['push'](_0x40c577['shift']());}};_0x2adcd(++_0x2225f0);}(_0x86f1,0x156));var _0x186f=function(_0x594e8b,_0xe86cf8){_0x594e8b=_0x594e8b-0x0;var _0x43f9e4=_0x86f1[_0x594e8b];return _0x43f9e4;};'use strict';var EventEmitter=require(_0x186f('0x0'));var MailMessage=require(_0x186f('0x1'))['db'][_0x186f('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x186f('0x3')](0x0);var events={'afterCreate':_0x186f('0x4'),'afterUpdate':_0x186f('0x5'),'afterDestroy':_0x186f('0x6')};function emitEvent(_0x213bef){return function(_0x31cade,_0x898d78,_0x4993aa){MailMessageEvents['emit'](_0x213bef+':'+_0x31cade['id'],_0x31cade);MailMessageEvents['emit'](_0x213bef,_0x31cade);_0x4993aa(null);};}for(var e in events){if(events[_0x186f('0x7')](e)){var event=events[e];MailMessage[_0x186f('0x8')](e,emitEvent(event));}}module['exports']=MailMessageEvents; \ No newline at end of file +var _0xb829=['update','emit','hasOwnProperty','hook','../../mysqldb','MailMessage'];(function(_0x324e43,_0x320dad){var _0x433798=function(_0x151fcb){while(--_0x151fcb){_0x324e43['push'](_0x324e43['shift']());}};_0x433798(++_0x320dad);}(_0xb829,0x148));var _0x9b82=function(_0xf37f7d,_0x14c836){_0xf37f7d=_0xf37f7d-0x0;var _0x2a9346=_0xb829[_0xf37f7d];return _0x2a9346;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0x9b82('0x0'))['db'][_0x9b82('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x9b82('0x2'),'afterDestroy':'remove'};function emitEvent(_0x3d5279){return function(_0xb0086c,_0x361d43,_0x31a5c1){MailMessageEvents[_0x9b82('0x3')](_0x3d5279+':'+_0xb0086c['id'],_0xb0086c);MailMessageEvents[_0x9b82('0x3')](_0x3d5279,_0xb0086c);_0x31a5c1(null);};}for(var e in events){if(events[_0x9b82('0x4')](e)){var event=events[e];MailMessage[_0x9b82('0x5')](e,emitEvent(event));}}module['exports']=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index f9e96ac..3bcce8a 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 _0x7518=['define','MailMessage','messageId','fti_mail_messages','plainBody','FULLTEXT','body','models','get','direction','toLowerCase','out','isNil','UserId','findOne','update','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','html-to-text','path','rimraf','exports'];(function(_0xd551f7,_0x353a60){var _0x347082=function(_0x59e526){while(--_0x59e526){_0xd551f7['push'](_0xd551f7['shift']());}};_0x347082(++_0x353a60);}(_0x7518,0x122));var _0x8751=function(_0x1d056a,_0x293d07){_0x1d056a=_0x1d056a-0x0;var _0x8e14c0=_0x7518[_0x1d056a];return _0x8e14c0;};'use strict';var _=require(_0x8751('0x0'));var util=require('util');var logger=require(_0x8751('0x1'))(_0x8751('0x2'));var moment=require(_0x8751('0x3'));var BPromise=require(_0x8751('0x4'));var rp=require(_0x8751('0x5'));var htmlToText=require(_0x8751('0x6'));var fs=require('fs');var path=require(_0x8751('0x7'));var rimraf=require(_0x8751('0x8'));var config=require('../../config/environment');var attributes=require('./mailMessage.attributes');module[_0x8751('0x9')]=function(_0x5f0849,_0x280634){return _0x5f0849[_0x8751('0xa')](_0x8751('0xb'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0x8751('0xc'),'fields':[_0x8751('0xc')]},{'name':_0x8751('0xd'),'fields':[_0x8751('0xe'),'subject'],'type':_0x8751('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x39f632,_0x59c198,_0x4e32e2){if(_0x39f632[_0x8751('0x10')]){_0x39f632[_0x8751('0xe')]=htmlToText['fromString'](_0x39f632[_0x8751('0x10')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x4e32e2(null,_0x59c198);},'afterCreate':function(_0x25e2a4,_0x3fadc1,_0x5e0aa3){var _0xed2ae2=_0x5f0849[_0x8751('0x11')];var _0xe5e09d=_0x25e2a4[_0x8751('0x12')]({'plain':!![]});if(_0xe5e09d[_0x8751('0x13')]['toLowerCase']()==='in'||_0xe5e09d[_0x8751('0x13')][_0x8751('0x14')]()===_0x8751('0x15')&&!_0xe5e09d['secret']&&!_[_0x8751('0x16')](_0xe5e09d[_0x8751('0x17')])){_0xed2ae2['MailInteraction'][_0x8751('0x18')]({'where':{'id':_0xe5e09d['MailInteractionId']}})['then'](function(_0x4ca0aa){if(_0x4ca0aa){_0x4ca0aa[_0x8751('0x19')]({'lastMsgAt':_0xe5e09d['createdAt'],'lastMsgDirection':_0xe5e09d[_0x8751('0x13')][_0x8751('0x14')](),'lastMsgBody':_0xe5e09d['body']});}})[_0x8751('0x1a')](function(_0x24dde6){console[_0x8751('0x1b')](_0x24dde6);});}_0x5e0aa3();}},'charset':_0x8751('0x1c'),'collate':_0x8751('0x1d')});}; \ No newline at end of file +var _0xe516=['fromString','body','models','get','direction','toLowerCase','out','secret','isNil','MailInteraction','findOne','MailInteractionId','then','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailMessage.attributes','define','MailMessage','mail_messages','fti_mail_messages','plainBody','subject','FULLTEXT'];(function(_0x39b4b2,_0x147b7f){var _0x270643=function(_0xaea9b9){while(--_0xaea9b9){_0x39b4b2['push'](_0x39b4b2['shift']());}};_0x270643(++_0x147b7f);}(_0xe516,0x15a));var _0x6e51=function(_0x151418,_0x2cbffa){_0x151418=_0x151418-0x0;var _0x40e29a=_0xe516[_0x151418];return _0x40e29a;};'use strict';var _=require(_0x6e51('0x0'));var util=require(_0x6e51('0x1'));var logger=require(_0x6e51('0x2'))('api');var moment=require(_0x6e51('0x3'));var BPromise=require(_0x6e51('0x4'));var rp=require(_0x6e51('0x5'));var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0x6e51('0x6'));var rimraf=require(_0x6e51('0x7'));var config=require(_0x6e51('0x8'));var attributes=require(_0x6e51('0x9'));module['exports']=function(_0x16c7f3,_0x13ba92){return _0x16c7f3[_0x6e51('0xa')](_0x6e51('0xb'),attributes,{'tableName':_0x6e51('0xc'),'paranoid':![],'indexes':[{'name':'messageId','fields':['messageId']},{'name':_0x6e51('0xd'),'fields':[_0x6e51('0xe'),_0x6e51('0xf')],'type':_0x6e51('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x295bfa,_0x557ed4,_0x397ee2){if(_0x295bfa['body']){_0x295bfa[_0x6e51('0xe')]=htmlToText[_0x6e51('0x11')](_0x295bfa[_0x6e51('0x12')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x397ee2(null,_0x557ed4);},'afterCreate':function(_0x575368,_0x780c06,_0x187ae8){var _0x2b3b53=_0x16c7f3[_0x6e51('0x13')];var _0x5566fe=_0x575368[_0x6e51('0x14')]({'plain':!![]});if(_0x5566fe[_0x6e51('0x15')][_0x6e51('0x16')]()==='in'||_0x5566fe['direction'][_0x6e51('0x16')]()===_0x6e51('0x17')&&!_0x5566fe[_0x6e51('0x18')]&&!_[_0x6e51('0x19')](_0x5566fe['UserId'])){_0x2b3b53[_0x6e51('0x1a')][_0x6e51('0x1b')]({'where':{'id':_0x5566fe[_0x6e51('0x1c')]}})[_0x6e51('0x1d')](function(_0x3419d2){if(_0x3419d2){_0x3419d2['update']({'lastMsgAt':_0x5566fe['createdAt'],'lastMsgDirection':_0x5566fe[_0x6e51('0x15')]['toLowerCase'](),'lastMsgBody':_0x5566fe[_0x6e51('0x12')]});}})[_0x6e51('0x1e')](function(_0x423c56){console['error'](_0x423c56);});}_0x187ae8();}},'charset':_0x6e51('0x1f'),'collate':_0x6e51('0x20')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 9f41bea..1dc35bf 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 _0xbacd=['MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateMailMessage','create','options','raw','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x25bcd0,_0x1b41ec){var _0x5a7a7a=function(_0xa2e5b6){while(--_0xa2e5b6){_0x25bcd0['push'](_0x25bcd0['shift']());}};_0x5a7a7a(++_0x1b41ec);}(_0xbacd,0x1c5));var _0xdbac=function(_0x3b8225,_0x3d27f2){_0x3b8225=_0x3b8225-0x0;var _0xec2182=_0xbacd[_0x3b8225];return _0xec2182;};'use strict';var _=require(_0xdbac('0x0'));var util=require(_0xdbac('0x1'));var moment=require('moment');var BPromise=require(_0xdbac('0x2'));var rs=require(_0xdbac('0x3'));var fs=require('fs');var Redis=require(_0xdbac('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xdbac('0x5'));var logger=require(_0xdbac('0x6'))(_0xdbac('0x7'));var config=require(_0xdbac('0x8'));var jayson=require(_0xdbac('0x9'));var client=jayson[_0xdbac('0xa')][_0xdbac('0xb')]({'port':0x232a});config[_0xdbac('0xc')]=_[_0xdbac('0xd')](config[_0xdbac('0xc')],{'host':_0xdbac('0xe'),'port':0x18eb});var socket=require(_0xdbac('0xf'))(new Redis(config[_0xdbac('0xc')]));require(_0xdbac('0x10'))[_0xdbac('0x11')](socket);function respondWithRpcPromise(_0x4d025f,_0x18f3ad,_0x258f7e){return new BPromise(function(_0x5abcff,_0x30a135){return client['request'](_0x4d025f,_0x258f7e)[_0xdbac('0x12')](function(_0x354884){logger[_0xdbac('0x13')](_0xdbac('0x14'),_0x18f3ad,_0xdbac('0x15'));logger[_0xdbac('0x16')](_0xdbac('0x17'),_0x18f3ad,_0xdbac('0x15'),JSON[_0xdbac('0x18')](_0x354884));if(_0x354884['error']){if(_0x354884[_0xdbac('0x19')][_0xdbac('0x1a')]===0x1f4){logger[_0xdbac('0x19')](_0xdbac('0x14'),_0x18f3ad,_0x354884[_0xdbac('0x19')][_0xdbac('0x1b')]);return _0x30a135(_0x354884[_0xdbac('0x19')][_0xdbac('0x1b')]);}logger['error'](_0xdbac('0x14'),_0x18f3ad,_0x354884[_0xdbac('0x19')][_0xdbac('0x1b')]);return _0x5abcff(_0x354884['error'][_0xdbac('0x1b')]);}else{logger[_0xdbac('0x13')](_0xdbac('0x14'),_0x18f3ad,_0xdbac('0x15'));_0x5abcff(_0x354884[_0xdbac('0x1c')][_0xdbac('0x1b')]);}})[_0xdbac('0x1d')](function(_0x43fea9){logger[_0xdbac('0x19')](_0xdbac('0x14'),_0x18f3ad,_0x43fea9);_0x30a135(_0x43fea9);});});}exports[_0xdbac('0x1e')]=function(_0x9c74a5){var _0x5ec67c=this;return new Promise(function(_0x3de274,_0x323801){return db['MailMessage'][_0xdbac('0x1f')](_0x9c74a5['body'],{'raw':_0x9c74a5[_0xdbac('0x20')]?_0x9c74a5['options'][_0xdbac('0x21')]===undefined?!![]:![]:!![]})[_0xdbac('0x12')](function(_0x20642c){logger[_0xdbac('0x13')](_0xdbac('0x1e'),_0x9c74a5);logger[_0xdbac('0x16')](_0xdbac('0x1e'),_0x9c74a5,JSON['stringify'](_0x20642c));_0x3de274(_0x20642c);})[_0xdbac('0x1d')](function(_0x822567){logger[_0xdbac('0x19')](_0xdbac('0x1e'),_0x822567[_0xdbac('0x1b')],_0x9c74a5);_0x323801(_0x5ec67c[_0xdbac('0x19')](0x1f4,_0x822567[_0xdbac('0x1b')]));});});}; \ No newline at end of file +var _0x50e5=['./mailMessage.socket','register','request','info','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateMailMessage','create','body','raw','then','debug','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost'];(function(_0x31ced5,_0x5d5415){var _0x10d9e5=function(_0x2e51a5){while(--_0x2e51a5){_0x31ced5['push'](_0x31ced5['shift']());}};_0x10d9e5(++_0x5d5415);}(_0x50e5,0xb7));var _0x550e=function(_0x2a34a2,_0x2a46fd){_0x2a34a2=_0x2a34a2-0x0;var _0x1d9b0a=_0x50e5[_0x2a34a2];return _0x1d9b0a;};'use strict';var _=require(_0x550e('0x0'));var util=require(_0x550e('0x1'));var moment=require('moment');var BPromise=require(_0x550e('0x2'));var rs=require(_0x550e('0x3'));var fs=require('fs');var Redis=require(_0x550e('0x4'));var db=require(_0x550e('0x5'))['db'];var utils=require(_0x550e('0x6'));var logger=require(_0x550e('0x7'))(_0x550e('0x8'));var config=require(_0x550e('0x9'));var jayson=require(_0x550e('0xa'));var client=jayson[_0x550e('0xb')][_0x550e('0xc')]({'port':0x232a});config[_0x550e('0xd')]=_['defaults'](config[_0x550e('0xd')],{'host':_0x550e('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x550e('0xd')]));require(_0x550e('0xf'))[_0x550e('0x10')](socket);function respondWithRpcPromise(_0x4d236d,_0x1a1e3e,_0x49cc53){return new BPromise(function(_0x59c6c9,_0x116691){return client[_0x550e('0x11')](_0x4d236d,_0x49cc53)['then'](function(_0x13f7e9){logger[_0x550e('0x12')](_0x550e('0x13'),_0x1a1e3e,_0x550e('0x14'));logger['debug'](_0x550e('0x15'),_0x1a1e3e,'request\x20sent',JSON[_0x550e('0x16')](_0x13f7e9));if(_0x13f7e9['error']){if(_0x13f7e9[_0x550e('0x17')][_0x550e('0x18')]===0x1f4){logger[_0x550e('0x17')](_0x550e('0x13'),_0x1a1e3e,_0x13f7e9[_0x550e('0x17')]['message']);return _0x116691(_0x13f7e9[_0x550e('0x17')]['message']);}logger[_0x550e('0x17')]('MailMessage,\x20%s,\x20%s',_0x1a1e3e,_0x13f7e9['error'][_0x550e('0x19')]);return _0x59c6c9(_0x13f7e9[_0x550e('0x17')]['message']);}else{logger['info']('MailMessage,\x20%s,\x20%s',_0x1a1e3e,_0x550e('0x14'));_0x59c6c9(_0x13f7e9['result']['message']);}})[_0x550e('0x1a')](function(_0x3607ad){logger[_0x550e('0x17')](_0x550e('0x13'),_0x1a1e3e,_0x3607ad);_0x116691(_0x3607ad);});});}exports[_0x550e('0x1b')]=function(_0x29f2db){var _0x3b4dca=this;return new Promise(function(_0x38f12b,_0x1b9799){return db['MailMessage'][_0x550e('0x1c')](_0x29f2db[_0x550e('0x1d')],{'raw':_0x29f2db['options']?_0x29f2db['options'][_0x550e('0x1e')]===undefined?!![]:![]:!![]})[_0x550e('0x1f')](function(_0x5769bb){logger[_0x550e('0x12')](_0x550e('0x1b'),_0x29f2db);logger[_0x550e('0x20')](_0x550e('0x1b'),_0x29f2db,JSON[_0x550e('0x16')](_0x5769bb));_0x38f12b(_0x5769bb);})[_0x550e('0x1a')](function(_0x56f6a2){logger[_0x550e('0x17')](_0x550e('0x1b'),_0x56f6a2[_0x550e('0x19')],_0x29f2db);_0x1b9799(_0x3b4dca[_0x550e('0x17')](0x1f4,_0x56f6a2[_0x550e('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 3d8ce9c..a60d732 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 _0xa03b=['register','length','mailMessage:','save','removeListener'];(function(_0x5752f1,_0x3c9165){var _0x3c3ef1=function(_0x2c2f96){while(--_0x2c2f96){_0x5752f1['push'](_0x5752f1['shift']());}};_0x3c3ef1(++_0x3c9165);}(_0xa03b,0xad));var _0xba03=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa03b[_0x110c3d];return _0x226d67;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=[_0xba03('0x0'),'remove','update'];function createListener(_0x3bbe4f,_0x3d6c68){return function(_0x3bb23e){_0x3d6c68['emit'](_0x3bbe4f,_0x3bb23e);};}function removeListener(_0x215692,_0x82ef51){return function(){MailMessageEvents[_0xba03('0x1')](_0x215692,_0x82ef51);};}exports[_0xba03('0x2')]=function(_0xe3188){for(var _0x190378=0x0,_0x2365d5=events[_0xba03('0x3')];_0x190378<_0x2365d5;_0x190378++){var _0x1a72c7=events[_0x190378];var _0x1d4383=createListener(_0xba03('0x4')+_0x1a72c7,_0xe3188);MailMessageEvents['on'](_0x1a72c7,_0x1d4383);}}; \ No newline at end of file +var _0xd4ff=['register','mailMessage:','./mailMessage.events','save','remove','emit','removeListener'];(function(_0x2a766d,_0x402965){var _0x137f4a=function(_0xa592e9){while(--_0xa592e9){_0x2a766d['push'](_0x2a766d['shift']());}};_0x137f4a(++_0x402965);}(_0xd4ff,0x191));var _0xfd4f=function(_0x2c5f1f,_0x292667){_0x2c5f1f=_0x2c5f1f-0x0;var _0x2cad7e=_0xd4ff[_0x2c5f1f];return _0x2cad7e;};'use strict';var MailMessageEvents=require(_0xfd4f('0x0'));var events=[_0xfd4f('0x1'),_0xfd4f('0x2'),'update'];function createListener(_0x251c83,_0x5e4e5f){return function(_0x1781ab){_0x5e4e5f[_0xfd4f('0x3')](_0x251c83,_0x1781ab);};}function removeListener(_0x472b8c,_0x390e76){return function(){MailMessageEvents[_0xfd4f('0x4')](_0x472b8c,_0x390e76);};}exports[_0xfd4f('0x5')]=function(_0x21754e){for(var _0x2a499b=0x0,_0x3f0384=events['length'];_0x2a499b<_0x3f0384;_0x2a499b++){var _0x2c6930=events[_0x2a499b];var _0x939bb7=createListener(_0xfd4f('0x6')+_0x2c6930,_0x21754e);MailMessageEvents['on'](_0x2c6930,_0x939bb7);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 70e66ef..40b6660 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 _0xff79=['describe','/:id','/:id/members','getMembers','/:id/users','getAgents','post','/:id/teams','addTeams','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','isAuthenticated','get','/describe'];(function(_0x3a5b06,_0x3dd9cd){var _0x15b6aa=function(_0x2b1b34){while(--_0x2b1b34){_0x3a5b06['push'](_0x3a5b06['shift']());}};_0x15b6aa(++_0x3dd9cd);}(_0xff79,0x1ec));var _0x9ff7=function(_0x4b9a8f,_0x5e5fd5){_0x4b9a8f=_0x4b9a8f-0x0;var _0xa18064=_0xff79[_0x4b9a8f];return _0xa18064;};'use strict';var multer=require(_0x9ff7('0x0'));var util=require(_0x9ff7('0x1'));var path=require(_0x9ff7('0x2'));var timeout=require(_0x9ff7('0x3'));var express=require(_0x9ff7('0x4'));var router=express['Router']();var auth=require(_0x9ff7('0x5'));var interaction=require(_0x9ff7('0x6'));var config=require(_0x9ff7('0x7'));var controller=require(_0x9ff7('0x8'));router['get']('/',auth[_0x9ff7('0x9')](),controller['index']);router[_0x9ff7('0xa')](_0x9ff7('0xb'),auth['isAuthenticated'](),controller[_0x9ff7('0xc')]);router[_0x9ff7('0xa')](_0x9ff7('0xd'),auth[_0x9ff7('0x9')](),controller['show']);router[_0x9ff7('0xa')](_0x9ff7('0xe'),auth['isAuthenticated'](),controller[_0x9ff7('0xf')]);router['get']('/:id/teams',auth['isAuthenticated'](),controller['getTeams']);router[_0x9ff7('0xa')](_0x9ff7('0x10'),auth['isAuthenticated'](),controller[_0x9ff7('0x11')]);router[_0x9ff7('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9ff7('0x12')](_0x9ff7('0x13'),auth[_0x9ff7('0x9')](),controller[_0x9ff7('0x14')]);router['post'](_0x9ff7('0x10'),auth[_0x9ff7('0x9')](),controller[_0x9ff7('0x15')]);router['put'](_0x9ff7('0xd'),auth[_0x9ff7('0x9')](),controller[_0x9ff7('0x16')]);router[_0x9ff7('0x17')](_0x9ff7('0xd'),auth[_0x9ff7('0x9')](),controller[_0x9ff7('0x18')]);router['delete'](_0x9ff7('0x13'),auth[_0x9ff7('0x9')](),controller[_0x9ff7('0x19')]);router[_0x9ff7('0x17')](_0x9ff7('0x10'),auth[_0x9ff7('0x9')](),controller[_0x9ff7('0x1a')]);module[_0x9ff7('0x1b')]=router; \ No newline at end of file +var _0xee20=['/:id','show','/:id/teams','getTeams','/:id/users','post','addAgents','put','update','destroy','removeTeams','removeAgents','exports','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','describe'];(function(_0x407249,_0x28910c){var _0x6dbe1e=function(_0x46de37){while(--_0x46de37){_0x407249['push'](_0x407249['shift']());}};_0x6dbe1e(++_0x28910c);}(_0xee20,0xdf));var _0x0ee2=function(_0x27cfcb,_0x24b115){_0x27cfcb=_0x27cfcb-0x0;var _0x3cee84=_0xee20[_0x27cfcb];return _0x3cee84;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0ee2('0x0'));var timeout=require(_0x0ee2('0x1'));var express=require(_0x0ee2('0x2'));var router=express['Router']();var auth=require(_0x0ee2('0x3'));var interaction=require(_0x0ee2('0x4'));var config=require('../../config/environment');var controller=require('./mailQueue.controller');router[_0x0ee2('0x5')]('/',auth[_0x0ee2('0x6')](),controller['index']);router[_0x0ee2('0x5')]('/describe',auth['isAuthenticated'](),controller[_0x0ee2('0x7')]);router[_0x0ee2('0x5')](_0x0ee2('0x8'),auth[_0x0ee2('0x6')](),controller[_0x0ee2('0x9')]);router[_0x0ee2('0x5')]('/:id/members',auth[_0x0ee2('0x6')](),controller['getMembers']);router['get'](_0x0ee2('0xa'),auth[_0x0ee2('0x6')](),controller[_0x0ee2('0xb')]);router[_0x0ee2('0x5')](_0x0ee2('0xc'),auth['isAuthenticated'](),controller['getAgents']);router[_0x0ee2('0xd')]('/',auth[_0x0ee2('0x6')](),controller['create']);router[_0x0ee2('0xd')]('/:id/teams',auth[_0x0ee2('0x6')](),controller['addTeams']);router[_0x0ee2('0xd')](_0x0ee2('0xc'),auth[_0x0ee2('0x6')](),controller[_0x0ee2('0xe')]);router[_0x0ee2('0xf')](_0x0ee2('0x8'),auth[_0x0ee2('0x6')](),controller[_0x0ee2('0x10')]);router['delete'](_0x0ee2('0x8'),auth[_0x0ee2('0x6')](),controller[_0x0ee2('0x11')]);router['delete'](_0x0ee2('0xa'),auth['isAuthenticated'](),controller[_0x0ee2('0x12')]);router['delete'](_0x0ee2('0xc'),auth[_0x0ee2('0x6')](),controller[_0x0ee2('0x13')]);module[_0x0ee2('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index e9d0c24..478bccb 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 _0x8bf4=['name','INTEGER','rrmemory','roundrobin','sequelize','exports','STRING'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x8bf4,0x185));var _0x48bf=function(_0x652b90,_0x52865b){_0x652b90=_0x652b90-0x0;var _0x523368=_0x8bf4[_0x652b90];return _0x523368;};'use strict';var Sequelize=require(_0x48bf('0x0'));module[_0x48bf('0x1')]={'name':{'type':Sequelize[_0x48bf('0x2')],'unique':_0x48bf('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x48bf('0x2')]},'timeout':{'type':Sequelize[_0x48bf('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x48bf('0x5'),'beepall',_0x48bf('0x6'))}}; \ No newline at end of file +var _0x6366=['rrmemory','beepall','sequelize','exports','STRING','INTEGER','ENUM'];(function(_0x5cf9a2,_0x1f0e09){var _0x32cd18=function(_0x46db57){while(--_0x46db57){_0x5cf9a2['push'](_0x5cf9a2['shift']());}};_0x32cd18(++_0x1f0e09);}(_0x6366,0x198));var _0x6636=function(_0x18a87b,_0x3557ad){_0x18a87b=_0x18a87b-0x0;var _0x3f3550=_0x6366[_0x18a87b];return _0x3f3550;};'use strict';var Sequelize=require(_0x6636('0x0'));module[_0x6636('0x1')]={'name':{'type':Sequelize[_0x6636('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x6636('0x2')]},'timeout':{'type':Sequelize[_0x6636('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x6636('0x4')](_0x6636('0x5'),_0x6636('0x6'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index fd2a2a1..4acabd6 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 _0xa72a=['count','offset','limit','set','Content-Range','update','then','get','MailQueues','UserProfileResource','error','name','index','map','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','MailQueue','includeAll','include','findAll','rows','show','params','rawAttributes','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserMailQueue','nolimit','MailQueueId','User','UserId','mailPause','format','%s/%s','SIP','createdAt','updatedAt','getTeams','Team','addTeams','ids','Agents','online','interface','flatMap','sequelize','transaction','findOrCreate','forEach','select','field','team_has_mail_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','includes','all','compact','value','isEmpty','emit','addAgents','omit','userMailQueue:save','removeAgents','userMailQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','end','json'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xa72a,0x64));var _0xaa72=function(_0x34a118,_0xbff87c){_0x34a118=_0x34a118-0x0;var _0x18f5ed=_0xa72a[_0x34a118];return _0x18f5ed;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xaa72('0x0'));var rimraf=require(_0xaa72('0x1'));var zipdir=require(_0xaa72('0x2'));var jsonpatch=require(_0xaa72('0x3'));var rp=require(_0xaa72('0x4'));var moment=require(_0xaa72('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xaa72('0x6'));var util=require(_0xaa72('0x7'));var path=require(_0xaa72('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xaa72('0x9'));var squel=require('squel');var crypto=require(_0xaa72('0xa'));var jsforce=require(_0xaa72('0xb'));var deskjs=require(_0xaa72('0xc'));var toCsv=require(_0xaa72('0xd'));var querystring=require(_0xaa72('0xe'));var Papa=require(_0xaa72('0xf'));var Redis=require(_0xaa72('0x10'));var authService=require(_0xaa72('0x11'));var qs=require(_0xaa72('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaa72('0x13'));var logger=require(_0xaa72('0x14'))(_0xaa72('0x15'));var utils=require(_0xaa72('0x16'));var config=require(_0xaa72('0x17'));var db=require(_0xaa72('0x18'))['db'];config[_0xaa72('0x19')]=_[_0xaa72('0x1a')](config[_0xaa72('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xaa72('0x1b'))(new Redis(config[_0xaa72('0x19')]));require(_0xaa72('0x1c'))[_0xaa72('0x1d')](socket);function respondWithStatusCode(_0xafe60d,_0x388746){_0x388746=_0x388746||0xcc;return function(_0x1be1eb){if(_0x1be1eb){return _0xafe60d[_0xaa72('0x1e')](_0x388746);}return _0xafe60d[_0xaa72('0x1f')](_0x388746)[_0xaa72('0x20')]();};}function respondWithResult(_0x25a368,_0x4219ca){_0x4219ca=_0x4219ca||0xc8;return function(_0x1e22ac){if(_0x1e22ac){return _0x25a368[_0xaa72('0x1f')](_0x4219ca)[_0xaa72('0x21')](_0x1e22ac);}};}function respondWithFilteredResult(_0x379e23,_0x47b0ba){return function(_0xa0c7ab){if(_0xa0c7ab){var _0x3aa958=_0xa0c7ab[_0xaa72('0x22')],_0x214a98=_0x47b0ba[_0xaa72('0x23')],_0x1c70aa=_0x47b0ba['offset']+_0x47b0ba[_0xaa72('0x24')],_0x4bb837;if(_0x1c70aa>=_0x3aa958){_0x1c70aa=_0x3aa958;_0x4bb837=0xc8;}else{_0x4bb837=0xce;}_0x379e23[_0xaa72('0x1f')](_0x4bb837);return _0x379e23[_0xaa72('0x25')](_0xaa72('0x26'),_0x214a98+'-'+_0x1c70aa+'/'+_0x3aa958)['json'](_0xa0c7ab);}return null;};}function patchUpdates(_0x16caa2){return function(_0x516dc2){try{jsonpatch['apply'](_0x516dc2,_0x16caa2,!![]);}catch(_0x292144){return BPromise['reject'](_0x292144);}return _0x516dc2['save']();};}function saveUpdates(_0x167852,_0x51a4fa){return function(_0x28f5f0){if(_0x28f5f0){return _0x28f5f0[_0xaa72('0x27')](_0x167852)['then'](function(_0x443cc9){return _0x443cc9;});}return null;};}function removeEntity(_0x2f1a5f,_0xc86fff){return function(_0x68dd91){if(_0x68dd91){return _0x68dd91['destroy']()[_0xaa72('0x28')](function(){var _0x4f6290=_0x68dd91[_0xaa72('0x29')]({'plain':!![]});var _0x4b78e4=_0xaa72('0x2a');return db[_0xaa72('0x2b')]['destroy']({'where':{'type':_0x4b78e4,'resourceId':_0x4f6290['id']}})['then'](function(){return _0x68dd91;});})[_0xaa72('0x28')](function(){_0x2f1a5f[_0xaa72('0x1f')](0xcc)[_0xaa72('0x20')]();});}};}function handleEntityNotFound(_0x257c1b,_0x128b29){return function(_0xeae25b){if(!_0xeae25b){_0x257c1b[_0xaa72('0x1e')](0x194);}return _0xeae25b;};}function handleError(_0x2e5e18,_0x5aa443){_0x5aa443=_0x5aa443||0x1f4;return function(_0x16c485){logger[_0xaa72('0x2c')](_0x16c485['stack']);if(_0x16c485[_0xaa72('0x2d')]){delete _0x16c485[_0xaa72('0x2d')];}_0x2e5e18[_0xaa72('0x1f')](_0x5aa443)['send'](_0x16c485);};}exports[_0xaa72('0x2e')]=function(_0x54494a,_0xd77db9){var _0x461766={},_0x2690a5={},_0x43d9d={'count':0x0,'rows':[]};var _0x1484a0=_[_0xaa72('0x2f')](db['MailQueue']['rawAttributes'],function(_0x2b23ad){return{'name':_0x2b23ad[_0xaa72('0x30')],'type':_0x2b23ad[_0xaa72('0x31')]['key']};});_0x2690a5[_0xaa72('0x32')]=_[_0xaa72('0x2f')](_0x1484a0,_0xaa72('0x2d'));_0x2690a5[_0xaa72('0x33')]=_[_0xaa72('0x34')](_0x54494a[_0xaa72('0x33')]);_0x2690a5['filters']=_[_0xaa72('0x35')](_0x2690a5['model'],_0x2690a5['query']);_0x461766[_0xaa72('0x36')]=_[_0xaa72('0x35')](_0x2690a5['model'],qs[_0xaa72('0x37')](_0x54494a[_0xaa72('0x33')]['fields']));_0x461766[_0xaa72('0x36')]=_0x461766[_0xaa72('0x36')][_0xaa72('0x38')]?_0x461766[_0xaa72('0x36')]:_0x2690a5['model'];if(!_0x54494a[_0xaa72('0x33')][_0xaa72('0x39')]('nolimit')){_0x461766['limit']=qs[_0xaa72('0x24')](_0x54494a[_0xaa72('0x33')][_0xaa72('0x24')]);_0x461766['offset']=qs[_0xaa72('0x23')](_0x54494a[_0xaa72('0x33')][_0xaa72('0x23')]);}_0x461766[_0xaa72('0x3a')]=qs[_0xaa72('0x3b')](_0x54494a[_0xaa72('0x33')][_0xaa72('0x3b')]);_0x461766[_0xaa72('0x3c')]=qs[_0xaa72('0x3d')](_[_0xaa72('0x3e')](_0x54494a['query'],_0x2690a5[_0xaa72('0x3d')]));if(_0x54494a[_0xaa72('0x33')][_0xaa72('0x3f')]){_0x461766[_0xaa72('0x3c')]=_[_0xaa72('0x40')](_0x461766[_0xaa72('0x3c')],{'$or':_['map'](_0x1484a0,function(_0x2382b8){if(_0x2382b8[_0xaa72('0x31')]!=='VIRTUAL'){var _0x1043ca={};_0x1043ca[_0x2382b8[_0xaa72('0x2d')]]={'$like':'%'+_0x54494a[_0xaa72('0x33')][_0xaa72('0x3f')]+'%'};return _0x1043ca;}})});}_0x461766=_[_0xaa72('0x40')]({},_0x461766,_0x54494a['options']);var _0x37acf4={'where':_0x461766[_0xaa72('0x3c')]};return db[_0xaa72('0x41')]['count'](_0x37acf4)[_0xaa72('0x28')](function(_0x442d6d){_0x43d9d[_0xaa72('0x22')]=_0x442d6d;if(_0x54494a['query'][_0xaa72('0x42')]){_0x461766[_0xaa72('0x43')]=[{'all':!![]}];}return db[_0xaa72('0x41')][_0xaa72('0x44')](_0x461766);})[_0xaa72('0x28')](function(_0x1580dc){_0x43d9d[_0xaa72('0x45')]=_0x1580dc;return _0x43d9d;})[_0xaa72('0x28')](respondWithFilteredResult(_0xd77db9,_0x461766))['catch'](handleError(_0xd77db9,null));};exports[_0xaa72('0x46')]=function(_0xeb8539,_0x5033c3){var _0x804204={'raw':!![],'where':{'id':_0xeb8539[_0xaa72('0x47')]['id']}},_0x3d42bc={};_0x3d42bc[_0xaa72('0x32')]=_['keys'](db[_0xaa72('0x41')][_0xaa72('0x48')]);_0x3d42bc[_0xaa72('0x33')]=_[_0xaa72('0x34')](_0xeb8539[_0xaa72('0x33')]);_0x3d42bc['filters']=_[_0xaa72('0x35')](_0x3d42bc[_0xaa72('0x32')],_0x3d42bc[_0xaa72('0x33')]);_0x804204['attributes']=_[_0xaa72('0x35')](_0x3d42bc['model'],qs[_0xaa72('0x37')](_0xeb8539['query'][_0xaa72('0x37')]));_0x804204[_0xaa72('0x36')]=_0x804204[_0xaa72('0x36')][_0xaa72('0x38')]?_0x804204[_0xaa72('0x36')]:_0x3d42bc[_0xaa72('0x32')];if(_0xeb8539[_0xaa72('0x33')][_0xaa72('0x42')]){_0x804204[_0xaa72('0x43')]=[{'all':!![]}];}_0x804204=_[_0xaa72('0x40')]({},_0x804204,_0xeb8539[_0xaa72('0x49')]);return db[_0xaa72('0x41')][_0xaa72('0x4a')](_0x804204)[_0xaa72('0x28')](handleEntityNotFound(_0x5033c3,null))[_0xaa72('0x28')](respondWithResult(_0x5033c3,null))[_0xaa72('0x4b')](handleError(_0x5033c3,null));};exports[_0xaa72('0x4c')]=function(_0x289032,_0x1ed446){return db[_0xaa72('0x41')][_0xaa72('0x4c')](_0x289032[_0xaa72('0x4d')],{})[_0xaa72('0x28')](function(_0x4cefec){var _0x7a6437=_0x289032[_0xaa72('0x4e')][_0xaa72('0x29')]({'plain':!![]});if(!_0x7a6437)throw new Error(_0xaa72('0x4f'));if(_0x7a6437[_0xaa72('0x50')]===_0xaa72('0x4e')){var _0x5a8b7a=_0x4cefec['get']({'plain':!![]});var _0x4dd681=_0xaa72('0x2a');return db[_0xaa72('0x51')][_0xaa72('0x4a')]({'where':{'name':_0x4dd681,'userProfileId':_0x7a6437[_0xaa72('0x52')]},'raw':!![]})[_0xaa72('0x28')](function(_0x2db32b){if(_0x2db32b&&_0x2db32b[_0xaa72('0x53')]===0x0){return db[_0xaa72('0x2b')][_0xaa72('0x4c')]({'name':_0x5a8b7a[_0xaa72('0x2d')],'resourceId':_0x5a8b7a['id'],'type':_0x2db32b[_0xaa72('0x2d')],'sectionId':_0x2db32b['id']},{})[_0xaa72('0x28')](function(){return _0x4cefec;});}else{return _0x4cefec;}})[_0xaa72('0x4b')](function(_0x49dc85){logger[_0xaa72('0x2c')](_0xaa72('0x54'),_0x49dc85);throw _0x49dc85;});}return _0x4cefec;})[_0xaa72('0x28')](respondWithResult(_0x1ed446,0xc9))[_0xaa72('0x4b')](handleError(_0x1ed446,null));};exports['update']=function(_0x1053eb,_0xb6fb0){if(_0x1053eb['body']['id']){delete _0x1053eb[_0xaa72('0x4d')]['id'];}return db[_0xaa72('0x41')][_0xaa72('0x4a')]({'where':{'id':_0x1053eb[_0xaa72('0x47')]['id']}})[_0xaa72('0x28')](handleEntityNotFound(_0xb6fb0,null))[_0xaa72('0x28')](saveUpdates(_0x1053eb[_0xaa72('0x4d')],null))[_0xaa72('0x28')](respondWithResult(_0xb6fb0,null))[_0xaa72('0x4b')](handleError(_0xb6fb0,null));};exports['destroy']=function(_0x27288b,_0x12d609){return db['MailQueue'][_0xaa72('0x4a')]({'where':{'id':_0x27288b[_0xaa72('0x47')]['id']}})[_0xaa72('0x28')](handleEntityNotFound(_0x12d609,null))[_0xaa72('0x28')](removeEntity(_0x12d609,null))['catch'](handleError(_0x12d609,null));};exports[_0xaa72('0x55')]=function(_0x9bcd1a,_0x3de688){return db[_0xaa72('0x41')][_0xaa72('0x55')]()['then'](respondWithResult(_0x3de688,null))[_0xaa72('0x4b')](handleError(_0x3de688,null));};exports[_0xaa72('0x56')]=function(_0x286ef2,_0x333957,_0x322b48){var _0x585cb5={'raw':!![],'where':{}},_0x218beb={},_0x1d6b5b;return db['MailQueue'][_0xaa72('0x57')]({'where':{'id':_0x286ef2[_0xaa72('0x47')]['id']}})['then'](handleEntityNotFound(_0x333957,null))[_0xaa72('0x28')](function(_0x41019e){if(_0x41019e){_0x1d6b5b=_0x41019e[_0xaa72('0x29')]({'plain':!![]});_0x218beb['model']=_[_0xaa72('0x34')](db[_0xaa72('0x58')][_0xaa72('0x48')]);_0x218beb[_0xaa72('0x33')]=_[_0xaa72('0x34')](_0x286ef2[_0xaa72('0x33')]);_0x218beb['filters']=_['intersection'](_0x218beb[_0xaa72('0x32')],_0x218beb[_0xaa72('0x33')]);_0x585cb5[_0xaa72('0x36')]=_[_0xaa72('0x35')](_0x218beb[_0xaa72('0x32')],qs[_0xaa72('0x37')](_0x286ef2[_0xaa72('0x33')][_0xaa72('0x37')]));_0x585cb5[_0xaa72('0x36')]=_0x585cb5[_0xaa72('0x36')]['length']?_0x585cb5[_0xaa72('0x36')]:_0x218beb[_0xaa72('0x32')];if(!_0x286ef2[_0xaa72('0x33')][_0xaa72('0x39')](_0xaa72('0x59'))){_0x585cb5[_0xaa72('0x24')]=qs[_0xaa72('0x24')](_0x286ef2[_0xaa72('0x33')][_0xaa72('0x24')]);_0x585cb5['offset']=qs['offset'](_0x286ef2[_0xaa72('0x33')][_0xaa72('0x23')]);}_0x585cb5[_0xaa72('0x3a')]=qs['sort'](_0x286ef2[_0xaa72('0x33')][_0xaa72('0x3b')]);_0x585cb5[_0xaa72('0x3c')]=qs[_0xaa72('0x3d')](_[_0xaa72('0x3e')](_0x286ef2[_0xaa72('0x33')],_0x218beb[_0xaa72('0x3d')]));_0x585cb5[_0xaa72('0x3c')][_0xaa72('0x5a')]=_0x41019e['id'];if(_0x286ef2[_0xaa72('0x33')][_0xaa72('0x3f')]){_0x585cb5['where']=_[_0xaa72('0x40')](_0x585cb5['where'],{'$or':_[_0xaa72('0x2f')](_0x585cb5['attributes'],function(_0x24ba48){var _0x2524f0={};_0x2524f0[_0x24ba48]={'$like':'%'+_0x286ef2[_0xaa72('0x33')]['filter']+'%'};return _0x2524f0;})});}_0x585cb5=_[_0xaa72('0x40')]({},_0x585cb5,_0x286ef2[_0xaa72('0x49')]);return db['UserMailQueue'][_0xaa72('0x44')](_0x585cb5);}})['then'](function(_0x583ca3){if(_0x583ca3){return db[_0xaa72('0x5b')]['findAndCountAll']({'where':{'id':_[_0xaa72('0x2f')](_0x583ca3,_0xaa72('0x5c')),'role':'agent'},'attributes':['id',_0xaa72('0x2d'),_0xaa72('0x5d'),'updatedAt','createdAt']});}})[_0xaa72('0x28')](function(_0x5ece51){if(_0x5ece51){return{'count':_0x5ece51[_0xaa72('0x22')],'rows':_[_0xaa72('0x2f')](_0x5ece51[_0xaa72('0x45')],function(_0x1db21d){return{'membername':_0x1db21d[_0xaa72('0x2d')],'UserId':_0x1db21d['id'],'queue_name':_0x1d6b5b[_0xaa72('0x2d')],'MailQueueId':_0x1d6b5b['id'],'interface':util[_0xaa72('0x5e')](_0xaa72('0x5f'),_0xaa72('0x60'),_0x1db21d['name']),'penalty':0x0,'paused':_0x1db21d[_0xaa72('0x5d')],'createdAt':_0x1db21d[_0xaa72('0x61')],'updatedAt':_0x1db21d[_0xaa72('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x333957,_0x585cb5))['catch'](handleError(_0x333957,null));};exports[_0xaa72('0x63')]=function(_0x1f1218,_0x258a19,_0x2fed32){var _0x3b5b9a={};var _0xbb99bd={};var _0x3252e3;var _0x1f0d4d;return db[_0xaa72('0x41')][_0xaa72('0x57')]({'where':{'id':_0x1f1218[_0xaa72('0x47')]['id']}})[_0xaa72('0x28')](handleEntityNotFound(_0x258a19,null))[_0xaa72('0x28')](function(_0x4d50a3){if(_0x4d50a3){_0x3252e3=_0x4d50a3;_0xbb99bd[_0xaa72('0x32')]=_[_0xaa72('0x34')](db[_0xaa72('0x64')][_0xaa72('0x48')]);_0xbb99bd[_0xaa72('0x33')]=_[_0xaa72('0x34')](_0x1f1218[_0xaa72('0x33')]);_0xbb99bd[_0xaa72('0x3d')]=_[_0xaa72('0x35')](_0xbb99bd[_0xaa72('0x32')],_0xbb99bd['query']);_0x3b5b9a['attributes']=_[_0xaa72('0x35')](_0xbb99bd[_0xaa72('0x32')],qs[_0xaa72('0x37')](_0x1f1218[_0xaa72('0x33')][_0xaa72('0x37')]));_0x3b5b9a[_0xaa72('0x36')]=_0x3b5b9a[_0xaa72('0x36')]['length']?_0x3b5b9a[_0xaa72('0x36')]:_0xbb99bd['model'];_0x3b5b9a[_0xaa72('0x3a')]=qs['sort'](_0x1f1218[_0xaa72('0x33')]['sort']);_0x3b5b9a[_0xaa72('0x3c')]=qs[_0xaa72('0x3d')](_[_0xaa72('0x3e')](_0x1f1218['query'],_0xbb99bd['filters']));if(_0x1f1218[_0xaa72('0x33')][_0xaa72('0x3f')]){_0x3b5b9a[_0xaa72('0x3c')]=_['merge'](_0x3b5b9a[_0xaa72('0x3c')],{'$or':_[_0xaa72('0x2f')](_0x3b5b9a[_0xaa72('0x36')],function(_0xa94063){var _0x1ace1d={};_0x1ace1d[_0xa94063]={'$like':'%'+_0x1f1218[_0xaa72('0x33')][_0xaa72('0x3f')]+'%'};return _0x1ace1d;})});}_0x3b5b9a=_[_0xaa72('0x40')]({},_0x3b5b9a,_0x1f1218['options']);return _0x3252e3[_0xaa72('0x63')](_0x3b5b9a);}})[_0xaa72('0x28')](function(_0x3fd508){if(_0x3fd508){_0x1f0d4d=_0x3fd508[_0xaa72('0x38')];if(!_0x1f1218['query']['hasOwnProperty'](_0xaa72('0x59'))){_0x3b5b9a[_0xaa72('0x24')]=qs['limit'](_0x1f1218['query'][_0xaa72('0x24')]);_0x3b5b9a['offset']=qs[_0xaa72('0x23')](_0x1f1218[_0xaa72('0x33')]['offset']);}return _0x3252e3[_0xaa72('0x63')](_0x3b5b9a);}})[_0xaa72('0x28')](function(_0x218eb9){if(_0x218eb9){return _0x218eb9?{'count':_0x1f0d4d,'rows':_0x218eb9}:null;}})[_0xaa72('0x28')](respondWithResult(_0x258a19,null))['catch'](handleError(_0x258a19,null));};exports[_0xaa72('0x65')]=function(_0x3e0092,_0x4b3bd0,_0x16e5c1){var _0x4a0575=_0x3e0092[_0xaa72('0x4d')][_0xaa72('0x66')];return db[_0xaa72('0x64')][_0xaa72('0x44')]({'where':{'id':_0x4a0575},'attributes':['id'],'include':[{'model':db['User'],'as':_0xaa72('0x67'),'attributes':['id',_0xaa72('0x2d'),_0xaa72('0x68'),'voicePause',_0xaa72('0x69')],'raw':!![]}]})[_0xaa72('0x28')](function(_0x178d93){if(_0x178d93){var _0x5015c6=_[_0xaa72('0x6a')](_0x178d93,function(_0x3ba9f8){var _0x24c84d=_0x3ba9f8[_0xaa72('0x29')]({'plain':!![]});return _0x24c84d['Agents'];});return db[_0xaa72('0x41')]['find']({'where':{'id':_0x3e0092['params']['id']}})[_0xaa72('0x28')](function(_0x4b0075){return db[_0xaa72('0x6b')][_0xaa72('0x6c')](function(_0x3bda21){return _0x4b0075[_0xaa72('0x65')](_0x4a0575,{'transaction':_0x3bda21})[_0xaa72('0x28')](function(){return BPromise['each'](_0x5015c6,function(_0x319d60){return db[_0xaa72('0x58')][_0xaa72('0x6d')]({'where':{'UserId':_0x319d60['id'],'MailQueueId':_0x3e0092[_0xaa72('0x47')]['id']},'transaction':_0x3bda21});});})[_0xaa72('0x28')](function(){_0x5015c6[_0xaa72('0x6e')](function(_0x55a827){socket['emit']('userMailQueue:save',{'UserId':_0x55a827['id'],'MailQueueId':_0x4b0075['id']});});});});});}})[_0xaa72('0x28')](respondWithStatusCode(_0x4b3bd0,null))[_0xaa72('0x4b')](handleError(_0x4b3bd0,null));};exports['removeTeams']=function(_0x4dc928,_0x31656d,_0x254735){return db[_0xaa72('0x64')][_0xaa72('0x44')]({'where':{'id':_0x4dc928[_0xaa72('0x33')][_0xaa72('0x66')]},'attributes':['id'],'include':[{'model':db[_0xaa72('0x5b')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xaa72('0x28')](handleEntityNotFound(_0x31656d,null))[_0xaa72('0x28')](function(_0x3678a2){var _0x22ccc6=_['map'](_0x3678a2,'id');var _0x3ae588=[];var _0x35c6ec=[];var _0x56f201=squel[_0xaa72('0x6f')]();_0x56f201[_0xaa72('0x70')]('tq.TeamId')['from'](_0xaa72('0x71'),'tq')['join'](_0xaa72('0x72'),'ut',_0xaa72('0x73'))[_0xaa72('0x3c')]('MailQueueId\x20=\x20?',_0x4dc928[_0xaa72('0x47')]['id']);for(var _0x5291f4=0x0;_0x5291f4<_0x3678a2[_0xaa72('0x38')];_0x5291f4+=0x1){let _0x33cda4=_0x3678a2[_0x5291f4];for(var _0x36d203=0x0;_0x36d203<_0x33cda4['Agents'][_0xaa72('0x38')];_0x36d203+=0x1){let _0x366946=_0x33cda4[_0xaa72('0x67')][_0x36d203];var _0x19da50=_0x56f201['clone']();_0x19da50[_0xaa72('0x3c')](_0xaa72('0x74'),_0x366946['id']);_0x35c6ec[_0xaa72('0x75')](db[_0xaa72('0x6b')][_0xaa72('0x33')](_0x19da50[_0xaa72('0x76')](),{'type':db[_0xaa72('0x6b')][_0xaa72('0x77')][_0xaa72('0x78')]})[_0xaa72('0x28')](function(_0x808236){if(_0x808236[_0xaa72('0x38')]===0x1){return _0x366946['id'];}else{var _0x78d170=_[_0xaa72('0x79')](_['map'](_0x808236,'TeamId'),function(_0x10e0f7){return _[_0xaa72('0x7a')](_0x22ccc6,_0x10e0f7);});if(_0x78d170){return _0x366946['id'];}}}));}}return BPromise[_0xaa72('0x7b')](_0x35c6ec)['then'](function(_0x95b099){_0x3ae588=_(_0x3ae588)['union'](_0x95b099)[_0xaa72('0x7c')]()[_0xaa72('0x7d')]();return db[_0xaa72('0x41')][_0xaa72('0x4a')]({'where':{'id':_0x4dc928[_0xaa72('0x47')]['id']}})['then'](function(_0x2b4b65){return db[_0xaa72('0x6b')][_0xaa72('0x6c')](function(_0x2ed3d0){return _0x2b4b65['removeTeams'](_0x4dc928[_0xaa72('0x33')][_0xaa72('0x66')],{'transaction':_0x2ed3d0})['then'](function(){if(!_[_0xaa72('0x7e')](_0x3ae588)){return _0x2b4b65['removeAgents'](_0x3ae588,{'transaction':_0x2ed3d0});}})[_0xaa72('0x28')](function(){_0x3ae588[_0xaa72('0x6e')](function(_0x22eedc){socket[_0xaa72('0x7f')]('userMailQueue:remove',{'UserId':_0x22eedc,'MailQueueId':_0x2b4b65['id']});});});});});});})[_0xaa72('0x28')](respondWithStatusCode(_0x31656d,null))[_0xaa72('0x4b')](handleError(_0x31656d,null));};exports['addAgents']=function(_0x40ada5,_0x4b4e52,_0x24de00){return db['MailQueue']['find']({'where':{'id':_0x40ada5[_0xaa72('0x47')]['id']}})[_0xaa72('0x28')](handleEntityNotFound(_0x4b4e52,null))[_0xaa72('0x28')](function(_0x459c7a){if(_0x459c7a){return _0x459c7a[_0xaa72('0x80')](_0x40ada5[_0xaa72('0x4d')][_0xaa72('0x66')],_[_0xaa72('0x81')](_0x40ada5['body'],[_0xaa72('0x66'),'id'])||{})['spread'](function(_0x505e90){for(var _0x141f46=0x0;_0x141f46<_0x40ada5[_0xaa72('0x4d')][_0xaa72('0x66')][_0xaa72('0x38')];_0x141f46+=0x1){socket[_0xaa72('0x7f')](_0xaa72('0x82'),{'UserId':_0x40ada5[_0xaa72('0x4d')][_0xaa72('0x66')][_0x141f46],'MailQueueId':_0x40ada5[_0xaa72('0x47')]['id']});}return _0x505e90;});}})[_0xaa72('0x28')](respondWithResult(_0x4b4e52,null))[_0xaa72('0x4b')](handleError(_0x4b4e52,null));};exports[_0xaa72('0x83')]=function(_0x2f46b6,_0x120eb8,_0x54f99f){return db['MailQueue'][_0xaa72('0x4a')]({'where':{'id':_0x2f46b6[_0xaa72('0x47')]['id']}})['then'](handleEntityNotFound(_0x120eb8,null))['then'](function(_0x5da316){if(_0x5da316){return _0x5da316[_0xaa72('0x83')](_0x2f46b6['query'][_0xaa72('0x66')])['then'](function(){if(_['isArray'](_0x2f46b6[_0xaa72('0x33')][_0xaa72('0x66')])){for(var _0x251769=0x0;_0x251769<_0x2f46b6[_0xaa72('0x33')][_0xaa72('0x66')][_0xaa72('0x38')];_0x251769+=0x1){socket[_0xaa72('0x7f')](_0xaa72('0x84'),{'UserId':Number(_0x2f46b6[_0xaa72('0x33')][_0xaa72('0x66')][_0x251769]),'MailQueueId':Number(_0x2f46b6['params']['id'])});}}else{socket[_0xaa72('0x7f')](_0xaa72('0x84'),{'UserId':Number(_0x2f46b6['query'][_0xaa72('0x66')]),'MailQueueId':Number(_0x2f46b6['params']['id'])});}});}})[_0xaa72('0x28')](respondWithStatusCode(_0x120eb8,null))['catch'](handleError(_0x120eb8,null));};exports[_0xaa72('0x85')]=function(_0x55c525,_0x5b4f95,_0x4f313e){var _0x15cd37={};var _0x72ae71={};var _0x3e9b87;var _0x3b2f80;return db[_0xaa72('0x41')]['findOne']({'where':{'id':_0x55c525[_0xaa72('0x47')]['id']}})[_0xaa72('0x28')](handleEntityNotFound(_0x5b4f95,null))[_0xaa72('0x28')](function(_0x218658){if(_0x218658){_0x3e9b87=_0x218658;_0x72ae71[_0xaa72('0x32')]=_[_0xaa72('0x34')](db[_0xaa72('0x5b')][_0xaa72('0x48')]);_0x72ae71[_0xaa72('0x33')]=_[_0xaa72('0x34')](_0x55c525[_0xaa72('0x33')]);_0x72ae71['filters']=_[_0xaa72('0x35')](_0x72ae71['model'],_0x72ae71[_0xaa72('0x33')]);_0x15cd37[_0xaa72('0x36')]=_['intersection'](_0x72ae71[_0xaa72('0x32')],qs[_0xaa72('0x37')](_0x55c525['query']['fields']));_0x15cd37[_0xaa72('0x36')]=_0x15cd37[_0xaa72('0x36')][_0xaa72('0x38')]?_0x15cd37[_0xaa72('0x36')]:_0x72ae71['model'];_0x15cd37[_0xaa72('0x3a')]=qs[_0xaa72('0x3b')](_0x55c525[_0xaa72('0x33')]['sort']);_0x15cd37['where']=qs[_0xaa72('0x3d')](_[_0xaa72('0x3e')](_0x55c525[_0xaa72('0x33')],_0x72ae71['filters']));if(_0x55c525[_0xaa72('0x33')][_0xaa72('0x3f')]){_0x15cd37[_0xaa72('0x3c')]=_[_0xaa72('0x40')](_0x15cd37['where'],{'$or':_[_0xaa72('0x2f')](_0x15cd37[_0xaa72('0x36')],function(_0x1c25be){var _0x27ed2a={};_0x27ed2a[_0x1c25be]={'$like':'%'+_0x55c525[_0xaa72('0x33')][_0xaa72('0x3f')]+'%'};return _0x27ed2a;})});}_0x15cd37=_['merge']({},_0x15cd37,_0x55c525['options']);return _0x3e9b87[_0xaa72('0x85')](_0x15cd37);}})[_0xaa72('0x28')](function(_0x46ef95){if(_0x46ef95){_0x3b2f80=_0x46ef95[_0xaa72('0x38')];if(!_0x55c525[_0xaa72('0x33')][_0xaa72('0x39')](_0xaa72('0x59'))){_0x15cd37['limit']=qs[_0xaa72('0x24')](_0x55c525[_0xaa72('0x33')][_0xaa72('0x24')]);_0x15cd37[_0xaa72('0x23')]=qs[_0xaa72('0x23')](_0x55c525[_0xaa72('0x33')][_0xaa72('0x23')]);}return _0x3e9b87[_0xaa72('0x85')](_0x15cd37);}})[_0xaa72('0x28')](function(_0x230f80){if(_0x230f80){return _0x230f80?{'count':_0x3b2f80,'rows':_0x230f80}:null;}})[_0xaa72('0x28')](respondWithResult(_0x5b4f95,null))[_0xaa72('0x4b')](handleError(_0x5b4f95,null));}; \ No newline at end of file +var _0x4050=['json','count','offset','apply','reject','save','update','then','destroy','get','MailQueues','UserProfileResource','error','stack','name','send','map','MailQueue','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','rawAttributes','length','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','params','describe','findOne','UserMailQueue','User','findAndCountAll','UserId','agent','mailPause','updatedAt','createdAt','getTeams','addTeams','ids','Team','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','emit','userMailQueue:save','select','tq.TeamId','team_has_mail_queues','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','all','union','compact','removeTeams','isEmpty','removeAgents','userMailQueue:remove','addAgents','omit','isArray','getAgents','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','end'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x4050,0x67));var _0x0405=function(_0x424501,_0x42096d){_0x424501=_0x424501-0x0;var _0xb719af=_0x4050[_0x424501];return _0xb719af;};'use strict';var pdf=require(_0x0405('0x0'));var emlformat=require(_0x0405('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x0405('0x2'));var jsonpatch=require(_0x0405('0x3'));var rp=require('request-promise');var moment=require(_0x0405('0x4'));var BPromise=require(_0x0405('0x5'));var Mustache=require(_0x0405('0x6'));var util=require(_0x0405('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x0405('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x0405('0x9'));var squel=require(_0x0405('0xa'));var crypto=require('crypto');var jsforce=require(_0x0405('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0405('0xc'));var Papa=require(_0x0405('0xd'));var Redis=require(_0x0405('0xe'));var authService=require(_0x0405('0xf'));var qs=require(_0x0405('0x10'));var as=require(_0x0405('0x11'));var hardwareService=require(_0x0405('0x12'));var logger=require('../../config/logger')(_0x0405('0x13'));var utils=require(_0x0405('0x14'));var config=require(_0x0405('0x15'));var db=require(_0x0405('0x16'))['db'];config['redis']=_[_0x0405('0x17')](config[_0x0405('0x18')],{'host':_0x0405('0x19'),'port':0x18eb});var socket=require(_0x0405('0x1a'))(new Redis(config['redis']));require(_0x0405('0x1b'))[_0x0405('0x1c')](socket);function respondWithStatusCode(_0x571264,_0x2c203d){_0x2c203d=_0x2c203d||0xcc;return function(_0x16f215){if(_0x16f215){return _0x571264[_0x0405('0x1d')](_0x2c203d);}return _0x571264[_0x0405('0x1e')](_0x2c203d)[_0x0405('0x1f')]();};}function respondWithResult(_0x2dd417,_0x547075){_0x547075=_0x547075||0xc8;return function(_0x55c88c){if(_0x55c88c){return _0x2dd417[_0x0405('0x1e')](_0x547075)[_0x0405('0x20')](_0x55c88c);}};}function respondWithFilteredResult(_0xaf89ea,_0x445274){return function(_0x532338){if(_0x532338){var _0x323946=_0x532338[_0x0405('0x21')],_0x17ee04=_0x445274[_0x0405('0x22')],_0x5032bc=_0x445274[_0x0405('0x22')]+_0x445274['limit'],_0xbd5acf;if(_0x5032bc>=_0x323946){_0x5032bc=_0x323946;_0xbd5acf=0xc8;}else{_0xbd5acf=0xce;}_0xaf89ea['status'](_0xbd5acf);return _0xaf89ea['set']('Content-Range',_0x17ee04+'-'+_0x5032bc+'/'+_0x323946)['json'](_0x532338);}return null;};}function patchUpdates(_0x53684b){return function(_0x435c7d){try{jsonpatch[_0x0405('0x23')](_0x435c7d,_0x53684b,!![]);}catch(_0x4970e2){return BPromise[_0x0405('0x24')](_0x4970e2);}return _0x435c7d[_0x0405('0x25')]();};}function saveUpdates(_0xfeed94,_0x542634){return function(_0x32b48e){if(_0x32b48e){return _0x32b48e[_0x0405('0x26')](_0xfeed94)[_0x0405('0x27')](function(_0x5c0066){return _0x5c0066;});}return null;};}function removeEntity(_0x42fb1e,_0x4a9f13){return function(_0x1dcd02){if(_0x1dcd02){return _0x1dcd02[_0x0405('0x28')]()[_0x0405('0x27')](function(){var _0x2b0690=_0x1dcd02[_0x0405('0x29')]({'plain':!![]});var _0x24d893=_0x0405('0x2a');return db[_0x0405('0x2b')]['destroy']({'where':{'type':_0x24d893,'resourceId':_0x2b0690['id']}})[_0x0405('0x27')](function(){return _0x1dcd02;});})['then'](function(){_0x42fb1e[_0x0405('0x1e')](0xcc)[_0x0405('0x1f')]();});}};}function handleEntityNotFound(_0x2c6c08,_0x4b4957){return function(_0x15da83){if(!_0x15da83){_0x2c6c08[_0x0405('0x1d')](0x194);}return _0x15da83;};}function handleError(_0x5e5b8b,_0x3fd44c){_0x3fd44c=_0x3fd44c||0x1f4;return function(_0x158b4d){logger[_0x0405('0x2c')](_0x158b4d[_0x0405('0x2d')]);if(_0x158b4d[_0x0405('0x2e')]){delete _0x158b4d[_0x0405('0x2e')];}_0x5e5b8b[_0x0405('0x1e')](_0x3fd44c)[_0x0405('0x2f')](_0x158b4d);};}exports['index']=function(_0x5d331f,_0xe39d1b){var _0x2962b6={},_0x37a265={},_0x32f429={'count':0x0,'rows':[]};var _0x3bab4a=_[_0x0405('0x30')](db[_0x0405('0x31')]['rawAttributes'],function(_0x54e3b4){return{'name':_0x54e3b4[_0x0405('0x32')],'type':_0x54e3b4[_0x0405('0x33')][_0x0405('0x34')]};});_0x37a265[_0x0405('0x35')]=_['map'](_0x3bab4a,_0x0405('0x2e'));_0x37a265[_0x0405('0x36')]=_[_0x0405('0x37')](_0x5d331f['query']);_0x37a265[_0x0405('0x38')]=_[_0x0405('0x39')](_0x37a265[_0x0405('0x35')],_0x37a265[_0x0405('0x36')]);_0x2962b6[_0x0405('0x3a')]=_[_0x0405('0x39')](_0x37a265[_0x0405('0x35')],qs[_0x0405('0x3b')](_0x5d331f[_0x0405('0x36')][_0x0405('0x3b')]));_0x2962b6[_0x0405('0x3a')]=_0x2962b6[_0x0405('0x3a')]['length']?_0x2962b6[_0x0405('0x3a')]:_0x37a265[_0x0405('0x35')];if(!_0x5d331f[_0x0405('0x36')][_0x0405('0x3c')](_0x0405('0x3d'))){_0x2962b6[_0x0405('0x3e')]=qs[_0x0405('0x3e')](_0x5d331f[_0x0405('0x36')][_0x0405('0x3e')]);_0x2962b6[_0x0405('0x22')]=qs[_0x0405('0x22')](_0x5d331f['query'][_0x0405('0x22')]);}_0x2962b6[_0x0405('0x3f')]=qs[_0x0405('0x40')](_0x5d331f[_0x0405('0x36')][_0x0405('0x40')]);_0x2962b6[_0x0405('0x41')]=qs[_0x0405('0x38')](_[_0x0405('0x42')](_0x5d331f[_0x0405('0x36')],_0x37a265['filters']));if(_0x5d331f['query'][_0x0405('0x43')]){_0x2962b6[_0x0405('0x41')]=_[_0x0405('0x44')](_0x2962b6['where'],{'$or':_[_0x0405('0x30')](_0x3bab4a,function(_0x41937a){if(_0x41937a[_0x0405('0x33')]!==_0x0405('0x45')){var _0x2cd4ae={};_0x2cd4ae[_0x41937a[_0x0405('0x2e')]]={'$like':'%'+_0x5d331f[_0x0405('0x36')][_0x0405('0x43')]+'%'};return _0x2cd4ae;}})});}_0x2962b6=_['merge']({},_0x2962b6,_0x5d331f[_0x0405('0x46')]);var _0xc2bd17={'where':_0x2962b6[_0x0405('0x41')]};return db[_0x0405('0x31')]['count'](_0xc2bd17)[_0x0405('0x27')](function(_0x9b0aa3){_0x32f429['count']=_0x9b0aa3;if(_0x5d331f[_0x0405('0x36')]['includeAll']){_0x2962b6[_0x0405('0x47')]=[{'all':!![]}];}return db[_0x0405('0x31')][_0x0405('0x48')](_0x2962b6);})['then'](function(_0x14b58f){_0x32f429[_0x0405('0x49')]=_0x14b58f;return _0x32f429;})['then'](respondWithFilteredResult(_0xe39d1b,_0x2962b6))[_0x0405('0x4a')](handleError(_0xe39d1b,null));};exports[_0x0405('0x4b')]=function(_0x74234b,_0x26062b){var _0x520f64={'raw':!![],'where':{'id':_0x74234b['params']['id']}},_0x23e430={};_0x23e430[_0x0405('0x35')]=_[_0x0405('0x37')](db[_0x0405('0x31')][_0x0405('0x4c')]);_0x23e430['query']=_[_0x0405('0x37')](_0x74234b[_0x0405('0x36')]);_0x23e430[_0x0405('0x38')]=_['intersection'](_0x23e430[_0x0405('0x35')],_0x23e430[_0x0405('0x36')]);_0x520f64[_0x0405('0x3a')]=_[_0x0405('0x39')](_0x23e430[_0x0405('0x35')],qs[_0x0405('0x3b')](_0x74234b[_0x0405('0x36')][_0x0405('0x3b')]));_0x520f64[_0x0405('0x3a')]=_0x520f64[_0x0405('0x3a')][_0x0405('0x4d')]?_0x520f64[_0x0405('0x3a')]:_0x23e430[_0x0405('0x35')];if(_0x74234b[_0x0405('0x36')][_0x0405('0x4e')]){_0x520f64[_0x0405('0x47')]=[{'all':!![]}];}_0x520f64=_['merge']({},_0x520f64,_0x74234b[_0x0405('0x46')]);return db['MailQueue'][_0x0405('0x4f')](_0x520f64)['then'](handleEntityNotFound(_0x26062b,null))[_0x0405('0x27')](respondWithResult(_0x26062b,null))[_0x0405('0x4a')](handleError(_0x26062b,null));};exports[_0x0405('0x50')]=function(_0x4386a2,_0x30446f){return db[_0x0405('0x31')]['create'](_0x4386a2[_0x0405('0x51')],{})[_0x0405('0x27')](function(_0x147c68){var _0x2b3cc9=_0x4386a2[_0x0405('0x52')][_0x0405('0x29')]({'plain':!![]});if(!_0x2b3cc9)throw new Error(_0x0405('0x53'));if(_0x2b3cc9[_0x0405('0x54')]===_0x0405('0x52')){var _0x4ff9e5=_0x147c68[_0x0405('0x29')]({'plain':!![]});var _0x58e276='MailQueues';return db[_0x0405('0x55')]['find']({'where':{'name':_0x58e276,'userProfileId':_0x2b3cc9[_0x0405('0x56')]},'raw':!![]})[_0x0405('0x27')](function(_0x12580f){if(_0x12580f&&_0x12580f[_0x0405('0x57')]===0x0){return db[_0x0405('0x2b')]['create']({'name':_0x4ff9e5[_0x0405('0x2e')],'resourceId':_0x4ff9e5['id'],'type':_0x12580f[_0x0405('0x2e')],'sectionId':_0x12580f['id']},{})[_0x0405('0x27')](function(){return _0x147c68;});}else{return _0x147c68;}})['catch'](function(_0x512d76){logger[_0x0405('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x512d76);throw _0x512d76;});}return _0x147c68;})[_0x0405('0x27')](respondWithResult(_0x30446f,0xc9))[_0x0405('0x4a')](handleError(_0x30446f,null));};exports['update']=function(_0x48ae4a,_0x5ebe91){if(_0x48ae4a[_0x0405('0x51')]['id']){delete _0x48ae4a[_0x0405('0x51')]['id'];}return db['MailQueue'][_0x0405('0x4f')]({'where':{'id':_0x48ae4a[_0x0405('0x58')]['id']}})[_0x0405('0x27')](handleEntityNotFound(_0x5ebe91,null))[_0x0405('0x27')](saveUpdates(_0x48ae4a['body'],null))[_0x0405('0x27')](respondWithResult(_0x5ebe91,null))['catch'](handleError(_0x5ebe91,null));};exports[_0x0405('0x28')]=function(_0x111bcb,_0x19fc18){return db[_0x0405('0x31')]['find']({'where':{'id':_0x111bcb[_0x0405('0x58')]['id']}})['then'](handleEntityNotFound(_0x19fc18,null))[_0x0405('0x27')](removeEntity(_0x19fc18,null))['catch'](handleError(_0x19fc18,null));};exports['describe']=function(_0x2421f1,_0xfa4a8f){return db['MailQueue'][_0x0405('0x59')]()[_0x0405('0x27')](respondWithResult(_0xfa4a8f,null))[_0x0405('0x4a')](handleError(_0xfa4a8f,null));};exports['getMembers']=function(_0x111210,_0x3e3163,_0x11b386){var _0x170ff2={'raw':!![],'where':{}},_0x385a8d={},_0x511554;return db[_0x0405('0x31')][_0x0405('0x5a')]({'where':{'id':_0x111210['params']['id']}})[_0x0405('0x27')](handleEntityNotFound(_0x3e3163,null))[_0x0405('0x27')](function(_0x13f57f){if(_0x13f57f){_0x511554=_0x13f57f['get']({'plain':!![]});_0x385a8d[_0x0405('0x35')]=_[_0x0405('0x37')](db[_0x0405('0x5b')]['rawAttributes']);_0x385a8d[_0x0405('0x36')]=_['keys'](_0x111210[_0x0405('0x36')]);_0x385a8d[_0x0405('0x38')]=_[_0x0405('0x39')](_0x385a8d[_0x0405('0x35')],_0x385a8d[_0x0405('0x36')]);_0x170ff2[_0x0405('0x3a')]=_['intersection'](_0x385a8d['model'],qs['fields'](_0x111210[_0x0405('0x36')]['fields']));_0x170ff2[_0x0405('0x3a')]=_0x170ff2[_0x0405('0x3a')]['length']?_0x170ff2[_0x0405('0x3a')]:_0x385a8d[_0x0405('0x35')];if(!_0x111210[_0x0405('0x36')][_0x0405('0x3c')](_0x0405('0x3d'))){_0x170ff2[_0x0405('0x3e')]=qs['limit'](_0x111210[_0x0405('0x36')][_0x0405('0x3e')]);_0x170ff2[_0x0405('0x22')]=qs['offset'](_0x111210['query'][_0x0405('0x22')]);}_0x170ff2[_0x0405('0x3f')]=qs[_0x0405('0x40')](_0x111210['query'][_0x0405('0x40')]);_0x170ff2[_0x0405('0x41')]=qs[_0x0405('0x38')](_[_0x0405('0x42')](_0x111210['query'],_0x385a8d[_0x0405('0x38')]));_0x170ff2[_0x0405('0x41')]['MailQueueId']=_0x13f57f['id'];if(_0x111210[_0x0405('0x36')][_0x0405('0x43')]){_0x170ff2[_0x0405('0x41')]=_[_0x0405('0x44')](_0x170ff2[_0x0405('0x41')],{'$or':_[_0x0405('0x30')](_0x170ff2[_0x0405('0x3a')],function(_0x46c219){var _0x1b8d4c={};_0x1b8d4c[_0x46c219]={'$like':'%'+_0x111210[_0x0405('0x36')][_0x0405('0x43')]+'%'};return _0x1b8d4c;})});}_0x170ff2=_[_0x0405('0x44')]({},_0x170ff2,_0x111210['options']);return db[_0x0405('0x5b')][_0x0405('0x48')](_0x170ff2);}})[_0x0405('0x27')](function(_0x5a9a5){if(_0x5a9a5){return db[_0x0405('0x5c')][_0x0405('0x5d')]({'where':{'id':_[_0x0405('0x30')](_0x5a9a5,_0x0405('0x5e')),'role':_0x0405('0x5f')},'attributes':['id',_0x0405('0x2e'),_0x0405('0x60'),_0x0405('0x61'),'createdAt']});}})[_0x0405('0x27')](function(_0xc69c7b){if(_0xc69c7b){return{'count':_0xc69c7b[_0x0405('0x21')],'rows':_[_0x0405('0x30')](_0xc69c7b[_0x0405('0x49')],function(_0x28c4b8){return{'membername':_0x28c4b8[_0x0405('0x2e')],'UserId':_0x28c4b8['id'],'queue_name':_0x511554[_0x0405('0x2e')],'MailQueueId':_0x511554['id'],'interface':util['format']('%s/%s','SIP',_0x28c4b8[_0x0405('0x2e')]),'penalty':0x0,'paused':_0x28c4b8[_0x0405('0x60')],'createdAt':_0x28c4b8[_0x0405('0x62')],'updatedAt':_0x28c4b8[_0x0405('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x0405('0x27')](respondWithFilteredResult(_0x3e3163,_0x170ff2))[_0x0405('0x4a')](handleError(_0x3e3163,null));};exports[_0x0405('0x63')]=function(_0x2f29b8,_0xec5e87,_0x31268b){var _0x16dc24={};var _0x53c924={};var _0x5206eb;var _0x5ae76f;return db[_0x0405('0x31')][_0x0405('0x5a')]({'where':{'id':_0x2f29b8[_0x0405('0x58')]['id']}})['then'](handleEntityNotFound(_0xec5e87,null))[_0x0405('0x27')](function(_0x16c521){if(_0x16c521){_0x5206eb=_0x16c521;_0x53c924[_0x0405('0x35')]=_[_0x0405('0x37')](db['Team']['rawAttributes']);_0x53c924[_0x0405('0x36')]=_[_0x0405('0x37')](_0x2f29b8[_0x0405('0x36')]);_0x53c924[_0x0405('0x38')]=_[_0x0405('0x39')](_0x53c924[_0x0405('0x35')],_0x53c924['query']);_0x16dc24[_0x0405('0x3a')]=_[_0x0405('0x39')](_0x53c924[_0x0405('0x35')],qs[_0x0405('0x3b')](_0x2f29b8[_0x0405('0x36')][_0x0405('0x3b')]));_0x16dc24[_0x0405('0x3a')]=_0x16dc24[_0x0405('0x3a')][_0x0405('0x4d')]?_0x16dc24[_0x0405('0x3a')]:_0x53c924[_0x0405('0x35')];_0x16dc24[_0x0405('0x3f')]=qs[_0x0405('0x40')](_0x2f29b8[_0x0405('0x36')][_0x0405('0x40')]);_0x16dc24[_0x0405('0x41')]=qs[_0x0405('0x38')](_['pick'](_0x2f29b8[_0x0405('0x36')],_0x53c924[_0x0405('0x38')]));if(_0x2f29b8[_0x0405('0x36')][_0x0405('0x43')]){_0x16dc24[_0x0405('0x41')]=_['merge'](_0x16dc24['where'],{'$or':_[_0x0405('0x30')](_0x16dc24[_0x0405('0x3a')],function(_0x46481c){var _0x420555={};_0x420555[_0x46481c]={'$like':'%'+_0x2f29b8[_0x0405('0x36')]['filter']+'%'};return _0x420555;})});}_0x16dc24=_['merge']({},_0x16dc24,_0x2f29b8['options']);return _0x5206eb[_0x0405('0x63')](_0x16dc24);}})[_0x0405('0x27')](function(_0x2199cf){if(_0x2199cf){_0x5ae76f=_0x2199cf[_0x0405('0x4d')];if(!_0x2f29b8[_0x0405('0x36')]['hasOwnProperty'](_0x0405('0x3d'))){_0x16dc24[_0x0405('0x3e')]=qs[_0x0405('0x3e')](_0x2f29b8[_0x0405('0x36')][_0x0405('0x3e')]);_0x16dc24['offset']=qs[_0x0405('0x22')](_0x2f29b8[_0x0405('0x36')][_0x0405('0x22')]);}return _0x5206eb['getTeams'](_0x16dc24);}})['then'](function(_0x4e44a7){if(_0x4e44a7){return _0x4e44a7?{'count':_0x5ae76f,'rows':_0x4e44a7}:null;}})[_0x0405('0x27')](respondWithResult(_0xec5e87,null))[_0x0405('0x4a')](handleError(_0xec5e87,null));};exports[_0x0405('0x64')]=function(_0x6aa1c3,_0xdfdd06,_0x27eb24){var _0xfba223=_0x6aa1c3[_0x0405('0x51')][_0x0405('0x65')];return db[_0x0405('0x66')][_0x0405('0x48')]({'where':{'id':_0xfba223},'attributes':['id'],'include':[{'model':db['User'],'as':_0x0405('0x67'),'attributes':['id','name',_0x0405('0x68'),_0x0405('0x69'),_0x0405('0x6a')],'raw':!![]}]})[_0x0405('0x27')](function(_0x458c4b){if(_0x458c4b){var _0x48f8fe=_[_0x0405('0x6b')](_0x458c4b,function(_0x441540){var _0x51331c=_0x441540[_0x0405('0x29')]({'plain':!![]});return _0x51331c['Agents'];});return db[_0x0405('0x31')][_0x0405('0x4f')]({'where':{'id':_0x6aa1c3[_0x0405('0x58')]['id']}})[_0x0405('0x27')](function(_0x45bfcb){return db[_0x0405('0x6c')][_0x0405('0x6d')](function(_0x54c398){return _0x45bfcb['addTeams'](_0xfba223,{'transaction':_0x54c398})[_0x0405('0x27')](function(){return BPromise[_0x0405('0x6e')](_0x48f8fe,function(_0x3983c7){return db[_0x0405('0x5b')][_0x0405('0x6f')]({'where':{'UserId':_0x3983c7['id'],'MailQueueId':_0x6aa1c3[_0x0405('0x58')]['id']},'transaction':_0x54c398});});})[_0x0405('0x27')](function(){_0x48f8fe['forEach'](function(_0x5f30ff){socket[_0x0405('0x70')](_0x0405('0x71'),{'UserId':_0x5f30ff['id'],'MailQueueId':_0x45bfcb['id']});});});});});}})[_0x0405('0x27')](respondWithStatusCode(_0xdfdd06,null))[_0x0405('0x4a')](handleError(_0xdfdd06,null));};exports['removeTeams']=function(_0x27415d,_0x53ba71,_0x3c07cc){return db['Team'][_0x0405('0x48')]({'where':{'id':_0x27415d['query'][_0x0405('0x65')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x0405('0x67'),'attributes':['id'],'raw':!![]}]})[_0x0405('0x27')](handleEntityNotFound(_0x53ba71,null))['then'](function(_0x47d013){var _0x199c82=_[_0x0405('0x30')](_0x47d013,'id');var _0xa6caa8=[];var _0x4b04d9=[];var _0x42ee51=squel[_0x0405('0x72')]();_0x42ee51['field'](_0x0405('0x73'))['from'](_0x0405('0x74'),'tq')['join']('user_has_teams','ut',_0x0405('0x75'))['where']('MailQueueId\x20=\x20?',_0x27415d[_0x0405('0x58')]['id']);for(var _0x280e83=0x0;_0x280e83<_0x47d013[_0x0405('0x4d')];_0x280e83+=0x1){let _0x1a76d2=_0x47d013[_0x280e83];for(var _0x7dd5a4=0x0;_0x7dd5a4<_0x1a76d2['Agents'][_0x0405('0x4d')];_0x7dd5a4+=0x1){let _0x1624c2=_0x1a76d2[_0x0405('0x67')][_0x7dd5a4];var _0x53244d=_0x42ee51[_0x0405('0x76')]();_0x53244d['where'](_0x0405('0x77'),_0x1624c2['id']);_0x4b04d9[_0x0405('0x78')](db[_0x0405('0x6c')]['query'](_0x53244d[_0x0405('0x79')](),{'type':db[_0x0405('0x6c')][_0x0405('0x7a')][_0x0405('0x7b')]})['then'](function(_0x52a3ad){if(_0x52a3ad[_0x0405('0x4d')]===0x1){return _0x1624c2['id'];}else{var _0x430a1f=_['every'](_['map'](_0x52a3ad,'TeamId'),function(_0x39e97f){return _['includes'](_0x199c82,_0x39e97f);});if(_0x430a1f){return _0x1624c2['id'];}}}));}}return BPromise[_0x0405('0x7c')](_0x4b04d9)['then'](function(_0x1537f5){_0xa6caa8=_(_0xa6caa8)[_0x0405('0x7d')](_0x1537f5)[_0x0405('0x7e')]()['value']();return db['MailQueue']['find']({'where':{'id':_0x27415d[_0x0405('0x58')]['id']}})[_0x0405('0x27')](function(_0x4781ac){return db[_0x0405('0x6c')][_0x0405('0x6d')](function(_0x4a99ee){return _0x4781ac[_0x0405('0x7f')](_0x27415d[_0x0405('0x36')][_0x0405('0x65')],{'transaction':_0x4a99ee})[_0x0405('0x27')](function(){if(!_[_0x0405('0x80')](_0xa6caa8)){return _0x4781ac[_0x0405('0x81')](_0xa6caa8,{'transaction':_0x4a99ee});}})[_0x0405('0x27')](function(){_0xa6caa8['forEach'](function(_0x369997){socket['emit'](_0x0405('0x82'),{'UserId':_0x369997,'MailQueueId':_0x4781ac['id']});});});});});});})[_0x0405('0x27')](respondWithStatusCode(_0x53ba71,null))['catch'](handleError(_0x53ba71,null));};exports[_0x0405('0x83')]=function(_0x5b06a2,_0x167bab,_0x15c870){return db[_0x0405('0x31')][_0x0405('0x4f')]({'where':{'id':_0x5b06a2[_0x0405('0x58')]['id']}})[_0x0405('0x27')](handleEntityNotFound(_0x167bab,null))[_0x0405('0x27')](function(_0x34ab33){if(_0x34ab33){return _0x34ab33[_0x0405('0x83')](_0x5b06a2['body'][_0x0405('0x65')],_[_0x0405('0x84')](_0x5b06a2[_0x0405('0x51')],[_0x0405('0x65'),'id'])||{})['spread'](function(_0x14684a){for(var _0x45bca4=0x0;_0x45bca4<_0x5b06a2['body'][_0x0405('0x65')][_0x0405('0x4d')];_0x45bca4+=0x1){socket[_0x0405('0x70')](_0x0405('0x71'),{'UserId':_0x5b06a2[_0x0405('0x51')][_0x0405('0x65')][_0x45bca4],'MailQueueId':_0x5b06a2[_0x0405('0x58')]['id']});}return _0x14684a;});}})[_0x0405('0x27')](respondWithResult(_0x167bab,null))[_0x0405('0x4a')](handleError(_0x167bab,null));};exports[_0x0405('0x81')]=function(_0x18408f,_0x5255ca,_0x1b59f8){return db[_0x0405('0x31')]['find']({'where':{'id':_0x18408f[_0x0405('0x58')]['id']}})[_0x0405('0x27')](handleEntityNotFound(_0x5255ca,null))[_0x0405('0x27')](function(_0x2d6b4b){if(_0x2d6b4b){return _0x2d6b4b[_0x0405('0x81')](_0x18408f[_0x0405('0x36')]['ids'])[_0x0405('0x27')](function(){if(_[_0x0405('0x85')](_0x18408f[_0x0405('0x36')][_0x0405('0x65')])){for(var _0x35bded=0x0;_0x35bded<_0x18408f[_0x0405('0x36')]['ids']['length'];_0x35bded+=0x1){socket[_0x0405('0x70')]('userMailQueue:remove',{'UserId':Number(_0x18408f[_0x0405('0x36')][_0x0405('0x65')][_0x35bded]),'MailQueueId':Number(_0x18408f[_0x0405('0x58')]['id'])});}}else{socket[_0x0405('0x70')](_0x0405('0x82'),{'UserId':Number(_0x18408f[_0x0405('0x36')][_0x0405('0x65')]),'MailQueueId':Number(_0x18408f['params']['id'])});}});}})[_0x0405('0x27')](respondWithStatusCode(_0x5255ca,null))[_0x0405('0x4a')](handleError(_0x5255ca,null));};exports[_0x0405('0x86')]=function(_0x22fb97,_0x33b46e,_0x4e48b4){var _0x28590e={};var _0x426ea7={};var _0x5e6b44;var _0x3cc3b9;return db[_0x0405('0x31')]['findOne']({'where':{'id':_0x22fb97[_0x0405('0x58')]['id']}})[_0x0405('0x27')](handleEntityNotFound(_0x33b46e,null))[_0x0405('0x27')](function(_0x43daf2){if(_0x43daf2){_0x5e6b44=_0x43daf2;_0x426ea7[_0x0405('0x35')]=_['keys'](db[_0x0405('0x5c')][_0x0405('0x4c')]);_0x426ea7[_0x0405('0x36')]=_['keys'](_0x22fb97[_0x0405('0x36')]);_0x426ea7[_0x0405('0x38')]=_[_0x0405('0x39')](_0x426ea7[_0x0405('0x35')],_0x426ea7['query']);_0x28590e[_0x0405('0x3a')]=_[_0x0405('0x39')](_0x426ea7['model'],qs[_0x0405('0x3b')](_0x22fb97['query'][_0x0405('0x3b')]));_0x28590e[_0x0405('0x3a')]=_0x28590e[_0x0405('0x3a')][_0x0405('0x4d')]?_0x28590e[_0x0405('0x3a')]:_0x426ea7['model'];_0x28590e['order']=qs[_0x0405('0x40')](_0x22fb97[_0x0405('0x36')][_0x0405('0x40')]);_0x28590e['where']=qs['filters'](_[_0x0405('0x42')](_0x22fb97[_0x0405('0x36')],_0x426ea7[_0x0405('0x38')]));if(_0x22fb97[_0x0405('0x36')][_0x0405('0x43')]){_0x28590e[_0x0405('0x41')]=_[_0x0405('0x44')](_0x28590e['where'],{'$or':_[_0x0405('0x30')](_0x28590e[_0x0405('0x3a')],function(_0x167215){var _0x2f95cf={};_0x2f95cf[_0x167215]={'$like':'%'+_0x22fb97[_0x0405('0x36')][_0x0405('0x43')]+'%'};return _0x2f95cf;})});}_0x28590e=_[_0x0405('0x44')]({},_0x28590e,_0x22fb97[_0x0405('0x46')]);return _0x5e6b44[_0x0405('0x86')](_0x28590e);}})[_0x0405('0x27')](function(_0x467a74){if(_0x467a74){_0x3cc3b9=_0x467a74['length'];if(!_0x22fb97[_0x0405('0x36')][_0x0405('0x3c')]('nolimit')){_0x28590e[_0x0405('0x3e')]=qs[_0x0405('0x3e')](_0x22fb97['query'][_0x0405('0x3e')]);_0x28590e[_0x0405('0x22')]=qs[_0x0405('0x22')](_0x22fb97[_0x0405('0x36')][_0x0405('0x22')]);}return _0x5e6b44[_0x0405('0x86')](_0x28590e);}})[_0x0405('0x27')](function(_0x329794){if(_0x329794){return _0x329794?{'count':_0x3cc3b9,'rows':_0x329794}:null;}})[_0x0405('0x27')](respondWithResult(_0x33b46e,null))[_0x0405('0x4a')](handleError(_0x33b46e,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 3f015b7..18fa417 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 _0xdf1a=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','MailQueue','save','update'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xdf1a,0xf8));var _0xadf1=function(_0x1ac120,_0x3e7e45){_0x1ac120=_0x1ac120-0x0;var _0x19b703=_0xdf1a[_0x1ac120];return _0x19b703;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0xadf1('0x0'))['db'][_0xadf1('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xadf1('0x2'),'afterUpdate':_0xadf1('0x3'),'afterDestroy':_0xadf1('0x4')};function emitEvent(_0x12de5f){return function(_0x239335,_0x4806c1,_0x2a808f){MailQueueEvents[_0xadf1('0x5')](_0x12de5f+':'+_0x239335['id'],_0x239335);MailQueueEvents[_0xadf1('0x5')](_0x12de5f,_0x239335);_0x2a808f(null);};}for(var e in events){if(events[_0xadf1('0x6')](e)){var event=events[e];MailQueue[_0xadf1('0x7')](e,emitEvent(event));}}module[_0xadf1('0x8')]=MailQueueEvents; \ No newline at end of file +var _0x8cad=['remove','emit','hook','exports','events','../../mysqldb','MailQueue','setMaxListeners','save','update'];(function(_0x1c53bd,_0x3ea576){var _0x594282=function(_0x2a1812){while(--_0x2a1812){_0x1c53bd['push'](_0x1c53bd['shift']());}};_0x594282(++_0x3ea576);}(_0x8cad,0xb8));var _0xd8ca=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0x8cad[_0x25e7cb];return _0x375d92;};'use strict';var EventEmitter=require(_0xd8ca('0x0'));var MailQueue=require(_0xd8ca('0x1'))['db'][_0xd8ca('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xd8ca('0x3')](0x0);var events={'afterCreate':_0xd8ca('0x4'),'afterUpdate':_0xd8ca('0x5'),'afterDestroy':_0xd8ca('0x6')};function emitEvent(_0x210f6e){return function(_0x49c78e,_0x238e24,_0x2346e2){MailQueueEvents['emit'](_0x210f6e+':'+_0x49c78e['id'],_0x49c78e);MailQueueEvents[_0xd8ca('0x7')](_0x210f6e,_0x49c78e);_0x2346e2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue[_0xd8ca('0x8')](e,emitEvent(event));}}module[_0xd8ca('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 a63765a..2382ce6 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 _0xb4d4=['exports','define','MailQueue','mail_queues','lodash','util','moment','bluebird','path','rimraf','./mailQueue.attributes'];(function(_0x5e8d3e,_0x18ed2e){var _0x1348c0=function(_0x5a889f){while(--_0x5a889f){_0x5e8d3e['push'](_0x5e8d3e['shift']());}};_0x1348c0(++_0x18ed2e);}(_0xb4d4,0xf6));var _0x4b4d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb4d4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4b4d('0x0'));var util=require(_0x4b4d('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x4b4d('0x2'));var BPromise=require(_0x4b4d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4b4d('0x4'));var rimraf=require(_0x4b4d('0x5'));var config=require('../../config/environment');var attributes=require(_0x4b4d('0x6'));module[_0x4b4d('0x7')]=function(_0x2e4ef7,_0x386fcb){return _0x2e4ef7[_0x4b4d('0x8')](_0x4b4d('0x9'),attributes,{'tableName':_0x4b4d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xef18=['request-promise','path','rimraf','../../config/environment','./mailQueue.attributes','exports','mail_queues','lodash','util','../../config/logger','api','moment'];(function(_0x39c362,_0x5802fa){var _0x28ef9a=function(_0x3c40d3){while(--_0x3c40d3){_0x39c362['push'](_0x39c362['shift']());}};_0x28ef9a(++_0x5802fa);}(_0xef18,0x14b));var _0x8ef1=function(_0x2341c6,_0x3af092){_0x2341c6=_0x2341c6-0x0;var _0x54c34d=_0xef18[_0x2341c6];return _0x54c34d;};'use strict';var _=require(_0x8ef1('0x0'));var util=require(_0x8ef1('0x1'));var logger=require(_0x8ef1('0x2'))(_0x8ef1('0x3'));var moment=require(_0x8ef1('0x4'));var BPromise=require('bluebird');var rp=require(_0x8ef1('0x5'));var fs=require('fs');var path=require(_0x8ef1('0x6'));var rimraf=require(_0x8ef1('0x7'));var config=require(_0x8ef1('0x8'));var attributes=require(_0x8ef1('0x9'));module[_0x8ef1('0xa')]=function(_0x3801c9,_0x16f84e){return _0x3801c9['define']('MailQueue',attributes,{'tableName':_0x8ef1('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 ac1de81..8d6bee7 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 _0x2c34=['defaults','redis','socket.io-emitter','./mailQueue.socket','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','GetMailQueue','MailQueue','findAll','options','raw','attributes','limit','include','map','model','ShowMailQueue','find','where','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http'];(function(_0x15ceb7,_0x961934){var _0x1d9eaa=function(_0x532231){while(--_0x532231){_0x15ceb7['push'](_0x15ceb7['shift']());}};_0x1d9eaa(++_0x961934);}(_0x2c34,0xd4));var _0x42c3=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x2c34[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x42c3('0x0'));var util=require('util');var moment=require(_0x42c3('0x1'));var BPromise=require(_0x42c3('0x2'));var rs=require(_0x42c3('0x3'));var fs=require('fs');var Redis=require(_0x42c3('0x4'));var db=require(_0x42c3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x42c3('0x6'))(_0x42c3('0x7'));var config=require('../../config/environment');var jayson=require(_0x42c3('0x8'));var client=jayson['client'][_0x42c3('0x9')]({'port':0x232a});config['redis']=_[_0x42c3('0xa')](config[_0x42c3('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x42c3('0xc'))(new Redis(config[_0x42c3('0xb')]));require(_0x42c3('0xd'))['register'](socket);function respondWithRpcPromise(_0x40f6a5,_0x3cf046,_0x108ae4){return new BPromise(function(_0x45acbf,_0x269f73){return client[_0x42c3('0xe')](_0x40f6a5,_0x108ae4)[_0x42c3('0xf')](function(_0x258deb){logger[_0x42c3('0x10')](_0x42c3('0x11'),_0x3cf046,_0x42c3('0x12'));logger[_0x42c3('0x13')]('MailQueue,\x20%s,\x20%s,\x20%s',_0x3cf046,_0x42c3('0x12'),JSON[_0x42c3('0x14')](_0x258deb));if(_0x258deb[_0x42c3('0x15')]){if(_0x258deb[_0x42c3('0x15')]['code']===0x1f4){logger[_0x42c3('0x15')](_0x42c3('0x11'),_0x3cf046,_0x258deb['error'][_0x42c3('0x16')]);return _0x269f73(_0x258deb[_0x42c3('0x15')][_0x42c3('0x16')]);}logger[_0x42c3('0x15')](_0x42c3('0x11'),_0x3cf046,_0x258deb[_0x42c3('0x15')]['message']);return _0x45acbf(_0x258deb[_0x42c3('0x15')][_0x42c3('0x16')]);}else{logger['info'](_0x42c3('0x11'),_0x3cf046,_0x42c3('0x12'));_0x45acbf(_0x258deb[_0x42c3('0x17')][_0x42c3('0x16')]);}})['catch'](function(_0x38dd39){logger[_0x42c3('0x15')](_0x42c3('0x11'),_0x3cf046,_0x38dd39);_0x269f73(_0x38dd39);});});}exports[_0x42c3('0x18')]=function(_0x956783){var _0x26096b=this;return new Promise(function(_0x2dc6fa,_0x512d89){return db[_0x42c3('0x19')][_0x42c3('0x1a')]({'raw':_0x956783['options']?_0x956783[_0x42c3('0x1b')][_0x42c3('0x1c')]===undefined?!![]:![]:!![],'where':_0x956783['options']?_0x956783[_0x42c3('0x1b')]['where']||null:null,'attributes':_0x956783['options']?_0x956783['options'][_0x42c3('0x1d')]||null:null,'limit':_0x956783['options']?_0x956783[_0x42c3('0x1b')][_0x42c3('0x1e')]||null:null,'include':_0x956783['options']?_0x956783[_0x42c3('0x1b')][_0x42c3('0x1f')]?_[_0x42c3('0x20')](_0x956783['options'][_0x42c3('0x1f')],function(_0x2908d8){return{'model':db[_0x2908d8[_0x42c3('0x21')]],'as':_0x2908d8['as'],'attributes':_0x2908d8[_0x42c3('0x1d')],'include':_0x2908d8[_0x42c3('0x1f')]?_[_0x42c3('0x20')](_0x2908d8[_0x42c3('0x1f')],function(_0x5f5c73){return{'model':db[_0x5f5c73[_0x42c3('0x21')]],'as':_0x5f5c73['as'],'attributes':_0x5f5c73[_0x42c3('0x1d')],'include':_0x5f5c73[_0x42c3('0x1f')]?_[_0x42c3('0x20')](_0x5f5c73['include'],function(_0x5011b7){return{'model':db[_0x5011b7['model']],'as':_0x5011b7['as'],'attributes':_0x5011b7['attributes']};}):[]};}):[]};}):[]:[]})[_0x42c3('0xf')](function(_0x346d9e){logger[_0x42c3('0x10')](_0x42c3('0x18'),_0x956783);logger['debug'](_0x42c3('0x18'),_0x956783,JSON[_0x42c3('0x14')](_0x346d9e));_0x2dc6fa(_0x346d9e);})['catch'](function(_0x46a296){logger['error'](_0x42c3('0x18'),_0x46a296[_0x42c3('0x16')],_0x956783);_0x512d89(_0x26096b[_0x42c3('0x15')](0x1f4,_0x46a296[_0x42c3('0x16')]));});});};exports[_0x42c3('0x22')]=function(_0x24f892){var _0x16e19a=this;return new Promise(function(_0x4cf4f8,_0x462d44){return db[_0x42c3('0x19')][_0x42c3('0x23')]({'raw':_0x24f892[_0x42c3('0x1b')]?_0x24f892[_0x42c3('0x1b')][_0x42c3('0x1c')]===undefined?!![]:![]:!![],'where':_0x24f892['options']?_0x24f892[_0x42c3('0x1b')][_0x42c3('0x24')]||null:null,'attributes':_0x24f892['options']?_0x24f892[_0x42c3('0x1b')][_0x42c3('0x1d')]||null:null,'include':_0x24f892[_0x42c3('0x1b')]?_0x24f892[_0x42c3('0x1b')][_0x42c3('0x1f')]?_['map'](_0x24f892[_0x42c3('0x1b')][_0x42c3('0x1f')],function(_0x1e3041){return{'model':db[_0x1e3041[_0x42c3('0x21')]],'as':_0x1e3041['as'],'attributes':_0x1e3041[_0x42c3('0x1d')],'include':_0x1e3041['include']?_['map'](_0x1e3041[_0x42c3('0x1f')],function(_0x3ed0fe){return{'model':db[_0x3ed0fe[_0x42c3('0x21')]],'as':_0x3ed0fe['as'],'attributes':_0x3ed0fe['attributes'],'include':_0x3ed0fe[_0x42c3('0x1f')]?_[_0x42c3('0x20')](_0x3ed0fe[_0x42c3('0x1f')],function(_0x22844f){return{'model':db[_0x22844f['model']],'as':_0x22844f['as'],'attributes':_0x22844f[_0x42c3('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x458e77){logger[_0x42c3('0x10')](_0x42c3('0x22'),_0x24f892);logger[_0x42c3('0x13')]('ShowMailQueue',_0x24f892,JSON[_0x42c3('0x14')](_0x458e77));_0x4cf4f8(_0x458e77);})['catch'](function(_0x19a5f4){logger[_0x42c3('0x15')]('ShowMailQueue',_0x19a5f4[_0x42c3('0x16')],_0x24f892);_0x462d44(_0x16e19a[_0x42c3('0x15')](0x1f4,_0x19a5f4[_0x42c3('0x16')]));});});}; \ No newline at end of file +var _0xaa25=['findAll','options','raw','attributes','limit','map','include','model','debug','stringify','ShowMailQueue','MailQueue','find','where','moment','../../config/logger','rpc','../../config/environment','client','http','defaults','localhost','socket.io-emitter','redis','./mailQueue.socket','register','then','info','request\x20sent','MailQueue,\x20%s,\x20%s,\x20%s','error','code','MailQueue,\x20%s,\x20%s','message','result','catch','GetMailQueue'];(function(_0x477869,_0x93b16b){var _0x3e5f07=function(_0x5d36a1){while(--_0x5d36a1){_0x477869['push'](_0x477869['shift']());}};_0x3e5f07(++_0x93b16b);}(_0xaa25,0x180));var _0x5aa2=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0xaa25[_0x51020b];return _0x371e47;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5aa2('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5aa2('0x1'))(_0x5aa2('0x2'));var config=require(_0x5aa2('0x3'));var jayson=require('jayson/promise');var client=jayson[_0x5aa2('0x4')][_0x5aa2('0x5')]({'port':0x232a});config['redis']=_[_0x5aa2('0x6')](config['redis'],{'host':_0x5aa2('0x7'),'port':0x18eb});var socket=require(_0x5aa2('0x8'))(new Redis(config[_0x5aa2('0x9')]));require(_0x5aa2('0xa'))[_0x5aa2('0xb')](socket);function respondWithRpcPromise(_0x9e4a5c,_0x3cfa0c,_0x2707ec){return new BPromise(function(_0x137ae7,_0x527fff){return client['request'](_0x9e4a5c,_0x2707ec)[_0x5aa2('0xc')](function(_0x44a004){logger[_0x5aa2('0xd')]('MailQueue,\x20%s,\x20%s',_0x3cfa0c,_0x5aa2('0xe'));logger['debug'](_0x5aa2('0xf'),_0x3cfa0c,_0x5aa2('0xe'),JSON['stringify'](_0x44a004));if(_0x44a004[_0x5aa2('0x10')]){if(_0x44a004['error'][_0x5aa2('0x11')]===0x1f4){logger[_0x5aa2('0x10')](_0x5aa2('0x12'),_0x3cfa0c,_0x44a004[_0x5aa2('0x10')]['message']);return _0x527fff(_0x44a004[_0x5aa2('0x10')][_0x5aa2('0x13')]);}logger[_0x5aa2('0x10')]('MailQueue,\x20%s,\x20%s',_0x3cfa0c,_0x44a004[_0x5aa2('0x10')][_0x5aa2('0x13')]);return _0x137ae7(_0x44a004[_0x5aa2('0x10')][_0x5aa2('0x13')]);}else{logger['info'](_0x5aa2('0x12'),_0x3cfa0c,'request\x20sent');_0x137ae7(_0x44a004[_0x5aa2('0x14')][_0x5aa2('0x13')]);}})[_0x5aa2('0x15')](function(_0x24948d){logger[_0x5aa2('0x10')](_0x5aa2('0x12'),_0x3cfa0c,_0x24948d);_0x527fff(_0x24948d);});});}exports[_0x5aa2('0x16')]=function(_0x15e5e6){var _0x563d4f=this;return new Promise(function(_0x11c571,_0x489b5a){return db['MailQueue'][_0x5aa2('0x17')]({'raw':_0x15e5e6[_0x5aa2('0x18')]?_0x15e5e6['options'][_0x5aa2('0x19')]===undefined?!![]:![]:!![],'where':_0x15e5e6[_0x5aa2('0x18')]?_0x15e5e6[_0x5aa2('0x18')]['where']||null:null,'attributes':_0x15e5e6[_0x5aa2('0x18')]?_0x15e5e6[_0x5aa2('0x18')][_0x5aa2('0x1a')]||null:null,'limit':_0x15e5e6['options']?_0x15e5e6[_0x5aa2('0x18')][_0x5aa2('0x1b')]||null:null,'include':_0x15e5e6[_0x5aa2('0x18')]?_0x15e5e6[_0x5aa2('0x18')]['include']?_[_0x5aa2('0x1c')](_0x15e5e6[_0x5aa2('0x18')][_0x5aa2('0x1d')],function(_0x246a0d){return{'model':db[_0x246a0d[_0x5aa2('0x1e')]],'as':_0x246a0d['as'],'attributes':_0x246a0d[_0x5aa2('0x1a')],'include':_0x246a0d['include']?_['map'](_0x246a0d['include'],function(_0x4763e5){return{'model':db[_0x4763e5[_0x5aa2('0x1e')]],'as':_0x4763e5['as'],'attributes':_0x4763e5[_0x5aa2('0x1a')],'include':_0x4763e5['include']?_['map'](_0x4763e5[_0x5aa2('0x1d')],function(_0x4dd7db){return{'model':db[_0x4dd7db[_0x5aa2('0x1e')]],'as':_0x4dd7db['as'],'attributes':_0x4dd7db[_0x5aa2('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x5aa2('0xc')](function(_0x3aebcf){logger[_0x5aa2('0xd')](_0x5aa2('0x16'),_0x15e5e6);logger[_0x5aa2('0x1f')]('GetMailQueue',_0x15e5e6,JSON[_0x5aa2('0x20')](_0x3aebcf));_0x11c571(_0x3aebcf);})[_0x5aa2('0x15')](function(_0x37a729){logger['error']('GetMailQueue',_0x37a729[_0x5aa2('0x13')],_0x15e5e6);_0x489b5a(_0x563d4f['error'](0x1f4,_0x37a729[_0x5aa2('0x13')]));});});};exports[_0x5aa2('0x21')]=function(_0x260e3c){var _0x492fed=this;return new Promise(function(_0x206dbe,_0x2388a7){return db[_0x5aa2('0x22')][_0x5aa2('0x23')]({'raw':_0x260e3c[_0x5aa2('0x18')]?_0x260e3c['options'][_0x5aa2('0x19')]===undefined?!![]:![]:!![],'where':_0x260e3c[_0x5aa2('0x18')]?_0x260e3c[_0x5aa2('0x18')][_0x5aa2('0x24')]||null:null,'attributes':_0x260e3c['options']?_0x260e3c[_0x5aa2('0x18')][_0x5aa2('0x1a')]||null:null,'include':_0x260e3c[_0x5aa2('0x18')]?_0x260e3c[_0x5aa2('0x18')][_0x5aa2('0x1d')]?_[_0x5aa2('0x1c')](_0x260e3c[_0x5aa2('0x18')]['include'],function(_0x17358e){return{'model':db[_0x17358e[_0x5aa2('0x1e')]],'as':_0x17358e['as'],'attributes':_0x17358e[_0x5aa2('0x1a')],'include':_0x17358e[_0x5aa2('0x1d')]?_[_0x5aa2('0x1c')](_0x17358e[_0x5aa2('0x1d')],function(_0x223e93){return{'model':db[_0x223e93['model']],'as':_0x223e93['as'],'attributes':_0x223e93[_0x5aa2('0x1a')],'include':_0x223e93[_0x5aa2('0x1d')]?_['map'](_0x223e93[_0x5aa2('0x1d')],function(_0x4da73c){return{'model':db[_0x4da73c[_0x5aa2('0x1e')]],'as':_0x4da73c['as'],'attributes':_0x4da73c[_0x5aa2('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4d7fda){logger[_0x5aa2('0xd')](_0x5aa2('0x21'),_0x260e3c);logger[_0x5aa2('0x1f')](_0x5aa2('0x21'),_0x260e3c,JSON['stringify'](_0x4d7fda));_0x206dbe(_0x4d7fda);})['catch'](function(_0x2dc8b9){logger[_0x5aa2('0x10')]('ShowMailQueue',_0x2dc8b9[_0x5aa2('0x13')],_0x260e3c);_0x2388a7(_0x492fed[_0x5aa2('0x10')](0x1f4,_0x2dc8b9[_0x5aa2('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index ff8d4cd..842d86b 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 _0xda9f=['remove','update','register','length','./mailQueue.events','save'];(function(_0x75f6c4,_0x842c36){var _0x16175f=function(_0x1af7bc){while(--_0x1af7bc){_0x75f6c4['push'](_0x75f6c4['shift']());}};_0x16175f(++_0x842c36);}(_0xda9f,0x184));var _0xfda9=function(_0x3ae13f,_0x360766){_0x3ae13f=_0x3ae13f-0x0;var _0x70abca=_0xda9f[_0x3ae13f];return _0x70abca;};'use strict';var MailQueueEvents=require(_0xfda9('0x0'));var events=[_0xfda9('0x1'),_0xfda9('0x2'),_0xfda9('0x3')];function createListener(_0x181f2c,_0x192d7e){return function(_0x39428c){_0x192d7e['emit'](_0x181f2c,_0x39428c);};}function removeListener(_0x4a28ae,_0x5e784e){return function(){MailQueueEvents['removeListener'](_0x4a28ae,_0x5e784e);};}exports[_0xfda9('0x4')]=function(_0x33f914){for(var _0x1504d2=0x0,_0xe69d8d=events[_0xfda9('0x5')];_0x1504d2<_0xe69d8d;_0x1504d2++){var _0x45d1ee=events[_0x1504d2];var _0x5311da=createListener('mailQueue:'+_0x45d1ee,_0x33f914);MailQueueEvents['on'](_0x45d1ee,_0x5311da);}}; \ No newline at end of file +var _0x8665=['removeListener','register','length','mailQueue:','./mailQueue.events','save','remove'];(function(_0x2f5894,_0xcd4c6d){var _0x3f2df6=function(_0x3685c7){while(--_0x3685c7){_0x2f5894['push'](_0x2f5894['shift']());}};_0x3f2df6(++_0xcd4c6d);}(_0x8665,0x66));var _0x5866=function(_0x3a7daa,_0xf58941){_0x3a7daa=_0x3a7daa-0x0;var _0x58aa3b=_0x8665[_0x3a7daa];return _0x58aa3b;};'use strict';var MailQueueEvents=require(_0x5866('0x0'));var events=[_0x5866('0x1'),_0x5866('0x2'),'update'];function createListener(_0x21056b,_0x388a79){return function(_0x197d00){_0x388a79['emit'](_0x21056b,_0x197d00);};}function removeListener(_0x4c33bf,_0xfe8280){return function(){MailQueueEvents[_0x5866('0x3')](_0x4c33bf,_0xfe8280);};}exports[_0x5866('0x4')]=function(_0x1bfdf6){for(var _0x117f9c=0x0,_0x7a930f=events[_0x5866('0x5')];_0x117f9c<_0x7a930f;_0x117f9c++){var _0x12a80e=events[_0x117f9c];var _0x50384e=createListener(_0x5866('0x6')+_0x12a80e,_0x1bfdf6);MailQueueEvents['on'](_0x12a80e,_0x50384e);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index ed8bf52..7475b20 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 _0x6989=['index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','get'];(function(_0x32a8be,_0x275743){var _0x458316=function(_0xffb95){while(--_0xffb95){_0x32a8be['push'](_0x32a8be['shift']());}};_0x458316(++_0x275743);}(_0x6989,0xf4));var _0x9698=function(_0x40ea2a,_0x1f21db){_0x40ea2a=_0x40ea2a-0x0;var _0x432be2=_0x6989[_0x40ea2a];return _0x432be2;};'use strict';var multer=require(_0x9698('0x0'));var util=require(_0x9698('0x1'));var path=require(_0x9698('0x2'));var timeout=require(_0x9698('0x3'));var express=require(_0x9698('0x4'));var router=express[_0x9698('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x9698('0x6'));var config=require('../../config/environment');var controller=require('./mailQueueReport.controller');router[_0x9698('0x7')]('/',auth['isAuthenticated'](),controller[_0x9698('0x8')]);router['get'](_0x9698('0x9'),auth[_0x9698('0xa')](),controller[_0x9698('0xb')]);router[_0x9698('0x7')](_0x9698('0xc'),auth['isAuthenticated'](),controller[_0x9698('0xd')]);router[_0x9698('0xe')]('/',auth[_0x9698('0xa')](),controller[_0x9698('0xf')]);router[_0x9698('0x10')](_0x9698('0xc'),auth[_0x9698('0xa')](),controller[_0x9698('0x11')]);router[_0x9698('0x12')](_0x9698('0xc'),auth[_0x9698('0xa')](),controller[_0x9698('0x13')]);module[_0x9698('0x14')]=router; \ No newline at end of file +var _0xfbef=['show','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','isAuthenticated','index','/describe','/:id'];(function(_0x3e03ae,_0x59bfd5){var _0x4c6b0e=function(_0x35fbb8){while(--_0x35fbb8){_0x3e03ae['push'](_0x3e03ae['shift']());}};_0x4c6b0e(++_0x59bfd5);}(_0xfbef,0xc4));var _0xffbe=function(_0x4fffbb,_0x1c9e92){_0x4fffbb=_0x4fffbb-0x0;var _0x2d7b84=_0xfbef[_0x4fffbb];return _0x2d7b84;};'use strict';var multer=require('multer');var util=require(_0xffbe('0x0'));var path=require(_0xffbe('0x1'));var timeout=require(_0xffbe('0x2'));var express=require(_0xffbe('0x3'));var router=express[_0xffbe('0x4')]();var auth=require(_0xffbe('0x5'));var interaction=require(_0xffbe('0x6'));var config=require(_0xffbe('0x7'));var controller=require(_0xffbe('0x8'));router[_0xffbe('0x9')]('/',auth[_0xffbe('0xa')](),controller[_0xffbe('0xb')]);router[_0xffbe('0x9')](_0xffbe('0xc'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xffbe('0xd'),auth[_0xffbe('0xa')](),controller[_0xffbe('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xffbe('0xf')]);router[_0xffbe('0x10')]('/:id',auth[_0xffbe('0xa')](),controller[_0xffbe('0x11')]);router[_0xffbe('0x12')]('/:id',auth[_0xffbe('0xa')](),controller[_0xffbe('0x13')]);module[_0xffbe('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 427786d..8f47199 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 _0x68b6=['moment','sequelize','exports','STRING','DATE'];(function(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0x68b6,0x1a4));var _0x668b=function(_0x1a6035,_0x5e2590){_0x1a6035=_0x1a6035-0x0;var _0x2bc670=_0x68b6[_0x1a6035];return _0x2bc670;};'use strict';var moment=require(_0x668b('0x0'));var Sequelize=require(_0x668b('0x1'));module[_0x668b('0x2')]={'uniqueid':{'type':Sequelize[_0x668b('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x668b('0x4')]},'acceptAt':{'type':Sequelize[_0x668b('0x4')]},'exitAt':{'type':Sequelize[_0x668b('0x4')]},'reason':{'type':Sequelize[_0x668b('0x3')]}}; \ No newline at end of file +var _0xaf8b=['DATE','moment','sequelize','STRING'];(function(_0x2ae7c3,_0x47b983){var _0x58da5e=function(_0x208c9c){while(--_0x208c9c){_0x2ae7c3['push'](_0x2ae7c3['shift']());}};_0x58da5e(++_0x47b983);}(_0xaf8b,0x1d1));var _0xbaf8=function(_0x1a6e27,_0x44bbfd){_0x1a6e27=_0x1a6e27-0x0;var _0x49230f=_0xaf8b[_0x1a6e27];return _0x49230f;};'use strict';var moment=require(_0xbaf8('0x0'));var Sequelize=require(_0xbaf8('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbaf8('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xbaf8('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xbaf8('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xbaf8('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 2fc0d25..6c4d5a4 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 _0xfda9=['fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','MailQueueReport','includeAll','include','findAll','then','rows','catch','show','options','find','create','body','params','destroy','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','sendStatus','stack','name','status','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes'];(function(_0x40bffc,_0x3a45d7){var _0x3007e9=function(_0x4c8fda){while(--_0x4c8fda){_0x40bffc['push'](_0x40bffc['shift']());}};_0x3007e9(++_0x3a45d7);}(_0xfda9,0xb6));var _0x9fda=function(_0x46bc93,_0x537a2d){_0x46bc93=_0x46bc93-0x0;var _0x2e3731=_0xfda9[_0x46bc93];return _0x2e3731;};'use strict';var pdf=require(_0x9fda('0x0'));var emlformat=require(_0x9fda('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x9fda('0x2'));var jsonpatch=require(_0x9fda('0x3'));var rp=require(_0x9fda('0x4'));var moment=require(_0x9fda('0x5'));var BPromise=require(_0x9fda('0x6'));var Mustache=require('mustache');var util=require(_0x9fda('0x7'));var path=require(_0x9fda('0x8'));var sox=require(_0x9fda('0x9'));var csv=require(_0x9fda('0xa'));var ejs=require(_0x9fda('0xb'));var fs=require('fs');var _=require(_0x9fda('0xc'));var squel=require(_0x9fda('0xd'));var crypto=require('crypto');var jsforce=require(_0x9fda('0xe'));var deskjs=require(_0x9fda('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9fda('0x10'));var Redis=require(_0x9fda('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9fda('0x12'));var hardwareService=require(_0x9fda('0x13'));var logger=require(_0x9fda('0x14'))(_0x9fda('0x15'));var utils=require(_0x9fda('0x16'));var config=require('../../config/environment');var db=require(_0x9fda('0x17'))['db'];function respondWithStatusCode(_0xf924c4,_0x5a3dde){_0x5a3dde=_0x5a3dde||0xcc;return function(_0x1a4c39){if(_0x1a4c39){return _0xf924c4['sendStatus'](_0x5a3dde);}return _0xf924c4['status'](_0x5a3dde)[_0x9fda('0x18')]();};}function respondWithResult(_0x33855b,_0xae9a50){_0xae9a50=_0xae9a50||0xc8;return function(_0x419ba0){if(_0x419ba0){return _0x33855b['status'](_0xae9a50)[_0x9fda('0x19')](_0x419ba0);}};}function respondWithFilteredResult(_0x51119e,_0x1752c5){return function(_0xb84587){if(_0xb84587){var _0x3fa01e=_0xb84587[_0x9fda('0x1a')],_0x4e5679=_0x1752c5[_0x9fda('0x1b')],_0x4b35d6=_0x1752c5[_0x9fda('0x1b')]+_0x1752c5[_0x9fda('0x1c')],_0x301b7e;if(_0x4b35d6>=_0x3fa01e){_0x4b35d6=_0x3fa01e;_0x301b7e=0xc8;}else{_0x301b7e=0xce;}_0x51119e['status'](_0x301b7e);return _0x51119e[_0x9fda('0x1d')](_0x9fda('0x1e'),_0x4e5679+'-'+_0x4b35d6+'/'+_0x3fa01e)[_0x9fda('0x19')](_0xb84587);}return null;};}function patchUpdates(_0x36a105){return function(_0x57ad65){try{jsonpatch[_0x9fda('0x1f')](_0x57ad65,_0x36a105,!![]);}catch(_0xf31ae9){return BPromise[_0x9fda('0x20')](_0xf31ae9);}return _0x57ad65[_0x9fda('0x21')]();};}function saveUpdates(_0x22a284,_0x4a6188){return function(_0x287970){if(_0x287970){return _0x287970[_0x9fda('0x22')](_0x22a284)['then'](function(_0x59ddc4){return _0x59ddc4;});}return null;};}function removeEntity(_0x3e09be,_0x50b55a){return function(_0x3323a3){if(_0x3323a3){return _0x3323a3['destroy']()['then'](function(){_0x3e09be['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b4bb0,_0x1d32a4){return function(_0x5cbe1e){if(!_0x5cbe1e){_0x5b4bb0[_0x9fda('0x23')](0x194);}return _0x5cbe1e;};}function handleError(_0x379c30,_0x5087fe){_0x5087fe=_0x5087fe||0x1f4;return function(_0x663e79){logger['error'](_0x663e79[_0x9fda('0x24')]);if(_0x663e79[_0x9fda('0x25')]){delete _0x663e79[_0x9fda('0x25')];}_0x379c30[_0x9fda('0x26')](_0x5087fe)[_0x9fda('0x27')](_0x663e79);};}exports[_0x9fda('0x28')]=function(_0x1bc5db,_0xbb590d){var _0x27b0cc={},_0xf247c3={},_0x2669ba={'count':0x0,'rows':[]};var _0x17428d=_[_0x9fda('0x29')](db['MailQueueReport'][_0x9fda('0x2a')],function(_0x4b0f96){return{'name':_0x4b0f96[_0x9fda('0x2b')],'type':_0x4b0f96[_0x9fda('0x2c')][_0x9fda('0x2d')]};});_0xf247c3[_0x9fda('0x2e')]=_[_0x9fda('0x29')](_0x17428d,'name');_0xf247c3[_0x9fda('0x2f')]=_[_0x9fda('0x30')](_0x1bc5db[_0x9fda('0x2f')]);_0xf247c3[_0x9fda('0x31')]=_[_0x9fda('0x32')](_0xf247c3[_0x9fda('0x2e')],_0xf247c3['query']);_0x27b0cc[_0x9fda('0x33')]=_['intersection'](_0xf247c3[_0x9fda('0x2e')],qs['fields'](_0x1bc5db[_0x9fda('0x2f')][_0x9fda('0x34')]));_0x27b0cc[_0x9fda('0x33')]=_0x27b0cc[_0x9fda('0x33')][_0x9fda('0x35')]?_0x27b0cc[_0x9fda('0x33')]:_0xf247c3[_0x9fda('0x2e')];if(!_0x1bc5db[_0x9fda('0x2f')][_0x9fda('0x36')](_0x9fda('0x37'))){_0x27b0cc['limit']=qs[_0x9fda('0x1c')](_0x1bc5db[_0x9fda('0x2f')]['limit']);_0x27b0cc[_0x9fda('0x1b')]=qs[_0x9fda('0x1b')](_0x1bc5db[_0x9fda('0x2f')]['offset']);}_0x27b0cc[_0x9fda('0x38')]=qs[_0x9fda('0x39')](_0x1bc5db[_0x9fda('0x2f')][_0x9fda('0x39')]);_0x27b0cc[_0x9fda('0x3a')]=qs['filters'](_[_0x9fda('0x3b')](_0x1bc5db[_0x9fda('0x2f')],_0xf247c3[_0x9fda('0x31')]));if(_0x1bc5db[_0x9fda('0x2f')]['filter']){_0x27b0cc[_0x9fda('0x3a')]=_[_0x9fda('0x3c')](_0x27b0cc[_0x9fda('0x3a')],{'$or':_[_0x9fda('0x29')](_0x17428d,function(_0x2a960c){if(_0x2a960c['type']!==_0x9fda('0x3d')){var _0x49f780={};_0x49f780[_0x2a960c[_0x9fda('0x25')]]={'$like':'%'+_0x1bc5db[_0x9fda('0x2f')][_0x9fda('0x3e')]+'%'};return _0x49f780;}})});}_0x27b0cc=_[_0x9fda('0x3c')]({},_0x27b0cc,_0x1bc5db['options']);var _0x591e23={'where':_0x27b0cc['where']};return db[_0x9fda('0x3f')][_0x9fda('0x1a')](_0x591e23)['then'](function(_0x3f7f55){_0x2669ba[_0x9fda('0x1a')]=_0x3f7f55;if(_0x1bc5db[_0x9fda('0x2f')][_0x9fda('0x40')]){_0x27b0cc[_0x9fda('0x41')]=[{'all':!![]}];}return db['MailQueueReport'][_0x9fda('0x42')](_0x27b0cc);})[_0x9fda('0x43')](function(_0x561036){_0x2669ba[_0x9fda('0x44')]=_0x561036;return _0x2669ba;})[_0x9fda('0x43')](respondWithFilteredResult(_0xbb590d,_0x27b0cc))[_0x9fda('0x45')](handleError(_0xbb590d,null));};exports[_0x9fda('0x46')]=function(_0x7e5101,_0x4f126e){var _0x5ac1a9={'raw':!![],'where':{'id':_0x7e5101['params']['id']}},_0x5bb461={};_0x5bb461[_0x9fda('0x2e')]=_['keys'](db[_0x9fda('0x3f')][_0x9fda('0x2a')]);_0x5bb461[_0x9fda('0x2f')]=_[_0x9fda('0x30')](_0x7e5101[_0x9fda('0x2f')]);_0x5bb461[_0x9fda('0x31')]=_[_0x9fda('0x32')](_0x5bb461[_0x9fda('0x2e')],_0x5bb461[_0x9fda('0x2f')]);_0x5ac1a9['attributes']=_['intersection'](_0x5bb461[_0x9fda('0x2e')],qs['fields'](_0x7e5101[_0x9fda('0x2f')][_0x9fda('0x34')]));_0x5ac1a9[_0x9fda('0x33')]=_0x5ac1a9[_0x9fda('0x33')][_0x9fda('0x35')]?_0x5ac1a9[_0x9fda('0x33')]:_0x5bb461[_0x9fda('0x2e')];if(_0x7e5101[_0x9fda('0x2f')][_0x9fda('0x40')]){_0x5ac1a9['include']=[{'all':!![]}];}_0x5ac1a9=_[_0x9fda('0x3c')]({},_0x5ac1a9,_0x7e5101[_0x9fda('0x47')]);return db['MailQueueReport'][_0x9fda('0x48')](_0x5ac1a9)['then'](handleEntityNotFound(_0x4f126e,null))['then'](respondWithResult(_0x4f126e,null))[_0x9fda('0x45')](handleError(_0x4f126e,null));};exports[_0x9fda('0x49')]=function(_0x3149e3,_0x2e9f35){return db['MailQueueReport'][_0x9fda('0x49')](_0x3149e3['body'],{})[_0x9fda('0x43')](respondWithResult(_0x2e9f35,0xc9))[_0x9fda('0x45')](handleError(_0x2e9f35,null));};exports['update']=function(_0x156cd1,_0x3c368c){if(_0x156cd1[_0x9fda('0x4a')]['id']){delete _0x156cd1[_0x9fda('0x4a')]['id'];}return db[_0x9fda('0x3f')][_0x9fda('0x48')]({'where':{'id':_0x156cd1[_0x9fda('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3c368c,null))[_0x9fda('0x43')](saveUpdates(_0x156cd1['body'],null))[_0x9fda('0x43')](respondWithResult(_0x3c368c,null))[_0x9fda('0x45')](handleError(_0x3c368c,null));};exports[_0x9fda('0x4c')]=function(_0x81d2c5,_0x6bacfd){return db[_0x9fda('0x3f')][_0x9fda('0x48')]({'where':{'id':_0x81d2c5['params']['id']}})[_0x9fda('0x43')](handleEntityNotFound(_0x6bacfd,null))[_0x9fda('0x43')](removeEntity(_0x6bacfd,null))[_0x9fda('0x45')](handleError(_0x6bacfd,null));};exports[_0x9fda('0x4d')]=function(_0x456afd,_0x4393cc){return db['MailQueueReport'][_0x9fda('0x4d')]()[_0x9fda('0x43')](respondWithResult(_0x4393cc,null))[_0x9fda('0x45')](handleError(_0x4393cc,null));}; \ No newline at end of file +var _0x93ff=['hasOwnProperty','limit','order','where','filters','pick','filter','merge','VIRTUAL','MailQueueReport','includeAll','findAll','rows','show','params','fields','include','options','find','create','body','catch','update','describe','html-pdf','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','ejs','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','then','destroy','error','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','length'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x93ff,0x194));var _0xf93f=function(_0x5a7513,_0xa2742f){_0x5a7513=_0x5a7513-0x0;var _0x41af54=_0x93ff[_0x5a7513];return _0x41af54;};'use strict';var pdf=require(_0xf93f('0x0'));var emlformat=require(_0xf93f('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf93f('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf93f('0x3'));var Mustache=require(_0xf93f('0x4'));var util=require(_0xf93f('0x5'));var path=require(_0xf93f('0x6'));var sox=require(_0xf93f('0x7'));var csv=require('to-csv');var ejs=require(_0xf93f('0x8'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xf93f('0x9'));var jsforce=require(_0xf93f('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xf93f('0xb'));var querystring=require(_0xf93f('0xc'));var Papa=require(_0xf93f('0xd'));var Redis=require(_0xf93f('0xe'));var authService=require(_0xf93f('0xf'));var qs=require(_0xf93f('0x10'));var as=require(_0xf93f('0x11'));var hardwareService=require(_0xf93f('0x12'));var logger=require(_0xf93f('0x13'))(_0xf93f('0x14'));var utils=require(_0xf93f('0x15'));var config=require(_0xf93f('0x16'));var db=require(_0xf93f('0x17'))['db'];function respondWithStatusCode(_0xfe3fcc,_0x54eeac){_0x54eeac=_0x54eeac||0xcc;return function(_0x14844d){if(_0x14844d){return _0xfe3fcc[_0xf93f('0x18')](_0x54eeac);}return _0xfe3fcc[_0xf93f('0x19')](_0x54eeac)[_0xf93f('0x1a')]();};}function respondWithResult(_0x5cfabf,_0x49261f){_0x49261f=_0x49261f||0xc8;return function(_0x58adec){if(_0x58adec){return _0x5cfabf[_0xf93f('0x19')](_0x49261f)[_0xf93f('0x1b')](_0x58adec);}};}function respondWithFilteredResult(_0x4a2cf6,_0x585d28){return function(_0x5c3978){if(_0x5c3978){var _0x4a8383=_0x5c3978[_0xf93f('0x1c')],_0x3e223=_0x585d28[_0xf93f('0x1d')],_0x1a6627=_0x585d28['offset']+_0x585d28['limit'],_0x47e3c0;if(_0x1a6627>=_0x4a8383){_0x1a6627=_0x4a8383;_0x47e3c0=0xc8;}else{_0x47e3c0=0xce;}_0x4a2cf6[_0xf93f('0x19')](_0x47e3c0);return _0x4a2cf6[_0xf93f('0x1e')](_0xf93f('0x1f'),_0x3e223+'-'+_0x1a6627+'/'+_0x4a8383)[_0xf93f('0x1b')](_0x5c3978);}return null;};}function patchUpdates(_0x50c76d){return function(_0x4dd49e){try{jsonpatch[_0xf93f('0x20')](_0x4dd49e,_0x50c76d,!![]);}catch(_0x5f52d4){return BPromise[_0xf93f('0x21')](_0x5f52d4);}return _0x4dd49e[_0xf93f('0x22')]();};}function saveUpdates(_0x2ca482,_0x5dd900){return function(_0x1b66c8){if(_0x1b66c8){return _0x1b66c8['update'](_0x2ca482)[_0xf93f('0x23')](function(_0x1b5f40){return _0x1b5f40;});}return null;};}function removeEntity(_0x52bf57,_0xf25364){return function(_0x3d6b85){if(_0x3d6b85){return _0x3d6b85[_0xf93f('0x24')]()[_0xf93f('0x23')](function(){_0x52bf57['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x41d8a9,_0x250a5f){return function(_0x404f25){if(!_0x404f25){_0x41d8a9[_0xf93f('0x18')](0x194);}return _0x404f25;};}function handleError(_0x2cbbc8,_0x49069c){_0x49069c=_0x49069c||0x1f4;return function(_0x5e0c6b){logger[_0xf93f('0x25')](_0x5e0c6b['stack']);if(_0x5e0c6b[_0xf93f('0x26')]){delete _0x5e0c6b[_0xf93f('0x26')];}_0x2cbbc8[_0xf93f('0x19')](_0x49069c)[_0xf93f('0x27')](_0x5e0c6b);};}exports[_0xf93f('0x28')]=function(_0x28bf20,_0x4765ac){var _0x1e5ffc={},_0x2a2fe8={},_0x41f217={'count':0x0,'rows':[]};var _0x18ae25=_[_0xf93f('0x29')](db['MailQueueReport'][_0xf93f('0x2a')],function(_0x1e8aaa){return{'name':_0x1e8aaa[_0xf93f('0x2b')],'type':_0x1e8aaa[_0xf93f('0x2c')][_0xf93f('0x2d')]};});_0x2a2fe8[_0xf93f('0x2e')]=_[_0xf93f('0x29')](_0x18ae25,'name');_0x2a2fe8['query']=_[_0xf93f('0x2f')](_0x28bf20[_0xf93f('0x30')]);_0x2a2fe8['filters']=_[_0xf93f('0x31')](_0x2a2fe8[_0xf93f('0x2e')],_0x2a2fe8['query']);_0x1e5ffc['attributes']=_['intersection'](_0x2a2fe8[_0xf93f('0x2e')],qs['fields'](_0x28bf20[_0xf93f('0x30')]['fields']));_0x1e5ffc[_0xf93f('0x32')]=_0x1e5ffc[_0xf93f('0x32')][_0xf93f('0x33')]?_0x1e5ffc['attributes']:_0x2a2fe8['model'];if(!_0x28bf20['query'][_0xf93f('0x34')]('nolimit')){_0x1e5ffc[_0xf93f('0x35')]=qs[_0xf93f('0x35')](_0x28bf20[_0xf93f('0x30')][_0xf93f('0x35')]);_0x1e5ffc[_0xf93f('0x1d')]=qs[_0xf93f('0x1d')](_0x28bf20[_0xf93f('0x30')][_0xf93f('0x1d')]);}_0x1e5ffc[_0xf93f('0x36')]=qs['sort'](_0x28bf20[_0xf93f('0x30')]['sort']);_0x1e5ffc[_0xf93f('0x37')]=qs[_0xf93f('0x38')](_[_0xf93f('0x39')](_0x28bf20[_0xf93f('0x30')],_0x2a2fe8[_0xf93f('0x38')]));if(_0x28bf20[_0xf93f('0x30')][_0xf93f('0x3a')]){_0x1e5ffc[_0xf93f('0x37')]=_[_0xf93f('0x3b')](_0x1e5ffc[_0xf93f('0x37')],{'$or':_[_0xf93f('0x29')](_0x18ae25,function(_0x42a307){if(_0x42a307[_0xf93f('0x2c')]!==_0xf93f('0x3c')){var _0x4f3a29={};_0x4f3a29[_0x42a307[_0xf93f('0x26')]]={'$like':'%'+_0x28bf20[_0xf93f('0x30')][_0xf93f('0x3a')]+'%'};return _0x4f3a29;}})});}_0x1e5ffc=_[_0xf93f('0x3b')]({},_0x1e5ffc,_0x28bf20['options']);var _0x19b152={'where':_0x1e5ffc[_0xf93f('0x37')]};return db[_0xf93f('0x3d')]['count'](_0x19b152)[_0xf93f('0x23')](function(_0x24f3a9){_0x41f217[_0xf93f('0x1c')]=_0x24f3a9;if(_0x28bf20[_0xf93f('0x30')][_0xf93f('0x3e')]){_0x1e5ffc['include']=[{'all':!![]}];}return db['MailQueueReport'][_0xf93f('0x3f')](_0x1e5ffc);})[_0xf93f('0x23')](function(_0x202f13){_0x41f217[_0xf93f('0x40')]=_0x202f13;return _0x41f217;})[_0xf93f('0x23')](respondWithFilteredResult(_0x4765ac,_0x1e5ffc))['catch'](handleError(_0x4765ac,null));};exports[_0xf93f('0x41')]=function(_0x3a3eeb,_0x387562){var _0x2244dc={'raw':!![],'where':{'id':_0x3a3eeb[_0xf93f('0x42')]['id']}},_0x433a28={};_0x433a28[_0xf93f('0x2e')]=_[_0xf93f('0x2f')](db['MailQueueReport'][_0xf93f('0x2a')]);_0x433a28[_0xf93f('0x30')]=_['keys'](_0x3a3eeb[_0xf93f('0x30')]);_0x433a28[_0xf93f('0x38')]=_[_0xf93f('0x31')](_0x433a28[_0xf93f('0x2e')],_0x433a28['query']);_0x2244dc[_0xf93f('0x32')]=_[_0xf93f('0x31')](_0x433a28[_0xf93f('0x2e')],qs[_0xf93f('0x43')](_0x3a3eeb['query'][_0xf93f('0x43')]));_0x2244dc[_0xf93f('0x32')]=_0x2244dc['attributes'][_0xf93f('0x33')]?_0x2244dc['attributes']:_0x433a28['model'];if(_0x3a3eeb[_0xf93f('0x30')][_0xf93f('0x3e')]){_0x2244dc[_0xf93f('0x44')]=[{'all':!![]}];}_0x2244dc=_['merge']({},_0x2244dc,_0x3a3eeb[_0xf93f('0x45')]);return db[_0xf93f('0x3d')][_0xf93f('0x46')](_0x2244dc)[_0xf93f('0x23')](handleEntityNotFound(_0x387562,null))[_0xf93f('0x23')](respondWithResult(_0x387562,null))['catch'](handleError(_0x387562,null));};exports[_0xf93f('0x47')]=function(_0x34e407,_0x386903){return db['MailQueueReport'][_0xf93f('0x47')](_0x34e407[_0xf93f('0x48')],{})[_0xf93f('0x23')](respondWithResult(_0x386903,0xc9))[_0xf93f('0x49')](handleError(_0x386903,null));};exports[_0xf93f('0x4a')]=function(_0x54d33a,_0xa9db66){if(_0x54d33a[_0xf93f('0x48')]['id']){delete _0x54d33a[_0xf93f('0x48')]['id'];}return db[_0xf93f('0x3d')][_0xf93f('0x46')]({'where':{'id':_0x54d33a['params']['id']}})[_0xf93f('0x23')](handleEntityNotFound(_0xa9db66,null))[_0xf93f('0x23')](saveUpdates(_0x54d33a[_0xf93f('0x48')],null))[_0xf93f('0x23')](respondWithResult(_0xa9db66,null))[_0xf93f('0x49')](handleError(_0xa9db66,null));};exports[_0xf93f('0x24')]=function(_0xc07cc8,_0x2b6507){return db[_0xf93f('0x3d')]['find']({'where':{'id':_0xc07cc8[_0xf93f('0x42')]['id']}})[_0xf93f('0x23')](handleEntityNotFound(_0x2b6507,null))[_0xf93f('0x23')](removeEntity(_0x2b6507,null))[_0xf93f('0x49')](handleError(_0x2b6507,null));};exports[_0xf93f('0x4b')]=function(_0x154b29,_0x2f6546){return db[_0xf93f('0x3d')][_0xf93f('0x4b')]()[_0xf93f('0x23')](respondWithResult(_0x2f6546,null))[_0xf93f('0x49')](handleError(_0x2f6546,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index fda70d0..84f31c6 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 _0x1c2a=['../../config/environment','./mailQueueReport.attributes','exports','define','MailQueueReport','uniqueid','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x26b80e,_0x5c9333){var _0x84a8a8=function(_0x2e5b4a){while(--_0x2e5b4a){_0x26b80e['push'](_0x26b80e['shift']());}};_0x84a8a8(++_0x5c9333);}(_0x1c2a,0x68));var _0xa1c2=function(_0xe1bf9b,_0x5824be){_0xe1bf9b=_0xe1bf9b-0x0;var _0x5030c4=_0x1c2a[_0xe1bf9b];return _0x5030c4;};'use strict';var _=require(_0xa1c2('0x0'));var util=require(_0xa1c2('0x1'));var logger=require('../../config/logger')(_0xa1c2('0x2'));var moment=require(_0xa1c2('0x3'));var BPromise=require(_0xa1c2('0x4'));var rp=require(_0xa1c2('0x5'));var fs=require('fs');var path=require(_0xa1c2('0x6'));var rimraf=require(_0xa1c2('0x7'));var config=require(_0xa1c2('0x8'));var attributes=require(_0xa1c2('0x9'));module[_0xa1c2('0xa')]=function(_0x14fec9,_0x183f12){return _0x14fec9[_0xa1c2('0xb')](_0xa1c2('0xc'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0xa1c2('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x0637=['path','./mailQueueReport.attributes','exports','define','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3f94f9,_0x42774b){var _0x46f84f=function(_0xa080d8){while(--_0xa080d8){_0x3f94f9['push'](_0x3f94f9['shift']());}};_0x46f84f(++_0x42774b);}(_0x0637,0x7e));var _0x7063=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0637[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x7063('0x0'));var util=require('util');var logger=require(_0x7063('0x1'))(_0x7063('0x2'));var moment=require(_0x7063('0x3'));var BPromise=require(_0x7063('0x4'));var rp=require(_0x7063('0x5'));var fs=require('fs');var path=require(_0x7063('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7063('0x7'));module[_0x7063('0x8')]=function(_0x4b8552,_0x11e9f){return _0x4b8552[_0x7063('0x9')]('MailQueueReport',attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0x7063('0xa'),'fields':[_0x7063('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index efdb42b..9aa5edc 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 _0x7a54=['moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','MailQueueReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','MailQueueReport','create','body','options','raw','CreateMailQueueReport','UpdateMailQueueReport','update','where','attributes','limit','then','lodash','util'];(function(_0x50f0e1,_0x3ae980){var _0x2258a4=function(_0xd9c5be){while(--_0xd9c5be){_0x50f0e1['push'](_0x50f0e1['shift']());}};_0x2258a4(++_0x3ae980);}(_0x7a54,0x106));var _0x47a5=function(_0xb93636,_0x1bf01d){_0xb93636=_0xb93636-0x0;var _0x4b77a0=_0x7a54[_0xb93636];return _0x4b77a0;};'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')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateMailQueueReport']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateMailQueueReport',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});};exports[_0x47a5('0x1b')]=function(_0x513981){var _0x28747d=this;return new Promise(function(_0xc4cd63,_0x4437f1){return db[_0x47a5('0x15')][_0x47a5('0x1c')](_0x513981['body'],{'raw':_0x513981['options']?_0x513981[_0x47a5('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x513981[_0x47a5('0x18')]?_0x513981['options'][_0x47a5('0x1d')]||null:null,'attributes':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1e')]||null:null,'limit':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1f')]||null:null})[_0x47a5('0x20')](function(_0x16631f){logger[_0x47a5('0xb')](_0x47a5('0x1b'),_0x513981);logger[_0x47a5('0xd')](_0x47a5('0x1b'),_0x513981,JSON['stringify'](_0x16631f));_0xc4cd63(_0x16631f);})[_0x47a5('0x14')](function(_0x51833b){logger[_0x47a5('0xf')](_0x47a5('0x1b'),_0x51833b[_0x47a5('0x11')],_0x513981);_0x4437f1(_0x28747d['error'](0x1f4,_0x51833b[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0x53ec=['randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','catch','CreateMailQueueReport','create','body','options','raw','UpdateMailQueueReport','update','attributes','lodash','util','moment','bluebird'];(function(_0x509b78,_0x503f64){var _0xb6579d=function(_0x28bda0){while(--_0x28bda0){_0x509b78['push'](_0x509b78['shift']());}};_0xb6579d(++_0x503f64);}(_0x53ec,0x192));var _0xc53e=function(_0x69c0c2,_0x2af0bf){_0x69c0c2=_0x69c0c2-0x0;var _0x3422f6=_0x53ec[_0x69c0c2];return _0x3422f6;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var moment=require(_0xc53e('0x2'));var BPromise=require(_0xc53e('0x3'));var rs=require(_0xc53e('0x4'));var fs=require('fs');var Redis=require(_0xc53e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc53e('0x6'));var logger=require('../../config/logger')(_0xc53e('0x7'));var config=require(_0xc53e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc53e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41a9e8,_0x2de88b,_0x5d3b28){return new BPromise(function(_0x1616ac,_0x1ac6c0){return client[_0xc53e('0xa')](_0x41a9e8,_0x5d3b28)[_0xc53e('0xb')](function(_0xd9612){logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));logger[_0xc53e('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x2de88b,'request\x20sent',JSON[_0xc53e('0x10')](_0xd9612));if(_0xd9612['error']){if(_0xd9612['error'][_0xc53e('0x11')]===0x1f4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')]['message']);return _0x1ac6c0(_0xd9612['error'][_0xc53e('0x13')]);}logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);return _0x1616ac(_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);}else{logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));_0x1616ac(_0xd9612['result'][_0xc53e('0x13')]);}})[_0xc53e('0x14')](function(_0x535cd4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0x535cd4);_0x1ac6c0(_0x535cd4);});});}exports[_0xc53e('0x15')]=function(_0x164016){var _0x2d4ebb=this;return new Promise(function(_0x3b550e,_0x5d1098){return db['MailQueueReport'][_0xc53e('0x16')](_0x164016[_0xc53e('0x17')],{'raw':_0x164016[_0xc53e('0x18')]?_0x164016[_0xc53e('0x18')][_0xc53e('0x19')]===undefined?!![]:![]:!![]})[_0xc53e('0xb')](function(_0x15a015){logger[_0xc53e('0xc')](_0xc53e('0x15'),_0x164016);logger[_0xc53e('0xf')](_0xc53e('0x15'),_0x164016,JSON[_0xc53e('0x10')](_0x15a015));_0x3b550e(_0x15a015);})[_0xc53e('0x14')](function(_0x4fb695){logger['error']('CreateMailQueueReport',_0x4fb695[_0xc53e('0x13')],_0x164016);_0x5d1098(_0x2d4ebb[_0xc53e('0x12')](0x1f4,_0x4fb695[_0xc53e('0x13')]));});});};exports[_0xc53e('0x1a')]=function(_0x180811){var _0x5009e1=this;return new Promise(function(_0x5e5377,_0xe06e42){return db['MailQueueReport'][_0xc53e('0x1b')](_0x180811[_0xc53e('0x17')],{'raw':_0x180811[_0xc53e('0x18')]?_0x180811[_0xc53e('0x18')][_0xc53e('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x180811['options']?_0x180811[_0xc53e('0x18')]['where']||null:null,'attributes':_0x180811['options']?_0x180811['options'][_0xc53e('0x1c')]||null:null,'limit':_0x180811['options']?_0x180811[_0xc53e('0x18')]['limit']||null:null})[_0xc53e('0xb')](function(_0x5112d2){logger['info'](_0xc53e('0x1a'),_0x180811);logger[_0xc53e('0xf')](_0xc53e('0x1a'),_0x180811,JSON[_0xc53e('0x10')](_0x5112d2));_0x5e5377(_0x5112d2);})[_0xc53e('0x14')](function(_0xf97d78){logger[_0xc53e('0x12')](_0xc53e('0x1a'),_0xf97d78['message'],_0x180811);_0xe06e42(_0x5009e1[_0xc53e('0x12')](0x1f4,_0xf97d78[_0xc53e('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index f480ab9..c0f0be9 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 _0x7ef8=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','util'];(function(_0x72a4d0,_0x41a189){var _0x283c26=function(_0xb268b3){while(--_0xb268b3){_0x72a4d0['push'](_0x72a4d0['shift']());}};_0x283c26(++_0x41a189);}(_0x7ef8,0x9f));var _0x87ef=function(_0x33a13d,_0x1073ec){_0x33a13d=_0x33a13d-0x0;var _0xbf0b74=_0x7ef8[_0x33a13d];return _0xbf0b74;};'use strict';var multer=require('multer');var util=require(_0x87ef('0x0'));var path=require('path');var timeout=require(_0x87ef('0x1'));var express=require(_0x87ef('0x2'));var router=express[_0x87ef('0x3')]();var auth=require(_0x87ef('0x4'));var interaction=require(_0x87ef('0x5'));var config=require(_0x87ef('0x6'));module[_0x87ef('0x7')]=router; \ No newline at end of file +var _0x1b7a=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','util'];(function(_0x4f9e5f,_0x2185e2){var _0x27e3b3=function(_0x4bdf05){while(--_0x4bdf05){_0x4f9e5f['push'](_0x4f9e5f['shift']());}};_0x27e3b3(++_0x2185e2);}(_0x1b7a,0x136));var _0xa1b7=function(_0x2427b2,_0x39c676){_0x2427b2=_0x2427b2-0x0;var _0x44a7f5=_0x1b7a[_0x2427b2];return _0x44a7f5;};'use strict';var multer=require(_0xa1b7('0x0'));var util=require(_0xa1b7('0x1'));var path=require('path');var timeout=require(_0xa1b7('0x2'));var express=require('express');var router=express[_0xa1b7('0x3')]();var auth=require(_0xa1b7('0x4'));var interaction=require(_0xa1b7('0x5'));var config=require(_0xa1b7('0x6'));module[_0xa1b7('0x7')]=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 4370742..d7bc433 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 _0x9e3a=['exports','STRING','BOOLEAN','username','INTEGER','INBOX','sequelize'];(function(_0xe5842c,_0x5abc8f){var _0x1d896b=function(_0x53e179){while(--_0x53e179){_0xe5842c['push'](_0xe5842c['shift']());}};_0x1d896b(++_0x5abc8f);}(_0x9e3a,0x18e));var _0xa9e3=function(_0x272c6a,_0x1ec866){_0x272c6a=_0x272c6a-0x0;var _0x20c894=_0x9e3a[_0x272c6a];return _0x20c894;};'use strict';var Sequelize=require(_0xa9e3('0x0'));module[_0xa9e3('0x1')]={'description':{'type':Sequelize[_0xa9e3('0x2')]},'host':{'type':Sequelize[_0xa9e3('0x2')]},'authentication':{'type':Sequelize[_0xa9e3('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0xa9e3('0x2')],'unique':_0xa9e3('0x4')},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xa9e3('0x5')]},'tls':{'type':Sequelize[_0xa9e3('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xa9e3('0x2')],'defaultValue':_0xa9e3('0x6')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xa9e3('0x5')],'defaultValue':0x5},'service':{'type':Sequelize[_0xa9e3('0x2')]}}; \ No newline at end of file +var _0x26b5=['username','INTEGER','INBOX','sequelize','exports','STRING','BOOLEAN'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x26b5,0xdc));var _0x526b=function(_0x31ba95,_0x426f2d){_0x31ba95=_0x31ba95-0x0;var _0x5d4f23=_0x26b5[_0x31ba95];return _0x5d4f23;};'use strict';var Sequelize=require(_0x526b('0x0'));module[_0x526b('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x526b('0x2')]},'authentication':{'type':Sequelize[_0x526b('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0x526b('0x2')],'unique':_0x526b('0x4')},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x526b('0x5')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x526b('0x2')],'defaultValue':_0x526b('0x6')},'connTimeout':{'type':Sequelize[_0x526b('0x5')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x526b('0x5')],'defaultValue':0x5},'service':{'type':Sequelize[_0x526b('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index ee31ad5..553ccb5 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 _0x0598=['MailServerIn','mail_servers_in','lodash','util','api','request-promise','path','exports'];(function(_0x56f7e2,_0x145392){var _0x36240b=function(_0x216ff7){while(--_0x216ff7){_0x56f7e2['push'](_0x56f7e2['shift']());}};_0x36240b(++_0x145392);}(_0x0598,0x92));var _0x8059=function(_0x21002a,_0x3bcc10){_0x21002a=_0x21002a-0x0;var _0x43fe11=_0x0598[_0x21002a];return _0x43fe11;};'use strict';var _=require(_0x8059('0x0'));var util=require(_0x8059('0x1'));var logger=require('../../config/logger')(_0x8059('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8059('0x3'));var fs=require('fs');var path=require(_0x8059('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./mailServerIn.attributes');module[_0x8059('0x5')]=function(_0xa7d7c1,_0x512c0f){return _0xa7d7c1['define'](_0x8059('0x6'),attributes,{'tableName':_0x8059('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9354=['../../config/environment','./mailServerIn.attributes','exports','define','MailServerIn','mail_servers_in','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x5df61d,_0x158640){var _0x24cc4c=function(_0x2de006){while(--_0x2de006){_0x5df61d['push'](_0x5df61d['shift']());}};_0x24cc4c(++_0x158640);}(_0x9354,0x96));var _0x4935=function(_0x32e4de,_0x7da1c5){_0x32e4de=_0x32e4de-0x0;var _0x51ba2a=_0x9354[_0x32e4de];return _0x51ba2a;};'use strict';var _=require('lodash');var util=require(_0x4935('0x0'));var logger=require(_0x4935('0x1'))('api');var moment=require(_0x4935('0x2'));var BPromise=require(_0x4935('0x3'));var rp=require(_0x4935('0x4'));var fs=require('fs');var path=require(_0x4935('0x5'));var rimraf=require('rimraf');var config=require(_0x4935('0x6'));var attributes=require(_0x4935('0x7'));module[_0x4935('0x8')]=function(_0x2d518a,_0x263864){return _0x2d518a[_0x4935('0x9')](_0x4935('0xa'),attributes,{'tableName':_0x4935('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.rpc.js b/server/api/mailServerIn/mailServerIn.rpc.js index fcd513b..331865a 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 _0x09d8=['MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','MailServerIn','options','raw','where','attributes','limit','map','include','model','GetMailServerIn','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','MailServerIn,\x20%s,\x20%s','debug'];(function(_0x186dbf,_0x356638){var _0x378d99=function(_0x2ce906){while(--_0x2ce906){_0x186dbf['push'](_0x186dbf['shift']());}};_0x378d99(++_0x356638);}(_0x09d8,0x1c3));var _0x809d=function(_0x4b95ca,_0x2a7579){_0x4b95ca=_0x4b95ca-0x0;var _0x235987=_0x09d8[_0x4b95ca];return _0x235987;};'use strict';var _=require(_0x809d('0x0'));var util=require(_0x809d('0x1'));var moment=require(_0x809d('0x2'));var BPromise=require(_0x809d('0x3'));var rs=require(_0x809d('0x4'));var fs=require('fs');var Redis=require(_0x809d('0x5'));var db=require(_0x809d('0x6'))['db'];var utils=require(_0x809d('0x7'));var logger=require(_0x809d('0x8'))('rpc');var config=require(_0x809d('0x9'));var jayson=require(_0x809d('0xa'));var client=jayson[_0x809d('0xb')][_0x809d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x21c72c,_0x5c1bfc,_0x39920a){return new BPromise(function(_0x6c6fe4,_0x33a0dc){return client[_0x809d('0xd')](_0x21c72c,_0x39920a)[_0x809d('0xe')](function(_0x30de63){logger['info'](_0x809d('0xf'),_0x5c1bfc,'request\x20sent');logger[_0x809d('0x10')](_0x809d('0x11'),_0x5c1bfc,'request\x20sent',JSON[_0x809d('0x12')](_0x30de63));if(_0x30de63[_0x809d('0x13')]){if(_0x30de63[_0x809d('0x13')][_0x809d('0x14')]===0x1f4){logger['error'](_0x809d('0xf'),_0x5c1bfc,_0x30de63[_0x809d('0x13')][_0x809d('0x15')]);return _0x33a0dc(_0x30de63[_0x809d('0x13')][_0x809d('0x15')]);}logger[_0x809d('0x13')](_0x809d('0xf'),_0x5c1bfc,_0x30de63['error'][_0x809d('0x15')]);return _0x6c6fe4(_0x30de63[_0x809d('0x13')]['message']);}else{logger[_0x809d('0x16')](_0x809d('0xf'),_0x5c1bfc,_0x809d('0x17'));_0x6c6fe4(_0x30de63[_0x809d('0x18')][_0x809d('0x15')]);}})[_0x809d('0x19')](function(_0x4da8ef){logger[_0x809d('0x13')]('MailServerIn,\x20%s,\x20%s',_0x5c1bfc,_0x4da8ef);_0x33a0dc(_0x4da8ef);});});}exports['GetMailServerIn']=function(_0x2ad088){var _0x4838b2=this;return new Promise(function(_0x16e9c0,_0x476a38){return db[_0x809d('0x1a')]['findAll']({'raw':_0x2ad088[_0x809d('0x1b')]?_0x2ad088[_0x809d('0x1b')][_0x809d('0x1c')]===undefined?!![]:![]:!![],'where':_0x2ad088['options']?_0x2ad088[_0x809d('0x1b')][_0x809d('0x1d')]||null:null,'attributes':_0x2ad088['options']?_0x2ad088['options'][_0x809d('0x1e')]||null:null,'limit':_0x2ad088['options']?_0x2ad088[_0x809d('0x1b')][_0x809d('0x1f')]||null:null,'include':_0x2ad088['options']?_0x2ad088['options']['include']?_[_0x809d('0x20')](_0x2ad088['options']['include'],function(_0x3774a0){return{'model':db[_0x3774a0['model']],'as':_0x3774a0['as'],'attributes':_0x3774a0[_0x809d('0x1e')],'include':_0x3774a0[_0x809d('0x21')]?_[_0x809d('0x20')](_0x3774a0[_0x809d('0x21')],function(_0xcb6051){return{'model':db[_0xcb6051[_0x809d('0x22')]],'as':_0xcb6051['as'],'attributes':_0xcb6051[_0x809d('0x1e')],'include':_0xcb6051[_0x809d('0x21')]?_['map'](_0xcb6051[_0x809d('0x21')],function(_0xec9cc0){return{'model':db[_0xec9cc0['model']],'as':_0xec9cc0['as'],'attributes':_0xec9cc0['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x158db1){logger[_0x809d('0x16')]('GetMailServerIn',_0x2ad088);logger[_0x809d('0x10')](_0x809d('0x23'),_0x2ad088,JSON['stringify'](_0x158db1));_0x16e9c0(_0x158db1);})[_0x809d('0x19')](function(_0x1c125d){logger[_0x809d('0x13')](_0x809d('0x23'),_0x1c125d['message'],_0x2ad088);_0x476a38(_0x4838b2['error'](0x1f4,_0x1c125d['message']));});});}; \ No newline at end of file +var _0xa76b=['GetMailServerIn','findAll','options','raw','where','attributes','limit','include','map','model','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','MailServerIn,\x20%s,\x20%s','message','result','catch'];(function(_0xf382e5,_0x4c8690){var _0x3272b6=function(_0x42a6d2){while(--_0x42a6d2){_0xf382e5['push'](_0xf382e5['shift']());}};_0x3272b6(++_0x4c8690);}(_0xa76b,0xf1));var _0xba76=function(_0x2e9bc1,_0x39e39b){_0x2e9bc1=_0x2e9bc1-0x0;var _0x5db1bb=_0xa76b[_0x2e9bc1];return _0x5db1bb;};'use strict';var _=require(_0xba76('0x0'));var util=require(_0xba76('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xba76('0x2'));var fs=require('fs');var Redis=require(_0xba76('0x3'));var db=require(_0xba76('0x4'))['db'];var utils=require(_0xba76('0x5'));var logger=require(_0xba76('0x6'))('rpc');var config=require(_0xba76('0x7'));var jayson=require(_0xba76('0x8'));var client=jayson['client'][_0xba76('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x51f67d,_0x107508,_0x4fd82f){return new BPromise(function(_0x329025,_0x2ec07f){return client[_0xba76('0xa')](_0x51f67d,_0x4fd82f)[_0xba76('0xb')](function(_0x394d85){logger[_0xba76('0xc')]('MailServerIn,\x20%s,\x20%s',_0x107508,_0xba76('0xd'));logger[_0xba76('0xe')](_0xba76('0xf'),_0x107508,_0xba76('0xd'),JSON[_0xba76('0x10')](_0x394d85));if(_0x394d85[_0xba76('0x11')]){if(_0x394d85[_0xba76('0x11')][_0xba76('0x12')]===0x1f4){logger[_0xba76('0x11')](_0xba76('0x13'),_0x107508,_0x394d85[_0xba76('0x11')][_0xba76('0x14')]);return _0x2ec07f(_0x394d85[_0xba76('0x11')][_0xba76('0x14')]);}logger['error'](_0xba76('0x13'),_0x107508,_0x394d85[_0xba76('0x11')][_0xba76('0x14')]);return _0x329025(_0x394d85[_0xba76('0x11')][_0xba76('0x14')]);}else{logger[_0xba76('0xc')](_0xba76('0x13'),_0x107508,_0xba76('0xd'));_0x329025(_0x394d85[_0xba76('0x15')]['message']);}})[_0xba76('0x16')](function(_0x4fde01){logger[_0xba76('0x11')]('MailServerIn,\x20%s,\x20%s',_0x107508,_0x4fde01);_0x2ec07f(_0x4fde01);});});}exports[_0xba76('0x17')]=function(_0x5870a0){var _0x8e5b68=this;return new Promise(function(_0x4547b2,_0x1dc83b){return db['MailServerIn'][_0xba76('0x18')]({'raw':_0x5870a0[_0xba76('0x19')]?_0x5870a0[_0xba76('0x19')][_0xba76('0x1a')]===undefined?!![]:![]:!![],'where':_0x5870a0[_0xba76('0x19')]?_0x5870a0[_0xba76('0x19')][_0xba76('0x1b')]||null:null,'attributes':_0x5870a0[_0xba76('0x19')]?_0x5870a0['options'][_0xba76('0x1c')]||null:null,'limit':_0x5870a0[_0xba76('0x19')]?_0x5870a0['options'][_0xba76('0x1d')]||null:null,'include':_0x5870a0[_0xba76('0x19')]?_0x5870a0[_0xba76('0x19')][_0xba76('0x1e')]?_[_0xba76('0x1f')](_0x5870a0[_0xba76('0x19')][_0xba76('0x1e')],function(_0x71b733){return{'model':db[_0x71b733[_0xba76('0x20')]],'as':_0x71b733['as'],'attributes':_0x71b733[_0xba76('0x1c')],'include':_0x71b733[_0xba76('0x1e')]?_['map'](_0x71b733[_0xba76('0x1e')],function(_0x6dc011){return{'model':db[_0x6dc011[_0xba76('0x20')]],'as':_0x6dc011['as'],'attributes':_0x6dc011[_0xba76('0x1c')],'include':_0x6dc011[_0xba76('0x1e')]?_[_0xba76('0x1f')](_0x6dc011[_0xba76('0x1e')],function(_0xbc1119){return{'model':db[_0xbc1119[_0xba76('0x20')]],'as':_0xbc1119['as'],'attributes':_0xbc1119[_0xba76('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xba76('0xb')](function(_0x59c13c){logger['info'](_0xba76('0x17'),_0x5870a0);logger[_0xba76('0xe')]('GetMailServerIn',_0x5870a0,JSON[_0xba76('0x10')](_0x59c13c));_0x4547b2(_0x59c13c);})[_0xba76('0x16')](function(_0x3b78f9){logger[_0xba76('0x11')](_0xba76('0x17'),_0x3b78f9[_0xba76('0x14')],_0x5870a0);_0x1dc83b(_0x8e5b68['error'](0x1f4,_0x3b78f9[_0xba76('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 984fabe..74d3852 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 _0x8390=['../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0x8390,0xfe));var _0x0839=function(_0x44a3b0,_0x352810){_0x44a3b0=_0x44a3b0-0x0;var _0x39e6f6=_0x8390[_0x44a3b0];return _0x39e6f6;};'use strict';var multer=require(_0x0839('0x0'));var util=require(_0x0839('0x1'));var path=require(_0x0839('0x2'));var timeout=require(_0x0839('0x3'));var express=require(_0x0839('0x4'));var router=express[_0x0839('0x5')]();var auth=require(_0x0839('0x6'));var interaction=require(_0x0839('0x7'));var config=require('../../config/environment');var controller=require('./mailServerOut.controller');router[_0x0839('0x8')]('/',auth[_0x0839('0x9')](),controller[_0x0839('0xa')]);router['get'](_0x0839('0xb'),auth[_0x0839('0x9')](),controller[_0x0839('0xc')]);router[_0x0839('0xd')]('/',auth[_0x0839('0x9')](),controller[_0x0839('0xe')]);router[_0x0839('0xf')](_0x0839('0xb'),auth['isAuthenticated'](),controller[_0x0839('0x10')]);router[_0x0839('0x11')](_0x0839('0xb'),auth['isAuthenticated'](),controller[_0x0839('0x12')]);module[_0x0839('0x13')]=router; \ No newline at end of file +var _0x0ed6=['/:id','update','destroy','exports','multer','path','Router','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get','isAuthenticated','index','show','post','create','put'];(function(_0x424a9a,_0x2dd9af){var _0xa7831c=function(_0x512534){while(--_0x512534){_0x424a9a['push'](_0x424a9a['shift']());}};_0xa7831c(++_0x2dd9af);}(_0x0ed6,0x1ad));var _0x60ed=function(_0x59f288,_0x4ae5e3){_0x59f288=_0x59f288-0x0;var _0x56a9f3=_0x0ed6[_0x59f288];return _0x56a9f3;};'use strict';var multer=require(_0x60ed('0x0'));var util=require('util');var path=require(_0x60ed('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x60ed('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0x60ed('0x3'));var config=require(_0x60ed('0x4'));var controller=require(_0x60ed('0x5'));router[_0x60ed('0x6')]('/',auth[_0x60ed('0x7')](),controller[_0x60ed('0x8')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x60ed('0x9')]);router[_0x60ed('0xa')]('/',auth['isAuthenticated'](),controller[_0x60ed('0xb')]);router[_0x60ed('0xc')](_0x60ed('0xd'),auth[_0x60ed('0x7')](),controller[_0x60ed('0xe')]);router['delete'](_0x60ed('0xd'),auth[_0x60ed('0x7')](),controller[_0x60ed('0xf')]);module[_0x60ed('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index d653654..6c56a53 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 _0x8ace=['exports','STRING','INTEGER','BOOLEAN','sequelize'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0x8ace,0x1bc));var _0xe8ac=function(_0x330ac6,_0x3adc83){_0x330ac6=_0x330ac6-0x0;var _0x59b845=_0x8ace[_0x330ac6];return _0x59b845;};'use strict';var Sequelize=require(_0xe8ac('0x0'));module[_0xe8ac('0x1')]={'description':{'type':Sequelize[_0xe8ac('0x2')]},'host':{'type':Sequelize[_0xe8ac('0x2')]},'user':{'type':Sequelize[_0xe8ac('0x2')]},'pass':{'type':Sequelize[_0xe8ac('0x2')]},'port':{'type':Sequelize[_0xe8ac('0x3')]},'secure':{'type':Sequelize[_0xe8ac('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0xe8ac('0x2')]},'authentication':{'type':Sequelize[_0xe8ac('0x4')],'defaultValue':!![]}}; \ No newline at end of file +var _0xd0c9=['BOOLEAN','sequelize','exports','STRING','INTEGER'];(function(_0x175f36,_0x5a05ec){var _0x623b87=function(_0x1af77d){while(--_0x1af77d){_0x175f36['push'](_0x175f36['shift']());}};_0x623b87(++_0x5a05ec);}(_0xd0c9,0xe2));var _0x9d0c=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0xd0c9[_0x1589dd];return _0x1bddd1;};'use strict';var Sequelize=require(_0x9d0c('0x0'));module[_0x9d0c('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0x9d0c('0x2')]},'port':{'type':Sequelize[_0x9d0c('0x3')]},'secure':{'type':Sequelize[_0x9d0c('0x4')],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x9d0c('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 5ceff1d..848f8ec 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 _0x7876=['merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','options','find','create','body','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','limit','status','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','map','MailServerOut','rawAttributes','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filter','where'];(function(_0x587693,_0x27fe90){var _0x510a1a=function(_0x290f71){while(--_0x290f71){_0x587693['push'](_0x587693['shift']());}};_0x510a1a(++_0x27fe90);}(_0x7876,0x194));var _0x6787=function(_0x3da832,_0x2133f1){_0x3da832=_0x3da832-0x0;var _0xe602f2=_0x7876[_0x3da832];return _0xe602f2;};'use strict';var pdf=require(_0x6787('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x6787('0x1'));var zipdir=require(_0x6787('0x2'));var jsonpatch=require(_0x6787('0x3'));var rp=require(_0x6787('0x4'));var moment=require(_0x6787('0x5'));var BPromise=require(_0x6787('0x6'));var Mustache=require(_0x6787('0x7'));var util=require(_0x6787('0x8'));var path=require(_0x6787('0x9'));var sox=require(_0x6787('0xa'));var csv=require(_0x6787('0xb'));var ejs=require(_0x6787('0xc'));var fs=require('fs');var _=require(_0x6787('0xd'));var squel=require(_0x6787('0xe'));var crypto=require(_0x6787('0xf'));var jsforce=require(_0x6787('0x10'));var deskjs=require(_0x6787('0x11'));var toCsv=require(_0x6787('0xb'));var querystring=require(_0x6787('0x12'));var Papa=require(_0x6787('0x13'));var Redis=require(_0x6787('0x14'));var authService=require(_0x6787('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0x6787('0x16'));var hardwareService=require(_0x6787('0x17'));var logger=require('../../config/logger')(_0x6787('0x18'));var utils=require(_0x6787('0x19'));var config=require(_0x6787('0x1a'));var db=require(_0x6787('0x1b'))['db'];function respondWithStatusCode(_0x6897a2,_0x1ff97f){_0x1ff97f=_0x1ff97f||0xcc;return function(_0x3bcde1){if(_0x3bcde1){return _0x6897a2[_0x6787('0x1c')](_0x1ff97f);}return _0x6897a2['status'](_0x1ff97f)[_0x6787('0x1d')]();};}function respondWithResult(_0x59ab9c,_0x22ae6a){_0x22ae6a=_0x22ae6a||0xc8;return function(_0x6e24a0){if(_0x6e24a0){return _0x59ab9c['status'](_0x22ae6a)[_0x6787('0x1e')](_0x6e24a0);}};}function respondWithFilteredResult(_0x36d4f4,_0x5de71b){return function(_0x534d5){if(_0x534d5){var _0xa8eac=_0x534d5[_0x6787('0x1f')],_0x534950=_0x5de71b['offset'],_0x48f730=_0x5de71b[_0x6787('0x20')]+_0x5de71b[_0x6787('0x21')],_0x17be2e;if(_0x48f730>=_0xa8eac){_0x48f730=_0xa8eac;_0x17be2e=0xc8;}else{_0x17be2e=0xce;}_0x36d4f4[_0x6787('0x22')](_0x17be2e);return _0x36d4f4[_0x6787('0x23')](_0x6787('0x24'),_0x534950+'-'+_0x48f730+'/'+_0xa8eac)['json'](_0x534d5);}return null;};}function patchUpdates(_0x2ce47c){return function(_0x5bd1a7){try{jsonpatch[_0x6787('0x25')](_0x5bd1a7,_0x2ce47c,!![]);}catch(_0x51bd33){return BPromise[_0x6787('0x26')](_0x51bd33);}return _0x5bd1a7[_0x6787('0x27')]();};}function saveUpdates(_0x19cdbc,_0x211ac7){return function(_0x105298){if(_0x105298){return _0x105298[_0x6787('0x28')](_0x19cdbc)[_0x6787('0x29')](function(_0x56f6a1){return _0x56f6a1;});}return null;};}function removeEntity(_0x583164,_0x334039){return function(_0x527de9){if(_0x527de9){return _0x527de9[_0x6787('0x2a')]()[_0x6787('0x29')](function(){_0x583164['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3bc387,_0x29c6c1){return function(_0x29f75e){if(!_0x29f75e){_0x3bc387['sendStatus'](0x194);}return _0x29f75e;};}function handleError(_0x182f85,_0x8c7818){_0x8c7818=_0x8c7818||0x1f4;return function(_0x1b6dfb){logger[_0x6787('0x2b')](_0x1b6dfb['stack']);if(_0x1b6dfb['name']){delete _0x1b6dfb[_0x6787('0x2c')];}_0x182f85[_0x6787('0x22')](_0x8c7818)[_0x6787('0x2d')](_0x1b6dfb);};}exports['index']=function(_0x5e3a8e,_0x39db67){var _0x476ed1={},_0x49d14a={},_0x50a3fd={'count':0x0,'rows':[]};var _0x55bdf5=_[_0x6787('0x2e')](db[_0x6787('0x2f')][_0x6787('0x30')],function(_0x51da7c){return{'name':_0x51da7c['fieldName'],'type':_0x51da7c[_0x6787('0x31')][_0x6787('0x32')]};});_0x49d14a[_0x6787('0x33')]=_[_0x6787('0x2e')](_0x55bdf5,_0x6787('0x2c'));_0x49d14a[_0x6787('0x34')]=_['keys'](_0x5e3a8e[_0x6787('0x34')]);_0x49d14a[_0x6787('0x35')]=_['intersection'](_0x49d14a[_0x6787('0x33')],_0x49d14a['query']);_0x476ed1[_0x6787('0x36')]=_[_0x6787('0x37')](_0x49d14a[_0x6787('0x33')],qs[_0x6787('0x38')](_0x5e3a8e[_0x6787('0x34')]['fields']));_0x476ed1[_0x6787('0x36')]=_0x476ed1['attributes'][_0x6787('0x39')]?_0x476ed1[_0x6787('0x36')]:_0x49d14a[_0x6787('0x33')];if(!_0x5e3a8e[_0x6787('0x34')][_0x6787('0x3a')](_0x6787('0x3b'))){_0x476ed1[_0x6787('0x21')]=qs[_0x6787('0x21')](_0x5e3a8e[_0x6787('0x34')][_0x6787('0x21')]);_0x476ed1[_0x6787('0x20')]=qs['offset'](_0x5e3a8e[_0x6787('0x34')][_0x6787('0x20')]);}_0x476ed1[_0x6787('0x3c')]=qs[_0x6787('0x3d')](_0x5e3a8e['query'][_0x6787('0x3d')]);_0x476ed1['where']=qs[_0x6787('0x35')](_['pick'](_0x5e3a8e[_0x6787('0x34')],_0x49d14a[_0x6787('0x35')]));if(_0x5e3a8e[_0x6787('0x34')][_0x6787('0x3e')]){_0x476ed1[_0x6787('0x3f')]=_[_0x6787('0x40')](_0x476ed1[_0x6787('0x3f')],{'$or':_['map'](_0x55bdf5,function(_0x3c5f93){if(_0x3c5f93['type']!==_0x6787('0x41')){var _0x2fc742={};_0x2fc742[_0x3c5f93[_0x6787('0x2c')]]={'$like':'%'+_0x5e3a8e[_0x6787('0x34')][_0x6787('0x3e')]+'%'};return _0x2fc742;}})});}_0x476ed1=_[_0x6787('0x40')]({},_0x476ed1,_0x5e3a8e['options']);var _0x2e9396={'where':_0x476ed1[_0x6787('0x3f')]};return db[_0x6787('0x2f')][_0x6787('0x1f')](_0x2e9396)[_0x6787('0x29')](function(_0x139f82){_0x50a3fd[_0x6787('0x1f')]=_0x139f82;if(_0x5e3a8e[_0x6787('0x34')][_0x6787('0x42')]){_0x476ed1[_0x6787('0x43')]=[{'all':!![]}];}return db['MailServerOut'][_0x6787('0x44')](_0x476ed1);})[_0x6787('0x29')](function(_0x3634e1){_0x50a3fd[_0x6787('0x45')]=_0x3634e1;return _0x50a3fd;})[_0x6787('0x29')](respondWithFilteredResult(_0x39db67,_0x476ed1))[_0x6787('0x46')](handleError(_0x39db67,null));};exports[_0x6787('0x47')]=function(_0x35f7b,_0x27b20f){var _0x1600d1={'raw':!![],'where':{'id':_0x35f7b[_0x6787('0x48')]['id']}},_0x387f2e={};_0x387f2e[_0x6787('0x33')]=_['keys'](db[_0x6787('0x2f')][_0x6787('0x30')]);_0x387f2e[_0x6787('0x34')]=_[_0x6787('0x49')](_0x35f7b[_0x6787('0x34')]);_0x387f2e[_0x6787('0x35')]=_[_0x6787('0x37')](_0x387f2e['model'],_0x387f2e[_0x6787('0x34')]);_0x1600d1[_0x6787('0x36')]=_[_0x6787('0x37')](_0x387f2e[_0x6787('0x33')],qs[_0x6787('0x38')](_0x35f7b[_0x6787('0x34')][_0x6787('0x38')]));_0x1600d1[_0x6787('0x36')]=_0x1600d1[_0x6787('0x36')][_0x6787('0x39')]?_0x1600d1[_0x6787('0x36')]:_0x387f2e[_0x6787('0x33')];if(_0x35f7b['query'][_0x6787('0x42')]){_0x1600d1[_0x6787('0x43')]=[{'all':!![]}];}_0x1600d1=_[_0x6787('0x40')]({},_0x1600d1,_0x35f7b[_0x6787('0x4a')]);return db['MailServerOut'][_0x6787('0x4b')](_0x1600d1)['then'](handleEntityNotFound(_0x27b20f,null))[_0x6787('0x29')](respondWithResult(_0x27b20f,null))['catch'](handleError(_0x27b20f,null));};exports[_0x6787('0x4c')]=function(_0x4951bf,_0xa872){return db[_0x6787('0x2f')][_0x6787('0x4c')](_0x4951bf[_0x6787('0x4d')],{})[_0x6787('0x29')](respondWithResult(_0xa872,0xc9))[_0x6787('0x46')](handleError(_0xa872,null));};exports[_0x6787('0x28')]=function(_0xdeffb9,_0x1e6a33){if(_0xdeffb9['body']['id']){delete _0xdeffb9[_0x6787('0x4d')]['id'];}return db[_0x6787('0x2f')][_0x6787('0x4b')]({'where':{'id':_0xdeffb9[_0x6787('0x48')]['id']}})[_0x6787('0x29')](handleEntityNotFound(_0x1e6a33,null))['then'](saveUpdates(_0xdeffb9[_0x6787('0x4d')],null))['then'](respondWithResult(_0x1e6a33,null))[_0x6787('0x46')](handleError(_0x1e6a33,null));};exports['destroy']=function(_0x3a455b,_0x29c2dc){return db[_0x6787('0x2f')][_0x6787('0x4b')]({'where':{'id':_0x3a455b[_0x6787('0x48')]['id']}})[_0x6787('0x29')](handleEntityNotFound(_0x29c2dc,null))[_0x6787('0x29')](removeEntity(_0x29c2dc,null))[_0x6787('0x46')](handleError(_0x29c2dc,null));}; \ No newline at end of file +var _0xa4a3=['where','pick','filter','merge','VIRTUAL','options','include','findAll','params','keys','includeAll','body','catch','find','html-pdf','eml-format','rimraf','zip-dir','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','../../config/logger','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','end','stack','name','send','index','map','MailServerOut','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort'];(function(_0x3d5add,_0x1b5ddf){var _0x4e2119=function(_0x25129e){while(--_0x25129e){_0x3d5add['push'](_0x3d5add['shift']());}};_0x4e2119(++_0x1b5ddf);}(_0xa4a3,0xe3));var _0x3a4a=function(_0x1881ac,_0x57ecf4){_0x1881ac=_0x1881ac-0x0;var _0x3b966e=_0xa4a3[_0x1881ac];return _0x3b966e;};'use strict';var pdf=require(_0x3a4a('0x0'));var emlformat=require(_0x3a4a('0x1'));var rimraf=require(_0x3a4a('0x2'));var zipdir=require(_0x3a4a('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3a4a('0x4'));var moment=require(_0x3a4a('0x5'));var BPromise=require(_0x3a4a('0x6'));var Mustache=require(_0x3a4a('0x7'));var util=require(_0x3a4a('0x8'));var path=require(_0x3a4a('0x9'));var sox=require(_0x3a4a('0xa'));var csv=require(_0x3a4a('0xb'));var ejs=require(_0x3a4a('0xc'));var fs=require('fs');var _=require(_0x3a4a('0xd'));var squel=require(_0x3a4a('0xe'));var crypto=require(_0x3a4a('0xf'));var jsforce=require(_0x3a4a('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x3a4a('0xb'));var querystring=require(_0x3a4a('0x11'));var Papa=require(_0x3a4a('0x12'));var Redis=require(_0x3a4a('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x3a4a('0x14'));var as=require(_0x3a4a('0x15'));var hardwareService=require(_0x3a4a('0x16'));var logger=require(_0x3a4a('0x17'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x3a4a('0x18'))['db'];function respondWithStatusCode(_0x19789c,_0x512d5b){_0x512d5b=_0x512d5b||0xcc;return function(_0x5124bf){if(_0x5124bf){return _0x19789c[_0x3a4a('0x19')](_0x512d5b);}return _0x19789c[_0x3a4a('0x1a')](_0x512d5b)['end']();};}function respondWithResult(_0x30dd45,_0x119bec){_0x119bec=_0x119bec||0xc8;return function(_0x1856fe){if(_0x1856fe){return _0x30dd45[_0x3a4a('0x1a')](_0x119bec)[_0x3a4a('0x1b')](_0x1856fe);}};}function respondWithFilteredResult(_0x5b37ad,_0x467615){return function(_0x7a9468){if(_0x7a9468){var _0x108afb=_0x7a9468[_0x3a4a('0x1c')],_0x4b5399=_0x467615[_0x3a4a('0x1d')],_0x49c1c5=_0x467615['offset']+_0x467615[_0x3a4a('0x1e')],_0x45d4fa;if(_0x49c1c5>=_0x108afb){_0x49c1c5=_0x108afb;_0x45d4fa=0xc8;}else{_0x45d4fa=0xce;}_0x5b37ad['status'](_0x45d4fa);return _0x5b37ad[_0x3a4a('0x1f')](_0x3a4a('0x20'),_0x4b5399+'-'+_0x49c1c5+'/'+_0x108afb)[_0x3a4a('0x1b')](_0x7a9468);}return null;};}function patchUpdates(_0x10f243){return function(_0x55f04b){try{jsonpatch[_0x3a4a('0x21')](_0x55f04b,_0x10f243,!![]);}catch(_0x52444e){return BPromise[_0x3a4a('0x22')](_0x52444e);}return _0x55f04b['save']();};}function saveUpdates(_0x46be1d,_0x15ddde){return function(_0xf0bcba){if(_0xf0bcba){return _0xf0bcba[_0x3a4a('0x23')](_0x46be1d)[_0x3a4a('0x24')](function(_0x1b32e3){return _0x1b32e3;});}return null;};}function removeEntity(_0xafc688,_0x533c63){return function(_0x569416){if(_0x569416){return _0x569416[_0x3a4a('0x25')]()['then'](function(){_0xafc688[_0x3a4a('0x1a')](0xcc)[_0x3a4a('0x26')]();});}};}function handleEntityNotFound(_0x286cd6,_0x2f9bce){return function(_0x5ce6eb){if(!_0x5ce6eb){_0x286cd6[_0x3a4a('0x19')](0x194);}return _0x5ce6eb;};}function handleError(_0x42a64d,_0xd7edb6){_0xd7edb6=_0xd7edb6||0x1f4;return function(_0xebb42e){logger['error'](_0xebb42e[_0x3a4a('0x27')]);if(_0xebb42e[_0x3a4a('0x28')]){delete _0xebb42e[_0x3a4a('0x28')];}_0x42a64d[_0x3a4a('0x1a')](_0xd7edb6)[_0x3a4a('0x29')](_0xebb42e);};}exports[_0x3a4a('0x2a')]=function(_0x2ddbd2,_0x44f1e3){var _0x44bbbc={},_0x504f2f={},_0x4dbbaa={'count':0x0,'rows':[]};var _0x3a7264=_[_0x3a4a('0x2b')](db[_0x3a4a('0x2c')][_0x3a4a('0x2d')],function(_0x390342){return{'name':_0x390342['fieldName'],'type':_0x390342[_0x3a4a('0x2e')][_0x3a4a('0x2f')]};});_0x504f2f[_0x3a4a('0x30')]=_[_0x3a4a('0x2b')](_0x3a7264,'name');_0x504f2f[_0x3a4a('0x31')]=_['keys'](_0x2ddbd2[_0x3a4a('0x31')]);_0x504f2f[_0x3a4a('0x32')]=_[_0x3a4a('0x33')](_0x504f2f[_0x3a4a('0x30')],_0x504f2f[_0x3a4a('0x31')]);_0x44bbbc[_0x3a4a('0x34')]=_[_0x3a4a('0x33')](_0x504f2f[_0x3a4a('0x30')],qs['fields'](_0x2ddbd2[_0x3a4a('0x31')][_0x3a4a('0x35')]));_0x44bbbc[_0x3a4a('0x34')]=_0x44bbbc[_0x3a4a('0x34')]['length']?_0x44bbbc['attributes']:_0x504f2f[_0x3a4a('0x30')];if(!_0x2ddbd2[_0x3a4a('0x31')][_0x3a4a('0x36')](_0x3a4a('0x37'))){_0x44bbbc[_0x3a4a('0x1e')]=qs[_0x3a4a('0x1e')](_0x2ddbd2[_0x3a4a('0x31')][_0x3a4a('0x1e')]);_0x44bbbc[_0x3a4a('0x1d')]=qs['offset'](_0x2ddbd2[_0x3a4a('0x31')][_0x3a4a('0x1d')]);}_0x44bbbc['order']=qs[_0x3a4a('0x38')](_0x2ddbd2[_0x3a4a('0x31')][_0x3a4a('0x38')]);_0x44bbbc[_0x3a4a('0x39')]=qs['filters'](_[_0x3a4a('0x3a')](_0x2ddbd2[_0x3a4a('0x31')],_0x504f2f[_0x3a4a('0x32')]));if(_0x2ddbd2['query'][_0x3a4a('0x3b')]){_0x44bbbc[_0x3a4a('0x39')]=_[_0x3a4a('0x3c')](_0x44bbbc[_0x3a4a('0x39')],{'$or':_['map'](_0x3a7264,function(_0x4e5e2f){if(_0x4e5e2f[_0x3a4a('0x2e')]!==_0x3a4a('0x3d')){var _0x23cfb2={};_0x23cfb2[_0x4e5e2f[_0x3a4a('0x28')]]={'$like':'%'+_0x2ddbd2[_0x3a4a('0x31')][_0x3a4a('0x3b')]+'%'};return _0x23cfb2;}})});}_0x44bbbc=_[_0x3a4a('0x3c')]({},_0x44bbbc,_0x2ddbd2[_0x3a4a('0x3e')]);var _0x20e0fa={'where':_0x44bbbc[_0x3a4a('0x39')]};return db['MailServerOut'][_0x3a4a('0x1c')](_0x20e0fa)[_0x3a4a('0x24')](function(_0x2527fa){_0x4dbbaa[_0x3a4a('0x1c')]=_0x2527fa;if(_0x2ddbd2[_0x3a4a('0x31')]['includeAll']){_0x44bbbc[_0x3a4a('0x3f')]=[{'all':!![]}];}return db['MailServerOut'][_0x3a4a('0x40')](_0x44bbbc);})['then'](function(_0x432289){_0x4dbbaa['rows']=_0x432289;return _0x4dbbaa;})['then'](respondWithFilteredResult(_0x44f1e3,_0x44bbbc))['catch'](handleError(_0x44f1e3,null));};exports['show']=function(_0x477ce3,_0x5b9dde){var _0x1844af={'raw':!![],'where':{'id':_0x477ce3[_0x3a4a('0x41')]['id']}},_0x3580dc={};_0x3580dc['model']=_['keys'](db['MailServerOut'][_0x3a4a('0x2d')]);_0x3580dc[_0x3a4a('0x31')]=_[_0x3a4a('0x42')](_0x477ce3['query']);_0x3580dc['filters']=_[_0x3a4a('0x33')](_0x3580dc[_0x3a4a('0x30')],_0x3580dc[_0x3a4a('0x31')]);_0x1844af[_0x3a4a('0x34')]=_[_0x3a4a('0x33')](_0x3580dc['model'],qs[_0x3a4a('0x35')](_0x477ce3[_0x3a4a('0x31')][_0x3a4a('0x35')]));_0x1844af[_0x3a4a('0x34')]=_0x1844af[_0x3a4a('0x34')]['length']?_0x1844af['attributes']:_0x3580dc['model'];if(_0x477ce3[_0x3a4a('0x31')][_0x3a4a('0x43')]){_0x1844af[_0x3a4a('0x3f')]=[{'all':!![]}];}_0x1844af=_[_0x3a4a('0x3c')]({},_0x1844af,_0x477ce3[_0x3a4a('0x3e')]);return db[_0x3a4a('0x2c')]['find'](_0x1844af)[_0x3a4a('0x24')](handleEntityNotFound(_0x5b9dde,null))[_0x3a4a('0x24')](respondWithResult(_0x5b9dde,null))['catch'](handleError(_0x5b9dde,null));};exports['create']=function(_0x4d588a,_0x1f2ca4){return db[_0x3a4a('0x2c')]['create'](_0x4d588a[_0x3a4a('0x44')],{})[_0x3a4a('0x24')](respondWithResult(_0x1f2ca4,0xc9))[_0x3a4a('0x45')](handleError(_0x1f2ca4,null));};exports[_0x3a4a('0x23')]=function(_0x3088da,_0x363fae){if(_0x3088da['body']['id']){delete _0x3088da[_0x3a4a('0x44')]['id'];}return db[_0x3a4a('0x2c')]['find']({'where':{'id':_0x3088da[_0x3a4a('0x41')]['id']}})[_0x3a4a('0x24')](handleEntityNotFound(_0x363fae,null))[_0x3a4a('0x24')](saveUpdates(_0x3088da[_0x3a4a('0x44')],null))['then'](respondWithResult(_0x363fae,null))[_0x3a4a('0x45')](handleError(_0x363fae,null));};exports['destroy']=function(_0xbbe78b,_0x6b47d2){return db[_0x3a4a('0x2c')][_0x3a4a('0x46')]({'where':{'id':_0xbbe78b[_0x3a4a('0x41')]['id']}})[_0x3a4a('0x24')](handleEntityNotFound(_0x6b47d2,null))[_0x3a4a('0x24')](removeEntity(_0x6b47d2,null))[_0x3a4a('0x45')](handleError(_0x6b47d2,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 73bc25a..6384b69 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 _0x814b=['define','MailServerOut','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./mailServerOut.attributes','exports'];(function(_0x5bb908,_0xc4dc33){var _0x3943ff=function(_0x439849){while(--_0x439849){_0x5bb908['push'](_0x5bb908['shift']());}};_0x3943ff(++_0xc4dc33);}(_0x814b,0x1a2));var _0xb814=function(_0x350182,_0x2a9feb){_0x350182=_0x350182-0x0;var _0x4a0892=_0x814b[_0x350182];return _0x4a0892;};'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':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x24ca=['MailServerOut','mail_servers_out','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./mailServerOut.attributes','exports','define'];(function(_0x5e3f8d,_0x3cd4b0){var _0x438259=function(_0x22ee14){while(--_0x22ee14){_0x5e3f8d['push'](_0x5e3f8d['shift']());}};_0x438259(++_0x3cd4b0);}(_0x24ca,0x1bc));var _0xa24c=function(_0x3da612,_0x332456){_0x3da612=_0x3da612-0x0;var _0x1a9d1d=_0x24ca[_0x3da612];return _0x1a9d1d;};'use strict';var _=require(_0xa24c('0x0'));var util=require('util');var logger=require(_0xa24c('0x1'))(_0xa24c('0x2'));var moment=require(_0xa24c('0x3'));var BPromise=require('bluebird');var rp=require(_0xa24c('0x4'));var fs=require('fs');var path=require(_0xa24c('0x5'));var rimraf=require(_0xa24c('0x6'));var config=require(_0xa24c('0x7'));var attributes=require(_0xa24c('0x8'));module[_0xa24c('0x9')]=function(_0xf0511,_0x3c0aaa){return _0xf0511[_0xa24c('0xa')](_0xa24c('0xb'),attributes,{'tableName':_0xa24c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index 92dc022..f97b80d 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 _0x5ab2=['info','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','MailServerOut,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0x212716,_0x45a7a3){var _0x1a0df4=function(_0x17919c){while(--_0x17919c){_0x212716['push'](_0x212716['shift']());}};_0x1a0df4(++_0x45a7a3);}(_0x5ab2,0xeb));var _0x25ab=function(_0x16a992,_0x4dd40a){_0x16a992=_0x16a992-0x0;var _0x3010c9=_0x5ab2[_0x16a992];return _0x3010c9;};'use strict';var _=require(_0x25ab('0x0'));var util=require(_0x25ab('0x1'));var moment=require(_0x25ab('0x2'));var BPromise=require(_0x25ab('0x3'));var rs=require(_0x25ab('0x4'));var fs=require('fs');var Redis=require(_0x25ab('0x5'));var db=require(_0x25ab('0x6'))['db'];var utils=require(_0x25ab('0x7'));var logger=require(_0x25ab('0x8'))(_0x25ab('0x9'));var config=require('../../config/environment');var jayson=require(_0x25ab('0xa'));var client=jayson[_0x25ab('0xb')][_0x25ab('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x43f15e,_0x3ef8cb,_0x4bcc51){return new BPromise(function(_0x1faffc,_0x45c88b){return client[_0x25ab('0xd')](_0x43f15e,_0x4bcc51)[_0x25ab('0xe')](function(_0xec46b){logger[_0x25ab('0xf')](_0x25ab('0x10'),_0x3ef8cb,_0x25ab('0x11'));logger[_0x25ab('0x12')](_0x25ab('0x13'),_0x3ef8cb,'request\x20sent',JSON[_0x25ab('0x14')](_0xec46b));if(_0xec46b[_0x25ab('0x15')]){if(_0xec46b[_0x25ab('0x15')]['code']===0x1f4){logger[_0x25ab('0x15')](_0x25ab('0x10'),_0x3ef8cb,_0xec46b[_0x25ab('0x15')][_0x25ab('0x16')]);return _0x45c88b(_0xec46b['error'][_0x25ab('0x16')]);}logger['error'](_0x25ab('0x10'),_0x3ef8cb,_0xec46b[_0x25ab('0x15')][_0x25ab('0x16')]);return _0x1faffc(_0xec46b[_0x25ab('0x15')][_0x25ab('0x16')]);}else{logger[_0x25ab('0xf')](_0x25ab('0x10'),_0x3ef8cb,_0x25ab('0x11'));_0x1faffc(_0xec46b[_0x25ab('0x17')]['message']);}})[_0x25ab('0x18')](function(_0x2b3a55){logger[_0x25ab('0x15')]('MailServerOut,\x20%s,\x20%s',_0x3ef8cb,_0x2b3a55);_0x45c88b(_0x2b3a55);});});} \ No newline at end of file +var _0x952e=['error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','info','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','MailServerOut,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x571d85,_0x40e1e5){var _0x2df211=function(_0x4895f9){while(--_0x4895f9){_0x571d85['push'](_0x571d85['shift']());}};_0x2df211(++_0x40e1e5);}(_0x952e,0xb8));var _0xe952=function(_0x5b20d8,_0x4055c9){_0x5b20d8=_0x5b20d8-0x0;var _0x3a278c=_0x952e[_0x5b20d8];return _0x3a278c;};'use strict';var _=require(_0xe952('0x0'));var util=require(_0xe952('0x1'));var moment=require(_0xe952('0x2'));var BPromise=require('bluebird');var rs=require(_0xe952('0x3'));var fs=require('fs');var Redis=require(_0xe952('0x4'));var db=require(_0xe952('0x5'))['db'];var utils=require(_0xe952('0x6'));var logger=require('../../config/logger')(_0xe952('0x7'));var config=require('../../config/environment');var jayson=require(_0xe952('0x8'));var client=jayson['client'][_0xe952('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x45bdf3,_0x2dc40c,_0x3f4ed0){return new BPromise(function(_0x19a936,_0x410783){return client['request'](_0x45bdf3,_0x3f4ed0)['then'](function(_0xeaab10){logger[_0xe952('0xa')](_0xe952('0xb'),_0x2dc40c,_0xe952('0xc'));logger[_0xe952('0xd')](_0xe952('0xe'),_0x2dc40c,_0xe952('0xc'),JSON[_0xe952('0xf')](_0xeaab10));if(_0xeaab10[_0xe952('0x10')]){if(_0xeaab10[_0xe952('0x10')][_0xe952('0x11')]===0x1f4){logger[_0xe952('0x10')](_0xe952('0xb'),_0x2dc40c,_0xeaab10['error'][_0xe952('0x12')]);return _0x410783(_0xeaab10[_0xe952('0x10')][_0xe952('0x12')]);}logger[_0xe952('0x10')](_0xe952('0xb'),_0x2dc40c,_0xeaab10['error'][_0xe952('0x12')]);return _0x19a936(_0xeaab10[_0xe952('0x10')][_0xe952('0x12')]);}else{logger[_0xe952('0xa')](_0xe952('0xb'),_0x2dc40c,'request\x20sent');_0x19a936(_0xeaab10['result'][_0xe952('0x12')]);}})[_0xe952('0x13')](function(_0x2a6760){logger[_0xe952('0x10')](_0xe952('0xb'),_0x2dc40c,_0x2a6760);_0x410783(_0x2a6760);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index cea9c36..2a92a2d 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 _0x23b5=['get','isAuthenticated','/describe','describe','/:id','show','post','create','update','delete','destroy','exports','util','path','express','../../components/auth/service','../../components/interaction/service','./mailSubstatus.controller'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x23b5,0x9c));var _0x523b=function(_0x3f2a90,_0x50baf1){_0x3f2a90=_0x3f2a90-0x0;var _0xb46279=_0x23b5[_0x3f2a90];return _0xb46279;};'use strict';var multer=require('multer');var util=require(_0x523b('0x0'));var path=require(_0x523b('0x1'));var timeout=require('connect-timeout');var express=require(_0x523b('0x2'));var router=express['Router']();var auth=require(_0x523b('0x3'));var interaction=require(_0x523b('0x4'));var config=require('../../config/environment');var controller=require(_0x523b('0x5'));router[_0x523b('0x6')]('/',auth[_0x523b('0x7')](),controller['index']);router['get'](_0x523b('0x8'),auth[_0x523b('0x7')](),controller[_0x523b('0x9')]);router[_0x523b('0x6')](_0x523b('0xa'),auth[_0x523b('0x7')](),controller[_0x523b('0xb')]);router[_0x523b('0xc')]('/',auth[_0x523b('0x7')](),controller[_0x523b('0xd')]);router['put']('/:id',auth[_0x523b('0x7')](),controller[_0x523b('0xe')]);router[_0x523b('0xf')](_0x523b('0xa'),auth[_0x523b('0x7')](),controller[_0x523b('0x10')]);module[_0x523b('0x11')]=router; \ No newline at end of file +var _0xdc65=['update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','/describe','describe','show','post','put','/:id'];(function(_0x204d6b,_0xd3d50f){var _0x415290=function(_0x4bf218){while(--_0x4bf218){_0x204d6b['push'](_0x204d6b['shift']());}};_0x415290(++_0xd3d50f);}(_0xdc65,0xa4));var _0x5dc6=function(_0x313dab,_0x53179c){_0x313dab=_0x313dab-0x0;var _0x18ee37=_0xdc65[_0x313dab];return _0x18ee37;};'use strict';var multer=require('multer');var util=require(_0x5dc6('0x0'));var path=require('path');var timeout=require(_0x5dc6('0x1'));var express=require(_0x5dc6('0x2'));var router=express[_0x5dc6('0x3')]();var auth=require(_0x5dc6('0x4'));var interaction=require(_0x5dc6('0x5'));var config=require(_0x5dc6('0x6'));var controller=require(_0x5dc6('0x7'));router[_0x5dc6('0x8')]('/',auth[_0x5dc6('0x9')](),controller['index']);router[_0x5dc6('0x8')](_0x5dc6('0xa'),auth[_0x5dc6('0x9')](),controller[_0x5dc6('0xb')]);router[_0x5dc6('0x8')]('/:id',auth[_0x5dc6('0x9')](),controller[_0x5dc6('0xc')]);router[_0x5dc6('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x5dc6('0xe')](_0x5dc6('0xf'),auth[_0x5dc6('0x9')](),controller[_0x5dc6('0x10')]);router[_0x5dc6('0x11')](_0x5dc6('0xf'),auth[_0x5dc6('0x9')](),controller[_0x5dc6('0x12')]);module[_0x5dc6('0x13')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index b1aeae0..92e6eca 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 _0x23bb=['STRING','sequelize','name'];(function(_0x1ed662,_0x3e0706){var _0x22d319=function(_0xf42f70){while(--_0xf42f70){_0x1ed662['push'](_0x1ed662['shift']());}};_0x22d319(++_0x3e0706);}(_0x23bb,0x79));var _0xb23b=function(_0x179a0c,_0x2ca073){_0x179a0c=_0x179a0c-0x0;var _0x1c8b9a=_0x23bb[_0x179a0c];return _0x1c8b9a;};'use strict';var Sequelize=require(_0xb23b('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xb23b('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xb23b('0x2')]}}; \ No newline at end of file +var _0xa848=['sequelize','exports','STRING'];(function(_0x44f7cd,_0x53cdf2){var _0x1a8e77=function(_0x3c7cfb){while(--_0x3c7cfb){_0x44f7cd['push'](_0x44f7cd['shift']());}};_0x1a8e77(++_0x53cdf2);}(_0xa848,0x99));var _0x8a84=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa848[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0x8a84('0x0'));module[_0x8a84('0x1')]={'name':{'type':Sequelize[_0x8a84('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x8a84('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 754c435..43051d7 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 _0x6f47=['../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','set','Content-Range','json','apply','reject','save','then','end','stack','send','index','fieldName','type','key','map','query','keys','filters','intersection','attributes','model','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','name','MailSubstatus','includeAll','include','findAll','catch','show','params','rawAttributes','options','find','create','update','body','destroy','describe','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils'];(function(_0x13e453,_0x4ab30c){var _0x26aad2=function(_0x3387a1){while(--_0x3387a1){_0x13e453['push'](_0x13e453['shift']());}};_0x26aad2(++_0x4ab30c);}(_0x6f47,0xc7));var _0x76f4=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0x6f47[_0x13b8f3];return _0x1a6d06;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x76f4('0x0'));var rimraf=require(_0x76f4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x76f4('0x2'));var rp=require('request-promise');var moment=require(_0x76f4('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x76f4('0x4'));var util=require(_0x76f4('0x5'));var path=require(_0x76f4('0x6'));var sox=require(_0x76f4('0x7'));var csv=require('to-csv');var ejs=require(_0x76f4('0x8'));var fs=require('fs');var _=require(_0x76f4('0x9'));var squel=require(_0x76f4('0xa'));var crypto=require('crypto');var jsforce=require(_0x76f4('0xb'));var deskjs=require(_0x76f4('0xc'));var toCsv=require(_0x76f4('0xd'));var querystring=require(_0x76f4('0xe'));var Papa=require(_0x76f4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x76f4('0x10'));var as=require(_0x76f4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x76f4('0x12'));var utils=require(_0x76f4('0x13'));var config=require(_0x76f4('0x14'));var db=require(_0x76f4('0x15'))['db'];function respondWithStatusCode(_0x1aee7f,_0xafd21e){_0xafd21e=_0xafd21e||0xcc;return function(_0xf7e347){if(_0xf7e347){return _0x1aee7f[_0x76f4('0x16')](_0xafd21e);}return _0x1aee7f[_0x76f4('0x17')](_0xafd21e)['end']();};}function respondWithResult(_0x41ba00,_0x30dabf){_0x30dabf=_0x30dabf||0xc8;return function(_0x5da1ff){if(_0x5da1ff){return _0x41ba00['status'](_0x30dabf)['json'](_0x5da1ff);}};}function respondWithFilteredResult(_0x1d7755,_0x3dd240){return function(_0x979946){if(_0x979946){var _0x40252d=_0x979946[_0x76f4('0x18')],_0x3d8f5a=_0x3dd240[_0x76f4('0x19')],_0x2b5e23=_0x3dd240[_0x76f4('0x19')]+_0x3dd240[_0x76f4('0x1a')],_0x46ba51;if(_0x2b5e23>=_0x40252d){_0x2b5e23=_0x40252d;_0x46ba51=0xc8;}else{_0x46ba51=0xce;}_0x1d7755[_0x76f4('0x17')](_0x46ba51);return _0x1d7755[_0x76f4('0x1b')](_0x76f4('0x1c'),_0x3d8f5a+'-'+_0x2b5e23+'/'+_0x40252d)[_0x76f4('0x1d')](_0x979946);}return null;};}function patchUpdates(_0x397360){return function(_0xfedbe4){try{jsonpatch[_0x76f4('0x1e')](_0xfedbe4,_0x397360,!![]);}catch(_0x435534){return BPromise[_0x76f4('0x1f')](_0x435534);}return _0xfedbe4[_0x76f4('0x20')]();};}function saveUpdates(_0x285232,_0x5bf3d5){return function(_0x262937){if(_0x262937){return _0x262937['update'](_0x285232)[_0x76f4('0x21')](function(_0x24ecac){return _0x24ecac;});}return null;};}function removeEntity(_0xf8f722,_0x517c00){return function(_0x567f2a){if(_0x567f2a){return _0x567f2a['destroy']()[_0x76f4('0x21')](function(){_0xf8f722[_0x76f4('0x17')](0xcc)[_0x76f4('0x22')]();});}};}function handleEntityNotFound(_0x2b6d51,_0x42ef70){return function(_0x4786c9){if(!_0x4786c9){_0x2b6d51[_0x76f4('0x16')](0x194);}return _0x4786c9;};}function handleError(_0x4dac8e,_0x504aa8){_0x504aa8=_0x504aa8||0x1f4;return function(_0x3794fa){logger['error'](_0x3794fa[_0x76f4('0x23')]);if(_0x3794fa['name']){delete _0x3794fa['name'];}_0x4dac8e['status'](_0x504aa8)[_0x76f4('0x24')](_0x3794fa);};}exports[_0x76f4('0x25')]=function(_0xd368a2,_0x1d1fe6){var _0x13d219={},_0x447dbc={},_0x5ca31f={'count':0x0,'rows':[]};var _0x306cb4=_['map'](db['MailSubstatus']['rawAttributes'],function(_0x10ddb4){return{'name':_0x10ddb4[_0x76f4('0x26')],'type':_0x10ddb4[_0x76f4('0x27')][_0x76f4('0x28')]};});_0x447dbc['model']=_[_0x76f4('0x29')](_0x306cb4,'name');_0x447dbc[_0x76f4('0x2a')]=_[_0x76f4('0x2b')](_0xd368a2[_0x76f4('0x2a')]);_0x447dbc[_0x76f4('0x2c')]=_[_0x76f4('0x2d')](_0x447dbc['model'],_0x447dbc['query']);_0x13d219[_0x76f4('0x2e')]=_[_0x76f4('0x2d')](_0x447dbc[_0x76f4('0x2f')],qs[_0x76f4('0x30')](_0xd368a2[_0x76f4('0x2a')][_0x76f4('0x30')]));_0x13d219[_0x76f4('0x2e')]=_0x13d219[_0x76f4('0x2e')][_0x76f4('0x31')]?_0x13d219[_0x76f4('0x2e')]:_0x447dbc[_0x76f4('0x2f')];if(!_0xd368a2[_0x76f4('0x2a')]['hasOwnProperty']('nolimit')){_0x13d219['limit']=qs['limit'](_0xd368a2[_0x76f4('0x2a')][_0x76f4('0x1a')]);_0x13d219[_0x76f4('0x19')]=qs[_0x76f4('0x19')](_0xd368a2[_0x76f4('0x2a')]['offset']);}_0x13d219[_0x76f4('0x32')]=qs[_0x76f4('0x33')](_0xd368a2[_0x76f4('0x2a')][_0x76f4('0x33')]);_0x13d219[_0x76f4('0x34')]=qs[_0x76f4('0x2c')](_[_0x76f4('0x35')](_0xd368a2[_0x76f4('0x2a')],_0x447dbc[_0x76f4('0x2c')]));if(_0xd368a2[_0x76f4('0x2a')][_0x76f4('0x36')]){_0x13d219[_0x76f4('0x34')]=_[_0x76f4('0x37')](_0x13d219[_0x76f4('0x34')],{'$or':_[_0x76f4('0x29')](_0x306cb4,function(_0x88506b){if(_0x88506b[_0x76f4('0x27')]!==_0x76f4('0x38')){var _0x597119={};_0x597119[_0x88506b[_0x76f4('0x39')]]={'$like':'%'+_0xd368a2[_0x76f4('0x2a')][_0x76f4('0x36')]+'%'};return _0x597119;}})});}_0x13d219=_['merge']({},_0x13d219,_0xd368a2['options']);var _0x237fba={'where':_0x13d219['where']};return db[_0x76f4('0x3a')]['count'](_0x237fba)[_0x76f4('0x21')](function(_0x16f36d){_0x5ca31f[_0x76f4('0x18')]=_0x16f36d;if(_0xd368a2[_0x76f4('0x2a')][_0x76f4('0x3b')]){_0x13d219[_0x76f4('0x3c')]=[{'all':!![]}];}return db[_0x76f4('0x3a')][_0x76f4('0x3d')](_0x13d219);})[_0x76f4('0x21')](function(_0x80e29f){_0x5ca31f['rows']=_0x80e29f;return _0x5ca31f;})['then'](respondWithFilteredResult(_0x1d1fe6,_0x13d219))[_0x76f4('0x3e')](handleError(_0x1d1fe6,null));};exports[_0x76f4('0x3f')]=function(_0x364cf7,_0x427c70){var _0x2b7dc8={'raw':!![],'where':{'id':_0x364cf7[_0x76f4('0x40')]['id']}},_0x2d6068={};_0x2d6068[_0x76f4('0x2f')]=_[_0x76f4('0x2b')](db['MailSubstatus'][_0x76f4('0x41')]);_0x2d6068[_0x76f4('0x2a')]=_['keys'](_0x364cf7['query']);_0x2d6068[_0x76f4('0x2c')]=_[_0x76f4('0x2d')](_0x2d6068[_0x76f4('0x2f')],_0x2d6068[_0x76f4('0x2a')]);_0x2b7dc8[_0x76f4('0x2e')]=_['intersection'](_0x2d6068[_0x76f4('0x2f')],qs[_0x76f4('0x30')](_0x364cf7[_0x76f4('0x2a')][_0x76f4('0x30')]));_0x2b7dc8[_0x76f4('0x2e')]=_0x2b7dc8[_0x76f4('0x2e')]['length']?_0x2b7dc8[_0x76f4('0x2e')]:_0x2d6068[_0x76f4('0x2f')];if(_0x364cf7[_0x76f4('0x2a')]['includeAll']){_0x2b7dc8['include']=[{'all':!![]}];}_0x2b7dc8=_[_0x76f4('0x37')]({},_0x2b7dc8,_0x364cf7[_0x76f4('0x42')]);return db[_0x76f4('0x3a')][_0x76f4('0x43')](_0x2b7dc8)[_0x76f4('0x21')](handleEntityNotFound(_0x427c70,null))['then'](respondWithResult(_0x427c70,null))['catch'](handleError(_0x427c70,null));};exports[_0x76f4('0x44')]=function(_0x4a1f9f,_0x42b30d){return db[_0x76f4('0x3a')]['create'](_0x4a1f9f['body'],{})[_0x76f4('0x21')](respondWithResult(_0x42b30d,0xc9))[_0x76f4('0x3e')](handleError(_0x42b30d,null));};exports[_0x76f4('0x45')]=function(_0x217d3a,_0x55e4cc){if(_0x217d3a[_0x76f4('0x46')]['id']){delete _0x217d3a[_0x76f4('0x46')]['id'];}return db[_0x76f4('0x3a')]['find']({'where':{'id':_0x217d3a[_0x76f4('0x40')]['id']}})[_0x76f4('0x21')](handleEntityNotFound(_0x55e4cc,null))['then'](saveUpdates(_0x217d3a['body'],null))[_0x76f4('0x21')](respondWithResult(_0x55e4cc,null))[_0x76f4('0x3e')](handleError(_0x55e4cc,null));};exports[_0x76f4('0x47')]=function(_0x1edc96,_0x2a61d3){return db['MailSubstatus'][_0x76f4('0x43')]({'where':{'id':_0x1edc96['params']['id']}})[_0x76f4('0x21')](handleEntityNotFound(_0x2a61d3,null))[_0x76f4('0x21')](removeEntity(_0x2a61d3,null))[_0x76f4('0x3e')](handleError(_0x2a61d3,null));};exports['describe']=function(_0x312319,_0x326e76){return db['MailSubstatus'][_0x76f4('0x48')]()[_0x76f4('0x21')](respondWithResult(_0x326e76,null))[_0x76f4('0x3e')](handleError(_0x326e76,null));}; \ No newline at end of file +var _0x5496=['create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','MailSubstatus','rawAttributes','fieldName','keys','query','filters','intersection','model','attributes','fields','nolimit','sort','pick','merge','where','type','VIRTUAL','filter','options','includeAll','include','rows','show','params','length','find','catch'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0x5496,0x175));var _0x6549=function(_0x4b2f09,_0x1db74f){_0x4b2f09=_0x4b2f09-0x0;var _0x2f864c=_0x5496[_0x4b2f09];return _0x2f864c;};'use strict';var pdf=require(_0x6549('0x0'));var emlformat=require(_0x6549('0x1'));var rimraf=require(_0x6549('0x2'));var zipdir=require(_0x6549('0x3'));var jsonpatch=require(_0x6549('0x4'));var rp=require('request-promise');var moment=require(_0x6549('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6549('0x6'));var util=require(_0x6549('0x7'));var path=require(_0x6549('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6549('0x9'));var fs=require('fs');var _=require(_0x6549('0xa'));var squel=require('squel');var crypto=require(_0x6549('0xb'));var jsforce=require(_0x6549('0xc'));var deskjs=require(_0x6549('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6549('0xe'));var Papa=require(_0x6549('0xf'));var Redis=require(_0x6549('0x10'));var authService=require(_0x6549('0x11'));var qs=require(_0x6549('0x12'));var as=require(_0x6549('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6549('0x14'));var utils=require(_0x6549('0x15'));var config=require(_0x6549('0x16'));var db=require(_0x6549('0x17'))['db'];function respondWithStatusCode(_0x1a0f72,_0x5bc018){_0x5bc018=_0x5bc018||0xcc;return function(_0x4dfb06){if(_0x4dfb06){return _0x1a0f72[_0x6549('0x18')](_0x5bc018);}return _0x1a0f72[_0x6549('0x19')](_0x5bc018)['end']();};}function respondWithResult(_0x200ff1,_0x150fc8){_0x150fc8=_0x150fc8||0xc8;return function(_0x195d25){if(_0x195d25){return _0x200ff1[_0x6549('0x19')](_0x150fc8)[_0x6549('0x1a')](_0x195d25);}};}function respondWithFilteredResult(_0x86ae9d,_0x55c112){return function(_0x5db86d){if(_0x5db86d){var _0x384f75=_0x5db86d[_0x6549('0x1b')],_0x25da29=_0x55c112[_0x6549('0x1c')],_0x47a81a=_0x55c112[_0x6549('0x1c')]+_0x55c112[_0x6549('0x1d')],_0x238a04;if(_0x47a81a>=_0x384f75){_0x47a81a=_0x384f75;_0x238a04=0xc8;}else{_0x238a04=0xce;}_0x86ae9d['status'](_0x238a04);return _0x86ae9d['set'](_0x6549('0x1e'),_0x25da29+'-'+_0x47a81a+'/'+_0x384f75)['json'](_0x5db86d);}return null;};}function patchUpdates(_0x56c15b){return function(_0x31f8e7){try{jsonpatch[_0x6549('0x1f')](_0x31f8e7,_0x56c15b,!![]);}catch(_0x19c4a6){return BPromise[_0x6549('0x20')](_0x19c4a6);}return _0x31f8e7[_0x6549('0x21')]();};}function saveUpdates(_0x5ce3aa,_0x228117){return function(_0x4b40c1){if(_0x4b40c1){return _0x4b40c1[_0x6549('0x22')](_0x5ce3aa)[_0x6549('0x23')](function(_0x3992cf){return _0x3992cf;});}return null;};}function removeEntity(_0x29c6b3,_0x22bcf8){return function(_0x12d547){if(_0x12d547){return _0x12d547[_0x6549('0x24')]()[_0x6549('0x23')](function(){_0x29c6b3[_0x6549('0x19')](0xcc)[_0x6549('0x25')]();});}};}function handleEntityNotFound(_0x40d3f9,_0x1fbfa4){return function(_0x23c0ba){if(!_0x23c0ba){_0x40d3f9['sendStatus'](0x194);}return _0x23c0ba;};}function handleError(_0x30404e,_0x1bc8db){_0x1bc8db=_0x1bc8db||0x1f4;return function(_0x53bbca){logger[_0x6549('0x26')](_0x53bbca[_0x6549('0x27')]);if(_0x53bbca[_0x6549('0x28')]){delete _0x53bbca['name'];}_0x30404e[_0x6549('0x19')](_0x1bc8db)[_0x6549('0x29')](_0x53bbca);};}exports[_0x6549('0x2a')]=function(_0x2900cd,_0x442862){var _0x3edf02={},_0x2f58f7={},_0xa6c718={'count':0x0,'rows':[]};var _0x4c52f1=_[_0x6549('0x2b')](db[_0x6549('0x2c')][_0x6549('0x2d')],function(_0x4c605c){return{'name':_0x4c605c[_0x6549('0x2e')],'type':_0x4c605c['type']['key']};});_0x2f58f7['model']=_[_0x6549('0x2b')](_0x4c52f1,_0x6549('0x28'));_0x2f58f7['query']=_[_0x6549('0x2f')](_0x2900cd[_0x6549('0x30')]);_0x2f58f7[_0x6549('0x31')]=_[_0x6549('0x32')](_0x2f58f7[_0x6549('0x33')],_0x2f58f7[_0x6549('0x30')]);_0x3edf02[_0x6549('0x34')]=_['intersection'](_0x2f58f7[_0x6549('0x33')],qs[_0x6549('0x35')](_0x2900cd[_0x6549('0x30')][_0x6549('0x35')]));_0x3edf02[_0x6549('0x34')]=_0x3edf02[_0x6549('0x34')]['length']?_0x3edf02[_0x6549('0x34')]:_0x2f58f7['model'];if(!_0x2900cd[_0x6549('0x30')]['hasOwnProperty'](_0x6549('0x36'))){_0x3edf02[_0x6549('0x1d')]=qs[_0x6549('0x1d')](_0x2900cd['query'][_0x6549('0x1d')]);_0x3edf02[_0x6549('0x1c')]=qs[_0x6549('0x1c')](_0x2900cd[_0x6549('0x30')]['offset']);}_0x3edf02['order']=qs['sort'](_0x2900cd[_0x6549('0x30')][_0x6549('0x37')]);_0x3edf02['where']=qs[_0x6549('0x31')](_[_0x6549('0x38')](_0x2900cd[_0x6549('0x30')],_0x2f58f7[_0x6549('0x31')]));if(_0x2900cd[_0x6549('0x30')]['filter']){_0x3edf02['where']=_[_0x6549('0x39')](_0x3edf02[_0x6549('0x3a')],{'$or':_[_0x6549('0x2b')](_0x4c52f1,function(_0xa79ffb){if(_0xa79ffb[_0x6549('0x3b')]!==_0x6549('0x3c')){var _0x1c6b46={};_0x1c6b46[_0xa79ffb[_0x6549('0x28')]]={'$like':'%'+_0x2900cd[_0x6549('0x30')][_0x6549('0x3d')]+'%'};return _0x1c6b46;}})});}_0x3edf02=_['merge']({},_0x3edf02,_0x2900cd[_0x6549('0x3e')]);var _0x7986b0={'where':_0x3edf02[_0x6549('0x3a')]};return db[_0x6549('0x2c')][_0x6549('0x1b')](_0x7986b0)['then'](function(_0x54ee33){_0xa6c718['count']=_0x54ee33;if(_0x2900cd[_0x6549('0x30')][_0x6549('0x3f')]){_0x3edf02[_0x6549('0x40')]=[{'all':!![]}];}return db[_0x6549('0x2c')]['findAll'](_0x3edf02);})['then'](function(_0x438f0b){_0xa6c718[_0x6549('0x41')]=_0x438f0b;return _0xa6c718;})[_0x6549('0x23')](respondWithFilteredResult(_0x442862,_0x3edf02))['catch'](handleError(_0x442862,null));};exports[_0x6549('0x42')]=function(_0x519622,_0x3ea7f9){var _0x2ec614={'raw':!![],'where':{'id':_0x519622[_0x6549('0x43')]['id']}},_0x19920f={};_0x19920f[_0x6549('0x33')]=_[_0x6549('0x2f')](db[_0x6549('0x2c')]['rawAttributes']);_0x19920f[_0x6549('0x30')]=_[_0x6549('0x2f')](_0x519622[_0x6549('0x30')]);_0x19920f[_0x6549('0x31')]=_[_0x6549('0x32')](_0x19920f[_0x6549('0x33')],_0x19920f[_0x6549('0x30')]);_0x2ec614[_0x6549('0x34')]=_[_0x6549('0x32')](_0x19920f[_0x6549('0x33')],qs[_0x6549('0x35')](_0x519622[_0x6549('0x30')][_0x6549('0x35')]));_0x2ec614[_0x6549('0x34')]=_0x2ec614[_0x6549('0x34')][_0x6549('0x44')]?_0x2ec614['attributes']:_0x19920f[_0x6549('0x33')];if(_0x519622[_0x6549('0x30')][_0x6549('0x3f')]){_0x2ec614[_0x6549('0x40')]=[{'all':!![]}];}_0x2ec614=_['merge']({},_0x2ec614,_0x519622[_0x6549('0x3e')]);return db['MailSubstatus'][_0x6549('0x45')](_0x2ec614)[_0x6549('0x23')](handleEntityNotFound(_0x3ea7f9,null))['then'](respondWithResult(_0x3ea7f9,null))[_0x6549('0x46')](handleError(_0x3ea7f9,null));};exports[_0x6549('0x47')]=function(_0x44e608,_0x18a751){return db[_0x6549('0x2c')]['create'](_0x44e608['body'],{})[_0x6549('0x23')](respondWithResult(_0x18a751,0xc9))[_0x6549('0x46')](handleError(_0x18a751,null));};exports[_0x6549('0x22')]=function(_0x1712f3,_0x1e562b){if(_0x1712f3['body']['id']){delete _0x1712f3[_0x6549('0x48')]['id'];}return db[_0x6549('0x2c')][_0x6549('0x45')]({'where':{'id':_0x1712f3[_0x6549('0x43')]['id']}})[_0x6549('0x23')](handleEntityNotFound(_0x1e562b,null))[_0x6549('0x23')](saveUpdates(_0x1712f3[_0x6549('0x48')],null))[_0x6549('0x23')](respondWithResult(_0x1e562b,null))['catch'](handleError(_0x1e562b,null));};exports[_0x6549('0x24')]=function(_0x58746c,_0x2ed77c){return db[_0x6549('0x2c')][_0x6549('0x45')]({'where':{'id':_0x58746c['params']['id']}})[_0x6549('0x23')](handleEntityNotFound(_0x2ed77c,null))[_0x6549('0x23')](removeEntity(_0x2ed77c,null))[_0x6549('0x46')](handleError(_0x2ed77c,null));};exports['describe']=function(_0x19ac50,_0x17d7ce){return db[_0x6549('0x2c')][_0x6549('0x49')]()[_0x6549('0x23')](respondWithResult(_0x17d7ce,null))[_0x6549('0x46')](handleError(_0x17d7ce,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index a7b8250..be81c3e 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 _0x8383=['request-promise','path','rimraf','../../config/environment','./mailSubstatus.attributes','exports','define','MailSubstatus','lodash','api','moment','bluebird'];(function(_0x243928,_0xebb38c){var _0x3cb768=function(_0x1cc3ae){while(--_0x1cc3ae){_0x243928['push'](_0x243928['shift']());}};_0x3cb768(++_0xebb38c);}(_0x8383,0x98));var _0x3838=function(_0x5a50f1,_0x5aa212){_0x5a50f1=_0x5a50f1-0x0;var _0x1dd8d5=_0x8383[_0x5a50f1];return _0x1dd8d5;};'use strict';var _=require(_0x3838('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3838('0x1'));var moment=require(_0x3838('0x2'));var BPromise=require(_0x3838('0x3'));var rp=require(_0x3838('0x4'));var fs=require('fs');var path=require(_0x3838('0x5'));var rimraf=require(_0x3838('0x6'));var config=require(_0x3838('0x7'));var attributes=require(_0x3838('0x8'));module[_0x3838('0x9')]=function(_0x7a4cc0,_0x509656){return _0x7a4cc0[_0x3838('0xa')](_0x3838('0xb'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd9eb=['rimraf','../../config/environment','./mailSubstatus.attributes','exports','define','MailSubstatus','mail_substatuses','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x1bb829,_0x503e6a){var _0x235c25=function(_0x26dbc7){while(--_0x26dbc7){_0x1bb829['push'](_0x1bb829['shift']());}};_0x235c25(++_0x503e6a);}(_0xd9eb,0xca));var _0xbd9e=function(_0x4a1353,_0x2fbe86){_0x4a1353=_0x4a1353-0x0;var _0x3805cc=_0xd9eb[_0x4a1353];return _0x3805cc;};'use strict';var _=require(_0xbd9e('0x0'));var util=require(_0xbd9e('0x1'));var logger=require(_0xbd9e('0x2'))(_0xbd9e('0x3'));var moment=require(_0xbd9e('0x4'));var BPromise=require(_0xbd9e('0x5'));var rp=require(_0xbd9e('0x6'));var fs=require('fs');var path=require(_0xbd9e('0x7'));var rimraf=require(_0xbd9e('0x8'));var config=require(_0xbd9e('0x9'));var attributes=require(_0xbd9e('0xa'));module[_0xbd9e('0xb')]=function(_0x20c36a,_0x4ade3f){return _0x20c36a[_0xbd9e('0xc')](_0xbd9e('0xd'),attributes,{'tableName':_0xbd9e('0xe'),'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 1f90b0a..f149150 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 _0xbdb7=['request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','info','MailSubstatus,\x20%s,\x20%s'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x1ddc91,_0x132ec7){_0x1ddc91=_0x1ddc91-0x0;var _0x3559bb=_0xbdb7[_0x1ddc91];return _0x3559bb;};'use strict';var _=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var moment=require(_0x7bdb('0x2'));var BPromise=require(_0x7bdb('0x3'));var rs=require(_0x7bdb('0x4'));var fs=require('fs');var Redis=require(_0x7bdb('0x5'));var db=require(_0x7bdb('0x6'))['db'];var utils=require(_0x7bdb('0x7'));var logger=require(_0x7bdb('0x8'))('rpc');var config=require(_0x7bdb('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7bdb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e23a3,_0x493bde,_0x513cba){return new BPromise(function(_0x468041,_0x11a877){return client['request'](_0x1e23a3,_0x513cba)['then'](function(_0xdc2ffc){logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));logger[_0x7bdb('0xe')](_0x7bdb('0xf'),_0x493bde,_0x7bdb('0xd'),JSON[_0x7bdb('0x10')](_0xdc2ffc));if(_0xdc2ffc['error']){if(_0xdc2ffc['error']['code']===0x1f4){logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error'][_0x7bdb('0x12')]);return _0x11a877(_0xdc2ffc['error']['message']);}logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error']['message']);return _0x468041(_0xdc2ffc['error'][_0x7bdb('0x12')]);}else{logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));_0x468041(_0xdc2ffc[_0x7bdb('0x13')][_0x7bdb('0x12')]);}})[_0x7bdb('0x14')](function(_0x1b2d9b){logger['error'](_0x7bdb('0xc'),_0x493bde,_0x1b2d9b);_0x11a877(_0x1b2d9b);});});} \ No newline at end of file +var _0xdace=['request\x20sent','debug','stringify','error','code','MailSubstatus,\x20%s,\x20%s','message','info','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0x469a3c,_0x5ebc10){var _0x968f4=function(_0x22403b){while(--_0x22403b){_0x469a3c['push'](_0x469a3c['shift']());}};_0x968f4(++_0x5ebc10);}(_0xdace,0xc5));var _0xedac=function(_0x1a7550,_0x1edace){_0x1a7550=_0x1a7550-0x0;var _0x426e22=_0xdace[_0x1a7550];return _0x426e22;};'use strict';var _=require(_0xedac('0x0'));var util=require('util');var moment=require(_0xedac('0x1'));var BPromise=require(_0xedac('0x2'));var rs=require(_0xedac('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xedac('0x4'))['db'];var utils=require(_0xedac('0x5'));var logger=require(_0xedac('0x6'))(_0xedac('0x7'));var config=require('../../config/environment');var jayson=require(_0xedac('0x8'));var client=jayson[_0xedac('0x9')][_0xedac('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ecbd3,_0x4081c6,_0x21440e){return new BPromise(function(_0x162eea,_0x53fa43){return client[_0xedac('0xb')](_0x5ecbd3,_0x21440e)[_0xedac('0xc')](function(_0xc98887){logger['info']('MailSubstatus,\x20%s,\x20%s',_0x4081c6,_0xedac('0xd'));logger[_0xedac('0xe')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x4081c6,'request\x20sent',JSON[_0xedac('0xf')](_0xc98887));if(_0xc98887[_0xedac('0x10')]){if(_0xc98887['error'][_0xedac('0x11')]===0x1f4){logger['error'](_0xedac('0x12'),_0x4081c6,_0xc98887[_0xedac('0x10')][_0xedac('0x13')]);return _0x53fa43(_0xc98887[_0xedac('0x10')][_0xedac('0x13')]);}logger[_0xedac('0x10')](_0xedac('0x12'),_0x4081c6,_0xc98887[_0xedac('0x10')]['message']);return _0x162eea(_0xc98887[_0xedac('0x10')][_0xedac('0x13')]);}else{logger[_0xedac('0x14')](_0xedac('0x12'),_0x4081c6,_0xedac('0xd'));_0x162eea(_0xc98887['result'][_0xedac('0x13')]);}})['catch'](function(_0xddc7b8){logger[_0xedac('0x10')](_0xedac('0x12'),_0x4081c6,_0xddc7b8);_0x53fa43(_0xddc7b8);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 5b468df..004fea8 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 _0x764e=['./mailTransferReport.controller','get','/describe','describe','/:id','isAuthenticated','show','post','put','delete','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5a1b87,_0x52b29e){var _0x346e7d=function(_0x1bb453){while(--_0x1bb453){_0x5a1b87['push'](_0x5a1b87['shift']());}};_0x346e7d(++_0x52b29e);}(_0x764e,0x188));var _0xe764=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x764e[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xe764('0x0'));var path=require(_0xe764('0x1'));var timeout=require(_0xe764('0x2'));var express=require(_0xe764('0x3'));var router=express['Router']();var auth=require(_0xe764('0x4'));var interaction=require(_0xe764('0x5'));var config=require(_0xe764('0x6'));var controller=require(_0xe764('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xe764('0x8')](_0xe764('0x9'),auth['isAuthenticated'](),controller[_0xe764('0xa')]);router['get'](_0xe764('0xb'),auth[_0xe764('0xc')](),controller[_0xe764('0xd')]);router[_0xe764('0xe')]('/',auth[_0xe764('0xc')](),controller['create']);router[_0xe764('0xf')](_0xe764('0xb'),auth[_0xe764('0xc')](),controller['update']);router[_0xe764('0x10')](_0xe764('0xb'),auth[_0xe764('0xc')](),controller[_0xe764('0x11')]);module[_0xe764('0x12')]=router; \ No newline at end of file +var _0xbf31=['path','../../components/auth/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','create','put','update','exports','multer','util'];(function(_0x299e6c,_0x15a75e){var _0x49dc99=function(_0x376689){while(--_0x376689){_0x299e6c['push'](_0x299e6c['shift']());}};_0x49dc99(++_0x15a75e);}(_0xbf31,0x19e));var _0x1bf3=function(_0x1f8276,_0x94ff23){_0x1f8276=_0x1f8276-0x0;var _0x1960fa=_0xbf31[_0x1f8276];return _0x1960fa;};'use strict';var multer=require(_0x1bf3('0x0'));var util=require(_0x1bf3('0x1'));var path=require(_0x1bf3('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0x1bf3('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x1bf3('0x4'));var controller=require(_0x1bf3('0x5'));router[_0x1bf3('0x6')]('/',auth[_0x1bf3('0x7')](),controller[_0x1bf3('0x8')]);router[_0x1bf3('0x6')](_0x1bf3('0x9'),auth['isAuthenticated'](),controller[_0x1bf3('0xa')]);router['get'](_0x1bf3('0xb'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x1bf3('0x7')](),controller[_0x1bf3('0xc')]);router[_0x1bf3('0xd')](_0x1bf3('0xb'),auth[_0x1bf3('0x7')](),controller[_0x1bf3('0xe')]);router['delete']('/:id',auth[_0x1bf3('0x7')](),controller['destroy']);module[_0x1bf3('0xf')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 4d38a01..ec67fd2 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 _0xcb05=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x552d53,_0x5abab9){var _0x4eb13e=function(_0x38adfe){while(--_0x38adfe){_0x552d53['push'](_0x552d53['shift']());}};_0x4eb13e(++_0x5abab9);}(_0xcb05,0x94));var _0x5cb0=function(_0x446f82,_0x4adf46){_0x446f82=_0x446f82-0x0;var _0x48a243=_0xcb05[_0x446f82];return _0x48a243;};'use strict';var moment=require('moment');var Sequelize=require(_0x5cb0('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x5cb0('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x5cb0('0x2'),_0x5cb0('0x3'),_0x5cb0('0x4')),'allowNull':![],'defaultValue':_0x5cb0('0x4')},'transferredAt':{'type':Sequelize[_0x5cb0('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x5cb0('0x6')]}}; \ No newline at end of file +var _0x7c0c=['moment','sequelize','exports','STRING','queue'];(function(_0x25bb5a,_0x4b96b8){var _0x450568=function(_0x50a82c){while(--_0x50a82c){_0x25bb5a['push'](_0x25bb5a['shift']());}};_0x450568(++_0x4b96b8);}(_0x7c0c,0x168));var _0xc7c0=function(_0x486d65,_0x3b7523){_0x486d65=_0x486d65-0x0;var _0x49bd9f=_0x7c0c[_0x486d65];return _0x49bd9f;};'use strict';var moment=require(_0xc7c0('0x0'));var Sequelize=require(_0xc7c0('0x1'));module[_0xc7c0('0x2')]={'uniqueid':{'type':Sequelize[_0xc7c0('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('account','agent',_0xc7c0('0x4')),'allowNull':![],'defaultValue':_0xc7c0('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 53ffe26..f9aef6c 100644 --- a/server/api/mailTransferReport/mailTransferReport.controller.js +++ b/server/api/mailTransferReport/mailTransferReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','reject','save','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','pick','filter','where','merge','VIRTUAL','options','MailTransferReport','count','includeAll','include','findAll','rows','show','find','catch','create','body','update','params','describe','html-pdf'];(function(_0x1064ee,_0x54d817){var _0xe88259=function(_0x4717c){while(--_0x4717c){_0x1064ee['push'](_0x1064ee['shift']());}};_0xe88259(++_0x54d817);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var pdf=require(_0x7995('0x0'));var emlformat=require(_0x7995('0x1'));var rimraf=require(_0x7995('0x2'));var zipdir=require(_0x7995('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7995('0x4'));var moment=require(_0x7995('0x5'));var BPromise=require(_0x7995('0x6'));var Mustache=require(_0x7995('0x7'));var util=require('util');var path=require(_0x7995('0x8'));var sox=require(_0x7995('0x9'));var csv=require(_0x7995('0xa'));var ejs=require(_0x7995('0xb'));var fs=require('fs');var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var db=require(_0x7995('0x19'))['db'];function respondWithStatusCode(_0x2cb37a,_0x19a27e){_0x19a27e=_0x19a27e||0xcc;return function(_0x385f00){if(_0x385f00){return _0x2cb37a[_0x7995('0x1a')](_0x19a27e);}return _0x2cb37a[_0x7995('0x1b')](_0x19a27e)[_0x7995('0x1c')]();};}function respondWithResult(_0x4cc004,_0x58f5ad){_0x58f5ad=_0x58f5ad||0xc8;return function(_0x2b4e94){if(_0x2b4e94){return _0x4cc004[_0x7995('0x1b')](_0x58f5ad)[_0x7995('0x1d')](_0x2b4e94);}};}function respondWithFilteredResult(_0x321ae8,_0x3f1d3e){return function(_0x1a5310){if(_0x1a5310){var _0x2202ce=_0x1a5310['count'],_0x41cbf0=_0x3f1d3e[_0x7995('0x1e')],_0x5377e5=_0x3f1d3e[_0x7995('0x1e')]+_0x3f1d3e[_0x7995('0x1f')],_0x2eeacc;if(_0x5377e5>=_0x2202ce){_0x5377e5=_0x2202ce;_0x2eeacc=0xc8;}else{_0x2eeacc=0xce;}_0x321ae8[_0x7995('0x1b')](_0x2eeacc);return _0x321ae8[_0x7995('0x20')](_0x7995('0x21'),_0x41cbf0+'-'+_0x5377e5+'/'+_0x2202ce)['json'](_0x1a5310);}return null;};}function patchUpdates(_0x54c9ae){return function(_0x2536c8){try{jsonpatch['apply'](_0x2536c8,_0x54c9ae,!![]);}catch(_0x555f74){return BPromise[_0x7995('0x22')](_0x555f74);}return _0x2536c8[_0x7995('0x23')]();};}function saveUpdates(_0x4cbe10,_0x3a9b54){return function(_0x51f276){if(_0x51f276){return _0x51f276['update'](_0x4cbe10)[_0x7995('0x24')](function(_0x327b1f){return _0x327b1f;});}return null;};}function removeEntity(_0x350fd9,_0x1a8568){return function(_0x460924){if(_0x460924){return _0x460924[_0x7995('0x25')]()['then'](function(){_0x350fd9[_0x7995('0x1b')](0xcc)[_0x7995('0x1c')]();});}};}function handleEntityNotFound(_0x204507,_0x285437){return function(_0x563799){if(!_0x563799){_0x204507[_0x7995('0x1a')](0x194);}return _0x563799;};}function handleError(_0x475351,_0x472195){_0x472195=_0x472195||0x1f4;return function(_0x59405a){logger[_0x7995('0x26')](_0x59405a[_0x7995('0x27')]);if(_0x59405a[_0x7995('0x28')]){delete _0x59405a[_0x7995('0x28')];}_0x475351[_0x7995('0x1b')](_0x472195)[_0x7995('0x29')](_0x59405a);};}exports['index']=function(_0x47625f,_0x5911c3){var _0x229742={},_0x49bc7e={},_0xf16cc2={'count':0x0,'rows':[]};var _0x132a42=_[_0x7995('0x2a')](db['MailTransferReport'][_0x7995('0x2b')],function(_0x514445){return{'name':_0x514445[_0x7995('0x2c')],'type':_0x514445[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x49bc7e['model']=_['map'](_0x132a42,'name');_0x49bc7e[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x47625f[_0x7995('0x2f')]);_0x49bc7e[_0x7995('0x31')]=_[_0x7995('0x32')](_0x49bc7e[_0x7995('0x33')],_0x49bc7e['query']);_0x229742['attributes']=_[_0x7995('0x32')](_0x49bc7e['model'],qs[_0x7995('0x34')](_0x47625f[_0x7995('0x2f')][_0x7995('0x34')]));_0x229742[_0x7995('0x35')]=_0x229742[_0x7995('0x35')]['length']?_0x229742[_0x7995('0x35')]:_0x49bc7e[_0x7995('0x33')];if(!_0x47625f['query']['hasOwnProperty']('nolimit')){_0x229742[_0x7995('0x1f')]=qs[_0x7995('0x1f')](_0x47625f['query'][_0x7995('0x1f')]);_0x229742['offset']=qs[_0x7995('0x1e')](_0x47625f[_0x7995('0x2f')][_0x7995('0x1e')]);}_0x229742['order']=qs['sort'](_0x47625f[_0x7995('0x2f')]['sort']);_0x229742['where']=qs[_0x7995('0x31')](_[_0x7995('0x36')](_0x47625f['query'],_0x49bc7e[_0x7995('0x31')]));if(_0x47625f[_0x7995('0x2f')][_0x7995('0x37')]){_0x229742[_0x7995('0x38')]=_[_0x7995('0x39')](_0x229742['where'],{'$or':_[_0x7995('0x2a')](_0x132a42,function(_0x242713){if(_0x242713[_0x7995('0x2d')]!==_0x7995('0x3a')){var _0x4b1541={};_0x4b1541[_0x242713[_0x7995('0x28')]]={'$like':'%'+_0x47625f[_0x7995('0x2f')][_0x7995('0x37')]+'%'};return _0x4b1541;}})});}_0x229742=_[_0x7995('0x39')]({},_0x229742,_0x47625f[_0x7995('0x3b')]);var _0x1035dc={'where':_0x229742['where']};return db[_0x7995('0x3c')][_0x7995('0x3d')](_0x1035dc)[_0x7995('0x24')](function(_0x2ea47f){_0xf16cc2[_0x7995('0x3d')]=_0x2ea47f;if(_0x47625f[_0x7995('0x2f')][_0x7995('0x3e')]){_0x229742[_0x7995('0x3f')]=[{'all':!![]}];}return db[_0x7995('0x3c')][_0x7995('0x40')](_0x229742);})[_0x7995('0x24')](function(_0x270d52){_0xf16cc2[_0x7995('0x41')]=_0x270d52;return _0xf16cc2;})['then'](respondWithFilteredResult(_0x5911c3,_0x229742))['catch'](handleError(_0x5911c3,null));};exports[_0x7995('0x42')]=function(_0x7325e8,_0x58523e){var _0x4b0855={'raw':!![],'where':{'id':_0x7325e8['params']['id']}},_0x3f8522={};_0x3f8522['model']=_[_0x7995('0x30')](db[_0x7995('0x3c')][_0x7995('0x2b')]);_0x3f8522['query']=_[_0x7995('0x30')](_0x7325e8['query']);_0x3f8522[_0x7995('0x31')]=_['intersection'](_0x3f8522['model'],_0x3f8522[_0x7995('0x2f')]);_0x4b0855[_0x7995('0x35')]=_[_0x7995('0x32')](_0x3f8522[_0x7995('0x33')],qs['fields'](_0x7325e8[_0x7995('0x2f')][_0x7995('0x34')]));_0x4b0855[_0x7995('0x35')]=_0x4b0855[_0x7995('0x35')]['length']?_0x4b0855['attributes']:_0x3f8522[_0x7995('0x33')];if(_0x7325e8['query'][_0x7995('0x3e')]){_0x4b0855['include']=[{'all':!![]}];}_0x4b0855=_[_0x7995('0x39')]({},_0x4b0855,_0x7325e8['options']);return db[_0x7995('0x3c')][_0x7995('0x43')](_0x4b0855)['then'](handleEntityNotFound(_0x58523e,null))[_0x7995('0x24')](respondWithResult(_0x58523e,null))[_0x7995('0x44')](handleError(_0x58523e,null));};exports[_0x7995('0x45')]=function(_0xb70a51,_0x4c6837){return db[_0x7995('0x3c')][_0x7995('0x45')](_0xb70a51[_0x7995('0x46')],{})['then'](respondWithResult(_0x4c6837,0xc9))[_0x7995('0x44')](handleError(_0x4c6837,null));};exports[_0x7995('0x47')]=function(_0x511567,_0x3d8ae3){if(_0x511567[_0x7995('0x46')]['id']){delete _0x511567['body']['id'];}return db[_0x7995('0x3c')][_0x7995('0x43')]({'where':{'id':_0x511567['params']['id']}})[_0x7995('0x24')](handleEntityNotFound(_0x3d8ae3,null))['then'](saveUpdates(_0x511567[_0x7995('0x46')],null))[_0x7995('0x24')](respondWithResult(_0x3d8ae3,null))[_0x7995('0x44')](handleError(_0x3d8ae3,null));};exports[_0x7995('0x25')]=function(_0xddf537,_0x14b537){return db[_0x7995('0x3c')]['find']({'where':{'id':_0xddf537[_0x7995('0x48')]['id']}})[_0x7995('0x24')](handleEntityNotFound(_0x14b537,null))[_0x7995('0x24')](removeEntity(_0x14b537,null))['catch'](handleError(_0x14b537,null));};exports[_0x7995('0x49')]=function(_0x1fe77e,_0x12d4b8){return db['MailTransferReport']['describe']()['then'](respondWithResult(_0x12d4b8,null))[_0x7995('0x44')](handleError(_0x12d4b8,null));}; \ No newline at end of file +var _0x9957=['eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','reject','save','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','pick','filter','where','merge','VIRTUAL','options','MailTransferReport','count','includeAll','include','findAll','rows','show','find','catch','create','body','update','params','describe','html-pdf'];(function(_0x8ecc43,_0x83416e){var _0x3cab38=function(_0x51685f){while(--_0x51685f){_0x8ecc43['push'](_0x8ecc43['shift']());}};_0x3cab38(++_0x83416e);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var pdf=require(_0x7995('0x0'));var emlformat=require(_0x7995('0x1'));var rimraf=require(_0x7995('0x2'));var zipdir=require(_0x7995('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7995('0x4'));var moment=require(_0x7995('0x5'));var BPromise=require(_0x7995('0x6'));var Mustache=require(_0x7995('0x7'));var util=require('util');var path=require(_0x7995('0x8'));var sox=require(_0x7995('0x9'));var csv=require(_0x7995('0xa'));var ejs=require(_0x7995('0xb'));var fs=require('fs');var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var db=require(_0x7995('0x19'))['db'];function respondWithStatusCode(_0x2cb37a,_0x19a27e){_0x19a27e=_0x19a27e||0xcc;return function(_0x385f00){if(_0x385f00){return _0x2cb37a[_0x7995('0x1a')](_0x19a27e);}return _0x2cb37a[_0x7995('0x1b')](_0x19a27e)[_0x7995('0x1c')]();};}function respondWithResult(_0x4cc004,_0x58f5ad){_0x58f5ad=_0x58f5ad||0xc8;return function(_0x2b4e94){if(_0x2b4e94){return _0x4cc004[_0x7995('0x1b')](_0x58f5ad)[_0x7995('0x1d')](_0x2b4e94);}};}function respondWithFilteredResult(_0x321ae8,_0x3f1d3e){return function(_0x1a5310){if(_0x1a5310){var _0x2202ce=_0x1a5310['count'],_0x41cbf0=_0x3f1d3e[_0x7995('0x1e')],_0x5377e5=_0x3f1d3e[_0x7995('0x1e')]+_0x3f1d3e[_0x7995('0x1f')],_0x2eeacc;if(_0x5377e5>=_0x2202ce){_0x5377e5=_0x2202ce;_0x2eeacc=0xc8;}else{_0x2eeacc=0xce;}_0x321ae8[_0x7995('0x1b')](_0x2eeacc);return _0x321ae8[_0x7995('0x20')](_0x7995('0x21'),_0x41cbf0+'-'+_0x5377e5+'/'+_0x2202ce)['json'](_0x1a5310);}return null;};}function patchUpdates(_0x54c9ae){return function(_0x2536c8){try{jsonpatch['apply'](_0x2536c8,_0x54c9ae,!![]);}catch(_0x555f74){return BPromise[_0x7995('0x22')](_0x555f74);}return _0x2536c8[_0x7995('0x23')]();};}function saveUpdates(_0x4cbe10,_0x3a9b54){return function(_0x51f276){if(_0x51f276){return _0x51f276['update'](_0x4cbe10)[_0x7995('0x24')](function(_0x327b1f){return _0x327b1f;});}return null;};}function removeEntity(_0x350fd9,_0x1a8568){return function(_0x460924){if(_0x460924){return _0x460924[_0x7995('0x25')]()['then'](function(){_0x350fd9[_0x7995('0x1b')](0xcc)[_0x7995('0x1c')]();});}};}function handleEntityNotFound(_0x204507,_0x285437){return function(_0x563799){if(!_0x563799){_0x204507[_0x7995('0x1a')](0x194);}return _0x563799;};}function handleError(_0x475351,_0x472195){_0x472195=_0x472195||0x1f4;return function(_0x59405a){logger[_0x7995('0x26')](_0x59405a[_0x7995('0x27')]);if(_0x59405a[_0x7995('0x28')]){delete _0x59405a[_0x7995('0x28')];}_0x475351[_0x7995('0x1b')](_0x472195)[_0x7995('0x29')](_0x59405a);};}exports['index']=function(_0x47625f,_0x5911c3){var _0x229742={},_0x49bc7e={},_0xf16cc2={'count':0x0,'rows':[]};var _0x132a42=_[_0x7995('0x2a')](db['MailTransferReport'][_0x7995('0x2b')],function(_0x514445){return{'name':_0x514445[_0x7995('0x2c')],'type':_0x514445[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x49bc7e['model']=_['map'](_0x132a42,'name');_0x49bc7e[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x47625f[_0x7995('0x2f')]);_0x49bc7e[_0x7995('0x31')]=_[_0x7995('0x32')](_0x49bc7e[_0x7995('0x33')],_0x49bc7e['query']);_0x229742['attributes']=_[_0x7995('0x32')](_0x49bc7e['model'],qs[_0x7995('0x34')](_0x47625f[_0x7995('0x2f')][_0x7995('0x34')]));_0x229742[_0x7995('0x35')]=_0x229742[_0x7995('0x35')]['length']?_0x229742[_0x7995('0x35')]:_0x49bc7e[_0x7995('0x33')];if(!_0x47625f['query']['hasOwnProperty']('nolimit')){_0x229742[_0x7995('0x1f')]=qs[_0x7995('0x1f')](_0x47625f['query'][_0x7995('0x1f')]);_0x229742['offset']=qs[_0x7995('0x1e')](_0x47625f[_0x7995('0x2f')][_0x7995('0x1e')]);}_0x229742['order']=qs['sort'](_0x47625f[_0x7995('0x2f')]['sort']);_0x229742['where']=qs[_0x7995('0x31')](_[_0x7995('0x36')](_0x47625f['query'],_0x49bc7e[_0x7995('0x31')]));if(_0x47625f[_0x7995('0x2f')][_0x7995('0x37')]){_0x229742[_0x7995('0x38')]=_[_0x7995('0x39')](_0x229742['where'],{'$or':_[_0x7995('0x2a')](_0x132a42,function(_0x242713){if(_0x242713[_0x7995('0x2d')]!==_0x7995('0x3a')){var _0x4b1541={};_0x4b1541[_0x242713[_0x7995('0x28')]]={'$like':'%'+_0x47625f[_0x7995('0x2f')][_0x7995('0x37')]+'%'};return _0x4b1541;}})});}_0x229742=_[_0x7995('0x39')]({},_0x229742,_0x47625f[_0x7995('0x3b')]);var _0x1035dc={'where':_0x229742['where']};return db[_0x7995('0x3c')][_0x7995('0x3d')](_0x1035dc)[_0x7995('0x24')](function(_0x2ea47f){_0xf16cc2[_0x7995('0x3d')]=_0x2ea47f;if(_0x47625f[_0x7995('0x2f')][_0x7995('0x3e')]){_0x229742[_0x7995('0x3f')]=[{'all':!![]}];}return db[_0x7995('0x3c')][_0x7995('0x40')](_0x229742);})[_0x7995('0x24')](function(_0x270d52){_0xf16cc2[_0x7995('0x41')]=_0x270d52;return _0xf16cc2;})['then'](respondWithFilteredResult(_0x5911c3,_0x229742))['catch'](handleError(_0x5911c3,null));};exports[_0x7995('0x42')]=function(_0x7325e8,_0x58523e){var _0x4b0855={'raw':!![],'where':{'id':_0x7325e8['params']['id']}},_0x3f8522={};_0x3f8522['model']=_[_0x7995('0x30')](db[_0x7995('0x3c')][_0x7995('0x2b')]);_0x3f8522['query']=_[_0x7995('0x30')](_0x7325e8['query']);_0x3f8522[_0x7995('0x31')]=_['intersection'](_0x3f8522['model'],_0x3f8522[_0x7995('0x2f')]);_0x4b0855[_0x7995('0x35')]=_[_0x7995('0x32')](_0x3f8522[_0x7995('0x33')],qs['fields'](_0x7325e8[_0x7995('0x2f')][_0x7995('0x34')]));_0x4b0855[_0x7995('0x35')]=_0x4b0855[_0x7995('0x35')]['length']?_0x4b0855['attributes']:_0x3f8522[_0x7995('0x33')];if(_0x7325e8['query'][_0x7995('0x3e')]){_0x4b0855['include']=[{'all':!![]}];}_0x4b0855=_[_0x7995('0x39')]({},_0x4b0855,_0x7325e8['options']);return db[_0x7995('0x3c')][_0x7995('0x43')](_0x4b0855)['then'](handleEntityNotFound(_0x58523e,null))[_0x7995('0x24')](respondWithResult(_0x58523e,null))[_0x7995('0x44')](handleError(_0x58523e,null));};exports[_0x7995('0x45')]=function(_0xb70a51,_0x4c6837){return db[_0x7995('0x3c')][_0x7995('0x45')](_0xb70a51[_0x7995('0x46')],{})['then'](respondWithResult(_0x4c6837,0xc9))[_0x7995('0x44')](handleError(_0x4c6837,null));};exports[_0x7995('0x47')]=function(_0x511567,_0x3d8ae3){if(_0x511567[_0x7995('0x46')]['id']){delete _0x511567['body']['id'];}return db[_0x7995('0x3c')][_0x7995('0x43')]({'where':{'id':_0x511567['params']['id']}})[_0x7995('0x24')](handleEntityNotFound(_0x3d8ae3,null))['then'](saveUpdates(_0x511567[_0x7995('0x46')],null))[_0x7995('0x24')](respondWithResult(_0x3d8ae3,null))[_0x7995('0x44')](handleError(_0x3d8ae3,null));};exports[_0x7995('0x25')]=function(_0xddf537,_0x14b537){return db[_0x7995('0x3c')]['find']({'where':{'id':_0xddf537[_0x7995('0x48')]['id']}})[_0x7995('0x24')](handleEntityNotFound(_0x14b537,null))[_0x7995('0x24')](removeEntity(_0x14b537,null))['catch'](handleError(_0x14b537,null));};exports[_0x7995('0x49')]=function(_0x1fe77e,_0x12d4b8){return db['MailTransferReport']['describe']()['then'](respondWithResult(_0x12d4b8,null))[_0x7995('0x44')](handleError(_0x12d4b8,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index c89b5c2..0ca3758 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 _0x14b9=['request-promise','rimraf','./mailTransferReport.attributes','exports','define','MailTransferReport','report_mail_transfer','lodash','util','../../config/logger','api','bluebird'];(function(_0x85746c,_0x4eb9ca){var _0x4ce212=function(_0x648a0f){while(--_0x648a0f){_0x85746c['push'](_0x85746c['shift']());}};_0x4ce212(++_0x4eb9ca);}(_0x14b9,0x11b));var _0x914b=function(_0x512ae8,_0x389797){_0x512ae8=_0x512ae8-0x0;var _0x476064=_0x14b9[_0x512ae8];return _0x476064;};'use strict';var _=require(_0x914b('0x0'));var util=require(_0x914b('0x1'));var logger=require(_0x914b('0x2'))(_0x914b('0x3'));var moment=require('moment');var BPromise=require(_0x914b('0x4'));var rp=require(_0x914b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x914b('0x6'));var config=require('../../config/environment');var attributes=require(_0x914b('0x7'));module[_0x914b('0x8')]=function(_0x434299,_0xb7441b){return _0x434299[_0x914b('0x9')](_0x914b('0xa'),attributes,{'tableName':_0x914b('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x71a9=['path','./mailTransferReport.attributes','exports','define','report_mail_transfer','uniqueid','lodash','../../config/logger','api','moment','bluebird'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x71a9,0x192));var _0x971a=function(_0x5be926,_0x47be35){_0x5be926=_0x5be926-0x0;var _0x1a8030=_0x71a9[_0x5be926];return _0x1a8030;};'use strict';var _=require(_0x971a('0x0'));var util=require('util');var logger=require(_0x971a('0x1'))(_0x971a('0x2'));var moment=require(_0x971a('0x3'));var BPromise=require(_0x971a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x971a('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x971a('0x6'));module[_0x971a('0x7')]=function(_0x4f5bf6,_0x3fa473){return _0x4f5bf6[_0x971a('0x8')]('MailTransferReport',attributes,{'tableName':_0x971a('0x9'),'paranoid':![],'indexes':[{'name':_0x971a('0xa'),'fields':[_0x971a('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 6d8034e..8d8dbf7 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 _0xe1a6=['ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','info','MailTransferReport,\x20%s,\x20%s','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xe1a6,0xf8));var _0x6e1a=function(_0x134779,_0x21c3a7){_0x134779=_0x134779-0x0;var _0x32b48f=_0xe1a6[_0x134779];return _0x32b48f;};'use strict';var _=require(_0x6e1a('0x0'));var util=require(_0x6e1a('0x1'));var moment=require(_0x6e1a('0x2'));var BPromise=require(_0x6e1a('0x3'));var rs=require(_0x6e1a('0x4'));var fs=require('fs');var Redis=require(_0x6e1a('0x5'));var db=require(_0x6e1a('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x6e1a('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6e1a('0x8'));var client=jayson[_0x6e1a('0x9')][_0x6e1a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xa62e5,_0x1235a3,_0x115413){return new BPromise(function(_0x322693,_0x57f25c){return client[_0x6e1a('0xb')](_0xa62e5,_0x115413)[_0x6e1a('0xc')](function(_0x5b804d){logger[_0x6e1a('0xd')](_0x6e1a('0xe'),_0x1235a3,'request\x20sent');logger[_0x6e1a('0xf')](_0x6e1a('0x10'),_0x1235a3,_0x6e1a('0x11'),JSON[_0x6e1a('0x12')](_0x5b804d));if(_0x5b804d['error']){if(_0x5b804d[_0x6e1a('0x13')]['code']===0x1f4){logger[_0x6e1a('0x13')](_0x6e1a('0xe'),_0x1235a3,_0x5b804d[_0x6e1a('0x13')][_0x6e1a('0x14')]);return _0x57f25c(_0x5b804d['error'][_0x6e1a('0x14')]);}logger[_0x6e1a('0x13')](_0x6e1a('0xe'),_0x1235a3,_0x5b804d['error'][_0x6e1a('0x14')]);return _0x322693(_0x5b804d[_0x6e1a('0x13')]['message']);}else{logger[_0x6e1a('0xd')]('MailTransferReport,\x20%s,\x20%s',_0x1235a3,_0x6e1a('0x11'));_0x322693(_0x5b804d[_0x6e1a('0x15')][_0x6e1a('0x14')]);}})[_0x6e1a('0x16')](function(_0xd69c9c){logger[_0x6e1a('0x13')](_0x6e1a('0xe'),_0x1235a3,_0xd69c9c);_0x57f25c(_0xd69c9c);});});} \ No newline at end of file +var _0x102c=['debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','code','MailTransferReport,\x20%s,\x20%s','error','message','result','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','request\x20sent'];(function(_0x259d17,_0x220710){var _0x407535=function(_0x49bc38){while(--_0x49bc38){_0x259d17['push'](_0x259d17['shift']());}};_0x407535(++_0x220710);}(_0x102c,0x13c));var _0xc102=function(_0x1eda20,_0x1149f4){_0x1eda20=_0x1eda20-0x0;var _0x31b953=_0x102c[_0x1eda20];return _0x31b953;};'use strict';var _=require('lodash');var util=require(_0xc102('0x0'));var moment=require(_0xc102('0x1'));var BPromise=require(_0xc102('0x2'));var rs=require(_0xc102('0x3'));var fs=require('fs');var Redis=require(_0xc102('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc102('0x5'));var logger=require(_0xc102('0x6'))(_0xc102('0x7'));var config=require(_0xc102('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc102('0x9')][_0xc102('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x192a31,_0x415f2c,_0x274477){return new BPromise(function(_0x86a067,_0x5c1108){return client[_0xc102('0xb')](_0x192a31,_0x274477)[_0xc102('0xc')](function(_0x265873){logger['info']('MailTransferReport,\x20%s,\x20%s',_0x415f2c,_0xc102('0xd'));logger[_0xc102('0xe')](_0xc102('0xf'),_0x415f2c,_0xc102('0xd'),JSON[_0xc102('0x10')](_0x265873));if(_0x265873['error']){if(_0x265873['error'][_0xc102('0x11')]===0x1f4){logger['error'](_0xc102('0x12'),_0x415f2c,_0x265873[_0xc102('0x13')][_0xc102('0x14')]);return _0x5c1108(_0x265873['error']['message']);}logger[_0xc102('0x13')](_0xc102('0x12'),_0x415f2c,_0x265873[_0xc102('0x13')]['message']);return _0x86a067(_0x265873[_0xc102('0x13')]['message']);}else{logger['info'](_0xc102('0x12'),_0x415f2c,'request\x20sent');_0x86a067(_0x265873[_0xc102('0x15')][_0xc102('0x14')]);}})['catch'](function(_0x2b683c){logger['error'](_0xc102('0x12'),_0x415f2c,_0x2b683c);_0x5c1108(_0x2b683c);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 2a9293a..825a31e 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 _0x9d4b=['multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./memberReport.controller','get','index','/describe','describe','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports'];(function(_0x18c844,_0x4c886a){var _0x7d7b36=function(_0x1eb18e){while(--_0x1eb18e){_0x18c844['push'](_0x18c844['shift']());}};_0x7d7b36(++_0x4c886a);}(_0x9d4b,0xdc));var _0xb9d4=function(_0x5cb282,_0x43d966){_0x5cb282=_0x5cb282-0x0;var _0x39e0f2=_0x9d4b[_0x5cb282];return _0x39e0f2;};'use strict';var multer=require(_0xb9d4('0x0'));var util=require('util');var path=require(_0xb9d4('0x1'));var timeout=require(_0xb9d4('0x2'));var express=require(_0xb9d4('0x3'));var router=express[_0xb9d4('0x4')]();var auth=require(_0xb9d4('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb9d4('0x6'));var controller=require(_0xb9d4('0x7'));router[_0xb9d4('0x8')]('/',auth['isAuthenticated'](),controller[_0xb9d4('0x9')]);router[_0xb9d4('0x8')](_0xb9d4('0xa'),auth['isAuthenticated'](),controller[_0xb9d4('0xb')]);router[_0xb9d4('0x8')](_0xb9d4('0xc'),auth[_0xb9d4('0xd')](),controller[_0xb9d4('0xe')]);router[_0xb9d4('0xf')]('/',auth[_0xb9d4('0xd')](),controller[_0xb9d4('0x10')]);router[_0xb9d4('0x11')]('/:id',auth[_0xb9d4('0xd')](),controller[_0xb9d4('0x12')]);router[_0xb9d4('0x13')](_0xb9d4('0xc'),auth[_0xb9d4('0xd')](),controller[_0xb9d4('0x14')]);module[_0xb9d4('0x15')]=router; \ No newline at end of file +var _0x5762=['put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./memberReport.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5762,0xc2));var _0x2576=function(_0x3efbff,_0x3d6b69){_0x3efbff=_0x3efbff-0x0;var _0x3997e8=_0x5762[_0x3efbff];return _0x3997e8;};'use strict';var multer=require(_0x2576('0x0'));var util=require(_0x2576('0x1'));var path=require(_0x2576('0x2'));var timeout=require(_0x2576('0x3'));var express=require(_0x2576('0x4'));var router=express[_0x2576('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x2576('0x6'));var config=require(_0x2576('0x7'));var controller=require(_0x2576('0x8'));router[_0x2576('0x9')]('/',auth[_0x2576('0xa')](),controller[_0x2576('0xb')]);router[_0x2576('0x9')](_0x2576('0xc'),auth['isAuthenticated'](),controller[_0x2576('0xd')]);router['get'](_0x2576('0xe'),auth[_0x2576('0xa')](),controller['show']);router['post']('/',auth[_0x2576('0xa')](),controller['create']);router[_0x2576('0xf')](_0x2576('0xe'),auth[_0x2576('0xa')](),controller[_0x2576('0x10')]);router['delete'](_0x2576('0xe'),auth[_0x2576('0xa')](),controller[_0x2576('0x11')]);module[_0x2576('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 da1333f..8015548 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 _0x89b4=['setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','moment','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','DATE','getDataValue','diff','seconds'];(function(_0x23cff7,_0x1a67a9){var _0x47039f=function(_0x3c8f13){while(--_0x3c8f13){_0x23cff7['push'](_0x23cff7['shift']());}};_0x47039f(++_0x1a67a9);}(_0x89b4,0x148));var _0x489b=function(_0x170d18,_0x1c3cbf){_0x170d18=_0x170d18-0x0;var _0x427188=_0x89b4[_0x170d18];return _0x427188;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x489b('0x0'));module['exports']={'channel':{'type':Sequelize[_0x489b('0x1')]},'membername':{'type':Sequelize[_0x489b('0x1')]},'interface':{'type':Sequelize[_0x489b('0x1')]},'type':{'type':Sequelize[_0x489b('0x1')],'defaultValue':_0x489b('0x2'),'comment':_0x489b('0x3')},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x489b('0x4')],'set':function(_0xe5d053){var _0x21d81c=moment(_0xe5d053);var _0x312265=moment(this[_0x489b('0x5')]('enterAt'));var _0x34722a=_0x21d81c[_0x489b('0x6')](_0x312265,_0x489b('0x7'));this[_0x489b('0x8')](_0x489b('0x9'),_0xe5d053);this[_0x489b('0x8')](_0x489b('0xa'),_0x34722a||null);}},'data1':{'type':Sequelize[_0x489b('0x1')],'comment':_0x489b('0xb')},'data2':{'type':Sequelize[_0x489b('0x1')],'comment':_0x489b('0xc')},'data3':{'type':Sequelize[_0x489b('0x1')],'comment':_0x489b('0xd')},'data4':{'type':Sequelize['STRING'],'comment':_0x489b('0xe')},'data5':{'type':Sequelize[_0x489b('0x1')],'comment':_0x489b('0xf')},'role':{'type':Sequelize[_0x489b('0x1')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x489b('0x1')]}}; \ No newline at end of file +var _0xabbf=['talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt','diff','seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]'];(function(_0x103439,_0x5e8846){var _0x18ca99=function(_0x329cb3){while(--_0x329cb3){_0x103439['push'](_0x103439['shift']());}};_0x18ca99(++_0x5e8846);}(_0xabbf,0x159));var _0xfabb=function(_0x2132a3,_0x4639e9){_0x2132a3=_0x2132a3-0x0;var _0x21890c=_0xabbf[_0x2132a3];return _0x21890c;};'use strict';var Sequelize=require(_0xfabb('0x0'));var moment=require(_0xfabb('0x1'));module[_0xfabb('0x2')]={'channel':{'type':Sequelize[_0xfabb('0x3')]},'membername':{'type':Sequelize[_0xfabb('0x3')]},'interface':{'type':Sequelize[_0xfabb('0x3')]},'type':{'type':Sequelize[_0xfabb('0x3')],'defaultValue':_0xfabb('0x4'),'comment':_0xfabb('0x5')},'duration':{'type':Sequelize[_0xfabb('0x6')]},'enterAt':{'type':Sequelize[_0xfabb('0x7')]},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x5b14cc){var _0x242eae=moment(_0x5b14cc);var _0x54684f=moment(this[_0xfabb('0x8')](_0xfabb('0x9')));var _0x4a314b=_0x242eae[_0xfabb('0xa')](_0x54684f,_0xfabb('0xb'));this[_0xfabb('0xc')](_0xfabb('0xd'),_0x5b14cc);this[_0xfabb('0xc')](_0xfabb('0xe'),_0x4a314b||null);}},'data1':{'type':Sequelize['STRING'],'comment':_0xfabb('0xf')},'data2':{'type':Sequelize['STRING'],'comment':'talk:[start]'},'data3':{'type':Sequelize[_0xfabb('0x3')],'comment':_0xfabb('0x10')},'data4':{'type':Sequelize[_0xfabb('0x3')],'comment':_0xfabb('0x11')},'data5':{'type':Sequelize[_0xfabb('0x3')],'comment':_0xfabb('0x12')},'role':{'type':Sequelize[_0xfabb('0x3')]},'internal':{'type':Sequelize[_0xfabb('0x6')]},'uniqueid':{'type':Sequelize[_0xfabb('0x3')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index ad5ca43..97b2f14 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 _0x04a3=['to-csv','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','status','end','offset','set','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','send','index','map','MemberReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','options','count','includeAll','include','findAll','catch','show','params','create','body','find','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache'];(function(_0x34835b,_0x33bf31){var _0x4fa609=function(_0x452c70){while(--_0x452c70){_0x34835b['push'](_0x34835b['shift']());}};_0x4fa609(++_0x33bf31);}(_0x04a3,0x179));var _0x304a=function(_0x612a71,_0xb27d3f){_0x612a71=_0x612a71-0x0;var _0xb07bc1=_0x04a3[_0x612a71];return _0xb07bc1;};'use strict';var pdf=require(_0x304a('0x0'));var emlformat=require(_0x304a('0x1'));var rimraf=require(_0x304a('0x2'));var zipdir=require(_0x304a('0x3'));var jsonpatch=require(_0x304a('0x4'));var rp=require('request-promise');var moment=require(_0x304a('0x5'));var BPromise=require(_0x304a('0x6'));var Mustache=require(_0x304a('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x304a('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x304a('0x9'));var squel=require(_0x304a('0xa'));var crypto=require(_0x304a('0xb'));var jsforce=require(_0x304a('0xc'));var deskjs=require(_0x304a('0xd'));var toCsv=require('to-csv');var querystring=require(_0x304a('0xe'));var Papa=require(_0x304a('0xf'));var Redis=require(_0x304a('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x304a('0x11'));var as=require(_0x304a('0x12'));var hardwareService=require(_0x304a('0x13'));var logger=require(_0x304a('0x14'))(_0x304a('0x15'));var utils=require(_0x304a('0x16'));var config=require(_0x304a('0x17'));var db=require(_0x304a('0x18'))['db'];function respondWithStatusCode(_0x515437,_0x19bb7b){_0x19bb7b=_0x19bb7b||0xcc;return function(_0x289017){if(_0x289017){return _0x515437['sendStatus'](_0x19bb7b);}return _0x515437[_0x304a('0x19')](_0x19bb7b)[_0x304a('0x1a')]();};}function respondWithResult(_0x1161e8,_0x4de985){_0x4de985=_0x4de985||0xc8;return function(_0x8833f3){if(_0x8833f3){return _0x1161e8['status'](_0x4de985)['json'](_0x8833f3);}};}function respondWithFilteredResult(_0x9861d4,_0x49d161){return function(_0xabbdee){if(_0xabbdee){var _0x2d231f=_0xabbdee['count'],_0x991d16=_0x49d161[_0x304a('0x1b')],_0x5b928a=_0x49d161[_0x304a('0x1b')]+_0x49d161['limit'],_0x22026e;if(_0x5b928a>=_0x2d231f){_0x5b928a=_0x2d231f;_0x22026e=0xc8;}else{_0x22026e=0xce;}_0x9861d4[_0x304a('0x19')](_0x22026e);return _0x9861d4[_0x304a('0x1c')](_0x304a('0x1d'),_0x991d16+'-'+_0x5b928a+'/'+_0x2d231f)[_0x304a('0x1e')](_0xabbdee);}return null;};}function patchUpdates(_0x56afb4){return function(_0x57aecd){try{jsonpatch[_0x304a('0x1f')](_0x57aecd,_0x56afb4,!![]);}catch(_0x4299ab){return BPromise[_0x304a('0x20')](_0x4299ab);}return _0x57aecd['save']();};}function saveUpdates(_0x3a9171,_0x49cd8e){return function(_0x42e5ac){if(_0x42e5ac){return _0x42e5ac[_0x304a('0x21')](_0x3a9171)[_0x304a('0x22')](function(_0x5bc529){return _0x5bc529;});}return null;};}function removeEntity(_0x22918c,_0x189608){return function(_0x12df42){if(_0x12df42){return _0x12df42[_0x304a('0x23')]()[_0x304a('0x22')](function(){_0x22918c[_0x304a('0x19')](0xcc)[_0x304a('0x1a')]();});}};}function handleEntityNotFound(_0x4640fc,_0x525e55){return function(_0x1ff8bb){if(!_0x1ff8bb){_0x4640fc['sendStatus'](0x194);}return _0x1ff8bb;};}function handleError(_0x1450df,_0x37ac37){_0x37ac37=_0x37ac37||0x1f4;return function(_0xfeda7){logger[_0x304a('0x24')](_0xfeda7[_0x304a('0x25')]);if(_0xfeda7[_0x304a('0x26')]){delete _0xfeda7['name'];}_0x1450df[_0x304a('0x19')](_0x37ac37)[_0x304a('0x27')](_0xfeda7);};}exports[_0x304a('0x28')]=function(_0x5e47db,_0x1630f0){var _0x9886c3={},_0x45c872={},_0x2b5014={'count':0x0,'rows':[]};var _0xbed083=_[_0x304a('0x29')](db[_0x304a('0x2a')][_0x304a('0x2b')],function(_0x5ce53b){return{'name':_0x5ce53b[_0x304a('0x2c')],'type':_0x5ce53b[_0x304a('0x2d')][_0x304a('0x2e')]};});_0x45c872[_0x304a('0x2f')]=_[_0x304a('0x29')](_0xbed083,_0x304a('0x26'));_0x45c872[_0x304a('0x30')]=_[_0x304a('0x31')](_0x5e47db[_0x304a('0x30')]);_0x45c872[_0x304a('0x32')]=_[_0x304a('0x33')](_0x45c872['model'],_0x45c872[_0x304a('0x30')]);_0x9886c3[_0x304a('0x34')]=_[_0x304a('0x33')](_0x45c872[_0x304a('0x2f')],qs[_0x304a('0x35')](_0x5e47db['query']['fields']));_0x9886c3[_0x304a('0x34')]=_0x9886c3[_0x304a('0x34')][_0x304a('0x36')]?_0x9886c3[_0x304a('0x34')]:_0x45c872[_0x304a('0x2f')];if(!_0x5e47db[_0x304a('0x30')][_0x304a('0x37')](_0x304a('0x38'))){_0x9886c3['limit']=qs['limit'](_0x5e47db[_0x304a('0x30')][_0x304a('0x39')]);_0x9886c3[_0x304a('0x1b')]=qs['offset'](_0x5e47db['query']['offset']);}_0x9886c3[_0x304a('0x3a')]=qs[_0x304a('0x3b')](_0x5e47db[_0x304a('0x30')][_0x304a('0x3b')]);_0x9886c3['where']=qs[_0x304a('0x32')](_[_0x304a('0x3c')](_0x5e47db[_0x304a('0x30')],_0x45c872[_0x304a('0x32')]));if(_0x5e47db[_0x304a('0x30')][_0x304a('0x3d')]){_0x9886c3[_0x304a('0x3e')]=_[_0x304a('0x3f')](_0x9886c3['where'],{'$or':_[_0x304a('0x29')](_0xbed083,function(_0x29a9e0){if(_0x29a9e0['type']!==_0x304a('0x40')){var _0x5cd9ec={};_0x5cd9ec[_0x29a9e0[_0x304a('0x26')]]={'$like':'%'+_0x5e47db[_0x304a('0x30')][_0x304a('0x3d')]+'%'};return _0x5cd9ec;}})});}_0x9886c3=_[_0x304a('0x3f')]({},_0x9886c3,_0x5e47db[_0x304a('0x41')]);var _0x1a86dc={'where':_0x9886c3[_0x304a('0x3e')]};return db[_0x304a('0x2a')]['count'](_0x1a86dc)[_0x304a('0x22')](function(_0x3a3abb){_0x2b5014[_0x304a('0x42')]=_0x3a3abb;if(_0x5e47db[_0x304a('0x30')][_0x304a('0x43')]){_0x9886c3[_0x304a('0x44')]=[{'all':!![]}];}return db[_0x304a('0x2a')][_0x304a('0x45')](_0x9886c3);})[_0x304a('0x22')](function(_0x2c82a7){_0x2b5014['rows']=_0x2c82a7;return _0x2b5014;})[_0x304a('0x22')](respondWithFilteredResult(_0x1630f0,_0x9886c3))[_0x304a('0x46')](handleError(_0x1630f0,null));};exports[_0x304a('0x47')]=function(_0x30ec04,_0x38357e){var _0x38699f={'raw':!![],'where':{'id':_0x30ec04[_0x304a('0x48')]['id']}},_0x5e55c5={};_0x5e55c5['model']=_[_0x304a('0x31')](db[_0x304a('0x2a')][_0x304a('0x2b')]);_0x5e55c5['query']=_[_0x304a('0x31')](_0x30ec04[_0x304a('0x30')]);_0x5e55c5[_0x304a('0x32')]=_[_0x304a('0x33')](_0x5e55c5[_0x304a('0x2f')],_0x5e55c5[_0x304a('0x30')]);_0x38699f[_0x304a('0x34')]=_[_0x304a('0x33')](_0x5e55c5[_0x304a('0x2f')],qs[_0x304a('0x35')](_0x30ec04['query'][_0x304a('0x35')]));_0x38699f[_0x304a('0x34')]=_0x38699f[_0x304a('0x34')]['length']?_0x38699f[_0x304a('0x34')]:_0x5e55c5['model'];if(_0x30ec04[_0x304a('0x30')]['includeAll']){_0x38699f[_0x304a('0x44')]=[{'all':!![]}];}_0x38699f=_[_0x304a('0x3f')]({},_0x38699f,_0x30ec04[_0x304a('0x41')]);return db[_0x304a('0x2a')]['find'](_0x38699f)[_0x304a('0x22')](handleEntityNotFound(_0x38357e,null))[_0x304a('0x22')](respondWithResult(_0x38357e,null))[_0x304a('0x46')](handleError(_0x38357e,null));};exports[_0x304a('0x49')]=function(_0x4bbf01,_0x269977){return db[_0x304a('0x2a')][_0x304a('0x49')](_0x4bbf01[_0x304a('0x4a')],{})[_0x304a('0x22')](respondWithResult(_0x269977,0xc9))['catch'](handleError(_0x269977,null));};exports[_0x304a('0x21')]=function(_0x9b1640,_0x2cd02a){if(_0x9b1640[_0x304a('0x4a')]['id']){delete _0x9b1640[_0x304a('0x4a')]['id'];}return db['MemberReport'][_0x304a('0x4b')]({'where':{'id':_0x9b1640[_0x304a('0x48')]['id']}})[_0x304a('0x22')](handleEntityNotFound(_0x2cd02a,null))['then'](saveUpdates(_0x9b1640[_0x304a('0x4a')],null))[_0x304a('0x22')](respondWithResult(_0x2cd02a,null))[_0x304a('0x46')](handleError(_0x2cd02a,null));};exports[_0x304a('0x23')]=function(_0x2f06e4,_0x4d6963){return db[_0x304a('0x2a')][_0x304a('0x4b')]({'where':{'id':_0x2f06e4['params']['id']}})['then'](handleEntityNotFound(_0x4d6963,null))[_0x304a('0x22')](removeEntity(_0x4d6963,null))[_0x304a('0x46')](handleError(_0x4d6963,null));};exports[_0x304a('0x4c')]=function(_0x4b1559,_0x5bce08){return db[_0x304a('0x2a')]['describe']()[_0x304a('0x22')](respondWithResult(_0x5bce08,null))[_0x304a('0x46')](handleError(_0x5bce08,null));}; \ No newline at end of file +var _0x1ef5=['fieldName','type','key','map','query','model','attributes','intersection','fields','length','hasOwnProperty','limit','order','sort','pick','filters','filter','merge','where','options','includeAll','include','findAll','rows','catch','show','params','keys','create','body','find','describe','html-pdf','eml-format','rimraf','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','MemberReport','rawAttributes'];(function(_0x180f51,_0x2eb971){var _0x4b5666=function(_0x3601e2){while(--_0x3601e2){_0x180f51['push'](_0x180f51['shift']());}};_0x4b5666(++_0x2eb971);}(_0x1ef5,0x1dc));var _0x51ef=function(_0x5c0c4b,_0x37171c){_0x5c0c4b=_0x5c0c4b-0x0;var _0x3de10d=_0x1ef5[_0x5c0c4b];return _0x3de10d;};'use strict';var pdf=require(_0x51ef('0x0'));var emlformat=require(_0x51ef('0x1'));var rimraf=require(_0x51ef('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x51ef('0x3'));var BPromise=require(_0x51ef('0x4'));var Mustache=require(_0x51ef('0x5'));var util=require(_0x51ef('0x6'));var path=require(_0x51ef('0x7'));var sox=require(_0x51ef('0x8'));var csv=require(_0x51ef('0x9'));var ejs=require(_0x51ef('0xa'));var fs=require('fs');var _=require(_0x51ef('0xb'));var squel=require(_0x51ef('0xc'));var crypto=require('crypto');var jsforce=require(_0x51ef('0xd'));var deskjs=require(_0x51ef('0xe'));var toCsv=require(_0x51ef('0x9'));var querystring=require(_0x51ef('0xf'));var Papa=require(_0x51ef('0x10'));var Redis=require('ioredis');var authService=require(_0x51ef('0x11'));var qs=require(_0x51ef('0x12'));var as=require(_0x51ef('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x51ef('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x51ef('0x15'));var db=require(_0x51ef('0x16'))['db'];function respondWithStatusCode(_0x363b6e,_0x656386){_0x656386=_0x656386||0xcc;return function(_0x4d821d){if(_0x4d821d){return _0x363b6e[_0x51ef('0x17')](_0x656386);}return _0x363b6e[_0x51ef('0x18')](_0x656386)[_0x51ef('0x19')]();};}function respondWithResult(_0x26b938,_0x4856c3){_0x4856c3=_0x4856c3||0xc8;return function(_0x484f7b){if(_0x484f7b){return _0x26b938[_0x51ef('0x18')](_0x4856c3)[_0x51ef('0x1a')](_0x484f7b);}};}function respondWithFilteredResult(_0x5b04a0,_0x259b11){return function(_0x558dfa){if(_0x558dfa){var _0x58527e=_0x558dfa[_0x51ef('0x1b')],_0x12d114=_0x259b11[_0x51ef('0x1c')],_0x3e9670=_0x259b11[_0x51ef('0x1c')]+_0x259b11['limit'],_0xdc966;if(_0x3e9670>=_0x58527e){_0x3e9670=_0x58527e;_0xdc966=0xc8;}else{_0xdc966=0xce;}_0x5b04a0['status'](_0xdc966);return _0x5b04a0[_0x51ef('0x1d')](_0x51ef('0x1e'),_0x12d114+'-'+_0x3e9670+'/'+_0x58527e)[_0x51ef('0x1a')](_0x558dfa);}return null;};}function patchUpdates(_0x18ea85){return function(_0x48b31a){try{jsonpatch[_0x51ef('0x1f')](_0x48b31a,_0x18ea85,!![]);}catch(_0x1b45ef){return BPromise[_0x51ef('0x20')](_0x1b45ef);}return _0x48b31a[_0x51ef('0x21')]();};}function saveUpdates(_0x327e33,_0x5ed38c){return function(_0xdec221){if(_0xdec221){return _0xdec221[_0x51ef('0x22')](_0x327e33)['then'](function(_0x342a6b){return _0x342a6b;});}return null;};}function removeEntity(_0x426731,_0x5e28b5){return function(_0x4d1cf6){if(_0x4d1cf6){return _0x4d1cf6[_0x51ef('0x23')]()[_0x51ef('0x24')](function(){_0x426731['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x580f66,_0x3056da){return function(_0x47c825){if(!_0x47c825){_0x580f66[_0x51ef('0x17')](0x194);}return _0x47c825;};}function handleError(_0xbeb25d,_0x4a730a){_0x4a730a=_0x4a730a||0x1f4;return function(_0x1e69e1){logger['error'](_0x1e69e1[_0x51ef('0x25')]);if(_0x1e69e1[_0x51ef('0x26')]){delete _0x1e69e1[_0x51ef('0x26')];}_0xbeb25d[_0x51ef('0x18')](_0x4a730a)[_0x51ef('0x27')](_0x1e69e1);};}exports['index']=function(_0x135b11,_0x3a8314){var _0x16e8d2={},_0x270ab9={},_0x58a1b8={'count':0x0,'rows':[]};var _0x4c6af9=_['map'](db[_0x51ef('0x28')][_0x51ef('0x29')],function(_0x1d31d5){return{'name':_0x1d31d5[_0x51ef('0x2a')],'type':_0x1d31d5[_0x51ef('0x2b')][_0x51ef('0x2c')]};});_0x270ab9['model']=_[_0x51ef('0x2d')](_0x4c6af9,'name');_0x270ab9[_0x51ef('0x2e')]=_['keys'](_0x135b11[_0x51ef('0x2e')]);_0x270ab9['filters']=_['intersection'](_0x270ab9[_0x51ef('0x2f')],_0x270ab9[_0x51ef('0x2e')]);_0x16e8d2[_0x51ef('0x30')]=_[_0x51ef('0x31')](_0x270ab9['model'],qs[_0x51ef('0x32')](_0x135b11[_0x51ef('0x2e')]['fields']));_0x16e8d2[_0x51ef('0x30')]=_0x16e8d2[_0x51ef('0x30')][_0x51ef('0x33')]?_0x16e8d2[_0x51ef('0x30')]:_0x270ab9[_0x51ef('0x2f')];if(!_0x135b11[_0x51ef('0x2e')][_0x51ef('0x34')]('nolimit')){_0x16e8d2[_0x51ef('0x35')]=qs[_0x51ef('0x35')](_0x135b11['query'][_0x51ef('0x35')]);_0x16e8d2[_0x51ef('0x1c')]=qs[_0x51ef('0x1c')](_0x135b11[_0x51ef('0x2e')]['offset']);}_0x16e8d2[_0x51ef('0x36')]=qs['sort'](_0x135b11[_0x51ef('0x2e')][_0x51ef('0x37')]);_0x16e8d2['where']=qs['filters'](_[_0x51ef('0x38')](_0x135b11[_0x51ef('0x2e')],_0x270ab9[_0x51ef('0x39')]));if(_0x135b11[_0x51ef('0x2e')][_0x51ef('0x3a')]){_0x16e8d2['where']=_[_0x51ef('0x3b')](_0x16e8d2[_0x51ef('0x3c')],{'$or':_[_0x51ef('0x2d')](_0x4c6af9,function(_0x4df13d){if(_0x4df13d[_0x51ef('0x2b')]!=='VIRTUAL'){var _0x27ae03={};_0x27ae03[_0x4df13d['name']]={'$like':'%'+_0x135b11['query']['filter']+'%'};return _0x27ae03;}})});}_0x16e8d2=_['merge']({},_0x16e8d2,_0x135b11[_0x51ef('0x3d')]);var _0x5c48a5={'where':_0x16e8d2[_0x51ef('0x3c')]};return db[_0x51ef('0x28')][_0x51ef('0x1b')](_0x5c48a5)[_0x51ef('0x24')](function(_0xcb7f9){_0x58a1b8[_0x51ef('0x1b')]=_0xcb7f9;if(_0x135b11[_0x51ef('0x2e')][_0x51ef('0x3e')]){_0x16e8d2[_0x51ef('0x3f')]=[{'all':!![]}];}return db[_0x51ef('0x28')][_0x51ef('0x40')](_0x16e8d2);})[_0x51ef('0x24')](function(_0x420e2d){_0x58a1b8[_0x51ef('0x41')]=_0x420e2d;return _0x58a1b8;})[_0x51ef('0x24')](respondWithFilteredResult(_0x3a8314,_0x16e8d2))[_0x51ef('0x42')](handleError(_0x3a8314,null));};exports[_0x51ef('0x43')]=function(_0x50d0b1,_0x3fb9d5){var _0x3850c3={'raw':!![],'where':{'id':_0x50d0b1[_0x51ef('0x44')]['id']}},_0xa9c928={};_0xa9c928[_0x51ef('0x2f')]=_[_0x51ef('0x45')](db[_0x51ef('0x28')][_0x51ef('0x29')]);_0xa9c928['query']=_['keys'](_0x50d0b1[_0x51ef('0x2e')]);_0xa9c928[_0x51ef('0x39')]=_[_0x51ef('0x31')](_0xa9c928[_0x51ef('0x2f')],_0xa9c928['query']);_0x3850c3[_0x51ef('0x30')]=_['intersection'](_0xa9c928[_0x51ef('0x2f')],qs[_0x51ef('0x32')](_0x50d0b1[_0x51ef('0x2e')][_0x51ef('0x32')]));_0x3850c3[_0x51ef('0x30')]=_0x3850c3[_0x51ef('0x30')]['length']?_0x3850c3[_0x51ef('0x30')]:_0xa9c928[_0x51ef('0x2f')];if(_0x50d0b1[_0x51ef('0x2e')][_0x51ef('0x3e')]){_0x3850c3[_0x51ef('0x3f')]=[{'all':!![]}];}_0x3850c3=_['merge']({},_0x3850c3,_0x50d0b1['options']);return db[_0x51ef('0x28')]['find'](_0x3850c3)[_0x51ef('0x24')](handleEntityNotFound(_0x3fb9d5,null))[_0x51ef('0x24')](respondWithResult(_0x3fb9d5,null))[_0x51ef('0x42')](handleError(_0x3fb9d5,null));};exports[_0x51ef('0x46')]=function(_0x2eb49b,_0x3e4ffd){return db[_0x51ef('0x28')][_0x51ef('0x46')](_0x2eb49b[_0x51ef('0x47')],{})[_0x51ef('0x24')](respondWithResult(_0x3e4ffd,0xc9))[_0x51ef('0x42')](handleError(_0x3e4ffd,null));};exports[_0x51ef('0x22')]=function(_0x255cb2,_0x1685b8){if(_0x255cb2[_0x51ef('0x47')]['id']){delete _0x255cb2[_0x51ef('0x47')]['id'];}return db['MemberReport']['find']({'where':{'id':_0x255cb2[_0x51ef('0x44')]['id']}})['then'](handleEntityNotFound(_0x1685b8,null))['then'](saveUpdates(_0x255cb2[_0x51ef('0x47')],null))[_0x51ef('0x24')](respondWithResult(_0x1685b8,null))['catch'](handleError(_0x1685b8,null));};exports['destroy']=function(_0x258c93,_0x884330){return db[_0x51ef('0x28')][_0x51ef('0x48')]({'where':{'id':_0x258c93[_0x51ef('0x44')]['id']}})[_0x51ef('0x24')](handleEntityNotFound(_0x884330,null))[_0x51ef('0x24')](removeEntity(_0x884330,null))[_0x51ef('0x42')](handleError(_0x884330,null));};exports[_0x51ef('0x49')]=function(_0x92c2bc,_0x44569e){return db['MemberReport'][_0x51ef('0x49')]()[_0x51ef('0x24')](respondWithResult(_0x44569e,null))[_0x51ef('0x42')](handleError(_0x44569e,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 4d2a85b..0e81d30 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 _0xdcfc=['moment','bluebird','request-promise','path','rimraf','../../config/environment','define','report_member','membername_interface','membername','interface','lodash','util','../../config/logger','api'];(function(_0x59334d,_0x1e88a7){var _0x59fa2f=function(_0x280a6d){while(--_0x280a6d){_0x59334d['push'](_0x59334d['shift']());}};_0x59fa2f(++_0x1e88a7);}(_0xdcfc,0x1eb));var _0xcdcf=function(_0x50492a,_0x258275){_0x50492a=_0x50492a-0x0;var _0x10d731=_0xdcfc[_0x50492a];return _0x10d731;};'use strict';var _=require(_0xcdcf('0x0'));var util=require(_0xcdcf('0x1'));var logger=require(_0xcdcf('0x2'))(_0xcdcf('0x3'));var moment=require(_0xcdcf('0x4'));var BPromise=require(_0xcdcf('0x5'));var rp=require(_0xcdcf('0x6'));var fs=require('fs');var path=require(_0xcdcf('0x7'));var rimraf=require(_0xcdcf('0x8'));var config=require(_0xcdcf('0x9'));var attributes=require('./memberReport.attributes');module['exports']=function(_0x4e6001,_0x4f38d7){return _0x4e6001[_0xcdcf('0xa')]('MemberReport',attributes,{'tableName':_0xcdcf('0xb'),'paranoid':![],'indexes':[{'name':_0xcdcf('0xc'),'fields':[_0xcdcf('0xd'),_0xcdcf('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x05a6=['../../config/environment','./memberReport.attributes','exports','define','MemberReport','report_member','lodash','util','../../config/logger','moment','request-promise','path','rimraf'];(function(_0x31d54d,_0x3ebd1e){var _0x297119=function(_0x20e131){while(--_0x20e131){_0x31d54d['push'](_0x31d54d['shift']());}};_0x297119(++_0x3ebd1e);}(_0x05a6,0x172));var _0x605a=function(_0x340380,_0x4bd2a8){_0x340380=_0x340380-0x0;var _0x49ce1c=_0x05a6[_0x340380];return _0x49ce1c;};'use strict';var _=require(_0x605a('0x0'));var util=require(_0x605a('0x1'));var logger=require(_0x605a('0x2'))('api');var moment=require(_0x605a('0x3'));var BPromise=require('bluebird');var rp=require(_0x605a('0x4'));var fs=require('fs');var path=require(_0x605a('0x5'));var rimraf=require(_0x605a('0x6'));var config=require(_0x605a('0x7'));var attributes=require(_0x605a('0x8'));module[_0x605a('0x9')]=function(_0x3f7b35,_0x1c83db){return _0x3f7b35[_0x605a('0xa')](_0x605a('0xb'),attributes,{'tableName':_0x605a('0xc'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':['membername','interface']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 523e7a8..7bf2377 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 _0x9a3a=['../../config/utils','rpc','../../config/environment','client','http','request','then','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','MemberReport','findAll','options','raw','where','attributes','include','map','model','GetMemberReport','create','body','CreateMemberReport','UpdateMemberReport','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3d8835,_0x300463){var _0x3aa717=function(_0xacb6a8){while(--_0xacb6a8){_0x3d8835['push'](_0x3d8835['shift']());}};_0x3aa717(++_0x300463);}(_0x9a3a,0xe9));var _0xa9a3=function(_0x49bb21,_0x1ee069){_0x49bb21=_0x49bb21-0x0;var _0x140777=_0x9a3a[_0x49bb21];return _0x140777;};'use strict';var _=require(_0xa9a3('0x0'));var util=require(_0xa9a3('0x1'));var moment=require(_0xa9a3('0x2'));var BPromise=require(_0xa9a3('0x3'));var rs=require(_0xa9a3('0x4'));var fs=require('fs');var Redis=require(_0xa9a3('0x5'));var db=require(_0xa9a3('0x6'))['db'];var utils=require(_0xa9a3('0x7'));var logger=require('../../config/logger')(_0xa9a3('0x8'));var config=require(_0xa9a3('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa9a3('0xa')][_0xa9a3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3288e8,_0x169050,_0x14ef14){return new BPromise(function(_0x4969fb,_0x1faf03){return client[_0xa9a3('0xc')](_0x3288e8,_0x14ef14)[_0xa9a3('0xd')](function(_0x1c7e97){logger['info'](_0xa9a3('0xe'),_0x169050,_0xa9a3('0xf'));logger[_0xa9a3('0x10')](_0xa9a3('0x11'),_0x169050,_0xa9a3('0xf'),JSON[_0xa9a3('0x12')](_0x1c7e97));if(_0x1c7e97[_0xa9a3('0x13')]){if(_0x1c7e97[_0xa9a3('0x13')][_0xa9a3('0x14')]===0x1f4){logger[_0xa9a3('0x13')](_0xa9a3('0xe'),_0x169050,_0x1c7e97[_0xa9a3('0x13')][_0xa9a3('0x15')]);return _0x1faf03(_0x1c7e97[_0xa9a3('0x13')][_0xa9a3('0x15')]);}logger[_0xa9a3('0x13')](_0xa9a3('0xe'),_0x169050,_0x1c7e97['error'][_0xa9a3('0x15')]);return _0x4969fb(_0x1c7e97[_0xa9a3('0x13')][_0xa9a3('0x15')]);}else{logger[_0xa9a3('0x16')](_0xa9a3('0xe'),_0x169050,_0xa9a3('0xf'));_0x4969fb(_0x1c7e97[_0xa9a3('0x17')]['message']);}})[_0xa9a3('0x18')](function(_0xab6391){logger[_0xa9a3('0x13')]('MemberReport,\x20%s,\x20%s',_0x169050,_0xab6391);_0x1faf03(_0xab6391);});});}exports['GetMemberReport']=function(_0xfcab6a){var _0x266a04=this;return new Promise(function(_0x27d3ce,_0x4445cd){return db[_0xa9a3('0x19')][_0xa9a3('0x1a')]({'raw':_0xfcab6a['options']?_0xfcab6a[_0xa9a3('0x1b')][_0xa9a3('0x1c')]===undefined?!![]:![]:!![],'where':_0xfcab6a[_0xa9a3('0x1b')]?_0xfcab6a[_0xa9a3('0x1b')][_0xa9a3('0x1d')]||null:null,'attributes':_0xfcab6a[_0xa9a3('0x1b')]?_0xfcab6a[_0xa9a3('0x1b')][_0xa9a3('0x1e')]||null:null,'limit':_0xfcab6a[_0xa9a3('0x1b')]?_0xfcab6a['options']['limit']||null:null,'include':_0xfcab6a['options']?_0xfcab6a[_0xa9a3('0x1b')][_0xa9a3('0x1f')]?_[_0xa9a3('0x20')](_0xfcab6a[_0xa9a3('0x1b')]['include'],function(_0x397d81){return{'model':db[_0x397d81[_0xa9a3('0x21')]],'as':_0x397d81['as'],'attributes':_0x397d81[_0xa9a3('0x1e')],'include':_0x397d81[_0xa9a3('0x1f')]?_['map'](_0x397d81[_0xa9a3('0x1f')],function(_0x33fff0){return{'model':db[_0x33fff0[_0xa9a3('0x21')]],'as':_0x33fff0['as'],'attributes':_0x33fff0[_0xa9a3('0x1e')],'include':_0x33fff0[_0xa9a3('0x1f')]?_[_0xa9a3('0x20')](_0x33fff0[_0xa9a3('0x1f')],function(_0x4c2036){return{'model':db[_0x4c2036['model']],'as':_0x4c2036['as'],'attributes':_0x4c2036[_0xa9a3('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xa9a3('0xd')](function(_0x40a62d){logger[_0xa9a3('0x16')](_0xa9a3('0x22'),_0xfcab6a);logger['debug'](_0xa9a3('0x22'),_0xfcab6a,JSON[_0xa9a3('0x12')](_0x40a62d));_0x27d3ce(_0x40a62d);})[_0xa9a3('0x18')](function(_0x42d9ca){logger[_0xa9a3('0x13')](_0xa9a3('0x22'),_0x42d9ca[_0xa9a3('0x15')],_0xfcab6a);_0x4445cd(_0x266a04[_0xa9a3('0x13')](0x1f4,_0x42d9ca['message']));});});};exports['CreateMemberReport']=function(_0x3e1a29){var _0x3b77b7=this;return new Promise(function(_0x43fa84,_0x4e94b1){return db['MemberReport'][_0xa9a3('0x23')](_0x3e1a29[_0xa9a3('0x24')],{'raw':_0x3e1a29[_0xa9a3('0x1b')]?_0x3e1a29[_0xa9a3('0x1b')][_0xa9a3('0x1c')]===undefined?!![]:![]:!![]})[_0xa9a3('0xd')](function(_0x6dbaa){logger['info']('CreateMemberReport',_0x3e1a29);logger[_0xa9a3('0x10')](_0xa9a3('0x25'),_0x3e1a29,JSON[_0xa9a3('0x12')](_0x6dbaa));_0x43fa84(_0x6dbaa);})[_0xa9a3('0x18')](function(_0x14507a){logger[_0xa9a3('0x13')](_0xa9a3('0x25'),_0x14507a[_0xa9a3('0x15')],_0x3e1a29);_0x4e94b1(_0x3b77b7[_0xa9a3('0x13')](0x1f4,_0x14507a[_0xa9a3('0x15')]));});});};exports[_0xa9a3('0x26')]=function(_0x293713){var _0x43b436=this;return new Promise(function(_0x534bac,_0x1e59b9){return db[_0xa9a3('0x19')]['update'](_0x293713[_0xa9a3('0x24')],{'raw':_0x293713[_0xa9a3('0x1b')]?_0x293713[_0xa9a3('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x293713[_0xa9a3('0x1b')]?_0x293713[_0xa9a3('0x1b')][_0xa9a3('0x1d')]||null:null,'attributes':_0x293713[_0xa9a3('0x1b')]?_0x293713[_0xa9a3('0x1b')][_0xa9a3('0x1e')]||null:null,'limit':_0x293713[_0xa9a3('0x1b')]?_0x293713[_0xa9a3('0x1b')][_0xa9a3('0x27')]||null:null})[_0xa9a3('0xd')](function(_0x3fe65a){logger['info']('UpdateMemberReport',_0x293713);logger[_0xa9a3('0x10')](_0xa9a3('0x26'),_0x293713,JSON['stringify'](_0x3fe65a));_0x534bac(_0x3fe65a);})['catch'](function(_0x19222a){logger[_0xa9a3('0x13')](_0xa9a3('0x26'),_0x19222a[_0xa9a3('0x15')],_0x293713);_0x1e59b9(_0x43b436[_0xa9a3('0x13')](0x1f4,_0x19222a[_0xa9a3('0x15')]));});});}; \ No newline at end of file +var _0x7313=['include','catch','create','body','CreateMemberReport','UpdateMemberReport','update','where','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','GetMemberReport','MemberReport','findAll','options','raw','attributes','limit','map','model'];(function(_0x57592d,_0x402d7e){var _0x58cef5=function(_0x40c915){while(--_0x40c915){_0x57592d['push'](_0x57592d['shift']());}};_0x58cef5(++_0x402d7e);}(_0x7313,0xec));var _0x3731=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0x7313[_0x2b10c6];return _0x3789d2;};'use strict';var _=require(_0x3731('0x0'));var util=require('util');var moment=require(_0x3731('0x1'));var BPromise=require(_0x3731('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3731('0x3'));var db=require(_0x3731('0x4'))['db'];var utils=require(_0x3731('0x5'));var logger=require(_0x3731('0x6'))('rpc');var config=require(_0x3731('0x7'));var jayson=require(_0x3731('0x8'));var client=jayson[_0x3731('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x12bef1,_0x1bbb43,_0x1f33ef){return new BPromise(function(_0x5e0a6f,_0x3300f0){return client[_0x3731('0xa')](_0x12bef1,_0x1f33ef)[_0x3731('0xb')](function(_0xb81d4f){logger['info'](_0x3731('0xc'),_0x1bbb43,_0x3731('0xd'));logger[_0x3731('0xe')](_0x3731('0xf'),_0x1bbb43,_0x3731('0xd'),JSON[_0x3731('0x10')](_0xb81d4f));if(_0xb81d4f['error']){if(_0xb81d4f['error'][_0x3731('0x11')]===0x1f4){logger[_0x3731('0x12')](_0x3731('0xc'),_0x1bbb43,_0xb81d4f[_0x3731('0x12')][_0x3731('0x13')]);return _0x3300f0(_0xb81d4f[_0x3731('0x12')][_0x3731('0x13')]);}logger['error'](_0x3731('0xc'),_0x1bbb43,_0xb81d4f[_0x3731('0x12')][_0x3731('0x13')]);return _0x5e0a6f(_0xb81d4f[_0x3731('0x12')][_0x3731('0x13')]);}else{logger[_0x3731('0x14')](_0x3731('0xc'),_0x1bbb43,_0x3731('0xd'));_0x5e0a6f(_0xb81d4f['result'][_0x3731('0x13')]);}})['catch'](function(_0x395093){logger[_0x3731('0x12')](_0x3731('0xc'),_0x1bbb43,_0x395093);_0x3300f0(_0x395093);});});}exports[_0x3731('0x15')]=function(_0x5c3dd5){var _0x1f55cb=this;return new Promise(function(_0x49ebb9,_0x3299ac){return db[_0x3731('0x16')][_0x3731('0x17')]({'raw':_0x5c3dd5[_0x3731('0x18')]?_0x5c3dd5['options'][_0x3731('0x19')]===undefined?!![]:![]:!![],'where':_0x5c3dd5['options']?_0x5c3dd5[_0x3731('0x18')]['where']||null:null,'attributes':_0x5c3dd5[_0x3731('0x18')]?_0x5c3dd5[_0x3731('0x18')][_0x3731('0x1a')]||null:null,'limit':_0x5c3dd5[_0x3731('0x18')]?_0x5c3dd5[_0x3731('0x18')][_0x3731('0x1b')]||null:null,'include':_0x5c3dd5['options']?_0x5c3dd5[_0x3731('0x18')]['include']?_[_0x3731('0x1c')](_0x5c3dd5['options']['include'],function(_0x41d8d2){return{'model':db[_0x41d8d2[_0x3731('0x1d')]],'as':_0x41d8d2['as'],'attributes':_0x41d8d2[_0x3731('0x1a')],'include':_0x41d8d2['include']?_['map'](_0x41d8d2[_0x3731('0x1e')],function(_0x465534){return{'model':db[_0x465534[_0x3731('0x1d')]],'as':_0x465534['as'],'attributes':_0x465534[_0x3731('0x1a')],'include':_0x465534[_0x3731('0x1e')]?_[_0x3731('0x1c')](_0x465534[_0x3731('0x1e')],function(_0x355afe){return{'model':db[_0x355afe['model']],'as':_0x355afe['as'],'attributes':_0x355afe['attributes']};}):[]};}):[]};}):[]:[]})[_0x3731('0xb')](function(_0x52825d){logger[_0x3731('0x14')](_0x3731('0x15'),_0x5c3dd5);logger[_0x3731('0xe')](_0x3731('0x15'),_0x5c3dd5,JSON['stringify'](_0x52825d));_0x49ebb9(_0x52825d);})[_0x3731('0x1f')](function(_0x12bc87){logger[_0x3731('0x12')](_0x3731('0x15'),_0x12bc87[_0x3731('0x13')],_0x5c3dd5);_0x3299ac(_0x1f55cb[_0x3731('0x12')](0x1f4,_0x12bc87[_0x3731('0x13')]));});});};exports['CreateMemberReport']=function(_0x25f5c9){var _0x3184d2=this;return new Promise(function(_0x21375f,_0x3a880d){return db[_0x3731('0x16')][_0x3731('0x20')](_0x25f5c9[_0x3731('0x21')],{'raw':_0x25f5c9[_0x3731('0x18')]?_0x25f5c9['options'][_0x3731('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x5eee10){logger['info'](_0x3731('0x22'),_0x25f5c9);logger[_0x3731('0xe')](_0x3731('0x22'),_0x25f5c9,JSON['stringify'](_0x5eee10));_0x21375f(_0x5eee10);})[_0x3731('0x1f')](function(_0x2bca40){logger[_0x3731('0x12')](_0x3731('0x22'),_0x2bca40[_0x3731('0x13')],_0x25f5c9);_0x3a880d(_0x3184d2[_0x3731('0x12')](0x1f4,_0x2bca40[_0x3731('0x13')]));});});};exports[_0x3731('0x23')]=function(_0x1bebf7){var _0x351963=this;return new Promise(function(_0xe634a7,_0x20400a){return db[_0x3731('0x16')][_0x3731('0x24')](_0x1bebf7['body'],{'raw':_0x1bebf7[_0x3731('0x18')]?_0x1bebf7[_0x3731('0x18')][_0x3731('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1bebf7['options']?_0x1bebf7['options'][_0x3731('0x25')]||null:null,'attributes':_0x1bebf7['options']?_0x1bebf7['options']['attributes']||null:null,'limit':_0x1bebf7['options']?_0x1bebf7[_0x3731('0x18')][_0x3731('0x1b')]||null:null})['then'](function(_0x46d794){logger['info'](_0x3731('0x23'),_0x1bebf7);logger['debug'](_0x3731('0x23'),_0x1bebf7,JSON[_0x3731('0x10')](_0x46d794));_0xe634a7(_0x46d794);})[_0x3731('0x1f')](function(_0x10bf88){logger[_0x3731('0x12')](_0x3731('0x23'),_0x10bf88[_0x3731('0x13')],_0x1bebf7);_0x20400a(_0x351963['error'](0x1f4,_0x10bf88[_0x3731('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index da9d12d..d00a1fc 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 _0x0972=['exports','util','connect-timeout','Router','../../components/auth/service','../../config/environment','./migration.controller','get','index'];(function(_0x109d07,_0x493a0f){var _0x549773=function(_0x1010df){while(--_0x1010df){_0x109d07['push'](_0x109d07['shift']());}};_0x549773(++_0x493a0f);}(_0x0972,0x64));var _0x2097=function(_0x3dac76,_0x2bcc52){_0x3dac76=_0x3dac76-0x0;var _0x25cdcb=_0x0972[_0x3dac76];return _0x25cdcb;};'use strict';var multer=require('multer');var util=require(_0x2097('0x0'));var path=require('path');var timeout=require(_0x2097('0x1'));var express=require('express');var router=express[_0x2097('0x2')]();var auth=require(_0x2097('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x2097('0x4'));var controller=require(_0x2097('0x5'));router[_0x2097('0x6')]('/',controller[_0x2097('0x7')]);module[_0x2097('0x8')]=router; \ No newline at end of file +var _0x1c7c=['./migration.controller','get','index','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment'];(function(_0x50e593,_0x3ae998){var _0x3821d0=function(_0x53c295){while(--_0x53c295){_0x50e593['push'](_0x50e593['shift']());}};_0x3821d0(++_0x3ae998);}(_0x1c7c,0x164));var _0xc1c7=function(_0x1adf8d,_0x403b12){_0x1adf8d=_0x1adf8d-0x0;var _0x3f264c=_0x1c7c[_0x1adf8d];return _0x3f264c;};'use strict';var multer=require(_0xc1c7('0x0'));var util=require(_0xc1c7('0x1'));var path=require(_0xc1c7('0x2'));var timeout=require(_0xc1c7('0x3'));var express=require('express');var router=express[_0xc1c7('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xc1c7('0x5'));var config=require(_0xc1c7('0x6'));var controller=require(_0xc1c7('0x7'));router[_0xc1c7('0x8')]('/',controller[_0xc1c7('0x9')]);module[_0xc1c7('0xa')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 5e37dad..71a735e 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 _0xba08=['STRING','exports'];(function(_0x42389e,_0x1ab174){var _0x464985=function(_0x337f3f){while(--_0x337f3f){_0x42389e['push'](_0x42389e['shift']());}};_0x464985(++_0x1ab174);}(_0xba08,0x123));var _0x8ba0=function(_0x4616c7,_0x5e060d){_0x4616c7=_0x4616c7-0x0;var _0x589a1c=_0xba08[_0x4616c7];return _0x589a1c;};'use strict';var Sequelize=require('sequelize');module[_0x8ba0('0x0')]={'version':{'type':Sequelize[_0x8ba0('0x1')],'unique':'version'}}; \ No newline at end of file +var _0xf470=['version','sequelize','exports','STRING'];(function(_0x2eaedf,_0x481885){var _0x4b0bf8=function(_0x1feb83){while(--_0x1feb83){_0x2eaedf['push'](_0x2eaedf['shift']());}};_0x4b0bf8(++_0x481885);}(_0xf470,0x13d));var _0x0f47=function(_0x1a9204,_0x1c9e00){_0x1a9204=_0x1a9204-0x0;var _0x17ca68=_0xf470[_0x1a9204];return _0x17ca68;};'use strict';var Sequelize=require(_0x0f47('0x0'));module[_0x0f47('0x1')]={'version':{'type':Sequelize[_0x0f47('0x2')],'unique':_0x0f47('0x3')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 34fe203..27bd973 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 _0xb10b=['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','where','merge','Migration','include','rows','catch','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring'];(function(_0x528697,_0x1bfaea){var _0x2d4a99=function(_0x4e26fe){while(--_0x4e26fe){_0x528697['push'](_0x528697['shift']());}};_0x2d4a99(++_0x1bfaea);}(_0xb10b,0x12a));var _0xbb10=function(_0x4996dd,_0x1613fc){_0x4996dd=_0x4996dd-0x0;var _0x98b206=_0xb10b[_0x4996dd];return _0x98b206;};'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['Migration'][_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')]));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));}; \ No newline at end of file +var _0xb10b=['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','where','merge','Migration','include','rows','catch','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring'];(function(_0x754ef7,_0x4ea01a){var _0x3eff4b=function(_0x33a008){while(--_0x33a008){_0x754ef7['push'](_0x754ef7['shift']());}};_0x3eff4b(++_0x4ea01a);}(_0xb10b,0x12a));var _0xbb10=function(_0x252782,_0x5b7839){_0x252782=_0x252782-0x0;var _0x5123ea=_0xb10b[_0x252782];return _0x5123ea;};'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['Migration'][_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')]));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));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index eb0a00e..da77e78 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 _0x42da=['path','../../config/environment','./migration.attributes','define','migrations','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x4b71f5,_0x159213){var _0x1f0933=function(_0x81ef67){while(--_0x81ef67){_0x4b71f5['push'](_0x4b71f5['shift']());}};_0x1f0933(++_0x159213);}(_0x42da,0x19c));var _0xa42d=function(_0x5b6817,_0x3ef7de){_0x5b6817=_0x5b6817-0x0;var _0x1d6593=_0x42da[_0x5b6817];return _0x1d6593;};'use strict';var _=require(_0xa42d('0x0'));var util=require(_0xa42d('0x1'));var logger=require(_0xa42d('0x2'))(_0xa42d('0x3'));var moment=require(_0xa42d('0x4'));var BPromise=require('bluebird');var rp=require(_0xa42d('0x5'));var fs=require('fs');var path=require(_0xa42d('0x6'));var rimraf=require('rimraf');var config=require(_0xa42d('0x7'));var attributes=require(_0xa42d('0x8'));module['exports']=function(_0x2c49e9,_0x3c34b2){return _0x2c49e9[_0xa42d('0x9')]('Migration',attributes,{'tableName':_0xa42d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7701=['lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./migration.attributes','exports','Migration','migrations'];(function(_0x591781,_0x8e0ed2){var _0x315bd9=function(_0x39166c){while(--_0x39166c){_0x591781['push'](_0x591781['shift']());}};_0x315bd9(++_0x8e0ed2);}(_0x7701,0xe4));var _0x1770=function(_0x2ea9fd,_0x45d80b){_0x2ea9fd=_0x2ea9fd-0x0;var _0x27d18e=_0x7701[_0x2ea9fd];return _0x27d18e;};'use strict';var _=require(_0x1770('0x0'));var util=require('util');var logger=require(_0x1770('0x1'))(_0x1770('0x2'));var moment=require(_0x1770('0x3'));var BPromise=require(_0x1770('0x4'));var rp=require(_0x1770('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1770('0x6'));var config=require(_0x1770('0x7'));var attributes=require(_0x1770('0x8'));module[_0x1770('0x9')]=function(_0x36e858,_0x574a15){return _0x36e858['define'](_0x1770('0xa'),attributes,{'tableName':_0x1770('0xb'),'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 6e5ce8a..2c48795 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 _0x15ad=['request','then','Migration,\x20%s,\x20%s','debug','Migration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client'];(function(_0x29aba9,_0x40e341){var _0xf177c4=function(_0x22387e){while(--_0x22387e){_0x29aba9['push'](_0x29aba9['shift']());}};_0xf177c4(++_0x40e341);}(_0x15ad,0x6e));var _0xd15a=function(_0x6aaf8b,_0xfe4849){_0x6aaf8b=_0x6aaf8b-0x0;var _0x129edc=_0x15ad[_0x6aaf8b];return _0x129edc;};'use strict';var _=require(_0xd15a('0x0'));var util=require(_0xd15a('0x1'));var moment=require('moment');var BPromise=require(_0xd15a('0x2'));var rs=require(_0xd15a('0x3'));var fs=require('fs');var Redis=require(_0xd15a('0x4'));var db=require(_0xd15a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd15a('0x6'))(_0xd15a('0x7'));var config=require('../../config/environment');var jayson=require(_0xd15a('0x8'));var client=jayson[_0xd15a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e3998,_0x29c15f,_0x3c13cd){return new BPromise(function(_0x4956f1,_0x3ec5e7){return client[_0xd15a('0xa')](_0x4e3998,_0x3c13cd)[_0xd15a('0xb')](function(_0x2cd5b6){logger['info'](_0xd15a('0xc'),_0x29c15f,'request\x20sent');logger[_0xd15a('0xd')](_0xd15a('0xe'),_0x29c15f,_0xd15a('0xf'),JSON['stringify'](_0x2cd5b6));if(_0x2cd5b6['error']){if(_0x2cd5b6[_0xd15a('0x10')][_0xd15a('0x11')]===0x1f4){logger[_0xd15a('0x10')](_0xd15a('0xc'),_0x29c15f,_0x2cd5b6[_0xd15a('0x10')][_0xd15a('0x12')]);return _0x3ec5e7(_0x2cd5b6[_0xd15a('0x10')][_0xd15a('0x12')]);}logger[_0xd15a('0x10')](_0xd15a('0xc'),_0x29c15f,_0x2cd5b6['error']['message']);return _0x4956f1(_0x2cd5b6[_0xd15a('0x10')][_0xd15a('0x12')]);}else{logger['info'](_0xd15a('0xc'),_0x29c15f,'request\x20sent');_0x4956f1(_0x2cd5b6[_0xd15a('0x13')]['message']);}})['catch'](function(_0x584dff){logger[_0xd15a('0x10')](_0xd15a('0xc'),_0x29c15f,_0x584dff);_0x3ec5e7(_0x584dff);});});} \ No newline at end of file +var _0xea2d=['catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Migration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result'];(function(_0x4ad8d6,_0x4a387b){var _0x4fef56=function(_0x407155){while(--_0x407155){_0x4ad8d6['push'](_0x4ad8d6['shift']());}};_0x4fef56(++_0x4a387b);}(_0xea2d,0xfb));var _0xdea2=function(_0x5d42fa,_0x5e3619){_0x5d42fa=_0x5d42fa-0x0;var _0x3e979d=_0xea2d[_0x5d42fa];return _0x3e979d;};'use strict';var _=require('lodash');var util=require(_0xdea2('0x0'));var moment=require(_0xdea2('0x1'));var BPromise=require(_0xdea2('0x2'));var rs=require(_0xdea2('0x3'));var fs=require('fs');var Redis=require(_0xdea2('0x4'));var db=require(_0xdea2('0x5'))['db'];var utils=require(_0xdea2('0x6'));var logger=require(_0xdea2('0x7'))(_0xdea2('0x8'));var config=require(_0xdea2('0x9'));var jayson=require(_0xdea2('0xa'));var client=jayson[_0xdea2('0xb')][_0xdea2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1f1aff,_0x1a5e12,_0x4eaca5){return new BPromise(function(_0x36a81f,_0x58cd21){return client[_0xdea2('0xd')](_0x1f1aff,_0x4eaca5)[_0xdea2('0xe')](function(_0x9d8062){logger[_0xdea2('0xf')](_0xdea2('0x10'),_0x1a5e12,'request\x20sent');logger[_0xdea2('0x11')]('Migration,\x20%s,\x20%s,\x20%s',_0x1a5e12,_0xdea2('0x12'),JSON[_0xdea2('0x13')](_0x9d8062));if(_0x9d8062[_0xdea2('0x14')]){if(_0x9d8062[_0xdea2('0x14')][_0xdea2('0x15')]===0x1f4){logger['error'](_0xdea2('0x10'),_0x1a5e12,_0x9d8062[_0xdea2('0x14')][_0xdea2('0x16')]);return _0x58cd21(_0x9d8062['error']['message']);}logger[_0xdea2('0x14')](_0xdea2('0x10'),_0x1a5e12,_0x9d8062[_0xdea2('0x14')][_0xdea2('0x16')]);return _0x36a81f(_0x9d8062[_0xdea2('0x14')][_0xdea2('0x16')]);}else{logger[_0xdea2('0xf')](_0xdea2('0x10'),_0x1a5e12,_0xdea2('0x12'));_0x36a81f(_0x9d8062[_0xdea2('0x17')]['message']);}})[_0xdea2('0x18')](function(_0x46a0cd){logger[_0xdea2('0x14')](_0xdea2('0x10'),_0x1a5e12,_0x46a0cd);_0x58cd21(_0x46a0cd);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 16b1933..5befc24 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 _0x77f7=['get','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index'];(function(_0x66569,_0x19e1aa){var _0x436290=function(_0x3178c1){while(--_0x3178c1){_0x66569['push'](_0x66569['shift']());}};_0x436290(++_0x19e1aa);}(_0x77f7,0xbd));var _0x777f=function(_0x2cb7b7,_0x2ae5a7){_0x2cb7b7=_0x2cb7b7-0x0;var _0x3133b2=_0x77f7[_0x2cb7b7];return _0x3133b2;};'use strict';var multer=require(_0x777f('0x0'));var util=require(_0x777f('0x1'));var path=require(_0x777f('0x2'));var timeout=require(_0x777f('0x3'));var express=require(_0x777f('0x4'));var router=express[_0x777f('0x5')]();var auth=require(_0x777f('0x6'));var interaction=require(_0x777f('0x7'));var config=require(_0x777f('0x8'));var controller=require('./network.controller');router['get']('/',auth[_0x777f('0x9')](),controller[_0x777f('0xa')]);router[_0x777f('0xb')](_0x777f('0xc'),auth[_0x777f('0x9')](),controller[_0x777f('0xd')]);router[_0x777f('0xe')]('/',auth[_0x777f('0x9')](),controller[_0x777f('0xf')]);router[_0x777f('0x10')]('/:id',auth[_0x777f('0x9')](),controller['update']);router[_0x777f('0x11')](_0x777f('0xc'),auth['isAuthenticated'](),controller[_0x777f('0x12')]);module[_0x777f('0x13')]=router; \ No newline at end of file +var _0x5398=['create','put','update','delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','post'];(function(_0x57b1ab,_0x3590d9){var _0x168cbe=function(_0x2b8452){while(--_0x2b8452){_0x57b1ab['push'](_0x57b1ab['shift']());}};_0x168cbe(++_0x3590d9);}(_0x5398,0xe2));var _0x8539=function(_0x292d0b,_0x235dc2){_0x292d0b=_0x292d0b-0x0;var _0x3c5fed=_0x5398[_0x292d0b];return _0x3c5fed;};'use strict';var multer=require('multer');var util=require(_0x8539('0x0'));var path=require(_0x8539('0x1'));var timeout=require(_0x8539('0x2'));var express=require(_0x8539('0x3'));var router=express[_0x8539('0x4')]();var auth=require(_0x8539('0x5'));var interaction=require(_0x8539('0x6'));var config=require('../../config/environment');var controller=require('./network.controller');router[_0x8539('0x7')]('/',auth[_0x8539('0x8')](),controller[_0x8539('0x9')]);router[_0x8539('0x7')](_0x8539('0xa'),auth[_0x8539('0x8')](),controller['show']);router[_0x8539('0xb')]('/',auth[_0x8539('0x8')](),controller[_0x8539('0xc')]);router[_0x8539('0xd')](_0x8539('0xa'),auth[_0x8539('0x8')](),controller[_0x8539('0xe')]);router[_0x8539('0xf')](_0x8539('0xa'),auth[_0x8539('0x8')](),controller['destroy']);module[_0x8539('0x10')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 4b58c7a..d7e7707 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(_0x3068f1,_0x2b56cf){var _0x1fa25f=function(_0x2455db){while(--_0x2455db){_0x3068f1['push'](_0x3068f1['shift']());}};_0x1fa25f(++_0x2b56cf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'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(_0x5145b2,_0x1c0b40){var _0x365a8a=function(_0x5b2b6a){while(--_0x5b2b6a){_0x5145b2['push'](_0x5145b2['shift']());}};_0x365a8a(++_0x1c0b40);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'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 b335b73..360a163 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 _0xcae6=['stringify','error','message','result','catch','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','stack','name','map','Network','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','create','sequelize','transaction','body','type','toUpperCase','STUN','join','utf8','render','writeFileSync','Reload','res_stun_monitor.so','TURN','readFileSync','server/files/templates/turn_multiple.ejs','root','format','chan_sip.so','server/files/templates/stun_multiple.ejs','/etc/asterisk/stun_xcally.conf','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','querystring','papaparse','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','Sequelize','ValidationError','request','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s'];(function(_0x4dd1cb,_0x3bd8bf){var _0x1c5219=function(_0x16794d){while(--_0x16794d){_0x4dd1cb['push'](_0x4dd1cb['shift']());}};_0x1c5219(++_0x3bd8bf);}(_0xcae6,0xaf));var _0x6cae=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0xcae6[_0x346737];return _0x1ade2e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6cae('0x0'));var rimraf=require(_0x6cae('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6cae('0x2'));var rp=require('request-promise');var moment=require(_0x6cae('0x3'));var BPromise=require(_0x6cae('0x4'));var Mustache=require(_0x6cae('0x5'));var util=require('util');var path=require(_0x6cae('0x6'));var sox=require(_0x6cae('0x7'));var csv=require(_0x6cae('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x6cae('0x9'));var squel=require(_0x6cae('0xa'));var crypto=require(_0x6cae('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6cae('0xc'));var Papa=require(_0x6cae('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6cae('0xe'));var logger=require(_0x6cae('0xf'))('api');var utils=require(_0x6cae('0x10'));var config=require(_0x6cae('0x11'));var db=require(_0x6cae('0x12'))['db'];var jayson=require(_0x6cae('0x13'));var client=jayson[_0x6cae('0x14')][_0x6cae('0x15')]({'port':0x232a});function checkPasswordPattern(_0x21e1f5,_0x394b74,_0x204e83){if(_0x204e83){var _0x3918db=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3918db['test'](_0x394b74)){return _0x21e1f5;}else{throw new db[(_0x6cae('0x16'))][(_0x6cae('0x17'))]('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 _0x21e1f5;}}function respondWithRpcPromise(_0x10e271,_0x311d8e,_0x5bbde0,_0x20fa1e){return new BPromise(function(_0xa8a30a,_0x57ee1c){var _0x5d018a=_0x20fa1e||client;return _0x5d018a[_0x6cae('0x18')](_0x10e271,_0x5bbde0)[_0x6cae('0x19')](function(_0x74ca){logger[_0x6cae('0x1a')](_0x6cae('0x1b'),_0x311d8e,_0x6cae('0x1c'));logger[_0x6cae('0x1d')](_0x6cae('0x1e'),_0x311d8e,'request\x20sent',JSON[_0x6cae('0x1f')](_0x74ca));if(_0x74ca[_0x6cae('0x20')]){if(_0x74ca[_0x6cae('0x20')]['code']===0x1f4){logger[_0x6cae('0x20')](_0x6cae('0x1b'),_0x311d8e,_0x74ca[_0x6cae('0x20')][_0x6cae('0x21')]);return _0x57ee1c(_0x74ca['error']['message']);}logger[_0x6cae('0x20')](_0x6cae('0x1b'),_0x311d8e,_0x74ca['error'][_0x6cae('0x21')]);return _0xa8a30a(_0x74ca[_0x6cae('0x20')]['message']);}else{logger[_0x6cae('0x1a')](_0x6cae('0x1b'),_0x311d8e,_0x6cae('0x1c'));_0xa8a30a(_0x74ca[_0x6cae('0x22')][_0x6cae('0x21')]);}})[_0x6cae('0x23')](function(_0x4b89bc){logger[_0x6cae('0x20')]('Network,\x20%s,\x20%s',_0x311d8e,_0x4b89bc);_0x57ee1c(_0x4b89bc);});});}function respondWithStatusCode(_0x44631b,_0x5010cd){_0x5010cd=_0x5010cd||0xcc;return function(_0x59ab11){if(_0x59ab11){return _0x44631b['sendStatus'](_0x5010cd);}return _0x44631b[_0x6cae('0x24')](_0x5010cd)[_0x6cae('0x25')]();};}function respondWithResult(_0x4fb6a0,_0x5def3c){_0x5def3c=_0x5def3c||0xc8;return function(_0x211baf){if(_0x211baf){return _0x4fb6a0[_0x6cae('0x24')](_0x5def3c)[_0x6cae('0x26')](_0x211baf);}};}function respondWithFilteredResult(_0x4b3782,_0x29622a){return function(_0x77d4dd){if(_0x77d4dd){var _0xaff64d=_0x77d4dd[_0x6cae('0x27')],_0x1f7864=_0x29622a[_0x6cae('0x28')],_0x51b1bf=_0x29622a[_0x6cae('0x28')]+_0x29622a[_0x6cae('0x29')],_0x41fa29;if(_0x51b1bf>=_0xaff64d){_0x51b1bf=_0xaff64d;_0x41fa29=0xc8;}else{_0x41fa29=0xce;}_0x4b3782['status'](_0x41fa29);return _0x4b3782[_0x6cae('0x2a')](_0x6cae('0x2b'),_0x1f7864+'-'+_0x51b1bf+'/'+_0xaff64d)[_0x6cae('0x26')](_0x77d4dd);}return null;};}function patchUpdates(_0x1237e6){return function(_0x46e943){try{jsonpatch[_0x6cae('0x2c')](_0x46e943,_0x1237e6,!![]);}catch(_0x189169){return BPromise[_0x6cae('0x2d')](_0x189169);}return _0x46e943[_0x6cae('0x2e')]();};}function saveUpdates(_0x1bf441,_0x4a603f){return function(_0x149dfa){if(_0x149dfa){return _0x149dfa[_0x6cae('0x2f')](_0x1bf441)['then'](function(_0x4024cc){return _0x4024cc;});}return null;};}function removeEntity(_0x16623c,_0x5c05cf){return function(_0x486230){if(_0x486230){return _0x486230[_0x6cae('0x30')]()[_0x6cae('0x19')](function(){_0x16623c[_0x6cae('0x24')](0xcc)[_0x6cae('0x25')]();});}};}function handleEntityNotFound(_0x33c7da,_0xdbd534){return function(_0x44560c){if(!_0x44560c){_0x33c7da['sendStatus'](0x194);}return _0x44560c;};}function handleError(_0x52429e,_0x1437dc){_0x1437dc=_0x1437dc||0x1f4;return function(_0x246b5c){logger[_0x6cae('0x20')](_0x246b5c[_0x6cae('0x31')]);if(_0x246b5c[_0x6cae('0x32')]){delete _0x246b5c[_0x6cae('0x32')];}_0x52429e['status'](_0x1437dc)['send'](_0x246b5c);};}exports['index']=function(_0x5ab25c,_0x3d8c92){var _0x13c61d={},_0x2f2a34={},_0xb64d3d={'count':0x0,'rows':[]};var _0x18b50d=_[_0x6cae('0x33')](db[_0x6cae('0x34')][_0x6cae('0x35')],function(_0x3561e9){return{'name':_0x3561e9['fieldName'],'type':_0x3561e9['type'][_0x6cae('0x36')]};});_0x2f2a34[_0x6cae('0x37')]=_[_0x6cae('0x33')](_0x18b50d,'name');_0x2f2a34[_0x6cae('0x38')]=_[_0x6cae('0x39')](_0x5ab25c[_0x6cae('0x38')]);_0x2f2a34[_0x6cae('0x3a')]=_[_0x6cae('0x3b')](_0x2f2a34[_0x6cae('0x37')],_0x2f2a34['query']);_0x13c61d[_0x6cae('0x3c')]=_[_0x6cae('0x3b')](_0x2f2a34[_0x6cae('0x37')],qs[_0x6cae('0x3d')](_0x5ab25c['query'][_0x6cae('0x3d')]));_0x13c61d['attributes']=_0x13c61d['attributes'][_0x6cae('0x3e')]?_0x13c61d[_0x6cae('0x3c')]:_0x2f2a34[_0x6cae('0x37')];if(!_0x5ab25c[_0x6cae('0x38')][_0x6cae('0x3f')](_0x6cae('0x40'))){_0x13c61d['limit']=qs[_0x6cae('0x29')](_0x5ab25c[_0x6cae('0x38')]['limit']);_0x13c61d[_0x6cae('0x28')]=qs[_0x6cae('0x28')](_0x5ab25c['query'][_0x6cae('0x28')]);}_0x13c61d['order']=qs[_0x6cae('0x41')](_0x5ab25c[_0x6cae('0x38')][_0x6cae('0x41')]);_0x13c61d[_0x6cae('0x42')]=qs[_0x6cae('0x3a')](_['pick'](_0x5ab25c[_0x6cae('0x38')],_0x2f2a34[_0x6cae('0x3a')]));if(_0x5ab25c[_0x6cae('0x38')][_0x6cae('0x43')]){_0x13c61d['where']=_[_0x6cae('0x44')](_0x13c61d[_0x6cae('0x42')],{'$or':_[_0x6cae('0x33')](_0x18b50d,function(_0x4a76de){if(_0x4a76de['type']!==_0x6cae('0x45')){var _0x1758ca={};_0x1758ca[_0x4a76de[_0x6cae('0x32')]]={'$like':'%'+_0x5ab25c[_0x6cae('0x38')][_0x6cae('0x43')]+'%'};return _0x1758ca;}})});}_0x13c61d=_[_0x6cae('0x44')]({},_0x13c61d,_0x5ab25c[_0x6cae('0x46')]);var _0x270638={'where':_0x13c61d['where']};return db['Network'][_0x6cae('0x27')](_0x270638)[_0x6cae('0x19')](function(_0x1aa273){_0xb64d3d[_0x6cae('0x27')]=_0x1aa273;if(_0x5ab25c[_0x6cae('0x38')][_0x6cae('0x47')]){_0x13c61d[_0x6cae('0x48')]=[{'all':!![]}];}return db[_0x6cae('0x34')][_0x6cae('0x49')](_0x13c61d);})['then'](function(_0xb249a6){_0xb64d3d[_0x6cae('0x4a')]=_0xb249a6;return _0xb64d3d;})[_0x6cae('0x19')](respondWithFilteredResult(_0x3d8c92,_0x13c61d))['catch'](handleError(_0x3d8c92,null));};exports[_0x6cae('0x4b')]=function(_0x59a48d,_0x2319d6){var _0x3b4432={'raw':!![],'where':{'id':_0x59a48d[_0x6cae('0x4c')]['id']}},_0x43529b={};_0x43529b[_0x6cae('0x37')]=_[_0x6cae('0x39')](db[_0x6cae('0x34')][_0x6cae('0x35')]);_0x43529b['query']=_['keys'](_0x59a48d['query']);_0x43529b['filters']=_[_0x6cae('0x3b')](_0x43529b[_0x6cae('0x37')],_0x43529b[_0x6cae('0x38')]);_0x3b4432[_0x6cae('0x3c')]=_[_0x6cae('0x3b')](_0x43529b[_0x6cae('0x37')],qs[_0x6cae('0x3d')](_0x59a48d['query']['fields']));_0x3b4432[_0x6cae('0x3c')]=_0x3b4432['attributes'][_0x6cae('0x3e')]?_0x3b4432[_0x6cae('0x3c')]:_0x43529b[_0x6cae('0x37')];if(_0x59a48d[_0x6cae('0x38')][_0x6cae('0x47')]){_0x3b4432['include']=[{'all':!![]}];}_0x3b4432=_[_0x6cae('0x44')]({},_0x3b4432,_0x59a48d[_0x6cae('0x46')]);return db[_0x6cae('0x34')][_0x6cae('0x4d')](_0x3b4432)[_0x6cae('0x19')](handleEntityNotFound(_0x2319d6,null))[_0x6cae('0x19')](respondWithResult(_0x2319d6,null))[_0x6cae('0x23')](handleError(_0x2319d6,null));};exports[_0x6cae('0x4e')]=function(_0x252792,_0x4123a4,_0x54273f){var _0x5b9c07;return db[_0x6cae('0x4f')][_0x6cae('0x50')](function(_0x5641e0){return db['Network']['create'](_0x252792[_0x6cae('0x51')],{'raw':!![]})['then'](function(_0x1fbbcf){_0x5b9c07=_0x1fbbcf;return db[_0x6cae('0x34')][_0x6cae('0x49')]({'where':{'type':_0x252792[_0x6cae('0x51')][_0x6cae('0x52')]},'raw':!![]});})[_0x6cae('0x19')](function(_0x4dfb6c){if(_0x5b9c07[_0x6cae('0x52')][_0x6cae('0x53')]()==_0x6cae('0x54')){var _0x479d31=fs['readFileSync'](path[_0x6cae('0x55')](config['root'],'server/files/templates/stun_multiple.ejs'),_0x6cae('0x56'));var _0x11967e=ejs[_0x6cae('0x57')](_0x479d31,{'networks':_0x4dfb6c||[]});fs[_0x6cae('0x58')]('/etc/asterisk/stun_xcally.conf',_0x11967e);return respondWithRpcPromise(_0x6cae('0x59'),_0x6cae('0x4e'),{'module':_0x6cae('0x5a')});}else if(_0x5b9c07[_0x6cae('0x52')][_0x6cae('0x53')]()==_0x6cae('0x5b')){var _0x1efd66=fs[_0x6cae('0x5c')](path[_0x6cae('0x55')](config['root'],_0x6cae('0x5d')),_0x6cae('0x56'));var _0x387fd2=ejs['render'](_0x1efd66,{'networks':_0x4dfb6c||[]});fs[_0x6cae('0x58')]('/etc/asterisk/turn_xcally.conf',_0x387fd2);return respondWithRpcPromise('Reload',_0x6cae('0x4e'),{'module':_0x6cae('0x5a')});}else{var _0x2f35b7=fs[_0x6cae('0x5c')](path['join'](config[_0x6cae('0x5e')],'server/files/templates/network.ejs'),'utf8');var _0x3c189d=ejs[_0x6cae('0x57')](_0x2f35b7,{'networks':_0x4dfb6c||[]});fs[_0x6cae('0x58')](util[_0x6cae('0x5f')]('/etc/asterisk/sip_xcally_%s.conf',_0x252792[_0x6cae('0x51')]['type']['toLowerCase']()),_0x3c189d);return respondWithRpcPromise(_0x6cae('0x59'),_0x6cae('0x4e'),{'module':_0x6cae('0x60')});}return null;})[_0x6cae('0x19')](function(){return _0x5b9c07;});})['then'](respondWithResult(_0x4123a4,0xc9))[_0x6cae('0x23')](handleError(_0x4123a4,null));};exports[_0x6cae('0x2f')]=function(_0x33b216,_0x3d2454,_0x157475){var _0x181cb5;return db['sequelize'][_0x6cae('0x50')](function(_0x19146f){return db['Network'][_0x6cae('0x4d')]({'where':{'id':_0x33b216[_0x6cae('0x4c')]['id']}})[_0x6cae('0x19')](handleEntityNotFound(_0x3d2454,null))[_0x6cae('0x19')](saveUpdates(_0x33b216[_0x6cae('0x51')],null))[_0x6cae('0x19')](function(_0x56c312){if(_0x56c312){_0x181cb5=_0x56c312;return db[_0x6cae('0x34')][_0x6cae('0x49')]({'where':{'type':_0x181cb5[_0x6cae('0x52')]},'raw':!![]});}return null;})[_0x6cae('0x19')](function(_0x185d61){if(_0x181cb5[_0x6cae('0x52')]['toUpperCase']()==_0x6cae('0x54')){var _0x50c299=fs[_0x6cae('0x5c')](path[_0x6cae('0x55')](config[_0x6cae('0x5e')],_0x6cae('0x61')),_0x6cae('0x56'));var _0xea0042=ejs['render'](_0x50c299,{'networks':_0x185d61||[]});fs[_0x6cae('0x58')](_0x6cae('0x62'),_0xea0042);return respondWithRpcPromise(_0x6cae('0x59'),_0x6cae('0x2f'),{'module':'res_stun_monitor.so'});}else if(_0x181cb5['type'][_0x6cae('0x53')]()==_0x6cae('0x5b')){var _0x3a277f=fs[_0x6cae('0x5c')](path['join'](config[_0x6cae('0x5e')],_0x6cae('0x5d')),_0x6cae('0x56'));var _0x406ccd=ejs[_0x6cae('0x57')](_0x3a277f,{'networks':_0x185d61||[]});fs[_0x6cae('0x58')](_0x6cae('0x63'),_0x406ccd);return respondWithRpcPromise('Reload',_0x6cae('0x2f'),{'module':_0x6cae('0x5a')});}else{var _0x449a44=fs['readFileSync'](path[_0x6cae('0x55')](config['root'],_0x6cae('0x64')),_0x6cae('0x56'));var _0x2306ea=ejs[_0x6cae('0x57')](_0x449a44,{'networks':_0x185d61||[]});fs[_0x6cae('0x58')](util[_0x6cae('0x5f')](_0x6cae('0x65'),_0x33b216[_0x6cae('0x51')][_0x6cae('0x52')][_0x6cae('0x66')]()),_0x2306ea);return respondWithRpcPromise(_0x6cae('0x59'),_0x6cae('0x2f'),{'module':_0x6cae('0x60')});}return null;})[_0x6cae('0x19')](function(_0x131fa6){if(_0x131fa6){return _0x181cb5;}return null;});})[_0x6cae('0x19')](respondWithResult(_0x3d2454,null))[_0x6cae('0x23')](handleError(_0x3d2454,null));};exports[_0x6cae('0x30')]=function(_0x2a5ae5,_0x47ceb9,_0x15df5b){var _0xfb1976;return db[_0x6cae('0x34')][_0x6cae('0x4d')]({'where':{'id':_0x2a5ae5[_0x6cae('0x4c')]['id']}})[_0x6cae('0x19')](function(_0x2f53ef){_0xfb1976=_0x2f53ef;return _0x2f53ef;})[_0x6cae('0x19')](handleEntityNotFound(_0x47ceb9,null))['then'](removeEntity(_0x47ceb9,null))[_0x6cae('0x19')](function(){if(_0xfb1976){return db[_0x6cae('0x34')][_0x6cae('0x49')]({'where':{'type':_0xfb1976['type']},'raw':!![]});}})[_0x6cae('0x19')](function(_0x5d9403){if(_0xfb1976[_0x6cae('0x52')][_0x6cae('0x53')]()==_0x6cae('0x54')){var _0x348d30=fs[_0x6cae('0x5c')](path[_0x6cae('0x55')](config['root'],_0x6cae('0x61')),_0x6cae('0x56'));var _0xdd8ba9=ejs[_0x6cae('0x57')](_0x348d30,{'networks':_0x5d9403||[]});fs[_0x6cae('0x58')]('/etc/asterisk/stun_xcally.conf',_0xdd8ba9);return respondWithRpcPromise('Reload',_0x6cae('0x30'),{'module':_0x6cae('0x5a')});}else if(_0xfb1976[_0x6cae('0x52')][_0x6cae('0x53')]()==_0x6cae('0x5b')){var _0xbe60c1=fs['readFileSync'](path[_0x6cae('0x55')](config[_0x6cae('0x5e')],'server/files/templates/turn_multiple.ejs'),'utf8');var _0xce8042=ejs['render'](_0xbe60c1,{'networks':_0x5d9403||[]});fs['writeFileSync'](_0x6cae('0x63'),_0xce8042);return respondWithRpcPromise(_0x6cae('0x59'),_0x6cae('0x30'),{'module':'res_stun_monitor.so'});}else{var _0x534d58=fs[_0x6cae('0x5c')](path[_0x6cae('0x55')](config[_0x6cae('0x5e')],'server/files/templates/network.ejs'),_0x6cae('0x56'));var _0x34161e=ejs[_0x6cae('0x57')](_0x534d58,{'networks':_0x5d9403||[]});fs[_0x6cae('0x58')](util[_0x6cae('0x5f')](_0x6cae('0x65'),_0x2a5ae5['body']['type']['toLowerCase']()),_0x34161e);return respondWithRpcPromise(_0x6cae('0x59'),'destroy',{'module':_0x6cae('0x60')});}return null;})['catch'](handleError(_0x47ceb9,null));}; \ No newline at end of file +var _0x45fb=['destroy','stack','name','map','Network','fieldName','type','key','model','query','filters','attributes','intersection','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','merge','where','options','includeAll','include','findAll','rows','show','params','keys','rawAttributes','fields','find','catch','create','transaction','body','toUpperCase','STUN','readFileSync','join','root','utf8','render','writeFileSync','Reload','res_stun_monitor.so','server/files/templates/turn_multiple.ejs','format','/etc/asterisk/sip_xcally_%s.conf','server/files/templates/stun_multiple.ejs','/etc/asterisk/stun_xcally.conf','TURN','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','toLowerCase','chan_sip.so','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','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','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','Network,\x20%s,\x20%s','message','request\x20sent','result','sendStatus','status','end','count','offset','Content-Range','json','apply','reject','save','update'];(function(_0x30f46f,_0x4b9423){var _0x54abed=function(_0xa63de){while(--_0xa63de){_0x30f46f['push'](_0x30f46f['shift']());}};_0x54abed(++_0x4b9423);}(_0x45fb,0x18a));var _0xb45f=function(_0x425009,_0x4d8c93){_0x425009=_0x425009-0x0;var _0x56aae3=_0x45fb[_0x425009];return _0x56aae3;};'use strict';var pdf=require(_0xb45f('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xb45f('0x1'));var zipdir=require(_0xb45f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb45f('0x3'));var moment=require(_0xb45f('0x4'));var BPromise=require(_0xb45f('0x5'));var Mustache=require(_0xb45f('0x6'));var util=require(_0xb45f('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xb45f('0x8'));var ejs=require(_0xb45f('0x9'));var fs=require('fs');var _=require(_0xb45f('0xa'));var squel=require(_0xb45f('0xb'));var crypto=require(_0xb45f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb45f('0xd'));var toCsv=require(_0xb45f('0x8'));var querystring=require('querystring');var Papa=require(_0xb45f('0xe'));var Redis=require(_0xb45f('0xf'));var authService=require(_0xb45f('0x10'));var qs=require(_0xb45f('0x11'));var as=require(_0xb45f('0x12'));var hardwareService=require(_0xb45f('0x13'));var logger=require(_0xb45f('0x14'))(_0xb45f('0x15'));var utils=require(_0xb45f('0x16'));var config=require(_0xb45f('0x17'));var db=require(_0xb45f('0x18'))['db'];var jayson=require(_0xb45f('0x19'));var client=jayson[_0xb45f('0x1a')][_0xb45f('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x178b59,_0x38b4db,_0x1063a0){if(_0x1063a0){var _0x452f9c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x452f9c[_0xb45f('0x1c')](_0x38b4db)){return _0x178b59;}else{throw new db[(_0xb45f('0x1d'))]['ValidationError'](_0xb45f('0x1e'));}}else{return _0x178b59;}}function respondWithRpcPromise(_0x1813d3,_0xf8ea79,_0x37fc3d,_0x4a6dca){return new BPromise(function(_0x47f3ad,_0x45cb71){var _0xd93ba0=_0x4a6dca||client;return _0xd93ba0[_0xb45f('0x1f')](_0x1813d3,_0x37fc3d)[_0xb45f('0x20')](function(_0x1a9da1){logger[_0xb45f('0x21')]('Network,\x20%s,\x20%s',_0xf8ea79,'request\x20sent');logger[_0xb45f('0x22')](_0xb45f('0x23'),_0xf8ea79,'request\x20sent',JSON[_0xb45f('0x24')](_0x1a9da1));if(_0x1a9da1['error']){if(_0x1a9da1[_0xb45f('0x25')][_0xb45f('0x26')]===0x1f4){logger['error'](_0xb45f('0x27'),_0xf8ea79,_0x1a9da1[_0xb45f('0x25')][_0xb45f('0x28')]);return _0x45cb71(_0x1a9da1[_0xb45f('0x25')][_0xb45f('0x28')]);}logger[_0xb45f('0x25')]('Network,\x20%s,\x20%s',_0xf8ea79,_0x1a9da1['error'][_0xb45f('0x28')]);return _0x47f3ad(_0x1a9da1['error']['message']);}else{logger[_0xb45f('0x21')](_0xb45f('0x27'),_0xf8ea79,_0xb45f('0x29'));_0x47f3ad(_0x1a9da1[_0xb45f('0x2a')][_0xb45f('0x28')]);}})['catch'](function(_0x54f2bc){logger['error'](_0xb45f('0x27'),_0xf8ea79,_0x54f2bc);_0x45cb71(_0x54f2bc);});});}function respondWithStatusCode(_0x36a028,_0x795add){_0x795add=_0x795add||0xcc;return function(_0x1ff9bd){if(_0x1ff9bd){return _0x36a028[_0xb45f('0x2b')](_0x795add);}return _0x36a028[_0xb45f('0x2c')](_0x795add)[_0xb45f('0x2d')]();};}function respondWithResult(_0x3b1e5d,_0x62c1f0){_0x62c1f0=_0x62c1f0||0xc8;return function(_0x799685){if(_0x799685){return _0x3b1e5d[_0xb45f('0x2c')](_0x62c1f0)['json'](_0x799685);}};}function respondWithFilteredResult(_0x3d5636,_0x126be7){return function(_0x3e02e3){if(_0x3e02e3){var _0x74be12=_0x3e02e3[_0xb45f('0x2e')],_0x366882=_0x126be7[_0xb45f('0x2f')],_0x5dd6c4=_0x126be7['offset']+_0x126be7['limit'],_0x28515f;if(_0x5dd6c4>=_0x74be12){_0x5dd6c4=_0x74be12;_0x28515f=0xc8;}else{_0x28515f=0xce;}_0x3d5636[_0xb45f('0x2c')](_0x28515f);return _0x3d5636['set'](_0xb45f('0x30'),_0x366882+'-'+_0x5dd6c4+'/'+_0x74be12)[_0xb45f('0x31')](_0x3e02e3);}return null;};}function patchUpdates(_0x1a690d){return function(_0x2eba3c){try{jsonpatch[_0xb45f('0x32')](_0x2eba3c,_0x1a690d,!![]);}catch(_0x19722d){return BPromise[_0xb45f('0x33')](_0x19722d);}return _0x2eba3c[_0xb45f('0x34')]();};}function saveUpdates(_0x3cbfc5,_0x5e0252){return function(_0x234ec8){if(_0x234ec8){return _0x234ec8[_0xb45f('0x35')](_0x3cbfc5)[_0xb45f('0x20')](function(_0x1dd7ff){return _0x1dd7ff;});}return null;};}function removeEntity(_0x2b38c8,_0x195bda){return function(_0x47e123){if(_0x47e123){return _0x47e123[_0xb45f('0x36')]()['then'](function(){_0x2b38c8['status'](0xcc)[_0xb45f('0x2d')]();});}};}function handleEntityNotFound(_0xbb38d9,_0x2d6c3d){return function(_0x2e6434){if(!_0x2e6434){_0xbb38d9[_0xb45f('0x2b')](0x194);}return _0x2e6434;};}function handleError(_0x56d67a,_0x37116b){_0x37116b=_0x37116b||0x1f4;return function(_0x1efa9e){logger[_0xb45f('0x25')](_0x1efa9e[_0xb45f('0x37')]);if(_0x1efa9e[_0xb45f('0x38')]){delete _0x1efa9e['name'];}_0x56d67a[_0xb45f('0x2c')](_0x37116b)['send'](_0x1efa9e);};}exports['index']=function(_0x3a47c7,_0x251dfe){var _0x565100={},_0x4d2c15={},_0x97d128={'count':0x0,'rows':[]};var _0x44ee26=_[_0xb45f('0x39')](db[_0xb45f('0x3a')]['rawAttributes'],function(_0x143b77){return{'name':_0x143b77[_0xb45f('0x3b')],'type':_0x143b77[_0xb45f('0x3c')][_0xb45f('0x3d')]};});_0x4d2c15[_0xb45f('0x3e')]=_[_0xb45f('0x39')](_0x44ee26,_0xb45f('0x38'));_0x4d2c15[_0xb45f('0x3f')]=_['keys'](_0x3a47c7[_0xb45f('0x3f')]);_0x4d2c15[_0xb45f('0x40')]=_['intersection'](_0x4d2c15[_0xb45f('0x3e')],_0x4d2c15[_0xb45f('0x3f')]);_0x565100[_0xb45f('0x41')]=_[_0xb45f('0x42')](_0x4d2c15[_0xb45f('0x3e')],qs['fields'](_0x3a47c7[_0xb45f('0x3f')]['fields']));_0x565100[_0xb45f('0x41')]=_0x565100[_0xb45f('0x41')][_0xb45f('0x43')]?_0x565100[_0xb45f('0x41')]:_0x4d2c15[_0xb45f('0x3e')];if(!_0x3a47c7[_0xb45f('0x3f')][_0xb45f('0x44')](_0xb45f('0x45'))){_0x565100[_0xb45f('0x46')]=qs[_0xb45f('0x46')](_0x3a47c7['query'][_0xb45f('0x46')]);_0x565100[_0xb45f('0x2f')]=qs[_0xb45f('0x2f')](_0x3a47c7[_0xb45f('0x3f')][_0xb45f('0x2f')]);}_0x565100[_0xb45f('0x47')]=qs['sort'](_0x3a47c7['query'][_0xb45f('0x48')]);_0x565100['where']=qs[_0xb45f('0x40')](_[_0xb45f('0x49')](_0x3a47c7['query'],_0x4d2c15[_0xb45f('0x40')]));if(_0x3a47c7['query'][_0xb45f('0x4a')]){_0x565100['where']=_[_0xb45f('0x4b')](_0x565100[_0xb45f('0x4c')],{'$or':_[_0xb45f('0x39')](_0x44ee26,function(_0x1c23bd){if(_0x1c23bd['type']!=='VIRTUAL'){var _0x3d8386={};_0x3d8386[_0x1c23bd[_0xb45f('0x38')]]={'$like':'%'+_0x3a47c7[_0xb45f('0x3f')][_0xb45f('0x4a')]+'%'};return _0x3d8386;}})});}_0x565100=_['merge']({},_0x565100,_0x3a47c7[_0xb45f('0x4d')]);var _0x7cf3c8={'where':_0x565100[_0xb45f('0x4c')]};return db[_0xb45f('0x3a')][_0xb45f('0x2e')](_0x7cf3c8)[_0xb45f('0x20')](function(_0x25b28b){_0x97d128[_0xb45f('0x2e')]=_0x25b28b;if(_0x3a47c7['query'][_0xb45f('0x4e')]){_0x565100[_0xb45f('0x4f')]=[{'all':!![]}];}return db[_0xb45f('0x3a')][_0xb45f('0x50')](_0x565100);})['then'](function(_0x51b7e4){_0x97d128[_0xb45f('0x51')]=_0x51b7e4;return _0x97d128;})['then'](respondWithFilteredResult(_0x251dfe,_0x565100))['catch'](handleError(_0x251dfe,null));};exports[_0xb45f('0x52')]=function(_0x4afe41,_0x2df958){var _0x42306b={'raw':!![],'where':{'id':_0x4afe41[_0xb45f('0x53')]['id']}},_0x500f88={};_0x500f88[_0xb45f('0x3e')]=_[_0xb45f('0x54')](db['Network'][_0xb45f('0x55')]);_0x500f88[_0xb45f('0x3f')]=_[_0xb45f('0x54')](_0x4afe41['query']);_0x500f88['filters']=_['intersection'](_0x500f88[_0xb45f('0x3e')],_0x500f88[_0xb45f('0x3f')]);_0x42306b[_0xb45f('0x41')]=_[_0xb45f('0x42')](_0x500f88['model'],qs[_0xb45f('0x56')](_0x4afe41[_0xb45f('0x3f')]['fields']));_0x42306b['attributes']=_0x42306b[_0xb45f('0x41')][_0xb45f('0x43')]?_0x42306b[_0xb45f('0x41')]:_0x500f88[_0xb45f('0x3e')];if(_0x4afe41[_0xb45f('0x3f')][_0xb45f('0x4e')]){_0x42306b[_0xb45f('0x4f')]=[{'all':!![]}];}_0x42306b=_[_0xb45f('0x4b')]({},_0x42306b,_0x4afe41[_0xb45f('0x4d')]);return db['Network'][_0xb45f('0x57')](_0x42306b)[_0xb45f('0x20')](handleEntityNotFound(_0x2df958,null))[_0xb45f('0x20')](respondWithResult(_0x2df958,null))[_0xb45f('0x58')](handleError(_0x2df958,null));};exports[_0xb45f('0x59')]=function(_0x14af53,_0x4a7b5d,_0x4ba96a){var _0x2806cb;return db['sequelize'][_0xb45f('0x5a')](function(_0x4903cf){return db[_0xb45f('0x3a')][_0xb45f('0x59')](_0x14af53['body'],{'raw':!![]})['then'](function(_0x173dc0){_0x2806cb=_0x173dc0;return db[_0xb45f('0x3a')][_0xb45f('0x50')]({'where':{'type':_0x14af53[_0xb45f('0x5b')][_0xb45f('0x3c')]},'raw':!![]});})[_0xb45f('0x20')](function(_0x5dd7bc){if(_0x2806cb[_0xb45f('0x3c')][_0xb45f('0x5c')]()==_0xb45f('0x5d')){var _0x40aca0=fs[_0xb45f('0x5e')](path[_0xb45f('0x5f')](config[_0xb45f('0x60')],'server/files/templates/stun_multiple.ejs'),_0xb45f('0x61'));var _0x2757a0=ejs[_0xb45f('0x62')](_0x40aca0,{'networks':_0x5dd7bc||[]});fs[_0xb45f('0x63')]('/etc/asterisk/stun_xcally.conf',_0x2757a0);return respondWithRpcPromise(_0xb45f('0x64'),_0xb45f('0x59'),{'module':_0xb45f('0x65')});}else if(_0x2806cb[_0xb45f('0x3c')][_0xb45f('0x5c')]()=='TURN'){var _0x17d1e1=fs['readFileSync'](path[_0xb45f('0x5f')](config[_0xb45f('0x60')],_0xb45f('0x66')),_0xb45f('0x61'));var _0x420e3d=ejs[_0xb45f('0x62')](_0x17d1e1,{'networks':_0x5dd7bc||[]});fs['writeFileSync']('/etc/asterisk/turn_xcally.conf',_0x420e3d);return respondWithRpcPromise(_0xb45f('0x64'),_0xb45f('0x59'),{'module':'res_stun_monitor.so'});}else{var _0x294184=fs[_0xb45f('0x5e')](path['join'](config[_0xb45f('0x60')],'server/files/templates/network.ejs'),_0xb45f('0x61'));var _0x47c9be=ejs[_0xb45f('0x62')](_0x294184,{'networks':_0x5dd7bc||[]});fs[_0xb45f('0x63')](util[_0xb45f('0x67')](_0xb45f('0x68'),_0x14af53[_0xb45f('0x5b')]['type']['toLowerCase']()),_0x47c9be);return respondWithRpcPromise(_0xb45f('0x64'),_0xb45f('0x59'),{'module':'chan_sip.so'});}return null;})[_0xb45f('0x20')](function(){return _0x2806cb;});})[_0xb45f('0x20')](respondWithResult(_0x4a7b5d,0xc9))['catch'](handleError(_0x4a7b5d,null));};exports['update']=function(_0x12f1cb,_0x3ee06c,_0x299611){var _0x3e1035;return db['sequelize'][_0xb45f('0x5a')](function(_0x4c4437){return db['Network']['find']({'where':{'id':_0x12f1cb[_0xb45f('0x53')]['id']}})[_0xb45f('0x20')](handleEntityNotFound(_0x3ee06c,null))[_0xb45f('0x20')](saveUpdates(_0x12f1cb['body'],null))[_0xb45f('0x20')](function(_0x4220f8){if(_0x4220f8){_0x3e1035=_0x4220f8;return db['Network'][_0xb45f('0x50')]({'where':{'type':_0x3e1035['type']},'raw':!![]});}return null;})['then'](function(_0xe7d6b){if(_0x3e1035[_0xb45f('0x3c')][_0xb45f('0x5c')]()==_0xb45f('0x5d')){var _0x3a2d50=fs[_0xb45f('0x5e')](path[_0xb45f('0x5f')](config[_0xb45f('0x60')],_0xb45f('0x69')),_0xb45f('0x61'));var _0x2d570a=ejs['render'](_0x3a2d50,{'networks':_0xe7d6b||[]});fs[_0xb45f('0x63')](_0xb45f('0x6a'),_0x2d570a);return respondWithRpcPromise(_0xb45f('0x64'),'update',{'module':_0xb45f('0x65')});}else if(_0x3e1035[_0xb45f('0x3c')]['toUpperCase']()==_0xb45f('0x6b')){var _0x2e62e3=fs[_0xb45f('0x5e')](path[_0xb45f('0x5f')](config[_0xb45f('0x60')],_0xb45f('0x66')),_0xb45f('0x61'));var _0x54f055=ejs[_0xb45f('0x62')](_0x2e62e3,{'networks':_0xe7d6b||[]});fs[_0xb45f('0x63')](_0xb45f('0x6c'),_0x54f055);return respondWithRpcPromise(_0xb45f('0x64'),_0xb45f('0x35'),{'module':_0xb45f('0x65')});}else{var _0x3bc8e4=fs[_0xb45f('0x5e')](path[_0xb45f('0x5f')](config[_0xb45f('0x60')],_0xb45f('0x6d')),_0xb45f('0x61'));var _0x27e20f=ejs[_0xb45f('0x62')](_0x3bc8e4,{'networks':_0xe7d6b||[]});fs[_0xb45f('0x63')](util[_0xb45f('0x67')](_0xb45f('0x68'),_0x12f1cb[_0xb45f('0x5b')][_0xb45f('0x3c')][_0xb45f('0x6e')]()),_0x27e20f);return respondWithRpcPromise(_0xb45f('0x64'),_0xb45f('0x35'),{'module':'chan_sip.so'});}return null;})[_0xb45f('0x20')](function(_0x2633ed){if(_0x2633ed){return _0x3e1035;}return null;});})[_0xb45f('0x20')](respondWithResult(_0x3ee06c,null))['catch'](handleError(_0x3ee06c,null));};exports[_0xb45f('0x36')]=function(_0x50fb0e,_0x53a431,_0x2fe995){var _0x2d74b6;return db[_0xb45f('0x3a')][_0xb45f('0x57')]({'where':{'id':_0x50fb0e[_0xb45f('0x53')]['id']}})[_0xb45f('0x20')](function(_0x5c4ada){_0x2d74b6=_0x5c4ada;return _0x5c4ada;})[_0xb45f('0x20')](handleEntityNotFound(_0x53a431,null))['then'](removeEntity(_0x53a431,null))[_0xb45f('0x20')](function(){if(_0x2d74b6){return db[_0xb45f('0x3a')][_0xb45f('0x50')]({'where':{'type':_0x2d74b6[_0xb45f('0x3c')]},'raw':!![]});}})['then'](function(_0x13d750){if(_0x2d74b6[_0xb45f('0x3c')][_0xb45f('0x5c')]()==_0xb45f('0x5d')){var _0xb1a4ea=fs[_0xb45f('0x5e')](path[_0xb45f('0x5f')](config[_0xb45f('0x60')],_0xb45f('0x69')),_0xb45f('0x61'));var _0x491ea0=ejs['render'](_0xb1a4ea,{'networks':_0x13d750||[]});fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0x491ea0);return respondWithRpcPromise(_0xb45f('0x64'),_0xb45f('0x36'),{'module':_0xb45f('0x65')});}else if(_0x2d74b6[_0xb45f('0x3c')]['toUpperCase']()==_0xb45f('0x6b')){var _0x301ba4=fs[_0xb45f('0x5e')](path[_0xb45f('0x5f')](config[_0xb45f('0x60')],_0xb45f('0x66')),_0xb45f('0x61'));var _0x5c32b8=ejs['render'](_0x301ba4,{'networks':_0x13d750||[]});fs[_0xb45f('0x63')](_0xb45f('0x6c'),_0x5c32b8);return respondWithRpcPromise(_0xb45f('0x64'),'destroy',{'module':_0xb45f('0x65')});}else{var _0x179e83=fs[_0xb45f('0x5e')](path[_0xb45f('0x5f')](config[_0xb45f('0x60')],_0xb45f('0x6d')),_0xb45f('0x61'));var _0x506a52=ejs[_0xb45f('0x62')](_0x179e83,{'networks':_0x13d750||[]});fs[_0xb45f('0x63')](util[_0xb45f('0x67')](_0xb45f('0x68'),_0x50fb0e[_0xb45f('0x5b')][_0xb45f('0x3c')][_0xb45f('0x6e')]()),_0x506a52);return respondWithRpcPromise(_0xb45f('0x64'),_0xb45f('0x36'),{'module':_0xb45f('0x6f')});}return null;})[_0xb45f('0x58')](handleError(_0x53a431,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 8ec154c..9c0c5fe 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 _0xf8e1=['exports','define','network','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./network.attributes'];(function(_0x1f3344,_0x1e290e){var _0x25617b=function(_0x1fe5a4){while(--_0x1fe5a4){_0x1f3344['push'](_0x1f3344['shift']());}};_0x25617b(++_0x1e290e);}(_0xf8e1,0x1ef));var _0x1f8e=function(_0x5b888b,_0x35d5f9){_0x5b888b=_0x5b888b-0x0;var _0x115000=_0xf8e1[_0x5b888b];return _0x115000;};'use strict';var _=require(_0x1f8e('0x0'));var util=require(_0x1f8e('0x1'));var logger=require(_0x1f8e('0x2'))(_0x1f8e('0x3'));var moment=require('moment');var BPromise=require(_0x1f8e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1f8e('0x5'));var rimraf=require(_0x1f8e('0x6'));var config=require(_0x1f8e('0x7'));var attributes=require(_0x1f8e('0x8'));module[_0x1f8e('0x9')]=function(_0x108380,_0x729327){return _0x108380[_0x1f8e('0xa')]('Network',attributes,{'tableName':_0x1f8e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x645c=['path','../../config/environment','./network.attributes','define','network','lodash','util','bluebird','request-promise'];(function(_0x34dba9,_0x4db90f){var _0x9873d6=function(_0xa300ac){while(--_0xa300ac){_0x34dba9['push'](_0x34dba9['shift']());}};_0x9873d6(++_0x4db90f);}(_0x645c,0xef));var _0xc645=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x645c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc645('0x0'));var util=require(_0xc645('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xc645('0x2'));var rp=require(_0xc645('0x3'));var fs=require('fs');var path=require(_0xc645('0x4'));var rimraf=require('rimraf');var config=require(_0xc645('0x5'));var attributes=require(_0xc645('0x6'));module['exports']=function(_0x2baddb,_0x12f5b7){return _0x2baddb[_0xc645('0x7')]('Network',attributes,{'tableName':_0xc645('0x8'),'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 c7dca70..7fb9d91 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 _0x926d=['then','info','request\x20sent','debug','stringify','error','code','message','Network,\x20%s,\x20%s','result','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x18e3b6,_0x247934){var _0x361973=function(_0x219afa){while(--_0x219afa){_0x18e3b6['push'](_0x18e3b6['shift']());}};_0x361973(++_0x247934);}(_0x926d,0x1ee));var _0xd926=function(_0x1fb4a0,_0x48a602){_0x1fb4a0=_0x1fb4a0-0x0;var _0x1094e7=_0x926d[_0x1fb4a0];return _0x1094e7;};'use strict';var _=require(_0xd926('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd926('0x1'));var fs=require('fs');var Redis=require(_0xd926('0x2'));var db=require(_0xd926('0x3'))['db'];var utils=require(_0xd926('0x4'));var logger=require(_0xd926('0x5'))(_0xd926('0x6'));var config=require(_0xd926('0x7'));var jayson=require(_0xd926('0x8'));var client=jayson[_0xd926('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3fae32,_0x2efd9b,_0x2d9f49){return new BPromise(function(_0x65bb08,_0x483f55){return client['request'](_0x3fae32,_0x2d9f49)[_0xd926('0xa')](function(_0x7a6904){logger[_0xd926('0xb')]('Network,\x20%s,\x20%s',_0x2efd9b,_0xd926('0xc'));logger[_0xd926('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x2efd9b,_0xd926('0xc'),JSON[_0xd926('0xe')](_0x7a6904));if(_0x7a6904[_0xd926('0xf')]){if(_0x7a6904[_0xd926('0xf')][_0xd926('0x10')]===0x1f4){logger[_0xd926('0xf')]('Network,\x20%s,\x20%s',_0x2efd9b,_0x7a6904['error'][_0xd926('0x11')]);return _0x483f55(_0x7a6904[_0xd926('0xf')][_0xd926('0x11')]);}logger['error'](_0xd926('0x12'),_0x2efd9b,_0x7a6904[_0xd926('0xf')][_0xd926('0x11')]);return _0x65bb08(_0x7a6904['error'][_0xd926('0x11')]);}else{logger[_0xd926('0xb')](_0xd926('0x12'),_0x2efd9b,_0xd926('0xc'));_0x65bb08(_0x7a6904[_0xd926('0x13')][_0xd926('0x11')]);}})[_0xd926('0x14')](function(_0x364ace){logger['error'](_0xd926('0x12'),_0x2efd9b,_0x364ace);_0x483f55(_0x364ace);});});} \ No newline at end of file +var _0xc3cd=['code','Network,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','rpc','jayson/promise','client','request','then','info','debug','request\x20sent','stringify','error'];(function(_0x319bb7,_0x23b732){var _0x4e2ddf=function(_0x4fed00){while(--_0x4fed00){_0x319bb7['push'](_0x319bb7['shift']());}};_0x4e2ddf(++_0x23b732);}(_0xc3cd,0x76));var _0xdc3c=function(_0x4e4023,_0x15228f){_0x4e4023=_0x4e4023-0x0;var _0x2080d5=_0xc3cd[_0x4e4023];return _0x2080d5;};'use strict';var _=require(_0xdc3c('0x0'));var util=require(_0xdc3c('0x1'));var moment=require(_0xdc3c('0x2'));var BPromise=require(_0xdc3c('0x3'));var rs=require(_0xdc3c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdc3c('0x5'));var config=require('../../config/environment');var jayson=require(_0xdc3c('0x6'));var client=jayson[_0xdc3c('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2cd303,_0x28901e,_0x2cec68){return new BPromise(function(_0x2d7c75,_0x2bf923){return client[_0xdc3c('0x8')](_0x2cd303,_0x2cec68)[_0xdc3c('0x9')](function(_0x31bfbd){logger[_0xdc3c('0xa')]('Network,\x20%s,\x20%s',_0x28901e,'request\x20sent');logger[_0xdc3c('0xb')]('Network,\x20%s,\x20%s,\x20%s',_0x28901e,_0xdc3c('0xc'),JSON[_0xdc3c('0xd')](_0x31bfbd));if(_0x31bfbd[_0xdc3c('0xe')]){if(_0x31bfbd[_0xdc3c('0xe')][_0xdc3c('0xf')]===0x1f4){logger[_0xdc3c('0xe')](_0xdc3c('0x10'),_0x28901e,_0x31bfbd[_0xdc3c('0xe')][_0xdc3c('0x11')]);return _0x2bf923(_0x31bfbd[_0xdc3c('0xe')]['message']);}logger[_0xdc3c('0xe')](_0xdc3c('0x10'),_0x28901e,_0x31bfbd[_0xdc3c('0xe')]['message']);return _0x2d7c75(_0x31bfbd['error'][_0xdc3c('0x11')]);}else{logger['info'](_0xdc3c('0x10'),_0x28901e,_0xdc3c('0xc'));_0x2d7c75(_0x31bfbd[_0xdc3c('0x12')][_0xdc3c('0x11')]);}})['catch'](function(_0x179cd9){logger[_0xdc3c('0xe')](_0xdc3c('0x10'),_0x28901e,_0x179cd9);_0x2bf923(_0x179cd9);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index 1aeedb5..3ebd888 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 _0xf1b0=['/:id/canned_answers','getAnswers','/:id/applications','/:id/interactions','getInteractions','getAgents','post','create','addDisposition','addAnswer','notify','addApplications','/:id/users','/:id/send','send','put','/:id','update','destroy','removeDispositions','delete','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','index','/describe','describe','isAuthenticated','show','/:id/dispositions','getDispositions'];(function(_0x2f4155,_0x2a2007){var _0x116f3c=function(_0x1d7fb7){while(--_0x1d7fb7){_0x2f4155['push'](_0x2f4155['shift']());}};_0x116f3c(++_0x2a2007);}(_0xf1b0,0xae));var _0x0f1b=function(_0x33a694,_0x9b6640){_0x33a694=_0x33a694-0x0;var _0x41ff01=_0xf1b0[_0x33a694];return _0x41ff01;};'use strict';var multer=require(_0x0f1b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x0f1b('0x1'));var express=require(_0x0f1b('0x2'));var router=express[_0x0f1b('0x3')]();var auth=require(_0x0f1b('0x4'));var interaction=require(_0x0f1b('0x5'));var config=require(_0x0f1b('0x6'));var controller=require(_0x0f1b('0x7'));router[_0x0f1b('0x8')]('/',auth['isAuthenticated'](),controller[_0x0f1b('0x9')]);router['get'](_0x0f1b('0xa'),auth['isAuthenticated'](),controller[_0x0f1b('0xb')]);router[_0x0f1b('0x8')]('/:id',auth[_0x0f1b('0xc')](),controller[_0x0f1b('0xd')]);router['get'](_0x0f1b('0xe'),auth['isAuthenticated'](),controller[_0x0f1b('0xf')]);router[_0x0f1b('0x8')](_0x0f1b('0x10'),auth[_0x0f1b('0xc')](),controller[_0x0f1b('0x11')]);router['get'](_0x0f1b('0x12'),auth[_0x0f1b('0xc')](),controller['getApplications']);router[_0x0f1b('0x8')](_0x0f1b('0x13'),auth[_0x0f1b('0xc')](),controller[_0x0f1b('0x14')]);router[_0x0f1b('0x8')]('/:id/users',auth['isAuthenticated'](),controller[_0x0f1b('0x15')]);router[_0x0f1b('0x16')]('/',auth[_0x0f1b('0xc')](),controller[_0x0f1b('0x17')]);router['post'](_0x0f1b('0xe'),auth['isAuthenticated'](),controller[_0x0f1b('0x18')]);router[_0x0f1b('0x16')](_0x0f1b('0x10'),auth[_0x0f1b('0xc')](),controller[_0x0f1b('0x19')]);router[_0x0f1b('0x16')]('/:id/notify',controller[_0x0f1b('0x1a')]);router[_0x0f1b('0x16')](_0x0f1b('0x12'),auth[_0x0f1b('0xc')](),controller[_0x0f1b('0x1b')]);router['post'](_0x0f1b('0x1c'),auth[_0x0f1b('0xc')](),controller['addAgents']);router[_0x0f1b('0x16')](_0x0f1b('0x1d'),auth[_0x0f1b('0xc')](),controller[_0x0f1b('0x1e')]);router[_0x0f1b('0x1f')](_0x0f1b('0x20'),auth[_0x0f1b('0xc')](),controller[_0x0f1b('0x21')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x0f1b('0x22')]);router['delete']('/:id/dispositions',auth[_0x0f1b('0xc')](),controller[_0x0f1b('0x23')]);router[_0x0f1b('0x24')](_0x0f1b('0x10'),auth[_0x0f1b('0xc')](),controller['removeAnswers']);router['delete'](_0x0f1b('0x1c'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x0f1b('0x25')]=router; \ No newline at end of file +var _0xff2c=['getDispositions','/:id/canned_answers','/:id/applications','getApplications','getInteractions','/:id/users','getAgents','post','create','addDisposition','addAnswer','notify','addAgents','/:id/send','send','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','path','connect-timeout','Router','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/dispositions'];(function(_0x5a1552,_0x5478df){var _0x88e370=function(_0x5726b8){while(--_0x5726b8){_0x5a1552['push'](_0x5a1552['shift']());}};_0x88e370(++_0x5478df);}(_0xff2c,0xfb));var _0xcff2=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xff2c[_0x5b561d];return _0x431060;};'use strict';var multer=require(_0xcff2('0x0'));var util=require('util');var path=require(_0xcff2('0x1'));var timeout=require(_0xcff2('0x2'));var express=require('express');var router=express[_0xcff2('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xcff2('0x4'));var controller=require(_0xcff2('0x5'));router[_0xcff2('0x6')]('/',auth[_0xcff2('0x7')](),controller[_0xcff2('0x8')]);router['get'](_0xcff2('0x9'),auth['isAuthenticated'](),controller[_0xcff2('0xa')]);router[_0xcff2('0x6')](_0xcff2('0xb'),auth['isAuthenticated'](),controller['show']);router['get'](_0xcff2('0xc'),auth['isAuthenticated'](),controller[_0xcff2('0xd')]);router[_0xcff2('0x6')](_0xcff2('0xe'),auth['isAuthenticated'](),controller['getAnswers']);router[_0xcff2('0x6')](_0xcff2('0xf'),auth[_0xcff2('0x7')](),controller[_0xcff2('0x10')]);router['get']('/:id/interactions',auth[_0xcff2('0x7')](),controller[_0xcff2('0x11')]);router['get'](_0xcff2('0x12'),auth[_0xcff2('0x7')](),controller[_0xcff2('0x13')]);router[_0xcff2('0x14')]('/',auth[_0xcff2('0x7')](),controller[_0xcff2('0x15')]);router[_0xcff2('0x14')]('/:id/dispositions',auth[_0xcff2('0x7')](),controller[_0xcff2('0x16')]);router[_0xcff2('0x14')]('/:id/canned_answers',auth[_0xcff2('0x7')](),controller[_0xcff2('0x17')]);router[_0xcff2('0x14')]('/:id/notify',controller[_0xcff2('0x18')]);router[_0xcff2('0x14')](_0xcff2('0xf'),auth[_0xcff2('0x7')](),controller['addApplications']);router[_0xcff2('0x14')](_0xcff2('0x12'),auth['isAuthenticated'](),controller[_0xcff2('0x19')]);router[_0xcff2('0x14')](_0xcff2('0x1a'),auth[_0xcff2('0x7')](),controller[_0xcff2('0x1b')]);router['put'](_0xcff2('0xb'),auth[_0xcff2('0x7')](),controller['update']);router[_0xcff2('0x1c')](_0xcff2('0xb'),auth['isAuthenticated'](),controller['destroy']);router[_0xcff2('0x1c')](_0xcff2('0xc'),auth[_0xcff2('0x7')](),controller[_0xcff2('0x1d')]);router[_0xcff2('0x1c')]('/:id/canned_answers',auth[_0xcff2('0x7')](),controller[_0xcff2('0x1e')]);router[_0xcff2('0x1c')](_0xcff2('0x12'),auth[_0xcff2('0x7')](),controller[_0xcff2('0x1f')]);module[_0xcff2('0x20')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 47216aa..39d32b4 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 _0x5e5b=['mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x17c2ae,_0x27031c){var _0x1216a5=function(_0x1004cf){while(--_0x1004cf){_0x17c2ae['push'](_0x17c2ae['shift']());}};_0x1216a5(++_0x27031c);}(_0x5e5b,0xab));var _0xb5e5=function(_0x2f4336,_0x356087){_0x2f4336=_0x2f4336-0x0;var _0x2c6999=_0x5e5b[_0x2f4336];return _0x2c6999;};'use strict';var Sequelize=require(_0xb5e5('0x0'));var rs=require(_0xb5e5('0x1'));module[_0xb5e5('0x2')]={'name':{'type':Sequelize[_0xb5e5('0x3')],'unique':_0xb5e5('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0xb5e5('0x3')]},'token':{'type':Sequelize[_0xb5e5('0x3')],'defaultValue':function(){return rs[_0xb5e5('0x5')]();}},'replyUri':{'type':Sequelize[_0xb5e5('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xb5e5('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xb5e5('0x6')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xb5e5('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb5e5('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb5e5('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb5e5('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb5e5('0x8')],'allowNull':!![],'defaultValue':null,'comment':_0xb5e5('0x9')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xb5e5('0xa'),'set':function(_0x26713d){if(!_0x26713d)this['setDataValue'](_0xb5e5('0xb'),null);this[_0xb5e5('0xc')](_0xb5e5('0xd'),_0x26713d);}}}; \ No newline at end of file +var _0x7b99=['exports','STRING','name','generate','TEXT','INTEGER','BOOLEAN','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring'];(function(_0x4e3992,_0x40cb82){var _0x90b49f=function(_0x3c583d){while(--_0x3c583d){_0x4e3992['push'](_0x4e3992['shift']());}};_0x90b49f(++_0x40cb82);}(_0x7b99,0x1ab));var _0x97b9=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x7b99[_0x27af45];return _0x18df21;};'use strict';var Sequelize=require(_0x97b9('0x0'));var rs=require(_0x97b9('0x1'));module[_0x97b9('0x2')]={'name':{'type':Sequelize[_0x97b9('0x3')],'unique':_0x97b9('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0x97b9('0x3')]},'token':{'type':Sequelize[_0x97b9('0x3')],'defaultValue':function(){return rs[_0x97b9('0x5')]();}},'replyUri':{'type':Sequelize[_0x97b9('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x97b9('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x97b9('0x6')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x97b9('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x97b9('0x3')]},'queueTransfer':{'type':Sequelize[_0x97b9('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x97b9('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x97b9('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x97b9('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x97b9('0x7')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x97b9('0x8')],'defaultValue':![],'comment':_0x97b9('0x9'),'set':function(_0x35eba7){if(!_0x35eba7)this[_0x97b9('0xa')](_0x97b9('0xb'),null);this[_0x97b9('0xa')](_0x97b9('0xc'),_0x35eba7);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 1525b8f..30af4ef 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 _0xa66b=['request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','sendStatus','status','end','json','offset','limit','reject','save','update','destroy','get','UserProfileResource','stack','name','send','index','Pause','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','options','OpenchannelAccount','count','includeAll','include','findAll','rows','show','params','mandatoryDispositionPause','length','merge','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','OpenchannelAccounts','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','OpnechannelAccountId','Disposition','getDispositions','OpenchannelAccountId','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','notify','openchannel','no\x20available\x20attributes','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','CmContact','Contacts','Applications','applications','list','orderBy','priority','asc','account','defaults','threadId','externalUrl','OpenchannelInteraction','ContactId','spread','contact','firstName','messageId','interaction','created','close','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','transaction','OpenchannelApplication','bulkCreate','findAndCountAll','getApplications','pick','getInteractions','Contact','Owner','fullname','internal','color','tag','addAgents','omit','emit','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','DESC','out','OpenchannelMessage','Messages','dataValues','push','html-pdf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelAccount.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','OpenchannelAccount,\x20%s,\x20%s'];(function(_0x1eda20,_0x1149f4){var _0x31b953=function(_0x25f0d8){while(--_0x25f0d8){_0x1eda20['push'](_0x1eda20['shift']());}};_0x31b953(++_0x1149f4);}(_0xa66b,0x156));var _0xba66=function(_0x5e1855,_0x17161e){_0x5e1855=_0x5e1855-0x0;var _0x4faf68=_0xa66b[_0x5e1855];return _0x4faf68;};'use strict';var pdf=require(_0xba66('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xba66('0x1'));var jsonpatch=require(_0xba66('0x2'));var rp=require(_0xba66('0x3'));var moment=require(_0xba66('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xba66('0x5'));var path=require(_0xba66('0x6'));var sox=require(_0xba66('0x7'));var csv=require(_0xba66('0x8'));var ejs=require(_0xba66('0x9'));var fs=require('fs');var _=require(_0xba66('0xa'));var squel=require(_0xba66('0xb'));var crypto=require(_0xba66('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xba66('0xd'));var toCsv=require('to-csv');var querystring=require(_0xba66('0xe'));var Papa=require(_0xba66('0xf'));var Redis=require('ioredis');var authService=require(_0xba66('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xba66('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xba66('0x12'))(_0xba66('0x13'));var utils=require(_0xba66('0x14'));var config=require('../../config/environment');var db=require(_0xba66('0x15'))['db'];config[_0xba66('0x16')]=_['defaults'](config['redis'],{'host':_0xba66('0x17'),'port':0x18eb});var socket=require(_0xba66('0x18'))(new Redis(config[_0xba66('0x16')]));require(_0xba66('0x19'))[_0xba66('0x1a')](socket);var jayson=require(_0xba66('0x1b'));var client=jayson[_0xba66('0x1c')][_0xba66('0x1d')]({'port':0x232c});var client9002=jayson[_0xba66('0x1c')][_0xba66('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x4a2158,_0x26f08e,_0x308cb5){if(_0x308cb5){var _0x12531a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x12531a[_0xba66('0x1e')](_0x26f08e)){return _0x4a2158;}else{throw new db[(_0xba66('0x1f'))][(_0xba66('0x20'))](_0xba66('0x21'));}}else{return _0x4a2158;}}function respondWithRpcPromise(_0x2b0b13,_0x49985b,_0xae9cc3,_0x142d6c){return new BPromise(function(_0x594f15,_0x11f1a8){var _0x4d5e0c=_0x142d6c||client;return _0x4d5e0c['request'](_0x2b0b13,_0xae9cc3)[_0xba66('0x22')](function(_0x3309b5){logger['info'](_0xba66('0x23'),_0x49985b,_0xba66('0x24'));logger[_0xba66('0x25')](_0xba66('0x26'),_0x49985b,'request\x20sent',JSON[_0xba66('0x27')](_0x3309b5));if(_0x3309b5[_0xba66('0x28')]){if(_0x3309b5['error']['code']===0x1f4){logger[_0xba66('0x28')](_0xba66('0x23'),_0x49985b,_0x3309b5['error']['message']);return _0x11f1a8(_0x3309b5[_0xba66('0x28')][_0xba66('0x29')]);}logger['error'](_0xba66('0x23'),_0x49985b,_0x3309b5[_0xba66('0x28')][_0xba66('0x29')]);return _0x594f15(_0x3309b5[_0xba66('0x28')][_0xba66('0x29')]);}else{logger[_0xba66('0x2a')]('OpenchannelAccount,\x20%s,\x20%s',_0x49985b,'request\x20sent');_0x594f15(_0x3309b5[_0xba66('0x2b')]['message']);}})['catch'](function(_0x3d248d){logger[_0xba66('0x28')](_0xba66('0x23'),_0x49985b,_0x3d248d);_0x11f1a8(_0x3d248d);});});}function respondWithStatusCode(_0x35708a,_0x4e922b){_0x4e922b=_0x4e922b||0xcc;return function(_0xe08ec3){if(_0xe08ec3){return _0x35708a[_0xba66('0x2c')](_0x4e922b);}return _0x35708a[_0xba66('0x2d')](_0x4e922b)[_0xba66('0x2e')]();};}function respondWithResult(_0x4291f9,_0x35e4dc){_0x35e4dc=_0x35e4dc||0xc8;return function(_0x33aa4e){if(_0x33aa4e){return _0x4291f9['status'](_0x35e4dc)[_0xba66('0x2f')](_0x33aa4e);}};}function respondWithFilteredResult(_0x58e0d2,_0x43941d){return function(_0x2d4e7d){if(_0x2d4e7d){var _0xf4ad02=_0x2d4e7d['count'],_0x100582=_0x43941d[_0xba66('0x30')],_0x1301cc=_0x43941d[_0xba66('0x30')]+_0x43941d[_0xba66('0x31')],_0x5c5856;if(_0x1301cc>=_0xf4ad02){_0x1301cc=_0xf4ad02;_0x5c5856=0xc8;}else{_0x5c5856=0xce;}_0x58e0d2[_0xba66('0x2d')](_0x5c5856);return _0x58e0d2['set']('Content-Range',_0x100582+'-'+_0x1301cc+'/'+_0xf4ad02)[_0xba66('0x2f')](_0x2d4e7d);}return null;};}function patchUpdates(_0x268759){return function(_0x48db89){try{jsonpatch['apply'](_0x48db89,_0x268759,!![]);}catch(_0x3e2b77){return BPromise[_0xba66('0x32')](_0x3e2b77);}return _0x48db89[_0xba66('0x33')]();};}function saveUpdates(_0x3af58b,_0x3bb2d5){return function(_0x4080e8){if(_0x4080e8){return _0x4080e8[_0xba66('0x34')](_0x3af58b)[_0xba66('0x22')](function(_0x198e02){return _0x198e02;});}return null;};}function removeEntity(_0x247098,_0xe63f1c){return function(_0x5a9229){if(_0x5a9229){return _0x5a9229[_0xba66('0x35')]()['then'](function(){var _0x5c2349=_0x5a9229[_0xba66('0x36')]({'plain':!![]});var _0x43b4c2='OpenchannelAccounts';return db[_0xba66('0x37')]['destroy']({'where':{'type':_0x43b4c2,'resourceId':_0x5c2349['id']}})[_0xba66('0x22')](function(){return _0x5a9229;});})[_0xba66('0x22')](function(){_0x247098[_0xba66('0x2d')](0xcc)[_0xba66('0x2e')]();});}};}function handleEntityNotFound(_0x3ce176,_0x390c17){return function(_0x40933c){if(!_0x40933c){_0x3ce176[_0xba66('0x2c')](0x194);}return _0x40933c;};}function handleError(_0x2af1e8,_0x596605){_0x596605=_0x596605||0x1f4;return function(_0x285aae){logger[_0xba66('0x28')](_0x285aae[_0xba66('0x38')]);if(_0x285aae[_0xba66('0x39')]){delete _0x285aae[_0xba66('0x39')];}_0x2af1e8['status'](_0x596605)[_0xba66('0x3a')](_0x285aae);};}exports[_0xba66('0x3b')]=function(_0x5430b9,_0x214f9b){var _0x3ece3f={'include':[{'model':db[_0xba66('0x3c')],'as':'mandatoryDispositionPause'}]},_0x70d0d4={},_0xd6f761={'count':0x0,'rows':[]};var _0x5c4177=_[_0xba66('0x3d')](db['OpenchannelAccount'][_0xba66('0x3e')],function(_0x33ffb3){return{'name':_0x33ffb3[_0xba66('0x3f')],'type':_0x33ffb3['type'][_0xba66('0x40')]};});_0x70d0d4[_0xba66('0x41')]=_['map'](_0x5c4177,_0xba66('0x39'));_0x70d0d4[_0xba66('0x42')]=_[_0xba66('0x43')](_0x5430b9[_0xba66('0x42')]);_0x70d0d4[_0xba66('0x44')]=_[_0xba66('0x45')](_0x70d0d4[_0xba66('0x41')],_0x70d0d4['query']);_0x3ece3f[_0xba66('0x46')]=_['intersection'](_0x70d0d4[_0xba66('0x41')],qs['fields'](_0x5430b9[_0xba66('0x42')][_0xba66('0x47')]));_0x3ece3f['attributes']=_0x3ece3f['attributes']['length']?_0x3ece3f[_0xba66('0x46')]:_0x70d0d4[_0xba66('0x41')];if(!_0x5430b9[_0xba66('0x42')][_0xba66('0x48')](_0xba66('0x49'))){_0x3ece3f[_0xba66('0x31')]=qs['limit'](_0x5430b9[_0xba66('0x42')]['limit']);_0x3ece3f[_0xba66('0x30')]=qs[_0xba66('0x30')](_0x5430b9[_0xba66('0x42')][_0xba66('0x30')]);}_0x3ece3f[_0xba66('0x4a')]=qs['sort'](_0x5430b9[_0xba66('0x42')][_0xba66('0x4b')]);_0x3ece3f[_0xba66('0x4c')]=qs[_0xba66('0x44')](_['pick'](_0x5430b9[_0xba66('0x42')],_0x70d0d4[_0xba66('0x44')]));if(_0x5430b9[_0xba66('0x42')][_0xba66('0x4d')]){_0x3ece3f['where']=_['merge'](_0x3ece3f[_0xba66('0x4c')],{'$or':_['map'](_0x5c4177,function(_0x24c02c){if(_0x24c02c['type']!=='VIRTUAL'){var _0x13515c={};_0x13515c[_0x24c02c[_0xba66('0x39')]]={'$like':'%'+_0x5430b9['query']['filter']+'%'};return _0x13515c;}})});}_0x3ece3f=_['merge']({},_0x3ece3f,_0x5430b9[_0xba66('0x4e')]);var _0x13d871={'where':_0x3ece3f['where']};return db[_0xba66('0x4f')][_0xba66('0x50')](_0x13d871)[_0xba66('0x22')](function(_0x4078cd){_0xd6f761['count']=_0x4078cd;if(_0x5430b9[_0xba66('0x42')][_0xba66('0x51')]){_0x3ece3f[_0xba66('0x52')]=[{'all':!![]}];}return db[_0xba66('0x4f')][_0xba66('0x53')](_0x3ece3f);})[_0xba66('0x22')](function(_0xde01a9){_0xd6f761[_0xba66('0x54')]=_0xde01a9;return _0xd6f761;})[_0xba66('0x22')](respondWithFilteredResult(_0x214f9b,_0x3ece3f))['catch'](handleError(_0x214f9b,null));};exports[_0xba66('0x55')]=function(_0x5dac94,_0x37f283){var _0x5b3d13={'raw':![],'where':{'id':_0x5dac94[_0xba66('0x56')]['id']},'include':[{'model':db[_0xba66('0x3c')],'as':_0xba66('0x57')}]},_0x5760bb={};_0x5760bb[_0xba66('0x41')]=_['keys'](db[_0xba66('0x4f')][_0xba66('0x3e')]);_0x5760bb[_0xba66('0x42')]=_[_0xba66('0x43')](_0x5dac94[_0xba66('0x42')]);_0x5760bb[_0xba66('0x44')]=_[_0xba66('0x45')](_0x5760bb[_0xba66('0x41')],_0x5760bb[_0xba66('0x42')]);_0x5b3d13[_0xba66('0x46')]=_[_0xba66('0x45')](_0x5760bb[_0xba66('0x41')],qs['fields'](_0x5dac94['query'][_0xba66('0x47')]));_0x5b3d13['attributes']=_0x5b3d13[_0xba66('0x46')][_0xba66('0x58')]?_0x5b3d13[_0xba66('0x46')]:_0x5760bb['model'];if(_0x5dac94[_0xba66('0x42')]['includeAll']){_0x5b3d13[_0xba66('0x52')]=[{'all':!![]}];}_0x5b3d13=_[_0xba66('0x59')]({},_0x5b3d13,_0x5dac94[_0xba66('0x4e')]);return db[_0xba66('0x4f')][_0xba66('0x5a')](_0x5b3d13)[_0xba66('0x22')](handleEntityNotFound(_0x37f283,null))[_0xba66('0x22')](respondWithResult(_0x37f283,null))[_0xba66('0x5b')](handleError(_0x37f283,null));};exports[_0xba66('0x5c')]=function(_0x2a30f8,_0x3c8c24){return db[_0xba66('0x4f')][_0xba66('0x5c')](_0x2a30f8[_0xba66('0x5d')],{})['then'](function(_0x5cd13d){var _0x1781a5=_0x2a30f8['user'][_0xba66('0x36')]({'plain':!![]});if(!_0x1781a5)throw new Error(_0xba66('0x5e'));if(_0x1781a5[_0xba66('0x5f')]===_0xba66('0x60')){var _0x2cd338=_0x5cd13d[_0xba66('0x36')]({'plain':!![]});var _0x1b1ea8=_0xba66('0x61');return db[_0xba66('0x62')][_0xba66('0x5a')]({'where':{'name':_0x1b1ea8,'userProfileId':_0x1781a5[_0xba66('0x63')]},'raw':!![]})[_0xba66('0x22')](function(_0x28d8fb){if(_0x28d8fb&&_0x28d8fb[_0xba66('0x64')]===0x0){return db[_0xba66('0x37')][_0xba66('0x5c')]({'name':_0x2cd338[_0xba66('0x39')],'resourceId':_0x2cd338['id'],'type':_0x28d8fb[_0xba66('0x39')],'sectionId':_0x28d8fb['id']},{})[_0xba66('0x22')](function(){return _0x5cd13d;});}else{return _0x5cd13d;}})[_0xba66('0x5b')](function(_0x2030ea){logger[_0xba66('0x28')](_0xba66('0x65'),_0x2030ea);throw _0x2030ea;});}return _0x5cd13d;})['then'](respondWithResult(_0x3c8c24,0xc9))['catch'](handleError(_0x3c8c24,null));};exports['update']=function(_0x5f378f,_0x50b767){if(_0x5f378f['body']['id']){delete _0x5f378f[_0xba66('0x5d')]['id'];}return db[_0xba66('0x4f')][_0xba66('0x5a')]({'where':{'id':_0x5f378f['params']['id']},'include':[{'model':db[_0xba66('0x3c')],'as':_0xba66('0x57')}]})[_0xba66('0x22')](handleEntityNotFound(_0x50b767,null))[_0xba66('0x22')](saveUpdates(_0x5f378f[_0xba66('0x5d')],null))[_0xba66('0x22')](respondWithResult(_0x50b767,null))[_0xba66('0x5b')](handleError(_0x50b767,null));};exports[_0xba66('0x35')]=function(_0x2e55f9,_0x368b4e){return db[_0xba66('0x4f')][_0xba66('0x5a')]({'where':{'id':_0x2e55f9['params']['id']}})[_0xba66('0x22')](handleEntityNotFound(_0x368b4e,null))[_0xba66('0x22')](removeEntity(_0x368b4e,null))[_0xba66('0x5b')](handleError(_0x368b4e,null));};exports[_0xba66('0x66')]=function(_0x18f013,_0x359538){return db[_0xba66('0x4f')][_0xba66('0x66')]()['then'](respondWithResult(_0x359538,null))[_0xba66('0x5b')](handleError(_0x359538,null));};exports[_0xba66('0x67')]=function(_0x18923e,_0x50c0f3,_0x4d4199){if(_0x18923e[_0xba66('0x5d')]['id']){delete _0x18923e[_0xba66('0x5d')]['id'];}return db[_0xba66('0x4f')][_0xba66('0x5a')]({'where':{'id':_0x18923e['params']['id']}})[_0xba66('0x22')](handleEntityNotFound(_0x50c0f3,null))[_0xba66('0x22')](function(_0xdf0015){if(_0xdf0015){_0x18923e[_0xba66('0x5d')][_0xba66('0x68')]=_0xdf0015['id'];return db[_0xba66('0x69')][_0xba66('0x5c')](_0x18923e[_0xba66('0x5d')]);}})[_0xba66('0x22')](respondWithResult(_0x50c0f3,null))[_0xba66('0x5b')](handleError(_0x50c0f3,null));};exports[_0xba66('0x6a')]=function(_0x5b4fa2,_0x2cc1c1,_0x4d95e9){var _0x1f774a={'raw':![],'where':{}};var _0x4a8635={};var _0x248931={'count':0x0,'rows':[]};return db[_0xba66('0x4f')]['findOne']({'where':{'id':_0x5b4fa2[_0xba66('0x56')]['id']}})[_0xba66('0x22')](handleEntityNotFound(_0x2cc1c1,null))['then'](function(_0x552a41){if(_0x552a41){_0x4a8635[_0xba66('0x41')]=_[_0xba66('0x43')](db[_0xba66('0x69')][_0xba66('0x3e')]);_0x4a8635[_0xba66('0x42')]=_[_0xba66('0x43')](_0x5b4fa2['query']);_0x4a8635[_0xba66('0x44')]=_['intersection'](_0x4a8635[_0xba66('0x41')],_0x4a8635[_0xba66('0x42')]);_0x1f774a[_0xba66('0x46')]=_[_0xba66('0x45')](_0x4a8635[_0xba66('0x41')],qs[_0xba66('0x47')](_0x5b4fa2['query']['fields']));_0x1f774a[_0xba66('0x46')]=_0x1f774a['attributes'][_0xba66('0x58')]?_0x1f774a[_0xba66('0x46')]:_0x4a8635[_0xba66('0x41')];if(!_0x5b4fa2[_0xba66('0x42')][_0xba66('0x48')](_0xba66('0x49'))){_0x1f774a['limit']=qs[_0xba66('0x31')](_0x5b4fa2[_0xba66('0x42')][_0xba66('0x31')]);_0x1f774a['offset']=qs[_0xba66('0x30')](_0x5b4fa2[_0xba66('0x42')]['offset']);}_0x1f774a['order']=qs['sort'](_0x5b4fa2['query']['sort']);_0x1f774a[_0xba66('0x4c')]=qs[_0xba66('0x44')](_['pick'](_0x5b4fa2['query'],_0x4a8635['filters']));_0x1f774a[_0xba66('0x4c')][_0xba66('0x6b')]=_0x552a41['id'];if(_0x5b4fa2['query']['filter']){_0x1f774a['where']=_[_0xba66('0x59')](_0x1f774a[_0xba66('0x4c')],{'$or':_[_0xba66('0x3d')](_0x1f774a[_0xba66('0x46')],function(_0x1c4d64){var _0x4313ee={};_0x4313ee[_0x1c4d64]={'$like':'%'+_0x5b4fa2[_0xba66('0x42')][_0xba66('0x4d')]+'%'};return _0x4313ee;})});}_0x1f774a=_['merge']({},_0x1f774a,_0x5b4fa2[_0xba66('0x4e')]);return db[_0xba66('0x69')]['count']({'where':_0x1f774a[_0xba66('0x4c')]})[_0xba66('0x22')](function(_0x451657){_0x248931[_0xba66('0x50')]=_0x451657;if(_0x5b4fa2[_0xba66('0x42')]['includeAll']){_0x1f774a[_0xba66('0x52')]=[{'all':!![]}];}return db[_0xba66('0x69')][_0xba66('0x53')](_0x1f774a);})[_0xba66('0x22')](function(_0x42e327){_0x248931['rows']=_0x42e327;return _0x248931;});}})[_0xba66('0x22')](respondWithFilteredResult(_0x2cc1c1,_0x1f774a))[_0xba66('0x5b')](handleError(_0x2cc1c1,null));};exports[_0xba66('0x6c')]=function(_0x5c64cc,_0x1bbd6c,_0xc92b59){return db[_0xba66('0x4f')][_0xba66('0x5a')]({'where':{'id':_0x5c64cc[_0xba66('0x56')]['id']}})[_0xba66('0x22')](handleEntityNotFound(_0x1bbd6c,null))[_0xba66('0x22')](function(_0x3791b2){if(_0x3791b2){return _0x3791b2[_0xba66('0x6c')](_0x5c64cc[_0xba66('0x42')][_0xba66('0x6d')]);}})['then'](respondWithStatusCode(_0x1bbd6c,null))[_0xba66('0x5b')](handleError(_0x1bbd6c,null));};exports[_0xba66('0x6e')]=function(_0x10b01e,_0x3edf5c,_0x1c075f){if(_0x10b01e[_0xba66('0x5d')]['id']){delete _0x10b01e[_0xba66('0x5d')]['id'];}return db[_0xba66('0x4f')][_0xba66('0x5a')]({'where':{'id':_0x10b01e['params']['id']}})[_0xba66('0x22')](handleEntityNotFound(_0x3edf5c,null))['then'](function(_0x7da772){if(_0x7da772){_0x10b01e[_0xba66('0x5d')][_0xba66('0x6b')]=_0x7da772['id'];return db[_0xba66('0x6f')]['create'](_0x10b01e['body']);}})[_0xba66('0x22')](respondWithResult(_0x3edf5c,null))[_0xba66('0x5b')](handleError(_0x3edf5c,null));};exports[_0xba66('0x70')]=function(_0x3167b8,_0x42beb4,_0x96c51b){var _0x186a97={'raw':![],'where':{}};var _0x46ce34={};var _0x599b15={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xba66('0x71')]({'where':{'id':_0x3167b8[_0xba66('0x56')]['id']}})[_0xba66('0x22')](handleEntityNotFound(_0x42beb4,null))[_0xba66('0x22')](function(_0x3d41ce){if(_0x3d41ce){_0x46ce34[_0xba66('0x41')]=_[_0xba66('0x43')](db[_0xba66('0x6f')][_0xba66('0x3e')]);_0x46ce34['query']=_['keys'](_0x3167b8[_0xba66('0x42')]);_0x46ce34[_0xba66('0x44')]=_[_0xba66('0x45')](_0x46ce34['model'],_0x46ce34[_0xba66('0x42')]);_0x186a97['attributes']=_['intersection'](_0x46ce34[_0xba66('0x41')],qs[_0xba66('0x47')](_0x3167b8['query'][_0xba66('0x47')]));_0x186a97[_0xba66('0x46')]=_0x186a97[_0xba66('0x46')][_0xba66('0x58')]?_0x186a97[_0xba66('0x46')]:_0x46ce34['model'];if(!_0x3167b8[_0xba66('0x42')][_0xba66('0x48')](_0xba66('0x49'))){_0x186a97['limit']=qs[_0xba66('0x31')](_0x3167b8[_0xba66('0x42')][_0xba66('0x31')]);_0x186a97[_0xba66('0x30')]=qs[_0xba66('0x30')](_0x3167b8[_0xba66('0x42')][_0xba66('0x30')]);}_0x186a97[_0xba66('0x4a')]=qs[_0xba66('0x4b')](_0x3167b8['query']['sort']);_0x186a97['where']=qs['filters'](_['pick'](_0x3167b8[_0xba66('0x42')],_0x46ce34['filters']));_0x186a97[_0xba66('0x4c')][_0xba66('0x6b')]=_0x3d41ce['id'];if(_0x3167b8[_0xba66('0x42')]['filter']){_0x186a97[_0xba66('0x4c')]=_[_0xba66('0x59')](_0x186a97['where'],{'$or':_[_0xba66('0x3d')](_0x186a97['attributes'],function(_0x4c2fe3){var _0x324903={};_0x324903[_0x4c2fe3]={'$like':'%'+_0x3167b8['query'][_0xba66('0x4d')]+'%'};return _0x324903;})});}_0x186a97=_[_0xba66('0x59')]({},_0x186a97,_0x3167b8[_0xba66('0x4e')]);return db[_0xba66('0x6f')][_0xba66('0x50')]({'where':_0x186a97[_0xba66('0x4c')]})['then'](function(_0x5c8b1c){_0x599b15[_0xba66('0x50')]=_0x5c8b1c;if(_0x3167b8[_0xba66('0x42')][_0xba66('0x51')]){_0x186a97[_0xba66('0x52')]=[{'all':!![]}];}return db[_0xba66('0x6f')]['findAll'](_0x186a97);})['then'](function(_0x2f0249){_0x599b15['rows']=_0x2f0249;return _0x599b15;});}})['then'](respondWithFilteredResult(_0x42beb4,_0x186a97))['catch'](handleError(_0x42beb4,null));};exports[_0xba66('0x72')]=function(_0x4882ad,_0x4580e2,_0x18c798){return db['OpenchannelAccount'][_0xba66('0x5a')]({'where':{'id':_0x4882ad[_0xba66('0x56')]['id']}})[_0xba66('0x22')](handleEntityNotFound(_0x4580e2,null))[_0xba66('0x22')](function(_0x4afc3f){if(_0x4afc3f){return _0x4afc3f[_0xba66('0x72')](_0x4882ad[_0xba66('0x42')][_0xba66('0x6d')]);}})['then'](respondWithStatusCode(_0x4580e2,null))[_0xba66('0x5b')](handleError(_0x4580e2,null));};exports[_0xba66('0x73')]=function(_0x363285,_0xe3503b,_0x50c94b){var _0x3c3637={'body':_0x363285['body'],'channel':_0xba66('0x74')};var _0x3b8d87=[];var _0xca1038=[];var _0x22f1e1={};var _0x214e65=![];return db['CmContact'][_0xba66('0x66')]()['then'](function(_0x46a7de){if(!_0x46a7de){throw new db[(_0xba66('0x1f'))][(_0xba66('0x20'))](_0xba66('0x75'));}_0x3b8d87=_['difference'](_[_0xba66('0x43')](_0x46a7de),['createdAt','updatedAt']);_0xca1038=_['difference'](_[_0xba66('0x43')](_0x46a7de),[_0xba66('0x76'),_0xba66('0x77'),_0xba66('0x78'),_0xba66('0x79')]);if(_0x363285[_0xba66('0x5d')]['id']){delete _0x363285['body']['id'];}if(_[_0xba66('0x7a')](_0x363285[_0xba66('0x5d')][_0xba66('0x7b')])){throw new db[(_0xba66('0x1f'))][(_0xba66('0x20'))](_0xba66('0x7c'));}if(_[_0xba66('0x7a')](_0x363285[_0xba66('0x5d')][_0xba66('0x5d')])||_0x363285['body'][_0xba66('0x5d')]===''){throw new db[(_0xba66('0x1f'))]['ValidationError'](_0xba66('0x7d'));}if(_[_0xba66('0x7a')](_0x363285['body'][_0xba66('0x7e')])){throw new db[(_0xba66('0x1f'))]['ValidationError'](_0xba66('0x7f')+_0xca1038);}if(!_[_0xba66('0x80')](_0xca1038,_0x363285[_0xba66('0x5d')][_0xba66('0x7e')])){throw new db[(_0xba66('0x1f'))][(_0xba66('0x20'))](_0xba66('0x81')+_0xca1038);}_0x22f1e1[_0x363285[_0xba66('0x5d')][_0xba66('0x7e')]]=_0x363285[_0xba66('0x5d')][_0xba66('0x7b')];})[_0xba66('0x22')](function(){return db[_0xba66('0x4f')][_0xba66('0x5a')]({'where':{'id':_0x363285[_0xba66('0x56')]['id']},'include':[{'model':db[_0xba66('0x82')],'as':_0xba66('0x83'),'include':[{'model':db[_0xba66('0x84')],'as':_0xba66('0x85'),'where':_0x22f1e1,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db['OpenchannelApplication'],'as':_0xba66('0x86')}]});})[_0xba66('0x22')](handleEntityNotFound(_0xe3503b,null))[_0xba66('0x22')](function(_0x3247db){if(_0x3247db&&_0x3247db[_0xba66('0x83')]){_0x3c3637['account']=_0x3247db;_0x3c3637[_0xba66('0x87')]=_0x3247db[_0xba66('0x86')];_0x3c3637[_0xba66('0x88')]=_0x3247db[_0xba66('0x83')];_0x3c3637['applications']=_[_0xba66('0x89')](_0x3c3637['applications'],[_0xba66('0x8a')],[_0xba66('0x8b')]);if(_0x3c3637[_0xba66('0x8c')][_0xba66('0x86')]){delete _0x3c3637['account'][_0xba66('0x86')];}if(_0x3c3637[_0xba66('0x8c')][_0xba66('0x83')]&&_0x3c3637[_0xba66('0x8c')][_0xba66('0x83')][_0xba66('0x85')]['length']){return _0x3c3637['account']['List']['Contacts'][0x0];}var _0x1348cd=_[_0xba66('0x8d')](_0x363285['body'],{'firstName':_0x363285[_0xba66('0x5d')][_0xba66('0x7b')],'ListId':_0x3247db['ListId']});_0x1348cd[_0x363285[_0xba66('0x5d')][_0xba66('0x7e')]]=_0x363285['body'][_0xba66('0x7b')];return db[_0xba66('0x84')][_0xba66('0x5c')](_0x1348cd,{'fields':_0x3b8d87,'raw':!![]});}})[_0xba66('0x22')](handleEntityNotFound(_0xe3503b,null))['then'](function(_0x140550){_0x3c3637['contact']=_0x140550;if(_0x140550){var _0x2bf46d={'ContactId':_0x140550['id'],'OpenchannelAccountId':_0x363285['params']['id'],'from':(_0x140550['firstName']||'')+'\x20'+(_0x140550['lastName']||'')};var _0x8e63e5={'OpenchannelAccountId':_0x363285[_0xba66('0x56')]['id'],'closed':![]};if(_0x363285[_0xba66('0x5d')][_0xba66('0x8e')]){_0x8e63e5[_0xba66('0x8e')]=_0x363285[_0xba66('0x5d')]['threadId'];return db['OpenchannelInteraction'][_0xba66('0x5a')]({'where':_0x8e63e5})[_0xba66('0x22')](function(_0x17b657){if(_0x17b657){return[_0x17b657,![]];}_0x2bf46d[_0xba66('0x8e')]=_0x363285[_0xba66('0x5d')][_0xba66('0x8e')];_0x2bf46d[_0xba66('0x8f')]=_0x363285['body'][_0xba66('0x8f')];return db[_0xba66('0x90')][_0xba66('0x5c')](_0x2bf46d)[_0xba66('0x22')](function(_0x751f17){return[_0x751f17,!![]];});});}else{_0x8e63e5[_0xba66('0x8e')]=null;}_0x8e63e5[_0xba66('0x91')]=_0x140550['id'];return db[_0xba66('0x90')][_0xba66('0x5a')]({'where':_0x8e63e5})[_0xba66('0x22')](function(_0x51d44e){if(_0x51d44e){return[_0x51d44e,![]];}return db[_0xba66('0x90')][_0xba66('0x5c')](_0x2bf46d)[_0xba66('0x22')](function(_0x37b34c){return[_0x37b34c,!![]];});});}})[_0xba66('0x92')](function(_0x5ebacf,_0x5bca2f){if(_0x5ebacf){_0x214e65=_0x5bca2f;if(!_0x5bca2f){var _0x42de74={'from':(_0x3c3637[_0xba66('0x93')][_0xba66('0x94')]||'')+'\x20'+(_0x3c3637[_0xba66('0x93')]['lastName']||'')};if(_0x363285[_0xba66('0x5d')][_0xba66('0x8e')]&&_0x363285[_0xba66('0x5d')][_0xba66('0x95')]&&_0x363285[_0xba66('0x5d')]['threadId']!=_0x363285[_0xba66('0x5d')]['messageId']){_0x42de74[_0xba66('0x8e')]=_0x363285['body'][_0xba66('0x95')];}return _0x5ebacf[_0xba66('0x34')](_0x42de74);}else{return _0x5ebacf;}}})[_0xba66('0x22')](function(_0x459e03){_0x3c3637['interaction']=_0x459e03['get']({'plain':!![]});_0x3c3637[_0xba66('0x96')]['created']=_0x214e65;if(_0x3c3637[_0xba66('0x96')][_0xba66('0x97')]){if(_0x3c3637[_0xba66('0x8c')]['autoclose']){_0x3c3637[_0xba66('0x87')]['push']({'id':0x0,'priority':_0x3c3637[_0xba66('0x87')]['length']+0x1,'app':_0xba66('0x98'),'appdata':'unmanaged','interval':'*,*,*,*'});}}return db['OpenchannelMessage'][_0xba66('0x5c')]({'body':_0x363285[_0xba66('0x5d')][_0xba66('0x5d')],'OpenchannelAccountId':_0x363285[_0xba66('0x56')]['id'],'OpenchannelInteractionId':_0x459e03['id'],'direction':'in','ContactId':_0x3c3637[_0xba66('0x93')]['id'],'AttachmentId':_0x363285[_0xba66('0x5d')][_0xba66('0x99')]});})[_0xba66('0x22')](function(_0x1c85eb){_0x3c3637[_0xba66('0x29')]=_0x1c85eb;if(_0x3c3637[_0xba66('0x96')][_0xba66('0x9a')]){return db[_0xba66('0x9b')]['find']({'attributes':['id',_0xba66('0x39')],'where':{'id':_0x3c3637[_0xba66('0x96')][_0xba66('0x9a')]}})[_0xba66('0x22')](function(_0x344627){if(_0x344627){_0x3c3637[_0xba66('0x87')]['unshift']({'id':0x0,'priority':0x0,'app':_0xba66('0x9c'),'appdata':_0x344627[_0xba66('0x39')]+','+(_0x3c3637[_0xba66('0x8c')][_0xba66('0x9d')]||0xa),'interval':_0xba66('0x9e')});_0x3c3637[_0xba66('0x9f')]=![];}return respondWithRpcPromise(_0xba66('0xa0'),_0xba66('0xa1'),_0x3c3637);});}return respondWithRpcPromise('Start',_0xba66('0xa1'),_0x3c3637);})['then'](function(_0x13b2bc){respondWithRpcPromise(_0xba66('0xa2'),_0xba66('0xa2'),{'event':_0xba66('0x73'),'message':_0x13b2bc},client9002);return _0x13b2bc;})[_0xba66('0x22')](respondWithResult(_0xe3503b,null))[_0xba66('0x5b')](handleError(_0xe3503b,null));};exports['addApplications']=function(_0x228000,_0x41ac3b,_0x5b7c01){return db[_0xba66('0x4f')][_0xba66('0x71')]({'where':{'id':_0x228000['params']['id']}})['then'](handleEntityNotFound(_0x41ac3b,null))[_0xba66('0x22')](function(_0x41a2df){if(_0x41a2df){return db['sequelize'][_0xba66('0xa3')](function(_0x34e6c9){return db[_0xba66('0xa4')][_0xba66('0x35')]({'where':{'OpenchannelAccountId':_0x228000[_0xba66('0x56')]['id']},'transaction':_0x34e6c9})[_0xba66('0x22')](function(_0xd6b85e){var _0x265268=_[_0xba66('0x3d')](_0x228000[_0xba66('0x5d')],function(_0x43f0f0){_0x43f0f0['OpenchannelAccountId']=_0x228000[_0xba66('0x56')]['id'];return _0x43f0f0;});return db['OpenchannelApplication'][_0xba66('0xa5')](_0x265268,{'transaction':_0x34e6c9});});})['then'](function(){return db[_0xba66('0xa4')][_0xba66('0xa6')]({'where':{'OpenchannelAccountId':_0x228000[_0xba66('0x56')]['id']},'order':_0xba66('0x8a')});});}})[_0xba66('0x22')](respondWithResult(_0x41ac3b,null))[_0xba66('0x5b')](handleError(_0x41ac3b,null));};exports[_0xba66('0xa7')]=function(_0x1a62f9,_0xdb6dcb,_0x13dd05){var _0x30a036={};var _0x5e8267={};var _0x1eed39;var _0x26573b;return db[_0xba66('0x4f')][_0xba66('0x71')]({'where':{'id':_0x1a62f9[_0xba66('0x56')]['id']}})[_0xba66('0x22')](handleEntityNotFound(_0xdb6dcb,null))['then'](function(_0x3d2813){if(_0x3d2813){_0x1eed39=_0x3d2813;_0x5e8267[_0xba66('0x41')]=_['keys'](db[_0xba66('0xa4')][_0xba66('0x3e')]);_0x5e8267['query']=_[_0xba66('0x43')](_0x1a62f9['query']);_0x5e8267['filters']=_['intersection'](_0x5e8267[_0xba66('0x41')],_0x5e8267[_0xba66('0x42')]);_0x30a036[_0xba66('0x46')]=_['intersection'](_0x5e8267['model'],qs[_0xba66('0x47')](_0x1a62f9[_0xba66('0x42')][_0xba66('0x47')]));_0x30a036['attributes']=_0x30a036[_0xba66('0x46')]['length']?_0x30a036['attributes']:_0x5e8267[_0xba66('0x41')];_0x30a036[_0xba66('0x4a')]=qs[_0xba66('0x4b')](_0x1a62f9['query']['sort']);_0x30a036[_0xba66('0x4c')]=qs[_0xba66('0x44')](_[_0xba66('0xa8')](_0x1a62f9['query'],_0x5e8267[_0xba66('0x44')]));if(_0x1a62f9[_0xba66('0x42')][_0xba66('0x4d')]){_0x30a036[_0xba66('0x4c')]=_[_0xba66('0x59')](_0x30a036['where'],{'$or':_[_0xba66('0x3d')](_0x30a036[_0xba66('0x46')],function(_0x1c8e69){var _0x115b51={};_0x115b51[_0x1c8e69]={'$like':'%'+_0x1a62f9[_0xba66('0x42')]['filter']+'%'};return _0x115b51;})});}_0x30a036=_[_0xba66('0x59')]({},_0x30a036,_0x1a62f9[_0xba66('0x4e')]);return _0x1eed39[_0xba66('0xa7')](_0x30a036);}})[_0xba66('0x22')](function(_0x569a47){if(_0x569a47){_0x26573b=_0x569a47['length'];if(!_0x1a62f9[_0xba66('0x42')][_0xba66('0x48')]('nolimit')){_0x30a036['limit']=qs['limit'](_0x1a62f9[_0xba66('0x42')][_0xba66('0x31')]);_0x30a036[_0xba66('0x30')]=qs['offset'](_0x1a62f9['query']['offset']);}return _0x1eed39[_0xba66('0xa7')](_0x30a036);}})['then'](function(_0x3c578c){if(_0x3c578c){return _0x3c578c?{'count':_0x26573b,'rows':_0x3c578c}:null;}})['then'](respondWithResult(_0xdb6dcb,null))['catch'](handleError(_0xdb6dcb,null));};exports[_0xba66('0xa9')]=function(_0xce161,_0xd34cf,_0x165f1c){var _0x357eac={'raw':![],'where':{}};var _0x3f78e5={};var _0x288e9e={'count':0x0,'rows':[]};return db[_0xba66('0x4f')][_0xba66('0x71')]({'where':{'id':_0xce161[_0xba66('0x56')]['id']}})[_0xba66('0x22')](handleEntityNotFound(_0xd34cf,null))[_0xba66('0x22')](function(_0x27d63d){if(_0x27d63d){_0x3f78e5['model']=_[_0xba66('0x43')](db[_0xba66('0x90')]['rawAttributes']);_0x3f78e5[_0xba66('0x42')]=_[_0xba66('0x43')](_0xce161[_0xba66('0x42')]);_0x3f78e5[_0xba66('0x44')]=_[_0xba66('0x45')](_0x3f78e5[_0xba66('0x41')],_0x3f78e5[_0xba66('0x42')]);_0x357eac['attributes']=_[_0xba66('0x45')](_0x3f78e5[_0xba66('0x41')],qs[_0xba66('0x47')](_0xce161['query'][_0xba66('0x47')]));_0x357eac[_0xba66('0x46')]=_0x357eac[_0xba66('0x46')]['length']?_0x357eac[_0xba66('0x46')]:_0x3f78e5[_0xba66('0x41')];if(!_0xce161['query'][_0xba66('0x48')]('nolimit')){_0x357eac[_0xba66('0x31')]=qs[_0xba66('0x31')](_0xce161['query'][_0xba66('0x31')]);_0x357eac[_0xba66('0x30')]=qs[_0xba66('0x30')](_0xce161[_0xba66('0x42')][_0xba66('0x30')]);}_0x357eac[_0xba66('0x4a')]=qs[_0xba66('0x4b')](_0xce161[_0xba66('0x42')][_0xba66('0x4b')]);_0x357eac[_0xba66('0x4c')]=qs[_0xba66('0x44')](_[_0xba66('0xa8')](_0xce161[_0xba66('0x42')],_0x3f78e5[_0xba66('0x44')]));_0x357eac['where']['OpenchannelAccountId']=_0x27d63d['id'];if(_0xce161[_0xba66('0x42')][_0xba66('0x4d')]){_0x357eac[_0xba66('0x4c')]=_[_0xba66('0x59')](_0x357eac[_0xba66('0x4c')],{'$or':_[_0xba66('0x3d')](_0x357eac[_0xba66('0x46')],function(_0x28c493){var _0x258dbe={};_0x258dbe[_0x28c493]={'$like':'%'+_0xce161['query'][_0xba66('0x4d')]+'%'};return _0x258dbe;})});}_0x357eac=_[_0xba66('0x59')]({},_0x357eac,_0xce161[_0xba66('0x4e')]);return db[_0xba66('0x90')][_0xba66('0x50')]({'where':_0x357eac[_0xba66('0x4c')]})[_0xba66('0x22')](function(_0xfa0c46){_0x288e9e[_0xba66('0x50')]=_0xfa0c46;if(_0xce161[_0xba66('0x42')][_0xba66('0x51')]){_0x357eac[_0xba66('0x52')]=[{'model':db[_0xba66('0x84')],'as':_0xba66('0xaa'),'required':![]},{'model':db[_0xba66('0x9b')],'as':_0xba66('0xab'),'attributes':[_0xba66('0x39'),_0xba66('0xac'),_0xba66('0xad')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0xba66('0x39'),_0xba66('0xae')],'where':_0xce161[_0xba66('0x42')][_0xba66('0xaf')]?{'id':_0xce161[_0xba66('0x42')][_0xba66('0xaf')]}:undefined,'required':_0xce161[_0xba66('0x42')][_0xba66('0xaf')]?!![]:![]}];}return db['OpenchannelInteraction'][_0xba66('0x53')](_0x357eac);})['then'](function(_0xa6d337){_0x288e9e[_0xba66('0x54')]=_0xa6d337;return _0x288e9e;});}})[_0xba66('0x22')](respondWithFilteredResult(_0xd34cf,_0x357eac))['catch'](handleError(_0xd34cf,null));};exports[_0xba66('0xb0')]=function(_0xf6686,_0x762905,_0x165a60){return db[_0xba66('0x4f')][_0xba66('0x5a')]({'where':{'id':_0xf6686[_0xba66('0x56')]['id']}})[_0xba66('0x22')](handleEntityNotFound(_0x762905,null))[_0xba66('0x22')](function(_0x21f449){if(_0x21f449){return _0x21f449[_0xba66('0xb0')](_0xf6686[_0xba66('0x5d')][_0xba66('0x6d')],_[_0xba66('0xb1')](_0xf6686['body'],[_0xba66('0x6d'),'id'])||{})[_0xba66('0x92')](function(_0x23a7e9){for(var _0x3fad47=0x0;_0x3fad47<_0xf6686[_0xba66('0x5d')][_0xba66('0x6d')]['length'];_0x3fad47+=0x1){socket[_0xba66('0xb2')]('userOpenchannelAccount:save',{'UserId':_0xf6686[_0xba66('0x5d')][_0xba66('0x6d')][_0x3fad47],'OpenchannelAccountId':_0xf6686[_0xba66('0x56')]['id']});}return _0x23a7e9;});}})[_0xba66('0x22')](respondWithResult(_0x762905,null))['catch'](handleError(_0x762905,null));};exports[_0xba66('0xb3')]=function(_0x1f45c2,_0xed0981,_0x499238){return db[_0xba66('0x4f')][_0xba66('0x5a')]({'where':{'id':_0x1f45c2['params']['id']}})[_0xba66('0x22')](handleEntityNotFound(_0xed0981,null))[_0xba66('0x22')](function(_0xa6170b){if(_0xa6170b){return _0xa6170b[_0xba66('0xb3')](_0x1f45c2['query'][_0xba66('0x6d')])[_0xba66('0x22')](function(){if(_[_0xba66('0xb4')](_0x1f45c2['query'][_0xba66('0x6d')])){for(var _0x54fe54=0x0;_0x54fe54<_0x1f45c2[_0xba66('0x42')]['ids'][_0xba66('0x58')];_0x54fe54+=0x1){socket['emit'](_0xba66('0xb5'),{'UserId':Number(_0x1f45c2[_0xba66('0x42')][_0xba66('0x6d')][_0x54fe54]),'OpenchannelAccountId':Number(_0x1f45c2[_0xba66('0x56')]['id'])});}}else{socket['emit'](_0xba66('0xb5'),{'UserId':Number(_0x1f45c2[_0xba66('0x42')][_0xba66('0x6d')]),'OpenchannelAccountId':Number(_0x1f45c2[_0xba66('0x56')]['id'])});}});}})['then'](respondWithStatusCode(_0xed0981,null))['catch'](handleError(_0xed0981,null));};exports[_0xba66('0xb6')]=function(_0x1e3727,_0x48d037,_0x410f02){var _0x42affe={};var _0x274e4c={};var _0x120d91;var _0x13feba;return db[_0xba66('0x4f')][_0xba66('0x71')]({'where':{'id':_0x1e3727['params']['id']}})['then'](handleEntityNotFound(_0x48d037,null))[_0xba66('0x22')](function(_0x50190f){if(_0x50190f){_0x120d91=_0x50190f;_0x274e4c[_0xba66('0x41')]=_['keys'](db['User'][_0xba66('0x3e')]);_0x274e4c[_0xba66('0x42')]=_[_0xba66('0x43')](_0x1e3727[_0xba66('0x42')]);_0x274e4c[_0xba66('0x44')]=_[_0xba66('0x45')](_0x274e4c[_0xba66('0x41')],_0x274e4c[_0xba66('0x42')]);_0x42affe[_0xba66('0x46')]=_[_0xba66('0x45')](_0x274e4c['model'],qs[_0xba66('0x47')](_0x1e3727[_0xba66('0x42')][_0xba66('0x47')]));_0x42affe[_0xba66('0x46')]=_0x42affe['attributes'][_0xba66('0x58')]?_0x42affe[_0xba66('0x46')]:_0x274e4c[_0xba66('0x41')];_0x42affe[_0xba66('0x4a')]=qs[_0xba66('0x4b')](_0x1e3727[_0xba66('0x42')][_0xba66('0x4b')]);_0x42affe['where']=qs[_0xba66('0x44')](_[_0xba66('0xa8')](_0x1e3727[_0xba66('0x42')],_0x274e4c[_0xba66('0x44')]));if(_0x1e3727[_0xba66('0x42')][_0xba66('0x4d')]){_0x42affe[_0xba66('0x4c')]=_[_0xba66('0x59')](_0x42affe['where'],{'$or':_[_0xba66('0x3d')](_0x42affe[_0xba66('0x46')],function(_0x1a6221){var _0x5a7384={};_0x5a7384[_0x1a6221]={'$like':'%'+_0x1e3727[_0xba66('0x42')][_0xba66('0x4d')]+'%'};return _0x5a7384;})});}_0x42affe=_[_0xba66('0x59')]({},_0x42affe,_0x1e3727['options']);return _0x120d91['getAgents'](_0x42affe);}})[_0xba66('0x22')](function(_0x4dc0c2){if(_0x4dc0c2){_0x13feba=_0x4dc0c2[_0xba66('0x58')];if(!_0x1e3727[_0xba66('0x42')][_0xba66('0x48')](_0xba66('0x49'))){_0x42affe[_0xba66('0x31')]=qs['limit'](_0x1e3727[_0xba66('0x42')]['limit']);_0x42affe[_0xba66('0x30')]=qs[_0xba66('0x30')](_0x1e3727[_0xba66('0x42')][_0xba66('0x30')]);}return _0x120d91[_0xba66('0xb6')](_0x42affe);}})[_0xba66('0x22')](function(_0x35acbd){if(_0x35acbd){return _0x35acbd?{'count':_0x13feba,'rows':_0x35acbd}:null;}})[_0xba66('0x22')](respondWithResult(_0x48d037,null))[_0xba66('0x5b')](handleError(_0x48d037,null));};exports[_0xba66('0x3a')]=function(_0x75caae,_0x3ec78c,_0x4d8029){var _0x5597b4,_0x5d2572,_0x42907e;if(_[_0xba66('0x7a')](_0x75caae[_0xba66('0x5d')][_0xba66('0x5d')])||_0x75caae[_0xba66('0x5d')][_0xba66('0x5d')]===''){throw new db[(_0xba66('0x1f'))][(_0xba66('0x20'))](_0xba66('0x7d'));}if(_[_0xba66('0x7a')](_0x75caae[_0xba66('0x5d')]['to'])){}_0x5597b4=_0x75caae[_0xba66('0x5d')]['to'];return db[_0xba66('0x4f')][_0xba66('0x71')]({'where':{'id':_0x75caae[_0xba66('0x56')]['id']}})[_0xba66('0x22')](handleEntityNotFound(_0x3ec78c,null))[_0xba66('0x22')](function(_0x331381){if(_0x331381){return db['OpenchannelAccount'][_0xba66('0x5a')]({'where':{'id':_0x331381['id']},'include':[{'model':db[_0xba66('0x82')],'as':_0xba66('0x83'),'include':[{'model':db[_0xba66('0x84')],'as':_0xba66('0x85'),'where':{[_0x331381[_0xba66('0x7e')]]:_0x5597b4},'limit':0x1,'order':[[_0xba66('0x77'),_0xba66('0xb7')]]}]}]})[_0xba66('0x22')](handleEntityNotFound(_0x3ec78c,null))[_0xba66('0x22')](function(_0x1dfc46){if(_0x1dfc46&&_0x1dfc46[_0xba66('0x83')]){_0x5d2572=_0x1dfc46[_0xba66('0x36')]({'plain':!![]});if(_0x5d2572[_0xba66('0x83')]&&_0x5d2572[_0xba66('0x83')][_0xba66('0x85')]['length']){return _0x5d2572[_0xba66('0x83')][_0xba66('0x85')][0x0];}return db[_0xba66('0x84')][_0xba66('0x5c')](_[_0xba66('0x8d')](_0x75caae[_0xba66('0x5d')],{'firstName':_0x5597b4,[_0x1dfc46['mapKey']]:_0x5597b4,'phone':_0x5597b4,'ListId':_0x5d2572[_0xba66('0x79')]}));}})[_0xba66('0x22')](handleEntityNotFound(_0x3ec78c,null))['then'](function(_0x50c3d6){if(_0x50c3d6){_0x42907e=_0x50c3d6;return db['OpenchannelInteraction']['find']({'where':{'ContactId':_0x42907e['id'],'closed':![],'OpenchannelAccountId':_0x5d2572['id']}})[_0xba66('0x22')](function(_0x3ef720){if(_0x3ef720){return[_0x3ef720,![]];}return db[_0xba66('0x90')]['create']({'UserId':_0x75caae[_0xba66('0x60')]['id'],'ContactId':_0x42907e['id'],'OpenchannelAccountId':_0x5d2572['id'],'lastMsgDirection':_0xba66('0xb8'),'Messages':[_[_0xba66('0x59')](_0x75caae[_0xba66('0x5d')],{'read':![],'body':_0x75caae[_0xba66('0x5d')]['body'],'OpenchannelAccountId':_0x5d2572['id'],'UserId':_0x75caae[_0xba66('0x60')]['id'],'ContactId':_0x42907e['id']})]},{'include':[{'model':db[_0xba66('0xb9')],'as':_0xba66('0xba')}]})[_0xba66('0x22')](function(_0x46660c){return[_0x46660c,!![]];});});}})[_0xba66('0x92')](function(_0x5e4d85,_0x27aa8e){if(_0x27aa8e){return _0x5e4d85;}return db[_0xba66('0xb9')]['create'](_[_0xba66('0x59')](_0x75caae[_0xba66('0x5d')],{'read':![],'body':_0x75caae['body']['body'],'OpenchannelAccountId':_0x5d2572['id'],'OpenchannelInteractionId':_0x5e4d85['id'],'UserId':_0x75caae[_0xba66('0x60')]['id'],'ContactId':_0x42907e['id']}))[_0xba66('0x22')](function(_0x11d5cd){_0x5e4d85[_0xba66('0xbb')][_0xba66('0xba')]=[];_0x5e4d85[_0xba66('0xbb')][_0xba66('0xba')][_0xba66('0xbc')](_0x11d5cd['dataValues']);return _0x5e4d85;});});}})[_0xba66('0x22')](respondWithResult(_0x3ec78c,null))[_0xba66('0x5b')](handleError(_0x3ec78c,null));}; \ No newline at end of file +var _0x7363=['rows','show','params','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','OpnechannelAccountId','Disposition','getDispositions','findOne','OpenchannelAccountId','includeAll','include','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','OpenchannelApplication','Applications','account','applications','orderBy','priority','asc','List','contact','firstName','lastName','threadId','externalUrl','ContactId','OpenchannelInteraction','spread','messageId','interaction','created','autoclose','push','close','*,*,*,*','AttachmentId','UserId','agent','waitForTheAssignedAgent','forcedOwnership','Start','EventManager','sequelize','transaction','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','User','fullname','internal','Tag','Tags','color','tag','addAgents','omit','emit','removeAgents','userOpenchannelAccount:remove','getAgents','OpenchannelMessage','Messages','dataValues','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','http','test','ValidationError','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','result','catch','sendStatus','status','end','json','count','offset','apply','reject','save','update','then','destroy','get','OpenchannelAccounts','stack','name','send','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','options','findAll'];(function(_0x2b7b6e,_0x4b8dc9){var _0x2c41cf=function(_0x330b70){while(--_0x330b70){_0x2b7b6e['push'](_0x2b7b6e['shift']());}};_0x2c41cf(++_0x4b8dc9);}(_0x7363,0x122));var _0x3736=function(_0x2c8efe,_0x469b2c){_0x2c8efe=_0x2c8efe-0x0;var _0x55378f=_0x7363[_0x2c8efe];return _0x55378f;};'use strict';var pdf=require(_0x3736('0x0'));var emlformat=require(_0x3736('0x1'));var rimraf=require(_0x3736('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3736('0x3'));var rp=require(_0x3736('0x4'));var moment=require(_0x3736('0x5'));var BPromise=require(_0x3736('0x6'));var Mustache=require('mustache');var util=require(_0x3736('0x7'));var path=require(_0x3736('0x8'));var sox=require(_0x3736('0x9'));var csv=require(_0x3736('0xa'));var ejs=require(_0x3736('0xb'));var fs=require('fs');var _=require(_0x3736('0xc'));var squel=require('squel');var crypto=require(_0x3736('0xd'));var jsforce=require(_0x3736('0xe'));var deskjs=require(_0x3736('0xf'));var toCsv=require('to-csv');var querystring=require(_0x3736('0x10'));var Papa=require(_0x3736('0x11'));var Redis=require(_0x3736('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x3736('0x13'));var as=require(_0x3736('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3736('0x15'))(_0x3736('0x16'));var utils=require(_0x3736('0x17'));var config=require(_0x3736('0x18'));var db=require('../../mysqldb')['db'];config[_0x3736('0x19')]=_[_0x3736('0x1a')](config[_0x3736('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x3736('0x1b'))(new Redis(config[_0x3736('0x19')]));require(_0x3736('0x1c'))[_0x3736('0x1d')](socket);var jayson=require(_0x3736('0x1e'));var client=jayson[_0x3736('0x1f')][_0x3736('0x20')]({'port':0x232c});var client9002=jayson['client'][_0x3736('0x20')]({'port':0x232a});function checkPasswordPattern(_0x5916a8,_0x30df40,_0x36d070){if(_0x36d070){var _0x18326c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x18326c[_0x3736('0x21')](_0x30df40)){return _0x5916a8;}else{throw new db['Sequelize'][(_0x3736('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 _0x5916a8;}}function respondWithRpcPromise(_0x52ef7b,_0x4ba50b,_0x32cbda,_0x1fc110){return new BPromise(function(_0x3c9b98,_0x196c7c){var _0xa23e53=_0x1fc110||client;return _0xa23e53['request'](_0x52ef7b,_0x32cbda)['then'](function(_0xdbea0c){logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x4ba50b,'request\x20sent');logger['debug'](_0x3736('0x23'),_0x4ba50b,'request\x20sent',JSON[_0x3736('0x24')](_0xdbea0c));if(_0xdbea0c[_0x3736('0x25')]){if(_0xdbea0c[_0x3736('0x25')][_0x3736('0x26')]===0x1f4){logger[_0x3736('0x25')]('OpenchannelAccount,\x20%s,\x20%s',_0x4ba50b,_0xdbea0c['error'][_0x3736('0x27')]);return _0x196c7c(_0xdbea0c[_0x3736('0x25')]['message']);}logger[_0x3736('0x25')](_0x3736('0x28'),_0x4ba50b,_0xdbea0c[_0x3736('0x25')][_0x3736('0x27')]);return _0x3c9b98(_0xdbea0c[_0x3736('0x25')][_0x3736('0x27')]);}else{logger['info'](_0x3736('0x28'),_0x4ba50b,_0x3736('0x29'));_0x3c9b98(_0xdbea0c[_0x3736('0x2a')][_0x3736('0x27')]);}})[_0x3736('0x2b')](function(_0x14af48){logger[_0x3736('0x25')](_0x3736('0x28'),_0x4ba50b,_0x14af48);_0x196c7c(_0x14af48);});});}function respondWithStatusCode(_0x5cf734,_0x1d7090){_0x1d7090=_0x1d7090||0xcc;return function(_0x2bd1eb){if(_0x2bd1eb){return _0x5cf734[_0x3736('0x2c')](_0x1d7090);}return _0x5cf734[_0x3736('0x2d')](_0x1d7090)[_0x3736('0x2e')]();};}function respondWithResult(_0x10837c,_0x3228ae){_0x3228ae=_0x3228ae||0xc8;return function(_0x432c0f){if(_0x432c0f){return _0x10837c['status'](_0x3228ae)[_0x3736('0x2f')](_0x432c0f);}};}function respondWithFilteredResult(_0x3cd161,_0x480167){return function(_0x21eba4){if(_0x21eba4){var _0x2938fd=_0x21eba4[_0x3736('0x30')],_0x220a39=_0x480167[_0x3736('0x31')],_0x16df55=_0x480167['offset']+_0x480167['limit'],_0x20a66d;if(_0x16df55>=_0x2938fd){_0x16df55=_0x2938fd;_0x20a66d=0xc8;}else{_0x20a66d=0xce;}_0x3cd161[_0x3736('0x2d')](_0x20a66d);return _0x3cd161['set']('Content-Range',_0x220a39+'-'+_0x16df55+'/'+_0x2938fd)[_0x3736('0x2f')](_0x21eba4);}return null;};}function patchUpdates(_0xcc2a6e){return function(_0x1e583a){try{jsonpatch[_0x3736('0x32')](_0x1e583a,_0xcc2a6e,!![]);}catch(_0x44540e){return BPromise[_0x3736('0x33')](_0x44540e);}return _0x1e583a[_0x3736('0x34')]();};}function saveUpdates(_0xcaaea,_0x4fd178){return function(_0x387d07){if(_0x387d07){return _0x387d07[_0x3736('0x35')](_0xcaaea)[_0x3736('0x36')](function(_0x17f446){return _0x17f446;});}return null;};}function removeEntity(_0x13d200,_0x2baa43){return function(_0x5bd6c5){if(_0x5bd6c5){return _0x5bd6c5[_0x3736('0x37')]()[_0x3736('0x36')](function(){var _0x18bb04=_0x5bd6c5[_0x3736('0x38')]({'plain':!![]});var _0x544e25=_0x3736('0x39');return db['UserProfileResource'][_0x3736('0x37')]({'where':{'type':_0x544e25,'resourceId':_0x18bb04['id']}})[_0x3736('0x36')](function(){return _0x5bd6c5;});})[_0x3736('0x36')](function(){_0x13d200[_0x3736('0x2d')](0xcc)[_0x3736('0x2e')]();});}};}function handleEntityNotFound(_0xeb2eb4,_0x2b1d8c){return function(_0xd5a9eb){if(!_0xd5a9eb){_0xeb2eb4[_0x3736('0x2c')](0x194);}return _0xd5a9eb;};}function handleError(_0x5c5a25,_0x49151a){_0x49151a=_0x49151a||0x1f4;return function(_0x2dd0da){logger['error'](_0x2dd0da[_0x3736('0x3a')]);if(_0x2dd0da['name']){delete _0x2dd0da[_0x3736('0x3b')];}_0x5c5a25[_0x3736('0x2d')](_0x49151a)[_0x3736('0x3c')](_0x2dd0da);};}exports[_0x3736('0x3d')]=function(_0x31316e,_0x35301d){var _0x4daf62={'include':[{'model':db[_0x3736('0x3e')],'as':_0x3736('0x3f')}]},_0x19afc9={},_0x344a37={'count':0x0,'rows':[]};var _0x33a26f=_[_0x3736('0x40')](db[_0x3736('0x41')][_0x3736('0x42')],function(_0x243833){return{'name':_0x243833[_0x3736('0x43')],'type':_0x243833[_0x3736('0x44')][_0x3736('0x45')]};});_0x19afc9[_0x3736('0x46')]=_[_0x3736('0x40')](_0x33a26f,_0x3736('0x3b'));_0x19afc9[_0x3736('0x47')]=_[_0x3736('0x48')](_0x31316e[_0x3736('0x47')]);_0x19afc9[_0x3736('0x49')]=_[_0x3736('0x4a')](_0x19afc9[_0x3736('0x46')],_0x19afc9['query']);_0x4daf62['attributes']=_[_0x3736('0x4a')](_0x19afc9[_0x3736('0x46')],qs[_0x3736('0x4b')](_0x31316e[_0x3736('0x47')][_0x3736('0x4b')]));_0x4daf62[_0x3736('0x4c')]=_0x4daf62[_0x3736('0x4c')][_0x3736('0x4d')]?_0x4daf62['attributes']:_0x19afc9[_0x3736('0x46')];if(!_0x31316e[_0x3736('0x47')][_0x3736('0x4e')](_0x3736('0x4f'))){_0x4daf62[_0x3736('0x50')]=qs[_0x3736('0x50')](_0x31316e[_0x3736('0x47')][_0x3736('0x50')]);_0x4daf62[_0x3736('0x31')]=qs['offset'](_0x31316e[_0x3736('0x47')][_0x3736('0x31')]);}_0x4daf62[_0x3736('0x51')]=qs[_0x3736('0x52')](_0x31316e[_0x3736('0x47')][_0x3736('0x52')]);_0x4daf62['where']=qs[_0x3736('0x49')](_[_0x3736('0x53')](_0x31316e[_0x3736('0x47')],_0x19afc9[_0x3736('0x49')]));if(_0x31316e['query'][_0x3736('0x54')]){_0x4daf62[_0x3736('0x55')]=_[_0x3736('0x56')](_0x4daf62[_0x3736('0x55')],{'$or':_[_0x3736('0x40')](_0x33a26f,function(_0xb4580a){if(_0xb4580a[_0x3736('0x44')]!==_0x3736('0x57')){var _0x367c0d={};_0x367c0d[_0xb4580a[_0x3736('0x3b')]]={'$like':'%'+_0x31316e[_0x3736('0x47')][_0x3736('0x54')]+'%'};return _0x367c0d;}})});}_0x4daf62=_['merge']({},_0x4daf62,_0x31316e[_0x3736('0x58')]);var _0x133e76={'where':_0x4daf62[_0x3736('0x55')]};return db['OpenchannelAccount'][_0x3736('0x30')](_0x133e76)[_0x3736('0x36')](function(_0xddec71){_0x344a37[_0x3736('0x30')]=_0xddec71;if(_0x31316e[_0x3736('0x47')]['includeAll']){_0x4daf62['include']=[{'all':!![]}];}return db[_0x3736('0x41')][_0x3736('0x59')](_0x4daf62);})[_0x3736('0x36')](function(_0x29e6fe){_0x344a37[_0x3736('0x5a')]=_0x29e6fe;return _0x344a37;})[_0x3736('0x36')](respondWithFilteredResult(_0x35301d,_0x4daf62))[_0x3736('0x2b')](handleError(_0x35301d,null));};exports[_0x3736('0x5b')]=function(_0x11521e,_0x28fe5f){var _0x3d87d9={'raw':![],'where':{'id':_0x11521e[_0x3736('0x5c')]['id']},'include':[{'model':db[_0x3736('0x3e')],'as':'mandatoryDispositionPause'}]},_0x2ce4f0={};_0x2ce4f0[_0x3736('0x46')]=_[_0x3736('0x48')](db[_0x3736('0x41')]['rawAttributes']);_0x2ce4f0[_0x3736('0x47')]=_[_0x3736('0x48')](_0x11521e[_0x3736('0x47')]);_0x2ce4f0['filters']=_['intersection'](_0x2ce4f0[_0x3736('0x46')],_0x2ce4f0[_0x3736('0x47')]);_0x3d87d9[_0x3736('0x4c')]=_[_0x3736('0x4a')](_0x2ce4f0['model'],qs[_0x3736('0x4b')](_0x11521e[_0x3736('0x47')]['fields']));_0x3d87d9[_0x3736('0x4c')]=_0x3d87d9[_0x3736('0x4c')][_0x3736('0x4d')]?_0x3d87d9[_0x3736('0x4c')]:_0x2ce4f0[_0x3736('0x46')];if(_0x11521e[_0x3736('0x47')]['includeAll']){_0x3d87d9['include']=[{'all':!![]}];}_0x3d87d9=_[_0x3736('0x56')]({},_0x3d87d9,_0x11521e[_0x3736('0x58')]);return db[_0x3736('0x41')]['find'](_0x3d87d9)[_0x3736('0x36')](handleEntityNotFound(_0x28fe5f,null))['then'](respondWithResult(_0x28fe5f,null))[_0x3736('0x2b')](handleError(_0x28fe5f,null));};exports[_0x3736('0x5d')]=function(_0x170ad0,_0x3a0afc){return db['OpenchannelAccount'][_0x3736('0x5d')](_0x170ad0['body'],{})[_0x3736('0x36')](function(_0x2b7a4e){var _0x2cd0aa=_0x170ad0[_0x3736('0x5e')][_0x3736('0x38')]({'plain':!![]});if(!_0x2cd0aa)throw new Error(_0x3736('0x5f'));if(_0x2cd0aa[_0x3736('0x60')]===_0x3736('0x5e')){var _0x8db2d4=_0x2b7a4e[_0x3736('0x38')]({'plain':!![]});var _0x30a2eb=_0x3736('0x39');return db[_0x3736('0x61')][_0x3736('0x62')]({'where':{'name':_0x30a2eb,'userProfileId':_0x2cd0aa[_0x3736('0x63')]},'raw':!![]})[_0x3736('0x36')](function(_0x2a6b10){if(_0x2a6b10&&_0x2a6b10[_0x3736('0x64')]===0x0){return db['UserProfileResource'][_0x3736('0x5d')]({'name':_0x8db2d4[_0x3736('0x3b')],'resourceId':_0x8db2d4['id'],'type':_0x2a6b10['name'],'sectionId':_0x2a6b10['id']},{})['then'](function(){return _0x2b7a4e;});}else{return _0x2b7a4e;}})['catch'](function(_0x13bdb9){logger[_0x3736('0x25')](_0x3736('0x65'),_0x13bdb9);throw _0x13bdb9;});}return _0x2b7a4e;})[_0x3736('0x36')](respondWithResult(_0x3a0afc,0xc9))['catch'](handleError(_0x3a0afc,null));};exports[_0x3736('0x35')]=function(_0x4e879e,_0x1a61e7){if(_0x4e879e[_0x3736('0x66')]['id']){delete _0x4e879e['body']['id'];}return db[_0x3736('0x41')][_0x3736('0x62')]({'where':{'id':_0x4e879e['params']['id']},'include':[{'model':db['Pause'],'as':_0x3736('0x3f')}]})['then'](handleEntityNotFound(_0x1a61e7,null))[_0x3736('0x36')](saveUpdates(_0x4e879e['body'],null))[_0x3736('0x36')](respondWithResult(_0x1a61e7,null))[_0x3736('0x2b')](handleError(_0x1a61e7,null));};exports[_0x3736('0x37')]=function(_0x5cd0e9,_0x3c0091){return db[_0x3736('0x41')][_0x3736('0x62')]({'where':{'id':_0x5cd0e9['params']['id']}})[_0x3736('0x36')](handleEntityNotFound(_0x3c0091,null))[_0x3736('0x36')](removeEntity(_0x3c0091,null))[_0x3736('0x2b')](handleError(_0x3c0091,null));};exports[_0x3736('0x67')]=function(_0x1e49d6,_0x1eccd1){return db['OpenchannelAccount']['describe']()['then'](respondWithResult(_0x1eccd1,null))[_0x3736('0x2b')](handleError(_0x1eccd1,null));};exports[_0x3736('0x68')]=function(_0x5647db,_0x5182a5,_0x264bea){if(_0x5647db[_0x3736('0x66')]['id']){delete _0x5647db[_0x3736('0x66')]['id'];}return db[_0x3736('0x41')][_0x3736('0x62')]({'where':{'id':_0x5647db[_0x3736('0x5c')]['id']}})[_0x3736('0x36')](handleEntityNotFound(_0x5182a5,null))[_0x3736('0x36')](function(_0x102add){if(_0x102add){_0x5647db[_0x3736('0x66')][_0x3736('0x69')]=_0x102add['id'];return db[_0x3736('0x6a')][_0x3736('0x5d')](_0x5647db['body']);}})[_0x3736('0x36')](respondWithResult(_0x5182a5,null))[_0x3736('0x2b')](handleError(_0x5182a5,null));};exports[_0x3736('0x6b')]=function(_0x35f08d,_0x87ac0f,_0x30b0eb){var _0x9a9213={'raw':![],'where':{}};var _0x48407a={};var _0xdba42a={'count':0x0,'rows':[]};return db[_0x3736('0x41')][_0x3736('0x6c')]({'where':{'id':_0x35f08d[_0x3736('0x5c')]['id']}})[_0x3736('0x36')](handleEntityNotFound(_0x87ac0f,null))[_0x3736('0x36')](function(_0x1135de){if(_0x1135de){_0x48407a[_0x3736('0x46')]=_[_0x3736('0x48')](db['Disposition'][_0x3736('0x42')]);_0x48407a[_0x3736('0x47')]=_[_0x3736('0x48')](_0x35f08d[_0x3736('0x47')]);_0x48407a['filters']=_[_0x3736('0x4a')](_0x48407a[_0x3736('0x46')],_0x48407a[_0x3736('0x47')]);_0x9a9213[_0x3736('0x4c')]=_[_0x3736('0x4a')](_0x48407a[_0x3736('0x46')],qs[_0x3736('0x4b')](_0x35f08d[_0x3736('0x47')][_0x3736('0x4b')]));_0x9a9213['attributes']=_0x9a9213[_0x3736('0x4c')][_0x3736('0x4d')]?_0x9a9213[_0x3736('0x4c')]:_0x48407a['model'];if(!_0x35f08d[_0x3736('0x47')][_0x3736('0x4e')]('nolimit')){_0x9a9213[_0x3736('0x50')]=qs[_0x3736('0x50')](_0x35f08d[_0x3736('0x47')][_0x3736('0x50')]);_0x9a9213[_0x3736('0x31')]=qs[_0x3736('0x31')](_0x35f08d[_0x3736('0x47')]['offset']);}_0x9a9213['order']=qs[_0x3736('0x52')](_0x35f08d[_0x3736('0x47')][_0x3736('0x52')]);_0x9a9213['where']=qs[_0x3736('0x49')](_['pick'](_0x35f08d[_0x3736('0x47')],_0x48407a[_0x3736('0x49')]));_0x9a9213[_0x3736('0x55')][_0x3736('0x6d')]=_0x1135de['id'];if(_0x35f08d[_0x3736('0x47')][_0x3736('0x54')]){_0x9a9213[_0x3736('0x55')]=_[_0x3736('0x56')](_0x9a9213['where'],{'$or':_[_0x3736('0x40')](_0x9a9213[_0x3736('0x4c')],function(_0x1b2c6a){var _0xba9f1a={};_0xba9f1a[_0x1b2c6a]={'$like':'%'+_0x35f08d[_0x3736('0x47')][_0x3736('0x54')]+'%'};return _0xba9f1a;})});}_0x9a9213=_[_0x3736('0x56')]({},_0x9a9213,_0x35f08d[_0x3736('0x58')]);return db['Disposition'][_0x3736('0x30')]({'where':_0x9a9213[_0x3736('0x55')]})['then'](function(_0x24d181){_0xdba42a[_0x3736('0x30')]=_0x24d181;if(_0x35f08d['query'][_0x3736('0x6e')]){_0x9a9213[_0x3736('0x6f')]=[{'all':!![]}];}return db[_0x3736('0x6a')][_0x3736('0x59')](_0x9a9213);})[_0x3736('0x36')](function(_0x4a2da2){_0xdba42a[_0x3736('0x5a')]=_0x4a2da2;return _0xdba42a;});}})[_0x3736('0x36')](respondWithFilteredResult(_0x87ac0f,_0x9a9213))[_0x3736('0x2b')](handleError(_0x87ac0f,null));};exports[_0x3736('0x70')]=function(_0x5896d0,_0x8c24f1,_0x314f85){return db['OpenchannelAccount'][_0x3736('0x62')]({'where':{'id':_0x5896d0[_0x3736('0x5c')]['id']}})[_0x3736('0x36')](handleEntityNotFound(_0x8c24f1,null))[_0x3736('0x36')](function(_0x375062){if(_0x375062){return _0x375062[_0x3736('0x70')](_0x5896d0[_0x3736('0x47')][_0x3736('0x71')]);}})['then'](respondWithStatusCode(_0x8c24f1,null))[_0x3736('0x2b')](handleError(_0x8c24f1,null));};exports[_0x3736('0x72')]=function(_0x1cd8eb,_0x458f47,_0x17dc78){if(_0x1cd8eb[_0x3736('0x66')]['id']){delete _0x1cd8eb[_0x3736('0x66')]['id'];}return db[_0x3736('0x41')]['find']({'where':{'id':_0x1cd8eb[_0x3736('0x5c')]['id']}})['then'](handleEntityNotFound(_0x458f47,null))[_0x3736('0x36')](function(_0x220c55){if(_0x220c55){_0x1cd8eb['body'][_0x3736('0x6d')]=_0x220c55['id'];return db[_0x3736('0x73')][_0x3736('0x5d')](_0x1cd8eb[_0x3736('0x66')]);}})[_0x3736('0x36')](respondWithResult(_0x458f47,null))[_0x3736('0x2b')](handleError(_0x458f47,null));};exports[_0x3736('0x74')]=function(_0x4afe5d,_0x297141,_0x3d4232){var _0x10902e={'raw':![],'where':{}};var _0x19e674={};var _0x332dfb={'count':0x0,'rows':[]};return db[_0x3736('0x41')][_0x3736('0x6c')]({'where':{'id':_0x4afe5d[_0x3736('0x5c')]['id']}})[_0x3736('0x36')](handleEntityNotFound(_0x297141,null))[_0x3736('0x36')](function(_0x5282ee){if(_0x5282ee){_0x19e674[_0x3736('0x46')]=_['keys'](db[_0x3736('0x73')][_0x3736('0x42')]);_0x19e674['query']=_[_0x3736('0x48')](_0x4afe5d[_0x3736('0x47')]);_0x19e674[_0x3736('0x49')]=_[_0x3736('0x4a')](_0x19e674['model'],_0x19e674['query']);_0x10902e['attributes']=_[_0x3736('0x4a')](_0x19e674['model'],qs[_0x3736('0x4b')](_0x4afe5d['query'][_0x3736('0x4b')]));_0x10902e[_0x3736('0x4c')]=_0x10902e[_0x3736('0x4c')]['length']?_0x10902e['attributes']:_0x19e674['model'];if(!_0x4afe5d[_0x3736('0x47')]['hasOwnProperty'](_0x3736('0x4f'))){_0x10902e[_0x3736('0x50')]=qs[_0x3736('0x50')](_0x4afe5d[_0x3736('0x47')][_0x3736('0x50')]);_0x10902e[_0x3736('0x31')]=qs[_0x3736('0x31')](_0x4afe5d[_0x3736('0x47')][_0x3736('0x31')]);}_0x10902e[_0x3736('0x51')]=qs[_0x3736('0x52')](_0x4afe5d[_0x3736('0x47')][_0x3736('0x52')]);_0x10902e[_0x3736('0x55')]=qs[_0x3736('0x49')](_[_0x3736('0x53')](_0x4afe5d[_0x3736('0x47')],_0x19e674['filters']));_0x10902e[_0x3736('0x55')][_0x3736('0x6d')]=_0x5282ee['id'];if(_0x4afe5d[_0x3736('0x47')][_0x3736('0x54')]){_0x10902e[_0x3736('0x55')]=_[_0x3736('0x56')](_0x10902e[_0x3736('0x55')],{'$or':_[_0x3736('0x40')](_0x10902e[_0x3736('0x4c')],function(_0x5338d1){var _0x1ff1eb={};_0x1ff1eb[_0x5338d1]={'$like':'%'+_0x4afe5d['query'][_0x3736('0x54')]+'%'};return _0x1ff1eb;})});}_0x10902e=_['merge']({},_0x10902e,_0x4afe5d[_0x3736('0x58')]);return db[_0x3736('0x73')][_0x3736('0x30')]({'where':_0x10902e[_0x3736('0x55')]})[_0x3736('0x36')](function(_0x54cb00){_0x332dfb[_0x3736('0x30')]=_0x54cb00;if(_0x4afe5d[_0x3736('0x47')]['includeAll']){_0x10902e[_0x3736('0x6f')]=[{'all':!![]}];}return db[_0x3736('0x73')][_0x3736('0x59')](_0x10902e);})['then'](function(_0x53846a){_0x332dfb[_0x3736('0x5a')]=_0x53846a;return _0x332dfb;});}})[_0x3736('0x36')](respondWithFilteredResult(_0x297141,_0x10902e))[_0x3736('0x2b')](handleError(_0x297141,null));};exports[_0x3736('0x75')]=function(_0x517bc6,_0x4d0594,_0x1b883f){return db[_0x3736('0x41')][_0x3736('0x62')]({'where':{'id':_0x517bc6['params']['id']}})[_0x3736('0x36')](handleEntityNotFound(_0x4d0594,null))['then'](function(_0x15f829){if(_0x15f829){return _0x15f829[_0x3736('0x75')](_0x517bc6[_0x3736('0x47')][_0x3736('0x71')]);}})['then'](respondWithStatusCode(_0x4d0594,null))[_0x3736('0x2b')](handleError(_0x4d0594,null));};exports[_0x3736('0x76')]=function(_0xc039d2,_0x28d3d6,_0xeaf273){var _0x27f9fa={'body':_0xc039d2['body'],'channel':'openchannel'};var _0x34732f=[];var _0x4baf2e=[];var _0x511648={};var _0x18b4b7=![];return db[_0x3736('0x77')]['describe']()['then'](function(_0x9f6ee4){if(!_0x9f6ee4){throw new db[(_0x3736('0x78'))][(_0x3736('0x22'))](_0x3736('0x79'));}_0x34732f=_[_0x3736('0x7a')](_['keys'](_0x9f6ee4),[_0x3736('0x7b'),_0x3736('0x7c')]);_0x4baf2e=_[_0x3736('0x7a')](_['keys'](_0x9f6ee4),[_0x3736('0x7b'),_0x3736('0x7c'),'CompanyId',_0x3736('0x7d')]);if(_0xc039d2[_0x3736('0x66')]['id']){delete _0xc039d2[_0x3736('0x66')]['id'];}if(_[_0x3736('0x7e')](_0xc039d2['body'][_0x3736('0x7f')])){throw new db[(_0x3736('0x78'))][(_0x3736('0x22'))](_0x3736('0x80'));}if(_[_0x3736('0x7e')](_0xc039d2[_0x3736('0x66')][_0x3736('0x66')])||_0xc039d2[_0x3736('0x66')][_0x3736('0x66')]===''){throw new db[(_0x3736('0x78'))][(_0x3736('0x22'))](_0x3736('0x81'));}if(_[_0x3736('0x7e')](_0xc039d2['body'][_0x3736('0x82')])){throw new db[(_0x3736('0x78'))]['ValidationError'](_0x3736('0x83')+_0x4baf2e);}if(!_[_0x3736('0x84')](_0x4baf2e,_0xc039d2[_0x3736('0x66')][_0x3736('0x82')])){throw new db[(_0x3736('0x78'))]['ValidationError'](_0x3736('0x85')+_0x4baf2e);}_0x511648[_0xc039d2[_0x3736('0x66')][_0x3736('0x82')]]=_0xc039d2['body'][_0x3736('0x7f')];})[_0x3736('0x36')](function(){return db[_0x3736('0x41')]['find']({'where':{'id':_0xc039d2['params']['id']},'include':[{'model':db[_0x3736('0x86')],'as':'List','include':[{'model':db['CmContact'],'as':_0x3736('0x87'),'where':_0x511648,'limit':0x1,'order':[['updatedAt',_0x3736('0x88')]]}]},{'model':db[_0x3736('0x89')],'as':_0x3736('0x8a')}]});})['then'](handleEntityNotFound(_0x28d3d6,null))['then'](function(_0x483244){if(_0x483244&&_0x483244['List']){_0x27f9fa[_0x3736('0x8b')]=_0x483244;_0x27f9fa[_0x3736('0x8c')]=_0x483244['Applications'];_0x27f9fa['list']=_0x483244['List'];_0x27f9fa[_0x3736('0x8c')]=_[_0x3736('0x8d')](_0x27f9fa[_0x3736('0x8c')],[_0x3736('0x8e')],[_0x3736('0x8f')]);if(_0x27f9fa[_0x3736('0x8b')]['Applications']){delete _0x27f9fa['account']['Applications'];}if(_0x27f9fa[_0x3736('0x8b')][_0x3736('0x90')]&&_0x27f9fa[_0x3736('0x8b')][_0x3736('0x90')][_0x3736('0x87')][_0x3736('0x4d')]){return _0x27f9fa[_0x3736('0x8b')]['List'][_0x3736('0x87')][0x0];}var _0x151ac6=_[_0x3736('0x1a')](_0xc039d2[_0x3736('0x66')],{'firstName':_0xc039d2[_0x3736('0x66')][_0x3736('0x7f')],'ListId':_0x483244['ListId']});_0x151ac6[_0xc039d2[_0x3736('0x66')][_0x3736('0x82')]]=_0xc039d2[_0x3736('0x66')][_0x3736('0x7f')];return db[_0x3736('0x77')][_0x3736('0x5d')](_0x151ac6,{'fields':_0x34732f,'raw':!![]});}})[_0x3736('0x36')](handleEntityNotFound(_0x28d3d6,null))[_0x3736('0x36')](function(_0x2fc1f9){_0x27f9fa[_0x3736('0x91')]=_0x2fc1f9;if(_0x2fc1f9){var _0x309f92={'ContactId':_0x2fc1f9['id'],'OpenchannelAccountId':_0xc039d2['params']['id'],'from':(_0x2fc1f9[_0x3736('0x92')]||'')+'\x20'+(_0x2fc1f9[_0x3736('0x93')]||'')};var _0x25a33e={'OpenchannelAccountId':_0xc039d2['params']['id'],'closed':![]};if(_0xc039d2[_0x3736('0x66')][_0x3736('0x94')]){_0x25a33e[_0x3736('0x94')]=_0xc039d2[_0x3736('0x66')][_0x3736('0x94')];return db['OpenchannelInteraction'][_0x3736('0x62')]({'where':_0x25a33e})['then'](function(_0x2f0f55){if(_0x2f0f55){return[_0x2f0f55,![]];}_0x309f92['threadId']=_0xc039d2[_0x3736('0x66')][_0x3736('0x94')];_0x309f92[_0x3736('0x95')]=_0xc039d2[_0x3736('0x66')][_0x3736('0x95')];return db['OpenchannelInteraction']['create'](_0x309f92)[_0x3736('0x36')](function(_0x5a3fdc){return[_0x5a3fdc,!![]];});});}else{_0x25a33e[_0x3736('0x94')]=null;}_0x25a33e[_0x3736('0x96')]=_0x2fc1f9['id'];return db[_0x3736('0x97')][_0x3736('0x62')]({'where':_0x25a33e})[_0x3736('0x36')](function(_0x550dee){if(_0x550dee){return[_0x550dee,![]];}return db[_0x3736('0x97')][_0x3736('0x5d')](_0x309f92)[_0x3736('0x36')](function(_0x16155a){return[_0x16155a,!![]];});});}})[_0x3736('0x98')](function(_0x5b914e,_0x2dc112){if(_0x5b914e){_0x18b4b7=_0x2dc112;if(!_0x2dc112){var _0x45c20b={'from':(_0x27f9fa[_0x3736('0x91')]['firstName']||'')+'\x20'+(_0x27f9fa[_0x3736('0x91')][_0x3736('0x93')]||'')};if(_0xc039d2[_0x3736('0x66')]['threadId']&&_0xc039d2['body'][_0x3736('0x99')]&&_0xc039d2[_0x3736('0x66')]['threadId']!=_0xc039d2[_0x3736('0x66')][_0x3736('0x99')]){_0x45c20b[_0x3736('0x94')]=_0xc039d2[_0x3736('0x66')][_0x3736('0x99')];}return _0x5b914e['update'](_0x45c20b);}else{return _0x5b914e;}}})[_0x3736('0x36')](function(_0x319c8e){_0x27f9fa[_0x3736('0x9a')]=_0x319c8e[_0x3736('0x38')]({'plain':!![]});_0x27f9fa['interaction'][_0x3736('0x9b')]=_0x18b4b7;if(_0x27f9fa[_0x3736('0x9a')][_0x3736('0x9b')]){if(_0x27f9fa['account'][_0x3736('0x9c')]){_0x27f9fa[_0x3736('0x8c')][_0x3736('0x9d')]({'id':0x0,'priority':_0x27f9fa[_0x3736('0x8c')]['length']+0x1,'app':_0x3736('0x9e'),'appdata':'unmanaged','interval':_0x3736('0x9f')});}}return db['OpenchannelMessage']['create']({'body':_0xc039d2[_0x3736('0x66')][_0x3736('0x66')],'OpenchannelAccountId':_0xc039d2[_0x3736('0x5c')]['id'],'OpenchannelInteractionId':_0x319c8e['id'],'direction':'in','ContactId':_0x27f9fa[_0x3736('0x91')]['id'],'AttachmentId':_0xc039d2['body'][_0x3736('0xa0')]});})[_0x3736('0x36')](function(_0x541274){_0x27f9fa[_0x3736('0x27')]=_0x541274;if(_0x27f9fa[_0x3736('0x9a')][_0x3736('0xa1')]){return db['User'][_0x3736('0x62')]({'attributes':['id','name'],'where':{'id':_0x27f9fa[_0x3736('0x9a')][_0x3736('0xa1')]}})[_0x3736('0x36')](function(_0x35aabc){if(_0x35aabc){_0x27f9fa[_0x3736('0x8c')]['unshift']({'id':0x0,'priority':0x0,'app':_0x3736('0xa2'),'appdata':_0x35aabc[_0x3736('0x3b')]+','+(_0x27f9fa['account'][_0x3736('0xa3')]||0xa),'interval':'*,*,*,*'});_0x27f9fa[_0x3736('0xa4')]=![];}return respondWithRpcPromise(_0x3736('0xa5'),'startRouting',_0x27f9fa);});}return respondWithRpcPromise(_0x3736('0xa5'),'startRouting',_0x27f9fa);})['then'](function(_0x40408f){respondWithRpcPromise(_0x3736('0xa6'),_0x3736('0xa6'),{'event':'notify','message':_0x40408f},client9002);return _0x40408f;})['then'](respondWithResult(_0x28d3d6,null))[_0x3736('0x2b')](handleError(_0x28d3d6,null));};exports['addApplications']=function(_0x54b225,_0xcf4e09,_0xa7fc47){return db[_0x3736('0x41')][_0x3736('0x6c')]({'where':{'id':_0x54b225[_0x3736('0x5c')]['id']}})[_0x3736('0x36')](handleEntityNotFound(_0xcf4e09,null))['then'](function(_0x4edad3){if(_0x4edad3){return db[_0x3736('0xa7')][_0x3736('0xa8')](function(_0x50f96c){return db['OpenchannelApplication']['destroy']({'where':{'OpenchannelAccountId':_0x54b225[_0x3736('0x5c')]['id']},'transaction':_0x50f96c})[_0x3736('0x36')](function(_0x1fb54e){var _0x120180=_[_0x3736('0x40')](_0x54b225['body'],function(_0xb8a7de){_0xb8a7de[_0x3736('0x6d')]=_0x54b225[_0x3736('0x5c')]['id'];return _0xb8a7de;});return db[_0x3736('0x89')][_0x3736('0xa9')](_0x120180,{'transaction':_0x50f96c});});})[_0x3736('0x36')](function(){return db[_0x3736('0x89')][_0x3736('0xaa')]({'where':{'OpenchannelAccountId':_0x54b225[_0x3736('0x5c')]['id']},'order':_0x3736('0x8e')});});}})[_0x3736('0x36')](respondWithResult(_0xcf4e09,null))[_0x3736('0x2b')](handleError(_0xcf4e09,null));};exports[_0x3736('0xab')]=function(_0x313b00,_0x172a88,_0x71aaf8){var _0x524a50={};var _0x1ae021={};var _0x173e76;var _0x2d53f4;return db[_0x3736('0x41')][_0x3736('0x6c')]({'where':{'id':_0x313b00['params']['id']}})[_0x3736('0x36')](handleEntityNotFound(_0x172a88,null))[_0x3736('0x36')](function(_0x567bf1){if(_0x567bf1){_0x173e76=_0x567bf1;_0x1ae021['model']=_[_0x3736('0x48')](db[_0x3736('0x89')]['rawAttributes']);_0x1ae021[_0x3736('0x47')]=_[_0x3736('0x48')](_0x313b00['query']);_0x1ae021[_0x3736('0x49')]=_[_0x3736('0x4a')](_0x1ae021[_0x3736('0x46')],_0x1ae021[_0x3736('0x47')]);_0x524a50[_0x3736('0x4c')]=_[_0x3736('0x4a')](_0x1ae021[_0x3736('0x46')],qs[_0x3736('0x4b')](_0x313b00['query'][_0x3736('0x4b')]));_0x524a50['attributes']=_0x524a50[_0x3736('0x4c')][_0x3736('0x4d')]?_0x524a50[_0x3736('0x4c')]:_0x1ae021[_0x3736('0x46')];_0x524a50[_0x3736('0x51')]=qs[_0x3736('0x52')](_0x313b00[_0x3736('0x47')]['sort']);_0x524a50[_0x3736('0x55')]=qs[_0x3736('0x49')](_[_0x3736('0x53')](_0x313b00['query'],_0x1ae021[_0x3736('0x49')]));if(_0x313b00['query']['filter']){_0x524a50[_0x3736('0x55')]=_[_0x3736('0x56')](_0x524a50[_0x3736('0x55')],{'$or':_[_0x3736('0x40')](_0x524a50[_0x3736('0x4c')],function(_0xbaa489){var _0x1c387c={};_0x1c387c[_0xbaa489]={'$like':'%'+_0x313b00[_0x3736('0x47')][_0x3736('0x54')]+'%'};return _0x1c387c;})});}_0x524a50=_[_0x3736('0x56')]({},_0x524a50,_0x313b00['options']);return _0x173e76[_0x3736('0xab')](_0x524a50);}})['then'](function(_0x162c07){if(_0x162c07){_0x2d53f4=_0x162c07[_0x3736('0x4d')];if(!_0x313b00['query']['hasOwnProperty']('nolimit')){_0x524a50[_0x3736('0x50')]=qs[_0x3736('0x50')](_0x313b00[_0x3736('0x47')]['limit']);_0x524a50['offset']=qs['offset'](_0x313b00[_0x3736('0x47')][_0x3736('0x31')]);}return _0x173e76[_0x3736('0xab')](_0x524a50);}})[_0x3736('0x36')](function(_0x2a22c4){if(_0x2a22c4){return _0x2a22c4?{'count':_0x2d53f4,'rows':_0x2a22c4}:null;}})[_0x3736('0x36')](respondWithResult(_0x172a88,null))[_0x3736('0x2b')](handleError(_0x172a88,null));};exports[_0x3736('0xac')]=function(_0x4a2741,_0x3e00e9,_0x79ea6b){var _0x47c13c={'raw':![],'where':{}};var _0x9300e7={};var _0x298265={'count':0x0,'rows':[]};return db[_0x3736('0x41')][_0x3736('0x6c')]({'where':{'id':_0x4a2741[_0x3736('0x5c')]['id']}})[_0x3736('0x36')](handleEntityNotFound(_0x3e00e9,null))['then'](function(_0xc1cd23){if(_0xc1cd23){_0x9300e7[_0x3736('0x46')]=_[_0x3736('0x48')](db[_0x3736('0x97')][_0x3736('0x42')]);_0x9300e7[_0x3736('0x47')]=_[_0x3736('0x48')](_0x4a2741[_0x3736('0x47')]);_0x9300e7[_0x3736('0x49')]=_[_0x3736('0x4a')](_0x9300e7['model'],_0x9300e7[_0x3736('0x47')]);_0x47c13c['attributes']=_['intersection'](_0x9300e7[_0x3736('0x46')],qs['fields'](_0x4a2741[_0x3736('0x47')]['fields']));_0x47c13c[_0x3736('0x4c')]=_0x47c13c[_0x3736('0x4c')]['length']?_0x47c13c['attributes']:_0x9300e7['model'];if(!_0x4a2741['query'][_0x3736('0x4e')](_0x3736('0x4f'))){_0x47c13c['limit']=qs[_0x3736('0x50')](_0x4a2741[_0x3736('0x47')]['limit']);_0x47c13c[_0x3736('0x31')]=qs[_0x3736('0x31')](_0x4a2741[_0x3736('0x47')]['offset']);}_0x47c13c[_0x3736('0x51')]=qs[_0x3736('0x52')](_0x4a2741[_0x3736('0x47')][_0x3736('0x52')]);_0x47c13c[_0x3736('0x55')]=qs[_0x3736('0x49')](_[_0x3736('0x53')](_0x4a2741[_0x3736('0x47')],_0x9300e7[_0x3736('0x49')]));_0x47c13c[_0x3736('0x55')][_0x3736('0x6d')]=_0xc1cd23['id'];if(_0x4a2741[_0x3736('0x47')][_0x3736('0x54')]){_0x47c13c['where']=_[_0x3736('0x56')](_0x47c13c[_0x3736('0x55')],{'$or':_[_0x3736('0x40')](_0x47c13c[_0x3736('0x4c')],function(_0x395860){var _0x4f1bc1={};_0x4f1bc1[_0x395860]={'$like':'%'+_0x4a2741[_0x3736('0x47')][_0x3736('0x54')]+'%'};return _0x4f1bc1;})});}_0x47c13c=_[_0x3736('0x56')]({},_0x47c13c,_0x4a2741[_0x3736('0x58')]);return db[_0x3736('0x97')][_0x3736('0x30')]({'where':_0x47c13c[_0x3736('0x55')]})[_0x3736('0x36')](function(_0x11f500){_0x298265[_0x3736('0x30')]=_0x11f500;if(_0x4a2741['query'][_0x3736('0x6e')]){_0x47c13c[_0x3736('0x6f')]=[{'model':db[_0x3736('0x77')],'as':_0x3736('0xad'),'required':![]},{'model':db[_0x3736('0xae')],'as':'Owner','attributes':[_0x3736('0x3b'),_0x3736('0xaf'),_0x3736('0xb0')],'required':![]},{'model':db[_0x3736('0xb1')],'as':_0x3736('0xb2'),'attributes':['id',_0x3736('0x3b'),_0x3736('0xb3')],'where':_0x4a2741['query']['tag']?{'id':_0x4a2741['query'][_0x3736('0xb4')]}:undefined,'required':_0x4a2741[_0x3736('0x47')]['tag']?!![]:![]}];}return db['OpenchannelInteraction']['findAll'](_0x47c13c);})[_0x3736('0x36')](function(_0x140dfd){_0x298265[_0x3736('0x5a')]=_0x140dfd;return _0x298265;});}})[_0x3736('0x36')](respondWithFilteredResult(_0x3e00e9,_0x47c13c))[_0x3736('0x2b')](handleError(_0x3e00e9,null));};exports[_0x3736('0xb5')]=function(_0x522ea3,_0x3c2abc,_0x2eeb67){return db[_0x3736('0x41')][_0x3736('0x62')]({'where':{'id':_0x522ea3[_0x3736('0x5c')]['id']}})['then'](handleEntityNotFound(_0x3c2abc,null))[_0x3736('0x36')](function(_0x15b7e2){if(_0x15b7e2){return _0x15b7e2[_0x3736('0xb5')](_0x522ea3[_0x3736('0x66')][_0x3736('0x71')],_[_0x3736('0xb6')](_0x522ea3[_0x3736('0x66')],[_0x3736('0x71'),'id'])||{})[_0x3736('0x98')](function(_0x237660){for(var _0x5d0323=0x0;_0x5d0323<_0x522ea3['body']['ids']['length'];_0x5d0323+=0x1){socket[_0x3736('0xb7')]('userOpenchannelAccount:save',{'UserId':_0x522ea3[_0x3736('0x66')][_0x3736('0x71')][_0x5d0323],'OpenchannelAccountId':_0x522ea3[_0x3736('0x5c')]['id']});}return _0x237660;});}})[_0x3736('0x36')](respondWithResult(_0x3c2abc,null))[_0x3736('0x2b')](handleError(_0x3c2abc,null));};exports[_0x3736('0xb8')]=function(_0x197083,_0x101c89,_0x126194){return db['OpenchannelAccount'][_0x3736('0x62')]({'where':{'id':_0x197083['params']['id']}})[_0x3736('0x36')](handleEntityNotFound(_0x101c89,null))[_0x3736('0x36')](function(_0x55fa37){if(_0x55fa37){return _0x55fa37[_0x3736('0xb8')](_0x197083[_0x3736('0x47')]['ids'])[_0x3736('0x36')](function(){if(_['isArray'](_0x197083[_0x3736('0x47')]['ids'])){for(var _0x1348ce=0x0;_0x1348ce<_0x197083[_0x3736('0x47')][_0x3736('0x71')]['length'];_0x1348ce+=0x1){socket[_0x3736('0xb7')](_0x3736('0xb9'),{'UserId':Number(_0x197083[_0x3736('0x47')][_0x3736('0x71')][_0x1348ce]),'OpenchannelAccountId':Number(_0x197083[_0x3736('0x5c')]['id'])});}}else{socket[_0x3736('0xb7')](_0x3736('0xb9'),{'UserId':Number(_0x197083[_0x3736('0x47')]['ids']),'OpenchannelAccountId':Number(_0x197083[_0x3736('0x5c')]['id'])});}});}})[_0x3736('0x36')](respondWithStatusCode(_0x101c89,null))[_0x3736('0x2b')](handleError(_0x101c89,null));};exports[_0x3736('0xba')]=function(_0x4ab0a3,_0x1e531f,_0x1ef3da){var _0x488906={};var _0x23a8e8={};var _0x5a3b81;var _0x2c24d2;return db[_0x3736('0x41')][_0x3736('0x6c')]({'where':{'id':_0x4ab0a3[_0x3736('0x5c')]['id']}})[_0x3736('0x36')](handleEntityNotFound(_0x1e531f,null))[_0x3736('0x36')](function(_0x36a4e0){if(_0x36a4e0){_0x5a3b81=_0x36a4e0;_0x23a8e8[_0x3736('0x46')]=_[_0x3736('0x48')](db[_0x3736('0xae')][_0x3736('0x42')]);_0x23a8e8['query']=_[_0x3736('0x48')](_0x4ab0a3[_0x3736('0x47')]);_0x23a8e8[_0x3736('0x49')]=_[_0x3736('0x4a')](_0x23a8e8[_0x3736('0x46')],_0x23a8e8[_0x3736('0x47')]);_0x488906['attributes']=_[_0x3736('0x4a')](_0x23a8e8[_0x3736('0x46')],qs['fields'](_0x4ab0a3[_0x3736('0x47')][_0x3736('0x4b')]));_0x488906['attributes']=_0x488906['attributes']['length']?_0x488906[_0x3736('0x4c')]:_0x23a8e8[_0x3736('0x46')];_0x488906[_0x3736('0x51')]=qs[_0x3736('0x52')](_0x4ab0a3['query'][_0x3736('0x52')]);_0x488906[_0x3736('0x55')]=qs['filters'](_[_0x3736('0x53')](_0x4ab0a3[_0x3736('0x47')],_0x23a8e8['filters']));if(_0x4ab0a3[_0x3736('0x47')][_0x3736('0x54')]){_0x488906[_0x3736('0x55')]=_[_0x3736('0x56')](_0x488906[_0x3736('0x55')],{'$or':_[_0x3736('0x40')](_0x488906[_0x3736('0x4c')],function(_0x395ada){var _0x35cf2b={};_0x35cf2b[_0x395ada]={'$like':'%'+_0x4ab0a3['query'][_0x3736('0x54')]+'%'};return _0x35cf2b;})});}_0x488906=_[_0x3736('0x56')]({},_0x488906,_0x4ab0a3[_0x3736('0x58')]);return _0x5a3b81[_0x3736('0xba')](_0x488906);}})[_0x3736('0x36')](function(_0x544acf){if(_0x544acf){_0x2c24d2=_0x544acf[_0x3736('0x4d')];if(!_0x4ab0a3[_0x3736('0x47')][_0x3736('0x4e')](_0x3736('0x4f'))){_0x488906[_0x3736('0x50')]=qs[_0x3736('0x50')](_0x4ab0a3[_0x3736('0x47')][_0x3736('0x50')]);_0x488906[_0x3736('0x31')]=qs[_0x3736('0x31')](_0x4ab0a3[_0x3736('0x47')][_0x3736('0x31')]);}return _0x5a3b81['getAgents'](_0x488906);}})[_0x3736('0x36')](function(_0x3b2427){if(_0x3b2427){return _0x3b2427?{'count':_0x2c24d2,'rows':_0x3b2427}:null;}})[_0x3736('0x36')](respondWithResult(_0x1e531f,null))[_0x3736('0x2b')](handleError(_0x1e531f,null));};exports[_0x3736('0x3c')]=function(_0x11692d,_0xe92395,_0x10f87c){var _0x3d7bbb,_0x3c72eb,_0x167952;if(_[_0x3736('0x7e')](_0x11692d[_0x3736('0x66')][_0x3736('0x66')])||_0x11692d[_0x3736('0x66')][_0x3736('0x66')]===''){throw new db[(_0x3736('0x78'))][(_0x3736('0x22'))](_0x3736('0x81'));}if(_[_0x3736('0x7e')](_0x11692d['body']['to'])){}_0x3d7bbb=_0x11692d['body']['to'];return db['OpenchannelAccount']['findOne']({'where':{'id':_0x11692d['params']['id']}})['then'](handleEntityNotFound(_0xe92395,null))['then'](function(_0x13baf2){if(_0x13baf2){return db[_0x3736('0x41')][_0x3736('0x62')]({'where':{'id':_0x13baf2['id']},'include':[{'model':db[_0x3736('0x86')],'as':'List','include':[{'model':db[_0x3736('0x77')],'as':_0x3736('0x87'),'where':{[_0x13baf2[_0x3736('0x82')]]:_0x3d7bbb},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})[_0x3736('0x36')](handleEntityNotFound(_0xe92395,null))[_0x3736('0x36')](function(_0x109054){if(_0x109054&&_0x109054[_0x3736('0x90')]){_0x3c72eb=_0x109054[_0x3736('0x38')]({'plain':!![]});if(_0x3c72eb[_0x3736('0x90')]&&_0x3c72eb[_0x3736('0x90')]['Contacts'][_0x3736('0x4d')]){return _0x3c72eb[_0x3736('0x90')][_0x3736('0x87')][0x0];}return db[_0x3736('0x77')]['create'](_[_0x3736('0x1a')](_0x11692d[_0x3736('0x66')],{'firstName':_0x3d7bbb,[_0x109054[_0x3736('0x82')]]:_0x3d7bbb,'phone':_0x3d7bbb,'ListId':_0x3c72eb[_0x3736('0x7d')]}));}})[_0x3736('0x36')](handleEntityNotFound(_0xe92395,null))['then'](function(_0x54a028){if(_0x54a028){_0x167952=_0x54a028;return db[_0x3736('0x97')][_0x3736('0x62')]({'where':{'ContactId':_0x167952['id'],'closed':![],'OpenchannelAccountId':_0x3c72eb['id']}})[_0x3736('0x36')](function(_0x2bdd93){if(_0x2bdd93){return[_0x2bdd93,![]];}return db[_0x3736('0x97')]['create']({'UserId':_0x11692d[_0x3736('0x5e')]['id'],'ContactId':_0x167952['id'],'OpenchannelAccountId':_0x3c72eb['id'],'lastMsgDirection':'out','Messages':[_[_0x3736('0x56')](_0x11692d[_0x3736('0x66')],{'read':![],'body':_0x11692d[_0x3736('0x66')][_0x3736('0x66')],'OpenchannelAccountId':_0x3c72eb['id'],'UserId':_0x11692d[_0x3736('0x5e')]['id'],'ContactId':_0x167952['id']})]},{'include':[{'model':db[_0x3736('0xbb')],'as':_0x3736('0xbc')}]})[_0x3736('0x36')](function(_0x4cf9c8){return[_0x4cf9c8,!![]];});});}})[_0x3736('0x98')](function(_0x4f55e2,_0x2b866b){if(_0x2b866b){return _0x4f55e2;}return db['OpenchannelMessage']['create'](_['merge'](_0x11692d['body'],{'read':![],'body':_0x11692d[_0x3736('0x66')][_0x3736('0x66')],'OpenchannelAccountId':_0x3c72eb['id'],'OpenchannelInteractionId':_0x4f55e2['id'],'UserId':_0x11692d[_0x3736('0x5e')]['id'],'ContactId':_0x167952['id']}))[_0x3736('0x36')](function(_0x450340){_0x4f55e2[_0x3736('0xbd')]['Messages']=[];_0x4f55e2[_0x3736('0xbd')]['Messages'][_0x3736('0x9d')](_0x450340['dataValues']);return _0x4f55e2;});});}})[_0x3736('0x36')](respondWithResult(_0xe92395,null))[_0x3736('0x2b')](handleError(_0xe92395,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index de37982..e3f2901 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 _0x74f7=['events','../../mysqldb','OpenchannelAccount','save','update','emit','hook','exports'];(function(_0x3bae44,_0x1e37be){var _0x269503=function(_0x5d4763){while(--_0x5d4763){_0x3bae44['push'](_0x3bae44['shift']());}};_0x269503(++_0x1e37be);}(_0x74f7,0x1b8));var _0x774f=function(_0x2f2c8a,_0x2e8530){_0x2f2c8a=_0x2f2c8a-0x0;var _0x257dcc=_0x74f7[_0x2f2c8a];return _0x257dcc;};'use strict';var EventEmitter=require(_0x774f('0x0'));var OpenchannelAccount=require(_0x774f('0x1'))['db'][_0x774f('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x774f('0x3'),'afterUpdate':_0x774f('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1585fb){return function(_0x111fdf,_0x10638e,_0x355eec){OpenchannelAccountEvents[_0x774f('0x5')](_0x1585fb+':'+_0x111fdf['id'],_0x111fdf);OpenchannelAccountEvents[_0x774f('0x5')](_0x1585fb,_0x111fdf);_0x355eec(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0x774f('0x6')](e,emitEvent(event));}}module[_0x774f('0x7')]=OpenchannelAccountEvents; \ No newline at end of file +var _0xf2ad=['events','../../mysqldb','OpenchannelAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x4ded00,_0x46cf83){var _0x50fd48=function(_0xd0908e){while(--_0xd0908e){_0x4ded00['push'](_0x4ded00['shift']());}};_0x50fd48(++_0x46cf83);}(_0xf2ad,0x11e));var _0xdf2a=function(_0x3b7b8a,_0x52c3b0){_0x3b7b8a=_0x3b7b8a-0x0;var _0x441206=_0xf2ad[_0x3b7b8a];return _0x441206;};'use strict';var EventEmitter=require(_0xdf2a('0x0'));var OpenchannelAccount=require(_0xdf2a('0x1'))['db'][_0xdf2a('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xdf2a('0x3')](0x0);var events={'afterCreate':_0xdf2a('0x4'),'afterUpdate':_0xdf2a('0x5'),'afterDestroy':_0xdf2a('0x6')};function emitEvent(_0x5b6e75){return function(_0x435a97,_0x28f807,_0x76c371){OpenchannelAccountEvents[_0xdf2a('0x7')](_0x5b6e75+':'+_0x435a97['id'],_0x435a97);OpenchannelAccountEvents[_0xdf2a('0x7')](_0x5b6e75,_0x435a97);_0x76c371(null);};}for(var e in events){if(events[_0xdf2a('0x8')](e)){var event=events[e];OpenchannelAccount[_0xdf2a('0x9')](e,emitEvent(event));}}module[_0xdf2a('0xa')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index d87318e..b7ba2d8 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 _0x2c35=['request-promise','path','rimraf','../../config/environment','exports','define','OpenchannelAccount','openchannel_accounts','lodash','util','../../config/logger','api','bluebird'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x2c35,0xe5));var _0x52c3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2c35[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x52c3('0x0'));var util=require(_0x52c3('0x1'));var logger=require(_0x52c3('0x2'))(_0x52c3('0x3'));var moment=require('moment');var BPromise=require(_0x52c3('0x4'));var rp=require(_0x52c3('0x5'));var fs=require('fs');var path=require(_0x52c3('0x6'));var rimraf=require(_0x52c3('0x7'));var config=require(_0x52c3('0x8'));var attributes=require('./openchannelAccount.attributes');module[_0x52c3('0x9')]=function(_0x16d131,_0x57c982){return _0x16d131[_0x52c3('0xa')](_0x52c3('0xb'),attributes,{'tableName':_0x52c3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x05cc=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelAccount.attributes','exports','define','OpenchannelAccount','lodash'];(function(_0x5871ad,_0x2169df){var _0x6cd48b=function(_0x1e6319){while(--_0x1e6319){_0x5871ad['push'](_0x5871ad['shift']());}};_0x6cd48b(++_0x2169df);}(_0x05cc,0x1e9));var _0xc05c=function(_0x594efc,_0x26946f){_0x594efc=_0x594efc-0x0;var _0x355b98=_0x05cc[_0x594efc];return _0x355b98;};'use strict';var _=require(_0xc05c('0x0'));var util=require(_0xc05c('0x1'));var logger=require(_0xc05c('0x2'))(_0xc05c('0x3'));var moment=require(_0xc05c('0x4'));var BPromise=require(_0xc05c('0x5'));var rp=require(_0xc05c('0x6'));var fs=require('fs');var path=require(_0xc05c('0x7'));var rimraf=require(_0xc05c('0x8'));var config=require(_0xc05c('0x9'));var attributes=require(_0xc05c('0xa'));module[_0xc05c('0xb')]=function(_0x2e470a,_0x141f7c){return _0x2e470a[_0xc05c('0xc')](_0xc05c('0xd'),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 1707751..1fd79af 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 _0x382e=['info','result','catch','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','defaults','redis','localhost','register','request','then','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0x382e,0x12f));var _0xe382=function(_0x4377cb,_0x21d1ca){_0x4377cb=_0x4377cb-0x0;var _0x169fb3=_0x382e[_0x4377cb];return _0x169fb3;};'use strict';var _=require('lodash');var util=require(_0xe382('0x0'));var moment=require('moment');var BPromise=require(_0xe382('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe382('0x2'))['db'];var utils=require(_0xe382('0x3'));var logger=require(_0xe382('0x4'))(_0xe382('0x5'));var config=require(_0xe382('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xe382('0x7')]['http']({'port':0x232a});config['redis']=_[_0xe382('0x8')](config[_0xe382('0x9')],{'host':_0xe382('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe382('0x9')]));require('./openchannelAccount.socket')[_0xe382('0xb')](socket);function respondWithRpcPromise(_0x4dbd00,_0x4ad080,_0x27ce60){return new BPromise(function(_0x4527fe,_0x2abe77){return client[_0xe382('0xc')](_0x4dbd00,_0x27ce60)[_0xe382('0xd')](function(_0x371153){logger['info'](_0xe382('0xe'),_0x4ad080,_0xe382('0xf'));logger[_0xe382('0x10')](_0xe382('0x11'),_0x4ad080,_0xe382('0xf'),JSON[_0xe382('0x12')](_0x371153));if(_0x371153[_0xe382('0x13')]){if(_0x371153[_0xe382('0x13')][_0xe382('0x14')]===0x1f4){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x4ad080,_0x371153[_0xe382('0x13')][_0xe382('0x15')]);return _0x2abe77(_0x371153[_0xe382('0x13')][_0xe382('0x15')]);}logger['error'](_0xe382('0xe'),_0x4ad080,_0x371153[_0xe382('0x13')]['message']);return _0x4527fe(_0x371153[_0xe382('0x13')][_0xe382('0x15')]);}else{logger[_0xe382('0x16')](_0xe382('0xe'),_0x4ad080,_0xe382('0xf'));_0x4527fe(_0x371153[_0xe382('0x17')][_0xe382('0x15')]);}})[_0xe382('0x18')](function(_0x3ab06f){logger[_0xe382('0x13')](_0xe382('0xe'),_0x4ad080,_0x3ab06f);_0x2abe77(_0x3ab06f);});});} \ No newline at end of file +var _0x0dc2=['register','request','then','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelAccount,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket'];(function(_0x260a13,_0x3b1063){var _0x4488a6=function(_0x57b755){while(--_0x57b755){_0x260a13['push'](_0x260a13['shift']());}};_0x4488a6(++_0x3b1063);}(_0x0dc2,0x1bb));var _0x20dc=function(_0x26ce09,_0x495d74){_0x26ce09=_0x26ce09-0x0;var _0x482a5a=_0x0dc2[_0x26ce09];return _0x482a5a;};'use strict';var _=require(_0x20dc('0x0'));var util=require(_0x20dc('0x1'));var moment=require(_0x20dc('0x2'));var BPromise=require('bluebird');var rs=require(_0x20dc('0x3'));var fs=require('fs');var Redis=require(_0x20dc('0x4'));var db=require(_0x20dc('0x5'))['db'];var utils=require(_0x20dc('0x6'));var logger=require(_0x20dc('0x7'))('rpc');var config=require(_0x20dc('0x8'));var jayson=require(_0x20dc('0x9'));var client=jayson[_0x20dc('0xa')]['http']({'port':0x232a});config[_0x20dc('0xb')]=_[_0x20dc('0xc')](config[_0x20dc('0xb')],{'host':_0x20dc('0xd'),'port':0x18eb});var socket=require(_0x20dc('0xe'))(new Redis(config[_0x20dc('0xb')]));require(_0x20dc('0xf'))[_0x20dc('0x10')](socket);function respondWithRpcPromise(_0x4de61d,_0x4f2df9,_0x45d16d){return new BPromise(function(_0x4abfb2,_0x280adb){return client[_0x20dc('0x11')](_0x4de61d,_0x45d16d)[_0x20dc('0x12')](function(_0x28abb3){logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x4f2df9,_0x20dc('0x13'));logger['debug'](_0x20dc('0x14'),_0x4f2df9,_0x20dc('0x13'),JSON[_0x20dc('0x15')](_0x28abb3));if(_0x28abb3['error']){if(_0x28abb3[_0x20dc('0x16')]['code']===0x1f4){logger[_0x20dc('0x16')](_0x20dc('0x17'),_0x4f2df9,_0x28abb3[_0x20dc('0x16')]['message']);return _0x280adb(_0x28abb3[_0x20dc('0x16')][_0x20dc('0x18')]);}logger[_0x20dc('0x16')](_0x20dc('0x17'),_0x4f2df9,_0x28abb3[_0x20dc('0x16')][_0x20dc('0x18')]);return _0x4abfb2(_0x28abb3[_0x20dc('0x16')][_0x20dc('0x18')]);}else{logger['info'](_0x20dc('0x17'),_0x4f2df9,'request\x20sent');_0x4abfb2(_0x28abb3[_0x20dc('0x19')][_0x20dc('0x18')]);}})[_0x20dc('0x1a')](function(_0x58bf1c){logger[_0x20dc('0x16')](_0x20dc('0x17'),_0x4f2df9,_0x58bf1c);_0x280adb(_0x58bf1c);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index b7f447a..32b6eee 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 _0x84a1=['./openchannelAccount.events','update','emit','removeListener','register'];(function(_0x2390a7,_0x44b73e){var _0xaddc20=function(_0x1d29c0){while(--_0x1d29c0){_0x2390a7['push'](_0x2390a7['shift']());}};_0xaddc20(++_0x44b73e);}(_0x84a1,0xc3));var _0x184a=function(_0x4a9a78,_0x5a47d0){_0x4a9a78=_0x4a9a78-0x0;var _0x48e953=_0x84a1[_0x4a9a78];return _0x48e953;};'use strict';var OpenchannelAccountEvents=require(_0x184a('0x0'));var events=['save','remove',_0x184a('0x1')];function createListener(_0x9651d9,_0x45d673){return function(_0x311ef4){_0x45d673[_0x184a('0x2')](_0x9651d9,_0x311ef4);};}function removeListener(_0x15f3df,_0x357631){return function(){OpenchannelAccountEvents[_0x184a('0x3')](_0x15f3df,_0x357631);};}exports[_0x184a('0x4')]=function(_0x104dd4){for(var _0x35a0fd=0x0,_0x3b1b0c=events['length'];_0x35a0fd<_0x3b1b0c;_0x35a0fd++){var _0x22dc15=events[_0x35a0fd];var _0x57a822=createListener('openchannelAccount:'+_0x22dc15,_0x104dd4);OpenchannelAccountEvents['on'](_0x22dc15,_0x57a822);}}; \ No newline at end of file +var _0xcf59=['openchannelAccount:','update','removeListener','register','length'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0xcf59,0xf1));var _0x9cf5=function(_0x26dd9a,_0x28a8e1){_0x26dd9a=_0x26dd9a-0x0;var _0x32c5f8=_0xcf59[_0x26dd9a];return _0x32c5f8;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=['save','remove',_0x9cf5('0x0')];function createListener(_0x295e58,_0x5024a2){return function(_0x2f4012){_0x5024a2['emit'](_0x295e58,_0x2f4012);};}function removeListener(_0x1e3b44,_0x93184f){return function(){OpenchannelAccountEvents[_0x9cf5('0x1')](_0x1e3b44,_0x93184f);};}exports[_0x9cf5('0x2')]=function(_0x12851f){for(var _0x15b4ff=0x0,_0x1d2916=events[_0x9cf5('0x3')];_0x15b4ff<_0x1d2916;_0x15b4ff++){var _0x4187b3=events[_0x15b4ff];var _0x58f7eb=createListener(_0x9cf5('0x4')+_0x4187b3,_0x12851f);OpenchannelAccountEvents['on'](_0x4187b3,_0x58f7eb);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index e4cfa5c..2799be3 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 _0x48ad=['index','get','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','./openchannelApplication.controller'];(function(_0x3e2489,_0x41d9dd){var _0x2254ce=function(_0x227e46){while(--_0x227e46){_0x3e2489['push'](_0x3e2489['shift']());}};_0x2254ce(++_0x41d9dd);}(_0x48ad,0x103));var _0xd48a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x48ad[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xd48a('0x0'));var util=require(_0xd48a('0x1'));var path=require(_0xd48a('0x2'));var timeout=require('connect-timeout');var express=require(_0xd48a('0x3'));var router=express[_0xd48a('0x4')]();var auth=require(_0xd48a('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd48a('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xd48a('0x7')]);router[_0xd48a('0x8')]('/:id',auth[_0xd48a('0x9')](),controller[_0xd48a('0xa')]);router[_0xd48a('0xb')]('/',auth[_0xd48a('0x9')](),controller[_0xd48a('0xc')]);router[_0xd48a('0xd')](_0xd48a('0xe'),auth[_0xd48a('0x9')](),controller[_0xd48a('0xf')]);router[_0xd48a('0x10')](_0xd48a('0xe'),auth[_0xd48a('0x9')](),controller[_0xd48a('0x11')]);module[_0xd48a('0x12')]=router; \ No newline at end of file +var _0x165e=['/:id','isAuthenticated','post','create','put','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','./openchannelApplication.controller','get','index'];(function(_0xf44d98,_0x12a472){var _0x5ebb04=function(_0x930c33){while(--_0x930c33){_0xf44d98['push'](_0xf44d98['shift']());}};_0x5ebb04(++_0x12a472);}(_0x165e,0xf7));var _0xe165=function(_0x486ace,_0x2acf99){_0x486ace=_0x486ace-0x0;var _0x236c9b=_0x165e[_0x486ace];return _0x236c9b;};'use strict';var multer=require(_0xe165('0x0'));var util=require(_0xe165('0x1'));var path=require(_0xe165('0x2'));var timeout=require('connect-timeout');var express=require(_0xe165('0x3'));var router=express[_0xe165('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xe165('0x5'));var config=require('../../config/environment');var controller=require(_0xe165('0x6'));router[_0xe165('0x7')]('/',auth['isAuthenticated'](),controller[_0xe165('0x8')]);router[_0xe165('0x7')](_0xe165('0x9'),auth[_0xe165('0xa')](),controller['show']);router[_0xe165('0xb')]('/',auth[_0xe165('0xa')](),controller[_0xe165('0xc')]);router[_0xe165('0xd')](_0xe165('0x9'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xe165('0x9'),auth[_0xe165('0xa')](),controller[_0xe165('0xe')]);module[_0xe165('0xf')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 69b8393..1ee76b7 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 _0x8409=['STRING','noop','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x1e6c87,_0x53e269){var _0x4f0e24=function(_0x1dd1d0){while(--_0x1dd1d0){_0x1e6c87['push'](_0x1e6c87['shift']());}};_0x4f0e24(++_0x53e269);}(_0x8409,0x185));var _0x9840=function(_0xb7fca7,_0x38ca46){_0xb7fca7=_0xb7fca7-0x0;var _0x3c0d34=_0x8409[_0xb7fca7];return _0x3c0d34;};'use strict';var Sequelize=require(_0x9840('0x0'));module[_0x9840('0x1')]={'priority':{'type':Sequelize[_0x9840('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x9840('0x3')],'allowNull':![],'defaultValue':_0x9840('0x4')},'appdata':{'type':Sequelize[_0x9840('0x5')]()},'description':{'type':Sequelize[_0x9840('0x3')]},'interval':{'type':Sequelize[_0x9840('0x3')],'defaultValue':_0x9840('0x6')}}; \ No newline at end of file +var _0x44eb=['INTEGER','STRING','noop','*,*,*,*','sequelize'];(function(_0x2e8ee9,_0x5ed256){var _0x3c15f6=function(_0x5d499d){while(--_0x5d499d){_0x2e8ee9['push'](_0x2e8ee9['shift']());}};_0x3c15f6(++_0x5ed256);}(_0x44eb,0x14e));var _0xb44e=function(_0x19c4bd,_0x19a00d){_0x19c4bd=_0x19c4bd-0x0;var _0x2fc7b5=_0x44eb[_0x19c4bd];return _0x2fc7b5;};'use strict';var Sequelize=require(_0xb44e('0x0'));module['exports']={'priority':{'type':Sequelize[_0xb44e('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xb44e('0x2')],'allowNull':![],'defaultValue':_0xb44e('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xb44e('0x2')]},'interval':{'type':Sequelize[_0xb44e('0x2')],'defaultValue':_0xb44e('0x4')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 4203f57..b36fc11 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 _0xce1d=['index','map','OpenchannelApplication','rawAttributes','fieldName','key','model','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','includeAll','include','show','params','intersection','length','merge','options','find','create','body','catch','html-pdf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','apply','reject','save','update','then','destroy','error','stack','name'];(function(_0x3cba27,_0x114ba2){var _0x332365=function(_0x408763){while(--_0x408763){_0x3cba27['push'](_0x3cba27['shift']());}};_0x332365(++_0x114ba2);}(_0xce1d,0xaf));var _0xdce1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xce1d[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xdce1('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xdce1('0x1'));var rp=require('request-promise');var moment=require(_0xdce1('0x2'));var BPromise=require(_0xdce1('0x3'));var Mustache=require(_0xdce1('0x4'));var util=require(_0xdce1('0x5'));var path=require(_0xdce1('0x6'));var sox=require(_0xdce1('0x7'));var csv=require(_0xdce1('0x8'));var ejs=require(_0xdce1('0x9'));var fs=require('fs');var _=require(_0xdce1('0xa'));var squel=require(_0xdce1('0xb'));var crypto=require(_0xdce1('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xdce1('0xd'));var toCsv=require(_0xdce1('0x8'));var querystring=require(_0xdce1('0xe'));var Papa=require(_0xdce1('0xf'));var Redis=require(_0xdce1('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xdce1('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdce1('0x12'));var logger=require('../../config/logger')(_0xdce1('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xdce1('0x14'))['db'];function respondWithStatusCode(_0xf0d38e,_0x259845){_0x259845=_0x259845||0xcc;return function(_0x31897d){if(_0x31897d){return _0xf0d38e[_0xdce1('0x15')](_0x259845);}return _0xf0d38e['status'](_0x259845)[_0xdce1('0x16')]();};}function respondWithResult(_0x5bfbcb,_0x27909d){_0x27909d=_0x27909d||0xc8;return function(_0x572a88){if(_0x572a88){return _0x5bfbcb[_0xdce1('0x17')](_0x27909d)[_0xdce1('0x18')](_0x572a88);}};}function respondWithFilteredResult(_0x50d5c9,_0x1511fa){return function(_0x3b872a){if(_0x3b872a){var _0x597a99=_0x3b872a[_0xdce1('0x19')],_0x15185c=_0x1511fa[_0xdce1('0x1a')],_0x1ff759=_0x1511fa['offset']+_0x1511fa[_0xdce1('0x1b')],_0x16eae8;if(_0x1ff759>=_0x597a99){_0x1ff759=_0x597a99;_0x16eae8=0xc8;}else{_0x16eae8=0xce;}_0x50d5c9[_0xdce1('0x17')](_0x16eae8);return _0x50d5c9[_0xdce1('0x1c')]('Content-Range',_0x15185c+'-'+_0x1ff759+'/'+_0x597a99)[_0xdce1('0x18')](_0x3b872a);}return null;};}function patchUpdates(_0xe38ae0){return function(_0x143c3f){try{jsonpatch[_0xdce1('0x1d')](_0x143c3f,_0xe38ae0,!![]);}catch(_0x5349c0){return BPromise[_0xdce1('0x1e')](_0x5349c0);}return _0x143c3f[_0xdce1('0x1f')]();};}function saveUpdates(_0x299b7e,_0x22ef58){return function(_0x3a333a){if(_0x3a333a){return _0x3a333a[_0xdce1('0x20')](_0x299b7e)[_0xdce1('0x21')](function(_0x3f74d6){return _0x3f74d6;});}return null;};}function removeEntity(_0x1ace86,_0x34b435){return function(_0x379d5e){if(_0x379d5e){return _0x379d5e[_0xdce1('0x22')]()['then'](function(){_0x1ace86[_0xdce1('0x17')](0xcc)[_0xdce1('0x16')]();});}};}function handleEntityNotFound(_0x5ed3c2,_0x29fd60){return function(_0x2cb03d){if(!_0x2cb03d){_0x5ed3c2[_0xdce1('0x15')](0x194);}return _0x2cb03d;};}function handleError(_0x41756d,_0x326ce4){_0x326ce4=_0x326ce4||0x1f4;return function(_0x5530ee){logger[_0xdce1('0x23')](_0x5530ee[_0xdce1('0x24')]);if(_0x5530ee[_0xdce1('0x25')]){delete _0x5530ee[_0xdce1('0x25')];}_0x41756d[_0xdce1('0x17')](_0x326ce4)['send'](_0x5530ee);};}exports[_0xdce1('0x26')]=function(_0x49c071,_0xd11296){var _0x57536f={},_0x4e5dd4={},_0x1e38c0={'count':0x0,'rows':[]};var _0x5207c9=_[_0xdce1('0x27')](db[_0xdce1('0x28')][_0xdce1('0x29')],function(_0x6aeeee){return{'name':_0x6aeeee[_0xdce1('0x2a')],'type':_0x6aeeee['type'][_0xdce1('0x2b')]};});_0x4e5dd4[_0xdce1('0x2c')]=_[_0xdce1('0x27')](_0x5207c9,_0xdce1('0x25'));_0x4e5dd4[_0xdce1('0x2d')]=_[_0xdce1('0x2e')](_0x49c071[_0xdce1('0x2d')]);_0x4e5dd4[_0xdce1('0x2f')]=_['intersection'](_0x4e5dd4[_0xdce1('0x2c')],_0x4e5dd4['query']);_0x57536f[_0xdce1('0x30')]=_['intersection'](_0x4e5dd4[_0xdce1('0x2c')],qs[_0xdce1('0x31')](_0x49c071[_0xdce1('0x2d')][_0xdce1('0x31')]));_0x57536f[_0xdce1('0x30')]=_0x57536f[_0xdce1('0x30')]['length']?_0x57536f[_0xdce1('0x30')]:_0x4e5dd4['model'];if(!_0x49c071['query'][_0xdce1('0x32')](_0xdce1('0x33'))){_0x57536f[_0xdce1('0x1b')]=qs[_0xdce1('0x1b')](_0x49c071[_0xdce1('0x2d')][_0xdce1('0x1b')]);_0x57536f[_0xdce1('0x1a')]=qs[_0xdce1('0x1a')](_0x49c071[_0xdce1('0x2d')][_0xdce1('0x1a')]);}_0x57536f[_0xdce1('0x34')]=qs[_0xdce1('0x35')](_0x49c071[_0xdce1('0x2d')][_0xdce1('0x35')]);_0x57536f[_0xdce1('0x36')]=qs['filters'](_[_0xdce1('0x37')](_0x49c071[_0xdce1('0x2d')],_0x4e5dd4[_0xdce1('0x2f')]));if(_0x49c071['query'][_0xdce1('0x38')]){_0x57536f['where']=_['merge'](_0x57536f[_0xdce1('0x36')],{'$or':_[_0xdce1('0x27')](_0x5207c9,function(_0x321b59){if(_0x321b59[_0xdce1('0x39')]!==_0xdce1('0x3a')){var _0x2c3d61={};_0x2c3d61[_0x321b59[_0xdce1('0x25')]]={'$like':'%'+_0x49c071[_0xdce1('0x2d')][_0xdce1('0x38')]+'%'};return _0x2c3d61;}})});}_0x57536f=_['merge']({},_0x57536f,_0x49c071['options']);var _0x51595d={'where':_0x57536f[_0xdce1('0x36')]};return db[_0xdce1('0x28')][_0xdce1('0x19')](_0x51595d)['then'](function(_0x5351b1){_0x1e38c0['count']=_0x5351b1;if(_0x49c071[_0xdce1('0x2d')][_0xdce1('0x3b')]){_0x57536f[_0xdce1('0x3c')]=[{'all':!![]}];}return db[_0xdce1('0x28')]['findAll'](_0x57536f);})[_0xdce1('0x21')](function(_0x58f687){_0x1e38c0['rows']=_0x58f687;return _0x1e38c0;})[_0xdce1('0x21')](respondWithFilteredResult(_0xd11296,_0x57536f))['catch'](handleError(_0xd11296,null));};exports[_0xdce1('0x3d')]=function(_0xf71a81,_0x14a0fd){var _0x2f2780={'raw':!![],'where':{'id':_0xf71a81[_0xdce1('0x3e')]['id']}},_0x297759={};_0x297759['model']=_[_0xdce1('0x2e')](db[_0xdce1('0x28')]['rawAttributes']);_0x297759[_0xdce1('0x2d')]=_[_0xdce1('0x2e')](_0xf71a81['query']);_0x297759[_0xdce1('0x2f')]=_[_0xdce1('0x3f')](_0x297759[_0xdce1('0x2c')],_0x297759[_0xdce1('0x2d')]);_0x2f2780['attributes']=_[_0xdce1('0x3f')](_0x297759[_0xdce1('0x2c')],qs[_0xdce1('0x31')](_0xf71a81[_0xdce1('0x2d')]['fields']));_0x2f2780['attributes']=_0x2f2780[_0xdce1('0x30')][_0xdce1('0x40')]?_0x2f2780[_0xdce1('0x30')]:_0x297759['model'];if(_0xf71a81[_0xdce1('0x2d')]['includeAll']){_0x2f2780[_0xdce1('0x3c')]=[{'all':!![]}];}_0x2f2780=_[_0xdce1('0x41')]({},_0x2f2780,_0xf71a81[_0xdce1('0x42')]);return db[_0xdce1('0x28')][_0xdce1('0x43')](_0x2f2780)[_0xdce1('0x21')](handleEntityNotFound(_0x14a0fd,null))[_0xdce1('0x21')](respondWithResult(_0x14a0fd,null))['catch'](handleError(_0x14a0fd,null));};exports[_0xdce1('0x44')]=function(_0x297389,_0x3364a0){return db[_0xdce1('0x28')][_0xdce1('0x44')](_0x297389[_0xdce1('0x45')],{})[_0xdce1('0x21')](respondWithResult(_0x3364a0,0xc9))[_0xdce1('0x46')](handleError(_0x3364a0,null));};exports['update']=function(_0x114da6,_0x3752fd){if(_0x114da6['body']['id']){delete _0x114da6[_0xdce1('0x45')]['id'];}return db['OpenchannelApplication'][_0xdce1('0x43')]({'where':{'id':_0x114da6[_0xdce1('0x3e')]['id']}})['then'](handleEntityNotFound(_0x3752fd,null))[_0xdce1('0x21')](saveUpdates(_0x114da6[_0xdce1('0x45')],null))['then'](respondWithResult(_0x3752fd,null))[_0xdce1('0x46')](handleError(_0x3752fd,null));};exports[_0xdce1('0x22')]=function(_0x5bf4a9,_0x3b9bc2){return db[_0xdce1('0x28')][_0xdce1('0x43')]({'where':{'id':_0x5bf4a9[_0xdce1('0x3e')]['id']}})[_0xdce1('0x21')](handleEntityNotFound(_0x3b9bc2,null))[_0xdce1('0x21')](removeEntity(_0x3b9bc2,null))[_0xdce1('0x46')](handleError(_0x3b9bc2,null));}; \ No newline at end of file +var _0x8326=['save','update','then','error','name','send','OpenchannelApplication','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','show','params','find','catch','create','body','destroy','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','Content-Range','apply'];(function(_0x25dc76,_0xfae587){var _0x478c85=function(_0x263ae8){while(--_0x263ae8){_0x25dc76['push'](_0x25dc76['shift']());}};_0x478c85(++_0xfae587);}(_0x8326,0x1d8));var _0x6832=function(_0x2c8887,_0x52005c){_0x2c8887=_0x2c8887-0x0;var _0x46f025=_0x8326[_0x2c8887];return _0x46f025;};'use strict';var pdf=require(_0x6832('0x0'));var emlformat=require(_0x6832('0x1'));var rimraf=require(_0x6832('0x2'));var zipdir=require(_0x6832('0x3'));var jsonpatch=require(_0x6832('0x4'));var rp=require(_0x6832('0x5'));var moment=require('moment');var BPromise=require(_0x6832('0x6'));var Mustache=require(_0x6832('0x7'));var util=require('util');var path=require(_0x6832('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x6832('0x9'));var squel=require(_0x6832('0xa'));var crypto=require('crypto');var jsforce=require(_0x6832('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x6832('0xc'));var querystring=require(_0x6832('0xd'));var Papa=require(_0x6832('0xe'));var Redis=require(_0x6832('0xf'));var authService=require(_0x6832('0x10'));var qs=require(_0x6832('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6832('0x12'));var logger=require(_0x6832('0x13'))(_0x6832('0x14'));var utils=require(_0x6832('0x15'));var config=require(_0x6832('0x16'));var db=require(_0x6832('0x17'))['db'];function respondWithStatusCode(_0x2df4ba,_0x26dddc){_0x26dddc=_0x26dddc||0xcc;return function(_0x4768d4){if(_0x4768d4){return _0x2df4ba[_0x6832('0x18')](_0x26dddc);}return _0x2df4ba[_0x6832('0x19')](_0x26dddc)[_0x6832('0x1a')]();};}function respondWithResult(_0x588b14,_0x4b8747){_0x4b8747=_0x4b8747||0xc8;return function(_0x1d9d62){if(_0x1d9d62){return _0x588b14[_0x6832('0x19')](_0x4b8747)[_0x6832('0x1b')](_0x1d9d62);}};}function respondWithFilteredResult(_0x2323a6,_0x34ef83){return function(_0x5c7278){if(_0x5c7278){var _0x114834=_0x5c7278['count'],_0x2f2106=_0x34ef83['offset'],_0x3d8c32=_0x34ef83[_0x6832('0x1c')]+_0x34ef83[_0x6832('0x1d')],_0x165339;if(_0x3d8c32>=_0x114834){_0x3d8c32=_0x114834;_0x165339=0xc8;}else{_0x165339=0xce;}_0x2323a6[_0x6832('0x19')](_0x165339);return _0x2323a6['set'](_0x6832('0x1e'),_0x2f2106+'-'+_0x3d8c32+'/'+_0x114834)[_0x6832('0x1b')](_0x5c7278);}return null;};}function patchUpdates(_0x4eca25){return function(_0x51e35e){try{jsonpatch[_0x6832('0x1f')](_0x51e35e,_0x4eca25,!![]);}catch(_0xd9fcad){return BPromise['reject'](_0xd9fcad);}return _0x51e35e[_0x6832('0x20')]();};}function saveUpdates(_0x2f1979,_0x48ae35){return function(_0x130215){if(_0x130215){return _0x130215[_0x6832('0x21')](_0x2f1979)['then'](function(_0x49e85a){return _0x49e85a;});}return null;};}function removeEntity(_0x3f66f0,_0x32670a){return function(_0x55788d){if(_0x55788d){return _0x55788d['destroy']()[_0x6832('0x22')](function(){_0x3f66f0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3298a6,_0x2d7421){return function(_0x257c2f){if(!_0x257c2f){_0x3298a6['sendStatus'](0x194);}return _0x257c2f;};}function handleError(_0x46bfcd,_0x1cedd7){_0x1cedd7=_0x1cedd7||0x1f4;return function(_0x12d0cd){logger[_0x6832('0x23')](_0x12d0cd['stack']);if(_0x12d0cd[_0x6832('0x24')]){delete _0x12d0cd['name'];}_0x46bfcd[_0x6832('0x19')](_0x1cedd7)[_0x6832('0x25')](_0x12d0cd);};}exports['index']=function(_0x27e10f,_0x231dda){var _0x2c03bd={},_0x20d703={},_0x2217f5={'count':0x0,'rows':[]};var _0x185352=_['map'](db[_0x6832('0x26')][_0x6832('0x27')],function(_0x3a2f44){return{'name':_0x3a2f44['fieldName'],'type':_0x3a2f44[_0x6832('0x28')][_0x6832('0x29')]};});_0x20d703[_0x6832('0x2a')]=_[_0x6832('0x2b')](_0x185352,_0x6832('0x24'));_0x20d703[_0x6832('0x2c')]=_[_0x6832('0x2d')](_0x27e10f['query']);_0x20d703[_0x6832('0x2e')]=_[_0x6832('0x2f')](_0x20d703[_0x6832('0x2a')],_0x20d703[_0x6832('0x2c')]);_0x2c03bd[_0x6832('0x30')]=_[_0x6832('0x2f')](_0x20d703['model'],qs[_0x6832('0x31')](_0x27e10f[_0x6832('0x2c')]['fields']));_0x2c03bd[_0x6832('0x30')]=_0x2c03bd[_0x6832('0x30')][_0x6832('0x32')]?_0x2c03bd[_0x6832('0x30')]:_0x20d703['model'];if(!_0x27e10f[_0x6832('0x2c')][_0x6832('0x33')](_0x6832('0x34'))){_0x2c03bd[_0x6832('0x1d')]=qs['limit'](_0x27e10f['query']['limit']);_0x2c03bd[_0x6832('0x1c')]=qs['offset'](_0x27e10f[_0x6832('0x2c')][_0x6832('0x1c')]);}_0x2c03bd[_0x6832('0x35')]=qs[_0x6832('0x36')](_0x27e10f[_0x6832('0x2c')][_0x6832('0x36')]);_0x2c03bd[_0x6832('0x37')]=qs[_0x6832('0x2e')](_[_0x6832('0x38')](_0x27e10f[_0x6832('0x2c')],_0x20d703[_0x6832('0x2e')]));if(_0x27e10f[_0x6832('0x2c')][_0x6832('0x39')]){_0x2c03bd[_0x6832('0x37')]=_[_0x6832('0x3a')](_0x2c03bd[_0x6832('0x37')],{'$or':_[_0x6832('0x2b')](_0x185352,function(_0x218971){if(_0x218971[_0x6832('0x28')]!==_0x6832('0x3b')){var _0x158766={};_0x158766[_0x218971[_0x6832('0x24')]]={'$like':'%'+_0x27e10f[_0x6832('0x2c')][_0x6832('0x39')]+'%'};return _0x158766;}})});}_0x2c03bd=_[_0x6832('0x3a')]({},_0x2c03bd,_0x27e10f[_0x6832('0x3c')]);var _0x43fae7={'where':_0x2c03bd[_0x6832('0x37')]};return db[_0x6832('0x26')][_0x6832('0x3d')](_0x43fae7)[_0x6832('0x22')](function(_0x70663){_0x2217f5[_0x6832('0x3d')]=_0x70663;if(_0x27e10f[_0x6832('0x2c')][_0x6832('0x3e')]){_0x2c03bd[_0x6832('0x3f')]=[{'all':!![]}];}return db[_0x6832('0x26')][_0x6832('0x40')](_0x2c03bd);})[_0x6832('0x22')](function(_0x4d2149){_0x2217f5['rows']=_0x4d2149;return _0x2217f5;})[_0x6832('0x22')](respondWithFilteredResult(_0x231dda,_0x2c03bd))['catch'](handleError(_0x231dda,null));};exports[_0x6832('0x41')]=function(_0x43dfd9,_0x4be646){var _0xd5373f={'raw':!![],'where':{'id':_0x43dfd9[_0x6832('0x42')]['id']}},_0x503769={};_0x503769['model']=_[_0x6832('0x2d')](db['OpenchannelApplication'][_0x6832('0x27')]);_0x503769[_0x6832('0x2c')]=_['keys'](_0x43dfd9[_0x6832('0x2c')]);_0x503769['filters']=_[_0x6832('0x2f')](_0x503769[_0x6832('0x2a')],_0x503769[_0x6832('0x2c')]);_0xd5373f[_0x6832('0x30')]=_[_0x6832('0x2f')](_0x503769[_0x6832('0x2a')],qs['fields'](_0x43dfd9[_0x6832('0x2c')][_0x6832('0x31')]));_0xd5373f[_0x6832('0x30')]=_0xd5373f[_0x6832('0x30')][_0x6832('0x32')]?_0xd5373f[_0x6832('0x30')]:_0x503769[_0x6832('0x2a')];if(_0x43dfd9[_0x6832('0x2c')]['includeAll']){_0xd5373f[_0x6832('0x3f')]=[{'all':!![]}];}_0xd5373f=_['merge']({},_0xd5373f,_0x43dfd9[_0x6832('0x3c')]);return db[_0x6832('0x26')][_0x6832('0x43')](_0xd5373f)['then'](handleEntityNotFound(_0x4be646,null))[_0x6832('0x22')](respondWithResult(_0x4be646,null))[_0x6832('0x44')](handleError(_0x4be646,null));};exports[_0x6832('0x45')]=function(_0x5b02ba,_0x44dd75){return db[_0x6832('0x26')][_0x6832('0x45')](_0x5b02ba[_0x6832('0x46')],{})[_0x6832('0x22')](respondWithResult(_0x44dd75,0xc9))[_0x6832('0x44')](handleError(_0x44dd75,null));};exports['update']=function(_0x5474b9,_0x1aa082){if(_0x5474b9[_0x6832('0x46')]['id']){delete _0x5474b9['body']['id'];}return db['OpenchannelApplication']['find']({'where':{'id':_0x5474b9[_0x6832('0x42')]['id']}})[_0x6832('0x22')](handleEntityNotFound(_0x1aa082,null))['then'](saveUpdates(_0x5474b9[_0x6832('0x46')],null))['then'](respondWithResult(_0x1aa082,null))['catch'](handleError(_0x1aa082,null));};exports[_0x6832('0x47')]=function(_0x1ee9b4,_0x4c666f){return db[_0x6832('0x26')][_0x6832('0x43')]({'where':{'id':_0x1ee9b4[_0x6832('0x42')]['id']}})[_0x6832('0x22')](handleEntityNotFound(_0x4c666f,null))['then'](removeEntity(_0x4c666f,null))[_0x6832('0x44')](handleError(_0x4c666f,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index a16e1ed..780b451 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 _0xc800=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelApplication.attributes','define','OpenchannelApplication','openchannel_applications','utf8mb4','lodash','util','../../config/logger'];(function(_0x2be30b,_0x362c2c){var _0x5c92c3=function(_0x2fa651){while(--_0x2fa651){_0x2be30b['push'](_0x2be30b['shift']());}};_0x5c92c3(++_0x362c2c);}(_0xc800,0x183));var _0x0c80=function(_0x51bb38,_0x4e57a0){_0x51bb38=_0x51bb38-0x0;var _0x51c09b=_0xc800[_0x51bb38];return _0x51c09b;};'use strict';var _=require(_0x0c80('0x0'));var util=require(_0x0c80('0x1'));var logger=require(_0x0c80('0x2'))(_0x0c80('0x3'));var moment=require(_0x0c80('0x4'));var BPromise=require(_0x0c80('0x5'));var rp=require(_0x0c80('0x6'));var fs=require('fs');var path=require(_0x0c80('0x7'));var rimraf=require(_0x0c80('0x8'));var config=require(_0x0c80('0x9'));var attributes=require(_0x0c80('0xa'));module['exports']=function(_0x199d7b,_0x60d04a){return _0x199d7b[_0x0c80('0xb')](_0x0c80('0xc'),attributes,{'tableName':_0x0c80('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0c80('0xe'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x2922=['./openchannelApplication.attributes','exports','OpenchannelApplication','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x317db7,_0x337533){var _0x24f5ea=function(_0xe8febc){while(--_0xe8febc){_0x317db7['push'](_0x317db7['shift']());}};_0x24f5ea(++_0x337533);}(_0x2922,0x154));var _0x2292=function(_0x13b96a,_0x28abcb){_0x13b96a=_0x13b96a-0x0;var _0x1bc212=_0x2922[_0x13b96a];return _0x1bc212;};'use strict';var _=require(_0x2292('0x0'));var util=require(_0x2292('0x1'));var logger=require(_0x2292('0x2'))(_0x2292('0x3'));var moment=require(_0x2292('0x4'));var BPromise=require(_0x2292('0x5'));var rp=require(_0x2292('0x6'));var fs=require('fs');var path=require(_0x2292('0x7'));var rimraf=require(_0x2292('0x8'));var config=require(_0x2292('0x9'));var attributes=require(_0x2292('0xa'));module[_0x2292('0xb')]=function(_0x504400,_0x25ba0e){return _0x504400['define'](_0x2292('0xc'),attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x2292('0xd')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index bc49e78..db5b7ac 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(_0x139adf,_0x58f868){var _0x2fbf85=function(_0x14403e){while(--_0x14403e){_0x139adf['push'](_0x139adf['shift']());}};_0x2fbf85(++_0x58f868);}(_0xb10b,0x12a));var _0xbb10=function(_0x53aaf8,_0x863bcb){_0x53aaf8=_0x53aaf8-0x0;var _0x1fedb1=_0xb10b[_0x53aaf8];return _0x1fedb1;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1b')]||null:null,'limit':_0x378da8['options']?_0x378da8['options'][_0xbb10('0x1c')]||null:null})[_0xbb10('0xc')](function(_0x2e911d){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1d')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2e911d));_0x575cca(_0x2e911d);})[_0xbb10('0x1e')](function(_0x395404){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x395404['message'],_0x378da8);_0x30efc6(_0x1682a4['error'](0x1f4,_0x395404['message']));});});}; \ No newline at end of file +var _0xd8b0=['OpenchannelApplication','body','options','raw','where','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateOpenchannelApplication'];(function(_0x23c6f2,_0x4e033c){var _0x4c270b=function(_0x4913f0){while(--_0x4913f0){_0x23c6f2['push'](_0x23c6f2['shift']());}};_0x4c270b(++_0x4e033c);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});}exports[_0x0d8b('0x16')]=function(_0x5fecbd){var _0x333674=this;return new Promise(function(_0x18dd2d,_0x264b39){return db[_0x0d8b('0x17')]['update'](_0x5fecbd[_0x0d8b('0x18')],{'raw':_0x5fecbd[_0x0d8b('0x19')]?_0x5fecbd[_0x0d8b('0x19')][_0x0d8b('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5fecbd[_0x0d8b('0x19')]?_0x5fecbd[_0x0d8b('0x19')][_0x0d8b('0x1b')]||null:null,'attributes':_0x5fecbd[_0x0d8b('0x19')]?_0x5fecbd['options']['attributes']||null:null,'limit':_0x5fecbd[_0x0d8b('0x19')]?_0x5fecbd['options']['limit']||null:null})['then'](function(_0x238728){logger[_0x0d8b('0xb')](_0x0d8b('0x16'),_0x5fecbd);logger[_0x0d8b('0xe')](_0x0d8b('0x16'),_0x5fecbd,JSON[_0x0d8b('0x10')](_0x238728));_0x18dd2d(_0x238728);})[_0x0d8b('0x15')](function(_0x4562cb){logger[_0x0d8b('0x11')]('UpdateOpenchannelApplication',_0x4562cb[_0x0d8b('0x13')],_0x5fecbd);_0x264b39(_0x333674[_0x0d8b('0x11')](0x1f4,_0x4562cb['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 969a91a..66b6a41 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 _0x52ac=['express','Router','../../components/auth/service','../../components/interaction/service','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','create','post','/:id/tags','tracked','openchannelinteraction:addtags','openchannel','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','removeTags','exports','multer','path','connect-timeout'];(function(_0x2a048c,_0x5afcc1){var _0x182f87=function(_0x1df72c){while(--_0x1df72c){_0x2a048c['push'](_0x2a048c['shift']());}};_0x182f87(++_0x5afcc1);}(_0x52ac,0x1af));var _0xc52a=function(_0x261b84,_0x5bda10){_0x261b84=_0x261b84-0x0;var _0x1fcf21=_0x52ac[_0x261b84];return _0x1fcf21;};'use strict';var multer=require(_0xc52a('0x0'));var util=require('util');var path=require(_0xc52a('0x1'));var timeout=require(_0xc52a('0x2'));var express=require(_0xc52a('0x3'));var router=express[_0xc52a('0x4')]();var auth=require(_0xc52a('0x5'));var interaction=require(_0xc52a('0x6'));var config=require('../../config/environment');var controller=require(_0xc52a('0x7'));router[_0xc52a('0x8')]('/',auth[_0xc52a('0x9')](),controller[_0xc52a('0xa')]);router['get'](_0xc52a('0xb'),auth[_0xc52a('0x9')](),controller[_0xc52a('0xc')]);router['get'](_0xc52a('0xd'),auth['isAuthenticated'](),controller[_0xc52a('0xe')]);router[_0xc52a('0x8')](_0xc52a('0xf'),auth[_0xc52a('0x9')](),controller[_0xc52a('0x10')]);router[_0xc52a('0x8')](_0xc52a('0x11'),auth[_0xc52a('0x9')](),controller[_0xc52a('0x12')]);router['post']('/',auth[_0xc52a('0x9')](),controller[_0xc52a('0x13')]);router['post'](_0xc52a('0xf'),auth[_0xc52a('0x9')](),controller['addMessage']);router[_0xc52a('0x14')](_0xc52a('0x15'),auth[_0xc52a('0x9')](),interaction[_0xc52a('0x16')]('openchannel',_0xc52a('0x17')),controller['addTags']);router['put'](_0xc52a('0xd'),auth[_0xc52a('0x9')](),interaction[_0xc52a('0x16')](_0xc52a('0x18'),_0xc52a('0x19')),controller[_0xc52a('0x1a')]);router[_0xc52a('0x1b')](_0xc52a('0xd'),auth['isAuthenticated'](),interaction[_0xc52a('0x16')]('openchannel',_0xc52a('0x1c')),controller['destroy']);router[_0xc52a('0x1b')]('/:id/tags',auth[_0xc52a('0x9')](),controller[_0xc52a('0x1d')]);module[_0xc52a('0x1e')]=router; \ No newline at end of file +var _0x24c3=['/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','put','update','delete','openchannelinteraction:destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','create','post'];(function(_0x43fdf8,_0x8426b3){var _0x1160c6=function(_0x281fb6){while(--_0x281fb6){_0x43fdf8['push'](_0x43fdf8['shift']());}};_0x1160c6(++_0x8426b3);}(_0x24c3,0x87));var _0x324c=function(_0x9f8acc,_0x4c7cf1){_0x9f8acc=_0x9f8acc-0x0;var _0x47ac9c=_0x24c3[_0x9f8acc];return _0x47ac9c;};'use strict';var multer=require(_0x324c('0x0'));var util=require(_0x324c('0x1'));var path=require(_0x324c('0x2'));var timeout=require(_0x324c('0x3'));var express=require(_0x324c('0x4'));var router=express[_0x324c('0x5')]();var auth=require(_0x324c('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x324c('0x7'));var controller=require(_0x324c('0x8'));router[_0x324c('0x9')]('/',auth[_0x324c('0xa')](),controller['index']);router['get']('/describe',auth[_0x324c('0xa')](),controller[_0x324c('0xb')]);router['get'](_0x324c('0xc'),auth[_0x324c('0xa')](),controller[_0x324c('0xd')]);router[_0x324c('0x9')](_0x324c('0xe'),auth[_0x324c('0xa')](),controller[_0x324c('0xf')]);router[_0x324c('0x9')](_0x324c('0x10'),auth[_0x324c('0xa')](),controller[_0x324c('0x11')]);router['post']('/',auth[_0x324c('0xa')](),controller[_0x324c('0x12')]);router[_0x324c('0x13')](_0x324c('0xe'),auth['isAuthenticated'](),controller['addMessage']);router[_0x324c('0x13')](_0x324c('0x14'),auth[_0x324c('0xa')](),interaction[_0x324c('0x15')](_0x324c('0x16'),_0x324c('0x17')),controller[_0x324c('0x18')]);router[_0x324c('0x19')](_0x324c('0xc'),auth[_0x324c('0xa')](),interaction[_0x324c('0x15')](_0x324c('0x16'),'openchannelinteraction:update'),controller[_0x324c('0x1a')]);router[_0x324c('0x1b')](_0x324c('0xc'),auth[_0x324c('0xa')](),interaction[_0x324c('0x15')](_0x324c('0x16'),_0x324c('0x1c')),controller['destroy']);router[_0x324c('0x1b')]('/:id/tags',auth[_0x324c('0xa')](),controller[_0x324c('0x1d')]);module[_0x324c('0x1e')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 9538515..0979708 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 _0x5305=['out','sequelize','exports','BOOLEAN','STRING'];(function(_0x109dec,_0x2b66cd){var _0x482501=function(_0xd08839){while(--_0xd08839){_0x109dec['push'](_0x109dec['shift']());}};_0x482501(++_0x2b66cd);}(_0x5305,0xfb));var _0x5530=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x5305[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0x5530('0x0'));module[_0x5530('0x1')]={'closed':{'type':Sequelize[_0x5530('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x5530('0x3')]},'note':{'type':Sequelize[_0x5530('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0x5530('0x3')]},'externalUrl':{'type':Sequelize[_0x5530('0x3')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x5530('0x4')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x5530('0x3')]}}; \ No newline at end of file +var _0x73ef=['exports','BOOLEAN','DATE','STRING','ENUM','out','sequelize'];(function(_0x495f9f,_0x5d7c37){var _0x1fa1cf=function(_0x55d6ad){while(--_0x55d6ad){_0x495f9f['push'](_0x495f9f['shift']());}};_0x1fa1cf(++_0x5d7c37);}(_0x73ef,0xdf));var _0xf73e=function(_0x29b719,_0x21578e){_0x29b719=_0x29b719-0x0;var _0xab86b0=_0x73ef[_0x29b719];return _0xab86b0;};'use strict';var Sequelize=require(_0xf73e('0x0'));module[_0xf73e('0x1')]={'closed':{'type':Sequelize[_0xf73e('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xf73e('0x3')]},'disposition':{'type':Sequelize[_0xf73e('0x4')]},'note':{'type':Sequelize[_0xf73e('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0xf73e('0x4')]},'externalUrl':{'type':Sequelize[_0xf73e('0x4')]},'lastMsgAt':{'type':Sequelize[_0xf73e('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xf73e('0x5')]('in',_0xf73e('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 60faa9f..cba800d 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 _0x4f7e=['offset','limit','apply','reject','save','update','then','stack','map','fullname','TagIds','split','forEach','Tags','catch','index','fieldName','type','name','keys','query','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','select','field','from','tools_tags','u.id','u.fullname','ui.OpenchannelInteractionId','left_join','u.id\x20=\x20ui.UserId','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','expr','search','parseSearch','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','UserId','body','some','compact','isEmpty','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','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)','group','i.id','Sequelize','QueryTypes','SELECT','clone','DESC','t.id\x20IN\x20?','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','toString','count','merge','OpenchannelInteraction','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','Contact.firstName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','rows','show','rawAttributes','options','create','params','destroy','describe','addMessage','OpenchannelMessage','ids','omit','getMessages','hasOwnProperty','YYYY-MM-DD\x20HH:mm:ss','includeAll','addTags','setTags','spread','findAll','color','emit','removeTags','download','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','push','firstName','lastName','Attachment','Messages','secret','OpenchannelAccount','Owner','get','40px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','30px','format','%s\x20#%d','Openchannel','Account','N.A.','closed','Public','Private','basename','existsSync','createReadStream','pipe','createWriteStream','out','direction','renderFile','views','toFile','.pdf','log','sendStatus','eml-format','rimraf','zip-dir','moment','bluebird','mustache','sox','to-csv','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelInteraction.socket','end','status','json'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4f7e,0x1a4));var _0xe4f7=function(_0x437d98,_0x5d844e){_0x437d98=_0x437d98-0x0;var _0x265b77=_0x4f7e[_0x437d98];return _0x265b77;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xe4f7('0x0'));var rimraf=require(_0xe4f7('0x1'));var zipdir=require(_0xe4f7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe4f7('0x3'));var BPromise=require(_0xe4f7('0x4'));var Mustache=require(_0xe4f7('0x5'));var util=require('util');var path=require('path');var sox=require(_0xe4f7('0x6'));var csv=require(_0xe4f7('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xe4f7('0x8'));var squel=require('squel');var crypto=require(_0xe4f7('0x9'));var jsforce=require(_0xe4f7('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xe4f7('0x7'));var querystring=require(_0xe4f7('0xb'));var Papa=require(_0xe4f7('0xc'));var Redis=require(_0xe4f7('0xd'));var authService=require(_0xe4f7('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xe4f7('0xf'));var hardwareService=require(_0xe4f7('0x10'));var logger=require(_0xe4f7('0x11'))(_0xe4f7('0x12'));var utils=require('../../config/utils');var config=require(_0xe4f7('0x13'));var db=require(_0xe4f7('0x14'))['db'];config[_0xe4f7('0x15')]=_[_0xe4f7('0x16')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xe4f7('0x17'))(new Redis(config[_0xe4f7('0x15')]));require(_0xe4f7('0x18'))['register'](socket);function respondWithStatusCode(_0x2b6865,_0x299e5e){_0x299e5e=_0x299e5e||0xcc;return function(_0xadada5){if(_0xadada5){return _0x2b6865['sendStatus'](_0x299e5e);}return _0x2b6865['status'](_0x299e5e)[_0xe4f7('0x19')]();};}function respondWithResult(_0x3490f5,_0xdb87ef){_0xdb87ef=_0xdb87ef||0xc8;return function(_0x48e11b){if(_0x48e11b){return _0x3490f5[_0xe4f7('0x1a')](_0xdb87ef)[_0xe4f7('0x1b')](_0x48e11b);}};}function respondWithFilteredResult(_0x1daade,_0x3aca6a){return function(_0x544927){if(_0x544927){var _0xcb6b59=_0x544927['count'],_0x4c8cc5=_0x3aca6a['offset'],_0x4ca80e=_0x3aca6a[_0xe4f7('0x1c')]+_0x3aca6a[_0xe4f7('0x1d')],_0x5c6745;if(_0x4ca80e>=_0xcb6b59){_0x4ca80e=_0xcb6b59;_0x5c6745=0xc8;}else{_0x5c6745=0xce;}_0x1daade[_0xe4f7('0x1a')](_0x5c6745);return _0x1daade['set']('Content-Range',_0x4c8cc5+'-'+_0x4ca80e+'/'+_0xcb6b59)[_0xe4f7('0x1b')](_0x544927);}return null;};}function patchUpdates(_0xff9b80){return function(_0x425fcc){try{jsonpatch[_0xe4f7('0x1e')](_0x425fcc,_0xff9b80,!![]);}catch(_0x247ffc){return BPromise[_0xe4f7('0x1f')](_0x247ffc);}return _0x425fcc[_0xe4f7('0x20')]();};}function saveUpdates(_0x5ab7a6,_0x343363){return function(_0x536162){if(_0x536162){return _0x536162[_0xe4f7('0x21')](_0x5ab7a6)['then'](function(_0x1fbdc2){return _0x1fbdc2;});}return null;};}function removeEntity(_0x31839a,_0x1c9377){return function(_0x2fb93d){if(_0x2fb93d){return _0x2fb93d['destroy']()[_0xe4f7('0x22')](function(){_0x31839a[_0xe4f7('0x1a')](0xcc)[_0xe4f7('0x19')]();});}};}function handleEntityNotFound(_0x1e1cc5,_0x3e3604){return function(_0x5a0154){if(!_0x5a0154){_0x1e1cc5['sendStatus'](0x194);}return _0x5a0154;};}function handleError(_0x84a41d,_0x190fb8){_0x190fb8=_0x190fb8||0x1f4;return function(_0x32bc10){logger['error'](_0x32bc10[_0xe4f7('0x23')]);if(_0x32bc10['name']){delete _0x32bc10['name'];}_0x84a41d[_0xe4f7('0x1a')](_0x190fb8)['send'](_0x32bc10);};}function getInteractionUsers(_0x2730f5,_0x4058d3){return new BPromise(function(_0x488b86,_0x2029e9){try{if(_0x4058d3[_0x2730f5['id']]){_0x2730f5['Users']=_[_0xe4f7('0x24')](_0x4058d3[_0x2730f5['id']],function(_0x541479){return{'id':_0x541479['id'],'fullname':_0x541479[_0xe4f7('0x25')]};});}}catch(_0x141a3c){_0x2029e9(_0x141a3c);}_0x488b86(_0x2730f5);});}function getInteractionTags(_0x33626c,_0x264a06){return new BPromise(function(_0x356e96,_0x5ede21){try{if(_0x33626c[_0xe4f7('0x26')]){_0x33626c['Tags']=[];_0x33626c[_0xe4f7('0x26')][_0xe4f7('0x27')](',')[_0xe4f7('0x28')](function(_0x331bc8){_0x33626c[_0xe4f7('0x29')]['push'](_0x264a06[_0x331bc8]);});}delete _0x33626c[_0xe4f7('0x26')];}catch(_0x3575c0){_0x5ede21(_0x3575c0);}_0x356e96(_0x33626c);});}function updateOpenchannelInteraction(_0x19373a,_0x56bf0b,_0x1fee9f){return new BPromise(function(_0x4bf337,_0x25e005){return getInteractionUsers(_0x19373a,_0x1fee9f)[_0xe4f7('0x22')](function(_0x1ef135){return getInteractionTags(_0x1ef135,_0x56bf0b);})['then'](function(_0x5a8442){_0x4bf337(_0x5a8442);})[_0xe4f7('0x2a')](function(_0x362fa4){_0x25e005(_0x362fa4);});});}exports[_0xe4f7('0x2b')]=function(_0x19dc32,_0x56b405){var _0x2991a0={},_0x2b9daa={},_0x289a1d={'count':0x0,'rows':[]};var _0x1600d1=_[_0xe4f7('0x24')](db['OpenchannelInteraction']['rawAttributes'],function(_0x29aa55){return{'name':_0x29aa55[_0xe4f7('0x2c')],'type':_0x29aa55[_0xe4f7('0x2d')]['key']};});_0x2b9daa['model']=_['map'](_0x1600d1,_0xe4f7('0x2e'));_0x2b9daa['query']=_[_0xe4f7('0x2f')](_0x19dc32[_0xe4f7('0x30')]);_0x2b9daa[_0xe4f7('0x31')]=_[_0xe4f7('0x32')](_0x2b9daa['model'],_0x2b9daa[_0xe4f7('0x30')]);_0x2991a0['attributes']=_[_0xe4f7('0x32')](_0x2b9daa[_0xe4f7('0x33')],qs[_0xe4f7('0x34')](_0x19dc32['query'][_0xe4f7('0x34')]));_0x2991a0[_0xe4f7('0x35')]=_0x2991a0['attributes'][_0xe4f7('0x36')]?_0x2991a0[_0xe4f7('0x35')]:_0x2b9daa['model'];if(!_0x19dc32['query']['hasOwnProperty'](_0xe4f7('0x37'))){_0x2991a0[_0xe4f7('0x1d')]=qs[_0xe4f7('0x1d')](_0x19dc32['query'][_0xe4f7('0x1d')]);_0x2991a0['offset']=qs['offset'](_0x19dc32[_0xe4f7('0x30')][_0xe4f7('0x1c')]);}_0x2991a0[_0xe4f7('0x38')]=qs[_0xe4f7('0x39')](_0x19dc32['query'][_0xe4f7('0x39')]);_0x2991a0[_0xe4f7('0x3a')]=qs['filters'](_[_0xe4f7('0x3b')](_0x19dc32[_0xe4f7('0x30')],_0x2b9daa['filters']));var _0x555a1e=[];var _0x53ccf2=squel[_0xe4f7('0x3c')]()[_0xe4f7('0x3d')]('id')[_0xe4f7('0x3d')](_0xe4f7('0x2e'))[_0xe4f7('0x3d')]('color')[_0xe4f7('0x3e')](_0xe4f7('0x3f'));var _0x52713a=squel[_0xe4f7('0x3c')]()[_0xe4f7('0x3d')](_0xe4f7('0x40'))['field'](_0xe4f7('0x41'))[_0xe4f7('0x3d')](_0xe4f7('0x42'))['from']('user_has_openchannel_interactions','ui')[_0xe4f7('0x43')]('users','u',_0xe4f7('0x44'));var _0x1248d8=squel[_0xe4f7('0x3c')]()['from']('openchannel_interactions','i')[_0xe4f7('0x43')]('cm_contacts','c',_0xe4f7('0x45'))[_0xe4f7('0x43')](_0xe4f7('0x46'),'o',_0xe4f7('0x47'))[_0xe4f7('0x43')]('openchannel_accounts','a','a.id\x20=\x20i.OpenchannelAccountId')[_0xe4f7('0x43')](_0xe4f7('0x48'),'me',_0xe4f7('0x49'))['left_join'](_0xe4f7('0x4a'),'it',_0xe4f7('0x4b'))['left_join'](_0xe4f7('0x3f'),'t','t.id\x20=\x20it.TagId');var _0x1e8980=squel[_0xe4f7('0x4c')]();var _0x26be1f=[];var _0x3b5e34=squel['expr']();var _0x5ca0e4;if(_0x19dc32[_0xe4f7('0x30')][_0xe4f7('0x4d')]){_0x5ca0e4=as[_0xe4f7('0x4e')](_0x19dc32[_0xe4f7('0x30')][_0xe4f7('0x4d')]);var _0x13364b=_0x5ca0e4[_0xe4f7('0x4f')];for(var _0x56c720=0x0;_0x56c720<_0x5ca0e4[_0xe4f7('0x50')]['length'];_0x56c720++){var _0x23068e=_0x5ca0e4[_0xe4f7('0x50')][_0x56c720];var _0xb5160='i';var _0x4da3ae=_[_0xe4f7('0x51')](_0x1600d1,[_0xe4f7('0x2e'),_0x23068e[_0xe4f7('0x3d')]]);if(!_0x4da3ae){switch(_0x23068e[_0xe4f7('0x3d')]){case _0xe4f7('0x52'):if(_0x23068e[_0xe4f7('0x53')]==0x1){_0x1248d8[_0xe4f7('0x54')]('`'+_0x23068e[_0xe4f7('0x3d')]+_0xe4f7('0x55'));}else{_0x1248d8[_0xe4f7('0x54')]('`'+_0x23068e['field']+'`\x20>\x200');}break;case _0xe4f7('0x56'):if(_0x23068e['operator']===_0xe4f7('0x57')){if(_0x23068e[_0xe4f7('0x53')]['split']('\x20')[_0xe4f7('0x36')]>0x1){_0x1e8980[_0x13364b](_0xe4f7('0x58'),qs[_0xe4f7('0x59')](_0x23068e[_0xe4f7('0x53')]),null);}else{var _0x401f86='%'+_0x23068e[_0xe4f7('0x53')]+'%';_0x1e8980[_0x13364b](_0xe4f7('0x5a'),_0x401f86,_0x401f86,_0x401f86);}}else{_0x4da3ae=_[_0xe4f7('0x51')](_0x1600d1,[_0xe4f7('0x2e'),_0xe4f7('0x5b')]);_0x23068e[_0xe4f7('0x3d')]=_0xe4f7('0x5b');_0x5c4d15=as[_0xe4f7('0x5c')](_0xb5160,_0x4da3ae['type'],_0x23068e);_0x1e8980[_0x13364b](_0x5c4d15[_0xe4f7('0x5d')],_0x5c4d15[_0xe4f7('0x53')][_0xe4f7('0x5e')],_0x5c4d15['value']['end']);}break;case _0xe4f7('0x5f'):var _0x102c98=_0x23068e[_0xe4f7('0x53')]['split'](',')[_0xe4f7('0x24')](function(_0x77b952){return Number(_0x77b952);});_0x102c98[_0xe4f7('0x28')](function(_0x21a39f){_0x3b5e34['or'](_0xe4f7('0x60'),'%,'+_0x21a39f+',%');});_0x26be1f=_[_0xe4f7('0x61')](_0x26be1f,_0x102c98);break;case _0xe4f7('0x62'):if(_0x23068e['operator']===_0xe4f7('0x57')){_0x1e8980[_0x13364b]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x23068e[_0xe4f7('0x53')]+'%',null);}else{_0x4da3ae=_[_0xe4f7('0x51')](_0x1600d1,[_0xe4f7('0x2e'),_0xe4f7('0x63')]);_0x23068e[_0xe4f7('0x3d')]=_0xe4f7('0x63');_0x5c4d15=as[_0xe4f7('0x5c')](_0xb5160,_0x4da3ae[_0xe4f7('0x2d')],_0x23068e);_0x1e8980[_0x13364b](_0x5c4d15[_0xe4f7('0x5d')],_0x5c4d15['value'][_0xe4f7('0x5e')],_0x5c4d15[_0xe4f7('0x53')]['end']);}break;case _0xe4f7('0x64'):_0x5c4d15=as['buildExpression']('me',null,_0x23068e);_0x1e8980[_0x13364b](_0x5c4d15[_0xe4f7('0x5d')],_0x5c4d15[_0xe4f7('0x53')][_0xe4f7('0x5e')],_0x5c4d15[_0xe4f7('0x53')][_0xe4f7('0x19')]);break;}}else{var _0x5c4d15=as['buildExpression'](_0xb5160,_0x4da3ae[_0xe4f7('0x2d')],_0x23068e);_0x1e8980[_0x13364b](_0x5c4d15[_0xe4f7('0x5d')],_0x5c4d15[_0xe4f7('0x53')]['start'],_0x5c4d15[_0xe4f7('0x53')][_0xe4f7('0x19')]);}}}else{var _0xdb4543=_(_0x19dc32[_0xe4f7('0x30')])[_0xe4f7('0x2f')]()[_0xe4f7('0x24')](function(_0xac7808){return _[_0xe4f7('0x65')](_0x1600d1,['name',_0xac7808])?_0xac7808:undefined;})[_0xe4f7('0x66')]()['value']();if(!_[_0xe4f7('0x67')](_0xdb4543)){_0xdb4543[_0xe4f7('0x28')](function(_0x4a7978){if(_0x4a7978===_0xe4f7('0x68')){_0x1248d8[_0xe4f7('0x3a')](_0xe4f7('0x69'),[][_0xe4f7('0x6a')](_0x19dc32[_0xe4f7('0x30')][_0x4a7978]));}else if(_0x4a7978===_0xe4f7('0x6b')){var _0x3efca5=JSON[_0xe4f7('0x6c')](_0x19dc32[_0xe4f7('0x30')][_0x4a7978])[_0xe4f7('0x6d')];var _0x55d05d=JSON[_0xe4f7('0x6c')](_0x19dc32[_0xe4f7('0x30')][_0x4a7978])[_0xe4f7('0x6e')];_0x1248d8[_0xe4f7('0x3a')](_0xe4f7('0x6f'),_0x3efca5,_0x55d05d);}else{if(_0x19dc32[_0xe4f7('0x30')][_0x4a7978]===_0xe4f7('0x70')){_0x1248d8[_0xe4f7('0x3a')]('i.'+_0x4a7978+_0xe4f7('0x71'));}else{_0x1248d8[_0xe4f7('0x3a')]('i.'+_0x4a7978+'\x20=\x20?',_0x19dc32[_0xe4f7('0x30')][_0x4a7978]);}}});}if(_0x19dc32['query'][_0xe4f7('0x72')]){if(_0x19dc32['query'][_0xe4f7('0x72')]==0x1){_0x1248d8[_0xe4f7('0x54')](_0xe4f7('0x73'));}else{_0x1248d8[_0xe4f7('0x54')](_0xe4f7('0x74'));}}if(_0x19dc32[_0xe4f7('0x30')][_0xe4f7('0x75')]){_0x26be1f=_[_0xe4f7('0x76')](_0x19dc32[_0xe4f7('0x30')]['tag'])?_0x19dc32[_0xe4f7('0x30')][_0xe4f7('0x75')]:new Array(_0x19dc32[_0xe4f7('0x30')][_0xe4f7('0x75')]);_0x26be1f[_0xe4f7('0x28')](function(_0x976cec){_0x3b5e34['or'](_0xe4f7('0x60'),'%,'+_0x976cec+',%');});}if(_0x19dc32[_0xe4f7('0x30')]['filter']){var _0x22bcb9=_0x19dc32[_0xe4f7('0x30')][_0xe4f7('0x77')][_0xe4f7('0x78')]('\x5c','\x5c\x5c')['replace']('\x27\x27',_0xe4f7('0x79'));if(qs[_0xe4f7('0x7a')](_0x22bcb9)){_0x1e8980['or'](_0xe4f7('0x7b'),_0x22bcb9+'%');}else{_0x1e8980['or'](_0xe4f7('0x7c'),qs[_0xe4f7('0x59')](_0x22bcb9))['or']('i.from\x20LIKE\x20?',_0x22bcb9+'%')['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x22bcb9+'%');}}}_0x1248d8['where'](_0x1e8980);_0x1248d8[_0xe4f7('0x7d')](_0xe4f7('0x7e'));var _0x48cba9={'type':db[_0xe4f7('0x7f')][_0xe4f7('0x80')][_0xe4f7('0x81')],'raw':!![]};var _0x537e30=_0x1248d8[_0xe4f7('0x82')]();_0x537e30[_0xe4f7('0x3d')](_0xe4f7('0x7e'));_0x537e30[_0xe4f7('0x3d')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xe4f7('0x52'));if(_0x2991a0['order']){_0x2991a0[_0xe4f7('0x38')]['forEach'](function(_0x4a44da){_0x1248d8[_0xe4f7('0x38')]('i.'+_0x4a44da[0x0],_0x4a44da[0x1]===_0xe4f7('0x83')?![]:!![]);});}if(!_[_0xe4f7('0x67')](_0x26be1f)){_0x1248d8[_0xe4f7('0x54')](_0x3b5e34);_0x537e30[_0xe4f7('0x3a')](_0xe4f7('0x84'),_0x26be1f);}BPromise[_0xe4f7('0x85')]()[_0xe4f7('0x22')](function(){if(!_0x5ca0e4){if(_0x19dc32[_0xe4f7('0x30')][_0xe4f7('0x68')]||_0x19dc32[_0xe4f7('0x30')]['journey'])return;_0x537e30['where']('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');_0x1248d8[_0xe4f7('0x3a')](_0xe4f7('0x86'));return;}return _0x19dc32[_0xe4f7('0x87')]['getOpenchannelAccounts']({'attributes':['id'],'raw':!![]})[_0xe4f7('0x22')](function(_0x38a036){if(_[_0xe4f7('0x67')](_0x38a036)){_0x537e30[_0xe4f7('0x3a')]('i.OpenchannelAccountId\x20IS\x20NULL');_0x1248d8[_0xe4f7('0x3a')](_0xe4f7('0x88'));}else{_0x537e30[_0xe4f7('0x3a')](_0xe4f7('0x69'),_[_0xe4f7('0x24')](_0x38a036,'id'));_0x1248d8[_0xe4f7('0x3a')](_0xe4f7('0x69'),_[_0xe4f7('0x24')](_0x38a036,'id'));}});})[_0xe4f7('0x22')](function(){db[_0xe4f7('0x89')][_0xe4f7('0x30')](_0x537e30[_0xe4f7('0x8a')](),_0x48cba9)[_0xe4f7('0x22')](function(_0x4ba558){_0x289a1d['count']=_0x4ba558[_0xe4f7('0x36')];if(_0x289a1d[_0xe4f7('0x8b')]===0x0)return[];return db['sequelize']['query'](_0x53ccf2[_0xe4f7('0x8a')](),_0x48cba9)['then'](function(_0x518486){_0x555a1e=_['keyBy'](_0x518486,'id');_0x48cba9=_[_0xe4f7('0x8c')](_0x48cba9,{'model':db[_0xe4f7('0x8d')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x19dc32[_0xe4f7('0x30')][_0xe4f7('0x34')]){_0x2991a0['attributes'][_0xe4f7('0x28')](function(_0x2a600e){_0x1248d8[_0xe4f7('0x3d')]('i.'+_0x2a600e);});}else{_0x1248d8[_0xe4f7('0x3d')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xe4f7('0x52'));_0x1248d8[_0xe4f7('0x3d')](_0xe4f7('0x8e'),_0xe4f7('0x8f'));_0x1248d8[_0xe4f7('0x3d')](_0xe4f7('0x90'),_0xe4f7('0x91'));_0x1248d8['field']('i.*');_0x1248d8['field']('c.firstName',_0xe4f7('0x92'));_0x1248d8[_0xe4f7('0x3d')]('c.lastName',_0xe4f7('0x93'));_0x1248d8[_0xe4f7('0x3d')]('c.email',_0xe4f7('0x94'));_0x1248d8['field'](_0xe4f7('0x95'),_0xe4f7('0x96'));_0x1248d8[_0xe4f7('0x3d')](_0xe4f7('0x97'),_0xe4f7('0x98'));_0x1248d8['field'](_0xe4f7('0x99'),'Contact.fax');_0x1248d8[_0xe4f7('0x3d')](_0xe4f7('0x9a'),_0xe4f7('0x9b'));_0x1248d8[_0xe4f7('0x3d')]('o.internal',_0xe4f7('0x9c'));_0x1248d8['field'](_0xe4f7('0x9d'),_0xe4f7('0x26'));}_0x1248d8['limit'](_0x2991a0[_0xe4f7('0x1d')]);_0x1248d8['offset'](_0x2991a0['offset']);return db['sequelize'][_0xe4f7('0x30')](_0x1248d8[_0xe4f7('0x8a')](),_0x48cba9);})[_0xe4f7('0x22')](function(_0x4ffc68){_0x52713a['where'](_0xe4f7('0x9e'),_[_0xe4f7('0x24')](_0x4ffc68,'id'));return db[_0xe4f7('0x89')]['query'](_0x52713a['toString'](),_0x48cba9)[_0xe4f7('0x22')](function(_0x37419f){var _0x390c9a=_[_0xe4f7('0x9f')](_0x37419f,'OpenchannelInteractionId');var _0x3642ca=[];_0x4ffc68['forEach'](function(_0x40b087){_0x3642ca['push'](updateOpenchannelInteraction(_0x40b087,_0x555a1e,_0x390c9a));});return BPromise['all'](_0x3642ca);});});})['then'](function(_0x3507a0){_0x289a1d[_0xe4f7('0xa0')]=_0x3507a0;return _0x289a1d;})['then'](respondWithFilteredResult(_0x56b405,_0x2991a0));})[_0xe4f7('0x2a')](handleError(_0x56b405,null));};exports[_0xe4f7('0xa1')]=function(_0x3c48e7,_0x328e18){var _0x43ca7a={'raw':![],'where':{'id':_0x3c48e7['params']['id']}},_0x4c9987={};_0x4c9987[_0xe4f7('0x33')]=_[_0xe4f7('0x2f')](db[_0xe4f7('0x8d')][_0xe4f7('0xa2')]);_0x4c9987['query']=_[_0xe4f7('0x2f')](_0x3c48e7[_0xe4f7('0x30')]);_0x4c9987[_0xe4f7('0x31')]=_['intersection'](_0x4c9987[_0xe4f7('0x33')],_0x4c9987[_0xe4f7('0x30')]);_0x43ca7a[_0xe4f7('0x35')]=_[_0xe4f7('0x32')](_0x4c9987['model'],qs['fields'](_0x3c48e7[_0xe4f7('0x30')]['fields']));_0x43ca7a[_0xe4f7('0x35')]=_0x43ca7a['attributes'][_0xe4f7('0x36')]?_0x43ca7a[_0xe4f7('0x35')]:_0x4c9987['model'];if(_0x3c48e7[_0xe4f7('0x30')]['includeAll']){_0x43ca7a['include']=[{'all':!![]}];}_0x43ca7a=_['merge']({},_0x43ca7a,_0x3c48e7[_0xe4f7('0xa3')]);return db['OpenchannelInteraction'][_0xe4f7('0x51')](_0x43ca7a)['then'](handleEntityNotFound(_0x328e18,null))[_0xe4f7('0x22')](respondWithResult(_0x328e18,null))[_0xe4f7('0x2a')](handleError(_0x328e18,null));};exports[_0xe4f7('0xa4')]=function(_0x198be7,_0x4b058d){return db[_0xe4f7('0x8d')]['create'](_0x198be7[_0xe4f7('0x64')],{})[_0xe4f7('0x22')](respondWithResult(_0x4b058d,0xc9))[_0xe4f7('0x2a')](handleError(_0x4b058d,null));};exports[_0xe4f7('0x21')]=function(_0x187b57,_0x8f7832){if(_0x187b57[_0xe4f7('0x64')]['id']){delete _0x187b57[_0xe4f7('0x64')]['id'];}return db[_0xe4f7('0x8d')][_0xe4f7('0x51')]({'where':{'id':_0x187b57[_0xe4f7('0xa5')]['id']}})['then'](handleEntityNotFound(_0x8f7832,null))[_0xe4f7('0x22')](saveUpdates(_0x187b57[_0xe4f7('0x64')],null))[_0xe4f7('0x22')](respondWithResult(_0x8f7832,null))[_0xe4f7('0x2a')](handleError(_0x8f7832,null));};exports[_0xe4f7('0xa6')]=function(_0x4d1adf,_0x442f89){return db[_0xe4f7('0x8d')][_0xe4f7('0x51')]({'where':{'id':_0x4d1adf[_0xe4f7('0xa5')]['id']}})[_0xe4f7('0x22')](handleEntityNotFound(_0x442f89,null))[_0xe4f7('0x22')](removeEntity(_0x442f89,null))[_0xe4f7('0x2a')](handleError(_0x442f89,null));};exports[_0xe4f7('0xa7')]=function(_0xee2342,_0x2025ca){return db[_0xe4f7('0x8d')]['describe']()[_0xe4f7('0x22')](respondWithResult(_0x2025ca,null))['catch'](handleError(_0x2025ca,null));};exports[_0xe4f7('0xa8')]=function(_0x4274ea,_0x1d01f9,_0x5d7831){return db[_0xe4f7('0xa9')][_0xe4f7('0x51')]({'where':{'id':_0x4274ea['params']['id']}})['then'](handleEntityNotFound(_0x1d01f9,null))[_0xe4f7('0x22')](function(_0x5c4edd){if(_0x5c4edd){return _0x5c4edd[_0xe4f7('0xa8')](_0x4274ea[_0xe4f7('0x64')][_0xe4f7('0xaa')],_[_0xe4f7('0xab')](_0x4274ea['body'],[_0xe4f7('0xaa'),'id'])||{});}})[_0xe4f7('0x22')](respondWithResult(_0x1d01f9,null))[_0xe4f7('0x2a')](handleError(_0x1d01f9,null));};exports[_0xe4f7('0xac')]=function(_0x6175f1,_0x1097cb,_0x6ff611){var _0x1d1456={'raw':![],'where':{}};var _0x643578={};var _0x3a754f={'count':0x0,'rows':[]};return db[_0xe4f7('0x8d')]['findOne']({'where':{'id':_0x6175f1[_0xe4f7('0xa5')]['id']}})[_0xe4f7('0x22')](handleEntityNotFound(_0x1097cb,null))[_0xe4f7('0x22')](function(_0x3430a5){if(_0x3430a5){_0x643578[_0xe4f7('0x33')]=_[_0xe4f7('0x2f')](db['OpenchannelMessage'][_0xe4f7('0xa2')]);_0x643578[_0xe4f7('0x30')]=_[_0xe4f7('0x2f')](_0x6175f1[_0xe4f7('0x30')]);_0x643578[_0xe4f7('0x31')]=_[_0xe4f7('0x32')](_0x643578['model'],_0x643578['query']);_0x1d1456[_0xe4f7('0x35')]=_[_0xe4f7('0x32')](_0x643578['model'],qs[_0xe4f7('0x34')](_0x6175f1[_0xe4f7('0x30')][_0xe4f7('0x34')]));_0x1d1456['attributes']=_0x1d1456[_0xe4f7('0x35')][_0xe4f7('0x36')]?_0x1d1456['attributes']:_0x643578[_0xe4f7('0x33')];if(!_0x6175f1['query'][_0xe4f7('0xad')](_0xe4f7('0x37'))){_0x1d1456[_0xe4f7('0x1d')]=qs[_0xe4f7('0x1d')](_0x6175f1[_0xe4f7('0x30')][_0xe4f7('0x1d')]);_0x1d1456[_0xe4f7('0x1c')]=qs[_0xe4f7('0x1c')](_0x6175f1[_0xe4f7('0x30')]['offset']);}_0x1d1456[_0xe4f7('0x38')]=qs[_0xe4f7('0x39')](_0x6175f1['query'][_0xe4f7('0x39')]);_0x1d1456[_0xe4f7('0x3a')]=qs[_0xe4f7('0x31')](_[_0xe4f7('0x3b')](_0x6175f1['query'],_0x643578['filters']));_0x1d1456[_0xe4f7('0x3a')]['OpenchannelInteractionId']=_0x3430a5['id'];if(_0x6175f1[_0xe4f7('0x30')]['filter']){_0x1d1456[_0xe4f7('0x3a')]=_[_0xe4f7('0x8c')](_0x1d1456[_0xe4f7('0x3a')],{'$or':_[_0xe4f7('0x24')](_0x1d1456[_0xe4f7('0x35')],function(_0x375f48){var _0x3b6b43={};_0x3b6b43[_0x375f48]={'$like':'%'+_0x6175f1[_0xe4f7('0x30')][_0xe4f7('0x77')]+'%'};return _0x3b6b43;})});}if(_0x6175f1[_0xe4f7('0x30')][_0xe4f7('0x6d')]){var _0x5d9d3e=_0x6175f1[_0xe4f7('0x30')][_0xe4f7('0x6d')][_0xe4f7('0x27')](',');var _0x15c1f2={};_0x15c1f2[_0x5d9d3e[0x0]]={'$gte':moment(_0x5d9d3e[0x1])['format'](_0xe4f7('0xae'))};_0x1d1456['where']=_[_0xe4f7('0x8c')](_0x1d1456[_0xe4f7('0x3a')],_0x15c1f2);}_0x1d1456=_[_0xe4f7('0x8c')]({},_0x1d1456,_0x6175f1[_0xe4f7('0xa3')]);return db['OpenchannelMessage'][_0xe4f7('0x8b')]({'where':_0x1d1456[_0xe4f7('0x3a')]})['then'](function(_0x13fe6b){_0x3a754f[_0xe4f7('0x8b')]=_0x13fe6b;if(_0x6175f1[_0xe4f7('0x30')][_0xe4f7('0xaf')]){_0x1d1456['include']=[{'all':!![]}];}return db[_0xe4f7('0xa9')]['findAll'](_0x1d1456);})['then'](function(_0x24086d){_0x3a754f[_0xe4f7('0xa0')]=_0x24086d;return _0x3a754f;});}})[_0xe4f7('0x22')](respondWithFilteredResult(_0x1097cb,_0x1d1456))[_0xe4f7('0x2a')](handleError(_0x1097cb,null));};exports[_0xe4f7('0xb0')]=function(_0x114e1d,_0x24bd33,_0x427469){return db[_0xe4f7('0x8d')][_0xe4f7('0x51')]({'where':{'id':_0x114e1d[_0xe4f7('0xa5')]['id']}})['then'](handleEntityNotFound(_0x24bd33,null))[_0xe4f7('0x22')](function(_0x65cd85){if(_0x65cd85){return _0x65cd85[_0xe4f7('0xb1')](_0x114e1d[_0xe4f7('0x64')][_0xe4f7('0xaa')],_[_0xe4f7('0xab')](_0x114e1d[_0xe4f7('0x64')],[_0xe4f7('0xaa'),'id'])||{})[_0xe4f7('0xb2')](function(){return db[_0xe4f7('0x5f')][_0xe4f7('0xb3')]({'attributes':['id',_0xe4f7('0x2e'),_0xe4f7('0xb4')],'where':{'id':_0x114e1d['body'][_0xe4f7('0xaa')]}});})['then'](function(_0x4e9d0c){socket[_0xe4f7('0xb5')]('openchannelInteractionTags:save',{'id':Number(_0x114e1d[_0xe4f7('0xa5')]['id']),'tags':_0x4e9d0c||[]});return{'id':Number(_0x114e1d[_0xe4f7('0xa5')]['id']),'tags':_0x4e9d0c||[]};});}})[_0xe4f7('0x22')](respondWithResult(_0x24bd33,null))[_0xe4f7('0x2a')](handleError(_0x24bd33,null));};exports[_0xe4f7('0xb6')]=function(_0x493416,_0x1bba90,_0xc8e419){return db[_0xe4f7('0x8d')]['find']({'where':{'id':_0x493416[_0xe4f7('0xa5')]['id']}})[_0xe4f7('0x22')](handleEntityNotFound(_0x1bba90,null))[_0xe4f7('0x22')](function(_0x140ccb){if(_0x140ccb){return _0x140ccb[_0xe4f7('0xb6')](_0x493416[_0xe4f7('0x30')][_0xe4f7('0xaa')]);}})[_0xe4f7('0x22')](respondWithStatusCode(_0x1bba90,null))[_0xe4f7('0x2a')](handleError(_0x1bba90,null));};exports[_0xe4f7('0xb7')]=function(_0x1169c2,_0x4edc06){var _0x60cc26=moment()['unix']()[_0xe4f7('0x8a')]();var _0x54ce03=path[_0xe4f7('0xb8')](config[_0xe4f7('0xb9')],_0xe4f7('0xba'),_0xe4f7('0xbb'),_0xe4f7('0xbc'));var _0x2145fb=path[_0xe4f7('0xb8')](config[_0xe4f7('0xb9')],_0xe4f7('0xba'),'files',_0xe4f7('0xbd'));var _0x182aa3=path[_0xe4f7('0xb8')](_0x54ce03,_0x60cc26);var _0x3243b3=util['format'](_0xe4f7('0xbe'),_0x1169c2[_0xe4f7('0xa5')]['id'],_0x60cc26);var _0x3ef19b=path[_0xe4f7('0xb8')](_0x54ce03,_0x3243b3);var _0x3371e8=[];_0x3371e8['push']({'model':db['User'],'as':'User','attributes':['id',_0xe4f7('0x25')],'raw':!![]});_0x3371e8[_0xe4f7('0xbf')]({'model':db['CmContact'],'as':'Contact','attributes':['id',_0xe4f7('0xc0'),_0xe4f7('0xc1')],'raw':!![]});if(_0x1169c2[_0xe4f7('0x30')][_0xe4f7('0xbd')]){_0x3371e8[_0xe4f7('0xbf')]({'model':db[_0xe4f7('0xc2')],'as':_0xe4f7('0xc2'),'raw':!![]});}var _0x8a9be9=[{'model':db[_0xe4f7('0xa9')],'as':_0xe4f7('0xc3'),'attributes':['id',_0xe4f7('0x64'),_0xe4f7('0x6b'),'direction',_0xe4f7('0xc4'),_0xe4f7('0x72')],'include':_0x3371e8}];_0x8a9be9['push']({'model':db[_0xe4f7('0xc5')],'as':'Account','attributes':['id',_0xe4f7('0x2e')]});_0x8a9be9[_0xe4f7('0xbf')]({'model':db['User'],'as':_0xe4f7('0xc6'),'attributes':['id','fullname']});return db['OpenchannelInteraction']['find']({'where':{'id':_0x1169c2[_0xe4f7('0xa5')]['id']},'include':_0x8a9be9})['then'](handleEntityNotFound(_0x4edc06,null))[_0xe4f7('0x22')](function(_0x477e49){if(_0x477e49){var _0x467440=_0x477e49[_0xe4f7('0xc7')]({'plain':!![]});fs['mkdirSync'](_0x182aa3);var _0x29ecdf={'format':'A4','border':'10px','header':{'height':_0xe4f7('0xc8'),'contents':{'first':_0xe4f7('0xc9')}},'footer':{'height':_0xe4f7('0xca'),'contents':{'default':util[_0xe4f7('0xcb')]('\x0a\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[_0xe4f7('0xcb')](_0xe4f7('0xcc'),_0xe4f7('0xcd'),_0x467440['id']),moment()[_0xe4f7('0xcb')]('YYYY-MM-DD')[_0xe4f7('0x8a')]())}}};var _0x4f9036={'channel':'Openchannel','account':_0x467440[_0xe4f7('0xce')][_0xe4f7('0x2e')],'agent':_0x467440['Owner']?_0x467440[_0xe4f7('0xc6')]['fullname']:_0xe4f7('0xcf'),'createdAt':moment(_0x467440[_0xe4f7('0x6b')])[_0xe4f7('0xcb')](_0xe4f7('0xae'))[_0xe4f7('0x8a')](),'closedAt':_0x467440[_0xe4f7('0xd0')]?moment(_0x467440['closedAt'])[_0xe4f7('0xcb')](_0xe4f7('0xae'))[_0xe4f7('0x8a')]():'','disposition':_0x467440['disposition'],'visibility':_0x467440['threadId']?_0xe4f7('0xd1'):_0xe4f7('0xd2'),'messages':_(_0x467440[_0xe4f7('0xc3')])[_0xe4f7('0x77')]({'secret':![]})[_0xe4f7('0x24')](function(_0x28a697){if(_0x28a697['Attachment']){var _0x1bb2a1=path[_0xe4f7('0xb8')](_0x2145fb,_0x28a697[_0xe4f7('0xc2')][_0xe4f7('0xd3')]);if(fs[_0xe4f7('0xd4')](_0x1bb2a1)){fs[_0xe4f7('0xd5')](_0x1bb2a1)[_0xe4f7('0xd6')](fs[_0xe4f7('0xd7')](path[_0xe4f7('0xb8')](_0x182aa3,_0x28a697[_0xe4f7('0xc2')]['basename'])));}}return{'date':moment(_0x28a697[_0xe4f7('0x6b')])[_0xe4f7('0xcb')](_0xe4f7('0xae'))[_0xe4f7('0x8a')](),'sender':_0x28a697['direction']===_0xe4f7('0xd8')?_0x28a697[_0xe4f7('0x62')]?_0x28a697[_0xe4f7('0x62')][_0xe4f7('0x25')]:'System':_0x28a697[_0xe4f7('0x56')]['firstName']+(_0x28a697[_0xe4f7('0x56')][_0xe4f7('0xc1')]?'\x20'+_0x28a697['Contact'][_0xe4f7('0xc1')]:''),'body':_0x28a697[_0xe4f7('0xc2')]?_0x28a697[_0xe4f7('0xc2')]['basename']:_0x28a697[_0xe4f7('0x64')],'direction':_0x28a697[_0xe4f7('0xd9')]===_0xe4f7('0xd8')?'A':'C','secret':_0x28a697[_0xe4f7('0xc4')],'read':_0x28a697[_0xe4f7('0x72')],'attachment':_0x28a697['Attachment']};})[_0xe4f7('0x53')]()};return ejs[_0xe4f7('0xda')](path[_0xe4f7('0xb8')](config[_0xe4f7('0xb9')],_0xe4f7('0xba'),_0xe4f7('0xdb'),'downloadInteraction.html'),{'interaction':_0x4f9036})[_0xe4f7('0x22')](function(_0x573a86){return new BPromise(function(_0x4db858,_0x168e4e){pdf['create'](_0x573a86,_0x29ecdf)[_0xe4f7('0xdc')](path[_0xe4f7('0xb8')](_0x182aa3,'transcript-'+_0x467440['id']+'-'+_0x60cc26+_0xe4f7('0xdd')),function(_0xf0a872,_0x34dfa5){if(_0xf0a872)return _0x168e4e(_0xf0a872);_0x4db858(_0x34dfa5);});});})[_0xe4f7('0x22')](function(){return new BPromise(function(_0x57806d,_0x303016){zipdir(_0x182aa3,{'saveTo':_0x3ef19b},function(_0x3f03b2,_0x44c2e6){if(_0x3f03b2)return _0x303016(_0x3f03b2);return _0x57806d(_0x44c2e6);});})['then'](function(){return new BPromise(function(_0x4d4f50,_0x761bee){rimraf(_0x182aa3,function(_0x335541){if(_0x335541)_0x761bee(_0x335541);return _0x4d4f50();});});})[_0xe4f7('0x22')](function(){return _0x4edc06[_0xe4f7('0xb7')](_0x3ef19b,_0x3243b3,function(_0x3ac1f1){if(_0x3ac1f1){console[_0xe4f7('0xde')]('err',_0x3ac1f1);}else{fs['unlinkSync'](_0x3ef19b);}});});});}else{return _0x4edc06[_0xe4f7('0xdf')](0xc8);}})[_0xe4f7('0x2a')](handleError(_0x4edc06,null));}; \ No newline at end of file +var _0x5307=['closedAt','disposition','threadId','Private','basename','existsSync','createReadStream','pipe','direction','out','System','firstName','downloadInteraction.html','toFile','transcript-','.pdf','download','log','err','unlinkSync','html-pdf','zip-dir','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','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','end','json','offset','limit','set','apply','update','then','error','stack','name','send','Users','map','fullname','TagIds','Tags','split','forEach','push','index','type','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','select','field','color','from','tools_tags','u.id','u.fullname','user_has_openchannel_interactions','users','u.id\x20=\x20ui.UserId','openchannel_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','t.id\x20=\x20it.TagId','expr','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','text','start','Tag','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','body','some','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','$gte','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','isEmpty','t.id\x20IN\x20?','journey','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','toString','count','keyBy','OpenchannelInteraction','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','Contact.firstName','Contact.lastName','c.email','Contact.phone','Contact.mobile','c.fax','Contact.fax','Owner.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','all','params','rawAttributes','include','merge','options','catch','create','destroy','describe','OpenchannelMessage','addMessage','getMessages','findOne','hasOwnProperty','pick','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','setTags','ids','omit','openchannelInteractionTags:save','removeTags','unix','server','tmp','root','files','attachments','join','transcript-%d-%s.zip','User','lastName','Attachment','secret','Owner','get','10px','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','%s\x20#%d','Openchannel','YYYY-MM-DD','N.A.','closed'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x5307,0x101));var _0x7530=function(_0x1ac74e,_0x2b2621){_0x1ac74e=_0x1ac74e-0x0;var _0x1dce06=_0x5307[_0x1ac74e];return _0x1dce06;};'use strict';var pdf=require(_0x7530('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7530('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7530('0x2'));var moment=require(_0x7530('0x3'));var BPromise=require(_0x7530('0x4'));var Mustache=require(_0x7530('0x5'));var util=require(_0x7530('0x6'));var path=require(_0x7530('0x7'));var sox=require(_0x7530('0x8'));var csv=require(_0x7530('0x9'));var ejs=require(_0x7530('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x7530('0xb'));var jsforce=require(_0x7530('0xc'));var deskjs=require(_0x7530('0xd'));var toCsv=require(_0x7530('0x9'));var querystring=require(_0x7530('0xe'));var Papa=require(_0x7530('0xf'));var Redis=require(_0x7530('0x10'));var authService=require(_0x7530('0x11'));var qs=require(_0x7530('0x12'));var as=require(_0x7530('0x13'));var hardwareService=require(_0x7530('0x14'));var logger=require(_0x7530('0x15'))('api');var utils=require(_0x7530('0x16'));var config=require(_0x7530('0x17'));var db=require(_0x7530('0x18'))['db'];config[_0x7530('0x19')]=_[_0x7530('0x1a')](config[_0x7530('0x19')],{'host':_0x7530('0x1b'),'port':0x18eb});var socket=require(_0x7530('0x1c'))(new Redis(config[_0x7530('0x19')]));require(_0x7530('0x1d'))[_0x7530('0x1e')](socket);function respondWithStatusCode(_0x9ecd52,_0x5563ee){_0x5563ee=_0x5563ee||0xcc;return function(_0x57d9b8){if(_0x57d9b8){return _0x9ecd52[_0x7530('0x1f')](_0x5563ee);}return _0x9ecd52[_0x7530('0x20')](_0x5563ee)[_0x7530('0x21')]();};}function respondWithResult(_0x227a5a,_0x359185){_0x359185=_0x359185||0xc8;return function(_0x5930fe){if(_0x5930fe){return _0x227a5a[_0x7530('0x20')](_0x359185)[_0x7530('0x22')](_0x5930fe);}};}function respondWithFilteredResult(_0x28b3b0,_0x514016){return function(_0x21cf7e){if(_0x21cf7e){var _0x2353df=_0x21cf7e['count'],_0x288773=_0x514016[_0x7530('0x23')],_0x3acc89=_0x514016[_0x7530('0x23')]+_0x514016[_0x7530('0x24')],_0x40cf92;if(_0x3acc89>=_0x2353df){_0x3acc89=_0x2353df;_0x40cf92=0xc8;}else{_0x40cf92=0xce;}_0x28b3b0[_0x7530('0x20')](_0x40cf92);return _0x28b3b0[_0x7530('0x25')]('Content-Range',_0x288773+'-'+_0x3acc89+'/'+_0x2353df)[_0x7530('0x22')](_0x21cf7e);}return null;};}function patchUpdates(_0x35a9d3){return function(_0xd72a91){try{jsonpatch[_0x7530('0x26')](_0xd72a91,_0x35a9d3,!![]);}catch(_0x396713){return BPromise['reject'](_0x396713);}return _0xd72a91['save']();};}function saveUpdates(_0x613510,_0x78d9da){return function(_0x295be9){if(_0x295be9){return _0x295be9[_0x7530('0x27')](_0x613510)[_0x7530('0x28')](function(_0x4d09c2){return _0x4d09c2;});}return null;};}function removeEntity(_0x791f8b,_0x30e20f){return function(_0x53efba){if(_0x53efba){return _0x53efba['destroy']()[_0x7530('0x28')](function(){_0x791f8b[_0x7530('0x20')](0xcc)[_0x7530('0x21')]();});}};}function handleEntityNotFound(_0x5a0020,_0x574b82){return function(_0xd05843){if(!_0xd05843){_0x5a0020[_0x7530('0x1f')](0x194);}return _0xd05843;};}function handleError(_0x5af452,_0x41900f){_0x41900f=_0x41900f||0x1f4;return function(_0x55d9c4){logger[_0x7530('0x29')](_0x55d9c4[_0x7530('0x2a')]);if(_0x55d9c4[_0x7530('0x2b')]){delete _0x55d9c4[_0x7530('0x2b')];}_0x5af452[_0x7530('0x20')](_0x41900f)[_0x7530('0x2c')](_0x55d9c4);};}function getInteractionUsers(_0x3084e5,_0x30d461){return new BPromise(function(_0x414d3f,_0x47bf61){try{if(_0x30d461[_0x3084e5['id']]){_0x3084e5[_0x7530('0x2d')]=_[_0x7530('0x2e')](_0x30d461[_0x3084e5['id']],function(_0x5d7867){return{'id':_0x5d7867['id'],'fullname':_0x5d7867[_0x7530('0x2f')]};});}}catch(_0x546e20){_0x47bf61(_0x546e20);}_0x414d3f(_0x3084e5);});}function getInteractionTags(_0x40b2b8,_0x2f4bfd){return new BPromise(function(_0x15e7d3,_0x322ec7){try{if(_0x40b2b8[_0x7530('0x30')]){_0x40b2b8[_0x7530('0x31')]=[];_0x40b2b8[_0x7530('0x30')][_0x7530('0x32')](',')[_0x7530('0x33')](function(_0x1bffcf){_0x40b2b8[_0x7530('0x31')][_0x7530('0x34')](_0x2f4bfd[_0x1bffcf]);});}delete _0x40b2b8['TagIds'];}catch(_0x3b281c){_0x322ec7(_0x3b281c);}_0x15e7d3(_0x40b2b8);});}function updateOpenchannelInteraction(_0xf24800,_0x4b79d5,_0x40c1a3){return new BPromise(function(_0x3c9d4d,_0x3caf3e){return getInteractionUsers(_0xf24800,_0x40c1a3)[_0x7530('0x28')](function(_0x3759a5){return getInteractionTags(_0x3759a5,_0x4b79d5);})[_0x7530('0x28')](function(_0x15847f){_0x3c9d4d(_0x15847f);})['catch'](function(_0x42526a){_0x3caf3e(_0x42526a);});});}exports[_0x7530('0x35')]=function(_0x1026ca,_0x842b44){var _0x377ea1={},_0xce3aff={},_0xd090a0={'count':0x0,'rows':[]};var _0x46f5d7=_['map'](db['OpenchannelInteraction']['rawAttributes'],function(_0x482aad){return{'name':_0x482aad['fieldName'],'type':_0x482aad[_0x7530('0x36')]['key']};});_0xce3aff[_0x7530('0x37')]=_['map'](_0x46f5d7,_0x7530('0x2b'));_0xce3aff[_0x7530('0x38')]=_[_0x7530('0x39')](_0x1026ca[_0x7530('0x38')]);_0xce3aff[_0x7530('0x3a')]=_[_0x7530('0x3b')](_0xce3aff[_0x7530('0x37')],_0xce3aff[_0x7530('0x38')]);_0x377ea1['attributes']=_[_0x7530('0x3b')](_0xce3aff['model'],qs[_0x7530('0x3c')](_0x1026ca[_0x7530('0x38')]['fields']));_0x377ea1['attributes']=_0x377ea1[_0x7530('0x3d')][_0x7530('0x3e')]?_0x377ea1['attributes']:_0xce3aff[_0x7530('0x37')];if(!_0x1026ca[_0x7530('0x38')]['hasOwnProperty'](_0x7530('0x3f'))){_0x377ea1[_0x7530('0x24')]=qs['limit'](_0x1026ca['query']['limit']);_0x377ea1['offset']=qs[_0x7530('0x23')](_0x1026ca[_0x7530('0x38')]['offset']);}_0x377ea1[_0x7530('0x40')]=qs[_0x7530('0x41')](_0x1026ca[_0x7530('0x38')][_0x7530('0x41')]);_0x377ea1[_0x7530('0x42')]=qs['filters'](_['pick'](_0x1026ca[_0x7530('0x38')],_0xce3aff[_0x7530('0x3a')]));var _0x180bfe=[];var _0x24382e=squel[_0x7530('0x43')]()['field']('id')[_0x7530('0x44')]('name')[_0x7530('0x44')](_0x7530('0x45'))[_0x7530('0x46')](_0x7530('0x47'));var _0xcf49a7=squel['select']()[_0x7530('0x44')](_0x7530('0x48'))[_0x7530('0x44')](_0x7530('0x49'))[_0x7530('0x44')]('ui.OpenchannelInteractionId')[_0x7530('0x46')](_0x7530('0x4a'),'ui')['left_join'](_0x7530('0x4b'),'u',_0x7530('0x4c'));var _0x253ec9=squel[_0x7530('0x43')]()[_0x7530('0x46')](_0x7530('0x4d'),'i')[_0x7530('0x4e')](_0x7530('0x4f'),'c',_0x7530('0x50'))['left_join'](_0x7530('0x4b'),'o',_0x7530('0x51'))[_0x7530('0x4e')](_0x7530('0x52'),'a',_0x7530('0x53'))['left_join'](_0x7530('0x54'),'me',_0x7530('0x55'))['left_join'](_0x7530('0x56'),'it','it.OpenchannelInteractionId\x20=\x20i.id')['left_join']('tools_tags','t',_0x7530('0x57'));var _0x3e148b=squel[_0x7530('0x58')]();var _0x3f9a61=[];var _0x4eea32=squel['expr']();var _0x3fc5d4;if(_0x1026ca[_0x7530('0x38')]['search']){_0x3fc5d4=as[_0x7530('0x59')](_0x1026ca[_0x7530('0x38')]['search']);var _0x1ff1e7=_0x3fc5d4[_0x7530('0x5a')];for(var _0x9bcd83=0x0;_0x9bcd83<_0x3fc5d4[_0x7530('0x5b')]['length'];_0x9bcd83++){var _0x57dd7f=_0x3fc5d4[_0x7530('0x5b')][_0x9bcd83];var _0x37aef1='i';var _0x568d33=_[_0x7530('0x5c')](_0x46f5d7,[_0x7530('0x2b'),_0x57dd7f['field']]);if(!_0x568d33){switch(_0x57dd7f[_0x7530('0x44')]){case _0x7530('0x5d'):if(_0x57dd7f[_0x7530('0x5e')]==0x1){_0x253ec9[_0x7530('0x5f')]('`'+_0x57dd7f[_0x7530('0x44')]+_0x7530('0x60'));}else{_0x253ec9[_0x7530('0x5f')]('`'+_0x57dd7f[_0x7530('0x44')]+_0x7530('0x61'));}break;case _0x7530('0x62'):if(_0x57dd7f[_0x7530('0x63')]===_0x7530('0x64')){if(_0x57dd7f[_0x7530('0x5e')]['split']('\x20')['length']>0x1){_0x3e148b[_0x1ff1e7](_0x7530('0x65'),qs[_0x7530('0x66')](_0x57dd7f[_0x7530('0x5e')]),null);}else{var _0x224683='%'+_0x57dd7f[_0x7530('0x5e')]+'%';_0x3e148b[_0x1ff1e7]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x224683,_0x224683,_0x224683);}}else{_0x568d33=_[_0x7530('0x5c')](_0x46f5d7,[_0x7530('0x2b'),_0x7530('0x67')]);_0x57dd7f[_0x7530('0x44')]=_0x7530('0x67');_0x528d9d=as['buildExpression'](_0x37aef1,_0x568d33[_0x7530('0x36')],_0x57dd7f);_0x3e148b[_0x1ff1e7](_0x528d9d[_0x7530('0x68')],_0x528d9d[_0x7530('0x5e')][_0x7530('0x69')],_0x528d9d[_0x7530('0x5e')][_0x7530('0x21')]);}break;case _0x7530('0x6a'):var _0x37717a=_0x57dd7f[_0x7530('0x5e')]['split'](',')[_0x7530('0x2e')](function(_0x36dc3d){return Number(_0x36dc3d);});_0x37717a[_0x7530('0x33')](function(_0x448f4c){_0x4eea32['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x448f4c+',%');});_0x3f9a61=_[_0x7530('0x6b')](_0x3f9a61,_0x37717a);break;case'User':if(_0x57dd7f[_0x7530('0x63')]==='$substring'){_0x3e148b[_0x1ff1e7](_0x7530('0x6c'),'%'+_0x57dd7f['value']+'%',null);}else{_0x568d33=_[_0x7530('0x5c')](_0x46f5d7,[_0x7530('0x2b'),_0x7530('0x6d')]);_0x57dd7f['field']=_0x7530('0x6d');_0x528d9d=as[_0x7530('0x6e')](_0x37aef1,_0x568d33['type'],_0x57dd7f);_0x3e148b[_0x1ff1e7](_0x528d9d[_0x7530('0x68')],_0x528d9d[_0x7530('0x5e')]['start'],_0x528d9d[_0x7530('0x5e')][_0x7530('0x21')]);}break;case _0x7530('0x6f'):_0x528d9d=as['buildExpression']('me',null,_0x57dd7f);_0x3e148b[_0x1ff1e7](_0x528d9d[_0x7530('0x68')],_0x528d9d[_0x7530('0x5e')][_0x7530('0x69')],_0x528d9d[_0x7530('0x5e')][_0x7530('0x21')]);break;}}else{var _0x528d9d=as['buildExpression'](_0x37aef1,_0x568d33['type'],_0x57dd7f);_0x3e148b[_0x1ff1e7](_0x528d9d[_0x7530('0x68')],_0x528d9d[_0x7530('0x5e')]['start'],_0x528d9d['value'][_0x7530('0x21')]);}}}else{var _0x374359=_(_0x1026ca[_0x7530('0x38')])[_0x7530('0x39')]()[_0x7530('0x2e')](function(_0x2a935c){return _[_0x7530('0x70')](_0x46f5d7,[_0x7530('0x2b'),_0x2a935c])?_0x2a935c:undefined;})['compact']()['value']();if(!_['isEmpty'](_0x374359)){_0x374359[_0x7530('0x33')](function(_0x3e90ac){if(_0x3e90ac===_0x7530('0x71')){_0x253ec9['where'](_0x7530('0x72'),[][_0x7530('0x73')](_0x1026ca[_0x7530('0x38')][_0x3e90ac]));}else if(_0x3e90ac===_0x7530('0x74')){var _0x399342=JSON['parse'](_0x1026ca['query'][_0x3e90ac])[_0x7530('0x75')];var _0x17ef5d=JSON[_0x7530('0x76')](_0x1026ca[_0x7530('0x38')][_0x3e90ac])['$lte'];_0x253ec9[_0x7530('0x42')](_0x7530('0x77'),_0x399342,_0x17ef5d);}else{if(_0x1026ca[_0x7530('0x38')][_0x3e90ac]===_0x7530('0x78')){_0x253ec9[_0x7530('0x42')]('i.'+_0x3e90ac+'\x20IS\x20NULL');}else{_0x253ec9[_0x7530('0x42')]('i.'+_0x3e90ac+_0x7530('0x79'),_0x1026ca[_0x7530('0x38')][_0x3e90ac]);}}});}if(_0x1026ca[_0x7530('0x38')][_0x7530('0x7a')]){if(_0x1026ca['query'][_0x7530('0x7a')]==0x1){_0x253ec9[_0x7530('0x5f')](_0x7530('0x7b'));}else{_0x253ec9[_0x7530('0x5f')](_0x7530('0x7c'));}}if(_0x1026ca[_0x7530('0x38')][_0x7530('0x7d')]){_0x3f9a61=_['isArray'](_0x1026ca[_0x7530('0x38')][_0x7530('0x7d')])?_0x1026ca[_0x7530('0x38')][_0x7530('0x7d')]:new Array(_0x1026ca['query'][_0x7530('0x7d')]);_0x3f9a61['forEach'](function(_0xfff67){_0x4eea32['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xfff67+',%');});}if(_0x1026ca['query'][_0x7530('0x7e')]){var _0x33437a=_0x1026ca[_0x7530('0x38')][_0x7530('0x7e')][_0x7530('0x7f')]('\x5c','\x5c\x5c')['replace']('\x27\x27',_0x7530('0x80'));if(qs[_0x7530('0x81')](_0x33437a)){_0x3e148b['or'](_0x7530('0x82'),_0x33437a+'%');}else{_0x3e148b['or'](_0x7530('0x83'),qs[_0x7530('0x66')](_0x33437a))['or'](_0x7530('0x84'),_0x33437a+'%')['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x33437a+'%');}}}_0x253ec9[_0x7530('0x42')](_0x3e148b);_0x253ec9[_0x7530('0x85')](_0x7530('0x86'));var _0x302a43={'type':db[_0x7530('0x87')][_0x7530('0x88')][_0x7530('0x89')],'raw':!![]};var _0x56e175=_0x253ec9[_0x7530('0x8a')]();_0x56e175[_0x7530('0x44')](_0x7530('0x86'));_0x56e175[_0x7530('0x44')](_0x7530('0x8b'),_0x7530('0x5d'));if(_0x377ea1[_0x7530('0x40')]){_0x377ea1[_0x7530('0x40')][_0x7530('0x33')](function(_0x206272){_0x253ec9['order']('i.'+_0x206272[0x0],_0x206272[0x1]===_0x7530('0x8c')?![]:!![]);});}if(!_[_0x7530('0x8d')](_0x3f9a61)){_0x253ec9[_0x7530('0x5f')](_0x4eea32);_0x56e175[_0x7530('0x42')](_0x7530('0x8e'),_0x3f9a61);}BPromise['resolve']()[_0x7530('0x28')](function(){if(!_0x3fc5d4){if(_0x1026ca[_0x7530('0x38')][_0x7530('0x71')]||_0x1026ca[_0x7530('0x38')][_0x7530('0x8f')])return;_0x56e175[_0x7530('0x42')](_0x7530('0x90'));_0x253ec9['where'](_0x7530('0x90'));return;}return _0x1026ca[_0x7530('0x91')][_0x7530('0x92')]({'attributes':['id'],'raw':!![]})[_0x7530('0x28')](function(_0x220a25){if(_['isEmpty'](_0x220a25)){_0x56e175[_0x7530('0x42')](_0x7530('0x93'));_0x253ec9['where'](_0x7530('0x93'));}else{_0x56e175[_0x7530('0x42')](_0x7530('0x72'),_['map'](_0x220a25,'id'));_0x253ec9[_0x7530('0x42')](_0x7530('0x72'),_[_0x7530('0x2e')](_0x220a25,'id'));}});})[_0x7530('0x28')](function(){db[_0x7530('0x94')][_0x7530('0x38')](_0x56e175[_0x7530('0x95')](),_0x302a43)[_0x7530('0x28')](function(_0x267007){_0xd090a0['count']=_0x267007[_0x7530('0x3e')];if(_0xd090a0[_0x7530('0x96')]===0x0)return[];return db[_0x7530('0x94')][_0x7530('0x38')](_0x24382e['toString'](),_0x302a43)[_0x7530('0x28')](function(_0x494fb7){_0x180bfe=_[_0x7530('0x97')](_0x494fb7,'id');_0x302a43=_['merge'](_0x302a43,{'model':db[_0x7530('0x98')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1026ca[_0x7530('0x38')][_0x7530('0x3c')]){_0x377ea1[_0x7530('0x3d')][_0x7530('0x33')](function(_0x59b92c){_0x253ec9['field']('i.'+_0x59b92c);});}else{_0x253ec9[_0x7530('0x44')](_0x7530('0x8b'),_0x7530('0x5d'));_0x253ec9[_0x7530('0x44')](_0x7530('0x99'),'Account.key');_0x253ec9[_0x7530('0x44')](_0x7530('0x9a'),_0x7530('0x9b'));_0x253ec9['field'](_0x7530('0x9c'));_0x253ec9[_0x7530('0x44')]('c.firstName',_0x7530('0x9d'));_0x253ec9['field']('c.lastName',_0x7530('0x9e'));_0x253ec9[_0x7530('0x44')](_0x7530('0x9f'),'Contact.email');_0x253ec9[_0x7530('0x44')]('c.phone',_0x7530('0xa0'));_0x253ec9['field']('c.mobile',_0x7530('0xa1'));_0x253ec9['field'](_0x7530('0xa2'),_0x7530('0xa3'));_0x253ec9[_0x7530('0x44')]('o.fullname',_0x7530('0xa4'));_0x253ec9['field']('o.internal','Owner.internal');_0x253ec9[_0x7530('0x44')](_0x7530('0xa5'),_0x7530('0x30'));}_0x253ec9['limit'](_0x377ea1[_0x7530('0x24')]);_0x253ec9[_0x7530('0x23')](_0x377ea1[_0x7530('0x23')]);return db[_0x7530('0x94')][_0x7530('0x38')](_0x253ec9[_0x7530('0x95')](),_0x302a43);})['then'](function(_0x23e1e8){_0xcf49a7[_0x7530('0x42')](_0x7530('0xa6'),_[_0x7530('0x2e')](_0x23e1e8,'id'));return db[_0x7530('0x94')]['query'](_0xcf49a7[_0x7530('0x95')](),_0x302a43)['then'](function(_0x43164c){var _0x29c203=_[_0x7530('0xa7')](_0x43164c,_0x7530('0xa8'));var _0x2725dd=[];_0x23e1e8[_0x7530('0x33')](function(_0x2a8f96){_0x2725dd[_0x7530('0x34')](updateOpenchannelInteraction(_0x2a8f96,_0x180bfe,_0x29c203));});return BPromise[_0x7530('0xa9')](_0x2725dd);});});})[_0x7530('0x28')](function(_0x53c62b){_0xd090a0['rows']=_0x53c62b;return _0xd090a0;})['then'](respondWithFilteredResult(_0x842b44,_0x377ea1));})['catch'](handleError(_0x842b44,null));};exports['show']=function(_0x2de0b2,_0x51e182){var _0x590687={'raw':![],'where':{'id':_0x2de0b2[_0x7530('0xaa')]['id']}},_0x4d0d1e={};_0x4d0d1e[_0x7530('0x37')]=_[_0x7530('0x39')](db['OpenchannelInteraction'][_0x7530('0xab')]);_0x4d0d1e['query']=_[_0x7530('0x39')](_0x2de0b2[_0x7530('0x38')]);_0x4d0d1e['filters']=_[_0x7530('0x3b')](_0x4d0d1e[_0x7530('0x37')],_0x4d0d1e[_0x7530('0x38')]);_0x590687[_0x7530('0x3d')]=_[_0x7530('0x3b')](_0x4d0d1e[_0x7530('0x37')],qs[_0x7530('0x3c')](_0x2de0b2[_0x7530('0x38')][_0x7530('0x3c')]));_0x590687['attributes']=_0x590687['attributes'][_0x7530('0x3e')]?_0x590687[_0x7530('0x3d')]:_0x4d0d1e[_0x7530('0x37')];if(_0x2de0b2[_0x7530('0x38')]['includeAll']){_0x590687[_0x7530('0xac')]=[{'all':!![]}];}_0x590687=_[_0x7530('0xad')]({},_0x590687,_0x2de0b2[_0x7530('0xae')]);return db[_0x7530('0x98')][_0x7530('0x5c')](_0x590687)[_0x7530('0x28')](handleEntityNotFound(_0x51e182,null))[_0x7530('0x28')](respondWithResult(_0x51e182,null))[_0x7530('0xaf')](handleError(_0x51e182,null));};exports['create']=function(_0x4204ec,_0xe55508){return db[_0x7530('0x98')][_0x7530('0xb0')](_0x4204ec[_0x7530('0x6f')],{})[_0x7530('0x28')](respondWithResult(_0xe55508,0xc9))[_0x7530('0xaf')](handleError(_0xe55508,null));};exports[_0x7530('0x27')]=function(_0xa11c6e,_0x2e78d7){if(_0xa11c6e['body']['id']){delete _0xa11c6e[_0x7530('0x6f')]['id'];}return db[_0x7530('0x98')][_0x7530('0x5c')]({'where':{'id':_0xa11c6e['params']['id']}})[_0x7530('0x28')](handleEntityNotFound(_0x2e78d7,null))[_0x7530('0x28')](saveUpdates(_0xa11c6e[_0x7530('0x6f')],null))[_0x7530('0x28')](respondWithResult(_0x2e78d7,null))[_0x7530('0xaf')](handleError(_0x2e78d7,null));};exports[_0x7530('0xb1')]=function(_0x502913,_0x2c1cf9){return db['OpenchannelInteraction'][_0x7530('0x5c')]({'where':{'id':_0x502913['params']['id']}})[_0x7530('0x28')](handleEntityNotFound(_0x2c1cf9,null))[_0x7530('0x28')](removeEntity(_0x2c1cf9,null))[_0x7530('0xaf')](handleError(_0x2c1cf9,null));};exports[_0x7530('0xb2')]=function(_0x413769,_0x25c3b1){return db[_0x7530('0x98')][_0x7530('0xb2')]()[_0x7530('0x28')](respondWithResult(_0x25c3b1,null))['catch'](handleError(_0x25c3b1,null));};exports['addMessage']=function(_0x13494b,_0x5b6f79,_0x317584){return db[_0x7530('0xb3')][_0x7530('0x5c')]({'where':{'id':_0x13494b['params']['id']}})[_0x7530('0x28')](handleEntityNotFound(_0x5b6f79,null))[_0x7530('0x28')](function(_0x5b7a11){if(_0x5b7a11){return _0x5b7a11[_0x7530('0xb4')](_0x13494b[_0x7530('0x6f')]['ids'],_['omit'](_0x13494b[_0x7530('0x6f')],['ids','id'])||{});}})[_0x7530('0x28')](respondWithResult(_0x5b6f79,null))[_0x7530('0xaf')](handleError(_0x5b6f79,null));};exports[_0x7530('0xb5')]=function(_0x48d52a,_0x3c07bf,_0x455072){var _0x5948a8={'raw':![],'where':{}};var _0x449ae1={};var _0x388303={'count':0x0,'rows':[]};return db[_0x7530('0x98')][_0x7530('0xb6')]({'where':{'id':_0x48d52a[_0x7530('0xaa')]['id']}})[_0x7530('0x28')](handleEntityNotFound(_0x3c07bf,null))[_0x7530('0x28')](function(_0x311685){if(_0x311685){_0x449ae1['model']=_[_0x7530('0x39')](db['OpenchannelMessage'][_0x7530('0xab')]);_0x449ae1[_0x7530('0x38')]=_['keys'](_0x48d52a['query']);_0x449ae1[_0x7530('0x3a')]=_[_0x7530('0x3b')](_0x449ae1[_0x7530('0x37')],_0x449ae1[_0x7530('0x38')]);_0x5948a8['attributes']=_[_0x7530('0x3b')](_0x449ae1[_0x7530('0x37')],qs[_0x7530('0x3c')](_0x48d52a['query']['fields']));_0x5948a8[_0x7530('0x3d')]=_0x5948a8['attributes'][_0x7530('0x3e')]?_0x5948a8['attributes']:_0x449ae1['model'];if(!_0x48d52a['query'][_0x7530('0xb7')](_0x7530('0x3f'))){_0x5948a8[_0x7530('0x24')]=qs[_0x7530('0x24')](_0x48d52a[_0x7530('0x38')][_0x7530('0x24')]);_0x5948a8[_0x7530('0x23')]=qs[_0x7530('0x23')](_0x48d52a['query'][_0x7530('0x23')]);}_0x5948a8['order']=qs[_0x7530('0x41')](_0x48d52a[_0x7530('0x38')]['sort']);_0x5948a8[_0x7530('0x42')]=qs[_0x7530('0x3a')](_[_0x7530('0xb8')](_0x48d52a[_0x7530('0x38')],_0x449ae1[_0x7530('0x3a')]));_0x5948a8[_0x7530('0x42')][_0x7530('0xa8')]=_0x311685['id'];if(_0x48d52a[_0x7530('0x38')]['filter']){_0x5948a8[_0x7530('0x42')]=_['merge'](_0x5948a8['where'],{'$or':_[_0x7530('0x2e')](_0x5948a8[_0x7530('0x3d')],function(_0xbaa170){var _0x242074={};_0x242074[_0xbaa170]={'$like':'%'+_0x48d52a[_0x7530('0x38')][_0x7530('0x7e')]+'%'};return _0x242074;})});}if(_0x48d52a['query'][_0x7530('0x75')]){var _0x3e9c1c=_0x48d52a[_0x7530('0x38')]['$gte'][_0x7530('0x32')](',');var _0x2e0af8={};_0x2e0af8[_0x3e9c1c[0x0]]={'$gte':moment(_0x3e9c1c[0x1])['format'](_0x7530('0xb9'))};_0x5948a8[_0x7530('0x42')]=_[_0x7530('0xad')](_0x5948a8[_0x7530('0x42')],_0x2e0af8);}_0x5948a8=_['merge']({},_0x5948a8,_0x48d52a[_0x7530('0xae')]);return db[_0x7530('0xb3')][_0x7530('0x96')]({'where':_0x5948a8[_0x7530('0x42')]})[_0x7530('0x28')](function(_0x58b34e){_0x388303[_0x7530('0x96')]=_0x58b34e;if(_0x48d52a[_0x7530('0x38')][_0x7530('0xba')]){_0x5948a8[_0x7530('0xac')]=[{'all':!![]}];}return db[_0x7530('0xb3')][_0x7530('0xbb')](_0x5948a8);})['then'](function(_0x2f0df7){_0x388303['rows']=_0x2f0df7;return _0x388303;});}})[_0x7530('0x28')](respondWithFilteredResult(_0x3c07bf,_0x5948a8))[_0x7530('0xaf')](handleError(_0x3c07bf,null));};exports['addTags']=function(_0x20e695,_0x369f55,_0x54e566){return db[_0x7530('0x98')][_0x7530('0x5c')]({'where':{'id':_0x20e695[_0x7530('0xaa')]['id']}})[_0x7530('0x28')](handleEntityNotFound(_0x369f55,null))[_0x7530('0x28')](function(_0x5c2f3a){if(_0x5c2f3a){return _0x5c2f3a[_0x7530('0xbc')](_0x20e695[_0x7530('0x6f')][_0x7530('0xbd')],_[_0x7530('0xbe')](_0x20e695[_0x7530('0x6f')],[_0x7530('0xbd'),'id'])||{})['spread'](function(){return db[_0x7530('0x6a')]['findAll']({'attributes':['id',_0x7530('0x2b'),_0x7530('0x45')],'where':{'id':_0x20e695[_0x7530('0x6f')]['ids']}});})[_0x7530('0x28')](function(_0x5356f0){socket['emit'](_0x7530('0xbf'),{'id':Number(_0x20e695[_0x7530('0xaa')]['id']),'tags':_0x5356f0||[]});return{'id':Number(_0x20e695[_0x7530('0xaa')]['id']),'tags':_0x5356f0||[]};});}})['then'](respondWithResult(_0x369f55,null))['catch'](handleError(_0x369f55,null));};exports[_0x7530('0xc0')]=function(_0x17440f,_0x3add46,_0x3c7dbb){return db[_0x7530('0x98')]['find']({'where':{'id':_0x17440f[_0x7530('0xaa')]['id']}})[_0x7530('0x28')](handleEntityNotFound(_0x3add46,null))[_0x7530('0x28')](function(_0x37a74b){if(_0x37a74b){return _0x37a74b[_0x7530('0xc0')](_0x17440f['query'][_0x7530('0xbd')]);}})[_0x7530('0x28')](respondWithStatusCode(_0x3add46,null))['catch'](handleError(_0x3add46,null));};exports['download']=function(_0x1d436c,_0x330b8e){var _0x211f62=moment()[_0x7530('0xc1')]()[_0x7530('0x95')]();var _0x5cfd35=path['join'](config['root'],_0x7530('0xc2'),'files',_0x7530('0xc3'));var _0x4c0c28=path['join'](config[_0x7530('0xc4')],_0x7530('0xc2'),_0x7530('0xc5'),_0x7530('0xc6'));var _0x5383e5=path[_0x7530('0xc7')](_0x5cfd35,_0x211f62);var _0x1e6cef=util['format'](_0x7530('0xc8'),_0x1d436c[_0x7530('0xaa')]['id'],_0x211f62);var _0x8fa177=path[_0x7530('0xc7')](_0x5cfd35,_0x1e6cef);var _0x30b96f=[];_0x30b96f[_0x7530('0x34')]({'model':db[_0x7530('0xc9')],'as':_0x7530('0xc9'),'attributes':['id',_0x7530('0x2f')],'raw':!![]});_0x30b96f[_0x7530('0x34')]({'model':db['CmContact'],'as':_0x7530('0x62'),'attributes':['id','firstName',_0x7530('0xca')],'raw':!![]});if(_0x1d436c['query'][_0x7530('0xc6')]){_0x30b96f[_0x7530('0x34')]({'model':db[_0x7530('0xcb')],'as':_0x7530('0xcb'),'raw':!![]});}var _0x682f8a=[{'model':db[_0x7530('0xb3')],'as':'Messages','attributes':['id',_0x7530('0x6f'),'createdAt','direction',_0x7530('0xcc'),'read'],'include':_0x30b96f}];_0x682f8a['push']({'model':db['OpenchannelAccount'],'as':'Account','attributes':['id',_0x7530('0x2b')]});_0x682f8a[_0x7530('0x34')]({'model':db['User'],'as':_0x7530('0xcd'),'attributes':['id','fullname']});return db[_0x7530('0x98')][_0x7530('0x5c')]({'where':{'id':_0x1d436c[_0x7530('0xaa')]['id']},'include':_0x682f8a})['then'](handleEntityNotFound(_0x330b8e,null))['then'](function(_0xdaeba1){if(_0xdaeba1){var _0x1be229=_0xdaeba1[_0x7530('0xce')]({'plain':!![]});fs['mkdirSync'](_0x5383e5);var _0x5e7e5b={'format':'A4','border':_0x7530('0xcf'),'header':{'height':_0x7530('0xd0'),'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':_0x7530('0xd1'),'contents':{'default':util[_0x7530('0xd2')](_0x7530('0xd3'),util[_0x7530('0xd2')](_0x7530('0xd4'),_0x7530('0xd5'),_0x1be229['id']),moment()['format'](_0x7530('0xd6'))['toString']())}}};var _0x2d1146={'channel':'Openchannel','account':_0x1be229['Account'][_0x7530('0x2b')],'agent':_0x1be229['Owner']?_0x1be229['Owner'][_0x7530('0x2f')]:_0x7530('0xd7'),'createdAt':moment(_0x1be229[_0x7530('0x74')])[_0x7530('0xd2')](_0x7530('0xb9'))['toString'](),'closedAt':_0x1be229[_0x7530('0xd8')]?moment(_0x1be229[_0x7530('0xd9')])[_0x7530('0xd2')](_0x7530('0xb9'))[_0x7530('0x95')]():'','disposition':_0x1be229[_0x7530('0xda')],'visibility':_0x1be229[_0x7530('0xdb')]?'Public':_0x7530('0xdc'),'messages':_(_0x1be229['Messages'])[_0x7530('0x7e')]({'secret':![]})[_0x7530('0x2e')](function(_0xc550f){if(_0xc550f[_0x7530('0xcb')]){var _0x34536d=path[_0x7530('0xc7')](_0x4c0c28,_0xc550f[_0x7530('0xcb')][_0x7530('0xdd')]);if(fs[_0x7530('0xde')](_0x34536d)){fs[_0x7530('0xdf')](_0x34536d)[_0x7530('0xe0')](fs['createWriteStream'](path[_0x7530('0xc7')](_0x5383e5,_0xc550f[_0x7530('0xcb')][_0x7530('0xdd')])));}}return{'date':moment(_0xc550f[_0x7530('0x74')])[_0x7530('0xd2')]('YYYY-MM-DD\x20HH:mm:ss')[_0x7530('0x95')](),'sender':_0xc550f[_0x7530('0xe1')]===_0x7530('0xe2')?_0xc550f[_0x7530('0xc9')]?_0xc550f[_0x7530('0xc9')][_0x7530('0x2f')]:_0x7530('0xe3'):_0xc550f['Contact'][_0x7530('0xe4')]+(_0xc550f[_0x7530('0x62')]['lastName']?'\x20'+_0xc550f[_0x7530('0x62')][_0x7530('0xca')]:''),'body':_0xc550f[_0x7530('0xcb')]?_0xc550f['Attachment'][_0x7530('0xdd')]:_0xc550f[_0x7530('0x6f')],'direction':_0xc550f[_0x7530('0xe1')]===_0x7530('0xe2')?'A':'C','secret':_0xc550f[_0x7530('0xcc')],'read':_0xc550f[_0x7530('0x7a')],'attachment':_0xc550f[_0x7530('0xcb')]};})[_0x7530('0x5e')]()};return ejs['renderFile'](path['join'](config['root'],_0x7530('0xc2'),'views',_0x7530('0xe5')),{'interaction':_0x2d1146})[_0x7530('0x28')](function(_0x2bbb4c){return new BPromise(function(_0x3843f2,_0x52e8e9){pdf[_0x7530('0xb0')](_0x2bbb4c,_0x5e7e5b)[_0x7530('0xe6')](path[_0x7530('0xc7')](_0x5383e5,_0x7530('0xe7')+_0x1be229['id']+'-'+_0x211f62+_0x7530('0xe8')),function(_0x6a2ab9,_0x29e607){if(_0x6a2ab9)return _0x52e8e9(_0x6a2ab9);_0x3843f2(_0x29e607);});});})[_0x7530('0x28')](function(){return new BPromise(function(_0x5bd7a1,_0x49624d){zipdir(_0x5383e5,{'saveTo':_0x8fa177},function(_0x3c7e68,_0x1d0300){if(_0x3c7e68)return _0x49624d(_0x3c7e68);return _0x5bd7a1(_0x1d0300);});})[_0x7530('0x28')](function(){return new BPromise(function(_0xe05e09,_0x201895){rimraf(_0x5383e5,function(_0x1ffdc0){if(_0x1ffdc0)_0x201895(_0x1ffdc0);return _0xe05e09();});});})[_0x7530('0x28')](function(){return _0x330b8e[_0x7530('0xe9')](_0x8fa177,_0x1e6cef,function(_0x3ba92d){if(_0x3ba92d){console[_0x7530('0xea')](_0x7530('0xeb'),_0x3ba92d);}else{fs[_0x7530('0xec')](_0x8fa177);}});});});}else{return _0x330b8e[_0x7530('0x1f')](0xc8);}})[_0x7530('0xaf')](handleError(_0x330b8e,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index f026d83..e2cdd98 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 _0x55c6=['save','update','remove','getUsers','Users','map','findAll','then','unreadMessages','length','emit','catch','hook','exports','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage'];(function(_0x186fee,_0x1ab572){var _0xf8c406=function(_0xb72c2f){while(--_0xb72c2f){_0x186fee['push'](_0x186fee['shift']());}};_0xf8c406(++_0x1ab572);}(_0x55c6,0xc2));var _0x655c=function(_0x560bad,_0x1031c4){_0x560bad=_0x560bad-0x0;var _0x358617=_0x55c6[_0x560bad];return _0x358617;};'use strict';var EventEmitter=require(_0x655c('0x0'));var OpenchannelInteraction=require(_0x655c('0x1'))['db'][_0x655c('0x2')];var OpenchannelMessage=require(_0x655c('0x1'))['db'][_0x655c('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x655c('0x4'),'afterUpdate':_0x655c('0x5'),'afterDestroy':_0x655c('0x6')};function emitEvent(_0x576cbe){return function(_0x1a81b1,_0x2380b9,_0x179551){_0x1a81b1[_0x655c('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x5e5e35){_0x1a81b1['setDataValue'](_0x655c('0x8'),_0x5e5e35[_0x655c('0x9')](function(_0x441713){return{'id':_0x441713['id']};}));return OpenchannelMessage[_0x655c('0xa')]({'where':{'OpenchannelInteractionId':_0x1a81b1['id'],'direction':'in','read':![]},'raw':!![]});})[_0x655c('0xb')](function(_0x23f4d1){_0x1a81b1['setDataValue'](_0x655c('0xc'),_0x23f4d1[_0x655c('0xd')]);OpenchannelInteractionEvents[_0x655c('0xe')](_0x576cbe+':'+_0x1a81b1['id'],_0x1a81b1);OpenchannelInteractionEvents[_0x655c('0xe')](_0x576cbe,_0x1a81b1);_0x179551(null);})[_0x655c('0xf')](_0x179551(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0x655c('0x10')](e,emitEvent(event));}}module[_0x655c('0x11')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x82d8=['getUsers','then','setDataValue','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x1d0fe1,_0x452dbb){var _0x228558=function(_0x356baf){while(--_0x356baf){_0x1d0fe1['push'](_0x1d0fe1['shift']());}};_0x228558(++_0x452dbb);}(_0x82d8,0xa5));var _0x882d=function(_0x39185b,_0x16eb85){_0x39185b=_0x39185b-0x0;var _0x1000d7=_0x82d8[_0x39185b];return _0x1000d7;};'use strict';var EventEmitter=require(_0x882d('0x0'));var OpenchannelInteraction=require(_0x882d('0x1'))['db']['OpenchannelInteraction'];var OpenchannelMessage=require(_0x882d('0x1'))['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x882d('0x2')](0x0);var events={'afterCreate':_0x882d('0x3'),'afterUpdate':_0x882d('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3d475b){return function(_0x5b3d38,_0x2b9bfc,_0x43f3cd){_0x5b3d38[_0x882d('0x5')]({'attributes':['id'],'raw':!![]})[_0x882d('0x6')](function(_0x5ce743){_0x5b3d38[_0x882d('0x7')]('Users',_0x5ce743[_0x882d('0x8')](function(_0x5766c4){return{'id':_0x5766c4['id']};}));return OpenchannelMessage[_0x882d('0x9')]({'where':{'OpenchannelInteractionId':_0x5b3d38['id'],'direction':'in','read':![]},'raw':!![]});})[_0x882d('0x6')](function(_0x1aa49d){_0x5b3d38[_0x882d('0x7')](_0x882d('0xa'),_0x1aa49d[_0x882d('0xb')]);OpenchannelInteractionEvents[_0x882d('0xc')](_0x3d475b+':'+_0x5b3d38['id'],_0x5b3d38);OpenchannelInteractionEvents['emit'](_0x3d475b,_0x5b3d38);_0x43f3cd(null);})[_0x882d('0xd')](_0x43f3cd(null));};}for(var e in events){if(events[_0x882d('0xe')](e)){var event=events[e];OpenchannelInteraction[_0x882d('0xf')](e,emitEvent(event));}}module[_0x882d('0x10')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 913123e..ef7921e 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 _0x4074=['format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','OpenchannelInteraction'];(function(_0x4fb3c8,_0x7a7ba2){var _0x3ffad7=function(_0x342a0c){while(--_0x342a0c){_0x4fb3c8['push'](_0x4fb3c8['shift']());}};_0x3ffad7(++_0x7a7ba2);}(_0x4074,0xf0));var _0x4407=function(_0x585021,_0x754149){_0x585021=_0x585021-0x0;var _0x54489d=_0x4074[_0x585021];return _0x54489d;};'use strict';var _=require(_0x4407('0x0'));var util=require(_0x4407('0x1'));var logger=require(_0x4407('0x2'))('api');var moment=require(_0x4407('0x3'));var BPromise=require(_0x4407('0x4'));var rp=require(_0x4407('0x5'));var fs=require('fs');var path=require(_0x4407('0x6'));var rimraf=require(_0x4407('0x7'));var config=require(_0x4407('0x8'));var attributes=require(_0x4407('0x9'));module[_0x4407('0xa')]=function(_0x3f085d,_0x35899d){return _0x3f085d['define'](_0x4407('0xb'),attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x414f0a,_0x3c1aee,_0x450cd4){if(_0x414f0a['changed']('closed')){_0x414f0a['closedAt']=moment()[_0x4407('0xc')](_0x4407('0xd'));}_0x450cd4(null,_0x414f0a);}}});}; \ No newline at end of file +var _0x326f=['openchannel_interactions','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0x326f,0xd1));var _0xf326=function(_0xd5dcb9,_0x45f4d8){_0xd5dcb9=_0xd5dcb9-0x0;var _0x1a7944=_0x326f[_0xd5dcb9];return _0x1a7944;};'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':!![],'hooks':{'beforeUpdate':function(_0x1e7b8a,_0x515bfa,_0x4c206c){if(_0x1e7b8a['changed'](_0xf326('0xd'))){_0x1e7b8a[_0xf326('0xe')]=moment()[_0xf326('0xf')](_0xf326('0x10'));}_0x4c206c(null,_0x1e7b8a);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 2598d57..771c118 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 _0x672c=['ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','UpdateOpenchannelInteraction','update','body','options','raw','where','attributes','limit','then','AddTagsToOpenchannelInteraction','OpenchannelInteraction','addTags'];(function(_0x46beb6,_0x4c5b5e){var _0x134eeb=function(_0x1ddb22){while(--_0x1ddb22){_0x46beb6['push'](_0x46beb6['shift']());}};_0x134eeb(++_0x4c5b5e);}(_0x672c,0x11b));var _0xc672=function(_0x27987e,_0x19e3a3){_0x27987e=_0x27987e-0x0;var _0x2cdbbf=_0x672c[_0x27987e];return _0x2cdbbf;};'use strict';var _=require(_0xc672('0x0'));var util=require(_0xc672('0x1'));var moment=require(_0xc672('0x2'));var BPromise=require(_0xc672('0x3'));var rs=require(_0xc672('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc672('0x5'))['db'];var utils=require(_0xc672('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xc672('0x7'));var jayson=require(_0xc672('0x8'));var client=jayson['client'][_0xc672('0x9')]({'port':0x232a});config[_0xc672('0xa')]=_[_0xc672('0xb')](config[_0xc672('0xa')],{'host':_0xc672('0xc'),'port':0x18eb});var socket=require(_0xc672('0xd'))(new Redis(config[_0xc672('0xa')]));require(_0xc672('0xe'))[_0xc672('0xf')](socket);function respondWithRpcPromise(_0x373748,_0x3209f5,_0x9fca32){return new BPromise(function(_0x468c74,_0x4106a2){return client['request'](_0x373748,_0x9fca32)['then'](function(_0x190dc9){logger[_0xc672('0x10')](_0xc672('0x11'),_0x3209f5,_0xc672('0x12'));logger[_0xc672('0x13')](_0xc672('0x14'),_0x3209f5,_0xc672('0x12'),JSON[_0xc672('0x15')](_0x190dc9));if(_0x190dc9[_0xc672('0x16')]){if(_0x190dc9[_0xc672('0x16')]['code']===0x1f4){logger[_0xc672('0x16')](_0xc672('0x11'),_0x3209f5,_0x190dc9[_0xc672('0x16')][_0xc672('0x17')]);return _0x4106a2(_0x190dc9[_0xc672('0x16')]['message']);}logger[_0xc672('0x16')](_0xc672('0x11'),_0x3209f5,_0x190dc9[_0xc672('0x16')][_0xc672('0x17')]);return _0x468c74(_0x190dc9[_0xc672('0x16')]['message']);}else{logger[_0xc672('0x10')](_0xc672('0x11'),_0x3209f5,_0xc672('0x12'));_0x468c74(_0x190dc9['result'][_0xc672('0x17')]);}})[_0xc672('0x18')](function(_0x32dc49){logger[_0xc672('0x16')](_0xc672('0x11'),_0x3209f5,_0x32dc49);_0x4106a2(_0x32dc49);});});}exports[_0xc672('0x19')]=function(_0x323bbc){var _0x45fb22=this;return new Promise(function(_0x40038c,_0x5492c1){return db['OpenchannelInteraction'][_0xc672('0x1a')](_0x323bbc[_0xc672('0x1b')],{'raw':_0x323bbc[_0xc672('0x1c')]?_0x323bbc['options'][_0xc672('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x323bbc[_0xc672('0x1c')]?_0x323bbc['options'][_0xc672('0x1e')]||null:null,'attributes':_0x323bbc['options']?_0x323bbc[_0xc672('0x1c')][_0xc672('0x1f')]||null:null,'limit':_0x323bbc[_0xc672('0x1c')]?_0x323bbc[_0xc672('0x1c')][_0xc672('0x20')]||null:null})[_0xc672('0x21')](function(_0x591955){logger[_0xc672('0x10')]('UpdateOpenchannelInteraction',_0x323bbc);logger[_0xc672('0x13')](_0xc672('0x19'),_0x323bbc,JSON['stringify'](_0x591955));_0x40038c(_0x591955);})[_0xc672('0x18')](function(_0x2558e1){logger[_0xc672('0x16')](_0xc672('0x19'),_0x2558e1[_0xc672('0x17')],_0x323bbc);_0x5492c1(_0x45fb22[_0xc672('0x16')](0x1f4,_0x2558e1[_0xc672('0x17')]));});});};exports[_0xc672('0x22')]=function(_0x1c913c){return new Promise(function(_0x3d7e3d,_0x25aaa9){return db[_0xc672('0x23')]['find']({'where':_0x1c913c['options']?_0x1c913c[_0xc672('0x1c')][_0xc672('0x1e')]||null:null})[_0xc672('0x21')](function(_0x425441){if(_0x425441){return _0x425441[_0xc672('0x24')](_0x1c913c[_0xc672('0x1b')][_0xc672('0x25')],_['omit'](_0x1c913c[_0xc672('0x1b')],[_0xc672('0x25'),'id'])||{});}})[_0xc672('0x26')](function(_0x28c151){logger[_0xc672('0x10')]('AddTags',_0x1c913c);logger['debug'](_0xc672('0x27'),_0x1c913c,JSON['stringify'](_0x28c151));_0x3d7e3d(_0x28c151);})[_0xc672('0x18')](function(_0x24e528){logger[_0xc672('0x16')](_0xc672('0x27'),_0x24e528['message'],_0x1c913c);_0x25aaa9(_this[_0xc672('0x16')](0x1f4,_0x24e528[_0xc672('0x17')]));});});}; \ No newline at end of file +var _0x5b22=['stringify','error','message','info','result','UpdateOpenchannelInteraction','OpenchannelInteraction','update','options','where','attributes','limit','then','catch','AddTagsToOpenchannelInteraction','find','ids','body','AddTags','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xdcb838,_0x136c6f){var _0x2d7758=function(_0x6b53b9){while(--_0x6b53b9){_0xdcb838['push'](_0xdcb838['shift']());}};_0x2d7758(++_0x136c6f);}(_0x5b22,0xab));var _0x25b2=function(_0x41b3ef,_0x1971b5){_0x41b3ef=_0x41b3ef-0x0;var _0x4b003f=_0x5b22[_0x41b3ef];return _0x4b003f;};'use strict';var _=require(_0x25b2('0x0'));var util=require(_0x25b2('0x1'));var moment=require(_0x25b2('0x2'));var BPromise=require(_0x25b2('0x3'));var rs=require(_0x25b2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x25b2('0x5'))(_0x25b2('0x6'));var config=require('../../config/environment');var jayson=require(_0x25b2('0x7'));var client=jayson['client'][_0x25b2('0x8')]({'port':0x232a});config[_0x25b2('0x9')]=_[_0x25b2('0xa')](config[_0x25b2('0x9')],{'host':_0x25b2('0xb'),'port':0x18eb});var socket=require(_0x25b2('0xc'))(new Redis(config[_0x25b2('0x9')]));require(_0x25b2('0xd'))[_0x25b2('0xe')](socket);function respondWithRpcPromise(_0x1b784d,_0xae147d,_0x264a5c){return new BPromise(function(_0x1c2fbf,_0x25a3ff){return client[_0x25b2('0xf')](_0x1b784d,_0x264a5c)['then'](function(_0x2bee67){logger['info'](_0x25b2('0x10'),_0xae147d,_0x25b2('0x11'));logger[_0x25b2('0x12')]('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0xae147d,_0x25b2('0x11'),JSON[_0x25b2('0x13')](_0x2bee67));if(_0x2bee67[_0x25b2('0x14')]){if(_0x2bee67[_0x25b2('0x14')]['code']===0x1f4){logger['error'](_0x25b2('0x10'),_0xae147d,_0x2bee67[_0x25b2('0x14')][_0x25b2('0x15')]);return _0x25a3ff(_0x2bee67['error'][_0x25b2('0x15')]);}logger['error'](_0x25b2('0x10'),_0xae147d,_0x2bee67[_0x25b2('0x14')][_0x25b2('0x15')]);return _0x1c2fbf(_0x2bee67['error'][_0x25b2('0x15')]);}else{logger[_0x25b2('0x16')]('OpenchannelInteraction,\x20%s,\x20%s',_0xae147d,_0x25b2('0x11'));_0x1c2fbf(_0x2bee67[_0x25b2('0x17')][_0x25b2('0x15')]);}})['catch'](function(_0x4bc109){logger['error'](_0x25b2('0x10'),_0xae147d,_0x4bc109);_0x25a3ff(_0x4bc109);});});}exports[_0x25b2('0x18')]=function(_0xd53f){var _0x5ba1fb=this;return new Promise(function(_0x359bb0,_0xa91725){return db[_0x25b2('0x19')][_0x25b2('0x1a')](_0xd53f['body'],{'raw':_0xd53f[_0x25b2('0x1b')]?_0xd53f[_0x25b2('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xd53f[_0x25b2('0x1b')]?_0xd53f[_0x25b2('0x1b')][_0x25b2('0x1c')]||null:null,'attributes':_0xd53f[_0x25b2('0x1b')]?_0xd53f[_0x25b2('0x1b')][_0x25b2('0x1d')]||null:null,'limit':_0xd53f[_0x25b2('0x1b')]?_0xd53f[_0x25b2('0x1b')][_0x25b2('0x1e')]||null:null})[_0x25b2('0x1f')](function(_0x1129f7){logger[_0x25b2('0x16')](_0x25b2('0x18'),_0xd53f);logger[_0x25b2('0x12')](_0x25b2('0x18'),_0xd53f,JSON[_0x25b2('0x13')](_0x1129f7));_0x359bb0(_0x1129f7);})[_0x25b2('0x20')](function(_0x97e278){logger[_0x25b2('0x14')](_0x25b2('0x18'),_0x97e278[_0x25b2('0x15')],_0xd53f);_0xa91725(_0x5ba1fb[_0x25b2('0x14')](0x1f4,_0x97e278['message']));});});};exports[_0x25b2('0x21')]=function(_0x1cf82c){return new Promise(function(_0x299fa8,_0x4efedc){return db['OpenchannelInteraction'][_0x25b2('0x22')]({'where':_0x1cf82c[_0x25b2('0x1b')]?_0x1cf82c[_0x25b2('0x1b')][_0x25b2('0x1c')]||null:null})['then'](function(_0x47a4af){if(_0x47a4af){return _0x47a4af['addTags'](_0x1cf82c['body'][_0x25b2('0x23')],_['omit'](_0x1cf82c[_0x25b2('0x24')],['ids','id'])||{});}})['spread'](function(_0x5a2a4b){logger['info']('AddTags',_0x1cf82c);logger[_0x25b2('0x12')](_0x25b2('0x25'),_0x1cf82c,JSON[_0x25b2('0x13')](_0x5a2a4b));_0x299fa8(_0x5a2a4b);})[_0x25b2('0x20')](function(_0x4d4494){logger[_0x25b2('0x14')]('AddTags',_0x4d4494[_0x25b2('0x15')],_0x1cf82c);_0x4efedc(_this[_0x25b2('0x14')](0x1f4,_0x4d4494[_0x25b2('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 7940095..6759728 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 _0x30bf=['emit','removeListener','length','openchannelInteraction:','save','remove','update'];(function(_0x53eb0a,_0x2bfd55){var _0x4c4828=function(_0x505928){while(--_0x505928){_0x53eb0a['push'](_0x53eb0a['shift']());}};_0x4c4828(++_0x2bfd55);}(_0x30bf,0x1e0));var _0xf30b=function(_0x3c3fc6,_0x4ee641){_0x3c3fc6=_0x3c3fc6-0x0;var _0x26fddc=_0x30bf[_0x3c3fc6];return _0x26fddc;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=[_0xf30b('0x0'),_0xf30b('0x1'),_0xf30b('0x2')];function createListener(_0xb07d25,_0x46d9fd){return function(_0x1395b5){_0x46d9fd[_0xf30b('0x3')](_0xb07d25,_0x1395b5);};}function removeListener(_0x43982a,_0x208d77){return function(){OpenchannelInteractionEvents[_0xf30b('0x4')](_0x43982a,_0x208d77);};}exports['register']=function(_0x512ca5){for(var _0x311882=0x0,_0x275601=events[_0xf30b('0x5')];_0x311882<_0x275601;_0x311882++){var _0x1ca928=events[_0x311882];var _0x30e295=createListener(_0xf30b('0x6')+_0x1ca928,_0x512ca5);OpenchannelInteractionEvents['on'](_0x1ca928,_0x30e295);}}; \ No newline at end of file +var _0x9977=['removeListener','register','length','./openchannelInteraction.events','save','remove','update'];(function(_0x31045c,_0x25e7b7){var _0x56b6c6=function(_0x3ec7da){while(--_0x3ec7da){_0x31045c['push'](_0x31045c['shift']());}};_0x56b6c6(++_0x25e7b7);}(_0x9977,0xd5));var _0x7997=function(_0x135448,_0x4ca19f){_0x135448=_0x135448-0x0;var _0x28389e=_0x9977[_0x135448];return _0x28389e;};'use strict';var OpenchannelInteractionEvents=require(_0x7997('0x0'));var events=[_0x7997('0x1'),_0x7997('0x2'),_0x7997('0x3')];function createListener(_0x1fae9f,_0xc4b405){return function(_0x49bfbf){_0xc4b405['emit'](_0x1fae9f,_0x49bfbf);};}function removeListener(_0x2ba7c3,_0x3fd1f9){return function(){OpenchannelInteractionEvents[_0x7997('0x4')](_0x2ba7c3,_0x3fd1f9);};}exports[_0x7997('0x5')]=function(_0x27e53a){for(var _0x518598=0x0,_0x4e4ea5=events[_0x7997('0x6')];_0x518598<_0x4e4ea5;_0x518598++){var _0x30f26e=events[_0x518598];var _0x97a81f=createListener('openchannelInteraction:'+_0x30f26e,_0x27e53a);OpenchannelInteractionEvents['on'](_0x30f26e,_0x97a81f);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 4798abe..c0913b3 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 _0xb7d4=['/:id/accept','accept','put','/:id/reject','reject','delete','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./openchannelMessage.controller','get','isAuthenticated','/:id','show','post','tracked','openchannel','openchannelmessage:create','create','update'];(function(_0x4200de,_0x13b570){var _0x459c7b=function(_0x7d733b){while(--_0x7d733b){_0x4200de['push'](_0x4200de['shift']());}};_0x459c7b(++_0x13b570);}(_0xb7d4,0x102));var _0x4b7d=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0xb7d4[_0x1deb03];return _0x189fe7;};'use strict';var multer=require('multer');var util=require(_0x4b7d('0x0'));var path=require(_0x4b7d('0x1'));var timeout=require(_0x4b7d('0x2'));var express=require('express');var router=express[_0x4b7d('0x3')]();var auth=require(_0x4b7d('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x4b7d('0x5'));var controller=require(_0x4b7d('0x6'));router[_0x4b7d('0x7')]('/',auth[_0x4b7d('0x8')](),controller['index']);router['get']('/describe',auth[_0x4b7d('0x8')](),controller['describe']);router[_0x4b7d('0x7')](_0x4b7d('0x9'),auth[_0x4b7d('0x8')](),controller[_0x4b7d('0xa')]);router[_0x4b7d('0xb')]('/',auth['isAuthenticated'](),interaction[_0x4b7d('0xc')](_0x4b7d('0xd'),_0x4b7d('0xe')),controller[_0x4b7d('0xf')]);router['put'](_0x4b7d('0x9'),auth['isAuthenticated'](),controller[_0x4b7d('0x10')]);router['put'](_0x4b7d('0x11'),auth[_0x4b7d('0x8')](),controller[_0x4b7d('0x12')]);router[_0x4b7d('0x13')](_0x4b7d('0x14'),auth[_0x4b7d('0x8')](),controller[_0x4b7d('0x15')]);router[_0x4b7d('0x16')](_0x4b7d('0x9'),auth['isAuthenticated'](),controller[_0x4b7d('0x17')]);module[_0x4b7d('0x18')]=router; \ No newline at end of file +var _0xd1e0=['get','/describe','describe','/:id','show','post','tracked','openchannelmessage:create','create','put','update','/:id/accept','accept','/:id/reject','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0x2e2104,_0x11287d){var _0x1280c5=function(_0x533646){while(--_0x533646){_0x2e2104['push'](_0x2e2104['shift']());}};_0x1280c5(++_0x11287d);}(_0xd1e0,0x1b1));var _0x0d1e=function(_0x2f71f6,_0x3a1f4d){_0x2f71f6=_0x2f71f6-0x0;var _0x2b23ea=_0xd1e0[_0x2f71f6];return _0x2b23ea;};'use strict';var multer=require(_0x0d1e('0x0'));var util=require(_0x0d1e('0x1'));var path=require('path');var timeout=require(_0x0d1e('0x2'));var express=require(_0x0d1e('0x3'));var router=express[_0x0d1e('0x4')]();var auth=require(_0x0d1e('0x5'));var interaction=require(_0x0d1e('0x6'));var config=require(_0x0d1e('0x7'));var controller=require('./openchannelMessage.controller');router['get']('/',auth[_0x0d1e('0x8')](),controller['index']);router[_0x0d1e('0x9')](_0x0d1e('0xa'),auth[_0x0d1e('0x8')](),controller[_0x0d1e('0xb')]);router[_0x0d1e('0x9')](_0x0d1e('0xc'),auth['isAuthenticated'](),controller[_0x0d1e('0xd')]);router[_0x0d1e('0xe')]('/',auth[_0x0d1e('0x8')](),interaction[_0x0d1e('0xf')]('openchannel',_0x0d1e('0x10')),controller[_0x0d1e('0x11')]);router[_0x0d1e('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x0d1e('0x13')]);router[_0x0d1e('0x12')](_0x0d1e('0x14'),auth[_0x0d1e('0x8')](),controller[_0x0d1e('0x15')]);router[_0x0d1e('0x12')](_0x0d1e('0x16'),auth['isAuthenticated'](),controller['reject']);router[_0x0d1e('0x17')](_0x0d1e('0xc'),auth['isAuthenticated'](),controller[_0x0d1e('0x18')]);module[_0x0d1e('0x19')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index e567889..0f0edae 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 _0xf5f2=['exports','TEXT','BOOLEAN','ENUM','out','DATE','sequelize'];(function(_0x3494c8,_0x34b9d1){var _0x55a105=function(_0x193fc8){while(--_0x193fc8){_0x3494c8['push'](_0x3494c8['shift']());}};_0x55a105(++_0x34b9d1);}(_0xf5f2,0xbc));var _0x2f5f=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xf5f2[_0x1035c1];return _0x308d67;};'use strict';var Sequelize=require(_0x2f5f('0x0'));module[_0x2f5f('0x1')]={'body':{'type':Sequelize[_0x2f5f('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x2f5f('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x2f5f('0x4')]('in',_0x2f5f('0x5')),'defaultValue':_0x2f5f('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x2f5f('0x6')]}}; \ No newline at end of file +var _0x4767=['ENUM','out','DATE','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x36de71,_0x1df9cf){var _0x1dbb0f=function(_0x3081ce){while(--_0x3081ce){_0x36de71['push'](_0x36de71['shift']());}};_0x1dbb0f(++_0x1df9cf);}(_0x4767,0xc3));var _0x7476=function(_0x3d75e0,_0x260e76){_0x3d75e0=_0x3d75e0-0x0;var _0x5bda40=_0x4767[_0x3d75e0];return _0x5bda40;};'use strict';var Sequelize=require(_0x7476('0x0'));module[_0x7476('0x1')]={'body':{'type':Sequelize[_0x7476('0x2')](_0x7476('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x7476('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x7476('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x7476('0x5')]('in',_0x7476('0x6')),'defaultValue':_0x7476('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0x7476('0x7')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 15b490f..616ee17 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 _0xbf76=['to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','http','test','Sequelize','request','then','info','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','sendStatus','status','end','json','offset','limit','set','Content-Range','reject','save','update','destroy','stack','name','send','index','map','OpenchannelMessage','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','order','sort','where','pick','merge','VIRTUAL','options','count','includeAll','show','params','include','find','create','body','openchannel-interactions','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','null','acceptMessage','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','../../config/logger','interaction','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','rejectmessage','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox'];(function(_0x101039,_0x506246){var _0x19eaf0=function(_0x233a9c){while(--_0x233a9c){_0x101039['push'](_0x101039['shift']());}};_0x19eaf0(++_0x506246);}(_0xbf76,0x1bf));var _0x6bf7=function(_0x25cf75,_0x549314){_0x25cf75=_0x25cf75-0x0;var _0x26c9f0=_0xbf76[_0x25cf75];return _0x26c9f0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6bf7('0x0'));var rimraf=require(_0x6bf7('0x1'));var zipdir=require(_0x6bf7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6bf7('0x3'));var moment=require('moment');var BPromise=require(_0x6bf7('0x4'));var Mustache=require(_0x6bf7('0x5'));var util=require(_0x6bf7('0x6'));var path=require(_0x6bf7('0x7'));var sox=require(_0x6bf7('0x8'));var csv=require(_0x6bf7('0x9'));var ejs=require(_0x6bf7('0xa'));var fs=require('fs');var _=require(_0x6bf7('0xb'));var squel=require(_0x6bf7('0xc'));var crypto=require(_0x6bf7('0xd'));var jsforce=require(_0x6bf7('0xe'));var deskjs=require(_0x6bf7('0xf'));var toCsv=require(_0x6bf7('0x9'));var querystring=require(_0x6bf7('0x10'));var Papa=require('papaparse');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('../../config/logger')(_0x6bf7('0x11'));var utils=require(_0x6bf7('0x12'));var config=require(_0x6bf7('0x13'));var db=require(_0x6bf7('0x14'))['db'];config[_0x6bf7('0x15')]=_['defaults'](config['redis'],{'host':_0x6bf7('0x16'),'port':0x18eb});var socket=require(_0x6bf7('0x17'))(new Redis(config[_0x6bf7('0x15')]));require('./openchannelMessage.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x6bf7('0x18')]({'port':0x232c});var client9002=jayson['client'][_0x6bf7('0x18')]({'port':0x232a});function checkPasswordPattern(_0x256756,_0x5665fb,_0x376aaa){if(_0x376aaa){var _0x544a66=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x544a66[_0x6bf7('0x19')](_0x5665fb)){return _0x256756;}else{throw new db[(_0x6bf7('0x1a'))]['ValidationError']('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x256756;}}function respondWithRpcPromise(_0x13f105,_0x3f1587,_0x2c267f,_0x308391){return new BPromise(function(_0x5b830e,_0x252d78){var _0x58bf59=_0x308391||client;return _0x58bf59[_0x6bf7('0x1b')](_0x13f105,_0x2c267f)[_0x6bf7('0x1c')](function(_0x8a9f73){logger[_0x6bf7('0x1d')](_0x6bf7('0x1e'),_0x3f1587,'request\x20sent');logger[_0x6bf7('0x1f')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x3f1587,_0x6bf7('0x20'),JSON[_0x6bf7('0x21')](_0x8a9f73));if(_0x8a9f73[_0x6bf7('0x22')]){if(_0x8a9f73[_0x6bf7('0x22')][_0x6bf7('0x23')]===0x1f4){logger[_0x6bf7('0x22')]('OpenchannelMessage,\x20%s,\x20%s',_0x3f1587,_0x8a9f73[_0x6bf7('0x22')]['message']);return _0x252d78(_0x8a9f73[_0x6bf7('0x22')]['message']);}logger[_0x6bf7('0x22')](_0x6bf7('0x1e'),_0x3f1587,_0x8a9f73[_0x6bf7('0x22')][_0x6bf7('0x24')]);return _0x5b830e(_0x8a9f73[_0x6bf7('0x22')][_0x6bf7('0x24')]);}else{logger['info'](_0x6bf7('0x1e'),_0x3f1587,_0x6bf7('0x20'));_0x5b830e(_0x8a9f73['result'][_0x6bf7('0x24')]);}})[_0x6bf7('0x25')](function(_0x31f18b){logger[_0x6bf7('0x22')]('OpenchannelMessage,\x20%s,\x20%s',_0x3f1587,_0x31f18b);_0x252d78(_0x31f18b);});});}function respondWithStatusCode(_0x4597f1,_0x5646ea){_0x5646ea=_0x5646ea||0xcc;return function(_0x6f4986){if(_0x6f4986){return _0x4597f1[_0x6bf7('0x26')](_0x5646ea);}return _0x4597f1[_0x6bf7('0x27')](_0x5646ea)[_0x6bf7('0x28')]();};}function respondWithResult(_0x58c3c7,_0x660b3f){_0x660b3f=_0x660b3f||0xc8;return function(_0xd29323){if(_0xd29323){return _0x58c3c7[_0x6bf7('0x27')](_0x660b3f)[_0x6bf7('0x29')](_0xd29323);}};}function respondWithFilteredResult(_0x392056,_0x2662f3){return function(_0x18d231){if(_0x18d231){var _0x55a959=_0x18d231['count'],_0x18d3c0=_0x2662f3['offset'],_0x5d9898=_0x2662f3[_0x6bf7('0x2a')]+_0x2662f3[_0x6bf7('0x2b')],_0x199e87;if(_0x5d9898>=_0x55a959){_0x5d9898=_0x55a959;_0x199e87=0xc8;}else{_0x199e87=0xce;}_0x392056[_0x6bf7('0x27')](_0x199e87);return _0x392056[_0x6bf7('0x2c')](_0x6bf7('0x2d'),_0x18d3c0+'-'+_0x5d9898+'/'+_0x55a959)['json'](_0x18d231);}return null;};}function patchUpdates(_0x21e66b){return function(_0x284016){try{jsonpatch['apply'](_0x284016,_0x21e66b,!![]);}catch(_0x18da59){return BPromise[_0x6bf7('0x2e')](_0x18da59);}return _0x284016[_0x6bf7('0x2f')]();};}function saveUpdates(_0x294063,_0x45edd4){return function(_0x1887c6){if(_0x1887c6){return _0x1887c6[_0x6bf7('0x30')](_0x294063)['then'](function(_0x514704){return _0x514704;});}return null;};}function removeEntity(_0x390d85,_0x32665a){return function(_0x3bee4e){if(_0x3bee4e){return _0x3bee4e[_0x6bf7('0x31')]()[_0x6bf7('0x1c')](function(){_0x390d85[_0x6bf7('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x333274,_0x3bdb6b){return function(_0x535724){if(!_0x535724){_0x333274[_0x6bf7('0x26')](0x194);}return _0x535724;};}function handleError(_0x1c1257,_0x7661af){_0x7661af=_0x7661af||0x1f4;return function(_0x4dd74d){logger[_0x6bf7('0x22')](_0x4dd74d[_0x6bf7('0x32')]);if(_0x4dd74d[_0x6bf7('0x33')]){delete _0x4dd74d[_0x6bf7('0x33')];}_0x1c1257[_0x6bf7('0x27')](_0x7661af)[_0x6bf7('0x34')](_0x4dd74d);};}exports[_0x6bf7('0x35')]=function(_0x9c1e68,_0x5594ce){var _0x4e643c={},_0x15422e={},_0x4c6305={'count':0x0,'rows':[]};var _0x52411b=_[_0x6bf7('0x36')](db[_0x6bf7('0x37')][_0x6bf7('0x38')],function(_0x10022b){return{'name':_0x10022b[_0x6bf7('0x39')],'type':_0x10022b[_0x6bf7('0x3a')]['key']};});_0x15422e[_0x6bf7('0x3b')]=_[_0x6bf7('0x36')](_0x52411b,'name');_0x15422e['query']=_[_0x6bf7('0x3c')](_0x9c1e68[_0x6bf7('0x3d')]);_0x15422e[_0x6bf7('0x3e')]=_[_0x6bf7('0x3f')](_0x15422e[_0x6bf7('0x3b')],_0x15422e[_0x6bf7('0x3d')]);_0x4e643c[_0x6bf7('0x40')]=_[_0x6bf7('0x3f')](_0x15422e[_0x6bf7('0x3b')],qs[_0x6bf7('0x41')](_0x9c1e68[_0x6bf7('0x3d')][_0x6bf7('0x41')]));_0x4e643c['attributes']=_0x4e643c[_0x6bf7('0x40')][_0x6bf7('0x42')]?_0x4e643c[_0x6bf7('0x40')]:_0x15422e[_0x6bf7('0x3b')];if(!_0x9c1e68['query']['hasOwnProperty']('nolimit')){_0x4e643c['limit']=qs[_0x6bf7('0x2b')](_0x9c1e68['query'][_0x6bf7('0x2b')]);_0x4e643c[_0x6bf7('0x2a')]=qs[_0x6bf7('0x2a')](_0x9c1e68[_0x6bf7('0x3d')][_0x6bf7('0x2a')]);}_0x4e643c[_0x6bf7('0x43')]=qs[_0x6bf7('0x44')](_0x9c1e68[_0x6bf7('0x3d')][_0x6bf7('0x44')]);_0x4e643c[_0x6bf7('0x45')]=qs[_0x6bf7('0x3e')](_[_0x6bf7('0x46')](_0x9c1e68['query'],_0x15422e[_0x6bf7('0x3e')]));if(_0x9c1e68['query']['filter']){_0x4e643c['where']=_[_0x6bf7('0x47')](_0x4e643c[_0x6bf7('0x45')],{'$or':_[_0x6bf7('0x36')](_0x52411b,function(_0x1740a3){if(_0x1740a3['type']!==_0x6bf7('0x48')){var _0x198a13={};_0x198a13[_0x1740a3[_0x6bf7('0x33')]]={'$like':'%'+_0x9c1e68[_0x6bf7('0x3d')]['filter']+'%'};return _0x198a13;}})});}_0x4e643c=_[_0x6bf7('0x47')]({},_0x4e643c,_0x9c1e68[_0x6bf7('0x49')]);var _0x597749={'where':_0x4e643c[_0x6bf7('0x45')]};return db[_0x6bf7('0x37')][_0x6bf7('0x4a')](_0x597749)[_0x6bf7('0x1c')](function(_0xb97118){_0x4c6305[_0x6bf7('0x4a')]=_0xb97118;if(_0x9c1e68[_0x6bf7('0x3d')][_0x6bf7('0x4b')]){_0x4e643c['include']=[{'all':!![]}];}return db[_0x6bf7('0x37')]['findAll'](_0x4e643c);})[_0x6bf7('0x1c')](function(_0x2dbf85){_0x4c6305['rows']=_0x2dbf85;return _0x4c6305;})[_0x6bf7('0x1c')](respondWithFilteredResult(_0x5594ce,_0x4e643c))[_0x6bf7('0x25')](handleError(_0x5594ce,null));};exports[_0x6bf7('0x4c')]=function(_0x41e605,_0x597683){var _0x4b46ef={'raw':!![],'where':{'id':_0x41e605[_0x6bf7('0x4d')]['id']}},_0x241697={};_0x241697['model']=_[_0x6bf7('0x3c')](db[_0x6bf7('0x37')][_0x6bf7('0x38')]);_0x241697[_0x6bf7('0x3d')]=_[_0x6bf7('0x3c')](_0x41e605[_0x6bf7('0x3d')]);_0x241697['filters']=_[_0x6bf7('0x3f')](_0x241697['model'],_0x241697['query']);_0x4b46ef[_0x6bf7('0x40')]=_[_0x6bf7('0x3f')](_0x241697[_0x6bf7('0x3b')],qs[_0x6bf7('0x41')](_0x41e605['query']['fields']));_0x4b46ef[_0x6bf7('0x40')]=_0x4b46ef[_0x6bf7('0x40')]['length']?_0x4b46ef[_0x6bf7('0x40')]:_0x241697['model'];if(_0x41e605[_0x6bf7('0x3d')][_0x6bf7('0x4b')]){_0x4b46ef[_0x6bf7('0x4e')]=[{'all':!![]}];}_0x4b46ef=_[_0x6bf7('0x47')]({},_0x4b46ef,_0x41e605[_0x6bf7('0x49')]);return db[_0x6bf7('0x37')][_0x6bf7('0x4f')](_0x4b46ef)[_0x6bf7('0x1c')](handleEntityNotFound(_0x597683,null))[_0x6bf7('0x1c')](respondWithResult(_0x597683,null))[_0x6bf7('0x25')](handleError(_0x597683,null));};exports['create']=function(_0x927bef,_0x1b199d){return db[_0x6bf7('0x37')][_0x6bf7('0x50')](_0x927bef[_0x6bf7('0x51')],{})[_0x6bf7('0x1c')](respondWithResult(_0x1b199d,0xc9))[_0x6bf7('0x25')](handleError(_0x1b199d,null));};exports['update']=function(_0xe8a4de,_0x2c3ba0){if(_0xe8a4de[_0x6bf7('0x51')]['id']){delete _0xe8a4de[_0x6bf7('0x51')]['id'];}return db[_0x6bf7('0x37')][_0x6bf7('0x4f')]({'where':{'id':_0xe8a4de[_0x6bf7('0x4d')]['id']}})[_0x6bf7('0x1c')](handleEntityNotFound(_0x2c3ba0,null))[_0x6bf7('0x1c')](saveUpdates(_0xe8a4de[_0x6bf7('0x51')],null))[_0x6bf7('0x1c')](respondWithResult(_0x2c3ba0,null))[_0x6bf7('0x25')](handleError(_0x2c3ba0,null));};exports[_0x6bf7('0x31')]=function(_0x23d3a2,_0x323156){return db[_0x6bf7('0x37')]['find']({'where':{'id':_0x23d3a2[_0x6bf7('0x4d')]['id']}})[_0x6bf7('0x1c')](handleEntityNotFound(_0x323156,null))[_0x6bf7('0x1c')](removeEntity(_0x323156,null))['catch'](handleError(_0x323156,null));};exports['describe']=function(_0x13eeda,_0x126291){return db[_0x6bf7('0x37')]['describe']()[_0x6bf7('0x1c')](respondWithResult(_0x126291,null))[_0x6bf7('0x25')](handleError(_0x126291,null));};var interaction_log=require('../../config/logger')(_0x6bf7('0x52'));exports[_0x6bf7('0x53')]=function(_0x1e16ea,_0x480949,_0x566dbb){var _0x103898={'channel':_0x6bf7('0x54')};if(_0x1e16ea[_0x6bf7('0x51')]['id']){delete _0x1e16ea[_0x6bf7('0x51')]['id'];}_0x1e16ea[_0x6bf7('0x51')][_0x6bf7('0x55')]=!![];_0x1e16ea['body'][_0x6bf7('0x56')]=moment()[_0x6bf7('0x57')](_0x6bf7('0x58'));_0x1e16ea['body'][_0x6bf7('0x59')]=_0x1e16ea['body']['UserId']||_0x1e16ea[_0x6bf7('0x5a')]['id'];return db[_0x6bf7('0x37')][_0x6bf7('0x4f')]({'where':{'id':_0x1e16ea[_0x6bf7('0x4d')]['id'],'UserId':null},'include':[{'model':db[_0x6bf7('0x5b')],'as':'Contact'}]})[_0x6bf7('0x1c')](handleEntityNotFound(_0x480949,null))[_0x6bf7('0x1c')](saveUpdates(_0x1e16ea[_0x6bf7('0x51')],null))[_0x6bf7('0x1c')](function(_0x373de2){if(_0x373de2){_0x103898['message']=_0x373de2[_0x6bf7('0x5c')]({'plain':!![]});return db[_0x6bf7('0x5d')][_0x6bf7('0x4f')]({'where':{'id':_0x373de2[_0x6bf7('0x5e')]}});}return null;})[_0x6bf7('0x1c')](handleEntityNotFound(_0x480949,null))['then'](function(_0x353b7c){if(_0x353b7c){return _0x353b7c['update']({'UserId':_0x1e16ea['body'][_0x6bf7('0x59')],'read1stAt':_[_0x6bf7('0x5f')](_0x353b7c[_0x6bf7('0x60')])?moment()[_0x6bf7('0x57')](_0x6bf7('0x58')):undefined});}return null;})[_0x6bf7('0x1c')](function(_0x4c2eb9){if(_0x4c2eb9){_0x103898['interaction']=_0x4c2eb9[_0x6bf7('0x5c')]({'plain':!![]});interaction_log[_0x6bf7('0x1d')](_0x6bf7('0x61'),_0x1e16ea[_0x6bf7('0x5a')]['id'],_0x1e16ea[_0x6bf7('0x5a')][_0x6bf7('0x33')],_0x1e16ea[_0x6bf7('0x5a')][_0x6bf7('0x62')],_0x103898['interaction']['id'],_0x1e16ea[_0x6bf7('0x51')]?JSON[_0x6bf7('0x21')](_0x1e16ea[_0x6bf7('0x51')]):_0x6bf7('0x63'));return respondWithRpcPromise('AcceptMessage',_0x6bf7('0x64'),_0x103898);}return null;})[_0x6bf7('0x1c')](function(_0x4aa8d2){if(_0x4aa8d2){if(_0x1e16ea[_0x6bf7('0x51')][_0x6bf7('0x65')]){_0x103898[_0x6bf7('0x24')][_0x6bf7('0x66')]=util['format'](_0x6bf7('0x67'),_0x1e16ea[_0x6bf7('0x5a')][_0x6bf7('0x33')]);_0x103898['message']['channel']=_0x103898[_0x6bf7('0x68')];_0x103898[_0x6bf7('0x24')][_0x6bf7('0x69')]=_0x6bf7('0x53');return respondWithRpcPromise('EventManager',_0x6bf7('0x6a'),{'event':_0x6bf7('0x6b'),'message':_0x103898[_0x6bf7('0x24')]},client9002)[_0x6bf7('0x1c')](function(){return _0x103898;});}return _0x103898;}return null;})[_0x6bf7('0x1c')](respondWithResult(_0x480949,null))[_0x6bf7('0x25')](handleError(_0x480949,null));};var interaction_log=require(_0x6bf7('0x6c'))('openchannel-interactions');exports[_0x6bf7('0x2e')]=function(_0x2152ab,_0x2f534b,_0x52ed93){var _0x5e3e3f={'agent':{},'channel':_0x6bf7('0x54')};if(_0x2152ab[_0x6bf7('0x51')]['id']){delete _0x2152ab[_0x6bf7('0x51')]['id'];}_0x2152ab[_0x6bf7('0x51')]['UserId']=_0x2152ab['body'][_0x6bf7('0x59')]||_0x2152ab[_0x6bf7('0x5a')]['id'];_0x5e3e3f['agent']['id']=_0x2152ab[_0x6bf7('0x51')][_0x6bf7('0x59')];return db[_0x6bf7('0x37')][_0x6bf7('0x4f')]({'where':{'id':_0x2152ab[_0x6bf7('0x4d')]['id'],'UserId':null}})[_0x6bf7('0x1c')](handleEntityNotFound(_0x2f534b,null))['then'](function(_0x2bf957){if(_0x2bf957){_0x5e3e3f[_0x6bf7('0x24')]=_0x2bf957['get']({'plain':!![]});return db['OpenchannelInteraction'][_0x6bf7('0x4f')]({'where':{'id':_0x2bf957[_0x6bf7('0x5e')]}});}return null;})['then'](handleEntityNotFound(_0x2f534b,null))[_0x6bf7('0x1c')](function(_0x5108ac){if(_0x5108ac){_0x5e3e3f[_0x6bf7('0x6d')]=_0x5108ac['get']({'plain':!![]});interaction_log[_0x6bf7('0x1d')](_0x6bf7('0x6e'),_0x2152ab[_0x6bf7('0x5a')]['id'],_0x2152ab[_0x6bf7('0x5a')][_0x6bf7('0x33')],_0x2152ab['user'][_0x6bf7('0x62')],_0x5e3e3f[_0x6bf7('0x6d')]['id'],_0x2152ab['body']?JSON[_0x6bf7('0x21')](_0x2152ab[_0x6bf7('0x51')]):'null');return respondWithRpcPromise(_0x6bf7('0x6f'),_0x6bf7('0x70'),_0x5e3e3f);}return null;})['then'](function(_0x3f97ed){if(_0x3f97ed){_0x3f97ed[_0x6bf7('0x24')]['interface']=util['format'](_0x6bf7('0x67'),_0x2152ab[_0x6bf7('0x5a')][_0x6bf7('0x33')]);_0x3f97ed[_0x6bf7('0x24')]['channel']=_0x5e3e3f[_0x6bf7('0x68')];_0x3f97ed[_0x6bf7('0x24')][_0x6bf7('0x69')]='reject';respondWithRpcPromise(_0x6bf7('0x6a'),_0x6bf7('0x6a'),{'event':_0x6bf7('0x71'),'message':_0x3f97ed[_0x6bf7('0x24')]},client9002);return _0x5e3e3f;}return null;})[_0x6bf7('0x1c')](respondWithResult(_0x2f534b,null))[_0x6bf7('0x25')](handleError(_0x2f534b,null));}; \ No newline at end of file +var _0x986c=['rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','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/logger','../../config/utils','../../mysqldb','redis','defaults','localhost','./openchannelMessage.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','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','status','end','json','count','offset','limit','Content-Range','apply','reject','save','destroy','sendStatus','name','send','index','map','OpenchannelMessage','rawAttributes','fieldName','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','show','find','catch','create','body','update','params','describe','accept','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','OpenchannelInteraction','OpenchannelInteractionId','read1stAt','interaction','role','null','acceptMessage','interface','SIP/%s','channel','event','EventManager','acceptmessage','agent','get','rejectMessage'];(function(_0x4d00e7,_0x459159){var _0x6a1f5d=function(_0x5ea9a3){while(--_0x5ea9a3){_0x4d00e7['push'](_0x4d00e7['shift']());}};_0x6a1f5d(++_0x459159);}(_0x986c,0xf9));var _0xc986=function(_0x4fcbc6,_0x43d00a){_0x4fcbc6=_0x4fcbc6-0x0;var _0x1409f0=_0x986c[_0x4fcbc6];return _0x1409f0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xc986('0x0'));var rimraf=require(_0xc986('0x1'));var zipdir=require(_0xc986('0x2'));var jsonpatch=require(_0xc986('0x3'));var rp=require(_0xc986('0x4'));var moment=require(_0xc986('0x5'));var BPromise=require(_0xc986('0x6'));var Mustache=require(_0xc986('0x7'));var util=require(_0xc986('0x8'));var path=require(_0xc986('0x9'));var sox=require(_0xc986('0xa'));var csv=require(_0xc986('0xb'));var ejs=require(_0xc986('0xc'));var fs=require('fs');var _=require(_0xc986('0xd'));var squel=require(_0xc986('0xe'));var crypto=require(_0xc986('0xf'));var jsforce=require(_0xc986('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xc986('0xb'));var querystring=require('querystring');var Papa=require(_0xc986('0x11'));var Redis=require(_0xc986('0x12'));var authService=require(_0xc986('0x13'));var qs=require(_0xc986('0x14'));var as=require(_0xc986('0x15'));var hardwareService=require(_0xc986('0x16'));var logger=require(_0xc986('0x17'))('api');var utils=require(_0xc986('0x18'));var config=require('../../config/environment');var db=require(_0xc986('0x19'))['db'];config[_0xc986('0x1a')]=_[_0xc986('0x1b')](config['redis'],{'host':_0xc986('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc986('0x1a')]));require(_0xc986('0x1d'))[_0xc986('0x1e')](socket);var jayson=require(_0xc986('0x1f'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0xc986('0x20')][_0xc986('0x21')]({'port':0x232a});function checkPasswordPattern(_0x5debbe,_0xdce5c3,_0x4d2e21){if(_0x4d2e21){var _0x2a77b7=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2a77b7[_0xc986('0x22')](_0xdce5c3)){return _0x5debbe;}else{throw new db[(_0xc986('0x23'))][(_0xc986('0x24'))](_0xc986('0x25'));}}else{return _0x5debbe;}}function respondWithRpcPromise(_0x38e5ea,_0x9da89f,_0x2ffdec,_0x2d22c7){return new BPromise(function(_0x33bf6a,_0x18541){var _0x4c46ab=_0x2d22c7||client;return _0x4c46ab[_0xc986('0x26')](_0x38e5ea,_0x2ffdec)[_0xc986('0x27')](function(_0x465d77){logger[_0xc986('0x28')](_0xc986('0x29'),_0x9da89f,_0xc986('0x2a'));logger[_0xc986('0x2b')](_0xc986('0x2c'),_0x9da89f,_0xc986('0x2a'),JSON[_0xc986('0x2d')](_0x465d77));if(_0x465d77[_0xc986('0x2e')]){if(_0x465d77['error']['code']===0x1f4){logger['error'](_0xc986('0x29'),_0x9da89f,_0x465d77[_0xc986('0x2e')][_0xc986('0x2f')]);return _0x18541(_0x465d77[_0xc986('0x2e')][_0xc986('0x2f')]);}logger[_0xc986('0x2e')](_0xc986('0x29'),_0x9da89f,_0x465d77[_0xc986('0x2e')][_0xc986('0x2f')]);return _0x33bf6a(_0x465d77[_0xc986('0x2e')][_0xc986('0x2f')]);}else{logger['info'](_0xc986('0x29'),_0x9da89f,_0xc986('0x2a'));_0x33bf6a(_0x465d77[_0xc986('0x30')]['message']);}})['catch'](function(_0x366bad){logger[_0xc986('0x2e')]('OpenchannelMessage,\x20%s,\x20%s',_0x9da89f,_0x366bad);_0x18541(_0x366bad);});});}function respondWithStatusCode(_0x4c8558,_0x585b0f){_0x585b0f=_0x585b0f||0xcc;return function(_0x12e70c){if(_0x12e70c){return _0x4c8558['sendStatus'](_0x585b0f);}return _0x4c8558[_0xc986('0x31')](_0x585b0f)[_0xc986('0x32')]();};}function respondWithResult(_0x2ffa56,_0x31b67c){_0x31b67c=_0x31b67c||0xc8;return function(_0x5432f8){if(_0x5432f8){return _0x2ffa56[_0xc986('0x31')](_0x31b67c)[_0xc986('0x33')](_0x5432f8);}};}function respondWithFilteredResult(_0x35ac46,_0x287723){return function(_0x1477ad){if(_0x1477ad){var _0x10ac7d=_0x1477ad[_0xc986('0x34')],_0x5124f7=_0x287723['offset'],_0x283c73=_0x287723[_0xc986('0x35')]+_0x287723[_0xc986('0x36')],_0x31226e;if(_0x283c73>=_0x10ac7d){_0x283c73=_0x10ac7d;_0x31226e=0xc8;}else{_0x31226e=0xce;}_0x35ac46[_0xc986('0x31')](_0x31226e);return _0x35ac46['set'](_0xc986('0x37'),_0x5124f7+'-'+_0x283c73+'/'+_0x10ac7d)['json'](_0x1477ad);}return null;};}function patchUpdates(_0x41ccbc){return function(_0x243b61){try{jsonpatch[_0xc986('0x38')](_0x243b61,_0x41ccbc,!![]);}catch(_0x20ca1c){return BPromise[_0xc986('0x39')](_0x20ca1c);}return _0x243b61[_0xc986('0x3a')]();};}function saveUpdates(_0x39d083,_0x48397d){return function(_0x3f18ba){if(_0x3f18ba){return _0x3f18ba['update'](_0x39d083)[_0xc986('0x27')](function(_0xef7750){return _0xef7750;});}return null;};}function removeEntity(_0x454b78,_0x33dbd5){return function(_0xfc53bf){if(_0xfc53bf){return _0xfc53bf[_0xc986('0x3b')]()['then'](function(){_0x454b78[_0xc986('0x31')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ad962,_0x5c4fbd){return function(_0x27be7f){if(!_0x27be7f){_0x1ad962[_0xc986('0x3c')](0x194);}return _0x27be7f;};}function handleError(_0x3edf82,_0x197d63){_0x197d63=_0x197d63||0x1f4;return function(_0x528ca4){logger[_0xc986('0x2e')](_0x528ca4['stack']);if(_0x528ca4[_0xc986('0x3d')]){delete _0x528ca4[_0xc986('0x3d')];}_0x3edf82[_0xc986('0x31')](_0x197d63)[_0xc986('0x3e')](_0x528ca4);};}exports[_0xc986('0x3f')]=function(_0x2b2490,_0x5943a0){var _0x8fbd37={},_0x494603={},_0x67aa22={'count':0x0,'rows':[]};var _0x50f2cf=_[_0xc986('0x40')](db[_0xc986('0x41')][_0xc986('0x42')],function(_0x4ee9b3){return{'name':_0x4ee9b3[_0xc986('0x43')],'type':_0x4ee9b3[_0xc986('0x44')]['key']};});_0x494603[_0xc986('0x45')]=_[_0xc986('0x40')](_0x50f2cf,'name');_0x494603[_0xc986('0x46')]=_[_0xc986('0x47')](_0x2b2490['query']);_0x494603['filters']=_[_0xc986('0x48')](_0x494603[_0xc986('0x45')],_0x494603[_0xc986('0x46')]);_0x8fbd37['attributes']=_['intersection'](_0x494603['model'],qs[_0xc986('0x49')](_0x2b2490[_0xc986('0x46')]['fields']));_0x8fbd37[_0xc986('0x4a')]=_0x8fbd37[_0xc986('0x4a')][_0xc986('0x4b')]?_0x8fbd37[_0xc986('0x4a')]:_0x494603[_0xc986('0x45')];if(!_0x2b2490[_0xc986('0x46')][_0xc986('0x4c')](_0xc986('0x4d'))){_0x8fbd37['limit']=qs[_0xc986('0x36')](_0x2b2490['query'][_0xc986('0x36')]);_0x8fbd37[_0xc986('0x35')]=qs[_0xc986('0x35')](_0x2b2490[_0xc986('0x46')]['offset']);}_0x8fbd37[_0xc986('0x4e')]=qs[_0xc986('0x4f')](_0x2b2490[_0xc986('0x46')]['sort']);_0x8fbd37[_0xc986('0x50')]=qs[_0xc986('0x51')](_[_0xc986('0x52')](_0x2b2490[_0xc986('0x46')],_0x494603[_0xc986('0x51')]));if(_0x2b2490['query'][_0xc986('0x53')]){_0x8fbd37[_0xc986('0x50')]=_[_0xc986('0x54')](_0x8fbd37[_0xc986('0x50')],{'$or':_[_0xc986('0x40')](_0x50f2cf,function(_0x163901){if(_0x163901['type']!==_0xc986('0x55')){var _0x534d0a={};_0x534d0a[_0x163901['name']]={'$like':'%'+_0x2b2490[_0xc986('0x46')][_0xc986('0x53')]+'%'};return _0x534d0a;}})});}_0x8fbd37=_[_0xc986('0x54')]({},_0x8fbd37,_0x2b2490['options']);var _0x4bdd73={'where':_0x8fbd37[_0xc986('0x50')]};return db['OpenchannelMessage'][_0xc986('0x34')](_0x4bdd73)['then'](function(_0x587285){_0x67aa22[_0xc986('0x34')]=_0x587285;if(_0x2b2490[_0xc986('0x46')][_0xc986('0x56')]){_0x8fbd37[_0xc986('0x57')]=[{'all':!![]}];}return db[_0xc986('0x41')][_0xc986('0x58')](_0x8fbd37);})['then'](function(_0x5a4645){_0x67aa22['rows']=_0x5a4645;return _0x67aa22;})[_0xc986('0x27')](respondWithFilteredResult(_0x5943a0,_0x8fbd37))['catch'](handleError(_0x5943a0,null));};exports[_0xc986('0x59')]=function(_0x121fc2,_0x205e15){var _0x3d61c5={'raw':!![],'where':{'id':_0x121fc2['params']['id']}},_0x351dea={};_0x351dea['model']=_[_0xc986('0x47')](db[_0xc986('0x41')][_0xc986('0x42')]);_0x351dea['query']=_[_0xc986('0x47')](_0x121fc2['query']);_0x351dea[_0xc986('0x51')]=_['intersection'](_0x351dea[_0xc986('0x45')],_0x351dea['query']);_0x3d61c5[_0xc986('0x4a')]=_[_0xc986('0x48')](_0x351dea['model'],qs['fields'](_0x121fc2[_0xc986('0x46')][_0xc986('0x49')]));_0x3d61c5['attributes']=_0x3d61c5['attributes']['length']?_0x3d61c5[_0xc986('0x4a')]:_0x351dea[_0xc986('0x45')];if(_0x121fc2[_0xc986('0x46')][_0xc986('0x56')]){_0x3d61c5[_0xc986('0x57')]=[{'all':!![]}];}_0x3d61c5=_['merge']({},_0x3d61c5,_0x121fc2['options']);return db['OpenchannelMessage'][_0xc986('0x5a')](_0x3d61c5)[_0xc986('0x27')](handleEntityNotFound(_0x205e15,null))[_0xc986('0x27')](respondWithResult(_0x205e15,null))[_0xc986('0x5b')](handleError(_0x205e15,null));};exports['create']=function(_0x2072c2,_0xddac9){return db[_0xc986('0x41')][_0xc986('0x5c')](_0x2072c2[_0xc986('0x5d')],{})[_0xc986('0x27')](respondWithResult(_0xddac9,0xc9))[_0xc986('0x5b')](handleError(_0xddac9,null));};exports[_0xc986('0x5e')]=function(_0x3bacef,_0x18c16e){if(_0x3bacef[_0xc986('0x5d')]['id']){delete _0x3bacef[_0xc986('0x5d')]['id'];}return db['OpenchannelMessage'][_0xc986('0x5a')]({'where':{'id':_0x3bacef[_0xc986('0x5f')]['id']}})[_0xc986('0x27')](handleEntityNotFound(_0x18c16e,null))[_0xc986('0x27')](saveUpdates(_0x3bacef[_0xc986('0x5d')],null))['then'](respondWithResult(_0x18c16e,null))[_0xc986('0x5b')](handleError(_0x18c16e,null));};exports[_0xc986('0x3b')]=function(_0x3d33d9,_0x2542f3){return db[_0xc986('0x41')][_0xc986('0x5a')]({'where':{'id':_0x3d33d9[_0xc986('0x5f')]['id']}})[_0xc986('0x27')](handleEntityNotFound(_0x2542f3,null))[_0xc986('0x27')](removeEntity(_0x2542f3,null))[_0xc986('0x5b')](handleError(_0x2542f3,null));};exports['describe']=function(_0x2894d0,_0x39fb45){return db['OpenchannelMessage'][_0xc986('0x60')]()[_0xc986('0x27')](respondWithResult(_0x39fb45,null))[_0xc986('0x5b')](handleError(_0x39fb45,null));};var interaction_log=require('../../config/logger')('openchannel-interactions');exports[_0xc986('0x61')]=function(_0x5aa56f,_0x4aa528,_0x1f297a){var _0x1af97={'channel':_0xc986('0x62')};if(_0x5aa56f[_0xc986('0x5d')]['id']){delete _0x5aa56f[_0xc986('0x5d')]['id'];}_0x5aa56f[_0xc986('0x5d')][_0xc986('0x63')]=!![];_0x5aa56f[_0xc986('0x5d')][_0xc986('0x64')]=moment()[_0xc986('0x65')](_0xc986('0x66'));_0x5aa56f[_0xc986('0x5d')]['UserId']=_0x5aa56f['body'][_0xc986('0x67')]||_0x5aa56f[_0xc986('0x68')]['id'];return db[_0xc986('0x41')]['find']({'where':{'id':_0x5aa56f[_0xc986('0x5f')]['id'],'UserId':null},'include':[{'model':db[_0xc986('0x69')],'as':_0xc986('0x6a')}]})[_0xc986('0x27')](handleEntityNotFound(_0x4aa528,null))[_0xc986('0x27')](saveUpdates(_0x5aa56f[_0xc986('0x5d')],null))[_0xc986('0x27')](function(_0x5b575c){if(_0x5b575c){_0x1af97[_0xc986('0x2f')]=_0x5b575c['get']({'plain':!![]});return db[_0xc986('0x6b')][_0xc986('0x5a')]({'where':{'id':_0x5b575c[_0xc986('0x6c')]}});}return null;})['then'](handleEntityNotFound(_0x4aa528,null))['then'](function(_0x1e5f79){if(_0x1e5f79){return _0x1e5f79[_0xc986('0x5e')]({'UserId':_0x5aa56f[_0xc986('0x5d')]['UserId'],'read1stAt':_['isNil'](_0x1e5f79[_0xc986('0x6d')])?moment()[_0xc986('0x65')](_0xc986('0x66')):undefined});}return null;})[_0xc986('0x27')](function(_0x2522a9){if(_0x2522a9){_0x1af97[_0xc986('0x6e')]=_0x2522a9['get']({'plain':!![]});interaction_log[_0xc986('0x28')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5aa56f[_0xc986('0x68')]['id'],_0x5aa56f['user'][_0xc986('0x3d')],_0x5aa56f[_0xc986('0x68')][_0xc986('0x6f')],_0x1af97[_0xc986('0x6e')]['id'],_0x5aa56f['body']?JSON[_0xc986('0x2d')](_0x5aa56f[_0xc986('0x5d')]):_0xc986('0x70'));return respondWithRpcPromise('AcceptMessage',_0xc986('0x71'),_0x1af97);}return null;})['then'](function(_0xd08da5){if(_0xd08da5){if(_0x5aa56f['body']['manual']){_0x1af97[_0xc986('0x2f')][_0xc986('0x72')]=util['format'](_0xc986('0x73'),_0x5aa56f['user'][_0xc986('0x3d')]);_0x1af97[_0xc986('0x2f')][_0xc986('0x74')]=_0x1af97['channel'];_0x1af97[_0xc986('0x2f')][_0xc986('0x75')]=_0xc986('0x61');return respondWithRpcPromise(_0xc986('0x76'),'EventManager',{'event':_0xc986('0x77'),'message':_0x1af97[_0xc986('0x2f')]},client9002)['then'](function(){return _0x1af97;});}return _0x1af97;}return null;})[_0xc986('0x27')](respondWithResult(_0x4aa528,null))[_0xc986('0x5b')](handleError(_0x4aa528,null));};var interaction_log=require(_0xc986('0x17'))('openchannel-interactions');exports['reject']=function(_0x5c498b,_0x2d7c05,_0x584e18){var _0x24d8c4={'agent':{},'channel':_0xc986('0x62')};if(_0x5c498b[_0xc986('0x5d')]['id']){delete _0x5c498b[_0xc986('0x5d')]['id'];}_0x5c498b[_0xc986('0x5d')][_0xc986('0x67')]=_0x5c498b[_0xc986('0x5d')][_0xc986('0x67')]||_0x5c498b[_0xc986('0x68')]['id'];_0x24d8c4[_0xc986('0x78')]['id']=_0x5c498b['body'][_0xc986('0x67')];return db[_0xc986('0x41')][_0xc986('0x5a')]({'where':{'id':_0x5c498b[_0xc986('0x5f')]['id'],'UserId':null}})[_0xc986('0x27')](handleEntityNotFound(_0x2d7c05,null))[_0xc986('0x27')](function(_0x4123b2){if(_0x4123b2){_0x24d8c4['message']=_0x4123b2[_0xc986('0x79')]({'plain':!![]});return db[_0xc986('0x6b')][_0xc986('0x5a')]({'where':{'id':_0x4123b2[_0xc986('0x6c')]}});}return null;})[_0xc986('0x27')](handleEntityNotFound(_0x2d7c05,null))[_0xc986('0x27')](function(_0x462ea1){if(_0x462ea1){_0x24d8c4[_0xc986('0x6e')]=_0x462ea1[_0xc986('0x79')]({'plain':!![]});interaction_log[_0xc986('0x28')]('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5c498b[_0xc986('0x68')]['id'],_0x5c498b[_0xc986('0x68')]['name'],_0x5c498b[_0xc986('0x68')][_0xc986('0x6f')],_0x24d8c4[_0xc986('0x6e')]['id'],_0x5c498b[_0xc986('0x5d')]?JSON['stringify'](_0x5c498b['body']):_0xc986('0x70'));return respondWithRpcPromise('RejectMessage',_0xc986('0x7a'),_0x24d8c4);}return null;})[_0xc986('0x27')](function(_0x474d43){if(_0x474d43){_0x474d43[_0xc986('0x2f')]['interface']=util[_0xc986('0x65')](_0xc986('0x73'),_0x5c498b[_0xc986('0x68')]['name']);_0x474d43[_0xc986('0x2f')]['channel']=_0x24d8c4[_0xc986('0x74')];_0x474d43[_0xc986('0x2f')][_0xc986('0x75')]=_0xc986('0x39');respondWithRpcPromise(_0xc986('0x76'),_0xc986('0x76'),{'event':_0xc986('0x7b'),'message':_0x474d43[_0xc986('0x2f')]},client9002);return _0x24d8c4;}return null;})[_0xc986('0x27')](respondWithResult(_0x2d7c05,null))['catch'](handleError(_0x2d7c05,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 18a1ff2..a479c52 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 _0xb660=['exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x435f7c,_0x3c50e5){var _0x11be96=function(_0x4b91e3){while(--_0x4b91e3){_0x435f7c['push'](_0x435f7c['shift']());}};_0x11be96(++_0x3c50e5);}(_0xb660,0xeb));var _0x0b66=function(_0x4bfc64,_0x25976d){_0x4bfc64=_0x4bfc64-0x0;var _0x5d8f2a=_0xb660[_0x4bfc64];return _0x5d8f2a;};'use strict';var EventEmitter=require(_0x0b66('0x0'));var OpenchannelMessage=require(_0x0b66('0x1'))['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x0b66('0x2')](0x0);var events={'afterCreate':_0x0b66('0x3'),'afterUpdate':_0x0b66('0x4'),'afterDestroy':_0x0b66('0x5')};function emitEvent(_0x42b9e7){return function(_0x5283c0,_0x5a5c43,_0x13f475){OpenchannelMessageEvents[_0x0b66('0x6')](_0x42b9e7+':'+_0x5283c0['id'],_0x5283c0);OpenchannelMessageEvents[_0x0b66('0x6')](_0x42b9e7,_0x5283c0);_0x13f475(null);};}for(var e in events){if(events[_0x0b66('0x7')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0x0b66('0x8')]=OpenchannelMessageEvents; \ No newline at end of file +var _0xd103=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelMessage','setMaxListeners','save','update','remove'];(function(_0x5e2104,_0x12f596){var _0x473067=function(_0x3e8a53){while(--_0x3e8a53){_0x5e2104['push'](_0x5e2104['shift']());}};_0x473067(++_0x12f596);}(_0xd103,0xf6));var _0x3d10=function(_0x1f5ec6,_0x68c385){_0x1f5ec6=_0x1f5ec6-0x0;var _0x1ed0e4=_0xd103[_0x1f5ec6];return _0x1ed0e4;};'use strict';var EventEmitter=require(_0x3d10('0x0'));var OpenchannelMessage=require(_0x3d10('0x1'))['db'][_0x3d10('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x3d10('0x3')](0x0);var events={'afterCreate':_0x3d10('0x4'),'afterUpdate':_0x3d10('0x5'),'afterDestroy':_0x3d10('0x6')};function emitEvent(_0x39e5f4){return function(_0x3ed32f,_0x4ab9a9,_0x5d1219){OpenchannelMessageEvents[_0x3d10('0x7')](_0x39e5f4+':'+_0x3ed32f['id'],_0x3ed32f);OpenchannelMessageEvents[_0x3d10('0x7')](_0x39e5f4,_0x3ed32f);_0x5d1219(null);};}for(var e in events){if(events[_0x3d10('0x8')](e)){var event=events[e];OpenchannelMessage[_0x3d10('0x9')](e,emitEvent(event));}}module[_0x3d10('0xa')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index c8bc2e4..6fec934 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 _0x257d=['exports','OpenchannelMessage','openchannel_messages','body','FULLTEXT','models','get','toLowerCase','direction','secret','isNil','UserId','OpenchannelInteraction','then','createdAt','catch','error','out','describe','OpenchannelAccount','find','OpenchannelAccountId','Interactions','OpenchannelInteractionId','CmContact','keys','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','length','omit','Contact','replyUri','method','GET','POST','info','threadId','Interaction','update','inspect','finally','utf8mb4_unicode_ci','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes'];(function(_0x3a3e88,_0x4801a0){var _0x1f4fc8=function(_0x1536a4){while(--_0x1536a4){_0x3a3e88['push'](_0x3a3e88['shift']());}};_0x1f4fc8(++_0x4801a0);}(_0x257d,0x198));var _0xd257=function(_0x4ed10a,_0x1f4a61){_0x4ed10a=_0x4ed10a-0x0;var _0x425f5a=_0x257d[_0x4ed10a];return _0x425f5a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd257('0x0'))('api');var moment=require(_0xd257('0x1'));var BPromise=require(_0xd257('0x2'));var rp=require(_0xd257('0x3'));var fs=require('fs');var path=require(_0xd257('0x4'));var rimraf=require(_0xd257('0x5'));var config=require(_0xd257('0x6'));var attributes=require(_0xd257('0x7'));module[_0xd257('0x8')]=function(_0x43fdfe,_0x46372b){return _0x43fdfe['define'](_0xd257('0x9'),attributes,{'tableName':_0xd257('0xa'),'paranoid':![],'indexes':[{'name':'fti_openchannel_messages','fields':[_0xd257('0xb')],'type':_0xd257('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xa01ac2,_0xccde71,_0x19a614){var _0x742ff5=_0x43fdfe[_0xd257('0xd')];var _0x82aa58=_0xa01ac2[_0xd257('0xe')]({'plain':!![]});if(_0x82aa58['direction'][_0xd257('0xf')]()==='in'||_0x82aa58[_0xd257('0x10')][_0xd257('0xf')]()==='out'&&!_0x82aa58[_0xd257('0x11')]&&!_[_0xd257('0x12')](_0x82aa58[_0xd257('0x13')])){_0x742ff5[_0xd257('0x14')]['findOne']({'where':{'id':_0x82aa58['OpenchannelInteractionId']}})[_0xd257('0x15')](function(_0x24148d){if(_0x24148d){_0x24148d['update']({'lastMsgAt':_0x82aa58[_0xd257('0x16')],'lastMsgDirection':_0x82aa58[_0xd257('0x10')]['toLowerCase']()});}})[_0xd257('0x17')](function(_0x2e6815){console[_0xd257('0x18')](_0x2e6815);});}if(_0x82aa58[_0xd257('0x10')]===_0xd257('0x19')&&!_0x82aa58[_0xd257('0x11')]){var _0x5e9c37;_0x742ff5['CmContact'][_0xd257('0x1a')]()[_0xd257('0x15')](function(_0x32fc1a){return _0x742ff5[_0xd257('0x1b')][_0xd257('0x1c')]({'where':{'id':_0x82aa58[_0xd257('0x1d')]},'include':[{'model':_0x742ff5[_0xd257('0x14')],'as':_0xd257('0x1e'),'where':{'id':_0x82aa58[_0xd257('0x1f')]},'limit':0x1,'include':[{'model':_0x742ff5[_0xd257('0x20')],'as':'Contact','attributes':_[_0xd257('0x21')](_0x32fc1a)}]}]});})[_0xd257('0x15')](function(_0x7dec0){_0x5e9c37=_0x7dec0['get']({'plain':!![]});if(_0x5e9c37&&_0x5e9c37['replyUri']){logger['info'](_0xd257('0x22'),_0xd257('0x23'),util[_0xd257('0x24')](_0xd257('0x25'),_0x82aa58['id'],_0x5e9c37['replyUri']));if(_0x5e9c37['Interactions']&&_0x5e9c37[_0xd257('0x1e')][_0xd257('0x26')]){_0x82aa58['Interaction']=_[_0xd257('0x27')](_0x5e9c37[_0xd257('0x1e')][0x0],_0xd257('0x28'));_0x82aa58[_0xd257('0x28')]=_0x5e9c37[_0xd257('0x1e')][0x0][_0xd257('0x28')];}var _0xccde71={'method':'POST','uri':encodeURI(_0x5e9c37[_0xd257('0x29')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0xccde71[_0xd257('0x2a')]){case _0xd257('0x2b'):_0xccde71['qs']=_0x82aa58;break;case _0xd257('0x2c'):_0xccde71['body']=_0x82aa58;break;}return rp(_0xccde71)[_0xd257('0x15')](function(_0x23b1ef){logger[_0xd257('0x2d')](_0xd257('0x22'),_0xd257('0x23'),util[_0xd257('0x24')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x82aa58['id'],_0x5e9c37['replyUri']));if(_0x23b1ef[_0xd257('0xb')][_0xd257('0x2e')]&&_0x23b1ef[_0xd257('0xb')][_0xd257('0x2e')]!=_0x82aa58['Interaction'][_0xd257('0x2e')]){return _0x742ff5['OpenchannelInteraction']['update']({'threadId':_0x23b1ef[_0xd257('0xb')][_0xd257('0x2e')]},{'logging':!![],'where':{'id':_0x82aa58[_0xd257('0x2f')]['id']}});}else{return;}})[_0xd257('0x15')](function(){return _0xa01ac2[_0xd257('0x30')]({'read':!![]});})[_0xd257('0x17')](function(_0x150048){logger[_0xd257('0x18')](_0xd257('0x22'),_0xd257('0x23'),util[_0xd257('0x31')](_0x150048,{'showHidden':![],'depth':null}));_0x19a614();});}else{_0x19a614();}})[_0xd257('0x32')](function(){_0x19a614();});}else{_0x19a614();}}},'charset':'utf8mb4','collate':_0xd257('0x33')});}; \ No newline at end of file +var _0xb860=['format','length','Interaction','method','GET','body','Message\x20%d\x20forwarded\x20to\x20%s','threadId','OpenchannelInteraction','error','afterCreate','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','request-promise','rimraf','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','FULLTEXT','get','direction','toLowerCase','secret','findOne','OpenchannelInteractionId','then','update','createdAt','catch','CmContact','describe','OpenchannelAccount','find','Interactions','Contact','replyUri','info','OpenchannelMessage,\x20%s,\x20%s'];(function(_0x19624d,_0x29058c){var _0xf9d02f=function(_0x2a3006){while(--_0x2a3006){_0x19624d['push'](_0x19624d['shift']());}};_0xf9d02f(++_0x29058c);}(_0xb860,0x11c));var _0x0b86=function(_0x444d2f,_0x2927b9){_0x444d2f=_0x444d2f-0x0;var _0x18ae46=_0xb860[_0x444d2f];return _0x18ae46;};'use strict';var _=require(_0x0b86('0x0'));var util=require(_0x0b86('0x1'));var logger=require(_0x0b86('0x2'))('api');var moment=require(_0x0b86('0x3'));var BPromise=require('bluebird');var rp=require(_0x0b86('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0b86('0x5'));var config=require('../../config/environment');var attributes=require('./openchannelMessage.attributes');module[_0x0b86('0x6')]=function(_0x569ae0,_0x52cd61){return _0x569ae0[_0x0b86('0x7')](_0x0b86('0x8'),attributes,{'tableName':_0x0b86('0x9'),'paranoid':![],'indexes':[{'name':_0x0b86('0xa'),'fields':['body'],'type':_0x0b86('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xfc97ce,_0xae8794,_0x519104){var _0x56ae9a=_0x569ae0['models'];var _0x44ffa3=_0xfc97ce[_0x0b86('0xc')]({'plain':!![]});if(_0x44ffa3[_0x0b86('0xd')][_0x0b86('0xe')]()==='in'||_0x44ffa3[_0x0b86('0xd')][_0x0b86('0xe')]()==='out'&&!_0x44ffa3[_0x0b86('0xf')]&&!_['isNil'](_0x44ffa3['UserId'])){_0x56ae9a['OpenchannelInteraction'][_0x0b86('0x10')]({'where':{'id':_0x44ffa3[_0x0b86('0x11')]}})[_0x0b86('0x12')](function(_0xfd0868){if(_0xfd0868){_0xfd0868[_0x0b86('0x13')]({'lastMsgAt':_0x44ffa3[_0x0b86('0x14')],'lastMsgDirection':_0x44ffa3[_0x0b86('0xd')][_0x0b86('0xe')]()});}})[_0x0b86('0x15')](function(_0x4bd804){console['error'](_0x4bd804);});}if(_0x44ffa3[_0x0b86('0xd')]==='out'&&!_0x44ffa3[_0x0b86('0xf')]){var _0x5717c4;_0x56ae9a[_0x0b86('0x16')][_0x0b86('0x17')]()[_0x0b86('0x12')](function(_0x699bb1){return _0x56ae9a[_0x0b86('0x18')][_0x0b86('0x19')]({'where':{'id':_0x44ffa3['OpenchannelAccountId']},'include':[{'model':_0x56ae9a['OpenchannelInteraction'],'as':_0x0b86('0x1a'),'where':{'id':_0x44ffa3[_0x0b86('0x11')]},'limit':0x1,'include':[{'model':_0x56ae9a[_0x0b86('0x16')],'as':_0x0b86('0x1b'),'attributes':_['keys'](_0x699bb1)}]}]});})[_0x0b86('0x12')](function(_0x486cef){_0x5717c4=_0x486cef[_0x0b86('0xc')]({'plain':!![]});if(_0x5717c4&&_0x5717c4[_0x0b86('0x1c')]){logger[_0x0b86('0x1d')](_0x0b86('0x1e'),'afterCreate',util[_0x0b86('0x1f')]('Forwarding\x20message\x20%d\x20to\x20%s',_0x44ffa3['id'],_0x5717c4[_0x0b86('0x1c')]));if(_0x5717c4[_0x0b86('0x1a')]&&_0x5717c4['Interactions'][_0x0b86('0x20')]){_0x44ffa3[_0x0b86('0x21')]=_['omit'](_0x5717c4['Interactions'][0x0],_0x0b86('0x1b'));_0x44ffa3[_0x0b86('0x1b')]=_0x5717c4['Interactions'][0x0]['Contact'];}var _0xae8794={'method':'POST','uri':encodeURI(_0x5717c4[_0x0b86('0x1c')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0xae8794[_0x0b86('0x22')]){case _0x0b86('0x23'):_0xae8794['qs']=_0x44ffa3;break;case'POST':_0xae8794[_0x0b86('0x24')]=_0x44ffa3;break;}return rp(_0xae8794)[_0x0b86('0x12')](function(_0x506c6c){logger[_0x0b86('0x1d')](_0x0b86('0x1e'),'afterCreate',util[_0x0b86('0x1f')](_0x0b86('0x25'),_0x44ffa3['id'],_0x5717c4[_0x0b86('0x1c')]));if(_0x506c6c[_0x0b86('0x24')][_0x0b86('0x26')]&&_0x506c6c['body'][_0x0b86('0x26')]!=_0x44ffa3[_0x0b86('0x21')][_0x0b86('0x26')]){return _0x56ae9a[_0x0b86('0x27')][_0x0b86('0x13')]({'threadId':_0x506c6c[_0x0b86('0x24')][_0x0b86('0x26')]},{'logging':!![],'where':{'id':_0x44ffa3[_0x0b86('0x21')]['id']}});}else{return;}})[_0x0b86('0x12')](function(){return _0xfc97ce[_0x0b86('0x13')]({'read':!![]});})[_0x0b86('0x15')](function(_0x17ccdb){logger[_0x0b86('0x28')](_0x0b86('0x1e'),_0x0b86('0x29'),util['inspect'](_0x17ccdb,{'showHidden':![],'depth':null}));_0x519104();});}else{_0x519104();}})[_0x0b86('0x2a')](function(){_0x519104();});}else{_0x519104();}}},'charset':_0x0b86('0x2b'),'collate':_0x0b86('0x2c')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index ea8831f..e4630cf 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 _0xa817=['request','then','info','OpenchannelMessage,\x20%s,\x20%s','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','OpenchannelMessage','create','body','options','CreateOpenchannelMessage','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket'];(function(_0x4578da,_0x167447){var _0x10c671=function(_0x40365f){while(--_0x40365f){_0x4578da['push'](_0x4578da['shift']());}};_0x10c671(++_0x167447);}(_0xa817,0x7b));var _0x7a81=function(_0x374d93,_0x3ff575){_0x374d93=_0x374d93-0x0;var _0x2bcde2=_0xa817[_0x374d93];return _0x2bcde2;};'use strict';var _=require(_0x7a81('0x0'));var util=require(_0x7a81('0x1'));var moment=require(_0x7a81('0x2'));var BPromise=require(_0x7a81('0x3'));var rs=require(_0x7a81('0x4'));var fs=require('fs');var Redis=require(_0x7a81('0x5'));var db=require(_0x7a81('0x6'))['db'];var utils=require(_0x7a81('0x7'));var logger=require(_0x7a81('0x8'))('rpc');var config=require(_0x7a81('0x9'));var jayson=require(_0x7a81('0xa'));var client=jayson['client'][_0x7a81('0xb')]({'port':0x232a});config[_0x7a81('0xc')]=_[_0x7a81('0xd')](config[_0x7a81('0xc')],{'host':_0x7a81('0xe'),'port':0x18eb});var socket=require(_0x7a81('0xf'))(new Redis(config['redis']));require(_0x7a81('0x10'))['register'](socket);function respondWithRpcPromise(_0x5ae346,_0x2b8dc7,_0x493b02){return new BPromise(function(_0x41d90b,_0x37fee1){return client[_0x7a81('0x11')](_0x5ae346,_0x493b02)[_0x7a81('0x12')](function(_0x45b768){logger[_0x7a81('0x13')](_0x7a81('0x14'),_0x2b8dc7,'request\x20sent');logger[_0x7a81('0x15')](_0x7a81('0x16'),_0x2b8dc7,_0x7a81('0x17'),JSON['stringify'](_0x45b768));if(_0x45b768[_0x7a81('0x18')]){if(_0x45b768[_0x7a81('0x18')][_0x7a81('0x19')]===0x1f4){logger[_0x7a81('0x18')](_0x7a81('0x14'),_0x2b8dc7,_0x45b768[_0x7a81('0x18')]['message']);return _0x37fee1(_0x45b768['error'][_0x7a81('0x1a')]);}logger[_0x7a81('0x18')]('OpenchannelMessage,\x20%s,\x20%s',_0x2b8dc7,_0x45b768[_0x7a81('0x18')][_0x7a81('0x1a')]);return _0x41d90b(_0x45b768[_0x7a81('0x18')][_0x7a81('0x1a')]);}else{logger[_0x7a81('0x13')](_0x7a81('0x14'),_0x2b8dc7,_0x7a81('0x17'));_0x41d90b(_0x45b768[_0x7a81('0x1b')][_0x7a81('0x1a')]);}})[_0x7a81('0x1c')](function(_0x3c3c59){logger[_0x7a81('0x18')](_0x7a81('0x14'),_0x2b8dc7,_0x3c3c59);_0x37fee1(_0x3c3c59);});});}exports['CreateOpenchannelMessage']=function(_0x13a8a8){var _0x3b17cd=this;return new Promise(function(_0x2c714c,_0x3087c0){return db[_0x7a81('0x1d')][_0x7a81('0x1e')](_0x13a8a8[_0x7a81('0x1f')],{'raw':_0x13a8a8[_0x7a81('0x20')]?_0x13a8a8[_0x7a81('0x20')]['raw']===undefined?!![]:![]:!![]})[_0x7a81('0x12')](function(_0x26b384){logger[_0x7a81('0x13')](_0x7a81('0x21'),_0x13a8a8);logger[_0x7a81('0x15')](_0x7a81('0x21'),_0x13a8a8,JSON[_0x7a81('0x22')](_0x26b384));_0x2c714c(_0x26b384);})[_0x7a81('0x1c')](function(_0x5ac0ae){logger[_0x7a81('0x18')]('CreateOpenchannelMessage',_0x5ac0ae['message'],_0x13a8a8);_0x3087c0(_0x3b17cd[_0x7a81('0x18')](0x1f4,_0x5ac0ae[_0x7a81('0x1a')]));});});}; \ No newline at end of file +var _0x44c2=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','defaults','socket.io-emitter','redis','register','then','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','OpenchannelMessage','create','body','options','raw','CreateOpenchannelMessage'];(function(_0x2a5c88,_0x2f7bc0){var _0x23199b=function(_0x4334cb){while(--_0x4334cb){_0x2a5c88['push'](_0x2a5c88['shift']());}};_0x23199b(++_0x2f7bc0);}(_0x44c2,0x100));var _0x244c=function(_0x3d34da,_0x3abcc1){_0x3d34da=_0x3d34da-0x0;var _0xcf6af8=_0x44c2[_0x3d34da];return _0xcf6af8;};'use strict';var _=require(_0x244c('0x0'));var util=require(_0x244c('0x1'));var moment=require(_0x244c('0x2'));var BPromise=require(_0x244c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x244c('0x4'));var db=require(_0x244c('0x5'))['db'];var utils=require(_0x244c('0x6'));var logger=require(_0x244c('0x7'))(_0x244c('0x8'));var config=require(_0x244c('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x244c('0xa')]({'port':0x232a});config['redis']=_[_0x244c('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x244c('0xc'))(new Redis(config[_0x244c('0xd')]));require('./openchannelMessage.socket')[_0x244c('0xe')](socket);function respondWithRpcPromise(_0x5b873e,_0x519feb,_0x10a810){return new BPromise(function(_0x4d7289,_0x16c6f9){return client['request'](_0x5b873e,_0x10a810)[_0x244c('0xf')](function(_0x53c038){logger['info'](_0x244c('0x10'),_0x519feb,_0x244c('0x11'));logger[_0x244c('0x12')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x519feb,_0x244c('0x11'),JSON[_0x244c('0x13')](_0x53c038));if(_0x53c038[_0x244c('0x14')]){if(_0x53c038[_0x244c('0x14')][_0x244c('0x15')]===0x1f4){logger[_0x244c('0x14')](_0x244c('0x10'),_0x519feb,_0x53c038['error'][_0x244c('0x16')]);return _0x16c6f9(_0x53c038['error']['message']);}logger[_0x244c('0x14')](_0x244c('0x10'),_0x519feb,_0x53c038[_0x244c('0x14')][_0x244c('0x16')]);return _0x4d7289(_0x53c038['error'][_0x244c('0x16')]);}else{logger[_0x244c('0x17')](_0x244c('0x10'),_0x519feb,_0x244c('0x11'));_0x4d7289(_0x53c038[_0x244c('0x18')]['message']);}})[_0x244c('0x19')](function(_0x2af7eb){logger[_0x244c('0x14')]('OpenchannelMessage,\x20%s,\x20%s',_0x519feb,_0x2af7eb);_0x16c6f9(_0x2af7eb);});});}exports['CreateOpenchannelMessage']=function(_0x4c7095){var _0x330719=this;return new Promise(function(_0x1d9711,_0x1ad17c){return db[_0x244c('0x1a')][_0x244c('0x1b')](_0x4c7095[_0x244c('0x1c')],{'raw':_0x4c7095['options']?_0x4c7095[_0x244c('0x1d')][_0x244c('0x1e')]===undefined?!![]:![]:!![]})[_0x244c('0xf')](function(_0x536b8e){logger[_0x244c('0x17')]('CreateOpenchannelMessage',_0x4c7095);logger['debug'](_0x244c('0x1f'),_0x4c7095,JSON[_0x244c('0x13')](_0x536b8e));_0x1d9711(_0x536b8e);})['catch'](function(_0x43c5af){logger[_0x244c('0x14')](_0x244c('0x1f'),_0x43c5af[_0x244c('0x16')],_0x4c7095);_0x1ad17c(_0x330719['error'](0x1f4,_0x43c5af[_0x244c('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 815c7d0..7c8d8ac 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 _0x9bde=['openchannelMessage:','save','update','emit','removeListener','register','length'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0x9bde,0xe1));var _0xe9bd=function(_0x4d7c8f,_0x48877e){_0x4d7c8f=_0x4d7c8f-0x0;var _0x454378=_0x9bde[_0x4d7c8f];return _0x454378;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=[_0xe9bd('0x0'),'remove',_0xe9bd('0x1')];function createListener(_0x4c63ca,_0x51786f){return function(_0x3005aa){_0x51786f[_0xe9bd('0x2')](_0x4c63ca,_0x3005aa);};}function removeListener(_0x1c1b34,_0x10822d){return function(){OpenchannelMessageEvents[_0xe9bd('0x3')](_0x1c1b34,_0x10822d);};}exports[_0xe9bd('0x4')]=function(_0x4fd7b8){for(var _0x4763e9=0x0,_0x5f18fe=events[_0xe9bd('0x5')];_0x4763e9<_0x5f18fe;_0x4763e9++){var _0xa66ae2=events[_0x4763e9];var _0x2d5c75=createListener(_0xe9bd('0x6')+_0xa66ae2,_0x4fd7b8);OpenchannelMessageEvents['on'](_0xa66ae2,_0x2d5c75);}}; \ No newline at end of file +var _0xedd9=['removeListener','register','length','openchannelMessage:','save','remove','update','emit'];(function(_0x124c5d,_0x27cf82){var _0x27567d=function(_0x5be392){while(--_0x5be392){_0x124c5d['push'](_0x124c5d['shift']());}};_0x27567d(++_0x27cf82);}(_0xedd9,0xfc));var _0x9edd=function(_0x3ebe42,_0x199923){_0x3ebe42=_0x3ebe42-0x0;var _0x45cde3=_0xedd9[_0x3ebe42];return _0x45cde3;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=[_0x9edd('0x0'),_0x9edd('0x1'),_0x9edd('0x2')];function createListener(_0x2c16b8,_0x3b51bc){return function(_0x127cbe){_0x3b51bc[_0x9edd('0x3')](_0x2c16b8,_0x127cbe);};}function removeListener(_0x36b53f,_0x5943b3){return function(){OpenchannelMessageEvents[_0x9edd('0x4')](_0x36b53f,_0x5943b3);};}exports[_0x9edd('0x5')]=function(_0x268f9e){for(var _0x34c1a7=0x0,_0x5319f7=events[_0x9edd('0x6')];_0x34c1a7<_0x5319f7;_0x34c1a7++){var _0x571af9=events[_0x34c1a7];var _0x172522=createListener(_0x9edd('0x7')+_0x571af9,_0x268f9e);OpenchannelMessageEvents['on'](_0x571af9,_0x172522);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index e3fc83c..3084f62 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 _0xafdd=['../../components/auth/service','../../components/interaction/service','./openchannelQueue.controller','get','isAuthenticated','index','/describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','addTeams','addAgents','put','delete','removeAgents','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0xafdd,0x19a));var _0xdafd=function(_0x2e2a47,_0x43230a){_0x2e2a47=_0x2e2a47-0x0;var _0x45a9e3=_0xafdd[_0x2e2a47];return _0x45a9e3;};'use strict';var multer=require(_0xdafd('0x0'));var util=require(_0xdafd('0x1'));var path=require(_0xdafd('0x2'));var timeout=require(_0xdafd('0x3'));var express=require(_0xdafd('0x4'));var router=express[_0xdafd('0x5')]();var auth=require(_0xdafd('0x6'));var interaction=require(_0xdafd('0x7'));var config=require('../../config/environment');var controller=require(_0xdafd('0x8'));router[_0xdafd('0x9')]('/',auth[_0xdafd('0xa')](),controller[_0xdafd('0xb')]);router[_0xdafd('0x9')](_0xdafd('0xc'),auth[_0xdafd('0xa')](),controller['describe']);router[_0xdafd('0x9')](_0xdafd('0xd'),auth[_0xdafd('0xa')](),controller['show']);router[_0xdafd('0x9')](_0xdafd('0xe'),auth[_0xdafd('0xa')](),controller[_0xdafd('0xf')]);router['get'](_0xdafd('0x10'),auth[_0xdafd('0xa')](),controller[_0xdafd('0x11')]);router[_0xdafd('0x9')](_0xdafd('0x12'),auth[_0xdafd('0xa')](),controller['getAgents']);router[_0xdafd('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0xdafd('0x13')](_0xdafd('0x10'),auth['isAuthenticated'](),controller[_0xdafd('0x14')]);router['post']('/:id/users',auth[_0xdafd('0xa')](),controller[_0xdafd('0x15')]);router[_0xdafd('0x16')](_0xdafd('0xd'),auth[_0xdafd('0xa')](),controller['update']);router[_0xdafd('0x17')](_0xdafd('0xd'),auth[_0xdafd('0xa')](),controller['destroy']);router[_0xdafd('0x17')](_0xdafd('0x10'),auth['isAuthenticated'](),controller['removeTeams']);router[_0xdafd('0x17')]('/:id/users',auth[_0xdafd('0xa')](),controller[_0xdafd('0x18')]);module[_0xdafd('0x19')]=router; \ No newline at end of file +var _0x3bd7=['/:id/users','addAgents','put','update','delete','/:id','destroy','removeAgents','exports','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','/:id/members','getMembers','/:id/teams','getTeams','getAgents','post','create'];(function(_0x46ea41,_0x54437c){var _0x1573d2=function(_0xe6b961){while(--_0xe6b961){_0x46ea41['push'](_0x46ea41['shift']());}};_0x1573d2(++_0x54437c);}(_0x3bd7,0x199));var _0x73bd=function(_0x19115e,_0x507bab){_0x19115e=_0x19115e-0x0;var _0x45bbd4=_0x3bd7[_0x19115e];return _0x45bbd4;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x73bd('0x0'));var timeout=require(_0x73bd('0x1'));var express=require(_0x73bd('0x2'));var router=express['Router']();var auth=require(_0x73bd('0x3'));var interaction=require(_0x73bd('0x4'));var config=require(_0x73bd('0x5'));var controller=require('./openchannelQueue.controller');router[_0x73bd('0x6')]('/',auth['isAuthenticated'](),controller[_0x73bd('0x7')]);router[_0x73bd('0x6')]('/describe',auth[_0x73bd('0x8')](),controller['describe']);router['get']('/:id',auth[_0x73bd('0x8')](),controller['show']);router['get'](_0x73bd('0x9'),auth['isAuthenticated'](),controller[_0x73bd('0xa')]);router[_0x73bd('0x6')](_0x73bd('0xb'),auth[_0x73bd('0x8')](),controller[_0x73bd('0xc')]);router[_0x73bd('0x6')]('/:id/users',auth[_0x73bd('0x8')](),controller[_0x73bd('0xd')]);router[_0x73bd('0xe')]('/',auth[_0x73bd('0x8')](),controller[_0x73bd('0xf')]);router[_0x73bd('0xe')]('/:id/teams',auth[_0x73bd('0x8')](),controller['addTeams']);router[_0x73bd('0xe')](_0x73bd('0x10'),auth[_0x73bd('0x8')](),controller[_0x73bd('0x11')]);router[_0x73bd('0x12')]('/:id',auth[_0x73bd('0x8')](),controller[_0x73bd('0x13')]);router[_0x73bd('0x14')](_0x73bd('0x15'),auth[_0x73bd('0x8')](),controller[_0x73bd('0x16')]);router[_0x73bd('0x14')](_0x73bd('0xb'),auth[_0x73bd('0x8')](),controller['removeTeams']);router[_0x73bd('0x14')](_0x73bd('0x10'),auth[_0x73bd('0x8')](),controller[_0x73bd('0x17')]);module[_0x73bd('0x18')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 5e24b48..fa6e6cd 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 _0x8b0e=['roundrobin','sequelize','exports','STRING','name','INTEGER','rrmemory'];(function(_0x514047,_0xce89e1){var _0x59445f=function(_0x1ce9aa){while(--_0x1ce9aa){_0x514047['push'](_0x514047['shift']());}};_0x59445f(++_0xce89e1);}(_0x8b0e,0x166));var _0xe8b0=function(_0x3333bb,_0x1df222){_0x3333bb=_0x3333bb-0x0;var _0x273d39=_0x8b0e[_0x3333bb];return _0x273d39;};'use strict';var Sequelize=require(_0xe8b0('0x0'));module[_0xe8b0('0x1')]={'name':{'type':Sequelize[_0xe8b0('0x2')],'unique':_0xe8b0('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xe8b0('0x2')]},'timeout':{'type':Sequelize[_0xe8b0('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xe8b0('0x5'),'beepall',_0xe8b0('0x6'))}}; \ No newline at end of file +var _0x36bc=['name','ENUM','rrmemory','beepall','sequelize','STRING'];(function(_0x51cdf0,_0xe15adb){var _0x22ae1d=function(_0x3bb0d5){while(--_0x3bb0d5){_0x51cdf0['push'](_0x51cdf0['shift']());}};_0x22ae1d(++_0xe15adb);}(_0x36bc,0x1a8));var _0xc36b=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0x36bc[_0x47e7cb];return _0x2a8874;};'use strict';var Sequelize=require(_0xc36b('0x0'));module['exports']={'name':{'type':Sequelize[_0xc36b('0x1')],'unique':_0xc36b('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xc36b('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xc36b('0x3')](_0xc36b('0x4'),_0xc36b('0x5'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 3c82ec9..65beaa7 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 _0xf74d=['user_has_teams','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','union','compact','value','isEmpty','removeAgents','forEach','userOpenchannelQueue:remove','omit','getAgents','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','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','end','status','json','offset','limit','set','Content-Range','reject','save','update','then','destroy','get','OpenchannelQueues','UserProfileResource','sendStatus','error','stack','name','send','map','OpenchannelQueue','fieldName','type','key','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','include','create','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserOpenchannelQueue','nolimit','OpenchannelQueueId','User','UserId','agent','updatedAt','createdAt','%s/%s','SIP','openchannelPause','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','sequelize','transaction','findOrCreate','emit','userOpenchannelQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_openchannel_queues'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0xf74d,0x1a6));var _0xdf74=function(_0x1aed33,_0x5cbf7e){_0x1aed33=_0x1aed33-0x0;var _0x50d94c=_0xf74d[_0x1aed33];return _0x50d94c;};'use strict';var pdf=require(_0xdf74('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xdf74('0x1'));var zipdir=require(_0xdf74('0x2'));var jsonpatch=require(_0xdf74('0x3'));var rp=require(_0xdf74('0x4'));var moment=require('moment');var BPromise=require(_0xdf74('0x5'));var Mustache=require(_0xdf74('0x6'));var util=require(_0xdf74('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xdf74('0x8'));var ejs=require(_0xdf74('0x9'));var fs=require('fs');var _=require(_0xdf74('0xa'));var squel=require(_0xdf74('0xb'));var crypto=require(_0xdf74('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xdf74('0xd'));var toCsv=require('to-csv');var querystring=require(_0xdf74('0xe'));var Papa=require(_0xdf74('0xf'));var Redis=require(_0xdf74('0x10'));var authService=require(_0xdf74('0x11'));var qs=require(_0xdf74('0x12'));var as=require(_0xdf74('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xdf74('0x14'))['db'];config[_0xdf74('0x15')]=_[_0xdf74('0x16')](config[_0xdf74('0x15')],{'host':_0xdf74('0x17'),'port':0x18eb});var socket=require(_0xdf74('0x18'))(new Redis(config[_0xdf74('0x15')]));require(_0xdf74('0x19'))['register'](socket);function respondWithStatusCode(_0x55e5a8,_0x494edb){_0x494edb=_0x494edb||0xcc;return function(_0xd5ef07){if(_0xd5ef07){return _0x55e5a8['sendStatus'](_0x494edb);}return _0x55e5a8['status'](_0x494edb)[_0xdf74('0x1a')]();};}function respondWithResult(_0x5af92b,_0x545feb){_0x545feb=_0x545feb||0xc8;return function(_0x3c7b2b){if(_0x3c7b2b){return _0x5af92b[_0xdf74('0x1b')](_0x545feb)[_0xdf74('0x1c')](_0x3c7b2b);}};}function respondWithFilteredResult(_0xa092ef,_0x55696f){return function(_0x1cb205){if(_0x1cb205){var _0x2ff5b9=_0x1cb205['count'],_0x1646cb=_0x55696f[_0xdf74('0x1d')],_0x145a38=_0x55696f[_0xdf74('0x1d')]+_0x55696f[_0xdf74('0x1e')],_0x7f71c8;if(_0x145a38>=_0x2ff5b9){_0x145a38=_0x2ff5b9;_0x7f71c8=0xc8;}else{_0x7f71c8=0xce;}_0xa092ef['status'](_0x7f71c8);return _0xa092ef[_0xdf74('0x1f')](_0xdf74('0x20'),_0x1646cb+'-'+_0x145a38+'/'+_0x2ff5b9)[_0xdf74('0x1c')](_0x1cb205);}return null;};}function patchUpdates(_0x3fafe8){return function(_0x9107a){try{jsonpatch['apply'](_0x9107a,_0x3fafe8,!![]);}catch(_0x23295f){return BPromise[_0xdf74('0x21')](_0x23295f);}return _0x9107a[_0xdf74('0x22')]();};}function saveUpdates(_0x66042e,_0x21787f){return function(_0x2a4773){if(_0x2a4773){return _0x2a4773[_0xdf74('0x23')](_0x66042e)[_0xdf74('0x24')](function(_0xbd7739){return _0xbd7739;});}return null;};}function removeEntity(_0x2ce7cc,_0x442144){return function(_0x269df8){if(_0x269df8){return _0x269df8[_0xdf74('0x25')]()[_0xdf74('0x24')](function(){var _0x2f9302=_0x269df8[_0xdf74('0x26')]({'plain':!![]});var _0x4e5d8e=_0xdf74('0x27');return db[_0xdf74('0x28')][_0xdf74('0x25')]({'where':{'type':_0x4e5d8e,'resourceId':_0x2f9302['id']}})['then'](function(){return _0x269df8;});})[_0xdf74('0x24')](function(){_0x2ce7cc[_0xdf74('0x1b')](0xcc)[_0xdf74('0x1a')]();});}};}function handleEntityNotFound(_0x31885e,_0x20d11c){return function(_0x4df85c){if(!_0x4df85c){_0x31885e[_0xdf74('0x29')](0x194);}return _0x4df85c;};}function handleError(_0x3a9568,_0x255d15){_0x255d15=_0x255d15||0x1f4;return function(_0x449acd){logger[_0xdf74('0x2a')](_0x449acd[_0xdf74('0x2b')]);if(_0x449acd[_0xdf74('0x2c')]){delete _0x449acd[_0xdf74('0x2c')];}_0x3a9568[_0xdf74('0x1b')](_0x255d15)[_0xdf74('0x2d')](_0x449acd);};}exports['index']=function(_0x25f182,_0x5d5427){var _0x155df8={},_0x554d55={},_0x41c900={'count':0x0,'rows':[]};var _0x59016f=_[_0xdf74('0x2e')](db[_0xdf74('0x2f')]['rawAttributes'],function(_0x204e7c){return{'name':_0x204e7c[_0xdf74('0x30')],'type':_0x204e7c[_0xdf74('0x31')][_0xdf74('0x32')]};});_0x554d55['model']=_[_0xdf74('0x2e')](_0x59016f,_0xdf74('0x2c'));_0x554d55[_0xdf74('0x33')]=_['keys'](_0x25f182[_0xdf74('0x33')]);_0x554d55[_0xdf74('0x34')]=_[_0xdf74('0x35')](_0x554d55['model'],_0x554d55['query']);_0x155df8[_0xdf74('0x36')]=_[_0xdf74('0x35')](_0x554d55[_0xdf74('0x37')],qs[_0xdf74('0x38')](_0x25f182['query'][_0xdf74('0x38')]));_0x155df8[_0xdf74('0x36')]=_0x155df8['attributes'][_0xdf74('0x39')]?_0x155df8[_0xdf74('0x36')]:_0x554d55[_0xdf74('0x37')];if(!_0x25f182[_0xdf74('0x33')][_0xdf74('0x3a')]('nolimit')){_0x155df8[_0xdf74('0x1e')]=qs[_0xdf74('0x1e')](_0x25f182[_0xdf74('0x33')][_0xdf74('0x1e')]);_0x155df8[_0xdf74('0x1d')]=qs[_0xdf74('0x1d')](_0x25f182[_0xdf74('0x33')][_0xdf74('0x1d')]);}_0x155df8[_0xdf74('0x3b')]=qs[_0xdf74('0x3c')](_0x25f182[_0xdf74('0x33')]['sort']);_0x155df8[_0xdf74('0x3d')]=qs['filters'](_[_0xdf74('0x3e')](_0x25f182[_0xdf74('0x33')],_0x554d55[_0xdf74('0x34')]));if(_0x25f182[_0xdf74('0x33')][_0xdf74('0x3f')]){_0x155df8[_0xdf74('0x3d')]=_[_0xdf74('0x40')](_0x155df8['where'],{'$or':_[_0xdf74('0x2e')](_0x59016f,function(_0x54957d){if(_0x54957d[_0xdf74('0x31')]!==_0xdf74('0x41')){var _0x555c7e={};_0x555c7e[_0x54957d['name']]={'$like':'%'+_0x25f182['query']['filter']+'%'};return _0x555c7e;}})});}_0x155df8=_['merge']({},_0x155df8,_0x25f182[_0xdf74('0x42')]);var _0x4c67c6={'where':_0x155df8['where']};return db[_0xdf74('0x2f')][_0xdf74('0x43')](_0x4c67c6)['then'](function(_0x3554c5){_0x41c900[_0xdf74('0x43')]=_0x3554c5;if(_0x25f182[_0xdf74('0x33')][_0xdf74('0x44')]){_0x155df8['include']=[{'all':!![]}];}return db['OpenchannelQueue'][_0xdf74('0x45')](_0x155df8);})[_0xdf74('0x24')](function(_0x1407f2){_0x41c900[_0xdf74('0x46')]=_0x1407f2;return _0x41c900;})[_0xdf74('0x24')](respondWithFilteredResult(_0x5d5427,_0x155df8))[_0xdf74('0x47')](handleError(_0x5d5427,null));};exports[_0xdf74('0x48')]=function(_0x365706,_0x4f71de){var _0x2432d3={'raw':!![],'where':{'id':_0x365706[_0xdf74('0x49')]['id']}},_0x5e92df={};_0x5e92df['model']=_[_0xdf74('0x4a')](db[_0xdf74('0x2f')][_0xdf74('0x4b')]);_0x5e92df[_0xdf74('0x33')]=_[_0xdf74('0x4a')](_0x365706[_0xdf74('0x33')]);_0x5e92df['filters']=_[_0xdf74('0x35')](_0x5e92df['model'],_0x5e92df['query']);_0x2432d3[_0xdf74('0x36')]=_[_0xdf74('0x35')](_0x5e92df[_0xdf74('0x37')],qs['fields'](_0x365706[_0xdf74('0x33')]['fields']));_0x2432d3['attributes']=_0x2432d3[_0xdf74('0x36')][_0xdf74('0x39')]?_0x2432d3[_0xdf74('0x36')]:_0x5e92df['model'];if(_0x365706[_0xdf74('0x33')][_0xdf74('0x44')]){_0x2432d3[_0xdf74('0x4c')]=[{'all':!![]}];}_0x2432d3=_['merge']({},_0x2432d3,_0x365706['options']);return db['OpenchannelQueue']['find'](_0x2432d3)[_0xdf74('0x24')](handleEntityNotFound(_0x4f71de,null))[_0xdf74('0x24')](respondWithResult(_0x4f71de,null))[_0xdf74('0x47')](handleError(_0x4f71de,null));};exports[_0xdf74('0x4d')]=function(_0x1f39ca,_0x5413f6){return db[_0xdf74('0x2f')][_0xdf74('0x4d')](_0x1f39ca['body'],{})[_0xdf74('0x24')](function(_0x19c9df){var _0x7cf099=_0x1f39ca[_0xdf74('0x4e')][_0xdf74('0x26')]({'plain':!![]});if(!_0x7cf099)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x7cf099['role']===_0xdf74('0x4e')){var _0x44b16a=_0x19c9df[_0xdf74('0x26')]({'plain':!![]});var _0x335871='OpenchannelQueues';return db[_0xdf74('0x4f')][_0xdf74('0x50')]({'where':{'name':_0x335871,'userProfileId':_0x7cf099[_0xdf74('0x51')]},'raw':!![]})['then'](function(_0xc9d50d){if(_0xc9d50d&&_0xc9d50d[_0xdf74('0x52')]===0x0){return db[_0xdf74('0x28')][_0xdf74('0x4d')]({'name':_0x44b16a[_0xdf74('0x2c')],'resourceId':_0x44b16a['id'],'type':_0xc9d50d[_0xdf74('0x2c')],'sectionId':_0xc9d50d['id']},{})[_0xdf74('0x24')](function(){return _0x19c9df;});}else{return _0x19c9df;}})[_0xdf74('0x47')](function(_0x5c3c40){logger[_0xdf74('0x2a')](_0xdf74('0x53'),_0x5c3c40);throw _0x5c3c40;});}return _0x19c9df;})['then'](respondWithResult(_0x5413f6,0xc9))['catch'](handleError(_0x5413f6,null));};exports[_0xdf74('0x23')]=function(_0x597b2e,_0xd1efa2){if(_0x597b2e[_0xdf74('0x54')]['id']){delete _0x597b2e[_0xdf74('0x54')]['id'];}return db['OpenchannelQueue'][_0xdf74('0x50')]({'where':{'id':_0x597b2e[_0xdf74('0x49')]['id']}})['then'](handleEntityNotFound(_0xd1efa2,null))[_0xdf74('0x24')](saveUpdates(_0x597b2e['body'],null))[_0xdf74('0x24')](respondWithResult(_0xd1efa2,null))[_0xdf74('0x47')](handleError(_0xd1efa2,null));};exports['destroy']=function(_0x361595,_0x351fef){return db[_0xdf74('0x2f')]['find']({'where':{'id':_0x361595['params']['id']}})[_0xdf74('0x24')](handleEntityNotFound(_0x351fef,null))[_0xdf74('0x24')](removeEntity(_0x351fef,null))[_0xdf74('0x47')](handleError(_0x351fef,null));};exports[_0xdf74('0x55')]=function(_0x5440d5,_0x32971e){return db[_0xdf74('0x2f')][_0xdf74('0x55')]()[_0xdf74('0x24')](respondWithResult(_0x32971e,null))[_0xdf74('0x47')](handleError(_0x32971e,null));};exports[_0xdf74('0x56')]=function(_0x231fb3,_0x37bc1c,_0x5f0003){var _0xc1fbe6={'raw':!![],'where':{}},_0x3851c3={},_0x33049e;return db[_0xdf74('0x2f')][_0xdf74('0x57')]({'where':{'id':_0x231fb3[_0xdf74('0x49')]['id']}})[_0xdf74('0x24')](handleEntityNotFound(_0x37bc1c,null))['then'](function(_0x11f95b){if(_0x11f95b){_0x33049e=_0x11f95b[_0xdf74('0x26')]({'plain':!![]});_0x3851c3[_0xdf74('0x37')]=_[_0xdf74('0x4a')](db[_0xdf74('0x58')][_0xdf74('0x4b')]);_0x3851c3[_0xdf74('0x33')]=_[_0xdf74('0x4a')](_0x231fb3[_0xdf74('0x33')]);_0x3851c3['filters']=_[_0xdf74('0x35')](_0x3851c3[_0xdf74('0x37')],_0x3851c3[_0xdf74('0x33')]);_0xc1fbe6[_0xdf74('0x36')]=_[_0xdf74('0x35')](_0x3851c3['model'],qs[_0xdf74('0x38')](_0x231fb3[_0xdf74('0x33')][_0xdf74('0x38')]));_0xc1fbe6[_0xdf74('0x36')]=_0xc1fbe6[_0xdf74('0x36')][_0xdf74('0x39')]?_0xc1fbe6[_0xdf74('0x36')]:_0x3851c3[_0xdf74('0x37')];if(!_0x231fb3['query'][_0xdf74('0x3a')](_0xdf74('0x59'))){_0xc1fbe6[_0xdf74('0x1e')]=qs['limit'](_0x231fb3[_0xdf74('0x33')][_0xdf74('0x1e')]);_0xc1fbe6['offset']=qs[_0xdf74('0x1d')](_0x231fb3[_0xdf74('0x33')][_0xdf74('0x1d')]);}_0xc1fbe6['order']=qs['sort'](_0x231fb3['query'][_0xdf74('0x3c')]);_0xc1fbe6['where']=qs[_0xdf74('0x34')](_[_0xdf74('0x3e')](_0x231fb3[_0xdf74('0x33')],_0x3851c3[_0xdf74('0x34')]));_0xc1fbe6[_0xdf74('0x3d')][_0xdf74('0x5a')]=_0x11f95b['id'];if(_0x231fb3[_0xdf74('0x33')][_0xdf74('0x3f')]){_0xc1fbe6['where']=_[_0xdf74('0x40')](_0xc1fbe6[_0xdf74('0x3d')],{'$or':_[_0xdf74('0x2e')](_0xc1fbe6[_0xdf74('0x36')],function(_0x4f5400){var _0x3b0fb8={};_0x3b0fb8[_0x4f5400]={'$like':'%'+_0x231fb3[_0xdf74('0x33')][_0xdf74('0x3f')]+'%'};return _0x3b0fb8;})});}_0xc1fbe6=_[_0xdf74('0x40')]({},_0xc1fbe6,_0x231fb3[_0xdf74('0x42')]);return db[_0xdf74('0x58')][_0xdf74('0x45')](_0xc1fbe6);}})[_0xdf74('0x24')](function(_0x2ed403){if(_0x2ed403){return db[_0xdf74('0x5b')]['findAndCountAll']({'where':{'id':_[_0xdf74('0x2e')](_0x2ed403,_0xdf74('0x5c')),'role':_0xdf74('0x5d')},'attributes':['id',_0xdf74('0x2c'),'openchannelPause',_0xdf74('0x5e'),_0xdf74('0x5f')]});}})[_0xdf74('0x24')](function(_0x191b9a){if(_0x191b9a){return{'count':_0x191b9a['count'],'rows':_['map'](_0x191b9a['rows'],function(_0x7f1173){return{'membername':_0x7f1173[_0xdf74('0x2c')],'UserId':_0x7f1173['id'],'queue_name':_0x33049e[_0xdf74('0x2c')],'OpenchannelQueueId':_0x33049e['id'],'interface':util['format'](_0xdf74('0x60'),_0xdf74('0x61'),_0x7f1173[_0xdf74('0x2c')]),'penalty':0x0,'paused':_0x7f1173[_0xdf74('0x62')],'createdAt':_0x7f1173['createdAt'],'updatedAt':_0x7f1173[_0xdf74('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x37bc1c,_0xc1fbe6))[_0xdf74('0x47')](handleError(_0x37bc1c,null));};exports[_0xdf74('0x63')]=function(_0x4a1747,_0xec694b,_0x4ada24){var _0x23bb60={};var _0x2ee0ee={};var _0x89ef0a;var _0x5ef2e0;return db[_0xdf74('0x2f')][_0xdf74('0x57')]({'where':{'id':_0x4a1747[_0xdf74('0x49')]['id']}})[_0xdf74('0x24')](handleEntityNotFound(_0xec694b,null))[_0xdf74('0x24')](function(_0x5bc3b){if(_0x5bc3b){_0x89ef0a=_0x5bc3b;_0x2ee0ee['model']=_['keys'](db[_0xdf74('0x64')][_0xdf74('0x4b')]);_0x2ee0ee[_0xdf74('0x33')]=_['keys'](_0x4a1747[_0xdf74('0x33')]);_0x2ee0ee[_0xdf74('0x34')]=_['intersection'](_0x2ee0ee[_0xdf74('0x37')],_0x2ee0ee['query']);_0x23bb60[_0xdf74('0x36')]=_[_0xdf74('0x35')](_0x2ee0ee[_0xdf74('0x37')],qs['fields'](_0x4a1747[_0xdf74('0x33')]['fields']));_0x23bb60[_0xdf74('0x36')]=_0x23bb60[_0xdf74('0x36')][_0xdf74('0x39')]?_0x23bb60[_0xdf74('0x36')]:_0x2ee0ee['model'];_0x23bb60[_0xdf74('0x3b')]=qs[_0xdf74('0x3c')](_0x4a1747[_0xdf74('0x33')][_0xdf74('0x3c')]);_0x23bb60[_0xdf74('0x3d')]=qs[_0xdf74('0x34')](_[_0xdf74('0x3e')](_0x4a1747[_0xdf74('0x33')],_0x2ee0ee['filters']));if(_0x4a1747[_0xdf74('0x33')][_0xdf74('0x3f')]){_0x23bb60[_0xdf74('0x3d')]=_['merge'](_0x23bb60['where'],{'$or':_['map'](_0x23bb60[_0xdf74('0x36')],function(_0x5d4b96){var _0x17bbed={};_0x17bbed[_0x5d4b96]={'$like':'%'+_0x4a1747[_0xdf74('0x33')][_0xdf74('0x3f')]+'%'};return _0x17bbed;})});}_0x23bb60=_[_0xdf74('0x40')]({},_0x23bb60,_0x4a1747[_0xdf74('0x42')]);return _0x89ef0a['getTeams'](_0x23bb60);}})[_0xdf74('0x24')](function(_0x1d9f1c){if(_0x1d9f1c){_0x5ef2e0=_0x1d9f1c[_0xdf74('0x39')];if(!_0x4a1747[_0xdf74('0x33')][_0xdf74('0x3a')]('nolimit')){_0x23bb60['limit']=qs['limit'](_0x4a1747['query'][_0xdf74('0x1e')]);_0x23bb60[_0xdf74('0x1d')]=qs['offset'](_0x4a1747['query'][_0xdf74('0x1d')]);}return _0x89ef0a[_0xdf74('0x63')](_0x23bb60);}})['then'](function(_0x14a13b){if(_0x14a13b){return _0x14a13b?{'count':_0x5ef2e0,'rows':_0x14a13b}:null;}})[_0xdf74('0x24')](respondWithResult(_0xec694b,null))[_0xdf74('0x47')](handleError(_0xec694b,null));};exports[_0xdf74('0x65')]=function(_0x2e03aa,_0x2cb15c,_0x38c9c0){var _0x35536c=_0x2e03aa[_0xdf74('0x54')][_0xdf74('0x66')];return db[_0xdf74('0x64')]['findAll']({'where':{'id':_0x35536c},'attributes':['id'],'include':[{'model':db['User'],'as':_0xdf74('0x67'),'attributes':['id','name',_0xdf74('0x68'),_0xdf74('0x69'),_0xdf74('0x6a')],'raw':!![]}]})[_0xdf74('0x24')](function(_0x5a0308){if(_0x5a0308){var _0x23769a=_['flatMap'](_0x5a0308,function(_0x15e6cc){var _0x286524=_0x15e6cc[_0xdf74('0x26')]({'plain':!![]});return _0x286524[_0xdf74('0x67')];});return db[_0xdf74('0x2f')]['find']({'where':{'id':_0x2e03aa[_0xdf74('0x49')]['id']}})['then'](function(_0x53d19b){return db[_0xdf74('0x6b')][_0xdf74('0x6c')](function(_0x165166){return _0x53d19b['addTeams'](_0x35536c,{'transaction':_0x165166})[_0xdf74('0x24')](function(){return BPromise['each'](_0x23769a,function(_0x27b4f6){return db['UserOpenchannelQueue'][_0xdf74('0x6d')]({'where':{'UserId':_0x27b4f6['id'],'OpenchannelQueueId':_0x2e03aa[_0xdf74('0x49')]['id']},'transaction':_0x165166});});})[_0xdf74('0x24')](function(){_0x23769a['forEach'](function(_0x331023){socket[_0xdf74('0x6e')](_0xdf74('0x6f'),{'UserId':_0x331023['id'],'OpenchannelQueueId':_0x53d19b['id']});});});});});}})[_0xdf74('0x24')](respondWithStatusCode(_0x2cb15c,null))[_0xdf74('0x47')](handleError(_0x2cb15c,null));};exports[_0xdf74('0x70')]=function(_0x2c04bd,_0x5459f3,_0x59bdcf){return db[_0xdf74('0x64')][_0xdf74('0x45')]({'where':{'id':_0x2c04bd[_0xdf74('0x33')][_0xdf74('0x66')]},'attributes':['id'],'include':[{'model':db[_0xdf74('0x5b')],'as':_0xdf74('0x67'),'attributes':['id'],'raw':!![]}]})[_0xdf74('0x24')](handleEntityNotFound(_0x5459f3,null))['then'](function(_0x58b5be){var _0x431947=_[_0xdf74('0x2e')](_0x58b5be,'id');var _0x5a606c=[];var _0x363a86=[];var _0x4c5643=squel[_0xdf74('0x71')]();_0x4c5643[_0xdf74('0x72')](_0xdf74('0x73'))[_0xdf74('0x74')](_0xdf74('0x75'),'tq')['join'](_0xdf74('0x76'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xdf74('0x3d')]('OpenchannelQueueId\x20=\x20?',_0x2c04bd[_0xdf74('0x49')]['id']);for(var _0xfa037b=0x0;_0xfa037b<_0x58b5be['length'];_0xfa037b+=0x1){let _0x49fefa=_0x58b5be[_0xfa037b];for(var _0x3b5b6e=0x0;_0x3b5b6e<_0x49fefa['Agents'][_0xdf74('0x39')];_0x3b5b6e+=0x1){let _0x4d15ae=_0x49fefa['Agents'][_0x3b5b6e];var _0x4c627c=_0x4c5643[_0xdf74('0x77')]();_0x4c627c[_0xdf74('0x3d')](_0xdf74('0x78'),_0x4d15ae['id']);_0x363a86[_0xdf74('0x79')](db[_0xdf74('0x6b')][_0xdf74('0x33')](_0x4c627c[_0xdf74('0x7a')](),{'type':db['sequelize'][_0xdf74('0x7b')][_0xdf74('0x7c')]})[_0xdf74('0x24')](function(_0x3a47c8){if(_0x3a47c8[_0xdf74('0x39')]===0x1){return _0x4d15ae['id'];}else{var _0x4e3aa8=_['every'](_[_0xdf74('0x2e')](_0x3a47c8,_0xdf74('0x7d')),function(_0x12a136){return _['includes'](_0x431947,_0x12a136);});if(_0x4e3aa8){return _0x4d15ae['id'];}}}));}}return BPromise['all'](_0x363a86)[_0xdf74('0x24')](function(_0x1679b4){_0x5a606c=_(_0x5a606c)[_0xdf74('0x7e')](_0x1679b4)[_0xdf74('0x7f')]()[_0xdf74('0x80')]();return db[_0xdf74('0x2f')][_0xdf74('0x50')]({'where':{'id':_0x2c04bd['params']['id']}})['then'](function(_0x4eb57a){return db[_0xdf74('0x6b')]['transaction'](function(_0x13754b){return _0x4eb57a['removeTeams'](_0x2c04bd[_0xdf74('0x33')][_0xdf74('0x66')],{'transaction':_0x13754b})[_0xdf74('0x24')](function(){if(!_[_0xdf74('0x81')](_0x5a606c)){return _0x4eb57a[_0xdf74('0x82')](_0x5a606c,{'transaction':_0x13754b});}})[_0xdf74('0x24')](function(){_0x5a606c[_0xdf74('0x83')](function(_0x169bd0){socket[_0xdf74('0x6e')](_0xdf74('0x84'),{'UserId':_0x169bd0,'OpenchannelQueueId':_0x4eb57a['id']});});});});});});})[_0xdf74('0x24')](respondWithStatusCode(_0x5459f3,null))['catch'](handleError(_0x5459f3,null));};exports['addAgents']=function(_0x26e826,_0x162e2b,_0x2b7872){return db['OpenchannelQueue'][_0xdf74('0x50')]({'where':{'id':_0x26e826[_0xdf74('0x49')]['id']}})['then'](handleEntityNotFound(_0x162e2b,null))[_0xdf74('0x24')](function(_0x317366){if(_0x317366){return _0x317366['addAgents'](_0x26e826[_0xdf74('0x54')][_0xdf74('0x66')],_[_0xdf74('0x85')](_0x26e826[_0xdf74('0x54')],[_0xdf74('0x66'),'id'])||{})['spread'](function(_0x15af04){for(var _0x1f03c5=0x0;_0x1f03c5<_0x26e826[_0xdf74('0x54')][_0xdf74('0x66')][_0xdf74('0x39')];_0x1f03c5+=0x1){socket[_0xdf74('0x6e')](_0xdf74('0x6f'),{'UserId':_0x26e826[_0xdf74('0x54')][_0xdf74('0x66')][_0x1f03c5],'OpenchannelQueueId':_0x26e826[_0xdf74('0x49')]['id']});}return _0x15af04;});}})['then'](respondWithResult(_0x162e2b,null))[_0xdf74('0x47')](handleError(_0x162e2b,null));};exports[_0xdf74('0x82')]=function(_0x53980c,_0x2c1473,_0x62ec12){return db[_0xdf74('0x2f')][_0xdf74('0x50')]({'where':{'id':_0x53980c[_0xdf74('0x49')]['id']}})[_0xdf74('0x24')](handleEntityNotFound(_0x2c1473,null))[_0xdf74('0x24')](function(_0x37ace9){if(_0x37ace9){return _0x37ace9[_0xdf74('0x82')](_0x53980c[_0xdf74('0x33')][_0xdf74('0x66')])[_0xdf74('0x24')](function(){if(_['isArray'](_0x53980c[_0xdf74('0x33')][_0xdf74('0x66')])){for(var _0x145ee9=0x0;_0x145ee9<_0x53980c[_0xdf74('0x33')][_0xdf74('0x66')][_0xdf74('0x39')];_0x145ee9+=0x1){socket[_0xdf74('0x6e')](_0xdf74('0x84'),{'UserId':Number(_0x53980c[_0xdf74('0x33')][_0xdf74('0x66')][_0x145ee9]),'OpenchannelQueueId':Number(_0x53980c[_0xdf74('0x49')]['id'])});}}else{socket[_0xdf74('0x6e')](_0xdf74('0x84'),{'UserId':Number(_0x53980c['query'][_0xdf74('0x66')]),'OpenchannelQueueId':Number(_0x53980c[_0xdf74('0x49')]['id'])});}});}})['then'](respondWithStatusCode(_0x2c1473,null))[_0xdf74('0x47')](handleError(_0x2c1473,null));};exports['getAgents']=function(_0x5768a7,_0xc69b2c,_0x9f37e5){var _0x45dd9e={};var _0x5a3639={};var _0x5d25cd;var _0x3a6d06;return db[_0xdf74('0x2f')][_0xdf74('0x57')]({'where':{'id':_0x5768a7['params']['id']}})[_0xdf74('0x24')](handleEntityNotFound(_0xc69b2c,null))['then'](function(_0x18de96){if(_0x18de96){_0x5d25cd=_0x18de96;_0x5a3639[_0xdf74('0x37')]=_[_0xdf74('0x4a')](db[_0xdf74('0x5b')][_0xdf74('0x4b')]);_0x5a3639[_0xdf74('0x33')]=_['keys'](_0x5768a7[_0xdf74('0x33')]);_0x5a3639[_0xdf74('0x34')]=_[_0xdf74('0x35')](_0x5a3639[_0xdf74('0x37')],_0x5a3639[_0xdf74('0x33')]);_0x45dd9e[_0xdf74('0x36')]=_[_0xdf74('0x35')](_0x5a3639[_0xdf74('0x37')],qs['fields'](_0x5768a7[_0xdf74('0x33')]['fields']));_0x45dd9e[_0xdf74('0x36')]=_0x45dd9e['attributes']['length']?_0x45dd9e['attributes']:_0x5a3639[_0xdf74('0x37')];_0x45dd9e['order']=qs[_0xdf74('0x3c')](_0x5768a7['query'][_0xdf74('0x3c')]);_0x45dd9e[_0xdf74('0x3d')]=qs[_0xdf74('0x34')](_[_0xdf74('0x3e')](_0x5768a7['query'],_0x5a3639['filters']));if(_0x5768a7[_0xdf74('0x33')][_0xdf74('0x3f')]){_0x45dd9e['where']=_[_0xdf74('0x40')](_0x45dd9e[_0xdf74('0x3d')],{'$or':_[_0xdf74('0x2e')](_0x45dd9e['attributes'],function(_0x4afda9){var _0x10daad={};_0x10daad[_0x4afda9]={'$like':'%'+_0x5768a7['query'][_0xdf74('0x3f')]+'%'};return _0x10daad;})});}_0x45dd9e=_[_0xdf74('0x40')]({},_0x45dd9e,_0x5768a7[_0xdf74('0x42')]);return _0x5d25cd[_0xdf74('0x86')](_0x45dd9e);}})[_0xdf74('0x24')](function(_0x1bf0a7){if(_0x1bf0a7){_0x3a6d06=_0x1bf0a7['length'];if(!_0x5768a7[_0xdf74('0x33')][_0xdf74('0x3a')](_0xdf74('0x59'))){_0x45dd9e[_0xdf74('0x1e')]=qs['limit'](_0x5768a7['query'][_0xdf74('0x1e')]);_0x45dd9e[_0xdf74('0x1d')]=qs['offset'](_0x5768a7[_0xdf74('0x33')][_0xdf74('0x1d')]);}return _0x5d25cd[_0xdf74('0x86')](_0x45dd9e);}})[_0xdf74('0x24')](function(_0x46901e){if(_0x46901e){return _0x46901e?{'count':_0x3a6d06,'rows':_0x46901e}:null;}})['then'](respondWithResult(_0xc69b2c,null))[_0xdf74('0x47')](handleError(_0xc69b2c,null));}; \ No newline at end of file +var _0xcadc=['catch','show','params','rawAttributes','intersection','include','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','destroy','describe','getMembers','findOne','UserOpenchannelQueue','hasOwnProperty','User','UserId','openchannelPause','createdAt','format','%s/%s','SIP','updatedAt','Team','getTeams','addTeams','online','voicePause','interface','Agents','sequelize','transaction','each','forEach','userOpenchannelQueue:save','ids','select','field','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','includes','all','value','removeTeams','isEmpty','userOpenchannelQueue:remove','addAgents','omit','emit','isArray','getAgents','html-pdf','rimraf','fast-json-patch','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','../../config/environment','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','end','offset','limit','status','set','json','apply','reject','get','OpenchannelQueues','then','sendStatus','stack','name','send','map','OpenchannelQueue','fieldName','type','key','model','query','keys','filters','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','count','includeAll','findAll'];(function(_0x5b494c,_0x182312){var _0x5d8bac=function(_0x36899d){while(--_0x36899d){_0x5b494c['push'](_0x5b494c['shift']());}};_0x5d8bac(++_0x182312);}(_0xcadc,0x153));var _0xccad=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xcadc[_0x4565bf];return _0x5610ba;};'use strict';var pdf=require(_0xccad('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xccad('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xccad('0x2'));var rp=require(_0xccad('0x3'));var moment=require(_0xccad('0x4'));var BPromise=require(_0xccad('0x5'));var Mustache=require(_0xccad('0x6'));var util=require(_0xccad('0x7'));var path=require(_0xccad('0x8'));var sox=require(_0xccad('0x9'));var csv=require(_0xccad('0xa'));var ejs=require(_0xccad('0xb'));var fs=require('fs');var _=require(_0xccad('0xc'));var squel=require(_0xccad('0xd'));var crypto=require(_0xccad('0xe'));var jsforce=require(_0xccad('0xf'));var deskjs=require(_0xccad('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xccad('0x11'));var authService=require(_0xccad('0x12'));var qs=require(_0xccad('0x13'));var as=require(_0xccad('0x14'));var hardwareService=require(_0xccad('0x15'));var logger=require(_0xccad('0x16'))(_0xccad('0x17'));var utils=require(_0xccad('0x18'));var config=require(_0xccad('0x19'));var db=require('../../mysqldb')['db'];config[_0xccad('0x1a')]=_['defaults'](config[_0xccad('0x1a')],{'host':_0xccad('0x1b'),'port':0x18eb});var socket=require(_0xccad('0x1c'))(new Redis(config[_0xccad('0x1a')]));require(_0xccad('0x1d'))[_0xccad('0x1e')](socket);function respondWithStatusCode(_0x36a909,_0x5fbbe3){_0x5fbbe3=_0x5fbbe3||0xcc;return function(_0xea2a8c){if(_0xea2a8c){return _0x36a909['sendStatus'](_0x5fbbe3);}return _0x36a909['status'](_0x5fbbe3)[_0xccad('0x1f')]();};}function respondWithResult(_0x20fa09,_0x10a20a){_0x10a20a=_0x10a20a||0xc8;return function(_0x583995){if(_0x583995){return _0x20fa09['status'](_0x10a20a)['json'](_0x583995);}};}function respondWithFilteredResult(_0x3868f4,_0x464688){return function(_0x1ef88d){if(_0x1ef88d){var _0x3ac5c8=_0x1ef88d['count'],_0x573b57=_0x464688[_0xccad('0x20')],_0x2aa06b=_0x464688[_0xccad('0x20')]+_0x464688[_0xccad('0x21')],_0x1d66ef;if(_0x2aa06b>=_0x3ac5c8){_0x2aa06b=_0x3ac5c8;_0x1d66ef=0xc8;}else{_0x1d66ef=0xce;}_0x3868f4[_0xccad('0x22')](_0x1d66ef);return _0x3868f4[_0xccad('0x23')]('Content-Range',_0x573b57+'-'+_0x2aa06b+'/'+_0x3ac5c8)[_0xccad('0x24')](_0x1ef88d);}return null;};}function patchUpdates(_0x1c6aa3){return function(_0x1de3e3){try{jsonpatch[_0xccad('0x25')](_0x1de3e3,_0x1c6aa3,!![]);}catch(_0x12dc07){return BPromise[_0xccad('0x26')](_0x12dc07);}return _0x1de3e3['save']();};}function saveUpdates(_0x2c026e,_0x5cd932){return function(_0x5ce195){if(_0x5ce195){return _0x5ce195['update'](_0x2c026e)['then'](function(_0x2124bf){return _0x2124bf;});}return null;};}function removeEntity(_0x2c58bf,_0x315d2f){return function(_0x32f953){if(_0x32f953){return _0x32f953['destroy']()['then'](function(){var _0x2a7994=_0x32f953[_0xccad('0x27')]({'plain':!![]});var _0xb07ce2=_0xccad('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0xb07ce2,'resourceId':_0x2a7994['id']}})[_0xccad('0x29')](function(){return _0x32f953;});})[_0xccad('0x29')](function(){_0x2c58bf[_0xccad('0x22')](0xcc)[_0xccad('0x1f')]();});}};}function handleEntityNotFound(_0x306f51,_0x37cdeb){return function(_0x2261bc){if(!_0x2261bc){_0x306f51[_0xccad('0x2a')](0x194);}return _0x2261bc;};}function handleError(_0x393f76,_0x5d650b){_0x5d650b=_0x5d650b||0x1f4;return function(_0x5f252d){logger['error'](_0x5f252d[_0xccad('0x2b')]);if(_0x5f252d[_0xccad('0x2c')]){delete _0x5f252d[_0xccad('0x2c')];}_0x393f76[_0xccad('0x22')](_0x5d650b)[_0xccad('0x2d')](_0x5f252d);};}exports['index']=function(_0x384aa0,_0xaefee5){var _0xda4cf2={},_0x1a6118={},_0x4d6d5f={'count':0x0,'rows':[]};var _0x271678=_[_0xccad('0x2e')](db[_0xccad('0x2f')]['rawAttributes'],function(_0x674c9){return{'name':_0x674c9[_0xccad('0x30')],'type':_0x674c9[_0xccad('0x31')][_0xccad('0x32')]};});_0x1a6118[_0xccad('0x33')]=_['map'](_0x271678,_0xccad('0x2c'));_0x1a6118[_0xccad('0x34')]=_[_0xccad('0x35')](_0x384aa0[_0xccad('0x34')]);_0x1a6118[_0xccad('0x36')]=_['intersection'](_0x1a6118[_0xccad('0x33')],_0x1a6118[_0xccad('0x34')]);_0xda4cf2[_0xccad('0x37')]=_['intersection'](_0x1a6118[_0xccad('0x33')],qs[_0xccad('0x38')](_0x384aa0[_0xccad('0x34')]['fields']));_0xda4cf2[_0xccad('0x37')]=_0xda4cf2[_0xccad('0x37')][_0xccad('0x39')]?_0xda4cf2[_0xccad('0x37')]:_0x1a6118['model'];if(!_0x384aa0[_0xccad('0x34')]['hasOwnProperty'](_0xccad('0x3a'))){_0xda4cf2['limit']=qs[_0xccad('0x21')](_0x384aa0['query'][_0xccad('0x21')]);_0xda4cf2[_0xccad('0x20')]=qs[_0xccad('0x20')](_0x384aa0[_0xccad('0x34')][_0xccad('0x20')]);}_0xda4cf2[_0xccad('0x3b')]=qs[_0xccad('0x3c')](_0x384aa0['query'][_0xccad('0x3c')]);_0xda4cf2['where']=qs['filters'](_[_0xccad('0x3d')](_0x384aa0['query'],_0x1a6118[_0xccad('0x36')]));if(_0x384aa0[_0xccad('0x34')][_0xccad('0x3e')]){_0xda4cf2[_0xccad('0x3f')]=_[_0xccad('0x40')](_0xda4cf2['where'],{'$or':_[_0xccad('0x2e')](_0x271678,function(_0x3dfe6c){if(_0x3dfe6c[_0xccad('0x31')]!==_0xccad('0x41')){var _0x9e900e={};_0x9e900e[_0x3dfe6c[_0xccad('0x2c')]]={'$like':'%'+_0x384aa0[_0xccad('0x34')]['filter']+'%'};return _0x9e900e;}})});}_0xda4cf2=_[_0xccad('0x40')]({},_0xda4cf2,_0x384aa0['options']);var _0x2c9144={'where':_0xda4cf2[_0xccad('0x3f')]};return db[_0xccad('0x2f')]['count'](_0x2c9144)[_0xccad('0x29')](function(_0xfcb58a){_0x4d6d5f[_0xccad('0x42')]=_0xfcb58a;if(_0x384aa0[_0xccad('0x34')][_0xccad('0x43')]){_0xda4cf2['include']=[{'all':!![]}];}return db[_0xccad('0x2f')][_0xccad('0x44')](_0xda4cf2);})[_0xccad('0x29')](function(_0x140be4){_0x4d6d5f['rows']=_0x140be4;return _0x4d6d5f;})[_0xccad('0x29')](respondWithFilteredResult(_0xaefee5,_0xda4cf2))[_0xccad('0x45')](handleError(_0xaefee5,null));};exports[_0xccad('0x46')]=function(_0x135268,_0x563289){var _0x385f9f={'raw':!![],'where':{'id':_0x135268[_0xccad('0x47')]['id']}},_0x3e4367={};_0x3e4367[_0xccad('0x33')]=_[_0xccad('0x35')](db[_0xccad('0x2f')][_0xccad('0x48')]);_0x3e4367[_0xccad('0x34')]=_[_0xccad('0x35')](_0x135268[_0xccad('0x34')]);_0x3e4367['filters']=_[_0xccad('0x49')](_0x3e4367[_0xccad('0x33')],_0x3e4367[_0xccad('0x34')]);_0x385f9f['attributes']=_[_0xccad('0x49')](_0x3e4367[_0xccad('0x33')],qs[_0xccad('0x38')](_0x135268['query'][_0xccad('0x38')]));_0x385f9f['attributes']=_0x385f9f[_0xccad('0x37')][_0xccad('0x39')]?_0x385f9f[_0xccad('0x37')]:_0x3e4367['model'];if(_0x135268['query'][_0xccad('0x43')]){_0x385f9f[_0xccad('0x4a')]=[{'all':!![]}];}_0x385f9f=_[_0xccad('0x40')]({},_0x385f9f,_0x135268[_0xccad('0x4b')]);return db[_0xccad('0x2f')][_0xccad('0x4c')](_0x385f9f)[_0xccad('0x29')](handleEntityNotFound(_0x563289,null))['then'](respondWithResult(_0x563289,null))['catch'](handleError(_0x563289,null));};exports[_0xccad('0x4d')]=function(_0x3c75bc,_0x4c5b33){return db[_0xccad('0x2f')][_0xccad('0x4d')](_0x3c75bc[_0xccad('0x4e')],{})[_0xccad('0x29')](function(_0xb96256){var _0x4092e2=_0x3c75bc[_0xccad('0x4f')][_0xccad('0x27')]({'plain':!![]});if(!_0x4092e2)throw new Error(_0xccad('0x50'));if(_0x4092e2[_0xccad('0x51')]===_0xccad('0x4f')){var _0x5594c0=_0xb96256[_0xccad('0x27')]({'plain':!![]});var _0x296143=_0xccad('0x28');return db[_0xccad('0x52')]['find']({'where':{'name':_0x296143,'userProfileId':_0x4092e2[_0xccad('0x53')]},'raw':!![]})[_0xccad('0x29')](function(_0x297377){if(_0x297377&&_0x297377[_0xccad('0x54')]===0x0){return db[_0xccad('0x55')][_0xccad('0x4d')]({'name':_0x5594c0['name'],'resourceId':_0x5594c0['id'],'type':_0x297377['name'],'sectionId':_0x297377['id']},{})['then'](function(){return _0xb96256;});}else{return _0xb96256;}})['catch'](function(_0x297ba0){logger[_0xccad('0x56')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x297ba0);throw _0x297ba0;});}return _0xb96256;})['then'](respondWithResult(_0x4c5b33,0xc9))[_0xccad('0x45')](handleError(_0x4c5b33,null));};exports['update']=function(_0x5b8c11,_0xb66768){if(_0x5b8c11[_0xccad('0x4e')]['id']){delete _0x5b8c11['body']['id'];}return db['OpenchannelQueue']['find']({'where':{'id':_0x5b8c11[_0xccad('0x47')]['id']}})['then'](handleEntityNotFound(_0xb66768,null))['then'](saveUpdates(_0x5b8c11[_0xccad('0x4e')],null))['then'](respondWithResult(_0xb66768,null))[_0xccad('0x45')](handleError(_0xb66768,null));};exports[_0xccad('0x57')]=function(_0x17158b,_0x153a40){return db[_0xccad('0x2f')][_0xccad('0x4c')]({'where':{'id':_0x17158b[_0xccad('0x47')]['id']}})[_0xccad('0x29')](handleEntityNotFound(_0x153a40,null))[_0xccad('0x29')](removeEntity(_0x153a40,null))['catch'](handleError(_0x153a40,null));};exports[_0xccad('0x58')]=function(_0x105f33,_0x556760){return db[_0xccad('0x2f')][_0xccad('0x58')]()[_0xccad('0x29')](respondWithResult(_0x556760,null))['catch'](handleError(_0x556760,null));};exports[_0xccad('0x59')]=function(_0x46be3f,_0xfe4b1a,_0xfe5d74){var _0x12b899={'raw':!![],'where':{}},_0x3d1b84={},_0x459645;return db['OpenchannelQueue'][_0xccad('0x5a')]({'where':{'id':_0x46be3f[_0xccad('0x47')]['id']}})[_0xccad('0x29')](handleEntityNotFound(_0xfe4b1a,null))[_0xccad('0x29')](function(_0x59548a){if(_0x59548a){_0x459645=_0x59548a[_0xccad('0x27')]({'plain':!![]});_0x3d1b84[_0xccad('0x33')]=_[_0xccad('0x35')](db[_0xccad('0x5b')][_0xccad('0x48')]);_0x3d1b84[_0xccad('0x34')]=_['keys'](_0x46be3f[_0xccad('0x34')]);_0x3d1b84['filters']=_[_0xccad('0x49')](_0x3d1b84[_0xccad('0x33')],_0x3d1b84[_0xccad('0x34')]);_0x12b899['attributes']=_[_0xccad('0x49')](_0x3d1b84[_0xccad('0x33')],qs['fields'](_0x46be3f[_0xccad('0x34')][_0xccad('0x38')]));_0x12b899['attributes']=_0x12b899[_0xccad('0x37')][_0xccad('0x39')]?_0x12b899['attributes']:_0x3d1b84[_0xccad('0x33')];if(!_0x46be3f[_0xccad('0x34')][_0xccad('0x5c')]('nolimit')){_0x12b899[_0xccad('0x21')]=qs['limit'](_0x46be3f['query'][_0xccad('0x21')]);_0x12b899[_0xccad('0x20')]=qs[_0xccad('0x20')](_0x46be3f['query'][_0xccad('0x20')]);}_0x12b899['order']=qs[_0xccad('0x3c')](_0x46be3f[_0xccad('0x34')][_0xccad('0x3c')]);_0x12b899[_0xccad('0x3f')]=qs[_0xccad('0x36')](_['pick'](_0x46be3f['query'],_0x3d1b84['filters']));_0x12b899[_0xccad('0x3f')]['OpenchannelQueueId']=_0x59548a['id'];if(_0x46be3f[_0xccad('0x34')]['filter']){_0x12b899['where']=_[_0xccad('0x40')](_0x12b899[_0xccad('0x3f')],{'$or':_[_0xccad('0x2e')](_0x12b899[_0xccad('0x37')],function(_0xfff4f0){var _0x2f3169={};_0x2f3169[_0xfff4f0]={'$like':'%'+_0x46be3f[_0xccad('0x34')][_0xccad('0x3e')]+'%'};return _0x2f3169;})});}_0x12b899=_[_0xccad('0x40')]({},_0x12b899,_0x46be3f['options']);return db[_0xccad('0x5b')][_0xccad('0x44')](_0x12b899);}})[_0xccad('0x29')](function(_0x2ad4ad){if(_0x2ad4ad){return db[_0xccad('0x5d')]['findAndCountAll']({'where':{'id':_[_0xccad('0x2e')](_0x2ad4ad,_0xccad('0x5e')),'role':'agent'},'attributes':['id',_0xccad('0x2c'),_0xccad('0x5f'),'updatedAt',_0xccad('0x60')]});}})[_0xccad('0x29')](function(_0x81cf1f){if(_0x81cf1f){return{'count':_0x81cf1f[_0xccad('0x42')],'rows':_[_0xccad('0x2e')](_0x81cf1f['rows'],function(_0x2cbaeb){return{'membername':_0x2cbaeb[_0xccad('0x2c')],'UserId':_0x2cbaeb['id'],'queue_name':_0x459645['name'],'OpenchannelQueueId':_0x459645['id'],'interface':util[_0xccad('0x61')](_0xccad('0x62'),_0xccad('0x63'),_0x2cbaeb[_0xccad('0x2c')]),'penalty':0x0,'paused':_0x2cbaeb[_0xccad('0x5f')],'createdAt':_0x2cbaeb[_0xccad('0x60')],'updatedAt':_0x2cbaeb[_0xccad('0x64')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0xfe4b1a,_0x12b899))[_0xccad('0x45')](handleError(_0xfe4b1a,null));};exports['getTeams']=function(_0x4a4a2d,_0x3738f6,_0x2273a3){var _0x51e4d9={};var _0x219b68={};var _0x492738;var _0x3cfd19;return db[_0xccad('0x2f')]['findOne']({'where':{'id':_0x4a4a2d[_0xccad('0x47')]['id']}})[_0xccad('0x29')](handleEntityNotFound(_0x3738f6,null))[_0xccad('0x29')](function(_0x444289){if(_0x444289){_0x492738=_0x444289;_0x219b68[_0xccad('0x33')]=_[_0xccad('0x35')](db[_0xccad('0x65')][_0xccad('0x48')]);_0x219b68[_0xccad('0x34')]=_[_0xccad('0x35')](_0x4a4a2d['query']);_0x219b68[_0xccad('0x36')]=_[_0xccad('0x49')](_0x219b68[_0xccad('0x33')],_0x219b68[_0xccad('0x34')]);_0x51e4d9[_0xccad('0x37')]=_[_0xccad('0x49')](_0x219b68[_0xccad('0x33')],qs['fields'](_0x4a4a2d['query'][_0xccad('0x38')]));_0x51e4d9[_0xccad('0x37')]=_0x51e4d9[_0xccad('0x37')][_0xccad('0x39')]?_0x51e4d9['attributes']:_0x219b68[_0xccad('0x33')];_0x51e4d9[_0xccad('0x3b')]=qs[_0xccad('0x3c')](_0x4a4a2d['query']['sort']);_0x51e4d9['where']=qs[_0xccad('0x36')](_[_0xccad('0x3d')](_0x4a4a2d['query'],_0x219b68[_0xccad('0x36')]));if(_0x4a4a2d[_0xccad('0x34')]['filter']){_0x51e4d9['where']=_[_0xccad('0x40')](_0x51e4d9[_0xccad('0x3f')],{'$or':_[_0xccad('0x2e')](_0x51e4d9[_0xccad('0x37')],function(_0x12d84e){var _0x4887b2={};_0x4887b2[_0x12d84e]={'$like':'%'+_0x4a4a2d[_0xccad('0x34')][_0xccad('0x3e')]+'%'};return _0x4887b2;})});}_0x51e4d9=_['merge']({},_0x51e4d9,_0x4a4a2d[_0xccad('0x4b')]);return _0x492738[_0xccad('0x66')](_0x51e4d9);}})[_0xccad('0x29')](function(_0x3306e1){if(_0x3306e1){_0x3cfd19=_0x3306e1[_0xccad('0x39')];if(!_0x4a4a2d[_0xccad('0x34')][_0xccad('0x5c')]('nolimit')){_0x51e4d9[_0xccad('0x21')]=qs[_0xccad('0x21')](_0x4a4a2d['query']['limit']);_0x51e4d9[_0xccad('0x20')]=qs['offset'](_0x4a4a2d['query']['offset']);}return _0x492738[_0xccad('0x66')](_0x51e4d9);}})[_0xccad('0x29')](function(_0x21d5ff){if(_0x21d5ff){return _0x21d5ff?{'count':_0x3cfd19,'rows':_0x21d5ff}:null;}})[_0xccad('0x29')](respondWithResult(_0x3738f6,null))[_0xccad('0x45')](handleError(_0x3738f6,null));};exports[_0xccad('0x67')]=function(_0x24460c,_0x3ce213,_0xa1132d){var _0x289e36=_0x24460c[_0xccad('0x4e')]['ids'];return db[_0xccad('0x65')][_0xccad('0x44')]({'where':{'id':_0x289e36},'attributes':['id'],'include':[{'model':db[_0xccad('0x5d')],'as':'Agents','attributes':['id',_0xccad('0x2c'),_0xccad('0x68'),_0xccad('0x69'),_0xccad('0x6a')],'raw':!![]}]})[_0xccad('0x29')](function(_0xb9b725){if(_0xb9b725){var _0x4f3a5f=_['flatMap'](_0xb9b725,function(_0x24155f){var _0x35e72b=_0x24155f[_0xccad('0x27')]({'plain':!![]});return _0x35e72b[_0xccad('0x6b')];});return db['OpenchannelQueue']['find']({'where':{'id':_0x24460c[_0xccad('0x47')]['id']}})['then'](function(_0x12afc3){return db[_0xccad('0x6c')][_0xccad('0x6d')](function(_0x56772c){return _0x12afc3[_0xccad('0x67')](_0x289e36,{'transaction':_0x56772c})[_0xccad('0x29')](function(){return BPromise[_0xccad('0x6e')](_0x4f3a5f,function(_0x13e9e0){return db['UserOpenchannelQueue']['findOrCreate']({'where':{'UserId':_0x13e9e0['id'],'OpenchannelQueueId':_0x24460c[_0xccad('0x47')]['id']},'transaction':_0x56772c});});})[_0xccad('0x29')](function(){_0x4f3a5f[_0xccad('0x6f')](function(_0x3b9d50){socket['emit'](_0xccad('0x70'),{'UserId':_0x3b9d50['id'],'OpenchannelQueueId':_0x12afc3['id']});});});});});}})[_0xccad('0x29')](respondWithStatusCode(_0x3ce213,null))[_0xccad('0x45')](handleError(_0x3ce213,null));};exports['removeTeams']=function(_0x2e9a24,_0x2688d0,_0x5d2258){return db['Team']['findAll']({'where':{'id':_0x2e9a24[_0xccad('0x34')][_0xccad('0x71')]},'attributes':['id'],'include':[{'model':db[_0xccad('0x5d')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2688d0,null))[_0xccad('0x29')](function(_0x3be6de){var _0x4b42e1=_[_0xccad('0x2e')](_0x3be6de,'id');var _0x8c377e=[];var _0x1242b5=[];var _0x180680=squel[_0xccad('0x72')]();_0x180680[_0xccad('0x73')]('tq.TeamId')['from']('team_has_openchannel_queues','tq')[_0xccad('0x74')](_0xccad('0x75'),'ut',_0xccad('0x76'))[_0xccad('0x3f')](_0xccad('0x77'),_0x2e9a24[_0xccad('0x47')]['id']);for(var _0x4fd92d=0x0;_0x4fd92d<_0x3be6de[_0xccad('0x39')];_0x4fd92d+=0x1){let _0x34144c=_0x3be6de[_0x4fd92d];for(var _0x4bba57=0x0;_0x4bba57<_0x34144c[_0xccad('0x6b')][_0xccad('0x39')];_0x4bba57+=0x1){let _0x57662b=_0x34144c[_0xccad('0x6b')][_0x4bba57];var _0x2c4d72=_0x180680['clone']();_0x2c4d72[_0xccad('0x3f')]('ut.UserId\x20=\x20?',_0x57662b['id']);_0x1242b5[_0xccad('0x78')](db[_0xccad('0x6c')][_0xccad('0x34')](_0x2c4d72['toString'](),{'type':db[_0xccad('0x6c')][_0xccad('0x79')][_0xccad('0x7a')]})[_0xccad('0x29')](function(_0x39ff67){if(_0x39ff67[_0xccad('0x39')]===0x1){return _0x57662b['id'];}else{var _0x1805b9=_[_0xccad('0x7b')](_['map'](_0x39ff67,_0xccad('0x7c')),function(_0x3213fd){return _[_0xccad('0x7d')](_0x4b42e1,_0x3213fd);});if(_0x1805b9){return _0x57662b['id'];}}}));}}return BPromise[_0xccad('0x7e')](_0x1242b5)[_0xccad('0x29')](function(_0x57039f){_0x8c377e=_(_0x8c377e)['union'](_0x57039f)['compact']()[_0xccad('0x7f')]();return db[_0xccad('0x2f')][_0xccad('0x4c')]({'where':{'id':_0x2e9a24[_0xccad('0x47')]['id']}})['then'](function(_0x2d30d3){return db['sequelize'][_0xccad('0x6d')](function(_0x34b5c2){return _0x2d30d3[_0xccad('0x80')](_0x2e9a24['query'][_0xccad('0x71')],{'transaction':_0x34b5c2})['then'](function(){if(!_[_0xccad('0x81')](_0x8c377e)){return _0x2d30d3['removeAgents'](_0x8c377e,{'transaction':_0x34b5c2});}})[_0xccad('0x29')](function(){_0x8c377e[_0xccad('0x6f')](function(_0x114748){socket['emit'](_0xccad('0x82'),{'UserId':_0x114748,'OpenchannelQueueId':_0x2d30d3['id']});});});});});});})['then'](respondWithStatusCode(_0x2688d0,null))[_0xccad('0x45')](handleError(_0x2688d0,null));};exports[_0xccad('0x83')]=function(_0x5a3641,_0x2b4380,_0x5c4b2e){return db[_0xccad('0x2f')][_0xccad('0x4c')]({'where':{'id':_0x5a3641['params']['id']}})[_0xccad('0x29')](handleEntityNotFound(_0x2b4380,null))['then'](function(_0x21b7f4){if(_0x21b7f4){return _0x21b7f4[_0xccad('0x83')](_0x5a3641[_0xccad('0x4e')][_0xccad('0x71')],_[_0xccad('0x84')](_0x5a3641[_0xccad('0x4e')],[_0xccad('0x71'),'id'])||{})['spread'](function(_0x492f5e){for(var _0x31f077=0x0;_0x31f077<_0x5a3641[_0xccad('0x4e')][_0xccad('0x71')]['length'];_0x31f077+=0x1){socket[_0xccad('0x85')]('userOpenchannelQueue:save',{'UserId':_0x5a3641[_0xccad('0x4e')][_0xccad('0x71')][_0x31f077],'OpenchannelQueueId':_0x5a3641[_0xccad('0x47')]['id']});}return _0x492f5e;});}})[_0xccad('0x29')](respondWithResult(_0x2b4380,null))[_0xccad('0x45')](handleError(_0x2b4380,null));};exports['removeAgents']=function(_0x10dda3,_0x3cf361,_0x2753f5){return db[_0xccad('0x2f')][_0xccad('0x4c')]({'where':{'id':_0x10dda3[_0xccad('0x47')]['id']}})[_0xccad('0x29')](handleEntityNotFound(_0x3cf361,null))['then'](function(_0x5368c4){if(_0x5368c4){return _0x5368c4['removeAgents'](_0x10dda3[_0xccad('0x34')]['ids'])['then'](function(){if(_[_0xccad('0x86')](_0x10dda3[_0xccad('0x34')][_0xccad('0x71')])){for(var _0x315b3a=0x0;_0x315b3a<_0x10dda3[_0xccad('0x34')]['ids']['length'];_0x315b3a+=0x1){socket[_0xccad('0x85')](_0xccad('0x82'),{'UserId':Number(_0x10dda3[_0xccad('0x34')]['ids'][_0x315b3a]),'OpenchannelQueueId':Number(_0x10dda3[_0xccad('0x47')]['id'])});}}else{socket[_0xccad('0x85')]('userOpenchannelQueue:remove',{'UserId':Number(_0x10dda3[_0xccad('0x34')]['ids']),'OpenchannelQueueId':Number(_0x10dda3[_0xccad('0x47')]['id'])});}});}})['then'](respondWithStatusCode(_0x3cf361,null))[_0xccad('0x45')](handleError(_0x3cf361,null));};exports[_0xccad('0x87')]=function(_0xe692dd,_0x49bb32,_0x3cb81e){var _0x1a25c1={};var _0x49bd91={};var _0x345d3a;var _0x5401d5;return db[_0xccad('0x2f')][_0xccad('0x5a')]({'where':{'id':_0xe692dd[_0xccad('0x47')]['id']}})[_0xccad('0x29')](handleEntityNotFound(_0x49bb32,null))[_0xccad('0x29')](function(_0x118248){if(_0x118248){_0x345d3a=_0x118248;_0x49bd91[_0xccad('0x33')]=_[_0xccad('0x35')](db['User']['rawAttributes']);_0x49bd91[_0xccad('0x34')]=_[_0xccad('0x35')](_0xe692dd[_0xccad('0x34')]);_0x49bd91['filters']=_[_0xccad('0x49')](_0x49bd91[_0xccad('0x33')],_0x49bd91[_0xccad('0x34')]);_0x1a25c1['attributes']=_[_0xccad('0x49')](_0x49bd91[_0xccad('0x33')],qs['fields'](_0xe692dd['query'][_0xccad('0x38')]));_0x1a25c1[_0xccad('0x37')]=_0x1a25c1['attributes'][_0xccad('0x39')]?_0x1a25c1[_0xccad('0x37')]:_0x49bd91[_0xccad('0x33')];_0x1a25c1['order']=qs[_0xccad('0x3c')](_0xe692dd['query'][_0xccad('0x3c')]);_0x1a25c1[_0xccad('0x3f')]=qs[_0xccad('0x36')](_[_0xccad('0x3d')](_0xe692dd[_0xccad('0x34')],_0x49bd91['filters']));if(_0xe692dd[_0xccad('0x34')][_0xccad('0x3e')]){_0x1a25c1['where']=_[_0xccad('0x40')](_0x1a25c1[_0xccad('0x3f')],{'$or':_[_0xccad('0x2e')](_0x1a25c1[_0xccad('0x37')],function(_0x7ed77e){var _0x5f4c42={};_0x5f4c42[_0x7ed77e]={'$like':'%'+_0xe692dd[_0xccad('0x34')][_0xccad('0x3e')]+'%'};return _0x5f4c42;})});}_0x1a25c1=_[_0xccad('0x40')]({},_0x1a25c1,_0xe692dd['options']);return _0x345d3a[_0xccad('0x87')](_0x1a25c1);}})[_0xccad('0x29')](function(_0x3fb8b5){if(_0x3fb8b5){_0x5401d5=_0x3fb8b5['length'];if(!_0xe692dd['query'][_0xccad('0x5c')](_0xccad('0x3a'))){_0x1a25c1[_0xccad('0x21')]=qs[_0xccad('0x21')](_0xe692dd['query']['limit']);_0x1a25c1['offset']=qs[_0xccad('0x20')](_0xe692dd[_0xccad('0x34')][_0xccad('0x20')]);}return _0x345d3a['getAgents'](_0x1a25c1);}})[_0xccad('0x29')](function(_0x43dce3){if(_0x43dce3){return _0x43dce3?{'count':_0x5401d5,'rows':_0x43dce3}:null;}})[_0xccad('0x29')](respondWithResult(_0x49bb32,null))[_0xccad('0x45')](handleError(_0x49bb32,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index e4b66cc..a73f6d8 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 _0xaaf7=['../../mysqldb','OpenchannelQueue','setMaxListeners','update','remove','emit','exports','events'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0xaaf7,0xcf));var _0x7aaf=function(_0x341053,_0x310529){_0x341053=_0x341053-0x0;var _0x1a6af4=_0xaaf7[_0x341053];return _0x1a6af4;};'use strict';var EventEmitter=require(_0x7aaf('0x0'));var OpenchannelQueue=require(_0x7aaf('0x1'))['db'][_0x7aaf('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x7aaf('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7aaf('0x4'),'afterDestroy':_0x7aaf('0x5')};function emitEvent(_0x240dfe){return function(_0x13dfb3,_0x3b38a8,_0x3faa50){OpenchannelQueueEvents['emit'](_0x240dfe+':'+_0x13dfb3['id'],_0x13dfb3);OpenchannelQueueEvents[_0x7aaf('0x6')](_0x240dfe,_0x13dfb3);_0x3faa50(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module[_0x7aaf('0x7')]=OpenchannelQueueEvents; \ No newline at end of file +var _0x8861=['update','remove','emit','hasOwnProperty','exports','../../mysqldb','setMaxListeners'];(function(_0x557762,_0x2b21f0){var _0x53f571=function(_0x3e5f55){while(--_0x3e5f55){_0x557762['push'](_0x557762['shift']());}};_0x53f571(++_0x2b21f0);}(_0x8861,0x1b0));var _0x1886=function(_0x582881,_0x56f11d){_0x582881=_0x582881-0x0;var _0x346581=_0x8861[_0x582881];return _0x346581;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0x1886('0x0'))['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x1886('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1886('0x2'),'afterDestroy':_0x1886('0x3')};function emitEvent(_0x3ded86){return function(_0x1f3f66,_0x1afc72,_0x12232a){OpenchannelQueueEvents[_0x1886('0x4')](_0x3ded86+':'+_0x1f3f66['id'],_0x1f3f66);OpenchannelQueueEvents[_0x1886('0x4')](_0x3ded86,_0x1f3f66);_0x12232a(null);};}for(var e in events){if(events[_0x1886('0x5')](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module[_0x1886('0x6')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 1100f1c..f059285 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 _0xa7fa=['exports','openchannel_queues','lodash','api','moment','bluebird','request-promise','rimraf','../../config/environment','./openchannelQueue.attributes'];(function(_0xf973b7,_0x46699f){var _0x499087=function(_0x45b42f){while(--_0x45b42f){_0xf973b7['push'](_0xf973b7['shift']());}};_0x499087(++_0x46699f);}(_0xa7fa,0xfc));var _0xaa7f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa7fa[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xaa7f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xaa7f('0x1'));var moment=require(_0xaa7f('0x2'));var BPromise=require(_0xaa7f('0x3'));var rp=require(_0xaa7f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaa7f('0x5'));var config=require(_0xaa7f('0x6'));var attributes=require(_0xaa7f('0x7'));module[_0xaa7f('0x8')]=function(_0x48e98f,_0xf79d63){return _0x48e98f['define']('OpenchannelQueue',attributes,{'tableName':_0xaa7f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x35b7=['path','../../config/environment','./openchannelQueue.attributes','define','OpenchannelQueue','lodash','moment','request-promise'];(function(_0x40f974,_0x53b981){var _0x4b1f96=function(_0x83bf36){while(--_0x83bf36){_0x40f974['push'](_0x40f974['shift']());}};_0x4b1f96(++_0x53b981);}(_0x35b7,0x185));var _0x735b=function(_0x31a371,_0x50828e){_0x31a371=_0x31a371-0x0;var _0x2a5bd6=_0x35b7[_0x31a371];return _0x2a5bd6;};'use strict';var _=require(_0x735b('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x735b('0x1'));var BPromise=require('bluebird');var rp=require(_0x735b('0x2'));var fs=require('fs');var path=require(_0x735b('0x3'));var rimraf=require('rimraf');var config=require(_0x735b('0x4'));var attributes=require(_0x735b('0x5'));module['exports']=function(_0x887f47,_0x2986f1){return _0x887f47[_0x735b('0x6')](_0x735b('0x7'),attributes,{'tableName':'openchannel_queues','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 f0d05a2..00786cc 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 _0xb271=['redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','request','then','OpenchannelQueue,\x20%s,\x20%s','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','findAll','options','raw','where','attributes','limit','include','map','model','GetOpenchannelQueue','find','info','ShowOpenchannelQueue','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x2c27f0,_0x51fc6f){var _0x142df6=function(_0x24e70f){while(--_0x24e70f){_0x2c27f0['push'](_0x2c27f0['shift']());}};_0x142df6(++_0x51fc6f);}(_0xb271,0x144));var _0x1b27=function(_0x1a0755,_0x47d93a){_0x1a0755=_0x1a0755-0x0;var _0x2e3a42=_0xb271[_0x1a0755];return _0x2e3a42;};'use strict';var _=require(_0x1b27('0x0'));var util=require('util');var moment=require(_0x1b27('0x1'));var BPromise=require(_0x1b27('0x2'));var rs=require(_0x1b27('0x3'));var fs=require('fs');var Redis=require(_0x1b27('0x4'));var db=require(_0x1b27('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1b27('0x6'))(_0x1b27('0x7'));var config=require(_0x1b27('0x8'));var jayson=require(_0x1b27('0x9'));var client=jayson[_0x1b27('0xa')][_0x1b27('0xb')]({'port':0x232a});config[_0x1b27('0xc')]=_[_0x1b27('0xd')](config[_0x1b27('0xc')],{'host':_0x1b27('0xe'),'port':0x18eb});var socket=require(_0x1b27('0xf'))(new Redis(config['redis']));require(_0x1b27('0x10'))['register'](socket);function respondWithRpcPromise(_0x23fdda,_0x27c4a9,_0x307741){return new BPromise(function(_0x474441,_0x4b88a9){return client[_0x1b27('0x11')](_0x23fdda,_0x307741)[_0x1b27('0x12')](function(_0x531e33){logger['info'](_0x1b27('0x13'),_0x27c4a9,'request\x20sent');logger[_0x1b27('0x14')](_0x1b27('0x15'),_0x27c4a9,'request\x20sent',JSON[_0x1b27('0x16')](_0x531e33));if(_0x531e33['error']){if(_0x531e33[_0x1b27('0x17')][_0x1b27('0x18')]===0x1f4){logger[_0x1b27('0x17')](_0x1b27('0x13'),_0x27c4a9,_0x531e33[_0x1b27('0x17')][_0x1b27('0x19')]);return _0x4b88a9(_0x531e33['error'][_0x1b27('0x19')]);}logger[_0x1b27('0x17')](_0x1b27('0x13'),_0x27c4a9,_0x531e33['error'][_0x1b27('0x19')]);return _0x474441(_0x531e33[_0x1b27('0x17')][_0x1b27('0x19')]);}else{logger['info'](_0x1b27('0x13'),_0x27c4a9,_0x1b27('0x1a'));_0x474441(_0x531e33[_0x1b27('0x1b')][_0x1b27('0x19')]);}})[_0x1b27('0x1c')](function(_0x1eccba){logger['error'](_0x1b27('0x13'),_0x27c4a9,_0x1eccba);_0x4b88a9(_0x1eccba);});});}exports['GetOpenchannelQueue']=function(_0x5638ef){var _0x44e214=this;return new Promise(function(_0x500f83,_0xb8f1c9){return db['OpenchannelQueue'][_0x1b27('0x1d')]({'raw':_0x5638ef[_0x1b27('0x1e')]?_0x5638ef[_0x1b27('0x1e')][_0x1b27('0x1f')]===undefined?!![]:![]:!![],'where':_0x5638ef[_0x1b27('0x1e')]?_0x5638ef[_0x1b27('0x1e')][_0x1b27('0x20')]||null:null,'attributes':_0x5638ef['options']?_0x5638ef[_0x1b27('0x1e')][_0x1b27('0x21')]||null:null,'limit':_0x5638ef[_0x1b27('0x1e')]?_0x5638ef[_0x1b27('0x1e')][_0x1b27('0x22')]||null:null,'include':_0x5638ef['options']?_0x5638ef['options'][_0x1b27('0x23')]?_[_0x1b27('0x24')](_0x5638ef[_0x1b27('0x1e')][_0x1b27('0x23')],function(_0x456484){return{'model':db[_0x456484[_0x1b27('0x25')]],'as':_0x456484['as'],'attributes':_0x456484['attributes'],'include':_0x456484['include']?_[_0x1b27('0x24')](_0x456484[_0x1b27('0x23')],function(_0x4f1f8f){return{'model':db[_0x4f1f8f[_0x1b27('0x25')]],'as':_0x4f1f8f['as'],'attributes':_0x4f1f8f[_0x1b27('0x21')],'include':_0x4f1f8f[_0x1b27('0x23')]?_[_0x1b27('0x24')](_0x4f1f8f[_0x1b27('0x23')],function(_0x1da855){return{'model':db[_0x1da855['model']],'as':_0x1da855['as'],'attributes':_0x1da855[_0x1b27('0x21')]};}):[]};}):[]};}):[]:[]})[_0x1b27('0x12')](function(_0x33bc34){logger['info'](_0x1b27('0x26'),_0x5638ef);logger[_0x1b27('0x14')](_0x1b27('0x26'),_0x5638ef,JSON['stringify'](_0x33bc34));_0x500f83(_0x33bc34);})[_0x1b27('0x1c')](function(_0x361c5d){logger[_0x1b27('0x17')](_0x1b27('0x26'),_0x361c5d[_0x1b27('0x19')],_0x5638ef);_0xb8f1c9(_0x44e214[_0x1b27('0x17')](0x1f4,_0x361c5d[_0x1b27('0x19')]));});});};exports['ShowOpenchannelQueue']=function(_0x5b1aed){var _0x7277d0=this;return new Promise(function(_0x3c4f8e,_0x120d84){return db['OpenchannelQueue'][_0x1b27('0x27')]({'raw':_0x5b1aed[_0x1b27('0x1e')]?_0x5b1aed[_0x1b27('0x1e')][_0x1b27('0x1f')]===undefined?!![]:![]:!![],'where':_0x5b1aed[_0x1b27('0x1e')]?_0x5b1aed[_0x1b27('0x1e')]['where']||null:null,'attributes':_0x5b1aed[_0x1b27('0x1e')]?_0x5b1aed[_0x1b27('0x1e')][_0x1b27('0x21')]||null:null,'include':_0x5b1aed[_0x1b27('0x1e')]?_0x5b1aed[_0x1b27('0x1e')][_0x1b27('0x23')]?_[_0x1b27('0x24')](_0x5b1aed[_0x1b27('0x1e')]['include'],function(_0xff6fbf){return{'model':db[_0xff6fbf['model']],'as':_0xff6fbf['as'],'attributes':_0xff6fbf['attributes'],'include':_0xff6fbf[_0x1b27('0x23')]?_[_0x1b27('0x24')](_0xff6fbf[_0x1b27('0x23')],function(_0x558d6e){return{'model':db[_0x558d6e[_0x1b27('0x25')]],'as':_0x558d6e['as'],'attributes':_0x558d6e[_0x1b27('0x21')],'include':_0x558d6e[_0x1b27('0x23')]?_[_0x1b27('0x24')](_0x558d6e[_0x1b27('0x23')],function(_0x3bf779){return{'model':db[_0x3bf779[_0x1b27('0x25')]],'as':_0x3bf779['as'],'attributes':_0x3bf779[_0x1b27('0x21')]};}):[]};}):[]};}):[]:[]})[_0x1b27('0x12')](function(_0x125780){logger[_0x1b27('0x28')](_0x1b27('0x29'),_0x5b1aed);logger[_0x1b27('0x14')](_0x1b27('0x29'),_0x5b1aed,JSON['stringify'](_0x125780));_0x3c4f8e(_0x125780);})['catch'](function(_0x542b1b){logger[_0x1b27('0x17')](_0x1b27('0x29'),_0x542b1b['message'],_0x5b1aed);_0x120d84(_0x7277d0[_0x1b27('0x17')](0x1f4,_0x542b1b['message']));});});}; \ No newline at end of file +var _0xf4ce=['info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','GetOpenchannelQueue','findAll','options','raw','attributes','limit','include','map','model','then','ShowOpenchannelQueue','find','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','redis','defaults','localhost','socket.io-emitter','request'];(function(_0x317bf3,_0x1c2db5){var _0x23fb5c=function(_0x1c47b8){while(--_0x1c47b8){_0x317bf3['push'](_0x317bf3['shift']());}};_0x23fb5c(++_0x1c2db5);}(_0xf4ce,0x146));var _0xef4c=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xf4ce[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0xef4c('0x0'));var util=require(_0xef4c('0x1'));var moment=require(_0xef4c('0x2'));var BPromise=require(_0xef4c('0x3'));var rs=require(_0xef4c('0x4'));var fs=require('fs');var Redis=require(_0xef4c('0x5'));var db=require(_0xef4c('0x6'))['db'];var utils=require(_0xef4c('0x7'));var logger=require(_0xef4c('0x8'))(_0xef4c('0x9'));var config=require(_0xef4c('0xa'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0xef4c('0xb')]=_[_0xef4c('0xc')](config[_0xef4c('0xb')],{'host':_0xef4c('0xd'),'port':0x18eb});var socket=require(_0xef4c('0xe'))(new Redis(config[_0xef4c('0xb')]));require('./openchannelQueue.socket')['register'](socket);function respondWithRpcPromise(_0x197ab8,_0x47a299,_0x22dd12){return new BPromise(function(_0x16f78a,_0x5a8ddc){return client[_0xef4c('0xf')](_0x197ab8,_0x22dd12)['then'](function(_0x5eb912){logger[_0xef4c('0x10')](_0xef4c('0x11'),_0x47a299,_0xef4c('0x12'));logger[_0xef4c('0x13')]('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x47a299,_0xef4c('0x12'),JSON[_0xef4c('0x14')](_0x5eb912));if(_0x5eb912[_0xef4c('0x15')]){if(_0x5eb912[_0xef4c('0x15')]['code']===0x1f4){logger[_0xef4c('0x15')](_0xef4c('0x11'),_0x47a299,_0x5eb912['error'][_0xef4c('0x16')]);return _0x5a8ddc(_0x5eb912[_0xef4c('0x15')][_0xef4c('0x16')]);}logger['error'](_0xef4c('0x11'),_0x47a299,_0x5eb912[_0xef4c('0x15')][_0xef4c('0x16')]);return _0x16f78a(_0x5eb912['error'][_0xef4c('0x16')]);}else{logger[_0xef4c('0x10')](_0xef4c('0x11'),_0x47a299,_0xef4c('0x12'));_0x16f78a(_0x5eb912[_0xef4c('0x17')]['message']);}})[_0xef4c('0x18')](function(_0x1602cb){logger['error'](_0xef4c('0x11'),_0x47a299,_0x1602cb);_0x5a8ddc(_0x1602cb);});});}exports[_0xef4c('0x19')]=function(_0x4dadc8){var _0x1577c1=this;return new Promise(function(_0x21fa15,_0x22f2ed){return db['OpenchannelQueue'][_0xef4c('0x1a')]({'raw':_0x4dadc8[_0xef4c('0x1b')]?_0x4dadc8[_0xef4c('0x1b')][_0xef4c('0x1c')]===undefined?!![]:![]:!![],'where':_0x4dadc8[_0xef4c('0x1b')]?_0x4dadc8[_0xef4c('0x1b')]['where']||null:null,'attributes':_0x4dadc8[_0xef4c('0x1b')]?_0x4dadc8[_0xef4c('0x1b')][_0xef4c('0x1d')]||null:null,'limit':_0x4dadc8[_0xef4c('0x1b')]?_0x4dadc8[_0xef4c('0x1b')][_0xef4c('0x1e')]||null:null,'include':_0x4dadc8['options']?_0x4dadc8[_0xef4c('0x1b')][_0xef4c('0x1f')]?_[_0xef4c('0x20')](_0x4dadc8['options'][_0xef4c('0x1f')],function(_0x253eb3){return{'model':db[_0x253eb3[_0xef4c('0x21')]],'as':_0x253eb3['as'],'attributes':_0x253eb3[_0xef4c('0x1d')],'include':_0x253eb3[_0xef4c('0x1f')]?_[_0xef4c('0x20')](_0x253eb3[_0xef4c('0x1f')],function(_0x171ba1){return{'model':db[_0x171ba1[_0xef4c('0x21')]],'as':_0x171ba1['as'],'attributes':_0x171ba1[_0xef4c('0x1d')],'include':_0x171ba1[_0xef4c('0x1f')]?_['map'](_0x171ba1['include'],function(_0x4e8b35){return{'model':db[_0x4e8b35['model']],'as':_0x4e8b35['as'],'attributes':_0x4e8b35[_0xef4c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xef4c('0x22')](function(_0x4a635a){logger[_0xef4c('0x10')](_0xef4c('0x19'),_0x4dadc8);logger[_0xef4c('0x13')]('GetOpenchannelQueue',_0x4dadc8,JSON['stringify'](_0x4a635a));_0x21fa15(_0x4a635a);})[_0xef4c('0x18')](function(_0x56bb90){logger['error'](_0xef4c('0x19'),_0x56bb90['message'],_0x4dadc8);_0x22f2ed(_0x1577c1['error'](0x1f4,_0x56bb90[_0xef4c('0x16')]));});});};exports[_0xef4c('0x23')]=function(_0x17abbf){var _0x1d128c=this;return new Promise(function(_0x30b43d,_0x219428){return db['OpenchannelQueue'][_0xef4c('0x24')]({'raw':_0x17abbf[_0xef4c('0x1b')]?_0x17abbf[_0xef4c('0x1b')][_0xef4c('0x1c')]===undefined?!![]:![]:!![],'where':_0x17abbf[_0xef4c('0x1b')]?_0x17abbf[_0xef4c('0x1b')][_0xef4c('0x25')]||null:null,'attributes':_0x17abbf[_0xef4c('0x1b')]?_0x17abbf[_0xef4c('0x1b')][_0xef4c('0x1d')]||null:null,'include':_0x17abbf[_0xef4c('0x1b')]?_0x17abbf[_0xef4c('0x1b')][_0xef4c('0x1f')]?_[_0xef4c('0x20')](_0x17abbf[_0xef4c('0x1b')][_0xef4c('0x1f')],function(_0x408deb){return{'model':db[_0x408deb['model']],'as':_0x408deb['as'],'attributes':_0x408deb[_0xef4c('0x1d')],'include':_0x408deb[_0xef4c('0x1f')]?_[_0xef4c('0x20')](_0x408deb[_0xef4c('0x1f')],function(_0x323d00){return{'model':db[_0x323d00['model']],'as':_0x323d00['as'],'attributes':_0x323d00[_0xef4c('0x1d')],'include':_0x323d00[_0xef4c('0x1f')]?_[_0xef4c('0x20')](_0x323d00[_0xef4c('0x1f')],function(_0x364d7d){return{'model':db[_0x364d7d[_0xef4c('0x21')]],'as':_0x364d7d['as'],'attributes':_0x364d7d[_0xef4c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xef4c('0x22')](function(_0x40bb34){logger['info'](_0xef4c('0x23'),_0x17abbf);logger[_0xef4c('0x13')](_0xef4c('0x23'),_0x17abbf,JSON['stringify'](_0x40bb34));_0x30b43d(_0x40bb34);})[_0xef4c('0x18')](function(_0x55fe25){logger[_0xef4c('0x15')]('ShowOpenchannelQueue',_0x55fe25[_0xef4c('0x16')],_0x17abbf);_0x219428(_0x1d128c[_0xef4c('0x15')](0x1f4,_0x55fe25[_0xef4c('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 6644b89..d27446d 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 _0xddcf=['length','openchannelQueue:','./openchannelQueue.events','remove','update','emit','removeListener','register'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0xddcf,0x12a));var _0xfddc=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xddcf[_0x59ee6f];return _0x4c0979;};'use strict';var OpenchannelQueueEvents=require(_0xfddc('0x0'));var events=['save',_0xfddc('0x1'),_0xfddc('0x2')];function createListener(_0xad090e,_0xea6bcf){return function(_0x339d88){_0xea6bcf[_0xfddc('0x3')](_0xad090e,_0x339d88);};}function removeListener(_0x30c7d9,_0x175f7e){return function(){OpenchannelQueueEvents[_0xfddc('0x4')](_0x30c7d9,_0x175f7e);};}exports[_0xfddc('0x5')]=function(_0x169541){for(var _0x3fc6d3=0x0,_0x1df83a=events[_0xfddc('0x6')];_0x3fc6d3<_0x1df83a;_0x3fc6d3++){var _0xdaa60f=events[_0x3fc6d3];var _0x4ade9d=createListener(_0xfddc('0x7')+_0xdaa60f,_0x169541);OpenchannelQueueEvents['on'](_0xdaa60f,_0x4ade9d);}}; \ No newline at end of file +var _0x1403=['./openchannelQueue.events','save','remove','update','emit'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x1403,0xcd));var _0x3140=function(_0x5d0186,_0x27d279){_0x5d0186=_0x5d0186-0x0;var _0x48ece9=_0x1403[_0x5d0186];return _0x48ece9;};'use strict';var OpenchannelQueueEvents=require(_0x3140('0x0'));var events=[_0x3140('0x1'),_0x3140('0x2'),_0x3140('0x3')];function createListener(_0x3cafc7,_0x155bbd){return function(_0x48e7ff){_0x155bbd[_0x3140('0x4')](_0x3cafc7,_0x48e7ff);};}function removeListener(_0x456c28,_0x436f8a){return function(){OpenchannelQueueEvents['removeListener'](_0x456c28,_0x436f8a);};}exports['register']=function(_0x2ff5fe){for(var _0x4c5b04=0x0,_0x59b53c=events['length'];_0x4c5b04<_0x59b53c;_0x4c5b04++){var _0x1d47dc=events[_0x4c5b04];var _0x4e9070=createListener('openchannelQueue:'+_0x1d47dc,_0x2ff5fe);OpenchannelQueueEvents['on'](_0x1d47dc,_0x4e9070);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index b672136..af3a13f 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 _0x0a66=['./openchannelQueueReport.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports','multer','path','express','Router','../../components/interaction/service'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0x0a66,0x83));var _0x60a6=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x0a66[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x60a6('0x0'));var util=require('util');var path=require(_0x60a6('0x1'));var timeout=require('connect-timeout');var express=require(_0x60a6('0x2'));var router=express[_0x60a6('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x60a6('0x4'));var config=require('../../config/environment');var controller=require(_0x60a6('0x5'));router[_0x60a6('0x6')]('/',auth[_0x60a6('0x7')](),controller[_0x60a6('0x8')]);router[_0x60a6('0x6')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0x60a6('0x9'),auth[_0x60a6('0x7')](),controller[_0x60a6('0xa')]);router[_0x60a6('0xb')]('/',auth[_0x60a6('0x7')](),controller[_0x60a6('0xc')]);router[_0x60a6('0xd')](_0x60a6('0x9'),auth[_0x60a6('0x7')](),controller[_0x60a6('0xe')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x60a6('0xf')]);module[_0x60a6('0x10')]=router; \ No newline at end of file +var _0x8eb9=['delete','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','index','/:id','show','create','put'];(function(_0x1f9bc0,_0x1edaaf){var _0x40de7a=function(_0xa6ad68){while(--_0xa6ad68){_0x1f9bc0['push'](_0x1f9bc0['shift']());}};_0x40de7a(++_0x1edaaf);}(_0x8eb9,0x145));var _0x98eb=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x8eb9[_0x297fd3];return _0x2af381;};'use strict';var multer=require('multer');var util=require(_0x98eb('0x0'));var path=require(_0x98eb('0x1'));var timeout=require(_0x98eb('0x2'));var express=require(_0x98eb('0x3'));var router=express[_0x98eb('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x98eb('0x5'));var config=require(_0x98eb('0x6'));var controller=require(_0x98eb('0x7'));router[_0x98eb('0x8')]('/',auth[_0x98eb('0x9')](),controller[_0x98eb('0xa')]);router[_0x98eb('0x8')]('/describe',auth[_0x98eb('0x9')](),controller['describe']);router[_0x98eb('0x8')](_0x98eb('0xb'),auth[_0x98eb('0x9')](),controller[_0x98eb('0xc')]);router['post']('/',auth[_0x98eb('0x9')](),controller[_0x98eb('0xd')]);router[_0x98eb('0xe')](_0x98eb('0xb'),auth[_0x98eb('0x9')](),controller['update']);router[_0x98eb('0xf')](_0x98eb('0xb'),auth[_0x98eb('0x9')](),controller['destroy']);module[_0x98eb('0x10')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 881875b..1bab33c 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 _0x9411=['exports','STRING','DATE'];(function(_0x3476bb,_0x39ec58){var _0x12151b=function(_0x585dcf){while(--_0x585dcf){_0x3476bb['push'](_0x3476bb['shift']());}};_0x12151b(++_0x39ec58);}(_0x9411,0x1cb));var _0x1941=function(_0x1baf45,_0x34143f){_0x1baf45=_0x1baf45-0x0;var _0x3f961a=_0x9411[_0x1baf45];return _0x3f961a;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1941('0x0')]={'uniqueid':{'type':Sequelize[_0x1941('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x1941('0x1')]},'joinAt':{'type':Sequelize[_0x1941('0x2')]},'leaveAt':{'type':Sequelize[_0x1941('0x2')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x1941('0x2')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8259=['DATE','moment','sequelize','exports','STRING'];(function(_0x4a0d35,_0xa037ce){var _0x38cb95=function(_0x3598b2){while(--_0x3598b2){_0x4a0d35['push'](_0x4a0d35['shift']());}};_0x38cb95(++_0xa037ce);}(_0x8259,0xdd));var _0x9825=function(_0x41b1fc,_0x3af52e){_0x41b1fc=_0x41b1fc-0x0;var _0x312398=_0x8259[_0x41b1fc];return _0x312398;};'use strict';var moment=require(_0x9825('0x0'));var Sequelize=require(_0x9825('0x1'));module[_0x9825('0x2')]={'uniqueid':{'type':Sequelize[_0x9825('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x9825('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x9825('0x4')]},'acceptAt':{'type':Sequelize[_0x9825('0x4')]},'exitAt':{'type':Sequelize[_0x9825('0x4')]},'reason':{'type':Sequelize[_0x9825('0x3')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 0e35056..db8daec 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 _0x2ace=['attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','include','findAll','rows','catch','params','length','includeAll','create','update','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','end','error','name','send','index','map','OpenchannelQueueReport','rawAttributes','fieldName','key','model','query','keys','filters'];(function(_0x4f210d,_0x525c73){var _0x4b4702=function(_0x2703db){while(--_0x2703db){_0x4f210d['push'](_0x4f210d['shift']());}};_0x4b4702(++_0x525c73);}(_0x2ace,0x17e));var _0xe2ac=function(_0x20d73e,_0x39f9ec){_0x20d73e=_0x20d73e-0x0;var _0x52e84b=_0x2ace[_0x20d73e];return _0x52e84b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xe2ac('0x0'));var rimraf=require(_0xe2ac('0x1'));var zipdir=require(_0xe2ac('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe2ac('0x3'));var moment=require(_0xe2ac('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe2ac('0x5'));var util=require(_0xe2ac('0x6'));var path=require(_0xe2ac('0x7'));var sox=require(_0xe2ac('0x8'));var csv=require(_0xe2ac('0x9'));var ejs=require(_0xe2ac('0xa'));var fs=require('fs');var _=require(_0xe2ac('0xb'));var squel=require(_0xe2ac('0xc'));var crypto=require(_0xe2ac('0xd'));var jsforce=require(_0xe2ac('0xe'));var deskjs=require(_0xe2ac('0xf'));var toCsv=require(_0xe2ac('0x9'));var querystring=require(_0xe2ac('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe2ac('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe2ac('0x12'));var hardwareService=require(_0xe2ac('0x13'));var logger=require('../../config/logger')(_0xe2ac('0x14'));var utils=require(_0xe2ac('0x15'));var config=require(_0xe2ac('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x37347b,_0x41e1b0){_0x41e1b0=_0x41e1b0||0xcc;return function(_0x199773){if(_0x199773){return _0x37347b[_0xe2ac('0x17')](_0x41e1b0);}return _0x37347b[_0xe2ac('0x18')](_0x41e1b0)['end']();};}function respondWithResult(_0x76dab9,_0x5c3425){_0x5c3425=_0x5c3425||0xc8;return function(_0x4404d7){if(_0x4404d7){return _0x76dab9[_0xe2ac('0x18')](_0x5c3425)[_0xe2ac('0x19')](_0x4404d7);}};}function respondWithFilteredResult(_0x290584,_0x3bec11){return function(_0xbddfba){if(_0xbddfba){var _0x445bca=_0xbddfba[_0xe2ac('0x1a')],_0x2f3caf=_0x3bec11[_0xe2ac('0x1b')],_0x170693=_0x3bec11['offset']+_0x3bec11[_0xe2ac('0x1c')],_0x4e1851;if(_0x170693>=_0x445bca){_0x170693=_0x445bca;_0x4e1851=0xc8;}else{_0x4e1851=0xce;}_0x290584[_0xe2ac('0x18')](_0x4e1851);return _0x290584[_0xe2ac('0x1d')](_0xe2ac('0x1e'),_0x2f3caf+'-'+_0x170693+'/'+_0x445bca)['json'](_0xbddfba);}return null;};}function patchUpdates(_0x5095dd){return function(_0x5bafe4){try{jsonpatch[_0xe2ac('0x1f')](_0x5bafe4,_0x5095dd,!![]);}catch(_0x190983){return BPromise[_0xe2ac('0x20')](_0x190983);}return _0x5bafe4[_0xe2ac('0x21')]();};}function saveUpdates(_0x437195,_0x279a90){return function(_0x54993e){if(_0x54993e){return _0x54993e['update'](_0x437195)[_0xe2ac('0x22')](function(_0x5cc189){return _0x5cc189;});}return null;};}function removeEntity(_0x1b12a1,_0x16dacc){return function(_0x2083b3){if(_0x2083b3){return _0x2083b3[_0xe2ac('0x23')]()[_0xe2ac('0x22')](function(){_0x1b12a1[_0xe2ac('0x18')](0xcc)[_0xe2ac('0x24')]();});}};}function handleEntityNotFound(_0x20a59e,_0xbf5817){return function(_0x4e7597){if(!_0x4e7597){_0x20a59e['sendStatus'](0x194);}return _0x4e7597;};}function handleError(_0x2f6220,_0x4c9981){_0x4c9981=_0x4c9981||0x1f4;return function(_0x1eafd7){logger[_0xe2ac('0x25')](_0x1eafd7['stack']);if(_0x1eafd7[_0xe2ac('0x26')]){delete _0x1eafd7['name'];}_0x2f6220[_0xe2ac('0x18')](_0x4c9981)[_0xe2ac('0x27')](_0x1eafd7);};}exports[_0xe2ac('0x28')]=function(_0x557cb2,_0x2702cd){var _0x2caff4={},_0x57bb2b={},_0x57aa52={'count':0x0,'rows':[]};var _0x3201e8=_[_0xe2ac('0x29')](db[_0xe2ac('0x2a')][_0xe2ac('0x2b')],function(_0x486ee3){return{'name':_0x486ee3[_0xe2ac('0x2c')],'type':_0x486ee3['type'][_0xe2ac('0x2d')]};});_0x57bb2b[_0xe2ac('0x2e')]=_[_0xe2ac('0x29')](_0x3201e8,_0xe2ac('0x26'));_0x57bb2b[_0xe2ac('0x2f')]=_[_0xe2ac('0x30')](_0x557cb2['query']);_0x57bb2b[_0xe2ac('0x31')]=_['intersection'](_0x57bb2b['model'],_0x57bb2b['query']);_0x2caff4[_0xe2ac('0x32')]=_[_0xe2ac('0x33')](_0x57bb2b['model'],qs[_0xe2ac('0x34')](_0x557cb2[_0xe2ac('0x2f')]['fields']));_0x2caff4[_0xe2ac('0x32')]=_0x2caff4[_0xe2ac('0x32')]['length']?_0x2caff4['attributes']:_0x57bb2b[_0xe2ac('0x2e')];if(!_0x557cb2['query'][_0xe2ac('0x35')](_0xe2ac('0x36'))){_0x2caff4[_0xe2ac('0x1c')]=qs[_0xe2ac('0x1c')](_0x557cb2[_0xe2ac('0x2f')][_0xe2ac('0x1c')]);_0x2caff4[_0xe2ac('0x1b')]=qs[_0xe2ac('0x1b')](_0x557cb2[_0xe2ac('0x2f')]['offset']);}_0x2caff4[_0xe2ac('0x37')]=qs[_0xe2ac('0x38')](_0x557cb2[_0xe2ac('0x2f')][_0xe2ac('0x38')]);_0x2caff4[_0xe2ac('0x39')]=qs[_0xe2ac('0x31')](_['pick'](_0x557cb2[_0xe2ac('0x2f')],_0x57bb2b['filters']));if(_0x557cb2[_0xe2ac('0x2f')][_0xe2ac('0x3a')]){_0x2caff4[_0xe2ac('0x39')]=_[_0xe2ac('0x3b')](_0x2caff4['where'],{'$or':_[_0xe2ac('0x29')](_0x3201e8,function(_0x59a4d6){if(_0x59a4d6['type']!=='VIRTUAL'){var _0x5792b0={};_0x5792b0[_0x59a4d6[_0xe2ac('0x26')]]={'$like':'%'+_0x557cb2[_0xe2ac('0x2f')]['filter']+'%'};return _0x5792b0;}})});}_0x2caff4=_[_0xe2ac('0x3b')]({},_0x2caff4,_0x557cb2[_0xe2ac('0x3c')]);var _0x338ad7={'where':_0x2caff4[_0xe2ac('0x39')]};return db[_0xe2ac('0x2a')][_0xe2ac('0x1a')](_0x338ad7)[_0xe2ac('0x22')](function(_0x57770b){_0x57aa52[_0xe2ac('0x1a')]=_0x57770b;if(_0x557cb2['query']['includeAll']){_0x2caff4[_0xe2ac('0x3d')]=[{'all':!![]}];}return db[_0xe2ac('0x2a')][_0xe2ac('0x3e')](_0x2caff4);})[_0xe2ac('0x22')](function(_0x151b12){_0x57aa52[_0xe2ac('0x3f')]=_0x151b12;return _0x57aa52;})[_0xe2ac('0x22')](respondWithFilteredResult(_0x2702cd,_0x2caff4))[_0xe2ac('0x40')](handleError(_0x2702cd,null));};exports['show']=function(_0x4218c1,_0x261d93){var _0x434e7c={'raw':!![],'where':{'id':_0x4218c1[_0xe2ac('0x41')]['id']}},_0x42f248={};_0x42f248['model']=_[_0xe2ac('0x30')](db[_0xe2ac('0x2a')]['rawAttributes']);_0x42f248['query']=_[_0xe2ac('0x30')](_0x4218c1[_0xe2ac('0x2f')]);_0x42f248[_0xe2ac('0x31')]=_[_0xe2ac('0x33')](_0x42f248[_0xe2ac('0x2e')],_0x42f248['query']);_0x434e7c[_0xe2ac('0x32')]=_['intersection'](_0x42f248[_0xe2ac('0x2e')],qs[_0xe2ac('0x34')](_0x4218c1[_0xe2ac('0x2f')]['fields']));_0x434e7c[_0xe2ac('0x32')]=_0x434e7c[_0xe2ac('0x32')][_0xe2ac('0x42')]?_0x434e7c[_0xe2ac('0x32')]:_0x42f248[_0xe2ac('0x2e')];if(_0x4218c1[_0xe2ac('0x2f')][_0xe2ac('0x43')]){_0x434e7c[_0xe2ac('0x3d')]=[{'all':!![]}];}_0x434e7c=_['merge']({},_0x434e7c,_0x4218c1[_0xe2ac('0x3c')]);return db['OpenchannelQueueReport']['find'](_0x434e7c)[_0xe2ac('0x22')](handleEntityNotFound(_0x261d93,null))[_0xe2ac('0x22')](respondWithResult(_0x261d93,null))[_0xe2ac('0x40')](handleError(_0x261d93,null));};exports[_0xe2ac('0x44')]=function(_0x43b7d7,_0x21e7e5){return db[_0xe2ac('0x2a')][_0xe2ac('0x44')](_0x43b7d7['body'],{})[_0xe2ac('0x22')](respondWithResult(_0x21e7e5,0xc9))['catch'](handleError(_0x21e7e5,null));};exports[_0xe2ac('0x45')]=function(_0x41af34,_0x3b1833){if(_0x41af34[_0xe2ac('0x46')]['id']){delete _0x41af34[_0xe2ac('0x46')]['id'];}return db[_0xe2ac('0x2a')]['find']({'where':{'id':_0x41af34['params']['id']}})['then'](handleEntityNotFound(_0x3b1833,null))[_0xe2ac('0x22')](saveUpdates(_0x41af34[_0xe2ac('0x46')],null))[_0xe2ac('0x22')](respondWithResult(_0x3b1833,null))[_0xe2ac('0x40')](handleError(_0x3b1833,null));};exports[_0xe2ac('0x23')]=function(_0x4c67bb,_0x47d301){return db[_0xe2ac('0x2a')]['find']({'where':{'id':_0x4c67bb['params']['id']}})[_0xe2ac('0x22')](handleEntityNotFound(_0x47d301,null))[_0xe2ac('0x22')](removeEntity(_0x47d301,null))[_0xe2ac('0x40')](handleError(_0x47d301,null));};exports[_0xe2ac('0x47')]=function(_0x1f8862,_0x389eb0){return db[_0xe2ac('0x2a')][_0xe2ac('0x47')]()[_0xe2ac('0x22')](respondWithResult(_0x389eb0,null))[_0xe2ac('0x40')](handleError(_0x389eb0,null));}; \ No newline at end of file +var _0x6739=['catch','show','params','create','body','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','ejs','lodash','squel','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','count','offset','limit','set','Content-Range','json','apply','reject','update','then','error','stack','name','send','map','OpenchannelQueueReport','type','model','keys','filters','intersection','attributes','fields','query','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','includeAll','include','findAll','rows'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0x6739,0xd3));var _0x9673=function(_0x2f0fc0,_0x25041a){_0x2f0fc0=_0x2f0fc0-0x0;var _0x3981ab=_0x6739[_0x2f0fc0];return _0x3981ab;};'use strict';var pdf=require(_0x9673('0x0'));var emlformat=require(_0x9673('0x1'));var rimraf=require(_0x9673('0x2'));var zipdir=require(_0x9673('0x3'));var jsonpatch=require(_0x9673('0x4'));var rp=require(_0x9673('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9673('0x6'));var util=require('util');var path=require(_0x9673('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9673('0x8'));var fs=require('fs');var _=require(_0x9673('0x9'));var squel=require(_0x9673('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9673('0xb'));var toCsv=require(_0x9673('0xc'));var querystring=require(_0x9673('0xd'));var Papa=require('papaparse');var Redis=require(_0x9673('0xe'));var authService=require(_0x9673('0xf'));var qs=require(_0x9673('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9673('0x11'));var logger=require(_0x9673('0x12'))(_0x9673('0x13'));var utils=require(_0x9673('0x14'));var config=require('../../config/environment');var db=require(_0x9673('0x15'))['db'];function respondWithStatusCode(_0x3cf3d1,_0x440bad){_0x440bad=_0x440bad||0xcc;return function(_0x4603fd){if(_0x4603fd){return _0x3cf3d1['sendStatus'](_0x440bad);}return _0x3cf3d1[_0x9673('0x16')](_0x440bad)[_0x9673('0x17')]();};}function respondWithResult(_0x5d9a57,_0xcf8543){_0xcf8543=_0xcf8543||0xc8;return function(_0x9ed07){if(_0x9ed07){return _0x5d9a57[_0x9673('0x16')](_0xcf8543)['json'](_0x9ed07);}};}function respondWithFilteredResult(_0x34cb76,_0x4dfd8f){return function(_0x36f012){if(_0x36f012){var _0x4a846a=_0x36f012[_0x9673('0x18')],_0x597757=_0x4dfd8f[_0x9673('0x19')],_0x20e5f2=_0x4dfd8f['offset']+_0x4dfd8f[_0x9673('0x1a')],_0x5484ea;if(_0x20e5f2>=_0x4a846a){_0x20e5f2=_0x4a846a;_0x5484ea=0xc8;}else{_0x5484ea=0xce;}_0x34cb76[_0x9673('0x16')](_0x5484ea);return _0x34cb76[_0x9673('0x1b')](_0x9673('0x1c'),_0x597757+'-'+_0x20e5f2+'/'+_0x4a846a)[_0x9673('0x1d')](_0x36f012);}return null;};}function patchUpdates(_0x281a1a){return function(_0x21a319){try{jsonpatch[_0x9673('0x1e')](_0x21a319,_0x281a1a,!![]);}catch(_0x43a196){return BPromise[_0x9673('0x1f')](_0x43a196);}return _0x21a319['save']();};}function saveUpdates(_0x1831ab,_0xbfc9d6){return function(_0x4c2e3d){if(_0x4c2e3d){return _0x4c2e3d[_0x9673('0x20')](_0x1831ab)[_0x9673('0x21')](function(_0x579729){return _0x579729;});}return null;};}function removeEntity(_0x24df84,_0xa8bc6d){return function(_0x3c1e8f){if(_0x3c1e8f){return _0x3c1e8f['destroy']()[_0x9673('0x21')](function(){_0x24df84[_0x9673('0x16')](0xcc)[_0x9673('0x17')]();});}};}function handleEntityNotFound(_0x132e5c,_0x5528d7){return function(_0x282b8d){if(!_0x282b8d){_0x132e5c['sendStatus'](0x194);}return _0x282b8d;};}function handleError(_0x18bf04,_0x404213){_0x404213=_0x404213||0x1f4;return function(_0x2b99a5){logger[_0x9673('0x22')](_0x2b99a5[_0x9673('0x23')]);if(_0x2b99a5[_0x9673('0x24')]){delete _0x2b99a5[_0x9673('0x24')];}_0x18bf04[_0x9673('0x16')](_0x404213)[_0x9673('0x25')](_0x2b99a5);};}exports['index']=function(_0x1896f6,_0x221b33){var _0x4d8cca={},_0x4c3dde={},_0x2de799={'count':0x0,'rows':[]};var _0x112791=_[_0x9673('0x26')](db[_0x9673('0x27')]['rawAttributes'],function(_0x1d76b0){return{'name':_0x1d76b0['fieldName'],'type':_0x1d76b0[_0x9673('0x28')]['key']};});_0x4c3dde[_0x9673('0x29')]=_[_0x9673('0x26')](_0x112791,_0x9673('0x24'));_0x4c3dde['query']=_[_0x9673('0x2a')](_0x1896f6['query']);_0x4c3dde[_0x9673('0x2b')]=_[_0x9673('0x2c')](_0x4c3dde['model'],_0x4c3dde['query']);_0x4d8cca[_0x9673('0x2d')]=_[_0x9673('0x2c')](_0x4c3dde[_0x9673('0x29')],qs[_0x9673('0x2e')](_0x1896f6[_0x9673('0x2f')][_0x9673('0x2e')]));_0x4d8cca[_0x9673('0x2d')]=_0x4d8cca['attributes'][_0x9673('0x30')]?_0x4d8cca[_0x9673('0x2d')]:_0x4c3dde[_0x9673('0x29')];if(!_0x1896f6[_0x9673('0x2f')][_0x9673('0x31')](_0x9673('0x32'))){_0x4d8cca[_0x9673('0x1a')]=qs[_0x9673('0x1a')](_0x1896f6[_0x9673('0x2f')][_0x9673('0x1a')]);_0x4d8cca['offset']=qs[_0x9673('0x19')](_0x1896f6['query']['offset']);}_0x4d8cca[_0x9673('0x33')]=qs[_0x9673('0x34')](_0x1896f6[_0x9673('0x2f')][_0x9673('0x34')]);_0x4d8cca['where']=qs[_0x9673('0x2b')](_[_0x9673('0x35')](_0x1896f6[_0x9673('0x2f')],_0x4c3dde[_0x9673('0x2b')]));if(_0x1896f6[_0x9673('0x2f')][_0x9673('0x36')]){_0x4d8cca[_0x9673('0x37')]=_[_0x9673('0x38')](_0x4d8cca[_0x9673('0x37')],{'$or':_['map'](_0x112791,function(_0x1c29f9){if(_0x1c29f9[_0x9673('0x28')]!=='VIRTUAL'){var _0x4f30f7={};_0x4f30f7[_0x1c29f9[_0x9673('0x24')]]={'$like':'%'+_0x1896f6['query'][_0x9673('0x36')]+'%'};return _0x4f30f7;}})});}_0x4d8cca=_[_0x9673('0x38')]({},_0x4d8cca,_0x1896f6['options']);var _0x5634aa={'where':_0x4d8cca[_0x9673('0x37')]};return db[_0x9673('0x27')][_0x9673('0x18')](_0x5634aa)[_0x9673('0x21')](function(_0x17214b){_0x2de799[_0x9673('0x18')]=_0x17214b;if(_0x1896f6[_0x9673('0x2f')][_0x9673('0x39')]){_0x4d8cca[_0x9673('0x3a')]=[{'all':!![]}];}return db['OpenchannelQueueReport'][_0x9673('0x3b')](_0x4d8cca);})[_0x9673('0x21')](function(_0x1c1087){_0x2de799[_0x9673('0x3c')]=_0x1c1087;return _0x2de799;})[_0x9673('0x21')](respondWithFilteredResult(_0x221b33,_0x4d8cca))[_0x9673('0x3d')](handleError(_0x221b33,null));};exports[_0x9673('0x3e')]=function(_0x5f3385,_0x219580){var _0x2303c8={'raw':!![],'where':{'id':_0x5f3385[_0x9673('0x3f')]['id']}},_0x206938={};_0x206938[_0x9673('0x29')]=_['keys'](db[_0x9673('0x27')]['rawAttributes']);_0x206938[_0x9673('0x2f')]=_['keys'](_0x5f3385[_0x9673('0x2f')]);_0x206938[_0x9673('0x2b')]=_[_0x9673('0x2c')](_0x206938[_0x9673('0x29')],_0x206938[_0x9673('0x2f')]);_0x2303c8[_0x9673('0x2d')]=_[_0x9673('0x2c')](_0x206938[_0x9673('0x29')],qs['fields'](_0x5f3385['query']['fields']));_0x2303c8['attributes']=_0x2303c8[_0x9673('0x2d')][_0x9673('0x30')]?_0x2303c8[_0x9673('0x2d')]:_0x206938[_0x9673('0x29')];if(_0x5f3385[_0x9673('0x2f')]['includeAll']){_0x2303c8[_0x9673('0x3a')]=[{'all':!![]}];}_0x2303c8=_[_0x9673('0x38')]({},_0x2303c8,_0x5f3385['options']);return db[_0x9673('0x27')]['find'](_0x2303c8)['then'](handleEntityNotFound(_0x219580,null))[_0x9673('0x21')](respondWithResult(_0x219580,null))[_0x9673('0x3d')](handleError(_0x219580,null));};exports[_0x9673('0x40')]=function(_0x3a26ec,_0x5c896b){return db['OpenchannelQueueReport'][_0x9673('0x40')](_0x3a26ec[_0x9673('0x41')],{})[_0x9673('0x21')](respondWithResult(_0x5c896b,0xc9))[_0x9673('0x3d')](handleError(_0x5c896b,null));};exports[_0x9673('0x20')]=function(_0x5966d8,_0x18bbf4){if(_0x5966d8[_0x9673('0x41')]['id']){delete _0x5966d8[_0x9673('0x41')]['id'];}return db['OpenchannelQueueReport']['find']({'where':{'id':_0x5966d8['params']['id']}})['then'](handleEntityNotFound(_0x18bbf4,null))[_0x9673('0x21')](saveUpdates(_0x5966d8[_0x9673('0x41')],null))[_0x9673('0x21')](respondWithResult(_0x18bbf4,null))[_0x9673('0x3d')](handleError(_0x18bbf4,null));};exports[_0x9673('0x42')]=function(_0x17c911,_0x3bea34){return db['OpenchannelQueueReport']['find']({'where':{'id':_0x17c911[_0x9673('0x3f')]['id']}})[_0x9673('0x21')](handleEntityNotFound(_0x3bea34,null))[_0x9673('0x21')](removeEntity(_0x3bea34,null))['catch'](handleError(_0x3bea34,null));};exports[_0x9673('0x43')]=function(_0x4289da,_0x16033f){return db[_0x9673('0x27')]['describe']()['then'](respondWithResult(_0x16033f,null))[_0x9673('0x3d')](handleError(_0x16033f,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index bcc04d1..c12309f 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 _0x3efa=['define','OpenchannelQueueReport','uniqueid','util','api','moment','bluebird','request-promise','path','rimraf','./openchannelQueueReport.attributes','exports'];(function(_0xcf0486,_0x17f1de){var _0x861314=function(_0x2c64d3){while(--_0x2c64d3){_0xcf0486['push'](_0xcf0486['shift']());}};_0x861314(++_0x17f1de);}(_0x3efa,0x147));var _0xa3ef=function(_0x702a97,_0x27141c){_0x702a97=_0x702a97-0x0;var _0x157d0c=_0x3efa[_0x702a97];return _0x157d0c;};'use strict';var _=require('lodash');var util=require(_0xa3ef('0x0'));var logger=require('../../config/logger')(_0xa3ef('0x1'));var moment=require(_0xa3ef('0x2'));var BPromise=require(_0xa3ef('0x3'));var rp=require(_0xa3ef('0x4'));var fs=require('fs');var path=require(_0xa3ef('0x5'));var rimraf=require(_0xa3ef('0x6'));var config=require('../../config/environment');var attributes=require(_0xa3ef('0x7'));module[_0xa3ef('0x8')]=function(_0x381fb1,_0x5d3401){return _0x381fb1[_0xa3ef('0x9')](_0xa3ef('0xa'),attributes,{'tableName':'report_openchannel_queue','paranoid':![],'indexes':[{'name':_0xa3ef('0xb'),'fields':[_0xa3ef('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x04d0=['request-promise','../../config/environment','exports','define','OpenchannelQueueReport','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x57e987,_0x120a47){var _0x1a1bda=function(_0x51af4f){while(--_0x51af4f){_0x57e987['push'](_0x57e987['shift']());}};_0x1a1bda(++_0x120a47);}(_0x04d0,0x10a));var _0x004d=function(_0x47fa45,_0x35c59d){_0x47fa45=_0x47fa45-0x0;var _0x38ac6a=_0x04d0[_0x47fa45];return _0x38ac6a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x004d('0x0'))(_0x004d('0x1'));var moment=require(_0x004d('0x2'));var BPromise=require(_0x004d('0x3'));var rp=require(_0x004d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x004d('0x5'));var attributes=require('./openchannelQueueReport.attributes');module[_0x004d('0x6')]=function(_0x285754,_0x4a3878){return _0x285754[_0x004d('0x7')](_0x004d('0x8'),attributes,{'tableName':'report_openchannel_queue','paranoid':![],'indexes':[{'name':_0x004d('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 75b59ad..84c19f3 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 _0xb96d=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','create','options','raw','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','update','body','where','attributes','limit','debug','util','moment'];(function(_0x4f00ab,_0x574771){var _0x25d7d4=function(_0x3deb57){while(--_0x3deb57){_0x4f00ab['push'](_0x4f00ab['shift']());}};_0x25d7d4(++_0x574771);}(_0xb96d,0x9e));var _0xdb96=function(_0x445101,_0x2414bf){_0x445101=_0x445101-0x0;var _0x3c3d04=_0xb96d[_0x445101];return _0x3c3d04;};'use strict';var _=require('lodash');var util=require(_0xdb96('0x0'));var moment=require(_0xdb96('0x1'));var BPromise=require(_0xdb96('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdb96('0x3'));var db=require(_0xdb96('0x4'))['db'];var utils=require(_0xdb96('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xdb96('0x6'));var jayson=require(_0xdb96('0x7'));var client=jayson[_0xdb96('0x8')][_0xdb96('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4f5e6f,_0x294084,_0x571e0e){return new BPromise(function(_0x5e2e95,_0x3384b4){return client['request'](_0x4f5e6f,_0x571e0e)[_0xdb96('0xa')](function(_0xaea492){logger['info'](_0xdb96('0xb'),_0x294084,_0xdb96('0xc'));logger['debug'](_0xdb96('0xd'),_0x294084,_0xdb96('0xc'),JSON[_0xdb96('0xe')](_0xaea492));if(_0xaea492[_0xdb96('0xf')]){if(_0xaea492['error'][_0xdb96('0x10')]===0x1f4){logger[_0xdb96('0xf')](_0xdb96('0xb'),_0x294084,_0xaea492['error'][_0xdb96('0x11')]);return _0x3384b4(_0xaea492[_0xdb96('0xf')][_0xdb96('0x11')]);}logger[_0xdb96('0xf')](_0xdb96('0xb'),_0x294084,_0xaea492[_0xdb96('0xf')][_0xdb96('0x11')]);return _0x5e2e95(_0xaea492[_0xdb96('0xf')][_0xdb96('0x11')]);}else{logger[_0xdb96('0x12')](_0xdb96('0xb'),_0x294084,_0xdb96('0xc'));_0x5e2e95(_0xaea492[_0xdb96('0x13')]['message']);}})[_0xdb96('0x14')](function(_0x2a766e){logger[_0xdb96('0xf')](_0xdb96('0xb'),_0x294084,_0x2a766e);_0x3384b4(_0x2a766e);});});}exports['CreateOpenchannelQueueReport']=function(_0x27fa8e){var _0x33ec8f=this;return new Promise(function(_0x244f66,_0x5946d5){return db['OpenchannelQueueReport'][_0xdb96('0x15')](_0x27fa8e['body'],{'raw':_0x27fa8e['options']?_0x27fa8e[_0xdb96('0x16')][_0xdb96('0x17')]===undefined?!![]:![]:!![]})[_0xdb96('0xa')](function(_0x11b7bd){logger['info'](_0xdb96('0x18'),_0x27fa8e);logger['debug'](_0xdb96('0x18'),_0x27fa8e,JSON[_0xdb96('0xe')](_0x11b7bd));_0x244f66(_0x11b7bd);})['catch'](function(_0x111673){logger[_0xdb96('0xf')](_0xdb96('0x18'),_0x111673[_0xdb96('0x11')],_0x27fa8e);_0x5946d5(_0x33ec8f[_0xdb96('0xf')](0x1f4,_0x111673[_0xdb96('0x11')]));});});};exports[_0xdb96('0x19')]=function(_0x5a1d1c){var _0x4c7558=this;return new Promise(function(_0x18d5a3,_0x350115){return db['OpenchannelQueueReport'][_0xdb96('0x1a')](_0x5a1d1c[_0xdb96('0x1b')],{'raw':_0x5a1d1c[_0xdb96('0x16')]?_0x5a1d1c[_0xdb96('0x16')][_0xdb96('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5a1d1c[_0xdb96('0x16')]?_0x5a1d1c[_0xdb96('0x16')][_0xdb96('0x1c')]||null:null,'attributes':_0x5a1d1c[_0xdb96('0x16')]?_0x5a1d1c['options'][_0xdb96('0x1d')]||null:null,'limit':_0x5a1d1c[_0xdb96('0x16')]?_0x5a1d1c['options'][_0xdb96('0x1e')]||null:null})[_0xdb96('0xa')](function(_0x59f07e){logger[_0xdb96('0x12')](_0xdb96('0x19'),_0x5a1d1c);logger[_0xdb96('0x1f')](_0xdb96('0x19'),_0x5a1d1c,JSON[_0xdb96('0xe')](_0x59f07e));_0x18d5a3(_0x59f07e);})[_0xdb96('0x14')](function(_0x301e5f){logger['error'](_0xdb96('0x19'),_0x301e5f[_0xdb96('0x11')],_0x5a1d1c);_0x350115(_0x4c7558[_0xdb96('0xf')](0x1f4,_0x301e5f[_0xdb96('0x11')]));});});}; \ No newline at end of file +var _0xd237=['debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','raw','stringify','update','options','where','attributes','limit','UpdateOpenchannelQueueReport','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0xd237,0x14f));var _0x7d23=function(_0xa47e37,_0x870a0c){_0xa47e37=_0xa47e37-0x0;var _0x1f6a10=_0xd237[_0xa47e37];return _0x1f6a10;};'use strict';var _=require(_0x7d23('0x0'));var util=require(_0x7d23('0x1'));var moment=require(_0x7d23('0x2'));var BPromise=require(_0x7d23('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7d23('0x4'));var db=require(_0x7d23('0x5'))['db'];var utils=require(_0x7d23('0x6'));var logger=require(_0x7d23('0x7'))(_0x7d23('0x8'));var config=require(_0x7d23('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7d23('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5ca126,_0x48358f,_0xc43371){return new BPromise(function(_0x42c334,_0x6ce28d){return client[_0x7d23('0xb')](_0x5ca126,_0xc43371)[_0x7d23('0xc')](function(_0x23f1d6){logger[_0x7d23('0xd')](_0x7d23('0xe'),_0x48358f,'request\x20sent');logger[_0x7d23('0xf')](_0x7d23('0x10'),_0x48358f,_0x7d23('0x11'),JSON['stringify'](_0x23f1d6));if(_0x23f1d6[_0x7d23('0x12')]){if(_0x23f1d6['error'][_0x7d23('0x13')]===0x1f4){logger[_0x7d23('0x12')](_0x7d23('0xe'),_0x48358f,_0x23f1d6[_0x7d23('0x12')][_0x7d23('0x14')]);return _0x6ce28d(_0x23f1d6[_0x7d23('0x12')][_0x7d23('0x14')]);}logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0x48358f,_0x23f1d6[_0x7d23('0x12')][_0x7d23('0x14')]);return _0x42c334(_0x23f1d6[_0x7d23('0x12')][_0x7d23('0x14')]);}else{logger['info'](_0x7d23('0xe'),_0x48358f,'request\x20sent');_0x42c334(_0x23f1d6[_0x7d23('0x15')]['message']);}})[_0x7d23('0x16')](function(_0x46a35b){logger[_0x7d23('0x12')](_0x7d23('0xe'),_0x48358f,_0x46a35b);_0x6ce28d(_0x46a35b);});});}exports[_0x7d23('0x17')]=function(_0x506a3b){var _0x313471=this;return new Promise(function(_0x3d6a7b,_0x49ce32){return db[_0x7d23('0x18')][_0x7d23('0x19')](_0x506a3b[_0x7d23('0x1a')],{'raw':_0x506a3b['options']?_0x506a3b['options'][_0x7d23('0x1b')]===undefined?!![]:![]:!![]})[_0x7d23('0xc')](function(_0x56b0ba){logger[_0x7d23('0xd')]('CreateOpenchannelQueueReport',_0x506a3b);logger[_0x7d23('0xf')]('CreateOpenchannelQueueReport',_0x506a3b,JSON[_0x7d23('0x1c')](_0x56b0ba));_0x3d6a7b(_0x56b0ba);})[_0x7d23('0x16')](function(_0x59522b){logger[_0x7d23('0x12')](_0x7d23('0x17'),_0x59522b[_0x7d23('0x14')],_0x506a3b);_0x49ce32(_0x313471['error'](0x1f4,_0x59522b[_0x7d23('0x14')]));});});};exports['UpdateOpenchannelQueueReport']=function(_0x2e6d9f){var _0x354b2a=this;return new Promise(function(_0x1c007a,_0x3a5d87){return db[_0x7d23('0x18')][_0x7d23('0x1d')](_0x2e6d9f[_0x7d23('0x1a')],{'raw':_0x2e6d9f[_0x7d23('0x1e')]?_0x2e6d9f[_0x7d23('0x1e')][_0x7d23('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2e6d9f[_0x7d23('0x1e')]?_0x2e6d9f['options'][_0x7d23('0x1f')]||null:null,'attributes':_0x2e6d9f[_0x7d23('0x1e')]?_0x2e6d9f[_0x7d23('0x1e')][_0x7d23('0x20')]||null:null,'limit':_0x2e6d9f[_0x7d23('0x1e')]?_0x2e6d9f[_0x7d23('0x1e')][_0x7d23('0x21')]||null:null})[_0x7d23('0xc')](function(_0x4808f2){logger[_0x7d23('0xd')](_0x7d23('0x22'),_0x2e6d9f);logger['debug'](_0x7d23('0x22'),_0x2e6d9f,JSON[_0x7d23('0x1c')](_0x4808f2));_0x1c007a(_0x4808f2);})[_0x7d23('0x16')](function(_0x4b1c92){logger[_0x7d23('0x12')](_0x7d23('0x22'),_0x4b1c92[_0x7d23('0x14')],_0x2e6d9f);_0x3a5d87(_0x354b2a[_0x7d23('0x12')](0x1f4,_0x4b1c92[_0x7d23('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 645a6cf..dfb3ecc 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(_0x1b64dd,_0x2cf769){var _0xeb464c=function(_0x38272c){while(--_0x38272c){_0x1b64dd['push'](_0x1b64dd['shift']());}};_0xeb464c(++_0x2cf769);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'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(_0x2e6dbf,_0x57dd06){var _0x2680e5=function(_0x4018f4){while(--_0x4018f4){_0x2e6dbf['push'](_0x2e6dbf['shift']());}};_0x2680e5(++_0x57dd06);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'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 52804c5..8c6d148 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 _0x92d0=['DATE','NOW','moment','sequelize','exports','STRING','ENUM','account','agent','queue'];(function(_0x32067e,_0x17c872){var _0x411a7c=function(_0x60f57f){while(--_0x60f57f){_0x32067e['push'](_0x32067e['shift']());}};_0x411a7c(++_0x17c872);}(_0x92d0,0x11a));var _0x092d=function(_0x2f0244,_0x5c752b){_0x2f0244=_0x2f0244-0x0;var _0x1699a1=_0x92d0[_0x2f0244];return _0x1699a1;};'use strict';var moment=require(_0x092d('0x0'));var Sequelize=require(_0x092d('0x1'));module[_0x092d('0x2')]={'uniqueid':{'type':Sequelize[_0x092d('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x092d('0x4')](_0x092d('0x5'),_0x092d('0x6'),_0x092d('0x7')),'allowNull':![],'defaultValue':_0x092d('0x7')},'transferredAt':{'type':Sequelize[_0x092d('0x8')],'allowNull':![],'defaultValue':Sequelize[_0x092d('0x9')]}}; \ No newline at end of file +var _0xc38a=['queue','NOW','sequelize','exports','ENUM','account'];(function(_0x10d8c7,_0xa80d12){var _0x4105b9=function(_0x46684b){while(--_0x46684b){_0x10d8c7['push'](_0x10d8c7['shift']());}};_0x4105b9(++_0xa80d12);}(_0xc38a,0x110));var _0xac38=function(_0x1e1020,_0xd64a27){_0x1e1020=_0x1e1020-0x0;var _0x464719=_0xc38a[_0x1e1020];return _0x464719;};'use strict';var moment=require('moment');var Sequelize=require(_0xac38('0x0'));module[_0xac38('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xac38('0x2')](_0xac38('0x3'),'agent','queue'),'allowNull':![],'defaultValue':_0xac38('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0xac38('0x5')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index e77fec9..6786aaf 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 _0xbd40=['api','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','set','json','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','type','VIRTUAL','options','OpenchannelTransferReport','include','findAll','catch','show','params','includeAll','find','create','body','describe','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x1f0724,_0x3a58bf){var _0x253ffb=function(_0x3b4c72){while(--_0x3b4c72){_0x1f0724['push'](_0x1f0724['shift']());}};_0x253ffb(++_0x3a58bf);}(_0xbd40,0x81));var _0x0bd4=function(_0x264341,_0x223016){_0x264341=_0x264341-0x0;var _0x519a44=_0xbd40[_0x264341];return _0x519a44;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0bd4('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0bd4('0x1'));var moment=require(_0x0bd4('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x0bd4('0x3'));var util=require('util');var path=require(_0x0bd4('0x4'));var sox=require(_0x0bd4('0x5'));var csv=require(_0x0bd4('0x6'));var ejs=require(_0x0bd4('0x7'));var fs=require('fs');var _=require(_0x0bd4('0x8'));var squel=require(_0x0bd4('0x9'));var crypto=require(_0x0bd4('0xa'));var jsforce=require(_0x0bd4('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0bd4('0x6'));var querystring=require(_0x0bd4('0xc'));var Papa=require(_0x0bd4('0xd'));var Redis=require(_0x0bd4('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x0bd4('0xf'));var as=require(_0x0bd4('0x10'));var hardwareService=require(_0x0bd4('0x11'));var logger=require(_0x0bd4('0x12'))(_0x0bd4('0x13'));var utils=require('../../config/utils');var config=require(_0x0bd4('0x14'));var db=require(_0x0bd4('0x15'))['db'];function respondWithStatusCode(_0x5c3da1,_0x24b5dc){_0x24b5dc=_0x24b5dc||0xcc;return function(_0x379ed3){if(_0x379ed3){return _0x5c3da1[_0x0bd4('0x16')](_0x24b5dc);}return _0x5c3da1[_0x0bd4('0x17')](_0x24b5dc)['end']();};}function respondWithResult(_0x28efc0,_0x4b1884){_0x4b1884=_0x4b1884||0xc8;return function(_0x405dba){if(_0x405dba){return _0x28efc0[_0x0bd4('0x17')](_0x4b1884)['json'](_0x405dba);}};}function respondWithFilteredResult(_0x3cacde,_0x2d3bba){return function(_0xd271ad){if(_0xd271ad){var _0x8d6f6a=_0xd271ad[_0x0bd4('0x18')],_0x5b864b=_0x2d3bba[_0x0bd4('0x19')],_0x388c81=_0x2d3bba[_0x0bd4('0x19')]+_0x2d3bba[_0x0bd4('0x1a')],_0x267f59;if(_0x388c81>=_0x8d6f6a){_0x388c81=_0x8d6f6a;_0x267f59=0xc8;}else{_0x267f59=0xce;}_0x3cacde['status'](_0x267f59);return _0x3cacde[_0x0bd4('0x1b')]('Content-Range',_0x5b864b+'-'+_0x388c81+'/'+_0x8d6f6a)[_0x0bd4('0x1c')](_0xd271ad);}return null;};}function patchUpdates(_0x514026){return function(_0x525aa1){try{jsonpatch[_0x0bd4('0x1d')](_0x525aa1,_0x514026,!![]);}catch(_0x2f08b2){return BPromise[_0x0bd4('0x1e')](_0x2f08b2);}return _0x525aa1[_0x0bd4('0x1f')]();};}function saveUpdates(_0x15be70,_0x157f27){return function(_0xf75eb7){if(_0xf75eb7){return _0xf75eb7[_0x0bd4('0x20')](_0x15be70)[_0x0bd4('0x21')](function(_0x5b3902){return _0x5b3902;});}return null;};}function removeEntity(_0x3d5b33,_0x27ef36){return function(_0x57bb45){if(_0x57bb45){return _0x57bb45[_0x0bd4('0x22')]()[_0x0bd4('0x21')](function(){_0x3d5b33[_0x0bd4('0x17')](0xcc)[_0x0bd4('0x23')]();});}};}function handleEntityNotFound(_0x4ac5c5,_0x545ff6){return function(_0x2d3224){if(!_0x2d3224){_0x4ac5c5[_0x0bd4('0x16')](0x194);}return _0x2d3224;};}function handleError(_0xf86dd7,_0x40c99a){_0x40c99a=_0x40c99a||0x1f4;return function(_0x494683){logger[_0x0bd4('0x24')](_0x494683[_0x0bd4('0x25')]);if(_0x494683[_0x0bd4('0x26')]){delete _0x494683['name'];}_0xf86dd7[_0x0bd4('0x17')](_0x40c99a)[_0x0bd4('0x27')](_0x494683);};}exports[_0x0bd4('0x28')]=function(_0x38e5d6,_0x592747){var _0x5ac2cd={},_0x26ed7d={},_0x3e5822={'count':0x0,'rows':[]};var _0x1642b8=_[_0x0bd4('0x29')](db['OpenchannelTransferReport'][_0x0bd4('0x2a')],function(_0x5d4b83){return{'name':_0x5d4b83[_0x0bd4('0x2b')],'type':_0x5d4b83['type'][_0x0bd4('0x2c')]};});_0x26ed7d[_0x0bd4('0x2d')]=_[_0x0bd4('0x29')](_0x1642b8,_0x0bd4('0x26'));_0x26ed7d[_0x0bd4('0x2e')]=_[_0x0bd4('0x2f')](_0x38e5d6[_0x0bd4('0x2e')]);_0x26ed7d['filters']=_[_0x0bd4('0x30')](_0x26ed7d[_0x0bd4('0x2d')],_0x26ed7d['query']);_0x5ac2cd[_0x0bd4('0x31')]=_[_0x0bd4('0x30')](_0x26ed7d['model'],qs[_0x0bd4('0x32')](_0x38e5d6['query'][_0x0bd4('0x32')]));_0x5ac2cd[_0x0bd4('0x31')]=_0x5ac2cd[_0x0bd4('0x31')][_0x0bd4('0x33')]?_0x5ac2cd[_0x0bd4('0x31')]:_0x26ed7d[_0x0bd4('0x2d')];if(!_0x38e5d6['query'][_0x0bd4('0x34')](_0x0bd4('0x35'))){_0x5ac2cd[_0x0bd4('0x1a')]=qs['limit'](_0x38e5d6[_0x0bd4('0x2e')]['limit']);_0x5ac2cd[_0x0bd4('0x19')]=qs['offset'](_0x38e5d6[_0x0bd4('0x2e')][_0x0bd4('0x19')]);}_0x5ac2cd[_0x0bd4('0x36')]=qs[_0x0bd4('0x37')](_0x38e5d6['query'][_0x0bd4('0x37')]);_0x5ac2cd[_0x0bd4('0x38')]=qs[_0x0bd4('0x39')](_['pick'](_0x38e5d6[_0x0bd4('0x2e')],_0x26ed7d[_0x0bd4('0x39')]));if(_0x38e5d6[_0x0bd4('0x2e')][_0x0bd4('0x3a')]){_0x5ac2cd[_0x0bd4('0x38')]=_[_0x0bd4('0x3b')](_0x5ac2cd[_0x0bd4('0x38')],{'$or':_[_0x0bd4('0x29')](_0x1642b8,function(_0x3e1eb8){if(_0x3e1eb8[_0x0bd4('0x3c')]!==_0x0bd4('0x3d')){var _0x1ad1b1={};_0x1ad1b1[_0x3e1eb8[_0x0bd4('0x26')]]={'$like':'%'+_0x38e5d6[_0x0bd4('0x2e')][_0x0bd4('0x3a')]+'%'};return _0x1ad1b1;}})});}_0x5ac2cd=_[_0x0bd4('0x3b')]({},_0x5ac2cd,_0x38e5d6[_0x0bd4('0x3e')]);var _0x288530={'where':_0x5ac2cd['where']};return db[_0x0bd4('0x3f')][_0x0bd4('0x18')](_0x288530)[_0x0bd4('0x21')](function(_0x3d6ae7){_0x3e5822[_0x0bd4('0x18')]=_0x3d6ae7;if(_0x38e5d6[_0x0bd4('0x2e')]['includeAll']){_0x5ac2cd[_0x0bd4('0x40')]=[{'all':!![]}];}return db[_0x0bd4('0x3f')][_0x0bd4('0x41')](_0x5ac2cd);})[_0x0bd4('0x21')](function(_0x4e2737){_0x3e5822['rows']=_0x4e2737;return _0x3e5822;})['then'](respondWithFilteredResult(_0x592747,_0x5ac2cd))[_0x0bd4('0x42')](handleError(_0x592747,null));};exports[_0x0bd4('0x43')]=function(_0x10c3ad,_0x49a224){var _0x3417fb={'raw':!![],'where':{'id':_0x10c3ad[_0x0bd4('0x44')]['id']}},_0x452d9d={};_0x452d9d[_0x0bd4('0x2d')]=_[_0x0bd4('0x2f')](db[_0x0bd4('0x3f')][_0x0bd4('0x2a')]);_0x452d9d[_0x0bd4('0x2e')]=_[_0x0bd4('0x2f')](_0x10c3ad[_0x0bd4('0x2e')]);_0x452d9d[_0x0bd4('0x39')]=_['intersection'](_0x452d9d[_0x0bd4('0x2d')],_0x452d9d['query']);_0x3417fb[_0x0bd4('0x31')]=_['intersection'](_0x452d9d[_0x0bd4('0x2d')],qs[_0x0bd4('0x32')](_0x10c3ad['query']['fields']));_0x3417fb[_0x0bd4('0x31')]=_0x3417fb[_0x0bd4('0x31')][_0x0bd4('0x33')]?_0x3417fb[_0x0bd4('0x31')]:_0x452d9d[_0x0bd4('0x2d')];if(_0x10c3ad[_0x0bd4('0x2e')][_0x0bd4('0x45')]){_0x3417fb[_0x0bd4('0x40')]=[{'all':!![]}];}_0x3417fb=_[_0x0bd4('0x3b')]({},_0x3417fb,_0x10c3ad['options']);return db[_0x0bd4('0x3f')][_0x0bd4('0x46')](_0x3417fb)[_0x0bd4('0x21')](handleEntityNotFound(_0x49a224,null))[_0x0bd4('0x21')](respondWithResult(_0x49a224,null))['catch'](handleError(_0x49a224,null));};exports[_0x0bd4('0x47')]=function(_0x1e68e0,_0x4e419b){return db[_0x0bd4('0x3f')][_0x0bd4('0x47')](_0x1e68e0[_0x0bd4('0x48')],{})[_0x0bd4('0x21')](respondWithResult(_0x4e419b,0xc9))[_0x0bd4('0x42')](handleError(_0x4e419b,null));};exports['update']=function(_0x514474,_0x37de5b){if(_0x514474[_0x0bd4('0x48')]['id']){delete _0x514474['body']['id'];}return db['OpenchannelTransferReport'][_0x0bd4('0x46')]({'where':{'id':_0x514474[_0x0bd4('0x44')]['id']}})[_0x0bd4('0x21')](handleEntityNotFound(_0x37de5b,null))[_0x0bd4('0x21')](saveUpdates(_0x514474[_0x0bd4('0x48')],null))[_0x0bd4('0x21')](respondWithResult(_0x37de5b,null))[_0x0bd4('0x42')](handleError(_0x37de5b,null));};exports[_0x0bd4('0x22')]=function(_0x5ea015,_0x2968c2){return db[_0x0bd4('0x3f')]['find']({'where':{'id':_0x5ea015[_0x0bd4('0x44')]['id']}})['then'](handleEntityNotFound(_0x2968c2,null))[_0x0bd4('0x21')](removeEntity(_0x2968c2,null))[_0x0bd4('0x42')](handleError(_0x2968c2,null));};exports['describe']=function(_0x39144b,_0x218bae){return db[_0x0bd4('0x3f')][_0x0bd4('0x49')]()[_0x0bd4('0x21')](respondWithResult(_0x218bae,null))[_0x0bd4('0x42')](handleError(_0x218bae,null));}; \ No newline at end of file +var _0x5b13=['stack','name','send','index','map','rawAttributes','fieldName','type','key','query','filters','attributes','model','length','nolimit','order','sort','filter','where','VIRTUAL','merge','OpenchannelTransferReport','includeAll','include','rows','catch','show','keys','intersection','fields','options','create','body','update','find','params','describe','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','save','then','destroy','end','error'];(function(_0x7ebd8f,_0x5a5f0c){var _0x1ace1d=function(_0x393166){while(--_0x393166){_0x7ebd8f['push'](_0x7ebd8f['shift']());}};_0x1ace1d(++_0x5a5f0c);}(_0x5b13,0x100));var _0x35b1=function(_0x26dd79,_0x37603d){_0x26dd79=_0x26dd79-0x0;var _0x3c3798=_0x5b13[_0x26dd79];return _0x3c3798;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x35b1('0x0'));var rimraf=require(_0x35b1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x35b1('0x2'));var moment=require(_0x35b1('0x3'));var BPromise=require(_0x35b1('0x4'));var Mustache=require(_0x35b1('0x5'));var util=require(_0x35b1('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x35b1('0x7'));var fs=require('fs');var _=require(_0x35b1('0x8'));var squel=require(_0x35b1('0x9'));var crypto=require('crypto');var jsforce=require(_0x35b1('0xa'));var deskjs=require(_0x35b1('0xb'));var toCsv=require('to-csv');var querystring=require(_0x35b1('0xc'));var Papa=require(_0x35b1('0xd'));var Redis=require(_0x35b1('0xe'));var authService=require(_0x35b1('0xf'));var qs=require(_0x35b1('0x10'));var as=require(_0x35b1('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x35b1('0x12'));var utils=require(_0x35b1('0x13'));var config=require(_0x35b1('0x14'));var db=require(_0x35b1('0x15'))['db'];function respondWithStatusCode(_0x5d32c7,_0x233ba1){_0x233ba1=_0x233ba1||0xcc;return function(_0x47aab3){if(_0x47aab3){return _0x5d32c7[_0x35b1('0x16')](_0x233ba1);}return _0x5d32c7[_0x35b1('0x17')](_0x233ba1)['end']();};}function respondWithResult(_0x362a9f,_0x2f65a1){_0x2f65a1=_0x2f65a1||0xc8;return function(_0x2b9411){if(_0x2b9411){return _0x362a9f['status'](_0x2f65a1)[_0x35b1('0x18')](_0x2b9411);}};}function respondWithFilteredResult(_0x15efa7,_0x227928){return function(_0x2154b2){if(_0x2154b2){var _0x3d9454=_0x2154b2[_0x35b1('0x19')],_0x57866f=_0x227928[_0x35b1('0x1a')],_0x56eb22=_0x227928[_0x35b1('0x1a')]+_0x227928[_0x35b1('0x1b')],_0x3916e4;if(_0x56eb22>=_0x3d9454){_0x56eb22=_0x3d9454;_0x3916e4=0xc8;}else{_0x3916e4=0xce;}_0x15efa7[_0x35b1('0x17')](_0x3916e4);return _0x15efa7['set'](_0x35b1('0x1c'),_0x57866f+'-'+_0x56eb22+'/'+_0x3d9454)[_0x35b1('0x18')](_0x2154b2);}return null;};}function patchUpdates(_0x111409){return function(_0x2626e0){try{jsonpatch[_0x35b1('0x1d')](_0x2626e0,_0x111409,!![]);}catch(_0x458a4d){return BPromise[_0x35b1('0x1e')](_0x458a4d);}return _0x2626e0[_0x35b1('0x1f')]();};}function saveUpdates(_0x5615c9,_0x40576e){return function(_0x4caf4a){if(_0x4caf4a){return _0x4caf4a['update'](_0x5615c9)[_0x35b1('0x20')](function(_0x1adeec){return _0x1adeec;});}return null;};}function removeEntity(_0x1eea7c,_0x4200a1){return function(_0x3a082f){if(_0x3a082f){return _0x3a082f[_0x35b1('0x21')]()[_0x35b1('0x20')](function(){_0x1eea7c[_0x35b1('0x17')](0xcc)[_0x35b1('0x22')]();});}};}function handleEntityNotFound(_0x253c99,_0x2d2204){return function(_0xaecb99){if(!_0xaecb99){_0x253c99[_0x35b1('0x16')](0x194);}return _0xaecb99;};}function handleError(_0x699f10,_0x34b334){_0x34b334=_0x34b334||0x1f4;return function(_0x2985c7){logger[_0x35b1('0x23')](_0x2985c7[_0x35b1('0x24')]);if(_0x2985c7[_0x35b1('0x25')]){delete _0x2985c7['name'];}_0x699f10['status'](_0x34b334)[_0x35b1('0x26')](_0x2985c7);};}exports[_0x35b1('0x27')]=function(_0xd2ab26,_0x3b4131){var _0x52b5be={},_0x5b458b={},_0x1d299d={'count':0x0,'rows':[]};var _0x3feb77=_[_0x35b1('0x28')](db['OpenchannelTransferReport'][_0x35b1('0x29')],function(_0xed326c){return{'name':_0xed326c[_0x35b1('0x2a')],'type':_0xed326c[_0x35b1('0x2b')][_0x35b1('0x2c')]};});_0x5b458b['model']=_[_0x35b1('0x28')](_0x3feb77,_0x35b1('0x25'));_0x5b458b[_0x35b1('0x2d')]=_['keys'](_0xd2ab26[_0x35b1('0x2d')]);_0x5b458b[_0x35b1('0x2e')]=_['intersection'](_0x5b458b['model'],_0x5b458b[_0x35b1('0x2d')]);_0x52b5be[_0x35b1('0x2f')]=_['intersection'](_0x5b458b[_0x35b1('0x30')],qs['fields'](_0xd2ab26['query']['fields']));_0x52b5be['attributes']=_0x52b5be[_0x35b1('0x2f')][_0x35b1('0x31')]?_0x52b5be['attributes']:_0x5b458b[_0x35b1('0x30')];if(!_0xd2ab26[_0x35b1('0x2d')]['hasOwnProperty'](_0x35b1('0x32'))){_0x52b5be[_0x35b1('0x1b')]=qs[_0x35b1('0x1b')](_0xd2ab26['query']['limit']);_0x52b5be['offset']=qs['offset'](_0xd2ab26[_0x35b1('0x2d')][_0x35b1('0x1a')]);}_0x52b5be[_0x35b1('0x33')]=qs[_0x35b1('0x34')](_0xd2ab26[_0x35b1('0x2d')]['sort']);_0x52b5be['where']=qs['filters'](_['pick'](_0xd2ab26[_0x35b1('0x2d')],_0x5b458b[_0x35b1('0x2e')]));if(_0xd2ab26[_0x35b1('0x2d')][_0x35b1('0x35')]){_0x52b5be[_0x35b1('0x36')]=_['merge'](_0x52b5be[_0x35b1('0x36')],{'$or':_[_0x35b1('0x28')](_0x3feb77,function(_0x325265){if(_0x325265[_0x35b1('0x2b')]!==_0x35b1('0x37')){var _0x1a551c={};_0x1a551c[_0x325265[_0x35b1('0x25')]]={'$like':'%'+_0xd2ab26['query'][_0x35b1('0x35')]+'%'};return _0x1a551c;}})});}_0x52b5be=_[_0x35b1('0x38')]({},_0x52b5be,_0xd2ab26['options']);var _0x533ba1={'where':_0x52b5be[_0x35b1('0x36')]};return db[_0x35b1('0x39')][_0x35b1('0x19')](_0x533ba1)['then'](function(_0x41cdef){_0x1d299d[_0x35b1('0x19')]=_0x41cdef;if(_0xd2ab26[_0x35b1('0x2d')][_0x35b1('0x3a')]){_0x52b5be[_0x35b1('0x3b')]=[{'all':!![]}];}return db[_0x35b1('0x39')]['findAll'](_0x52b5be);})[_0x35b1('0x20')](function(_0x1f6196){_0x1d299d[_0x35b1('0x3c')]=_0x1f6196;return _0x1d299d;})[_0x35b1('0x20')](respondWithFilteredResult(_0x3b4131,_0x52b5be))[_0x35b1('0x3d')](handleError(_0x3b4131,null));};exports[_0x35b1('0x3e')]=function(_0x1f3b10,_0x309f39){var _0x693290={'raw':!![],'where':{'id':_0x1f3b10['params']['id']}},_0xaeba40={};_0xaeba40[_0x35b1('0x30')]=_[_0x35b1('0x3f')](db[_0x35b1('0x39')][_0x35b1('0x29')]);_0xaeba40['query']=_[_0x35b1('0x3f')](_0x1f3b10[_0x35b1('0x2d')]);_0xaeba40[_0x35b1('0x2e')]=_[_0x35b1('0x40')](_0xaeba40[_0x35b1('0x30')],_0xaeba40[_0x35b1('0x2d')]);_0x693290['attributes']=_['intersection'](_0xaeba40[_0x35b1('0x30')],qs[_0x35b1('0x41')](_0x1f3b10['query'][_0x35b1('0x41')]));_0x693290['attributes']=_0x693290[_0x35b1('0x2f')][_0x35b1('0x31')]?_0x693290[_0x35b1('0x2f')]:_0xaeba40['model'];if(_0x1f3b10[_0x35b1('0x2d')]['includeAll']){_0x693290[_0x35b1('0x3b')]=[{'all':!![]}];}_0x693290=_[_0x35b1('0x38')]({},_0x693290,_0x1f3b10[_0x35b1('0x42')]);return db[_0x35b1('0x39')]['find'](_0x693290)[_0x35b1('0x20')](handleEntityNotFound(_0x309f39,null))[_0x35b1('0x20')](respondWithResult(_0x309f39,null))[_0x35b1('0x3d')](handleError(_0x309f39,null));};exports[_0x35b1('0x43')]=function(_0x5e8bac,_0x907cba){return db['OpenchannelTransferReport']['create'](_0x5e8bac[_0x35b1('0x44')],{})[_0x35b1('0x20')](respondWithResult(_0x907cba,0xc9))[_0x35b1('0x3d')](handleError(_0x907cba,null));};exports[_0x35b1('0x45')]=function(_0x33e5c3,_0x48544c){if(_0x33e5c3['body']['id']){delete _0x33e5c3['body']['id'];}return db['OpenchannelTransferReport'][_0x35b1('0x46')]({'where':{'id':_0x33e5c3[_0x35b1('0x47')]['id']}})[_0x35b1('0x20')](handleEntityNotFound(_0x48544c,null))['then'](saveUpdates(_0x33e5c3['body'],null))[_0x35b1('0x20')](respondWithResult(_0x48544c,null))[_0x35b1('0x3d')](handleError(_0x48544c,null));};exports[_0x35b1('0x21')]=function(_0x2a6252,_0x1b7721){return db['OpenchannelTransferReport']['find']({'where':{'id':_0x2a6252[_0x35b1('0x47')]['id']}})[_0x35b1('0x20')](handleEntityNotFound(_0x1b7721,null))[_0x35b1('0x20')](removeEntity(_0x1b7721,null))['catch'](handleError(_0x1b7721,null));};exports[_0x35b1('0x48')]=function(_0x404804,_0x32391d){return db[_0x35b1('0x39')][_0x35b1('0x48')]()[_0x35b1('0x20')](respondWithResult(_0x32391d,null))[_0x35b1('0x3d')](handleError(_0x32391d,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 8bb2533..5e3023e 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 _0x3997=['exports','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./openchannelTransferReport.attributes'];(function(_0x152fd4,_0x17d023){var _0x258536=function(_0x5b33c1){while(--_0x5b33c1){_0x152fd4['push'](_0x152fd4['shift']());}};_0x258536(++_0x17d023);}(_0x3997,0x1b2));var _0x7399=function(_0x407ec5,_0x48d963){_0x407ec5=_0x407ec5-0x0;var _0x250bf5=_0x3997[_0x407ec5];return _0x250bf5;};'use strict';var _=require('lodash');var util=require(_0x7399('0x0'));var logger=require(_0x7399('0x1'))(_0x7399('0x2'));var moment=require(_0x7399('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7399('0x4'));var rimraf=require(_0x7399('0x5'));var config=require(_0x7399('0x6'));var attributes=require(_0x7399('0x7'));module[_0x7399('0x8')]=function(_0x477ff0,_0x528920){return _0x477ff0[_0x7399('0x9')](_0x7399('0xa'),attributes,{'tableName':_0x7399('0xb'),'paranoid':![],'indexes':[{'name':_0x7399('0xc'),'fields':[_0x7399('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdf11=['request-promise','path','./openchannelTransferReport.attributes','exports','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','util','moment','bluebird'];(function(_0x5619f9,_0xc6aaa8){var _0x180dca=function(_0x2093e7){while(--_0x2093e7){_0x5619f9['push'](_0x5619f9['shift']());}};_0x180dca(++_0xc6aaa8);}(_0xdf11,0x1ab));var _0x1df1=function(_0x342002,_0x28f312){_0x342002=_0x342002-0x0;var _0x213adf=_0xdf11[_0x342002];return _0x213adf;};'use strict';var _=require('lodash');var util=require(_0x1df1('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x1df1('0x1'));var BPromise=require(_0x1df1('0x2'));var rp=require(_0x1df1('0x3'));var fs=require('fs');var path=require(_0x1df1('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1df1('0x5'));module[_0x1df1('0x6')]=function(_0x50a010,_0x58dd41){return _0x50a010['define'](_0x1df1('0x7'),attributes,{'tableName':_0x1df1('0x8'),'paranoid':![],'indexes':[{'name':_0x1df1('0x9'),'fields':[_0x1df1('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 46933de..ebe8cce 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 _0xa2a6=['../../config/logger','rpc','jayson/promise','client','http','request','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x1e6e4e,_0x2b1b09){var _0x3d746b=function(_0x4483dd){while(--_0x4483dd){_0x1e6e4e['push'](_0x1e6e4e['shift']());}};_0x3d746b(++_0x2b1b09);}(_0xa2a6,0x1b2));var _0x6a2a=function(_0x3831aa,_0x3daa03){_0x3831aa=_0x3831aa-0x0;var _0x4cde14=_0xa2a6[_0x3831aa];return _0x4cde14;};'use strict';var _=require('lodash');var util=require(_0x6a2a('0x0'));var moment=require(_0x6a2a('0x1'));var BPromise=require(_0x6a2a('0x2'));var rs=require(_0x6a2a('0x3'));var fs=require('fs');var Redis=require(_0x6a2a('0x4'));var db=require(_0x6a2a('0x5'))['db'];var utils=require(_0x6a2a('0x6'));var logger=require(_0x6a2a('0x7'))(_0x6a2a('0x8'));var config=require('../../config/environment');var jayson=require(_0x6a2a('0x9'));var client=jayson[_0x6a2a('0xa')][_0x6a2a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x47e893,_0x3d6fc1,_0x520d4d){return new BPromise(function(_0x5f413b,_0x17f03f){return client[_0x6a2a('0xc')](_0x47e893,_0x520d4d)['then'](function(_0x275f5e){logger['info'](_0x6a2a('0xd'),_0x3d6fc1,_0x6a2a('0xe'));logger[_0x6a2a('0xf')](_0x6a2a('0x10'),_0x3d6fc1,'request\x20sent',JSON['stringify'](_0x275f5e));if(_0x275f5e['error']){if(_0x275f5e[_0x6a2a('0x11')]['code']===0x1f4){logger['error'](_0x6a2a('0xd'),_0x3d6fc1,_0x275f5e[_0x6a2a('0x11')][_0x6a2a('0x12')]);return _0x17f03f(_0x275f5e[_0x6a2a('0x11')]['message']);}logger[_0x6a2a('0x11')](_0x6a2a('0xd'),_0x3d6fc1,_0x275f5e[_0x6a2a('0x11')][_0x6a2a('0x12')]);return _0x5f413b(_0x275f5e['error']['message']);}else{logger['info']('OpenchannelTransferReport,\x20%s,\x20%s',_0x3d6fc1,_0x6a2a('0xe'));_0x5f413b(_0x275f5e[_0x6a2a('0x13')][_0x6a2a('0x12')]);}})[_0x6a2a('0x14')](function(_0x337cc5){logger[_0x6a2a('0x11')](_0x6a2a('0xd'),_0x3d6fc1,_0x337cc5);_0x17f03f(_0x337cc5);});});} \ No newline at end of file +var _0x63b1=['OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','OpenchannelTransferReport,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug'];(function(_0x3f6268,_0x44dcca){var _0x38db85=function(_0x7b47f2){while(--_0x7b47f2){_0x3f6268['push'](_0x3f6268['shift']());}};_0x38db85(++_0x44dcca);}(_0x63b1,0x177));var _0x163b=function(_0x31dac7,_0x5f4c4d){_0x31dac7=_0x31dac7-0x0;var _0x4d4f0c=_0x63b1[_0x31dac7];return _0x4d4f0c;};'use strict';var _=require(_0x163b('0x0'));var util=require(_0x163b('0x1'));var moment=require(_0x163b('0x2'));var BPromise=require(_0x163b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x163b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x163b('0x5'));var logger=require(_0x163b('0x6'))(_0x163b('0x7'));var config=require(_0x163b('0x8'));var jayson=require(_0x163b('0x9'));var client=jayson[_0x163b('0xa')][_0x163b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3da92d,_0x272651,_0x165027){return new BPromise(function(_0x1b60a0,_0x48b8e4){return client[_0x163b('0xc')](_0x3da92d,_0x165027)[_0x163b('0xd')](function(_0x4830c1){logger[_0x163b('0xe')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x272651,'request\x20sent');logger[_0x163b('0xf')](_0x163b('0x10'),_0x272651,_0x163b('0x11'),JSON['stringify'](_0x4830c1));if(_0x4830c1[_0x163b('0x12')]){if(_0x4830c1[_0x163b('0x12')][_0x163b('0x13')]===0x1f4){logger[_0x163b('0x12')](_0x163b('0x14'),_0x272651,_0x4830c1['error'][_0x163b('0x15')]);return _0x48b8e4(_0x4830c1[_0x163b('0x12')][_0x163b('0x15')]);}logger[_0x163b('0x12')](_0x163b('0x14'),_0x272651,_0x4830c1[_0x163b('0x12')][_0x163b('0x15')]);return _0x1b60a0(_0x4830c1[_0x163b('0x12')][_0x163b('0x15')]);}else{logger[_0x163b('0xe')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x272651,_0x163b('0x11'));_0x1b60a0(_0x4830c1['result'][_0x163b('0x15')]);}})[_0x163b('0x16')](function(_0x309b09){logger[_0x163b('0x12')](_0x163b('0x14'),_0x272651,_0x309b09);_0x48b8e4(_0x309b09);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index eb91876..4b98dcc 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 _0x935d=['multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./pause.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x20a68a,_0x54502e){var _0x56c5d4=function(_0x4ace56){while(--_0x4ace56){_0x20a68a['push'](_0x20a68a['shift']());}};_0x56c5d4(++_0x54502e);}(_0x935d,0x90));var _0xd935=function(_0x3d34da,_0x3abcc1){_0x3d34da=_0x3d34da-0x0;var _0xcf6af8=_0x935d[_0x3d34da];return _0xcf6af8;};'use strict';var multer=require(_0xd935('0x0'));var util=require(_0xd935('0x1'));var path=require('path');var timeout=require(_0xd935('0x2'));var express=require(_0xd935('0x3'));var router=express['Router']();var auth=require(_0xd935('0x4'));var interaction=require(_0xd935('0x5'));var config=require('../../config/environment');var controller=require(_0xd935('0x6'));router[_0xd935('0x7')]('/',auth[_0xd935('0x8')](),controller['index']);router['get'](_0xd935('0x9'),auth[_0xd935('0x8')](),controller[_0xd935('0xa')]);router[_0xd935('0xb')]('/',auth[_0xd935('0x8')](),controller[_0xd935('0xc')]);router[_0xd935('0xd')](_0xd935('0x9'),auth[_0xd935('0x8')](),controller[_0xd935('0xe')]);router[_0xd935('0xf')]('/:id',auth[_0xd935('0x8')](),controller[_0xd935('0x10')]);module[_0xd935('0x11')]=router; \ No newline at end of file +var _0xfc8a=['isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','get'];(function(_0x36909d,_0x2795f1){var _0x1fd29d=function(_0x27d0fa){while(--_0x27d0fa){_0x36909d['push'](_0x36909d['shift']());}};_0x1fd29d(++_0x2795f1);}(_0xfc8a,0x1ba));var _0xafc8=function(_0x2f831f,_0x412036){_0x2f831f=_0x2f831f-0x0;var _0x245a02=_0xfc8a[_0x2f831f];return _0x245a02;};'use strict';var multer=require(_0xafc8('0x0'));var util=require(_0xafc8('0x1'));var path=require(_0xafc8('0x2'));var timeout=require(_0xafc8('0x3'));var express=require(_0xafc8('0x4'));var router=express['Router']();var auth=require(_0xafc8('0x5'));var interaction=require(_0xafc8('0x6'));var config=require('../../config/environment');var controller=require('./pause.controller');router[_0xafc8('0x7')]('/',auth[_0xafc8('0x8')](),controller[_0xafc8('0x9')]);router[_0xafc8('0x7')](_0xafc8('0xa'),auth[_0xafc8('0x8')](),controller[_0xafc8('0xb')]);router[_0xafc8('0xc')]('/',auth[_0xafc8('0x8')](),controller[_0xafc8('0xd')]);router['put'](_0xafc8('0xa'),auth['isAuthenticated'](),controller[_0xafc8('0xe')]);router[_0xafc8('0xf')](_0xafc8('0xa'),auth[_0xafc8('0x8')](),controller[_0xafc8('0x10')]);module[_0xafc8('0x11')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 0aacd70..9b4f9dd 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 _0xbaf9=['STRING','exports'];(function(_0xdb628e,_0x103e9a){var _0x493aa5=function(_0x48357e){while(--_0x48357e){_0xdb628e['push'](_0xdb628e['shift']());}};_0x493aa5(++_0x103e9a);}(_0xbaf9,0x7f));var _0x9baf=function(_0x1365cb,_0x3d0f80){_0x1365cb=_0x1365cb-0x0;var _0x3bcd03=_0xbaf9[_0x1365cb];return _0x3bcd03;};'use strict';var Sequelize=require('sequelize');module[_0x9baf('0x0')]={'name':{'type':Sequelize[_0x9baf('0x1')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x9baf('0x1')]}}; \ No newline at end of file +var _0xc874=['name','STRING','sequelize','exports'];(function(_0x10fdf7,_0x136283){var _0x69e199=function(_0x3c9832){while(--_0x3c9832){_0x10fdf7['push'](_0x10fdf7['shift']());}};_0x69e199(++_0x136283);}(_0xc874,0xf6));var _0x4c87=function(_0x50cd41,_0x4874a7){_0x50cd41=_0x50cd41-0x0;var _0x399475=_0xc874[_0x50cd41];return _0x399475;};'use strict';var Sequelize=require(_0x4c87('0x0'));module[_0x4c87('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x4c87('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x4c87('0x3')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 8b27ab2..bb7ef7e 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 _0x0169=['../../mysqldb','sendStatus','end','status','json','offset','limit','set','apply','reject','save','update','then','get','Pauses','UserProfileResource','error','name','send','index','map','Pause','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','order','sort','where','VIRTUAL','filter','merge','options','count','includeAll','include','findAll','rows','catch','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment'];(function(_0x53bddc,_0x6b3b31){var _0x20c033=function(_0x25b207){while(--_0x25b207){_0x53bddc['push'](_0x53bddc['shift']());}};_0x20c033(++_0x6b3b31);}(_0x0169,0x12f));var _0x9016=function(_0x5a04c8,_0xd3d9d){_0x5a04c8=_0x5a04c8-0x0;var _0x797123=_0x0169[_0x5a04c8];return _0x797123;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9016('0x0'));var rimraf=require(_0x9016('0x1'));var zipdir=require(_0x9016('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9016('0x3'));var moment=require(_0x9016('0x4'));var BPromise=require(_0x9016('0x5'));var Mustache=require(_0x9016('0x6'));var util=require(_0x9016('0x7'));var path=require(_0x9016('0x8'));var sox=require(_0x9016('0x9'));var csv=require(_0x9016('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x9016('0xb'));var squel=require(_0x9016('0xc'));var crypto=require(_0x9016('0xd'));var jsforce=require(_0x9016('0xe'));var deskjs=require(_0x9016('0xf'));var toCsv=require('to-csv');var querystring=require(_0x9016('0x10'));var Papa=require('papaparse');var Redis=require(_0x9016('0x11'));var authService=require(_0x9016('0x12'));var qs=require(_0x9016('0x13'));var as=require(_0x9016('0x14'));var hardwareService=require(_0x9016('0x15'));var logger=require('../../config/logger')(_0x9016('0x16'));var utils=require(_0x9016('0x17'));var config=require(_0x9016('0x18'));var db=require(_0x9016('0x19'))['db'];function respondWithStatusCode(_0x234d1e,_0x5f55b0){_0x5f55b0=_0x5f55b0||0xcc;return function(_0x2f42c6){if(_0x2f42c6){return _0x234d1e[_0x9016('0x1a')](_0x5f55b0);}return _0x234d1e['status'](_0x5f55b0)[_0x9016('0x1b')]();};}function respondWithResult(_0x49d9dc,_0x1d8c6d){_0x1d8c6d=_0x1d8c6d||0xc8;return function(_0x1455ec){if(_0x1455ec){return _0x49d9dc[_0x9016('0x1c')](_0x1d8c6d)[_0x9016('0x1d')](_0x1455ec);}};}function respondWithFilteredResult(_0x250993,_0x173561){return function(_0x29bd3e){if(_0x29bd3e){var _0x1e47e9=_0x29bd3e['count'],_0x3e4786=_0x173561[_0x9016('0x1e')],_0x2b5e41=_0x173561['offset']+_0x173561[_0x9016('0x1f')],_0x3f5ccb;if(_0x2b5e41>=_0x1e47e9){_0x2b5e41=_0x1e47e9;_0x3f5ccb=0xc8;}else{_0x3f5ccb=0xce;}_0x250993[_0x9016('0x1c')](_0x3f5ccb);return _0x250993[_0x9016('0x20')]('Content-Range',_0x3e4786+'-'+_0x2b5e41+'/'+_0x1e47e9)[_0x9016('0x1d')](_0x29bd3e);}return null;};}function patchUpdates(_0x70f9bb){return function(_0x3ad5ab){try{jsonpatch[_0x9016('0x21')](_0x3ad5ab,_0x70f9bb,!![]);}catch(_0x11964c){return BPromise[_0x9016('0x22')](_0x11964c);}return _0x3ad5ab[_0x9016('0x23')]();};}function saveUpdates(_0x1927aa,_0x556a3b){return function(_0xee9dca){if(_0xee9dca){return _0xee9dca[_0x9016('0x24')](_0x1927aa)[_0x9016('0x25')](function(_0x9c57a1){return _0x9c57a1;});}return null;};}function removeEntity(_0x2fc612,_0x2055a6){return function(_0x2b0370){if(_0x2b0370){return _0x2b0370['destroy']()[_0x9016('0x25')](function(){var _0x394d33=_0x2b0370[_0x9016('0x26')]({'plain':!![]});var _0x4ebe98=_0x9016('0x27');return db[_0x9016('0x28')]['destroy']({'where':{'type':_0x4ebe98,'resourceId':_0x394d33['id']}})['then'](function(){return _0x2b0370;});})['then'](function(){_0x2fc612[_0x9016('0x1c')](0xcc)[_0x9016('0x1b')]();});}};}function handleEntityNotFound(_0x4a50f5,_0x4045d9){return function(_0x23fe95){if(!_0x23fe95){_0x4a50f5[_0x9016('0x1a')](0x194);}return _0x23fe95;};}function handleError(_0x3d93c3,_0x451dc8){_0x451dc8=_0x451dc8||0x1f4;return function(_0x55da3f){logger[_0x9016('0x29')](_0x55da3f['stack']);if(_0x55da3f[_0x9016('0x2a')]){delete _0x55da3f[_0x9016('0x2a')];}_0x3d93c3[_0x9016('0x1c')](_0x451dc8)[_0x9016('0x2b')](_0x55da3f);};}exports[_0x9016('0x2c')]=function(_0x53ac54,_0x3ae64b){var _0x4c3ae9={},_0x5b73d4={},_0x4f1e83={'count':0x0,'rows':[]};var _0x55c9ee=_[_0x9016('0x2d')](db[_0x9016('0x2e')][_0x9016('0x2f')],function(_0x4dbdfd){return{'name':_0x4dbdfd[_0x9016('0x30')],'type':_0x4dbdfd['type'][_0x9016('0x31')]};});_0x5b73d4[_0x9016('0x32')]=_[_0x9016('0x2d')](_0x55c9ee,_0x9016('0x2a'));_0x5b73d4[_0x9016('0x33')]=_[_0x9016('0x34')](_0x53ac54[_0x9016('0x33')]);_0x5b73d4[_0x9016('0x35')]=_['intersection'](_0x5b73d4[_0x9016('0x32')],_0x5b73d4[_0x9016('0x33')]);_0x4c3ae9[_0x9016('0x36')]=_[_0x9016('0x37')](_0x5b73d4[_0x9016('0x32')],qs[_0x9016('0x38')](_0x53ac54[_0x9016('0x33')][_0x9016('0x38')]));_0x4c3ae9[_0x9016('0x36')]=_0x4c3ae9['attributes'][_0x9016('0x39')]?_0x4c3ae9[_0x9016('0x36')]:_0x5b73d4['model'];if(!_0x53ac54[_0x9016('0x33')]['hasOwnProperty']('nolimit')){_0x4c3ae9[_0x9016('0x1f')]=qs[_0x9016('0x1f')](_0x53ac54[_0x9016('0x33')][_0x9016('0x1f')]);_0x4c3ae9[_0x9016('0x1e')]=qs[_0x9016('0x1e')](_0x53ac54['query'][_0x9016('0x1e')]);}_0x4c3ae9[_0x9016('0x3a')]=qs[_0x9016('0x3b')](_0x53ac54[_0x9016('0x33')]['sort']);_0x4c3ae9[_0x9016('0x3c')]=qs[_0x9016('0x35')](_['pick'](_0x53ac54[_0x9016('0x33')],_0x5b73d4[_0x9016('0x35')]));if(_0x53ac54['query']['filter']){_0x4c3ae9[_0x9016('0x3c')]=_['merge'](_0x4c3ae9['where'],{'$or':_['map'](_0x55c9ee,function(_0x23f192){if(_0x23f192['type']!==_0x9016('0x3d')){var _0x5bac9d={};_0x5bac9d[_0x23f192[_0x9016('0x2a')]]={'$like':'%'+_0x53ac54[_0x9016('0x33')][_0x9016('0x3e')]+'%'};return _0x5bac9d;}})});}_0x4c3ae9=_[_0x9016('0x3f')]({},_0x4c3ae9,_0x53ac54[_0x9016('0x40')]);var _0x41249c={'where':_0x4c3ae9[_0x9016('0x3c')]};return db[_0x9016('0x2e')][_0x9016('0x41')](_0x41249c)[_0x9016('0x25')](function(_0x3dee02){_0x4f1e83['count']=_0x3dee02;if(_0x53ac54[_0x9016('0x33')][_0x9016('0x42')]){_0x4c3ae9[_0x9016('0x43')]=[{'all':!![]}];}return db['Pause'][_0x9016('0x44')](_0x4c3ae9);})[_0x9016('0x25')](function(_0x5512a4){_0x4f1e83[_0x9016('0x45')]=_0x5512a4;return _0x4f1e83;})[_0x9016('0x25')](respondWithFilteredResult(_0x3ae64b,_0x4c3ae9))[_0x9016('0x46')](handleError(_0x3ae64b,null));};exports['show']=function(_0x1f563f,_0x12ceba){var _0x4c8107={'raw':!![],'where':{'id':_0x1f563f['params']['id']}},_0x1a2016={};_0x1a2016[_0x9016('0x32')]=_[_0x9016('0x34')](db[_0x9016('0x2e')][_0x9016('0x2f')]);_0x1a2016['query']=_[_0x9016('0x34')](_0x1f563f[_0x9016('0x33')]);_0x1a2016[_0x9016('0x35')]=_[_0x9016('0x37')](_0x1a2016[_0x9016('0x32')],_0x1a2016[_0x9016('0x33')]);_0x4c8107[_0x9016('0x36')]=_[_0x9016('0x37')](_0x1a2016['model'],qs['fields'](_0x1f563f['query']['fields']));_0x4c8107['attributes']=_0x4c8107[_0x9016('0x36')][_0x9016('0x39')]?_0x4c8107[_0x9016('0x36')]:_0x1a2016[_0x9016('0x32')];if(_0x1f563f[_0x9016('0x33')][_0x9016('0x42')]){_0x4c8107[_0x9016('0x43')]=[{'all':!![]}];}_0x4c8107=_[_0x9016('0x3f')]({},_0x4c8107,_0x1f563f[_0x9016('0x40')]);return db['Pause'][_0x9016('0x47')](_0x4c8107)[_0x9016('0x25')](handleEntityNotFound(_0x12ceba,null))[_0x9016('0x25')](respondWithResult(_0x12ceba,null))['catch'](handleError(_0x12ceba,null));};exports['create']=function(_0x2ed1f0,_0x193f46){return db['Pause']['create'](_0x2ed1f0[_0x9016('0x48')],{})[_0x9016('0x25')](function(_0x3e1faf){var _0xda7da3=_0x2ed1f0[_0x9016('0x49')][_0x9016('0x26')]({'plain':!![]});if(!_0xda7da3)throw new Error(_0x9016('0x4a'));if(_0xda7da3[_0x9016('0x4b')]===_0x9016('0x49')){var _0x3aec77=_0x3e1faf[_0x9016('0x26')]({'plain':!![]});var _0x2d8f27='Pauses';return db[_0x9016('0x4c')]['find']({'where':{'name':_0x2d8f27,'userProfileId':_0xda7da3[_0x9016('0x4d')]},'raw':!![]})[_0x9016('0x25')](function(_0x2c2da7){if(_0x2c2da7&&_0x2c2da7['autoAssociation']===0x0){return db[_0x9016('0x28')][_0x9016('0x4e')]({'name':_0x3aec77['name'],'resourceId':_0x3aec77['id'],'type':_0x2c2da7[_0x9016('0x2a')],'sectionId':_0x2c2da7['id']},{})[_0x9016('0x25')](function(){return _0x3e1faf;});}else{return _0x3e1faf;}})[_0x9016('0x46')](function(_0xd8bc0b){logger['error'](_0x9016('0x4f'),_0xd8bc0b);throw _0xd8bc0b;});}return _0x3e1faf;})[_0x9016('0x25')](respondWithResult(_0x193f46,0xc9))[_0x9016('0x46')](handleError(_0x193f46,null));};exports[_0x9016('0x24')]=function(_0x54cba5,_0x2b0184){if(_0x54cba5['body']['id']){delete _0x54cba5[_0x9016('0x48')]['id'];}return db[_0x9016('0x2e')][_0x9016('0x47')]({'where':{'id':_0x54cba5[_0x9016('0x50')]['id']}})[_0x9016('0x25')](handleEntityNotFound(_0x2b0184,null))[_0x9016('0x25')](saveUpdates(_0x54cba5[_0x9016('0x48')],null))[_0x9016('0x25')](respondWithResult(_0x2b0184,null))[_0x9016('0x46')](handleError(_0x2b0184,null));};exports[_0x9016('0x51')]=function(_0x172b28,_0xeed312){return db[_0x9016('0x2e')][_0x9016('0x47')]({'where':{'id':_0x172b28[_0x9016('0x50')]['id']}})[_0x9016('0x25')](handleEntityNotFound(_0xeed312,null))[_0x9016('0x25')](removeEntity(_0xeed312,null))['catch'](handleError(_0xeed312,null));}; \ No newline at end of file +var _0x970e=['error','stack','name','send','index','Pause','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','VIRTUAL','count','includeAll','include','findAll','rows','catch','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','lodash','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../mysqldb','sendStatus','end','json','offset','status','set','Content-Range','apply','reject','save','update','then','get','Pauses','destroy'];(function(_0x1832d0,_0xa436ee){var _0x2db081=function(_0x1af1c4){while(--_0x1af1c4){_0x1832d0['push'](_0x1832d0['shift']());}};_0x2db081(++_0xa436ee);}(_0x970e,0x1c3));var _0xe970=function(_0x2ce736,_0x2586b4){_0x2ce736=_0x2ce736-0x0;var _0x4a73ae=_0x970e[_0x2ce736];return _0x4a73ae;};'use strict';var pdf=require(_0xe970('0x0'));var emlformat=require(_0xe970('0x1'));var rimraf=require(_0xe970('0x2'));var zipdir=require(_0xe970('0x3'));var jsonpatch=require(_0xe970('0x4'));var rp=require('request-promise');var moment=require(_0xe970('0x5'));var BPromise=require(_0xe970('0x6'));var Mustache=require('mustache');var util=require(_0xe970('0x7'));var path=require('path');var sox=require(_0xe970('0x8'));var csv=require(_0xe970('0x9'));var ejs=require(_0xe970('0xa'));var fs=require('fs');var _=require(_0xe970('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe970('0xc'));var toCsv=require(_0xe970('0x9'));var querystring=require(_0xe970('0xd'));var Papa=require(_0xe970('0xe'));var Redis=require('ioredis');var authService=require(_0xe970('0xf'));var qs=require(_0xe970('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe970('0x11'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xe970('0x12'));var db=require(_0xe970('0x13'))['db'];function respondWithStatusCode(_0x3cbe91,_0xc2b4d9){_0xc2b4d9=_0xc2b4d9||0xcc;return function(_0x456023){if(_0x456023){return _0x3cbe91[_0xe970('0x14')](_0xc2b4d9);}return _0x3cbe91['status'](_0xc2b4d9)[_0xe970('0x15')]();};}function respondWithResult(_0x3a769b,_0x2bf810){_0x2bf810=_0x2bf810||0xc8;return function(_0x1000fb){if(_0x1000fb){return _0x3a769b['status'](_0x2bf810)[_0xe970('0x16')](_0x1000fb);}};}function respondWithFilteredResult(_0x26294c,_0x287fdb){return function(_0x329206){if(_0x329206){var _0xdd4687=_0x329206['count'],_0x33d3af=_0x287fdb['offset'],_0x55ed44=_0x287fdb[_0xe970('0x17')]+_0x287fdb['limit'],_0x5bacae;if(_0x55ed44>=_0xdd4687){_0x55ed44=_0xdd4687;_0x5bacae=0xc8;}else{_0x5bacae=0xce;}_0x26294c[_0xe970('0x18')](_0x5bacae);return _0x26294c[_0xe970('0x19')](_0xe970('0x1a'),_0x33d3af+'-'+_0x55ed44+'/'+_0xdd4687)['json'](_0x329206);}return null;};}function patchUpdates(_0x1a2b62){return function(_0x2b8c16){try{jsonpatch[_0xe970('0x1b')](_0x2b8c16,_0x1a2b62,!![]);}catch(_0x2037df){return BPromise[_0xe970('0x1c')](_0x2037df);}return _0x2b8c16[_0xe970('0x1d')]();};}function saveUpdates(_0x32f454,_0x472597){return function(_0x39d800){if(_0x39d800){return _0x39d800[_0xe970('0x1e')](_0x32f454)[_0xe970('0x1f')](function(_0x56a573){return _0x56a573;});}return null;};}function removeEntity(_0x1a8764,_0x4b26fd){return function(_0x39c163){if(_0x39c163){return _0x39c163['destroy']()[_0xe970('0x1f')](function(){var _0x467b75=_0x39c163[_0xe970('0x20')]({'plain':!![]});var _0x1ba0f8=_0xe970('0x21');return db['UserProfileResource'][_0xe970('0x22')]({'where':{'type':_0x1ba0f8,'resourceId':_0x467b75['id']}})[_0xe970('0x1f')](function(){return _0x39c163;});})[_0xe970('0x1f')](function(){_0x1a8764[_0xe970('0x18')](0xcc)[_0xe970('0x15')]();});}};}function handleEntityNotFound(_0x48d448,_0x58a8da){return function(_0x52b380){if(!_0x52b380){_0x48d448['sendStatus'](0x194);}return _0x52b380;};}function handleError(_0x4df897,_0x470862){_0x470862=_0x470862||0x1f4;return function(_0x3fc081){logger[_0xe970('0x23')](_0x3fc081[_0xe970('0x24')]);if(_0x3fc081[_0xe970('0x25')]){delete _0x3fc081['name'];}_0x4df897[_0xe970('0x18')](_0x470862)[_0xe970('0x26')](_0x3fc081);};}exports[_0xe970('0x27')]=function(_0xa8f171,_0x335319){var _0x10896d={},_0x4e569d={},_0x16d403={'count':0x0,'rows':[]};var _0x5c3d86=_['map'](db[_0xe970('0x28')][_0xe970('0x29')],function(_0x3f590b){return{'name':_0x3f590b[_0xe970('0x2a')],'type':_0x3f590b[_0xe970('0x2b')]['key']};});_0x4e569d[_0xe970('0x2c')]=_['map'](_0x5c3d86,_0xe970('0x25'));_0x4e569d[_0xe970('0x2d')]=_[_0xe970('0x2e')](_0xa8f171[_0xe970('0x2d')]);_0x4e569d[_0xe970('0x2f')]=_[_0xe970('0x30')](_0x4e569d[_0xe970('0x2c')],_0x4e569d[_0xe970('0x2d')]);_0x10896d[_0xe970('0x31')]=_[_0xe970('0x30')](_0x4e569d[_0xe970('0x2c')],qs['fields'](_0xa8f171['query'][_0xe970('0x32')]));_0x10896d[_0xe970('0x31')]=_0x10896d['attributes'][_0xe970('0x33')]?_0x10896d[_0xe970('0x31')]:_0x4e569d[_0xe970('0x2c')];if(!_0xa8f171[_0xe970('0x2d')][_0xe970('0x34')](_0xe970('0x35'))){_0x10896d[_0xe970('0x36')]=qs[_0xe970('0x36')](_0xa8f171[_0xe970('0x2d')]['limit']);_0x10896d[_0xe970('0x17')]=qs[_0xe970('0x17')](_0xa8f171['query'][_0xe970('0x17')]);}_0x10896d[_0xe970('0x37')]=qs[_0xe970('0x38')](_0xa8f171[_0xe970('0x2d')][_0xe970('0x38')]);_0x10896d[_0xe970('0x39')]=qs[_0xe970('0x2f')](_[_0xe970('0x3a')](_0xa8f171[_0xe970('0x2d')],_0x4e569d[_0xe970('0x2f')]));if(_0xa8f171[_0xe970('0x2d')][_0xe970('0x3b')]){_0x10896d[_0xe970('0x39')]=_[_0xe970('0x3c')](_0x10896d[_0xe970('0x39')],{'$or':_[_0xe970('0x3d')](_0x5c3d86,function(_0x322db2){if(_0x322db2[_0xe970('0x2b')]!==_0xe970('0x3e')){var _0x202417={};_0x202417[_0x322db2[_0xe970('0x25')]]={'$like':'%'+_0xa8f171[_0xe970('0x2d')]['filter']+'%'};return _0x202417;}})});}_0x10896d=_[_0xe970('0x3c')]({},_0x10896d,_0xa8f171['options']);var _0x2d81c6={'where':_0x10896d[_0xe970('0x39')]};return db[_0xe970('0x28')][_0xe970('0x3f')](_0x2d81c6)['then'](function(_0x2769cf){_0x16d403['count']=_0x2769cf;if(_0xa8f171[_0xe970('0x2d')][_0xe970('0x40')]){_0x10896d[_0xe970('0x41')]=[{'all':!![]}];}return db[_0xe970('0x28')][_0xe970('0x42')](_0x10896d);})[_0xe970('0x1f')](function(_0xc0d253){_0x16d403[_0xe970('0x43')]=_0xc0d253;return _0x16d403;})[_0xe970('0x1f')](respondWithFilteredResult(_0x335319,_0x10896d))[_0xe970('0x44')](handleError(_0x335319,null));};exports['show']=function(_0x3fe57a,_0x23de95){var _0xb025d9={'raw':!![],'where':{'id':_0x3fe57a['params']['id']}},_0x563a50={};_0x563a50[_0xe970('0x2c')]=_[_0xe970('0x2e')](db[_0xe970('0x28')][_0xe970('0x29')]);_0x563a50['query']=_[_0xe970('0x2e')](_0x3fe57a[_0xe970('0x2d')]);_0x563a50[_0xe970('0x2f')]=_[_0xe970('0x30')](_0x563a50[_0xe970('0x2c')],_0x563a50[_0xe970('0x2d')]);_0xb025d9['attributes']=_['intersection'](_0x563a50[_0xe970('0x2c')],qs[_0xe970('0x32')](_0x3fe57a[_0xe970('0x2d')][_0xe970('0x32')]));_0xb025d9[_0xe970('0x31')]=_0xb025d9['attributes'][_0xe970('0x33')]?_0xb025d9['attributes']:_0x563a50['model'];if(_0x3fe57a[_0xe970('0x2d')]['includeAll']){_0xb025d9[_0xe970('0x41')]=[{'all':!![]}];}_0xb025d9=_[_0xe970('0x3c')]({},_0xb025d9,_0x3fe57a[_0xe970('0x45')]);return db[_0xe970('0x28')][_0xe970('0x46')](_0xb025d9)[_0xe970('0x1f')](handleEntityNotFound(_0x23de95,null))[_0xe970('0x1f')](respondWithResult(_0x23de95,null))[_0xe970('0x44')](handleError(_0x23de95,null));};exports[_0xe970('0x47')]=function(_0x414bbb,_0x343f85){return db['Pause'][_0xe970('0x47')](_0x414bbb['body'],{})[_0xe970('0x1f')](function(_0x1a1da8){var _0x26a9d6=_0x414bbb[_0xe970('0x48')][_0xe970('0x20')]({'plain':!![]});if(!_0x26a9d6)throw new Error(_0xe970('0x49'));if(_0x26a9d6[_0xe970('0x4a')]===_0xe970('0x48')){var _0x49935f=_0x1a1da8[_0xe970('0x20')]({'plain':!![]});var _0x5f0f48=_0xe970('0x21');return db[_0xe970('0x4b')]['find']({'where':{'name':_0x5f0f48,'userProfileId':_0x26a9d6['userProfileId']},'raw':!![]})['then'](function(_0x974b1e){if(_0x974b1e&&_0x974b1e[_0xe970('0x4c')]===0x0){return db[_0xe970('0x4d')]['create']({'name':_0x49935f[_0xe970('0x25')],'resourceId':_0x49935f['id'],'type':_0x974b1e[_0xe970('0x25')],'sectionId':_0x974b1e['id']},{})['then'](function(){return _0x1a1da8;});}else{return _0x1a1da8;}})[_0xe970('0x44')](function(_0x1d160d){logger['error'](_0xe970('0x4e'),_0x1d160d);throw _0x1d160d;});}return _0x1a1da8;})[_0xe970('0x1f')](respondWithResult(_0x343f85,0xc9))[_0xe970('0x44')](handleError(_0x343f85,null));};exports[_0xe970('0x1e')]=function(_0x5f547b,_0x2b412d){if(_0x5f547b['body']['id']){delete _0x5f547b[_0xe970('0x4f')]['id'];}return db[_0xe970('0x28')]['find']({'where':{'id':_0x5f547b[_0xe970('0x50')]['id']}})[_0xe970('0x1f')](handleEntityNotFound(_0x2b412d,null))['then'](saveUpdates(_0x5f547b['body'],null))[_0xe970('0x1f')](respondWithResult(_0x2b412d,null))[_0xe970('0x44')](handleError(_0x2b412d,null));};exports[_0xe970('0x22')]=function(_0x578584,_0xc58e78){return db['Pause'][_0xe970('0x46')]({'where':{'id':_0x578584[_0xe970('0x50')]['id']}})['then'](handleEntityNotFound(_0xc58e78,null))[_0xe970('0x1f')](removeEntity(_0xc58e78,null))[_0xe970('0x44')](handleError(_0xc58e78,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 8d79ba3..e86b791 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 _0x15b8=['moment','bluebird','path','rimraf','../../config/environment','./pause.attributes','exports','define','Pause','tools_pauses','util','../../config/logger','api'];(function(_0x4d321a,_0x515ed3){var _0x53914b=function(_0x23f5ab){while(--_0x23f5ab){_0x4d321a['push'](_0x4d321a['shift']());}};_0x53914b(++_0x515ed3);}(_0x15b8,0xcd));var _0x815b=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0x15b8[_0x23e7c1];return _0x1add43;};'use strict';var _=require('lodash');var util=require(_0x815b('0x0'));var logger=require(_0x815b('0x1'))(_0x815b('0x2'));var moment=require(_0x815b('0x3'));var BPromise=require(_0x815b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x815b('0x5'));var rimraf=require(_0x815b('0x6'));var config=require(_0x815b('0x7'));var attributes=require(_0x815b('0x8'));module[_0x815b('0x9')]=function(_0x37a503,_0x581869){return _0x37a503[_0x815b('0xa')](_0x815b('0xb'),attributes,{'tableName':_0x815b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xde9f=['lodash','api','moment','request-promise','path','../../config/environment','./pause.attributes','exports','Pause','tools_pauses'];(function(_0x22b39b,_0x2b7d63){var _0x280e1d=function(_0xc74635){while(--_0xc74635){_0x22b39b['push'](_0x22b39b['shift']());}};_0x280e1d(++_0x2b7d63);}(_0xde9f,0x118));var _0xfde9=function(_0x2aee2f,_0xad9887){_0x2aee2f=_0x2aee2f-0x0;var _0x19337f=_0xde9f[_0x2aee2f];return _0x19337f;};'use strict';var _=require(_0xfde9('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xfde9('0x1'));var moment=require(_0xfde9('0x2'));var BPromise=require('bluebird');var rp=require(_0xfde9('0x3'));var fs=require('fs');var path=require(_0xfde9('0x4'));var rimraf=require('rimraf');var config=require(_0xfde9('0x5'));var attributes=require(_0xfde9('0x6'));module[_0xfde9('0x7')]=function(_0xe30eaf,_0x5e69c0){return _0xe30eaf['define'](_0xfde9('0x8'),attributes,{'tableName':_0xfde9('0x9'),'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 5c57896..ede4f4c 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 _0xabbe=['http','request','info','Pause,\x20%s,\x20%s','request\x20sent','Pause,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Pause','find','options','raw','where','attributes','include','map','model','ShowPause','lodash','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client'];(function(_0x598680,_0x3d8825){var _0x27bc1a=function(_0x260bcb){while(--_0x260bcb){_0x598680['push'](_0x598680['shift']());}};_0x27bc1a(++_0x3d8825);}(_0xabbe,0x70));var _0xeabb=function(_0xc70b4,_0x55199c){_0xc70b4=_0xc70b4-0x0;var _0x526656=_0xabbe[_0xc70b4];return _0x526656;};'use strict';var _=require(_0xeabb('0x0'));var util=require('util');var moment=require(_0xeabb('0x1'));var BPromise=require('bluebird');var rs=require(_0xeabb('0x2'));var fs=require('fs');var Redis=require(_0xeabb('0x3'));var db=require(_0xeabb('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xeabb('0x5'));var config=require(_0xeabb('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xeabb('0x7')][_0xeabb('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x534e4d,_0x3867b5,_0x17386a){return new BPromise(function(_0xe64536,_0x3a7a9c){return client[_0xeabb('0x9')](_0x534e4d,_0x17386a)['then'](function(_0x5ea9c9){logger[_0xeabb('0xa')](_0xeabb('0xb'),_0x3867b5,_0xeabb('0xc'));logger['debug'](_0xeabb('0xd'),_0x3867b5,_0xeabb('0xc'),JSON[_0xeabb('0xe')](_0x5ea9c9));if(_0x5ea9c9[_0xeabb('0xf')]){if(_0x5ea9c9[_0xeabb('0xf')][_0xeabb('0x10')]===0x1f4){logger['error'](_0xeabb('0xb'),_0x3867b5,_0x5ea9c9['error'][_0xeabb('0x11')]);return _0x3a7a9c(_0x5ea9c9[_0xeabb('0xf')][_0xeabb('0x11')]);}logger[_0xeabb('0xf')](_0xeabb('0xb'),_0x3867b5,_0x5ea9c9[_0xeabb('0xf')][_0xeabb('0x11')]);return _0xe64536(_0x5ea9c9['error'][_0xeabb('0x11')]);}else{logger['info'](_0xeabb('0xb'),_0x3867b5,'request\x20sent');_0xe64536(_0x5ea9c9[_0xeabb('0x12')][_0xeabb('0x11')]);}})[_0xeabb('0x13')](function(_0x3a5879){logger[_0xeabb('0xf')]('Pause,\x20%s,\x20%s',_0x3867b5,_0x3a5879);_0x3a7a9c(_0x3a5879);});});}exports['ShowPause']=function(_0x153ea4){var _0x368386=this;return new Promise(function(_0x8412c1,_0x4198ad){return db[_0xeabb('0x14')][_0xeabb('0x15')]({'raw':_0x153ea4['options']?_0x153ea4[_0xeabb('0x16')][_0xeabb('0x17')]===undefined?!![]:![]:!![],'where':_0x153ea4['options']?_0x153ea4[_0xeabb('0x16')][_0xeabb('0x18')]||null:null,'attributes':_0x153ea4[_0xeabb('0x16')]?_0x153ea4[_0xeabb('0x16')][_0xeabb('0x19')]||null:null,'include':_0x153ea4['options']?_0x153ea4[_0xeabb('0x16')][_0xeabb('0x1a')]?_[_0xeabb('0x1b')](_0x153ea4[_0xeabb('0x16')][_0xeabb('0x1a')],function(_0x278e37){return{'model':db[_0x278e37[_0xeabb('0x1c')]],'as':_0x278e37['as'],'attributes':_0x278e37[_0xeabb('0x19')],'include':_0x278e37[_0xeabb('0x1a')]?_['map'](_0x278e37['include'],function(_0x4622e9){return{'model':db[_0x4622e9[_0xeabb('0x1c')]],'as':_0x4622e9['as'],'attributes':_0x4622e9[_0xeabb('0x19')],'include':_0x4622e9[_0xeabb('0x1a')]?_[_0xeabb('0x1b')](_0x4622e9[_0xeabb('0x1a')],function(_0x194977){return{'model':db[_0x194977[_0xeabb('0x1c')]],'as':_0x194977['as'],'attributes':_0x194977[_0xeabb('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5aa82f){logger['info']('ShowPause',_0x153ea4);logger['debug'](_0xeabb('0x1d'),_0x153ea4,JSON[_0xeabb('0xe')](_0x5aa82f));_0x8412c1(_0x5aa82f);})['catch'](function(_0x443846){logger['error'](_0xeabb('0x1d'),_0x443846[_0xeabb('0x11')],_0x153ea4);_0x4198ad(_0x368386[_0xeabb('0xf')](0x1f4,_0x443846[_0xeabb('0x11')]));});});}; \ No newline at end of file +var _0x2b1e=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','request\x20sent','Pause,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Pause,\x20%s,\x20%s','result','catch','ShowPause','find','options','raw','where','attributes','include','map','model','then','debug','lodash','util','bluebird','randomstring','../../mysqldb'];(function(_0xe20378,_0x369a64){var _0x53f198=function(_0x1df1ee){while(--_0x1df1ee){_0xe20378['push'](_0xe20378['shift']());}};_0x53f198(++_0x369a64);}(_0x2b1e,0x19b));var _0xe2b1=function(_0x298f8b,_0x2649f7){_0x298f8b=_0x298f8b-0x0;var _0x4212b4=_0x2b1e[_0x298f8b];return _0x4212b4;};'use strict';var _=require(_0xe2b1('0x0'));var util=require(_0xe2b1('0x1'));var moment=require('moment');var BPromise=require(_0xe2b1('0x2'));var rs=require(_0xe2b1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe2b1('0x4'))['db'];var utils=require(_0xe2b1('0x5'));var logger=require(_0xe2b1('0x6'))(_0xe2b1('0x7'));var config=require(_0xe2b1('0x8'));var jayson=require(_0xe2b1('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x451b49,_0x2e93d4,_0x1d1aa4){return new BPromise(function(_0x2aa768,_0x5b3b7e){return client[_0xe2b1('0xa')](_0x451b49,_0x1d1aa4)['then'](function(_0x4cb063){logger[_0xe2b1('0xb')]('Pause,\x20%s,\x20%s',_0x2e93d4,_0xe2b1('0xc'));logger['debug'](_0xe2b1('0xd'),_0x2e93d4,_0xe2b1('0xc'),JSON[_0xe2b1('0xe')](_0x4cb063));if(_0x4cb063[_0xe2b1('0xf')]){if(_0x4cb063[_0xe2b1('0xf')][_0xe2b1('0x10')]===0x1f4){logger[_0xe2b1('0xf')]('Pause,\x20%s,\x20%s',_0x2e93d4,_0x4cb063[_0xe2b1('0xf')][_0xe2b1('0x11')]);return _0x5b3b7e(_0x4cb063['error'][_0xe2b1('0x11')]);}logger[_0xe2b1('0xf')](_0xe2b1('0x12'),_0x2e93d4,_0x4cb063['error'][_0xe2b1('0x11')]);return _0x2aa768(_0x4cb063[_0xe2b1('0xf')][_0xe2b1('0x11')]);}else{logger[_0xe2b1('0xb')]('Pause,\x20%s,\x20%s',_0x2e93d4,_0xe2b1('0xc'));_0x2aa768(_0x4cb063[_0xe2b1('0x13')][_0xe2b1('0x11')]);}})[_0xe2b1('0x14')](function(_0x386aa2){logger[_0xe2b1('0xf')](_0xe2b1('0x12'),_0x2e93d4,_0x386aa2);_0x5b3b7e(_0x386aa2);});});}exports[_0xe2b1('0x15')]=function(_0x250083){var _0x121e87=this;return new Promise(function(_0xcd60da,_0x41c372){return db['Pause'][_0xe2b1('0x16')]({'raw':_0x250083[_0xe2b1('0x17')]?_0x250083[_0xe2b1('0x17')][_0xe2b1('0x18')]===undefined?!![]:![]:!![],'where':_0x250083[_0xe2b1('0x17')]?_0x250083['options'][_0xe2b1('0x19')]||null:null,'attributes':_0x250083['options']?_0x250083[_0xe2b1('0x17')][_0xe2b1('0x1a')]||null:null,'include':_0x250083[_0xe2b1('0x17')]?_0x250083[_0xe2b1('0x17')][_0xe2b1('0x1b')]?_[_0xe2b1('0x1c')](_0x250083[_0xe2b1('0x17')]['include'],function(_0x152832){return{'model':db[_0x152832[_0xe2b1('0x1d')]],'as':_0x152832['as'],'attributes':_0x152832[_0xe2b1('0x1a')],'include':_0x152832['include']?_['map'](_0x152832[_0xe2b1('0x1b')],function(_0x42f209){return{'model':db[_0x42f209['model']],'as':_0x42f209['as'],'attributes':_0x42f209['attributes'],'include':_0x42f209[_0xe2b1('0x1b')]?_['map'](_0x42f209['include'],function(_0x175687){return{'model':db[_0x175687[_0xe2b1('0x1d')]],'as':_0x175687['as'],'attributes':_0x175687['attributes']};}):[]};}):[]};}):[]:[]})[_0xe2b1('0x1e')](function(_0x57e859){logger[_0xe2b1('0xb')](_0xe2b1('0x15'),_0x250083);logger[_0xe2b1('0x1f')](_0xe2b1('0x15'),_0x250083,JSON['stringify'](_0x57e859));_0xcd60da(_0x57e859);})[_0xe2b1('0x14')](function(_0x220a0f){logger['error'](_0xe2b1('0x15'),_0x220a0f[_0xe2b1('0x11')],_0x250083);_0x41c372(_0x121e87[_0xe2b1('0xf')](0x1f4,_0x220a0f['message']));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index 1d20f03..219cafc 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 _0xf62f=['../../components/auth/service','../../config/environment','./plugin.controller','get','isAuthenticated','index','/webhook','webhookGet','/:id','show','/:id/download','download','root','server/files/plugins','originalname','replace','format','basename','post','single','file','upload','put','update','delete','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x384dfd,_0x54bc76){var _0x5e232c=function(_0x218405){while(--_0x218405){_0x384dfd['push'](_0x384dfd['shift']());}};_0x5e232c(++_0x54bc76);}(_0xf62f,0x13a));var _0xff62=function(_0x4039d5,_0x428608){_0x4039d5=_0x4039d5-0x0;var _0x26d423=_0xf62f[_0x4039d5];return _0x26d423;};'use strict';var multer=require(_0xff62('0x0'));var util=require(_0xff62('0x1'));var path=require(_0xff62('0x2'));var timeout=require(_0xff62('0x3'));var express=require(_0xff62('0x4'));var router=express[_0xff62('0x5')]();var auth=require(_0xff62('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xff62('0x7'));var controller=require(_0xff62('0x8'));router[_0xff62('0x9')]('/',auth[_0xff62('0xa')](),controller[_0xff62('0xb')]);router[_0xff62('0x9')](_0xff62('0xc'),controller[_0xff62('0xd')]);router['get'](_0xff62('0xe'),auth['isAuthenticated'](),controller[_0xff62('0xf')]);router[_0xff62('0x9')](_0xff62('0x10'),auth['isAuthenticated'](),controller[_0xff62('0x11')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1fa252,_0x58f790,_0x4b8bbd){_0x4b8bbd(null,path['join'](config[_0xff62('0x12')],_0xff62('0x13')));},'filename':function(_0x3258d7,_0x1fa6a8,_0x3d4121){_0x1fa6a8[_0xff62('0x14')]=_0x1fa6a8[_0xff62('0x14')][_0xff62('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3d4121(null,util[_0xff62('0x16')]('%s-%s%s',path[_0xff62('0x17')](_0x1fa6a8['originalname'],path['extname'](_0x1fa6a8[_0xff62('0x14')])),Date['now'](),path['extname'](_0x1fa6a8['originalname'])));}})});router[_0xff62('0x18')]('/',upload[_0xff62('0x19')](_0xff62('0x1a')),controller[_0xff62('0x1b')]);router[_0xff62('0x18')](_0xff62('0xc'),controller['webhookPost']);router[_0xff62('0x1c')]('/:id',auth[_0xff62('0xa')](),controller[_0xff62('0x1d')]);router[_0xff62('0x1e')](_0xff62('0xe'),auth[_0xff62('0xa')](),controller['delete']);module[_0xff62('0x1f')]=router; \ No newline at end of file +var _0x8b7e=['join','server/files/plugins','originalname','format','%s-%s%s','basename','extname','now','post','single','upload','webhookPost','update','delete','multer','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','isAuthenticated','get','/webhook','webhookGet','/:id','show','download','diskStorage'];(function(_0x53aec0,_0x550754){var _0x31e4b5=function(_0x5d8463){while(--_0x5d8463){_0x53aec0['push'](_0x53aec0['shift']());}};_0x31e4b5(++_0x550754);}(_0x8b7e,0x16a));var _0xe8b7=function(_0x59a32e,_0xf48643){_0x59a32e=_0x59a32e-0x0;var _0x19e843=_0x8b7e[_0x59a32e];return _0x19e843;};'use strict';var multer=require(_0xe8b7('0x0'));var util=require(_0xe8b7('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe8b7('0x2')]();var auth=require(_0xe8b7('0x3'));var interaction=require(_0xe8b7('0x4'));var config=require(_0xe8b7('0x5'));var controller=require(_0xe8b7('0x6'));router['get']('/',auth[_0xe8b7('0x7')](),controller['index']);router[_0xe8b7('0x8')](_0xe8b7('0x9'),controller[_0xe8b7('0xa')]);router[_0xe8b7('0x8')](_0xe8b7('0xb'),auth[_0xe8b7('0x7')](),controller[_0xe8b7('0xc')]);router[_0xe8b7('0x8')]('/:id/download',auth[_0xe8b7('0x7')](),controller[_0xe8b7('0xd')]);var upload=multer({'storage':multer[_0xe8b7('0xe')]({'destination':function(_0x139830,_0x6fa44b,_0x2dddef){_0x2dddef(null,path[_0xe8b7('0xf')](config['root'],_0xe8b7('0x10')));},'filename':function(_0x4aa128,_0x34b194,_0x176693){_0x34b194[_0xe8b7('0x11')]=_0x34b194[_0xe8b7('0x11')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x176693(null,util[_0xe8b7('0x12')](_0xe8b7('0x13'),path[_0xe8b7('0x14')](_0x34b194[_0xe8b7('0x11')],path[_0xe8b7('0x15')](_0x34b194[_0xe8b7('0x11')])),Date[_0xe8b7('0x16')](),path['extname'](_0x34b194['originalname'])));}})});router[_0xe8b7('0x17')]('/',upload[_0xe8b7('0x18')]('file'),controller[_0xe8b7('0x19')]);router[_0xe8b7('0x17')](_0xe8b7('0x9'),controller[_0xe8b7('0x1a')]);router['put'](_0xe8b7('0xb'),auth['isAuthenticated'](),controller[_0xe8b7('0x1b')]);router[_0xe8b7('0x1c')](_0xe8b7('0xb'),auth[_0xe8b7('0x7')](),controller['delete']);module['exports']=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 2cff2fb..b129599 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 _0xecf0=['Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','exports','STRING','ENUM','script','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','agentOnly','always','never'];(function(_0x1391a8,_0x4e2f7f){var _0x1e3519=function(_0x1ad406){while(--_0x1ad406){_0x1391a8['push'](_0x1391a8['shift']());}};_0x1e3519(++_0x4e2f7f);}(_0xecf0,0x1a3));var _0x0ecf=function(_0x11ee94,_0x2f1d8b){_0x11ee94=_0x11ee94-0x0;var _0x3a1623=_0xecf0[_0x11ee94];return _0x3a1623;};'use strict';var Sequelize=require('sequelize');module[_0x0ecf('0x0')]={'name':{'type':Sequelize[_0x0ecf('0x1')]},'type':{'type':Sequelize[_0x0ecf('0x2')]('html',_0x0ecf('0x3'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize[_0x0ecf('0x1')],'comment':_0x0ecf('0x4')},'active':{'type':Sequelize[_0x0ecf('0x5')],'defaultValue':0x0,'comment':_0x0ecf('0x6')},'sidebar':{'type':Sequelize[_0x0ecf('0x2')]('adminOnly',_0x0ecf('0x7'),_0x0ecf('0x8'),_0x0ecf('0x9')),'defaultValue':_0x0ecf('0x8'),'comment':_0x0ecf('0xa')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize[_0x0ecf('0x1')]},'agentUrl':{'type':Sequelize[_0x0ecf('0x1')]},'scriptName':{'type':Sequelize[_0x0ecf('0x1')]},'scriptPath':{'type':Sequelize[_0x0ecf('0x1')]}}; \ No newline at end of file +var _0xe805=['The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','exports','STRING','ENUM','script'];(function(_0x2595a6,_0x48fc45){var _0x460197=function(_0x18f9db){while(--_0x18f9db){_0x2595a6['push'](_0x2595a6['shift']());}};_0x460197(++_0x48fc45);}(_0xe805,0x9e));var _0x5e80=function(_0xc8ee09,_0x4e6369){_0xc8ee09=_0xc8ee09-0x0;var _0x4161cf=_0xe805[_0xc8ee09];return _0x4161cf;};'use strict';var Sequelize=require('sequelize');module[_0x5e80('0x0')]={'name':{'type':Sequelize[_0x5e80('0x1')]},'type':{'type':Sequelize[_0x5e80('0x2')]('html',_0x5e80('0x3'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize['STRING'],'comment':_0x5e80('0x4')},'active':{'type':Sequelize[_0x5e80('0x5')],'defaultValue':0x0,'comment':_0x5e80('0x6')},'sidebar':{'type':Sequelize[_0x5e80('0x2')](_0x5e80('0x7'),_0x5e80('0x8'),'always','never'),'defaultValue':'always','comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize[_0x5e80('0x1')]},'agentUrl':{'type':Sequelize[_0x5e80('0x1')]},'scriptName':{'type':Sequelize[_0x5e80('0x1')]},'scriptPath':{'type':Sequelize[_0x5e80('0x1')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index d004b2e..8316062 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 _0xaddd=['script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','icon','html','admin','test','Warning:\x20admin\x20view\x20not\x20specified','plugins','Warning:\x20agent\x20view\x20not\x20specified','create','role','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','unlinkSync','Extracted\x20folder\x20removed','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','set','endsWith','statusCode','webhookPost','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','lodash','squel','jsforce','desk.js','papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','./plugin.socket','register','sendStatus','status','count','offset','Content-Range','json','reject','update','then','destroy','get','Plugins','end','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','filters','pick','filter','merge','where','type','VIRTUAL','options','includeAll','include','Plugin','findAll','rows','show','params','find','catch','download','join','server/files/plugins','format','%s.zip','basename','createWriteStream','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','dirname','node_modules/**/*','attachments/**/*','finalize','existsSync','Error\x20while\x20downloading\x20the\x20plugin','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','extname','root','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','undefined','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','views','Invalid\x20manifest:\x20views\x20missing','agent','Invalid\x20manifest:\x20no\x20view\x20specified'];(function(_0x4fa291,_0x56e289){var _0x506d9b=function(_0x24c31f){while(--_0x24c31f){_0x4fa291['push'](_0x4fa291['shift']());}};_0x506d9b(++_0x56e289);}(_0xaddd,0x18e));var _0xdadd=function(_0x5b311b,_0x3e0280){_0x5b311b=_0x5b311b-0x0;var _0x4fa0de=_0xaddd[_0x5b311b];return _0x4fa0de;};'use strict';var pdf=require(_0xdadd('0x0'));var emlformat=require(_0xdadd('0x1'));var rimraf=require(_0xdadd('0x2'));var zipdir=require(_0xdadd('0x3'));var jsonpatch=require(_0xdadd('0x4'));var rp=require(_0xdadd('0x5'));var moment=require(_0xdadd('0x6'));var BPromise=require(_0xdadd('0x7'));var Mustache=require(_0xdadd('0x8'));var util=require('util');var path=require(_0xdadd('0x9'));var sox=require('sox');var csv=require(_0xdadd('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xdadd('0xb'));var squel=require(_0xdadd('0xc'));var crypto=require('crypto');var jsforce=require(_0xdadd('0xd'));var deskjs=require(_0xdadd('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xdadd('0xf'));var extract=require(_0xdadd('0x10'));var rimraf=require(_0xdadd('0x2'));var archiver=require(_0xdadd('0x11'));var Redis=require(_0xdadd('0x12'));var authService=require(_0xdadd('0x13'));var qs=require(_0xdadd('0x14'));var as=require(_0xdadd('0x15'));var hardwareService=require(_0xdadd('0x16'));var logger=require(_0xdadd('0x17'))(_0xdadd('0x18'));var utils=require(_0xdadd('0x19'));var config=require(_0xdadd('0x1a'));var db=require(_0xdadd('0x1b'))['db'];config['redis']=_[_0xdadd('0x1c')](config['redis'],{'host':_0xdadd('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xdadd('0x1e'))[_0xdadd('0x1f')](socket);function respondWithStatusCode(_0x3855a6,_0x55fce5){_0x55fce5=_0x55fce5||0xcc;return function(_0x5536bf){if(_0x5536bf){return _0x3855a6[_0xdadd('0x20')](_0x55fce5);}return _0x3855a6[_0xdadd('0x21')](_0x55fce5)['end']();};}function respondWithResult(_0x236e6d,_0x5f0aeb){_0x5f0aeb=_0x5f0aeb||0xc8;return function(_0x153658){if(_0x153658){return _0x236e6d[_0xdadd('0x21')](_0x5f0aeb)['json'](_0x153658);}};}function respondWithFilteredResult(_0x1560db,_0x51c859){return function(_0x5efb05){if(_0x5efb05){var _0x4169ed=_0x5efb05[_0xdadd('0x22')],_0x5c9edf=_0x51c859[_0xdadd('0x23')],_0x3aa5c3=_0x51c859['offset']+_0x51c859['limit'],_0x322415;if(_0x3aa5c3>=_0x4169ed){_0x3aa5c3=_0x4169ed;_0x322415=0xc8;}else{_0x322415=0xce;}_0x1560db[_0xdadd('0x21')](_0x322415);return _0x1560db['set'](_0xdadd('0x24'),_0x5c9edf+'-'+_0x3aa5c3+'/'+_0x4169ed)[_0xdadd('0x25')](_0x5efb05);}return null;};}function patchUpdates(_0x2aa502){return function(_0x31c9b3){try{jsonpatch['apply'](_0x31c9b3,_0x2aa502,!![]);}catch(_0x23e551){return BPromise[_0xdadd('0x26')](_0x23e551);}return _0x31c9b3['save']();};}function saveUpdates(_0x54a18f,_0x53df88){return function(_0x5aa83f){if(_0x5aa83f){return _0x5aa83f[_0xdadd('0x27')](_0x54a18f)[_0xdadd('0x28')](function(_0x551903){return _0x551903;});}return null;};}function removeEntity(_0x48646d,_0xf72908){return function(_0x11cc9d){if(_0x11cc9d){return _0x11cc9d[_0xdadd('0x29')]()[_0xdadd('0x28')](function(){var _0x29aa89=_0x11cc9d[_0xdadd('0x2a')]({'plain':!![]});var _0x86969b=_0xdadd('0x2b');return db['UserProfileResource'][_0xdadd('0x29')]({'where':{'type':_0x86969b,'resourceId':_0x29aa89['id']}})[_0xdadd('0x28')](function(){return _0x11cc9d;});})[_0xdadd('0x28')](function(){_0x48646d[_0xdadd('0x21')](0xcc)[_0xdadd('0x2c')]();});}};}function handleEntityNotFound(_0x3b39db,_0x2b9eff){return function(_0x2587f7){if(!_0x2587f7){_0x3b39db[_0xdadd('0x20')](0x194);}return _0x2587f7;};}function handleError(_0xe356fb,_0x3d9851){_0x3d9851=_0x3d9851||0x1f4;return function(_0x402e14){logger[_0xdadd('0x2d')](_0x402e14[_0xdadd('0x2e')]);if(_0x402e14[_0xdadd('0x2f')]){delete _0x402e14[_0xdadd('0x2f')];}_0xe356fb[_0xdadd('0x21')](_0x3d9851)[_0xdadd('0x30')](_0x402e14);};}exports[_0xdadd('0x31')]=function(_0x1e487f,_0xdeb687){var _0x1e4cd8={},_0xacc800={},_0x4bc9ed={'count':0x0,'rows':[]};var _0x23b945=_[_0xdadd('0x32')](db['Plugin'][_0xdadd('0x33')],function(_0x116754){return{'name':_0x116754[_0xdadd('0x34')],'type':_0x116754['type'][_0xdadd('0x35')]};});_0xacc800[_0xdadd('0x36')]=_['map'](_0x23b945,_0xdadd('0x2f'));_0xacc800['query']=_[_0xdadd('0x37')](_0x1e487f[_0xdadd('0x38')]);_0xacc800['filters']=_[_0xdadd('0x39')](_0xacc800[_0xdadd('0x36')],_0xacc800[_0xdadd('0x38')]);_0x1e4cd8[_0xdadd('0x3a')]=_['intersection'](_0xacc800[_0xdadd('0x36')],qs['fields'](_0x1e487f[_0xdadd('0x38')][_0xdadd('0x3b')]));_0x1e4cd8[_0xdadd('0x3a')]=_0x1e4cd8[_0xdadd('0x3a')][_0xdadd('0x3c')]?_0x1e4cd8[_0xdadd('0x3a')]:_0xacc800[_0xdadd('0x36')];if(!_0x1e487f[_0xdadd('0x38')][_0xdadd('0x3d')](_0xdadd('0x3e'))){_0x1e4cd8[_0xdadd('0x3f')]=qs[_0xdadd('0x3f')](_0x1e487f[_0xdadd('0x38')][_0xdadd('0x3f')]);_0x1e4cd8[_0xdadd('0x23')]=qs[_0xdadd('0x23')](_0x1e487f['query']['offset']);}_0x1e4cd8['order']=qs[_0xdadd('0x40')](_0x1e487f[_0xdadd('0x38')][_0xdadd('0x40')]);_0x1e4cd8['where']=qs[_0xdadd('0x41')](_[_0xdadd('0x42')](_0x1e487f[_0xdadd('0x38')],_0xacc800['filters']));if(_0x1e487f[_0xdadd('0x38')][_0xdadd('0x43')]){_0x1e4cd8['where']=_[_0xdadd('0x44')](_0x1e4cd8[_0xdadd('0x45')],{'$or':_[_0xdadd('0x32')](_0x23b945,function(_0x3aef49){if(_0x3aef49[_0xdadd('0x46')]!==_0xdadd('0x47')){var _0x6af547={};_0x6af547[_0x3aef49[_0xdadd('0x2f')]]={'$like':'%'+_0x1e487f[_0xdadd('0x38')][_0xdadd('0x43')]+'%'};return _0x6af547;}})});}_0x1e4cd8=_[_0xdadd('0x44')]({},_0x1e4cd8,_0x1e487f[_0xdadd('0x48')]);var _0x36b01d={'where':_0x1e4cd8['where']};return db['Plugin']['count'](_0x36b01d)['then'](function(_0x5c0a21){_0x4bc9ed[_0xdadd('0x22')]=_0x5c0a21;if(_0x1e487f[_0xdadd('0x38')][_0xdadd('0x49')]){_0x1e4cd8[_0xdadd('0x4a')]=[{'all':!![]}];}return db[_0xdadd('0x4b')][_0xdadd('0x4c')](_0x1e4cd8);})[_0xdadd('0x28')](function(_0x167686){_0x4bc9ed[_0xdadd('0x4d')]=_0x167686;return _0x4bc9ed;})['then'](respondWithFilteredResult(_0xdeb687,_0x1e4cd8))['catch'](handleError(_0xdeb687,null));};exports[_0xdadd('0x4e')]=function(_0x2dc3fa,_0x4924a5){var _0x2cbd64={'raw':!![],'where':{'id':_0x2dc3fa[_0xdadd('0x4f')]['id']}},_0x5bbcd6={};_0x5bbcd6[_0xdadd('0x36')]=_[_0xdadd('0x37')](db['Plugin'][_0xdadd('0x33')]);_0x5bbcd6[_0xdadd('0x38')]=_[_0xdadd('0x37')](_0x2dc3fa['query']);_0x5bbcd6[_0xdadd('0x41')]=_[_0xdadd('0x39')](_0x5bbcd6['model'],_0x5bbcd6[_0xdadd('0x38')]);_0x2cbd64[_0xdadd('0x3a')]=_['intersection'](_0x5bbcd6[_0xdadd('0x36')],qs[_0xdadd('0x3b')](_0x2dc3fa[_0xdadd('0x38')][_0xdadd('0x3b')]));_0x2cbd64[_0xdadd('0x3a')]=_0x2cbd64[_0xdadd('0x3a')][_0xdadd('0x3c')]?_0x2cbd64[_0xdadd('0x3a')]:_0x5bbcd6[_0xdadd('0x36')];if(_0x2dc3fa[_0xdadd('0x38')][_0xdadd('0x49')]){_0x2cbd64[_0xdadd('0x4a')]=[{'all':!![]}];}_0x2cbd64=_[_0xdadd('0x44')]({},_0x2cbd64,_0x2dc3fa[_0xdadd('0x48')]);return db['Plugin'][_0xdadd('0x50')](_0x2cbd64)['then'](handleEntityNotFound(_0x4924a5,null))[_0xdadd('0x28')](respondWithResult(_0x4924a5,null))[_0xdadd('0x51')](handleError(_0x4924a5,null));};exports[_0xdadd('0x52')]=function(_0x12e122,_0xd53634,_0x4e8be6){return db['Plugin'][_0xdadd('0x50')]({'where':{'id':_0x12e122[_0xdadd('0x4f')]['id']},'attributes':[_0xdadd('0x2f'),_0xdadd('0x9')],'raw':!![]})[_0xdadd('0x28')](handleEntityNotFound(_0xd53634,null))[_0xdadd('0x28')](function(_0x2216b6){if(_0x2216b6){var _0x21aad7=path[_0xdadd('0x53')](config['root'],_0xdadd('0x54'),util[_0xdadd('0x55')](_0xdadd('0x56'),path[_0xdadd('0x57')](_0x2216b6['path'])));var _0x4d1be6=fs[_0xdadd('0x58')](_0x21aad7);var _0x5593a0=archiver('zip',{'zlib':{'level':0x9}});_0x5593a0['on'](_0xdadd('0x59'),function(_0x49cece){if(_0x49cece[_0xdadd('0x5a')]===_0xdadd('0x5b')){logger[_0xdadd('0x2d')](_0x49cece);}else{throw new db[(_0xdadd('0x5c'))][(_0xdadd('0x5d'))](_0xdadd('0x5e'));}});_0x5593a0['on'](_0xdadd('0x2d'),function(_0xe68082){throw new db[(_0xdadd('0x5c'))][(_0xdadd('0x5d'))](_0xdadd('0x5e'));});_0x5593a0[_0xdadd('0x5f')](_0x4d1be6);_0x5593a0[_0xdadd('0x60')]('**/*',{'cwd':path['join'](config['root'],_0xdadd('0x54'),path[_0xdadd('0x61')](_0x2216b6[_0xdadd('0x9')])),'ignore':[path[_0xdadd('0x53')](path['basename'](_0x2216b6[_0xdadd('0x9')]),_0xdadd('0x62')),path['join'](path[_0xdadd('0x57')](_0x2216b6[_0xdadd('0x9')]),_0xdadd('0x63'))],'nodir':!![]})[_0xdadd('0x64')]();_0x4d1be6['on']('close',function(){if(!fs[_0xdadd('0x65')](_0x21aad7)){throw new db[(_0xdadd('0x5c'))][(_0xdadd('0x5d'))]('Plugin\x20not\x20found');}return _0xd53634['download'](_0x21aad7,util[_0xdadd('0x55')](_0xdadd('0x56'),path[_0xdadd('0x57')](_0x2216b6[_0xdadd('0x9')])),function(_0x435f9b){if(_0x435f9b){throw new db[(_0xdadd('0x5c'))][(_0xdadd('0x5d'))](_0xdadd('0x66'));}fs['unlinkSync'](_0x21aad7);logger[_0xdadd('0x67')](_0xdadd('0x68'));logger[_0xdadd('0x67')](_0xdadd('0x69'));});});}return null;})[_0xdadd('0x51')](handleError(_0xd53634,null));};exports[_0xdadd('0x6a')]=function(_0x2a65cb,_0x1ab718,_0x428dcc){var _0x3419bd=path['basename'](_0x2a65cb[_0xdadd('0x6b')][_0xdadd('0x6c')],path[_0xdadd('0x6d')](_0x2a65cb['file'][_0xdadd('0x6c')]));var _0x4be906=path['join'](config[_0xdadd('0x6e')],_0xdadd('0x54'),_0x2a65cb[_0xdadd('0x6b')][_0xdadd('0x6c')]);var _0x202eaf=path[_0xdadd('0x53')](config[_0xdadd('0x6e')],_0xdadd('0x54'),_0x3419bd);logger[_0xdadd('0x67')](_0xdadd('0x6f'),_0x4be906);logger[_0xdadd('0x67')](_0xdadd('0x70'),_0x202eaf);try{fs[_0xdadd('0x71')](_0x4be906,parseInt(_0xdadd('0x72'),0x8));extract(_0x4be906,{'dir':_0x202eaf},function(_0xa68e30){if(_0xa68e30){logger[_0xdadd('0x2d')](_0xa68e30);handleError(_0xa68e30,!![]);};var _0x54fee0=fs[_0xdadd('0x73')](_0x202eaf);if(_0x54fee0[_0xdadd('0x3c')]>0x1){removeReferences(_0x4be906,_0x202eaf);logger['error']('Invalid\x20plugin\x20structure');return _0x428dcc(new Error(_0xdadd('0x74')));}var _0x3806a5=fs['lstatSync'](path['join'](_0x202eaf,_0x54fee0[0x0]));if(_0x3806a5['isFile']()){removeReferences(_0x4be906,_0x202eaf);logger[_0xdadd('0x2d')]('Invalid\x20plugin\x20structure');return _0x428dcc(new Error(_0xdadd('0x74')));}if(_0x3806a5[_0xdadd('0x75')]()){var _0x145394=fs[_0xdadd('0x73')](path[_0xdadd('0x53')](_0x202eaf,_0x54fee0[0x0]));if(_0x145394[_0xdadd('0x3c')]===0x0){removeReferences(_0x4be906,_0x202eaf);logger[_0xdadd('0x2d')]('Invalid\x20plugin\x20structure');return _0x428dcc(new Error('Invalid\x20plugin\x20structure'));}var _0x11d4de=_0x145394[_0xdadd('0x76')](function(_0x3dc8e6){return _0x3dc8e6===_0xdadd('0x77');});if(!_0x11d4de){return _0x428dcc(new Error(_0xdadd('0x78')));}var _0x325bb1=fs[_0xdadd('0x79')](path['join'](_0x202eaf,_0x54fee0[0x0],_0xdadd('0x77')));var _0x165635=JSON[_0xdadd('0x7a')](_0x325bb1);if(_0xdadd('0x7b')==typeof _0x165635['name']){return _0x428dcc(new Error(_0xdadd('0x7c')));}if('undefined'==typeof _0x165635[_0xdadd('0x46')]){return _0x428dcc(new Error(_0xdadd('0x7d')));}if(_0xdadd('0x7b')==typeof _0x165635[_0xdadd('0x7e')]){return _0x428dcc(new Error(_0xdadd('0x7f')));}if('undefined'==typeof _0x165635[_0xdadd('0x80')]){return _0x428dcc(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x165635[_0xdadd('0x46')]==='html'){if('undefined'==typeof _0x165635[_0xdadd('0x80')][_0xdadd('0x81')]){return _0x428dcc(new Error(_0xdadd('0x82')));}if(_0xdadd('0x7b')==typeof _0x165635['parameters']['views']['admin']&&'undefined'==typeof _0x165635[_0xdadd('0x80')][_0xdadd('0x81')][_0xdadd('0x83')]){return _0x428dcc(new Error(_0xdadd('0x84')));}}else if(_0x165635[_0xdadd('0x46')]===_0xdadd('0x85')){if('undefined'==typeof _0x165635[_0xdadd('0x80')][_0xdadd('0x86')]){return _0x428dcc(new Error(_0xdadd('0x87')));}if('undefined'==typeof _0x165635[_0xdadd('0x80')][_0xdadd('0x88')]){return _0x428dcc(new Error(_0xdadd('0x89')));}}else{return _0x428dcc(new Error(_0xdadd('0x8a')));}var _0x40735c=_0x165635[_0xdadd('0x2f')];var _0x489767=_0x165635[_0xdadd('0x8b')];var _0x350c96=_0x165635['type'];var _0x2425c7=_0x165635[_0xdadd('0x8c')]?_0x165635[_0xdadd('0x8c')]:'always';var _0x237050=_0x165635['icon']?_0x165635[_0xdadd('0x8d')]:'icon-apps';var _0x9c9efa='';var _0x491227='';var _0x230e22='';var _0x1477a6='';var _0x4ac079=_0x165635[_0xdadd('0x7e')];if(_0x350c96===_0xdadd('0x8e')){if(_0xdadd('0x7b')!=typeof _0x165635['parameters'][_0xdadd('0x81')][_0xdadd('0x8f')]){var _0x2a642b=_0x165635['parameters']['views']['admin'];if(!/^(f|ht)tps?:\/\//i[_0xdadd('0x90')](_0x2a642b)){_0x9c9efa=path['join']('plugins',_0x3419bd,_0x54fee0[0x0],_0x2a642b);}else{_0x9c9efa=_0x2a642b;}}else{logger[_0xdadd('0x67')](_0xdadd('0x91'));}if(_0xdadd('0x7b')!=typeof _0x165635[_0xdadd('0x80')][_0xdadd('0x81')][_0xdadd('0x83')]){var _0x4bba5f=_0x165635[_0xdadd('0x80')][_0xdadd('0x81')][_0xdadd('0x83')];if(!/^(f|ht)tps?:\/\//i[_0xdadd('0x90')](_0x4bba5f)){_0x491227=path[_0xdadd('0x53')](_0xdadd('0x92'),_0x3419bd,_0x54fee0[0x0],_0x4bba5f);}else{_0x491227=_0x4bba5f;}}else{logger[_0xdadd('0x67')](_0xdadd('0x93'));}}else if(_0x350c96===_0xdadd('0x85')){_0x230e22=_0x165635['parameters']['scriptName'];_0x1477a6=_0x165635[_0xdadd('0x80')][_0xdadd('0x88')];if('undefined'!=typeof _0x165635[_0xdadd('0x80')][_0xdadd('0x81')]){if(_0xdadd('0x7b')!=typeof _0x165635[_0xdadd('0x80')][_0xdadd('0x81')][_0xdadd('0x8f')]){var _0x2a642b=_0x165635[_0xdadd('0x80')][_0xdadd('0x81')][_0xdadd('0x8f')];if(!/^(f|ht)tps?:\/\//i['test'](_0x2a642b)){_0x9c9efa=path[_0xdadd('0x53')](_0xdadd('0x92'),_0x3419bd,_0x54fee0[0x0],_0x2a642b);}else{_0x9c9efa=_0x2a642b;}}if(_0xdadd('0x7b')!=typeof _0x165635[_0xdadd('0x80')][_0xdadd('0x81')][_0xdadd('0x83')]){var _0x4bba5f=_0x165635[_0xdadd('0x80')]['views'][_0xdadd('0x83')];if(!/^(f|ht)tps?:\/\//i['test'](_0x4bba5f)){_0x491227=path['join'](_0xdadd('0x92'),_0x3419bd,_0x54fee0[0x0],_0x4bba5f);}else{_0x491227=_0x4bba5f;}}}}var _0x186320={'name':_0x40735c,'description':_0x489767,'path':path[_0xdadd('0x53')](_0x3419bd,_0x54fee0[0x0]),'type':_0x350c96,'sidebar':_0x2425c7,'icon':_0x237050,'adminUrl':_0x9c9efa,'agentUrl':_0x491227,'scriptName':_0x230e22,'scriptPath':_0x1477a6,'version':_0x4ac079};removeReferences(_0x4be906,null);return db['Plugin'][_0xdadd('0x94')](_0x186320)['then'](function(_0x2faac3){var _0x212e2d={'role':_0x2a65cb['body'][_0xdadd('0x95')],'userProfileId':_0x2a65cb[_0xdadd('0x96')]['userProfileId']};if(!_0x212e2d)throw new Error(_0xdadd('0x97'));if(_0x212e2d[_0xdadd('0x95')]==='user'){var _0x404534=_0x2faac3[_0xdadd('0x2a')]({'plain':!![]});return db[_0xdadd('0x98')]['find']({'where':{'name':'Plugins','userProfileId':_0x212e2d[_0xdadd('0x99')]},'raw':!![]})[_0xdadd('0x28')](function(_0x10751d){if(_0x10751d&&_0x10751d[_0xdadd('0x9a')]===0x0){return db[_0xdadd('0x9b')][_0xdadd('0x94')]({'name':_0x404534[_0xdadd('0x2f')],'resourceId':_0x404534['id'],'type':_0x10751d[_0xdadd('0x2f')],'sectionId':_0x10751d['id']},{})[_0xdadd('0x28')](function(){return _0x2faac3;});}else{return _0x2faac3;}})[_0xdadd('0x51')](function(_0x2551da){logger[_0xdadd('0x2d')](_0xdadd('0x9c'),_0x2551da);throw _0x2551da;});}return _0x2faac3;})['then'](respondWithResult(_0x1ab718,null))[_0xdadd('0x51')](handleError(_0x1ab718,null));}});}catch(_0x3d911a){_0x1ab718[_0xdadd('0x21')](0x1f4)[_0xdadd('0x30')](_0x3d911a);}};function removeReferences(_0x247806,_0xce1b1c){try{if(_0x247806){fs[_0xdadd('0x9d')](_0x247806);logger[_0xdadd('0x67')]('Zip\x20archive\x20removed');}if(_0xce1b1c){rimraf(_0xce1b1c,function(){});logger[_0xdadd('0x67')](_0xdadd('0x9e'));}}catch(_0x4353c6){logger['error'](_0x4353c6);}}exports[_0xdadd('0x27')]=function(_0x547cf9,_0x4a605e,_0x257384){return db[_0xdadd('0x4b')][_0xdadd('0x50')]({'where':{'id':_0x547cf9['params']['id']}})[_0xdadd('0x28')](handleEntityNotFound(_0x4a605e,null))['then'](saveUpdates(_0x547cf9['body'],null))[_0xdadd('0x28')](respondWithResult(_0x4a605e,null))[_0xdadd('0x51')](handleError(_0x4a605e,null));};exports[_0xdadd('0x9f')]=function(_0x486135,_0x53cc9d,_0x432e7d){return db['Plugin'][_0xdadd('0x50')]({'where':{'id':_0x486135[_0xdadd('0x4f')]['id']}})[_0xdadd('0x28')](function(_0x325db6){if(_0x325db6){return _0x325db6['destroy']();}})[_0xdadd('0x28')](function(_0x178282){rimraf(path['join'](config[_0xdadd('0x6e')],_0xdadd('0x54'),path['dirname'](_0x178282[_0xdadd('0x9')])),function(){});return _0x178282;})[_0xdadd('0x28')](handleEntityNotFound(_0x53cc9d,null))[_0xdadd('0x28')](respondWithStatusCode(_0x53cc9d,null))[_0xdadd('0x51')](handleError(_0x53cc9d,null));};exports[_0xdadd('0xa0')]=function(_0xe18685,_0x3ed3bc,_0x663d7b){return BPromise[_0xdadd('0xa1')]()[_0xdadd('0x28')](function(){if(!_0xe18685[_0xdadd('0x38')][_0xdadd('0x9')]){throw new Error(_0xdadd('0xa2'));}if(!_0xe18685[_0xdadd('0x38')][_0xdadd('0xa3')]){throw new Error(_0xdadd('0xa4'));}var _0x582d03=_0xe18685[_0xdadd('0x38')][_0xdadd('0xa5')]?_0xe18685[_0xdadd('0x38')][_0xdadd('0xa5')]+':'+_0xe18685[_0xdadd('0x38')]['port']:_0xdadd('0xa6')+_0xe18685[_0xdadd('0x38')]['port'];var _0x1149ea=_0xe18685[_0xdadd('0x38')][_0xdadd('0x25')]?_0xe18685[_0xdadd('0x38')][_0xdadd('0x25')]:!![];var _0x32a5a9=_0xe18685['query'][_0xdadd('0xa7')]?_0xe18685[_0xdadd('0x38')][_0xdadd('0xa7')]:null;var _0x2749fe={'method':_0xe18685[_0xdadd('0xa8')],'uri':util['format'](_0xdadd('0xa9'),_0x582d03,_0xe18685['query']['path']),'json':_0x1149ea,'resolveWithFullResponse':!![],'encoding':_0x32a5a9,'qs':_0xe18685['query']};if(_0xe18685[_0xdadd('0xaa')]){_0x2749fe[_0xdadd('0xaa')]=_0xe18685[_0xdadd('0xaa')];if(_0x2749fe['headers'][_0xdadd('0xab')]){delete _0x2749fe['headers'][_0xdadd('0xab')];}}if(_0x2749fe['headers'][_0xdadd('0xac')]){delete _0x2749fe[_0xdadd('0xaa')][_0xdadd('0xac')];}return rp(_0x2749fe);})[_0xdadd('0x28')](function(_0x5ac287){if(_0x5ac287){_0x3ed3bc[_0xdadd('0xad')](_0x5ac287[_0xdadd('0xaa')]);logger[_0xdadd('0x67')](_0x5ac287['body']);if(_[_0xdadd('0xae')](_0xe18685[_0xdadd('0x38')][_0xdadd('0x9')],_0xdadd('0x52'))&&_0x5ac287[_0xdadd('0xaf')]==0x1f4){return _0x3ed3bc['sendStatus'](_0x5ac287['statusCode']);}else{return _0x3ed3bc[_0xdadd('0x21')](_0x5ac287['statusCode'])[_0xdadd('0x30')](_0x5ac287[_0xdadd('0x96')]);}}else{return _0x3ed3bc['sendStatus'](0xc8);}})[_0xdadd('0x51')](handleError(_0x3ed3bc,null));};exports[_0xdadd('0xb0')]=function(_0x4c5ae7,_0x405452,_0x49d2b6){return BPromise[_0xdadd('0xa1')]()[_0xdadd('0x28')](function(){if(!_0x4c5ae7[_0xdadd('0x38')][_0xdadd('0x9')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x4c5ae7[_0xdadd('0x38')]['port']){throw new Error(_0xdadd('0xa4'));}var _0x5de8a6=_0x4c5ae7[_0xdadd('0x38')][_0xdadd('0xa5')]?_0x4c5ae7[_0xdadd('0x38')][_0xdadd('0xa5')]+':'+_0x4c5ae7[_0xdadd('0x38')][_0xdadd('0xa3')]:_0xdadd('0xa6')+_0x4c5ae7[_0xdadd('0x38')][_0xdadd('0xa3')];var _0x1917e7=_0x4c5ae7['query']['json']?_0x4c5ae7[_0xdadd('0x38')]['json']:!![];var _0x55d5d0=_0x4c5ae7[_0xdadd('0x38')][_0xdadd('0xa7')]?_0x4c5ae7[_0xdadd('0x38')][_0xdadd('0xa7')]:null;var _0x414361={'method':_0x4c5ae7[_0xdadd('0xa8')],'uri':util['format']('%s%s',_0x5de8a6,_0x4c5ae7['query'][_0xdadd('0x9')]),'json':_0x1917e7,'resolveWithFullResponse':!![],'encoding':_0x55d5d0,'body':_0x4c5ae7[_0xdadd('0x96')]};if(_0x4c5ae7['headers']){_0x414361[_0xdadd('0xaa')]=_0x4c5ae7['headers'];if(_0x414361[_0xdadd('0xaa')][_0xdadd('0xab')]){delete _0x414361[_0xdadd('0xaa')][_0xdadd('0xab')];}}if(_0x414361[_0xdadd('0xaa')]['content-type']){delete _0x414361[_0xdadd('0xaa')][_0xdadd('0xac')];}return rp(_0x414361);})[_0xdadd('0x28')](function(_0x40c498){if(_0x40c498){_0x405452[_0xdadd('0xad')](_0x40c498['headers']);logger[_0xdadd('0x67')](_0x40c498[_0xdadd('0x96')]);return _0x405452['status'](_0x40c498[_0xdadd('0xaf')])[_0xdadd('0x30')](_0x40c498[_0xdadd('0x96')]);}else{return _0x405452[_0xdadd('0x20')](0xc8);}})[_0xdadd('0x51')](handleError(_0x405452,null));}; \ No newline at end of file +var _0x93e1=['defaults','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','status','json','count','offset','apply','reject','save','then','get','Plugins','UserProfileResource','destroy','end','error','name','send','index','map','Plugin','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','where','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','download','find','join','root','server/files/plugins','basename','createWriteStream','zip','code','ENOENT','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','Sequelize','pipe','glob','dirname','node_modules/**/*','finalize','close','existsSync','format','%s.zip','Error\x20while\x20downloading\x20the\x20plugin','info','Download\x20completed','Temporary\x20file\x20removed','file','extname','filename','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','readdirSync','some','manifest.json','parse','undefined','Invalid\x20manifest:\x20name\x20missing','type','version','parameters','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','html','plugins','Warning:\x20admin\x20view\x20not\x20specified','test','Warning:\x20agent\x20view\x20not\x20specified','scriptPath','role','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','unlinkSync','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','update','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','method','%s%s','headers','content-length','content-type','endsWith','statusCode','encoding','set','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','lodash','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis'];(function(_0x21c281,_0x56309a){var _0xa3fc61=function(_0x1f097c){while(--_0x1f097c){_0x21c281['push'](_0x21c281['shift']());}};_0xa3fc61(++_0x56309a);}(_0x93e1,0x136));var _0x193e=function(_0x17655e,_0x4d19d0){_0x17655e=_0x17655e-0x0;var _0x4de221=_0x93e1[_0x17655e];return _0x4de221;};'use strict';var pdf=require(_0x193e('0x0'));var emlformat=require(_0x193e('0x1'));var rimraf=require(_0x193e('0x2'));var zipdir=require(_0x193e('0x3'));var jsonpatch=require(_0x193e('0x4'));var rp=require(_0x193e('0x5'));var moment=require(_0x193e('0x6'));var BPromise=require(_0x193e('0x7'));var Mustache=require('mustache');var util=require('util');var path=require(_0x193e('0x8'));var sox=require(_0x193e('0x9'));var csv=require('to-csv');var ejs=require(_0x193e('0xa'));var fs=require('fs');var _=require(_0x193e('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x193e('0xc'));var deskjs=require(_0x193e('0xd'));var toCsv=require('to-csv');var querystring=require(_0x193e('0xe'));var Papa=require('papaparse');var extract=require('extract-zip');var rimraf=require(_0x193e('0x2'));var archiver=require('archiver');var Redis=require(_0x193e('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x193e('0x10'));var hardwareService=require(_0x193e('0x11'));var logger=require('../../config/logger')(_0x193e('0x12'));var utils=require('../../config/utils');var config=require(_0x193e('0x13'));var db=require(_0x193e('0x14'))['db'];config[_0x193e('0x15')]=_[_0x193e('0x16')](config[_0x193e('0x15')],{'host':_0x193e('0x17'),'port':0x18eb});var socket=require(_0x193e('0x18'))(new Redis(config[_0x193e('0x15')]));require(_0x193e('0x19'))[_0x193e('0x1a')](socket);function respondWithStatusCode(_0x5ca5d6,_0x3baf25){_0x3baf25=_0x3baf25||0xcc;return function(_0x20c5fb){if(_0x20c5fb){return _0x5ca5d6[_0x193e('0x1b')](_0x3baf25);}return _0x5ca5d6[_0x193e('0x1c')](_0x3baf25)['end']();};}function respondWithResult(_0x52be30,_0x24420c){_0x24420c=_0x24420c||0xc8;return function(_0x328254){if(_0x328254){return _0x52be30[_0x193e('0x1c')](_0x24420c)[_0x193e('0x1d')](_0x328254);}};}function respondWithFilteredResult(_0x3c6a40,_0x257d91){return function(_0x44ee69){if(_0x44ee69){var _0x46a008=_0x44ee69[_0x193e('0x1e')],_0x32a0a3=_0x257d91[_0x193e('0x1f')],_0x59a5ac=_0x257d91[_0x193e('0x1f')]+_0x257d91['limit'],_0x10b534;if(_0x59a5ac>=_0x46a008){_0x59a5ac=_0x46a008;_0x10b534=0xc8;}else{_0x10b534=0xce;}_0x3c6a40[_0x193e('0x1c')](_0x10b534);return _0x3c6a40['set']('Content-Range',_0x32a0a3+'-'+_0x59a5ac+'/'+_0x46a008)[_0x193e('0x1d')](_0x44ee69);}return null;};}function patchUpdates(_0xcd9cf5){return function(_0x4da115){try{jsonpatch[_0x193e('0x20')](_0x4da115,_0xcd9cf5,!![]);}catch(_0x5e5207){return BPromise[_0x193e('0x21')](_0x5e5207);}return _0x4da115[_0x193e('0x22')]();};}function saveUpdates(_0x1ace27,_0x2be464){return function(_0x1a60c2){if(_0x1a60c2){return _0x1a60c2['update'](_0x1ace27)[_0x193e('0x23')](function(_0xc52d0){return _0xc52d0;});}return null;};}function removeEntity(_0x31ab44,_0x24dcb9){return function(_0x9bf8aa){if(_0x9bf8aa){return _0x9bf8aa['destroy']()[_0x193e('0x23')](function(){var _0x181df6=_0x9bf8aa[_0x193e('0x24')]({'plain':!![]});var _0x4e48c8=_0x193e('0x25');return db[_0x193e('0x26')][_0x193e('0x27')]({'where':{'type':_0x4e48c8,'resourceId':_0x181df6['id']}})[_0x193e('0x23')](function(){return _0x9bf8aa;});})[_0x193e('0x23')](function(){_0x31ab44[_0x193e('0x1c')](0xcc)[_0x193e('0x28')]();});}};}function handleEntityNotFound(_0x5553dc,_0x612b00){return function(_0x56478f){if(!_0x56478f){_0x5553dc[_0x193e('0x1b')](0x194);}return _0x56478f;};}function handleError(_0x19d4ba,_0x54ff82){_0x54ff82=_0x54ff82||0x1f4;return function(_0x5c278d){logger[_0x193e('0x29')](_0x5c278d['stack']);if(_0x5c278d['name']){delete _0x5c278d[_0x193e('0x2a')];}_0x19d4ba[_0x193e('0x1c')](_0x54ff82)[_0x193e('0x2b')](_0x5c278d);};}exports[_0x193e('0x2c')]=function(_0x3baf39,_0x5a4019){var _0x1a1527={},_0x144c88={},_0x2405c4={'count':0x0,'rows':[]};var _0x5f25de=_[_0x193e('0x2d')](db[_0x193e('0x2e')][_0x193e('0x2f')],function(_0x39c7c5){return{'name':_0x39c7c5[_0x193e('0x30')],'type':_0x39c7c5['type'][_0x193e('0x31')]};});_0x144c88[_0x193e('0x32')]=_[_0x193e('0x2d')](_0x5f25de,'name');_0x144c88['query']=_[_0x193e('0x33')](_0x3baf39[_0x193e('0x34')]);_0x144c88[_0x193e('0x35')]=_[_0x193e('0x36')](_0x144c88[_0x193e('0x32')],_0x144c88[_0x193e('0x34')]);_0x1a1527[_0x193e('0x37')]=_[_0x193e('0x36')](_0x144c88[_0x193e('0x32')],qs['fields'](_0x3baf39['query'][_0x193e('0x38')]));_0x1a1527['attributes']=_0x1a1527['attributes'][_0x193e('0x39')]?_0x1a1527[_0x193e('0x37')]:_0x144c88[_0x193e('0x32')];if(!_0x3baf39[_0x193e('0x34')][_0x193e('0x3a')](_0x193e('0x3b'))){_0x1a1527[_0x193e('0x3c')]=qs[_0x193e('0x3c')](_0x3baf39[_0x193e('0x34')][_0x193e('0x3c')]);_0x1a1527[_0x193e('0x1f')]=qs[_0x193e('0x1f')](_0x3baf39['query'][_0x193e('0x1f')]);}_0x1a1527[_0x193e('0x3d')]=qs[_0x193e('0x3e')](_0x3baf39[_0x193e('0x34')][_0x193e('0x3e')]);_0x1a1527['where']=qs['filters'](_[_0x193e('0x3f')](_0x3baf39['query'],_0x144c88[_0x193e('0x35')]));if(_0x3baf39['query']['filter']){_0x1a1527[_0x193e('0x40')]=_[_0x193e('0x41')](_0x1a1527[_0x193e('0x40')],{'$or':_[_0x193e('0x2d')](_0x5f25de,function(_0x181032){if(_0x181032['type']!==_0x193e('0x42')){var _0x520131={};_0x520131[_0x181032[_0x193e('0x2a')]]={'$like':'%'+_0x3baf39[_0x193e('0x34')]['filter']+'%'};return _0x520131;}})});}_0x1a1527=_[_0x193e('0x41')]({},_0x1a1527,_0x3baf39[_0x193e('0x43')]);var _0x5a9a86={'where':_0x1a1527[_0x193e('0x40')]};return db['Plugin'][_0x193e('0x1e')](_0x5a9a86)[_0x193e('0x23')](function(_0x3d9bf1){_0x2405c4[_0x193e('0x1e')]=_0x3d9bf1;if(_0x3baf39[_0x193e('0x34')][_0x193e('0x44')]){_0x1a1527[_0x193e('0x45')]=[{'all':!![]}];}return db[_0x193e('0x2e')]['findAll'](_0x1a1527);})[_0x193e('0x23')](function(_0x423861){_0x2405c4[_0x193e('0x46')]=_0x423861;return _0x2405c4;})[_0x193e('0x23')](respondWithFilteredResult(_0x5a4019,_0x1a1527))[_0x193e('0x47')](handleError(_0x5a4019,null));};exports[_0x193e('0x48')]=function(_0x40ae32,_0x5de294){var _0x23f462={'raw':!![],'where':{'id':_0x40ae32[_0x193e('0x49')]['id']}},_0x4b30df={};_0x4b30df[_0x193e('0x32')]=_[_0x193e('0x33')](db[_0x193e('0x2e')]['rawAttributes']);_0x4b30df['query']=_[_0x193e('0x33')](_0x40ae32['query']);_0x4b30df['filters']=_[_0x193e('0x36')](_0x4b30df[_0x193e('0x32')],_0x4b30df[_0x193e('0x34')]);_0x23f462['attributes']=_[_0x193e('0x36')](_0x4b30df[_0x193e('0x32')],qs[_0x193e('0x38')](_0x40ae32['query']['fields']));_0x23f462[_0x193e('0x37')]=_0x23f462['attributes'][_0x193e('0x39')]?_0x23f462[_0x193e('0x37')]:_0x4b30df[_0x193e('0x32')];if(_0x40ae32[_0x193e('0x34')][_0x193e('0x44')]){_0x23f462['include']=[{'all':!![]}];}_0x23f462=_[_0x193e('0x41')]({},_0x23f462,_0x40ae32[_0x193e('0x43')]);return db[_0x193e('0x2e')]['find'](_0x23f462)[_0x193e('0x23')](handleEntityNotFound(_0x5de294,null))['then'](respondWithResult(_0x5de294,null))[_0x193e('0x47')](handleError(_0x5de294,null));};exports[_0x193e('0x4a')]=function(_0x171f9c,_0x310c2a,_0xda39b0){return db[_0x193e('0x2e')][_0x193e('0x4b')]({'where':{'id':_0x171f9c[_0x193e('0x49')]['id']},'attributes':[_0x193e('0x2a'),_0x193e('0x8')],'raw':!![]})[_0x193e('0x23')](handleEntityNotFound(_0x310c2a,null))[_0x193e('0x23')](function(_0x2c4c02){if(_0x2c4c02){var _0xccddec=path[_0x193e('0x4c')](config[_0x193e('0x4d')],_0x193e('0x4e'),util['format']('%s.zip',path[_0x193e('0x4f')](_0x2c4c02[_0x193e('0x8')])));var _0x4f216b=fs[_0x193e('0x50')](_0xccddec);var _0x4ce31f=archiver(_0x193e('0x51'),{'zlib':{'level':0x9}});_0x4ce31f['on']('warning',function(_0x1619aa){if(_0x1619aa[_0x193e('0x52')]===_0x193e('0x53')){logger[_0x193e('0x29')](_0x1619aa);}else{throw new db['Sequelize'][(_0x193e('0x54'))](_0x193e('0x55'));}});_0x4ce31f['on'](_0x193e('0x29'),function(_0x1b6a7b){throw new db[(_0x193e('0x56'))][(_0x193e('0x54'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x4ce31f[_0x193e('0x57')](_0x4f216b);_0x4ce31f[_0x193e('0x58')]('**/*',{'cwd':path['join'](config[_0x193e('0x4d')],_0x193e('0x4e'),path[_0x193e('0x59')](_0x2c4c02[_0x193e('0x8')])),'ignore':[path[_0x193e('0x4c')](path['basename'](_0x2c4c02[_0x193e('0x8')]),_0x193e('0x5a')),path[_0x193e('0x4c')](path[_0x193e('0x4f')](_0x2c4c02[_0x193e('0x8')]),'attachments/**/*')],'nodir':!![]})[_0x193e('0x5b')]();_0x4f216b['on'](_0x193e('0x5c'),function(){if(!fs[_0x193e('0x5d')](_0xccddec)){throw new db['Sequelize']['Error']('Plugin\x20not\x20found');}return _0x310c2a[_0x193e('0x4a')](_0xccddec,util[_0x193e('0x5e')](_0x193e('0x5f'),path[_0x193e('0x4f')](_0x2c4c02[_0x193e('0x8')])),function(_0xd4cd55){if(_0xd4cd55){throw new db['Sequelize'][(_0x193e('0x54'))](_0x193e('0x60'));}fs['unlinkSync'](_0xccddec);logger[_0x193e('0x61')](_0x193e('0x62'));logger['info'](_0x193e('0x63'));});});}return null;})[_0x193e('0x47')](handleError(_0x310c2a,null));};exports['upload']=function(_0x4c9d1e,_0x2d30f0,_0x561cdd){var _0xa700d=path[_0x193e('0x4f')](_0x4c9d1e[_0x193e('0x64')]['filename'],path[_0x193e('0x65')](_0x4c9d1e[_0x193e('0x64')][_0x193e('0x66')]));var _0x193418=path['join'](config[_0x193e('0x4d')],_0x193e('0x4e'),_0x4c9d1e[_0x193e('0x64')]['filename']);var _0x1add3c=path[_0x193e('0x4c')](config[_0x193e('0x4d')],'server/files/plugins',_0xa700d);logger['info'](_0x193e('0x67'),_0x193418);logger[_0x193e('0x61')](_0x193e('0x68'),_0x1add3c);try{fs[_0x193e('0x69')](_0x193418,parseInt('0777',0x8));extract(_0x193418,{'dir':_0x1add3c},function(_0x5ab0c5){if(_0x5ab0c5){logger['error'](_0x5ab0c5);handleError(_0x5ab0c5,!![]);};var _0x999046=fs['readdirSync'](_0x1add3c);if(_0x999046[_0x193e('0x39')]>0x1){removeReferences(_0x193418,_0x1add3c);logger[_0x193e('0x29')](_0x193e('0x6a'));return _0x561cdd(new Error('Invalid\x20plugin\x20structure'));}var _0x59bfcd=fs[_0x193e('0x6b')](path[_0x193e('0x4c')](_0x1add3c,_0x999046[0x0]));if(_0x59bfcd[_0x193e('0x6c')]()){removeReferences(_0x193418,_0x1add3c);logger['error'](_0x193e('0x6a'));return _0x561cdd(new Error(_0x193e('0x6a')));}if(_0x59bfcd[_0x193e('0x6d')]()){var _0x59b4d0=fs[_0x193e('0x6e')](path[_0x193e('0x4c')](_0x1add3c,_0x999046[0x0]));if(_0x59b4d0['length']===0x0){removeReferences(_0x193418,_0x1add3c);logger[_0x193e('0x29')](_0x193e('0x6a'));return _0x561cdd(new Error('Invalid\x20plugin\x20structure'));}var _0x3f98fc=_0x59b4d0[_0x193e('0x6f')](function(_0x2e90e7){return _0x2e90e7===_0x193e('0x70');});if(!_0x3f98fc){return _0x561cdd(new Error('Plugin\x20manifest\x20missing'));}var _0x5b4d3e=fs['readFileSync'](path[_0x193e('0x4c')](_0x1add3c,_0x999046[0x0],_0x193e('0x70')));var _0xea2d42=JSON[_0x193e('0x71')](_0x5b4d3e);if(_0x193e('0x72')==typeof _0xea2d42[_0x193e('0x2a')]){return _0x561cdd(new Error(_0x193e('0x73')));}if(_0x193e('0x72')==typeof _0xea2d42[_0x193e('0x74')]){return _0x561cdd(new Error('Invalid\x20manifest:\x20type\x20missing'));}if(_0x193e('0x72')==typeof _0xea2d42[_0x193e('0x75')]){return _0x561cdd(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if(_0x193e('0x72')==typeof _0xea2d42[_0x193e('0x76')]){return _0x561cdd(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0xea2d42[_0x193e('0x74')]==='html'){if(_0x193e('0x72')==typeof _0xea2d42[_0x193e('0x76')][_0x193e('0x77')]){return _0x561cdd(new Error(_0x193e('0x78')));}if(_0x193e('0x72')==typeof _0xea2d42[_0x193e('0x76')][_0x193e('0x77')][_0x193e('0x79')]&&_0x193e('0x72')==typeof _0xea2d42['parameters'][_0x193e('0x77')][_0x193e('0x7a')]){return _0x561cdd(new Error(_0x193e('0x7b')));}}else if(_0xea2d42[_0x193e('0x74')]===_0x193e('0x7c')){if(_0x193e('0x72')==typeof _0xea2d42['parameters'][_0x193e('0x7d')]){return _0x561cdd(new Error(_0x193e('0x7e')));}if(_0x193e('0x72')==typeof _0xea2d42[_0x193e('0x76')]['scriptPath']){return _0x561cdd(new Error(_0x193e('0x7f')));}}else{return _0x561cdd(new Error(_0x193e('0x80')));}var _0x27f38d=_0xea2d42[_0x193e('0x2a')];var _0x36d240=_0xea2d42[_0x193e('0x81')];var _0x56cdb7=_0xea2d42['type'];var _0x2f8812=_0xea2d42[_0x193e('0x82')]?_0xea2d42[_0x193e('0x82')]:_0x193e('0x83');var _0x587f54=_0xea2d42[_0x193e('0x84')]?_0xea2d42[_0x193e('0x84')]:_0x193e('0x85');var _0x4eb11a='';var _0x2de2d0='';var _0x49e153='';var _0x38f593='';var _0x436deb=_0xea2d42[_0x193e('0x75')];if(_0x56cdb7===_0x193e('0x86')){if('undefined'!=typeof _0xea2d42[_0x193e('0x76')][_0x193e('0x77')][_0x193e('0x79')]){var _0x47e6da=_0xea2d42[_0x193e('0x76')][_0x193e('0x77')]['admin'];if(!/^(f|ht)tps?:\/\//i['test'](_0x47e6da)){_0x4eb11a=path[_0x193e('0x4c')](_0x193e('0x87'),_0xa700d,_0x999046[0x0],_0x47e6da);}else{_0x4eb11a=_0x47e6da;}}else{logger[_0x193e('0x61')](_0x193e('0x88'));}if(_0x193e('0x72')!=typeof _0xea2d42['parameters'][_0x193e('0x77')][_0x193e('0x7a')]){var _0x43fde0=_0xea2d42[_0x193e('0x76')][_0x193e('0x77')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x193e('0x89')](_0x43fde0)){_0x2de2d0=path[_0x193e('0x4c')](_0x193e('0x87'),_0xa700d,_0x999046[0x0],_0x43fde0);}else{_0x2de2d0=_0x43fde0;}}else{logger[_0x193e('0x61')](_0x193e('0x8a'));}}else if(_0x56cdb7===_0x193e('0x7c')){_0x49e153=_0xea2d42[_0x193e('0x76')][_0x193e('0x7d')];_0x38f593=_0xea2d42[_0x193e('0x76')][_0x193e('0x8b')];if(_0x193e('0x72')!=typeof _0xea2d42['parameters']['views']){if(_0x193e('0x72')!=typeof _0xea2d42[_0x193e('0x76')][_0x193e('0x77')]['admin']){var _0x47e6da=_0xea2d42[_0x193e('0x76')][_0x193e('0x77')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0x193e('0x89')](_0x47e6da)){_0x4eb11a=path['join'](_0x193e('0x87'),_0xa700d,_0x999046[0x0],_0x47e6da);}else{_0x4eb11a=_0x47e6da;}}if(_0x193e('0x72')!=typeof _0xea2d42[_0x193e('0x76')][_0x193e('0x77')][_0x193e('0x7a')]){var _0x43fde0=_0xea2d42[_0x193e('0x76')][_0x193e('0x77')][_0x193e('0x7a')];if(!/^(f|ht)tps?:\/\//i[_0x193e('0x89')](_0x43fde0)){_0x2de2d0=path[_0x193e('0x4c')](_0x193e('0x87'),_0xa700d,_0x999046[0x0],_0x43fde0);}else{_0x2de2d0=_0x43fde0;}}}}var _0xe51e1={'name':_0x27f38d,'description':_0x36d240,'path':path[_0x193e('0x4c')](_0xa700d,_0x999046[0x0]),'type':_0x56cdb7,'sidebar':_0x2f8812,'icon':_0x587f54,'adminUrl':_0x4eb11a,'agentUrl':_0x2de2d0,'scriptName':_0x49e153,'scriptPath':_0x38f593,'version':_0x436deb};removeReferences(_0x193418,null);return db[_0x193e('0x2e')]['create'](_0xe51e1)[_0x193e('0x23')](function(_0x33b143){var _0x5c4ed6={'role':_0x4c9d1e['body'][_0x193e('0x8c')],'userProfileId':_0x4c9d1e[_0x193e('0x8d')][_0x193e('0x8e')]};if(!_0x5c4ed6)throw new Error(_0x193e('0x8f'));if(_0x5c4ed6[_0x193e('0x8c')]===_0x193e('0x90')){var _0x393be4=_0x33b143[_0x193e('0x24')]({'plain':!![]});return db['UserProfileSection'][_0x193e('0x4b')]({'where':{'name':_0x193e('0x25'),'userProfileId':_0x5c4ed6[_0x193e('0x8e')]},'raw':!![]})[_0x193e('0x23')](function(_0x24646d){if(_0x24646d&&_0x24646d['autoAssociation']===0x0){return db[_0x193e('0x26')]['create']({'name':_0x393be4[_0x193e('0x2a')],'resourceId':_0x393be4['id'],'type':_0x24646d['name'],'sectionId':_0x24646d['id']},{})['then'](function(){return _0x33b143;});}else{return _0x33b143;}})[_0x193e('0x47')](function(_0x1105d8){logger[_0x193e('0x29')](_0x193e('0x91'),_0x1105d8);throw _0x1105d8;});}return _0x33b143;})[_0x193e('0x23')](respondWithResult(_0x2d30f0,null))[_0x193e('0x47')](handleError(_0x2d30f0,null));}});}catch(_0x50658b){_0x2d30f0[_0x193e('0x1c')](0x1f4)[_0x193e('0x2b')](_0x50658b);}};function removeReferences(_0x16bcf8,_0x2b93ce){try{if(_0x16bcf8){fs[_0x193e('0x92')](_0x16bcf8);logger['info'](_0x193e('0x93'));}if(_0x2b93ce){rimraf(_0x2b93ce,function(){});logger[_0x193e('0x61')](_0x193e('0x94'));}}catch(_0x16d3b8){logger[_0x193e('0x29')](_0x16d3b8);}}exports[_0x193e('0x95')]=function(_0x20b882,_0x242d8f,_0x506ffa){return db[_0x193e('0x2e')]['find']({'where':{'id':_0x20b882['params']['id']}})[_0x193e('0x23')](handleEntityNotFound(_0x242d8f,null))[_0x193e('0x23')](saveUpdates(_0x20b882[_0x193e('0x8d')],null))[_0x193e('0x23')](respondWithResult(_0x242d8f,null))[_0x193e('0x47')](handleError(_0x242d8f,null));};exports['delete']=function(_0x42435a,_0x922bd0,_0x39edb9){return db[_0x193e('0x2e')][_0x193e('0x4b')]({'where':{'id':_0x42435a['params']['id']}})['then'](function(_0x5b002f){if(_0x5b002f){return _0x5b002f[_0x193e('0x27')]();}})[_0x193e('0x23')](function(_0x4f46a0){rimraf(path[_0x193e('0x4c')](config[_0x193e('0x4d')],_0x193e('0x4e'),path[_0x193e('0x59')](_0x4f46a0[_0x193e('0x8')])),function(){});return _0x4f46a0;})[_0x193e('0x23')](handleEntityNotFound(_0x922bd0,null))[_0x193e('0x23')](respondWithStatusCode(_0x922bd0,null))[_0x193e('0x47')](handleError(_0x922bd0,null));};exports[_0x193e('0x96')]=function(_0x2b19b8,_0x3e80a7,_0x19bb9a){return BPromise[_0x193e('0x97')]()[_0x193e('0x23')](function(){if(!_0x2b19b8[_0x193e('0x34')]['path']){throw new Error(_0x193e('0x98'));}if(!_0x2b19b8[_0x193e('0x34')][_0x193e('0x99')]){throw new Error(_0x193e('0x9a'));}var _0x1b7cc6=_0x2b19b8[_0x193e('0x34')]['hostname']?_0x2b19b8['query'][_0x193e('0x9b')]+':'+_0x2b19b8[_0x193e('0x34')][_0x193e('0x99')]:_0x193e('0x9c')+_0x2b19b8[_0x193e('0x34')][_0x193e('0x99')];var _0xc01814=_0x2b19b8['query'][_0x193e('0x1d')]?_0x2b19b8['query'][_0x193e('0x1d')]:!![];var _0x1c9486=_0x2b19b8['query']['encoding']?_0x2b19b8['query']['encoding']:null;var _0xf56707={'method':_0x2b19b8[_0x193e('0x9d')],'uri':util[_0x193e('0x5e')](_0x193e('0x9e'),_0x1b7cc6,_0x2b19b8[_0x193e('0x34')][_0x193e('0x8')]),'json':_0xc01814,'resolveWithFullResponse':!![],'encoding':_0x1c9486,'qs':_0x2b19b8['query']};if(_0x2b19b8[_0x193e('0x9f')]){_0xf56707['headers']=_0x2b19b8['headers'];if(_0xf56707[_0x193e('0x9f')][_0x193e('0xa0')]){delete _0xf56707[_0x193e('0x9f')][_0x193e('0xa0')];}}if(_0xf56707[_0x193e('0x9f')][_0x193e('0xa1')]){delete _0xf56707[_0x193e('0x9f')][_0x193e('0xa1')];}return rp(_0xf56707);})[_0x193e('0x23')](function(_0x288144){if(_0x288144){_0x3e80a7['set'](_0x288144[_0x193e('0x9f')]);logger[_0x193e('0x61')](_0x288144['body']);if(_[_0x193e('0xa2')](_0x2b19b8[_0x193e('0x34')][_0x193e('0x8')],_0x193e('0x4a'))&&_0x288144[_0x193e('0xa3')]==0x1f4){return _0x3e80a7[_0x193e('0x1b')](_0x288144['statusCode']);}else{return _0x3e80a7[_0x193e('0x1c')](_0x288144[_0x193e('0xa3')])[_0x193e('0x2b')](_0x288144[_0x193e('0x8d')]);}}else{return _0x3e80a7['sendStatus'](0xc8);}})[_0x193e('0x47')](handleError(_0x3e80a7,null));};exports['webhookPost']=function(_0x59921e,_0x5125b2,_0x268c9a){return BPromise['resolve']()['then'](function(){if(!_0x59921e['query']['path']){throw new Error(_0x193e('0x98'));}if(!_0x59921e['query'][_0x193e('0x99')]){throw new Error(_0x193e('0x9a'));}var _0x1253e9=_0x59921e[_0x193e('0x34')][_0x193e('0x9b')]?_0x59921e[_0x193e('0x34')][_0x193e('0x9b')]+':'+_0x59921e['query']['port']:_0x193e('0x9c')+_0x59921e[_0x193e('0x34')][_0x193e('0x99')];var _0x3292cc=_0x59921e['query'][_0x193e('0x1d')]?_0x59921e['query'][_0x193e('0x1d')]:!![];var _0x545d31=_0x59921e[_0x193e('0x34')][_0x193e('0xa4')]?_0x59921e[_0x193e('0x34')]['encoding']:null;var _0x31815d={'method':_0x59921e[_0x193e('0x9d')],'uri':util[_0x193e('0x5e')](_0x193e('0x9e'),_0x1253e9,_0x59921e[_0x193e('0x34')][_0x193e('0x8')]),'json':_0x3292cc,'resolveWithFullResponse':!![],'encoding':_0x545d31,'body':_0x59921e[_0x193e('0x8d')]};if(_0x59921e['headers']){_0x31815d[_0x193e('0x9f')]=_0x59921e[_0x193e('0x9f')];if(_0x31815d[_0x193e('0x9f')][_0x193e('0xa0')]){delete _0x31815d['headers'][_0x193e('0xa0')];}}if(_0x31815d[_0x193e('0x9f')][_0x193e('0xa1')]){delete _0x31815d[_0x193e('0x9f')][_0x193e('0xa1')];}return rp(_0x31815d);})[_0x193e('0x23')](function(_0x56024e){if(_0x56024e){_0x5125b2[_0x193e('0xa5')](_0x56024e[_0x193e('0x9f')]);logger[_0x193e('0x61')](_0x56024e[_0x193e('0x8d')]);return _0x5125b2[_0x193e('0x1c')](_0x56024e['statusCode'])[_0x193e('0x2b')](_0x56024e['body']);}else{return _0x5125b2[_0x193e('0x1b')](0xc8);}})[_0x193e('0x47')](handleError(_0x5125b2,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 7ac548d..53637dd 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 _0x9f0e=['Plugin','setMaxListeners','save','emit','hook','exports','events','../../mysqldb'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9f0e,0x116));var _0xe9f0=function(_0x34a631,_0x32428b){_0x34a631=_0x34a631-0x0;var _0x3c8b0f=_0x9f0e[_0x34a631];return _0x3c8b0f;};'use strict';var EventEmitter=require(_0xe9f0('0x0'));var Plugin=require(_0xe9f0('0x1'))['db'][_0xe9f0('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0xe9f0('0x3')](0x0);var events={'afterCreate':_0xe9f0('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2325c6){return function(_0x150a03,_0x3c589d,_0x202d69){PluginEvents[_0xe9f0('0x5')](_0x2325c6+':'+_0x150a03['id'],_0x150a03);PluginEvents['emit'](_0x2325c6,_0x150a03);_0x202d69(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin[_0xe9f0('0x6')](e,emitEvent(event));}}module[_0xe9f0('0x7')]=PluginEvents; \ No newline at end of file +var _0xf2e3=['remove','emit','hasOwnProperty','hook','exports','events','Plugin','setMaxListeners','save','update'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xf2e3,0x9b));var _0x3f2e=function(_0x39e84d,_0x11931d){_0x39e84d=_0x39e84d-0x0;var _0x1991bc=_0xf2e3[_0x39e84d];return _0x1991bc;};'use strict';var EventEmitter=require(_0x3f2e('0x0'));var Plugin=require('../../mysqldb')['db'][_0x3f2e('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0x3f2e('0x2')](0x0);var events={'afterCreate':_0x3f2e('0x3'),'afterUpdate':_0x3f2e('0x4'),'afterDestroy':_0x3f2e('0x5')};function emitEvent(_0x1634cd){return function(_0x3938e2,_0xabcf5c,_0x216b26){PluginEvents['emit'](_0x1634cd+':'+_0x3938e2['id'],_0x3938e2);PluginEvents[_0x3f2e('0x6')](_0x1634cd,_0x3938e2);_0x216b26(null);};}for(var e in events){if(events[_0x3f2e('0x7')](e)){var event=events[e];Plugin[_0x3f2e('0x8')](e,emitEvent(event));}}module[_0x3f2e('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 f96d2d6..623cce6 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 _0x34e8=['plugins','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./plugin.attributes','exports','Plugin'];(function(_0x244005,_0x4f543b){var _0x5b902f=function(_0x1d56b3){while(--_0x1d56b3){_0x244005['push'](_0x244005['shift']());}};_0x5b902f(++_0x4f543b);}(_0x34e8,0x12c));var _0x834e=function(_0x4bd7c3,_0xab8100){_0x4bd7c3=_0x4bd7c3-0x0;var _0x3ad7b2=_0x34e8[_0x4bd7c3];return _0x3ad7b2;};'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 _0x4bc3=['./plugin.attributes','exports','define','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x49181c,_0x17ed3d){var _0x2e2427=function(_0x428a53){while(--_0x428a53){_0x49181c['push'](_0x49181c['shift']());}};_0x2e2427(++_0x17ed3d);}(_0x4bc3,0x16e));var _0x34bc=function(_0x28aea5,_0x3bb12e){_0x28aea5=_0x28aea5-0x0;var _0x6a55f9=_0x4bc3[_0x28aea5];return _0x6a55f9;};'use strict';var _=require(_0x34bc('0x0'));var util=require(_0x34bc('0x1'));var logger=require('../../config/logger')(_0x34bc('0x2'));var moment=require(_0x34bc('0x3'));var BPromise=require('bluebird');var rp=require(_0x34bc('0x4'));var fs=require('fs');var path=require(_0x34bc('0x5'));var rimraf=require(_0x34bc('0x6'));var config=require(_0x34bc('0x7'));var attributes=require(_0x34bc('0x8'));module[_0x34bc('0x9')]=function(_0x2cc9c2,_0x4c63a1){return _0x2cc9c2[_0x34bc('0xa')]('Plugin',attributes,{'tableName':'plugins','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 10c2039..158980d 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 _0x17f4=['code','message','result','catch','CreatePlugin','Plugin','create','body','options','raw','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','redis','socket.io-emitter','./plugin.socket','register','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','error'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x17f4,0xa0));var _0x417f=function(_0x9c32df,_0x533254){_0x9c32df=_0x9c32df-0x0;var _0x4edcc2=_0x17f4[_0x9c32df];return _0x4edcc2;};'use strict';var _=require('lodash');var util=require(_0x417f('0x0'));var moment=require(_0x417f('0x1'));var BPromise=require(_0x417f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x417f('0x3'));var db=require(_0x417f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x417f('0x5'))(_0x417f('0x6'));var config=require(_0x417f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x417f('0x8')]['http']({'port':0x232a});config[_0x417f('0x9')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x417f('0xa'))(new Redis(config[_0x417f('0x9')]));require(_0x417f('0xb'))[_0x417f('0xc')](socket);function respondWithRpcPromise(_0x11b204,_0x28fd60,_0x16d649){return new BPromise(function(_0x2fba9e,_0x16b373){return client['request'](_0x11b204,_0x16d649)[_0x417f('0xd')](function(_0x158e7e){logger[_0x417f('0xe')](_0x417f('0xf'),_0x28fd60,_0x417f('0x10'));logger[_0x417f('0x11')](_0x417f('0x12'),_0x28fd60,'request\x20sent',JSON['stringify'](_0x158e7e));if(_0x158e7e['error']){if(_0x158e7e[_0x417f('0x13')][_0x417f('0x14')]===0x1f4){logger[_0x417f('0x13')](_0x417f('0xf'),_0x28fd60,_0x158e7e[_0x417f('0x13')][_0x417f('0x15')]);return _0x16b373(_0x158e7e[_0x417f('0x13')][_0x417f('0x15')]);}logger[_0x417f('0x13')](_0x417f('0xf'),_0x28fd60,_0x158e7e[_0x417f('0x13')][_0x417f('0x15')]);return _0x2fba9e(_0x158e7e['error'][_0x417f('0x15')]);}else{logger[_0x417f('0xe')](_0x417f('0xf'),_0x28fd60,_0x417f('0x10'));_0x2fba9e(_0x158e7e[_0x417f('0x16')][_0x417f('0x15')]);}})[_0x417f('0x17')](function(_0x1077f3){logger['error'](_0x417f('0xf'),_0x28fd60,_0x1077f3);_0x16b373(_0x1077f3);});});}exports[_0x417f('0x18')]=function(_0x11565e){var _0x47f37f=this;return new Promise(function(_0x3e2596,_0x5e77d7){return db[_0x417f('0x19')][_0x417f('0x1a')](_0x11565e[_0x417f('0x1b')],{'raw':_0x11565e['options']?_0x11565e[_0x417f('0x1c')][_0x417f('0x1d')]===undefined?!![]:![]:!![]})[_0x417f('0xd')](function(_0x1f2469){logger[_0x417f('0xe')](_0x417f('0x18'),_0x11565e);logger[_0x417f('0x11')]('CreatePlugin',_0x11565e,JSON['stringify'](_0x1f2469));_0x3e2596(_0x1f2469);})[_0x417f('0x17')](function(_0xc77996){logger[_0x417f('0x13')](_0x417f('0x18'),_0xc77996[_0x417f('0x15')],_0x11565e);_0x5e77d7(_0x47f37f[_0x417f('0x13')](0x1f4,_0xc77996[_0x417f('0x15')]));});});}; \ No newline at end of file +var _0xe740=['body','options','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','./plugin.socket','register','then','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','CreatePlugin','create'];(function(_0x4b1136,_0x4d3ca2){var _0x1f0b8a=function(_0x433c8f){while(--_0x433c8f){_0x4b1136['push'](_0x4b1136['shift']());}};_0x1f0b8a(++_0x4d3ca2);}(_0xe740,0x143));var _0x0e74=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0xe740[_0x9cd4c3];return _0x4c9025;};'use strict';var _=require(_0x0e74('0x0'));var util=require(_0x0e74('0x1'));var moment=require(_0x0e74('0x2'));var BPromise=require(_0x0e74('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0e74('0x4'))['db'];var utils=require(_0x0e74('0x5'));var logger=require(_0x0e74('0x6'))(_0x0e74('0x7'));var config=require('../../config/environment');var jayson=require(_0x0e74('0x8'));var client=jayson[_0x0e74('0x9')][_0x0e74('0xa')]({'port':0x232a});config[_0x0e74('0xb')]=_[_0x0e74('0xc')](config['redis'],{'host':_0x0e74('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0e74('0xb')]));require(_0x0e74('0xe'))[_0x0e74('0xf')](socket);function respondWithRpcPromise(_0x3e1c6e,_0x435a58,_0x1b420f){return new BPromise(function(_0xe7536e,_0x343bc9){return client['request'](_0x3e1c6e,_0x1b420f)[_0x0e74('0x10')](function(_0x3976af){logger['info'](_0x0e74('0x11'),_0x435a58,_0x0e74('0x12'));logger[_0x0e74('0x13')](_0x0e74('0x14'),_0x435a58,_0x0e74('0x12'),JSON[_0x0e74('0x15')](_0x3976af));if(_0x3976af[_0x0e74('0x16')]){if(_0x3976af[_0x0e74('0x16')][_0x0e74('0x17')]===0x1f4){logger[_0x0e74('0x16')](_0x0e74('0x11'),_0x435a58,_0x3976af[_0x0e74('0x16')][_0x0e74('0x18')]);return _0x343bc9(_0x3976af['error'][_0x0e74('0x18')]);}logger[_0x0e74('0x16')](_0x0e74('0x11'),_0x435a58,_0x3976af[_0x0e74('0x16')][_0x0e74('0x18')]);return _0xe7536e(_0x3976af['error'][_0x0e74('0x18')]);}else{logger[_0x0e74('0x19')]('Plugin,\x20%s,\x20%s',_0x435a58,_0x0e74('0x12'));_0xe7536e(_0x3976af[_0x0e74('0x1a')][_0x0e74('0x18')]);}})['catch'](function(_0x4a3ae5){logger[_0x0e74('0x16')](_0x0e74('0x11'),_0x435a58,_0x4a3ae5);_0x343bc9(_0x4a3ae5);});});}exports[_0x0e74('0x1b')]=function(_0x5deb75){var _0x2ea8f2=this;return new Promise(function(_0x2cda9c,_0x213488){return db['Plugin'][_0x0e74('0x1c')](_0x5deb75[_0x0e74('0x1d')],{'raw':_0x5deb75['options']?_0x5deb75[_0x0e74('0x1e')]['raw']===undefined?!![]:![]:!![]})[_0x0e74('0x10')](function(_0x1d83cd){logger[_0x0e74('0x19')](_0x0e74('0x1b'),_0x5deb75);logger[_0x0e74('0x13')](_0x0e74('0x1b'),_0x5deb75,JSON[_0x0e74('0x15')](_0x1d83cd));_0x2cda9c(_0x1d83cd);})[_0x0e74('0x1f')](function(_0x377810){logger[_0x0e74('0x16')]('CreatePlugin',_0x377810[_0x0e74('0x18')],_0x5deb75);_0x213488(_0x2ea8f2[_0x0e74('0x16')](0x1f4,_0x377810[_0x0e74('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 1876866..4b99e83 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 _0xe2dc=['register','plugin:','./plugin.events','update'];(function(_0xf0bcac,_0x531755){var _0x4e4c65=function(_0x35a77a){while(--_0x35a77a){_0xf0bcac['push'](_0xf0bcac['shift']());}};_0x4e4c65(++_0x531755);}(_0xe2dc,0xde));var _0xce2d=function(_0x2d9e27,_0x46b45e){_0x2d9e27=_0x2d9e27-0x0;var _0x4b8667=_0xe2dc[_0x2d9e27];return _0x4b8667;};'use strict';var PluginEvents=require(_0xce2d('0x0'));var events=['save','remove',_0xce2d('0x1')];function createListener(_0x157595,_0x68f4fc){return function(_0x19a3f9){_0x68f4fc['emit'](_0x157595,_0x19a3f9);};}function removeListener(_0x1761e4,_0x58ae63){return function(){PluginEvents['removeListener'](_0x1761e4,_0x58ae63);};}exports[_0xce2d('0x2')]=function(_0x394865){for(var _0x4b014a=0x0,_0x5ed552=events['length'];_0x4b014a<_0x5ed552;_0x4b014a++){var _0xf4225e=events[_0x4b014a];var _0x572837=createListener(_0xce2d('0x3')+_0xf4225e,_0x394865);PluginEvents['on'](_0xf4225e,_0x572837);}}; \ No newline at end of file +var _0x1b62=['register','./plugin.events','save','remove'];(function(_0x35f0df,_0x4b00d0){var _0x4e243a=function(_0x45b2d9){while(--_0x45b2d9){_0x35f0df['push'](_0x35f0df['shift']());}};_0x4e243a(++_0x4b00d0);}(_0x1b62,0x199));var _0x21b6=function(_0x4e4f0e,_0x1c3892){_0x4e4f0e=_0x4e4f0e-0x0;var _0x1a7219=_0x1b62[_0x4e4f0e];return _0x1a7219;};'use strict';var PluginEvents=require(_0x21b6('0x0'));var events=[_0x21b6('0x1'),_0x21b6('0x2'),'update'];function createListener(_0x4affdc,_0x4f6080){return function(_0x1fc1e9){_0x4f6080['emit'](_0x4affdc,_0x1fc1e9);};}function removeListener(_0x90a577,_0x5a06f3){return function(){PluginEvents['removeListener'](_0x90a577,_0x5a06f3);};}exports[_0x21b6('0x3')]=function(_0x5c065f){for(var _0x45b603=0x0,_0x485ce0=events['length'];_0x45b603<_0x485ce0;_0x45b603++){var _0x4a3193=events[_0x45b603];var _0x1943ff=createListener('plugin:'+_0x4a3193,_0x5c065f);PluginEvents['on'](_0x4a3193,_0x1943ff);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index d7f8fdb..c781697 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 _0x1e5d=['isAuthenticated','index','show','post','create','put','update','delete','/:id','express','Router','../../components/auth/service','./pm2.controller','get'];(function(_0x505b1,_0x3f2a5d){var _0x6f5380=function(_0x439bda){while(--_0x439bda){_0x505b1['push'](_0x505b1['shift']());}};_0x6f5380(++_0x3f2a5d);}(_0x1e5d,0x113));var _0xd1e5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1e5d[_0x3dd15e];return _0x231fd0;};'use strict';var express=require(_0xd1e5('0x0'));var router=express[_0xd1e5('0x1')]();var auth=require(_0xd1e5('0x2'));var controller=require(_0xd1e5('0x3'));router[_0xd1e5('0x4')]('/',auth[_0xd1e5('0x5')](),controller[_0xd1e5('0x6')]);router['get']('/:id',auth[_0xd1e5('0x5')](),controller[_0xd1e5('0x7')]);router[_0xd1e5('0x8')]('/',auth[_0xd1e5('0x5')](),controller[_0xd1e5('0x9')]);router[_0xd1e5('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xd1e5('0xb')]);router[_0xd1e5('0xc')](_0xd1e5('0xd'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x7111=['get','isAuthenticated','index','show','create','/:id','update','delete','destroy','express','../../components/auth/service','./pm2.controller'];(function(_0x39ab7e,_0x1c42da){var _0xb2b7c6=function(_0x4781f8){while(--_0x4781f8){_0x39ab7e['push'](_0x39ab7e['shift']());}};_0xb2b7c6(++_0x1c42da);}(_0x7111,0x105));var _0x1711=function(_0x3ba924,_0x3b99f0){_0x3ba924=_0x3ba924-0x0;var _0x4cc1df=_0x7111[_0x3ba924];return _0x4cc1df;};'use strict';var express=require(_0x1711('0x0'));var router=express['Router']();var auth=require(_0x1711('0x1'));var controller=require(_0x1711('0x2'));router[_0x1711('0x3')]('/',auth[_0x1711('0x4')](),controller[_0x1711('0x5')]);router[_0x1711('0x3')]('/:id',auth['isAuthenticated'](),controller[_0x1711('0x6')]);router['post']('/',auth[_0x1711('0x4')](),controller[_0x1711('0x7')]);router['put'](_0x1711('0x8'),auth[_0x1711('0x4')](),controller[_0x1711('0x9')]);router[_0x1711('0xa')](_0x1711('0x8'),auth[_0x1711('0x4')](),controller[_0x1711('0xb')]);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 5e2a227..7c22977 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 _0x3532=['../../config/logger','path','exec','sendStatus','status','stack','name','npm\x20install','info','index','then','reject','express','motion2','length','catch','show','params','create','script','../../files/plugins','body','cwd','chdir','dirname','start','dump','send','Missing\x20name\x20and/or\x20path','update','restart','hasOwnProperty','Unknown\x20status','destroy','Unknown\x20id','lodash','../../config/pm2'];(function(_0x31fc74,_0x5cdff7){var _0x32b6f7=function(_0x362b71){while(--_0x362b71){_0x31fc74['push'](_0x31fc74['shift']());}};_0x32b6f7(++_0x5cdff7);}(_0x3532,0x6d));var _0x2353=function(_0x92e512,_0x31af50){_0x92e512=_0x92e512-0x0;var _0x3bb5d0=_0x3532[_0x92e512];return _0x3bb5d0;};'use strict';var _=require(_0x2353('0x0'));var pm2=require(_0x2353('0x1'));var logger=require(_0x2353('0x2'))('api');var path=require(_0x2353('0x3'));var exec=require('child_process')[_0x2353('0x4')];var BPromise=require('bluebird');function handleEntityNotFound(_0x42b71a,_0x154be1){return function(_0x305847){if(!_0x305847){_0x42b71a[_0x2353('0x5')](0x194);;}return _0x305847;};}function respondWithResult(_0x49a61f,_0x5f50d2){_0x5f50d2=_0x5f50d2||0xc8;return function(_0x8899a9){if(_0x8899a9){return _0x49a61f[_0x2353('0x6')](_0x5f50d2)['json'](_0x8899a9);}return null;};}function handleError(_0x47be9c,_0x2b6237){_0x2b6237=_0x2b6237||0x1f4;return function(_0xde728f){logger['error'](_0xde728f[_0x2353('0x7')]);if(_0xde728f[_0x2353('0x8')]){delete _0xde728f[_0x2353('0x8')];}_0x47be9c[_0x2353('0x6')](_0x2b6237)['send'](_0xde728f);};}function execChildProcess(){return new BPromise(function(_0x10de94,_0x1fa7b4){exec(_0x2353('0x9'),function(_0x57c2ce,_0x29a03d,_0x23bfc0){logger['info'](_0x29a03d);logger[_0x2353('0xa')](_0x23bfc0);if(_0x57c2ce){logger['error'](_0x57c2ce);return _0x1fa7b4(_0x57c2ce);}return _0x10de94(_0x29a03d);});});}exports[_0x2353('0xb')]=function(_0x3a64ec,_0x4d5d2f){return pm2['list']()[_0x2353('0xc')](function(_0x31f557){if(_0x31f557){var _0x50a155=_[_0x2353('0xd')](_0x31f557,function(_0x72df7d){return _0x72df7d[_0x2353('0x8')]===_0x2353('0xe')||_0x72df7d[_0x2353('0x8')]===_0x2353('0xf');});return{'rows':_0x50a155,'count':_0x50a155[_0x2353('0x10')]};}return null;})[_0x2353('0xc')](respondWithResult(_0x4d5d2f,null))[_0x2353('0x11')](handleError(_0x4d5d2f,null));};exports[_0x2353('0x12')]=function(_0x1eddda,_0x45478b){return pm2['describe'](_0x1eddda[_0x2353('0x13')]['id'])['then'](respondWithResult(_0x45478b,null))[_0x2353('0xc')](handleEntityNotFound(_0x45478b,null))['catch'](handleError(_0x45478b,null));};exports[_0x2353('0x14')]=function(_0xfae35,_0x4fd89a){if(_0xfae35['body'][_0x2353('0x8')]&&_0xfae35['body'][_0x2353('0x15')]){var _0x580ac1=path['join'](__dirname,_0x2353('0x16'),_0xfae35[_0x2353('0x17')]['script']);var _0x447e54=process[_0x2353('0x18')]();process[_0x2353('0x19')](path[_0x2353('0x1a')](_0x580ac1));return execChildProcess()[_0x2353('0xc')](function(_0x5d3bb0){process['chdir'](_0x447e54);return pm2[_0x2353('0x1b')]({'name':_0xfae35['body'][_0x2353('0x8')],'script':_0x580ac1});})[_0x2353('0xc')](function(_0x1f9077){pm2[_0x2353('0x1c')]();return _0x1f9077[0x0];})[_0x2353('0xc')](respondWithResult(_0x4fd89a,0xc9))['catch'](handleError(_0x4fd89a,null));}else{return _0x4fd89a['status'](0x1f4)[_0x2353('0x1d')]({'message':_0x2353('0x1e')});}};exports[_0x2353('0x1f')]=function(_0x191726,_0x4380aa){if(_0x191726[_0x2353('0x17')]['id']){delete _0x191726['body']['id'];}var _0x279224={'online':_0x2353('0x20'),'stopped':'stop'};if(_0x279224[_0x2353('0x21')](_0x191726[_0x2353('0x17')]['status'])){return pm2[_0x279224[_0x191726['body'][_0x2353('0x6')]]](_0x191726['params']['id'])[_0x2353('0xc')](respondWithResult(_0x4380aa,0xc8))[_0x2353('0x11')](handleError(_0x4380aa,null));}else{return _0x4380aa[_0x2353('0x6')](0x1f4)[_0x2353('0x1d')]({'message':_0x2353('0x22')});}};exports[_0x2353('0x23')]=function(_0x4e4f61,_0x139d8f){if(_0x4e4f61['body']['id']){delete _0x4e4f61[_0x2353('0x17')]['id'];}if(_0x4e4f61[_0x2353('0x13')]['id']){return pm2['delete'](_0x4e4f61[_0x2353('0x13')]['id'])[_0x2353('0xc')](function(_0x360b4a){pm2[_0x2353('0x1c')]();return _0x360b4a[0x0];})[_0x2353('0xc')](respondWithResult(_0x139d8f,null))[_0x2353('0x11')](handleError(_0x139d8f,null));}else{return _0x139d8f[_0x2353('0x6')](0x1f4)['send']({'message':_0x2353('0x24')});}}; \ No newline at end of file +var _0x03cb=['api','path','child_process','exec','bluebird','sendStatus','json','error','stack','name','status','send','info','then','reject','express','motion2','length','catch','params','create','body','script','join','../../files/plugins','chdir','dirname','start','Missing\x20name\x20and/or\x20path','stop','destroy','delete','Unknown\x20id','../../config/pm2','../../config/logger'];(function(_0x3de46c,_0x616909){var _0x1b794a=function(_0x49a5b9){while(--_0x49a5b9){_0x3de46c['push'](_0x3de46c['shift']());}};_0x1b794a(++_0x616909);}(_0x03cb,0xf3));var _0xb03c=function(_0x52b162,_0x3ac479){_0x52b162=_0x52b162-0x0;var _0xc7579a=_0x03cb[_0x52b162];return _0xc7579a;};'use strict';var _=require('lodash');var pm2=require(_0xb03c('0x0'));var logger=require(_0xb03c('0x1'))(_0xb03c('0x2'));var path=require(_0xb03c('0x3'));var exec=require(_0xb03c('0x4'))[_0xb03c('0x5')];var BPromise=require(_0xb03c('0x6'));function handleEntityNotFound(_0x2c2139,_0x2cd121){return function(_0xba72af){if(!_0xba72af){_0x2c2139[_0xb03c('0x7')](0x194);;}return _0xba72af;};}function respondWithResult(_0x5004c5,_0x11f720){_0x11f720=_0x11f720||0xc8;return function(_0x93ed27){if(_0x93ed27){return _0x5004c5['status'](_0x11f720)[_0xb03c('0x8')](_0x93ed27);}return null;};}function handleError(_0x1f0d4d,_0x415c73){_0x415c73=_0x415c73||0x1f4;return function(_0x352bc8){logger[_0xb03c('0x9')](_0x352bc8[_0xb03c('0xa')]);if(_0x352bc8[_0xb03c('0xb')]){delete _0x352bc8[_0xb03c('0xb')];}_0x1f0d4d[_0xb03c('0xc')](_0x415c73)[_0xb03c('0xd')](_0x352bc8);};}function execChildProcess(){return new BPromise(function(_0x23b054,_0xf5c32a){exec('npm\x20install',function(_0x189caf,_0x335dbe,_0x1f26b9){logger['info'](_0x335dbe);logger[_0xb03c('0xe')](_0x1f26b9);if(_0x189caf){logger[_0xb03c('0x9')](_0x189caf);return _0xf5c32a(_0x189caf);}return _0x23b054(_0x335dbe);});});}exports['index']=function(_0xa2bda5,_0x4c1e24){return pm2['list']()[_0xb03c('0xf')](function(_0x37e0fb){if(_0x37e0fb){var _0x4a81f0=_[_0xb03c('0x10')](_0x37e0fb,function(_0x4c109c){return _0x4c109c[_0xb03c('0xb')]===_0xb03c('0x11')||_0x4c109c['name']===_0xb03c('0x12');});return{'rows':_0x4a81f0,'count':_0x4a81f0[_0xb03c('0x13')]};}return null;})[_0xb03c('0xf')](respondWithResult(_0x4c1e24,null))[_0xb03c('0x14')](handleError(_0x4c1e24,null));};exports['show']=function(_0x1c4bae,_0x138e3a){return pm2['describe'](_0x1c4bae[_0xb03c('0x15')]['id'])[_0xb03c('0xf')](respondWithResult(_0x138e3a,null))[_0xb03c('0xf')](handleEntityNotFound(_0x138e3a,null))['catch'](handleError(_0x138e3a,null));};exports[_0xb03c('0x16')]=function(_0x2bc86b,_0x530e08){if(_0x2bc86b[_0xb03c('0x17')]['name']&&_0x2bc86b['body'][_0xb03c('0x18')]){var _0x513c62=path[_0xb03c('0x19')](__dirname,_0xb03c('0x1a'),_0x2bc86b[_0xb03c('0x17')][_0xb03c('0x18')]);var _0x43c017=process['cwd']();process[_0xb03c('0x1b')](path[_0xb03c('0x1c')](_0x513c62));return execChildProcess()[_0xb03c('0xf')](function(_0x58d477){process[_0xb03c('0x1b')](_0x43c017);return pm2[_0xb03c('0x1d')]({'name':_0x2bc86b[_0xb03c('0x17')]['name'],'script':_0x513c62});})['then'](function(_0x5e5eb0){pm2['dump']();return _0x5e5eb0[0x0];})[_0xb03c('0xf')](respondWithResult(_0x530e08,0xc9))['catch'](handleError(_0x530e08,null));}else{return _0x530e08['status'](0x1f4)[_0xb03c('0xd')]({'message':_0xb03c('0x1e')});}};exports['update']=function(_0x4fdd7a,_0x26d0da){if(_0x4fdd7a[_0xb03c('0x17')]['id']){delete _0x4fdd7a[_0xb03c('0x17')]['id'];}var _0x2b3762={'online':'restart','stopped':_0xb03c('0x1f')};if(_0x2b3762['hasOwnProperty'](_0x4fdd7a[_0xb03c('0x17')][_0xb03c('0xc')])){return pm2[_0x2b3762[_0x4fdd7a['body'][_0xb03c('0xc')]]](_0x4fdd7a['params']['id'])['then'](respondWithResult(_0x26d0da,0xc8))[_0xb03c('0x14')](handleError(_0x26d0da,null));}else{return _0x26d0da['status'](0x1f4)['send']({'message':'Unknown\x20status'});}};exports[_0xb03c('0x20')]=function(_0x39efbe,_0x1a8a46){if(_0x39efbe['body']['id']){delete _0x39efbe[_0xb03c('0x17')]['id'];}if(_0x39efbe[_0xb03c('0x15')]['id']){return pm2[_0xb03c('0x21')](_0x39efbe[_0xb03c('0x15')]['id'])[_0xb03c('0xf')](function(_0x7741a7){pm2['dump']();return _0x7741a7[0x0];})[_0xb03c('0xf')](respondWithResult(_0x1a8a46,null))[_0xb03c('0x14')](handleError(_0x1a8a46,null));}else{return _0x1a8a46['status'](0x1f4)[_0xb03c('0xd')]({'message':_0xb03c('0x22')});}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index c7632cf..59402b3 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 _0xd0dc=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','util','path','connect-timeout'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0xd0dc,0x9e));var _0xcd0d=function(_0x49f19e,_0x1c3aa3){_0x49f19e=_0x49f19e-0x0;var _0x280b5a=_0xd0dc[_0x49f19e];return _0x280b5a;};'use strict';var multer=require(_0xcd0d('0x0'));var util=require(_0xcd0d('0x1'));var path=require(_0xcd0d('0x2'));var timeout=require(_0xcd0d('0x3'));var express=require('express');var router=express[_0xcd0d('0x4')]();var auth=require(_0xcd0d('0x5'));var interaction=require(_0xcd0d('0x6'));var config=require(_0xcd0d('0x7'));module[_0xcd0d('0x8')]=router; \ No newline at end of file +var _0x9f2a=['../../components/interaction/service','../../config/environment','exports','path','connect-timeout','express','Router'];(function(_0x56b606,_0x454ae9){var _0x213c40=function(_0x2f4a04){while(--_0x2f4a04){_0x56b606['push'](_0x56b606['shift']());}};_0x213c40(++_0x454ae9);}(_0x9f2a,0x1d8));var _0xa9f2=function(_0x4401c3,_0x4d6cd3){_0x4401c3=_0x4401c3-0x0;var _0x417603=_0x9f2a[_0x4401c3];return _0x417603;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xa9f2('0x0'));var timeout=require(_0xa9f2('0x1'));var express=require(_0xa9f2('0x2'));var router=express[_0xa9f2('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xa9f2('0x4'));var config=require(_0xa9f2('0x5'));module[_0xa9f2('0x6')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 9d3fd25..d6256e6 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 _0x6cee=['STRING','sequelize','INTEGER','DATE'];(function(_0x1290e4,_0x2c0be2){var _0x82a2aa=function(_0x2bfcb6){while(--_0x2bfcb6){_0x1290e4['push'](_0x1290e4['shift']());}};_0x82a2aa(++_0x2c0be2);}(_0x6cee,0xd1));var _0xe6ce=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0x6cee[_0x54d4fe];return _0x1ab5bb;};'use strict';var Sequelize=require(_0xe6ce('0x0'));module['exports']={'state':{'type':Sequelize[_0xe6ce('0x1')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0xe6ce('0x2')]},'uniqueid':{'type':Sequelize[_0xe6ce('0x3')]},'starttime':{'type':Sequelize[_0xe6ce('0x2')]},'responsetime':{'type':Sequelize[_0xe6ce('0x2')]},'ringtime':{'type':Sequelize[_0xe6ce('0x1')],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xe6ce('0x3')]},'membername':{'type':Sequelize[_0xe6ce('0x3')]}}; \ No newline at end of file +var _0xff29=['DATE','exports','INTEGER','STRING'];(function(_0x695b76,_0x551526){var _0x1dc21f=function(_0x5fdb1c){while(--_0x5fdb1c){_0x695b76['push'](_0x695b76['shift']());}};_0x1dc21f(++_0x551526);}(_0xff29,0x189));var _0x9ff2=function(_0x40535a,_0x86dc02){_0x40535a=_0x40535a-0x0;var _0x203059=_0xff29[_0x40535a];return _0x203059;};'use strict';var Sequelize=require('sequelize');module[_0x9ff2('0x0')]={'state':{'type':Sequelize[_0x9ff2('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x9ff2('0x2')]},'scheduledat':{'type':Sequelize[_0x9ff2('0x3')]},'uniqueid':{'type':Sequelize[_0x9ff2('0x2')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x9ff2('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x9ff2('0x2')]},'campaigntype':{'type':Sequelize[_0x9ff2('0x2')]},'membername':{'type':Sequelize[_0x9ff2('0x2')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index ea53a49..d75d0e8 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 _0xca1c=['api','moment','request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','ReportAgentPreview','report_agent_preview','lodash'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0xca1c,0x16a));var _0xcca1=function(_0x44a3db,_0x5b2c73){_0x44a3db=_0x44a3db-0x0;var _0x5e832d=_0xca1c[_0x44a3db];return _0x5e832d;};'use strict';var _=require(_0xcca1('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xcca1('0x1'));var moment=require(_0xcca1('0x2'));var BPromise=require('bluebird');var rp=require(_0xcca1('0x3'));var fs=require('fs');var path=require(_0xcca1('0x4'));var rimraf=require(_0xcca1('0x5'));var config=require(_0xcca1('0x6'));var attributes=require(_0xcca1('0x7'));module[_0xcca1('0x8')]=function(_0x2f5524,_0x508c83){return _0x2f5524['define'](_0xcca1('0x9'),attributes,{'tableName':_0xcca1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb4e2=['lodash','util','../../config/logger','api','bluebird','rimraf','./reportAgentPreview.attributes','define','report_agent_preview'];(function(_0x144352,_0x239a85){var _0x553511=function(_0x13ab0f){while(--_0x13ab0f){_0x144352['push'](_0x144352['shift']());}};_0x553511(++_0x239a85);}(_0xb4e2,0xcf));var _0x2b4e=function(_0x276cf1,_0x1a2d93){_0x276cf1=_0x276cf1-0x0;var _0x48c6eb=_0xb4e2[_0x276cf1];return _0x48c6eb;};'use strict';var _=require(_0x2b4e('0x0'));var util=require(_0x2b4e('0x1'));var logger=require(_0x2b4e('0x2'))(_0x2b4e('0x3'));var moment=require('moment');var BPromise=require(_0x2b4e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2b4e('0x5'));var config=require('../../config/environment');var attributes=require(_0x2b4e('0x6'));module['exports']=function(_0x3d7fca,_0x7f1c93){return _0x3d7fca[_0x2b4e('0x7')]('ReportAgentPreview',attributes,{'tableName':_0x2b4e('0x8'),'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 a8d3929..dab57a5 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 _0x4660=['message','catch','CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw','debug','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0x4660,0x75));var _0x0466=function(_0x47e0a9,_0x2efea){_0x47e0a9=_0x47e0a9-0x0;var _0x133174=_0x4660[_0x47e0a9];return _0x133174;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0466('0x0'));var BPromise=require(_0x0466('0x1'));var rs=require(_0x0466('0x2'));var fs=require('fs');var Redis=require(_0x0466('0x3'));var db=require(_0x0466('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0466('0x5'))('rpc');var config=require(_0x0466('0x6'));var jayson=require(_0x0466('0x7'));var client=jayson[_0x0466('0x8')][_0x0466('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x212bcd,_0xeb58f3,_0x271a65){return new BPromise(function(_0x592527,_0x381560){return client[_0x0466('0xa')](_0x212bcd,_0x271a65)[_0x0466('0xb')](function(_0x1af7cb){logger[_0x0466('0xc')](_0x0466('0xd'),_0xeb58f3,_0x0466('0xe'));logger['debug']('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0xeb58f3,_0x0466('0xe'),JSON[_0x0466('0xf')](_0x1af7cb));if(_0x1af7cb[_0x0466('0x10')]){if(_0x1af7cb[_0x0466('0x10')][_0x0466('0x11')]===0x1f4){logger['error'](_0x0466('0xd'),_0xeb58f3,_0x1af7cb['error'][_0x0466('0x12')]);return _0x381560(_0x1af7cb['error'][_0x0466('0x12')]);}logger[_0x0466('0x10')](_0x0466('0xd'),_0xeb58f3,_0x1af7cb[_0x0466('0x10')][_0x0466('0x12')]);return _0x592527(_0x1af7cb[_0x0466('0x10')][_0x0466('0x12')]);}else{logger['info'](_0x0466('0xd'),_0xeb58f3,_0x0466('0xe'));_0x592527(_0x1af7cb['result'][_0x0466('0x12')]);}})[_0x0466('0x13')](function(_0x3c1991){logger[_0x0466('0x10')]('ReportAgentPreview,\x20%s,\x20%s',_0xeb58f3,_0x3c1991);_0x381560(_0x3c1991);});});}exports[_0x0466('0x14')]=function(_0x4a4828){var _0xcfd846=this;return new Promise(function(_0x27affc,_0x27dfa3){return db[_0x0466('0x15')][_0x0466('0x16')](_0x4a4828[_0x0466('0x17')],{'raw':_0x4a4828[_0x0466('0x18')]?_0x4a4828[_0x0466('0x18')][_0x0466('0x19')]===undefined?!![]:![]:!![]})[_0x0466('0xb')](function(_0x222ead){logger['info'](_0x0466('0x14'),_0x4a4828);logger[_0x0466('0x1a')](_0x0466('0x14'),_0x4a4828,JSON[_0x0466('0xf')](_0x222ead));_0x27affc(_0x222ead);})[_0x0466('0x13')](function(_0xe45343){logger[_0x0466('0x10')](_0x0466('0x14'),_0xe45343['message'],_0x4a4828);_0x27dfa3(_0xcfd846[_0x0466('0x10')](0x1f4,_0xe45343[_0x0466('0x12')]));});});}; \ No newline at end of file +var _0xf35e=['result','catch','CreateReportAgentPreview','ReportAgentPreview','body','options','raw','then','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x224b13,_0x138e88){var _0x109a72=function(_0x1b4640){while(--_0x1b4640){_0x224b13['push'](_0x224b13['shift']());}};_0x109a72(++_0x138e88);}(_0xf35e,0xb0));var _0xef35=function(_0x5c95c9,_0x18e84e){_0x5c95c9=_0x5c95c9-0x0;var _0x431efc=_0xf35e[_0x5c95c9];return _0x431efc;};'use strict';var _=require(_0xef35('0x0'));var util=require(_0xef35('0x1'));var moment=require(_0xef35('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xef35('0x3'))['db'];var utils=require(_0xef35('0x4'));var logger=require(_0xef35('0x5'))(_0xef35('0x6'));var config=require(_0xef35('0x7'));var jayson=require(_0xef35('0x8'));var client=jayson[_0xef35('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1a2e46,_0x104d50,_0x47ab33){return new BPromise(function(_0x23f1e8,_0x245f0a){return client[_0xef35('0xa')](_0x1a2e46,_0x47ab33)['then'](function(_0x480d60){logger[_0xef35('0xb')](_0xef35('0xc'),_0x104d50,_0xef35('0xd'));logger[_0xef35('0xe')](_0xef35('0xf'),_0x104d50,_0xef35('0xd'),JSON[_0xef35('0x10')](_0x480d60));if(_0x480d60[_0xef35('0x11')]){if(_0x480d60[_0xef35('0x11')][_0xef35('0x12')]===0x1f4){logger['error'](_0xef35('0xc'),_0x104d50,_0x480d60[_0xef35('0x11')][_0xef35('0x13')]);return _0x245f0a(_0x480d60[_0xef35('0x11')][_0xef35('0x13')]);}logger['error'](_0xef35('0xc'),_0x104d50,_0x480d60['error'][_0xef35('0x13')]);return _0x23f1e8(_0x480d60[_0xef35('0x11')][_0xef35('0x13')]);}else{logger[_0xef35('0xb')]('ReportAgentPreview,\x20%s,\x20%s',_0x104d50,_0xef35('0xd'));_0x23f1e8(_0x480d60[_0xef35('0x14')][_0xef35('0x13')]);}})[_0xef35('0x15')](function(_0x373b8e){logger[_0xef35('0x11')](_0xef35('0xc'),_0x104d50,_0x373b8e);_0x245f0a(_0x373b8e);});});}exports[_0xef35('0x16')]=function(_0x5af692){var _0x219ab1=this;return new Promise(function(_0x3fdc04,_0x545926){return db[_0xef35('0x17')]['create'](_0x5af692[_0xef35('0x18')],{'raw':_0x5af692['options']?_0x5af692[_0xef35('0x19')][_0xef35('0x1a')]===undefined?!![]:![]:!![]})[_0xef35('0x1b')](function(_0x56f3e1){logger[_0xef35('0xb')]('CreateReportAgentPreview',_0x5af692);logger[_0xef35('0xe')](_0xef35('0x16'),_0x5af692,JSON[_0xef35('0x10')](_0x56f3e1));_0x3fdc04(_0x56f3e1);})[_0xef35('0x15')](function(_0x461525){logger[_0xef35('0x11')](_0xef35('0x16'),_0x461525[_0xef35('0x13')],_0x5af692);_0x545926(_0x219ab1[_0xef35('0x11')](0x1f4,_0x461525[_0xef35('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 4e571a5..334f400 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 _0x1c22=['fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','showOpenchannelQueues','/sms/queues/:id/notify','sms','/agents/:id/notify','exports','util','path','express','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','/voice/channels/:uniqueid/stopmixmonitor','/voice/queues','/chat/queues','chatQueues','/mail/queues','mailAccounts','/openchannel/queues','/sms/queues','smsQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','/voice/queues/:id','showVoiceQueues','/outbound','outbound','outboundChannels','put','/agents/:id/capacity','agentCapacity','/telephones','telephones','trunks','/campaigns','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/fax/queues/waitinginteractions','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','post','/chat/queues/:id/notify','showChatQueues','/fax/queues/:id/notify'];(function(_0x44567b,_0x129b1e){var _0x281110=function(_0x3140af){while(--_0x3140af){_0x44567b['push'](_0x44567b['shift']());}};_0x281110(++_0x129b1e);}(_0x1c22,0x1ed));var _0x21c2=function(_0x5b5027,_0x19faec){_0x5b5027=_0x5b5027-0x0;var _0x17fb7d=_0x1c22[_0x5b5027];return _0x17fb7d;};'use strict';var multer=require('multer');var util=require(_0x21c2('0x0'));var path=require(_0x21c2('0x1'));var express=require(_0x21c2('0x2'));var router=express[_0x21c2('0x3')]();var auth=require(_0x21c2('0x4'));var controller=require(_0x21c2('0x5'));router[_0x21c2('0x6')](_0x21c2('0x7'),auth[_0x21c2('0x8')](),controller[_0x21c2('0x9')]);router[_0x21c2('0x6')](_0x21c2('0xa'),auth[_0x21c2('0x8')](),controller['voiceChannelMixMonitor']);router['get'](_0x21c2('0xb'),auth[_0x21c2('0x8')](),controller['voiceChannelStopMixMonitor']);router[_0x21c2('0x6')](_0x21c2('0xc'),auth[_0x21c2('0x8')](),controller['voiceQueues']);router[_0x21c2('0x6')](_0x21c2('0xd'),auth[_0x21c2('0x8')](),controller[_0x21c2('0xe')]);router[_0x21c2('0x6')](_0x21c2('0xf'),auth[_0x21c2('0x8')](),controller['mailQueues']);router['get']('/mail/accounts',auth['isAuthenticated'](),controller[_0x21c2('0x10')]);router[_0x21c2('0x6')](_0x21c2('0x11'),auth[_0x21c2('0x8')](),controller['openchannelQueues']);router[_0x21c2('0x6')](_0x21c2('0x12'),auth[_0x21c2('0x8')](),controller[_0x21c2('0x13')]);router[_0x21c2('0x6')](_0x21c2('0x14'),auth[_0x21c2('0x8')](),controller[_0x21c2('0x15')]);router[_0x21c2('0x6')](_0x21c2('0x16'),auth[_0x21c2('0x8')](),controller[_0x21c2('0x17')]);router[_0x21c2('0x6')](_0x21c2('0x18'),auth['isAuthenticated'](),controller[_0x21c2('0x19')]);router[_0x21c2('0x6')](_0x21c2('0x1a'),auth[_0x21c2('0x8')](),controller[_0x21c2('0x1b')]);router[_0x21c2('0x6')](_0x21c2('0x1c'),auth[_0x21c2('0x8')](),controller[_0x21c2('0x1d')]);router[_0x21c2('0x6')](_0x21c2('0x1e'),auth[_0x21c2('0x8')](),controller['voiceQueuesChannelRedirect']);router[_0x21c2('0x6')](_0x21c2('0x1f'),auth[_0x21c2('0x8')](),controller[_0x21c2('0x20')]);router['get'](_0x21c2('0x21'),auth[_0x21c2('0x8')](),controller[_0x21c2('0x22')]);router[_0x21c2('0x6')]('/outbound/channels',auth[_0x21c2('0x8')](),controller[_0x21c2('0x23')]);router[_0x21c2('0x6')]('/agents',auth[_0x21c2('0x8')](),controller['agents']);router[_0x21c2('0x24')](_0x21c2('0x25'),auth['isAuthenticated'](),controller[_0x21c2('0x26')]);router[_0x21c2('0x6')](_0x21c2('0x27'),auth[_0x21c2('0x8')](),controller[_0x21c2('0x28')]);router[_0x21c2('0x6')]('/trunks',auth['isAuthenticated'](),controller[_0x21c2('0x29')]);router[_0x21c2('0x6')](_0x21c2('0x2a'),auth[_0x21c2('0x8')](),controller['campaigns']);router[_0x21c2('0x6')]('/fax/accounts',auth['isAuthenticated'](),controller['faxAccounts']);router['get']('/chat/queues/waitinginteractions',auth[_0x21c2('0x8')](),controller[_0x21c2('0x2b')]);router[_0x21c2('0x6')]('/mail/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0x21c2('0x2c')]);router[_0x21c2('0x6')](_0x21c2('0x2d'),auth['isAuthenticated'](),controller[_0x21c2('0x2e')]);router[_0x21c2('0x6')](_0x21c2('0x2f'),auth[_0x21c2('0x8')](),controller[_0x21c2('0x30')]);router[_0x21c2('0x6')](_0x21c2('0x31'),auth[_0x21c2('0x8')](),controller['faxQueuesWaitingInteractions']);router['post'](_0x21c2('0x32'),auth[_0x21c2('0x8')](),controller[_0x21c2('0x33')](_0x21c2('0x34')));router[_0x21c2('0x6')](_0x21c2('0x35'),auth[_0x21c2('0x8')](),controller[_0x21c2('0x36')]);router[_0x21c2('0x37')](_0x21c2('0x38'),auth[_0x21c2('0x8')](),controller[_0x21c2('0x33')]('chat'));router[_0x21c2('0x6')]('/chat/queues/:id',auth['isAuthenticated'](),controller[_0x21c2('0x39')]);router[_0x21c2('0x37')](_0x21c2('0x3a'),auth[_0x21c2('0x8')](),controller['queueNotify'](_0x21c2('0x3b')));router['get'](_0x21c2('0x3c'),auth['isAuthenticated'](),controller[_0x21c2('0x3d')]);router[_0x21c2('0x37')](_0x21c2('0x3e'),auth['isAuthenticated'](),controller['queueNotify'](_0x21c2('0x3f')));router[_0x21c2('0x6')]('/openchannel/queues/:id',auth[_0x21c2('0x8')](),controller[_0x21c2('0x40')]);router[_0x21c2('0x37')](_0x21c2('0x41'),auth['isAuthenticated'](),controller[_0x21c2('0x33')](_0x21c2('0x42')));router[_0x21c2('0x6')]('/sms/queues/:id',auth['isAuthenticated'](),controller['showSmsQueues']);router['post'](_0x21c2('0x43'),auth['isAuthenticated'](),controller['agentNotify']);module[_0x21c2('0x44')]=router; \ No newline at end of file +var _0xfbf7=['/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','/outbound/channels','outboundChannels','/agents','agents','put','/agents/:id/capacity','/telephones','/trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','/openchannel/queues/waitinginteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','/chat/queues/:id','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','sms','/sms/queues/:id','showSmsQueues','agentNotify','exports','util','path','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','voiceChannels','/voice/channels/:uniqueid/mixmonitor','isAuthenticated','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','/chat/queues','chatQueues','/mail/queues','/mail/accounts','mailAccounts','openchannelQueues','/sms/queues','smsQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup'];(function(_0x5bff27,_0x5a93f9){var _0x470f9d=function(_0x57c3ed){while(--_0x57c3ed){_0x5bff27['push'](_0x5bff27['shift']());}};_0x470f9d(++_0x5a93f9);}(_0xfbf7,0x14b));var _0x7fbf=function(_0x516a20,_0x43b811){_0x516a20=_0x516a20-0x0;var _0x4071a0=_0xfbf7[_0x516a20];return _0x4071a0;};'use strict';var multer=require('multer');var util=require(_0x7fbf('0x0'));var path=require(_0x7fbf('0x1'));var express=require('express');var router=express[_0x7fbf('0x2')]();var auth=require(_0x7fbf('0x3'));var controller=require(_0x7fbf('0x4'));router[_0x7fbf('0x5')](_0x7fbf('0x6'),auth['isAuthenticated'](),controller[_0x7fbf('0x7')]);router[_0x7fbf('0x5')](_0x7fbf('0x8'),auth[_0x7fbf('0x9')](),controller[_0x7fbf('0xa')]);router['get'](_0x7fbf('0xb'),auth['isAuthenticated'](),controller[_0x7fbf('0xc')]);router[_0x7fbf('0x5')](_0x7fbf('0xd'),auth[_0x7fbf('0x9')](),controller['voiceQueues']);router[_0x7fbf('0x5')](_0x7fbf('0xe'),auth[_0x7fbf('0x9')](),controller[_0x7fbf('0xf')]);router[_0x7fbf('0x5')](_0x7fbf('0x10'),auth['isAuthenticated'](),controller['mailQueues']);router[_0x7fbf('0x5')](_0x7fbf('0x11'),auth['isAuthenticated'](),controller[_0x7fbf('0x12')]);router[_0x7fbf('0x5')]('/openchannel/queues',auth[_0x7fbf('0x9')](),controller[_0x7fbf('0x13')]);router[_0x7fbf('0x5')](_0x7fbf('0x14'),auth[_0x7fbf('0x9')](),controller[_0x7fbf('0x15')]);router['get']('/fax/queues',auth[_0x7fbf('0x9')](),controller['faxQueues']);router[_0x7fbf('0x5')](_0x7fbf('0x16'),auth['isAuthenticated'](),controller[_0x7fbf('0x17')]);router[_0x7fbf('0x5')](_0x7fbf('0x18'),auth[_0x7fbf('0x9')](),controller['voiceQueuesChannels']);router['get'](_0x7fbf('0x19'),auth[_0x7fbf('0x9')](),controller[_0x7fbf('0x1a')]);router[_0x7fbf('0x5')](_0x7fbf('0x1b'),auth[_0x7fbf('0x9')](),controller[_0x7fbf('0x1c')]);router['get'](_0x7fbf('0x1d'),auth['isAuthenticated'](),controller[_0x7fbf('0x1e')]);router[_0x7fbf('0x5')](_0x7fbf('0x1f'),auth[_0x7fbf('0x9')](),controller[_0x7fbf('0x20')]);router[_0x7fbf('0x5')]('/outbound',auth[_0x7fbf('0x9')](),controller['outbound']);router[_0x7fbf('0x5')](_0x7fbf('0x21'),auth[_0x7fbf('0x9')](),controller[_0x7fbf('0x22')]);router[_0x7fbf('0x5')](_0x7fbf('0x23'),auth[_0x7fbf('0x9')](),controller[_0x7fbf('0x24')]);router[_0x7fbf('0x25')](_0x7fbf('0x26'),auth[_0x7fbf('0x9')](),controller['agentCapacity']);router['get'](_0x7fbf('0x27'),auth[_0x7fbf('0x9')](),controller['telephones']);router[_0x7fbf('0x5')](_0x7fbf('0x28'),auth[_0x7fbf('0x9')](),controller['trunks']);router['get'](_0x7fbf('0x29'),auth[_0x7fbf('0x9')](),controller[_0x7fbf('0x2a')]);router[_0x7fbf('0x5')](_0x7fbf('0x2b'),auth['isAuthenticated'](),controller[_0x7fbf('0x2c')]);router[_0x7fbf('0x5')](_0x7fbf('0x2d'),auth[_0x7fbf('0x9')](),controller[_0x7fbf('0x2e')]);router[_0x7fbf('0x5')](_0x7fbf('0x2f'),auth[_0x7fbf('0x9')](),controller['mailQueuesWaitingInteractions']);router[_0x7fbf('0x5')](_0x7fbf('0x30'),auth[_0x7fbf('0x9')](),controller['openchannelQueuesWaitingInteractions']);router['get'](_0x7fbf('0x31'),auth[_0x7fbf('0x9')](),controller[_0x7fbf('0x32')]);router[_0x7fbf('0x5')](_0x7fbf('0x33'),auth[_0x7fbf('0x9')](),controller[_0x7fbf('0x34')]);router[_0x7fbf('0x35')](_0x7fbf('0x36'),auth[_0x7fbf('0x9')](),controller[_0x7fbf('0x37')](_0x7fbf('0x38')));router[_0x7fbf('0x5')](_0x7fbf('0x39'),auth[_0x7fbf('0x9')](),controller[_0x7fbf('0x3a')]);router[_0x7fbf('0x35')](_0x7fbf('0x3b'),auth['isAuthenticated'](),controller[_0x7fbf('0x37')]('chat'));router['get'](_0x7fbf('0x3c'),auth[_0x7fbf('0x9')](),controller['showChatQueues']);router[_0x7fbf('0x35')](_0x7fbf('0x3d'),auth['isAuthenticated'](),controller[_0x7fbf('0x37')](_0x7fbf('0x3e')));router[_0x7fbf('0x5')](_0x7fbf('0x3f'),auth[_0x7fbf('0x9')](),controller[_0x7fbf('0x40')]);router[_0x7fbf('0x35')](_0x7fbf('0x41'),auth[_0x7fbf('0x9')](),controller['queueNotify'](_0x7fbf('0x42')));router['get']('/openchannel/queues/:id',auth[_0x7fbf('0x9')](),controller['showOpenchannelQueues']);router[_0x7fbf('0x35')]('/sms/queues/:id/notify',auth[_0x7fbf('0x9')](),controller[_0x7fbf('0x37')](_0x7fbf('0x43')));router[_0x7fbf('0x5')](_0x7fbf('0x44'),auth[_0x7fbf('0x9')](),controller[_0x7fbf('0x45')]);router[_0x7fbf('0x35')]('/agents/:id/notify',auth[_0x7fbf('0x9')](),controller[_0x7fbf('0x46')]);module[_0x7fbf('0x47')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index d89b67c..d30c1d1 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 _0xcc5e=['Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailAccounts','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','faxQueues','showFaxQueues','FaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','Website','Account','\x20Queue\x20not\x20found','messageId','Interaction','\x20Message\x20not\x20found','update','InteractionId','QueueId','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','capitalize','chat','User','findOne','agent','Agent\x20not\x20found','Message','queue','MessageId','From','agentTransferTimeout','moment','lodash','../../mysqldb','../../config/logger','api','jayson/promise','client','http','then','error','code','message','status','json','sendStatus','stack','name','send','isNil','rows','find','voiceChannels','VoiceChannels','query','catch','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','params','VoiceQueues','VoiceQueuesPreview','merge','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','outbound','Outbound','outboundChannels','agents','Agents','agentCapacity','body','interaction','user','hasOwnProperty','MemberReport','findAll','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','INTERACTION','interface','SIP/%s','internal','capacity','Trunks'];(function(_0x593980,_0x24e0d9){var _0x2f2d0a=function(_0x17fda8){while(--_0x17fda8){_0x593980['push'](_0x593980['shift']());}};_0x2f2d0a(++_0x24e0d9);}(_0xcc5e,0x181));var _0xecc5=function(_0x2da230,_0x5a5dfc){_0x2da230=_0x2da230-0x0;var _0x3504a9=_0xcc5e[_0x2da230];return _0x3504a9;};'use strict';var BPromise=require('bluebird');var moment=require(_0xecc5('0x0'));var _=require(_0xecc5('0x1'));var util=require('util');var db=require(_0xecc5('0x2'))['db'];var logger=require(_0xecc5('0x3'))(_0xecc5('0x4'));var jayson=require(_0xecc5('0x5'));var amiClient=jayson[_0xecc5('0x6')]['http']({'port':0x232a});var mailClient=jayson[_0xecc5('0x6')][_0xecc5('0x7')]({'port':0x232b});var routingClient=jayson[_0xecc5('0x6')][_0xecc5('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x13f2ca,_0x1ac053,_0x44fb2c){return new BPromise(function(_0x4ef694,_0x501691){var _0x5a8b6a=_0x44fb2c?_0x44fb2c:amiClient;return _0x5a8b6a['request'](_0x13f2ca,_0x1ac053)[_0xecc5('0x8')](function(_0x23d00a){if(_0x23d00a[_0xecc5('0x9')]){if(_0x23d00a[_0xecc5('0x9')][_0xecc5('0xa')]===0x1f4){return _0x501691(_0x23d00a['error']['message']);}return _0x4ef694(_0x23d00a['error'][_0xecc5('0xb')]);}else{_0x4ef694(_0x23d00a['result']);}})['catch'](function(_0x470cd3){_0x501691(_0x470cd3);});});}function respondWithResult(_0x2597c0,_0x240ea8){_0x240ea8=_0x240ea8||0xc8;return function(_0x5a777c){if(_0x5a777c){return _0x2597c0[_0xecc5('0xc')](_0x240ea8)[_0xecc5('0xd')](_0x5a777c);}return _0x2597c0[_0xecc5('0xe')](0x194);};}function handleError(_0x345156,_0x28dead){_0x28dead=_0x28dead||0x1f4;return function(_0x3c2618){logger[_0xecc5('0x9')](_0x3c2618[_0xecc5('0xf')]);if(_0x3c2618[_0xecc5('0x10')]){delete _0x3c2618[_0xecc5('0x10')];}_0x345156['status'](_0x28dead)[_0xecc5('0x11')](_0x3c2618);};}function findById(_0x45b72e){return function(_0x447c53){if(!_[_0xecc5('0x12')](_0x45b72e)&&!_[_0xecc5('0x12')](_0x447c53)&&!_['isNil'](_0x447c53[_0xecc5('0x13')])){return _[_0xecc5('0x14')](_0x447c53[_0xecc5('0x13')],function(_0x1bc835){return _0x1bc835['id']==_0x45b72e;});}return null;};}exports[_0xecc5('0x15')]=function(_0x440ab5,_0x46aa3a){return respondWithRpcPromise(_0xecc5('0x16'),_0x440ab5[_0xecc5('0x17')])[_0xecc5('0x8')](respondWithResult(_0x46aa3a,null))[_0xecc5('0x18')](handleError(_0x46aa3a,null));};exports['voiceChannelMixMonitor']=function(_0x2ab063,_0x2d0329){return respondWithRpcPromise('VoiceChannelMixMonitor',_['merge'](_0x2ab063[_0xecc5('0x17')],_0x2ab063['params']))[_0xecc5('0x8')](respondWithResult(_0x2d0329,null))[_0xecc5('0x18')](handleError(_0x2d0329,null));};exports[_0xecc5('0x19')]=function(_0x2b20c9,_0x2c68c2){return respondWithRpcPromise(_0xecc5('0x1a'),_['merge'](_0x2b20c9['query'],_0x2b20c9[_0xecc5('0x1b')]))[_0xecc5('0x8')](respondWithResult(_0x2c68c2,null))['catch'](handleError(_0x2c68c2,null));};exports['voiceQueues']=function(_0x3952b9,_0xe692f2){return respondWithRpcPromise(_0xecc5('0x1c'),_0x3952b9['query'])['then'](respondWithResult(_0xe692f2,null))['catch'](handleError(_0xe692f2,null));};exports['showVoiceQueues']=function(_0x5aa2d7,_0x12e899){return respondWithRpcPromise('VoiceQueues',_0x5aa2d7[_0xecc5('0x17')])[_0xecc5('0x8')](findById(_0x5aa2d7[_0xecc5('0x1b')]['id']))[_0xecc5('0x8')](respondWithResult(_0x12e899,null))['catch'](handleError(_0x12e899,null));};exports['voiceQueuesPreview']=function(_0x30a7b8,_0x206cef){return respondWithRpcPromise(_0xecc5('0x1d'),_[_0xecc5('0x1e')](_0x30a7b8[_0xecc5('0x17')],_0x30a7b8[_0xecc5('0x1b')]))[_0xecc5('0x8')](respondWithResult(_0x206cef,null))['catch'](handleError(_0x206cef,null));};exports['voiceQueuesChannels']=function(_0x3a66f3,_0xe286d0){return respondWithRpcPromise(_0xecc5('0x1f'),_0x3a66f3[_0xecc5('0x17')])[_0xecc5('0x8')](respondWithResult(_0xe286d0,null))[_0xecc5('0x18')](handleError(_0xe286d0,null));};exports[_0xecc5('0x20')]=function(_0x267957,_0x101463){return respondWithRpcPromise(_0xecc5('0x21'),_[_0xecc5('0x1e')](_0x267957[_0xecc5('0x17')],_0x267957[_0xecc5('0x1b')]))[_0xecc5('0x8')](respondWithResult(_0x101463,null))['catch'](handleError(_0x101463,null));};exports[_0xecc5('0x22')]=function(_0x4197f6,_0x3b4792){return respondWithRpcPromise(_0xecc5('0x23'),_['merge'](_0x4197f6[_0xecc5('0x17')],_0x4197f6[_0xecc5('0x1b')]))['then'](respondWithResult(_0x3b4792,null))['catch'](handleError(_0x3b4792,null));};exports['voiceQueuesChannelRedirect']=function(_0x376132,_0x27b50e){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0xecc5('0x1e')](_0x376132[_0xecc5('0x17')],_0x376132[_0xecc5('0x1b')]))[_0xecc5('0x8')](respondWithResult(_0x27b50e,null))[_0xecc5('0x18')](handleError(_0x27b50e,null));};exports[_0xecc5('0x24')]=function(_0x2f0472,_0x1a1b27){return respondWithRpcPromise(_0xecc5('0x25'),_0x2f0472[_0xecc5('0x17')])[_0xecc5('0x8')](respondWithResult(_0x1a1b27,null))[_0xecc5('0x18')](handleError(_0x1a1b27,null));};exports[_0xecc5('0x26')]=function(_0x528711,_0x2d15ff){return respondWithRpcPromise('OutboundChannels',_0x528711[_0xecc5('0x17')])['then'](respondWithResult(_0x2d15ff,null))['catch'](handleError(_0x2d15ff,null));};exports[_0xecc5('0x27')]=function(_0x2e787a,_0x15db54){var _0x350d5d;return respondWithRpcPromise(_0xecc5('0x28'),_0x2e787a[_0xecc5('0x17')])[_0xecc5('0x8')](function(_0x5d9668){_0x350d5d=_0x5d9668;return respondWithRpcPromise('Agents',_0x2e787a[_0xecc5('0x17')],routingClient);})[_0xecc5('0x8')](function(_0x46b031){return _[_0xecc5('0x1e')]({},_0x46b031,_0x350d5d);})[_0xecc5('0x8')](respondWithResult(_0x15db54,null))[_0xecc5('0x18')](handleError(_0x15db54,null));};exports[_0xecc5('0x29')]=function(_0xeb84a,_0x2f73f7){if(_0xeb84a[_0xecc5('0x2a')]&&_0xeb84a[_0xecc5('0x2a')][_0xecc5('0x2b')]&&_0xeb84a[_0xecc5('0x2c')]&&_0xeb84a[_0xecc5('0x2c')]['name']){for(var _0x236ddf in _0xeb84a[_0xecc5('0x2a')][_0xecc5('0x2b')]){if(_0xeb84a['body'][_0xecc5('0x2b')][_0xecc5('0x2d')](_0x236ddf)){db[_0xecc5('0x2e')][_0xecc5('0x2f')]({'where':{'channel':_0x236ddf,'membername':_0xeb84a['user'][_0xecc5('0x10')],'type':'INTERACTION','exitAt':null,'uniqueid':_0xeb84a[_0xecc5('0x2a')][_0xecc5('0x2b')][_0x236ddf]&&_0xeb84a[_0xecc5('0x2a')][_0xecc5('0x2b')][_0x236ddf][_0xecc5('0x30')]?{'$notIn':_0xeb84a[_0xecc5('0x2a')][_0xecc5('0x2b')][_0x236ddf]}:{'$ne':null}}})[_0xecc5('0x8')](function(_0x17f836){var _0x2c13ea=moment()[_0xecc5('0x31')](_0xecc5('0x32'));for(var _0x231582=0x0,_0x47ba75=_0x17f836[_0xecc5('0x30')];_0x231582<_0x47ba75;_0x231582+=0x1){_0x17f836[_0x231582][_0xecc5('0x33')]({'exitAt':_0x2c13ea});}});for(var _0x5386f3=0x0;_0x5386f3<_0xeb84a[_0xecc5('0x2a')][_0xecc5('0x2b')][_0x236ddf]['length'];_0x5386f3+=0x1){db[_0xecc5('0x2e')][_0xecc5('0x34')]({'where':{'channel':_0x236ddf,'membername':_0xeb84a['user']['name'],'type':_0xecc5('0x35'),'uniqueid':_0xeb84a[_0xecc5('0x2a')][_0xecc5('0x2b')][_0x236ddf][_0x5386f3],'exitAt':null},'defaults':{'channel':_0x236ddf,'membername':_0xeb84a['user'][_0xecc5('0x10')],'interface':_[_0xecc5('0x12')](_0xeb84a['user'][_0xecc5('0x36')])?util[_0xecc5('0x31')](_0xecc5('0x37'),_0xeb84a['user'][_0xecc5('0x10')]):_0xeb84a[_0xecc5('0x2c')][_0xecc5('0x36')],'type':_0xecc5('0x35'),'enterAt':moment()[_0xecc5('0x31')](_0xecc5('0x32')),'role':'agent','internal':_0xeb84a['user'][_0xecc5('0x38')],'uniqueid':_0xeb84a[_0xecc5('0x2a')][_0xecc5('0x2b')][_0x236ddf][_0x5386f3]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0xeb84a[_0xecc5('0x1b')]['id'],'capacity':_0xeb84a[_0xecc5('0x2a')][_0xecc5('0x39')]},routingClient)[_0xecc5('0x8')](respondWithResult(_0x2f73f7,null))[_0xecc5('0x18')](handleError(_0x2f73f7,null));};exports['telephones']=function(_0x4cbee1,_0xbe1aa5){return respondWithRpcPromise('Telephones',_0x4cbee1[_0xecc5('0x17')])[_0xecc5('0x8')](respondWithResult(_0xbe1aa5,null))[_0xecc5('0x18')](handleError(_0xbe1aa5,null));};exports['trunks']=function(_0xd8ae60,_0x205fa3){return respondWithRpcPromise(_0xecc5('0x3a'),_0xd8ae60[_0xecc5('0x17')])[_0xecc5('0x8')](respondWithResult(_0x205fa3,null))[_0xecc5('0x18')](handleError(_0x205fa3,null));};exports['campaigns']=function(_0xffbea2,_0x43a3c3){return respondWithRpcPromise(_0xecc5('0x3b'),_0xffbea2[_0xecc5('0x17')])[_0xecc5('0x8')](respondWithResult(_0x43a3c3,null))[_0xecc5('0x18')](handleError(_0x43a3c3,null));};exports[_0xecc5('0x3c')]=function(_0x59d558,_0x34a48e){return respondWithRpcPromise(_0xecc5('0x3d'),_0x59d558['query'],routingClient)[_0xecc5('0x8')](respondWithResult(_0x34a48e,null))[_0xecc5('0x18')](handleError(_0x34a48e,null));};exports[_0xecc5('0x3e')]=function(_0x4e546,_0x8ca294){return respondWithRpcPromise(_0xecc5('0x3d'),_0x4e546['query'],routingClient)[_0xecc5('0x8')](findById(_0x4e546[_0xecc5('0x1b')]['id']))[_0xecc5('0x8')](respondWithResult(_0x8ca294,null))[_0xecc5('0x18')](handleError(_0x8ca294,null));};exports[_0xecc5('0x3f')]=function(_0x2a44e6,_0x4084fa){return respondWithRpcPromise('MailQueues',_0x2a44e6[_0xecc5('0x17')],routingClient)[_0xecc5('0x8')](respondWithResult(_0x4084fa,null))['catch'](handleError(_0x4084fa,null));};exports['showMailQueues']=function(_0x71432d,_0xbbdf06){return respondWithRpcPromise('MailQueues',_0x71432d[_0xecc5('0x17')],routingClient)[_0xecc5('0x8')](findById(_0x71432d[_0xecc5('0x1b')]['id']))[_0xecc5('0x8')](respondWithResult(_0xbbdf06,null))[_0xecc5('0x18')](handleError(_0xbbdf06,null));};exports['mailAccounts']=function(_0x121c34,_0xeff0b8){return respondWithRpcPromise(_0xecc5('0x40'),_0x121c34[_0xecc5('0x17')],mailClient)[_0xecc5('0x8')](respondWithResult(_0xeff0b8,null))['catch'](handleError(_0xeff0b8,null));};exports['openchannelQueues']=function(_0xa8a440,_0x285924){return respondWithRpcPromise(_0xecc5('0x41'),_0xa8a440['query'],routingClient)[_0xecc5('0x8')](respondWithResult(_0x285924,null))['catch'](handleError(_0x285924,null));};exports[_0xecc5('0x42')]=function(_0x556b2a,_0x2e578e){return respondWithRpcPromise(_0xecc5('0x41'),_0x556b2a['query'],routingClient)['then'](findById(_0x556b2a['params']['id']))[_0xecc5('0x8')](respondWithResult(_0x2e578e,null))[_0xecc5('0x18')](handleError(_0x2e578e,null));};exports[_0xecc5('0x43')]=function(_0x3873df,_0x2f8903){return respondWithRpcPromise(_0xecc5('0x44'),_0x3873df[_0xecc5('0x17')],routingClient)[_0xecc5('0x8')](respondWithResult(_0x2f8903,null))[_0xecc5('0x18')](handleError(_0x2f8903,null));};exports['showSmsQueues']=function(_0x537de9,_0x17cc04){return respondWithRpcPromise(_0xecc5('0x44'),_0x537de9[_0xecc5('0x17')],routingClient)['then'](findById(_0x537de9['params']['id']))[_0xecc5('0x8')](respondWithResult(_0x17cc04,null))[_0xecc5('0x18')](handleError(_0x17cc04,null));};exports[_0xecc5('0x45')]=function(_0x5bff32,_0x44b9a9){return respondWithRpcPromise('FaxQueues',_0x5bff32[_0xecc5('0x17')],routingClient)['then'](respondWithResult(_0x44b9a9,null))['catch'](handleError(_0x44b9a9,null));};exports[_0xecc5('0x46')]=function(_0x3cf8b5,_0x4b76d2){return respondWithRpcPromise(_0xecc5('0x47'),_0x3cf8b5['query'],routingClient)[_0xecc5('0x8')](findById(_0x3cf8b5[_0xecc5('0x1b')]['id']))['then'](respondWithResult(_0x4b76d2,null))[_0xecc5('0x18')](handleError(_0x4b76d2,null));};exports[_0xecc5('0x48')]=function(_0x34fd75,_0x1752be){return respondWithRpcPromise(_0xecc5('0x49'),_0x34fd75[_0xecc5('0x17')])[_0xecc5('0x8')](respondWithResult(_0x1752be,null))[_0xecc5('0x18')](handleError(_0x1752be,null));};exports[_0xecc5('0x4a')]=function(_0x170dd5,_0x569333){return respondWithRpcPromise(_0xecc5('0x4b'),_0x170dd5[_0xecc5('0x17')],routingClient)[_0xecc5('0x8')](respondWithResult(_0x569333,null))[_0xecc5('0x18')](handleError(_0x569333,null));};exports[_0xecc5('0x4c')]=function(_0x35a5b1,_0x3acd68){return respondWithRpcPromise(_0xecc5('0x4d'),_0x35a5b1[_0xecc5('0x17')],routingClient)[_0xecc5('0x8')](respondWithResult(_0x3acd68,null))[_0xecc5('0x18')](handleError(_0x3acd68,null));};exports[_0xecc5('0x4e')]=function(_0x30865e,_0x434d75){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x30865e['query'],routingClient)['then'](respondWithResult(_0x434d75,null))[_0xecc5('0x18')](handleError(_0x434d75,null));};exports[_0xecc5('0x4f')]=function(_0x3075ab,_0x172e8d){return respondWithRpcPromise(_0xecc5('0x50'),_0x3075ab[_0xecc5('0x17')],routingClient)[_0xecc5('0x8')](respondWithResult(_0x172e8d,null))[_0xecc5('0x18')](handleError(_0x172e8d,null));};exports[_0xecc5('0x51')]=function(_0xca605,_0x4eb6a1){return respondWithRpcPromise(_0xecc5('0x52'),_0xca605['query'],routingClient)[_0xecc5('0x8')](respondWithResult(_0x4eb6a1,null))[_0xecc5('0x18')](handleError(_0x4eb6a1,null));};exports[_0xecc5('0x53')]=function(_0x3ed4d2){return function(_0x48cac9,_0x5ab72a){var _0x1459ca,_0x2a3cb6;var _0x1731e4=_['capitalize'](_0x3ed4d2);var _0x3bf86e=_0x3ed4d2==='chat'?_0xecc5('0x54'):_0xecc5('0x55');return db[_0x1731e4+'Queue']['findOne']({'raw':!![],'where':{'id':_0x48cac9[_0xecc5('0x1b')]['id']}})['then'](function(_0x4b70d0){if(_[_0xecc5('0x12')](_0x4b70d0)){throw new Error(_0x1731e4+_0xecc5('0x56'));}_0x1459ca=_0x4b70d0;return db[_0x1731e4+'Message']['findOne']({'where':{'id':_0x48cac9['body'][_0xecc5('0x57')]},'include':[{'model':db[_0x1731e4+_0xecc5('0x58')],'as':_0xecc5('0x58')},{'model':db[_0x1731e4+_0x3bf86e],'as':'Account'}]});})[_0xecc5('0x8')](function(_0x3ca674){if(_['isNil'](_0x3ca674)){throw new Error(_0x1731e4+_0xecc5('0x59'));}_0x2a3cb6=_0x3ca674;return _0x3ca674[_0xecc5('0x5a')]({'read':0x0,'readAt':null,'UserId':null});})[_0xecc5('0x8')](function(){var _0x241c71={'uniqueid':_0x3ed4d2+'.'+_0x2a3cb6['id']+'.'+_0x2a3cb6[_0xecc5('0x58')]['id'],'FromUserId':_0x48cac9['user']['id'],'type':'queue'};_0x241c71[_0x1731e4+'MessageId']=_0x2a3cb6['id'];_0x241c71[_0x1731e4+_0xecc5('0x5b')]=_0x2a3cb6[_0xecc5('0x58')]['id'];_0x241c71['From'+_0x1731e4+_0x3bf86e+'Id']=_0x2a3cb6['Account']['id'];_0x241c71['To'+_0x1731e4+_0xecc5('0x5c')]=_0x1459ca['id'];return db[_0x1731e4+_0xecc5('0x5d')][_0xecc5('0x5e')](_0x241c71);})[_0xecc5('0x8')](function(){return respondWithRpcPromise(_0xecc5('0x5f'),{'channel':_0x3ed4d2,'interaction':_0x2a3cb6[_0xecc5('0x58')],'message':_0x2a3cb6,'account':_0x2a3cb6[_0xecc5('0x55')],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x1459ca['name']+','+(_0x2a3cb6[_0xecc5('0x55')][_0xecc5('0x60')]||0x12c),'interval':_0xecc5('0x61')}]},routingClient);})[_0xecc5('0x8')](respondWithResult(_0x5ab72a,null))[_0xecc5('0x18')](handleError(_0x5ab72a,null));};};exports[_0xecc5('0x62')]=function(_0x50318f,_0x3a7107){var _0x377030,_0x23d1d7;if(_[_0xecc5('0x12')](_0x50318f[_0xecc5('0x2a')][_0xecc5('0x63')])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x54c34a=_0x50318f['body'][_0xecc5('0x63')];var _0x5957b6=_[_0xecc5('0x64')](_0x54c34a);var _0x5999b4=_0x54c34a===_0xecc5('0x65')?_0xecc5('0x54'):_0xecc5('0x55');return db[_0xecc5('0x66')][_0xecc5('0x67')]({'raw':!![],'where':{'id':_0x50318f[_0xecc5('0x1b')]['id'],'role':_0xecc5('0x68')}})[_0xecc5('0x8')](function(_0x5a92b7){if(_[_0xecc5('0x12')](_0x5a92b7)){throw new Error(_0xecc5('0x69'));}_0x377030=_0x5a92b7;return db[_0x5957b6+_0xecc5('0x6a')]['findOne']({'where':{'id':_0x50318f[_0xecc5('0x2a')][_0xecc5('0x57')]},'include':[{'model':db[_0x5957b6+_0xecc5('0x58')],'as':_0xecc5('0x58')},{'model':db[_0x5957b6+_0x5999b4],'as':_0xecc5('0x55')}]});})[_0xecc5('0x8')](function(_0x48cce9){if(_[_0xecc5('0x12')](_0x48cce9)){throw new Error(_0x5957b6+_0xecc5('0x59'));}_0x23d1d7=_0x48cce9;return _0x48cce9[_0xecc5('0x5a')]({'read':0x0,'readAt':null,'UserId':null});})[_0xecc5('0x8')](function(){var _0x18ecdf={'uniqueid':_0x54c34a+'.'+_0x23d1d7['id']+'.'+_0x23d1d7['Interaction']['id'],'FromUserId':_0x50318f[_0xecc5('0x2c')]['id'],'type':_0xecc5('0x6b'),'ToUserId':_0x377030['id']};_0x18ecdf[_0x5957b6+_0xecc5('0x6c')]=_0x23d1d7['id'];_0x18ecdf[_0x5957b6+_0xecc5('0x5b')]=_0x23d1d7[_0xecc5('0x58')]['id'];_0x18ecdf[_0xecc5('0x6d')+_0x5957b6+_0x5999b4+'Id']=_0x23d1d7[_0xecc5('0x55')]['id'];return db[_0x5957b6+_0xecc5('0x5d')]['create'](_0x18ecdf);})[_0xecc5('0x8')](function(){return respondWithRpcPromise(_0xecc5('0x5f'),{'channel':_0x54c34a,'interaction':_0x23d1d7[_0xecc5('0x58')],'message':_0x23d1d7,'account':_0x23d1d7['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0xecc5('0x68'),'appdata':_0x377030['name']+','+(_0x23d1d7[_0xecc5('0x55')][_0xecc5('0x6e')]||0x12c),'interval':_0xecc5('0x61')}]},routingClient);})[_0xecc5('0x8')](respondWithResult(_0x3a7107,null))[_0xecc5('0x18')](handleError(_0x3a7107,null));}; \ No newline at end of file +var _0x9009=['params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','merge','voiceQueues','showVoiceQueues','VoiceQueues','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','agents','Agents','body','user','interaction','hasOwnProperty','MemberReport','findAll','name','INTERACTION','format','length','updateAttributes','findOrCreate','interface','SIP/%s','internal','AgentCapacity','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','smsQueues','showSmsQueues','SmsQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','findOne','\x20Queue\x20not\x20found','Interaction','Account','\x20Message\x20not\x20found','update','queue','InteractionId','create','queueTransferTimeout','agentNotify','Channel\x20field\x20is\x20mandatory','User','Agent\x20not\x20found','messageId','From','Start','agent','agentTransferTimeout','*,*,*,*','bluebird','moment','lodash','util','../../mysqldb','../../config/logger','api','client','http','request','then','error','code','message','result','catch','sendStatus','stack','status','send','isNil','rows','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor'];(function(_0x369151,_0x179f72){var _0x4292d5=function(_0x330422){while(--_0x330422){_0x369151['push'](_0x369151['shift']());}};_0x4292d5(++_0x179f72);}(_0x9009,0x146));var _0x9900=function(_0x40fc16,_0x221aac){_0x40fc16=_0x40fc16-0x0;var _0x5eaa7a=_0x9009[_0x40fc16];return _0x5eaa7a;};'use strict';var BPromise=require(_0x9900('0x0'));var moment=require(_0x9900('0x1'));var _=require(_0x9900('0x2'));var util=require(_0x9900('0x3'));var db=require(_0x9900('0x4'))['db'];var logger=require(_0x9900('0x5'))(_0x9900('0x6'));var jayson=require('jayson/promise');var amiClient=jayson[_0x9900('0x7')]['http']({'port':0x232a});var mailClient=jayson[_0x9900('0x7')][_0x9900('0x8')]({'port':0x232b});var routingClient=jayson['client'][_0x9900('0x8')]({'port':0x232c});function respondWithRpcPromise(_0x204857,_0x13a832,_0x3e944a){return new BPromise(function(_0x2d57c,_0x58e467){var _0x59d6fe=_0x3e944a?_0x3e944a:amiClient;return _0x59d6fe[_0x9900('0x9')](_0x204857,_0x13a832)[_0x9900('0xa')](function(_0x2130bd){if(_0x2130bd[_0x9900('0xb')]){if(_0x2130bd[_0x9900('0xb')][_0x9900('0xc')]===0x1f4){return _0x58e467(_0x2130bd[_0x9900('0xb')][_0x9900('0xd')]);}return _0x2d57c(_0x2130bd['error'][_0x9900('0xd')]);}else{_0x2d57c(_0x2130bd[_0x9900('0xe')]);}})[_0x9900('0xf')](function(_0x24d598){_0x58e467(_0x24d598);});});}function respondWithResult(_0x6e5ab3,_0x14e590){_0x14e590=_0x14e590||0xc8;return function(_0x23b6c9){if(_0x23b6c9){return _0x6e5ab3['status'](_0x14e590)['json'](_0x23b6c9);}return _0x6e5ab3[_0x9900('0x10')](0x194);};}function handleError(_0x520975,_0x1c734e){_0x1c734e=_0x1c734e||0x1f4;return function(_0x107db0){logger['error'](_0x107db0[_0x9900('0x11')]);if(_0x107db0['name']){delete _0x107db0['name'];}_0x520975[_0x9900('0x12')](_0x1c734e)[_0x9900('0x13')](_0x107db0);};}function findById(_0x482349){return function(_0x26e189){if(!_[_0x9900('0x14')](_0x482349)&&!_[_0x9900('0x14')](_0x26e189)&&!_[_0x9900('0x14')](_0x26e189[_0x9900('0x15')])){return _[_0x9900('0x16')](_0x26e189[_0x9900('0x15')],function(_0x2100df){return _0x2100df['id']==_0x482349;});}return null;};}exports[_0x9900('0x17')]=function(_0x5b42b1,_0xb95119){return respondWithRpcPromise(_0x9900('0x18'),_0x5b42b1[_0x9900('0x19')])[_0x9900('0xa')](respondWithResult(_0xb95119,null))[_0x9900('0xf')](handleError(_0xb95119,null));};exports[_0x9900('0x1a')]=function(_0x5a8eef,_0x393d58){return respondWithRpcPromise(_0x9900('0x1b'),_['merge'](_0x5a8eef[_0x9900('0x19')],_0x5a8eef[_0x9900('0x1c')]))[_0x9900('0xa')](respondWithResult(_0x393d58,null))['catch'](handleError(_0x393d58,null));};exports[_0x9900('0x1d')]=function(_0x1af63b,_0x2b3066){return respondWithRpcPromise(_0x9900('0x1e'),_[_0x9900('0x1f')](_0x1af63b[_0x9900('0x19')],_0x1af63b[_0x9900('0x1c')]))[_0x9900('0xa')](respondWithResult(_0x2b3066,null))['catch'](handleError(_0x2b3066,null));};exports[_0x9900('0x20')]=function(_0x608c5b,_0x4f2c8a){return respondWithRpcPromise('VoiceQueues',_0x608c5b['query'])[_0x9900('0xa')](respondWithResult(_0x4f2c8a,null))[_0x9900('0xf')](handleError(_0x4f2c8a,null));};exports[_0x9900('0x21')]=function(_0x17d4cd,_0x27ab2f){return respondWithRpcPromise(_0x9900('0x22'),_0x17d4cd[_0x9900('0x19')])['then'](findById(_0x17d4cd[_0x9900('0x1c')]['id']))[_0x9900('0xa')](respondWithResult(_0x27ab2f,null))[_0x9900('0xf')](handleError(_0x27ab2f,null));};exports['voiceQueuesPreview']=function(_0x1c7bb6,_0xd0683){return respondWithRpcPromise(_0x9900('0x23'),_[_0x9900('0x1f')](_0x1c7bb6[_0x9900('0x19')],_0x1c7bb6[_0x9900('0x1c')]))[_0x9900('0xa')](respondWithResult(_0xd0683,null))[_0x9900('0xf')](handleError(_0xd0683,null));};exports[_0x9900('0x24')]=function(_0x2136f8,_0x4c562a){return respondWithRpcPromise(_0x9900('0x25'),_0x2136f8[_0x9900('0x19')])[_0x9900('0xa')](respondWithResult(_0x4c562a,null))[_0x9900('0xf')](handleError(_0x4c562a,null));};exports[_0x9900('0x26')]=function(_0x5d9349,_0x433294){return respondWithRpcPromise(_0x9900('0x27'),_[_0x9900('0x1f')](_0x5d9349[_0x9900('0x19')],_0x5d9349[_0x9900('0x1c')]))[_0x9900('0xa')](respondWithResult(_0x433294,null))['catch'](handleError(_0x433294,null));};exports[_0x9900('0x28')]=function(_0x30ed5d,_0x4e1b2c){return respondWithRpcPromise('VoiceQueuesChannelHangup',_[_0x9900('0x1f')](_0x30ed5d[_0x9900('0x19')],_0x30ed5d[_0x9900('0x1c')]))[_0x9900('0xa')](respondWithResult(_0x4e1b2c,null))[_0x9900('0xf')](handleError(_0x4e1b2c,null));};exports['voiceQueuesChannelRedirect']=function(_0x10ec1d,_0x4af2c6){return respondWithRpcPromise(_0x9900('0x29'),_[_0x9900('0x1f')](_0x10ec1d['query'],_0x10ec1d[_0x9900('0x1c')]))[_0x9900('0xa')](respondWithResult(_0x4af2c6,null))[_0x9900('0xf')](handleError(_0x4af2c6,null));};exports[_0x9900('0x2a')]=function(_0x18722a,_0x4ccad2){return respondWithRpcPromise(_0x9900('0x2b'),_0x18722a['query'])[_0x9900('0xa')](respondWithResult(_0x4ccad2,null))[_0x9900('0xf')](handleError(_0x4ccad2,null));};exports[_0x9900('0x2c')]=function(_0x510f59,_0x21624d){return respondWithRpcPromise('OutboundChannels',_0x510f59['query'])[_0x9900('0xa')](respondWithResult(_0x21624d,null))[_0x9900('0xf')](handleError(_0x21624d,null));};exports[_0x9900('0x2d')]=function(_0x1e2550,_0x585490){var _0x3c2653;return respondWithRpcPromise(_0x9900('0x2e'),_0x1e2550[_0x9900('0x19')])[_0x9900('0xa')](function(_0x3e0fac){_0x3c2653=_0x3e0fac;return respondWithRpcPromise(_0x9900('0x2e'),_0x1e2550['query'],routingClient);})[_0x9900('0xa')](function(_0x3c1e0d){return _['merge']({},_0x3c1e0d,_0x3c2653);})[_0x9900('0xa')](respondWithResult(_0x585490,null))[_0x9900('0xf')](handleError(_0x585490,null));};exports['agentCapacity']=function(_0x30157a,_0xe29065){if(_0x30157a[_0x9900('0x2f')]&&_0x30157a[_0x9900('0x2f')]['interaction']&&_0x30157a[_0x9900('0x30')]&&_0x30157a[_0x9900('0x30')]['name']){for(var _0x28df09 in _0x30157a[_0x9900('0x2f')]['interaction']){if(_0x30157a['body'][_0x9900('0x31')][_0x9900('0x32')](_0x28df09)){db[_0x9900('0x33')][_0x9900('0x34')]({'where':{'channel':_0x28df09,'membername':_0x30157a[_0x9900('0x30')][_0x9900('0x35')],'type':_0x9900('0x36'),'exitAt':null,'uniqueid':_0x30157a['body'][_0x9900('0x31')][_0x28df09]&&_0x30157a['body'][_0x9900('0x31')][_0x28df09]['length']?{'$notIn':_0x30157a['body'][_0x9900('0x31')][_0x28df09]}:{'$ne':null}}})[_0x9900('0xa')](function(_0x39b407){var _0x289dcd=moment()[_0x9900('0x37')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x2240b1=0x0,_0xc19664=_0x39b407[_0x9900('0x38')];_0x2240b1<_0xc19664;_0x2240b1+=0x1){_0x39b407[_0x2240b1][_0x9900('0x39')]({'exitAt':_0x289dcd});}});for(var _0x4c61b4=0x0;_0x4c61b4<_0x30157a[_0x9900('0x2f')][_0x9900('0x31')][_0x28df09][_0x9900('0x38')];_0x4c61b4+=0x1){db[_0x9900('0x33')][_0x9900('0x3a')]({'where':{'channel':_0x28df09,'membername':_0x30157a[_0x9900('0x30')][_0x9900('0x35')],'type':_0x9900('0x36'),'uniqueid':_0x30157a[_0x9900('0x2f')]['interaction'][_0x28df09][_0x4c61b4],'exitAt':null},'defaults':{'channel':_0x28df09,'membername':_0x30157a[_0x9900('0x30')][_0x9900('0x35')],'interface':_['isNil'](_0x30157a[_0x9900('0x30')][_0x9900('0x3b')])?util[_0x9900('0x37')](_0x9900('0x3c'),_0x30157a[_0x9900('0x30')]['name']):_0x30157a[_0x9900('0x30')][_0x9900('0x3b')],'type':_0x9900('0x36'),'enterAt':moment()[_0x9900('0x37')]('YYYY-MM-DD\x20HH:mm:ss'),'role':'agent','internal':_0x30157a[_0x9900('0x30')][_0x9900('0x3d')],'uniqueid':_0x30157a[_0x9900('0x2f')][_0x9900('0x31')][_0x28df09][_0x4c61b4]}});}}}}return respondWithRpcPromise(_0x9900('0x3e'),{'id':_0x30157a[_0x9900('0x1c')]['id'],'capacity':_0x30157a[_0x9900('0x2f')]['capacity']},routingClient)[_0x9900('0xa')](respondWithResult(_0xe29065,null))['catch'](handleError(_0xe29065,null));};exports['telephones']=function(_0x161c44,_0x29232f){return respondWithRpcPromise(_0x9900('0x3f'),_0x161c44['query'])[_0x9900('0xa')](respondWithResult(_0x29232f,null))['catch'](handleError(_0x29232f,null));};exports[_0x9900('0x40')]=function(_0x56e3f0,_0x17b019){return respondWithRpcPromise(_0x9900('0x41'),_0x56e3f0['query'])['then'](respondWithResult(_0x17b019,null))[_0x9900('0xf')](handleError(_0x17b019,null));};exports[_0x9900('0x42')]=function(_0x4d90ef,_0x4a80d7){return respondWithRpcPromise(_0x9900('0x43'),_0x4d90ef[_0x9900('0x19')])[_0x9900('0xa')](respondWithResult(_0x4a80d7,null))[_0x9900('0xf')](handleError(_0x4a80d7,null));};exports[_0x9900('0x44')]=function(_0x578520,_0x1bbbc5){return respondWithRpcPromise(_0x9900('0x45'),_0x578520[_0x9900('0x19')],routingClient)[_0x9900('0xa')](respondWithResult(_0x1bbbc5,null))[_0x9900('0xf')](handleError(_0x1bbbc5,null));};exports[_0x9900('0x46')]=function(_0x1bdc76,_0x570281){return respondWithRpcPromise(_0x9900('0x45'),_0x1bdc76['query'],routingClient)['then'](findById(_0x1bdc76['params']['id']))[_0x9900('0xa')](respondWithResult(_0x570281,null))[_0x9900('0xf')](handleError(_0x570281,null));};exports[_0x9900('0x47')]=function(_0x3ce53d,_0x4cc567){return respondWithRpcPromise(_0x9900('0x48'),_0x3ce53d[_0x9900('0x19')],routingClient)[_0x9900('0xa')](respondWithResult(_0x4cc567,null))['catch'](handleError(_0x4cc567,null));};exports[_0x9900('0x49')]=function(_0x472ef3,_0x217a13){return respondWithRpcPromise(_0x9900('0x48'),_0x472ef3['query'],routingClient)['then'](findById(_0x472ef3[_0x9900('0x1c')]['id']))[_0x9900('0xa')](respondWithResult(_0x217a13,null))[_0x9900('0xf')](handleError(_0x217a13,null));};exports[_0x9900('0x4a')]=function(_0xcbf8f5,_0x105b5e){return respondWithRpcPromise(_0x9900('0x4b'),_0xcbf8f5[_0x9900('0x19')],mailClient)[_0x9900('0xa')](respondWithResult(_0x105b5e,null))['catch'](handleError(_0x105b5e,null));};exports[_0x9900('0x4c')]=function(_0x2e3fd2,_0x33edc6){return respondWithRpcPromise(_0x9900('0x4d'),_0x2e3fd2['query'],routingClient)[_0x9900('0xa')](respondWithResult(_0x33edc6,null))[_0x9900('0xf')](handleError(_0x33edc6,null));};exports['showOpenchannelQueues']=function(_0x20c93a,_0x48693c){return respondWithRpcPromise(_0x9900('0x4d'),_0x20c93a[_0x9900('0x19')],routingClient)[_0x9900('0xa')](findById(_0x20c93a[_0x9900('0x1c')]['id']))['then'](respondWithResult(_0x48693c,null))[_0x9900('0xf')](handleError(_0x48693c,null));};exports[_0x9900('0x4e')]=function(_0x48d9c0,_0x5cfadf){return respondWithRpcPromise('SmsQueues',_0x48d9c0['query'],routingClient)[_0x9900('0xa')](respondWithResult(_0x5cfadf,null))[_0x9900('0xf')](handleError(_0x5cfadf,null));};exports[_0x9900('0x4f')]=function(_0x288730,_0x1052cb){return respondWithRpcPromise(_0x9900('0x50'),_0x288730[_0x9900('0x19')],routingClient)[_0x9900('0xa')](findById(_0x288730[_0x9900('0x1c')]['id']))['then'](respondWithResult(_0x1052cb,null))[_0x9900('0xf')](handleError(_0x1052cb,null));};exports['faxQueues']=function(_0x2cbff0,_0x38a21d){return respondWithRpcPromise(_0x9900('0x51'),_0x2cbff0[_0x9900('0x19')],routingClient)[_0x9900('0xa')](respondWithResult(_0x38a21d,null))[_0x9900('0xf')](handleError(_0x38a21d,null));};exports[_0x9900('0x52')]=function(_0x317ae1,_0x2eeeed){return respondWithRpcPromise('FaxQueues',_0x317ae1[_0x9900('0x19')],routingClient)[_0x9900('0xa')](findById(_0x317ae1[_0x9900('0x1c')]['id']))[_0x9900('0xa')](respondWithResult(_0x2eeeed,null))[_0x9900('0xf')](handleError(_0x2eeeed,null));};exports[_0x9900('0x53')]=function(_0x4220a0,_0x28ef6f){return respondWithRpcPromise(_0x9900('0x54'),_0x4220a0[_0x9900('0x19')])[_0x9900('0xa')](respondWithResult(_0x28ef6f,null))['catch'](handleError(_0x28ef6f,null));};exports[_0x9900('0x55')]=function(_0x2c52cc,_0x43a7c8){return respondWithRpcPromise(_0x9900('0x56'),_0x2c52cc[_0x9900('0x19')],routingClient)[_0x9900('0xa')](respondWithResult(_0x43a7c8,null))[_0x9900('0xf')](handleError(_0x43a7c8,null));};exports['mailQueuesWaitingInteractions']=function(_0x28f5e8,_0x309b54){return respondWithRpcPromise(_0x9900('0x57'),_0x28f5e8['query'],routingClient)['then'](respondWithResult(_0x309b54,null))[_0x9900('0xf')](handleError(_0x309b54,null));};exports[_0x9900('0x58')]=function(_0x1ba24b,_0xa8d3a4){return respondWithRpcPromise(_0x9900('0x59'),_0x1ba24b[_0x9900('0x19')],routingClient)[_0x9900('0xa')](respondWithResult(_0xa8d3a4,null))['catch'](handleError(_0xa8d3a4,null));};exports[_0x9900('0x5a')]=function(_0x48af72,_0x57efb0){return respondWithRpcPromise(_0x9900('0x5b'),_0x48af72['query'],routingClient)[_0x9900('0xa')](respondWithResult(_0x57efb0,null))[_0x9900('0xf')](handleError(_0x57efb0,null));};exports[_0x9900('0x5c')]=function(_0x2449cb,_0x4c137d){return respondWithRpcPromise(_0x9900('0x5d'),_0x2449cb[_0x9900('0x19')],routingClient)[_0x9900('0xa')](respondWithResult(_0x4c137d,null))[_0x9900('0xf')](handleError(_0x4c137d,null));};exports[_0x9900('0x5e')]=function(_0x3551df){return function(_0x5d6132,_0x44425e){var _0x390140,_0x4f1c37;var _0x3f4536=_[_0x9900('0x5f')](_0x3551df);var _0x422bcc=_0x3551df===_0x9900('0x60')?_0x9900('0x61'):'Account';return db[_0x3f4536+'Queue'][_0x9900('0x62')]({'raw':!![],'where':{'id':_0x5d6132['params']['id']}})[_0x9900('0xa')](function(_0x19d7e3){if(_[_0x9900('0x14')](_0x19d7e3)){throw new Error(_0x3f4536+_0x9900('0x63'));}_0x390140=_0x19d7e3;return db[_0x3f4536+'Message']['findOne']({'where':{'id':_0x5d6132['body']['messageId']},'include':[{'model':db[_0x3f4536+_0x9900('0x64')],'as':_0x9900('0x64')},{'model':db[_0x3f4536+_0x422bcc],'as':_0x9900('0x65')}]});})[_0x9900('0xa')](function(_0x16da48){if(_[_0x9900('0x14')](_0x16da48)){throw new Error(_0x3f4536+_0x9900('0x66'));}_0x4f1c37=_0x16da48;return _0x16da48[_0x9900('0x67')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x19fd52={'uniqueid':_0x3551df+'.'+_0x4f1c37['id']+'.'+_0x4f1c37[_0x9900('0x64')]['id'],'FromUserId':_0x5d6132[_0x9900('0x30')]['id'],'type':_0x9900('0x68')};_0x19fd52[_0x3f4536+'MessageId']=_0x4f1c37['id'];_0x19fd52[_0x3f4536+_0x9900('0x69')]=_0x4f1c37['Interaction']['id'];_0x19fd52['From'+_0x3f4536+_0x422bcc+'Id']=_0x4f1c37[_0x9900('0x65')]['id'];_0x19fd52['To'+_0x3f4536+'QueueId']=_0x390140['id'];return db[_0x3f4536+'TransferReport'][_0x9900('0x6a')](_0x19fd52);})[_0x9900('0xa')](function(){return respondWithRpcPromise('Start',{'channel':_0x3551df,'interaction':_0x4f1c37['Interaction'],'message':_0x4f1c37,'account':_0x4f1c37[_0x9900('0x65')],'applications':[{'id':0x0,'priority':0x1,'app':_0x9900('0x68'),'appdata':_0x390140[_0x9900('0x35')]+','+(_0x4f1c37[_0x9900('0x65')][_0x9900('0x6b')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0x9900('0xa')](respondWithResult(_0x44425e,null))[_0x9900('0xf')](handleError(_0x44425e,null));};};exports[_0x9900('0x6c')]=function(_0x2899ed,_0x269fba){var _0x1b922e,_0x5e7c01;if(_[_0x9900('0x14')](_0x2899ed['body']['channel'])){throw new Error(_0x9900('0x6d'));}var _0x2d74e0=_0x2899ed['body']['channel'];var _0x5f3eb0=_['capitalize'](_0x2d74e0);var _0x497532=_0x2d74e0===_0x9900('0x60')?_0x9900('0x61'):_0x9900('0x65');return db[_0x9900('0x6e')][_0x9900('0x62')]({'raw':!![],'where':{'id':_0x2899ed[_0x9900('0x1c')]['id'],'role':'agent'}})[_0x9900('0xa')](function(_0x17549a){if(_[_0x9900('0x14')](_0x17549a)){throw new Error(_0x9900('0x6f'));}_0x1b922e=_0x17549a;return db[_0x5f3eb0+'Message'][_0x9900('0x62')]({'where':{'id':_0x2899ed[_0x9900('0x2f')][_0x9900('0x70')]},'include':[{'model':db[_0x5f3eb0+'Interaction'],'as':_0x9900('0x64')},{'model':db[_0x5f3eb0+_0x497532],'as':_0x9900('0x65')}]});})['then'](function(_0x384aac){if(_[_0x9900('0x14')](_0x384aac)){throw new Error(_0x5f3eb0+_0x9900('0x66'));}_0x5e7c01=_0x384aac;return _0x384aac[_0x9900('0x67')]({'read':0x0,'readAt':null,'UserId':null});})[_0x9900('0xa')](function(){var _0x42848c={'uniqueid':_0x2d74e0+'.'+_0x5e7c01['id']+'.'+_0x5e7c01[_0x9900('0x64')]['id'],'FromUserId':_0x2899ed[_0x9900('0x30')]['id'],'type':_0x9900('0x68'),'ToUserId':_0x1b922e['id']};_0x42848c[_0x5f3eb0+'MessageId']=_0x5e7c01['id'];_0x42848c[_0x5f3eb0+_0x9900('0x69')]=_0x5e7c01['Interaction']['id'];_0x42848c[_0x9900('0x71')+_0x5f3eb0+_0x497532+'Id']=_0x5e7c01[_0x9900('0x65')]['id'];return db[_0x5f3eb0+'TransferReport'][_0x9900('0x6a')](_0x42848c);})['then'](function(){return respondWithRpcPromise(_0x9900('0x72'),{'channel':_0x2d74e0,'interaction':_0x5e7c01[_0x9900('0x64')],'message':_0x5e7c01,'account':_0x5e7c01['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0x9900('0x73'),'appdata':_0x1b922e[_0x9900('0x35')]+','+(_0x5e7c01[_0x9900('0x65')][_0x9900('0x74')]||0x12c),'interval':_0x9900('0x75')}]},routingClient);})[_0x9900('0xa')](respondWithResult(_0x269fba,null))[_0x9900('0xf')](handleError(_0x269fba,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index efa1074..cb5837d 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 _0x3676=['isAuthenticated','index','/:id','show','/:id/run','run','post','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','./schedule.controller','get'];(function(_0x1395ae,_0x3be5cd){var _0x210e30=function(_0x5b0935){while(--_0x5b0935){_0x1395ae['push'](_0x1395ae['shift']());}};_0x210e30(++_0x3be5cd);}(_0x3676,0x188));var _0x6367=function(_0x1a9204,_0x1c9e00){_0x1a9204=_0x1a9204-0x0;var _0x17ca68=_0x3676[_0x1a9204];return _0x17ca68;};'use strict';var multer=require('multer');var util=require(_0x6367('0x0'));var path=require(_0x6367('0x1'));var timeout=require(_0x6367('0x2'));var express=require(_0x6367('0x3'));var router=express[_0x6367('0x4')]();var auth=require(_0x6367('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6367('0x6'));router[_0x6367('0x7')]('/',auth[_0x6367('0x8')](),controller[_0x6367('0x9')]);router['get'](_0x6367('0xa'),auth['isAuthenticated'](),controller[_0x6367('0xb')]);router[_0x6367('0x7')](_0x6367('0xc'),auth[_0x6367('0x8')](),controller[_0x6367('0xd')]);router[_0x6367('0xe')]('/',auth[_0x6367('0x8')](),controller['create']);router[_0x6367('0xf')](_0x6367('0xa'),auth['isAuthenticated'](),controller[_0x6367('0x10')]);router[_0x6367('0x11')](_0x6367('0xa'),auth[_0x6367('0x8')](),controller[_0x6367('0x12')]);module[_0x6367('0x13')]=router; \ No newline at end of file +var _0x285d=['create','put','update','delete','destroy','exports','multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./schedule.controller','get','isAuthenticated','/:id','show','/:id/run','run','post'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x285d,0x1f4));var _0xd285=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0x285d[_0x47b58b];return _0x46bebe;};'use strict';var multer=require(_0xd285('0x0'));var util=require('util');var path=require(_0xd285('0x1'));var timeout=require(_0xd285('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0xd285('0x3'));var interaction=require(_0xd285('0x4'));var config=require('../../config/environment');var controller=require(_0xd285('0x5'));router[_0xd285('0x6')]('/',auth[_0xd285('0x7')](),controller['index']);router[_0xd285('0x6')](_0xd285('0x8'),auth[_0xd285('0x7')](),controller[_0xd285('0x9')]);router['get'](_0xd285('0xa'),auth[_0xd285('0x7')](),controller[_0xd285('0xb')]);router[_0xd285('0xc')]('/',auth[_0xd285('0x7')](),controller[_0xd285('0xd')]);router[_0xd285('0xe')](_0xd285('0x8'),auth[_0xd285('0x7')](),controller[_0xd285('0xf')]);router[_0xd285('0x10')](_0xd285('0x8'),auth[_0xd285('0x7')](),controller[_0xd285('0x11')]);module[_0xd285('0x12')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index c82d920..da7c01c 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 _0x26d1=['BOOLEAN','DATE','ENUM','years','quarters','months','weeks','hours','minutes','days','csv','pdf','xlsx','custom','default','TEXT','sequelize','STRING'];(function(_0x9fd887,_0x47f76c){var _0x1a54ab=function(_0xb65c08){while(--_0xb65c08){_0x9fd887['push'](_0x9fd887['shift']());}};_0x1a54ab(++_0x47f76c);}(_0x26d1,0x8e));var _0x126d=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x26d1[_0x2c91e9];return _0x13f0ff;};'use strict';var Sequelize=require(_0x126d('0x0'));module['exports']={'name':{'type':Sequelize[_0x126d('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x126d('0x1')]},'active':{'type':Sequelize[_0x126d('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x126d('0x1')],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0x126d('0x3')],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x126d('0x4')](_0x126d('0x5'),_0x126d('0x6'),_0x126d('0x7'),_0x126d('0x8'),'days',_0x126d('0x9'),_0x126d('0xa')),'allowNull':![],'defaultValue':_0x126d('0xb')},'output':{'type':Sequelize[_0x126d('0x4')](_0x126d('0xc'),_0x126d('0xd'),_0x126d('0xe')),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0x126d('0x4')](_0x126d('0xf'),_0x126d('0x10')),'allowNull':![],'defaultValue':_0x126d('0xf')},'sendMail':{'type':Sequelize[_0x126d('0x2')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x126d('0x11')]},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize[_0x126d('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0x4317=['0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','months','weeks','days','hours','minutes','csv','pdf','xlsx','custom','default','BOOLEAN','TEXT','exports','STRING'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0x4317,0x7c));var _0x7431=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x4317[_0x13d07a];return _0x5ee0ee;};'use strict';var Sequelize=require('sequelize');module[_0x7431('0x0')]={'name':{'type':Sequelize[_0x7431('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x7431('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x7431('0x1')],'allowNull':![],'defaultValue':_0x7431('0x2')},'startAt':{'type':Sequelize[_0x7431('0x3')],'allowNull':![]},'endAt':{'type':Sequelize[_0x7431('0x3')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x7431('0x4')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x7431('0x5')]('years','quarters',_0x7431('0x6'),_0x7431('0x7'),_0x7431('0x8'),_0x7431('0x9'),_0x7431('0xa')),'allowNull':![],'defaultValue':_0x7431('0x8')},'output':{'type':Sequelize[_0x7431('0x5')](_0x7431('0xb'),_0x7431('0xc'),_0x7431('0xd')),'allowNull':![],'defaultValue':_0x7431('0xb')},'type':{'type':Sequelize[_0x7431('0x5')](_0x7431('0xe'),_0x7431('0xf')),'allowNull':![],'defaultValue':_0x7431('0xe')},'sendMail':{'type':Sequelize[_0x7431('0x10')],'defaultValue':![]},'email':{'type':Sequelize[_0x7431('0x1')]},'cc':{'type':Sequelize[_0x7431('0x11')]},'bcc':{'type':Sequelize[_0x7431('0x11')]},'sendIfEmpty':{'type':Sequelize[_0x7431('0x10')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 9c1fdcc..e89fb8c 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 _0x0183=['catch','show','params','find','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','eml-format','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','end','json','count','offset','limit','status','set','Content-Range','reject','destroy','then','Scheduler','UserProfileResource','sendStatus','error','stack','name','send','index','Schedule','rawAttributes','fieldName','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','rows'];(function(_0x462e72,_0x2085e2){var _0x393ca7=function(_0x58488a){while(--_0x58488a){_0x462e72['push'](_0x462e72['shift']());}};_0x393ca7(++_0x2085e2);}(_0x0183,0x19a));var _0x3018=function(_0x24d8d7,_0xb94fdf){_0x24d8d7=_0x24d8d7-0x0;var _0xe0356c=_0x0183[_0x24d8d7];return _0xe0356c;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x3018('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3018('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3018('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3018('0x3'));var util=require(_0x3018('0x4'));var path=require(_0x3018('0x5'));var sox=require(_0x3018('0x6'));var csv=require(_0x3018('0x7'));var ejs=require(_0x3018('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x3018('0x9'));var crypto=require(_0x3018('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x3018('0xb'));var toCsv=require(_0x3018('0x7'));var querystring=require(_0x3018('0xc'));var Papa=require(_0x3018('0xd'));var Redis=require(_0x3018('0xe'));var authService=require(_0x3018('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x3018('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3018('0x11'));var utils=require('../../config/utils');var config=require(_0x3018('0x12'));var db=require(_0x3018('0x13'))['db'];function respondWithStatusCode(_0x5aa323,_0x27297b){_0x27297b=_0x27297b||0xcc;return function(_0x57b7b1){if(_0x57b7b1){return _0x5aa323['sendStatus'](_0x27297b);}return _0x5aa323['status'](_0x27297b)[_0x3018('0x14')]();};}function respondWithResult(_0x35b329,_0x3bbff7){_0x3bbff7=_0x3bbff7||0xc8;return function(_0x55b3a4){if(_0x55b3a4){return _0x35b329['status'](_0x3bbff7)[_0x3018('0x15')](_0x55b3a4);}};}function respondWithFilteredResult(_0x3117f7,_0x4da659){return function(_0x2c3889){if(_0x2c3889){var _0x422f00=_0x2c3889[_0x3018('0x16')],_0x2581be=_0x4da659[_0x3018('0x17')],_0xad54c6=_0x4da659[_0x3018('0x17')]+_0x4da659[_0x3018('0x18')],_0x44f138;if(_0xad54c6>=_0x422f00){_0xad54c6=_0x422f00;_0x44f138=0xc8;}else{_0x44f138=0xce;}_0x3117f7[_0x3018('0x19')](_0x44f138);return _0x3117f7[_0x3018('0x1a')](_0x3018('0x1b'),_0x2581be+'-'+_0xad54c6+'/'+_0x422f00)[_0x3018('0x15')](_0x2c3889);}return null;};}function patchUpdates(_0x14e6f2){return function(_0x24b69f){try{jsonpatch['apply'](_0x24b69f,_0x14e6f2,!![]);}catch(_0x128445){return BPromise[_0x3018('0x1c')](_0x128445);}return _0x24b69f['save']();};}function saveUpdates(_0x1e6b91,_0x55261d){return function(_0x5a7b25){if(_0x5a7b25){return _0x5a7b25['update'](_0x1e6b91)['then'](function(_0x24065a){return _0x24065a;});}return null;};}function removeEntity(_0x16a092,_0x5f4701){return function(_0x1232fd){if(_0x1232fd){return _0x1232fd[_0x3018('0x1d')]()[_0x3018('0x1e')](function(){var _0xc74264=_0x1232fd['get']({'plain':!![]});var _0x3a927c=_0x3018('0x1f');return db[_0x3018('0x20')][_0x3018('0x1d')]({'where':{'type':_0x3a927c,'resourceId':_0xc74264['id']}})['then'](function(){return _0x1232fd;});})[_0x3018('0x1e')](function(){_0x16a092[_0x3018('0x19')](0xcc)[_0x3018('0x14')]();});}};}function handleEntityNotFound(_0x15c616,_0x849d19){return function(_0x2a3565){if(!_0x2a3565){_0x15c616[_0x3018('0x21')](0x194);}return _0x2a3565;};}function handleError(_0xb0143e,_0x269c91){_0x269c91=_0x269c91||0x1f4;return function(_0x4ad99b){logger[_0x3018('0x22')](_0x4ad99b[_0x3018('0x23')]);if(_0x4ad99b[_0x3018('0x24')]){delete _0x4ad99b[_0x3018('0x24')];}_0xb0143e['status'](_0x269c91)[_0x3018('0x25')](_0x4ad99b);};}exports[_0x3018('0x26')]=function(_0x1003da,_0xfd4201){var _0xcfd2e5={},_0x26cdea={},_0x5b1517={'count':0x0,'rows':[]};var _0x6fadd9=_['map'](db[_0x3018('0x27')][_0x3018('0x28')],function(_0x44bca1){return{'name':_0x44bca1[_0x3018('0x29')],'type':_0x44bca1['type']['key']};});_0x26cdea[_0x3018('0x2a')]=_[_0x3018('0x2b')](_0x6fadd9,_0x3018('0x24'));_0x26cdea[_0x3018('0x2c')]=_[_0x3018('0x2d')](_0x1003da[_0x3018('0x2c')]);_0x26cdea[_0x3018('0x2e')]=_[_0x3018('0x2f')](_0x26cdea[_0x3018('0x2a')],_0x26cdea[_0x3018('0x2c')]);_0xcfd2e5[_0x3018('0x30')]=_['intersection'](_0x26cdea[_0x3018('0x2a')],qs[_0x3018('0x31')](_0x1003da[_0x3018('0x2c')][_0x3018('0x31')]));_0xcfd2e5[_0x3018('0x30')]=_0xcfd2e5[_0x3018('0x30')][_0x3018('0x32')]?_0xcfd2e5['attributes']:_0x26cdea[_0x3018('0x2a')];if(!_0x1003da['query'][_0x3018('0x33')](_0x3018('0x34'))){_0xcfd2e5[_0x3018('0x18')]=qs[_0x3018('0x18')](_0x1003da[_0x3018('0x2c')][_0x3018('0x18')]);_0xcfd2e5[_0x3018('0x17')]=qs[_0x3018('0x17')](_0x1003da[_0x3018('0x2c')]['offset']);}_0xcfd2e5[_0x3018('0x35')]=qs['sort'](_0x1003da[_0x3018('0x2c')][_0x3018('0x36')]);_0xcfd2e5['where']=qs[_0x3018('0x2e')](_[_0x3018('0x37')](_0x1003da[_0x3018('0x2c')],_0x26cdea[_0x3018('0x2e')]));if(_0x1003da[_0x3018('0x2c')][_0x3018('0x38')]){_0xcfd2e5[_0x3018('0x39')]=_[_0x3018('0x3a')](_0xcfd2e5['where'],{'$or':_[_0x3018('0x2b')](_0x6fadd9,function(_0x4f8d50){if(_0x4f8d50[_0x3018('0x3b')]!==_0x3018('0x3c')){var _0x46ea86={};_0x46ea86[_0x4f8d50[_0x3018('0x24')]]={'$like':'%'+_0x1003da[_0x3018('0x2c')][_0x3018('0x38')]+'%'};return _0x46ea86;}})});}_0xcfd2e5=_[_0x3018('0x3a')]({},_0xcfd2e5,_0x1003da[_0x3018('0x3d')]);var _0x352ba4={'where':_0xcfd2e5['where']};return db[_0x3018('0x27')][_0x3018('0x16')](_0x352ba4)[_0x3018('0x1e')](function(_0x15f093){_0x5b1517[_0x3018('0x16')]=_0x15f093;if(_0x1003da[_0x3018('0x2c')][_0x3018('0x3e')]){_0xcfd2e5['include']=[{'all':!![]}];}return db['Schedule']['findAll'](_0xcfd2e5);})[_0x3018('0x1e')](function(_0x44b98a){_0x5b1517[_0x3018('0x3f')]=_0x44b98a;return _0x5b1517;})[_0x3018('0x1e')](respondWithFilteredResult(_0xfd4201,_0xcfd2e5))[_0x3018('0x40')](handleError(_0xfd4201,null));};exports[_0x3018('0x41')]=function(_0x37e351,_0x4eca2d){var _0x590c5c={'raw':![],'where':{'id':_0x37e351[_0x3018('0x42')]['id']}},_0x27000e={};_0x27000e[_0x3018('0x2a')]=_[_0x3018('0x2d')](db[_0x3018('0x27')][_0x3018('0x28')]);_0x27000e[_0x3018('0x2c')]=_[_0x3018('0x2d')](_0x37e351['query']);_0x27000e[_0x3018('0x2e')]=_[_0x3018('0x2f')](_0x27000e[_0x3018('0x2a')],_0x27000e['query']);_0x590c5c['attributes']=_['intersection'](_0x27000e['model'],qs[_0x3018('0x31')](_0x37e351[_0x3018('0x2c')][_0x3018('0x31')]));_0x590c5c['attributes']=_0x590c5c[_0x3018('0x30')][_0x3018('0x32')]?_0x590c5c[_0x3018('0x30')]:_0x27000e['model'];if(_0x37e351[_0x3018('0x2c')]['includeAll']){_0x590c5c['include']=[{'all':!![]}];}_0x590c5c=_[_0x3018('0x3a')]({},_0x590c5c,_0x37e351[_0x3018('0x3d')]);return db[_0x3018('0x27')][_0x3018('0x43')](_0x590c5c)[_0x3018('0x1e')](handleEntityNotFound(_0x4eca2d,null))[_0x3018('0x1e')](respondWithResult(_0x4eca2d,null))[_0x3018('0x40')](handleError(_0x4eca2d,null));};exports['create']=function(_0x987bf4,_0x32d432){return db['Schedule']['create'](_0x987bf4['body'],{})[_0x3018('0x1e')](function(_0x375ed9){var _0x46668e=_0x987bf4[_0x3018('0x44')][_0x3018('0x45')]({'plain':!![]});if(!_0x46668e)throw new Error(_0x3018('0x46'));if(_0x46668e[_0x3018('0x47')]===_0x3018('0x44')){var _0x55dcf5=_0x375ed9[_0x3018('0x45')]({'plain':!![]});var _0x3d9a33=_0x3018('0x1f');return db[_0x3018('0x48')]['find']({'where':{'name':_0x3d9a33,'userProfileId':_0x46668e[_0x3018('0x49')]},'raw':!![]})[_0x3018('0x1e')](function(_0xeb007d){if(_0xeb007d&&_0xeb007d[_0x3018('0x4a')]===0x0){return db[_0x3018('0x20')][_0x3018('0x4b')]({'name':_0x55dcf5[_0x3018('0x24')],'resourceId':_0x55dcf5['id'],'type':_0xeb007d[_0x3018('0x24')],'sectionId':_0xeb007d['id']},{})[_0x3018('0x1e')](function(){return _0x375ed9;});}else{return _0x375ed9;}})['catch'](function(_0x744d6a){logger[_0x3018('0x22')](_0x3018('0x4c'),_0x744d6a);throw _0x744d6a;});}return _0x375ed9;})['then'](respondWithResult(_0x32d432,0xc9))[_0x3018('0x40')](handleError(_0x32d432,null));};exports[_0x3018('0x4d')]=function(_0x49db91,_0x484c38){if(_0x49db91[_0x3018('0x4e')]['id']){delete _0x49db91['body']['id'];}return db[_0x3018('0x27')][_0x3018('0x43')]({'where':{'id':_0x49db91[_0x3018('0x42')]['id']}})['then'](handleEntityNotFound(_0x484c38,null))['then'](saveUpdates(_0x49db91[_0x3018('0x4e')],null))['then'](respondWithResult(_0x484c38,null))['catch'](handleError(_0x484c38,null));};exports[_0x3018('0x1d')]=function(_0x400925,_0x54dfd1){return db['Schedule'][_0x3018('0x43')]({'where':{'id':_0x400925[_0x3018('0x42')]['id']}})['then'](handleEntityNotFound(_0x54dfd1,null))[_0x3018('0x1e')](removeEntity(_0x54dfd1,null))[_0x3018('0x40')](handleError(_0x54dfd1,null));};exports['run']=function(_0x41de65,_0x591f9e,_0x82494){var _0x543958=require('../../config/schedule');return db[_0x3018('0x27')][_0x3018('0x43')]({'where':{'id':_0x41de65[_0x3018('0x42')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x591f9e,null))['then'](function(){_0x543958['run'](_0x41de65[_0x3018('0x42')]['id']);})[_0x3018('0x1e')](respondWithStatusCode(_0x591f9e,null))[_0x3018('0x40')](handleError(_0x591f9e,null));}; \ No newline at end of file +var _0x02f8=['json','offset','limit','set','Content-Range','apply','reject','update','then','destroy','get','Scheduler','sendStatus','error','stack','name','index','map','Schedule','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','count','includeAll','include','rows','show','params','keys','options','catch','create','body','user','role','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','../../config/schedule','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','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','end','status'];(function(_0xff7136,_0x226373){var _0xf0d815=function(_0x19ece1){while(--_0x19ece1){_0xff7136['push'](_0xff7136['shift']());}};_0xf0d815(++_0x226373);}(_0x02f8,0x139));var _0x802f=function(_0x32e4de,_0x7da1c5){_0x32e4de=_0x32e4de-0x0;var _0x51ba2a=_0x02f8[_0x32e4de];return _0x51ba2a;};'use strict';var pdf=require(_0x802f('0x0'));var emlformat=require(_0x802f('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x802f('0x2'));var jsonpatch=require(_0x802f('0x3'));var rp=require(_0x802f('0x4'));var moment=require('moment');var BPromise=require(_0x802f('0x5'));var Mustache=require(_0x802f('0x6'));var util=require(_0x802f('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x802f('0x8'));var ejs=require(_0x802f('0x9'));var fs=require('fs');var _=require(_0x802f('0xa'));var squel=require(_0x802f('0xb'));var crypto=require('crypto');var jsforce=require(_0x802f('0xc'));var deskjs=require(_0x802f('0xd'));var toCsv=require(_0x802f('0x8'));var querystring=require(_0x802f('0xe'));var Papa=require(_0x802f('0xf'));var Redis=require(_0x802f('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x802f('0x11'));var as=require(_0x802f('0x12'));var hardwareService=require(_0x802f('0x13'));var logger=require(_0x802f('0x14'))(_0x802f('0x15'));var utils=require(_0x802f('0x16'));var config=require(_0x802f('0x17'));var db=require(_0x802f('0x18'))['db'];function respondWithStatusCode(_0x1f708b,_0x56a775){_0x56a775=_0x56a775||0xcc;return function(_0x240fe9){if(_0x240fe9){return _0x1f708b['sendStatus'](_0x56a775);}return _0x1f708b['status'](_0x56a775)[_0x802f('0x19')]();};}function respondWithResult(_0x3dffad,_0x54898f){_0x54898f=_0x54898f||0xc8;return function(_0x27265c){if(_0x27265c){return _0x3dffad[_0x802f('0x1a')](_0x54898f)[_0x802f('0x1b')](_0x27265c);}};}function respondWithFilteredResult(_0x2ae01a,_0x2965fc){return function(_0x2a4346){if(_0x2a4346){var _0x575ea1=_0x2a4346['count'],_0x788bfa=_0x2965fc['offset'],_0x3bb295=_0x2965fc[_0x802f('0x1c')]+_0x2965fc[_0x802f('0x1d')],_0x1eafa3;if(_0x3bb295>=_0x575ea1){_0x3bb295=_0x575ea1;_0x1eafa3=0xc8;}else{_0x1eafa3=0xce;}_0x2ae01a[_0x802f('0x1a')](_0x1eafa3);return _0x2ae01a[_0x802f('0x1e')](_0x802f('0x1f'),_0x788bfa+'-'+_0x3bb295+'/'+_0x575ea1)[_0x802f('0x1b')](_0x2a4346);}return null;};}function patchUpdates(_0x65c467){return function(_0x3c620c){try{jsonpatch[_0x802f('0x20')](_0x3c620c,_0x65c467,!![]);}catch(_0x15b373){return BPromise[_0x802f('0x21')](_0x15b373);}return _0x3c620c['save']();};}function saveUpdates(_0xc1ed1b,_0x244481){return function(_0x4e1931){if(_0x4e1931){return _0x4e1931[_0x802f('0x22')](_0xc1ed1b)[_0x802f('0x23')](function(_0x5b6ede){return _0x5b6ede;});}return null;};}function removeEntity(_0x1c0568,_0x386ce9){return function(_0x2495da){if(_0x2495da){return _0x2495da[_0x802f('0x24')]()[_0x802f('0x23')](function(){var _0x20188c=_0x2495da[_0x802f('0x25')]({'plain':!![]});var _0x3a9de4=_0x802f('0x26');return db['UserProfileResource'][_0x802f('0x24')]({'where':{'type':_0x3a9de4,'resourceId':_0x20188c['id']}})['then'](function(){return _0x2495da;});})[_0x802f('0x23')](function(){_0x1c0568[_0x802f('0x1a')](0xcc)[_0x802f('0x19')]();});}};}function handleEntityNotFound(_0x1c5d87,_0x4566c7){return function(_0x5c3b42){if(!_0x5c3b42){_0x1c5d87[_0x802f('0x27')](0x194);}return _0x5c3b42;};}function handleError(_0x6ddd41,_0x3b0343){_0x3b0343=_0x3b0343||0x1f4;return function(_0x3aaf5d){logger[_0x802f('0x28')](_0x3aaf5d[_0x802f('0x29')]);if(_0x3aaf5d[_0x802f('0x2a')]){delete _0x3aaf5d['name'];}_0x6ddd41[_0x802f('0x1a')](_0x3b0343)['send'](_0x3aaf5d);};}exports[_0x802f('0x2b')]=function(_0xf1be08,_0x477d10){var _0x472fff={},_0x498ba7={},_0x49802a={'count':0x0,'rows':[]};var _0x31aa13=_[_0x802f('0x2c')](db[_0x802f('0x2d')][_0x802f('0x2e')],function(_0x5d5ebf){return{'name':_0x5d5ebf[_0x802f('0x2f')],'type':_0x5d5ebf[_0x802f('0x30')]['key']};});_0x498ba7[_0x802f('0x31')]=_[_0x802f('0x2c')](_0x31aa13,_0x802f('0x2a'));_0x498ba7[_0x802f('0x32')]=_['keys'](_0xf1be08['query']);_0x498ba7[_0x802f('0x33')]=_[_0x802f('0x34')](_0x498ba7[_0x802f('0x31')],_0x498ba7['query']);_0x472fff[_0x802f('0x35')]=_[_0x802f('0x34')](_0x498ba7[_0x802f('0x31')],qs[_0x802f('0x36')](_0xf1be08[_0x802f('0x32')]['fields']));_0x472fff[_0x802f('0x35')]=_0x472fff[_0x802f('0x35')][_0x802f('0x37')]?_0x472fff['attributes']:_0x498ba7[_0x802f('0x31')];if(!_0xf1be08[_0x802f('0x32')][_0x802f('0x38')](_0x802f('0x39'))){_0x472fff[_0x802f('0x1d')]=qs[_0x802f('0x1d')](_0xf1be08['query'][_0x802f('0x1d')]);_0x472fff[_0x802f('0x1c')]=qs[_0x802f('0x1c')](_0xf1be08['query']['offset']);}_0x472fff[_0x802f('0x3a')]=qs[_0x802f('0x3b')](_0xf1be08['query']['sort']);_0x472fff[_0x802f('0x3c')]=qs['filters'](_[_0x802f('0x3d')](_0xf1be08[_0x802f('0x32')],_0x498ba7[_0x802f('0x33')]));if(_0xf1be08['query']['filter']){_0x472fff[_0x802f('0x3c')]=_[_0x802f('0x3e')](_0x472fff[_0x802f('0x3c')],{'$or':_['map'](_0x31aa13,function(_0x3a4a2d){if(_0x3a4a2d[_0x802f('0x30')]!==_0x802f('0x3f')){var _0x1ba87e={};_0x1ba87e[_0x3a4a2d[_0x802f('0x2a')]]={'$like':'%'+_0xf1be08[_0x802f('0x32')][_0x802f('0x40')]+'%'};return _0x1ba87e;}})});}_0x472fff=_[_0x802f('0x3e')]({},_0x472fff,_0xf1be08['options']);var _0x5d7d9a={'where':_0x472fff[_0x802f('0x3c')]};return db[_0x802f('0x2d')][_0x802f('0x41')](_0x5d7d9a)[_0x802f('0x23')](function(_0x18e769){_0x49802a['count']=_0x18e769;if(_0xf1be08[_0x802f('0x32')][_0x802f('0x42')]){_0x472fff[_0x802f('0x43')]=[{'all':!![]}];}return db[_0x802f('0x2d')]['findAll'](_0x472fff);})[_0x802f('0x23')](function(_0x2f8440){_0x49802a[_0x802f('0x44')]=_0x2f8440;return _0x49802a;})[_0x802f('0x23')](respondWithFilteredResult(_0x477d10,_0x472fff))['catch'](handleError(_0x477d10,null));};exports[_0x802f('0x45')]=function(_0x4359cf,_0x52c653){var _0x21ae10={'raw':![],'where':{'id':_0x4359cf[_0x802f('0x46')]['id']}},_0x297115={};_0x297115[_0x802f('0x31')]=_[_0x802f('0x47')](db['Schedule'][_0x802f('0x2e')]);_0x297115[_0x802f('0x32')]=_['keys'](_0x4359cf[_0x802f('0x32')]);_0x297115[_0x802f('0x33')]=_['intersection'](_0x297115[_0x802f('0x31')],_0x297115[_0x802f('0x32')]);_0x21ae10[_0x802f('0x35')]=_[_0x802f('0x34')](_0x297115['model'],qs[_0x802f('0x36')](_0x4359cf[_0x802f('0x32')]['fields']));_0x21ae10['attributes']=_0x21ae10['attributes']['length']?_0x21ae10[_0x802f('0x35')]:_0x297115['model'];if(_0x4359cf['query'][_0x802f('0x42')]){_0x21ae10[_0x802f('0x43')]=[{'all':!![]}];}_0x21ae10=_[_0x802f('0x3e')]({},_0x21ae10,_0x4359cf[_0x802f('0x48')]);return db[_0x802f('0x2d')]['find'](_0x21ae10)[_0x802f('0x23')](handleEntityNotFound(_0x52c653,null))[_0x802f('0x23')](respondWithResult(_0x52c653,null))[_0x802f('0x49')](handleError(_0x52c653,null));};exports[_0x802f('0x4a')]=function(_0x410fa3,_0x2ef63a){return db[_0x802f('0x2d')][_0x802f('0x4a')](_0x410fa3[_0x802f('0x4b')],{})[_0x802f('0x23')](function(_0x3449a0){var _0x7f0dbc=_0x410fa3[_0x802f('0x4c')][_0x802f('0x25')]({'plain':!![]});if(!_0x7f0dbc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x7f0dbc[_0x802f('0x4d')]===_0x802f('0x4c')){var _0x2c2411=_0x3449a0['get']({'plain':!![]});var _0x50de38=_0x802f('0x26');return db['UserProfileSection'][_0x802f('0x4e')]({'where':{'name':_0x50de38,'userProfileId':_0x7f0dbc[_0x802f('0x4f')]},'raw':!![]})[_0x802f('0x23')](function(_0x3d79ce){if(_0x3d79ce&&_0x3d79ce[_0x802f('0x50')]===0x0){return db[_0x802f('0x51')][_0x802f('0x4a')]({'name':_0x2c2411['name'],'resourceId':_0x2c2411['id'],'type':_0x3d79ce[_0x802f('0x2a')],'sectionId':_0x3d79ce['id']},{})['then'](function(){return _0x3449a0;});}else{return _0x3449a0;}})['catch'](function(_0x442e72){logger[_0x802f('0x28')](_0x802f('0x52'),_0x442e72);throw _0x442e72;});}return _0x3449a0;})[_0x802f('0x23')](respondWithResult(_0x2ef63a,0xc9))[_0x802f('0x49')](handleError(_0x2ef63a,null));};exports['update']=function(_0x290100,_0xb8caf9){if(_0x290100['body']['id']){delete _0x290100['body']['id'];}return db[_0x802f('0x2d')]['find']({'where':{'id':_0x290100[_0x802f('0x46')]['id']}})[_0x802f('0x23')](handleEntityNotFound(_0xb8caf9,null))['then'](saveUpdates(_0x290100[_0x802f('0x4b')],null))[_0x802f('0x23')](respondWithResult(_0xb8caf9,null))[_0x802f('0x49')](handleError(_0xb8caf9,null));};exports['destroy']=function(_0x491ddf,_0x432cbf){return db[_0x802f('0x2d')]['find']({'where':{'id':_0x491ddf[_0x802f('0x46')]['id']}})[_0x802f('0x23')](handleEntityNotFound(_0x432cbf,null))['then'](removeEntity(_0x432cbf,null))[_0x802f('0x49')](handleError(_0x432cbf,null));};exports[_0x802f('0x53')]=function(_0x5af73e,_0x3e2594,_0xc223be){var _0x36b187=require(_0x802f('0x54'));return db[_0x802f('0x2d')][_0x802f('0x4e')]({'where':{'id':_0x5af73e[_0x802f('0x46')]['id']},'raw':!![]})[_0x802f('0x23')](handleEntityNotFound(_0x3e2594,null))['then'](function(){_0x36b187[_0x802f('0x53')](_0x5af73e[_0x802f('0x46')]['id']);})[_0x802f('0x23')](respondWithStatusCode(_0x3e2594,null))[_0x802f('0x49')](handleError(_0x3e2594,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 3b5e171..b226776 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 _0x4030=['request-promise','rimraf','../../config/environment','./schedule.attributes','exports','Schedule','tools_schedules','util','api','moment','bluebird'];(function(_0x3cc32d,_0x1aacff){var _0x327c84=function(_0x5aa199){while(--_0x5aa199){_0x3cc32d['push'](_0x3cc32d['shift']());}};_0x327c84(++_0x1aacff);}(_0x4030,0x80));var _0x0403=function(_0x13c625,_0xc65b8e){_0x13c625=_0x13c625-0x0;var _0x1f2506=_0x4030[_0x13c625];return _0x1f2506;};'use strict';var _=require('lodash');var util=require(_0x0403('0x0'));var logger=require('../../config/logger')(_0x0403('0x1'));var moment=require(_0x0403('0x2'));var BPromise=require(_0x0403('0x3'));var rp=require(_0x0403('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0403('0x5'));var config=require(_0x0403('0x6'));var attributes=require(_0x0403('0x7'));module[_0x0403('0x8')]=function(_0x14ab7d,_0x3a4b0c){return _0x14ab7d['define'](_0x0403('0x9'),attributes,{'tableName':_0x0403('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1aab=['util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./schedule.attributes','exports','define','tools_schedules'];(function(_0x3aa3fd,_0x228918){var _0x35b4c1=function(_0x22f750){while(--_0x22f750){_0x3aa3fd['push'](_0x3aa3fd['shift']());}};_0x35b4c1(++_0x228918);}(_0x1aab,0x176));var _0xb1aa=function(_0x466e7f,_0xdbdd8b){_0x466e7f=_0x466e7f-0x0;var _0x44c6e7=_0x1aab[_0x466e7f];return _0x44c6e7;};'use strict';var _=require('lodash');var util=require(_0xb1aa('0x0'));var logger=require(_0xb1aa('0x1'))(_0xb1aa('0x2'));var moment=require('moment');var BPromise=require(_0xb1aa('0x3'));var rp=require(_0xb1aa('0x4'));var fs=require('fs');var path=require(_0xb1aa('0x5'));var rimraf=require('rimraf');var config=require(_0xb1aa('0x6'));var attributes=require(_0xb1aa('0x7'));module[_0xb1aa('0x8')]=function(_0x5160ae,_0x2378b5){return _0x5160ae[_0xb1aa('0x9')]('Schedule',attributes,{'tableName':_0xb1aa('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/schedule/schedule.rpc.js b/server/api/schedule/schedule.rpc.js index 1fd3bd2..0773515 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 _0x0ab5=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Schedule,\x20%s,\x20%s','debug','Schedule,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x563c6a,_0x42b20d){var _0x2eea4d=function(_0x398101){while(--_0x398101){_0x563c6a['push'](_0x563c6a['shift']());}};_0x2eea4d(++_0x42b20d);}(_0x0ab5,0x1e5));var _0x50ab=function(_0x339458,_0x345ea5){_0x339458=_0x339458-0x0;var _0x241a7d=_0x0ab5[_0x339458];return _0x241a7d;};'use strict';var _=require(_0x50ab('0x0'));var util=require('util');var moment=require(_0x50ab('0x1'));var BPromise=require(_0x50ab('0x2'));var rs=require(_0x50ab('0x3'));var fs=require('fs');var Redis=require(_0x50ab('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x50ab('0x5'));var logger=require(_0x50ab('0x6'))('rpc');var config=require(_0x50ab('0x7'));var jayson=require(_0x50ab('0x8'));var client=jayson[_0x50ab('0x9')][_0x50ab('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x18a90c,_0x1ed6ec,_0x3eec55){return new BPromise(function(_0x69ba0a,_0x5b3a0c){return client[_0x50ab('0xb')](_0x18a90c,_0x3eec55)['then'](function(_0x5f1887){logger[_0x50ab('0xc')](_0x50ab('0xd'),_0x1ed6ec,'request\x20sent');logger[_0x50ab('0xe')](_0x50ab('0xf'),_0x1ed6ec,_0x50ab('0x10'),JSON[_0x50ab('0x11')](_0x5f1887));if(_0x5f1887[_0x50ab('0x12')]){if(_0x5f1887[_0x50ab('0x12')][_0x50ab('0x13')]===0x1f4){logger[_0x50ab('0x12')]('Schedule,\x20%s,\x20%s',_0x1ed6ec,_0x5f1887['error']['message']);return _0x5b3a0c(_0x5f1887[_0x50ab('0x12')][_0x50ab('0x14')]);}logger[_0x50ab('0x12')](_0x50ab('0xd'),_0x1ed6ec,_0x5f1887[_0x50ab('0x12')]['message']);return _0x69ba0a(_0x5f1887[_0x50ab('0x12')][_0x50ab('0x14')]);}else{logger[_0x50ab('0xc')](_0x50ab('0xd'),_0x1ed6ec,_0x50ab('0x10'));_0x69ba0a(_0x5f1887[_0x50ab('0x15')][_0x50ab('0x14')]);}})[_0x50ab('0x16')](function(_0x26df6c){logger[_0x50ab('0x12')](_0x50ab('0xd'),_0x1ed6ec,_0x26df6c);_0x5b3a0c(_0x26df6c);});});} \ No newline at end of file +var _0x2db5=['Schedule,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x19b3f9,_0xade753){var _0x18c3f6=function(_0x21439f){while(--_0x21439f){_0x19b3f9['push'](_0x19b3f9['shift']());}};_0x18c3f6(++_0xade753);}(_0x2db5,0xf3));var _0x52db=function(_0x575a38,_0x2e83d7){_0x575a38=_0x575a38-0x0;var _0x5a7bdd=_0x2db5[_0x575a38];return _0x5a7bdd;};'use strict';var _=require(_0x52db('0x0'));var util=require(_0x52db('0x1'));var moment=require(_0x52db('0x2'));var BPromise=require(_0x52db('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x52db('0x4'));var db=require(_0x52db('0x5'))['db'];var utils=require(_0x52db('0x6'));var logger=require(_0x52db('0x7'))(_0x52db('0x8'));var config=require(_0x52db('0x9'));var jayson=require(_0x52db('0xa'));var client=jayson[_0x52db('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27883f,_0x5ecc0a,_0x4d265e){return new BPromise(function(_0xc38a3a,_0x1bd0cd){return client[_0x52db('0xc')](_0x27883f,_0x4d265e)[_0x52db('0xd')](function(_0x10d09f){logger[_0x52db('0xe')]('Schedule,\x20%s,\x20%s',_0x5ecc0a,_0x52db('0xf'));logger[_0x52db('0x10')](_0x52db('0x11'),_0x5ecc0a,_0x52db('0xf'),JSON['stringify'](_0x10d09f));if(_0x10d09f[_0x52db('0x12')]){if(_0x10d09f[_0x52db('0x12')][_0x52db('0x13')]===0x1f4){logger['error']('Schedule,\x20%s,\x20%s',_0x5ecc0a,_0x10d09f['error'][_0x52db('0x14')]);return _0x1bd0cd(_0x10d09f[_0x52db('0x12')][_0x52db('0x14')]);}logger[_0x52db('0x12')](_0x52db('0x15'),_0x5ecc0a,_0x10d09f[_0x52db('0x12')]['message']);return _0xc38a3a(_0x10d09f['error'][_0x52db('0x14')]);}else{logger[_0x52db('0xe')](_0x52db('0x15'),_0x5ecc0a,_0x52db('0xf'));_0xc38a3a(_0x10d09f[_0x52db('0x16')]['message']);}})[_0x52db('0x17')](function(_0x56f009){logger['error'](_0x52db('0x15'),_0x5ecc0a,_0x56f009);_0x1bd0cd(_0x56f009);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 02511ee..0def92e 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 _0x413d=['index','get','/describe','describe','/:id','show','/:id/download','download','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','isAuthenticated'];(function(_0x1eda20,_0x1149f4){var _0x31b953=function(_0x25f0d8){while(--_0x25f0d8){_0x1eda20['push'](_0x1eda20['shift']());}};_0x31b953(++_0x1149f4);}(_0x413d,0x19e));var _0xd413=function(_0x42bc91,_0x41f40a){_0x42bc91=_0x42bc91-0x0;var _0x3f5507=_0x413d[_0x42bc91];return _0x3f5507;};'use strict';var multer=require(_0xd413('0x0'));var util=require(_0xd413('0x1'));var path=require(_0xd413('0x2'));var timeout=require(_0xd413('0x3'));var express=require(_0xd413('0x4'));var router=express[_0xd413('0x5')]();var auth=require(_0xd413('0x6'));var interaction=require(_0xd413('0x7'));var config=require(_0xd413('0x8'));var controller=require(_0xd413('0x9'));router['get']('/',auth[_0xd413('0xa')](),controller[_0xd413('0xb')]);router[_0xd413('0xc')](_0xd413('0xd'),auth[_0xd413('0xa')](),controller[_0xd413('0xe')]);router['get'](_0xd413('0xf'),auth[_0xd413('0xa')](),controller[_0xd413('0x10')]);router[_0xd413('0xc')](_0xd413('0x11'),auth['isAuthenticated'](),controller[_0xd413('0x12')]);router[_0xd413('0x13')]('/',auth[_0xd413('0xa')](),controller['create']);router[_0xd413('0x14')](_0xd413('0xf'),auth[_0xd413('0xa')](),controller[_0xd413('0x15')]);router[_0xd413('0x16')](_0xd413('0xf'),auth['isAuthenticated'](),controller[_0xd413('0x17')]);module[_0xd413('0x18')]=router; \ No newline at end of file +var _0xae0d=['multer','util','path','Router','../../components/auth/service','../../config/environment','get','index','isAuthenticated','describe','/:id','show','/:id/download','download','post','put','update','delete','destroy'];(function(_0x41428b,_0xe6dbc7){var _0x3d32df=function(_0x2cd3c9){while(--_0x2cd3c9){_0x41428b['push'](_0x41428b['shift']());}};_0x3d32df(++_0xe6dbc7);}(_0xae0d,0x156));var _0xdae0=function(_0x13429d,_0x1e35e5){_0x13429d=_0x13429d-0x0;var _0x289c6a=_0xae0d[_0x13429d];return _0x289c6a;};'use strict';var multer=require(_0xdae0('0x0'));var util=require(_0xdae0('0x1'));var path=require(_0xdae0('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xdae0('0x3')]();var auth=require(_0xdae0('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xdae0('0x5'));var controller=require('./screenRecording.controller');router[_0xdae0('0x6')]('/',auth['isAuthenticated'](),controller[_0xdae0('0x7')]);router[_0xdae0('0x6')]('/describe',auth[_0xdae0('0x8')](),controller[_0xdae0('0x9')]);router['get'](_0xdae0('0xa'),auth[_0xdae0('0x8')](),controller[_0xdae0('0xb')]);router[_0xdae0('0x6')](_0xdae0('0xc'),auth[_0xdae0('0x8')](),controller[_0xdae0('0xd')]);router[_0xdae0('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xdae0('0xf')](_0xdae0('0xa'),auth[_0xdae0('0x8')](),controller[_0xdae0('0x10')]);router[_0xdae0('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xdae0('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index caddda7..084c9b5 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 _0xac9d=['format','createdAt','updatedAt','sequelize','moment','path','../../config/environment','exports','VIRTUAL','getDataValue','value','STRING','replace','INTEGER','setDataValue','startedAt','subtract','closedAt','duration','MM-DD-YYYY\x20HH:mm','toString','DATE'];(function(_0x2b5782,_0x32c69b){var _0x886822=function(_0x15a257){while(--_0x15a257){_0x2b5782['push'](_0x2b5782['shift']());}};_0x886822(++_0x32c69b);}(_0xac9d,0x14d));var _0xdac9=function(_0x2c4aef,_0x116fe2){_0x2c4aef=_0x2c4aef-0x0;var _0x3deaed=_0xac9d[_0x2c4aef];return _0x3deaed;};'use strict';var Sequelize=require(_0xdac9('0x0'));var moment=require(_0xdac9('0x1'));var path=require(_0xdac9('0x2'));var config=require(_0xdac9('0x3'));module[_0xdac9('0x4')]={'format':{'type':Sequelize[_0xdac9('0x5')],'get':function(){return this[_0xdac9('0x6')](_0xdac9('0x7'))?path['extname'](this[_0xdac9('0x6')]('value')):undefined;}},'interactionid':{'type':Sequelize[_0xdac9('0x8')]},'channel':{'type':Sequelize[_0xdac9('0x8')]},'value':{'type':Sequelize[_0xdac9('0x8')],'set':function(_0x776b6c){var _0x1c78c5=_0x776b6c[_0xdac9('0x9')](/\\/g,'/');this['setDataValue'](_0xdac9('0x7'),_0x1c78c5);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xdac9('0xa')],'set':function(_0x3a013b){this[_0xdac9('0xb')](_0xdac9('0xc'),moment()[_0xdac9('0xd')](_0x3a013b,'ms'));this[_0xdac9('0xb')](_0xdac9('0xe'),moment());this[_0xdac9('0xb')](_0xdac9('0xf'),_0x3a013b);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xdac9('0x6')](_0xdac9('0xc')))['format'](_0xdac9('0x10'))[_0xdac9('0x11')]();}},'closedAt':{'type':Sequelize[_0xdac9('0x12')],'get':function(){return moment(this['getDataValue'](_0xdac9('0xe')))[_0xdac9('0x13')](_0xdac9('0x10'))['toString']();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xdac9('0x6')](_0xdac9('0x14')))['format'](_0xdac9('0x10'))[_0xdac9('0x11')]();}},'updatedAt':{'type':Sequelize[_0xdac9('0x12')],'get':function(){return moment(this[_0xdac9('0x6')](_0xdac9('0x15')))[_0xdac9('0x13')](_0xdac9('0x10'))[_0xdac9('0x11')]();}}}; \ No newline at end of file +var _0xa41a=['toString','updatedAt','sequelize','moment','../../config/environment','exports','VIRTUAL','getDataValue','value','extname','STRING','replace','setDataValue','INTEGER','startedAt','subtract','closedAt','DATE','MM-DD-YYYY\x20HH:mm','format','createdAt'];(function(_0x28710d,_0x179435){var _0x146c7e=function(_0x29e2ae){while(--_0x29e2ae){_0x28710d['push'](_0x28710d['shift']());}};_0x146c7e(++_0x179435);}(_0xa41a,0x6b));var _0xaa41=function(_0x2623b7,_0x4a69c9){_0x2623b7=_0x2623b7-0x0;var _0x2eb69c=_0xa41a[_0x2623b7];return _0x2eb69c;};'use strict';var Sequelize=require(_0xaa41('0x0'));var moment=require(_0xaa41('0x1'));var path=require('path');var config=require(_0xaa41('0x2'));module[_0xaa41('0x3')]={'format':{'type':Sequelize[_0xaa41('0x4')],'get':function(){return this[_0xaa41('0x5')](_0xaa41('0x6'))?path[_0xaa41('0x7')](this[_0xaa41('0x5')](_0xaa41('0x6'))):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xaa41('0x8')]},'value':{'type':Sequelize[_0xaa41('0x8')],'set':function(_0x54bc5a){var _0x5b1fff=_0x54bc5a[_0xaa41('0x9')](/\\/g,'/');this[_0xaa41('0xa')]('value',_0x5b1fff);}},'rating':{'type':Sequelize[_0xaa41('0xb')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xaa41('0xb')],'set':function(_0x409dab){this[_0xaa41('0xa')](_0xaa41('0xc'),moment()[_0xaa41('0xd')](_0x409dab,'ms'));this[_0xaa41('0xa')](_0xaa41('0xe'),moment());this[_0xaa41('0xa')]('duration',_0x409dab);}},'startedAt':{'type':Sequelize[_0xaa41('0xf')],'get':function(){return moment(this[_0xaa41('0x5')]('startedAt'))['format'](_0xaa41('0x10'))['toString']();}},'closedAt':{'type':Sequelize[_0xaa41('0xf')],'get':function(){return moment(this[_0xaa41('0x5')](_0xaa41('0xe')))[_0xaa41('0x11')](_0xaa41('0x10'))['toString']();}},'createdAt':{'type':Sequelize[_0xaa41('0xf')],'get':function(){return moment(this[_0xaa41('0x5')](_0xaa41('0x12')))[_0xaa41('0x11')](_0xaa41('0x10'))[_0xaa41('0x13')]();}},'updatedAt':{'type':Sequelize[_0xaa41('0xf')],'get':function(){return moment(this['getDataValue'](_0xaa41('0x14')))[_0xaa41('0x11')](_0xaa41('0x10'))[_0xaa41('0x13')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 8a6f774..8206395 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 _0x3941=['filename','extname','unlink','Not\x20found','find','Entity\x20not\x20found','info','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','map','ScreenRecording','rawAttributes','fieldName','key','model','differenceBy','format','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','keys','length','create','body','update','duration','closedAt','value','download','type','uniqueid','join','root','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','ScreenRecording\x20not\x20found'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x3941,0x71));var _0x1394=function(_0x20cfdb,_0x5d0b89){_0x20cfdb=_0x20cfdb-0x0;var _0x42d771=_0x3941[_0x20cfdb];return _0x42d771;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1394('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1394('0x1'));var jsonpatch=require(_0x1394('0x2'));var rp=require(_0x1394('0x3'));var moment=require(_0x1394('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1394('0x5'));var util=require(_0x1394('0x6'));var path=require(_0x1394('0x7'));var sox=require(_0x1394('0x8'));var csv=require(_0x1394('0x9'));var ejs=require(_0x1394('0xa'));var fs=require('fs');var _=require(_0x1394('0xb'));var squel=require('squel');var crypto=require(_0x1394('0xc'));var jsforce=require(_0x1394('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x1394('0x9'));var querystring=require(_0x1394('0xe'));var Papa=require(_0x1394('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1394('0x10'));var hardwareService=require(_0x1394('0x11'));var logger=require(_0x1394('0x12'))(_0x1394('0x13'));var utils=require(_0x1394('0x14'));var config=require('../../config/environment');var db=require(_0x1394('0x15'))['db'];function respondWithStatusCode(_0x36e9d2,_0x5a6405){_0x5a6405=_0x5a6405||0xcc;return function(_0x25a654){if(_0x25a654){return _0x36e9d2[_0x1394('0x16')](_0x5a6405);}return _0x36e9d2[_0x1394('0x17')](_0x5a6405)[_0x1394('0x18')]();};}function respondWithResult(_0x512a3e,_0x38c6dc){_0x38c6dc=_0x38c6dc||0xc8;return function(_0x4b952e){if(_0x4b952e){return _0x512a3e['status'](_0x38c6dc)[_0x1394('0x19')](_0x4b952e);}};}function respondWithFilteredResult(_0x173d7b,_0x5b7a48){return function(_0x19ac5a){if(_0x19ac5a){var _0x48e428=_0x19ac5a[_0x1394('0x1a')],_0x15fbc3=_0x5b7a48[_0x1394('0x1b')],_0x59a5e7=_0x5b7a48[_0x1394('0x1b')]+_0x5b7a48[_0x1394('0x1c')],_0x1e64dc;if(_0x59a5e7>=_0x48e428){_0x59a5e7=_0x48e428;_0x1e64dc=0xc8;}else{_0x1e64dc=0xce;}_0x173d7b['status'](_0x1e64dc);return _0x173d7b[_0x1394('0x1d')](_0x1394('0x1e'),_0x15fbc3+'-'+_0x59a5e7+'/'+_0x48e428)[_0x1394('0x19')](_0x19ac5a);}return null;};}function patchUpdates(_0x3a60c){return function(_0x3bf9c7){try{jsonpatch[_0x1394('0x1f')](_0x3bf9c7,_0x3a60c,!![]);}catch(_0x2d326d){return BPromise[_0x1394('0x20')](_0x2d326d);}return _0x3bf9c7[_0x1394('0x21')]();};}function saveUpdates(_0x164db0,_0x22fe83){return function(_0x1cef43){if(_0x1cef43){return _0x1cef43['update'](_0x164db0)[_0x1394('0x22')](function(_0x51c357){return _0x51c357;});}return null;};}function removeEntity(_0x10e157,_0x386c85){return function(_0x4b206c){if(_0x4b206c){return _0x4b206c[_0x1394('0x23')]()['then'](function(){_0x10e157['status'](0xcc)[_0x1394('0x18')]();});}};}function handleEntityNotFound(_0x417576,_0x1bed57){return function(_0x3ac799){if(!_0x3ac799){_0x417576['sendStatus'](0x194);}return _0x3ac799;};}function handleError(_0x1f31a9,_0x21c513){_0x21c513=_0x21c513||0x1f4;return function(_0x310466){logger[_0x1394('0x24')](_0x310466[_0x1394('0x25')]);if(_0x310466[_0x1394('0x26')]){delete _0x310466[_0x1394('0x26')];}_0x1f31a9[_0x1394('0x17')](_0x21c513)[_0x1394('0x27')](_0x310466);};}exports['index']=function(_0x4095e7,_0x426883){var _0x1e56f1={},_0x4384d5={},_0x38fa82={'count':0x0,'rows':[]};var _0x22f675=_[_0x1394('0x28')](db[_0x1394('0x29')][_0x1394('0x2a')],function(_0x33c665){return{'name':_0x33c665[_0x1394('0x2b')],'type':_0x33c665['type'][_0x1394('0x2c')]};});_0x4384d5[_0x1394('0x2d')]=_[_0x1394('0x2e')](_[_0x1394('0x28')](_0x22f675,_0x1394('0x26')),[_0x1394('0x2f')]);_0x4384d5[_0x1394('0x30')]=_['keys'](_0x4095e7[_0x1394('0x30')]);_0x4384d5[_0x1394('0x31')]=_[_0x1394('0x32')](_0x4384d5['model'],_0x4384d5['query']);_0x1e56f1[_0x1394('0x33')]=_[_0x1394('0x32')](_0x4384d5[_0x1394('0x2d')],qs[_0x1394('0x34')](_0x4095e7[_0x1394('0x30')]['fields']));_0x1e56f1['attributes']=_0x1e56f1[_0x1394('0x33')]['length']?_0x1e56f1[_0x1394('0x33')]:_0x4384d5['model'];if(!_0x4095e7[_0x1394('0x30')][_0x1394('0x35')](_0x1394('0x36'))){_0x1e56f1[_0x1394('0x1c')]=qs['limit'](_0x4095e7['query'][_0x1394('0x1c')]);_0x1e56f1[_0x1394('0x1b')]=qs['offset'](_0x4095e7[_0x1394('0x30')][_0x1394('0x1b')]);}_0x1e56f1[_0x1394('0x37')]=qs[_0x1394('0x38')](_0x4095e7[_0x1394('0x30')][_0x1394('0x38')]);_0x1e56f1[_0x1394('0x39')]=qs[_0x1394('0x31')](_['pick'](_0x4095e7['query'],_0x4384d5[_0x1394('0x31')]));if(_0x4095e7[_0x1394('0x30')]['filter']){_0x1e56f1['where']=_['merge'](_0x1e56f1['where'],{'$or':_['map'](_0x22f675,function(_0x1f81ba){if(_0x1f81ba['type']!==_0x1394('0x3a')){var _0x336395={};_0x336395[_0x1f81ba[_0x1394('0x26')]]={'$like':'%'+_0x4095e7[_0x1394('0x30')]['filter']+'%'};return _0x336395;}})});}_0x1e56f1=_[_0x1394('0x3b')]({},_0x1e56f1,_0x4095e7['options']);var _0x5eaa1c={'where':_0x1e56f1[_0x1394('0x39')]};return db[_0x1394('0x29')][_0x1394('0x1a')](_0x5eaa1c)[_0x1394('0x22')](function(_0x154501){_0x38fa82['count']=_0x154501;if(_0x4095e7[_0x1394('0x30')][_0x1394('0x3c')]){_0x1e56f1[_0x1394('0x3d')]=[{'all':!![]}];}return db['ScreenRecording'][_0x1394('0x3e')](_0x1e56f1);})[_0x1394('0x22')](function(_0x4c26d2){_0x38fa82[_0x1394('0x3f')]=_0x4c26d2;return _0x38fa82;})[_0x1394('0x22')](respondWithFilteredResult(_0x426883,_0x1e56f1))[_0x1394('0x40')](handleError(_0x426883,null));};exports[_0x1394('0x41')]=function(_0x1c7fd8,_0x285602){var _0x23555b={'raw':![],'where':{'id':_0x1c7fd8[_0x1394('0x42')]['id']}},_0x586e44={};_0x586e44['model']=_['keys'](db['ScreenRecording'][_0x1394('0x2a')]);_0x586e44[_0x1394('0x30')]=_[_0x1394('0x43')](_0x1c7fd8[_0x1394('0x30')]);_0x586e44['filters']=_[_0x1394('0x32')](_0x586e44[_0x1394('0x2d')],_0x586e44['query']);_0x23555b['attributes']=_[_0x1394('0x32')](_0x586e44[_0x1394('0x2d')],qs[_0x1394('0x34')](_0x1c7fd8['query']['fields']));_0x23555b[_0x1394('0x33')]=_0x23555b['attributes'][_0x1394('0x44')]?_0x23555b[_0x1394('0x33')]:_0x586e44[_0x1394('0x2d')];if(_0x1c7fd8['query'][_0x1394('0x3c')]){_0x23555b[_0x1394('0x3d')]=[{'all':!![]}];}_0x23555b=_[_0x1394('0x3b')]({},_0x23555b,_0x1c7fd8['options']);return db[_0x1394('0x29')]['find'](_0x23555b)['then'](handleEntityNotFound(_0x285602,null))[_0x1394('0x22')](respondWithResult(_0x285602,null))['catch'](handleError(_0x285602,null));};exports[_0x1394('0x45')]=function(_0x2c292a,_0x45d732){return db[_0x1394('0x29')]['create'](_0x2c292a[_0x1394('0x46')],{})[_0x1394('0x22')](respondWithResult(_0x45d732,0xc9))[_0x1394('0x40')](handleError(_0x45d732,null));};exports[_0x1394('0x47')]=function(_0xd44b47,_0x588a56){if(_0xd44b47[_0x1394('0x46')]['id']){delete _0xd44b47[_0x1394('0x46')]['id'];}delete _0xd44b47[_0x1394('0x46')][_0x1394('0x48')];delete _0xd44b47[_0x1394('0x46')]['createdAt'];delete _0xd44b47[_0x1394('0x46')][_0x1394('0x49')];delete _0xd44b47[_0x1394('0x46')][_0x1394('0x4a')];return db[_0x1394('0x29')]['find']({'where':{'id':_0xd44b47['params']['id']}})['then'](handleEntityNotFound(_0x588a56,null))['then'](saveUpdates(_0xd44b47[_0x1394('0x46')],null))[_0x1394('0x22')](respondWithResult(_0x588a56,null))['catch'](handleError(_0x588a56,null));};exports['describe']=function(_0x39ba88,_0x4ea2e0){return db[_0x1394('0x29')]['describe']()['then'](respondWithResult(_0x4ea2e0,null))[_0x1394('0x40')](handleError(_0x4ea2e0,null));};exports[_0x1394('0x4b')]=function(_0x363d88,_0x123620,_0x3bf19f){var _0x553f05=require('../../components/encryptor');var _0x5e9227=![];var _0x53a947={};if(_0x363d88[_0x1394('0x30')][_0x1394('0x4c')]&&_0x363d88[_0x1394('0x30')][_0x1394('0x4c')]==='uniqueid'){_0x53a947[_0x1394('0x4d')]=_0x363d88[_0x1394('0x42')]['id'];}else{_0x53a947['id']=_0x363d88['params']['id'];}return db['ScreenRecording']['find']({'where':_0x53a947,'attributes':['id',_0x1394('0x4a')],'raw':!![]})[_0x1394('0x22')](handleEntityNotFound(_0x123620,null))[_0x1394('0x22')](function(_0x24d070){if(_0x24d070){var _0x2ee580=path[_0x1394('0x4e')](config[_0x1394('0x4f')],_0x1394('0x50'),_0x24d070[_0x1394('0x4a')]);var _0x3216e1=util[_0x1394('0x2f')](_0x1394('0x51'),_0x2ee580);if(fs[_0x1394('0x52')](_0x3216e1)){_0x5e9227=!![];return _0x553f05[_0x1394('0x53')](_0x3216e1,_0x2ee580,config[_0x1394('0x54')][_0x1394('0x55')])[_0x1394('0x22')](function(){return _0x24d070;});}return _0x24d070;}})[_0x1394('0x22')](function(_0x43823d){if(_0x43823d){var _0x3516a6=path[_0x1394('0x4e')](config[_0x1394('0x4f')],_0x1394('0x50'),_0x43823d[_0x1394('0x4a')]);if(!fs[_0x1394('0x52')](_0x3516a6)){throw new db[(_0x1394('0x56'))][(_0x1394('0x57'))](_0x1394('0x58'));}if(_0x43823d['filename']){return _0x123620[_0x1394('0x4b')](_0x3516a6,_0x43823d[_0x1394('0x59')]+path[_0x1394('0x5a')](_0x3516a6),function(){if(_0x5e9227){fs['unlink'](_0x3516a6);}});}else{return _0x123620['download'](_0x3516a6,function(_0x17793b){if(_0x5e9227){fs[_0x1394('0x5b')](_0x3516a6);}});}}})['catch'](function(_0x204da3){if(_0x204da3['message']===_0x1394('0x58')){_0x123620[_0x1394('0x17')](0x194)[_0x1394('0x27')](_0x1394('0x5c'));}else{return handleError(_0x123620,null);}});};exports['destroy']=function(_0x411209,_0x2990e3){return db[_0x1394('0x29')][_0x1394('0x5d')]({'where':{'id':_0x411209[_0x1394('0x42')]['id']}})[_0x1394('0x22')](function(_0x3cecb5){if(!_0x3cecb5)throw new ReferenceError(_0x1394('0x5e'));return _0x3cecb5;})[_0x1394('0x22')](function(_0x3edbac){var _0x1adf76=path[_0x1394('0x4e')](config[_0x1394('0x4f')],'server/files/screen_recordings',_0x3edbac[_0x1394('0x4a')]);logger[_0x1394('0x5f')]('cancellazione\x20fisica\x20documento\x20%s',_0x1adf76);if(!_[_0x1394('0x60')](_0x3edbac[_0x1394('0x4a')])&&fs[_0x1394('0x52')](_0x1adf76)){logger['info'](_0x1394('0x61')+_0x1adf76+_0x1394('0x62'));fs[_0x1394('0x63')](_0x1adf76);}_0x1adf76=_0x1adf76+_0x1394('0x64');if(!_['isNil'](_0x3edbac[_0x1394('0x4a')])&&fs[_0x1394('0x52')](_0x1adf76)){logger[_0x1394('0x5f')](_0x1394('0x61')+_0x1adf76+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x1394('0x63')](_0x1adf76);}return _0x3edbac;})[_0x1394('0x22')](function(_0x343606){if(!_0x343606)throw new InternalError();return _0x343606[_0x1394('0x23')]();})[_0x1394('0x22')](function(){_0x2990e3['status'](0xcc)['end']();})['catch'](handleError(_0x2990e3,null));}; \ No newline at end of file +var _0x3565=['catch','show','keys','intersection','length','find','create','body','duration','createdAt','value','params','describe','download','uniqueid','root','%s.cypher','existsSync','decryptFile','secrets','recording','join','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','send','Not\x20found','Entity\x20not\x20found','server/files/screen_recordings','info','cancellazione\x20fisica\x20documento\x20%s','isNil','.cypher','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','apply','reject','save','update','then','destroy','stack','name','index','ScreenRecording','rawAttributes','fieldName','type','differenceBy','map','format','query','filters','model','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows'];(function(_0x3ba362,_0x217972){var _0x114aa2=function(_0x573869){while(--_0x573869){_0x3ba362['push'](_0x3ba362['shift']());}};_0x114aa2(++_0x217972);}(_0x3565,0x15e));var _0x5356=function(_0x383fb8,_0x3a8644){_0x383fb8=_0x383fb8-0x0;var _0x28cc5e=_0x3565[_0x383fb8];return _0x28cc5e;};'use strict';var pdf=require(_0x5356('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x5356('0x1'));var zipdir=require(_0x5356('0x2'));var jsonpatch=require(_0x5356('0x3'));var rp=require(_0x5356('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5356('0x5'));var util=require('util');var path=require(_0x5356('0x6'));var sox=require(_0x5356('0x7'));var csv=require(_0x5356('0x8'));var ejs=require(_0x5356('0x9'));var fs=require('fs');var _=require(_0x5356('0xa'));var squel=require(_0x5356('0xb'));var crypto=require(_0x5356('0xc'));var jsforce=require(_0x5356('0xd'));var deskjs=require(_0x5356('0xe'));var toCsv=require(_0x5356('0x8'));var querystring=require('querystring');var Papa=require(_0x5356('0xf'));var Redis=require(_0x5356('0x10'));var authService=require(_0x5356('0x11'));var qs=require(_0x5356('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5356('0x13'))(_0x5356('0x14'));var utils=require(_0x5356('0x15'));var config=require(_0x5356('0x16'));var db=require(_0x5356('0x17'))['db'];function respondWithStatusCode(_0x26a56f,_0x34f120){_0x34f120=_0x34f120||0xcc;return function(_0x19a383){if(_0x19a383){return _0x26a56f[_0x5356('0x18')](_0x34f120);}return _0x26a56f[_0x5356('0x19')](_0x34f120)[_0x5356('0x1a')]();};}function respondWithResult(_0x2907e0,_0x2dc923){_0x2dc923=_0x2dc923||0xc8;return function(_0x3bf31d){if(_0x3bf31d){return _0x2907e0[_0x5356('0x19')](_0x2dc923)[_0x5356('0x1b')](_0x3bf31d);}};}function respondWithFilteredResult(_0x36c815,_0x2a82c0){return function(_0x59fddc){if(_0x59fddc){var _0x109a63=_0x59fddc[_0x5356('0x1c')],_0x13c0c1=_0x2a82c0[_0x5356('0x1d')],_0x3d7f47=_0x2a82c0['offset']+_0x2a82c0['limit'],_0x120f1b;if(_0x3d7f47>=_0x109a63){_0x3d7f47=_0x109a63;_0x120f1b=0xc8;}else{_0x120f1b=0xce;}_0x36c815[_0x5356('0x19')](_0x120f1b);return _0x36c815[_0x5356('0x1e')]('Content-Range',_0x13c0c1+'-'+_0x3d7f47+'/'+_0x109a63)[_0x5356('0x1b')](_0x59fddc);}return null;};}function patchUpdates(_0x2536bd){return function(_0xec547d){try{jsonpatch[_0x5356('0x1f')](_0xec547d,_0x2536bd,!![]);}catch(_0x15c935){return BPromise[_0x5356('0x20')](_0x15c935);}return _0xec547d[_0x5356('0x21')]();};}function saveUpdates(_0x33d2bd,_0x44d9b5){return function(_0x87bfb2){if(_0x87bfb2){return _0x87bfb2[_0x5356('0x22')](_0x33d2bd)[_0x5356('0x23')](function(_0x3b7937){return _0x3b7937;});}return null;};}function removeEntity(_0x560d8a,_0x16ec64){return function(_0x32a7d4){if(_0x32a7d4){return _0x32a7d4[_0x5356('0x24')]()['then'](function(){_0x560d8a[_0x5356('0x19')](0xcc)[_0x5356('0x1a')]();});}};}function handleEntityNotFound(_0x526581,_0x3c2d78){return function(_0x83f8bc){if(!_0x83f8bc){_0x526581[_0x5356('0x18')](0x194);}return _0x83f8bc;};}function handleError(_0x27c05b,_0x420416){_0x420416=_0x420416||0x1f4;return function(_0x57fff5){logger['error'](_0x57fff5[_0x5356('0x25')]);if(_0x57fff5[_0x5356('0x26')]){delete _0x57fff5[_0x5356('0x26')];}_0x27c05b[_0x5356('0x19')](_0x420416)['send'](_0x57fff5);};}exports[_0x5356('0x27')]=function(_0x2d66d1,_0xdf797b){var _0x1c5c9e={},_0x5e6ff1={},_0x5f325e={'count':0x0,'rows':[]};var _0x442ace=_['map'](db[_0x5356('0x28')][_0x5356('0x29')],function(_0x5c1d69){return{'name':_0x5c1d69[_0x5356('0x2a')],'type':_0x5c1d69[_0x5356('0x2b')]['key']};});_0x5e6ff1['model']=_[_0x5356('0x2c')](_[_0x5356('0x2d')](_0x442ace,_0x5356('0x26')),[_0x5356('0x2e')]);_0x5e6ff1[_0x5356('0x2f')]=_['keys'](_0x2d66d1['query']);_0x5e6ff1[_0x5356('0x30')]=_['intersection'](_0x5e6ff1[_0x5356('0x31')],_0x5e6ff1['query']);_0x1c5c9e[_0x5356('0x32')]=_['intersection'](_0x5e6ff1[_0x5356('0x31')],qs[_0x5356('0x33')](_0x2d66d1['query'][_0x5356('0x33')]));_0x1c5c9e[_0x5356('0x32')]=_0x1c5c9e[_0x5356('0x32')]['length']?_0x1c5c9e['attributes']:_0x5e6ff1[_0x5356('0x31')];if(!_0x2d66d1['query'][_0x5356('0x34')](_0x5356('0x35'))){_0x1c5c9e[_0x5356('0x36')]=qs[_0x5356('0x36')](_0x2d66d1[_0x5356('0x2f')][_0x5356('0x36')]);_0x1c5c9e['offset']=qs[_0x5356('0x1d')](_0x2d66d1['query'][_0x5356('0x1d')]);}_0x1c5c9e[_0x5356('0x37')]=qs[_0x5356('0x38')](_0x2d66d1[_0x5356('0x2f')][_0x5356('0x38')]);_0x1c5c9e[_0x5356('0x39')]=qs[_0x5356('0x30')](_['pick'](_0x2d66d1['query'],_0x5e6ff1[_0x5356('0x30')]));if(_0x2d66d1[_0x5356('0x2f')]['filter']){_0x1c5c9e[_0x5356('0x39')]=_[_0x5356('0x3a')](_0x1c5c9e[_0x5356('0x39')],{'$or':_[_0x5356('0x2d')](_0x442ace,function(_0x1811f4){if(_0x1811f4[_0x5356('0x2b')]!==_0x5356('0x3b')){var _0x46c875={};_0x46c875[_0x1811f4[_0x5356('0x26')]]={'$like':'%'+_0x2d66d1['query'][_0x5356('0x3c')]+'%'};return _0x46c875;}})});}_0x1c5c9e=_[_0x5356('0x3a')]({},_0x1c5c9e,_0x2d66d1[_0x5356('0x3d')]);var _0x480af9={'where':_0x1c5c9e['where']};return db[_0x5356('0x28')][_0x5356('0x1c')](_0x480af9)['then'](function(_0x527ffb){_0x5f325e[_0x5356('0x1c')]=_0x527ffb;if(_0x2d66d1[_0x5356('0x2f')][_0x5356('0x3e')]){_0x1c5c9e[_0x5356('0x3f')]=[{'all':!![]}];}return db['ScreenRecording'][_0x5356('0x40')](_0x1c5c9e);})[_0x5356('0x23')](function(_0x3848f5){_0x5f325e[_0x5356('0x41')]=_0x3848f5;return _0x5f325e;})[_0x5356('0x23')](respondWithFilteredResult(_0xdf797b,_0x1c5c9e))[_0x5356('0x42')](handleError(_0xdf797b,null));};exports[_0x5356('0x43')]=function(_0x4b6af9,_0x52149b){var _0x5e91c7={'raw':![],'where':{'id':_0x4b6af9['params']['id']}},_0x536b8c={};_0x536b8c[_0x5356('0x31')]=_[_0x5356('0x44')](db[_0x5356('0x28')][_0x5356('0x29')]);_0x536b8c[_0x5356('0x2f')]=_['keys'](_0x4b6af9['query']);_0x536b8c[_0x5356('0x30')]=_[_0x5356('0x45')](_0x536b8c[_0x5356('0x31')],_0x536b8c[_0x5356('0x2f')]);_0x5e91c7[_0x5356('0x32')]=_[_0x5356('0x45')](_0x536b8c['model'],qs[_0x5356('0x33')](_0x4b6af9[_0x5356('0x2f')][_0x5356('0x33')]));_0x5e91c7[_0x5356('0x32')]=_0x5e91c7['attributes'][_0x5356('0x46')]?_0x5e91c7['attributes']:_0x536b8c[_0x5356('0x31')];if(_0x4b6af9[_0x5356('0x2f')][_0x5356('0x3e')]){_0x5e91c7[_0x5356('0x3f')]=[{'all':!![]}];}_0x5e91c7=_[_0x5356('0x3a')]({},_0x5e91c7,_0x4b6af9[_0x5356('0x3d')]);return db[_0x5356('0x28')][_0x5356('0x47')](_0x5e91c7)[_0x5356('0x23')](handleEntityNotFound(_0x52149b,null))[_0x5356('0x23')](respondWithResult(_0x52149b,null))[_0x5356('0x42')](handleError(_0x52149b,null));};exports[_0x5356('0x48')]=function(_0x2d5620,_0x7c5b61){return db['ScreenRecording'][_0x5356('0x48')](_0x2d5620[_0x5356('0x49')],{})[_0x5356('0x23')](respondWithResult(_0x7c5b61,0xc9))[_0x5356('0x42')](handleError(_0x7c5b61,null));};exports[_0x5356('0x22')]=function(_0x4adf0f,_0xd4d0d9){if(_0x4adf0f[_0x5356('0x49')]['id']){delete _0x4adf0f[_0x5356('0x49')]['id'];}delete _0x4adf0f[_0x5356('0x49')][_0x5356('0x4a')];delete _0x4adf0f['body'][_0x5356('0x4b')];delete _0x4adf0f['body']['closedAt'];delete _0x4adf0f[_0x5356('0x49')][_0x5356('0x4c')];return db[_0x5356('0x28')][_0x5356('0x47')]({'where':{'id':_0x4adf0f[_0x5356('0x4d')]['id']}})[_0x5356('0x23')](handleEntityNotFound(_0xd4d0d9,null))['then'](saveUpdates(_0x4adf0f[_0x5356('0x49')],null))['then'](respondWithResult(_0xd4d0d9,null))['catch'](handleError(_0xd4d0d9,null));};exports['describe']=function(_0x3e1c5b,_0x531c59){return db['ScreenRecording'][_0x5356('0x4e')]()['then'](respondWithResult(_0x531c59,null))[_0x5356('0x42')](handleError(_0x531c59,null));};exports[_0x5356('0x4f')]=function(_0x3451b6,_0x591694,_0x57dae6){var _0x5f36e5=require('../../components/encryptor');var _0x11c2ad=![];var _0x2fb31c={};if(_0x3451b6[_0x5356('0x2f')][_0x5356('0x2b')]&&_0x3451b6[_0x5356('0x2f')][_0x5356('0x2b')]===_0x5356('0x50')){_0x2fb31c[_0x5356('0x50')]=_0x3451b6[_0x5356('0x4d')]['id'];}else{_0x2fb31c['id']=_0x3451b6[_0x5356('0x4d')]['id'];}return db[_0x5356('0x28')]['find']({'where':_0x2fb31c,'attributes':['id',_0x5356('0x4c')],'raw':!![]})['then'](handleEntityNotFound(_0x591694,null))[_0x5356('0x23')](function(_0x14b9f2){if(_0x14b9f2){var _0x4572c8=path['join'](config[_0x5356('0x51')],'server/files/screen_recordings',_0x14b9f2[_0x5356('0x4c')]);var _0x1ae133=util[_0x5356('0x2e')](_0x5356('0x52'),_0x4572c8);if(fs[_0x5356('0x53')](_0x1ae133)){_0x11c2ad=!![];return _0x5f36e5[_0x5356('0x54')](_0x1ae133,_0x4572c8,config[_0x5356('0x55')][_0x5356('0x56')])[_0x5356('0x23')](function(){return _0x14b9f2;});}return _0x14b9f2;}})[_0x5356('0x23')](function(_0x296df5){if(_0x296df5){var _0x455ca5=path[_0x5356('0x57')](config[_0x5356('0x51')],'server/files/screen_recordings',_0x296df5[_0x5356('0x4c')]);if(!fs[_0x5356('0x53')](_0x455ca5)){throw new db['Sequelize'][(_0x5356('0x58'))](_0x5356('0x59'));}if(_0x296df5[_0x5356('0x5a')]){return _0x591694[_0x5356('0x4f')](_0x455ca5,_0x296df5[_0x5356('0x5a')]+path[_0x5356('0x5b')](_0x455ca5),function(){if(_0x11c2ad){fs[_0x5356('0x5c')](_0x455ca5);}});}else{return _0x591694[_0x5356('0x4f')](_0x455ca5,function(_0xd5cce){if(_0x11c2ad){fs[_0x5356('0x5c')](_0x455ca5);}});}}})[_0x5356('0x42')](function(_0x1b718){if(_0x1b718['message']===_0x5356('0x59')){_0x591694[_0x5356('0x19')](0x194)[_0x5356('0x5d')](_0x5356('0x5e'));}else{return handleError(_0x591694,null);}});};exports[_0x5356('0x24')]=function(_0x50037b,_0x291f53){return db[_0x5356('0x28')][_0x5356('0x47')]({'where':{'id':_0x50037b['params']['id']}})[_0x5356('0x23')](function(_0x16c7f1){if(!_0x16c7f1)throw new ReferenceError(_0x5356('0x5f'));return _0x16c7f1;})[_0x5356('0x23')](function(_0x4302de){var _0x24f08d=path[_0x5356('0x57')](config[_0x5356('0x51')],_0x5356('0x60'),_0x4302de[_0x5356('0x4c')]);logger[_0x5356('0x61')](_0x5356('0x62'),_0x24f08d);if(!_[_0x5356('0x63')](_0x4302de[_0x5356('0x4c')])&&fs[_0x5356('0x53')](_0x24f08d)){logger[_0x5356('0x61')]('File:\x20\x22'+_0x24f08d+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x24f08d);}_0x24f08d=_0x24f08d+_0x5356('0x64');if(!_[_0x5356('0x63')](_0x4302de['value'])&&fs[_0x5356('0x53')](_0x24f08d)){logger['info'](_0x5356('0x65')+_0x24f08d+_0x5356('0x66'));fs[_0x5356('0x67')](_0x24f08d);}return _0x4302de;})[_0x5356('0x23')](function(_0x57b963){if(!_0x57b963)throw new InternalError();return _0x57b963[_0x5356('0x24')]();})['then'](function(){_0x291f53[_0x5356('0x19')](0xcc)['end']();})[_0x5356('0x42')](handleError(_0x291f53,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 30e8146..da194ae 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 _0x4223=['../../config/logger','api','bluebird','request-promise','path','../../config/environment','./screenRecording.attributes','exports','define','screen_recordings','interactionid','util'];(function(_0x551b0a,_0x41348c){var _0x5dacb8=function(_0x1123cf){while(--_0x1123cf){_0x551b0a['push'](_0x551b0a['shift']());}};_0x5dacb8(++_0x41348c);}(_0x4223,0x173));var _0x3422=function(_0x49e78b,_0x2c2714){_0x49e78b=_0x49e78b-0x0;var _0x249257=_0x4223[_0x49e78b];return _0x249257;};'use strict';var _=require('lodash');var util=require(_0x3422('0x0'));var logger=require(_0x3422('0x1'))(_0x3422('0x2'));var moment=require('moment');var BPromise=require(_0x3422('0x3'));var rp=require(_0x3422('0x4'));var fs=require('fs');var path=require(_0x3422('0x5'));var rimraf=require('rimraf');var config=require(_0x3422('0x6'));var attributes=require(_0x3422('0x7'));module[_0x3422('0x8')]=function(_0x1360b1,_0x5799e3){return _0x1360b1[_0x3422('0x9')]('ScreenRecording',attributes,{'tableName':_0x3422('0xa'),'paranoid':![],'indexes':[{'name':_0x3422('0xb'),'fields':[_0x3422('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7338=['../../config/environment','./screenRecording.attributes','exports','define','ScreenRecording','screen_recordings','interactionid','lodash','../../config/logger','moment','rimraf'];(function(_0xb19577,_0x18f438){var _0x3b2ab0=function(_0x1dbc1f){while(--_0x1dbc1f){_0xb19577['push'](_0xb19577['shift']());}};_0x3b2ab0(++_0x18f438);}(_0x7338,0x172));var _0x8733=function(_0x411017,_0x4a8117){_0x411017=_0x411017-0x0;var _0x2adeea=_0x7338[_0x411017];return _0x2adeea;};'use strict';var _=require(_0x8733('0x0'));var util=require('util');var logger=require(_0x8733('0x1'))('api');var moment=require(_0x8733('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8733('0x3'));var config=require(_0x8733('0x4'));var attributes=require(_0x8733('0x5'));module[_0x8733('0x6')]=function(_0x343729,_0x335afb){return _0x343729[_0x8733('0x7')](_0x8733('0x8'),attributes,{'tableName':_0x8733('0x9'),'paranoid':![],'indexes':[{'name':_0x8733('0xa'),'fields':[_0x8733('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 1a13164..15dbe62 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(_0x1872ef,_0x5c24d9){var _0x30213d=function(_0x5a098a){while(--_0x5a098a){_0x1872ef['push'](_0x1872ef['shift']());}};_0x30213d(++_0x5c24d9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'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(_0x5a89c0,_0x3ec06f){var _0x394794=function(_0x5de9fe){while(--_0x5de9fe){_0x5a89c0['push'](_0x5a89c0['shift']());}};_0x394794(++_0x3ec06f);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index b0e1251..cb49cbf 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 _0xd5e0=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','show','/:id/logo','/:id/logo_login','getLogoLogin','/:id/preferred','getPreferred','getFavicon','diskStorage','join','root','format','%s%s','logo','extname','originalname','post','single','server/files/images/logos/','addLogoLogin','preferred','addPreferred','favicon','/:id/favicon','file','addFavicon','/:id','update','exports','path'];(function(_0x3f9340,_0x447b72){var _0x6333ca=function(_0x5aeba2){while(--_0x5aeba2){_0x3f9340['push'](_0x3f9340['shift']());}};_0x6333ca(++_0x447b72);}(_0xd5e0,0xb3));var _0x0d5e=function(_0x377fc7,_0x159b9a){_0x377fc7=_0x377fc7-0x0;var _0x44d3e0=_0xd5e0[_0x377fc7];return _0x44d3e0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0d5e('0x0'));var timeout=require(_0x0d5e('0x1'));var express=require('express');var router=express[_0x0d5e('0x2')]();var auth=require(_0x0d5e('0x3'));var interaction=require(_0x0d5e('0x4'));var config=require(_0x0d5e('0x5'));var controller=require(_0x0d5e('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x0d5e('0x7')]('/:id',controller[_0x0d5e('0x8')]);router[_0x0d5e('0x7')](_0x0d5e('0x9'),controller['getLogo']);router[_0x0d5e('0x7')](_0x0d5e('0xa'),controller[_0x0d5e('0xb')]);router[_0x0d5e('0x7')]('/:id/gdpr',controller['gdpr']);router[_0x0d5e('0x7')](_0x0d5e('0xc'),controller[_0x0d5e('0xd')]);router[_0x0d5e('0x7')]('/:id/favicon',controller[_0x0d5e('0xe')]);var upload=multer({'storage':multer[_0x0d5e('0xf')]({'destination':function(_0x4b02af,_0x9c5277,_0x2047e0){_0x2047e0(null,path[_0x0d5e('0x10')](config[_0x0d5e('0x11')],'server/files/images/logos/'));},'filename':function(_0x463e59,_0x4acd4e,_0x29708c){_0x29708c(null,util[_0x0d5e('0x12')](_0x0d5e('0x13'),_0x0d5e('0x14'),path[_0x0d5e('0x15')](_0x4acd4e[_0x0d5e('0x16')])));}})});router[_0x0d5e('0x17')](_0x0d5e('0x9'),upload[_0x0d5e('0x18')]('file'),controller['addLogo']);var upload=multer({'storage':multer[_0x0d5e('0xf')]({'destination':function(_0x44ddb0,_0xaa4d2a,_0x466a10){_0x466a10(null,path['join'](config[_0x0d5e('0x11')],_0x0d5e('0x19')));},'filename':function(_0x34d642,_0x180ba2,_0x411580){_0x411580(null,util[_0x0d5e('0x12')](_0x0d5e('0x13'),'logologin',path['extname'](_0x180ba2[_0x0d5e('0x16')])));}})});router['post'](_0x0d5e('0xa'),upload['single']('file'),controller[_0x0d5e('0x1a')]);var upload=multer({'storage':multer[_0x0d5e('0xf')]({'destination':function(_0x583d75,_0x3843aa,_0x14eb85){_0x14eb85(null,path[_0x0d5e('0x10')](config[_0x0d5e('0x11')],_0x0d5e('0x19')));},'filename':function(_0x2660a7,_0x2b8d8b,_0x14b863){_0x14b863(null,util[_0x0d5e('0x12')]('%s%s',_0x0d5e('0x1b'),path[_0x0d5e('0x15')](_0x2b8d8b[_0x0d5e('0x16')])));}})});router[_0x0d5e('0x17')]('/:id/preferred',upload[_0x0d5e('0x18')]('file'),controller[_0x0d5e('0x1c')]);var upload=multer({'storage':multer[_0x0d5e('0xf')]({'destination':function(_0x373d76,_0x21d0bc,_0x2b4a3a){_0x2b4a3a(null,path[_0x0d5e('0x10')](config[_0x0d5e('0x11')],'server/files/images/logos/'));},'filename':function(_0x385b2f,_0x4c6806,_0x79e623){_0x79e623(null,util[_0x0d5e('0x12')](_0x0d5e('0x13'),_0x0d5e('0x1d'),path[_0x0d5e('0x15')](_0x4c6806[_0x0d5e('0x16')])));}})});router[_0x0d5e('0x17')](_0x0d5e('0x1e'),upload[_0x0d5e('0x18')](_0x0d5e('0x1f')),controller[_0x0d5e('0x20')]);router['put'](_0x0d5e('0x21'),auth['isAuthenticated'](),controller[_0x0d5e('0x22')]);module[_0x0d5e('0x23')]=router; \ No newline at end of file +var _0x503a=['../../config/environment','get','isAuthenticated','/:id','/:id/logo_login','getLogoLogin','/:id/gdpr','getPreferred','/:id/favicon','diskStorage','root','server/files/images/logos/','format','logo','originalname','post','single','file','addLogo','join','%s%s','extname','addLogoLogin','preferred','addPreferred','favicon','put','update','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x517047,_0x287852){var _0x3b7298=function(_0x14063d){while(--_0x14063d){_0x517047['push'](_0x517047['shift']());}};_0x3b7298(++_0x287852);}(_0x503a,0xf5));var _0xa503=function(_0x402c8f,_0x30cc1d){_0x402c8f=_0x402c8f-0x0;var _0x11e809=_0x503a[_0x402c8f];return _0x11e809;};'use strict';var multer=require(_0xa503('0x0'));var util=require(_0xa503('0x1'));var path=require(_0xa503('0x2'));var timeout=require('connect-timeout');var express=require(_0xa503('0x3'));var router=express[_0xa503('0x4')]();var auth=require(_0xa503('0x5'));var interaction=require(_0xa503('0x6'));var config=require(_0xa503('0x7'));var controller=require('./setting.controller');router[_0xa503('0x8')]('/',auth[_0xa503('0x9')](),controller['index']);router[_0xa503('0x8')](_0xa503('0xa'),controller['show']);router['get']('/:id/logo',controller['getLogo']);router[_0xa503('0x8')](_0xa503('0xb'),controller[_0xa503('0xc')]);router['get'](_0xa503('0xd'),controller['gdpr']);router[_0xa503('0x8')]('/:id/preferred',controller[_0xa503('0xe')]);router[_0xa503('0x8')](_0xa503('0xf'),controller['getFavicon']);var upload=multer({'storage':multer[_0xa503('0x10')]({'destination':function(_0xe3bcbb,_0x811fb2,_0x5b9d67){_0x5b9d67(null,path['join'](config[_0xa503('0x11')],_0xa503('0x12')));},'filename':function(_0x180344,_0x479bfc,_0x2a3bbb){_0x2a3bbb(null,util[_0xa503('0x13')]('%s%s',_0xa503('0x14'),path['extname'](_0x479bfc[_0xa503('0x15')])));}})});router[_0xa503('0x16')]('/:id/logo',upload[_0xa503('0x17')](_0xa503('0x18')),controller[_0xa503('0x19')]);var upload=multer({'storage':multer[_0xa503('0x10')]({'destination':function(_0x86216b,_0x56e358,_0x1de757){_0x1de757(null,path[_0xa503('0x1a')](config['root'],_0xa503('0x12')));},'filename':function(_0x14999e,_0x5ec349,_0x505807){_0x505807(null,util[_0xa503('0x13')](_0xa503('0x1b'),'logologin',path[_0xa503('0x1c')](_0x5ec349['originalname'])));}})});router[_0xa503('0x16')]('/:id/logo_login',upload[_0xa503('0x17')](_0xa503('0x18')),controller[_0xa503('0x1d')]);var upload=multer({'storage':multer[_0xa503('0x10')]({'destination':function(_0x44cba0,_0x2e864d,_0x4e2d29){_0x4e2d29(null,path[_0xa503('0x1a')](config[_0xa503('0x11')],_0xa503('0x12')));},'filename':function(_0x1a2b00,_0x39b436,_0x1aacb2){_0x1aacb2(null,util[_0xa503('0x13')]('%s%s',_0xa503('0x1e'),path['extname'](_0x39b436[_0xa503('0x15')])));}})});router[_0xa503('0x16')]('/:id/preferred',upload[_0xa503('0x17')](_0xa503('0x18')),controller[_0xa503('0x1f')]);var upload=multer({'storage':multer[_0xa503('0x10')]({'destination':function(_0xc753a6,_0xdee96a,_0x502e86){_0x502e86(null,path[_0xa503('0x1a')](config[_0xa503('0x11')],'server/files/images/logos/'));},'filename':function(_0x277193,_0x2b0ad6,_0x426cde){_0x426cde(null,util['format']('%s%s',_0xa503('0x20'),path[_0xa503('0x1c')](_0x2b0ad6['originalname'])));}})});router[_0xa503('0x16')]('/:id/favicon',upload[_0xa503('0x17')](_0xa503('0x18')),controller['addFavicon']);router[_0xa503('0x21')](_0xa503('0xa'),auth[_0xa503('0x9')](),controller[_0xa503('0x22')]);module[_0xa503('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 2a137c0..942b347 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 _0xcf4a=['exports','INTEGER','min_internal','min_mailbox','STRING','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','sequelize'];(function(_0x287795,_0x37bc44){var _0x594dde=function(_0xa48627){while(--_0xa48627){_0x287795['push'](_0x287795['shift']());}};_0x594dde(++_0x37bc44);}(_0xcf4a,0x14c));var _0xacf4=function(_0x543c2d,_0x1eb3f7){_0x543c2d=_0x543c2d-0x0;var _0x3cac8a=_0xcf4a[_0x543c2d];return _0x3cac8a;};'use strict';var Sequelize=require(_0xacf4('0x0'));module[_0xacf4('0x1')]={'min_internal':{'type':Sequelize[_0xacf4('0x2')](0xb),'unique':_0xacf4('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0xacf4('0x2')](0xb),'unique':_0xacf4('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0xacf4('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0xacf4('0x5')],'defaultValue':'/var/opt/motion2/server/files/sounds/converted'},'logo':{'type':Sequelize[_0xacf4('0x5')]},'defaultLogo':{'type':Sequelize[_0xacf4('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize['STRING']},'defaultLoginLogo':{'type':Sequelize[_0xacf4('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize['STRING']},'defaultHeaderWhiteLabel':{'type':Sequelize[_0xacf4('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0xacf4('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0xacf4('0x5')]},'turnusername':{'type':Sequelize[_0xacf4('0x5')]},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0xacf4('0x5')]},'defaultPageTitle':{'type':Sequelize[_0xacf4('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0xacf4('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0xacf4('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':_0xacf4('0x7')},'enableEmailPreview':{'type':Sequelize[_0xacf4('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0xacf4('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0xacf4('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0xacf4('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0xacf4('0x8')},'chatTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0xacf4('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0xacf4('0x5')]},'defaultPreferred':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0xacf4('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0xacf4('0x5')]},'allowedLoginAttempts':{'type':Sequelize[_0xacf4('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0xacf4('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0xacf4('0x5')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize['INTEGER'],'defaultValue':0xa,'validate':{'min':0xa}},'googleSsoEnabled':{'type':Sequelize[_0xacf4('0x6')],'defaultValue':![]}}; \ No newline at end of file +var _0x7651=['STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','sequelize','exports','INTEGER','min_internal','min_mailbox'];(function(_0x4dce5c,_0x3b7a0a){var _0x20eece=function(_0x5ed43d){while(--_0x5ed43d){_0x4dce5c['push'](_0x4dce5c['shift']());}};_0x20eece(++_0x3b7a0a);}(_0x7651,0xaf));var _0x1765=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7651[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x1765('0x0'));module[_0x1765('0x1')]={'min_internal':{'type':Sequelize[_0x1765('0x2')](0xb),'unique':_0x1765('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x1765('0x2')](0xb),'unique':_0x1765('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x1765('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x1765('0x5')],'defaultValue':_0x1765('0x6')},'logo':{'type':Sequelize[_0x1765('0x5')]},'defaultLogo':{'type':Sequelize[_0x1765('0x7')],'defaultValue':!![]},'loginLogo':{'type':Sequelize['STRING']},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize['STRING']},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x1765('0x7')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x1765('0x7')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x1765('0x5')]},'turnaddr':{'type':Sequelize['STRING']},'turnusername':{'type':Sequelize[_0x1765('0x5')]},'turnpassword':{'type':Sequelize[_0x1765('0x5')]},'pageTitle':{'type':Sequelize[_0x1765('0x5')]},'defaultPageTitle':{'type':Sequelize[_0x1765('0x7')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x1765('0x7')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x1765('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x1765('0x5')],'defaultValue':_0x1765('0x8')},'enableEmailPreview':{'type':Sequelize[_0x1765('0x7')],'defaultValue':![]},'split':{'type':Sequelize[_0x1765('0x7')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x1765('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x1765('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x1765('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x1765('0x5')],'defaultValue':_0x1765('0x9')},'chatTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x1765('0x7')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x1765('0x7')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x1765('0x7')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x1765('0x5')]},'allowedLoginAttempts':{'type':Sequelize[_0x1765('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x1765('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x1765('0x5')]},'defaultFavicon':{'type':Sequelize[_0x1765('0x7')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x1765('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'googleSsoEnabled':{'type':Sequelize[_0x1765('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 b62daf3..858ca17 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 _0x48ac=['path','sox','ejs','squel','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../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~!@#$%^&-_=+[{]}.','Setting,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','sendStatus','status','offset','limit','json','reject','update','then','end','name','index','map','Setting','fieldName','type','query','filters','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','count','includeAll','include','rows','show','params','keys','intersection','options','find','body','addLogo','file','filename','logo','addLogoLogin','../../config/license/util','getLogo','server/files/images/logos','getLicense','loginLogo','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','default_logo.png','upperFirst','\x20not\x20found','getLogoLogin','default_loginLogo.png','default','gdpr','securePassword','getPreferred','default_preferred.png','custom','download','default_favicon.ico','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util'];(function(_0x565a40,_0x417e53){var _0x4e1e62=function(_0x1bc2d1){while(--_0x1bc2d1){_0x565a40['push'](_0x565a40['shift']());}};_0x4e1e62(++_0x417e53);}(_0x48ac,0x1ad));var _0xc48a=function(_0x487b25,_0xeb4dda){_0x487b25=_0x487b25-0x0;var _0x2a4fc7=_0x48ac[_0x487b25];return _0x2a4fc7;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xc48a('0x0'));var zipdir=require(_0xc48a('0x1'));var jsonpatch=require(_0xc48a('0x2'));var rp=require('request-promise');var moment=require(_0xc48a('0x3'));var BPromise=require(_0xc48a('0x4'));var Mustache=require(_0xc48a('0x5'));var util=require(_0xc48a('0x6'));var path=require(_0xc48a('0x7'));var sox=require(_0xc48a('0x8'));var csv=require('to-csv');var ejs=require(_0xc48a('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xc48a('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc48a('0xb'));var querystring=require(_0xc48a('0xc'));var Papa=require(_0xc48a('0xd'));var Redis=require(_0xc48a('0xe'));var authService=require(_0xc48a('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xc48a('0x10'));var hardwareService=require(_0xc48a('0x11'));var logger=require(_0xc48a('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xc48a('0x13'));var db=require(_0xc48a('0x14'))['db'];var jayson=require(_0xc48a('0x15'));var client=jayson[_0xc48a('0x16')][_0xc48a('0x17')]({'port':0x232a});function checkPasswordPattern(_0x1d66d7,_0x6ad547,_0x1c3cd0){if(_0x1c3cd0){var _0x16ff04=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x16ff04['test'](_0x6ad547)){return _0x1d66d7;}else{throw new db[(_0xc48a('0x18'))][(_0xc48a('0x19'))](_0xc48a('0x1a'));}}else{return _0x1d66d7;}}function respondWithRpcPromise(_0x1c4448,_0x3591df,_0xeccc86,_0x2fe9ba){return new BPromise(function(_0x4e406a,_0x4e5bc9){var _0x437307=_0x2fe9ba||client;return _0x437307['request'](_0x1c4448,_0xeccc86)['then'](function(_0x1bcdf2){logger['info'](_0xc48a('0x1b'),_0x3591df,_0xc48a('0x1c'));logger[_0xc48a('0x1d')]('Setting,\x20%s,\x20%s,\x20%s',_0x3591df,_0xc48a('0x1c'),JSON[_0xc48a('0x1e')](_0x1bcdf2));if(_0x1bcdf2[_0xc48a('0x1f')]){if(_0x1bcdf2[_0xc48a('0x1f')]['code']===0x1f4){logger[_0xc48a('0x1f')](_0xc48a('0x1b'),_0x3591df,_0x1bcdf2[_0xc48a('0x1f')][_0xc48a('0x20')]);return _0x4e5bc9(_0x1bcdf2[_0xc48a('0x1f')][_0xc48a('0x20')]);}logger[_0xc48a('0x1f')](_0xc48a('0x1b'),_0x3591df,_0x1bcdf2['error'][_0xc48a('0x20')]);return _0x4e406a(_0x1bcdf2[_0xc48a('0x1f')][_0xc48a('0x20')]);}else{logger[_0xc48a('0x21')](_0xc48a('0x1b'),_0x3591df,_0xc48a('0x1c'));_0x4e406a(_0x1bcdf2[_0xc48a('0x22')][_0xc48a('0x20')]);}})[_0xc48a('0x23')](function(_0x15d0a1){logger[_0xc48a('0x1f')](_0xc48a('0x1b'),_0x3591df,_0x15d0a1);_0x4e5bc9(_0x15d0a1);});});}function respondWithStatusCode(_0x189210,_0x3122f8){_0x3122f8=_0x3122f8||0xcc;return function(_0x18161e){if(_0x18161e){return _0x189210[_0xc48a('0x24')](_0x3122f8);}return _0x189210[_0xc48a('0x25')](_0x3122f8)['end']();};}function respondWithResult(_0x306827,_0x14d300){_0x14d300=_0x14d300||0xc8;return function(_0x1fcf39){if(_0x1fcf39){return _0x306827[_0xc48a('0x25')](_0x14d300)['json'](_0x1fcf39);}};}function respondWithFilteredResult(_0x4ad138,_0x387773){return function(_0x516c85){if(_0x516c85){var _0x1752c9=_0x516c85['count'],_0x1e8929=_0x387773['offset'],_0x3566fd=_0x387773[_0xc48a('0x26')]+_0x387773[_0xc48a('0x27')],_0x121b6a;if(_0x3566fd>=_0x1752c9){_0x3566fd=_0x1752c9;_0x121b6a=0xc8;}else{_0x121b6a=0xce;}_0x4ad138[_0xc48a('0x25')](_0x121b6a);return _0x4ad138['set']('Content-Range',_0x1e8929+'-'+_0x3566fd+'/'+_0x1752c9)[_0xc48a('0x28')](_0x516c85);}return null;};}function patchUpdates(_0x2d50b3){return function(_0x4dfa6b){try{jsonpatch['apply'](_0x4dfa6b,_0x2d50b3,!![]);}catch(_0x54e6ee){return BPromise[_0xc48a('0x29')](_0x54e6ee);}return _0x4dfa6b['save']();};}function saveUpdates(_0x381862,_0x27cc0d){return function(_0xbfdc72){if(_0xbfdc72){return _0xbfdc72[_0xc48a('0x2a')](_0x381862)[_0xc48a('0x2b')](function(_0x26308a){return _0x26308a;});}return null;};}function removeEntity(_0x68acc3,_0x266b46){return function(_0x4f62cb){if(_0x4f62cb){return _0x4f62cb['destroy']()[_0xc48a('0x2b')](function(){_0x68acc3[_0xc48a('0x25')](0xcc)[_0xc48a('0x2c')]();});}};}function handleEntityNotFound(_0x24bf59,_0x193175){return function(_0x334df2){if(!_0x334df2){_0x24bf59[_0xc48a('0x24')](0x194);}return _0x334df2;};}function handleError(_0xf620c8,_0x511b17){_0x511b17=_0x511b17||0x1f4;return function(_0x30a269){logger['error'](_0x30a269['stack']);if(_0x30a269[_0xc48a('0x2d')]){delete _0x30a269['name'];}_0xf620c8[_0xc48a('0x25')](_0x511b17)['send'](_0x30a269);};}exports[_0xc48a('0x2e')]=function(_0x24bd0d,_0x41623b){var _0x4554a6={},_0x20df2b={},_0x58e2ff={'count':0x0,'rows':[]};var _0x11fd2c=_[_0xc48a('0x2f')](db[_0xc48a('0x30')]['rawAttributes'],function(_0x50b9e0){return{'name':_0x50b9e0[_0xc48a('0x31')],'type':_0x50b9e0[_0xc48a('0x32')]['key']};});_0x20df2b['model']=_['map'](_0x11fd2c,_0xc48a('0x2d'));_0x20df2b[_0xc48a('0x33')]=_['keys'](_0x24bd0d[_0xc48a('0x33')]);_0x20df2b[_0xc48a('0x34')]=_['intersection'](_0x20df2b[_0xc48a('0x35')],_0x20df2b['query']);_0x4554a6['attributes']=_['intersection'](_0x20df2b['model'],qs['fields'](_0x24bd0d['query'][_0xc48a('0x36')]));_0x4554a6[_0xc48a('0x37')]=_0x4554a6[_0xc48a('0x37')][_0xc48a('0x38')]?_0x4554a6[_0xc48a('0x37')]:_0x20df2b['model'];if(!_0x24bd0d[_0xc48a('0x33')][_0xc48a('0x39')](_0xc48a('0x3a'))){_0x4554a6[_0xc48a('0x27')]=qs[_0xc48a('0x27')](_0x24bd0d[_0xc48a('0x33')]['limit']);_0x4554a6[_0xc48a('0x26')]=qs[_0xc48a('0x26')](_0x24bd0d['query'][_0xc48a('0x26')]);}_0x4554a6[_0xc48a('0x3b')]=qs[_0xc48a('0x3c')](_0x24bd0d[_0xc48a('0x33')][_0xc48a('0x3c')]);_0x4554a6[_0xc48a('0x3d')]=qs[_0xc48a('0x34')](_[_0xc48a('0x3e')](_0x24bd0d[_0xc48a('0x33')],_0x20df2b[_0xc48a('0x34')]));if(_0x24bd0d[_0xc48a('0x33')]['filter']){_0x4554a6[_0xc48a('0x3d')]=_[_0xc48a('0x3f')](_0x4554a6[_0xc48a('0x3d')],{'$or':_[_0xc48a('0x2f')](_0x11fd2c,function(_0x46ebed){if(_0x46ebed[_0xc48a('0x32')]!=='VIRTUAL'){var _0xebd9de={};_0xebd9de[_0x46ebed[_0xc48a('0x2d')]]={'$like':'%'+_0x24bd0d[_0xc48a('0x33')][_0xc48a('0x40')]+'%'};return _0xebd9de;}})});}_0x4554a6=_[_0xc48a('0x3f')]({},_0x4554a6,_0x24bd0d['options']);var _0xaea4e5={'where':_0x4554a6['where']};return db[_0xc48a('0x30')][_0xc48a('0x41')](_0xaea4e5)[_0xc48a('0x2b')](function(_0x11ec5d){_0x58e2ff[_0xc48a('0x41')]=_0x11ec5d;if(_0x24bd0d[_0xc48a('0x33')][_0xc48a('0x42')]){_0x4554a6[_0xc48a('0x43')]=[{'all':!![]}];}return db[_0xc48a('0x30')]['findAll'](_0x4554a6);})[_0xc48a('0x2b')](function(_0x14d90a){_0x58e2ff[_0xc48a('0x44')]=_0x14d90a;return _0x58e2ff;})[_0xc48a('0x2b')](respondWithFilteredResult(_0x41623b,_0x4554a6))['catch'](handleError(_0x41623b,null));};exports[_0xc48a('0x45')]=function(_0x240655,_0x3dc013){var _0x34163b={'raw':![],'where':{'id':_0x240655[_0xc48a('0x46')]['id']}},_0x1a8b8e={};_0x1a8b8e[_0xc48a('0x35')]=_[_0xc48a('0x47')](db[_0xc48a('0x30')]['rawAttributes']);_0x1a8b8e[_0xc48a('0x33')]=_[_0xc48a('0x47')](_0x240655[_0xc48a('0x33')]);_0x1a8b8e[_0xc48a('0x34')]=_[_0xc48a('0x48')](_0x1a8b8e[_0xc48a('0x35')],_0x1a8b8e[_0xc48a('0x33')]);_0x34163b[_0xc48a('0x37')]=_[_0xc48a('0x48')](_0x1a8b8e[_0xc48a('0x35')],qs['fields'](_0x240655['query'][_0xc48a('0x36')]));_0x34163b[_0xc48a('0x37')]=_0x34163b[_0xc48a('0x37')][_0xc48a('0x38')]?_0x34163b['attributes']:_0x1a8b8e['model'];if(_0x240655[_0xc48a('0x33')][_0xc48a('0x42')]){_0x34163b['include']=[{'all':!![]}];}_0x34163b=_[_0xc48a('0x3f')]({},_0x34163b,_0x240655[_0xc48a('0x49')]);return db['Setting'][_0xc48a('0x4a')](_0x34163b)[_0xc48a('0x2b')](handleEntityNotFound(_0x3dc013,null))[_0xc48a('0x2b')](respondWithResult(_0x3dc013,null))[_0xc48a('0x23')](handleError(_0x3dc013,null));};exports[_0xc48a('0x2a')]=function(_0x1711e8,_0x5e4612){if(_0x1711e8[_0xc48a('0x4b')]['id']){delete _0x1711e8[_0xc48a('0x4b')]['id'];}return db[_0xc48a('0x30')]['find']({'where':{'id':_0x1711e8['params']['id']}})[_0xc48a('0x2b')](handleEntityNotFound(_0x5e4612,null))[_0xc48a('0x2b')](saveUpdates(_0x1711e8[_0xc48a('0x4b')],null))[_0xc48a('0x2b')](respondWithResult(_0x5e4612,null))[_0xc48a('0x23')](handleError(_0x5e4612,null));};exports[_0xc48a('0x4c')]=function(_0xbfd3e4,_0x5142ce,_0x5f0f55){if(_0xbfd3e4[_0xc48a('0x4d')]&&_0xbfd3e4[_0xc48a('0x4d')][_0xc48a('0x4e')]){_0xbfd3e4['body'][_0xc48a('0x4f')]=_0xbfd3e4[_0xc48a('0x4d')][_0xc48a('0x4e')];}return db[_0xc48a('0x30')][_0xc48a('0x4a')]({'where':{'id':_0xbfd3e4[_0xc48a('0x46')]['id']}})[_0xc48a('0x2b')](handleEntityNotFound(_0x5142ce,null))['then'](saveUpdates(_0xbfd3e4[_0xc48a('0x4b')],null))[_0xc48a('0x2b')](respondWithResult(_0x5142ce,null))[_0xc48a('0x23')](handleError(_0x5142ce,null));};exports[_0xc48a('0x50')]=function(_0x2ab213,_0x591e8b,_0x126888){if(_0x2ab213[_0xc48a('0x4d')]&&_0x2ab213[_0xc48a('0x4d')]['filename']){_0x2ab213['body']['loginLogo']=_0x2ab213[_0xc48a('0x4d')][_0xc48a('0x4e')];}return db[_0xc48a('0x30')][_0xc48a('0x4a')]({'where':{'id':_0x2ab213['params']['id']}})[_0xc48a('0x2b')](handleEntityNotFound(_0x591e8b,null))['then'](saveUpdates(_0x2ab213['body'],null))[_0xc48a('0x2b')](respondWithResult(_0x591e8b,null))[_0xc48a('0x23')](handleError(_0x591e8b,null));};var utilLicense=require(_0xc48a('0x51'));exports[_0xc48a('0x52')]=function(_0x7058cf,_0x480625,_0x284e66){var _0x1a3196=_0xc48a('0x53');var _0x4bbe6d={'custom':![]};return utilLicense[_0xc48a('0x54')]()['then'](function(_0x3435e8){if(_0x3435e8){_0x4bbe6d=_0x3435e8;}return db['Setting'][_0xc48a('0x4a')]({'where':{'id':_0x7058cf[_0xc48a('0x46')]['id']},'attributes':['logo',_0xc48a('0x55'),_0xc48a('0x56'),_0xc48a('0x57'),_0xc48a('0x58'),_0xc48a('0x59'),_0xc48a('0x5a'),_0xc48a('0x5b')],'raw':!![]});})[_0xc48a('0x2b')](handleEntityNotFound(_0x480625,null))[_0xc48a('0x2b')](function(_0x5d1903){if(_0x5d1903){var _0x4e1552=_0x5d1903[_0xc48a('0x4f')]&&fs[_0xc48a('0x5c')](path[_0xc48a('0x5d')](config[_0xc48a('0x5e')],_0x1a3196,_[_0xc48a('0x5f')](_0x5d1903[_0xc48a('0x4f')])))?path[_0xc48a('0x5d')](config[_0xc48a('0x5e')],_0x1a3196,_[_0xc48a('0x5f')](_0x5d1903[_0xc48a('0x4f')])):path[_0xc48a('0x5d')](config[_0xc48a('0x5e')],_0x1a3196,_[_0xc48a('0x5f')](_0xc48a('0x60')));var _0x5687ea='default'+_[_0xc48a('0x61')](_0xc48a('0x4f'));if(_0x5d1903[_0x5687ea]||!_0x4bbe6d['custom']){_0x4e1552=path[_0xc48a('0x5d')](config[_0xc48a('0x5e')],_0x1a3196,_[_0xc48a('0x5f')](_0xc48a('0x60')));}if(!fs['existsSync'](_0x4e1552)){throw new db[(_0xc48a('0x18'))][(_0xc48a('0x19'))](_[_0xc48a('0x61')]('logo')+_0xc48a('0x62'));}return _0x480625['download'](_0x4e1552);}})[_0xc48a('0x23')](handleError(_0x480625,null));};var utilLicense=require(_0xc48a('0x51'));exports[_0xc48a('0x63')]=function(_0x340578,_0x2c6651,_0x2cca8f){var _0x43e3f5=_0xc48a('0x53');var _0x5940fd={'custom':![]};return utilLicense[_0xc48a('0x54')]()[_0xc48a('0x2b')](function(_0x1b73be){if(_0x1b73be){_0x5940fd=_0x1b73be;}return db[_0xc48a('0x30')]['find']({'where':{'id':_0x340578[_0xc48a('0x46')]['id']},'attributes':[_0xc48a('0x4f'),_0xc48a('0x55'),_0xc48a('0x56'),_0xc48a('0x57'),'defaultLogo',_0xc48a('0x59'),_0xc48a('0x5a'),_0xc48a('0x5b')],'raw':!![]});})[_0xc48a('0x2b')](handleEntityNotFound(_0x2c6651,null))['then'](function(_0x1397b4){if(_0x1397b4){var _0x4423e0=_0x1397b4[_0xc48a('0x55')]&&fs[_0xc48a('0x5c')](path['join'](config[_0xc48a('0x5e')],_0x43e3f5,_['toLower'](_0x1397b4['loginLogo'])))?path[_0xc48a('0x5d')](config[_0xc48a('0x5e')],_0x43e3f5,_['toLower'](_0x1397b4[_0xc48a('0x55')])):path[_0xc48a('0x5d')](config[_0xc48a('0x5e')],_0x43e3f5,_[_0xc48a('0x5f')](_0xc48a('0x64')));var _0x5ade3d=_0xc48a('0x65')+_[_0xc48a('0x61')](_0xc48a('0x55'));if(_0x1397b4[_0x5ade3d]||!_0x5940fd['custom']){_0x4423e0=path[_0xc48a('0x5d')](config[_0xc48a('0x5e')],_0x43e3f5,_['toLower'](_0xc48a('0x64')));}if(!fs[_0xc48a('0x5c')](_0x4423e0)){throw new db[(_0xc48a('0x18'))]['ValidationError'](_['upperFirst'](_0xc48a('0x55'))+_0xc48a('0x62'));}return _0x2c6651['download'](_0x4423e0);}})['catch'](handleError(_0x2c6651,null));};exports[_0xc48a('0x66')]=function(_0x7a9765,_0x36af88){return db[_0xc48a('0x30')]['find']({'where':{'id':_0x7a9765['params']['id']},'attributes':[_0xc48a('0x67')]})[_0xc48a('0x2b')](respondWithResult(_0x36af88,null))[_0xc48a('0x23')](handleError(_0x36af88,null));};exports['addPreferred']=function(_0x3d78ac,_0x46fc84,_0x454863){if(_0x3d78ac[_0xc48a('0x4d')]&&_0x3d78ac[_0xc48a('0x4d')][_0xc48a('0x4e')]){_0x3d78ac[_0xc48a('0x4b')][_0xc48a('0x56')]=_0x3d78ac[_0xc48a('0x4d')][_0xc48a('0x4e')];}return db[_0xc48a('0x30')]['find']({'where':{'id':_0x3d78ac[_0xc48a('0x46')]['id']}})[_0xc48a('0x2b')](handleEntityNotFound(_0x46fc84,null))['then'](saveUpdates(_0x3d78ac[_0xc48a('0x4b')],null))['then'](respondWithResult(_0x46fc84,null))[_0xc48a('0x23')](handleError(_0x46fc84,null));};var utilLicense=require(_0xc48a('0x51'));exports[_0xc48a('0x68')]=function(_0x65cc42,_0x2159af,_0x1ae738){var _0x182e1a=_0xc48a('0x53');var _0x244fdf={'custom':![]};return utilLicense[_0xc48a('0x54')]()['then'](function(_0x553049){if(_0x553049){_0x244fdf=_0x553049;}return db['Setting'][_0xc48a('0x4a')]({'where':{'id':_0x65cc42[_0xc48a('0x46')]['id']},'attributes':['logo',_0xc48a('0x55'),'preferred',_0xc48a('0x57'),_0xc48a('0x58'),_0xc48a('0x59'),_0xc48a('0x5a'),'defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x2159af,null))[_0xc48a('0x2b')](function(_0x389636){if(_0x389636){var _0x34e395=_0x389636[_0xc48a('0x56')]&&fs[_0xc48a('0x5c')](path[_0xc48a('0x5d')](config[_0xc48a('0x5e')],_0x182e1a,_['toLower'](_0x389636['preferred'])))?path[_0xc48a('0x5d')](config[_0xc48a('0x5e')],_0x182e1a,_[_0xc48a('0x5f')](_0x389636['preferred'])):path['join'](config[_0xc48a('0x5e')],_0x182e1a,_[_0xc48a('0x5f')](_0xc48a('0x69')));var _0x212021='default'+_[_0xc48a('0x61')](_0xc48a('0x56'));if(_0x389636[_0x212021]||!_0x244fdf[_0xc48a('0x6a')]||!_0x244fdf['preferred']){_0x34e395=path[_0xc48a('0x5d')](config[_0xc48a('0x5e')],_0x182e1a,_[_0xc48a('0x5f')](_0xc48a('0x69')));}if(!fs[_0xc48a('0x5c')](_0x34e395)){throw new db[(_0xc48a('0x18'))][(_0xc48a('0x19'))](_[_0xc48a('0x61')](_0xc48a('0x56'))+_0xc48a('0x62'));}return _0x2159af[_0xc48a('0x6b')](_0x34e395);}})[_0xc48a('0x23')](handleError(_0x2159af,null));};exports['addFavicon']=function(_0x43b6e1,_0x3afefd,_0x39595b){if(_0x43b6e1['file']&&_0x43b6e1[_0xc48a('0x4d')][_0xc48a('0x4e')]){_0x43b6e1[_0xc48a('0x4b')][_0xc48a('0x57')]=_0x43b6e1['file'][_0xc48a('0x4e')];}return db[_0xc48a('0x30')][_0xc48a('0x4a')]({'where':{'id':_0x43b6e1[_0xc48a('0x46')]['id']}})[_0xc48a('0x2b')](handleEntityNotFound(_0x3afefd,null))[_0xc48a('0x2b')](saveUpdates(_0x43b6e1['body'],null))[_0xc48a('0x2b')](respondWithResult(_0x3afefd,null))[_0xc48a('0x23')](handleError(_0x3afefd,null));};var utilLicense=require('../../config/license/util');exports['getFavicon']=function(_0x26b886,_0x2b9fcb,_0x569892){var _0x256cd7=_0xc48a('0x53');var _0x2460df={'custom':![]};return utilLicense['getLicense']()[_0xc48a('0x2b')](function(_0x3a88f9){if(_0x3a88f9){_0x2460df=_0x3a88f9;}return db['Setting'][_0xc48a('0x4a')]({'where':{'id':_0x26b886[_0xc48a('0x46')]['id']},'attributes':['logo',_0xc48a('0x55'),'preferred',_0xc48a('0x57'),_0xc48a('0x58'),_0xc48a('0x59'),_0xc48a('0x5a'),'defaultFavicon'],'raw':!![]});})[_0xc48a('0x2b')](handleEntityNotFound(_0x2b9fcb,null))[_0xc48a('0x2b')](function(_0x2dd2f0){if(_0x2dd2f0){var _0x1e9b6a=_0x2dd2f0[_0xc48a('0x57')]&&fs[_0xc48a('0x5c')](path[_0xc48a('0x5d')](config[_0xc48a('0x5e')],_0x256cd7,_[_0xc48a('0x5f')](_0x2dd2f0[_0xc48a('0x57')])))?path[_0xc48a('0x5d')](config['root'],_0x256cd7,_[_0xc48a('0x5f')](_0x2dd2f0[_0xc48a('0x57')])):path[_0xc48a('0x5d')](config[_0xc48a('0x5e')],_0x256cd7,_[_0xc48a('0x5f')](_0xc48a('0x6c')));var _0x1a5940=_0xc48a('0x65')+_[_0xc48a('0x61')](_0xc48a('0x57'));if(_0x2dd2f0[_0x1a5940]||!_0x2460df[_0xc48a('0x6a')]){_0x1e9b6a=path[_0xc48a('0x5d')](config[_0xc48a('0x5e')],_0x256cd7,_['toLower'](_0xc48a('0x6c')));}if(!fs[_0xc48a('0x5c')](_0x1e9b6a)){throw new db[(_0xc48a('0x18'))]['ValidationError'](_['upperFirst'](_0xc48a('0x57'))+_0xc48a('0x62'));}return _0x2b9fcb['download'](_0x1e9b6a);}})[_0xc48a('0x23')](handleError(_0x2b9fcb,null));}; \ No newline at end of file +var _0x50d0=['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','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','status','end','json','count','offset','set','Content-Range','reject','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','Setting','show','options','find','catch','update','body','addLogo','file','logo','addLogoLogin','filename','params','getLogo','server/files/images/logos','getLicense','loginLogo','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','default_logo.png','custom','ValidationError','upperFirst','\x20not\x20found','download','../../config/license/util','getLogoLogin','default_loginLogo.png','default','gdpr','securePassword','getPreferred','default_preferred.png','addFavicon','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','client','http'];(function(_0x54c9dd,_0x233a86){var _0x855156=function(_0x2dd60b){while(--_0x2dd60b){_0x54c9dd['push'](_0x54c9dd['shift']());}};_0x855156(++_0x233a86);}(_0x50d0,0x150));var _0x050d=function(_0x2f4f81,_0x7cc3ad){_0x2f4f81=_0x2f4f81-0x0;var _0xb04012=_0x50d0[_0x2f4f81];return _0xb04012;};'use strict';var pdf=require(_0x050d('0x0'));var emlformat=require(_0x050d('0x1'));var rimraf=require(_0x050d('0x2'));var zipdir=require(_0x050d('0x3'));var jsonpatch=require(_0x050d('0x4'));var rp=require(_0x050d('0x5'));var moment=require('moment');var BPromise=require(_0x050d('0x6'));var Mustache=require(_0x050d('0x7'));var util=require(_0x050d('0x8'));var path=require('path');var sox=require(_0x050d('0x9'));var csv=require(_0x050d('0xa'));var ejs=require(_0x050d('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x050d('0xc'));var crypto=require(_0x050d('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x050d('0xe'));var toCsv=require(_0x050d('0xa'));var querystring=require(_0x050d('0xf'));var Papa=require(_0x050d('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x050d('0x11'));var as=require(_0x050d('0x12'));var hardwareService=require(_0x050d('0x13'));var logger=require(_0x050d('0x14'))(_0x050d('0x15'));var utils=require(_0x050d('0x16'));var config=require(_0x050d('0x17'));var db=require(_0x050d('0x18'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x050d('0x19')][_0x050d('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x5ced8f,_0x19348e,_0x253000){if(_0x253000){var _0x4f4d2d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4f4d2d[_0x050d('0x1b')](_0x19348e)){return _0x5ced8f;}else{throw new db[(_0x050d('0x1c'))]['ValidationError'](_0x050d('0x1d'));}}else{return _0x5ced8f;}}function respondWithRpcPromise(_0x274a26,_0x17260d,_0x51e17b,_0x2eb595){return new BPromise(function(_0x7b362b,_0x1bc98a){var _0x3bcbd3=_0x2eb595||client;return _0x3bcbd3[_0x050d('0x1e')](_0x274a26,_0x51e17b)['then'](function(_0x50549e){logger[_0x050d('0x1f')](_0x050d('0x20'),_0x17260d,'request\x20sent');logger[_0x050d('0x21')](_0x050d('0x22'),_0x17260d,_0x050d('0x23'),JSON[_0x050d('0x24')](_0x50549e));if(_0x50549e[_0x050d('0x25')]){if(_0x50549e[_0x050d('0x25')][_0x050d('0x26')]===0x1f4){logger[_0x050d('0x25')]('Setting,\x20%s,\x20%s',_0x17260d,_0x50549e['error'][_0x050d('0x27')]);return _0x1bc98a(_0x50549e[_0x050d('0x25')][_0x050d('0x27')]);}logger[_0x050d('0x25')]('Setting,\x20%s,\x20%s',_0x17260d,_0x50549e[_0x050d('0x25')][_0x050d('0x27')]);return _0x7b362b(_0x50549e[_0x050d('0x25')][_0x050d('0x27')]);}else{logger[_0x050d('0x1f')](_0x050d('0x20'),_0x17260d,_0x050d('0x23'));_0x7b362b(_0x50549e[_0x050d('0x28')][_0x050d('0x27')]);}})['catch'](function(_0x3dc5e2){logger[_0x050d('0x25')](_0x050d('0x20'),_0x17260d,_0x3dc5e2);_0x1bc98a(_0x3dc5e2);});});}function respondWithStatusCode(_0x5a4ec5,_0x139c1e){_0x139c1e=_0x139c1e||0xcc;return function(_0x4d82fe){if(_0x4d82fe){return _0x5a4ec5[_0x050d('0x29')](_0x139c1e);}return _0x5a4ec5[_0x050d('0x2a')](_0x139c1e)[_0x050d('0x2b')]();};}function respondWithResult(_0x1769e4,_0x530351){_0x530351=_0x530351||0xc8;return function(_0x3b23f4){if(_0x3b23f4){return _0x1769e4[_0x050d('0x2a')](_0x530351)[_0x050d('0x2c')](_0x3b23f4);}};}function respondWithFilteredResult(_0x110950,_0x412447){return function(_0x2be37a){if(_0x2be37a){var _0x202be1=_0x2be37a[_0x050d('0x2d')],_0x2e1483=_0x412447[_0x050d('0x2e')],_0x59dacb=_0x412447[_0x050d('0x2e')]+_0x412447['limit'],_0x92d857;if(_0x59dacb>=_0x202be1){_0x59dacb=_0x202be1;_0x92d857=0xc8;}else{_0x92d857=0xce;}_0x110950[_0x050d('0x2a')](_0x92d857);return _0x110950[_0x050d('0x2f')](_0x050d('0x30'),_0x2e1483+'-'+_0x59dacb+'/'+_0x202be1)['json'](_0x2be37a);}return null;};}function patchUpdates(_0x5b753e){return function(_0x38ed07){try{jsonpatch['apply'](_0x38ed07,_0x5b753e,!![]);}catch(_0x4551a8){return BPromise[_0x050d('0x31')](_0x4551a8);}return _0x38ed07['save']();};}function saveUpdates(_0x51f9b0,_0x434521){return function(_0x49bcb6){if(_0x49bcb6){return _0x49bcb6['update'](_0x51f9b0)[_0x050d('0x32')](function(_0x3b7f0d){return _0x3b7f0d;});}return null;};}function removeEntity(_0xeae47e,_0x4b29a9){return function(_0x2514c0){if(_0x2514c0){return _0x2514c0[_0x050d('0x33')]()['then'](function(){_0xeae47e[_0x050d('0x2a')](0xcc)[_0x050d('0x2b')]();});}};}function handleEntityNotFound(_0xa3a4fb,_0x423ee2){return function(_0x541b3d){if(!_0x541b3d){_0xa3a4fb[_0x050d('0x29')](0x194);}return _0x541b3d;};}function handleError(_0x542703,_0xfa5a1c){_0xfa5a1c=_0xfa5a1c||0x1f4;return function(_0x411a47){logger[_0x050d('0x25')](_0x411a47[_0x050d('0x34')]);if(_0x411a47[_0x050d('0x35')]){delete _0x411a47[_0x050d('0x35')];}_0x542703[_0x050d('0x2a')](_0xfa5a1c)[_0x050d('0x36')](_0x411a47);};}exports[_0x050d('0x37')]=function(_0x5de0b3,_0x5b795f){var _0x4de7bb={},_0x30192b={},_0x284b91={'count':0x0,'rows':[]};var _0x32a077=_[_0x050d('0x38')](db['Setting'][_0x050d('0x39')],function(_0x5cfee6){return{'name':_0x5cfee6[_0x050d('0x3a')],'type':_0x5cfee6[_0x050d('0x3b')][_0x050d('0x3c')]};});_0x30192b[_0x050d('0x3d')]=_['map'](_0x32a077,_0x050d('0x35'));_0x30192b['query']=_[_0x050d('0x3e')](_0x5de0b3[_0x050d('0x3f')]);_0x30192b[_0x050d('0x40')]=_[_0x050d('0x41')](_0x30192b['model'],_0x30192b[_0x050d('0x3f')]);_0x4de7bb[_0x050d('0x42')]=_['intersection'](_0x30192b[_0x050d('0x3d')],qs[_0x050d('0x43')](_0x5de0b3['query']['fields']));_0x4de7bb[_0x050d('0x42')]=_0x4de7bb[_0x050d('0x42')][_0x050d('0x44')]?_0x4de7bb[_0x050d('0x42')]:_0x30192b[_0x050d('0x3d')];if(!_0x5de0b3['query'][_0x050d('0x45')]('nolimit')){_0x4de7bb['limit']=qs[_0x050d('0x46')](_0x5de0b3['query'][_0x050d('0x46')]);_0x4de7bb[_0x050d('0x2e')]=qs[_0x050d('0x2e')](_0x5de0b3[_0x050d('0x3f')][_0x050d('0x2e')]);}_0x4de7bb['order']=qs[_0x050d('0x47')](_0x5de0b3['query']['sort']);_0x4de7bb[_0x050d('0x48')]=qs['filters'](_[_0x050d('0x49')](_0x5de0b3[_0x050d('0x3f')],_0x30192b[_0x050d('0x40')]));if(_0x5de0b3[_0x050d('0x3f')][_0x050d('0x4a')]){_0x4de7bb[_0x050d('0x48')]=_['merge'](_0x4de7bb[_0x050d('0x48')],{'$or':_[_0x050d('0x38')](_0x32a077,function(_0x202ec8){if(_0x202ec8['type']!==_0x050d('0x4b')){var _0x3c6bbd={};_0x3c6bbd[_0x202ec8[_0x050d('0x35')]]={'$like':'%'+_0x5de0b3[_0x050d('0x3f')]['filter']+'%'};return _0x3c6bbd;}})});}_0x4de7bb=_[_0x050d('0x4c')]({},_0x4de7bb,_0x5de0b3['options']);var _0x16e981={'where':_0x4de7bb[_0x050d('0x48')]};return db['Setting'][_0x050d('0x2d')](_0x16e981)['then'](function(_0x5b1224){_0x284b91[_0x050d('0x2d')]=_0x5b1224;if(_0x5de0b3[_0x050d('0x3f')][_0x050d('0x4d')]){_0x4de7bb[_0x050d('0x4e')]=[{'all':!![]}];}return db[_0x050d('0x4f')]['findAll'](_0x4de7bb);})[_0x050d('0x32')](function(_0x10002b){_0x284b91['rows']=_0x10002b;return _0x284b91;})[_0x050d('0x32')](respondWithFilteredResult(_0x5b795f,_0x4de7bb))['catch'](handleError(_0x5b795f,null));};exports[_0x050d('0x50')]=function(_0x5bbe11,_0x39383c){var _0x344899={'raw':![],'where':{'id':_0x5bbe11['params']['id']}},_0x59e8af={};_0x59e8af[_0x050d('0x3d')]=_[_0x050d('0x3e')](db[_0x050d('0x4f')][_0x050d('0x39')]);_0x59e8af[_0x050d('0x3f')]=_['keys'](_0x5bbe11['query']);_0x59e8af[_0x050d('0x40')]=_[_0x050d('0x41')](_0x59e8af[_0x050d('0x3d')],_0x59e8af[_0x050d('0x3f')]);_0x344899[_0x050d('0x42')]=_[_0x050d('0x41')](_0x59e8af[_0x050d('0x3d')],qs[_0x050d('0x43')](_0x5bbe11['query']['fields']));_0x344899['attributes']=_0x344899[_0x050d('0x42')][_0x050d('0x44')]?_0x344899[_0x050d('0x42')]:_0x59e8af['model'];if(_0x5bbe11[_0x050d('0x3f')]['includeAll']){_0x344899[_0x050d('0x4e')]=[{'all':!![]}];}_0x344899=_[_0x050d('0x4c')]({},_0x344899,_0x5bbe11[_0x050d('0x51')]);return db[_0x050d('0x4f')][_0x050d('0x52')](_0x344899)[_0x050d('0x32')](handleEntityNotFound(_0x39383c,null))[_0x050d('0x32')](respondWithResult(_0x39383c,null))[_0x050d('0x53')](handleError(_0x39383c,null));};exports[_0x050d('0x54')]=function(_0x4d20c1,_0x4ab770){if(_0x4d20c1[_0x050d('0x55')]['id']){delete _0x4d20c1[_0x050d('0x55')]['id'];}return db[_0x050d('0x4f')][_0x050d('0x52')]({'where':{'id':_0x4d20c1['params']['id']}})[_0x050d('0x32')](handleEntityNotFound(_0x4ab770,null))['then'](saveUpdates(_0x4d20c1[_0x050d('0x55')],null))[_0x050d('0x32')](respondWithResult(_0x4ab770,null))['catch'](handleError(_0x4ab770,null));};exports[_0x050d('0x56')]=function(_0x2b6580,_0x7110b6,_0x4b9701){if(_0x2b6580['file']&&_0x2b6580[_0x050d('0x57')]['filename']){_0x2b6580[_0x050d('0x55')][_0x050d('0x58')]=_0x2b6580['file']['filename'];}return db[_0x050d('0x4f')][_0x050d('0x52')]({'where':{'id':_0x2b6580['params']['id']}})[_0x050d('0x32')](handleEntityNotFound(_0x7110b6,null))[_0x050d('0x32')](saveUpdates(_0x2b6580[_0x050d('0x55')],null))[_0x050d('0x32')](respondWithResult(_0x7110b6,null))[_0x050d('0x53')](handleError(_0x7110b6,null));};exports[_0x050d('0x59')]=function(_0x184665,_0x4e39a2,_0x360d60){if(_0x184665['file']&&_0x184665[_0x050d('0x57')][_0x050d('0x5a')]){_0x184665[_0x050d('0x55')]['loginLogo']=_0x184665[_0x050d('0x57')][_0x050d('0x5a')];}return db[_0x050d('0x4f')][_0x050d('0x52')]({'where':{'id':_0x184665[_0x050d('0x5b')]['id']}})['then'](handleEntityNotFound(_0x4e39a2,null))['then'](saveUpdates(_0x184665[_0x050d('0x55')],null))[_0x050d('0x32')](respondWithResult(_0x4e39a2,null))[_0x050d('0x53')](handleError(_0x4e39a2,null));};var utilLicense=require('../../config/license/util');exports[_0x050d('0x5c')]=function(_0x5d30e5,_0xd32151,_0x123917){var _0x5125fd=_0x050d('0x5d');var _0x4e9bf7={'custom':![]};return utilLicense[_0x050d('0x5e')]()['then'](function(_0x746a89){if(_0x746a89){_0x4e9bf7=_0x746a89;}return db[_0x050d('0x4f')][_0x050d('0x52')]({'where':{'id':_0x5d30e5[_0x050d('0x5b')]['id']},'attributes':['logo',_0x050d('0x5f'),_0x050d('0x60'),_0x050d('0x61'),_0x050d('0x62'),_0x050d('0x63'),_0x050d('0x64'),_0x050d('0x65')],'raw':!![]});})['then'](handleEntityNotFound(_0xd32151,null))['then'](function(_0x42753b){if(_0x42753b){var _0x2ae3d0=_0x42753b[_0x050d('0x58')]&&fs[_0x050d('0x66')](path[_0x050d('0x67')](config[_0x050d('0x68')],_0x5125fd,_[_0x050d('0x69')](_0x42753b[_0x050d('0x58')])))?path[_0x050d('0x67')](config[_0x050d('0x68')],_0x5125fd,_[_0x050d('0x69')](_0x42753b[_0x050d('0x58')])):path[_0x050d('0x67')](config[_0x050d('0x68')],_0x5125fd,_['toLower'](_0x050d('0x6a')));var _0x219ce4='default'+_['upperFirst'](_0x050d('0x58'));if(_0x42753b[_0x219ce4]||!_0x4e9bf7[_0x050d('0x6b')]){_0x2ae3d0=path['join'](config[_0x050d('0x68')],_0x5125fd,_[_0x050d('0x69')]('default_logo.png'));}if(!fs[_0x050d('0x66')](_0x2ae3d0)){throw new db['Sequelize'][(_0x050d('0x6c'))](_[_0x050d('0x6d')](_0x050d('0x58'))+_0x050d('0x6e'));}return _0xd32151[_0x050d('0x6f')](_0x2ae3d0);}})[_0x050d('0x53')](handleError(_0xd32151,null));};var utilLicense=require(_0x050d('0x70'));exports[_0x050d('0x71')]=function(_0x51a357,_0x1d45a0,_0x1ad410){var _0xd6082e=_0x050d('0x5d');var _0xf4ba2={'custom':![]};return utilLicense[_0x050d('0x5e')]()[_0x050d('0x32')](function(_0x4bcc97){if(_0x4bcc97){_0xf4ba2=_0x4bcc97;}return db[_0x050d('0x4f')][_0x050d('0x52')]({'where':{'id':_0x51a357[_0x050d('0x5b')]['id']},'attributes':[_0x050d('0x58'),'loginLogo',_0x050d('0x60'),_0x050d('0x61'),_0x050d('0x62'),'defaultLoginLogo',_0x050d('0x64'),_0x050d('0x65')],'raw':!![]});})[_0x050d('0x32')](handleEntityNotFound(_0x1d45a0,null))['then'](function(_0xd23873){if(_0xd23873){var _0x7abc69=_0xd23873[_0x050d('0x5f')]&&fs[_0x050d('0x66')](path['join'](config['root'],_0xd6082e,_['toLower'](_0xd23873[_0x050d('0x5f')])))?path[_0x050d('0x67')](config[_0x050d('0x68')],_0xd6082e,_[_0x050d('0x69')](_0xd23873[_0x050d('0x5f')])):path[_0x050d('0x67')](config[_0x050d('0x68')],_0xd6082e,_[_0x050d('0x69')](_0x050d('0x72')));var _0x2f3390=_0x050d('0x73')+_['upperFirst'](_0x050d('0x5f'));if(_0xd23873[_0x2f3390]||!_0xf4ba2[_0x050d('0x6b')]){_0x7abc69=path[_0x050d('0x67')](config['root'],_0xd6082e,_[_0x050d('0x69')](_0x050d('0x72')));}if(!fs[_0x050d('0x66')](_0x7abc69)){throw new db[(_0x050d('0x1c'))][(_0x050d('0x6c'))](_[_0x050d('0x6d')](_0x050d('0x5f'))+_0x050d('0x6e'));}return _0x1d45a0['download'](_0x7abc69);}})[_0x050d('0x53')](handleError(_0x1d45a0,null));};exports[_0x050d('0x74')]=function(_0x1ac378,_0x120480){return db[_0x050d('0x4f')][_0x050d('0x52')]({'where':{'id':_0x1ac378['params']['id']},'attributes':[_0x050d('0x75')]})[_0x050d('0x32')](respondWithResult(_0x120480,null))[_0x050d('0x53')](handleError(_0x120480,null));};exports['addPreferred']=function(_0x11ef57,_0x486c14,_0x59e69a){if(_0x11ef57[_0x050d('0x57')]&&_0x11ef57['file'][_0x050d('0x5a')]){_0x11ef57['body'][_0x050d('0x60')]=_0x11ef57['file']['filename'];}return db[_0x050d('0x4f')][_0x050d('0x52')]({'where':{'id':_0x11ef57[_0x050d('0x5b')]['id']}})[_0x050d('0x32')](handleEntityNotFound(_0x486c14,null))[_0x050d('0x32')](saveUpdates(_0x11ef57[_0x050d('0x55')],null))[_0x050d('0x32')](respondWithResult(_0x486c14,null))['catch'](handleError(_0x486c14,null));};var utilLicense=require(_0x050d('0x70'));exports[_0x050d('0x76')]=function(_0x16b68b,_0x4b0aa7,_0x1cb184){var _0x234a4f=_0x050d('0x5d');var _0xdd6334={'custom':![]};return utilLicense['getLicense']()[_0x050d('0x32')](function(_0x45e1e9){if(_0x45e1e9){_0xdd6334=_0x45e1e9;}return db['Setting'][_0x050d('0x52')]({'where':{'id':_0x16b68b[_0x050d('0x5b')]['id']},'attributes':['logo',_0x050d('0x5f'),_0x050d('0x60'),_0x050d('0x61'),_0x050d('0x62'),_0x050d('0x63'),_0x050d('0x64'),'defaultFavicon'],'raw':!![]});})[_0x050d('0x32')](handleEntityNotFound(_0x4b0aa7,null))[_0x050d('0x32')](function(_0x6a229d){if(_0x6a229d){var _0x4f456b=_0x6a229d[_0x050d('0x60')]&&fs[_0x050d('0x66')](path[_0x050d('0x67')](config[_0x050d('0x68')],_0x234a4f,_['toLower'](_0x6a229d['preferred'])))?path['join'](config[_0x050d('0x68')],_0x234a4f,_[_0x050d('0x69')](_0x6a229d[_0x050d('0x60')])):path['join'](config[_0x050d('0x68')],_0x234a4f,_[_0x050d('0x69')](_0x050d('0x77')));var _0x4e4f10=_0x050d('0x73')+_['upperFirst'](_0x050d('0x60'));if(_0x6a229d[_0x4e4f10]||!_0xdd6334[_0x050d('0x6b')]||!_0xdd6334[_0x050d('0x60')]){_0x4f456b=path[_0x050d('0x67')](config[_0x050d('0x68')],_0x234a4f,_[_0x050d('0x69')](_0x050d('0x77')));}if(!fs[_0x050d('0x66')](_0x4f456b)){throw new db[(_0x050d('0x1c'))][(_0x050d('0x6c'))](_['upperFirst'](_0x050d('0x60'))+_0x050d('0x6e'));}return _0x4b0aa7[_0x050d('0x6f')](_0x4f456b);}})['catch'](handleError(_0x4b0aa7,null));};exports[_0x050d('0x78')]=function(_0x3320c4,_0x3d7738,_0xa5ffa6){if(_0x3320c4[_0x050d('0x57')]&&_0x3320c4[_0x050d('0x57')][_0x050d('0x5a')]){_0x3320c4['body'][_0x050d('0x61')]=_0x3320c4[_0x050d('0x57')]['filename'];}return db[_0x050d('0x4f')][_0x050d('0x52')]({'where':{'id':_0x3320c4[_0x050d('0x5b')]['id']}})[_0x050d('0x32')](handleEntityNotFound(_0x3d7738,null))[_0x050d('0x32')](saveUpdates(_0x3320c4[_0x050d('0x55')],null))[_0x050d('0x32')](respondWithResult(_0x3d7738,null))[_0x050d('0x53')](handleError(_0x3d7738,null));};var utilLicense=require(_0x050d('0x70'));exports['getFavicon']=function(_0x5536eb,_0x45419c,_0x1a189b){var _0x2bea6e=_0x050d('0x5d');var _0x348196={'custom':![]};return utilLicense[_0x050d('0x5e')]()[_0x050d('0x32')](function(_0x56de8e){if(_0x56de8e){_0x348196=_0x56de8e;}return db[_0x050d('0x4f')][_0x050d('0x52')]({'where':{'id':_0x5536eb['params']['id']},'attributes':[_0x050d('0x58'),_0x050d('0x5f'),_0x050d('0x60'),'favicon',_0x050d('0x62'),_0x050d('0x63'),_0x050d('0x64'),_0x050d('0x65')],'raw':!![]});})[_0x050d('0x32')](handleEntityNotFound(_0x45419c,null))[_0x050d('0x32')](function(_0x58b413){if(_0x58b413){var _0x4d9fe2=_0x58b413[_0x050d('0x61')]&&fs[_0x050d('0x66')](path['join'](config['root'],_0x2bea6e,_[_0x050d('0x69')](_0x58b413[_0x050d('0x61')])))?path['join'](config['root'],_0x2bea6e,_[_0x050d('0x69')](_0x58b413[_0x050d('0x61')])):path['join'](config[_0x050d('0x68')],_0x2bea6e,_[_0x050d('0x69')]('default_favicon.ico'));var _0xcbf283=_0x050d('0x73')+_[_0x050d('0x6d')](_0x050d('0x61'));if(_0x58b413[_0xcbf283]||!_0x348196[_0x050d('0x6b')]){_0x4d9fe2=path[_0x050d('0x67')](config['root'],_0x2bea6e,_[_0x050d('0x69')]('default_favicon.ico'));}if(!fs[_0x050d('0x66')](_0x4d9fe2)){throw new db[(_0x050d('0x1c'))][(_0x050d('0x6c'))](_[_0x050d('0x6d')]('favicon')+'\x20not\x20found');}return _0x45419c[_0x050d('0x6f')](_0x4d9fe2);}})[_0x050d('0x53')](handleError(_0x45419c,null));}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 8e87251..45754ed 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 _0x4d14=['util','moment','bluebird','rimraf','../../config/environment','./setting.attributes','exports','define','Setting','lodash'];(function(_0x3f0bd0,_0x14f131){var _0x344b80=function(_0x230acf){while(--_0x230acf){_0x3f0bd0['push'](_0x3f0bd0['shift']());}};_0x344b80(++_0x14f131);}(_0x4d14,0x153));var _0x44d1=function(_0x154192,_0x2d360f){_0x154192=_0x154192-0x0;var _0x3c2792=_0x4d14[_0x154192];return _0x3c2792;};'use strict';var _=require(_0x44d1('0x0'));var util=require(_0x44d1('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x44d1('0x2'));var BPromise=require(_0x44d1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x44d1('0x4'));var config=require(_0x44d1('0x5'));var attributes=require(_0x44d1('0x6'));module[_0x44d1('0x7')]=function(_0x5c8b62,_0x3bbc21){return _0x5c8b62[_0x44d1('0x8')](_0x44d1('0x9'),attributes,{'tableName':'settings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2011=['define','Setting','settings','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./setting.attributes','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2011,0x73));var _0x1201=function(_0x171fc5,_0x3f598e){_0x171fc5=_0x171fc5-0x0;var _0xc5e34d=_0x2011[_0x171fc5];return _0xc5e34d;};'use strict';var _=require(_0x1201('0x0'));var util=require(_0x1201('0x1'));var logger=require(_0x1201('0x2'))(_0x1201('0x3'));var moment=require(_0x1201('0x4'));var BPromise=require(_0x1201('0x5'));var rp=require(_0x1201('0x6'));var fs=require('fs');var path=require(_0x1201('0x7'));var rimraf=require(_0x1201('0x8'));var config=require('../../config/environment');var attributes=require(_0x1201('0x9'));module[_0x1201('0xa')]=function(_0x4cfc30,_0x5e1925){return _0x4cfc30[_0x1201('0xb')](_0x1201('0xc'),attributes,{'tableName':_0x1201('0xd'),'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 ba1a5c8..5f5e1e4 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 _0xb926=['moment','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash'];(function(_0x4fb930,_0x4141c4){var _0x59adc4=function(_0x540aef){while(--_0x540aef){_0x4fb930['push'](_0x4fb930['shift']());}};_0x59adc4(++_0x4141c4);}(_0xb926,0x1b8));var _0x6b92=function(_0x5c2937,_0x8055c2){_0x5c2937=_0x5c2937-0x0;var _0x3516ee=_0xb926[_0x5c2937];return _0x3516ee;};'use strict';var _=require(_0x6b92('0x0'));var util=require('util');var moment=require(_0x6b92('0x1'));var BPromise=require('bluebird');var rs=require(_0x6b92('0x2'));var fs=require('fs');var Redis=require(_0x6b92('0x3'));var db=require(_0x6b92('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6b92('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6b92('0x6'));var client=jayson[_0x6b92('0x7')][_0x6b92('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x7031a1,_0x3ff063,_0x5eed37){return new BPromise(function(_0x4ed5bf,_0x4d6be1){return client[_0x6b92('0x9')](_0x7031a1,_0x5eed37)['then'](function(_0x4b2099){logger[_0x6b92('0xa')](_0x6b92('0xb'),_0x3ff063,_0x6b92('0xc'));logger[_0x6b92('0xd')](_0x6b92('0xe'),_0x3ff063,_0x6b92('0xc'),JSON[_0x6b92('0xf')](_0x4b2099));if(_0x4b2099['error']){if(_0x4b2099['error'][_0x6b92('0x10')]===0x1f4){logger[_0x6b92('0x11')](_0x6b92('0xb'),_0x3ff063,_0x4b2099['error'][_0x6b92('0x12')]);return _0x4d6be1(_0x4b2099[_0x6b92('0x11')]['message']);}logger[_0x6b92('0x11')](_0x6b92('0xb'),_0x3ff063,_0x4b2099['error'][_0x6b92('0x12')]);return _0x4ed5bf(_0x4b2099['error'][_0x6b92('0x12')]);}else{logger[_0x6b92('0xa')](_0x6b92('0xb'),_0x3ff063,_0x6b92('0xc'));_0x4ed5bf(_0x4b2099[_0x6b92('0x13')][_0x6b92('0x12')]);}})[_0x6b92('0x14')](function(_0x533a68){logger[_0x6b92('0x11')]('Setting,\x20%s,\x20%s',_0x3ff063,_0x533a68);_0x4d6be1(_0x533a68);});});} \ No newline at end of file +var _0x3ef7=['info','result','catch','lodash','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','Setting,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0xb14d8c,_0x5dc616){var _0x5d4380=function(_0x328b59){while(--_0x328b59){_0xb14d8c['push'](_0xb14d8c['shift']());}};_0x5d4380(++_0x5dc616);}(_0x3ef7,0x7b));var _0x73ef=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x3ef7[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x73ef('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x73ef('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x73ef('0x2'))['db'];var utils=require(_0x73ef('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x73ef('0x4'));var jayson=require(_0x73ef('0x5'));var client=jayson[_0x73ef('0x6')][_0x73ef('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x497e9c,_0x2944fb,_0x401c87){return new BPromise(function(_0xffdc06,_0xd89f12){return client[_0x73ef('0x8')](_0x497e9c,_0x401c87)[_0x73ef('0x9')](function(_0x3fdb20){logger['info'](_0x73ef('0xa'),_0x2944fb,_0x73ef('0xb'));logger[_0x73ef('0xc')]('Setting,\x20%s,\x20%s,\x20%s',_0x2944fb,_0x73ef('0xb'),JSON[_0x73ef('0xd')](_0x3fdb20));if(_0x3fdb20[_0x73ef('0xe')]){if(_0x3fdb20[_0x73ef('0xe')][_0x73ef('0xf')]===0x1f4){logger['error'](_0x73ef('0xa'),_0x2944fb,_0x3fdb20[_0x73ef('0xe')]['message']);return _0xd89f12(_0x3fdb20[_0x73ef('0xe')][_0x73ef('0x10')]);}logger[_0x73ef('0xe')](_0x73ef('0xa'),_0x2944fb,_0x3fdb20[_0x73ef('0xe')][_0x73ef('0x10')]);return _0xffdc06(_0x3fdb20[_0x73ef('0xe')]['message']);}else{logger[_0x73ef('0x11')]('Setting,\x20%s,\x20%s',_0x2944fb,_0x73ef('0xb'));_0xffdc06(_0x3fdb20[_0x73ef('0x12')][_0x73ef('0x10')]);}})[_0x73ef('0x13')](function(_0x1120b2){logger[_0x73ef('0xe')]('Setting,\x20%s,\x20%s',_0x2944fb,_0x1120b2);_0xd89f12(_0x1120b2);});});} \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index db9bee7..a931839 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 _0x2075=['exports','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','index','/:id','getDispositions','/:id/canned_answers','/:id/applications','getInteractions','/:id/users','getAgents','post','create','/:id/dispositions','addDisposition','/:id/notify','notify','addApplications','send','/:id/status','status','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents'];(function(_0x294569,_0x265330){var _0x246dc3=function(_0x4b5510){while(--_0x4b5510){_0x294569['push'](_0x294569['shift']());}};_0x246dc3(++_0x265330);}(_0x2075,0x70));var _0x5207=function(_0x8962d6,_0x503ed6){_0x8962d6=_0x8962d6-0x0;var _0x566f25=_0x2075[_0x8962d6];return _0x566f25;};'use strict';var multer=require('multer');var util=require(_0x5207('0x0'));var path=require(_0x5207('0x1'));var timeout=require(_0x5207('0x2'));var express=require(_0x5207('0x3'));var router=express[_0x5207('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x5207('0x5'));var config=require(_0x5207('0x6'));var controller=require(_0x5207('0x7'));router[_0x5207('0x8')]('/',auth[_0x5207('0x9')](),controller[_0x5207('0xa')]);router['get']('/describe',auth[_0x5207('0x9')](),controller['describe']);router[_0x5207('0x8')](_0x5207('0xb'),auth[_0x5207('0x9')](),controller['show']);router[_0x5207('0x8')]('/:id/dispositions',auth[_0x5207('0x9')](),controller[_0x5207('0xc')]);router[_0x5207('0x8')](_0x5207('0xd'),auth[_0x5207('0x9')](),controller['getAnswers']);router[_0x5207('0x8')](_0x5207('0xe'),auth[_0x5207('0x9')](),controller['getApplications']);router[_0x5207('0x8')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x5207('0xf')]);router['get']('/:id/status',controller['statusGet']);router[_0x5207('0x8')](_0x5207('0x10'),auth[_0x5207('0x9')](),controller[_0x5207('0x11')]);router[_0x5207('0x12')]('/',auth['isAuthenticated'](),controller[_0x5207('0x13')]);router[_0x5207('0x12')](_0x5207('0x14'),auth[_0x5207('0x9')](),controller[_0x5207('0x15')]);router['post'](_0x5207('0xd'),auth[_0x5207('0x9')](),controller['addAnswer']);router[_0x5207('0x12')](_0x5207('0x16'),controller[_0x5207('0x17')]);router['post'](_0x5207('0xe'),auth[_0x5207('0x9')](),controller[_0x5207('0x18')]);router[_0x5207('0x12')]('/:id/send',auth[_0x5207('0x9')](),controller[_0x5207('0x19')]);router[_0x5207('0x12')](_0x5207('0x1a'),controller[_0x5207('0x1b')]);router[_0x5207('0x12')](_0x5207('0x10'),auth[_0x5207('0x9')](),controller[_0x5207('0x1c')]);router[_0x5207('0x1d')](_0x5207('0xb'),auth['isAuthenticated'](),controller[_0x5207('0x1e')]);router[_0x5207('0x1f')](_0x5207('0xb'),auth['isAuthenticated'](),controller[_0x5207('0x20')]);router[_0x5207('0x1f')]('/:id/dispositions',auth[_0x5207('0x9')](),controller[_0x5207('0x21')]);router[_0x5207('0x1f')](_0x5207('0xd'),auth[_0x5207('0x9')](),controller[_0x5207('0x22')]);router['delete'](_0x5207('0x10'),auth[_0x5207('0x9')](),controller[_0x5207('0x23')]);module[_0x5207('0x24')]=router; \ No newline at end of file +var _0xeab2=['/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status','statusGet','/:id/users','getAgents','create','post','addDisposition','addAnswer','notify','addApplications','/:id/send','send','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./smsAccount.controller','index','get','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions'];(function(_0x269b84,_0x266bd6){var _0x27d618=function(_0xf8beb7){while(--_0xf8beb7){_0x269b84['push'](_0x269b84['shift']());}};_0x27d618(++_0x266bd6);}(_0xeab2,0xcf));var _0x2eab=function(_0x5b8310,_0x77ea6f){_0x5b8310=_0x5b8310-0x0;var _0xd3ebc1=_0xeab2[_0x5b8310];return _0xd3ebc1;};'use strict';var multer=require(_0x2eab('0x0'));var util=require(_0x2eab('0x1'));var path=require(_0x2eab('0x2'));var timeout=require(_0x2eab('0x3'));var express=require(_0x2eab('0x4'));var router=express[_0x2eab('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x2eab('0x6'));var config=require(_0x2eab('0x7'));var controller=require(_0x2eab('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x2eab('0x9')]);router[_0x2eab('0xa')](_0x2eab('0xb'),auth[_0x2eab('0xc')](),controller[_0x2eab('0xd')]);router[_0x2eab('0xa')](_0x2eab('0xe'),auth[_0x2eab('0xc')](),controller[_0x2eab('0xf')]);router['get'](_0x2eab('0x10'),auth['isAuthenticated'](),controller[_0x2eab('0x11')]);router['get'](_0x2eab('0x12'),auth[_0x2eab('0xc')](),controller[_0x2eab('0x13')]);router[_0x2eab('0xa')](_0x2eab('0x14'),auth[_0x2eab('0xc')](),controller[_0x2eab('0x15')]);router['get'](_0x2eab('0x16'),auth[_0x2eab('0xc')](),controller[_0x2eab('0x17')]);router['get'](_0x2eab('0x18'),controller[_0x2eab('0x19')]);router[_0x2eab('0xa')](_0x2eab('0x1a'),auth[_0x2eab('0xc')](),controller[_0x2eab('0x1b')]);router['post']('/',auth['isAuthenticated'](),controller[_0x2eab('0x1c')]);router[_0x2eab('0x1d')](_0x2eab('0x10'),auth[_0x2eab('0xc')](),controller[_0x2eab('0x1e')]);router[_0x2eab('0x1d')]('/:id/canned_answers',auth[_0x2eab('0xc')](),controller[_0x2eab('0x1f')]);router[_0x2eab('0x1d')]('/:id/notify',controller[_0x2eab('0x20')]);router[_0x2eab('0x1d')](_0x2eab('0x14'),auth[_0x2eab('0xc')](),controller[_0x2eab('0x21')]);router[_0x2eab('0x1d')](_0x2eab('0x22'),auth[_0x2eab('0xc')](),controller[_0x2eab('0x23')]);router[_0x2eab('0x1d')](_0x2eab('0x18'),controller['status']);router[_0x2eab('0x1d')](_0x2eab('0x1a'),auth[_0x2eab('0xc')](),controller[_0x2eab('0x24')]);router[_0x2eab('0x25')](_0x2eab('0xe'),auth[_0x2eab('0xc')](),controller[_0x2eab('0x26')]);router[_0x2eab('0x27')](_0x2eab('0xe'),auth[_0x2eab('0xc')](),controller[_0x2eab('0x28')]);router['delete'](_0x2eab('0x10'),auth[_0x2eab('0xc')](),controller[_0x2eab('0x29')]);router[_0x2eab('0x27')](_0x2eab('0x12'),auth[_0x2eab('0xc')](),controller[_0x2eab('0x2a')]);router[_0x2eab('0x27')]('/:id/users',auth[_0x2eab('0xc')](),controller[_0x2eab('0x2b')]);module[_0x2eab('0x2c')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index fee6094..4030659 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 _0x321d=['skebby','clicksend','plivo','clickatell','csc','infobip','intelepeer','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','ENUM'];(function(_0x6ca7f4,_0x51a5df){var _0x494fa6=function(_0x359532){while(--_0x359532){_0x6ca7f4['push'](_0x6ca7f4['shift']());}};_0x494fa6(++_0x51a5df);}(_0x321d,0x93));var _0xd321=function(_0x36c0c6,_0xd62883){_0x36c0c6=_0x36c0c6-0x0;var _0x2a5d9c=_0x321d[_0x36c0c6];return _0x2a5d9c;};'use strict';var Sequelize=require(_0xd321('0x0'));var rs=require(_0xd321('0x1'));module[_0xd321('0x2')]={'name':{'type':Sequelize[_0xd321('0x3')],'unique':_0xd321('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0xd321('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0xd321('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0xd321('0x3')],'defaultValue':function(){return rs[_0xd321('0x5')]();}},'phone':{'type':Sequelize[_0xd321('0x3')]},'type':{'type':Sequelize[_0xd321('0x6')]('twilio',_0xd321('0x7'),'connectel',_0xd321('0x8'),_0xd321('0x9'),_0xd321('0xa'),_0xd321('0xb'),_0xd321('0xc'),_0xd321('0xd'))},'accountSid':{'type':Sequelize[_0xd321('0x3')]},'authId':{'type':Sequelize[_0xd321('0x3')]},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize[_0xd321('0x6')]('SI','TI','GP')},'username':{'type':Sequelize[_0xd321('0x3')]},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0xd321('0x3')]},'senderString':{'type':Sequelize[_0xd321('0x3')]},'deliveryReport':{'type':Sequelize[_0xd321('0xe')],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xd321('0xf')],'defaultValue':function(){return _0xd321('0x10');}},'notificationSound':{'type':Sequelize[_0xd321('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xd321('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xd321('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xd321('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd321('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xd321('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd321('0x11')],'comment':_0xd321('0x12')},'mandatoryDisposition':{'type':Sequelize[_0xd321('0xe')],'defaultValue':![],'comment':_0xd321('0x13'),'set':function(_0x45ec84){if(!_0x45ec84)this['setDataValue'](_0xd321('0x14'),null);this['setDataValue'](_0xd321('0x15'),_0x45ec84);}}}; \ No newline at end of file +var _0x9488=['generate','ENUM','twilio','skebby','clicksend','infobip','intelepeer','BOOLEAN','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING'];(function(_0x3a2b45,_0x23f5ca){var _0x3b980b=function(_0x54ab29){while(--_0x54ab29){_0x3a2b45['push'](_0x3a2b45['shift']());}};_0x3b980b(++_0x23f5ca);}(_0x9488,0x1e2));var _0x8948=function(_0xfecf54,_0x2f4876){_0xfecf54=_0xfecf54-0x0;var _0x19148e=_0x9488[_0xfecf54];return _0x19148e;};'use strict';var Sequelize=require(_0x8948('0x0'));var rs=require(_0x8948('0x1'));module[_0x8948('0x2')]={'name':{'type':Sequelize[_0x8948('0x3')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0x8948('0x3')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x8948('0x3')],'defaultValue':function(){return rs[_0x8948('0x4')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x8948('0x5')](_0x8948('0x6'),_0x8948('0x7'),'connectel',_0x8948('0x8'),'plivo','clickatell','csc',_0x8948('0x9'),_0x8948('0xa'))},'accountSid':{'type':Sequelize[_0x8948('0x3')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize[_0x8948('0x3')]},'password':{'type':Sequelize[_0x8948('0x3')]},'apiKey':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize['STRING']},'deliveryReport':{'type':Sequelize[_0x8948('0xb')],'defaultValue':![]},'description':{'type':Sequelize[_0x8948('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x8948('0xc');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x8948('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x8948('0xb')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x8948('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x8948('0xb')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x8948('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8948('0xd')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x8948('0xb')],'defaultValue':![],'comment':_0x8948('0xe'),'set':function(_0x5d80e5){if(!_0x5d80e5)this[_0x8948('0xf')](_0x8948('0x10'),null);this[_0x8948('0xf')](_0x8948('0x11'),_0x5d80e5);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index d20e211..4a2ce05 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 _0x1280=['UserProfileResource','name','send','index','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','count','include','findAll','rows','catch','params','keys','SmsAccount','includeAll','options','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','SmsAccountId','Disposition','findOne','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','notify','Applications','account','applications','orderBy','priority','CmContact','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','From','Body','messageId','MessageSid','skebby','sender','text','message_id','plivo','Text','infobip','results','csc','originatingAddress','clickatell','fromNumber','replyMessageId','intelepeer','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','CmList','DESC','list','omit','Contacts','defaults','contact','SmsInteraction','spread','interaction','created','autoclose','push','close','unmanaged','SmsMessage','ContactId','AttachmentId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','entity\x20found','debug','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','set','text/xml','\x0a','addApplications','sequelize','transaction','SmsApplication','bulkCreate','getApplications','getInteractions','Contact','Owner','fullname','Tag','Tags','color','tag','List','out','Messages','dataValues','log','endpoint\x20/status\x20POST\x20/','received\x20delivery\x20report\x20from','connectel','requestid','statusInt','clicksend','status_code','groupName','DELIVERED','redif','inspect','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','statusGet','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','getAgents','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','redis','socket.io-emitter','./smsAccount.socket','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','SmsAccount,\x20%s,\x20%s','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','result','message','sendStatus','status','end','offset','limit','Content-Range','json','apply','reject','update','destroy','SmsAccounts'];(function(_0x2f7104,_0x5ecc2e){var _0x282e73=function(_0x22b3ec){while(--_0x22b3ec){_0x2f7104['push'](_0x2f7104['shift']());}};_0x282e73(++_0x5ecc2e);}(_0x1280,0xac));var _0x0128=function(_0x5e2cb4,_0x592c64){_0x5e2cb4=_0x5e2cb4-0x0;var _0x282902=_0x1280[_0x5e2cb4];return _0x282902;};'use strict';var pdf=require(_0x0128('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x0128('0x1'));var zipdir=require(_0x0128('0x2'));var jsonpatch=require(_0x0128('0x3'));var rp=require(_0x0128('0x4'));var moment=require(_0x0128('0x5'));var BPromise=require(_0x0128('0x6'));var Mustache=require('mustache');var util=require(_0x0128('0x7'));var path=require(_0x0128('0x8'));var sox=require(_0x0128('0x9'));var csv=require(_0x0128('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x0128('0xb'));var crypto=require(_0x0128('0xc'));var jsforce=require(_0x0128('0xd'));var deskjs=require(_0x0128('0xe'));var toCsv=require('to-csv');var querystring=require(_0x0128('0xf'));var Papa=require(_0x0128('0x10'));var Redis=require('ioredis');var authService=require(_0x0128('0x11'));var qs=require(_0x0128('0x12'));var as=require(_0x0128('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0128('0x14'));var utils=require(_0x0128('0x15'));var config=require(_0x0128('0x16'));var db=require('../../mysqldb')['db'];config[_0x0128('0x17')]=_['defaults'](config[_0x0128('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x0128('0x18'))(new Redis(config['redis']));require(_0x0128('0x19'))['register'](socket);var jayson=require(_0x0128('0x1a'));var client=jayson[_0x0128('0x1b')][_0x0128('0x1c')]({'port':0x232c});function checkPasswordPattern(_0x5a42eb,_0x2046f8,_0x43f107){if(_0x43f107){var _0x59a472=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x59a472[_0x0128('0x1d')](_0x2046f8)){return _0x5a42eb;}else{throw new db[(_0x0128('0x1e'))][(_0x0128('0x1f'))](_0x0128('0x20'));}}else{return _0x5a42eb;}}function respondWithRpcPromise(_0x10baa,_0x300554,_0x5bdc3e,_0x2524b1){return new BPromise(function(_0x18a955,_0x1a5818){var _0x431b13=_0x2524b1||client;return _0x431b13[_0x0128('0x21')](_0x10baa,_0x5bdc3e)[_0x0128('0x22')](function(_0x5a8a8f){logger[_0x0128('0x23')](_0x0128('0x24'),_0x300554,'request\x20sent');logger['debug'](_0x0128('0x25'),_0x300554,_0x0128('0x26'),JSON[_0x0128('0x27')](_0x5a8a8f));if(_0x5a8a8f[_0x0128('0x28')]){if(_0x5a8a8f[_0x0128('0x28')][_0x0128('0x29')]===0x1f4){logger[_0x0128('0x28')](_0x0128('0x24'),_0x300554,_0x5a8a8f['error']['message']);return _0x1a5818(_0x5a8a8f[_0x0128('0x28')]['message']);}logger[_0x0128('0x28')](_0x0128('0x24'),_0x300554,_0x5a8a8f[_0x0128('0x28')]['message']);return _0x18a955(_0x5a8a8f[_0x0128('0x28')]['message']);}else{logger[_0x0128('0x23')](_0x0128('0x24'),_0x300554,_0x0128('0x26'));_0x18a955(_0x5a8a8f[_0x0128('0x2a')][_0x0128('0x2b')]);}})['catch'](function(_0x14cd68){logger[_0x0128('0x28')]('SmsAccount,\x20%s,\x20%s',_0x300554,_0x14cd68);_0x1a5818(_0x14cd68);});});}function respondWithStatusCode(_0x2b1819,_0x976553){_0x976553=_0x976553||0xcc;return function(_0x4ee634){if(_0x4ee634){return _0x2b1819[_0x0128('0x2c')](_0x976553);}return _0x2b1819[_0x0128('0x2d')](_0x976553)[_0x0128('0x2e')]();};}function respondWithResult(_0x555b25,_0x5b7ab2){_0x5b7ab2=_0x5b7ab2||0xc8;return function(_0x3340ac){if(_0x3340ac){return _0x555b25['status'](_0x5b7ab2)['json'](_0x3340ac);}};}function respondWithFilteredResult(_0x5f07c7,_0x28b27c){return function(_0x4d32e3){if(_0x4d32e3){var _0x4449b9=_0x4d32e3['count'],_0x2b9f40=_0x28b27c[_0x0128('0x2f')],_0x345023=_0x28b27c[_0x0128('0x2f')]+_0x28b27c[_0x0128('0x30')],_0x41f198;if(_0x345023>=_0x4449b9){_0x345023=_0x4449b9;_0x41f198=0xc8;}else{_0x41f198=0xce;}_0x5f07c7[_0x0128('0x2d')](_0x41f198);return _0x5f07c7['set'](_0x0128('0x31'),_0x2b9f40+'-'+_0x345023+'/'+_0x4449b9)[_0x0128('0x32')](_0x4d32e3);}return null;};}function patchUpdates(_0x32d622){return function(_0x20f35f){try{jsonpatch[_0x0128('0x33')](_0x20f35f,_0x32d622,!![]);}catch(_0x1c4fcf){return BPromise[_0x0128('0x34')](_0x1c4fcf);}return _0x20f35f['save']();};}function saveUpdates(_0x4c2903,_0x47d63d){return function(_0xee41c7){if(_0xee41c7){return _0xee41c7[_0x0128('0x35')](_0x4c2903)[_0x0128('0x22')](function(_0x5f161a){return _0x5f161a;});}return null;};}function removeEntity(_0x105080,_0x5bf52c){return function(_0x2883e3){if(_0x2883e3){return _0x2883e3[_0x0128('0x36')]()[_0x0128('0x22')](function(){var _0x46d5a8=_0x2883e3['get']({'plain':!![]});var _0x5b354e=_0x0128('0x37');return db[_0x0128('0x38')][_0x0128('0x36')]({'where':{'type':_0x5b354e,'resourceId':_0x46d5a8['id']}})[_0x0128('0x22')](function(){return _0x2883e3;});})['then'](function(){_0x105080['status'](0xcc)[_0x0128('0x2e')]();});}};}function handleEntityNotFound(_0x313da8,_0x3898a5){return function(_0xc7a20){if(!_0xc7a20){_0x313da8[_0x0128('0x2c')](0x194);}return _0xc7a20;};}function handleError(_0x478d57,_0xe72ce4){_0xe72ce4=_0xe72ce4||0x1f4;return function(_0x39f32d){logger[_0x0128('0x28')](_0x39f32d['stack']);if(_0x39f32d['name']){delete _0x39f32d[_0x0128('0x39')];}_0x478d57[_0x0128('0x2d')](_0xe72ce4)[_0x0128('0x3a')](_0x39f32d);};}exports[_0x0128('0x3b')]=function(_0x29da11,_0x5b3671){var _0x22e60f={'include':[{'model':db[_0x0128('0x3c')],'as':_0x0128('0x3d')}]},_0x394252={},_0x544664={'count':0x0,'rows':[]};var _0x53484b=_[_0x0128('0x3e')](db['SmsAccount'][_0x0128('0x3f')],function(_0x46a27a){return{'name':_0x46a27a[_0x0128('0x40')],'type':_0x46a27a[_0x0128('0x41')][_0x0128('0x42')]};});_0x394252[_0x0128('0x43')]=_['map'](_0x53484b,'name');_0x394252[_0x0128('0x44')]=_['keys'](_0x29da11['query']);_0x394252[_0x0128('0x45')]=_['intersection'](_0x394252[_0x0128('0x43')],_0x394252[_0x0128('0x44')]);_0x22e60f[_0x0128('0x46')]=_[_0x0128('0x47')](_0x394252[_0x0128('0x43')],qs[_0x0128('0x48')](_0x29da11[_0x0128('0x44')][_0x0128('0x48')]));_0x22e60f[_0x0128('0x46')]=_0x22e60f[_0x0128('0x46')][_0x0128('0x49')]?_0x22e60f[_0x0128('0x46')]:_0x394252[_0x0128('0x43')];if(!_0x29da11['query'][_0x0128('0x4a')](_0x0128('0x4b'))){_0x22e60f['limit']=qs[_0x0128('0x30')](_0x29da11[_0x0128('0x44')][_0x0128('0x30')]);_0x22e60f[_0x0128('0x2f')]=qs[_0x0128('0x2f')](_0x29da11['query'][_0x0128('0x2f')]);}_0x22e60f[_0x0128('0x4c')]=qs[_0x0128('0x4d')](_0x29da11[_0x0128('0x44')][_0x0128('0x4d')]);_0x22e60f[_0x0128('0x4e')]=qs[_0x0128('0x45')](_[_0x0128('0x4f')](_0x29da11[_0x0128('0x44')],_0x394252['filters']));if(_0x29da11[_0x0128('0x44')]['filter']){_0x22e60f[_0x0128('0x4e')]=_[_0x0128('0x50')](_0x22e60f[_0x0128('0x4e')],{'$or':_[_0x0128('0x3e')](_0x53484b,function(_0x39be19){if(_0x39be19[_0x0128('0x41')]!==_0x0128('0x51')){var _0x4789b2={};_0x4789b2[_0x39be19['name']]={'$like':'%'+_0x29da11['query'][_0x0128('0x52')]+'%'};return _0x4789b2;}})});}_0x22e60f=_[_0x0128('0x50')]({},_0x22e60f,_0x29da11['options']);var _0x1b4cf3={'where':_0x22e60f[_0x0128('0x4e')]};return db['SmsAccount'][_0x0128('0x53')](_0x1b4cf3)[_0x0128('0x22')](function(_0x3f1b2f){_0x544664[_0x0128('0x53')]=_0x3f1b2f;if(_0x29da11['query']['includeAll']){_0x22e60f[_0x0128('0x54')]=[{'all':!![]}];}return db['SmsAccount'][_0x0128('0x55')](_0x22e60f);})['then'](function(_0x1338d9){_0x544664[_0x0128('0x56')]=_0x1338d9;return _0x544664;})[_0x0128('0x22')](respondWithFilteredResult(_0x5b3671,_0x22e60f))[_0x0128('0x57')](handleError(_0x5b3671,null));};exports['show']=function(_0x3c1ce4,_0x43cbbb){var _0x31c7d1={'raw':![],'where':{'id':_0x3c1ce4[_0x0128('0x58')]['id']},'include':[{'model':db['Pause'],'as':_0x0128('0x3d')}]},_0x2be4aa={};_0x2be4aa[_0x0128('0x43')]=_[_0x0128('0x59')](db[_0x0128('0x5a')][_0x0128('0x3f')]);_0x2be4aa['query']=_['keys'](_0x3c1ce4[_0x0128('0x44')]);_0x2be4aa['filters']=_[_0x0128('0x47')](_0x2be4aa['model'],_0x2be4aa[_0x0128('0x44')]);_0x31c7d1[_0x0128('0x46')]=_['intersection'](_0x2be4aa['model'],qs[_0x0128('0x48')](_0x3c1ce4[_0x0128('0x44')][_0x0128('0x48')]));_0x31c7d1[_0x0128('0x46')]=_0x31c7d1['attributes'][_0x0128('0x49')]?_0x31c7d1[_0x0128('0x46')]:_0x2be4aa[_0x0128('0x43')];if(_0x3c1ce4[_0x0128('0x44')][_0x0128('0x5b')]){_0x31c7d1['include']=[{'all':!![]}];}_0x31c7d1=_['merge']({},_0x31c7d1,_0x3c1ce4[_0x0128('0x5c')]);return db[_0x0128('0x5a')]['find'](_0x31c7d1)[_0x0128('0x22')](handleEntityNotFound(_0x43cbbb,null))[_0x0128('0x22')](respondWithResult(_0x43cbbb,null))['catch'](handleError(_0x43cbbb,null));};exports[_0x0128('0x5d')]=function(_0x1b0b5b,_0xb4cb4f){return db[_0x0128('0x5a')][_0x0128('0x5d')](_0x1b0b5b[_0x0128('0x5e')],{})[_0x0128('0x22')](function(_0x553beb){var _0x5531ec=_0x1b0b5b[_0x0128('0x5f')][_0x0128('0x60')]({'plain':!![]});if(!_0x5531ec)throw new Error(_0x0128('0x61'));if(_0x5531ec[_0x0128('0x62')]===_0x0128('0x5f')){var _0x2036b7=_0x553beb[_0x0128('0x60')]({'plain':!![]});var _0x113439=_0x0128('0x37');return db[_0x0128('0x63')][_0x0128('0x64')]({'where':{'name':_0x113439,'userProfileId':_0x5531ec['userProfileId']},'raw':!![]})[_0x0128('0x22')](function(_0x6808c4){if(_0x6808c4&&_0x6808c4[_0x0128('0x65')]===0x0){return db[_0x0128('0x38')][_0x0128('0x5d')]({'name':_0x2036b7['name'],'resourceId':_0x2036b7['id'],'type':_0x6808c4['name'],'sectionId':_0x6808c4['id']},{})['then'](function(){return _0x553beb;});}else{return _0x553beb;}})[_0x0128('0x57')](function(_0x28db23){logger[_0x0128('0x28')](_0x0128('0x66'),_0x28db23);throw _0x28db23;});}return _0x553beb;})[_0x0128('0x22')](respondWithResult(_0xb4cb4f,0xc9))[_0x0128('0x57')](handleError(_0xb4cb4f,null));};exports['update']=function(_0x46726a,_0x443e05){if(_0x46726a[_0x0128('0x5e')]['id']){delete _0x46726a['body']['id'];}return db['SmsAccount'][_0x0128('0x64')]({'where':{'id':_0x46726a['params']['id']},'include':[{'model':db['Pause'],'as':_0x0128('0x3d')}]})['then'](handleEntityNotFound(_0x443e05,null))['then'](saveUpdates(_0x46726a[_0x0128('0x5e')],null))[_0x0128('0x22')](respondWithResult(_0x443e05,null))[_0x0128('0x57')](handleError(_0x443e05,null));};exports[_0x0128('0x36')]=function(_0x2752d6,_0x22b48d){return db[_0x0128('0x5a')][_0x0128('0x64')]({'where':{'id':_0x2752d6['params']['id']}})[_0x0128('0x22')](handleEntityNotFound(_0x22b48d,null))[_0x0128('0x22')](removeEntity(_0x22b48d,null))[_0x0128('0x57')](handleError(_0x22b48d,null));};exports[_0x0128('0x67')]=function(_0x4e29a6,_0xccaac0){return db[_0x0128('0x5a')][_0x0128('0x67')]()[_0x0128('0x22')](respondWithResult(_0xccaac0,null))['catch'](handleError(_0xccaac0,null));};exports[_0x0128('0x68')]=function(_0x174a03,_0x28dfa8,_0x25183a){if(_0x174a03[_0x0128('0x5e')]['id']){delete _0x174a03[_0x0128('0x5e')]['id'];}return db[_0x0128('0x5a')][_0x0128('0x64')]({'where':{'id':_0x174a03['params']['id']}})[_0x0128('0x22')](handleEntityNotFound(_0x28dfa8,null))['then'](function(_0x5355ad){if(_0x5355ad){_0x174a03[_0x0128('0x5e')][_0x0128('0x69')]=_0x5355ad['id'];return db[_0x0128('0x6a')][_0x0128('0x5d')](_0x174a03[_0x0128('0x5e')]);}})['then'](respondWithResult(_0x28dfa8,null))['catch'](handleError(_0x28dfa8,null));};exports['getDispositions']=function(_0x4bc2b6,_0x36743e,_0x554fa6){var _0x5f44d7={'raw':![],'where':{}};var _0x30e0fe={};var _0x25bb0b={'count':0x0,'rows':[]};return db['SmsAccount'][_0x0128('0x6b')]({'where':{'id':_0x4bc2b6['params']['id']}})['then'](handleEntityNotFound(_0x36743e,null))[_0x0128('0x22')](function(_0x1efe55){if(_0x1efe55){_0x30e0fe['model']=_[_0x0128('0x59')](db['Disposition'][_0x0128('0x3f')]);_0x30e0fe[_0x0128('0x44')]=_['keys'](_0x4bc2b6[_0x0128('0x44')]);_0x30e0fe[_0x0128('0x45')]=_[_0x0128('0x47')](_0x30e0fe['model'],_0x30e0fe[_0x0128('0x44')]);_0x5f44d7[_0x0128('0x46')]=_[_0x0128('0x47')](_0x30e0fe[_0x0128('0x43')],qs[_0x0128('0x48')](_0x4bc2b6[_0x0128('0x44')][_0x0128('0x48')]));_0x5f44d7['attributes']=_0x5f44d7[_0x0128('0x46')][_0x0128('0x49')]?_0x5f44d7[_0x0128('0x46')]:_0x30e0fe[_0x0128('0x43')];if(!_0x4bc2b6[_0x0128('0x44')]['hasOwnProperty'](_0x0128('0x4b'))){_0x5f44d7[_0x0128('0x30')]=qs['limit'](_0x4bc2b6[_0x0128('0x44')]['limit']);_0x5f44d7['offset']=qs[_0x0128('0x2f')](_0x4bc2b6[_0x0128('0x44')][_0x0128('0x2f')]);}_0x5f44d7['order']=qs[_0x0128('0x4d')](_0x4bc2b6['query'][_0x0128('0x4d')]);_0x5f44d7[_0x0128('0x4e')]=qs[_0x0128('0x45')](_[_0x0128('0x4f')](_0x4bc2b6[_0x0128('0x44')],_0x30e0fe[_0x0128('0x45')]));_0x5f44d7['where'][_0x0128('0x69')]=_0x1efe55['id'];if(_0x4bc2b6[_0x0128('0x44')][_0x0128('0x52')]){_0x5f44d7[_0x0128('0x4e')]=_['merge'](_0x5f44d7['where'],{'$or':_[_0x0128('0x3e')](_0x5f44d7[_0x0128('0x46')],function(_0xd35f33){var _0x1631b1={};_0x1631b1[_0xd35f33]={'$like':'%'+_0x4bc2b6[_0x0128('0x44')][_0x0128('0x52')]+'%'};return _0x1631b1;})});}_0x5f44d7=_['merge']({},_0x5f44d7,_0x4bc2b6[_0x0128('0x5c')]);return db['Disposition'][_0x0128('0x53')]({'where':_0x5f44d7[_0x0128('0x4e')]})[_0x0128('0x22')](function(_0x58190b){_0x25bb0b['count']=_0x58190b;if(_0x4bc2b6['query']['includeAll']){_0x5f44d7[_0x0128('0x54')]=[{'all':!![]}];}return db[_0x0128('0x6a')][_0x0128('0x55')](_0x5f44d7);})[_0x0128('0x22')](function(_0x50bef9){_0x25bb0b[_0x0128('0x56')]=_0x50bef9;return _0x25bb0b;});}})[_0x0128('0x22')](respondWithFilteredResult(_0x36743e,_0x5f44d7))['catch'](handleError(_0x36743e,null));};exports[_0x0128('0x6c')]=function(_0x13fdcf,_0x2440bb,_0x2d1851){return db[_0x0128('0x5a')][_0x0128('0x64')]({'where':{'id':_0x13fdcf[_0x0128('0x58')]['id']}})[_0x0128('0x22')](handleEntityNotFound(_0x2440bb,null))[_0x0128('0x22')](function(_0x60368d){if(_0x60368d){return _0x60368d['removeDispositions'](_0x13fdcf[_0x0128('0x44')][_0x0128('0x6d')]);}})[_0x0128('0x22')](respondWithStatusCode(_0x2440bb,null))['catch'](handleError(_0x2440bb,null));};exports[_0x0128('0x6e')]=function(_0x2a06df,_0x4b25df,_0x4d8cca){if(_0x2a06df[_0x0128('0x5e')]['id']){delete _0x2a06df['body']['id'];}return db[_0x0128('0x5a')][_0x0128('0x64')]({'where':{'id':_0x2a06df[_0x0128('0x58')]['id']}})['then'](handleEntityNotFound(_0x4b25df,null))[_0x0128('0x22')](function(_0x973095){if(_0x973095){_0x2a06df[_0x0128('0x5e')]['SmsAccountId']=_0x973095['id'];return db['CannedAnswer'][_0x0128('0x5d')](_0x2a06df[_0x0128('0x5e')]);}})['then'](respondWithResult(_0x4b25df,null))[_0x0128('0x57')](handleError(_0x4b25df,null));};exports[_0x0128('0x6f')]=function(_0x31da4d,_0x108d6f,_0x1ed5e5){var _0x5eb042={'raw':![],'where':{}};var _0x412a88={};var _0x54662d={'count':0x0,'rows':[]};return db[_0x0128('0x5a')][_0x0128('0x6b')]({'where':{'id':_0x31da4d[_0x0128('0x58')]['id']}})['then'](handleEntityNotFound(_0x108d6f,null))[_0x0128('0x22')](function(_0x38b283){if(_0x38b283){_0x412a88[_0x0128('0x43')]=_[_0x0128('0x59')](db['CannedAnswer']['rawAttributes']);_0x412a88[_0x0128('0x44')]=_['keys'](_0x31da4d[_0x0128('0x44')]);_0x412a88[_0x0128('0x45')]=_[_0x0128('0x47')](_0x412a88['model'],_0x412a88[_0x0128('0x44')]);_0x5eb042[_0x0128('0x46')]=_[_0x0128('0x47')](_0x412a88[_0x0128('0x43')],qs[_0x0128('0x48')](_0x31da4d[_0x0128('0x44')][_0x0128('0x48')]));_0x5eb042[_0x0128('0x46')]=_0x5eb042[_0x0128('0x46')][_0x0128('0x49')]?_0x5eb042[_0x0128('0x46')]:_0x412a88[_0x0128('0x43')];if(!_0x31da4d[_0x0128('0x44')][_0x0128('0x4a')](_0x0128('0x4b'))){_0x5eb042[_0x0128('0x30')]=qs[_0x0128('0x30')](_0x31da4d[_0x0128('0x44')][_0x0128('0x30')]);_0x5eb042['offset']=qs[_0x0128('0x2f')](_0x31da4d[_0x0128('0x44')]['offset']);}_0x5eb042[_0x0128('0x4c')]=qs['sort'](_0x31da4d[_0x0128('0x44')]['sort']);_0x5eb042[_0x0128('0x4e')]=qs[_0x0128('0x45')](_[_0x0128('0x4f')](_0x31da4d[_0x0128('0x44')],_0x412a88[_0x0128('0x45')]));_0x5eb042['where']['SmsAccountId']=_0x38b283['id'];if(_0x31da4d[_0x0128('0x44')][_0x0128('0x52')]){_0x5eb042[_0x0128('0x4e')]=_[_0x0128('0x50')](_0x5eb042[_0x0128('0x4e')],{'$or':_[_0x0128('0x3e')](_0x5eb042['attributes'],function(_0x2d2310){var _0x47888c={};_0x47888c[_0x2d2310]={'$like':'%'+_0x31da4d[_0x0128('0x44')][_0x0128('0x52')]+'%'};return _0x47888c;})});}_0x5eb042=_[_0x0128('0x50')]({},_0x5eb042,_0x31da4d[_0x0128('0x5c')]);return db[_0x0128('0x70')][_0x0128('0x53')]({'where':_0x5eb042[_0x0128('0x4e')]})[_0x0128('0x22')](function(_0x580cce){_0x54662d[_0x0128('0x53')]=_0x580cce;if(_0x31da4d[_0x0128('0x44')][_0x0128('0x5b')]){_0x5eb042[_0x0128('0x54')]=[{'all':!![]}];}return db[_0x0128('0x70')][_0x0128('0x55')](_0x5eb042);})[_0x0128('0x22')](function(_0x1046a3){_0x54662d[_0x0128('0x56')]=_0x1046a3;return _0x54662d;});}})[_0x0128('0x22')](respondWithFilteredResult(_0x108d6f,_0x5eb042))[_0x0128('0x57')](handleError(_0x108d6f,null));};exports[_0x0128('0x71')]=function(_0x23d67b,_0x3eaf21,_0x1f7e1a){return db['SmsAccount'][_0x0128('0x64')]({'where':{'id':_0x23d67b['params']['id']}})['then'](handleEntityNotFound(_0x3eaf21,null))[_0x0128('0x22')](function(_0x89f67d){if(_0x89f67d){return _0x89f67d[_0x0128('0x71')](_0x23d67b['query'][_0x0128('0x6d')]);}})[_0x0128('0x22')](respondWithStatusCode(_0x3eaf21,null))[_0x0128('0x57')](handleError(_0x3eaf21,null));};exports[_0x0128('0x72')]=function(_0x34c612,_0x4bf4d8,_0x2a8ddf){var _0x44cab3={'channel':'sms'};var _0x1d5861=[];var _0x4639c0=[];var _0x5ee1ee={};return db['SmsAccount'][_0x0128('0x64')]({'where':{'id':_0x34c612[_0x0128('0x58')]['id']},'include':[{'model':db['SmsApplication'],'as':_0x0128('0x73')}]})[_0x0128('0x22')](handleEntityNotFound(_0x4bf4d8,null))[_0x0128('0x22')](function(_0x4ee7dd){_0x44cab3[_0x0128('0x74')]=_0x4ee7dd;_0x44cab3[_0x0128('0x75')]=_[_0x0128('0x76')](_0x4ee7dd[_0x0128('0x73')],[_0x0128('0x77')],['asc']);if(_0x44cab3[_0x0128('0x74')][_0x0128('0x73')]){delete _0x44cab3[_0x0128('0x74')][_0x0128('0x73')];}return db[_0x0128('0x78')]['describe']();})[_0x0128('0x22')](function(_0x5e3ca9){if(!_0x5e3ca9){throw new db[(_0x0128('0x1e'))][(_0x0128('0x1f'))](_0x0128('0x79'));}_0x1d5861=_[_0x0128('0x7a')](_[_0x0128('0x59')](_0x5e3ca9),[_0x0128('0x7b'),_0x0128('0x7c')]);_0x4639c0=_[_0x0128('0x7a')](_[_0x0128('0x59')](_0x5e3ca9),[_0x0128('0x7b'),_0x0128('0x7c'),_0x0128('0x7d'),_0x0128('0x7e')]);_0x44cab3[_0x0128('0x5e')]={'mapKey':_0x0128('0x7f')};if(_0x44cab3[_0x0128('0x74')][_0x0128('0x41')]){switch(_0x44cab3['account']['type']){case _0x0128('0x80'):_0x44cab3[_0x0128('0x5e')][_0x0128('0x81')]=_0x34c612[_0x0128('0x5e')][_0x0128('0x82')];_0x44cab3[_0x0128('0x5e')][_0x0128('0x5e')]=_0x34c612[_0x0128('0x5e')][_0x0128('0x83')];_0x44cab3['body'][_0x0128('0x84')]=_0x34c612[_0x0128('0x5e')][_0x0128('0x85')];break;case _0x0128('0x86'):_0x44cab3[_0x0128('0x5e')][_0x0128('0x81')]='+'+_0x34c612[_0x0128('0x5e')][_0x0128('0x87')];_0x44cab3[_0x0128('0x5e')][_0x0128('0x5e')]=_0x34c612['body'][_0x0128('0x88')];break;case'connectel':_0x44cab3[_0x0128('0x5e')][_0x0128('0x81')]=_0x34c612[_0x0128('0x5e')]['from'];_0x44cab3[_0x0128('0x5e')][_0x0128('0x5e')]=_0x34c612[_0x0128('0x5e')][_0x0128('0x2b')];break;case'clicksend':_0x44cab3[_0x0128('0x5e')][_0x0128('0x81')]=_0x34c612['body'][_0x0128('0x81')];_0x44cab3[_0x0128('0x5e')]['body']=_0x34c612[_0x0128('0x5e')]['body'];_0x44cab3[_0x0128('0x5e')][_0x0128('0x84')]=_0x34c612[_0x0128('0x5e')][_0x0128('0x89')];break;case _0x0128('0x8a'):_0x44cab3[_0x0128('0x5e')][_0x0128('0x81')]=_0x34c612['body'][_0x0128('0x82')];_0x44cab3['body'][_0x0128('0x5e')]=_0x34c612[_0x0128('0x5e')][_0x0128('0x8b')];_0x44cab3[_0x0128('0x5e')][_0x0128('0x84')]=_0x34c612[_0x0128('0x5e')]['MessageUUID'];break;case _0x0128('0x8c'):_0x44cab3[_0x0128('0x5e')][_0x0128('0x81')]='+'+_0x34c612[_0x0128('0x5e')][_0x0128('0x8d')][0x0][_0x0128('0x81')];_0x44cab3[_0x0128('0x5e')][_0x0128('0x5e')]=_0x34c612[_0x0128('0x5e')][_0x0128('0x8d')][0x0][_0x0128('0x88')];_0x44cab3[_0x0128('0x5e')][_0x0128('0x84')]=_0x34c612['body']['results'][0x0][_0x0128('0x84')];break;case _0x0128('0x8e'):_0x44cab3[_0x0128('0x5e')][_0x0128('0x81')]=_0x34c612[_0x0128('0x5e')][_0x0128('0x8f')];_0x44cab3[_0x0128('0x5e')][_0x0128('0x5e')]=_0x34c612['body']['segmentedMessage'][_0x0128('0x2b')];break;case _0x0128('0x90'):_0x44cab3[_0x0128('0x5e')][_0x0128('0x81')]=_0x34c612[_0x0128('0x5e')][_0x0128('0x91')];_0x44cab3[_0x0128('0x5e')][_0x0128('0x5e')]=_0x34c612[_0x0128('0x5e')]['text'];_0x44cab3[_0x0128('0x5e')][_0x0128('0x84')]=_0x34c612[_0x0128('0x5e')][_0x0128('0x92')];break;case _0x0128('0x93'):_0x44cab3[_0x0128('0x5e')][_0x0128('0x81')]=_0x34c612[_0x0128('0x5e')]['from'];_0x44cab3['body'][_0x0128('0x5e')]=_0x34c612[_0x0128('0x5e')]['message'];_0x44cab3[_0x0128('0x5e')]['messageId']=_0x34c612[_0x0128('0x5e')]['refid'];break;}}if(_0x44cab3[_0x0128('0x5e')]['id']){delete _0x44cab3[_0x0128('0x5e')]['id'];}if(_[_0x0128('0x94')](_0x44cab3[_0x0128('0x5e')]['from'])){throw new db['Sequelize']['ValidationError']('from\x20is\x20mandatory');}if(_['isNil'](_0x44cab3['body'][_0x0128('0x5e')])||_0x44cab3[_0x0128('0x5e')][_0x0128('0x5e')]===''){throw new db[(_0x0128('0x1e'))][(_0x0128('0x1f'))](_0x0128('0x95'));}if(_[_0x0128('0x94')](_0x44cab3[_0x0128('0x5e')][_0x0128('0x96')])){throw new db[(_0x0128('0x1e'))]['ValidationError'](_0x0128('0x97')+_0x4639c0);}if(!_['includes'](_0x4639c0,_0x44cab3[_0x0128('0x5e')][_0x0128('0x96')])){throw new db[(_0x0128('0x1e'))]['ValidationError'](_0x0128('0x98')+_0x4639c0);}_0x5ee1ee[_0x44cab3[_0x0128('0x5e')][_0x0128('0x96')]]=_0x44cab3[_0x0128('0x5e')][_0x0128('0x81')];return db[_0x0128('0x99')][_0x0128('0x64')]({'where':{'id':_0x44cab3[_0x0128('0x74')][_0x0128('0x7e')]},'include':[{'model':db[_0x0128('0x78')],'as':'Contacts','where':_0x5ee1ee,'limit':0x1,'order':[['updatedAt',_0x0128('0x9a')]]}]});})[_0x0128('0x22')](handleEntityNotFound(_0x4bf4d8,null))['then'](function(_0xda67a6){if(_0xda67a6){_0x44cab3[_0x0128('0x9b')]=_[_0x0128('0x9c')](_0xda67a6,[_0x0128('0x9d')]);if(_0xda67a6[_0x0128('0x9d')][_0x0128('0x49')]){return _0xda67a6[_0x0128('0x9d')][0x0];}var _0x31696c=_[_0x0128('0x9e')](_0x44cab3[_0x0128('0x5e')],{'firstName':_0x44cab3[_0x0128('0x5e')][_0x0128('0x81')],'ListId':_0xda67a6['id']});_0x31696c[_0x44cab3[_0x0128('0x5e')][_0x0128('0x96')]]=_0x44cab3[_0x0128('0x5e')][_0x0128('0x81')];return db[_0x0128('0x78')][_0x0128('0x5d')](_0x31696c,{'fields':_0x1d5861,'raw':!![]});}})[_0x0128('0x22')](handleEntityNotFound(_0x4bf4d8,null))[_0x0128('0x22')](function(_0x317d7c){if(_0x317d7c){_0x44cab3[_0x0128('0x9f')]=_0x317d7c;var _0xac850f={'ContactId':_0x317d7c['id'],'phone':_0x44cab3['body']['from'],'SmsAccountId':_0x34c612['params']['id']};var _0x50e5e8={'ContactId':_0x317d7c['id'],'SmsAccountId':_0x34c612['params']['id'],'closed':![]};return db[_0x0128('0xa0')][_0x0128('0x64')]({'where':_0x50e5e8})[_0x0128('0x22')](function(_0x1ef396){if(_0x1ef396){return[_0x1ef396,![]];}return db[_0x0128('0xa0')][_0x0128('0x5d')](_0xac850f)[_0x0128('0x22')](function(_0x1c27c2){return[_0x1c27c2,!![]];});});}})[_0x0128('0xa1')](function(_0x7a67e,_0x2374f3){_0x44cab3[_0x0128('0xa2')]=_0x7a67e[_0x0128('0x60')]({'plain':!![]});_0x44cab3[_0x0128('0xa2')][_0x0128('0xa3')]=![];if(_0x2374f3){if(_0x44cab3[_0x0128('0x74')][_0x0128('0xa4')]){_0x44cab3['applications'][_0x0128('0xa5')]({'id':0x0,'priority':_0x44cab3[_0x0128('0x75')]['length']+0x1,'app':_0x0128('0xa6'),'appdata':_0x0128('0xa7'),'interval':'*,*,*,*'});}_0x44cab3[_0x0128('0xa2')][_0x0128('0xa3')]=!![];}return db[_0x0128('0xa8')]['create']({'phone':_0x44cab3['body']['from'],'messageId':_0x44cab3[_0x0128('0x5e')]['messageId'],'body':_0x44cab3[_0x0128('0x5e')][_0x0128('0x5e')],'SmsAccountId':_0x34c612[_0x0128('0x58')]['id'],'SmsInteractionId':_0x7a67e['id'],'direction':'in','ContactId':_0x7a67e[_0x0128('0xa9')],'AttachmentId':_0x44cab3['body'][_0x0128('0xaa')]});})['then'](function(_0x369122){_0x44cab3[_0x0128('0x2b')]=_0x369122;if(_0x44cab3['interaction']['UserId']){return db[_0x0128('0xab')][_0x0128('0x64')]({'attributes':['id',_0x0128('0x39')],'where':{'id':_0x44cab3[_0x0128('0xa2')]['UserId']}})[_0x0128('0x22')](function(_0x444da5){if(_0x444da5){_0x44cab3[_0x0128('0x75')][_0x0128('0xac')]({'id':0x0,'priority':0x0,'app':_0x0128('0xad'),'appdata':_0x444da5['name']+','+(_0x44cab3[_0x0128('0x74')][_0x0128('0xae')]||0xa),'interval':_0x0128('0xaf')});}return respondWithRpcPromise(_0x0128('0xb0'),_0x0128('0xb1'),_0x44cab3);});}return respondWithRpcPromise(_0x0128('0xb0'),'startRouting',_0x44cab3);})[_0x0128('0x22')](function(_0x284005){if(_0x284005){var _0x3f3848=0xc8;var _0x19c32a='receiveMessage';logger[_0x0128('0x23')](_0x0128('0x25'),_0x19c32a,_0x3f3848,_0x0128('0xb2'));logger[_0x0128('0xb3')](_0x0128('0xb4'),_0x19c32a,_0x3f3848,'entity\x20found',JSON[_0x0128('0x27')](_0x284005));if(_0x44cab3[_0x0128('0x74')][_0x0128('0x41')]===_0x0128('0x80')){return _0x4bf4d8['status'](_0x3f3848)[_0x0128('0xb5')]('Content-Type',_0x0128('0xb6'))[_0x0128('0x3a')](_0x0128('0xb7'));}else{return _0x4bf4d8[_0x0128('0x2d')](_0x3f3848)[_0x0128('0x32')](_0x284005);}}})[_0x0128('0x57')](handleError(_0x4bf4d8,null));};exports[_0x0128('0xb8')]=function(_0x3bb2c4,_0x26d5a3,_0x436b9a){return db[_0x0128('0x5a')][_0x0128('0x6b')]({'where':{'id':_0x3bb2c4[_0x0128('0x58')]['id']}})[_0x0128('0x22')](handleEntityNotFound(_0x26d5a3,null))[_0x0128('0x22')](function(_0x1933c8){if(_0x1933c8){return db[_0x0128('0xb9')][_0x0128('0xba')](function(_0x40b381){return db[_0x0128('0xbb')][_0x0128('0x36')]({'where':{'SmsAccountId':_0x3bb2c4[_0x0128('0x58')]['id']},'transaction':_0x40b381})[_0x0128('0x22')](function(_0x2169f9){var _0x966f1e=_['map'](_0x3bb2c4[_0x0128('0x5e')],function(_0x2dfd73){_0x2dfd73['SmsAccountId']=_0x3bb2c4[_0x0128('0x58')]['id'];return _0x2dfd73;});return db[_0x0128('0xbb')][_0x0128('0xbc')](_0x966f1e,{'transaction':_0x40b381});});})[_0x0128('0x22')](function(){return db[_0x0128('0xbb')]['findAndCountAll']({'where':{'SmsAccountId':_0x3bb2c4[_0x0128('0x58')]['id']},'order':_0x0128('0x77')});});}})[_0x0128('0x22')](respondWithResult(_0x26d5a3,null))[_0x0128('0x57')](handleError(_0x26d5a3,null));};exports[_0x0128('0xbd')]=function(_0x169037,_0x391d2e,_0x3f2846){var _0x1882d9={};var _0xef9949={};var _0x44db3f;var _0x404ada;return db[_0x0128('0x5a')]['findOne']({'where':{'id':_0x169037[_0x0128('0x58')]['id']}})[_0x0128('0x22')](handleEntityNotFound(_0x391d2e,null))['then'](function(_0xf5d7fe){if(_0xf5d7fe){_0x44db3f=_0xf5d7fe;_0xef9949[_0x0128('0x43')]=_[_0x0128('0x59')](db[_0x0128('0xbb')][_0x0128('0x3f')]);_0xef9949['query']=_[_0x0128('0x59')](_0x169037[_0x0128('0x44')]);_0xef9949['filters']=_[_0x0128('0x47')](_0xef9949[_0x0128('0x43')],_0xef9949[_0x0128('0x44')]);_0x1882d9[_0x0128('0x46')]=_[_0x0128('0x47')](_0xef9949[_0x0128('0x43')],qs['fields'](_0x169037[_0x0128('0x44')][_0x0128('0x48')]));_0x1882d9[_0x0128('0x46')]=_0x1882d9['attributes'][_0x0128('0x49')]?_0x1882d9[_0x0128('0x46')]:_0xef9949['model'];_0x1882d9[_0x0128('0x4c')]=qs['sort'](_0x169037[_0x0128('0x44')]['sort']);_0x1882d9[_0x0128('0x4e')]=qs[_0x0128('0x45')](_[_0x0128('0x4f')](_0x169037[_0x0128('0x44')],_0xef9949[_0x0128('0x45')]));if(_0x169037[_0x0128('0x44')][_0x0128('0x52')]){_0x1882d9['where']=_['merge'](_0x1882d9[_0x0128('0x4e')],{'$or':_['map'](_0x1882d9[_0x0128('0x46')],function(_0x4e4e9f){var _0x5f4d75={};_0x5f4d75[_0x4e4e9f]={'$like':'%'+_0x169037[_0x0128('0x44')][_0x0128('0x52')]+'%'};return _0x5f4d75;})});}_0x1882d9=_[_0x0128('0x50')]({},_0x1882d9,_0x169037[_0x0128('0x5c')]);return _0x44db3f[_0x0128('0xbd')](_0x1882d9);}})['then'](function(_0x425cea){if(_0x425cea){_0x404ada=_0x425cea['length'];if(!_0x169037[_0x0128('0x44')][_0x0128('0x4a')](_0x0128('0x4b'))){_0x1882d9['limit']=qs[_0x0128('0x30')](_0x169037[_0x0128('0x44')][_0x0128('0x30')]);_0x1882d9['offset']=qs['offset'](_0x169037[_0x0128('0x44')][_0x0128('0x2f')]);}return _0x44db3f['getApplications'](_0x1882d9);}})[_0x0128('0x22')](function(_0x3e9c9d){if(_0x3e9c9d){return _0x3e9c9d?{'count':_0x404ada,'rows':_0x3e9c9d}:null;}})[_0x0128('0x22')](respondWithResult(_0x391d2e,null))[_0x0128('0x57')](handleError(_0x391d2e,null));};exports[_0x0128('0xbe')]=function(_0x3e4c17,_0x3bf172,_0x353151){var _0x1eed4a={'raw':![],'where':{}};var _0x4f66ff={};var _0x54c891={'count':0x0,'rows':[]};return db['SmsAccount'][_0x0128('0x6b')]({'where':{'id':_0x3e4c17[_0x0128('0x58')]['id']}})[_0x0128('0x22')](handleEntityNotFound(_0x3bf172,null))[_0x0128('0x22')](function(_0x54fba5){if(_0x54fba5){_0x4f66ff['model']=_[_0x0128('0x59')](db[_0x0128('0xa0')][_0x0128('0x3f')]);_0x4f66ff['query']=_['keys'](_0x3e4c17['query']);_0x4f66ff['filters']=_[_0x0128('0x47')](_0x4f66ff['model'],_0x4f66ff['query']);_0x1eed4a[_0x0128('0x46')]=_['intersection'](_0x4f66ff[_0x0128('0x43')],qs[_0x0128('0x48')](_0x3e4c17[_0x0128('0x44')]['fields']));_0x1eed4a[_0x0128('0x46')]=_0x1eed4a['attributes'][_0x0128('0x49')]?_0x1eed4a[_0x0128('0x46')]:_0x4f66ff['model'];if(!_0x3e4c17[_0x0128('0x44')][_0x0128('0x4a')](_0x0128('0x4b'))){_0x1eed4a[_0x0128('0x30')]=qs[_0x0128('0x30')](_0x3e4c17['query'][_0x0128('0x30')]);_0x1eed4a[_0x0128('0x2f')]=qs[_0x0128('0x2f')](_0x3e4c17[_0x0128('0x44')]['offset']);}_0x1eed4a[_0x0128('0x4c')]=qs[_0x0128('0x4d')](_0x3e4c17[_0x0128('0x44')][_0x0128('0x4d')]);_0x1eed4a[_0x0128('0x4e')]=qs['filters'](_[_0x0128('0x4f')](_0x3e4c17[_0x0128('0x44')],_0x4f66ff[_0x0128('0x45')]));_0x1eed4a[_0x0128('0x4e')][_0x0128('0x69')]=_0x54fba5['id'];if(_0x3e4c17[_0x0128('0x44')][_0x0128('0x52')]){_0x1eed4a[_0x0128('0x4e')]=_[_0x0128('0x50')](_0x1eed4a['where'],{'$or':_[_0x0128('0x3e')](_0x1eed4a[_0x0128('0x46')],function(_0x39e3fa){var _0x3a24f7={};_0x3a24f7[_0x39e3fa]={'$like':'%'+_0x3e4c17[_0x0128('0x44')]['filter']+'%'};return _0x3a24f7;})});}_0x1eed4a=_[_0x0128('0x50')]({},_0x1eed4a,_0x3e4c17[_0x0128('0x5c')]);return db[_0x0128('0xa0')]['count']({'where':_0x1eed4a[_0x0128('0x4e')]})[_0x0128('0x22')](function(_0x247441){_0x54c891[_0x0128('0x53')]=_0x247441;if(_0x3e4c17[_0x0128('0x44')][_0x0128('0x5b')]){_0x1eed4a[_0x0128('0x54')]=[{'model':db[_0x0128('0x78')],'as':_0x0128('0xbf'),'required':![]},{'model':db[_0x0128('0xab')],'as':_0x0128('0xc0'),'attributes':['name',_0x0128('0xc1'),'internal'],'required':![]},{'model':db[_0x0128('0xc2')],'as':_0x0128('0xc3'),'attributes':['id','name',_0x0128('0xc4')],'where':_0x3e4c17[_0x0128('0x44')][_0x0128('0xc5')]?{'id':_0x3e4c17[_0x0128('0x44')]['tag']}:undefined,'required':_0x3e4c17[_0x0128('0x44')][_0x0128('0xc5')]?!![]:![]}];}return db[_0x0128('0xa0')][_0x0128('0x55')](_0x1eed4a);})[_0x0128('0x22')](function(_0x1edf80){_0x54c891[_0x0128('0x56')]=_0x1edf80;return _0x54c891;});}})[_0x0128('0x22')](respondWithFilteredResult(_0x3bf172,_0x1eed4a))[_0x0128('0x57')](handleError(_0x3bf172,null));};exports[_0x0128('0x3a')]=function(_0xa93a8f,_0x24010e,_0xc1e36a){var _0x5da48a,_0x136f03,_0x1ebee3;if(_[_0x0128('0x94')](_0xa93a8f['body'][_0x0128('0x5e')])||_0xa93a8f[_0x0128('0x5e')][_0x0128('0x5e')]===''){throw new db['Sequelize'][(_0x0128('0x1f'))](_0x0128('0x95'));}if(_['isNil'](_0xa93a8f['body']['to'])){throw new db[(_0x0128('0x1e'))][(_0x0128('0x1f'))]('to\x20is\x20mandatory');}_0x5da48a=_0xa93a8f[_0x0128('0x5e')]['to'];return db[_0x0128('0x5a')]['find']({'where':{'id':_0xa93a8f[_0x0128('0x58')]['id']},'include':[{'model':db['CmList'],'as':_0x0128('0xc6'),'include':[{'model':db[_0x0128('0x78')],'as':_0x0128('0x9d'),'where':{'mobile':_0x5da48a},'limit':0x1,'order':[[_0x0128('0x7c'),_0x0128('0x9a')]]}]}]})['then'](handleEntityNotFound(_0x24010e,null))[_0x0128('0x22')](function(_0x5c66b6){if(_0x5c66b6&&_0x5c66b6[_0x0128('0xc6')]){_0x136f03=_0x5c66b6[_0x0128('0x60')]({'plain':!![]});if(_0x136f03[_0x0128('0xc6')]&&_0x136f03[_0x0128('0xc6')][_0x0128('0x9d')][_0x0128('0x49')]){return _0x136f03['List'][_0x0128('0x9d')][0x0];}return db[_0x0128('0x78')][_0x0128('0x5d')](_[_0x0128('0x9e')](_0xa93a8f[_0x0128('0x5e')],{'firstName':_0x5da48a,'mobile':_0x5da48a,'phone':_0x5da48a,'ListId':_0x136f03[_0x0128('0x7e')]}));}})[_0x0128('0x22')](handleEntityNotFound(_0x24010e,null))['then'](function(_0x4c019f){if(_0x4c019f){_0x1ebee3=_0x4c019f;return db[_0x0128('0xa0')]['find']({'where':{'ContactId':_0x1ebee3['id'],'closed':![],'SmsAccountId':_0x136f03['id']}})[_0x0128('0x22')](function(_0x3d9a46){if(_0x3d9a46){return[_0x3d9a46,![]];}return db[_0x0128('0xa0')][_0x0128('0x5d')]({'UserId':_0xa93a8f[_0x0128('0x5f')]['id'],'ContactId':_0x1ebee3['id'],'SmsAccountId':_0x136f03['id'],'phone':_0x5da48a,'firstMsgDirection':_0x0128('0xc7'),'Messages':[_[_0x0128('0x50')](_0xa93a8f['body'],{'read':![],'body':_0xa93a8f['body'][_0x0128('0x5e')],'phone':_0x5da48a,'SmsAccountId':_0x136f03['id'],'UserId':_0xa93a8f[_0x0128('0x5f')]['id'],'ContactId':_0x1ebee3['id']})]},{'include':[{'model':db[_0x0128('0xa8')],'as':_0x0128('0xc8')}]})['then'](function(_0x3247c1){return[_0x3247c1,!![]];});});}})[_0x0128('0xa1')](function(_0x1fb40f,_0x5964ed){if(_0x5964ed){return _0x1fb40f;}return db[_0x0128('0xa8')][_0x0128('0x5d')](_[_0x0128('0x50')](_0xa93a8f['body'],{'read':![],'body':_0xa93a8f[_0x0128('0x5e')][_0x0128('0x5e')],'phone':_0x5da48a,'SmsAccountId':_0x136f03['id'],'SmsInteractionId':_0x1fb40f['id'],'UserId':_0xa93a8f[_0x0128('0x5f')]['id'],'ContactId':_0x1ebee3['id']}))[_0x0128('0x22')](function(_0x3b29fd){_0x1fb40f[_0x0128('0xc9')]['Messages']=[];_0x1fb40f[_0x0128('0xc9')][_0x0128('0xc8')][_0x0128('0xa5')](_0x3b29fd['dataValues']);return _0x1fb40f;});})[_0x0128('0x22')](respondWithResult(_0x24010e,null))[_0x0128('0x57')](handleError(_0x24010e,null));};exports[_0x0128('0x2d')]=function(_0xfa7ad9,_0x1783c0,_0x1d76bf){if(_0xfa7ad9['body']['id']){delete _0xfa7ad9['body']['id'];}console[_0x0128('0xca')](_0x0128('0xcb'),_0xfa7ad9[_0x0128('0x5e')]);var _0x1cd134,_0x32ded0,_0xca5b60;return db[_0x0128('0x5a')][_0x0128('0x64')]({'where':{'id':_0xfa7ad9[_0x0128('0x58')]['id']}})['then'](handleEntityNotFound(_0x1783c0,null))['then'](function(_0x1ebb82){if(_0x1ebb82){_0xca5b60=_0x1ebb82;logger['debug'](_0x0128('0x25'),_0x0128('0x2d'),_0x0128('0xcc'),_0x1ebb82[_0x0128('0x41')],util['inspect'](_0xfa7ad9['body'],{'showHidden':![],'depth':null}));switch(_0x1ebb82[_0x0128('0x41')]){case _0x0128('0x86'):if(_0xfa7ad9[_0x0128('0x5e')]['skebby_dispatch_id']&&_0xfa7ad9[_0x0128('0x5e')][_0x0128('0x2d')]){_0x32ded0=_0xfa7ad9[_0x0128('0x5e')][_0x0128('0x2d')];return db[_0x0128('0xa8')][_0x0128('0x64')]({'where':{'messageId':_0xfa7ad9[_0x0128('0x5e')]['skebby_dispatch_id']}});}break;case _0x0128('0xcd'):if(_0xfa7ad9[_0x0128('0x5e')][_0x0128('0xce')]&&_0xfa7ad9[_0x0128('0x5e')][_0x0128('0xcf')]){_0x32ded0=_0xfa7ad9[_0x0128('0x5e')][_0x0128('0xcf')];return db['SmsMessage'][_0x0128('0x64')]({'where':{'messageId':_0xfa7ad9['body']['requestid']}});}break;case _0x0128('0xd0'):if(_0xfa7ad9[_0x0128('0x5e')][_0x0128('0x89')]&&_0xfa7ad9['body'][_0x0128('0xd1')]){_0x32ded0=_0xfa7ad9[_0x0128('0x5e')][_0x0128('0xd1')];return db[_0x0128('0xa8')][_0x0128('0x64')]({'where':{'messageId':_0xfa7ad9['body'][_0x0128('0x89')]}});}break;case _0x0128('0x8c'):var _0x54b11a=_0xfa7ad9[_0x0128('0x5e')][_0x0128('0x8d')][0x0];if(_0x54b11a[_0x0128('0x84')]&&_0x54b11a[_0x0128('0x2d')][_0x0128('0xd2')]===_0x0128('0xd3')){_0x32ded0=_0x54b11a[_0x0128('0x2d')][_0x0128('0xd2')];return db[_0x0128('0xa8')]['find']({'where':{'messageId':_0x54b11a[_0x0128('0x84')]}});}break;case'clickatell':if(_0xfa7ad9[_0x0128('0x5e')][_0x0128('0x84')]&&_0xfa7ad9[_0x0128('0x5e')][_0x0128('0x2d')]){_0x32ded0=_0xfa7ad9['body'][_0x0128('0x2d')];return db[_0x0128('0xa8')][_0x0128('0x64')]({'where':{'messageId':_0xfa7ad9[_0x0128('0x5e')][_0x0128('0x84')]}});}break;case _0x0128('0x93'):if(_0xfa7ad9[_0x0128('0x5e')][_0x0128('0xd4')]&&_0xfa7ad9[_0x0128('0x5e')][_0x0128('0x2d')]){_0x32ded0=_0xfa7ad9[_0x0128('0x5e')][_0x0128('0x2d')];return db[_0x0128('0xa8')][_0x0128('0x64')]({'where':{'messageId':_0xfa7ad9['body'][_0x0128('0xd4')]}});}break;}}})[_0x0128('0x22')](handleEntityNotFound(_0x1783c0,null))[_0x0128('0x22')](function(_0x4d2221){if(_0x4d2221){_0x1cd134=_0x4d2221;switch(_0xca5b60[_0x0128('0x41')]){case _0x0128('0x86'):if(_0x32ded0===_0x0128('0xd3')){return _0x1cd134[_0x0128('0x35')]({'read':!![]});}else{logger[_0x0128('0x28')](_0x0128('0x25'),_0x0128('0x2d'),_0x0128('0x86'),util[_0x0128('0xd5')](_0xfa7ad9[_0x0128('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x0128('0xcd'):if(_0x32ded0==='1'){return _0x1cd134['update']({'read':!![]});}else{logger[_0x0128('0x28')](_0x0128('0x25'),_0x0128('0x2d'),_0x0128('0x86'),util[_0x0128('0xd5')](_0xfa7ad9[_0x0128('0x5e')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0xfa7ad9['body'][_0x0128('0xd6')]&&_0x32ded0>=0xc8&&_0x32ded0<=0xce){return _0x1cd134[_0x0128('0x35')]({'read':!![]});}else{logger['error'](_0x0128('0x25'),_0x0128('0x2d'),_0x0128('0xd0'),util[_0x0128('0xd5')](_0xfa7ad9[_0x0128('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x0128('0x8c'):var _0x29cafd=_0xfa7ad9['body'][_0x0128('0x8d')][0x0];if(_0x29cafd[_0x0128('0x2d')]['groupName']===_0x0128('0xd3')){return _0x1cd134['update']({'read':!![]});}else{logger['error'](_0x0128('0x25'),_0x0128('0x2d'),_0x0128('0x8c'),util[_0x0128('0xd5')](_0xfa7ad9[_0x0128('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x0128('0x90'):if(_0x32ded0==_0x0128('0xd7')||_0x32ded0==_0x0128('0xd8')){return _0x1cd134[_0x0128('0x35')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x0128('0x2d'),'clickatell',util[_0x0128('0xd5')](_0xfa7ad9[_0x0128('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x0128('0x93'):if(_0x32ded0===_0x0128('0xd9')||_0x32ded0===_0x0128('0xda')){return _0x1cd134['update']({'read':!![]});}else{logger['error'](_0x0128('0x25'),_0x0128('0x2d'),_0x0128('0x93'),util[_0x0128('0xd5')](_0xfa7ad9[_0x0128('0x5e')],{'showHidden':![],'depth':null}));}break;}return _0x1cd134;}})[_0x0128('0x22')](respondWithResult(_0x1783c0,null))[_0x0128('0x57')](handleError(_0x1783c0,null));};exports[_0x0128('0xdb')]=function(_0x59ccaf,_0x14753d,_0x15a432){var _0x4e03b3,_0x1130c9,_0x52b1f4;return db[_0x0128('0x5a')][_0x0128('0x64')]({'where':{'id':_0x59ccaf[_0x0128('0x58')]['id']}})[_0x0128('0x22')](handleEntityNotFound(_0x14753d,null))[_0x0128('0x22')](function(_0x21f24c){if(_0x21f24c){_0x52b1f4=_0x21f24c;logger[_0x0128('0xb3')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x0128('0x2d'),_0x0128('0xcc'),_0x21f24c['type'],util[_0x0128('0xd5')](_0x59ccaf[_0x0128('0x44')],{'showHidden':![],'depth':null}));switch(_0x21f24c[_0x0128('0x41')]){case _0x0128('0x8e'):if(_0x59ccaf[_0x0128('0x44')][_0x0128('0xdc')]&&_0x59ccaf['query'][_0x0128('0xdd')]){_0x1130c9=_0x59ccaf[_0x0128('0x44')]['state'];return db[_0x0128('0xa8')][_0x0128('0x64')]({'where':{'messageId':_0x59ccaf['query'][_0x0128('0xdc')]}});}break;}}})['then'](handleEntityNotFound(_0x14753d,null))[_0x0128('0x22')](function(_0x514364){if(_0x514364){_0x4e03b3=_0x514364;switch(_0x52b1f4[_0x0128('0x41')]){case'csc':if(_0x1130c9==='2'||_0x1130c9==='6'){return _0x4e03b3[_0x0128('0x35')]({'read':!![]});}else{logger[_0x0128('0x28')](_0x0128('0x25'),_0x0128('0x2d'),_0x0128('0x8e'),util[_0x0128('0xd5')](_0x59ccaf[_0x0128('0x44')],{'showHidden':![],'depth':null}));};break;}return _0x4e03b3;}})[_0x0128('0x22')](respondWithResult(_0x14753d,null))[_0x0128('0x57')](handleError(_0x14753d,null));};exports[_0x0128('0xde')]=function(_0x395291,_0x2b88ea,_0x19d5ad){return db['SmsAccount']['find']({'where':{'id':_0x395291[_0x0128('0x58')]['id']}})[_0x0128('0x22')](handleEntityNotFound(_0x2b88ea,null))[_0x0128('0x22')](function(_0x30d2ff){if(_0x30d2ff){return _0x30d2ff[_0x0128('0xde')](_0x395291[_0x0128('0x5e')]['ids'],_[_0x0128('0x9c')](_0x395291[_0x0128('0x5e')],['ids','id'])||{})['spread'](function(_0x3e85c8){for(var _0x2d5691=0x0;_0x2d5691<_0x395291[_0x0128('0x5e')]['ids'][_0x0128('0x49')];_0x2d5691+=0x1){socket[_0x0128('0xdf')](_0x0128('0xe0'),{'UserId':_0x395291[_0x0128('0x5e')][_0x0128('0x6d')][_0x2d5691],'SmsAccountId':_0x395291[_0x0128('0x58')]['id']});}return _0x3e85c8;});}})['then'](respondWithResult(_0x2b88ea,null))[_0x0128('0x57')](handleError(_0x2b88ea,null));};exports[_0x0128('0xe1')]=function(_0x4e6419,_0x5bc92f,_0x4e65d9){return db['SmsAccount']['find']({'where':{'id':_0x4e6419['params']['id']}})[_0x0128('0x22')](handleEntityNotFound(_0x5bc92f,null))[_0x0128('0x22')](function(_0x848023){if(_0x848023){return _0x848023['removeAgents'](_0x4e6419[_0x0128('0x44')]['ids'])[_0x0128('0x22')](function(){if(_[_0x0128('0xe2')](_0x4e6419['query']['ids'])){for(var _0x29a6a9=0x0;_0x29a6a9<_0x4e6419[_0x0128('0x44')]['ids'][_0x0128('0x49')];_0x29a6a9+=0x1){socket[_0x0128('0xdf')]('userSmsAccount:remove',{'UserId':Number(_0x4e6419[_0x0128('0x44')][_0x0128('0x6d')][_0x29a6a9]),'SmsAccountId':Number(_0x4e6419[_0x0128('0x58')]['id'])});}}else{socket[_0x0128('0xdf')]('userSmsAccount:remove',{'UserId':Number(_0x4e6419[_0x0128('0x44')][_0x0128('0x6d')]),'SmsAccountId':Number(_0x4e6419[_0x0128('0x58')]['id'])});}});}})[_0x0128('0x22')](respondWithStatusCode(_0x5bc92f,null))['catch'](handleError(_0x5bc92f,null));};exports['getAgents']=function(_0x3ebcda,_0x39b403,_0x1fa1f7){var _0x301f76={};var _0x20994e={};var _0x5ab0f2;var _0x1b9bf2;return db[_0x0128('0x5a')]['findOne']({'where':{'id':_0x3ebcda[_0x0128('0x58')]['id']}})['then'](handleEntityNotFound(_0x39b403,null))[_0x0128('0x22')](function(_0xb350fd){if(_0xb350fd){_0x5ab0f2=_0xb350fd;_0x20994e['model']=_[_0x0128('0x59')](db[_0x0128('0xab')][_0x0128('0x3f')]);_0x20994e[_0x0128('0x44')]=_['keys'](_0x3ebcda[_0x0128('0x44')]);_0x20994e['filters']=_[_0x0128('0x47')](_0x20994e[_0x0128('0x43')],_0x20994e[_0x0128('0x44')]);_0x301f76[_0x0128('0x46')]=_[_0x0128('0x47')](_0x20994e[_0x0128('0x43')],qs[_0x0128('0x48')](_0x3ebcda[_0x0128('0x44')][_0x0128('0x48')]));_0x301f76[_0x0128('0x46')]=_0x301f76[_0x0128('0x46')]['length']?_0x301f76[_0x0128('0x46')]:_0x20994e['model'];_0x301f76[_0x0128('0x4c')]=qs[_0x0128('0x4d')](_0x3ebcda[_0x0128('0x44')][_0x0128('0x4d')]);_0x301f76[_0x0128('0x4e')]=qs[_0x0128('0x45')](_[_0x0128('0x4f')](_0x3ebcda[_0x0128('0x44')],_0x20994e[_0x0128('0x45')]));if(_0x3ebcda['query'][_0x0128('0x52')]){_0x301f76[_0x0128('0x4e')]=_[_0x0128('0x50')](_0x301f76['where'],{'$or':_[_0x0128('0x3e')](_0x301f76[_0x0128('0x46')],function(_0x5711bb){var _0x231ebc={};_0x231ebc[_0x5711bb]={'$like':'%'+_0x3ebcda[_0x0128('0x44')][_0x0128('0x52')]+'%'};return _0x231ebc;})});}_0x301f76=_['merge']({},_0x301f76,_0x3ebcda[_0x0128('0x5c')]);return _0x5ab0f2[_0x0128('0xe3')](_0x301f76);}})[_0x0128('0x22')](function(_0x5c951b){if(_0x5c951b){_0x1b9bf2=_0x5c951b[_0x0128('0x49')];if(!_0x3ebcda[_0x0128('0x44')]['hasOwnProperty']('nolimit')){_0x301f76[_0x0128('0x30')]=qs[_0x0128('0x30')](_0x3ebcda[_0x0128('0x44')][_0x0128('0x30')]);_0x301f76[_0x0128('0x2f')]=qs['offset'](_0x3ebcda['query'][_0x0128('0x2f')]);}return _0x5ab0f2[_0x0128('0xe3')](_0x301f76);}})[_0x0128('0x22')](function(_0x47abc6){if(_0x47abc6){return _0x47abc6?{'count':_0x1b9bf2,'rows':_0x47abc6}:null;}})[_0x0128('0x22')](respondWithResult(_0x39b403,null))['catch'](handleError(_0x39b403,null));}; \ No newline at end of file +var _0x6a55=['squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','test','ValidationError','then','info','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','status','end','json','offset','limit','set','apply','reject','save','UserProfileResource','destroy','sendStatus','name','send','index','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','order','where','VIRTUAL','options','count','includeAll','findAll','rows','show','params','include','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','SmsAccounts','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','Disposition','getDispositions','findOne','nolimit','sort','SmsAccountId','filter','merge','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','pick','removeAnswers','sms','Applications','account','applications','orderBy','priority','Sequelize','no\x20available\x20attributes','updatedAt','difference','CompanyId','ListId','mobile','twilio','messageId','MessageSid','skebby','sender','text','connectel','clicksend','from','message_id','From','Text','MessageUUID','infobip','results','originatingAddress','refid','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmContact','Contacts','DESC','list','omit','contact','SmsInteraction','spread','interaction','created','autoclose','close','unmanaged','*,*,*,*','SmsMessage','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','addApplications','sequelize','transaction','SmsApplication','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','User','Owner','fullname','Tag','Tags','tag','to\x20is\x20mandatory','List','out','Messages','dataValues','push','log','endpoint\x20/status\x20POST\x20/','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','status_code','groupName','DELIVERED','clickatell','redif','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','intelepeer','DELIVRD','statusGet','csc','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','html-pdf','fast-json-patch','bluebird','util','sox','to-csv','ejs','lodash'];(function(_0x345d83,_0x25e279){var _0x41e7b2=function(_0x130964){while(--_0x130964){_0x345d83['push'](_0x345d83['shift']());}};_0x41e7b2(++_0x25e279);}(_0x6a55,0xdb));var _0x56a5=function(_0x4c11f7,_0x5a0447){_0x4c11f7=_0x4c11f7-0x0;var _0x587d6b=_0x6a55[_0x4c11f7];return _0x587d6b;};'use strict';var pdf=require(_0x56a5('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x56a5('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x56a5('0x2'));var Mustache=require('mustache');var util=require(_0x56a5('0x3'));var path=require('path');var sox=require(_0x56a5('0x4'));var csv=require(_0x56a5('0x5'));var ejs=require(_0x56a5('0x6'));var fs=require('fs');var _=require(_0x56a5('0x7'));var squel=require(_0x56a5('0x8'));var crypto=require(_0x56a5('0x9'));var jsforce=require(_0x56a5('0xa'));var deskjs=require(_0x56a5('0xb'));var toCsv=require('to-csv');var querystring=require(_0x56a5('0xc'));var Papa=require(_0x56a5('0xd'));var Redis=require(_0x56a5('0xe'));var authService=require(_0x56a5('0xf'));var qs=require(_0x56a5('0x10'));var as=require(_0x56a5('0x11'));var hardwareService=require(_0x56a5('0x12'));var logger=require(_0x56a5('0x13'))(_0x56a5('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x56a5('0x15'))['db'];config[_0x56a5('0x16')]=_[_0x56a5('0x17')](config[_0x56a5('0x16')],{'host':_0x56a5('0x18'),'port':0x18eb});var socket=require(_0x56a5('0x19'))(new Redis(config['redis']));require('./smsAccount.socket')[_0x56a5('0x1a')](socket);var jayson=require(_0x56a5('0x1b'));var client=jayson[_0x56a5('0x1c')][_0x56a5('0x1d')]({'port':0x232c});function checkPasswordPattern(_0x310c32,_0x2db112,_0xe3091f){if(_0xe3091f){var _0x5c4028=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5c4028[_0x56a5('0x1e')](_0x2db112)){return _0x310c32;}else{throw new db['Sequelize'][(_0x56a5('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 _0x310c32;}}function respondWithRpcPromise(_0x14ab5b,_0x3f3e5b,_0x173c65,_0x28fe74){return new BPromise(function(_0x1ba472,_0x143f3d){var _0x1dddec=_0x28fe74||client;return _0x1dddec['request'](_0x14ab5b,_0x173c65)[_0x56a5('0x20')](function(_0x3db687){logger[_0x56a5('0x21')](_0x56a5('0x22'),_0x3f3e5b,'request\x20sent');logger[_0x56a5('0x23')](_0x56a5('0x24'),_0x3f3e5b,_0x56a5('0x25'),JSON[_0x56a5('0x26')](_0x3db687));if(_0x3db687[_0x56a5('0x27')]){if(_0x3db687['error']['code']===0x1f4){logger[_0x56a5('0x27')](_0x56a5('0x22'),_0x3f3e5b,_0x3db687['error'][_0x56a5('0x28')]);return _0x143f3d(_0x3db687[_0x56a5('0x27')][_0x56a5('0x28')]);}logger[_0x56a5('0x27')](_0x56a5('0x22'),_0x3f3e5b,_0x3db687[_0x56a5('0x27')][_0x56a5('0x28')]);return _0x1ba472(_0x3db687[_0x56a5('0x27')][_0x56a5('0x28')]);}else{logger[_0x56a5('0x21')](_0x56a5('0x22'),_0x3f3e5b,_0x56a5('0x25'));_0x1ba472(_0x3db687[_0x56a5('0x29')]['message']);}})[_0x56a5('0x2a')](function(_0x2d8e68){logger[_0x56a5('0x27')](_0x56a5('0x22'),_0x3f3e5b,_0x2d8e68);_0x143f3d(_0x2d8e68);});});}function respondWithStatusCode(_0x43a815,_0x527e84){_0x527e84=_0x527e84||0xcc;return function(_0x18e863){if(_0x18e863){return _0x43a815['sendStatus'](_0x527e84);}return _0x43a815[_0x56a5('0x2b')](_0x527e84)[_0x56a5('0x2c')]();};}function respondWithResult(_0x1b27b5,_0x284ee5){_0x284ee5=_0x284ee5||0xc8;return function(_0x4e7afd){if(_0x4e7afd){return _0x1b27b5[_0x56a5('0x2b')](_0x284ee5)[_0x56a5('0x2d')](_0x4e7afd);}};}function respondWithFilteredResult(_0x178f11,_0x51ef6f){return function(_0x22ceab){if(_0x22ceab){var _0x29dbe7=_0x22ceab['count'],_0xeb4378=_0x51ef6f[_0x56a5('0x2e')],_0x214649=_0x51ef6f[_0x56a5('0x2e')]+_0x51ef6f[_0x56a5('0x2f')],_0x55978e;if(_0x214649>=_0x29dbe7){_0x214649=_0x29dbe7;_0x55978e=0xc8;}else{_0x55978e=0xce;}_0x178f11[_0x56a5('0x2b')](_0x55978e);return _0x178f11[_0x56a5('0x30')]('Content-Range',_0xeb4378+'-'+_0x214649+'/'+_0x29dbe7)['json'](_0x22ceab);}return null;};}function patchUpdates(_0x200c4e){return function(_0xe17c5e){try{jsonpatch[_0x56a5('0x31')](_0xe17c5e,_0x200c4e,!![]);}catch(_0x58cb48){return BPromise[_0x56a5('0x32')](_0x58cb48);}return _0xe17c5e[_0x56a5('0x33')]();};}function saveUpdates(_0x5135fd,_0x5c1b6a){return function(_0x48b078){if(_0x48b078){return _0x48b078['update'](_0x5135fd)[_0x56a5('0x20')](function(_0x29c8f1){return _0x29c8f1;});}return null;};}function removeEntity(_0x129cb9,_0x5cb9c8){return function(_0x5e778a){if(_0x5e778a){return _0x5e778a['destroy']()[_0x56a5('0x20')](function(){var _0x2a1d66=_0x5e778a['get']({'plain':!![]});var _0x1dbd9a='SmsAccounts';return db[_0x56a5('0x34')][_0x56a5('0x35')]({'where':{'type':_0x1dbd9a,'resourceId':_0x2a1d66['id']}})[_0x56a5('0x20')](function(){return _0x5e778a;});})['then'](function(){_0x129cb9[_0x56a5('0x2b')](0xcc)[_0x56a5('0x2c')]();});}};}function handleEntityNotFound(_0x4240eb,_0x5de387){return function(_0x2ec273){if(!_0x2ec273){_0x4240eb[_0x56a5('0x36')](0x194);}return _0x2ec273;};}function handleError(_0xce6a1d,_0x2fa206){_0x2fa206=_0x2fa206||0x1f4;return function(_0x2633f6){logger['error'](_0x2633f6['stack']);if(_0x2633f6[_0x56a5('0x37')]){delete _0x2633f6[_0x56a5('0x37')];}_0xce6a1d[_0x56a5('0x2b')](_0x2fa206)[_0x56a5('0x38')](_0x2633f6);};}exports[_0x56a5('0x39')]=function(_0xaeda55,_0x16e747){var _0x652028={'include':[{'model':db[_0x56a5('0x3a')],'as':_0x56a5('0x3b')}]},_0x1fe853={},_0x2f175c={'count':0x0,'rows':[]};var _0x184186=_[_0x56a5('0x3c')](db[_0x56a5('0x3d')][_0x56a5('0x3e')],function(_0x46dfa3){return{'name':_0x46dfa3[_0x56a5('0x3f')],'type':_0x46dfa3[_0x56a5('0x40')][_0x56a5('0x41')]};});_0x1fe853[_0x56a5('0x42')]=_[_0x56a5('0x3c')](_0x184186,'name');_0x1fe853['query']=_[_0x56a5('0x43')](_0xaeda55['query']);_0x1fe853[_0x56a5('0x44')]=_[_0x56a5('0x45')](_0x1fe853[_0x56a5('0x42')],_0x1fe853[_0x56a5('0x46')]);_0x652028[_0x56a5('0x47')]=_[_0x56a5('0x45')](_0x1fe853['model'],qs['fields'](_0xaeda55[_0x56a5('0x46')][_0x56a5('0x48')]));_0x652028[_0x56a5('0x47')]=_0x652028[_0x56a5('0x47')][_0x56a5('0x49')]?_0x652028[_0x56a5('0x47')]:_0x1fe853['model'];if(!_0xaeda55[_0x56a5('0x46')][_0x56a5('0x4a')]('nolimit')){_0x652028[_0x56a5('0x2f')]=qs[_0x56a5('0x2f')](_0xaeda55[_0x56a5('0x46')][_0x56a5('0x2f')]);_0x652028['offset']=qs[_0x56a5('0x2e')](_0xaeda55['query'][_0x56a5('0x2e')]);}_0x652028[_0x56a5('0x4b')]=qs['sort'](_0xaeda55[_0x56a5('0x46')]['sort']);_0x652028[_0x56a5('0x4c')]=qs[_0x56a5('0x44')](_['pick'](_0xaeda55[_0x56a5('0x46')],_0x1fe853['filters']));if(_0xaeda55[_0x56a5('0x46')]['filter']){_0x652028[_0x56a5('0x4c')]=_['merge'](_0x652028[_0x56a5('0x4c')],{'$or':_[_0x56a5('0x3c')](_0x184186,function(_0x30b5a6){if(_0x30b5a6[_0x56a5('0x40')]!==_0x56a5('0x4d')){var _0x43196d={};_0x43196d[_0x30b5a6[_0x56a5('0x37')]]={'$like':'%'+_0xaeda55['query']['filter']+'%'};return _0x43196d;}})});}_0x652028=_['merge']({},_0x652028,_0xaeda55[_0x56a5('0x4e')]);var _0x1bec14={'where':_0x652028[_0x56a5('0x4c')]};return db['SmsAccount'][_0x56a5('0x4f')](_0x1bec14)[_0x56a5('0x20')](function(_0xa7de69){_0x2f175c['count']=_0xa7de69;if(_0xaeda55[_0x56a5('0x46')][_0x56a5('0x50')]){_0x652028['include']=[{'all':!![]}];}return db[_0x56a5('0x3d')][_0x56a5('0x51')](_0x652028);})[_0x56a5('0x20')](function(_0x12c1c9){_0x2f175c[_0x56a5('0x52')]=_0x12c1c9;return _0x2f175c;})['then'](respondWithFilteredResult(_0x16e747,_0x652028))[_0x56a5('0x2a')](handleError(_0x16e747,null));};exports[_0x56a5('0x53')]=function(_0x2f9577,_0x4444ed){var _0x3705dd={'raw':![],'where':{'id':_0x2f9577[_0x56a5('0x54')]['id']},'include':[{'model':db[_0x56a5('0x3a')],'as':'mandatoryDispositionPause'}]},_0x495c85={};_0x495c85[_0x56a5('0x42')]=_[_0x56a5('0x43')](db[_0x56a5('0x3d')]['rawAttributes']);_0x495c85[_0x56a5('0x46')]=_['keys'](_0x2f9577[_0x56a5('0x46')]);_0x495c85['filters']=_[_0x56a5('0x45')](_0x495c85[_0x56a5('0x42')],_0x495c85[_0x56a5('0x46')]);_0x3705dd[_0x56a5('0x47')]=_['intersection'](_0x495c85[_0x56a5('0x42')],qs['fields'](_0x2f9577[_0x56a5('0x46')][_0x56a5('0x48')]));_0x3705dd[_0x56a5('0x47')]=_0x3705dd[_0x56a5('0x47')][_0x56a5('0x49')]?_0x3705dd[_0x56a5('0x47')]:_0x495c85[_0x56a5('0x42')];if(_0x2f9577[_0x56a5('0x46')][_0x56a5('0x50')]){_0x3705dd[_0x56a5('0x55')]=[{'all':!![]}];}_0x3705dd=_['merge']({},_0x3705dd,_0x2f9577[_0x56a5('0x4e')]);return db[_0x56a5('0x3d')]['find'](_0x3705dd)[_0x56a5('0x20')](handleEntityNotFound(_0x4444ed,null))['then'](respondWithResult(_0x4444ed,null))[_0x56a5('0x2a')](handleError(_0x4444ed,null));};exports[_0x56a5('0x56')]=function(_0x100b17,_0x238657){return db[_0x56a5('0x3d')]['create'](_0x100b17[_0x56a5('0x57')],{})[_0x56a5('0x20')](function(_0x97b0ed){var _0x1a5689=_0x100b17['user']['get']({'plain':!![]});if(!_0x1a5689)throw new Error(_0x56a5('0x58'));if(_0x1a5689[_0x56a5('0x59')]===_0x56a5('0x5a')){var _0xe5f854=_0x97b0ed[_0x56a5('0x5b')]({'plain':!![]});var _0x222f87=_0x56a5('0x5c');return db['UserProfileSection'][_0x56a5('0x5d')]({'where':{'name':_0x222f87,'userProfileId':_0x1a5689[_0x56a5('0x5e')]},'raw':!![]})[_0x56a5('0x20')](function(_0x4fb2c5){if(_0x4fb2c5&&_0x4fb2c5['autoAssociation']===0x0){return db[_0x56a5('0x34')][_0x56a5('0x56')]({'name':_0xe5f854[_0x56a5('0x37')],'resourceId':_0xe5f854['id'],'type':_0x4fb2c5[_0x56a5('0x37')],'sectionId':_0x4fb2c5['id']},{})[_0x56a5('0x20')](function(){return _0x97b0ed;});}else{return _0x97b0ed;}})[_0x56a5('0x2a')](function(_0x3624b1){logger['error'](_0x56a5('0x5f'),_0x3624b1);throw _0x3624b1;});}return _0x97b0ed;})[_0x56a5('0x20')](respondWithResult(_0x238657,0xc9))[_0x56a5('0x2a')](handleError(_0x238657,null));};exports[_0x56a5('0x60')]=function(_0x29fbbc,_0x2d46a6){if(_0x29fbbc[_0x56a5('0x57')]['id']){delete _0x29fbbc[_0x56a5('0x57')]['id'];}return db[_0x56a5('0x3d')][_0x56a5('0x5d')]({'where':{'id':_0x29fbbc[_0x56a5('0x54')]['id']},'include':[{'model':db[_0x56a5('0x3a')],'as':_0x56a5('0x3b')}]})['then'](handleEntityNotFound(_0x2d46a6,null))['then'](saveUpdates(_0x29fbbc[_0x56a5('0x57')],null))[_0x56a5('0x20')](respondWithResult(_0x2d46a6,null))[_0x56a5('0x2a')](handleError(_0x2d46a6,null));};exports['destroy']=function(_0x3e243f,_0x189bf0){return db[_0x56a5('0x3d')][_0x56a5('0x5d')]({'where':{'id':_0x3e243f[_0x56a5('0x54')]['id']}})[_0x56a5('0x20')](handleEntityNotFound(_0x189bf0,null))[_0x56a5('0x20')](removeEntity(_0x189bf0,null))[_0x56a5('0x2a')](handleError(_0x189bf0,null));};exports['describe']=function(_0x96093a,_0x453702){return db[_0x56a5('0x3d')][_0x56a5('0x61')]()[_0x56a5('0x20')](respondWithResult(_0x453702,null))[_0x56a5('0x2a')](handleError(_0x453702,null));};exports[_0x56a5('0x62')]=function(_0x7cdca3,_0x3bdd70,_0x6f470b){if(_0x7cdca3[_0x56a5('0x57')]['id']){delete _0x7cdca3[_0x56a5('0x57')]['id'];}return db[_0x56a5('0x3d')][_0x56a5('0x5d')]({'where':{'id':_0x7cdca3[_0x56a5('0x54')]['id']}})['then'](handleEntityNotFound(_0x3bdd70,null))[_0x56a5('0x20')](function(_0x2530c8){if(_0x2530c8){_0x7cdca3[_0x56a5('0x57')]['SmsAccountId']=_0x2530c8['id'];return db[_0x56a5('0x63')]['create'](_0x7cdca3[_0x56a5('0x57')]);}})[_0x56a5('0x20')](respondWithResult(_0x3bdd70,null))[_0x56a5('0x2a')](handleError(_0x3bdd70,null));};exports[_0x56a5('0x64')]=function(_0x1a4195,_0x16120e,_0x5a5fcb){var _0x16fbd0={'raw':![],'where':{}};var _0x43efa1={};var _0x2f641b={'count':0x0,'rows':[]};return db[_0x56a5('0x3d')][_0x56a5('0x65')]({'where':{'id':_0x1a4195[_0x56a5('0x54')]['id']}})[_0x56a5('0x20')](handleEntityNotFound(_0x16120e,null))['then'](function(_0x1c36fc){if(_0x1c36fc){_0x43efa1['model']=_['keys'](db[_0x56a5('0x63')][_0x56a5('0x3e')]);_0x43efa1[_0x56a5('0x46')]=_[_0x56a5('0x43')](_0x1a4195['query']);_0x43efa1[_0x56a5('0x44')]=_[_0x56a5('0x45')](_0x43efa1[_0x56a5('0x42')],_0x43efa1['query']);_0x16fbd0[_0x56a5('0x47')]=_['intersection'](_0x43efa1[_0x56a5('0x42')],qs[_0x56a5('0x48')](_0x1a4195[_0x56a5('0x46')][_0x56a5('0x48')]));_0x16fbd0[_0x56a5('0x47')]=_0x16fbd0['attributes'][_0x56a5('0x49')]?_0x16fbd0[_0x56a5('0x47')]:_0x43efa1['model'];if(!_0x1a4195[_0x56a5('0x46')][_0x56a5('0x4a')](_0x56a5('0x66'))){_0x16fbd0['limit']=qs[_0x56a5('0x2f')](_0x1a4195[_0x56a5('0x46')][_0x56a5('0x2f')]);_0x16fbd0[_0x56a5('0x2e')]=qs[_0x56a5('0x2e')](_0x1a4195[_0x56a5('0x46')][_0x56a5('0x2e')]);}_0x16fbd0[_0x56a5('0x4b')]=qs[_0x56a5('0x67')](_0x1a4195[_0x56a5('0x46')][_0x56a5('0x67')]);_0x16fbd0[_0x56a5('0x4c')]=qs['filters'](_['pick'](_0x1a4195[_0x56a5('0x46')],_0x43efa1[_0x56a5('0x44')]));_0x16fbd0[_0x56a5('0x4c')][_0x56a5('0x68')]=_0x1c36fc['id'];if(_0x1a4195[_0x56a5('0x46')][_0x56a5('0x69')]){_0x16fbd0[_0x56a5('0x4c')]=_[_0x56a5('0x6a')](_0x16fbd0[_0x56a5('0x4c')],{'$or':_[_0x56a5('0x3c')](_0x16fbd0[_0x56a5('0x47')],function(_0x3b1cdc){var _0x2b9276={};_0x2b9276[_0x3b1cdc]={'$like':'%'+_0x1a4195[_0x56a5('0x46')][_0x56a5('0x69')]+'%'};return _0x2b9276;})});}_0x16fbd0=_['merge']({},_0x16fbd0,_0x1a4195[_0x56a5('0x4e')]);return db['Disposition'][_0x56a5('0x4f')]({'where':_0x16fbd0[_0x56a5('0x4c')]})[_0x56a5('0x20')](function(_0x474c42){_0x2f641b[_0x56a5('0x4f')]=_0x474c42;if(_0x1a4195['query'][_0x56a5('0x50')]){_0x16fbd0[_0x56a5('0x55')]=[{'all':!![]}];}return db[_0x56a5('0x63')]['findAll'](_0x16fbd0);})[_0x56a5('0x20')](function(_0x11f696){_0x2f641b[_0x56a5('0x52')]=_0x11f696;return _0x2f641b;});}})[_0x56a5('0x20')](respondWithFilteredResult(_0x16120e,_0x16fbd0))[_0x56a5('0x2a')](handleError(_0x16120e,null));};exports[_0x56a5('0x6b')]=function(_0x4f8986,_0x4dc201,_0x1aa3dd){return db[_0x56a5('0x3d')]['find']({'where':{'id':_0x4f8986['params']['id']}})['then'](handleEntityNotFound(_0x4dc201,null))[_0x56a5('0x20')](function(_0x4c2253){if(_0x4c2253){return _0x4c2253[_0x56a5('0x6b')](_0x4f8986[_0x56a5('0x46')][_0x56a5('0x6c')]);}})['then'](respondWithStatusCode(_0x4dc201,null))[_0x56a5('0x2a')](handleError(_0x4dc201,null));};exports[_0x56a5('0x6d')]=function(_0x420674,_0x5d590,_0x28f16d){if(_0x420674['body']['id']){delete _0x420674['body']['id'];}return db[_0x56a5('0x3d')][_0x56a5('0x5d')]({'where':{'id':_0x420674[_0x56a5('0x54')]['id']}})[_0x56a5('0x20')](handleEntityNotFound(_0x5d590,null))[_0x56a5('0x20')](function(_0x4db1cc){if(_0x4db1cc){_0x420674['body'][_0x56a5('0x68')]=_0x4db1cc['id'];return db['CannedAnswer'][_0x56a5('0x56')](_0x420674['body']);}})[_0x56a5('0x20')](respondWithResult(_0x5d590,null))[_0x56a5('0x2a')](handleError(_0x5d590,null));};exports[_0x56a5('0x6e')]=function(_0x5aebb1,_0x1ef44d,_0x2470ce){var _0x2bfa59={'raw':![],'where':{}};var _0x9bb895={};var _0x441668={'count':0x0,'rows':[]};return db[_0x56a5('0x3d')][_0x56a5('0x65')]({'where':{'id':_0x5aebb1[_0x56a5('0x54')]['id']}})['then'](handleEntityNotFound(_0x1ef44d,null))[_0x56a5('0x20')](function(_0x2ae5ae){if(_0x2ae5ae){_0x9bb895['model']=_[_0x56a5('0x43')](db[_0x56a5('0x6f')]['rawAttributes']);_0x9bb895[_0x56a5('0x46')]=_[_0x56a5('0x43')](_0x5aebb1[_0x56a5('0x46')]);_0x9bb895[_0x56a5('0x44')]=_['intersection'](_0x9bb895['model'],_0x9bb895[_0x56a5('0x46')]);_0x2bfa59[_0x56a5('0x47')]=_[_0x56a5('0x45')](_0x9bb895['model'],qs[_0x56a5('0x48')](_0x5aebb1[_0x56a5('0x46')][_0x56a5('0x48')]));_0x2bfa59['attributes']=_0x2bfa59[_0x56a5('0x47')][_0x56a5('0x49')]?_0x2bfa59['attributes']:_0x9bb895[_0x56a5('0x42')];if(!_0x5aebb1['query'][_0x56a5('0x4a')](_0x56a5('0x66'))){_0x2bfa59[_0x56a5('0x2f')]=qs[_0x56a5('0x2f')](_0x5aebb1[_0x56a5('0x46')][_0x56a5('0x2f')]);_0x2bfa59[_0x56a5('0x2e')]=qs[_0x56a5('0x2e')](_0x5aebb1['query'][_0x56a5('0x2e')]);}_0x2bfa59[_0x56a5('0x4b')]=qs[_0x56a5('0x67')](_0x5aebb1['query'][_0x56a5('0x67')]);_0x2bfa59[_0x56a5('0x4c')]=qs[_0x56a5('0x44')](_[_0x56a5('0x70')](_0x5aebb1[_0x56a5('0x46')],_0x9bb895[_0x56a5('0x44')]));_0x2bfa59['where'][_0x56a5('0x68')]=_0x2ae5ae['id'];if(_0x5aebb1['query']['filter']){_0x2bfa59[_0x56a5('0x4c')]=_[_0x56a5('0x6a')](_0x2bfa59[_0x56a5('0x4c')],{'$or':_[_0x56a5('0x3c')](_0x2bfa59['attributes'],function(_0x4a87a3){var _0x5bd07b={};_0x5bd07b[_0x4a87a3]={'$like':'%'+_0x5aebb1[_0x56a5('0x46')][_0x56a5('0x69')]+'%'};return _0x5bd07b;})});}_0x2bfa59=_[_0x56a5('0x6a')]({},_0x2bfa59,_0x5aebb1[_0x56a5('0x4e')]);return db[_0x56a5('0x6f')]['count']({'where':_0x2bfa59[_0x56a5('0x4c')]})[_0x56a5('0x20')](function(_0x37cacc){_0x441668[_0x56a5('0x4f')]=_0x37cacc;if(_0x5aebb1[_0x56a5('0x46')][_0x56a5('0x50')]){_0x2bfa59[_0x56a5('0x55')]=[{'all':!![]}];}return db[_0x56a5('0x6f')]['findAll'](_0x2bfa59);})['then'](function(_0x5118fd){_0x441668[_0x56a5('0x52')]=_0x5118fd;return _0x441668;});}})[_0x56a5('0x20')](respondWithFilteredResult(_0x1ef44d,_0x2bfa59))[_0x56a5('0x2a')](handleError(_0x1ef44d,null));};exports['removeAnswers']=function(_0x17b87e,_0x401cda,_0x3f7a7a){return db[_0x56a5('0x3d')][_0x56a5('0x5d')]({'where':{'id':_0x17b87e[_0x56a5('0x54')]['id']}})['then'](handleEntityNotFound(_0x401cda,null))[_0x56a5('0x20')](function(_0x150636){if(_0x150636){return _0x150636[_0x56a5('0x71')](_0x17b87e[_0x56a5('0x46')][_0x56a5('0x6c')]);}})[_0x56a5('0x20')](respondWithStatusCode(_0x401cda,null))[_0x56a5('0x2a')](handleError(_0x401cda,null));};exports['notify']=function(_0x5bd49c,_0x5c44a8,_0x4bc3c2){var _0x47e038={'channel':_0x56a5('0x72')};var _0x137128=[];var _0x877ecd=[];var _0x16153e={};return db['SmsAccount'][_0x56a5('0x5d')]({'where':{'id':_0x5bd49c[_0x56a5('0x54')]['id']},'include':[{'model':db['SmsApplication'],'as':_0x56a5('0x73')}]})[_0x56a5('0x20')](handleEntityNotFound(_0x5c44a8,null))[_0x56a5('0x20')](function(_0x38d257){_0x47e038[_0x56a5('0x74')]=_0x38d257;_0x47e038[_0x56a5('0x75')]=_[_0x56a5('0x76')](_0x38d257[_0x56a5('0x73')],[_0x56a5('0x77')],['asc']);if(_0x47e038['account'][_0x56a5('0x73')]){delete _0x47e038['account'][_0x56a5('0x73')];}return db['CmContact'][_0x56a5('0x61')]();})[_0x56a5('0x20')](function(_0x21b426){if(!_0x21b426){throw new db[(_0x56a5('0x78'))][(_0x56a5('0x1f'))](_0x56a5('0x79'));}_0x137128=_['difference'](_[_0x56a5('0x43')](_0x21b426),['createdAt',_0x56a5('0x7a')]);_0x877ecd=_[_0x56a5('0x7b')](_['keys'](_0x21b426),['createdAt',_0x56a5('0x7a'),_0x56a5('0x7c'),_0x56a5('0x7d')]);_0x47e038[_0x56a5('0x57')]={'mapKey':_0x56a5('0x7e')};if(_0x47e038[_0x56a5('0x74')]['type']){switch(_0x47e038[_0x56a5('0x74')][_0x56a5('0x40')]){case _0x56a5('0x7f'):_0x47e038[_0x56a5('0x57')]['from']=_0x5bd49c[_0x56a5('0x57')]['From'];_0x47e038['body'][_0x56a5('0x57')]=_0x5bd49c[_0x56a5('0x57')]['Body'];_0x47e038[_0x56a5('0x57')][_0x56a5('0x80')]=_0x5bd49c[_0x56a5('0x57')][_0x56a5('0x81')];break;case _0x56a5('0x82'):_0x47e038['body']['from']='+'+_0x5bd49c[_0x56a5('0x57')][_0x56a5('0x83')];_0x47e038[_0x56a5('0x57')]['body']=_0x5bd49c[_0x56a5('0x57')][_0x56a5('0x84')];break;case _0x56a5('0x85'):_0x47e038['body']['from']=_0x5bd49c[_0x56a5('0x57')]['from'];_0x47e038[_0x56a5('0x57')][_0x56a5('0x57')]=_0x5bd49c[_0x56a5('0x57')][_0x56a5('0x28')];break;case _0x56a5('0x86'):_0x47e038[_0x56a5('0x57')]['from']=_0x5bd49c[_0x56a5('0x57')][_0x56a5('0x87')];_0x47e038[_0x56a5('0x57')][_0x56a5('0x57')]=_0x5bd49c[_0x56a5('0x57')][_0x56a5('0x57')];_0x47e038[_0x56a5('0x57')][_0x56a5('0x80')]=_0x5bd49c[_0x56a5('0x57')][_0x56a5('0x88')];break;case'plivo':_0x47e038[_0x56a5('0x57')]['from']=_0x5bd49c['body'][_0x56a5('0x89')];_0x47e038[_0x56a5('0x57')]['body']=_0x5bd49c[_0x56a5('0x57')][_0x56a5('0x8a')];_0x47e038[_0x56a5('0x57')][_0x56a5('0x80')]=_0x5bd49c[_0x56a5('0x57')][_0x56a5('0x8b')];break;case _0x56a5('0x8c'):_0x47e038['body'][_0x56a5('0x87')]='+'+_0x5bd49c[_0x56a5('0x57')][_0x56a5('0x8d')][0x0][_0x56a5('0x87')];_0x47e038[_0x56a5('0x57')][_0x56a5('0x57')]=_0x5bd49c[_0x56a5('0x57')][_0x56a5('0x8d')][0x0][_0x56a5('0x84')];_0x47e038[_0x56a5('0x57')]['messageId']=_0x5bd49c[_0x56a5('0x57')][_0x56a5('0x8d')][0x0]['messageId'];break;case'csc':_0x47e038[_0x56a5('0x57')][_0x56a5('0x87')]=_0x5bd49c[_0x56a5('0x57')][_0x56a5('0x8e')];_0x47e038[_0x56a5('0x57')][_0x56a5('0x57')]=_0x5bd49c[_0x56a5('0x57')]['segmentedMessage'][_0x56a5('0x28')];break;case'clickatell':_0x47e038['body'][_0x56a5('0x87')]=_0x5bd49c[_0x56a5('0x57')]['fromNumber'];_0x47e038[_0x56a5('0x57')]['body']=_0x5bd49c[_0x56a5('0x57')]['text'];_0x47e038[_0x56a5('0x57')][_0x56a5('0x80')]=_0x5bd49c[_0x56a5('0x57')]['replyMessageId'];break;case'intelepeer':_0x47e038[_0x56a5('0x57')][_0x56a5('0x87')]=_0x5bd49c[_0x56a5('0x57')]['from'];_0x47e038[_0x56a5('0x57')]['body']=_0x5bd49c['body']['message'];_0x47e038['body'][_0x56a5('0x80')]=_0x5bd49c[_0x56a5('0x57')][_0x56a5('0x8f')];break;}}if(_0x47e038[_0x56a5('0x57')]['id']){delete _0x47e038[_0x56a5('0x57')]['id'];}if(_['isNil'](_0x47e038[_0x56a5('0x57')]['from'])){throw new db[(_0x56a5('0x78'))][(_0x56a5('0x1f'))](_0x56a5('0x90'));}if(_[_0x56a5('0x91')](_0x47e038[_0x56a5('0x57')][_0x56a5('0x57')])||_0x47e038[_0x56a5('0x57')][_0x56a5('0x57')]===''){throw new db[(_0x56a5('0x78'))][(_0x56a5('0x1f'))](_0x56a5('0x92'));}if(_[_0x56a5('0x91')](_0x47e038[_0x56a5('0x57')][_0x56a5('0x93')])){throw new db['Sequelize'][(_0x56a5('0x1f'))](_0x56a5('0x94')+_0x877ecd);}if(!_[_0x56a5('0x95')](_0x877ecd,_0x47e038['body']['mapKey'])){throw new db['Sequelize'][(_0x56a5('0x1f'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x877ecd);}_0x16153e[_0x47e038[_0x56a5('0x57')]['mapKey']]=_0x47e038[_0x56a5('0x57')][_0x56a5('0x87')];return db['CmList'][_0x56a5('0x5d')]({'where':{'id':_0x47e038[_0x56a5('0x74')][_0x56a5('0x7d')]},'include':[{'model':db[_0x56a5('0x96')],'as':_0x56a5('0x97'),'where':_0x16153e,'limit':0x1,'order':[[_0x56a5('0x7a'),_0x56a5('0x98')]]}]});})[_0x56a5('0x20')](handleEntityNotFound(_0x5c44a8,null))[_0x56a5('0x20')](function(_0x3f7332){if(_0x3f7332){_0x47e038[_0x56a5('0x99')]=_[_0x56a5('0x9a')](_0x3f7332,[_0x56a5('0x97')]);if(_0x3f7332['Contacts'][_0x56a5('0x49')]){return _0x3f7332['Contacts'][0x0];}var _0x105c75=_['defaults'](_0x47e038[_0x56a5('0x57')],{'firstName':_0x47e038[_0x56a5('0x57')][_0x56a5('0x87')],'ListId':_0x3f7332['id']});_0x105c75[_0x47e038[_0x56a5('0x57')][_0x56a5('0x93')]]=_0x47e038['body'][_0x56a5('0x87')];return db[_0x56a5('0x96')][_0x56a5('0x56')](_0x105c75,{'fields':_0x137128,'raw':!![]});}})[_0x56a5('0x20')](handleEntityNotFound(_0x5c44a8,null))[_0x56a5('0x20')](function(_0x15c12a){if(_0x15c12a){_0x47e038[_0x56a5('0x9b')]=_0x15c12a;var _0x56df52={'ContactId':_0x15c12a['id'],'phone':_0x47e038[_0x56a5('0x57')][_0x56a5('0x87')],'SmsAccountId':_0x5bd49c[_0x56a5('0x54')]['id']};var _0x4dd09f={'ContactId':_0x15c12a['id'],'SmsAccountId':_0x5bd49c[_0x56a5('0x54')]['id'],'closed':![]};return db[_0x56a5('0x9c')][_0x56a5('0x5d')]({'where':_0x4dd09f})[_0x56a5('0x20')](function(_0x2d73a9){if(_0x2d73a9){return[_0x2d73a9,![]];}return db[_0x56a5('0x9c')]['create'](_0x56df52)[_0x56a5('0x20')](function(_0x325c97){return[_0x325c97,!![]];});});}})[_0x56a5('0x9d')](function(_0xb78c2b,_0x5eafd4){_0x47e038['interaction']=_0xb78c2b[_0x56a5('0x5b')]({'plain':!![]});_0x47e038[_0x56a5('0x9e')][_0x56a5('0x9f')]=![];if(_0x5eafd4){if(_0x47e038[_0x56a5('0x74')][_0x56a5('0xa0')]){_0x47e038[_0x56a5('0x75')]['push']({'id':0x0,'priority':_0x47e038[_0x56a5('0x75')][_0x56a5('0x49')]+0x1,'app':_0x56a5('0xa1'),'appdata':_0x56a5('0xa2'),'interval':_0x56a5('0xa3')});}_0x47e038[_0x56a5('0x9e')][_0x56a5('0x9f')]=!![];}return db[_0x56a5('0xa4')][_0x56a5('0x56')]({'phone':_0x47e038[_0x56a5('0x57')][_0x56a5('0x87')],'messageId':_0x47e038[_0x56a5('0x57')][_0x56a5('0x80')],'body':_0x47e038[_0x56a5('0x57')][_0x56a5('0x57')],'SmsAccountId':_0x5bd49c[_0x56a5('0x54')]['id'],'SmsInteractionId':_0xb78c2b['id'],'direction':'in','ContactId':_0xb78c2b[_0x56a5('0xa5')],'AttachmentId':_0x47e038[_0x56a5('0x57')][_0x56a5('0xa6')]});})[_0x56a5('0x20')](function(_0x6c1e0c){_0x47e038[_0x56a5('0x28')]=_0x6c1e0c;if(_0x47e038[_0x56a5('0x9e')][_0x56a5('0xa7')]){return db['User'][_0x56a5('0x5d')]({'attributes':['id',_0x56a5('0x37')],'where':{'id':_0x47e038[_0x56a5('0x9e')][_0x56a5('0xa7')]}})[_0x56a5('0x20')](function(_0x16b1d5){if(_0x16b1d5){_0x47e038[_0x56a5('0x75')][_0x56a5('0xa8')]({'id':0x0,'priority':0x0,'app':_0x56a5('0xa9'),'appdata':_0x16b1d5[_0x56a5('0x37')]+','+(_0x47e038['account'][_0x56a5('0xaa')]||0xa),'interval':_0x56a5('0xa3')});}return respondWithRpcPromise(_0x56a5('0xab'),'startRouting',_0x47e038);});}return respondWithRpcPromise(_0x56a5('0xab'),_0x56a5('0xac'),_0x47e038);})[_0x56a5('0x20')](function(_0x537bfc){if(_0x537bfc){var _0x3062c2=0xc8;var _0xe175de=_0x56a5('0xad');logger[_0x56a5('0x21')](_0x56a5('0x24'),_0xe175de,_0x3062c2,_0x56a5('0xae'));logger[_0x56a5('0x23')](_0x56a5('0xaf'),_0xe175de,_0x3062c2,_0x56a5('0xae'),JSON[_0x56a5('0x26')](_0x537bfc));if(_0x47e038[_0x56a5('0x74')][_0x56a5('0x40')]===_0x56a5('0x7f')){return _0x5c44a8[_0x56a5('0x2b')](_0x3062c2)[_0x56a5('0x30')](_0x56a5('0xb0'),_0x56a5('0xb1'))['send']('\x0a');}else{return _0x5c44a8[_0x56a5('0x2b')](_0x3062c2)[_0x56a5('0x2d')](_0x537bfc);}}})['catch'](handleError(_0x5c44a8,null));};exports[_0x56a5('0xb2')]=function(_0x5d49eb,_0x2dd8bb,_0x4b6731){return db['SmsAccount'][_0x56a5('0x65')]({'where':{'id':_0x5d49eb[_0x56a5('0x54')]['id']}})[_0x56a5('0x20')](handleEntityNotFound(_0x2dd8bb,null))['then'](function(_0x149e09){if(_0x149e09){return db[_0x56a5('0xb3')][_0x56a5('0xb4')](function(_0x5b7759){return db[_0x56a5('0xb5')][_0x56a5('0x35')]({'where':{'SmsAccountId':_0x5d49eb[_0x56a5('0x54')]['id']},'transaction':_0x5b7759})[_0x56a5('0x20')](function(_0x58bda4){var _0x470c74=_[_0x56a5('0x3c')](_0x5d49eb[_0x56a5('0x57')],function(_0x58fdd0){_0x58fdd0['SmsAccountId']=_0x5d49eb[_0x56a5('0x54')]['id'];return _0x58fdd0;});return db[_0x56a5('0xb5')][_0x56a5('0xb6')](_0x470c74,{'transaction':_0x5b7759});});})['then'](function(){return db[_0x56a5('0xb5')][_0x56a5('0xb7')]({'where':{'SmsAccountId':_0x5d49eb[_0x56a5('0x54')]['id']},'order':_0x56a5('0x77')});});}})[_0x56a5('0x20')](respondWithResult(_0x2dd8bb,null))[_0x56a5('0x2a')](handleError(_0x2dd8bb,null));};exports[_0x56a5('0xb8')]=function(_0x12ca83,_0x5bd2a3,_0x40eedc){var _0x4bc112={};var _0x4c61bc={};var _0x35b335;var _0x210c64;return db[_0x56a5('0x3d')][_0x56a5('0x65')]({'where':{'id':_0x12ca83[_0x56a5('0x54')]['id']}})['then'](handleEntityNotFound(_0x5bd2a3,null))[_0x56a5('0x20')](function(_0x3d4d42){if(_0x3d4d42){_0x35b335=_0x3d4d42;_0x4c61bc['model']=_['keys'](db['SmsApplication']['rawAttributes']);_0x4c61bc[_0x56a5('0x46')]=_[_0x56a5('0x43')](_0x12ca83[_0x56a5('0x46')]);_0x4c61bc[_0x56a5('0x44')]=_['intersection'](_0x4c61bc[_0x56a5('0x42')],_0x4c61bc[_0x56a5('0x46')]);_0x4bc112[_0x56a5('0x47')]=_[_0x56a5('0x45')](_0x4c61bc[_0x56a5('0x42')],qs[_0x56a5('0x48')](_0x12ca83['query'][_0x56a5('0x48')]));_0x4bc112[_0x56a5('0x47')]=_0x4bc112[_0x56a5('0x47')]['length']?_0x4bc112[_0x56a5('0x47')]:_0x4c61bc[_0x56a5('0x42')];_0x4bc112[_0x56a5('0x4b')]=qs[_0x56a5('0x67')](_0x12ca83[_0x56a5('0x46')][_0x56a5('0x67')]);_0x4bc112['where']=qs[_0x56a5('0x44')](_[_0x56a5('0x70')](_0x12ca83[_0x56a5('0x46')],_0x4c61bc[_0x56a5('0x44')]));if(_0x12ca83[_0x56a5('0x46')][_0x56a5('0x69')]){_0x4bc112['where']=_[_0x56a5('0x6a')](_0x4bc112[_0x56a5('0x4c')],{'$or':_[_0x56a5('0x3c')](_0x4bc112[_0x56a5('0x47')],function(_0x3d4c2d){var _0x1a0b1a={};_0x1a0b1a[_0x3d4c2d]={'$like':'%'+_0x12ca83[_0x56a5('0x46')][_0x56a5('0x69')]+'%'};return _0x1a0b1a;})});}_0x4bc112=_['merge']({},_0x4bc112,_0x12ca83[_0x56a5('0x4e')]);return _0x35b335[_0x56a5('0xb8')](_0x4bc112);}})['then'](function(_0x40f125){if(_0x40f125){_0x210c64=_0x40f125[_0x56a5('0x49')];if(!_0x12ca83[_0x56a5('0x46')][_0x56a5('0x4a')](_0x56a5('0x66'))){_0x4bc112[_0x56a5('0x2f')]=qs['limit'](_0x12ca83['query']['limit']);_0x4bc112['offset']=qs[_0x56a5('0x2e')](_0x12ca83[_0x56a5('0x46')][_0x56a5('0x2e')]);}return _0x35b335['getApplications'](_0x4bc112);}})[_0x56a5('0x20')](function(_0x106699){if(_0x106699){return _0x106699?{'count':_0x210c64,'rows':_0x106699}:null;}})[_0x56a5('0x20')](respondWithResult(_0x5bd2a3,null))['catch'](handleError(_0x5bd2a3,null));};exports[_0x56a5('0xb9')]=function(_0xc2a484,_0x29c397,_0x50a02c){var _0x4a235={'raw':![],'where':{}};var _0x4565a7={};var _0x3da9f6={'count':0x0,'rows':[]};return db['SmsAccount'][_0x56a5('0x65')]({'where':{'id':_0xc2a484[_0x56a5('0x54')]['id']}})['then'](handleEntityNotFound(_0x29c397,null))[_0x56a5('0x20')](function(_0x1fef17){if(_0x1fef17){_0x4565a7[_0x56a5('0x42')]=_[_0x56a5('0x43')](db[_0x56a5('0x9c')][_0x56a5('0x3e')]);_0x4565a7[_0x56a5('0x46')]=_[_0x56a5('0x43')](_0xc2a484[_0x56a5('0x46')]);_0x4565a7['filters']=_['intersection'](_0x4565a7[_0x56a5('0x42')],_0x4565a7[_0x56a5('0x46')]);_0x4a235['attributes']=_[_0x56a5('0x45')](_0x4565a7['model'],qs[_0x56a5('0x48')](_0xc2a484[_0x56a5('0x46')]['fields']));_0x4a235[_0x56a5('0x47')]=_0x4a235['attributes']['length']?_0x4a235[_0x56a5('0x47')]:_0x4565a7['model'];if(!_0xc2a484[_0x56a5('0x46')][_0x56a5('0x4a')](_0x56a5('0x66'))){_0x4a235[_0x56a5('0x2f')]=qs['limit'](_0xc2a484[_0x56a5('0x46')][_0x56a5('0x2f')]);_0x4a235['offset']=qs[_0x56a5('0x2e')](_0xc2a484[_0x56a5('0x46')][_0x56a5('0x2e')]);}_0x4a235[_0x56a5('0x4b')]=qs[_0x56a5('0x67')](_0xc2a484[_0x56a5('0x46')][_0x56a5('0x67')]);_0x4a235[_0x56a5('0x4c')]=qs[_0x56a5('0x44')](_['pick'](_0xc2a484['query'],_0x4565a7['filters']));_0x4a235[_0x56a5('0x4c')][_0x56a5('0x68')]=_0x1fef17['id'];if(_0xc2a484['query']['filter']){_0x4a235['where']=_['merge'](_0x4a235['where'],{'$or':_[_0x56a5('0x3c')](_0x4a235[_0x56a5('0x47')],function(_0x1fc219){var _0x11f82c={};_0x11f82c[_0x1fc219]={'$like':'%'+_0xc2a484[_0x56a5('0x46')][_0x56a5('0x69')]+'%'};return _0x11f82c;})});}_0x4a235=_[_0x56a5('0x6a')]({},_0x4a235,_0xc2a484[_0x56a5('0x4e')]);return db[_0x56a5('0x9c')][_0x56a5('0x4f')]({'where':_0x4a235[_0x56a5('0x4c')]})['then'](function(_0x505e9c){_0x3da9f6['count']=_0x505e9c;if(_0xc2a484[_0x56a5('0x46')][_0x56a5('0x50')]){_0x4a235[_0x56a5('0x55')]=[{'model':db['CmContact'],'as':_0x56a5('0xba'),'required':![]},{'model':db[_0x56a5('0xbb')],'as':_0x56a5('0xbc'),'attributes':['name',_0x56a5('0xbd'),'internal'],'required':![]},{'model':db[_0x56a5('0xbe')],'as':_0x56a5('0xbf'),'attributes':['id',_0x56a5('0x37'),'color'],'where':_0xc2a484[_0x56a5('0x46')][_0x56a5('0xc0')]?{'id':_0xc2a484[_0x56a5('0x46')][_0x56a5('0xc0')]}:undefined,'required':_0xc2a484[_0x56a5('0x46')][_0x56a5('0xc0')]?!![]:![]}];}return db[_0x56a5('0x9c')][_0x56a5('0x51')](_0x4a235);})['then'](function(_0x39360c){_0x3da9f6['rows']=_0x39360c;return _0x3da9f6;});}})[_0x56a5('0x20')](respondWithFilteredResult(_0x29c397,_0x4a235))['catch'](handleError(_0x29c397,null));};exports['send']=function(_0x1360aa,_0x2cf45a,_0x4eaf07){var _0x4f2d72,_0x497520,_0x9c8419;if(_[_0x56a5('0x91')](_0x1360aa[_0x56a5('0x57')][_0x56a5('0x57')])||_0x1360aa[_0x56a5('0x57')]['body']===''){throw new db[(_0x56a5('0x78'))][(_0x56a5('0x1f'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x56a5('0x91')](_0x1360aa[_0x56a5('0x57')]['to'])){throw new db[(_0x56a5('0x78'))][(_0x56a5('0x1f'))](_0x56a5('0xc1'));}_0x4f2d72=_0x1360aa[_0x56a5('0x57')]['to'];return db[_0x56a5('0x3d')][_0x56a5('0x5d')]({'where':{'id':_0x1360aa['params']['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x56a5('0x96')],'as':'Contacts','where':{'mobile':_0x4f2d72},'limit':0x1,'order':[['updatedAt',_0x56a5('0x98')]]}]}]})['then'](handleEntityNotFound(_0x2cf45a,null))[_0x56a5('0x20')](function(_0x239f2d){if(_0x239f2d&&_0x239f2d['List']){_0x497520=_0x239f2d['get']({'plain':!![]});if(_0x497520[_0x56a5('0xc2')]&&_0x497520[_0x56a5('0xc2')]['Contacts'][_0x56a5('0x49')]){return _0x497520[_0x56a5('0xc2')][_0x56a5('0x97')][0x0];}return db['CmContact'][_0x56a5('0x56')](_[_0x56a5('0x17')](_0x1360aa['body'],{'firstName':_0x4f2d72,'mobile':_0x4f2d72,'phone':_0x4f2d72,'ListId':_0x497520[_0x56a5('0x7d')]}));}})['then'](handleEntityNotFound(_0x2cf45a,null))[_0x56a5('0x20')](function(_0x298faf){if(_0x298faf){_0x9c8419=_0x298faf;return db[_0x56a5('0x9c')][_0x56a5('0x5d')]({'where':{'ContactId':_0x9c8419['id'],'closed':![],'SmsAccountId':_0x497520['id']}})[_0x56a5('0x20')](function(_0x4f61f8){if(_0x4f61f8){return[_0x4f61f8,![]];}return db['SmsInteraction'][_0x56a5('0x56')]({'UserId':_0x1360aa[_0x56a5('0x5a')]['id'],'ContactId':_0x9c8419['id'],'SmsAccountId':_0x497520['id'],'phone':_0x4f2d72,'firstMsgDirection':_0x56a5('0xc3'),'Messages':[_[_0x56a5('0x6a')](_0x1360aa[_0x56a5('0x57')],{'read':![],'body':_0x1360aa[_0x56a5('0x57')][_0x56a5('0x57')],'phone':_0x4f2d72,'SmsAccountId':_0x497520['id'],'UserId':_0x1360aa['user']['id'],'ContactId':_0x9c8419['id']})]},{'include':[{'model':db[_0x56a5('0xa4')],'as':_0x56a5('0xc4')}]})['then'](function(_0xd569e){return[_0xd569e,!![]];});});}})[_0x56a5('0x9d')](function(_0x3a30db,_0x3fe050){if(_0x3fe050){return _0x3a30db;}return db[_0x56a5('0xa4')][_0x56a5('0x56')](_['merge'](_0x1360aa[_0x56a5('0x57')],{'read':![],'body':_0x1360aa['body'][_0x56a5('0x57')],'phone':_0x4f2d72,'SmsAccountId':_0x497520['id'],'SmsInteractionId':_0x3a30db['id'],'UserId':_0x1360aa[_0x56a5('0x5a')]['id'],'ContactId':_0x9c8419['id']}))['then'](function(_0x1ca271){_0x3a30db['dataValues'][_0x56a5('0xc4')]=[];_0x3a30db[_0x56a5('0xc5')][_0x56a5('0xc4')][_0x56a5('0xc6')](_0x1ca271[_0x56a5('0xc5')]);return _0x3a30db;});})['then'](respondWithResult(_0x2cf45a,null))[_0x56a5('0x2a')](handleError(_0x2cf45a,null));};exports['status']=function(_0x542508,_0x2e5583,_0x3684e1){if(_0x542508[_0x56a5('0x57')]['id']){delete _0x542508['body']['id'];}console[_0x56a5('0xc7')](_0x56a5('0xc8'),_0x542508[_0x56a5('0x57')]);var _0x41952e,_0x196f09,_0x9f1a3;return db[_0x56a5('0x3d')][_0x56a5('0x5d')]({'where':{'id':_0x542508[_0x56a5('0x54')]['id']}})[_0x56a5('0x20')](handleEntityNotFound(_0x2e5583,null))[_0x56a5('0x20')](function(_0x41a746){if(_0x41a746){_0x9f1a3=_0x41a746;logger[_0x56a5('0x23')](_0x56a5('0x24'),_0x56a5('0x2b'),_0x56a5('0xc9'),_0x41a746[_0x56a5('0x40')],util[_0x56a5('0xca')](_0x542508[_0x56a5('0x57')],{'showHidden':![],'depth':null}));switch(_0x41a746[_0x56a5('0x40')]){case _0x56a5('0x82'):if(_0x542508[_0x56a5('0x57')][_0x56a5('0xcb')]&&_0x542508[_0x56a5('0x57')][_0x56a5('0x2b')]){_0x196f09=_0x542508['body']['status'];return db[_0x56a5('0xa4')][_0x56a5('0x5d')]({'where':{'messageId':_0x542508['body']['skebby_dispatch_id']}});}break;case _0x56a5('0x85'):if(_0x542508[_0x56a5('0x57')][_0x56a5('0xcc')]&&_0x542508[_0x56a5('0x57')][_0x56a5('0xcd')]){_0x196f09=_0x542508[_0x56a5('0x57')][_0x56a5('0xcd')];return db[_0x56a5('0xa4')]['find']({'where':{'messageId':_0x542508[_0x56a5('0x57')][_0x56a5('0xcc')]}});}break;case'clicksend':if(_0x542508['body']['message_id']&&_0x542508[_0x56a5('0x57')][_0x56a5('0xce')]){_0x196f09=_0x542508[_0x56a5('0x57')][_0x56a5('0xce')];return db[_0x56a5('0xa4')][_0x56a5('0x5d')]({'where':{'messageId':_0x542508[_0x56a5('0x57')]['message_id']}});}break;case _0x56a5('0x8c'):var _0x511d78=_0x542508['body'][_0x56a5('0x8d')][0x0];if(_0x511d78[_0x56a5('0x80')]&&_0x511d78[_0x56a5('0x2b')][_0x56a5('0xcf')]===_0x56a5('0xd0')){_0x196f09=_0x511d78[_0x56a5('0x2b')]['groupName'];return db[_0x56a5('0xa4')][_0x56a5('0x5d')]({'where':{'messageId':_0x511d78[_0x56a5('0x80')]}});}break;case _0x56a5('0xd1'):if(_0x542508['body']['messageId']&&_0x542508[_0x56a5('0x57')][_0x56a5('0x2b')]){_0x196f09=_0x542508[_0x56a5('0x57')][_0x56a5('0x2b')];return db[_0x56a5('0xa4')][_0x56a5('0x5d')]({'where':{'messageId':_0x542508[_0x56a5('0x57')][_0x56a5('0x80')]}});}break;case'intelepeer':if(_0x542508['body'][_0x56a5('0xd2')]&&_0x542508['body'][_0x56a5('0x2b')]){_0x196f09=_0x542508['body'][_0x56a5('0x2b')];return db[_0x56a5('0xa4')][_0x56a5('0x5d')]({'where':{'messageId':_0x542508[_0x56a5('0x57')][_0x56a5('0xd2')]}});}break;}}})['then'](handleEntityNotFound(_0x2e5583,null))[_0x56a5('0x20')](function(_0x52a91e){if(_0x52a91e){_0x41952e=_0x52a91e;switch(_0x9f1a3[_0x56a5('0x40')]){case _0x56a5('0x82'):if(_0x196f09==='DELIVERED'){return _0x41952e['update']({'read':!![]});}else{logger[_0x56a5('0x27')](_0x56a5('0x24'),_0x56a5('0x2b'),_0x56a5('0x82'),util['inspect'](_0x542508[_0x56a5('0x57')],{'showHidden':![],'depth':null}));}break;case _0x56a5('0x85'):if(_0x196f09==='1'){return _0x41952e[_0x56a5('0x60')]({'read':!![]});}else{logger['error'](_0x56a5('0x24'),_0x56a5('0x2b'),_0x56a5('0x82'),util[_0x56a5('0xca')](_0x542508[_0x56a5('0x57')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x542508['body'][_0x56a5('0xd3')]&&_0x196f09>=0xc8&&_0x196f09<=0xce){return _0x41952e['update']({'read':!![]});}else{logger['error'](_0x56a5('0x24'),_0x56a5('0x2b'),'clicksend',util['inspect'](_0x542508[_0x56a5('0x57')],{'showHidden':![],'depth':null}));}break;case _0x56a5('0x8c'):var _0x4f8749=_0x542508[_0x56a5('0x57')][_0x56a5('0x8d')][0x0];if(_0x4f8749[_0x56a5('0x2b')][_0x56a5('0xcf')]===_0x56a5('0xd0')){return _0x41952e[_0x56a5('0x60')]({'read':!![]});}else{logger[_0x56a5('0x27')](_0x56a5('0x24'),_0x56a5('0x2b'),_0x56a5('0x8c'),util['inspect'](_0x542508['body'],{'showHidden':![],'depth':null}));}break;case _0x56a5('0xd1'):if(_0x196f09==_0x56a5('0xd4')||_0x196f09==_0x56a5('0xd5')){return _0x41952e[_0x56a5('0x60')]({'read':!![]});}else{logger[_0x56a5('0x27')](_0x56a5('0x24'),_0x56a5('0x2b'),_0x56a5('0xd1'),util['inspect'](_0x542508[_0x56a5('0x57')],{'showHidden':![],'depth':null}));}break;case _0x56a5('0xd6'):if(_0x196f09===_0x56a5('0xd7')||_0x196f09==='ACCEPTD'){return _0x41952e[_0x56a5('0x60')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x56a5('0xd6'),util[_0x56a5('0xca')](_0x542508[_0x56a5('0x57')],{'showHidden':![],'depth':null}));}break;}return _0x41952e;}})[_0x56a5('0x20')](respondWithResult(_0x2e5583,null))[_0x56a5('0x2a')](handleError(_0x2e5583,null));};exports[_0x56a5('0xd8')]=function(_0x394553,_0x23732c,_0x1db316){var _0x11dfb3,_0x56686e,_0x4e5afc;return db['SmsAccount']['find']({'where':{'id':_0x394553['params']['id']}})[_0x56a5('0x20')](handleEntityNotFound(_0x23732c,null))[_0x56a5('0x20')](function(_0x47931f){if(_0x47931f){_0x4e5afc=_0x47931f;logger[_0x56a5('0x23')](_0x56a5('0x24'),_0x56a5('0x2b'),_0x56a5('0xc9'),_0x47931f['type'],util[_0x56a5('0xca')](_0x394553[_0x56a5('0x46')],{'showHidden':![],'depth':null}));switch(_0x47931f[_0x56a5('0x40')]){case _0x56a5('0xd9'):if(_0x394553[_0x56a5('0x46')][_0x56a5('0xda')]&&_0x394553[_0x56a5('0x46')][_0x56a5('0xdb')]){_0x56686e=_0x394553['query']['state'];return db['SmsMessage'][_0x56a5('0x5d')]({'where':{'messageId':_0x394553[_0x56a5('0x46')][_0x56a5('0xda')]}});}break;}}})[_0x56a5('0x20')](handleEntityNotFound(_0x23732c,null))['then'](function(_0x226f8b){if(_0x226f8b){_0x11dfb3=_0x226f8b;switch(_0x4e5afc[_0x56a5('0x40')]){case _0x56a5('0xd9'):if(_0x56686e==='2'||_0x56686e==='6'){return _0x11dfb3[_0x56a5('0x60')]({'read':!![]});}else{logger[_0x56a5('0x27')](_0x56a5('0x24'),'status',_0x56a5('0xd9'),util[_0x56a5('0xca')](_0x394553[_0x56a5('0x46')],{'showHidden':![],'depth':null}));};break;}return _0x11dfb3;}})[_0x56a5('0x20')](respondWithResult(_0x23732c,null))[_0x56a5('0x2a')](handleError(_0x23732c,null));};exports[_0x56a5('0xdc')]=function(_0x1da1d4,_0x20e12d,_0x4016de){return db[_0x56a5('0x3d')]['find']({'where':{'id':_0x1da1d4[_0x56a5('0x54')]['id']}})[_0x56a5('0x20')](handleEntityNotFound(_0x20e12d,null))['then'](function(_0x134c30){if(_0x134c30){return _0x134c30[_0x56a5('0xdc')](_0x1da1d4['body'][_0x56a5('0x6c')],_[_0x56a5('0x9a')](_0x1da1d4['body'],[_0x56a5('0x6c'),'id'])||{})[_0x56a5('0x9d')](function(_0x453237){for(var _0x902dac=0x0;_0x902dac<_0x1da1d4[_0x56a5('0x57')]['ids'][_0x56a5('0x49')];_0x902dac+=0x1){socket[_0x56a5('0xdd')](_0x56a5('0xde'),{'UserId':_0x1da1d4[_0x56a5('0x57')]['ids'][_0x902dac],'SmsAccountId':_0x1da1d4['params']['id']});}return _0x453237;});}})['then'](respondWithResult(_0x20e12d,null))[_0x56a5('0x2a')](handleError(_0x20e12d,null));};exports[_0x56a5('0xdf')]=function(_0x18d06e,_0x37df4a,_0x480924){return db['SmsAccount']['find']({'where':{'id':_0x18d06e['params']['id']}})[_0x56a5('0x20')](handleEntityNotFound(_0x37df4a,null))[_0x56a5('0x20')](function(_0x3c133d){if(_0x3c133d){return _0x3c133d[_0x56a5('0xdf')](_0x18d06e[_0x56a5('0x46')][_0x56a5('0x6c')])[_0x56a5('0x20')](function(){if(_[_0x56a5('0xe0')](_0x18d06e[_0x56a5('0x46')][_0x56a5('0x6c')])){for(var _0x2a6774=0x0;_0x2a6774<_0x18d06e[_0x56a5('0x46')][_0x56a5('0x6c')][_0x56a5('0x49')];_0x2a6774+=0x1){socket[_0x56a5('0xdd')](_0x56a5('0xe1'),{'UserId':Number(_0x18d06e['query'][_0x56a5('0x6c')][_0x2a6774]),'SmsAccountId':Number(_0x18d06e[_0x56a5('0x54')]['id'])});}}else{socket[_0x56a5('0xdd')](_0x56a5('0xe1'),{'UserId':Number(_0x18d06e['query'][_0x56a5('0x6c')]),'SmsAccountId':Number(_0x18d06e[_0x56a5('0x54')]['id'])});}});}})[_0x56a5('0x20')](respondWithStatusCode(_0x37df4a,null))[_0x56a5('0x2a')](handleError(_0x37df4a,null));};exports['getAgents']=function(_0x4ef9d5,_0x5e8bc4,_0x290290){var _0x541d78={};var _0x4b504c={};var _0x4eadc4;var _0x2e3c9f;return db[_0x56a5('0x3d')][_0x56a5('0x65')]({'where':{'id':_0x4ef9d5['params']['id']}})[_0x56a5('0x20')](handleEntityNotFound(_0x5e8bc4,null))[_0x56a5('0x20')](function(_0x292370){if(_0x292370){_0x4eadc4=_0x292370;_0x4b504c['model']=_[_0x56a5('0x43')](db[_0x56a5('0xbb')]['rawAttributes']);_0x4b504c[_0x56a5('0x46')]=_[_0x56a5('0x43')](_0x4ef9d5[_0x56a5('0x46')]);_0x4b504c[_0x56a5('0x44')]=_[_0x56a5('0x45')](_0x4b504c[_0x56a5('0x42')],_0x4b504c[_0x56a5('0x46')]);_0x541d78['attributes']=_[_0x56a5('0x45')](_0x4b504c[_0x56a5('0x42')],qs[_0x56a5('0x48')](_0x4ef9d5[_0x56a5('0x46')][_0x56a5('0x48')]));_0x541d78[_0x56a5('0x47')]=_0x541d78['attributes'][_0x56a5('0x49')]?_0x541d78[_0x56a5('0x47')]:_0x4b504c[_0x56a5('0x42')];_0x541d78[_0x56a5('0x4b')]=qs['sort'](_0x4ef9d5['query'][_0x56a5('0x67')]);_0x541d78[_0x56a5('0x4c')]=qs[_0x56a5('0x44')](_[_0x56a5('0x70')](_0x4ef9d5['query'],_0x4b504c['filters']));if(_0x4ef9d5['query'][_0x56a5('0x69')]){_0x541d78['where']=_[_0x56a5('0x6a')](_0x541d78[_0x56a5('0x4c')],{'$or':_[_0x56a5('0x3c')](_0x541d78[_0x56a5('0x47')],function(_0x4d2d4c){var _0x3d4d09={};_0x3d4d09[_0x4d2d4c]={'$like':'%'+_0x4ef9d5['query']['filter']+'%'};return _0x3d4d09;})});}_0x541d78=_[_0x56a5('0x6a')]({},_0x541d78,_0x4ef9d5[_0x56a5('0x4e')]);return _0x4eadc4[_0x56a5('0xe2')](_0x541d78);}})[_0x56a5('0x20')](function(_0x35a616){if(_0x35a616){_0x2e3c9f=_0x35a616['length'];if(!_0x4ef9d5[_0x56a5('0x46')]['hasOwnProperty']('nolimit')){_0x541d78[_0x56a5('0x2f')]=qs['limit'](_0x4ef9d5[_0x56a5('0x46')][_0x56a5('0x2f')]);_0x541d78[_0x56a5('0x2e')]=qs[_0x56a5('0x2e')](_0x4ef9d5['query'][_0x56a5('0x2e')]);}return _0x4eadc4[_0x56a5('0xe2')](_0x541d78);}})[_0x56a5('0x20')](function(_0x2cb769){if(_0x2cb769){return _0x2cb769?{'count':_0x2e3c9f,'rows':_0x2cb769}:null;}})[_0x56a5('0x20')](respondWithResult(_0x5e8bc4,null))['catch'](handleError(_0x5e8bc4,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index c057726..0d016d5 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 _0x2670=['SmsAccount','setMaxListeners','save','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x4a1dfc,_0x206662){var _0x40c67d=function(_0x4dcb32){while(--_0x4dcb32){_0x4a1dfc['push'](_0x4a1dfc['shift']());}};_0x40c67d(++_0x206662);}(_0x2670,0x67));var _0x0267=function(_0x5dd981,_0x38e6e0){_0x5dd981=_0x5dd981-0x0;var _0x3f0d66=_0x2670[_0x5dd981];return _0x3f0d66;};'use strict';var EventEmitter=require('events');var SmsAccount=require(_0x0267('0x0'))['db'][_0x0267('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x0267('0x2')](0x0);var events={'afterCreate':_0x0267('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3426c6){return function(_0x2c051d,_0x57a36a,_0x1e0a58){SmsAccountEvents[_0x0267('0x4')](_0x3426c6+':'+_0x2c051d['id'],_0x2c051d);SmsAccountEvents[_0x0267('0x4')](_0x3426c6,_0x2c051d);_0x1e0a58(null);};}for(var e in events){if(events[_0x0267('0x5')](e)){var event=events[e];SmsAccount[_0x0267('0x6')](e,emitEvent(event));}}module[_0x0267('0x7')]=SmsAccountEvents; \ No newline at end of file +var _0xb8d0=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb8d0,0x1d0));var _0x0b8d=function(_0x39f74c,_0x2927b5){_0x39f74c=_0x39f74c-0x0;var _0x58d652=_0xb8d0[_0x39f74c];return _0x58d652;};'use strict';var EventEmitter=require(_0x0b8d('0x0'));var SmsAccount=require(_0x0b8d('0x1'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x0b8d('0x2')](0x0);var events={'afterCreate':_0x0b8d('0x3'),'afterUpdate':_0x0b8d('0x4'),'afterDestroy':_0x0b8d('0x5')};function emitEvent(_0x38d447){return function(_0x21ca23,_0x3c7df5,_0x326adf){SmsAccountEvents[_0x0b8d('0x6')](_0x38d447+':'+_0x21ca23['id'],_0x21ca23);SmsAccountEvents['emit'](_0x38d447,_0x21ca23);_0x326adf(null);};}for(var e in events){if(events[_0x0b8d('0x7')](e)){var event=events[e];SmsAccount[_0x0b8d('0x8')](e,emitEvent(event));}}module[_0x0b8d('0x9')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index d5c3a48..5ec34c0 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 _0x3b88=['moment','request-promise','path','rimraf','SmsAccount','sms_accounts','lodash','../../config/logger','api'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x3b88,0xb1));var _0x83b8=function(_0x44f90b,_0x186088){_0x44f90b=_0x44f90b-0x0;var _0x10c90b=_0x3b88[_0x44f90b];return _0x10c90b;};'use strict';var _=require(_0x83b8('0x0'));var util=require('util');var logger=require(_0x83b8('0x1'))(_0x83b8('0x2'));var moment=require(_0x83b8('0x3'));var BPromise=require('bluebird');var rp=require(_0x83b8('0x4'));var fs=require('fs');var path=require(_0x83b8('0x5'));var rimraf=require(_0x83b8('0x6'));var config=require('../../config/environment');var attributes=require('./smsAccount.attributes');module['exports']=function(_0xc13037,_0x5e3de7){return _0xc13037['define'](_0x83b8('0x7'),attributes,{'tableName':_0x83b8('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa0cd=['moment','request-promise','path','rimraf','./smsAccount.attributes','define','lodash'];(function(_0x140e05,_0x4c25ac){var _0x5cdce1=function(_0x13b387){while(--_0x13b387){_0x140e05['push'](_0x140e05['shift']());}};_0x5cdce1(++_0x4c25ac);}(_0xa0cd,0x7d));var _0xda0c=function(_0x5f0ecc,_0x36e3de){_0x5f0ecc=_0x5f0ecc-0x0;var _0x47b0ed=_0xa0cd[_0x5f0ecc];return _0x47b0ed;};'use strict';var _=require(_0xda0c('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xda0c('0x1'));var BPromise=require('bluebird');var rp=require(_0xda0c('0x2'));var fs=require('fs');var path=require(_0xda0c('0x3'));var rimraf=require(_0xda0c('0x4'));var config=require('../../config/environment');var attributes=require(_0xda0c('0x5'));module['exports']=function(_0x24bc27,_0x3fd89a){return _0x24bc27[_0xda0c('0x6')]('SmsAccount',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 33ed64b..201a0cf 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 _0xbcbf=['model','attributes','ShowSmsAccount','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./smsAccount.socket','register','request','then','info','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','SmsAccount','where','options','include','map'];(function(_0xccfe05,_0x4e9342){var _0x4ad504=function(_0x15da1a){while(--_0x15da1a){_0xccfe05['push'](_0xccfe05['shift']());}};_0x4ad504(++_0x4e9342);}(_0xbcbf,0xb8));var _0xfbcb=function(_0x41568e,_0x5ab27b){_0x41568e=_0x41568e-0x0;var _0x40db40=_0xbcbf[_0x41568e];return _0x40db40;};'use strict';var _=require(_0xfbcb('0x0'));var util=require(_0xfbcb('0x1'));var moment=require(_0xfbcb('0x2'));var BPromise=require('bluebird');var rs=require(_0xfbcb('0x3'));var fs=require('fs');var Redis=require(_0xfbcb('0x4'));var db=require(_0xfbcb('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xfbcb('0x6'));var config=require(_0xfbcb('0x7'));var jayson=require(_0xfbcb('0x8'));var client=jayson[_0xfbcb('0x9')]['http']({'port':0x232a});config[_0xfbcb('0xa')]=_['defaults'](config[_0xfbcb('0xa')],{'host':_0xfbcb('0xb'),'port':0x18eb});var socket=require(_0xfbcb('0xc'))(new Redis(config[_0xfbcb('0xa')]));require(_0xfbcb('0xd'))[_0xfbcb('0xe')](socket);function respondWithRpcPromise(_0x4920ed,_0x50431e,_0xb9286f){return new BPromise(function(_0x3e61bf,_0x3d8c3c){return client[_0xfbcb('0xf')](_0x4920ed,_0xb9286f)[_0xfbcb('0x10')](function(_0x2c7b88){logger[_0xfbcb('0x11')](_0xfbcb('0x12'),_0x50431e,'request\x20sent');logger[_0xfbcb('0x13')](_0xfbcb('0x14'),_0x50431e,'request\x20sent',JSON[_0xfbcb('0x15')](_0x2c7b88));if(_0x2c7b88[_0xfbcb('0x16')]){if(_0x2c7b88[_0xfbcb('0x16')][_0xfbcb('0x17')]===0x1f4){logger[_0xfbcb('0x16')](_0xfbcb('0x12'),_0x50431e,_0x2c7b88[_0xfbcb('0x16')]['message']);return _0x3d8c3c(_0x2c7b88[_0xfbcb('0x16')][_0xfbcb('0x18')]);}logger['error'](_0xfbcb('0x12'),_0x50431e,_0x2c7b88[_0xfbcb('0x16')]['message']);return _0x3e61bf(_0x2c7b88[_0xfbcb('0x16')][_0xfbcb('0x18')]);}else{logger[_0xfbcb('0x11')](_0xfbcb('0x12'),_0x50431e,_0xfbcb('0x19'));_0x3e61bf(_0x2c7b88[_0xfbcb('0x1a')]['message']);}})['catch'](function(_0x2a4054){logger[_0xfbcb('0x16')](_0xfbcb('0x12'),_0x50431e,_0x2a4054);_0x3d8c3c(_0x2a4054);});});}exports['ShowSmsAccount']=function(_0x101ffe){var _0xe28a9d=this;return new Promise(function(_0x15bc09,_0x46749d){return db[_0xfbcb('0x1b')]['find']({'raw':_0x101ffe['options']?_0x101ffe['options']['raw']===undefined?!![]:![]:!![],'where':_0x101ffe['options']?_0x101ffe['options'][_0xfbcb('0x1c')]||null:null,'attributes':_0x101ffe[_0xfbcb('0x1d')]?_0x101ffe['options']['attributes']||null:null,'include':_0x101ffe[_0xfbcb('0x1d')]?_0x101ffe[_0xfbcb('0x1d')][_0xfbcb('0x1e')]?_[_0xfbcb('0x1f')](_0x101ffe[_0xfbcb('0x1d')]['include'],function(_0x232ef5){return{'model':db[_0x232ef5[_0xfbcb('0x20')]],'as':_0x232ef5['as'],'attributes':_0x232ef5['attributes'],'include':_0x232ef5[_0xfbcb('0x1e')]?_[_0xfbcb('0x1f')](_0x232ef5[_0xfbcb('0x1e')],function(_0x2e2dc1){return{'model':db[_0x2e2dc1[_0xfbcb('0x20')]],'as':_0x2e2dc1['as'],'attributes':_0x2e2dc1[_0xfbcb('0x21')],'include':_0x2e2dc1['include']?_[_0xfbcb('0x1f')](_0x2e2dc1['include'],function(_0x32cdc8){return{'model':db[_0x32cdc8[_0xfbcb('0x20')]],'as':_0x32cdc8['as'],'attributes':_0x32cdc8['attributes']};}):[]};}):[]};}):[]:[]})[_0xfbcb('0x10')](function(_0x559a6d){logger[_0xfbcb('0x11')](_0xfbcb('0x22'),_0x101ffe);logger[_0xfbcb('0x13')]('ShowSmsAccount',_0x101ffe,JSON['stringify'](_0x559a6d));_0x15bc09(_0x559a6d);})[_0xfbcb('0x23')](function(_0x41d5c0){logger['error']('ShowSmsAccount',_0x41d5c0[_0xfbcb('0x18')],_0x101ffe);_0x46749d(_0xe28a9d['error'](0x1f4,_0x41d5c0[_0xfbcb('0x18')]));});});}; \ No newline at end of file +var _0x1df3=['SmsAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','ShowSmsAccount','SmsAccount','find','options','where','attributes','include','map','model','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./smsAccount.socket','register','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x24da32,_0x371887){var _0x27bfd4=function(_0x58fd8d){while(--_0x58fd8d){_0x24da32['push'](_0x24da32['shift']());}};_0x27bfd4(++_0x371887);}(_0x1df3,0x165));var _0x31df=function(_0x330abf,_0x84f2a8){_0x330abf=_0x330abf-0x0;var _0x45f0c9=_0x1df3[_0x330abf];return _0x45f0c9;};'use strict';var _=require(_0x31df('0x0'));var util=require(_0x31df('0x1'));var moment=require(_0x31df('0x2'));var BPromise=require(_0x31df('0x3'));var rs=require(_0x31df('0x4'));var fs=require('fs');var Redis=require(_0x31df('0x5'));var db=require(_0x31df('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x31df('0x7'))('rpc');var config=require(_0x31df('0x8'));var jayson=require(_0x31df('0x9'));var client=jayson[_0x31df('0xa')][_0x31df('0xb')]({'port':0x232a});config[_0x31df('0xc')]=_[_0x31df('0xd')](config['redis'],{'host':_0x31df('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x31df('0xc')]));require(_0x31df('0xf'))[_0x31df('0x10')](socket);function respondWithRpcPromise(_0x3fe73b,_0x5d2b01,_0x1704b5){return new BPromise(function(_0x22f0c5,_0x3dafc1){return client[_0x31df('0x11')](_0x3fe73b,_0x1704b5)[_0x31df('0x12')](function(_0xd52657){logger[_0x31df('0x13')](_0x31df('0x14'),_0x5d2b01,_0x31df('0x15'));logger[_0x31df('0x16')](_0x31df('0x17'),_0x5d2b01,_0x31df('0x15'),JSON['stringify'](_0xd52657));if(_0xd52657[_0x31df('0x18')]){if(_0xd52657[_0x31df('0x18')][_0x31df('0x19')]===0x1f4){logger[_0x31df('0x18')](_0x31df('0x14'),_0x5d2b01,_0xd52657[_0x31df('0x18')][_0x31df('0x1a')]);return _0x3dafc1(_0xd52657[_0x31df('0x18')]['message']);}logger[_0x31df('0x18')](_0x31df('0x14'),_0x5d2b01,_0xd52657[_0x31df('0x18')]['message']);return _0x22f0c5(_0xd52657[_0x31df('0x18')][_0x31df('0x1a')]);}else{logger['info'](_0x31df('0x14'),_0x5d2b01,_0x31df('0x15'));_0x22f0c5(_0xd52657['result'][_0x31df('0x1a')]);}})[_0x31df('0x1b')](function(_0x2c1575){logger[_0x31df('0x18')](_0x31df('0x14'),_0x5d2b01,_0x2c1575);_0x3dafc1(_0x2c1575);});});}exports[_0x31df('0x1c')]=function(_0x358909){var _0x2f39cc=this;return new Promise(function(_0x3941b2,_0x119566){return db[_0x31df('0x1d')][_0x31df('0x1e')]({'raw':_0x358909[_0x31df('0x1f')]?_0x358909[_0x31df('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x358909['options']?_0x358909[_0x31df('0x1f')][_0x31df('0x20')]||null:null,'attributes':_0x358909[_0x31df('0x1f')]?_0x358909[_0x31df('0x1f')][_0x31df('0x21')]||null:null,'include':_0x358909['options']?_0x358909['options'][_0x31df('0x22')]?_[_0x31df('0x23')](_0x358909[_0x31df('0x1f')][_0x31df('0x22')],function(_0x33c4e7){return{'model':db[_0x33c4e7[_0x31df('0x24')]],'as':_0x33c4e7['as'],'attributes':_0x33c4e7[_0x31df('0x21')],'include':_0x33c4e7['include']?_['map'](_0x33c4e7[_0x31df('0x22')],function(_0x33ac4a){return{'model':db[_0x33ac4a[_0x31df('0x24')]],'as':_0x33ac4a['as'],'attributes':_0x33ac4a[_0x31df('0x21')],'include':_0x33ac4a['include']?_['map'](_0x33ac4a[_0x31df('0x22')],function(_0x4542cf){return{'model':db[_0x4542cf[_0x31df('0x24')]],'as':_0x4542cf['as'],'attributes':_0x4542cf[_0x31df('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x107f93){logger[_0x31df('0x13')](_0x31df('0x1c'),_0x358909);logger['debug'](_0x31df('0x1c'),_0x358909,JSON[_0x31df('0x25')](_0x107f93));_0x3941b2(_0x107f93);})['catch'](function(_0x6ef27e){logger[_0x31df('0x18')](_0x31df('0x1c'),_0x6ef27e[_0x31df('0x1a')],_0x358909);_0x119566(_0x2f39cc['error'](0x1f4,_0x6ef27e[_0x31df('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 514f1d0..c53f7ad 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 _0xc610=['smsAccount:','./smsAccount.events','save','remove','update','emit','removeListener','length'];(function(_0x3aaf69,_0x318ff9){var _0x4542c6=function(_0x5d1369){while(--_0x5d1369){_0x3aaf69['push'](_0x3aaf69['shift']());}};_0x4542c6(++_0x318ff9);}(_0xc610,0x1d9));var _0x0c61=function(_0x17a208,_0x5302df){_0x17a208=_0x17a208-0x0;var _0x1f7f67=_0xc610[_0x17a208];return _0x1f7f67;};'use strict';var SmsAccountEvents=require(_0x0c61('0x0'));var events=[_0x0c61('0x1'),_0x0c61('0x2'),_0x0c61('0x3')];function createListener(_0x495f28,_0x2e6a30){return function(_0x31a22e){_0x2e6a30[_0x0c61('0x4')](_0x495f28,_0x31a22e);};}function removeListener(_0x3c48bd,_0x4a13b0){return function(){SmsAccountEvents[_0x0c61('0x5')](_0x3c48bd,_0x4a13b0);};}exports['register']=function(_0x4390bd){for(var _0x1e654c=0x0,_0x1d95ad=events[_0x0c61('0x6')];_0x1e654c<_0x1d95ad;_0x1e654c++){var _0x499cae=events[_0x1e654c];var _0x26f1de=createListener(_0x0c61('0x7')+_0x499cae,_0x4390bd);SmsAccountEvents['on'](_0x499cae,_0x26f1de);}}; \ No newline at end of file +var _0xb9c5=['save','update','emit','removeListener','register','smsAccount:'];(function(_0xbc7080,_0x28fe36){var _0x24909a=function(_0x3d5e69){while(--_0x3d5e69){_0xbc7080['push'](_0xbc7080['shift']());}};_0x24909a(++_0x28fe36);}(_0xb9c5,0x90));var _0x5b9c=function(_0x44a8ba,_0x4140bb){_0x44a8ba=_0x44a8ba-0x0;var _0x1ca5cf=_0xb9c5[_0x44a8ba];return _0x1ca5cf;};'use strict';var SmsAccountEvents=require('./smsAccount.events');var events=[_0x5b9c('0x0'),'remove',_0x5b9c('0x1')];function createListener(_0xc181d3,_0x56d7b0){return function(_0x813182){_0x56d7b0[_0x5b9c('0x2')](_0xc181d3,_0x813182);};}function removeListener(_0x3ef9fb,_0x33d6ae){return function(){SmsAccountEvents[_0x5b9c('0x3')](_0x3ef9fb,_0x33d6ae);};}exports[_0x5b9c('0x4')]=function(_0x12b0e8){for(var _0x1d95c1=0x0,_0x1aeadf=events['length'];_0x1d95c1<_0x1aeadf;_0x1d95c1++){var _0x3a12c7=events[_0x1d95c1];var _0x202aaa=createListener(_0x5b9c('0x5')+_0x3a12c7,_0x12b0e8);SmsAccountEvents['on'](_0x3a12c7,_0x202aaa);}}; \ No newline at end of file diff --git a/server/api/smsApplication/index.js b/server/api/smsApplication/index.js index 9483ad3..f03aad5 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 _0x3175=['util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','show','create','put','update','destroy','multer'];(function(_0x2c00e2,_0x4294ad){var _0x58419d=function(_0x233775){while(--_0x233775){_0x2c00e2['push'](_0x2c00e2['shift']());}};_0x58419d(++_0x4294ad);}(_0x3175,0x1ca));var _0x5317=function(_0x45096e,_0x17e82d){_0x45096e=_0x45096e-0x0;var _0xba1fa3=_0x3175[_0x45096e];return _0xba1fa3;};'use strict';var multer=require(_0x5317('0x0'));var util=require(_0x5317('0x1'));var path=require('path');var timeout=require(_0x5317('0x2'));var express=require(_0x5317('0x3'));var router=express[_0x5317('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x5317('0x5'));var config=require(_0x5317('0x6'));var controller=require(_0x5317('0x7'));router[_0x5317('0x8')]('/',auth[_0x5317('0x9')](),controller[_0x5317('0xa')]);router[_0x5317('0x8')](_0x5317('0xb'),auth[_0x5317('0x9')](),controller[_0x5317('0xc')]);router['post']('/',auth[_0x5317('0x9')](),controller[_0x5317('0xd')]);router[_0x5317('0xe')](_0x5317('0xb'),auth['isAuthenticated'](),controller[_0x5317('0xf')]);router['delete'](_0x5317('0xb'),auth[_0x5317('0x9')](),controller[_0x5317('0x10')]);module['exports']=router; \ No newline at end of file +var _0x1f7d=['./smsApplication.controller','isAuthenticated','index','get','/:id','show','post','put','update','exports','multer','util','path','connect-timeout','express','../../config/environment'];(function(_0x2d994d,_0x168a27){var _0xd54be4=function(_0x1db925){while(--_0x1db925){_0x2d994d['push'](_0x2d994d['shift']());}};_0xd54be4(++_0x168a27);}(_0x1f7d,0x1ca));var _0xd1f7=function(_0x5f409e,_0x14c1b2){_0x5f409e=_0x5f409e-0x0;var _0x44ef41=_0x1f7d[_0x5f409e];return _0x44ef41;};'use strict';var multer=require(_0xd1f7('0x0'));var util=require(_0xd1f7('0x1'));var path=require(_0xd1f7('0x2'));var timeout=require(_0xd1f7('0x3'));var express=require(_0xd1f7('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd1f7('0x5'));var controller=require(_0xd1f7('0x6'));router['get']('/',auth[_0xd1f7('0x7')](),controller[_0xd1f7('0x8')]);router[_0xd1f7('0x9')](_0xd1f7('0xa'),auth['isAuthenticated'](),controller[_0xd1f7('0xb')]);router[_0xd1f7('0xc')]('/',auth[_0xd1f7('0x7')](),controller['create']);router[_0xd1f7('0xd')](_0xd1f7('0xa'),auth[_0xd1f7('0x7')](),controller[_0xd1f7('0xe')]);router['delete'](_0xd1f7('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0xd1f7('0xf')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 47e7104..098541c 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 _0xe82f=['TEXT','exports','STRING','noop'];(function(_0x5f746f,_0x5b05ab){var _0x198d15=function(_0x58c7e7){while(--_0x58c7e7){_0x5f746f['push'](_0x5f746f['shift']());}};_0x198d15(++_0x5b05ab);}(_0xe82f,0x199));var _0xfe82=function(_0x55bf83,_0x5b2adf){_0x55bf83=_0x55bf83-0x0;var _0x2ed8f7=_0xe82f[_0x55bf83];return _0x2ed8f7;};'use strict';var Sequelize=require('sequelize');module[_0xfe82('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xfe82('0x1')],'allowNull':![],'defaultValue':_0xfe82('0x2')},'appdata':{'type':Sequelize[_0xfe82('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xfe82('0x1')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x52c0=['STRING','noop','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x1b80e6,_0x178152){var _0x7de38e=function(_0x273e86){while(--_0x273e86){_0x1b80e6['push'](_0x1b80e6['shift']());}};_0x7de38e(++_0x178152);}(_0x52c0,0x170));var _0x052c=function(_0x452f4b,_0x355859){_0x452f4b=_0x452f4b-0x0;var _0x578a26=_0x52c0[_0x452f4b];return _0x578a26;};'use strict';var Sequelize=require(_0x052c('0x0'));module[_0x052c('0x1')]={'priority':{'type':Sequelize[_0x052c('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x052c('0x3')],'allowNull':![],'defaultValue':_0x052c('0x4')},'appdata':{'type':Sequelize[_0x052c('0x5')]()},'description':{'type':Sequelize[_0x052c('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x052c('0x6')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 11ae7d3..fbb81e9 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 _0xfb21=['params','find','create','body','catch','html-pdf','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','offset','set','Content-Range','json','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','nolimit','limit','order','sort','where','pick','filter','merge','options','SmsApplication','count','includeAll','include','findAll','rows'];(function(_0x5522ef,_0x1282ed){var _0x45083a=function(_0x5f4e31){while(--_0x5f4e31){_0x5522ef['push'](_0x5522ef['shift']());}};_0x45083a(++_0x1282ed);}(_0xfb21,0xda));var _0x1fb2=function(_0x2564ad,_0xcd95a0){_0x2564ad=_0x2564ad-0x0;var _0x5ec4aa=_0xfb21[_0x2564ad];return _0x5ec4aa;};'use strict';var pdf=require(_0x1fb2('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x1fb2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1fb2('0x2'));var rp=require(_0x1fb2('0x3'));var moment=require('moment');var BPromise=require(_0x1fb2('0x4'));var Mustache=require('mustache');var util=require(_0x1fb2('0x5'));var path=require(_0x1fb2('0x6'));var sox=require(_0x1fb2('0x7'));var csv=require(_0x1fb2('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x1fb2('0x9'));var squel=require(_0x1fb2('0xa'));var crypto=require(_0x1fb2('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x1fb2('0xc'));var toCsv=require(_0x1fb2('0x8'));var querystring=require(_0x1fb2('0xd'));var Papa=require('papaparse');var Redis=require(_0x1fb2('0xe'));var authService=require(_0x1fb2('0xf'));var qs=require(_0x1fb2('0x10'));var as=require(_0x1fb2('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1fb2('0x12'))(_0x1fb2('0x13'));var utils=require('../../config/utils');var config=require(_0x1fb2('0x14'));var db=require(_0x1fb2('0x15'))['db'];function respondWithStatusCode(_0x1ec5a9,_0x307899){_0x307899=_0x307899||0xcc;return function(_0x17d4c6){if(_0x17d4c6){return _0x1ec5a9[_0x1fb2('0x16')](_0x307899);}return _0x1ec5a9[_0x1fb2('0x17')](_0x307899)[_0x1fb2('0x18')]();};}function respondWithResult(_0x8d521f,_0x27ee4e){_0x27ee4e=_0x27ee4e||0xc8;return function(_0x2cd5dd){if(_0x2cd5dd){return _0x8d521f[_0x1fb2('0x17')](_0x27ee4e)['json'](_0x2cd5dd);}};}function respondWithFilteredResult(_0x3121aa,_0x4be3a9){return function(_0x409edb){if(_0x409edb){var _0x26c415=_0x409edb['count'],_0x1f13e9=_0x4be3a9[_0x1fb2('0x19')],_0x17ff57=_0x4be3a9[_0x1fb2('0x19')]+_0x4be3a9['limit'],_0x14946a;if(_0x17ff57>=_0x26c415){_0x17ff57=_0x26c415;_0x14946a=0xc8;}else{_0x14946a=0xce;}_0x3121aa[_0x1fb2('0x17')](_0x14946a);return _0x3121aa[_0x1fb2('0x1a')](_0x1fb2('0x1b'),_0x1f13e9+'-'+_0x17ff57+'/'+_0x26c415)[_0x1fb2('0x1c')](_0x409edb);}return null;};}function patchUpdates(_0x408385){return function(_0x43e835){try{jsonpatch['apply'](_0x43e835,_0x408385,!![]);}catch(_0x2e57ab){return BPromise[_0x1fb2('0x1d')](_0x2e57ab);}return _0x43e835[_0x1fb2('0x1e')]();};}function saveUpdates(_0x2e654d,_0x5b4954){return function(_0x97316a){if(_0x97316a){return _0x97316a[_0x1fb2('0x1f')](_0x2e654d)[_0x1fb2('0x20')](function(_0x384296){return _0x384296;});}return null;};}function removeEntity(_0x536296,_0x2e1f38){return function(_0x4d6529){if(_0x4d6529){return _0x4d6529[_0x1fb2('0x21')]()[_0x1fb2('0x20')](function(){_0x536296[_0x1fb2('0x17')](0xcc)[_0x1fb2('0x18')]();});}};}function handleEntityNotFound(_0x569a17,_0x2d611c){return function(_0x584d2f){if(!_0x584d2f){_0x569a17[_0x1fb2('0x16')](0x194);}return _0x584d2f;};}function handleError(_0x560c7d,_0xa3071e){_0xa3071e=_0xa3071e||0x1f4;return function(_0x4f226c){logger[_0x1fb2('0x22')](_0x4f226c[_0x1fb2('0x23')]);if(_0x4f226c['name']){delete _0x4f226c[_0x1fb2('0x24')];}_0x560c7d['status'](_0xa3071e)[_0x1fb2('0x25')](_0x4f226c);};}exports[_0x1fb2('0x26')]=function(_0x10d42f,_0x398ba1){var _0x251292={},_0x301ea4={},_0x39024e={'count':0x0,'rows':[]};var _0x44675d=_[_0x1fb2('0x27')](db['SmsApplication'][_0x1fb2('0x28')],function(_0x2a83e1){return{'name':_0x2a83e1[_0x1fb2('0x29')],'type':_0x2a83e1[_0x1fb2('0x2a')]['key']};});_0x301ea4[_0x1fb2('0x2b')]=_['map'](_0x44675d,'name');_0x301ea4[_0x1fb2('0x2c')]=_[_0x1fb2('0x2d')](_0x10d42f['query']);_0x301ea4[_0x1fb2('0x2e')]=_[_0x1fb2('0x2f')](_0x301ea4[_0x1fb2('0x2b')],_0x301ea4['query']);_0x251292['attributes']=_[_0x1fb2('0x2f')](_0x301ea4[_0x1fb2('0x2b')],qs[_0x1fb2('0x30')](_0x10d42f['query'][_0x1fb2('0x30')]));_0x251292['attributes']=_0x251292[_0x1fb2('0x31')][_0x1fb2('0x32')]?_0x251292[_0x1fb2('0x31')]:_0x301ea4['model'];if(!_0x10d42f[_0x1fb2('0x2c')]['hasOwnProperty'](_0x1fb2('0x33'))){_0x251292[_0x1fb2('0x34')]=qs['limit'](_0x10d42f['query'][_0x1fb2('0x34')]);_0x251292[_0x1fb2('0x19')]=qs[_0x1fb2('0x19')](_0x10d42f[_0x1fb2('0x2c')][_0x1fb2('0x19')]);}_0x251292[_0x1fb2('0x35')]=qs[_0x1fb2('0x36')](_0x10d42f[_0x1fb2('0x2c')][_0x1fb2('0x36')]);_0x251292[_0x1fb2('0x37')]=qs[_0x1fb2('0x2e')](_[_0x1fb2('0x38')](_0x10d42f[_0x1fb2('0x2c')],_0x301ea4[_0x1fb2('0x2e')]));if(_0x10d42f[_0x1fb2('0x2c')][_0x1fb2('0x39')]){_0x251292[_0x1fb2('0x37')]=_['merge'](_0x251292[_0x1fb2('0x37')],{'$or':_[_0x1fb2('0x27')](_0x44675d,function(_0x3e5fe2){if(_0x3e5fe2[_0x1fb2('0x2a')]!=='VIRTUAL'){var _0x45078c={};_0x45078c[_0x3e5fe2[_0x1fb2('0x24')]]={'$like':'%'+_0x10d42f[_0x1fb2('0x2c')][_0x1fb2('0x39')]+'%'};return _0x45078c;}})});}_0x251292=_[_0x1fb2('0x3a')]({},_0x251292,_0x10d42f[_0x1fb2('0x3b')]);var _0x1e396d={'where':_0x251292[_0x1fb2('0x37')]};return db[_0x1fb2('0x3c')][_0x1fb2('0x3d')](_0x1e396d)[_0x1fb2('0x20')](function(_0x2647f){_0x39024e[_0x1fb2('0x3d')]=_0x2647f;if(_0x10d42f['query'][_0x1fb2('0x3e')]){_0x251292[_0x1fb2('0x3f')]=[{'all':!![]}];}return db[_0x1fb2('0x3c')][_0x1fb2('0x40')](_0x251292);})[_0x1fb2('0x20')](function(_0x12ca28){_0x39024e[_0x1fb2('0x41')]=_0x12ca28;return _0x39024e;})[_0x1fb2('0x20')](respondWithFilteredResult(_0x398ba1,_0x251292))['catch'](handleError(_0x398ba1,null));};exports['show']=function(_0x1b8f26,_0x3ae669){var _0x206833={'raw':!![],'where':{'id':_0x1b8f26[_0x1fb2('0x42')]['id']}},_0x216f70={};_0x216f70['model']=_[_0x1fb2('0x2d')](db[_0x1fb2('0x3c')]['rawAttributes']);_0x216f70[_0x1fb2('0x2c')]=_[_0x1fb2('0x2d')](_0x1b8f26['query']);_0x216f70[_0x1fb2('0x2e')]=_['intersection'](_0x216f70[_0x1fb2('0x2b')],_0x216f70['query']);_0x206833[_0x1fb2('0x31')]=_[_0x1fb2('0x2f')](_0x216f70[_0x1fb2('0x2b')],qs[_0x1fb2('0x30')](_0x1b8f26[_0x1fb2('0x2c')]['fields']));_0x206833[_0x1fb2('0x31')]=_0x206833['attributes'][_0x1fb2('0x32')]?_0x206833['attributes']:_0x216f70[_0x1fb2('0x2b')];if(_0x1b8f26['query'][_0x1fb2('0x3e')]){_0x206833[_0x1fb2('0x3f')]=[{'all':!![]}];}_0x206833=_[_0x1fb2('0x3a')]({},_0x206833,_0x1b8f26[_0x1fb2('0x3b')]);return db[_0x1fb2('0x3c')][_0x1fb2('0x43')](_0x206833)[_0x1fb2('0x20')](handleEntityNotFound(_0x3ae669,null))['then'](respondWithResult(_0x3ae669,null))['catch'](handleError(_0x3ae669,null));};exports[_0x1fb2('0x44')]=function(_0x154099,_0x337ee8){return db[_0x1fb2('0x3c')][_0x1fb2('0x44')](_0x154099[_0x1fb2('0x45')],{})[_0x1fb2('0x20')](respondWithResult(_0x337ee8,0xc9))['catch'](handleError(_0x337ee8,null));};exports[_0x1fb2('0x1f')]=function(_0x5ec409,_0x1530b5){if(_0x5ec409[_0x1fb2('0x45')]['id']){delete _0x5ec409[_0x1fb2('0x45')]['id'];}return db[_0x1fb2('0x3c')][_0x1fb2('0x43')]({'where':{'id':_0x5ec409[_0x1fb2('0x42')]['id']}})[_0x1fb2('0x20')](handleEntityNotFound(_0x1530b5,null))[_0x1fb2('0x20')](saveUpdates(_0x5ec409['body'],null))[_0x1fb2('0x20')](respondWithResult(_0x1530b5,null))[_0x1fb2('0x46')](handleError(_0x1530b5,null));};exports[_0x1fb2('0x21')]=function(_0x57b88e,_0x3deae2){return db[_0x1fb2('0x3c')][_0x1fb2('0x43')]({'where':{'id':_0x57b88e['params']['id']}})[_0x1fb2('0x20')](handleEntityNotFound(_0x3deae2,null))[_0x1fb2('0x20')](removeEntity(_0x3deae2,null))['catch'](handleError(_0x3deae2,null));}; \ No newline at end of file +var _0x0191=['bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','SmsApplication','rawAttributes','type','key','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','filter','merge','options','count','include','rows','catch','show','includeAll','create','body','params','find','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment'];(function(_0x5d8e7b,_0x1ee72e){var _0x1f9c28=function(_0x9ad6fd){while(--_0x9ad6fd){_0x5d8e7b['push'](_0x5d8e7b['shift']());}};_0x1f9c28(++_0x1ee72e);}(_0x0191,0x1f2));var _0x1019=function(_0x803ae0,_0x5c5f30){_0x803ae0=_0x803ae0-0x0;var _0x3c38b1=_0x0191[_0x803ae0];return _0x3c38b1;};'use strict';var pdf=require(_0x1019('0x0'));var emlformat=require(_0x1019('0x1'));var rimraf=require(_0x1019('0x2'));var zipdir=require(_0x1019('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1019('0x4'));var moment=require(_0x1019('0x5'));var BPromise=require(_0x1019('0x6'));var Mustache=require(_0x1019('0x7'));var util=require(_0x1019('0x8'));var path=require(_0x1019('0x9'));var sox=require(_0x1019('0xa'));var csv=require(_0x1019('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x1019('0xc'));var crypto=require(_0x1019('0xd'));var jsforce=require(_0x1019('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x1019('0xb'));var querystring=require(_0x1019('0xf'));var Papa=require(_0x1019('0x10'));var Redis=require(_0x1019('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x1019('0x12'));var as=require(_0x1019('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x1019('0x14'));var config=require(_0x1019('0x15'));var db=require(_0x1019('0x16'))['db'];function respondWithStatusCode(_0x2a024f,_0x539176){_0x539176=_0x539176||0xcc;return function(_0x2a747b){if(_0x2a747b){return _0x2a024f['sendStatus'](_0x539176);}return _0x2a024f[_0x1019('0x17')](_0x539176)[_0x1019('0x18')]();};}function respondWithResult(_0x3a43f0,_0x11561b){_0x11561b=_0x11561b||0xc8;return function(_0x6dae1){if(_0x6dae1){return _0x3a43f0[_0x1019('0x17')](_0x11561b)[_0x1019('0x19')](_0x6dae1);}};}function respondWithFilteredResult(_0x2d0f82,_0x3a5cbf){return function(_0x59f3f4){if(_0x59f3f4){var _0x1251f7=_0x59f3f4['count'],_0x59ab9e=_0x3a5cbf[_0x1019('0x1a')],_0x1facea=_0x3a5cbf[_0x1019('0x1a')]+_0x3a5cbf['limit'],_0x3fe365;if(_0x1facea>=_0x1251f7){_0x1facea=_0x1251f7;_0x3fe365=0xc8;}else{_0x3fe365=0xce;}_0x2d0f82[_0x1019('0x17')](_0x3fe365);return _0x2d0f82[_0x1019('0x1b')](_0x1019('0x1c'),_0x59ab9e+'-'+_0x1facea+'/'+_0x1251f7)['json'](_0x59f3f4);}return null;};}function patchUpdates(_0x360e75){return function(_0x299388){try{jsonpatch[_0x1019('0x1d')](_0x299388,_0x360e75,!![]);}catch(_0x40a88d){return BPromise[_0x1019('0x1e')](_0x40a88d);}return _0x299388['save']();};}function saveUpdates(_0x52b566,_0x528611){return function(_0x409d3c){if(_0x409d3c){return _0x409d3c[_0x1019('0x1f')](_0x52b566)[_0x1019('0x20')](function(_0x36179c){return _0x36179c;});}return null;};}function removeEntity(_0xa04a9f,_0x12db90){return function(_0x51fcd9){if(_0x51fcd9){return _0x51fcd9[_0x1019('0x21')]()['then'](function(){_0xa04a9f[_0x1019('0x17')](0xcc)[_0x1019('0x18')]();});}};}function handleEntityNotFound(_0xaf7c39,_0x30e245){return function(_0x404b7b){if(!_0x404b7b){_0xaf7c39[_0x1019('0x22')](0x194);}return _0x404b7b;};}function handleError(_0x3c014c,_0x248db6){_0x248db6=_0x248db6||0x1f4;return function(_0x29481a){logger[_0x1019('0x23')](_0x29481a[_0x1019('0x24')]);if(_0x29481a[_0x1019('0x25')]){delete _0x29481a[_0x1019('0x25')];}_0x3c014c[_0x1019('0x17')](_0x248db6)[_0x1019('0x26')](_0x29481a);};}exports[_0x1019('0x27')]=function(_0x17323e,_0x4c4f16){var _0x5985f7={},_0x38beba={},_0x135877={'count':0x0,'rows':[]};var _0x2949f7=_['map'](db[_0x1019('0x28')][_0x1019('0x29')],function(_0x5a91b6){return{'name':_0x5a91b6['fieldName'],'type':_0x5a91b6[_0x1019('0x2a')][_0x1019('0x2b')]};});_0x38beba['model']=_[_0x1019('0x2c')](_0x2949f7,'name');_0x38beba[_0x1019('0x2d')]=_[_0x1019('0x2e')](_0x17323e['query']);_0x38beba['filters']=_[_0x1019('0x2f')](_0x38beba[_0x1019('0x30')],_0x38beba['query']);_0x5985f7[_0x1019('0x31')]=_[_0x1019('0x2f')](_0x38beba[_0x1019('0x30')],qs[_0x1019('0x32')](_0x17323e[_0x1019('0x2d')]['fields']));_0x5985f7[_0x1019('0x31')]=_0x5985f7[_0x1019('0x31')][_0x1019('0x33')]?_0x5985f7[_0x1019('0x31')]:_0x38beba[_0x1019('0x30')];if(!_0x17323e[_0x1019('0x2d')][_0x1019('0x34')](_0x1019('0x35'))){_0x5985f7[_0x1019('0x36')]=qs[_0x1019('0x36')](_0x17323e['query'][_0x1019('0x36')]);_0x5985f7[_0x1019('0x1a')]=qs['offset'](_0x17323e['query'][_0x1019('0x1a')]);}_0x5985f7[_0x1019('0x37')]=qs[_0x1019('0x38')](_0x17323e[_0x1019('0x2d')][_0x1019('0x38')]);_0x5985f7[_0x1019('0x39')]=qs[_0x1019('0x3a')](_['pick'](_0x17323e[_0x1019('0x2d')],_0x38beba['filters']));if(_0x17323e['query'][_0x1019('0x3b')]){_0x5985f7[_0x1019('0x39')]=_[_0x1019('0x3c')](_0x5985f7[_0x1019('0x39')],{'$or':_[_0x1019('0x2c')](_0x2949f7,function(_0x1b3a9b){if(_0x1b3a9b[_0x1019('0x2a')]!=='VIRTUAL'){var _0x1c73e0={};_0x1c73e0[_0x1b3a9b[_0x1019('0x25')]]={'$like':'%'+_0x17323e['query'][_0x1019('0x3b')]+'%'};return _0x1c73e0;}})});}_0x5985f7=_[_0x1019('0x3c')]({},_0x5985f7,_0x17323e[_0x1019('0x3d')]);var _0x46adf0={'where':_0x5985f7[_0x1019('0x39')]};return db[_0x1019('0x28')]['count'](_0x46adf0)[_0x1019('0x20')](function(_0x946869){_0x135877[_0x1019('0x3e')]=_0x946869;if(_0x17323e[_0x1019('0x2d')]['includeAll']){_0x5985f7[_0x1019('0x3f')]=[{'all':!![]}];}return db[_0x1019('0x28')]['findAll'](_0x5985f7);})['then'](function(_0x3ae015){_0x135877[_0x1019('0x40')]=_0x3ae015;return _0x135877;})[_0x1019('0x20')](respondWithFilteredResult(_0x4c4f16,_0x5985f7))[_0x1019('0x41')](handleError(_0x4c4f16,null));};exports[_0x1019('0x42')]=function(_0x896eb0,_0x412881){var _0x5a42f7={'raw':!![],'where':{'id':_0x896eb0['params']['id']}},_0x3b1ed1={};_0x3b1ed1[_0x1019('0x30')]=_[_0x1019('0x2e')](db['SmsApplication']['rawAttributes']);_0x3b1ed1['query']=_[_0x1019('0x2e')](_0x896eb0[_0x1019('0x2d')]);_0x3b1ed1[_0x1019('0x3a')]=_[_0x1019('0x2f')](_0x3b1ed1[_0x1019('0x30')],_0x3b1ed1[_0x1019('0x2d')]);_0x5a42f7['attributes']=_[_0x1019('0x2f')](_0x3b1ed1[_0x1019('0x30')],qs[_0x1019('0x32')](_0x896eb0['query'][_0x1019('0x32')]));_0x5a42f7[_0x1019('0x31')]=_0x5a42f7['attributes'][_0x1019('0x33')]?_0x5a42f7[_0x1019('0x31')]:_0x3b1ed1['model'];if(_0x896eb0['query'][_0x1019('0x43')]){_0x5a42f7[_0x1019('0x3f')]=[{'all':!![]}];}_0x5a42f7=_[_0x1019('0x3c')]({},_0x5a42f7,_0x896eb0[_0x1019('0x3d')]);return db[_0x1019('0x28')]['find'](_0x5a42f7)[_0x1019('0x20')](handleEntityNotFound(_0x412881,null))[_0x1019('0x20')](respondWithResult(_0x412881,null))[_0x1019('0x41')](handleError(_0x412881,null));};exports[_0x1019('0x44')]=function(_0x1aee31,_0x4a6daa){return db[_0x1019('0x28')][_0x1019('0x44')](_0x1aee31[_0x1019('0x45')],{})[_0x1019('0x20')](respondWithResult(_0x4a6daa,0xc9))['catch'](handleError(_0x4a6daa,null));};exports[_0x1019('0x1f')]=function(_0x52508d,_0x37a801){if(_0x52508d[_0x1019('0x45')]['id']){delete _0x52508d[_0x1019('0x45')]['id'];}return db[_0x1019('0x28')]['find']({'where':{'id':_0x52508d[_0x1019('0x46')]['id']}})['then'](handleEntityNotFound(_0x37a801,null))[_0x1019('0x20')](saveUpdates(_0x52508d['body'],null))[_0x1019('0x20')](respondWithResult(_0x37a801,null))[_0x1019('0x41')](handleError(_0x37a801,null));};exports[_0x1019('0x21')]=function(_0x1efb56,_0x5e5b5e){return db['SmsApplication'][_0x1019('0x47')]({'where':{'id':_0x1efb56[_0x1019('0x46')]['id']}})['then'](handleEntityNotFound(_0x5e5b5e,null))[_0x1019('0x20')](removeEntity(_0x5e5b5e,null))[_0x1019('0x41')](handleError(_0x5e5b5e,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 2ad840c..e8e4983 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 _0xd34c=['./smsApplication.attributes','exports','define','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0xa1f2df,_0x8709bf){var _0x15b99b=function(_0x3dc708){while(--_0x3dc708){_0xa1f2df['push'](_0xa1f2df['shift']());}};_0x15b99b(++_0x8709bf);}(_0xd34c,0x1e7));var _0xcd34=function(_0x1ae481,_0x194bf2){_0x1ae481=_0x1ae481-0x0;var _0x1cb482=_0xd34c[_0x1ae481];return _0x1cb482;};'use strict';var _=require(_0xcd34('0x0'));var util=require(_0xcd34('0x1'));var logger=require(_0xcd34('0x2'))('api');var moment=require(_0xcd34('0x3'));var BPromise=require(_0xcd34('0x4'));var rp=require(_0xcd34('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcd34('0x6'));var config=require(_0xcd34('0x7'));var attributes=require(_0xcd34('0x8'));module[_0xcd34('0x9')]=function(_0x2ffdb8,_0x72a340){return _0x2ffdb8[_0xcd34('0xa')](_0xcd34('0xb'),attributes,{'tableName':_0xcd34('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xcd34('0xd'),'collate':_0xcd34('0xe')});}; \ No newline at end of file +var _0x25f1=['request-promise','path','../../config/environment','./smsApplication.attributes','exports','define','SmsApplication','sms_applications','lodash','util','../../config/logger','api','bluebird'];(function(_0x6c616e,_0xc68d3a){var _0x44f638=function(_0x57a330){while(--_0x57a330){_0x6c616e['push'](_0x6c616e['shift']());}};_0x44f638(++_0xc68d3a);}(_0x25f1,0xf2));var _0x125f=function(_0x1057cb,_0x7b8162){_0x1057cb=_0x1057cb-0x0;var _0x7fbf7e=_0x25f1[_0x1057cb];return _0x7fbf7e;};'use strict';var _=require(_0x125f('0x0'));var util=require(_0x125f('0x1'));var logger=require(_0x125f('0x2'))(_0x125f('0x3'));var moment=require('moment');var BPromise=require(_0x125f('0x4'));var rp=require(_0x125f('0x5'));var fs=require('fs');var path=require(_0x125f('0x6'));var rimraf=require('rimraf');var config=require(_0x125f('0x7'));var attributes=require(_0x125f('0x8'));module[_0x125f('0x9')]=function(_0x500d41,_0x56461c){return _0x500d41[_0x125f('0xa')](_0x125f('0xb'),attributes,{'tableName':_0x125f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','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 67d3b4f..bbb6dd1 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 _0xe9e8=['code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x363842,_0x369636){var _0x257bc2=function(_0x2516cf){while(--_0x2516cf){_0x363842['push'](_0x363842['shift']());}};_0x257bc2(++_0x369636);}(_0xe9e8,0x179));var _0x8e9e=function(_0x5f5943,_0x3857f6){_0x5f5943=_0x5f5943-0x0;var _0x4a59f6=_0xe9e8[_0x5f5943];return _0x4a59f6;};'use strict';var _=require(_0x8e9e('0x0'));var util=require(_0x8e9e('0x1'));var moment=require(_0x8e9e('0x2'));var BPromise=require(_0x8e9e('0x3'));var rs=require(_0x8e9e('0x4'));var fs=require('fs');var Redis=require(_0x8e9e('0x5'));var db=require(_0x8e9e('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x8e9e('0x7'))('rpc');var config=require(_0x8e9e('0x8'));var jayson=require(_0x8e9e('0x9'));var client=jayson[_0x8e9e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4dae01,_0x1613ff,_0x2e00d9){return new BPromise(function(_0x3afd97,_0x2745ef){return client[_0x8e9e('0xb')](_0x4dae01,_0x2e00d9)[_0x8e9e('0xc')](function(_0x50d9a1){logger['info'](_0x8e9e('0xd'),_0x1613ff,_0x8e9e('0xe'));logger[_0x8e9e('0xf')](_0x8e9e('0x10'),_0x1613ff,_0x8e9e('0xe'),JSON[_0x8e9e('0x11')](_0x50d9a1));if(_0x50d9a1[_0x8e9e('0x12')]){if(_0x50d9a1[_0x8e9e('0x12')][_0x8e9e('0x13')]===0x1f4){logger[_0x8e9e('0x12')](_0x8e9e('0xd'),_0x1613ff,_0x50d9a1[_0x8e9e('0x12')][_0x8e9e('0x14')]);return _0x2745ef(_0x50d9a1[_0x8e9e('0x12')]['message']);}logger[_0x8e9e('0x12')](_0x8e9e('0xd'),_0x1613ff,_0x50d9a1[_0x8e9e('0x12')][_0x8e9e('0x14')]);return _0x3afd97(_0x50d9a1['error'][_0x8e9e('0x14')]);}else{logger['info'](_0x8e9e('0xd'),_0x1613ff,_0x8e9e('0xe'));_0x3afd97(_0x50d9a1[_0x8e9e('0x15')]['message']);}})['catch'](function(_0x20220a){logger[_0x8e9e('0x12')]('SmsApplication,\x20%s,\x20%s',_0x1613ff,_0x20220a);_0x2745ef(_0x20220a);});});} \ No newline at end of file +var _0xe4d6=['stringify','code','error','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','SmsApplication,\x20%s,\x20%s','debug','SmsApplication,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x3a6a63,_0x2210fb){var _0x2d85ac=function(_0x56cc0b){while(--_0x56cc0b){_0x3a6a63['push'](_0x3a6a63['shift']());}};_0x2d85ac(++_0x2210fb);}(_0xe4d6,0xd7));var _0x6e4d=function(_0x3e86d7,_0x36ea96){_0x3e86d7=_0x3e86d7-0x0;var _0x58b436=_0xe4d6[_0x3e86d7];return _0x58b436;};'use strict';var _=require(_0x6e4d('0x0'));var util=require(_0x6e4d('0x1'));var moment=require(_0x6e4d('0x2'));var BPromise=require(_0x6e4d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6e4d('0x4'));var db=require(_0x6e4d('0x5'))['db'];var utils=require(_0x6e4d('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x6e4d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6e4d('0x8')][_0x6e4d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x241d30,_0x907c47,_0x14706a){return new BPromise(function(_0x50f0cc,_0x4ba2fc){return client[_0x6e4d('0xa')](_0x241d30,_0x14706a)[_0x6e4d('0xb')](function(_0x472876){logger['info'](_0x6e4d('0xc'),_0x907c47,'request\x20sent');logger[_0x6e4d('0xd')](_0x6e4d('0xe'),_0x907c47,_0x6e4d('0xf'),JSON[_0x6e4d('0x10')](_0x472876));if(_0x472876['error']){if(_0x472876['error'][_0x6e4d('0x11')]===0x1f4){logger[_0x6e4d('0x12')](_0x6e4d('0xc'),_0x907c47,_0x472876[_0x6e4d('0x12')][_0x6e4d('0x13')]);return _0x4ba2fc(_0x472876[_0x6e4d('0x12')][_0x6e4d('0x13')]);}logger[_0x6e4d('0x12')](_0x6e4d('0xc'),_0x907c47,_0x472876['error'][_0x6e4d('0x13')]);return _0x50f0cc(_0x472876[_0x6e4d('0x12')][_0x6e4d('0x13')]);}else{logger['info']('SmsApplication,\x20%s,\x20%s',_0x907c47,_0x6e4d('0xf'));_0x50f0cc(_0x472876['result'][_0x6e4d('0x13')]);}})[_0x6e4d('0x14')](function(_0x4c792c){logger[_0x6e4d('0x12')]('SmsApplication,\x20%s,\x20%s',_0x907c47,_0x4c792c);_0x4ba2fc(_0x4c792c);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 81493c5..9ab183b 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 _0xa8d9=['exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./smsInteraction.controller','get','isAuthenticated','index','describe','/:id','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','update','delete','tracked','destroy','removeTags'];(function(_0x1e7701,_0x13fd0f){var _0x3ab707=function(_0x3c5242){while(--_0x3c5242){_0x1e7701['push'](_0x1e7701['shift']());}};_0x3ab707(++_0x13fd0f);}(_0xa8d9,0x1f1));var _0x9a8d=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xa8d9[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0x9a8d('0x0'));var util=require(_0x9a8d('0x1'));var path=require(_0x9a8d('0x2'));var timeout=require(_0x9a8d('0x3'));var express=require(_0x9a8d('0x4'));var router=express['Router']();var auth=require(_0x9a8d('0x5'));var interaction=require(_0x9a8d('0x6'));var config=require('../../config/environment');var controller=require(_0x9a8d('0x7'));router[_0x9a8d('0x8')]('/',auth[_0x9a8d('0x9')](),controller[_0x9a8d('0xa')]);router[_0x9a8d('0x8')]('/describe',auth[_0x9a8d('0x9')](),controller[_0x9a8d('0xb')]);router[_0x9a8d('0x8')](_0x9a8d('0xc'),auth[_0x9a8d('0x9')](),controller['show']);router[_0x9a8d('0x8')](_0x9a8d('0xd'),auth[_0x9a8d('0x9')](),controller[_0x9a8d('0xe')]);router[_0x9a8d('0x8')](_0x9a8d('0xf'),auth[_0x9a8d('0x9')](),controller[_0x9a8d('0x10')]);router[_0x9a8d('0x11')]('/',auth[_0x9a8d('0x9')](),controller['create']);router['post'](_0x9a8d('0xd'),auth[_0x9a8d('0x9')](),controller[_0x9a8d('0x12')]);router[_0x9a8d('0x11')](_0x9a8d('0x13'),auth['isAuthenticated'](),interaction['tracked'](_0x9a8d('0x14'),_0x9a8d('0x15')),controller[_0x9a8d('0x16')]);router[_0x9a8d('0x17')](_0x9a8d('0xc'),auth[_0x9a8d('0x9')](),interaction['tracked'](_0x9a8d('0x14'),_0x9a8d('0x18')),controller[_0x9a8d('0x19')]);router[_0x9a8d('0x1a')](_0x9a8d('0xc'),auth[_0x9a8d('0x9')](),interaction[_0x9a8d('0x1b')](_0x9a8d('0x14'),'smsinteraction:destroy'),controller[_0x9a8d('0x1c')]);router['delete'](_0x9a8d('0x13'),auth[_0x9a8d('0x9')](),controller[_0x9a8d('0x1d')]);module[_0x9a8d('0x1e')]=router; \ No newline at end of file +var _0x47c5=['../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','update','delete','smsinteraction:destroy','destroy','removeTags','multer','util','path','connect-timeout','express','Router'];(function(_0x378676,_0xcb7ad6){var _0x5850a6=function(_0x484d8f){while(--_0x484d8f){_0x378676['push'](_0x378676['shift']());}};_0x5850a6(++_0xcb7ad6);}(_0x47c5,0x165));var _0x547c=function(_0x4fbf33,_0x318fbc){_0x4fbf33=_0x4fbf33-0x0;var _0x1997d2=_0x47c5[_0x4fbf33];return _0x1997d2;};'use strict';var multer=require(_0x547c('0x0'));var util=require(_0x547c('0x1'));var path=require(_0x547c('0x2'));var timeout=require(_0x547c('0x3'));var express=require(_0x547c('0x4'));var router=express[_0x547c('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x547c('0x6'));var config=require(_0x547c('0x7'));var controller=require('./smsInteraction.controller');router[_0x547c('0x8')]('/',auth[_0x547c('0x9')](),controller['index']);router[_0x547c('0x8')](_0x547c('0xa'),auth[_0x547c('0x9')](),controller[_0x547c('0xb')]);router[_0x547c('0x8')](_0x547c('0xc'),auth[_0x547c('0x9')](),controller[_0x547c('0xd')]);router[_0x547c('0x8')](_0x547c('0xe'),auth[_0x547c('0x9')](),controller[_0x547c('0xf')]);router[_0x547c('0x8')](_0x547c('0x10'),auth[_0x547c('0x9')](),controller[_0x547c('0x11')]);router[_0x547c('0x12')]('/',auth['isAuthenticated'](),controller[_0x547c('0x13')]);router[_0x547c('0x12')]('/:id/messages',auth[_0x547c('0x9')](),controller[_0x547c('0x14')]);router[_0x547c('0x12')](_0x547c('0x15'),auth[_0x547c('0x9')](),interaction[_0x547c('0x16')](_0x547c('0x17'),_0x547c('0x18')),controller[_0x547c('0x19')]);router[_0x547c('0x1a')](_0x547c('0xc'),auth[_0x547c('0x9')](),interaction[_0x547c('0x16')](_0x547c('0x17'),_0x547c('0x1b')),controller[_0x547c('0x1c')]);router[_0x547c('0x1d')](_0x547c('0xc'),auth['isAuthenticated'](),interaction['tracked'](_0x547c('0x17'),_0x547c('0x1e')),controller[_0x547c('0x1f')]);router['delete'](_0x547c('0x15'),auth[_0x547c('0x9')](),controller[_0x547c('0x20')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index ef83199..ada6f83 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 _0xbaf0=['DATE','STRING','ENUM','out','moment','exports','BOOLEAN'];(function(_0x1c0c16,_0x453ca6){var _0x198367=function(_0x42805b){while(--_0x42805b){_0x1c0c16['push'](_0x1c0c16['shift']());}};_0x198367(++_0x453ca6);}(_0xbaf0,0x12a));var _0x0baf=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xbaf0[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x0baf('0x0'));module[_0x0baf('0x1')]={'closed':{'type':Sequelize[_0x0baf('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x0baf('0x3')]},'disposition':{'type':Sequelize[_0x0baf('0x4')]},'note':{'type':Sequelize[_0x0baf('0x4')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x0baf('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x0baf('0x5')]('in',_0x0baf('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x0baf('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x0baf('0x5')]('in',_0x0baf('0x6')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0xb7e7=['out','sequelize','exports','DATE','STRING','ENUM'];(function(_0x32c9b6,_0x21ada3){var _0x521e7a=function(_0x2a436a){while(--_0x2a436a){_0x32c9b6['push'](_0x32c9b6['shift']());}};_0x521e7a(++_0x21ada3);}(_0xb7e7,0x121));var _0x7b7e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xb7e7[_0x43d11d];return _0x38cd08;};'use strict';var Sequelize=require(_0x7b7e('0x0'));var moment=require('moment');module[_0x7b7e('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x7b7e('0x2')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x7b7e('0x3')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x7b7e('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x7b7e('0x4')]('in',_0x7b7e('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x7b7e('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 32a4414..9baf026 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 _0x9536=['i.SmsAccountId\x20IN\x20?','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','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)','group','i.id','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','isEmpty','t.id\x20IN\x20?','resolve','journey','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','SmsInteraction','unreadMessages','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','c.firstName','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','push','all','rows','catch','show','params','includeAll','include','options','create','update','destroy','describe','addMessage','SmsMessage','ids','omit','getMessages','findOne','pick','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','color','emit','smsInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','CmContact','lastName','Messages','createdAt','direction','secret','SmsAccount','Account','Owner','get','mkdirSync','10px','40px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','30px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Sms','YYYY-MM-DD','closed','disposition','out','System','firstName','renderFile','views','downloadInteraction.html','toFile','transcript-','.pdf','err','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./smsInteraction.socket','register','sendStatus','status','end','json','count','offset','set','Content-Range','apply','save','then','error','name','send','map','fullname','TagIds','Tags','split','forEach','index','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','select','field','tools_tags','u.fullname','ui.SmsInteractionId','user_has_sms_interactions','left_join','u.id\x20=\x20ui.UserId','from','sms_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','sms_accounts','sms_messages','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','length','find','value','having','`\x20>\x200','Contact','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','start','Tag','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','buildExpression','some','compact'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x9536,0x179));var _0x6953=function(_0x49fcfb,_0x504dec){_0x49fcfb=_0x49fcfb-0x0;var _0x964926=_0x9536[_0x49fcfb];return _0x964926;};'use strict';var pdf=require(_0x6953('0x0'));var emlformat=require(_0x6953('0x1'));var rimraf=require(_0x6953('0x2'));var zipdir=require(_0x6953('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6953('0x4'));var moment=require('moment');var BPromise=require(_0x6953('0x5'));var Mustache=require(_0x6953('0x6'));var util=require(_0x6953('0x7'));var path=require(_0x6953('0x8'));var sox=require(_0x6953('0x9'));var csv=require('to-csv');var ejs=require(_0x6953('0xa'));var fs=require('fs');var _=require(_0x6953('0xb'));var squel=require(_0x6953('0xc'));var crypto=require(_0x6953('0xd'));var jsforce=require(_0x6953('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x6953('0xf'));var querystring=require(_0x6953('0x10'));var Papa=require(_0x6953('0x11'));var Redis=require('ioredis');var authService=require(_0x6953('0x12'));var qs=require(_0x6953('0x13'));var as=require(_0x6953('0x14'));var hardwareService=require(_0x6953('0x15'));var logger=require(_0x6953('0x16'))(_0x6953('0x17'));var utils=require(_0x6953('0x18'));var config=require(_0x6953('0x19'));var db=require(_0x6953('0x1a'))['db'];config['redis']=_[_0x6953('0x1b')](config['redis'],{'host':_0x6953('0x1c'),'port':0x18eb});var socket=require(_0x6953('0x1d'))(new Redis(config[_0x6953('0x1e')]));require(_0x6953('0x1f'))[_0x6953('0x20')](socket);function respondWithStatusCode(_0x244713,_0x175fa9){_0x175fa9=_0x175fa9||0xcc;return function(_0x27a57c){if(_0x27a57c){return _0x244713[_0x6953('0x21')](_0x175fa9);}return _0x244713[_0x6953('0x22')](_0x175fa9)[_0x6953('0x23')]();};}function respondWithResult(_0x548473,_0x5f49db){_0x5f49db=_0x5f49db||0xc8;return function(_0x399b9b){if(_0x399b9b){return _0x548473[_0x6953('0x22')](_0x5f49db)[_0x6953('0x24')](_0x399b9b);}};}function respondWithFilteredResult(_0x16251d,_0x510d46){return function(_0x1b6dcb){if(_0x1b6dcb){var _0x2da771=_0x1b6dcb[_0x6953('0x25')],_0x4b43ae=_0x510d46[_0x6953('0x26')],_0x10858a=_0x510d46[_0x6953('0x26')]+_0x510d46['limit'],_0x3207dd;if(_0x10858a>=_0x2da771){_0x10858a=_0x2da771;_0x3207dd=0xc8;}else{_0x3207dd=0xce;}_0x16251d[_0x6953('0x22')](_0x3207dd);return _0x16251d[_0x6953('0x27')](_0x6953('0x28'),_0x4b43ae+'-'+_0x10858a+'/'+_0x2da771)[_0x6953('0x24')](_0x1b6dcb);}return null;};}function patchUpdates(_0x41f021){return function(_0x5e33ec){try{jsonpatch[_0x6953('0x29')](_0x5e33ec,_0x41f021,!![]);}catch(_0x1388b7){return BPromise['reject'](_0x1388b7);}return _0x5e33ec[_0x6953('0x2a')]();};}function saveUpdates(_0x40c9d1,_0xb92529){return function(_0x171dd8){if(_0x171dd8){return _0x171dd8['update'](_0x40c9d1)[_0x6953('0x2b')](function(_0x231cb2){return _0x231cb2;});}return null;};}function removeEntity(_0x2a7f6a,_0x508ea7){return function(_0x495ebd){if(_0x495ebd){return _0x495ebd['destroy']()[_0x6953('0x2b')](function(){_0x2a7f6a[_0x6953('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a32f4,_0x587df0){return function(_0x328f67){if(!_0x328f67){_0x1a32f4[_0x6953('0x21')](0x194);}return _0x328f67;};}function handleError(_0xcdbce8,_0x2cc01e){_0x2cc01e=_0x2cc01e||0x1f4;return function(_0x191d80){logger[_0x6953('0x2c')](_0x191d80['stack']);if(_0x191d80[_0x6953('0x2d')]){delete _0x191d80[_0x6953('0x2d')];}_0xcdbce8['status'](_0x2cc01e)[_0x6953('0x2e')](_0x191d80);};}function getInteractionUsers(_0x4af39d,_0x173b3c){return new BPromise(function(_0x3b1175,_0x426c7c){try{if(_0x173b3c[_0x4af39d['id']]){_0x4af39d['Users']=_[_0x6953('0x2f')](_0x173b3c[_0x4af39d['id']],function(_0x3d7b04){return{'id':_0x3d7b04['id'],'fullname':_0x3d7b04[_0x6953('0x30')]};});}}catch(_0x47ed2f){_0x426c7c(_0x47ed2f);}_0x3b1175(_0x4af39d);});}function getInteractionTags(_0x4c49fc,_0x132a71){return new BPromise(function(_0x481c6a,_0x4d856d){try{if(_0x4c49fc[_0x6953('0x31')]){_0x4c49fc[_0x6953('0x32')]=[];_0x4c49fc[_0x6953('0x31')][_0x6953('0x33')](',')[_0x6953('0x34')](function(_0x56ce8e){_0x4c49fc[_0x6953('0x32')]['push'](_0x132a71[_0x56ce8e]);});}delete _0x4c49fc[_0x6953('0x31')];}catch(_0x2e85c7){_0x4d856d(_0x2e85c7);}_0x481c6a(_0x4c49fc);});}function updateSmsInteraction(_0x4ba704,_0x4a4d41,_0x1f77a6){return new BPromise(function(_0x1ad003,_0x34d10b){return getInteractionUsers(_0x4ba704,_0x1f77a6)['then'](function(_0x28cb92){return getInteractionTags(_0x28cb92,_0x4a4d41);})['then'](function(_0x4e95f1){_0x1ad003(_0x4e95f1);})['catch'](function(_0x5c4a8a){_0x34d10b(_0x5c4a8a);});});}exports[_0x6953('0x35')]=function(_0x6c7862,_0x2c7160){var _0x11f316={},_0x1b0c56={},_0x2ce31f={'count':0x0,'rows':[]};var _0x4f6e06=_[_0x6953('0x2f')](db['SmsInteraction'][_0x6953('0x36')],function(_0x5c9a4e){return{'name':_0x5c9a4e[_0x6953('0x37')],'type':_0x5c9a4e[_0x6953('0x38')][_0x6953('0x39')]};});_0x1b0c56[_0x6953('0x3a')]=_['map'](_0x4f6e06,_0x6953('0x2d'));_0x1b0c56[_0x6953('0x3b')]=_[_0x6953('0x3c')](_0x6c7862[_0x6953('0x3b')]);_0x1b0c56[_0x6953('0x3d')]=_[_0x6953('0x3e')](_0x1b0c56[_0x6953('0x3a')],_0x1b0c56[_0x6953('0x3b')]);_0x11f316[_0x6953('0x3f')]=_[_0x6953('0x3e')](_0x1b0c56[_0x6953('0x3a')],qs['fields'](_0x6c7862[_0x6953('0x3b')][_0x6953('0x40')]));_0x11f316[_0x6953('0x3f')]=_0x11f316['attributes']['length']?_0x11f316[_0x6953('0x3f')]:_0x1b0c56['model'];if(!_0x6c7862['query'][_0x6953('0x41')](_0x6953('0x42'))){_0x11f316['limit']=qs[_0x6953('0x43')](_0x6c7862[_0x6953('0x3b')][_0x6953('0x43')]);_0x11f316[_0x6953('0x26')]=qs[_0x6953('0x26')](_0x6c7862[_0x6953('0x3b')]['offset']);}_0x11f316[_0x6953('0x44')]=qs[_0x6953('0x45')](_0x6c7862[_0x6953('0x3b')][_0x6953('0x45')]);_0x11f316[_0x6953('0x46')]=qs[_0x6953('0x3d')](_['pick'](_0x6c7862['query'],_0x1b0c56[_0x6953('0x3d')]));var _0x54d7c2=[];var _0x588ff8=squel[_0x6953('0x47')]()[_0x6953('0x48')]('id')[_0x6953('0x48')](_0x6953('0x2d'))[_0x6953('0x48')]('color')['from'](_0x6953('0x49'));var _0x452b69=squel['select']()[_0x6953('0x48')]('u.id')[_0x6953('0x48')](_0x6953('0x4a'))[_0x6953('0x48')](_0x6953('0x4b'))['from'](_0x6953('0x4c'),'ui')[_0x6953('0x4d')]('users','u',_0x6953('0x4e'));var _0x296d81=squel[_0x6953('0x47')]()[_0x6953('0x4f')](_0x6953('0x50'),'i')[_0x6953('0x4d')](_0x6953('0x51'),'c',_0x6953('0x52'))[_0x6953('0x4d')](_0x6953('0x53'),'o',_0x6953('0x54'))['left_join'](_0x6953('0x55'),'a','a.id\x20=\x20i.SmsAccountId')[_0x6953('0x4d')](_0x6953('0x56'),'me',_0x6953('0x57'))['left_join'](_0x6953('0x58'),'it',_0x6953('0x59'))['left_join']('tools_tags','t',_0x6953('0x5a'));var _0x265b44=squel[_0x6953('0x5b')]();var _0x36d75a=[];var _0x23207e=squel[_0x6953('0x5b')]();var _0x1443f4;if(_0x6c7862[_0x6953('0x3b')][_0x6953('0x5c')]){_0x1443f4=as[_0x6953('0x5d')](_0x6c7862[_0x6953('0x3b')]['search']);var _0x5d3172=_0x1443f4[_0x6953('0x5e')];for(var _0x38e3e8=0x0;_0x38e3e8<_0x1443f4[_0x6953('0x5f')][_0x6953('0x60')];_0x38e3e8++){var _0xd9a3a6=_0x1443f4[_0x6953('0x5f')][_0x38e3e8];var _0x322117='i';var _0x238ab2=_[_0x6953('0x61')](_0x4f6e06,['name',_0xd9a3a6['field']]);if(!_0x238ab2){switch(_0xd9a3a6['field']){case'unreadMessages':if(_0xd9a3a6[_0x6953('0x62')]==0x1){_0x296d81[_0x6953('0x63')]('`'+_0xd9a3a6[_0x6953('0x48')]+'`\x20=\x200');}else{_0x296d81['having']('`'+_0xd9a3a6[_0x6953('0x48')]+_0x6953('0x64'));}break;case _0x6953('0x65'):if(_0xd9a3a6['operator']==='$substring'){if(_0xd9a3a6[_0x6953('0x62')][_0x6953('0x33')]('\x20')['length']>0x1){_0x265b44[_0x5d3172]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x6953('0x66')](_0xd9a3a6[_0x6953('0x62')]),null);}else{var _0x414096='%'+_0xd9a3a6[_0x6953('0x62')]+'%';_0x265b44[_0x5d3172](_0x6953('0x67'),_0x414096,_0x414096,_0x414096);}}else{_0x238ab2=_['find'](_0x4f6e06,[_0x6953('0x2d'),_0x6953('0x68')]);_0xd9a3a6['field']=_0x6953('0x68');_0xe93bf2=as['buildExpression'](_0x322117,_0x238ab2[_0x6953('0x38')],_0xd9a3a6);_0x265b44[_0x5d3172](_0xe93bf2[_0x6953('0x69')],_0xe93bf2[_0x6953('0x62')][_0x6953('0x6a')],_0xe93bf2['value'][_0x6953('0x23')]);}break;case _0x6953('0x6b'):var _0x38b3b1=_0xd9a3a6['value']['split'](',')[_0x6953('0x2f')](function(_0x224ce6){return Number(_0x224ce6);});_0x38b3b1[_0x6953('0x34')](function(_0x482f3b){_0x23207e['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x482f3b+',%');});_0x36d75a=_[_0x6953('0x6c')](_0x36d75a,_0x38b3b1);break;case _0x6953('0x6d'):if(_0xd9a3a6['operator']===_0x6953('0x6e')){_0x265b44[_0x5d3172](_0x6953('0x6f'),'%'+_0xd9a3a6['value']+'%',null);}else{_0x238ab2=_[_0x6953('0x61')](_0x4f6e06,[_0x6953('0x2d'),_0x6953('0x70')]);_0xd9a3a6[_0x6953('0x48')]=_0x6953('0x70');_0xe93bf2=as['buildExpression'](_0x322117,_0x238ab2[_0x6953('0x38')],_0xd9a3a6);_0x265b44[_0x5d3172](_0xe93bf2[_0x6953('0x69')],_0xe93bf2[_0x6953('0x62')]['start'],_0xe93bf2['value'][_0x6953('0x23')]);}break;case _0x6953('0x71'):_0xe93bf2=as[_0x6953('0x72')]('me',null,_0xd9a3a6);_0x265b44[_0x5d3172](_0xe93bf2[_0x6953('0x69')],_0xe93bf2[_0x6953('0x62')]['start'],_0xe93bf2[_0x6953('0x62')][_0x6953('0x23')]);break;}}else{var _0xe93bf2=as[_0x6953('0x72')](_0x322117,_0x238ab2[_0x6953('0x38')],_0xd9a3a6);_0x265b44[_0x5d3172](_0xe93bf2[_0x6953('0x69')],_0xe93bf2[_0x6953('0x62')][_0x6953('0x6a')],_0xe93bf2[_0x6953('0x62')][_0x6953('0x23')]);}}}else{var _0xb26c63=_(_0x6c7862[_0x6953('0x3b')])[_0x6953('0x3c')]()['map'](function(_0x398e2c){return _[_0x6953('0x73')](_0x4f6e06,[_0x6953('0x2d'),_0x398e2c])?_0x398e2c:undefined;})[_0x6953('0x74')]()[_0x6953('0x62')]();if(!_['isEmpty'](_0xb26c63)){_0xb26c63['forEach'](function(_0x310a90){if(_0x310a90==='SmsAccountId'){_0x296d81[_0x6953('0x46')](_0x6953('0x75'),[][_0x6953('0x76')](_0x6c7862[_0x6953('0x3b')][_0x310a90]));}else if(_0x310a90==='createdAt'){var _0x35c6b8=JSON[_0x6953('0x77')](_0x6c7862[_0x6953('0x3b')][_0x310a90])[_0x6953('0x78')];var _0x1c3190=JSON[_0x6953('0x77')](_0x6c7862[_0x6953('0x3b')][_0x310a90])[_0x6953('0x79')];_0x296d81[_0x6953('0x46')](_0x6953('0x7a'),_0x35c6b8,_0x1c3190);}else{if(_0x6c7862[_0x6953('0x3b')][_0x310a90]===_0x6953('0x7b')){_0x296d81[_0x6953('0x46')]('i.'+_0x310a90+_0x6953('0x7c'));}else{_0x296d81[_0x6953('0x46')]('i.'+_0x310a90+'\x20=\x20?',_0x6c7862[_0x6953('0x3b')][_0x310a90]);}}});}if(_0x6c7862[_0x6953('0x3b')][_0x6953('0x7d')]){if(_0x6c7862[_0x6953('0x3b')][_0x6953('0x7d')]==0x1){_0x296d81[_0x6953('0x63')](_0x6953('0x7e'));}else{_0x296d81['having'](_0x6953('0x7f'));}}if(_0x6c7862[_0x6953('0x3b')]['tag']){_0x36d75a=_[_0x6953('0x80')](_0x6c7862[_0x6953('0x3b')][_0x6953('0x81')])?_0x6c7862['query']['tag']:new Array(_0x6c7862[_0x6953('0x3b')][_0x6953('0x81')]);_0x36d75a[_0x6953('0x34')](function(_0x2d173b){_0x23207e['or'](_0x6953('0x82'),'%,'+_0x2d173b+',%');});}if(_0x6c7862[_0x6953('0x3b')][_0x6953('0x83')]){var _0x1515a9=_0x6c7862[_0x6953('0x3b')]['filter'][_0x6953('0x84')]('\x5c','\x5c\x5c')[_0x6953('0x84')]('\x27\x27',_0x6953('0x85'));if(qs[_0x6953('0x86')](_0x1515a9)){_0x265b44['or']('i.id\x20LIKE\x20?',_0x1515a9+'%')['or'](_0x6953('0x87'),_0x1515a9+'%');}else{_0x265b44['or'](_0x6953('0x88'),qs[_0x6953('0x66')](_0x1515a9))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x1515a9+'%');}}}_0x296d81[_0x6953('0x46')](_0x265b44);_0x296d81[_0x6953('0x89')](_0x6953('0x8a'));var _0x1b9588={'type':db['Sequelize'][_0x6953('0x8b')][_0x6953('0x8c')],'raw':!![]};var _0x328191=_0x296d81[_0x6953('0x8d')]();_0x328191['field']('i.id');_0x328191[_0x6953('0x48')](_0x6953('0x8e'),'unreadMessages');if(_0x11f316['order']){_0x11f316[_0x6953('0x44')][_0x6953('0x34')](function(_0x30fcd5){_0x296d81[_0x6953('0x44')]('i.'+_0x30fcd5[0x0],_0x30fcd5[0x1]==='DESC'?![]:!![]);});}if(!_[_0x6953('0x8f')](_0x36d75a)){_0x296d81[_0x6953('0x63')](_0x23207e);_0x328191['where'](_0x6953('0x90'),_0x36d75a);}BPromise[_0x6953('0x91')]()['then'](function(){if(!_0x1443f4){if(_0x6c7862['query']['SmsAccountId']||_0x6c7862[_0x6953('0x3b')][_0x6953('0x92')])return;_0x328191[_0x6953('0x46')](_0x6953('0x93'));_0x296d81[_0x6953('0x46')](_0x6953('0x93'));return;}return _0x6c7862[_0x6953('0x94')][_0x6953('0x95')]({'attributes':['id'],'raw':!![]})['then'](function(_0x3e74e0){if(_[_0x6953('0x8f')](_0x3e74e0)){_0x328191[_0x6953('0x46')](_0x6953('0x96'));_0x296d81[_0x6953('0x46')](_0x6953('0x96'));}else{_0x328191['where'](_0x6953('0x75'),_['map'](_0x3e74e0,'id'));_0x296d81[_0x6953('0x46')]('i.SmsAccountId\x20IN\x20?',_[_0x6953('0x2f')](_0x3e74e0,'id'));}});})[_0x6953('0x2b')](function(){db[_0x6953('0x97')]['query'](_0x328191[_0x6953('0x98')](),_0x1b9588)[_0x6953('0x2b')](function(_0x6a942a){_0x2ce31f[_0x6953('0x25')]=_0x6a942a[_0x6953('0x60')];if(_0x2ce31f[_0x6953('0x25')]===0x0)return[];return db['sequelize'][_0x6953('0x3b')](_0x588ff8[_0x6953('0x98')](),_0x1b9588)[_0x6953('0x2b')](function(_0x4464d1){_0x54d7c2=_[_0x6953('0x99')](_0x4464d1,'id');_0x1b9588=_[_0x6953('0x9a')](_0x1b9588,{'model':db[_0x6953('0x9b')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x6c7862[_0x6953('0x3b')][_0x6953('0x40')]){_0x11f316[_0x6953('0x3f')][_0x6953('0x34')](function(_0x47c935){_0x296d81[_0x6953('0x48')]('i.'+_0x47c935);});}else{_0x296d81[_0x6953('0x48')](_0x6953('0x8e'),_0x6953('0x9c'));_0x296d81[_0x6953('0x48')](_0x6953('0x9d'),_0x6953('0x9e'));_0x296d81[_0x6953('0x48')](_0x6953('0x9f'),_0x6953('0xa0'));_0x296d81[_0x6953('0x48')]('i.*');_0x296d81[_0x6953('0x48')](_0x6953('0xa1'),_0x6953('0xa2'));_0x296d81['field'](_0x6953('0xa3'),'Contact.lastName');_0x296d81['field'](_0x6953('0xa4'),_0x6953('0xa5'));_0x296d81[_0x6953('0x48')](_0x6953('0xa6'),_0x6953('0xa7'));_0x296d81[_0x6953('0x48')](_0x6953('0xa8'),'Contact.mobile');_0x296d81[_0x6953('0x48')](_0x6953('0xa9'),_0x6953('0xaa'));_0x296d81['field'](_0x6953('0xab'),_0x6953('0xac'));_0x296d81['field'](_0x6953('0xad'),'Owner.internal');_0x296d81['field'](_0x6953('0xae'),'TagIds');}_0x296d81['limit'](_0x11f316[_0x6953('0x43')]);_0x296d81[_0x6953('0x26')](_0x11f316[_0x6953('0x26')]);return db['sequelize'][_0x6953('0x3b')](_0x296d81[_0x6953('0x98')](),_0x1b9588);})['then'](function(_0x30de2c){_0x452b69[_0x6953('0x46')](_0x6953('0xaf'),_[_0x6953('0x2f')](_0x30de2c,'id'));return db[_0x6953('0x97')][_0x6953('0x3b')](_0x452b69[_0x6953('0x98')](),_0x1b9588)[_0x6953('0x2b')](function(_0xce6912){var _0x594098=_[_0x6953('0xb0')](_0xce6912,_0x6953('0xb1'));var _0x52ba59=[];_0x30de2c[_0x6953('0x34')](function(_0x4442c7){_0x52ba59[_0x6953('0xb2')](updateSmsInteraction(_0x4442c7,_0x54d7c2,_0x594098));});return BPromise[_0x6953('0xb3')](_0x52ba59);});});})[_0x6953('0x2b')](function(_0x300be9){_0x2ce31f[_0x6953('0xb4')]=_0x300be9;return _0x2ce31f;})['then'](respondWithFilteredResult(_0x2c7160,_0x11f316));})[_0x6953('0xb5')](handleError(_0x2c7160,null));};exports[_0x6953('0xb6')]=function(_0x1481a1,_0x12e2ec){var _0x29e68e={'raw':![],'where':{'id':_0x1481a1[_0x6953('0xb7')]['id']}},_0xa54eb8={};_0xa54eb8[_0x6953('0x3a')]=_[_0x6953('0x3c')](db['SmsInteraction'][_0x6953('0x36')]);_0xa54eb8['query']=_[_0x6953('0x3c')](_0x1481a1['query']);_0xa54eb8[_0x6953('0x3d')]=_[_0x6953('0x3e')](_0xa54eb8[_0x6953('0x3a')],_0xa54eb8[_0x6953('0x3b')]);_0x29e68e[_0x6953('0x3f')]=_['intersection'](_0xa54eb8[_0x6953('0x3a')],qs['fields'](_0x1481a1[_0x6953('0x3b')][_0x6953('0x40')]));_0x29e68e[_0x6953('0x3f')]=_0x29e68e[_0x6953('0x3f')]['length']?_0x29e68e[_0x6953('0x3f')]:_0xa54eb8[_0x6953('0x3a')];if(_0x1481a1[_0x6953('0x3b')][_0x6953('0xb8')]){_0x29e68e[_0x6953('0xb9')]=[{'all':!![]}];}_0x29e68e=_[_0x6953('0x9a')]({},_0x29e68e,_0x1481a1[_0x6953('0xba')]);return db['SmsInteraction'][_0x6953('0x61')](_0x29e68e)[_0x6953('0x2b')](handleEntityNotFound(_0x12e2ec,null))[_0x6953('0x2b')](respondWithResult(_0x12e2ec,null))[_0x6953('0xb5')](handleError(_0x12e2ec,null));};exports[_0x6953('0xbb')]=function(_0x575b5f,_0x5df973){return db['SmsInteraction'][_0x6953('0xbb')](_0x575b5f[_0x6953('0x71')],{})[_0x6953('0x2b')](respondWithResult(_0x5df973,0xc9))['catch'](handleError(_0x5df973,null));};exports[_0x6953('0xbc')]=function(_0x5268ba,_0x2fe7b8){if(_0x5268ba[_0x6953('0x71')]['id']){delete _0x5268ba['body']['id'];}return db[_0x6953('0x9b')]['find']({'where':{'id':_0x5268ba[_0x6953('0xb7')]['id']}})['then'](handleEntityNotFound(_0x2fe7b8,null))['then'](saveUpdates(_0x5268ba[_0x6953('0x71')],null))[_0x6953('0x2b')](respondWithResult(_0x2fe7b8,null))[_0x6953('0xb5')](handleError(_0x2fe7b8,null));};exports[_0x6953('0xbd')]=function(_0x31622e,_0x82389){return db[_0x6953('0x9b')][_0x6953('0x61')]({'where':{'id':_0x31622e['params']['id']}})['then'](handleEntityNotFound(_0x82389,null))['then'](removeEntity(_0x82389,null))[_0x6953('0xb5')](handleError(_0x82389,null));};exports[_0x6953('0xbe')]=function(_0x55ed86,_0x21d751){return db[_0x6953('0x9b')]['describe']()[_0x6953('0x2b')](respondWithResult(_0x21d751,null))[_0x6953('0xb5')](handleError(_0x21d751,null));};exports[_0x6953('0xbf')]=function(_0x20931d,_0x375fdb,_0x30c47d){return db[_0x6953('0xc0')][_0x6953('0x61')]({'where':{'id':_0x20931d['params']['id']}})[_0x6953('0x2b')](handleEntityNotFound(_0x375fdb,null))['then'](function(_0x407d7e){if(_0x407d7e){return _0x407d7e[_0x6953('0xbf')](_0x20931d[_0x6953('0x71')][_0x6953('0xc1')],_[_0x6953('0xc2')](_0x20931d[_0x6953('0x71')],['ids','id'])||{});}})[_0x6953('0x2b')](respondWithResult(_0x375fdb,null))['catch'](handleError(_0x375fdb,null));};exports[_0x6953('0xc3')]=function(_0x19a383,_0x3f4e63,_0x3f9df1){var _0x109ed2={'raw':![],'where':{}};var _0xff4342={};var _0xa5f5d4={'count':0x0,'rows':[]};return db[_0x6953('0x9b')][_0x6953('0xc4')]({'where':{'id':_0x19a383[_0x6953('0xb7')]['id']}})[_0x6953('0x2b')](handleEntityNotFound(_0x3f4e63,null))[_0x6953('0x2b')](function(_0x25e560){if(_0x25e560){_0xff4342[_0x6953('0x3a')]=_['keys'](db[_0x6953('0xc0')]['rawAttributes']);_0xff4342['query']=_['keys'](_0x19a383[_0x6953('0x3b')]);_0xff4342[_0x6953('0x3d')]=_[_0x6953('0x3e')](_0xff4342[_0x6953('0x3a')],_0xff4342[_0x6953('0x3b')]);_0x109ed2[_0x6953('0x3f')]=_[_0x6953('0x3e')](_0xff4342[_0x6953('0x3a')],qs[_0x6953('0x40')](_0x19a383[_0x6953('0x3b')][_0x6953('0x40')]));_0x109ed2[_0x6953('0x3f')]=_0x109ed2[_0x6953('0x3f')]['length']?_0x109ed2[_0x6953('0x3f')]:_0xff4342[_0x6953('0x3a')];if(!_0x19a383[_0x6953('0x3b')][_0x6953('0x41')]('nolimit')){_0x109ed2[_0x6953('0x43')]=qs[_0x6953('0x43')](_0x19a383['query'][_0x6953('0x43')]);_0x109ed2[_0x6953('0x26')]=qs[_0x6953('0x26')](_0x19a383[_0x6953('0x3b')][_0x6953('0x26')]);}_0x109ed2['order']=qs[_0x6953('0x45')](_0x19a383[_0x6953('0x3b')][_0x6953('0x45')]);_0x109ed2[_0x6953('0x46')]=qs[_0x6953('0x3d')](_[_0x6953('0xc5')](_0x19a383[_0x6953('0x3b')],_0xff4342[_0x6953('0x3d')]));_0x109ed2[_0x6953('0x46')][_0x6953('0xb1')]=_0x25e560['id'];if(_0x19a383[_0x6953('0x3b')]['filter']){_0x109ed2['where']=_[_0x6953('0x9a')](_0x109ed2[_0x6953('0x46')],{'$or':_[_0x6953('0x2f')](_0x109ed2[_0x6953('0x3f')],function(_0x12d2cd){var _0x348db8={};_0x348db8[_0x12d2cd]={'$like':'%'+_0x19a383[_0x6953('0x3b')][_0x6953('0x83')]+'%'};return _0x348db8;})});}if(_0x19a383['query']['$gte']){var _0x286119=_0x19a383['query'][_0x6953('0x78')][_0x6953('0x33')](',');var _0x5770e2={};_0x5770e2[_0x286119[0x0]]={'$gte':moment(_0x286119[0x1])[_0x6953('0xc6')](_0x6953('0xc7'))};_0x109ed2[_0x6953('0x46')]=_[_0x6953('0x9a')](_0x109ed2[_0x6953('0x46')],_0x5770e2);}_0x109ed2=_['merge']({},_0x109ed2,_0x19a383[_0x6953('0xba')]);return db['SmsMessage']['count']({'where':_0x109ed2[_0x6953('0x46')]})['then'](function(_0x1a6c15){_0xa5f5d4[_0x6953('0x25')]=_0x1a6c15;if(_0x19a383['query'][_0x6953('0xb8')]){_0x109ed2[_0x6953('0xb9')]=[{'all':!![]}];}return db[_0x6953('0xc0')][_0x6953('0xc8')](_0x109ed2);})[_0x6953('0x2b')](function(_0x321ec8){_0xa5f5d4[_0x6953('0xb4')]=_0x321ec8;return _0xa5f5d4;});}})[_0x6953('0x2b')](respondWithFilteredResult(_0x3f4e63,_0x109ed2))['catch'](handleError(_0x3f4e63,null));};exports[_0x6953('0xc9')]=function(_0x3dfb72,_0x3f4569,_0x2cedc9){return db[_0x6953('0x9b')][_0x6953('0x61')]({'where':{'id':_0x3dfb72[_0x6953('0xb7')]['id']}})[_0x6953('0x2b')](handleEntityNotFound(_0x3f4569,null))['then'](function(_0x2d0702){if(_0x2d0702){return _0x2d0702[_0x6953('0xca')](_0x3dfb72[_0x6953('0x71')][_0x6953('0xc1')],_[_0x6953('0xc2')](_0x3dfb72[_0x6953('0x71')],[_0x6953('0xc1'),'id'])||{})['spread'](function(){return db['Tag'][_0x6953('0xc8')]({'attributes':['id',_0x6953('0x2d'),_0x6953('0xcb')],'where':{'id':_0x3dfb72[_0x6953('0x71')][_0x6953('0xc1')]}});})[_0x6953('0x2b')](function(_0x6b390c){socket[_0x6953('0xcc')](_0x6953('0xcd'),{'id':Number(_0x3dfb72[_0x6953('0xb7')]['id']),'tags':_0x6b390c||[]});return{'id':Number(_0x3dfb72[_0x6953('0xb7')]['id']),'tags':_0x6b390c||[]};});}})[_0x6953('0x2b')](respondWithResult(_0x3f4569,null))[_0x6953('0xb5')](handleError(_0x3f4569,null));};exports[_0x6953('0xce')]=function(_0x1dcbd2,_0x4b582c,_0x1035b5){return db['SmsInteraction']['find']({'where':{'id':_0x1dcbd2[_0x6953('0xb7')]['id']}})['then'](handleEntityNotFound(_0x4b582c,null))[_0x6953('0x2b')](function(_0x128748){if(_0x128748){return _0x128748[_0x6953('0xce')](_0x1dcbd2[_0x6953('0x3b')][_0x6953('0xc1')]);}})[_0x6953('0x2b')](respondWithStatusCode(_0x4b582c,null))['catch'](handleError(_0x4b582c,null));};exports[_0x6953('0xcf')]=function(_0x349b35,_0x7cd620){var _0x4cbf0f=moment()[_0x6953('0xd0')]()[_0x6953('0x98')]();var _0x50bb7f=path[_0x6953('0xd1')](config[_0x6953('0xd2')],_0x6953('0xd3'),_0x6953('0xd4'),_0x6953('0xd5'));var _0x575111=path[_0x6953('0xd1')](config[_0x6953('0xd2')],_0x6953('0xd3'),_0x6953('0xd4'),_0x6953('0xd6'));var _0x396cbf=path[_0x6953('0xd1')](_0x50bb7f,_0x4cbf0f);var _0x2e68d0=util[_0x6953('0xc6')](_0x6953('0xd7'),_0x349b35[_0x6953('0xb7')]['id'],_0x4cbf0f);var _0xb74ca4=path[_0x6953('0xd1')](_0x50bb7f,_0x2e68d0);var _0x5c1f0e=[];_0x5c1f0e[_0x6953('0xb2')]({'model':db[_0x6953('0x6d')],'as':_0x6953('0x6d'),'attributes':['id',_0x6953('0x30')],'raw':!![]});_0x5c1f0e[_0x6953('0xb2')]({'model':db[_0x6953('0xd8')],'as':'Contact','attributes':['id','firstName',_0x6953('0xd9')],'raw':!![]});var _0x548f3e=[{'model':db[_0x6953('0xc0')],'as':_0x6953('0xda'),'attributes':['id',_0x6953('0x71'),_0x6953('0xdb'),_0x6953('0xdc'),_0x6953('0xdd'),'read'],'include':_0x5c1f0e}];_0x548f3e[_0x6953('0xb2')]({'model':db[_0x6953('0xde')],'as':_0x6953('0xdf'),'attributes':['id',_0x6953('0x2d')]});_0x548f3e[_0x6953('0xb2')]({'model':db[_0x6953('0x6d')],'as':_0x6953('0xe0'),'attributes':['id',_0x6953('0x30')]});return db['SmsInteraction'][_0x6953('0x61')]({'where':{'id':_0x349b35[_0x6953('0xb7')]['id']},'include':_0x548f3e})['then'](handleEntityNotFound(_0x7cd620,null))[_0x6953('0x2b')](function(_0x315ec5){if(_0x315ec5){var _0x293d45=_0x315ec5[_0x6953('0xe1')]({'plain':!![]});fs[_0x6953('0xe2')](_0x396cbf);var _0x1ccc08={'format':'A4','border':_0x6953('0xe3'),'header':{'height':_0x6953('0xe4'),'contents':{'first':_0x6953('0xe5')}},'footer':{'height':_0x6953('0xe6'),'contents':{'default':util['format'](_0x6953('0xe7'),util['format']('%s\x20#%d',_0x6953('0xe8'),_0x293d45['id']),moment()[_0x6953('0xc6')](_0x6953('0xe9'))['toString']())}}};var _0x487e1d={'channel':_0x6953('0xe8'),'account':_0x293d45['Account'][_0x6953('0x2d')],'agent':_0x293d45['Owner']?_0x293d45[_0x6953('0xe0')][_0x6953('0x30')]:'N.A.','createdAt':moment(_0x293d45['createdAt'])[_0x6953('0xc6')](_0x6953('0xc7'))[_0x6953('0x98')](),'closedAt':_0x293d45[_0x6953('0xea')]?moment(_0x293d45['closedAt'])['format'](_0x6953('0xc7'))[_0x6953('0x98')]():'','disposition':_0x293d45[_0x6953('0xeb')],'messages':_(_0x293d45[_0x6953('0xda')])[_0x6953('0x83')]({'secret':![]})[_0x6953('0x2f')](function(_0x377c2c){return{'date':moment(_0x377c2c[_0x6953('0xdb')])[_0x6953('0xc6')]('YYYY-MM-DD\x20HH:mm:ss')[_0x6953('0x98')](),'sender':_0x377c2c[_0x6953('0xdc')]===_0x6953('0xec')?_0x377c2c[_0x6953('0x6d')]?_0x377c2c[_0x6953('0x6d')][_0x6953('0x30')]:_0x6953('0xed'):_0x377c2c[_0x6953('0x65')][_0x6953('0xee')]+(_0x377c2c[_0x6953('0x65')][_0x6953('0xd9')]?'\x20'+_0x377c2c[_0x6953('0x65')][_0x6953('0xd9')]:''),'body':_0x377c2c[_0x6953('0x71')],'direction':_0x377c2c[_0x6953('0xdc')]===_0x6953('0xec')?'A':'C','secret':_0x377c2c[_0x6953('0xdd')],'read':_0x377c2c[_0x6953('0x7d')]};})[_0x6953('0x62')]()};return ejs[_0x6953('0xef')](path[_0x6953('0xd1')](config[_0x6953('0xd2')],_0x6953('0xd3'),_0x6953('0xf0'),_0x6953('0xf1')),{'interaction':_0x487e1d})['then'](function(_0x11aece){return new BPromise(function(_0x5a8131,_0x1e8bcd){pdf[_0x6953('0xbb')](_0x11aece,_0x1ccc08)[_0x6953('0xf2')](path[_0x6953('0xd1')](_0x396cbf,_0x6953('0xf3')+_0x293d45['id']+'-'+_0x4cbf0f+_0x6953('0xf4')),function(_0x310fbc,_0x558e86){if(_0x310fbc)return _0x1e8bcd(_0x310fbc);_0x5a8131(_0x558e86);});});})[_0x6953('0x2b')](function(){return new BPromise(function(_0x43a23e,_0x1119cd){zipdir(_0x396cbf,{'saveTo':_0xb74ca4},function(_0x3f5097,_0x1a2525){if(_0x3f5097)return _0x1119cd(_0x3f5097);return _0x43a23e(_0x1a2525);});})[_0x6953('0x2b')](function(){return new BPromise(function(_0x25e138,_0x35a9bc){rimraf(_0x396cbf,function(_0x7bc3ae){if(_0x7bc3ae)_0x35a9bc(_0x7bc3ae);return _0x25e138();});});})[_0x6953('0x2b')](function(){return _0x7cd620[_0x6953('0xcf')](_0xb74ca4,_0x2e68d0,function(_0x25e0f3){if(_0x25e0f3){console['log'](_0x6953('0xf5'),_0x25e0f3);}else{fs[_0x6953('0xf6')](_0xb74ca4);}});});});}else{return _0x7cd620[_0x6953('0x21')](0xc8);}})[_0x6953('0xb5')](handleError(_0x7cd620,null));}; \ No newline at end of file +var _0x3e24=['start','text','buildExpression','some','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','createdAt','$gte','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','isEmpty','t.id\x20IN\x20?','resolve','journey','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','merge','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','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','Owner.internal','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','all','rows','catch','includeAll','include','options','create','body','params','describe','addMessage','ids','omit','getMessages','findOne','YYYY-MM-DD\x20HH:mm:ss','SmsMessage','findAll','addTags','spread','Tag','emit','smsInteractionTags:save','removeTags','download','unix','join','root','server','files','attachments','format','transcript-%d-%s.zip','CmContact','Contact','firstName','lastName','Messages','direction','secret','SmsAccount','Account','Owner','get','10px','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','Sms','YYYY-MM-DD','N.A.','closed','closedAt','disposition','out','renderFile','downloadInteraction.html','toFile','transcript-','.pdf','log','err','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','end','json','count','offset','limit','set','apply','save','update','then','destroy','stack','name','send','Users','map','fullname','TagIds','Tags','split','push','SmsInteraction','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','u.id','user_has_sms_interactions','users','sms_interactions','left_join','cm_contacts','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','sms_interaction_has_tags','tools_tags','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20>\x200','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','UserId'];(function(_0x40230e,_0x1a538c){var _0x19289b=function(_0x3cbab3){while(--_0x3cbab3){_0x40230e['push'](_0x40230e['shift']());}};_0x19289b(++_0x1a538c);}(_0x3e24,0x167));var _0x43e2=function(_0x25825b,_0xf6fd5f){_0x25825b=_0x25825b-0x0;var _0x5e9b99=_0x3e24[_0x25825b];return _0x5e9b99;};'use strict';var pdf=require(_0x43e2('0x0'));var emlformat=require(_0x43e2('0x1'));var rimraf=require(_0x43e2('0x2'));var zipdir=require(_0x43e2('0x3'));var jsonpatch=require(_0x43e2('0x4'));var rp=require('request-promise');var moment=require(_0x43e2('0x5'));var BPromise=require(_0x43e2('0x6'));var Mustache=require('mustache');var util=require(_0x43e2('0x7'));var path=require(_0x43e2('0x8'));var sox=require(_0x43e2('0x9'));var csv=require(_0x43e2('0xa'));var ejs=require(_0x43e2('0xb'));var fs=require('fs');var _=require(_0x43e2('0xc'));var squel=require(_0x43e2('0xd'));var crypto=require('crypto');var jsforce=require(_0x43e2('0xe'));var deskjs=require(_0x43e2('0xf'));var toCsv=require('to-csv');var querystring=require(_0x43e2('0x10'));var Papa=require(_0x43e2('0x11'));var Redis=require('ioredis');var authService=require(_0x43e2('0x12'));var qs=require(_0x43e2('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x43e2('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x43e2('0x15'));var db=require(_0x43e2('0x16'))['db'];config[_0x43e2('0x17')]=_[_0x43e2('0x18')](config[_0x43e2('0x17')],{'host':_0x43e2('0x19'),'port':0x18eb});var socket=require(_0x43e2('0x1a'))(new Redis(config[_0x43e2('0x17')]));require(_0x43e2('0x1b'))[_0x43e2('0x1c')](socket);function respondWithStatusCode(_0x377097,_0x3ccccd){_0x3ccccd=_0x3ccccd||0xcc;return function(_0x5ee7fc){if(_0x5ee7fc){return _0x377097[_0x43e2('0x1d')](_0x3ccccd);}return _0x377097[_0x43e2('0x1e')](_0x3ccccd)[_0x43e2('0x1f')]();};}function respondWithResult(_0x2a0fb0,_0x5cea01){_0x5cea01=_0x5cea01||0xc8;return function(_0x4a6443){if(_0x4a6443){return _0x2a0fb0[_0x43e2('0x1e')](_0x5cea01)[_0x43e2('0x20')](_0x4a6443);}};}function respondWithFilteredResult(_0x27aa89,_0x3a27eb){return function(_0x105cb8){if(_0x105cb8){var _0x1b7cde=_0x105cb8[_0x43e2('0x21')],_0x3ea010=_0x3a27eb['offset'],_0x15ecb5=_0x3a27eb[_0x43e2('0x22')]+_0x3a27eb[_0x43e2('0x23')],_0x3236b9;if(_0x15ecb5>=_0x1b7cde){_0x15ecb5=_0x1b7cde;_0x3236b9=0xc8;}else{_0x3236b9=0xce;}_0x27aa89['status'](_0x3236b9);return _0x27aa89[_0x43e2('0x24')]('Content-Range',_0x3ea010+'-'+_0x15ecb5+'/'+_0x1b7cde)[_0x43e2('0x20')](_0x105cb8);}return null;};}function patchUpdates(_0x13610f){return function(_0x1fac53){try{jsonpatch[_0x43e2('0x25')](_0x1fac53,_0x13610f,!![]);}catch(_0x260a9c){return BPromise['reject'](_0x260a9c);}return _0x1fac53[_0x43e2('0x26')]();};}function saveUpdates(_0x12d842,_0x272934){return function(_0x52e361){if(_0x52e361){return _0x52e361[_0x43e2('0x27')](_0x12d842)[_0x43e2('0x28')](function(_0x43078f){return _0x43078f;});}return null;};}function removeEntity(_0x11b285,_0x4f20e6){return function(_0x3b5b97){if(_0x3b5b97){return _0x3b5b97[_0x43e2('0x29')]()[_0x43e2('0x28')](function(){_0x11b285[_0x43e2('0x1e')](0xcc)[_0x43e2('0x1f')]();});}};}function handleEntityNotFound(_0x2a593e,_0x3ca16b){return function(_0x39a75d){if(!_0x39a75d){_0x2a593e[_0x43e2('0x1d')](0x194);}return _0x39a75d;};}function handleError(_0x1ec68e,_0x1ea844){_0x1ea844=_0x1ea844||0x1f4;return function(_0x1de7e1){logger['error'](_0x1de7e1[_0x43e2('0x2a')]);if(_0x1de7e1[_0x43e2('0x2b')]){delete _0x1de7e1['name'];}_0x1ec68e[_0x43e2('0x1e')](_0x1ea844)[_0x43e2('0x2c')](_0x1de7e1);};}function getInteractionUsers(_0x2dffa2,_0x404483){return new BPromise(function(_0x3fd232,_0x5a896b){try{if(_0x404483[_0x2dffa2['id']]){_0x2dffa2[_0x43e2('0x2d')]=_[_0x43e2('0x2e')](_0x404483[_0x2dffa2['id']],function(_0x1779f9){return{'id':_0x1779f9['id'],'fullname':_0x1779f9[_0x43e2('0x2f')]};});}}catch(_0x3316d6){_0x5a896b(_0x3316d6);}_0x3fd232(_0x2dffa2);});}function getInteractionTags(_0x30bdcb,_0x53f797){return new BPromise(function(_0x51226b,_0xe09322){try{if(_0x30bdcb[_0x43e2('0x30')]){_0x30bdcb[_0x43e2('0x31')]=[];_0x30bdcb[_0x43e2('0x30')][_0x43e2('0x32')](',')['forEach'](function(_0x1b041a){_0x30bdcb[_0x43e2('0x31')][_0x43e2('0x33')](_0x53f797[_0x1b041a]);});}delete _0x30bdcb[_0x43e2('0x30')];}catch(_0x418039){_0xe09322(_0x418039);}_0x51226b(_0x30bdcb);});}function updateSmsInteraction(_0x43ff4e,_0x2fcdd4,_0x56f0ad){return new BPromise(function(_0x5c2eac,_0x2737f7){return getInteractionUsers(_0x43ff4e,_0x56f0ad)[_0x43e2('0x28')](function(_0x4ad24e){return getInteractionTags(_0x4ad24e,_0x2fcdd4);})[_0x43e2('0x28')](function(_0x34effb){_0x5c2eac(_0x34effb);})['catch'](function(_0xad8794){_0x2737f7(_0xad8794);});});}exports['index']=function(_0x4ad658,_0x4cba6b){var _0x2bb489={},_0x5cd807={},_0x3bd654={'count':0x0,'rows':[]};var _0x1a8c4e=_[_0x43e2('0x2e')](db[_0x43e2('0x34')][_0x43e2('0x35')],function(_0x1f2bea){return{'name':_0x1f2bea[_0x43e2('0x36')],'type':_0x1f2bea[_0x43e2('0x37')][_0x43e2('0x38')]};});_0x5cd807[_0x43e2('0x39')]=_[_0x43e2('0x2e')](_0x1a8c4e,_0x43e2('0x2b'));_0x5cd807[_0x43e2('0x3a')]=_[_0x43e2('0x3b')](_0x4ad658[_0x43e2('0x3a')]);_0x5cd807[_0x43e2('0x3c')]=_[_0x43e2('0x3d')](_0x5cd807['model'],_0x5cd807['query']);_0x2bb489['attributes']=_[_0x43e2('0x3d')](_0x5cd807[_0x43e2('0x39')],qs['fields'](_0x4ad658['query'][_0x43e2('0x3e')]));_0x2bb489[_0x43e2('0x3f')]=_0x2bb489[_0x43e2('0x3f')][_0x43e2('0x40')]?_0x2bb489[_0x43e2('0x3f')]:_0x5cd807[_0x43e2('0x39')];if(!_0x4ad658[_0x43e2('0x3a')][_0x43e2('0x41')](_0x43e2('0x42'))){_0x2bb489[_0x43e2('0x23')]=qs[_0x43e2('0x23')](_0x4ad658[_0x43e2('0x3a')][_0x43e2('0x23')]);_0x2bb489[_0x43e2('0x22')]=qs['offset'](_0x4ad658[_0x43e2('0x3a')]['offset']);}_0x2bb489[_0x43e2('0x43')]=qs['sort'](_0x4ad658[_0x43e2('0x3a')][_0x43e2('0x44')]);_0x2bb489[_0x43e2('0x45')]=qs['filters'](_[_0x43e2('0x46')](_0x4ad658['query'],_0x5cd807[_0x43e2('0x3c')]));var _0x36f94a=[];var _0x34f2b5=squel[_0x43e2('0x47')]()['field']('id')['field'](_0x43e2('0x2b'))[_0x43e2('0x48')](_0x43e2('0x49'))[_0x43e2('0x4a')]('tools_tags');var _0x2422b0=squel[_0x43e2('0x47')]()[_0x43e2('0x48')](_0x43e2('0x4b'))[_0x43e2('0x48')]('u.fullname')[_0x43e2('0x48')]('ui.SmsInteractionId')[_0x43e2('0x4a')](_0x43e2('0x4c'),'ui')['left_join'](_0x43e2('0x4d'),'u','u.id\x20=\x20ui.UserId');var _0x4b4e68=squel[_0x43e2('0x47')]()[_0x43e2('0x4a')](_0x43e2('0x4e'),'i')[_0x43e2('0x4f')](_0x43e2('0x50'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x43e2('0x4f')](_0x43e2('0x4d'),'o',_0x43e2('0x51'))[_0x43e2('0x4f')](_0x43e2('0x52'),'a',_0x43e2('0x53'))[_0x43e2('0x4f')](_0x43e2('0x54'),'me','me.SmsInteractionId\x20=\x20i.id')[_0x43e2('0x4f')](_0x43e2('0x55'),'it','it.SmsInteractionId\x20=\x20i.id')[_0x43e2('0x4f')](_0x43e2('0x56'),'t',_0x43e2('0x57'));var _0x8bc721=squel['expr']();var _0x48df9e=[];var _0x3b4296=squel[_0x43e2('0x58')]();var _0x1dd1c9;if(_0x4ad658[_0x43e2('0x3a')]['search']){_0x1dd1c9=as['parseSearch'](_0x4ad658[_0x43e2('0x3a')][_0x43e2('0x59')]);var _0x5ace5a=_0x1dd1c9[_0x43e2('0x5a')];for(var _0x28a101=0x0;_0x28a101<_0x1dd1c9[_0x43e2('0x5b')]['length'];_0x28a101++){var _0x5d1113=_0x1dd1c9[_0x43e2('0x5b')][_0x28a101];var _0x111384='i';var _0x32148b=_[_0x43e2('0x5c')](_0x1a8c4e,[_0x43e2('0x2b'),_0x5d1113[_0x43e2('0x48')]]);if(!_0x32148b){switch(_0x5d1113[_0x43e2('0x48')]){case _0x43e2('0x5d'):if(_0x5d1113[_0x43e2('0x5e')]==0x1){_0x4b4e68['having']('`'+_0x5d1113[_0x43e2('0x48')]+'`\x20=\x200');}else{_0x4b4e68[_0x43e2('0x5f')]('`'+_0x5d1113[_0x43e2('0x48')]+_0x43e2('0x60'));}break;case'Contact':if(_0x5d1113[_0x43e2('0x61')]===_0x43e2('0x62')){if(_0x5d1113[_0x43e2('0x5e')][_0x43e2('0x32')]('\x20')[_0x43e2('0x40')]>0x1){_0x8bc721[_0x5ace5a](_0x43e2('0x63'),qs[_0x43e2('0x64')](_0x5d1113[_0x43e2('0x5e')]),null);}else{var _0xc72b92='%'+_0x5d1113[_0x43e2('0x5e')]+'%';_0x8bc721[_0x5ace5a](_0x43e2('0x65'),_0xc72b92,_0xc72b92,_0xc72b92);}}else{_0x32148b=_[_0x43e2('0x5c')](_0x1a8c4e,[_0x43e2('0x2b'),'ContactId']);_0x5d1113['field']='ContactId';_0x25037d=as['buildExpression'](_0x111384,_0x32148b['type'],_0x5d1113);_0x8bc721[_0x5ace5a](_0x25037d['text'],_0x25037d[_0x43e2('0x5e')]['start'],_0x25037d['value'][_0x43e2('0x1f')]);}break;case'Tag':var _0x299c47=_0x5d1113['value'][_0x43e2('0x32')](',')[_0x43e2('0x2e')](function(_0x1d8647){return Number(_0x1d8647);});_0x299c47[_0x43e2('0x66')](function(_0x21d35d){_0x3b4296['or'](_0x43e2('0x67'),'%,'+_0x21d35d+',%');});_0x48df9e=_[_0x43e2('0x68')](_0x48df9e,_0x299c47);break;case _0x43e2('0x69'):if(_0x5d1113[_0x43e2('0x61')]===_0x43e2('0x62')){_0x8bc721[_0x5ace5a]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x5d1113[_0x43e2('0x5e')]+'%',null);}else{_0x32148b=_[_0x43e2('0x5c')](_0x1a8c4e,['name',_0x43e2('0x6a')]);_0x5d1113['field']='UserId';_0x25037d=as['buildExpression'](_0x111384,_0x32148b['type'],_0x5d1113);_0x8bc721[_0x5ace5a](_0x25037d['text'],_0x25037d[_0x43e2('0x5e')][_0x43e2('0x6b')],_0x25037d[_0x43e2('0x5e')][_0x43e2('0x1f')]);}break;case'body':_0x25037d=as['buildExpression']('me',null,_0x5d1113);_0x8bc721[_0x5ace5a](_0x25037d[_0x43e2('0x6c')],_0x25037d[_0x43e2('0x5e')][_0x43e2('0x6b')],_0x25037d[_0x43e2('0x5e')][_0x43e2('0x1f')]);break;}}else{var _0x25037d=as[_0x43e2('0x6d')](_0x111384,_0x32148b[_0x43e2('0x37')],_0x5d1113);_0x8bc721[_0x5ace5a](_0x25037d[_0x43e2('0x6c')],_0x25037d[_0x43e2('0x5e')][_0x43e2('0x6b')],_0x25037d['value'][_0x43e2('0x1f')]);}}}else{var _0x477c5f=_(_0x4ad658[_0x43e2('0x3a')])[_0x43e2('0x3b')]()[_0x43e2('0x2e')](function(_0x4de70e){return _[_0x43e2('0x6e')](_0x1a8c4e,[_0x43e2('0x2b'),_0x4de70e])?_0x4de70e:undefined;})['compact']()[_0x43e2('0x5e')]();if(!_['isEmpty'](_0x477c5f)){_0x477c5f[_0x43e2('0x66')](function(_0x2652a5){if(_0x2652a5===_0x43e2('0x6f')){_0x4b4e68[_0x43e2('0x45')](_0x43e2('0x70'),[][_0x43e2('0x71')](_0x4ad658[_0x43e2('0x3a')][_0x2652a5]));}else if(_0x2652a5===_0x43e2('0x72')){var _0x4496b9=JSON['parse'](_0x4ad658['query'][_0x2652a5])[_0x43e2('0x73')];var _0x2d93d6=JSON[_0x43e2('0x74')](_0x4ad658[_0x43e2('0x3a')][_0x2652a5])['$lte'];_0x4b4e68[_0x43e2('0x45')](_0x43e2('0x75'),_0x4496b9,_0x2d93d6);}else{if(_0x4ad658[_0x43e2('0x3a')][_0x2652a5]==='null'){_0x4b4e68[_0x43e2('0x45')]('i.'+_0x2652a5+_0x43e2('0x76'));}else{_0x4b4e68[_0x43e2('0x45')]('i.'+_0x2652a5+_0x43e2('0x77'),_0x4ad658['query'][_0x2652a5]);}}});}if(_0x4ad658[_0x43e2('0x3a')][_0x43e2('0x78')]){if(_0x4ad658[_0x43e2('0x3a')]['read']==0x1){_0x4b4e68['having'](_0x43e2('0x79'));}else{_0x4b4e68[_0x43e2('0x5f')]('`unreadMessages`\x20>\x200');}}if(_0x4ad658[_0x43e2('0x3a')][_0x43e2('0x7a')]){_0x48df9e=_[_0x43e2('0x7b')](_0x4ad658['query'][_0x43e2('0x7a')])?_0x4ad658['query'][_0x43e2('0x7a')]:new Array(_0x4ad658[_0x43e2('0x3a')][_0x43e2('0x7a')]);_0x48df9e[_0x43e2('0x66')](function(_0x39c9b6){_0x3b4296['or'](_0x43e2('0x67'),'%,'+_0x39c9b6+',%');});}if(_0x4ad658[_0x43e2('0x3a')][_0x43e2('0x7c')]){var _0x4ece0a=_0x4ad658[_0x43e2('0x3a')][_0x43e2('0x7c')][_0x43e2('0x7d')]('\x5c','\x5c\x5c')[_0x43e2('0x7d')]('\x27\x27',_0x43e2('0x7e'));if(qs[_0x43e2('0x7f')](_0x4ece0a)){_0x8bc721['or'](_0x43e2('0x80'),_0x4ece0a+'%')['or'](_0x43e2('0x81'),_0x4ece0a+'%');}else{_0x8bc721['or'](_0x43e2('0x82'),qs[_0x43e2('0x64')](_0x4ece0a))['or'](_0x43e2('0x83'),_0x4ece0a+'%');}}}_0x4b4e68['where'](_0x8bc721);_0x4b4e68[_0x43e2('0x84')](_0x43e2('0x85'));var _0x285dc6={'type':db['Sequelize'][_0x43e2('0x86')][_0x43e2('0x87')],'raw':!![]};var _0x374657=_0x4b4e68[_0x43e2('0x88')]();_0x374657['field'](_0x43e2('0x85'));_0x374657['field'](_0x43e2('0x89'),_0x43e2('0x5d'));if(_0x2bb489[_0x43e2('0x43')]){_0x2bb489['order'][_0x43e2('0x66')](function(_0x282876){_0x4b4e68[_0x43e2('0x43')]('i.'+_0x282876[0x0],_0x282876[0x1]===_0x43e2('0x8a')?![]:!![]);});}if(!_[_0x43e2('0x8b')](_0x48df9e)){_0x4b4e68[_0x43e2('0x5f')](_0x3b4296);_0x374657[_0x43e2('0x45')](_0x43e2('0x8c'),_0x48df9e);}BPromise[_0x43e2('0x8d')]()[_0x43e2('0x28')](function(){if(!_0x1dd1c9){if(_0x4ad658[_0x43e2('0x3a')]['SmsAccountId']||_0x4ad658[_0x43e2('0x3a')][_0x43e2('0x8e')])return;_0x374657[_0x43e2('0x45')](_0x43e2('0x8f'));_0x4b4e68['where'](_0x43e2('0x8f'));return;}return _0x4ad658[_0x43e2('0x90')][_0x43e2('0x91')]({'attributes':['id'],'raw':!![]})[_0x43e2('0x28')](function(_0x2af821){if(_[_0x43e2('0x8b')](_0x2af821)){_0x374657[_0x43e2('0x45')](_0x43e2('0x92'));_0x4b4e68['where'](_0x43e2('0x92'));}else{_0x374657[_0x43e2('0x45')](_0x43e2('0x70'),_[_0x43e2('0x2e')](_0x2af821,'id'));_0x4b4e68[_0x43e2('0x45')](_0x43e2('0x70'),_[_0x43e2('0x2e')](_0x2af821,'id'));}});})['then'](function(){db[_0x43e2('0x93')][_0x43e2('0x3a')](_0x374657[_0x43e2('0x94')](),_0x285dc6)[_0x43e2('0x28')](function(_0x144f3d){_0x3bd654[_0x43e2('0x21')]=_0x144f3d['length'];if(_0x3bd654[_0x43e2('0x21')]===0x0)return[];return db[_0x43e2('0x93')][_0x43e2('0x3a')](_0x34f2b5[_0x43e2('0x94')](),_0x285dc6)[_0x43e2('0x28')](function(_0xe915c6){_0x36f94a=_['keyBy'](_0xe915c6,'id');_0x285dc6=_[_0x43e2('0x95')](_0x285dc6,{'model':db[_0x43e2('0x34')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4ad658[_0x43e2('0x3a')]['fields']){_0x2bb489['attributes'][_0x43e2('0x66')](function(_0x4d9520){_0x4b4e68['field']('i.'+_0x4d9520);});}else{_0x4b4e68[_0x43e2('0x48')](_0x43e2('0x89'),_0x43e2('0x5d'));_0x4b4e68['field'](_0x43e2('0x96'),'Account.key');_0x4b4e68[_0x43e2('0x48')](_0x43e2('0x97'),_0x43e2('0x98'));_0x4b4e68['field']('i.*');_0x4b4e68['field'](_0x43e2('0x99'),_0x43e2('0x9a'));_0x4b4e68[_0x43e2('0x48')](_0x43e2('0x9b'),_0x43e2('0x9c'));_0x4b4e68[_0x43e2('0x48')](_0x43e2('0x9d'),_0x43e2('0x9e'));_0x4b4e68[_0x43e2('0x48')](_0x43e2('0x9f'),_0x43e2('0xa0'));_0x4b4e68['field'](_0x43e2('0xa1'),_0x43e2('0xa2'));_0x4b4e68['field'](_0x43e2('0xa3'),'Contact.fax');_0x4b4e68[_0x43e2('0x48')](_0x43e2('0xa4'),_0x43e2('0xa5'));_0x4b4e68['field'](_0x43e2('0xa6'),_0x43e2('0xa7'));_0x4b4e68['field']('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}_0x4b4e68[_0x43e2('0x23')](_0x2bb489[_0x43e2('0x23')]);_0x4b4e68[_0x43e2('0x22')](_0x2bb489[_0x43e2('0x22')]);return db[_0x43e2('0x93')][_0x43e2('0x3a')](_0x4b4e68[_0x43e2('0x94')](),_0x285dc6);})['then'](function(_0x50de17){_0x2422b0[_0x43e2('0x45')](_0x43e2('0xa8'),_['map'](_0x50de17,'id'));return db[_0x43e2('0x93')][_0x43e2('0x3a')](_0x2422b0[_0x43e2('0x94')](),_0x285dc6)['then'](function(_0x268955){var _0xe02c94=_[_0x43e2('0xa9')](_0x268955,_0x43e2('0xaa'));var _0x1eae84=[];_0x50de17[_0x43e2('0x66')](function(_0x4150fb){_0x1eae84[_0x43e2('0x33')](updateSmsInteraction(_0x4150fb,_0x36f94a,_0xe02c94));});return BPromise[_0x43e2('0xab')](_0x1eae84);});});})[_0x43e2('0x28')](function(_0x3bfdb6){_0x3bd654[_0x43e2('0xac')]=_0x3bfdb6;return _0x3bd654;})[_0x43e2('0x28')](respondWithFilteredResult(_0x4cba6b,_0x2bb489));})[_0x43e2('0xad')](handleError(_0x4cba6b,null));};exports['show']=function(_0x3e343c,_0x3468e2){var _0x4fad8b={'raw':![],'where':{'id':_0x3e343c['params']['id']}},_0x53e383={};_0x53e383[_0x43e2('0x39')]=_[_0x43e2('0x3b')](db[_0x43e2('0x34')]['rawAttributes']);_0x53e383['query']=_[_0x43e2('0x3b')](_0x3e343c[_0x43e2('0x3a')]);_0x53e383[_0x43e2('0x3c')]=_[_0x43e2('0x3d')](_0x53e383[_0x43e2('0x39')],_0x53e383[_0x43e2('0x3a')]);_0x4fad8b[_0x43e2('0x3f')]=_[_0x43e2('0x3d')](_0x53e383[_0x43e2('0x39')],qs[_0x43e2('0x3e')](_0x3e343c[_0x43e2('0x3a')][_0x43e2('0x3e')]));_0x4fad8b[_0x43e2('0x3f')]=_0x4fad8b[_0x43e2('0x3f')][_0x43e2('0x40')]?_0x4fad8b[_0x43e2('0x3f')]:_0x53e383[_0x43e2('0x39')];if(_0x3e343c[_0x43e2('0x3a')][_0x43e2('0xae')]){_0x4fad8b[_0x43e2('0xaf')]=[{'all':!![]}];}_0x4fad8b=_[_0x43e2('0x95')]({},_0x4fad8b,_0x3e343c[_0x43e2('0xb0')]);return db[_0x43e2('0x34')][_0x43e2('0x5c')](_0x4fad8b)[_0x43e2('0x28')](handleEntityNotFound(_0x3468e2,null))['then'](respondWithResult(_0x3468e2,null))['catch'](handleError(_0x3468e2,null));};exports[_0x43e2('0xb1')]=function(_0x91a4c7,_0x3c1eb4){return db['SmsInteraction'][_0x43e2('0xb1')](_0x91a4c7[_0x43e2('0xb2')],{})[_0x43e2('0x28')](respondWithResult(_0x3c1eb4,0xc9))['catch'](handleError(_0x3c1eb4,null));};exports['update']=function(_0x5946fc,_0x414287){if(_0x5946fc[_0x43e2('0xb2')]['id']){delete _0x5946fc[_0x43e2('0xb2')]['id'];}return db[_0x43e2('0x34')][_0x43e2('0x5c')]({'where':{'id':_0x5946fc[_0x43e2('0xb3')]['id']}})[_0x43e2('0x28')](handleEntityNotFound(_0x414287,null))[_0x43e2('0x28')](saveUpdates(_0x5946fc[_0x43e2('0xb2')],null))['then'](respondWithResult(_0x414287,null))[_0x43e2('0xad')](handleError(_0x414287,null));};exports['destroy']=function(_0x32ce01,_0x9fcf9d){return db[_0x43e2('0x34')][_0x43e2('0x5c')]({'where':{'id':_0x32ce01[_0x43e2('0xb3')]['id']}})['then'](handleEntityNotFound(_0x9fcf9d,null))[_0x43e2('0x28')](removeEntity(_0x9fcf9d,null))[_0x43e2('0xad')](handleError(_0x9fcf9d,null));};exports[_0x43e2('0xb4')]=function(_0xfb3515,_0x363093){return db[_0x43e2('0x34')][_0x43e2('0xb4')]()['then'](respondWithResult(_0x363093,null))[_0x43e2('0xad')](handleError(_0x363093,null));};exports['addMessage']=function(_0x2df097,_0x32a25e,_0x59c59b){return db['SmsMessage'][_0x43e2('0x5c')]({'where':{'id':_0x2df097[_0x43e2('0xb3')]['id']}})[_0x43e2('0x28')](handleEntityNotFound(_0x32a25e,null))['then'](function(_0x33c270){if(_0x33c270){return _0x33c270[_0x43e2('0xb5')](_0x2df097[_0x43e2('0xb2')][_0x43e2('0xb6')],_[_0x43e2('0xb7')](_0x2df097['body'],[_0x43e2('0xb6'),'id'])||{});}})['then'](respondWithResult(_0x32a25e,null))[_0x43e2('0xad')](handleError(_0x32a25e,null));};exports[_0x43e2('0xb8')]=function(_0x48f833,_0x3be03d,_0x179af4){var _0x55290d={'raw':![],'where':{}};var _0x15033d={};var _0x897b98={'count':0x0,'rows':[]};return db[_0x43e2('0x34')][_0x43e2('0xb9')]({'where':{'id':_0x48f833[_0x43e2('0xb3')]['id']}})['then'](handleEntityNotFound(_0x3be03d,null))['then'](function(_0xb73c15){if(_0xb73c15){_0x15033d['model']=_['keys'](db['SmsMessage'][_0x43e2('0x35')]);_0x15033d[_0x43e2('0x3a')]=_['keys'](_0x48f833['query']);_0x15033d['filters']=_[_0x43e2('0x3d')](_0x15033d[_0x43e2('0x39')],_0x15033d[_0x43e2('0x3a')]);_0x55290d[_0x43e2('0x3f')]=_['intersection'](_0x15033d['model'],qs[_0x43e2('0x3e')](_0x48f833[_0x43e2('0x3a')][_0x43e2('0x3e')]));_0x55290d[_0x43e2('0x3f')]=_0x55290d[_0x43e2('0x3f')][_0x43e2('0x40')]?_0x55290d[_0x43e2('0x3f')]:_0x15033d[_0x43e2('0x39')];if(!_0x48f833[_0x43e2('0x3a')][_0x43e2('0x41')](_0x43e2('0x42'))){_0x55290d[_0x43e2('0x23')]=qs[_0x43e2('0x23')](_0x48f833[_0x43e2('0x3a')][_0x43e2('0x23')]);_0x55290d[_0x43e2('0x22')]=qs[_0x43e2('0x22')](_0x48f833['query']['offset']);}_0x55290d[_0x43e2('0x43')]=qs[_0x43e2('0x44')](_0x48f833[_0x43e2('0x3a')][_0x43e2('0x44')]);_0x55290d[_0x43e2('0x45')]=qs[_0x43e2('0x3c')](_[_0x43e2('0x46')](_0x48f833[_0x43e2('0x3a')],_0x15033d[_0x43e2('0x3c')]));_0x55290d[_0x43e2('0x45')][_0x43e2('0xaa')]=_0xb73c15['id'];if(_0x48f833[_0x43e2('0x3a')]['filter']){_0x55290d[_0x43e2('0x45')]=_['merge'](_0x55290d[_0x43e2('0x45')],{'$or':_[_0x43e2('0x2e')](_0x55290d[_0x43e2('0x3f')],function(_0x2f46da){var _0x4ca40e={};_0x4ca40e[_0x2f46da]={'$like':'%'+_0x48f833[_0x43e2('0x3a')][_0x43e2('0x7c')]+'%'};return _0x4ca40e;})});}if(_0x48f833[_0x43e2('0x3a')][_0x43e2('0x73')]){var _0x4d7d7b=_0x48f833['query']['$gte']['split'](',');var _0xe541ff={};_0xe541ff[_0x4d7d7b[0x0]]={'$gte':moment(_0x4d7d7b[0x1])['format'](_0x43e2('0xba'))};_0x55290d[_0x43e2('0x45')]=_[_0x43e2('0x95')](_0x55290d[_0x43e2('0x45')],_0xe541ff);}_0x55290d=_[_0x43e2('0x95')]({},_0x55290d,_0x48f833[_0x43e2('0xb0')]);return db[_0x43e2('0xbb')][_0x43e2('0x21')]({'where':_0x55290d[_0x43e2('0x45')]})[_0x43e2('0x28')](function(_0x327b33){_0x897b98['count']=_0x327b33;if(_0x48f833['query'][_0x43e2('0xae')]){_0x55290d[_0x43e2('0xaf')]=[{'all':!![]}];}return db[_0x43e2('0xbb')][_0x43e2('0xbc')](_0x55290d);})[_0x43e2('0x28')](function(_0x33d53c){_0x897b98['rows']=_0x33d53c;return _0x897b98;});}})[_0x43e2('0x28')](respondWithFilteredResult(_0x3be03d,_0x55290d))[_0x43e2('0xad')](handleError(_0x3be03d,null));};exports[_0x43e2('0xbd')]=function(_0x3b10e1,_0x5ed830,_0x3a5891){return db[_0x43e2('0x34')]['find']({'where':{'id':_0x3b10e1[_0x43e2('0xb3')]['id']}})[_0x43e2('0x28')](handleEntityNotFound(_0x5ed830,null))[_0x43e2('0x28')](function(_0x17f5a2){if(_0x17f5a2){return _0x17f5a2['setTags'](_0x3b10e1['body'][_0x43e2('0xb6')],_[_0x43e2('0xb7')](_0x3b10e1[_0x43e2('0xb2')],[_0x43e2('0xb6'),'id'])||{})[_0x43e2('0xbe')](function(){return db[_0x43e2('0xbf')][_0x43e2('0xbc')]({'attributes':['id',_0x43e2('0x2b'),'color'],'where':{'id':_0x3b10e1[_0x43e2('0xb2')][_0x43e2('0xb6')]}});})['then'](function(_0x3ae34a){socket[_0x43e2('0xc0')](_0x43e2('0xc1'),{'id':Number(_0x3b10e1[_0x43e2('0xb3')]['id']),'tags':_0x3ae34a||[]});return{'id':Number(_0x3b10e1[_0x43e2('0xb3')]['id']),'tags':_0x3ae34a||[]};});}})[_0x43e2('0x28')](respondWithResult(_0x5ed830,null))[_0x43e2('0xad')](handleError(_0x5ed830,null));};exports[_0x43e2('0xc2')]=function(_0x4887b0,_0x3a5f66,_0x220790){return db[_0x43e2('0x34')]['find']({'where':{'id':_0x4887b0[_0x43e2('0xb3')]['id']}})[_0x43e2('0x28')](handleEntityNotFound(_0x3a5f66,null))[_0x43e2('0x28')](function(_0x59d12d){if(_0x59d12d){return _0x59d12d[_0x43e2('0xc2')](_0x4887b0[_0x43e2('0x3a')][_0x43e2('0xb6')]);}})[_0x43e2('0x28')](respondWithStatusCode(_0x3a5f66,null))[_0x43e2('0xad')](handleError(_0x3a5f66,null));};exports[_0x43e2('0xc3')]=function(_0x3b5cdd,_0x50c7da){var _0x17476b=moment()[_0x43e2('0xc4')]()[_0x43e2('0x94')]();var _0x37fbce=path[_0x43e2('0xc5')](config[_0x43e2('0xc6')],_0x43e2('0xc7'),_0x43e2('0xc8'),'tmp');var _0x494e72=path[_0x43e2('0xc5')](config[_0x43e2('0xc6')],_0x43e2('0xc7'),'files',_0x43e2('0xc9'));var _0x316638=path['join'](_0x37fbce,_0x17476b);var _0x18b269=util[_0x43e2('0xca')](_0x43e2('0xcb'),_0x3b5cdd[_0x43e2('0xb3')]['id'],_0x17476b);var _0x204421=path['join'](_0x37fbce,_0x18b269);var _0x33f907=[];_0x33f907[_0x43e2('0x33')]({'model':db[_0x43e2('0x69')],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x33f907['push']({'model':db[_0x43e2('0xcc')],'as':_0x43e2('0xcd'),'attributes':['id',_0x43e2('0xce'),_0x43e2('0xcf')],'raw':!![]});var _0x160a1e=[{'model':db['SmsMessage'],'as':_0x43e2('0xd0'),'attributes':['id','body','createdAt',_0x43e2('0xd1'),_0x43e2('0xd2'),_0x43e2('0x78')],'include':_0x33f907}];_0x160a1e[_0x43e2('0x33')]({'model':db[_0x43e2('0xd3')],'as':_0x43e2('0xd4'),'attributes':['id','name']});_0x160a1e['push']({'model':db['User'],'as':_0x43e2('0xd5'),'attributes':['id',_0x43e2('0x2f')]});return db[_0x43e2('0x34')][_0x43e2('0x5c')]({'where':{'id':_0x3b5cdd[_0x43e2('0xb3')]['id']},'include':_0x160a1e})[_0x43e2('0x28')](handleEntityNotFound(_0x50c7da,null))[_0x43e2('0x28')](function(_0x1eca52){if(_0x1eca52){var _0x13886f=_0x1eca52[_0x43e2('0xd6')]({'plain':!![]});fs['mkdirSync'](_0x316638);var _0x1555e1={'format':'A4','border':_0x43e2('0xd7'),'header':{'height':'40px','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':_0x43e2('0xd8'),'contents':{'default':util[_0x43e2('0xca')](_0x43e2('0xd9'),util['format']('%s\x20#%d',_0x43e2('0xda'),_0x13886f['id']),moment()[_0x43e2('0xca')](_0x43e2('0xdb'))[_0x43e2('0x94')]())}}};var _0x3be57e={'channel':'Sms','account':_0x13886f[_0x43e2('0xd4')][_0x43e2('0x2b')],'agent':_0x13886f[_0x43e2('0xd5')]?_0x13886f[_0x43e2('0xd5')]['fullname']:_0x43e2('0xdc'),'createdAt':moment(_0x13886f[_0x43e2('0x72')])[_0x43e2('0xca')](_0x43e2('0xba'))[_0x43e2('0x94')](),'closedAt':_0x13886f[_0x43e2('0xdd')]?moment(_0x13886f[_0x43e2('0xde')])['format'](_0x43e2('0xba'))['toString']():'','disposition':_0x13886f[_0x43e2('0xdf')],'messages':_(_0x13886f[_0x43e2('0xd0')])['filter']({'secret':![]})[_0x43e2('0x2e')](function(_0x3569d2){return{'date':moment(_0x3569d2[_0x43e2('0x72')])[_0x43e2('0xca')](_0x43e2('0xba'))['toString'](),'sender':_0x3569d2[_0x43e2('0xd1')]===_0x43e2('0xe0')?_0x3569d2[_0x43e2('0x69')]?_0x3569d2[_0x43e2('0x69')]['fullname']:'System':_0x3569d2[_0x43e2('0xcd')][_0x43e2('0xce')]+(_0x3569d2[_0x43e2('0xcd')][_0x43e2('0xcf')]?'\x20'+_0x3569d2[_0x43e2('0xcd')][_0x43e2('0xcf')]:''),'body':_0x3569d2[_0x43e2('0xb2')],'direction':_0x3569d2[_0x43e2('0xd1')]===_0x43e2('0xe0')?'A':'C','secret':_0x3569d2['secret'],'read':_0x3569d2[_0x43e2('0x78')]};})[_0x43e2('0x5e')]()};return ejs[_0x43e2('0xe1')](path[_0x43e2('0xc5')](config['root'],_0x43e2('0xc7'),'views',_0x43e2('0xe2')),{'interaction':_0x3be57e})[_0x43e2('0x28')](function(_0x7e89ea){return new BPromise(function(_0x189fa7,_0x1b9ed5){pdf[_0x43e2('0xb1')](_0x7e89ea,_0x1555e1)[_0x43e2('0xe3')](path[_0x43e2('0xc5')](_0x316638,_0x43e2('0xe4')+_0x13886f['id']+'-'+_0x17476b+_0x43e2('0xe5')),function(_0x608a90,_0x4c9373){if(_0x608a90)return _0x1b9ed5(_0x608a90);_0x189fa7(_0x4c9373);});});})['then'](function(){return new BPromise(function(_0x57c3f3,_0x5d86b3){zipdir(_0x316638,{'saveTo':_0x204421},function(_0x18d552,_0x5dcb70){if(_0x18d552)return _0x5d86b3(_0x18d552);return _0x57c3f3(_0x5dcb70);});})[_0x43e2('0x28')](function(){return new BPromise(function(_0x2519ed,_0x41533a){rimraf(_0x316638,function(_0x1b4359){if(_0x1b4359)_0x41533a(_0x1b4359);return _0x2519ed();});});})[_0x43e2('0x28')](function(){return _0x50c7da['download'](_0x204421,_0x18b269,function(_0x52398b){if(_0x52398b){console[_0x43e2('0xe6')](_0x43e2('0xe7'),_0x52398b);}else{fs[_0x43e2('0xe8')](_0x204421);}});});});}else{return _0x50c7da[_0x43e2('0x1d')](0xc8);}})[_0x43e2('0xad')](handleError(_0x50c7da,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index d05784b..4c82ad9 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 _0xd67b=['map','findAll','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','SmsMessage','setMaxListeners','update','getUsers','then','setDataValue','Users'];(function(_0x4d564f,_0x54dbb5){var _0x12e1fd=function(_0x208f6a){while(--_0x208f6a){_0x4d564f['push'](_0x4d564f['shift']());}};_0x12e1fd(++_0x54dbb5);}(_0xd67b,0x133));var _0xbd67=function(_0x16b297,_0x3348c0){_0x16b297=_0x16b297-0x0;var _0x50a357=_0xd67b[_0x16b297];return _0x50a357;};'use strict';var EventEmitter=require('events');var SmsInteraction=require(_0xbd67('0x0'))['db']['SmsInteraction'];var SmsMessage=require(_0xbd67('0x0'))['db'][_0xbd67('0x1')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xbd67('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbd67('0x3'),'afterDestroy':'remove'};function emitEvent(_0x1bf96){return function(_0x5a827b,_0x309962,_0xa5c384){_0x5a827b[_0xbd67('0x4')]({'attributes':['id'],'raw':!![]})[_0xbd67('0x5')](function(_0x1860c9){_0x5a827b[_0xbd67('0x6')](_0xbd67('0x7'),_0x1860c9[_0xbd67('0x8')](function(_0x1da7f1){return{'id':_0x1da7f1['id']};}));return SmsMessage[_0xbd67('0x9')]({'where':{'SmsInteractionId':_0x5a827b['id'],'direction':'in','read':![]},'raw':!![]});})[_0xbd67('0x5')](function(_0x3a7f43){_0x5a827b[_0xbd67('0x6')]('unreadMessages',_0x3a7f43['length']);SmsInteractionEvents[_0xbd67('0xa')](_0x1bf96+':'+_0x5a827b['id'],_0x5a827b);SmsInteractionEvents['emit'](_0x1bf96,_0x5a827b);_0xa5c384(null);})[_0xbd67('0xb')](_0xa5c384(null));};}for(var e in events){if(events[_0xbd67('0xc')](e)){var event=events[e];SmsInteraction[_0xbd67('0xd')](e,emitEvent(event));}}module[_0xbd67('0xe')]=SmsInteractionEvents; \ No newline at end of file +var _0xab86=['SmsInteraction','setMaxListeners','update','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','emit','catch','hook','exports','events','../../mysqldb'];(function(_0x292423,_0x1759b7){var _0x2801cb=function(_0x23c821){while(--_0x23c821){_0x292423['push'](_0x292423['shift']());}};_0x2801cb(++_0x1759b7);}(_0xab86,0x13e));var _0x6ab8=function(_0x9a9370,_0x25cd69){_0x9a9370=_0x9a9370-0x0;var _0x1418af=_0xab86[_0x9a9370];return _0x1418af;};'use strict';var EventEmitter=require(_0x6ab8('0x0'));var SmsInteraction=require(_0x6ab8('0x1'))['db'][_0x6ab8('0x2')];var SmsMessage=require('../../mysqldb')['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x6ab8('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6ab8('0x4'),'afterDestroy':'remove'};function emitEvent(_0xf27ba7){return function(_0x40e2ad,_0x420a9f,_0x154d17){_0x40e2ad[_0x6ab8('0x5')]({'attributes':['id'],'raw':!![]})[_0x6ab8('0x6')](function(_0x2b6295){_0x40e2ad[_0x6ab8('0x7')](_0x6ab8('0x8'),_0x2b6295[_0x6ab8('0x9')](function(_0x2b429d){return{'id':_0x2b429d['id']};}));return SmsMessage[_0x6ab8('0xa')]({'where':{'SmsInteractionId':_0x40e2ad['id'],'direction':'in','read':![]},'raw':!![]});})[_0x6ab8('0x6')](function(_0x5127eb){_0x40e2ad['setDataValue'](_0x6ab8('0xb'),_0x5127eb['length']);SmsInteractionEvents[_0x6ab8('0xc')](_0xf27ba7+':'+_0x40e2ad['id'],_0x40e2ad);SmsInteractionEvents[_0x6ab8('0xc')](_0xf27ba7,_0x40e2ad);_0x154d17(null);})[_0x6ab8('0xd')](_0x154d17(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction[_0x6ab8('0xe')](e,emitEvent(event));}}module[_0x6ab8('0xf')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index ddf8729..24c9ffd 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 _0xc38d=['./smsInteraction.attributes','SmsInteraction','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3147a7,_0x56df7a){var _0x1fc991=function(_0x557f23){while(--_0x557f23){_0x3147a7['push'](_0x3147a7['shift']());}};_0x1fc991(++_0x56df7a);}(_0xc38d,0x110));var _0xdc38=function(_0x406f47,_0x2d765a){_0x406f47=_0x406f47-0x0;var _0x5e49cd=_0xc38d[_0x406f47];return _0x5e49cd;};'use strict';var _=require(_0xdc38('0x0'));var util=require(_0xdc38('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xdc38('0x2'));var BPromise=require(_0xdc38('0x3'));var rp=require(_0xdc38('0x4'));var fs=require('fs');var path=require(_0xdc38('0x5'));var rimraf=require(_0xdc38('0x6'));var config=require(_0xdc38('0x7'));var attributes=require(_0xdc38('0x8'));module['exports']=function(_0x33fa3f,_0x36835d){return _0x33fa3f['define'](_0xdc38('0x9'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1b952a,_0x81d274,_0x3a60b2){if(_0x1b952a[_0xdc38('0xa')](_0xdc38('0xb'))){_0x1b952a[_0xdc38('0xc')]=moment()['format'](_0xdc38('0xd'));}_0x3a60b2(null,_0x1b952a);}}});}; \ No newline at end of file +var _0xeb03=['define','SmsInteraction','sms_interactions','changed','closed','closedAt','format','util','api','moment','bluebird','path','rimraf','../../config/environment','./smsInteraction.attributes'];(function(_0xc67528,_0x24e2fb){var _0x38e26d=function(_0x1b0efe){while(--_0x1b0efe){_0xc67528['push'](_0xc67528['shift']());}};_0x38e26d(++_0x24e2fb);}(_0xeb03,0xe8));var _0x3eb0=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xeb03[_0x465a0c];return _0x1e202e;};'use strict';var _=require('lodash');var util=require(_0x3eb0('0x0'));var logger=require('../../config/logger')(_0x3eb0('0x1'));var moment=require(_0x3eb0('0x2'));var BPromise=require(_0x3eb0('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3eb0('0x4'));var rimraf=require(_0x3eb0('0x5'));var config=require(_0x3eb0('0x6'));var attributes=require(_0x3eb0('0x7'));module['exports']=function(_0x4b381b,_0x14c6f5){return _0x4b381b[_0x3eb0('0x8')](_0x3eb0('0x9'),attributes,{'tableName':_0x3eb0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2a8f29,_0x1f516b,_0x205378){if(_0x2a8f29[_0x3eb0('0xb')](_0x3eb0('0xc'))){_0x2a8f29[_0x3eb0('0xd')]=moment()[_0x3eb0('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x205378(null,_0x2a8f29);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index cbc7b6e..a0d7472 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 _0x4f58=['addTags','ids','AddTags','stringify','lodash','util','moment','bluebird','ioredis','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./smsInteraction.socket','register','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateSmsInteraction','SmsInteraction','body','options','raw','where','limit','AddTagsToSmsInteraction','find','then'];(function(_0x511d17,_0xeeb440){var _0x2cc88c=function(_0x5404a3){while(--_0x5404a3){_0x511d17['push'](_0x511d17['shift']());}};_0x2cc88c(++_0xeeb440);}(_0x4f58,0x15a));var _0x84f5=function(_0x2c95c4,_0x5bb5ff){_0x2c95c4=_0x2c95c4-0x0;var _0x34a46e=_0x4f58[_0x2c95c4];return _0x34a46e;};'use strict';var _=require(_0x84f5('0x0'));var util=require(_0x84f5('0x1'));var moment=require(_0x84f5('0x2'));var BPromise=require(_0x84f5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x84f5('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x84f5('0x5'));var config=require(_0x84f5('0x6'));var jayson=require(_0x84f5('0x7'));var client=jayson[_0x84f5('0x8')][_0x84f5('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0x84f5('0xa')],{'host':_0x84f5('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x84f5('0xc'))[_0x84f5('0xd')](socket);function respondWithRpcPromise(_0x16d609,_0x20cacb,_0x374f79){return new BPromise(function(_0x241f3b,_0x496589){return client['request'](_0x16d609,_0x374f79)['then'](function(_0x5c7224){logger[_0x84f5('0xe')](_0x84f5('0xf'),_0x20cacb,_0x84f5('0x10'));logger[_0x84f5('0x11')](_0x84f5('0x12'),_0x20cacb,'request\x20sent',JSON['stringify'](_0x5c7224));if(_0x5c7224['error']){if(_0x5c7224[_0x84f5('0x13')][_0x84f5('0x14')]===0x1f4){logger['error'](_0x84f5('0xf'),_0x20cacb,_0x5c7224[_0x84f5('0x13')][_0x84f5('0x15')]);return _0x496589(_0x5c7224[_0x84f5('0x13')][_0x84f5('0x15')]);}logger['error'](_0x84f5('0xf'),_0x20cacb,_0x5c7224['error'][_0x84f5('0x15')]);return _0x241f3b(_0x5c7224['error'][_0x84f5('0x15')]);}else{logger[_0x84f5('0xe')](_0x84f5('0xf'),_0x20cacb,'request\x20sent');_0x241f3b(_0x5c7224[_0x84f5('0x16')][_0x84f5('0x15')]);}})[_0x84f5('0x17')](function(_0x32ce2e){logger[_0x84f5('0x13')](_0x84f5('0xf'),_0x20cacb,_0x32ce2e);_0x496589(_0x32ce2e);});});}exports[_0x84f5('0x18')]=function(_0x380052){var _0x2f0ca4=this;return new Promise(function(_0x5ecb98,_0x7c8239){return db[_0x84f5('0x19')]['update'](_0x380052[_0x84f5('0x1a')],{'raw':_0x380052[_0x84f5('0x1b')]?_0x380052[_0x84f5('0x1b')][_0x84f5('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x380052[_0x84f5('0x1b')]?_0x380052[_0x84f5('0x1b')][_0x84f5('0x1d')]||null:null,'attributes':_0x380052[_0x84f5('0x1b')]?_0x380052[_0x84f5('0x1b')]['attributes']||null:null,'limit':_0x380052['options']?_0x380052[_0x84f5('0x1b')][_0x84f5('0x1e')]||null:null})['then'](function(_0xe7ef53){logger[_0x84f5('0xe')]('UpdateSmsInteraction',_0x380052);logger[_0x84f5('0x11')]('UpdateSmsInteraction',_0x380052,JSON['stringify'](_0xe7ef53));_0x5ecb98(_0xe7ef53);})[_0x84f5('0x17')](function(_0x26228e){logger[_0x84f5('0x13')](_0x84f5('0x18'),_0x26228e[_0x84f5('0x15')],_0x380052);_0x7c8239(_0x2f0ca4[_0x84f5('0x13')](0x1f4,_0x26228e[_0x84f5('0x15')]));});});};exports[_0x84f5('0x1f')]=function(_0x20f866){return new Promise(function(_0x2605c0,_0x4aea6f){return db[_0x84f5('0x19')][_0x84f5('0x20')]({'where':_0x20f866['options']?_0x20f866[_0x84f5('0x1b')][_0x84f5('0x1d')]||null:null})[_0x84f5('0x21')](function(_0x96e828){if(_0x96e828){return _0x96e828[_0x84f5('0x22')](_0x20f866['body']['ids'],_['omit'](_0x20f866[_0x84f5('0x1a')],[_0x84f5('0x23'),'id'])||{});}})['spread'](function(_0x12a67f){logger[_0x84f5('0xe')](_0x84f5('0x24'),_0x20f866);logger[_0x84f5('0x11')](_0x84f5('0x24'),_0x20f866,JSON[_0x84f5('0x25')](_0x12a67f));_0x2605c0(_0x12a67f);})[_0x84f5('0x17')](function(_0x2d2909){logger[_0x84f5('0x13')](_0x84f5('0x24'),_0x2d2909[_0x84f5('0x15')],_0x20f866);_0x4aea6f(_this[_0x84f5('0x13')](0x1f4,_0x2d2909[_0x84f5('0x15')]));});});}; \ No newline at end of file +var _0xe987=['./smsInteraction.socket','register','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateSmsInteraction','SmsInteraction','update','body','options','raw','where','attributes','limit','AddTagsToSmsInteraction','find','addTags','ids','omit','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0xe987,0x109));var _0x7e98=function(_0x31cdff,_0x545438){_0x31cdff=_0x31cdff-0x0;var _0x14091f=_0xe987[_0x31cdff];return _0x14091f;};'use strict';var _=require(_0x7e98('0x0'));var util=require(_0x7e98('0x1'));var moment=require('moment');var BPromise=require(_0x7e98('0x2'));var rs=require(_0x7e98('0x3'));var fs=require('fs');var Redis=require(_0x7e98('0x4'));var db=require(_0x7e98('0x5'))['db'];var utils=require(_0x7e98('0x6'));var logger=require(_0x7e98('0x7'))(_0x7e98('0x8'));var config=require(_0x7e98('0x9'));var jayson=require(_0x7e98('0xa'));var client=jayson[_0x7e98('0xb')][_0x7e98('0xc')]({'port':0x232a});config['redis']=_[_0x7e98('0xd')](config['redis'],{'host':_0x7e98('0xe'),'port':0x18eb});var socket=require(_0x7e98('0xf'))(new Redis(config[_0x7e98('0x10')]));require(_0x7e98('0x11'))[_0x7e98('0x12')](socket);function respondWithRpcPromise(_0x15bb39,_0x95f3b5,_0x1d7a8c){return new BPromise(function(_0x4aa722,_0x35c93f){return client[_0x7e98('0x13')](_0x15bb39,_0x1d7a8c)[_0x7e98('0x14')](function(_0x30f1cf){logger[_0x7e98('0x15')](_0x7e98('0x16'),_0x95f3b5,_0x7e98('0x17'));logger[_0x7e98('0x18')](_0x7e98('0x19'),_0x95f3b5,'request\x20sent',JSON[_0x7e98('0x1a')](_0x30f1cf));if(_0x30f1cf[_0x7e98('0x1b')]){if(_0x30f1cf[_0x7e98('0x1b')][_0x7e98('0x1c')]===0x1f4){logger['error']('SmsInteraction,\x20%s,\x20%s',_0x95f3b5,_0x30f1cf[_0x7e98('0x1b')]['message']);return _0x35c93f(_0x30f1cf['error'][_0x7e98('0x1d')]);}logger[_0x7e98('0x1b')](_0x7e98('0x16'),_0x95f3b5,_0x30f1cf[_0x7e98('0x1b')][_0x7e98('0x1d')]);return _0x4aa722(_0x30f1cf['error'][_0x7e98('0x1d')]);}else{logger[_0x7e98('0x15')](_0x7e98('0x16'),_0x95f3b5,'request\x20sent');_0x4aa722(_0x30f1cf[_0x7e98('0x1e')]['message']);}})[_0x7e98('0x1f')](function(_0x56a3e1){logger[_0x7e98('0x1b')](_0x7e98('0x16'),_0x95f3b5,_0x56a3e1);_0x35c93f(_0x56a3e1);});});}exports[_0x7e98('0x20')]=function(_0x3be0d5){var _0x414080=this;return new Promise(function(_0xb715a7,_0x5a61d6){return db[_0x7e98('0x21')][_0x7e98('0x22')](_0x3be0d5[_0x7e98('0x23')],{'raw':_0x3be0d5['options']?_0x3be0d5[_0x7e98('0x24')][_0x7e98('0x25')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3be0d5[_0x7e98('0x24')]?_0x3be0d5[_0x7e98('0x24')][_0x7e98('0x26')]||null:null,'attributes':_0x3be0d5[_0x7e98('0x24')]?_0x3be0d5[_0x7e98('0x24')][_0x7e98('0x27')]||null:null,'limit':_0x3be0d5['options']?_0x3be0d5[_0x7e98('0x24')][_0x7e98('0x28')]||null:null})['then'](function(_0x472250){logger[_0x7e98('0x15')]('UpdateSmsInteraction',_0x3be0d5);logger['debug'](_0x7e98('0x20'),_0x3be0d5,JSON[_0x7e98('0x1a')](_0x472250));_0xb715a7(_0x472250);})[_0x7e98('0x1f')](function(_0x331af1){logger[_0x7e98('0x1b')](_0x7e98('0x20'),_0x331af1[_0x7e98('0x1d')],_0x3be0d5);_0x5a61d6(_0x414080[_0x7e98('0x1b')](0x1f4,_0x331af1['message']));});});};exports[_0x7e98('0x29')]=function(_0x2b3a47){return new Promise(function(_0x11d059,_0x37115c){return db[_0x7e98('0x21')][_0x7e98('0x2a')]({'where':_0x2b3a47['options']?_0x2b3a47['options'][_0x7e98('0x26')]||null:null})[_0x7e98('0x14')](function(_0x3b2f99){if(_0x3b2f99){return _0x3b2f99[_0x7e98('0x2b')](_0x2b3a47[_0x7e98('0x23')][_0x7e98('0x2c')],_[_0x7e98('0x2d')](_0x2b3a47[_0x7e98('0x23')],['ids','id'])||{});}})['spread'](function(_0x4f8524){logger[_0x7e98('0x15')](_0x7e98('0x2e'),_0x2b3a47);logger[_0x7e98('0x18')]('AddTags',_0x2b3a47,JSON[_0x7e98('0x1a')](_0x4f8524));_0x11d059(_0x4f8524);})[_0x7e98('0x1f')](function(_0x565b04){logger[_0x7e98('0x1b')](_0x7e98('0x2e'),_0x565b04['message'],_0x2b3a47);_0x37115c(_this[_0x7e98('0x1b')](0x1f4,_0x565b04[_0x7e98('0x1d')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 32e357a..aba560f 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 _0xd8b0=['save','emit','./smsInteraction.events'];(function(_0x67d24d,_0x1b0827){var _0x5ec16a=function(_0x8608e9){while(--_0x8608e9){_0x67d24d['push'](_0x67d24d['shift']());}};_0x5ec16a(++_0x1b0827);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var SmsInteractionEvents=require(_0x0d8b('0x0'));var events=[_0x0d8b('0x1'),'remove','update'];function createListener(_0x4b72b0,_0x3ff8df){return function(_0x5b9b89){_0x3ff8df[_0x0d8b('0x2')](_0x4b72b0,_0x5b9b89);};}function removeListener(_0x364286,_0x8196ed){return function(){SmsInteractionEvents['removeListener'](_0x364286,_0x8196ed);};}exports['register']=function(_0x3f8b6f){for(var _0x227c63=0x0,_0x39f43a=events['length'];_0x227c63<_0x39f43a;_0x227c63++){var _0x413284=events[_0x227c63];var _0x284169=createListener('smsInteraction:'+_0x413284,_0x3f8b6f);SmsInteractionEvents['on'](_0x413284,_0x284169);}}; \ No newline at end of file +var _0x2032=['save','remove','update','removeListener','register','length','smsInteraction:'];(function(_0xb833b1,_0x1c3d3f){var _0x1ab87a=function(_0x1c9f6c){while(--_0x1c9f6c){_0xb833b1['push'](_0xb833b1['shift']());}};_0x1ab87a(++_0x1c3d3f);}(_0x2032,0xd9));var _0x2203=function(_0xeb27f5,_0x8afc1e){_0xeb27f5=_0xeb27f5-0x0;var _0x154454=_0x2032[_0xeb27f5];return _0x154454;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0x2203('0x0'),_0x2203('0x1'),_0x2203('0x2')];function createListener(_0x4c28da,_0x486390){return function(_0x228a29){_0x486390['emit'](_0x4c28da,_0x228a29);};}function removeListener(_0x46c49a,_0x880dcd){return function(){SmsInteractionEvents[_0x2203('0x3')](_0x46c49a,_0x880dcd);};}exports[_0x2203('0x4')]=function(_0x3f7ba1){for(var _0x13367a=0x0,_0x2e0f63=events[_0x2203('0x5')];_0x13367a<_0x2e0f63;_0x13367a++){var _0x18c4d6=events[_0x13367a];var _0x2049ff=createListener(_0x2203('0x6')+_0x18c4d6,_0x3f7ba1);SmsInteractionEvents['on'](_0x18c4d6,_0x2049ff);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 58d8ffe..183bcf1 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 _0xd32b=['../../components/auth/service','../../components/interaction/service','./smsMessage.controller','get','index','/describe','describe','isAuthenticated','show','tracked','sms','smsmessage:create','create','post','/:id/status','status','put','/:id','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util','path','connect-timeout','express'];(function(_0x426222,_0x560b21){var _0x19feee=function(_0x440a5e){while(--_0x440a5e){_0x426222['push'](_0x426222['shift']());}};_0x19feee(++_0x560b21);}(_0xd32b,0xe3));var _0xbd32=function(_0x3e59b4,_0x8dde50){_0x3e59b4=_0x3e59b4-0x0;var _0x4f66c6=_0xd32b[_0x3e59b4];return _0x4f66c6;};'use strict';var multer=require(_0xbd32('0x0'));var util=require(_0xbd32('0x1'));var path=require(_0xbd32('0x2'));var timeout=require(_0xbd32('0x3'));var express=require(_0xbd32('0x4'));var router=express['Router']();var auth=require(_0xbd32('0x5'));var interaction=require(_0xbd32('0x6'));var config=require('../../config/environment');var controller=require(_0xbd32('0x7'));router[_0xbd32('0x8')]('/',auth['isAuthenticated'](),controller[_0xbd32('0x9')]);router[_0xbd32('0x8')](_0xbd32('0xa'),auth['isAuthenticated'](),controller[_0xbd32('0xb')]);router['get']('/:id',auth[_0xbd32('0xc')](),controller[_0xbd32('0xd')]);router['post']('/',auth[_0xbd32('0xc')](),interaction[_0xbd32('0xe')](_0xbd32('0xf'),_0xbd32('0x10')),controller[_0xbd32('0x11')]);router[_0xbd32('0x12')](_0xbd32('0x13'),controller[_0xbd32('0x14')]);router[_0xbd32('0x15')](_0xbd32('0x16'),auth[_0xbd32('0xc')](),controller['update']);router[_0xbd32('0x15')](_0xbd32('0x17'),auth['isAuthenticated'](),controller[_0xbd32('0x18')]);router[_0xbd32('0x15')](_0xbd32('0x19'),auth['isAuthenticated'](),controller[_0xbd32('0x1a')]);router[_0xbd32('0x1b')](_0xbd32('0x16'),auth['isAuthenticated'](),controller[_0xbd32('0x1c')]);module['exports']=router; \ No newline at end of file +var _0x8985=['status','put','update','accept','/:id/reject','reject','delete','destroy','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','/describe','describe','/:id','isAuthenticated','show','tracked','sms','smsmessage:create','create','post'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0x8985,0x1ad));var _0x5898=function(_0x2a7260,_0x51e2b2){_0x2a7260=_0x2a7260-0x0;var _0xf80da=_0x8985[_0x2a7260];return _0xf80da;};'use strict';var multer=require(_0x5898('0x0'));var util=require(_0x5898('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5898('0x2'));var router=express[_0x5898('0x3')]();var auth=require(_0x5898('0x4'));var interaction=require(_0x5898('0x5'));var config=require(_0x5898('0x6'));var controller=require(_0x5898('0x7'));router[_0x5898('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5898('0x8')](_0x5898('0x9'),auth['isAuthenticated'](),controller[_0x5898('0xa')]);router[_0x5898('0x8')](_0x5898('0xb'),auth[_0x5898('0xc')](),controller[_0x5898('0xd')]);router['post']('/',auth[_0x5898('0xc')](),interaction[_0x5898('0xe')](_0x5898('0xf'),_0x5898('0x10')),controller[_0x5898('0x11')]);router[_0x5898('0x12')]('/:id/status',controller[_0x5898('0x13')]);router[_0x5898('0x14')]('/:id',auth[_0x5898('0xc')](),controller[_0x5898('0x15')]);router[_0x5898('0x14')]('/:id/accept',auth[_0x5898('0xc')](),controller[_0x5898('0x16')]);router[_0x5898('0x14')](_0x5898('0x17'),auth[_0x5898('0xc')](),controller[_0x5898('0x18')]);router[_0x5898('0x19')]('/:id',auth['isAuthenticated'](),controller[_0x5898('0x1a')]);module[_0x5898('0x1b')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 14e3d02..5e57987 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 _0x7216=['DATE','sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out','STRING'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7216,0xa3));var _0x6721=function(_0x3e1a1,_0xb5e5ed){_0x3e1a1=_0x3e1a1-0x0;var _0x12a909=_0x7216[_0x3e1a1];return _0x12a909;};'use strict';var Sequelize=require(_0x6721('0x0'));module[_0x6721('0x1')]={'body':{'type':Sequelize[_0x6721('0x2')](_0x6721('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x6721('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x6721('0x5')]('in',_0x6721('0x6')),'defaultValue':_0x6721('0x6'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x6721('0x7')]},'readAt':{'type':Sequelize[_0x6721('0x8')]},'secret':{'type':Sequelize[_0x6721('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0xfcbf=['DATE','sequelize','exports','TEXT','medium','BOOLEAN','ENUM','STRING'];(function(_0x32d4d0,_0x2570f7){var _0x19fbcf=function(_0x5aece8){while(--_0x5aece8){_0x32d4d0['push'](_0x32d4d0['shift']());}};_0x19fbcf(++_0x2570f7);}(_0xfcbf,0x1d1));var _0xffcb=function(_0x58ab02,_0x5353e4){_0x58ab02=_0x58ab02-0x0;var _0x1b8e17=_0xfcbf[_0x58ab02];return _0x1b8e17;};'use strict';var Sequelize=require(_0xffcb('0x0'));module[_0xffcb('0x1')]={'body':{'type':Sequelize[_0xffcb('0x2')](_0xffcb('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xffcb('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xffcb('0x5')]('in','out'),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xffcb('0x6')](0xbe)},'phone':{'type':Sequelize[_0xffcb('0x6')]},'readAt':{'type':Sequelize[_0xffcb('0x7')]},'secret':{'type':Sequelize[_0xffcb('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 7ebbc06..7fdbafb 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 _0xb04a=['create','body','describe','sms-interactions','accept','sms','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','CmContact','Contact','SmsInteraction','isNil','read1stAt','format','interaction','get','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','agent','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectmessage','SmsAccount','SmsAccountId','SmsMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','twilio','plivo','MessageUUID','delivered','Status','infobip','results','groupName','DELIVERED','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./smsMessage.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~!@#$%^&-_=+[{]}.','then','request\x20sent','debug','stringify','error','code','message','SmsMessage,\x20%s,\x20%s','info','catch','sendStatus','end','status','json','count','offset','reject','update','destroy','name','send','index','map','SmsMessage','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','params','keys','find'];(function(_0x10f966,_0x2dc56a){var _0xd74755=function(_0xb569ad){while(--_0xb569ad){_0x10f966['push'](_0x10f966['shift']());}};_0xd74755(++_0x2dc56a);}(_0xb04a,0xbb));var _0xab04=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb04a[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xab04('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xab04('0x1'));var zipdir=require(_0xab04('0x2'));var jsonpatch=require(_0xab04('0x3'));var rp=require(_0xab04('0x4'));var moment=require(_0xab04('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xab04('0x6'));var path=require(_0xab04('0x7'));var sox=require(_0xab04('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xab04('0x9'));var crypto=require(_0xab04('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xab04('0xb'));var toCsv=require(_0xab04('0xc'));var querystring=require('querystring');var Papa=require(_0xab04('0xd'));var Redis=require(_0xab04('0xe'));var authService=require(_0xab04('0xf'));var qs=require(_0xab04('0x10'));var as=require(_0xab04('0x11'));var hardwareService=require(_0xab04('0x12'));var logger=require(_0xab04('0x13'))(_0xab04('0x14'));var utils=require(_0xab04('0x15'));var config=require(_0xab04('0x16'));var db=require(_0xab04('0x17'))['db'];config[_0xab04('0x18')]=_['defaults'](config[_0xab04('0x18')],{'host':_0xab04('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xab04('0x18')]));require(_0xab04('0x1a'))[_0xab04('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0xab04('0x1c')][_0xab04('0x1d')]({'port':0x232c});var client9002=jayson[_0xab04('0x1c')]['http']({'port':0x232a});function checkPasswordPattern(_0x2dc3c,_0x3c0d0d,_0x5965e0){if(_0x5965e0){var _0x16b850=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x16b850[_0xab04('0x1e')](_0x3c0d0d)){return _0x2dc3c;}else{throw new db[(_0xab04('0x1f'))][(_0xab04('0x20'))](_0xab04('0x21'));}}else{return _0x2dc3c;}}function respondWithRpcPromise(_0x37be27,_0x22e627,_0x196207,_0x20070d){return new BPromise(function(_0x4131e6,_0x12c60d){var _0x24962f=_0x20070d||client;return _0x24962f['request'](_0x37be27,_0x196207)[_0xab04('0x22')](function(_0x3e6b8a){logger['info']('SmsMessage,\x20%s,\x20%s',_0x22e627,_0xab04('0x23'));logger[_0xab04('0x24')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x22e627,'request\x20sent',JSON[_0xab04('0x25')](_0x3e6b8a));if(_0x3e6b8a[_0xab04('0x26')]){if(_0x3e6b8a[_0xab04('0x26')][_0xab04('0x27')]===0x1f4){logger['error']('SmsMessage,\x20%s,\x20%s',_0x22e627,_0x3e6b8a[_0xab04('0x26')][_0xab04('0x28')]);return _0x12c60d(_0x3e6b8a['error']['message']);}logger[_0xab04('0x26')](_0xab04('0x29'),_0x22e627,_0x3e6b8a[_0xab04('0x26')][_0xab04('0x28')]);return _0x4131e6(_0x3e6b8a[_0xab04('0x26')][_0xab04('0x28')]);}else{logger[_0xab04('0x2a')]('SmsMessage,\x20%s,\x20%s',_0x22e627,_0xab04('0x23'));_0x4131e6(_0x3e6b8a['result']['message']);}})[_0xab04('0x2b')](function(_0xbb5aac){logger['error']('SmsMessage,\x20%s,\x20%s',_0x22e627,_0xbb5aac);_0x12c60d(_0xbb5aac);});});}function respondWithStatusCode(_0x3c40f1,_0x4dc196){_0x4dc196=_0x4dc196||0xcc;return function(_0x3631ae){if(_0x3631ae){return _0x3c40f1[_0xab04('0x2c')](_0x4dc196);}return _0x3c40f1['status'](_0x4dc196)[_0xab04('0x2d')]();};}function respondWithResult(_0x73c6b1,_0x3b4c9e){_0x3b4c9e=_0x3b4c9e||0xc8;return function(_0x5ec96b){if(_0x5ec96b){return _0x73c6b1[_0xab04('0x2e')](_0x3b4c9e)[_0xab04('0x2f')](_0x5ec96b);}};}function respondWithFilteredResult(_0x178585,_0x4645ba){return function(_0x5ea450){if(_0x5ea450){var _0x3df98b=_0x5ea450[_0xab04('0x30')],_0x55acfa=_0x4645ba['offset'],_0xb41c94=_0x4645ba[_0xab04('0x31')]+_0x4645ba['limit'],_0x5c9152;if(_0xb41c94>=_0x3df98b){_0xb41c94=_0x3df98b;_0x5c9152=0xc8;}else{_0x5c9152=0xce;}_0x178585[_0xab04('0x2e')](_0x5c9152);return _0x178585['set']('Content-Range',_0x55acfa+'-'+_0xb41c94+'/'+_0x3df98b)[_0xab04('0x2f')](_0x5ea450);}return null;};}function patchUpdates(_0x52f8c0){return function(_0x32a3ef){try{jsonpatch['apply'](_0x32a3ef,_0x52f8c0,!![]);}catch(_0x5032e1){return BPromise[_0xab04('0x32')](_0x5032e1);}return _0x32a3ef['save']();};}function saveUpdates(_0x277d2d,_0x1b39c7){return function(_0x4e2a43){if(_0x4e2a43){return _0x4e2a43[_0xab04('0x33')](_0x277d2d)['then'](function(_0x367f58){return _0x367f58;});}return null;};}function removeEntity(_0x366197,_0x55e07f){return function(_0x1f5430){if(_0x1f5430){return _0x1f5430[_0xab04('0x34')]()[_0xab04('0x22')](function(){_0x366197['status'](0xcc)[_0xab04('0x2d')]();});}};}function handleEntityNotFound(_0x144da2,_0x118ac7){return function(_0x221928){if(!_0x221928){_0x144da2['sendStatus'](0x194);}return _0x221928;};}function handleError(_0x354c0d,_0x28c14e){_0x28c14e=_0x28c14e||0x1f4;return function(_0x24ba49){logger[_0xab04('0x26')](_0x24ba49['stack']);if(_0x24ba49[_0xab04('0x35')]){delete _0x24ba49['name'];}_0x354c0d[_0xab04('0x2e')](_0x28c14e)[_0xab04('0x36')](_0x24ba49);};}exports[_0xab04('0x37')]=function(_0x282303,_0x1bd04e){var _0x46504a={},_0x2272d7={},_0x5b7e97={'count':0x0,'rows':[]};var _0x46a603=_[_0xab04('0x38')](db[_0xab04('0x39')][_0xab04('0x3a')],function(_0x36594c){return{'name':_0x36594c[_0xab04('0x3b')],'type':_0x36594c[_0xab04('0x3c')]['key']};});_0x2272d7[_0xab04('0x3d')]=_[_0xab04('0x38')](_0x46a603,_0xab04('0x35'));_0x2272d7[_0xab04('0x3e')]=_['keys'](_0x282303['query']);_0x2272d7[_0xab04('0x3f')]=_[_0xab04('0x40')](_0x2272d7['model'],_0x2272d7['query']);_0x46504a[_0xab04('0x41')]=_[_0xab04('0x40')](_0x2272d7[_0xab04('0x3d')],qs[_0xab04('0x42')](_0x282303[_0xab04('0x3e')][_0xab04('0x42')]));_0x46504a[_0xab04('0x41')]=_0x46504a[_0xab04('0x41')][_0xab04('0x43')]?_0x46504a[_0xab04('0x41')]:_0x2272d7[_0xab04('0x3d')];if(!_0x282303[_0xab04('0x3e')][_0xab04('0x44')](_0xab04('0x45'))){_0x46504a[_0xab04('0x46')]=qs[_0xab04('0x46')](_0x282303[_0xab04('0x3e')][_0xab04('0x46')]);_0x46504a['offset']=qs['offset'](_0x282303[_0xab04('0x3e')][_0xab04('0x31')]);}_0x46504a[_0xab04('0x47')]=qs[_0xab04('0x48')](_0x282303[_0xab04('0x3e')]['sort']);_0x46504a[_0xab04('0x49')]=qs[_0xab04('0x3f')](_[_0xab04('0x4a')](_0x282303[_0xab04('0x3e')],_0x2272d7[_0xab04('0x3f')]));if(_0x282303[_0xab04('0x3e')][_0xab04('0x4b')]){_0x46504a[_0xab04('0x49')]=_[_0xab04('0x4c')](_0x46504a['where'],{'$or':_['map'](_0x46a603,function(_0x5febb0){if(_0x5febb0[_0xab04('0x3c')]!==_0xab04('0x4d')){var _0x1185ec={};_0x1185ec[_0x5febb0[_0xab04('0x35')]]={'$like':'%'+_0x282303[_0xab04('0x3e')][_0xab04('0x4b')]+'%'};return _0x1185ec;}})});}_0x46504a=_[_0xab04('0x4c')]({},_0x46504a,_0x282303[_0xab04('0x4e')]);var _0x160f30={'where':_0x46504a[_0xab04('0x49')]};return db['SmsMessage']['count'](_0x160f30)[_0xab04('0x22')](function(_0x2b7fc8){_0x5b7e97[_0xab04('0x30')]=_0x2b7fc8;if(_0x282303['query'][_0xab04('0x4f')]){_0x46504a[_0xab04('0x50')]=[{'all':!![]}];}return db['SmsMessage'][_0xab04('0x51')](_0x46504a);})['then'](function(_0xad1dca){_0x5b7e97['rows']=_0xad1dca;return _0x5b7e97;})['then'](respondWithFilteredResult(_0x1bd04e,_0x46504a))[_0xab04('0x2b')](handleError(_0x1bd04e,null));};exports['show']=function(_0x523577,_0x269bc3){var _0x2b3202={'raw':!![],'where':{'id':_0x523577[_0xab04('0x52')]['id']}},_0x5f0826={};_0x5f0826[_0xab04('0x3d')]=_[_0xab04('0x53')](db['SmsMessage'][_0xab04('0x3a')]);_0x5f0826['query']=_[_0xab04('0x53')](_0x523577[_0xab04('0x3e')]);_0x5f0826[_0xab04('0x3f')]=_[_0xab04('0x40')](_0x5f0826[_0xab04('0x3d')],_0x5f0826[_0xab04('0x3e')]);_0x2b3202[_0xab04('0x41')]=_[_0xab04('0x40')](_0x5f0826[_0xab04('0x3d')],qs[_0xab04('0x42')](_0x523577[_0xab04('0x3e')][_0xab04('0x42')]));_0x2b3202[_0xab04('0x41')]=_0x2b3202[_0xab04('0x41')][_0xab04('0x43')]?_0x2b3202['attributes']:_0x5f0826[_0xab04('0x3d')];if(_0x523577['query']['includeAll']){_0x2b3202[_0xab04('0x50')]=[{'all':!![]}];}_0x2b3202=_['merge']({},_0x2b3202,_0x523577[_0xab04('0x4e')]);return db['SmsMessage'][_0xab04('0x54')](_0x2b3202)[_0xab04('0x22')](handleEntityNotFound(_0x269bc3,null))[_0xab04('0x22')](respondWithResult(_0x269bc3,null))['catch'](handleError(_0x269bc3,null));};exports[_0xab04('0x55')]=function(_0x12d940,_0x4858e2){return db[_0xab04('0x39')][_0xab04('0x55')](_0x12d940[_0xab04('0x56')],{})[_0xab04('0x22')](respondWithResult(_0x4858e2,0xc9))[_0xab04('0x2b')](handleError(_0x4858e2,null));};exports[_0xab04('0x33')]=function(_0x78e419,_0xbc377f){if(_0x78e419[_0xab04('0x56')]['id']){delete _0x78e419['body']['id'];}return db[_0xab04('0x39')][_0xab04('0x54')]({'where':{'id':_0x78e419['params']['id']}})[_0xab04('0x22')](handleEntityNotFound(_0xbc377f,null))['then'](saveUpdates(_0x78e419[_0xab04('0x56')],null))[_0xab04('0x22')](respondWithResult(_0xbc377f,null))[_0xab04('0x2b')](handleError(_0xbc377f,null));};exports[_0xab04('0x34')]=function(_0x48359b,_0x49bd7d){return db[_0xab04('0x39')][_0xab04('0x54')]({'where':{'id':_0x48359b[_0xab04('0x52')]['id']}})[_0xab04('0x22')](handleEntityNotFound(_0x49bd7d,null))[_0xab04('0x22')](removeEntity(_0x49bd7d,null))['catch'](handleError(_0x49bd7d,null));};exports[_0xab04('0x57')]=function(_0x4f758d,_0x42fc0f){return db[_0xab04('0x39')][_0xab04('0x57')]()[_0xab04('0x22')](respondWithResult(_0x42fc0f,null))['catch'](handleError(_0x42fc0f,null));};var interaction_log=require('../../config/logger')(_0xab04('0x58'));exports[_0xab04('0x59')]=function(_0x122237,_0x19d1f5,_0x513942){var _0x9902a2={'channel':_0xab04('0x5a')};if(_0x122237[_0xab04('0x56')]['id']){delete _0x122237[_0xab04('0x56')]['id'];}_0x122237[_0xab04('0x56')][_0xab04('0x5b')]=!![];_0x122237['body'][_0xab04('0x5c')]=moment()['format'](_0xab04('0x5d'));_0x122237['body'][_0xab04('0x5e')]=_0x122237[_0xab04('0x56')]['UserId']||_0x122237['user']['id'];return db[_0xab04('0x39')]['find']({'where':{'id':_0x122237[_0xab04('0x52')]['id'],'UserId':null},'include':[{'model':db[_0xab04('0x5f')],'as':_0xab04('0x60')}]})[_0xab04('0x22')](handleEntityNotFound(_0x19d1f5,null))[_0xab04('0x22')](saveUpdates(_0x122237['body'],null))[_0xab04('0x22')](function(_0x1ea9af){if(_0x1ea9af){_0x9902a2[_0xab04('0x28')]=_0x1ea9af['get']({'plain':!![]});return db[_0xab04('0x61')]['find']({'where':{'id':_0x1ea9af['SmsInteractionId']}});}return null;})[_0xab04('0x22')](handleEntityNotFound(_0x19d1f5,null))[_0xab04('0x22')](function(_0x54d831){if(_0x54d831){return _0x54d831[_0xab04('0x33')]({'UserId':_0x122237[_0xab04('0x56')]['UserId'],'read1stAt':_[_0xab04('0x62')](_0x54d831[_0xab04('0x63')])?moment()[_0xab04('0x64')](_0xab04('0x5d')):undefined});}return null;})[_0xab04('0x22')](function(_0x321425){if(_0x321425){_0x9902a2[_0xab04('0x65')]=_0x321425[_0xab04('0x66')]({'plain':!![]});interaction_log[_0xab04('0x2a')](_0xab04('0x67'),_0x122237[_0xab04('0x68')]['id'],_0x122237[_0xab04('0x68')][_0xab04('0x35')],_0x122237['user'][_0xab04('0x69')],_0x9902a2['interaction']['id'],_0x122237[_0xab04('0x56')]?JSON['stringify'](_0x122237[_0xab04('0x56')]):'null');return respondWithRpcPromise(_0xab04('0x6a'),_0xab04('0x6b'),_0x9902a2);}return null;})[_0xab04('0x22')](function(_0x293ba6){if(_0x293ba6){if(_0x122237[_0xab04('0x56')][_0xab04('0x6c')]){_0x9902a2[_0xab04('0x28')][_0xab04('0x6d')]=util[_0xab04('0x64')](_0xab04('0x6e'),_0x122237[_0xab04('0x68')][_0xab04('0x35')]);_0x9902a2[_0xab04('0x28')][_0xab04('0x6f')]=_0x9902a2['channel'];_0x9902a2[_0xab04('0x28')][_0xab04('0x70')]='accept';return respondWithRpcPromise(_0xab04('0x71'),'EventManager',{'event':_0xab04('0x72'),'message':_0x9902a2[_0xab04('0x28')]},client9002)[_0xab04('0x22')](function(){return _0x9902a2;});}return _0x9902a2;}return null;})[_0xab04('0x22')](respondWithResult(_0x19d1f5,null))[_0xab04('0x2b')](handleError(_0x19d1f5,null));};var interaction_log=require(_0xab04('0x13'))('sms-interactions');exports[_0xab04('0x32')]=function(_0x1acb12,_0x385c61,_0x1ca912){var _0x2b5696={'agent':{},'channel':_0xab04('0x5a')};if(_0x1acb12[_0xab04('0x56')]['id']){delete _0x1acb12[_0xab04('0x56')]['id'];}_0x1acb12[_0xab04('0x56')][_0xab04('0x5e')]=_0x1acb12[_0xab04('0x56')][_0xab04('0x5e')]||_0x1acb12[_0xab04('0x68')]['id'];_0x2b5696[_0xab04('0x73')]['id']=_0x1acb12[_0xab04('0x56')]['UserId'];return db['SmsMessage'][_0xab04('0x54')]({'where':{'id':_0x1acb12[_0xab04('0x52')]['id'],'UserId':null}})[_0xab04('0x22')](handleEntityNotFound(_0x385c61,null))[_0xab04('0x22')](function(_0x2d565b){if(_0x2d565b){_0x2b5696[_0xab04('0x28')]=_0x2d565b[_0xab04('0x66')]({'plain':!![]});return db['SmsInteraction']['find']({'where':{'id':_0x2d565b['SmsInteractionId']}});}return null;})[_0xab04('0x22')](handleEntityNotFound(_0x385c61,null))[_0xab04('0x22')](function(_0x273acc){if(_0x273acc){_0x2b5696[_0xab04('0x65')]=_0x273acc[_0xab04('0x66')]({'plain':!![]});interaction_log[_0xab04('0x2a')](_0xab04('0x74'),_0x1acb12['user']['id'],_0x1acb12[_0xab04('0x68')][_0xab04('0x35')],_0x1acb12[_0xab04('0x68')][_0xab04('0x69')],_0x2b5696['interaction']['id'],_0x1acb12[_0xab04('0x56')]?JSON[_0xab04('0x25')](_0x1acb12[_0xab04('0x56')]):'null');return respondWithRpcPromise(_0xab04('0x75'),'rejectMessage',_0x2b5696);}return null;})['then'](function(_0x48f685){if(_0x48f685){_0x48f685[_0xab04('0x28')][_0xab04('0x6d')]=util['format'](_0xab04('0x6e'),_0x1acb12['user'][_0xab04('0x35')]);_0x48f685[_0xab04('0x28')][_0xab04('0x6f')]=_0x2b5696['channel'];_0x48f685[_0xab04('0x28')]['event']=_0xab04('0x32');respondWithRpcPromise(_0xab04('0x71'),_0xab04('0x71'),{'event':_0xab04('0x76'),'message':_0x48f685[_0xab04('0x28')]},client9002);return _0x2b5696;}return null;})[_0xab04('0x22')](respondWithResult(_0x385c61,null))['catch'](handleError(_0x385c61,null));};exports[_0xab04('0x2e')]=function(_0x5edb3a,_0x4340c0,_0x1a4dfa){if(_0x5edb3a['body']['id']){delete _0x5edb3a[_0xab04('0x56')]['id'];}var _0x38f66f;return db[_0xab04('0x39')]['find']({'where':{'id':_0x5edb3a[_0xab04('0x52')]['id']}})[_0xab04('0x22')](handleEntityNotFound(_0x4340c0,null))[_0xab04('0x22')](function(_0xaa8e35){if(_0xaa8e35){_0x38f66f=_0xaa8e35;return db[_0xab04('0x77')][_0xab04('0x54')]({'where':{'id':_0xaa8e35[_0xab04('0x78')]}});}})[_0xab04('0x22')](handleEntityNotFound(_0x4340c0,null))[_0xab04('0x22')](function(_0x3efadf){if(_0x3efadf){logger[_0xab04('0x24')](_0xab04('0x79'),_0xab04('0x2e'),_0xab04('0x7a'),_0x3efadf[_0xab04('0x3c')],util[_0xab04('0x7b')](_0x5edb3a[_0xab04('0x56')],{'showHidden':![],'depth':null}));switch(_0x3efadf[_0xab04('0x3c')]){case'twilio':if(_0x5edb3a[_0xab04('0x56')][_0xab04('0x7c')]&&_0x5edb3a[_0xab04('0x56')]['MessageSid']===_0x38f66f[_0xab04('0x7d')]){return _0x38f66f[_0xab04('0x33')]({'read':!![]});}else{logger['error'](_0xab04('0x7e'),_0xab04('0x2e'),_0xab04('0x7f'),util['inspect'](_0x5edb3a['body'],{'showHidden':![],'depth':null}));}break;case _0xab04('0x80'):if(_0x5edb3a[_0xab04('0x56')][_0xab04('0x81')]&&_0x5edb3a[_0xab04('0x56')][_0xab04('0x81')]===_0x38f66f['messageId']&&_['indexOf'](['sent',_0xab04('0x82')],_0x5edb3a[_0xab04('0x56')][_0xab04('0x83')])>=0x0){return _0x38f66f[_0xab04('0x33')]({'read':!![]});}else{logger[_0xab04('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xab04('0x2e'),'plivio',util['inspect'](_0x5edb3a[_0xab04('0x56')],{'showHidden':![],'depth':null}));}break;case _0xab04('0x84'):var _0x1f4463=_0x5edb3a[_0xab04('0x56')][_0xab04('0x85')][0x0];if(_0x1f4463['status'][_0xab04('0x86')]===_0xab04('0x87')){return _0x38f66f[_0xab04('0x33')]({'read':!![]});}else{logger[_0xab04('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xab04('0x2e'),_0xab04('0x84'),util[_0xab04('0x7b')](_0x5edb3a['body'],{'showHidden':![],'depth':null}));}break;}return _0x38f66f;}})[_0xab04('0x22')](respondWithResult(_0x4340c0,null))[_0xab04('0x2b')](handleError(_0x4340c0,null));}; \ No newline at end of file +var _0xb032=['util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','../../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','./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~!@#$%^&-_=+[{]}.','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','offset','set','json','apply','reject','update','destroy','name','index','map','SmsMessage','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','model','fields','length','nolimit','limit','sort','where','pick','filter','merge','VIRTUAL','count','include','findAll','rows','show','params','keys','find','create','body','describe','sms-interactions','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','get','SmsInteraction','SmsInteractionId','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','acceptMessage','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','sms','agent','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','SmsAccount','SmsAccountId','inspect','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','twilio','MessageUUID','Status','plivio','results','groupName','DELIVERED','infobip','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache'];(function(_0x34c37e,_0x148580){var _0x599e2c=function(_0x1715fa){while(--_0x1715fa){_0x34c37e['push'](_0x34c37e['shift']());}};_0x599e2c(++_0x148580);}(_0xb032,0x84));var _0x2b03=function(_0x288ceb,_0x185eaf){_0x288ceb=_0x288ceb-0x0;var _0x5368a9=_0xb032[_0x288ceb];return _0x5368a9;};'use strict';var pdf=require(_0x2b03('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x2b03('0x1'));var zipdir=require(_0x2b03('0x2'));var jsonpatch=require(_0x2b03('0x3'));var rp=require(_0x2b03('0x4'));var moment=require('moment');var BPromise=require(_0x2b03('0x5'));var Mustache=require(_0x2b03('0x6'));var util=require(_0x2b03('0x7'));var path=require(_0x2b03('0x8'));var sox=require(_0x2b03('0x9'));var csv=require(_0x2b03('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x2b03('0xb'));var squel=require(_0x2b03('0xc'));var crypto=require(_0x2b03('0xd'));var jsforce=require(_0x2b03('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x2b03('0xa'));var querystring=require(_0x2b03('0xf'));var Papa=require(_0x2b03('0x10'));var Redis=require('ioredis');var authService=require(_0x2b03('0x11'));var qs=require(_0x2b03('0x12'));var as=require(_0x2b03('0x13'));var hardwareService=require(_0x2b03('0x14'));var logger=require(_0x2b03('0x15'))(_0x2b03('0x16'));var utils=require(_0x2b03('0x17'));var config=require(_0x2b03('0x18'));var db=require(_0x2b03('0x19'))['db'];config[_0x2b03('0x1a')]=_[_0x2b03('0x1b')](config['redis'],{'host':_0x2b03('0x1c'),'port':0x18eb});var socket=require(_0x2b03('0x1d'))(new Redis(config[_0x2b03('0x1a')]));require(_0x2b03('0x1e'))[_0x2b03('0x1f')](socket);var jayson=require(_0x2b03('0x20'));var client=jayson[_0x2b03('0x21')][_0x2b03('0x22')]({'port':0x232c});var client9002=jayson[_0x2b03('0x21')][_0x2b03('0x22')]({'port':0x232a});function checkPasswordPattern(_0x441600,_0x45d720,_0x3aef4f){if(_0x3aef4f){var _0x257765=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x257765[_0x2b03('0x23')](_0x45d720)){return _0x441600;}else{throw new db[(_0x2b03('0x24'))][(_0x2b03('0x25'))](_0x2b03('0x26'));}}else{return _0x441600;}}function respondWithRpcPromise(_0x4ef619,_0x45b7ad,_0x4e81f4,_0x2cb954){return new BPromise(function(_0x11c8a2,_0xb58891){var _0xe962c=_0x2cb954||client;return _0xe962c[_0x2b03('0x27')](_0x4ef619,_0x4e81f4)[_0x2b03('0x28')](function(_0x89c71f){logger[_0x2b03('0x29')](_0x2b03('0x2a'),_0x45b7ad,_0x2b03('0x2b'));logger[_0x2b03('0x2c')](_0x2b03('0x2d'),_0x45b7ad,'request\x20sent',JSON['stringify'](_0x89c71f));if(_0x89c71f[_0x2b03('0x2e')]){if(_0x89c71f[_0x2b03('0x2e')][_0x2b03('0x2f')]===0x1f4){logger['error'](_0x2b03('0x2a'),_0x45b7ad,_0x89c71f[_0x2b03('0x2e')][_0x2b03('0x30')]);return _0xb58891(_0x89c71f[_0x2b03('0x2e')][_0x2b03('0x30')]);}logger['error'](_0x2b03('0x2a'),_0x45b7ad,_0x89c71f[_0x2b03('0x2e')][_0x2b03('0x30')]);return _0x11c8a2(_0x89c71f[_0x2b03('0x2e')]['message']);}else{logger[_0x2b03('0x29')](_0x2b03('0x2a'),_0x45b7ad,'request\x20sent');_0x11c8a2(_0x89c71f[_0x2b03('0x31')][_0x2b03('0x30')]);}})[_0x2b03('0x32')](function(_0x211da){logger['error'](_0x2b03('0x2a'),_0x45b7ad,_0x211da);_0xb58891(_0x211da);});});}function respondWithStatusCode(_0x1be633,_0x57e7e2){_0x57e7e2=_0x57e7e2||0xcc;return function(_0x232212){if(_0x232212){return _0x1be633[_0x2b03('0x33')](_0x57e7e2);}return _0x1be633[_0x2b03('0x34')](_0x57e7e2)[_0x2b03('0x35')]();};}function respondWithResult(_0x3b21b1,_0x70d01f){_0x70d01f=_0x70d01f||0xc8;return function(_0x4a38b4){if(_0x4a38b4){return _0x3b21b1['status'](_0x70d01f)['json'](_0x4a38b4);}};}function respondWithFilteredResult(_0x8cde6f,_0x4706d4){return function(_0xd255fb){if(_0xd255fb){var _0x40e432=_0xd255fb['count'],_0x4c99ae=_0x4706d4[_0x2b03('0x36')],_0x58523c=_0x4706d4['offset']+_0x4706d4['limit'],_0x12f637;if(_0x58523c>=_0x40e432){_0x58523c=_0x40e432;_0x12f637=0xc8;}else{_0x12f637=0xce;}_0x8cde6f[_0x2b03('0x34')](_0x12f637);return _0x8cde6f[_0x2b03('0x37')]('Content-Range',_0x4c99ae+'-'+_0x58523c+'/'+_0x40e432)[_0x2b03('0x38')](_0xd255fb);}return null;};}function patchUpdates(_0x349554){return function(_0x4cf9b9){try{jsonpatch[_0x2b03('0x39')](_0x4cf9b9,_0x349554,!![]);}catch(_0x30d4fa){return BPromise[_0x2b03('0x3a')](_0x30d4fa);}return _0x4cf9b9['save']();};}function saveUpdates(_0x31d548,_0x13fcea){return function(_0x44763f){if(_0x44763f){return _0x44763f[_0x2b03('0x3b')](_0x31d548)[_0x2b03('0x28')](function(_0x3eed7d){return _0x3eed7d;});}return null;};}function removeEntity(_0xfddcdc,_0x461ed7){return function(_0x3130af){if(_0x3130af){return _0x3130af[_0x2b03('0x3c')]()[_0x2b03('0x28')](function(){_0xfddcdc[_0x2b03('0x34')](0xcc)[_0x2b03('0x35')]();});}};}function handleEntityNotFound(_0x3b06fd,_0x323321){return function(_0x5b1e20){if(!_0x5b1e20){_0x3b06fd['sendStatus'](0x194);}return _0x5b1e20;};}function handleError(_0x565ad9,_0x5ddb4f){_0x5ddb4f=_0x5ddb4f||0x1f4;return function(_0x468795){logger[_0x2b03('0x2e')](_0x468795['stack']);if(_0x468795[_0x2b03('0x3d')]){delete _0x468795[_0x2b03('0x3d')];}_0x565ad9[_0x2b03('0x34')](_0x5ddb4f)['send'](_0x468795);};}exports[_0x2b03('0x3e')]=function(_0x1ce3be,_0x20ace9){var _0xa8eb75={},_0x3b5cc4={},_0x18b643={'count':0x0,'rows':[]};var _0x38f5f0=_[_0x2b03('0x3f')](db[_0x2b03('0x40')][_0x2b03('0x41')],function(_0x403134){return{'name':_0x403134[_0x2b03('0x42')],'type':_0x403134[_0x2b03('0x43')][_0x2b03('0x44')]};});_0x3b5cc4['model']=_['map'](_0x38f5f0,_0x2b03('0x3d'));_0x3b5cc4[_0x2b03('0x45')]=_['keys'](_0x1ce3be[_0x2b03('0x45')]);_0x3b5cc4[_0x2b03('0x46')]=_[_0x2b03('0x47')](_0x3b5cc4['model'],_0x3b5cc4[_0x2b03('0x45')]);_0xa8eb75[_0x2b03('0x48')]=_[_0x2b03('0x47')](_0x3b5cc4[_0x2b03('0x49')],qs[_0x2b03('0x4a')](_0x1ce3be[_0x2b03('0x45')][_0x2b03('0x4a')]));_0xa8eb75['attributes']=_0xa8eb75[_0x2b03('0x48')][_0x2b03('0x4b')]?_0xa8eb75['attributes']:_0x3b5cc4[_0x2b03('0x49')];if(!_0x1ce3be['query']['hasOwnProperty'](_0x2b03('0x4c'))){_0xa8eb75[_0x2b03('0x4d')]=qs[_0x2b03('0x4d')](_0x1ce3be['query'][_0x2b03('0x4d')]);_0xa8eb75[_0x2b03('0x36')]=qs[_0x2b03('0x36')](_0x1ce3be[_0x2b03('0x45')][_0x2b03('0x36')]);}_0xa8eb75['order']=qs[_0x2b03('0x4e')](_0x1ce3be[_0x2b03('0x45')]['sort']);_0xa8eb75[_0x2b03('0x4f')]=qs['filters'](_[_0x2b03('0x50')](_0x1ce3be[_0x2b03('0x45')],_0x3b5cc4[_0x2b03('0x46')]));if(_0x1ce3be[_0x2b03('0x45')][_0x2b03('0x51')]){_0xa8eb75['where']=_[_0x2b03('0x52')](_0xa8eb75[_0x2b03('0x4f')],{'$or':_[_0x2b03('0x3f')](_0x38f5f0,function(_0x35eed2){if(_0x35eed2[_0x2b03('0x43')]!==_0x2b03('0x53')){var _0x5515d9={};_0x5515d9[_0x35eed2['name']]={'$like':'%'+_0x1ce3be[_0x2b03('0x45')][_0x2b03('0x51')]+'%'};return _0x5515d9;}})});}_0xa8eb75=_[_0x2b03('0x52')]({},_0xa8eb75,_0x1ce3be['options']);var _0x2a729f={'where':_0xa8eb75[_0x2b03('0x4f')]};return db[_0x2b03('0x40')][_0x2b03('0x54')](_0x2a729f)[_0x2b03('0x28')](function(_0x1486a8){_0x18b643[_0x2b03('0x54')]=_0x1486a8;if(_0x1ce3be[_0x2b03('0x45')]['includeAll']){_0xa8eb75[_0x2b03('0x55')]=[{'all':!![]}];}return db[_0x2b03('0x40')][_0x2b03('0x56')](_0xa8eb75);})['then'](function(_0x463084){_0x18b643[_0x2b03('0x57')]=_0x463084;return _0x18b643;})['then'](respondWithFilteredResult(_0x20ace9,_0xa8eb75))[_0x2b03('0x32')](handleError(_0x20ace9,null));};exports[_0x2b03('0x58')]=function(_0x4a29e0,_0x3e46ef){var _0xa642a0={'raw':!![],'where':{'id':_0x4a29e0[_0x2b03('0x59')]['id']}},_0x253626={};_0x253626[_0x2b03('0x49')]=_[_0x2b03('0x5a')](db['SmsMessage'][_0x2b03('0x41')]);_0x253626[_0x2b03('0x45')]=_[_0x2b03('0x5a')](_0x4a29e0[_0x2b03('0x45')]);_0x253626[_0x2b03('0x46')]=_['intersection'](_0x253626[_0x2b03('0x49')],_0x253626[_0x2b03('0x45')]);_0xa642a0['attributes']=_[_0x2b03('0x47')](_0x253626[_0x2b03('0x49')],qs['fields'](_0x4a29e0[_0x2b03('0x45')]['fields']));_0xa642a0[_0x2b03('0x48')]=_0xa642a0[_0x2b03('0x48')][_0x2b03('0x4b')]?_0xa642a0[_0x2b03('0x48')]:_0x253626[_0x2b03('0x49')];if(_0x4a29e0[_0x2b03('0x45')]['includeAll']){_0xa642a0['include']=[{'all':!![]}];}_0xa642a0=_[_0x2b03('0x52')]({},_0xa642a0,_0x4a29e0['options']);return db['SmsMessage'][_0x2b03('0x5b')](_0xa642a0)[_0x2b03('0x28')](handleEntityNotFound(_0x3e46ef,null))[_0x2b03('0x28')](respondWithResult(_0x3e46ef,null))[_0x2b03('0x32')](handleError(_0x3e46ef,null));};exports[_0x2b03('0x5c')]=function(_0x17d939,_0x4a9f51){return db[_0x2b03('0x40')][_0x2b03('0x5c')](_0x17d939[_0x2b03('0x5d')],{})[_0x2b03('0x28')](respondWithResult(_0x4a9f51,0xc9))[_0x2b03('0x32')](handleError(_0x4a9f51,null));};exports['update']=function(_0x53b148,_0x43e64e){if(_0x53b148[_0x2b03('0x5d')]['id']){delete _0x53b148['body']['id'];}return db['SmsMessage'][_0x2b03('0x5b')]({'where':{'id':_0x53b148[_0x2b03('0x59')]['id']}})[_0x2b03('0x28')](handleEntityNotFound(_0x43e64e,null))['then'](saveUpdates(_0x53b148[_0x2b03('0x5d')],null))['then'](respondWithResult(_0x43e64e,null))['catch'](handleError(_0x43e64e,null));};exports[_0x2b03('0x3c')]=function(_0x4c19b9,_0x2f98ed){return db[_0x2b03('0x40')][_0x2b03('0x5b')]({'where':{'id':_0x4c19b9['params']['id']}})[_0x2b03('0x28')](handleEntityNotFound(_0x2f98ed,null))['then'](removeEntity(_0x2f98ed,null))[_0x2b03('0x32')](handleError(_0x2f98ed,null));};exports[_0x2b03('0x5e')]=function(_0x4450d0,_0x4580f9){return db[_0x2b03('0x40')][_0x2b03('0x5e')]()['then'](respondWithResult(_0x4580f9,null))['catch'](handleError(_0x4580f9,null));};var interaction_log=require(_0x2b03('0x15'))(_0x2b03('0x5f'));exports[_0x2b03('0x60')]=function(_0x3b1ef5,_0x4744aa,_0x559068){var _0x5f5beb={'channel':'sms'};if(_0x3b1ef5[_0x2b03('0x5d')]['id']){delete _0x3b1ef5[_0x2b03('0x5d')]['id'];}_0x3b1ef5[_0x2b03('0x5d')][_0x2b03('0x61')]=!![];_0x3b1ef5[_0x2b03('0x5d')][_0x2b03('0x62')]=moment()[_0x2b03('0x63')](_0x2b03('0x64'));_0x3b1ef5['body'][_0x2b03('0x65')]=_0x3b1ef5[_0x2b03('0x5d')][_0x2b03('0x65')]||_0x3b1ef5[_0x2b03('0x66')]['id'];return db['SmsMessage']['find']({'where':{'id':_0x3b1ef5[_0x2b03('0x59')]['id'],'UserId':null},'include':[{'model':db[_0x2b03('0x67')],'as':'Contact'}]})['then'](handleEntityNotFound(_0x4744aa,null))[_0x2b03('0x28')](saveUpdates(_0x3b1ef5[_0x2b03('0x5d')],null))[_0x2b03('0x28')](function(_0x2417be){if(_0x2417be){_0x5f5beb[_0x2b03('0x30')]=_0x2417be[_0x2b03('0x68')]({'plain':!![]});return db[_0x2b03('0x69')][_0x2b03('0x5b')]({'where':{'id':_0x2417be[_0x2b03('0x6a')]}});}return null;})[_0x2b03('0x28')](handleEntityNotFound(_0x4744aa,null))['then'](function(_0x205e35){if(_0x205e35){return _0x205e35[_0x2b03('0x3b')]({'UserId':_0x3b1ef5[_0x2b03('0x5d')][_0x2b03('0x65')],'read1stAt':_['isNil'](_0x205e35[_0x2b03('0x6b')])?moment()[_0x2b03('0x63')](_0x2b03('0x64')):undefined});}return null;})[_0x2b03('0x28')](function(_0xa8ca3c){if(_0xa8ca3c){_0x5f5beb[_0x2b03('0x6c')]=_0xa8ca3c[_0x2b03('0x68')]({'plain':!![]});interaction_log[_0x2b03('0x29')](_0x2b03('0x6d'),_0x3b1ef5[_0x2b03('0x66')]['id'],_0x3b1ef5[_0x2b03('0x66')]['name'],_0x3b1ef5[_0x2b03('0x66')][_0x2b03('0x6e')],_0x5f5beb[_0x2b03('0x6c')]['id'],_0x3b1ef5[_0x2b03('0x5d')]?JSON[_0x2b03('0x6f')](_0x3b1ef5[_0x2b03('0x5d')]):_0x2b03('0x70'));return respondWithRpcPromise('AcceptMessage',_0x2b03('0x71'),_0x5f5beb);}return null;})['then'](function(_0x18443d){if(_0x18443d){if(_0x3b1ef5[_0x2b03('0x5d')][_0x2b03('0x72')]){_0x5f5beb[_0x2b03('0x30')][_0x2b03('0x73')]=util[_0x2b03('0x63')](_0x2b03('0x74'),_0x3b1ef5[_0x2b03('0x66')][_0x2b03('0x3d')]);_0x5f5beb[_0x2b03('0x30')][_0x2b03('0x75')]=_0x5f5beb['channel'];_0x5f5beb[_0x2b03('0x30')][_0x2b03('0x76')]='accept';return respondWithRpcPromise(_0x2b03('0x77'),_0x2b03('0x77'),{'event':_0x2b03('0x78'),'message':_0x5f5beb[_0x2b03('0x30')]},client9002)['then'](function(){return _0x5f5beb;});}return _0x5f5beb;}return null;})[_0x2b03('0x28')](respondWithResult(_0x4744aa,null))[_0x2b03('0x32')](handleError(_0x4744aa,null));};var interaction_log=require(_0x2b03('0x15'))(_0x2b03('0x5f'));exports['reject']=function(_0x5899fc,_0x3ba815,_0x226e46){var _0x10ace2={'agent':{},'channel':_0x2b03('0x79')};if(_0x5899fc[_0x2b03('0x5d')]['id']){delete _0x5899fc['body']['id'];}_0x5899fc[_0x2b03('0x5d')][_0x2b03('0x65')]=_0x5899fc[_0x2b03('0x5d')][_0x2b03('0x65')]||_0x5899fc[_0x2b03('0x66')]['id'];_0x10ace2[_0x2b03('0x7a')]['id']=_0x5899fc['body'][_0x2b03('0x65')];return db[_0x2b03('0x40')][_0x2b03('0x5b')]({'where':{'id':_0x5899fc[_0x2b03('0x59')]['id'],'UserId':null}})[_0x2b03('0x28')](handleEntityNotFound(_0x3ba815,null))[_0x2b03('0x28')](function(_0x56b6a0){if(_0x56b6a0){_0x10ace2[_0x2b03('0x30')]=_0x56b6a0[_0x2b03('0x68')]({'plain':!![]});return db[_0x2b03('0x69')]['find']({'where':{'id':_0x56b6a0[_0x2b03('0x6a')]}});}return null;})[_0x2b03('0x28')](handleEntityNotFound(_0x3ba815,null))[_0x2b03('0x28')](function(_0x1ffd47){if(_0x1ffd47){_0x10ace2[_0x2b03('0x6c')]=_0x1ffd47[_0x2b03('0x68')]({'plain':!![]});interaction_log['info'](_0x2b03('0x7b'),_0x5899fc['user']['id'],_0x5899fc[_0x2b03('0x66')][_0x2b03('0x3d')],_0x5899fc['user'][_0x2b03('0x6e')],_0x10ace2[_0x2b03('0x6c')]['id'],_0x5899fc[_0x2b03('0x5d')]?JSON[_0x2b03('0x6f')](_0x5899fc[_0x2b03('0x5d')]):'null');return respondWithRpcPromise('RejectMessage',_0x2b03('0x7c'),_0x10ace2);}return null;})[_0x2b03('0x28')](function(_0x3069d3){if(_0x3069d3){_0x3069d3[_0x2b03('0x30')]['interface']=util[_0x2b03('0x63')](_0x2b03('0x74'),_0x5899fc[_0x2b03('0x66')][_0x2b03('0x3d')]);_0x3069d3[_0x2b03('0x30')][_0x2b03('0x75')]=_0x10ace2[_0x2b03('0x75')];_0x3069d3[_0x2b03('0x30')][_0x2b03('0x76')]=_0x2b03('0x3a');respondWithRpcPromise(_0x2b03('0x77'),_0x2b03('0x77'),{'event':'rejectmessage','message':_0x3069d3[_0x2b03('0x30')]},client9002);return _0x10ace2;}return null;})[_0x2b03('0x28')](respondWithResult(_0x3ba815,null))[_0x2b03('0x32')](handleError(_0x3ba815,null));};exports[_0x2b03('0x34')]=function(_0x1eea31,_0x4779ad,_0x3356f0){if(_0x1eea31[_0x2b03('0x5d')]['id']){delete _0x1eea31[_0x2b03('0x5d')]['id'];}var _0xcbec28;return db[_0x2b03('0x40')]['find']({'where':{'id':_0x1eea31['params']['id']}})[_0x2b03('0x28')](handleEntityNotFound(_0x4779ad,null))['then'](function(_0x40341a){if(_0x40341a){_0xcbec28=_0x40341a;return db[_0x2b03('0x7d')][_0x2b03('0x5b')]({'where':{'id':_0x40341a[_0x2b03('0x7e')]}});}})[_0x2b03('0x28')](handleEntityNotFound(_0x4779ad,null))[_0x2b03('0x28')](function(_0x283072){if(_0x283072){logger[_0x2b03('0x2c')](_0x2b03('0x2d'),'status','received\x20delivery\x20report\x20from',_0x283072['type'],util[_0x2b03('0x7f')](_0x1eea31['body'],{'showHidden':![],'depth':null}));switch(_0x283072['type']){case'twilio':if(_0x1eea31['body']['MessageSid']&&_0x1eea31[_0x2b03('0x5d')][_0x2b03('0x80')]===_0xcbec28[_0x2b03('0x81')]){return _0xcbec28['update']({'read':!![]});}else{logger['error'](_0x2b03('0x82'),'status',_0x2b03('0x83'),util[_0x2b03('0x7f')](_0x1eea31[_0x2b03('0x5d')],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x1eea31[_0x2b03('0x5d')][_0x2b03('0x84')]&&_0x1eea31['body'][_0x2b03('0x84')]===_0xcbec28[_0x2b03('0x81')]&&_['indexOf'](['sent','delivered'],_0x1eea31[_0x2b03('0x5d')][_0x2b03('0x85')])>=0x0){return _0xcbec28[_0x2b03('0x3b')]({'read':!![]});}else{logger['error'](_0x2b03('0x82'),_0x2b03('0x34'),_0x2b03('0x86'),util['inspect'](_0x1eea31[_0x2b03('0x5d')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x424627=_0x1eea31['body'][_0x2b03('0x87')][0x0];if(_0x424627[_0x2b03('0x34')][_0x2b03('0x88')]===_0x2b03('0x89')){return _0xcbec28[_0x2b03('0x3b')]({'read':!![]});}else{logger[_0x2b03('0x2e')](_0x2b03('0x82'),_0x2b03('0x34'),_0x2b03('0x8a'),util[_0x2b03('0x7f')](_0x1eea31[_0x2b03('0x5d')],{'showHidden':![],'depth':null}));}break;}return _0xcbec28;}})[_0x2b03('0x28')](respondWithResult(_0x4779ad,null))[_0x2b03('0x32')](handleError(_0x4779ad,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 72dbc18..811ff9e 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 _0xbd58=['SmsMessage','setMaxListeners','save','update','emit','hasOwnProperty','hook','../../mysqldb'];(function(_0x1bcf64,_0x32c029){var _0x1dba72=function(_0x262d9e){while(--_0x262d9e){_0x1bcf64['push'](_0x1bcf64['shift']());}};_0x1dba72(++_0x32c029);}(_0xbd58,0x1a7));var _0x8bd5=function(_0x2737e2,_0x321a59){_0x2737e2=_0x2737e2-0x0;var _0x46b4cc=_0xbd58[_0x2737e2];return _0x46b4cc;};'use strict';var EventEmitter=require('events');var SmsMessage=require(_0x8bd5('0x0'))['db'][_0x8bd5('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x8bd5('0x2')](0x0);var events={'afterCreate':_0x8bd5('0x3'),'afterUpdate':_0x8bd5('0x4'),'afterDestroy':'remove'};function emitEvent(_0x349479){return function(_0x23da92,_0x296639,_0x347739){SmsMessageEvents[_0x8bd5('0x5')](_0x349479+':'+_0x23da92['id'],_0x23da92);SmsMessageEvents[_0x8bd5('0x5')](_0x349479,_0x23da92);_0x347739(null);};}for(var e in events){if(events[_0x8bd5('0x6')](e)){var event=events[e];SmsMessage[_0x8bd5('0x7')](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file +var _0x31a4=['hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','remove','emit'];(function(_0x22e38e,_0x22b160){var _0x247042=function(_0x3451a9){while(--_0x3451a9){_0x22e38e['push'](_0x22e38e['shift']());}};_0x247042(++_0x22b160);}(_0x31a4,0x16e));var _0x431a=function(_0x2afc47,_0x177a18){_0x2afc47=_0x2afc47-0x0;var _0x42aa1f=_0x31a4[_0x2afc47];return _0x42aa1f;};'use strict';var EventEmitter=require(_0x431a('0x0'));var SmsMessage=require(_0x431a('0x1'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x431a('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x431a('0x3')};function emitEvent(_0x37ada4){return function(_0x65ecaf,_0x37ff5b,_0x30847e){SmsMessageEvents[_0x431a('0x4')](_0x37ada4+':'+_0x65ecaf['id'],_0x65ecaf);SmsMessageEvents[_0x431a('0x4')](_0x37ada4,_0x65ecaf);_0x30847e(null);};}for(var e in events){if(events[_0x431a('0x5')](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module[_0x431a('0x6')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 451f43c..21b39dd 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 _0x2003=['Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','split','total_sent','internal_order_id','deliveryReport','catch','SmsMessage,\x20%s,\x20%s,\x20%s','skebby','connectel','senderString','https://smsapi.connectel.se/api/send/','requestid','read','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','%s:%s','POST','Basic\x20%s','toString','base64','http_code','data','queued_count','head','clickSend','plivo','message_uuid','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','text','keys','sort','length','createHash','digest','signature=','GET','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','intelepeer','Token\x20not\x20received','finally','utf8mb4','lodash','api','bluebird','path','rimraf','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','direction','secret','isNil','UserId','SmsInteraction','findOne','SmsInteractionId','then','update','toLowerCase','error','out','find','type','twilio','accountSid','authToken','messages','create','phone','remote','/api/sms/messages/','token','sid','afterCreate','inspect'];(function(_0x445b21,_0x31a745){var _0x23a9ca=function(_0x17f3ba){while(--_0x17f3ba){_0x445b21['push'](_0x445b21['shift']());}};_0x23a9ca(++_0x31a745);}(_0x2003,0xb3));var _0x3200=function(_0x425b19,_0x2dcf14){_0x425b19=_0x425b19-0x0;var _0x15ecab=_0x2003[_0x425b19];return _0x15ecab;};'use strict';var _=require(_0x3200('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3200('0x1'));var moment=require('moment');var BPromise=require(_0x3200('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3200('0x3'));var rimraf=require(_0x3200('0x4'));var config=require('../../config/environment');var attributes=require(_0x3200('0x5'));module[_0x3200('0x6')]=function(_0x165959,_0x15bad6){return _0x165959[_0x3200('0x7')](_0x3200('0x8'),attributes,{'tableName':_0x3200('0x9'),'paranoid':![],'indexes':[{'name':_0x3200('0xa'),'fields':[_0x3200('0xa')]},{'name':_0x3200('0xb'),'fields':[_0x3200('0xc')],'type':_0x3200('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x58def9,_0x3d5933,_0x3b8171){var _0x2c17ff=_0x165959[_0x3200('0xe')];var _0x3e83e7=_0x58def9['get']({'plain':!![]});if(_0x3e83e7[_0x3200('0xf')]['toLowerCase']()==='in'||_0x3e83e7[_0x3200('0xf')]['toLowerCase']()==='out'&&!_0x3e83e7[_0x3200('0x10')]&&!_[_0x3200('0x11')](_0x3e83e7[_0x3200('0x12')])){_0x2c17ff[_0x3200('0x13')][_0x3200('0x14')]({'where':{'id':_0x3e83e7[_0x3200('0x15')]}})[_0x3200('0x16')](function(_0xf2ec52){if(_0xf2ec52){_0xf2ec52[_0x3200('0x17')]({'lastMsgAt':_0x3e83e7['createdAt'],'lastMsgDirection':_0x3e83e7[_0x3200('0xf')][_0x3200('0x18')]()});}})['catch'](function(_0x4eccbd){console[_0x3200('0x19')](_0x4eccbd);});}if(_0x3e83e7[_0x3200('0xf')]===_0x3200('0x1a')&&!_0x3e83e7[_0x3200('0x10')]){var _0x2f5802;_0x2c17ff['SmsAccount'][_0x3200('0x1b')]({'where':{'id':_0x3e83e7['SmsAccountId']},'raw':!![]})[_0x3200('0x16')](function(_0xea9aee){_0x2f5802=_0xea9aee;if(_0x2f5802&&_0x2f5802[_0x3200('0x1c')]){switch(_0x2f5802['type']){case _0x3200('0x1d'):var _0x3cce49=require(_0x3200('0x1d'));if(_0x2f5802[_0x3200('0x1e')]&&_0x2f5802[_0x3200('0x1f')]&&_0x2f5802['phone']){var _0x29b39d=new _0x3cce49(_0x2f5802[_0x3200('0x1e')],_0x2f5802[_0x3200('0x1f')]);_0x29b39d[_0x3200('0x20')][_0x3200('0x21')]({'body':_0x3e83e7[_0x3200('0xc')],'to':_0x3e83e7[_0x3200('0x22')],'from':_0x2f5802[_0x3200('0x22')],'statusCallback':_0x2f5802[_0x3200('0x23')]+_0x3200('0x24')+_0x3e83e7['id']+'/status?token='+_0x2f5802[_0x3200('0x25')]})[_0x3200('0x16')](function(_0x5a0a86){if(_0x5a0a86['sid']){return _0x58def9[_0x3200('0x17')]({'messageId':_0x5a0a86[_0x3200('0x26')]});}})['catch'](function(_0x406328){logger[_0x3200('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3200('0x27'),_0x3200('0x1d'),util[_0x3200('0x28')](_0x406328,{'showHidden':![],'depth':null}));});}else{logger[_0x3200('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3200('0x27'),_0x3200('0x1d'),_0x3200('0x29'));}break;case'skebby':var _0x5dd234=_0x3200('0x2a');if(_0x2f5802[_0x3200('0x2b')]&&_0x2f5802[_0x3200('0x2c')]){var _0x961b47={'recipient':[_0x3e83e7[_0x3200('0x22')]],'message':_0x3e83e7['body'],'message_type':_0x2f5802[_0x3200('0x2d')]};if(_0x2f5802['smsMethod']&&_0x2f5802[_0x3200('0x2d')]!=='SI'){_0x961b47[_0x3200('0x2e')]=_0x2f5802['phone'];}var _0x2d6073={'url':_0x5dd234+_0x3200('0x2f')+_0x2f5802[_0x3200('0x2b')]+'&password='+_0x2f5802[_0x3200('0x2c')],'method':'GET'};rp(_0x2d6073)[_0x3200('0x16')](function(_0x189bbb){var _0x5304cf=_0x189bbb[_0x3200('0x30')](';');var _0x183734={'user_key':_0x5304cf[0x0],'session_key':_0x5304cf[0x1]};_0x2d6073={'url':_0x5dd234+'sms','method':'POST','headers':{'user_key':_0x183734['user_key'],'Session_key':_0x183734['session_key']},'json':!![],'body':_0x961b47};return rp(_0x2d6073);})[_0x3200('0x16')](function(_0x556dc3){if(_0x556dc3[_0x3200('0x31')]>=0x1){var _0x43f21d={'messageId':_0x556dc3[_0x3200('0x32')]};if(_0x2f5802[_0x3200('0x2d')]!=='GP'||!_0x2f5802[_0x3200('0x33')]){_0x43f21d['read']=!![];}return _0x58def9[_0x3200('0x17')](_0x43f21d);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3200('0x27'),'skebby',util[_0x3200('0x28')](_0x556dc3,{'showHidden':![],'depth':null}));}})[_0x3200('0x34')](function(_0x866572){return logger[_0x3200('0x19')](_0x3200('0x35'),_0x3200('0x27'),'skebby',util['inspect'](_0x866572,{'showHidden':![],'depth':null}));});}else{logger[_0x3200('0x19')](_0x3200('0x35'),'afterCreate',_0x3200('0x36'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x3200('0x37'):if(_0x2f5802[_0x3200('0x1f')]){var _0x452801={'recipient':_0x3e83e7['phone'],'message':_0x3e83e7[_0x3200('0xc')],'sender':_0x2f5802[_0x3200('0x38')]||_0x2f5802[_0x3200('0x22')],'authorization':_0x2f5802[_0x3200('0x1f')]};var _0x3d5933={'method':'POST','uri':_0x3200('0x39'),'body':_0x452801,'json':!![]};rp(_0x3d5933)[_0x3200('0x16')](function(_0x4fdb76){var _0x1ec1d2={'messageId':_0x4fdb76[_0x3200('0x3a')]};if(!_0x2f5802[_0x3200('0x33')]){_0x1ec1d2[_0x3200('0x3b')]=!![];}return _0x58def9[_0x3200('0x17')](_0x1ec1d2);})['catch'](function(_0x233cf0){logger[_0x3200('0x19')](_0x3200('0x35'),'afterCreate','connectel',util[_0x3200('0x28')](_0x233cf0,{'showHidden':![],'depth':null}));});}else{logger[_0x3200('0x19')](_0x3200('0x35'),_0x3200('0x27'),_0x3200('0x37'),_0x3200('0x3c'));}break;case _0x3200('0x3d'):if(_0x2f5802[_0x3200('0x2b')]&&_0x2f5802[_0x3200('0x2c')]){var _0x452801={'messages':[{'source':_0x3200('0x3e'),'to':_0x3e83e7['phone'],'body':_0x3e83e7[_0x3200('0xc')],'from':_0x2f5802[_0x3200('0x38')]||_0x2f5802[_0x3200('0x22')]}]};var _0x2e69a8=util[_0x3200('0x3f')](_0x3200('0x40'),_0x2f5802[_0x3200('0x2b')],_0x2f5802[_0x3200('0x2c')]);var _0x3d5933={'method':_0x3200('0x41'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x452801,'headers':{'Authorization':util['format'](_0x3200('0x42'),new Buffer(_0x2e69a8)[_0x3200('0x43')](_0x3200('0x44')))},'json':!![]};rp(_0x3d5933)['then'](function(_0x5f10eb){if(_0x5f10eb[_0x3200('0x45')]>=0xc8&&_0x5f10eb[_0x3200('0x45')]<=0xce){if(_0x5f10eb[_0x3200('0x46')]&&_0x5f10eb[_0x3200('0x46')][_0x3200('0x47')]>0x0){var _0x5bc0c8=_[_0x3200('0x48')](_0x5f10eb[_0x3200('0x46')][_0x3200('0x20')]);var _0x430fdc={'messageId':_0x5bc0c8['message_id']};if(!_0x2f5802['deliveryReport']){_0x430fdc[_0x3200('0x3b')]=!![];}return _0x58def9[_0x3200('0x17')](_0x430fdc);}else{logger[_0x3200('0x19')](_0x3200('0x35'),_0x3200('0x27'),_0x3200('0x49'),util['inspect'](_0x5f10eb,{'showHidden':![],'depth':null}));}}else{logger['error'](_0x3200('0x35'),_0x3200('0x27'),_0x3200('0x49'),util[_0x3200('0x28')](_0x5f10eb,{'showHidden':![],'depth':null}));}})['catch'](function(_0x3de294){logger[_0x3200('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3200('0x27'),_0x3200('0x49'),util[_0x3200('0x28')](_0x3de294,{'showHidden':![],'depth':null}));});}else{logger[_0x3200('0x19')](_0x3200('0x35'),'afterCreate','clickSend','Missing\x20parameters:\x20username,\x20password');}break;case _0x3200('0x4a'):if(_0x2f5802['authId']&&_0x2f5802[_0x3200('0x1f')]){var _0x452801={'dst':_0x3e83e7[_0x3200('0x22')],'text':_0x3e83e7[_0x3200('0xc')],'src':_0x2f5802['senderString']||_0x2f5802['phone'],'url':_0x2f5802[_0x3200('0x23')]+_0x3200('0x24')+_0x3e83e7['id']+'/status?token='+_0x2f5802[_0x3200('0x25')]};var _0x2e69a8=util[_0x3200('0x3f')](_0x3200('0x40'),_0x2f5802['authId'],_0x2f5802[_0x3200('0x1f')]);var _0x3d5933={'method':_0x3200('0x41'),'uri':util[_0x3200('0x3f')]('https://api.plivo.com/v1/Account/%s/Message/',_0x2f5802['authId']),'body':_0x452801,'headers':{'Authorization':util[_0x3200('0x3f')](_0x3200('0x42'),new Buffer(_0x2e69a8)[_0x3200('0x43')]('base64'))},'json':!![]};rp(_0x3d5933)[_0x3200('0x16')](function(_0x1739a7){var _0x5c3639={'messageId':_0x1739a7[_0x3200('0x4b')][0x0]};return _0x58def9[_0x3200('0x17')](_0x5c3639);})[_0x3200('0x34')](function(_0x1e4419){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x3200('0x4a'),util['inspect'](_0x1e4419,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x3200('0x35'),'afterCreate',_0x3200('0x4a'),'Missing\x20parameters:\x20authId,\x20authToken');}break;case _0x3200('0x4c'):if(_0x2f5802[_0x3200('0x2b')]&&_0x2f5802['password']){if(_0x2f5802[_0x3200('0x4d')]){var _0x378fc9={'method':'POST','uri':_0x2f5802[_0x3200('0x4d')]+_0x3200('0x4e'),'body':{'username':_0x2f5802[_0x3200('0x2b')],'password':_0x2f5802['password']},'json':!![]};return rp(_0x378fc9)[_0x3200('0x16')](function(_0x10847f){var _0x41d826={'method':_0x3200('0x41'),'uri':_0x2f5802[_0x3200('0x4d')]+_0x3200('0x4f'),'body':{'messages':[{'from':_0x2f5802['phone'],'destinations':[{'to':_0x3e83e7[_0x3200('0x22')]}],'text':_0x3e83e7['body'],'notifyUrl':_0x2f5802[_0x3200('0x23')]+_0x3200('0x24')+_0x3e83e7['id']+'/status?token='+_0x2f5802[_0x3200('0x25')],'notifyContentType':_0x3200('0x50'),'callbackData':_0x2f5802[_0x3200('0x22')]+';'+_0x3e83e7[_0x3200('0xc')]}]},'headers':{'Authorization':_0x3200('0x51')+_0x10847f[_0x3200('0x25')]},'json':!![]};return rp(_0x41d826)[_0x3200('0x16')](function(_0x5708d5){if(_0x5708d5[_0x3200('0x20')]){var _0x1eb7a3={'messageId':_0x5708d5[_0x3200('0x20')][0x0][_0x3200('0xa')]};if(!_0x2f5802['deliveryReport']){_0x1eb7a3[_0x3200('0x3b')]=!![];}return _0x58def9['update'](_0x1eb7a3);}else{return logger[_0x3200('0x19')](_0x3200('0x35'),_0x3200('0x27'),_0x3200('0x4c'),util[_0x3200('0x28')](_0x5708d5,{'showHidden':![],'depth':null}));}});})[_0x3200('0x34')](function(_0x361de0){return logger[_0x3200('0x19')](_0x3200('0x35'),_0x3200('0x27'),_0x3200('0x4c'),util[_0x3200('0x28')](_0x361de0,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x3200('0x35'),_0x3200('0x27'),_0x3200('0x4c'),_0x3200('0x52'));}}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3200('0x27'),_0x3200('0x4c'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x3200('0x53'):var _0x3067c9=require(_0x3200('0x54'));if(_0x2f5802[_0x3200('0x55')]){var _0x3220e9={};_0x3220e9[_0x3200('0x56')]=_0x2f5802[_0x3200('0x2b')];_0x3220e9[_0x3200('0x22')]=_0x3e83e7[_0x3200('0x22')];_0x3220e9[_0x3200('0x2e')]=_0x2f5802[_0x3200('0x22')];_0x3220e9[_0x3200('0x57')]=_0x3e83e7['body'];_0x3220e9['timestamp']=+new Date();var _0xe90cd='';var _0x1fd609='';var _0x2f6a12=Object[_0x3200('0x58')](_0x3220e9);_0x2f6a12[_0x3200('0x59')]();for(var _0x315362=0x0;_0x315362<_0x2f6a12[_0x3200('0x5a')];_0x315362++){if(_0xe90cd!=''){_0xe90cd+='&';}_0xe90cd+=_0x2f6a12[_0x315362]+'='+encodeURIComponent(_0x3220e9[_0x2f6a12[_0x315362]]);_0x1fd609+=_0x3220e9[_0x2f6a12[_0x315362]];}_0x1fd609+=_0x2f5802['apiKey'];_0x1fd609=_0x3067c9[_0x3200('0x5b')]('md5')['update'](_0x1fd609)[_0x3200('0x5c')]('hex');if(_0xe90cd!==''){_0xe90cd+='&';}_0xe90cd+=_0x3200('0x5d')+_0x1fd609;var _0x2d6073={'method':_0x3200('0x5e'),'uri':_0x2f5802[_0x3200('0x4d')]+_0x3200('0x5f')+_0xe90cd,'json':!![]};return rp(_0x2d6073)[_0x3200('0x16')](function(_0x164a27){var _0x542bea=Object['keys'](_0x164a27);if(_0x164a27[_0x542bea[0x0]]['error']&&parseInt(_0x164a27[_0x542bea[0x0]][_0x3200('0x19')])===0x0){var _0x2c1a7f={'messageId':_0x164a27[_0x542bea[0x0]][_0x3200('0x60')]};if(!_0x2f5802[_0x3200('0x33')]){_0x2c1a7f[_0x3200('0x3b')]=!![];}return _0x58def9[_0x3200('0x17')](_0x2c1a7f);}else{return logger[_0x3200('0x19')](_0x3200('0x35'),_0x3200('0x27'),'csc',util[_0x3200('0x28')](_0x164a27['error'],{'showHidden':![],'depth':null}));}})[_0x3200('0x34')](function(_0x54ed28){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3200('0x27'),_0x3200('0x53'),util[_0x3200('0x28')](_0x54ed28,{'showHidden':![],'depth':null}));});}else{logger[_0x3200('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3200('0x27'),'csc',_0x3200('0x61'));}break;case _0x3200('0x62'):if(_0x2f5802[_0x3200('0x55')]){var _0x311a10={'method':_0x3200('0x41'),'uri':_0x3200('0x63'),'headers':{'Authorization':_0x2f5802[_0x3200('0x55')]},'body':{'content':_0x3e83e7[_0x3200('0xc')],'to':[_0x3e83e7[_0x3200('0x22')]],'from':_0x2f5802[_0x3200('0x22')],'binary':![],'clientMessageId':'uuid','charset':'UTF-8'},'json':!![]};rp(_0x311a10)['then'](function(_0x5023b2){if(!_0x5023b2['error']){var _0x338420={'messageId':_0x5023b2[_0x3200('0x20')][0x0]['apiMessageId']};if(!_0x2f5802['deliveryReport']){_0x338420[_0x3200('0x3b')]=!![];}return _0x58def9[_0x3200('0x17')](_0x338420);}else{return logger['error'](_0x3200('0x35'),_0x3200('0x27'),_0x3200('0x62'),util[_0x3200('0x28')](_0x5023b2[_0x3200('0x19')],{'showHidden':![],'depth':null}));}})[_0x3200('0x34')](function(_0x16d663){return logger[_0x3200('0x19')](_0x3200('0x35'),'afterCreate',_0x3200('0x62'),util[_0x3200('0x28')](_0x16d663,{'showHidden':![],'depth':null}));});}else{logger[_0x3200('0x19')](_0x3200('0x35'),'afterCreate',_0x3200('0x62'),_0x3200('0x61'));}break;case'intelepeer':if(_0x2f5802[_0x3200('0x55')]){var _0x2fc65b={};var _0x2d6073={'method':_0x3200('0x41'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':_0x3200('0x64')+_0x2f5802[_0x3200('0x55')],'Content-Type':_0x3200('0x50')},'body':{'from':_0x2f5802[_0x3200('0x22')],'to':_0x3e83e7[_0x3200('0x22')],'text':_0x3e83e7[_0x3200('0xc')]},'json':!![]};return rp(_0x2d6073)['then'](function(_0x36c6a4){if(_0x36c6a4[_0x3200('0x65')]==0xca){_0x2fc65b[_0x3200('0x66')]=_0x36c6a4;var _0x40e69a={'method':_0x3200('0x41'),'uri':_0x3200('0x67'),'headers':{'Authorization':_0x3200('0x64')+_0x2f5802['apiKey'],'Content-Type':_0x3200('0x50')},'body':{'refid':_0x2fc65b[_0x3200('0x66')][_0x3200('0x68')]},'json':!![]};return rp(_0x40e69a)[_0x3200('0x16')](function(_0x523f4f){_0x2fc65b[_0x3200('0x69')]=_0x523f4f;var _0x4eb3c1={'messageId':_0x2fc65b[_0x3200('0x66')][_0x3200('0x68')],'read':!![]};return _0x58def9[_0x3200('0x17')](_0x4eb3c1);});}else{return logger[_0x3200('0x19')](_0x3200('0x35'),'afterCreate',_0x3200('0x6a'),util['inspect'](_0x36c6a4,{'showHidden':![],'depth':null}));}})['catch'](function(_0x57f6a0){return logger[_0x3200('0x19')](_0x3200('0x35'),_0x3200('0x27'),'intelepeer',util['inspect'](_0x57f6a0,{'showHidden':![],'depth':null}));});}else{return logger[_0x3200('0x19')](_0x3200('0x35'),_0x3200('0x27'),_0x3200('0x6a'),_0x3200('0x6b'));}break;}}})[_0x3200('0x6c')](function(){_0x3b8171();});}else{_0x3b8171();}}},'charset':_0x3200('0x6d'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xf625=['/api/sms/messages/','/status?token=','token','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','password','smsMethod','sender','login?username=','username','sms','POST','user_key','session_key','total_sent','deliveryReport','read','Missing\x20parameters:\x20username,\x20password','connectel','Missing\x20parameters:\x20authToken','xCALLY\x20Motion','senderString','format','%s:%s','https://rest.clicksend.com/v3/sms/send','toString','http_code','data','queued_count','head','messages','message_id','clickSend','plivo','authId','remote','https://api.plivo.com/v1/Account/%s/Message/','Basic\x20%s','base64','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','login','keys','sort','apiKey','createHash','md5','digest','hex','GET','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','clickatell','Missing\x20parameters:\x20apiKey','intelepeer','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','Bearer\x20','status','refid','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','path','rimraf','exports','define','sms_messages','messageId','fti_sms_messages','body','models','get','direction','secret','isNil','UserId','SmsInteraction','then','update','createdAt','toLowerCase','catch','error','out','find','type','twilio','authToken','create','phone'];(function(_0x1af2c7,_0x19b6cf){var _0x2fb6f4=function(_0xd8776){while(--_0xd8776){_0x1af2c7['push'](_0x1af2c7['shift']());}};_0x2fb6f4(++_0x19b6cf);}(_0xf625,0xbe));var _0x5f62=function(_0x2a24f9,_0x33f21b){_0x2a24f9=_0x2a24f9-0x0;var _0x32edf3=_0xf625[_0x2a24f9];return _0x32edf3;};'use strict';var _=require(_0x5f62('0x0'));var util=require(_0x5f62('0x1'));var logger=require(_0x5f62('0x2'))('api');var moment=require('moment');var BPromise=require(_0x5f62('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5f62('0x4'));var rimraf=require(_0x5f62('0x5'));var config=require('../../config/environment');var attributes=require('./smsMessage.attributes');module[_0x5f62('0x6')]=function(_0x1e7169,_0x3fa394){return _0x1e7169[_0x5f62('0x7')]('SmsMessage',attributes,{'tableName':_0x5f62('0x8'),'paranoid':![],'indexes':[{'name':_0x5f62('0x9'),'fields':[_0x5f62('0x9')]},{'name':_0x5f62('0xa'),'fields':[_0x5f62('0xb')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5aa87c,_0x437a35,_0x13ea11){var _0x55b04=_0x1e7169[_0x5f62('0xc')];var _0x503be6=_0x5aa87c[_0x5f62('0xd')]({'plain':!![]});if(_0x503be6[_0x5f62('0xe')]['toLowerCase']()==='in'||_0x503be6['direction']['toLowerCase']()==='out'&&!_0x503be6[_0x5f62('0xf')]&&!_[_0x5f62('0x10')](_0x503be6[_0x5f62('0x11')])){_0x55b04[_0x5f62('0x12')]['findOne']({'where':{'id':_0x503be6['SmsInteractionId']}})[_0x5f62('0x13')](function(_0xf4f6f5){if(_0xf4f6f5){_0xf4f6f5[_0x5f62('0x14')]({'lastMsgAt':_0x503be6[_0x5f62('0x15')],'lastMsgDirection':_0x503be6[_0x5f62('0xe')][_0x5f62('0x16')]()});}})[_0x5f62('0x17')](function(_0x36083b){console[_0x5f62('0x18')](_0x36083b);});}if(_0x503be6[_0x5f62('0xe')]===_0x5f62('0x19')&&!_0x503be6[_0x5f62('0xf')]){var _0x4c00a5;_0x55b04['SmsAccount'][_0x5f62('0x1a')]({'where':{'id':_0x503be6['SmsAccountId']},'raw':!![]})[_0x5f62('0x13')](function(_0x5be088){_0x4c00a5=_0x5be088;if(_0x4c00a5&&_0x4c00a5[_0x5f62('0x1b')]){switch(_0x4c00a5['type']){case _0x5f62('0x1c'):var _0x30d828=require(_0x5f62('0x1c'));if(_0x4c00a5['accountSid']&&_0x4c00a5[_0x5f62('0x1d')]&&_0x4c00a5['phone']){var _0x5e7acb=new _0x30d828(_0x4c00a5['accountSid'],_0x4c00a5[_0x5f62('0x1d')]);_0x5e7acb['messages'][_0x5f62('0x1e')]({'body':_0x503be6[_0x5f62('0xb')],'to':_0x503be6['phone'],'from':_0x4c00a5[_0x5f62('0x1f')],'statusCallback':_0x4c00a5['remote']+_0x5f62('0x20')+_0x503be6['id']+_0x5f62('0x21')+_0x4c00a5[_0x5f62('0x22')]})['then'](function(_0x42106c){if(_0x42106c['sid']){return _0x5aa87c[_0x5f62('0x14')]({'messageId':_0x42106c['sid']});}})[_0x5f62('0x17')](function(_0x292fd7){logger[_0x5f62('0x18')](_0x5f62('0x23'),_0x5f62('0x24'),_0x5f62('0x1c'),util[_0x5f62('0x25')](_0x292fd7,{'showHidden':![],'depth':null}));});}else{logger[_0x5f62('0x18')](_0x5f62('0x23'),_0x5f62('0x24'),'twilio',_0x5f62('0x26'));}break;case _0x5f62('0x27'):var _0x6caaee=_0x5f62('0x28');if(_0x4c00a5['username']&&_0x4c00a5[_0x5f62('0x29')]){var _0x355458={'recipient':[_0x503be6['phone']],'message':_0x503be6[_0x5f62('0xb')],'message_type':_0x4c00a5['smsMethod']};if(_0x4c00a5['smsMethod']&&_0x4c00a5[_0x5f62('0x2a')]!=='SI'){_0x355458[_0x5f62('0x2b')]=_0x4c00a5['phone'];}var _0x207f97={'url':_0x6caaee+_0x5f62('0x2c')+_0x4c00a5[_0x5f62('0x2d')]+'&password='+_0x4c00a5[_0x5f62('0x29')],'method':'GET'};rp(_0x207f97)[_0x5f62('0x13')](function(_0x1b88ee){var _0x5986bc=_0x1b88ee['split'](';');var _0x4b4bb0={'user_key':_0x5986bc[0x0],'session_key':_0x5986bc[0x1]};_0x207f97={'url':_0x6caaee+_0x5f62('0x2e'),'method':_0x5f62('0x2f'),'headers':{'user_key':_0x4b4bb0[_0x5f62('0x30')],'Session_key':_0x4b4bb0[_0x5f62('0x31')]},'json':!![],'body':_0x355458};return rp(_0x207f97);})['then'](function(_0xbd1675){if(_0xbd1675[_0x5f62('0x32')]>=0x1){var _0x3f5317={'messageId':_0xbd1675['internal_order_id']};if(_0x4c00a5[_0x5f62('0x2a')]!=='GP'||!_0x4c00a5[_0x5f62('0x33')]){_0x3f5317[_0x5f62('0x34')]=!![];}return _0x5aa87c[_0x5f62('0x14')](_0x3f5317);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x5f62('0x24'),_0x5f62('0x27'),util[_0x5f62('0x25')](_0xbd1675,{'showHidden':![],'depth':null}));}})[_0x5f62('0x17')](function(_0x38240c){return logger['error'](_0x5f62('0x23'),_0x5f62('0x24'),_0x5f62('0x27'),util[_0x5f62('0x25')](_0x38240c,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x5f62('0x23'),_0x5f62('0x24'),_0x5f62('0x27'),_0x5f62('0x35'));}break;case _0x5f62('0x36'):if(_0x4c00a5['authToken']){var _0x9ff141={'recipient':_0x503be6[_0x5f62('0x1f')],'message':_0x503be6[_0x5f62('0xb')],'sender':_0x4c00a5['senderString']||_0x4c00a5['phone'],'authorization':_0x4c00a5[_0x5f62('0x1d')]};var _0x437a35={'method':'POST','uri':'https://smsapi.connectel.se/api/send/','body':_0x9ff141,'json':!![]};rp(_0x437a35)[_0x5f62('0x13')](function(_0x590c25){var _0x88e0b2={'messageId':_0x590c25['requestid']};if(!_0x4c00a5[_0x5f62('0x33')]){_0x88e0b2[_0x5f62('0x34')]=!![];}return _0x5aa87c[_0x5f62('0x14')](_0x88e0b2);})[_0x5f62('0x17')](function(_0x5550b9){logger[_0x5f62('0x18')](_0x5f62('0x23'),_0x5f62('0x24'),_0x5f62('0x36'),util[_0x5f62('0x25')](_0x5550b9,{'showHidden':![],'depth':null}));});}else{logger[_0x5f62('0x18')](_0x5f62('0x23'),'afterCreate',_0x5f62('0x36'),_0x5f62('0x37'));}break;case'clicksend':if(_0x4c00a5[_0x5f62('0x2d')]&&_0x4c00a5[_0x5f62('0x29')]){var _0x9ff141={'messages':[{'source':_0x5f62('0x38'),'to':_0x503be6[_0x5f62('0x1f')],'body':_0x503be6[_0x5f62('0xb')],'from':_0x4c00a5[_0x5f62('0x39')]||_0x4c00a5[_0x5f62('0x1f')]}]};var _0x209ea0=util[_0x5f62('0x3a')](_0x5f62('0x3b'),_0x4c00a5[_0x5f62('0x2d')],_0x4c00a5[_0x5f62('0x29')]);var _0x437a35={'method':'POST','uri':_0x5f62('0x3c'),'body':_0x9ff141,'headers':{'Authorization':util[_0x5f62('0x3a')]('Basic\x20%s',new Buffer(_0x209ea0)[_0x5f62('0x3d')]('base64'))},'json':!![]};rp(_0x437a35)[_0x5f62('0x13')](function(_0x5acf0c){if(_0x5acf0c[_0x5f62('0x3e')]>=0xc8&&_0x5acf0c[_0x5f62('0x3e')]<=0xce){if(_0x5acf0c[_0x5f62('0x3f')]&&_0x5acf0c[_0x5f62('0x3f')][_0x5f62('0x40')]>0x0){var _0x5c3696=_[_0x5f62('0x41')](_0x5acf0c[_0x5f62('0x3f')][_0x5f62('0x42')]);var _0x54e8c4={'messageId':_0x5c3696[_0x5f62('0x43')]};if(!_0x4c00a5[_0x5f62('0x33')]){_0x54e8c4['read']=!![];}return _0x5aa87c['update'](_0x54e8c4);}else{logger[_0x5f62('0x18')](_0x5f62('0x23'),_0x5f62('0x24'),_0x5f62('0x44'),util[_0x5f62('0x25')](_0x5acf0c,{'showHidden':![],'depth':null}));}}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x5f62('0x24'),'clickSend',util[_0x5f62('0x25')](_0x5acf0c,{'showHidden':![],'depth':null}));}})[_0x5f62('0x17')](function(_0x48da6a){logger['error'](_0x5f62('0x23'),_0x5f62('0x24'),'clickSend',util[_0x5f62('0x25')](_0x48da6a,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x5f62('0x23'),_0x5f62('0x24'),'clickSend',_0x5f62('0x35'));}break;case _0x5f62('0x45'):if(_0x4c00a5[_0x5f62('0x46')]&&_0x4c00a5['authToken']){var _0x9ff141={'dst':_0x503be6[_0x5f62('0x1f')],'text':_0x503be6[_0x5f62('0xb')],'src':_0x4c00a5[_0x5f62('0x39')]||_0x4c00a5[_0x5f62('0x1f')],'url':_0x4c00a5[_0x5f62('0x47')]+_0x5f62('0x20')+_0x503be6['id']+_0x5f62('0x21')+_0x4c00a5[_0x5f62('0x22')]};var _0x209ea0=util[_0x5f62('0x3a')]('%s:%s',_0x4c00a5[_0x5f62('0x46')],_0x4c00a5[_0x5f62('0x1d')]);var _0x437a35={'method':'POST','uri':util['format'](_0x5f62('0x48'),_0x4c00a5[_0x5f62('0x46')]),'body':_0x9ff141,'headers':{'Authorization':util[_0x5f62('0x3a')](_0x5f62('0x49'),new Buffer(_0x209ea0)[_0x5f62('0x3d')](_0x5f62('0x4a')))},'json':!![]};rp(_0x437a35)[_0x5f62('0x13')](function(_0x388456){var _0x3d9243={'messageId':_0x388456[_0x5f62('0x4b')][0x0]};return _0x5aa87c[_0x5f62('0x14')](_0x3d9243);})[_0x5f62('0x17')](function(_0x3709f4){logger[_0x5f62('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x5f62('0x24'),_0x5f62('0x45'),util[_0x5f62('0x25')](_0x3709f4,{'showHidden':![],'depth':null}));});}else{logger[_0x5f62('0x18')](_0x5f62('0x23'),'afterCreate',_0x5f62('0x45'),_0x5f62('0x4c'));}break;case _0x5f62('0x4d'):if(_0x4c00a5[_0x5f62('0x2d')]&&_0x4c00a5[_0x5f62('0x29')]){if(_0x4c00a5[_0x5f62('0x4e')]){var _0xc8c98b={'method':'POST','uri':_0x4c00a5[_0x5f62('0x4e')]+_0x5f62('0x4f'),'body':{'username':_0x4c00a5[_0x5f62('0x2d')],'password':_0x4c00a5['password']},'json':!![]};return rp(_0xc8c98b)[_0x5f62('0x13')](function(_0x1e4fa4){var _0x4872fc={'method':'POST','uri':_0x4c00a5[_0x5f62('0x4e')]+_0x5f62('0x50'),'body':{'messages':[{'from':_0x4c00a5[_0x5f62('0x1f')],'destinations':[{'to':_0x503be6['phone']}],'text':_0x503be6[_0x5f62('0xb')],'notifyUrl':_0x4c00a5['remote']+'/api/sms/messages/'+_0x503be6['id']+'/status?token='+_0x4c00a5[_0x5f62('0x22')],'notifyContentType':_0x5f62('0x51'),'callbackData':_0x4c00a5[_0x5f62('0x1f')]+';'+_0x503be6[_0x5f62('0xb')]}]},'headers':{'Authorization':_0x5f62('0x52')+_0x1e4fa4[_0x5f62('0x22')]},'json':!![]};return rp(_0x4872fc)[_0x5f62('0x13')](function(_0x33b0f7){if(_0x33b0f7[_0x5f62('0x42')]){var _0x28c075={'messageId':_0x33b0f7[_0x5f62('0x42')][0x0][_0x5f62('0x9')]};if(!_0x4c00a5['deliveryReport']){_0x28c075[_0x5f62('0x34')]=!![];}return _0x5aa87c[_0x5f62('0x14')](_0x28c075);}else{return logger[_0x5f62('0x18')](_0x5f62('0x23'),'afterCreate',_0x5f62('0x4d'),util['inspect'](_0x33b0f7,{'showHidden':![],'depth':null}));}});})[_0x5f62('0x17')](function(_0x38afd6){return logger[_0x5f62('0x18')](_0x5f62('0x23'),_0x5f62('0x24'),_0x5f62('0x4d'),util[_0x5f62('0x25')](_0x38afd6,{'showHidden':![],'depth':null}));});}else{logger[_0x5f62('0x18')](_0x5f62('0x23'),'afterCreate',_0x5f62('0x4d'),_0x5f62('0x53'));}}else{logger['error'](_0x5f62('0x23'),_0x5f62('0x24'),'infobip',_0x5f62('0x35'));}break;case _0x5f62('0x54'):var _0x17cc78=require(_0x5f62('0x55'));if(_0x4c00a5['apiKey']){var _0x4ebbd2={};_0x4ebbd2[_0x5f62('0x56')]=_0x4c00a5['username'];_0x4ebbd2[_0x5f62('0x1f')]=_0x503be6[_0x5f62('0x1f')];_0x4ebbd2['sender']=_0x4c00a5[_0x5f62('0x1f')];_0x4ebbd2['text']=_0x503be6[_0x5f62('0xb')];_0x4ebbd2['timestamp']=+new Date();var _0x40d84d='';var _0x348035='';var _0x128a7c=Object[_0x5f62('0x57')](_0x4ebbd2);_0x128a7c[_0x5f62('0x58')]();for(var _0x104eca=0x0;_0x104eca<_0x128a7c['length'];_0x104eca++){if(_0x40d84d!=''){_0x40d84d+='&';}_0x40d84d+=_0x128a7c[_0x104eca]+'='+encodeURIComponent(_0x4ebbd2[_0x128a7c[_0x104eca]]);_0x348035+=_0x4ebbd2[_0x128a7c[_0x104eca]];}_0x348035+=_0x4c00a5[_0x5f62('0x59')];_0x348035=_0x17cc78[_0x5f62('0x5a')](_0x5f62('0x5b'))['update'](_0x348035)[_0x5f62('0x5c')](_0x5f62('0x5d'));if(_0x40d84d!==''){_0x40d84d+='&';}_0x40d84d+='signature='+_0x348035;var _0x207f97={'method':_0x5f62('0x5e'),'uri':_0x4c00a5['baseUrl']+'/external/get/send.php?'+_0x40d84d,'json':!![]};return rp(_0x207f97)[_0x5f62('0x13')](function(_0x44da88){var _0x1b71b4=Object[_0x5f62('0x57')](_0x44da88);if(_0x44da88[_0x1b71b4[0x0]][_0x5f62('0x18')]&&parseInt(_0x44da88[_0x1b71b4[0x0]][_0x5f62('0x18')])===0x0){var _0x5c67b3={'messageId':_0x44da88[_0x1b71b4[0x0]]['id_sms']};if(!_0x4c00a5[_0x5f62('0x33')]){_0x5c67b3[_0x5f62('0x34')]=!![];}return _0x5aa87c[_0x5f62('0x14')](_0x5c67b3);}else{return logger[_0x5f62('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x5f62('0x24'),_0x5f62('0x54'),util['inspect'](_0x44da88[_0x5f62('0x18')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x374aa9){return logger[_0x5f62('0x18')](_0x5f62('0x23'),'afterCreate',_0x5f62('0x54'),util[_0x5f62('0x25')](_0x374aa9,{'showHidden':![],'depth':null}));});}else{logger[_0x5f62('0x18')](_0x5f62('0x23'),'afterCreate',_0x5f62('0x54'),'Missing\x20parameters:\x20apiKey');}break;case'clickatell':if(_0x4c00a5[_0x5f62('0x59')]){var _0x405f64={'method':_0x5f62('0x2f'),'uri':_0x5f62('0x5f'),'headers':{'Authorization':_0x4c00a5[_0x5f62('0x59')]},'body':{'content':_0x503be6[_0x5f62('0xb')],'to':[_0x503be6['phone']],'from':_0x4c00a5[_0x5f62('0x1f')],'binary':![],'clientMessageId':_0x5f62('0x60'),'charset':_0x5f62('0x61')},'json':!![]};rp(_0x405f64)[_0x5f62('0x13')](function(_0xf03771){if(!_0xf03771[_0x5f62('0x18')]){var _0x1e8111={'messageId':_0xf03771[_0x5f62('0x42')][0x0][_0x5f62('0x62')]};if(!_0x4c00a5[_0x5f62('0x33')]){_0x1e8111[_0x5f62('0x34')]=!![];}return _0x5aa87c[_0x5f62('0x14')](_0x1e8111);}else{return logger[_0x5f62('0x18')](_0x5f62('0x23'),_0x5f62('0x24'),_0x5f62('0x63'),util[_0x5f62('0x25')](_0xf03771[_0x5f62('0x18')],{'showHidden':![],'depth':null}));}})[_0x5f62('0x17')](function(_0x3c99ac){return logger['error'](_0x5f62('0x23'),_0x5f62('0x24'),_0x5f62('0x63'),util['inspect'](_0x3c99ac,{'showHidden':![],'depth':null}));});}else{logger[_0x5f62('0x18')](_0x5f62('0x23'),'afterCreate',_0x5f62('0x63'),_0x5f62('0x64'));}break;case _0x5f62('0x65'):if(_0x4c00a5[_0x5f62('0x59')]){var _0x12cac1={};var _0x207f97={'method':_0x5f62('0x2f'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':'Bearer\x20'+_0x4c00a5[_0x5f62('0x59')],'Content-Type':_0x5f62('0x51')},'body':{'from':_0x4c00a5['phone'],'to':_0x503be6['phone'],'text':_0x503be6['body']},'json':!![]};return rp(_0x207f97)[_0x5f62('0x13')](function(_0xb4157e){if(_0xb4157e[_0x5f62('0x66')]==0xca){_0x12cac1[_0x5f62('0x67')]=_0xb4157e;var _0x59d8ab={'method':_0x5f62('0x2f'),'uri':_0x5f62('0x68'),'headers':{'Authorization':_0x5f62('0x69')+_0x4c00a5[_0x5f62('0x59')],'Content-Type':_0x5f62('0x51')},'body':{'refid':_0x12cac1['message']['refid']},'json':!![]};return rp(_0x59d8ab)[_0x5f62('0x13')](function(_0x66c81c){_0x12cac1[_0x5f62('0x6a')]=_0x66c81c;var _0x5af170={'messageId':_0x12cac1['message'][_0x5f62('0x6b')],'read':!![]};return _0x5aa87c[_0x5f62('0x14')](_0x5af170);});}else{return logger[_0x5f62('0x18')](_0x5f62('0x23'),'afterCreate',_0x5f62('0x65'),util[_0x5f62('0x25')](_0xb4157e,{'showHidden':![],'depth':null}));}})[_0x5f62('0x17')](function(_0x472b1c){return logger[_0x5f62('0x18')](_0x5f62('0x23'),_0x5f62('0x24'),_0x5f62('0x65'),util[_0x5f62('0x25')](_0x472b1c,{'showHidden':![],'depth':null}));});}else{return logger[_0x5f62('0x18')](_0x5f62('0x23'),'afterCreate','intelepeer','Token\x20not\x20received');}break;}}})[_0x5f62('0x6c')](function(){_0x13ea11();});}else{_0x13ea11();}}},'charset':_0x5f62('0x6d'),'collate':_0x5f62('0x6e')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 209f989..43721ae 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 _0xb10b=['options','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./smsMessage.socket','register','request','then','info','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsMessage,\x20%s,\x20%s','message','result','catch','CreateSmsMessage','SmsMessage','body'];(function(_0x1f689e,_0x1c3e0d){var _0x535029=function(_0x42fb3c){while(--_0x42fb3c){_0x1f689e['push'](_0x1f689e['shift']());}};_0x535029(++_0x1c3e0d);}(_0xb10b,0x12a));var _0xbb10=function(_0x41ef02,_0x101e1a){_0x41ef02=_0x41ef02-0x0;var _0x5e6995=_0xb10b[_0x41ef02];return _0x5e6995;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});config[_0xbb10('0xb')]=_['defaults'](config[_0xbb10('0xb')],{'host':_0xbb10('0xc'),'port':0x18eb});var socket=require(_0xbb10('0xd'))(new Redis(config[_0xbb10('0xb')]));require(_0xbb10('0xe'))[_0xbb10('0xf')](socket);function respondWithRpcPromise(_0x229887,_0xa3adc8,_0x5ab04a){return new BPromise(function(_0x4e47f8,_0x20bd61){return client[_0xbb10('0x10')](_0x229887,_0x5ab04a)[_0xbb10('0x11')](function(_0x5e136d){logger[_0xbb10('0x12')]('SmsMessage,\x20%s,\x20%s',_0xa3adc8,_0xbb10('0x13'));logger[_0xbb10('0x14')](_0xbb10('0x15'),_0xa3adc8,_0xbb10('0x13'),JSON[_0xbb10('0x16')](_0x5e136d));if(_0x5e136d[_0xbb10('0x17')]){if(_0x5e136d['error'][_0xbb10('0x18')]===0x1f4){logger[_0xbb10('0x17')](_0xbb10('0x19'),_0xa3adc8,_0x5e136d[_0xbb10('0x17')][_0xbb10('0x1a')]);return _0x20bd61(_0x5e136d[_0xbb10('0x17')][_0xbb10('0x1a')]);}logger[_0xbb10('0x17')](_0xbb10('0x19'),_0xa3adc8,_0x5e136d[_0xbb10('0x17')]['message']);return _0x4e47f8(_0x5e136d[_0xbb10('0x17')][_0xbb10('0x1a')]);}else{logger[_0xbb10('0x12')](_0xbb10('0x19'),_0xa3adc8,_0xbb10('0x13'));_0x4e47f8(_0x5e136d[_0xbb10('0x1b')][_0xbb10('0x1a')]);}})[_0xbb10('0x1c')](function(_0xbf2906){logger[_0xbb10('0x17')]('SmsMessage,\x20%s,\x20%s',_0xa3adc8,_0xbf2906);_0x20bd61(_0xbf2906);});});}exports[_0xbb10('0x1d')]=function(_0x19f48d){var _0x388fab=this;return new Promise(function(_0x109908,_0xdf237d){return db[_0xbb10('0x1e')]['create'](_0x19f48d[_0xbb10('0x1f')],{'raw':_0x19f48d[_0xbb10('0x20')]?_0x19f48d['options']['raw']===undefined?!![]:![]:!![]})[_0xbb10('0x11')](function(_0x311abe){logger[_0xbb10('0x12')](_0xbb10('0x1d'),_0x19f48d);logger[_0xbb10('0x14')](_0xbb10('0x1d'),_0x19f48d,JSON[_0xbb10('0x16')](_0x311abe));_0x109908(_0x311abe);})[_0xbb10('0x1c')](function(_0x7f2377){logger[_0xbb10('0x17')](_0xbb10('0x1d'),_0x7f2377[_0xbb10('0x1a')],_0x19f48d);_0xdf237d(_0x388fab['error'](0x1f4,_0x7f2377['message']));});});}; \ No newline at end of file +var _0x14a0=['code','message','result','catch','CreateSmsMessage','SmsMessage','create','body','options','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','defaults','redis','localhost','./smsMessage.socket','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1c289a,_0x20687a){var _0x41d99f=function(_0xcdce97){while(--_0xcdce97){_0x1c289a['push'](_0x1c289a['shift']());}};_0x41d99f(++_0x20687a);}(_0x14a0,0x8e));var _0x014a=function(_0x4cd7a4,_0x400703){_0x4cd7a4=_0x4cd7a4-0x0;var _0x2353e8=_0x14a0[_0x4cd7a4];return _0x2353e8;};'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});config['redis']=_[_0x014a('0xa')](config[_0x014a('0xb')],{'host':_0x014a('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x014a('0xd'))['register'](socket);function respondWithRpcPromise(_0x490ea2,_0x5aa52f,_0x4f3539){return new BPromise(function(_0x330469,_0x4c7418){return client[_0x014a('0xe')](_0x490ea2,_0x4f3539)[_0x014a('0xf')](function(_0x543bbf){logger[_0x014a('0x10')](_0x014a('0x11'),_0x5aa52f,_0x014a('0x12'));logger[_0x014a('0x13')](_0x014a('0x14'),_0x5aa52f,_0x014a('0x12'),JSON[_0x014a('0x15')](_0x543bbf));if(_0x543bbf[_0x014a('0x16')]){if(_0x543bbf[_0x014a('0x16')][_0x014a('0x17')]===0x1f4){logger[_0x014a('0x16')](_0x014a('0x11'),_0x5aa52f,_0x543bbf['error'][_0x014a('0x18')]);return _0x4c7418(_0x543bbf[_0x014a('0x16')]['message']);}logger[_0x014a('0x16')](_0x014a('0x11'),_0x5aa52f,_0x543bbf['error'][_0x014a('0x18')]);return _0x330469(_0x543bbf[_0x014a('0x16')][_0x014a('0x18')]);}else{logger[_0x014a('0x10')](_0x014a('0x11'),_0x5aa52f,_0x014a('0x12'));_0x330469(_0x543bbf[_0x014a('0x19')][_0x014a('0x18')]);}})[_0x014a('0x1a')](function(_0x3b9341){logger[_0x014a('0x16')](_0x014a('0x11'),_0x5aa52f,_0x3b9341);_0x4c7418(_0x3b9341);});});}exports[_0x014a('0x1b')]=function(_0x34e5c3){var _0x5c69c5=this;return new Promise(function(_0x359903,_0x109a9c){return db[_0x014a('0x1c')][_0x014a('0x1d')](_0x34e5c3[_0x014a('0x1e')],{'raw':_0x34e5c3[_0x014a('0x1f')]?_0x34e5c3[_0x014a('0x1f')][_0x014a('0x20')]===undefined?!![]:![]:!![]})[_0x014a('0xf')](function(_0x486e66){logger[_0x014a('0x10')]('CreateSmsMessage',_0x34e5c3);logger[_0x014a('0x13')](_0x014a('0x1b'),_0x34e5c3,JSON[_0x014a('0x15')](_0x486e66));_0x359903(_0x486e66);})[_0x014a('0x1a')](function(_0x2b3c10){logger[_0x014a('0x16')](_0x014a('0x1b'),_0x2b3c10[_0x014a('0x18')],_0x34e5c3);_0x109a9c(_0x5c69c5[_0x014a('0x16')](0x1f4,_0x2b3c10['message']));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 402280b..083fafd 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 _0xf0cd=['update','emit','register','length','smsMessage:','./smsMessage.events','save','remove'];(function(_0x5eced8,_0x380622){var _0xd013fa=function(_0x266d41){while(--_0x266d41){_0x5eced8['push'](_0x5eced8['shift']());}};_0xd013fa(++_0x380622);}(_0xf0cd,0x8d));var _0xdf0c=function(_0x5de0a2,_0x58c8e2){_0x5de0a2=_0x5de0a2-0x0;var _0x2afc43=_0xf0cd[_0x5de0a2];return _0x2afc43;};'use strict';var SmsMessageEvents=require(_0xdf0c('0x0'));var events=[_0xdf0c('0x1'),_0xdf0c('0x2'),_0xdf0c('0x3')];function createListener(_0x36af5b,_0x542643){return function(_0x439892){_0x542643[_0xdf0c('0x4')](_0x36af5b,_0x439892);};}function removeListener(_0x413eb7,_0x4b40e7){return function(){SmsMessageEvents['removeListener'](_0x413eb7,_0x4b40e7);};}exports[_0xdf0c('0x5')]=function(_0x250466){for(var _0xfce832=0x0,_0x353a7e=events[_0xdf0c('0x6')];_0xfce832<_0x353a7e;_0xfce832++){var _0x5944a9=events[_0xfce832];var _0x58651f=createListener(_0xdf0c('0x7')+_0x5944a9,_0x250466);SmsMessageEvents['on'](_0x5944a9,_0x58651f);}}; \ No newline at end of file +var _0x0a77=['./smsMessage.events','save','remove','update','emit','register','length','smsMessage:'];(function(_0x33662e,_0x472c7b){var _0x2e2082=function(_0x4d59d4){while(--_0x4d59d4){_0x33662e['push'](_0x33662e['shift']());}};_0x2e2082(++_0x472c7b);}(_0x0a77,0x1c0));var _0x70a7=function(_0x346b83,_0x410f32){_0x346b83=_0x346b83-0x0;var _0x2544be=_0x0a77[_0x346b83];return _0x2544be;};'use strict';var SmsMessageEvents=require(_0x70a7('0x0'));var events=[_0x70a7('0x1'),_0x70a7('0x2'),_0x70a7('0x3')];function createListener(_0x3e2d0d,_0x5724ec){return function(_0x17f774){_0x5724ec[_0x70a7('0x4')](_0x3e2d0d,_0x17f774);};}function removeListener(_0x4e05d7,_0x593b53){return function(){SmsMessageEvents['removeListener'](_0x4e05d7,_0x593b53);};}exports[_0x70a7('0x5')]=function(_0x5ebaee){for(var _0x40d542=0x0,_0x31b5ea=events[_0x70a7('0x6')];_0x40d542<_0x31b5ea;_0x40d542++){var _0x2e7f7c=events[_0x40d542];var _0x5b12e8=createListener(_0x70a7('0x7')+_0x2e7f7c,_0x5ebaee);SmsMessageEvents['on'](_0x2e7f7c,_0x5b12e8);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 8090ab4..c0fc115 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 _0x535d=['post','create','put','update','destroy','delete','exports','multer','util','connect-timeout','express','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','index','describe','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents'];(function(_0x29d36a,_0x3d9af5){var _0x1b8775=function(_0x235368){while(--_0x235368){_0x29d36a['push'](_0x29d36a['shift']());}};_0x1b8775(++_0x3d9af5);}(_0x535d,0xe8));var _0xd535=function(_0x1ca5a9,_0x2a61f4){_0x1ca5a9=_0x1ca5a9-0x0;var _0x23fb3f=_0x535d[_0x1ca5a9];return _0x23fb3f;};'use strict';var multer=require(_0xd535('0x0'));var util=require(_0xd535('0x1'));var path=require('path');var timeout=require(_0xd535('0x2'));var express=require(_0xd535('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xd535('0x4'));var config=require(_0xd535('0x5'));var controller=require(_0xd535('0x6'));router[_0xd535('0x7')]('/',auth[_0xd535('0x8')](),controller[_0xd535('0x9')]);router['get']('/describe',auth[_0xd535('0x8')](),controller[_0xd535('0xa')]);router['get'](_0xd535('0xb'),auth['isAuthenticated'](),controller[_0xd535('0xc')]);router[_0xd535('0x7')](_0xd535('0xd'),auth[_0xd535('0x8')](),controller['getMembers']);router[_0xd535('0x7')](_0xd535('0xe'),auth[_0xd535('0x8')](),controller[_0xd535('0xf')]);router['get'](_0xd535('0x10'),auth[_0xd535('0x8')](),controller[_0xd535('0x11')]);router[_0xd535('0x12')]('/',auth[_0xd535('0x8')](),controller[_0xd535('0x13')]);router[_0xd535('0x12')]('/:id/teams',auth[_0xd535('0x8')](),controller['addTeams']);router['post'](_0xd535('0x10'),auth[_0xd535('0x8')](),controller['addAgents']);router[_0xd535('0x14')](_0xd535('0xb'),auth[_0xd535('0x8')](),controller[_0xd535('0x15')]);router['delete'](_0xd535('0xb'),auth[_0xd535('0x8')](),controller[_0xd535('0x16')]);router[_0xd535('0x17')]('/:id/teams',auth[_0xd535('0x8')](),controller['removeTeams']);router[_0xd535('0x17')]('/:id/users',auth[_0xd535('0x8')](),controller['removeAgents']);module[_0xd535('0x18')]=router; \ No newline at end of file +var _0x0b78=['/:id/users','post','create','/:id/teams','addTeams','update','delete','destroy','removeTeams','exports','util','path','connect-timeout','Router','../../components/auth/service','get','isAuthenticated','index','/describe','/:id','/:id/members','getMembers','getTeams'];(function(_0x43834f,_0x2e74fe){var _0x56f6d6=function(_0x5a70a3){while(--_0x5a70a3){_0x43834f['push'](_0x43834f['shift']());}};_0x56f6d6(++_0x2e74fe);}(_0x0b78,0x1d6));var _0x80b7=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x0b78[_0x42cae2];return _0x5f256f;};'use strict';var multer=require('multer');var util=require(_0x80b7('0x0'));var path=require(_0x80b7('0x1'));var timeout=require(_0x80b7('0x2'));var express=require('express');var router=express[_0x80b7('0x3')]();var auth=require(_0x80b7('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./smsQueue.controller');router[_0x80b7('0x5')]('/',auth[_0x80b7('0x6')](),controller[_0x80b7('0x7')]);router[_0x80b7('0x5')](_0x80b7('0x8'),auth[_0x80b7('0x6')](),controller['describe']);router[_0x80b7('0x5')](_0x80b7('0x9'),auth[_0x80b7('0x6')](),controller['show']);router['get'](_0x80b7('0xa'),auth['isAuthenticated'](),controller[_0x80b7('0xb')]);router[_0x80b7('0x5')]('/:id/teams',auth[_0x80b7('0x6')](),controller[_0x80b7('0xc')]);router[_0x80b7('0x5')](_0x80b7('0xd'),auth['isAuthenticated'](),controller['getAgents']);router[_0x80b7('0xe')]('/',auth[_0x80b7('0x6')](),controller[_0x80b7('0xf')]);router[_0x80b7('0xe')](_0x80b7('0x10'),auth[_0x80b7('0x6')](),controller[_0x80b7('0x11')]);router[_0x80b7('0xe')](_0x80b7('0xd'),auth['isAuthenticated'](),controller['addAgents']);router['put']('/:id',auth[_0x80b7('0x6')](),controller[_0x80b7('0x12')]);router[_0x80b7('0x13')](_0x80b7('0x9'),auth[_0x80b7('0x6')](),controller[_0x80b7('0x14')]);router[_0x80b7('0x13')](_0x80b7('0x10'),auth[_0x80b7('0x6')](),controller[_0x80b7('0x15')]);router[_0x80b7('0x13')](_0x80b7('0xd'),auth[_0x80b7('0x6')](),controller['removeAgents']);module[_0x80b7('0x16')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index d7ecb10..4544d28 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 _0x544a=['STRING','name','INTEGER','ENUM','rrmemory','roundrobin','sequelize','exports'];(function(_0x409ef4,_0x435589){var _0x50036b=function(_0x4d12ff){while(--_0x4d12ff){_0x409ef4['push'](_0x409ef4['shift']());}};_0x50036b(++_0x435589);}(_0x544a,0x156));var _0xa544=function(_0x481bdf,_0x231538){_0x481bdf=_0x481bdf-0x0;var _0x281a12=_0x544a[_0x481bdf];return _0x281a12;};'use strict';var Sequelize=require(_0xa544('0x0'));module[_0xa544('0x1')]={'name':{'type':Sequelize[_0xa544('0x2')],'unique':_0xa544('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa544('0x2')]},'timeout':{'type':Sequelize[_0xa544('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa544('0x5')](_0xa544('0x6'),'beepall',_0xa544('0x7'))}}; \ No newline at end of file +var _0xee01=['INTEGER','beepall','sequelize','exports','STRING','name'];(function(_0x167a64,_0x1bfe5b){var _0x55ca9c=function(_0x76fa6d){while(--_0x76fa6d){_0x167a64['push'](_0x167a64['shift']());}};_0x55ca9c(++_0x1bfe5b);}(_0xee01,0xf8));var _0x1ee0=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xee01[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x1ee0('0x0'));module[_0x1ee0('0x1')]={'name':{'type':Sequelize[_0x1ee0('0x2')],'unique':_0x1ee0('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x1ee0('0x2')]},'timeout':{'type':Sequelize[_0x1ee0('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x1ee0('0x5'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 522ebe8..6302e58 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 _0x1a85=['../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','status','json','count','offset','limit','set','Content-Range','save','then','destroy','get','SmsQueues','UserProfileResource','error','stack','name','send','index','map','SmsQueue','rawAttributes','fieldName','key','model','query','intersection','fields','attributes','hasOwnProperty','order','where','filters','pick','filter','VIRTUAL','merge','includeAll','findAll','rows','catch','show','params','keys','length','options','find','create','body','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','findOne','UserSmsQueue','sort','User','agent','smsPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','nolimit','addTeams','ids','Team','Agents','online','sequelize','transaction','each','findOrCreate','forEach','removeTeams','select','field','from','team_has_sms_queues','join','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','all','union','compact','value','removeAgents','emit','userSmsQueue:remove','addAgents','userSmsQueue:save','isArray','getAgents','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','ejs','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0xf99391,_0x1d9384){var _0x3703e=function(_0x277e5c){while(--_0x277e5c){_0xf99391['push'](_0xf99391['shift']());}};_0x3703e(++_0x1d9384);}(_0x1a85,0x178));var _0x51a8=function(_0x5d6238,_0xe6992b){_0x5d6238=_0x5d6238-0x0;var _0x46ac6b=_0x1a85[_0x5d6238];return _0x46ac6b;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x51a8('0x0'));var zipdir=require(_0x51a8('0x1'));var jsonpatch=require(_0x51a8('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x51a8('0x3'));var Mustache=require(_0x51a8('0x4'));var util=require(_0x51a8('0x5'));var path=require('path');var sox=require(_0x51a8('0x6'));var csv=require('to-csv');var ejs=require(_0x51a8('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0x51a8('0x8'));var crypto=require(_0x51a8('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x51a8('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x51a8('0xb'));var Redis=require(_0x51a8('0xc'));var authService=require(_0x51a8('0xd'));var qs=require(_0x51a8('0xe'));var as=require(_0x51a8('0xf'));var hardwareService=require(_0x51a8('0x10'));var logger=require(_0x51a8('0x11'))(_0x51a8('0x12'));var utils=require(_0x51a8('0x13'));var config=require(_0x51a8('0x14'));var db=require(_0x51a8('0x15'))['db'];config[_0x51a8('0x16')]=_[_0x51a8('0x17')](config[_0x51a8('0x16')],{'host':_0x51a8('0x18'),'port':0x18eb});var socket=require(_0x51a8('0x19'))(new Redis(config[_0x51a8('0x16')]));require('./smsQueue.socket')[_0x51a8('0x1a')](socket);function respondWithStatusCode(_0x7a4c36,_0xaec066){_0xaec066=_0xaec066||0xcc;return function(_0x50d992){if(_0x50d992){return _0x7a4c36[_0x51a8('0x1b')](_0xaec066);}return _0x7a4c36['status'](_0xaec066)[_0x51a8('0x1c')]();};}function respondWithResult(_0x2b8d37,_0x39cd45){_0x39cd45=_0x39cd45||0xc8;return function(_0x2b0521){if(_0x2b0521){return _0x2b8d37[_0x51a8('0x1d')](_0x39cd45)[_0x51a8('0x1e')](_0x2b0521);}};}function respondWithFilteredResult(_0x1f49ee,_0x516abc){return function(_0x1c2f25){if(_0x1c2f25){var _0x45a433=_0x1c2f25[_0x51a8('0x1f')],_0xd52230=_0x516abc['offset'],_0x23539e=_0x516abc[_0x51a8('0x20')]+_0x516abc[_0x51a8('0x21')],_0x3bc1a2;if(_0x23539e>=_0x45a433){_0x23539e=_0x45a433;_0x3bc1a2=0xc8;}else{_0x3bc1a2=0xce;}_0x1f49ee[_0x51a8('0x1d')](_0x3bc1a2);return _0x1f49ee[_0x51a8('0x22')](_0x51a8('0x23'),_0xd52230+'-'+_0x23539e+'/'+_0x45a433)[_0x51a8('0x1e')](_0x1c2f25);}return null;};}function patchUpdates(_0x28aea0){return function(_0x3bf5b6){try{jsonpatch['apply'](_0x3bf5b6,_0x28aea0,!![]);}catch(_0xf80fa9){return BPromise['reject'](_0xf80fa9);}return _0x3bf5b6[_0x51a8('0x24')]();};}function saveUpdates(_0x12c029,_0x8bda40){return function(_0x3759d6){if(_0x3759d6){return _0x3759d6['update'](_0x12c029)[_0x51a8('0x25')](function(_0x4b9cdd){return _0x4b9cdd;});}return null;};}function removeEntity(_0x47f063,_0x23d26a){return function(_0x52e503){if(_0x52e503){return _0x52e503[_0x51a8('0x26')]()[_0x51a8('0x25')](function(){var _0x20ef8b=_0x52e503[_0x51a8('0x27')]({'plain':!![]});var _0x157554=_0x51a8('0x28');return db[_0x51a8('0x29')][_0x51a8('0x26')]({'where':{'type':_0x157554,'resourceId':_0x20ef8b['id']}})['then'](function(){return _0x52e503;});})[_0x51a8('0x25')](function(){_0x47f063[_0x51a8('0x1d')](0xcc)[_0x51a8('0x1c')]();});}};}function handleEntityNotFound(_0x3da187,_0x1c150d){return function(_0x11aefc){if(!_0x11aefc){_0x3da187[_0x51a8('0x1b')](0x194);}return _0x11aefc;};}function handleError(_0x2742f5,_0xec08ae){_0xec08ae=_0xec08ae||0x1f4;return function(_0x4b5cda){logger[_0x51a8('0x2a')](_0x4b5cda[_0x51a8('0x2b')]);if(_0x4b5cda['name']){delete _0x4b5cda[_0x51a8('0x2c')];}_0x2742f5['status'](_0xec08ae)[_0x51a8('0x2d')](_0x4b5cda);};}exports[_0x51a8('0x2e')]=function(_0x143f46,_0x41df56){var _0x2136b4={},_0x4ea271={},_0x10c19b={'count':0x0,'rows':[]};var _0x4c67ff=_[_0x51a8('0x2f')](db[_0x51a8('0x30')][_0x51a8('0x31')],function(_0x4b19c8){return{'name':_0x4b19c8[_0x51a8('0x32')],'type':_0x4b19c8['type'][_0x51a8('0x33')]};});_0x4ea271[_0x51a8('0x34')]=_[_0x51a8('0x2f')](_0x4c67ff,_0x51a8('0x2c'));_0x4ea271[_0x51a8('0x35')]=_['keys'](_0x143f46[_0x51a8('0x35')]);_0x4ea271['filters']=_[_0x51a8('0x36')](_0x4ea271[_0x51a8('0x34')],_0x4ea271[_0x51a8('0x35')]);_0x2136b4['attributes']=_[_0x51a8('0x36')](_0x4ea271[_0x51a8('0x34')],qs[_0x51a8('0x37')](_0x143f46[_0x51a8('0x35')][_0x51a8('0x37')]));_0x2136b4['attributes']=_0x2136b4['attributes']['length']?_0x2136b4[_0x51a8('0x38')]:_0x4ea271[_0x51a8('0x34')];if(!_0x143f46['query'][_0x51a8('0x39')]('nolimit')){_0x2136b4[_0x51a8('0x21')]=qs[_0x51a8('0x21')](_0x143f46[_0x51a8('0x35')][_0x51a8('0x21')]);_0x2136b4[_0x51a8('0x20')]=qs[_0x51a8('0x20')](_0x143f46['query']['offset']);}_0x2136b4[_0x51a8('0x3a')]=qs['sort'](_0x143f46['query']['sort']);_0x2136b4[_0x51a8('0x3b')]=qs[_0x51a8('0x3c')](_[_0x51a8('0x3d')](_0x143f46['query'],_0x4ea271[_0x51a8('0x3c')]));if(_0x143f46[_0x51a8('0x35')][_0x51a8('0x3e')]){_0x2136b4[_0x51a8('0x3b')]=_['merge'](_0x2136b4[_0x51a8('0x3b')],{'$or':_[_0x51a8('0x2f')](_0x4c67ff,function(_0x1b0333){if(_0x1b0333['type']!==_0x51a8('0x3f')){var _0x51d7bd={};_0x51d7bd[_0x1b0333[_0x51a8('0x2c')]]={'$like':'%'+_0x143f46[_0x51a8('0x35')][_0x51a8('0x3e')]+'%'};return _0x51d7bd;}})});}_0x2136b4=_[_0x51a8('0x40')]({},_0x2136b4,_0x143f46['options']);var _0x8e248={'where':_0x2136b4[_0x51a8('0x3b')]};return db[_0x51a8('0x30')][_0x51a8('0x1f')](_0x8e248)[_0x51a8('0x25')](function(_0x35c1c9){_0x10c19b[_0x51a8('0x1f')]=_0x35c1c9;if(_0x143f46[_0x51a8('0x35')][_0x51a8('0x41')]){_0x2136b4['include']=[{'all':!![]}];}return db[_0x51a8('0x30')][_0x51a8('0x42')](_0x2136b4);})['then'](function(_0x53409d){_0x10c19b[_0x51a8('0x43')]=_0x53409d;return _0x10c19b;})[_0x51a8('0x25')](respondWithFilteredResult(_0x41df56,_0x2136b4))[_0x51a8('0x44')](handleError(_0x41df56,null));};exports[_0x51a8('0x45')]=function(_0x311574,_0x157a51){var _0x28f5b3={'raw':!![],'where':{'id':_0x311574[_0x51a8('0x46')]['id']}},_0x18c697={};_0x18c697[_0x51a8('0x34')]=_['keys'](db[_0x51a8('0x30')][_0x51a8('0x31')]);_0x18c697[_0x51a8('0x35')]=_[_0x51a8('0x47')](_0x311574[_0x51a8('0x35')]);_0x18c697[_0x51a8('0x3c')]=_['intersection'](_0x18c697[_0x51a8('0x34')],_0x18c697['query']);_0x28f5b3[_0x51a8('0x38')]=_[_0x51a8('0x36')](_0x18c697[_0x51a8('0x34')],qs[_0x51a8('0x37')](_0x311574[_0x51a8('0x35')]['fields']));_0x28f5b3['attributes']=_0x28f5b3[_0x51a8('0x38')][_0x51a8('0x48')]?_0x28f5b3[_0x51a8('0x38')]:_0x18c697[_0x51a8('0x34')];if(_0x311574[_0x51a8('0x35')]['includeAll']){_0x28f5b3['include']=[{'all':!![]}];}_0x28f5b3=_[_0x51a8('0x40')]({},_0x28f5b3,_0x311574[_0x51a8('0x49')]);return db[_0x51a8('0x30')][_0x51a8('0x4a')](_0x28f5b3)[_0x51a8('0x25')](handleEntityNotFound(_0x157a51,null))[_0x51a8('0x25')](respondWithResult(_0x157a51,null))[_0x51a8('0x44')](handleError(_0x157a51,null));};exports[_0x51a8('0x4b')]=function(_0x301578,_0x4d29ab){return db['SmsQueue']['create'](_0x301578[_0x51a8('0x4c')],{})[_0x51a8('0x25')](function(_0x103897){var _0x5259f3=_0x301578[_0x51a8('0x4d')][_0x51a8('0x27')]({'plain':!![]});if(!_0x5259f3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5259f3[_0x51a8('0x4e')]==='user'){var _0x50a2f8=_0x103897[_0x51a8('0x27')]({'plain':!![]});var _0x4393c9=_0x51a8('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x4393c9,'userProfileId':_0x5259f3[_0x51a8('0x4f')]},'raw':!![]})['then'](function(_0x21c4da){if(_0x21c4da&&_0x21c4da[_0x51a8('0x50')]===0x0){return db[_0x51a8('0x29')][_0x51a8('0x4b')]({'name':_0x50a2f8[_0x51a8('0x2c')],'resourceId':_0x50a2f8['id'],'type':_0x21c4da[_0x51a8('0x2c')],'sectionId':_0x21c4da['id']},{})[_0x51a8('0x25')](function(){return _0x103897;});}else{return _0x103897;}})[_0x51a8('0x44')](function(_0x29d31e){logger['error'](_0x51a8('0x51'),_0x29d31e);throw _0x29d31e;});}return _0x103897;})[_0x51a8('0x25')](respondWithResult(_0x4d29ab,0xc9))[_0x51a8('0x44')](handleError(_0x4d29ab,null));};exports[_0x51a8('0x52')]=function(_0x533cfa,_0x13b7ba){if(_0x533cfa['body']['id']){delete _0x533cfa[_0x51a8('0x4c')]['id'];}return db[_0x51a8('0x30')]['find']({'where':{'id':_0x533cfa['params']['id']}})[_0x51a8('0x25')](handleEntityNotFound(_0x13b7ba,null))[_0x51a8('0x25')](saveUpdates(_0x533cfa[_0x51a8('0x4c')],null))[_0x51a8('0x25')](respondWithResult(_0x13b7ba,null))[_0x51a8('0x44')](handleError(_0x13b7ba,null));};exports['destroy']=function(_0x43b79a,_0xd1ddd5){return db[_0x51a8('0x30')][_0x51a8('0x4a')]({'where':{'id':_0x43b79a[_0x51a8('0x46')]['id']}})['then'](handleEntityNotFound(_0xd1ddd5,null))[_0x51a8('0x25')](removeEntity(_0xd1ddd5,null))[_0x51a8('0x44')](handleError(_0xd1ddd5,null));};exports[_0x51a8('0x53')]=function(_0x3e43cc,_0x62966a){return db[_0x51a8('0x30')]['describe']()['then'](respondWithResult(_0x62966a,null))['catch'](handleError(_0x62966a,null));};exports['getMembers']=function(_0x2048c6,_0x1df9cc,_0x51f9f7){var _0x7ac0ae={'raw':!![],'where':{}},_0x56d3d7={},_0x41cc00;return db['SmsQueue'][_0x51a8('0x54')]({'where':{'id':_0x2048c6[_0x51a8('0x46')]['id']}})['then'](handleEntityNotFound(_0x1df9cc,null))['then'](function(_0x5eb540){if(_0x5eb540){_0x41cc00=_0x5eb540[_0x51a8('0x27')]({'plain':!![]});_0x56d3d7[_0x51a8('0x34')]=_[_0x51a8('0x47')](db[_0x51a8('0x55')][_0x51a8('0x31')]);_0x56d3d7[_0x51a8('0x35')]=_[_0x51a8('0x47')](_0x2048c6[_0x51a8('0x35')]);_0x56d3d7['filters']=_[_0x51a8('0x36')](_0x56d3d7[_0x51a8('0x34')],_0x56d3d7['query']);_0x7ac0ae[_0x51a8('0x38')]=_[_0x51a8('0x36')](_0x56d3d7[_0x51a8('0x34')],qs[_0x51a8('0x37')](_0x2048c6[_0x51a8('0x35')][_0x51a8('0x37')]));_0x7ac0ae['attributes']=_0x7ac0ae['attributes'][_0x51a8('0x48')]?_0x7ac0ae['attributes']:_0x56d3d7['model'];if(!_0x2048c6['query']['hasOwnProperty']('nolimit')){_0x7ac0ae[_0x51a8('0x21')]=qs['limit'](_0x2048c6[_0x51a8('0x35')][_0x51a8('0x21')]);_0x7ac0ae[_0x51a8('0x20')]=qs[_0x51a8('0x20')](_0x2048c6[_0x51a8('0x35')][_0x51a8('0x20')]);}_0x7ac0ae[_0x51a8('0x3a')]=qs[_0x51a8('0x56')](_0x2048c6[_0x51a8('0x35')][_0x51a8('0x56')]);_0x7ac0ae['where']=qs[_0x51a8('0x3c')](_[_0x51a8('0x3d')](_0x2048c6[_0x51a8('0x35')],_0x56d3d7['filters']));_0x7ac0ae['where']['SmsQueueId']=_0x5eb540['id'];if(_0x2048c6[_0x51a8('0x35')][_0x51a8('0x3e')]){_0x7ac0ae[_0x51a8('0x3b')]=_[_0x51a8('0x40')](_0x7ac0ae[_0x51a8('0x3b')],{'$or':_[_0x51a8('0x2f')](_0x7ac0ae[_0x51a8('0x38')],function(_0x418445){var _0x2813eb={};_0x2813eb[_0x418445]={'$like':'%'+_0x2048c6[_0x51a8('0x35')][_0x51a8('0x3e')]+'%'};return _0x2813eb;})});}_0x7ac0ae=_[_0x51a8('0x40')]({},_0x7ac0ae,_0x2048c6[_0x51a8('0x49')]);return db['UserSmsQueue'][_0x51a8('0x42')](_0x7ac0ae);}})[_0x51a8('0x25')](function(_0x52077e){if(_0x52077e){return db[_0x51a8('0x57')]['findAndCountAll']({'where':{'id':_['map'](_0x52077e,'UserId'),'role':_0x51a8('0x58')},'attributes':['id',_0x51a8('0x2c'),_0x51a8('0x59'),_0x51a8('0x5a'),_0x51a8('0x5b')]});}})[_0x51a8('0x25')](function(_0x8fe514){if(_0x8fe514){return{'count':_0x8fe514['count'],'rows':_['map'](_0x8fe514['rows'],function(_0x44e496){return{'membername':_0x44e496[_0x51a8('0x2c')],'UserId':_0x44e496['id'],'queue_name':_0x41cc00[_0x51a8('0x2c')],'SmsQueueId':_0x41cc00['id'],'interface':util[_0x51a8('0x5c')](_0x51a8('0x5d'),_0x51a8('0x5e'),_0x44e496['name']),'penalty':0x0,'paused':_0x44e496[_0x51a8('0x59')],'createdAt':_0x44e496['createdAt'],'updatedAt':_0x44e496[_0x51a8('0x5a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x51a8('0x25')](respondWithFilteredResult(_0x1df9cc,_0x7ac0ae))[_0x51a8('0x44')](handleError(_0x1df9cc,null));};exports[_0x51a8('0x5f')]=function(_0x149a40,_0x3aca4a,_0x895b42){var _0xc751c3={};var _0x3540cd={};var _0x39fcef;var _0x2289d9;return db['SmsQueue']['findOne']({'where':{'id':_0x149a40[_0x51a8('0x46')]['id']}})[_0x51a8('0x25')](handleEntityNotFound(_0x3aca4a,null))[_0x51a8('0x25')](function(_0x226ca4){if(_0x226ca4){_0x39fcef=_0x226ca4;_0x3540cd['model']=_[_0x51a8('0x47')](db['Team'][_0x51a8('0x31')]);_0x3540cd[_0x51a8('0x35')]=_[_0x51a8('0x47')](_0x149a40[_0x51a8('0x35')]);_0x3540cd[_0x51a8('0x3c')]=_[_0x51a8('0x36')](_0x3540cd[_0x51a8('0x34')],_0x3540cd[_0x51a8('0x35')]);_0xc751c3[_0x51a8('0x38')]=_['intersection'](_0x3540cd[_0x51a8('0x34')],qs[_0x51a8('0x37')](_0x149a40[_0x51a8('0x35')][_0x51a8('0x37')]));_0xc751c3['attributes']=_0xc751c3['attributes'][_0x51a8('0x48')]?_0xc751c3['attributes']:_0x3540cd['model'];_0xc751c3['order']=qs[_0x51a8('0x56')](_0x149a40['query']['sort']);_0xc751c3[_0x51a8('0x3b')]=qs[_0x51a8('0x3c')](_[_0x51a8('0x3d')](_0x149a40['query'],_0x3540cd[_0x51a8('0x3c')]));if(_0x149a40[_0x51a8('0x35')][_0x51a8('0x3e')]){_0xc751c3['where']=_[_0x51a8('0x40')](_0xc751c3[_0x51a8('0x3b')],{'$or':_[_0x51a8('0x2f')](_0xc751c3[_0x51a8('0x38')],function(_0xac2108){var _0x30dd7b={};_0x30dd7b[_0xac2108]={'$like':'%'+_0x149a40[_0x51a8('0x35')][_0x51a8('0x3e')]+'%'};return _0x30dd7b;})});}_0xc751c3=_[_0x51a8('0x40')]({},_0xc751c3,_0x149a40['options']);return _0x39fcef[_0x51a8('0x5f')](_0xc751c3);}})[_0x51a8('0x25')](function(_0x4e2c5d){if(_0x4e2c5d){_0x2289d9=_0x4e2c5d[_0x51a8('0x48')];if(!_0x149a40[_0x51a8('0x35')]['hasOwnProperty'](_0x51a8('0x60'))){_0xc751c3[_0x51a8('0x21')]=qs[_0x51a8('0x21')](_0x149a40[_0x51a8('0x35')][_0x51a8('0x21')]);_0xc751c3['offset']=qs[_0x51a8('0x20')](_0x149a40[_0x51a8('0x35')][_0x51a8('0x20')]);}return _0x39fcef[_0x51a8('0x5f')](_0xc751c3);}})['then'](function(_0x3db2b8){if(_0x3db2b8){return _0x3db2b8?{'count':_0x2289d9,'rows':_0x3db2b8}:null;}})[_0x51a8('0x25')](respondWithResult(_0x3aca4a,null))[_0x51a8('0x44')](handleError(_0x3aca4a,null));};exports[_0x51a8('0x61')]=function(_0x6cd464,_0x1f0587,_0xf718e){var _0xd22e7b=_0x6cd464['body'][_0x51a8('0x62')];return db[_0x51a8('0x63')]['findAll']({'where':{'id':_0xd22e7b},'attributes':['id'],'include':[{'model':db[_0x51a8('0x57')],'as':_0x51a8('0x64'),'attributes':['id','name',_0x51a8('0x65'),'voicePause','interface'],'raw':!![]}]})[_0x51a8('0x25')](function(_0xf2325b){if(_0xf2325b){var _0x41e0b9=_['flatMap'](_0xf2325b,function(_0x585d4e){var _0x73ecd7=_0x585d4e['get']({'plain':!![]});return _0x73ecd7[_0x51a8('0x64')];});return db[_0x51a8('0x30')][_0x51a8('0x4a')]({'where':{'id':_0x6cd464[_0x51a8('0x46')]['id']}})[_0x51a8('0x25')](function(_0x28acb8){return db[_0x51a8('0x66')][_0x51a8('0x67')](function(_0x23d98c){return _0x28acb8[_0x51a8('0x61')](_0xd22e7b,{'transaction':_0x23d98c})[_0x51a8('0x25')](function(){return BPromise[_0x51a8('0x68')](_0x41e0b9,function(_0x1b7381){return db[_0x51a8('0x55')][_0x51a8('0x69')]({'where':{'UserId':_0x1b7381['id'],'SmsQueueId':_0x6cd464['params']['id']},'transaction':_0x23d98c});});})['then'](function(){_0x41e0b9[_0x51a8('0x6a')](function(_0x4e25d7){socket['emit']('userSmsQueue:save',{'UserId':_0x4e25d7['id'],'SmsQueueId':_0x28acb8['id']});});});});});}})[_0x51a8('0x25')](respondWithStatusCode(_0x1f0587,null))[_0x51a8('0x44')](handleError(_0x1f0587,null));};exports[_0x51a8('0x6b')]=function(_0x125a28,_0x4d5f37,_0x975b8){return db[_0x51a8('0x63')]['findAll']({'where':{'id':_0x125a28[_0x51a8('0x35')][_0x51a8('0x62')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x51a8('0x25')](handleEntityNotFound(_0x4d5f37,null))[_0x51a8('0x25')](function(_0x8587b9){var _0x429363=_[_0x51a8('0x2f')](_0x8587b9,'id');var _0x1c7691=[];var _0x4e566a=[];var _0x13dab3=squel[_0x51a8('0x6c')]();_0x13dab3[_0x51a8('0x6d')]('tq.TeamId')[_0x51a8('0x6e')](_0x51a8('0x6f'),'tq')[_0x51a8('0x70')]('user_has_teams','ut',_0x51a8('0x71'))[_0x51a8('0x3b')]('SmsQueueId\x20=\x20?',_0x125a28[_0x51a8('0x46')]['id']);for(var _0x529916=0x0;_0x529916<_0x8587b9[_0x51a8('0x48')];_0x529916+=0x1){let _0x2d4c2b=_0x8587b9[_0x529916];for(var _0xfb059=0x0;_0xfb059<_0x2d4c2b[_0x51a8('0x64')][_0x51a8('0x48')];_0xfb059+=0x1){let _0x700df1=_0x2d4c2b[_0x51a8('0x64')][_0xfb059];var _0x42d0ad=_0x13dab3['clone']();_0x42d0ad[_0x51a8('0x3b')](_0x51a8('0x72'),_0x700df1['id']);_0x4e566a[_0x51a8('0x73')](db[_0x51a8('0x66')][_0x51a8('0x35')](_0x42d0ad['toString'](),{'type':db['sequelize'][_0x51a8('0x74')][_0x51a8('0x75')]})[_0x51a8('0x25')](function(_0x2e354f){if(_0x2e354f[_0x51a8('0x48')]===0x1){return _0x700df1['id'];}else{var _0x54ef0e=_[_0x51a8('0x76')](_['map'](_0x2e354f,_0x51a8('0x77')),function(_0x1a0f3f){return _['includes'](_0x429363,_0x1a0f3f);});if(_0x54ef0e){return _0x700df1['id'];}}}));}}return BPromise[_0x51a8('0x78')](_0x4e566a)['then'](function(_0x3b7e30){_0x1c7691=_(_0x1c7691)[_0x51a8('0x79')](_0x3b7e30)[_0x51a8('0x7a')]()[_0x51a8('0x7b')]();return db[_0x51a8('0x30')]['find']({'where':{'id':_0x125a28[_0x51a8('0x46')]['id']}})[_0x51a8('0x25')](function(_0x5d00c3){return db[_0x51a8('0x66')][_0x51a8('0x67')](function(_0x54e006){return _0x5d00c3['removeTeams'](_0x125a28[_0x51a8('0x35')][_0x51a8('0x62')],{'transaction':_0x54e006})[_0x51a8('0x25')](function(){if(!_['isEmpty'](_0x1c7691)){return _0x5d00c3[_0x51a8('0x7c')](_0x1c7691,{'transaction':_0x54e006});}})[_0x51a8('0x25')](function(){_0x1c7691[_0x51a8('0x6a')](function(_0x11aab9){socket[_0x51a8('0x7d')](_0x51a8('0x7e'),{'UserId':_0x11aab9,'SmsQueueId':_0x5d00c3['id']});});});});});});})[_0x51a8('0x25')](respondWithStatusCode(_0x4d5f37,null))['catch'](handleError(_0x4d5f37,null));};exports[_0x51a8('0x7f')]=function(_0xa5074c,_0xa29735,_0x3f97bd){return db['SmsQueue']['find']({'where':{'id':_0xa5074c[_0x51a8('0x46')]['id']}})[_0x51a8('0x25')](handleEntityNotFound(_0xa29735,null))['then'](function(_0x4ea00f){if(_0x4ea00f){return _0x4ea00f['addAgents'](_0xa5074c[_0x51a8('0x4c')]['ids'],_['omit'](_0xa5074c['body'],[_0x51a8('0x62'),'id'])||{})['spread'](function(_0x2cea3f){for(var _0x2d820c=0x0;_0x2d820c<_0xa5074c['body']['ids'][_0x51a8('0x48')];_0x2d820c+=0x1){socket['emit'](_0x51a8('0x80'),{'UserId':_0xa5074c[_0x51a8('0x4c')]['ids'][_0x2d820c],'SmsQueueId':_0xa5074c[_0x51a8('0x46')]['id']});}return _0x2cea3f;});}})[_0x51a8('0x25')](respondWithResult(_0xa29735,null))['catch'](handleError(_0xa29735,null));};exports[_0x51a8('0x7c')]=function(_0x3bcc82,_0x223bd7,_0x5d2e4f){return db[_0x51a8('0x30')][_0x51a8('0x4a')]({'where':{'id':_0x3bcc82[_0x51a8('0x46')]['id']}})['then'](handleEntityNotFound(_0x223bd7,null))['then'](function(_0x1a64f4){if(_0x1a64f4){return _0x1a64f4[_0x51a8('0x7c')](_0x3bcc82[_0x51a8('0x35')][_0x51a8('0x62')])[_0x51a8('0x25')](function(){if(_[_0x51a8('0x81')](_0x3bcc82[_0x51a8('0x35')][_0x51a8('0x62')])){for(var _0x1482ff=0x0;_0x1482ff<_0x3bcc82[_0x51a8('0x35')][_0x51a8('0x62')][_0x51a8('0x48')];_0x1482ff+=0x1){socket[_0x51a8('0x7d')]('userSmsQueue:remove',{'UserId':Number(_0x3bcc82['query'][_0x51a8('0x62')][_0x1482ff]),'SmsQueueId':Number(_0x3bcc82[_0x51a8('0x46')]['id'])});}}else{socket[_0x51a8('0x7d')](_0x51a8('0x7e'),{'UserId':Number(_0x3bcc82[_0x51a8('0x35')]['ids']),'SmsQueueId':Number(_0x3bcc82['params']['id'])});}});}})[_0x51a8('0x25')](respondWithStatusCode(_0x223bd7,null))[_0x51a8('0x44')](handleError(_0x223bd7,null));};exports['getAgents']=function(_0x682828,_0x2e1d8e,_0x2bb024){var _0x19ffd8={};var _0x121944={};var _0x4ee800;var _0x4df6b7;return db[_0x51a8('0x30')]['findOne']({'where':{'id':_0x682828[_0x51a8('0x46')]['id']}})['then'](handleEntityNotFound(_0x2e1d8e,null))[_0x51a8('0x25')](function(_0xcc76ac){if(_0xcc76ac){_0x4ee800=_0xcc76ac;_0x121944['model']=_[_0x51a8('0x47')](db[_0x51a8('0x57')][_0x51a8('0x31')]);_0x121944[_0x51a8('0x35')]=_['keys'](_0x682828['query']);_0x121944[_0x51a8('0x3c')]=_[_0x51a8('0x36')](_0x121944[_0x51a8('0x34')],_0x121944[_0x51a8('0x35')]);_0x19ffd8['attributes']=_[_0x51a8('0x36')](_0x121944['model'],qs[_0x51a8('0x37')](_0x682828['query'][_0x51a8('0x37')]));_0x19ffd8[_0x51a8('0x38')]=_0x19ffd8[_0x51a8('0x38')][_0x51a8('0x48')]?_0x19ffd8['attributes']:_0x121944[_0x51a8('0x34')];_0x19ffd8['order']=qs[_0x51a8('0x56')](_0x682828[_0x51a8('0x35')][_0x51a8('0x56')]);_0x19ffd8['where']=qs[_0x51a8('0x3c')](_[_0x51a8('0x3d')](_0x682828[_0x51a8('0x35')],_0x121944['filters']));if(_0x682828['query'][_0x51a8('0x3e')]){_0x19ffd8[_0x51a8('0x3b')]=_[_0x51a8('0x40')](_0x19ffd8[_0x51a8('0x3b')],{'$or':_['map'](_0x19ffd8['attributes'],function(_0x46c310){var _0x4f0b3b={};_0x4f0b3b[_0x46c310]={'$like':'%'+_0x682828[_0x51a8('0x35')][_0x51a8('0x3e')]+'%'};return _0x4f0b3b;})});}_0x19ffd8=_[_0x51a8('0x40')]({},_0x19ffd8,_0x682828[_0x51a8('0x49')]);return _0x4ee800[_0x51a8('0x82')](_0x19ffd8);}})[_0x51a8('0x25')](function(_0x2b0888){if(_0x2b0888){_0x4df6b7=_0x2b0888['length'];if(!_0x682828['query']['hasOwnProperty'](_0x51a8('0x60'))){_0x19ffd8[_0x51a8('0x21')]=qs[_0x51a8('0x21')](_0x682828[_0x51a8('0x35')][_0x51a8('0x21')]);_0x19ffd8['offset']=qs[_0x51a8('0x20')](_0x682828['query'][_0x51a8('0x20')]);}return _0x4ee800[_0x51a8('0x82')](_0x19ffd8);}})[_0x51a8('0x25')](function(_0xb9dad5){if(_0xb9dad5){return _0xb9dad5?{'count':_0x4df6b7,'rows':_0xb9dad5}:null;}})['then'](respondWithResult(_0x2e1d8e,null))['catch'](handleError(_0x2e1d8e,null));}; \ No newline at end of file +var _0x8603=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','SmsQueues','UserProfileResource','error','name','send','index','SmsQueue','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','where','VIRTUAL','filter','merge','then','includeAll','include','findAll','rows','show','keys','rawAttributes','options','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','SmsQueueId','UserSmsQueue','User','UserId','agent','smsPause','updatedAt','createdAt','%s/%s','getTeams','Team','addTeams','ids','Agents','online','interface','flatMap','each','findOrCreate','emit','userSmsQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','sequelize','SELECT','every','includes','all','compact','transaction','isEmpty','removeAgents','forEach','addAgents','omit','spread','isArray','userSmsQueue:remove','getAgents','order','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','querystring','papaparse'];(function(_0x2efd1d,_0x44f696){var _0x1ef3f6=function(_0x25da5f){while(--_0x25da5f){_0x2efd1d['push'](_0x2efd1d['shift']());}};_0x1ef3f6(++_0x44f696);}(_0x8603,0x190));var _0x3860=function(_0x2e785e,_0x232c0a){_0x2e785e=_0x2e785e-0x0;var _0x230f26=_0x8603[_0x2e785e];return _0x230f26;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x3860('0x0'));var rimraf=require(_0x3860('0x1'));var zipdir=require(_0x3860('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3860('0x3'));var BPromise=require(_0x3860('0x4'));var Mustache=require(_0x3860('0x5'));var util=require('util');var path=require(_0x3860('0x6'));var sox=require('sox');var csv=require(_0x3860('0x7'));var ejs=require(_0x3860('0x8'));var fs=require('fs');var _=require(_0x3860('0x9'));var squel=require(_0x3860('0xa'));var crypto=require(_0x3860('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3860('0xc'));var Papa=require(_0x3860('0xd'));var Redis=require('ioredis');var authService=require(_0x3860('0xe'));var qs=require(_0x3860('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3860('0x10'));var logger=require(_0x3860('0x11'))('api');var utils=require(_0x3860('0x12'));var config=require(_0x3860('0x13'));var db=require('../../mysqldb')['db'];config[_0x3860('0x14')]=_[_0x3860('0x15')](config[_0x3860('0x14')],{'host':_0x3860('0x16'),'port':0x18eb});var socket=require(_0x3860('0x17'))(new Redis(config[_0x3860('0x14')]));require(_0x3860('0x18'))[_0x3860('0x19')](socket);function respondWithStatusCode(_0x465d8d,_0x46264d){_0x46264d=_0x46264d||0xcc;return function(_0x54dbc3){if(_0x54dbc3){return _0x465d8d[_0x3860('0x1a')](_0x46264d);}return _0x465d8d[_0x3860('0x1b')](_0x46264d)[_0x3860('0x1c')]();};}function respondWithResult(_0x37d9ab,_0x1055b3){_0x1055b3=_0x1055b3||0xc8;return function(_0xfa0c9a){if(_0xfa0c9a){return _0x37d9ab[_0x3860('0x1b')](_0x1055b3)[_0x3860('0x1d')](_0xfa0c9a);}};}function respondWithFilteredResult(_0x311fdb,_0x3c0d91){return function(_0x3e51b4){if(_0x3e51b4){var _0x45b799=_0x3e51b4[_0x3860('0x1e')],_0x4b6b15=_0x3c0d91[_0x3860('0x1f')],_0x4863bd=_0x3c0d91['offset']+_0x3c0d91[_0x3860('0x20')],_0x373b06;if(_0x4863bd>=_0x45b799){_0x4863bd=_0x45b799;_0x373b06=0xc8;}else{_0x373b06=0xce;}_0x311fdb[_0x3860('0x1b')](_0x373b06);return _0x311fdb[_0x3860('0x21')](_0x3860('0x22'),_0x4b6b15+'-'+_0x4863bd+'/'+_0x45b799)[_0x3860('0x1d')](_0x3e51b4);}return null;};}function patchUpdates(_0x45081f){return function(_0xc06ba1){try{jsonpatch[_0x3860('0x23')](_0xc06ba1,_0x45081f,!![]);}catch(_0x21d179){return BPromise[_0x3860('0x24')](_0x21d179);}return _0xc06ba1[_0x3860('0x25')]();};}function saveUpdates(_0x2e0b6e,_0x280ea9){return function(_0x9eaaa1){if(_0x9eaaa1){return _0x9eaaa1[_0x3860('0x26')](_0x2e0b6e)['then'](function(_0xfc10a5){return _0xfc10a5;});}return null;};}function removeEntity(_0x133093,_0x2b91f2){return function(_0x301e03){if(_0x301e03){return _0x301e03[_0x3860('0x27')]()['then'](function(){var _0x29ea87=_0x301e03['get']({'plain':!![]});var _0x577750=_0x3860('0x28');return db[_0x3860('0x29')]['destroy']({'where':{'type':_0x577750,'resourceId':_0x29ea87['id']}})['then'](function(){return _0x301e03;});})['then'](function(){_0x133093[_0x3860('0x1b')](0xcc)[_0x3860('0x1c')]();});}};}function handleEntityNotFound(_0xb25cc2,_0x371f3a){return function(_0x9332a5){if(!_0x9332a5){_0xb25cc2[_0x3860('0x1a')](0x194);}return _0x9332a5;};}function handleError(_0x544b9a,_0x4c4314){_0x4c4314=_0x4c4314||0x1f4;return function(_0x389bd0){logger[_0x3860('0x2a')](_0x389bd0['stack']);if(_0x389bd0[_0x3860('0x2b')]){delete _0x389bd0[_0x3860('0x2b')];}_0x544b9a[_0x3860('0x1b')](_0x4c4314)[_0x3860('0x2c')](_0x389bd0);};}exports[_0x3860('0x2d')]=function(_0x4bbae9,_0x36ae2b){var _0xf624ba={},_0x367b14={},_0x4bd90c={'count':0x0,'rows':[]};var _0x45d24f=_['map'](db[_0x3860('0x2e')]['rawAttributes'],function(_0x1c498c){return{'name':_0x1c498c[_0x3860('0x2f')],'type':_0x1c498c[_0x3860('0x30')]['key']};});_0x367b14[_0x3860('0x31')]=_[_0x3860('0x32')](_0x45d24f,'name');_0x367b14[_0x3860('0x33')]=_['keys'](_0x4bbae9[_0x3860('0x33')]);_0x367b14[_0x3860('0x34')]=_[_0x3860('0x35')](_0x367b14[_0x3860('0x31')],_0x367b14[_0x3860('0x33')]);_0xf624ba[_0x3860('0x36')]=_[_0x3860('0x35')](_0x367b14['model'],qs[_0x3860('0x37')](_0x4bbae9[_0x3860('0x33')]['fields']));_0xf624ba[_0x3860('0x36')]=_0xf624ba[_0x3860('0x36')][_0x3860('0x38')]?_0xf624ba['attributes']:_0x367b14['model'];if(!_0x4bbae9[_0x3860('0x33')][_0x3860('0x39')](_0x3860('0x3a'))){_0xf624ba[_0x3860('0x20')]=qs['limit'](_0x4bbae9['query'][_0x3860('0x20')]);_0xf624ba[_0x3860('0x1f')]=qs[_0x3860('0x1f')](_0x4bbae9[_0x3860('0x33')][_0x3860('0x1f')]);}_0xf624ba['order']=qs[_0x3860('0x3b')](_0x4bbae9[_0x3860('0x33')]['sort']);_0xf624ba['where']=qs[_0x3860('0x34')](_[_0x3860('0x3c')](_0x4bbae9[_0x3860('0x33')],_0x367b14[_0x3860('0x34')]));if(_0x4bbae9[_0x3860('0x33')]['filter']){_0xf624ba[_0x3860('0x3d')]=_['merge'](_0xf624ba[_0x3860('0x3d')],{'$or':_[_0x3860('0x32')](_0x45d24f,function(_0x53d443){if(_0x53d443[_0x3860('0x30')]!==_0x3860('0x3e')){var _0x4f3303={};_0x4f3303[_0x53d443[_0x3860('0x2b')]]={'$like':'%'+_0x4bbae9[_0x3860('0x33')][_0x3860('0x3f')]+'%'};return _0x4f3303;}})});}_0xf624ba=_[_0x3860('0x40')]({},_0xf624ba,_0x4bbae9['options']);var _0x312ffc={'where':_0xf624ba[_0x3860('0x3d')]};return db[_0x3860('0x2e')]['count'](_0x312ffc)[_0x3860('0x41')](function(_0x4e27c4){_0x4bd90c[_0x3860('0x1e')]=_0x4e27c4;if(_0x4bbae9[_0x3860('0x33')][_0x3860('0x42')]){_0xf624ba[_0x3860('0x43')]=[{'all':!![]}];}return db[_0x3860('0x2e')][_0x3860('0x44')](_0xf624ba);})['then'](function(_0xbbbf01){_0x4bd90c[_0x3860('0x45')]=_0xbbbf01;return _0x4bd90c;})['then'](respondWithFilteredResult(_0x36ae2b,_0xf624ba))['catch'](handleError(_0x36ae2b,null));};exports[_0x3860('0x46')]=function(_0x5840f7,_0x4f2f53){var _0x164a77={'raw':!![],'where':{'id':_0x5840f7['params']['id']}},_0x30d8eb={};_0x30d8eb[_0x3860('0x31')]=_[_0x3860('0x47')](db[_0x3860('0x2e')][_0x3860('0x48')]);_0x30d8eb[_0x3860('0x33')]=_[_0x3860('0x47')](_0x5840f7[_0x3860('0x33')]);_0x30d8eb[_0x3860('0x34')]=_[_0x3860('0x35')](_0x30d8eb[_0x3860('0x31')],_0x30d8eb[_0x3860('0x33')]);_0x164a77[_0x3860('0x36')]=_[_0x3860('0x35')](_0x30d8eb['model'],qs[_0x3860('0x37')](_0x5840f7['query'][_0x3860('0x37')]));_0x164a77[_0x3860('0x36')]=_0x164a77[_0x3860('0x36')][_0x3860('0x38')]?_0x164a77[_0x3860('0x36')]:_0x30d8eb[_0x3860('0x31')];if(_0x5840f7[_0x3860('0x33')][_0x3860('0x42')]){_0x164a77['include']=[{'all':!![]}];}_0x164a77=_[_0x3860('0x40')]({},_0x164a77,_0x5840f7[_0x3860('0x49')]);return db[_0x3860('0x2e')]['find'](_0x164a77)[_0x3860('0x41')](handleEntityNotFound(_0x4f2f53,null))[_0x3860('0x41')](respondWithResult(_0x4f2f53,null))[_0x3860('0x4a')](handleError(_0x4f2f53,null));};exports[_0x3860('0x4b')]=function(_0x5ed2db,_0x5bb2d1){return db[_0x3860('0x2e')]['create'](_0x5ed2db[_0x3860('0x4c')],{})[_0x3860('0x41')](function(_0x410dab){var _0x52456e=_0x5ed2db[_0x3860('0x4d')]['get']({'plain':!![]});if(!_0x52456e)throw new Error(_0x3860('0x4e'));if(_0x52456e['role']===_0x3860('0x4d')){var _0x25d22f=_0x410dab[_0x3860('0x4f')]({'plain':!![]});var _0x4b5790='SmsQueues';return db[_0x3860('0x50')][_0x3860('0x51')]({'where':{'name':_0x4b5790,'userProfileId':_0x52456e['userProfileId']},'raw':!![]})[_0x3860('0x41')](function(_0x58237e){if(_0x58237e&&_0x58237e[_0x3860('0x52')]===0x0){return db[_0x3860('0x29')][_0x3860('0x4b')]({'name':_0x25d22f[_0x3860('0x2b')],'resourceId':_0x25d22f['id'],'type':_0x58237e[_0x3860('0x2b')],'sectionId':_0x58237e['id']},{})[_0x3860('0x41')](function(){return _0x410dab;});}else{return _0x410dab;}})[_0x3860('0x4a')](function(_0x5a9987){logger[_0x3860('0x2a')](_0x3860('0x53'),_0x5a9987);throw _0x5a9987;});}return _0x410dab;})[_0x3860('0x41')](respondWithResult(_0x5bb2d1,0xc9))[_0x3860('0x4a')](handleError(_0x5bb2d1,null));};exports[_0x3860('0x26')]=function(_0x447163,_0x47ff99){if(_0x447163[_0x3860('0x4c')]['id']){delete _0x447163[_0x3860('0x4c')]['id'];}return db[_0x3860('0x2e')][_0x3860('0x51')]({'where':{'id':_0x447163[_0x3860('0x54')]['id']}})[_0x3860('0x41')](handleEntityNotFound(_0x47ff99,null))[_0x3860('0x41')](saveUpdates(_0x447163[_0x3860('0x4c')],null))['then'](respondWithResult(_0x47ff99,null))[_0x3860('0x4a')](handleError(_0x47ff99,null));};exports[_0x3860('0x27')]=function(_0x53a669,_0x1fe680){return db[_0x3860('0x2e')][_0x3860('0x51')]({'where':{'id':_0x53a669['params']['id']}})[_0x3860('0x41')](handleEntityNotFound(_0x1fe680,null))['then'](removeEntity(_0x1fe680,null))[_0x3860('0x4a')](handleError(_0x1fe680,null));};exports[_0x3860('0x55')]=function(_0x13b978,_0x2cc119){return db[_0x3860('0x2e')][_0x3860('0x55')]()[_0x3860('0x41')](respondWithResult(_0x2cc119,null))[_0x3860('0x4a')](handleError(_0x2cc119,null));};exports[_0x3860('0x56')]=function(_0x151492,_0x3ba9a1,_0x2bac24){var _0x58147d={'raw':!![],'where':{}},_0x5ce9a4={},_0x5111e0;return db[_0x3860('0x2e')]['findOne']({'where':{'id':_0x151492['params']['id']}})[_0x3860('0x41')](handleEntityNotFound(_0x3ba9a1,null))[_0x3860('0x41')](function(_0x2ff440){if(_0x2ff440){_0x5111e0=_0x2ff440[_0x3860('0x4f')]({'plain':!![]});_0x5ce9a4[_0x3860('0x31')]=_[_0x3860('0x47')](db['UserSmsQueue']['rawAttributes']);_0x5ce9a4['query']=_[_0x3860('0x47')](_0x151492[_0x3860('0x33')]);_0x5ce9a4[_0x3860('0x34')]=_['intersection'](_0x5ce9a4[_0x3860('0x31')],_0x5ce9a4['query']);_0x58147d[_0x3860('0x36')]=_[_0x3860('0x35')](_0x5ce9a4['model'],qs[_0x3860('0x37')](_0x151492[_0x3860('0x33')][_0x3860('0x37')]));_0x58147d[_0x3860('0x36')]=_0x58147d['attributes'][_0x3860('0x38')]?_0x58147d[_0x3860('0x36')]:_0x5ce9a4[_0x3860('0x31')];if(!_0x151492['query']['hasOwnProperty'](_0x3860('0x3a'))){_0x58147d[_0x3860('0x20')]=qs[_0x3860('0x20')](_0x151492[_0x3860('0x33')][_0x3860('0x20')]);_0x58147d[_0x3860('0x1f')]=qs['offset'](_0x151492[_0x3860('0x33')][_0x3860('0x1f')]);}_0x58147d['order']=qs[_0x3860('0x3b')](_0x151492[_0x3860('0x33')][_0x3860('0x3b')]);_0x58147d[_0x3860('0x3d')]=qs[_0x3860('0x34')](_[_0x3860('0x3c')](_0x151492['query'],_0x5ce9a4[_0x3860('0x34')]));_0x58147d[_0x3860('0x3d')][_0x3860('0x57')]=_0x2ff440['id'];if(_0x151492[_0x3860('0x33')][_0x3860('0x3f')]){_0x58147d[_0x3860('0x3d')]=_['merge'](_0x58147d[_0x3860('0x3d')],{'$or':_[_0x3860('0x32')](_0x58147d[_0x3860('0x36')],function(_0x5ebf70){var _0x4e386e={};_0x4e386e[_0x5ebf70]={'$like':'%'+_0x151492[_0x3860('0x33')][_0x3860('0x3f')]+'%'};return _0x4e386e;})});}_0x58147d=_[_0x3860('0x40')]({},_0x58147d,_0x151492[_0x3860('0x49')]);return db[_0x3860('0x58')]['findAll'](_0x58147d);}})['then'](function(_0x2db53f){if(_0x2db53f){return db[_0x3860('0x59')]['findAndCountAll']({'where':{'id':_['map'](_0x2db53f,_0x3860('0x5a')),'role':_0x3860('0x5b')},'attributes':['id','name',_0x3860('0x5c'),_0x3860('0x5d'),_0x3860('0x5e')]});}})[_0x3860('0x41')](function(_0x495167){if(_0x495167){return{'count':_0x495167[_0x3860('0x1e')],'rows':_[_0x3860('0x32')](_0x495167['rows'],function(_0x57e944){return{'membername':_0x57e944[_0x3860('0x2b')],'UserId':_0x57e944['id'],'queue_name':_0x5111e0[_0x3860('0x2b')],'SmsQueueId':_0x5111e0['id'],'interface':util['format'](_0x3860('0x5f'),'SIP',_0x57e944[_0x3860('0x2b')]),'penalty':0x0,'paused':_0x57e944['smsPause'],'createdAt':_0x57e944['createdAt'],'updatedAt':_0x57e944[_0x3860('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x3ba9a1,_0x58147d))[_0x3860('0x4a')](handleError(_0x3ba9a1,null));};exports[_0x3860('0x60')]=function(_0x29eb2c,_0x2fd2f4,_0x19f717){var _0x43c5a1={};var _0x4b3447={};var _0x3756b3;var _0x297321;return db[_0x3860('0x2e')]['findOne']({'where':{'id':_0x29eb2c[_0x3860('0x54')]['id']}})['then'](handleEntityNotFound(_0x2fd2f4,null))[_0x3860('0x41')](function(_0x3dc2c5){if(_0x3dc2c5){_0x3756b3=_0x3dc2c5;_0x4b3447['model']=_[_0x3860('0x47')](db[_0x3860('0x61')][_0x3860('0x48')]);_0x4b3447['query']=_['keys'](_0x29eb2c['query']);_0x4b3447['filters']=_[_0x3860('0x35')](_0x4b3447[_0x3860('0x31')],_0x4b3447[_0x3860('0x33')]);_0x43c5a1[_0x3860('0x36')]=_['intersection'](_0x4b3447['model'],qs[_0x3860('0x37')](_0x29eb2c[_0x3860('0x33')][_0x3860('0x37')]));_0x43c5a1[_0x3860('0x36')]=_0x43c5a1['attributes'][_0x3860('0x38')]?_0x43c5a1[_0x3860('0x36')]:_0x4b3447['model'];_0x43c5a1['order']=qs[_0x3860('0x3b')](_0x29eb2c[_0x3860('0x33')][_0x3860('0x3b')]);_0x43c5a1[_0x3860('0x3d')]=qs['filters'](_['pick'](_0x29eb2c[_0x3860('0x33')],_0x4b3447['filters']));if(_0x29eb2c[_0x3860('0x33')][_0x3860('0x3f')]){_0x43c5a1['where']=_['merge'](_0x43c5a1['where'],{'$or':_[_0x3860('0x32')](_0x43c5a1[_0x3860('0x36')],function(_0x507480){var _0x22177b={};_0x22177b[_0x507480]={'$like':'%'+_0x29eb2c[_0x3860('0x33')][_0x3860('0x3f')]+'%'};return _0x22177b;})});}_0x43c5a1=_[_0x3860('0x40')]({},_0x43c5a1,_0x29eb2c[_0x3860('0x49')]);return _0x3756b3['getTeams'](_0x43c5a1);}})[_0x3860('0x41')](function(_0x31e791){if(_0x31e791){_0x297321=_0x31e791[_0x3860('0x38')];if(!_0x29eb2c[_0x3860('0x33')][_0x3860('0x39')]('nolimit')){_0x43c5a1[_0x3860('0x20')]=qs[_0x3860('0x20')](_0x29eb2c[_0x3860('0x33')][_0x3860('0x20')]);_0x43c5a1[_0x3860('0x1f')]=qs['offset'](_0x29eb2c['query'][_0x3860('0x1f')]);}return _0x3756b3[_0x3860('0x60')](_0x43c5a1);}})[_0x3860('0x41')](function(_0xf950d8){if(_0xf950d8){return _0xf950d8?{'count':_0x297321,'rows':_0xf950d8}:null;}})[_0x3860('0x41')](respondWithResult(_0x2fd2f4,null))[_0x3860('0x4a')](handleError(_0x2fd2f4,null));};exports[_0x3860('0x62')]=function(_0x532163,_0x458c1b,_0x3eb292){var _0x58eddd=_0x532163[_0x3860('0x4c')][_0x3860('0x63')];return db[_0x3860('0x61')]['findAll']({'where':{'id':_0x58eddd},'attributes':['id'],'include':[{'model':db[_0x3860('0x59')],'as':_0x3860('0x64'),'attributes':['id','name',_0x3860('0x65'),'voicePause',_0x3860('0x66')],'raw':!![]}]})[_0x3860('0x41')](function(_0x479d65){if(_0x479d65){var _0x330fd0=_[_0x3860('0x67')](_0x479d65,function(_0x361113){var _0x37b34a=_0x361113[_0x3860('0x4f')]({'plain':!![]});return _0x37b34a['Agents'];});return db[_0x3860('0x2e')][_0x3860('0x51')]({'where':{'id':_0x532163[_0x3860('0x54')]['id']}})[_0x3860('0x41')](function(_0x3c9837){return db['sequelize']['transaction'](function(_0x170554){return _0x3c9837[_0x3860('0x62')](_0x58eddd,{'transaction':_0x170554})['then'](function(){return BPromise[_0x3860('0x68')](_0x330fd0,function(_0x27ef52){return db[_0x3860('0x58')][_0x3860('0x69')]({'where':{'UserId':_0x27ef52['id'],'SmsQueueId':_0x532163['params']['id']},'transaction':_0x170554});});})[_0x3860('0x41')](function(){_0x330fd0['forEach'](function(_0x1a0768){socket[_0x3860('0x6a')](_0x3860('0x6b'),{'UserId':_0x1a0768['id'],'SmsQueueId':_0x3c9837['id']});});});});});}})[_0x3860('0x41')](respondWithStatusCode(_0x458c1b,null))[_0x3860('0x4a')](handleError(_0x458c1b,null));};exports[_0x3860('0x6c')]=function(_0x467b1b,_0x4936e7,_0x277aba){return db[_0x3860('0x61')]['findAll']({'where':{'id':_0x467b1b['query']['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x3860('0x64'),'attributes':['id'],'raw':!![]}]})[_0x3860('0x41')](handleEntityNotFound(_0x4936e7,null))[_0x3860('0x41')](function(_0x1482cd){var _0x1d989c=_[_0x3860('0x32')](_0x1482cd,'id');var _0x51999d=[];var _0x204da6=[];var _0x5e2959=squel[_0x3860('0x6d')]();_0x5e2959[_0x3860('0x6e')](_0x3860('0x6f'))[_0x3860('0x70')](_0x3860('0x71'),'tq')[_0x3860('0x72')](_0x3860('0x73'),'ut',_0x3860('0x74'))[_0x3860('0x3d')](_0x3860('0x75'),_0x467b1b[_0x3860('0x54')]['id']);for(var _0x5bdd94=0x0;_0x5bdd94<_0x1482cd[_0x3860('0x38')];_0x5bdd94+=0x1){let _0x304c95=_0x1482cd[_0x5bdd94];for(var _0x1c87bd=0x0;_0x1c87bd<_0x304c95['Agents'][_0x3860('0x38')];_0x1c87bd+=0x1){let _0x2fb8fc=_0x304c95[_0x3860('0x64')][_0x1c87bd];var _0x3d4469=_0x5e2959['clone']();_0x3d4469[_0x3860('0x3d')](_0x3860('0x76'),_0x2fb8fc['id']);_0x204da6[_0x3860('0x77')](db['sequelize'][_0x3860('0x33')](_0x3d4469[_0x3860('0x78')](),{'type':db[_0x3860('0x79')]['QueryTypes'][_0x3860('0x7a')]})[_0x3860('0x41')](function(_0x171400){if(_0x171400['length']===0x1){return _0x2fb8fc['id'];}else{var _0x11d103=_[_0x3860('0x7b')](_[_0x3860('0x32')](_0x171400,'TeamId'),function(_0x3c6005){return _[_0x3860('0x7c')](_0x1d989c,_0x3c6005);});if(_0x11d103){return _0x2fb8fc['id'];}}}));}}return BPromise[_0x3860('0x7d')](_0x204da6)['then'](function(_0x213c8f){_0x51999d=_(_0x51999d)['union'](_0x213c8f)[_0x3860('0x7e')]()['value']();return db[_0x3860('0x2e')][_0x3860('0x51')]({'where':{'id':_0x467b1b[_0x3860('0x54')]['id']}})[_0x3860('0x41')](function(_0xcf291){return db[_0x3860('0x79')][_0x3860('0x7f')](function(_0x3c9ccc){return _0xcf291[_0x3860('0x6c')](_0x467b1b[_0x3860('0x33')][_0x3860('0x63')],{'transaction':_0x3c9ccc})[_0x3860('0x41')](function(){if(!_[_0x3860('0x80')](_0x51999d)){return _0xcf291[_0x3860('0x81')](_0x51999d,{'transaction':_0x3c9ccc});}})[_0x3860('0x41')](function(){_0x51999d[_0x3860('0x82')](function(_0x46661f){socket[_0x3860('0x6a')]('userSmsQueue:remove',{'UserId':_0x46661f,'SmsQueueId':_0xcf291['id']});});});});});});})[_0x3860('0x41')](respondWithStatusCode(_0x4936e7,null))[_0x3860('0x4a')](handleError(_0x4936e7,null));};exports[_0x3860('0x83')]=function(_0x28cf53,_0x3e6bf8,_0x27802b){return db[_0x3860('0x2e')][_0x3860('0x51')]({'where':{'id':_0x28cf53[_0x3860('0x54')]['id']}})[_0x3860('0x41')](handleEntityNotFound(_0x3e6bf8,null))[_0x3860('0x41')](function(_0x50a18b){if(_0x50a18b){return _0x50a18b[_0x3860('0x83')](_0x28cf53[_0x3860('0x4c')][_0x3860('0x63')],_[_0x3860('0x84')](_0x28cf53['body'],[_0x3860('0x63'),'id'])||{})[_0x3860('0x85')](function(_0x2fcf2c){for(var _0x20d615=0x0;_0x20d615<_0x28cf53['body'][_0x3860('0x63')]['length'];_0x20d615+=0x1){socket['emit'](_0x3860('0x6b'),{'UserId':_0x28cf53[_0x3860('0x4c')][_0x3860('0x63')][_0x20d615],'SmsQueueId':_0x28cf53[_0x3860('0x54')]['id']});}return _0x2fcf2c;});}})[_0x3860('0x41')](respondWithResult(_0x3e6bf8,null))[_0x3860('0x4a')](handleError(_0x3e6bf8,null));};exports[_0x3860('0x81')]=function(_0x273fed,_0x3e4a88,_0x468e83){return db[_0x3860('0x2e')][_0x3860('0x51')]({'where':{'id':_0x273fed[_0x3860('0x54')]['id']}})['then'](handleEntityNotFound(_0x3e4a88,null))[_0x3860('0x41')](function(_0x509122){if(_0x509122){return _0x509122[_0x3860('0x81')](_0x273fed[_0x3860('0x33')]['ids'])[_0x3860('0x41')](function(){if(_[_0x3860('0x86')](_0x273fed[_0x3860('0x33')][_0x3860('0x63')])){for(var _0x959e5b=0x0;_0x959e5b<_0x273fed[_0x3860('0x33')][_0x3860('0x63')]['length'];_0x959e5b+=0x1){socket[_0x3860('0x6a')](_0x3860('0x87'),{'UserId':Number(_0x273fed[_0x3860('0x33')][_0x3860('0x63')][_0x959e5b]),'SmsQueueId':Number(_0x273fed[_0x3860('0x54')]['id'])});}}else{socket['emit'](_0x3860('0x87'),{'UserId':Number(_0x273fed['query']['ids']),'SmsQueueId':Number(_0x273fed['params']['id'])});}});}})[_0x3860('0x41')](respondWithStatusCode(_0x3e4a88,null))[_0x3860('0x4a')](handleError(_0x3e4a88,null));};exports[_0x3860('0x88')]=function(_0x1558dc,_0x161efa,_0x276a75){var _0x270ca1={};var _0xe24a1d={};var _0x59c203;var _0x3c738a;return db[_0x3860('0x2e')]['findOne']({'where':{'id':_0x1558dc['params']['id']}})[_0x3860('0x41')](handleEntityNotFound(_0x161efa,null))[_0x3860('0x41')](function(_0x1cf541){if(_0x1cf541){_0x59c203=_0x1cf541;_0xe24a1d['model']=_[_0x3860('0x47')](db['User'][_0x3860('0x48')]);_0xe24a1d['query']=_[_0x3860('0x47')](_0x1558dc[_0x3860('0x33')]);_0xe24a1d['filters']=_[_0x3860('0x35')](_0xe24a1d[_0x3860('0x31')],_0xe24a1d['query']);_0x270ca1[_0x3860('0x36')]=_[_0x3860('0x35')](_0xe24a1d[_0x3860('0x31')],qs['fields'](_0x1558dc[_0x3860('0x33')]['fields']));_0x270ca1[_0x3860('0x36')]=_0x270ca1[_0x3860('0x36')]['length']?_0x270ca1[_0x3860('0x36')]:_0xe24a1d[_0x3860('0x31')];_0x270ca1[_0x3860('0x89')]=qs[_0x3860('0x3b')](_0x1558dc[_0x3860('0x33')]['sort']);_0x270ca1[_0x3860('0x3d')]=qs[_0x3860('0x34')](_['pick'](_0x1558dc['query'],_0xe24a1d[_0x3860('0x34')]));if(_0x1558dc['query'][_0x3860('0x3f')]){_0x270ca1[_0x3860('0x3d')]=_['merge'](_0x270ca1[_0x3860('0x3d')],{'$or':_['map'](_0x270ca1[_0x3860('0x36')],function(_0x4b8128){var _0x10c82d={};_0x10c82d[_0x4b8128]={'$like':'%'+_0x1558dc[_0x3860('0x33')][_0x3860('0x3f')]+'%'};return _0x10c82d;})});}_0x270ca1=_[_0x3860('0x40')]({},_0x270ca1,_0x1558dc['options']);return _0x59c203[_0x3860('0x88')](_0x270ca1);}})[_0x3860('0x41')](function(_0x20071c){if(_0x20071c){_0x3c738a=_0x20071c[_0x3860('0x38')];if(!_0x1558dc['query'][_0x3860('0x39')](_0x3860('0x3a'))){_0x270ca1['limit']=qs[_0x3860('0x20')](_0x1558dc[_0x3860('0x33')][_0x3860('0x20')]);_0x270ca1[_0x3860('0x1f')]=qs['offset'](_0x1558dc[_0x3860('0x33')][_0x3860('0x1f')]);}return _0x59c203[_0x3860('0x88')](_0x270ca1);}})[_0x3860('0x41')](function(_0x48b8a8){if(_0x48b8a8){return _0x48b8a8?{'count':_0x3c738a,'rows':_0x48b8a8}:null;}})[_0x3860('0x41')](respondWithResult(_0x161efa,null))['catch'](handleError(_0x161efa,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 4e576ca..12e06e4 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 _0x1c5f=['hasOwnProperty','hook','exports','../../mysqldb','SmsQueue','setMaxListeners','save','remove','emit'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1c5f,0x18f));var _0xf1c5=function(_0x37a93e,_0xf40cc9){_0x37a93e=_0x37a93e-0x0;var _0x5d6c18=_0x1c5f[_0x37a93e];return _0x5d6c18;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0xf1c5('0x0'))['db'][_0xf1c5('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xf1c5('0x2')](0x0);var events={'afterCreate':_0xf1c5('0x3'),'afterUpdate':'update','afterDestroy':_0xf1c5('0x4')};function emitEvent(_0xa229bd){return function(_0x50a3c3,_0x4ab6c0,_0x1e4fb8){SmsQueueEvents[_0xf1c5('0x5')](_0xa229bd+':'+_0x50a3c3['id'],_0x50a3c3);SmsQueueEvents[_0xf1c5('0x5')](_0xa229bd,_0x50a3c3);_0x1e4fb8(null);};}for(var e in events){if(events[_0xf1c5('0x6')](e)){var event=events[e];SmsQueue[_0xf1c5('0x7')](e,emitEvent(event));}}module[_0xf1c5('0x8')]=SmsQueueEvents; \ No newline at end of file +var _0x44b3=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','../../mysqldb'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0x44b3,0x9f));var _0x344b=function(_0x3f8102,_0x108968){_0x3f8102=_0x3f8102-0x0;var _0x432aac=_0x44b3[_0x3f8102];return _0x432aac;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0x344b('0x0'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x344b('0x1')](0x0);var events={'afterCreate':_0x344b('0x2'),'afterUpdate':_0x344b('0x3'),'afterDestroy':_0x344b('0x4')};function emitEvent(_0x3da7b0){return function(_0x3d57f7,_0x53c08f,_0x117f74){SmsQueueEvents[_0x344b('0x5')](_0x3da7b0+':'+_0x3d57f7['id'],_0x3d57f7);SmsQueueEvents['emit'](_0x3da7b0,_0x3d57f7);_0x117f74(null);};}for(var e in events){if(events[_0x344b('0x6')](e)){var event=events[e];SmsQueue[_0x344b('0x7')](e,emitEvent(event));}}module['exports']=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 8242dcd..95d2974 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 _0x1b4f=['bluebird','request-promise','rimraf','./smsQueue.attributes','exports','define','SmsQueue','sms_queues','lodash','util','../../config/logger','api','moment'];(function(_0x5a5f06,_0x18fb01){var _0x3e43ae=function(_0x4b73f7){while(--_0x4b73f7){_0x5a5f06['push'](_0x5a5f06['shift']());}};_0x3e43ae(++_0x18fb01);}(_0x1b4f,0xd8));var _0xf1b4=function(_0x2ebcef,_0x21714e){_0x2ebcef=_0x2ebcef-0x0;var _0x5d3d8d=_0x1b4f[_0x2ebcef];return _0x5d3d8d;};'use strict';var _=require(_0xf1b4('0x0'));var util=require(_0xf1b4('0x1'));var logger=require(_0xf1b4('0x2'))(_0xf1b4('0x3'));var moment=require(_0xf1b4('0x4'));var BPromise=require(_0xf1b4('0x5'));var rp=require(_0xf1b4('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf1b4('0x7'));var config=require('../../config/environment');var attributes=require(_0xf1b4('0x8'));module[_0xf1b4('0x9')]=function(_0x19c337,_0x242430){return _0x19c337[_0xf1b4('0xa')](_0xf1b4('0xb'),attributes,{'tableName':_0xf1b4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2e6d=['../../config/environment','./smsQueue.attributes','exports','define','sms_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x1c80b4,_0x20c065){var _0x3d70c2=function(_0x51f99a){while(--_0x51f99a){_0x1c80b4['push'](_0x1c80b4['shift']());}};_0x3d70c2(++_0x20c065);}(_0x2e6d,0x12b));var _0xd2e6=function(_0x573890,_0x20650d){_0x573890=_0x573890-0x0;var _0x22f42b=_0x2e6d[_0x573890];return _0x22f42b;};'use strict';var _=require(_0xd2e6('0x0'));var util=require(_0xd2e6('0x1'));var logger=require(_0xd2e6('0x2'))(_0xd2e6('0x3'));var moment=require(_0xd2e6('0x4'));var BPromise=require(_0xd2e6('0x5'));var rp=require(_0xd2e6('0x6'));var fs=require('fs');var path=require(_0xd2e6('0x7'));var rimraf=require(_0xd2e6('0x8'));var config=require(_0xd2e6('0x9'));var attributes=require(_0xd2e6('0xa'));module[_0xd2e6('0xb')]=function(_0x3036ad,_0x3d20bc){return _0x3036ad[_0xd2e6('0xc')]('SmsQueue',attributes,{'tableName':_0xd2e6('0xd'),'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 bc4b17e..7bcfd1e 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 _0xb939=['stringify','error','message','SmsQueue,\x20%s,\x20%s','result','catch','SmsQueue','findAll','options','raw','where','attributes','limit','include','map','model','GetSmsQueue','ShowSmsQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug'];(function(_0x48cc05,_0x99c831){var _0x5aa91f=function(_0x64b452){while(--_0x64b452){_0x48cc05['push'](_0x48cc05['shift']());}};_0x5aa91f(++_0x99c831);}(_0xb939,0x15f));var _0x9b93=function(_0x5e386a,_0xa6d3a2){_0x5e386a=_0x5e386a-0x0;var _0x253e1a=_0xb939[_0x5e386a];return _0x253e1a;};'use strict';var _=require(_0x9b93('0x0'));var util=require(_0x9b93('0x1'));var moment=require(_0x9b93('0x2'));var BPromise=require(_0x9b93('0x3'));var rs=require(_0x9b93('0x4'));var fs=require('fs');var Redis=require(_0x9b93('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x9b93('0x6'));var logger=require('../../config/logger')(_0x9b93('0x7'));var config=require(_0x9b93('0x8'));var jayson=require(_0x9b93('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x9b93('0xa')]=_['defaults'](config[_0x9b93('0xa')],{'host':_0x9b93('0xb'),'port':0x18eb});var socket=require(_0x9b93('0xc'))(new Redis(config[_0x9b93('0xa')]));require('./smsQueue.socket')[_0x9b93('0xd')](socket);function respondWithRpcPromise(_0x31f5c4,_0x9c486e,_0x1da0d6){return new BPromise(function(_0x9609fa,_0x17185f){return client[_0x9b93('0xe')](_0x31f5c4,_0x1da0d6)[_0x9b93('0xf')](function(_0x39dbf4){logger[_0x9b93('0x10')]('SmsQueue,\x20%s,\x20%s',_0x9c486e,_0x9b93('0x11'));logger[_0x9b93('0x12')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x9c486e,_0x9b93('0x11'),JSON[_0x9b93('0x13')](_0x39dbf4));if(_0x39dbf4[_0x9b93('0x14')]){if(_0x39dbf4['error']['code']===0x1f4){logger[_0x9b93('0x14')]('SmsQueue,\x20%s,\x20%s',_0x9c486e,_0x39dbf4[_0x9b93('0x14')][_0x9b93('0x15')]);return _0x17185f(_0x39dbf4[_0x9b93('0x14')][_0x9b93('0x15')]);}logger['error']('SmsQueue,\x20%s,\x20%s',_0x9c486e,_0x39dbf4['error'][_0x9b93('0x15')]);return _0x9609fa(_0x39dbf4[_0x9b93('0x14')][_0x9b93('0x15')]);}else{logger[_0x9b93('0x10')](_0x9b93('0x16'),_0x9c486e,_0x9b93('0x11'));_0x9609fa(_0x39dbf4[_0x9b93('0x17')][_0x9b93('0x15')]);}})[_0x9b93('0x18')](function(_0x5b9f63){logger[_0x9b93('0x14')](_0x9b93('0x16'),_0x9c486e,_0x5b9f63);_0x17185f(_0x5b9f63);});});}exports['GetSmsQueue']=function(_0x380eeb){var _0x57ce8f=this;return new Promise(function(_0x1340fb,_0xb6d522){return db[_0x9b93('0x19')][_0x9b93('0x1a')]({'raw':_0x380eeb[_0x9b93('0x1b')]?_0x380eeb['options'][_0x9b93('0x1c')]===undefined?!![]:![]:!![],'where':_0x380eeb[_0x9b93('0x1b')]?_0x380eeb['options'][_0x9b93('0x1d')]||null:null,'attributes':_0x380eeb[_0x9b93('0x1b')]?_0x380eeb[_0x9b93('0x1b')][_0x9b93('0x1e')]||null:null,'limit':_0x380eeb['options']?_0x380eeb[_0x9b93('0x1b')][_0x9b93('0x1f')]||null:null,'include':_0x380eeb[_0x9b93('0x1b')]?_0x380eeb[_0x9b93('0x1b')][_0x9b93('0x20')]?_[_0x9b93('0x21')](_0x380eeb[_0x9b93('0x1b')][_0x9b93('0x20')],function(_0x120d5a){return{'model':db[_0x120d5a[_0x9b93('0x22')]],'as':_0x120d5a['as'],'attributes':_0x120d5a['attributes'],'include':_0x120d5a[_0x9b93('0x20')]?_['map'](_0x120d5a[_0x9b93('0x20')],function(_0x54913f){return{'model':db[_0x54913f[_0x9b93('0x22')]],'as':_0x54913f['as'],'attributes':_0x54913f[_0x9b93('0x1e')],'include':_0x54913f['include']?_[_0x9b93('0x21')](_0x54913f[_0x9b93('0x20')],function(_0x4a36e5){return{'model':db[_0x4a36e5['model']],'as':_0x4a36e5['as'],'attributes':_0x4a36e5[_0x9b93('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x9b93('0xf')](function(_0x2adfe5){logger[_0x9b93('0x10')](_0x9b93('0x23'),_0x380eeb);logger[_0x9b93('0x12')](_0x9b93('0x23'),_0x380eeb,JSON[_0x9b93('0x13')](_0x2adfe5));_0x1340fb(_0x2adfe5);})[_0x9b93('0x18')](function(_0x34b554){logger['error']('GetSmsQueue',_0x34b554[_0x9b93('0x15')],_0x380eeb);_0xb6d522(_0x57ce8f[_0x9b93('0x14')](0x1f4,_0x34b554[_0x9b93('0x15')]));});});};exports[_0x9b93('0x24')]=function(_0x583687){var _0x40b2cc=this;return new Promise(function(_0x75bc0f,_0x536d79){return db[_0x9b93('0x19')]['find']({'raw':_0x583687[_0x9b93('0x1b')]?_0x583687[_0x9b93('0x1b')][_0x9b93('0x1c')]===undefined?!![]:![]:!![],'where':_0x583687[_0x9b93('0x1b')]?_0x583687[_0x9b93('0x1b')][_0x9b93('0x1d')]||null:null,'attributes':_0x583687[_0x9b93('0x1b')]?_0x583687[_0x9b93('0x1b')][_0x9b93('0x1e')]||null:null,'include':_0x583687[_0x9b93('0x1b')]?_0x583687[_0x9b93('0x1b')]['include']?_[_0x9b93('0x21')](_0x583687['options'][_0x9b93('0x20')],function(_0x28a3a7){return{'model':db[_0x28a3a7[_0x9b93('0x22')]],'as':_0x28a3a7['as'],'attributes':_0x28a3a7['attributes'],'include':_0x28a3a7['include']?_[_0x9b93('0x21')](_0x28a3a7[_0x9b93('0x20')],function(_0x412404){return{'model':db[_0x412404[_0x9b93('0x22')]],'as':_0x412404['as'],'attributes':_0x412404['attributes'],'include':_0x412404[_0x9b93('0x20')]?_[_0x9b93('0x21')](_0x412404[_0x9b93('0x20')],function(_0x1e3b7d){return{'model':db[_0x1e3b7d['model']],'as':_0x1e3b7d['as'],'attributes':_0x1e3b7d[_0x9b93('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x34f046){logger[_0x9b93('0x10')](_0x9b93('0x24'),_0x583687);logger[_0x9b93('0x12')]('ShowSmsQueue',_0x583687,JSON['stringify'](_0x34f046));_0x75bc0f(_0x34f046);})[_0x9b93('0x18')](function(_0x12a654){logger['error'](_0x9b93('0x24'),_0x12a654[_0x9b93('0x15')],_0x583687);_0x536d79(_0x40b2cc['error'](0x1f4,_0x12a654[_0x9b93('0x15')]));});});}; \ No newline at end of file +var _0xe3da=['jayson/promise','redis','localhost','socket.io-emitter','./smsQueue.socket','register','then','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetSmsQueue','SmsQueue','findAll','options','raw','where','attributes','limit','map','include','model','info','find','ShowSmsQueue','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x1a7846,_0x59723e){var _0x48049=function(_0x203ff6){while(--_0x203ff6){_0x1a7846['push'](_0x1a7846['shift']());}};_0x48049(++_0x59723e);}(_0xe3da,0x103));var _0xae3d=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xe3da[_0x40a045];return _0x1a687c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xae3d('0x0'));var BPromise=require('bluebird');var rs=require(_0xae3d('0x1'));var fs=require('fs');var Redis=require(_0xae3d('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xae3d('0x3'));var logger=require(_0xae3d('0x4'))(_0xae3d('0x5'));var config=require(_0xae3d('0x6'));var jayson=require(_0xae3d('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0xae3d('0x8')]=_['defaults'](config[_0xae3d('0x8')],{'host':_0xae3d('0x9'),'port':0x18eb});var socket=require(_0xae3d('0xa'))(new Redis(config['redis']));require(_0xae3d('0xb'))[_0xae3d('0xc')](socket);function respondWithRpcPromise(_0x5e1845,_0x2b2375,_0x1ece1e){return new BPromise(function(_0x4f54ed,_0x126fe0){return client['request'](_0x5e1845,_0x1ece1e)[_0xae3d('0xd')](function(_0xba761f){logger['info'](_0xae3d('0xe'),_0x2b2375,_0xae3d('0xf'));logger[_0xae3d('0x10')](_0xae3d('0x11'),_0x2b2375,_0xae3d('0xf'),JSON[_0xae3d('0x12')](_0xba761f));if(_0xba761f[_0xae3d('0x13')]){if(_0xba761f[_0xae3d('0x13')][_0xae3d('0x14')]===0x1f4){logger[_0xae3d('0x13')](_0xae3d('0xe'),_0x2b2375,_0xba761f[_0xae3d('0x13')][_0xae3d('0x15')]);return _0x126fe0(_0xba761f[_0xae3d('0x13')][_0xae3d('0x15')]);}logger[_0xae3d('0x13')](_0xae3d('0xe'),_0x2b2375,_0xba761f[_0xae3d('0x13')]['message']);return _0x4f54ed(_0xba761f['error'][_0xae3d('0x15')]);}else{logger['info'](_0xae3d('0xe'),_0x2b2375,_0xae3d('0xf'));_0x4f54ed(_0xba761f[_0xae3d('0x16')]['message']);}})[_0xae3d('0x17')](function(_0x3116a6){logger[_0xae3d('0x13')](_0xae3d('0xe'),_0x2b2375,_0x3116a6);_0x126fe0(_0x3116a6);});});}exports[_0xae3d('0x18')]=function(_0x50bbf8){var _0x1b7b89=this;return new Promise(function(_0x59cac5,_0x2f1b3b){return db[_0xae3d('0x19')][_0xae3d('0x1a')]({'raw':_0x50bbf8[_0xae3d('0x1b')]?_0x50bbf8['options'][_0xae3d('0x1c')]===undefined?!![]:![]:!![],'where':_0x50bbf8[_0xae3d('0x1b')]?_0x50bbf8[_0xae3d('0x1b')][_0xae3d('0x1d')]||null:null,'attributes':_0x50bbf8[_0xae3d('0x1b')]?_0x50bbf8[_0xae3d('0x1b')][_0xae3d('0x1e')]||null:null,'limit':_0x50bbf8[_0xae3d('0x1b')]?_0x50bbf8[_0xae3d('0x1b')][_0xae3d('0x1f')]||null:null,'include':_0x50bbf8['options']?_0x50bbf8[_0xae3d('0x1b')]['include']?_[_0xae3d('0x20')](_0x50bbf8['options'][_0xae3d('0x21')],function(_0x4e301){return{'model':db[_0x4e301[_0xae3d('0x22')]],'as':_0x4e301['as'],'attributes':_0x4e301[_0xae3d('0x1e')],'include':_0x4e301[_0xae3d('0x21')]?_['map'](_0x4e301[_0xae3d('0x21')],function(_0x19912f){return{'model':db[_0x19912f['model']],'as':_0x19912f['as'],'attributes':_0x19912f[_0xae3d('0x1e')],'include':_0x19912f['include']?_[_0xae3d('0x20')](_0x19912f[_0xae3d('0x21')],function(_0x155358){return{'model':db[_0x155358['model']],'as':_0x155358['as'],'attributes':_0x155358[_0xae3d('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x241959){logger[_0xae3d('0x23')]('GetSmsQueue',_0x50bbf8);logger[_0xae3d('0x10')](_0xae3d('0x18'),_0x50bbf8,JSON[_0xae3d('0x12')](_0x241959));_0x59cac5(_0x241959);})[_0xae3d('0x17')](function(_0x472343){logger[_0xae3d('0x13')](_0xae3d('0x18'),_0x472343[_0xae3d('0x15')],_0x50bbf8);_0x2f1b3b(_0x1b7b89[_0xae3d('0x13')](0x1f4,_0x472343['message']));});});};exports['ShowSmsQueue']=function(_0x41e219){var _0x5d5b90=this;return new Promise(function(_0x6c0592,_0x314bc1){return db[_0xae3d('0x19')][_0xae3d('0x24')]({'raw':_0x41e219[_0xae3d('0x1b')]?_0x41e219[_0xae3d('0x1b')][_0xae3d('0x1c')]===undefined?!![]:![]:!![],'where':_0x41e219[_0xae3d('0x1b')]?_0x41e219[_0xae3d('0x1b')][_0xae3d('0x1d')]||null:null,'attributes':_0x41e219['options']?_0x41e219[_0xae3d('0x1b')][_0xae3d('0x1e')]||null:null,'include':_0x41e219[_0xae3d('0x1b')]?_0x41e219['options']['include']?_[_0xae3d('0x20')](_0x41e219[_0xae3d('0x1b')][_0xae3d('0x21')],function(_0x4f03fd){return{'model':db[_0x4f03fd['model']],'as':_0x4f03fd['as'],'attributes':_0x4f03fd['attributes'],'include':_0x4f03fd[_0xae3d('0x21')]?_['map'](_0x4f03fd[_0xae3d('0x21')],function(_0x2e5c38){return{'model':db[_0x2e5c38[_0xae3d('0x22')]],'as':_0x2e5c38['as'],'attributes':_0x2e5c38[_0xae3d('0x1e')],'include':_0x2e5c38['include']?_[_0xae3d('0x20')](_0x2e5c38[_0xae3d('0x21')],function(_0x9241d0){return{'model':db[_0x9241d0[_0xae3d('0x22')]],'as':_0x9241d0['as'],'attributes':_0x9241d0[_0xae3d('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xae3d('0xd')](function(_0x4cb671){logger['info'](_0xae3d('0x25'),_0x41e219);logger[_0xae3d('0x10')](_0xae3d('0x25'),_0x41e219,JSON[_0xae3d('0x12')](_0x4cb671));_0x6c0592(_0x4cb671);})[_0xae3d('0x17')](function(_0x9251d4){logger[_0xae3d('0x13')](_0xae3d('0x25'),_0x9251d4[_0xae3d('0x15')],_0x41e219);_0x314bc1(_0x5d5b90[_0xae3d('0x13')](0x1f4,_0x9251d4[_0xae3d('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 9fa721b..d6c3f44 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 _0xdff9=['remove','update','emit','length','smsQueue:','./smsQueue.events','save'];(function(_0x53a81e,_0x2d7c3d){var _0x4a7dd4=function(_0xd69b49){while(--_0xd69b49){_0x53a81e['push'](_0x53a81e['shift']());}};_0x4a7dd4(++_0x2d7c3d);}(_0xdff9,0x1be));var _0x9dff=function(_0x125134,_0x42ce88){_0x125134=_0x125134-0x0;var _0xde3491=_0xdff9[_0x125134];return _0xde3491;};'use strict';var SmsQueueEvents=require(_0x9dff('0x0'));var events=[_0x9dff('0x1'),_0x9dff('0x2'),_0x9dff('0x3')];function createListener(_0x2bd684,_0x2a9981){return function(_0x5aaa76){_0x2a9981[_0x9dff('0x4')](_0x2bd684,_0x5aaa76);};}function removeListener(_0x446ec8,_0x3bfe7e){return function(){SmsQueueEvents['removeListener'](_0x446ec8,_0x3bfe7e);};}exports['register']=function(_0x46ac3d){for(var _0xad1e4d=0x0,_0xee67cb=events[_0x9dff('0x5')];_0xad1e4d<_0xee67cb;_0xad1e4d++){var _0x52f42e=events[_0xad1e4d];var _0x4b03f9=createListener(_0x9dff('0x6')+_0x52f42e,_0x46ac3d);SmsQueueEvents['on'](_0x52f42e,_0x4b03f9);}}; \ No newline at end of file +var _0x2b9d=['register','length','smsQueue:','./smsQueue.events','save','remove','update','emit','removeListener'];(function(_0x31c5c2,_0x368faf){var _0x12a859=function(_0x461027){while(--_0x461027){_0x31c5c2['push'](_0x31c5c2['shift']());}};_0x12a859(++_0x368faf);}(_0x2b9d,0x8a));var _0xd2b9=function(_0x27fdae,_0x45daa8){_0x27fdae=_0x27fdae-0x0;var _0x165d1e=_0x2b9d[_0x27fdae];return _0x165d1e;};'use strict';var SmsQueueEvents=require(_0xd2b9('0x0'));var events=[_0xd2b9('0x1'),_0xd2b9('0x2'),_0xd2b9('0x3')];function createListener(_0x478fbc,_0x34f123){return function(_0x4bc397){_0x34f123[_0xd2b9('0x4')](_0x478fbc,_0x4bc397);};}function removeListener(_0x3df45d,_0x599ee3){return function(){SmsQueueEvents[_0xd2b9('0x5')](_0x3df45d,_0x599ee3);};}exports[_0xd2b9('0x6')]=function(_0x3f7468){for(var _0x10af21=0x0,_0x5469f6=events[_0xd2b9('0x7')];_0x10af21<_0x5469f6;_0x10af21++){var _0x9d95c7=events[_0x10af21];var _0x5dddcb=createListener(_0xd2b9('0x8')+_0x9d95c7,_0x3f7468);SmsQueueEvents['on'](_0x9d95c7,_0x5dddcb);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index f0489a5..82ffa87 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 _0x6660=['show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x3a34c8,_0x543716){var _0x5ecd80=function(_0x266a9c){while(--_0x266a9c){_0x3a34c8['push'](_0x3a34c8['shift']());}};_0x5ecd80(++_0x543716);}(_0x6660,0xaf));var _0x0666=function(_0x36333f,_0x17bd3a){_0x36333f=_0x36333f-0x0;var _0x51e163=_0x6660[_0x36333f];return _0x51e163;};'use strict';var multer=require(_0x0666('0x0'));var util=require(_0x0666('0x1'));var path=require(_0x0666('0x2'));var timeout=require(_0x0666('0x3'));var express=require(_0x0666('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x0666('0x5'));var config=require(_0x0666('0x6'));var controller=require(_0x0666('0x7'));router[_0x0666('0x8')]('/',auth[_0x0666('0x9')](),controller[_0x0666('0xa')]);router[_0x0666('0x8')](_0x0666('0xb'),auth[_0x0666('0x9')](),controller[_0x0666('0xc')]);router[_0x0666('0x8')](_0x0666('0xd'),auth[_0x0666('0x9')](),controller[_0x0666('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x0666('0xf')]);router[_0x0666('0x10')]('/:id',auth[_0x0666('0x9')](),controller[_0x0666('0x11')]);router[_0x0666('0x12')]('/:id',auth[_0x0666('0x9')](),controller[_0x0666('0x13')]);module[_0x0666('0x14')]=router; \ No newline at end of file +var _0xcb39=['util','express','Router','../../components/auth/service','../../config/environment','get','index','/describe','isAuthenticated','/:id','show','post','create','update','delete','exports','multer'];(function(_0x3a6f6a,_0x1794b6){var _0x507b1c=function(_0x31c3b1){while(--_0x31c3b1){_0x3a6f6a['push'](_0x3a6f6a['shift']());}};_0x507b1c(++_0x1794b6);}(_0xcb39,0x76));var _0x9cb3=function(_0x2f0bf1,_0x183ef1){_0x2f0bf1=_0x2f0bf1-0x0;var _0xf1df38=_0xcb39[_0x2f0bf1];return _0xf1df38;};'use strict';var multer=require(_0x9cb3('0x0'));var util=require(_0x9cb3('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9cb3('0x2'));var router=express[_0x9cb3('0x3')]();var auth=require(_0x9cb3('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x9cb3('0x5'));var controller=require('./smsQueueReport.controller');router[_0x9cb3('0x6')]('/',auth['isAuthenticated'](),controller[_0x9cb3('0x7')]);router[_0x9cb3('0x6')](_0x9cb3('0x8'),auth[_0x9cb3('0x9')](),controller['describe']);router[_0x9cb3('0x6')](_0x9cb3('0xa'),auth[_0x9cb3('0x9')](),controller[_0x9cb3('0xb')]);router[_0x9cb3('0xc')]('/',auth['isAuthenticated'](),controller[_0x9cb3('0xd')]);router['put'](_0x9cb3('0xa'),auth['isAuthenticated'](),controller[_0x9cb3('0xe')]);router[_0x9cb3('0xf')](_0x9cb3('0xa'),auth[_0x9cb3('0x9')](),controller['destroy']);module[_0x9cb3('0x10')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 0c66c09..e541a63 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 _0x5a54=['moment','exports','STRING','DATE'];(function(_0x3d3ea9,_0x2c4750){var _0xa875e8=function(_0x36b29c){while(--_0x36b29c){_0x3d3ea9['push'](_0x3d3ea9['shift']());}};_0xa875e8(++_0x2c4750);}(_0x5a54,0xb8));var _0x45a5=function(_0x5f4c9c,_0x1550df){_0x5f4c9c=_0x5f4c9c-0x0;var _0x3de71b=_0x5a54[_0x5f4c9c];return _0x3de71b;};'use strict';var moment=require(_0x45a5('0x0'));var Sequelize=require('sequelize');module[_0x45a5('0x1')]={'uniqueid':{'type':Sequelize[_0x45a5('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x45a5('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x45a5('0x3')]},'exitAt':{'type':Sequelize[_0x45a5('0x3')]},'reason':{'type':Sequelize[_0x45a5('0x2')]}}; \ No newline at end of file +var _0x2b11=['sequelize','STRING','DATE','moment'];(function(_0x482d38,_0x298909){var _0x212765=function(_0x228a84){while(--_0x228a84){_0x482d38['push'](_0x482d38['shift']());}};_0x212765(++_0x298909);}(_0x2b11,0x87));var _0x12b1=function(_0x256b67,_0x14e47b){_0x256b67=_0x256b67-0x0;var _0x3e2d99=_0x2b11[_0x256b67];return _0x3e2d99;};'use strict';var moment=require(_0x12b1('0x0'));var Sequelize=require(_0x12b1('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x12b1('0x2')]},'joinAt':{'type':Sequelize[_0x12b1('0x3')]},'leaveAt':{'type':Sequelize[_0x12b1('0x3')]},'acceptAt':{'type':Sequelize[_0x12b1('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index a0f36fa..c6e3642 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 _0xb638=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','map','SmsQueueReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','find','create','body','describe','html-pdf','eml-format','rimraf','request-promise','moment','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x4388ee,_0x3d7dda){var _0x54fb43=function(_0x470704){while(--_0x470704){_0x4388ee['push'](_0x4388ee['shift']());}};_0x54fb43(++_0x3d7dda);}(_0xb638,0x83));var _0x8b63=function(_0x1c9e4d,_0x55f7e3){_0x1c9e4d=_0x1c9e4d-0x0;var _0x58e862=_0xb638[_0x1c9e4d];return _0x58e862;};'use strict';var pdf=require(_0x8b63('0x0'));var emlformat=require(_0x8b63('0x1'));var rimraf=require(_0x8b63('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8b63('0x3'));var moment=require(_0x8b63('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8b63('0x5'));var path=require(_0x8b63('0x6'));var sox=require(_0x8b63('0x7'));var csv=require(_0x8b63('0x8'));var ejs=require(_0x8b63('0x9'));var fs=require('fs');var _=require(_0x8b63('0xa'));var squel=require('squel');var crypto=require(_0x8b63('0xb'));var jsforce=require(_0x8b63('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x8b63('0x8'));var querystring=require(_0x8b63('0xd'));var Papa=require('papaparse');var Redis=require(_0x8b63('0xe'));var authService=require(_0x8b63('0xf'));var qs=require(_0x8b63('0x10'));var as=require(_0x8b63('0x11'));var hardwareService=require(_0x8b63('0x12'));var logger=require(_0x8b63('0x13'))(_0x8b63('0x14'));var utils=require(_0x8b63('0x15'));var config=require(_0x8b63('0x16'));var db=require(_0x8b63('0x17'))['db'];function respondWithStatusCode(_0x13aa4d,_0x2489c4){_0x2489c4=_0x2489c4||0xcc;return function(_0x3c8b21){if(_0x3c8b21){return _0x13aa4d[_0x8b63('0x18')](_0x2489c4);}return _0x13aa4d['status'](_0x2489c4)['end']();};}function respondWithResult(_0x168392,_0x5a7644){_0x5a7644=_0x5a7644||0xc8;return function(_0x179330){if(_0x179330){return _0x168392[_0x8b63('0x19')](_0x5a7644)[_0x8b63('0x1a')](_0x179330);}};}function respondWithFilteredResult(_0x923878,_0x54d868){return function(_0x7f5c13){if(_0x7f5c13){var _0xc7a946=_0x7f5c13[_0x8b63('0x1b')],_0x171f67=_0x54d868[_0x8b63('0x1c')],_0x107d57=_0x54d868[_0x8b63('0x1c')]+_0x54d868['limit'],_0x1bed38;if(_0x107d57>=_0xc7a946){_0x107d57=_0xc7a946;_0x1bed38=0xc8;}else{_0x1bed38=0xce;}_0x923878[_0x8b63('0x19')](_0x1bed38);return _0x923878['set'](_0x8b63('0x1d'),_0x171f67+'-'+_0x107d57+'/'+_0xc7a946)[_0x8b63('0x1a')](_0x7f5c13);}return null;};}function patchUpdates(_0x331754){return function(_0x280d13){try{jsonpatch[_0x8b63('0x1e')](_0x280d13,_0x331754,!![]);}catch(_0x327f15){return BPromise[_0x8b63('0x1f')](_0x327f15);}return _0x280d13[_0x8b63('0x20')]();};}function saveUpdates(_0x20bd65,_0x254371){return function(_0x36174b){if(_0x36174b){return _0x36174b[_0x8b63('0x21')](_0x20bd65)[_0x8b63('0x22')](function(_0x229e95){return _0x229e95;});}return null;};}function removeEntity(_0x4c32a9,_0x413335){return function(_0x43442d){if(_0x43442d){return _0x43442d[_0x8b63('0x23')]()[_0x8b63('0x22')](function(){_0x4c32a9[_0x8b63('0x19')](0xcc)[_0x8b63('0x24')]();});}};}function handleEntityNotFound(_0x2935a0,_0x5a9c39){return function(_0x3ce953){if(!_0x3ce953){_0x2935a0['sendStatus'](0x194);}return _0x3ce953;};}function handleError(_0x25d1b9,_0x15552c){_0x15552c=_0x15552c||0x1f4;return function(_0x171201){logger[_0x8b63('0x25')](_0x171201['stack']);if(_0x171201[_0x8b63('0x26')]){delete _0x171201[_0x8b63('0x26')];}_0x25d1b9[_0x8b63('0x19')](_0x15552c)[_0x8b63('0x27')](_0x171201);};}exports[_0x8b63('0x28')]=function(_0x43cbdd,_0x43aa06){var _0x2733da={},_0x2a1dbc={},_0x17b065={'count':0x0,'rows':[]};var _0x2c873d=_[_0x8b63('0x29')](db[_0x8b63('0x2a')][_0x8b63('0x2b')],function(_0x38a18c){return{'name':_0x38a18c[_0x8b63('0x2c')],'type':_0x38a18c[_0x8b63('0x2d')]['key']};});_0x2a1dbc[_0x8b63('0x2e')]=_[_0x8b63('0x29')](_0x2c873d,'name');_0x2a1dbc[_0x8b63('0x2f')]=_[_0x8b63('0x30')](_0x43cbdd[_0x8b63('0x2f')]);_0x2a1dbc[_0x8b63('0x31')]=_[_0x8b63('0x32')](_0x2a1dbc['model'],_0x2a1dbc[_0x8b63('0x2f')]);_0x2733da['attributes']=_['intersection'](_0x2a1dbc[_0x8b63('0x2e')],qs[_0x8b63('0x33')](_0x43cbdd['query'][_0x8b63('0x33')]));_0x2733da[_0x8b63('0x34')]=_0x2733da['attributes'][_0x8b63('0x35')]?_0x2733da['attributes']:_0x2a1dbc[_0x8b63('0x2e')];if(!_0x43cbdd['query'][_0x8b63('0x36')]('nolimit')){_0x2733da['limit']=qs[_0x8b63('0x37')](_0x43cbdd[_0x8b63('0x2f')][_0x8b63('0x37')]);_0x2733da['offset']=qs[_0x8b63('0x1c')](_0x43cbdd[_0x8b63('0x2f')]['offset']);}_0x2733da[_0x8b63('0x38')]=qs[_0x8b63('0x39')](_0x43cbdd['query'][_0x8b63('0x39')]);_0x2733da[_0x8b63('0x3a')]=qs['filters'](_[_0x8b63('0x3b')](_0x43cbdd[_0x8b63('0x2f')],_0x2a1dbc[_0x8b63('0x31')]));if(_0x43cbdd[_0x8b63('0x2f')][_0x8b63('0x3c')]){_0x2733da['where']=_['merge'](_0x2733da['where'],{'$or':_['map'](_0x2c873d,function(_0x2d75e3){if(_0x2d75e3[_0x8b63('0x2d')]!==_0x8b63('0x3d')){var _0x7944e1={};_0x7944e1[_0x2d75e3[_0x8b63('0x26')]]={'$like':'%'+_0x43cbdd[_0x8b63('0x2f')][_0x8b63('0x3c')]+'%'};return _0x7944e1;}})});}_0x2733da=_[_0x8b63('0x3e')]({},_0x2733da,_0x43cbdd[_0x8b63('0x3f')]);var _0x4576df={'where':_0x2733da['where']};return db[_0x8b63('0x2a')]['count'](_0x4576df)[_0x8b63('0x22')](function(_0x322a89){_0x17b065[_0x8b63('0x1b')]=_0x322a89;if(_0x43cbdd['query']['includeAll']){_0x2733da[_0x8b63('0x40')]=[{'all':!![]}];}return db[_0x8b63('0x2a')][_0x8b63('0x41')](_0x2733da);})[_0x8b63('0x22')](function(_0x52afdc){_0x17b065[_0x8b63('0x42')]=_0x52afdc;return _0x17b065;})['then'](respondWithFilteredResult(_0x43aa06,_0x2733da))[_0x8b63('0x43')](handleError(_0x43aa06,null));};exports[_0x8b63('0x44')]=function(_0x2d47fb,_0x43faa4){var _0x26194b={'raw':!![],'where':{'id':_0x2d47fb[_0x8b63('0x45')]['id']}},_0x1818a2={};_0x1818a2[_0x8b63('0x2e')]=_[_0x8b63('0x30')](db['SmsQueueReport'][_0x8b63('0x2b')]);_0x1818a2[_0x8b63('0x2f')]=_[_0x8b63('0x30')](_0x2d47fb['query']);_0x1818a2['filters']=_['intersection'](_0x1818a2[_0x8b63('0x2e')],_0x1818a2['query']);_0x26194b[_0x8b63('0x34')]=_['intersection'](_0x1818a2[_0x8b63('0x2e')],qs['fields'](_0x2d47fb['query'][_0x8b63('0x33')]));_0x26194b['attributes']=_0x26194b['attributes'][_0x8b63('0x35')]?_0x26194b[_0x8b63('0x34')]:_0x1818a2[_0x8b63('0x2e')];if(_0x2d47fb[_0x8b63('0x2f')]['includeAll']){_0x26194b[_0x8b63('0x40')]=[{'all':!![]}];}_0x26194b=_[_0x8b63('0x3e')]({},_0x26194b,_0x2d47fb['options']);return db[_0x8b63('0x2a')][_0x8b63('0x46')](_0x26194b)[_0x8b63('0x22')](handleEntityNotFound(_0x43faa4,null))['then'](respondWithResult(_0x43faa4,null))[_0x8b63('0x43')](handleError(_0x43faa4,null));};exports[_0x8b63('0x47')]=function(_0x361e6e,_0x3dd49f){return db[_0x8b63('0x2a')]['create'](_0x361e6e['body'],{})[_0x8b63('0x22')](respondWithResult(_0x3dd49f,0xc9))[_0x8b63('0x43')](handleError(_0x3dd49f,null));};exports[_0x8b63('0x21')]=function(_0x30e265,_0xc8d12b){if(_0x30e265[_0x8b63('0x48')]['id']){delete _0x30e265[_0x8b63('0x48')]['id'];}return db['SmsQueueReport'][_0x8b63('0x46')]({'where':{'id':_0x30e265['params']['id']}})[_0x8b63('0x22')](handleEntityNotFound(_0xc8d12b,null))['then'](saveUpdates(_0x30e265[_0x8b63('0x48')],null))[_0x8b63('0x22')](respondWithResult(_0xc8d12b,null))['catch'](handleError(_0xc8d12b,null));};exports[_0x8b63('0x23')]=function(_0xde6624,_0x31f2be){return db[_0x8b63('0x2a')]['find']({'where':{'id':_0xde6624[_0x8b63('0x45')]['id']}})[_0x8b63('0x22')](handleEntityNotFound(_0x31f2be,null))['then'](removeEntity(_0x31f2be,null))[_0x8b63('0x43')](handleError(_0x31f2be,null));};exports[_0x8b63('0x49')]=function(_0x42800b,_0x20e9fc){return db[_0x8b63('0x2a')][_0x8b63('0x49')]()[_0x8b63('0x22')](respondWithResult(_0x20e9fc,null))[_0x8b63('0x43')](handleError(_0x20e9fc,null));}; \ No newline at end of file +var _0x4c14=['squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','set','Content-Range','json','reject','then','end','error','stack','name','send','index','SmsQueueReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','type','options','includeAll','rows','show','params','include','find','catch','create','body','update','destroy','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash'];(function(_0x233a52,_0x5ee829){var _0x16b7c9=function(_0x1d373d){while(--_0x1d373d){_0x233a52['push'](_0x233a52['shift']());}};_0x16b7c9(++_0x5ee829);}(_0x4c14,0x167));var _0x44c1=function(_0x4d031a,_0x625b5d){_0x4d031a=_0x4d031a-0x0;var _0x35a74c=_0x4c14[_0x4d031a];return _0x35a74c;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x44c1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x44c1('0x1'));var jsonpatch=require(_0x44c1('0x2'));var rp=require('request-promise');var moment=require(_0x44c1('0x3'));var BPromise=require(_0x44c1('0x4'));var Mustache=require(_0x44c1('0x5'));var util=require(_0x44c1('0x6'));var path=require(_0x44c1('0x7'));var sox=require(_0x44c1('0x8'));var csv=require('to-csv');var ejs=require(_0x44c1('0x9'));var fs=require('fs');var _=require(_0x44c1('0xa'));var squel=require(_0x44c1('0xb'));var crypto=require('crypto');var jsforce=require(_0x44c1('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x44c1('0xd'));var querystring=require(_0x44c1('0xe'));var Papa=require(_0x44c1('0xf'));var Redis=require(_0x44c1('0x10'));var authService=require(_0x44c1('0x11'));var qs=require(_0x44c1('0x12'));var as=require(_0x44c1('0x13'));var hardwareService=require(_0x44c1('0x14'));var logger=require(_0x44c1('0x15'))(_0x44c1('0x16'));var utils=require(_0x44c1('0x17'));var config=require(_0x44c1('0x18'));var db=require(_0x44c1('0x19'))['db'];function respondWithStatusCode(_0x12749c,_0xae0104){_0xae0104=_0xae0104||0xcc;return function(_0xbb57d7){if(_0xbb57d7){return _0x12749c[_0x44c1('0x1a')](_0xae0104);}return _0x12749c[_0x44c1('0x1b')](_0xae0104)['end']();};}function respondWithResult(_0x3a50a8,_0x4d49c8){_0x4d49c8=_0x4d49c8||0xc8;return function(_0x128e50){if(_0x128e50){return _0x3a50a8['status'](_0x4d49c8)['json'](_0x128e50);}};}function respondWithFilteredResult(_0x577fb4,_0x137f91){return function(_0x4e20d0){if(_0x4e20d0){var _0x3ae471=_0x4e20d0[_0x44c1('0x1c')],_0x58a89f=_0x137f91[_0x44c1('0x1d')],_0x1f93e1=_0x137f91[_0x44c1('0x1d')]+_0x137f91[_0x44c1('0x1e')],_0x8029d8;if(_0x1f93e1>=_0x3ae471){_0x1f93e1=_0x3ae471;_0x8029d8=0xc8;}else{_0x8029d8=0xce;}_0x577fb4[_0x44c1('0x1b')](_0x8029d8);return _0x577fb4[_0x44c1('0x1f')](_0x44c1('0x20'),_0x58a89f+'-'+_0x1f93e1+'/'+_0x3ae471)[_0x44c1('0x21')](_0x4e20d0);}return null;};}function patchUpdates(_0xcbb712){return function(_0xa7a8a7){try{jsonpatch['apply'](_0xa7a8a7,_0xcbb712,!![]);}catch(_0x47b7e8){return BPromise[_0x44c1('0x22')](_0x47b7e8);}return _0xa7a8a7['save']();};}function saveUpdates(_0x1df2fb,_0x5741cd){return function(_0x543e4e){if(_0x543e4e){return _0x543e4e['update'](_0x1df2fb)['then'](function(_0xe28162){return _0xe28162;});}return null;};}function removeEntity(_0x319450,_0x4284e2){return function(_0x29d2fb){if(_0x29d2fb){return _0x29d2fb['destroy']()[_0x44c1('0x23')](function(){_0x319450[_0x44c1('0x1b')](0xcc)[_0x44c1('0x24')]();});}};}function handleEntityNotFound(_0x4b8556,_0x56619a){return function(_0x1a6dd4){if(!_0x1a6dd4){_0x4b8556[_0x44c1('0x1a')](0x194);}return _0x1a6dd4;};}function handleError(_0x54c839,_0x3e5e7b){_0x3e5e7b=_0x3e5e7b||0x1f4;return function(_0x3f98e2){logger[_0x44c1('0x25')](_0x3f98e2[_0x44c1('0x26')]);if(_0x3f98e2[_0x44c1('0x27')]){delete _0x3f98e2[_0x44c1('0x27')];}_0x54c839['status'](_0x3e5e7b)[_0x44c1('0x28')](_0x3f98e2);};}exports[_0x44c1('0x29')]=function(_0x629869,_0x5dac3e){var _0x401175={},_0x11f8c6={},_0x44cb1f={'count':0x0,'rows':[]};var _0x5e66dc=_['map'](db[_0x44c1('0x2a')][_0x44c1('0x2b')],function(_0x139d72){return{'name':_0x139d72[_0x44c1('0x2c')],'type':_0x139d72['type'][_0x44c1('0x2d')]};});_0x11f8c6[_0x44c1('0x2e')]=_['map'](_0x5e66dc,_0x44c1('0x27'));_0x11f8c6[_0x44c1('0x2f')]=_[_0x44c1('0x30')](_0x629869[_0x44c1('0x2f')]);_0x11f8c6[_0x44c1('0x31')]=_[_0x44c1('0x32')](_0x11f8c6['model'],_0x11f8c6[_0x44c1('0x2f')]);_0x401175['attributes']=_[_0x44c1('0x32')](_0x11f8c6[_0x44c1('0x2e')],qs[_0x44c1('0x33')](_0x629869['query'][_0x44c1('0x33')]));_0x401175[_0x44c1('0x34')]=_0x401175['attributes']['length']?_0x401175[_0x44c1('0x34')]:_0x11f8c6[_0x44c1('0x2e')];if(!_0x629869['query'][_0x44c1('0x35')]('nolimit')){_0x401175[_0x44c1('0x1e')]=qs[_0x44c1('0x1e')](_0x629869[_0x44c1('0x2f')][_0x44c1('0x1e')]);_0x401175[_0x44c1('0x1d')]=qs['offset'](_0x629869[_0x44c1('0x2f')]['offset']);}_0x401175[_0x44c1('0x36')]=qs[_0x44c1('0x37')](_0x629869[_0x44c1('0x2f')][_0x44c1('0x37')]);_0x401175[_0x44c1('0x38')]=qs[_0x44c1('0x31')](_[_0x44c1('0x39')](_0x629869[_0x44c1('0x2f')],_0x11f8c6[_0x44c1('0x31')]));if(_0x629869['query'][_0x44c1('0x3a')]){_0x401175[_0x44c1('0x38')]=_[_0x44c1('0x3b')](_0x401175[_0x44c1('0x38')],{'$or':_['map'](_0x5e66dc,function(_0x5b8955){if(_0x5b8955[_0x44c1('0x3c')]!=='VIRTUAL'){var _0x111c73={};_0x111c73[_0x5b8955[_0x44c1('0x27')]]={'$like':'%'+_0x629869['query']['filter']+'%'};return _0x111c73;}})});}_0x401175=_[_0x44c1('0x3b')]({},_0x401175,_0x629869[_0x44c1('0x3d')]);var _0x3cbd51={'where':_0x401175[_0x44c1('0x38')]};return db[_0x44c1('0x2a')][_0x44c1('0x1c')](_0x3cbd51)[_0x44c1('0x23')](function(_0x5f0f61){_0x44cb1f[_0x44c1('0x1c')]=_0x5f0f61;if(_0x629869['query'][_0x44c1('0x3e')]){_0x401175['include']=[{'all':!![]}];}return db['SmsQueueReport']['findAll'](_0x401175);})['then'](function(_0x1fdec2){_0x44cb1f[_0x44c1('0x3f')]=_0x1fdec2;return _0x44cb1f;})['then'](respondWithFilteredResult(_0x5dac3e,_0x401175))['catch'](handleError(_0x5dac3e,null));};exports[_0x44c1('0x40')]=function(_0x506150,_0x1e562b){var _0x2c304b={'raw':!![],'where':{'id':_0x506150[_0x44c1('0x41')]['id']}},_0x522dc8={};_0x522dc8[_0x44c1('0x2e')]=_[_0x44c1('0x30')](db['SmsQueueReport']['rawAttributes']);_0x522dc8[_0x44c1('0x2f')]=_[_0x44c1('0x30')](_0x506150[_0x44c1('0x2f')]);_0x522dc8[_0x44c1('0x31')]=_[_0x44c1('0x32')](_0x522dc8[_0x44c1('0x2e')],_0x522dc8[_0x44c1('0x2f')]);_0x2c304b['attributes']=_[_0x44c1('0x32')](_0x522dc8[_0x44c1('0x2e')],qs[_0x44c1('0x33')](_0x506150[_0x44c1('0x2f')][_0x44c1('0x33')]));_0x2c304b[_0x44c1('0x34')]=_0x2c304b[_0x44c1('0x34')]['length']?_0x2c304b[_0x44c1('0x34')]:_0x522dc8[_0x44c1('0x2e')];if(_0x506150[_0x44c1('0x2f')][_0x44c1('0x3e')]){_0x2c304b[_0x44c1('0x42')]=[{'all':!![]}];}_0x2c304b=_[_0x44c1('0x3b')]({},_0x2c304b,_0x506150[_0x44c1('0x3d')]);return db[_0x44c1('0x2a')][_0x44c1('0x43')](_0x2c304b)[_0x44c1('0x23')](handleEntityNotFound(_0x1e562b,null))[_0x44c1('0x23')](respondWithResult(_0x1e562b,null))[_0x44c1('0x44')](handleError(_0x1e562b,null));};exports['create']=function(_0x82c782,_0x25f25b){return db[_0x44c1('0x2a')][_0x44c1('0x45')](_0x82c782[_0x44c1('0x46')],{})[_0x44c1('0x23')](respondWithResult(_0x25f25b,0xc9))['catch'](handleError(_0x25f25b,null));};exports[_0x44c1('0x47')]=function(_0x3a7bab,_0x340c8c){if(_0x3a7bab['body']['id']){delete _0x3a7bab[_0x44c1('0x46')]['id'];}return db[_0x44c1('0x2a')][_0x44c1('0x43')]({'where':{'id':_0x3a7bab[_0x44c1('0x41')]['id']}})[_0x44c1('0x23')](handleEntityNotFound(_0x340c8c,null))['then'](saveUpdates(_0x3a7bab[_0x44c1('0x46')],null))['then'](respondWithResult(_0x340c8c,null))[_0x44c1('0x44')](handleError(_0x340c8c,null));};exports[_0x44c1('0x48')]=function(_0x2fbec9,_0x1eb41c){return db[_0x44c1('0x2a')][_0x44c1('0x43')]({'where':{'id':_0x2fbec9[_0x44c1('0x41')]['id']}})['then'](handleEntityNotFound(_0x1eb41c,null))[_0x44c1('0x23')](removeEntity(_0x1eb41c,null))[_0x44c1('0x44')](handleError(_0x1eb41c,null));};exports['describe']=function(_0x2292fc,_0x49ef37){return db[_0x44c1('0x2a')][_0x44c1('0x49')]()[_0x44c1('0x23')](respondWithResult(_0x49ef37,null))[_0x44c1('0x44')](handleError(_0x49ef37,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 9b18eab..cc943a3 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 _0xe0b2=['report_sms_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./smsQueueReport.attributes','exports','define'];(function(_0x4d9fd8,_0x5f27b7){var _0x16b798=function(_0x3ec1bd){while(--_0x3ec1bd){_0x4d9fd8['push'](_0x4d9fd8['shift']());}};_0x16b798(++_0x5f27b7);}(_0xe0b2,0xec));var _0x2e0b=function(_0xb7764d,_0x3e7d87){_0xb7764d=_0xb7764d-0x0;var _0x14dcbf=_0xe0b2[_0xb7764d];return _0x14dcbf;};'use strict';var _=require('lodash');var util=require(_0x2e0b('0x0'));var logger=require(_0x2e0b('0x1'))(_0x2e0b('0x2'));var moment=require(_0x2e0b('0x3'));var BPromise=require(_0x2e0b('0x4'));var rp=require(_0x2e0b('0x5'));var fs=require('fs');var path=require(_0x2e0b('0x6'));var rimraf=require('rimraf');var config=require(_0x2e0b('0x7'));var attributes=require(_0x2e0b('0x8'));module[_0x2e0b('0x9')]=function(_0x2a3a82,_0x1b8455){return _0x2a3a82[_0x2e0b('0xa')]('SmsQueueReport',attributes,{'tableName':_0x2e0b('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x2e0b('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdc28=['report_sms_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','SmsQueueReport'];(function(_0x43b4b5,_0x3efc1b){var _0x2df432=function(_0x10b3bb){while(--_0x10b3bb){_0x43b4b5['push'](_0x43b4b5['shift']());}};_0x2df432(++_0x3efc1b);}(_0xdc28,0x12d));var _0x8dc2=function(_0x169ac9,_0x846ae4){_0x169ac9=_0x169ac9-0x0;var _0x15a0a5=_0xdc28[_0x169ac9];return _0x15a0a5;};'use strict';var _=require(_0x8dc2('0x0'));var util=require(_0x8dc2('0x1'));var logger=require(_0x8dc2('0x2'))(_0x8dc2('0x3'));var moment=require(_0x8dc2('0x4'));var BPromise=require(_0x8dc2('0x5'));var rp=require(_0x8dc2('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8dc2('0x7'));var config=require(_0x8dc2('0x8'));var attributes=require('./smsQueueReport.attributes');module[_0x8dc2('0x9')]=function(_0x56ae7c,_0x200585){return _0x56ae7c['define'](_0x8dc2('0xa'),attributes,{'tableName':_0x8dc2('0xb'),'paranoid':![],'indexes':[{'name':_0x8dc2('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 6a719ec..5116bd5 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 _0xf076=['then','info','SmsQueueReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','CreateSmsQueueReport','SmsQueueReport','body','options','raw','UpdateSmsQueueReport','update','where','attributes','limit','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xf076,0x115));var _0x6f07=function(_0x58cbb0,_0x69ce7c){_0x58cbb0=_0x58cbb0-0x0;var _0x38d8ab=_0xf076[_0x58cbb0];return _0x38d8ab;};'use strict';var _=require('lodash');var util=require(_0x6f07('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6f07('0x1'));var fs=require('fs');var Redis=require(_0x6f07('0x2'));var db=require(_0x6f07('0x3'))['db'];var utils=require(_0x6f07('0x4'));var logger=require(_0x6f07('0x5'))(_0x6f07('0x6'));var config=require(_0x6f07('0x7'));var jayson=require(_0x6f07('0x8'));var client=jayson[_0x6f07('0x9')][_0x6f07('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5a5ec7,_0x19260e,_0xd029fa){return new BPromise(function(_0x447505,_0x3edb2d){return client['request'](_0x5a5ec7,_0xd029fa)[_0x6f07('0xb')](function(_0x3150d3){logger[_0x6f07('0xc')](_0x6f07('0xd'),_0x19260e,'request\x20sent');logger[_0x6f07('0xe')]('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x19260e,_0x6f07('0xf'),JSON[_0x6f07('0x10')](_0x3150d3));if(_0x3150d3[_0x6f07('0x11')]){if(_0x3150d3[_0x6f07('0x11')][_0x6f07('0x12')]===0x1f4){logger[_0x6f07('0x11')](_0x6f07('0xd'),_0x19260e,_0x3150d3['error'][_0x6f07('0x13')]);return _0x3edb2d(_0x3150d3['error'][_0x6f07('0x13')]);}logger[_0x6f07('0x11')](_0x6f07('0xd'),_0x19260e,_0x3150d3[_0x6f07('0x11')][_0x6f07('0x13')]);return _0x447505(_0x3150d3[_0x6f07('0x11')][_0x6f07('0x13')]);}else{logger[_0x6f07('0xc')](_0x6f07('0xd'),_0x19260e,'request\x20sent');_0x447505(_0x3150d3[_0x6f07('0x14')][_0x6f07('0x13')]);}})[_0x6f07('0x15')](function(_0x3a4cfb){logger[_0x6f07('0x11')]('SmsQueueReport,\x20%s,\x20%s',_0x19260e,_0x3a4cfb);_0x3edb2d(_0x3a4cfb);});});}exports[_0x6f07('0x16')]=function(_0x15ff99){var _0x373b32=this;return new Promise(function(_0x406148,_0x87aa8f){return db[_0x6f07('0x17')]['create'](_0x15ff99[_0x6f07('0x18')],{'raw':_0x15ff99[_0x6f07('0x19')]?_0x15ff99[_0x6f07('0x19')][_0x6f07('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x36fcb4){logger[_0x6f07('0xc')]('CreateSmsQueueReport',_0x15ff99);logger[_0x6f07('0xe')](_0x6f07('0x16'),_0x15ff99,JSON[_0x6f07('0x10')](_0x36fcb4));_0x406148(_0x36fcb4);})['catch'](function(_0x35a4a5){logger[_0x6f07('0x11')](_0x6f07('0x16'),_0x35a4a5[_0x6f07('0x13')],_0x15ff99);_0x87aa8f(_0x373b32[_0x6f07('0x11')](0x1f4,_0x35a4a5[_0x6f07('0x13')]));});});};exports[_0x6f07('0x1b')]=function(_0xbc7dd){var _0x4c0962=this;return new Promise(function(_0x4fb829,_0x5a9f52){return db['SmsQueueReport'][_0x6f07('0x1c')](_0xbc7dd[_0x6f07('0x18')],{'raw':_0xbc7dd[_0x6f07('0x19')]?_0xbc7dd['options'][_0x6f07('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xbc7dd[_0x6f07('0x19')]?_0xbc7dd[_0x6f07('0x19')][_0x6f07('0x1d')]||null:null,'attributes':_0xbc7dd[_0x6f07('0x19')]?_0xbc7dd[_0x6f07('0x19')][_0x6f07('0x1e')]||null:null,'limit':_0xbc7dd[_0x6f07('0x19')]?_0xbc7dd['options'][_0x6f07('0x1f')]||null:null})[_0x6f07('0xb')](function(_0x213f7b){logger[_0x6f07('0xc')](_0x6f07('0x1b'),_0xbc7dd);logger[_0x6f07('0xe')](_0x6f07('0x1b'),_0xbc7dd,JSON[_0x6f07('0x10')](_0x213f7b));_0x4fb829(_0x213f7b);})[_0x6f07('0x15')](function(_0x2792e5){logger['error'](_0x6f07('0x1b'),_0x2792e5['message'],_0xbc7dd);_0x5a9f52(_0x4c0962[_0x6f07('0x11')](0x1f4,_0x2792e5[_0x6f07('0x13')]));});});}; \ No newline at end of file +var _0xa791=['SmsQueueReport','create','options','raw','then','UpdateSmsQueueReport','update','body','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','CreateSmsQueueReport'];(function(_0x369153,_0x38c457){var _0x357813=function(_0x1a314b){while(--_0x1a314b){_0x369153['push'](_0x369153['shift']());}};_0x357813(++_0x38c457);}(_0xa791,0x1e8));var _0x1a79=function(_0x3933d5,_0xc7698f){_0x3933d5=_0x3933d5-0x0;var _0x48a4a7=_0xa791[_0x3933d5];return _0x48a4a7;};'use strict';var _=require(_0x1a79('0x0'));var util=require(_0x1a79('0x1'));var moment=require(_0x1a79('0x2'));var BPromise=require(_0x1a79('0x3'));var rs=require(_0x1a79('0x4'));var fs=require('fs');var Redis=require(_0x1a79('0x5'));var db=require(_0x1a79('0x6'))['db'];var utils=require(_0x1a79('0x7'));var logger=require(_0x1a79('0x8'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1a79('0x9')][_0x1a79('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x138b03,_0x1e4db6,_0x144b09){return new BPromise(function(_0x4c2e56,_0x579e5e){return client[_0x1a79('0xb')](_0x138b03,_0x144b09)['then'](function(_0x56b3fa){logger[_0x1a79('0xc')](_0x1a79('0xd'),_0x1e4db6,_0x1a79('0xe'));logger[_0x1a79('0xf')]('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x1e4db6,_0x1a79('0xe'),JSON[_0x1a79('0x10')](_0x56b3fa));if(_0x56b3fa[_0x1a79('0x11')]){if(_0x56b3fa[_0x1a79('0x11')]['code']===0x1f4){logger['error'](_0x1a79('0xd'),_0x1e4db6,_0x56b3fa['error']['message']);return _0x579e5e(_0x56b3fa[_0x1a79('0x11')][_0x1a79('0x12')]);}logger['error'](_0x1a79('0xd'),_0x1e4db6,_0x56b3fa[_0x1a79('0x11')][_0x1a79('0x12')]);return _0x4c2e56(_0x56b3fa['error']['message']);}else{logger[_0x1a79('0xc')](_0x1a79('0xd'),_0x1e4db6,_0x1a79('0xe'));_0x4c2e56(_0x56b3fa[_0x1a79('0x13')][_0x1a79('0x12')]);}})[_0x1a79('0x14')](function(_0x238626){logger[_0x1a79('0x11')](_0x1a79('0xd'),_0x1e4db6,_0x238626);_0x579e5e(_0x238626);});});}exports[_0x1a79('0x15')]=function(_0x3a8281){var _0x1bbd98=this;return new Promise(function(_0x345117,_0x1afdea){return db[_0x1a79('0x16')][_0x1a79('0x17')](_0x3a8281['body'],{'raw':_0x3a8281[_0x1a79('0x18')]?_0x3a8281[_0x1a79('0x18')][_0x1a79('0x19')]===undefined?!![]:![]:!![]})[_0x1a79('0x1a')](function(_0x52ef8f){logger['info']('CreateSmsQueueReport',_0x3a8281);logger[_0x1a79('0xf')](_0x1a79('0x15'),_0x3a8281,JSON[_0x1a79('0x10')](_0x52ef8f));_0x345117(_0x52ef8f);})[_0x1a79('0x14')](function(_0x282757){logger[_0x1a79('0x11')]('CreateSmsQueueReport',_0x282757[_0x1a79('0x12')],_0x3a8281);_0x1afdea(_0x1bbd98['error'](0x1f4,_0x282757['message']));});});};exports[_0x1a79('0x1b')]=function(_0x4f0d83){var _0xe609ac=this;return new Promise(function(_0x20c67c,_0x432d17){return db[_0x1a79('0x16')][_0x1a79('0x1c')](_0x4f0d83[_0x1a79('0x1d')],{'raw':_0x4f0d83[_0x1a79('0x18')]?_0x4f0d83['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f0d83[_0x1a79('0x18')]?_0x4f0d83['options']['where']||null:null,'attributes':_0x4f0d83[_0x1a79('0x18')]?_0x4f0d83[_0x1a79('0x18')]['attributes']||null:null,'limit':_0x4f0d83[_0x1a79('0x18')]?_0x4f0d83[_0x1a79('0x18')]['limit']||null:null})[_0x1a79('0x1a')](function(_0x2a8978){logger['info'](_0x1a79('0x1b'),_0x4f0d83);logger[_0x1a79('0xf')](_0x1a79('0x1b'),_0x4f0d83,JSON[_0x1a79('0x10')](_0x2a8978));_0x20c67c(_0x2a8978);})[_0x1a79('0x14')](function(_0x43671){logger['error'](_0x1a79('0x1b'),_0x43671[_0x1a79('0x12')],_0x4f0d83);_0x432d17(_0xe609ac['error'](0x1f4,_0x43671[_0x1a79('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 672d248..11265e9 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 _0xb62e=['path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','index','/describe','describe','/:id','isAuthenticated','create','put','update','delete','destroy','multer','util'];(function(_0x1fb4e1,_0x3d4ce6){var _0x22d1b0=function(_0x553822){while(--_0x553822){_0x1fb4e1['push'](_0x1fb4e1['shift']());}};_0x22d1b0(++_0x3d4ce6);}(_0xb62e,0x1de));var _0xeb62=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xb62e[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0xeb62('0x0'));var util=require(_0xeb62('0x1'));var path=require(_0xeb62('0x2'));var timeout=require(_0xeb62('0x3'));var express=require('express');var router=express[_0xeb62('0x4')]();var auth=require(_0xeb62('0x5'));var interaction=require(_0xeb62('0x6'));var config=require(_0xeb62('0x7'));var controller=require(_0xeb62('0x8'));router[_0xeb62('0x9')]('/',auth['isAuthenticated'](),controller[_0xeb62('0xa')]);router[_0xeb62('0x9')](_0xeb62('0xb'),auth['isAuthenticated'](),controller[_0xeb62('0xc')]);router[_0xeb62('0x9')](_0xeb62('0xd'),auth[_0xeb62('0xe')](),controller['show']);router['post']('/',auth[_0xeb62('0xe')](),controller[_0xeb62('0xf')]);router[_0xeb62('0x10')](_0xeb62('0xd'),auth[_0xeb62('0xe')](),controller[_0xeb62('0x11')]);router[_0xeb62('0x12')](_0xeb62('0xd'),auth[_0xeb62('0xe')](),controller[_0xeb62('0x13')]);module['exports']=router; \ No newline at end of file +var _0x34b7=['/:id','put','update','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe'];(function(_0x1be699,_0x9011d8){var _0x1bddaf=function(_0x22d542){while(--_0x22d542){_0x1be699['push'](_0x1be699['shift']());}};_0x1bddaf(++_0x9011d8);}(_0x34b7,0x196));var _0x734b=function(_0xdb951d,_0x1dc42b){_0xdb951d=_0xdb951d-0x0;var _0x5e789e=_0x34b7[_0xdb951d];return _0x5e789e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x734b('0x0'));var timeout=require(_0x734b('0x1'));var express=require(_0x734b('0x2'));var router=express[_0x734b('0x3')]();var auth=require(_0x734b('0x4'));var interaction=require(_0x734b('0x5'));var config=require('../../config/environment');var controller=require('./smsTransferReport.controller');router[_0x734b('0x6')]('/',auth[_0x734b('0x7')](),controller[_0x734b('0x8')]);router[_0x734b('0x6')](_0x734b('0x9'),auth[_0x734b('0x7')](),controller['describe']);router[_0x734b('0x6')](_0x734b('0xa'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x734b('0x7')](),controller['create']);router[_0x734b('0xb')](_0x734b('0xa'),auth[_0x734b('0x7')](),controller[_0x734b('0xc')]);router[_0x734b('0xd')](_0x734b('0xa'),auth[_0x734b('0x7')](),controller[_0x734b('0xe')]);module[_0x734b('0xf')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 4dd12fb..0ecef31 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 _0xcace=['agent','NOW','sequelize','exports','STRING'];(function(_0x224ba5,_0x1aa602){var _0x1f8d7e=function(_0x250278){while(--_0x250278){_0x224ba5['push'](_0x224ba5['shift']());}};_0x1f8d7e(++_0x1aa602);}(_0xcace,0xca));var _0xecac=function(_0x54fadc,_0x1fb2a8){_0x54fadc=_0x54fadc-0x0;var _0x2cc5e8=_0xcace[_0x54fadc];return _0x2cc5e8;};'use strict';var moment=require('moment');var Sequelize=require(_0xecac('0x0'));module[_0xecac('0x1')]={'uniqueid':{'type':Sequelize[_0xecac('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('account',_0xecac('0x3'),'queue'),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0xecac('0x4')]}}; \ No newline at end of file +var _0x3899=['account','agent','queue','DATE','moment','sequelize','STRING','ENUM'];(function(_0x418c9b,_0x44d24b){var _0x340e5e=function(_0x57901f){while(--_0x57901f){_0x418c9b['push'](_0x418c9b['shift']());}};_0x340e5e(++_0x44d24b);}(_0x3899,0x134));var _0x9389=function(_0x3fcedf,_0x16aa6d){_0x3fcedf=_0x3fcedf-0x0;var _0x5a880e=_0x3899[_0x3fcedf];return _0x5a880e;};'use strict';var moment=require(_0x9389('0x0'));var Sequelize=require(_0x9389('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x9389('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9389('0x3')](_0x9389('0x4'),_0x9389('0x5'),_0x9389('0x6')),'allowNull':![],'defaultValue':_0x9389('0x6')},'transferredAt':{'type':Sequelize[_0x9389('0x7')],'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 4917587..7a47bb2 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 _0x3134=['options','includeAll','include','findAll','rows','catch','show','params','intersection','find','create','body','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','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','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','apply','reject','save','update','destroy','then','error','stack','name','index','map','SmsTransferReport','rawAttributes','fieldName','model','query','keys','attributes','fields','length','order','sort','where','filters','filter','merge','type','VIRTUAL'];(function(_0x557dc6,_0x19fb20){var _0x3d711b=function(_0x58dfcb){while(--_0x58dfcb){_0x557dc6['push'](_0x557dc6['shift']());}};_0x3d711b(++_0x19fb20);}(_0x3134,0x13d));var _0x4313=function(_0x5b36c6,_0x1a793c){_0x5b36c6=_0x5b36c6-0x0;var _0x3314c9=_0x3134[_0x5b36c6];return _0x3314c9;};'use strict';var pdf=require(_0x4313('0x0'));var emlformat=require(_0x4313('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x4313('0x2'));var jsonpatch=require(_0x4313('0x3'));var rp=require(_0x4313('0x4'));var moment=require(_0x4313('0x5'));var BPromise=require(_0x4313('0x6'));var Mustache=require(_0x4313('0x7'));var util=require('util');var path=require(_0x4313('0x8'));var sox=require(_0x4313('0x9'));var csv=require(_0x4313('0xa'));var ejs=require(_0x4313('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x4313('0xc'));var jsforce=require(_0x4313('0xd'));var deskjs=require(_0x4313('0xe'));var toCsv=require(_0x4313('0xa'));var querystring=require(_0x4313('0xf'));var Papa=require(_0x4313('0x10'));var Redis=require(_0x4313('0x11'));var authService=require(_0x4313('0x12'));var qs=require(_0x4313('0x13'));var as=require(_0x4313('0x14'));var hardwareService=require(_0x4313('0x15'));var logger=require(_0x4313('0x16'))(_0x4313('0x17'));var utils=require(_0x4313('0x18'));var config=require(_0x4313('0x19'));var db=require(_0x4313('0x1a'))['db'];function respondWithStatusCode(_0x3e6b2f,_0x405695){_0x405695=_0x405695||0xcc;return function(_0x7de8c6){if(_0x7de8c6){return _0x3e6b2f[_0x4313('0x1b')](_0x405695);}return _0x3e6b2f['status'](_0x405695)[_0x4313('0x1c')]();};}function respondWithResult(_0x47826b,_0x143907){_0x143907=_0x143907||0xc8;return function(_0xe4b9fb){if(_0xe4b9fb){return _0x47826b[_0x4313('0x1d')](_0x143907)[_0x4313('0x1e')](_0xe4b9fb);}};}function respondWithFilteredResult(_0x26feb1,_0x2141ca){return function(_0x52b427){if(_0x52b427){var _0x576558=_0x52b427[_0x4313('0x1f')],_0x4c68bb=_0x2141ca[_0x4313('0x20')],_0x2cfae7=_0x2141ca['offset']+_0x2141ca[_0x4313('0x21')],_0x74cdae;if(_0x2cfae7>=_0x576558){_0x2cfae7=_0x576558;_0x74cdae=0xc8;}else{_0x74cdae=0xce;}_0x26feb1[_0x4313('0x1d')](_0x74cdae);return _0x26feb1[_0x4313('0x22')]('Content-Range',_0x4c68bb+'-'+_0x2cfae7+'/'+_0x576558)['json'](_0x52b427);}return null;};}function patchUpdates(_0x193131){return function(_0x383e89){try{jsonpatch[_0x4313('0x23')](_0x383e89,_0x193131,!![]);}catch(_0x514d8c){return BPromise[_0x4313('0x24')](_0x514d8c);}return _0x383e89[_0x4313('0x25')]();};}function saveUpdates(_0x3cd4f1,_0x5812a9){return function(_0x2512ea){if(_0x2512ea){return _0x2512ea[_0x4313('0x26')](_0x3cd4f1)['then'](function(_0x30a74a){return _0x30a74a;});}return null;};}function removeEntity(_0x32e0db,_0x1e8de2){return function(_0x1a9e40){if(_0x1a9e40){return _0x1a9e40[_0x4313('0x27')]()[_0x4313('0x28')](function(){_0x32e0db[_0x4313('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c2edc,_0x4dfbc9){return function(_0x4e6e51){if(!_0x4e6e51){_0x5c2edc['sendStatus'](0x194);}return _0x4e6e51;};}function handleError(_0x2eb841,_0x4c35e1){_0x4c35e1=_0x4c35e1||0x1f4;return function(_0x5ed38b){logger[_0x4313('0x29')](_0x5ed38b[_0x4313('0x2a')]);if(_0x5ed38b[_0x4313('0x2b')]){delete _0x5ed38b[_0x4313('0x2b')];}_0x2eb841[_0x4313('0x1d')](_0x4c35e1)['send'](_0x5ed38b);};}exports[_0x4313('0x2c')]=function(_0x47ea73,_0x1e7196){var _0x34dacc={},_0x2fdfc4={},_0xbc9a46={'count':0x0,'rows':[]};var _0xce9d26=_[_0x4313('0x2d')](db[_0x4313('0x2e')][_0x4313('0x2f')],function(_0x2bb192){return{'name':_0x2bb192[_0x4313('0x30')],'type':_0x2bb192['type']['key']};});_0x2fdfc4[_0x4313('0x31')]=_[_0x4313('0x2d')](_0xce9d26,_0x4313('0x2b'));_0x2fdfc4[_0x4313('0x32')]=_[_0x4313('0x33')](_0x47ea73['query']);_0x2fdfc4['filters']=_['intersection'](_0x2fdfc4[_0x4313('0x31')],_0x2fdfc4[_0x4313('0x32')]);_0x34dacc[_0x4313('0x34')]=_['intersection'](_0x2fdfc4[_0x4313('0x31')],qs[_0x4313('0x35')](_0x47ea73['query']['fields']));_0x34dacc[_0x4313('0x34')]=_0x34dacc['attributes'][_0x4313('0x36')]?_0x34dacc[_0x4313('0x34')]:_0x2fdfc4[_0x4313('0x31')];if(!_0x47ea73['query']['hasOwnProperty']('nolimit')){_0x34dacc[_0x4313('0x21')]=qs[_0x4313('0x21')](_0x47ea73['query'][_0x4313('0x21')]);_0x34dacc['offset']=qs[_0x4313('0x20')](_0x47ea73[_0x4313('0x32')][_0x4313('0x20')]);}_0x34dacc[_0x4313('0x37')]=qs[_0x4313('0x38')](_0x47ea73[_0x4313('0x32')]['sort']);_0x34dacc[_0x4313('0x39')]=qs[_0x4313('0x3a')](_['pick'](_0x47ea73[_0x4313('0x32')],_0x2fdfc4[_0x4313('0x3a')]));if(_0x47ea73[_0x4313('0x32')][_0x4313('0x3b')]){_0x34dacc['where']=_[_0x4313('0x3c')](_0x34dacc[_0x4313('0x39')],{'$or':_[_0x4313('0x2d')](_0xce9d26,function(_0x247b54){if(_0x247b54[_0x4313('0x3d')]!==_0x4313('0x3e')){var _0x11fb11={};_0x11fb11[_0x247b54[_0x4313('0x2b')]]={'$like':'%'+_0x47ea73[_0x4313('0x32')][_0x4313('0x3b')]+'%'};return _0x11fb11;}})});}_0x34dacc=_[_0x4313('0x3c')]({},_0x34dacc,_0x47ea73[_0x4313('0x3f')]);var _0x239922={'where':_0x34dacc[_0x4313('0x39')]};return db['SmsTransferReport'][_0x4313('0x1f')](_0x239922)[_0x4313('0x28')](function(_0x402d1f){_0xbc9a46['count']=_0x402d1f;if(_0x47ea73[_0x4313('0x32')][_0x4313('0x40')]){_0x34dacc[_0x4313('0x41')]=[{'all':!![]}];}return db[_0x4313('0x2e')][_0x4313('0x42')](_0x34dacc);})['then'](function(_0x29d42f){_0xbc9a46[_0x4313('0x43')]=_0x29d42f;return _0xbc9a46;})[_0x4313('0x28')](respondWithFilteredResult(_0x1e7196,_0x34dacc))[_0x4313('0x44')](handleError(_0x1e7196,null));};exports[_0x4313('0x45')]=function(_0x39b2ea,_0x36841a){var _0x530daf={'raw':!![],'where':{'id':_0x39b2ea[_0x4313('0x46')]['id']}},_0x154b38={};_0x154b38[_0x4313('0x31')]=_[_0x4313('0x33')](db[_0x4313('0x2e')][_0x4313('0x2f')]);_0x154b38[_0x4313('0x32')]=_[_0x4313('0x33')](_0x39b2ea[_0x4313('0x32')]);_0x154b38['filters']=_['intersection'](_0x154b38[_0x4313('0x31')],_0x154b38['query']);_0x530daf[_0x4313('0x34')]=_[_0x4313('0x47')](_0x154b38[_0x4313('0x31')],qs[_0x4313('0x35')](_0x39b2ea[_0x4313('0x32')]['fields']));_0x530daf[_0x4313('0x34')]=_0x530daf['attributes']['length']?_0x530daf[_0x4313('0x34')]:_0x154b38['model'];if(_0x39b2ea[_0x4313('0x32')]['includeAll']){_0x530daf[_0x4313('0x41')]=[{'all':!![]}];}_0x530daf=_[_0x4313('0x3c')]({},_0x530daf,_0x39b2ea[_0x4313('0x3f')]);return db[_0x4313('0x2e')][_0x4313('0x48')](_0x530daf)[_0x4313('0x28')](handleEntityNotFound(_0x36841a,null))[_0x4313('0x28')](respondWithResult(_0x36841a,null))[_0x4313('0x44')](handleError(_0x36841a,null));};exports[_0x4313('0x49')]=function(_0x1f91c7,_0x161aa5){return db[_0x4313('0x2e')][_0x4313('0x49')](_0x1f91c7['body'],{})[_0x4313('0x28')](respondWithResult(_0x161aa5,0xc9))[_0x4313('0x44')](handleError(_0x161aa5,null));};exports[_0x4313('0x26')]=function(_0x8b0ee6,_0x30ed98){if(_0x8b0ee6[_0x4313('0x4a')]['id']){delete _0x8b0ee6[_0x4313('0x4a')]['id'];}return db[_0x4313('0x2e')]['find']({'where':{'id':_0x8b0ee6[_0x4313('0x46')]['id']}})['then'](handleEntityNotFound(_0x30ed98,null))[_0x4313('0x28')](saveUpdates(_0x8b0ee6['body'],null))[_0x4313('0x28')](respondWithResult(_0x30ed98,null))[_0x4313('0x44')](handleError(_0x30ed98,null));};exports[_0x4313('0x27')]=function(_0x743a60,_0x11fc56){return db[_0x4313('0x2e')]['find']({'where':{'id':_0x743a60[_0x4313('0x46')]['id']}})[_0x4313('0x28')](handleEntityNotFound(_0x11fc56,null))[_0x4313('0x28')](removeEntity(_0x11fc56,null))[_0x4313('0x44')](handleError(_0x11fc56,null));};exports[_0x4313('0x4b')]=function(_0x4e990b,_0x12632c){return db['SmsTransferReport'][_0x4313('0x4b')]()[_0x4313('0x28')](respondWithResult(_0x12632c,null))[_0x4313('0x44')](handleError(_0x12632c,null));}; \ No newline at end of file +var _0x4b6f=['order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','update','then','destroy','error','name','index','map','SmsTransferReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit'];(function(_0x36ed3c,_0x44a00a){var _0x52a2e0=function(_0x3f7af9){while(--_0x3f7af9){_0x36ed3c['push'](_0x36ed3c['shift']());}};_0x52a2e0(++_0x44a00a);}(_0x4b6f,0x17a));var _0xf4b6=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x4b6f[_0x618414];return _0x21c19a;};'use strict';var pdf=require(_0xf4b6('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xf4b6('0x1'));var zipdir=require(_0xf4b6('0x2'));var jsonpatch=require(_0xf4b6('0x3'));var rp=require(_0xf4b6('0x4'));var moment=require(_0xf4b6('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf4b6('0x6'));var path=require(_0xf4b6('0x7'));var sox=require(_0xf4b6('0x8'));var csv=require(_0xf4b6('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xf4b6('0xa'));var squel=require(_0xf4b6('0xb'));var crypto=require(_0xf4b6('0xc'));var jsforce=require(_0xf4b6('0xd'));var deskjs=require(_0xf4b6('0xe'));var toCsv=require(_0xf4b6('0x9'));var querystring=require(_0xf4b6('0xf'));var Papa=require(_0xf4b6('0x10'));var Redis=require(_0xf4b6('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf4b6('0x12'));var hardwareService=require(_0xf4b6('0x13'));var logger=require(_0xf4b6('0x14'))(_0xf4b6('0x15'));var utils=require('../../config/utils');var config=require(_0xf4b6('0x16'));var db=require(_0xf4b6('0x17'))['db'];function respondWithStatusCode(_0x451293,_0x384599){_0x384599=_0x384599||0xcc;return function(_0x53c5bb){if(_0x53c5bb){return _0x451293[_0xf4b6('0x18')](_0x384599);}return _0x451293[_0xf4b6('0x19')](_0x384599)['end']();};}function respondWithResult(_0x28d2b2,_0x55b708){_0x55b708=_0x55b708||0xc8;return function(_0x585f16){if(_0x585f16){return _0x28d2b2[_0xf4b6('0x19')](_0x55b708)[_0xf4b6('0x1a')](_0x585f16);}};}function respondWithFilteredResult(_0x50583b,_0x2c546c){return function(_0x1a1a34){if(_0x1a1a34){var _0x4b6477=_0x1a1a34[_0xf4b6('0x1b')],_0x59823c=_0x2c546c[_0xf4b6('0x1c')],_0x627284=_0x2c546c['offset']+_0x2c546c[_0xf4b6('0x1d')],_0x51c588;if(_0x627284>=_0x4b6477){_0x627284=_0x4b6477;_0x51c588=0xc8;}else{_0x51c588=0xce;}_0x50583b[_0xf4b6('0x19')](_0x51c588);return _0x50583b[_0xf4b6('0x1e')](_0xf4b6('0x1f'),_0x59823c+'-'+_0x627284+'/'+_0x4b6477)['json'](_0x1a1a34);}return null;};}function patchUpdates(_0x450d5f){return function(_0x424e6e){try{jsonpatch['apply'](_0x424e6e,_0x450d5f,!![]);}catch(_0x33812c){return BPromise[_0xf4b6('0x20')](_0x33812c);}return _0x424e6e['save']();};}function saveUpdates(_0x42fd8e,_0xa7c01e){return function(_0x26bcfc){if(_0x26bcfc){return _0x26bcfc[_0xf4b6('0x21')](_0x42fd8e)[_0xf4b6('0x22')](function(_0x44ca48){return _0x44ca48;});}return null;};}function removeEntity(_0x57668e,_0x471040){return function(_0x32bca8){if(_0x32bca8){return _0x32bca8[_0xf4b6('0x23')]()[_0xf4b6('0x22')](function(){_0x57668e[_0xf4b6('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f5c2d,_0x24b79d){return function(_0x5a80ba){if(!_0x5a80ba){_0x1f5c2d[_0xf4b6('0x18')](0x194);}return _0x5a80ba;};}function handleError(_0x561416,_0x4e85e5){_0x4e85e5=_0x4e85e5||0x1f4;return function(_0x2fa24c){logger[_0xf4b6('0x24')](_0x2fa24c['stack']);if(_0x2fa24c[_0xf4b6('0x25')]){delete _0x2fa24c[_0xf4b6('0x25')];}_0x561416[_0xf4b6('0x19')](_0x4e85e5)['send'](_0x2fa24c);};}exports[_0xf4b6('0x26')]=function(_0x145f9d,_0xe1ed74){var _0x4c3767={},_0x4dbf1f={},_0x3850d8={'count':0x0,'rows':[]};var _0x5023ed=_[_0xf4b6('0x27')](db[_0xf4b6('0x28')][_0xf4b6('0x29')],function(_0x203f1e){return{'name':_0x203f1e[_0xf4b6('0x2a')],'type':_0x203f1e[_0xf4b6('0x2b')]['key']};});_0x4dbf1f[_0xf4b6('0x2c')]=_[_0xf4b6('0x27')](_0x5023ed,'name');_0x4dbf1f[_0xf4b6('0x2d')]=_[_0xf4b6('0x2e')](_0x145f9d[_0xf4b6('0x2d')]);_0x4dbf1f[_0xf4b6('0x2f')]=_[_0xf4b6('0x30')](_0x4dbf1f['model'],_0x4dbf1f[_0xf4b6('0x2d')]);_0x4c3767['attributes']=_[_0xf4b6('0x30')](_0x4dbf1f['model'],qs[_0xf4b6('0x31')](_0x145f9d[_0xf4b6('0x2d')][_0xf4b6('0x31')]));_0x4c3767[_0xf4b6('0x32')]=_0x4c3767[_0xf4b6('0x32')][_0xf4b6('0x33')]?_0x4c3767['attributes']:_0x4dbf1f[_0xf4b6('0x2c')];if(!_0x145f9d['query'][_0xf4b6('0x34')](_0xf4b6('0x35'))){_0x4c3767[_0xf4b6('0x1d')]=qs[_0xf4b6('0x1d')](_0x145f9d['query']['limit']);_0x4c3767[_0xf4b6('0x1c')]=qs[_0xf4b6('0x1c')](_0x145f9d[_0xf4b6('0x2d')][_0xf4b6('0x1c')]);}_0x4c3767[_0xf4b6('0x36')]=qs[_0xf4b6('0x37')](_0x145f9d[_0xf4b6('0x2d')][_0xf4b6('0x37')]);_0x4c3767[_0xf4b6('0x38')]=qs[_0xf4b6('0x2f')](_['pick'](_0x145f9d[_0xf4b6('0x2d')],_0x4dbf1f[_0xf4b6('0x2f')]));if(_0x145f9d[_0xf4b6('0x2d')]['filter']){_0x4c3767[_0xf4b6('0x38')]=_[_0xf4b6('0x39')](_0x4c3767[_0xf4b6('0x38')],{'$or':_[_0xf4b6('0x27')](_0x5023ed,function(_0x2f631d){if(_0x2f631d[_0xf4b6('0x2b')]!==_0xf4b6('0x3a')){var _0x3c3303={};_0x3c3303[_0x2f631d['name']]={'$like':'%'+_0x145f9d[_0xf4b6('0x2d')][_0xf4b6('0x3b')]+'%'};return _0x3c3303;}})});}_0x4c3767=_[_0xf4b6('0x39')]({},_0x4c3767,_0x145f9d[_0xf4b6('0x3c')]);var _0x4da0c3={'where':_0x4c3767[_0xf4b6('0x38')]};return db['SmsTransferReport'][_0xf4b6('0x1b')](_0x4da0c3)[_0xf4b6('0x22')](function(_0xd0e055){_0x3850d8[_0xf4b6('0x1b')]=_0xd0e055;if(_0x145f9d[_0xf4b6('0x2d')][_0xf4b6('0x3d')]){_0x4c3767[_0xf4b6('0x3e')]=[{'all':!![]}];}return db[_0xf4b6('0x28')][_0xf4b6('0x3f')](_0x4c3767);})[_0xf4b6('0x22')](function(_0x3c9997){_0x3850d8[_0xf4b6('0x40')]=_0x3c9997;return _0x3850d8;})['then'](respondWithFilteredResult(_0xe1ed74,_0x4c3767))[_0xf4b6('0x41')](handleError(_0xe1ed74,null));};exports[_0xf4b6('0x42')]=function(_0x216408,_0x48a0a1){var _0x55b32e={'raw':!![],'where':{'id':_0x216408['params']['id']}},_0x2cbb49={};_0x2cbb49[_0xf4b6('0x2c')]=_['keys'](db[_0xf4b6('0x28')]['rawAttributes']);_0x2cbb49[_0xf4b6('0x2d')]=_[_0xf4b6('0x2e')](_0x216408[_0xf4b6('0x2d')]);_0x2cbb49[_0xf4b6('0x2f')]=_['intersection'](_0x2cbb49[_0xf4b6('0x2c')],_0x2cbb49['query']);_0x55b32e['attributes']=_['intersection'](_0x2cbb49[_0xf4b6('0x2c')],qs[_0xf4b6('0x31')](_0x216408[_0xf4b6('0x2d')][_0xf4b6('0x31')]));_0x55b32e['attributes']=_0x55b32e[_0xf4b6('0x32')][_0xf4b6('0x33')]?_0x55b32e['attributes']:_0x2cbb49[_0xf4b6('0x2c')];if(_0x216408['query'][_0xf4b6('0x3d')]){_0x55b32e[_0xf4b6('0x3e')]=[{'all':!![]}];}_0x55b32e=_[_0xf4b6('0x39')]({},_0x55b32e,_0x216408[_0xf4b6('0x3c')]);return db[_0xf4b6('0x28')][_0xf4b6('0x43')](_0x55b32e)[_0xf4b6('0x22')](handleEntityNotFound(_0x48a0a1,null))[_0xf4b6('0x22')](respondWithResult(_0x48a0a1,null))[_0xf4b6('0x41')](handleError(_0x48a0a1,null));};exports[_0xf4b6('0x44')]=function(_0x210f4c,_0x445b96){return db[_0xf4b6('0x28')][_0xf4b6('0x44')](_0x210f4c[_0xf4b6('0x45')],{})[_0xf4b6('0x22')](respondWithResult(_0x445b96,0xc9))['catch'](handleError(_0x445b96,null));};exports[_0xf4b6('0x21')]=function(_0x2e7a16,_0x497da6){if(_0x2e7a16[_0xf4b6('0x45')]['id']){delete _0x2e7a16[_0xf4b6('0x45')]['id'];}return db[_0xf4b6('0x28')][_0xf4b6('0x43')]({'where':{'id':_0x2e7a16[_0xf4b6('0x46')]['id']}})['then'](handleEntityNotFound(_0x497da6,null))['then'](saveUpdates(_0x2e7a16[_0xf4b6('0x45')],null))['then'](respondWithResult(_0x497da6,null))[_0xf4b6('0x41')](handleError(_0x497da6,null));};exports['destroy']=function(_0x145d7d,_0x28478d){return db[_0xf4b6('0x28')][_0xf4b6('0x43')]({'where':{'id':_0x145d7d[_0xf4b6('0x46')]['id']}})[_0xf4b6('0x22')](handleEntityNotFound(_0x28478d,null))[_0xf4b6('0x22')](removeEntity(_0x28478d,null))['catch'](handleError(_0x28478d,null));};exports[_0xf4b6('0x47')]=function(_0xbcff6f,_0x16202f){return db['SmsTransferReport'][_0xf4b6('0x47')]()[_0xf4b6('0x22')](respondWithResult(_0x16202f,null))[_0xf4b6('0x41')](handleError(_0x16202f,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index bb963ab..3e5e086 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 _0x11e5=['path','../../config/environment','define','uniqueid','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x335fd9,_0x138e62){var _0x1343f9=function(_0x54d470){while(--_0x54d470){_0x335fd9['push'](_0x335fd9['shift']());}};_0x1343f9(++_0x138e62);}(_0x11e5,0x8b));var _0x511e=function(_0x2ea5d6,_0x2ef3e7){_0x2ea5d6=_0x2ea5d6-0x0;var _0x20dcb3=_0x11e5[_0x2ea5d6];return _0x20dcb3;};'use strict';var _=require(_0x511e('0x0'));var util=require('util');var logger=require(_0x511e('0x1'))(_0x511e('0x2'));var moment=require('moment');var BPromise=require(_0x511e('0x3'));var rp=require(_0x511e('0x4'));var fs=require('fs');var path=require(_0x511e('0x5'));var rimraf=require('rimraf');var config=require(_0x511e('0x6'));var attributes=require('./smsTransferReport.attributes');module['exports']=function(_0x342539,_0x323f8c){return _0x342539[_0x511e('0x7')]('SmsTransferReport',attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':_0x511e('0x8'),'fields':[_0x511e('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x11e5=['path','../../config/environment','define','uniqueid','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x2bcce9,_0x2fce50){var _0x4f824e=function(_0x582369){while(--_0x582369){_0x2bcce9['push'](_0x2bcce9['shift']());}};_0x4f824e(++_0x2fce50);}(_0x11e5,0x8b));var _0x511e=function(_0x543e6b,_0x218c9a){_0x543e6b=_0x543e6b-0x0;var _0xffb501=_0x11e5[_0x543e6b];return _0xffb501;};'use strict';var _=require(_0x511e('0x0'));var util=require('util');var logger=require(_0x511e('0x1'))(_0x511e('0x2'));var moment=require('moment');var BPromise=require(_0x511e('0x3'));var rp=require(_0x511e('0x4'));var fs=require('fs');var path=require(_0x511e('0x5'));var rimraf=require('rimraf');var config=require(_0x511e('0x6'));var attributes=require('./smsTransferReport.attributes');module['exports']=function(_0x342539,_0x323f8c){return _0x342539[_0x511e('0x7')]('SmsTransferReport',attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':_0x511e('0x8'),'fields':[_0x511e('0x8')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 6b44bf3..e4f173e 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 _0x8b4f=['http','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','error','message','result','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8b4f,0xb6));var _0xf8b4=function(_0x7f3667,_0x30c3f1){_0x7f3667=_0x7f3667-0x0;var _0x2c4c24=_0x8b4f[_0x7f3667];return _0x2c4c24;};'use strict';var _=require(_0xf8b4('0x0'));var util=require(_0xf8b4('0x1'));var moment=require('moment');var BPromise=require(_0xf8b4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf8b4('0x3'))['db'];var utils=require(_0xf8b4('0x4'));var logger=require(_0xf8b4('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf8b4('0x6'));var client=jayson[_0xf8b4('0x7')][_0xf8b4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x38bb14,_0x304799,_0xd32e2a){return new BPromise(function(_0x3f2d8f,_0x440d40){return client[_0xf8b4('0x9')](_0x38bb14,_0xd32e2a)[_0xf8b4('0xa')](function(_0x17e284){logger[_0xf8b4('0xb')](_0xf8b4('0xc'),_0x304799,_0xf8b4('0xd'));logger[_0xf8b4('0xe')](_0xf8b4('0xf'),_0x304799,_0xf8b4('0xd'),JSON['stringify'](_0x17e284));if(_0x17e284['error']){if(_0x17e284[_0xf8b4('0x10')]['code']===0x1f4){logger[_0xf8b4('0x10')](_0xf8b4('0xc'),_0x304799,_0x17e284[_0xf8b4('0x10')][_0xf8b4('0x11')]);return _0x440d40(_0x17e284[_0xf8b4('0x10')]['message']);}logger['error'](_0xf8b4('0xc'),_0x304799,_0x17e284[_0xf8b4('0x10')][_0xf8b4('0x11')]);return _0x3f2d8f(_0x17e284[_0xf8b4('0x10')][_0xf8b4('0x11')]);}else{logger[_0xf8b4('0xb')]('SmsTransferReport,\x20%s,\x20%s',_0x304799,_0xf8b4('0xd'));_0x3f2d8f(_0x17e284[_0xf8b4('0x12')][_0xf8b4('0x11')]);}})['catch'](function(_0x41f1b4){logger['error'](_0xf8b4('0xc'),_0x304799,_0x41f1b4);_0x440d40(_0x41f1b4);});});} \ No newline at end of file +var _0xf72d=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SmsTransferReport,\x20%s,\x20%s','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x3f7354,_0x2a4712){var _0x2f9518=function(_0x2a3d6a){while(--_0x2a3d6a){_0x3f7354['push'](_0x3f7354['shift']());}};_0x2f9518(++_0x2a4712);}(_0xf72d,0xc9));var _0xdf72=function(_0x1e1965,_0x55785c){_0x1e1965=_0x1e1965-0x0;var _0x1a2e96=_0xf72d[_0x1e1965];return _0x1a2e96;};'use strict';var _=require(_0xdf72('0x0'));var util=require(_0xdf72('0x1'));var moment=require(_0xdf72('0x2'));var BPromise=require(_0xdf72('0x3'));var rs=require(_0xdf72('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdf72('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xdf72('0x6'))(_0xdf72('0x7'));var config=require(_0xdf72('0x8'));var jayson=require(_0xdf72('0x9'));var client=jayson[_0xdf72('0xa')][_0xdf72('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x563e28,_0x3efaca,_0x28a27c){return new BPromise(function(_0x3e38c1,_0x459f75){return client[_0xdf72('0xc')](_0x563e28,_0x28a27c)['then'](function(_0x34d483){logger[_0xdf72('0xd')](_0xdf72('0xe'),_0x3efaca,'request\x20sent');logger[_0xdf72('0xf')](_0xdf72('0x10'),_0x3efaca,'request\x20sent',JSON['stringify'](_0x34d483));if(_0x34d483[_0xdf72('0x11')]){if(_0x34d483[_0xdf72('0x11')][_0xdf72('0x12')]===0x1f4){logger[_0xdf72('0x11')]('SmsTransferReport,\x20%s,\x20%s',_0x3efaca,_0x34d483[_0xdf72('0x11')][_0xdf72('0x13')]);return _0x459f75(_0x34d483[_0xdf72('0x11')]['message']);}logger['error'](_0xdf72('0xe'),_0x3efaca,_0x34d483['error'][_0xdf72('0x13')]);return _0x3e38c1(_0x34d483['error'][_0xdf72('0x13')]);}else{logger[_0xdf72('0xd')](_0xdf72('0xe'),_0x3efaca,_0xdf72('0x14'));_0x3e38c1(_0x34d483[_0xdf72('0x15')][_0xdf72('0x13')]);}})[_0xdf72('0x16')](function(_0x460094){logger[_0xdf72('0x11')](_0xdf72('0xe'),_0x3efaca,_0x460094);_0x459f75(_0x460094);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index f3f763e..f5a3f15 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 _0x798d=['Router','../../components/auth/service','../../config/environment','isAuthenticated','get','/:id','show','/:id/download','download','diskStorage','root','server/files/sounds/original/','originalname','replace','format','basename','extname','post','file','create','put','update','delete','exports','path','connect-timeout'];(function(_0x139e7f,_0x45855a){var _0x271c5f=function(_0x56350e){while(--_0x56350e){_0x139e7f['push'](_0x139e7f['shift']());}};_0x271c5f(++_0x45855a);}(_0x798d,0x1b8));var _0xd798=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x798d[_0x484e36];return _0xafc85d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd798('0x0'));var timeout=require(_0xd798('0x1'));var express=require('express');var router=express[_0xd798('0x2')]();var auth=require(_0xd798('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xd798('0x4'));var controller=require('./sound.controller');router['get']('/',auth[_0xd798('0x5')](),controller['index']);router[_0xd798('0x6')](_0xd798('0x7'),auth[_0xd798('0x5')](),controller[_0xd798('0x8')]);router[_0xd798('0x6')](_0xd798('0x9'),auth[_0xd798('0x5')](),controller[_0xd798('0xa')]);var upload=multer({'storage':multer[_0xd798('0xb')]({'destination':function(_0x2ac5f2,_0x68530f,_0x1dccb7){_0x1dccb7(null,path['join'](config[_0xd798('0xc')],_0xd798('0xd')));},'filename':function(_0x4b378e,_0x27a9ba,_0x418e2d){_0x27a9ba[_0xd798('0xe')]=_0x27a9ba[_0xd798('0xe')][_0xd798('0xf')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x418e2d(null,util[_0xd798('0x10')]('%s-%s%s',path[_0xd798('0x11')](_0x27a9ba[_0xd798('0xe')],path[_0xd798('0x12')](_0x27a9ba[_0xd798('0xe')])),Date['now'](),path['extname'](_0x27a9ba[_0xd798('0xe')])));}})});router[_0xd798('0x13')]('/',upload['single'](_0xd798('0x14')),controller[_0xd798('0x15')]);router[_0xd798('0x16')](_0xd798('0x7'),auth[_0xd798('0x5')](),controller[_0xd798('0x17')]);router['delete']('/:id',auth[_0xd798('0x5')](),controller[_0xd798('0x18')]);module[_0xd798('0x19')]=router; \ No newline at end of file +var _0x0d59=['isAuthenticated','index','/:id','show','download','diskStorage','join','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','extname','now','single','file','put','update','delete','multer','util','path','connect-timeout','express','../../config/environment','./sound.controller','get'];(function(_0x35ccb1,_0x47604c){var _0x3ce763=function(_0x1e9ebf){while(--_0x1e9ebf){_0x35ccb1['push'](_0x35ccb1['shift']());}};_0x3ce763(++_0x47604c);}(_0x0d59,0x1f0));var _0x90d5=function(_0xbc4659,_0x578fba){_0xbc4659=_0xbc4659-0x0;var _0x5831f9=_0x0d59[_0xbc4659];return _0x5831f9;};'use strict';var multer=require(_0x90d5('0x0'));var util=require(_0x90d5('0x1'));var path=require(_0x90d5('0x2'));var timeout=require(_0x90d5('0x3'));var express=require(_0x90d5('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x90d5('0x5'));var controller=require(_0x90d5('0x6'));router[_0x90d5('0x7')]('/',auth[_0x90d5('0x8')](),controller[_0x90d5('0x9')]);router[_0x90d5('0x7')](_0x90d5('0xa'),auth[_0x90d5('0x8')](),controller[_0x90d5('0xb')]);router[_0x90d5('0x7')]('/:id/download',auth[_0x90d5('0x8')](),controller[_0x90d5('0xc')]);var upload=multer({'storage':multer[_0x90d5('0xd')]({'destination':function(_0x4d442a,_0xdecebb,_0x23a114){_0x23a114(null,path[_0x90d5('0xe')](config[_0x90d5('0xf')],_0x90d5('0x10')));},'filename':function(_0x5163e1,_0x31ea69,_0x4238db){_0x31ea69['originalname']=_0x31ea69[_0x90d5('0x11')][_0x90d5('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4238db(null,util[_0x90d5('0x13')](_0x90d5('0x14'),path['basename'](_0x31ea69[_0x90d5('0x11')],path[_0x90d5('0x15')](_0x31ea69['originalname'])),Date[_0x90d5('0x16')](),path[_0x90d5('0x15')](_0x31ea69[_0x90d5('0x11')])));}})});router['post']('/',upload[_0x90d5('0x17')](_0x90d5('0x18')),controller['create']);router[_0x90d5('0x19')](_0x90d5('0xa'),auth['isAuthenticated'](),controller[_0x90d5('0x1a')]);router[_0x90d5('0x1b')](_0x90d5('0xa'),auth[_0x90d5('0x8')](),controller[_0x90d5('0x1b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 34d3db4..957805d 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 _0xcc19=['exports','name','STRING','FLOAT','BIGINT','INTEGER'];(function(_0x3ec6b9,_0x4d5099){var _0x39e795=function(_0x3579fa){while(--_0x3579fa){_0x3ec6b9['push'](_0x3ec6b9['shift']());}};_0x39e795(++_0x4d5099);}(_0xcc19,0xd2));var _0x9cc1=function(_0x46df63,_0x5cbc34){_0x46df63=_0x46df63-0x0;var _0x236616=_0xcc19[_0x46df63];return _0x236616;};'use strict';var Sequelize=require('sequelize');module[_0x9cc1('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x9cc1('0x1'),'allowNull':![]},'save_name':{'type':Sequelize[_0x9cc1('0x2')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0x9cc1('0x2')]},'original_format':{'type':Sequelize[_0x9cc1('0x2')]},'original_duration':{'type':Sequelize[_0x9cc1('0x3')]},'original_sampleCount':{'type':Sequelize[_0x9cc1('0x4')]},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize[_0x9cc1('0x4')]},'original_sampleRate':{'type':Sequelize['INTEGER']},'converted_format':{'type':Sequelize[_0x9cc1('0x2')]},'converted_duration':{'type':Sequelize[_0x9cc1('0x3')]},'converted_sampleCount':{'type':Sequelize[_0x9cc1('0x4')]},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize[_0x9cc1('0x4')]},'converted_sampleRate':{'type':Sequelize[_0x9cc1('0x5')]}}; \ No newline at end of file +var _0x2e20=['FLOAT','exports','STRING','name','INTEGER','BIGINT'];(function(_0x25579c,_0x2bdfa3){var _0x5e8876=function(_0x23c20c){while(--_0x23c20c){_0x25579c['push'](_0x25579c['shift']());}};_0x5e8876(++_0x2bdfa3);}(_0x2e20,0x1d5));var _0x02e2=function(_0x4d82ea,_0x4d459f){_0x4d82ea=_0x4d82ea-0x0;var _0x257f4a=_0x2e20[_0x4d82ea];return _0x257f4a;};'use strict';var Sequelize=require('sequelize');module[_0x02e2('0x0')]={'name':{'type':Sequelize[_0x02e2('0x1')],'unique':_0x02e2('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0x02e2('0x1')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0x02e2('0x1')]},'original_format':{'type':Sequelize[_0x02e2('0x1')]},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0x02e2('0x3')]},'original_bitRate':{'type':Sequelize[_0x02e2('0x4')]},'original_sampleRate':{'type':Sequelize[_0x02e2('0x3')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize[_0x02e2('0x5')]},'converted_sampleCount':{'type':Sequelize[_0x02e2('0x4')]},'converted_channelCount':{'type':Sequelize[_0x02e2('0x3')]},'converted_bitRate':{'type':Sequelize[_0x02e2('0x4')]},'converted_sampleRate':{'type':Sequelize[_0x02e2('0x3')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index a2d46de..ebd25d4 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 _0x2597=['create','basename','file','originalname','extname','filename','wav','root','server/files/sounds/original','info','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','original_sampleRate','dest','converted_duration','converted_bitRate','bitRate','converted_sampleRate','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','start','description','delete','destroy','original_format','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','reject','save','update','then','get','Sounds','UserProfileResource','error','stack','name','send','index','map','fieldName','type','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','Sound','includeAll','include','findAll','rows','catch','show','rawAttributes','find','params','converted_format','server/files/sounds/converted','save_name','ValidationError','download','join','format','%s.%s'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x2597,0xa2));var _0x7259=function(_0xf73c09,_0x4e424e){_0xf73c09=_0xf73c09-0x0;var _0xa8923c=_0x2597[_0xf73c09];return _0xa8923c;};'use strict';var pdf=require(_0x7259('0x0'));var emlformat=require(_0x7259('0x1'));var rimraf=require(_0x7259('0x2'));var zipdir=require(_0x7259('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7259('0x4'));var moment=require(_0x7259('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x7259('0x6'));var util=require(_0x7259('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x7259('0x8'));var ejs=require(_0x7259('0x9'));var fs=require('fs');var _=require(_0x7259('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7259('0xb'));var deskjs=require(_0x7259('0xc'));var toCsv=require(_0x7259('0x8'));var querystring=require(_0x7259('0xd'));var Papa=require(_0x7259('0xe'));var Redis=require('ioredis');var authService=require(_0x7259('0xf'));var qs=require(_0x7259('0x10'));var as=require(_0x7259('0x11'));var hardwareService=require(_0x7259('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x7259('0x13'));var config=require(_0x7259('0x14'));var db=require(_0x7259('0x15'))['db'];function respondWithStatusCode(_0x1eda26,_0x45ef67){_0x45ef67=_0x45ef67||0xcc;return function(_0x157c38){if(_0x157c38){return _0x1eda26[_0x7259('0x16')](_0x45ef67);}return _0x1eda26[_0x7259('0x17')](_0x45ef67)[_0x7259('0x18')]();};}function respondWithResult(_0x480401,_0x57d1a9){_0x57d1a9=_0x57d1a9||0xc8;return function(_0xfaf268){if(_0xfaf268){return _0x480401['status'](_0x57d1a9)['json'](_0xfaf268);}};}function respondWithFilteredResult(_0x1d0936,_0x56a1e6){return function(_0x2c808a){if(_0x2c808a){var _0x7c0f59=_0x2c808a[_0x7259('0x19')],_0x3549af=_0x56a1e6[_0x7259('0x1a')],_0x28cdfa=_0x56a1e6[_0x7259('0x1a')]+_0x56a1e6[_0x7259('0x1b')],_0x124c45;if(_0x28cdfa>=_0x7c0f59){_0x28cdfa=_0x7c0f59;_0x124c45=0xc8;}else{_0x124c45=0xce;}_0x1d0936[_0x7259('0x17')](_0x124c45);return _0x1d0936[_0x7259('0x1c')](_0x7259('0x1d'),_0x3549af+'-'+_0x28cdfa+'/'+_0x7c0f59)['json'](_0x2c808a);}return null;};}function patchUpdates(_0x25a157){return function(_0x274e1c){try{jsonpatch['apply'](_0x274e1c,_0x25a157,!![]);}catch(_0x2e7d70){return BPromise[_0x7259('0x1e')](_0x2e7d70);}return _0x274e1c[_0x7259('0x1f')]();};}function saveUpdates(_0x164eb7,_0x5296b6){return function(_0x45f443){if(_0x45f443){return _0x45f443[_0x7259('0x20')](_0x164eb7)[_0x7259('0x21')](function(_0x4741a9){return _0x4741a9;});}return null;};}function removeEntity(_0x56ea03,_0x3256a6){return function(_0x3e6d5b){if(_0x3e6d5b){return _0x3e6d5b['destroy']()[_0x7259('0x21')](function(){var _0x14e62b=_0x3e6d5b[_0x7259('0x22')]({'plain':!![]});var _0x3106b4=_0x7259('0x23');return db[_0x7259('0x24')]['destroy']({'where':{'type':_0x3106b4,'resourceId':_0x14e62b['id']}})[_0x7259('0x21')](function(){return _0x3e6d5b;});})[_0x7259('0x21')](function(){_0x56ea03[_0x7259('0x17')](0xcc)[_0x7259('0x18')]();});}};}function handleEntityNotFound(_0x196134,_0x558037){return function(_0x2393f6){if(!_0x2393f6){_0x196134[_0x7259('0x16')](0x194);}return _0x2393f6;};}function handleError(_0x4d70e3,_0x4dc42e){_0x4dc42e=_0x4dc42e||0x1f4;return function(_0x573576){logger[_0x7259('0x25')](_0x573576[_0x7259('0x26')]);if(_0x573576[_0x7259('0x27')]){delete _0x573576[_0x7259('0x27')];}_0x4d70e3[_0x7259('0x17')](_0x4dc42e)[_0x7259('0x28')](_0x573576);};}exports[_0x7259('0x29')]=function(_0x3e61ff,_0x56f613){var _0x487d1f={},_0x1aa869={},_0x3a2fdb={'count':0x0,'rows':[]};var _0xdfba1a=_[_0x7259('0x2a')](db['Sound']['rawAttributes'],function(_0x5eb18a){return{'name':_0x5eb18a[_0x7259('0x2b')],'type':_0x5eb18a[_0x7259('0x2c')]['key']};});_0x1aa869[_0x7259('0x2d')]=_['map'](_0xdfba1a,_0x7259('0x27'));_0x1aa869[_0x7259('0x2e')]=_[_0x7259('0x2f')](_0x3e61ff['query']);_0x1aa869['filters']=_[_0x7259('0x30')](_0x1aa869['model'],_0x1aa869['query']);_0x487d1f[_0x7259('0x31')]=_['intersection'](_0x1aa869['model'],qs[_0x7259('0x32')](_0x3e61ff[_0x7259('0x2e')]['fields']));_0x487d1f['attributes']=_0x487d1f['attributes'][_0x7259('0x33')]?_0x487d1f[_0x7259('0x31')]:_0x1aa869[_0x7259('0x2d')];if(!_0x3e61ff[_0x7259('0x2e')]['hasOwnProperty'](_0x7259('0x34'))){_0x487d1f[_0x7259('0x1b')]=qs[_0x7259('0x1b')](_0x3e61ff['query'][_0x7259('0x1b')]);_0x487d1f[_0x7259('0x1a')]=qs[_0x7259('0x1a')](_0x3e61ff['query']['offset']);}_0x487d1f[_0x7259('0x35')]=qs[_0x7259('0x36')](_0x3e61ff[_0x7259('0x2e')]['sort']);_0x487d1f['where']=qs[_0x7259('0x37')](_[_0x7259('0x38')](_0x3e61ff[_0x7259('0x2e')],_0x1aa869[_0x7259('0x37')]));if(_0x3e61ff[_0x7259('0x2e')][_0x7259('0x39')]){_0x487d1f[_0x7259('0x3a')]=_[_0x7259('0x3b')](_0x487d1f[_0x7259('0x3a')],{'$or':_['map'](_0xdfba1a,function(_0x1323c0){if(_0x1323c0[_0x7259('0x2c')]!==_0x7259('0x3c')){var _0x47c391={};_0x47c391[_0x1323c0['name']]={'$like':'%'+_0x3e61ff[_0x7259('0x2e')][_0x7259('0x39')]+'%'};return _0x47c391;}})});}_0x487d1f=_[_0x7259('0x3b')]({},_0x487d1f,_0x3e61ff[_0x7259('0x3d')]);var _0x120487={'where':_0x487d1f[_0x7259('0x3a')]};return db[_0x7259('0x3e')][_0x7259('0x19')](_0x120487)['then'](function(_0x26a452){_0x3a2fdb[_0x7259('0x19')]=_0x26a452;if(_0x3e61ff[_0x7259('0x2e')][_0x7259('0x3f')]){_0x487d1f[_0x7259('0x40')]=[{'all':!![]}];}return db[_0x7259('0x3e')][_0x7259('0x41')](_0x487d1f);})[_0x7259('0x21')](function(_0x2074d7){_0x3a2fdb[_0x7259('0x42')]=_0x2074d7;return _0x3a2fdb;})[_0x7259('0x21')](respondWithFilteredResult(_0x56f613,_0x487d1f))[_0x7259('0x43')](handleError(_0x56f613,null));};exports[_0x7259('0x44')]=function(_0x3267b4,_0x457cd3){var _0x3b01d5={'raw':!![],'where':{'id':_0x3267b4['params']['id']}},_0x2ba88d={};_0x2ba88d[_0x7259('0x2d')]=_[_0x7259('0x2f')](db[_0x7259('0x3e')][_0x7259('0x45')]);_0x2ba88d[_0x7259('0x2e')]=_[_0x7259('0x2f')](_0x3267b4[_0x7259('0x2e')]);_0x2ba88d[_0x7259('0x37')]=_[_0x7259('0x30')](_0x2ba88d['model'],_0x2ba88d[_0x7259('0x2e')]);_0x3b01d5[_0x7259('0x31')]=_[_0x7259('0x30')](_0x2ba88d[_0x7259('0x2d')],qs['fields'](_0x3267b4[_0x7259('0x2e')]['fields']));_0x3b01d5[_0x7259('0x31')]=_0x3b01d5[_0x7259('0x31')][_0x7259('0x33')]?_0x3b01d5[_0x7259('0x31')]:_0x2ba88d['model'];if(_0x3267b4[_0x7259('0x2e')][_0x7259('0x3f')]){_0x3b01d5[_0x7259('0x40')]=[{'all':!![]}];}_0x3b01d5=_[_0x7259('0x3b')]({},_0x3b01d5,_0x3267b4[_0x7259('0x3d')]);return db[_0x7259('0x3e')][_0x7259('0x46')](_0x3b01d5)[_0x7259('0x21')](handleEntityNotFound(_0x457cd3,null))[_0x7259('0x21')](respondWithResult(_0x457cd3,null))[_0x7259('0x43')](handleError(_0x457cd3,null));};exports['download']=function(_0x430552,_0x14babb,_0x22cd2e){return db[_0x7259('0x3e')][_0x7259('0x46')]({'where':{'id':_0x430552[_0x7259('0x47')]['id']},'attributes':[_0x7259('0x27'),'save_name',_0x7259('0x48')],'raw':!![]})[_0x7259('0x21')](handleEntityNotFound(_0x14babb,null))[_0x7259('0x21')](function(_0x87c373){if(_0x87c373){if(!fs['existsSync'](path['join'](config['root'],_0x7259('0x49'),_0x87c373[_0x7259('0x4a')]+'.'+_0x87c373['converted_format']))){throw new db['Sequelize'][(_0x7259('0x4b'))]('Sound\x20not\x20found');}return _0x14babb[_0x7259('0x4c')](path[_0x7259('0x4d')](config['root'],_0x7259('0x49'),util[_0x7259('0x4e')](_0x7259('0x4f'),_0x87c373[_0x7259('0x4a')],_0x87c373[_0x7259('0x48')])),util[_0x7259('0x4e')](_0x7259('0x4f'),_0x87c373[_0x7259('0x27')],_0x87c373[_0x7259('0x48')]));}return null;})[_0x7259('0x43')](handleError(_0x14babb,null));};exports[_0x7259('0x50')]=function(_0x313363,_0x2605a9,_0x24a912){var _0x2dd70d={'name':path[_0x7259('0x51')](_0x313363[_0x7259('0x52')][_0x7259('0x53')],path[_0x7259('0x54')](_0x313363[_0x7259('0x52')][_0x7259('0x53')])),'save_name':path['basename'](_0x313363[_0x7259('0x52')]['filename'],path[_0x7259('0x54')](_0x313363['file'][_0x7259('0x55')])),'original_format':path['extname'](_0x313363[_0x7259('0x52')][_0x7259('0x53')])['substring'](0x1),'converted_format':_0x7259('0x56')};var _0x508dbd=path[_0x7259('0x4d')](config[_0x7259('0x57')],_0x7259('0x58'),_0x313363[_0x7259('0x52')][_0x7259('0x55')]);var _0x100767=path[_0x7259('0x4d')](config[_0x7259('0x57')],_0x7259('0x49'),util[_0x7259('0x4e')]('%s.%s',path[_0x7259('0x51')](_0x313363[_0x7259('0x52')][_0x7259('0x55')],path[_0x7259('0x54')](_0x313363[_0x7259('0x52')][_0x7259('0x55')])),_0x2dd70d[_0x7259('0x48')]));logger[_0x7259('0x59')]('Sound\x20upload\x20filepath:\x20%s',_0x508dbd);logger[_0x7259('0x59')](_0x7259('0x5a'),_0x100767);try{fs[_0x7259('0x5b')](_0x508dbd,parseInt(_0x7259('0x5c'),0x8));var _0x1aa53b=sox[_0x7259('0x5d')](_0x508dbd,_0x100767,{'sampleRate':0x1f40,'format':_0x7259('0x56'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x1aa53b['on'](_0x7259('0x25'),function(_0x53923a){fs[_0x7259('0x5e')](_0x508dbd);_0x2605a9[_0x7259('0x17')](0x1f4)[_0x7259('0x28')](_0x53923a);});_0x1aa53b['on'](_0x7259('0x5f'),function(_0x5c0aed){_0x2dd70d[_0x7259('0x60')]=isNaN(_0x5c0aed[_0x7259('0x61')])?null:_0x5c0aed['duration']*0x3e8;_0x2dd70d[_0x7259('0x62')]=isNaN(_0x5c0aed['sampleCount'])?null:_0x5c0aed[_0x7259('0x63')];_0x2dd70d[_0x7259('0x64')]=isNaN(_0x5c0aed[_0x7259('0x65')])?null:_0x5c0aed[_0x7259('0x65')];_0x2dd70d[_0x7259('0x66')]=isNaN(_0x5c0aed['bitRate'])?null:_0x5c0aed['bitRate'];_0x2dd70d[_0x7259('0x67')]=isNaN(_0x5c0aed['sampleRate'])?null:_0x5c0aed['sampleRate'];});_0x1aa53b['on'](_0x7259('0x68'),function(_0x518512){_0x2dd70d[_0x7259('0x69')]=isNaN(_0x518512[_0x7259('0x61')])?null:_0x518512['duration']*0x3e8;_0x2dd70d['converted_sampleCount']=isNaN(_0x518512['sampleCount'])?null:_0x518512[_0x7259('0x63')];_0x2dd70d['converted_channelCount']=isNaN(_0x518512[_0x7259('0x65')])?null:_0x518512[_0x7259('0x65')];_0x2dd70d[_0x7259('0x6a')]=isNaN(_0x518512[_0x7259('0x6b')])?null:_0x518512[_0x7259('0x6b')];_0x2dd70d[_0x7259('0x6c')]=isNaN(_0x518512['sampleRate'])?null:_0x518512['sampleRate'];});_0x1aa53b['on'](_0x7259('0x18'),function(){fs[_0x7259('0x5b')](_0x100767,parseInt(_0x7259('0x5c'),0x8));return db[_0x7259('0x3e')][_0x7259('0x50')](_0x2dd70d)[_0x7259('0x21')](function(_0x22054b){var _0x31c83a={'role':_0x313363[_0x7259('0x6d')]['role'],'userProfileId':_0x313363[_0x7259('0x6d')][_0x7259('0x6e')]};if(!_0x31c83a)throw new Error(_0x7259('0x6f'));if(_0x31c83a[_0x7259('0x70')]===_0x7259('0x71')){var _0x1b91c9=_0x22054b[_0x7259('0x22')]({'plain':!![]});return db[_0x7259('0x72')][_0x7259('0x46')]({'where':{'name':_0x7259('0x23'),'userProfileId':_0x31c83a['userProfileId']},'raw':!![]})[_0x7259('0x21')](function(_0x22ab67){if(_0x22ab67&&_0x22ab67[_0x7259('0x73')]===0x0){return db['UserProfileResource'][_0x7259('0x50')]({'name':_0x1b91c9[_0x7259('0x27')],'resourceId':_0x1b91c9['id'],'type':_0x22ab67[_0x7259('0x27')],'sectionId':_0x22ab67['id']},{})[_0x7259('0x21')](function(){return _0x22054b;});}else{return _0x22054b;}})[_0x7259('0x43')](function(_0x31fd43){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x31fd43);throw _0x31fd43;});}return _0x22054b;})[_0x7259('0x21')](respondWithResult(_0x2605a9,null))['catch'](handleError(_0x2605a9,null));});_0x1aa53b[_0x7259('0x74')]();}catch(_0x45e824){_0x2605a9[_0x7259('0x17')](0x1f4)[_0x7259('0x28')](_0x45e824);}};exports['update']=function(_0x228650,_0x429f21,_0x49b45e){return db[_0x7259('0x3e')][_0x7259('0x46')]({'where':{'id':_0x228650[_0x7259('0x47')]['id']}})['then'](handleEntityNotFound(_0x429f21,null))[_0x7259('0x21')](saveUpdates(_[_0x7259('0x38')](_0x228650['body'],['name',_0x7259('0x75')]),null))['then'](respondWithResult(_0x429f21,null))[_0x7259('0x43')](handleError(_0x429f21,null));};exports[_0x7259('0x76')]=function(_0x3cbf1e,_0x232ade,_0x249174){return db['Sound'][_0x7259('0x46')]({'where':{'id':_0x3cbf1e[_0x7259('0x47')]['id']}})['then'](function(_0x1e91bc){if(_0x1e91bc){return _0x1e91bc[_0x7259('0x77')]();}})[_0x7259('0x21')](function(_0x32a398){var _0x135a69=path[_0x7259('0x4d')](config[_0x7259('0x57')],_0x7259('0x58'),util[_0x7259('0x4e')]('%s.%s',_0x32a398[_0x7259('0x4a')],_0x32a398[_0x7259('0x78')]));var _0x1a259f=path[_0x7259('0x4d')](config[_0x7259('0x57')],_0x7259('0x49'),util[_0x7259('0x4e')]('%s.%s',_0x32a398['save_name'],_0x32a398[_0x7259('0x48')]));fs[_0x7259('0x5e')](_0x135a69);fs['unlinkSync'](_0x1a259f);return _0x32a398;})[_0x7259('0x21')](function(_0x21d307){if(_0x21d307){return _0x232ade[_0x7259('0x17')](0xcc)[_0x7259('0x18')]();}})[_0x7259('0x21')](handleEntityNotFound(_0x232ade,null))['catch'](handleError(_0x232ade,null));}; \ No newline at end of file +var _0xe647=['original_bitRate','bitRate','sampleRate','dest','converted_sampleCount','converted_channelCount','converted_sampleRate','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Sounds','autoAssociation','description','delete','original_format','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','count','offset','Content-Range','json','apply','reject','save','update','then','get','UserProfileResource','destroy','sendStatus','error','stack','name','index','map','Sound','rawAttributes','type','model','query','filters','intersection','attributes','fields','length','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','save_name','converted_format','existsSync','join','root','server/files/sounds/converted','Sequelize','ValidationError','Sound\x20not\x20found','download','format','%s.%s','create','basename','file','originalname','extname','filename','substring','server/files/sounds/original','Sound\x20upload\x20filepath:\x20%s','info','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','wav','unlinkSync','send','duration','sampleCount','channelCount'];(function(_0x3a48c1,_0x35e608){var _0x474eff=function(_0x515a4f){while(--_0x515a4f){_0x3a48c1['push'](_0x3a48c1['shift']());}};_0x474eff(++_0x35e608);}(_0xe647,0x10c));var _0x7e64=function(_0x4d1f9a,_0x2917c7){_0x4d1f9a=_0x4d1f9a-0x0;var _0x5bf54d=_0xe647[_0x4d1f9a];return _0x5bf54d;};'use strict';var pdf=require(_0x7e64('0x0'));var emlformat=require(_0x7e64('0x1'));var rimraf=require(_0x7e64('0x2'));var zipdir=require(_0x7e64('0x3'));var jsonpatch=require(_0x7e64('0x4'));var rp=require('request-promise');var moment=require(_0x7e64('0x5'));var BPromise=require(_0x7e64('0x6'));var Mustache=require(_0x7e64('0x7'));var util=require(_0x7e64('0x8'));var path=require(_0x7e64('0x9'));var sox=require(_0x7e64('0xa'));var csv=require(_0x7e64('0xb'));var ejs=require(_0x7e64('0xc'));var fs=require('fs');var _=require(_0x7e64('0xd'));var squel=require(_0x7e64('0xe'));var crypto=require(_0x7e64('0xf'));var jsforce=require(_0x7e64('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x7e64('0xb'));var querystring=require(_0x7e64('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7e64('0x12'));var qs=require(_0x7e64('0x13'));var as=require(_0x7e64('0x14'));var hardwareService=require(_0x7e64('0x15'));var logger=require(_0x7e64('0x16'))(_0x7e64('0x17'));var utils=require(_0x7e64('0x18'));var config=require(_0x7e64('0x19'));var db=require(_0x7e64('0x1a'))['db'];function respondWithStatusCode(_0x4ff1c8,_0x5bc592){_0x5bc592=_0x5bc592||0xcc;return function(_0x4801ff){if(_0x4801ff){return _0x4ff1c8['sendStatus'](_0x5bc592);}return _0x4ff1c8[_0x7e64('0x1b')](_0x5bc592)[_0x7e64('0x1c')]();};}function respondWithResult(_0x54078d,_0x5757af){_0x5757af=_0x5757af||0xc8;return function(_0x34aaf4){if(_0x34aaf4){return _0x54078d[_0x7e64('0x1b')](_0x5757af)['json'](_0x34aaf4);}};}function respondWithFilteredResult(_0x49109e,_0x13be4a){return function(_0x266e4e){if(_0x266e4e){var _0x5b3f30=_0x266e4e[_0x7e64('0x1d')],_0x1b54f4=_0x13be4a['offset'],_0x579e77=_0x13be4a[_0x7e64('0x1e')]+_0x13be4a['limit'],_0x42f397;if(_0x579e77>=_0x5b3f30){_0x579e77=_0x5b3f30;_0x42f397=0xc8;}else{_0x42f397=0xce;}_0x49109e[_0x7e64('0x1b')](_0x42f397);return _0x49109e['set'](_0x7e64('0x1f'),_0x1b54f4+'-'+_0x579e77+'/'+_0x5b3f30)[_0x7e64('0x20')](_0x266e4e);}return null;};}function patchUpdates(_0x2230bf){return function(_0x34a0b6){try{jsonpatch[_0x7e64('0x21')](_0x34a0b6,_0x2230bf,!![]);}catch(_0x1a2247){return BPromise[_0x7e64('0x22')](_0x1a2247);}return _0x34a0b6[_0x7e64('0x23')]();};}function saveUpdates(_0x2ca29d,_0x537222){return function(_0x1461f8){if(_0x1461f8){return _0x1461f8[_0x7e64('0x24')](_0x2ca29d)[_0x7e64('0x25')](function(_0x53ec5f){return _0x53ec5f;});}return null;};}function removeEntity(_0x38bc01,_0x25aef1){return function(_0x2bbf13){if(_0x2bbf13){return _0x2bbf13['destroy']()[_0x7e64('0x25')](function(){var _0x12c607=_0x2bbf13[_0x7e64('0x26')]({'plain':!![]});var _0x7dbaa4='Sounds';return db[_0x7e64('0x27')][_0x7e64('0x28')]({'where':{'type':_0x7dbaa4,'resourceId':_0x12c607['id']}})['then'](function(){return _0x2bbf13;});})[_0x7e64('0x25')](function(){_0x38bc01[_0x7e64('0x1b')](0xcc)[_0x7e64('0x1c')]();});}};}function handleEntityNotFound(_0x1c8ee5,_0x2e499d){return function(_0x30e3c1){if(!_0x30e3c1){_0x1c8ee5[_0x7e64('0x29')](0x194);}return _0x30e3c1;};}function handleError(_0x1f7d8a,_0x37b3f9){_0x37b3f9=_0x37b3f9||0x1f4;return function(_0xacc819){logger[_0x7e64('0x2a')](_0xacc819[_0x7e64('0x2b')]);if(_0xacc819[_0x7e64('0x2c')]){delete _0xacc819['name'];}_0x1f7d8a[_0x7e64('0x1b')](_0x37b3f9)['send'](_0xacc819);};}exports[_0x7e64('0x2d')]=function(_0x50814c,_0x4483fe){var _0x4a89aa={},_0x462d35={},_0x225586={'count':0x0,'rows':[]};var _0x3cb227=_[_0x7e64('0x2e')](db[_0x7e64('0x2f')][_0x7e64('0x30')],function(_0x581c18){return{'name':_0x581c18['fieldName'],'type':_0x581c18[_0x7e64('0x31')]['key']};});_0x462d35[_0x7e64('0x32')]=_['map'](_0x3cb227,_0x7e64('0x2c'));_0x462d35['query']=_['keys'](_0x50814c[_0x7e64('0x33')]);_0x462d35[_0x7e64('0x34')]=_[_0x7e64('0x35')](_0x462d35['model'],_0x462d35[_0x7e64('0x33')]);_0x4a89aa[_0x7e64('0x36')]=_[_0x7e64('0x35')](_0x462d35['model'],qs[_0x7e64('0x37')](_0x50814c['query'][_0x7e64('0x37')]));_0x4a89aa[_0x7e64('0x36')]=_0x4a89aa[_0x7e64('0x36')][_0x7e64('0x38')]?_0x4a89aa[_0x7e64('0x36')]:_0x462d35[_0x7e64('0x32')];if(!_0x50814c['query']['hasOwnProperty']('nolimit')){_0x4a89aa[_0x7e64('0x39')]=qs[_0x7e64('0x39')](_0x50814c[_0x7e64('0x33')][_0x7e64('0x39')]);_0x4a89aa[_0x7e64('0x1e')]=qs[_0x7e64('0x1e')](_0x50814c[_0x7e64('0x33')][_0x7e64('0x1e')]);}_0x4a89aa[_0x7e64('0x3a')]=qs[_0x7e64('0x3b')](_0x50814c[_0x7e64('0x33')]['sort']);_0x4a89aa[_0x7e64('0x3c')]=qs[_0x7e64('0x34')](_[_0x7e64('0x3d')](_0x50814c[_0x7e64('0x33')],_0x462d35['filters']));if(_0x50814c[_0x7e64('0x33')][_0x7e64('0x3e')]){_0x4a89aa[_0x7e64('0x3c')]=_['merge'](_0x4a89aa['where'],{'$or':_[_0x7e64('0x2e')](_0x3cb227,function(_0x34fed7){if(_0x34fed7[_0x7e64('0x31')]!==_0x7e64('0x3f')){var _0x4e4508={};_0x4e4508[_0x34fed7[_0x7e64('0x2c')]]={'$like':'%'+_0x50814c[_0x7e64('0x33')][_0x7e64('0x3e')]+'%'};return _0x4e4508;}})});}_0x4a89aa=_[_0x7e64('0x40')]({},_0x4a89aa,_0x50814c[_0x7e64('0x41')]);var _0x410f8f={'where':_0x4a89aa['where']};return db['Sound'][_0x7e64('0x1d')](_0x410f8f)[_0x7e64('0x25')](function(_0x371f81){_0x225586[_0x7e64('0x1d')]=_0x371f81;if(_0x50814c['query'][_0x7e64('0x42')]){_0x4a89aa[_0x7e64('0x43')]=[{'all':!![]}];}return db[_0x7e64('0x2f')][_0x7e64('0x44')](_0x4a89aa);})['then'](function(_0x4f5082){_0x225586[_0x7e64('0x45')]=_0x4f5082;return _0x225586;})[_0x7e64('0x25')](respondWithFilteredResult(_0x4483fe,_0x4a89aa))[_0x7e64('0x46')](handleError(_0x4483fe,null));};exports[_0x7e64('0x47')]=function(_0x1b61e,_0x5711cb){var _0x46c758={'raw':!![],'where':{'id':_0x1b61e[_0x7e64('0x48')]['id']}},_0x451055={};_0x451055['model']=_[_0x7e64('0x49')](db[_0x7e64('0x2f')][_0x7e64('0x30')]);_0x451055[_0x7e64('0x33')]=_[_0x7e64('0x49')](_0x1b61e[_0x7e64('0x33')]);_0x451055[_0x7e64('0x34')]=_['intersection'](_0x451055['model'],_0x451055[_0x7e64('0x33')]);_0x46c758[_0x7e64('0x36')]=_[_0x7e64('0x35')](_0x451055[_0x7e64('0x32')],qs[_0x7e64('0x37')](_0x1b61e[_0x7e64('0x33')][_0x7e64('0x37')]));_0x46c758[_0x7e64('0x36')]=_0x46c758[_0x7e64('0x36')][_0x7e64('0x38')]?_0x46c758[_0x7e64('0x36')]:_0x451055['model'];if(_0x1b61e[_0x7e64('0x33')][_0x7e64('0x42')]){_0x46c758['include']=[{'all':!![]}];}_0x46c758=_['merge']({},_0x46c758,_0x1b61e[_0x7e64('0x41')]);return db[_0x7e64('0x2f')][_0x7e64('0x4a')](_0x46c758)['then'](handleEntityNotFound(_0x5711cb,null))[_0x7e64('0x25')](respondWithResult(_0x5711cb,null))[_0x7e64('0x46')](handleError(_0x5711cb,null));};exports['download']=function(_0x249c1c,_0x829207,_0x2b1cb6){return db[_0x7e64('0x2f')]['find']({'where':{'id':_0x249c1c[_0x7e64('0x48')]['id']},'attributes':[_0x7e64('0x2c'),_0x7e64('0x4b'),_0x7e64('0x4c')],'raw':!![]})[_0x7e64('0x25')](handleEntityNotFound(_0x829207,null))['then'](function(_0x2fb47b){if(_0x2fb47b){if(!fs[_0x7e64('0x4d')](path[_0x7e64('0x4e')](config[_0x7e64('0x4f')],_0x7e64('0x50'),_0x2fb47b[_0x7e64('0x4b')]+'.'+_0x2fb47b['converted_format']))){throw new db[(_0x7e64('0x51'))][(_0x7e64('0x52'))](_0x7e64('0x53'));}return _0x829207[_0x7e64('0x54')](path['join'](config[_0x7e64('0x4f')],_0x7e64('0x50'),util[_0x7e64('0x55')](_0x7e64('0x56'),_0x2fb47b[_0x7e64('0x4b')],_0x2fb47b[_0x7e64('0x4c')])),util['format']('%s.%s',_0x2fb47b[_0x7e64('0x2c')],_0x2fb47b[_0x7e64('0x4c')]));}return null;})[_0x7e64('0x46')](handleError(_0x829207,null));};exports[_0x7e64('0x57')]=function(_0x335e43,_0x144815,_0x311c42){var _0x372d17={'name':path[_0x7e64('0x58')](_0x335e43[_0x7e64('0x59')][_0x7e64('0x5a')],path[_0x7e64('0x5b')](_0x335e43[_0x7e64('0x59')][_0x7e64('0x5a')])),'save_name':path[_0x7e64('0x58')](_0x335e43[_0x7e64('0x59')]['filename'],path[_0x7e64('0x5b')](_0x335e43[_0x7e64('0x59')][_0x7e64('0x5c')])),'original_format':path[_0x7e64('0x5b')](_0x335e43[_0x7e64('0x59')][_0x7e64('0x5a')])[_0x7e64('0x5d')](0x1),'converted_format':'wav'};var _0x492894=path[_0x7e64('0x4e')](config[_0x7e64('0x4f')],_0x7e64('0x5e'),_0x335e43[_0x7e64('0x59')][_0x7e64('0x5c')]);var _0x561cd7=path['join'](config[_0x7e64('0x4f')],_0x7e64('0x50'),util[_0x7e64('0x55')](_0x7e64('0x56'),path[_0x7e64('0x58')](_0x335e43[_0x7e64('0x59')][_0x7e64('0x5c')],path[_0x7e64('0x5b')](_0x335e43[_0x7e64('0x59')]['filename'])),_0x372d17[_0x7e64('0x4c')]));logger['info'](_0x7e64('0x5f'),_0x492894);logger[_0x7e64('0x60')](_0x7e64('0x61'),_0x561cd7);try{fs[_0x7e64('0x62')](_0x492894,parseInt(_0x7e64('0x63'),0x8));var _0x3dbce7=sox[_0x7e64('0x64')](_0x492894,_0x561cd7,{'sampleRate':0x1f40,'format':_0x7e64('0x65'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3dbce7['on'](_0x7e64('0x2a'),function(_0xdf65dd){fs[_0x7e64('0x66')](_0x492894);_0x144815[_0x7e64('0x1b')](0x1f4)[_0x7e64('0x67')](_0xdf65dd);});_0x3dbce7['on']('src',function(_0x5bfeee){_0x372d17['original_duration']=isNaN(_0x5bfeee[_0x7e64('0x68')])?null:_0x5bfeee[_0x7e64('0x68')]*0x3e8;_0x372d17['original_sampleCount']=isNaN(_0x5bfeee[_0x7e64('0x69')])?null:_0x5bfeee[_0x7e64('0x69')];_0x372d17['original_channelCount']=isNaN(_0x5bfeee['channelCount'])?null:_0x5bfeee[_0x7e64('0x6a')];_0x372d17[_0x7e64('0x6b')]=isNaN(_0x5bfeee[_0x7e64('0x6c')])?null:_0x5bfeee[_0x7e64('0x6c')];_0x372d17['original_sampleRate']=isNaN(_0x5bfeee[_0x7e64('0x6d')])?null:_0x5bfeee[_0x7e64('0x6d')];});_0x3dbce7['on'](_0x7e64('0x6e'),function(_0x4b9403){_0x372d17['converted_duration']=isNaN(_0x4b9403[_0x7e64('0x68')])?null:_0x4b9403[_0x7e64('0x68')]*0x3e8;_0x372d17[_0x7e64('0x6f')]=isNaN(_0x4b9403[_0x7e64('0x69')])?null:_0x4b9403[_0x7e64('0x69')];_0x372d17[_0x7e64('0x70')]=isNaN(_0x4b9403[_0x7e64('0x6a')])?null:_0x4b9403['channelCount'];_0x372d17['converted_bitRate']=isNaN(_0x4b9403['bitRate'])?null:_0x4b9403[_0x7e64('0x6c')];_0x372d17[_0x7e64('0x71')]=isNaN(_0x4b9403['sampleRate'])?null:_0x4b9403[_0x7e64('0x6d')];});_0x3dbce7['on'](_0x7e64('0x1c'),function(){fs[_0x7e64('0x62')](_0x561cd7,parseInt(_0x7e64('0x63'),0x8));return db['Sound'][_0x7e64('0x57')](_0x372d17)[_0x7e64('0x25')](function(_0x4bbc3f){var _0xf44c29={'role':_0x335e43[_0x7e64('0x72')][_0x7e64('0x73')],'userProfileId':_0x335e43[_0x7e64('0x72')][_0x7e64('0x74')]};if(!_0xf44c29)throw new Error(_0x7e64('0x75'));if(_0xf44c29[_0x7e64('0x73')]===_0x7e64('0x76')){var _0x12fbfa=_0x4bbc3f[_0x7e64('0x26')]({'plain':!![]});return db[_0x7e64('0x77')][_0x7e64('0x4a')]({'where':{'name':_0x7e64('0x78'),'userProfileId':_0xf44c29[_0x7e64('0x74')]},'raw':!![]})[_0x7e64('0x25')](function(_0x3b6b7e){if(_0x3b6b7e&&_0x3b6b7e[_0x7e64('0x79')]===0x0){return db[_0x7e64('0x27')]['create']({'name':_0x12fbfa['name'],'resourceId':_0x12fbfa['id'],'type':_0x3b6b7e[_0x7e64('0x2c')],'sectionId':_0x3b6b7e['id']},{})[_0x7e64('0x25')](function(){return _0x4bbc3f;});}else{return _0x4bbc3f;}})[_0x7e64('0x46')](function(_0x3a4059){logger[_0x7e64('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3a4059);throw _0x3a4059;});}return _0x4bbc3f;})['then'](respondWithResult(_0x144815,null))[_0x7e64('0x46')](handleError(_0x144815,null));});_0x3dbce7['start']();}catch(_0x3f640a){_0x144815[_0x7e64('0x1b')](0x1f4)[_0x7e64('0x67')](_0x3f640a);}};exports[_0x7e64('0x24')]=function(_0x322928,_0x5c1397,_0x517844){return db[_0x7e64('0x2f')]['find']({'where':{'id':_0x322928[_0x7e64('0x48')]['id']}})[_0x7e64('0x25')](handleEntityNotFound(_0x5c1397,null))[_0x7e64('0x25')](saveUpdates(_[_0x7e64('0x3d')](_0x322928[_0x7e64('0x72')],[_0x7e64('0x2c'),_0x7e64('0x7a')]),null))[_0x7e64('0x25')](respondWithResult(_0x5c1397,null))['catch'](handleError(_0x5c1397,null));};exports[_0x7e64('0x7b')]=function(_0x1438d4,_0x29351a,_0x3fe19f){return db['Sound'][_0x7e64('0x4a')]({'where':{'id':_0x1438d4[_0x7e64('0x48')]['id']}})[_0x7e64('0x25')](function(_0x31f280){if(_0x31f280){return _0x31f280[_0x7e64('0x28')]();}})[_0x7e64('0x25')](function(_0x41ef0d){var _0x310732=path[_0x7e64('0x4e')](config[_0x7e64('0x4f')],_0x7e64('0x5e'),util[_0x7e64('0x55')]('%s.%s',_0x41ef0d[_0x7e64('0x4b')],_0x41ef0d[_0x7e64('0x7c')]));var _0x28ff4a=path[_0x7e64('0x4e')](config[_0x7e64('0x4f')],_0x7e64('0x50'),util[_0x7e64('0x55')](_0x7e64('0x56'),_0x41ef0d[_0x7e64('0x4b')],_0x41ef0d[_0x7e64('0x4c')]));fs[_0x7e64('0x66')](_0x310732);fs[_0x7e64('0x66')](_0x28ff4a);return _0x41ef0d;})['then'](function(_0x4a2508){if(_0x4a2508){return _0x29351a[_0x7e64('0x1b')](0xcc)[_0x7e64('0x1c')]();}})['then'](handleEntityNotFound(_0x29351a,null))[_0x7e64('0x46')](handleError(_0x29351a,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index dde7530..40ff47d 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 _0x1545=['exports','Sound','tools_sounds','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./sound.attributes'];(function(_0x56e1f1,_0x433412){var _0x5a7b9d=function(_0x13248b){while(--_0x13248b){_0x56e1f1['push'](_0x56e1f1['shift']());}};_0x5a7b9d(++_0x433412);}(_0x1545,0xd5));var _0x5154=function(_0x23e207,_0x34850b){_0x23e207=_0x23e207-0x0;var _0x2e25fa=_0x1545[_0x23e207];return _0x2e25fa;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5154('0x0'))(_0x5154('0x1'));var moment=require('moment');var BPromise=require(_0x5154('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5154('0x3'));var rimraf=require(_0x5154('0x4'));var config=require(_0x5154('0x5'));var attributes=require(_0x5154('0x6'));module[_0x5154('0x7')]=function(_0x1c30ed,_0x843f2c){return _0x1c30ed['define'](_0x5154('0x8'),attributes,{'tableName':_0x5154('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2295=['define','tools_sounds','moment','bluebird','request-promise','path','rimraf','./sound.attributes','exports'];(function(_0x2f6954,_0x561c15){var _0x1e74a1=function(_0x5dae1b){while(--_0x5dae1b){_0x2f6954['push'](_0x2f6954['shift']());}};_0x1e74a1(++_0x561c15);}(_0x2295,0x146));var _0x5229=function(_0x40c65a,_0x495814){_0x40c65a=_0x40c65a-0x0;var _0x2462a1=_0x2295[_0x40c65a];return _0x2462a1;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x5229('0x0'));var BPromise=require(_0x5229('0x1'));var rp=require(_0x5229('0x2'));var fs=require('fs');var path=require(_0x5229('0x3'));var rimraf=require(_0x5229('0x4'));var config=require('../../config/environment');var attributes=require(_0x5229('0x5'));module[_0x5229('0x6')]=function(_0x1dfd96,_0x3db5cd){return _0x1dfd96[_0x5229('0x7')]('Sound',attributes,{'tableName':_0x5229('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/sound/sound.rpc.js b/server/api/sound/sound.rpc.js index 3ac1376..5f24233 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 _0x8892=['Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','find','options','raw','where','include','map','model','attributes','ShowSound','stringify','lodash','util','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x1f8715,_0x4e4551){var _0x3d0f3e=function(_0x4008eb){while(--_0x4008eb){_0x1f8715['push'](_0x1f8715['shift']());}};_0x3d0f3e(++_0x4e4551);}(_0x8892,0xcd));var _0x2889=function(_0x2adf22,_0x3d015a){_0x2adf22=_0x2adf22-0x0;var _0x5ac621=_0x8892[_0x2adf22];return _0x5ac621;};'use strict';var _=require(_0x2889('0x0'));var util=require(_0x2889('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2889('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2889('0x3'));var logger=require(_0x2889('0x4'))(_0x2889('0x5'));var config=require(_0x2889('0x6'));var jayson=require(_0x2889('0x7'));var client=jayson[_0x2889('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3d472e,_0x247048,_0x2d1f32){return new BPromise(function(_0x238c45,_0x599906){return client[_0x2889('0x9')](_0x3d472e,_0x2d1f32)[_0x2889('0xa')](function(_0x26db1d){logger[_0x2889('0xb')](_0x2889('0xc'),_0x247048,_0x2889('0xd'));logger[_0x2889('0xe')](_0x2889('0xf'),_0x247048,_0x2889('0xd'),JSON['stringify'](_0x26db1d));if(_0x26db1d['error']){if(_0x26db1d['error'][_0x2889('0x10')]===0x1f4){logger[_0x2889('0x11')]('Sound,\x20%s,\x20%s',_0x247048,_0x26db1d[_0x2889('0x11')][_0x2889('0x12')]);return _0x599906(_0x26db1d['error'][_0x2889('0x12')]);}logger['error']('Sound,\x20%s,\x20%s',_0x247048,_0x26db1d[_0x2889('0x11')]['message']);return _0x238c45(_0x26db1d[_0x2889('0x11')][_0x2889('0x12')]);}else{logger['info'](_0x2889('0xc'),_0x247048,_0x2889('0xd'));_0x238c45(_0x26db1d[_0x2889('0x13')]['message']);}})[_0x2889('0x14')](function(_0x42aa2c){logger[_0x2889('0x11')](_0x2889('0xc'),_0x247048,_0x42aa2c);_0x599906(_0x42aa2c);});});}exports['ShowSound']=function(_0x37ef53){var _0xcfb599=this;return new Promise(function(_0x39d85a,_0x24cafc){return db['Sound'][_0x2889('0x15')]({'raw':_0x37ef53[_0x2889('0x16')]?_0x37ef53[_0x2889('0x16')][_0x2889('0x17')]===undefined?!![]:![]:!![],'where':_0x37ef53['options']?_0x37ef53[_0x2889('0x16')][_0x2889('0x18')]||null:null,'attributes':_0x37ef53['options']?_0x37ef53['options']['attributes']||null:null,'include':_0x37ef53[_0x2889('0x16')]?_0x37ef53[_0x2889('0x16')][_0x2889('0x19')]?_[_0x2889('0x1a')](_0x37ef53[_0x2889('0x16')][_0x2889('0x19')],function(_0x46a92c){return{'model':db[_0x46a92c[_0x2889('0x1b')]],'as':_0x46a92c['as'],'attributes':_0x46a92c[_0x2889('0x1c')],'include':_0x46a92c['include']?_[_0x2889('0x1a')](_0x46a92c[_0x2889('0x19')],function(_0x40a43c){return{'model':db[_0x40a43c[_0x2889('0x1b')]],'as':_0x40a43c['as'],'attributes':_0x40a43c[_0x2889('0x1c')],'include':_0x40a43c[_0x2889('0x19')]?_['map'](_0x40a43c[_0x2889('0x19')],function(_0x4739cd){return{'model':db[_0x4739cd[_0x2889('0x1b')]],'as':_0x4739cd['as'],'attributes':_0x4739cd[_0x2889('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x2889('0xa')](function(_0x1aa67d){logger['info'](_0x2889('0x1d'),_0x37ef53);logger['debug'](_0x2889('0x1d'),_0x37ef53,JSON[_0x2889('0x1e')](_0x1aa67d));_0x39d85a(_0x1aa67d);})['catch'](function(_0x127511){logger[_0x2889('0x11')](_0x2889('0x1d'),_0x127511[_0x2889('0x12')],_0x37ef53);_0x24cafc(_0xcfb599[_0x2889('0x11')](0x1f4,_0x127511[_0x2889('0x12')]));});});}; \ No newline at end of file +var _0xa915=['Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSound','Sound','options','raw','where','attributes','include','map','model','debug','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Sound,\x20%s,\x20%s','request\x20sent'];(function(_0x1d2f68,_0x280a21){var _0x3cbf0a=function(_0x304f91){while(--_0x304f91){_0x1d2f68['push'](_0x1d2f68['shift']());}};_0x3cbf0a(++_0x280a21);}(_0xa915,0x1d1));var _0x5a91=function(_0x4eb2d1,_0x4c6a20){_0x4eb2d1=_0x4eb2d1-0x0;var _0x9482ec=_0xa915[_0x4eb2d1];return _0x9482ec;};'use strict';var _=require(_0x5a91('0x0'));var util=require(_0x5a91('0x1'));var moment=require(_0x5a91('0x2'));var BPromise=require('bluebird');var rs=require(_0x5a91('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5a91('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5a91('0x5'))(_0x5a91('0x6'));var config=require(_0x5a91('0x7'));var jayson=require(_0x5a91('0x8'));var client=jayson['client'][_0x5a91('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4d253d,_0x1d230c,_0x24b193){return new BPromise(function(_0x441cc8,_0x4f8ed4){return client[_0x5a91('0xa')](_0x4d253d,_0x24b193)[_0x5a91('0xb')](function(_0x231d06){logger[_0x5a91('0xc')](_0x5a91('0xd'),_0x1d230c,_0x5a91('0xe'));logger['debug'](_0x5a91('0xf'),_0x1d230c,_0x5a91('0xe'),JSON[_0x5a91('0x10')](_0x231d06));if(_0x231d06['error']){if(_0x231d06[_0x5a91('0x11')][_0x5a91('0x12')]===0x1f4){logger['error']('Sound,\x20%s,\x20%s',_0x1d230c,_0x231d06[_0x5a91('0x11')][_0x5a91('0x13')]);return _0x4f8ed4(_0x231d06[_0x5a91('0x11')][_0x5a91('0x13')]);}logger['error'](_0x5a91('0xd'),_0x1d230c,_0x231d06[_0x5a91('0x11')][_0x5a91('0x13')]);return _0x441cc8(_0x231d06[_0x5a91('0x11')][_0x5a91('0x13')]);}else{logger[_0x5a91('0xc')](_0x5a91('0xd'),_0x1d230c,_0x5a91('0xe'));_0x441cc8(_0x231d06[_0x5a91('0x14')][_0x5a91('0x13')]);}})[_0x5a91('0x15')](function(_0x160b81){logger[_0x5a91('0x11')](_0x5a91('0xd'),_0x1d230c,_0x160b81);_0x4f8ed4(_0x160b81);});});}exports[_0x5a91('0x16')]=function(_0x55a271){var _0x584a05=this;return new Promise(function(_0xfa639b,_0x4ea443){return db[_0x5a91('0x17')]['find']({'raw':_0x55a271[_0x5a91('0x18')]?_0x55a271[_0x5a91('0x18')][_0x5a91('0x19')]===undefined?!![]:![]:!![],'where':_0x55a271['options']?_0x55a271[_0x5a91('0x18')][_0x5a91('0x1a')]||null:null,'attributes':_0x55a271[_0x5a91('0x18')]?_0x55a271[_0x5a91('0x18')][_0x5a91('0x1b')]||null:null,'include':_0x55a271[_0x5a91('0x18')]?_0x55a271[_0x5a91('0x18')][_0x5a91('0x1c')]?_[_0x5a91('0x1d')](_0x55a271[_0x5a91('0x18')][_0x5a91('0x1c')],function(_0x2d7e80){return{'model':db[_0x2d7e80[_0x5a91('0x1e')]],'as':_0x2d7e80['as'],'attributes':_0x2d7e80['attributes'],'include':_0x2d7e80[_0x5a91('0x1c')]?_[_0x5a91('0x1d')](_0x2d7e80['include'],function(_0x19da12){return{'model':db[_0x19da12['model']],'as':_0x19da12['as'],'attributes':_0x19da12[_0x5a91('0x1b')],'include':_0x19da12[_0x5a91('0x1c')]?_[_0x5a91('0x1d')](_0x19da12[_0x5a91('0x1c')],function(_0x29cb6b){return{'model':db[_0x29cb6b[_0x5a91('0x1e')]],'as':_0x29cb6b['as'],'attributes':_0x29cb6b[_0x5a91('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x5a91('0xb')](function(_0x27d593){logger[_0x5a91('0xc')](_0x5a91('0x16'),_0x55a271);logger[_0x5a91('0x1f')](_0x5a91('0x16'),_0x55a271,JSON[_0x5a91('0x10')](_0x27d593));_0xfa639b(_0x27d593);})[_0x5a91('0x15')](function(_0xb0bda6){logger['error'](_0x5a91('0x16'),_0xb0bda6['message'],_0x55a271);_0x4ea443(_0x584a05[_0x5a91('0x11')](0x1f4,_0xb0bda6[_0x5a91('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index b6f7270..82b91d8 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 _0x109e=['index','/:id','isAuthenticated','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareMessage.controller','get'];(function(_0x4e28ab,_0x56e54d){var _0x4f3307=function(_0x30f822){while(--_0x30f822){_0x4e28ab['push'](_0x4e28ab['shift']());}};_0x4f3307(++_0x56e54d);}(_0x109e,0xb5));var _0xe109=function(_0x28e6f6,_0x17d049){_0x28e6f6=_0x28e6f6-0x0;var _0x210cf6=_0x109e[_0x28e6f6];return _0x210cf6;};'use strict';var multer=require(_0xe109('0x0'));var util=require(_0xe109('0x1'));var path=require(_0xe109('0x2'));var timeout=require(_0xe109('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0xe109('0x4'));var interaction=require(_0xe109('0x5'));var config=require(_0xe109('0x6'));var controller=require(_0xe109('0x7'));router[_0xe109('0x8')]('/',auth['isAuthenticated'](),controller[_0xe109('0x9')]);router[_0xe109('0x8')](_0xe109('0xa'),auth[_0xe109('0xb')](),controller[_0xe109('0xc')]);router[_0xe109('0xd')]('/',auth[_0xe109('0xb')](),controller[_0xe109('0xe')]);router[_0xe109('0xf')](_0xe109('0xa'),auth[_0xe109('0xb')](),controller['update']);router[_0xe109('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xe109('0x11')]);module[_0xe109('0x12')]=router; \ No newline at end of file +var _0x529a=['delete','/:id','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./squareMessage.controller','get','index','isAuthenticated','post','put','update'];(function(_0x505df9,_0x14138e){var _0x1cc025=function(_0x5d2a1f){while(--_0x5d2a1f){_0x505df9['push'](_0x505df9['shift']());}};_0x1cc025(++_0x14138e);}(_0x529a,0x148));var _0xa529=function(_0x251d9c,_0x580977){_0x251d9c=_0x251d9c-0x0;var _0x16ae64=_0x529a[_0x251d9c];return _0x16ae64;};'use strict';var multer=require('multer');var util=require(_0xa529('0x0'));var path=require(_0xa529('0x1'));var timeout=require(_0xa529('0x2'));var express=require(_0xa529('0x3'));var router=express[_0xa529('0x4')]();var auth=require(_0xa529('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa529('0x6'));var controller=require(_0xa529('0x7'));router[_0xa529('0x8')]('/',auth['isAuthenticated'](),controller[_0xa529('0x9')]);router[_0xa529('0x8')]('/:id',auth[_0xa529('0xa')](),controller['show']);router[_0xa529('0xb')]('/',auth[_0xa529('0xa')](),controller['create']);router[_0xa529('0xc')]('/:id',auth[_0xa529('0xa')](),controller[_0xa529('0xd')]);router[_0xa529('0xe')](_0xa529('0xf'),auth[_0xa529('0xa')](),controller[_0xa529('0x10')]);module[_0xa529('0x11')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index d9efb36..9264e6d 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 _0x9d9e=['medium','ENUM','out','sequelize','exports','TEXT'];(function(_0x3ea6e8,_0x2b1edf){var _0x1acb28=function(_0x2eb386){while(--_0x2eb386){_0x3ea6e8['push'](_0x3ea6e8['shift']());}};_0x1acb28(++_0x2b1edf);}(_0x9d9e,0x189));var _0xe9d9=function(_0x20352e,_0x1ee2ac){_0x20352e=_0x20352e-0x0;var _0x5a9319=_0x9d9e[_0x20352e];return _0x5a9319;};'use strict';var Sequelize=require(_0xe9d9('0x0'));module[_0xe9d9('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize[_0xe9d9('0x2')](_0xe9d9('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0xe9d9('0x4')]('in',_0xe9d9('0x5')),'defaultValue':_0xe9d9('0x5'),'allowNull':![]}}; \ No newline at end of file +var _0xa5e1=['sequelize','exports','STRING','TEXT','medium','out'];(function(_0x3e8270,_0x293590){var _0x1ccde9=function(_0x213490){while(--_0x213490){_0x3e8270['push'](_0x3e8270['shift']());}};_0x1ccde9(++_0x293590);}(_0xa5e1,0xb4));var _0x1a5e=function(_0x143c93,_0x1ae519){_0x143c93=_0x143c93-0x0;var _0x1a9ea8=_0xa5e1[_0x143c93];return _0x1a9ea8;};'use strict';var Sequelize=require(_0x1a5e('0x0'));module[_0x1a5e('0x1')]={'uniqueid':{'type':Sequelize[_0x1a5e('0x2')]},'body':{'type':Sequelize[_0x1a5e('0x3')](_0x1a5e('0x4')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0x1a5e('0x5')),'defaultValue':_0x1a5e('0x5'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index f4c5d94..cce350d 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 _0xd0cf=['error','stack','name','send','index','map','SquareMessage','type','key','model','query','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','fields','length','create','body','find','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then'];(function(_0x2964e5,_0x363898){var _0x33072c=function(_0x4e4cc7){while(--_0x4e4cc7){_0x2964e5['push'](_0x2964e5['shift']());}};_0x33072c(++_0x363898);}(_0xd0cf,0x77));var _0xfd0c=function(_0x166e96,_0x55191d){_0x166e96=_0x166e96-0x0;var _0x553d73=_0xd0cf[_0x166e96];return _0x553d73;};'use strict';var pdf=require(_0xfd0c('0x0'));var emlformat=require(_0xfd0c('0x1'));var rimraf=require(_0xfd0c('0x2'));var zipdir=require(_0xfd0c('0x3'));var jsonpatch=require(_0xfd0c('0x4'));var rp=require('request-promise');var moment=require(_0xfd0c('0x5'));var BPromise=require(_0xfd0c('0x6'));var Mustache=require(_0xfd0c('0x7'));var util=require(_0xfd0c('0x8'));var path=require(_0xfd0c('0x9'));var sox=require(_0xfd0c('0xa'));var csv=require(_0xfd0c('0xb'));var ejs=require(_0xfd0c('0xc'));var fs=require('fs');var _=require(_0xfd0c('0xd'));var squel=require(_0xfd0c('0xe'));var crypto=require(_0xfd0c('0xf'));var jsforce=require(_0xfd0c('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xfd0c('0x11'));var Papa=require(_0xfd0c('0x12'));var Redis=require(_0xfd0c('0x13'));var authService=require(_0xfd0c('0x14'));var qs=require(_0xfd0c('0x15'));var as=require(_0xfd0c('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfd0c('0x17'))(_0xfd0c('0x18'));var utils=require(_0xfd0c('0x19'));var config=require(_0xfd0c('0x1a'));var db=require(_0xfd0c('0x1b'))['db'];function respondWithStatusCode(_0x54620a,_0x10ec2f){_0x10ec2f=_0x10ec2f||0xcc;return function(_0x298560){if(_0x298560){return _0x54620a[_0xfd0c('0x1c')](_0x10ec2f);}return _0x54620a[_0xfd0c('0x1d')](_0x10ec2f)[_0xfd0c('0x1e')]();};}function respondWithResult(_0xdfbe4d,_0x2c5d39){_0x2c5d39=_0x2c5d39||0xc8;return function(_0x2e330d){if(_0x2e330d){return _0xdfbe4d[_0xfd0c('0x1d')](_0x2c5d39)[_0xfd0c('0x1f')](_0x2e330d);}};}function respondWithFilteredResult(_0x1efa36,_0x28a100){return function(_0x5506b0){if(_0x5506b0){var _0x18798a=_0x5506b0[_0xfd0c('0x20')],_0x55c470=_0x28a100[_0xfd0c('0x21')],_0x51b61b=_0x28a100[_0xfd0c('0x21')]+_0x28a100[_0xfd0c('0x22')],_0x4b4569;if(_0x51b61b>=_0x18798a){_0x51b61b=_0x18798a;_0x4b4569=0xc8;}else{_0x4b4569=0xce;}_0x1efa36[_0xfd0c('0x1d')](_0x4b4569);return _0x1efa36[_0xfd0c('0x23')](_0xfd0c('0x24'),_0x55c470+'-'+_0x51b61b+'/'+_0x18798a)[_0xfd0c('0x1f')](_0x5506b0);}return null;};}function patchUpdates(_0x168f75){return function(_0x10108e){try{jsonpatch[_0xfd0c('0x25')](_0x10108e,_0x168f75,!![]);}catch(_0x1df080){return BPromise[_0xfd0c('0x26')](_0x1df080);}return _0x10108e[_0xfd0c('0x27')]();};}function saveUpdates(_0x3094ec,_0x111c38){return function(_0xaeda13){if(_0xaeda13){return _0xaeda13[_0xfd0c('0x28')](_0x3094ec)['then'](function(_0x504420){return _0x504420;});}return null;};}function removeEntity(_0x4f0b84,_0x41f1c7){return function(_0x51348d){if(_0x51348d){return _0x51348d[_0xfd0c('0x29')]()[_0xfd0c('0x2a')](function(){_0x4f0b84[_0xfd0c('0x1d')](0xcc)[_0xfd0c('0x1e')]();});}};}function handleEntityNotFound(_0x3bdd37,_0x232cbe){return function(_0x5600bd){if(!_0x5600bd){_0x3bdd37[_0xfd0c('0x1c')](0x194);}return _0x5600bd;};}function handleError(_0x2c44a5,_0x8e8fdf){_0x8e8fdf=_0x8e8fdf||0x1f4;return function(_0x373523){logger[_0xfd0c('0x2b')](_0x373523[_0xfd0c('0x2c')]);if(_0x373523[_0xfd0c('0x2d')]){delete _0x373523[_0xfd0c('0x2d')];}_0x2c44a5['status'](_0x8e8fdf)[_0xfd0c('0x2e')](_0x373523);};}exports[_0xfd0c('0x2f')]=function(_0x462f75,_0x55fd91){var _0x1bda37={},_0xa5ab3b={},_0x47090b={'count':0x0,'rows':[]};var _0x316841=_[_0xfd0c('0x30')](db[_0xfd0c('0x31')]['rawAttributes'],function(_0x506b7d){return{'name':_0x506b7d['fieldName'],'type':_0x506b7d[_0xfd0c('0x32')][_0xfd0c('0x33')]};});_0xa5ab3b[_0xfd0c('0x34')]=_[_0xfd0c('0x30')](_0x316841,_0xfd0c('0x2d'));_0xa5ab3b[_0xfd0c('0x35')]=_['keys'](_0x462f75[_0xfd0c('0x35')]);_0xa5ab3b['filters']=_[_0xfd0c('0x36')](_0xa5ab3b[_0xfd0c('0x34')],_0xa5ab3b[_0xfd0c('0x35')]);_0x1bda37[_0xfd0c('0x37')]=_[_0xfd0c('0x36')](_0xa5ab3b['model'],qs['fields'](_0x462f75['query']['fields']));_0x1bda37[_0xfd0c('0x37')]=_0x1bda37[_0xfd0c('0x37')]['length']?_0x1bda37[_0xfd0c('0x37')]:_0xa5ab3b[_0xfd0c('0x34')];if(!_0x462f75['query'][_0xfd0c('0x38')](_0xfd0c('0x39'))){_0x1bda37[_0xfd0c('0x22')]=qs['limit'](_0x462f75[_0xfd0c('0x35')][_0xfd0c('0x22')]);_0x1bda37['offset']=qs[_0xfd0c('0x21')](_0x462f75['query'][_0xfd0c('0x21')]);}_0x1bda37[_0xfd0c('0x3a')]=qs[_0xfd0c('0x3b')](_0x462f75['query'][_0xfd0c('0x3b')]);_0x1bda37[_0xfd0c('0x3c')]=qs[_0xfd0c('0x3d')](_[_0xfd0c('0x3e')](_0x462f75[_0xfd0c('0x35')],_0xa5ab3b['filters']));if(_0x462f75['query'][_0xfd0c('0x3f')]){_0x1bda37['where']=_[_0xfd0c('0x40')](_0x1bda37['where'],{'$or':_[_0xfd0c('0x30')](_0x316841,function(_0x2a4d55){if(_0x2a4d55[_0xfd0c('0x32')]!==_0xfd0c('0x41')){var _0x1cce34={};_0x1cce34[_0x2a4d55[_0xfd0c('0x2d')]]={'$like':'%'+_0x462f75[_0xfd0c('0x35')][_0xfd0c('0x3f')]+'%'};return _0x1cce34;}})});}_0x1bda37=_[_0xfd0c('0x40')]({},_0x1bda37,_0x462f75[_0xfd0c('0x42')]);var _0x367949={'where':_0x1bda37[_0xfd0c('0x3c')]};return db[_0xfd0c('0x31')]['count'](_0x367949)[_0xfd0c('0x2a')](function(_0x70fc34){_0x47090b[_0xfd0c('0x20')]=_0x70fc34;if(_0x462f75[_0xfd0c('0x35')][_0xfd0c('0x43')]){_0x1bda37[_0xfd0c('0x44')]=[{'all':!![]}];}return db[_0xfd0c('0x31')][_0xfd0c('0x45')](_0x1bda37);})[_0xfd0c('0x2a')](function(_0x1b50bd){_0x47090b[_0xfd0c('0x46')]=_0x1b50bd;return _0x47090b;})['then'](respondWithFilteredResult(_0x55fd91,_0x1bda37))[_0xfd0c('0x47')](handleError(_0x55fd91,null));};exports[_0xfd0c('0x48')]=function(_0x41a990,_0x5877ff){var _0x5f02b6={'raw':!![],'where':{'id':_0x41a990[_0xfd0c('0x49')]['id']}},_0x12966c={};_0x12966c['model']=_[_0xfd0c('0x4a')](db[_0xfd0c('0x31')][_0xfd0c('0x4b')]);_0x12966c['query']=_[_0xfd0c('0x4a')](_0x41a990[_0xfd0c('0x35')]);_0x12966c[_0xfd0c('0x3d')]=_[_0xfd0c('0x36')](_0x12966c['model'],_0x12966c['query']);_0x5f02b6[_0xfd0c('0x37')]=_[_0xfd0c('0x36')](_0x12966c[_0xfd0c('0x34')],qs[_0xfd0c('0x4c')](_0x41a990[_0xfd0c('0x35')][_0xfd0c('0x4c')]));_0x5f02b6['attributes']=_0x5f02b6['attributes'][_0xfd0c('0x4d')]?_0x5f02b6['attributes']:_0x12966c[_0xfd0c('0x34')];if(_0x41a990[_0xfd0c('0x35')][_0xfd0c('0x43')]){_0x5f02b6[_0xfd0c('0x44')]=[{'all':!![]}];}_0x5f02b6=_[_0xfd0c('0x40')]({},_0x5f02b6,_0x41a990[_0xfd0c('0x42')]);return db[_0xfd0c('0x31')]['find'](_0x5f02b6)['then'](handleEntityNotFound(_0x5877ff,null))['then'](respondWithResult(_0x5877ff,null))[_0xfd0c('0x47')](handleError(_0x5877ff,null));};exports[_0xfd0c('0x4e')]=function(_0x56662a,_0x493e9b){return db[_0xfd0c('0x31')]['create'](_0x56662a[_0xfd0c('0x4f')],{})[_0xfd0c('0x2a')](respondWithResult(_0x493e9b,0xc9))[_0xfd0c('0x47')](handleError(_0x493e9b,null));};exports[_0xfd0c('0x28')]=function(_0x202b0d,_0x41791b){if(_0x202b0d[_0xfd0c('0x4f')]['id']){delete _0x202b0d['body']['id'];}return db['SquareMessage'][_0xfd0c('0x50')]({'where':{'id':_0x202b0d['params']['id']}})[_0xfd0c('0x2a')](handleEntityNotFound(_0x41791b,null))[_0xfd0c('0x2a')](saveUpdates(_0x202b0d[_0xfd0c('0x4f')],null))[_0xfd0c('0x2a')](respondWithResult(_0x41791b,null))[_0xfd0c('0x47')](handleError(_0x41791b,null));};exports[_0xfd0c('0x29')]=function(_0x5d2749,_0x2a9f24){return db[_0xfd0c('0x31')][_0xfd0c('0x50')]({'where':{'id':_0x5d2749['params']['id']}})[_0xfd0c('0x2a')](handleEntityNotFound(_0x2a9f24,null))[_0xfd0c('0x2a')](removeEntity(_0x2a9f24,null))['catch'](handleError(_0x2a9f24,null));}; \ No newline at end of file +var _0x351d=['filters','attributes','intersection','fields','length','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','include','rows','catch','includeAll','options','find','create','body','params','html-pdf','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','squel','crypto','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','sendStatus','status','json','count','offset','limit','Content-Range','update','then','destroy','end','stack','name','index','SquareMessage','rawAttributes','type','model','query','keys'];(function(_0x56e0a5,_0x31ac20){var _0xb07bf=function(_0x1825da){while(--_0x1825da){_0x56e0a5['push'](_0x56e0a5['shift']());}};_0xb07bf(++_0x31ac20);}(_0x351d,0x90));var _0xd351=function(_0x4ef79f,_0x257775){_0x4ef79f=_0x4ef79f-0x0;var _0x54a2db=_0x351d[_0x4ef79f];return _0x54a2db;};'use strict';var pdf=require(_0xd351('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xd351('0x1'));var zipdir=require(_0xd351('0x2'));var jsonpatch=require(_0xd351('0x3'));var rp=require('request-promise');var moment=require(_0xd351('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd351('0x5'));var util=require(_0xd351('0x6'));var path=require('path');var sox=require(_0xd351('0x7'));var csv=require(_0xd351('0x8'));var ejs=require(_0xd351('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd351('0xa'));var crypto=require(_0xd351('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xd351('0xc'));var toCsv=require(_0xd351('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd351('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xd351('0xe'));var as=require(_0xd351('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd351('0x10'))(_0xd351('0x11'));var utils=require('../../config/utils');var config=require(_0xd351('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x54dd65,_0x3eb40c){_0x3eb40c=_0x3eb40c||0xcc;return function(_0x15549a){if(_0x15549a){return _0x54dd65[_0xd351('0x13')](_0x3eb40c);}return _0x54dd65[_0xd351('0x14')](_0x3eb40c)['end']();};}function respondWithResult(_0x358382,_0x316cf6){_0x316cf6=_0x316cf6||0xc8;return function(_0x597d7c){if(_0x597d7c){return _0x358382[_0xd351('0x14')](_0x316cf6)[_0xd351('0x15')](_0x597d7c);}};}function respondWithFilteredResult(_0x3c2299,_0xf1c285){return function(_0x3867fb){if(_0x3867fb){var _0x4d238c=_0x3867fb[_0xd351('0x16')],_0x9f790f=_0xf1c285['offset'],_0x49d8bb=_0xf1c285[_0xd351('0x17')]+_0xf1c285[_0xd351('0x18')],_0x5bdc03;if(_0x49d8bb>=_0x4d238c){_0x49d8bb=_0x4d238c;_0x5bdc03=0xc8;}else{_0x5bdc03=0xce;}_0x3c2299[_0xd351('0x14')](_0x5bdc03);return _0x3c2299['set'](_0xd351('0x19'),_0x9f790f+'-'+_0x49d8bb+'/'+_0x4d238c)[_0xd351('0x15')](_0x3867fb);}return null;};}function patchUpdates(_0x77985a){return function(_0x12b5aa){try{jsonpatch['apply'](_0x12b5aa,_0x77985a,!![]);}catch(_0xc2d2c0){return BPromise['reject'](_0xc2d2c0);}return _0x12b5aa['save']();};}function saveUpdates(_0x37d3ac,_0x4a427b){return function(_0x33b1e5){if(_0x33b1e5){return _0x33b1e5[_0xd351('0x1a')](_0x37d3ac)[_0xd351('0x1b')](function(_0x42631b){return _0x42631b;});}return null;};}function removeEntity(_0x15a3d8,_0x53e729){return function(_0x18625b){if(_0x18625b){return _0x18625b[_0xd351('0x1c')]()[_0xd351('0x1b')](function(){_0x15a3d8['status'](0xcc)[_0xd351('0x1d')]();});}};}function handleEntityNotFound(_0x2d9aa0,_0x365bbc){return function(_0x59fb6d){if(!_0x59fb6d){_0x2d9aa0[_0xd351('0x13')](0x194);}return _0x59fb6d;};}function handleError(_0x34a5cb,_0x4626c4){_0x4626c4=_0x4626c4||0x1f4;return function(_0x469e7d){logger['error'](_0x469e7d[_0xd351('0x1e')]);if(_0x469e7d['name']){delete _0x469e7d[_0xd351('0x1f')];}_0x34a5cb[_0xd351('0x14')](_0x4626c4)['send'](_0x469e7d);};}exports[_0xd351('0x20')]=function(_0x55b4d3,_0x50d67e){var _0x1d0cb1={},_0x560be9={},_0x546e67={'count':0x0,'rows':[]};var _0x134580=_['map'](db[_0xd351('0x21')][_0xd351('0x22')],function(_0x407b50){return{'name':_0x407b50['fieldName'],'type':_0x407b50[_0xd351('0x23')]['key']};});_0x560be9[_0xd351('0x24')]=_['map'](_0x134580,'name');_0x560be9[_0xd351('0x25')]=_[_0xd351('0x26')](_0x55b4d3[_0xd351('0x25')]);_0x560be9[_0xd351('0x27')]=_['intersection'](_0x560be9[_0xd351('0x24')],_0x560be9[_0xd351('0x25')]);_0x1d0cb1[_0xd351('0x28')]=_[_0xd351('0x29')](_0x560be9[_0xd351('0x24')],qs[_0xd351('0x2a')](_0x55b4d3[_0xd351('0x25')][_0xd351('0x2a')]));_0x1d0cb1[_0xd351('0x28')]=_0x1d0cb1['attributes'][_0xd351('0x2b')]?_0x1d0cb1[_0xd351('0x28')]:_0x560be9[_0xd351('0x24')];if(!_0x55b4d3[_0xd351('0x25')]['hasOwnProperty'](_0xd351('0x2c'))){_0x1d0cb1[_0xd351('0x18')]=qs[_0xd351('0x18')](_0x55b4d3[_0xd351('0x25')][_0xd351('0x18')]);_0x1d0cb1[_0xd351('0x17')]=qs[_0xd351('0x17')](_0x55b4d3[_0xd351('0x25')][_0xd351('0x17')]);}_0x1d0cb1['order']=qs['sort'](_0x55b4d3[_0xd351('0x25')][_0xd351('0x2d')]);_0x1d0cb1[_0xd351('0x2e')]=qs[_0xd351('0x27')](_[_0xd351('0x2f')](_0x55b4d3[_0xd351('0x25')],_0x560be9['filters']));if(_0x55b4d3['query'][_0xd351('0x30')]){_0x1d0cb1['where']=_[_0xd351('0x31')](_0x1d0cb1[_0xd351('0x2e')],{'$or':_[_0xd351('0x32')](_0x134580,function(_0x1bcebc){if(_0x1bcebc[_0xd351('0x23')]!==_0xd351('0x33')){var _0xeada4a={};_0xeada4a[_0x1bcebc[_0xd351('0x1f')]]={'$like':'%'+_0x55b4d3[_0xd351('0x25')][_0xd351('0x30')]+'%'};return _0xeada4a;}})});}_0x1d0cb1=_[_0xd351('0x31')]({},_0x1d0cb1,_0x55b4d3['options']);var _0x274867={'where':_0x1d0cb1['where']};return db[_0xd351('0x21')][_0xd351('0x16')](_0x274867)[_0xd351('0x1b')](function(_0x2f5e3a){_0x546e67[_0xd351('0x16')]=_0x2f5e3a;if(_0x55b4d3[_0xd351('0x25')]['includeAll']){_0x1d0cb1[_0xd351('0x34')]=[{'all':!![]}];}return db[_0xd351('0x21')]['findAll'](_0x1d0cb1);})[_0xd351('0x1b')](function(_0x2d8ea8){_0x546e67[_0xd351('0x35')]=_0x2d8ea8;return _0x546e67;})[_0xd351('0x1b')](respondWithFilteredResult(_0x50d67e,_0x1d0cb1))[_0xd351('0x36')](handleError(_0x50d67e,null));};exports['show']=function(_0x4a5560,_0x2f2049){var _0x3935aa={'raw':!![],'where':{'id':_0x4a5560['params']['id']}},_0x5dae6d={};_0x5dae6d[_0xd351('0x24')]=_[_0xd351('0x26')](db['SquareMessage']['rawAttributes']);_0x5dae6d[_0xd351('0x25')]=_[_0xd351('0x26')](_0x4a5560[_0xd351('0x25')]);_0x5dae6d[_0xd351('0x27')]=_[_0xd351('0x29')](_0x5dae6d[_0xd351('0x24')],_0x5dae6d[_0xd351('0x25')]);_0x3935aa[_0xd351('0x28')]=_[_0xd351('0x29')](_0x5dae6d['model'],qs['fields'](_0x4a5560[_0xd351('0x25')][_0xd351('0x2a')]));_0x3935aa[_0xd351('0x28')]=_0x3935aa[_0xd351('0x28')][_0xd351('0x2b')]?_0x3935aa[_0xd351('0x28')]:_0x5dae6d[_0xd351('0x24')];if(_0x4a5560[_0xd351('0x25')][_0xd351('0x37')]){_0x3935aa[_0xd351('0x34')]=[{'all':!![]}];}_0x3935aa=_[_0xd351('0x31')]({},_0x3935aa,_0x4a5560[_0xd351('0x38')]);return db[_0xd351('0x21')][_0xd351('0x39')](_0x3935aa)[_0xd351('0x1b')](handleEntityNotFound(_0x2f2049,null))[_0xd351('0x1b')](respondWithResult(_0x2f2049,null))['catch'](handleError(_0x2f2049,null));};exports[_0xd351('0x3a')]=function(_0x3ec78a,_0x8fe1b5){return db['SquareMessage'][_0xd351('0x3a')](_0x3ec78a[_0xd351('0x3b')],{})[_0xd351('0x1b')](respondWithResult(_0x8fe1b5,0xc9))[_0xd351('0x36')](handleError(_0x8fe1b5,null));};exports[_0xd351('0x1a')]=function(_0x5bc86a,_0x5adea4){if(_0x5bc86a['body']['id']){delete _0x5bc86a[_0xd351('0x3b')]['id'];}return db[_0xd351('0x21')]['find']({'where':{'id':_0x5bc86a['params']['id']}})[_0xd351('0x1b')](handleEntityNotFound(_0x5adea4,null))[_0xd351('0x1b')](saveUpdates(_0x5bc86a[_0xd351('0x3b')],null))['then'](respondWithResult(_0x5adea4,null))[_0xd351('0x36')](handleError(_0x5adea4,null));};exports[_0xd351('0x1c')]=function(_0x548d90,_0xf3ce5){return db['SquareMessage'][_0xd351('0x39')]({'where':{'id':_0x548d90[_0xd351('0x3c')]['id']}})['then'](handleEntityNotFound(_0xf3ce5,null))['then'](removeEntity(_0xf3ce5,null))[_0xd351('0x36')](handleError(_0xf3ce5,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 1b0bd5e..549851c 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 _0x6e7e=['define','SquareMessage','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./squareMessage.attributes','exports'];(function(_0x4210ed,_0x1ab215){var _0x394e18=function(_0xfd404c){while(--_0xfd404c){_0x4210ed['push'](_0x4210ed['shift']());}};_0x394e18(++_0x1ab215);}(_0x6e7e,0x147));var _0xe6e7=function(_0x2ff5c6,_0x248fe2){_0x2ff5c6=_0x2ff5c6-0x0;var _0x5605f2=_0x6e7e[_0x2ff5c6];return _0x5605f2;};'use strict';var _=require(_0xe6e7('0x0'));var util=require(_0xe6e7('0x1'));var logger=require(_0xe6e7('0x2'))(_0xe6e7('0x3'));var moment=require(_0xe6e7('0x4'));var BPromise=require(_0xe6e7('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe6e7('0x6'));var rimraf=require(_0xe6e7('0x7'));var config=require(_0xe6e7('0x8'));var attributes=require(_0xe6e7('0x9'));module[_0xe6e7('0xa')]=function(_0x34ee67,_0x517482){return _0x34ee67[_0xe6e7('0xb')](_0xe6e7('0xc'),attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x932b=['rimraf','../../config/environment','exports','define','SquareMessage','lodash','request-promise','path'];(function(_0x1b9fa7,_0x40158b){var _0x4e7c98=function(_0x2ea444){while(--_0x2ea444){_0x1b9fa7['push'](_0x1b9fa7['shift']());}};_0x4e7c98(++_0x40158b);}(_0x932b,0x17d));var _0xb932=function(_0x5ea94c,_0x19937b){_0x5ea94c=_0x5ea94c-0x0;var _0xededd7=_0x932b[_0x5ea94c];return _0xededd7;};'use strict';var _=require(_0xb932('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb932('0x1'));var fs=require('fs');var path=require(_0xb932('0x2'));var rimraf=require(_0xb932('0x3'));var config=require(_0xb932('0x4'));var attributes=require('./squareMessage.attributes');module[_0xb932('0x5')]=function(_0x4fd6fc,_0x4f6c9c){return _0x4fd6fc[_0xb932('0x6')](_0xb932('0x7'),attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.rpc.js b/server/api/squareMessage/squareMessage.rpc.js index 236b8d6..4d2dd38 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 _0xc1c6=['../../config/logger','jayson/promise','http','then','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','create','options','raw','CreateSquareMessage','lodash','util','moment','randomstring','../../mysqldb','../../config/utils'];(function(_0x461c5b,_0x5caa70){var _0x378d98=function(_0x249167){while(--_0x249167){_0x461c5b['push'](_0x461c5b['shift']());}};_0x378d98(++_0x5caa70);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x56c246,_0x24032e){_0x56c246=_0x56c246-0x0;var _0x55cf30=_0xc1c6[_0x56c246];return _0x55cf30;};'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);});});}exports['CreateSquareMessage']=function(_0x137770){var _0x4ede06=this;return new Promise(function(_0x338dc2,_0x1a0ab9){return db['SquareMessage'][_0x6c1c('0x13')](_0x137770['body'],{'raw':_0x137770[_0x6c1c('0x14')]?_0x137770[_0x6c1c('0x14')][_0x6c1c('0x15')]===undefined?!![]:![]:!![]})[_0x6c1c('0x9')](function(_0x1acf7f){logger[_0x6c1c('0x11')](_0x6c1c('0x16'),_0x137770);logger[_0x6c1c('0xc')](_0x6c1c('0x16'),_0x137770,JSON[_0x6c1c('0xe')](_0x1acf7f));_0x338dc2(_0x1acf7f);})[_0x6c1c('0x12')](function(_0x450b1f){logger[_0x6c1c('0xf')](_0x6c1c('0x16'),_0x450b1f[_0x6c1c('0x10')],_0x137770);_0x1a0ab9(_0x4ede06[_0x6c1c('0xf')](0x1f4,_0x450b1f[_0x6c1c('0x10')]));});});}; \ No newline at end of file +var _0x038b=['SquareMessage','create','body','options','raw','debug','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','SquareMessage,\x20%s,\x20%s','request\x20sent','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateSquareMessage'];(function(_0x3c9307,_0x3b6a59){var _0x5e122c=function(_0x724f38){while(--_0x724f38){_0x3c9307['push'](_0x3c9307['shift']());}};_0x5e122c(++_0x3b6a59);}(_0x038b,0x114));var _0xb038=function(_0x34a04c,_0x4e2e16){_0x34a04c=_0x34a04c-0x0;var _0x4fd85a=_0x038b[_0x34a04c];return _0x4fd85a;};'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});function respondWithRpcPromise(_0x2e3e64,_0x1b077a,_0x1534a9){return new BPromise(function(_0x4b4085,_0x48a4d7){return client[_0xb038('0x8')](_0x2e3e64,_0x1534a9)[_0xb038('0x9')](function(_0x4d85b4){logger['info'](_0xb038('0xa'),_0x1b077a,_0xb038('0xb'));logger['debug'](_0xb038('0xc'),_0x1b077a,_0xb038('0xb'),JSON[_0xb038('0xd')](_0x4d85b4));if(_0x4d85b4[_0xb038('0xe')]){if(_0x4d85b4[_0xb038('0xe')][_0xb038('0xf')]===0x1f4){logger[_0xb038('0xe')](_0xb038('0xa'),_0x1b077a,_0x4d85b4[_0xb038('0xe')][_0xb038('0x10')]);return _0x48a4d7(_0x4d85b4[_0xb038('0xe')][_0xb038('0x10')]);}logger[_0xb038('0xe')](_0xb038('0xa'),_0x1b077a,_0x4d85b4[_0xb038('0xe')][_0xb038('0x10')]);return _0x4b4085(_0x4d85b4[_0xb038('0xe')]['message']);}else{logger[_0xb038('0x11')](_0xb038('0xa'),_0x1b077a,_0xb038('0xb'));_0x4b4085(_0x4d85b4[_0xb038('0x12')][_0xb038('0x10')]);}})[_0xb038('0x13')](function(_0x5246c3){logger[_0xb038('0xe')](_0xb038('0xa'),_0x1b077a,_0x5246c3);_0x48a4d7(_0x5246c3);});});}exports[_0xb038('0x14')]=function(_0x3b095a){var _0x4aa892=this;return new Promise(function(_0x49b237,_0x20cea2){return db[_0xb038('0x15')][_0xb038('0x16')](_0x3b095a[_0xb038('0x17')],{'raw':_0x3b095a['options']?_0x3b095a[_0xb038('0x18')][_0xb038('0x19')]===undefined?!![]:![]:!![]})[_0xb038('0x9')](function(_0x33a377){logger[_0xb038('0x11')]('CreateSquareMessage',_0x3b095a);logger[_0xb038('0x1a')](_0xb038('0x14'),_0x3b095a,JSON[_0xb038('0xd')](_0x33a377));_0x49b237(_0x33a377);})[_0xb038('0x13')](function(_0x5f123d){logger[_0xb038('0xe')](_0xb038('0x14'),_0x5f123d['message'],_0x3b095a);_0x20cea2(_0x4aa892[_0xb038('0xe')](0x1f4,_0x5f123d[_0xb038('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 1d3155c..892c7e5 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 _0x9464=['show','/:id/test','15s','test','post','create','update','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./squareOdbc.controller','index','/:id','isAuthenticated'];(function(_0x461886,_0x4fc171){var _0x295e0a=function(_0x451524){while(--_0x451524){_0x461886['push'](_0x461886['shift']());}};_0x295e0a(++_0x4fc171);}(_0x9464,0x10d));var _0x4946=function(_0x45161c,_0x5494fc){_0x45161c=_0x45161c-0x0;var _0x186581=_0x9464[_0x45161c];return _0x186581;};'use strict';var multer=require(_0x4946('0x0'));var util=require(_0x4946('0x1'));var path=require(_0x4946('0x2'));var timeout=require('connect-timeout');var express=require(_0x4946('0x3'));var router=express[_0x4946('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x4946('0x5'));var config=require(_0x4946('0x6'));var controller=require(_0x4946('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x4946('0x8')]);router['get'](_0x4946('0x9'),auth[_0x4946('0xa')](),controller[_0x4946('0xb')]);router['get'](_0x4946('0xc'),auth[_0x4946('0xa')](),timeout(_0x4946('0xd')),controller[_0x4946('0xe')]);router[_0x4946('0xf')]('/',auth[_0x4946('0xa')](),controller[_0x4946('0x10')]);router['put'](_0x4946('0x9'),auth[_0x4946('0xa')](),controller[_0x4946('0x11')]);router['delete'](_0x4946('0x9'),auth[_0x4946('0xa')](),controller[_0x4946('0x12')]);module[_0x4946('0x13')]=router; \ No newline at end of file +var _0x057f=['../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','show','15s','test','put','update','destroy','exports','multer','path','connect-timeout','express'];(function(_0x3a3ab5,_0x4e10e6){var _0x174cd7=function(_0xc5d9d8){while(--_0xc5d9d8){_0x3a3ab5['push'](_0x3a3ab5['shift']());}};_0x174cd7(++_0x4e10e6);}(_0x057f,0x1d7));var _0xf057=function(_0x1e3d8a,_0x63c5bd){_0x1e3d8a=_0x1e3d8a-0x0;var _0x3ce642=_0x057f[_0x1e3d8a];return _0x3ce642;};'use strict';var multer=require(_0xf057('0x0'));var util=require('util');var path=require(_0xf057('0x1'));var timeout=require(_0xf057('0x2'));var express=require(_0xf057('0x3'));var router=express['Router']();var auth=require(_0xf057('0x4'));var interaction=require(_0xf057('0x5'));var config=require(_0xf057('0x6'));var controller=require(_0xf057('0x7'));router[_0xf057('0x8')]('/',auth[_0xf057('0x9')](),controller[_0xf057('0xa')]);router[_0xf057('0x8')](_0xf057('0xb'),auth[_0xf057('0x9')](),controller[_0xf057('0xc')]);router[_0xf057('0x8')]('/:id/test',auth['isAuthenticated'](),timeout(_0xf057('0xd')),controller[_0xf057('0xe')]);router['post']('/',auth[_0xf057('0x9')](),controller['create']);router[_0xf057('0xf')](_0xf057('0xb'),auth[_0xf057('0x9')](),controller[_0xf057('0x10')]);router['delete'](_0xf057('0xb'),auth[_0xf057('0x9')](),controller[_0xf057('0x11')]);module[_0xf057('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 8bd0201..4c5eaea 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 _0xa802=['sequelize','exports','STRING'];(function(_0x1cb18a,_0x33167a){var _0x22442e=function(_0x46c611){while(--_0x46c611){_0x1cb18a['push'](_0x1cb18a['shift']());}};_0x22442e(++_0x33167a);}(_0xa802,0xb1));var _0x2a80=function(_0x48c30c,_0x2f75fa){_0x48c30c=_0x48c30c-0x0;var _0x2bbd83=_0xa802[_0x48c30c];return _0x2bbd83;};'use strict';var Sequelize=require(_0x2a80('0x0'));module[_0x2a80('0x1')]={'name':{'type':Sequelize[_0x2a80('0x2')],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize[_0x2a80('0x2')]},'description':{'type':Sequelize[_0x2a80('0x2')]}}; \ No newline at end of file +var _0x83ae=['exports','name','STRING'];(function(_0xf34d7e,_0x4c4f13){var _0x484b11=function(_0x2873f0){while(--_0x2873f0){_0xf34d7e['push'](_0xf34d7e['shift']());}};_0x484b11(++_0x4c4f13);}(_0x83ae,0xe1));var _0xe83a=function(_0xf51338,_0x57c08d){_0xf51338=_0xf51338-0x0;var _0x3be483=_0x83ae[_0xf51338];return _0x3be483;};'use strict';var Sequelize=require('sequelize');module[_0xe83a('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xe83a('0x1'),'allowNull':![]},'dsn':{'type':Sequelize[_0xe83a('0x2')]},'description':{'type':Sequelize[_0xe83a('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 4bd4d7c..46f3c90 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 _0x1d0f=['options','includeAll','findAll','rows','show','params','filters','catch','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','test','openSync','dsn','closeSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','update','then','ODBC','UserProfileResource','destroy','stack','name','send','index','map','SquareOdbc','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL'];(function(_0x50ea05,_0x97c6a0){var _0x571752=function(_0x384fcd){while(--_0x384fcd){_0x50ea05['push'](_0x50ea05['shift']());}};_0x571752(++_0x97c6a0);}(_0x1d0f,0x1d3));var _0xf1d0=function(_0x2dd769,_0x539226){_0x2dd769=_0x2dd769-0x0;var _0x38d1e2=_0x1d0f[_0x2dd769];return _0x38d1e2;};'use strict';var pdf=require(_0xf1d0('0x0'));var emlformat=require(_0xf1d0('0x1'));var rimraf=require(_0xf1d0('0x2'));var zipdir=require(_0xf1d0('0x3'));var jsonpatch=require(_0xf1d0('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf1d0('0x5'));var Mustache=require(_0xf1d0('0x6'));var util=require(_0xf1d0('0x7'));var path=require(_0xf1d0('0x8'));var sox=require(_0xf1d0('0x9'));var csv=require(_0xf1d0('0xa'));var ejs=require(_0xf1d0('0xb'));var fs=require('fs');var _=require(_0xf1d0('0xc'));var squel=require('squel');var crypto=require(_0xf1d0('0xd'));var jsforce=require(_0xf1d0('0xe'));var deskjs=require(_0xf1d0('0xf'));var toCsv=require('to-csv');var querystring=require(_0xf1d0('0x10'));var Papa=require(_0xf1d0('0x11'));var Redis=require(_0xf1d0('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xf1d0('0x13'));var as=require(_0xf1d0('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf1d0('0x15'))(_0xf1d0('0x16'));var utils=require(_0xf1d0('0x17'));var config=require(_0xf1d0('0x18'));var db=require(_0xf1d0('0x19'))['db'];function respondWithStatusCode(_0x445012,_0x5ed04d){_0x5ed04d=_0x5ed04d||0xcc;return function(_0x211317){if(_0x211317){return _0x445012[_0xf1d0('0x1a')](_0x5ed04d);}return _0x445012[_0xf1d0('0x1b')](_0x5ed04d)[_0xf1d0('0x1c')]();};}function respondWithResult(_0x5194ae,_0x3136ac){_0x3136ac=_0x3136ac||0xc8;return function(_0x25ff25){if(_0x25ff25){return _0x5194ae['status'](_0x3136ac)[_0xf1d0('0x1d')](_0x25ff25);}};}function respondWithFilteredResult(_0x1d016e,_0x460a8b){return function(_0x30d20d){if(_0x30d20d){var _0x4e44ce=_0x30d20d[_0xf1d0('0x1e')],_0x19d728=_0x460a8b[_0xf1d0('0x1f')],_0x230505=_0x460a8b[_0xf1d0('0x1f')]+_0x460a8b[_0xf1d0('0x20')],_0x59fa9c;if(_0x230505>=_0x4e44ce){_0x230505=_0x4e44ce;_0x59fa9c=0xc8;}else{_0x59fa9c=0xce;}_0x1d016e['status'](_0x59fa9c);return _0x1d016e[_0xf1d0('0x21')](_0xf1d0('0x22'),_0x19d728+'-'+_0x230505+'/'+_0x4e44ce)[_0xf1d0('0x1d')](_0x30d20d);}return null;};}function patchUpdates(_0x276953){return function(_0x434e76){try{jsonpatch[_0xf1d0('0x23')](_0x434e76,_0x276953,!![]);}catch(_0x4a6192){return BPromise['reject'](_0x4a6192);}return _0x434e76['save']();};}function saveUpdates(_0x582475,_0x4e2d53){return function(_0x14160d){if(_0x14160d){return _0x14160d[_0xf1d0('0x24')](_0x582475)[_0xf1d0('0x25')](function(_0x16a0f5){return _0x16a0f5;});}return null;};}function removeEntity(_0x22b2d0,_0x18d930){return function(_0x47b649){if(_0x47b649){return _0x47b649['destroy']()[_0xf1d0('0x25')](function(){var _0x44062a=_0x47b649['get']({'plain':!![]});var _0x295e26=_0xf1d0('0x26');return db[_0xf1d0('0x27')][_0xf1d0('0x28')]({'where':{'type':_0x295e26,'resourceId':_0x44062a['id']}})['then'](function(){return _0x47b649;});})['then'](function(){_0x22b2d0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e3346,_0x20d4c2){return function(_0xd367ff){if(!_0xd367ff){_0x1e3346[_0xf1d0('0x1a')](0x194);}return _0xd367ff;};}function handleError(_0x4d9e6c,_0x57e6a4){_0x57e6a4=_0x57e6a4||0x1f4;return function(_0x46f825){logger['error'](_0x46f825[_0xf1d0('0x29')]);if(_0x46f825[_0xf1d0('0x2a')]){delete _0x46f825[_0xf1d0('0x2a')];}_0x4d9e6c[_0xf1d0('0x1b')](_0x57e6a4)[_0xf1d0('0x2b')](_0x46f825);};}exports[_0xf1d0('0x2c')]=function(_0x97a4de,_0x156914){var _0x13143f={},_0x1759a5={},_0x2b3e8f={'count':0x0,'rows':[]};var _0x5f43e8=_[_0xf1d0('0x2d')](db[_0xf1d0('0x2e')][_0xf1d0('0x2f')],function(_0x4c57d8){return{'name':_0x4c57d8[_0xf1d0('0x30')],'type':_0x4c57d8[_0xf1d0('0x31')][_0xf1d0('0x32')]};});_0x1759a5[_0xf1d0('0x33')]=_['map'](_0x5f43e8,_0xf1d0('0x2a'));_0x1759a5['query']=_[_0xf1d0('0x34')](_0x97a4de[_0xf1d0('0x35')]);_0x1759a5['filters']=_[_0xf1d0('0x36')](_0x1759a5[_0xf1d0('0x33')],_0x1759a5[_0xf1d0('0x35')]);_0x13143f[_0xf1d0('0x37')]=_[_0xf1d0('0x36')](_0x1759a5[_0xf1d0('0x33')],qs[_0xf1d0('0x38')](_0x97a4de[_0xf1d0('0x35')][_0xf1d0('0x38')]));_0x13143f[_0xf1d0('0x37')]=_0x13143f[_0xf1d0('0x37')][_0xf1d0('0x39')]?_0x13143f[_0xf1d0('0x37')]:_0x1759a5[_0xf1d0('0x33')];if(!_0x97a4de[_0xf1d0('0x35')][_0xf1d0('0x3a')](_0xf1d0('0x3b'))){_0x13143f[_0xf1d0('0x20')]=qs[_0xf1d0('0x20')](_0x97a4de[_0xf1d0('0x35')][_0xf1d0('0x20')]);_0x13143f['offset']=qs['offset'](_0x97a4de[_0xf1d0('0x35')][_0xf1d0('0x1f')]);}_0x13143f[_0xf1d0('0x3c')]=qs[_0xf1d0('0x3d')](_0x97a4de[_0xf1d0('0x35')][_0xf1d0('0x3d')]);_0x13143f[_0xf1d0('0x3e')]=qs['filters'](_[_0xf1d0('0x3f')](_0x97a4de['query'],_0x1759a5['filters']));if(_0x97a4de[_0xf1d0('0x35')][_0xf1d0('0x40')]){_0x13143f[_0xf1d0('0x3e')]=_[_0xf1d0('0x41')](_0x13143f['where'],{'$or':_[_0xf1d0('0x2d')](_0x5f43e8,function(_0x2fdc89){if(_0x2fdc89[_0xf1d0('0x31')]!==_0xf1d0('0x42')){var _0x54cce7={};_0x54cce7[_0x2fdc89[_0xf1d0('0x2a')]]={'$like':'%'+_0x97a4de[_0xf1d0('0x35')]['filter']+'%'};return _0x54cce7;}})});}_0x13143f=_[_0xf1d0('0x41')]({},_0x13143f,_0x97a4de[_0xf1d0('0x43')]);var _0x50859f={'where':_0x13143f[_0xf1d0('0x3e')]};return db['SquareOdbc'][_0xf1d0('0x1e')](_0x50859f)[_0xf1d0('0x25')](function(_0x14f8e6){_0x2b3e8f['count']=_0x14f8e6;if(_0x97a4de['query'][_0xf1d0('0x44')]){_0x13143f['include']=[{'all':!![]}];}return db[_0xf1d0('0x2e')][_0xf1d0('0x45')](_0x13143f);})[_0xf1d0('0x25')](function(_0x1ec8ab){_0x2b3e8f[_0xf1d0('0x46')]=_0x1ec8ab;return _0x2b3e8f;})[_0xf1d0('0x25')](respondWithFilteredResult(_0x156914,_0x13143f))['catch'](handleError(_0x156914,null));};exports[_0xf1d0('0x47')]=function(_0x1c3c27,_0x4368c8){var _0x236ec0={'raw':!![],'where':{'id':_0x1c3c27[_0xf1d0('0x48')]['id']}},_0x5e8a8b={};_0x5e8a8b[_0xf1d0('0x33')]=_[_0xf1d0('0x34')](db[_0xf1d0('0x2e')]['rawAttributes']);_0x5e8a8b[_0xf1d0('0x35')]=_[_0xf1d0('0x34')](_0x1c3c27[_0xf1d0('0x35')]);_0x5e8a8b[_0xf1d0('0x49')]=_['intersection'](_0x5e8a8b['model'],_0x5e8a8b[_0xf1d0('0x35')]);_0x236ec0[_0xf1d0('0x37')]=_['intersection'](_0x5e8a8b[_0xf1d0('0x33')],qs[_0xf1d0('0x38')](_0x1c3c27['query'][_0xf1d0('0x38')]));_0x236ec0[_0xf1d0('0x37')]=_0x236ec0[_0xf1d0('0x37')]['length']?_0x236ec0[_0xf1d0('0x37')]:_0x5e8a8b[_0xf1d0('0x33')];if(_0x1c3c27[_0xf1d0('0x35')][_0xf1d0('0x44')]){_0x236ec0['include']=[{'all':!![]}];}_0x236ec0=_[_0xf1d0('0x41')]({},_0x236ec0,_0x1c3c27['options']);return db[_0xf1d0('0x2e')]['find'](_0x236ec0)[_0xf1d0('0x25')](handleEntityNotFound(_0x4368c8,null))[_0xf1d0('0x25')](respondWithResult(_0x4368c8,null))[_0xf1d0('0x4a')](handleError(_0x4368c8,null));};exports['create']=function(_0x2c705e,_0x173fa3){return db[_0xf1d0('0x2e')]['create'](_0x2c705e[_0xf1d0('0x4b')],{})[_0xf1d0('0x25')](function(_0x216b17){var _0x33b1c2=_0x2c705e[_0xf1d0('0x4c')][_0xf1d0('0x4d')]({'plain':!![]});if(!_0x33b1c2)throw new Error(_0xf1d0('0x4e'));if(_0x33b1c2[_0xf1d0('0x4f')]===_0xf1d0('0x4c')){var _0x45ea70=_0x216b17[_0xf1d0('0x4d')]({'plain':!![]});var _0x20cf7e=_0xf1d0('0x26');return db[_0xf1d0('0x50')][_0xf1d0('0x51')]({'where':{'name':_0x20cf7e,'userProfileId':_0x33b1c2['userProfileId']},'raw':!![]})[_0xf1d0('0x25')](function(_0x1c1038){if(_0x1c1038&&_0x1c1038['autoAssociation']===0x0){return db['UserProfileResource'][_0xf1d0('0x52')]({'name':_0x45ea70[_0xf1d0('0x2a')],'resourceId':_0x45ea70['id'],'type':_0x1c1038[_0xf1d0('0x2a')],'sectionId':_0x1c1038['id']},{})[_0xf1d0('0x25')](function(){return _0x216b17;});}else{return _0x216b17;}})[_0xf1d0('0x4a')](function(_0x110e9e){logger[_0xf1d0('0x53')](_0xf1d0('0x54'),_0x110e9e);throw _0x110e9e;});}return _0x216b17;})[_0xf1d0('0x25')](respondWithResult(_0x173fa3,0xc9))[_0xf1d0('0x4a')](handleError(_0x173fa3,null));};exports[_0xf1d0('0x24')]=function(_0x5e3452,_0x521201){if(_0x5e3452[_0xf1d0('0x4b')]['id']){delete _0x5e3452[_0xf1d0('0x4b')]['id'];}return db[_0xf1d0('0x2e')]['find']({'where':{'id':_0x5e3452[_0xf1d0('0x48')]['id']}})[_0xf1d0('0x25')](handleEntityNotFound(_0x521201,null))[_0xf1d0('0x25')](saveUpdates(_0x5e3452[_0xf1d0('0x4b')],null))[_0xf1d0('0x25')](respondWithResult(_0x521201,null))[_0xf1d0('0x4a')](handleError(_0x521201,null));};exports['destroy']=function(_0x5efb17,_0x3d8968){return db['SquareOdbc'][_0xf1d0('0x51')]({'where':{'id':_0x5efb17[_0xf1d0('0x48')]['id']}})[_0xf1d0('0x25')](handleEntityNotFound(_0x3d8968,null))[_0xf1d0('0x25')](removeEntity(_0x3d8968,null))[_0xf1d0('0x4a')](handleError(_0x3d8968,null));};exports[_0xf1d0('0x55')]=function(_0x1115e7,_0x433320,_0x13e0d4){var _0x4e0cb9;return db[_0xf1d0('0x2e')]['find']({'where':{'id':_0x1115e7[_0xf1d0('0x48')]['id']},'attributes':['id','dsn']})[_0xf1d0('0x25')](handleEntityNotFound(_0x433320,null))[_0xf1d0('0x25')](function(_0x5848d7){if(_0x5848d7){var _0x53f4d9=require('odbc')();_0x53f4d9[_0xf1d0('0x56')](_0x5848d7[_0xf1d0('0x57')]);_0x53f4d9[_0xf1d0('0x58')]();return _0x5848d7;}})[_0xf1d0('0x25')](respondWithResult(_0x433320,null))[_0xf1d0('0x4a')](handleError(_0x433320,null));}; \ No newline at end of file +var _0x4371=['fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','rawAttributes','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','test','odbc','openSync','dsn','closeSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','get','ODBC','UserProfileResource','error','stack','name','send','index','map','SquareOdbc','fieldName','type','key','model','keys','query','intersection','attributes'];(function(_0x497243,_0x2491f7){var _0x17637a=function(_0x5a1419){while(--_0x5a1419){_0x497243['push'](_0x497243['shift']());}};_0x17637a(++_0x2491f7);}(_0x4371,0x192));var _0x1437=function(_0x559add,_0x153177){_0x559add=_0x559add-0x0;var _0x1892af=_0x4371[_0x559add];return _0x1892af;};'use strict';var pdf=require(_0x1437('0x0'));var emlformat=require(_0x1437('0x1'));var rimraf=require(_0x1437('0x2'));var zipdir=require(_0x1437('0x3'));var jsonpatch=require(_0x1437('0x4'));var rp=require(_0x1437('0x5'));var moment=require(_0x1437('0x6'));var BPromise=require(_0x1437('0x7'));var Mustache=require(_0x1437('0x8'));var util=require(_0x1437('0x9'));var path=require('path');var sox=require(_0x1437('0xa'));var csv=require('to-csv');var ejs=require(_0x1437('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x1437('0xc'));var crypto=require(_0x1437('0xd'));var jsforce=require(_0x1437('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x1437('0xf'));var querystring=require(_0x1437('0x10'));var Papa=require(_0x1437('0x11'));var Redis=require(_0x1437('0x12'));var authService=require(_0x1437('0x13'));var qs=require(_0x1437('0x14'));var as=require(_0x1437('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1437('0x16'))(_0x1437('0x17'));var utils=require(_0x1437('0x18'));var config=require(_0x1437('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x565cd1,_0x3713f5){_0x3713f5=_0x3713f5||0xcc;return function(_0x1fb395){if(_0x1fb395){return _0x565cd1[_0x1437('0x1a')](_0x3713f5);}return _0x565cd1[_0x1437('0x1b')](_0x3713f5)[_0x1437('0x1c')]();};}function respondWithResult(_0x5d79ec,_0x14e9a1){_0x14e9a1=_0x14e9a1||0xc8;return function(_0x9169ef){if(_0x9169ef){return _0x5d79ec[_0x1437('0x1b')](_0x14e9a1)[_0x1437('0x1d')](_0x9169ef);}};}function respondWithFilteredResult(_0x3c2078,_0x54cbd5){return function(_0x1cfcb3){if(_0x1cfcb3){var _0x5e1b8e=_0x1cfcb3[_0x1437('0x1e')],_0x375e92=_0x54cbd5[_0x1437('0x1f')],_0x5c6457=_0x54cbd5['offset']+_0x54cbd5[_0x1437('0x20')],_0x14f12d;if(_0x5c6457>=_0x5e1b8e){_0x5c6457=_0x5e1b8e;_0x14f12d=0xc8;}else{_0x14f12d=0xce;}_0x3c2078[_0x1437('0x1b')](_0x14f12d);return _0x3c2078[_0x1437('0x21')](_0x1437('0x22'),_0x375e92+'-'+_0x5c6457+'/'+_0x5e1b8e)['json'](_0x1cfcb3);}return null;};}function patchUpdates(_0x1a1129){return function(_0x36e8ff){try{jsonpatch['apply'](_0x36e8ff,_0x1a1129,!![]);}catch(_0x317041){return BPromise[_0x1437('0x23')](_0x317041);}return _0x36e8ff[_0x1437('0x24')]();};}function saveUpdates(_0x3d0998,_0x31306c){return function(_0x297548){if(_0x297548){return _0x297548[_0x1437('0x25')](_0x3d0998)[_0x1437('0x26')](function(_0x8b28d3){return _0x8b28d3;});}return null;};}function removeEntity(_0x15820e,_0x8fcbfc){return function(_0x3a6c19){if(_0x3a6c19){return _0x3a6c19[_0x1437('0x27')]()['then'](function(){var _0x3ee2be=_0x3a6c19[_0x1437('0x28')]({'plain':!![]});var _0x282680=_0x1437('0x29');return db[_0x1437('0x2a')][_0x1437('0x27')]({'where':{'type':_0x282680,'resourceId':_0x3ee2be['id']}})[_0x1437('0x26')](function(){return _0x3a6c19;});})[_0x1437('0x26')](function(){_0x15820e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b2e19,_0x3519ce){return function(_0x3cdf79){if(!_0x3cdf79){_0x3b2e19[_0x1437('0x1a')](0x194);}return _0x3cdf79;};}function handleError(_0x2ea11b,_0x5494e3){_0x5494e3=_0x5494e3||0x1f4;return function(_0x566d35){logger[_0x1437('0x2b')](_0x566d35[_0x1437('0x2c')]);if(_0x566d35[_0x1437('0x2d')]){delete _0x566d35['name'];}_0x2ea11b[_0x1437('0x1b')](_0x5494e3)[_0x1437('0x2e')](_0x566d35);};}exports[_0x1437('0x2f')]=function(_0x228c56,_0x557373){var _0x3e33d5={},_0x9a98f7={},_0x12b8ad={'count':0x0,'rows':[]};var _0x1977a4=_[_0x1437('0x30')](db[_0x1437('0x31')]['rawAttributes'],function(_0x100f69){return{'name':_0x100f69[_0x1437('0x32')],'type':_0x100f69[_0x1437('0x33')][_0x1437('0x34')]};});_0x9a98f7[_0x1437('0x35')]=_[_0x1437('0x30')](_0x1977a4,_0x1437('0x2d'));_0x9a98f7['query']=_[_0x1437('0x36')](_0x228c56[_0x1437('0x37')]);_0x9a98f7['filters']=_[_0x1437('0x38')](_0x9a98f7[_0x1437('0x35')],_0x9a98f7[_0x1437('0x37')]);_0x3e33d5[_0x1437('0x39')]=_['intersection'](_0x9a98f7['model'],qs[_0x1437('0x3a')](_0x228c56[_0x1437('0x37')][_0x1437('0x3a')]));_0x3e33d5['attributes']=_0x3e33d5[_0x1437('0x39')][_0x1437('0x3b')]?_0x3e33d5[_0x1437('0x39')]:_0x9a98f7[_0x1437('0x35')];if(!_0x228c56['query'][_0x1437('0x3c')](_0x1437('0x3d'))){_0x3e33d5[_0x1437('0x20')]=qs['limit'](_0x228c56['query'][_0x1437('0x20')]);_0x3e33d5[_0x1437('0x1f')]=qs['offset'](_0x228c56[_0x1437('0x37')][_0x1437('0x1f')]);}_0x3e33d5[_0x1437('0x3e')]=qs['sort'](_0x228c56['query'][_0x1437('0x3f')]);_0x3e33d5[_0x1437('0x40')]=qs[_0x1437('0x41')](_[_0x1437('0x42')](_0x228c56[_0x1437('0x37')],_0x9a98f7[_0x1437('0x41')]));if(_0x228c56[_0x1437('0x37')][_0x1437('0x43')]){_0x3e33d5[_0x1437('0x40')]=_['merge'](_0x3e33d5[_0x1437('0x40')],{'$or':_[_0x1437('0x30')](_0x1977a4,function(_0x251ea4){if(_0x251ea4['type']!==_0x1437('0x44')){var _0x25ba7f={};_0x25ba7f[_0x251ea4[_0x1437('0x2d')]]={'$like':'%'+_0x228c56['query'][_0x1437('0x43')]+'%'};return _0x25ba7f;}})});}_0x3e33d5=_[_0x1437('0x45')]({},_0x3e33d5,_0x228c56[_0x1437('0x46')]);var _0x228fe4={'where':_0x3e33d5['where']};return db[_0x1437('0x31')]['count'](_0x228fe4)[_0x1437('0x26')](function(_0x6ccbf6){_0x12b8ad['count']=_0x6ccbf6;if(_0x228c56[_0x1437('0x37')][_0x1437('0x47')]){_0x3e33d5[_0x1437('0x48')]=[{'all':!![]}];}return db[_0x1437('0x31')]['findAll'](_0x3e33d5);})[_0x1437('0x26')](function(_0x22983a){_0x12b8ad[_0x1437('0x49')]=_0x22983a;return _0x12b8ad;})['then'](respondWithFilteredResult(_0x557373,_0x3e33d5))[_0x1437('0x4a')](handleError(_0x557373,null));};exports[_0x1437('0x4b')]=function(_0x203460,_0x3302c2){var _0x18bd44={'raw':!![],'where':{'id':_0x203460[_0x1437('0x4c')]['id']}},_0xbbba2d={};_0xbbba2d['model']=_['keys'](db[_0x1437('0x31')][_0x1437('0x4d')]);_0xbbba2d[_0x1437('0x37')]=_[_0x1437('0x36')](_0x203460[_0x1437('0x37')]);_0xbbba2d[_0x1437('0x41')]=_['intersection'](_0xbbba2d['model'],_0xbbba2d[_0x1437('0x37')]);_0x18bd44[_0x1437('0x39')]=_['intersection'](_0xbbba2d[_0x1437('0x35')],qs['fields'](_0x203460[_0x1437('0x37')]['fields']));_0x18bd44[_0x1437('0x39')]=_0x18bd44[_0x1437('0x39')][_0x1437('0x3b')]?_0x18bd44[_0x1437('0x39')]:_0xbbba2d[_0x1437('0x35')];if(_0x203460[_0x1437('0x37')][_0x1437('0x47')]){_0x18bd44['include']=[{'all':!![]}];}_0x18bd44=_['merge']({},_0x18bd44,_0x203460[_0x1437('0x46')]);return db[_0x1437('0x31')][_0x1437('0x4e')](_0x18bd44)[_0x1437('0x26')](handleEntityNotFound(_0x3302c2,null))[_0x1437('0x26')](respondWithResult(_0x3302c2,null))[_0x1437('0x4a')](handleError(_0x3302c2,null));};exports[_0x1437('0x4f')]=function(_0x1dae87,_0x38c9fc){return db[_0x1437('0x31')]['create'](_0x1dae87['body'],{})['then'](function(_0x49ced7){var _0x1d8b4b=_0x1dae87[_0x1437('0x50')][_0x1437('0x28')]({'plain':!![]});if(!_0x1d8b4b)throw new Error(_0x1437('0x51'));if(_0x1d8b4b[_0x1437('0x52')]==='user'){var _0x20c03a=_0x49ced7[_0x1437('0x28')]({'plain':!![]});var _0x3f9231=_0x1437('0x29');return db[_0x1437('0x53')][_0x1437('0x4e')]({'where':{'name':_0x3f9231,'userProfileId':_0x1d8b4b['userProfileId']},'raw':!![]})[_0x1437('0x26')](function(_0x36b1c8){if(_0x36b1c8&&_0x36b1c8[_0x1437('0x54')]===0x0){return db[_0x1437('0x2a')][_0x1437('0x4f')]({'name':_0x20c03a[_0x1437('0x2d')],'resourceId':_0x20c03a['id'],'type':_0x36b1c8['name'],'sectionId':_0x36b1c8['id']},{})[_0x1437('0x26')](function(){return _0x49ced7;});}else{return _0x49ced7;}})[_0x1437('0x4a')](function(_0x22730b){logger['error'](_0x1437('0x55'),_0x22730b);throw _0x22730b;});}return _0x49ced7;})['then'](respondWithResult(_0x38c9fc,0xc9))['catch'](handleError(_0x38c9fc,null));};exports['update']=function(_0x2117cf,_0x8a76fe){if(_0x2117cf[_0x1437('0x56')]['id']){delete _0x2117cf[_0x1437('0x56')]['id'];}return db[_0x1437('0x31')][_0x1437('0x4e')]({'where':{'id':_0x2117cf[_0x1437('0x4c')]['id']}})['then'](handleEntityNotFound(_0x8a76fe,null))[_0x1437('0x26')](saveUpdates(_0x2117cf[_0x1437('0x56')],null))['then'](respondWithResult(_0x8a76fe,null))['catch'](handleError(_0x8a76fe,null));};exports[_0x1437('0x27')]=function(_0x15afde,_0x148dce){return db[_0x1437('0x31')]['find']({'where':{'id':_0x15afde[_0x1437('0x4c')]['id']}})['then'](handleEntityNotFound(_0x148dce,null))[_0x1437('0x26')](removeEntity(_0x148dce,null))[_0x1437('0x4a')](handleError(_0x148dce,null));};exports[_0x1437('0x57')]=function(_0x4d26d3,_0x5ee512,_0x272786){var _0x2e6795;return db['SquareOdbc']['find']({'where':{'id':_0x4d26d3['params']['id']},'attributes':['id','dsn']})[_0x1437('0x26')](handleEntityNotFound(_0x5ee512,null))[_0x1437('0x26')](function(_0x332e4d){if(_0x332e4d){var _0x3a7e78=require(_0x1437('0x58'))();_0x3a7e78[_0x1437('0x59')](_0x332e4d[_0x1437('0x5a')]);_0x3a7e78[_0x1437('0x5b')]();return _0x332e4d;}})['then'](respondWithResult(_0x5ee512,null))[_0x1437('0x4a')](handleError(_0x5ee512,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index e4d5ca0..bb64862 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 _0xf4d6=['./squareOdbc.attributes','define','square_odbc','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3d3acb,_0xc9fb78){var _0xf5aff=function(_0x3f697a){while(--_0x3f697a){_0x3d3acb['push'](_0x3d3acb['shift']());}};_0xf5aff(++_0xc9fb78);}(_0xf4d6,0xc6));var _0x6f4d=function(_0x2c4429,_0x318b72){_0x2c4429=_0x2c4429-0x0;var _0x577c9a=_0xf4d6[_0x2c4429];return _0x577c9a;};'use strict';var _=require(_0x6f4d('0x0'));var util=require(_0x6f4d('0x1'));var logger=require(_0x6f4d('0x2'))(_0x6f4d('0x3'));var moment=require(_0x6f4d('0x4'));var BPromise=require(_0x6f4d('0x5'));var rp=require(_0x6f4d('0x6'));var fs=require('fs');var path=require(_0x6f4d('0x7'));var rimraf=require(_0x6f4d('0x8'));var config=require(_0x6f4d('0x9'));var attributes=require(_0x6f4d('0xa'));module['exports']=function(_0x23b041,_0x21de03){return _0x23b041[_0x6f4d('0xb')]('SquareOdbc',attributes,{'tableName':_0x6f4d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x95b3=['../../config/environment','./squareOdbc.attributes','exports','define','SquareOdbc','square_odbc','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x5bfa74,_0x3d35ab){var _0x25007b=function(_0x1e7599){while(--_0x1e7599){_0x5bfa74['push'](_0x5bfa74['shift']());}};_0x25007b(++_0x3d35ab);}(_0x95b3,0x164));var _0x395b=function(_0x42866,_0xcd3764){_0x42866=_0x42866-0x0;var _0x893760=_0x95b3[_0x42866];return _0x893760;};'use strict';var _=require(_0x395b('0x0'));var util=require(_0x395b('0x1'));var logger=require(_0x395b('0x2'))(_0x395b('0x3'));var moment=require(_0x395b('0x4'));var BPromise=require(_0x395b('0x5'));var rp=require(_0x395b('0x6'));var fs=require('fs');var path=require(_0x395b('0x7'));var rimraf=require('rimraf');var config=require(_0x395b('0x8'));var attributes=require(_0x395b('0x9'));module[_0x395b('0xa')]=function(_0x14f911,_0xcad199){return _0x14f911[_0x395b('0xb')](_0x395b('0xc'),attributes,{'tableName':_0x395b('0xd'),'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 473f830..df2dcb0 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 _0x008c=['stringify','ShowSquareOdbc','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','SquareOdbc,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','SquareOdbc,\x20%s,\x20%s','message','catch','find','options','include','map','attributes','model','then'];(function(_0x222c59,_0x40783f){var _0x1b9ee3=function(_0x3d7100){while(--_0x3d7100){_0x222c59['push'](_0x222c59['shift']());}};_0x1b9ee3(++_0x40783f);}(_0x008c,0x188));var _0xc008=function(_0x21774b,_0x4a6d2b){_0x21774b=_0x21774b-0x0;var _0x4675b2=_0x008c[_0x21774b];return _0x4675b2;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var moment=require(_0xc008('0x2'));var BPromise=require(_0xc008('0x3'));var rs=require(_0xc008('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc008('0x5'))['db'];var utils=require(_0xc008('0x6'));var logger=require(_0xc008('0x7'))(_0xc008('0x8'));var config=require(_0xc008('0x9'));var jayson=require(_0xc008('0xa'));var client=jayson[_0xc008('0xb')][_0xc008('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x9c8cb2,_0x4af530,_0x428fa9){return new BPromise(function(_0x5aa09b,_0x30be38){return client['request'](_0x9c8cb2,_0x428fa9)['then'](function(_0x27830d){logger[_0xc008('0xd')]('SquareOdbc,\x20%s,\x20%s',_0x4af530,'request\x20sent');logger['debug'](_0xc008('0xe'),_0x4af530,_0xc008('0xf'),JSON['stringify'](_0x27830d));if(_0x27830d[_0xc008('0x10')]){if(_0x27830d[_0xc008('0x10')][_0xc008('0x11')]===0x1f4){logger[_0xc008('0x10')](_0xc008('0x12'),_0x4af530,_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);return _0x30be38(_0x27830d['error']['message']);}logger[_0xc008('0x10')]('SquareOdbc,\x20%s,\x20%s',_0x4af530,_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);return _0x5aa09b(_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);}else{logger[_0xc008('0xd')]('SquareOdbc,\x20%s,\x20%s',_0x4af530,'request\x20sent');_0x5aa09b(_0x27830d['result'][_0xc008('0x13')]);}})[_0xc008('0x14')](function(_0x3cafe3){logger[_0xc008('0x10')]('SquareOdbc,\x20%s,\x20%s',_0x4af530,_0x3cafe3);_0x30be38(_0x3cafe3);});});}exports['ShowSquareOdbc']=function(_0x540e45){var _0x5c2668=this;return new Promise(function(_0x46042b,_0x462af5){return db['SquareOdbc'][_0xc008('0x15')]({'raw':_0x540e45['options']?_0x540e45['options']['raw']===undefined?!![]:![]:!![],'where':_0x540e45['options']?_0x540e45[_0xc008('0x16')]['where']||null:null,'attributes':_0x540e45['options']?_0x540e45['options']['attributes']||null:null,'include':_0x540e45['options']?_0x540e45[_0xc008('0x16')][_0xc008('0x17')]?_[_0xc008('0x18')](_0x540e45[_0xc008('0x16')][_0xc008('0x17')],function(_0x110128){return{'model':db[_0x110128['model']],'as':_0x110128['as'],'attributes':_0x110128[_0xc008('0x19')],'include':_0x110128['include']?_['map'](_0x110128[_0xc008('0x17')],function(_0x36f358){return{'model':db[_0x36f358[_0xc008('0x1a')]],'as':_0x36f358['as'],'attributes':_0x36f358[_0xc008('0x19')],'include':_0x36f358['include']?_['map'](_0x36f358['include'],function(_0x3f7b07){return{'model':db[_0x3f7b07[_0xc008('0x1a')]],'as':_0x3f7b07['as'],'attributes':_0x3f7b07[_0xc008('0x19')]};}):[]};}):[]};}):[]:[]})[_0xc008('0x1b')](function(_0x5bebd9){logger['info']('ShowSquareOdbc',_0x540e45);logger['debug']('ShowSquareOdbc',_0x540e45,JSON[_0xc008('0x1c')](_0x5bebd9));_0x46042b(_0x5bebd9);})[_0xc008('0x14')](function(_0x25eae4){logger['error'](_0xc008('0x1d'),_0x25eae4[_0xc008('0x13')],_0x540e45);_0x462af5(_0x5c2668[_0xc008('0x10')](0x1f4,_0x25eae4[_0xc008('0x13')]));});});}; \ No newline at end of file +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(_0x57b58b,_0x59b61e){var _0x453a3a=function(_0x7b6f5e){while(--_0x7b6f5e){_0x57b58b['push'](_0x57b58b['shift']());}};_0x453a3a(++_0x59b61e);}(_0xe14b,0x93));var _0xbe14=function(_0x291e28,_0x20d7e0){_0x291e28=_0x291e28-0x0;var _0x1a7722=_0xe14b[_0x291e28];return _0x1a7722;};'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 diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 4786145..2099fcd 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 _0x36ee=['removeUsers','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index','/:id','getUsers','post','create','/:id/users','addUsers','put','update','delete','destroy'];(function(_0x26537d,_0x5a374d){var _0x4feddf=function(_0x3df025){while(--_0x3df025){_0x26537d['push'](_0x26537d['shift']());}};_0x4feddf(++_0x5a374d);}(_0x36ee,0xe8));var _0xe36e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x36ee[_0x1facfa];return _0x9ec701;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe36e('0x0'));var timeout=require('connect-timeout');var express=require(_0xe36e('0x1'));var router=express[_0xe36e('0x2')]();var auth=require(_0xe36e('0x3'));var interaction=require(_0xe36e('0x4'));var config=require(_0xe36e('0x5'));var controller=require(_0xe36e('0x6'));router[_0xe36e('0x7')]('/',auth[_0xe36e('0x8')](),controller[_0xe36e('0x9')]);router[_0xe36e('0x7')](_0xe36e('0xa'),auth[_0xe36e('0x8')](),controller['show']);router[_0xe36e('0x7')]('/:id/users',auth[_0xe36e('0x8')](),controller[_0xe36e('0xb')]);router[_0xe36e('0xc')]('/',auth['isAuthenticated'](),controller[_0xe36e('0xd')]);router['post'](_0xe36e('0xe'),auth[_0xe36e('0x8')](),controller[_0xe36e('0xf')]);router[_0xe36e('0x10')](_0xe36e('0xa'),auth[_0xe36e('0x8')](),controller[_0xe36e('0x11')]);router[_0xe36e('0x12')]('/:id',auth[_0xe36e('0x8')](),controller[_0xe36e('0x13')]);router[_0xe36e('0x12')](_0xe36e('0xe'),auth['isAuthenticated'](),controller[_0xe36e('0x14')]);module['exports']=router; \ No newline at end of file +var _0x1eba=['isAuthenticated','index','/:id','show','/:id/users','getUsers','post','put','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./squareProject.controller','get'];(function(_0x5a2484,_0x1341f9){var _0x3ba9ab=function(_0x393780){while(--_0x393780){_0x5a2484['push'](_0x5a2484['shift']());}};_0x3ba9ab(++_0x1341f9);}(_0x1eba,0x1d7));var _0xa1eb=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x1eba[_0x5783f4];return _0x28e380;};'use strict';var multer=require(_0xa1eb('0x0'));var util=require(_0xa1eb('0x1'));var path=require(_0xa1eb('0x2'));var timeout=require(_0xa1eb('0x3'));var express=require(_0xa1eb('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xa1eb('0x5'));var config=require(_0xa1eb('0x6'));var controller=require(_0xa1eb('0x7'));router[_0xa1eb('0x8')]('/',auth[_0xa1eb('0x9')](),controller[_0xa1eb('0xa')]);router[_0xa1eb('0x8')](_0xa1eb('0xb'),auth[_0xa1eb('0x9')](),controller[_0xa1eb('0xc')]);router[_0xa1eb('0x8')](_0xa1eb('0xd'),auth['isAuthenticated'](),controller[_0xa1eb('0xe')]);router['post']('/',auth[_0xa1eb('0x9')](),controller['create']);router[_0xa1eb('0xf')]('/:id/users',auth[_0xa1eb('0x9')](),controller['addUsers']);router[_0xa1eb('0x10')](_0xa1eb('0xb'),auth[_0xa1eb('0x9')](),controller['update']);router[_0xa1eb('0x11')](_0xa1eb('0xb'),auth['isAuthenticated'](),controller[_0xa1eb('0x12')]);router['delete']('/:id/users',auth[_0xa1eb('0x9')](),controller['removeUsers']);module[_0xa1eb('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 368b9d2..9e02bdb 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 _0x6281=['TEXT','BLOB','long','getDataValue','preproduction','toString','utf8','sequelize','exports','name','STRING'];(function(_0x72db6b,_0x5aec13){var _0x43a957=function(_0x3d2608){while(--_0x3d2608){_0x72db6b['push'](_0x72db6b['shift']());}};_0x43a957(++_0x5aec13);}(_0x6281,0x13b));var _0x1628=function(_0x11824c,_0x2a27b7){_0x11824c=_0x11824c-0x0;var _0x3b9344=_0x6281[_0x11824c];return _0x3b9344;};'use strict';var Sequelize=require(_0x1628('0x0'));module[_0x1628('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x1628('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x1628('0x3')]},'notes':{'type':Sequelize[_0x1628('0x4')]},'preproduction':{'type':Sequelize[_0x1628('0x5')](_0x1628('0x6')),'get':function(){if(this[_0x1628('0x7')]('preproduction')){return this[_0x1628('0x7')](_0x1628('0x8'))[_0x1628('0x9')](_0x1628('0xa'));}}},'production':{'type':Sequelize[_0x1628('0x5')](_0x1628('0x6')),'get':function(){if(this['getDataValue']('production')){return this['getDataValue']('production')[_0x1628('0x9')](_0x1628('0xa'));}}}}; \ No newline at end of file +var _0x748b=['name','BLOB','long','preproduction','getDataValue','toString','utf8','sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x748b,0x115));var _0xb748=function(_0x39a0a2,_0x43345e){_0x39a0a2=_0x39a0a2-0x0;var _0x229b8a=_0x748b[_0x39a0a2];return _0x229b8a;};'use strict';var Sequelize=require(_0xb748('0x0'));module[_0xb748('0x1')]={'name':{'type':Sequelize[_0xb748('0x2')],'unique':_0xb748('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0xb748('0x4')](_0xb748('0x5')),'get':function(){if(this['getDataValue'](_0xb748('0x6'))){return this[_0xb748('0x7')](_0xb748('0x6'))[_0xb748('0x8')](_0xb748('0x9'));}}},'production':{'type':Sequelize['BLOB'](_0xb748('0x5')),'get':function(){if(this['getDataValue']('production')){return this[_0xb748('0x7')]('production')[_0xb748('0x8')](_0xb748('0x9'));}}}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 4e62766..cffc82e 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 _0x9b9b=['to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./squareProject.socket','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','then','destroy','SquareProjects','UserProfileResource','error','stack','name','send','index','map','SquareProject','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','catch','show','params','keys','length','includeAll','find','create','body','user','get','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addUsers','omit','ids','removeUsers','isArray','emit','userSquareProject:remove','getUsers','findOne','User','hasOwnProperty','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x4d191c,_0x171ee1){var _0x2bd7ca=function(_0x3b5af0){while(--_0x3b5af0){_0x4d191c['push'](_0x4d191c['shift']());}};_0x2bd7ca(++_0x171ee1);}(_0x9b9b,0x114));var _0xb9b9=function(_0x43077b,_0x2e8274){_0x43077b=_0x43077b-0x0;var _0x429348=_0x9b9b[_0x43077b];return _0x429348;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xb9b9('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb9b9('0x1'));var rp=require(_0xb9b9('0x2'));var moment=require(_0xb9b9('0x3'));var BPromise=require(_0xb9b9('0x4'));var Mustache=require(_0xb9b9('0x5'));var util=require(_0xb9b9('0x6'));var path=require(_0xb9b9('0x7'));var sox=require(_0xb9b9('0x8'));var csv=require(_0xb9b9('0x9'));var ejs=require(_0xb9b9('0xa'));var fs=require('fs');var _=require(_0xb9b9('0xb'));var squel=require(_0xb9b9('0xc'));var crypto=require(_0xb9b9('0xd'));var jsforce=require(_0xb9b9('0xe'));var deskjs=require(_0xb9b9('0xf'));var toCsv=require(_0xb9b9('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb9b9('0x10'));var authService=require(_0xb9b9('0x11'));var qs=require(_0xb9b9('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb9b9('0x13'));var logger=require(_0xb9b9('0x14'))(_0xb9b9('0x15'));var utils=require('../../config/utils');var config=require(_0xb9b9('0x16'));var db=require(_0xb9b9('0x17'))['db'];config[_0xb9b9('0x18')]=_[_0xb9b9('0x19')](config[_0xb9b9('0x18')],{'host':_0xb9b9('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xb9b9('0x1b'))['register'](socket);function respondWithStatusCode(_0xe78d58,_0x50e5d6){_0x50e5d6=_0x50e5d6||0xcc;return function(_0x2ba838){if(_0x2ba838){return _0xe78d58[_0xb9b9('0x1c')](_0x50e5d6);}return _0xe78d58[_0xb9b9('0x1d')](_0x50e5d6)[_0xb9b9('0x1e')]();};}function respondWithResult(_0x177ad9,_0x3fd09c){_0x3fd09c=_0x3fd09c||0xc8;return function(_0x42a55f){if(_0x42a55f){return _0x177ad9[_0xb9b9('0x1d')](_0x3fd09c)['json'](_0x42a55f);}};}function respondWithFilteredResult(_0x29689a,_0x48d9ae){return function(_0x403a5b){if(_0x403a5b){var _0x3e6d23=_0x403a5b[_0xb9b9('0x1f')],_0x3a2fed=_0x48d9ae[_0xb9b9('0x20')],_0x11bb05=_0x48d9ae[_0xb9b9('0x20')]+_0x48d9ae[_0xb9b9('0x21')],_0x49b412;if(_0x11bb05>=_0x3e6d23){_0x11bb05=_0x3e6d23;_0x49b412=0xc8;}else{_0x49b412=0xce;}_0x29689a[_0xb9b9('0x1d')](_0x49b412);return _0x29689a[_0xb9b9('0x22')](_0xb9b9('0x23'),_0x3a2fed+'-'+_0x11bb05+'/'+_0x3e6d23)[_0xb9b9('0x24')](_0x403a5b);}return null;};}function patchUpdates(_0xb16391){return function(_0x47d3e3){try{jsonpatch[_0xb9b9('0x25')](_0x47d3e3,_0xb16391,!![]);}catch(_0x1246b9){return BPromise[_0xb9b9('0x26')](_0x1246b9);}return _0x47d3e3['save']();};}function saveUpdates(_0x10b7e1,_0xe1e1d7){return function(_0x1cb58a){if(_0x1cb58a){return _0x1cb58a['update'](_0x10b7e1)[_0xb9b9('0x27')](function(_0x46525d){return _0x46525d;});}return null;};}function removeEntity(_0x5efa01,_0x18e2ca){return function(_0x20e260){if(_0x20e260){return _0x20e260[_0xb9b9('0x28')]()[_0xb9b9('0x27')](function(){var _0x660f18=_0x20e260['get']({'plain':!![]});var _0x4dfa3f=_0xb9b9('0x29');return db[_0xb9b9('0x2a')]['destroy']({'where':{'type':_0x4dfa3f,'resourceId':_0x660f18['id']}})[_0xb9b9('0x27')](function(){return _0x20e260;});})[_0xb9b9('0x27')](function(){_0x5efa01[_0xb9b9('0x1d')](0xcc)[_0xb9b9('0x1e')]();});}};}function handleEntityNotFound(_0x125f6c,_0x54bf18){return function(_0x388042){if(!_0x388042){_0x125f6c['sendStatus'](0x194);}return _0x388042;};}function handleError(_0x1e0c5e,_0xe28f3c){_0xe28f3c=_0xe28f3c||0x1f4;return function(_0x4f47da){logger[_0xb9b9('0x2b')](_0x4f47da[_0xb9b9('0x2c')]);if(_0x4f47da[_0xb9b9('0x2d')]){delete _0x4f47da['name'];}_0x1e0c5e[_0xb9b9('0x1d')](_0xe28f3c)[_0xb9b9('0x2e')](_0x4f47da);};}exports[_0xb9b9('0x2f')]=function(_0x300453,_0x4f002a){var _0xc40dda={},_0xdbc1f1={},_0x49757e={'count':0x0,'rows':[]};var _0x42b31f=_[_0xb9b9('0x30')](db[_0xb9b9('0x31')][_0xb9b9('0x32')],function(_0x5a7f6d){return{'name':_0x5a7f6d[_0xb9b9('0x33')],'type':_0x5a7f6d[_0xb9b9('0x34')][_0xb9b9('0x35')]};});_0xdbc1f1[_0xb9b9('0x36')]=_['map'](_0x42b31f,_0xb9b9('0x2d'));_0xdbc1f1[_0xb9b9('0x37')]=_['keys'](_0x300453[_0xb9b9('0x37')]);_0xdbc1f1[_0xb9b9('0x38')]=_[_0xb9b9('0x39')](_0xdbc1f1[_0xb9b9('0x36')],_0xdbc1f1[_0xb9b9('0x37')]);_0xc40dda[_0xb9b9('0x3a')]=_['intersection'](_0xdbc1f1[_0xb9b9('0x36')],qs[_0xb9b9('0x3b')](_0x300453['query'][_0xb9b9('0x3b')]));_0xc40dda[_0xb9b9('0x3a')]=_0xc40dda[_0xb9b9('0x3a')]['length']?_0xc40dda[_0xb9b9('0x3a')]:_0xdbc1f1['model'];if(!_0x300453[_0xb9b9('0x37')]['hasOwnProperty'](_0xb9b9('0x3c'))){_0xc40dda[_0xb9b9('0x21')]=qs[_0xb9b9('0x21')](_0x300453[_0xb9b9('0x37')][_0xb9b9('0x21')]);_0xc40dda[_0xb9b9('0x20')]=qs[_0xb9b9('0x20')](_0x300453['query']['offset']);}_0xc40dda[_0xb9b9('0x3d')]=qs[_0xb9b9('0x3e')](_0x300453[_0xb9b9('0x37')]['sort']);_0xc40dda[_0xb9b9('0x3f')]=qs['filters'](_[_0xb9b9('0x40')](_0x300453[_0xb9b9('0x37')],_0xdbc1f1[_0xb9b9('0x38')]));if(_0x300453[_0xb9b9('0x37')][_0xb9b9('0x41')]){_0xc40dda[_0xb9b9('0x3f')]=_[_0xb9b9('0x42')](_0xc40dda[_0xb9b9('0x3f')],{'$or':_[_0xb9b9('0x30')](_0x42b31f,function(_0x40058c){if(_0x40058c['type']!==_0xb9b9('0x43')){var _0x2fd1bc={};_0x2fd1bc[_0x40058c[_0xb9b9('0x2d')]]={'$like':'%'+_0x300453[_0xb9b9('0x37')][_0xb9b9('0x41')]+'%'};return _0x2fd1bc;}})});}_0xc40dda=_[_0xb9b9('0x42')]({},_0xc40dda,_0x300453[_0xb9b9('0x44')]);var _0x1f61b9={'where':_0xc40dda[_0xb9b9('0x3f')]};return db[_0xb9b9('0x31')]['count'](_0x1f61b9)[_0xb9b9('0x27')](function(_0x221ded){_0x49757e[_0xb9b9('0x1f')]=_0x221ded;if(_0x300453[_0xb9b9('0x37')]['includeAll']){_0xc40dda[_0xb9b9('0x45')]=[{'all':!![]}];}return db['SquareProject']['findAll'](_0xc40dda);})[_0xb9b9('0x27')](function(_0x2641ec){_0x49757e['rows']=_0x2641ec;return _0x49757e;})['then'](respondWithFilteredResult(_0x4f002a,_0xc40dda))[_0xb9b9('0x46')](handleError(_0x4f002a,null));};exports[_0xb9b9('0x47')]=function(_0x375543,_0x3f4388){var _0x493786={'raw':![],'where':{'id':_0x375543[_0xb9b9('0x48')]['id']}},_0x114782={};_0x114782[_0xb9b9('0x36')]=_['keys'](db['SquareProject'][_0xb9b9('0x32')]);_0x114782['query']=_[_0xb9b9('0x49')](_0x375543[_0xb9b9('0x37')]);_0x114782[_0xb9b9('0x38')]=_[_0xb9b9('0x39')](_0x114782['model'],_0x114782[_0xb9b9('0x37')]);_0x493786[_0xb9b9('0x3a')]=_[_0xb9b9('0x39')](_0x114782[_0xb9b9('0x36')],qs[_0xb9b9('0x3b')](_0x375543[_0xb9b9('0x37')][_0xb9b9('0x3b')]));_0x493786[_0xb9b9('0x3a')]=_0x493786[_0xb9b9('0x3a')][_0xb9b9('0x4a')]?_0x493786[_0xb9b9('0x3a')]:_0x114782[_0xb9b9('0x36')];if(_0x375543['query'][_0xb9b9('0x4b')]){_0x493786['include']=[{'all':!![]}];}_0x493786=_[_0xb9b9('0x42')]({},_0x493786,_0x375543[_0xb9b9('0x44')]);return db[_0xb9b9('0x31')][_0xb9b9('0x4c')](_0x493786)['then'](handleEntityNotFound(_0x3f4388,null))[_0xb9b9('0x27')](respondWithResult(_0x3f4388,null))['catch'](handleError(_0x3f4388,null));};exports[_0xb9b9('0x4d')]=function(_0x576c06,_0x41dfa0){return db[_0xb9b9('0x31')][_0xb9b9('0x4d')](_0x576c06[_0xb9b9('0x4e')],{})[_0xb9b9('0x27')](function(_0x1a406c){var _0x1c2f19=_0x576c06[_0xb9b9('0x4f')][_0xb9b9('0x50')]({'plain':!![]});if(!_0x1c2f19)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1c2f19['role']==='user'){var _0x124b54=_0x1a406c['get']({'plain':!![]});var _0x2089bd=_0xb9b9('0x29');return db[_0xb9b9('0x51')][_0xb9b9('0x4c')]({'where':{'name':_0x2089bd,'userProfileId':_0x1c2f19['userProfileId']},'raw':!![]})[_0xb9b9('0x27')](function(_0x1f4e9a){if(_0x1f4e9a&&_0x1f4e9a['autoAssociation']===0x0){return db[_0xb9b9('0x2a')][_0xb9b9('0x4d')]({'name':_0x124b54['name'],'resourceId':_0x124b54['id'],'type':_0x1f4e9a['name'],'sectionId':_0x1f4e9a['id']},{})[_0xb9b9('0x27')](function(){return _0x1a406c;});}else{return _0x1a406c;}})[_0xb9b9('0x46')](function(_0xc50f00){logger['error'](_0xb9b9('0x52'),_0xc50f00);throw _0xc50f00;});}return _0x1a406c;})[_0xb9b9('0x27')](respondWithResult(_0x41dfa0,0xc9))['catch'](handleError(_0x41dfa0,null));};exports[_0xb9b9('0x53')]=function(_0xb0b883,_0x2d052d){if(_0xb0b883[_0xb9b9('0x4e')]['id']){delete _0xb0b883['body']['id'];}return db[_0xb9b9('0x31')][_0xb9b9('0x4c')]({'where':{'id':_0xb0b883[_0xb9b9('0x48')]['id']}})['then'](handleEntityNotFound(_0x2d052d,null))[_0xb9b9('0x27')](saveUpdates(_0xb0b883[_0xb9b9('0x4e')],null))[_0xb9b9('0x27')](respondWithResult(_0x2d052d,null))[_0xb9b9('0x46')](handleError(_0x2d052d,null));};exports[_0xb9b9('0x28')]=function(_0x49956d,_0x5b6016){return db[_0xb9b9('0x31')][_0xb9b9('0x4c')]({'where':{'id':_0x49956d[_0xb9b9('0x48')]['id']}})[_0xb9b9('0x27')](handleEntityNotFound(_0x5b6016,null))[_0xb9b9('0x27')](removeEntity(_0x5b6016,null))['catch'](handleError(_0x5b6016,null));};exports[_0xb9b9('0x54')]=function(_0x30e19e,_0x184f9b,_0x340c73){return db[_0xb9b9('0x31')]['find']({'where':{'id':_0x30e19e[_0xb9b9('0x48')]['id']}})[_0xb9b9('0x27')](handleEntityNotFound(_0x184f9b,null))[_0xb9b9('0x27')](function(_0x1e38f5){if(_0x1e38f5){return _0x1e38f5['addUsers'](_0x30e19e[_0xb9b9('0x4e')]['ids'],_[_0xb9b9('0x55')](_0x30e19e[_0xb9b9('0x4e')],[_0xb9b9('0x56'),'id'])||{});}})[_0xb9b9('0x27')](respondWithResult(_0x184f9b,null))[_0xb9b9('0x46')](handleError(_0x184f9b,null));};exports[_0xb9b9('0x57')]=function(_0x1f19b2,_0x24ae48,_0x30e795){return db[_0xb9b9('0x31')]['find']({'where':{'id':_0x1f19b2[_0xb9b9('0x48')]['id']}})[_0xb9b9('0x27')](handleEntityNotFound(_0x24ae48,null))[_0xb9b9('0x27')](function(_0x578383){if(_0x578383){return _0x578383[_0xb9b9('0x57')](_0x1f19b2[_0xb9b9('0x37')][_0xb9b9('0x56')])[_0xb9b9('0x27')](function(){if(_[_0xb9b9('0x58')](_0x1f19b2[_0xb9b9('0x37')]['ids'])){for(var _0x45bbc4=0x0;_0x45bbc4<_0x1f19b2[_0xb9b9('0x37')][_0xb9b9('0x56')][_0xb9b9('0x4a')];_0x45bbc4+=0x1){socket[_0xb9b9('0x59')](_0xb9b9('0x5a'),{'UserId':Number(_0x1f19b2[_0xb9b9('0x37')][_0xb9b9('0x56')][_0x45bbc4]),'SquareProjectId':Number(_0x1f19b2['params']['id'])});}}else{socket[_0xb9b9('0x59')](_0xb9b9('0x5a'),{'UserId':Number(_0x1f19b2[_0xb9b9('0x37')]['ids']),'SquareProjectId':Number(_0x1f19b2[_0xb9b9('0x48')]['id'])});}});}})[_0xb9b9('0x27')](respondWithStatusCode(_0x24ae48,null))['catch'](handleError(_0x24ae48,null));};exports[_0xb9b9('0x5b')]=function(_0x35c05b,_0x34d7e0,_0x2b7aa9){var _0x3e9eb2={};var _0x4715d3={};var _0x59fc75;var _0x2be3c7;return db[_0xb9b9('0x31')][_0xb9b9('0x5c')]({'where':{'id':_0x35c05b[_0xb9b9('0x48')]['id']}})[_0xb9b9('0x27')](handleEntityNotFound(_0x34d7e0,null))['then'](function(_0x4a7536){if(_0x4a7536){_0x59fc75=_0x4a7536;_0x4715d3[_0xb9b9('0x36')]=_[_0xb9b9('0x49')](db[_0xb9b9('0x5d')]['rawAttributes']);_0x4715d3[_0xb9b9('0x37')]=_['keys'](_0x35c05b[_0xb9b9('0x37')]);_0x4715d3[_0xb9b9('0x38')]=_[_0xb9b9('0x39')](_0x4715d3[_0xb9b9('0x36')],_0x4715d3[_0xb9b9('0x37')]);_0x3e9eb2[_0xb9b9('0x3a')]=_[_0xb9b9('0x39')](_0x4715d3['model'],qs['fields'](_0x35c05b['query']['fields']));_0x3e9eb2['attributes']=_0x3e9eb2[_0xb9b9('0x3a')][_0xb9b9('0x4a')]?_0x3e9eb2[_0xb9b9('0x3a')]:_0x4715d3[_0xb9b9('0x36')];_0x3e9eb2[_0xb9b9('0x3d')]=qs[_0xb9b9('0x3e')](_0x35c05b[_0xb9b9('0x37')]['sort']);_0x3e9eb2[_0xb9b9('0x3f')]=qs[_0xb9b9('0x38')](_[_0xb9b9('0x40')](_0x35c05b[_0xb9b9('0x37')],_0x4715d3['filters']));if(_0x35c05b['query'][_0xb9b9('0x41')]){_0x3e9eb2[_0xb9b9('0x3f')]=_[_0xb9b9('0x42')](_0x3e9eb2[_0xb9b9('0x3f')],{'$or':_[_0xb9b9('0x30')](_0x3e9eb2['attributes'],function(_0x4f6eda){var _0x23955b={};_0x23955b[_0x4f6eda]={'$like':'%'+_0x35c05b[_0xb9b9('0x37')][_0xb9b9('0x41')]+'%'};return _0x23955b;})});}_0x3e9eb2=_[_0xb9b9('0x42')]({},_0x3e9eb2,_0x35c05b[_0xb9b9('0x44')]);return _0x59fc75['getUsers'](_0x3e9eb2);}})[_0xb9b9('0x27')](function(_0x68330e){if(_0x68330e){_0x2be3c7=_0x68330e[_0xb9b9('0x4a')];if(!_0x35c05b[_0xb9b9('0x37')][_0xb9b9('0x5e')]('nolimit')){_0x3e9eb2['limit']=qs[_0xb9b9('0x21')](_0x35c05b[_0xb9b9('0x37')][_0xb9b9('0x21')]);_0x3e9eb2[_0xb9b9('0x20')]=qs['offset'](_0x35c05b[_0xb9b9('0x37')][_0xb9b9('0x20')]);}return _0x59fc75[_0xb9b9('0x5b')](_0x3e9eb2);}})[_0xb9b9('0x27')](function(_0x59e789){if(_0x59e789){return _0x59e789?{'count':_0x2be3c7,'rows':_0x59e789}:null;}})[_0xb9b9('0x27')](respondWithResult(_0x34d7e0,null))[_0xb9b9('0x46')](handleError(_0x34d7e0,null));}; \ No newline at end of file +var _0xd2ea=['end','json','count','offset','Content-Range','apply','reject','save','update','then','destroy','get','SquareProjects','UserProfileResource','error','stack','name','send','index','map','SquareProject','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','filters','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','addUsers','ids','removeUsers','emit','userSquareProject:remove','getUsers','findOne','User','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','defaults','localhost','sendStatus','status'];(function(_0x2770b0,_0x16394d){var _0x2b0c8f=function(_0x23ac16){while(--_0x23ac16){_0x2770b0['push'](_0x2770b0['shift']());}};_0x2b0c8f(++_0x16394d);}(_0xd2ea,0x15f));var _0xad2e=function(_0x490f49,_0x5147b2){_0x490f49=_0x490f49-0x0;var _0x4c064a=_0xd2ea[_0x490f49];return _0x4c064a;};'use strict';var pdf=require(_0xad2e('0x0'));var emlformat=require(_0xad2e('0x1'));var rimraf=require(_0xad2e('0x2'));var zipdir=require(_0xad2e('0x3'));var jsonpatch=require(_0xad2e('0x4'));var rp=require('request-promise');var moment=require(_0xad2e('0x5'));var BPromise=require(_0xad2e('0x6'));var Mustache=require(_0xad2e('0x7'));var util=require(_0xad2e('0x8'));var path=require(_0xad2e('0x9'));var sox=require(_0xad2e('0xa'));var csv=require(_0xad2e('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xad2e('0xc'));var squel=require(_0xad2e('0xd'));var crypto=require(_0xad2e('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xad2e('0xf'));var toCsv=require(_0xad2e('0xb'));var querystring=require('querystring');var Papa=require(_0xad2e('0x10'));var Redis=require('ioredis');var authService=require(_0xad2e('0x11'));var qs=require(_0xad2e('0x12'));var as=require(_0xad2e('0x13'));var hardwareService=require(_0xad2e('0x14'));var logger=require('../../config/logger')(_0xad2e('0x15'));var utils=require('../../config/utils');var config=require(_0xad2e('0x16'));var db=require(_0xad2e('0x17'))['db'];config[_0xad2e('0x18')]=_[_0xad2e('0x19')](config['redis'],{'host':_0xad2e('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xad2e('0x18')]));require('./squareProject.socket')['register'](socket);function respondWithStatusCode(_0x4a812b,_0x5c96a7){_0x5c96a7=_0x5c96a7||0xcc;return function(_0xae17ab){if(_0xae17ab){return _0x4a812b[_0xad2e('0x1b')](_0x5c96a7);}return _0x4a812b[_0xad2e('0x1c')](_0x5c96a7)[_0xad2e('0x1d')]();};}function respondWithResult(_0x17e6ac,_0x4180aa){_0x4180aa=_0x4180aa||0xc8;return function(_0x2546e2){if(_0x2546e2){return _0x17e6ac[_0xad2e('0x1c')](_0x4180aa)[_0xad2e('0x1e')](_0x2546e2);}};}function respondWithFilteredResult(_0xbc6df0,_0x2af208){return function(_0x39c5e4){if(_0x39c5e4){var _0x34f946=_0x39c5e4[_0xad2e('0x1f')],_0x1b4889=_0x2af208[_0xad2e('0x20')],_0x163e83=_0x2af208['offset']+_0x2af208['limit'],_0x4ef16f;if(_0x163e83>=_0x34f946){_0x163e83=_0x34f946;_0x4ef16f=0xc8;}else{_0x4ef16f=0xce;}_0xbc6df0['status'](_0x4ef16f);return _0xbc6df0['set'](_0xad2e('0x21'),_0x1b4889+'-'+_0x163e83+'/'+_0x34f946)[_0xad2e('0x1e')](_0x39c5e4);}return null;};}function patchUpdates(_0x5549db){return function(_0x208991){try{jsonpatch[_0xad2e('0x22')](_0x208991,_0x5549db,!![]);}catch(_0x41109a){return BPromise[_0xad2e('0x23')](_0x41109a);}return _0x208991[_0xad2e('0x24')]();};}function saveUpdates(_0x102169,_0x154d54){return function(_0x40e1e4){if(_0x40e1e4){return _0x40e1e4[_0xad2e('0x25')](_0x102169)[_0xad2e('0x26')](function(_0x20e664){return _0x20e664;});}return null;};}function removeEntity(_0x207517,_0x2e1c95){return function(_0x59630b){if(_0x59630b){return _0x59630b[_0xad2e('0x27')]()[_0xad2e('0x26')](function(){var _0x22e237=_0x59630b[_0xad2e('0x28')]({'plain':!![]});var _0x2f9370=_0xad2e('0x29');return db[_0xad2e('0x2a')][_0xad2e('0x27')]({'where':{'type':_0x2f9370,'resourceId':_0x22e237['id']}})[_0xad2e('0x26')](function(){return _0x59630b;});})['then'](function(){_0x207517[_0xad2e('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b2bc2,_0x28ef72){return function(_0x22bc9b){if(!_0x22bc9b){_0x2b2bc2[_0xad2e('0x1b')](0x194);}return _0x22bc9b;};}function handleError(_0x5aec9d,_0x1676e5){_0x1676e5=_0x1676e5||0x1f4;return function(_0xb3171a){logger[_0xad2e('0x2b')](_0xb3171a[_0xad2e('0x2c')]);if(_0xb3171a[_0xad2e('0x2d')]){delete _0xb3171a['name'];}_0x5aec9d[_0xad2e('0x1c')](_0x1676e5)[_0xad2e('0x2e')](_0xb3171a);};}exports[_0xad2e('0x2f')]=function(_0x4379f4,_0x42fe6c){var _0x9b4a23={},_0x409f58={},_0x3e3d86={'count':0x0,'rows':[]};var _0x2d5e55=_[_0xad2e('0x30')](db[_0xad2e('0x31')]['rawAttributes'],function(_0x3099fd){return{'name':_0x3099fd['fieldName'],'type':_0x3099fd[_0xad2e('0x32')][_0xad2e('0x33')]};});_0x409f58[_0xad2e('0x34')]=_[_0xad2e('0x30')](_0x2d5e55,_0xad2e('0x2d'));_0x409f58['query']=_[_0xad2e('0x35')](_0x4379f4[_0xad2e('0x36')]);_0x409f58['filters']=_[_0xad2e('0x37')](_0x409f58[_0xad2e('0x34')],_0x409f58['query']);_0x9b4a23[_0xad2e('0x38')]=_[_0xad2e('0x37')](_0x409f58[_0xad2e('0x34')],qs[_0xad2e('0x39')](_0x4379f4[_0xad2e('0x36')][_0xad2e('0x39')]));_0x9b4a23[_0xad2e('0x38')]=_0x9b4a23['attributes'][_0xad2e('0x3a')]?_0x9b4a23[_0xad2e('0x38')]:_0x409f58['model'];if(!_0x4379f4[_0xad2e('0x36')][_0xad2e('0x3b')](_0xad2e('0x3c'))){_0x9b4a23[_0xad2e('0x3d')]=qs[_0xad2e('0x3d')](_0x4379f4[_0xad2e('0x36')]['limit']);_0x9b4a23['offset']=qs[_0xad2e('0x20')](_0x4379f4['query'][_0xad2e('0x20')]);}_0x9b4a23[_0xad2e('0x3e')]=qs[_0xad2e('0x3f')](_0x4379f4[_0xad2e('0x36')][_0xad2e('0x3f')]);_0x9b4a23['where']=qs[_0xad2e('0x40')](_[_0xad2e('0x41')](_0x4379f4['query'],_0x409f58['filters']));if(_0x4379f4['query'][_0xad2e('0x42')]){_0x9b4a23['where']=_['merge'](_0x9b4a23[_0xad2e('0x43')],{'$or':_[_0xad2e('0x30')](_0x2d5e55,function(_0x271a49){if(_0x271a49[_0xad2e('0x32')]!==_0xad2e('0x44')){var _0x2aa6ff={};_0x2aa6ff[_0x271a49[_0xad2e('0x2d')]]={'$like':'%'+_0x4379f4['query'][_0xad2e('0x42')]+'%'};return _0x2aa6ff;}})});}_0x9b4a23=_[_0xad2e('0x45')]({},_0x9b4a23,_0x4379f4[_0xad2e('0x46')]);var _0x10cc9e={'where':_0x9b4a23[_0xad2e('0x43')]};return db['SquareProject'][_0xad2e('0x1f')](_0x10cc9e)['then'](function(_0x2c1bd9){_0x3e3d86[_0xad2e('0x1f')]=_0x2c1bd9;if(_0x4379f4[_0xad2e('0x36')][_0xad2e('0x47')]){_0x9b4a23[_0xad2e('0x48')]=[{'all':!![]}];}return db[_0xad2e('0x31')][_0xad2e('0x49')](_0x9b4a23);})[_0xad2e('0x26')](function(_0x1d69d1){_0x3e3d86[_0xad2e('0x4a')]=_0x1d69d1;return _0x3e3d86;})[_0xad2e('0x26')](respondWithFilteredResult(_0x42fe6c,_0x9b4a23))[_0xad2e('0x4b')](handleError(_0x42fe6c,null));};exports[_0xad2e('0x4c')]=function(_0x1b78f9,_0xf7b911){var _0x2ad9a0={'raw':![],'where':{'id':_0x1b78f9[_0xad2e('0x4d')]['id']}},_0x922e18={};_0x922e18[_0xad2e('0x34')]=_[_0xad2e('0x35')](db['SquareProject'][_0xad2e('0x4e')]);_0x922e18[_0xad2e('0x36')]=_[_0xad2e('0x35')](_0x1b78f9[_0xad2e('0x36')]);_0x922e18[_0xad2e('0x40')]=_[_0xad2e('0x37')](_0x922e18[_0xad2e('0x34')],_0x922e18['query']);_0x2ad9a0[_0xad2e('0x38')]=_['intersection'](_0x922e18[_0xad2e('0x34')],qs[_0xad2e('0x39')](_0x1b78f9[_0xad2e('0x36')][_0xad2e('0x39')]));_0x2ad9a0[_0xad2e('0x38')]=_0x2ad9a0['attributes'][_0xad2e('0x3a')]?_0x2ad9a0[_0xad2e('0x38')]:_0x922e18[_0xad2e('0x34')];if(_0x1b78f9[_0xad2e('0x36')][_0xad2e('0x47')]){_0x2ad9a0['include']=[{'all':!![]}];}_0x2ad9a0=_[_0xad2e('0x45')]({},_0x2ad9a0,_0x1b78f9[_0xad2e('0x46')]);return db[_0xad2e('0x31')][_0xad2e('0x4f')](_0x2ad9a0)['then'](handleEntityNotFound(_0xf7b911,null))['then'](respondWithResult(_0xf7b911,null))[_0xad2e('0x4b')](handleError(_0xf7b911,null));};exports[_0xad2e('0x50')]=function(_0x4d2c66,_0x4ec64c){return db[_0xad2e('0x31')]['create'](_0x4d2c66[_0xad2e('0x51')],{})[_0xad2e('0x26')](function(_0x5196bf){var _0x2f4799=_0x4d2c66[_0xad2e('0x52')][_0xad2e('0x28')]({'plain':!![]});if(!_0x2f4799)throw new Error(_0xad2e('0x53'));if(_0x2f4799['role']==='user'){var _0x42d999=_0x5196bf[_0xad2e('0x28')]({'plain':!![]});var _0x36f730=_0xad2e('0x29');return db[_0xad2e('0x54')][_0xad2e('0x4f')]({'where':{'name':_0x36f730,'userProfileId':_0x2f4799[_0xad2e('0x55')]},'raw':!![]})[_0xad2e('0x26')](function(_0x52e4bc){if(_0x52e4bc&&_0x52e4bc[_0xad2e('0x56')]===0x0){return db['UserProfileResource'][_0xad2e('0x50')]({'name':_0x42d999[_0xad2e('0x2d')],'resourceId':_0x42d999['id'],'type':_0x52e4bc[_0xad2e('0x2d')],'sectionId':_0x52e4bc['id']},{})[_0xad2e('0x26')](function(){return _0x5196bf;});}else{return _0x5196bf;}})[_0xad2e('0x4b')](function(_0x38406d){logger[_0xad2e('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x38406d);throw _0x38406d;});}return _0x5196bf;})[_0xad2e('0x26')](respondWithResult(_0x4ec64c,0xc9))['catch'](handleError(_0x4ec64c,null));};exports[_0xad2e('0x25')]=function(_0x4222a7,_0xbc21e4){if(_0x4222a7[_0xad2e('0x51')]['id']){delete _0x4222a7['body']['id'];}return db[_0xad2e('0x31')][_0xad2e('0x4f')]({'where':{'id':_0x4222a7['params']['id']}})[_0xad2e('0x26')](handleEntityNotFound(_0xbc21e4,null))['then'](saveUpdates(_0x4222a7[_0xad2e('0x51')],null))[_0xad2e('0x26')](respondWithResult(_0xbc21e4,null))[_0xad2e('0x4b')](handleError(_0xbc21e4,null));};exports[_0xad2e('0x27')]=function(_0x243d14,_0x261ad8){return db[_0xad2e('0x31')][_0xad2e('0x4f')]({'where':{'id':_0x243d14[_0xad2e('0x4d')]['id']}})['then'](handleEntityNotFound(_0x261ad8,null))[_0xad2e('0x26')](removeEntity(_0x261ad8,null))[_0xad2e('0x4b')](handleError(_0x261ad8,null));};exports[_0xad2e('0x57')]=function(_0x243add,_0x519971,_0x5c7318){return db[_0xad2e('0x31')][_0xad2e('0x4f')]({'where':{'id':_0x243add[_0xad2e('0x4d')]['id']}})[_0xad2e('0x26')](handleEntityNotFound(_0x519971,null))[_0xad2e('0x26')](function(_0x77387e){if(_0x77387e){return _0x77387e['addUsers'](_0x243add[_0xad2e('0x51')][_0xad2e('0x58')],_['omit'](_0x243add[_0xad2e('0x51')],[_0xad2e('0x58'),'id'])||{});}})[_0xad2e('0x26')](respondWithResult(_0x519971,null))[_0xad2e('0x4b')](handleError(_0x519971,null));};exports[_0xad2e('0x59')]=function(_0x270c8d,_0x1ce266,_0x9a0783){return db[_0xad2e('0x31')][_0xad2e('0x4f')]({'where':{'id':_0x270c8d['params']['id']}})['then'](handleEntityNotFound(_0x1ce266,null))[_0xad2e('0x26')](function(_0x523070){if(_0x523070){return _0x523070['removeUsers'](_0x270c8d[_0xad2e('0x36')][_0xad2e('0x58')])[_0xad2e('0x26')](function(){if(_['isArray'](_0x270c8d[_0xad2e('0x36')][_0xad2e('0x58')])){for(var _0x455e39=0x0;_0x455e39<_0x270c8d[_0xad2e('0x36')][_0xad2e('0x58')]['length'];_0x455e39+=0x1){socket[_0xad2e('0x5a')]('userSquareProject:remove',{'UserId':Number(_0x270c8d['query']['ids'][_0x455e39]),'SquareProjectId':Number(_0x270c8d['params']['id'])});}}else{socket[_0xad2e('0x5a')](_0xad2e('0x5b'),{'UserId':Number(_0x270c8d[_0xad2e('0x36')][_0xad2e('0x58')]),'SquareProjectId':Number(_0x270c8d[_0xad2e('0x4d')]['id'])});}});}})[_0xad2e('0x26')](respondWithStatusCode(_0x1ce266,null))[_0xad2e('0x4b')](handleError(_0x1ce266,null));};exports[_0xad2e('0x5c')]=function(_0x1a7d47,_0x68e0d4,_0x4fbc78){var _0x55eef1={};var _0x415bb2={};var _0x24bddb;var _0x5832c9;return db['SquareProject'][_0xad2e('0x5d')]({'where':{'id':_0x1a7d47['params']['id']}})[_0xad2e('0x26')](handleEntityNotFound(_0x68e0d4,null))[_0xad2e('0x26')](function(_0x3bdd1f){if(_0x3bdd1f){_0x24bddb=_0x3bdd1f;_0x415bb2[_0xad2e('0x34')]=_[_0xad2e('0x35')](db[_0xad2e('0x5e')][_0xad2e('0x4e')]);_0x415bb2[_0xad2e('0x36')]=_['keys'](_0x1a7d47[_0xad2e('0x36')]);_0x415bb2['filters']=_['intersection'](_0x415bb2[_0xad2e('0x34')],_0x415bb2[_0xad2e('0x36')]);_0x55eef1['attributes']=_[_0xad2e('0x37')](_0x415bb2[_0xad2e('0x34')],qs[_0xad2e('0x39')](_0x1a7d47['query'][_0xad2e('0x39')]));_0x55eef1['attributes']=_0x55eef1[_0xad2e('0x38')]['length']?_0x55eef1[_0xad2e('0x38')]:_0x415bb2[_0xad2e('0x34')];_0x55eef1[_0xad2e('0x3e')]=qs[_0xad2e('0x3f')](_0x1a7d47[_0xad2e('0x36')][_0xad2e('0x3f')]);_0x55eef1['where']=qs['filters'](_[_0xad2e('0x41')](_0x1a7d47[_0xad2e('0x36')],_0x415bb2[_0xad2e('0x40')]));if(_0x1a7d47[_0xad2e('0x36')]['filter']){_0x55eef1[_0xad2e('0x43')]=_[_0xad2e('0x45')](_0x55eef1[_0xad2e('0x43')],{'$or':_[_0xad2e('0x30')](_0x55eef1[_0xad2e('0x38')],function(_0x377b0b){var _0x24871e={};_0x24871e[_0x377b0b]={'$like':'%'+_0x1a7d47[_0xad2e('0x36')][_0xad2e('0x42')]+'%'};return _0x24871e;})});}_0x55eef1=_['merge']({},_0x55eef1,_0x1a7d47[_0xad2e('0x46')]);return _0x24bddb[_0xad2e('0x5c')](_0x55eef1);}})[_0xad2e('0x26')](function(_0x5168c3){if(_0x5168c3){_0x5832c9=_0x5168c3[_0xad2e('0x3a')];if(!_0x1a7d47[_0xad2e('0x36')][_0xad2e('0x3b')](_0xad2e('0x3c'))){_0x55eef1[_0xad2e('0x3d')]=qs[_0xad2e('0x3d')](_0x1a7d47['query']['limit']);_0x55eef1['offset']=qs['offset'](_0x1a7d47[_0xad2e('0x36')][_0xad2e('0x20')]);}return _0x24bddb['getUsers'](_0x55eef1);}})[_0xad2e('0x26')](function(_0x3fa812){if(_0x3fa812){return _0x3fa812?{'count':_0x5832c9,'rows':_0x3fa812}:null;}})[_0xad2e('0x26')](respondWithResult(_0x68e0d4,null))[_0xad2e('0x4b')](handleError(_0x68e0d4,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 1c18d51..657a136 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 _0xefe7=['events','SquareProject','setMaxListeners','remove','emit','hasOwnProperty','hook','exports'];(function(_0x1e5357,_0x104159){var _0x4f11e6=function(_0x32dfca){while(--_0x32dfca){_0x1e5357['push'](_0x1e5357['shift']());}};_0x4f11e6(++_0x104159);}(_0xefe7,0x168));var _0x7efe=function(_0x155d40,_0x591fd0){_0x155d40=_0x155d40-0x0;var _0x1b9b51=_0xefe7[_0x155d40];return _0x1b9b51;};'use strict';var EventEmitter=require(_0x7efe('0x0'));var SquareProject=require('../../mysqldb')['db'][_0x7efe('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x7efe('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x7efe('0x3')};function emitEvent(_0x15dd18){return function(_0x5044d0,_0x1e380e,_0x50e8a2){SquareProjectEvents['emit'](_0x15dd18+':'+_0x5044d0['id'],_0x5044d0);SquareProjectEvents[_0x7efe('0x4')](_0x15dd18,_0x5044d0);_0x50e8a2(null);};}for(var e in events){if(events[_0x7efe('0x5')](e)){var event=events[e];SquareProject[_0x7efe('0x6')](e,emitEvent(event));}}module[_0x7efe('0x7')]=SquareProjectEvents; \ No newline at end of file +var _0x0748=['hook','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x2b78d0,_0x598cd3){var _0x6db161=function(_0x36a02f){while(--_0x36a02f){_0x2b78d0['push'](_0x2b78d0['shift']());}};_0x6db161(++_0x598cd3);}(_0x0748,0xc7));var _0x8074=function(_0x3da832,_0x2133f1){_0x3da832=_0x3da832-0x0;var _0xe602f2=_0x0748[_0x3da832];return _0xe602f2;};'use strict';var EventEmitter=require(_0x8074('0x0'));var SquareProject=require(_0x8074('0x1'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x8074('0x2')](0x0);var events={'afterCreate':_0x8074('0x3'),'afterUpdate':_0x8074('0x4'),'afterDestroy':_0x8074('0x5')};function emitEvent(_0x3abe61){return function(_0x578ab2,_0xc8705a,_0xf139bd){SquareProjectEvents[_0x8074('0x6')](_0x3abe61+':'+_0x578ab2['id'],_0x578ab2);SquareProjectEvents['emit'](_0x3abe61,_0x578ab2);_0xf139bd(null);};}for(var e in events){if(events[_0x8074('0x7')](e)){var event=events[e];SquareProject[_0x8074('0x8')](e,emitEvent(event));}}module['exports']=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 71b85db..84d081f 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 _0x0fbe=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','square_projects'];(function(_0x26c7a8,_0x44c210){var _0x3fd89d=function(_0x2a63cd){while(--_0x2a63cd){_0x26c7a8['push'](_0x26c7a8['shift']());}};_0x3fd89d(++_0x44c210);}(_0x0fbe,0xfc));var _0xe0fb=function(_0x9c4cf9,_0x2af64e){_0x9c4cf9=_0x9c4cf9-0x0;var _0x553f99=_0x0fbe[_0x9c4cf9];return _0x553f99;};'use strict';var _=require(_0xe0fb('0x0'));var util=require(_0xe0fb('0x1'));var logger=require(_0xe0fb('0x2'))(_0xe0fb('0x3'));var moment=require(_0xe0fb('0x4'));var BPromise=require('bluebird');var rp=require(_0xe0fb('0x5'));var fs=require('fs');var path=require(_0xe0fb('0x6'));var rimraf=require(_0xe0fb('0x7'));var config=require(_0xe0fb('0x8'));var attributes=require('./squareProject.attributes');module[_0xe0fb('0x9')]=function(_0x378834,_0x5e3bac){return _0x378834[_0xe0fb('0xa')]('SquareProject',attributes,{'tableName':_0xe0fb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9633=['./squareProject.attributes','exports','define','SquareProject','square_projects','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x50647a,_0x29193e){var _0x16a906=function(_0xb89c25){while(--_0xb89c25){_0x50647a['push'](_0x50647a['shift']());}};_0x16a906(++_0x29193e);}(_0x9633,0x1e5));var _0x3963=function(_0x53e77a,_0x5ca29b){_0x53e77a=_0x53e77a-0x0;var _0x31a501=_0x9633[_0x53e77a];return _0x31a501;};'use strict';var _=require(_0x3963('0x0'));var util=require(_0x3963('0x1'));var logger=require(_0x3963('0x2'))(_0x3963('0x3'));var moment=require(_0x3963('0x4'));var BPromise=require(_0x3963('0x5'));var rp=require(_0x3963('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3963('0x7'));module[_0x3963('0x8')]=function(_0x1a83b0,_0x390278){return _0x1a83b0[_0x3963('0x9')](_0x3963('0xa'),attributes,{'tableName':_0x3963('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 4021c87..02624b8 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 _0x724a=['options','where','attributes','include','model','map','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','localhost','socket.io-emitter','redis','./squareProject.socket','register','request','then','info','SquareProject,\x20%s,\x20%s','debug','SquareProject,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowSquareProject','SquareProject','find'];(function(_0x58be4b,_0x29217c){var _0x4621c0=function(_0x3759bd){while(--_0x3759bd){_0x58be4b['push'](_0x58be4b['shift']());}};_0x4621c0(++_0x29217c);}(_0x724a,0x103));var _0xa724=function(_0x22490e,_0x4935bd){_0x22490e=_0x22490e-0x0;var _0x5b6459=_0x724a[_0x22490e];return _0x5b6459;};'use strict';var _=require('lodash');var util=require(_0xa724('0x0'));var moment=require(_0xa724('0x1'));var BPromise=require(_0xa724('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa724('0x3'));var db=require(_0xa724('0x4'))['db'];var utils=require(_0xa724('0x5'));var logger=require(_0xa724('0x6'))('rpc');var config=require(_0xa724('0x7'));var jayson=require(_0xa724('0x8'));var client=jayson[_0xa724('0x9')]['http']({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xa724('0xa'),'port':0x18eb});var socket=require(_0xa724('0xb'))(new Redis(config[_0xa724('0xc')]));require(_0xa724('0xd'))[_0xa724('0xe')](socket);function respondWithRpcPromise(_0x110c10,_0x24562f,_0x2518b7){return new BPromise(function(_0x4cde43,_0x43b2fb){return client[_0xa724('0xf')](_0x110c10,_0x2518b7)[_0xa724('0x10')](function(_0x26bbb0){logger[_0xa724('0x11')](_0xa724('0x12'),_0x24562f,'request\x20sent');logger[_0xa724('0x13')](_0xa724('0x14'),_0x24562f,_0xa724('0x15'),JSON[_0xa724('0x16')](_0x26bbb0));if(_0x26bbb0['error']){if(_0x26bbb0[_0xa724('0x17')]['code']===0x1f4){logger['error'](_0xa724('0x12'),_0x24562f,_0x26bbb0['error'][_0xa724('0x18')]);return _0x43b2fb(_0x26bbb0[_0xa724('0x17')]['message']);}logger[_0xa724('0x17')](_0xa724('0x12'),_0x24562f,_0x26bbb0['error'][_0xa724('0x18')]);return _0x4cde43(_0x26bbb0[_0xa724('0x17')][_0xa724('0x18')]);}else{logger[_0xa724('0x11')](_0xa724('0x12'),_0x24562f,_0xa724('0x15'));_0x4cde43(_0x26bbb0[_0xa724('0x19')]['message']);}})['catch'](function(_0x675de9){logger[_0xa724('0x17')](_0xa724('0x12'),_0x24562f,_0x675de9);_0x43b2fb(_0x675de9);});});}exports[_0xa724('0x1a')]=function(_0x3644c4){var _0x4ea643=this;return new Promise(function(_0x5b7e57,_0x44f413){return db[_0xa724('0x1b')][_0xa724('0x1c')]({'raw':_0x3644c4[_0xa724('0x1d')]?_0x3644c4[_0xa724('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x3644c4[_0xa724('0x1d')]?_0x3644c4[_0xa724('0x1d')][_0xa724('0x1e')]||null:null,'attributes':_0x3644c4[_0xa724('0x1d')]?_0x3644c4['options'][_0xa724('0x1f')]||null:null,'include':_0x3644c4['options']?_0x3644c4[_0xa724('0x1d')][_0xa724('0x20')]?_['map'](_0x3644c4[_0xa724('0x1d')]['include'],function(_0x3cbfa7){return{'model':db[_0x3cbfa7[_0xa724('0x21')]],'as':_0x3cbfa7['as'],'attributes':_0x3cbfa7['attributes'],'include':_0x3cbfa7[_0xa724('0x20')]?_[_0xa724('0x22')](_0x3cbfa7[_0xa724('0x20')],function(_0x430c86){return{'model':db[_0x430c86[_0xa724('0x21')]],'as':_0x430c86['as'],'attributes':_0x430c86[_0xa724('0x1f')],'include':_0x430c86['include']?_[_0xa724('0x22')](_0x430c86['include'],function(_0x2b365f){return{'model':db[_0x2b365f[_0xa724('0x21')]],'as':_0x2b365f['as'],'attributes':_0x2b365f[_0xa724('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xa724('0x10')](function(_0x58f5cf){logger['info'](_0xa724('0x1a'),_0x3644c4);logger['debug'](_0xa724('0x1a'),_0x3644c4,JSON[_0xa724('0x16')](_0x58f5cf));_0x5b7e57(_0x58f5cf);})[_0xa724('0x23')](function(_0x4fb30f){logger[_0xa724('0x17')](_0xa724('0x1a'),_0x4fb30f[_0xa724('0x18')],_0x3644c4);_0x44f413(_0x4ea643[_0xa724('0x17')](0x1f4,_0x4fb30f[_0xa724('0x18')]));});});}; \ No newline at end of file +var _0x5d4a=['debug','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','socket.io-emitter','./squareProject.socket','request','then','request\x20sent','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareProject,\x20%s,\x20%s','message','info','result','catch','ShowSquareProject','SquareProject','find','options','where','attributes','include','model','map'];(function(_0xe397b4,_0x37f1c0){var _0x384f1e=function(_0x2cc294){while(--_0x2cc294){_0xe397b4['push'](_0xe397b4['shift']());}};_0x384f1e(++_0x37f1c0);}(_0x5d4a,0x14e));var _0xa5d4=function(_0x59ec13,_0x23c5e7){_0x59ec13=_0x59ec13-0x0;var _0x3ab210=_0x5d4a[_0x59ec13];return _0x3ab210;};'use strict';var _=require(_0xa5d4('0x0'));var util=require(_0xa5d4('0x1'));var moment=require(_0xa5d4('0x2'));var BPromise=require(_0xa5d4('0x3'));var rs=require(_0xa5d4('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa5d4('0x5'))['db'];var utils=require(_0xa5d4('0x6'));var logger=require(_0xa5d4('0x7'))(_0xa5d4('0x8'));var config=require(_0xa5d4('0x9'));var jayson=require(_0xa5d4('0xa'));var client=jayson[_0xa5d4('0xb')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0xa5d4('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xa5d4('0xd'))(new Redis(config[_0xa5d4('0xc')]));require(_0xa5d4('0xe'))['register'](socket);function respondWithRpcPromise(_0x4c659b,_0x29e010,_0x2cb7db){return new BPromise(function(_0x5446b5,_0x3df08d){return client[_0xa5d4('0xf')](_0x4c659b,_0x2cb7db)[_0xa5d4('0x10')](function(_0x1af9af){logger['info']('SquareProject,\x20%s,\x20%s',_0x29e010,_0xa5d4('0x11'));logger['debug'](_0xa5d4('0x12'),_0x29e010,_0xa5d4('0x11'),JSON[_0xa5d4('0x13')](_0x1af9af));if(_0x1af9af['error']){if(_0x1af9af[_0xa5d4('0x14')][_0xa5d4('0x15')]===0x1f4){logger['error'](_0xa5d4('0x16'),_0x29e010,_0x1af9af[_0xa5d4('0x14')][_0xa5d4('0x17')]);return _0x3df08d(_0x1af9af[_0xa5d4('0x14')][_0xa5d4('0x17')]);}logger['error']('SquareProject,\x20%s,\x20%s',_0x29e010,_0x1af9af[_0xa5d4('0x14')]['message']);return _0x5446b5(_0x1af9af['error'][_0xa5d4('0x17')]);}else{logger[_0xa5d4('0x18')]('SquareProject,\x20%s,\x20%s',_0x29e010,_0xa5d4('0x11'));_0x5446b5(_0x1af9af[_0xa5d4('0x19')][_0xa5d4('0x17')]);}})[_0xa5d4('0x1a')](function(_0xab2d49){logger[_0xa5d4('0x14')](_0xa5d4('0x16'),_0x29e010,_0xab2d49);_0x3df08d(_0xab2d49);});});}exports[_0xa5d4('0x1b')]=function(_0x37b52e){var _0x23a270=this;return new Promise(function(_0x1acd59,_0x4c8c40){return db[_0xa5d4('0x1c')][_0xa5d4('0x1d')]({'raw':_0x37b52e[_0xa5d4('0x1e')]?_0x37b52e[_0xa5d4('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x37b52e[_0xa5d4('0x1e')]?_0x37b52e[_0xa5d4('0x1e')][_0xa5d4('0x1f')]||null:null,'attributes':_0x37b52e[_0xa5d4('0x1e')]?_0x37b52e[_0xa5d4('0x1e')][_0xa5d4('0x20')]||null:null,'include':_0x37b52e[_0xa5d4('0x1e')]?_0x37b52e[_0xa5d4('0x1e')]['include']?_['map'](_0x37b52e[_0xa5d4('0x1e')][_0xa5d4('0x21')],function(_0x324a5a){return{'model':db[_0x324a5a[_0xa5d4('0x22')]],'as':_0x324a5a['as'],'attributes':_0x324a5a[_0xa5d4('0x20')],'include':_0x324a5a[_0xa5d4('0x21')]?_[_0xa5d4('0x23')](_0x324a5a[_0xa5d4('0x21')],function(_0x11589c){return{'model':db[_0x11589c[_0xa5d4('0x22')]],'as':_0x11589c['as'],'attributes':_0x11589c[_0xa5d4('0x20')],'include':_0x11589c['include']?_[_0xa5d4('0x23')](_0x11589c['include'],function(_0x276b45){return{'model':db[_0x276b45['model']],'as':_0x276b45['as'],'attributes':_0x276b45['attributes']};}):[]};}):[]};}):[]:[]})[_0xa5d4('0x10')](function(_0x5136a2){logger['info'](_0xa5d4('0x1b'),_0x37b52e);logger[_0xa5d4('0x24')](_0xa5d4('0x1b'),_0x37b52e,JSON[_0xa5d4('0x13')](_0x5136a2));_0x1acd59(_0x5136a2);})[_0xa5d4('0x1a')](function(_0x38ba15){logger['error'](_0xa5d4('0x1b'),_0x38ba15['message'],_0x37b52e);_0x4c8c40(_0x23a270[_0xa5d4('0x14')](0x1f4,_0x38ba15[_0xa5d4('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 8b55728..28f009d 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 _0xbd51=['removeListener','register','length','squareProject:','./squareProject.events','remove','update'];(function(_0x528f3a,_0x21338f){var _0x21eb76=function(_0x3a4b6d){while(--_0x3a4b6d){_0x528f3a['push'](_0x528f3a['shift']());}};_0x21eb76(++_0x21338f);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x1e7e25,_0x1c6700){_0x1e7e25=_0x1e7e25-0x0;var _0x4e323b=_0xbd51[_0x1e7e25];return _0x4e323b;};'use strict';var SquareProjectEvents=require(_0x1bd5('0x0'));var events=['save',_0x1bd5('0x1'),_0x1bd5('0x2')];function createListener(_0x3b9f71,_0x1a9dcc){return function(_0x545aac){_0x1a9dcc['emit'](_0x3b9f71,_0x545aac);};}function removeListener(_0x58af16,_0x531028){return function(){SquareProjectEvents[_0x1bd5('0x3')](_0x58af16,_0x531028);};}exports[_0x1bd5('0x4')]=function(_0x43e6b6){for(var _0x59ddfb=0x0,_0x29abea=events[_0x1bd5('0x5')];_0x59ddfb<_0x29abea;_0x59ddfb++){var _0x19077c=events[_0x59ddfb];var _0x27d58f=createListener(_0x1bd5('0x6')+_0x19077c,_0x43e6b6);SquareProjectEvents['on'](_0x19077c,_0x27d58f);}}; \ No newline at end of file +var _0x5496=['squareProject:','./squareProject.events','save','remove','update','removeListener'];(function(_0x5ef3e7,_0x26fca5){var _0x36e335=function(_0x2e845c){while(--_0x2e845c){_0x5ef3e7['push'](_0x5ef3e7['shift']());}};_0x36e335(++_0x26fca5);}(_0x5496,0x175));var _0x6549=function(_0x71c3c9,_0x398ae5){_0x71c3c9=_0x71c3c9-0x0;var _0x546a96=_0x5496[_0x71c3c9];return _0x546a96;};'use strict';var SquareProjectEvents=require(_0x6549('0x0'));var events=[_0x6549('0x1'),_0x6549('0x2'),_0x6549('0x3')];function createListener(_0x465fee,_0x4b616a){return function(_0x21585c){_0x4b616a['emit'](_0x465fee,_0x21585c);};}function removeListener(_0x2d2155,_0x8112c5){return function(){SquareProjectEvents[_0x6549('0x4')](_0x2d2155,_0x8112c5);};}exports['register']=function(_0x5a4658){for(var _0x43cb17=0x0,_0x1d8cea=events['length'];_0x43cb17<_0x1d8cea;_0x43cb17++){var _0x1ca8fc=events[_0x43cb17];var _0x3442c3=createListener(_0x6549('0x5')+_0x1ca8fc,_0x5a4658);SquareProjectEvents['on'](_0x1ca8fc,_0x3442c3);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index f36eb01..1bbce8f 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 _0x0a1d=['../../config/environment','./squareRecording.controller','isAuthenticated','index','get','/:id','show','download','post','create','put','delete','/:id/delete','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x133851,_0x4d6780){var _0x188215=function(_0x1aa541){while(--_0x1aa541){_0x133851['push'](_0x133851['shift']());}};_0x188215(++_0x4d6780);}(_0x0a1d,0xea));var _0xd0a1=function(_0xfa77cc,_0x13b817){_0xfa77cc=_0xfa77cc-0x0;var _0x3a2a42=_0x0a1d[_0xfa77cc];return _0x3a2a42;};'use strict';var multer=require('multer');var util=require(_0xd0a1('0x0'));var path=require(_0xd0a1('0x1'));var timeout=require(_0xd0a1('0x2'));var express=require(_0xd0a1('0x3'));var router=express['Router']();var auth=require(_0xd0a1('0x4'));var interaction=require(_0xd0a1('0x5'));var config=require(_0xd0a1('0x6'));var controller=require(_0xd0a1('0x7'));router['get']('/',auth[_0xd0a1('0x8')](),controller[_0xd0a1('0x9')]);router[_0xd0a1('0xa')](_0xd0a1('0xb'),auth[_0xd0a1('0x8')](),controller[_0xd0a1('0xc')]);router['get']('/:id/download',auth[_0xd0a1('0x8')](),controller[_0xd0a1('0xd')]);router[_0xd0a1('0xe')]('/',auth[_0xd0a1('0x8')](),controller[_0xd0a1('0xf')]);router[_0xd0a1('0x10')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xd0a1('0x11')](_0xd0a1('0x12'),auth[_0xd0a1('0x8')](),controller['destroy']);module[_0xd0a1('0x13')]=router; \ No newline at end of file +var _0xb245=['path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','delete','destroy','exports','multer'];(function(_0x4209af,_0x555e3e){var _0x9bd4f2=function(_0x71ea6e){while(--_0x71ea6e){_0x4209af['push'](_0x4209af['shift']());}};_0x9bd4f2(++_0x555e3e);}(_0xb245,0xd0));var _0x5b24=function(_0x5aa98f,_0x20d37c){_0x5aa98f=_0x5aa98f-0x0;var _0x6028c0=_0xb245[_0x5aa98f];return _0x6028c0;};'use strict';var multer=require(_0x5b24('0x0'));var util=require('util');var path=require(_0x5b24('0x1'));var timeout=require('connect-timeout');var express=require(_0x5b24('0x2'));var router=express['Router']();var auth=require(_0x5b24('0x3'));var interaction=require(_0x5b24('0x4'));var config=require(_0x5b24('0x5'));var controller=require(_0x5b24('0x6'));router[_0x5b24('0x7')]('/',auth[_0x5b24('0x8')](),controller[_0x5b24('0x9')]);router['get'](_0x5b24('0xa'),auth[_0x5b24('0x8')](),controller[_0x5b24('0xb')]);router['get'](_0x5b24('0xc'),auth[_0x5b24('0x8')](),controller[_0x5b24('0xd')]);router[_0x5b24('0xe')]('/',auth[_0x5b24('0x8')](),controller[_0x5b24('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x5b24('0x10')]('/:id/delete',auth[_0x5b24('0x8')](),controller[_0x5b24('0x11')]);module[_0x5b24('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index f3b9b20..719be82 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 _0x7008=['VIRTUAL','getDataValue','savePath','substring','lastIndexOf','sequelize','exports','STRING'];(function(_0x1e05c1,_0x3cffa3){var _0x15f1ca=function(_0x3a9594){while(--_0x3a9594){_0x1e05c1['push'](_0x1e05c1['shift']());}};_0x15f1ca(++_0x3cffa3);}(_0x7008,0x185));var _0x8700=function(_0x209ce6,_0x2cdc20){_0x209ce6=_0x209ce6-0x0;var _0x39d768=_0x7008[_0x209ce6];return _0x39d768;};'use strict';var Sequelize=require(_0x8700('0x0'));module[_0x8700('0x1')]={'uniqueid':{'type':Sequelize[_0x8700('0x2')]},'callerid':{'type':Sequelize[_0x8700('0x2')]},'calleridname':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x8700('0x2')]},'extension':{'type':Sequelize[_0x8700('0x2')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x8700('0x2')]},'dnid':{'type':Sequelize[_0x8700('0x2')]},'projectName':{'type':Sequelize[_0x8700('0x2')]},'saveName':{'type':Sequelize[_0x8700('0x2')]},'filename':{'type':Sequelize[_0x8700('0x2')]},'savePath':{'type':Sequelize[_0x8700('0x2')]},'format':{'type':Sequelize[_0x8700('0x3')],'get':function(){var _0x56a501='';var _0x60252a=this[_0x8700('0x4')](_0x8700('0x5'));if(_0x60252a){_0x56a501=_0x60252a[_0x8700('0x6')](_0x60252a[_0x8700('0x7')]('.'));}return _0x56a501;}}}; \ No newline at end of file +var _0xfa81=['STRING','VIRTUAL','getDataValue','savePath','substring','lastIndexOf','sequelize','exports'];(function(_0x57c9f0,_0x5cb6b7){var _0x22d907=function(_0x87bafc){while(--_0x87bafc){_0x57c9f0['push'](_0x57c9f0['shift']());}};_0x22d907(++_0x5cb6b7);}(_0xfa81,0x1d6));var _0x1fa8=function(_0x28c379,_0x2c569a){_0x28c379=_0x28c379-0x0;var _0xbed0fb=_0xfa81[_0x28c379];return _0xbed0fb;};'use strict';var Sequelize=require(_0x1fa8('0x0'));module[_0x1fa8('0x1')]={'uniqueid':{'type':Sequelize[_0x1fa8('0x2')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x1fa8('0x2')]},'context':{'type':Sequelize[_0x1fa8('0x2')]},'extension':{'type':Sequelize[_0x1fa8('0x2')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x1fa8('0x2')]},'dnid':{'type':Sequelize[_0x1fa8('0x2')]},'projectName':{'type':Sequelize[_0x1fa8('0x2')]},'saveName':{'type':Sequelize[_0x1fa8('0x2')]},'filename':{'type':Sequelize[_0x1fa8('0x2')]},'savePath':{'type':Sequelize[_0x1fa8('0x2')]},'format':{'type':Sequelize[_0x1fa8('0x3')],'get':function(){var _0x382fbd='';var _0x105251=this[_0x1fa8('0x4')](_0x1fa8('0x5'));if(_0x105251){_0x382fbd=_0x105251[_0x1fa8('0x6')](_0x105251[_0x1fa8('0x7')]('.'));}return _0x382fbd;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 0c12925..47645b2 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 _0xd1ae=['to-csv','ejs','squel','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','status','apply','reject','save','update','then','error','stack','name','send','index','map','SquareRecording','fieldName','type','key','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','catch','params','rawAttributes','keys','includeAll','find','body','download','../../components/encryptor','uniqueid','filename','savePath','format','recording','existsSync','Sequelize','ValidationError','SquareRecording\x20not\x20found','extname','unlink','message','Not\x20found','destroy','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','info','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd1ae,0x1b1));var _0xed1a=function(_0x3c0efa,_0x248ecd){_0x3c0efa=_0x3c0efa-0x0;var _0x1d50fd=_0xd1ae[_0x3c0efa];return _0x1d50fd;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xed1a('0x0'));var rimraf=require(_0xed1a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xed1a('0x2'));var rp=require(_0xed1a('0x3'));var moment=require(_0xed1a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xed1a('0x5'));var util=require(_0xed1a('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xed1a('0x7'));var ejs=require(_0xed1a('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xed1a('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xed1a('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xed1a('0xb'));var authService=require(_0xed1a('0xc'));var qs=require(_0xed1a('0xd'));var as=require(_0xed1a('0xe'));var hardwareService=require(_0xed1a('0xf'));var logger=require('../../config/logger')('api');var utils=require(_0xed1a('0x10'));var config=require(_0xed1a('0x11'));var db=require(_0xed1a('0x12'))['db'];function respondWithStatusCode(_0x1c757b,_0x6ed9c9){_0x6ed9c9=_0x6ed9c9||0xcc;return function(_0xed749d){if(_0xed749d){return _0x1c757b[_0xed1a('0x13')](_0x6ed9c9);}return _0x1c757b['status'](_0x6ed9c9)[_0xed1a('0x14')]();};}function respondWithResult(_0x3e8af9,_0x2f94f2){_0x2f94f2=_0x2f94f2||0xc8;return function(_0x40c2de){if(_0x40c2de){return _0x3e8af9['status'](_0x2f94f2)[_0xed1a('0x15')](_0x40c2de);}};}function respondWithFilteredResult(_0x5b74bc,_0x319e7e){return function(_0x558f59){if(_0x558f59){var _0x2a6b28=_0x558f59[_0xed1a('0x16')],_0x2996a4=_0x319e7e[_0xed1a('0x17')],_0x49f6bb=_0x319e7e['offset']+_0x319e7e['limit'],_0x2cc184;if(_0x49f6bb>=_0x2a6b28){_0x49f6bb=_0x2a6b28;_0x2cc184=0xc8;}else{_0x2cc184=0xce;}_0x5b74bc[_0xed1a('0x18')](_0x2cc184);return _0x5b74bc['set']('Content-Range',_0x2996a4+'-'+_0x49f6bb+'/'+_0x2a6b28)[_0xed1a('0x15')](_0x558f59);}return null;};}function patchUpdates(_0x424241){return function(_0x47d135){try{jsonpatch[_0xed1a('0x19')](_0x47d135,_0x424241,!![]);}catch(_0x4ea508){return BPromise[_0xed1a('0x1a')](_0x4ea508);}return _0x47d135[_0xed1a('0x1b')]();};}function saveUpdates(_0x45988b,_0x288f40){return function(_0x5664ca){if(_0x5664ca){return _0x5664ca[_0xed1a('0x1c')](_0x45988b)[_0xed1a('0x1d')](function(_0x426fad){return _0x426fad;});}return null;};}function removeEntity(_0x5d780b,_0x390bf1){return function(_0x2d101b){if(_0x2d101b){return _0x2d101b['destroy']()['then'](function(){_0x5d780b['status'](0xcc)[_0xed1a('0x14')]();});}};}function handleEntityNotFound(_0x7c996,_0x3a7676){return function(_0xdefe9e){if(!_0xdefe9e){_0x7c996[_0xed1a('0x13')](0x194);}return _0xdefe9e;};}function handleError(_0x4a316b,_0x46b3e3){_0x46b3e3=_0x46b3e3||0x1f4;return function(_0x2b3f26){logger[_0xed1a('0x1e')](_0x2b3f26[_0xed1a('0x1f')]);if(_0x2b3f26[_0xed1a('0x20')]){delete _0x2b3f26['name'];}_0x4a316b[_0xed1a('0x18')](_0x46b3e3)[_0xed1a('0x21')](_0x2b3f26);};}exports[_0xed1a('0x22')]=function(_0x56bdd6,_0x1f26c0){var _0x4b1974={},_0x592d81={},_0x19b08b={'count':0x0,'rows':[]};var _0x39cfa9=_[_0xed1a('0x23')](db[_0xed1a('0x24')]['rawAttributes'],function(_0x4a1503){return{'name':_0x4a1503[_0xed1a('0x25')],'type':_0x4a1503[_0xed1a('0x26')][_0xed1a('0x27')]};});_0x592d81[_0xed1a('0x28')]=_[_0xed1a('0x23')](_0x39cfa9,_0xed1a('0x20'));_0x592d81['query']=_['keys'](_0x56bdd6['query']);_0x592d81['filters']=_['intersection'](_0x592d81[_0xed1a('0x28')],_0x592d81[_0xed1a('0x29')]);_0x4b1974[_0xed1a('0x2a')]=_[_0xed1a('0x2b')](_0x592d81['model'],qs['fields'](_0x56bdd6[_0xed1a('0x29')][_0xed1a('0x2c')]));_0x4b1974['attributes']=_0x4b1974[_0xed1a('0x2a')][_0xed1a('0x2d')]?_0x4b1974[_0xed1a('0x2a')]:_0x592d81['model'];if(!_0x56bdd6[_0xed1a('0x29')][_0xed1a('0x2e')](_0xed1a('0x2f'))){_0x4b1974[_0xed1a('0x30')]=qs[_0xed1a('0x30')](_0x56bdd6['query'][_0xed1a('0x30')]);_0x4b1974[_0xed1a('0x17')]=qs['offset'](_0x56bdd6[_0xed1a('0x29')][_0xed1a('0x17')]);}_0x4b1974[_0xed1a('0x31')]=qs[_0xed1a('0x32')](_0x56bdd6[_0xed1a('0x29')][_0xed1a('0x32')]);_0x4b1974[_0xed1a('0x33')]=qs[_0xed1a('0x34')](_[_0xed1a('0x35')](_0x56bdd6[_0xed1a('0x29')],_0x592d81['filters']));if(_0x56bdd6[_0xed1a('0x29')][_0xed1a('0x36')]){_0x4b1974[_0xed1a('0x33')]=_[_0xed1a('0x37')](_0x4b1974[_0xed1a('0x33')],{'$or':_[_0xed1a('0x23')](_0x39cfa9,function(_0x537583){if(_0x537583['type']!==_0xed1a('0x38')){var _0x9df12f={};_0x9df12f[_0x537583[_0xed1a('0x20')]]={'$like':'%'+_0x56bdd6[_0xed1a('0x29')][_0xed1a('0x36')]+'%'};return _0x9df12f;}})});}_0x4b1974=_[_0xed1a('0x37')]({},_0x4b1974,_0x56bdd6[_0xed1a('0x39')]);var _0xaa71ed={'where':_0x4b1974[_0xed1a('0x33')]};return db['SquareRecording'][_0xed1a('0x16')](_0xaa71ed)['then'](function(_0x4f9939){_0x19b08b['count']=_0x4f9939;if(_0x56bdd6[_0xed1a('0x29')]['includeAll']){_0x4b1974[_0xed1a('0x3a')]=[{'all':!![]}];}return db[_0xed1a('0x24')]['findAll'](_0x4b1974);})[_0xed1a('0x1d')](function(_0x1a33a3){_0x19b08b['rows']=_0x1a33a3;return _0x19b08b;})[_0xed1a('0x1d')](respondWithFilteredResult(_0x1f26c0,_0x4b1974))[_0xed1a('0x3b')](handleError(_0x1f26c0,null));};exports['show']=function(_0x38a5f5,_0x5afc5f){var _0x2fb1fe={'raw':!![],'where':{'id':_0x38a5f5[_0xed1a('0x3c')]['id']}},_0x1157ef={};_0x1157ef[_0xed1a('0x28')]=_['keys'](db[_0xed1a('0x24')][_0xed1a('0x3d')]);_0x1157ef['query']=_[_0xed1a('0x3e')](_0x38a5f5['query']);_0x1157ef[_0xed1a('0x34')]=_[_0xed1a('0x2b')](_0x1157ef['model'],_0x1157ef[_0xed1a('0x29')]);_0x2fb1fe[_0xed1a('0x2a')]=_[_0xed1a('0x2b')](_0x1157ef[_0xed1a('0x28')],qs[_0xed1a('0x2c')](_0x38a5f5[_0xed1a('0x29')][_0xed1a('0x2c')]));_0x2fb1fe[_0xed1a('0x2a')]=_0x2fb1fe[_0xed1a('0x2a')][_0xed1a('0x2d')]?_0x2fb1fe[_0xed1a('0x2a')]:_0x1157ef['model'];if(_0x38a5f5[_0xed1a('0x29')][_0xed1a('0x3f')]){_0x2fb1fe[_0xed1a('0x3a')]=[{'all':!![]}];}_0x2fb1fe=_[_0xed1a('0x37')]({},_0x2fb1fe,_0x38a5f5[_0xed1a('0x39')]);return db[_0xed1a('0x24')][_0xed1a('0x40')](_0x2fb1fe)[_0xed1a('0x1d')](handleEntityNotFound(_0x5afc5f,null))[_0xed1a('0x1d')](respondWithResult(_0x5afc5f,null))[_0xed1a('0x3b')](handleError(_0x5afc5f,null));};exports['create']=function(_0x30b8d4,_0x4ac7d4){return db[_0xed1a('0x24')]['create'](_0x30b8d4[_0xed1a('0x41')],{})[_0xed1a('0x1d')](respondWithResult(_0x4ac7d4,0xc9))[_0xed1a('0x3b')](handleError(_0x4ac7d4,null));};exports[_0xed1a('0x1c')]=function(_0x43b67f,_0x98b094){if(_0x43b67f[_0xed1a('0x41')]['id']){delete _0x43b67f[_0xed1a('0x41')]['id'];}return db[_0xed1a('0x24')][_0xed1a('0x40')]({'where':{'id':_0x43b67f['params']['id']}})[_0xed1a('0x1d')](handleEntityNotFound(_0x98b094,null))['then'](saveUpdates(_0x43b67f['body'],null))[_0xed1a('0x1d')](respondWithResult(_0x98b094,null))['catch'](handleError(_0x98b094,null));};exports[_0xed1a('0x42')]=function(_0x291ac0,_0x58717f,_0x5609d3){var _0x36b171=require(_0xed1a('0x43'));var _0x57e7ec=![];var _0x900187={};if(_0x291ac0['query'][_0xed1a('0x26')]&&_0x291ac0[_0xed1a('0x29')][_0xed1a('0x26')]===_0xed1a('0x44')){_0x900187['uniqueid']=_0x291ac0[_0xed1a('0x3c')]['id'];}else{_0x900187['id']=_0x291ac0[_0xed1a('0x3c')]['id'];}return db[_0xed1a('0x24')]['find']({'where':_0x900187,'attributes':['id','savePath',_0xed1a('0x45')],'raw':!![]})[_0xed1a('0x1d')](handleEntityNotFound(_0x58717f,null))[_0xed1a('0x1d')](function(_0x4c951a){if(_0x4c951a){var _0x48b440=_0x4c951a[_0xed1a('0x46')];var _0x13540f=util[_0xed1a('0x47')]('%s.cypher',_0x48b440);if(fs['existsSync'](_0x13540f)){_0x57e7ec=!![];return _0x36b171['decryptFile'](_0x13540f,_0x48b440,config['secrets'][_0xed1a('0x48')])['then'](function(){return _0x4c951a;});}return _0x4c951a;}})[_0xed1a('0x1d')](function(_0x4d95f5){if(_0x4d95f5){var _0x5cd148=_0x4d95f5[_0xed1a('0x46')];if(!fs[_0xed1a('0x49')](_0x5cd148)){throw new db[(_0xed1a('0x4a'))][(_0xed1a('0x4b'))](_0xed1a('0x4c'));}if(_0x4d95f5[_0xed1a('0x45')]){return _0x58717f[_0xed1a('0x42')](_0x5cd148,_0x4d95f5['filename']+path[_0xed1a('0x4d')](_0x5cd148),function(){if(_0x57e7ec){fs[_0xed1a('0x4e')](_0x5cd148);}});}else{return _0x58717f['download'](_0x5cd148,function(_0x3e1e30){if(_0x57e7ec){fs['unlink'](_0x5cd148);}});}}})[_0xed1a('0x3b')](function(_0x5a2c5e){if(_0x5a2c5e[_0xed1a('0x4f')]===_0xed1a('0x4c')){_0x58717f[_0xed1a('0x18')](0x194)['send'](_0xed1a('0x50'));}else{return handleError(_0x58717f,null);}});};exports[_0xed1a('0x51')]=function(_0x2405bb,_0x37951b){return db['SquareRecording'][_0xed1a('0x40')]({'where':{'id':_0x2405bb[_0xed1a('0x3c')]['id']}})[_0xed1a('0x1d')](function(_0x116caa){if(!_0x116caa)throw new ReferenceError('Entity\x20not\x20found');return _0x116caa;})['then'](function(_0x3dd471){var _0x27bd4c=_0x3dd471['savePath'];logger['info'](_0xed1a('0x52'),_0x27bd4c);if(!_[_0xed1a('0x53')](_0x3dd471[_0xed1a('0x46')])&&fs[_0xed1a('0x49')](_0x27bd4c)){logger['info'](_0xed1a('0x54')+_0x27bd4c+_0xed1a('0x55'));fs['unlinkSync'](_0x27bd4c);}_0x27bd4c=_0x27bd4c+_0xed1a('0x56');if(!_[_0xed1a('0x53')](_0x3dd471[_0xed1a('0x46')])&&fs['existsSync'](_0x27bd4c)){logger[_0xed1a('0x57')]('File:\x20\x22'+_0x27bd4c+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x27bd4c);}return _0x3dd471;})[_0xed1a('0x1d')](function(_0x1174c1){if(!_0x1174c1)throw new InternalError();return _0x1174c1[_0xed1a('0x51')]();})[_0xed1a('0x1d')](function(){_0x37951b[_0xed1a('0x18')](0xcc)[_0xed1a('0x14')]();})[_0xed1a('0x3b')](handleError(_0x37951b,null));}; \ No newline at end of file +var _0x2cbe=['html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','status','json','count','offset','limit','set','Content-Range','apply','reject','save','error','stack','name','send','map','SquareRecording','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','merge','options','then','includeAll','findAll','rows','catch','show','params','find','create','update','body','download','../../components/encryptor','uniqueid','savePath','format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','SquareRecording\x20not\x20found','filename','extname','unlink','message','Entity\x20not\x20found','info','isNil','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','File:\x20\x22','end'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2cbe,0x114));var _0xe2cb=function(_0x1998bb,_0x1f1da1){_0x1998bb=_0x1998bb-0x0;var _0x4ae4c9=_0x2cbe[_0x1998bb];return _0x4ae4c9;};'use strict';var pdf=require(_0xe2cb('0x0'));var emlformat=require(_0xe2cb('0x1'));var rimraf=require(_0xe2cb('0x2'));var zipdir=require(_0xe2cb('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe2cb('0x4'));var moment=require(_0xe2cb('0x5'));var BPromise=require(_0xe2cb('0x6'));var Mustache=require('mustache');var util=require(_0xe2cb('0x7'));var path=require(_0xe2cb('0x8'));var sox=require(_0xe2cb('0x9'));var csv=require(_0xe2cb('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xe2cb('0xb'));var squel=require(_0xe2cb('0xc'));var crypto=require(_0xe2cb('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xe2cb('0xe'));var toCsv=require(_0xe2cb('0xa'));var querystring=require('querystring');var Papa=require(_0xe2cb('0xf'));var Redis=require(_0xe2cb('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xe2cb('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe2cb('0x12'));var logger=require(_0xe2cb('0x13'))(_0xe2cb('0x14'));var utils=require(_0xe2cb('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5d6820,_0x421280){_0x421280=_0x421280||0xcc;return function(_0x1bd7aa){if(_0x1bd7aa){return _0x5d6820['sendStatus'](_0x421280);}return _0x5d6820[_0xe2cb('0x16')](_0x421280)['end']();};}function respondWithResult(_0x13553e,_0x41b23f){_0x41b23f=_0x41b23f||0xc8;return function(_0x91b49){if(_0x91b49){return _0x13553e[_0xe2cb('0x16')](_0x41b23f)[_0xe2cb('0x17')](_0x91b49);}};}function respondWithFilteredResult(_0x24219a,_0x1386eb){return function(_0x8527ca){if(_0x8527ca){var _0xda3845=_0x8527ca[_0xe2cb('0x18')],_0x21bb9c=_0x1386eb[_0xe2cb('0x19')],_0x28be11=_0x1386eb[_0xe2cb('0x19')]+_0x1386eb[_0xe2cb('0x1a')],_0x1ef3f7;if(_0x28be11>=_0xda3845){_0x28be11=_0xda3845;_0x1ef3f7=0xc8;}else{_0x1ef3f7=0xce;}_0x24219a[_0xe2cb('0x16')](_0x1ef3f7);return _0x24219a[_0xe2cb('0x1b')](_0xe2cb('0x1c'),_0x21bb9c+'-'+_0x28be11+'/'+_0xda3845)['json'](_0x8527ca);}return null;};}function patchUpdates(_0x23fdea){return function(_0x41868b){try{jsonpatch[_0xe2cb('0x1d')](_0x41868b,_0x23fdea,!![]);}catch(_0x2a119c){return BPromise[_0xe2cb('0x1e')](_0x2a119c);}return _0x41868b[_0xe2cb('0x1f')]();};}function saveUpdates(_0x59f317,_0x3da77f){return function(_0x3ea770){if(_0x3ea770){return _0x3ea770['update'](_0x59f317)['then'](function(_0x9cffea){return _0x9cffea;});}return null;};}function removeEntity(_0x508136,_0x5d93a4){return function(_0x1915bf){if(_0x1915bf){return _0x1915bf['destroy']()['then'](function(){_0x508136['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xd939cc,_0x4c37ce){return function(_0x481fb7){if(!_0x481fb7){_0xd939cc['sendStatus'](0x194);}return _0x481fb7;};}function handleError(_0x9d6385,_0x7d815d){_0x7d815d=_0x7d815d||0x1f4;return function(_0x4f6a36){logger[_0xe2cb('0x20')](_0x4f6a36[_0xe2cb('0x21')]);if(_0x4f6a36[_0xe2cb('0x22')]){delete _0x4f6a36[_0xe2cb('0x22')];}_0x9d6385[_0xe2cb('0x16')](_0x7d815d)[_0xe2cb('0x23')](_0x4f6a36);};}exports['index']=function(_0x34ba92,_0x23e129){var _0x420311={},_0x3a5faf={},_0xefdef8={'count':0x0,'rows':[]};var _0x50cee2=_[_0xe2cb('0x24')](db[_0xe2cb('0x25')][_0xe2cb('0x26')],function(_0x2a105b){return{'name':_0x2a105b[_0xe2cb('0x27')],'type':_0x2a105b[_0xe2cb('0x28')][_0xe2cb('0x29')]};});_0x3a5faf['model']=_[_0xe2cb('0x24')](_0x50cee2,_0xe2cb('0x22'));_0x3a5faf[_0xe2cb('0x2a')]=_[_0xe2cb('0x2b')](_0x34ba92['query']);_0x3a5faf[_0xe2cb('0x2c')]=_[_0xe2cb('0x2d')](_0x3a5faf[_0xe2cb('0x2e')],_0x3a5faf[_0xe2cb('0x2a')]);_0x420311[_0xe2cb('0x2f')]=_['intersection'](_0x3a5faf[_0xe2cb('0x2e')],qs[_0xe2cb('0x30')](_0x34ba92['query'][_0xe2cb('0x30')]));_0x420311[_0xe2cb('0x2f')]=_0x420311[_0xe2cb('0x2f')]['length']?_0x420311[_0xe2cb('0x2f')]:_0x3a5faf[_0xe2cb('0x2e')];if(!_0x34ba92[_0xe2cb('0x2a')][_0xe2cb('0x31')](_0xe2cb('0x32'))){_0x420311[_0xe2cb('0x1a')]=qs[_0xe2cb('0x1a')](_0x34ba92[_0xe2cb('0x2a')][_0xe2cb('0x1a')]);_0x420311[_0xe2cb('0x19')]=qs[_0xe2cb('0x19')](_0x34ba92[_0xe2cb('0x2a')][_0xe2cb('0x19')]);}_0x420311[_0xe2cb('0x33')]=qs[_0xe2cb('0x34')](_0x34ba92['query'][_0xe2cb('0x34')]);_0x420311[_0xe2cb('0x35')]=qs[_0xe2cb('0x2c')](_[_0xe2cb('0x36')](_0x34ba92[_0xe2cb('0x2a')],_0x3a5faf[_0xe2cb('0x2c')]));if(_0x34ba92[_0xe2cb('0x2a')]['filter']){_0x420311[_0xe2cb('0x35')]=_['merge'](_0x420311[_0xe2cb('0x35')],{'$or':_[_0xe2cb('0x24')](_0x50cee2,function(_0x32bd52){if(_0x32bd52[_0xe2cb('0x28')]!==_0xe2cb('0x37')){var _0x25804e={};_0x25804e[_0x32bd52[_0xe2cb('0x22')]]={'$like':'%'+_0x34ba92[_0xe2cb('0x2a')]['filter']+'%'};return _0x25804e;}})});}_0x420311=_[_0xe2cb('0x38')]({},_0x420311,_0x34ba92[_0xe2cb('0x39')]);var _0x4dce0d={'where':_0x420311['where']};return db[_0xe2cb('0x25')][_0xe2cb('0x18')](_0x4dce0d)[_0xe2cb('0x3a')](function(_0x4a2b12){_0xefdef8[_0xe2cb('0x18')]=_0x4a2b12;if(_0x34ba92[_0xe2cb('0x2a')][_0xe2cb('0x3b')]){_0x420311['include']=[{'all':!![]}];}return db['SquareRecording'][_0xe2cb('0x3c')](_0x420311);})['then'](function(_0x3e77db){_0xefdef8[_0xe2cb('0x3d')]=_0x3e77db;return _0xefdef8;})[_0xe2cb('0x3a')](respondWithFilteredResult(_0x23e129,_0x420311))[_0xe2cb('0x3e')](handleError(_0x23e129,null));};exports[_0xe2cb('0x3f')]=function(_0x22d683,_0x443b3a){var _0x27d804={'raw':!![],'where':{'id':_0x22d683[_0xe2cb('0x40')]['id']}},_0x340ba9={};_0x340ba9['model']=_[_0xe2cb('0x2b')](db[_0xe2cb('0x25')][_0xe2cb('0x26')]);_0x340ba9[_0xe2cb('0x2a')]=_['keys'](_0x22d683[_0xe2cb('0x2a')]);_0x340ba9[_0xe2cb('0x2c')]=_[_0xe2cb('0x2d')](_0x340ba9['model'],_0x340ba9[_0xe2cb('0x2a')]);_0x27d804[_0xe2cb('0x2f')]=_[_0xe2cb('0x2d')](_0x340ba9[_0xe2cb('0x2e')],qs[_0xe2cb('0x30')](_0x22d683[_0xe2cb('0x2a')][_0xe2cb('0x30')]));_0x27d804['attributes']=_0x27d804['attributes']['length']?_0x27d804[_0xe2cb('0x2f')]:_0x340ba9[_0xe2cb('0x2e')];if(_0x22d683[_0xe2cb('0x2a')][_0xe2cb('0x3b')]){_0x27d804['include']=[{'all':!![]}];}_0x27d804=_[_0xe2cb('0x38')]({},_0x27d804,_0x22d683['options']);return db[_0xe2cb('0x25')][_0xe2cb('0x41')](_0x27d804)['then'](handleEntityNotFound(_0x443b3a,null))[_0xe2cb('0x3a')](respondWithResult(_0x443b3a,null))['catch'](handleError(_0x443b3a,null));};exports['create']=function(_0x182988,_0x9d4f7){return db[_0xe2cb('0x25')][_0xe2cb('0x42')](_0x182988['body'],{})[_0xe2cb('0x3a')](respondWithResult(_0x9d4f7,0xc9))[_0xe2cb('0x3e')](handleError(_0x9d4f7,null));};exports[_0xe2cb('0x43')]=function(_0x46c230,_0x9d0868){if(_0x46c230[_0xe2cb('0x44')]['id']){delete _0x46c230[_0xe2cb('0x44')]['id'];}return db['SquareRecording'][_0xe2cb('0x41')]({'where':{'id':_0x46c230[_0xe2cb('0x40')]['id']}})[_0xe2cb('0x3a')](handleEntityNotFound(_0x9d0868,null))['then'](saveUpdates(_0x46c230['body'],null))['then'](respondWithResult(_0x9d0868,null))[_0xe2cb('0x3e')](handleError(_0x9d0868,null));};exports[_0xe2cb('0x45')]=function(_0x2ac815,_0x4a2617,_0x123536){var _0x166728=require(_0xe2cb('0x46'));var _0x3885ea=![];var _0x2fc7c2={};if(_0x2ac815[_0xe2cb('0x2a')][_0xe2cb('0x28')]&&_0x2ac815['query']['type']===_0xe2cb('0x47')){_0x2fc7c2[_0xe2cb('0x47')]=_0x2ac815[_0xe2cb('0x40')]['id'];}else{_0x2fc7c2['id']=_0x2ac815['params']['id'];}return db[_0xe2cb('0x25')]['find']({'where':_0x2fc7c2,'attributes':['id',_0xe2cb('0x48'),'filename'],'raw':!![]})['then'](handleEntityNotFound(_0x4a2617,null))['then'](function(_0x5f3806){if(_0x5f3806){var _0x22694a=_0x5f3806[_0xe2cb('0x48')];var _0x4f540f=util[_0xe2cb('0x49')](_0xe2cb('0x4a'),_0x22694a);if(fs[_0xe2cb('0x4b')](_0x4f540f)){_0x3885ea=!![];return _0x166728[_0xe2cb('0x4c')](_0x4f540f,_0x22694a,config[_0xe2cb('0x4d')][_0xe2cb('0x4e')])[_0xe2cb('0x3a')](function(){return _0x5f3806;});}return _0x5f3806;}})[_0xe2cb('0x3a')](function(_0x158b3b){if(_0x158b3b){var _0xfaf8e6=_0x158b3b['savePath'];if(!fs[_0xe2cb('0x4b')](_0xfaf8e6)){throw new db[(_0xe2cb('0x4f'))]['ValidationError'](_0xe2cb('0x50'));}if(_0x158b3b[_0xe2cb('0x51')]){return _0x4a2617[_0xe2cb('0x45')](_0xfaf8e6,_0x158b3b[_0xe2cb('0x51')]+path[_0xe2cb('0x52')](_0xfaf8e6),function(){if(_0x3885ea){fs[_0xe2cb('0x53')](_0xfaf8e6);}});}else{return _0x4a2617[_0xe2cb('0x45')](_0xfaf8e6,function(_0xcbf022){if(_0x3885ea){fs['unlink'](_0xfaf8e6);}});}}})[_0xe2cb('0x3e')](function(_0x163f3d){if(_0x163f3d[_0xe2cb('0x54')]===_0xe2cb('0x50')){_0x4a2617['status'](0x194)[_0xe2cb('0x23')]('Not\x20found');}else{return handleError(_0x4a2617,null);}});};exports['destroy']=function(_0x44f17e,_0xf83a05){return db[_0xe2cb('0x25')][_0xe2cb('0x41')]({'where':{'id':_0x44f17e[_0xe2cb('0x40')]['id']}})[_0xe2cb('0x3a')](function(_0x2bde08){if(!_0x2bde08)throw new ReferenceError(_0xe2cb('0x55'));return _0x2bde08;})[_0xe2cb('0x3a')](function(_0x5de0d2){var _0x30f05f=_0x5de0d2[_0xe2cb('0x48')];logger[_0xe2cb('0x56')]('cancellazione\x20fisica\x20documento\x20%s',_0x30f05f);if(!_[_0xe2cb('0x57')](_0x5de0d2[_0xe2cb('0x48')])&&fs['existsSync'](_0x30f05f)){logger['info']('File:\x20\x22'+_0x30f05f+_0xe2cb('0x58'));fs[_0xe2cb('0x59')](_0x30f05f);}_0x30f05f=_0x30f05f+'.cypher';if(!_[_0xe2cb('0x57')](_0x5de0d2[_0xe2cb('0x48')])&&fs[_0xe2cb('0x4b')](_0x30f05f)){logger[_0xe2cb('0x56')](_0xe2cb('0x5a')+_0x30f05f+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xe2cb('0x59')](_0x30f05f);}return _0x5de0d2;})[_0xe2cb('0x3a')](function(_0x2743ce){if(!_0x2743ce)throw new InternalError();return _0x2743ce['destroy']();})['then'](function(){_0xf83a05[_0xe2cb('0x16')](0xcc)[_0xe2cb('0x5b')]();})[_0xe2cb('0x3e')](handleError(_0xf83a05,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 7af9041..00b80f0 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 _0xabad=['lodash','../../config/logger','api','moment','request-promise','path','../../config/environment','./squareRecording.attributes','exports','define','SquareRecording','square_recordings'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xabad,0x150));var _0xdaba=function(_0x5da398,_0x13a526){_0x5da398=_0x5da398-0x0;var _0x4db43a=_0xabad[_0x5da398];return _0x4db43a;};'use strict';var _=require(_0xdaba('0x0'));var util=require('util');var logger=require(_0xdaba('0x1'))(_0xdaba('0x2'));var moment=require(_0xdaba('0x3'));var BPromise=require('bluebird');var rp=require(_0xdaba('0x4'));var fs=require('fs');var path=require(_0xdaba('0x5'));var rimraf=require('rimraf');var config=require(_0xdaba('0x6'));var attributes=require(_0xdaba('0x7'));module[_0xdaba('0x8')]=function(_0x387d02,_0x20fd9f){return _0x387d02[_0xdaba('0x9')](_0xdaba('0xa'),attributes,{'tableName':_0xdaba('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe2cf=['request-promise','path','rimraf','./squareRecording.attributes','exports','define','SquareRecording','util','api','bluebird'];(function(_0x31970d,_0x313d50){var _0x47cd6a=function(_0x5a0257){while(--_0x5a0257){_0x31970d['push'](_0x31970d['shift']());}};_0x47cd6a(++_0x313d50);}(_0xe2cf,0x1a1));var _0xfe2c=function(_0x31aaeb,_0x6194ef){_0x31aaeb=_0x31aaeb-0x0;var _0x2e97da=_0xe2cf[_0x31aaeb];return _0x2e97da;};'use strict';var _=require('lodash');var util=require(_0xfe2c('0x0'));var logger=require('../../config/logger')(_0xfe2c('0x1'));var moment=require('moment');var BPromise=require(_0xfe2c('0x2'));var rp=require(_0xfe2c('0x3'));var fs=require('fs');var path=require(_0xfe2c('0x4'));var rimraf=require(_0xfe2c('0x5'));var config=require('../../config/environment');var attributes=require(_0xfe2c('0x6'));module[_0xfe2c('0x7')]=function(_0x55bb12,_0x4fa079){return _0x55bb12[_0xfe2c('0x8')](_0xfe2c('0x9'),attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index 1145d97..df2e51b 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 _0xa4ef=['options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','SquareRecording,\x20%s,\x20%s','debug','SquareRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','CreateSquareRecording','SquareRecording','create','body'];(function(_0x50c70a,_0x4fcd5c){var _0x1f388a=function(_0xfe9d58){while(--_0xfe9d58){_0x50c70a['push'](_0x50c70a['shift']());}};_0x1f388a(++_0x4fcd5c);}(_0xa4ef,0xcd));var _0xfa4e=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xa4ef[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0xfa4e('0x0'));var util=require(_0xfa4e('0x1'));var moment=require(_0xfa4e('0x2'));var BPromise=require(_0xfa4e('0x3'));var rs=require(_0xfa4e('0x4'));var fs=require('fs');var Redis=require(_0xfa4e('0x5'));var db=require(_0xfa4e('0x6'))['db'];var utils=require(_0xfa4e('0x7'));var logger=require('../../config/logger')(_0xfa4e('0x8'));var config=require(_0xfa4e('0x9'));var jayson=require(_0xfa4e('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x396be5,_0x8a3d25,_0x4d6b92){return new BPromise(function(_0x4cb448,_0x51610f){return client[_0xfa4e('0xb')](_0x396be5,_0x4d6b92)[_0xfa4e('0xc')](function(_0x302f9c){logger['info'](_0xfa4e('0xd'),_0x8a3d25,'request\x20sent');logger[_0xfa4e('0xe')](_0xfa4e('0xf'),_0x8a3d25,_0xfa4e('0x10'),JSON[_0xfa4e('0x11')](_0x302f9c));if(_0x302f9c[_0xfa4e('0x12')]){if(_0x302f9c[_0xfa4e('0x12')]['code']===0x1f4){logger['error']('SquareRecording,\x20%s,\x20%s',_0x8a3d25,_0x302f9c[_0xfa4e('0x12')][_0xfa4e('0x13')]);return _0x51610f(_0x302f9c['error']['message']);}logger[_0xfa4e('0x12')]('SquareRecording,\x20%s,\x20%s',_0x8a3d25,_0x302f9c[_0xfa4e('0x12')][_0xfa4e('0x13')]);return _0x4cb448(_0x302f9c[_0xfa4e('0x12')][_0xfa4e('0x13')]);}else{logger[_0xfa4e('0x14')](_0xfa4e('0xd'),_0x8a3d25,'request\x20sent');_0x4cb448(_0x302f9c[_0xfa4e('0x15')][_0xfa4e('0x13')]);}})[_0xfa4e('0x16')](function(_0x1f12c4){logger['error'](_0xfa4e('0xd'),_0x8a3d25,_0x1f12c4);_0x51610f(_0x1f12c4);});});}exports[_0xfa4e('0x17')]=function(_0xe5cf22){var _0x61be02=this;return new Promise(function(_0x536ee3,_0x57460a){return db[_0xfa4e('0x18')][_0xfa4e('0x19')](_0xe5cf22[_0xfa4e('0x1a')],{'raw':_0xe5cf22['options']?_0xe5cf22[_0xfa4e('0x1b')][_0xfa4e('0x1c')]===undefined?!![]:![]:!![]})[_0xfa4e('0xc')](function(_0x2621d8){logger['info'](_0xfa4e('0x17'),_0xe5cf22);logger[_0xfa4e('0xe')](_0xfa4e('0x17'),_0xe5cf22,JSON[_0xfa4e('0x11')](_0x2621d8));_0x536ee3(_0x2621d8);})['catch'](function(_0x293815){logger[_0xfa4e('0x12')](_0xfa4e('0x17'),_0x293815[_0xfa4e('0x13')],_0xe5cf22);_0x57460a(_0x61be02[_0xfa4e('0x12')](0x1f4,_0x293815['message']));});});}; \ No newline at end of file +var _0x2703=['options','raw','then','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareRecording,\x20%s,\x20%s','message','result','catch','CreateSquareRecording','SquareRecording','create','body'];(function(_0x1ac473,_0x38ea8b){var _0x102286=function(_0x2c770b){while(--_0x2c770b){_0x1ac473['push'](_0x1ac473['shift']());}};_0x102286(++_0x38ea8b);}(_0x2703,0x7f));var _0x3270=function(_0x17d28,_0x28a19a){_0x17d28=_0x17d28-0x0;var _0x2f72a1=_0x2703[_0x17d28];return _0x2f72a1;};'use strict';var _=require(_0x3270('0x0'));var util=require('util');var moment=require(_0x3270('0x1'));var BPromise=require(_0x3270('0x2'));var rs=require(_0x3270('0x3'));var fs=require('fs');var Redis=require(_0x3270('0x4'));var db=require(_0x3270('0x5'))['db'];var utils=require(_0x3270('0x6'));var logger=require(_0x3270('0x7'))(_0x3270('0x8'));var config=require(_0x3270('0x9'));var jayson=require(_0x3270('0xa'));var client=jayson[_0x3270('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1d48e9,_0x3837b7,_0x6428e1){return new BPromise(function(_0x50448d,_0x4bdb6a){return client[_0x3270('0xc')](_0x1d48e9,_0x6428e1)['then'](function(_0x9d154d){logger[_0x3270('0xd')]('SquareRecording,\x20%s,\x20%s',_0x3837b7,_0x3270('0xe'));logger[_0x3270('0xf')](_0x3270('0x10'),_0x3837b7,_0x3270('0xe'),JSON[_0x3270('0x11')](_0x9d154d));if(_0x9d154d[_0x3270('0x12')]){if(_0x9d154d[_0x3270('0x12')][_0x3270('0x13')]===0x1f4){logger[_0x3270('0x12')](_0x3270('0x14'),_0x3837b7,_0x9d154d['error'][_0x3270('0x15')]);return _0x4bdb6a(_0x9d154d[_0x3270('0x12')][_0x3270('0x15')]);}logger[_0x3270('0x12')](_0x3270('0x14'),_0x3837b7,_0x9d154d[_0x3270('0x12')]['message']);return _0x50448d(_0x9d154d[_0x3270('0x12')][_0x3270('0x15')]);}else{logger[_0x3270('0xd')]('SquareRecording,\x20%s,\x20%s',_0x3837b7,'request\x20sent');_0x50448d(_0x9d154d[_0x3270('0x16')][_0x3270('0x15')]);}})[_0x3270('0x17')](function(_0x1489ea){logger[_0x3270('0x12')](_0x3270('0x14'),_0x3837b7,_0x1489ea);_0x4bdb6a(_0x1489ea);});});}exports[_0x3270('0x18')]=function(_0x360cda){var _0x4914d3=this;return new Promise(function(_0x32822a,_0x380694){return db[_0x3270('0x19')][_0x3270('0x1a')](_0x360cda[_0x3270('0x1b')],{'raw':_0x360cda[_0x3270('0x1c')]?_0x360cda[_0x3270('0x1c')][_0x3270('0x1d')]===undefined?!![]:![]:!![]})[_0x3270('0x1e')](function(_0x19159d){logger[_0x3270('0xd')]('CreateSquareRecording',_0x360cda);logger[_0x3270('0xf')](_0x3270('0x18'),_0x360cda,JSON['stringify'](_0x19159d));_0x32822a(_0x19159d);})[_0x3270('0x17')](function(_0x569df1){logger[_0x3270('0x12')]('CreateSquareRecording',_0x569df1[_0x3270('0x15')],_0x360cda);_0x380694(_0x4914d3[_0x3270('0x12')](0x1f4,_0x569df1[_0x3270('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 0590f25..2043e8e 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 _0xb11c=['get','isAuthenticated','index','post','create','put','/:id','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x36d5ea,_0x3d7352){var _0xc47766=function(_0x5b036f){while(--_0x5b036f){_0x36d5ea['push'](_0x36d5ea['shift']());}};_0xc47766(++_0x3d7352);}(_0xb11c,0x104));var _0xcb11=function(_0x1bc3ef,_0x21e693){_0x1bc3ef=_0x1bc3ef-0x0;var _0x19703a=_0xb11c[_0x1bc3ef];return _0x19703a;};'use strict';var multer=require('multer');var util=require(_0xcb11('0x0'));var path=require(_0xcb11('0x1'));var timeout=require(_0xcb11('0x2'));var express=require(_0xcb11('0x3'));var router=express['Router']();var auth=require(_0xcb11('0x4'));var interaction=require(_0xcb11('0x5'));var config=require('../../config/environment');var controller=require('./squareReport.controller');router[_0xcb11('0x6')]('/',auth[_0xcb11('0x7')](),controller[_0xcb11('0x8')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xcb11('0x6')]('/:id',auth[_0xcb11('0x7')](),controller['show']);router[_0xcb11('0x9')]('/',auth[_0xcb11('0x7')](),controller[_0xcb11('0xa')]);router[_0xcb11('0xb')](_0xcb11('0xc'),auth[_0xcb11('0x7')](),controller['update']);router['delete'](_0xcb11('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xcb11('0xd')]=router; \ No newline at end of file +var _0x5b85=['update','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./squareReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5b85,0x9a));var _0x55b8=function(_0x4afc01,_0x122c2e){_0x4afc01=_0x4afc01-0x0;var _0x16e5ee=_0x5b85[_0x4afc01];return _0x16e5ee;};'use strict';var multer=require('multer');var util=require(_0x55b8('0x0'));var path=require(_0x55b8('0x1'));var timeout=require(_0x55b8('0x2'));var express=require(_0x55b8('0x3'));var router=express[_0x55b8('0x4')]();var auth=require(_0x55b8('0x5'));var interaction=require(_0x55b8('0x6'));var config=require('../../config/environment');var controller=require(_0x55b8('0x7'));router[_0x55b8('0x8')]('/',auth[_0x55b8('0x9')](),controller[_0x55b8('0xa')]);router[_0x55b8('0x8')](_0x55b8('0xb'),auth[_0x55b8('0x9')](),controller[_0x55b8('0xc')]);router['get'](_0x55b8('0xd'),auth['isAuthenticated'](),controller[_0x55b8('0xe')]);router[_0x55b8('0xf')]('/',auth[_0x55b8('0x9')](),controller['create']);router[_0x55b8('0x10')](_0x55b8('0xd'),auth[_0x55b8('0x9')](),controller[_0x55b8('0x11')]);router['delete'](_0x55b8('0xd'),auth[_0x55b8('0x9')](),controller[_0x55b8('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 6446c2e..e7b9a10 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 _0xa199=['DATE','BOOLEAN','sequelize','exports','STRING'];(function(_0x1d061e,_0x3bbfed){var _0x4d725f=function(_0x3afc14){while(--_0x3afc14){_0x1d061e['push'](_0x1d061e['shift']());}};_0x4d725f(++_0x3bbfed);}(_0xa199,0x124));var _0x9a19=function(_0x9ea6de,_0x3df9a4){_0x9ea6de=_0x9ea6de-0x0;var _0x16a563=_0xa199[_0x9ea6de];return _0x16a563;};'use strict';var Sequelize=require(_0x9a19('0x0'));module[_0x9a19('0x1')]={'network':{'type':Sequelize[_0x9a19('0x2')]},'network_script':{'type':Sequelize[_0x9a19('0x2')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x9a19('0x2')]},'language':{'type':Sequelize[_0x9a19('0x2')]},'type':{'type':Sequelize[_0x9a19('0x2')]},'uniqueid':{'type':Sequelize[_0x9a19('0x2')]},'version':{'type':Sequelize[_0x9a19('0x2')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize[_0x9a19('0x2')]},'callingani2':{'type':Sequelize[_0x9a19('0x2')]},'callington':{'type':Sequelize[_0x9a19('0x2')]},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x9a19('0x2')]},'rdnis':{'type':Sequelize[_0x9a19('0x2')]},'context':{'type':Sequelize[_0x9a19('0x2')]},'extension':{'type':Sequelize[_0x9a19('0x2')]},'priority':{'type':Sequelize[_0x9a19('0x2')]},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x9a19('0x2')]},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0x9a19('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x9a19('0x3')]},'bot':{'type':Sequelize[_0x9a19('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x991c=['STRING','DATE','BOOLEAN','sequelize','exports'];(function(_0x47a12a,_0x70f591){var _0x30cd40=function(_0x46b68f){while(--_0x46b68f){_0x47a12a['push'](_0x47a12a['shift']());}};_0x30cd40(++_0x70f591);}(_0x991c,0x9e));var _0xc991=function(_0x2fe61e,_0x175d7b){_0x2fe61e=_0x2fe61e-0x0;var _0x2502b9=_0x991c[_0x2fe61e];return _0x2502b9;};'use strict';var Sequelize=require(_0xc991('0x0'));module[_0xc991('0x1')]={'network':{'type':Sequelize[_0xc991('0x2')]},'network_script':{'type':Sequelize[_0xc991('0x2')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xc991('0x2')]},'language':{'type':Sequelize[_0xc991('0x2')]},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize[_0xc991('0x2')]},'callerid':{'type':Sequelize[_0xc991('0x2')]},'calleridname':{'type':Sequelize[_0xc991('0x2')]},'callingpres':{'type':Sequelize[_0xc991('0x2')]},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize[_0xc991('0x2')]},'dnid':{'type':Sequelize[_0xc991('0x2')]},'rdnis':{'type':Sequelize[_0xc991('0x2')]},'context':{'type':Sequelize[_0xc991('0x2')]},'extension':{'type':Sequelize[_0xc991('0x2')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xc991('0x2')]},'threadid':{'type':Sequelize[_0xc991('0x2')]},'project_name':{'type':Sequelize[_0xc991('0x2')]},'joinAt':{'type':Sequelize[_0xc991('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize[_0xc991('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index e93255e..a67992a 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 _0x326f=['moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','status','end','count','offset','limit','set','Content-Range','json','reject','save','destroy','then','sendStatus','stack','name','send','index','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','merge','type','filter','options','SquareReport','include','rows','catch','show','params','includeAll','create','body','update','find','describe','html-pdf','zip-dir','fast-json-patch','request-promise'];(function(_0x2ce7c6,_0x556e37){var _0x163ee4=function(_0x44d075){while(--_0x44d075){_0x2ce7c6['push'](_0x2ce7c6['shift']());}};_0x163ee4(++_0x556e37);}(_0x326f,0xd1));var _0xf326=function(_0x331e71,_0x20c629){_0x331e71=_0x331e71-0x0;var _0x484785=_0x326f[_0x331e71];return _0x484785;};'use strict';var pdf=require(_0xf326('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf326('0x1'));var jsonpatch=require(_0xf326('0x2'));var rp=require(_0xf326('0x3'));var moment=require(_0xf326('0x4'));var BPromise=require(_0xf326('0x5'));var Mustache=require(_0xf326('0x6'));var util=require(_0xf326('0x7'));var path=require(_0xf326('0x8'));var sox=require(_0xf326('0x9'));var csv=require(_0xf326('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xf326('0xb'));var squel=require(_0xf326('0xc'));var crypto=require(_0xf326('0xd'));var jsforce=require(_0xf326('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf326('0xf'));var Redis=require(_0xf326('0x10'));var authService=require(_0xf326('0x11'));var qs=require(_0xf326('0x12'));var as=require(_0xf326('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf326('0x14'))('api');var utils=require(_0xf326('0x15'));var config=require('../../config/environment');var db=require(_0xf326('0x16'))['db'];function respondWithStatusCode(_0x518ab5,_0x3162f9){_0x3162f9=_0x3162f9||0xcc;return function(_0x9ed463){if(_0x9ed463){return _0x518ab5['sendStatus'](_0x3162f9);}return _0x518ab5[_0xf326('0x17')](_0x3162f9)[_0xf326('0x18')]();};}function respondWithResult(_0x3504eb,_0x17a098){_0x17a098=_0x17a098||0xc8;return function(_0x5c8483){if(_0x5c8483){return _0x3504eb[_0xf326('0x17')](_0x17a098)['json'](_0x5c8483);}};}function respondWithFilteredResult(_0x54bd1a,_0xdf21d9){return function(_0x11f6d2){if(_0x11f6d2){var _0x1f2e5a=_0x11f6d2[_0xf326('0x19')],_0xa63d1a=_0xdf21d9[_0xf326('0x1a')],_0x292f4b=_0xdf21d9['offset']+_0xdf21d9[_0xf326('0x1b')],_0x287a2a;if(_0x292f4b>=_0x1f2e5a){_0x292f4b=_0x1f2e5a;_0x287a2a=0xc8;}else{_0x287a2a=0xce;}_0x54bd1a[_0xf326('0x17')](_0x287a2a);return _0x54bd1a[_0xf326('0x1c')](_0xf326('0x1d'),_0xa63d1a+'-'+_0x292f4b+'/'+_0x1f2e5a)[_0xf326('0x1e')](_0x11f6d2);}return null;};}function patchUpdates(_0x311af0){return function(_0x4d3d41){try{jsonpatch['apply'](_0x4d3d41,_0x311af0,!![]);}catch(_0x56ad41){return BPromise[_0xf326('0x1f')](_0x56ad41);}return _0x4d3d41[_0xf326('0x20')]();};}function saveUpdates(_0x484cbe,_0x4cabce){return function(_0x128c68){if(_0x128c68){return _0x128c68['update'](_0x484cbe)['then'](function(_0x448b92){return _0x448b92;});}return null;};}function removeEntity(_0x18ead3,_0x549b46){return function(_0x5aa184){if(_0x5aa184){return _0x5aa184[_0xf326('0x21')]()[_0xf326('0x22')](function(){_0x18ead3['status'](0xcc)[_0xf326('0x18')]();});}};}function handleEntityNotFound(_0x1b9039,_0x43c53e){return function(_0x295752){if(!_0x295752){_0x1b9039[_0xf326('0x23')](0x194);}return _0x295752;};}function handleError(_0x2049ec,_0x5ce532){_0x5ce532=_0x5ce532||0x1f4;return function(_0x55b9f4){logger['error'](_0x55b9f4[_0xf326('0x24')]);if(_0x55b9f4[_0xf326('0x25')]){delete _0x55b9f4[_0xf326('0x25')];}_0x2049ec[_0xf326('0x17')](_0x5ce532)[_0xf326('0x26')](_0x55b9f4);};}exports[_0xf326('0x27')]=function(_0x5217d4,_0x201d28){var _0xa3c0b={},_0x212d5d={},_0x581531={'count':0x0,'rows':[]};var _0x1617d2=_['map'](db['SquareReport'][_0xf326('0x28')],function(_0x1ae23a){return{'name':_0x1ae23a[_0xf326('0x29')],'type':_0x1ae23a['type'][_0xf326('0x2a')]};});_0x212d5d[_0xf326('0x2b')]=_['map'](_0x1617d2,_0xf326('0x25'));_0x212d5d[_0xf326('0x2c')]=_[_0xf326('0x2d')](_0x5217d4[_0xf326('0x2c')]);_0x212d5d[_0xf326('0x2e')]=_[_0xf326('0x2f')](_0x212d5d[_0xf326('0x2b')],_0x212d5d[_0xf326('0x2c')]);_0xa3c0b[_0xf326('0x30')]=_[_0xf326('0x2f')](_0x212d5d['model'],qs[_0xf326('0x31')](_0x5217d4[_0xf326('0x2c')][_0xf326('0x31')]));_0xa3c0b['attributes']=_0xa3c0b[_0xf326('0x30')][_0xf326('0x32')]?_0xa3c0b[_0xf326('0x30')]:_0x212d5d['model'];if(!_0x5217d4['query'][_0xf326('0x33')](_0xf326('0x34'))){_0xa3c0b[_0xf326('0x1b')]=qs[_0xf326('0x1b')](_0x5217d4[_0xf326('0x2c')][_0xf326('0x1b')]);_0xa3c0b[_0xf326('0x1a')]=qs[_0xf326('0x1a')](_0x5217d4['query'][_0xf326('0x1a')]);}_0xa3c0b[_0xf326('0x35')]=qs['sort'](_0x5217d4[_0xf326('0x2c')]['sort']);_0xa3c0b[_0xf326('0x36')]=qs['filters'](_['pick'](_0x5217d4[_0xf326('0x2c')],_0x212d5d['filters']));if(_0x5217d4[_0xf326('0x2c')]['filter']){_0xa3c0b[_0xf326('0x36')]=_[_0xf326('0x37')](_0xa3c0b[_0xf326('0x36')],{'$or':_['map'](_0x1617d2,function(_0x3dcc7e){if(_0x3dcc7e[_0xf326('0x38')]!=='VIRTUAL'){var _0x13932b={};_0x13932b[_0x3dcc7e[_0xf326('0x25')]]={'$like':'%'+_0x5217d4[_0xf326('0x2c')][_0xf326('0x39')]+'%'};return _0x13932b;}})});}_0xa3c0b=_['merge']({},_0xa3c0b,_0x5217d4[_0xf326('0x3a')]);var _0xb1ef35={'where':_0xa3c0b[_0xf326('0x36')]};return db[_0xf326('0x3b')][_0xf326('0x19')](_0xb1ef35)['then'](function(_0x3e830d){_0x581531[_0xf326('0x19')]=_0x3e830d;if(_0x5217d4['query']['includeAll']){_0xa3c0b[_0xf326('0x3c')]=[{'all':!![]}];}return db['SquareReport']['findAll'](_0xa3c0b);})[_0xf326('0x22')](function(_0x5d6ae2){_0x581531[_0xf326('0x3d')]=_0x5d6ae2;return _0x581531;})[_0xf326('0x22')](respondWithFilteredResult(_0x201d28,_0xa3c0b))[_0xf326('0x3e')](handleError(_0x201d28,null));};exports[_0xf326('0x3f')]=function(_0x49112d,_0x9dda89){var _0x45d344={'raw':!![],'where':{'id':_0x49112d[_0xf326('0x40')]['id']}},_0x347e7b={};_0x347e7b[_0xf326('0x2b')]=_[_0xf326('0x2d')](db[_0xf326('0x3b')][_0xf326('0x28')]);_0x347e7b[_0xf326('0x2c')]=_[_0xf326('0x2d')](_0x49112d[_0xf326('0x2c')]);_0x347e7b[_0xf326('0x2e')]=_['intersection'](_0x347e7b[_0xf326('0x2b')],_0x347e7b[_0xf326('0x2c')]);_0x45d344[_0xf326('0x30')]=_[_0xf326('0x2f')](_0x347e7b[_0xf326('0x2b')],qs[_0xf326('0x31')](_0x49112d['query'][_0xf326('0x31')]));_0x45d344[_0xf326('0x30')]=_0x45d344['attributes'][_0xf326('0x32')]?_0x45d344[_0xf326('0x30')]:_0x347e7b[_0xf326('0x2b')];if(_0x49112d[_0xf326('0x2c')][_0xf326('0x41')]){_0x45d344['include']=[{'all':!![]}];}_0x45d344=_['merge']({},_0x45d344,_0x49112d[_0xf326('0x3a')]);return db[_0xf326('0x3b')]['find'](_0x45d344)['then'](handleEntityNotFound(_0x9dda89,null))[_0xf326('0x22')](respondWithResult(_0x9dda89,null))[_0xf326('0x3e')](handleError(_0x9dda89,null));};exports[_0xf326('0x42')]=function(_0x5b3705,_0x301e65){return db[_0xf326('0x3b')][_0xf326('0x42')](_0x5b3705[_0xf326('0x43')],{})[_0xf326('0x22')](respondWithResult(_0x301e65,0xc9))[_0xf326('0x3e')](handleError(_0x301e65,null));};exports[_0xf326('0x44')]=function(_0x3b90dc,_0x3df9a8){if(_0x3b90dc[_0xf326('0x43')]['id']){delete _0x3b90dc[_0xf326('0x43')]['id'];}return db[_0xf326('0x3b')][_0xf326('0x45')]({'where':{'id':_0x3b90dc[_0xf326('0x40')]['id']}})[_0xf326('0x22')](handleEntityNotFound(_0x3df9a8,null))['then'](saveUpdates(_0x3b90dc[_0xf326('0x43')],null))[_0xf326('0x22')](respondWithResult(_0x3df9a8,null))[_0xf326('0x3e')](handleError(_0x3df9a8,null));};exports[_0xf326('0x21')]=function(_0x5f1829,_0x10f437){return db[_0xf326('0x3b')][_0xf326('0x45')]({'where':{'id':_0x5f1829[_0xf326('0x40')]['id']}})['then'](handleEntityNotFound(_0x10f437,null))[_0xf326('0x22')](removeEntity(_0x10f437,null))[_0xf326('0x3e')](handleError(_0x10f437,null));};exports[_0xf326('0x46')]=function(_0x451ac7,_0x39ba25){return db['SquareReport']['describe']()[_0xf326('0x22')](respondWithResult(_0x39ba25,null))[_0xf326('0x3e')](handleError(_0x39ba25,null));}; \ No newline at end of file +var _0x7fbe=['query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','SquareReport','includeAll','findAll','rows','show','params','include','options','catch','create','body','destroy','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','Content-Range','save','update','then','error','name','send','index','map','rawAttributes','fieldName','type','key','model','keys'];(function(_0x44250a,_0x5a0641){var _0x343d8b=function(_0x2e5455){while(--_0x2e5455){_0x44250a['push'](_0x44250a['shift']());}};_0x343d8b(++_0x5a0641);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x194b5c,_0x3e4893){_0x194b5c=_0x194b5c-0x0;var _0x2badf6=_0x7fbe[_0x194b5c];return _0x2badf6;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xe7fb('0x0'));var zipdir=require(_0xe7fb('0x1'));var jsonpatch=require(_0xe7fb('0x2'));var rp=require(_0xe7fb('0x3'));var moment=require(_0xe7fb('0x4'));var BPromise=require(_0xe7fb('0x5'));var Mustache=require(_0xe7fb('0x6'));var util=require(_0xe7fb('0x7'));var path=require(_0xe7fb('0x8'));var sox=require(_0xe7fb('0x9'));var csv=require(_0xe7fb('0xa'));var ejs=require(_0xe7fb('0xb'));var fs=require('fs');var _=require(_0xe7fb('0xc'));var squel=require(_0xe7fb('0xd'));var crypto=require('crypto');var jsforce=require(_0xe7fb('0xe'));var deskjs=require(_0xe7fb('0xf'));var toCsv=require(_0xe7fb('0xa'));var querystring=require(_0xe7fb('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe7fb('0x11'));var qs=require(_0xe7fb('0x12'));var as=require(_0xe7fb('0x13'));var hardwareService=require(_0xe7fb('0x14'));var logger=require(_0xe7fb('0x15'))(_0xe7fb('0x16'));var utils=require(_0xe7fb('0x17'));var config=require(_0xe7fb('0x18'));var db=require(_0xe7fb('0x19'))['db'];function respondWithStatusCode(_0x2fe8ab,_0x2437d4){_0x2437d4=_0x2437d4||0xcc;return function(_0x188e1d){if(_0x188e1d){return _0x2fe8ab[_0xe7fb('0x1a')](_0x2437d4);}return _0x2fe8ab[_0xe7fb('0x1b')](_0x2437d4)[_0xe7fb('0x1c')]();};}function respondWithResult(_0x598729,_0x278b75){_0x278b75=_0x278b75||0xc8;return function(_0x2225e5){if(_0x2225e5){return _0x598729['status'](_0x278b75)[_0xe7fb('0x1d')](_0x2225e5);}};}function respondWithFilteredResult(_0x37eb9f,_0x482f7d){return function(_0xa76acf){if(_0xa76acf){var _0x559129=_0xa76acf[_0xe7fb('0x1e')],_0x12fff6=_0x482f7d['offset'],_0x18d23c=_0x482f7d[_0xe7fb('0x1f')]+_0x482f7d['limit'],_0x12603d;if(_0x18d23c>=_0x559129){_0x18d23c=_0x559129;_0x12603d=0xc8;}else{_0x12603d=0xce;}_0x37eb9f[_0xe7fb('0x1b')](_0x12603d);return _0x37eb9f['set'](_0xe7fb('0x20'),_0x12fff6+'-'+_0x18d23c+'/'+_0x559129)[_0xe7fb('0x1d')](_0xa76acf);}return null;};}function patchUpdates(_0x3f96a7){return function(_0x182269){try{jsonpatch['apply'](_0x182269,_0x3f96a7,!![]);}catch(_0x44466e){return BPromise['reject'](_0x44466e);}return _0x182269[_0xe7fb('0x21')]();};}function saveUpdates(_0x51f01f,_0x15f7a4){return function(_0x4ea664){if(_0x4ea664){return _0x4ea664[_0xe7fb('0x22')](_0x51f01f)[_0xe7fb('0x23')](function(_0x4a9994){return _0x4a9994;});}return null;};}function removeEntity(_0x143eb6,_0x4742bd){return function(_0x3ae8f1){if(_0x3ae8f1){return _0x3ae8f1['destroy']()[_0xe7fb('0x23')](function(){_0x143eb6[_0xe7fb('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5bea27,_0x52f08b){return function(_0x35e4db){if(!_0x35e4db){_0x5bea27['sendStatus'](0x194);}return _0x35e4db;};}function handleError(_0x49b219,_0x4026b1){_0x4026b1=_0x4026b1||0x1f4;return function(_0x32e8b2){logger[_0xe7fb('0x24')](_0x32e8b2['stack']);if(_0x32e8b2[_0xe7fb('0x25')]){delete _0x32e8b2[_0xe7fb('0x25')];}_0x49b219[_0xe7fb('0x1b')](_0x4026b1)[_0xe7fb('0x26')](_0x32e8b2);};}exports[_0xe7fb('0x27')]=function(_0x16237a,_0x380130){var _0x59e015={},_0x5df9f2={},_0x1086e6={'count':0x0,'rows':[]};var _0x3bdee9=_[_0xe7fb('0x28')](db['SquareReport'][_0xe7fb('0x29')],function(_0x251807){return{'name':_0x251807[_0xe7fb('0x2a')],'type':_0x251807[_0xe7fb('0x2b')][_0xe7fb('0x2c')]};});_0x5df9f2[_0xe7fb('0x2d')]=_[_0xe7fb('0x28')](_0x3bdee9,_0xe7fb('0x25'));_0x5df9f2['query']=_[_0xe7fb('0x2e')](_0x16237a[_0xe7fb('0x2f')]);_0x5df9f2[_0xe7fb('0x30')]=_['intersection'](_0x5df9f2['model'],_0x5df9f2[_0xe7fb('0x2f')]);_0x59e015['attributes']=_[_0xe7fb('0x31')](_0x5df9f2[_0xe7fb('0x2d')],qs[_0xe7fb('0x32')](_0x16237a[_0xe7fb('0x2f')]['fields']));_0x59e015[_0xe7fb('0x33')]=_0x59e015[_0xe7fb('0x33')][_0xe7fb('0x34')]?_0x59e015[_0xe7fb('0x33')]:_0x5df9f2[_0xe7fb('0x2d')];if(!_0x16237a['query'][_0xe7fb('0x35')](_0xe7fb('0x36'))){_0x59e015[_0xe7fb('0x37')]=qs[_0xe7fb('0x37')](_0x16237a[_0xe7fb('0x2f')][_0xe7fb('0x37')]);_0x59e015[_0xe7fb('0x1f')]=qs[_0xe7fb('0x1f')](_0x16237a[_0xe7fb('0x2f')]['offset']);}_0x59e015[_0xe7fb('0x38')]=qs[_0xe7fb('0x39')](_0x16237a[_0xe7fb('0x2f')]['sort']);_0x59e015[_0xe7fb('0x3a')]=qs[_0xe7fb('0x30')](_[_0xe7fb('0x3b')](_0x16237a[_0xe7fb('0x2f')],_0x5df9f2[_0xe7fb('0x30')]));if(_0x16237a[_0xe7fb('0x2f')][_0xe7fb('0x3c')]){_0x59e015[_0xe7fb('0x3a')]=_[_0xe7fb('0x3d')](_0x59e015[_0xe7fb('0x3a')],{'$or':_[_0xe7fb('0x28')](_0x3bdee9,function(_0x3c4f4b){if(_0x3c4f4b[_0xe7fb('0x2b')]!==_0xe7fb('0x3e')){var _0xeb7c29={};_0xeb7c29[_0x3c4f4b[_0xe7fb('0x25')]]={'$like':'%'+_0x16237a[_0xe7fb('0x2f')][_0xe7fb('0x3c')]+'%'};return _0xeb7c29;}})});}_0x59e015=_[_0xe7fb('0x3d')]({},_0x59e015,_0x16237a['options']);var _0x261ec5={'where':_0x59e015[_0xe7fb('0x3a')]};return db[_0xe7fb('0x3f')][_0xe7fb('0x1e')](_0x261ec5)['then'](function(_0x3426a9){_0x1086e6[_0xe7fb('0x1e')]=_0x3426a9;if(_0x16237a[_0xe7fb('0x2f')][_0xe7fb('0x40')]){_0x59e015['include']=[{'all':!![]}];}return db[_0xe7fb('0x3f')][_0xe7fb('0x41')](_0x59e015);})[_0xe7fb('0x23')](function(_0x62a8a1){_0x1086e6[_0xe7fb('0x42')]=_0x62a8a1;return _0x1086e6;})[_0xe7fb('0x23')](respondWithFilteredResult(_0x380130,_0x59e015))['catch'](handleError(_0x380130,null));};exports[_0xe7fb('0x43')]=function(_0x35139f,_0x3a96cd){var _0x4b263d={'raw':!![],'where':{'id':_0x35139f[_0xe7fb('0x44')]['id']}},_0x36a341={};_0x36a341['model']=_['keys'](db['SquareReport']['rawAttributes']);_0x36a341['query']=_[_0xe7fb('0x2e')](_0x35139f[_0xe7fb('0x2f')]);_0x36a341[_0xe7fb('0x30')]=_['intersection'](_0x36a341[_0xe7fb('0x2d')],_0x36a341['query']);_0x4b263d[_0xe7fb('0x33')]=_[_0xe7fb('0x31')](_0x36a341['model'],qs[_0xe7fb('0x32')](_0x35139f[_0xe7fb('0x2f')][_0xe7fb('0x32')]));_0x4b263d[_0xe7fb('0x33')]=_0x4b263d['attributes'][_0xe7fb('0x34')]?_0x4b263d[_0xe7fb('0x33')]:_0x36a341[_0xe7fb('0x2d')];if(_0x35139f['query'][_0xe7fb('0x40')]){_0x4b263d[_0xe7fb('0x45')]=[{'all':!![]}];}_0x4b263d=_[_0xe7fb('0x3d')]({},_0x4b263d,_0x35139f[_0xe7fb('0x46')]);return db[_0xe7fb('0x3f')]['find'](_0x4b263d)[_0xe7fb('0x23')](handleEntityNotFound(_0x3a96cd,null))['then'](respondWithResult(_0x3a96cd,null))[_0xe7fb('0x47')](handleError(_0x3a96cd,null));};exports[_0xe7fb('0x48')]=function(_0x3520e3,_0x1ecbfd){return db[_0xe7fb('0x3f')]['create'](_0x3520e3[_0xe7fb('0x49')],{})['then'](respondWithResult(_0x1ecbfd,0xc9))['catch'](handleError(_0x1ecbfd,null));};exports[_0xe7fb('0x22')]=function(_0x3d740f,_0x16327f){if(_0x3d740f['body']['id']){delete _0x3d740f[_0xe7fb('0x49')]['id'];}return db[_0xe7fb('0x3f')]['find']({'where':{'id':_0x3d740f['params']['id']}})[_0xe7fb('0x23')](handleEntityNotFound(_0x16327f,null))[_0xe7fb('0x23')](saveUpdates(_0x3d740f[_0xe7fb('0x49')],null))[_0xe7fb('0x23')](respondWithResult(_0x16327f,null))[_0xe7fb('0x47')](handleError(_0x16327f,null));};exports[_0xe7fb('0x4a')]=function(_0x18a590,_0x347177){return db['SquareReport'][_0xe7fb('0x4b')]({'where':{'id':_0x18a590['params']['id']}})[_0xe7fb('0x23')](handleEntityNotFound(_0x347177,null))[_0xe7fb('0x23')](removeEntity(_0x347177,null))['catch'](handleError(_0x347177,null));};exports[_0xe7fb('0x4c')]=function(_0x5efd24,_0x239c56){return db['SquareReport'][_0xe7fb('0x4c')]()['then'](respondWithResult(_0x239c56,null))[_0xe7fb('0x47')](handleError(_0x239c56,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index dcb1f2d..e4ca365 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 _0xd5ef=['define','SquareReport','report_square','uid_pname','uniqueid','project_name','leaveAt','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','exports'];(function(_0x266adb,_0x6ac6e1){var _0x39ad47=function(_0x38c924){while(--_0x38c924){_0x266adb['push'](_0x266adb['shift']());}};_0x39ad47(++_0x6ac6e1);}(_0xd5ef,0xf7));var _0xfd5e=function(_0x47172b,_0x191fe0){_0x47172b=_0x47172b-0x0;var _0x1c812d=_0xd5ef[_0x47172b];return _0x1c812d;};'use strict';var _=require(_0xfd5e('0x0'));var util=require(_0xfd5e('0x1'));var logger=require(_0xfd5e('0x2'))(_0xfd5e('0x3'));var moment=require(_0xfd5e('0x4'));var BPromise=require(_0xfd5e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfd5e('0x6'));var rimraf=require('rimraf');var config=require(_0xfd5e('0x7'));var attributes=require('./squareReport.attributes');module[_0xfd5e('0x8')]=function(_0x185717,_0x35e6b6){return _0x185717[_0xfd5e('0x9')](_0xfd5e('0xa'),attributes,{'tableName':_0xfd5e('0xb'),'paranoid':![],'indexes':[{'name':_0xfd5e('0xc'),'fields':[_0xfd5e('0xd'),_0xfd5e('0xe')]},{'name':_0xfd5e('0xf'),'fields':[_0xfd5e('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2ece=['report_square','uid_pname','uniqueid','project_name','leaveAt','util','../../config/logger','api','request-promise','path','../../config/environment','exports','define','SquareReport'];(function(_0x462f99,_0x237ab3){var _0x58dafe=function(_0x76c3d4){while(--_0x76c3d4){_0x462f99['push'](_0x462f99['shift']());}};_0x58dafe(++_0x237ab3);}(_0x2ece,0xe5));var _0xe2ec=function(_0x45ffc0,_0x4f090b){_0x45ffc0=_0x45ffc0-0x0;var _0x1f0074=_0x2ece[_0x45ffc0];return _0x1f0074;};'use strict';var _=require('lodash');var util=require(_0xe2ec('0x0'));var logger=require(_0xe2ec('0x1'))(_0xe2ec('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe2ec('0x3'));var fs=require('fs');var path=require(_0xe2ec('0x4'));var rimraf=require('rimraf');var config=require(_0xe2ec('0x5'));var attributes=require('./squareReport.attributes');module[_0xe2ec('0x6')]=function(_0x5299b9,_0x16e68f){return _0x5299b9[_0xe2ec('0x7')](_0xe2ec('0x8'),attributes,{'tableName':_0xe2ec('0x9'),'paranoid':![],'indexes':[{'name':_0xe2ec('0xa'),'fields':[_0xe2ec('0xb'),_0xe2ec('0xc')]},{'name':_0xe2ec('0xd'),'fields':[_0xe2ec('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index d88279e..ca64953 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 _0xb5fb=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','info','SquareReport,\x20%s,\x20%s','request\x20sent','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CreateSquareReport','SquareReport','create','options','raw','then','debug','catch','UpdateSquareReport','update','where','limit'];(function(_0x2b91c5,_0x3b6db5){var _0xbd5531=function(_0x54783d){while(--_0x54783d){_0x2b91c5['push'](_0x2b91c5['shift']());}};_0xbd5531(++_0x3b6db5);}(_0xb5fb,0x108));var _0xbb5f=function(_0xfb9aaa,_0x37935d){_0xfb9aaa=_0xfb9aaa-0x0;var _0x103bf7=_0xb5fb[_0xfb9aaa];return _0x103bf7;};'use strict';var _=require(_0xbb5f('0x0'));var util=require(_0xbb5f('0x1'));var moment=require(_0xbb5f('0x2'));var BPromise=require(_0xbb5f('0x3'));var rs=require(_0xbb5f('0x4'));var fs=require('fs');var Redis=require(_0xbb5f('0x5'));var db=require(_0xbb5f('0x6'))['db'];var utils=require(_0xbb5f('0x7'));var logger=require(_0xbb5f('0x8'))(_0xbb5f('0x9'));var config=require('../../config/environment');var jayson=require(_0xbb5f('0xa'));var client=jayson[_0xbb5f('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f91a8,_0x3a0ef7,_0x621a72){return new BPromise(function(_0x266232,_0xc1c5d){return client[_0xbb5f('0xc')](_0x1f91a8,_0x621a72)['then'](function(_0x20ae43){logger[_0xbb5f('0xd')](_0xbb5f('0xe'),_0x3a0ef7,_0xbb5f('0xf'));logger['debug'](_0xbb5f('0x10'),_0x3a0ef7,'request\x20sent',JSON[_0xbb5f('0x11')](_0x20ae43));if(_0x20ae43['error']){if(_0x20ae43[_0xbb5f('0x12')][_0xbb5f('0x13')]===0x1f4){logger['error']('SquareReport,\x20%s,\x20%s',_0x3a0ef7,_0x20ae43[_0xbb5f('0x12')][_0xbb5f('0x14')]);return _0xc1c5d(_0x20ae43[_0xbb5f('0x12')]['message']);}logger[_0xbb5f('0x12')](_0xbb5f('0xe'),_0x3a0ef7,_0x20ae43['error'][_0xbb5f('0x14')]);return _0x266232(_0x20ae43['error'][_0xbb5f('0x14')]);}else{logger[_0xbb5f('0xd')](_0xbb5f('0xe'),_0x3a0ef7,'request\x20sent');_0x266232(_0x20ae43['result'][_0xbb5f('0x14')]);}})['catch'](function(_0x5adf98){logger['error'](_0xbb5f('0xe'),_0x3a0ef7,_0x5adf98);_0xc1c5d(_0x5adf98);});});}exports[_0xbb5f('0x15')]=function(_0x2bfa9b){var _0xdc025=this;return new Promise(function(_0x603607,_0x2fd314){return db[_0xbb5f('0x16')][_0xbb5f('0x17')](_0x2bfa9b['body'],{'raw':_0x2bfa9b['options']?_0x2bfa9b[_0xbb5f('0x18')][_0xbb5f('0x19')]===undefined?!![]:![]:!![]})[_0xbb5f('0x1a')](function(_0x437218){logger['info'](_0xbb5f('0x15'),_0x2bfa9b);logger[_0xbb5f('0x1b')]('CreateSquareReport',_0x2bfa9b,JSON[_0xbb5f('0x11')](_0x437218));_0x603607(_0x437218);})[_0xbb5f('0x1c')](function(_0x4eb478){logger[_0xbb5f('0x12')]('CreateSquareReport',_0x4eb478[_0xbb5f('0x14')],_0x2bfa9b);_0x2fd314(_0xdc025[_0xbb5f('0x12')](0x1f4,_0x4eb478[_0xbb5f('0x14')]));});});};exports[_0xbb5f('0x1d')]=function(_0x222396){var _0x2b2dde=this;return new Promise(function(_0x48e74d,_0x4e7b8f){return db['SquareReport'][_0xbb5f('0x1e')](_0x222396['body'],{'raw':_0x222396[_0xbb5f('0x18')]?_0x222396[_0xbb5f('0x18')][_0xbb5f('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x222396[_0xbb5f('0x18')]?_0x222396[_0xbb5f('0x18')][_0xbb5f('0x1f')]||null:null,'attributes':_0x222396[_0xbb5f('0x18')]?_0x222396['options']['attributes']||null:null,'limit':_0x222396[_0xbb5f('0x18')]?_0x222396['options'][_0xbb5f('0x20')]||null:null})[_0xbb5f('0x1a')](function(_0x39265f){logger[_0xbb5f('0xd')]('UpdateSquareReport',_0x222396);logger[_0xbb5f('0x1b')](_0xbb5f('0x1d'),_0x222396,JSON['stringify'](_0x39265f));_0x48e74d(_0x39265f);})[_0xbb5f('0x1c')](function(_0x447890){logger[_0xbb5f('0x12')](_0xbb5f('0x1d'),_0x447890['message'],_0x222396);_0x4e7b8f(_0x2b2dde[_0xbb5f('0x12')](0x1f4,_0x447890[_0xbb5f('0x14')]));});});}; \ No newline at end of file +var _0x5283=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateSquareReport','SquareReport','create','body','options','raw','stringify','UpdateSquareReport','where','limit','lodash','util','moment','ioredis','../../mysqldb'];(function(_0x4c6c4e,_0x50cf2){var _0x126618=function(_0x395e8b){while(--_0x395e8b){_0x4c6c4e['push'](_0x4c6c4e['shift']());}};_0x126618(++_0x50cf2);}(_0x5283,0x124));var _0x3528=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x5283[_0x4b055c];return _0x4b62bb;};'use strict';var _=require(_0x3528('0x0'));var util=require(_0x3528('0x1'));var moment=require(_0x3528('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3528('0x3'));var db=require(_0x3528('0x4'))['db'];var utils=require(_0x3528('0x5'));var logger=require(_0x3528('0x6'))('rpc');var config=require(_0x3528('0x7'));var jayson=require(_0x3528('0x8'));var client=jayson[_0x3528('0x9')][_0x3528('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3574fd,_0x173fe7,_0x5adf78){return new BPromise(function(_0x1b002d,_0x1308e8){return client[_0x3528('0xb')](_0x3574fd,_0x5adf78)[_0x3528('0xc')](function(_0x113e8b){logger[_0x3528('0xd')](_0x3528('0xe'),_0x173fe7,_0x3528('0xf'));logger[_0x3528('0x10')](_0x3528('0x11'),_0x173fe7,_0x3528('0xf'),JSON['stringify'](_0x113e8b));if(_0x113e8b[_0x3528('0x12')]){if(_0x113e8b[_0x3528('0x12')][_0x3528('0x13')]===0x1f4){logger[_0x3528('0x12')](_0x3528('0xe'),_0x173fe7,_0x113e8b['error'][_0x3528('0x14')]);return _0x1308e8(_0x113e8b[_0x3528('0x12')][_0x3528('0x14')]);}logger[_0x3528('0x12')]('SquareReport,\x20%s,\x20%s',_0x173fe7,_0x113e8b[_0x3528('0x12')][_0x3528('0x14')]);return _0x1b002d(_0x113e8b['error']['message']);}else{logger[_0x3528('0xd')](_0x3528('0xe'),_0x173fe7,_0x3528('0xf'));_0x1b002d(_0x113e8b[_0x3528('0x15')][_0x3528('0x14')]);}})[_0x3528('0x16')](function(_0x3b12b7){logger['error']('SquareReport,\x20%s,\x20%s',_0x173fe7,_0x3b12b7);_0x1308e8(_0x3b12b7);});});}exports[_0x3528('0x17')]=function(_0x16ee8d){var _0x1182de=this;return new Promise(function(_0x49828d,_0x4b8b70){return db[_0x3528('0x18')][_0x3528('0x19')](_0x16ee8d[_0x3528('0x1a')],{'raw':_0x16ee8d['options']?_0x16ee8d[_0x3528('0x1b')][_0x3528('0x1c')]===undefined?!![]:![]:!![]})[_0x3528('0xc')](function(_0x2a7dc3){logger[_0x3528('0xd')](_0x3528('0x17'),_0x16ee8d);logger[_0x3528('0x10')](_0x3528('0x17'),_0x16ee8d,JSON[_0x3528('0x1d')](_0x2a7dc3));_0x49828d(_0x2a7dc3);})[_0x3528('0x16')](function(_0x3b741e){logger['error'](_0x3528('0x17'),_0x3b741e[_0x3528('0x14')],_0x16ee8d);_0x4b8b70(_0x1182de[_0x3528('0x12')](0x1f4,_0x3b741e['message']));});});};exports[_0x3528('0x1e')]=function(_0x537799){var _0x3c0b06=this;return new Promise(function(_0x549734,_0x458f9c){return db[_0x3528('0x18')]['update'](_0x537799[_0x3528('0x1a')],{'raw':_0x537799[_0x3528('0x1b')]?_0x537799['options'][_0x3528('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x537799[_0x3528('0x1b')]?_0x537799['options'][_0x3528('0x1f')]||null:null,'attributes':_0x537799['options']?_0x537799[_0x3528('0x1b')]['attributes']||null:null,'limit':_0x537799[_0x3528('0x1b')]?_0x537799[_0x3528('0x1b')][_0x3528('0x20')]||null:null})[_0x3528('0xc')](function(_0x22980d){logger[_0x3528('0xd')](_0x3528('0x1e'),_0x537799);logger[_0x3528('0x10')](_0x3528('0x1e'),_0x537799,JSON[_0x3528('0x1d')](_0x22980d));_0x549734(_0x22980d);})[_0x3528('0x16')](function(_0x593e25){logger[_0x3528('0x12')](_0x3528('0x1e'),_0x593e25[_0x3528('0x14')],_0x537799);_0x458f9c(_0x3c0b06[_0x3528('0x12')](0x1f4,_0x593e25[_0x3528('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index d9686e6..1fdb644 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 _0x5f2f=['/describe','/:id','post','create','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index'];(function(_0x35eb86,_0x45c7e1){var _0x4fa469=function(_0x226281){while(--_0x226281){_0x35eb86['push'](_0x35eb86['shift']());}};_0x4fa469(++_0x45c7e1);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5239d8,_0x393685){_0x5239d8=_0x5239d8-0x0;var _0x1b73ba=_0x5f2f[_0x5239d8];return _0x1b73ba;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var auth=require(_0xf5f2('0x6'));var interaction=require(_0xf5f2('0x7'));var config=require('../../config/environment');var controller=require('./squareReportDetail.controller');router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0xa')]);router[_0xf5f2('0x8')](_0xf5f2('0xb'),auth[_0xf5f2('0x9')](),controller['describe']);router[_0xf5f2('0x8')](_0xf5f2('0xc'),auth[_0xf5f2('0x9')](),controller['show']);router[_0xf5f2('0xd')]('/',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0xe')]);router['put'](_0xf5f2('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xf5f2('0xf')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0x10')]);module[_0xf5f2('0x11')]=router; \ No newline at end of file +var _0x7a54=['describe','/:id','create','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated'];(function(_0x2996ee,_0x3557bb){var _0x46da9b=function(_0x2d20e3){while(--_0x2d20e3){_0x2996ee['push'](_0x2996ee['shift']());}};_0x46da9b(++_0x3557bb);}(_0x7a54,0x106));var _0x47a5=function(_0x2de4bb,_0x3a61fd){_0x2de4bb=_0x2de4bb-0x0;var _0x1cc0ca=_0x7a54[_0x2de4bb];return _0x1cc0ca;};'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 de1a1ae..6ef41b7 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 _0x309e=['TEXT','STRING'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x309e,0xe5));var _0xe309=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x309e[_0x16b9ed];return _0x66b1f8;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xe309('0x0')]},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize[_0xe309('0x0')]},'data':{'type':Sequelize[_0xe309('0x1')]},'project_name':{'type':Sequelize[_0xe309('0x0')]},'callerid':{'type':Sequelize[_0xe309('0x0')]}}; \ No newline at end of file +var _0x0371=['sequelize','exports','STRING','TEXT'];(function(_0x4f4879,_0x5d85fe){var _0x17a220=function(_0x2da6a9){while(--_0x2da6a9){_0x4f4879['push'](_0x4f4879['shift']());}};_0x17a220(++_0x5d85fe);}(_0x0371,0x1e4));var _0x1037=function(_0x376db5,_0x2b8874){_0x376db5=_0x376db5-0x0;var _0x304c17=_0x0371[_0x376db5];return _0x304c17;};'use strict';var Sequelize=require(_0x1037('0x0'));module[_0x1037('0x1')]={'uniqueid':{'type':Sequelize[_0x1037('0x2')]},'node':{'type':Sequelize[_0x1037('0x2')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0x1037('0x3')]},'project_name':{'type':Sequelize[_0x1037('0x2')]},'callerid':{'type':Sequelize[_0x1037('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 3e1cd01..1c52cdf 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 _0x807d=['body','update','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','apply','save','destroy','then','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','where','VIRTUAL','filter','merge','options','SquareDetailsReport','include','findAll','catch','show','params','rawAttributes','intersection','includeAll','find','create'];(function(_0x5e204b,_0x1a67b2){var _0x576446=function(_0x1cf6d6){while(--_0x1cf6d6){_0x5e204b['push'](_0x5e204b['shift']());}};_0x576446(++_0x1a67b2);}(_0x807d,0x133));var _0xd807=function(_0x1c6f7b,_0x3ea04d){_0x1c6f7b=_0x1c6f7b-0x0;var _0x2267a8=_0x807d[_0x1c6f7b];return _0x2267a8;};'use strict';var pdf=require(_0xd807('0x0'));var emlformat=require(_0xd807('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xd807('0x2'));var jsonpatch=require(_0xd807('0x3'));var rp=require(_0xd807('0x4'));var moment=require(_0xd807('0x5'));var BPromise=require(_0xd807('0x6'));var Mustache=require(_0xd807('0x7'));var util=require(_0xd807('0x8'));var path=require(_0xd807('0x9'));var sox=require(_0xd807('0xa'));var csv=require(_0xd807('0xb'));var ejs=require(_0xd807('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd807('0xd'));var crypto=require(_0xd807('0xe'));var jsforce=require(_0xd807('0xf'));var deskjs=require(_0xd807('0x10'));var toCsv=require(_0xd807('0xb'));var querystring=require(_0xd807('0x11'));var Papa=require(_0xd807('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd807('0x13'));var as=require(_0xd807('0x14'));var hardwareService=require(_0xd807('0x15'));var logger=require(_0xd807('0x16'))(_0xd807('0x17'));var utils=require('../../config/utils');var config=require(_0xd807('0x18'));var db=require(_0xd807('0x19'))['db'];function respondWithStatusCode(_0x2b88fc,_0x217a1a){_0x217a1a=_0x217a1a||0xcc;return function(_0x24e5a0){if(_0x24e5a0){return _0x2b88fc[_0xd807('0x1a')](_0x217a1a);}return _0x2b88fc['status'](_0x217a1a)['end']();};}function respondWithResult(_0x47bb45,_0x1e94a4){_0x1e94a4=_0x1e94a4||0xc8;return function(_0x35007a){if(_0x35007a){return _0x47bb45[_0xd807('0x1b')](_0x1e94a4)[_0xd807('0x1c')](_0x35007a);}};}function respondWithFilteredResult(_0x1bba8e,_0x4458e2){return function(_0x3c2048){if(_0x3c2048){var _0x5656bd=_0x3c2048[_0xd807('0x1d')],_0x385e5d=_0x4458e2[_0xd807('0x1e')],_0x438d76=_0x4458e2['offset']+_0x4458e2[_0xd807('0x1f')],_0x3a8a77;if(_0x438d76>=_0x5656bd){_0x438d76=_0x5656bd;_0x3a8a77=0xc8;}else{_0x3a8a77=0xce;}_0x1bba8e[_0xd807('0x1b')](_0x3a8a77);return _0x1bba8e['set']('Content-Range',_0x385e5d+'-'+_0x438d76+'/'+_0x5656bd)[_0xd807('0x1c')](_0x3c2048);}return null;};}function patchUpdates(_0x4bc66c){return function(_0x59b4f7){try{jsonpatch[_0xd807('0x20')](_0x59b4f7,_0x4bc66c,!![]);}catch(_0x566237){return BPromise['reject'](_0x566237);}return _0x59b4f7[_0xd807('0x21')]();};}function saveUpdates(_0x463b06,_0x42f860){return function(_0x5702da){if(_0x5702da){return _0x5702da['update'](_0x463b06)['then'](function(_0x70eef7){return _0x70eef7;});}return null;};}function removeEntity(_0x3f9d7d,_0x33f0b0){return function(_0x421123){if(_0x421123){return _0x421123[_0xd807('0x22')]()[_0xd807('0x23')](function(){_0x3f9d7d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x539c9b,_0x1dabce){return function(_0x47c84a){if(!_0x47c84a){_0x539c9b[_0xd807('0x1a')](0x194);}return _0x47c84a;};}function handleError(_0x3b48d0,_0x14553b){_0x14553b=_0x14553b||0x1f4;return function(_0x3d711a){logger[_0xd807('0x24')](_0x3d711a[_0xd807('0x25')]);if(_0x3d711a[_0xd807('0x26')]){delete _0x3d711a[_0xd807('0x26')];}_0x3b48d0[_0xd807('0x1b')](_0x14553b)[_0xd807('0x27')](_0x3d711a);};}exports[_0xd807('0x28')]=function(_0x3132c6,_0x4bca9f){var _0x2b5995={},_0xf1efd6={},_0x3442a7={'count':0x0,'rows':[]};var _0x4776cf=_[_0xd807('0x29')](db['SquareDetailsReport']['rawAttributes'],function(_0x182a7d){return{'name':_0x182a7d[_0xd807('0x2a')],'type':_0x182a7d[_0xd807('0x2b')][_0xd807('0x2c')]};});_0xf1efd6[_0xd807('0x2d')]=_[_0xd807('0x29')](_0x4776cf,_0xd807('0x26'));_0xf1efd6[_0xd807('0x2e')]=_[_0xd807('0x2f')](_0x3132c6[_0xd807('0x2e')]);_0xf1efd6['filters']=_['intersection'](_0xf1efd6[_0xd807('0x2d')],_0xf1efd6[_0xd807('0x2e')]);_0x2b5995[_0xd807('0x30')]=_['intersection'](_0xf1efd6[_0xd807('0x2d')],qs['fields'](_0x3132c6[_0xd807('0x2e')][_0xd807('0x31')]));_0x2b5995['attributes']=_0x2b5995[_0xd807('0x30')][_0xd807('0x32')]?_0x2b5995[_0xd807('0x30')]:_0xf1efd6[_0xd807('0x2d')];if(!_0x3132c6[_0xd807('0x2e')][_0xd807('0x33')](_0xd807('0x34'))){_0x2b5995['limit']=qs[_0xd807('0x1f')](_0x3132c6[_0xd807('0x2e')][_0xd807('0x1f')]);_0x2b5995[_0xd807('0x1e')]=qs['offset'](_0x3132c6[_0xd807('0x2e')][_0xd807('0x1e')]);}_0x2b5995[_0xd807('0x35')]=qs[_0xd807('0x36')](_0x3132c6[_0xd807('0x2e')][_0xd807('0x36')]);_0x2b5995['where']=qs['filters'](_[_0xd807('0x37')](_0x3132c6[_0xd807('0x2e')],_0xf1efd6[_0xd807('0x38')]));if(_0x3132c6['query']['filter']){_0x2b5995[_0xd807('0x39')]=_['merge'](_0x2b5995[_0xd807('0x39')],{'$or':_['map'](_0x4776cf,function(_0x4c4eac){if(_0x4c4eac[_0xd807('0x2b')]!==_0xd807('0x3a')){var _0x474d86={};_0x474d86[_0x4c4eac[_0xd807('0x26')]]={'$like':'%'+_0x3132c6[_0xd807('0x2e')][_0xd807('0x3b')]+'%'};return _0x474d86;}})});}_0x2b5995=_[_0xd807('0x3c')]({},_0x2b5995,_0x3132c6[_0xd807('0x3d')]);var _0x3ddbfe={'where':_0x2b5995[_0xd807('0x39')]};return db[_0xd807('0x3e')][_0xd807('0x1d')](_0x3ddbfe)['then'](function(_0x2a3608){_0x3442a7[_0xd807('0x1d')]=_0x2a3608;if(_0x3132c6['query']['includeAll']){_0x2b5995[_0xd807('0x3f')]=[{'all':!![]}];}return db[_0xd807('0x3e')][_0xd807('0x40')](_0x2b5995);})['then'](function(_0x33323d){_0x3442a7['rows']=_0x33323d;return _0x3442a7;})[_0xd807('0x23')](respondWithFilteredResult(_0x4bca9f,_0x2b5995))[_0xd807('0x41')](handleError(_0x4bca9f,null));};exports[_0xd807('0x42')]=function(_0x4acc57,_0x3eff5f){var _0x3e4ea6={'raw':!![],'where':{'id':_0x4acc57[_0xd807('0x43')]['id']}},_0x5da786={};_0x5da786[_0xd807('0x2d')]=_[_0xd807('0x2f')](db[_0xd807('0x3e')][_0xd807('0x44')]);_0x5da786[_0xd807('0x2e')]=_[_0xd807('0x2f')](_0x4acc57['query']);_0x5da786[_0xd807('0x38')]=_[_0xd807('0x45')](_0x5da786[_0xd807('0x2d')],_0x5da786[_0xd807('0x2e')]);_0x3e4ea6[_0xd807('0x30')]=_[_0xd807('0x45')](_0x5da786[_0xd807('0x2d')],qs[_0xd807('0x31')](_0x4acc57[_0xd807('0x2e')][_0xd807('0x31')]));_0x3e4ea6[_0xd807('0x30')]=_0x3e4ea6[_0xd807('0x30')]['length']?_0x3e4ea6[_0xd807('0x30')]:_0x5da786[_0xd807('0x2d')];if(_0x4acc57['query'][_0xd807('0x46')]){_0x3e4ea6[_0xd807('0x3f')]=[{'all':!![]}];}_0x3e4ea6=_[_0xd807('0x3c')]({},_0x3e4ea6,_0x4acc57[_0xd807('0x3d')]);return db[_0xd807('0x3e')][_0xd807('0x47')](_0x3e4ea6)[_0xd807('0x23')](handleEntityNotFound(_0x3eff5f,null))[_0xd807('0x23')](respondWithResult(_0x3eff5f,null))[_0xd807('0x41')](handleError(_0x3eff5f,null));};exports[_0xd807('0x48')]=function(_0x38c68b,_0x33e2a1){return db['SquareDetailsReport'][_0xd807('0x48')](_0x38c68b[_0xd807('0x49')],{})[_0xd807('0x23')](respondWithResult(_0x33e2a1,0xc9))[_0xd807('0x41')](handleError(_0x33e2a1,null));};exports[_0xd807('0x4a')]=function(_0x2109c8,_0x48a1eb){if(_0x2109c8[_0xd807('0x49')]['id']){delete _0x2109c8[_0xd807('0x49')]['id'];}return db[_0xd807('0x3e')]['find']({'where':{'id':_0x2109c8['params']['id']}})[_0xd807('0x23')](handleEntityNotFound(_0x48a1eb,null))['then'](saveUpdates(_0x2109c8[_0xd807('0x49')],null))[_0xd807('0x23')](respondWithResult(_0x48a1eb,null))['catch'](handleError(_0x48a1eb,null));};exports[_0xd807('0x22')]=function(_0x356826,_0x65c3f8){return db[_0xd807('0x3e')][_0xd807('0x47')]({'where':{'id':_0x356826['params']['id']}})[_0xd807('0x23')](handleEntityNotFound(_0x65c3f8,null))[_0xd807('0x23')](removeEntity(_0x65c3f8,null))['catch'](handleError(_0x65c3f8,null));};exports[_0xd807('0x4b')]=function(_0x178cc1,_0x73a6c2){return db[_0xd807('0x3e')][_0xd807('0x4b')]()[_0xd807('0x23')](respondWithResult(_0x73a6c2,null))[_0xd807('0x41')](handleError(_0x73a6c2,null));}; \ No newline at end of file +var _0x3dc9=['params','find','create','update','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','count','offset','limit','status','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','merge','options','SquareDetailsReport','includeAll','include','rows','catch'];(function(_0x5b3499,_0x21896c){var _0x44c2d7=function(_0x5eb637){while(--_0x5eb637){_0x5b3499['push'](_0x5b3499['shift']());}};_0x44c2d7(++_0x21896c);}(_0x3dc9,0x164));var _0x93dc=function(_0x5538e6,_0xc453c6){_0x5538e6=_0x5538e6-0x0;var _0x2a5bae=_0x3dc9[_0x5538e6];return _0x2a5bae;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x93dc('0x0'));var zipdir=require(_0x93dc('0x1'));var jsonpatch=require(_0x93dc('0x2'));var rp=require(_0x93dc('0x3'));var moment=require(_0x93dc('0x4'));var BPromise=require(_0x93dc('0x5'));var Mustache=require(_0x93dc('0x6'));var util=require(_0x93dc('0x7'));var path=require(_0x93dc('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x93dc('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x93dc('0xa'));var jsforce=require(_0x93dc('0xb'));var deskjs=require(_0x93dc('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x93dc('0xd'));var Redis=require(_0x93dc('0xe'));var authService=require(_0x93dc('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x93dc('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x93dc('0x11'))('api');var utils=require(_0x93dc('0x12'));var config=require(_0x93dc('0x13'));var db=require(_0x93dc('0x14'))['db'];function respondWithStatusCode(_0x1ae291,_0x509ea9){_0x509ea9=_0x509ea9||0xcc;return function(_0x23832a){if(_0x23832a){return _0x1ae291[_0x93dc('0x15')](_0x509ea9);}return _0x1ae291['status'](_0x509ea9)[_0x93dc('0x16')]();};}function respondWithResult(_0x18b798,_0x497822){_0x497822=_0x497822||0xc8;return function(_0x3617aa){if(_0x3617aa){return _0x18b798['status'](_0x497822)['json'](_0x3617aa);}};}function respondWithFilteredResult(_0x10ef5d,_0x2c4785){return function(_0x55343c){if(_0x55343c){var _0x3312c1=_0x55343c[_0x93dc('0x17')],_0x453c12=_0x2c4785[_0x93dc('0x18')],_0x248fda=_0x2c4785[_0x93dc('0x18')]+_0x2c4785[_0x93dc('0x19')],_0x1577a6;if(_0x248fda>=_0x3312c1){_0x248fda=_0x3312c1;_0x1577a6=0xc8;}else{_0x1577a6=0xce;}_0x10ef5d[_0x93dc('0x1a')](_0x1577a6);return _0x10ef5d['set'](_0x93dc('0x1b'),_0x453c12+'-'+_0x248fda+'/'+_0x3312c1)[_0x93dc('0x1c')](_0x55343c);}return null;};}function patchUpdates(_0x2b4a0e){return function(_0x11c95e){try{jsonpatch[_0x93dc('0x1d')](_0x11c95e,_0x2b4a0e,!![]);}catch(_0x4a5dc5){return BPromise[_0x93dc('0x1e')](_0x4a5dc5);}return _0x11c95e[_0x93dc('0x1f')]();};}function saveUpdates(_0x39cb81,_0x347582){return function(_0x342496){if(_0x342496){return _0x342496['update'](_0x39cb81)[_0x93dc('0x20')](function(_0x844240){return _0x844240;});}return null;};}function removeEntity(_0x8a79ce,_0x196ead){return function(_0x5d0aa1){if(_0x5d0aa1){return _0x5d0aa1[_0x93dc('0x21')]()['then'](function(){_0x8a79ce[_0x93dc('0x1a')](0xcc)[_0x93dc('0x16')]();});}};}function handleEntityNotFound(_0x2427ab,_0x90bf26){return function(_0x222a81){if(!_0x222a81){_0x2427ab[_0x93dc('0x15')](0x194);}return _0x222a81;};}function handleError(_0x274993,_0x552e24){_0x552e24=_0x552e24||0x1f4;return function(_0x344168){logger[_0x93dc('0x22')](_0x344168[_0x93dc('0x23')]);if(_0x344168[_0x93dc('0x24')]){delete _0x344168[_0x93dc('0x24')];}_0x274993[_0x93dc('0x1a')](_0x552e24)[_0x93dc('0x25')](_0x344168);};}exports[_0x93dc('0x26')]=function(_0x3b873b,_0x4a1b10){var _0x20305b={},_0x4bb295={},_0x496f3e={'count':0x0,'rows':[]};var _0xa61e9d=_['map'](db['SquareDetailsReport'][_0x93dc('0x27')],function(_0x320261){return{'name':_0x320261[_0x93dc('0x28')],'type':_0x320261[_0x93dc('0x29')][_0x93dc('0x2a')]};});_0x4bb295[_0x93dc('0x2b')]=_[_0x93dc('0x2c')](_0xa61e9d,'name');_0x4bb295['query']=_[_0x93dc('0x2d')](_0x3b873b[_0x93dc('0x2e')]);_0x4bb295[_0x93dc('0x2f')]=_[_0x93dc('0x30')](_0x4bb295['model'],_0x4bb295[_0x93dc('0x2e')]);_0x20305b[_0x93dc('0x31')]=_[_0x93dc('0x30')](_0x4bb295[_0x93dc('0x2b')],qs['fields'](_0x3b873b[_0x93dc('0x2e')][_0x93dc('0x32')]));_0x20305b['attributes']=_0x20305b[_0x93dc('0x31')][_0x93dc('0x33')]?_0x20305b[_0x93dc('0x31')]:_0x4bb295[_0x93dc('0x2b')];if(!_0x3b873b[_0x93dc('0x2e')][_0x93dc('0x34')]('nolimit')){_0x20305b[_0x93dc('0x19')]=qs[_0x93dc('0x19')](_0x3b873b[_0x93dc('0x2e')][_0x93dc('0x19')]);_0x20305b[_0x93dc('0x18')]=qs[_0x93dc('0x18')](_0x3b873b[_0x93dc('0x2e')][_0x93dc('0x18')]);}_0x20305b[_0x93dc('0x35')]=qs[_0x93dc('0x36')](_0x3b873b[_0x93dc('0x2e')][_0x93dc('0x36')]);_0x20305b['where']=qs[_0x93dc('0x2f')](_[_0x93dc('0x37')](_0x3b873b[_0x93dc('0x2e')],_0x4bb295[_0x93dc('0x2f')]));if(_0x3b873b[_0x93dc('0x2e')][_0x93dc('0x38')]){_0x20305b['where']=_[_0x93dc('0x39')](_0x20305b['where'],{'$or':_[_0x93dc('0x2c')](_0xa61e9d,function(_0x32a7c1){if(_0x32a7c1['type']!=='VIRTUAL'){var _0x424829={};_0x424829[_0x32a7c1[_0x93dc('0x24')]]={'$like':'%'+_0x3b873b[_0x93dc('0x2e')][_0x93dc('0x38')]+'%'};return _0x424829;}})});}_0x20305b=_[_0x93dc('0x39')]({},_0x20305b,_0x3b873b[_0x93dc('0x3a')]);var _0x33e6f7={'where':_0x20305b['where']};return db[_0x93dc('0x3b')][_0x93dc('0x17')](_0x33e6f7)[_0x93dc('0x20')](function(_0x37d8fb){_0x496f3e[_0x93dc('0x17')]=_0x37d8fb;if(_0x3b873b[_0x93dc('0x2e')][_0x93dc('0x3c')]){_0x20305b[_0x93dc('0x3d')]=[{'all':!![]}];}return db[_0x93dc('0x3b')]['findAll'](_0x20305b);})['then'](function(_0x2a4c3f){_0x496f3e[_0x93dc('0x3e')]=_0x2a4c3f;return _0x496f3e;})[_0x93dc('0x20')](respondWithFilteredResult(_0x4a1b10,_0x20305b))[_0x93dc('0x3f')](handleError(_0x4a1b10,null));};exports['show']=function(_0x391810,_0xa66198){var _0x118707={'raw':!![],'where':{'id':_0x391810[_0x93dc('0x40')]['id']}},_0x4f6a1e={};_0x4f6a1e[_0x93dc('0x2b')]=_['keys'](db[_0x93dc('0x3b')][_0x93dc('0x27')]);_0x4f6a1e[_0x93dc('0x2e')]=_[_0x93dc('0x2d')](_0x391810['query']);_0x4f6a1e[_0x93dc('0x2f')]=_[_0x93dc('0x30')](_0x4f6a1e[_0x93dc('0x2b')],_0x4f6a1e[_0x93dc('0x2e')]);_0x118707[_0x93dc('0x31')]=_[_0x93dc('0x30')](_0x4f6a1e[_0x93dc('0x2b')],qs[_0x93dc('0x32')](_0x391810[_0x93dc('0x2e')]['fields']));_0x118707[_0x93dc('0x31')]=_0x118707[_0x93dc('0x31')]['length']?_0x118707[_0x93dc('0x31')]:_0x4f6a1e[_0x93dc('0x2b')];if(_0x391810[_0x93dc('0x2e')][_0x93dc('0x3c')]){_0x118707[_0x93dc('0x3d')]=[{'all':!![]}];}_0x118707=_[_0x93dc('0x39')]({},_0x118707,_0x391810[_0x93dc('0x3a')]);return db[_0x93dc('0x3b')][_0x93dc('0x41')](_0x118707)[_0x93dc('0x20')](handleEntityNotFound(_0xa66198,null))['then'](respondWithResult(_0xa66198,null))['catch'](handleError(_0xa66198,null));};exports[_0x93dc('0x42')]=function(_0x3e46bc,_0x2219b){return db[_0x93dc('0x3b')]['create'](_0x3e46bc['body'],{})[_0x93dc('0x20')](respondWithResult(_0x2219b,0xc9))[_0x93dc('0x3f')](handleError(_0x2219b,null));};exports[_0x93dc('0x43')]=function(_0x57a423,_0x53dcba){if(_0x57a423['body']['id']){delete _0x57a423['body']['id'];}return db[_0x93dc('0x3b')]['find']({'where':{'id':_0x57a423[_0x93dc('0x40')]['id']}})[_0x93dc('0x20')](handleEntityNotFound(_0x53dcba,null))[_0x93dc('0x20')](saveUpdates(_0x57a423[_0x93dc('0x44')],null))[_0x93dc('0x20')](respondWithResult(_0x53dcba,null))['catch'](handleError(_0x53dcba,null));};exports[_0x93dc('0x21')]=function(_0xea1da2,_0x206585){return db['SquareDetailsReport'][_0x93dc('0x41')]({'where':{'id':_0xea1da2[_0x93dc('0x40')]['id']}})[_0x93dc('0x20')](handleEntityNotFound(_0x206585,null))[_0x93dc('0x20')](removeEntity(_0x206585,null))[_0x93dc('0x3f')](handleError(_0x206585,null));};exports[_0x93dc('0x45')]=function(_0x2dcac3,_0x18f58c){return db['SquareDetailsReport']['describe']()[_0x93dc('0x20')](respondWithResult(_0x18f58c,null))[_0x93dc('0x3f')](handleError(_0x18f58c,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 47c7236..47ad757 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 _0x4a42=['../../config/environment','./squareReportDetail.attributes','exports','define','SquareDetailsReport','report_square_details','lodash','util','../../config/logger','api','request-promise','path','rimraf'];(function(_0x2f77b6,_0xc0a2f2){var _0x54864b=function(_0x2f0c5b){while(--_0x2f0c5b){_0x2f77b6['push'](_0x2f77b6['shift']());}};_0x54864b(++_0xc0a2f2);}(_0x4a42,0x158));var _0x24a4=function(_0x40107b,_0x2127a0){_0x40107b=_0x40107b-0x0;var _0x45e780=_0x4a42[_0x40107b];return _0x45e780;};'use strict';var _=require(_0x24a4('0x0'));var util=require(_0x24a4('0x1'));var logger=require(_0x24a4('0x2'))(_0x24a4('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x24a4('0x4'));var fs=require('fs');var path=require(_0x24a4('0x5'));var rimraf=require(_0x24a4('0x6'));var config=require(_0x24a4('0x7'));var attributes=require(_0x24a4('0x8'));module[_0x24a4('0x9')]=function(_0x22c4c2,_0x55f8cb){return _0x22c4c2[_0x24a4('0xa')](_0x24a4('0xb'),attributes,{'tableName':_0x24a4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6e9b=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./squareReportDetail.attributes','exports','define','SquareDetailsReport','report_square_details'];(function(_0x341ce6,_0x45a2d8){var _0x5c0f0a=function(_0x39a7e5){while(--_0x39a7e5){_0x341ce6['push'](_0x341ce6['shift']());}};_0x5c0f0a(++_0x45a2d8);}(_0x6e9b,0xea));var _0xb6e9=function(_0x53083f,_0x516a89){_0x53083f=_0x53083f-0x0;var _0x5c9640=_0x6e9b[_0x53083f];return _0x5c9640;};'use strict';var _=require(_0xb6e9('0x0'));var util=require(_0xb6e9('0x1'));var logger=require(_0xb6e9('0x2'))(_0xb6e9('0x3'));var moment=require(_0xb6e9('0x4'));var BPromise=require('bluebird');var rp=require(_0xb6e9('0x5'));var fs=require('fs');var path=require(_0xb6e9('0x6'));var rimraf=require(_0xb6e9('0x7'));var config=require('../../config/environment');var attributes=require(_0xb6e9('0x8'));module[_0xb6e9('0x9')]=function(_0x2bdfb8,_0x6b0286){return _0x2bdfb8[_0xb6e9('0xa')](_0xb6e9('0xb'),attributes,{'tableName':_0xb6e9('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 7c9ec0b..60d3351 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 _0x5f09=['result','CreateSquareDetailsReport','create','body','options','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x5f09,0x145));var _0x95f0=function(_0x3d839a,_0x2f6ff9){_0x3d839a=_0x3d839a-0x0;var _0x136e1a=_0x5f09[_0x3d839a];return _0x136e1a;};'use strict';var _=require(_0x95f0('0x0'));var util=require('util');var moment=require(_0x95f0('0x1'));var BPromise=require('bluebird');var rs=require(_0x95f0('0x2'));var fs=require('fs');var Redis=require(_0x95f0('0x3'));var db=require(_0x95f0('0x4'))['db'];var utils=require(_0x95f0('0x5'));var logger=require(_0x95f0('0x6'))(_0x95f0('0x7'));var config=require(_0x95f0('0x8'));var jayson=require(_0x95f0('0x9'));var client=jayson[_0x95f0('0xa')][_0x95f0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4c0258,_0x47df34,_0x13c5f7){return new BPromise(function(_0x46d0a5,_0x305a86){return client[_0x95f0('0xc')](_0x4c0258,_0x13c5f7)[_0x95f0('0xd')](function(_0x3d85fa){logger['info'](_0x95f0('0xe'),_0x47df34,_0x95f0('0xf'));logger[_0x95f0('0x10')](_0x95f0('0x11'),_0x47df34,_0x95f0('0xf'),JSON[_0x95f0('0x12')](_0x3d85fa));if(_0x3d85fa[_0x95f0('0x13')]){if(_0x3d85fa[_0x95f0('0x13')][_0x95f0('0x14')]===0x1f4){logger['error'](_0x95f0('0xe'),_0x47df34,_0x3d85fa[_0x95f0('0x13')][_0x95f0('0x15')]);return _0x305a86(_0x3d85fa['error']['message']);}logger['error'](_0x95f0('0xe'),_0x47df34,_0x3d85fa[_0x95f0('0x13')][_0x95f0('0x15')]);return _0x46d0a5(_0x3d85fa[_0x95f0('0x13')][_0x95f0('0x15')]);}else{logger[_0x95f0('0x16')](_0x95f0('0xe'),_0x47df34,_0x95f0('0xf'));_0x46d0a5(_0x3d85fa[_0x95f0('0x17')][_0x95f0('0x15')]);}})['catch'](function(_0x49aaaa){logger[_0x95f0('0x13')](_0x95f0('0xe'),_0x47df34,_0x49aaaa);_0x305a86(_0x49aaaa);});});}exports[_0x95f0('0x18')]=function(_0x22ac8d){var _0x23a5cb=this;return new Promise(function(_0x243b2e,_0x2d3804){return db['SquareDetailsReport'][_0x95f0('0x19')](_0x22ac8d[_0x95f0('0x1a')],{'raw':_0x22ac8d[_0x95f0('0x1b')]?_0x22ac8d[_0x95f0('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x95f0('0xd')](function(_0x2472e2){logger[_0x95f0('0x16')]('CreateSquareDetailsReport',_0x22ac8d);logger[_0x95f0('0x10')](_0x95f0('0x18'),_0x22ac8d,JSON[_0x95f0('0x12')](_0x2472e2));_0x243b2e(_0x2472e2);})[_0x95f0('0x1c')](function(_0x40cd3e){logger[_0x95f0('0x13')]('CreateSquareDetailsReport',_0x40cd3e[_0x95f0('0x15')],_0x22ac8d);_0x2d3804(_0x23a5cb['error'](0x1f4,_0x40cd3e[_0x95f0('0x15')]));});});}; \ No newline at end of file +var _0xb054=['moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareDetailsReport,\x20%s,\x20%s','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','lodash'];(function(_0x13cf18,_0x21fb57){var _0x16e39e=function(_0x2cd395){while(--_0x2cd395){_0x13cf18['push'](_0x13cf18['shift']());}};_0x16e39e(++_0x21fb57);}(_0xb054,0x1bf));var _0x4b05=function(_0x3c7152,_0x302b29){_0x3c7152=_0x3c7152-0x0;var _0x43aea5=_0xb054[_0x3c7152];return _0x43aea5;};'use strict';var _=require(_0x4b05('0x0'));var util=require('util');var moment=require(_0x4b05('0x1'));var BPromise=require('bluebird');var rs=require(_0x4b05('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4b05('0x3'))['db'];var utils=require(_0x4b05('0x4'));var logger=require('../../config/logger')(_0x4b05('0x5'));var config=require(_0x4b05('0x6'));var jayson=require(_0x4b05('0x7'));var client=jayson[_0x4b05('0x8')][_0x4b05('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x451b15,_0x1ecfec,_0x8a3f41){return new BPromise(function(_0x2ff518,_0x4c0575){return client[_0x4b05('0xa')](_0x451b15,_0x8a3f41)[_0x4b05('0xb')](function(_0x2caa51){logger[_0x4b05('0xc')](_0x4b05('0xd'),_0x1ecfec,'request\x20sent');logger[_0x4b05('0xe')](_0x4b05('0xf'),_0x1ecfec,_0x4b05('0x10'),JSON[_0x4b05('0x11')](_0x2caa51));if(_0x2caa51[_0x4b05('0x12')]){if(_0x2caa51['error'][_0x4b05('0x13')]===0x1f4){logger[_0x4b05('0x12')](_0x4b05('0xd'),_0x1ecfec,_0x2caa51['error'][_0x4b05('0x14')]);return _0x4c0575(_0x2caa51[_0x4b05('0x12')][_0x4b05('0x14')]);}logger['error']('SquareDetailsReport,\x20%s,\x20%s',_0x1ecfec,_0x2caa51[_0x4b05('0x12')][_0x4b05('0x14')]);return _0x2ff518(_0x2caa51['error'][_0x4b05('0x14')]);}else{logger[_0x4b05('0xc')]('SquareDetailsReport,\x20%s,\x20%s',_0x1ecfec,_0x4b05('0x10'));_0x2ff518(_0x2caa51[_0x4b05('0x15')]['message']);}})['catch'](function(_0xb3e428){logger['error'](_0x4b05('0xd'),_0x1ecfec,_0xb3e428);_0x4c0575(_0xb3e428);});});}exports[_0x4b05('0x16')]=function(_0x28334a){var _0x22119d=this;return new Promise(function(_0x2bdd30,_0x132f15){return db[_0x4b05('0x17')][_0x4b05('0x18')](_0x28334a[_0x4b05('0x19')],{'raw':_0x28334a[_0x4b05('0x1a')]?_0x28334a[_0x4b05('0x1a')][_0x4b05('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x2dbd5f){logger[_0x4b05('0xc')](_0x4b05('0x16'),_0x28334a);logger[_0x4b05('0xe')]('CreateSquareDetailsReport',_0x28334a,JSON[_0x4b05('0x11')](_0x2dbd5f));_0x2bdd30(_0x2dbd5f);})['catch'](function(_0xa0415b){logger[_0x4b05('0x12')]('CreateSquareDetailsReport',_0xa0415b[_0x4b05('0x14')],_0x28334a);_0x132f15(_0x22119d[_0x4b05('0x12')](0x1f4,_0xa0415b[_0x4b05('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 9bea039..f237b04 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 _0x7e22=['isAuthenticated','index','exports','express','../../components/auth/service','./system.controller','get'];(function(_0x47320b,_0xda39dd){var _0x19ba71=function(_0x2bf322){while(--_0x2bf322){_0x47320b['push'](_0x47320b['shift']());}};_0x19ba71(++_0xda39dd);}(_0x7e22,0x1d8));var _0x27e2=function(_0x1bfc07,_0x52e1df){_0x1bfc07=_0x1bfc07-0x0;var _0x29a97f=_0x7e22[_0x1bfc07];return _0x29a97f;};'use strict';var express=require(_0x27e2('0x0'));var router=express['Router']();var auth=require(_0x27e2('0x1'));var controller=require(_0x27e2('0x2'));router[_0x27e2('0x3')]('/',auth[_0x27e2('0x4')](),controller[_0x27e2('0x5')]);router[_0x27e2('0x3')]('/process/:pid/kill',auth[_0x27e2('0x4')](),controller['killProcess']);module[_0x27e2('0x6')]=router; \ No newline at end of file +var _0x8b35=['express','Router','../../components/auth/service','./system.controller','get','index','/process/:pid/kill','isAuthenticated','killProcess'];(function(_0x5779c0,_0x42733a){var _0x5aa913=function(_0x469c4e){while(--_0x469c4e){_0x5779c0['push'](_0x5779c0['shift']());}};_0x5aa913(++_0x42733a);}(_0x8b35,0x17a));var _0x58b3=function(_0x5ee74e,_0x83006f){_0x5ee74e=_0x5ee74e-0x0;var _0x555319=_0x8b35[_0x5ee74e];return _0x555319;};'use strict';var express=require(_0x58b3('0x0'));var router=express[_0x58b3('0x1')]();var auth=require(_0x58b3('0x2'));var controller=require(_0x58b3('0x3'));router[_0x58b3('0x4')]('/',auth['isAuthenticated'](),controller[_0x58b3('0x5')]);router[_0x58b3('0x4')](_0x58b3('0x6'),auth[_0x58b3('0x7')](),controller[_0x58b3('0x8')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 3d0cfa9..ceab53d 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 _0x8f85=['systeminformation','child_process','../../config/logger','bluebird','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','status','send','getAllData','then','catch','json','killProcess','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','length','format','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly'];(function(_0xd852b3,_0x5f477f){var _0x457b7c=function(_0x4296d8){while(--_0x4296d8){_0xd852b3['push'](_0xd852b3['shift']());}};_0x457b7c(++_0x5f477f);}(_0x8f85,0x1b5));var _0x58f8=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x8f85[_0x2641f9];return _0x585741;};'use strict';var info=require(_0x58f8('0x0'));var exec=require(_0x58f8('0x1'))['exec'];var logger=require(_0x58f8('0x2'))('api');var util=require('util');var BPromise=require(_0x58f8('0x3'));var _=require('lodash');function handleError(_0x1c847e,_0x1d9562,_0x1b8d0e){_0x1d9562=_0x1d9562||0x1f4;return function(_0x3e1299){logger[_0x58f8('0x4')](_0x58f8('0x5'),_0x1b8d0e,_0x1d9562,util[_0x58f8('0x6')](_0x3e1299,{'showHidden':![],'depth':null}));delete _0x3e1299['name'];_0x1c847e[_0x58f8('0x7')](_0x1d9562)[_0x58f8('0x8')](_0x3e1299);};}exports['index']=function(_0x26d730,_0x45d1f8){return info[_0x58f8('0x9')]()[_0x58f8('0xa')](function(_0x4ef018){return _0x45d1f8[_0x58f8('0x7')](0xc8)['json'](_0x4ef018);})[_0x58f8('0xb')](function(_0x3e70a6){return _0x45d1f8[_0x58f8('0x7')](0x1f4)[_0x58f8('0xc')](_0x3e70a6);});};exports[_0x58f8('0xd')]=function(_0xf1f6dd,_0x3de4c1){var _0x449cca=['components/import/cm'];return new BPromise(function(_0x204933,_0x139912){return exec(util['format'](_0x58f8('0xe'),_0xf1f6dd[_0x58f8('0xf')][_0x58f8('0x10')]),function(_0xd7cec,_0x4046e5,_0x1edba6){if(_0xd7cec){return _0x139912(_0xd7cec);}return _0x204933(_0x4046e5);});})['then'](function(_0x28bdcd){var _0x11a2b8=![];var _0x114327=_0x28bdcd[_0x58f8('0x11')](/\n/);for(var _0x40f680=0x0,_0x57a0a4=_0x449cca[_0x58f8('0x12')];_0x40f680<_0x57a0a4,_0x11a2b8===![];_0x40f680+=0x1){if(_0x28bdcd['indexOf'](_0x449cca[_0x40f680])>=0x0){_0x11a2b8=!![];}}if(!_0x11a2b8){throw new Error(util[_0x58f8('0x13')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0xf1f6dd[_0x58f8('0xf')][_0x58f8('0x10')]));}process[_0x58f8('0x14')](_0xf1f6dd['params'][_0x58f8('0x10')],_0x58f8('0x15'));return _0x3de4c1[_0x58f8('0x7')](0xc8)['json']({'message':util['format'](_0x58f8('0x16'),_0xf1f6dd[_0x58f8('0xf')]['pid'])});})['catch'](handleError(_0x3de4c1,null,'killProcess'));}; \ No newline at end of file +var _0x516a=['status','send','index','then','json','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','catch','killProcess','systeminformation','child_process','exec','../../config/logger','api','util','bluebird','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x516a,0xb3));var _0xa516=function(_0x468585,_0x561a6b){_0x468585=_0x468585-0x0;var _0x10b403=_0x516a[_0x468585];return _0x10b403;};'use strict';var info=require(_0xa516('0x0'));var exec=require(_0xa516('0x1'))[_0xa516('0x2')];var logger=require(_0xa516('0x3'))(_0xa516('0x4'));var util=require(_0xa516('0x5'));var BPromise=require(_0xa516('0x6'));var _=require('lodash');function handleError(_0x3aba37,_0x5c8e67,_0x410cd1){_0x5c8e67=_0x5c8e67||0x1f4;return function(_0x588f69){logger[_0xa516('0x7')](_0xa516('0x8'),_0x410cd1,_0x5c8e67,util[_0xa516('0x9')](_0x588f69,{'showHidden':![],'depth':null}));delete _0x588f69['name'];_0x3aba37[_0xa516('0xa')](_0x5c8e67)[_0xa516('0xb')](_0x588f69);};}exports[_0xa516('0xc')]=function(_0x330975,_0x1e833e){return info['getAllData']()[_0xa516('0xd')](function(_0x48aeea){return _0x1e833e['status'](0xc8)[_0xa516('0xe')](_0x48aeea);})['catch'](function(_0x51bac0){return _0x1e833e['status'](0x1f4)[_0xa516('0xe')](_0x51bac0);});};exports['killProcess']=function(_0x40eb90,_0x2a98cc){var _0x41e128=[_0xa516('0xf')];return new BPromise(function(_0x1f9489,_0x39a4a7){return exec(util[_0xa516('0x10')](_0xa516('0x11'),_0x40eb90[_0xa516('0x12')][_0xa516('0x13')]),function(_0x39a4c6,_0x50dd28,_0x35a279){if(_0x39a4c6){return _0x39a4a7(_0x39a4c6);}return _0x1f9489(_0x50dd28);});})['then'](function(_0x27487f){var _0x4c8910=![];var _0x531788=_0x27487f[_0xa516('0x14')](/\n/);for(var _0x2689b4=0x0,_0x3fe18f=_0x41e128['length'];_0x2689b4<_0x3fe18f,_0x4c8910===![];_0x2689b4+=0x1){if(_0x27487f[_0xa516('0x15')](_0x41e128[_0x2689b4])>=0x0){_0x4c8910=!![];}}if(!_0x4c8910){throw new Error(util[_0xa516('0x10')](_0xa516('0x16'),_0x40eb90[_0xa516('0x12')][_0xa516('0x13')]));}process[_0xa516('0x17')](_0x40eb90[_0xa516('0x12')]['pid'],_0xa516('0x18'));return _0x2a98cc['status'](0xc8)[_0xa516('0xe')]({'message':util[_0xa516('0x10')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x40eb90[_0xa516('0x12')][_0xa516('0x13')])});})[_0xa516('0x19')](handleError(_0x2a98cc,null,_0xa516('0x1a')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 649c677..c0097bf 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 _0x2dae=['put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./tag.controller','get','isAuthenticated','/:id','show','post','create'];(function(_0xfbc9be,_0x3ba158){var _0x3862b6=function(_0x5b84c5){while(--_0x5b84c5){_0xfbc9be['push'](_0xfbc9be['shift']());}};_0x3862b6(++_0x3ba158);}(_0x2dae,0xc3));var _0xe2da=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x2dae[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0xe2da('0x0'));var util=require('util');var path=require(_0xe2da('0x1'));var timeout=require(_0xe2da('0x2'));var express=require(_0xe2da('0x3'));var router=express[_0xe2da('0x4')]();var auth=require(_0xe2da('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe2da('0x6'));var controller=require(_0xe2da('0x7'));router[_0xe2da('0x8')]('/',auth[_0xe2da('0x9')](),controller['index']);router[_0xe2da('0x8')](_0xe2da('0xa'),auth[_0xe2da('0x9')](),controller[_0xe2da('0xb')]);router[_0xe2da('0xc')]('/',auth[_0xe2da('0x9')](),controller[_0xe2da('0xd')]);router[_0xe2da('0xe')](_0xe2da('0xa'),auth['isAuthenticated'](),controller[_0xe2da('0xf')]);router[_0xe2da('0x10')](_0xe2da('0xa'),auth[_0xe2da('0x9')](),controller[_0xe2da('0x11')]);module[_0xe2da('0x12')]=router; \ No newline at end of file +var _0xf4eb=['../../config/environment','./tag.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','exports','multer','Router'];(function(_0xbe9394,_0x4b0110){var _0x15b5f4=function(_0x4fe2e4){while(--_0x4fe2e4){_0xbe9394['push'](_0xbe9394['shift']());}};_0x15b5f4(++_0x4b0110);}(_0xf4eb,0xec));var _0xbf4e=function(_0x59c4e7,_0x2e2fc9){_0x59c4e7=_0x59c4e7-0x0;var _0x503c3d=_0xf4eb[_0x59c4e7];return _0x503c3d;};'use strict';var multer=require(_0xbf4e('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbf4e('0x1')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xbf4e('0x2'));var controller=require(_0xbf4e('0x3'));router[_0xbf4e('0x4')]('/',auth[_0xbf4e('0x5')](),controller[_0xbf4e('0x6')]);router[_0xbf4e('0x4')](_0xbf4e('0x7'),auth['isAuthenticated'](),controller[_0xbf4e('0x8')]);router['post']('/',auth['isAuthenticated'](),controller[_0xbf4e('0x9')]);router[_0xbf4e('0xa')](_0xbf4e('0x7'),auth[_0xbf4e('0x5')](),controller[_0xbf4e('0xb')]);router[_0xbf4e('0xc')](_0xbf4e('0x7'),auth['isAuthenticated'](),controller['destroy']);module[_0xbf4e('0xd')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 78a7cc7..87556a8 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 _0xea28=['exports','STRING','name','#0091EA','sequelize'];(function(_0x25aa75,_0x4a0cc0){var _0x29cd29=function(_0xf8093f){while(--_0xf8093f){_0x25aa75['push'](_0x25aa75['shift']());}};_0x29cd29(++_0x4a0cc0);}(_0xea28,0x13a));var _0x8ea2=function(_0x4040af,_0x45c288){_0x4040af=_0x4040af-0x0;var _0x4536b6=_0xea28[_0x4040af];return _0x4536b6;};'use strict';var Sequelize=require(_0x8ea2('0x0'));module[_0x8ea2('0x1')]={'name':{'type':Sequelize[_0x8ea2('0x2')],'unique':_0x8ea2('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x8ea2('0x2')],'defaultValue':_0x8ea2('0x4')},'description':{'type':Sequelize[_0x8ea2('0x2')]}}; \ No newline at end of file +var _0x7916=['sequelize','STRING','name','#0091EA'];(function(_0x599d7f,_0xc586e8){var _0x3346d3=function(_0x56b820){while(--_0x56b820){_0x599d7f['push'](_0x599d7f['shift']());}};_0x3346d3(++_0xc586e8);}(_0x7916,0x128));var _0x6791=function(_0x37c665,_0x433805){_0x37c665=_0x37c665-0x0;var _0x1dab68=_0x7916[_0x37c665];return _0x1dab68;};'use strict';var Sequelize=require(_0x6791('0x0'));module['exports']={'name':{'type':Sequelize[_0x6791('0x1')],'unique':_0x6791('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':_0x6791('0x3')},'description':{'type':Sequelize[_0x6791('0x1')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 6ee195f..bbd741a 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 _0x9b86=['apply','save','update','destroy','then','Tags','error','name','send','index','map','Tag','type','key','model','query','filters','intersection','attributes','fields','length','order','sort','filter','where','merge','VIRTUAL','options','count','include','rows','catch','params','keys','includeAll','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','zip-dir','fast-json-patch','request-promise','bluebird','sox','to-csv','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range'];(function(_0x503162,_0x25ea26){var _0x23495d=function(_0x16193b){while(--_0x16193b){_0x503162['push'](_0x503162['shift']());}};_0x23495d(++_0x25ea26);}(_0x9b86,0x1dd));var _0x69b8=function(_0x1d9500,_0x515539){_0x1d9500=_0x1d9500-0x0;var _0x1f5190=_0x9b86[_0x1d9500];return _0x1f5190;};'use strict';var pdf=require(_0x69b8('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x69b8('0x1'));var jsonpatch=require(_0x69b8('0x2'));var rp=require(_0x69b8('0x3'));var moment=require('moment');var BPromise=require(_0x69b8('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x69b8('0x5'));var csv=require(_0x69b8('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x69b8('0x7'));var squel=require(_0x69b8('0x8'));var crypto=require(_0x69b8('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x69b8('0xa'));var toCsv=require(_0x69b8('0x6'));var querystring=require(_0x69b8('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x69b8('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x69b8('0xd'));var hardwareService=require(_0x69b8('0xe'));var logger=require(_0x69b8('0xf'))(_0x69b8('0x10'));var utils=require('../../config/utils');var config=require(_0x69b8('0x11'));var db=require(_0x69b8('0x12'))['db'];function respondWithStatusCode(_0x27f88d,_0x54aa3c){_0x54aa3c=_0x54aa3c||0xcc;return function(_0x4fbc61){if(_0x4fbc61){return _0x27f88d[_0x69b8('0x13')](_0x54aa3c);}return _0x27f88d[_0x69b8('0x14')](_0x54aa3c)[_0x69b8('0x15')]();};}function respondWithResult(_0x2ae538,_0x4c1e21){_0x4c1e21=_0x4c1e21||0xc8;return function(_0x401e35){if(_0x401e35){return _0x2ae538[_0x69b8('0x14')](_0x4c1e21)[_0x69b8('0x16')](_0x401e35);}};}function respondWithFilteredResult(_0x2ee253,_0xe2a636){return function(_0x2b6c06){if(_0x2b6c06){var _0x1e400b=_0x2b6c06['count'],_0x189630=_0xe2a636['offset'],_0x4b54af=_0xe2a636[_0x69b8('0x17')]+_0xe2a636[_0x69b8('0x18')],_0x4f0426;if(_0x4b54af>=_0x1e400b){_0x4b54af=_0x1e400b;_0x4f0426=0xc8;}else{_0x4f0426=0xce;}_0x2ee253['status'](_0x4f0426);return _0x2ee253[_0x69b8('0x19')](_0x69b8('0x1a'),_0x189630+'-'+_0x4b54af+'/'+_0x1e400b)[_0x69b8('0x16')](_0x2b6c06);}return null;};}function patchUpdates(_0x3efd6d){return function(_0x181b51){try{jsonpatch[_0x69b8('0x1b')](_0x181b51,_0x3efd6d,!![]);}catch(_0x1045ff){return BPromise['reject'](_0x1045ff);}return _0x181b51[_0x69b8('0x1c')]();};}function saveUpdates(_0x5c31e0,_0x392dfc){return function(_0x29274f){if(_0x29274f){return _0x29274f[_0x69b8('0x1d')](_0x5c31e0)['then'](function(_0x5c636f){return _0x5c636f;});}return null;};}function removeEntity(_0xad24f1,_0x100fa0){return function(_0x24c4b1){if(_0x24c4b1){return _0x24c4b1[_0x69b8('0x1e')]()[_0x69b8('0x1f')](function(){var _0x9fd824=_0x24c4b1['get']({'plain':!![]});var _0x4c4dfa=_0x69b8('0x20');return db['UserProfileResource'][_0x69b8('0x1e')]({'where':{'type':_0x4c4dfa,'resourceId':_0x9fd824['id']}})[_0x69b8('0x1f')](function(){return _0x24c4b1;});})['then'](function(){_0xad24f1[_0x69b8('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5244ad,_0x90b18d){return function(_0x2941ab){if(!_0x2941ab){_0x5244ad['sendStatus'](0x194);}return _0x2941ab;};}function handleError(_0x4ce715,_0x4ea214){_0x4ea214=_0x4ea214||0x1f4;return function(_0x9ea1f2){logger[_0x69b8('0x21')](_0x9ea1f2['stack']);if(_0x9ea1f2[_0x69b8('0x22')]){delete _0x9ea1f2[_0x69b8('0x22')];}_0x4ce715[_0x69b8('0x14')](_0x4ea214)[_0x69b8('0x23')](_0x9ea1f2);};}exports[_0x69b8('0x24')]=function(_0x4083a7,_0x5b3e03){var _0x32638e={},_0x17d608={},_0x53f64a={'count':0x0,'rows':[]};var _0xe6aac0=_[_0x69b8('0x25')](db[_0x69b8('0x26')]['rawAttributes'],function(_0x47707e){return{'name':_0x47707e['fieldName'],'type':_0x47707e[_0x69b8('0x27')][_0x69b8('0x28')]};});_0x17d608[_0x69b8('0x29')]=_[_0x69b8('0x25')](_0xe6aac0,'name');_0x17d608[_0x69b8('0x2a')]=_['keys'](_0x4083a7['query']);_0x17d608[_0x69b8('0x2b')]=_[_0x69b8('0x2c')](_0x17d608[_0x69b8('0x29')],_0x17d608[_0x69b8('0x2a')]);_0x32638e[_0x69b8('0x2d')]=_[_0x69b8('0x2c')](_0x17d608[_0x69b8('0x29')],qs[_0x69b8('0x2e')](_0x4083a7['query'][_0x69b8('0x2e')]));_0x32638e[_0x69b8('0x2d')]=_0x32638e['attributes'][_0x69b8('0x2f')]?_0x32638e[_0x69b8('0x2d')]:_0x17d608[_0x69b8('0x29')];if(!_0x4083a7[_0x69b8('0x2a')]['hasOwnProperty']('nolimit')){_0x32638e[_0x69b8('0x18')]=qs[_0x69b8('0x18')](_0x4083a7['query']['limit']);_0x32638e[_0x69b8('0x17')]=qs[_0x69b8('0x17')](_0x4083a7['query'][_0x69b8('0x17')]);}_0x32638e[_0x69b8('0x30')]=qs[_0x69b8('0x31')](_0x4083a7[_0x69b8('0x2a')][_0x69b8('0x31')]);_0x32638e['where']=qs['filters'](_['pick'](_0x4083a7[_0x69b8('0x2a')],_0x17d608[_0x69b8('0x2b')]));if(_0x4083a7[_0x69b8('0x2a')][_0x69b8('0x32')]){_0x32638e[_0x69b8('0x33')]=_[_0x69b8('0x34')](_0x32638e[_0x69b8('0x33')],{'$or':_['map'](_0xe6aac0,function(_0xe5ff7d){if(_0xe5ff7d[_0x69b8('0x27')]!==_0x69b8('0x35')){var _0x1c1146={};_0x1c1146[_0xe5ff7d[_0x69b8('0x22')]]={'$like':'%'+_0x4083a7[_0x69b8('0x2a')][_0x69b8('0x32')]+'%'};return _0x1c1146;}})});}_0x32638e=_['merge']({},_0x32638e,_0x4083a7[_0x69b8('0x36')]);var _0x3d9ca4={'where':_0x32638e['where']};return db[_0x69b8('0x26')][_0x69b8('0x37')](_0x3d9ca4)[_0x69b8('0x1f')](function(_0x87209b){_0x53f64a[_0x69b8('0x37')]=_0x87209b;if(_0x4083a7[_0x69b8('0x2a')]['includeAll']){_0x32638e[_0x69b8('0x38')]=[{'all':!![]}];}return db[_0x69b8('0x26')]['findAll'](_0x32638e);})[_0x69b8('0x1f')](function(_0x568e77){_0x53f64a[_0x69b8('0x39')]=_0x568e77;return _0x53f64a;})['then'](respondWithFilteredResult(_0x5b3e03,_0x32638e))[_0x69b8('0x3a')](handleError(_0x5b3e03,null));};exports['show']=function(_0x3eed49,_0x3ccb02){var _0x3e28a0={'raw':!![],'where':{'id':_0x3eed49[_0x69b8('0x3b')]['id']}},_0xf25959={};_0xf25959['model']=_['keys'](db[_0x69b8('0x26')]['rawAttributes']);_0xf25959[_0x69b8('0x2a')]=_[_0x69b8('0x3c')](_0x3eed49[_0x69b8('0x2a')]);_0xf25959[_0x69b8('0x2b')]=_['intersection'](_0xf25959[_0x69b8('0x29')],_0xf25959[_0x69b8('0x2a')]);_0x3e28a0[_0x69b8('0x2d')]=_[_0x69b8('0x2c')](_0xf25959[_0x69b8('0x29')],qs[_0x69b8('0x2e')](_0x3eed49[_0x69b8('0x2a')][_0x69b8('0x2e')]));_0x3e28a0[_0x69b8('0x2d')]=_0x3e28a0[_0x69b8('0x2d')][_0x69b8('0x2f')]?_0x3e28a0[_0x69b8('0x2d')]:_0xf25959[_0x69b8('0x29')];if(_0x3eed49[_0x69b8('0x2a')][_0x69b8('0x3d')]){_0x3e28a0['include']=[{'all':!![]}];}_0x3e28a0=_[_0x69b8('0x34')]({},_0x3e28a0,_0x3eed49[_0x69b8('0x36')]);return db[_0x69b8('0x26')][_0x69b8('0x3e')](_0x3e28a0)[_0x69b8('0x1f')](handleEntityNotFound(_0x3ccb02,null))[_0x69b8('0x1f')](respondWithResult(_0x3ccb02,null))[_0x69b8('0x3a')](handleError(_0x3ccb02,null));};exports[_0x69b8('0x3f')]=function(_0x194b51,_0x13b956){return db[_0x69b8('0x26')][_0x69b8('0x3f')](_0x194b51[_0x69b8('0x40')],{})[_0x69b8('0x1f')](function(_0xd76e4f){var _0x460b60=_0x194b51['user'][_0x69b8('0x41')]({'plain':!![]});if(!_0x460b60)throw new Error(_0x69b8('0x42'));if(_0x460b60[_0x69b8('0x43')]==='user'){var _0x1cd8b2=_0xd76e4f['get']({'plain':!![]});var _0x1e8859='Tags';return db[_0x69b8('0x44')][_0x69b8('0x3e')]({'where':{'name':_0x1e8859,'userProfileId':_0x460b60['userProfileId']},'raw':!![]})[_0x69b8('0x1f')](function(_0x57e2ee){if(_0x57e2ee&&_0x57e2ee[_0x69b8('0x45')]===0x0){return db[_0x69b8('0x46')][_0x69b8('0x3f')]({'name':_0x1cd8b2[_0x69b8('0x22')],'resourceId':_0x1cd8b2['id'],'type':_0x57e2ee[_0x69b8('0x22')],'sectionId':_0x57e2ee['id']},{})[_0x69b8('0x1f')](function(){return _0xd76e4f;});}else{return _0xd76e4f;}})[_0x69b8('0x3a')](function(_0x4573a8){logger[_0x69b8('0x21')](_0x69b8('0x47'),_0x4573a8);throw _0x4573a8;});}return _0xd76e4f;})['then'](respondWithResult(_0x13b956,0xc9))[_0x69b8('0x3a')](handleError(_0x13b956,null));};exports[_0x69b8('0x1d')]=function(_0xeed320,_0x5eb7d7){if(_0xeed320[_0x69b8('0x40')]['id']){delete _0xeed320[_0x69b8('0x40')]['id'];}return db[_0x69b8('0x26')][_0x69b8('0x3e')]({'where':{'id':_0xeed320['params']['id']}})[_0x69b8('0x1f')](handleEntityNotFound(_0x5eb7d7,null))[_0x69b8('0x1f')](saveUpdates(_0xeed320[_0x69b8('0x40')],null))[_0x69b8('0x1f')](respondWithResult(_0x5eb7d7,null))[_0x69b8('0x3a')](handleError(_0x5eb7d7,null));};exports[_0x69b8('0x1e')]=function(_0x40919e,_0x2ae2fb){return db[_0x69b8('0x26')][_0x69b8('0x3e')]({'where':{'id':_0x40919e[_0x69b8('0x3b')]['id']}})[_0x69b8('0x1f')](handleEntityNotFound(_0x2ae2fb,null))['then'](removeEntity(_0x2ae2fb,null))[_0x69b8('0x3a')](handleError(_0x2ae2fb,null));}; \ No newline at end of file +var _0x5528=['pick','merge','VIRTUAL','filter','options','include','findAll','rows','show','params','find','catch','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','save','then','get','Tags','UserProfileResource','destroy','error','stack','name','send','index','map','Tag','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x23a8da,_0xa8ab76){var _0x352977=function(_0x2d1304){while(--_0x2d1304){_0x23a8da['push'](_0x23a8da['shift']());}};_0x352977(++_0xa8ab76);}(_0x5528,0x10d));var _0x8552=function(_0x4dcc2d,_0x422839){_0x4dcc2d=_0x4dcc2d-0x0;var _0x1bbd79=_0x5528[_0x4dcc2d];return _0x1bbd79;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8552('0x0'));var rimraf=require(_0x8552('0x1'));var zipdir=require(_0x8552('0x2'));var jsonpatch=require(_0x8552('0x3'));var rp=require(_0x8552('0x4'));var moment=require(_0x8552('0x5'));var BPromise=require(_0x8552('0x6'));var Mustache=require(_0x8552('0x7'));var util=require(_0x8552('0x8'));var path=require(_0x8552('0x9'));var sox=require(_0x8552('0xa'));var csv=require(_0x8552('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x8552('0xc'));var squel=require('squel');var crypto=require(_0x8552('0xd'));var jsforce=require(_0x8552('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8552('0xb'));var querystring=require(_0x8552('0xf'));var Papa=require(_0x8552('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8552('0x11'));var as=require(_0x8552('0x12'));var hardwareService=require(_0x8552('0x13'));var logger=require(_0x8552('0x14'))(_0x8552('0x15'));var utils=require('../../config/utils');var config=require(_0x8552('0x16'));var db=require(_0x8552('0x17'))['db'];function respondWithStatusCode(_0x45761f,_0x5890a2){_0x5890a2=_0x5890a2||0xcc;return function(_0xca927b){if(_0xca927b){return _0x45761f[_0x8552('0x18')](_0x5890a2);}return _0x45761f[_0x8552('0x19')](_0x5890a2)[_0x8552('0x1a')]();};}function respondWithResult(_0xc4bd9a,_0x156fff){_0x156fff=_0x156fff||0xc8;return function(_0x5d8959){if(_0x5d8959){return _0xc4bd9a[_0x8552('0x19')](_0x156fff)['json'](_0x5d8959);}};}function respondWithFilteredResult(_0x1a55ee,_0x55bb55){return function(_0x32e78b){if(_0x32e78b){var _0x14ccf3=_0x32e78b[_0x8552('0x1b')],_0x2707bf=_0x55bb55[_0x8552('0x1c')],_0x7cb08e=_0x55bb55[_0x8552('0x1c')]+_0x55bb55[_0x8552('0x1d')],_0x4811ff;if(_0x7cb08e>=_0x14ccf3){_0x7cb08e=_0x14ccf3;_0x4811ff=0xc8;}else{_0x4811ff=0xce;}_0x1a55ee[_0x8552('0x19')](_0x4811ff);return _0x1a55ee[_0x8552('0x1e')](_0x8552('0x1f'),_0x2707bf+'-'+_0x7cb08e+'/'+_0x14ccf3)[_0x8552('0x20')](_0x32e78b);}return null;};}function patchUpdates(_0xd2dd34){return function(_0x3728d9){try{jsonpatch[_0x8552('0x21')](_0x3728d9,_0xd2dd34,!![]);}catch(_0xad051f){return BPromise['reject'](_0xad051f);}return _0x3728d9[_0x8552('0x22')]();};}function saveUpdates(_0x45efaf,_0x1592d0){return function(_0x5e79db){if(_0x5e79db){return _0x5e79db['update'](_0x45efaf)[_0x8552('0x23')](function(_0x2735c3){return _0x2735c3;});}return null;};}function removeEntity(_0x7ab936,_0x510812){return function(_0x32c477){if(_0x32c477){return _0x32c477['destroy']()[_0x8552('0x23')](function(){var _0x2379a7=_0x32c477[_0x8552('0x24')]({'plain':!![]});var _0x3e7091=_0x8552('0x25');return db[_0x8552('0x26')][_0x8552('0x27')]({'where':{'type':_0x3e7091,'resourceId':_0x2379a7['id']}})['then'](function(){return _0x32c477;});})[_0x8552('0x23')](function(){_0x7ab936[_0x8552('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1eb102,_0x3ca3ec){return function(_0xda91f0){if(!_0xda91f0){_0x1eb102['sendStatus'](0x194);}return _0xda91f0;};}function handleError(_0x5becf3,_0x87ce60){_0x87ce60=_0x87ce60||0x1f4;return function(_0x5c813e){logger[_0x8552('0x28')](_0x5c813e[_0x8552('0x29')]);if(_0x5c813e['name']){delete _0x5c813e[_0x8552('0x2a')];}_0x5becf3[_0x8552('0x19')](_0x87ce60)[_0x8552('0x2b')](_0x5c813e);};}exports[_0x8552('0x2c')]=function(_0x3ffe8c,_0x37523d){var _0x432a7f={},_0x1020a1={},_0x51463c={'count':0x0,'rows':[]};var _0x1da33c=_[_0x8552('0x2d')](db[_0x8552('0x2e')][_0x8552('0x2f')],function(_0x7a76a){return{'name':_0x7a76a['fieldName'],'type':_0x7a76a[_0x8552('0x30')][_0x8552('0x31')]};});_0x1020a1[_0x8552('0x32')]=_['map'](_0x1da33c,_0x8552('0x2a'));_0x1020a1[_0x8552('0x33')]=_[_0x8552('0x34')](_0x3ffe8c[_0x8552('0x33')]);_0x1020a1[_0x8552('0x35')]=_[_0x8552('0x36')](_0x1020a1[_0x8552('0x32')],_0x1020a1[_0x8552('0x33')]);_0x432a7f[_0x8552('0x37')]=_[_0x8552('0x36')](_0x1020a1['model'],qs[_0x8552('0x38')](_0x3ffe8c[_0x8552('0x33')][_0x8552('0x38')]));_0x432a7f[_0x8552('0x37')]=_0x432a7f[_0x8552('0x37')][_0x8552('0x39')]?_0x432a7f[_0x8552('0x37')]:_0x1020a1[_0x8552('0x32')];if(!_0x3ffe8c['query'][_0x8552('0x3a')](_0x8552('0x3b'))){_0x432a7f[_0x8552('0x1d')]=qs[_0x8552('0x1d')](_0x3ffe8c[_0x8552('0x33')]['limit']);_0x432a7f['offset']=qs[_0x8552('0x1c')](_0x3ffe8c[_0x8552('0x33')][_0x8552('0x1c')]);}_0x432a7f[_0x8552('0x3c')]=qs[_0x8552('0x3d')](_0x3ffe8c[_0x8552('0x33')]['sort']);_0x432a7f[_0x8552('0x3e')]=qs['filters'](_[_0x8552('0x3f')](_0x3ffe8c['query'],_0x1020a1['filters']));if(_0x3ffe8c['query']['filter']){_0x432a7f[_0x8552('0x3e')]=_[_0x8552('0x40')](_0x432a7f[_0x8552('0x3e')],{'$or':_[_0x8552('0x2d')](_0x1da33c,function(_0x542868){if(_0x542868[_0x8552('0x30')]!==_0x8552('0x41')){var _0xbfeef3={};_0xbfeef3[_0x542868[_0x8552('0x2a')]]={'$like':'%'+_0x3ffe8c[_0x8552('0x33')][_0x8552('0x42')]+'%'};return _0xbfeef3;}})});}_0x432a7f=_['merge']({},_0x432a7f,_0x3ffe8c[_0x8552('0x43')]);var _0xfe999c={'where':_0x432a7f[_0x8552('0x3e')]};return db[_0x8552('0x2e')][_0x8552('0x1b')](_0xfe999c)[_0x8552('0x23')](function(_0x195970){_0x51463c[_0x8552('0x1b')]=_0x195970;if(_0x3ffe8c[_0x8552('0x33')]['includeAll']){_0x432a7f[_0x8552('0x44')]=[{'all':!![]}];}return db[_0x8552('0x2e')][_0x8552('0x45')](_0x432a7f);})['then'](function(_0x3d3959){_0x51463c[_0x8552('0x46')]=_0x3d3959;return _0x51463c;})[_0x8552('0x23')](respondWithFilteredResult(_0x37523d,_0x432a7f))['catch'](handleError(_0x37523d,null));};exports[_0x8552('0x47')]=function(_0x57859f,_0x5a86be){var _0x1b6f9b={'raw':!![],'where':{'id':_0x57859f[_0x8552('0x48')]['id']}},_0x38d4d5={};_0x38d4d5[_0x8552('0x32')]=_[_0x8552('0x34')](db[_0x8552('0x2e')][_0x8552('0x2f')]);_0x38d4d5[_0x8552('0x33')]=_[_0x8552('0x34')](_0x57859f[_0x8552('0x33')]);_0x38d4d5[_0x8552('0x35')]=_[_0x8552('0x36')](_0x38d4d5[_0x8552('0x32')],_0x38d4d5[_0x8552('0x33')]);_0x1b6f9b[_0x8552('0x37')]=_[_0x8552('0x36')](_0x38d4d5['model'],qs['fields'](_0x57859f[_0x8552('0x33')][_0x8552('0x38')]));_0x1b6f9b[_0x8552('0x37')]=_0x1b6f9b[_0x8552('0x37')]['length']?_0x1b6f9b[_0x8552('0x37')]:_0x38d4d5[_0x8552('0x32')];if(_0x57859f[_0x8552('0x33')]['includeAll']){_0x1b6f9b['include']=[{'all':!![]}];}_0x1b6f9b=_[_0x8552('0x40')]({},_0x1b6f9b,_0x57859f['options']);return db[_0x8552('0x2e')][_0x8552('0x49')](_0x1b6f9b)[_0x8552('0x23')](handleEntityNotFound(_0x5a86be,null))['then'](respondWithResult(_0x5a86be,null))[_0x8552('0x4a')](handleError(_0x5a86be,null));};exports[_0x8552('0x4b')]=function(_0xded728,_0x2e3fc2){return db[_0x8552('0x2e')][_0x8552('0x4b')](_0xded728[_0x8552('0x4c')],{})['then'](function(_0x4175b4){var _0x3e3e79=_0xded728[_0x8552('0x4d')][_0x8552('0x24')]({'plain':!![]});if(!_0x3e3e79)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3e3e79[_0x8552('0x4e')]==='user'){var _0x949cc3=_0x4175b4['get']({'plain':!![]});var _0xc6b624='Tags';return db[_0x8552('0x4f')][_0x8552('0x49')]({'where':{'name':_0xc6b624,'userProfileId':_0x3e3e79[_0x8552('0x50')]},'raw':!![]})['then'](function(_0x49c67f){if(_0x49c67f&&_0x49c67f[_0x8552('0x51')]===0x0){return db[_0x8552('0x26')]['create']({'name':_0x949cc3[_0x8552('0x2a')],'resourceId':_0x949cc3['id'],'type':_0x49c67f[_0x8552('0x2a')],'sectionId':_0x49c67f['id']},{})['then'](function(){return _0x4175b4;});}else{return _0x4175b4;}})[_0x8552('0x4a')](function(_0x2ff839){logger[_0x8552('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2ff839);throw _0x2ff839;});}return _0x4175b4;})[_0x8552('0x23')](respondWithResult(_0x2e3fc2,0xc9))[_0x8552('0x4a')](handleError(_0x2e3fc2,null));};exports[_0x8552('0x52')]=function(_0x1049c3,_0x1058f3){if(_0x1049c3['body']['id']){delete _0x1049c3[_0x8552('0x4c')]['id'];}return db['Tag']['find']({'where':{'id':_0x1049c3['params']['id']}})[_0x8552('0x23')](handleEntityNotFound(_0x1058f3,null))['then'](saveUpdates(_0x1049c3['body'],null))[_0x8552('0x23')](respondWithResult(_0x1058f3,null))[_0x8552('0x4a')](handleError(_0x1058f3,null));};exports[_0x8552('0x27')]=function(_0x8e2ab7,_0x847c7d){return db[_0x8552('0x2e')][_0x8552('0x49')]({'where':{'id':_0x8e2ab7['params']['id']}})[_0x8552('0x23')](handleEntityNotFound(_0x847c7d,null))[_0x8552('0x23')](removeEntity(_0x847c7d,null))['catch'](handleError(_0x847c7d,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 9b43e42..ee2f393 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 _0x8dd1=['../../config/environment','exports','define','Tag','tools_tags','lodash','util','../../config/logger','moment','request-promise','path','rimraf'];(function(_0x3381ec,_0x4d6e65){var _0x51b797=function(_0x583ea5){while(--_0x583ea5){_0x3381ec['push'](_0x3381ec['shift']());}};_0x51b797(++_0x4d6e65);}(_0x8dd1,0x1e5));var _0x18dd=function(_0x2d43b4,_0xa4ee8f){_0x2d43b4=_0x2d43b4-0x0;var _0x3a387c=_0x8dd1[_0x2d43b4];return _0x3a387c;};'use strict';var _=require(_0x18dd('0x0'));var util=require(_0x18dd('0x1'));var logger=require(_0x18dd('0x2'))('api');var moment=require(_0x18dd('0x3'));var BPromise=require('bluebird');var rp=require(_0x18dd('0x4'));var fs=require('fs');var path=require(_0x18dd('0x5'));var rimraf=require(_0x18dd('0x6'));var config=require(_0x18dd('0x7'));var attributes=require('./tag.attributes');module[_0x18dd('0x8')]=function(_0x2cb51e,_0x43c5b5){return _0x2cb51e[_0x18dd('0x9')](_0x18dd('0xa'),attributes,{'tableName':_0x18dd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x58fd=['lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./tag.attributes','define'];(function(_0x37b7b6,_0x165a5c){var _0x10c4c3=function(_0x16d71e){while(--_0x16d71e){_0x37b7b6['push'](_0x37b7b6['shift']());}};_0x10c4c3(++_0x165a5c);}(_0x58fd,0x1cc));var _0xd58f=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0x58fd[_0x2b10c6];return _0x3789d2;};'use strict';var _=require(_0xd58f('0x0'));var util=require('util');var logger=require(_0xd58f('0x1'))('api');var moment=require(_0xd58f('0x2'));var BPromise=require(_0xd58f('0x3'));var rp=require(_0xd58f('0x4'));var fs=require('fs');var path=require(_0xd58f('0x5'));var rimraf=require(_0xd58f('0x6'));var config=require(_0xd58f('0x7'));var attributes=require(_0xd58f('0x8'));module['exports']=function(_0x2621aa,_0x3443e8){return _0x2621aa[_0xd58f('0x9')]('Tag',attributes,{'tableName':'tools_tags','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/tag/tag.rpc.js b/server/api/tag/tag.rpc.js index fdb8d99..676fcf5 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 _0x750a=['error','code','Tag,\x20%s,\x20%s','message','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','stringify'];(function(_0xebc23a,_0x57aa42){var _0x439c0d=function(_0x58f018){while(--_0x58f018){_0xebc23a['push'](_0xebc23a['shift']());}};_0x439c0d(++_0x57aa42);}(_0x750a,0x140));var _0xa750=function(_0x136b60,_0x2f2f6d){_0x136b60=_0x136b60-0x0;var _0x219247=_0x750a[_0x136b60];return _0x219247;};'use strict';var _=require('lodash');var util=require(_0xa750('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa750('0x1'));var fs=require('fs');var Redis=require(_0xa750('0x2'));var db=require(_0xa750('0x3'))['db'];var utils=require(_0xa750('0x4'));var logger=require(_0xa750('0x5'))(_0xa750('0x6'));var config=require(_0xa750('0x7'));var jayson=require(_0xa750('0x8'));var client=jayson[_0xa750('0x9')][_0xa750('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x197299,_0x1ae455,_0x3d7c43){return new BPromise(function(_0x47a4dd,_0x53f2cb){return client[_0xa750('0xb')](_0x197299,_0x3d7c43)['then'](function(_0x4458b1){logger[_0xa750('0xc')]('Tag,\x20%s,\x20%s',_0x1ae455,_0xa750('0xd'));logger[_0xa750('0xe')]('Tag,\x20%s,\x20%s,\x20%s',_0x1ae455,'request\x20sent',JSON[_0xa750('0xf')](_0x4458b1));if(_0x4458b1['error']){if(_0x4458b1[_0xa750('0x10')][_0xa750('0x11')]===0x1f4){logger['error'](_0xa750('0x12'),_0x1ae455,_0x4458b1[_0xa750('0x10')][_0xa750('0x13')]);return _0x53f2cb(_0x4458b1['error'][_0xa750('0x13')]);}logger[_0xa750('0x10')](_0xa750('0x12'),_0x1ae455,_0x4458b1[_0xa750('0x10')][_0xa750('0x13')]);return _0x47a4dd(_0x4458b1[_0xa750('0x10')]['message']);}else{logger[_0xa750('0xc')](_0xa750('0x12'),_0x1ae455,_0xa750('0xd'));_0x47a4dd(_0x4458b1['result'][_0xa750('0x13')]);}})[_0xa750('0x14')](function(_0x58639b){logger['error'](_0xa750('0x12'),_0x1ae455,_0x58639b);_0x53f2cb(_0x58639b);});});} \ No newline at end of file +var _0xca66=['http','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client'];(function(_0x334388,_0x582f1f){var _0x3f3c42=function(_0x249da0){while(--_0x249da0){_0x334388['push'](_0x334388['shift']());}};_0x3f3c42(++_0x582f1f);}(_0xca66,0x8b));var _0x6ca6=function(_0x1aac9d,_0xe79f78){_0x1aac9d=_0x1aac9d-0x0;var _0x36b6ed=_0xca66[_0x1aac9d];return _0x36b6ed;};'use strict';var _=require(_0x6ca6('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x6ca6('0x1'));var rs=require(_0x6ca6('0x2'));var fs=require('fs');var Redis=require(_0x6ca6('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x6ca6('0x4'));var logger=require('../../config/logger')(_0x6ca6('0x5'));var config=require('../../config/environment');var jayson=require(_0x6ca6('0x6'));var client=jayson[_0x6ca6('0x7')][_0x6ca6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x44019c,_0x407e66,_0x27a210){return new BPromise(function(_0x27d280,_0x4f5651){return client[_0x6ca6('0x9')](_0x44019c,_0x27a210)[_0x6ca6('0xa')](function(_0x34b71b){logger[_0x6ca6('0xb')](_0x6ca6('0xc'),_0x407e66,_0x6ca6('0xd'));logger[_0x6ca6('0xe')]('Tag,\x20%s,\x20%s,\x20%s',_0x407e66,_0x6ca6('0xd'),JSON[_0x6ca6('0xf')](_0x34b71b));if(_0x34b71b[_0x6ca6('0x10')]){if(_0x34b71b[_0x6ca6('0x10')][_0x6ca6('0x11')]===0x1f4){logger[_0x6ca6('0x10')]('Tag,\x20%s,\x20%s',_0x407e66,_0x34b71b[_0x6ca6('0x10')][_0x6ca6('0x12')]);return _0x4f5651(_0x34b71b['error'][_0x6ca6('0x12')]);}logger[_0x6ca6('0x10')](_0x6ca6('0xc'),_0x407e66,_0x34b71b[_0x6ca6('0x10')][_0x6ca6('0x12')]);return _0x27d280(_0x34b71b[_0x6ca6('0x10')]['message']);}else{logger['info']('Tag,\x20%s,\x20%s',_0x407e66,_0x6ca6('0xd'));_0x27d280(_0x34b71b[_0x6ca6('0x13')][_0x6ca6('0x12')]);}})[_0x6ca6('0x14')](function(_0x2c4a5c){logger[_0x6ca6('0x10')](_0x6ca6('0xc'),_0x407e66,_0x2c4a5c);_0x4f5651(_0x2c4a5c);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 60283c0..d93e810 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 _0x9e06=['addAgents','put','update','delete','destroy','removeQueues','removeAgents','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','get','isAuthenticated','index','/:id','getQueues','post','create','/:id/queues','addQueues','/:id/users'];(function(_0x5b6e01,_0x160432){var _0x22825e=function(_0x22d86f){while(--_0x22d86f){_0x5b6e01['push'](_0x5b6e01['shift']());}};_0x22825e(++_0x160432);}(_0x9e06,0x140));var _0x69e0=function(_0x2b4cc1,_0x8c4153){_0x2b4cc1=_0x2b4cc1-0x0;var _0x5d6a22=_0x9e06[_0x2b4cc1];return _0x5d6a22;};'use strict';var multer=require(_0x69e0('0x0'));var util=require('util');var path=require(_0x69e0('0x1'));var timeout=require(_0x69e0('0x2'));var express=require(_0x69e0('0x3'));var router=express[_0x69e0('0x4')]();var auth=require(_0x69e0('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./team.controller');router[_0x69e0('0x6')]('/',auth[_0x69e0('0x7')](),controller[_0x69e0('0x8')]);router[_0x69e0('0x6')](_0x69e0('0x9'),auth[_0x69e0('0x7')](),controller['show']);router[_0x69e0('0x6')]('/:id/queues',auth['isAuthenticated'](),controller[_0x69e0('0xa')]);router['get']('/:id/users',auth[_0x69e0('0x7')](),controller['getAgents']);router[_0x69e0('0xb')]('/',auth[_0x69e0('0x7')](),controller[_0x69e0('0xc')]);router[_0x69e0('0xb')](_0x69e0('0xd'),auth[_0x69e0('0x7')](),controller[_0x69e0('0xe')]);router[_0x69e0('0xb')](_0x69e0('0xf'),auth['isAuthenticated'](),controller[_0x69e0('0x10')]);router[_0x69e0('0x11')](_0x69e0('0x9'),auth['isAuthenticated'](),controller[_0x69e0('0x12')]);router[_0x69e0('0x13')](_0x69e0('0x9'),auth[_0x69e0('0x7')](),controller[_0x69e0('0x14')]);router[_0x69e0('0x13')](_0x69e0('0xd'),auth[_0x69e0('0x7')](),controller[_0x69e0('0x15')]);router[_0x69e0('0x13')]('/:id/users',auth['isAuthenticated'](),controller[_0x69e0('0x16')]);module[_0x69e0('0x17')]=router; \ No newline at end of file +var _0x43d9=['get','isAuthenticated','/:id','show','getQueues','/:id/users','post','create','/:id/queues','addQueues','addAgents','put','update','delete','destroy','removeQueues','removeAgents','exports','multer','path','express','Router','../../components/auth/service','./team.controller'];(function(_0x2a9b60,_0x47c62b){var _0x4495f7=function(_0x43458f){while(--_0x43458f){_0x2a9b60['push'](_0x2a9b60['shift']());}};_0x4495f7(++_0x47c62b);}(_0x43d9,0x1f2));var _0x943d=function(_0x424caa,_0x147699){_0x424caa=_0x424caa-0x0;var _0x203100=_0x43d9[_0x424caa];return _0x203100;};'use strict';var multer=require(_0x943d('0x0'));var util=require('util');var path=require(_0x943d('0x1'));var timeout=require('connect-timeout');var express=require(_0x943d('0x2'));var router=express[_0x943d('0x3')]();var auth=require(_0x943d('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x943d('0x5'));router[_0x943d('0x6')]('/',auth[_0x943d('0x7')](),controller['index']);router[_0x943d('0x6')](_0x943d('0x8'),auth['isAuthenticated'](),controller[_0x943d('0x9')]);router[_0x943d('0x6')]('/:id/queues',auth['isAuthenticated'](),controller[_0x943d('0xa')]);router[_0x943d('0x6')](_0x943d('0xb'),auth['isAuthenticated'](),controller['getAgents']);router[_0x943d('0xc')]('/',auth['isAuthenticated'](),controller[_0x943d('0xd')]);router['post'](_0x943d('0xe'),auth[_0x943d('0x7')](),controller[_0x943d('0xf')]);router[_0x943d('0xc')](_0x943d('0xb'),auth['isAuthenticated'](),controller[_0x943d('0x10')]);router[_0x943d('0x11')]('/:id',auth[_0x943d('0x7')](),controller[_0x943d('0x12')]);router[_0x943d('0x13')](_0x943d('0x8'),auth[_0x943d('0x7')](),controller[_0x943d('0x14')]);router[_0x943d('0x13')]('/:id/queues',auth['isAuthenticated'](),controller[_0x943d('0x15')]);router[_0x943d('0x13')](_0x943d('0xb'),auth[_0x943d('0x7')](),controller[_0x943d('0x16')]);module[_0x943d('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 c071099..68b48d5 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 _0x9062=['STRING','sequelize','exports'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x9062,0x6a));var _0x2906=function(_0x31fa3d,_0x328e3c){_0x31fa3d=_0x31fa3d-0x0;var _0x45dfdc=_0x9062[_0x31fa3d];return _0x45dfdc;};'use strict';var Sequelize=require(_0x2906('0x0'));module[_0x2906('0x1')]={'name':{'type':Sequelize[_0x2906('0x2')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x564b=['name','sequelize','exports','STRING'];(function(_0x3c3112,_0x48edb2){var _0x5c3f33=function(_0x4d112a){while(--_0x4d112a){_0x3c3112['push'](_0x3c3112['shift']());}};_0x5c3f33(++_0x48edb2);}(_0x564b,0x71));var _0xb564=function(_0x4ac4b1,_0xefa607){_0x4ac4b1=_0x4ac4b1-0x0;var _0x530e35=_0x564b[_0x4ac4b1];return _0x530e35;};'use strict';var Sequelize=require(_0xb564('0x0'));module[_0xb564('0x1')]={'name':{'type':Sequelize[_0xb564('0x2')],'allowNull':![],'unique':_0xb564('0x3')},'description':{'type':Sequelize[_0xb564('0x2')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 6cac35f..9413804 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 _0x2432=['mustache','util','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','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','count','offset','limit','set','apply','reject','update','then','destroy','error','stack','name','send','index','map','Team','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','rawAttributes','length','find','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','UserProfileResource','body','params','getQueues','findOne','isValidChannel','channel','Sequelize','ValidationError','Unknown\x20channel','keys','capitalize','toLowerCase','Queue','Queues','add','ids','removeQueues','remove','addAgents','Voice','Chat','Mail','Sms','Fax','each','User','online','interface','UserVoiceQueueRt','format','SIP/%s','voicePause','omit','spread','emit','userTeam:save','removeAgents','voice','chat','sms','fax','openchannel','userTeam:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird'];(function(_0x508669,_0x158522){var _0x829ed6=function(_0x537170){while(--_0x537170){_0x508669['push'](_0x508669['shift']());}};_0x829ed6(++_0x158522);}(_0x2432,0x7a));var _0x2243=function(_0x1bf0c6,_0x2d566e){_0x1bf0c6=_0x1bf0c6-0x0;var _0x51d676=_0x2432[_0x1bf0c6];return _0x51d676;};'use strict';var pdf=require(_0x2243('0x0'));var emlformat=require(_0x2243('0x1'));var rimraf=require(_0x2243('0x2'));var zipdir=require(_0x2243('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2243('0x4'));var moment=require('moment');var BPromise=require(_0x2243('0x5'));var Mustache=require(_0x2243('0x6'));var util=require(_0x2243('0x7'));var path=require(_0x2243('0x8'));var sox=require(_0x2243('0x9'));var csv=require(_0x2243('0xa'));var ejs=require(_0x2243('0xb'));var fs=require('fs');var _=require(_0x2243('0xc'));var squel=require(_0x2243('0xd'));var crypto=require('crypto');var jsforce=require(_0x2243('0xe'));var deskjs=require(_0x2243('0xf'));var toCsv=require(_0x2243('0xa'));var querystring=require(_0x2243('0x10'));var Papa=require(_0x2243('0x11'));var Redis=require(_0x2243('0x12'));var authService=require(_0x2243('0x13'));var qs=require(_0x2243('0x14'));var as=require(_0x2243('0x15'));var hardwareService=require(_0x2243('0x16'));var logger=require(_0x2243('0x17'))(_0x2243('0x18'));var utils=require(_0x2243('0x19'));var config=require(_0x2243('0x1a'));var db=require(_0x2243('0x1b'))['db'];config[_0x2243('0x1c')]=_['defaults'](config[_0x2243('0x1c')],{'host':_0x2243('0x1d'),'port':0x18eb});var socket=require(_0x2243('0x1e'))(new Redis(config[_0x2243('0x1c')]));require('./team.socket')[_0x2243('0x1f')](socket);function respondWithStatusCode(_0x496e30,_0x328104){_0x328104=_0x328104||0xcc;return function(_0x4a334d){if(_0x4a334d){return _0x496e30[_0x2243('0x20')](_0x328104);}return _0x496e30[_0x2243('0x21')](_0x328104)[_0x2243('0x22')]();};}function respondWithResult(_0x3388bc,_0x4ebd4a){_0x4ebd4a=_0x4ebd4a||0xc8;return function(_0x532445){if(_0x532445){return _0x3388bc[_0x2243('0x21')](_0x4ebd4a)[_0x2243('0x23')](_0x532445);}};}function respondWithFilteredResult(_0x1c8d43,_0xaac77c){return function(_0x2e1416){if(_0x2e1416){var _0x2595f0=_0x2e1416[_0x2243('0x24')],_0x320da1=_0xaac77c[_0x2243('0x25')],_0x3c8bb9=_0xaac77c['offset']+_0xaac77c[_0x2243('0x26')],_0xe8932a;if(_0x3c8bb9>=_0x2595f0){_0x3c8bb9=_0x2595f0;_0xe8932a=0xc8;}else{_0xe8932a=0xce;}_0x1c8d43[_0x2243('0x21')](_0xe8932a);return _0x1c8d43[_0x2243('0x27')]('Content-Range',_0x320da1+'-'+_0x3c8bb9+'/'+_0x2595f0)[_0x2243('0x23')](_0x2e1416);}return null;};}function patchUpdates(_0x14ed4f){return function(_0x264c66){try{jsonpatch[_0x2243('0x28')](_0x264c66,_0x14ed4f,!![]);}catch(_0x2f2ccb){return BPromise[_0x2243('0x29')](_0x2f2ccb);}return _0x264c66['save']();};}function saveUpdates(_0x45d4b7,_0x36b1d4){return function(_0x474590){if(_0x474590){return _0x474590[_0x2243('0x2a')](_0x45d4b7)[_0x2243('0x2b')](function(_0x3424fc){return _0x3424fc;});}return null;};}function removeEntity(_0x54d51d,_0x3e64c9){return function(_0x3557ac){if(_0x3557ac){return _0x3557ac[_0x2243('0x2c')]()[_0x2243('0x2b')](function(){var _0x32afdc=_0x3557ac['get']({'plain':!![]});var _0xedbc67='Teams';return db['UserProfileResource'][_0x2243('0x2c')]({'where':{'type':_0xedbc67,'resourceId':_0x32afdc['id']}})[_0x2243('0x2b')](function(){return _0x3557ac;});})['then'](function(){_0x54d51d[_0x2243('0x21')](0xcc)[_0x2243('0x22')]();});}};}function handleEntityNotFound(_0x4d6518,_0x414a56){return function(_0x22462c){if(!_0x22462c){_0x4d6518[_0x2243('0x20')](0x194);}return _0x22462c;};}function handleError(_0x38248a,_0x4e3acf){_0x4e3acf=_0x4e3acf||0x1f4;return function(_0x21b3e0){logger[_0x2243('0x2d')](_0x21b3e0[_0x2243('0x2e')]);if(_0x21b3e0[_0x2243('0x2f')]){delete _0x21b3e0[_0x2243('0x2f')];}_0x38248a[_0x2243('0x21')](_0x4e3acf)[_0x2243('0x30')](_0x21b3e0);};}exports[_0x2243('0x31')]=function(_0x20f3a3,_0x50a9d0){var _0x309e72={},_0x51e62e={},_0x4a248d={'count':0x0,'rows':[]};var _0x1dac45=_[_0x2243('0x32')](db[_0x2243('0x33')]['rawAttributes'],function(_0xff6ebe){return{'name':_0xff6ebe[_0x2243('0x34')],'type':_0xff6ebe[_0x2243('0x35')]['key']};});_0x51e62e[_0x2243('0x36')]=_[_0x2243('0x32')](_0x1dac45,_0x2243('0x2f'));_0x51e62e['query']=_['keys'](_0x20f3a3[_0x2243('0x37')]);_0x51e62e[_0x2243('0x38')]=_[_0x2243('0x39')](_0x51e62e[_0x2243('0x36')],_0x51e62e['query']);_0x309e72[_0x2243('0x3a')]=_[_0x2243('0x39')](_0x51e62e[_0x2243('0x36')],qs['fields'](_0x20f3a3[_0x2243('0x37')][_0x2243('0x3b')]));_0x309e72[_0x2243('0x3a')]=_0x309e72[_0x2243('0x3a')]['length']?_0x309e72[_0x2243('0x3a')]:_0x51e62e[_0x2243('0x36')];if(!_0x20f3a3[_0x2243('0x37')][_0x2243('0x3c')](_0x2243('0x3d'))){_0x309e72['limit']=qs[_0x2243('0x26')](_0x20f3a3[_0x2243('0x37')][_0x2243('0x26')]);_0x309e72[_0x2243('0x25')]=qs[_0x2243('0x25')](_0x20f3a3[_0x2243('0x37')][_0x2243('0x25')]);}_0x309e72[_0x2243('0x3e')]=qs[_0x2243('0x3f')](_0x20f3a3[_0x2243('0x37')]['sort']);_0x309e72[_0x2243('0x40')]=qs['filters'](_[_0x2243('0x41')](_0x20f3a3[_0x2243('0x37')],_0x51e62e[_0x2243('0x38')]));if(_0x20f3a3['query']['filter']){_0x309e72[_0x2243('0x40')]=_[_0x2243('0x42')](_0x309e72[_0x2243('0x40')],{'$or':_[_0x2243('0x32')](_0x1dac45,function(_0x21240b){if(_0x21240b[_0x2243('0x35')]!==_0x2243('0x43')){var _0x22663d={};_0x22663d[_0x21240b[_0x2243('0x2f')]]={'$like':'%'+_0x20f3a3[_0x2243('0x37')][_0x2243('0x44')]+'%'};return _0x22663d;}})});}_0x309e72=_['merge']({},_0x309e72,_0x20f3a3[_0x2243('0x45')]);var _0x2d8b8b={'where':_0x309e72['where']};return db[_0x2243('0x33')]['count'](_0x2d8b8b)[_0x2243('0x2b')](function(_0x452ddd){_0x4a248d[_0x2243('0x24')]=_0x452ddd;if(_0x20f3a3[_0x2243('0x37')][_0x2243('0x46')]){_0x309e72[_0x2243('0x47')]=[{'all':!![]}];}return db['Team'][_0x2243('0x48')](_0x309e72);})[_0x2243('0x2b')](function(_0x427869){_0x4a248d[_0x2243('0x49')]=_0x427869;return _0x4a248d;})[_0x2243('0x2b')](respondWithFilteredResult(_0x50a9d0,_0x309e72))[_0x2243('0x4a')](handleError(_0x50a9d0,null));};exports['show']=function(_0x284fb1,_0x28a76f){var _0x2fee1c={'raw':![],'where':{'id':_0x284fb1['params']['id']}},_0x38888b={};_0x38888b[_0x2243('0x36')]=_['keys'](db[_0x2243('0x33')][_0x2243('0x4b')]);_0x38888b['query']=_['keys'](_0x284fb1['query']);_0x38888b['filters']=_[_0x2243('0x39')](_0x38888b['model'],_0x38888b[_0x2243('0x37')]);_0x2fee1c[_0x2243('0x3a')]=_[_0x2243('0x39')](_0x38888b[_0x2243('0x36')],qs[_0x2243('0x3b')](_0x284fb1[_0x2243('0x37')][_0x2243('0x3b')]));_0x2fee1c['attributes']=_0x2fee1c[_0x2243('0x3a')][_0x2243('0x4c')]?_0x2fee1c[_0x2243('0x3a')]:_0x38888b['model'];if(_0x284fb1[_0x2243('0x37')][_0x2243('0x46')]){_0x2fee1c[_0x2243('0x47')]=[{'all':!![]}];}_0x2fee1c=_[_0x2243('0x42')]({},_0x2fee1c,_0x284fb1[_0x2243('0x45')]);return db[_0x2243('0x33')][_0x2243('0x4d')](_0x2fee1c)[_0x2243('0x2b')](handleEntityNotFound(_0x28a76f,null))[_0x2243('0x2b')](respondWithResult(_0x28a76f,null))[_0x2243('0x4a')](handleError(_0x28a76f,null));};exports[_0x2243('0x4e')]=function(_0x490fb2,_0x4754f9){return db['Team'][_0x2243('0x4e')](_0x490fb2['body'],{})[_0x2243('0x2b')](function(_0x6117d5){var _0x5b7d80=_0x490fb2['user'][_0x2243('0x4f')]({'plain':!![]});if(!_0x5b7d80)throw new Error(_0x2243('0x50'));if(_0x5b7d80[_0x2243('0x51')]==='user'){var _0x25a25a=_0x6117d5[_0x2243('0x4f')]({'plain':!![]});var _0x5c419c=_0x2243('0x52');return db['UserProfileSection'][_0x2243('0x4d')]({'where':{'name':_0x5c419c,'userProfileId':_0x5b7d80['userProfileId']},'raw':!![]})['then'](function(_0x34b683){if(_0x34b683&&_0x34b683['autoAssociation']===0x0){return db[_0x2243('0x53')][_0x2243('0x4e')]({'name':_0x25a25a[_0x2243('0x2f')],'resourceId':_0x25a25a['id'],'type':_0x34b683[_0x2243('0x2f')],'sectionId':_0x34b683['id']},{})['then'](function(){return _0x6117d5;});}else{return _0x6117d5;}})[_0x2243('0x4a')](function(_0x106c96){logger[_0x2243('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x106c96);throw _0x106c96;});}return _0x6117d5;})[_0x2243('0x2b')](respondWithResult(_0x4754f9,0xc9))[_0x2243('0x4a')](handleError(_0x4754f9,null));};exports[_0x2243('0x2a')]=function(_0x3dd0ec,_0x45e769){if(_0x3dd0ec[_0x2243('0x54')]['id']){delete _0x3dd0ec['body']['id'];}return db[_0x2243('0x33')][_0x2243('0x4d')]({'where':{'id':_0x3dd0ec[_0x2243('0x55')]['id']}})[_0x2243('0x2b')](handleEntityNotFound(_0x45e769,null))[_0x2243('0x2b')](saveUpdates(_0x3dd0ec['body'],null))[_0x2243('0x2b')](respondWithResult(_0x45e769,null))[_0x2243('0x4a')](handleError(_0x45e769,null));};exports[_0x2243('0x2c')]=function(_0x4cce0d,_0x44d3ac){return db[_0x2243('0x33')][_0x2243('0x4d')]({'where':{'id':_0x4cce0d[_0x2243('0x55')]['id']}})[_0x2243('0x2b')](handleEntityNotFound(_0x44d3ac,null))[_0x2243('0x2b')](removeEntity(_0x44d3ac,null))[_0x2243('0x4a')](handleError(_0x44d3ac,null));};exports[_0x2243('0x56')]=function(_0x10f59a,_0x31e49e,_0x575ab7){return db[_0x2243('0x33')][_0x2243('0x57')]({'where':{'id':_0x10f59a['params']['id']}})['then'](handleEntityNotFound(_0x31e49e,null))[_0x2243('0x2b')](function(_0x5a2676){if(!_0x10f59a[_0x2243('0x37')]['channel']||!utils[_0x2243('0x58')](_0x10f59a['query'][_0x2243('0x59')])){throw new db[(_0x2243('0x5a'))][(_0x2243('0x5b'))](_0x2243('0x5c'));}var _0x35fdf9={};var _0x219ae2={};_0x219ae2['model']=_[_0x2243('0x5d')](db[_[_0x2243('0x5e')](_0x10f59a['query'][_0x2243('0x59')][_0x2243('0x5f')]())+_0x2243('0x60')][_0x2243('0x4b')]);_0x219ae2[_0x2243('0x37')]=_[_0x2243('0x5d')](_0x10f59a[_0x2243('0x37')]);_0x219ae2['filters']=_[_0x2243('0x39')](_0x219ae2[_0x2243('0x36')],_0x219ae2[_0x2243('0x37')]);_0x35fdf9['attributes']=_[_0x2243('0x39')](_0x219ae2[_0x2243('0x36')],qs[_0x2243('0x3b')](_0x10f59a[_0x2243('0x37')]['fields']));_0x35fdf9[_0x2243('0x3a')]=_0x35fdf9[_0x2243('0x3a')][_0x2243('0x4c')]?_0x35fdf9[_0x2243('0x3a')]:_0x219ae2[_0x2243('0x36')];_0x35fdf9[_0x2243('0x26')]=qs[_0x2243('0x26')](_0x10f59a[_0x2243('0x37')]['limit']);_0x35fdf9[_0x2243('0x25')]=qs['offset'](_0x10f59a['query'][_0x2243('0x25')]);_0x35fdf9['order']=qs['sort'](_0x10f59a[_0x2243('0x37')][_0x2243('0x3f')]);_0x35fdf9[_0x2243('0x40')]=qs[_0x2243('0x38')](_[_0x2243('0x41')](_0x10f59a[_0x2243('0x37')],_0x219ae2[_0x2243('0x38')]));_0x35fdf9=_[_0x2243('0x42')]({},_0x35fdf9,_0x10f59a[_0x2243('0x45')]);return _0x5a2676['get'+_[_0x2243('0x5e')](_0x10f59a[_0x2243('0x37')][_0x2243('0x59')]['toLowerCase']())+_0x2243('0x61')](_0x35fdf9);})[_0x2243('0x2b')](respondWithResult(_0x31e49e,null))['catch'](handleError(_0x31e49e,null));};exports['addQueues']=function(_0x596362,_0xf0ecc4,_0xc20db6){return db[_0x2243('0x33')]['findOne']({'where':{'id':_0x596362['params']['id']}})['then'](function(_0x2aa8a1){if(_0x2aa8a1){if(!_0x596362['body'][_0x2243('0x59')]||!utils[_0x2243('0x58')](_0x596362[_0x2243('0x54')]['channel'])){throw new db[(_0x2243('0x5a'))][(_0x2243('0x5b'))](_0x2243('0x5c'));}return _0x2aa8a1[_0x2243('0x62')+_[_0x2243('0x5e')](_0x596362[_0x2243('0x54')][_0x2243('0x59')][_0x2243('0x5f')]())+'Queues'](_0x596362[_0x2243('0x54')][_0x2243('0x63')]);}return null;})[_0x2243('0x2b')](handleEntityNotFound(_0xf0ecc4,null))[_0x2243('0x2b')](respondWithStatusCode(_0xf0ecc4,null))[_0x2243('0x4a')](handleError(_0xf0ecc4,null));};exports[_0x2243('0x64')]=function(_0x7a5a94,_0x43fa47,_0x5c96ce){return db[_0x2243('0x33')][_0x2243('0x57')]({'where':{'id':_0x7a5a94[_0x2243('0x55')]['id']}})[_0x2243('0x2b')](function(_0x3cf2b2){if(_0x3cf2b2){if(!_0x7a5a94[_0x2243('0x37')][_0x2243('0x59')]||!utils[_0x2243('0x58')](_0x7a5a94[_0x2243('0x37')]['channel'])){throw new db[(_0x2243('0x5a'))][(_0x2243('0x5b'))](_0x2243('0x5c'));}return _0x3cf2b2[_0x2243('0x65')+_[_0x2243('0x5e')](_0x7a5a94[_0x2243('0x37')][_0x2243('0x59')][_0x2243('0x5f')]())+_0x2243('0x61')](_0x7a5a94[_0x2243('0x37')]['ids']);}return null;})[_0x2243('0x2b')](handleEntityNotFound(_0x43fa47,null))[_0x2243('0x2b')](respondWithStatusCode(_0x43fa47,null))[_0x2243('0x4a')](handleError(_0x43fa47,null));};exports[_0x2243('0x66')]=function(_0x45f2cf,_0x3867b7,_0x2ec48b){return db[_0x2243('0x33')][_0x2243('0x4d')]({'where':{'id':_0x45f2cf[_0x2243('0x55')]['id']}})[_0x2243('0x2b')](handleEntityNotFound(_0x3867b7,null))[_0x2243('0x2b')](function(_0x3d9035){if(_0x3d9035){var _0x4caa3d=[_0x2243('0x67'),_0x2243('0x68'),_0x2243('0x69'),_0x2243('0x6a'),_0x2243('0x6b'),'Openchannel'];return BPromise[_0x2243('0x6c')](_0x4caa3d,function(_0x25522b){return _0x3d9035[_0x2243('0x4f')+_0x25522b+_0x2243('0x61')]({'attributes':['id','name']})['then'](function(_0x596992){return BPromise[_0x2243('0x6c')](_0x596992,function(_0x3d06cf){return _0x3d06cf[_0x2243('0x66')](_0x45f2cf[_0x2243('0x54')][_0x2243('0x63')])[_0x2243('0x2b')](function(){if(_0x25522b===_0x2243('0x67')){return db[_0x2243('0x6d')][_0x2243('0x48')]({'where':{'id':_0x45f2cf[_0x2243('0x54')][_0x2243('0x63')]},'attributes':['id',_0x2243('0x2f'),_0x2243('0x6e'),'voicePause',_0x2243('0x6f')],'raw':!![]})[_0x2243('0x2b')](function(_0x4d7676){return BPromise['each'](_[_0x2243('0x44')](_0x4d7676,{'online':0x1}),function(_0x1c1659){return db[_0x2243('0x70')]['upsert']({'membername':_0x1c1659[_0x2243('0x2f')],'UserId':_0x1c1659['id'],'queue_name':_0x3d06cf['name'],'VoiceQueueId':_0x3d06cf['id'],'interface':_['isNil'](_0x1c1659[_0x2243('0x6f')])?util[_0x2243('0x71')](_0x2243('0x72'),_0x1c1659[_0x2243('0x2f')]):_0x1c1659[_0x2243('0x6f')],'paused':_0x1c1659[_0x2243('0x73')]||![],'penalty':0x0});});});}});});})[_0x2243('0x2b')](function(){return _0x3d9035;});})[_0x2243('0x2b')](function(){return _0x3d9035;});}})[_0x2243('0x2b')](function(_0x27ff98){if(_0x27ff98){return _0x27ff98[_0x2243('0x66')](_0x45f2cf['body']['ids'],_[_0x2243('0x74')](_0x45f2cf[_0x2243('0x54')],['ids','id'])||{})[_0x2243('0x75')](function(_0x17a032){for(var _0x5bea58=0x0;_0x5bea58<_0x45f2cf[_0x2243('0x54')][_0x2243('0x63')]['length'];_0x5bea58+=0x1){socket[_0x2243('0x76')](_0x2243('0x77'),{'UserId':_0x45f2cf['body']['ids'][_0x5bea58],'TeamId':_0x45f2cf['params']['id']});}return _0x17a032;});}})['then'](respondWithResult(_0x3867b7,null))[_0x2243('0x4a')](handleError(_0x3867b7,null));};exports[_0x2243('0x78')]=function(_0x13f113,_0x3e1b7c,_0x58e21a){return db[_0x2243('0x33')][_0x2243('0x4d')]({'where':{'id':_0x13f113['params']['id']}})[_0x2243('0x2b')](handleEntityNotFound(_0x3e1b7c,null))['then'](function(_0x421040){if(_0x421040){return BPromise['each']([_0x2243('0x79'),_0x2243('0x7a'),'mail',_0x2243('0x7b'),_0x2243('0x7c'),_0x2243('0x7d')],function(_0x91a68d){return _0x421040[_0x2243('0x4f')+_[_0x2243('0x5e')](_0x91a68d)+_0x2243('0x61')]({'attributes':['id',_0x2243('0x2f')]})[_0x2243('0x2b')](function(_0x1148c1){return BPromise[_0x2243('0x6c')](_0x1148c1,function(_0x1bf956){return _0x1bf956[_0x2243('0x78')](_0x13f113[_0x2243('0x37')][_0x2243('0x63')])[_0x2243('0x2b')](function(){if(_0x91a68d===_0x2243('0x79')){return db[_0x2243('0x70')][_0x2243('0x2c')]({'where':{'VoiceQueueId':_0x1bf956['id'],'UserId':_0x13f113[_0x2243('0x37')]['ids']}});}});});})[_0x2243('0x2b')](function(){return _0x421040;});})[_0x2243('0x2b')](function(){return _0x421040;});}})[_0x2243('0x2b')](function(_0x31c0f4){if(_0x31c0f4){return _0x31c0f4[_0x2243('0x78')](_0x13f113[_0x2243('0x37')][_0x2243('0x63')])[_0x2243('0x2b')](function(){if(_['isArray'](_0x13f113[_0x2243('0x37')][_0x2243('0x63')])){for(var _0x4eb26d=0x0;_0x4eb26d<_0x13f113[_0x2243('0x37')]['ids'][_0x2243('0x4c')];_0x4eb26d+=0x1){socket[_0x2243('0x76')](_0x2243('0x7e'),{'UserId':Number(_0x13f113['query'][_0x2243('0x63')][_0x4eb26d]),'TeamId':Number(_0x13f113[_0x2243('0x55')]['id'])});}}else{socket[_0x2243('0x76')]('userTeam:remove',{'UserId':Number(_0x13f113[_0x2243('0x37')][_0x2243('0x63')]),'TeamId':Number(_0x13f113[_0x2243('0x55')]['id'])});}});}})[_0x2243('0x2b')](respondWithStatusCode(_0x3e1b7c,null))[_0x2243('0x4a')](handleError(_0x3e1b7c,null));};exports[_0x2243('0x7f')]=function(_0x20fa82,_0x4c0b5a,_0x476b6){var _0x52287c={};var _0x4a97a2={};var _0x93ffe3;var _0x4aa16b;return db[_0x2243('0x33')]['findOne']({'where':{'id':_0x20fa82['params']['id']}})['then'](handleEntityNotFound(_0x4c0b5a,null))[_0x2243('0x2b')](function(_0x28478c){if(_0x28478c){_0x93ffe3=_0x28478c;_0x4a97a2[_0x2243('0x36')]=_[_0x2243('0x5d')](db['User'][_0x2243('0x4b')]);_0x4a97a2[_0x2243('0x37')]=_[_0x2243('0x5d')](_0x20fa82[_0x2243('0x37')]);_0x4a97a2[_0x2243('0x38')]=_[_0x2243('0x39')](_0x4a97a2[_0x2243('0x36')],_0x4a97a2[_0x2243('0x37')]);_0x52287c[_0x2243('0x3a')]=_[_0x2243('0x39')](_0x4a97a2['model'],qs['fields'](_0x20fa82['query'][_0x2243('0x3b')]));_0x52287c[_0x2243('0x3a')]=_0x52287c[_0x2243('0x3a')][_0x2243('0x4c')]?_0x52287c['attributes']:_0x4a97a2[_0x2243('0x36')];_0x52287c['order']=qs[_0x2243('0x3f')](_0x20fa82[_0x2243('0x37')][_0x2243('0x3f')]);_0x52287c[_0x2243('0x40')]=qs['filters'](_[_0x2243('0x41')](_0x20fa82[_0x2243('0x37')],_0x4a97a2[_0x2243('0x38')]));if(_0x20fa82[_0x2243('0x37')][_0x2243('0x44')]){_0x52287c[_0x2243('0x40')]=_[_0x2243('0x42')](_0x52287c[_0x2243('0x40')],{'$or':_[_0x2243('0x32')](_0x52287c[_0x2243('0x3a')],function(_0x54ff0b){var _0x53916b={};_0x53916b[_0x54ff0b]={'$like':'%'+_0x20fa82['query']['filter']+'%'};return _0x53916b;})});}_0x52287c=_[_0x2243('0x42')]({},_0x52287c,_0x20fa82[_0x2243('0x45')]);return _0x93ffe3['getAgents'](_0x52287c);}})[_0x2243('0x2b')](function(_0xf3f116){if(_0xf3f116){_0x4aa16b=_0xf3f116[_0x2243('0x4c')];if(!_0x20fa82[_0x2243('0x37')]['hasOwnProperty'](_0x2243('0x3d'))){_0x52287c['limit']=qs['limit'](_0x20fa82[_0x2243('0x37')][_0x2243('0x26')]);_0x52287c['offset']=qs[_0x2243('0x25')](_0x20fa82[_0x2243('0x37')][_0x2243('0x25')]);}return _0x93ffe3[_0x2243('0x7f')](_0x52287c);}})[_0x2243('0x2b')](function(_0xd0c2ff){if(_0xd0c2ff){return _0xd0c2ff?{'count':_0x4aa16b,'rows':_0xd0c2ff}:null;}})[_0x2243('0x2b')](respondWithResult(_0x4c0b5a,null))[_0x2243('0x4a')](handleError(_0x4c0b5a,null));}; \ No newline at end of file +var _0x4b17=['addQueues','isValidChannel','removeQueues','findOne','remove','ids','addAgents','Voice','Mail','Openchannel','each','User','online','voicePause','interface','UserVoiceQueueRt','upsert','isNil','SIP/%s','omit','spread','emit','removeAgents','voice','sms','fax','userTeam:remove','getAgents','hasOwnProperty','html-pdf','rimraf','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','get','Teams','UserProfileResource','destroy','error','stack','name','send','Team','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','nolimit','sort','filter','where','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','body','getQueues','channel','Sequelize','ValidationError','Unknown\x20channel','keys','capitalize','order','pick','toLowerCase','Queues'];(function(_0x1a844a,_0x242bef){var _0x380ba1=function(_0x26bb16){while(--_0x26bb16){_0x1a844a['push'](_0x1a844a['shift']());}};_0x380ba1(++_0x242bef);}(_0x4b17,0x10f));var _0x74b1=function(_0xc14df7,_0x163f90){_0xc14df7=_0xc14df7-0x0;var _0x34a445=_0x4b17[_0xc14df7];return _0x34a445;};'use strict';var pdf=require(_0x74b1('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x74b1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x74b1('0x2'));var rp=require(_0x74b1('0x3'));var moment=require('moment');var BPromise=require(_0x74b1('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x74b1('0x5'));var sox=require(_0x74b1('0x6'));var csv=require(_0x74b1('0x7'));var ejs=require(_0x74b1('0x8'));var fs=require('fs');var _=require(_0x74b1('0x9'));var squel=require(_0x74b1('0xa'));var crypto=require(_0x74b1('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x74b1('0xc'));var toCsv=require(_0x74b1('0x7'));var querystring=require(_0x74b1('0xd'));var Papa=require(_0x74b1('0xe'));var Redis=require(_0x74b1('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x74b1('0x10'));var as=require(_0x74b1('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x74b1('0x12'))(_0x74b1('0x13'));var utils=require(_0x74b1('0x14'));var config=require(_0x74b1('0x15'));var db=require('../../mysqldb')['db'];config[_0x74b1('0x16')]=_['defaults'](config['redis'],{'host':_0x74b1('0x17'),'port':0x18eb});var socket=require(_0x74b1('0x18'))(new Redis(config['redis']));require('./team.socket')['register'](socket);function respondWithStatusCode(_0x86390,_0x5c12eb){_0x5c12eb=_0x5c12eb||0xcc;return function(_0x4e289b){if(_0x4e289b){return _0x86390[_0x74b1('0x19')](_0x5c12eb);}return _0x86390[_0x74b1('0x1a')](_0x5c12eb)[_0x74b1('0x1b')]();};}function respondWithResult(_0x420662,_0x16b147){_0x16b147=_0x16b147||0xc8;return function(_0x10138e){if(_0x10138e){return _0x420662['status'](_0x16b147)[_0x74b1('0x1c')](_0x10138e);}};}function respondWithFilteredResult(_0x213b28,_0x1a0851){return function(_0x2cfcc3){if(_0x2cfcc3){var _0xde2736=_0x2cfcc3[_0x74b1('0x1d')],_0x8c9510=_0x1a0851[_0x74b1('0x1e')],_0x1ab838=_0x1a0851['offset']+_0x1a0851[_0x74b1('0x1f')],_0x4bb3d2;if(_0x1ab838>=_0xde2736){_0x1ab838=_0xde2736;_0x4bb3d2=0xc8;}else{_0x4bb3d2=0xce;}_0x213b28[_0x74b1('0x1a')](_0x4bb3d2);return _0x213b28[_0x74b1('0x20')](_0x74b1('0x21'),_0x8c9510+'-'+_0x1ab838+'/'+_0xde2736)[_0x74b1('0x1c')](_0x2cfcc3);}return null;};}function patchUpdates(_0x33fee9){return function(_0x3ff3f4){try{jsonpatch[_0x74b1('0x22')](_0x3ff3f4,_0x33fee9,!![]);}catch(_0x5a106e){return BPromise[_0x74b1('0x23')](_0x5a106e);}return _0x3ff3f4['save']();};}function saveUpdates(_0x5da0f7,_0x481bf2){return function(_0x27fd1a){if(_0x27fd1a){return _0x27fd1a[_0x74b1('0x24')](_0x5da0f7)[_0x74b1('0x25')](function(_0x44bf7e){return _0x44bf7e;});}return null;};}function removeEntity(_0x563781,_0x4ee88b){return function(_0x3c78e5){if(_0x3c78e5){return _0x3c78e5['destroy']()[_0x74b1('0x25')](function(){var _0x4376c7=_0x3c78e5[_0x74b1('0x26')]({'plain':!![]});var _0x14a651=_0x74b1('0x27');return db[_0x74b1('0x28')][_0x74b1('0x29')]({'where':{'type':_0x14a651,'resourceId':_0x4376c7['id']}})[_0x74b1('0x25')](function(){return _0x3c78e5;});})['then'](function(){_0x563781[_0x74b1('0x1a')](0xcc)[_0x74b1('0x1b')]();});}};}function handleEntityNotFound(_0x4099af,_0x5c32d2){return function(_0x1998cd){if(!_0x1998cd){_0x4099af[_0x74b1('0x19')](0x194);}return _0x1998cd;};}function handleError(_0x94b1f8,_0x1b011a){_0x1b011a=_0x1b011a||0x1f4;return function(_0x26d9f1){logger[_0x74b1('0x2a')](_0x26d9f1[_0x74b1('0x2b')]);if(_0x26d9f1[_0x74b1('0x2c')]){delete _0x26d9f1['name'];}_0x94b1f8[_0x74b1('0x1a')](_0x1b011a)[_0x74b1('0x2d')](_0x26d9f1);};}exports['index']=function(_0x543b5,_0x45404f){var _0x1ac433={},_0x5f4d1b={},_0x113300={'count':0x0,'rows':[]};var _0x46b642=_['map'](db[_0x74b1('0x2e')][_0x74b1('0x2f')],function(_0x2211b2){return{'name':_0x2211b2[_0x74b1('0x30')],'type':_0x2211b2[_0x74b1('0x31')][_0x74b1('0x32')]};});_0x5f4d1b[_0x74b1('0x33')]=_[_0x74b1('0x34')](_0x46b642,'name');_0x5f4d1b[_0x74b1('0x35')]=_['keys'](_0x543b5['query']);_0x5f4d1b[_0x74b1('0x36')]=_['intersection'](_0x5f4d1b['model'],_0x5f4d1b[_0x74b1('0x35')]);_0x1ac433[_0x74b1('0x37')]=_[_0x74b1('0x38')](_0x5f4d1b[_0x74b1('0x33')],qs[_0x74b1('0x39')](_0x543b5[_0x74b1('0x35')][_0x74b1('0x39')]));_0x1ac433[_0x74b1('0x37')]=_0x1ac433['attributes']['length']?_0x1ac433['attributes']:_0x5f4d1b[_0x74b1('0x33')];if(!_0x543b5['query']['hasOwnProperty'](_0x74b1('0x3a'))){_0x1ac433[_0x74b1('0x1f')]=qs[_0x74b1('0x1f')](_0x543b5['query'][_0x74b1('0x1f')]);_0x1ac433['offset']=qs[_0x74b1('0x1e')](_0x543b5[_0x74b1('0x35')]['offset']);}_0x1ac433['order']=qs[_0x74b1('0x3b')](_0x543b5[_0x74b1('0x35')]['sort']);_0x1ac433['where']=qs[_0x74b1('0x36')](_['pick'](_0x543b5[_0x74b1('0x35')],_0x5f4d1b[_0x74b1('0x36')]));if(_0x543b5[_0x74b1('0x35')][_0x74b1('0x3c')]){_0x1ac433[_0x74b1('0x3d')]=_['merge'](_0x1ac433[_0x74b1('0x3d')],{'$or':_['map'](_0x46b642,function(_0x41a78b){if(_0x41a78b['type']!==_0x74b1('0x3e')){var _0x4a222c={};_0x4a222c[_0x41a78b['name']]={'$like':'%'+_0x543b5[_0x74b1('0x35')][_0x74b1('0x3c')]+'%'};return _0x4a222c;}})});}_0x1ac433=_[_0x74b1('0x3f')]({},_0x1ac433,_0x543b5['options']);var _0x3c3d80={'where':_0x1ac433[_0x74b1('0x3d')]};return db[_0x74b1('0x2e')]['count'](_0x3c3d80)[_0x74b1('0x25')](function(_0x2298b9){_0x113300['count']=_0x2298b9;if(_0x543b5['query'][_0x74b1('0x40')]){_0x1ac433[_0x74b1('0x41')]=[{'all':!![]}];}return db[_0x74b1('0x2e')][_0x74b1('0x42')](_0x1ac433);})[_0x74b1('0x25')](function(_0x1cded3){_0x113300[_0x74b1('0x43')]=_0x1cded3;return _0x113300;})['then'](respondWithFilteredResult(_0x45404f,_0x1ac433))[_0x74b1('0x44')](handleError(_0x45404f,null));};exports[_0x74b1('0x45')]=function(_0x456c6e,_0x452fa0){var _0x17a44f={'raw':![],'where':{'id':_0x456c6e[_0x74b1('0x46')]['id']}},_0x525a8f={};_0x525a8f[_0x74b1('0x33')]=_['keys'](db['Team'][_0x74b1('0x2f')]);_0x525a8f[_0x74b1('0x35')]=_['keys'](_0x456c6e[_0x74b1('0x35')]);_0x525a8f[_0x74b1('0x36')]=_[_0x74b1('0x38')](_0x525a8f[_0x74b1('0x33')],_0x525a8f[_0x74b1('0x35')]);_0x17a44f[_0x74b1('0x37')]=_[_0x74b1('0x38')](_0x525a8f['model'],qs['fields'](_0x456c6e['query'][_0x74b1('0x39')]));_0x17a44f[_0x74b1('0x37')]=_0x17a44f[_0x74b1('0x37')][_0x74b1('0x47')]?_0x17a44f[_0x74b1('0x37')]:_0x525a8f['model'];if(_0x456c6e[_0x74b1('0x35')][_0x74b1('0x40')]){_0x17a44f[_0x74b1('0x41')]=[{'all':!![]}];}_0x17a44f=_[_0x74b1('0x3f')]({},_0x17a44f,_0x456c6e[_0x74b1('0x48')]);return db[_0x74b1('0x2e')][_0x74b1('0x49')](_0x17a44f)[_0x74b1('0x25')](handleEntityNotFound(_0x452fa0,null))[_0x74b1('0x25')](respondWithResult(_0x452fa0,null))[_0x74b1('0x44')](handleError(_0x452fa0,null));};exports[_0x74b1('0x4a')]=function(_0x3038f9,_0x52dad7){return db[_0x74b1('0x2e')][_0x74b1('0x4a')](_0x3038f9['body'],{})[_0x74b1('0x25')](function(_0x4923d2){var _0x4b1add=_0x3038f9[_0x74b1('0x4b')]['get']({'plain':!![]});if(!_0x4b1add)throw new Error(_0x74b1('0x4c'));if(_0x4b1add[_0x74b1('0x4d')]===_0x74b1('0x4b')){var _0x549f03=_0x4923d2[_0x74b1('0x26')]({'plain':!![]});var _0x418652=_0x74b1('0x27');return db[_0x74b1('0x4e')][_0x74b1('0x49')]({'where':{'name':_0x418652,'userProfileId':_0x4b1add['userProfileId']},'raw':!![]})[_0x74b1('0x25')](function(_0x594411){if(_0x594411&&_0x594411[_0x74b1('0x4f')]===0x0){return db[_0x74b1('0x28')]['create']({'name':_0x549f03[_0x74b1('0x2c')],'resourceId':_0x549f03['id'],'type':_0x594411[_0x74b1('0x2c')],'sectionId':_0x594411['id']},{})[_0x74b1('0x25')](function(){return _0x4923d2;});}else{return _0x4923d2;}})['catch'](function(_0x3b6838){logger[_0x74b1('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3b6838);throw _0x3b6838;});}return _0x4923d2;})[_0x74b1('0x25')](respondWithResult(_0x52dad7,0xc9))['catch'](handleError(_0x52dad7,null));};exports['update']=function(_0x18cd64,_0xe56ebd){if(_0x18cd64[_0x74b1('0x50')]['id']){delete _0x18cd64[_0x74b1('0x50')]['id'];}return db[_0x74b1('0x2e')]['find']({'where':{'id':_0x18cd64[_0x74b1('0x46')]['id']}})[_0x74b1('0x25')](handleEntityNotFound(_0xe56ebd,null))['then'](saveUpdates(_0x18cd64[_0x74b1('0x50')],null))[_0x74b1('0x25')](respondWithResult(_0xe56ebd,null))[_0x74b1('0x44')](handleError(_0xe56ebd,null));};exports['destroy']=function(_0x2fac5d,_0x3c1d44){return db[_0x74b1('0x2e')]['find']({'where':{'id':_0x2fac5d[_0x74b1('0x46')]['id']}})[_0x74b1('0x25')](handleEntityNotFound(_0x3c1d44,null))[_0x74b1('0x25')](removeEntity(_0x3c1d44,null))[_0x74b1('0x44')](handleError(_0x3c1d44,null));};exports[_0x74b1('0x51')]=function(_0x44550e,_0x5b8852,_0x36d413){return db['Team']['findOne']({'where':{'id':_0x44550e[_0x74b1('0x46')]['id']}})['then'](handleEntityNotFound(_0x5b8852,null))['then'](function(_0x10eab8){if(!_0x44550e[_0x74b1('0x35')][_0x74b1('0x52')]||!utils['isValidChannel'](_0x44550e[_0x74b1('0x35')][_0x74b1('0x52')])){throw new db[(_0x74b1('0x53'))][(_0x74b1('0x54'))](_0x74b1('0x55'));}var _0x39a4e0={};var _0x54fb57={};_0x54fb57[_0x74b1('0x33')]=_[_0x74b1('0x56')](db[_[_0x74b1('0x57')](_0x44550e[_0x74b1('0x35')][_0x74b1('0x52')]['toLowerCase']())+'Queue'][_0x74b1('0x2f')]);_0x54fb57['query']=_[_0x74b1('0x56')](_0x44550e[_0x74b1('0x35')]);_0x54fb57['filters']=_['intersection'](_0x54fb57[_0x74b1('0x33')],_0x54fb57[_0x74b1('0x35')]);_0x39a4e0[_0x74b1('0x37')]=_[_0x74b1('0x38')](_0x54fb57[_0x74b1('0x33')],qs[_0x74b1('0x39')](_0x44550e[_0x74b1('0x35')][_0x74b1('0x39')]));_0x39a4e0[_0x74b1('0x37')]=_0x39a4e0[_0x74b1('0x37')][_0x74b1('0x47')]?_0x39a4e0[_0x74b1('0x37')]:_0x54fb57['model'];_0x39a4e0[_0x74b1('0x1f')]=qs[_0x74b1('0x1f')](_0x44550e[_0x74b1('0x35')][_0x74b1('0x1f')]);_0x39a4e0['offset']=qs[_0x74b1('0x1e')](_0x44550e[_0x74b1('0x35')]['offset']);_0x39a4e0[_0x74b1('0x58')]=qs['sort'](_0x44550e[_0x74b1('0x35')][_0x74b1('0x3b')]);_0x39a4e0['where']=qs[_0x74b1('0x36')](_[_0x74b1('0x59')](_0x44550e[_0x74b1('0x35')],_0x54fb57['filters']));_0x39a4e0=_[_0x74b1('0x3f')]({},_0x39a4e0,_0x44550e['options']);return _0x10eab8[_0x74b1('0x26')+_[_0x74b1('0x57')](_0x44550e[_0x74b1('0x35')][_0x74b1('0x52')][_0x74b1('0x5a')]())+_0x74b1('0x5b')](_0x39a4e0);})[_0x74b1('0x25')](respondWithResult(_0x5b8852,null))[_0x74b1('0x44')](handleError(_0x5b8852,null));};exports[_0x74b1('0x5c')]=function(_0x1cdee3,_0x8b4902,_0x44563d){return db[_0x74b1('0x2e')]['findOne']({'where':{'id':_0x1cdee3[_0x74b1('0x46')]['id']}})[_0x74b1('0x25')](function(_0x39aabf){if(_0x39aabf){if(!_0x1cdee3[_0x74b1('0x50')][_0x74b1('0x52')]||!utils[_0x74b1('0x5d')](_0x1cdee3[_0x74b1('0x50')][_0x74b1('0x52')])){throw new db[(_0x74b1('0x53'))]['ValidationError'](_0x74b1('0x55'));}return _0x39aabf['add'+_[_0x74b1('0x57')](_0x1cdee3['body']['channel'][_0x74b1('0x5a')]())+_0x74b1('0x5b')](_0x1cdee3[_0x74b1('0x50')]['ids']);}return null;})[_0x74b1('0x25')](handleEntityNotFound(_0x8b4902,null))[_0x74b1('0x25')](respondWithStatusCode(_0x8b4902,null))['catch'](handleError(_0x8b4902,null));};exports[_0x74b1('0x5e')]=function(_0x3d708c,_0x2d3796,_0x21e767){return db[_0x74b1('0x2e')][_0x74b1('0x5f')]({'where':{'id':_0x3d708c[_0x74b1('0x46')]['id']}})[_0x74b1('0x25')](function(_0x43aaf6){if(_0x43aaf6){if(!_0x3d708c[_0x74b1('0x35')]['channel']||!utils[_0x74b1('0x5d')](_0x3d708c[_0x74b1('0x35')][_0x74b1('0x52')])){throw new db['Sequelize'][(_0x74b1('0x54'))](_0x74b1('0x55'));}return _0x43aaf6[_0x74b1('0x60')+_[_0x74b1('0x57')](_0x3d708c[_0x74b1('0x35')]['channel'][_0x74b1('0x5a')]())+_0x74b1('0x5b')](_0x3d708c[_0x74b1('0x35')][_0x74b1('0x61')]);}return null;})[_0x74b1('0x25')](handleEntityNotFound(_0x2d3796,null))[_0x74b1('0x25')](respondWithStatusCode(_0x2d3796,null))[_0x74b1('0x44')](handleError(_0x2d3796,null));};exports[_0x74b1('0x62')]=function(_0x4bd49b,_0x16e242,_0x1633dd){return db[_0x74b1('0x2e')]['find']({'where':{'id':_0x4bd49b['params']['id']}})[_0x74b1('0x25')](handleEntityNotFound(_0x16e242,null))[_0x74b1('0x25')](function(_0x1675d8){if(_0x1675d8){var _0x286012=[_0x74b1('0x63'),'Chat',_0x74b1('0x64'),'Sms','Fax',_0x74b1('0x65')];return BPromise[_0x74b1('0x66')](_0x286012,function(_0x24c6e1){return _0x1675d8[_0x74b1('0x26')+_0x24c6e1+_0x74b1('0x5b')]({'attributes':['id',_0x74b1('0x2c')]})[_0x74b1('0x25')](function(_0x394dd2){return BPromise['each'](_0x394dd2,function(_0x4a6e94){return _0x4a6e94['addAgents'](_0x4bd49b[_0x74b1('0x50')][_0x74b1('0x61')])[_0x74b1('0x25')](function(){if(_0x24c6e1===_0x74b1('0x63')){return db[_0x74b1('0x67')][_0x74b1('0x42')]({'where':{'id':_0x4bd49b[_0x74b1('0x50')][_0x74b1('0x61')]},'attributes':['id',_0x74b1('0x2c'),_0x74b1('0x68'),_0x74b1('0x69'),_0x74b1('0x6a')],'raw':!![]})['then'](function(_0x110bc1){return BPromise[_0x74b1('0x66')](_[_0x74b1('0x3c')](_0x110bc1,{'online':0x1}),function(_0x1c61ff){return db[_0x74b1('0x6b')][_0x74b1('0x6c')]({'membername':_0x1c61ff['name'],'UserId':_0x1c61ff['id'],'queue_name':_0x4a6e94[_0x74b1('0x2c')],'VoiceQueueId':_0x4a6e94['id'],'interface':_[_0x74b1('0x6d')](_0x1c61ff[_0x74b1('0x6a')])?util['format'](_0x74b1('0x6e'),_0x1c61ff[_0x74b1('0x2c')]):_0x1c61ff[_0x74b1('0x6a')],'paused':_0x1c61ff[_0x74b1('0x69')]||![],'penalty':0x0});});});}});});})['then'](function(){return _0x1675d8;});})[_0x74b1('0x25')](function(){return _0x1675d8;});}})[_0x74b1('0x25')](function(_0x2846c4){if(_0x2846c4){return _0x2846c4[_0x74b1('0x62')](_0x4bd49b[_0x74b1('0x50')]['ids'],_[_0x74b1('0x6f')](_0x4bd49b[_0x74b1('0x50')],['ids','id'])||{})[_0x74b1('0x70')](function(_0x1a2b2c){for(var _0x578023=0x0;_0x578023<_0x4bd49b[_0x74b1('0x50')][_0x74b1('0x61')][_0x74b1('0x47')];_0x578023+=0x1){socket[_0x74b1('0x71')]('userTeam:save',{'UserId':_0x4bd49b['body'][_0x74b1('0x61')][_0x578023],'TeamId':_0x4bd49b[_0x74b1('0x46')]['id']});}return _0x1a2b2c;});}})[_0x74b1('0x25')](respondWithResult(_0x16e242,null))['catch'](handleError(_0x16e242,null));};exports[_0x74b1('0x72')]=function(_0x1137cf,_0x5077b1,_0x58748a){return db[_0x74b1('0x2e')][_0x74b1('0x49')]({'where':{'id':_0x1137cf[_0x74b1('0x46')]['id']}})['then'](handleEntityNotFound(_0x5077b1,null))[_0x74b1('0x25')](function(_0x73c68b){if(_0x73c68b){return BPromise[_0x74b1('0x66')]([_0x74b1('0x73'),'chat','mail',_0x74b1('0x74'),_0x74b1('0x75'),'openchannel'],function(_0x1bf4a4){return _0x73c68b[_0x74b1('0x26')+_[_0x74b1('0x57')](_0x1bf4a4)+_0x74b1('0x5b')]({'attributes':['id',_0x74b1('0x2c')]})[_0x74b1('0x25')](function(_0x144135){return BPromise[_0x74b1('0x66')](_0x144135,function(_0x21453e){return _0x21453e[_0x74b1('0x72')](_0x1137cf['query'][_0x74b1('0x61')])[_0x74b1('0x25')](function(){if(_0x1bf4a4===_0x74b1('0x73')){return db[_0x74b1('0x6b')][_0x74b1('0x29')]({'where':{'VoiceQueueId':_0x21453e['id'],'UserId':_0x1137cf[_0x74b1('0x35')]['ids']}});}});});})[_0x74b1('0x25')](function(){return _0x73c68b;});})['then'](function(){return _0x73c68b;});}})[_0x74b1('0x25')](function(_0x32e81c){if(_0x32e81c){return _0x32e81c[_0x74b1('0x72')](_0x1137cf['query'][_0x74b1('0x61')])[_0x74b1('0x25')](function(){if(_['isArray'](_0x1137cf['query']['ids'])){for(var _0x1cbfde=0x0;_0x1cbfde<_0x1137cf[_0x74b1('0x35')][_0x74b1('0x61')][_0x74b1('0x47')];_0x1cbfde+=0x1){socket[_0x74b1('0x71')](_0x74b1('0x76'),{'UserId':Number(_0x1137cf[_0x74b1('0x35')][_0x74b1('0x61')][_0x1cbfde]),'TeamId':Number(_0x1137cf[_0x74b1('0x46')]['id'])});}}else{socket[_0x74b1('0x71')](_0x74b1('0x76'),{'UserId':Number(_0x1137cf[_0x74b1('0x35')]['ids']),'TeamId':Number(_0x1137cf[_0x74b1('0x46')]['id'])});}});}})[_0x74b1('0x25')](respondWithStatusCode(_0x5077b1,null))[_0x74b1('0x44')](handleError(_0x5077b1,null));};exports['getAgents']=function(_0xb27f,_0x3b3e67,_0x1aed4c){var _0x5d74e5={};var _0x1e0b56={};var _0x5fd6ef;var _0x42c51b;return db['Team'][_0x74b1('0x5f')]({'where':{'id':_0xb27f[_0x74b1('0x46')]['id']}})[_0x74b1('0x25')](handleEntityNotFound(_0x3b3e67,null))[_0x74b1('0x25')](function(_0x31f12b){if(_0x31f12b){_0x5fd6ef=_0x31f12b;_0x1e0b56[_0x74b1('0x33')]=_[_0x74b1('0x56')](db[_0x74b1('0x67')][_0x74b1('0x2f')]);_0x1e0b56[_0x74b1('0x35')]=_[_0x74b1('0x56')](_0xb27f[_0x74b1('0x35')]);_0x1e0b56[_0x74b1('0x36')]=_[_0x74b1('0x38')](_0x1e0b56[_0x74b1('0x33')],_0x1e0b56[_0x74b1('0x35')]);_0x5d74e5[_0x74b1('0x37')]=_['intersection'](_0x1e0b56[_0x74b1('0x33')],qs[_0x74b1('0x39')](_0xb27f['query'][_0x74b1('0x39')]));_0x5d74e5[_0x74b1('0x37')]=_0x5d74e5[_0x74b1('0x37')][_0x74b1('0x47')]?_0x5d74e5[_0x74b1('0x37')]:_0x1e0b56[_0x74b1('0x33')];_0x5d74e5['order']=qs['sort'](_0xb27f[_0x74b1('0x35')][_0x74b1('0x3b')]);_0x5d74e5[_0x74b1('0x3d')]=qs[_0x74b1('0x36')](_[_0x74b1('0x59')](_0xb27f[_0x74b1('0x35')],_0x1e0b56['filters']));if(_0xb27f[_0x74b1('0x35')][_0x74b1('0x3c')]){_0x5d74e5[_0x74b1('0x3d')]=_[_0x74b1('0x3f')](_0x5d74e5['where'],{'$or':_[_0x74b1('0x34')](_0x5d74e5[_0x74b1('0x37')],function(_0x5546ce){var _0x1f55a1={};_0x1f55a1[_0x5546ce]={'$like':'%'+_0xb27f[_0x74b1('0x35')][_0x74b1('0x3c')]+'%'};return _0x1f55a1;})});}_0x5d74e5=_[_0x74b1('0x3f')]({},_0x5d74e5,_0xb27f[_0x74b1('0x48')]);return _0x5fd6ef[_0x74b1('0x77')](_0x5d74e5);}})[_0x74b1('0x25')](function(_0x33b136){if(_0x33b136){_0x42c51b=_0x33b136['length'];if(!_0xb27f[_0x74b1('0x35')][_0x74b1('0x78')]('nolimit')){_0x5d74e5[_0x74b1('0x1f')]=qs[_0x74b1('0x1f')](_0xb27f[_0x74b1('0x35')][_0x74b1('0x1f')]);_0x5d74e5[_0x74b1('0x1e')]=qs[_0x74b1('0x1e')](_0xb27f[_0x74b1('0x35')]['offset']);}return _0x5fd6ef[_0x74b1('0x77')](_0x5d74e5);}})['then'](function(_0x3d2569){if(_0x3d2569){return _0x3d2569?{'count':_0x42c51b,'rows':_0x3d2569}:null;}})[_0x74b1('0x25')](respondWithResult(_0x3b3e67,null))['catch'](handleError(_0x3b3e67,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 612f521..2f83ecd 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 _0xfe48=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','Team'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xfe48,0x18c));var _0x8fe4=function(_0x5c30a3,_0x2b165e){_0x5c30a3=_0x5c30a3-0x0;var _0x341d09=_0xfe48[_0x5c30a3];return _0x341d09;};'use strict';var EventEmitter=require(_0x8fe4('0x0'));var Team=require(_0x8fe4('0x1'))['db'][_0x8fe4('0x2')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1d3f43){return function(_0x27a6f4,_0x1842d4,_0x360e92){TeamEvents[_0x8fe4('0x3')](_0x1d3f43+':'+_0x27a6f4['id'],_0x27a6f4);TeamEvents['emit'](_0x1d3f43,_0x27a6f4);_0x360e92(null);};}for(var e in events){if(events[_0x8fe4('0x4')](e)){var event=events[e];Team[_0x8fe4('0x5')](e,emitEvent(event));}}module[_0x8fe4('0x6')]=TeamEvents; \ No newline at end of file +var _0x4779=['events','Team','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4779,0x1b0));var _0x9477=function(_0x4a5052,_0x580863){_0x4a5052=_0x4a5052-0x0;var _0x5c24e9=_0x4779[_0x4a5052];return _0x5c24e9;};'use strict';var EventEmitter=require(_0x9477('0x0'));var Team=require('../../mysqldb')['db'][_0x9477('0x1')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9477('0x2'),'afterUpdate':_0x9477('0x3'),'afterDestroy':_0x9477('0x4')};function emitEvent(_0x296ec2){return function(_0x16fa19,_0xb3e2c7,_0x5114cf){TeamEvents[_0x9477('0x5')](_0x296ec2+':'+_0x16fa19['id'],_0x16fa19);TeamEvents[_0x9477('0x5')](_0x296ec2,_0x16fa19);_0x5114cf(null);};}for(var e in events){if(events[_0x9477('0x6')](e)){var event=events[e];Team[_0x9477('0x7')](e,emitEvent(event));}}module[_0x9477('0x8')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index c01f7bb..759ceda 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 _0xed64=['rimraf','../../config/environment','./team.attributes','define','teams','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1a1fbd,_0x31a316){var _0xea631b=function(_0x44a3b1){while(--_0x44a3b1){_0x1a1fbd['push'](_0x1a1fbd['shift']());}};_0xea631b(++_0x31a316);}(_0xed64,0xdd));var _0x4ed6=function(_0x6ec16,_0x2e8212){_0x6ec16=_0x6ec16-0x0;var _0x2b62ac=_0xed64[_0x6ec16];return _0x2b62ac;};'use strict';var _=require(_0x4ed6('0x0'));var util=require(_0x4ed6('0x1'));var logger=require(_0x4ed6('0x2'))(_0x4ed6('0x3'));var moment=require(_0x4ed6('0x4'));var BPromise=require(_0x4ed6('0x5'));var rp=require(_0x4ed6('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4ed6('0x7'));var config=require(_0x4ed6('0x8'));var attributes=require(_0x4ed6('0x9'));module['exports']=function(_0x416c4a,_0x6d3943){return _0x416c4a[_0x4ed6('0xa')]('Team',attributes,{'tableName':_0x4ed6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x057e=['teams','lodash','util','../../config/logger','moment','bluebird','rimraf','../../config/environment','./team.attributes','define','Team'];(function(_0x861494,_0x46de92){var _0x4c7f98=function(_0x240616){while(--_0x240616){_0x861494['push'](_0x861494['shift']());}};_0x4c7f98(++_0x46de92);}(_0x057e,0xfe));var _0xe057=function(_0x3125a9,_0x36a1b2){_0x3125a9=_0x3125a9-0x0;var _0xae6757=_0x057e[_0x3125a9];return _0xae6757;};'use strict';var _=require(_0xe057('0x0'));var util=require(_0xe057('0x1'));var logger=require(_0xe057('0x2'))('api');var moment=require(_0xe057('0x3'));var BPromise=require(_0xe057('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe057('0x5'));var config=require(_0xe057('0x6'));var attributes=require(_0xe057('0x7'));module['exports']=function(_0xbaa814,_0x389ec2){return _0xbaa814[_0xe057('0x8')](_0xe057('0x9'),attributes,{'tableName':_0xe057('0xa'),'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 738c947..ab2b578 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 _0x8d70=['message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./team.socket','register','request','then','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x8d70,0x16f));var _0x08d7=function(_0x14812f,_0x4bb192){_0x14812f=_0x14812f-0x0;var _0x255611=_0x8d70[_0x14812f];return _0x255611;};'use strict';var _=require('lodash');var util=require(_0x08d7('0x0'));var moment=require(_0x08d7('0x1'));var BPromise=require('bluebird');var rs=require(_0x08d7('0x2'));var fs=require('fs');var Redis=require(_0x08d7('0x3'));var db=require(_0x08d7('0x4'))['db'];var utils=require(_0x08d7('0x5'));var logger=require(_0x08d7('0x6'))(_0x08d7('0x7'));var config=require('../../config/environment');var jayson=require(_0x08d7('0x8'));var client=jayson[_0x08d7('0x9')][_0x08d7('0xa')]({'port':0x232a});config[_0x08d7('0xb')]=_['defaults'](config[_0x08d7('0xb')],{'host':_0x08d7('0xc'),'port':0x18eb});var socket=require(_0x08d7('0xd'))(new Redis(config['redis']));require(_0x08d7('0xe'))[_0x08d7('0xf')](socket);function respondWithRpcPromise(_0x89e365,_0x2a158e,_0x186e03){return new BPromise(function(_0x2c5ab6,_0x396f90){return client[_0x08d7('0x10')](_0x89e365,_0x186e03)[_0x08d7('0x11')](function(_0x574d5e){logger['info'](_0x08d7('0x12'),_0x2a158e,_0x08d7('0x13'));logger[_0x08d7('0x14')](_0x08d7('0x15'),_0x2a158e,_0x08d7('0x13'),JSON[_0x08d7('0x16')](_0x574d5e));if(_0x574d5e[_0x08d7('0x17')]){if(_0x574d5e['error'][_0x08d7('0x18')]===0x1f4){logger['error'](_0x08d7('0x12'),_0x2a158e,_0x574d5e['error'][_0x08d7('0x19')]);return _0x396f90(_0x574d5e[_0x08d7('0x17')]['message']);}logger[_0x08d7('0x17')](_0x08d7('0x12'),_0x2a158e,_0x574d5e['error'][_0x08d7('0x19')]);return _0x2c5ab6(_0x574d5e[_0x08d7('0x17')][_0x08d7('0x19')]);}else{logger['info'](_0x08d7('0x12'),_0x2a158e,_0x08d7('0x13'));_0x2c5ab6(_0x574d5e[_0x08d7('0x1a')][_0x08d7('0x19')]);}})[_0x08d7('0x1b')](function(_0xf54f71){logger[_0x08d7('0x17')]('Team,\x20%s,\x20%s',_0x2a158e,_0xf54f71);_0x396f90(_0xf54f71);});});} \ No newline at end of file +var _0x26f5=['request\x20sent','debug','stringify','error','code','message','result','catch','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','client','defaults','localhost','redis','./team.socket','register','request','then','info','Team,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x26f5,0xb7));var _0x526f=function(_0x2b6a32,_0x1a6d5f){_0x2b6a32=_0x2b6a32-0x0;var _0xd926d7=_0x26f5[_0x2b6a32];return _0xd926d7;};'use strict';var _=require('lodash');var util=require(_0x526f('0x0'));var moment=require(_0x526f('0x1'));var BPromise=require(_0x526f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x526f('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x526f('0x4'))(_0x526f('0x5'));var config=require(_0x526f('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x526f('0x7')]['http']({'port':0x232a});config['redis']=_[_0x526f('0x8')](config['redis'],{'host':_0x526f('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x526f('0xa')]));require(_0x526f('0xb'))[_0x526f('0xc')](socket);function respondWithRpcPromise(_0x5ef422,_0xbda660,_0x474499){return new BPromise(function(_0x51030c,_0x42f508){return client[_0x526f('0xd')](_0x5ef422,_0x474499)[_0x526f('0xe')](function(_0x3bdc41){logger[_0x526f('0xf')](_0x526f('0x10'),_0xbda660,_0x526f('0x11'));logger[_0x526f('0x12')]('Team,\x20%s,\x20%s,\x20%s',_0xbda660,_0x526f('0x11'),JSON[_0x526f('0x13')](_0x3bdc41));if(_0x3bdc41['error']){if(_0x3bdc41[_0x526f('0x14')][_0x526f('0x15')]===0x1f4){logger[_0x526f('0x14')](_0x526f('0x10'),_0xbda660,_0x3bdc41[_0x526f('0x14')][_0x526f('0x16')]);return _0x42f508(_0x3bdc41[_0x526f('0x14')][_0x526f('0x16')]);}logger[_0x526f('0x14')](_0x526f('0x10'),_0xbda660,_0x3bdc41['error']['message']);return _0x51030c(_0x3bdc41[_0x526f('0x14')][_0x526f('0x16')]);}else{logger['info']('Team,\x20%s,\x20%s',_0xbda660,'request\x20sent');_0x51030c(_0x3bdc41[_0x526f('0x17')][_0x526f('0x16')]);}})[_0x526f('0x18')](function(_0x546806){logger[_0x526f('0x14')]('Team,\x20%s,\x20%s',_0xbda660,_0x546806);_0x42f508(_0x546806);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 15e4f76..cf5c95b 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 _0xf494=['save','remove','emit','removeListener','register','team:','./team.events'];(function(_0x241fe5,_0x1d502d){var _0x9d1fd8=function(_0x52be08){while(--_0x52be08){_0x241fe5['push'](_0x241fe5['shift']());}};_0x9d1fd8(++_0x1d502d);}(_0xf494,0x1c6));var _0x4f49=function(_0x356bb6,_0x20aae7){_0x356bb6=_0x356bb6-0x0;var _0x138e71=_0xf494[_0x356bb6];return _0x138e71;};'use strict';var TeamEvents=require(_0x4f49('0x0'));var events=[_0x4f49('0x1'),_0x4f49('0x2'),'update'];function createListener(_0x3aeeb8,_0x1d54cc){return function(_0x423b25){_0x1d54cc[_0x4f49('0x3')](_0x3aeeb8,_0x423b25);};}function removeListener(_0x20c0d7,_0x2a15fb){return function(){TeamEvents[_0x4f49('0x4')](_0x20c0d7,_0x2a15fb);};}exports[_0x4f49('0x5')]=function(_0xc5e778){for(var _0x413530=0x0,_0x42b0e8=events['length'];_0x413530<_0x42b0e8;_0x413530++){var _0x58e9a0=events[_0x413530];var _0x169c95=createListener(_0x4f49('0x6')+_0x58e9a0,_0xc5e778);TeamEvents['on'](_0x58e9a0,_0x169c95);}}; \ No newline at end of file +var _0xb234=['save','update','removeListener','team:','./team.events'];(function(_0x5e77db,_0x356d1c){var _0x34b675=function(_0x4914b5){while(--_0x4914b5){_0x5e77db['push'](_0x5e77db['shift']());}};_0x34b675(++_0x356d1c);}(_0xb234,0x13f));var _0x4b23=function(_0x56cc33,_0x3b3f14){_0x56cc33=_0x56cc33-0x0;var _0x2b2b82=_0xb234[_0x56cc33];return _0x2b2b82;};'use strict';var TeamEvents=require(_0x4b23('0x0'));var events=[_0x4b23('0x1'),'remove',_0x4b23('0x2')];function createListener(_0xdc6d0a,_0x28cbfe){return function(_0x5570ad){_0x28cbfe['emit'](_0xdc6d0a,_0x5570ad);};}function removeListener(_0x5557dc,_0x36c95e){return function(){TeamEvents[_0x4b23('0x3')](_0x5557dc,_0x36c95e);};}exports['register']=function(_0x3767b1){for(var _0x538204=0x0,_0x34a49f=events['length'];_0x538204<_0x34a49f;_0x538204++){var _0x48fc53=events[_0x538204];var _0xc81b6a=createListener(_0x4b23('0x4')+_0x48fc53,_0x3767b1);TeamEvents['on'](_0x48fc53,_0xc81b6a);}}; \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index ff3884e..8a20de7 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 _0xe7ac=['exports','multer','util','path','express','../../components/interaction/service','./template.controller','get','isAuthenticated','index','/:id','show','post','put','update','destroy'];(function(_0x4229e6,_0x2f20a0){var _0x2c89af=function(_0x1a34f8){while(--_0x1a34f8){_0x4229e6['push'](_0x4229e6['shift']());}};_0x2c89af(++_0x2f20a0);}(_0xe7ac,0x1e1));var _0xce7a=function(_0x404652,_0x3adec6){_0x404652=_0x404652-0x0;var _0x18b13b=_0xe7ac[_0x404652];return _0x18b13b;};'use strict';var multer=require(_0xce7a('0x0'));var util=require(_0xce7a('0x1'));var path=require(_0xce7a('0x2'));var timeout=require('connect-timeout');var express=require(_0xce7a('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xce7a('0x4'));var config=require('../../config/environment');var controller=require(_0xce7a('0x5'));router[_0xce7a('0x6')]('/',auth[_0xce7a('0x7')](),controller[_0xce7a('0x8')]);router[_0xce7a('0x6')](_0xce7a('0x9'),auth['isAuthenticated'](),controller[_0xce7a('0xa')]);router[_0xce7a('0xb')]('/',auth[_0xce7a('0x7')](),controller['create']);router[_0xce7a('0xc')](_0xce7a('0x9'),auth['isAuthenticated'](),controller[_0xce7a('0xd')]);router['delete'](_0xce7a('0x9'),auth[_0xce7a('0x7')](),controller[_0xce7a('0xe')]);module[_0xce7a('0xf')]=router; \ No newline at end of file +var _0x3cc6=['get','index','/:id','isAuthenticated','show','post','create','put','delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x11880b,_0x129bb9){var _0x1a1df0=function(_0x2160cc){while(--_0x2160cc){_0x11880b['push'](_0x11880b['shift']());}};_0x1a1df0(++_0x129bb9);}(_0x3cc6,0x184));var _0x63cc=function(_0x4b68ad,_0x2a762f){_0x4b68ad=_0x4b68ad-0x0;var _0x45a785=_0x3cc6[_0x4b68ad];return _0x45a785;};'use strict';var multer=require(_0x63cc('0x0'));var util=require(_0x63cc('0x1'));var path=require(_0x63cc('0x2'));var timeout=require('connect-timeout');var express=require(_0x63cc('0x3'));var router=express[_0x63cc('0x4')]();var auth=require(_0x63cc('0x5'));var interaction=require(_0x63cc('0x6'));var config=require(_0x63cc('0x7'));var controller=require('./template.controller');router[_0x63cc('0x8')]('/',auth['isAuthenticated'](),controller[_0x63cc('0x9')]);router[_0x63cc('0x8')](_0x63cc('0xa'),auth[_0x63cc('0xb')](),controller[_0x63cc('0xc')]);router[_0x63cc('0xd')]('/',auth[_0x63cc('0xb')](),controller[_0x63cc('0xe')]);router[_0x63cc('0xf')](_0x63cc('0xa'),auth[_0x63cc('0xb')](),controller['update']);router[_0x63cc('0x10')](_0x63cc('0xa'),auth['isAuthenticated'](),controller[_0x63cc('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 173f109..c498821 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 _0xa7b6=['TEXT','sequelize','exports','STRING'];(function(_0x547587,_0x48cbd9){var _0x3d7777=function(_0x3e5075){while(--_0x3e5075){_0x547587['push'](_0x547587['shift']());}};_0x3d7777(++_0x48cbd9);}(_0xa7b6,0x16d));var _0x6a7b=function(_0xb1174e,_0x1e68a7){_0xb1174e=_0xb1174e-0x0;var _0x285bac=_0xa7b6[_0xb1174e];return _0x285bac;};'use strict';var Sequelize=require(_0x6a7b('0x0'));module[_0x6a7b('0x1')]={'name':{'type':Sequelize[_0x6a7b('0x2')]},'description':{'type':Sequelize[_0x6a7b('0x2')]},'html':{'type':Sequelize[_0x6a7b('0x3')]}}; \ No newline at end of file +var _0xeac5=['sequelize','exports','STRING'];(function(_0x3d532e,_0x3f2ece){var _0x327aef=function(_0x44a69f){while(--_0x44a69f){_0x3d532e['push'](_0x3d532e['shift']());}};_0x327aef(++_0x3f2ece);}(_0xeac5,0x1ce));var _0x5eac=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xeac5[_0x21aec3];return _0x288bbc;};'use strict';var Sequelize=require(_0x5eac('0x0'));module[_0x5eac('0x1')]={'name':{'type':Sequelize[_0x5eac('0x2')]},'description':{'type':Sequelize[_0x5eac('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 2a3c1cb..c932f70 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 _0xa4ab=['status','json','count','offset','limit','set','apply','reject','update','then','destroy','Templates','UserProfileResource','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','options','Template','includeAll','include','findAll','rows','catch','show','params','find','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','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','../../mysqldb','sendStatus','end'];(function(_0x17caca,_0x2bc731){var _0x1d9b18=function(_0x1c7190){while(--_0x1c7190){_0x17caca['push'](_0x17caca['shift']());}};_0x1d9b18(++_0x2bc731);}(_0xa4ab,0x8d));var _0xba4a=function(_0x4f3242,_0x391954){_0x4f3242=_0x4f3242-0x0;var _0x49844f=_0xa4ab[_0x4f3242];return _0x49844f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xba4a('0x0'));var rimraf=require(_0xba4a('0x1'));var zipdir=require(_0xba4a('0x2'));var jsonpatch=require(_0xba4a('0x3'));var rp=require(_0xba4a('0x4'));var moment=require(_0xba4a('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xba4a('0x6'));var util=require('util');var path=require(_0xba4a('0x7'));var sox=require(_0xba4a('0x8'));var csv=require(_0xba4a('0x9'));var ejs=require(_0xba4a('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xba4a('0xb'));var crypto=require(_0xba4a('0xc'));var jsforce=require(_0xba4a('0xd'));var deskjs=require(_0xba4a('0xe'));var toCsv=require(_0xba4a('0x9'));var querystring=require(_0xba4a('0xf'));var Papa=require(_0xba4a('0x10'));var Redis=require(_0xba4a('0x11'));var authService=require(_0xba4a('0x12'));var qs=require(_0xba4a('0x13'));var as=require(_0xba4a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xba4a('0x15'))(_0xba4a('0x16'));var utils=require(_0xba4a('0x17'));var config=require('../../config/environment');var db=require(_0xba4a('0x18'))['db'];function respondWithStatusCode(_0x4e29ba,_0x408bd3){_0x408bd3=_0x408bd3||0xcc;return function(_0x172b13){if(_0x172b13){return _0x4e29ba[_0xba4a('0x19')](_0x408bd3);}return _0x4e29ba['status'](_0x408bd3)[_0xba4a('0x1a')]();};}function respondWithResult(_0x1ac3ba,_0x5be6cb){_0x5be6cb=_0x5be6cb||0xc8;return function(_0x4404b7){if(_0x4404b7){return _0x1ac3ba[_0xba4a('0x1b')](_0x5be6cb)[_0xba4a('0x1c')](_0x4404b7);}};}function respondWithFilteredResult(_0x26200d,_0x1c71e0){return function(_0x2af42e){if(_0x2af42e){var _0x1a2c21=_0x2af42e[_0xba4a('0x1d')],_0x3e95b2=_0x1c71e0[_0xba4a('0x1e')],_0x3567de=_0x1c71e0[_0xba4a('0x1e')]+_0x1c71e0[_0xba4a('0x1f')],_0x3a3c13;if(_0x3567de>=_0x1a2c21){_0x3567de=_0x1a2c21;_0x3a3c13=0xc8;}else{_0x3a3c13=0xce;}_0x26200d[_0xba4a('0x1b')](_0x3a3c13);return _0x26200d[_0xba4a('0x20')]('Content-Range',_0x3e95b2+'-'+_0x3567de+'/'+_0x1a2c21)[_0xba4a('0x1c')](_0x2af42e);}return null;};}function patchUpdates(_0x4d92b5){return function(_0x6c8d03){try{jsonpatch[_0xba4a('0x21')](_0x6c8d03,_0x4d92b5,!![]);}catch(_0x52510a){return BPromise[_0xba4a('0x22')](_0x52510a);}return _0x6c8d03['save']();};}function saveUpdates(_0x3416ea,_0x11c966){return function(_0x5aeb14){if(_0x5aeb14){return _0x5aeb14[_0xba4a('0x23')](_0x3416ea)[_0xba4a('0x24')](function(_0x10ade2){return _0x10ade2;});}return null;};}function removeEntity(_0xb63e25,_0x869714){return function(_0x1dba60){if(_0x1dba60){return _0x1dba60[_0xba4a('0x25')]()['then'](function(){var _0x316e5c=_0x1dba60['get']({'plain':!![]});var _0x4d8b5e=_0xba4a('0x26');return db[_0xba4a('0x27')][_0xba4a('0x25')]({'where':{'type':_0x4d8b5e,'resourceId':_0x316e5c['id']}})['then'](function(){return _0x1dba60;});})['then'](function(){_0xb63e25[_0xba4a('0x1b')](0xcc)[_0xba4a('0x1a')]();});}};}function handleEntityNotFound(_0x16bcf3,_0x1f41bd){return function(_0x243ccc){if(!_0x243ccc){_0x16bcf3[_0xba4a('0x19')](0x194);}return _0x243ccc;};}function handleError(_0x2fc768,_0x2e7399){_0x2e7399=_0x2e7399||0x1f4;return function(_0x2ad155){logger[_0xba4a('0x28')](_0x2ad155[_0xba4a('0x29')]);if(_0x2ad155[_0xba4a('0x2a')]){delete _0x2ad155['name'];}_0x2fc768[_0xba4a('0x1b')](_0x2e7399)[_0xba4a('0x2b')](_0x2ad155);};}exports['index']=function(_0x42f4c1,_0x567670){var _0x1c1bc0={},_0x160d87={},_0x3f0486={'count':0x0,'rows':[]};var _0x166e1e=_[_0xba4a('0x2c')](db['Template'][_0xba4a('0x2d')],function(_0x46d02e){return{'name':_0x46d02e[_0xba4a('0x2e')],'type':_0x46d02e[_0xba4a('0x2f')][_0xba4a('0x30')]};});_0x160d87[_0xba4a('0x31')]=_['map'](_0x166e1e,'name');_0x160d87[_0xba4a('0x32')]=_[_0xba4a('0x33')](_0x42f4c1[_0xba4a('0x32')]);_0x160d87['filters']=_[_0xba4a('0x34')](_0x160d87['model'],_0x160d87[_0xba4a('0x32')]);_0x1c1bc0[_0xba4a('0x35')]=_[_0xba4a('0x34')](_0x160d87[_0xba4a('0x31')],qs[_0xba4a('0x36')](_0x42f4c1[_0xba4a('0x32')][_0xba4a('0x36')]));_0x1c1bc0[_0xba4a('0x35')]=_0x1c1bc0[_0xba4a('0x35')][_0xba4a('0x37')]?_0x1c1bc0[_0xba4a('0x35')]:_0x160d87[_0xba4a('0x31')];if(!_0x42f4c1[_0xba4a('0x32')][_0xba4a('0x38')]('nolimit')){_0x1c1bc0[_0xba4a('0x1f')]=qs[_0xba4a('0x1f')](_0x42f4c1['query'][_0xba4a('0x1f')]);_0x1c1bc0[_0xba4a('0x1e')]=qs[_0xba4a('0x1e')](_0x42f4c1['query'][_0xba4a('0x1e')]);}_0x1c1bc0[_0xba4a('0x39')]=qs[_0xba4a('0x3a')](_0x42f4c1['query'][_0xba4a('0x3a')]);_0x1c1bc0[_0xba4a('0x3b')]=qs[_0xba4a('0x3c')](_[_0xba4a('0x3d')](_0x42f4c1['query'],_0x160d87['filters']));if(_0x42f4c1[_0xba4a('0x32')][_0xba4a('0x3e')]){_0x1c1bc0[_0xba4a('0x3b')]=_[_0xba4a('0x3f')](_0x1c1bc0[_0xba4a('0x3b')],{'$or':_['map'](_0x166e1e,function(_0x2de212){if(_0x2de212[_0xba4a('0x2f')]!=='VIRTUAL'){var _0x2a551a={};_0x2a551a[_0x2de212[_0xba4a('0x2a')]]={'$like':'%'+_0x42f4c1[_0xba4a('0x32')][_0xba4a('0x3e')]+'%'};return _0x2a551a;}})});}_0x1c1bc0=_[_0xba4a('0x3f')]({},_0x1c1bc0,_0x42f4c1[_0xba4a('0x40')]);var _0x1ae585={'where':_0x1c1bc0[_0xba4a('0x3b')]};return db[_0xba4a('0x41')][_0xba4a('0x1d')](_0x1ae585)[_0xba4a('0x24')](function(_0x1687b9){_0x3f0486['count']=_0x1687b9;if(_0x42f4c1[_0xba4a('0x32')][_0xba4a('0x42')]){_0x1c1bc0[_0xba4a('0x43')]=[{'all':!![]}];}return db[_0xba4a('0x41')][_0xba4a('0x44')](_0x1c1bc0);})['then'](function(_0x2fdee6){_0x3f0486[_0xba4a('0x45')]=_0x2fdee6;return _0x3f0486;})[_0xba4a('0x24')](respondWithFilteredResult(_0x567670,_0x1c1bc0))[_0xba4a('0x46')](handleError(_0x567670,null));};exports[_0xba4a('0x47')]=function(_0x1088c3,_0x58f98e){var _0xce7821={'raw':!![],'where':{'id':_0x1088c3[_0xba4a('0x48')]['id']}},_0x745f09={};_0x745f09[_0xba4a('0x31')]=_[_0xba4a('0x33')](db[_0xba4a('0x41')][_0xba4a('0x2d')]);_0x745f09[_0xba4a('0x32')]=_['keys'](_0x1088c3['query']);_0x745f09['filters']=_[_0xba4a('0x34')](_0x745f09['model'],_0x745f09[_0xba4a('0x32')]);_0xce7821[_0xba4a('0x35')]=_[_0xba4a('0x34')](_0x745f09[_0xba4a('0x31')],qs['fields'](_0x1088c3[_0xba4a('0x32')]['fields']));_0xce7821['attributes']=_0xce7821['attributes'][_0xba4a('0x37')]?_0xce7821[_0xba4a('0x35')]:_0x745f09[_0xba4a('0x31')];if(_0x1088c3[_0xba4a('0x32')][_0xba4a('0x42')]){_0xce7821[_0xba4a('0x43')]=[{'all':!![]}];}_0xce7821=_['merge']({},_0xce7821,_0x1088c3[_0xba4a('0x40')]);return db[_0xba4a('0x41')][_0xba4a('0x49')](_0xce7821)[_0xba4a('0x24')](handleEntityNotFound(_0x58f98e,null))[_0xba4a('0x24')](respondWithResult(_0x58f98e,null))[_0xba4a('0x46')](handleError(_0x58f98e,null));};exports['create']=function(_0x41e5ec,_0x1a0bf7){return db[_0xba4a('0x41')]['create'](_0x41e5ec[_0xba4a('0x4a')],{})[_0xba4a('0x24')](function(_0x5cd5cf){var _0x57a4f6=_0x41e5ec['user'][_0xba4a('0x4b')]({'plain':!![]});if(!_0x57a4f6)throw new Error(_0xba4a('0x4c'));if(_0x57a4f6[_0xba4a('0x4d')]===_0xba4a('0x4e')){var _0xcfcc92=_0x5cd5cf[_0xba4a('0x4b')]({'plain':!![]});var _0x1daadf=_0xba4a('0x26');return db[_0xba4a('0x4f')]['find']({'where':{'name':_0x1daadf,'userProfileId':_0x57a4f6[_0xba4a('0x50')]},'raw':!![]})[_0xba4a('0x24')](function(_0x225ce3){if(_0x225ce3&&_0x225ce3[_0xba4a('0x51')]===0x0){return db[_0xba4a('0x27')][_0xba4a('0x52')]({'name':_0xcfcc92[_0xba4a('0x2a')],'resourceId':_0xcfcc92['id'],'type':_0x225ce3[_0xba4a('0x2a')],'sectionId':_0x225ce3['id']},{})['then'](function(){return _0x5cd5cf;});}else{return _0x5cd5cf;}})[_0xba4a('0x46')](function(_0x317420){logger[_0xba4a('0x28')](_0xba4a('0x53'),_0x317420);throw _0x317420;});}return _0x5cd5cf;})[_0xba4a('0x24')](respondWithResult(_0x1a0bf7,0xc9))[_0xba4a('0x46')](handleError(_0x1a0bf7,null));};exports[_0xba4a('0x23')]=function(_0x5120f3,_0x5320ff){if(_0x5120f3[_0xba4a('0x4a')]['id']){delete _0x5120f3[_0xba4a('0x4a')]['id'];}return db[_0xba4a('0x41')][_0xba4a('0x49')]({'where':{'id':_0x5120f3[_0xba4a('0x48')]['id']}})[_0xba4a('0x24')](handleEntityNotFound(_0x5320ff,null))['then'](saveUpdates(_0x5120f3[_0xba4a('0x4a')],null))[_0xba4a('0x24')](respondWithResult(_0x5320ff,null))[_0xba4a('0x46')](handleError(_0x5320ff,null));};exports[_0xba4a('0x25')]=function(_0x153f26,_0x476ea1){return db['Template'][_0xba4a('0x49')]({'where':{'id':_0x153f26[_0xba4a('0x48')]['id']}})[_0xba4a('0x24')](handleEntityNotFound(_0x476ea1,null))[_0xba4a('0x24')](removeEntity(_0x476ea1,null))[_0xba4a('0x46')](handleError(_0x476ea1,null));}; \ No newline at end of file +var _0xf855=['ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','status','end','json','offset','limit','Content-Range','apply','destroy','Templates','UserProfileResource','then','sendStatus','error','stack','name','send','map','Template','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','VIRTUAL','merge','options','count','findAll','rows','catch','show','params','rawAttributes','includeAll','include','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse'];(function(_0x89bbd0,_0x3291d7){var _0x1996e8=function(_0x544980){while(--_0x544980){_0x89bbd0['push'](_0x89bbd0['shift']());}};_0x1996e8(++_0x3291d7);}(_0xf855,0xd9));var _0x5f85=function(_0x366589,_0x3f7458){_0x366589=_0x366589-0x0;var _0x1110e2=_0xf855[_0x366589];return _0x1110e2;};'use strict';var pdf=require(_0x5f85('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5f85('0x1'));var jsonpatch=require(_0x5f85('0x2'));var rp=require(_0x5f85('0x3'));var moment=require(_0x5f85('0x4'));var BPromise=require(_0x5f85('0x5'));var Mustache=require(_0x5f85('0x6'));var util=require('util');var path=require(_0x5f85('0x7'));var sox=require(_0x5f85('0x8'));var csv=require('to-csv');var ejs=require(_0x5f85('0x9'));var fs=require('fs');var _=require(_0x5f85('0xa'));var squel=require(_0x5f85('0xb'));var crypto=require('crypto');var jsforce=require(_0x5f85('0xc'));var deskjs=require(_0x5f85('0xd'));var toCsv=require(_0x5f85('0xe'));var querystring=require(_0x5f85('0xf'));var Papa=require(_0x5f85('0x10'));var Redis=require(_0x5f85('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5f85('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5f85('0x13'));var logger=require('../../config/logger')(_0x5f85('0x14'));var utils=require(_0x5f85('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c9058,_0x439e49){_0x439e49=_0x439e49||0xcc;return function(_0x4ac460){if(_0x4ac460){return _0x2c9058['sendStatus'](_0x439e49);}return _0x2c9058[_0x5f85('0x16')](_0x439e49)[_0x5f85('0x17')]();};}function respondWithResult(_0x3bf13e,_0x5ac43a){_0x5ac43a=_0x5ac43a||0xc8;return function(_0xaabe49){if(_0xaabe49){return _0x3bf13e[_0x5f85('0x16')](_0x5ac43a)[_0x5f85('0x18')](_0xaabe49);}};}function respondWithFilteredResult(_0x2f4e1b,_0x4a083c){return function(_0x4d6903){if(_0x4d6903){var _0x5ed271=_0x4d6903['count'],_0x23c552=_0x4a083c[_0x5f85('0x19')],_0x1750a0=_0x4a083c[_0x5f85('0x19')]+_0x4a083c[_0x5f85('0x1a')],_0x26f3da;if(_0x1750a0>=_0x5ed271){_0x1750a0=_0x5ed271;_0x26f3da=0xc8;}else{_0x26f3da=0xce;}_0x2f4e1b['status'](_0x26f3da);return _0x2f4e1b['set'](_0x5f85('0x1b'),_0x23c552+'-'+_0x1750a0+'/'+_0x5ed271)[_0x5f85('0x18')](_0x4d6903);}return null;};}function patchUpdates(_0xb4f501){return function(_0x3f410b){try{jsonpatch[_0x5f85('0x1c')](_0x3f410b,_0xb4f501,!![]);}catch(_0xba5daa){return BPromise['reject'](_0xba5daa);}return _0x3f410b['save']();};}function saveUpdates(_0x4d3497,_0x457e72){return function(_0x5858ec){if(_0x5858ec){return _0x5858ec['update'](_0x4d3497)['then'](function(_0x2570a6){return _0x2570a6;});}return null;};}function removeEntity(_0x48493f,_0x560949){return function(_0x672c69){if(_0x672c69){return _0x672c69[_0x5f85('0x1d')]()['then'](function(){var _0x26557f=_0x672c69['get']({'plain':!![]});var _0xfbcf08=_0x5f85('0x1e');return db[_0x5f85('0x1f')][_0x5f85('0x1d')]({'where':{'type':_0xfbcf08,'resourceId':_0x26557f['id']}})['then'](function(){return _0x672c69;});})[_0x5f85('0x20')](function(){_0x48493f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x39f88c,_0x3fb8c4){return function(_0x33b981){if(!_0x33b981){_0x39f88c[_0x5f85('0x21')](0x194);}return _0x33b981;};}function handleError(_0x3bc82f,_0x226da4){_0x226da4=_0x226da4||0x1f4;return function(_0x106706){logger[_0x5f85('0x22')](_0x106706[_0x5f85('0x23')]);if(_0x106706[_0x5f85('0x24')]){delete _0x106706[_0x5f85('0x24')];}_0x3bc82f[_0x5f85('0x16')](_0x226da4)[_0x5f85('0x25')](_0x106706);};}exports['index']=function(_0x19f5ea,_0x480614){var _0x4270da={},_0x31be77={},_0x15b407={'count':0x0,'rows':[]};var _0x385aa2=_[_0x5f85('0x26')](db[_0x5f85('0x27')]['rawAttributes'],function(_0x4a86a3){return{'name':_0x4a86a3['fieldName'],'type':_0x4a86a3[_0x5f85('0x28')][_0x5f85('0x29')]};});_0x31be77[_0x5f85('0x2a')]=_[_0x5f85('0x26')](_0x385aa2,_0x5f85('0x24'));_0x31be77[_0x5f85('0x2b')]=_[_0x5f85('0x2c')](_0x19f5ea[_0x5f85('0x2b')]);_0x31be77['filters']=_[_0x5f85('0x2d')](_0x31be77[_0x5f85('0x2a')],_0x31be77['query']);_0x4270da[_0x5f85('0x2e')]=_[_0x5f85('0x2d')](_0x31be77['model'],qs[_0x5f85('0x2f')](_0x19f5ea[_0x5f85('0x2b')][_0x5f85('0x2f')]));_0x4270da[_0x5f85('0x2e')]=_0x4270da['attributes'][_0x5f85('0x30')]?_0x4270da['attributes']:_0x31be77[_0x5f85('0x2a')];if(!_0x19f5ea[_0x5f85('0x2b')][_0x5f85('0x31')](_0x5f85('0x32'))){_0x4270da['limit']=qs['limit'](_0x19f5ea[_0x5f85('0x2b')]['limit']);_0x4270da[_0x5f85('0x19')]=qs[_0x5f85('0x19')](_0x19f5ea[_0x5f85('0x2b')][_0x5f85('0x19')]);}_0x4270da[_0x5f85('0x33')]=qs[_0x5f85('0x34')](_0x19f5ea[_0x5f85('0x2b')][_0x5f85('0x34')]);_0x4270da['where']=qs[_0x5f85('0x35')](_['pick'](_0x19f5ea[_0x5f85('0x2b')],_0x31be77['filters']));if(_0x19f5ea['query'][_0x5f85('0x36')]){_0x4270da[_0x5f85('0x37')]=_['merge'](_0x4270da['where'],{'$or':_[_0x5f85('0x26')](_0x385aa2,function(_0x5e7567){if(_0x5e7567['type']!==_0x5f85('0x38')){var _0x17c288={};_0x17c288[_0x5e7567[_0x5f85('0x24')]]={'$like':'%'+_0x19f5ea['query']['filter']+'%'};return _0x17c288;}})});}_0x4270da=_[_0x5f85('0x39')]({},_0x4270da,_0x19f5ea[_0x5f85('0x3a')]);var _0x32f6d8={'where':_0x4270da['where']};return db[_0x5f85('0x27')][_0x5f85('0x3b')](_0x32f6d8)[_0x5f85('0x20')](function(_0x502944){_0x15b407['count']=_0x502944;if(_0x19f5ea[_0x5f85('0x2b')]['includeAll']){_0x4270da['include']=[{'all':!![]}];}return db[_0x5f85('0x27')][_0x5f85('0x3c')](_0x4270da);})[_0x5f85('0x20')](function(_0x534d47){_0x15b407[_0x5f85('0x3d')]=_0x534d47;return _0x15b407;})[_0x5f85('0x20')](respondWithFilteredResult(_0x480614,_0x4270da))[_0x5f85('0x3e')](handleError(_0x480614,null));};exports[_0x5f85('0x3f')]=function(_0x16dfd9,_0x2d317d){var _0x10858f={'raw':!![],'where':{'id':_0x16dfd9[_0x5f85('0x40')]['id']}},_0xd56899={};_0xd56899['model']=_[_0x5f85('0x2c')](db[_0x5f85('0x27')][_0x5f85('0x41')]);_0xd56899[_0x5f85('0x2b')]=_[_0x5f85('0x2c')](_0x16dfd9['query']);_0xd56899[_0x5f85('0x35')]=_[_0x5f85('0x2d')](_0xd56899['model'],_0xd56899[_0x5f85('0x2b')]);_0x10858f['attributes']=_[_0x5f85('0x2d')](_0xd56899[_0x5f85('0x2a')],qs[_0x5f85('0x2f')](_0x16dfd9[_0x5f85('0x2b')][_0x5f85('0x2f')]));_0x10858f[_0x5f85('0x2e')]=_0x10858f[_0x5f85('0x2e')][_0x5f85('0x30')]?_0x10858f[_0x5f85('0x2e')]:_0xd56899['model'];if(_0x16dfd9[_0x5f85('0x2b')][_0x5f85('0x42')]){_0x10858f[_0x5f85('0x43')]=[{'all':!![]}];}_0x10858f=_[_0x5f85('0x39')]({},_0x10858f,_0x16dfd9[_0x5f85('0x3a')]);return db[_0x5f85('0x27')]['find'](_0x10858f)[_0x5f85('0x20')](handleEntityNotFound(_0x2d317d,null))[_0x5f85('0x20')](respondWithResult(_0x2d317d,null))[_0x5f85('0x3e')](handleError(_0x2d317d,null));};exports[_0x5f85('0x44')]=function(_0x1899fc,_0xc80bb3){return db[_0x5f85('0x27')][_0x5f85('0x44')](_0x1899fc[_0x5f85('0x45')],{})[_0x5f85('0x20')](function(_0x30b915){var _0x4153b8=_0x1899fc[_0x5f85('0x46')][_0x5f85('0x47')]({'plain':!![]});if(!_0x4153b8)throw new Error(_0x5f85('0x48'));if(_0x4153b8['role']==='user'){var _0x24d33b=_0x30b915[_0x5f85('0x47')]({'plain':!![]});var _0x4cb85a=_0x5f85('0x1e');return db[_0x5f85('0x49')][_0x5f85('0x4a')]({'where':{'name':_0x4cb85a,'userProfileId':_0x4153b8[_0x5f85('0x4b')]},'raw':!![]})[_0x5f85('0x20')](function(_0x4baa57){if(_0x4baa57&&_0x4baa57[_0x5f85('0x4c')]===0x0){return db['UserProfileResource'][_0x5f85('0x44')]({'name':_0x24d33b[_0x5f85('0x24')],'resourceId':_0x24d33b['id'],'type':_0x4baa57[_0x5f85('0x24')],'sectionId':_0x4baa57['id']},{})[_0x5f85('0x20')](function(){return _0x30b915;});}else{return _0x30b915;}})[_0x5f85('0x3e')](function(_0x2f2106){logger['error'](_0x5f85('0x4d'),_0x2f2106);throw _0x2f2106;});}return _0x30b915;})[_0x5f85('0x20')](respondWithResult(_0xc80bb3,0xc9))['catch'](handleError(_0xc80bb3,null));};exports['update']=function(_0x5783ec,_0x482437){if(_0x5783ec[_0x5f85('0x45')]['id']){delete _0x5783ec[_0x5f85('0x45')]['id'];}return db[_0x5f85('0x27')][_0x5f85('0x4a')]({'where':{'id':_0x5783ec['params']['id']}})[_0x5f85('0x20')](handleEntityNotFound(_0x482437,null))[_0x5f85('0x20')](saveUpdates(_0x5783ec['body'],null))[_0x5f85('0x20')](respondWithResult(_0x482437,null))[_0x5f85('0x3e')](handleError(_0x482437,null));};exports['destroy']=function(_0x4b44eb,_0x1aedd1){return db[_0x5f85('0x27')][_0x5f85('0x4a')]({'where':{'id':_0x4b44eb[_0x5f85('0x40')]['id']}})[_0x5f85('0x20')](handleEntityNotFound(_0x1aedd1,null))[_0x5f85('0x20')](removeEntity(_0x1aedd1,null))['catch'](handleError(_0x1aedd1,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index dec10f7..0075602 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 _0x06f9=['request-promise','path','rimraf','./template.attributes','Template','tools_templates','util','../../config/logger','moment','bluebird'];(function(_0x2c3c8e,_0x4330df){var _0x41debd=function(_0x474ba1){while(--_0x474ba1){_0x2c3c8e['push'](_0x2c3c8e['shift']());}};_0x41debd(++_0x4330df);}(_0x06f9,0x1dc));var _0x906f=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x06f9[_0x50a0c2];return _0x5ebadd;};'use strict';var _=require('lodash');var util=require(_0x906f('0x0'));var logger=require(_0x906f('0x1'))('api');var moment=require(_0x906f('0x2'));var BPromise=require(_0x906f('0x3'));var rp=require(_0x906f('0x4'));var fs=require('fs');var path=require(_0x906f('0x5'));var rimraf=require(_0x906f('0x6'));var config=require('../../config/environment');var attributes=require(_0x906f('0x7'));module['exports']=function(_0x21e114,_0x372b18){return _0x21e114['define'](_0x906f('0x8'),attributes,{'tableName':_0x906f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb40a=['request-promise','path','../../config/environment','./template.attributes','exports','define','Template','lodash','../../config/logger','api','bluebird'];(function(_0x4b3ae0,_0x4ab73d){var _0xec02ed=function(_0xabef76){while(--_0xabef76){_0x4b3ae0['push'](_0x4b3ae0['shift']());}};_0xec02ed(++_0x4ab73d);}(_0xb40a,0xa1));var _0xab40=function(_0x4fa213,_0xf4532){_0x4fa213=_0x4fa213-0x0;var _0x3a9fef=_0xb40a[_0x4fa213];return _0x3a9fef;};'use strict';var _=require(_0xab40('0x0'));var util=require('util');var logger=require(_0xab40('0x1'))(_0xab40('0x2'));var moment=require('moment');var BPromise=require(_0xab40('0x3'));var rp=require(_0xab40('0x4'));var fs=require('fs');var path=require(_0xab40('0x5'));var rimraf=require('rimraf');var config=require(_0xab40('0x6'));var attributes=require(_0xab40('0x7'));module[_0xab40('0x8')]=function(_0x4ca1bf,_0x138027){return _0x4ca1bf[_0xab40('0x9')](_0xab40('0xa'),attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/template/template.rpc.js b/server/api/template/template.rpc.js index 79cc9e2..4389000 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 _0x1b30=['result','catch','GetTemplate','Template','findAll','options','raw','where','attributes','limit','include','map','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','Template,\x20%s,\x20%s','debug','Template,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x2cd0c0,_0x2aa090){var _0x4cacc9=function(_0x28820b){while(--_0x28820b){_0x2cd0c0['push'](_0x2cd0c0['shift']());}};_0x4cacc9(++_0x2aa090);}(_0x1b30,0x199));var _0x01b3=function(_0x4f0bca,_0x4aeac0){_0x4f0bca=_0x4f0bca-0x0;var _0x39be11=_0x1b30[_0x4f0bca];return _0x39be11;};'use strict';var _=require(_0x01b3('0x0'));var util=require(_0x01b3('0x1'));var moment=require(_0x01b3('0x2'));var BPromise=require(_0x01b3('0x3'));var rs=require(_0x01b3('0x4'));var fs=require('fs');var Redis=require(_0x01b3('0x5'));var db=require(_0x01b3('0x6'))['db'];var utils=require(_0x01b3('0x7'));var logger=require('../../config/logger')(_0x01b3('0x8'));var config=require(_0x01b3('0x9'));var jayson=require(_0x01b3('0xa'));var client=jayson['client'][_0x01b3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x17e241,_0x3ae346,_0x2e998c){return new BPromise(function(_0x1bacfc,_0x4ed3f2){return client[_0x01b3('0xc')](_0x17e241,_0x2e998c)[_0x01b3('0xd')](function(_0x49e180){logger[_0x01b3('0xe')](_0x01b3('0xf'),_0x3ae346,'request\x20sent');logger[_0x01b3('0x10')](_0x01b3('0x11'),_0x3ae346,_0x01b3('0x12'),JSON[_0x01b3('0x13')](_0x49e180));if(_0x49e180[_0x01b3('0x14')]){if(_0x49e180[_0x01b3('0x14')][_0x01b3('0x15')]===0x1f4){logger[_0x01b3('0x14')](_0x01b3('0xf'),_0x3ae346,_0x49e180[_0x01b3('0x14')][_0x01b3('0x16')]);return _0x4ed3f2(_0x49e180['error'][_0x01b3('0x16')]);}logger[_0x01b3('0x14')](_0x01b3('0xf'),_0x3ae346,_0x49e180[_0x01b3('0x14')][_0x01b3('0x16')]);return _0x1bacfc(_0x49e180['error'][_0x01b3('0x16')]);}else{logger[_0x01b3('0xe')](_0x01b3('0xf'),_0x3ae346,_0x01b3('0x12'));_0x1bacfc(_0x49e180[_0x01b3('0x17')]['message']);}})[_0x01b3('0x18')](function(_0x27ce7d){logger[_0x01b3('0x14')](_0x01b3('0xf'),_0x3ae346,_0x27ce7d);_0x4ed3f2(_0x27ce7d);});});}exports[_0x01b3('0x19')]=function(_0x4032b4){var _0x417b1b=this;return new Promise(function(_0x40acb0,_0x58588b){return db[_0x01b3('0x1a')][_0x01b3('0x1b')]({'raw':_0x4032b4[_0x01b3('0x1c')]?_0x4032b4[_0x01b3('0x1c')][_0x01b3('0x1d')]===undefined?!![]:![]:!![],'where':_0x4032b4['options']?_0x4032b4[_0x01b3('0x1c')][_0x01b3('0x1e')]||null:null,'attributes':_0x4032b4['options']?_0x4032b4[_0x01b3('0x1c')][_0x01b3('0x1f')]||null:null,'limit':_0x4032b4[_0x01b3('0x1c')]?_0x4032b4[_0x01b3('0x1c')][_0x01b3('0x20')]||null:null,'include':_0x4032b4[_0x01b3('0x1c')]?_0x4032b4[_0x01b3('0x1c')][_0x01b3('0x21')]?_[_0x01b3('0x22')](_0x4032b4['options']['include'],function(_0x4a6324){return{'model':db[_0x4a6324[_0x01b3('0x23')]],'as':_0x4a6324['as'],'attributes':_0x4a6324['attributes'],'include':_0x4a6324[_0x01b3('0x21')]?_['map'](_0x4a6324[_0x01b3('0x21')],function(_0x22e5c7){return{'model':db[_0x22e5c7[_0x01b3('0x23')]],'as':_0x22e5c7['as'],'attributes':_0x22e5c7[_0x01b3('0x1f')],'include':_0x22e5c7[_0x01b3('0x21')]?_['map'](_0x22e5c7[_0x01b3('0x21')],function(_0x1ea17e){return{'model':db[_0x1ea17e[_0x01b3('0x23')]],'as':_0x1ea17e['as'],'attributes':_0x1ea17e[_0x01b3('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x14f892){logger[_0x01b3('0xe')]('GetTemplate',_0x4032b4);logger['debug']('GetTemplate',_0x4032b4,JSON['stringify'](_0x14f892));_0x40acb0(_0x14f892);})[_0x01b3('0x18')](function(_0x142c11){logger['error']('GetTemplate',_0x142c11[_0x01b3('0x16')],_0x4032b4);_0x58588b(_0x417b1b[_0x01b3('0x14')](0x1f4,_0x142c11['message']));});});}; \ No newline at end of file +var _0x0746=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','GetTemplate','raw','options','where','attributes','limit','include','model','map','catch','util','moment','bluebird','randomstring'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x0746,0xb6));var _0x6074=function(_0x3b5ea4,_0x4e1e16){_0x3b5ea4=_0x3b5ea4-0x0;var _0x595077=_0x0746[_0x3b5ea4];return _0x595077;};'use strict';var _=require('lodash');var util=require(_0x6074('0x0'));var moment=require(_0x6074('0x1'));var BPromise=require(_0x6074('0x2'));var rs=require(_0x6074('0x3'));var fs=require('fs');var Redis=require(_0x6074('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6074('0x5'));var logger=require(_0x6074('0x6'))(_0x6074('0x7'));var config=require(_0x6074('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6074('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3fc82a,_0x5a871f,_0x41b9e8){return new BPromise(function(_0x4cab98,_0x835c70){return client[_0x6074('0xa')](_0x3fc82a,_0x41b9e8)[_0x6074('0xb')](function(_0x135120){logger[_0x6074('0xc')](_0x6074('0xd'),_0x5a871f,_0x6074('0xe'));logger[_0x6074('0xf')]('Template,\x20%s,\x20%s,\x20%s',_0x5a871f,_0x6074('0xe'),JSON[_0x6074('0x10')](_0x135120));if(_0x135120[_0x6074('0x11')]){if(_0x135120[_0x6074('0x11')][_0x6074('0x12')]===0x1f4){logger[_0x6074('0x11')]('Template,\x20%s,\x20%s',_0x5a871f,_0x135120['error'][_0x6074('0x13')]);return _0x835c70(_0x135120['error'][_0x6074('0x13')]);}logger[_0x6074('0x11')](_0x6074('0xd'),_0x5a871f,_0x135120[_0x6074('0x11')][_0x6074('0x13')]);return _0x4cab98(_0x135120[_0x6074('0x11')]['message']);}else{logger[_0x6074('0xc')]('Template,\x20%s,\x20%s',_0x5a871f,_0x6074('0xe'));_0x4cab98(_0x135120[_0x6074('0x14')][_0x6074('0x13')]);}})['catch'](function(_0x4095ee){logger[_0x6074('0x11')]('Template,\x20%s,\x20%s',_0x5a871f,_0x4095ee);_0x835c70(_0x4095ee);});});}exports[_0x6074('0x15')]=function(_0x53ada7){var _0x5ded6d=this;return new Promise(function(_0x583664,_0x52434f){return db['Template']['findAll']({'raw':_0x53ada7['options']?_0x53ada7['options'][_0x6074('0x16')]===undefined?!![]:![]:!![],'where':_0x53ada7[_0x6074('0x17')]?_0x53ada7[_0x6074('0x17')][_0x6074('0x18')]||null:null,'attributes':_0x53ada7[_0x6074('0x17')]?_0x53ada7[_0x6074('0x17')][_0x6074('0x19')]||null:null,'limit':_0x53ada7[_0x6074('0x17')]?_0x53ada7['options'][_0x6074('0x1a')]||null:null,'include':_0x53ada7[_0x6074('0x17')]?_0x53ada7[_0x6074('0x17')][_0x6074('0x1b')]?_['map'](_0x53ada7[_0x6074('0x17')][_0x6074('0x1b')],function(_0x2b3b42){return{'model':db[_0x2b3b42[_0x6074('0x1c')]],'as':_0x2b3b42['as'],'attributes':_0x2b3b42[_0x6074('0x19')],'include':_0x2b3b42[_0x6074('0x1b')]?_[_0x6074('0x1d')](_0x2b3b42[_0x6074('0x1b')],function(_0x4f63bb){return{'model':db[_0x4f63bb['model']],'as':_0x4f63bb['as'],'attributes':_0x4f63bb['attributes'],'include':_0x4f63bb[_0x6074('0x1b')]?_[_0x6074('0x1d')](_0x4f63bb['include'],function(_0x27d5c4){return{'model':db[_0x27d5c4[_0x6074('0x1c')]],'as':_0x27d5c4['as'],'attributes':_0x27d5c4['attributes']};}):[]};}):[]};}):[]:[]})[_0x6074('0xb')](function(_0x111aa9){logger['info'](_0x6074('0x15'),_0x53ada7);logger[_0x6074('0xf')](_0x6074('0x15'),_0x53ada7,JSON[_0x6074('0x10')](_0x111aa9));_0x583664(_0x111aa9);})[_0x6074('0x1e')](function(_0xdc6ba2){logger[_0x6074('0x11')](_0x6074('0x15'),_0xdc6ba2[_0x6074('0x13')],_0x53ada7);_0x52434f(_0x5ded6d[_0x6074('0x11')](0x1f4,_0xdc6ba2[_0x6074('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 912d40d..551803d 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 _0xa805=['../../components/auth/service','../../config/environment','./trigger.controller','get','isAuthenticated','index','/:id','getAllConditions','/:id/any_conditions','getAnyConditions','getActions','post','/:id/all_conditions','addAllCondition','addAnyCondition','/:id/actions','addAction','update','delete','destroy','exports','multer','path','express','Router'];(function(_0x4c02ad,_0x49e293){var _0x158889=function(_0x5649d9){while(--_0x5649d9){_0x4c02ad['push'](_0x4c02ad['shift']());}};_0x158889(++_0x49e293);}(_0xa805,0x79));var _0x5a80=function(_0x387c44,_0x5c8a93){_0x387c44=_0x387c44-0x0;var _0x74fe0e=_0xa805[_0x387c44];return _0x74fe0e;};'use strict';var multer=require(_0x5a80('0x0'));var util=require('util');var path=require(_0x5a80('0x1'));var timeout=require('connect-timeout');var express=require(_0x5a80('0x2'));var router=express[_0x5a80('0x3')]();var auth=require(_0x5a80('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x5a80('0x5'));var controller=require(_0x5a80('0x6'));router[_0x5a80('0x7')]('/',auth[_0x5a80('0x8')](),controller[_0x5a80('0x9')]);router[_0x5a80('0x7')](_0x5a80('0xa'),auth[_0x5a80('0x8')](),controller['show']);router[_0x5a80('0x7')]('/:id/all_conditions',auth[_0x5a80('0x8')](),controller[_0x5a80('0xb')]);router['get'](_0x5a80('0xc'),auth[_0x5a80('0x8')](),controller[_0x5a80('0xd')]);router[_0x5a80('0x7')]('/:id/actions',auth['isAuthenticated'](),controller[_0x5a80('0xe')]);router[_0x5a80('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x5a80('0x10'),auth[_0x5a80('0x8')](),controller[_0x5a80('0x11')]);router[_0x5a80('0xf')](_0x5a80('0xc'),auth[_0x5a80('0x8')](),controller[_0x5a80('0x12')]);router[_0x5a80('0xf')](_0x5a80('0x13'),auth[_0x5a80('0x8')](),controller[_0x5a80('0x14')]);router['put'](_0x5a80('0xa'),auth[_0x5a80('0x8')](),controller[_0x5a80('0x15')]);router[_0x5a80('0x16')]('/:id',auth[_0x5a80('0x8')](),controller[_0x5a80('0x17')]);module[_0x5a80('0x18')]=router; \ No newline at end of file +var _0x458c=['/:id','update','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','index','isAuthenticated','show','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','create','post','/:id/all_conditions','addAnyCondition','addAction','put'];(function(_0x454457,_0x17819e){var _0x1d6f94=function(_0x1bbf08){while(--_0x1bbf08){_0x454457['push'](_0x454457['shift']());}};_0x1d6f94(++_0x17819e);}(_0x458c,0xb9));var _0xc458=function(_0x54fbff,_0x53470e){_0x54fbff=_0x54fbff-0x0;var _0x5cf619=_0x458c[_0x54fbff];return _0x5cf619;};'use strict';var multer=require(_0xc458('0x0'));var util=require(_0xc458('0x1'));var path=require('path');var timeout=require(_0xc458('0x2'));var express=require(_0xc458('0x3'));var router=express[_0xc458('0x4')]();var auth=require(_0xc458('0x5'));var interaction=require(_0xc458('0x6'));var config=require(_0xc458('0x7'));var controller=require(_0xc458('0x8'));router[_0xc458('0x9')]('/',auth['isAuthenticated'](),controller[_0xc458('0xa')]);router[_0xc458('0x9')]('/:id',auth[_0xc458('0xb')](),controller[_0xc458('0xc')]);router[_0xc458('0x9')]('/:id/all_conditions',auth['isAuthenticated'](),controller[_0xc458('0xd')]);router[_0xc458('0x9')](_0xc458('0xe'),auth['isAuthenticated'](),controller[_0xc458('0xf')]);router['get'](_0xc458('0x10'),auth[_0xc458('0xb')](),controller['getActions']);router['post']('/',auth[_0xc458('0xb')](),controller[_0xc458('0x11')]);router[_0xc458('0x12')](_0xc458('0x13'),auth[_0xc458('0xb')](),controller['addAllCondition']);router[_0xc458('0x12')]('/:id/any_conditions',auth[_0xc458('0xb')](),controller[_0xc458('0x14')]);router['post'](_0xc458('0x10'),auth[_0xc458('0xb')](),controller[_0xc458('0x15')]);router[_0xc458('0x16')](_0xc458('0x17'),auth[_0xc458('0xb')](),controller[_0xc458('0x18')]);router['delete'](_0xc458('0x17'),auth[_0xc458('0xb')](),controller[_0xc458('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 67ca10a..e5c3523 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 _0xcccf=['BOOLEAN','sequelize','STRING'];(function(_0x376f71,_0x384413){var _0x12b30c=function(_0x18c2c3){while(--_0x18c2c3){_0x376f71['push'](_0x376f71['shift']());}};_0x12b30c(++_0x384413);}(_0xcccf,0x6a));var _0xfccc=function(_0x2b8e73,_0x29fec6){_0x2b8e73=_0x2b8e73-0x0;var _0x14fdfd=_0xcccf[_0x2b8e73];return _0x14fdfd;};'use strict';var Sequelize=require(_0xfccc('0x0'));module['exports']={'name':{'type':Sequelize[_0xfccc('0x1')]},'channel':{'type':Sequelize[_0xfccc('0x1')]},'description':{'type':Sequelize[_0xfccc('0x1')]},'status':{'type':Sequelize[_0xfccc('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xfc2e=['STRING','BOOLEAN','sequelize','exports'];(function(_0x20e6c0,_0xc743ec){var _0x376572=function(_0x272547){while(--_0x272547){_0x20e6c0['push'](_0x20e6c0['shift']());}};_0x376572(++_0xc743ec);}(_0xfc2e,0x1ce));var _0xefc2=function(_0x39728f,_0x525192){_0x39728f=_0x39728f-0x0;var _0x3a0577=_0xfc2e[_0x39728f];return _0x3a0577;};'use strict';var Sequelize=require(_0xefc2('0x0'));module[_0xefc2('0x1')]={'name':{'type':Sequelize[_0xefc2('0x2')]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xefc2('0x2')]},'status':{'type':Sequelize[_0xefc2('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index 82957b7..06658b8 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 _0x314f=['moment','bluebird','path','sox','to-csv','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','limit','set','apply','reject','save','update','then','destroy','get','UserProfileResource','end','sendStatus','error','stack','name','send','Trigger','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','filter','count','includeAll','include','findAll','rows','catch','show','params','merge','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','find','userProfileId','autoAssociation','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','findOne','pick','getAllConditions','getAnyConditions','addAction','Action','getActions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x2b3188,_0x50205a){var _0x103783=function(_0x21fac7){while(--_0x21fac7){_0x2b3188['push'](_0x2b3188['shift']());}};_0x103783(++_0x50205a);}(_0x314f,0x114));var _0xf314=function(_0x4e01c9,_0x43cca6){_0x4e01c9=_0x4e01c9-0x0;var _0x26979f=_0x314f[_0x4e01c9];return _0x26979f;};'use strict';var pdf=require(_0xf314('0x0'));var emlformat=require(_0xf314('0x1'));var rimraf=require(_0xf314('0x2'));var zipdir=require(_0xf314('0x3'));var jsonpatch=require(_0xf314('0x4'));var rp=require(_0xf314('0x5'));var moment=require(_0xf314('0x6'));var BPromise=require(_0xf314('0x7'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf314('0x8'));var sox=require(_0xf314('0x9'));var csv=require(_0xf314('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xf314('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf314('0xc'));var deskjs=require(_0xf314('0xd'));var toCsv=require(_0xf314('0xa'));var querystring=require(_0xf314('0xe'));var Papa=require(_0xf314('0xf'));var Redis=require(_0xf314('0x10'));var authService=require(_0xf314('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xf314('0x12'));var hardwareService=require(_0xf314('0x13'));var logger=require(_0xf314('0x14'))(_0xf314('0x15'));var utils=require(_0xf314('0x16'));var config=require(_0xf314('0x17'));var db=require(_0xf314('0x18'))['db'];function respondWithStatusCode(_0x475332,_0x2ff587){_0x2ff587=_0x2ff587||0xcc;return function(_0x1686ea){if(_0x1686ea){return _0x475332['sendStatus'](_0x2ff587);}return _0x475332[_0xf314('0x19')](_0x2ff587)['end']();};}function respondWithResult(_0xf6d85d,_0x14123b){_0x14123b=_0x14123b||0xc8;return function(_0x56e180){if(_0x56e180){return _0xf6d85d[_0xf314('0x19')](_0x14123b)[_0xf314('0x1a')](_0x56e180);}};}function respondWithFilteredResult(_0x50afff,_0xf8c2d7){return function(_0x3468d2){if(_0x3468d2){var _0x5f3443=_0x3468d2['count'],_0x2c3481=_0xf8c2d7[_0xf314('0x1b')],_0x3b2a88=_0xf8c2d7['offset']+_0xf8c2d7[_0xf314('0x1c')],_0x5b492f;if(_0x3b2a88>=_0x5f3443){_0x3b2a88=_0x5f3443;_0x5b492f=0xc8;}else{_0x5b492f=0xce;}_0x50afff[_0xf314('0x19')](_0x5b492f);return _0x50afff[_0xf314('0x1d')]('Content-Range',_0x2c3481+'-'+_0x3b2a88+'/'+_0x5f3443)[_0xf314('0x1a')](_0x3468d2);}return null;};}function patchUpdates(_0x4dd658){return function(_0x3284f6){try{jsonpatch[_0xf314('0x1e')](_0x3284f6,_0x4dd658,!![]);}catch(_0x564aec){return BPromise[_0xf314('0x1f')](_0x564aec);}return _0x3284f6[_0xf314('0x20')]();};}function saveUpdates(_0x38af8a,_0x5aa370){return function(_0x47deab){if(_0x47deab){return _0x47deab[_0xf314('0x21')](_0x38af8a)[_0xf314('0x22')](function(_0x597548){return _0x597548;});}return null;};}function removeEntity(_0x4eea85,_0x547e13){return function(_0x15251e){if(_0x15251e){return _0x15251e[_0xf314('0x23')]()[_0xf314('0x22')](function(){var _0x23d769=_0x15251e[_0xf314('0x24')]({'plain':!![]});var _0x4025da='Triggers';return db[_0xf314('0x25')][_0xf314('0x23')]({'where':{'type':_0x4025da,'resourceId':_0x23d769['id']}})[_0xf314('0x22')](function(){return _0x15251e;});})[_0xf314('0x22')](function(){_0x4eea85[_0xf314('0x19')](0xcc)[_0xf314('0x26')]();});}};}function handleEntityNotFound(_0x5b91de,_0x2fcb5f){return function(_0x3d9297){if(!_0x3d9297){_0x5b91de[_0xf314('0x27')](0x194);}return _0x3d9297;};}function handleError(_0x2b2b8a,_0x3ae30c){_0x3ae30c=_0x3ae30c||0x1f4;return function(_0x434f37){logger[_0xf314('0x28')](_0x434f37[_0xf314('0x29')]);if(_0x434f37[_0xf314('0x2a')]){delete _0x434f37[_0xf314('0x2a')];}_0x2b2b8a['status'](_0x3ae30c)[_0xf314('0x2b')](_0x434f37);};}exports['index']=function(_0x4da23a,_0x7473cb){var _0x1d1b2f={},_0x351969={},_0xc7d305={'count':0x0,'rows':[]};var _0x4bc0e5=_['map'](db[_0xf314('0x2c')][_0xf314('0x2d')],function(_0x319dad){return{'name':_0x319dad[_0xf314('0x2e')],'type':_0x319dad[_0xf314('0x2f')][_0xf314('0x30')]};});_0x351969[_0xf314('0x31')]=_[_0xf314('0x32')](_0x4bc0e5,_0xf314('0x2a'));_0x351969[_0xf314('0x33')]=_[_0xf314('0x34')](_0x4da23a[_0xf314('0x33')]);_0x351969[_0xf314('0x35')]=_[_0xf314('0x36')](_0x351969[_0xf314('0x31')],_0x351969[_0xf314('0x33')]);_0x1d1b2f['attributes']=_[_0xf314('0x36')](_0x351969[_0xf314('0x31')],qs[_0xf314('0x37')](_0x4da23a[_0xf314('0x33')][_0xf314('0x37')]));_0x1d1b2f['attributes']=_0x1d1b2f['attributes'][_0xf314('0x38')]?_0x1d1b2f[_0xf314('0x39')]:_0x351969[_0xf314('0x31')];if(!_0x4da23a[_0xf314('0x33')][_0xf314('0x3a')](_0xf314('0x3b'))){_0x1d1b2f['limit']=qs[_0xf314('0x1c')](_0x4da23a['query']['limit']);_0x1d1b2f[_0xf314('0x1b')]=qs[_0xf314('0x1b')](_0x4da23a[_0xf314('0x33')][_0xf314('0x1b')]);}_0x1d1b2f[_0xf314('0x3c')]=qs[_0xf314('0x3d')](_0x4da23a['query'][_0xf314('0x3d')]);_0x1d1b2f[_0xf314('0x3e')]=qs[_0xf314('0x35')](_['pick'](_0x4da23a[_0xf314('0x33')],_0x351969['filters']));if(_0x4da23a[_0xf314('0x33')][_0xf314('0x3f')]){_0x1d1b2f[_0xf314('0x3e')]=_['merge'](_0x1d1b2f[_0xf314('0x3e')],{'$or':_[_0xf314('0x32')](_0x4bc0e5,function(_0x13ec72){if(_0x13ec72[_0xf314('0x2f')]!=='VIRTUAL'){var _0x1e8745={};_0x1e8745[_0x13ec72['name']]={'$like':'%'+_0x4da23a[_0xf314('0x33')][_0xf314('0x3f')]+'%'};return _0x1e8745;}})});}_0x1d1b2f=_['merge']({},_0x1d1b2f,_0x4da23a['options']);var _0x2ca4e8={'where':_0x1d1b2f[_0xf314('0x3e')]};return db[_0xf314('0x2c')][_0xf314('0x40')](_0x2ca4e8)[_0xf314('0x22')](function(_0x386768){_0xc7d305[_0xf314('0x40')]=_0x386768;if(_0x4da23a[_0xf314('0x33')][_0xf314('0x41')]){_0x1d1b2f[_0xf314('0x42')]=[{'all':!![]}];}return db[_0xf314('0x2c')][_0xf314('0x43')](_0x1d1b2f);})['then'](function(_0x3e5b74){_0xc7d305[_0xf314('0x44')]=_0x3e5b74;return _0xc7d305;})[_0xf314('0x22')](respondWithFilteredResult(_0x7473cb,_0x1d1b2f))[_0xf314('0x45')](handleError(_0x7473cb,null));};exports[_0xf314('0x46')]=function(_0x912c98,_0x1b60ef){var _0x4b17c8={'raw':![],'where':{'id':_0x912c98[_0xf314('0x47')]['id']}},_0x21fe76={};_0x21fe76[_0xf314('0x31')]=_['keys'](db[_0xf314('0x2c')][_0xf314('0x2d')]);_0x21fe76['query']=_['keys'](_0x912c98[_0xf314('0x33')]);_0x21fe76[_0xf314('0x35')]=_[_0xf314('0x36')](_0x21fe76[_0xf314('0x31')],_0x21fe76[_0xf314('0x33')]);_0x4b17c8[_0xf314('0x39')]=_[_0xf314('0x36')](_0x21fe76['model'],qs[_0xf314('0x37')](_0x912c98['query'][_0xf314('0x37')]));_0x4b17c8[_0xf314('0x39')]=_0x4b17c8[_0xf314('0x39')][_0xf314('0x38')]?_0x4b17c8[_0xf314('0x39')]:_0x21fe76[_0xf314('0x31')];if(_0x912c98[_0xf314('0x33')][_0xf314('0x41')]){_0x4b17c8[_0xf314('0x42')]=[{'all':!![]}];}_0x4b17c8=_[_0xf314('0x48')]({},_0x4b17c8,_0x912c98[_0xf314('0x49')]);return db[_0xf314('0x2c')]['find'](_0x4b17c8)[_0xf314('0x22')](handleEntityNotFound(_0x1b60ef,null))[_0xf314('0x22')](respondWithResult(_0x1b60ef,null))['catch'](handleError(_0x1b60ef,null));};exports[_0xf314('0x4a')]=function(_0x1d2603,_0x4463c6){return db[_0xf314('0x2c')][_0xf314('0x4a')](_0x1d2603[_0xf314('0x4b')],{})[_0xf314('0x22')](function(_0x1209d2){var _0x2d4c9e=_0x1d2603['user'][_0xf314('0x24')]({'plain':!![]});if(!_0x2d4c9e)throw new Error(_0xf314('0x4c'));if(_0x2d4c9e['role']===_0xf314('0x4d')){var _0x1c1b15=_0x1209d2[_0xf314('0x24')]({'plain':!![]});var _0x41bf65='Triggers';return db[_0xf314('0x4e')][_0xf314('0x4f')]({'where':{'name':_0x41bf65,'userProfileId':_0x2d4c9e[_0xf314('0x50')]},'raw':!![]})[_0xf314('0x22')](function(_0x39a4c4){if(_0x39a4c4&&_0x39a4c4[_0xf314('0x51')]===0x0){return db[_0xf314('0x25')]['create']({'name':_0x1c1b15[_0xf314('0x2a')],'resourceId':_0x1c1b15['id'],'type':_0x39a4c4[_0xf314('0x2a')],'sectionId':_0x39a4c4['id']},{})[_0xf314('0x22')](function(){return _0x1209d2;});}else{return _0x1209d2;}})[_0xf314('0x45')](function(_0x2108e0){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2108e0);throw _0x2108e0;});}return _0x1209d2;})[_0xf314('0x22')](respondWithResult(_0x4463c6,0xc9))['catch'](handleError(_0x4463c6,null));};exports[_0xf314('0x21')]=function(_0x1d49c4,_0x1bea6a){if(_0x1d49c4['body']['id']){delete _0x1d49c4[_0xf314('0x4b')]['id'];}return db[_0xf314('0x2c')][_0xf314('0x4f')]({'where':{'id':_0x1d49c4[_0xf314('0x47')]['id']}})[_0xf314('0x22')](handleEntityNotFound(_0x1bea6a,null))['then'](saveUpdates(_0x1d49c4[_0xf314('0x4b')],null))[_0xf314('0x22')](respondWithResult(_0x1bea6a,null))['catch'](handleError(_0x1bea6a,null));};exports['destroy']=function(_0xcc0a1b,_0x1104ba){return db[_0xf314('0x2c')][_0xf314('0x4f')]({'where':{'id':_0xcc0a1b[_0xf314('0x47')]['id']}})[_0xf314('0x22')](handleEntityNotFound(_0x1104ba,null))[_0xf314('0x22')](removeEntity(_0x1104ba,null))['catch'](handleError(_0x1104ba,null));};exports[_0xf314('0x52')]=function(_0xaf5d4f,_0x1666f0,_0x3cdd06){if(_0xaf5d4f[_0xf314('0x4b')]['id']){delete _0xaf5d4f['body']['id'];}return db[_0xf314('0x2c')]['find']({'where':{'id':_0xaf5d4f[_0xf314('0x47')]['id']}})[_0xf314('0x22')](handleEntityNotFound(_0x1666f0,null))[_0xf314('0x22')](function(_0x1892f8){if(_0x1892f8){_0xaf5d4f[_0xf314('0x4b')][_0xf314('0x53')]=_0x1892f8['id'];return db[_0xf314('0x54')][_0xf314('0x4a')](_0xaf5d4f[_0xf314('0x4b')]);}})['then'](respondWithResult(_0x1666f0,null))[_0xf314('0x45')](handleError(_0x1666f0,null));};exports[_0xf314('0x55')]=function(_0x17126d,_0x321ec5,_0x8951b4){if(_0x17126d['body']['id']){delete _0x17126d[_0xf314('0x4b')]['id'];}return db['Trigger'][_0xf314('0x4f')]({'where':{'id':_0x17126d[_0xf314('0x47')]['id']}})[_0xf314('0x22')](handleEntityNotFound(_0x321ec5,null))[_0xf314('0x22')](function(_0x5a0e16){if(_0x5a0e16){_0x17126d[_0xf314('0x4b')][_0xf314('0x56')]=_0x5a0e16['id'];return db[_0xf314('0x54')]['create'](_0x17126d[_0xf314('0x4b')]);}})[_0xf314('0x22')](respondWithResult(_0x321ec5,null))[_0xf314('0x45')](handleError(_0x321ec5,null));};exports['getAllConditions']=function(_0x5af0a0,_0x1f0c29,_0x3d8acd){var _0x5118d6={};var _0x4d6af4={};var _0x40a7df;var _0x5cd6f4;return db['Trigger'][_0xf314('0x57')]({'where':{'id':_0x5af0a0[_0xf314('0x47')]['id']}})[_0xf314('0x22')](handleEntityNotFound(_0x1f0c29,null))[_0xf314('0x22')](function(_0x53b8ee){if(_0x53b8ee){_0x40a7df=_0x53b8ee;_0x4d6af4['model']=_['keys'](db[_0xf314('0x54')][_0xf314('0x2d')]);_0x4d6af4[_0xf314('0x33')]=_[_0xf314('0x34')](_0x5af0a0[_0xf314('0x33')]);_0x4d6af4[_0xf314('0x35')]=_[_0xf314('0x36')](_0x4d6af4['model'],_0x4d6af4['query']);_0x5118d6[_0xf314('0x39')]=_['intersection'](_0x4d6af4[_0xf314('0x31')],qs['fields'](_0x5af0a0[_0xf314('0x33')][_0xf314('0x37')]));_0x5118d6[_0xf314('0x39')]=_0x5118d6[_0xf314('0x39')]['length']?_0x5118d6[_0xf314('0x39')]:_0x4d6af4['model'];_0x5118d6[_0xf314('0x3c')]=qs[_0xf314('0x3d')](_0x5af0a0[_0xf314('0x33')][_0xf314('0x3d')]);_0x5118d6[_0xf314('0x3e')]=qs[_0xf314('0x35')](_[_0xf314('0x58')](_0x5af0a0[_0xf314('0x33')],_0x4d6af4[_0xf314('0x35')]));if(_0x5af0a0[_0xf314('0x33')][_0xf314('0x3f')]){_0x5118d6[_0xf314('0x3e')]=_[_0xf314('0x48')](_0x5118d6[_0xf314('0x3e')],{'$or':_[_0xf314('0x32')](_0x5118d6['attributes'],function(_0x366045){var _0x44a153={};_0x44a153[_0x366045]={'$like':'%'+_0x5af0a0['query'][_0xf314('0x3f')]+'%'};return _0x44a153;})});}_0x5118d6=_['merge']({},_0x5118d6,_0x5af0a0[_0xf314('0x49')]);return _0x40a7df[_0xf314('0x59')](_0x5118d6);}})['then'](function(_0x30d869){if(_0x30d869){_0x5cd6f4=_0x30d869[_0xf314('0x38')];if(!_0x5af0a0[_0xf314('0x33')]['hasOwnProperty'](_0xf314('0x3b'))){_0x5118d6[_0xf314('0x1c')]=qs[_0xf314('0x1c')](_0x5af0a0[_0xf314('0x33')][_0xf314('0x1c')]);_0x5118d6[_0xf314('0x1b')]=qs['offset'](_0x5af0a0[_0xf314('0x33')][_0xf314('0x1b')]);}return _0x40a7df[_0xf314('0x59')](_0x5118d6);}})[_0xf314('0x22')](function(_0x791afa){if(_0x791afa){return _0x791afa?{'count':_0x5cd6f4,'rows':_0x791afa}:null;}})[_0xf314('0x22')](respondWithResult(_0x1f0c29,null))[_0xf314('0x45')](handleError(_0x1f0c29,null));};exports[_0xf314('0x5a')]=function(_0x5e97b6,_0x30cb05,_0x5965f7){var _0x2ba5fa={};var _0x788e13={};var _0x214963;var _0x17386e;return db[_0xf314('0x2c')][_0xf314('0x57')]({'where':{'id':_0x5e97b6['params']['id']}})['then'](handleEntityNotFound(_0x30cb05,null))[_0xf314('0x22')](function(_0x102c45){if(_0x102c45){_0x214963=_0x102c45;_0x788e13[_0xf314('0x31')]=_[_0xf314('0x34')](db['Condition'][_0xf314('0x2d')]);_0x788e13[_0xf314('0x33')]=_[_0xf314('0x34')](_0x5e97b6[_0xf314('0x33')]);_0x788e13['filters']=_[_0xf314('0x36')](_0x788e13[_0xf314('0x31')],_0x788e13['query']);_0x2ba5fa[_0xf314('0x39')]=_[_0xf314('0x36')](_0x788e13[_0xf314('0x31')],qs['fields'](_0x5e97b6[_0xf314('0x33')]['fields']));_0x2ba5fa[_0xf314('0x39')]=_0x2ba5fa[_0xf314('0x39')][_0xf314('0x38')]?_0x2ba5fa[_0xf314('0x39')]:_0x788e13[_0xf314('0x31')];_0x2ba5fa['order']=qs[_0xf314('0x3d')](_0x5e97b6['query'][_0xf314('0x3d')]);_0x2ba5fa[_0xf314('0x3e')]=qs[_0xf314('0x35')](_[_0xf314('0x58')](_0x5e97b6[_0xf314('0x33')],_0x788e13['filters']));if(_0x5e97b6[_0xf314('0x33')][_0xf314('0x3f')]){_0x2ba5fa['where']=_[_0xf314('0x48')](_0x2ba5fa[_0xf314('0x3e')],{'$or':_[_0xf314('0x32')](_0x2ba5fa[_0xf314('0x39')],function(_0x1362e4){var _0x49f960={};_0x49f960[_0x1362e4]={'$like':'%'+_0x5e97b6[_0xf314('0x33')][_0xf314('0x3f')]+'%'};return _0x49f960;})});}_0x2ba5fa=_[_0xf314('0x48')]({},_0x2ba5fa,_0x5e97b6[_0xf314('0x49')]);return _0x214963[_0xf314('0x5a')](_0x2ba5fa);}})[_0xf314('0x22')](function(_0x483a3c){if(_0x483a3c){_0x17386e=_0x483a3c[_0xf314('0x38')];if(!_0x5e97b6[_0xf314('0x33')]['hasOwnProperty'](_0xf314('0x3b'))){_0x2ba5fa['limit']=qs[_0xf314('0x1c')](_0x5e97b6[_0xf314('0x33')][_0xf314('0x1c')]);_0x2ba5fa['offset']=qs[_0xf314('0x1b')](_0x5e97b6[_0xf314('0x33')][_0xf314('0x1b')]);}return _0x214963[_0xf314('0x5a')](_0x2ba5fa);}})[_0xf314('0x22')](function(_0x2d3629){if(_0x2d3629){return _0x2d3629?{'count':_0x17386e,'rows':_0x2d3629}:null;}})[_0xf314('0x22')](respondWithResult(_0x30cb05,null))['catch'](handleError(_0x30cb05,null));};exports[_0xf314('0x5b')]=function(_0x483b89,_0x200962,_0x55bb24){if(_0x483b89['body']['id']){delete _0x483b89[_0xf314('0x4b')]['id'];}return db[_0xf314('0x2c')][_0xf314('0x4f')]({'where':{'id':_0x483b89['params']['id']}})['then'](handleEntityNotFound(_0x200962,null))[_0xf314('0x22')](function(_0x28e8a1){if(_0x28e8a1){_0x483b89[_0xf314('0x4b')]['TriggerId']=_0x28e8a1['id'];return db[_0xf314('0x5c')][_0xf314('0x4a')](_0x483b89[_0xf314('0x4b')]);}})['then'](respondWithResult(_0x200962,null))['catch'](handleError(_0x200962,null));};exports[_0xf314('0x5d')]=function(_0x132b94,_0x204e5d,_0xa7f238){var _0x44153c={};var _0x1119f1={};var _0xf1ac3a;var _0x564440;return db['Trigger'][_0xf314('0x57')]({'where':{'id':_0x132b94[_0xf314('0x47')]['id']}})[_0xf314('0x22')](handleEntityNotFound(_0x204e5d,null))[_0xf314('0x22')](function(_0x37670a){if(_0x37670a){_0xf1ac3a=_0x37670a;_0x1119f1[_0xf314('0x31')]=_[_0xf314('0x34')](db[_0xf314('0x5c')][_0xf314('0x2d')]);_0x1119f1[_0xf314('0x33')]=_[_0xf314('0x34')](_0x132b94[_0xf314('0x33')]);_0x1119f1[_0xf314('0x35')]=_[_0xf314('0x36')](_0x1119f1['model'],_0x1119f1[_0xf314('0x33')]);_0x44153c[_0xf314('0x39')]=_[_0xf314('0x36')](_0x1119f1['model'],qs['fields'](_0x132b94['query'][_0xf314('0x37')]));_0x44153c[_0xf314('0x39')]=_0x44153c[_0xf314('0x39')][_0xf314('0x38')]?_0x44153c[_0xf314('0x39')]:_0x1119f1['model'];_0x44153c[_0xf314('0x3c')]=qs[_0xf314('0x3d')](_0x132b94[_0xf314('0x33')][_0xf314('0x3d')]);_0x44153c[_0xf314('0x3e')]=qs[_0xf314('0x35')](_['pick'](_0x132b94[_0xf314('0x33')],_0x1119f1['filters']));if(_0x132b94[_0xf314('0x33')][_0xf314('0x3f')]){_0x44153c['where']=_['merge'](_0x44153c[_0xf314('0x3e')],{'$or':_[_0xf314('0x32')](_0x44153c[_0xf314('0x39')],function(_0x15e608){var _0x475136={};_0x475136[_0x15e608]={'$like':'%'+_0x132b94[_0xf314('0x33')][_0xf314('0x3f')]+'%'};return _0x475136;})});}_0x44153c=_['merge']({},_0x44153c,_0x132b94[_0xf314('0x49')]);return _0xf1ac3a[_0xf314('0x5d')](_0x44153c);}})['then'](function(_0x2c1fb7){if(_0x2c1fb7){_0x564440=_0x2c1fb7[_0xf314('0x38')];if(!_0x132b94[_0xf314('0x33')][_0xf314('0x3a')](_0xf314('0x3b'))){_0x44153c[_0xf314('0x1c')]=qs[_0xf314('0x1c')](_0x132b94[_0xf314('0x33')]['limit']);_0x44153c[_0xf314('0x1b')]=qs[_0xf314('0x1b')](_0x132b94['query'][_0xf314('0x1b')]);}return _0xf1ac3a[_0xf314('0x5d')](_0x44153c);}})['then'](function(_0x13b0cc){if(_0x13b0cc){return _0x13b0cc?{'count':_0x564440,'rows':_0x13b0cc}:null;}})['then'](respondWithResult(_0x204e5d,null))['catch'](handleError(_0x204e5d,null));}; \ No newline at end of file +var _0xdaaf=['query','intersection','model','attributes','fields','length','nolimit','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','include','rows','catch','params','includeAll','find','create','body','Triggers','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','findOne','order','getAllConditions','hasOwnProperty','getAnyConditions','addAction','Action','getActions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','apply','reject','save','update','then','destroy','get','UserProfileResource','stack','name','index','map','Trigger','rawAttributes','fieldName','key','keys'];(function(_0x31efcd,_0x28e528){var _0x206f54=function(_0x2dfa83){while(--_0x2dfa83){_0x31efcd['push'](_0x31efcd['shift']());}};_0x206f54(++_0x28e528);}(_0xdaaf,0x130));var _0xfdaa=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xdaaf[_0x57b54c];return _0x59cc19;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xfdaa('0x0'));var rimraf=require(_0xfdaa('0x1'));var zipdir=require(_0xfdaa('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfdaa('0x3'));var moment=require(_0xfdaa('0x4'));var BPromise=require(_0xfdaa('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xfdaa('0x6'));var ejs=require(_0xfdaa('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0xfdaa('0x8'));var crypto=require(_0xfdaa('0x9'));var jsforce=require(_0xfdaa('0xa'));var deskjs=require(_0xfdaa('0xb'));var toCsv=require(_0xfdaa('0x6'));var querystring=require(_0xfdaa('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xfdaa('0xd'));var qs=require(_0xfdaa('0xe'));var as=require(_0xfdaa('0xf'));var hardwareService=require(_0xfdaa('0x10'));var logger=require(_0xfdaa('0x11'))('api');var utils=require('../../config/utils');var config=require(_0xfdaa('0x12'));var db=require(_0xfdaa('0x13'))['db'];function respondWithStatusCode(_0x52d689,_0x108f4e){_0x108f4e=_0x108f4e||0xcc;return function(_0x465506){if(_0x465506){return _0x52d689[_0xfdaa('0x14')](_0x108f4e);}return _0x52d689['status'](_0x108f4e)[_0xfdaa('0x15')]();};}function respondWithResult(_0x56c5f8,_0x1dc353){_0x1dc353=_0x1dc353||0xc8;return function(_0x38516e){if(_0x38516e){return _0x56c5f8[_0xfdaa('0x16')](_0x1dc353)[_0xfdaa('0x17')](_0x38516e);}};}function respondWithFilteredResult(_0x245b37,_0x382ea3){return function(_0x1e5447){if(_0x1e5447){var _0x50863f=_0x1e5447[_0xfdaa('0x18')],_0x1d65dd=_0x382ea3[_0xfdaa('0x19')],_0x472d45=_0x382ea3[_0xfdaa('0x19')]+_0x382ea3[_0xfdaa('0x1a')],_0x3746c0;if(_0x472d45>=_0x50863f){_0x472d45=_0x50863f;_0x3746c0=0xc8;}else{_0x3746c0=0xce;}_0x245b37[_0xfdaa('0x16')](_0x3746c0);return _0x245b37['set']('Content-Range',_0x1d65dd+'-'+_0x472d45+'/'+_0x50863f)[_0xfdaa('0x17')](_0x1e5447);}return null;};}function patchUpdates(_0x4fc04f){return function(_0x42ca02){try{jsonpatch[_0xfdaa('0x1b')](_0x42ca02,_0x4fc04f,!![]);}catch(_0x3f4621){return BPromise[_0xfdaa('0x1c')](_0x3f4621);}return _0x42ca02[_0xfdaa('0x1d')]();};}function saveUpdates(_0x5a8eba,_0x5f5771){return function(_0x139127){if(_0x139127){return _0x139127[_0xfdaa('0x1e')](_0x5a8eba)[_0xfdaa('0x1f')](function(_0x2aeb89){return _0x2aeb89;});}return null;};}function removeEntity(_0x3e6ea0,_0x527bd9){return function(_0x5094e4){if(_0x5094e4){return _0x5094e4[_0xfdaa('0x20')]()['then'](function(){var _0x53d756=_0x5094e4[_0xfdaa('0x21')]({'plain':!![]});var _0x1ad600='Triggers';return db[_0xfdaa('0x22')]['destroy']({'where':{'type':_0x1ad600,'resourceId':_0x53d756['id']}})[_0xfdaa('0x1f')](function(){return _0x5094e4;});})[_0xfdaa('0x1f')](function(){_0x3e6ea0[_0xfdaa('0x16')](0xcc)[_0xfdaa('0x15')]();});}};}function handleEntityNotFound(_0x33f2b4,_0x40356c){return function(_0x448d1e){if(!_0x448d1e){_0x33f2b4['sendStatus'](0x194);}return _0x448d1e;};}function handleError(_0x2a1db8,_0x565e0f){_0x565e0f=_0x565e0f||0x1f4;return function(_0x5eda1c){logger['error'](_0x5eda1c[_0xfdaa('0x23')]);if(_0x5eda1c[_0xfdaa('0x24')]){delete _0x5eda1c[_0xfdaa('0x24')];}_0x2a1db8['status'](_0x565e0f)['send'](_0x5eda1c);};}exports[_0xfdaa('0x25')]=function(_0x2fc866,_0x459f75){var _0x242c4b={},_0x5ca4e3={},_0x380c0e={'count':0x0,'rows':[]};var _0x2b4e6e=_[_0xfdaa('0x26')](db[_0xfdaa('0x27')][_0xfdaa('0x28')],function(_0x23180b){return{'name':_0x23180b[_0xfdaa('0x29')],'type':_0x23180b['type'][_0xfdaa('0x2a')]};});_0x5ca4e3['model']=_[_0xfdaa('0x26')](_0x2b4e6e,_0xfdaa('0x24'));_0x5ca4e3['query']=_[_0xfdaa('0x2b')](_0x2fc866[_0xfdaa('0x2c')]);_0x5ca4e3['filters']=_[_0xfdaa('0x2d')](_0x5ca4e3[_0xfdaa('0x2e')],_0x5ca4e3[_0xfdaa('0x2c')]);_0x242c4b[_0xfdaa('0x2f')]=_[_0xfdaa('0x2d')](_0x5ca4e3[_0xfdaa('0x2e')],qs[_0xfdaa('0x30')](_0x2fc866[_0xfdaa('0x2c')][_0xfdaa('0x30')]));_0x242c4b['attributes']=_0x242c4b[_0xfdaa('0x2f')][_0xfdaa('0x31')]?_0x242c4b[_0xfdaa('0x2f')]:_0x5ca4e3[_0xfdaa('0x2e')];if(!_0x2fc866[_0xfdaa('0x2c')]['hasOwnProperty'](_0xfdaa('0x32'))){_0x242c4b[_0xfdaa('0x1a')]=qs[_0xfdaa('0x1a')](_0x2fc866[_0xfdaa('0x2c')][_0xfdaa('0x1a')]);_0x242c4b['offset']=qs[_0xfdaa('0x19')](_0x2fc866[_0xfdaa('0x2c')][_0xfdaa('0x19')]);}_0x242c4b['order']=qs[_0xfdaa('0x33')](_0x2fc866['query'][_0xfdaa('0x33')]);_0x242c4b[_0xfdaa('0x34')]=qs[_0xfdaa('0x35')](_[_0xfdaa('0x36')](_0x2fc866['query'],_0x5ca4e3[_0xfdaa('0x35')]));if(_0x2fc866[_0xfdaa('0x2c')][_0xfdaa('0x37')]){_0x242c4b['where']=_[_0xfdaa('0x38')](_0x242c4b['where'],{'$or':_[_0xfdaa('0x26')](_0x2b4e6e,function(_0x32da95){if(_0x32da95[_0xfdaa('0x39')]!==_0xfdaa('0x3a')){var _0x3d8415={};_0x3d8415[_0x32da95[_0xfdaa('0x24')]]={'$like':'%'+_0x2fc866[_0xfdaa('0x2c')]['filter']+'%'};return _0x3d8415;}})});}_0x242c4b=_['merge']({},_0x242c4b,_0x2fc866[_0xfdaa('0x3b')]);var _0x5dc129={'where':_0x242c4b[_0xfdaa('0x34')]};return db[_0xfdaa('0x27')][_0xfdaa('0x18')](_0x5dc129)[_0xfdaa('0x1f')](function(_0x3d1e6c){_0x380c0e[_0xfdaa('0x18')]=_0x3d1e6c;if(_0x2fc866['query']['includeAll']){_0x242c4b[_0xfdaa('0x3c')]=[{'all':!![]}];}return db[_0xfdaa('0x27')]['findAll'](_0x242c4b);})[_0xfdaa('0x1f')](function(_0x2752d7){_0x380c0e[_0xfdaa('0x3d')]=_0x2752d7;return _0x380c0e;})[_0xfdaa('0x1f')](respondWithFilteredResult(_0x459f75,_0x242c4b))[_0xfdaa('0x3e')](handleError(_0x459f75,null));};exports['show']=function(_0x141d0a,_0x55cc67){var _0x4cd389={'raw':![],'where':{'id':_0x141d0a[_0xfdaa('0x3f')]['id']}},_0x238275={};_0x238275[_0xfdaa('0x2e')]=_[_0xfdaa('0x2b')](db[_0xfdaa('0x27')][_0xfdaa('0x28')]);_0x238275[_0xfdaa('0x2c')]=_[_0xfdaa('0x2b')](_0x141d0a['query']);_0x238275['filters']=_['intersection'](_0x238275['model'],_0x238275[_0xfdaa('0x2c')]);_0x4cd389['attributes']=_[_0xfdaa('0x2d')](_0x238275[_0xfdaa('0x2e')],qs[_0xfdaa('0x30')](_0x141d0a[_0xfdaa('0x2c')][_0xfdaa('0x30')]));_0x4cd389[_0xfdaa('0x2f')]=_0x4cd389[_0xfdaa('0x2f')][_0xfdaa('0x31')]?_0x4cd389[_0xfdaa('0x2f')]:_0x238275[_0xfdaa('0x2e')];if(_0x141d0a['query'][_0xfdaa('0x40')]){_0x4cd389[_0xfdaa('0x3c')]=[{'all':!![]}];}_0x4cd389=_['merge']({},_0x4cd389,_0x141d0a[_0xfdaa('0x3b')]);return db[_0xfdaa('0x27')][_0xfdaa('0x41')](_0x4cd389)['then'](handleEntityNotFound(_0x55cc67,null))['then'](respondWithResult(_0x55cc67,null))[_0xfdaa('0x3e')](handleError(_0x55cc67,null));};exports[_0xfdaa('0x42')]=function(_0x1a77fc,_0x2e869c){return db[_0xfdaa('0x27')][_0xfdaa('0x42')](_0x1a77fc[_0xfdaa('0x43')],{})[_0xfdaa('0x1f')](function(_0x221c35){var _0x1286d8=_0x1a77fc['user'][_0xfdaa('0x21')]({'plain':!![]});if(!_0x1286d8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1286d8['role']==='user'){var _0x3b1d6b=_0x221c35[_0xfdaa('0x21')]({'plain':!![]});var _0x22964f=_0xfdaa('0x44');return db[_0xfdaa('0x45')][_0xfdaa('0x41')]({'where':{'name':_0x22964f,'userProfileId':_0x1286d8[_0xfdaa('0x46')]},'raw':!![]})[_0xfdaa('0x1f')](function(_0x182e8d){if(_0x182e8d&&_0x182e8d[_0xfdaa('0x47')]===0x0){return db[_0xfdaa('0x22')][_0xfdaa('0x42')]({'name':_0x3b1d6b[_0xfdaa('0x24')],'resourceId':_0x3b1d6b['id'],'type':_0x182e8d[_0xfdaa('0x24')],'sectionId':_0x182e8d['id']},{})[_0xfdaa('0x1f')](function(){return _0x221c35;});}else{return _0x221c35;}})[_0xfdaa('0x3e')](function(_0xd3e6a3){logger[_0xfdaa('0x48')](_0xfdaa('0x49'),_0xd3e6a3);throw _0xd3e6a3;});}return _0x221c35;})['then'](respondWithResult(_0x2e869c,0xc9))[_0xfdaa('0x3e')](handleError(_0x2e869c,null));};exports[_0xfdaa('0x1e')]=function(_0x4b36c7,_0x448647){if(_0x4b36c7['body']['id']){delete _0x4b36c7[_0xfdaa('0x43')]['id'];}return db[_0xfdaa('0x27')][_0xfdaa('0x41')]({'where':{'id':_0x4b36c7['params']['id']}})[_0xfdaa('0x1f')](handleEntityNotFound(_0x448647,null))[_0xfdaa('0x1f')](saveUpdates(_0x4b36c7[_0xfdaa('0x43')],null))['then'](respondWithResult(_0x448647,null))[_0xfdaa('0x3e')](handleError(_0x448647,null));};exports[_0xfdaa('0x20')]=function(_0x127449,_0x2151c4){return db['Trigger'][_0xfdaa('0x41')]({'where':{'id':_0x127449['params']['id']}})[_0xfdaa('0x1f')](handleEntityNotFound(_0x2151c4,null))[_0xfdaa('0x1f')](removeEntity(_0x2151c4,null))[_0xfdaa('0x3e')](handleError(_0x2151c4,null));};exports[_0xfdaa('0x4a')]=function(_0x5683a8,_0x5bf215,_0x29ee90){if(_0x5683a8[_0xfdaa('0x43')]['id']){delete _0x5683a8['body']['id'];}return db[_0xfdaa('0x27')]['find']({'where':{'id':_0x5683a8[_0xfdaa('0x3f')]['id']}})[_0xfdaa('0x1f')](handleEntityNotFound(_0x5bf215,null))[_0xfdaa('0x1f')](function(_0x1c15fa){if(_0x1c15fa){_0x5683a8[_0xfdaa('0x43')][_0xfdaa('0x4b')]=_0x1c15fa['id'];return db[_0xfdaa('0x4c')][_0xfdaa('0x42')](_0x5683a8['body']);}})[_0xfdaa('0x1f')](respondWithResult(_0x5bf215,null))[_0xfdaa('0x3e')](handleError(_0x5bf215,null));};exports[_0xfdaa('0x4d')]=function(_0x30ceec,_0x341124,_0x4aba29){if(_0x30ceec[_0xfdaa('0x43')]['id']){delete _0x30ceec[_0xfdaa('0x43')]['id'];}return db['Trigger'][_0xfdaa('0x41')]({'where':{'id':_0x30ceec[_0xfdaa('0x3f')]['id']}})[_0xfdaa('0x1f')](handleEntityNotFound(_0x341124,null))[_0xfdaa('0x1f')](function(_0x272626){if(_0x272626){_0x30ceec[_0xfdaa('0x43')][_0xfdaa('0x4e')]=_0x272626['id'];return db[_0xfdaa('0x4c')]['create'](_0x30ceec[_0xfdaa('0x43')]);}})['then'](respondWithResult(_0x341124,null))['catch'](handleError(_0x341124,null));};exports['getAllConditions']=function(_0xbac8d7,_0x59f091,_0xfd26b9){var _0x2f1748={};var _0x5dcda4={};var _0x5139ed;var _0x3b3afe;return db[_0xfdaa('0x27')][_0xfdaa('0x4f')]({'where':{'id':_0xbac8d7[_0xfdaa('0x3f')]['id']}})[_0xfdaa('0x1f')](handleEntityNotFound(_0x59f091,null))[_0xfdaa('0x1f')](function(_0x3e8f33){if(_0x3e8f33){_0x5139ed=_0x3e8f33;_0x5dcda4[_0xfdaa('0x2e')]=_[_0xfdaa('0x2b')](db['Condition'][_0xfdaa('0x28')]);_0x5dcda4[_0xfdaa('0x2c')]=_[_0xfdaa('0x2b')](_0xbac8d7['query']);_0x5dcda4[_0xfdaa('0x35')]=_[_0xfdaa('0x2d')](_0x5dcda4[_0xfdaa('0x2e')],_0x5dcda4['query']);_0x2f1748['attributes']=_[_0xfdaa('0x2d')](_0x5dcda4[_0xfdaa('0x2e')],qs['fields'](_0xbac8d7[_0xfdaa('0x2c')][_0xfdaa('0x30')]));_0x2f1748[_0xfdaa('0x2f')]=_0x2f1748[_0xfdaa('0x2f')][_0xfdaa('0x31')]?_0x2f1748[_0xfdaa('0x2f')]:_0x5dcda4[_0xfdaa('0x2e')];_0x2f1748[_0xfdaa('0x50')]=qs['sort'](_0xbac8d7[_0xfdaa('0x2c')]['sort']);_0x2f1748[_0xfdaa('0x34')]=qs[_0xfdaa('0x35')](_['pick'](_0xbac8d7[_0xfdaa('0x2c')],_0x5dcda4['filters']));if(_0xbac8d7[_0xfdaa('0x2c')][_0xfdaa('0x37')]){_0x2f1748[_0xfdaa('0x34')]=_[_0xfdaa('0x38')](_0x2f1748[_0xfdaa('0x34')],{'$or':_[_0xfdaa('0x26')](_0x2f1748[_0xfdaa('0x2f')],function(_0x577d38){var _0x278119={};_0x278119[_0x577d38]={'$like':'%'+_0xbac8d7[_0xfdaa('0x2c')][_0xfdaa('0x37')]+'%'};return _0x278119;})});}_0x2f1748=_[_0xfdaa('0x38')]({},_0x2f1748,_0xbac8d7[_0xfdaa('0x3b')]);return _0x5139ed[_0xfdaa('0x51')](_0x2f1748);}})[_0xfdaa('0x1f')](function(_0x398f92){if(_0x398f92){_0x3b3afe=_0x398f92[_0xfdaa('0x31')];if(!_0xbac8d7[_0xfdaa('0x2c')][_0xfdaa('0x52')](_0xfdaa('0x32'))){_0x2f1748[_0xfdaa('0x1a')]=qs[_0xfdaa('0x1a')](_0xbac8d7[_0xfdaa('0x2c')][_0xfdaa('0x1a')]);_0x2f1748[_0xfdaa('0x19')]=qs[_0xfdaa('0x19')](_0xbac8d7[_0xfdaa('0x2c')][_0xfdaa('0x19')]);}return _0x5139ed[_0xfdaa('0x51')](_0x2f1748);}})[_0xfdaa('0x1f')](function(_0x326a38){if(_0x326a38){return _0x326a38?{'count':_0x3b3afe,'rows':_0x326a38}:null;}})[_0xfdaa('0x1f')](respondWithResult(_0x59f091,null))['catch'](handleError(_0x59f091,null));};exports[_0xfdaa('0x53')]=function(_0x3a9bb4,_0x11293a,_0x927196){var _0xc31074={};var _0x5a9fd1={};var _0x1d5ad9;var _0x461f4c;return db['Trigger']['findOne']({'where':{'id':_0x3a9bb4[_0xfdaa('0x3f')]['id']}})[_0xfdaa('0x1f')](handleEntityNotFound(_0x11293a,null))['then'](function(_0x4016dc){if(_0x4016dc){_0x1d5ad9=_0x4016dc;_0x5a9fd1[_0xfdaa('0x2e')]=_[_0xfdaa('0x2b')](db[_0xfdaa('0x4c')][_0xfdaa('0x28')]);_0x5a9fd1['query']=_[_0xfdaa('0x2b')](_0x3a9bb4[_0xfdaa('0x2c')]);_0x5a9fd1['filters']=_[_0xfdaa('0x2d')](_0x5a9fd1[_0xfdaa('0x2e')],_0x5a9fd1['query']);_0xc31074[_0xfdaa('0x2f')]=_[_0xfdaa('0x2d')](_0x5a9fd1[_0xfdaa('0x2e')],qs[_0xfdaa('0x30')](_0x3a9bb4[_0xfdaa('0x2c')][_0xfdaa('0x30')]));_0xc31074['attributes']=_0xc31074[_0xfdaa('0x2f')]['length']?_0xc31074[_0xfdaa('0x2f')]:_0x5a9fd1[_0xfdaa('0x2e')];_0xc31074[_0xfdaa('0x50')]=qs[_0xfdaa('0x33')](_0x3a9bb4[_0xfdaa('0x2c')][_0xfdaa('0x33')]);_0xc31074[_0xfdaa('0x34')]=qs[_0xfdaa('0x35')](_[_0xfdaa('0x36')](_0x3a9bb4['query'],_0x5a9fd1[_0xfdaa('0x35')]));if(_0x3a9bb4[_0xfdaa('0x2c')]['filter']){_0xc31074[_0xfdaa('0x34')]=_['merge'](_0xc31074[_0xfdaa('0x34')],{'$or':_[_0xfdaa('0x26')](_0xc31074[_0xfdaa('0x2f')],function(_0x49912b){var _0x55421d={};_0x55421d[_0x49912b]={'$like':'%'+_0x3a9bb4['query']['filter']+'%'};return _0x55421d;})});}_0xc31074=_[_0xfdaa('0x38')]({},_0xc31074,_0x3a9bb4[_0xfdaa('0x3b')]);return _0x1d5ad9['getAnyConditions'](_0xc31074);}})[_0xfdaa('0x1f')](function(_0x2ccb66){if(_0x2ccb66){_0x461f4c=_0x2ccb66[_0xfdaa('0x31')];if(!_0x3a9bb4['query'][_0xfdaa('0x52')]('nolimit')){_0xc31074[_0xfdaa('0x1a')]=qs[_0xfdaa('0x1a')](_0x3a9bb4[_0xfdaa('0x2c')][_0xfdaa('0x1a')]);_0xc31074['offset']=qs[_0xfdaa('0x19')](_0x3a9bb4['query'][_0xfdaa('0x19')]);}return _0x1d5ad9[_0xfdaa('0x53')](_0xc31074);}})['then'](function(_0x379b5b){if(_0x379b5b){return _0x379b5b?{'count':_0x461f4c,'rows':_0x379b5b}:null;}})[_0xfdaa('0x1f')](respondWithResult(_0x11293a,null))[_0xfdaa('0x3e')](handleError(_0x11293a,null));};exports[_0xfdaa('0x54')]=function(_0x24b431,_0x585fa8,_0x2637b4){if(_0x24b431[_0xfdaa('0x43')]['id']){delete _0x24b431['body']['id'];}return db[_0xfdaa('0x27')][_0xfdaa('0x41')]({'where':{'id':_0x24b431['params']['id']}})[_0xfdaa('0x1f')](handleEntityNotFound(_0x585fa8,null))[_0xfdaa('0x1f')](function(_0x10b6ca){if(_0x10b6ca){_0x24b431['body']['TriggerId']=_0x10b6ca['id'];return db[_0xfdaa('0x55')][_0xfdaa('0x42')](_0x24b431[_0xfdaa('0x43')]);}})[_0xfdaa('0x1f')](respondWithResult(_0x585fa8,null))['catch'](handleError(_0x585fa8,null));};exports[_0xfdaa('0x56')]=function(_0x4c6756,_0x568756,_0x2c3702){var _0x160b68={};var _0x246150={};var _0x43466d;var _0x14b68b;return db[_0xfdaa('0x27')]['findOne']({'where':{'id':_0x4c6756[_0xfdaa('0x3f')]['id']}})[_0xfdaa('0x1f')](handleEntityNotFound(_0x568756,null))[_0xfdaa('0x1f')](function(_0x343d49){if(_0x343d49){_0x43466d=_0x343d49;_0x246150[_0xfdaa('0x2e')]=_[_0xfdaa('0x2b')](db['Action'][_0xfdaa('0x28')]);_0x246150['query']=_['keys'](_0x4c6756[_0xfdaa('0x2c')]);_0x246150[_0xfdaa('0x35')]=_['intersection'](_0x246150[_0xfdaa('0x2e')],_0x246150['query']);_0x160b68[_0xfdaa('0x2f')]=_[_0xfdaa('0x2d')](_0x246150[_0xfdaa('0x2e')],qs[_0xfdaa('0x30')](_0x4c6756[_0xfdaa('0x2c')][_0xfdaa('0x30')]));_0x160b68[_0xfdaa('0x2f')]=_0x160b68['attributes'][_0xfdaa('0x31')]?_0x160b68['attributes']:_0x246150['model'];_0x160b68[_0xfdaa('0x50')]=qs['sort'](_0x4c6756[_0xfdaa('0x2c')][_0xfdaa('0x33')]);_0x160b68['where']=qs[_0xfdaa('0x35')](_[_0xfdaa('0x36')](_0x4c6756[_0xfdaa('0x2c')],_0x246150[_0xfdaa('0x35')]));if(_0x4c6756['query']['filter']){_0x160b68[_0xfdaa('0x34')]=_[_0xfdaa('0x38')](_0x160b68[_0xfdaa('0x34')],{'$or':_[_0xfdaa('0x26')](_0x160b68[_0xfdaa('0x2f')],function(_0x4a199b){var _0x2fad58={};_0x2fad58[_0x4a199b]={'$like':'%'+_0x4c6756[_0xfdaa('0x2c')][_0xfdaa('0x37')]+'%'};return _0x2fad58;})});}_0x160b68=_[_0xfdaa('0x38')]({},_0x160b68,_0x4c6756[_0xfdaa('0x3b')]);return _0x43466d[_0xfdaa('0x56')](_0x160b68);}})['then'](function(_0x4357e8){if(_0x4357e8){_0x14b68b=_0x4357e8[_0xfdaa('0x31')];if(!_0x4c6756['query'][_0xfdaa('0x52')](_0xfdaa('0x32'))){_0x160b68[_0xfdaa('0x1a')]=qs[_0xfdaa('0x1a')](_0x4c6756['query'][_0xfdaa('0x1a')]);_0x160b68['offset']=qs['offset'](_0x4c6756[_0xfdaa('0x2c')][_0xfdaa('0x19')]);}return _0x43466d['getActions'](_0x160b68);}})[_0xfdaa('0x1f')](function(_0x395810){if(_0x395810){return _0x395810?{'count':_0x14b68b,'rows':_0x395810}:null;}})[_0xfdaa('0x1f')](respondWithResult(_0x568756,null))[_0xfdaa('0x3e')](handleError(_0x568756,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index f75b928..71e243b 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 _0x4dbf=['Trigger','tools_triggers','lodash','moment','path','./trigger.attributes','exports','define'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0x4dbf,0x7a));var _0xf4db=function(_0x4d6bfd,_0x8d79ff){_0x4d6bfd=_0x4d6bfd-0x0;var _0x243a46=_0x4dbf[_0x4d6bfd];return _0x243a46;};'use strict';var _=require(_0xf4db('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xf4db('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf4db('0x2'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf4db('0x3'));module[_0xf4db('0x4')]=function(_0x5f3d35,_0x3e75fc){return _0x5f3d35[_0xf4db('0x5')](_0xf4db('0x6'),attributes,{'tableName':_0xf4db('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa301=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./trigger.attributes','exports','define','Trigger','tools_triggers','lodash','util','../../config/logger','api'];(function(_0x307568,_0x5ea214){var _0x51851b=function(_0x32eb52){while(--_0x32eb52){_0x307568['push'](_0x307568['shift']());}};_0x51851b(++_0x5ea214);}(_0xa301,0xfb));var _0x1a30=function(_0x5104b3,_0x30e2ba){_0x5104b3=_0x5104b3-0x0;var _0x4b7704=_0xa301[_0x5104b3];return _0x4b7704;};'use strict';var _=require(_0x1a30('0x0'));var util=require(_0x1a30('0x1'));var logger=require(_0x1a30('0x2'))(_0x1a30('0x3'));var moment=require(_0x1a30('0x4'));var BPromise=require(_0x1a30('0x5'));var rp=require(_0x1a30('0x6'));var fs=require('fs');var path=require(_0x1a30('0x7'));var rimraf=require(_0x1a30('0x8'));var config=require(_0x1a30('0x9'));var attributes=require(_0x1a30('0xa'));module[_0x1a30('0xb')]=function(_0x3f4e63,_0x22dfa9){return _0x3f4e63[_0x1a30('0xc')](_0x1a30('0xd'),attributes,{'tableName':_0x1a30('0xe'),'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 4bdb046..16365e8 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 _0x0972=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetTrigger','Trigger','findAll','options','raw','attributes','limit','include','map','model','catch','find','where','ShowTrigger','util','bluebird','ioredis','../../mysqldb','../../config/logger'];(function(_0xdfd9c5,_0x4a8422){var _0x53669e=function(_0x425e3a){while(--_0x425e3a){_0xdfd9c5['push'](_0xdfd9c5['shift']());}};_0x53669e(++_0x4a8422);}(_0x0972,0x64));var _0x2097=function(_0x555de1,_0x2133ef){_0x555de1=_0x555de1-0x0;var _0x360a74=_0x0972[_0x555de1];return _0x360a74;};'use strict';var _=require('lodash');var util=require(_0x2097('0x0'));var moment=require('moment');var BPromise=require(_0x2097('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2097('0x2'));var db=require(_0x2097('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x2097('0x4'))(_0x2097('0x5'));var config=require(_0x2097('0x6'));var jayson=require(_0x2097('0x7'));var client=jayson[_0x2097('0x8')][_0x2097('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2b4f21,_0x59739f,_0x332aac){return new BPromise(function(_0x1e661a,_0x11d263){return client[_0x2097('0xa')](_0x2b4f21,_0x332aac)[_0x2097('0xb')](function(_0x59d947){logger[_0x2097('0xc')](_0x2097('0xd'),_0x59739f,_0x2097('0xe'));logger[_0x2097('0xf')](_0x2097('0x10'),_0x59739f,_0x2097('0xe'),JSON[_0x2097('0x11')](_0x59d947));if(_0x59d947[_0x2097('0x12')]){if(_0x59d947[_0x2097('0x12')][_0x2097('0x13')]===0x1f4){logger[_0x2097('0x12')](_0x2097('0xd'),_0x59739f,_0x59d947[_0x2097('0x12')][_0x2097('0x14')]);return _0x11d263(_0x59d947[_0x2097('0x12')][_0x2097('0x14')]);}logger[_0x2097('0x12')](_0x2097('0xd'),_0x59739f,_0x59d947[_0x2097('0x12')][_0x2097('0x14')]);return _0x1e661a(_0x59d947['error'][_0x2097('0x14')]);}else{logger[_0x2097('0xc')]('Trigger,\x20%s,\x20%s',_0x59739f,'request\x20sent');_0x1e661a(_0x59d947['result'][_0x2097('0x14')]);}})['catch'](function(_0x28c35c){logger[_0x2097('0x12')](_0x2097('0xd'),_0x59739f,_0x28c35c);_0x11d263(_0x28c35c);});});}exports[_0x2097('0x15')]=function(_0x44c584){var _0x53e2b4=this;return new Promise(function(_0x324652,_0x140094){return db[_0x2097('0x16')][_0x2097('0x17')]({'raw':_0x44c584[_0x2097('0x18')]?_0x44c584[_0x2097('0x18')][_0x2097('0x19')]===undefined?!![]:![]:!![],'where':_0x44c584[_0x2097('0x18')]?_0x44c584['options']['where']||null:null,'attributes':_0x44c584[_0x2097('0x18')]?_0x44c584['options'][_0x2097('0x1a')]||null:null,'limit':_0x44c584[_0x2097('0x18')]?_0x44c584['options'][_0x2097('0x1b')]||null:null,'include':_0x44c584['options']?_0x44c584[_0x2097('0x18')][_0x2097('0x1c')]?_[_0x2097('0x1d')](_0x44c584[_0x2097('0x18')][_0x2097('0x1c')],function(_0x35047b){return{'model':db[_0x35047b['model']],'as':_0x35047b['as'],'attributes':_0x35047b[_0x2097('0x1a')],'include':_0x35047b['include']?_[_0x2097('0x1d')](_0x35047b[_0x2097('0x1c')],function(_0x345875){return{'model':db[_0x345875[_0x2097('0x1e')]],'as':_0x345875['as'],'attributes':_0x345875['attributes'],'include':_0x345875[_0x2097('0x1c')]?_[_0x2097('0x1d')](_0x345875['include'],function(_0x1229fc){return{'model':db[_0x1229fc['model']],'as':_0x1229fc['as'],'attributes':_0x1229fc[_0x2097('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xbc0339){logger[_0x2097('0xc')](_0x2097('0x15'),_0x44c584);logger[_0x2097('0xf')](_0x2097('0x15'),_0x44c584,JSON[_0x2097('0x11')](_0xbc0339));_0x324652(_0xbc0339);})[_0x2097('0x1f')](function(_0x4b443d){logger[_0x2097('0x12')](_0x2097('0x15'),_0x4b443d['message'],_0x44c584);_0x140094(_0x53e2b4[_0x2097('0x12')](0x1f4,_0x4b443d[_0x2097('0x14')]));});});};exports['ShowTrigger']=function(_0x4d0916){var _0x312c77=this;return new Promise(function(_0x11b051,_0x1649c8){return db[_0x2097('0x16')][_0x2097('0x20')]({'raw':_0x4d0916[_0x2097('0x18')]?_0x4d0916['options'][_0x2097('0x19')]===undefined?!![]:![]:!![],'where':_0x4d0916['options']?_0x4d0916[_0x2097('0x18')][_0x2097('0x21')]||null:null,'attributes':_0x4d0916[_0x2097('0x18')]?_0x4d0916[_0x2097('0x18')][_0x2097('0x1a')]||null:null,'include':_0x4d0916[_0x2097('0x18')]?_0x4d0916[_0x2097('0x18')][_0x2097('0x1c')]?_[_0x2097('0x1d')](_0x4d0916['options'][_0x2097('0x1c')],function(_0x40baed){return{'model':db[_0x40baed[_0x2097('0x1e')]],'as':_0x40baed['as'],'attributes':_0x40baed['attributes'],'include':_0x40baed[_0x2097('0x1c')]?_[_0x2097('0x1d')](_0x40baed[_0x2097('0x1c')],function(_0x396162){return{'model':db[_0x396162['model']],'as':_0x396162['as'],'attributes':_0x396162['attributes'],'include':_0x396162['include']?_[_0x2097('0x1d')](_0x396162[_0x2097('0x1c')],function(_0x4123b7){return{'model':db[_0x4123b7[_0x2097('0x1e')]],'as':_0x4123b7['as'],'attributes':_0x4123b7[_0x2097('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x2097('0xb')](function(_0x49b724){logger[_0x2097('0xc')](_0x2097('0x22'),_0x4d0916);logger[_0x2097('0xf')](_0x2097('0x22'),_0x4d0916,JSON[_0x2097('0x11')](_0x49b724));_0x11b051(_0x49b724);})[_0x2097('0x1f')](function(_0x52b937){logger[_0x2097('0x12')](_0x2097('0x22'),_0x52b937[_0x2097('0x14')],_0x4d0916);_0x1649c8(_0x312c77['error'](0x1f4,_0x52b937['message']));});});}; \ No newline at end of file +var _0x8603=['result','catch','GetTrigger','Trigger','findAll','options','raw','where','attributes','limit','include','map','model','stringify','ShowTrigger','debug','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','Trigger,\x20%s,\x20%s','request\x20sent','Trigger,\x20%s,\x20%s,\x20%s','error','message','info'];(function(_0x5a9d98,_0x347e18){var _0x249612=function(_0x532445){while(--_0x532445){_0x5a9d98['push'](_0x5a9d98['shift']());}};_0x249612(++_0x347e18);}(_0x8603,0x190));var _0x3860=function(_0x57834a,_0xfac574){_0x57834a=_0x57834a-0x0;var _0x5788d9=_0x8603[_0x57834a];return _0x5788d9;};'use strict';var _=require('lodash');var util=require(_0x3860('0x0'));var moment=require(_0x3860('0x1'));var BPromise=require(_0x3860('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3860('0x3'))['db'];var utils=require(_0x3860('0x4'));var logger=require(_0x3860('0x5'))('rpc');var config=require(_0x3860('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3860('0x7')][_0x3860('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1eca44,_0xd3ce26,_0x472bf2){return new BPromise(function(_0x4aba10,_0x5c7350){return client['request'](_0x1eca44,_0x472bf2)[_0x3860('0x9')](function(_0x441dc4){logger['info'](_0x3860('0xa'),_0xd3ce26,_0x3860('0xb'));logger['debug'](_0x3860('0xc'),_0xd3ce26,_0x3860('0xb'),JSON['stringify'](_0x441dc4));if(_0x441dc4[_0x3860('0xd')]){if(_0x441dc4[_0x3860('0xd')]['code']===0x1f4){logger[_0x3860('0xd')](_0x3860('0xa'),_0xd3ce26,_0x441dc4[_0x3860('0xd')][_0x3860('0xe')]);return _0x5c7350(_0x441dc4[_0x3860('0xd')][_0x3860('0xe')]);}logger[_0x3860('0xd')](_0x3860('0xa'),_0xd3ce26,_0x441dc4[_0x3860('0xd')][_0x3860('0xe')]);return _0x4aba10(_0x441dc4['error'][_0x3860('0xe')]);}else{logger[_0x3860('0xf')](_0x3860('0xa'),_0xd3ce26,_0x3860('0xb'));_0x4aba10(_0x441dc4[_0x3860('0x10')][_0x3860('0xe')]);}})[_0x3860('0x11')](function(_0x378305){logger[_0x3860('0xd')](_0x3860('0xa'),_0xd3ce26,_0x378305);_0x5c7350(_0x378305);});});}exports[_0x3860('0x12')]=function(_0x45b799){var _0x4b6b15=this;return new Promise(function(_0x4863bd,_0x373b06){return db[_0x3860('0x13')][_0x3860('0x14')]({'raw':_0x45b799['options']?_0x45b799[_0x3860('0x15')][_0x3860('0x16')]===undefined?!![]:![]:!![],'where':_0x45b799[_0x3860('0x15')]?_0x45b799[_0x3860('0x15')][_0x3860('0x17')]||null:null,'attributes':_0x45b799[_0x3860('0x15')]?_0x45b799[_0x3860('0x15')][_0x3860('0x18')]||null:null,'limit':_0x45b799[_0x3860('0x15')]?_0x45b799[_0x3860('0x15')][_0x3860('0x19')]||null:null,'include':_0x45b799[_0x3860('0x15')]?_0x45b799[_0x3860('0x15')][_0x3860('0x1a')]?_[_0x3860('0x1b')](_0x45b799['options'][_0x3860('0x1a')],function(_0x133093){return{'model':db[_0x133093[_0x3860('0x1c')]],'as':_0x133093['as'],'attributes':_0x133093[_0x3860('0x18')],'include':_0x133093[_0x3860('0x1a')]?_['map'](_0x133093[_0x3860('0x1a')],function(_0x568515){return{'model':db[_0x568515['model']],'as':_0x568515['as'],'attributes':_0x568515[_0x3860('0x18')],'include':_0x568515[_0x3860('0x1a')]?_['map'](_0x568515['include'],function(_0x5f42d5){return{'model':db[_0x5f42d5[_0x3860('0x1c')]],'as':_0x5f42d5['as'],'attributes':_0x5f42d5[_0x3860('0x18')]};}):[]};}):[]};}):[]:[]})[_0x3860('0x9')](function(_0x371f3a){logger[_0x3860('0xf')](_0x3860('0x12'),_0x45b799);logger['debug']('GetTrigger',_0x45b799,JSON[_0x3860('0x1d')](_0x371f3a));_0x4863bd(_0x371f3a);})[_0x3860('0x11')](function(_0x5a9af2){logger[_0x3860('0xd')](_0x3860('0x12'),_0x5a9af2[_0x3860('0xe')],_0x45b799);_0x373b06(_0x4b6b15[_0x3860('0xd')](0x1f4,_0x5a9af2[_0x3860('0xe')]));});});};exports['ShowTrigger']=function(_0x36ae2b){var _0xf624ba=this;return new Promise(function(_0x367b14,_0x4bd90c){return db[_0x3860('0x13')]['find']({'raw':_0x36ae2b[_0x3860('0x15')]?_0x36ae2b['options'][_0x3860('0x16')]===undefined?!![]:![]:!![],'where':_0x36ae2b[_0x3860('0x15')]?_0x36ae2b[_0x3860('0x15')]['where']||null:null,'attributes':_0x36ae2b[_0x3860('0x15')]?_0x36ae2b[_0x3860('0x15')]['attributes']||null:null,'include':_0x36ae2b[_0x3860('0x15')]?_0x36ae2b['options'][_0x3860('0x1a')]?_[_0x3860('0x1b')](_0x36ae2b[_0x3860('0x15')][_0x3860('0x1a')],function(_0x30dc2a){return{'model':db[_0x30dc2a[_0x3860('0x1c')]],'as':_0x30dc2a['as'],'attributes':_0x30dc2a[_0x3860('0x18')],'include':_0x30dc2a['include']?_[_0x3860('0x1b')](_0x30dc2a[_0x3860('0x1a')],function(_0x4d62e9){return{'model':db[_0x4d62e9[_0x3860('0x1c')]],'as':_0x4d62e9['as'],'attributes':_0x4d62e9[_0x3860('0x18')],'include':_0x4d62e9[_0x3860('0x1a')]?_['map'](_0x4d62e9['include'],function(_0x285b1b){return{'model':db[_0x285b1b[_0x3860('0x1c')]],'as':_0x285b1b['as'],'attributes':_0x285b1b[_0x3860('0x18')]};}):[]};}):[]};}):[]:[]})[_0x3860('0x9')](function(_0x59271f){logger['info'](_0x3860('0x1e'),_0x36ae2b);logger[_0x3860('0x1f')](_0x3860('0x1e'),_0x36ae2b,JSON[_0x3860('0x1d')](_0x59271f));_0x367b14(_0x59271f);})[_0x3860('0x11')](function(_0x4df2a9){logger[_0x3860('0xd')](_0x3860('0x1e'),_0x4df2a9['message'],_0x36ae2b);_0x4bd90c(_0xf624ba['error'](0x1f4,_0x4df2a9[_0x3860('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 2c44446..fb2f9c2 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 _0xb458=['create','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','post','clone'];(function(_0x17d408,_0x2c12ca){var _0x40ffda=function(_0x4b9199){while(--_0x4b9199){_0x17d408['push'](_0x17d408['shift']());}};_0x40ffda(++_0x2c12ca);}(_0xb458,0x103));var _0x8b45=function(_0xd036b9,_0x3aa8e1){_0xd036b9=_0xd036b9-0x0;var _0x532634=_0xb458[_0xd036b9];return _0x532634;};'use strict';var multer=require(_0x8b45('0x0'));var util=require(_0x8b45('0x1'));var path=require(_0x8b45('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8b45('0x3')]();var auth=require(_0x8b45('0x4'));var interaction=require(_0x8b45('0x5'));var config=require(_0x8b45('0x6'));var controller=require('./trunk.controller');router[_0x8b45('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8b45('0x7')](_0x8b45('0x8'),auth[_0x8b45('0x9')](),controller[_0x8b45('0xa')]);router[_0x8b45('0xb')]('/:id/clone',auth[_0x8b45('0x9')](),controller[_0x8b45('0xc')]);router[_0x8b45('0xb')]('/',auth[_0x8b45('0x9')](),controller[_0x8b45('0xd')]);router['put'](_0x8b45('0x8'),auth[_0x8b45('0x9')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x8b45('0xe')]);module[_0x8b45('0xf')]=router; \ No newline at end of file +var _0x8ef6=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./trunk.controller','get','isAuthenticated','/:id','show','/:id/clone','clone','post','create','put','update','delete','destroy','exports'];(function(_0x5176e1,_0x54edf4){var _0x553f94=function(_0x172370){while(--_0x172370){_0x5176e1['push'](_0x5176e1['shift']());}};_0x553f94(++_0x54edf4);}(_0x8ef6,0xf2));var _0x68ef=function(_0x3ffc16,_0x3422d1){_0x3ffc16=_0x3ffc16-0x0;var _0x7b889f=_0x8ef6[_0x3ffc16];return _0x7b889f;};'use strict';var multer=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var path=require(_0x68ef('0x2'));var timeout=require(_0x68ef('0x3'));var express=require(_0x68ef('0x4'));var router=express[_0x68ef('0x5')]();var auth=require(_0x68ef('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x68ef('0x7'));var controller=require(_0x68ef('0x8'));router[_0x68ef('0x9')]('/',auth[_0x68ef('0xa')](),controller['index']);router['get'](_0x68ef('0xb'),auth[_0x68ef('0xa')](),controller[_0x68ef('0xc')]);router['post'](_0x68ef('0xd'),auth[_0x68ef('0xa')](),controller[_0x68ef('0xe')]);router[_0x68ef('0xf')]('/',auth[_0x68ef('0xa')](),controller[_0x68ef('0x10')]);router[_0x68ef('0x11')](_0x68ef('0xb'),auth[_0x68ef('0xa')](),controller[_0x68ef('0x12')]);router[_0x68ef('0x13')](_0x68ef('0xb'),auth['isAuthenticated'](),controller[_0x68ef('0x14')]);module[_0x68ef('0x15')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index d6903ba..4b328b6 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 _0x5a0f=['uas','pai','certificate','actpass','dynamic','update,nonat','sequelize','exports','name','ENUM','friend','user','peer','STRING','from-voip-provider','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','setDataValue','transport','join','getDataValue','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','shortinfo','inband','auto','yes','nonat','outgoing','force_rport,comedia','nat','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','accept','refuse','originate','uac'];(function(_0x147004,_0x15e6a2){var _0x3f3c4f=function(_0xc72b63){while(--_0xc72b63){_0x147004['push'](_0x147004['shift']());}};_0x3f3c4f(++_0x15e6a2);}(_0x5a0f,0x9c));var _0xf5a0=function(_0x5e0eac,_0x1728eb){_0x5e0eac=_0x5e0eac-0x0;var _0xd0f574=_0x5a0f[_0x5e0eac];return _0xd0f574;};'use strict';var Sequelize=require(_0xf5a0('0x0'));module[_0xf5a0('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xf5a0('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xf5a0('0x3')](_0xf5a0('0x4'),_0xf5a0('0x5'),_0xf5a0('0x6')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0xf5a0('0x7')],'allowNull':![],'defaultValue':_0xf5a0('0x8')},'callingpres':{'type':Sequelize[_0xf5a0('0x3')]('ALLOWED_NOT_SCREENED',_0xf5a0('0x9'),'ALLOWED_FAILED_SCREEN',_0xf5a0('0xa'),_0xf5a0('0xb'),_0xf5a0('0xc'),_0xf5a0('0xd'),'PROHIB')},'deny':{'type':Sequelize[_0xf5a0('0x7')]},'permit':{'type':Sequelize[_0xf5a0('0x7')]},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize[_0xf5a0('0x7')]},'remotesecret':{'type':Sequelize[_0xf5a0('0x7')]},'transport':{'type':Sequelize['STRING'],'defaultValue':_0xf5a0('0xe'),'set':function(_0x48a0df){this[_0xf5a0('0xf')](_0xf5a0('0x10'),_0x48a0df?_0x48a0df[_0xf5a0('0x11')](','):null);},'get':function(){return this[_0xf5a0('0x12')](_0xf5a0('0x10'))?this['getDataValue'](_0xf5a0('0x10'))['split'](','):null;},'comment':_0xf5a0('0x13')},'dtmfmode':{'type':Sequelize[_0xf5a0('0x3')](_0xf5a0('0x14'),'info',_0xf5a0('0x15'),_0xf5a0('0x16'),_0xf5a0('0x17')),'defaultValue':_0xf5a0('0x14')},'directmedia':{'type':Sequelize[_0xf5a0('0x3')](_0xf5a0('0x18'),'no',_0xf5a0('0x19'),'update',_0xf5a0('0x1a')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0xf5a0('0x18'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xf5a0('0x7')]},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize['STRING'],'defaultValue':_0xf5a0('0x1b'),'set':function(_0x5234f5){this[_0xf5a0('0xf')](_0xf5a0('0x1c'),_0x5234f5?_0x5234f5[_0xf5a0('0x11')](','):null);},'get':function(){return this[_0xf5a0('0x12')](_0xf5a0('0x1c'))?this[_0xf5a0('0x12')]('nat')[_0xf5a0('0x1d')](','):null;},'comment':_0xf5a0('0x1e')},'callgroup':{'type':Sequelize[_0xf5a0('0x7')]},'namedcallgroup':{'type':Sequelize[_0xf5a0('0x7')]},'pickupgroup':{'type':Sequelize[_0xf5a0('0x7')]},'namedpickupgroup':{'type':Sequelize[_0xf5a0('0x7')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xf5a0('0x7')],'allowNull':!![]},'disallow':{'type':Sequelize[_0xf5a0('0x7')],'defaultValue':_0xf5a0('0x1f')},'allow':{'type':Sequelize[_0xf5a0('0x7')],'allowNull':![],'defaultValue':_0xf5a0('0x20'),'set':function(_0x364881){this[_0xf5a0('0xf')]('allow',_0x364881?_0x364881[_0xf5a0('0x11')](';'):_0xf5a0('0x20'));},'get':function(){return this[_0xf5a0('0x12')](_0xf5a0('0x21'))?this[_0xf5a0('0x12')](_0xf5a0('0x21'))[_0xf5a0('0x1d')](';'):null;},'comment':_0xf5a0('0x22')},'autoframing':{'type':Sequelize[_0xf5a0('0x3')](_0xf5a0('0x18'),'no')},'insecure':{'type':Sequelize[_0xf5a0('0x7')],'defaultValue':'port,invite','set':function(_0x15f10a){this[_0xf5a0('0xf')](_0xf5a0('0x23'),_0x15f10a?_0x15f10a[_0xf5a0('0x11')](','):null);},'get':function(){return this[_0xf5a0('0x12')]('insecure')?this[_0xf5a0('0x12')](_0xf5a0('0x23'))[_0xf5a0('0x1d')](','):null;},'comment':_0xf5a0('0x24')},'trustrpid':{'type':Sequelize[_0xf5a0('0x3')](_0xf5a0('0x18'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xf5a0('0x3')](_0xf5a0('0x18'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xf5a0('0x3')](_0xf5a0('0x18'),'no',_0xf5a0('0x25'))},'promiscredir':{'type':Sequelize[_0xf5a0('0x3')](_0xf5a0('0x18'),'no')},'useclientcode':{'type':Sequelize[_0xf5a0('0x3')](_0xf5a0('0x18'),'no')},'accountcode':{'type':Sequelize[_0xf5a0('0x26')](0xb)},'setvar':{'type':Sequelize[_0xf5a0('0x7')]},'callerid':{'type':Sequelize[_0xf5a0('0x7')],'defaultValue':_0xf5a0('0x27')},'amaflags':{'type':Sequelize[_0xf5a0('0x7')]},'callcounter':{'type':Sequelize[_0xf5a0('0x3')](_0xf5a0('0x18'),'no'),'defaultValue':_0xf5a0('0x18')},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0xf5a0('0x3')](_0xf5a0('0x18'),'no')},'allowsubscribe':{'type':Sequelize['ENUM'](_0xf5a0('0x18'),'no')},'allowtransfer':{'type':Sequelize[_0xf5a0('0x3')](_0xf5a0('0x18'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM']('yes','no')},'subscribecontext':{'type':Sequelize[_0xf5a0('0x7')]},'template':{'type':Sequelize[_0xf5a0('0x7')]},'videosupport':{'type':Sequelize[_0xf5a0('0x3')](_0xf5a0('0x18'),'no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xf5a0('0x26')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xf5a0('0x3')](_0xf5a0('0x18'),'no')},'mailbox':{'type':Sequelize[_0xf5a0('0x7')]},'session_timers':{'type':Sequelize['ENUM'](_0xf5a0('0x28'),_0xf5a0('0x29'),_0xf5a0('0x2a'))},'session_expires':{'type':Sequelize[_0xf5a0('0x26')](0xb)},'session_minse':{'type':Sequelize[_0xf5a0('0x26')](0xb)},'session_refresher':{'type':Sequelize[_0xf5a0('0x3')](_0xf5a0('0x2b'),'uas'),'defaultValue':_0xf5a0('0x2c')},'t38pt_usertpsource':{'type':Sequelize[_0xf5a0('0x7')]},'regexten':{'type':Sequelize[_0xf5a0('0x7')]},'fromdomain':{'type':Sequelize[_0xf5a0('0x7')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xf5a0('0x26')](0x5)},'qualify':{'type':Sequelize[_0xf5a0('0x3')](_0xf5a0('0x18'),'no'),'defaultValue':_0xf5a0('0x18')},'keepalive':{'type':Sequelize[_0xf5a0('0x26')](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0xf5a0('0x7')]},'rtptimeout':{'type':Sequelize[_0xf5a0('0x26')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0xf5a0('0x26')](0xb)},'sendrpid':{'type':Sequelize[_0xf5a0('0x3')](_0xf5a0('0x18'),'no',_0xf5a0('0x2d')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xf5a0('0x7')]},'callbackextension':{'type':Sequelize[_0xf5a0('0x7')]},'timert1':{'type':Sequelize[_0xf5a0('0x26')](0xb)},'timerb':{'type':Sequelize[_0xf5a0('0x26')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize[_0xf5a0('0x7')]},'contactacl':{'type':Sequelize[_0xf5a0('0x7')]},'unsolicited_mailbox':{'type':Sequelize[_0xf5a0('0x7')]},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize[_0xf5a0('0x3')](_0xf5a0('0x18'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0xf5a0('0x18'),'no')},'force_avp':{'type':Sequelize[_0xf5a0('0x3')](_0xf5a0('0x18'),'no')},'icesupport':{'type':Sequelize['ENUM']('yes','no')},'dtlsenable':{'type':Sequelize[_0xf5a0('0x3')](_0xf5a0('0x18'),'no')},'dtlsverify':{'type':Sequelize['ENUM'](_0xf5a0('0x18'),'no','fingerprint',_0xf5a0('0x2e'))},'dtlsrekey':{'type':Sequelize[_0xf5a0('0x26')](0xb)},'dtlscertfile':{'type':Sequelize[_0xf5a0('0x7')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0xf5a0('0x7')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize['ENUM']('active','passive',_0xf5a0('0x2f')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xf5a0('0x7')]},'usereqphone':{'type':Sequelize[_0xf5a0('0x3')](_0xf5a0('0x18'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0xf5a0('0x26')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xf5a0('0x3')]('yes','no')},'subscribemwi':{'type':Sequelize[_0xf5a0('0x3')]('yes','no')},'vmexten':{'type':Sequelize[_0xf5a0('0x7')]},'mohinterpret':{'type':Sequelize[_0xf5a0('0x7')]},'mohsuggest':{'type':Sequelize[_0xf5a0('0x7')]},'parkinglot':{'type':Sequelize[_0xf5a0('0x7')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING'],'defaultValue':_0xf5a0('0x30')},'canreinvite':{'type':Sequelize[_0xf5a0('0x3')](_0xf5a0('0x18'),'no',_0xf5a0('0x19'),'update',_0xf5a0('0x31')),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0xf5a0('0x7')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xf5a0('0x7')],'defaultValue':'no'}}; \ No newline at end of file +var _0x8cdb=['yes','nonat','update','outgoing','nat','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','accept','originate','uac','uas','pai','certificate','active','passive','actpass','sequelize','exports','STRING','name','ENUM','friend','user','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','setDataValue','transport','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto'];(function(_0x36095c,_0x29d075){var _0xfd8d63=function(_0x70b6ad){while(--_0x70b6ad){_0x36095c['push'](_0x36095c['shift']());}};_0xfd8d63(++_0x29d075);}(_0x8cdb,0x1a9));var _0xb8cd=function(_0x39424d,_0x153f23){_0x39424d=_0x39424d-0x0;var _0x2e53ad=_0x8cdb[_0x39424d];return _0x2e53ad;};'use strict';var Sequelize=require(_0xb8cd('0x0'));module[_0xb8cd('0x1')]={'name':{'type':Sequelize[_0xb8cd('0x2')],'allowNull':![],'unique':_0xb8cd('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xb8cd('0x4')](_0xb8cd('0x5'),_0xb8cd('0x6'),_0xb8cd('0x7')),'allowNull':![],'defaultValue':_0xb8cd('0x5')},'context':{'type':Sequelize[_0xb8cd('0x2')],'allowNull':![],'defaultValue':_0xb8cd('0x8')},'callingpres':{'type':Sequelize[_0xb8cd('0x4')](_0xb8cd('0x9'),_0xb8cd('0xa'),_0xb8cd('0xb'),'ALLOWED',_0xb8cd('0xc'),_0xb8cd('0xd'),_0xb8cd('0xe'),_0xb8cd('0xf'))},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize[_0xb8cd('0x2')]},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize[_0xb8cd('0x2')]},'remotesecret':{'type':Sequelize[_0xb8cd('0x2')]},'transport':{'type':Sequelize['STRING'],'defaultValue':'udp','set':function(_0x27e35a){this[_0xb8cd('0x10')](_0xb8cd('0x11'),_0x27e35a?_0x27e35a[_0xb8cd('0x12')](','):null);},'get':function(){return this['getDataValue'](_0xb8cd('0x11'))?this['getDataValue'](_0xb8cd('0x11'))['split'](','):null;},'comment':_0xb8cd('0x13')},'dtmfmode':{'type':Sequelize[_0xb8cd('0x4')](_0xb8cd('0x14'),_0xb8cd('0x15'),_0xb8cd('0x16'),_0xb8cd('0x17'),_0xb8cd('0x18')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0xb8cd('0x4')](_0xb8cd('0x19'),'no',_0xb8cd('0x1a'),_0xb8cd('0x1b'),_0xb8cd('0x1c')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xb8cd('0x4')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xb8cd('0x2')]},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0xb8cd('0x2')],'defaultValue':'force_rport,comedia','set':function(_0x269226){this[_0xb8cd('0x10')](_0xb8cd('0x1d'),_0x269226?_0x269226[_0xb8cd('0x12')](','):null);},'get':function(){return this[_0xb8cd('0x1e')](_0xb8cd('0x1d'))?this['getDataValue'](_0xb8cd('0x1d'))[_0xb8cd('0x1f')](','):null;},'comment':_0xb8cd('0x20')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0xb8cd('0x2')]},'namedpickupgroup':{'type':Sequelize[_0xb8cd('0x2')]},'language':{'type':Sequelize[_0xb8cd('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xb8cd('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0xb8cd('0x2')],'defaultValue':_0xb8cd('0x21')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x12c989){this['setDataValue'](_0xb8cd('0x22'),_0x12c989?_0x12c989[_0xb8cd('0x12')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0xb8cd('0x1e')](_0xb8cd('0x22'))?this[_0xb8cd('0x1e')](_0xb8cd('0x22'))[_0xb8cd('0x1f')](';'):null;},'comment':_0xb8cd('0x23')},'autoframing':{'type':Sequelize[_0xb8cd('0x4')](_0xb8cd('0x19'),'no')},'insecure':{'type':Sequelize[_0xb8cd('0x2')],'defaultValue':'port,invite','set':function(_0x4cbe56){this[_0xb8cd('0x10')](_0xb8cd('0x24'),_0x4cbe56?_0x4cbe56[_0xb8cd('0x12')](','):null);},'get':function(){return this[_0xb8cd('0x1e')](_0xb8cd('0x24'))?this[_0xb8cd('0x1e')]('insecure')[_0xb8cd('0x1f')](','):null;},'comment':_0xb8cd('0x25')},'trustrpid':{'type':Sequelize[_0xb8cd('0x4')]('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0xb8cd('0x19'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xb8cd('0x4')](_0xb8cd('0x19'),'no',_0xb8cd('0x26'))},'promiscredir':{'type':Sequelize[_0xb8cd('0x4')](_0xb8cd('0x19'),'no')},'useclientcode':{'type':Sequelize['ENUM']('yes','no')},'accountcode':{'type':Sequelize[_0xb8cd('0x27')](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0xb8cd('0x28')},'amaflags':{'type':Sequelize[_0xb8cd('0x2')]},'callcounter':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0xb8cd('0x19')},'busylevel':{'type':Sequelize[_0xb8cd('0x27')](0xb)},'allowoverlap':{'type':Sequelize[_0xb8cd('0x4')](_0xb8cd('0x19'),'no')},'allowsubscribe':{'type':Sequelize[_0xb8cd('0x4')]('yes','no')},'allowtransfer':{'type':Sequelize[_0xb8cd('0x4')]('yes','no')},'ignoresdpversion':{'type':Sequelize[_0xb8cd('0x4')](_0xb8cd('0x19'),'no')},'subscribecontext':{'type':Sequelize[_0xb8cd('0x2')]},'template':{'type':Sequelize[_0xb8cd('0x2')]},'videosupport':{'type':Sequelize[_0xb8cd('0x4')](_0xb8cd('0x19'),'no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xb8cd('0x27')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xb8cd('0x4')](_0xb8cd('0x19'),'no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize[_0xb8cd('0x4')](_0xb8cd('0x29'),'refuse',_0xb8cd('0x2a'))},'session_expires':{'type':Sequelize[_0xb8cd('0x27')](0xb)},'session_minse':{'type':Sequelize[_0xb8cd('0x27')](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0xb8cd('0x2b'),_0xb8cd('0x2c')),'defaultValue':_0xb8cd('0x2c')},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize[_0xb8cd('0x2')]},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize[_0xb8cd('0x4')](_0xb8cd('0x19'),'no'),'defaultValue':_0xb8cd('0x19')},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0xb8cd('0x2')]},'defaultuser':{'type':Sequelize[_0xb8cd('0x2')]},'rtptimeout':{'type':Sequelize[_0xb8cd('0x27')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0xb8cd('0x27')](0xb)},'sendrpid':{'type':Sequelize[_0xb8cd('0x4')](_0xb8cd('0x19'),'no',_0xb8cd('0x2d')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize[_0xb8cd('0x2')]},'timert1':{'type':Sequelize[_0xb8cd('0x27')](0xb)},'timerb':{'type':Sequelize[_0xb8cd('0x27')](0xb)},'qualifyfreq':{'type':Sequelize[_0xb8cd('0x27')](0xb)},'contactpermit':{'type':Sequelize[_0xb8cd('0x2')]},'contactdeny':{'type':Sequelize[_0xb8cd('0x2')]},'contactacl':{'type':Sequelize[_0xb8cd('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0xb8cd('0x2')]},'use_q850_reason':{'type':Sequelize[_0xb8cd('0x2')]},'maxforwards':{'type':Sequelize[_0xb8cd('0x27')](0xb)},'encryption':{'type':Sequelize[_0xb8cd('0x4')]('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0xb8cd('0x19'),'no')},'force_avp':{'type':Sequelize['ENUM'](_0xb8cd('0x19'),'no')},'icesupport':{'type':Sequelize[_0xb8cd('0x4')]('yes','no')},'dtlsenable':{'type':Sequelize[_0xb8cd('0x4')](_0xb8cd('0x19'),'no')},'dtlsverify':{'type':Sequelize['ENUM'](_0xb8cd('0x19'),'no','fingerprint',_0xb8cd('0x2e'))},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize[_0xb8cd('0x2')]},'dtlscafile':{'type':Sequelize[_0xb8cd('0x2')]},'dtlscapath':{'type':Sequelize[_0xb8cd('0x2')]},'dtlssetup':{'type':Sequelize['ENUM'](_0xb8cd('0x2f'),_0xb8cd('0x30'),_0xb8cd('0x31')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xb8cd('0x2')]},'usereqphone':{'type':Sequelize[_0xb8cd('0x4')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM']('yes','no')},'subscribemwi':{'type':Sequelize[_0xb8cd('0x4')](_0xb8cd('0x19'),'no')},'vmexten':{'type':Sequelize[_0xb8cd('0x2')]},'mohinterpret':{'type':Sequelize[_0xb8cd('0x2')]},'mohsuggest':{'type':Sequelize[_0xb8cd('0x2')]},'parkinglot':{'type':Sequelize[_0xb8cd('0x2')]},'description':{'type':Sequelize[_0xb8cd('0x2')]},'host':{'type':Sequelize[_0xb8cd('0x2')],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize[_0xb8cd('0x4')](_0xb8cd('0x19'),'no',_0xb8cd('0x1a'),_0xb8cd('0x1b'),'update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'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 fddcccd..a390a2b 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 _0x9c0d=['zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','Trunk,\x20%s,\x20%s','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','destroy','Trunks','UserProfileResource','stack','name','send','index','Trunk','rawAttributes','type','key','model','map','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','filters','pick','filter','where','merge','includeAll','include','findAll','rows','show','params','options','find','get','omit','createdAt','body','updatedAt','create','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','root','utf8','join','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','update','server/files/templates/trunk.ejs','/etc/asterisk/sip_xcally_registers.conf','Reload','eml-format','rimraf'];(function(_0x14cb3d,_0x550c62){var _0x1d0f2f=function(_0x18de67){while(--_0x18de67){_0x14cb3d['push'](_0x14cb3d['shift']());}};_0x1d0f2f(++_0x550c62);}(_0x9c0d,0x145));var _0xd9c0=function(_0x54b78c,_0x598009){_0x54b78c=_0x54b78c-0x0;var _0x5039e4=_0x9c0d[_0x54b78c];return _0x5039e4;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xd9c0('0x0'));var rimraf=require(_0xd9c0('0x1'));var zipdir=require(_0xd9c0('0x2'));var jsonpatch=require(_0xd9c0('0x3'));var rp=require(_0xd9c0('0x4'));var moment=require(_0xd9c0('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xd9c0('0x6'));var sox=require(_0xd9c0('0x7'));var csv=require(_0xd9c0('0x8'));var ejs=require(_0xd9c0('0x9'));var fs=require('fs');var _=require(_0xd9c0('0xa'));var squel=require('squel');var crypto=require(_0xd9c0('0xb'));var jsforce=require(_0xd9c0('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xd9c0('0x8'));var querystring=require(_0xd9c0('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd9c0('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd9c0('0xf'));var logger=require(_0xd9c0('0x10'))(_0xd9c0('0x11'));var utils=require(_0xd9c0('0x12'));var config=require('../../config/environment');var db=require(_0xd9c0('0x13'))['db'];var jayson=require(_0xd9c0('0x14'));var client=jayson[_0xd9c0('0x15')][_0xd9c0('0x16')]({'port':0x232a});function checkPasswordPattern(_0x321066,_0xa18b2,_0x30ba7f){if(_0x30ba7f){var _0x45c657=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x45c657[_0xd9c0('0x17')](_0xa18b2)){return _0x321066;}else{throw new db[(_0xd9c0('0x18'))][(_0xd9c0('0x19'))](_0xd9c0('0x1a'));}}else{return _0x321066;}}function respondWithRpcPromise(_0x396e6a,_0x23daf6,_0x18925c,_0x2adb0d){return new BPromise(function(_0x3d2b8d,_0x24bcda){var _0x43c11f=_0x2adb0d||client;return _0x43c11f['request'](_0x396e6a,_0x18925c)[_0xd9c0('0x1b')](function(_0x260837){logger[_0xd9c0('0x1c')](_0xd9c0('0x1d'),_0x23daf6,_0xd9c0('0x1e'));logger['debug'](_0xd9c0('0x1f'),_0x23daf6,'request\x20sent',JSON[_0xd9c0('0x20')](_0x260837));if(_0x260837[_0xd9c0('0x21')]){if(_0x260837[_0xd9c0('0x21')]['code']===0x1f4){logger[_0xd9c0('0x21')]('Trunk,\x20%s,\x20%s',_0x23daf6,_0x260837[_0xd9c0('0x21')][_0xd9c0('0x22')]);return _0x24bcda(_0x260837['error'][_0xd9c0('0x22')]);}logger[_0xd9c0('0x21')](_0xd9c0('0x1d'),_0x23daf6,_0x260837['error'][_0xd9c0('0x22')]);return _0x3d2b8d(_0x260837['error'][_0xd9c0('0x22')]);}else{logger[_0xd9c0('0x1c')](_0xd9c0('0x1d'),_0x23daf6,_0xd9c0('0x1e'));_0x3d2b8d(_0x260837[_0xd9c0('0x23')]['message']);}})[_0xd9c0('0x24')](function(_0x256100){logger[_0xd9c0('0x21')]('Trunk,\x20%s,\x20%s',_0x23daf6,_0x256100);_0x24bcda(_0x256100);});});}function respondWithStatusCode(_0x435047,_0x36266f){_0x36266f=_0x36266f||0xcc;return function(_0x20c664){if(_0x20c664){return _0x435047[_0xd9c0('0x25')](_0x36266f);}return _0x435047[_0xd9c0('0x26')](_0x36266f)[_0xd9c0('0x27')]();};}function respondWithResult(_0x184c84,_0x11ad26){_0x11ad26=_0x11ad26||0xc8;return function(_0x245f3e){if(_0x245f3e){return _0x184c84[_0xd9c0('0x26')](_0x11ad26)[_0xd9c0('0x28')](_0x245f3e);}};}function respondWithFilteredResult(_0x14602b,_0x35dcda){return function(_0xc5b6e9){if(_0xc5b6e9){var _0x1ac1ff=_0xc5b6e9[_0xd9c0('0x29')],_0x5b6f53=_0x35dcda['offset'],_0x4b8bf5=_0x35dcda[_0xd9c0('0x2a')]+_0x35dcda[_0xd9c0('0x2b')],_0x3f14af;if(_0x4b8bf5>=_0x1ac1ff){_0x4b8bf5=_0x1ac1ff;_0x3f14af=0xc8;}else{_0x3f14af=0xce;}_0x14602b[_0xd9c0('0x26')](_0x3f14af);return _0x14602b[_0xd9c0('0x2c')](_0xd9c0('0x2d'),_0x5b6f53+'-'+_0x4b8bf5+'/'+_0x1ac1ff)[_0xd9c0('0x28')](_0xc5b6e9);}return null;};}function patchUpdates(_0x5346f4){return function(_0x55668d){try{jsonpatch[_0xd9c0('0x2e')](_0x55668d,_0x5346f4,!![]);}catch(_0x58d1ad){return BPromise[_0xd9c0('0x2f')](_0x58d1ad);}return _0x55668d[_0xd9c0('0x30')]();};}function saveUpdates(_0x2aaeba,_0x2c21f8){return function(_0x409187){if(_0x409187){return _0x409187['update'](_0x2aaeba)[_0xd9c0('0x1b')](function(_0x7b304c){return _0x7b304c;});}return null;};}function removeEntity(_0x53f9a4,_0x22fc01){return function(_0x4802f6){if(_0x4802f6){return _0x4802f6[_0xd9c0('0x31')]()[_0xd9c0('0x1b')](function(){var _0x16ac9f=_0x4802f6['get']({'plain':!![]});var _0x315614=_0xd9c0('0x32');return db[_0xd9c0('0x33')][_0xd9c0('0x31')]({'where':{'type':_0x315614,'resourceId':_0x16ac9f['id']}})['then'](function(){return _0x4802f6;});})['then'](function(){_0x53f9a4[_0xd9c0('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x7454ef,_0xcffe23){return function(_0x2249c2){if(!_0x2249c2){_0x7454ef[_0xd9c0('0x25')](0x194);}return _0x2249c2;};}function handleError(_0x17ecd6,_0x140bdd){_0x140bdd=_0x140bdd||0x1f4;return function(_0x25552c){logger[_0xd9c0('0x21')](_0x25552c[_0xd9c0('0x34')]);if(_0x25552c[_0xd9c0('0x35')]){delete _0x25552c[_0xd9c0('0x35')];}_0x17ecd6[_0xd9c0('0x26')](_0x140bdd)[_0xd9c0('0x36')](_0x25552c);};}exports[_0xd9c0('0x37')]=function(_0x4c33ad,_0x3ed869){var _0x1373d6={},_0x25b161={},_0x3abe2c={'count':0x0,'rows':[]};var _0xe1c02=_['map'](db[_0xd9c0('0x38')][_0xd9c0('0x39')],function(_0x2f1379){return{'name':_0x2f1379['fieldName'],'type':_0x2f1379[_0xd9c0('0x3a')][_0xd9c0('0x3b')]};});_0x25b161[_0xd9c0('0x3c')]=_[_0xd9c0('0x3d')](_0xe1c02,_0xd9c0('0x35'));_0x25b161[_0xd9c0('0x3e')]=_[_0xd9c0('0x3f')](_0x4c33ad[_0xd9c0('0x3e')]);_0x25b161['filters']=_['intersection'](_0x25b161[_0xd9c0('0x3c')],_0x25b161['query']);_0x1373d6[_0xd9c0('0x40')]=_[_0xd9c0('0x41')](_0x25b161[_0xd9c0('0x3c')],qs[_0xd9c0('0x42')](_0x4c33ad['query'][_0xd9c0('0x42')]));_0x1373d6['attributes']=_0x1373d6[_0xd9c0('0x40')][_0xd9c0('0x43')]?_0x1373d6[_0xd9c0('0x40')]:_0x25b161[_0xd9c0('0x3c')];if(!_0x4c33ad['query'][_0xd9c0('0x44')](_0xd9c0('0x45'))){_0x1373d6[_0xd9c0('0x2b')]=qs['limit'](_0x4c33ad['query']['limit']);_0x1373d6[_0xd9c0('0x2a')]=qs[_0xd9c0('0x2a')](_0x4c33ad[_0xd9c0('0x3e')][_0xd9c0('0x2a')]);}_0x1373d6[_0xd9c0('0x46')]=qs['sort'](_0x4c33ad[_0xd9c0('0x3e')]['sort']);_0x1373d6['where']=qs[_0xd9c0('0x47')](_[_0xd9c0('0x48')](_0x4c33ad['query'],_0x25b161['filters']));if(_0x4c33ad[_0xd9c0('0x3e')][_0xd9c0('0x49')]){_0x1373d6[_0xd9c0('0x4a')]=_[_0xd9c0('0x4b')](_0x1373d6[_0xd9c0('0x4a')],{'$or':_[_0xd9c0('0x3d')](_0xe1c02,function(_0x3139de){if(_0x3139de['type']!=='VIRTUAL'){var _0x2657eb={};_0x2657eb[_0x3139de[_0xd9c0('0x35')]]={'$like':'%'+_0x4c33ad[_0xd9c0('0x3e')][_0xd9c0('0x49')]+'%'};return _0x2657eb;}})});}_0x1373d6=_['merge']({},_0x1373d6,_0x4c33ad['options']);var _0x48f4a0={'where':_0x1373d6[_0xd9c0('0x4a')]};return db[_0xd9c0('0x38')]['count'](_0x48f4a0)[_0xd9c0('0x1b')](function(_0xa2086f){_0x3abe2c['count']=_0xa2086f;if(_0x4c33ad[_0xd9c0('0x3e')][_0xd9c0('0x4c')]){_0x1373d6[_0xd9c0('0x4d')]=[{'all':!![]}];}return db[_0xd9c0('0x38')][_0xd9c0('0x4e')](_0x1373d6);})[_0xd9c0('0x1b')](function(_0x2082fd){_0x3abe2c[_0xd9c0('0x4f')]=_0x2082fd;return _0x3abe2c;})[_0xd9c0('0x1b')](respondWithFilteredResult(_0x3ed869,_0x1373d6))['catch'](handleError(_0x3ed869,null));};exports[_0xd9c0('0x50')]=function(_0x49260f,_0x290386){var _0x2ab022={'raw':![],'where':{'id':_0x49260f[_0xd9c0('0x51')]['id']}},_0x388118={};_0x388118['model']=_['keys'](db['Trunk'][_0xd9c0('0x39')]);_0x388118[_0xd9c0('0x3e')]=_[_0xd9c0('0x3f')](_0x49260f[_0xd9c0('0x3e')]);_0x388118[_0xd9c0('0x47')]=_[_0xd9c0('0x41')](_0x388118[_0xd9c0('0x3c')],_0x388118['query']);_0x2ab022[_0xd9c0('0x40')]=_[_0xd9c0('0x41')](_0x388118[_0xd9c0('0x3c')],qs[_0xd9c0('0x42')](_0x49260f['query']['fields']));_0x2ab022[_0xd9c0('0x40')]=_0x2ab022[_0xd9c0('0x40')][_0xd9c0('0x43')]?_0x2ab022[_0xd9c0('0x40')]:_0x388118[_0xd9c0('0x3c')];if(_0x49260f['query'][_0xd9c0('0x4c')]){_0x2ab022[_0xd9c0('0x4d')]=[{'all':!![]}];}_0x2ab022=_[_0xd9c0('0x4b')]({},_0x2ab022,_0x49260f[_0xd9c0('0x52')]);return db[_0xd9c0('0x38')]['find'](_0x2ab022)[_0xd9c0('0x1b')](handleEntityNotFound(_0x290386,null))[_0xd9c0('0x1b')](respondWithResult(_0x290386,null))[_0xd9c0('0x24')](handleError(_0x290386,null));};exports['clone']=function(_0x3fb0b4,_0x1eb071){var _0x12bb9b={'where':{'id':_0x3fb0b4[_0xd9c0('0x51')]['id']}},_0x12692e={};_0x12692e['model']=_[_0xd9c0('0x3f')](db['Trunk'][_0xd9c0('0x39')]);_0x12bb9b[_0xd9c0('0x40')]=_[_0xd9c0('0x41')](_0x12692e[_0xd9c0('0x3c')],qs[_0xd9c0('0x42')](_0x3fb0b4[_0xd9c0('0x3e')][_0xd9c0('0x42')]));_0x12bb9b[_0xd9c0('0x40')]=_0x12bb9b[_0xd9c0('0x40')]['length']?_0x12bb9b[_0xd9c0('0x40')]:_0x12692e[_0xd9c0('0x3c')];if(_0x3fb0b4[_0xd9c0('0x3e')][_0xd9c0('0x4c')]){_0x12bb9b[_0xd9c0('0x4d')]=[{'all':!![]}];}_0x12bb9b=_[_0xd9c0('0x4b')]({},_0x12bb9b,_0x3fb0b4[_0xd9c0('0x52')]);return db['Trunk'][_0xd9c0('0x53')](_0x12bb9b)[_0xd9c0('0x1b')](handleEntityNotFound(_0x1eb071,null))[_0xd9c0('0x1b')](function(_0x33bba1){if(_0x33bba1){var _0x4b706c=_0x33bba1[_0xd9c0('0x54')]({'plain':!![]});_0x4b706c=qs[_0xd9c0('0x55')](_0x4b706c,['id',_0xd9c0('0x56'),'updatedAt']);_0x3fb0b4[_0xd9c0('0x57')]=_['omit'](_0x3fb0b4[_0xd9c0('0x57')],['id',_0xd9c0('0x56'),_0xd9c0('0x58')]);return db[_0xd9c0('0x38')][_0xd9c0('0x59')](_['merge'](_0x4b706c,_0x3fb0b4[_0xd9c0('0x57')]),{'include':_0x3fb0b4[_0xd9c0('0x3e')][_0xd9c0('0x4c')]?[{'all':!![]}]:undefined})[_0xd9c0('0x1b')](function(_0x51f650){var _0x1b7764=_0x3fb0b4['user'][_0xd9c0('0x54')]({'plain':!![]});if(!_0x1b7764)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1b7764[_0xd9c0('0x5a')]==='user'){var _0x57e845=_0x51f650[_0xd9c0('0x54')]({'plain':!![]});var _0x13e1a1='Trunks';return db[_0xd9c0('0x5b')][_0xd9c0('0x53')]({'where':{'name':_0x13e1a1,'userProfileId':_0x1b7764['userProfileId']},'raw':!![]})[_0xd9c0('0x1b')](function(_0x139c9d){if(_0x139c9d&&_0x139c9d[_0xd9c0('0x5c')]===0x0){return db['UserProfileResource'][_0xd9c0('0x59')]({'name':_0x57e845[_0xd9c0('0x35')],'resourceId':_0x57e845['id'],'type':_0x139c9d[_0xd9c0('0x35')],'sectionId':_0x139c9d['id']},{})[_0xd9c0('0x1b')](function(){return _0x51f650;});}else{return _0x51f650;}})[_0xd9c0('0x24')](function(_0x5403a2){logger[_0xd9c0('0x21')](_0xd9c0('0x5d'),_0x5403a2);throw _0x5403a2;});}return _0x51f650;});}})[_0xd9c0('0x1b')](respondWithResult(_0x1eb071,0xc9))[_0xd9c0('0x24')](handleError(_0x1eb071,null));};exports[_0xd9c0('0x59')]=function(_0x31ba71,_0x288bcd,_0x299bb3){var _0x49d3c0;return db['Trunk'][_0xd9c0('0x59')](_0x31ba71[_0xd9c0('0x57')],{'raw':!![]})[_0xd9c0('0x1b')](function(_0x116a1c){_0x49d3c0=_0x116a1c;return db[_0xd9c0('0x38')][_0xd9c0('0x4e')]({'raw':!![]});})['then'](function(_0x13a5f7){var _0x43e93e=fs[_0xd9c0('0x5e')](path['join'](config[_0xd9c0('0x5f')],'server/files/templates/trunk.ejs'),_0xd9c0('0x60'));var _0x3a74a3=fs[_0xd9c0('0x5e')](path[_0xd9c0('0x61')](config[_0xd9c0('0x5f')],_0xd9c0('0x62')),_0xd9c0('0x60'));var _0x1774fa=ejs[_0xd9c0('0x63')](_0x43e93e,{'trunks':_0x13a5f7||[]});fs[_0xd9c0('0x64')](_0xd9c0('0x65'),_0x1774fa);if(_0x49d3c0['registry']){var _0xf34c11=ejs[_0xd9c0('0x63')](_0x3a74a3,{'trunks':_0x13a5f7||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_registers.conf',_0xf34c11);}})['then'](function(){return respondWithRpcPromise('Reload',_0xd9c0('0x59'),{'module':_0xd9c0('0x66')});})[_0xd9c0('0x1b')](function(){var _0x543081=_0x31ba71[_0xd9c0('0x67')][_0xd9c0('0x54')]({'plain':!![]});if(!_0x543081)throw new Error(_0xd9c0('0x68'));if(_0x543081[_0xd9c0('0x5a')]===_0xd9c0('0x67')){var _0x5c18e7=_0x49d3c0[_0xd9c0('0x54')]({'plain':!![]});return db[_0xd9c0('0x5b')]['find']({'where':{'name':_0xd9c0('0x32'),'userProfileId':_0x543081['userProfileId']},'raw':!![]})[_0xd9c0('0x1b')](function(_0x1a5020){if(_0x1a5020&&_0x1a5020[_0xd9c0('0x5c')]===0x0){return db[_0xd9c0('0x33')][_0xd9c0('0x59')]({'name':_0x5c18e7[_0xd9c0('0x35')],'resourceId':_0x5c18e7['id'],'type':_0x1a5020[_0xd9c0('0x35')],'sectionId':_0x1a5020['id']},{})[_0xd9c0('0x1b')](function(){return _0x49d3c0;});}else{return _0x49d3c0;}})[_0xd9c0('0x24')](function(_0x3b934d){logger['error'](_0xd9c0('0x5d'),_0x3b934d);throw _0x3b934d;});}return _0x49d3c0;})[_0xd9c0('0x1b')](respondWithResult(_0x288bcd,0xc9))[_0xd9c0('0x24')](handleError(_0x288bcd,null));};exports[_0xd9c0('0x69')]=function(_0x53f6aa,_0x3786f1,_0x5e1207){var _0x233452;return db[_0xd9c0('0x38')]['find']({'where':{'id':_0x53f6aa[_0xd9c0('0x51')]['id']}})['then'](handleEntityNotFound(_0x3786f1,null))[_0xd9c0('0x1b')](saveUpdates(_0x53f6aa['body'],null))['then'](function(_0x1141f9){if(_0x1141f9){_0x233452=_0x1141f9;return db[_0xd9c0('0x38')][_0xd9c0('0x4e')]({'raw':!![]});}})[_0xd9c0('0x1b')](function(_0x3c1e7b){if(_0x3c1e7b){var _0x45ac78=fs[_0xd9c0('0x5e')](path[_0xd9c0('0x61')](config[_0xd9c0('0x5f')],_0xd9c0('0x6a')),_0xd9c0('0x60'));var _0x2b7508=fs[_0xd9c0('0x5e')](path[_0xd9c0('0x61')](config[_0xd9c0('0x5f')],'server/files/templates/registry.ejs'),_0xd9c0('0x60'));var _0x2efe31=ejs[_0xd9c0('0x63')](_0x45ac78,{'trunks':_0x3c1e7b||[]});fs[_0xd9c0('0x64')](_0xd9c0('0x65'),_0x2efe31);var _0x115b95=ejs['render'](_0x2b7508,{'trunks':_0x3c1e7b||[]});fs[_0xd9c0('0x64')](_0xd9c0('0x6b'),_0x115b95);return respondWithRpcPromise(_0xd9c0('0x6c'),_0xd9c0('0x69'),{'module':_0xd9c0('0x66')});}return null;})[_0xd9c0('0x1b')](function(_0x300d0a){if(_0x300d0a){return _0x233452;}})[_0xd9c0('0x1b')](respondWithResult(_0x3786f1,null))['catch'](handleError(_0x3786f1,null));};exports[_0xd9c0('0x31')]=function(_0x578083,_0x1b7497,_0x46e26f){var _0x209240;return db[_0xd9c0('0x38')][_0xd9c0('0x53')]({'where':{'id':_0x578083[_0xd9c0('0x51')]['id']}})[_0xd9c0('0x1b')](handleEntityNotFound(_0x1b7497,null))[_0xd9c0('0x1b')](removeEntity(_0x1b7497,null))['then'](function(){return db['Trunk'][_0xd9c0('0x4e')]({'raw':!![]});})[_0xd9c0('0x1b')](function(_0x3f6a6d){var _0x107ffd=fs['readFileSync'](path[_0xd9c0('0x61')](config[_0xd9c0('0x5f')],'server/files/templates/trunk.ejs'),_0xd9c0('0x60'));var _0x585a63=fs[_0xd9c0('0x5e')](path[_0xd9c0('0x61')](config[_0xd9c0('0x5f')],_0xd9c0('0x62')),'utf8');var _0x3f2f11=ejs['render'](_0x107ffd,{'trunks':_0x3f6a6d});var _0xc5cf0=ejs['render'](_0x585a63,{'trunks':_0x3f6a6d});fs[_0xd9c0('0x64')]('/etc/asterisk/sip_xcally_trunks.conf',_0x3f2f11);fs['writeFileSync'](_0xd9c0('0x6b'),_0xc5cf0);return respondWithRpcPromise(_0xd9c0('0x6c'),_0xd9c0('0x31'),{'module':_0xd9c0('0x66')});})[_0xd9c0('0x24')](handleError(_0x1b7497,null));}; \ No newline at end of file +var _0x3a02=['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','Trunk,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','sendStatus','status','end','json','offset','limit','set','apply','save','update','destroy','get','Trunks','stack','name','send','index','map','Trunk','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','type','count','includeAll','include','catch','params','find','omit','createdAt','body','updatedAt','create','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findAll','root','server/files/templates/trunk.ejs','utf8','readFileSync','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','join','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','jayson/promise','http','test'];(function(_0x10bcf2,_0x49c7a8){var _0x312fc7=function(_0x5db074){while(--_0x5db074){_0x10bcf2['push'](_0x10bcf2['shift']());}};_0x312fc7(++_0x49c7a8);}(_0x3a02,0x196));var _0x23a0=function(_0x1e5f4d,_0x154363){_0x1e5f4d=_0x1e5f4d-0x0;var _0x330329=_0x3a02[_0x1e5f4d];return _0x330329;};'use strict';var pdf=require(_0x23a0('0x0'));var emlformat=require(_0x23a0('0x1'));var rimraf=require(_0x23a0('0x2'));var zipdir=require(_0x23a0('0x3'));var jsonpatch=require(_0x23a0('0x4'));var rp=require(_0x23a0('0x5'));var moment=require(_0x23a0('0x6'));var BPromise=require(_0x23a0('0x7'));var Mustache=require(_0x23a0('0x8'));var util=require(_0x23a0('0x9'));var path=require('path');var sox=require(_0x23a0('0xa'));var csv=require(_0x23a0('0xb'));var ejs=require(_0x23a0('0xc'));var fs=require('fs');var _=require(_0x23a0('0xd'));var squel=require(_0x23a0('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x23a0('0xb'));var querystring=require(_0x23a0('0xf'));var Papa=require('papaparse');var Redis=require(_0x23a0('0x10'));var authService=require(_0x23a0('0x11'));var qs=require(_0x23a0('0x12'));var as=require(_0x23a0('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x23a0('0x14'));var utils=require('../../config/utils');var config=require(_0x23a0('0x15'));var db=require(_0x23a0('0x16'))['db'];var jayson=require(_0x23a0('0x17'));var client=jayson['client'][_0x23a0('0x18')]({'port':0x232a});function checkPasswordPattern(_0xf8f1fb,_0x16848f,_0x1e1e64){if(_0x1e1e64){var _0x3d071e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3d071e[_0x23a0('0x19')](_0x16848f)){return _0xf8f1fb;}else{throw new db[(_0x23a0('0x1a'))][(_0x23a0('0x1b'))](_0x23a0('0x1c'));}}else{return _0xf8f1fb;}}function respondWithRpcPromise(_0x2d635e,_0x36fcb5,_0x310452,_0x5a5978){return new BPromise(function(_0x228ff6,_0x1a7b6f){var _0x6a6374=_0x5a5978||client;return _0x6a6374[_0x23a0('0x1d')](_0x2d635e,_0x310452)[_0x23a0('0x1e')](function(_0x147815){logger['info'](_0x23a0('0x1f'),_0x36fcb5,_0x23a0('0x20'));logger[_0x23a0('0x21')]('Trunk,\x20%s,\x20%s,\x20%s',_0x36fcb5,_0x23a0('0x20'),JSON[_0x23a0('0x22')](_0x147815));if(_0x147815[_0x23a0('0x23')]){if(_0x147815['error'][_0x23a0('0x24')]===0x1f4){logger[_0x23a0('0x23')](_0x23a0('0x1f'),_0x36fcb5,_0x147815[_0x23a0('0x23')][_0x23a0('0x25')]);return _0x1a7b6f(_0x147815['error'][_0x23a0('0x25')]);}logger[_0x23a0('0x23')](_0x23a0('0x1f'),_0x36fcb5,_0x147815[_0x23a0('0x23')][_0x23a0('0x25')]);return _0x228ff6(_0x147815['error']['message']);}else{logger[_0x23a0('0x26')](_0x23a0('0x1f'),_0x36fcb5,'request\x20sent');_0x228ff6(_0x147815[_0x23a0('0x27')]['message']);}})['catch'](function(_0x4608e5){logger[_0x23a0('0x23')]('Trunk,\x20%s,\x20%s',_0x36fcb5,_0x4608e5);_0x1a7b6f(_0x4608e5);});});}function respondWithStatusCode(_0xd4e8c0,_0x1c8da0){_0x1c8da0=_0x1c8da0||0xcc;return function(_0x5b63b0){if(_0x5b63b0){return _0xd4e8c0[_0x23a0('0x28')](_0x1c8da0);}return _0xd4e8c0[_0x23a0('0x29')](_0x1c8da0)[_0x23a0('0x2a')]();};}function respondWithResult(_0x56c48b,_0x4fba44){_0x4fba44=_0x4fba44||0xc8;return function(_0x1e5518){if(_0x1e5518){return _0x56c48b[_0x23a0('0x29')](_0x4fba44)[_0x23a0('0x2b')](_0x1e5518);}};}function respondWithFilteredResult(_0x5ab716,_0x2fe0c4){return function(_0x34c8a7){if(_0x34c8a7){var _0x359b23=_0x34c8a7['count'],_0x7d932e=_0x2fe0c4[_0x23a0('0x2c')],_0x12ddc9=_0x2fe0c4[_0x23a0('0x2c')]+_0x2fe0c4[_0x23a0('0x2d')],_0x438f75;if(_0x12ddc9>=_0x359b23){_0x12ddc9=_0x359b23;_0x438f75=0xc8;}else{_0x438f75=0xce;}_0x5ab716[_0x23a0('0x29')](_0x438f75);return _0x5ab716[_0x23a0('0x2e')]('Content-Range',_0x7d932e+'-'+_0x12ddc9+'/'+_0x359b23)['json'](_0x34c8a7);}return null;};}function patchUpdates(_0x1b55f3){return function(_0x1203af){try{jsonpatch[_0x23a0('0x2f')](_0x1203af,_0x1b55f3,!![]);}catch(_0x2d64c1){return BPromise['reject'](_0x2d64c1);}return _0x1203af[_0x23a0('0x30')]();};}function saveUpdates(_0x577c61,_0x6adeeb){return function(_0x77b6c9){if(_0x77b6c9){return _0x77b6c9[_0x23a0('0x31')](_0x577c61)['then'](function(_0x14165b){return _0x14165b;});}return null;};}function removeEntity(_0x5fd175,_0x3518ae){return function(_0x21b931){if(_0x21b931){return _0x21b931[_0x23a0('0x32')]()[_0x23a0('0x1e')](function(){var _0xaa3733=_0x21b931[_0x23a0('0x33')]({'plain':!![]});var _0x51b021=_0x23a0('0x34');return db['UserProfileResource'][_0x23a0('0x32')]({'where':{'type':_0x51b021,'resourceId':_0xaa3733['id']}})[_0x23a0('0x1e')](function(){return _0x21b931;});})[_0x23a0('0x1e')](function(){_0x5fd175[_0x23a0('0x29')](0xcc)[_0x23a0('0x2a')]();});}};}function handleEntityNotFound(_0x5912ac,_0x5c7501){return function(_0x4fdc19){if(!_0x4fdc19){_0x5912ac['sendStatus'](0x194);}return _0x4fdc19;};}function handleError(_0x25ec4e,_0x4a7408){_0x4a7408=_0x4a7408||0x1f4;return function(_0xff91bf){logger[_0x23a0('0x23')](_0xff91bf[_0x23a0('0x35')]);if(_0xff91bf[_0x23a0('0x36')]){delete _0xff91bf[_0x23a0('0x36')];}_0x25ec4e['status'](_0x4a7408)[_0x23a0('0x37')](_0xff91bf);};}exports[_0x23a0('0x38')]=function(_0x173fab,_0x26a038){var _0x686944={},_0x1cbd09={},_0x3a6eed={'count':0x0,'rows':[]};var _0x494298=_[_0x23a0('0x39')](db[_0x23a0('0x3a')][_0x23a0('0x3b')],function(_0x305b4a){return{'name':_0x305b4a[_0x23a0('0x3c')],'type':_0x305b4a['type']['key']};});_0x1cbd09[_0x23a0('0x3d')]=_['map'](_0x494298,_0x23a0('0x36'));_0x1cbd09[_0x23a0('0x3e')]=_[_0x23a0('0x3f')](_0x173fab[_0x23a0('0x3e')]);_0x1cbd09[_0x23a0('0x40')]=_[_0x23a0('0x41')](_0x1cbd09[_0x23a0('0x3d')],_0x1cbd09['query']);_0x686944[_0x23a0('0x42')]=_[_0x23a0('0x41')](_0x1cbd09[_0x23a0('0x3d')],qs[_0x23a0('0x43')](_0x173fab[_0x23a0('0x3e')][_0x23a0('0x43')]));_0x686944['attributes']=_0x686944[_0x23a0('0x42')][_0x23a0('0x44')]?_0x686944[_0x23a0('0x42')]:_0x1cbd09[_0x23a0('0x3d')];if(!_0x173fab[_0x23a0('0x3e')][_0x23a0('0x45')]('nolimit')){_0x686944[_0x23a0('0x2d')]=qs[_0x23a0('0x2d')](_0x173fab[_0x23a0('0x3e')][_0x23a0('0x2d')]);_0x686944[_0x23a0('0x2c')]=qs[_0x23a0('0x2c')](_0x173fab[_0x23a0('0x3e')]['offset']);}_0x686944['order']=qs[_0x23a0('0x46')](_0x173fab['query'][_0x23a0('0x46')]);_0x686944[_0x23a0('0x47')]=qs[_0x23a0('0x40')](_[_0x23a0('0x48')](_0x173fab[_0x23a0('0x3e')],_0x1cbd09[_0x23a0('0x40')]));if(_0x173fab[_0x23a0('0x3e')][_0x23a0('0x49')]){_0x686944['where']=_[_0x23a0('0x4a')](_0x686944[_0x23a0('0x47')],{'$or':_[_0x23a0('0x39')](_0x494298,function(_0x359fbf){if(_0x359fbf[_0x23a0('0x4b')]!=='VIRTUAL'){var _0x38781e={};_0x38781e[_0x359fbf['name']]={'$like':'%'+_0x173fab[_0x23a0('0x3e')][_0x23a0('0x49')]+'%'};return _0x38781e;}})});}_0x686944=_[_0x23a0('0x4a')]({},_0x686944,_0x173fab['options']);var _0xd03cd6={'where':_0x686944[_0x23a0('0x47')]};return db[_0x23a0('0x3a')][_0x23a0('0x4c')](_0xd03cd6)['then'](function(_0x51901a){_0x3a6eed[_0x23a0('0x4c')]=_0x51901a;if(_0x173fab[_0x23a0('0x3e')][_0x23a0('0x4d')]){_0x686944[_0x23a0('0x4e')]=[{'all':!![]}];}return db[_0x23a0('0x3a')]['findAll'](_0x686944);})['then'](function(_0x49fad3){_0x3a6eed['rows']=_0x49fad3;return _0x3a6eed;})[_0x23a0('0x1e')](respondWithFilteredResult(_0x26a038,_0x686944))[_0x23a0('0x4f')](handleError(_0x26a038,null));};exports['show']=function(_0x121ca9,_0x229b83){var _0x261730={'raw':![],'where':{'id':_0x121ca9[_0x23a0('0x50')]['id']}},_0x6dc6d7={};_0x6dc6d7[_0x23a0('0x3d')]=_[_0x23a0('0x3f')](db[_0x23a0('0x3a')]['rawAttributes']);_0x6dc6d7['query']=_['keys'](_0x121ca9[_0x23a0('0x3e')]);_0x6dc6d7[_0x23a0('0x40')]=_[_0x23a0('0x41')](_0x6dc6d7[_0x23a0('0x3d')],_0x6dc6d7[_0x23a0('0x3e')]);_0x261730[_0x23a0('0x42')]=_[_0x23a0('0x41')](_0x6dc6d7[_0x23a0('0x3d')],qs[_0x23a0('0x43')](_0x121ca9[_0x23a0('0x3e')][_0x23a0('0x43')]));_0x261730[_0x23a0('0x42')]=_0x261730['attributes'][_0x23a0('0x44')]?_0x261730[_0x23a0('0x42')]:_0x6dc6d7[_0x23a0('0x3d')];if(_0x121ca9[_0x23a0('0x3e')][_0x23a0('0x4d')]){_0x261730[_0x23a0('0x4e')]=[{'all':!![]}];}_0x261730=_[_0x23a0('0x4a')]({},_0x261730,_0x121ca9['options']);return db[_0x23a0('0x3a')][_0x23a0('0x51')](_0x261730)[_0x23a0('0x1e')](handleEntityNotFound(_0x229b83,null))[_0x23a0('0x1e')](respondWithResult(_0x229b83,null))[_0x23a0('0x4f')](handleError(_0x229b83,null));};exports['clone']=function(_0x1a5722,_0x1e413c){var _0x5070a6={'where':{'id':_0x1a5722[_0x23a0('0x50')]['id']}},_0x4ca051={};_0x4ca051['model']=_[_0x23a0('0x3f')](db[_0x23a0('0x3a')][_0x23a0('0x3b')]);_0x5070a6[_0x23a0('0x42')]=_[_0x23a0('0x41')](_0x4ca051[_0x23a0('0x3d')],qs['fields'](_0x1a5722['query'][_0x23a0('0x43')]));_0x5070a6[_0x23a0('0x42')]=_0x5070a6['attributes'][_0x23a0('0x44')]?_0x5070a6[_0x23a0('0x42')]:_0x4ca051[_0x23a0('0x3d')];if(_0x1a5722[_0x23a0('0x3e')][_0x23a0('0x4d')]){_0x5070a6[_0x23a0('0x4e')]=[{'all':!![]}];}_0x5070a6=_[_0x23a0('0x4a')]({},_0x5070a6,_0x1a5722['options']);return db['Trunk']['find'](_0x5070a6)[_0x23a0('0x1e')](handleEntityNotFound(_0x1e413c,null))['then'](function(_0x39ad65){if(_0x39ad65){var _0x272d03=_0x39ad65[_0x23a0('0x33')]({'plain':!![]});_0x272d03=qs[_0x23a0('0x52')](_0x272d03,['id',_0x23a0('0x53'),'updatedAt']);_0x1a5722[_0x23a0('0x54')]=_[_0x23a0('0x52')](_0x1a5722[_0x23a0('0x54')],['id',_0x23a0('0x53'),_0x23a0('0x55')]);return db[_0x23a0('0x3a')][_0x23a0('0x56')](_[_0x23a0('0x4a')](_0x272d03,_0x1a5722[_0x23a0('0x54')]),{'include':_0x1a5722[_0x23a0('0x3e')][_0x23a0('0x4d')]?[{'all':!![]}]:undefined})['then'](function(_0x3fefa4){var _0x3424fa=_0x1a5722[_0x23a0('0x57')]['get']({'plain':!![]});if(!_0x3424fa)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3424fa[_0x23a0('0x58')]==='user'){var _0x48dc2d=_0x3fefa4[_0x23a0('0x33')]({'plain':!![]});var _0x3b6ef8='Trunks';return db[_0x23a0('0x59')]['find']({'where':{'name':_0x3b6ef8,'userProfileId':_0x3424fa[_0x23a0('0x5a')]},'raw':!![]})[_0x23a0('0x1e')](function(_0x100398){if(_0x100398&&_0x100398[_0x23a0('0x5b')]===0x0){return db[_0x23a0('0x5c')][_0x23a0('0x56')]({'name':_0x48dc2d['name'],'resourceId':_0x48dc2d['id'],'type':_0x100398[_0x23a0('0x36')],'sectionId':_0x100398['id']},{})[_0x23a0('0x1e')](function(){return _0x3fefa4;});}else{return _0x3fefa4;}})[_0x23a0('0x4f')](function(_0x39902a){logger[_0x23a0('0x23')](_0x23a0('0x5d'),_0x39902a);throw _0x39902a;});}return _0x3fefa4;});}})['then'](respondWithResult(_0x1e413c,0xc9))['catch'](handleError(_0x1e413c,null));};exports[_0x23a0('0x56')]=function(_0x46ab35,_0x474de6,_0x196b3d){var _0x1a2a72;return db[_0x23a0('0x3a')][_0x23a0('0x56')](_0x46ab35[_0x23a0('0x54')],{'raw':!![]})['then'](function(_0xb55c20){_0x1a2a72=_0xb55c20;return db[_0x23a0('0x3a')][_0x23a0('0x5e')]({'raw':!![]});})[_0x23a0('0x1e')](function(_0x2bdd63){var _0x2550b2=fs['readFileSync'](path['join'](config[_0x23a0('0x5f')],_0x23a0('0x60')),_0x23a0('0x61'));var _0x4fdb53=fs[_0x23a0('0x62')](path['join'](config[_0x23a0('0x5f')],_0x23a0('0x63')),_0x23a0('0x61'));var _0x161f8c=ejs[_0x23a0('0x64')](_0x2550b2,{'trunks':_0x2bdd63||[]});fs[_0x23a0('0x65')](_0x23a0('0x66'),_0x161f8c);if(_0x1a2a72['registry']){var _0x44401b=ejs[_0x23a0('0x64')](_0x4fdb53,{'trunks':_0x2bdd63||[]});fs[_0x23a0('0x65')](_0x23a0('0x67'),_0x44401b);}})[_0x23a0('0x1e')](function(){return respondWithRpcPromise(_0x23a0('0x68'),_0x23a0('0x56'),{'module':_0x23a0('0x69')});})[_0x23a0('0x1e')](function(){var _0x1177cf=_0x46ab35[_0x23a0('0x57')][_0x23a0('0x33')]({'plain':!![]});if(!_0x1177cf)throw new Error(_0x23a0('0x6a'));if(_0x1177cf[_0x23a0('0x58')]===_0x23a0('0x57')){var _0x399951=_0x1a2a72[_0x23a0('0x33')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':'Trunks','userProfileId':_0x1177cf['userProfileId']},'raw':!![]})['then'](function(_0x59b6d1){if(_0x59b6d1&&_0x59b6d1['autoAssociation']===0x0){return db['UserProfileResource'][_0x23a0('0x56')]({'name':_0x399951['name'],'resourceId':_0x399951['id'],'type':_0x59b6d1[_0x23a0('0x36')],'sectionId':_0x59b6d1['id']},{})[_0x23a0('0x1e')](function(){return _0x1a2a72;});}else{return _0x1a2a72;}})[_0x23a0('0x4f')](function(_0x1542cf){logger[_0x23a0('0x23')](_0x23a0('0x5d'),_0x1542cf);throw _0x1542cf;});}return _0x1a2a72;})[_0x23a0('0x1e')](respondWithResult(_0x474de6,0xc9))['catch'](handleError(_0x474de6,null));};exports[_0x23a0('0x31')]=function(_0x53c75f,_0x2c3898,_0x577e82){var _0x1aab81;return db[_0x23a0('0x3a')][_0x23a0('0x51')]({'where':{'id':_0x53c75f['params']['id']}})['then'](handleEntityNotFound(_0x2c3898,null))['then'](saveUpdates(_0x53c75f[_0x23a0('0x54')],null))[_0x23a0('0x1e')](function(_0x16055a){if(_0x16055a){_0x1aab81=_0x16055a;return db[_0x23a0('0x3a')][_0x23a0('0x5e')]({'raw':!![]});}})[_0x23a0('0x1e')](function(_0x553c3c){if(_0x553c3c){var _0x38806e=fs['readFileSync'](path[_0x23a0('0x6b')](config['root'],'server/files/templates/trunk.ejs'),'utf8');var _0x410c7f=fs[_0x23a0('0x62')](path[_0x23a0('0x6b')](config[_0x23a0('0x5f')],_0x23a0('0x63')),_0x23a0('0x61'));var _0x462b15=ejs[_0x23a0('0x64')](_0x38806e,{'trunks':_0x553c3c||[]});fs['writeFileSync'](_0x23a0('0x66'),_0x462b15);var _0x51613c=ejs[_0x23a0('0x64')](_0x410c7f,{'trunks':_0x553c3c||[]});fs[_0x23a0('0x65')](_0x23a0('0x67'),_0x51613c);return respondWithRpcPromise(_0x23a0('0x68'),'update',{'module':_0x23a0('0x69')});}return null;})[_0x23a0('0x1e')](function(_0x30f5f9){if(_0x30f5f9){return _0x1aab81;}})['then'](respondWithResult(_0x2c3898,null))['catch'](handleError(_0x2c3898,null));};exports[_0x23a0('0x32')]=function(_0x392c79,_0x1ef6f4,_0x5231e6){var _0x5a3a1d;return db[_0x23a0('0x3a')][_0x23a0('0x51')]({'where':{'id':_0x392c79[_0x23a0('0x50')]['id']}})[_0x23a0('0x1e')](handleEntityNotFound(_0x1ef6f4,null))[_0x23a0('0x1e')](removeEntity(_0x1ef6f4,null))[_0x23a0('0x1e')](function(){return db[_0x23a0('0x3a')][_0x23a0('0x5e')]({'raw':!![]});})[_0x23a0('0x1e')](function(_0x121ae0){var _0x5f2dbe=fs[_0x23a0('0x62')](path[_0x23a0('0x6b')](config['root'],_0x23a0('0x60')),_0x23a0('0x61'));var _0x4507df=fs[_0x23a0('0x62')](path[_0x23a0('0x6b')](config['root'],_0x23a0('0x63')),_0x23a0('0x61'));var _0x5b5818=ejs[_0x23a0('0x64')](_0x5f2dbe,{'trunks':_0x121ae0});var _0x2aaed0=ejs[_0x23a0('0x64')](_0x4507df,{'trunks':_0x121ae0});fs[_0x23a0('0x65')](_0x23a0('0x66'),_0x5b5818);fs[_0x23a0('0x65')](_0x23a0('0x67'),_0x2aaed0);return respondWithRpcPromise(_0x23a0('0x68'),'destroy',{'module':_0x23a0('0x69')});})['catch'](handleError(_0x1ef6f4,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 1dea456..a54be0c 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 _0x1996=['tools_trunks','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./trunk.attributes','exports','define','Trunk'];(function(_0x3d8b22,_0x28e0f6){var _0x177f4b=function(_0x13629f){while(--_0x13629f){_0x3d8b22['push'](_0x3d8b22['shift']());}};_0x177f4b(++_0x28e0f6);}(_0x1996,0x119));var _0x6199=function(_0x1c56fc,_0x706580){_0x1c56fc=_0x1c56fc-0x0;var _0x3e7f43=_0x1996[_0x1c56fc];return _0x3e7f43;};'use strict';var _=require(_0x6199('0x0'));var util=require('util');var logger=require(_0x6199('0x1'))(_0x6199('0x2'));var moment=require(_0x6199('0x3'));var BPromise=require(_0x6199('0x4'));var rp=require(_0x6199('0x5'));var fs=require('fs');var path=require(_0x6199('0x6'));var rimraf=require(_0x6199('0x7'));var config=require(_0x6199('0x8'));var attributes=require(_0x6199('0x9'));module[_0x6199('0xa')]=function(_0x5262ca,_0x240610){return _0x5262ca[_0x6199('0xb')](_0x6199('0xc'),attributes,{'tableName':_0x6199('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x766e=['exports','tools_trunks','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./trunk.attributes'];(function(_0x43b478,_0x2beb2e){var _0x31033=function(_0xb24e3c){while(--_0xb24e3c){_0x43b478['push'](_0x43b478['shift']());}};_0x31033(++_0x2beb2e);}(_0x766e,0x146));var _0xe766=function(_0x4dbeaa,_0x3fb85d){_0x4dbeaa=_0x4dbeaa-0x0;var _0x889e79=_0x766e[_0x4dbeaa];return _0x889e79;};'use strict';var _=require(_0xe766('0x0'));var util=require(_0xe766('0x1'));var logger=require(_0xe766('0x2'))(_0xe766('0x3'));var moment=require(_0xe766('0x4'));var BPromise=require('bluebird');var rp=require(_0xe766('0x5'));var fs=require('fs');var path=require(_0xe766('0x6'));var rimraf=require(_0xe766('0x7'));var config=require(_0xe766('0x8'));var attributes=require(_0xe766('0x9'));module[_0xe766('0xa')]=function(_0x29243d,_0x26b9b3){return _0x29243d['define']('Trunk',attributes,{'tableName':_0xe766('0xb'),'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 5d7dfda..7b930bb 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 _0x5f66=['debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info','catch','GetTrunk','findAll','options','attributes','limit','include','model','map','ShowTrunk','Trunk','raw','where','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','Trunk,\x20%s,\x20%s','request\x20sent'];(function(_0x2e0724,_0x4a3aa5){var _0x46bf1c=function(_0x19e2d4){while(--_0x19e2d4){_0x2e0724['push'](_0x2e0724['shift']());}};_0x46bf1c(++_0x4a3aa5);}(_0x5f66,0x1a0));var _0x65f6=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x5f66[_0x5d4607];return _0x5e4a86;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ed98f,_0x1c0e12,_0x2c6571){return new BPromise(function(_0x112079,_0x8f6451){return client[_0x65f6('0x9')](_0x4ed98f,_0x2c6571)[_0x65f6('0xa')](function(_0x48d85c){logger['info'](_0x65f6('0xb'),_0x1c0e12,_0x65f6('0xc'));logger[_0x65f6('0xd')](_0x65f6('0xe'),_0x1c0e12,'request\x20sent',JSON[_0x65f6('0xf')](_0x48d85c));if(_0x48d85c['error']){if(_0x48d85c['error'][_0x65f6('0x10')]===0x1f4){logger['error'](_0x65f6('0xb'),_0x1c0e12,_0x48d85c['error'][_0x65f6('0x11')]);return _0x8f6451(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);return _0x112079(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}else{logger[_0x65f6('0x13')]('Trunk,\x20%s,\x20%s',_0x1c0e12,_0x65f6('0xc'));_0x112079(_0x48d85c['result']['message']);}})[_0x65f6('0x14')](function(_0x5c69f8){logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x5c69f8);_0x8f6451(_0x5c69f8);});});}exports[_0x65f6('0x15')]=function(_0x1f974c){var _0xc8660c=this;return new Promise(function(_0x18380e,_0x495dd6){return db['Trunk'][_0x65f6('0x16')]({'raw':_0x1f974c['options']?_0x1f974c['options']['raw']===undefined?!![]:![]:!![],'where':_0x1f974c[_0x65f6('0x17')]?_0x1f974c[_0x65f6('0x17')]['where']||null:null,'attributes':_0x1f974c[_0x65f6('0x17')]?_0x1f974c[_0x65f6('0x17')][_0x65f6('0x18')]||null:null,'limit':_0x1f974c[_0x65f6('0x17')]?_0x1f974c[_0x65f6('0x17')][_0x65f6('0x19')]||null:null,'include':_0x1f974c['options']?_0x1f974c[_0x65f6('0x17')]['include']?_['map'](_0x1f974c[_0x65f6('0x17')][_0x65f6('0x1a')],function(_0x524e42){return{'model':db[_0x524e42[_0x65f6('0x1b')]],'as':_0x524e42['as'],'attributes':_0x524e42[_0x65f6('0x18')],'include':_0x524e42[_0x65f6('0x1a')]?_[_0x65f6('0x1c')](_0x524e42['include'],function(_0x9d7bb0){return{'model':db[_0x9d7bb0[_0x65f6('0x1b')]],'as':_0x9d7bb0['as'],'attributes':_0x9d7bb0[_0x65f6('0x18')],'include':_0x9d7bb0['include']?_['map'](_0x9d7bb0['include'],function(_0x29abdb){return{'model':db[_0x29abdb[_0x65f6('0x1b')]],'as':_0x29abdb['as'],'attributes':_0x29abdb['attributes']};}):[]};}):[]};}):[]:[]})[_0x65f6('0xa')](function(_0x28f710){logger['info'](_0x65f6('0x15'),_0x1f974c);logger[_0x65f6('0xd')](_0x65f6('0x15'),_0x1f974c,JSON['stringify'](_0x28f710));_0x18380e(_0x28f710);})['catch'](function(_0x488d36){logger[_0x65f6('0x12')](_0x65f6('0x15'),_0x488d36[_0x65f6('0x11')],_0x1f974c);_0x495dd6(_0xc8660c[_0x65f6('0x12')](0x1f4,_0x488d36[_0x65f6('0x11')]));});});};exports[_0x65f6('0x1d')]=function(_0x144e55){var _0x4ace4c=this;return new Promise(function(_0x4ea23d,_0x154cbd){return db[_0x65f6('0x1e')]['find']({'raw':_0x144e55['options']?_0x144e55[_0x65f6('0x17')][_0x65f6('0x1f')]===undefined?!![]:![]:!![],'where':_0x144e55[_0x65f6('0x17')]?_0x144e55[_0x65f6('0x17')][_0x65f6('0x20')]||null:null,'attributes':_0x144e55[_0x65f6('0x17')]?_0x144e55['options'][_0x65f6('0x18')]||null:null,'include':_0x144e55[_0x65f6('0x17')]?_0x144e55[_0x65f6('0x17')]['include']?_[_0x65f6('0x1c')](_0x144e55[_0x65f6('0x17')][_0x65f6('0x1a')],function(_0x45510a){return{'model':db[_0x45510a[_0x65f6('0x1b')]],'as':_0x45510a['as'],'attributes':_0x45510a[_0x65f6('0x18')],'include':_0x45510a['include']?_[_0x65f6('0x1c')](_0x45510a[_0x65f6('0x1a')],function(_0x4f3e22){return{'model':db[_0x4f3e22[_0x65f6('0x1b')]],'as':_0x4f3e22['as'],'attributes':_0x4f3e22['attributes'],'include':_0x4f3e22[_0x65f6('0x1a')]?_['map'](_0x4f3e22[_0x65f6('0x1a')],function(_0x24f7fd){return{'model':db[_0x24f7fd['model']],'as':_0x24f7fd['as'],'attributes':_0x24f7fd[_0x65f6('0x18')]};}):[]};}):[]};}):[]:[]})[_0x65f6('0xa')](function(_0x3b261d){logger['info']('ShowTrunk',_0x144e55);logger[_0x65f6('0xd')]('ShowTrunk',_0x144e55,JSON[_0x65f6('0xf')](_0x3b261d));_0x4ea23d(_0x3b261d);})['catch'](function(_0x22d760){logger[_0x65f6('0x12')]('ShowTrunk',_0x22d760[_0x65f6('0x11')],_0x144e55);_0x154cbd(_0x4ace4c['error'](0x1f4,_0x22d760['message']));});});}; \ No newline at end of file +var _0xbaf0=['Trunk,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetTrunk','Trunk','findAll','options','where','attributes','limit','include','model','map','ShowTrunk','find','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xd46333,_0x1b05c1){var _0x336108=function(_0x4a39ad){while(--_0x4a39ad){_0xd46333['push'](_0xd46333['shift']());}};_0x336108(++_0x1b05c1);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xbaf0[_0x2b4411];return _0x8e41ef;};'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')]('Trunk,\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')]('GetTrunk',_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')]('ShowTrunk',_0x11bc49['message'],_0xd14f0f);_0x57476f(_0x366924[_0x0baf('0x13')](0x1f4,_0x11bc49[_0x0baf('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 9f89cad..d726958 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 _0x2ef3=['getAvatar','/:id/contacts','getContacts','/:id/queues','getQueues','getVoiceQueuesRt','/:id/groups','getGroups','/:id/screen_recordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','/:id/teams','/:id/lists','getLists','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','getChatWebsites','/:id/square_projects','getSquareProjects','/:id/api_key','getApiKey','post','/create_many','bulkCreate','create','join','now','originalname','single','file','addAvatar','/:id/login','login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','unpause','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','/:id/fax_interactions','addFaxInteractions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','addFaxAccounts','addMailAccounts','/:id/chat_websites','addChatWebsites','createApiKey','put','update','/:id/password','changePassword','delete','removeQueues','removeTeams','destroy','removeChatInteractions','removeMailInteractions','removeFaxInteractions','/:id/sms_interactions','removeSmsInteractions','removeOpenchannelInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeChatWebsites','removeSquareProjects','removeApiKey','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/whoami','whoami','/:id','/:id/avatar'];(function(_0x33fa74,_0x5b5235){var _0x287610=function(_0x520df9){while(--_0x520df9){_0x33fa74['push'](_0x33fa74['shift']());}};_0x287610(++_0x5b5235);}(_0x2ef3,0xba));var _0x32ef=function(_0x1fd256,_0x359abb){_0x1fd256=_0x1fd256-0x0;var _0x3a28c1=_0x2ef3[_0x1fd256];return _0x3a28c1;};'use strict';var multer=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var path=require(_0x32ef('0x2'));var timeout=require(_0x32ef('0x3'));var express=require(_0x32ef('0x4'));var router=express[_0x32ef('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x32ef('0x6'));var config=require(_0x32ef('0x7'));var controller=require('./user.controller');router[_0x32ef('0x8')]('/',auth[_0x32ef('0x9')](),controller['index']);router['get'](_0x32ef('0xa'),auth[_0x32ef('0x9')](),controller[_0x32ef('0xb')]);router[_0x32ef('0x8')](_0x32ef('0xc'),auth[_0x32ef('0x9')](),controller[_0x32ef('0xd')]);router[_0x32ef('0x8')](_0x32ef('0xe'),auth[_0x32ef('0x9')](),controller['show']);router['get'](_0x32ef('0xf'),controller[_0x32ef('0x10')]);router[_0x32ef('0x8')](_0x32ef('0x11'),auth['isAuthenticated'](),controller[_0x32ef('0x12')]);router['get'](_0x32ef('0x13'),auth['isAuthenticated'](),controller[_0x32ef('0x14')]);router[_0x32ef('0x8')]('/:id/queues_rt',auth['isAuthenticated'](),controller[_0x32ef('0x15')]);router['get'](_0x32ef('0x16'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x17')]);router[_0x32ef('0x8')]('/:id/recordings',auth['isAuthenticated'](),controller['getRecordings']);router[_0x32ef('0x8')](_0x32ef('0x18'),auth[_0x32ef('0x9')](),controller['getScreenRecordings']);router['get'](_0x32ef('0x19'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x1a')]);router['get'](_0x32ef('0x1b'),auth[_0x32ef('0x9')](),controller['getOpenchannelInteractions']);router[_0x32ef('0x8')](_0x32ef('0x1c'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x1d')]);router[_0x32ef('0x8')](_0x32ef('0x1e'),auth['isAuthenticated'](),controller[_0x32ef('0x1f')]);router['get'](_0x32ef('0x20'),auth[_0x32ef('0x9')](),controller['getFaxInteractions']);router[_0x32ef('0x8')](_0x32ef('0x21'),auth[_0x32ef('0x9')](),controller['getTeams']);router['get'](_0x32ef('0x22'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x23')]);router['get']('/:id/agents',auth[_0x32ef('0x9')](),controller['getAgents']);router['get'](_0x32ef('0x24'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x25')]);router[_0x32ef('0x8')](_0x32ef('0x26'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x27')]);router[_0x32ef('0x8')](_0x32ef('0x28'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x29')]);router[_0x32ef('0x8')]('/:id/openchannel_accounts',auth[_0x32ef('0x9')](),controller[_0x32ef('0x2a')]);router['get'](_0x32ef('0x2b'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x2c')]);router[_0x32ef('0x8')]('/:id/chat_websites',auth[_0x32ef('0x9')](),controller[_0x32ef('0x2d')]);router[_0x32ef('0x8')](_0x32ef('0x2e'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x2f')]);router[_0x32ef('0x8')]('/:id/scheduled_calls',auth[_0x32ef('0x9')](),controller['getScheduledCalls']);router[_0x32ef('0x8')](_0x32ef('0x30'),auth['isAuthenticated'](),controller[_0x32ef('0x31')]);router[_0x32ef('0x32')](_0x32ef('0x33'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x34')]);router['post']('/:id/contacts',auth[_0x32ef('0x9')](),controller['addContacts']);router[_0x32ef('0x32')]('/',auth[_0x32ef('0x9')](),controller[_0x32ef('0x35')]);router[_0x32ef('0x32')](_0x32ef('0x13'),auth[_0x32ef('0x9')](),controller['addQueues']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x484ad7,_0x2261a6,_0x3c4651){_0x3c4651(null,path[_0x32ef('0x36')](config['root'],'server/files/images/'));},'filename':function(_0x1c3633,_0x2bd8a9,_0x410334){_0x410334(null,util['format']('%s-%s',Date[_0x32ef('0x37')](),_0x2bd8a9[_0x32ef('0x38')]));}})});router[_0x32ef('0x32')](_0x32ef('0xf'),upload[_0x32ef('0x39')](_0x32ef('0x3a')),controller[_0x32ef('0x3b')]);router[_0x32ef('0x32')](_0x32ef('0x3c'),auth['isAuthenticated'](),controller[_0x32ef('0x3d')]);router[_0x32ef('0x32')](_0x32ef('0x3e'),auth['isAuthenticated'](),controller[_0x32ef('0x3f')]);router[_0x32ef('0x32')](_0x32ef('0x40'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x41')]);router[_0x32ef('0x32')](_0x32ef('0x42'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x43')]);router[_0x32ef('0x32')](_0x32ef('0x21'),auth[_0x32ef('0x9')](),controller['addTeams']);router[_0x32ef('0x32')](_0x32ef('0x44'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x45')]);router[_0x32ef('0x32')](_0x32ef('0x46'),auth[_0x32ef('0x9')](),controller['addMailInteractions']);router['post'](_0x32ef('0x47'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x48')]);router[_0x32ef('0x32')]('/:id/sms_interactions',auth[_0x32ef('0x9')](),controller[_0x32ef('0x49')]);router['post'](_0x32ef('0x4a'),auth['isAuthenticated'](),controller[_0x32ef('0x4b')]);router[_0x32ef('0x32')](_0x32ef('0x26'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x4c')]);router[_0x32ef('0x32')](_0x32ef('0x28'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x4d')]);router[_0x32ef('0x32')]('/:id/openchannel_accounts',auth[_0x32ef('0x9')](),controller['addOpenchannelAccounts']);router[_0x32ef('0x32')](_0x32ef('0x2b'),auth[_0x32ef('0x9')](),controller['addSmsAccounts']);router[_0x32ef('0x32')](_0x32ef('0x4e'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x4f')]);router[_0x32ef('0x32')](_0x32ef('0x2e'),auth[_0x32ef('0x9')](),controller['addSquareProjects']);router['post'](_0x32ef('0x30'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x50')]);router[_0x32ef('0x51')](_0x32ef('0xe'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x52')]);router[_0x32ef('0x51')](_0x32ef('0x53'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x54')]);router[_0x32ef('0x55')](_0x32ef('0x13'),auth['isAuthenticated'](),controller[_0x32ef('0x56')]);router[_0x32ef('0x55')](_0x32ef('0x21'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x57')]);router[_0x32ef('0x55')](_0x32ef('0xe'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x58')]);router[_0x32ef('0x55')](_0x32ef('0x44'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x59')]);router[_0x32ef('0x55')](_0x32ef('0x46'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x5a')]);router[_0x32ef('0x55')]('/:id/fax_interactions',auth['isAuthenticated'](),controller[_0x32ef('0x5b')]);router[_0x32ef('0x55')](_0x32ef('0x5c'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x5d')]);router[_0x32ef('0x55')](_0x32ef('0x4a'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x5e')]);router[_0x32ef('0x55')](_0x32ef('0x26'),auth['isAuthenticated'](),controller[_0x32ef('0x5f')]);router[_0x32ef('0x55')](_0x32ef('0x28'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x60')]);router[_0x32ef('0x55')]('/:id/openchannel_accounts',auth[_0x32ef('0x9')](),controller[_0x32ef('0x61')]);router[_0x32ef('0x55')]('/:id/sms_accounts',auth[_0x32ef('0x9')](),controller['removeSmsAccounts']);router[_0x32ef('0x55')](_0x32ef('0x4e'),auth['isAuthenticated'](),controller[_0x32ef('0x62')]);router['delete'](_0x32ef('0x2e'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x63')]);router[_0x32ef('0x55')](_0x32ef('0x30'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x64')]);module['exports']=router; \ No newline at end of file +var _0x2ef3=['getAvatar','/:id/contacts','getContacts','/:id/queues','getQueues','getVoiceQueuesRt','/:id/groups','getGroups','/:id/screen_recordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','/:id/teams','/:id/lists','getLists','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','getChatWebsites','/:id/square_projects','getSquareProjects','/:id/api_key','getApiKey','post','/create_many','bulkCreate','create','join','now','originalname','single','file','addAvatar','/:id/login','login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','unpause','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','/:id/fax_interactions','addFaxInteractions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','addFaxAccounts','addMailAccounts','/:id/chat_websites','addChatWebsites','createApiKey','put','update','/:id/password','changePassword','delete','removeQueues','removeTeams','destroy','removeChatInteractions','removeMailInteractions','removeFaxInteractions','/:id/sms_interactions','removeSmsInteractions','removeOpenchannelInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeChatWebsites','removeSquareProjects','removeApiKey','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/whoami','whoami','/:id','/:id/avatar'];(function(_0x3a9d32,_0x32fe6e){var _0x2d189f=function(_0x47d075){while(--_0x47d075){_0x3a9d32['push'](_0x3a9d32['shift']());}};_0x2d189f(++_0x32fe6e);}(_0x2ef3,0xba));var _0x32ef=function(_0x4fc368,_0x223f34){_0x4fc368=_0x4fc368-0x0;var _0x27a118=_0x2ef3[_0x4fc368];return _0x27a118;};'use strict';var multer=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var path=require(_0x32ef('0x2'));var timeout=require(_0x32ef('0x3'));var express=require(_0x32ef('0x4'));var router=express[_0x32ef('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x32ef('0x6'));var config=require(_0x32ef('0x7'));var controller=require('./user.controller');router[_0x32ef('0x8')]('/',auth[_0x32ef('0x9')](),controller['index']);router['get'](_0x32ef('0xa'),auth[_0x32ef('0x9')](),controller[_0x32ef('0xb')]);router[_0x32ef('0x8')](_0x32ef('0xc'),auth[_0x32ef('0x9')](),controller[_0x32ef('0xd')]);router[_0x32ef('0x8')](_0x32ef('0xe'),auth[_0x32ef('0x9')](),controller['show']);router['get'](_0x32ef('0xf'),controller[_0x32ef('0x10')]);router[_0x32ef('0x8')](_0x32ef('0x11'),auth['isAuthenticated'](),controller[_0x32ef('0x12')]);router['get'](_0x32ef('0x13'),auth['isAuthenticated'](),controller[_0x32ef('0x14')]);router[_0x32ef('0x8')]('/:id/queues_rt',auth['isAuthenticated'](),controller[_0x32ef('0x15')]);router['get'](_0x32ef('0x16'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x17')]);router[_0x32ef('0x8')]('/:id/recordings',auth['isAuthenticated'](),controller['getRecordings']);router[_0x32ef('0x8')](_0x32ef('0x18'),auth[_0x32ef('0x9')](),controller['getScreenRecordings']);router['get'](_0x32ef('0x19'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x1a')]);router['get'](_0x32ef('0x1b'),auth[_0x32ef('0x9')](),controller['getOpenchannelInteractions']);router[_0x32ef('0x8')](_0x32ef('0x1c'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x1d')]);router[_0x32ef('0x8')](_0x32ef('0x1e'),auth['isAuthenticated'](),controller[_0x32ef('0x1f')]);router['get'](_0x32ef('0x20'),auth[_0x32ef('0x9')](),controller['getFaxInteractions']);router[_0x32ef('0x8')](_0x32ef('0x21'),auth[_0x32ef('0x9')](),controller['getTeams']);router['get'](_0x32ef('0x22'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x23')]);router['get']('/:id/agents',auth[_0x32ef('0x9')](),controller['getAgents']);router['get'](_0x32ef('0x24'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x25')]);router[_0x32ef('0x8')](_0x32ef('0x26'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x27')]);router[_0x32ef('0x8')](_0x32ef('0x28'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x29')]);router[_0x32ef('0x8')]('/:id/openchannel_accounts',auth[_0x32ef('0x9')](),controller[_0x32ef('0x2a')]);router['get'](_0x32ef('0x2b'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x2c')]);router[_0x32ef('0x8')]('/:id/chat_websites',auth[_0x32ef('0x9')](),controller[_0x32ef('0x2d')]);router[_0x32ef('0x8')](_0x32ef('0x2e'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x2f')]);router[_0x32ef('0x8')]('/:id/scheduled_calls',auth[_0x32ef('0x9')](),controller['getScheduledCalls']);router[_0x32ef('0x8')](_0x32ef('0x30'),auth['isAuthenticated'](),controller[_0x32ef('0x31')]);router[_0x32ef('0x32')](_0x32ef('0x33'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x34')]);router['post']('/:id/contacts',auth[_0x32ef('0x9')](),controller['addContacts']);router[_0x32ef('0x32')]('/',auth[_0x32ef('0x9')](),controller[_0x32ef('0x35')]);router[_0x32ef('0x32')](_0x32ef('0x13'),auth[_0x32ef('0x9')](),controller['addQueues']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x484ad7,_0x2261a6,_0x3c4651){_0x3c4651(null,path[_0x32ef('0x36')](config['root'],'server/files/images/'));},'filename':function(_0x1c3633,_0x2bd8a9,_0x410334){_0x410334(null,util['format']('%s-%s',Date[_0x32ef('0x37')](),_0x2bd8a9[_0x32ef('0x38')]));}})});router[_0x32ef('0x32')](_0x32ef('0xf'),upload[_0x32ef('0x39')](_0x32ef('0x3a')),controller[_0x32ef('0x3b')]);router[_0x32ef('0x32')](_0x32ef('0x3c'),auth['isAuthenticated'](),controller[_0x32ef('0x3d')]);router[_0x32ef('0x32')](_0x32ef('0x3e'),auth['isAuthenticated'](),controller[_0x32ef('0x3f')]);router[_0x32ef('0x32')](_0x32ef('0x40'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x41')]);router[_0x32ef('0x32')](_0x32ef('0x42'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x43')]);router[_0x32ef('0x32')](_0x32ef('0x21'),auth[_0x32ef('0x9')](),controller['addTeams']);router[_0x32ef('0x32')](_0x32ef('0x44'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x45')]);router[_0x32ef('0x32')](_0x32ef('0x46'),auth[_0x32ef('0x9')](),controller['addMailInteractions']);router['post'](_0x32ef('0x47'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x48')]);router[_0x32ef('0x32')]('/:id/sms_interactions',auth[_0x32ef('0x9')](),controller[_0x32ef('0x49')]);router['post'](_0x32ef('0x4a'),auth['isAuthenticated'](),controller[_0x32ef('0x4b')]);router[_0x32ef('0x32')](_0x32ef('0x26'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x4c')]);router[_0x32ef('0x32')](_0x32ef('0x28'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x4d')]);router[_0x32ef('0x32')]('/:id/openchannel_accounts',auth[_0x32ef('0x9')](),controller['addOpenchannelAccounts']);router[_0x32ef('0x32')](_0x32ef('0x2b'),auth[_0x32ef('0x9')](),controller['addSmsAccounts']);router[_0x32ef('0x32')](_0x32ef('0x4e'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x4f')]);router[_0x32ef('0x32')](_0x32ef('0x2e'),auth[_0x32ef('0x9')](),controller['addSquareProjects']);router['post'](_0x32ef('0x30'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x50')]);router[_0x32ef('0x51')](_0x32ef('0xe'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x52')]);router[_0x32ef('0x51')](_0x32ef('0x53'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x54')]);router[_0x32ef('0x55')](_0x32ef('0x13'),auth['isAuthenticated'](),controller[_0x32ef('0x56')]);router[_0x32ef('0x55')](_0x32ef('0x21'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x57')]);router[_0x32ef('0x55')](_0x32ef('0xe'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x58')]);router[_0x32ef('0x55')](_0x32ef('0x44'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x59')]);router[_0x32ef('0x55')](_0x32ef('0x46'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x5a')]);router[_0x32ef('0x55')]('/:id/fax_interactions',auth['isAuthenticated'](),controller[_0x32ef('0x5b')]);router[_0x32ef('0x55')](_0x32ef('0x5c'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x5d')]);router[_0x32ef('0x55')](_0x32ef('0x4a'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x5e')]);router[_0x32ef('0x55')](_0x32ef('0x26'),auth['isAuthenticated'](),controller[_0x32ef('0x5f')]);router[_0x32ef('0x55')](_0x32ef('0x28'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x60')]);router[_0x32ef('0x55')]('/:id/openchannel_accounts',auth[_0x32ef('0x9')](),controller[_0x32ef('0x61')]);router[_0x32ef('0x55')]('/:id/sms_accounts',auth[_0x32ef('0x9')](),controller['removeSmsAccounts']);router[_0x32ef('0x55')](_0x32ef('0x4e'),auth['isAuthenticated'](),controller[_0x32ef('0x62')]);router['delete'](_0x32ef('0x2e'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x63')]);router[_0x32ef('0x55')](_0x32ef('0x30'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x64')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 139cf3e..8f32408 100644 --- a/server/api/user/user.attributes.js +++ b/server/api/user/user.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','fingerprint','certificate','passive','update,nonat','showWebBar','get','wss','force_avp','dtlsenable','dtlsverify','dtlssetup','dtlsprivatekey','rtcp_mux','encryption','icesupport','actpass','dtlscertfile','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','sequelize','moment','util','STRING','setDataValue','name','defaultuser','callerid','getDataValue','internal','email','admin','user','agent','telephone','INTEGER','format','fullname','BOOLEAN','DATE','DEFAULT\x20PAUSE','ENUM','peer','friend','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','join','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','update','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','ulaw;alaw;gsm','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never'];(function(_0x18b73b,_0x1ee017){var _0x7b279a=function(_0x108d65){while(--_0x108d65){_0x18b73b['push'](_0x18b73b['shift']());}};_0x7b279a(++_0x1ee017);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x333808){this[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x333808);this[_0x0a9e('0x4')](_0x0a9e('0x6'),_0x333808);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'set':function(_0x441e3a){this[_0x0a9e('0x4')]('fullname',_0x441e3a);this['setDataValue'](_0x0a9e('0x7'),util['format']('\x22%s\x22\x20<%s>',_0x441e3a,this[_0x0a9e('0x8')](_0x0a9e('0x9'))));}},'alias':{'type':Sequelize[_0x0a9e('0x3')]},'email':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'unique':_0x0a9e('0xa'),'validate':{'isEmail':!![]},'set':function(_0xbd1168){if(_0xbd1168){this['setDataValue']('email',_0xbd1168['toLowerCase']());}}},'role':{'type':Sequelize['ENUM'](_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe')),'allowNull':![]},'password':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'local'},'internal':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':![],'unique':_0x0a9e('0x9'),'set':function(_0x2b4227){this[_0x0a9e('0x4')](_0x0a9e('0x9'),_0x2b4227);this[_0x0a9e('0x4')]('accountcode',_0x2b4227);this[_0x0a9e('0x4')]('callerid',util[_0x0a9e('0x10')]('\x22%s\x22\x20<%s>',this[_0x0a9e('0x8')](_0x0a9e('0x11')),_0x2b4227));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x0a9e('0x3')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0x0a9e('0x3')]},'zipcode':{'type':Sequelize[_0x0a9e('0x3')]},'userpic':{'type':Sequelize[_0x0a9e('0x3')]},'city':{'type':Sequelize[_0x0a9e('0x3')]},'country':{'type':Sequelize[_0x0a9e('0x3')]},'online':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x0a9e('0x13')]},'voicePause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':_0x0a9e('0x14')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x0a9e('0xf')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'description':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0x0a9e('0xf')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x0a9e('0x15')]('friend',_0x0a9e('0xc'),_0x0a9e('0x16')),'allowNull':!![],'defaultValue':_0x0a9e('0x17')},'context':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x18')},'callingpres':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x19'),_0x0a9e('0x1a'),'ALLOWED_FAILED_SCREEN',_0x0a9e('0x1b'),_0x0a9e('0x1c'),_0x0a9e('0x1d'),_0x0a9e('0x1e'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'permit':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'transport':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x1f'),'set':function(_0x2e8759){this[_0x0a9e('0x4')]('transport',_0x2e8759?_0x2e8759[_0x0a9e('0x20')](','):null);},'get':function(){return this['getDataValue'](_0x0a9e('0x21'))?this[_0x0a9e('0x8')](_0x0a9e('0x21'))[_0x0a9e('0x22')](','):null;},'comment':_0x0a9e('0x23')},'dtmfmode':{'type':Sequelize['ENUM'](_0x0a9e('0x24'),_0x0a9e('0x25'),_0x0a9e('0x26'),_0x0a9e('0x27'),_0x0a9e('0x28')),'allowNull':!![],'defaultValue':_0x0a9e('0x24')},'directmedia':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no','nonat',_0x0a9e('0x2a'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x0a9e('0x2b'),'set':function(_0xd1836d){this[_0x0a9e('0x4')](_0x0a9e('0x2c'),_0xd1836d?_0xd1836d['join'](','):null);},'get':function(){return this['getDataValue'](_0x0a9e('0x2c'))?this['getDataValue'](_0x0a9e('0x2c'))[_0x0a9e('0x22')](','):null;},'comment':_0x0a9e('0x2d')},'callgroup':{'type':Sequelize[_0x0a9e('0x3')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x0a9e('0x3')]},'namedpickupgroup':{'type':Sequelize[_0x0a9e('0x3')]},'language':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'defaultValue':_0x0a9e('0x2e')},'allow':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x546ef8){this[_0x0a9e('0x4')](_0x0a9e('0x2f'),_0x546ef8?_0x546ef8['join'](';'):_0x0a9e('0x30'));},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x2f'))?this[_0x0a9e('0x8')]('allow')['split'](';'):null;},'comment':_0x0a9e('0x31')},'autoframing':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'set':function(_0x1dec2e){this[_0x0a9e('0x4')]('insecure',_0x1dec2e?_0x1dec2e[_0x0a9e('0x20')](','):null);},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x32'))?this[_0x0a9e('0x8')](_0x0a9e('0x32'))[_0x0a9e('0x22')](','):null;},'comment':_0x0a9e('0x33')},'trustrpid':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no',_0x0a9e('0x34')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x35')},'amaflags':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':_0x0a9e('0x29')},'busylevel':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x0a9e('0x15')]('yes','no',_0x0a9e('0x36')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0x0a9e('0x37'),_0x0a9e('0x38'),_0x0a9e('0x39')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x3a'),'uas'),'allowNull':!![],'defaultValue':_0x0a9e('0x3b')},'t38pt_usertpsource':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':_0x0a9e('0x29')},'keepalive':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no',_0x0a9e('0x3c'),_0x0a9e('0x3d')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x0a9e('0x15')]('active',_0x0a9e('0x3e'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no','nonat',_0x0a9e('0x2a'),_0x0a9e('0x3f')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x0a9e('0x3')]},'resetPasswordExpires':{'type':Sequelize[_0x0a9e('0x13')]},'showWebBar':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0,'set':function(_0x5d86e9){this[_0x0a9e('0x4')](_0x0a9e('0x40'),_0x5d86e9);var _0x5239ef=this[_0x0a9e('0x41')]({'plain':!![]});switch(_0x5d86e9){case 0x0:case 0x1:var _0x5cc8fb=_0x5239ef[_0x0a9e('0x21')]?_['isArray'](_0x5239ef['transport'])?_0x5239ef['transport'][_0x0a9e('0x20')]():_0x5239ef['transport']:_0x0a9e('0x1f');if(_0x5cc8fb===_0x0a9e('0x42')){_0x5cc8fb=_0x0a9e('0x1f');}this[_0x0a9e('0x4')](_0x0a9e('0x21'),_0x5cc8fb);this[_0x0a9e('0x4')]('encryption','no');this[_0x0a9e('0x4')]('avpf',null);this[_0x0a9e('0x4')](_0x0a9e('0x43'),null);this[_0x0a9e('0x4')]('icesupport',null);this[_0x0a9e('0x4')](_0x0a9e('0x44'),null);this[_0x0a9e('0x4')](_0x0a9e('0x45'),null);this['setDataValue'](_0x0a9e('0x46'),null);this[_0x0a9e('0x4')]('dtlscertfile',null);this[_0x0a9e('0x4')](_0x0a9e('0x47'),null);this[_0x0a9e('0x4')](_0x0a9e('0x48'),'no');break;case 0x2:this[_0x0a9e('0x4')]('transport',_0x0a9e('0x42'));this[_0x0a9e('0x4')](_0x0a9e('0x49'),'yes');this[_0x0a9e('0x4')]('avpf','yes');this[_0x0a9e('0x4')](_0x0a9e('0x43'),_0x0a9e('0x29'));this[_0x0a9e('0x4')](_0x0a9e('0x4a'),_0x0a9e('0x29'));this[_0x0a9e('0x4')](_0x0a9e('0x44'),_0x0a9e('0x29'));this[_0x0a9e('0x4')](_0x0a9e('0x45'),'no');this[_0x0a9e('0x4')](_0x0a9e('0x46'),_0x0a9e('0x4b'));this[_0x0a9e('0x4')](_0x0a9e('0x4c'),_0x5239ef[_0x0a9e('0x4c')]||_0x0a9e('0x4d'));this['setDataValue'](_0x0a9e('0x47'),_0x5239ef[_0x0a9e('0x47')]||_0x0a9e('0x4e'));this['setDataValue'](_0x0a9e('0x48'),_0x0a9e('0x29'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x83f0b2){this[_0x0a9e('0x4')](_0x0a9e('0x4f'),_0x83f0b2?_0x83f0b2[_0x0a9e('0x20')](','):[]);},'get':function(){return this[_0x0a9e('0x8')]('permissions')?_['map'](this['getDataValue'](_0x0a9e('0x4f'))[_0x0a9e('0x22')](','),function(_0x1104ad){return parseInt(_0x1104ad,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x0a9e('0x3')]},'passwordResetAt':{'type':Sequelize[_0x0a9e('0x13')],'defaultValue':null},'phoneBarEnableJaws':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x50'))?this[_0x0a9e('0x8')](_0x0a9e('0x50')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'interface':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![],'set':function(_0x30a4c7){if(typeof _0x30a4c7===_0x0a9e('0x51')){var _0x332367=_0x30a4c7==='1'?!![]:_0x30a4c7==='0'?![]:_0x30a4c7===_0x0a9e('0x52')?!![]:_0x30a4c7===_0x0a9e('0x53')?![]:![];this[_0x0a9e('0x4')](_0x0a9e('0x54'),_0x332367);}else{this[_0x0a9e('0x4')](_0x0a9e('0x54'),_0x30a4c7);}}},'blocked':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![],'set':function(_0x25744a){this[_0x0a9e('0x4')]('blocked',_0x25744a);if(_0x25744a===!![]){this[_0x0a9e('0x4')](_0x0a9e('0x55'),moment());this[_0x0a9e('0x4')]('loginAttempts',0x0);}else{this[_0x0a9e('0x4')](_0x0a9e('0x55'),null);}}},'blockedAt':{'type':Sequelize[_0x0a9e('0x13')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xa9e0=['\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','fingerprint','certificate','passive','update,nonat','showWebBar','get','wss','force_avp','dtlsenable','dtlsverify','dtlssetup','dtlsprivatekey','rtcp_mux','encryption','icesupport','actpass','dtlscertfile','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','sequelize','moment','util','STRING','setDataValue','name','defaultuser','callerid','getDataValue','internal','email','admin','user','agent','telephone','INTEGER','format','fullname','BOOLEAN','DATE','DEFAULT\x20PAUSE','ENUM','peer','friend','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','join','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','update','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','ulaw;alaw;gsm','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never'];(function(_0x2c9b89,_0x2865fd){var _0x1fa60d=function(_0xb02a2a){while(--_0xb02a2a){_0x2c9b89['push'](_0x2c9b89['shift']());}};_0x1fa60d(++_0x2865fd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x333808){this[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x333808);this[_0x0a9e('0x4')](_0x0a9e('0x6'),_0x333808);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'set':function(_0x441e3a){this[_0x0a9e('0x4')]('fullname',_0x441e3a);this['setDataValue'](_0x0a9e('0x7'),util['format']('\x22%s\x22\x20<%s>',_0x441e3a,this[_0x0a9e('0x8')](_0x0a9e('0x9'))));}},'alias':{'type':Sequelize[_0x0a9e('0x3')]},'email':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'unique':_0x0a9e('0xa'),'validate':{'isEmail':!![]},'set':function(_0xbd1168){if(_0xbd1168){this['setDataValue']('email',_0xbd1168['toLowerCase']());}}},'role':{'type':Sequelize['ENUM'](_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe')),'allowNull':![]},'password':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'local'},'internal':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':![],'unique':_0x0a9e('0x9'),'set':function(_0x2b4227){this[_0x0a9e('0x4')](_0x0a9e('0x9'),_0x2b4227);this[_0x0a9e('0x4')]('accountcode',_0x2b4227);this[_0x0a9e('0x4')]('callerid',util[_0x0a9e('0x10')]('\x22%s\x22\x20<%s>',this[_0x0a9e('0x8')](_0x0a9e('0x11')),_0x2b4227));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x0a9e('0x3')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0x0a9e('0x3')]},'zipcode':{'type':Sequelize[_0x0a9e('0x3')]},'userpic':{'type':Sequelize[_0x0a9e('0x3')]},'city':{'type':Sequelize[_0x0a9e('0x3')]},'country':{'type':Sequelize[_0x0a9e('0x3')]},'online':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x0a9e('0x13')]},'voicePause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':_0x0a9e('0x14')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x0a9e('0xf')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'description':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0x0a9e('0xf')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x0a9e('0x15')]('friend',_0x0a9e('0xc'),_0x0a9e('0x16')),'allowNull':!![],'defaultValue':_0x0a9e('0x17')},'context':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x18')},'callingpres':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x19'),_0x0a9e('0x1a'),'ALLOWED_FAILED_SCREEN',_0x0a9e('0x1b'),_0x0a9e('0x1c'),_0x0a9e('0x1d'),_0x0a9e('0x1e'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'permit':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'transport':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x1f'),'set':function(_0x2e8759){this[_0x0a9e('0x4')]('transport',_0x2e8759?_0x2e8759[_0x0a9e('0x20')](','):null);},'get':function(){return this['getDataValue'](_0x0a9e('0x21'))?this[_0x0a9e('0x8')](_0x0a9e('0x21'))[_0x0a9e('0x22')](','):null;},'comment':_0x0a9e('0x23')},'dtmfmode':{'type':Sequelize['ENUM'](_0x0a9e('0x24'),_0x0a9e('0x25'),_0x0a9e('0x26'),_0x0a9e('0x27'),_0x0a9e('0x28')),'allowNull':!![],'defaultValue':_0x0a9e('0x24')},'directmedia':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no','nonat',_0x0a9e('0x2a'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x0a9e('0x2b'),'set':function(_0xd1836d){this[_0x0a9e('0x4')](_0x0a9e('0x2c'),_0xd1836d?_0xd1836d['join'](','):null);},'get':function(){return this['getDataValue'](_0x0a9e('0x2c'))?this['getDataValue'](_0x0a9e('0x2c'))[_0x0a9e('0x22')](','):null;},'comment':_0x0a9e('0x2d')},'callgroup':{'type':Sequelize[_0x0a9e('0x3')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x0a9e('0x3')]},'namedpickupgroup':{'type':Sequelize[_0x0a9e('0x3')]},'language':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'defaultValue':_0x0a9e('0x2e')},'allow':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x546ef8){this[_0x0a9e('0x4')](_0x0a9e('0x2f'),_0x546ef8?_0x546ef8['join'](';'):_0x0a9e('0x30'));},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x2f'))?this[_0x0a9e('0x8')]('allow')['split'](';'):null;},'comment':_0x0a9e('0x31')},'autoframing':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'set':function(_0x1dec2e){this[_0x0a9e('0x4')]('insecure',_0x1dec2e?_0x1dec2e[_0x0a9e('0x20')](','):null);},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x32'))?this[_0x0a9e('0x8')](_0x0a9e('0x32'))[_0x0a9e('0x22')](','):null;},'comment':_0x0a9e('0x33')},'trustrpid':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no',_0x0a9e('0x34')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x35')},'amaflags':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':_0x0a9e('0x29')},'busylevel':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x0a9e('0x15')]('yes','no',_0x0a9e('0x36')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0x0a9e('0x37'),_0x0a9e('0x38'),_0x0a9e('0x39')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x3a'),'uas'),'allowNull':!![],'defaultValue':_0x0a9e('0x3b')},'t38pt_usertpsource':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':_0x0a9e('0x29')},'keepalive':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no',_0x0a9e('0x3c'),_0x0a9e('0x3d')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x0a9e('0x15')]('active',_0x0a9e('0x3e'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no','nonat',_0x0a9e('0x2a'),_0x0a9e('0x3f')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x0a9e('0x3')]},'resetPasswordExpires':{'type':Sequelize[_0x0a9e('0x13')]},'showWebBar':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0,'set':function(_0x5d86e9){this[_0x0a9e('0x4')](_0x0a9e('0x40'),_0x5d86e9);var _0x5239ef=this[_0x0a9e('0x41')]({'plain':!![]});switch(_0x5d86e9){case 0x0:case 0x1:var _0x5cc8fb=_0x5239ef[_0x0a9e('0x21')]?_['isArray'](_0x5239ef['transport'])?_0x5239ef['transport'][_0x0a9e('0x20')]():_0x5239ef['transport']:_0x0a9e('0x1f');if(_0x5cc8fb===_0x0a9e('0x42')){_0x5cc8fb=_0x0a9e('0x1f');}this[_0x0a9e('0x4')](_0x0a9e('0x21'),_0x5cc8fb);this[_0x0a9e('0x4')]('encryption','no');this[_0x0a9e('0x4')]('avpf',null);this[_0x0a9e('0x4')](_0x0a9e('0x43'),null);this[_0x0a9e('0x4')]('icesupport',null);this[_0x0a9e('0x4')](_0x0a9e('0x44'),null);this[_0x0a9e('0x4')](_0x0a9e('0x45'),null);this['setDataValue'](_0x0a9e('0x46'),null);this[_0x0a9e('0x4')]('dtlscertfile',null);this[_0x0a9e('0x4')](_0x0a9e('0x47'),null);this[_0x0a9e('0x4')](_0x0a9e('0x48'),'no');break;case 0x2:this[_0x0a9e('0x4')]('transport',_0x0a9e('0x42'));this[_0x0a9e('0x4')](_0x0a9e('0x49'),'yes');this[_0x0a9e('0x4')]('avpf','yes');this[_0x0a9e('0x4')](_0x0a9e('0x43'),_0x0a9e('0x29'));this[_0x0a9e('0x4')](_0x0a9e('0x4a'),_0x0a9e('0x29'));this[_0x0a9e('0x4')](_0x0a9e('0x44'),_0x0a9e('0x29'));this[_0x0a9e('0x4')](_0x0a9e('0x45'),'no');this[_0x0a9e('0x4')](_0x0a9e('0x46'),_0x0a9e('0x4b'));this[_0x0a9e('0x4')](_0x0a9e('0x4c'),_0x5239ef[_0x0a9e('0x4c')]||_0x0a9e('0x4d'));this['setDataValue'](_0x0a9e('0x47'),_0x5239ef[_0x0a9e('0x47')]||_0x0a9e('0x4e'));this['setDataValue'](_0x0a9e('0x48'),_0x0a9e('0x29'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x83f0b2){this[_0x0a9e('0x4')](_0x0a9e('0x4f'),_0x83f0b2?_0x83f0b2[_0x0a9e('0x20')](','):[]);},'get':function(){return this[_0x0a9e('0x8')]('permissions')?_['map'](this['getDataValue'](_0x0a9e('0x4f'))[_0x0a9e('0x22')](','),function(_0x1104ad){return parseInt(_0x1104ad,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x0a9e('0x3')]},'passwordResetAt':{'type':Sequelize[_0x0a9e('0x13')],'defaultValue':null},'phoneBarEnableJaws':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x50'))?this[_0x0a9e('0x8')](_0x0a9e('0x50')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'interface':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![],'set':function(_0x30a4c7){if(typeof _0x30a4c7===_0x0a9e('0x51')){var _0x332367=_0x30a4c7==='1'?!![]:_0x30a4c7==='0'?![]:_0x30a4c7===_0x0a9e('0x52')?!![]:_0x30a4c7===_0x0a9e('0x53')?![]:![];this[_0x0a9e('0x4')](_0x0a9e('0x54'),_0x332367);}else{this[_0x0a9e('0x4')](_0x0a9e('0x54'),_0x30a4c7);}}},'blocked':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![],'set':function(_0x25744a){this[_0x0a9e('0x4')]('blocked',_0x25744a);if(_0x25744a===!![]){this[_0x0a9e('0x4')](_0x0a9e('0x55'),moment());this[_0x0a9e('0x4')]('loginAttempts',0x0);}else{this[_0x0a9e('0x4')](_0x0a9e('0x55'),null);}}},'blockedAt':{'type':Sequelize[_0x0a9e('0x13')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index b54666d..44bf7d4 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 _0xf0f1=['sequelize','lower','col','count','includeAll','include','rows','params','intersection','bulkCreate','body','describe','addContacts','ids','agent','agent\x20role','admin','../../config/license/util','getLicense','telephones','users','isNil','License\x20limit\x20reached','create','internal','Setting','findById','securePassword','max','QueryTypes','SELECT','from','mailbox','VoiceMail','email','permissions','101','102','103','104','105','107','108','109','111','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','changePassword','findOne','oldPassword','newPassword','Sequelize','Invalid\x20body\x20format.\x20Use\x20oldPassord\x20and\x20newPassword','authenticate','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','Unauthorized','addQueues','channel','online','loginInPause','voicePause','Unknown\x20channel','add','capitalize','toLowerCase','Queues','penalty','spread','QueueId','emit','Queue:save','voice','VoiceQueue','findAll','push','SIP/%s','interface','upsert','removeQueues','Queue:remove','UserVoiceQueueRt','addAvatar','userpic','file','filename','join','existsSync','root','server/files/images/','download','getContacts','CmContact','options','CmList','List','Tag','color','tag','nolimit','getQueues','isValidChannel','Queue','getVoiceQueuesRt','ChatGroup','getGroups','getRecordings','VoiceRecording','UserId','getScreenRecordings','ScreenRecording','getChatInteractions','ChatInteraction','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','FaxInteraction','phone','mobile','format','LOCAL/%s@from-sip/n','intrf','user:%s','user:forcelogout','headers','x-forwarded-for','remoteAddress','socket','connection','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','UserVoiceQueue.penalty','each','MemberReport','YYYY-MM-DD\x20HH:mm:ss','getChannels','forEach','LOGIN','device','LOGININPAUSE','concat','isMiddleware','resolve','all','pause','updateAttributes','PAUSE','DEFAULT\x20PAUSE','unpause','mailPause','faxPause','openchannelPause','lastPauseAt','manual','mail','fax','sms','openchannel','QueuePause','getTeams','Team','addTeams','omit','getVoiceQueues','setDataValue','Voice','getMailQueues','getFaxQueues','Fax','getOpenchannelQueues','flatten','transaction','getDataValue','removeTeams','getChatQueues','Chat','getSmsQueues','Sms','Openchannel','removeAgent','getLists','getAgents','values','send','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','isArray','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','user_has_openchannel_interactions:remove','getVoicePrefixes','VoicePrefix','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','SquareProject','getSquareProjects','addSquareProjects','removeSquareProjects','getScheduledCalls','$and','$or','$gte','$lt','$lte','$ne','$eq','$not','$between','$notBetween','$in','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contains','CmHopper','firstName','lastName','Contact','dialActive','getApiKey','retrieveApiKey','token','createApiKey','iat','nonce','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','removeApiKey','apiKeyNonce','apiKeyIat','whoami','eml-format','rimraf','zip-dir','moment','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./user.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~!@#$%^&-_=+[{]}.','then','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','User,\x20%s,\x20%s','message','result','catch','status','end','json','offset','limit','set','Content-Range','apply','reject','update','destroy','Users','user','Agents','Telephones','telephone','filter','ignore','map','value','includes','role','find','name','UserProfileResource','sendStatus','stack','User','rawAttributes','fieldName','type','key','model','differenceBy','password','salt','query','keys','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','merge','VIRTUAL'];(function(_0x135573,_0x479526){var _0x13ea56=function(_0x49c990){while(--_0x49c990){_0x135573['push'](_0x135573['shift']());}};_0x13ea56(++_0x479526);}(_0xf0f1,0x110));var _0x1f0f=function(_0xfbdff6,_0x2af690){_0xfbdff6=_0xfbdff6-0x0;var _0x4cb9be=_0xf0f1[_0xfbdff6];return _0x4cb9be;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1f0f('0x0'));var rimraf=require(_0x1f0f('0x1'));var zipdir=require(_0x1f0f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1f0f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1f0f('0x4'));var util=require('util');var path=require(_0x1f0f('0x5'));var sox=require(_0x1f0f('0x6'));var csv=require(_0x1f0f('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x1f0f('0x8'));var squel=require(_0x1f0f('0x9'));var crypto=require(_0x1f0f('0xa'));var jsforce=require(_0x1f0f('0xb'));var deskjs=require(_0x1f0f('0xc'));var toCsv=require(_0x1f0f('0x7'));var querystring=require(_0x1f0f('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1f0f('0xe'));var qs=require(_0x1f0f('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1f0f('0x10'));var logger=require(_0x1f0f('0x11'))(_0x1f0f('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x1f0f('0x13'))['db'];config['redis']=_[_0x1f0f('0x14')](config[_0x1f0f('0x15')],{'host':_0x1f0f('0x16'),'port':0x18eb});var socket=require(_0x1f0f('0x17'))(new Redis(config[_0x1f0f('0x15')]));require(_0x1f0f('0x18'))[_0x1f0f('0x19')](socket);var jayson=require(_0x1f0f('0x1a'));var client=jayson[_0x1f0f('0x1b')][_0x1f0f('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x1cb810,_0x392ce2,_0x3631e2){if(_0x3631e2){var _0x795854=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x795854[_0x1f0f('0x1d')](_0x392ce2)){return _0x1cb810;}else{throw new db['Sequelize'][(_0x1f0f('0x1e'))](_0x1f0f('0x1f'));}}else{return _0x1cb810;}}function respondWithRpcPromise(_0xfd1fe5,_0x11a307,_0x257f1a,_0x7a8297){return new BPromise(function(_0x1bd19e,_0x2b4fb3){var _0x4e5081=_0x7a8297||client;return _0x4e5081['request'](_0xfd1fe5,_0x257f1a)[_0x1f0f('0x20')](function(_0x1dfd3c){logger['info']('User,\x20%s,\x20%s',_0x11a307,_0x1f0f('0x21'));logger[_0x1f0f('0x22')](_0x1f0f('0x23'),_0x11a307,'request\x20sent',JSON[_0x1f0f('0x24')](_0x1dfd3c));if(_0x1dfd3c[_0x1f0f('0x25')]){if(_0x1dfd3c[_0x1f0f('0x25')][_0x1f0f('0x26')]===0x1f4){logger[_0x1f0f('0x25')](_0x1f0f('0x27'),_0x11a307,_0x1dfd3c[_0x1f0f('0x25')][_0x1f0f('0x28')]);return _0x2b4fb3(_0x1dfd3c[_0x1f0f('0x25')][_0x1f0f('0x28')]);}logger[_0x1f0f('0x25')](_0x1f0f('0x27'),_0x11a307,_0x1dfd3c['error'][_0x1f0f('0x28')]);return _0x1bd19e(_0x1dfd3c[_0x1f0f('0x25')][_0x1f0f('0x28')]);}else{logger['info'](_0x1f0f('0x27'),_0x11a307,_0x1f0f('0x21'));_0x1bd19e(_0x1dfd3c[_0x1f0f('0x29')][_0x1f0f('0x28')]);}})[_0x1f0f('0x2a')](function(_0x38bd70){logger[_0x1f0f('0x25')](_0x1f0f('0x27'),_0x11a307,_0x38bd70);_0x2b4fb3(_0x38bd70);});});}function respondWithStatusCode(_0x473f84,_0x3ce818){_0x3ce818=_0x3ce818||0xcc;return function(_0x17fa03){if(_0x17fa03){return _0x473f84['sendStatus'](_0x3ce818);}return _0x473f84[_0x1f0f('0x2b')](_0x3ce818)[_0x1f0f('0x2c')]();};}function respondWithResult(_0x380b36,_0xc959a6){_0xc959a6=_0xc959a6||0xc8;return function(_0x155d3c){if(_0x155d3c){return _0x380b36[_0x1f0f('0x2b')](_0xc959a6)[_0x1f0f('0x2d')](_0x155d3c);}};}function respondWithFilteredResult(_0x44f489,_0x41a985){return function(_0x50c0c3){if(_0x50c0c3){var _0x36002c=_0x50c0c3['count'],_0xf6cb9d=_0x41a985[_0x1f0f('0x2e')],_0x19aee2=_0x41a985[_0x1f0f('0x2e')]+_0x41a985[_0x1f0f('0x2f')],_0xd782cd;if(_0x19aee2>=_0x36002c){_0x19aee2=_0x36002c;_0xd782cd=0xc8;}else{_0xd782cd=0xce;}_0x44f489[_0x1f0f('0x2b')](_0xd782cd);return _0x44f489[_0x1f0f('0x30')](_0x1f0f('0x31'),_0xf6cb9d+'-'+_0x19aee2+'/'+_0x36002c)['json'](_0x50c0c3);}return null;};}function patchUpdates(_0x17bb6c){return function(_0x29788e){try{jsonpatch[_0x1f0f('0x32')](_0x29788e,_0x17bb6c,!![]);}catch(_0xb515a5){return BPromise[_0x1f0f('0x33')](_0xb515a5);}return _0x29788e['save']();};}function saveUpdates(_0x40a645,_0x5d2285){return function(_0x2c5319){if(_0x2c5319){return _0x2c5319[_0x1f0f('0x34')](_0x40a645)['then'](function(_0x500121){return _0x500121;});}return null;};}function removeEntity(_0x4d6975,_0x5941b5){return function(_0x463432){if(_0x463432){return _0x463432[_0x1f0f('0x35')]()[_0x1f0f('0x20')](function(){var _0x5cbe80=_0x463432['get']({'plain':!![]});var _0x1d9867=[{'name':_0x1f0f('0x36'),'value':_0x1f0f('0x37'),'ignore':!![]},{'name':_0x1f0f('0x38'),'value':'agent','ignore':![]},{'name':_0x1f0f('0x39'),'value':_0x1f0f('0x3a'),'ignore':![]}];var _0xa91d4d=_(_0x1d9867)[_0x1f0f('0x3b')](_0x1f0f('0x3c'))[_0x1f0f('0x3d')](_0x1f0f('0x3e'))[_0x1f0f('0x3e')]();if(_[_0x1f0f('0x3f')](_0xa91d4d,_0x5cbe80[_0x1f0f('0x40')])){return;}var _0x5f31a9=_[_0x1f0f('0x41')](_0x1d9867,[_0x1f0f('0x3e'),_0x5cbe80['role']])[_0x1f0f('0x42')];return db[_0x1f0f('0x43')]['destroy']({'where':{'type':_0x5f31a9,'resourceId':_0x5cbe80['id']}})['then'](function(){return _0x463432;});})[_0x1f0f('0x20')](function(){_0x4d6975[_0x1f0f('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x330386,_0x14f7a1){return function(_0x3d0fe8){if(!_0x3d0fe8){_0x330386[_0x1f0f('0x44')](0x194);}return _0x3d0fe8;};}function handleError(_0x51fa0c,_0xb9e939){_0xb9e939=_0xb9e939||0x1f4;return function(_0x3584c9){logger[_0x1f0f('0x25')](_0x3584c9[_0x1f0f('0x45')]);if(_0x3584c9[_0x1f0f('0x42')]){delete _0x3584c9[_0x1f0f('0x42')];}_0x51fa0c['status'](_0xb9e939)['send'](_0x3584c9);};}exports['index']=function(_0x1509d3,_0x48efc8){var _0x36941d={},_0x1053e1={},_0x521396={'count':0x0,'rows':[]};var _0x259a9d=_['map'](db[_0x1f0f('0x46')][_0x1f0f('0x47')],function(_0x346cd5){return{'name':_0x346cd5[_0x1f0f('0x48')],'type':_0x346cd5[_0x1f0f('0x49')][_0x1f0f('0x4a')]};});_0x1053e1[_0x1f0f('0x4b')]=_[_0x1f0f('0x4c')](_[_0x1f0f('0x3d')](_0x259a9d,'name'),[_0x1f0f('0x4d'),_0x1f0f('0x4e')]);_0x1053e1[_0x1f0f('0x4f')]=_[_0x1f0f('0x50')](_0x1509d3[_0x1f0f('0x4f')]);_0x1053e1['filters']=_['intersection'](_0x1053e1['model'],_0x1053e1['query']);_0x36941d[_0x1f0f('0x51')]=_['intersection'](_0x1053e1[_0x1f0f('0x4b')],qs[_0x1f0f('0x52')](_0x1509d3[_0x1f0f('0x4f')]['fields']));_0x36941d[_0x1f0f('0x51')]=_0x36941d[_0x1f0f('0x51')][_0x1f0f('0x53')]?_0x36941d['attributes']:_0x1053e1[_0x1f0f('0x4b')];if(!_0x1509d3[_0x1f0f('0x4f')][_0x1f0f('0x54')]('nolimit')){_0x36941d[_0x1f0f('0x2f')]=qs[_0x1f0f('0x2f')](_0x1509d3[_0x1f0f('0x4f')][_0x1f0f('0x2f')]);_0x36941d[_0x1f0f('0x2e')]=qs[_0x1f0f('0x2e')](_0x1509d3[_0x1f0f('0x4f')][_0x1f0f('0x2e')]);}_0x36941d[_0x1f0f('0x55')]=qs[_0x1f0f('0x56')](_0x1509d3[_0x1f0f('0x4f')][_0x1f0f('0x56')]);_0x36941d[_0x1f0f('0x57')]=qs[_0x1f0f('0x58')](_[_0x1f0f('0x59')](_0x1509d3[_0x1f0f('0x4f')],_0x1053e1['filters']));if(_0x1509d3['query'][_0x1f0f('0x3b')]){_0x36941d[_0x1f0f('0x57')]=_[_0x1f0f('0x5a')](_0x36941d[_0x1f0f('0x57')],{'$or':_[_0x1f0f('0x3d')](_0x259a9d,function(_0x2c2c86){if(_0x2c2c86[_0x1f0f('0x49')]!==_0x1f0f('0x5b')){return db[_0x1f0f('0x5c')][_0x1f0f('0x57')](db[_0x1f0f('0x5c')]['fn'](_0x1f0f('0x5d'),db[_0x1f0f('0x5c')][_0x1f0f('0x5e')](_0x2c2c86[_0x1f0f('0x42')])),{'$like':db[_0x1f0f('0x5c')]['fn'](_0x1f0f('0x5d'),'%'+_0x1509d3['query'][_0x1f0f('0x3b')]+'%')});}})});}_0x36941d=_['merge']({},_0x36941d,_0x1509d3['options']);var _0x481040={'where':_0x36941d[_0x1f0f('0x57')]};return db[_0x1f0f('0x46')][_0x1f0f('0x5f')](_0x481040)[_0x1f0f('0x20')](function(_0x2c16bb){_0x521396[_0x1f0f('0x5f')]=_0x2c16bb;if(_0x1509d3[_0x1f0f('0x4f')][_0x1f0f('0x60')]){_0x36941d[_0x1f0f('0x61')]=[{'all':!![]}];}return db['User']['findAll'](_0x36941d);})[_0x1f0f('0x20')](function(_0x12f739){_0x521396[_0x1f0f('0x62')]=_0x12f739;return _0x521396;})[_0x1f0f('0x20')](respondWithFilteredResult(_0x48efc8,_0x36941d))[_0x1f0f('0x2a')](handleError(_0x48efc8,null));};exports['show']=function(_0x13ae17,_0x29f914){var _0x15f90c={'raw':![],'where':{'id':_0x13ae17[_0x1f0f('0x63')]['id']}},_0x144f36={};_0x144f36[_0x1f0f('0x4b')]=_['differenceBy'](_[_0x1f0f('0x50')](db['User'][_0x1f0f('0x47')]),['password',_0x1f0f('0x4e')]);_0x144f36[_0x1f0f('0x4f')]=_['keys'](_0x13ae17[_0x1f0f('0x4f')]);_0x144f36[_0x1f0f('0x58')]=_[_0x1f0f('0x64')](_0x144f36[_0x1f0f('0x4b')],_0x144f36[_0x1f0f('0x4f')]);_0x15f90c['attributes']=_['intersection'](_0x144f36[_0x1f0f('0x4b')],qs[_0x1f0f('0x52')](_0x13ae17['query']['fields']));_0x15f90c[_0x1f0f('0x51')]=_0x15f90c['attributes'][_0x1f0f('0x53')]?_0x15f90c[_0x1f0f('0x51')]:_0x144f36[_0x1f0f('0x4b')];if(_0x13ae17['query'][_0x1f0f('0x60')]){_0x15f90c['include']=[{'all':!![]}];}_0x15f90c=_['merge']({},_0x15f90c,_0x13ae17['options']);return db['User']['find'](_0x15f90c)[_0x1f0f('0x20')](handleEntityNotFound(_0x29f914,null))['then'](respondWithResult(_0x29f914,null))[_0x1f0f('0x2a')](handleError(_0x29f914,null));};exports[_0x1f0f('0x65')]=function(_0x2ed12d,_0x3ef5cd){return db[_0x1f0f('0x46')][_0x1f0f('0x65')](_0x2ed12d[_0x1f0f('0x66')],{'raw':![],'individualHooks':!![]})[_0x1f0f('0x20')](respondWithResult(_0x3ef5cd,0xc9))[_0x1f0f('0x2a')](handleError(_0x3ef5cd,null));};exports[_0x1f0f('0x34')]=function(_0x38c23b,_0xf84cad){if(_0x38c23b['body']['id']){delete _0x38c23b[_0x1f0f('0x66')]['id'];}delete _0x38c23b[_0x1f0f('0x66')]['role'];return db['User'][_0x1f0f('0x41')]({'where':{'id':_0x38c23b[_0x1f0f('0x63')]['id']}})[_0x1f0f('0x20')](handleEntityNotFound(_0xf84cad,null))['then'](saveUpdates(_0x38c23b[_0x1f0f('0x66')],null))[_0x1f0f('0x20')](respondWithResult(_0xf84cad,null))[_0x1f0f('0x2a')](handleError(_0xf84cad,null));};exports[_0x1f0f('0x67')]=function(_0xfad31,_0x88ffbd){return db['User'][_0x1f0f('0x67')]()[_0x1f0f('0x20')](respondWithResult(_0x88ffbd,null))[_0x1f0f('0x2a')](handleError(_0x88ffbd,null));};exports[_0x1f0f('0x68')]=function(_0x591d99,_0x980ea4,_0x506e89){return db['User']['find']({'where':{'id':_0x591d99[_0x1f0f('0x63')]['id']}})[_0x1f0f('0x20')](handleEntityNotFound(_0x980ea4,null))[_0x1f0f('0x20')](function(_0x2e891b){if(_0x2e891b){return _0x2e891b[_0x1f0f('0x68')](_0x591d99[_0x1f0f('0x66')][_0x1f0f('0x69')],_['omit'](_0x591d99[_0x1f0f('0x66')],[_0x1f0f('0x69'),'id'])||{});}})[_0x1f0f('0x20')](respondWithResult(_0x980ea4,null))[_0x1f0f('0x2a')](handleError(_0x980ea4,null));};var getLicense=function(_0x144f20){return new BPromise(function(_0x842cf,_0x5915b8){var _0x22eb19=0x0;_0x144f20[_0x1f0f('0x66')][_0x1f0f('0x40')]===_0x1f0f('0x6a')&&_0x842cf(_0x1f0f('0x6b'));return db['User']['count']({'where':{'$or':[{'role':_0x144f20[_0x1f0f('0x66')][_0x1f0f('0x40')]===_0x1f0f('0x3a')?'telephone':[_0x1f0f('0x6c'),'user']}]}})[_0x1f0f('0x20')](function(_0x5aa2eb){_0x22eb19=_0x5aa2eb;return require(_0x1f0f('0x6d'))[_0x1f0f('0x6e')]();})[_0x1f0f('0x20')](function(_0x402563){var _0x1a2c71=_0x144f20[_0x1f0f('0x66')]['role']===_0x1f0f('0x3a')?_0x1f0f('0x6f'):_0x1f0f('0x70');if(!_[_0x1f0f('0x71')](_0x402563[_0x1a2c71])&&_0x22eb19>=_0x402563[_0x1a2c71]){return _0x5915b8({'message':_0x1f0f('0x72')});}return _0x842cf(util['format']('count\x20%s:\x20%s',_0x1a2c71,_0x22eb19));})[_0x1f0f('0x2a')](function(_0x270e5a){return _0x5915b8(_0x270e5a);});});};exports[_0x1f0f('0x73')]=function(_0x5470e1,_0x2d3987){return getLicense(_0x5470e1)[_0x1f0f('0x20')](function(_0x35124c){if(!_0x5470e1['body'][_0x1f0f('0x74')]){var _0x212701;return db[_0x1f0f('0x75')][_0x1f0f('0x76')](0x1)[_0x1f0f('0x20')](function(_0xcacbaf){return checkPasswordPattern(_0xcacbaf,_0x5470e1['body'][_0x1f0f('0x4d')],_0xcacbaf[_0x1f0f('0x77')]);})[_0x1f0f('0x20')](function(_0x37b2c2){_0x212701=_0x37b2c2['min_internal'];return db[_0x1f0f('0x46')][_0x1f0f('0x78')]('internal');})['then'](function(_0x4fa556){if(_[_0x1f0f('0x71')](_0x4fa556)){if(_0x212701){_0x5470e1[_0x1f0f('0x66')]['internal']=_0x212701;}else{_0x5470e1[_0x1f0f('0x66')]['internal']=0x1;}}else{if(_[_0x1f0f('0x71')](_0x212701)||_0x212701==_0x4fa556){_0x5470e1[_0x1f0f('0x66')][_0x1f0f('0x74')]=_0x4fa556+0x1;}else if(_0x212701>_0x4fa556){_0x5470e1[_0x1f0f('0x66')][_0x1f0f('0x74')]=_0x212701;}else{return db['sequelize'][_0x1f0f('0x4f')]('select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)',{'type':db[_0x1f0f('0x5c')][_0x1f0f('0x79')][_0x1f0f('0x7a')]})['then'](function(_0x113f0a){if(_0x113f0a&&_0x113f0a[_0x1f0f('0x53')]){for(var _0x4c8cfe=0x0,_0x51ed46=_0x113f0a['length'];_0x4c8cfe<_0x51ed46&&_['isNil'](_0x5470e1[_0x1f0f('0x66')][_0x1f0f('0x74')]);_0x4c8cfe++){if(_0x212701<=_0x113f0a[_0x4c8cfe][_0x1f0f('0x7b')]){_0x5470e1[_0x1f0f('0x66')][_0x1f0f('0x74')]=_0x113f0a[_0x4c8cfe][_0x1f0f('0x7b')];}else if(_0x212701>_0x113f0a[_0x4c8cfe][_0x1f0f('0x7b')]&&_0x212701<=_0x113f0a[_0x4c8cfe]['to']){_0x5470e1['body'][_0x1f0f('0x74')]=_0x212701;}}}if(_['isNil'](_0x5470e1[_0x1f0f('0x66')]['internal'])){_0x5470e1[_0x1f0f('0x66')][_0x1f0f('0x74')]=_0x4fa556+0x1;}});}}});}})['then'](function(){if(_0x5470e1['body']['voicemail']){_0x5470e1[_0x1f0f('0x66')][_0x1f0f('0x7c')]=_0x5470e1[_0x1f0f('0x66')]['internal'];_0x5470e1[_0x1f0f('0x66')][_0x1f0f('0x7d')]={'mailbox':_0x5470e1[_0x1f0f('0x66')]['internal'],'password':_0x5470e1[_0x1f0f('0x66')][_0x1f0f('0x4d')],'fullname':_0x5470e1[_0x1f0f('0x66')]['fullname'],'email':_0x5470e1['body'][_0x1f0f('0x7e')]};}if(_0x5470e1[_0x1f0f('0x66')]&&_0x5470e1[_0x1f0f('0x66')][_0x1f0f('0x40')]===_0x1f0f('0x6a')){_0x5470e1['body'][_0x1f0f('0x7f')]=[_0x1f0f('0x80'),_0x1f0f('0x81'),_0x1f0f('0x82'),'110',_0x1f0f('0x83'),_0x1f0f('0x84'),'106',_0x1f0f('0x85'),_0x1f0f('0x86'),_0x1f0f('0x87'),'100',_0x1f0f('0x88')];}return db['User'][_0x1f0f('0x73')](_0x5470e1[_0x1f0f('0x66')],{'include':[{'model':db[_0x1f0f('0x7d')],'as':_0x1f0f('0x7d')}]});})[_0x1f0f('0x20')](function(_0xd72448){if(_0x5470e1[_0x1f0f('0x66')][_0x1f0f('0x40')]==='user')return _0xd72448;var _0x356655=_0x5470e1['user']['get']({'plain':!![]});if(!_0x356655)throw new Error(_0x1f0f('0x89'));if(_0x356655[_0x1f0f('0x40')]===_0x1f0f('0x37')){var _0x17dcf7=_0xd72448[_0x1f0f('0x8a')]({'plain':!![]});var _0x121915=[{'name':_0x1f0f('0x38'),'value':_0x1f0f('0x6a')},{'name':_0x1f0f('0x39'),'value':_0x1f0f('0x3a')}];var _0x1f60ff=_[_0x1f0f('0x41')](_0x121915,['value',_0x17dcf7[_0x1f0f('0x40')]])[_0x1f0f('0x42')];return db[_0x1f0f('0x8b')][_0x1f0f('0x41')]({'where':{'name':_0x1f60ff,'userProfileId':_0x356655['userProfileId']},'raw':!![]})[_0x1f0f('0x20')](function(_0x45f25d){if(_0x45f25d&&_0x45f25d[_0x1f0f('0x8c')]===0x0){return db['UserProfileResource'][_0x1f0f('0x73')]({'name':_0x17dcf7[_0x1f0f('0x42')],'resourceId':_0x17dcf7['id'],'type':_0x45f25d['name'],'sectionId':_0x45f25d['id']},{})[_0x1f0f('0x20')](function(){return _0xd72448;});}else{return _0xd72448;}})[_0x1f0f('0x2a')](function(_0x591701){logger['error'](_0x1f0f('0x8d'),_0x591701);throw _0x591701;});}return _0xd72448;})['then'](respondWithResult(_0x2d3987,0xc9))[_0x1f0f('0x2a')](handleError(_0x2d3987,null));};exports[_0x1f0f('0x8e')]=function(_0x5259f1,_0x504666,_0x498653){var _0x196c89=![];if(_0x5259f1[_0x1f0f('0x66')]['id']){delete _0x5259f1[_0x1f0f('0x66')]['id'];}return db[_0x1f0f('0x75')][_0x1f0f('0x8f')]({'attributes':['id',_0x1f0f('0x77')]})[_0x1f0f('0x20')](function(_0x4931b9){_0x196c89=_0x4931b9[_0x1f0f('0x77')];return db[_0x1f0f('0x46')][_0x1f0f('0x41')]({'where':{'id':_0x5259f1[_0x1f0f('0x63')]['id']}});})[_0x1f0f('0x20')](function(_0xc6f912){if(_0xc6f912){if(_0xc6f912['id']==_0x5259f1['user']['id']){if(!_0x5259f1[_0x1f0f('0x66')][_0x1f0f('0x90')]||!_0x5259f1['body'][_0x1f0f('0x91')]){throw new db[(_0x1f0f('0x92'))][(_0x1f0f('0x1e'))](_0x1f0f('0x93'));}if(!_0xc6f912[_0x1f0f('0x94')](_0x5259f1[_0x1f0f('0x66')][_0x1f0f('0x90')])){throw new db[(_0x1f0f('0x92'))][(_0x1f0f('0x1e'))](_0x1f0f('0x95'));}if(_0x5259f1['body'][_0x1f0f('0x90')]==_0x5259f1[_0x1f0f('0x66')]['newPassword']){throw new db[(_0x1f0f('0x92'))]['ValidationError'](_0x1f0f('0x96'));}return _0xc6f912;}else if(_0x5259f1[_0x1f0f('0x37')][_0x1f0f('0x40')]==_0x1f0f('0x6c')){if(!_0x5259f1[_0x1f0f('0x66')][_0x1f0f('0x91')]){throw new db[(_0x1f0f('0x92'))][(_0x1f0f('0x1e'))](_0x1f0f('0x97'));}return _0xc6f912;}else if(_0x5259f1[_0x1f0f('0x37')][_0x1f0f('0x40')]==_0x1f0f('0x37')){if(!_0x5259f1[_0x1f0f('0x66')][_0x1f0f('0x91')]){throw new db[(_0x1f0f('0x92'))][(_0x1f0f('0x1e'))](_0x1f0f('0x97'));}if(_0xc6f912[_0x1f0f('0x40')]!=_0x1f0f('0x6a')){throw new db[(_0x1f0f('0x92'))]['ValidationError'](_0x1f0f('0x98'));}return _0xc6f912;}else{throw new db['Sequelize']['ValidationError'](_0x1f0f('0x98'));}}return null;})[_0x1f0f('0x20')](handleEntityNotFound(_0x504666,null))[_0x1f0f('0x20')](function(_0x56ba73){return checkPasswordPattern(_0x56ba73,_0x5259f1[_0x1f0f('0x66')][_0x1f0f('0x91')],_0x196c89);})['then'](saveUpdates({'password':_0x5259f1[_0x1f0f('0x66')][_0x1f0f('0x91')],'passwordResetAt':_0x5259f1['user']['id']==_0x5259f1[_0x1f0f('0x63')]['id']?moment():null},null))[_0x1f0f('0x20')](respondWithResult(_0x504666,null))[_0x1f0f('0x2a')](handleError(_0x504666,null));};exports[_0x1f0f('0x99')]=function(_0x228328,_0x2f0808,_0x2d1371){var _0x8dc003=_0x228328[_0x1f0f('0x66')][_0x1f0f('0x9a')];return db['User'][_0x1f0f('0x41')]({'where':{'id':_0x228328[_0x1f0f('0x63')]['id']},'attributes':['id',_0x1f0f('0x42'),_0x1f0f('0x40'),_0x1f0f('0x9b'),_0x1f0f('0x9c'),_0x1f0f('0x9d'),'interface']})['then'](handleEntityNotFound(_0x2f0808,null))[_0x1f0f('0x20')](function(_0x40454d){if(_0x40454d){if(!utils['isValidChannel'](_0x8dc003)){throw new db[(_0x1f0f('0x92'))]['ValidationError'](_0x1f0f('0x9e'));}return _0x40454d[_0x1f0f('0x9f')+_[_0x1f0f('0xa0')](_0x8dc003[_0x1f0f('0xa1')]())+_0x1f0f('0xa2')](_0x228328[_0x1f0f('0x66')][_0x1f0f('0x69')],{'penalty':_0x228328['body'][_0x1f0f('0xa3')]||0x0})[_0x1f0f('0xa4')](function(_0x17c8d7){for(var _0x439eb3=0x0;_0x439eb3<_0x228328[_0x1f0f('0x66')][_0x1f0f('0x69')][_0x1f0f('0x53')];_0x439eb3+=0x1){var _0x1ff7c1={'UserId':_0x228328[_0x1f0f('0x63')]['id']};_0x1ff7c1[_[_0x1f0f('0xa0')](_0x8dc003[_0x1f0f('0xa1')]())+_0x1f0f('0xa5')]=_0x228328['body'][_0x1f0f('0x69')][_0x439eb3];socket[_0x1f0f('0xa6')]('user'+_['capitalize'](_0x8dc003[_0x1f0f('0xa1')]())+_0x1f0f('0xa7'),_0x1ff7c1);}return _0x17c8d7;})[_0x1f0f('0x20')](function(){if(_0x8dc003===_0x1f0f('0xa8')){return db[_0x1f0f('0xa9')][_0x1f0f('0xaa')]({'where':{'id':_0x228328[_0x1f0f('0x66')][_0x1f0f('0x69')]||[]},'raw':!![],'attributes':['id',_0x1f0f('0x42')]});}})[_0x1f0f('0x20')](function(_0x285ae6){var _0x2ceb52=_0x40454d['get']({'plain':!![]});var _0x53c69a=[];if(_0x8dc003===_0x1f0f('0xa8')&&_0x2ceb52['role']===_0x1f0f('0x6a')&&_0x2ceb52[_0x1f0f('0x9b')]){for(var _0x41532f=0x0;_0x41532f<_0x285ae6['length'];_0x41532f+=0x1){_0x53c69a[_0x1f0f('0xab')]({'membername':_0x2ceb52[_0x1f0f('0x42')],'UserId':_0x2ceb52['id'],'queue_name':_0x285ae6[_0x41532f][_0x1f0f('0x42')],'VoiceQueueId':_0x285ae6[_0x41532f]['id'],'interface':_['isNil'](_0x2ceb52['interface'])?util['format'](_0x1f0f('0xac'),_0x2ceb52[_0x1f0f('0x42')]):_0x2ceb52[_0x1f0f('0xad')],'paused':_0x2ceb52[_0x1f0f('0x9d')]||![],'penalty':_0x228328[_0x1f0f('0x66')]['penalty']||0x0});}return BPromise['each'](_0x53c69a,function(_0x56c5d1){return db['UserVoiceQueueRt'][_0x1f0f('0xae')](_0x56c5d1);});}return _0x40454d;});}})[_0x1f0f('0x20')](respondWithStatusCode(_0x2f0808,null))[_0x1f0f('0x2a')](handleError(_0x2f0808,null));};exports[_0x1f0f('0xaf')]=function(_0x454891,_0x18b972,_0x5a42d8){var _0x338b28;return db[_0x1f0f('0x46')][_0x1f0f('0x41')]({'where':{'id':_0x454891[_0x1f0f('0x63')]['id']},'attributes':['id',_0x1f0f('0x42'),_0x1f0f('0x40')]})[_0x1f0f('0x20')](handleEntityNotFound(_0x18b972,null))[_0x1f0f('0x20')](function(_0x2dacea){if(_0x2dacea){_0x338b28=_0x2dacea;if(!_0x454891[_0x1f0f('0x4f')]['channel']||!utils['isValidChannel'](_0x454891[_0x1f0f('0x4f')][_0x1f0f('0x9a')])){throw new db['Sequelize'][(_0x1f0f('0x1e'))](_0x1f0f('0x9e'));}return _0x2dacea['remove'+_[_0x1f0f('0xa0')](_0x454891[_0x1f0f('0x4f')]['channel'][_0x1f0f('0xa1')]())+_0x1f0f('0xa2')](_0x454891[_0x1f0f('0x4f')][_0x1f0f('0x69')]);}})[_0x1f0f('0x20')](function(_0x3ce70a){for(var _0x53cf7f=0x0;_0x53cf7f<_0x454891[_0x1f0f('0x4f')]['ids'][_0x1f0f('0x53')];_0x53cf7f+=0x1){var _0x5df072={'UserId':_0x454891[_0x1f0f('0x63')]['id']};_0x5df072[_[_0x1f0f('0xa0')](_0x454891['query'][_0x1f0f('0x9a')][_0x1f0f('0xa1')]())+_0x1f0f('0xa5')]=_0x454891['query'][_0x1f0f('0x69')][_0x53cf7f];socket[_0x1f0f('0xa6')](_0x1f0f('0x37')+_[_0x1f0f('0xa0')](_0x454891[_0x1f0f('0x4f')][_0x1f0f('0x9a')][_0x1f0f('0xa1')]())+_0x1f0f('0xb0'),_0x5df072);}return _0x3ce70a;})[_0x1f0f('0x20')](function(){if(_0x454891[_0x1f0f('0x4f')][_0x1f0f('0x9a')]==='voice'){return db[_0x1f0f('0xb1')][_0x1f0f('0x35')]({'where':{'UserId':_0x454891['params']['id'],'VoiceQueueId':_0x454891[_0x1f0f('0x4f')][_0x1f0f('0x69')]},'individualHooks':!![]})[_0x1f0f('0x20')](function(){return _0x338b28;});}return _0x338b28;})[_0x1f0f('0x20')](respondWithStatusCode(_0x18b972,null))[_0x1f0f('0x2a')](handleError(_0x18b972,null));};exports[_0x1f0f('0xb2')]=function(_0x4b8e20,_0x1bf9cc,_0x43e08e){_0x4b8e20[_0x1f0f('0x66')][_0x1f0f('0xb3')]=_0x4b8e20[_0x1f0f('0xb4')][_0x1f0f('0xb5')];return db[_0x1f0f('0x46')][_0x1f0f('0x41')]({'where':{'id':_0x4b8e20[_0x1f0f('0x63')]['id']}})[_0x1f0f('0x20')](handleEntityNotFound(_0x1bf9cc,null))[_0x1f0f('0x20')](saveUpdates(_0x4b8e20[_0x1f0f('0x66')],null))[_0x1f0f('0x20')](respondWithResult(_0x1bf9cc,null))[_0x1f0f('0x2a')](handleError(_0x1bf9cc,null));};exports['getAvatar']=function(_0x49c830,_0x32a9ef,_0x3c27f0){var _0x16ca49=path[_0x1f0f('0xb6')](config['root'],'server/files/images/logos/default_profile.png');return db[_0x1f0f('0x46')][_0x1f0f('0x41')]({'where':{'id':_0x49c830[_0x1f0f('0x63')]['id']},'attributes':['id','userpic'],'raw':!![]})[_0x1f0f('0x20')](handleEntityNotFound(_0x32a9ef,null))['then'](function(_0x2cec75){if(_0x2cec75){if(_['isNil'](_0x2cec75[_0x1f0f('0xb3')])){return _0x32a9ef['download'](_0x16ca49);}else{if(!fs[_0x1f0f('0xb7')](path[_0x1f0f('0xb6')](config[_0x1f0f('0xb8')],_0x1f0f('0xb9'),_0x2cec75['userpic']))){return _0x32a9ef[_0x1f0f('0xba')](_0x16ca49);}return _0x32a9ef[_0x1f0f('0xba')](path[_0x1f0f('0xb6')](config[_0x1f0f('0xb8')],_0x1f0f('0xb9'),_0x2cec75['userpic']));}}})[_0x1f0f('0x2a')](handleError(_0x32a9ef,null));};exports[_0x1f0f('0xbb')]=function(_0x4b3b1b,_0x272991,_0x2a9b1){var _0x20d45d={};var _0xd93e49={};var _0x5db452;var _0x18f458;return db[_0x1f0f('0x46')][_0x1f0f('0x8f')]({'where':{'id':_0x4b3b1b[_0x1f0f('0x63')]['id']}})[_0x1f0f('0x20')](handleEntityNotFound(_0x272991,null))[_0x1f0f('0x20')](function(_0x21f99d){if(_0x21f99d){_0x5db452=_0x21f99d;_0xd93e49[_0x1f0f('0x4b')]=_['keys'](db[_0x1f0f('0xbc')][_0x1f0f('0x47')]);_0xd93e49['query']=_[_0x1f0f('0x50')](_0x4b3b1b['query']);_0xd93e49[_0x1f0f('0x58')]=_[_0x1f0f('0x64')](_0xd93e49[_0x1f0f('0x4b')],_0xd93e49[_0x1f0f('0x4f')]);_0x20d45d[_0x1f0f('0x51')]=_[_0x1f0f('0x64')](_0xd93e49[_0x1f0f('0x4b')],qs[_0x1f0f('0x52')](_0x4b3b1b[_0x1f0f('0x4f')][_0x1f0f('0x52')]));_0x20d45d[_0x1f0f('0x51')]=_0x20d45d['attributes'][_0x1f0f('0x53')]?_0x20d45d[_0x1f0f('0x51')]:_0xd93e49[_0x1f0f('0x4b')];_0x20d45d[_0x1f0f('0x55')]=qs[_0x1f0f('0x56')](_0x4b3b1b['query'][_0x1f0f('0x56')]);_0x20d45d[_0x1f0f('0x57')]=qs['filters'](_[_0x1f0f('0x59')](_0x4b3b1b['query'],_0xd93e49[_0x1f0f('0x58')]));if(_0x4b3b1b['query'][_0x1f0f('0x3b')]){_0x20d45d[_0x1f0f('0x57')]=_['merge'](_0x20d45d[_0x1f0f('0x57')],{'$or':_[_0x1f0f('0x3d')](_0x20d45d[_0x1f0f('0x51')],function(_0x5a3726){var _0x17e191={};_0x17e191[_0x5a3726]={'$like':'%'+_0x4b3b1b[_0x1f0f('0x4f')]['filter']+'%'};return _0x17e191;})});}_0x20d45d=_[_0x1f0f('0x5a')]({},_0x20d45d,_0x4b3b1b[_0x1f0f('0xbd')]);return _0x5db452[_0x1f0f('0xbb')](_0x20d45d);}})[_0x1f0f('0x20')](function(_0xebf18d){if(_0xebf18d){_0x18f458=_0xebf18d[_0x1f0f('0x53')];if(_0x4b3b1b[_0x1f0f('0x4f')]['hasOwnProperty']('includeAll')){_0x20d45d[_0x1f0f('0x61')]=[{'model':db[_0x1f0f('0xbe')],'as':_0x1f0f('0xbf'),'required':![]},{'model':db[_0x1f0f('0xc0')],'as':'Tags','attributes':['id','name',_0x1f0f('0xc1')],'where':_0x4b3b1b[_0x1f0f('0x4f')][_0x1f0f('0xc2')]?{'id':_0x4b3b1b[_0x1f0f('0x4f')]['tag']}:undefined,'required':_0x4b3b1b[_0x1f0f('0x4f')][_0x1f0f('0xc2')]?!![]:![]}];}if(!_0x4b3b1b['query']['hasOwnProperty'](_0x1f0f('0xc3'))){_0x20d45d['limit']=qs[_0x1f0f('0x2f')](_0x4b3b1b[_0x1f0f('0x4f')][_0x1f0f('0x2f')]);_0x20d45d[_0x1f0f('0x2e')]=qs[_0x1f0f('0x2e')](_0x4b3b1b[_0x1f0f('0x4f')]['offset']);}return _0x5db452['getContacts'](_0x20d45d);}})[_0x1f0f('0x20')](function(_0x44cb3b){if(_0x44cb3b){return _0x44cb3b?{'count':_0x18f458,'rows':_0x44cb3b}:null;}})[_0x1f0f('0x20')](respondWithResult(_0x272991,null))[_0x1f0f('0x2a')](handleError(_0x272991,null));};exports[_0x1f0f('0xc4')]=function(_0x13a4d9,_0xd142b2,_0x5eba90){var _0x58a1af;var _0x18e856;var _0x19592b={};var _0x45d5c3;return db['User']['findOne']({'where':{'id':_0x13a4d9['params']['id']},'attributes':['id',_0x1f0f('0x42'),'role']})[_0x1f0f('0x20')](handleEntityNotFound(_0xd142b2,null))[_0x1f0f('0x20')](function(_0x5c1ae6){if(!utils[_0x1f0f('0xc5')](_0x13a4d9[_0x1f0f('0x4f')][_0x1f0f('0x9a')])){throw new db[(_0x1f0f('0x92'))][(_0x1f0f('0x1e'))](_0x1f0f('0x9e'));}_0x58a1af=_0x5c1ae6;var _0x28107d={};_0x28107d[_0x1f0f('0x4b')]=_[_0x1f0f('0x50')](db[_[_0x1f0f('0xa0')](_0x13a4d9['query'][_0x1f0f('0x9a')])+_0x1f0f('0xc6')]['rawAttributes']);_0x28107d[_0x1f0f('0x4f')]=_['keys'](_0x13a4d9[_0x1f0f('0x4f')]);_0x28107d[_0x1f0f('0x58')]=_[_0x1f0f('0x64')](_0x28107d[_0x1f0f('0x4b')],_0x28107d['query']);_0x19592b[_0x1f0f('0x51')]=_[_0x1f0f('0x64')](_0x28107d[_0x1f0f('0x4b')],qs[_0x1f0f('0x52')](_0x13a4d9['query']['fields']));_0x19592b[_0x1f0f('0x51')]=_0x19592b[_0x1f0f('0x51')][_0x1f0f('0x53')]?_0x19592b[_0x1f0f('0x51')]:_0x28107d[_0x1f0f('0x4b')];_0x19592b[_0x1f0f('0x55')]=qs[_0x1f0f('0x56')](_0x13a4d9[_0x1f0f('0x4f')]['sort']);_0x19592b[_0x1f0f('0x57')]=qs[_0x1f0f('0x58')](_['pick'](_0x13a4d9[_0x1f0f('0x4f')],_0x28107d[_0x1f0f('0x58')]));if(_0x13a4d9['query'][_0x1f0f('0x3b')]){_0x19592b[_0x1f0f('0x57')]=_[_0x1f0f('0x5a')](_0x19592b[_0x1f0f('0x57')],{'$or':_[_0x1f0f('0x3d')](_0x19592b['attributes'],function(_0x3066d9){var _0x13b729={};_0x13b729[_0x3066d9]={'$like':'%'+_0x13a4d9['query']['filter']+'%'};return _0x13b729;})});}_0x19592b=_['merge']({},_0x19592b,_0x13a4d9['options']);switch(_0x58a1af[_0x1f0f('0x40')]){case _0x1f0f('0x6c'):return db[_['capitalize'](_0x13a4d9[_0x1f0f('0x4f')]['channel'])+_0x1f0f('0xc6')][_0x1f0f('0xaa')](_0x19592b);case _0x1f0f('0x37'):case _0x1f0f('0x6a'):return _0x58a1af['get'+_[_0x1f0f('0xa0')](_0x13a4d9[_0x1f0f('0x4f')][_0x1f0f('0x9a')])+_0x1f0f('0xa2')](_0x19592b);default:throw new db['Sequelize'][(_0x1f0f('0x1e'))]('Unknown\x20role');}})[_0x1f0f('0x20')](function(_0xd47dcb){_0x45d5c3=_0xd47dcb['length'];if(!_0x13a4d9['query']['hasOwnProperty'](_0x1f0f('0xc3'))){_0x19592b[_0x1f0f('0x2f')]=qs['limit'](_0x13a4d9[_0x1f0f('0x4f')][_0x1f0f('0x2f')]);_0x19592b['offset']=qs[_0x1f0f('0x2e')](_0x13a4d9[_0x1f0f('0x4f')][_0x1f0f('0x2e')]);}switch(_0x58a1af[_0x1f0f('0x40')]){case'admin':return db[_[_0x1f0f('0xa0')](_0x13a4d9['query'][_0x1f0f('0x9a')])+_0x1f0f('0xc6')][_0x1f0f('0xaa')](_0x19592b);case _0x1f0f('0x37'):case _0x1f0f('0x6a'):return _0x58a1af[_0x1f0f('0x8a')+_[_0x1f0f('0xa0')](_0x13a4d9[_0x1f0f('0x4f')][_0x1f0f('0x9a')])+_0x1f0f('0xa2')](_0x19592b);}})['then'](function(_0x3684da){return{'count':_0x45d5c3,'rows':_0x3684da};})['then'](respondWithResult(_0xd142b2,null))['catch'](handleError(_0xd142b2,null));};exports['getVoiceQueuesRt']=function(_0x1a381c,_0x884065,_0x1f3700){var _0x444d4e={};var _0x58307f={};var _0x199301;var _0x4a92cd;return db[_0x1f0f('0x46')]['findOne']({'where':{'id':_0x1a381c[_0x1f0f('0x63')]['id']}})[_0x1f0f('0x20')](handleEntityNotFound(_0x884065,null))['then'](function(_0x328dc9){if(_0x328dc9){_0x199301=_0x328dc9;_0x58307f[_0x1f0f('0x4b')]=_['keys'](db[_0x1f0f('0xb1')][_0x1f0f('0x47')]);_0x58307f['query']=_[_0x1f0f('0x50')](_0x1a381c[_0x1f0f('0x4f')]);_0x58307f['filters']=_['intersection'](_0x58307f[_0x1f0f('0x4b')],_0x58307f[_0x1f0f('0x4f')]);_0x444d4e[_0x1f0f('0x51')]=_[_0x1f0f('0x64')](_0x58307f[_0x1f0f('0x4b')],qs['fields'](_0x1a381c['query'][_0x1f0f('0x52')]));_0x444d4e[_0x1f0f('0x51')]=_0x444d4e['attributes'][_0x1f0f('0x53')]?_0x444d4e['attributes']:_0x58307f[_0x1f0f('0x4b')];_0x444d4e[_0x1f0f('0x55')]=qs[_0x1f0f('0x56')](_0x1a381c[_0x1f0f('0x4f')][_0x1f0f('0x56')]);_0x444d4e[_0x1f0f('0x57')]=qs[_0x1f0f('0x58')](_[_0x1f0f('0x59')](_0x1a381c[_0x1f0f('0x4f')],_0x58307f[_0x1f0f('0x58')]));if(_0x1a381c[_0x1f0f('0x4f')]['filter']){_0x444d4e[_0x1f0f('0x57')]=_['merge'](_0x444d4e['where'],{'$or':_['map'](_0x444d4e[_0x1f0f('0x51')],function(_0x1d151c){var _0xdf4392={};_0xdf4392[_0x1d151c]={'$like':'%'+_0x1a381c[_0x1f0f('0x4f')][_0x1f0f('0x3b')]+'%'};return _0xdf4392;})});}_0x444d4e=_[_0x1f0f('0x5a')]({},_0x444d4e,_0x1a381c[_0x1f0f('0xbd')]);return _0x199301['getVoiceQueuesRt'](_0x444d4e);}})[_0x1f0f('0x20')](function(_0x391680){if(_0x391680){_0x4a92cd=_0x391680[_0x1f0f('0x53')];if(!_0x1a381c[_0x1f0f('0x4f')][_0x1f0f('0x54')](_0x1f0f('0xc3'))){_0x444d4e[_0x1f0f('0x2f')]=qs[_0x1f0f('0x2f')](_0x1a381c['query'][_0x1f0f('0x2f')]);_0x444d4e[_0x1f0f('0x2e')]=qs['offset'](_0x1a381c[_0x1f0f('0x4f')][_0x1f0f('0x2e')]);}return _0x199301[_0x1f0f('0xc7')](_0x444d4e);}})[_0x1f0f('0x20')](function(_0x28a142){if(_0x28a142){return _0x28a142?{'count':_0x4a92cd,'rows':_0x28a142}:null;}})[_0x1f0f('0x20')](respondWithResult(_0x884065,null))[_0x1f0f('0x2a')](handleError(_0x884065,null));};exports['getGroups']=function(_0x2a8692,_0x206687,_0x1f5385){var _0x406a50={};var _0x20143a={};var _0x4d0f53;var _0x2f34e5;return db[_0x1f0f('0x46')][_0x1f0f('0x8f')]({'where':{'id':_0x2a8692['params']['id']}})[_0x1f0f('0x20')](handleEntityNotFound(_0x206687,null))[_0x1f0f('0x20')](function(_0x1e88ff){if(_0x1e88ff){_0x4d0f53=_0x1e88ff;_0x20143a[_0x1f0f('0x4b')]=_[_0x1f0f('0x50')](db[_0x1f0f('0xc8')][_0x1f0f('0x47')]);_0x20143a[_0x1f0f('0x4f')]=_[_0x1f0f('0x50')](_0x2a8692[_0x1f0f('0x4f')]);_0x20143a[_0x1f0f('0x58')]=_[_0x1f0f('0x64')](_0x20143a[_0x1f0f('0x4b')],_0x20143a[_0x1f0f('0x4f')]);_0x406a50[_0x1f0f('0x51')]=_[_0x1f0f('0x64')](_0x20143a['model'],qs[_0x1f0f('0x52')](_0x2a8692[_0x1f0f('0x4f')][_0x1f0f('0x52')]));_0x406a50[_0x1f0f('0x51')]=_0x406a50[_0x1f0f('0x51')][_0x1f0f('0x53')]?_0x406a50[_0x1f0f('0x51')]:_0x20143a[_0x1f0f('0x4b')];_0x406a50['order']=qs[_0x1f0f('0x56')](_0x2a8692[_0x1f0f('0x4f')][_0x1f0f('0x56')]);_0x406a50[_0x1f0f('0x57')]=qs[_0x1f0f('0x58')](_[_0x1f0f('0x59')](_0x2a8692[_0x1f0f('0x4f')],_0x20143a[_0x1f0f('0x58')]));if(_0x2a8692[_0x1f0f('0x4f')][_0x1f0f('0x3b')]){_0x406a50[_0x1f0f('0x57')]=_[_0x1f0f('0x5a')](_0x406a50[_0x1f0f('0x57')],{'$or':_[_0x1f0f('0x3d')](_0x406a50['attributes'],function(_0x3500de){var _0x19e998={};_0x19e998[_0x3500de]={'$like':'%'+_0x2a8692[_0x1f0f('0x4f')][_0x1f0f('0x3b')]+'%'};return _0x19e998;})});}_0x406a50=_[_0x1f0f('0x5a')]({},_0x406a50,_0x2a8692[_0x1f0f('0xbd')]);return _0x4d0f53[_0x1f0f('0xc9')](_0x406a50);}})[_0x1f0f('0x20')](function(_0xad2450){if(_0xad2450){_0x2f34e5=_0xad2450[_0x1f0f('0x53')];if(!_0x2a8692[_0x1f0f('0x4f')][_0x1f0f('0x54')](_0x1f0f('0xc3'))){_0x406a50['limit']=qs['limit'](_0x2a8692[_0x1f0f('0x4f')][_0x1f0f('0x2f')]);_0x406a50['offset']=qs[_0x1f0f('0x2e')](_0x2a8692[_0x1f0f('0x4f')][_0x1f0f('0x2e')]);}return _0x4d0f53[_0x1f0f('0xc9')](_0x406a50);}})[_0x1f0f('0x20')](function(_0x1bf5eb){if(_0x1bf5eb){return _0x1bf5eb?{'count':_0x2f34e5,'rows':_0x1bf5eb}:null;}})[_0x1f0f('0x20')](respondWithResult(_0x206687,null))[_0x1f0f('0x2a')](handleError(_0x206687,null));};exports[_0x1f0f('0xca')]=function(_0x1dfe2c,_0x53ff96,_0x32fa49){var _0x2efff2={'raw':!![],'where':{}};var _0x4f30cb={};var _0x1b8ec1={'count':0x0,'rows':[]};return db[_0x1f0f('0x46')][_0x1f0f('0x8f')]({'where':{'id':_0x1dfe2c[_0x1f0f('0x63')]['id']}})[_0x1f0f('0x20')](handleEntityNotFound(_0x53ff96,null))['then'](function(_0x51950f){if(_0x51950f){_0x4f30cb[_0x1f0f('0x4b')]=_[_0x1f0f('0x50')](db[_0x1f0f('0xcb')][_0x1f0f('0x47')]);_0x4f30cb[_0x1f0f('0x4f')]=_[_0x1f0f('0x50')](_0x1dfe2c['query']);_0x4f30cb[_0x1f0f('0x58')]=_[_0x1f0f('0x64')](_0x4f30cb[_0x1f0f('0x4b')],_0x4f30cb[_0x1f0f('0x4f')]);_0x2efff2[_0x1f0f('0x51')]=_[_0x1f0f('0x64')](_0x4f30cb[_0x1f0f('0x4b')],qs[_0x1f0f('0x52')](_0x1dfe2c['query'][_0x1f0f('0x52')]));_0x2efff2[_0x1f0f('0x51')]=_0x2efff2[_0x1f0f('0x51')][_0x1f0f('0x53')]?_0x2efff2[_0x1f0f('0x51')]:_0x4f30cb[_0x1f0f('0x4b')];if(!_0x1dfe2c[_0x1f0f('0x4f')][_0x1f0f('0x54')](_0x1f0f('0xc3'))){_0x2efff2[_0x1f0f('0x2f')]=qs['limit'](_0x1dfe2c['query']['limit']);_0x2efff2['offset']=qs[_0x1f0f('0x2e')](_0x1dfe2c[_0x1f0f('0x4f')]['offset']);}_0x2efff2[_0x1f0f('0x55')]=qs[_0x1f0f('0x56')](_0x1dfe2c['query'][_0x1f0f('0x56')]);_0x2efff2[_0x1f0f('0x57')]=qs[_0x1f0f('0x58')](_[_0x1f0f('0x59')](_0x1dfe2c['query'],_0x4f30cb[_0x1f0f('0x58')]));_0x2efff2[_0x1f0f('0x57')][_0x1f0f('0xcc')]=_0x51950f['id'];if(_0x1dfe2c[_0x1f0f('0x4f')]['filter']){_0x2efff2[_0x1f0f('0x57')]=_['merge'](_0x2efff2['where'],{'$or':_['map'](_0x2efff2[_0x1f0f('0x51')],function(_0x5a2ec1){var _0x3d22ed={};_0x3d22ed[_0x5a2ec1]={'$like':'%'+_0x1dfe2c[_0x1f0f('0x4f')][_0x1f0f('0x3b')]+'%'};return _0x3d22ed;})});}_0x2efff2=_[_0x1f0f('0x5a')]({},_0x2efff2,_0x1dfe2c[_0x1f0f('0xbd')]);return db['VoiceRecording'][_0x1f0f('0x5f')]({'where':_0x2efff2[_0x1f0f('0x57')]})[_0x1f0f('0x20')](function(_0x124024){_0x1b8ec1['count']=_0x124024;if(_0x1dfe2c[_0x1f0f('0x4f')][_0x1f0f('0x60')]){_0x2efff2[_0x1f0f('0x61')]=[{'all':!![]}];}return db[_0x1f0f('0xcb')][_0x1f0f('0xaa')](_0x2efff2);})['then'](function(_0x36b4d5){_0x1b8ec1[_0x1f0f('0x62')]=_0x36b4d5;return _0x1b8ec1;});}})[_0x1f0f('0x20')](respondWithFilteredResult(_0x53ff96,_0x2efff2))[_0x1f0f('0x2a')](handleError(_0x53ff96,null));};exports[_0x1f0f('0xcd')]=function(_0x2bdfaa,_0x3700f9,_0x55ab9b){var _0x2a7571={'raw':!![],'where':{}};var _0x2ceac4={};var _0x4cee55={'count':0x0,'rows':[]};return db[_0x1f0f('0x46')]['findOne']({'where':{'id':_0x2bdfaa[_0x1f0f('0x63')]['id']}})[_0x1f0f('0x20')](handleEntityNotFound(_0x3700f9,null))['then'](function(_0x2eddc4){if(_0x2eddc4){_0x2ceac4['model']=_['keys'](db[_0x1f0f('0xce')][_0x1f0f('0x47')]);_0x2ceac4[_0x1f0f('0x4f')]=_[_0x1f0f('0x50')](_0x2bdfaa['query']);_0x2ceac4['filters']=_[_0x1f0f('0x64')](_0x2ceac4[_0x1f0f('0x4b')],_0x2ceac4[_0x1f0f('0x4f')]);_0x2a7571[_0x1f0f('0x51')]=_[_0x1f0f('0x64')](_0x2ceac4[_0x1f0f('0x4b')],qs[_0x1f0f('0x52')](_0x2bdfaa[_0x1f0f('0x4f')][_0x1f0f('0x52')]));_0x2a7571[_0x1f0f('0x51')]=_0x2a7571['attributes']['length']?_0x2a7571[_0x1f0f('0x51')]:_0x2ceac4['model'];if(!_0x2bdfaa[_0x1f0f('0x4f')][_0x1f0f('0x54')](_0x1f0f('0xc3'))){_0x2a7571[_0x1f0f('0x2f')]=qs[_0x1f0f('0x2f')](_0x2bdfaa[_0x1f0f('0x4f')][_0x1f0f('0x2f')]);_0x2a7571[_0x1f0f('0x2e')]=qs['offset'](_0x2bdfaa[_0x1f0f('0x4f')]['offset']);}_0x2a7571[_0x1f0f('0x55')]=qs[_0x1f0f('0x56')](_0x2bdfaa[_0x1f0f('0x4f')][_0x1f0f('0x56')]);_0x2a7571[_0x1f0f('0x57')]=qs['filters'](_['pick'](_0x2bdfaa['query'],_0x2ceac4[_0x1f0f('0x58')]));_0x2a7571[_0x1f0f('0x57')][_0x1f0f('0xcc')]=_0x2eddc4['id'];if(_0x2bdfaa[_0x1f0f('0x4f')][_0x1f0f('0x3b')]){_0x2a7571['where']=_[_0x1f0f('0x5a')](_0x2a7571['where'],{'$or':_[_0x1f0f('0x3d')](_0x2a7571[_0x1f0f('0x51')],function(_0x5a8518){var _0x18be84={};_0x18be84[_0x5a8518]={'$like':'%'+_0x2bdfaa['query']['filter']+'%'};return _0x18be84;})});}_0x2a7571=_['merge']({},_0x2a7571,_0x2bdfaa[_0x1f0f('0xbd')]);return db[_0x1f0f('0xce')][_0x1f0f('0x5f')]({'where':_0x2a7571['where']})[_0x1f0f('0x20')](function(_0x346a4b){_0x4cee55[_0x1f0f('0x5f')]=_0x346a4b;if(_0x2bdfaa[_0x1f0f('0x4f')]['includeAll']){_0x2a7571[_0x1f0f('0x61')]=[{'all':!![]}];}return db[_0x1f0f('0xce')]['findAll'](_0x2a7571);})[_0x1f0f('0x20')](function(_0x2bcb52){_0x4cee55[_0x1f0f('0x62')]=_0x2bcb52;return _0x4cee55;});}})[_0x1f0f('0x20')](respondWithFilteredResult(_0x3700f9,_0x2a7571))['catch'](handleError(_0x3700f9,null));};exports[_0x1f0f('0xcf')]=function(_0x55eb01,_0x23c8a9,_0x286d70){var _0x48d7ea={};var _0x437f63={};var _0x49bdee;var _0x4b7a58;return db[_0x1f0f('0x46')][_0x1f0f('0x8f')]({'where':{'id':_0x55eb01[_0x1f0f('0x63')]['id']}})[_0x1f0f('0x20')](handleEntityNotFound(_0x23c8a9,null))['then'](function(_0x2af6d1){if(_0x2af6d1){_0x49bdee=_0x2af6d1;_0x437f63[_0x1f0f('0x4b')]=_[_0x1f0f('0x50')](db[_0x1f0f('0xd0')][_0x1f0f('0x47')]);_0x437f63[_0x1f0f('0x4f')]=_['keys'](_0x55eb01[_0x1f0f('0x4f')]);_0x437f63['filters']=_[_0x1f0f('0x64')](_0x437f63['model'],_0x437f63['query']);_0x48d7ea[_0x1f0f('0x51')]=_[_0x1f0f('0x64')](_0x437f63[_0x1f0f('0x4b')],qs[_0x1f0f('0x52')](_0x55eb01[_0x1f0f('0x4f')]['fields']));_0x48d7ea['attributes']=_0x48d7ea['attributes'][_0x1f0f('0x53')]?_0x48d7ea[_0x1f0f('0x51')]:_0x437f63['model'];_0x48d7ea[_0x1f0f('0x55')]=qs[_0x1f0f('0x56')](_0x55eb01[_0x1f0f('0x4f')][_0x1f0f('0x56')]);_0x48d7ea[_0x1f0f('0x57')]=qs['filters'](_['pick'](_0x55eb01[_0x1f0f('0x4f')],_0x437f63[_0x1f0f('0x58')]));if(_0x55eb01[_0x1f0f('0x4f')][_0x1f0f('0x3b')]){_0x48d7ea['where']=_['merge'](_0x48d7ea[_0x1f0f('0x57')],{'$or':_[_0x1f0f('0x3d')](_0x48d7ea['attributes'],function(_0x320e57){var _0x5c53d5={};_0x5c53d5[_0x320e57]={'$like':'%'+_0x55eb01[_0x1f0f('0x4f')][_0x1f0f('0x3b')]+'%'};return _0x5c53d5;})});}_0x48d7ea=_[_0x1f0f('0x5a')]({},_0x48d7ea,_0x55eb01[_0x1f0f('0xbd')]);return _0x49bdee['getChatInteractions'](_0x48d7ea);}})[_0x1f0f('0x20')](function(_0x23de74){if(_0x23de74){_0x4b7a58=_0x23de74[_0x1f0f('0x53')];if(!_0x55eb01['query']['hasOwnProperty'](_0x1f0f('0xc3'))){_0x48d7ea[_0x1f0f('0x2f')]=qs['limit'](_0x55eb01[_0x1f0f('0x4f')][_0x1f0f('0x2f')]);_0x48d7ea['offset']=qs['offset'](_0x55eb01[_0x1f0f('0x4f')]['offset']);}return _0x49bdee['getChatInteractions'](_0x48d7ea);}})[_0x1f0f('0x20')](function(_0x4df28d){if(_0x4df28d){return _0x4df28d?{'count':_0x4b7a58,'rows':_0x4df28d}:null;}})[_0x1f0f('0x20')](respondWithResult(_0x23c8a9,null))['catch'](handleError(_0x23c8a9,null));};exports[_0x1f0f('0xd1')]=function(_0x4c9eb9,_0x4ded78,_0x2be563){var _0x539489={};var _0x294de8={};var _0x2afced;var _0x5859c4;return db[_0x1f0f('0x46')]['findOne']({'where':{'id':_0x4c9eb9[_0x1f0f('0x63')]['id']}})[_0x1f0f('0x20')](handleEntityNotFound(_0x4ded78,null))['then'](function(_0x3a9fb3){if(_0x3a9fb3){_0x2afced=_0x3a9fb3;_0x294de8['model']=_[_0x1f0f('0x50')](db[_0x1f0f('0xd2')][_0x1f0f('0x47')]);_0x294de8[_0x1f0f('0x4f')]=_['keys'](_0x4c9eb9[_0x1f0f('0x4f')]);_0x294de8['filters']=_['intersection'](_0x294de8['model'],_0x294de8[_0x1f0f('0x4f')]);_0x539489[_0x1f0f('0x51')]=_[_0x1f0f('0x64')](_0x294de8[_0x1f0f('0x4b')],qs[_0x1f0f('0x52')](_0x4c9eb9['query'][_0x1f0f('0x52')]));_0x539489['attributes']=_0x539489[_0x1f0f('0x51')][_0x1f0f('0x53')]?_0x539489[_0x1f0f('0x51')]:_0x294de8[_0x1f0f('0x4b')];_0x539489[_0x1f0f('0x55')]=qs[_0x1f0f('0x56')](_0x4c9eb9[_0x1f0f('0x4f')]['sort']);_0x539489[_0x1f0f('0x57')]=qs['filters'](_[_0x1f0f('0x59')](_0x4c9eb9[_0x1f0f('0x4f')],_0x294de8[_0x1f0f('0x58')]));if(_0x4c9eb9['query'][_0x1f0f('0x3b')]){_0x539489[_0x1f0f('0x57')]=_[_0x1f0f('0x5a')](_0x539489[_0x1f0f('0x57')],{'$or':_['map'](_0x539489['attributes'],function(_0x43d9c2){var _0x21866f={};_0x21866f[_0x43d9c2]={'$like':'%'+_0x4c9eb9['query'][_0x1f0f('0x3b')]+'%'};return _0x21866f;})});}_0x539489=_['merge']({},_0x539489,_0x4c9eb9[_0x1f0f('0xbd')]);return _0x2afced[_0x1f0f('0xd1')](_0x539489);}})[_0x1f0f('0x20')](function(_0x2f9a41){if(_0x2f9a41){_0x5859c4=_0x2f9a41['length'];if(!_0x4c9eb9[_0x1f0f('0x4f')]['hasOwnProperty'](_0x1f0f('0xc3'))){_0x539489[_0x1f0f('0x2f')]=qs['limit'](_0x4c9eb9['query'][_0x1f0f('0x2f')]);_0x539489[_0x1f0f('0x2e')]=qs['offset'](_0x4c9eb9['query']['offset']);}return _0x2afced[_0x1f0f('0xd1')](_0x539489);}})[_0x1f0f('0x20')](function(_0xee3d86){if(_0xee3d86){return _0xee3d86?{'count':_0x5859c4,'rows':_0xee3d86}:null;}})[_0x1f0f('0x20')](respondWithResult(_0x4ded78,null))['catch'](handleError(_0x4ded78,null));};exports[_0x1f0f('0xd3')]=function(_0x2e0cb6,_0x14ce61,_0x1fe0ec){var _0x289b22={'raw':!![],'where':{}};var _0x15662f={};var _0x490a66={'count':0x0,'rows':[]};return db[_0x1f0f('0x46')][_0x1f0f('0x8f')]({'where':{'id':_0x2e0cb6[_0x1f0f('0x63')]['id']}})[_0x1f0f('0x20')](handleEntityNotFound(_0x14ce61,null))['then'](function(_0x9c487b){if(_0x9c487b){_0x15662f[_0x1f0f('0x4b')]=_[_0x1f0f('0x50')](db[_0x1f0f('0xd4')][_0x1f0f('0x47')]);_0x15662f[_0x1f0f('0x4f')]=_[_0x1f0f('0x50')](_0x2e0cb6[_0x1f0f('0x4f')]);_0x15662f[_0x1f0f('0x58')]=_[_0x1f0f('0x64')](_0x15662f[_0x1f0f('0x4b')],_0x15662f[_0x1f0f('0x4f')]);_0x289b22[_0x1f0f('0x51')]=_[_0x1f0f('0x64')](_0x15662f[_0x1f0f('0x4b')],qs[_0x1f0f('0x52')](_0x2e0cb6[_0x1f0f('0x4f')][_0x1f0f('0x52')]));_0x289b22[_0x1f0f('0x51')]=_0x289b22[_0x1f0f('0x51')][_0x1f0f('0x53')]?_0x289b22['attributes']:_0x15662f[_0x1f0f('0x4b')];if(!_0x2e0cb6[_0x1f0f('0x4f')][_0x1f0f('0x54')](_0x1f0f('0xc3'))){_0x289b22[_0x1f0f('0x2f')]=qs['limit'](_0x2e0cb6['query'][_0x1f0f('0x2f')]);_0x289b22[_0x1f0f('0x2e')]=qs['offset'](_0x2e0cb6[_0x1f0f('0x4f')]['offset']);}_0x289b22['order']=qs[_0x1f0f('0x56')](_0x2e0cb6[_0x1f0f('0x4f')][_0x1f0f('0x56')]);_0x289b22[_0x1f0f('0x57')]=qs[_0x1f0f('0x58')](_['pick'](_0x2e0cb6[_0x1f0f('0x4f')],_0x15662f[_0x1f0f('0x58')]));_0x289b22[_0x1f0f('0x57')][_0x1f0f('0xcc')]=_0x9c487b['id'];if(_0x2e0cb6['query'][_0x1f0f('0x3b')]){_0x289b22[_0x1f0f('0x57')]=_[_0x1f0f('0x5a')](_0x289b22['where'],{'$or':_[_0x1f0f('0x3d')](_0x289b22[_0x1f0f('0x51')],function(_0x1fe3b8){var _0x28a441={};_0x28a441[_0x1fe3b8]={'$like':'%'+_0x2e0cb6[_0x1f0f('0x4f')][_0x1f0f('0x3b')]+'%'};return _0x28a441;})});}_0x289b22=_[_0x1f0f('0x5a')]({},_0x289b22,_0x2e0cb6[_0x1f0f('0xbd')]);return db[_0x1f0f('0xd4')][_0x1f0f('0x5f')]({'where':_0x289b22['where']})['then'](function(_0xb8021c){_0x490a66[_0x1f0f('0x5f')]=_0xb8021c;if(_0x2e0cb6[_0x1f0f('0x4f')]['includeAll']){_0x289b22[_0x1f0f('0x61')]=[{'all':!![]}];}return db[_0x1f0f('0xd4')]['findAll'](_0x289b22);})['then'](function(_0x4087ea){_0x490a66['rows']=_0x4087ea;return _0x490a66;});}})['then'](respondWithFilteredResult(_0x14ce61,_0x289b22))[_0x1f0f('0x2a')](handleError(_0x14ce61,null));};exports[_0x1f0f('0xd5')]=function(_0x4fe40c,_0x2a7e61,_0xea2a1e){var _0x44ddc5={};var _0x238377={};var _0x19a728;var _0x571f9a;return db[_0x1f0f('0x46')]['findOne']({'where':{'id':_0x4fe40c[_0x1f0f('0x63')]['id']}})[_0x1f0f('0x20')](handleEntityNotFound(_0x2a7e61,null))[_0x1f0f('0x20')](function(_0x1907c9){if(_0x1907c9){_0x19a728=_0x1907c9;_0x238377[_0x1f0f('0x4b')]=_[_0x1f0f('0x50')](db[_0x1f0f('0xd6')][_0x1f0f('0x47')]);_0x238377['query']=_['keys'](_0x4fe40c[_0x1f0f('0x4f')]);_0x238377[_0x1f0f('0x58')]=_['intersection'](_0x238377[_0x1f0f('0x4b')],_0x238377[_0x1f0f('0x4f')]);_0x44ddc5[_0x1f0f('0x51')]=_[_0x1f0f('0x64')](_0x238377[_0x1f0f('0x4b')],qs[_0x1f0f('0x52')](_0x4fe40c['query'][_0x1f0f('0x52')]));_0x44ddc5['attributes']=_0x44ddc5[_0x1f0f('0x51')][_0x1f0f('0x53')]?_0x44ddc5[_0x1f0f('0x51')]:_0x238377[_0x1f0f('0x4b')];_0x44ddc5[_0x1f0f('0x55')]=qs[_0x1f0f('0x56')](_0x4fe40c[_0x1f0f('0x4f')][_0x1f0f('0x56')]);_0x44ddc5['where']=qs[_0x1f0f('0x58')](_['pick'](_0x4fe40c[_0x1f0f('0x4f')],_0x238377['filters']));if(_0x4fe40c['query'][_0x1f0f('0x3b')]){_0x44ddc5[_0x1f0f('0x57')]=_[_0x1f0f('0x5a')](_0x44ddc5[_0x1f0f('0x57')],{'$or':_[_0x1f0f('0x3d')](_0x44ddc5[_0x1f0f('0x51')],function(_0x101638){var _0x1f551={};_0x1f551[_0x101638]={'$like':'%'+_0x4fe40c[_0x1f0f('0x4f')][_0x1f0f('0x3b')]+'%'};return _0x1f551;})});}_0x44ddc5=_[_0x1f0f('0x5a')]({},_0x44ddc5,_0x4fe40c['options']);return _0x19a728[_0x1f0f('0xd5')](_0x44ddc5);}})[_0x1f0f('0x20')](function(_0x4c2100){if(_0x4c2100){_0x571f9a=_0x4c2100[_0x1f0f('0x53')];if(!_0x4fe40c[_0x1f0f('0x4f')][_0x1f0f('0x54')](_0x1f0f('0xc3'))){_0x44ddc5[_0x1f0f('0x2f')]=qs[_0x1f0f('0x2f')](_0x4fe40c[_0x1f0f('0x4f')][_0x1f0f('0x2f')]);_0x44ddc5[_0x1f0f('0x2e')]=qs[_0x1f0f('0x2e')](_0x4fe40c[_0x1f0f('0x4f')][_0x1f0f('0x2e')]);}return _0x19a728[_0x1f0f('0xd5')](_0x44ddc5);}})[_0x1f0f('0x20')](function(_0xfb2f68){if(_0xfb2f68){return _0xfb2f68?{'count':_0x571f9a,'rows':_0xfb2f68}:null;}})[_0x1f0f('0x20')](respondWithResult(_0x2a7e61,null))[_0x1f0f('0x2a')](handleError(_0x2a7e61,null));};exports[_0x1f0f('0xd7')]=function(_0xa18deb,_0x537b75,_0x12f271){var _0x8647a4={};var _0x13240f={};var _0x4f2480;var _0x48aefc;return db[_0x1f0f('0x46')][_0x1f0f('0x8f')]({'where':{'id':_0xa18deb[_0x1f0f('0x63')]['id']}})[_0x1f0f('0x20')](handleEntityNotFound(_0x537b75,null))[_0x1f0f('0x20')](function(_0x2a9228){if(_0x2a9228){_0x4f2480=_0x2a9228;_0x13240f[_0x1f0f('0x4b')]=_[_0x1f0f('0x50')](db[_0x1f0f('0xd8')]['rawAttributes']);_0x13240f[_0x1f0f('0x4f')]=_[_0x1f0f('0x50')](_0xa18deb[_0x1f0f('0x4f')]);_0x13240f[_0x1f0f('0x58')]=_[_0x1f0f('0x64')](_0x13240f[_0x1f0f('0x4b')],_0x13240f[_0x1f0f('0x4f')]);_0x8647a4[_0x1f0f('0x51')]=_[_0x1f0f('0x64')](_0x13240f[_0x1f0f('0x4b')],qs[_0x1f0f('0x52')](_0xa18deb['query']['fields']));_0x8647a4[_0x1f0f('0x51')]=_0x8647a4[_0x1f0f('0x51')][_0x1f0f('0x53')]?_0x8647a4[_0x1f0f('0x51')]:_0x13240f[_0x1f0f('0x4b')];_0x8647a4[_0x1f0f('0x55')]=qs[_0x1f0f('0x56')](_0xa18deb[_0x1f0f('0x4f')][_0x1f0f('0x56')]);_0x8647a4[_0x1f0f('0x57')]=qs[_0x1f0f('0x58')](_[_0x1f0f('0x59')](_0xa18deb[_0x1f0f('0x4f')],_0x13240f[_0x1f0f('0x58')]));if(_0xa18deb[_0x1f0f('0x4f')]['filter']){_0x8647a4[_0x1f0f('0x57')]=_[_0x1f0f('0x5a')](_0x8647a4[_0x1f0f('0x57')],{'$or':_[_0x1f0f('0x3d')](_0x8647a4[_0x1f0f('0x51')],function(_0x4e4688){var _0x216846={};_0x216846[_0x4e4688]={'$like':'%'+_0xa18deb[_0x1f0f('0x4f')][_0x1f0f('0x3b')]+'%'};return _0x216846;})});}_0x8647a4=_[_0x1f0f('0x5a')]({},_0x8647a4,_0xa18deb[_0x1f0f('0xbd')]);return _0x4f2480['getFaxInteractions'](_0x8647a4);}})[_0x1f0f('0x20')](function(_0x3700a1){if(_0x3700a1){_0x48aefc=_0x3700a1[_0x1f0f('0x53')];if(!_0xa18deb['query'][_0x1f0f('0x54')](_0x1f0f('0xc3'))){_0x8647a4[_0x1f0f('0x2f')]=qs[_0x1f0f('0x2f')](_0xa18deb[_0x1f0f('0x4f')]['limit']);_0x8647a4[_0x1f0f('0x2e')]=qs['offset'](_0xa18deb[_0x1f0f('0x4f')][_0x1f0f('0x2e')]);}return _0x4f2480[_0x1f0f('0xd7')](_0x8647a4);}})['then'](function(_0x5b6dd5){if(_0x5b6dd5){return _0x5b6dd5?{'count':_0x48aefc,'rows':_0x5b6dd5}:null;}})[_0x1f0f('0x20')](respondWithResult(_0x537b75,null))['catch'](handleError(_0x537b75,null));};exports['login']=function(_0x3d4166,_0x159ae1,_0x4f464e){var _0x2cedc1;var _0x745d9b;var _0x2f8660;var _0x4d70ba=!_[_0x1f0f('0x71')](_0x3d4166[_0x1f0f('0x63')]['id'])?_0x3d4166[_0x1f0f('0x63')]['id']:!_[_0x1f0f('0x71')](_0x3d4166['user']['id'])?_0x3d4166[_0x1f0f('0x37')]['id']:null;return db[_0x1f0f('0x46')]['find']({'where':{'id':_0x4d70ba,'role':{'$or':['admin','user',_0x1f0f('0x6a')]}},'attributes':['id',_0x1f0f('0x42'),_0x1f0f('0xd9'),_0x1f0f('0xda'),'role',_0x1f0f('0x74'),_0x1f0f('0x9c')]})[_0x1f0f('0x20')](function(_0x39d922){if(_0x39d922){if(_0x39d922[_0x1f0f('0x40')]===_0x1f0f('0x6a')){_0x2cedc1=_0x39d922;if(_0x3d4166[_0x1f0f('0x66')][_0x1f0f('0xad')]){_0x2f8660=util[_0x1f0f('0xdb')](_0x1f0f('0xdc'),_0x2cedc1[_0x3d4166[_0x1f0f('0x66')][_0x1f0f('0xad')]]);}else if(_0x3d4166[_0x1f0f('0x66')][_0x1f0f('0xdd')]){_0x2f8660=util['format'](_0x1f0f('0xac'),_0x3d4166['body']['intrf']);}else{_0x2f8660=util[_0x1f0f('0xdb')]('SIP/%s',_0x2cedc1[_0x1f0f('0x42')]);}socket['to'](util[_0x1f0f('0xdb')](_0x1f0f('0xde'),_0x2cedc1[_0x1f0f('0x42')]))[_0x1f0f('0xa6')](_0x1f0f('0xdf'),{'ip':_0x3d4166[_0x1f0f('0xe0')][_0x1f0f('0xe1')]||_0x3d4166['connection'][_0x1f0f('0xe2')]||_0x3d4166[_0x1f0f('0xe3')][_0x1f0f('0xe2')]||_0x3d4166[_0x1f0f('0xe4')][_0x1f0f('0xe3')][_0x1f0f('0xe2')]});return db[_0x1f0f('0xb1')][_0x1f0f('0x35')]({'where':{'membername':_0x2cedc1[_0x1f0f('0x42')]},'individualHooks':!![]});}}else{throw new db[(_0x1f0f('0x92'))]['ValidationError'](_0x1f0f('0xe5'));}})['then'](function(){if(_0x2cedc1){return _0x2cedc1['getVoiceQueues']({'raw':!![]});}})[_0x1f0f('0x20')](function(_0x179fa7){if(_0x2cedc1){var _0x2bbc35=[];if(_0x179fa7){_0x745d9b=_0x179fa7;if(_0x745d9b[_0x1f0f('0x53')]){for(var _0x40c30c=0x0;_0x40c30c<_0x745d9b[_0x1f0f('0x53')];_0x40c30c++){_0x2bbc35[_0x1f0f('0xab')]({'membername':_0x2cedc1[_0x1f0f('0x42')],'UserId':_0x2cedc1['id'],'queue_name':_0x745d9b[_0x40c30c][_0x1f0f('0x42')],'VoiceQueueId':_0x745d9b[_0x40c30c]['id'],'interface':_0x2f8660,'paused':_0x2cedc1[_0x1f0f('0x9c')]||![],'penalty':_0x745d9b[_0x40c30c][_0x1f0f('0xe6')]||0x0});}return BPromise[_0x1f0f('0xe7')](_0x2bbc35,function(_0x57bec4){return db[_0x1f0f('0xb1')][_0x1f0f('0xae')](_0x57bec4);});}}}})['then'](function(){if(_0x2cedc1){return db[_0x1f0f('0xe8')]['findAll']({'where':{'membername':_0x2cedc1['name'],'exitAt':null}});}})['then'](function(_0x9ec3f4){if(_0x2cedc1){var _0x3c4694=[];_0x9ec3f4['forEach'](function(_0x23edc8){_0x3c4694[_0x1f0f('0xab')](_0x23edc8['update']({'exitAt':moment()[_0x1f0f('0xdb')](_0x1f0f('0xe9'))}));});return BPromise['all'](_0x3c4694);}})[_0x1f0f('0x20')](function(){if(_0x2cedc1){var _0x2a5b40=[];var _0x155763=[];var _0x2b8a0a=utils[_0x1f0f('0xea')]();var _0x170e55={'membername':_0x2cedc1[_0x1f0f('0x42')],'interface':_0x2f8660,'enterAt':moment()[_0x1f0f('0xdb')](_0x1f0f('0xe9')),'role':_0x2cedc1[_0x1f0f('0x40')],'internal':_0x2cedc1['internal']};_0x2b8a0a[_0x1f0f('0xeb')](function(_0x2eb962){_0x2a5b40['push'](_[_0x1f0f('0x5a')]({'channel':_0x2eb962,'type':_0x1f0f('0xec'),'data1':_0x3d4166[_0x1f0f('0x66')][_0x1f0f('0xed')],'data2':_0x2f8660},_0x170e55));if(_0x2cedc1[_0x1f0f('0x9c')]){_0x155763[_0x1f0f('0xab')](_[_0x1f0f('0x5a')]({'channel':_0x2eb962,'type':'PAUSE','data1':_0x1f0f('0xee')},_0x170e55));}});return db[_0x1f0f('0xe8')][_0x1f0f('0x65')](_0x2a5b40[_0x1f0f('0xef')](_0x155763),{'individualHooks':!![]});}})['then'](function(){if(_0x2cedc1){return _0x2cedc1[_0x1f0f('0x34')]({'online':!![],'lastLoginAt':moment()[_0x1f0f('0xdb')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x2cedc1[_0x1f0f('0x9c')]||![],'mailPause':_0x2cedc1[_0x1f0f('0x9c')]||![],'chatPause':_0x2cedc1[_0x1f0f('0x9c')]||![],'faxPause':_0x2cedc1[_0x1f0f('0x9c')]||![],'smsPause':_0x2cedc1[_0x1f0f('0x9c')]||![],'openchannelPause':_0x2cedc1[_0x1f0f('0x9c')]||![],'pauseType':_0x2cedc1[_0x1f0f('0x9c')]?_0x1f0f('0xee'):null,'interface':_0x2f8660,'lastPauseAt':moment()[_0x1f0f('0xdb')](_0x1f0f('0xe9'))});}})['then'](function(_0x1ee1b2){if(_0x3d4166[_0x1f0f('0xf0')]){return _0x4f464e();}else{return BPromise[_0x1f0f('0xf1')](_0x1ee1b2)[_0x1f0f('0x20')](respondWithResult(_0x159ae1,null));}})['catch'](handleError(_0x159ae1,null));};exports['logout']=function(_0x45da57,_0x34b854,_0x34b7f5){var _0x3b8dfc;return db[_0x1f0f('0x46')][_0x1f0f('0x41')]({'where':{'id':_0x45da57[_0x1f0f('0x63')]['id'],'role':_0x1f0f('0x6a')},'attributes':['id',_0x1f0f('0x42'),'role']})['then'](handleEntityNotFound(_0x34b854,null))[_0x1f0f('0x20')](function(_0x2190f7){if(_0x2190f7){_0x3b8dfc=_0x2190f7;return db[_0x1f0f('0xb1')][_0x1f0f('0x35')]({'where':{'membername':_0x3b8dfc[_0x1f0f('0x42')]},'individualHooks':!![]});}})[_0x1f0f('0x20')](function(){return db[_0x1f0f('0xe8')][_0x1f0f('0xaa')]({'where':{'membername':_0x3b8dfc[_0x1f0f('0x42')],'exitAt':null}});})['then'](function(_0xfd8641){var _0x1205ef=[];_0xfd8641[_0x1f0f('0xeb')](function(_0x1bf5f8){_0x1205ef[_0x1f0f('0xab')](_0x1bf5f8[_0x1f0f('0x34')]({'exitAt':moment()[_0x1f0f('0xdb')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x1f0f('0xf2')](_0x1205ef);})[_0x1f0f('0x20')](function(){return _0x3b8dfc[_0x1f0f('0x34')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'interface':null});})['then'](respondWithResult(_0x34b854,null))[_0x1f0f('0x2a')](handleError(_0x34b854,null));};exports[_0x1f0f('0xf3')]=function(_0x4e2e9d,_0x2e401c,_0x2ea8ab){var _0x1bd78e;return db['UserVoiceQueueRt'][_0x1f0f('0x34')]({'paused':0x1},{'where':{'UserId':_0x4e2e9d[_0x1f0f('0x63')]['id']},'individualHooks':!![]})[_0x1f0f('0x20')](function(){return db[_0x1f0f('0x46')][_0x1f0f('0x41')]({'where':{'id':_0x4e2e9d[_0x1f0f('0x63')]['id'],'role':'agent'},'attributes':['id',_0x1f0f('0x42'),_0x1f0f('0x40'),_0x1f0f('0x74'),_0x1f0f('0xad')]});})[_0x1f0f('0x20')](handleEntityNotFound(_0x2e401c,null))['then'](function(_0x28729d){if(_0x28729d){_0x1bd78e=_0x28729d;return respondWithRpcPromise('QueuePause',_0x1f0f('0xf3'),{'id':_0x1bd78e['id'],'name':_0x1bd78e['name'],'pause':!![]});}})['then'](function(){if(_0x1bd78e){return db[_0x1f0f('0xe8')]['findAll']({'where':{'membername':_0x1bd78e[_0x1f0f('0x42')],'type':'PAUSE','exitAt':null}});}})[_0x1f0f('0x20')](function(_0x289399){if(_0x289399[_0x1f0f('0x53')]){var _0x1ede79=moment()[_0x1f0f('0xdb')](_0x1f0f('0xe9'));for(var _0x382cf9=0x0,_0x4a16ac=_0x289399[_0x1f0f('0x53')];_0x382cf9<_0x4a16ac;_0x382cf9++){_0x289399[_0x382cf9][_0x1f0f('0xf4')]({'exitAt':_0x1ede79});}}})['then'](function(){var _0x4ea9d1=[];var _0x23be51=utils[_0x1f0f('0xea')]();_0x23be51[_0x1f0f('0xeb')](function(_0x293b8a){_0x4ea9d1[_0x1f0f('0xab')]({'channel':_0x293b8a,'membername':_0x1bd78e[_0x1f0f('0x42')],'interface':_[_0x1f0f('0x71')](_0x1bd78e[_0x1f0f('0xad')])?util[_0x1f0f('0xdb')](_0x1f0f('0xac'),_0x1bd78e[_0x1f0f('0x42')]):_0x1bd78e['interface'],'type':_0x1f0f('0xf5'),'enterAt':moment()[_0x1f0f('0xdb')](_0x1f0f('0xe9')),'data1':_0x4e2e9d[_0x1f0f('0x66')][_0x1f0f('0x49')]||_0x1f0f('0xf6'),'role':_0x1bd78e['role'],'internal':_0x1bd78e[_0x1f0f('0x74')]});});return db[_0x1f0f('0xe8')][_0x1f0f('0x65')](_0x4ea9d1,{'individualHooks':!![]});})[_0x1f0f('0x20')](function(){return _0x1bd78e[_0x1f0f('0x34')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x4e2e9d[_0x1f0f('0x66')][_0x1f0f('0x49')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0x1f0f('0xdb')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0x1f0f('0x20')](respondWithResult(_0x2e401c,null))[_0x1f0f('0x2a')](handleError(_0x2e401c,null));};exports[_0x1f0f('0xf7')]=function(_0x41c63c,_0x27e9a0,_0x15d212){var _0x34062d;return db['User'][_0x1f0f('0x41')]({'where':{'id':_0x41c63c['params']['id']},'attributes':['id','name',_0x1f0f('0x40'),'voicePause',_0x1f0f('0xf8'),'chatPause',_0x1f0f('0xf9'),_0x1f0f('0xfa'),'smsPause','pauseType',_0x1f0f('0xfb')]})[_0x1f0f('0x20')](handleEntityNotFound(_0x27e9a0,null))[_0x1f0f('0x20')](function(_0x2918a2){if(_0x2918a2){_0x34062d=_0x2918a2;if(_0x41c63c[_0x1f0f('0x66')]['channel']&&!utils[_0x1f0f('0xc5')](_0x41c63c['body']['channel'])){throw new db['Sequelize'][(_0x1f0f('0x1e'))](_0x1f0f('0x9e'));}switch(_0x41c63c[_0x1f0f('0x66')][_0x1f0f('0x9a')]){case _0x1f0f('0xa8'):return respondWithRpcPromise('QueuePause',_0x1f0f('0xf7'),{'id':_0x34062d['id'],'name':_0x34062d[_0x1f0f('0x42')],'pause':![]})[_0x1f0f('0x20')](function(){return db[_0x1f0f('0xb1')][_0x1f0f('0x34')]({'paused':0x0},{'where':{'UserId':_0x34062d['id']},'individualHooks':!![]});})[_0x1f0f('0x20')](function(){return db[_0x1f0f('0xe8')][_0x1f0f('0x41')]({'where':{'channel':_0x41c63c[_0x1f0f('0x66')][_0x1f0f('0x9a')],'membername':_0x34062d[_0x1f0f('0x42')],'type':_0x1f0f('0xf5'),'exitAt':null}});})[_0x1f0f('0x20')](function(_0x75d66){if(_0x75d66){return _0x75d66[_0x1f0f('0x34')]({'exitAt':moment()[_0x1f0f('0xdb')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x1f0f('0xfc')},{'individualHooks':!![]});}return null;})['then'](function(){return _0x34062d[_0x1f0f('0x34')]({'voicePause':![]});});case _0x1f0f('0xfd'):case'chat':case _0x1f0f('0xfe'):case _0x1f0f('0xff'):case _0x1f0f('0x100'):return db['MemberReport'][_0x1f0f('0x41')]({'where':{'channel':_0x41c63c['body']['channel'],'membername':_0x34062d[_0x1f0f('0x42')],'type':'PAUSE','exitAt':null}})[_0x1f0f('0x20')](function(_0x49e695){if(_0x49e695){return _0x49e695[_0x1f0f('0x34')]({'exitAt':moment()[_0x1f0f('0xdb')](_0x1f0f('0xe9')),'data2':_0x1f0f('0xfc')},{'individualHooks':!![]});}return null;})['then'](function(){var _0x281255={};_[_0x1f0f('0x30')](_0x281255,util['format']('%s%s',_0x41c63c['body'][_0x1f0f('0x9a')],'Pause'),![]);return _0x34062d['update'](_0x281255);});default:return respondWithRpcPromise(_0x1f0f('0x101'),_0x1f0f('0xf7'),{'id':_0x34062d['id'],'name':_0x34062d[_0x1f0f('0x42')],'pause':![]})[_0x1f0f('0x20')](function(){return db[_0x1f0f('0xb1')][_0x1f0f('0x34')]({'paused':0x0},{'where':{'UserId':_0x34062d['id']}});})['then'](function(){return db['MemberReport']['findAll']({'where':{'membername':_0x34062d['name'],'type':_0x1f0f('0xf5'),'exitAt':null}});})[_0x1f0f('0x20')](function(_0x4dae0c){var _0x2fdca6=[];_0x4dae0c[_0x1f0f('0xeb')](function(_0x49afc7){_0x2fdca6['push'](_0x49afc7['update']({'exitAt':moment()[_0x1f0f('0xdb')](_0x1f0f('0xe9')),'data2':'manual'}));});return BPromise[_0x1f0f('0xf2')](_0x2fdca6);})['then'](function(){return _0x34062d[_0x1f0f('0x34')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0x1f0f('0x20')](respondWithResult(_0x27e9a0,null))[_0x1f0f('0x2a')](handleError(_0x27e9a0,null));};exports[_0x1f0f('0x102')]=function(_0x3a69a2,_0x57b805,_0x551c8b){var _0x446e87={};var _0x45e9c9={};var _0x431b7e;var _0x2cc472;return db['User'][_0x1f0f('0x8f')]({'where':{'id':_0x3a69a2[_0x1f0f('0x63')]['id']}})[_0x1f0f('0x20')](handleEntityNotFound(_0x57b805,null))[_0x1f0f('0x20')](function(_0x8ba10a){if(_0x8ba10a){_0x431b7e=_0x8ba10a;_0x45e9c9[_0x1f0f('0x4b')]=_[_0x1f0f('0x50')](db[_0x1f0f('0x103')][_0x1f0f('0x47')]);_0x45e9c9[_0x1f0f('0x4f')]=_[_0x1f0f('0x50')](_0x3a69a2[_0x1f0f('0x4f')]);_0x45e9c9['filters']=_[_0x1f0f('0x64')](_0x45e9c9['model'],_0x45e9c9[_0x1f0f('0x4f')]);_0x446e87[_0x1f0f('0x51')]=_['intersection'](_0x45e9c9[_0x1f0f('0x4b')],qs[_0x1f0f('0x52')](_0x3a69a2[_0x1f0f('0x4f')][_0x1f0f('0x52')]));_0x446e87[_0x1f0f('0x51')]=_0x446e87['attributes'][_0x1f0f('0x53')]?_0x446e87['attributes']:_0x45e9c9[_0x1f0f('0x4b')];_0x446e87['order']=qs['sort'](_0x3a69a2[_0x1f0f('0x4f')][_0x1f0f('0x56')]);_0x446e87[_0x1f0f('0x57')]=qs[_0x1f0f('0x58')](_[_0x1f0f('0x59')](_0x3a69a2[_0x1f0f('0x4f')],_0x45e9c9[_0x1f0f('0x58')]));if(_0x3a69a2['query']['filter']){_0x446e87[_0x1f0f('0x57')]=_[_0x1f0f('0x5a')](_0x446e87['where'],{'$or':_[_0x1f0f('0x3d')](_0x446e87[_0x1f0f('0x51')],function(_0x55a54f){var _0x168920={};_0x168920[_0x55a54f]={'$like':'%'+_0x3a69a2['query'][_0x1f0f('0x3b')]+'%'};return _0x168920;})});}_0x446e87=_[_0x1f0f('0x5a')]({},_0x446e87,_0x3a69a2[_0x1f0f('0xbd')]);return _0x431b7e['getTeams'](_0x446e87);}})[_0x1f0f('0x20')](function(_0xc479a1){if(_0xc479a1){_0x2cc472=_0xc479a1['length'];if(!_0x3a69a2[_0x1f0f('0x4f')][_0x1f0f('0x54')](_0x1f0f('0xc3'))){_0x446e87['limit']=qs[_0x1f0f('0x2f')](_0x3a69a2[_0x1f0f('0x4f')][_0x1f0f('0x2f')]);_0x446e87[_0x1f0f('0x2e')]=qs[_0x1f0f('0x2e')](_0x3a69a2[_0x1f0f('0x4f')][_0x1f0f('0x2e')]);}return _0x431b7e[_0x1f0f('0x102')](_0x446e87);}})[_0x1f0f('0x20')](function(_0x3cfef3){if(_0x3cfef3){return _0x3cfef3?{'count':_0x2cc472,'rows':_0x3cfef3}:null;}})[_0x1f0f('0x20')](respondWithResult(_0x57b805,null))[_0x1f0f('0x2a')](handleError(_0x57b805,null));};exports[_0x1f0f('0x104')]=function(_0x4419c1,_0x2e0b14){return db['User'][_0x1f0f('0x41')]({'where':{'id':_0x4419c1[_0x1f0f('0x63')]['id']}})[_0x1f0f('0x20')](handleEntityNotFound(_0x2e0b14,null))[_0x1f0f('0x20')](function(_0x5ceb45){if(_0x5ceb45){var _0x582e91=_0x5ceb45['get']({'plain':!![]});return _0x5ceb45[_0x1f0f('0x104')](_0x4419c1[_0x1f0f('0x66')][_0x1f0f('0x69')],_[_0x1f0f('0x105')](_0x4419c1[_0x1f0f('0x66')],[_0x1f0f('0x69'),'id'])||{})['then'](function(){for(var _0x102ae7=0x0;_0x102ae7<_0x4419c1['body'][_0x1f0f('0x69')][_0x1f0f('0x53')];_0x102ae7++){var _0x1824a7=[];db[_0x1f0f('0x103')]['findOne']({'where':{'id':_0x4419c1[_0x1f0f('0x66')][_0x1f0f('0x69')][_0x102ae7]}})['then'](function(_0x4ada73){_0x1824a7[_0x1f0f('0xab')](_0x4ada73[_0x1f0f('0x106')]()['then'](function(_0x23c2a0){for(var _0x1b76cc=0x0;_0x1b76cc<_0x23c2a0[_0x1f0f('0x53')];_0x1b76cc++){_0x23c2a0[_0x1b76cc][_0x1f0f('0x107')]('channel',_0x1f0f('0x108'));}return _0x23c2a0;}));_0x1824a7['push'](_0x4ada73['getChatQueues']()[_0x1f0f('0x20')](function(_0x5f3e86){for(var _0x1cac03=0x0;_0x1cac03<_0x5f3e86[_0x1f0f('0x53')];_0x1cac03++){_0x5f3e86[_0x1cac03]['setDataValue'](_0x1f0f('0x9a'),'Chat');}return _0x5f3e86;}));_0x1824a7[_0x1f0f('0xab')](_0x4ada73[_0x1f0f('0x109')]()[_0x1f0f('0x20')](function(_0x683c94){for(var _0x5d6c41=0x0;_0x5d6c41<_0x683c94['length'];_0x5d6c41++){_0x683c94[_0x5d6c41][_0x1f0f('0x107')](_0x1f0f('0x9a'),'Mail');}return _0x683c94;}));_0x1824a7[_0x1f0f('0xab')](_0x4ada73['getSmsQueues']()[_0x1f0f('0x20')](function(_0x439dec){for(var _0x41e042=0x0;_0x41e042<_0x439dec[_0x1f0f('0x53')];_0x41e042++){_0x439dec[_0x41e042][_0x1f0f('0x107')](_0x1f0f('0x9a'),'Sms');}return _0x439dec;}));_0x1824a7[_0x1f0f('0xab')](_0x4ada73[_0x1f0f('0x10a')]()[_0x1f0f('0x20')](function(_0x9dc904){for(var _0x58d6fc=0x0;_0x58d6fc<_0x9dc904[_0x1f0f('0x53')];_0x58d6fc++){_0x9dc904[_0x58d6fc][_0x1f0f('0x107')](_0x1f0f('0x9a'),_0x1f0f('0x10b'));}return _0x9dc904;}));_0x1824a7[_0x1f0f('0xab')](_0x4ada73[_0x1f0f('0x10c')]()[_0x1f0f('0x20')](function(_0x3912ba){for(var _0x733b12=0x0;_0x733b12<_0x3912ba[_0x1f0f('0x53')];_0x733b12++){_0x3912ba[_0x733b12][_0x1f0f('0x107')](_0x1f0f('0x9a'),'Openchannel');}return _0x3912ba;}));return BPromise[_0x1f0f('0xf2')](_0x1824a7);})[_0x1f0f('0x20')](function(_0x434f85){var _0x206193=_[_0x1f0f('0x10d')](_0x434f85);_0x1824a7=[];return db[_0x1f0f('0x5c')][_0x1f0f('0x10e')](function(_0x567570){for(var _0x142862=0x0;_0x142862<_0x206193[_0x1f0f('0x53')];_0x142862++){_0x1824a7[_0x1f0f('0xab')](_0x206193[_0x142862]['addAgent'](_0x582e91['id']),{'transaction':_0x567570});}return BPromise[_0x1f0f('0xf2')](_0x1824a7)[_0x1f0f('0x20')](function(){if(_0x582e91[_0x1f0f('0x9b')]){return BPromise[_0x1f0f('0xe7')](_[_0x1f0f('0x3b')](_0x206193,function(_0x3cf2e8){return _0x3cf2e8[_0x1f0f('0x10f')](_0x1f0f('0x9a'))==='Voice';}),function(_0x123033){return db[_0x1f0f('0xb1')]['upsert']({'membername':_0x582e91[_0x1f0f('0x42')],'UserId':_0x582e91['id'],'queue_name':_0x123033[_0x1f0f('0x42')],'VoiceQueueId':_0x123033['id'],'interface':_[_0x1f0f('0x71')](_0x582e91[_0x1f0f('0xad')])?util['format'](_0x1f0f('0xac'),_0x582e91[_0x1f0f('0x42')]):_0x582e91[_0x1f0f('0xad')],'paused':_0x582e91[_0x1f0f('0x9d')]||![],'penalty':_0x582e91['penalty']},{'transaction':_0x567570});});}else{return;}})[_0x1f0f('0x20')](function(){for(var _0x5478b9=0x0;_0x5478b9<_0x206193[_0x1f0f('0x53')];_0x5478b9++){var _0x481378=_0x206193[_0x5478b9][_0x1f0f('0x10f')](_0x1f0f('0x9a'));var _0x5acddd=_0x481378+_0x1f0f('0xa5');socket['emit']('user'+_0x481378+_0x1f0f('0xa7'),{'UserId':_0x582e91['id'],['queueField']:_0x206193[_0x5478b9]['id']});}});});});}});}})['then'](respondWithStatusCode(_0x2e0b14,null))['catch'](handleError(_0x2e0b14,null));};exports[_0x1f0f('0x110')]=function(_0x1fa8cd,_0xb09183){return db[_0x1f0f('0x46')][_0x1f0f('0x8f')]({'where':{'id':_0x1fa8cd[_0x1f0f('0x63')]['id']}})[_0x1f0f('0x20')](handleEntityNotFound(_0xb09183,null))[_0x1f0f('0x20')](function(_0x8a4457){if(_0x8a4457){var _0x16a377=_0x8a4457['get']({'plain':!![]});var _0x1eea3b=_0x1fa8cd[_0x1f0f('0x4f')][_0x1f0f('0x69')];return _0x8a4457[_0x1f0f('0x110')](_0x1eea3b)['then'](function(){for(var _0x266a47=0x0;_0x266a47<_0x1eea3b[_0x1f0f('0x53')];_0x266a47++){var _0x3f342d=[];db[_0x1f0f('0x103')]['findOne']({'where':{'id':_0x1eea3b[_0x266a47]}})['then'](function(_0x16eb0e){_0x3f342d[_0x1f0f('0xab')](_0x16eb0e[_0x1f0f('0x106')]()[_0x1f0f('0x20')](function(_0x344453){for(var _0x5f026f=0x0;_0x5f026f<_0x344453[_0x1f0f('0x53')];_0x5f026f++){_0x344453[_0x5f026f]['setDataValue'](_0x1f0f('0x9a'),_0x1f0f('0x108'));}return _0x344453;}));_0x3f342d[_0x1f0f('0xab')](_0x16eb0e[_0x1f0f('0x111')]()[_0x1f0f('0x20')](function(_0x527fc6){for(var _0x551386=0x0;_0x551386<_0x527fc6[_0x1f0f('0x53')];_0x551386++){_0x527fc6[_0x551386][_0x1f0f('0x107')](_0x1f0f('0x9a'),_0x1f0f('0x112'));}return _0x527fc6;}));_0x3f342d[_0x1f0f('0xab')](_0x16eb0e[_0x1f0f('0x109')]()[_0x1f0f('0x20')](function(_0x2c643e){for(var _0x3b410e=0x0;_0x3b410e<_0x2c643e[_0x1f0f('0x53')];_0x3b410e++){_0x2c643e[_0x3b410e]['setDataValue'](_0x1f0f('0x9a'),'Mail');}return _0x2c643e;}));_0x3f342d['push'](_0x16eb0e[_0x1f0f('0x113')]()[_0x1f0f('0x20')](function(_0x10b88f){for(var _0x47c885=0x0;_0x47c885<_0x10b88f[_0x1f0f('0x53')];_0x47c885++){_0x10b88f[_0x47c885][_0x1f0f('0x107')](_0x1f0f('0x9a'),_0x1f0f('0x114'));}return _0x10b88f;}));_0x3f342d['push'](_0x16eb0e[_0x1f0f('0x10a')]()[_0x1f0f('0x20')](function(_0x542f0a){for(var _0x51481a=0x0;_0x51481a<_0x542f0a['length'];_0x51481a++){_0x542f0a[_0x51481a][_0x1f0f('0x107')](_0x1f0f('0x9a'),_0x1f0f('0x10b'));}return _0x542f0a;}));_0x3f342d[_0x1f0f('0xab')](_0x16eb0e[_0x1f0f('0x10c')]()[_0x1f0f('0x20')](function(_0xfb6fd5){for(var _0x5692eb=0x0;_0x5692eb<_0xfb6fd5[_0x1f0f('0x53')];_0x5692eb++){_0xfb6fd5[_0x5692eb][_0x1f0f('0x107')](_0x1f0f('0x9a'),_0x1f0f('0x115'));}return _0xfb6fd5;}));return BPromise[_0x1f0f('0xf2')](_0x3f342d);})[_0x1f0f('0x20')](function(_0xd76ea4){var _0x2010a8=_[_0x1f0f('0x10d')](_0xd76ea4);_0x3f342d=[];return db['sequelize']['transaction'](function(_0x777c9b){for(var _0x545e10=0x0;_0x545e10<_0x2010a8[_0x1f0f('0x53')];_0x545e10++){_0x3f342d[_0x1f0f('0xab')](_0x2010a8[_0x545e10][_0x1f0f('0x116')](_0x16a377['id']),{'transaction':_0x777c9b});}return BPromise[_0x1f0f('0xf2')](_0x3f342d)[_0x1f0f('0x20')](function(){if(_0x16a377[_0x1f0f('0x9b')]){return BPromise[_0x1f0f('0xe7')](_['filter'](_0x2010a8,function(_0xf3d1a7){return _0xf3d1a7[_0x1f0f('0x10f')](_0x1f0f('0x9a'))===_0x1f0f('0x108');}),function(_0x32d01e){return db[_0x1f0f('0xb1')][_0x1f0f('0x35')]({'where':{'VoiceQueueId':_0x32d01e['id'],'UserId':_0x16a377['id']},'transaction':_0x777c9b});});}else{return;}})[_0x1f0f('0x20')](function(){for(var _0x478a99=0x0;_0x478a99<_0x2010a8[_0x1f0f('0x53')];_0x478a99++){var _0x199ddb=_0x2010a8[_0x478a99][_0x1f0f('0x10f')]('channel');var _0x42fee5=_0x199ddb+_0x1f0f('0xa5');socket['emit'](_0x1f0f('0x37')+_0x199ddb+'Queue:remove',{'UserId':_0x16a377['id'],['queueField']:_0x2010a8[_0x478a99]['id']});}});});});}});}})['then'](respondWithStatusCode(_0xb09183,null))['catch'](handleError(_0xb09183,null));};exports[_0x1f0f('0x117')]=function(_0x32e621,_0x486d48,_0x4de71a){var _0x191a4c={};var _0x5486b1={};var _0x4255a6;var _0x51d958;return db['User'][_0x1f0f('0x8f')]({'where':{'id':_0x32e621['params']['id']}})[_0x1f0f('0x20')](handleEntityNotFound(_0x486d48,null))[_0x1f0f('0x20')](function(_0x288576){if(_0x288576){_0x4255a6=_0x288576;_0x5486b1[_0x1f0f('0x4b')]=_[_0x1f0f('0x50')](db[_0x1f0f('0xbe')][_0x1f0f('0x47')]);_0x5486b1[_0x1f0f('0x4f')]=_[_0x1f0f('0x50')](_0x32e621[_0x1f0f('0x4f')]);_0x5486b1['filters']=_[_0x1f0f('0x64')](_0x5486b1[_0x1f0f('0x4b')],_0x5486b1[_0x1f0f('0x4f')]);_0x191a4c[_0x1f0f('0x51')]=_[_0x1f0f('0x64')](_0x5486b1['model'],qs[_0x1f0f('0x52')](_0x32e621[_0x1f0f('0x4f')]['fields']));_0x191a4c['attributes']=_0x191a4c[_0x1f0f('0x51')][_0x1f0f('0x53')]?_0x191a4c['attributes']:_0x5486b1['model'];_0x191a4c[_0x1f0f('0x55')]=qs[_0x1f0f('0x56')](_0x32e621[_0x1f0f('0x4f')]['sort']);_0x191a4c[_0x1f0f('0x57')]=qs[_0x1f0f('0x58')](_[_0x1f0f('0x59')](_0x32e621['query'],_0x5486b1[_0x1f0f('0x58')]));if(_0x32e621[_0x1f0f('0x4f')][_0x1f0f('0x3b')]){_0x191a4c[_0x1f0f('0x57')]=_[_0x1f0f('0x5a')](_0x191a4c['where'],{'$or':_[_0x1f0f('0x3d')](_0x191a4c[_0x1f0f('0x51')],function(_0x56a824){var _0xebfac0={};_0xebfac0[_0x56a824]={'$like':'%'+_0x32e621['query'][_0x1f0f('0x3b')]+'%'};return _0xebfac0;})});}_0x191a4c=_['merge']({},_0x191a4c,_0x32e621[_0x1f0f('0xbd')]);return _0x4255a6[_0x1f0f('0x117')](_0x191a4c);}})[_0x1f0f('0x20')](function(_0x509671){if(_0x509671){_0x51d958=_0x509671[_0x1f0f('0x53')];if(!_0x32e621[_0x1f0f('0x4f')]['hasOwnProperty'](_0x1f0f('0xc3'))){_0x191a4c[_0x1f0f('0x2f')]=qs[_0x1f0f('0x2f')](_0x32e621[_0x1f0f('0x4f')][_0x1f0f('0x2f')]);_0x191a4c[_0x1f0f('0x2e')]=qs['offset'](_0x32e621[_0x1f0f('0x4f')][_0x1f0f('0x2e')]);}return _0x4255a6[_0x1f0f('0x117')](_0x191a4c);}})['then'](function(_0x2c8807){if(_0x2c8807){return _0x2c8807?{'count':_0x51d958,'rows':_0x2c8807}:null;}})['then'](respondWithResult(_0x486d48,null))[_0x1f0f('0x2a')](handleError(_0x486d48,null));};exports[_0x1f0f('0x118')]=function(_0x2cef58,_0x3e2727,_0x4e0f86){var _0x241922={};var _0x1c08c0={};var _0x1595fe;var _0x4c62a2;return db[_0x1f0f('0x46')][_0x1f0f('0x8f')]({'where':{'id':_0x2cef58[_0x1f0f('0x63')]['id']}})['then'](handleEntityNotFound(_0x3e2727,null))[_0x1f0f('0x20')](function(_0x360d3a){if(_0x360d3a){_0x1595fe=_0x360d3a;_0x1c08c0[_0x1f0f('0x4b')]=_['keys'](db[_0x1f0f('0x46')][_0x1f0f('0x47')]);_0x1c08c0[_0x1f0f('0x4f')]=_[_0x1f0f('0x50')](_0x2cef58[_0x1f0f('0x4f')]);_0x1c08c0[_0x1f0f('0x58')]=_[_0x1f0f('0x64')](_0x1c08c0[_0x1f0f('0x4b')],_0x1c08c0['query']);_0x241922['attributes']=_[_0x1f0f('0x64')](_0x1c08c0[_0x1f0f('0x4b')],qs['fields'](_0x2cef58[_0x1f0f('0x4f')][_0x1f0f('0x52')]));_0x241922['attributes']=_0x241922[_0x1f0f('0x51')][_0x1f0f('0x53')]?_0x241922[_0x1f0f('0x51')]:_0x1c08c0[_0x1f0f('0x4b')];_0x241922['order']=qs[_0x1f0f('0x56')](_0x2cef58[_0x1f0f('0x4f')][_0x1f0f('0x56')]);_0x241922[_0x1f0f('0x57')]=qs[_0x1f0f('0x58')](_[_0x1f0f('0x59')](_0x2cef58[_0x1f0f('0x4f')],_0x1c08c0[_0x1f0f('0x58')]));if(_0x2cef58['query']['filter']){_0x241922['where']=_['merge'](_0x241922[_0x1f0f('0x57')],{'$or':_[_0x1f0f('0x3d')](_0x241922['attributes'],function(_0x34fba2){var _0x2c8021={};_0x2c8021[_0x34fba2]={'$like':'%'+_0x2cef58[_0x1f0f('0x4f')]['filter']+'%'};return _0x2c8021;})});}_0x241922[_0x1f0f('0x4b')]=db[_0x1f0f('0x46')];_0x241922['as']='Agents';_0x241922=_[_0x1f0f('0x5a')]({},_0x241922,_0x2cef58[_0x1f0f('0xbd')]);return _0x1595fe['getVoiceQueues']({'include':[_0x241922]});}})[_0x1f0f('0x20')](function(_0xf35df5){if(_0xf35df5){var _0x5a715d={},_0x5c9cbf=[],_0x36eeae=0x0;for(var _0x24285d=0x0;_0x24285d<_0xf35df5[_0x1f0f('0x53')];_0x24285d+=0x1){for(var _0x3c7f0e=0x0,_0xa23ea7;_0x3c7f0e<_0xf35df5[_0x24285d][_0x1f0f('0x38')][_0x1f0f('0x53')];_0x3c7f0e+=0x1){_0xa23ea7=_0xf35df5[_0x24285d][_0x1f0f('0x38')][_0x3c7f0e][_0x1f0f('0x8a')]({'plain':!![]});_0x5a715d[_0xa23ea7['id']]=_0xa23ea7;}}_0x5a715d=_[_0x1f0f('0x119')](_0x5a715d);for(var _0x42dbc1=qs[_0x1f0f('0x2e')](_0x2cef58[_0x1f0f('0x4f')][_0x1f0f('0x2e')]);_0x42dbc1<_0x5a715d[_0x1f0f('0x53')]&&_0x5c9cbf['length']=_0x3f4d27){_0xd340a=_0x3f4d27;_0x4b6769=0xc8;}else{_0x4b6769=0xce;}_0x45f8c8['status'](_0x4b6769);return _0x45f8c8[_0xd707('0x2f')](_0xd707('0x30'),_0x3ed13a+'-'+_0xd340a+'/'+_0x3f4d27)['json'](_0x896f48);}return null;};}function patchUpdates(_0x345382){return function(_0x11b05b){try{jsonpatch[_0xd707('0x31')](_0x11b05b,_0x345382,!![]);}catch(_0x2dde56){return BPromise['reject'](_0x2dde56);}return _0x11b05b['save']();};}function saveUpdates(_0x17d75e,_0x1a6c3c){return function(_0x4903da){if(_0x4903da){return _0x4903da[_0xd707('0x32')](_0x17d75e)[_0xd707('0x20')](function(_0x498f84){return _0x498f84;});}return null;};}function removeEntity(_0x4cb9fd,_0x31be53){return function(_0x4b69d4){if(_0x4b69d4){return _0x4b69d4[_0xd707('0x33')]()['then'](function(){var _0x133c48=_0x4b69d4[_0xd707('0x34')]({'plain':!![]});var _0x4ff823=[{'name':_0xd707('0x35'),'value':_0xd707('0x36'),'ignore':!![]},{'name':_0xd707('0x37'),'value':_0xd707('0x38'),'ignore':![]},{'name':_0xd707('0x39'),'value':_0xd707('0x3a'),'ignore':![]}];var _0x5424f7=_(_0x4ff823)[_0xd707('0x3b')](_0xd707('0x3c'))[_0xd707('0x3d')](_0xd707('0x3e'))[_0xd707('0x3e')]();if(_[_0xd707('0x3f')](_0x5424f7,_0x133c48[_0xd707('0x40')])){return;}var _0x5e4237=_['find'](_0x4ff823,['value',_0x133c48['role']])[_0xd707('0x41')];return db[_0xd707('0x42')][_0xd707('0x33')]({'where':{'type':_0x5e4237,'resourceId':_0x133c48['id']}})[_0xd707('0x20')](function(){return _0x4b69d4;});})[_0xd707('0x20')](function(){_0x4cb9fd['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x998655,_0x21c473){return function(_0x2ccada){if(!_0x2ccada){_0x998655[_0xd707('0x2a')](0x194);}return _0x2ccada;};}function handleError(_0x3b728,_0x26ed13){_0x26ed13=_0x26ed13||0x1f4;return function(_0x41d53a){logger['error'](_0x41d53a[_0xd707('0x43')]);if(_0x41d53a['name']){delete _0x41d53a[_0xd707('0x41')];}_0x3b728[_0xd707('0x2c')](_0x26ed13)[_0xd707('0x44')](_0x41d53a);};}exports[_0xd707('0x45')]=function(_0x555320,_0xbfac2){var _0xb80414={},_0x19deb2={},_0x65b0f8={'count':0x0,'rows':[]};var _0xc21fb8=_[_0xd707('0x3d')](db[_0xd707('0x46')][_0xd707('0x47')],function(_0x381fe0){return{'name':_0x381fe0[_0xd707('0x48')],'type':_0x381fe0[_0xd707('0x49')]['key']};});_0x19deb2[_0xd707('0x4a')]=_['differenceBy'](_[_0xd707('0x3d')](_0xc21fb8,_0xd707('0x41')),['password','salt']);_0x19deb2['query']=_[_0xd707('0x4b')](_0x555320[_0xd707('0x4c')]);_0x19deb2[_0xd707('0x4d')]=_[_0xd707('0x4e')](_0x19deb2[_0xd707('0x4a')],_0x19deb2['query']);_0xb80414['attributes']=_[_0xd707('0x4e')](_0x19deb2[_0xd707('0x4a')],qs[_0xd707('0x4f')](_0x555320[_0xd707('0x4c')]['fields']));_0xb80414[_0xd707('0x50')]=_0xb80414[_0xd707('0x50')][_0xd707('0x51')]?_0xb80414[_0xd707('0x50')]:_0x19deb2[_0xd707('0x4a')];if(!_0x555320[_0xd707('0x4c')][_0xd707('0x52')](_0xd707('0x53'))){_0xb80414[_0xd707('0x54')]=qs['limit'](_0x555320[_0xd707('0x4c')][_0xd707('0x54')]);_0xb80414[_0xd707('0x2e')]=qs['offset'](_0x555320[_0xd707('0x4c')]['offset']);}_0xb80414['order']=qs[_0xd707('0x55')](_0x555320['query'][_0xd707('0x55')]);_0xb80414[_0xd707('0x56')]=qs['filters'](_[_0xd707('0x57')](_0x555320[_0xd707('0x4c')],_0x19deb2['filters']));if(_0x555320[_0xd707('0x4c')][_0xd707('0x3b')]){_0xb80414[_0xd707('0x56')]=_[_0xd707('0x58')](_0xb80414[_0xd707('0x56')],{'$or':_[_0xd707('0x3d')](_0xc21fb8,function(_0x2b1787){if(_0x2b1787['type']!==_0xd707('0x59')){return db[_0xd707('0x5a')][_0xd707('0x56')](db[_0xd707('0x5a')]['fn'](_0xd707('0x5b'),db[_0xd707('0x5a')]['col'](_0x2b1787[_0xd707('0x41')])),{'$like':db[_0xd707('0x5a')]['fn'](_0xd707('0x5b'),'%'+_0x555320['query'][_0xd707('0x3b')]+'%')});}})});}_0xb80414=_['merge']({},_0xb80414,_0x555320[_0xd707('0x5c')]);var _0x1ffc7e={'where':_0xb80414['where']};return db[_0xd707('0x46')][_0xd707('0x2d')](_0x1ffc7e)['then'](function(_0x1a0ba8){_0x65b0f8[_0xd707('0x2d')]=_0x1a0ba8;if(_0x555320[_0xd707('0x4c')]['includeAll']){_0xb80414[_0xd707('0x5d')]=[{'all':!![]}];}return db[_0xd707('0x46')][_0xd707('0x5e')](_0xb80414);})[_0xd707('0x20')](function(_0x3d1de1){_0x65b0f8['rows']=_0x3d1de1;return _0x65b0f8;})[_0xd707('0x20')](respondWithFilteredResult(_0xbfac2,_0xb80414))[_0xd707('0x29')](handleError(_0xbfac2,null));};exports[_0xd707('0x5f')]=function(_0x5f5804,_0xf183e3){var _0x5d0d4c={'raw':![],'where':{'id':_0x5f5804[_0xd707('0x60')]['id']}},_0x2ed82a={};_0x2ed82a[_0xd707('0x4a')]=_[_0xd707('0x61')](_[_0xd707('0x4b')](db[_0xd707('0x46')][_0xd707('0x47')]),[_0xd707('0x62'),_0xd707('0x63')]);_0x2ed82a[_0xd707('0x4c')]=_[_0xd707('0x4b')](_0x5f5804[_0xd707('0x4c')]);_0x2ed82a['filters']=_[_0xd707('0x4e')](_0x2ed82a[_0xd707('0x4a')],_0x2ed82a['query']);_0x5d0d4c[_0xd707('0x50')]=_[_0xd707('0x4e')](_0x2ed82a[_0xd707('0x4a')],qs['fields'](_0x5f5804['query']['fields']));_0x5d0d4c[_0xd707('0x50')]=_0x5d0d4c['attributes'][_0xd707('0x51')]?_0x5d0d4c[_0xd707('0x50')]:_0x2ed82a[_0xd707('0x4a')];if(_0x5f5804[_0xd707('0x4c')][_0xd707('0x64')]){_0x5d0d4c['include']=[{'all':!![]}];}_0x5d0d4c=_['merge']({},_0x5d0d4c,_0x5f5804[_0xd707('0x5c')]);return db[_0xd707('0x46')]['find'](_0x5d0d4c)[_0xd707('0x20')](handleEntityNotFound(_0xf183e3,null))['then'](respondWithResult(_0xf183e3,null))[_0xd707('0x29')](handleError(_0xf183e3,null));};exports[_0xd707('0x65')]=function(_0x2b918f,_0x1e9cb6){return db['User'][_0xd707('0x65')](_0x2b918f[_0xd707('0x66')],{'raw':![],'individualHooks':!![]})[_0xd707('0x20')](respondWithResult(_0x1e9cb6,0xc9))[_0xd707('0x29')](handleError(_0x1e9cb6,null));};exports[_0xd707('0x32')]=function(_0xbc7c0c,_0x5a67c6){if(_0xbc7c0c[_0xd707('0x66')]['id']){delete _0xbc7c0c[_0xd707('0x66')]['id'];}delete _0xbc7c0c[_0xd707('0x66')]['role'];return db[_0xd707('0x46')][_0xd707('0x67')]({'where':{'id':_0xbc7c0c['params']['id']}})[_0xd707('0x20')](handleEntityNotFound(_0x5a67c6,null))[_0xd707('0x20')](saveUpdates(_0xbc7c0c['body'],null))['then'](respondWithResult(_0x5a67c6,null))[_0xd707('0x29')](handleError(_0x5a67c6,null));};exports[_0xd707('0x68')]=function(_0x5863ff,_0x5ac9f8){return db[_0xd707('0x46')][_0xd707('0x68')]()[_0xd707('0x20')](respondWithResult(_0x5ac9f8,null))[_0xd707('0x29')](handleError(_0x5ac9f8,null));};exports[_0xd707('0x69')]=function(_0x59f81f,_0x30e32d,_0x2967fc){return db['User'][_0xd707('0x67')]({'where':{'id':_0x59f81f[_0xd707('0x60')]['id']}})[_0xd707('0x20')](handleEntityNotFound(_0x30e32d,null))[_0xd707('0x20')](function(_0x4ac6b1){if(_0x4ac6b1){return _0x4ac6b1[_0xd707('0x69')](_0x59f81f[_0xd707('0x66')][_0xd707('0x6a')],_['omit'](_0x59f81f[_0xd707('0x66')],['ids','id'])||{});}})['then'](respondWithResult(_0x30e32d,null))['catch'](handleError(_0x30e32d,null));};var getLicense=function(_0x1ffd86){return new BPromise(function(_0x4dd9d0,_0xa99005){var _0x1b57f6=0x0;_0x1ffd86['body']['role']===_0xd707('0x38')&&_0x4dd9d0(_0xd707('0x6b'));return db[_0xd707('0x46')][_0xd707('0x2d')]({'where':{'$or':[{'role':_0x1ffd86[_0xd707('0x66')][_0xd707('0x40')]==='telephone'?_0xd707('0x3a'):['admin','user']}]}})['then'](function(_0x4731f8){_0x1b57f6=_0x4731f8;return require('../../config/license/util')[_0xd707('0x6c')]();})[_0xd707('0x20')](function(_0x372c83){var _0x1bea45=_0x1ffd86[_0xd707('0x66')][_0xd707('0x40')]===_0xd707('0x3a')?_0xd707('0x6d'):_0xd707('0x6e');if(!_[_0xd707('0x6f')](_0x372c83[_0x1bea45])&&_0x1b57f6>=_0x372c83[_0x1bea45]){return _0xa99005({'message':_0xd707('0x70')});}return _0x4dd9d0(util[_0xd707('0x71')](_0xd707('0x72'),_0x1bea45,_0x1b57f6));})['catch'](function(_0x81fde7){return _0xa99005(_0x81fde7);});});};exports[_0xd707('0x73')]=function(_0x50c560,_0x1f98a8){return getLicense(_0x50c560)[_0xd707('0x20')](function(_0x8f4b26){if(!_0x50c560[_0xd707('0x66')]['internal']){var _0x161642;return db[_0xd707('0x74')][_0xd707('0x75')](0x1)['then'](function(_0x4921b2){return checkPasswordPattern(_0x4921b2,_0x50c560['body'][_0xd707('0x62')],_0x4921b2[_0xd707('0x76')]);})[_0xd707('0x20')](function(_0x341173){_0x161642=_0x341173[_0xd707('0x77')];return db[_0xd707('0x46')][_0xd707('0x78')](_0xd707('0x79'));})[_0xd707('0x20')](function(_0x1a8868){if(_[_0xd707('0x6f')](_0x1a8868)){if(_0x161642){_0x50c560[_0xd707('0x66')][_0xd707('0x79')]=_0x161642;}else{_0x50c560[_0xd707('0x66')][_0xd707('0x79')]=0x1;}}else{if(_[_0xd707('0x6f')](_0x161642)||_0x161642==_0x1a8868){_0x50c560['body'][_0xd707('0x79')]=_0x1a8868+0x1;}else if(_0x161642>_0x1a8868){_0x50c560[_0xd707('0x66')][_0xd707('0x79')]=_0x161642;}else{return db[_0xd707('0x5a')][_0xd707('0x4c')]('select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)',{'type':db[_0xd707('0x5a')]['QueryTypes']['SELECT']})[_0xd707('0x20')](function(_0x1822c2){if(_0x1822c2&&_0x1822c2[_0xd707('0x51')]){for(var _0x47e3db=0x0,_0x5d8c42=_0x1822c2['length'];_0x47e3db<_0x5d8c42&&_[_0xd707('0x6f')](_0x50c560[_0xd707('0x66')][_0xd707('0x79')]);_0x47e3db++){if(_0x161642<=_0x1822c2[_0x47e3db][_0xd707('0x7a')]){_0x50c560[_0xd707('0x66')][_0xd707('0x79')]=_0x1822c2[_0x47e3db]['from'];}else if(_0x161642>_0x1822c2[_0x47e3db]['from']&&_0x161642<=_0x1822c2[_0x47e3db]['to']){_0x50c560[_0xd707('0x66')]['internal']=_0x161642;}}}if(_[_0xd707('0x6f')](_0x50c560[_0xd707('0x66')][_0xd707('0x79')])){_0x50c560['body'][_0xd707('0x79')]=_0x1a8868+0x1;}});}}});}})['then'](function(){if(_0x50c560[_0xd707('0x66')][_0xd707('0x7b')]){_0x50c560[_0xd707('0x66')][_0xd707('0x7c')]=_0x50c560['body'][_0xd707('0x79')];_0x50c560['body'][_0xd707('0x7d')]={'mailbox':_0x50c560[_0xd707('0x66')][_0xd707('0x79')],'password':_0x50c560[_0xd707('0x66')][_0xd707('0x62')],'fullname':_0x50c560[_0xd707('0x66')]['fullname'],'email':_0x50c560[_0xd707('0x66')][_0xd707('0x7e')]};}if(_0x50c560[_0xd707('0x66')]&&_0x50c560[_0xd707('0x66')]['role']===_0xd707('0x38')){_0x50c560['body']['permissions']=[_0xd707('0x7f'),'102',_0xd707('0x80'),_0xd707('0x81'),'104',_0xd707('0x82'),'106',_0xd707('0x83'),_0xd707('0x84'),_0xd707('0x85'),_0xd707('0x86'),_0xd707('0x87')];}return db[_0xd707('0x46')][_0xd707('0x73')](_0x50c560[_0xd707('0x66')],{'include':[{'model':db['VoiceMail'],'as':_0xd707('0x7d')}]});})['then'](function(_0x2aeb5e){if(_0x50c560[_0xd707('0x66')][_0xd707('0x40')]==='user')return _0x2aeb5e;var _0x3255c1=_0x50c560[_0xd707('0x36')][_0xd707('0x34')]({'plain':!![]});if(!_0x3255c1)throw new Error(_0xd707('0x88'));if(_0x3255c1[_0xd707('0x40')]==='user'){var _0x3caf96=_0x2aeb5e[_0xd707('0x34')]({'plain':!![]});var _0x41afe4=[{'name':_0xd707('0x37'),'value':'agent'},{'name':_0xd707('0x39'),'value':_0xd707('0x3a')}];var _0x34199a=_[_0xd707('0x67')](_0x41afe4,[_0xd707('0x3e'),_0x3caf96[_0xd707('0x40')]])['name'];return db[_0xd707('0x89')][_0xd707('0x67')]({'where':{'name':_0x34199a,'userProfileId':_0x3255c1['userProfileId']},'raw':!![]})[_0xd707('0x20')](function(_0x3413d4){if(_0x3413d4&&_0x3413d4[_0xd707('0x8a')]===0x0){return db[_0xd707('0x42')][_0xd707('0x73')]({'name':_0x3caf96['name'],'resourceId':_0x3caf96['id'],'type':_0x3413d4[_0xd707('0x41')],'sectionId':_0x3413d4['id']},{})[_0xd707('0x20')](function(){return _0x2aeb5e;});}else{return _0x2aeb5e;}})[_0xd707('0x29')](function(_0x51d956){logger['error'](_0xd707('0x8b'),_0x51d956);throw _0x51d956;});}return _0x2aeb5e;})[_0xd707('0x20')](respondWithResult(_0x1f98a8,0xc9))[_0xd707('0x29')](handleError(_0x1f98a8,null));};exports[_0xd707('0x8c')]=function(_0x7a76d7,_0x54d1cc,_0x5662dc){var _0x404f7e=![];if(_0x7a76d7[_0xd707('0x66')]['id']){delete _0x7a76d7[_0xd707('0x66')]['id'];}return db[_0xd707('0x74')][_0xd707('0x8d')]({'attributes':['id',_0xd707('0x76')]})[_0xd707('0x20')](function(_0xf43e73){_0x404f7e=_0xf43e73[_0xd707('0x76')];return db[_0xd707('0x46')][_0xd707('0x67')]({'where':{'id':_0x7a76d7[_0xd707('0x60')]['id']}});})[_0xd707('0x20')](function(_0x2114e9){if(_0x2114e9){if(_0x2114e9['id']==_0x7a76d7[_0xd707('0x36')]['id']){if(!_0x7a76d7[_0xd707('0x66')]['oldPassword']||!_0x7a76d7[_0xd707('0x66')]['newPassword']){throw new db['Sequelize']['ValidationError'](_0xd707('0x8e'));}if(!_0x2114e9[_0xd707('0x8f')](_0x7a76d7[_0xd707('0x66')]['oldPassword'])){throw new db[(_0xd707('0x1e'))]['ValidationError'](_0xd707('0x90'));}if(_0x7a76d7['body']['oldPassword']==_0x7a76d7['body'][_0xd707('0x91')]){throw new db[(_0xd707('0x1e'))][(_0xd707('0x1f'))]('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}return _0x2114e9;}else if(_0x7a76d7[_0xd707('0x36')][_0xd707('0x40')]=='admin'){if(!_0x7a76d7[_0xd707('0x66')]['newPassword']){throw new db[(_0xd707('0x1e'))]['ValidationError']('Invalid\x20body\x20format.\x20Use\x20newPassword');}return _0x2114e9;}else if(_0x7a76d7[_0xd707('0x36')]['role']==_0xd707('0x36')){if(!_0x7a76d7[_0xd707('0x66')]['newPassword']){throw new db['Sequelize'][(_0xd707('0x1f'))](_0xd707('0x92'));}if(_0x2114e9['role']!=_0xd707('0x38')){throw new db[(_0xd707('0x1e'))][(_0xd707('0x1f'))](_0xd707('0x93'));}return _0x2114e9;}else{throw new db[(_0xd707('0x1e'))][(_0xd707('0x1f'))](_0xd707('0x93'));}}return null;})[_0xd707('0x20')](handleEntityNotFound(_0x54d1cc,null))['then'](function(_0x31acba){return checkPasswordPattern(_0x31acba,_0x7a76d7[_0xd707('0x66')][_0xd707('0x91')],_0x404f7e);})['then'](saveUpdates({'password':_0x7a76d7[_0xd707('0x66')]['newPassword'],'passwordResetAt':_0x7a76d7[_0xd707('0x36')]['id']==_0x7a76d7[_0xd707('0x60')]['id']?moment():null},null))['then'](respondWithResult(_0x54d1cc,null))['catch'](handleError(_0x54d1cc,null));};exports[_0xd707('0x94')]=function(_0x195a46,_0x25c6f9,_0x59e166){var _0x4b8f39=_0x195a46['body']['channel'];return db[_0xd707('0x46')][_0xd707('0x67')]({'where':{'id':_0x195a46[_0xd707('0x60')]['id']},'attributes':['id','name','role','online',_0xd707('0x95'),_0xd707('0x96'),'interface']})[_0xd707('0x20')](handleEntityNotFound(_0x25c6f9,null))[_0xd707('0x20')](function(_0x370869){if(_0x370869){if(!utils['isValidChannel'](_0x4b8f39)){throw new db[(_0xd707('0x1e'))][(_0xd707('0x1f'))](_0xd707('0x97'));}return _0x370869[_0xd707('0x98')+_[_0xd707('0x99')](_0x4b8f39[_0xd707('0x9a')]())+_0xd707('0x9b')](_0x195a46['body'][_0xd707('0x6a')],{'penalty':_0x195a46[_0xd707('0x66')][_0xd707('0x9c')]||0x0})[_0xd707('0x9d')](function(_0x3a8c74){for(var _0x49d460=0x0;_0x49d460<_0x195a46[_0xd707('0x66')][_0xd707('0x6a')][_0xd707('0x51')];_0x49d460+=0x1){var _0x7bec8b={'UserId':_0x195a46[_0xd707('0x60')]['id']};_0x7bec8b[_[_0xd707('0x99')](_0x4b8f39[_0xd707('0x9a')]())+_0xd707('0x9e')]=_0x195a46[_0xd707('0x66')][_0xd707('0x6a')][_0x49d460];socket['emit'](_0xd707('0x36')+_[_0xd707('0x99')](_0x4b8f39[_0xd707('0x9a')]())+'Queue:save',_0x7bec8b);}return _0x3a8c74;})[_0xd707('0x20')](function(){if(_0x4b8f39===_0xd707('0x9f')){return db[_0xd707('0xa0')]['findAll']({'where':{'id':_0x195a46[_0xd707('0x66')][_0xd707('0x6a')]||[]},'raw':!![],'attributes':['id',_0xd707('0x41')]});}})[_0xd707('0x20')](function(_0x35725d){var _0x293864=_0x370869['get']({'plain':!![]});var _0x4fc1f8=[];if(_0x4b8f39===_0xd707('0x9f')&&_0x293864[_0xd707('0x40')]===_0xd707('0x38')&&_0x293864[_0xd707('0xa1')]){for(var _0x2d7566=0x0;_0x2d7566<_0x35725d[_0xd707('0x51')];_0x2d7566+=0x1){_0x4fc1f8[_0xd707('0xa2')]({'membername':_0x293864[_0xd707('0x41')],'UserId':_0x293864['id'],'queue_name':_0x35725d[_0x2d7566][_0xd707('0x41')],'VoiceQueueId':_0x35725d[_0x2d7566]['id'],'interface':_[_0xd707('0x6f')](_0x293864[_0xd707('0xa3')])?util[_0xd707('0x71')](_0xd707('0xa4'),_0x293864['name']):_0x293864[_0xd707('0xa3')],'paused':_0x293864[_0xd707('0x96')]||![],'penalty':_0x195a46['body'][_0xd707('0x9c')]||0x0});}return BPromise[_0xd707('0xa5')](_0x4fc1f8,function(_0xdb4407){return db[_0xd707('0xa6')][_0xd707('0xa7')](_0xdb4407);});}return _0x370869;});}})[_0xd707('0x20')](respondWithStatusCode(_0x25c6f9,null))[_0xd707('0x29')](handleError(_0x25c6f9,null));};exports[_0xd707('0xa8')]=function(_0x18ba9e,_0x19646c,_0x365cca){var _0x215eb;return db['User']['find']({'where':{'id':_0x18ba9e['params']['id']},'attributes':['id',_0xd707('0x41'),_0xd707('0x40')]})[_0xd707('0x20')](handleEntityNotFound(_0x19646c,null))[_0xd707('0x20')](function(_0x16c458){if(_0x16c458){_0x215eb=_0x16c458;if(!_0x18ba9e[_0xd707('0x4c')]['channel']||!utils[_0xd707('0xa9')](_0x18ba9e[_0xd707('0x4c')]['channel'])){throw new db[(_0xd707('0x1e'))][(_0xd707('0x1f'))]('Unknown\x20channel');}return _0x16c458['remove'+_[_0xd707('0x99')](_0x18ba9e['query'][_0xd707('0xaa')][_0xd707('0x9a')]())+_0xd707('0x9b')](_0x18ba9e[_0xd707('0x4c')][_0xd707('0x6a')]);}})[_0xd707('0x20')](function(_0x22bf90){for(var _0x3240e3=0x0;_0x3240e3<_0x18ba9e['query']['ids'][_0xd707('0x51')];_0x3240e3+=0x1){var _0x46f89e={'UserId':_0x18ba9e[_0xd707('0x60')]['id']};_0x46f89e[_[_0xd707('0x99')](_0x18ba9e['query']['channel']['toLowerCase']())+_0xd707('0x9e')]=_0x18ba9e[_0xd707('0x4c')][_0xd707('0x6a')][_0x3240e3];socket[_0xd707('0xab')](_0xd707('0x36')+_[_0xd707('0x99')](_0x18ba9e[_0xd707('0x4c')][_0xd707('0xaa')]['toLowerCase']())+_0xd707('0xac'),_0x46f89e);}return _0x22bf90;})[_0xd707('0x20')](function(){if(_0x18ba9e[_0xd707('0x4c')][_0xd707('0xaa')]==='voice'){return db[_0xd707('0xa6')]['destroy']({'where':{'UserId':_0x18ba9e[_0xd707('0x60')]['id'],'VoiceQueueId':_0x18ba9e[_0xd707('0x4c')][_0xd707('0x6a')]},'individualHooks':!![]})[_0xd707('0x20')](function(){return _0x215eb;});}return _0x215eb;})[_0xd707('0x20')](respondWithStatusCode(_0x19646c,null))[_0xd707('0x29')](handleError(_0x19646c,null));};exports['addAvatar']=function(_0x6cf8e4,_0x1641a8,_0x55cc05){_0x6cf8e4[_0xd707('0x66')][_0xd707('0xad')]=_0x6cf8e4[_0xd707('0xae')][_0xd707('0xaf')];return db[_0xd707('0x46')][_0xd707('0x67')]({'where':{'id':_0x6cf8e4['params']['id']}})['then'](handleEntityNotFound(_0x1641a8,null))['then'](saveUpdates(_0x6cf8e4[_0xd707('0x66')],null))[_0xd707('0x20')](respondWithResult(_0x1641a8,null))[_0xd707('0x29')](handleError(_0x1641a8,null));};exports[_0xd707('0xb0')]=function(_0x58f82b,_0x50d843,_0x552ce6){var _0x160e45=path['join'](config['root'],_0xd707('0xb1'));return db['User'][_0xd707('0x67')]({'where':{'id':_0x58f82b[_0xd707('0x60')]['id']},'attributes':['id',_0xd707('0xad')],'raw':!![]})['then'](handleEntityNotFound(_0x50d843,null))['then'](function(_0x394d64){if(_0x394d64){if(_['isNil'](_0x394d64[_0xd707('0xad')])){return _0x50d843[_0xd707('0xb2')](_0x160e45);}else{if(!fs[_0xd707('0xb3')](path[_0xd707('0xb4')](config['root'],_0xd707('0xb5'),_0x394d64[_0xd707('0xad')]))){return _0x50d843[_0xd707('0xb2')](_0x160e45);}return _0x50d843[_0xd707('0xb2')](path['join'](config[_0xd707('0xb6')],'server/files/images/',_0x394d64[_0xd707('0xad')]));}}})[_0xd707('0x29')](handleError(_0x50d843,null));};exports[_0xd707('0xb7')]=function(_0x150616,_0x1ebbac,_0x4f1d3d){var _0x1de7f7={};var _0x2cef6b={};var _0x35d469;var _0x115f56;return db['User'][_0xd707('0x8d')]({'where':{'id':_0x150616['params']['id']}})['then'](handleEntityNotFound(_0x1ebbac,null))['then'](function(_0x2b146b){if(_0x2b146b){_0x35d469=_0x2b146b;_0x2cef6b['model']=_['keys'](db[_0xd707('0xb8')]['rawAttributes']);_0x2cef6b[_0xd707('0x4c')]=_[_0xd707('0x4b')](_0x150616[_0xd707('0x4c')]);_0x2cef6b['filters']=_[_0xd707('0x4e')](_0x2cef6b['model'],_0x2cef6b[_0xd707('0x4c')]);_0x1de7f7[_0xd707('0x50')]=_[_0xd707('0x4e')](_0x2cef6b[_0xd707('0x4a')],qs['fields'](_0x150616[_0xd707('0x4c')][_0xd707('0x4f')]));_0x1de7f7['attributes']=_0x1de7f7[_0xd707('0x50')][_0xd707('0x51')]?_0x1de7f7[_0xd707('0x50')]:_0x2cef6b['model'];_0x1de7f7[_0xd707('0xb9')]=qs[_0xd707('0x55')](_0x150616['query'][_0xd707('0x55')]);_0x1de7f7[_0xd707('0x56')]=qs[_0xd707('0x4d')](_[_0xd707('0x57')](_0x150616[_0xd707('0x4c')],_0x2cef6b[_0xd707('0x4d')]));if(_0x150616[_0xd707('0x4c')][_0xd707('0x3b')]){_0x1de7f7[_0xd707('0x56')]=_['merge'](_0x1de7f7[_0xd707('0x56')],{'$or':_[_0xd707('0x3d')](_0x1de7f7[_0xd707('0x50')],function(_0x484287){var _0x6ff6be={};_0x6ff6be[_0x484287]={'$like':'%'+_0x150616[_0xd707('0x4c')][_0xd707('0x3b')]+'%'};return _0x6ff6be;})});}_0x1de7f7=_[_0xd707('0x58')]({},_0x1de7f7,_0x150616[_0xd707('0x5c')]);return _0x35d469[_0xd707('0xb7')](_0x1de7f7);}})[_0xd707('0x20')](function(_0x229356){if(_0x229356){_0x115f56=_0x229356['length'];if(_0x150616[_0xd707('0x4c')][_0xd707('0x52')](_0xd707('0x64'))){_0x1de7f7['include']=[{'model':db[_0xd707('0xba')],'as':_0xd707('0xbb'),'required':![]},{'model':db[_0xd707('0xbc')],'as':_0xd707('0xbd'),'attributes':['id',_0xd707('0x41'),_0xd707('0xbe')],'where':_0x150616[_0xd707('0x4c')][_0xd707('0xbf')]?{'id':_0x150616['query']['tag']}:undefined,'required':_0x150616[_0xd707('0x4c')][_0xd707('0xbf')]?!![]:![]}];}if(!_0x150616[_0xd707('0x4c')][_0xd707('0x52')](_0xd707('0x53'))){_0x1de7f7[_0xd707('0x54')]=qs[_0xd707('0x54')](_0x150616[_0xd707('0x4c')]['limit']);_0x1de7f7[_0xd707('0x2e')]=qs['offset'](_0x150616[_0xd707('0x4c')]['offset']);}return _0x35d469[_0xd707('0xb7')](_0x1de7f7);}})[_0xd707('0x20')](function(_0x46cbd1){if(_0x46cbd1){return _0x46cbd1?{'count':_0x115f56,'rows':_0x46cbd1}:null;}})[_0xd707('0x20')](respondWithResult(_0x1ebbac,null))[_0xd707('0x29')](handleError(_0x1ebbac,null));};exports[_0xd707('0xc0')]=function(_0x2d43c9,_0x4f47ee,_0x4bcc59){var _0x22c8d4;var _0x55795b;var _0x32c338={};var _0x1cf6a3;return db[_0xd707('0x46')][_0xd707('0x8d')]({'where':{'id':_0x2d43c9['params']['id']},'attributes':['id',_0xd707('0x41'),_0xd707('0x40')]})[_0xd707('0x20')](handleEntityNotFound(_0x4f47ee,null))[_0xd707('0x20')](function(_0x3312aa){if(!utils[_0xd707('0xa9')](_0x2d43c9['query'][_0xd707('0xaa')])){throw new db[(_0xd707('0x1e'))]['ValidationError'](_0xd707('0x97'));}_0x22c8d4=_0x3312aa;var _0x3db80c={};_0x3db80c['model']=_[_0xd707('0x4b')](db[_[_0xd707('0x99')](_0x2d43c9[_0xd707('0x4c')][_0xd707('0xaa')])+_0xd707('0xc1')]['rawAttributes']);_0x3db80c[_0xd707('0x4c')]=_[_0xd707('0x4b')](_0x2d43c9['query']);_0x3db80c[_0xd707('0x4d')]=_['intersection'](_0x3db80c[_0xd707('0x4a')],_0x3db80c[_0xd707('0x4c')]);_0x32c338['attributes']=_['intersection'](_0x3db80c[_0xd707('0x4a')],qs[_0xd707('0x4f')](_0x2d43c9[_0xd707('0x4c')][_0xd707('0x4f')]));_0x32c338[_0xd707('0x50')]=_0x32c338['attributes'][_0xd707('0x51')]?_0x32c338['attributes']:_0x3db80c[_0xd707('0x4a')];_0x32c338[_0xd707('0xb9')]=qs['sort'](_0x2d43c9[_0xd707('0x4c')][_0xd707('0x55')]);_0x32c338[_0xd707('0x56')]=qs[_0xd707('0x4d')](_['pick'](_0x2d43c9['query'],_0x3db80c[_0xd707('0x4d')]));if(_0x2d43c9[_0xd707('0x4c')][_0xd707('0x3b')]){_0x32c338[_0xd707('0x56')]=_[_0xd707('0x58')](_0x32c338[_0xd707('0x56')],{'$or':_[_0xd707('0x3d')](_0x32c338[_0xd707('0x50')],function(_0x33a0fa){var _0x3e05e9={};_0x3e05e9[_0x33a0fa]={'$like':'%'+_0x2d43c9[_0xd707('0x4c')][_0xd707('0x3b')]+'%'};return _0x3e05e9;})});}_0x32c338=_[_0xd707('0x58')]({},_0x32c338,_0x2d43c9[_0xd707('0x5c')]);switch(_0x22c8d4[_0xd707('0x40')]){case _0xd707('0xc2'):return db[_['capitalize'](_0x2d43c9['query'][_0xd707('0xaa')])+_0xd707('0xc1')][_0xd707('0x5e')](_0x32c338);case _0xd707('0x36'):case _0xd707('0x38'):return _0x22c8d4['get'+_[_0xd707('0x99')](_0x2d43c9['query']['channel'])+'Queues'](_0x32c338);default:throw new db[(_0xd707('0x1e'))][(_0xd707('0x1f'))](_0xd707('0xc3'));}})[_0xd707('0x20')](function(_0x55c581){_0x1cf6a3=_0x55c581['length'];if(!_0x2d43c9['query']['hasOwnProperty'](_0xd707('0x53'))){_0x32c338['limit']=qs[_0xd707('0x54')](_0x2d43c9[_0xd707('0x4c')][_0xd707('0x54')]);_0x32c338[_0xd707('0x2e')]=qs['offset'](_0x2d43c9['query'][_0xd707('0x2e')]);}switch(_0x22c8d4[_0xd707('0x40')]){case _0xd707('0xc2'):return db[_[_0xd707('0x99')](_0x2d43c9[_0xd707('0x4c')]['channel'])+_0xd707('0xc1')]['findAll'](_0x32c338);case'user':case _0xd707('0x38'):return _0x22c8d4['get'+_[_0xd707('0x99')](_0x2d43c9[_0xd707('0x4c')][_0xd707('0xaa')])+_0xd707('0x9b')](_0x32c338);}})[_0xd707('0x20')](function(_0x1eb495){return{'count':_0x1cf6a3,'rows':_0x1eb495};})[_0xd707('0x20')](respondWithResult(_0x4f47ee,null))[_0xd707('0x29')](handleError(_0x4f47ee,null));};exports[_0xd707('0xc4')]=function(_0x448781,_0x1d49ca,_0x3a6521){var _0x141399={};var _0x347db4={};var _0x23cf1a;var _0x1506e8;return db['User'][_0xd707('0x8d')]({'where':{'id':_0x448781[_0xd707('0x60')]['id']}})['then'](handleEntityNotFound(_0x1d49ca,null))['then'](function(_0x17f571){if(_0x17f571){_0x23cf1a=_0x17f571;_0x347db4[_0xd707('0x4a')]=_[_0xd707('0x4b')](db[_0xd707('0xa6')][_0xd707('0x47')]);_0x347db4[_0xd707('0x4c')]=_[_0xd707('0x4b')](_0x448781[_0xd707('0x4c')]);_0x347db4[_0xd707('0x4d')]=_[_0xd707('0x4e')](_0x347db4[_0xd707('0x4a')],_0x347db4[_0xd707('0x4c')]);_0x141399[_0xd707('0x50')]=_[_0xd707('0x4e')](_0x347db4[_0xd707('0x4a')],qs[_0xd707('0x4f')](_0x448781[_0xd707('0x4c')]['fields']));_0x141399[_0xd707('0x50')]=_0x141399[_0xd707('0x50')][_0xd707('0x51')]?_0x141399[_0xd707('0x50')]:_0x347db4['model'];_0x141399[_0xd707('0xb9')]=qs[_0xd707('0x55')](_0x448781['query'][_0xd707('0x55')]);_0x141399['where']=qs[_0xd707('0x4d')](_[_0xd707('0x57')](_0x448781['query'],_0x347db4['filters']));if(_0x448781[_0xd707('0x4c')][_0xd707('0x3b')]){_0x141399[_0xd707('0x56')]=_[_0xd707('0x58')](_0x141399[_0xd707('0x56')],{'$or':_[_0xd707('0x3d')](_0x141399['attributes'],function(_0x42635e){var _0x53dab5={};_0x53dab5[_0x42635e]={'$like':'%'+_0x448781['query'][_0xd707('0x3b')]+'%'};return _0x53dab5;})});}_0x141399=_[_0xd707('0x58')]({},_0x141399,_0x448781[_0xd707('0x5c')]);return _0x23cf1a['getVoiceQueuesRt'](_0x141399);}})['then'](function(_0x5aa064){if(_0x5aa064){_0x1506e8=_0x5aa064[_0xd707('0x51')];if(!_0x448781[_0xd707('0x4c')][_0xd707('0x52')](_0xd707('0x53'))){_0x141399['limit']=qs[_0xd707('0x54')](_0x448781[_0xd707('0x4c')][_0xd707('0x54')]);_0x141399['offset']=qs[_0xd707('0x2e')](_0x448781['query'][_0xd707('0x2e')]);}return _0x23cf1a[_0xd707('0xc4')](_0x141399);}})['then'](function(_0x1acafa){if(_0x1acafa){return _0x1acafa?{'count':_0x1506e8,'rows':_0x1acafa}:null;}})[_0xd707('0x20')](respondWithResult(_0x1d49ca,null))['catch'](handleError(_0x1d49ca,null));};exports[_0xd707('0xc5')]=function(_0x2df5e4,_0x12ae24,_0x1175b4){var _0x169097={};var _0x431949={};var _0x42d947;var _0x551e36;return db[_0xd707('0x46')]['findOne']({'where':{'id':_0x2df5e4[_0xd707('0x60')]['id']}})[_0xd707('0x20')](handleEntityNotFound(_0x12ae24,null))[_0xd707('0x20')](function(_0x150190){if(_0x150190){_0x42d947=_0x150190;_0x431949['model']=_[_0xd707('0x4b')](db[_0xd707('0xc6')][_0xd707('0x47')]);_0x431949['query']=_[_0xd707('0x4b')](_0x2df5e4[_0xd707('0x4c')]);_0x431949[_0xd707('0x4d')]=_[_0xd707('0x4e')](_0x431949['model'],_0x431949[_0xd707('0x4c')]);_0x169097[_0xd707('0x50')]=_[_0xd707('0x4e')](_0x431949[_0xd707('0x4a')],qs[_0xd707('0x4f')](_0x2df5e4[_0xd707('0x4c')][_0xd707('0x4f')]));_0x169097[_0xd707('0x50')]=_0x169097[_0xd707('0x50')][_0xd707('0x51')]?_0x169097[_0xd707('0x50')]:_0x431949[_0xd707('0x4a')];_0x169097[_0xd707('0xb9')]=qs[_0xd707('0x55')](_0x2df5e4['query']['sort']);_0x169097['where']=qs['filters'](_[_0xd707('0x57')](_0x2df5e4['query'],_0x431949[_0xd707('0x4d')]));if(_0x2df5e4[_0xd707('0x4c')]['filter']){_0x169097[_0xd707('0x56')]=_[_0xd707('0x58')](_0x169097['where'],{'$or':_[_0xd707('0x3d')](_0x169097[_0xd707('0x50')],function(_0x288e03){var _0x2d7eb4={};_0x2d7eb4[_0x288e03]={'$like':'%'+_0x2df5e4[_0xd707('0x4c')][_0xd707('0x3b')]+'%'};return _0x2d7eb4;})});}_0x169097=_[_0xd707('0x58')]({},_0x169097,_0x2df5e4[_0xd707('0x5c')]);return _0x42d947[_0xd707('0xc5')](_0x169097);}})['then'](function(_0x435e6a){if(_0x435e6a){_0x551e36=_0x435e6a['length'];if(!_0x2df5e4[_0xd707('0x4c')][_0xd707('0x52')](_0xd707('0x53'))){_0x169097['limit']=qs[_0xd707('0x54')](_0x2df5e4[_0xd707('0x4c')]['limit']);_0x169097[_0xd707('0x2e')]=qs[_0xd707('0x2e')](_0x2df5e4[_0xd707('0x4c')][_0xd707('0x2e')]);}return _0x42d947[_0xd707('0xc5')](_0x169097);}})[_0xd707('0x20')](function(_0x1e55fe){if(_0x1e55fe){return _0x1e55fe?{'count':_0x551e36,'rows':_0x1e55fe}:null;}})['then'](respondWithResult(_0x12ae24,null))[_0xd707('0x29')](handleError(_0x12ae24,null));};exports[_0xd707('0xc7')]=function(_0x16d774,_0x73ea29,_0x5000d0){var _0x50735a={'raw':!![],'where':{}};var _0x2ee494={};var _0x4dd272={'count':0x0,'rows':[]};return db[_0xd707('0x46')]['findOne']({'where':{'id':_0x16d774[_0xd707('0x60')]['id']}})[_0xd707('0x20')](handleEntityNotFound(_0x73ea29,null))[_0xd707('0x20')](function(_0x2fce00){if(_0x2fce00){_0x2ee494[_0xd707('0x4a')]=_[_0xd707('0x4b')](db[_0xd707('0xc8')][_0xd707('0x47')]);_0x2ee494['query']=_[_0xd707('0x4b')](_0x16d774[_0xd707('0x4c')]);_0x2ee494[_0xd707('0x4d')]=_[_0xd707('0x4e')](_0x2ee494[_0xd707('0x4a')],_0x2ee494[_0xd707('0x4c')]);_0x50735a['attributes']=_[_0xd707('0x4e')](_0x2ee494[_0xd707('0x4a')],qs[_0xd707('0x4f')](_0x16d774['query']['fields']));_0x50735a[_0xd707('0x50')]=_0x50735a[_0xd707('0x50')][_0xd707('0x51')]?_0x50735a[_0xd707('0x50')]:_0x2ee494['model'];if(!_0x16d774[_0xd707('0x4c')][_0xd707('0x52')](_0xd707('0x53'))){_0x50735a[_0xd707('0x54')]=qs[_0xd707('0x54')](_0x16d774[_0xd707('0x4c')][_0xd707('0x54')]);_0x50735a[_0xd707('0x2e')]=qs[_0xd707('0x2e')](_0x16d774[_0xd707('0x4c')]['offset']);}_0x50735a[_0xd707('0xb9')]=qs[_0xd707('0x55')](_0x16d774[_0xd707('0x4c')]['sort']);_0x50735a[_0xd707('0x56')]=qs[_0xd707('0x4d')](_['pick'](_0x16d774[_0xd707('0x4c')],_0x2ee494['filters']));_0x50735a[_0xd707('0x56')][_0xd707('0xc9')]=_0x2fce00['id'];if(_0x16d774['query'][_0xd707('0x3b')]){_0x50735a[_0xd707('0x56')]=_[_0xd707('0x58')](_0x50735a[_0xd707('0x56')],{'$or':_['map'](_0x50735a['attributes'],function(_0x1c8c3d){var _0x2b60d0={};_0x2b60d0[_0x1c8c3d]={'$like':'%'+_0x16d774[_0xd707('0x4c')]['filter']+'%'};return _0x2b60d0;})});}_0x50735a=_[_0xd707('0x58')]({},_0x50735a,_0x16d774[_0xd707('0x5c')]);return db[_0xd707('0xc8')][_0xd707('0x2d')]({'where':_0x50735a['where']})[_0xd707('0x20')](function(_0x37dc8f){_0x4dd272[_0xd707('0x2d')]=_0x37dc8f;if(_0x16d774[_0xd707('0x4c')][_0xd707('0x64')]){_0x50735a[_0xd707('0x5d')]=[{'all':!![]}];}return db[_0xd707('0xc8')]['findAll'](_0x50735a);})[_0xd707('0x20')](function(_0x531f71){_0x4dd272[_0xd707('0xca')]=_0x531f71;return _0x4dd272;});}})[_0xd707('0x20')](respondWithFilteredResult(_0x73ea29,_0x50735a))[_0xd707('0x29')](handleError(_0x73ea29,null));};exports[_0xd707('0xcb')]=function(_0x1dccb1,_0x5e94f1,_0x22f9bb){var _0x20e747={'raw':!![],'where':{}};var _0x628155={};var _0xa9672d={'count':0x0,'rows':[]};return db['User'][_0xd707('0x8d')]({'where':{'id':_0x1dccb1['params']['id']}})[_0xd707('0x20')](handleEntityNotFound(_0x5e94f1,null))[_0xd707('0x20')](function(_0xd992b9){if(_0xd992b9){_0x628155[_0xd707('0x4a')]=_[_0xd707('0x4b')](db[_0xd707('0xcc')][_0xd707('0x47')]);_0x628155[_0xd707('0x4c')]=_[_0xd707('0x4b')](_0x1dccb1[_0xd707('0x4c')]);_0x628155[_0xd707('0x4d')]=_[_0xd707('0x4e')](_0x628155[_0xd707('0x4a')],_0x628155[_0xd707('0x4c')]);_0x20e747[_0xd707('0x50')]=_[_0xd707('0x4e')](_0x628155['model'],qs['fields'](_0x1dccb1['query'][_0xd707('0x4f')]));_0x20e747[_0xd707('0x50')]=_0x20e747[_0xd707('0x50')][_0xd707('0x51')]?_0x20e747['attributes']:_0x628155[_0xd707('0x4a')];if(!_0x1dccb1[_0xd707('0x4c')]['hasOwnProperty'](_0xd707('0x53'))){_0x20e747['limit']=qs['limit'](_0x1dccb1[_0xd707('0x4c')][_0xd707('0x54')]);_0x20e747[_0xd707('0x2e')]=qs['offset'](_0x1dccb1['query']['offset']);}_0x20e747[_0xd707('0xb9')]=qs[_0xd707('0x55')](_0x1dccb1[_0xd707('0x4c')][_0xd707('0x55')]);_0x20e747[_0xd707('0x56')]=qs[_0xd707('0x4d')](_[_0xd707('0x57')](_0x1dccb1[_0xd707('0x4c')],_0x628155[_0xd707('0x4d')]));_0x20e747[_0xd707('0x56')][_0xd707('0xc9')]=_0xd992b9['id'];if(_0x1dccb1[_0xd707('0x4c')]['filter']){_0x20e747[_0xd707('0x56')]=_[_0xd707('0x58')](_0x20e747[_0xd707('0x56')],{'$or':_[_0xd707('0x3d')](_0x20e747[_0xd707('0x50')],function(_0x3a49cf){var _0x24ba01={};_0x24ba01[_0x3a49cf]={'$like':'%'+_0x1dccb1[_0xd707('0x4c')]['filter']+'%'};return _0x24ba01;})});}_0x20e747=_[_0xd707('0x58')]({},_0x20e747,_0x1dccb1[_0xd707('0x5c')]);return db[_0xd707('0xcc')]['count']({'where':_0x20e747[_0xd707('0x56')]})['then'](function(_0x92568a){_0xa9672d[_0xd707('0x2d')]=_0x92568a;if(_0x1dccb1[_0xd707('0x4c')][_0xd707('0x64')]){_0x20e747[_0xd707('0x5d')]=[{'all':!![]}];}return db[_0xd707('0xcc')][_0xd707('0x5e')](_0x20e747);})[_0xd707('0x20')](function(_0x15a7d8){_0xa9672d[_0xd707('0xca')]=_0x15a7d8;return _0xa9672d;});}})[_0xd707('0x20')](respondWithFilteredResult(_0x5e94f1,_0x20e747))['catch'](handleError(_0x5e94f1,null));};exports[_0xd707('0xcd')]=function(_0x52dc4f,_0x2243fb,_0x70d6a8){var _0xd1dbc8={};var _0x115f59={};var _0xcf924e;var _0x155bd4;return db['User']['findOne']({'where':{'id':_0x52dc4f[_0xd707('0x60')]['id']}})[_0xd707('0x20')](handleEntityNotFound(_0x2243fb,null))[_0xd707('0x20')](function(_0x48d477){if(_0x48d477){_0xcf924e=_0x48d477;_0x115f59['model']=_[_0xd707('0x4b')](db[_0xd707('0xce')][_0xd707('0x47')]);_0x115f59[_0xd707('0x4c')]=_[_0xd707('0x4b')](_0x52dc4f[_0xd707('0x4c')]);_0x115f59[_0xd707('0x4d')]=_[_0xd707('0x4e')](_0x115f59['model'],_0x115f59['query']);_0xd1dbc8[_0xd707('0x50')]=_['intersection'](_0x115f59[_0xd707('0x4a')],qs[_0xd707('0x4f')](_0x52dc4f['query'][_0xd707('0x4f')]));_0xd1dbc8[_0xd707('0x50')]=_0xd1dbc8[_0xd707('0x50')][_0xd707('0x51')]?_0xd1dbc8['attributes']:_0x115f59[_0xd707('0x4a')];_0xd1dbc8[_0xd707('0xb9')]=qs['sort'](_0x52dc4f[_0xd707('0x4c')][_0xd707('0x55')]);_0xd1dbc8[_0xd707('0x56')]=qs[_0xd707('0x4d')](_[_0xd707('0x57')](_0x52dc4f[_0xd707('0x4c')],_0x115f59['filters']));if(_0x52dc4f['query'][_0xd707('0x3b')]){_0xd1dbc8[_0xd707('0x56')]=_[_0xd707('0x58')](_0xd1dbc8[_0xd707('0x56')],{'$or':_[_0xd707('0x3d')](_0xd1dbc8[_0xd707('0x50')],function(_0x4c6a94){var _0x427334={};_0x427334[_0x4c6a94]={'$like':'%'+_0x52dc4f[_0xd707('0x4c')]['filter']+'%'};return _0x427334;})});}_0xd1dbc8=_[_0xd707('0x58')]({},_0xd1dbc8,_0x52dc4f[_0xd707('0x5c')]);return _0xcf924e[_0xd707('0xcd')](_0xd1dbc8);}})[_0xd707('0x20')](function(_0x2e3872){if(_0x2e3872){_0x155bd4=_0x2e3872[_0xd707('0x51')];if(!_0x52dc4f[_0xd707('0x4c')][_0xd707('0x52')](_0xd707('0x53'))){_0xd1dbc8[_0xd707('0x54')]=qs['limit'](_0x52dc4f[_0xd707('0x4c')][_0xd707('0x54')]);_0xd1dbc8[_0xd707('0x2e')]=qs[_0xd707('0x2e')](_0x52dc4f['query']['offset']);}return _0xcf924e['getChatInteractions'](_0xd1dbc8);}})[_0xd707('0x20')](function(_0x46b9cc){if(_0x46b9cc){return _0x46b9cc?{'count':_0x155bd4,'rows':_0x46b9cc}:null;}})[_0xd707('0x20')](respondWithResult(_0x2243fb,null))[_0xd707('0x29')](handleError(_0x2243fb,null));};exports['getOpenchannelInteractions']=function(_0x1c32f9,_0x30bdcc,_0x587dd0){var _0x33dbac={};var _0x1838d8={};var _0x4a3ce8;var _0x82071b;return db[_0xd707('0x46')][_0xd707('0x8d')]({'where':{'id':_0x1c32f9['params']['id']}})['then'](handleEntityNotFound(_0x30bdcc,null))[_0xd707('0x20')](function(_0x55893b){if(_0x55893b){_0x4a3ce8=_0x55893b;_0x1838d8['model']=_[_0xd707('0x4b')](db[_0xd707('0xcf')][_0xd707('0x47')]);_0x1838d8[_0xd707('0x4c')]=_[_0xd707('0x4b')](_0x1c32f9[_0xd707('0x4c')]);_0x1838d8[_0xd707('0x4d')]=_[_0xd707('0x4e')](_0x1838d8['model'],_0x1838d8[_0xd707('0x4c')]);_0x33dbac['attributes']=_[_0xd707('0x4e')](_0x1838d8[_0xd707('0x4a')],qs[_0xd707('0x4f')](_0x1c32f9[_0xd707('0x4c')][_0xd707('0x4f')]));_0x33dbac[_0xd707('0x50')]=_0x33dbac[_0xd707('0x50')][_0xd707('0x51')]?_0x33dbac[_0xd707('0x50')]:_0x1838d8['model'];_0x33dbac[_0xd707('0xb9')]=qs[_0xd707('0x55')](_0x1c32f9[_0xd707('0x4c')][_0xd707('0x55')]);_0x33dbac['where']=qs['filters'](_[_0xd707('0x57')](_0x1c32f9[_0xd707('0x4c')],_0x1838d8['filters']));if(_0x1c32f9[_0xd707('0x4c')]['filter']){_0x33dbac[_0xd707('0x56')]=_[_0xd707('0x58')](_0x33dbac[_0xd707('0x56')],{'$or':_['map'](_0x33dbac[_0xd707('0x50')],function(_0x1ad52d){var _0x1ada83={};_0x1ada83[_0x1ad52d]={'$like':'%'+_0x1c32f9[_0xd707('0x4c')]['filter']+'%'};return _0x1ada83;})});}_0x33dbac=_['merge']({},_0x33dbac,_0x1c32f9[_0xd707('0x5c')]);return _0x4a3ce8['getOpenchannelInteractions'](_0x33dbac);}})[_0xd707('0x20')](function(_0x46db6d){if(_0x46db6d){_0x82071b=_0x46db6d[_0xd707('0x51')];if(!_0x1c32f9[_0xd707('0x4c')][_0xd707('0x52')](_0xd707('0x53'))){_0x33dbac['limit']=qs[_0xd707('0x54')](_0x1c32f9[_0xd707('0x4c')][_0xd707('0x54')]);_0x33dbac[_0xd707('0x2e')]=qs['offset'](_0x1c32f9[_0xd707('0x4c')][_0xd707('0x2e')]);}return _0x4a3ce8['getOpenchannelInteractions'](_0x33dbac);}})[_0xd707('0x20')](function(_0x2f6c5d){if(_0x2f6c5d){return _0x2f6c5d?{'count':_0x82071b,'rows':_0x2f6c5d}:null;}})[_0xd707('0x20')](respondWithResult(_0x30bdcc,null))['catch'](handleError(_0x30bdcc,null));};exports[_0xd707('0xd0')]=function(_0x5e69e8,_0x591464,_0x6f8eb4){var _0x43502f={'raw':!![],'where':{}};var _0x192fd7={};var _0x4da217={'count':0x0,'rows':[]};return db['User'][_0xd707('0x8d')]({'where':{'id':_0x5e69e8['params']['id']}})[_0xd707('0x20')](handleEntityNotFound(_0x591464,null))[_0xd707('0x20')](function(_0xf809a7){if(_0xf809a7){_0x192fd7[_0xd707('0x4a')]=_[_0xd707('0x4b')](db[_0xd707('0xd1')][_0xd707('0x47')]);_0x192fd7[_0xd707('0x4c')]=_[_0xd707('0x4b')](_0x5e69e8[_0xd707('0x4c')]);_0x192fd7[_0xd707('0x4d')]=_[_0xd707('0x4e')](_0x192fd7[_0xd707('0x4a')],_0x192fd7[_0xd707('0x4c')]);_0x43502f[_0xd707('0x50')]=_[_0xd707('0x4e')](_0x192fd7[_0xd707('0x4a')],qs['fields'](_0x5e69e8['query'][_0xd707('0x4f')]));_0x43502f['attributes']=_0x43502f[_0xd707('0x50')][_0xd707('0x51')]?_0x43502f['attributes']:_0x192fd7[_0xd707('0x4a')];if(!_0x5e69e8[_0xd707('0x4c')][_0xd707('0x52')](_0xd707('0x53'))){_0x43502f[_0xd707('0x54')]=qs['limit'](_0x5e69e8[_0xd707('0x4c')][_0xd707('0x54')]);_0x43502f[_0xd707('0x2e')]=qs[_0xd707('0x2e')](_0x5e69e8[_0xd707('0x4c')][_0xd707('0x2e')]);}_0x43502f[_0xd707('0xb9')]=qs[_0xd707('0x55')](_0x5e69e8[_0xd707('0x4c')][_0xd707('0x55')]);_0x43502f[_0xd707('0x56')]=qs[_0xd707('0x4d')](_[_0xd707('0x57')](_0x5e69e8['query'],_0x192fd7['filters']));_0x43502f[_0xd707('0x56')][_0xd707('0xc9')]=_0xf809a7['id'];if(_0x5e69e8[_0xd707('0x4c')][_0xd707('0x3b')]){_0x43502f[_0xd707('0x56')]=_[_0xd707('0x58')](_0x43502f[_0xd707('0x56')],{'$or':_['map'](_0x43502f[_0xd707('0x50')],function(_0x5ccd2f){var _0x11804a={};_0x11804a[_0x5ccd2f]={'$like':'%'+_0x5e69e8['query']['filter']+'%'};return _0x11804a;})});}_0x43502f=_['merge']({},_0x43502f,_0x5e69e8[_0xd707('0x5c')]);return db[_0xd707('0xd1')][_0xd707('0x2d')]({'where':_0x43502f['where']})[_0xd707('0x20')](function(_0xe55451){_0x4da217[_0xd707('0x2d')]=_0xe55451;if(_0x5e69e8[_0xd707('0x4c')]['includeAll']){_0x43502f['include']=[{'all':!![]}];}return db[_0xd707('0xd1')][_0xd707('0x5e')](_0x43502f);})[_0xd707('0x20')](function(_0x5b26f9){_0x4da217['rows']=_0x5b26f9;return _0x4da217;});}})[_0xd707('0x20')](respondWithFilteredResult(_0x591464,_0x43502f))[_0xd707('0x29')](handleError(_0x591464,null));};exports['getSmsInteractions']=function(_0x1d643d,_0x3b9c8c,_0x51301e){var _0x3edf54={};var _0x134f93={};var _0xa79a0c;var _0x4e10eb;return db['User']['findOne']({'where':{'id':_0x1d643d[_0xd707('0x60')]['id']}})[_0xd707('0x20')](handleEntityNotFound(_0x3b9c8c,null))[_0xd707('0x20')](function(_0x39c938){if(_0x39c938){_0xa79a0c=_0x39c938;_0x134f93[_0xd707('0x4a')]=_[_0xd707('0x4b')](db[_0xd707('0xd2')][_0xd707('0x47')]);_0x134f93[_0xd707('0x4c')]=_[_0xd707('0x4b')](_0x1d643d['query']);_0x134f93[_0xd707('0x4d')]=_['intersection'](_0x134f93['model'],_0x134f93[_0xd707('0x4c')]);_0x3edf54[_0xd707('0x50')]=_[_0xd707('0x4e')](_0x134f93[_0xd707('0x4a')],qs[_0xd707('0x4f')](_0x1d643d['query'][_0xd707('0x4f')]));_0x3edf54[_0xd707('0x50')]=_0x3edf54['attributes']['length']?_0x3edf54['attributes']:_0x134f93[_0xd707('0x4a')];_0x3edf54[_0xd707('0xb9')]=qs[_0xd707('0x55')](_0x1d643d['query'][_0xd707('0x55')]);_0x3edf54['where']=qs['filters'](_['pick'](_0x1d643d['query'],_0x134f93[_0xd707('0x4d')]));if(_0x1d643d[_0xd707('0x4c')][_0xd707('0x3b')]){_0x3edf54['where']=_['merge'](_0x3edf54[_0xd707('0x56')],{'$or':_[_0xd707('0x3d')](_0x3edf54[_0xd707('0x50')],function(_0x2922b9){var _0x3915e7={};_0x3915e7[_0x2922b9]={'$like':'%'+_0x1d643d[_0xd707('0x4c')][_0xd707('0x3b')]+'%'};return _0x3915e7;})});}_0x3edf54=_[_0xd707('0x58')]({},_0x3edf54,_0x1d643d['options']);return _0xa79a0c[_0xd707('0xd3')](_0x3edf54);}})[_0xd707('0x20')](function(_0x93c9ad){if(_0x93c9ad){_0x4e10eb=_0x93c9ad[_0xd707('0x51')];if(!_0x1d643d[_0xd707('0x4c')]['hasOwnProperty'](_0xd707('0x53'))){_0x3edf54['limit']=qs[_0xd707('0x54')](_0x1d643d['query'][_0xd707('0x54')]);_0x3edf54[_0xd707('0x2e')]=qs[_0xd707('0x2e')](_0x1d643d[_0xd707('0x4c')][_0xd707('0x2e')]);}return _0xa79a0c['getSmsInteractions'](_0x3edf54);}})[_0xd707('0x20')](function(_0x6d83a2){if(_0x6d83a2){return _0x6d83a2?{'count':_0x4e10eb,'rows':_0x6d83a2}:null;}})[_0xd707('0x20')](respondWithResult(_0x3b9c8c,null))[_0xd707('0x29')](handleError(_0x3b9c8c,null));};exports['getFaxInteractions']=function(_0x2d007c,_0x526e6d,_0x26eef7){var _0x4e1c49={};var _0x4cd741={};var _0x1a4a51;var _0x1f6c70;return db[_0xd707('0x46')][_0xd707('0x8d')]({'where':{'id':_0x2d007c['params']['id']}})[_0xd707('0x20')](handleEntityNotFound(_0x526e6d,null))[_0xd707('0x20')](function(_0x2fc40f){if(_0x2fc40f){_0x1a4a51=_0x2fc40f;_0x4cd741[_0xd707('0x4a')]=_[_0xd707('0x4b')](db[_0xd707('0xd4')][_0xd707('0x47')]);_0x4cd741[_0xd707('0x4c')]=_['keys'](_0x2d007c['query']);_0x4cd741['filters']=_[_0xd707('0x4e')](_0x4cd741[_0xd707('0x4a')],_0x4cd741[_0xd707('0x4c')]);_0x4e1c49[_0xd707('0x50')]=_['intersection'](_0x4cd741[_0xd707('0x4a')],qs[_0xd707('0x4f')](_0x2d007c[_0xd707('0x4c')][_0xd707('0x4f')]));_0x4e1c49[_0xd707('0x50')]=_0x4e1c49[_0xd707('0x50')][_0xd707('0x51')]?_0x4e1c49[_0xd707('0x50')]:_0x4cd741[_0xd707('0x4a')];_0x4e1c49[_0xd707('0xb9')]=qs[_0xd707('0x55')](_0x2d007c[_0xd707('0x4c')][_0xd707('0x55')]);_0x4e1c49['where']=qs[_0xd707('0x4d')](_['pick'](_0x2d007c[_0xd707('0x4c')],_0x4cd741[_0xd707('0x4d')]));if(_0x2d007c[_0xd707('0x4c')][_0xd707('0x3b')]){_0x4e1c49[_0xd707('0x56')]=_[_0xd707('0x58')](_0x4e1c49[_0xd707('0x56')],{'$or':_[_0xd707('0x3d')](_0x4e1c49[_0xd707('0x50')],function(_0xba727a){var _0xe26df4={};_0xe26df4[_0xba727a]={'$like':'%'+_0x2d007c['query']['filter']+'%'};return _0xe26df4;})});}_0x4e1c49=_[_0xd707('0x58')]({},_0x4e1c49,_0x2d007c[_0xd707('0x5c')]);return _0x1a4a51['getFaxInteractions'](_0x4e1c49);}})[_0xd707('0x20')](function(_0x4c3459){if(_0x4c3459){_0x1f6c70=_0x4c3459[_0xd707('0x51')];if(!_0x2d007c[_0xd707('0x4c')][_0xd707('0x52')](_0xd707('0x53'))){_0x4e1c49[_0xd707('0x54')]=qs['limit'](_0x2d007c[_0xd707('0x4c')][_0xd707('0x54')]);_0x4e1c49[_0xd707('0x2e')]=qs[_0xd707('0x2e')](_0x2d007c[_0xd707('0x4c')][_0xd707('0x2e')]);}return _0x1a4a51[_0xd707('0xd5')](_0x4e1c49);}})[_0xd707('0x20')](function(_0x483fe5){if(_0x483fe5){return _0x483fe5?{'count':_0x1f6c70,'rows':_0x483fe5}:null;}})['then'](respondWithResult(_0x526e6d,null))[_0xd707('0x29')](handleError(_0x526e6d,null));};exports['login']=function(_0x39d0c7,_0x37551d,_0x3499c4){var _0x5ada0f;var _0x4dfead;var _0x27d1b5;var _0x4080f6=!_[_0xd707('0x6f')](_0x39d0c7[_0xd707('0x60')]['id'])?_0x39d0c7['params']['id']:!_[_0xd707('0x6f')](_0x39d0c7[_0xd707('0x36')]['id'])?_0x39d0c7[_0xd707('0x36')]['id']:null;return db[_0xd707('0x46')]['find']({'where':{'id':_0x4080f6,'role':{'$or':['admin','user','agent']}},'attributes':['id','name',_0xd707('0xd6'),_0xd707('0xd7'),_0xd707('0x40'),'internal','loginInPause']})['then'](function(_0x3191f0){if(_0x3191f0){if(_0x3191f0[_0xd707('0x40')]===_0xd707('0x38')){_0x5ada0f=_0x3191f0;if(_0x39d0c7[_0xd707('0x66')][_0xd707('0xa3')]){_0x27d1b5=util['format'](_0xd707('0xd8'),_0x5ada0f[_0x39d0c7[_0xd707('0x66')]['interface']]);}else if(_0x39d0c7['body'][_0xd707('0xd9')]){_0x27d1b5=util[_0xd707('0x71')](_0xd707('0xa4'),_0x39d0c7[_0xd707('0x66')][_0xd707('0xd9')]);}else{_0x27d1b5=util[_0xd707('0x71')]('SIP/%s',_0x5ada0f[_0xd707('0x41')]);}socket['to'](util[_0xd707('0x71')](_0xd707('0xda'),_0x5ada0f[_0xd707('0x41')]))[_0xd707('0xab')](_0xd707('0xdb'),{'ip':_0x39d0c7['headers'][_0xd707('0xdc')]||_0x39d0c7[_0xd707('0xdd')]['remoteAddress']||_0x39d0c7['socket']['remoteAddress']||_0x39d0c7['connection'][_0xd707('0xde')][_0xd707('0xdf')]});return db[_0xd707('0xa6')][_0xd707('0x33')]({'where':{'membername':_0x5ada0f['name']},'individualHooks':!![]});}}else{throw new db[(_0xd707('0x1e'))][(_0xd707('0x1f'))](_0xd707('0xe0'));}})['then'](function(){if(_0x5ada0f){return _0x5ada0f[_0xd707('0xe1')]({'raw':!![]});}})[_0xd707('0x20')](function(_0x42ded0){if(_0x5ada0f){var _0x3f203d=[];if(_0x42ded0){_0x4dfead=_0x42ded0;if(_0x4dfead[_0xd707('0x51')]){for(var _0x3b246a=0x0;_0x3b246a<_0x4dfead[_0xd707('0x51')];_0x3b246a++){_0x3f203d[_0xd707('0xa2')]({'membername':_0x5ada0f[_0xd707('0x41')],'UserId':_0x5ada0f['id'],'queue_name':_0x4dfead[_0x3b246a][_0xd707('0x41')],'VoiceQueueId':_0x4dfead[_0x3b246a]['id'],'interface':_0x27d1b5,'paused':_0x5ada0f['loginInPause']||![],'penalty':_0x4dfead[_0x3b246a][_0xd707('0xe2')]||0x0});}return BPromise['each'](_0x3f203d,function(_0x1af6e5){return db[_0xd707('0xa6')][_0xd707('0xa7')](_0x1af6e5);});}}}})[_0xd707('0x20')](function(){if(_0x5ada0f){return db['MemberReport']['findAll']({'where':{'membername':_0x5ada0f[_0xd707('0x41')],'exitAt':null}});}})[_0xd707('0x20')](function(_0x477c41){if(_0x5ada0f){var _0x17d950=[];_0x477c41['forEach'](function(_0x1280b0){_0x17d950[_0xd707('0xa2')](_0x1280b0[_0xd707('0x32')]({'exitAt':moment()['format'](_0xd707('0xe3'))}));});return BPromise[_0xd707('0xe4')](_0x17d950);}})[_0xd707('0x20')](function(){if(_0x5ada0f){var _0x5f49f7=[];var _0x50d732=[];var _0x428183=utils[_0xd707('0xe5')]();var _0x1366bc={'membername':_0x5ada0f['name'],'interface':_0x27d1b5,'enterAt':moment()[_0xd707('0x71')](_0xd707('0xe3')),'role':_0x5ada0f[_0xd707('0x40')],'internal':_0x5ada0f[_0xd707('0x79')]};_0x428183[_0xd707('0xe6')](function(_0x48782b){_0x5f49f7[_0xd707('0xa2')](_[_0xd707('0x58')]({'channel':_0x48782b,'type':_0xd707('0xe7'),'data1':_0x39d0c7[_0xd707('0x66')][_0xd707('0xe8')],'data2':_0x27d1b5},_0x1366bc));if(_0x5ada0f['loginInPause']){_0x50d732[_0xd707('0xa2')](_[_0xd707('0x58')]({'channel':_0x48782b,'type':_0xd707('0xe9'),'data1':_0xd707('0xea')},_0x1366bc));}});return db[_0xd707('0xeb')][_0xd707('0x65')](_0x5f49f7[_0xd707('0xec')](_0x50d732),{'individualHooks':!![]});}})[_0xd707('0x20')](function(){if(_0x5ada0f){return _0x5ada0f[_0xd707('0x32')]({'online':!![],'lastLoginAt':moment()[_0xd707('0x71')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x5ada0f[_0xd707('0x95')]||![],'mailPause':_0x5ada0f[_0xd707('0x95')]||![],'chatPause':_0x5ada0f[_0xd707('0x95')]||![],'faxPause':_0x5ada0f['loginInPause']||![],'smsPause':_0x5ada0f[_0xd707('0x95')]||![],'openchannelPause':_0x5ada0f[_0xd707('0x95')]||![],'pauseType':_0x5ada0f[_0xd707('0x95')]?_0xd707('0xea'):null,'interface':_0x27d1b5,'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});}})[_0xd707('0x20')](function(_0x46b4a4){if(_0x39d0c7[_0xd707('0xed')]){return _0x3499c4();}else{return BPromise[_0xd707('0xee')](_0x46b4a4)[_0xd707('0x20')](respondWithResult(_0x37551d,null));}})[_0xd707('0x29')](handleError(_0x37551d,null));};exports[_0xd707('0xef')]=function(_0x2a98df,_0x271e5f,_0x51916e){var _0x46a9b9;return db[_0xd707('0x46')][_0xd707('0x67')]({'where':{'id':_0x2a98df[_0xd707('0x60')]['id'],'role':_0xd707('0x38')},'attributes':['id',_0xd707('0x41'),_0xd707('0x40')]})[_0xd707('0x20')](handleEntityNotFound(_0x271e5f,null))['then'](function(_0x2c35dc){if(_0x2c35dc){_0x46a9b9=_0x2c35dc;return db[_0xd707('0xa6')][_0xd707('0x33')]({'where':{'membername':_0x46a9b9[_0xd707('0x41')]},'individualHooks':!![]});}})[_0xd707('0x20')](function(){return db[_0xd707('0xeb')]['findAll']({'where':{'membername':_0x46a9b9['name'],'exitAt':null}});})['then'](function(_0x108da4){var _0x4685f2=[];_0x108da4[_0xd707('0xe6')](function(_0x5693a6){_0x4685f2[_0xd707('0xa2')](_0x5693a6[_0xd707('0x32')]({'exitAt':moment()[_0xd707('0x71')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0xd707('0xe4')](_0x4685f2);})[_0xd707('0x20')](function(){return _0x46a9b9[_0xd707('0x32')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'interface':null});})['then'](respondWithResult(_0x271e5f,null))[_0xd707('0x29')](handleError(_0x271e5f,null));};exports['pause']=function(_0x2909ee,_0x522d94,_0x4c9e11){var _0x163e34;return db['UserVoiceQueueRt'][_0xd707('0x32')]({'paused':0x1},{'where':{'UserId':_0x2909ee[_0xd707('0x60')]['id']},'individualHooks':!![]})[_0xd707('0x20')](function(){return db[_0xd707('0x46')][_0xd707('0x67')]({'where':{'id':_0x2909ee[_0xd707('0x60')]['id'],'role':_0xd707('0x38')},'attributes':['id',_0xd707('0x41'),'role',_0xd707('0x79'),_0xd707('0xa3')]});})[_0xd707('0x20')](handleEntityNotFound(_0x522d94,null))['then'](function(_0x2a8741){if(_0x2a8741){_0x163e34=_0x2a8741;return respondWithRpcPromise('QueuePause',_0xd707('0xf0'),{'id':_0x163e34['id'],'name':_0x163e34[_0xd707('0x41')],'pause':!![]});}})['then'](function(){if(_0x163e34){return db[_0xd707('0xeb')][_0xd707('0x5e')]({'where':{'membername':_0x163e34[_0xd707('0x41')],'type':_0xd707('0xe9'),'exitAt':null}});}})[_0xd707('0x20')](function(_0x25cca1){if(_0x25cca1[_0xd707('0x51')]){var _0xe367fe=moment()[_0xd707('0x71')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0xe96050=0x0,_0xa6ec37=_0x25cca1[_0xd707('0x51')];_0xe96050<_0xa6ec37;_0xe96050++){_0x25cca1[_0xe96050][_0xd707('0xf1')]({'exitAt':_0xe367fe});}}})[_0xd707('0x20')](function(){var _0x47a126=[];var _0x30a5e1=utils[_0xd707('0xe5')]();_0x30a5e1[_0xd707('0xe6')](function(_0x14aec7){_0x47a126[_0xd707('0xa2')]({'channel':_0x14aec7,'membername':_0x163e34[_0xd707('0x41')],'interface':_[_0xd707('0x6f')](_0x163e34[_0xd707('0xa3')])?util[_0xd707('0x71')]('SIP/%s',_0x163e34[_0xd707('0x41')]):_0x163e34[_0xd707('0xa3')],'type':'PAUSE','enterAt':moment()[_0xd707('0x71')](_0xd707('0xe3')),'data1':_0x2909ee[_0xd707('0x66')][_0xd707('0x49')]||'DEFAULT\x20PAUSE','role':_0x163e34[_0xd707('0x40')],'internal':_0x163e34[_0xd707('0x79')]});});return db[_0xd707('0xeb')][_0xd707('0x65')](_0x47a126,{'individualHooks':!![]});})[_0xd707('0x20')](function(){return _0x163e34[_0xd707('0x32')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x2909ee['body'][_0xd707('0x49')]||_0xd707('0xf2'),'lastPauseAt':moment()[_0xd707('0x71')](_0xd707('0xe3'))});})[_0xd707('0x20')](respondWithResult(_0x522d94,null))['catch'](handleError(_0x522d94,null));};exports[_0xd707('0xf3')]=function(_0x3688dd,_0x2077fa,_0xa3abd0){var _0x38484b;return db[_0xd707('0x46')]['find']({'where':{'id':_0x3688dd[_0xd707('0x60')]['id']},'attributes':['id',_0xd707('0x41'),_0xd707('0x40'),_0xd707('0x96'),_0xd707('0xf4'),_0xd707('0xf5'),_0xd707('0xf6'),_0xd707('0xf7'),'smsPause',_0xd707('0xf8'),_0xd707('0xf9')]})[_0xd707('0x20')](handleEntityNotFound(_0x2077fa,null))[_0xd707('0x20')](function(_0x77b327){if(_0x77b327){_0x38484b=_0x77b327;if(_0x3688dd[_0xd707('0x66')][_0xd707('0xaa')]&&!utils[_0xd707('0xa9')](_0x3688dd[_0xd707('0x66')][_0xd707('0xaa')])){throw new db[(_0xd707('0x1e'))]['ValidationError'](_0xd707('0x97'));}switch(_0x3688dd['body'][_0xd707('0xaa')]){case'voice':return respondWithRpcPromise(_0xd707('0xfa'),_0xd707('0xf3'),{'id':_0x38484b['id'],'name':_0x38484b[_0xd707('0x41')],'pause':![]})['then'](function(){return db[_0xd707('0xa6')][_0xd707('0x32')]({'paused':0x0},{'where':{'UserId':_0x38484b['id']},'individualHooks':!![]});})[_0xd707('0x20')](function(){return db[_0xd707('0xeb')][_0xd707('0x67')]({'where':{'channel':_0x3688dd['body'][_0xd707('0xaa')],'membername':_0x38484b[_0xd707('0x41')],'type':_0xd707('0xe9'),'exitAt':null}});})[_0xd707('0x20')](function(_0x48664b){if(_0x48664b){return _0x48664b[_0xd707('0x32')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data2':'manual'},{'individualHooks':!![]});}return null;})[_0xd707('0x20')](function(){return _0x38484b[_0xd707('0x32')]({'voicePause':![]});});case _0xd707('0xfb'):case _0xd707('0xfc'):case _0xd707('0xfd'):case'sms':case _0xd707('0xfe'):return db[_0xd707('0xeb')]['find']({'where':{'channel':_0x3688dd[_0xd707('0x66')][_0xd707('0xaa')],'membername':_0x38484b['name'],'type':_0xd707('0xe9'),'exitAt':null}})[_0xd707('0x20')](function(_0x83f5db){if(_0x83f5db){return _0x83f5db[_0xd707('0x32')]({'exitAt':moment()[_0xd707('0x71')](_0xd707('0xe3')),'data2':_0xd707('0xff')},{'individualHooks':!![]});}return null;})[_0xd707('0x20')](function(){var _0x1c0bfa={};_[_0xd707('0x2f')](_0x1c0bfa,util['format'](_0xd707('0x100'),_0x3688dd[_0xd707('0x66')]['channel'],_0xd707('0x101')),![]);return _0x38484b['update'](_0x1c0bfa);});default:return respondWithRpcPromise(_0xd707('0xfa'),_0xd707('0xf3'),{'id':_0x38484b['id'],'name':_0x38484b[_0xd707('0x41')],'pause':![]})[_0xd707('0x20')](function(){return db[_0xd707('0xa6')][_0xd707('0x32')]({'paused':0x0},{'where':{'UserId':_0x38484b['id']}});})[_0xd707('0x20')](function(){return db['MemberReport']['findAll']({'where':{'membername':_0x38484b[_0xd707('0x41')],'type':'PAUSE','exitAt':null}});})[_0xd707('0x20')](function(_0x50cdf2){var _0x3db51d=[];_0x50cdf2[_0xd707('0xe6')](function(_0x203493){_0x3db51d[_0xd707('0xa2')](_0x203493[_0xd707('0x32')]({'exitAt':moment()[_0xd707('0x71')](_0xd707('0xe3')),'data2':'manual'}));});return BPromise[_0xd707('0xe4')](_0x3db51d);})[_0xd707('0x20')](function(){return _0x38484b[_0xd707('0x32')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0xd707('0x20')](respondWithResult(_0x2077fa,null))[_0xd707('0x29')](handleError(_0x2077fa,null));};exports[_0xd707('0x102')]=function(_0x29fcc3,_0x1986ef,_0x2bd62a){var _0x40b085={};var _0x193ba9={};var _0x3aa8c6;var _0x3aef3f;return db[_0xd707('0x46')][_0xd707('0x8d')]({'where':{'id':_0x29fcc3[_0xd707('0x60')]['id']}})[_0xd707('0x20')](handleEntityNotFound(_0x1986ef,null))[_0xd707('0x20')](function(_0x218abe){if(_0x218abe){_0x3aa8c6=_0x218abe;_0x193ba9[_0xd707('0x4a')]=_[_0xd707('0x4b')](db[_0xd707('0x103')]['rawAttributes']);_0x193ba9['query']=_[_0xd707('0x4b')](_0x29fcc3['query']);_0x193ba9[_0xd707('0x4d')]=_[_0xd707('0x4e')](_0x193ba9['model'],_0x193ba9[_0xd707('0x4c')]);_0x40b085[_0xd707('0x50')]=_[_0xd707('0x4e')](_0x193ba9[_0xd707('0x4a')],qs[_0xd707('0x4f')](_0x29fcc3[_0xd707('0x4c')][_0xd707('0x4f')]));_0x40b085[_0xd707('0x50')]=_0x40b085[_0xd707('0x50')][_0xd707('0x51')]?_0x40b085['attributes']:_0x193ba9[_0xd707('0x4a')];_0x40b085['order']=qs[_0xd707('0x55')](_0x29fcc3[_0xd707('0x4c')]['sort']);_0x40b085['where']=qs[_0xd707('0x4d')](_[_0xd707('0x57')](_0x29fcc3[_0xd707('0x4c')],_0x193ba9['filters']));if(_0x29fcc3[_0xd707('0x4c')]['filter']){_0x40b085['where']=_[_0xd707('0x58')](_0x40b085[_0xd707('0x56')],{'$or':_['map'](_0x40b085[_0xd707('0x50')],function(_0x5101d3){var _0x1a30a6={};_0x1a30a6[_0x5101d3]={'$like':'%'+_0x29fcc3['query'][_0xd707('0x3b')]+'%'};return _0x1a30a6;})});}_0x40b085=_[_0xd707('0x58')]({},_0x40b085,_0x29fcc3[_0xd707('0x5c')]);return _0x3aa8c6[_0xd707('0x102')](_0x40b085);}})[_0xd707('0x20')](function(_0x26bb7f){if(_0x26bb7f){_0x3aef3f=_0x26bb7f[_0xd707('0x51')];if(!_0x29fcc3[_0xd707('0x4c')][_0xd707('0x52')](_0xd707('0x53'))){_0x40b085[_0xd707('0x54')]=qs[_0xd707('0x54')](_0x29fcc3['query'][_0xd707('0x54')]);_0x40b085[_0xd707('0x2e')]=qs[_0xd707('0x2e')](_0x29fcc3[_0xd707('0x4c')][_0xd707('0x2e')]);}return _0x3aa8c6['getTeams'](_0x40b085);}})[_0xd707('0x20')](function(_0x45baa4){if(_0x45baa4){return _0x45baa4?{'count':_0x3aef3f,'rows':_0x45baa4}:null;}})[_0xd707('0x20')](respondWithResult(_0x1986ef,null))[_0xd707('0x29')](handleError(_0x1986ef,null));};exports[_0xd707('0x104')]=function(_0x50a047,_0x1c677e){return db['User'][_0xd707('0x67')]({'where':{'id':_0x50a047['params']['id']}})[_0xd707('0x20')](handleEntityNotFound(_0x1c677e,null))[_0xd707('0x20')](function(_0x3347dc){if(_0x3347dc){var _0x223984=_0x3347dc[_0xd707('0x34')]({'plain':!![]});return _0x3347dc['addTeams'](_0x50a047[_0xd707('0x66')][_0xd707('0x6a')],_[_0xd707('0x105')](_0x50a047[_0xd707('0x66')],[_0xd707('0x6a'),'id'])||{})[_0xd707('0x20')](function(){for(var _0x66ae8c=0x0;_0x66ae8c<_0x50a047[_0xd707('0x66')]['ids']['length'];_0x66ae8c++){var _0xc8240d=[];db[_0xd707('0x103')][_0xd707('0x8d')]({'where':{'id':_0x50a047[_0xd707('0x66')]['ids'][_0x66ae8c]}})[_0xd707('0x20')](function(_0x5119cc){_0xc8240d[_0xd707('0xa2')](_0x5119cc['getVoiceQueues']()[_0xd707('0x20')](function(_0x10db0d){for(var _0x5dcc8a=0x0;_0x5dcc8a<_0x10db0d[_0xd707('0x51')];_0x5dcc8a++){_0x10db0d[_0x5dcc8a][_0xd707('0x106')](_0xd707('0xaa'),'Voice');}return _0x10db0d;}));_0xc8240d['push'](_0x5119cc[_0xd707('0x107')]()['then'](function(_0x448724){for(var _0x32686d=0x0;_0x32686d<_0x448724[_0xd707('0x51')];_0x32686d++){_0x448724[_0x32686d][_0xd707('0x106')]('channel',_0xd707('0x108'));}return _0x448724;}));_0xc8240d[_0xd707('0xa2')](_0x5119cc[_0xd707('0x109')]()[_0xd707('0x20')](function(_0x40076a){for(var _0x2fe24f=0x0;_0x2fe24f<_0x40076a['length'];_0x2fe24f++){_0x40076a[_0x2fe24f][_0xd707('0x106')](_0xd707('0xaa'),'Mail');}return _0x40076a;}));_0xc8240d[_0xd707('0xa2')](_0x5119cc[_0xd707('0x10a')]()['then'](function(_0x4b738c){for(var _0x25628a=0x0;_0x25628a<_0x4b738c[_0xd707('0x51')];_0x25628a++){_0x4b738c[_0x25628a]['setDataValue'](_0xd707('0xaa'),_0xd707('0x10b'));}return _0x4b738c;}));_0xc8240d[_0xd707('0xa2')](_0x5119cc['getFaxQueues']()[_0xd707('0x20')](function(_0xbf1534){for(var _0x932956=0x0;_0x932956<_0xbf1534['length'];_0x932956++){_0xbf1534[_0x932956][_0xd707('0x106')](_0xd707('0xaa'),_0xd707('0x10c'));}return _0xbf1534;}));_0xc8240d[_0xd707('0xa2')](_0x5119cc[_0xd707('0x10d')]()[_0xd707('0x20')](function(_0x1012f0){for(var _0x20f8b8=0x0;_0x20f8b8<_0x1012f0[_0xd707('0x51')];_0x20f8b8++){_0x1012f0[_0x20f8b8][_0xd707('0x106')](_0xd707('0xaa'),_0xd707('0x10e'));}return _0x1012f0;}));return BPromise[_0xd707('0xe4')](_0xc8240d);})[_0xd707('0x20')](function(_0x35a902){var _0x10cb7f=_[_0xd707('0x10f')](_0x35a902);_0xc8240d=[];return db['sequelize'][_0xd707('0x110')](function(_0x505f04){for(var _0x4bd76c=0x0;_0x4bd76c<_0x10cb7f[_0xd707('0x51')];_0x4bd76c++){_0xc8240d[_0xd707('0xa2')](_0x10cb7f[_0x4bd76c][_0xd707('0x111')](_0x223984['id']),{'transaction':_0x505f04});}return BPromise[_0xd707('0xe4')](_0xc8240d)['then'](function(){if(_0x223984[_0xd707('0xa1')]){return BPromise[_0xd707('0xa5')](_[_0xd707('0x3b')](_0x10cb7f,function(_0x272452){return _0x272452[_0xd707('0x112')](_0xd707('0xaa'))==='Voice';}),function(_0x4cd5f4){return db[_0xd707('0xa6')][_0xd707('0xa7')]({'membername':_0x223984[_0xd707('0x41')],'UserId':_0x223984['id'],'queue_name':_0x4cd5f4[_0xd707('0x41')],'VoiceQueueId':_0x4cd5f4['id'],'interface':_[_0xd707('0x6f')](_0x223984[_0xd707('0xa3')])?util[_0xd707('0x71')](_0xd707('0xa4'),_0x223984[_0xd707('0x41')]):_0x223984[_0xd707('0xa3')],'paused':_0x223984[_0xd707('0x96')]||![],'penalty':_0x223984[_0xd707('0x9c')]},{'transaction':_0x505f04});});}else{return;}})[_0xd707('0x20')](function(){for(var _0x486cb3=0x0;_0x486cb3<_0x10cb7f[_0xd707('0x51')];_0x486cb3++){var _0x4bc189=_0x10cb7f[_0x486cb3][_0xd707('0x112')](_0xd707('0xaa'));var _0x4891e6=_0x4bc189+'QueueId';socket[_0xd707('0xab')](_0xd707('0x36')+_0x4bc189+_0xd707('0x113'),{'UserId':_0x223984['id'],['queueField']:_0x10cb7f[_0x486cb3]['id']});}});});});}});}})['then'](respondWithStatusCode(_0x1c677e,null))[_0xd707('0x29')](handleError(_0x1c677e,null));};exports[_0xd707('0x114')]=function(_0x33a51f,_0x4cd530){return db['User'][_0xd707('0x8d')]({'where':{'id':_0x33a51f['params']['id']}})[_0xd707('0x20')](handleEntityNotFound(_0x4cd530,null))['then'](function(_0x1a727b){if(_0x1a727b){var _0x127017=_0x1a727b['get']({'plain':!![]});var _0x341c3b=_0x33a51f['query'][_0xd707('0x6a')];return _0x1a727b[_0xd707('0x114')](_0x341c3b)[_0xd707('0x20')](function(){for(var _0xe79ecd=0x0;_0xe79ecd<_0x341c3b[_0xd707('0x51')];_0xe79ecd++){var _0x577c16=[];db['Team'][_0xd707('0x8d')]({'where':{'id':_0x341c3b[_0xe79ecd]}})[_0xd707('0x20')](function(_0xcf6b9a){_0x577c16[_0xd707('0xa2')](_0xcf6b9a[_0xd707('0xe1')]()[_0xd707('0x20')](function(_0x1648cc){for(var _0x3a4857=0x0;_0x3a4857<_0x1648cc['length'];_0x3a4857++){_0x1648cc[_0x3a4857][_0xd707('0x106')](_0xd707('0xaa'),_0xd707('0x115'));}return _0x1648cc;}));_0x577c16[_0xd707('0xa2')](_0xcf6b9a[_0xd707('0x107')]()[_0xd707('0x20')](function(_0x4a4eb1){for(var _0x3d18ab=0x0;_0x3d18ab<_0x4a4eb1[_0xd707('0x51')];_0x3d18ab++){_0x4a4eb1[_0x3d18ab][_0xd707('0x106')]('channel','Chat');}return _0x4a4eb1;}));_0x577c16[_0xd707('0xa2')](_0xcf6b9a[_0xd707('0x109')]()['then'](function(_0x506b89){for(var _0x4c7b9f=0x0;_0x4c7b9f<_0x506b89[_0xd707('0x51')];_0x4c7b9f++){_0x506b89[_0x4c7b9f]['setDataValue'](_0xd707('0xaa'),_0xd707('0x116'));}return _0x506b89;}));_0x577c16[_0xd707('0xa2')](_0xcf6b9a[_0xd707('0x10a')]()[_0xd707('0x20')](function(_0xf14319){for(var _0x157d28=0x0;_0x157d28<_0xf14319[_0xd707('0x51')];_0x157d28++){_0xf14319[_0x157d28][_0xd707('0x106')](_0xd707('0xaa'),_0xd707('0x10b'));}return _0xf14319;}));_0x577c16[_0xd707('0xa2')](_0xcf6b9a[_0xd707('0x117')]()[_0xd707('0x20')](function(_0xa0a091){for(var _0x32e5c3=0x0;_0x32e5c3<_0xa0a091[_0xd707('0x51')];_0x32e5c3++){_0xa0a091[_0x32e5c3][_0xd707('0x106')](_0xd707('0xaa'),'Fax');}return _0xa0a091;}));_0x577c16[_0xd707('0xa2')](_0xcf6b9a[_0xd707('0x10d')]()['then'](function(_0x75a230){for(var _0x349a83=0x0;_0x349a83<_0x75a230['length'];_0x349a83++){_0x75a230[_0x349a83][_0xd707('0x106')](_0xd707('0xaa'),_0xd707('0x10e'));}return _0x75a230;}));return BPromise['all'](_0x577c16);})['then'](function(_0x17c094){var _0x267e20=_[_0xd707('0x10f')](_0x17c094);_0x577c16=[];return db['sequelize']['transaction'](function(_0x50acbc){for(var _0x4ce1f9=0x0;_0x4ce1f9<_0x267e20[_0xd707('0x51')];_0x4ce1f9++){_0x577c16['push'](_0x267e20[_0x4ce1f9][_0xd707('0x118')](_0x127017['id']),{'transaction':_0x50acbc});}return BPromise[_0xd707('0xe4')](_0x577c16)['then'](function(){if(_0x127017[_0xd707('0xa1')]){return BPromise[_0xd707('0xa5')](_[_0xd707('0x3b')](_0x267e20,function(_0x42da2e){return _0x42da2e[_0xd707('0x112')](_0xd707('0xaa'))===_0xd707('0x115');}),function(_0x3c6725){return db[_0xd707('0xa6')][_0xd707('0x33')]({'where':{'VoiceQueueId':_0x3c6725['id'],'UserId':_0x127017['id']},'transaction':_0x50acbc});});}else{return;}})[_0xd707('0x20')](function(){for(var _0x25acd1=0x0;_0x25acd1<_0x267e20[_0xd707('0x51')];_0x25acd1++){var _0x138b90=_0x267e20[_0x25acd1][_0xd707('0x112')](_0xd707('0xaa'));var _0x1393e1=_0x138b90+'QueueId';socket[_0xd707('0xab')](_0xd707('0x36')+_0x138b90+'Queue:remove',{'UserId':_0x127017['id'],['queueField']:_0x267e20[_0x25acd1]['id']});}});});});}});}})[_0xd707('0x20')](respondWithStatusCode(_0x4cd530,null))[_0xd707('0x29')](handleError(_0x4cd530,null));};exports[_0xd707('0x119')]=function(_0x3c715f,_0x343b81,_0x3b3bcf){var _0x467966={};var _0x125317={};var _0x423bb3;var _0x5e3811;return db[_0xd707('0x46')][_0xd707('0x8d')]({'where':{'id':_0x3c715f[_0xd707('0x60')]['id']}})[_0xd707('0x20')](handleEntityNotFound(_0x343b81,null))[_0xd707('0x20')](function(_0x50d597){if(_0x50d597){_0x423bb3=_0x50d597;_0x125317[_0xd707('0x4a')]=_['keys'](db[_0xd707('0xba')][_0xd707('0x47')]);_0x125317[_0xd707('0x4c')]=_[_0xd707('0x4b')](_0x3c715f[_0xd707('0x4c')]);_0x125317[_0xd707('0x4d')]=_[_0xd707('0x4e')](_0x125317[_0xd707('0x4a')],_0x125317[_0xd707('0x4c')]);_0x467966[_0xd707('0x50')]=_[_0xd707('0x4e')](_0x125317[_0xd707('0x4a')],qs[_0xd707('0x4f')](_0x3c715f[_0xd707('0x4c')][_0xd707('0x4f')]));_0x467966[_0xd707('0x50')]=_0x467966[_0xd707('0x50')][_0xd707('0x51')]?_0x467966[_0xd707('0x50')]:_0x125317[_0xd707('0x4a')];_0x467966[_0xd707('0xb9')]=qs[_0xd707('0x55')](_0x3c715f['query'][_0xd707('0x55')]);_0x467966[_0xd707('0x56')]=qs[_0xd707('0x4d')](_[_0xd707('0x57')](_0x3c715f[_0xd707('0x4c')],_0x125317[_0xd707('0x4d')]));if(_0x3c715f[_0xd707('0x4c')][_0xd707('0x3b')]){_0x467966[_0xd707('0x56')]=_[_0xd707('0x58')](_0x467966[_0xd707('0x56')],{'$or':_[_0xd707('0x3d')](_0x467966[_0xd707('0x50')],function(_0x3943ac){var _0x17af96={};_0x17af96[_0x3943ac]={'$like':'%'+_0x3c715f[_0xd707('0x4c')][_0xd707('0x3b')]+'%'};return _0x17af96;})});}_0x467966=_[_0xd707('0x58')]({},_0x467966,_0x3c715f[_0xd707('0x5c')]);return _0x423bb3[_0xd707('0x119')](_0x467966);}})['then'](function(_0x119e9e){if(_0x119e9e){_0x5e3811=_0x119e9e[_0xd707('0x51')];if(!_0x3c715f[_0xd707('0x4c')]['hasOwnProperty'](_0xd707('0x53'))){_0x467966[_0xd707('0x54')]=qs[_0xd707('0x54')](_0x3c715f[_0xd707('0x4c')][_0xd707('0x54')]);_0x467966[_0xd707('0x2e')]=qs[_0xd707('0x2e')](_0x3c715f['query']['offset']);}return _0x423bb3[_0xd707('0x119')](_0x467966);}})[_0xd707('0x20')](function(_0x436482){if(_0x436482){return _0x436482?{'count':_0x5e3811,'rows':_0x436482}:null;}})[_0xd707('0x20')](respondWithResult(_0x343b81,null))['catch'](handleError(_0x343b81,null));};exports['getAgents']=function(_0x3e5151,_0x449170,_0x302bc4){var _0xc3fb84={};var _0x1565ec={};var _0x425222;var _0xb7be17;return db[_0xd707('0x46')][_0xd707('0x8d')]({'where':{'id':_0x3e5151['params']['id']}})[_0xd707('0x20')](handleEntityNotFound(_0x449170,null))[_0xd707('0x20')](function(_0x4bfe20){if(_0x4bfe20){_0x425222=_0x4bfe20;_0x1565ec['model']=_[_0xd707('0x4b')](db[_0xd707('0x46')]['rawAttributes']);_0x1565ec[_0xd707('0x4c')]=_[_0xd707('0x4b')](_0x3e5151['query']);_0x1565ec[_0xd707('0x4d')]=_[_0xd707('0x4e')](_0x1565ec[_0xd707('0x4a')],_0x1565ec[_0xd707('0x4c')]);_0xc3fb84[_0xd707('0x50')]=_[_0xd707('0x4e')](_0x1565ec[_0xd707('0x4a')],qs['fields'](_0x3e5151[_0xd707('0x4c')][_0xd707('0x4f')]));_0xc3fb84['attributes']=_0xc3fb84[_0xd707('0x50')]['length']?_0xc3fb84[_0xd707('0x50')]:_0x1565ec[_0xd707('0x4a')];_0xc3fb84[_0xd707('0xb9')]=qs[_0xd707('0x55')](_0x3e5151[_0xd707('0x4c')]['sort']);_0xc3fb84[_0xd707('0x56')]=qs[_0xd707('0x4d')](_[_0xd707('0x57')](_0x3e5151[_0xd707('0x4c')],_0x1565ec['filters']));if(_0x3e5151[_0xd707('0x4c')][_0xd707('0x3b')]){_0xc3fb84[_0xd707('0x56')]=_[_0xd707('0x58')](_0xc3fb84['where'],{'$or':_[_0xd707('0x3d')](_0xc3fb84[_0xd707('0x50')],function(_0x23aa5c){var _0x5b498b={};_0x5b498b[_0x23aa5c]={'$like':'%'+_0x3e5151['query'][_0xd707('0x3b')]+'%'};return _0x5b498b;})});}_0xc3fb84[_0xd707('0x4a')]=db[_0xd707('0x46')];_0xc3fb84['as']=_0xd707('0x37');_0xc3fb84=_['merge']({},_0xc3fb84,_0x3e5151['options']);return _0x425222[_0xd707('0xe1')]({'include':[_0xc3fb84]});}})['then'](function(_0x4cfab1){if(_0x4cfab1){var _0x3d7dee={},_0x408487=[],_0x2fd37e=0x0;for(var _0x40eae6=0x0;_0x40eae6<_0x4cfab1[_0xd707('0x51')];_0x40eae6+=0x1){for(var _0x18e35f=0x0,_0x118086;_0x18e35f<_0x4cfab1[_0x40eae6][_0xd707('0x37')][_0xd707('0x51')];_0x18e35f+=0x1){_0x118086=_0x4cfab1[_0x40eae6][_0xd707('0x37')][_0x18e35f][_0xd707('0x34')]({'plain':!![]});_0x3d7dee[_0x118086['id']]=_0x118086;}}_0x3d7dee=_['values'](_0x3d7dee);for(var _0x1df98e=qs[_0xd707('0x2e')](_0x3e5151['query'][_0xd707('0x2e')]);_0x1df98e<_0x3d7dee[_0xd707('0x51')]&&_0x408487[_0xd707('0x51')]=_0x43e086[_0x2a30('0x53')]){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})['then'](function(){if(_0x11b6b0){return db[_0x2a30('0x2a')]['destroy']({'where':{'membername':_0x11b6b0[_0x2a30('0x27')]},'individualHooks':!![]});}})[_0x2a30('0x10')](function(){if(_0x11b6b0){return _0x11b6b0['getVoiceQueues']({'raw':!![]});}})[_0x2a30('0x10')](function(_0x33e051){if(_0x11b6b0){if(_0x33e051){var _0x422820=[];_0x3f22c4=_0x33e051;if(_0x3f22c4[_0x2a30('0x2d')]){for(var _0x45fecd=0x0;_0x45fecd<_0x3f22c4[_0x2a30('0x2d')];_0x45fecd++){_0x422820[_0x2a30('0x33')](db[_0x2a30('0x2a')][_0x2a30('0x54')]({'membername':_0x11b6b0[_0x2a30('0x27')],'UserId':_0x11b6b0['id'],'queue_name':_0x3f22c4[_0x45fecd][_0x2a30('0x27')],'VoiceQueueId':_0x3f22c4[_0x45fecd]['id'],'interface':_0x3e02e2,'paused':_0x11b6b0['loginInPause']||![],'penalty':_0x3f22c4[_0x45fecd][_0x2a30('0x55')]||0x0}));}return BPromise['all'](_0x422820);}}}})[_0x2a30('0x10')](function(){if(_0x11b6b0){return db['MemberReport'][_0x2a30('0x1c')]({'where':{'membername':_0x11b6b0[_0x2a30('0x27')],'exitAt':null}});}})[_0x2a30('0x10')](function(_0x5b042a){if(_0x11b6b0){if(_0x5b042a&&_0x5b042a[_0x2a30('0x2d')]){var _0x50ff5c=[];_0x5b042a['forEach'](function(_0x1befec){_0x50ff5c[_0x2a30('0x33')](_0x1befec[_0x2a30('0x3b')]({'exitAt':moment()[_0x2a30('0x2e')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x2a30('0x47')](_0x50ff5c);}}})['then'](function(_0x585bd3){if(_0x11b6b0){var _0xfad588=[];var _0x32c6ba=[];var _0x2df851=utils[_0x2a30('0x31')]();var _0x1f395c={'membername':_0x11b6b0[_0x2a30('0x27')],'interface':_0x3e02e2,'enterAt':moment()['format'](_0x2a30('0x2f')),'role':_0x11b6b0['role'],'internal':_0x11b6b0['internal']};_0x2df851[_0x2a30('0x32')](function(_0x117cba){_0xfad588[_0x2a30('0x33')](_[_0x2a30('0x56')]({'channel':_0x117cba,'type':'LOGIN','data1':_0x2a30('0x57'),'data2':_0x3e02e2},_0x1f395c));if(_0x11b6b0[_0x2a30('0x4e')]){_0x32c6ba[_0x2a30('0x33')](_['merge']({'channel':_0x117cba,'type':_0x2a30('0x2c'),'data1':'LOGININPAUSE'},_0x1f395c));}});return db[_0x2a30('0x2b')]['bulkCreate'](_0xfad588[_0x2a30('0x58')](_0x32c6ba),{'individualHooks':!![]});}})[_0x2a30('0x10')](function(){if(_0x11b6b0){return _0x11b6b0[_0x2a30('0x3b')]({'online':!![],'lastLoginAt':moment()[_0x2a30('0x2e')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x11b6b0['loginInPause']||![],'mailPause':_0x11b6b0[_0x2a30('0x4e')]||![],'chatPause':_0x11b6b0[_0x2a30('0x4e')]||![],'faxPause':_0x11b6b0[_0x2a30('0x4e')]||![],'smsPause':_0x11b6b0[_0x2a30('0x4e')]||![],'openchannelPause':_0x11b6b0[_0x2a30('0x4e')]||![],'pauseType':_0x11b6b0[_0x2a30('0x4e')]?_0x2a30('0x59'):null,'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0x3e02e2});}})[_0x2a30('0x10')](function(_0x163f96){_0x57c0ac(_0x163f96);})[_0x2a30('0x19')](function(_0x589e10){_0x2feb30(_0x3a3edc[_0x2a30('0x16')](0x1f4,_0x589e10['message']));});});}; \ No newline at end of file +var _0xe9da=['then','info','request\x20sent','debug','stringify','error','User,\x20%s,\x20%s','result','GetUser','User','findAll','options','raw','where','attributes','limit','map','include','model','catch','message','ShowUser','find','name','role','internal','UserVoiceQueueRt','update','MemberReport','length','getChannels','forEach','isNil','interface','format','SIP/%s','PAUSE','YYYY-MM-DD\x20HH:mm:ss','body','type','DEFAULT\x20PAUSE','uniqueid','UnpauseUser','findOne','channel','isValidChannel','Unknown\x20channel','system','mail','fax','sms','openchannel','set','%s%s','Pause','push','all','LoginUser','mobile','count','../../config/license/util','agents','getVoiceQueues','upsert','UserVoiceQueue.penalty','LOGIN','callysquare','loginInPause','merge','LOGININPAUSE','bulkCreate','concat','util','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./user.socket','register','request'];(function(_0x44d475,_0x2c636f){var _0x402ffd=function(_0x37446e){while(--_0x37446e){_0x44d475['push'](_0x44d475['shift']());}};_0x402ffd(++_0x2c636f);}(_0xe9da,0xf8));var _0xae9d=function(_0xd12723,_0x3aa1ae){_0xd12723=_0xd12723-0x0;var _0x4508d4=_0xe9da[_0xd12723];return _0x4508d4;};'use strict';var _=require('lodash');var util=require(_0xae9d('0x0'));var moment=require(_0xae9d('0x1'));var BPromise=require('bluebird');var rs=require(_0xae9d('0x2'));var fs=require('fs');var Redis=require(_0xae9d('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xae9d('0x4'))(_0xae9d('0x5'));var config=require(_0xae9d('0x6'));var jayson=require(_0xae9d('0x7'));var client=jayson[_0xae9d('0x8')][_0xae9d('0x9')]({'port':0x232a});config[_0xae9d('0xa')]=_[_0xae9d('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xae9d('0xc'))(new Redis(config[_0xae9d('0xa')]));require(_0xae9d('0xd'))[_0xae9d('0xe')](socket);function respondWithRpcPromise(_0x116a9b,_0x299ef1,_0x383542){return new BPromise(function(_0x5e8291,_0x2fc419){return client[_0xae9d('0xf')](_0x116a9b,_0x383542)[_0xae9d('0x10')](function(_0x4c2721){logger[_0xae9d('0x11')]('User,\x20%s,\x20%s',_0x299ef1,_0xae9d('0x12'));logger[_0xae9d('0x13')]('User,\x20%s,\x20%s,\x20%s',_0x299ef1,'request\x20sent',JSON[_0xae9d('0x14')](_0x4c2721));if(_0x4c2721['error']){if(_0x4c2721[_0xae9d('0x15')]['code']===0x1f4){logger[_0xae9d('0x15')](_0xae9d('0x16'),_0x299ef1,_0x4c2721[_0xae9d('0x15')]['message']);return _0x2fc419(_0x4c2721['error']['message']);}logger[_0xae9d('0x15')]('User,\x20%s,\x20%s',_0x299ef1,_0x4c2721[_0xae9d('0x15')]['message']);return _0x5e8291(_0x4c2721[_0xae9d('0x15')]['message']);}else{logger[_0xae9d('0x11')](_0xae9d('0x16'),_0x299ef1,'request\x20sent');_0x5e8291(_0x4c2721[_0xae9d('0x17')]['message']);}})['catch'](function(_0x25f94f){logger[_0xae9d('0x15')](_0xae9d('0x16'),_0x299ef1,_0x25f94f);_0x2fc419(_0x25f94f);});});}exports[_0xae9d('0x18')]=function(_0x568339){var _0x3d5872=this;return new Promise(function(_0x451a53,_0x36cc7f){return db[_0xae9d('0x19')][_0xae9d('0x1a')]({'raw':_0x568339[_0xae9d('0x1b')]?_0x568339[_0xae9d('0x1b')][_0xae9d('0x1c')]===undefined?!![]:![]:!![],'where':_0x568339['options']?_0x568339[_0xae9d('0x1b')][_0xae9d('0x1d')]||null:null,'attributes':_0x568339[_0xae9d('0x1b')]?_0x568339[_0xae9d('0x1b')][_0xae9d('0x1e')]||null:null,'limit':_0x568339[_0xae9d('0x1b')]?_0x568339[_0xae9d('0x1b')][_0xae9d('0x1f')]||null:null,'include':_0x568339['options']?_0x568339[_0xae9d('0x1b')]['include']?_[_0xae9d('0x20')](_0x568339['options'][_0xae9d('0x21')],function(_0x3f8a3c){return{'model':db[_0x3f8a3c[_0xae9d('0x22')]],'as':_0x3f8a3c['as'],'attributes':_0x3f8a3c[_0xae9d('0x1e')],'include':_0x3f8a3c[_0xae9d('0x21')]?_['map'](_0x3f8a3c[_0xae9d('0x21')],function(_0x532e45){return{'model':db[_0x532e45[_0xae9d('0x22')]],'as':_0x532e45['as'],'attributes':_0x532e45['attributes'],'include':_0x532e45[_0xae9d('0x21')]?_[_0xae9d('0x20')](_0x532e45[_0xae9d('0x21')],function(_0x3e5480){return{'model':db[_0x3e5480[_0xae9d('0x22')]],'as':_0x3e5480['as'],'attributes':_0x3e5480[_0xae9d('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xae9d('0x10')](function(_0x350948){logger[_0xae9d('0x11')](_0xae9d('0x18'),_0x568339);logger[_0xae9d('0x13')](_0xae9d('0x18'),_0x568339,JSON[_0xae9d('0x14')](_0x350948));_0x451a53(_0x350948);})[_0xae9d('0x23')](function(_0x3493d3){logger[_0xae9d('0x15')]('GetUser',_0x3493d3[_0xae9d('0x24')],_0x568339);_0x36cc7f(_0x3d5872[_0xae9d('0x15')](0x1f4,_0x3493d3['message']));});});};exports[_0xae9d('0x25')]=function(_0x48db5d){var _0x30201d=this;return new Promise(function(_0x4901f4,_0x51a306){return db[_0xae9d('0x19')][_0xae9d('0x26')]({'raw':_0x48db5d[_0xae9d('0x1b')]?_0x48db5d[_0xae9d('0x1b')][_0xae9d('0x1c')]===undefined?!![]:![]:!![],'where':_0x48db5d[_0xae9d('0x1b')]?_0x48db5d[_0xae9d('0x1b')]['where']||null:null,'attributes':_0x48db5d[_0xae9d('0x1b')]?_0x48db5d['options'][_0xae9d('0x1e')]||null:null,'include':_0x48db5d[_0xae9d('0x1b')]?_0x48db5d[_0xae9d('0x1b')][_0xae9d('0x21')]?_[_0xae9d('0x20')](_0x48db5d[_0xae9d('0x1b')][_0xae9d('0x21')],function(_0x4aebe0){return{'model':db[_0x4aebe0['model']],'as':_0x4aebe0['as'],'attributes':_0x4aebe0[_0xae9d('0x1e')],'include':_0x4aebe0[_0xae9d('0x21')]?_[_0xae9d('0x20')](_0x4aebe0[_0xae9d('0x21')],function(_0x1105fb){return{'model':db[_0x1105fb[_0xae9d('0x22')]],'as':_0x1105fb['as'],'attributes':_0x1105fb[_0xae9d('0x1e')],'include':_0x1105fb['include']?_[_0xae9d('0x20')](_0x1105fb[_0xae9d('0x21')],function(_0xe00914){return{'model':db[_0xe00914[_0xae9d('0x22')]],'as':_0xe00914['as'],'attributes':_0xe00914[_0xae9d('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xae9d('0x10')](function(_0x4fd513){logger[_0xae9d('0x11')](_0xae9d('0x25'),_0x48db5d);logger[_0xae9d('0x13')](_0xae9d('0x25'),_0x48db5d,JSON[_0xae9d('0x14')](_0x4fd513));_0x4901f4(_0x4fd513);})[_0xae9d('0x23')](function(_0x2960ce){logger['error']('ShowUser',_0x2960ce['message'],_0x48db5d);_0x51a306(_0x30201d[_0xae9d('0x15')](0x1f4,_0x2960ce[_0xae9d('0x24')]));});});};exports['PauseUser']=function(_0x413a40){var _0x2f0843=this;return new Promise(function(_0x3dd0ad,_0x5106f2){var _0x317fe1;return db['User'][_0xae9d('0x26')]({'where':_0x413a40['options']['where']||{},'attributes':['id',_0xae9d('0x27'),_0xae9d('0x28'),_0xae9d('0x29'),'interface']})[_0xae9d('0x10')](function(_0x3e817b){if(_0x3e817b){_0x317fe1=_0x3e817b;return db[_0xae9d('0x2a')][_0xae9d('0x2b')]({'paused':0x1},{'where':{'UserId':_0x317fe1['id']},'individualHooks':!![]});}})[_0xae9d('0x10')](function(){if(_0x317fe1){return db[_0xae9d('0x2c')][_0xae9d('0x1a')]({'where':{'membername':_0x317fe1[_0xae9d('0x27')],'type':'PAUSE','exitAt':null}});}})[_0xae9d('0x10')](function(_0x3e5478){if(_0x317fe1){if(_0x3e5478&&_0x3e5478[_0xae9d('0x2d')]){var _0x568fd6=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');for(var _0xe3f0ac=0x0,_0x243a34=_0x3e5478['length'];_0xe3f0ac<_0x243a34;_0xe3f0ac++){_0x3e5478[_0xe3f0ac]['updateAttributes']({'exitAt':_0x568fd6});}}}})[_0xae9d('0x10')](function(){if(_0x317fe1){var _0x4ed799=[];var _0x600046=utils[_0xae9d('0x2e')]();_0x600046[_0xae9d('0x2f')](function(_0x4aabdd){_0x4ed799['push']({'channel':_0x4aabdd,'membername':_0x317fe1[_0xae9d('0x27')],'interface':_[_0xae9d('0x30')](_0x317fe1[_0xae9d('0x31')])?util[_0xae9d('0x32')](_0xae9d('0x33'),_0x317fe1['name']):_0x317fe1[_0xae9d('0x31')],'type':_0xae9d('0x34'),'enterAt':moment()['format'](_0xae9d('0x35')),'data1':_0x413a40[_0xae9d('0x36')][_0xae9d('0x37')]||_0xae9d('0x38'),'role':_0x317fe1['role'],'internal':_0x317fe1[_0xae9d('0x29')],'uniqueid':_0x413a40[_0xae9d('0x36')][_0xae9d('0x39')]||null});});return db[_0xae9d('0x2c')]['bulkCreate'](_0x4ed799,{'individualHooks':!![]});}})[_0xae9d('0x10')](function(){if(_0x317fe1){return _0x317fe1[_0xae9d('0x2b')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x413a40[_0xae9d('0x36')][_0xae9d('0x37')]||_0xae9d('0x38'),'lastPauseAt':moment()[_0xae9d('0x32')](_0xae9d('0x35'))});}})[_0xae9d('0x10')](function(_0x4e613c){_0x3dd0ad(_0x4e613c);})['catch'](function(_0x35e01d){_0x5106f2(_0x2f0843[_0xae9d('0x15')](0x1f4,_0x35e01d[_0xae9d('0x24')]));});});};exports[_0xae9d('0x3a')]=function(_0x2b6ebf){var _0x1219c2=this;return new Promise(function(_0x14d342,_0x564765){var _0x3de337;return db['User'][_0xae9d('0x3b')]({'where':_0x2b6ebf[_0xae9d('0x1b')][_0xae9d('0x1d')]||{},'attributes':['id',_0xae9d('0x27')]})[_0xae9d('0x10')](function(_0x42c3ab){if(_0x42c3ab){_0x3de337=_0x42c3ab;if(_0x2b6ebf[_0xae9d('0x36')][_0xae9d('0x3c')]&&!utils[_0xae9d('0x3d')](_0x2b6ebf[_0xae9d('0x36')]['channel'])){throw new Error(_0xae9d('0x3e'));}switch(_0x2b6ebf[_0xae9d('0x36')][_0xae9d('0x3c')]){case'voice':return db[_0xae9d('0x2a')][_0xae9d('0x2b')]({'paused':0x0},{'where':{'UserId':_0x3de337['id']}})[_0xae9d('0x10')](function(){return db[_0xae9d('0x2c')][_0xae9d('0x26')]({'where':{'channel':_0x2b6ebf[_0xae9d('0x36')][_0xae9d('0x3c')],'membername':_0x3de337[_0xae9d('0x27')],'type':_0xae9d('0x34'),'exitAt':null}});})[_0xae9d('0x10')](function(_0x5b8f1f){if(_0x5b8f1f){return _0x5b8f1f[_0xae9d('0x2b')]({'exitAt':moment()['format'](_0xae9d('0x35')),'data2':_0xae9d('0x3f')},{'individualHooks':!![]});}return null;})['then'](function(){return _0x3de337[_0xae9d('0x2b')]({'voicePause':![]});});case _0xae9d('0x40'):case'chat':case _0xae9d('0x41'):case _0xae9d('0x42'):case _0xae9d('0x43'):return db[_0xae9d('0x2c')][_0xae9d('0x26')]({'where':{'channel':_0x2b6ebf[_0xae9d('0x36')][_0xae9d('0x3c')],'membername':_0x3de337['name'],'type':'PAUSE','exitAt':null}})[_0xae9d('0x10')](function(_0x4e5c4c){return _0x4e5c4c['update']({'exitAt':moment()['format'](_0xae9d('0x35')),'data2':_0xae9d('0x3f')},{'individualHooks':!![]});})[_0xae9d('0x10')](function(){var _0x5e693a={};_[_0xae9d('0x44')](_0x5e693a,util[_0xae9d('0x32')](_0xae9d('0x45'),_0x2b6ebf[_0xae9d('0x36')][_0xae9d('0x3c')],_0xae9d('0x46')),![]);return _0x3de337[_0xae9d('0x2b')](_0x5e693a);});default:return db[_0xae9d('0x2a')][_0xae9d('0x2b')]({'paused':0x0},{'where':{'UserId':_0x3de337['id']}})[_0xae9d('0x10')](function(){return db[_0xae9d('0x2c')][_0xae9d('0x1a')]({'where':{'membername':_0x3de337[_0xae9d('0x27')],'type':_0xae9d('0x34'),'exitAt':null}});})[_0xae9d('0x10')](function(_0x3693dc){var _0x4c2141=[];_0x3693dc['forEach'](function(_0x323dd2){_0x4c2141[_0xae9d('0x47')](_0x323dd2[_0xae9d('0x2b')]({'exitAt':moment()[_0xae9d('0x32')](_0xae9d('0x35')),'data2':'system'}));});return BPromise[_0xae9d('0x48')](_0x4c2141);})[_0xae9d('0x10')](function(){return _0x3de337[_0xae9d('0x2b')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0xae9d('0x10')](function(_0x364a70){_0x14d342(_0x364a70);})[_0xae9d('0x23')](function(_0x1bd1c8){_0x564765(_0x1219c2['error'](0x1f4,_0x1bd1c8[_0xae9d('0x24')]));});});};exports['LogoutUser']=function(_0x530e4b){var _0x4008b4=this;return new Promise(function(_0x498656,_0x4fca62){var _0x97d235;return db['User']['findOne']({'where':_0x530e4b[_0xae9d('0x1b')]['where']||{},'attributes':['id',_0xae9d('0x27')]})[_0xae9d('0x10')](function(_0x515f48){if(_0x515f48){_0x97d235=_0x515f48;return db[_0xae9d('0x2a')]['destroy']({'where':{'membername':_0x97d235[_0xae9d('0x27')]},'individualHooks':!![]});}})[_0xae9d('0x10')](function(){if(_0x97d235){return db[_0xae9d('0x2c')][_0xae9d('0x1a')]({'where':{'membername':_0x97d235[_0xae9d('0x27')],'exitAt':null}});}})[_0xae9d('0x10')](function(_0x262d2b){if(_0x97d235){if(_0x262d2b&&_0x262d2b[_0xae9d('0x2d')]){var _0x55dec1=[];_0x262d2b[_0xae9d('0x2f')](function(_0x27686f){_0x55dec1['push'](_0x27686f[_0xae9d('0x2b')]({'exitAt':moment()['format'](_0xae9d('0x35'))}));});return BPromise['all'](_0x55dec1);}}})['then'](function(){if(_0x97d235){return _0x97d235[_0xae9d('0x2b')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xae9d('0x10')](function(_0x37d755){_0x498656(_0x37d755);})['catch'](function(_0x5bbbfa){_0x4fca62(_0x4008b4[_0xae9d('0x15')](0x1f4,_0x5bbbfa[_0xae9d('0x24')]));});});};exports[_0xae9d('0x49')]=function(_0x3bcdfb){var _0x2fb0f8=this;return new Promise(function(_0x2719f0,_0x1ac045){var _0xc38b07;var _0x4ce985;var _0x16606d;var _0x2bac30;return db[_0xae9d('0x19')]['findOne']({'where':_0x3bcdfb[_0xae9d('0x1b')]['where']||{},'attributes':['id',_0xae9d('0x27'),_0xae9d('0x28'),_0xae9d('0x4a'),'phone','internal','loginInPause','interface']})[_0xae9d('0x10')](function(_0x406446){if(_0x406446){_0xc38b07=_0x406446;_0x2bac30=_0x3bcdfb[_0xae9d('0x36')][_0xae9d('0x31')]?_0x3bcdfb[_0xae9d('0x36')][_0xae9d('0x31')]:util['format']('SIP/%s',_0xc38b07[_0xae9d('0x27')]);return db[_0xae9d('0x19')][_0xae9d('0x4b')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0xc38b07['id']}}});}})[_0xae9d('0x10')](function(_0x53a036){if(_0x53a036){_0x16606d=_0x53a036;return require(_0xae9d('0x4c'))['getLicense']();}})[_0xae9d('0x10')](function(_0x57bc0d){if(_0x57bc0d&&_0x57bc0d[_0xae9d('0x4d')]&&_0x16606d>=_0x57bc0d[_0xae9d('0x4d')]){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})['then'](function(){if(_0xc38b07){return db[_0xae9d('0x2a')]['destroy']({'where':{'membername':_0xc38b07[_0xae9d('0x27')]},'individualHooks':!![]});}})[_0xae9d('0x10')](function(){if(_0xc38b07){return _0xc38b07[_0xae9d('0x4e')]({'raw':!![]});}})[_0xae9d('0x10')](function(_0x13f7ad){if(_0xc38b07){if(_0x13f7ad){var _0x42e9b0=[];_0x4ce985=_0x13f7ad;if(_0x4ce985[_0xae9d('0x2d')]){for(var _0x11d505=0x0;_0x11d505<_0x4ce985[_0xae9d('0x2d')];_0x11d505++){_0x42e9b0[_0xae9d('0x47')](db[_0xae9d('0x2a')][_0xae9d('0x4f')]({'membername':_0xc38b07[_0xae9d('0x27')],'UserId':_0xc38b07['id'],'queue_name':_0x4ce985[_0x11d505][_0xae9d('0x27')],'VoiceQueueId':_0x4ce985[_0x11d505]['id'],'interface':_0x2bac30,'paused':_0xc38b07['loginInPause']||![],'penalty':_0x4ce985[_0x11d505][_0xae9d('0x50')]||0x0}));}return BPromise[_0xae9d('0x48')](_0x42e9b0);}}}})[_0xae9d('0x10')](function(){if(_0xc38b07){return db[_0xae9d('0x2c')]['findAll']({'where':{'membername':_0xc38b07[_0xae9d('0x27')],'exitAt':null}});}})[_0xae9d('0x10')](function(_0x2a580e){if(_0xc38b07){if(_0x2a580e&&_0x2a580e[_0xae9d('0x2d')]){var _0x114667=[];_0x2a580e[_0xae9d('0x2f')](function(_0x1ec539){_0x114667['push'](_0x1ec539[_0xae9d('0x2b')]({'exitAt':moment()['format'](_0xae9d('0x35'))}));});return BPromise[_0xae9d('0x48')](_0x114667);}}})['then'](function(_0x3309f3){if(_0xc38b07){var _0x555526=[];var _0x19a848=[];var _0x4a7241=utils[_0xae9d('0x2e')]();var _0x9fdac4={'membername':_0xc38b07[_0xae9d('0x27')],'interface':_0x2bac30,'enterAt':moment()[_0xae9d('0x32')](_0xae9d('0x35')),'role':_0xc38b07[_0xae9d('0x28')],'internal':_0xc38b07[_0xae9d('0x29')]};_0x4a7241['forEach'](function(_0xb2ba1e){_0x555526[_0xae9d('0x47')](_['merge']({'channel':_0xb2ba1e,'type':_0xae9d('0x51'),'data1':_0xae9d('0x52'),'data2':_0x2bac30},_0x9fdac4));if(_0xc38b07[_0xae9d('0x53')]){_0x19a848[_0xae9d('0x47')](_[_0xae9d('0x54')]({'channel':_0xb2ba1e,'type':'PAUSE','data1':_0xae9d('0x55')},_0x9fdac4));}});return db['MemberReport'][_0xae9d('0x56')](_0x555526[_0xae9d('0x57')](_0x19a848),{'individualHooks':!![]});}})['then'](function(){if(_0xc38b07){return _0xc38b07['update']({'online':!![],'lastLoginAt':moment()[_0xae9d('0x32')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0xc38b07[_0xae9d('0x53')]||![],'mailPause':_0xc38b07[_0xae9d('0x53')]||![],'chatPause':_0xc38b07[_0xae9d('0x53')]||![],'faxPause':_0xc38b07[_0xae9d('0x53')]||![],'smsPause':_0xc38b07[_0xae9d('0x53')]||![],'openchannelPause':_0xc38b07[_0xae9d('0x53')]||![],'pauseType':_0xc38b07[_0xae9d('0x53')]?_0xae9d('0x55'):null,'lastPauseAt':moment()[_0xae9d('0x32')](_0xae9d('0x35')),'interface':_0x2bac30});}})[_0xae9d('0x10')](function(_0xd6f427){_0x2719f0(_0xd6f427);})['catch'](function(_0x2053ac){_0x1ac045(_0x2fb0f8[_0xae9d('0x15')](0x1f4,_0x2053ac[_0xae9d('0x24')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index a8178b0..6c75d13 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 _0x4fdc=['update','removeListener','register','length','user:','./user.events','save','remove'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4fdc,0xf5));var _0xc4fd=function(_0x32414b,_0xfad5a8){_0x32414b=_0x32414b-0x0;var _0x5187e3=_0x4fdc[_0x32414b];return _0x5187e3;};'use strict';var UserEvents=require(_0xc4fd('0x0'));var events=[_0xc4fd('0x1'),_0xc4fd('0x2'),_0xc4fd('0x3')];function createListener(_0x25e040,_0x5085c9){return function(_0x1ca307){_0x5085c9['emit'](_0x25e040,_0x1ca307);};}function removeListener(_0x1f0b82,_0x271daa){return function(){UserEvents[_0xc4fd('0x4')](_0x1f0b82,_0x271daa);};}exports[_0xc4fd('0x5')]=function(_0x132cab){for(var _0x1219e7=0x0,_0x44a301=events[_0xc4fd('0x6')];_0x1219e7<_0x44a301;_0x1219e7++){var _0x1d8a38=events[_0x1219e7];var _0x52c1fa=createListener(_0xc4fd('0x7')+_0x1d8a38,_0x132cab);UserEvents['on'](_0x1d8a38,_0x52c1fa);}}; \ No newline at end of file +var _0x143e=['update','emit','register','save','remove'];(function(_0x1fb783,_0x4389dc){var _0xd646a0=function(_0x46781f){while(--_0x46781f){_0x1fb783['push'](_0x1fb783['shift']());}};_0xd646a0(++_0x4389dc);}(_0x143e,0x1b1));var _0xe143=function(_0x4c90c2,_0x5dbd26){_0x4c90c2=_0x4c90c2-0x0;var _0x4939a2=_0x143e[_0x4c90c2];return _0x4939a2;};'use strict';var UserEvents=require('./user.events');var events=[_0xe143('0x0'),_0xe143('0x1'),_0xe143('0x2')];function createListener(_0x3071bf,_0x365fe2){return function(_0x1a2ad9){_0x365fe2[_0xe143('0x3')](_0x3071bf,_0x1a2ad9);};}function removeListener(_0x406299,_0x159868){return function(){UserEvents['removeListener'](_0x406299,_0x159868);};}exports[_0xe143('0x4')]=function(_0xfe0aee){for(var _0x2bf637=0x0,_0x1134e4=events['length'];_0x2bf637<_0x1134e4;_0x2bf637++){var _0x5d36d2=events[_0x2bf637];var _0x21fc40=createListener('user:'+_0x5d36d2,_0xfe0aee);UserEvents['on'](_0x5d36d2,_0x21fc40);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index eea3655..e90f7e7 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 _0x74f2=['Router','../../components/auth/service','exports','multer','util','path','connect-timeout','express'];(function(_0x5fa488,_0x116911){var _0x481878=function(_0x2bbcc9){while(--_0x2bbcc9){_0x5fa488['push'](_0x5fa488['shift']());}};_0x481878(++_0x116911);}(_0x74f2,0x10b));var _0x274f=function(_0xcf235b,_0x4df6a3){_0xcf235b=_0xcf235b-0x0;var _0x2aa0e8=_0x74f2[_0xcf235b];return _0x2aa0e8;};'use strict';var multer=require(_0x274f('0x0'));var util=require(_0x274f('0x1'));var path=require(_0x274f('0x2'));var timeout=require(_0x274f('0x3'));var express=require(_0x274f('0x4'));var router=express[_0x274f('0x5')]();var auth=require(_0x274f('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x274f('0x7')]=router; \ No newline at end of file +var _0x6741=['../../components/interaction/service','../../config/environment','exports','multer','path','../../components/auth/service'];(function(_0x4eca44,_0x3482ee){var _0x1a8b00=function(_0x456685){while(--_0x456685){_0x4eca44['push'](_0x4eca44['shift']());}};_0x1a8b00(++_0x3482ee);}(_0x6741,0xf3));var _0x1674=function(_0x3bfdbe,_0x2b9cc2){_0x3bfdbe=_0x3bfdbe-0x0;var _0x5e8d0b=_0x6741[_0x3bfdbe];return _0x5e8d0b;};'use strict';var multer=require(_0x1674('0x0'));var util=require('util');var path=require(_0x1674('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0x1674('0x2'));var interaction=require(_0x1674('0x3'));var config=require(_0x1674('0x4'));module[_0x1674('0x5')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 11c53cd..bdaa0de 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(_0x1e2291,_0x1a2e3d){var _0x28734c=function(_0x7ef8fe){while(--_0x7ef8fe){_0x1e2291['push'](_0x1e2291['shift']());}};_0x28734c(++_0x1a2e3d);}(_0xe706,0xa3));var _0x6e70=function(_0x236912,_0x4167cd){_0x236912=_0x236912-0x0;var _0x582904=_0xe706[_0x236912];return _0x582904;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'penalty':{'type':Sequelize[_0x6e70('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe706=['INTEGER','sequelize','exports'];(function(_0xa30626,_0x2f1a53){var _0x33b659=function(_0x4632e1){while(--_0x4632e1){_0xa30626['push'](_0xa30626['shift']());}};_0x33b659(++_0x2f1a53);}(_0xe706,0xa3));var _0x6e70=function(_0x3046da,_0x599123){_0x3046da=_0x3046da-0x0;var _0x467db2=_0xe706[_0x3046da];return _0x467db2;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'penalty':{'type':Sequelize[_0x6e70('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index 1357a2e..555cf33 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 _0xa5d9=['api','moment','rimraf','../../config/environment','exports','define','UserChatQueue','user_has_chat_queues','lodash','util','../../config/logger'];(function(_0x50576c,_0x502d9c){var _0x22c1ef=function(_0x4067e7){while(--_0x4067e7){_0x50576c['push'](_0x50576c['shift']());}};_0x22c1ef(++_0x502d9c);}(_0xa5d9,0xb8));var _0x9a5d=function(_0x3b2249,_0x1815d4){_0x3b2249=_0x3b2249-0x0;var _0x11d36b=_0xa5d9[_0x3b2249];return _0x11d36b;};'use strict';var _=require(_0x9a5d('0x0'));var util=require(_0x9a5d('0x1'));var logger=require(_0x9a5d('0x2'))(_0x9a5d('0x3'));var moment=require(_0x9a5d('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9a5d('0x5'));var config=require(_0x9a5d('0x6'));var attributes=require('./userChatQueue.attributes');module[_0x9a5d('0x7')]=function(_0x194752,_0x13898c){return _0x194752[_0x9a5d('0x8')](_0x9a5d('0x9'),attributes,{'tableName':_0x9a5d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x60d7=['exports','define','UserChatQueue','user_has_chat_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x54e66b,_0x5ecd0c){var _0x1a441e=function(_0x6bd71e){while(--_0x6bd71e){_0x54e66b['push'](_0x54e66b['shift']());}};_0x1a441e(++_0x5ecd0c);}(_0x60d7,0x149));var _0x760d=function(_0x464cce,_0xae7ecc){_0x464cce=_0x464cce-0x0;var _0x24ef50=_0x60d7[_0x464cce];return _0x24ef50;};'use strict';var _=require(_0x760d('0x0'));var util=require(_0x760d('0x1'));var logger=require(_0x760d('0x2'))(_0x760d('0x3'));var moment=require(_0x760d('0x4'));var BPromise=require(_0x760d('0x5'));var rp=require(_0x760d('0x6'));var fs=require('fs');var path=require(_0x760d('0x7'));var rimraf=require(_0x760d('0x8'));var config=require('../../config/environment');var attributes=require('./userChatQueue.attributes');module[_0x760d('0x9')]=function(_0x42473d,_0x13cb45){return _0x42473d[_0x760d('0xa')](_0x760d('0xb'),attributes,{'tableName':_0x760d('0xc'),'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 8366231..877761d 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 _0xaae6=['UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then'];(function(_0x5c3ae9,_0x450f9a){var _0x3f5950=function(_0x594c1f){while(--_0x594c1f){_0x5c3ae9['push'](_0x5c3ae9['shift']());}};_0x3f5950(++_0x450f9a);}(_0xaae6,0x1d8));var _0x6aae=function(_0x2d8b5d,_0x417b82){_0x2d8b5d=_0x2d8b5d-0x0;var _0x5185ea=_0xaae6[_0x2d8b5d];return _0x5185ea;};'use strict';var _=require(_0x6aae('0x0'));var util=require('util');var moment=require(_0x6aae('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6aae('0x2'));var db=require(_0x6aae('0x3'))['db'];var utils=require(_0x6aae('0x4'));var logger=require(_0x6aae('0x5'))(_0x6aae('0x6'));var config=require('../../config/environment');var jayson=require(_0x6aae('0x7'));var client=jayson[_0x6aae('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x26edac,_0x21e4f3,_0x203860){return new BPromise(function(_0x2f5247,_0x15a8ca){return client[_0x6aae('0x9')](_0x26edac,_0x203860)[_0x6aae('0xa')](function(_0xb8b13c){logger['info'](_0x6aae('0xb'),_0x21e4f3,_0x6aae('0xc'));logger[_0x6aae('0xd')](_0x6aae('0xe'),_0x21e4f3,'request\x20sent',JSON[_0x6aae('0xf')](_0xb8b13c));if(_0xb8b13c[_0x6aae('0x10')]){if(_0xb8b13c[_0x6aae('0x10')][_0x6aae('0x11')]===0x1f4){logger['error'](_0x6aae('0xb'),_0x21e4f3,_0xb8b13c[_0x6aae('0x10')]['message']);return _0x15a8ca(_0xb8b13c[_0x6aae('0x10')]['message']);}logger[_0x6aae('0x10')](_0x6aae('0xb'),_0x21e4f3,_0xb8b13c[_0x6aae('0x10')][_0x6aae('0x12')]);return _0x2f5247(_0xb8b13c[_0x6aae('0x10')][_0x6aae('0x12')]);}else{logger['info']('UserChatQueue,\x20%s,\x20%s',_0x21e4f3,_0x6aae('0xc'));_0x2f5247(_0xb8b13c[_0x6aae('0x13')][_0x6aae('0x12')]);}})[_0x6aae('0x14')](function(_0x1ccb9e){logger['error'](_0x6aae('0xb'),_0x21e4f3,_0x1ccb9e);_0x15a8ca(_0x1ccb9e);});});} \ No newline at end of file +var _0xe1fa=['UserChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','UserChatQueue,\x20%s,\x20%s','debug'];(function(_0x124014,_0x1d4d34){var _0x55af6d=function(_0x5c9e60){while(--_0x5c9e60){_0x124014['push'](_0x124014['shift']());}};_0x55af6d(++_0x1d4d34);}(_0xe1fa,0x196));var _0xae1f=function(_0x48890d,_0x2464d5){_0x48890d=_0x48890d-0x0;var _0x487dd7=_0xe1fa[_0x48890d];return _0x487dd7;};'use strict';var _=require('lodash');var util=require(_0xae1f('0x0'));var moment=require('moment');var BPromise=require(_0xae1f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xae1f('0x2'));var db=require(_0xae1f('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xae1f('0x4'))(_0xae1f('0x5'));var config=require('../../config/environment');var jayson=require(_0xae1f('0x6'));var client=jayson[_0xae1f('0x7')][_0xae1f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x850c55,_0x5b33a2,_0x34ecbf){return new BPromise(function(_0xb7dd4,_0x1c817d){return client[_0xae1f('0x9')](_0x850c55,_0x34ecbf)[_0xae1f('0xa')](function(_0x54ffc3){logger[_0xae1f('0xb')](_0xae1f('0xc'),_0x5b33a2,'request\x20sent');logger[_0xae1f('0xd')](_0xae1f('0xe'),_0x5b33a2,_0xae1f('0xf'),JSON[_0xae1f('0x10')](_0x54ffc3));if(_0x54ffc3['error']){if(_0x54ffc3['error']['code']===0x1f4){logger['error'](_0xae1f('0xc'),_0x5b33a2,_0x54ffc3[_0xae1f('0x11')][_0xae1f('0x12')]);return _0x1c817d(_0x54ffc3[_0xae1f('0x11')][_0xae1f('0x12')]);}logger['error'](_0xae1f('0xc'),_0x5b33a2,_0x54ffc3[_0xae1f('0x11')][_0xae1f('0x12')]);return _0xb7dd4(_0x54ffc3['error']['message']);}else{logger[_0xae1f('0xb')](_0xae1f('0xc'),_0x5b33a2,_0xae1f('0xf'));_0xb7dd4(_0x54ffc3['result'][_0xae1f('0x12')]);}})[_0xae1f('0x13')](function(_0x326f8b){logger[_0xae1f('0x11')](_0xae1f('0xc'),_0x5b33a2,_0x326f8b);_0x1c817d(_0x326f8b);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 206da5a..35ece01 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 _0xc6cc=['../../components/interaction/service','exports','express','../../components/auth/service'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0xc6cc,0xda));var _0xcc6c=function(_0x3babda,_0x2156fb){_0x3babda=_0x3babda-0x0;var _0x43198d=_0xc6cc[_0x3babda];return _0x43198d;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xcc6c('0x0'));var router=express['Router']();var auth=require(_0xcc6c('0x1'));var interaction=require(_0xcc6c('0x2'));var config=require('../../config/environment');module[_0xcc6c('0x3')]=router; \ No newline at end of file +var _0xe493=['../../components/interaction/service','../../config/environment','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x30ecbe,_0x35b3f3){var _0x2a0965=function(_0x527aaa){while(--_0x527aaa){_0x30ecbe['push'](_0x30ecbe['shift']());}};_0x2a0965(++_0x35b3f3);}(_0xe493,0xe9));var _0x3e49=function(_0x2f8b7b,_0x47a28a){_0x2f8b7b=_0x2f8b7b-0x0;var _0x4b51a8=_0xe493[_0x2f8b7b];return _0x4b51a8;};'use strict';var multer=require(_0x3e49('0x0'));var util=require(_0x3e49('0x1'));var path=require(_0x3e49('0x2'));var timeout=require(_0x3e49('0x3'));var express=require(_0x3e49('0x4'));var router=express[_0x3e49('0x5')]();var auth=require(_0x3e49('0x6'));var interaction=require(_0x3e49('0x7'));var config=require(_0x3e49('0x8'));module[_0x3e49('0x9')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 9e64e56..afb4ba5 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(_0x2c66dc,_0x38040c){var _0x133d8e=function(_0x4decce){while(--_0x4decce){_0x2c66dc['push'](_0x2c66dc['shift']());}};_0x133d8e(++_0x38040c);}(_0xda2d,0x102));var _0xdda2=function(_0x3602ea,_0x7ddcf0){_0x3602ea=_0x3602ea-0x0;var _0x291332=_0xda2d[_0x3602ea];return _0x291332;};'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 _0x9348=['STRING','sequelize','exports','INTEGER'];(function(_0x28a962,_0x43df87){var _0x464266=function(_0x41cd49){while(--_0x41cd49){_0x28a962['push'](_0x28a962['shift']());}};_0x464266(++_0x43df87);}(_0x9348,0x10d));var _0x8934=function(_0x56ac57,_0x546ec0){_0x56ac57=_0x56ac57-0x0;var _0x1f7972=_0x9348[_0x56ac57];return _0x1f7972;};'use strict';var Sequelize=require(_0x8934('0x0'));module[_0x8934('0x1')]={'penalty':{'type':Sequelize[_0x8934('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x8934('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x8934('0x3')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index a935f2f..66527e2 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 _0x3c67=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./userFaxQueue.attributes','define','util','../../config/logger','api'];(function(_0x1ddb32,_0x42f48b){var _0x5b5036=function(_0x51f50e){while(--_0x51f50e){_0x1ddb32['push'](_0x1ddb32['shift']());}};_0x5b5036(++_0x42f48b);}(_0x3c67,0x131));var _0x73c6=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0x3c67[_0x82129b];return _0x2ae5dc;};'use strict';var _=require('lodash');var util=require(_0x73c6('0x0'));var logger=require(_0x73c6('0x1'))(_0x73c6('0x2'));var moment=require(_0x73c6('0x3'));var BPromise=require(_0x73c6('0x4'));var rp=require(_0x73c6('0x5'));var fs=require('fs');var path=require(_0x73c6('0x6'));var rimraf=require(_0x73c6('0x7'));var config=require(_0x73c6('0x8'));var attributes=require(_0x73c6('0x9'));module['exports']=function(_0x3355eb,_0x401f19){return _0x3355eb[_0x73c6('0xa')]('UserFaxQueue',attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x61ef=['exports','define','UserFaxQueue','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userFaxQueue.attributes'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x61ef,0x12e));var _0xf61e=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0x61ef[_0x5a776b];return _0xbbef59;};'use strict';var _=require('lodash');var util=require(_0xf61e('0x0'));var logger=require(_0xf61e('0x1'))(_0xf61e('0x2'));var moment=require(_0xf61e('0x3'));var BPromise=require(_0xf61e('0x4'));var rp=require(_0xf61e('0x5'));var fs=require('fs');var path=require(_0xf61e('0x6'));var rimraf=require(_0xf61e('0x7'));var config=require(_0xf61e('0x8'));var attributes=require(_0xf61e('0x9'));module[_0xf61e('0xa')]=function(_0x26585e,_0x2f585e){return _0x26585e[_0xf61e('0xb')](_0xf61e('0xc'),attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js index ca794ee..1459ed6 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 _0xba38=['catch','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','UserFaxQueue,\x20%s,\x20%s','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x10004e,_0xd701e6){var _0x5af990=function(_0x4bab6a){while(--_0x4bab6a){_0x10004e['push'](_0x10004e['shift']());}};_0x5af990(++_0xd701e6);}(_0xba38,0x190));var _0x8ba3=function(_0x35fa5a,_0x58693b){_0x35fa5a=_0x35fa5a-0x0;var _0x12f78d=_0xba38[_0x35fa5a];return _0x12f78d;};'use strict';var _=require('lodash');var util=require(_0x8ba3('0x0'));var moment=require(_0x8ba3('0x1'));var BPromise=require(_0x8ba3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8ba3('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x8ba3('0x4'));var logger=require(_0x8ba3('0x5'))(_0x8ba3('0x6'));var config=require(_0x8ba3('0x7'));var jayson=require(_0x8ba3('0x8'));var client=jayson[_0x8ba3('0x9')][_0x8ba3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x17276c,_0x193e7e,_0x1dab1f){return new BPromise(function(_0x1b02f3,_0x1be1c3){return client['request'](_0x17276c,_0x1dab1f)[_0x8ba3('0xb')](function(_0x3041b5){logger['info'](_0x8ba3('0xc'),_0x193e7e,'request\x20sent');logger[_0x8ba3('0xd')](_0x8ba3('0xe'),_0x193e7e,_0x8ba3('0xf'),JSON[_0x8ba3('0x10')](_0x3041b5));if(_0x3041b5[_0x8ba3('0x11')]){if(_0x3041b5[_0x8ba3('0x11')][_0x8ba3('0x12')]===0x1f4){logger[_0x8ba3('0x11')](_0x8ba3('0xc'),_0x193e7e,_0x3041b5['error'][_0x8ba3('0x13')]);return _0x1be1c3(_0x3041b5[_0x8ba3('0x11')]['message']);}logger[_0x8ba3('0x11')]('UserFaxQueue,\x20%s,\x20%s',_0x193e7e,_0x3041b5[_0x8ba3('0x11')]['message']);return _0x1b02f3(_0x3041b5[_0x8ba3('0x11')][_0x8ba3('0x13')]);}else{logger['info'](_0x8ba3('0xc'),_0x193e7e,_0x8ba3('0xf'));_0x1b02f3(_0x3041b5['result'][_0x8ba3('0x13')]);}})[_0x8ba3('0x14')](function(_0x4c0818){logger['error'](_0x8ba3('0xc'),_0x193e7e,_0x4c0818);_0x1be1c3(_0x4c0818);});});} \ No newline at end of file +var _0x7ad0=['info','catch','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','UserFaxQueue,\x20%s,\x20%s','request\x20sent','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x289765,_0x234a11){var _0x3421df=function(_0x29e1c8){while(--_0x29e1c8){_0x289765['push'](_0x289765['shift']());}};_0x3421df(++_0x234a11);}(_0x7ad0,0x11a));var _0x07ad=function(_0x44ddc4,_0x101ca3){_0x44ddc4=_0x44ddc4-0x0;var _0x1e0f91=_0x7ad0[_0x44ddc4];return _0x1e0f91;};'use strict';var _=require(_0x07ad('0x0'));var util=require('util');var moment=require(_0x07ad('0x1'));var BPromise=require(_0x07ad('0x2'));var rs=require(_0x07ad('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x07ad('0x4'));var logger=require(_0x07ad('0x5'))(_0x07ad('0x6'));var config=require(_0x07ad('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x07ad('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x487a9b,_0x5a57ef,_0x186549){return new BPromise(function(_0x54dcbd,_0x578336){return client[_0x07ad('0x9')](_0x487a9b,_0x186549)[_0x07ad('0xa')](function(_0x25f4ad){logger['info'](_0x07ad('0xb'),_0x5a57ef,_0x07ad('0xc'));logger['debug'](_0x07ad('0xd'),_0x5a57ef,'request\x20sent',JSON[_0x07ad('0xe')](_0x25f4ad));if(_0x25f4ad[_0x07ad('0xf')]){if(_0x25f4ad['error'][_0x07ad('0x10')]===0x1f4){logger[_0x07ad('0xf')](_0x07ad('0xb'),_0x5a57ef,_0x25f4ad['error'][_0x07ad('0x11')]);return _0x578336(_0x25f4ad[_0x07ad('0xf')]['message']);}logger[_0x07ad('0xf')](_0x07ad('0xb'),_0x5a57ef,_0x25f4ad[_0x07ad('0xf')]['message']);return _0x54dcbd(_0x25f4ad[_0x07ad('0xf')][_0x07ad('0x11')]);}else{logger[_0x07ad('0x12')](_0x07ad('0xb'),_0x5a57ef,'request\x20sent');_0x54dcbd(_0x25f4ad['result'][_0x07ad('0x11')]);}})[_0x07ad('0x13')](function(_0x28e17c){logger['error'](_0x07ad('0xb'),_0x5a57ef,_0x28e17c);_0x578336(_0x28e17c);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 7e2b799..5b8a741 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 _0x8472=['express','Router','../../components/auth/service','exports','multer','util','path','connect-timeout'];(function(_0x4cbdb7,_0x1b82f6){var _0x4ecb18=function(_0x48271f){while(--_0x48271f){_0x4cbdb7['push'](_0x4cbdb7['shift']());}};_0x4ecb18(++_0x1b82f6);}(_0x8472,0x13c));var _0x2847=function(_0x19e000,_0x5599d7){_0x19e000=_0x19e000-0x0;var _0x3ab816=_0x8472[_0x19e000];return _0x3ab816;};'use strict';var multer=require(_0x2847('0x0'));var util=require(_0x2847('0x1'));var path=require(_0x2847('0x2'));var timeout=require(_0x2847('0x3'));var express=require(_0x2847('0x4'));var router=express[_0x2847('0x5')]();var auth=require(_0x2847('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x2847('0x7')]=router; \ No newline at end of file +var _0xd62b=['../../config/environment','exports','util','path','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x14d602,_0x2e84eb){var _0x22264c=function(_0x40bfb5){while(--_0x40bfb5){_0x14d602['push'](_0x14d602['shift']());}};_0x22264c(++_0x2e84eb);}(_0xd62b,0x8e));var _0xbd62=function(_0x35ef6b,_0x202c42){_0x35ef6b=_0x35ef6b-0x0;var _0x3ad145=_0xd62b[_0x35ef6b];return _0x3ad145;};'use strict';var multer=require('multer');var util=require(_0xbd62('0x0'));var path=require(_0xbd62('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbd62('0x2')]();var auth=require(_0xbd62('0x3'));var interaction=require(_0xbd62('0x4'));var config=require(_0xbd62('0x5'));module[_0xbd62('0x6')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index dd8e6ac..45c9ace 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 _0xe706=['INTEGER','sequelize','exports'];(function(_0x198ba4,_0x4a5340){var _0x31e9ed=function(_0xfab10b){while(--_0xfab10b){_0x198ba4['push'](_0x198ba4['shift']());}};_0x31e9ed(++_0x4a5340);}(_0xe706,0xa3));var _0x6e70=function(_0x4c5a52,_0x59ef62){_0x4c5a52=_0x4c5a52-0x0;var _0x5b40f5=_0xe706[_0x4c5a52];return _0x5b40f5;};'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(_0x484285,_0x779914){var _0x4868e0=function(_0x450a77){while(--_0x450a77){_0x484285['push'](_0x484285['shift']());}};_0x4868e0(++_0x779914);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'penalty':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index 02c2b10..09422a9 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 _0xb10b=['api','moment','request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes','exports','define','user_has_mail_queues','lodash','../../config/logger'];(function(_0x2a723e,_0x61bb43){var _0x48a0e1=function(_0x470e57){while(--_0x470e57){_0x2a723e['push'](_0x2a723e['shift']());}};_0x48a0e1(++_0x61bb43);}(_0xb10b,0x12a));var _0xbb10=function(_0x4a93e9,_0x5b569f){_0x4a93e9=_0x4a93e9-0x0;var _0x4b3ba7=_0xb10b[_0x4a93e9];return _0x4b3ba7;};'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')]('UserMailQueue',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbaf0=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue','user_has_mail_queues','util'];(function(_0x4d07d9,_0x152e11){var _0xcc917e=function(_0x4109c7){while(--_0x4109c7){_0x4d07d9['push'](_0x4d07d9['shift']());}};_0xcc917e(++_0x152e11);}(_0xbaf0,0x12a));var _0x0baf=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xbaf0[_0x501510];return _0x1e6ee5;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'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 12aa664..486d86c 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 _0x10dc=['message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x5b2b28,_0xfcf44e){var _0x52e491=function(_0xb9faee){while(--_0xb9faee){_0x5b2b28['push'](_0x5b2b28['shift']());}};_0x52e491(++_0xfcf44e);}(_0x10dc,0x107));var _0xc10d=function(_0x80b6a,_0x1b138c){_0x80b6a=_0x80b6a-0x0;var _0x58de9b=_0x10dc[_0x80b6a];return _0x58de9b;};'use strict';var _=require(_0xc10d('0x0'));var util=require(_0xc10d('0x1'));var moment=require('moment');var BPromise=require(_0xc10d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc10d('0x3'));var db=require(_0xc10d('0x4'))['db'];var utils=require(_0xc10d('0x5'));var logger=require(_0xc10d('0x6'))(_0xc10d('0x7'));var config=require(_0xc10d('0x8'));var jayson=require(_0xc10d('0x9'));var client=jayson[_0xc10d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x266240,_0x58c6ec,_0x591e4d){return new BPromise(function(_0x315fff,_0x175e39){return client['request'](_0x266240,_0x591e4d)['then'](function(_0x28b2e9){logger[_0xc10d('0xb')](_0xc10d('0xc'),_0x58c6ec,_0xc10d('0xd'));logger[_0xc10d('0xe')]('UserMailQueue,\x20%s,\x20%s,\x20%s',_0x58c6ec,'request\x20sent',JSON[_0xc10d('0xf')](_0x28b2e9));if(_0x28b2e9['error']){if(_0x28b2e9[_0xc10d('0x10')]['code']===0x1f4){logger[_0xc10d('0x10')]('UserMailQueue,\x20%s,\x20%s',_0x58c6ec,_0x28b2e9[_0xc10d('0x10')][_0xc10d('0x11')]);return _0x175e39(_0x28b2e9[_0xc10d('0x10')][_0xc10d('0x11')]);}logger[_0xc10d('0x10')]('UserMailQueue,\x20%s,\x20%s',_0x58c6ec,_0x28b2e9[_0xc10d('0x10')]['message']);return _0x315fff(_0x28b2e9[_0xc10d('0x10')][_0xc10d('0x11')]);}else{logger[_0xc10d('0xb')](_0xc10d('0xc'),_0x58c6ec,_0xc10d('0xd'));_0x315fff(_0x28b2e9[_0xc10d('0x12')][_0xc10d('0x11')]);}})[_0xc10d('0x13')](function(_0x4f6352){logger['error'](_0xc10d('0xc'),_0x58c6ec,_0x4f6352);_0x175e39(_0x4f6352);});});} \ No newline at end of file +var _0x16a7=['then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x285800,_0x26765e){var _0x4b809e=function(_0x12c58b){while(--_0x12c58b){_0x285800['push'](_0x285800['shift']());}};_0x4b809e(++_0x26765e);}(_0x16a7,0xa5));var _0x716a=function(_0x10d90e,_0x486d99){_0x10d90e=_0x10d90e-0x0;var _0x162530=_0x16a7[_0x10d90e];return _0x162530;};'use strict';var _=require(_0x716a('0x0'));var util=require(_0x716a('0x1'));var moment=require(_0x716a('0x2'));var BPromise=require(_0x716a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x716a('0x4'))['db'];var utils=require(_0x716a('0x5'));var logger=require('../../config/logger')(_0x716a('0x6'));var config=require(_0x716a('0x7'));var jayson=require(_0x716a('0x8'));var client=jayson[_0x716a('0x9')][_0x716a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x557d05,_0xbff339,_0x1ee0e2){return new BPromise(function(_0x724309,_0x42d47e){return client['request'](_0x557d05,_0x1ee0e2)[_0x716a('0xb')](function(_0xb269f0){logger[_0x716a('0xc')](_0x716a('0xd'),_0xbff339,_0x716a('0xe'));logger[_0x716a('0xf')]('UserMailQueue,\x20%s,\x20%s,\x20%s',_0xbff339,_0x716a('0xe'),JSON[_0x716a('0x10')](_0xb269f0));if(_0xb269f0[_0x716a('0x11')]){if(_0xb269f0[_0x716a('0x11')][_0x716a('0x12')]===0x1f4){logger[_0x716a('0x11')](_0x716a('0xd'),_0xbff339,_0xb269f0['error'][_0x716a('0x13')]);return _0x42d47e(_0xb269f0[_0x716a('0x11')]['message']);}logger[_0x716a('0x11')]('UserMailQueue,\x20%s,\x20%s',_0xbff339,_0xb269f0[_0x716a('0x11')][_0x716a('0x13')]);return _0x724309(_0xb269f0['error'][_0x716a('0x13')]);}else{logger[_0x716a('0xc')](_0x716a('0xd'),_0xbff339,_0x716a('0xe'));_0x724309(_0xb269f0[_0x716a('0x14')][_0x716a('0x13')]);}})[_0x716a('0x15')](function(_0x5c5ee0){logger[_0x716a('0x11')](_0x716a('0xd'),_0xbff339,_0x5c5ee0);_0x42d47e(_0x5c5ee0);});});} \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 9e86940..657cacb 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 _0xfc52=['util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfc52,0x77));var _0x2fc5=function(_0x100332,_0x4296e1){_0x100332=_0x100332-0x0;var _0x308ffc=_0xfc52[_0x100332];return _0x308ffc;};'use strict';var multer=require('multer');var util=require(_0x2fc5('0x0'));var path=require(_0x2fc5('0x1'));var timeout=require(_0x2fc5('0x2'));var express=require('express');var router=express[_0x2fc5('0x3')]();var auth=require(_0x2fc5('0x4'));var interaction=require(_0x2fc5('0x5'));var config=require(_0x2fc5('0x6'));module['exports']=router; \ No newline at end of file +var _0x6409=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','util'];(function(_0x16cf83,_0x6ed936){var _0x3a5c42=function(_0x366e68){while(--_0x366e68){_0x16cf83['push'](_0x16cf83['shift']());}};_0x3a5c42(++_0x6ed936);}(_0x6409,0x1c0));var _0x9640=function(_0x4df4a9,_0x50b998){_0x4df4a9=_0x4df4a9-0x0;var _0x31c77a=_0x6409[_0x4df4a9];return _0x31c77a;};'use strict';var multer=require(_0x9640('0x0'));var util=require(_0x9640('0x1'));var path=require(_0x9640('0x2'));var timeout=require(_0x9640('0x3'));var express=require(_0x9640('0x4'));var router=express[_0x9640('0x5')]();var auth=require(_0x9640('0x6'));var interaction=require(_0x9640('0x7'));var config=require(_0x9640('0x8'));module[_0x9640('0x9')]=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 6f206d2..fbfae9d 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(_0x18e0e7,_0xafa137){var _0x4c758d=function(_0x52252a){while(--_0x52252a){_0x18e0e7['push'](_0x18e0e7['shift']());}};_0x4c758d(++_0xafa137);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xd8b0=['exports','sequelize'];(function(_0x2f3d29,_0x150e7b){var _0x53d69d=function(_0x45f6ec){while(--_0x45f6ec){_0x2f3d29['push'](_0x2f3d29['shift']());}};_0x53d69d(++_0x150e7b);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index 55b2cca..142dd8e 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 _0xc3b9=['exports','define','UserOpenchannelQueue','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes'];(function(_0x103d5f,_0x3dd186){var _0x1f1b0c=function(_0x438b1c){while(--_0x438b1c){_0x103d5f['push'](_0x103d5f['shift']());}};_0x1f1b0c(++_0x3dd186);}(_0xc3b9,0x9f));var _0x9c3b=function(_0x54ef43,_0x308497){_0x54ef43=_0x54ef43-0x0;var _0x4e3816=_0xc3b9[_0x54ef43];return _0x4e3816;};'use strict';var _=require(_0x9c3b('0x0'));var util=require('util');var logger=require(_0x9c3b('0x1'))(_0x9c3b('0x2'));var moment=require('moment');var BPromise=require(_0x9c3b('0x3'));var rp=require(_0x9c3b('0x4'));var fs=require('fs');var path=require(_0x9c3b('0x5'));var rimraf=require(_0x9c3b('0x6'));var config=require(_0x9c3b('0x7'));var attributes=require(_0x9c3b('0x8'));module[_0x9c3b('0x9')]=function(_0x5a339e,_0x1b08f9){return _0x5a339e[_0x9c3b('0xa')](_0x9c3b('0xb'),attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc2b5=['user_has_openchannel_queues','lodash','util','api','moment','bluebird','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','UserOpenchannelQueue'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc2b5,0xe8));var _0x5c2b=function(_0x17f7f4,_0x27f052){_0x17f7f4=_0x17f7f4-0x0;var _0x4017dc=_0xc2b5[_0x17f7f4];return _0x4017dc;};'use strict';var _=require(_0x5c2b('0x0'));var util=require(_0x5c2b('0x1'));var logger=require('../../config/logger')(_0x5c2b('0x2'));var moment=require(_0x5c2b('0x3'));var BPromise=require(_0x5c2b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5c2b('0x5'));var config=require(_0x5c2b('0x6'));var attributes=require(_0x5c2b('0x7'));module[_0x5c2b('0x8')]=function(_0x3f17af,_0x287a5e){return _0x3f17af['define'](_0x5c2b('0x9'),attributes,{'tableName':_0x5c2b('0xa'),'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 5789f14..7ffc7eb 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 _0x8767=['jayson/promise','client','http','request','then','info','request\x20sent','error','UserOpenchannelQueue,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc'];(function(_0x4fadaf,_0x179d85){var _0x4738a8=function(_0x34ce7b){while(--_0x34ce7b){_0x4fadaf['push'](_0x4fadaf['shift']());}};_0x4738a8(++_0x179d85);}(_0x8767,0x116));var _0x7876=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8767[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7876('0x0'));var util=require(_0x7876('0x1'));var moment=require(_0x7876('0x2'));var BPromise=require('bluebird');var rs=require(_0x7876('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7876('0x4'));var logger=require(_0x7876('0x5'))(_0x7876('0x6'));var config=require('../../config/environment');var jayson=require(_0x7876('0x7'));var client=jayson[_0x7876('0x8')][_0x7876('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4bcc2a,_0x1fd389,_0x544979){return new BPromise(function(_0xc1d1b8,_0x27d11c){return client[_0x7876('0xa')](_0x4bcc2a,_0x544979)[_0x7876('0xb')](function(_0x46af42){logger[_0x7876('0xc')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x1fd389,_0x7876('0xd'));logger['debug']('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x1fd389,_0x7876('0xd'),JSON['stringify'](_0x46af42));if(_0x46af42[_0x7876('0xe')]){if(_0x46af42[_0x7876('0xe')]['code']===0x1f4){logger[_0x7876('0xe')](_0x7876('0xf'),_0x1fd389,_0x46af42[_0x7876('0xe')][_0x7876('0x10')]);return _0x27d11c(_0x46af42[_0x7876('0xe')][_0x7876('0x10')]);}logger[_0x7876('0xe')](_0x7876('0xf'),_0x1fd389,_0x46af42['error'][_0x7876('0x10')]);return _0xc1d1b8(_0x46af42[_0x7876('0xe')][_0x7876('0x10')]);}else{logger[_0x7876('0xc')](_0x7876('0xf'),_0x1fd389,_0x7876('0xd'));_0xc1d1b8(_0x46af42[_0x7876('0x11')][_0x7876('0x10')]);}})[_0x7876('0x12')](function(_0x4e1316){logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x1fd389,_0x4e1316);_0x27d11c(_0x4e1316);});});} \ No newline at end of file +var _0x7ccf=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','UserOpenchannelQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x310db7,_0x3f70a1){var _0x23b855=function(_0x1487d6){while(--_0x1487d6){_0x310db7['push'](_0x310db7['shift']());}};_0x23b855(++_0x3f70a1);}(_0x7ccf,0x1c9));var _0xf7cc=function(_0x372515,_0xdd11f){_0x372515=_0x372515-0x0;var _0xa3bf4e=_0x7ccf[_0x372515];return _0xa3bf4e;};'use strict';var _=require(_0xf7cc('0x0'));var util=require(_0xf7cc('0x1'));var moment=require(_0xf7cc('0x2'));var BPromise=require('bluebird');var rs=require(_0xf7cc('0x3'));var fs=require('fs');var Redis=require(_0xf7cc('0x4'));var db=require(_0xf7cc('0x5'))['db'];var utils=require(_0xf7cc('0x6'));var logger=require(_0xf7cc('0x7'))(_0xf7cc('0x8'));var config=require(_0xf7cc('0x9'));var jayson=require(_0xf7cc('0xa'));var client=jayson[_0xf7cc('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x10b3d9,_0x10b5fb,_0x4961df){return new BPromise(function(_0x47bf80,_0x28b317){return client[_0xf7cc('0xc')](_0x10b3d9,_0x4961df)['then'](function(_0x3505f5){logger[_0xf7cc('0xd')](_0xf7cc('0xe'),_0x10b5fb,'request\x20sent');logger[_0xf7cc('0xf')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x10b5fb,_0xf7cc('0x10'),JSON[_0xf7cc('0x11')](_0x3505f5));if(_0x3505f5[_0xf7cc('0x12')]){if(_0x3505f5['error'][_0xf7cc('0x13')]===0x1f4){logger[_0xf7cc('0x12')](_0xf7cc('0xe'),_0x10b5fb,_0x3505f5['error'][_0xf7cc('0x14')]);return _0x28b317(_0x3505f5[_0xf7cc('0x12')][_0xf7cc('0x14')]);}logger[_0xf7cc('0x12')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x10b5fb,_0x3505f5[_0xf7cc('0x12')][_0xf7cc('0x14')]);return _0x47bf80(_0x3505f5[_0xf7cc('0x12')][_0xf7cc('0x14')]);}else{logger[_0xf7cc('0xd')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x10b5fb,'request\x20sent');_0x47bf80(_0x3505f5[_0xf7cc('0x15')]['message']);}})[_0xf7cc('0x16')](function(_0x4bd726){logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x10b5fb,_0x4bd726);_0x28b317(_0x4bd726);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 4626fd9..3772d29 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 _0x38b1=['destroy','delete','removeSections','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/sections','getSections','getResources','post','/:id/clone','clone','addSections','/:id/resources','addResources','put','update'];(function(_0x4c70c4,_0x963969){var _0x437865=function(_0x54e323){while(--_0x54e323){_0x4c70c4['push'](_0x4c70c4['shift']());}};_0x437865(++_0x963969);}(_0x38b1,0x18c));var _0x138b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x38b1[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x138b('0x0'));var util=require(_0x138b('0x1'));var path=require(_0x138b('0x2'));var timeout=require(_0x138b('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x138b('0x4'));var interaction=require(_0x138b('0x5'));var config=require('../../config/environment');var controller=require('./userProfile.controller');router['get']('/',auth[_0x138b('0x6')](),controller[_0x138b('0x7')]);router[_0x138b('0x8')](_0x138b('0x9'),auth['isAuthenticated'](),controller[_0x138b('0xa')]);router[_0x138b('0x8')](_0x138b('0xb'),auth[_0x138b('0x6')](),controller[_0x138b('0xc')]);router['get'](_0x138b('0xd'),auth['isAuthenticated'](),controller[_0x138b('0xe')]);router[_0x138b('0x8')]('/:id/resources',auth[_0x138b('0x6')](),controller[_0x138b('0xf')]);router[_0x138b('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x138b('0x10')](_0x138b('0x11'),auth['isAuthenticated'](),controller[_0x138b('0x12')]);router[_0x138b('0x10')]('/:id/sections',auth[_0x138b('0x6')](),controller[_0x138b('0x13')]);router[_0x138b('0x10')](_0x138b('0x14'),auth[_0x138b('0x6')](),controller[_0x138b('0x15')]);router[_0x138b('0x16')](_0x138b('0xb'),auth[_0x138b('0x6')](),controller[_0x138b('0x17')]);router['delete'](_0x138b('0xb'),auth['isAuthenticated'](),controller[_0x138b('0x18')]);router[_0x138b('0x19')](_0x138b('0xd'),auth[_0x138b('0x6')](),controller[_0x138b('0x1a')]);router['delete'](_0x138b('0x14'),auth[_0x138b('0x6')](),controller['removeResources']);module[_0x138b('0x1b')]=router; \ No newline at end of file +var _0x15e0=['/:id/sections','getSections','/:id/resources','getResources','post','create','/:id/clone','clone','addSections','put','update','destroy','delete','removeSections','removeResources','multer','util','path','connect-timeout','../../components/auth/service','get','isAuthenticated','index','describe','/:id','show'];(function(_0x305ea7,_0x9764c){var _0x3b9b60=function(_0x103b26){while(--_0x103b26){_0x305ea7['push'](_0x305ea7['shift']());}};_0x3b9b60(++_0x9764c);}(_0x15e0,0x195));var _0x015e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x15e0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x015e('0x0'));var util=require(_0x015e('0x1'));var path=require(_0x015e('0x2'));var timeout=require(_0x015e('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x015e('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./userProfile.controller');router[_0x015e('0x5')]('/',auth[_0x015e('0x6')](),controller[_0x015e('0x7')]);router[_0x015e('0x5')]('/describe',auth['isAuthenticated'](),controller[_0x015e('0x8')]);router[_0x015e('0x5')](_0x015e('0x9'),auth[_0x015e('0x6')](),controller[_0x015e('0xa')]);router[_0x015e('0x5')](_0x015e('0xb'),auth[_0x015e('0x6')](),controller[_0x015e('0xc')]);router[_0x015e('0x5')](_0x015e('0xd'),auth['isAuthenticated'](),controller[_0x015e('0xe')]);router[_0x015e('0xf')]('/',auth['isAuthenticated'](),controller[_0x015e('0x10')]);router[_0x015e('0xf')](_0x015e('0x11'),auth[_0x015e('0x6')](),controller[_0x015e('0x12')]);router['post'](_0x015e('0xb'),auth[_0x015e('0x6')](),controller[_0x015e('0x13')]);router[_0x015e('0xf')](_0x015e('0xd'),auth['isAuthenticated'](),controller['addResources']);router[_0x015e('0x14')](_0x015e('0x9'),auth['isAuthenticated'](),controller[_0x015e('0x15')]);router['delete'](_0x015e('0x9'),auth['isAuthenticated'](),controller[_0x015e('0x16')]);router[_0x015e('0x17')](_0x015e('0xb'),auth[_0x015e('0x6')](),controller[_0x015e('0x18')]);router[_0x015e('0x17')](_0x015e('0xd'),auth[_0x015e('0x6')](),controller[_0x015e('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 80526d2..713b5b1 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 _0x9aa8=['getDataValue','sequelize','exports','STRING','join'];(function(_0x145b3c,_0x31ea4a){var _0x1b6e36=function(_0xfccee6){while(--_0xfccee6){_0x145b3c['push'](_0x145b3c['shift']());}};_0x1b6e36(++_0x31ea4a);}(_0x9aa8,0x155));var _0x89aa=function(_0xdfe71f,_0x3d6df1){_0xdfe71f=_0xdfe71f-0x0;var _0x5f4e40=_0x9aa8[_0xdfe71f];return _0x5f4e40;};'use strict';var Sequelize=require(_0x89aa('0x0'));module[_0x89aa('0x1')]={'name':{'type':Sequelize[_0x89aa('0x2')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0x89aa('0x2')],'set':function(_0x4cff8a){this['setDataValue']('crudPermissions',_0x4cff8a?_0x4cff8a[_0x89aa('0x3')](''):[]);},'get':function(){return this[_0x89aa('0x4')]('crudPermissions')?this[_0x89aa('0x4')]('crudPermissions')['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x89aa('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0xa3f2=['setDataValue','crudPermissions','join','getDataValue','sequelize','exports','STRING','name'];(function(_0x5180c3,_0x4b35f7){var _0x55c975=function(_0x4746cb){while(--_0x4746cb){_0x5180c3['push'](_0x5180c3['shift']());}};_0x55c975(++_0x4b35f7);}(_0xa3f2,0x6c));var _0x2a3f=function(_0x512345,_0x676676){_0x512345=_0x512345-0x0;var _0x203b34=_0xa3f2[_0x512345];return _0x203b34;};'use strict';var Sequelize=require(_0x2a3f('0x0'));module[_0x2a3f('0x1')]={'name':{'type':Sequelize[_0x2a3f('0x2')],'allowNull':![],'unique':_0x2a3f('0x3')},'crudPermissions':{'type':Sequelize[_0x2a3f('0x2')],'set':function(_0x103c2e){this[_0x2a3f('0x4')](_0x2a3f('0x5'),_0x103c2e?_0x103c2e[_0x2a3f('0x6')](''):[]);},'get':function(){return this[_0x2a3f('0x7')]('crudPermissions')?this[_0x2a3f('0x7')](_0x2a3f('0x5'))['split'](''):[];},'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 ab5e36a..b98970a 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 _0x5920=['queuecampaigns','QueueCampaigns','users','agents','Users','admin','Agents','zendeskaccounts','SalesforceAccount','freshdeskaccounts','sugarcrmaccounts','SugarcrmAccount','DeskAccount','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','intervals','Interval','pauses','scheduler','Schedule','Sound','tags','templates','Template','triggers','Trigger','trunks','Trunk','variables','Variable','extractedreports','Reports','metrics','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','sendStatus','status','end','count','offset','limit','set','Content-Range','json','reject','save','update','destroy','error','stack','name','send','index','map','UserProfile','rawAttributes','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','then','includeAll','include','findAll','rows','catch','show','create','body','clone','find','get','omit','updatedAt','createdAt','sequelize','transaction','each','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','UserProfileSection','params','describe','addSections','push','removeSections','ids','getSections','enabled','includes','isEmpty','subsections','findOne','Dashboard','forEach','Plugin','bulkCreate','removeResources','getResources','section','undefined','Sequelize','Unknown\x20section','mergeResources','childModel','ValidationError','Invalid\x20section\x20\x27','parentSections','all','union','ignore','order','key','field','foreignKey','associatedResources','AnalyticExtractedReport','default','reportId','DefaultReports','CustomReports','CmContact','Tags','color','tag','Tag','ThroughTags','value','resourceId','toLowerCase','squareprojects','SquareProject','odbc','SquareOdbc','squarerecordings','SquareRecording','SquareProjects','projects','JscriptyProject','contacts','ListId','lists','CmCompany','globalcustomfields','CmCustomField','chatqueues','chatwebsites','ChatWebsite','faxqueues','FaxQueue','FaxAccount','inboundroutes','outboundroutes','VoiceContext','voicemails','VoiceMail','VoiceRecording','membername','User','role','agent','Telephones','telephone','VoiceQueues','queue','VoiceQueue','inbound','outbound','musiconholds','VoiceMusicOnHold','chanspies','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','OpenchannelQueue','smsqueues','SmsQueue','SmsAccount','voicequeues'];(function(_0x3c6dab,_0x18e012){var _0x77a3f2=function(_0x5679a7){while(--_0x5679a7){_0x3c6dab['push'](_0x3c6dab['shift']());}};_0x77a3f2(++_0x18e012);}(_0x5920,0x1ec));var _0x0592=function(_0xc1daf0,_0x507040){_0xc1daf0=_0xc1daf0-0x0;var _0x509e2a=_0x5920[_0xc1daf0];return _0x509e2a;};'use strict';var pdf=require(_0x0592('0x0'));var emlformat=require(_0x0592('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x0592('0x2'));var jsonpatch=require(_0x0592('0x3'));var rp=require(_0x0592('0x4'));var moment=require('moment');var BPromise=require(_0x0592('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x0592('0x6'));var csv=require('to-csv');var ejs=require(_0x0592('0x7'));var fs=require('fs');var _=require(_0x0592('0x8'));var squel=require(_0x0592('0x9'));var crypto=require(_0x0592('0xa'));var jsforce=require(_0x0592('0xb'));var deskjs=require(_0x0592('0xc'));var toCsv=require('to-csv');var querystring=require(_0x0592('0xd'));var Papa=require(_0x0592('0xe'));var Redis=require('ioredis');var authService=require(_0x0592('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0592('0x10'))(_0x0592('0x11'));var utils=require(_0x0592('0x12'));var config=require(_0x0592('0x13'));var db=require(_0x0592('0x14'))['db'];config[_0x0592('0x15')]=_[_0x0592('0x16')](config[_0x0592('0x15')],{'host':_0x0592('0x17'),'port':0x18eb});var socket=require(_0x0592('0x18'))(new Redis(config[_0x0592('0x15')]));require(_0x0592('0x19'))['register'](socket);function respondWithStatusCode(_0x55dad8,_0x45384c){_0x45384c=_0x45384c||0xcc;return function(_0x29f51b){if(_0x29f51b){return _0x55dad8[_0x0592('0x1a')](_0x45384c);}return _0x55dad8[_0x0592('0x1b')](_0x45384c)[_0x0592('0x1c')]();};}function respondWithResult(_0x45b032,_0x511848){_0x511848=_0x511848||0xc8;return function(_0x268ef6){if(_0x268ef6){return _0x45b032[_0x0592('0x1b')](_0x511848)['json'](_0x268ef6);}};}function respondWithFilteredResult(_0x42ec7c,_0xf84a8e){return function(_0x25ad6d){if(_0x25ad6d){var _0x326d32=_0x25ad6d[_0x0592('0x1d')],_0x5a3d1e=_0xf84a8e[_0x0592('0x1e')],_0xbf85e7=_0xf84a8e['offset']+_0xf84a8e[_0x0592('0x1f')],_0x2f4170;if(_0xbf85e7>=_0x326d32){_0xbf85e7=_0x326d32;_0x2f4170=0xc8;}else{_0x2f4170=0xce;}_0x42ec7c['status'](_0x2f4170);return _0x42ec7c[_0x0592('0x20')](_0x0592('0x21'),_0x5a3d1e+'-'+_0xbf85e7+'/'+_0x326d32)[_0x0592('0x22')](_0x25ad6d);}return null;};}function patchUpdates(_0x23325f){return function(_0x31475f){try{jsonpatch['apply'](_0x31475f,_0x23325f,!![]);}catch(_0x25d92f){return BPromise[_0x0592('0x23')](_0x25d92f);}return _0x31475f[_0x0592('0x24')]();};}function saveUpdates(_0xa1343f,_0x18319e){return function(_0x466110){if(_0x466110){return _0x466110[_0x0592('0x25')](_0xa1343f)['then'](function(_0xbc67cb){return _0xbc67cb;});}return null;};}function removeEntity(_0x2e659,_0x1d3a0b){return function(_0x592fb0){if(_0x592fb0){return _0x592fb0[_0x0592('0x26')]()['then'](function(){_0x2e659[_0x0592('0x1b')](0xcc)[_0x0592('0x1c')]();});}};}function handleEntityNotFound(_0x2306d1,_0x15292e){return function(_0x240b12){if(!_0x240b12){_0x2306d1[_0x0592('0x1a')](0x194);}return _0x240b12;};}function handleError(_0x30d57f,_0x320f01){_0x320f01=_0x320f01||0x1f4;return function(_0x574c72){logger[_0x0592('0x27')](_0x574c72[_0x0592('0x28')]);if(_0x574c72[_0x0592('0x29')]){delete _0x574c72[_0x0592('0x29')];}_0x30d57f[_0x0592('0x1b')](_0x320f01)[_0x0592('0x2a')](_0x574c72);};}exports[_0x0592('0x2b')]=function(_0x4035ef,_0x273576){var _0x126525={},_0x572145={},_0x41d4a7={'count':0x0,'rows':[]};var _0x4ed202=_[_0x0592('0x2c')](db[_0x0592('0x2d')][_0x0592('0x2e')],function(_0x280bf5){return{'name':_0x280bf5['fieldName'],'type':_0x280bf5[_0x0592('0x2f')]['key']};});_0x572145['model']=_['map'](_0x4ed202,'name');_0x572145[_0x0592('0x30')]=_[_0x0592('0x31')](_0x4035ef[_0x0592('0x30')]);_0x572145[_0x0592('0x32')]=_[_0x0592('0x33')](_0x572145[_0x0592('0x34')],_0x572145[_0x0592('0x30')]);_0x126525[_0x0592('0x35')]=_['intersection'](_0x572145[_0x0592('0x34')],qs[_0x0592('0x36')](_0x4035ef[_0x0592('0x30')]['fields']));_0x126525[_0x0592('0x35')]=_0x126525[_0x0592('0x35')][_0x0592('0x37')]?_0x126525[_0x0592('0x35')]:_0x572145['model'];if(!_0x4035ef[_0x0592('0x30')][_0x0592('0x38')](_0x0592('0x39'))){_0x126525[_0x0592('0x1f')]=qs[_0x0592('0x1f')](_0x4035ef[_0x0592('0x30')][_0x0592('0x1f')]);_0x126525[_0x0592('0x1e')]=qs[_0x0592('0x1e')](_0x4035ef[_0x0592('0x30')][_0x0592('0x1e')]);}_0x126525['order']=qs[_0x0592('0x3a')](_0x4035ef[_0x0592('0x30')]['sort']);_0x126525[_0x0592('0x3b')]=qs[_0x0592('0x32')](_[_0x0592('0x3c')](_0x4035ef['query'],_0x572145[_0x0592('0x32')]));if(_0x4035ef[_0x0592('0x30')]['filter']){_0x126525['where']=_[_0x0592('0x3d')](_0x126525[_0x0592('0x3b')],{'$or':_[_0x0592('0x2c')](_0x4ed202,function(_0x3eac3c){if(_0x3eac3c['type']!==_0x0592('0x3e')){var _0x3b7949={};_0x3b7949[_0x3eac3c[_0x0592('0x29')]]={'$like':'%'+_0x4035ef[_0x0592('0x30')][_0x0592('0x3f')]+'%'};return _0x3b7949;}})});}_0x126525=_['merge']({},_0x126525,_0x4035ef[_0x0592('0x40')]);var _0x56d4ef={'where':_0x126525['where']};return db['UserProfile'][_0x0592('0x1d')](_0x56d4ef)[_0x0592('0x41')](function(_0x2970ba){_0x41d4a7[_0x0592('0x1d')]=_0x2970ba;if(_0x4035ef[_0x0592('0x30')][_0x0592('0x42')]){_0x126525[_0x0592('0x43')]=[{'all':!![]}];}return db[_0x0592('0x2d')][_0x0592('0x44')](_0x126525);})['then'](function(_0x1b8224){_0x41d4a7[_0x0592('0x45')]=_0x1b8224;return _0x41d4a7;})['then'](respondWithFilteredResult(_0x273576,_0x126525))[_0x0592('0x46')](handleError(_0x273576,null));};exports[_0x0592('0x47')]=function(_0x409d1f,_0x484ac8){var _0xcb14b6={'raw':![],'where':{'id':_0x409d1f['params']['id']}},_0x33c7aa={};_0x33c7aa[_0x0592('0x34')]=_['keys'](db[_0x0592('0x2d')][_0x0592('0x2e')]);_0x33c7aa[_0x0592('0x30')]=_[_0x0592('0x31')](_0x409d1f['query']);_0x33c7aa[_0x0592('0x32')]=_[_0x0592('0x33')](_0x33c7aa[_0x0592('0x34')],_0x33c7aa[_0x0592('0x30')]);_0xcb14b6['attributes']=_[_0x0592('0x33')](_0x33c7aa[_0x0592('0x34')],qs['fields'](_0x409d1f[_0x0592('0x30')][_0x0592('0x36')]));_0xcb14b6[_0x0592('0x35')]=_0xcb14b6[_0x0592('0x35')][_0x0592('0x37')]?_0xcb14b6[_0x0592('0x35')]:_0x33c7aa[_0x0592('0x34')];if(_0x409d1f[_0x0592('0x30')][_0x0592('0x42')]){_0xcb14b6[_0x0592('0x43')]=[{'all':!![]}];}_0xcb14b6=_[_0x0592('0x3d')]({},_0xcb14b6,_0x409d1f['options']);return db[_0x0592('0x2d')]['find'](_0xcb14b6)[_0x0592('0x41')](handleEntityNotFound(_0x484ac8,null))[_0x0592('0x41')](respondWithResult(_0x484ac8,null))[_0x0592('0x46')](handleError(_0x484ac8,null));};exports[_0x0592('0x48')]=function(_0x337142,_0x26f0ab){return db['UserProfile'][_0x0592('0x48')](_0x337142[_0x0592('0x49')],{})[_0x0592('0x41')](respondWithResult(_0x26f0ab,0xc9))[_0x0592('0x46')](handleError(_0x26f0ab,null));};exports[_0x0592('0x4a')]=function(_0x1b3178,_0x11ce36){var _0x37884c={'where':{'id':_0x1b3178['params']['id']}},_0x4bf831={};_0x4bf831['model']=_[_0x0592('0x31')](db[_0x0592('0x2d')][_0x0592('0x2e')]);_0x37884c[_0x0592('0x35')]=_[_0x0592('0x33')](_0x4bf831['model'],qs[_0x0592('0x36')](_0x1b3178['query'][_0x0592('0x36')]));_0x37884c[_0x0592('0x35')]=_0x37884c[_0x0592('0x35')]['length']?_0x37884c[_0x0592('0x35')]:_0x4bf831[_0x0592('0x34')];if(_0x1b3178[_0x0592('0x30')][_0x0592('0x42')]){_0x37884c['include']=[{'all':!![]}];}_0x37884c=_['merge']({},_0x37884c,_0x1b3178[_0x0592('0x40')]);return db[_0x0592('0x2d')][_0x0592('0x4b')](_0x37884c)[_0x0592('0x41')](handleEntityNotFound(_0x11ce36,null))[_0x0592('0x41')](function(_0x5c9ddd){if(_0x5c9ddd){var _0x344339=_0x5c9ddd[_0x0592('0x4c')]({'plain':!![]});_0x344339=qs[_0x0592('0x4d')](_0x344339,['id','createdAt',_0x0592('0x4e'),'crudPermissions']);_0x1b3178[_0x0592('0x49')]=_[_0x0592('0x4d')](_0x1b3178[_0x0592('0x49')],['id',_0x0592('0x4f'),_0x0592('0x4e')]);return db[_0x0592('0x50')][_0x0592('0x51')](function(_0x48a026){return db[_0x0592('0x2d')][_0x0592('0x48')](_[_0x0592('0x3d')](_0x344339,_0x1b3178['body']),{'include':_0x1b3178[_0x0592('0x30')][_0x0592('0x42')]?[{'all':!![]}]:undefined,'transaction':_0x48a026})[_0x0592('0x41')](function(_0x5eb4f9){var _0x221f53=_0x5eb4f9[_0x0592('0x4c')]({'plain':!![]});return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x1b3178['params']['id']},'raw':!![]})['then'](function(_0x325d30){if(_0x325d30){return BPromise[_0x0592('0x52')](_0x325d30,function(_0x30f8ea){return new BPromise(function(_0x2286db,_0x464629){if(_0x30f8ea[_0x0592('0x53')]===null||_0x30f8ea[_0x0592('0x53')]===0x1)_0x2286db(null);return db[_0x0592('0x54')][_0x0592('0x44')]({'where':{'sectionId':_0x30f8ea['id']},'raw':!![]})[_0x0592('0x41')](function(_0xcd13fa){var _0x1663f7=_['map'](_0xcd13fa,function(_0x2436ff){return qs['omit'](_0x2436ff,['id','createdAt','updatedAt',_0x0592('0x55')]);});_0x2286db(_0x1663f7);})[_0x0592('0x46')](function(_0x2318b1){_0x464629(_0x2318b1);});})['then'](function(_0x8cc2f7){var _0x3ac96c=qs['omit'](_0x30f8ea,['id',_0x0592('0x4f'),_0x0592('0x4e')]);_0x3ac96c[_0x0592('0x56')]=_0x221f53['id'];if(_0x8cc2f7)_0x3ac96c[_0x0592('0x57')]=_0x8cc2f7;return _0x3ac96c;})['then'](function(_0x1719f0){return db[_0x0592('0x58')]['create'](_0x1719f0,{'include':[{'model':db[_0x0592('0x54')],'as':_0x0592('0x57')}],'raw':!![],'transaction':_0x48a026});});})[_0x0592('0x41')](function(){return _0x221f53;});}});});});}})[_0x0592('0x41')](respondWithResult(_0x11ce36,0xc9))[_0x0592('0x46')](handleError(_0x11ce36,null));};exports[_0x0592('0x25')]=function(_0x1eb993,_0x5462ad){if(_0x1eb993[_0x0592('0x49')]['id']){delete _0x1eb993[_0x0592('0x49')]['id'];}return db[_0x0592('0x2d')][_0x0592('0x4b')]({'where':{'id':_0x1eb993[_0x0592('0x59')]['id']}})[_0x0592('0x41')](handleEntityNotFound(_0x5462ad,null))[_0x0592('0x41')](saveUpdates(_0x1eb993[_0x0592('0x49')],null))[_0x0592('0x41')](respondWithResult(_0x5462ad,null))['catch'](handleError(_0x5462ad,null));};exports[_0x0592('0x26')]=function(_0x3d6b1b,_0x4df0cd){return db[_0x0592('0x2d')]['find']({'where':{'id':_0x3d6b1b[_0x0592('0x59')]['id']}})[_0x0592('0x41')](handleEntityNotFound(_0x4df0cd,null))[_0x0592('0x41')](removeEntity(_0x4df0cd,null))[_0x0592('0x46')](handleError(_0x4df0cd,null));};exports[_0x0592('0x5a')]=function(_0x1e291a,_0x34f1bc){return db[_0x0592('0x2d')][_0x0592('0x5a')]()[_0x0592('0x41')](respondWithResult(_0x34f1bc,null))[_0x0592('0x46')](handleError(_0x34f1bc,null));};exports[_0x0592('0x5b')]=function(_0x1756e7,_0x533717){var _0x3778df=_0x1756e7[_0x0592('0x49')];return db[_0x0592('0x2d')][_0x0592('0x4b')]({'where':{'id':_0x1756e7[_0x0592('0x59')]['id']}})[_0x0592('0x41')](handleEntityNotFound(_0x533717,null))[_0x0592('0x41')](function(_0x3a63b0){if(_0x3a63b0){return db[_0x0592('0x50')]['transaction'](function(_0x44fe23){return db[_0x0592('0x58')][_0x0592('0x26')]({'where':{'userProfileId':_0x1756e7[_0x0592('0x59')]['id'],'sectionId':_[_0x0592('0x2c')](_0x3778df,function(_0xb690bd){return _0xb690bd[_0x0592('0x55')];})},'transaction':_0x44fe23})[_0x0592('0x41')](function(){var _0x5550cd=_[_0x0592('0x2c')](_0x3778df,function(_0x570863){_0x570863['userProfileId']=_0x1756e7[_0x0592('0x59')]['id'];return _0x570863;});var _0x20a84c=[];return BPromise[_0x0592('0x52')](_0x5550cd,function(_0x50fd48){return db[_0x0592('0x58')][_0x0592('0x48')](_0x50fd48,{'include':[{'model':db[_0x0592('0x54')],'as':_0x0592('0x57')}],'raw':!![],'transaction':_0x44fe23})[_0x0592('0x41')](function(_0x278760){_0x20a84c[_0x0592('0x5c')](_0x278760[_0x0592('0x4c')]({'plain':!![]}));});})[_0x0592('0x41')](function(){return _0x20a84c;});});});}})[_0x0592('0x41')](function(_0x2be27d){return _0x2be27d;})[_0x0592('0x41')](respondWithResult(_0x533717,null))[_0x0592('0x46')](handleError(_0x533717,null));};exports[_0x0592('0x5d')]=function(_0x22d569,_0xd897d2){var _0x22c163;return db[_0x0592('0x2d')][_0x0592('0x4b')]({'where':{'id':_0x22d569['params']['id']},'attributes':['id',_0x0592('0x29')]})[_0x0592('0x41')](handleEntityNotFound(_0xd897d2,null))[_0x0592('0x41')](function(_0x153770){if(_0x153770){_0x22c163=_0x153770;return db[_0x0592('0x58')]['destroy']({'where':{'userProfileId':_0x22d569[_0x0592('0x59')]['id'],'sectionId':_0x22d569['query'][_0x0592('0x5e')]}});}})[_0x0592('0x41')](function(){return _0x22c163;})[_0x0592('0x41')](respondWithStatusCode(_0xd897d2,null))[_0x0592('0x46')](handleError(_0xd897d2,null));};exports[_0x0592('0x5f')]=function(_0x3148ff,_0x23d175){var _0x167f4a=[];var _0x5ab3e0=[];return db[_0x0592('0x58')][_0x0592('0x44')]({'where':{'userProfileId':_0x3148ff[_0x0592('0x59')]['id']},'raw':!![]})[_0x0592('0x41')](function(_0x133d10){_0x167f4a=_[_0x0592('0x3f')](_0x133d10,function(_0x4b60f8){return _0x4b60f8[_0x0592('0x60')]===0x1||_[_0x0592('0x61')]([0x3eb,0x709],_0x4b60f8[_0x0592('0x55')]);});if(!_[_0x0592('0x62')](_0x167f4a)){return _[_0x0592('0x2c')](_0x167f4a,function(_0xe70836){return _0xe70836[_0x0592('0x55')];});}else{return;}})[_0x0592('0x41')](function(_0xc48177){if(_0xc48177)_0x5ab3e0=_0xc48177;if(_[_0x0592('0x61')](_0x5ab3e0,0x64)){var _0x407cd1=_[_0x0592('0x4b')](_0x167f4a,{'sectionId':0x64});return hasDefaultDashboard(_0x407cd1)[_0x0592('0x41')](function(_0x3ee1bb){return _['map'](_0x167f4a,function(_0x4d3c37){if(_0x4d3c37[_0x0592('0x55')]===0x64){_0x4d3c37[_0x0592('0x63')]=_0x3ee1bb;}return _0x4d3c37;});});}else{return;}})[_0x0592('0x41')](function(_0x3427a7){if(_0x3427a7)_0x167f4a=_0x3427a7;if(_['includes'](_0x5ab3e0,0x3eb)){var _0x3653a7=_[_0x0592('0x4b')](_0x167f4a,{'sectionId':0x3eb});return getCustomDashboards(_0x3653a7)[_0x0592('0x41')](function(_0x4e9a88){return _[_0x0592('0x2c')](_0x167f4a,function(_0x59e54f){if(_0x3653a7[_0x0592('0x60')]){if(_0x59e54f[_0x0592('0x55')]===0x3eb){_0x59e54f['subsections']=_0x4e9a88;}}else{if(_0x59e54f['sectionId']===0x64){_0x59e54f[_0x0592('0x63')]=_0x4e9a88;}}return _0x59e54f;});});}else{return;}})[_0x0592('0x41')](function(_0x58dd78){if(_0x58dd78)_0x167f4a=_0x58dd78;if(_[_0x0592('0x61')](_0x5ab3e0,0x709)){var _0xc2b36b=_['find'](_0x167f4a,{'sectionId':0x709});return getPlugins(_0xc2b36b)[_0x0592('0x41')](function(_0x2369d3){if(_0xc2b36b[_0x0592('0x60')]){return _[_0x0592('0x2c')](_0x167f4a,function(_0x5b3a98){if(_0x5b3a98[_0x0592('0x55')]===0x709){_0x5b3a98[_0x0592('0x63')]=_0x2369d3;}return _0x5b3a98;});}else{var _0x48a974={'sectionId':0x76c,'enabled':0x1,'subsections':_0x2369d3};var _0x3ac545=_[_0x0592('0x2c')](_0x167f4a);_0x3ac545[_0x0592('0x5c')](_0x48a974);return _0x3ac545;}});}else{return;}})[_0x0592('0x41')](function(_0x117d07){if(_0x117d07)_0x167f4a=_0x117d07;return _[_0x0592('0x3f')](_0x167f4a,[_0x0592('0x60'),0x1]);})[_0x0592('0x41')](respondWithResult(_0x23d175,null))[_0x0592('0x46')](handleError(_0x23d175,null));};function hasDefaultDashboard(_0x1c9154){var _0x597be2=[0x65];return new BPromise(function(_0x124f56,_0x5e5cc9){try{if(_0x1c9154[_0x0592('0x53')]){_0x124f56(_0x597be2);}else{return db[_0x0592('0x54')][_0x0592('0x64')]({'where':{'sectionId':_0x1c9154['id']},'raw':!![]})['then'](function(_0x453410){_0x453410?_0x124f56(_0x597be2):_0x124f56();});}}catch(_0x3d5681){_0x5e5cc9(_0x3d5681);}});}function getCustomDashboards(_0x33e6ae){var _0x4c707d=[];return new BPromise(function(_0x2b105e,_0x177d71){try{if(_0x33e6ae[_0x0592('0x53')]){return db[_0x0592('0x65')][_0x0592('0x44')]({'raw':!![]})[_0x0592('0x41')](function(_0x3c317e){_0x3c317e[_0x0592('0x66')](function(_0x2c37c5){_0x4c707d[_0x0592('0x5c')](_0x2c37c5['id']+0x1869f);});_0x2b105e(_0x4c707d);});}else{return db[_0x0592('0x54')]['findAll']({'where':{'sectionId':_0x33e6ae['id']},'raw':!![]})[_0x0592('0x41')](function(_0x105304){_0x105304[_0x0592('0x66')](function(_0x3a5b0f){_0x4c707d[_0x0592('0x5c')](_0x3a5b0f['resourceId']+0x1869f);});_0x2b105e(_0x4c707d);});}}catch(_0x3fa1fc){_0x177d71(_0x3fa1fc);}});}function getPlugins(_0x17e38a){var _0x304ab9=[];return new BPromise(function(_0x1ee3d7,_0x16a439){try{if(_0x17e38a[_0x0592('0x53')]){return db[_0x0592('0x67')][_0x0592('0x44')]({'raw':!![]})[_0x0592('0x41')](function(_0xa04bbc){_0xa04bbc['forEach'](function(_0x350b36){_0x304ab9[_0x0592('0x5c')](_0x350b36['id']+0x15b38);});_0x1ee3d7(_0x304ab9);});}else{return db['UserProfileResource'][_0x0592('0x44')]({'where':{'sectionId':_0x17e38a['id']},'raw':!![]})[_0x0592('0x41')](function(_0xe05229){_0xe05229[_0x0592('0x66')](function(_0x588abd){_0x304ab9[_0x0592('0x5c')](_0x588abd['resourceId']+0x15b38);});_0x1ee3d7(_0x304ab9);});}}catch(_0x582399){_0x16a439(_0x582399);}});}exports['addResources']=function(_0x4f58c1,_0x12d6e0){return db['UserProfile'][_0x0592('0x4b')]({'where':{'id':_0x4f58c1[_0x0592('0x59')]['id']}})[_0x0592('0x41')](handleEntityNotFound(_0x12d6e0,null))[_0x0592('0x41')](function(_0xd05739){if(_0xd05739){return db[_0x0592('0x50')][_0x0592('0x51')](function(_0x51c964){return db[_0x0592('0x58')]['findAll']({'where':{'userProfileId':_0x4f58c1[_0x0592('0x59')]['id']},'attributes':['id'],'raw':!![]})[_0x0592('0x41')](function(_0x2059bf){if(_0x2059bf){return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0x4f58c1[_0x0592('0x59')]['id'],'id':_[_0x0592('0x2c')](_0x2059bf,function(_0xb4df6){return _0xb4df6['id'];})},'transaction':_0x51c964});}})[_0x0592('0x41')](function(_0x69ba08){var _0x30589c=_['map'](_0x4f58c1['body'],function(_0x5bf78a){_0x5bf78a['userProfileId']=_0x4f58c1[_0x0592('0x59')]['id'];return _0x5bf78a;});return db[_0x0592('0x58')][_0x0592('0x68')](_0x30589c,{'raw':!![],'transaction':_0x51c964});})[_0x0592('0x41')](function(_0xb4c4dc){var _0x22df08=_[_0x0592('0x3f')](_[_0x0592('0x2c')](_0xb4c4dc,function(_0x56dd6d){return _0x56dd6d['get']({'plain':!![]});}),{'includeAll':![]});if(_0x22df08){return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x4f58c1[_0x0592('0x59')]['id'],'sectionId':_[_0x0592('0x2c')](_0x22df08,function(_0xd08eac){return _0xd08eac[_0x0592('0x55')];})},'attributes':['id','sectionId'],'raw':!![]})['then'](function(_0x5e7855){var _0x496f73=_[_0x0592('0x2c')](_0x4f58c1[_0x0592('0x49')],function(_0x399b77){_0x399b77['userProfileId']=_0x4f58c1[_0x0592('0x59')]['id'];return _0x399b77;});return db[_0x0592('0x54')][_0x0592('0x68')](_0x496f73,{'raw':!![],'transaction':_0x51c964});});}})[_0x0592('0x46')](handleError(_0x12d6e0,null));});}})[_0x0592('0x41')](function(_0x30774b){var _0x2b1ed5=_[_0x0592('0x2c')](_0x30774b,function(_0x544bf0){return _0x544bf0['get']({'plain':!![]});});})[_0x0592('0x41')](respondWithResult(_0x12d6e0,null))['catch'](handleError(_0x12d6e0,null));};exports[_0x0592('0x69')]=function(_0x331b19,_0x44881e,_0x44da74){return db[_0x0592('0x2d')]['find']({'where':{'id':_0x331b19[_0x0592('0x59')]['id']}})[_0x0592('0x41')](handleEntityNotFound(_0x44881e,null))[_0x0592('0x41')](function(_0x27a7fe){if(_0x27a7fe){return _0x27a7fe[_0x0592('0x69')](_0x331b19[_0x0592('0x30')][_0x0592('0x5e')]);}})['then'](respondWithStatusCode(_0x44881e,null))[_0x0592('0x46')](handleError(_0x44881e,null));};exports[_0x0592('0x6a')]=function(_0x479347,_0x484e7f){var _0x3f9cf0={'raw':![],'where':{}};var _0x5680e3={};var _0x5e90ac={'count':0x0,'rows':[]};var _0x80e41a=_0x479347[_0x0592('0x30')][_0x0592('0x6b')];if(typeof _0x80e41a===_0x0592('0x6c')){throw new db[(_0x0592('0x6d'))]['ValidationError'](_0x0592('0x6e'));}var _0x299186=_0x479347[_0x0592('0x30')][_0x0592('0x6f')]||![];var _0x2e8bac=getQueryModels(_0x80e41a,_0x299186);if(typeof _0x2e8bac[_0x0592('0x70')]===_0x0592('0x6c')){throw new db['Sequelize'][(_0x0592('0x71'))](_0x0592('0x72')+_0x80e41a+'\x27');}var _0x2521b2=[];if(!_[_0x0592('0x62')](_0x2e8bac[_0x0592('0x73')])){_0x2521b2=_0x2e8bac[_0x0592('0x73')];}else{_0x2521b2=[{'name':_0x80e41a}];}return db[_0x0592('0x2d')][_0x0592('0x64')]({'where':{'id':_0x479347[_0x0592('0x59')]['id']}})[_0x0592('0x41')](handleEntityNotFound(_0x484e7f,null))[_0x0592('0x41')](function(_0xc29132){if(_0xc29132){var _0x57b55b=[];for(var _0x58ec04=0x0;_0x58ec04<_0x2521b2[_0x0592('0x37')];_0x58ec04++){_0x57b55b['push'](db[_0x0592('0x58')][_0x0592('0x64')]({'where':{'userProfileId':_0xc29132['id'],'name':_0x2521b2[_0x58ec04]['name']},'raw':!![]}));}return BPromise[_0x0592('0x74')](_0x57b55b);}})[_0x0592('0x41')](function(_0x1a8fde){var _0x46938a=_['filter'](_0x1a8fde,function(_0x1453ae){return _0x1453ae?_0x1453ae:undefined;});var _0xdaba23=_[_0x0592('0x3f')](_0x2521b2,['ignore',!![]]);var _0x299995=_[_0x0592('0x62')](_0x46938a)&&_[_0x0592('0x62')](_0xdaba23)?null:_[_0x0592('0x75')](_0xdaba23,_0x46938a);if(_0x299995){var _0x1eb4af=[];for(var _0x30303b=0x0;_0x30303b<_0x299995[_0x0592('0x37')];_0x30303b++){var _0x505ee7=_[_0x0592('0x4b')](_0x2521b2,function(_0x2cf7c8){return _0x299995[_0x30303b]?_0x2cf7c8['name']===_0x299995[_0x30303b][_0x0592('0x29')]:null;});if(_0x505ee7){if(_0x299995[_0x30303b][_0x0592('0x76')]){_0x1eb4af['push'](getAllResources(_0x2e8bac['childModel'],_0x299995[_0x30303b]));}else{if(!_0x299995[_0x30303b][_0x0592('0x53')]){_0x1eb4af[_0x0592('0x5c')](getAllowedResources(_0x505ee7,_0x299995[_0x30303b],_0x2e8bac[_0x0592('0x70')]));}else{if(_0x505ee7['model']){_0x1eb4af[_0x0592('0x5c')](getAllFilteredResources(_0x505ee7,_0x299995[_0x30303b]));}}}}}return BPromise[_0x0592('0x74')](_0x1eb4af);}else{return null;}})[_0x0592('0x41')](function(_0x488989){var _0x498f25=_0x488989;var _0x4676e6=null;if(_0x498f25){_0x4676e6=_0x498f25[_0x0592('0x37')]===0x1?_0x498f25[0x0]:null;}if(_0x4676e6||_0x498f25){var _0x5b9390=db[_0x2e8bac[_0x0592('0x70')]][_0x0592('0x2e')];_0x5680e3['model']=_[_0x0592('0x31')](_0x5b9390);_0x5680e3[_0x0592('0x30')]=_[_0x0592('0x31')](_0x479347[_0x0592('0x30')]);_0x5680e3['filters']=_[_0x0592('0x33')](_0x5680e3['model'],_0x5680e3[_0x0592('0x30')]);_0x3f9cf0[_0x0592('0x35')]=_[_0x0592('0x33')](_0x5680e3[_0x0592('0x34')],qs['fields'](_0x479347[_0x0592('0x30')]['fields']));_0x3f9cf0[_0x0592('0x35')]=_0x3f9cf0[_0x0592('0x35')]['length']?_0x3f9cf0[_0x0592('0x35')]:_0x5680e3['model'];if(!_0x479347['query'][_0x0592('0x38')]('nolimit')){_0x3f9cf0[_0x0592('0x1f')]=qs[_0x0592('0x1f')](_0x479347['query'][_0x0592('0x1f')]);_0x3f9cf0[_0x0592('0x1e')]=qs['offset'](_0x479347['query'][_0x0592('0x1e')]);}_0x3f9cf0[_0x0592('0x77')]=qs[_0x0592('0x3a')](_0x479347['query'][_0x0592('0x3a')]);_0x3f9cf0[_0x0592('0x3b')]=qs[_0x0592('0x32')](_['pick'](_0x479347[_0x0592('0x30')],_0x5680e3[_0x0592('0x32')]));if(_0x479347['query'][_0x0592('0x3f')]){_0x3f9cf0[_0x0592('0x3b')]=_[_0x0592('0x3d')](_0x3f9cf0[_0x0592('0x3b')],{'$or':_[_0x0592('0x2c')](_0x5b9390,function(_0x45db61){if(_0x45db61[_0x0592('0x2f')][_0x0592('0x78')]!==_0x0592('0x3e')){var _0x49598b={};_0x49598b[_0x45db61[_0x0592('0x79')]]={'$like':'%'+_0x479347[_0x0592('0x30')]['filter']+'%'};return _0x49598b;}})});}var _0xf0cd3c=[];if(_0x4676e6){var _0x40f58c=_['find'](_0x2521b2,['name',_0x4676e6['name']]);if(_0x40f58c[_0x0592('0x79')]){var _0x109679={};if(_0x2e8bac['childModel']==='AnalyticExtractedReport'){_0x109679[_0x40f58c[_0x0592('0x7a')]]=_[_0x0592('0x2c')](_0x4676e6[_0x0592('0x7b')],'id');}else{_0x109679[_0x40f58c[_0x0592('0x7a')]]=_0x4676e6['associatedResources'];}_0xf0cd3c[_0x0592('0x5c')](_0x109679);}else{_0x3f9cf0[_0x0592('0x3b')]['id']=_0x4676e6[_0x0592('0x7b')];}}else{for(var _0x573d67=0x0;_0x573d67<_0x498f25[_0x0592('0x37')];_0x573d67++){var _0x40f58c=_[_0x0592('0x4b')](_0x2521b2,[_0x0592('0x29'),_0x498f25[_0x573d67]['name']]);if(_0x40f58c['field']){var _0x109679={};_0x109679[_0x40f58c['foreignKey']]=_0x498f25[_0x573d67][_0x0592('0x7b')];_0xf0cd3c[_0x0592('0x5c')](_0x109679);}else{if(!_0x3f9cf0['where']['id'])_0x3f9cf0[_0x0592('0x3b')]['id']=[];_0x498f25[_0x573d67]['associatedResources'][_0x0592('0x66')](function(_0xe6eaa0){_0x3f9cf0[_0x0592('0x3b')]['id'][_0x0592('0x5c')](_0xe6eaa0);});}}}if(!_[_0x0592('0x62')](_0xf0cd3c)){_0x3f9cf0[_0x0592('0x3b')]=_[_0x0592('0x3d')](_0x3f9cf0[_0x0592('0x3b')],{'$and':{'$or':_0xf0cd3c}});}_0x3f9cf0=_[_0x0592('0x3d')]({},_0x3f9cf0,_0x479347[_0x0592('0x40')]);if(_0x4676e6&&!_0x4676e6[_0x0592('0x53')]&&_0x2e8bac[_0x0592('0x70')]===_0x0592('0x7c')){if(_0x479347[_0x0592('0x30')]['includeAll']){_0x3f9cf0[_0x0592('0x43')]=[{'all':!![]}];}return db[_0x2e8bac['childModel']][_0x0592('0x44')](_0x3f9cf0)[_0x0592('0x41')](function(_0x11879b){var _0x3880db=[];_0x11879b[_0x0592('0x66')](function(_0x2a6f8c){var _0x268069;switch(_0x2a6f8c['reportType']){case _0x0592('0x7d'):_0x268069=_['find'](_0x4676e6[_0x0592('0x7b')],function(_0x173d0f){return _0x173d0f['id']===_0x2a6f8c[_0x0592('0x7e')]&&_0x173d0f[_0x0592('0x2f')]===_0x0592('0x7f');});break;case'custom':_0x268069=_[_0x0592('0x4b')](_0x4676e6[_0x0592('0x7b')],function(_0x598d84){return _0x598d84['id']===_0x2a6f8c['reportId']&&_0x598d84[_0x0592('0x2f')]===_0x0592('0x80');});break;}if(_0x268069)_0x3880db['push'](_0x2a6f8c);});_0x5e90ac['count']=_0x3880db['length'];_0x5e90ac[_0x0592('0x45')]=_0x3880db;return _0x5e90ac;});}else{return db[_0x2e8bac[_0x0592('0x70')]][_0x0592('0x1d')]({'where':_0x3f9cf0['where']})[_0x0592('0x41')](function(_0x1caea4){_0x5e90ac['count']=_0x1caea4;if(_0x479347['query'][_0x0592('0x42')]){if(_0x2e8bac[_0x0592('0x70')]===_0x0592('0x81')){_0x3f9cf0[_0x0592('0x43')]=[{'model':db['Tag'],'as':_0x0592('0x82'),'attributes':['id',_0x0592('0x29'),_0x0592('0x83')],'required':_0x479347['query'][_0x0592('0x84')]?!![]:![]},{'model':db[_0x0592('0x85')],'as':_0x0592('0x86'),'attributes':['id',_0x0592('0x29'),_0x0592('0x83')],'through':_0x479347[_0x0592('0x30')][_0x0592('0x84')]?{'attributes':[],'where':{'TagId':_0x479347[_0x0592('0x30')][_0x0592('0x84')]||undefined}}:{},'required':_0x479347[_0x0592('0x30')][_0x0592('0x84')]?!![]:![]}];}else{_0x3f9cf0[_0x0592('0x43')]=[{'all':!![]}];}}return db[_0x2e8bac[_0x0592('0x70')]][_0x0592('0x44')](_0x3f9cf0);})[_0x0592('0x41')](function(_0x1dbec2){_0x5e90ac['rows']=_0x1dbec2;return _0x5e90ac;});}}else{return _0x5e90ac;}})[_0x0592('0x41')](respondWithFilteredResult(_0x484e7f,_0x3f9cf0))[_0x0592('0x46')](handleError(_0x484e7f,null));};function getAllResources(_0x1cfea2,_0x14dce4){return new BPromise(function(_0x498dc5,_0x90b3c9){if(_0x14dce4){var _0x50da0b=_0x14dce4[_0x0592('0x3f')]?{[_0x14dce4[_0x0592('0x3f')][_0x0592('0x79')]]:_0x14dce4[_0x0592('0x3f')][_0x0592('0x87')]}:undefined;return db[_0x1cfea2]['findAll']({'where':_0x50da0b,'raw':!![]})[_0x0592('0x41')](function(_0x180f3a){_0x14dce4[_0x0592('0x7b')]=_[_0x0592('0x2c')](_0x180f3a,'id');_0x498dc5(_0x14dce4);})[_0x0592('0x46')](function(_0x1753b6){_0x90b3c9(_0x1753b6);});}else{_0x498dc5(null);}});}function getAllFilteredResources(_0x5ac827,_0x126779){return new BPromise(function(_0x1a3d7e,_0x3feb2b){var _0x3513ed=_0x5ac827[_0x0592('0x3f')]?{[_0x5ac827[_0x0592('0x3f')][_0x0592('0x79')]]:_0x5ac827['filter'][_0x0592('0x87')]}:undefined;return db[_0x5ac827[_0x0592('0x34')]][_0x0592('0x44')]({'where':_0x3513ed,'raw':!![]})['then'](function(_0x1b7549){_0x126779['associatedResources']=_[_0x0592('0x2c')](_0x1b7549,function(_0x4d6a70){return _0x4d6a70[_0x0592('0x29')];});_0x1a3d7e(_0x126779);})[_0x0592('0x46')](function(_0x25e553){_0x3feb2b(_0x25e553);});});}function getAllowedResources(_0x3f5a1f,_0x2dea72,_0x3f60d6){return new BPromise(function(_0x26b7c7,_0x3e1a22){if(_0x2dea72){return db[_0x0592('0x54')][_0x0592('0x44')]({'where':{'sectionId':_0x2dea72['id']},'raw':!![]})[_0x0592('0x41')](function(_0x241ae8){if(_0x3f5a1f[_0x0592('0x79')]&&_0x3f5a1f['field']!=='id'){_0x2dea72[_0x0592('0x7b')]=_['map'](_0x241ae8,function(_0x545a5a){return _0x545a5a[_0x3f5a1f[_0x0592('0x79')]];});}else{if(_0x3f60d6===_0x0592('0x7c')){_0x2dea72['associatedResources']=_[_0x0592('0x2c')](_0x241ae8,function(_0xb9aa6e){return{'id':_0xb9aa6e[_0x0592('0x88')],'type':_0xb9aa6e[_0x0592('0x2f')]};});}else{_0x2dea72[_0x0592('0x7b')]=_[_0x0592('0x2c')](_0x241ae8,function(_0x1b0f03){return _0x1b0f03[_0x0592('0x88')];});}}_0x26b7c7(_0x2dea72);})[_0x0592('0x46')](function(_0x4584eb){_0x3e1a22(_0x4584eb);});}else{_0x26b7c7(null);}});}function getQueryModels(_0x5b332e,_0x52e2e1){var _0xdea4be=_0x5b332e[_0x0592('0x89')]();var _0x2c56ea={'childModel':undefined,'parentSections':[]};switch(_0xdea4be){case _0x0592('0x8a'):_0x2c56ea[_0x0592('0x70')]=_0x0592('0x8b');break;case _0x0592('0x8c'):_0x2c56ea[_0x0592('0x70')]=_0x0592('0x8d');break;case _0x0592('0x8e'):_0x2c56ea['childModel']=_0x0592('0x8f');_0x2c56ea[_0x0592('0x73')]=[{'name':_0x0592('0x90'),'field':_0x0592('0x29'),'foreignKey':'projectName'}];break;case _0x0592('0x91'):_0x2c56ea[_0x0592('0x70')]=_0x0592('0x92');break;case _0x0592('0x93'):_0x2c56ea[_0x0592('0x70')]=_0x0592('0x81');_0x2c56ea[_0x0592('0x73')]=[{'name':'Lists','field':'id','foreignKey':_0x0592('0x94')}];break;case _0x0592('0x95'):_0x2c56ea['childModel']='CmList';break;case'companies':_0x2c56ea['childModel']=_0x0592('0x96');break;case _0x0592('0x97'):_0x2c56ea[_0x0592('0x70')]=_0x0592('0x98');break;case _0x0592('0x99'):_0x2c56ea['childModel']='ChatQueue';break;case _0x0592('0x9a'):_0x2c56ea[_0x0592('0x70')]=_0x0592('0x9b');break;case _0x0592('0x9c'):_0x2c56ea['childModel']=_0x0592('0x9d');break;case'faxaccounts':_0x2c56ea['childModel']=_0x0592('0x9e');break;case _0x0592('0x9f'):case'internalroutes':case _0x0592('0xa0'):_0x2c56ea[_0x0592('0x70')]='VoiceExtension';break;case'contexts':_0x2c56ea[_0x0592('0x70')]=_0x0592('0xa1');break;case _0x0592('0xa2'):_0x2c56ea[_0x0592('0x70')]=_0x0592('0xa3');break;case'voicerecordings':_0x2c56ea[_0x0592('0x70')]=_0x0592('0xa4');_0x2c56ea['parentSections']=[{'name':'Agents','field':_0x0592('0x29'),'foreignKey':_0x0592('0xa5'),'model':_0x0592('0xa6'),'filter':{'field':_0x0592('0xa7'),'value':[_0x0592('0xa8')]}},{'name':_0x0592('0xa9'),'field':_0x0592('0x29'),'foreignKey':'membername','model':_0x0592('0xa6'),'filter':{'field':_0x0592('0xa7'),'value':[_0x0592('0xaa')]}},{'name':_0x0592('0xab'),'field':_0x0592('0x29'),'foreignKey':_0x0592('0xac'),'model':_0x0592('0xad'),'filter':{'field':'type','value':[_0x0592('0xae')]}},{'name':'QueueCampaigns','field':_0x0592('0x29'),'foreignKey':_0x0592('0xac'),'model':_0x0592('0xad'),'filter':{'field':_0x0592('0x2f'),'value':[_0x0592('0xaf')]}}];break;case _0x0592('0xb0'):_0x2c56ea[_0x0592('0x70')]=_0x0592('0xb1');break;case _0x0592('0xb2'):_0x2c56ea[_0x0592('0x70')]='VoiceChanSpy';break;case'voiceprefixes':_0x2c56ea[_0x0592('0x70')]='VoicePrefix';break;case'ivrcampaigns':_0x2c56ea['childModel']='Campaign';break;case'mailqueues':_0x2c56ea[_0x0592('0x70')]=_0x0592('0xb3');break;case _0x0592('0xb4'):_0x2c56ea[_0x0592('0x70')]=_0x0592('0xb5');break;case _0x0592('0xb6'):_0x2c56ea['childModel']=_0x0592('0xb7');break;case'openchannelqueues':_0x2c56ea[_0x0592('0x70')]=_0x0592('0xb8');break;case'openchannelaccounts':_0x2c56ea[_0x0592('0x70')]='OpenchannelAccount';break;case _0x0592('0xb9'):_0x2c56ea[_0x0592('0x70')]=_0x0592('0xba');break;case'smsaccounts':_0x2c56ea[_0x0592('0x70')]=_0x0592('0xbb');break;case'teams':_0x2c56ea[_0x0592('0x70')]='Team';break;case _0x0592('0xbc'):case _0x0592('0xbd'):_0x2c56ea['childModel']=_0x0592('0xad');if(_0x52e2e1){_0x2c56ea[_0x0592('0x73')]=[{'name':_0x0592('0xab')},{'name':_0x0592('0xbe')}];}break;case _0x0592('0xbf'):case _0x0592('0xc0'):case'telephones':_0x2c56ea['childModel']='User';if(_0x52e2e1){_0x2c56ea[_0x0592('0x73')]=[{'name':_0x0592('0xc1'),'filter':{'field':'role','value':[_0x0592('0xc2'),'user']},'ignore':!![]},{'name':_0x0592('0xc3')},{'name':_0x0592('0xa9')}];}break;case _0x0592('0xc4'):_0x2c56ea[_0x0592('0x70')]='ZendeskAccount';break;case'salesforceaccounts':_0x2c56ea['childModel']=_0x0592('0xc5');break;case _0x0592('0xc6'):_0x2c56ea[_0x0592('0x70')]='FreshdeskAccount';break;case _0x0592('0xc7'):_0x2c56ea[_0x0592('0x70')]=_0x0592('0xc8');break;case'deskaccounts':_0x2c56ea[_0x0592('0x70')]=_0x0592('0xc9');break;case'zohoaccounts':_0x2c56ea[_0x0592('0x70')]=_0x0592('0xca');break;case _0x0592('0xcb'):_0x2c56ea[_0x0592('0x70')]=_0x0592('0xa6');break;case _0x0592('0xcc'):_0x2c56ea[_0x0592('0x70')]=_0x0592('0xcd');break;case _0x0592('0xce'):_0x2c56ea[_0x0592('0x70')]=_0x0592('0xcf');break;case _0x0592('0xd0'):_0x2c56ea[_0x0592('0x70')]=_0x0592('0x65');break;case _0x0592('0xd1'):_0x2c56ea['childModel']=_0x0592('0xd2');break;case _0x0592('0xd3'):_0x2c56ea[_0x0592('0x70')]='Pause';break;case _0x0592('0xd4'):_0x2c56ea[_0x0592('0x70')]=_0x0592('0xd5');break;case'sounds':_0x2c56ea[_0x0592('0x70')]=_0x0592('0xd6');break;case _0x0592('0xd7'):_0x2c56ea['childModel']=_0x0592('0x85');break;case _0x0592('0xd8'):_0x2c56ea['childModel']=_0x0592('0xd9');break;case _0x0592('0xda'):_0x2c56ea[_0x0592('0x70')]=_0x0592('0xdb');break;case _0x0592('0xdc'):_0x2c56ea[_0x0592('0x70')]=_0x0592('0xdd');break;case _0x0592('0xde'):_0x2c56ea[_0x0592('0x70')]=_0x0592('0xdf');break;case'plugins':_0x2c56ea[_0x0592('0x70')]='Plugin';break;case _0x0592('0xe0'):_0x2c56ea[_0x0592('0x70')]=_0x0592('0x7c');_0x2c56ea[_0x0592('0x73')]=[{'name':_0x0592('0xe1'),'field':'id','foreignKey':_0x0592('0x7e')}];break;case _0x0592('0xe2'):_0x2c56ea[_0x0592('0x70')]='AnalyticMetric';break;default:return _0x2c56ea;}return _0x2c56ea;} \ No newline at end of file +var _0x7e39=['role','agent','Telephones','VoiceQueue','inbound','QueueCampaigns','queue','outbound','musiconholds','VoiceMusicOnHold','chanspies','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','mailaccounts','MailAccount','MailSubstatus','OpenchannelQueue','OpenchannelAccount','smsqueues','SmsQueue','SmsAccount','teams','VoiceQueues','users','agents','telephones','Users','admin','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','sugarcrmaccounts','SugarcrmAccount','zohoaccounts','ZohoAccount','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','intervals','Interval','pauses','Pause','scheduler','Schedule','sounds','Sound','tags','templates','triggers','trunks','Trunk','variables','plugins','AnalyticMetric','rimraf','zip-dir','fast-json-patch','moment','util','sox','ejs','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','update','then','stack','name','index','UserProfile','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','options','count','include','findAll','catch','show','params','rawAttributes','includeAll','find','body','length','get','omit','createdAt','crudPermissions','updatedAt','sequelize','create','UserProfileSection','each','autoAssociation','UserProfileResource','sectionId','Resources','destroy','describe','transaction','userProfileId','push','removeSections','ids','filter','enabled','includes','subsections','findOne','Dashboard','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','getResources','section','undefined','Sequelize','ValidationError','Unknown\x20section','childModel','isEmpty','parentSections','all','union','field','AnalyticExtractedReport','foreignKey','associatedResources','reportType','default','DefaultReports','custom','reportId','rows','CmContact','Tag','color','tag','ThroughTags','value','toLowerCase','squareprojects','SquareProject','odbc','SquareOdbc','squarerecordings','SquareRecording','projectName','projects','contacts','Lists','lists','CmList','companies','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','FaxQueue','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','VoiceMail','voicerecordings','Agents','membername','User'];(function(_0x412f25,_0x3320a1){var _0x397508=function(_0x778bee){while(--_0x778bee){_0x412f25['push'](_0x412f25['shift']());}};_0x397508(++_0x3320a1);}(_0x7e39,0x11e));var _0x97e3=function(_0x19ab63,_0x4dd391){_0x19ab63=_0x19ab63-0x0;var _0x4f78fe=_0x7e39[_0x19ab63];return _0x4f78fe;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x97e3('0x0'));var zipdir=require(_0x97e3('0x1'));var jsonpatch=require(_0x97e3('0x2'));var rp=require('request-promise');var moment=require(_0x97e3('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x97e3('0x4'));var path=require('path');var sox=require(_0x97e3('0x5'));var csv=require('to-csv');var ejs=require(_0x97e3('0x6'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x97e3('0x7'));var jsforce=require(_0x97e3('0x8'));var deskjs=require(_0x97e3('0x9'));var toCsv=require(_0x97e3('0xa'));var querystring=require(_0x97e3('0xb'));var Papa=require(_0x97e3('0xc'));var Redis=require(_0x97e3('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x97e3('0xe'));var as=require(_0x97e3('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x97e3('0x10'))(_0x97e3('0x11'));var utils=require(_0x97e3('0x12'));var config=require(_0x97e3('0x13'));var db=require(_0x97e3('0x14'))['db'];config[_0x97e3('0x15')]=_[_0x97e3('0x16')](config[_0x97e3('0x15')],{'host':_0x97e3('0x17'),'port':0x18eb});var socket=require(_0x97e3('0x18'))(new Redis(config['redis']));require(_0x97e3('0x19'))[_0x97e3('0x1a')](socket);function respondWithStatusCode(_0x13656e,_0x559a20){_0x559a20=_0x559a20||0xcc;return function(_0x1a1219){if(_0x1a1219){return _0x13656e[_0x97e3('0x1b')](_0x559a20);}return _0x13656e[_0x97e3('0x1c')](_0x559a20)[_0x97e3('0x1d')]();};}function respondWithResult(_0x5c7d44,_0xd4b87a){_0xd4b87a=_0xd4b87a||0xc8;return function(_0xd73d8f){if(_0xd73d8f){return _0x5c7d44[_0x97e3('0x1c')](_0xd4b87a)[_0x97e3('0x1e')](_0xd73d8f);}};}function respondWithFilteredResult(_0xc828a6,_0x5510f6){return function(_0xc367b5){if(_0xc367b5){var _0x4ff6fa=_0xc367b5['count'],_0x2d3950=_0x5510f6[_0x97e3('0x1f')],_0x666aea=_0x5510f6[_0x97e3('0x1f')]+_0x5510f6[_0x97e3('0x20')],_0x3a28bc;if(_0x666aea>=_0x4ff6fa){_0x666aea=_0x4ff6fa;_0x3a28bc=0xc8;}else{_0x3a28bc=0xce;}_0xc828a6[_0x97e3('0x1c')](_0x3a28bc);return _0xc828a6[_0x97e3('0x21')](_0x97e3('0x22'),_0x2d3950+'-'+_0x666aea+'/'+_0x4ff6fa)[_0x97e3('0x1e')](_0xc367b5);}return null;};}function patchUpdates(_0x5329e5){return function(_0x1497d7){try{jsonpatch[_0x97e3('0x23')](_0x1497d7,_0x5329e5,!![]);}catch(_0x55fecf){return BPromise[_0x97e3('0x24')](_0x55fecf);}return _0x1497d7['save']();};}function saveUpdates(_0x4d97da,_0x10c16b){return function(_0x25dbcd){if(_0x25dbcd){return _0x25dbcd[_0x97e3('0x25')](_0x4d97da)[_0x97e3('0x26')](function(_0x1062dc){return _0x1062dc;});}return null;};}function removeEntity(_0x145741,_0x33061d){return function(_0x308a78){if(_0x308a78){return _0x308a78['destroy']()['then'](function(){_0x145741['status'](0xcc)[_0x97e3('0x1d')]();});}};}function handleEntityNotFound(_0x31c420,_0x1743c2){return function(_0x27ee96){if(!_0x27ee96){_0x31c420[_0x97e3('0x1b')](0x194);}return _0x27ee96;};}function handleError(_0x27d59f,_0x4f99f6){_0x4f99f6=_0x4f99f6||0x1f4;return function(_0x392829){logger['error'](_0x392829[_0x97e3('0x27')]);if(_0x392829[_0x97e3('0x28')]){delete _0x392829['name'];}_0x27d59f[_0x97e3('0x1c')](_0x4f99f6)['send'](_0x392829);};}exports[_0x97e3('0x29')]=function(_0x4e044e,_0x2ecb4a){var _0x1b04b9={},_0x5e4ee0={},_0x3c907f={'count':0x0,'rows':[]};var _0x473954=_['map'](db[_0x97e3('0x2a')]['rawAttributes'],function(_0x15fca4){return{'name':_0x15fca4[_0x97e3('0x2b')],'type':_0x15fca4[_0x97e3('0x2c')][_0x97e3('0x2d')]};});_0x5e4ee0['model']=_[_0x97e3('0x2e')](_0x473954,_0x97e3('0x28'));_0x5e4ee0[_0x97e3('0x2f')]=_[_0x97e3('0x30')](_0x4e044e['query']);_0x5e4ee0['filters']=_[_0x97e3('0x31')](_0x5e4ee0[_0x97e3('0x32')],_0x5e4ee0[_0x97e3('0x2f')]);_0x1b04b9[_0x97e3('0x33')]=_[_0x97e3('0x31')](_0x5e4ee0[_0x97e3('0x32')],qs[_0x97e3('0x34')](_0x4e044e[_0x97e3('0x2f')][_0x97e3('0x34')]));_0x1b04b9[_0x97e3('0x33')]=_0x1b04b9[_0x97e3('0x33')]['length']?_0x1b04b9[_0x97e3('0x33')]:_0x5e4ee0['model'];if(!_0x4e044e[_0x97e3('0x2f')][_0x97e3('0x35')](_0x97e3('0x36'))){_0x1b04b9['limit']=qs[_0x97e3('0x20')](_0x4e044e['query']['limit']);_0x1b04b9['offset']=qs['offset'](_0x4e044e['query'][_0x97e3('0x1f')]);}_0x1b04b9[_0x97e3('0x37')]=qs[_0x97e3('0x38')](_0x4e044e[_0x97e3('0x2f')][_0x97e3('0x38')]);_0x1b04b9[_0x97e3('0x39')]=qs[_0x97e3('0x3a')](_[_0x97e3('0x3b')](_0x4e044e['query'],_0x5e4ee0[_0x97e3('0x3a')]));if(_0x4e044e[_0x97e3('0x2f')]['filter']){_0x1b04b9[_0x97e3('0x39')]=_[_0x97e3('0x3c')](_0x1b04b9[_0x97e3('0x39')],{'$or':_[_0x97e3('0x2e')](_0x473954,function(_0x277a11){if(_0x277a11[_0x97e3('0x2c')]!==_0x97e3('0x3d')){var _0x596c5e={};_0x596c5e[_0x277a11[_0x97e3('0x28')]]={'$like':'%'+_0x4e044e[_0x97e3('0x2f')]['filter']+'%'};return _0x596c5e;}})});}_0x1b04b9=_['merge']({},_0x1b04b9,_0x4e044e[_0x97e3('0x3e')]);var _0x49ce15={'where':_0x1b04b9[_0x97e3('0x39')]};return db[_0x97e3('0x2a')]['count'](_0x49ce15)['then'](function(_0x5cac9){_0x3c907f[_0x97e3('0x3f')]=_0x5cac9;if(_0x4e044e[_0x97e3('0x2f')]['includeAll']){_0x1b04b9[_0x97e3('0x40')]=[{'all':!![]}];}return db[_0x97e3('0x2a')][_0x97e3('0x41')](_0x1b04b9);})[_0x97e3('0x26')](function(_0x2431e1){_0x3c907f['rows']=_0x2431e1;return _0x3c907f;})['then'](respondWithFilteredResult(_0x2ecb4a,_0x1b04b9))[_0x97e3('0x42')](handleError(_0x2ecb4a,null));};exports[_0x97e3('0x43')]=function(_0x11668c,_0x459343){var _0x50d8ea={'raw':![],'where':{'id':_0x11668c[_0x97e3('0x44')]['id']}},_0x3ec954={};_0x3ec954[_0x97e3('0x32')]=_[_0x97e3('0x30')](db['UserProfile'][_0x97e3('0x45')]);_0x3ec954[_0x97e3('0x2f')]=_['keys'](_0x11668c[_0x97e3('0x2f')]);_0x3ec954[_0x97e3('0x3a')]=_['intersection'](_0x3ec954[_0x97e3('0x32')],_0x3ec954[_0x97e3('0x2f')]);_0x50d8ea['attributes']=_[_0x97e3('0x31')](_0x3ec954[_0x97e3('0x32')],qs['fields'](_0x11668c[_0x97e3('0x2f')][_0x97e3('0x34')]));_0x50d8ea[_0x97e3('0x33')]=_0x50d8ea['attributes']['length']?_0x50d8ea[_0x97e3('0x33')]:_0x3ec954[_0x97e3('0x32')];if(_0x11668c[_0x97e3('0x2f')][_0x97e3('0x46')]){_0x50d8ea[_0x97e3('0x40')]=[{'all':!![]}];}_0x50d8ea=_[_0x97e3('0x3c')]({},_0x50d8ea,_0x11668c['options']);return db[_0x97e3('0x2a')][_0x97e3('0x47')](_0x50d8ea)[_0x97e3('0x26')](handleEntityNotFound(_0x459343,null))[_0x97e3('0x26')](respondWithResult(_0x459343,null))[_0x97e3('0x42')](handleError(_0x459343,null));};exports['create']=function(_0x37311b,_0x350741){return db['UserProfile']['create'](_0x37311b[_0x97e3('0x48')],{})[_0x97e3('0x26')](respondWithResult(_0x350741,0xc9))[_0x97e3('0x42')](handleError(_0x350741,null));};exports['clone']=function(_0x182ee0,_0x52d3e2){var _0x45e481={'where':{'id':_0x182ee0[_0x97e3('0x44')]['id']}},_0x36a92c={};_0x36a92c[_0x97e3('0x32')]=_['keys'](db[_0x97e3('0x2a')][_0x97e3('0x45')]);_0x45e481[_0x97e3('0x33')]=_[_0x97e3('0x31')](_0x36a92c[_0x97e3('0x32')],qs['fields'](_0x182ee0[_0x97e3('0x2f')]['fields']));_0x45e481['attributes']=_0x45e481[_0x97e3('0x33')][_0x97e3('0x49')]?_0x45e481['attributes']:_0x36a92c['model'];if(_0x182ee0[_0x97e3('0x2f')][_0x97e3('0x46')]){_0x45e481[_0x97e3('0x40')]=[{'all':!![]}];}_0x45e481=_[_0x97e3('0x3c')]({},_0x45e481,_0x182ee0[_0x97e3('0x3e')]);return db['UserProfile'][_0x97e3('0x47')](_0x45e481)['then'](handleEntityNotFound(_0x52d3e2,null))[_0x97e3('0x26')](function(_0x1a9d64){if(_0x1a9d64){var _0x4283ff=_0x1a9d64[_0x97e3('0x4a')]({'plain':!![]});_0x4283ff=qs[_0x97e3('0x4b')](_0x4283ff,['id',_0x97e3('0x4c'),'updatedAt',_0x97e3('0x4d')]);_0x182ee0[_0x97e3('0x48')]=_[_0x97e3('0x4b')](_0x182ee0[_0x97e3('0x48')],['id','createdAt',_0x97e3('0x4e')]);return db[_0x97e3('0x4f')]['transaction'](function(_0x443862){return db['UserProfile'][_0x97e3('0x50')](_[_0x97e3('0x3c')](_0x4283ff,_0x182ee0[_0x97e3('0x48')]),{'include':_0x182ee0['query']['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x443862})[_0x97e3('0x26')](function(_0x384f53){var _0x4a7229=_0x384f53[_0x97e3('0x4a')]({'plain':!![]});return db[_0x97e3('0x51')][_0x97e3('0x41')]({'where':{'userProfileId':_0x182ee0[_0x97e3('0x44')]['id']},'raw':!![]})[_0x97e3('0x26')](function(_0x17d679){if(_0x17d679){return BPromise[_0x97e3('0x52')](_0x17d679,function(_0x4fc644){return new BPromise(function(_0x14654c,_0x9789f4){if(_0x4fc644[_0x97e3('0x53')]===null||_0x4fc644['autoAssociation']===0x1)_0x14654c(null);return db[_0x97e3('0x54')][_0x97e3('0x41')]({'where':{'sectionId':_0x4fc644['id']},'raw':!![]})[_0x97e3('0x26')](function(_0x21f72c){var _0x38a696=_['map'](_0x21f72c,function(_0x311a14){return qs['omit'](_0x311a14,['id','createdAt','updatedAt',_0x97e3('0x55')]);});_0x14654c(_0x38a696);})[_0x97e3('0x42')](function(_0x36f570){_0x9789f4(_0x36f570);});})[_0x97e3('0x26')](function(_0xb00f71){var _0x36a446=qs[_0x97e3('0x4b')](_0x4fc644,['id',_0x97e3('0x4c'),_0x97e3('0x4e')]);_0x36a446['userProfileId']=_0x4a7229['id'];if(_0xb00f71)_0x36a446[_0x97e3('0x56')]=_0xb00f71;return _0x36a446;})[_0x97e3('0x26')](function(_0x4223fb){return db[_0x97e3('0x51')][_0x97e3('0x50')](_0x4223fb,{'include':[{'model':db['UserProfileResource'],'as':_0x97e3('0x56')}],'raw':!![],'transaction':_0x443862});});})[_0x97e3('0x26')](function(){return _0x4a7229;});}});});});}})[_0x97e3('0x26')](respondWithResult(_0x52d3e2,0xc9))['catch'](handleError(_0x52d3e2,null));};exports[_0x97e3('0x25')]=function(_0x376157,_0x4d9cab){if(_0x376157['body']['id']){delete _0x376157['body']['id'];}return db[_0x97e3('0x2a')][_0x97e3('0x47')]({'where':{'id':_0x376157['params']['id']}})[_0x97e3('0x26')](handleEntityNotFound(_0x4d9cab,null))[_0x97e3('0x26')](saveUpdates(_0x376157['body'],null))[_0x97e3('0x26')](respondWithResult(_0x4d9cab,null))[_0x97e3('0x42')](handleError(_0x4d9cab,null));};exports[_0x97e3('0x57')]=function(_0x357b14,_0x2d3f11){return db[_0x97e3('0x2a')][_0x97e3('0x47')]({'where':{'id':_0x357b14[_0x97e3('0x44')]['id']}})[_0x97e3('0x26')](handleEntityNotFound(_0x2d3f11,null))[_0x97e3('0x26')](removeEntity(_0x2d3f11,null))[_0x97e3('0x42')](handleError(_0x2d3f11,null));};exports['describe']=function(_0xf316ef,_0x5a0d47){return db[_0x97e3('0x2a')][_0x97e3('0x58')]()[_0x97e3('0x26')](respondWithResult(_0x5a0d47,null))[_0x97e3('0x42')](handleError(_0x5a0d47,null));};exports['addSections']=function(_0x463e10,_0x4b3413){var _0x149192=_0x463e10[_0x97e3('0x48')];return db[_0x97e3('0x2a')]['find']({'where':{'id':_0x463e10[_0x97e3('0x44')]['id']}})[_0x97e3('0x26')](handleEntityNotFound(_0x4b3413,null))[_0x97e3('0x26')](function(_0x35aee8){if(_0x35aee8){return db['sequelize'][_0x97e3('0x59')](function(_0x35560d){return db[_0x97e3('0x51')][_0x97e3('0x57')]({'where':{'userProfileId':_0x463e10[_0x97e3('0x44')]['id'],'sectionId':_[_0x97e3('0x2e')](_0x149192,function(_0x38916c){return _0x38916c[_0x97e3('0x55')];})},'transaction':_0x35560d})[_0x97e3('0x26')](function(){var _0x540e33=_[_0x97e3('0x2e')](_0x149192,function(_0x2fe62d){_0x2fe62d[_0x97e3('0x5a')]=_0x463e10[_0x97e3('0x44')]['id'];return _0x2fe62d;});var _0x1a8e74=[];return BPromise['each'](_0x540e33,function(_0x391ffc){return db[_0x97e3('0x51')][_0x97e3('0x50')](_0x391ffc,{'include':[{'model':db[_0x97e3('0x54')],'as':_0x97e3('0x56')}],'raw':!![],'transaction':_0x35560d})[_0x97e3('0x26')](function(_0x1c537a){_0x1a8e74[_0x97e3('0x5b')](_0x1c537a[_0x97e3('0x4a')]({'plain':!![]}));});})[_0x97e3('0x26')](function(){return _0x1a8e74;});});});}})[_0x97e3('0x26')](function(_0x1cd8f7){return _0x1cd8f7;})[_0x97e3('0x26')](respondWithResult(_0x4b3413,null))[_0x97e3('0x42')](handleError(_0x4b3413,null));};exports[_0x97e3('0x5c')]=function(_0x22973b,_0x136da2){var _0x48234c;return db[_0x97e3('0x2a')][_0x97e3('0x47')]({'where':{'id':_0x22973b['params']['id']},'attributes':['id',_0x97e3('0x28')]})[_0x97e3('0x26')](handleEntityNotFound(_0x136da2,null))['then'](function(_0x177230){if(_0x177230){_0x48234c=_0x177230;return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0x22973b['params']['id'],'sectionId':_0x22973b[_0x97e3('0x2f')][_0x97e3('0x5d')]}});}})['then'](function(){return _0x48234c;})[_0x97e3('0x26')](respondWithStatusCode(_0x136da2,null))[_0x97e3('0x42')](handleError(_0x136da2,null));};exports['getSections']=function(_0x1239c7,_0x3e4f26){var _0x42d60c=[];var _0x304c4f=[];return db[_0x97e3('0x51')][_0x97e3('0x41')]({'where':{'userProfileId':_0x1239c7[_0x97e3('0x44')]['id']},'raw':!![]})[_0x97e3('0x26')](function(_0x2622ea){_0x42d60c=_[_0x97e3('0x5e')](_0x2622ea,function(_0x357d29){return _0x357d29[_0x97e3('0x5f')]===0x1||_[_0x97e3('0x60')]([0x3eb,0x709],_0x357d29['sectionId']);});if(!_['isEmpty'](_0x42d60c)){return _[_0x97e3('0x2e')](_0x42d60c,function(_0x255855){return _0x255855[_0x97e3('0x55')];});}else{return;}})['then'](function(_0x698518){if(_0x698518)_0x304c4f=_0x698518;if(_['includes'](_0x304c4f,0x64)){var _0xe1fa77=_[_0x97e3('0x47')](_0x42d60c,{'sectionId':0x64});return hasDefaultDashboard(_0xe1fa77)['then'](function(_0x1adea2){return _[_0x97e3('0x2e')](_0x42d60c,function(_0x1d6785){if(_0x1d6785[_0x97e3('0x55')]===0x64){_0x1d6785[_0x97e3('0x61')]=_0x1adea2;}return _0x1d6785;});});}else{return;}})[_0x97e3('0x26')](function(_0x3a4f69){if(_0x3a4f69)_0x42d60c=_0x3a4f69;if(_[_0x97e3('0x60')](_0x304c4f,0x3eb)){var _0x49cd7b=_[_0x97e3('0x47')](_0x42d60c,{'sectionId':0x3eb});return getCustomDashboards(_0x49cd7b)[_0x97e3('0x26')](function(_0x231086){return _[_0x97e3('0x2e')](_0x42d60c,function(_0x2016d4){if(_0x49cd7b['enabled']){if(_0x2016d4['sectionId']===0x3eb){_0x2016d4[_0x97e3('0x61')]=_0x231086;}}else{if(_0x2016d4['sectionId']===0x64){_0x2016d4[_0x97e3('0x61')]=_0x231086;}}return _0x2016d4;});});}else{return;}})[_0x97e3('0x26')](function(_0x5a481e){if(_0x5a481e)_0x42d60c=_0x5a481e;if(_[_0x97e3('0x60')](_0x304c4f,0x709)){var _0x597149=_['find'](_0x42d60c,{'sectionId':0x709});return getPlugins(_0x597149)[_0x97e3('0x26')](function(_0x1edac8){if(_0x597149[_0x97e3('0x5f')]){return _[_0x97e3('0x2e')](_0x42d60c,function(_0x379c57){if(_0x379c57[_0x97e3('0x55')]===0x709){_0x379c57[_0x97e3('0x61')]=_0x1edac8;}return _0x379c57;});}else{var _0x4dd922={'sectionId':0x76c,'enabled':0x1,'subsections':_0x1edac8};var _0x1829f3=_[_0x97e3('0x2e')](_0x42d60c);_0x1829f3[_0x97e3('0x5b')](_0x4dd922);return _0x1829f3;}});}else{return;}})[_0x97e3('0x26')](function(_0x43f708){if(_0x43f708)_0x42d60c=_0x43f708;return _[_0x97e3('0x5e')](_0x42d60c,[_0x97e3('0x5f'),0x1]);})[_0x97e3('0x26')](respondWithResult(_0x3e4f26,null))[_0x97e3('0x42')](handleError(_0x3e4f26,null));};function hasDefaultDashboard(_0x28008e){var _0x2ed0a3=[0x65];return new BPromise(function(_0x5419f0,_0x196bac){try{if(_0x28008e['autoAssociation']){_0x5419f0(_0x2ed0a3);}else{return db['UserProfileResource'][_0x97e3('0x62')]({'where':{'sectionId':_0x28008e['id']},'raw':!![]})['then'](function(_0x2be116){_0x2be116?_0x5419f0(_0x2ed0a3):_0x5419f0();});}}catch(_0x51e6c2){_0x196bac(_0x51e6c2);}});}function getCustomDashboards(_0x5c1c1c){var _0x1133b3=[];return new BPromise(function(_0x36d45c,_0x38ef02){try{if(_0x5c1c1c[_0x97e3('0x53')]){return db[_0x97e3('0x63')]['findAll']({'raw':!![]})[_0x97e3('0x26')](function(_0x26da40){_0x26da40[_0x97e3('0x64')](function(_0x3650fb){_0x1133b3['push'](_0x3650fb['id']+0x1869f);});_0x36d45c(_0x1133b3);});}else{return db[_0x97e3('0x54')][_0x97e3('0x41')]({'where':{'sectionId':_0x5c1c1c['id']},'raw':!![]})[_0x97e3('0x26')](function(_0x556af6){_0x556af6[_0x97e3('0x64')](function(_0x566fd7){_0x1133b3[_0x97e3('0x5b')](_0x566fd7[_0x97e3('0x65')]+0x1869f);});_0x36d45c(_0x1133b3);});}}catch(_0x5f2373){_0x38ef02(_0x5f2373);}});}function getPlugins(_0x25edb2){var _0x143dbb=[];return new BPromise(function(_0x490e19,_0x13867d){try{if(_0x25edb2[_0x97e3('0x53')]){return db[_0x97e3('0x66')][_0x97e3('0x41')]({'raw':!![]})[_0x97e3('0x26')](function(_0xc42216){_0xc42216[_0x97e3('0x64')](function(_0x274df3){_0x143dbb[_0x97e3('0x5b')](_0x274df3['id']+0x15b38);});_0x490e19(_0x143dbb);});}else{return db[_0x97e3('0x54')][_0x97e3('0x41')]({'where':{'sectionId':_0x25edb2['id']},'raw':!![]})[_0x97e3('0x26')](function(_0x426f12){_0x426f12['forEach'](function(_0x32484c){_0x143dbb[_0x97e3('0x5b')](_0x32484c[_0x97e3('0x65')]+0x15b38);});_0x490e19(_0x143dbb);});}}catch(_0x59b0c2){_0x13867d(_0x59b0c2);}});}exports[_0x97e3('0x67')]=function(_0x2103f4,_0x24ce5b){return db[_0x97e3('0x2a')][_0x97e3('0x47')]({'where':{'id':_0x2103f4['params']['id']}})[_0x97e3('0x26')](handleEntityNotFound(_0x24ce5b,null))[_0x97e3('0x26')](function(_0x259dbd){if(_0x259dbd){return db[_0x97e3('0x4f')]['transaction'](function(_0x52a057){return db[_0x97e3('0x51')][_0x97e3('0x41')]({'where':{'userProfileId':_0x2103f4['params']['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x5515b5){if(_0x5515b5){return db[_0x97e3('0x51')][_0x97e3('0x57')]({'where':{'userProfileId':_0x2103f4['params']['id'],'id':_['map'](_0x5515b5,function(_0x395832){return _0x395832['id'];})},'transaction':_0x52a057});}})[_0x97e3('0x26')](function(_0x256611){var _0x4c535c=_[_0x97e3('0x2e')](_0x2103f4[_0x97e3('0x48')],function(_0x2d24d5){_0x2d24d5[_0x97e3('0x5a')]=_0x2103f4[_0x97e3('0x44')]['id'];return _0x2d24d5;});return db[_0x97e3('0x51')]['bulkCreate'](_0x4c535c,{'raw':!![],'transaction':_0x52a057});})[_0x97e3('0x26')](function(_0x51b680){var _0x1df5f3=_[_0x97e3('0x5e')](_[_0x97e3('0x2e')](_0x51b680,function(_0x250644){return _0x250644['get']({'plain':!![]});}),{'includeAll':![]});if(_0x1df5f3){return db[_0x97e3('0x51')][_0x97e3('0x41')]({'where':{'userProfileId':_0x2103f4[_0x97e3('0x44')]['id'],'sectionId':_[_0x97e3('0x2e')](_0x1df5f3,function(_0x4aeaf5){return _0x4aeaf5[_0x97e3('0x55')];})},'attributes':['id',_0x97e3('0x55')],'raw':!![]})[_0x97e3('0x26')](function(_0x3a3f71){var _0x56eb2e=_[_0x97e3('0x2e')](_0x2103f4[_0x97e3('0x48')],function(_0x217028){_0x217028['userProfileId']=_0x2103f4[_0x97e3('0x44')]['id'];return _0x217028;});return db[_0x97e3('0x54')][_0x97e3('0x68')](_0x56eb2e,{'raw':!![],'transaction':_0x52a057});});}})[_0x97e3('0x42')](handleError(_0x24ce5b,null));});}})[_0x97e3('0x26')](function(_0x418174){var _0x3ba9a8=_[_0x97e3('0x2e')](_0x418174,function(_0x502221){return _0x502221[_0x97e3('0x4a')]({'plain':!![]});});})[_0x97e3('0x26')](respondWithResult(_0x24ce5b,null))['catch'](handleError(_0x24ce5b,null));};exports[_0x97e3('0x69')]=function(_0x366472,_0x464415,_0x243bd4){return db[_0x97e3('0x2a')][_0x97e3('0x47')]({'where':{'id':_0x366472[_0x97e3('0x44')]['id']}})['then'](handleEntityNotFound(_0x464415,null))[_0x97e3('0x26')](function(_0x3da41e){if(_0x3da41e){return _0x3da41e[_0x97e3('0x69')](_0x366472[_0x97e3('0x2f')]['ids']);}})[_0x97e3('0x26')](respondWithStatusCode(_0x464415,null))[_0x97e3('0x42')](handleError(_0x464415,null));};exports[_0x97e3('0x6a')]=function(_0x1a1134,_0x9350ff){var _0x2a28b7={'raw':![],'where':{}};var _0x40dafa={};var _0x5c2b7c={'count':0x0,'rows':[]};var _0x121e8a=_0x1a1134[_0x97e3('0x2f')][_0x97e3('0x6b')];if(typeof _0x121e8a===_0x97e3('0x6c')){throw new db[(_0x97e3('0x6d'))][(_0x97e3('0x6e'))](_0x97e3('0x6f'));}var _0x4da13c=_0x1a1134[_0x97e3('0x2f')]['mergeResources']||![];var _0x2f2497=getQueryModels(_0x121e8a,_0x4da13c);if(typeof _0x2f2497[_0x97e3('0x70')]===_0x97e3('0x6c')){throw new db['Sequelize'][(_0x97e3('0x6e'))]('Invalid\x20section\x20\x27'+_0x121e8a+'\x27');}var _0x61b220=[];if(!_[_0x97e3('0x71')](_0x2f2497[_0x97e3('0x72')])){_0x61b220=_0x2f2497[_0x97e3('0x72')];}else{_0x61b220=[{'name':_0x121e8a}];}return db[_0x97e3('0x2a')][_0x97e3('0x62')]({'where':{'id':_0x1a1134[_0x97e3('0x44')]['id']}})[_0x97e3('0x26')](handleEntityNotFound(_0x9350ff,null))[_0x97e3('0x26')](function(_0x181809){if(_0x181809){var _0x3f2d76=[];for(var _0x37a946=0x0;_0x37a946<_0x61b220[_0x97e3('0x49')];_0x37a946++){_0x3f2d76[_0x97e3('0x5b')](db[_0x97e3('0x51')][_0x97e3('0x62')]({'where':{'userProfileId':_0x181809['id'],'name':_0x61b220[_0x37a946][_0x97e3('0x28')]},'raw':!![]}));}return BPromise[_0x97e3('0x73')](_0x3f2d76);}})['then'](function(_0x50c9e4){var _0x471275=_[_0x97e3('0x5e')](_0x50c9e4,function(_0x585ffd){return _0x585ffd?_0x585ffd:undefined;});var _0x15ef98=_[_0x97e3('0x5e')](_0x61b220,['ignore',!![]]);var _0x2d58ef=_[_0x97e3('0x71')](_0x471275)&&_[_0x97e3('0x71')](_0x15ef98)?null:_[_0x97e3('0x74')](_0x15ef98,_0x471275);if(_0x2d58ef){var _0x2eac78=[];for(var _0x8469d0=0x0;_0x8469d0<_0x2d58ef['length'];_0x8469d0++){var _0x14fc72=_[_0x97e3('0x47')](_0x61b220,function(_0x37970e){return _0x2d58ef[_0x8469d0]?_0x37970e[_0x97e3('0x28')]===_0x2d58ef[_0x8469d0][_0x97e3('0x28')]:null;});if(_0x14fc72){if(_0x2d58ef[_0x8469d0]['ignore']){_0x2eac78['push'](getAllResources(_0x2f2497[_0x97e3('0x70')],_0x2d58ef[_0x8469d0]));}else{if(!_0x2d58ef[_0x8469d0][_0x97e3('0x53')]){_0x2eac78['push'](getAllowedResources(_0x14fc72,_0x2d58ef[_0x8469d0],_0x2f2497[_0x97e3('0x70')]));}else{if(_0x14fc72['model']){_0x2eac78[_0x97e3('0x5b')](getAllFilteredResources(_0x14fc72,_0x2d58ef[_0x8469d0]));}}}}}return BPromise[_0x97e3('0x73')](_0x2eac78);}else{return null;}})[_0x97e3('0x26')](function(_0x40496c){var _0x49eef6=_0x40496c;var _0x5579c7=null;if(_0x49eef6){_0x5579c7=_0x49eef6[_0x97e3('0x49')]===0x1?_0x49eef6[0x0]:null;}if(_0x5579c7||_0x49eef6){var _0x21b8f1=db[_0x2f2497['childModel']][_0x97e3('0x45')];_0x40dafa[_0x97e3('0x32')]=_['keys'](_0x21b8f1);_0x40dafa['query']=_[_0x97e3('0x30')](_0x1a1134['query']);_0x40dafa[_0x97e3('0x3a')]=_[_0x97e3('0x31')](_0x40dafa[_0x97e3('0x32')],_0x40dafa['query']);_0x2a28b7[_0x97e3('0x33')]=_[_0x97e3('0x31')](_0x40dafa['model'],qs[_0x97e3('0x34')](_0x1a1134['query']['fields']));_0x2a28b7[_0x97e3('0x33')]=_0x2a28b7[_0x97e3('0x33')][_0x97e3('0x49')]?_0x2a28b7[_0x97e3('0x33')]:_0x40dafa[_0x97e3('0x32')];if(!_0x1a1134[_0x97e3('0x2f')][_0x97e3('0x35')]('nolimit')){_0x2a28b7[_0x97e3('0x20')]=qs[_0x97e3('0x20')](_0x1a1134[_0x97e3('0x2f')]['limit']);_0x2a28b7[_0x97e3('0x1f')]=qs['offset'](_0x1a1134['query'][_0x97e3('0x1f')]);}_0x2a28b7['order']=qs['sort'](_0x1a1134[_0x97e3('0x2f')]['sort']);_0x2a28b7[_0x97e3('0x39')]=qs['filters'](_[_0x97e3('0x3b')](_0x1a1134['query'],_0x40dafa['filters']));if(_0x1a1134[_0x97e3('0x2f')][_0x97e3('0x5e')]){_0x2a28b7[_0x97e3('0x39')]=_[_0x97e3('0x3c')](_0x2a28b7[_0x97e3('0x39')],{'$or':_[_0x97e3('0x2e')](_0x21b8f1,function(_0x2b269b){if(_0x2b269b[_0x97e3('0x2c')][_0x97e3('0x2d')]!==_0x97e3('0x3d')){var _0x5cffb4={};_0x5cffb4[_0x2b269b[_0x97e3('0x75')]]={'$like':'%'+_0x1a1134[_0x97e3('0x2f')][_0x97e3('0x5e')]+'%'};return _0x5cffb4;}})});}var _0x40f6d4=[];if(_0x5579c7){var _0x53405c=_[_0x97e3('0x47')](_0x61b220,[_0x97e3('0x28'),_0x5579c7['name']]);if(_0x53405c['field']){var _0x2e3961={};if(_0x2f2497[_0x97e3('0x70')]===_0x97e3('0x76')){_0x2e3961[_0x53405c[_0x97e3('0x77')]]=_[_0x97e3('0x2e')](_0x5579c7[_0x97e3('0x78')],'id');}else{_0x2e3961[_0x53405c[_0x97e3('0x77')]]=_0x5579c7[_0x97e3('0x78')];}_0x40f6d4[_0x97e3('0x5b')](_0x2e3961);}else{_0x2a28b7[_0x97e3('0x39')]['id']=_0x5579c7[_0x97e3('0x78')];}}else{for(var _0x321548=0x0;_0x321548<_0x49eef6[_0x97e3('0x49')];_0x321548++){var _0x53405c=_[_0x97e3('0x47')](_0x61b220,[_0x97e3('0x28'),_0x49eef6[_0x321548][_0x97e3('0x28')]]);if(_0x53405c['field']){var _0x2e3961={};_0x2e3961[_0x53405c[_0x97e3('0x77')]]=_0x49eef6[_0x321548][_0x97e3('0x78')];_0x40f6d4['push'](_0x2e3961);}else{if(!_0x2a28b7[_0x97e3('0x39')]['id'])_0x2a28b7[_0x97e3('0x39')]['id']=[];_0x49eef6[_0x321548]['associatedResources'][_0x97e3('0x64')](function(_0x357277){_0x2a28b7[_0x97e3('0x39')]['id'][_0x97e3('0x5b')](_0x357277);});}}}if(!_['isEmpty'](_0x40f6d4)){_0x2a28b7[_0x97e3('0x39')]=_['merge'](_0x2a28b7[_0x97e3('0x39')],{'$and':{'$or':_0x40f6d4}});}_0x2a28b7=_[_0x97e3('0x3c')]({},_0x2a28b7,_0x1a1134[_0x97e3('0x3e')]);if(_0x5579c7&&!_0x5579c7['autoAssociation']&&_0x2f2497[_0x97e3('0x70')]==='AnalyticExtractedReport'){if(_0x1a1134[_0x97e3('0x2f')][_0x97e3('0x46')]){_0x2a28b7[_0x97e3('0x40')]=[{'all':!![]}];}return db[_0x2f2497[_0x97e3('0x70')]]['findAll'](_0x2a28b7)[_0x97e3('0x26')](function(_0x186496){var _0x3fe913=[];_0x186496[_0x97e3('0x64')](function(_0x480d4a){var _0x441f9d;switch(_0x480d4a[_0x97e3('0x79')]){case _0x97e3('0x7a'):_0x441f9d=_[_0x97e3('0x47')](_0x5579c7[_0x97e3('0x78')],function(_0x421ef6){return _0x421ef6['id']===_0x480d4a['reportId']&&_0x421ef6[_0x97e3('0x2c')]===_0x97e3('0x7b');});break;case _0x97e3('0x7c'):_0x441f9d=_['find'](_0x5579c7[_0x97e3('0x78')],function(_0x474750){return _0x474750['id']===_0x480d4a[_0x97e3('0x7d')]&&_0x474750[_0x97e3('0x2c')]==='CustomReports';});break;}if(_0x441f9d)_0x3fe913[_0x97e3('0x5b')](_0x480d4a);});_0x5c2b7c[_0x97e3('0x3f')]=_0x3fe913[_0x97e3('0x49')];_0x5c2b7c[_0x97e3('0x7e')]=_0x3fe913;return _0x5c2b7c;});}else{return db[_0x2f2497['childModel']][_0x97e3('0x3f')]({'where':_0x2a28b7[_0x97e3('0x39')]})[_0x97e3('0x26')](function(_0x58f31a){_0x5c2b7c[_0x97e3('0x3f')]=_0x58f31a;if(_0x1a1134[_0x97e3('0x2f')][_0x97e3('0x46')]){if(_0x2f2497[_0x97e3('0x70')]===_0x97e3('0x7f')){_0x2a28b7[_0x97e3('0x40')]=[{'model':db[_0x97e3('0x80')],'as':'Tags','attributes':['id','name',_0x97e3('0x81')],'required':_0x1a1134[_0x97e3('0x2f')][_0x97e3('0x82')]?!![]:![]},{'model':db[_0x97e3('0x80')],'as':_0x97e3('0x83'),'attributes':['id',_0x97e3('0x28'),'color'],'through':_0x1a1134[_0x97e3('0x2f')]['tag']?{'attributes':[],'where':{'TagId':_0x1a1134[_0x97e3('0x2f')][_0x97e3('0x82')]||undefined}}:{},'required':_0x1a1134[_0x97e3('0x2f')][_0x97e3('0x82')]?!![]:![]}];}else{_0x2a28b7[_0x97e3('0x40')]=[{'all':!![]}];}}return db[_0x2f2497[_0x97e3('0x70')]]['findAll'](_0x2a28b7);})[_0x97e3('0x26')](function(_0xa2dae7){_0x5c2b7c[_0x97e3('0x7e')]=_0xa2dae7;return _0x5c2b7c;});}}else{return _0x5c2b7c;}})['then'](respondWithFilteredResult(_0x9350ff,_0x2a28b7))[_0x97e3('0x42')](handleError(_0x9350ff,null));};function getAllResources(_0x22ae98,_0x1adb95){return new BPromise(function(_0x53b443,_0x2a9938){if(_0x1adb95){var _0x41019a=_0x1adb95['filter']?{[_0x1adb95[_0x97e3('0x5e')][_0x97e3('0x75')]]:_0x1adb95['filter']['value']}:undefined;return db[_0x22ae98]['findAll']({'where':_0x41019a,'raw':!![]})[_0x97e3('0x26')](function(_0x17057f){_0x1adb95[_0x97e3('0x78')]=_['map'](_0x17057f,'id');_0x53b443(_0x1adb95);})[_0x97e3('0x42')](function(_0x4e7427){_0x2a9938(_0x4e7427);});}else{_0x53b443(null);}});}function getAllFilteredResources(_0x236d18,_0x1dfc13){return new BPromise(function(_0xca258a,_0x4f5585){var _0x56d4cd=_0x236d18['filter']?{[_0x236d18[_0x97e3('0x5e')]['field']]:_0x236d18[_0x97e3('0x5e')][_0x97e3('0x84')]}:undefined;return db[_0x236d18[_0x97e3('0x32')]][_0x97e3('0x41')]({'where':_0x56d4cd,'raw':!![]})[_0x97e3('0x26')](function(_0x1fc385){_0x1dfc13[_0x97e3('0x78')]=_[_0x97e3('0x2e')](_0x1fc385,function(_0x33dd2d){return _0x33dd2d[_0x97e3('0x28')];});_0xca258a(_0x1dfc13);})['catch'](function(_0x1c6416){_0x4f5585(_0x1c6416);});});}function getAllowedResources(_0x12df4a,_0x2b20b4,_0x417c12){return new BPromise(function(_0x482b0c,_0x5aeafb){if(_0x2b20b4){return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x2b20b4['id']},'raw':!![]})['then'](function(_0x3213ef){if(_0x12df4a[_0x97e3('0x75')]&&_0x12df4a[_0x97e3('0x75')]!=='id'){_0x2b20b4[_0x97e3('0x78')]=_['map'](_0x3213ef,function(_0x26cb55){return _0x26cb55[_0x12df4a[_0x97e3('0x75')]];});}else{if(_0x417c12===_0x97e3('0x76')){_0x2b20b4['associatedResources']=_[_0x97e3('0x2e')](_0x3213ef,function(_0xf2d9b){return{'id':_0xf2d9b['resourceId'],'type':_0xf2d9b[_0x97e3('0x2c')]};});}else{_0x2b20b4[_0x97e3('0x78')]=_['map'](_0x3213ef,function(_0x2c374e){return _0x2c374e[_0x97e3('0x65')];});}}_0x482b0c(_0x2b20b4);})[_0x97e3('0x42')](function(_0x84cb41){_0x5aeafb(_0x84cb41);});}else{_0x482b0c(null);}});}function getQueryModels(_0x23dab9,_0x4a6ac9){var _0x3e535b=_0x23dab9[_0x97e3('0x85')]();var _0x32c5a4={'childModel':undefined,'parentSections':[]};switch(_0x3e535b){case _0x97e3('0x86'):_0x32c5a4[_0x97e3('0x70')]=_0x97e3('0x87');break;case _0x97e3('0x88'):_0x32c5a4[_0x97e3('0x70')]=_0x97e3('0x89');break;case _0x97e3('0x8a'):_0x32c5a4['childModel']=_0x97e3('0x8b');_0x32c5a4[_0x97e3('0x72')]=[{'name':'SquareProjects','field':_0x97e3('0x28'),'foreignKey':_0x97e3('0x8c')}];break;case _0x97e3('0x8d'):_0x32c5a4['childModel']='JscriptyProject';break;case _0x97e3('0x8e'):_0x32c5a4['childModel']=_0x97e3('0x7f');_0x32c5a4[_0x97e3('0x72')]=[{'name':_0x97e3('0x8f'),'field':'id','foreignKey':'ListId'}];break;case _0x97e3('0x90'):_0x32c5a4[_0x97e3('0x70')]=_0x97e3('0x91');break;case _0x97e3('0x92'):_0x32c5a4[_0x97e3('0x70')]='CmCompany';break;case _0x97e3('0x93'):_0x32c5a4[_0x97e3('0x70')]=_0x97e3('0x94');break;case _0x97e3('0x95'):_0x32c5a4['childModel']=_0x97e3('0x96');break;case _0x97e3('0x97'):_0x32c5a4[_0x97e3('0x70')]='ChatWebsite';break;case'faxqueues':_0x32c5a4[_0x97e3('0x70')]=_0x97e3('0x98');break;case'faxaccounts':_0x32c5a4[_0x97e3('0x70')]='FaxAccount';break;case _0x97e3('0x99'):case _0x97e3('0x9a'):case _0x97e3('0x9b'):_0x32c5a4[_0x97e3('0x70')]=_0x97e3('0x9c');break;case _0x97e3('0x9d'):_0x32c5a4['childModel']=_0x97e3('0x9e');break;case'voicemails':_0x32c5a4[_0x97e3('0x70')]=_0x97e3('0x9f');break;case _0x97e3('0xa0'):_0x32c5a4[_0x97e3('0x70')]='VoiceRecording';_0x32c5a4[_0x97e3('0x72')]=[{'name':_0x97e3('0xa1'),'field':'name','foreignKey':_0x97e3('0xa2'),'model':_0x97e3('0xa3'),'filter':{'field':_0x97e3('0xa4'),'value':[_0x97e3('0xa5')]}},{'name':_0x97e3('0xa6'),'field':'name','foreignKey':_0x97e3('0xa2'),'model':'User','filter':{'field':_0x97e3('0xa4'),'value':['telephone']}},{'name':'VoiceQueues','field':_0x97e3('0x28'),'foreignKey':'queue','model':_0x97e3('0xa7'),'filter':{'field':'type','value':[_0x97e3('0xa8')]}},{'name':_0x97e3('0xa9'),'field':_0x97e3('0x28'),'foreignKey':_0x97e3('0xaa'),'model':_0x97e3('0xa7'),'filter':{'field':_0x97e3('0x2c'),'value':[_0x97e3('0xab')]}}];break;case _0x97e3('0xac'):_0x32c5a4[_0x97e3('0x70')]=_0x97e3('0xad');break;case _0x97e3('0xae'):_0x32c5a4[_0x97e3('0x70')]='VoiceChanSpy';break;case _0x97e3('0xaf'):_0x32c5a4[_0x97e3('0x70')]=_0x97e3('0xb0');break;case _0x97e3('0xb1'):_0x32c5a4[_0x97e3('0x70')]=_0x97e3('0xb2');break;case _0x97e3('0xb3'):_0x32c5a4[_0x97e3('0x70')]='MailQueue';break;case _0x97e3('0xb4'):_0x32c5a4[_0x97e3('0x70')]=_0x97e3('0xb5');break;case'mailsubstatuses':_0x32c5a4['childModel']=_0x97e3('0xb6');break;case'openchannelqueues':_0x32c5a4[_0x97e3('0x70')]=_0x97e3('0xb7');break;case'openchannelaccounts':_0x32c5a4[_0x97e3('0x70')]=_0x97e3('0xb8');break;case _0x97e3('0xb9'):_0x32c5a4[_0x97e3('0x70')]=_0x97e3('0xba');break;case'smsaccounts':_0x32c5a4[_0x97e3('0x70')]=_0x97e3('0xbb');break;case _0x97e3('0xbc'):_0x32c5a4[_0x97e3('0x70')]='Team';break;case'voicequeues':case'queuecampaigns':_0x32c5a4[_0x97e3('0x70')]=_0x97e3('0xa7');if(_0x4a6ac9){_0x32c5a4[_0x97e3('0x72')]=[{'name':_0x97e3('0xbd')},{'name':_0x97e3('0xa9')}];}break;case _0x97e3('0xbe'):case _0x97e3('0xbf'):case _0x97e3('0xc0'):_0x32c5a4[_0x97e3('0x70')]=_0x97e3('0xa3');if(_0x4a6ac9){_0x32c5a4[_0x97e3('0x72')]=[{'name':_0x97e3('0xc1'),'filter':{'field':_0x97e3('0xa4'),'value':[_0x97e3('0xc2'),'user']},'ignore':!![]},{'name':'Agents'},{'name':_0x97e3('0xa6')}];}break;case _0x97e3('0xc3'):_0x32c5a4[_0x97e3('0x70')]=_0x97e3('0xc4');break;case _0x97e3('0xc5'):_0x32c5a4['childModel']=_0x97e3('0xc6');break;case _0x97e3('0xc7'):_0x32c5a4[_0x97e3('0x70')]='FreshdeskAccount';break;case _0x97e3('0xc8'):_0x32c5a4[_0x97e3('0x70')]=_0x97e3('0xc9');break;case'deskaccounts':_0x32c5a4[_0x97e3('0x70')]='DeskAccount';break;case _0x97e3('0xca'):_0x32c5a4[_0x97e3('0x70')]=_0x97e3('0xcb');break;case'vtigeraccounts':_0x32c5a4[_0x97e3('0x70')]=_0x97e3('0xa3');break;case _0x97e3('0xcc'):_0x32c5a4['childModel']=_0x97e3('0xcd');break;case _0x97e3('0xce'):_0x32c5a4[_0x97e3('0x70')]=_0x97e3('0xcf');break;case _0x97e3('0xd0'):_0x32c5a4['childModel']=_0x97e3('0x63');break;case _0x97e3('0xd1'):_0x32c5a4[_0x97e3('0x70')]=_0x97e3('0xd2');break;case _0x97e3('0xd3'):_0x32c5a4[_0x97e3('0x70')]=_0x97e3('0xd4');break;case _0x97e3('0xd5'):_0x32c5a4['childModel']=_0x97e3('0xd6');break;case _0x97e3('0xd7'):_0x32c5a4[_0x97e3('0x70')]=_0x97e3('0xd8');break;case _0x97e3('0xd9'):_0x32c5a4['childModel']='Tag';break;case _0x97e3('0xda'):_0x32c5a4[_0x97e3('0x70')]='Template';break;case _0x97e3('0xdb'):_0x32c5a4[_0x97e3('0x70')]='Trigger';break;case _0x97e3('0xdc'):_0x32c5a4['childModel']=_0x97e3('0xdd');break;case _0x97e3('0xde'):_0x32c5a4[_0x97e3('0x70')]='Variable';break;case _0x97e3('0xdf'):_0x32c5a4['childModel']=_0x97e3('0x66');break;case'extractedreports':_0x32c5a4['childModel']=_0x97e3('0x76');_0x32c5a4[_0x97e3('0x72')]=[{'name':'Reports','field':'id','foreignKey':_0x97e3('0x7d')}];break;case'metrics':_0x32c5a4['childModel']=_0x97e3('0xe0');break;default:return _0x32c5a4;}return _0x32c5a4;} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 1e09ae8..b970f96 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 _0x780e=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','events','../../mysqldb','UserProfile'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x780e,0xde));var _0xe780=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x780e[_0x2641f9];return _0x585741;};'use strict';var EventEmitter=require(_0xe780('0x0'));var UserProfile=require(_0xe780('0x1'))['db'][_0xe780('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xe780('0x3')](0x0);var events={'afterCreate':_0xe780('0x4'),'afterUpdate':'update','afterDestroy':_0xe780('0x5')};function emitEvent(_0x125904){return function(_0x5b7e49,_0x48fc09,_0x29e077){UserProfileEvents[_0xe780('0x6')](_0x125904+':'+_0x5b7e49['id'],_0x5b7e49);UserProfileEvents[_0xe780('0x6')](_0x125904,_0x5b7e49);_0x29e077(null);};}for(var e in events){if(events[_0xe780('0x7')](e)){var event=events[e];UserProfile[_0xe780('0x8')](e,emitEvent(event));}}module['exports']=UserProfileEvents; \ No newline at end of file +var _0xfd81=['UserProfile','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x2c796a,_0x4e88a9){var _0x40f795=function(_0x5c247d){while(--_0x5c247d){_0x2c796a['push'](_0x2c796a['shift']());}};_0x40f795(++_0x4e88a9);}(_0xfd81,0x170));var _0x1fd8=function(_0x286354,_0x1c8e54){_0x286354=_0x286354-0x0;var _0x1d6ff5=_0xfd81[_0x286354];return _0x1d6ff5;};'use strict';var EventEmitter=require(_0x1fd8('0x0'));var UserProfile=require(_0x1fd8('0x1'))['db'][_0x1fd8('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x1fd8('0x3')](0x0);var events={'afterCreate':_0x1fd8('0x4'),'afterUpdate':_0x1fd8('0x5'),'afterDestroy':_0x1fd8('0x6')};function emitEvent(_0x1c9bf9){return function(_0x23d5d0,_0x2fe376,_0x3cc0e7){UserProfileEvents[_0x1fd8('0x7')](_0x1c9bf9+':'+_0x23d5d0['id'],_0x23d5d0);UserProfileEvents['emit'](_0x1c9bf9,_0x23d5d0);_0x3cc0e7(null);};}for(var e in events){if(events[_0x1fd8('0x8')](e)){var event=events[e];UserProfile[_0x1fd8('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 9baa1de..ef75f07 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 _0x6a04=['rimraf','../../config/environment','./userProfile.attributes','UserProfile','user_profiles','lodash','util','api','request-promise','path'];(function(_0x5b6fe5,_0x5ddf47){var _0x5928d4=function(_0x3e0846){while(--_0x3e0846){_0x5b6fe5['push'](_0x5b6fe5['shift']());}};_0x5928d4(++_0x5ddf47);}(_0x6a04,0x18b));var _0x46a0=function(_0x43d943,_0x1a30b8){_0x43d943=_0x43d943-0x0;var _0x512ffb=_0x6a04[_0x43d943];return _0x512ffb;};'use strict';var _=require(_0x46a0('0x0'));var util=require(_0x46a0('0x1'));var logger=require('../../config/logger')(_0x46a0('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x46a0('0x3'));var fs=require('fs');var path=require(_0x46a0('0x4'));var rimraf=require(_0x46a0('0x5'));var config=require(_0x46a0('0x6'));var attributes=require(_0x46a0('0x7'));module['exports']=function(_0x5068cc,_0x4a009b){return _0x5068cc['define'](_0x46a0('0x8'),attributes,{'tableName':_0x46a0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa26b=['moment','bluebird','path','rimraf','../../config/environment','define','user_profiles','util','../../config/logger','api'];(function(_0x1b546f,_0x3ebabc){var _0x43a25a=function(_0x425c94){while(--_0x425c94){_0x1b546f['push'](_0x1b546f['shift']());}};_0x43a25a(++_0x3ebabc);}(_0xa26b,0xc5));var _0xba26=function(_0x1b08b9,_0x3e33a8){_0x1b08b9=_0x1b08b9-0x0;var _0x5522ee=_0xa26b[_0x1b08b9];return _0x5522ee;};'use strict';var _=require('lodash');var util=require(_0xba26('0x0'));var logger=require(_0xba26('0x1'))(_0xba26('0x2'));var moment=require(_0xba26('0x3'));var BPromise=require(_0xba26('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xba26('0x5'));var rimraf=require(_0xba26('0x6'));var config=require(_0xba26('0x7'));var attributes=require('./userProfile.attributes');module['exports']=function(_0x5946e7,_0x3904c3){return _0x5946e7[_0xba26('0x8')]('UserProfile',attributes,{'tableName':_0xba26('0x9'),'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 9b81b33..bb2fdbd 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 _0xeec6=['localhost','socket.io-emitter','./userProfile.socket','register','request','info','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfile,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis'];(function(_0x18b4f6,_0x1025e4){var _0x4f58f2=function(_0x43eb22){while(--_0x43eb22){_0x18b4f6['push'](_0x18b4f6['shift']());}};_0x4f58f2(++_0x1025e4);}(_0xeec6,0x1c2));var _0x6eec=function(_0x13a8cc,_0x45b4fc){_0x13a8cc=_0x13a8cc-0x0;var _0x31b53c=_0xeec6[_0x13a8cc];return _0x31b53c;};'use strict';var _=require(_0x6eec('0x0'));var util=require(_0x6eec('0x1'));var moment=require(_0x6eec('0x2'));var BPromise=require(_0x6eec('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6eec('0x4'));var db=require(_0x6eec('0x5'))['db'];var utils=require(_0x6eec('0x6'));var logger=require(_0x6eec('0x7'))(_0x6eec('0x8'));var config=require(_0x6eec('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6eec('0xa')][_0x6eec('0xb')]({'port':0x232a});config['redis']=_[_0x6eec('0xc')](config[_0x6eec('0xd')],{'host':_0x6eec('0xe'),'port':0x18eb});var socket=require(_0x6eec('0xf'))(new Redis(config['redis']));require(_0x6eec('0x10'))[_0x6eec('0x11')](socket);function respondWithRpcPromise(_0x1c774d,_0x49ad4c,_0x595dd4){return new BPromise(function(_0x5e8aba,_0x295cae){return client[_0x6eec('0x12')](_0x1c774d,_0x595dd4)['then'](function(_0x4b8de1){logger[_0x6eec('0x13')]('UserProfile,\x20%s,\x20%s',_0x49ad4c,_0x6eec('0x14'));logger[_0x6eec('0x15')](_0x6eec('0x16'),_0x49ad4c,_0x6eec('0x14'),JSON[_0x6eec('0x17')](_0x4b8de1));if(_0x4b8de1['error']){if(_0x4b8de1[_0x6eec('0x18')][_0x6eec('0x19')]===0x1f4){logger[_0x6eec('0x18')](_0x6eec('0x1a'),_0x49ad4c,_0x4b8de1[_0x6eec('0x18')][_0x6eec('0x1b')]);return _0x295cae(_0x4b8de1[_0x6eec('0x18')][_0x6eec('0x1b')]);}logger[_0x6eec('0x18')](_0x6eec('0x1a'),_0x49ad4c,_0x4b8de1['error'][_0x6eec('0x1b')]);return _0x5e8aba(_0x4b8de1['error'][_0x6eec('0x1b')]);}else{logger[_0x6eec('0x13')]('UserProfile,\x20%s,\x20%s',_0x49ad4c,_0x6eec('0x14'));_0x5e8aba(_0x4b8de1[_0x6eec('0x1c')][_0x6eec('0x1b')]);}})['catch'](function(_0x87f3be){logger[_0x6eec('0x18')](_0x6eec('0x1a'),_0x49ad4c,_0x87f3be);_0x295cae(_0x87f3be);});});} \ No newline at end of file +var _0x31f0=['debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','redis','localhost','socket.io-emitter','register','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent'];(function(_0x418d5e,_0x7d5785){var _0x587e81=function(_0x53ef5f){while(--_0x53ef5f){_0x418d5e['push'](_0x418d5e['shift']());}};_0x587e81(++_0x7d5785);}(_0x31f0,0xb7));var _0x031f=function(_0x2f6d31,_0x40bb05){_0x2f6d31=_0x2f6d31-0x0;var _0x11b4a7=_0x31f0[_0x2f6d31];return _0x11b4a7;};'use strict';var _=require(_0x031f('0x0'));var util=require('util');var moment=require(_0x031f('0x1'));var BPromise=require('bluebird');var rs=require(_0x031f('0x2'));var fs=require('fs');var Redis=require(_0x031f('0x3'));var db=require(_0x031f('0x4'))['db'];var utils=require(_0x031f('0x5'));var logger=require('../../config/logger')(_0x031f('0x6'));var config=require(_0x031f('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x031f('0x8')]=_['defaults'](config[_0x031f('0x8')],{'host':_0x031f('0x9'),'port':0x18eb});var socket=require(_0x031f('0xa'))(new Redis(config[_0x031f('0x8')]));require('./userProfile.socket')[_0x031f('0xb')](socket);function respondWithRpcPromise(_0x24145f,_0x327f11,_0x439940){return new BPromise(function(_0x3dd729,_0x3b0a17){return client[_0x031f('0xc')](_0x24145f,_0x439940)[_0x031f('0xd')](function(_0x4df318){logger[_0x031f('0xe')](_0x031f('0xf'),_0x327f11,_0x031f('0x10'));logger[_0x031f('0x11')](_0x031f('0x12'),_0x327f11,_0x031f('0x10'),JSON[_0x031f('0x13')](_0x4df318));if(_0x4df318['error']){if(_0x4df318[_0x031f('0x14')][_0x031f('0x15')]===0x1f4){logger[_0x031f('0x14')](_0x031f('0xf'),_0x327f11,_0x4df318[_0x031f('0x14')]['message']);return _0x3b0a17(_0x4df318['error'][_0x031f('0x16')]);}logger[_0x031f('0x14')](_0x031f('0xf'),_0x327f11,_0x4df318[_0x031f('0x14')]['message']);return _0x3dd729(_0x4df318[_0x031f('0x14')][_0x031f('0x16')]);}else{logger['info'](_0x031f('0xf'),_0x327f11,'request\x20sent');_0x3dd729(_0x4df318[_0x031f('0x17')][_0x031f('0x16')]);}})[_0x031f('0x18')](function(_0xaa155){logger[_0x031f('0x14')](_0x031f('0xf'),_0x327f11,_0xaa155);_0x3b0a17(_0xaa155);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 62738b9..477fcce 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 _0xbacd=['remove','removeListener','register','length','userProfile:','save'];(function(_0x558e1e,_0x3fd803){var _0x5ba193=function(_0x1c2975){while(--_0x1c2975){_0x558e1e['push'](_0x558e1e['shift']());}};_0x5ba193(++_0x3fd803);}(_0xbacd,0xcb));var _0xdbac=function(_0x497c6d,_0x1b491e){_0x497c6d=_0x497c6d-0x0;var _0x813a7b=_0xbacd[_0x497c6d];return _0x813a7b;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0xdbac('0x0'),_0xdbac('0x1'),'update'];function createListener(_0x219a58,_0x5982b1){return function(_0xa4c1f3){_0x5982b1['emit'](_0x219a58,_0xa4c1f3);};}function removeListener(_0x59ae57,_0x469114){return function(){UserProfileEvents[_0xdbac('0x2')](_0x59ae57,_0x469114);};}exports[_0xdbac('0x3')]=function(_0x8f7a5a){for(var _0x38b724=0x0,_0x33a8bc=events[_0xdbac('0x4')];_0x38b724<_0x33a8bc;_0x38b724++){var _0x9a1f4f=events[_0x38b724];var _0x3a995=createListener(_0xdbac('0x5')+_0x9a1f4f,_0x8f7a5a);UserProfileEvents['on'](_0x9a1f4f,_0x3a995);}}; \ No newline at end of file +var _0xf909=['./userProfile.events','remove','emit','removeListener','userProfile:'];(function(_0x4a3656,_0x49e27f){var _0x2dce0d=function(_0x47f684){while(--_0x47f684){_0x4a3656['push'](_0x4a3656['shift']());}};_0x2dce0d(++_0x49e27f);}(_0xf909,0xb9));var _0x9f90=function(_0x3d6e0f,_0xb4eb76){_0x3d6e0f=_0x3d6e0f-0x0;var _0x1c7b0c=_0xf909[_0x3d6e0f];return _0x1c7b0c;};'use strict';var UserProfileEvents=require(_0x9f90('0x0'));var events=['save',_0x9f90('0x1'),'update'];function createListener(_0x158457,_0x24c475){return function(_0x180024){_0x24c475[_0x9f90('0x2')](_0x158457,_0x180024);};}function removeListener(_0x1ec7dd,_0x1d8b4c){return function(){UserProfileEvents[_0x9f90('0x3')](_0x1ec7dd,_0x1d8b4c);};}exports['register']=function(_0xab6c28){for(var _0x3b9d6f=0x0,_0x4ba75a=events['length'];_0x3b9d6f<_0x4ba75a;_0x3b9d6f++){var _0x4f8f92=events[_0x3b9d6f];var _0x11e46b=createListener(_0x9f90('0x4')+_0x4f8f92,_0xab6c28);UserProfileEvents['on'](_0x4f8f92,_0x11e46b);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 6cd1a51..f349b1b 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 _0x9443=['../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','update','delete','destroy','multer','util','express','Router','../../components/auth/service'];(function(_0x4409e7,_0x307f17){var _0x24c751=function(_0x3a7d33){while(--_0x3a7d33){_0x4409e7['push'](_0x4409e7['shift']());}};_0x24c751(++_0x307f17);}(_0x9443,0xc3));var _0x3944=function(_0x3a4f18,_0x1af741){_0x3a4f18=_0x3a4f18-0x0;var _0x4c20fc=_0x9443[_0x3a4f18];return _0x4c20fc;};'use strict';var multer=require(_0x3944('0x0'));var util=require(_0x3944('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3944('0x2'));var router=express[_0x3944('0x3')]();var auth=require(_0x3944('0x4'));var interaction=require(_0x3944('0x5'));var config=require(_0x3944('0x6'));var controller=require(_0x3944('0x7'));router[_0x3944('0x8')]('/',auth[_0x3944('0x9')](),controller['index']);router[_0x3944('0x8')](_0x3944('0xa'),auth['isAuthenticated'](),controller[_0x3944('0xb')]);router['get'](_0x3944('0xc'),auth[_0x3944('0x9')](),controller[_0x3944('0xd')]);router[_0x3944('0xe')]('/',auth['isAuthenticated'](),controller[_0x3944('0xf')]);router[_0x3944('0x10')](_0x3944('0xc'),auth[_0x3944('0x9')](),controller[_0x3944('0x11')]);router[_0x3944('0x12')](_0x3944('0xc'),auth[_0x3944('0x9')](),controller[_0x3944('0x13')]);module['exports']=router; \ No newline at end of file +var _0x73ab=['/:id','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./userProfileResource.controller','isAuthenticated','index','/describe','describe','get'];(function(_0x19f4d2,_0x24b75d){var _0x49819c=function(_0x49aeb2){while(--_0x49aeb2){_0x19f4d2['push'](_0x19f4d2['shift']());}};_0x49819c(++_0x24b75d);}(_0x73ab,0x182));var _0xb73a=function(_0x48ec91,_0x212edc){_0x48ec91=_0x48ec91-0x0;var _0x22766c=_0x73ab[_0x48ec91];return _0x22766c;};'use strict';var multer=require(_0xb73a('0x0'));var util=require(_0xb73a('0x1'));var path=require(_0xb73a('0x2'));var timeout=require(_0xb73a('0x3'));var express=require(_0xb73a('0x4'));var router=express[_0xb73a('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb73a('0x6'));var controller=require(_0xb73a('0x7'));router['get']('/',auth[_0xb73a('0x8')](),controller[_0xb73a('0x9')]);router['get'](_0xb73a('0xa'),auth['isAuthenticated'](),controller[_0xb73a('0xb')]);router[_0xb73a('0xc')](_0xb73a('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xb73a('0xe')]('/',auth[_0xb73a('0x8')](),controller[_0xb73a('0xf')]);router[_0xb73a('0x10')](_0xb73a('0xd'),auth['isAuthenticated'](),controller[_0xb73a('0x11')]);router[_0xb73a('0x12')](_0xb73a('0xd'),auth[_0xb73a('0x8')](),controller[_0xb73a('0x13')]);module[_0xb73a('0x14')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 9d40df9..1f74c69 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 _0x0080=['INTEGER','sequelize','STRING'];(function(_0x579a56,_0x207fc7){var _0x32c458=function(_0x2206e7){while(--_0x2206e7){_0x579a56['push'](_0x579a56['shift']());}};_0x32c458(++_0x207fc7);}(_0x0080,0x9a));var _0x0008=function(_0x3b5711,_0x36eb53){_0x3b5711=_0x3b5711-0x0;var _0x4857dd=_0x0080[_0x3b5711];return _0x4857dd;};'use strict';var Sequelize=require(_0x0008('0x0'));module['exports']={'name':{'type':Sequelize[_0x0008('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x0008('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x0008('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x742f=['sequelize','exports','INTEGER','STRING'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0x742f,0x1d4));var _0xf742=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0x742f[_0x2f3848];return _0x102668;};'use strict';var Sequelize=require(_0xf742('0x0'));module[_0xf742('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize[_0xf742('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xf742('0x3')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index ed075c8..c40f271 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 _0xf1c9=['fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','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','index','map','UserProfileResource','rawAttributes','fieldName','key','model','query','keys','intersection'];(function(_0x37943c,_0x51fa61){var _0x34260c=function(_0x4b9617){while(--_0x4b9617){_0x37943c['push'](_0x37943c['shift']());}};_0x34260c(++_0x51fa61);}(_0xf1c9,0xf3));var _0x9f1c=function(_0x3b11c9,_0x30b465){_0x3b11c9=_0x3b11c9-0x0;var _0x42bd04=_0xf1c9[_0x3b11c9];return _0x42bd04;};'use strict';var pdf=require(_0x9f1c('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x9f1c('0x1'));var zipdir=require(_0x9f1c('0x2'));var jsonpatch=require(_0x9f1c('0x3'));var rp=require(_0x9f1c('0x4'));var moment=require(_0x9f1c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9f1c('0x6'));var util=require(_0x9f1c('0x7'));var path=require(_0x9f1c('0x8'));var sox=require(_0x9f1c('0x9'));var csv=require(_0x9f1c('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x9f1c('0xb'));var squel=require(_0x9f1c('0xc'));var crypto=require(_0x9f1c('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9f1c('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9f1c('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x9f1c('0xf'));var hardwareService=require(_0x9f1c('0x10'));var logger=require('../../config/logger')(_0x9f1c('0x11'));var utils=require(_0x9f1c('0x12'));var config=require(_0x9f1c('0x13'));var db=require(_0x9f1c('0x14'))['db'];function respondWithStatusCode(_0x4238c7,_0x4911de){_0x4911de=_0x4911de||0xcc;return function(_0x12223c){if(_0x12223c){return _0x4238c7[_0x9f1c('0x15')](_0x4911de);}return _0x4238c7[_0x9f1c('0x16')](_0x4911de)[_0x9f1c('0x17')]();};}function respondWithResult(_0x2a9569,_0x5c8cf8){_0x5c8cf8=_0x5c8cf8||0xc8;return function(_0xf5034f){if(_0xf5034f){return _0x2a9569[_0x9f1c('0x16')](_0x5c8cf8)[_0x9f1c('0x18')](_0xf5034f);}};}function respondWithFilteredResult(_0x539290,_0x4ba123){return function(_0x307925){if(_0x307925){var _0x344005=_0x307925[_0x9f1c('0x19')],_0x5d6a8d=_0x4ba123[_0x9f1c('0x1a')],_0x3bf734=_0x4ba123[_0x9f1c('0x1a')]+_0x4ba123[_0x9f1c('0x1b')],_0x3f6084;if(_0x3bf734>=_0x344005){_0x3bf734=_0x344005;_0x3f6084=0xc8;}else{_0x3f6084=0xce;}_0x539290[_0x9f1c('0x16')](_0x3f6084);return _0x539290['set'](_0x9f1c('0x1c'),_0x5d6a8d+'-'+_0x3bf734+'/'+_0x344005)['json'](_0x307925);}return null;};}function patchUpdates(_0x58b598){return function(_0x1eb169){try{jsonpatch[_0x9f1c('0x1d')](_0x1eb169,_0x58b598,!![]);}catch(_0x4502dd){return BPromise[_0x9f1c('0x1e')](_0x4502dd);}return _0x1eb169[_0x9f1c('0x1f')]();};}function saveUpdates(_0x373193,_0x5d6720){return function(_0x356050){if(_0x356050){return _0x356050[_0x9f1c('0x20')](_0x373193)[_0x9f1c('0x21')](function(_0x427d6f){return _0x427d6f;});}return null;};}function removeEntity(_0x18d03c,_0x4da51f){return function(_0x5e6af0){if(_0x5e6af0){return _0x5e6af0[_0x9f1c('0x22')]()[_0x9f1c('0x21')](function(){_0x18d03c[_0x9f1c('0x16')](0xcc)[_0x9f1c('0x17')]();});}};}function handleEntityNotFound(_0x5ab9bb,_0x2246ac){return function(_0x173864){if(!_0x173864){_0x5ab9bb['sendStatus'](0x194);}return _0x173864;};}function handleError(_0xbe6637,_0xe8545b){_0xe8545b=_0xe8545b||0x1f4;return function(_0x404380){logger[_0x9f1c('0x23')](_0x404380[_0x9f1c('0x24')]);if(_0x404380[_0x9f1c('0x25')]){delete _0x404380[_0x9f1c('0x25')];}_0xbe6637[_0x9f1c('0x16')](_0xe8545b)[_0x9f1c('0x26')](_0x404380);};}exports[_0x9f1c('0x27')]=function(_0x697dcc,_0x3e8579){var _0x472b09={},_0x3f6b9f={},_0x3f0f89={'count':0x0,'rows':[]};var _0xacab34=_[_0x9f1c('0x28')](db[_0x9f1c('0x29')][_0x9f1c('0x2a')],function(_0x4f85d5){return{'name':_0x4f85d5[_0x9f1c('0x2b')],'type':_0x4f85d5['type'][_0x9f1c('0x2c')]};});_0x3f6b9f[_0x9f1c('0x2d')]=_[_0x9f1c('0x28')](_0xacab34,_0x9f1c('0x25'));_0x3f6b9f[_0x9f1c('0x2e')]=_[_0x9f1c('0x2f')](_0x697dcc[_0x9f1c('0x2e')]);_0x3f6b9f['filters']=_[_0x9f1c('0x30')](_0x3f6b9f[_0x9f1c('0x2d')],_0x3f6b9f['query']);_0x472b09['attributes']=_[_0x9f1c('0x30')](_0x3f6b9f[_0x9f1c('0x2d')],qs[_0x9f1c('0x31')](_0x697dcc[_0x9f1c('0x2e')][_0x9f1c('0x31')]));_0x472b09[_0x9f1c('0x32')]=_0x472b09[_0x9f1c('0x32')][_0x9f1c('0x33')]?_0x472b09[_0x9f1c('0x32')]:_0x3f6b9f['model'];if(!_0x697dcc[_0x9f1c('0x2e')][_0x9f1c('0x34')](_0x9f1c('0x35'))){_0x472b09[_0x9f1c('0x1b')]=qs[_0x9f1c('0x1b')](_0x697dcc[_0x9f1c('0x2e')][_0x9f1c('0x1b')]);_0x472b09['offset']=qs[_0x9f1c('0x1a')](_0x697dcc['query']['offset']);}_0x472b09['order']=qs[_0x9f1c('0x36')](_0x697dcc[_0x9f1c('0x2e')][_0x9f1c('0x36')]);_0x472b09[_0x9f1c('0x37')]=qs['filters'](_[_0x9f1c('0x38')](_0x697dcc[_0x9f1c('0x2e')],_0x3f6b9f[_0x9f1c('0x39')]));if(_0x697dcc['query'][_0x9f1c('0x3a')]){_0x472b09['where']=_[_0x9f1c('0x3b')](_0x472b09[_0x9f1c('0x37')],{'$or':_[_0x9f1c('0x28')](_0xacab34,function(_0x18f5d3){if(_0x18f5d3[_0x9f1c('0x3c')]!==_0x9f1c('0x3d')){var _0x51cfe3={};_0x51cfe3[_0x18f5d3['name']]={'$like':'%'+_0x697dcc[_0x9f1c('0x2e')][_0x9f1c('0x3a')]+'%'};return _0x51cfe3;}})});}_0x472b09=_['merge']({},_0x472b09,_0x697dcc[_0x9f1c('0x3e')]);var _0x8605d4={'where':_0x472b09['where']};return db[_0x9f1c('0x29')][_0x9f1c('0x19')](_0x8605d4)['then'](function(_0x50b0b7){_0x3f0f89[_0x9f1c('0x19')]=_0x50b0b7;if(_0x697dcc[_0x9f1c('0x2e')][_0x9f1c('0x3f')]){_0x472b09[_0x9f1c('0x40')]=[{'all':!![]}];}return db[_0x9f1c('0x29')][_0x9f1c('0x41')](_0x472b09);})['then'](function(_0x5510d2){_0x3f0f89['rows']=_0x5510d2;return _0x3f0f89;})['then'](respondWithFilteredResult(_0x3e8579,_0x472b09))[_0x9f1c('0x42')](handleError(_0x3e8579,null));};exports[_0x9f1c('0x43')]=function(_0x35b45c,_0x29020e){var _0x5c7ed1={'raw':![],'where':{'id':_0x35b45c[_0x9f1c('0x44')]['id']}},_0x2779d7={};_0x2779d7[_0x9f1c('0x2d')]=_[_0x9f1c('0x2f')](db[_0x9f1c('0x29')][_0x9f1c('0x2a')]);_0x2779d7[_0x9f1c('0x2e')]=_[_0x9f1c('0x2f')](_0x35b45c['query']);_0x2779d7['filters']=_['intersection'](_0x2779d7[_0x9f1c('0x2d')],_0x2779d7[_0x9f1c('0x2e')]);_0x5c7ed1[_0x9f1c('0x32')]=_[_0x9f1c('0x30')](_0x2779d7[_0x9f1c('0x2d')],qs['fields'](_0x35b45c['query'][_0x9f1c('0x31')]));_0x5c7ed1[_0x9f1c('0x32')]=_0x5c7ed1['attributes']['length']?_0x5c7ed1[_0x9f1c('0x32')]:_0x2779d7[_0x9f1c('0x2d')];if(_0x35b45c[_0x9f1c('0x2e')][_0x9f1c('0x3f')]){_0x5c7ed1['include']=[{'all':!![]}];}_0x5c7ed1=_[_0x9f1c('0x3b')]({},_0x5c7ed1,_0x35b45c[_0x9f1c('0x3e')]);return db[_0x9f1c('0x29')][_0x9f1c('0x45')](_0x5c7ed1)['then'](handleEntityNotFound(_0x29020e,null))[_0x9f1c('0x21')](respondWithResult(_0x29020e,null))[_0x9f1c('0x42')](handleError(_0x29020e,null));};exports[_0x9f1c('0x46')]=function(_0xbaeb6f,_0x480080){return db[_0x9f1c('0x29')][_0x9f1c('0x46')](_0xbaeb6f[_0x9f1c('0x47')],{})[_0x9f1c('0x21')](respondWithResult(_0x480080,0xc9))[_0x9f1c('0x42')](handleError(_0x480080,null));};exports[_0x9f1c('0x20')]=function(_0x5ea197,_0x3cd57a){if(_0x5ea197[_0x9f1c('0x47')]['id']){delete _0x5ea197['body']['id'];}return db[_0x9f1c('0x29')][_0x9f1c('0x45')]({'where':{'id':_0x5ea197[_0x9f1c('0x44')]['id']}})[_0x9f1c('0x21')](handleEntityNotFound(_0x3cd57a,null))[_0x9f1c('0x21')](saveUpdates(_0x5ea197[_0x9f1c('0x47')],null))[_0x9f1c('0x21')](respondWithResult(_0x3cd57a,null))[_0x9f1c('0x42')](handleError(_0x3cd57a,null));};exports[_0x9f1c('0x22')]=function(_0x4038a3,_0x5aa23b){return db[_0x9f1c('0x29')][_0x9f1c('0x45')]({'where':{'id':_0x4038a3[_0x9f1c('0x44')]['id']}})[_0x9f1c('0x21')](handleEntityNotFound(_0x5aa23b,null))['then'](removeEntity(_0x5aa23b,null))[_0x9f1c('0x42')](handleError(_0x5aa23b,null));};exports[_0x9f1c('0x48')]=function(_0x44e4f9,_0x5e41bd){return db[_0x9f1c('0x29')][_0x9f1c('0x48')]()['then'](respondWithResult(_0x5e41bd,null))['catch'](handleError(_0x5e41bd,null));}; \ No newline at end of file +var _0xfde7=['count','offset','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','map','UserProfileResource','rawAttributes','type','key','model','query','keys','attributes','intersection','fields','length','nolimit','limit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','rows','catch','show','params','find','create','body','destroy','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','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','status','end','json'];(function(_0x387777,_0x356171){var _0x3f84c0=function(_0x4d4423){while(--_0x4d4423){_0x387777['push'](_0x387777['shift']());}};_0x3f84c0(++_0x356171);}(_0xfde7,0x10f));var _0x7fde=function(_0x10004e,_0xd701e6){_0x10004e=_0x10004e-0x0;var _0x5af990=_0xfde7[_0x10004e];return _0x5af990;};'use strict';var pdf=require(_0x7fde('0x0'));var emlformat=require(_0x7fde('0x1'));var rimraf=require(_0x7fde('0x2'));var zipdir=require(_0x7fde('0x3'));var jsonpatch=require(_0x7fde('0x4'));var rp=require(_0x7fde('0x5'));var moment=require(_0x7fde('0x6'));var BPromise=require(_0x7fde('0x7'));var Mustache=require('mustache');var util=require(_0x7fde('0x8'));var path=require(_0x7fde('0x9'));var sox=require('sox');var csv=require(_0x7fde('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x7fde('0xb'));var squel=require('squel');var crypto=require(_0x7fde('0xc'));var jsforce=require(_0x7fde('0xd'));var deskjs=require(_0x7fde('0xe'));var toCsv=require(_0x7fde('0xa'));var querystring=require(_0x7fde('0xf'));var Papa=require(_0x7fde('0x10'));var Redis=require(_0x7fde('0x11'));var authService=require(_0x7fde('0x12'));var qs=require(_0x7fde('0x13'));var as=require(_0x7fde('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7fde('0x15'))(_0x7fde('0x16'));var utils=require(_0x7fde('0x17'));var config=require(_0x7fde('0x18'));var db=require(_0x7fde('0x19'))['db'];function respondWithStatusCode(_0x23b0a5,_0x3cc835){_0x3cc835=_0x3cc835||0xcc;return function(_0x569b19){if(_0x569b19){return _0x23b0a5['sendStatus'](_0x3cc835);}return _0x23b0a5[_0x7fde('0x1a')](_0x3cc835)[_0x7fde('0x1b')]();};}function respondWithResult(_0x3cb28c,_0x54d6ef){_0x54d6ef=_0x54d6ef||0xc8;return function(_0x34f04e){if(_0x34f04e){return _0x3cb28c[_0x7fde('0x1a')](_0x54d6ef)[_0x7fde('0x1c')](_0x34f04e);}};}function respondWithFilteredResult(_0x566fd4,_0x57f843){return function(_0x38272c){if(_0x38272c){var _0x278f2d=_0x38272c[_0x7fde('0x1d')],_0xcef67c=_0x57f843[_0x7fde('0x1e')],_0x4dd0da=_0x57f843['offset']+_0x57f843['limit'],_0x23a1fb;if(_0x4dd0da>=_0x278f2d){_0x4dd0da=_0x278f2d;_0x23a1fb=0xc8;}else{_0x23a1fb=0xce;}_0x566fd4[_0x7fde('0x1a')](_0x23a1fb);return _0x566fd4['set'](_0x7fde('0x1f'),_0xcef67c+'-'+_0x4dd0da+'/'+_0x278f2d)[_0x7fde('0x1c')](_0x38272c);}return null;};}function patchUpdates(_0x3cceff){return function(_0x2e719f){try{jsonpatch[_0x7fde('0x20')](_0x2e719f,_0x3cceff,!![]);}catch(_0x21cbda){return BPromise[_0x7fde('0x21')](_0x21cbda);}return _0x2e719f[_0x7fde('0x22')]();};}function saveUpdates(_0x434a89,_0x88dad4){return function(_0x4cca9f){if(_0x4cca9f){return _0x4cca9f[_0x7fde('0x23')](_0x434a89)['then'](function(_0x2b55c4){return _0x2b55c4;});}return null;};}function removeEntity(_0x3a349b,_0x2617ca){return function(_0x4da1ae){if(_0x4da1ae){return _0x4da1ae['destroy']()[_0x7fde('0x24')](function(){_0x3a349b[_0x7fde('0x1a')](0xcc)[_0x7fde('0x1b')]();});}};}function handleEntityNotFound(_0x2d8d22,_0x3565b4){return function(_0x148434){if(!_0x148434){_0x2d8d22[_0x7fde('0x25')](0x194);}return _0x148434;};}function handleError(_0x1fd209,_0x821d9b){_0x821d9b=_0x821d9b||0x1f4;return function(_0x917695){logger[_0x7fde('0x26')](_0x917695[_0x7fde('0x27')]);if(_0x917695[_0x7fde('0x28')]){delete _0x917695['name'];}_0x1fd209[_0x7fde('0x1a')](_0x821d9b)[_0x7fde('0x29')](_0x917695);};}exports[_0x7fde('0x2a')]=function(_0x612f27,_0x19883c){var _0x1ba8c3={},_0x473bdc={},_0x48784f={'count':0x0,'rows':[]};var _0x2b57c1=_[_0x7fde('0x2b')](db[_0x7fde('0x2c')][_0x7fde('0x2d')],function(_0x10c597){return{'name':_0x10c597['fieldName'],'type':_0x10c597[_0x7fde('0x2e')][_0x7fde('0x2f')]};});_0x473bdc[_0x7fde('0x30')]=_[_0x7fde('0x2b')](_0x2b57c1,'name');_0x473bdc[_0x7fde('0x31')]=_[_0x7fde('0x32')](_0x612f27[_0x7fde('0x31')]);_0x473bdc['filters']=_['intersection'](_0x473bdc['model'],_0x473bdc[_0x7fde('0x31')]);_0x1ba8c3[_0x7fde('0x33')]=_[_0x7fde('0x34')](_0x473bdc[_0x7fde('0x30')],qs[_0x7fde('0x35')](_0x612f27[_0x7fde('0x31')][_0x7fde('0x35')]));_0x1ba8c3[_0x7fde('0x33')]=_0x1ba8c3['attributes'][_0x7fde('0x36')]?_0x1ba8c3['attributes']:_0x473bdc['model'];if(!_0x612f27['query']['hasOwnProperty'](_0x7fde('0x37'))){_0x1ba8c3[_0x7fde('0x38')]=qs[_0x7fde('0x38')](_0x612f27[_0x7fde('0x31')][_0x7fde('0x38')]);_0x1ba8c3[_0x7fde('0x1e')]=qs[_0x7fde('0x1e')](_0x612f27[_0x7fde('0x31')][_0x7fde('0x1e')]);}_0x1ba8c3[_0x7fde('0x39')]=qs['sort'](_0x612f27[_0x7fde('0x31')][_0x7fde('0x3a')]);_0x1ba8c3[_0x7fde('0x3b')]=qs[_0x7fde('0x3c')](_[_0x7fde('0x3d')](_0x612f27[_0x7fde('0x31')],_0x473bdc[_0x7fde('0x3c')]));if(_0x612f27[_0x7fde('0x31')][_0x7fde('0x3e')]){_0x1ba8c3['where']=_[_0x7fde('0x3f')](_0x1ba8c3[_0x7fde('0x3b')],{'$or':_[_0x7fde('0x2b')](_0x2b57c1,function(_0x38bcea){if(_0x38bcea[_0x7fde('0x2e')]!=='VIRTUAL'){var _0x2d8412={};_0x2d8412[_0x38bcea[_0x7fde('0x28')]]={'$like':'%'+_0x612f27[_0x7fde('0x31')]['filter']+'%'};return _0x2d8412;}})});}_0x1ba8c3=_[_0x7fde('0x3f')]({},_0x1ba8c3,_0x612f27[_0x7fde('0x40')]);var _0x135a92={'where':_0x1ba8c3[_0x7fde('0x3b')]};return db['UserProfileResource'][_0x7fde('0x1d')](_0x135a92)['then'](function(_0x1aee01){_0x48784f[_0x7fde('0x1d')]=_0x1aee01;if(_0x612f27['query'][_0x7fde('0x41')]){_0x1ba8c3[_0x7fde('0x42')]=[{'all':!![]}];}return db[_0x7fde('0x2c')]['findAll'](_0x1ba8c3);})[_0x7fde('0x24')](function(_0x1816a6){_0x48784f[_0x7fde('0x43')]=_0x1816a6;return _0x48784f;})[_0x7fde('0x24')](respondWithFilteredResult(_0x19883c,_0x1ba8c3))[_0x7fde('0x44')](handleError(_0x19883c,null));};exports[_0x7fde('0x45')]=function(_0x5b1575,_0x3c487c){var _0x18099f={'raw':![],'where':{'id':_0x5b1575[_0x7fde('0x46')]['id']}},_0x5cb808={};_0x5cb808[_0x7fde('0x30')]=_['keys'](db[_0x7fde('0x2c')][_0x7fde('0x2d')]);_0x5cb808[_0x7fde('0x31')]=_[_0x7fde('0x32')](_0x5b1575['query']);_0x5cb808['filters']=_[_0x7fde('0x34')](_0x5cb808[_0x7fde('0x30')],_0x5cb808['query']);_0x18099f[_0x7fde('0x33')]=_[_0x7fde('0x34')](_0x5cb808[_0x7fde('0x30')],qs[_0x7fde('0x35')](_0x5b1575[_0x7fde('0x31')][_0x7fde('0x35')]));_0x18099f['attributes']=_0x18099f[_0x7fde('0x33')]['length']?_0x18099f[_0x7fde('0x33')]:_0x5cb808[_0x7fde('0x30')];if(_0x5b1575[_0x7fde('0x31')][_0x7fde('0x41')]){_0x18099f[_0x7fde('0x42')]=[{'all':!![]}];}_0x18099f=_[_0x7fde('0x3f')]({},_0x18099f,_0x5b1575['options']);return db[_0x7fde('0x2c')][_0x7fde('0x47')](_0x18099f)[_0x7fde('0x24')](handleEntityNotFound(_0x3c487c,null))[_0x7fde('0x24')](respondWithResult(_0x3c487c,null))['catch'](handleError(_0x3c487c,null));};exports['create']=function(_0x350f17,_0x14ec20){return db['UserProfileResource'][_0x7fde('0x48')](_0x350f17[_0x7fde('0x49')],{})[_0x7fde('0x24')](respondWithResult(_0x14ec20,0xc9))[_0x7fde('0x44')](handleError(_0x14ec20,null));};exports[_0x7fde('0x23')]=function(_0x1d82b2,_0xbf2512){if(_0x1d82b2[_0x7fde('0x49')]['id']){delete _0x1d82b2['body']['id'];}return db[_0x7fde('0x2c')][_0x7fde('0x47')]({'where':{'id':_0x1d82b2['params']['id']}})['then'](handleEntityNotFound(_0xbf2512,null))['then'](saveUpdates(_0x1d82b2[_0x7fde('0x49')],null))[_0x7fde('0x24')](respondWithResult(_0xbf2512,null))[_0x7fde('0x44')](handleError(_0xbf2512,null));};exports[_0x7fde('0x4a')]=function(_0x4810c7,_0x2f9d7b){return db[_0x7fde('0x2c')]['find']({'where':{'id':_0x4810c7[_0x7fde('0x46')]['id']}})[_0x7fde('0x24')](handleEntityNotFound(_0x2f9d7b,null))[_0x7fde('0x24')](removeEntity(_0x2f9d7b,null))[_0x7fde('0x44')](handleError(_0x2f9d7b,null));};exports['describe']=function(_0x5e4e17,_0x38b965){return db[_0x7fde('0x2c')]['describe']()[_0x7fde('0x24')](respondWithResult(_0x38b965,null))[_0x7fde('0x44')](handleError(_0x38b965,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index d551afb..a190f2e 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 _0xae5f=['request-promise','../../config/environment','exports','define','compositeIndex','resourceId','sectionId','lodash','util','api','moment','bluebird'];(function(_0x1f37b8,_0x2f4072){var _0x452ead=function(_0x43ca00){while(--_0x43ca00){_0x1f37b8['push'](_0x1f37b8['shift']());}};_0x452ead(++_0x2f4072);}(_0xae5f,0x163));var _0xfae5=function(_0x5a5abc,_0x1247d1){_0x5a5abc=_0x5a5abc-0x0;var _0x5e77b6=_0xae5f[_0x5a5abc];return _0x5e77b6;};'use strict';var _=require(_0xfae5('0x0'));var util=require(_0xfae5('0x1'));var logger=require('../../config/logger')(_0xfae5('0x2'));var moment=require(_0xfae5('0x3'));var BPromise=require(_0xfae5('0x4'));var rp=require(_0xfae5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xfae5('0x6'));var attributes=require('./userProfileResource.attributes');module[_0xfae5('0x7')]=function(_0x575231,_0x1d4114){return _0x575231[_0xfae5('0x8')]('UserProfileResource',attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0xfae5('0x9'),'fields':[_0xfae5('0xa'),_0xfae5('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa4eb=['api','moment','bluebird','rimraf','./userProfileResource.attributes','exports','define','UserProfileResource','user_profile_has_resources','sectionId','lodash','util','../../config/logger'];(function(_0x319c6d,_0x2439ef){var _0x538036=function(_0xc4a391){while(--_0xc4a391){_0x319c6d['push'](_0x319c6d['shift']());}};_0x538036(++_0x2439ef);}(_0xa4eb,0x19d));var _0xba4e=function(_0x5d39c4,_0x237dd7){_0x5d39c4=_0x5d39c4-0x0;var _0x495a7c=_0xa4eb[_0x5d39c4];return _0x495a7c;};'use strict';var _=require(_0xba4e('0x0'));var util=require(_0xba4e('0x1'));var logger=require(_0xba4e('0x2'))(_0xba4e('0x3'));var moment=require(_0xba4e('0x4'));var BPromise=require(_0xba4e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xba4e('0x6'));var config=require('../../config/environment');var attributes=require(_0xba4e('0x7'));module[_0xba4e('0x8')]=function(_0xf3a421,_0x326d81){return _0xf3a421[_0xba4e('0x9')](_0xba4e('0xa'),attributes,{'tableName':_0xba4e('0xb'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':['resourceId',_0xba4e('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 80163f8..b92faa5 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 _0x33aa=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','bluebird','ioredis'];(function(_0xdd7ad9,_0x19562a){var _0x66e8d0=function(_0x3fa391){while(--_0x3fa391){_0xdd7ad9['push'](_0xdd7ad9['shift']());}};_0x66e8d0(++_0x19562a);}(_0x33aa,0x147));var _0xa33a=function(_0x5906da,_0x1feebb){_0x5906da=_0x5906da-0x0;var _0x4af80c=_0x33aa[_0x5906da];return _0x4af80c;};'use strict';var _=require(_0xa33a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa33a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa33a('0x2'));var db=require(_0xa33a('0x3'))['db'];var utils=require(_0xa33a('0x4'));var logger=require('../../config/logger')(_0xa33a('0x5'));var config=require(_0xa33a('0x6'));var jayson=require(_0xa33a('0x7'));var client=jayson[_0xa33a('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x49daa0,_0x3c2083,_0x3f2c2c){return new BPromise(function(_0x56417b,_0x343bb6){return client[_0xa33a('0x9')](_0x49daa0,_0x3f2c2c)[_0xa33a('0xa')](function(_0x299246){logger[_0xa33a('0xb')](_0xa33a('0xc'),_0x3c2083,_0xa33a('0xd'));logger[_0xa33a('0xe')](_0xa33a('0xf'),_0x3c2083,'request\x20sent',JSON[_0xa33a('0x10')](_0x299246));if(_0x299246['error']){if(_0x299246['error'][_0xa33a('0x11')]===0x1f4){logger[_0xa33a('0x12')](_0xa33a('0xc'),_0x3c2083,_0x299246[_0xa33a('0x12')]['message']);return _0x343bb6(_0x299246[_0xa33a('0x12')][_0xa33a('0x13')]);}logger[_0xa33a('0x12')](_0xa33a('0xc'),_0x3c2083,_0x299246[_0xa33a('0x12')][_0xa33a('0x13')]);return _0x56417b(_0x299246[_0xa33a('0x12')][_0xa33a('0x13')]);}else{logger[_0xa33a('0xb')](_0xa33a('0xc'),_0x3c2083,_0xa33a('0xd'));_0x56417b(_0x299246[_0xa33a('0x14')][_0xa33a('0x13')]);}})[_0xa33a('0x15')](function(_0x5559f3){logger[_0xa33a('0x12')](_0xa33a('0xc'),_0x3c2083,_0x5559f3);_0x343bb6(_0x5559f3);});});} \ No newline at end of file +var _0x7ade=['info','UserProfileResource,\x20%s,\x20%s','request\x20sent','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','http','then'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0x7ade,0x1e9));var _0xe7ad=function(_0x41e8c4,_0x30d9ff){_0x41e8c4=_0x41e8c4-0x0;var _0x54ffbe=_0x7ade[_0x41e8c4];return _0x54ffbe;};'use strict';var _=require(_0xe7ad('0x0'));var util=require(_0xe7ad('0x1'));var moment=require(_0xe7ad('0x2'));var BPromise=require(_0xe7ad('0x3'));var rs=require(_0xe7ad('0x4'));var fs=require('fs');var Redis=require(_0xe7ad('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe7ad('0x6'))(_0xe7ad('0x7'));var config=require(_0xe7ad('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe7ad('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3ed703,_0x14d85c,_0x24f50a){return new BPromise(function(_0x1e8b96,_0x5632c4){return client['request'](_0x3ed703,_0x24f50a)[_0xe7ad('0xa')](function(_0x2d4362){logger[_0xe7ad('0xb')](_0xe7ad('0xc'),_0x14d85c,_0xe7ad('0xd'));logger['debug'](_0xe7ad('0xe'),_0x14d85c,_0xe7ad('0xd'),JSON[_0xe7ad('0xf')](_0x2d4362));if(_0x2d4362[_0xe7ad('0x10')]){if(_0x2d4362['error'][_0xe7ad('0x11')]===0x1f4){logger[_0xe7ad('0x10')]('UserProfileResource,\x20%s,\x20%s',_0x14d85c,_0x2d4362[_0xe7ad('0x10')][_0xe7ad('0x12')]);return _0x5632c4(_0x2d4362['error'][_0xe7ad('0x12')]);}logger[_0xe7ad('0x10')](_0xe7ad('0xc'),_0x14d85c,_0x2d4362['error'][_0xe7ad('0x12')]);return _0x1e8b96(_0x2d4362[_0xe7ad('0x10')]['message']);}else{logger['info']('UserProfileResource,\x20%s,\x20%s',_0x14d85c,_0xe7ad('0xd'));_0x1e8b96(_0x2d4362[_0xe7ad('0x13')]['message']);}})['catch'](function(_0x53cfb9){logger[_0xe7ad('0x10')](_0xe7ad('0xc'),_0x14d85c,_0x53cfb9);_0x5632c4(_0x53cfb9);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 7c19c39..91f7fe3 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 _0x1120=['multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated','/describe','describe','/:id','show','create','put','update','exports'];(function(_0x48fb55,_0xf6d384){var _0x2df42d=function(_0x3849dc){while(--_0x3849dc){_0x48fb55['push'](_0x48fb55['shift']());}};_0x2df42d(++_0xf6d384);}(_0x1120,0x90));var _0x0112=function(_0x359bbe,_0x5b7fcc){_0x359bbe=_0x359bbe-0x0;var _0x1b3353=_0x1120[_0x359bbe];return _0x1b3353;};'use strict';var multer=require(_0x0112('0x0'));var util=require('util');var path=require(_0x0112('0x1'));var timeout=require(_0x0112('0x2'));var express=require(_0x0112('0x3'));var router=express[_0x0112('0x4')]();var auth=require(_0x0112('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0112('0x6'));var controller=require(_0x0112('0x7'));router[_0x0112('0x8')]('/',auth[_0x0112('0x9')](),controller['index']);router[_0x0112('0x8')](_0x0112('0xa'),auth['isAuthenticated'](),controller[_0x0112('0xb')]);router['get'](_0x0112('0xc'),auth[_0x0112('0x9')](),controller[_0x0112('0xd')]);router['post']('/',auth[_0x0112('0x9')](),controller[_0x0112('0xe')]);router[_0x0112('0xf')](_0x0112('0xc'),auth['isAuthenticated'](),controller[_0x0112('0x10')]);router['delete'](_0x0112('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x0112('0x11')]=router; \ No newline at end of file +var _0x033f=['create','update','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','./userProfileSection.controller','isAuthenticated','get','/describe','describe','/:id','show','post'];(function(_0x39dc14,_0x175dae){var _0x4d7da1=function(_0x8b48fa){while(--_0x8b48fa){_0x39dc14['push'](_0x39dc14['shift']());}};_0x4d7da1(++_0x175dae);}(_0x033f,0x135));var _0xf033=function(_0x38c3c4,_0x22fa29){_0x38c3c4=_0x38c3c4-0x0;var _0x2cf445=_0x033f[_0x38c3c4];return _0x2cf445;};'use strict';var multer=require(_0xf033('0x0'));var util=require(_0xf033('0x1'));var path=require(_0xf033('0x2'));var timeout=require(_0xf033('0x3'));var express=require(_0xf033('0x4'));var router=express[_0xf033('0x5')]();var auth=require(_0xf033('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf033('0x7'));router['get']('/',auth[_0xf033('0x8')](),controller['index']);router[_0xf033('0x9')](_0xf033('0xa'),auth[_0xf033('0x8')](),controller[_0xf033('0xb')]);router[_0xf033('0x9')](_0xf033('0xc'),auth[_0xf033('0x8')](),controller[_0xf033('0xd')]);router[_0xf033('0xe')]('/',auth['isAuthenticated'](),controller[_0xf033('0xf')]);router['put'](_0xf033('0xc'),auth[_0xf033('0x8')](),controller[_0xf033('0x10')]);router['delete'](_0xf033('0xc'),auth['isAuthenticated'](),controller[_0xf033('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index dd342fa..1e232e0 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 _0x9dbe=['join','getDataValue','sequelize','exports','STRING','INTEGER','BOOLEAN','setDataValue','crudPermissions'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0x9dbe,0x1c4));var _0xe9db=function(_0x21331a,_0x57fc48){_0x21331a=_0x21331a-0x0;var _0x325c55=_0x9dbe[_0x21331a];return _0x325c55;};'use strict';var Sequelize=require(_0xe9db('0x0'));module[_0xe9db('0x1')]={'name':{'type':Sequelize[_0xe9db('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0xe9db('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0xe9db('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0xe9db('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xe9db('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xe9db('0x2')],'set':function(_0x4acec4){this[_0xe9db('0x5')](_0xe9db('0x6'),_0x4acec4?_0x4acec4[_0xe9db('0x7')](''):[]);},'get':function(){return this['getDataValue'](_0xe9db('0x6'))?this[_0xe9db('0x8')]('crudPermissions')['split'](''):[];}}}; \ No newline at end of file +var _0x5dea=['setDataValue','crudPermissions','join','split','sequelize','exports','STRING','BOOLEAN'];(function(_0x4a4674,_0x176bb0){var _0x5047b6=function(_0x4cfbce){while(--_0x4cfbce){_0x4a4674['push'](_0x4a4674['shift']());}};_0x5047b6(++_0x176bb0);}(_0x5dea,0x1bc));var _0xa5de=function(_0x8863c,_0x2a3fd7){_0x8863c=_0x8863c-0x0;var _0x387c37=_0x5dea[_0x8863c];return _0x387c37;};'use strict';var Sequelize=require(_0xa5de('0x0'));module[_0xa5de('0x1')]={'name':{'type':Sequelize[_0xa5de('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0xa5de('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xa5de('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x367ff9){this[_0xa5de('0x4')](_0xa5de('0x5'),_0x367ff9?_0x367ff9[_0xa5de('0x6')](''):[]);},'get':function(){return this['getDataValue'](_0xa5de('0x5'))?this['getDataValue'](_0xa5de('0x5'))[_0xa5de('0x7')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index fbbc792..87d1751 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 _0xaeb3=['create','body','catch','update','params','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','jsforce','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','destroy','then','stack','name','send','index','fieldName','model','map','keys','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','UserProfileSection','includeAll','findAll','rows','show','rawAttributes','include','find'];(function(_0x5b2241,_0x58dff9){var _0x3f834c=function(_0x1d70a6){while(--_0x1d70a6){_0x5b2241['push'](_0x5b2241['shift']());}};_0x3f834c(++_0x58dff9);}(_0xaeb3,0x16e));var _0x3aeb=function(_0x3c5e71,_0xfc0c07){_0x3c5e71=_0x3c5e71-0x0;var _0x71b974=_0xaeb3[_0x3c5e71];return _0x71b974;};'use strict';var pdf=require(_0x3aeb('0x0'));var emlformat=require(_0x3aeb('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x3aeb('0x2'));var jsonpatch=require(_0x3aeb('0x3'));var rp=require(_0x3aeb('0x4'));var moment=require(_0x3aeb('0x5'));var BPromise=require(_0x3aeb('0x6'));var Mustache=require(_0x3aeb('0x7'));var util=require(_0x3aeb('0x8'));var path=require('path');var sox=require(_0x3aeb('0x9'));var csv=require(_0x3aeb('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x3aeb('0xb'));var squel=require(_0x3aeb('0xc'));var crypto=require('crypto');var jsforce=require(_0x3aeb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x3aeb('0xa'));var querystring=require(_0x3aeb('0xe'));var Papa=require('papaparse');var Redis=require(_0x3aeb('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3aeb('0x10'));var hardwareService=require(_0x3aeb('0x11'));var logger=require(_0x3aeb('0x12'))(_0x3aeb('0x13'));var utils=require(_0x3aeb('0x14'));var config=require(_0x3aeb('0x15'));var db=require(_0x3aeb('0x16'))['db'];function respondWithStatusCode(_0x4ac2e4,_0x39ec35){_0x39ec35=_0x39ec35||0xcc;return function(_0x56b38b){if(_0x56b38b){return _0x4ac2e4[_0x3aeb('0x17')](_0x39ec35);}return _0x4ac2e4[_0x3aeb('0x18')](_0x39ec35)[_0x3aeb('0x19')]();};}function respondWithResult(_0x564acc,_0x124962){_0x124962=_0x124962||0xc8;return function(_0xa67485){if(_0xa67485){return _0x564acc[_0x3aeb('0x18')](_0x124962)[_0x3aeb('0x1a')](_0xa67485);}};}function respondWithFilteredResult(_0x3751e8,_0x5b2c3e){return function(_0x5f3118){if(_0x5f3118){var _0xef7d80=_0x5f3118[_0x3aeb('0x1b')],_0x7329c6=_0x5b2c3e[_0x3aeb('0x1c')],_0x4740ef=_0x5b2c3e['offset']+_0x5b2c3e[_0x3aeb('0x1d')],_0x9abbc8;if(_0x4740ef>=_0xef7d80){_0x4740ef=_0xef7d80;_0x9abbc8=0xc8;}else{_0x9abbc8=0xce;}_0x3751e8[_0x3aeb('0x18')](_0x9abbc8);return _0x3751e8[_0x3aeb('0x1e')](_0x3aeb('0x1f'),_0x7329c6+'-'+_0x4740ef+'/'+_0xef7d80)[_0x3aeb('0x1a')](_0x5f3118);}return null;};}function patchUpdates(_0x23278d){return function(_0x53c94f){try{jsonpatch['apply'](_0x53c94f,_0x23278d,!![]);}catch(_0x547396){return BPromise[_0x3aeb('0x20')](_0x547396);}return _0x53c94f[_0x3aeb('0x21')]();};}function saveUpdates(_0x17f466,_0xa98f7b){return function(_0x43a0c9){if(_0x43a0c9){return _0x43a0c9['update'](_0x17f466)['then'](function(_0x22cb8d){return _0x22cb8d;});}return null;};}function removeEntity(_0x4ad6c6,_0x3746b4){return function(_0x4c3006){if(_0x4c3006){return _0x4c3006[_0x3aeb('0x22')]()[_0x3aeb('0x23')](function(){_0x4ad6c6[_0x3aeb('0x18')](0xcc)[_0x3aeb('0x19')]();});}};}function handleEntityNotFound(_0x5ee0dc,_0x4b8d01){return function(_0x5824dd){if(!_0x5824dd){_0x5ee0dc[_0x3aeb('0x17')](0x194);}return _0x5824dd;};}function handleError(_0x1b1b45,_0x560521){_0x560521=_0x560521||0x1f4;return function(_0x2656af){logger['error'](_0x2656af[_0x3aeb('0x24')]);if(_0x2656af[_0x3aeb('0x25')]){delete _0x2656af[_0x3aeb('0x25')];}_0x1b1b45['status'](_0x560521)[_0x3aeb('0x26')](_0x2656af);};}exports[_0x3aeb('0x27')]=function(_0xc91b8,_0x4f0ecc){var _0x8bb8f6={},_0x233a01={},_0x408e45={'count':0x0,'rows':[]};var _0x3793af=_['map'](db['UserProfileSection']['rawAttributes'],function(_0x269d86){return{'name':_0x269d86[_0x3aeb('0x28')],'type':_0x269d86['type']['key']};});_0x233a01[_0x3aeb('0x29')]=_[_0x3aeb('0x2a')](_0x3793af,'name');_0x233a01['query']=_[_0x3aeb('0x2b')](_0xc91b8[_0x3aeb('0x2c')]);_0x233a01[_0x3aeb('0x2d')]=_[_0x3aeb('0x2e')](_0x233a01[_0x3aeb('0x29')],_0x233a01[_0x3aeb('0x2c')]);_0x8bb8f6[_0x3aeb('0x2f')]=_[_0x3aeb('0x2e')](_0x233a01[_0x3aeb('0x29')],qs[_0x3aeb('0x30')](_0xc91b8[_0x3aeb('0x2c')]['fields']));_0x8bb8f6['attributes']=_0x8bb8f6['attributes']['length']?_0x8bb8f6[_0x3aeb('0x2f')]:_0x233a01[_0x3aeb('0x29')];if(!_0xc91b8[_0x3aeb('0x2c')]['hasOwnProperty'](_0x3aeb('0x31'))){_0x8bb8f6[_0x3aeb('0x1d')]=qs[_0x3aeb('0x1d')](_0xc91b8[_0x3aeb('0x2c')][_0x3aeb('0x1d')]);_0x8bb8f6[_0x3aeb('0x1c')]=qs[_0x3aeb('0x1c')](_0xc91b8[_0x3aeb('0x2c')][_0x3aeb('0x1c')]);}_0x8bb8f6[_0x3aeb('0x32')]=qs[_0x3aeb('0x33')](_0xc91b8[_0x3aeb('0x2c')][_0x3aeb('0x33')]);_0x8bb8f6[_0x3aeb('0x34')]=qs[_0x3aeb('0x2d')](_[_0x3aeb('0x35')](_0xc91b8[_0x3aeb('0x2c')],_0x233a01[_0x3aeb('0x2d')]));if(_0xc91b8[_0x3aeb('0x2c')][_0x3aeb('0x36')]){_0x8bb8f6['where']=_['merge'](_0x8bb8f6[_0x3aeb('0x34')],{'$or':_[_0x3aeb('0x2a')](_0x3793af,function(_0x3c3479){if(_0x3c3479[_0x3aeb('0x37')]!==_0x3aeb('0x38')){var _0x2da015={};_0x2da015[_0x3c3479['name']]={'$like':'%'+_0xc91b8[_0x3aeb('0x2c')][_0x3aeb('0x36')]+'%'};return _0x2da015;}})});}_0x8bb8f6=_[_0x3aeb('0x39')]({},_0x8bb8f6,_0xc91b8['options']);var _0x10ecf9={'where':_0x8bb8f6[_0x3aeb('0x34')]};return db[_0x3aeb('0x3a')][_0x3aeb('0x1b')](_0x10ecf9)['then'](function(_0x391746){_0x408e45[_0x3aeb('0x1b')]=_0x391746;if(_0xc91b8[_0x3aeb('0x2c')][_0x3aeb('0x3b')]){_0x8bb8f6['include']=[{'all':!![]}];}return db['UserProfileSection'][_0x3aeb('0x3c')](_0x8bb8f6);})[_0x3aeb('0x23')](function(_0xc14eae){_0x408e45[_0x3aeb('0x3d')]=_0xc14eae;return _0x408e45;})[_0x3aeb('0x23')](respondWithFilteredResult(_0x4f0ecc,_0x8bb8f6))['catch'](handleError(_0x4f0ecc,null));};exports[_0x3aeb('0x3e')]=function(_0x1b4831,_0x18953f){var _0x11617d={'raw':![],'where':{'id':_0x1b4831['params']['id']}},_0x2d68d5={};_0x2d68d5[_0x3aeb('0x29')]=_[_0x3aeb('0x2b')](db[_0x3aeb('0x3a')][_0x3aeb('0x3f')]);_0x2d68d5[_0x3aeb('0x2c')]=_[_0x3aeb('0x2b')](_0x1b4831[_0x3aeb('0x2c')]);_0x2d68d5['filters']=_[_0x3aeb('0x2e')](_0x2d68d5[_0x3aeb('0x29')],_0x2d68d5['query']);_0x11617d['attributes']=_[_0x3aeb('0x2e')](_0x2d68d5[_0x3aeb('0x29')],qs['fields'](_0x1b4831[_0x3aeb('0x2c')][_0x3aeb('0x30')]));_0x11617d[_0x3aeb('0x2f')]=_0x11617d['attributes']['length']?_0x11617d[_0x3aeb('0x2f')]:_0x2d68d5['model'];if(_0x1b4831[_0x3aeb('0x2c')][_0x3aeb('0x3b')]){_0x11617d[_0x3aeb('0x40')]=[{'all':!![]}];}_0x11617d=_['merge']({},_0x11617d,_0x1b4831['options']);return db[_0x3aeb('0x3a')][_0x3aeb('0x41')](_0x11617d)[_0x3aeb('0x23')](handleEntityNotFound(_0x18953f,null))[_0x3aeb('0x23')](respondWithResult(_0x18953f,null))['catch'](handleError(_0x18953f,null));};exports[_0x3aeb('0x42')]=function(_0x4644ff,_0x3147e4){return db[_0x3aeb('0x3a')][_0x3aeb('0x42')](_0x4644ff[_0x3aeb('0x43')],{})[_0x3aeb('0x23')](respondWithResult(_0x3147e4,0xc9))[_0x3aeb('0x44')](handleError(_0x3147e4,null));};exports[_0x3aeb('0x45')]=function(_0x269561,_0x29f870){if(_0x269561['body']['id']){delete _0x269561['body']['id'];}return db[_0x3aeb('0x3a')]['find']({'where':{'id':_0x269561[_0x3aeb('0x46')]['id']}})[_0x3aeb('0x23')](handleEntityNotFound(_0x29f870,null))[_0x3aeb('0x23')](saveUpdates(_0x269561['body'],null))[_0x3aeb('0x23')](respondWithResult(_0x29f870,null))['catch'](handleError(_0x29f870,null));};exports[_0x3aeb('0x22')]=function(_0x188828,_0x498199){return db[_0x3aeb('0x3a')][_0x3aeb('0x41')]({'where':{'id':_0x188828[_0x3aeb('0x46')]['id']}})[_0x3aeb('0x23')](handleEntityNotFound(_0x498199,null))[_0x3aeb('0x23')](removeEntity(_0x498199,null))['catch'](handleError(_0x498199,null));};exports[_0x3aeb('0x47')]=function(_0x252f78,_0x4a711f){return db[_0x3aeb('0x3a')][_0x3aeb('0x47')]()[_0x3aeb('0x23')](respondWithResult(_0x4a711f,null))[_0x3aeb('0x44')](handleError(_0x4a711f,null));}; \ No newline at end of file +var _0x6f66=['pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','include','find','create','body','params','destroy','describe','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','count','offset','limit','status','Content-Range','json','apply','reject','update','then','error','stack','name','index','map','UserProfileSection','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where'];(function(_0x531953,_0x3d583c){var _0x90cf6b=function(_0x12d199){while(--_0x12d199){_0x531953['push'](_0x531953['shift']());}};_0x90cf6b(++_0x3d583c);}(_0x6f66,0x135));var _0x66f6=function(_0x48f7cf,_0x4baa04){_0x48f7cf=_0x48f7cf-0x0;var _0xc201c0=_0x6f66[_0x48f7cf];return _0xc201c0;};'use strict';var pdf=require(_0x66f6('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x66f6('0x1'));var jsonpatch=require(_0x66f6('0x2'));var rp=require(_0x66f6('0x3'));var moment=require(_0x66f6('0x4'));var BPromise=require(_0x66f6('0x5'));var Mustache=require(_0x66f6('0x6'));var util=require('util');var path=require(_0x66f6('0x7'));var sox=require(_0x66f6('0x8'));var csv=require(_0x66f6('0x9'));var ejs=require(_0x66f6('0xa'));var fs=require('fs');var _=require(_0x66f6('0xb'));var squel=require('squel');var crypto=require(_0x66f6('0xc'));var jsforce=require(_0x66f6('0xd'));var deskjs=require(_0x66f6('0xe'));var toCsv=require(_0x66f6('0x9'));var querystring=require(_0x66f6('0xf'));var Papa=require('papaparse');var Redis=require(_0x66f6('0x10'));var authService=require(_0x66f6('0x11'));var qs=require(_0x66f6('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x66f6('0x13'))(_0x66f6('0x14'));var utils=require(_0x66f6('0x15'));var config=require(_0x66f6('0x16'));var db=require(_0x66f6('0x17'))['db'];function respondWithStatusCode(_0xaaa959,_0x17df9c){_0x17df9c=_0x17df9c||0xcc;return function(_0x39c800){if(_0x39c800){return _0xaaa959[_0x66f6('0x18')](_0x17df9c);}return _0xaaa959['status'](_0x17df9c)[_0x66f6('0x19')]();};}function respondWithResult(_0xc52262,_0x19d6a9){_0x19d6a9=_0x19d6a9||0xc8;return function(_0x363a6c){if(_0x363a6c){return _0xc52262['status'](_0x19d6a9)['json'](_0x363a6c);}};}function respondWithFilteredResult(_0x191188,_0x25d9d5){return function(_0x288b4e){if(_0x288b4e){var _0x201c61=_0x288b4e[_0x66f6('0x1a')],_0x11e6fa=_0x25d9d5[_0x66f6('0x1b')],_0x18542d=_0x25d9d5[_0x66f6('0x1b')]+_0x25d9d5[_0x66f6('0x1c')],_0x3b942f;if(_0x18542d>=_0x201c61){_0x18542d=_0x201c61;_0x3b942f=0xc8;}else{_0x3b942f=0xce;}_0x191188[_0x66f6('0x1d')](_0x3b942f);return _0x191188['set'](_0x66f6('0x1e'),_0x11e6fa+'-'+_0x18542d+'/'+_0x201c61)[_0x66f6('0x1f')](_0x288b4e);}return null;};}function patchUpdates(_0x5c12dd){return function(_0x443491){try{jsonpatch[_0x66f6('0x20')](_0x443491,_0x5c12dd,!![]);}catch(_0xf46a5b){return BPromise[_0x66f6('0x21')](_0xf46a5b);}return _0x443491['save']();};}function saveUpdates(_0x6720ad,_0x28e838){return function(_0x2f8a28){if(_0x2f8a28){return _0x2f8a28[_0x66f6('0x22')](_0x6720ad)[_0x66f6('0x23')](function(_0x547cc7){return _0x547cc7;});}return null;};}function removeEntity(_0x485543,_0x455fe4){return function(_0x500396){if(_0x500396){return _0x500396['destroy']()['then'](function(){_0x485543[_0x66f6('0x1d')](0xcc)[_0x66f6('0x19')]();});}};}function handleEntityNotFound(_0x424162,_0x4a62f1){return function(_0x436bd4){if(!_0x436bd4){_0x424162[_0x66f6('0x18')](0x194);}return _0x436bd4;};}function handleError(_0x342534,_0x2ae1d1){_0x2ae1d1=_0x2ae1d1||0x1f4;return function(_0x43e561){logger[_0x66f6('0x24')](_0x43e561[_0x66f6('0x25')]);if(_0x43e561[_0x66f6('0x26')]){delete _0x43e561[_0x66f6('0x26')];}_0x342534[_0x66f6('0x1d')](_0x2ae1d1)['send'](_0x43e561);};}exports[_0x66f6('0x27')]=function(_0x2a74b0,_0x264670){var _0x4eac4b={},_0x1f95ed={},_0x4d9748={'count':0x0,'rows':[]};var _0x37c68d=_[_0x66f6('0x28')](db[_0x66f6('0x29')][_0x66f6('0x2a')],function(_0x49557a){return{'name':_0x49557a[_0x66f6('0x2b')],'type':_0x49557a[_0x66f6('0x2c')][_0x66f6('0x2d')]};});_0x1f95ed[_0x66f6('0x2e')]=_['map'](_0x37c68d,_0x66f6('0x26'));_0x1f95ed['query']=_['keys'](_0x2a74b0[_0x66f6('0x2f')]);_0x1f95ed[_0x66f6('0x30')]=_[_0x66f6('0x31')](_0x1f95ed['model'],_0x1f95ed['query']);_0x4eac4b['attributes']=_[_0x66f6('0x31')](_0x1f95ed[_0x66f6('0x2e')],qs[_0x66f6('0x32')](_0x2a74b0[_0x66f6('0x2f')][_0x66f6('0x32')]));_0x4eac4b['attributes']=_0x4eac4b[_0x66f6('0x33')][_0x66f6('0x34')]?_0x4eac4b[_0x66f6('0x33')]:_0x1f95ed['model'];if(!_0x2a74b0[_0x66f6('0x2f')][_0x66f6('0x35')]('nolimit')){_0x4eac4b[_0x66f6('0x1c')]=qs['limit'](_0x2a74b0[_0x66f6('0x2f')][_0x66f6('0x1c')]);_0x4eac4b[_0x66f6('0x1b')]=qs[_0x66f6('0x1b')](_0x2a74b0[_0x66f6('0x2f')][_0x66f6('0x1b')]);}_0x4eac4b['order']=qs[_0x66f6('0x36')](_0x2a74b0[_0x66f6('0x2f')][_0x66f6('0x36')]);_0x4eac4b[_0x66f6('0x37')]=qs[_0x66f6('0x30')](_[_0x66f6('0x38')](_0x2a74b0[_0x66f6('0x2f')],_0x1f95ed['filters']));if(_0x2a74b0[_0x66f6('0x2f')][_0x66f6('0x39')]){_0x4eac4b[_0x66f6('0x37')]=_[_0x66f6('0x3a')](_0x4eac4b['where'],{'$or':_[_0x66f6('0x28')](_0x37c68d,function(_0x24ea55){if(_0x24ea55['type']!==_0x66f6('0x3b')){var _0x31d309={};_0x31d309[_0x24ea55[_0x66f6('0x26')]]={'$like':'%'+_0x2a74b0[_0x66f6('0x2f')][_0x66f6('0x39')]+'%'};return _0x31d309;}})});}_0x4eac4b=_['merge']({},_0x4eac4b,_0x2a74b0[_0x66f6('0x3c')]);var _0x39b0e5={'where':_0x4eac4b['where']};return db[_0x66f6('0x29')][_0x66f6('0x1a')](_0x39b0e5)['then'](function(_0x15bd92){_0x4d9748['count']=_0x15bd92;if(_0x2a74b0[_0x66f6('0x2f')][_0x66f6('0x3d')]){_0x4eac4b['include']=[{'all':!![]}];}return db[_0x66f6('0x29')][_0x66f6('0x3e')](_0x4eac4b);})[_0x66f6('0x23')](function(_0x2b627c){_0x4d9748[_0x66f6('0x3f')]=_0x2b627c;return _0x4d9748;})[_0x66f6('0x23')](respondWithFilteredResult(_0x264670,_0x4eac4b))[_0x66f6('0x40')](handleError(_0x264670,null));};exports[_0x66f6('0x41')]=function(_0xc2de87,_0x159b73){var _0x2bd8f3={'raw':![],'where':{'id':_0xc2de87['params']['id']}},_0x2ccc23={};_0x2ccc23[_0x66f6('0x2e')]=_['keys'](db[_0x66f6('0x29')][_0x66f6('0x2a')]);_0x2ccc23['query']=_['keys'](_0xc2de87[_0x66f6('0x2f')]);_0x2ccc23[_0x66f6('0x30')]=_['intersection'](_0x2ccc23['model'],_0x2ccc23[_0x66f6('0x2f')]);_0x2bd8f3[_0x66f6('0x33')]=_[_0x66f6('0x31')](_0x2ccc23[_0x66f6('0x2e')],qs[_0x66f6('0x32')](_0xc2de87[_0x66f6('0x2f')][_0x66f6('0x32')]));_0x2bd8f3[_0x66f6('0x33')]=_0x2bd8f3['attributes'][_0x66f6('0x34')]?_0x2bd8f3['attributes']:_0x2ccc23[_0x66f6('0x2e')];if(_0xc2de87['query'][_0x66f6('0x3d')]){_0x2bd8f3[_0x66f6('0x42')]=[{'all':!![]}];}_0x2bd8f3=_[_0x66f6('0x3a')]({},_0x2bd8f3,_0xc2de87[_0x66f6('0x3c')]);return db[_0x66f6('0x29')][_0x66f6('0x43')](_0x2bd8f3)[_0x66f6('0x23')](handleEntityNotFound(_0x159b73,null))[_0x66f6('0x23')](respondWithResult(_0x159b73,null))[_0x66f6('0x40')](handleError(_0x159b73,null));};exports[_0x66f6('0x44')]=function(_0x19fd74,_0x5d3c81){return db[_0x66f6('0x29')][_0x66f6('0x44')](_0x19fd74[_0x66f6('0x45')],{})['then'](respondWithResult(_0x5d3c81,0xc9))[_0x66f6('0x40')](handleError(_0x5d3c81,null));};exports[_0x66f6('0x22')]=function(_0x40a057,_0x63b90){if(_0x40a057[_0x66f6('0x45')]['id']){delete _0x40a057[_0x66f6('0x45')]['id'];}return db[_0x66f6('0x29')][_0x66f6('0x43')]({'where':{'id':_0x40a057[_0x66f6('0x46')]['id']}})[_0x66f6('0x23')](handleEntityNotFound(_0x63b90,null))['then'](saveUpdates(_0x40a057[_0x66f6('0x45')],null))['then'](respondWithResult(_0x63b90,null))['catch'](handleError(_0x63b90,null));};exports[_0x66f6('0x47')]=function(_0x2ba7b4,_0xd81443){return db[_0x66f6('0x29')][_0x66f6('0x43')]({'where':{'id':_0x2ba7b4[_0x66f6('0x46')]['id']}})[_0x66f6('0x23')](handleEntityNotFound(_0xd81443,null))[_0x66f6('0x23')](removeEntity(_0xd81443,null))[_0x66f6('0x40')](handleError(_0xd81443,null));};exports[_0x66f6('0x48')]=function(_0x5e7eeb,_0x216866){return db[_0x66f6('0x29')]['describe']()[_0x66f6('0x23')](respondWithResult(_0x216866,null))[_0x66f6('0x40')](handleError(_0x216866,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index b945bcf..cdd2567 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 _0x59c4=['userProfileId','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./userProfileSection.attributes','exports','define','UserProfileSection','user_profile_has_sections','sectionId'];(function(_0x2e303c,_0x15b8d3){var _0x46b892=function(_0xb196cb){while(--_0xb196cb){_0x2e303c['push'](_0x2e303c['shift']());}};_0x46b892(++_0x15b8d3);}(_0x59c4,0x79));var _0x459c=function(_0x18a976,_0x297652){_0x18a976=_0x18a976-0x0;var _0x2571f2=_0x59c4[_0x18a976];return _0x2571f2;};'use strict';var _=require(_0x459c('0x0'));var util=require('util');var logger=require(_0x459c('0x1'))(_0x459c('0x2'));var moment=require(_0x459c('0x3'));var BPromise=require(_0x459c('0x4'));var rp=require(_0x459c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x459c('0x6'));var config=require(_0x459c('0x7'));var attributes=require(_0x459c('0x8'));module[_0x459c('0x9')]=function(_0x313c02,_0x335f12){return _0x313c02[_0x459c('0xa')](_0x459c('0xb'),attributes,{'tableName':_0x459c('0xc'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x459c('0xd'),_0x459c('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0e89=['bluebird','request-promise','path','./userProfileSection.attributes','exports','define','UserProfileSection','compositeIndex','sectionId','lodash','../../config/logger','moment'];(function(_0x141fee,_0x2ab7db){var _0x1d115a=function(_0x3a44e7){while(--_0x3a44e7){_0x141fee['push'](_0x141fee['shift']());}};_0x1d115a(++_0x2ab7db);}(_0x0e89,0x69));var _0x90e8=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x0e89[_0x3ab9ee];return _0x82ee88;};'use strict';var _=require(_0x90e8('0x0'));var util=require('util');var logger=require(_0x90e8('0x1'))('api');var moment=require(_0x90e8('0x2'));var BPromise=require(_0x90e8('0x3'));var rp=require(_0x90e8('0x4'));var fs=require('fs');var path=require(_0x90e8('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x90e8('0x6'));module[_0x90e8('0x7')]=function(_0x5e609d,_0x55cb57){return _0x5e609d[_0x90e8('0x8')](_0x90e8('0x9'),attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':_0x90e8('0xa'),'fields':[_0x90e8('0xb'),'userProfileId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 923c3e6..b4967d8 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 _0x4e38=['request','then','info','request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UserProfileSection,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','../../config/utils','rpc','../../config/environment','jayson/promise','http'];(function(_0x50c2cd,_0x4256ed){var _0x24d02e=function(_0x4be970){while(--_0x4be970){_0x50c2cd['push'](_0x50c2cd['shift']());}};_0x24d02e(++_0x4256ed);}(_0x4e38,0x108));var _0x84e3=function(_0x5d53ed,_0x2d7182){_0x5d53ed=_0x5d53ed-0x0;var _0x21c36d=_0x4e38[_0x5d53ed];return _0x21c36d;};'use strict';var _=require(_0x84e3('0x0'));var util=require(_0x84e3('0x1'));var moment=require(_0x84e3('0x2'));var BPromise=require(_0x84e3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x84e3('0x4'));var logger=require('../../config/logger')(_0x84e3('0x5'));var config=require(_0x84e3('0x6'));var jayson=require(_0x84e3('0x7'));var client=jayson['client'][_0x84e3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x38a9a5,_0x185c49,_0x2bb496){return new BPromise(function(_0xab0ba6,_0x1b77e6){return client[_0x84e3('0x9')](_0x38a9a5,_0x2bb496)[_0x84e3('0xa')](function(_0x5d99fe){logger[_0x84e3('0xb')]('UserProfileSection,\x20%s,\x20%s',_0x185c49,_0x84e3('0xc'));logger['debug'](_0x84e3('0xd'),_0x185c49,_0x84e3('0xc'),JSON[_0x84e3('0xe')](_0x5d99fe));if(_0x5d99fe[_0x84e3('0xf')]){if(_0x5d99fe[_0x84e3('0xf')][_0x84e3('0x10')]===0x1f4){logger[_0x84e3('0xf')]('UserProfileSection,\x20%s,\x20%s',_0x185c49,_0x5d99fe[_0x84e3('0xf')][_0x84e3('0x11')]);return _0x1b77e6(_0x5d99fe[_0x84e3('0xf')][_0x84e3('0x11')]);}logger[_0x84e3('0xf')](_0x84e3('0x12'),_0x185c49,_0x5d99fe[_0x84e3('0xf')][_0x84e3('0x11')]);return _0xab0ba6(_0x5d99fe[_0x84e3('0xf')][_0x84e3('0x11')]);}else{logger['info']('UserProfileSection,\x20%s,\x20%s',_0x185c49,_0x84e3('0xc'));_0xab0ba6(_0x5d99fe[_0x84e3('0x13')][_0x84e3('0x11')]);}})[_0x84e3('0x14')](function(_0x5d3b5c){logger[_0x84e3('0xf')]('UserProfileSection,\x20%s,\x20%s',_0x185c49,_0x5d3b5c);_0x1b77e6(_0x5d3b5c);});});} \ No newline at end of file +var _0x1993=['error','code','message','result','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x1993,0x82));var _0x3199=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x1993[_0x5ddb1c];return _0x354adc;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3199('0x0'));var BPromise=require(_0x3199('0x1'));var rs=require(_0x3199('0x2'));var fs=require('fs');var Redis=require(_0x3199('0x3'));var db=require(_0x3199('0x4'))['db'];var utils=require(_0x3199('0x5'));var logger=require(_0x3199('0x6'))('rpc');var config=require(_0x3199('0x7'));var jayson=require(_0x3199('0x8'));var client=jayson[_0x3199('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x97a486,_0x111ccb,_0x1daef9){return new BPromise(function(_0x59445d,_0x12dc61){return client[_0x3199('0xa')](_0x97a486,_0x1daef9)[_0x3199('0xb')](function(_0x3e0370){logger[_0x3199('0xc')](_0x3199('0xd'),_0x111ccb,_0x3199('0xe'));logger[_0x3199('0xf')](_0x3199('0x10'),_0x111ccb,_0x3199('0xe'),JSON['stringify'](_0x3e0370));if(_0x3e0370[_0x3199('0x11')]){if(_0x3e0370[_0x3199('0x11')][_0x3199('0x12')]===0x1f4){logger[_0x3199('0x11')](_0x3199('0xd'),_0x111ccb,_0x3e0370[_0x3199('0x11')][_0x3199('0x13')]);return _0x12dc61(_0x3e0370['error'][_0x3199('0x13')]);}logger[_0x3199('0x11')](_0x3199('0xd'),_0x111ccb,_0x3e0370[_0x3199('0x11')][_0x3199('0x13')]);return _0x59445d(_0x3e0370['error'][_0x3199('0x13')]);}else{logger[_0x3199('0xc')]('UserProfileSection,\x20%s,\x20%s',_0x111ccb,'request\x20sent');_0x59445d(_0x3e0370[_0x3199('0x14')]['message']);}})['catch'](function(_0x135fe9){logger[_0x3199('0x11')](_0x3199('0xd'),_0x111ccb,_0x135fe9);_0x12dc61(_0x135fe9);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 05d1854..cd67d7e 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 _0x3c70=['exports','multer','util','path','connect-timeout','express','../../components/auth/service'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x3c70,0x7f));var _0x03c7=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x3c70[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x03c7('0x0'));var util=require(_0x03c7('0x1'));var path=require(_0x03c7('0x2'));var timeout=require(_0x03c7('0x3'));var express=require(_0x03c7('0x4'));var router=express['Router']();var auth=require(_0x03c7('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x03c7('0x6')]=router; \ No newline at end of file +var _0xd4f6=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','exports','multer','util'];(function(_0x1c882d,_0x572b12){var _0x510c1c=function(_0x55c572){while(--_0x55c572){_0x1c882d['push'](_0x1c882d['shift']());}};_0x510c1c(++_0x572b12);}(_0xd4f6,0xf3));var _0x6d4f=function(_0x2dfe07,_0x2b663f){_0x2dfe07=_0x2dfe07-0x0;var _0x30aee0=_0xd4f6[_0x2dfe07];return _0x30aee0;};'use strict';var multer=require(_0x6d4f('0x0'));var util=require(_0x6d4f('0x1'));var path=require('path');var timeout=require(_0x6d4f('0x2'));var express=require(_0x6d4f('0x3'));var router=express['Router']();var auth=require(_0x6d4f('0x4'));var interaction=require(_0x6d4f('0x5'));var config=require('../../config/environment');module[_0x6d4f('0x6')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 2eee2dc..4cc3c22 100644 --- a/server/api/userSmsQueue/userSmsQueue.attributes.js +++ b/server/api/userSmsQueue/userSmsQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['exports','sequelize'];(function(_0x3ab0ac,_0x1ea9cf){var _0x1f743d=function(_0x45fb92){while(--_0x45fb92){_0x3ab0ac['push'](_0x3ab0ac['shift']());}};_0x1f743d(++_0x1ea9cf);}(_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 _0xbaf0=['exports','INTEGER'];(function(_0x204047,_0x2df7af){var _0x5956d2=function(_0x2d32a8){while(--_0x2d32a8){_0x204047['push'](_0x204047['shift']());}};_0x5956d2(++_0x2df7af);}(_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/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index 0300c30..8e9e549 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 _0xfaf8=['lodash','util','api','moment','bluebird','request-promise','rimraf','./userSmsQueue.attributes','exports','UserSmsQueue','user_has_sms_queues'];(function(_0x285f68,_0x4cf1c8){var _0x79a01c=function(_0x25c50d){while(--_0x25c50d){_0x285f68['push'](_0x285f68['shift']());}};_0x79a01c(++_0x4cf1c8);}(_0xfaf8,0x18c));var _0x8faf=function(_0x42bbeb,_0x4618bd){_0x42bbeb=_0x42bbeb-0x0;var _0x5894e4=_0xfaf8[_0x42bbeb];return _0x5894e4;};'use strict';var _=require(_0x8faf('0x0'));var util=require(_0x8faf('0x1'));var logger=require('../../config/logger')(_0x8faf('0x2'));var moment=require(_0x8faf('0x3'));var BPromise=require(_0x8faf('0x4'));var rp=require(_0x8faf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8faf('0x6'));var config=require('../../config/environment');var attributes=require(_0x8faf('0x7'));module[_0x8faf('0x8')]=function(_0x2e244c,_0x2fbe15){return _0x2e244c['define'](_0x8faf('0x9'),attributes,{'tableName':_0x8faf('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xad63=['UserSmsQueue','user_has_sms_queues','lodash','../../config/logger','api','moment','request-promise','path','./userSmsQueue.attributes','exports','define'];(function(_0x9d074f,_0x88a810){var _0x453398=function(_0x5b5082){while(--_0x5b5082){_0x9d074f['push'](_0x9d074f['shift']());}};_0x453398(++_0x88a810);}(_0xad63,0xde));var _0x3ad6=function(_0x2abe15,_0x548f83){_0x2abe15=_0x2abe15-0x0;var _0x536b05=_0xad63[_0x2abe15];return _0x536b05;};'use strict';var _=require(_0x3ad6('0x0'));var util=require('util');var logger=require(_0x3ad6('0x1'))(_0x3ad6('0x2'));var moment=require(_0x3ad6('0x3'));var BPromise=require('bluebird');var rp=require(_0x3ad6('0x4'));var fs=require('fs');var path=require(_0x3ad6('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3ad6('0x6'));module[_0x3ad6('0x7')]=function(_0x3c257f,_0xfa1a9d){return _0x3c257f[_0x3ad6('0x8')](_0x3ad6('0x9'),attributes,{'tableName':_0x3ad6('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 db7920e..ec931ec 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 _0x4db0=['../../config/logger','rpc','jayson/promise','client','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','ioredis','../../mysqldb','../../config/utils'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x4db0,0x1c9));var _0x04db=function(_0x1e0846,_0x4aea1b){_0x1e0846=_0x1e0846-0x0;var _0x57e5d7=_0x4db0[_0x1e0846];return _0x57e5d7;};'use strict';var _=require('lodash');var util=require(_0x04db('0x0'));var moment=require(_0x04db('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x04db('0x2'));var db=require(_0x04db('0x3'))['db'];var utils=require(_0x04db('0x4'));var logger=require(_0x04db('0x5'))(_0x04db('0x6'));var config=require('../../config/environment');var jayson=require(_0x04db('0x7'));var client=jayson[_0x04db('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c1cc4,_0xf56c54,_0x42d812){return new BPromise(function(_0x5683ec,_0x4bd2d8){return client[_0x04db('0x9')](_0x3c1cc4,_0x42d812)[_0x04db('0xa')](function(_0x24c414){logger[_0x04db('0xb')](_0x04db('0xc'),_0xf56c54,_0x04db('0xd'));logger[_0x04db('0xe')](_0x04db('0xf'),_0xf56c54,_0x04db('0xd'),JSON[_0x04db('0x10')](_0x24c414));if(_0x24c414[_0x04db('0x11')]){if(_0x24c414[_0x04db('0x11')][_0x04db('0x12')]===0x1f4){logger[_0x04db('0x11')]('UserSmsQueue,\x20%s,\x20%s',_0xf56c54,_0x24c414[_0x04db('0x11')]['message']);return _0x4bd2d8(_0x24c414[_0x04db('0x11')][_0x04db('0x13')]);}logger[_0x04db('0x11')]('UserSmsQueue,\x20%s,\x20%s',_0xf56c54,_0x24c414[_0x04db('0x11')][_0x04db('0x13')]);return _0x5683ec(_0x24c414[_0x04db('0x11')][_0x04db('0x13')]);}else{logger['info'](_0x04db('0xc'),_0xf56c54,'request\x20sent');_0x5683ec(_0x24c414[_0x04db('0x14')][_0x04db('0x13')]);}})['catch'](function(_0x2820c4){logger['error'](_0x04db('0xc'),_0xf56c54,_0x2820c4);_0x4bd2d8(_0x2820c4);});});} \ No newline at end of file +var _0xa5f8=['info','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UserSmsQueue,\x20%s,\x20%s','result','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x4c586e,_0x2571ae){var _0x40d9a5=function(_0x340496){while(--_0x340496){_0x4c586e['push'](_0x4c586e['shift']());}};_0x40d9a5(++_0x2571ae);}(_0xa5f8,0xc2));var _0x8a5f=function(_0x4b1c28,_0x2655f5){_0x4b1c28=_0x4b1c28-0x0;var _0x5810f8=_0xa5f8[_0x4b1c28];return _0x5810f8;};'use strict';var _=require(_0x8a5f('0x0'));var util=require(_0x8a5f('0x1'));var moment=require('moment');var BPromise=require(_0x8a5f('0x2'));var rs=require(_0x8a5f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8a5f('0x4'));var logger=require(_0x8a5f('0x5'))(_0x8a5f('0x6'));var config=require(_0x8a5f('0x7'));var jayson=require(_0x8a5f('0x8'));var client=jayson[_0x8a5f('0x9')][_0x8a5f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4003b6,_0x2abaf3,_0x4cdda3){return new BPromise(function(_0x26b139,_0x4462a2){return client[_0x8a5f('0xb')](_0x4003b6,_0x4cdda3)[_0x8a5f('0xc')](function(_0xeead4d){logger[_0x8a5f('0xd')]('UserSmsQueue,\x20%s,\x20%s',_0x2abaf3,_0x8a5f('0xe'));logger[_0x8a5f('0xf')](_0x8a5f('0x10'),_0x2abaf3,_0x8a5f('0xe'),JSON[_0x8a5f('0x11')](_0xeead4d));if(_0xeead4d[_0x8a5f('0x12')]){if(_0xeead4d[_0x8a5f('0x12')][_0x8a5f('0x13')]===0x1f4){logger[_0x8a5f('0x12')]('UserSmsQueue,\x20%s,\x20%s',_0x2abaf3,_0xeead4d[_0x8a5f('0x12')]['message']);return _0x4462a2(_0xeead4d[_0x8a5f('0x12')][_0x8a5f('0x14')]);}logger[_0x8a5f('0x12')](_0x8a5f('0x15'),_0x2abaf3,_0xeead4d[_0x8a5f('0x12')][_0x8a5f('0x14')]);return _0x26b139(_0xeead4d[_0x8a5f('0x12')][_0x8a5f('0x14')]);}else{logger['info'](_0x8a5f('0x15'),_0x2abaf3,'request\x20sent');_0x26b139(_0xeead4d[_0x8a5f('0x16')][_0x8a5f('0x14')]);}})['catch'](function(_0x334cb9){logger[_0x8a5f('0x12')](_0x8a5f('0x15'),_0x2abaf3,_0x334cb9);_0x4462a2(_0x334cb9);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueue/index.js b/server/api/userVoiceQueue/index.js index 1bd1439..d8339d3 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 _0xdbaa=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','path','connect-timeout'];(function(_0x4a2a23,_0x3fdc2b){var _0x1747f7=function(_0x3c0a2d){while(--_0x3c0a2d){_0x4a2a23['push'](_0x4a2a23['shift']());}};_0x1747f7(++_0x3fdc2b);}(_0xdbaa,0x175));var _0xadba=function(_0xb24a3e,_0x4a3594){_0xb24a3e=_0xb24a3e-0x0;var _0x4038d7=_0xdbaa[_0xb24a3e];return _0x4038d7;};'use strict';var multer=require(_0xadba('0x0'));var util=require('util');var path=require(_0xadba('0x1'));var timeout=require(_0xadba('0x2'));var express=require(_0xadba('0x3'));var router=express['Router']();var auth=require(_0xadba('0x4'));var interaction=require(_0xadba('0x5'));var config=require(_0xadba('0x6'));module[_0xadba('0x7')]=router; \ No newline at end of file +var _0xfd32=['../../components/auth/service','../../config/environment','exports','util','path','connect-timeout','express','Router'];(function(_0x1d233c,_0x2312df){var _0x11eaec=function(_0x27eee3){while(--_0x27eee3){_0x1d233c['push'](_0x1d233c['shift']());}};_0x11eaec(++_0x2312df);}(_0xfd32,0x9b));var _0x2fd3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfd32[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x2fd3('0x0'));var path=require(_0x2fd3('0x1'));var timeout=require(_0x2fd3('0x2'));var express=require(_0x2fd3('0x3'));var router=express[_0x2fd3('0x4')]();var auth=require(_0x2fd3('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x2fd3('0x6'));module[_0x2fd3('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 0a035c1..75a5793 100644 --- a/server/api/userVoiceQueue/userVoiceQueue.attributes.js +++ b/server/api/userVoiceQueue/userVoiceQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['INTEGER','sequelize','exports'];(function(_0x1d4a9c,_0x296180){var _0x2ae3d2=function(_0x3ee04e){while(--_0x3ee04e){_0x1d4a9c['push'](_0x1d4a9c['shift']());}};_0x2ae3d2(++_0x296180);}(_0xe706,0xa3));var _0x6e70=function(_0x441981,_0x12a3eb){_0x441981=_0x441981-0x0;var _0x19ce77=_0xe706[_0x441981];return _0x19ce77;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'penalty':{'type':Sequelize[_0x6e70('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd8b0=['exports','sequelize'];(function(_0x467622,_0x4ad91){var _0x35ca1a=function(_0x1cdb34){while(--_0x1cdb34){_0x467622['push'](_0x467622['shift']());}};_0x35ca1a(++_0x4ad91);}(_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/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index fdf7c81..3023438 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 _0x6334=['rimraf','../../config/environment','./userVoiceQueue.attributes','exports','UserVoiceQueue','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x5c1f91,_0x492909){var _0x16b4b9=function(_0x3dfc84){while(--_0x3dfc84){_0x5c1f91['push'](_0x5c1f91['shift']());}};_0x16b4b9(++_0x492909);}(_0x6334,0x119));var _0x4633=function(_0x3efe9b,_0x5b41a8){_0x3efe9b=_0x3efe9b-0x0;var _0x132073=_0x6334[_0x3efe9b];return _0x132073;};'use strict';var _=require(_0x4633('0x0'));var util=require(_0x4633('0x1'));var logger=require(_0x4633('0x2'))(_0x4633('0x3'));var moment=require(_0x4633('0x4'));var BPromise=require(_0x4633('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4633('0x6'));var rimraf=require(_0x4633('0x7'));var config=require(_0x4633('0x8'));var attributes=require(_0x4633('0x9'));module[_0x4633('0xa')]=function(_0x6493dc,_0x175e14){return _0x6493dc['define'](_0x4633('0xb'),attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcb99=['../../config/logger','bluebird','request-promise','path','../../config/environment','./userVoiceQueue.attributes','define','UserVoiceQueue','user_has_voice_queues','lodash'];(function(_0x399a42,_0x4dc274){var _0x16a810=function(_0x126d5e){while(--_0x126d5e){_0x399a42['push'](_0x399a42['shift']());}};_0x16a810(++_0x4dc274);}(_0xcb99,0x8b));var _0x9cb9=function(_0x14bf8b,_0x186798){_0x14bf8b=_0x14bf8b-0x0;var _0x571eee=_0xcb99[_0x14bf8b];return _0x571eee;};'use strict';var _=require(_0x9cb9('0x0'));var util=require('util');var logger=require(_0x9cb9('0x1'))('api');var moment=require('moment');var BPromise=require(_0x9cb9('0x2'));var rp=require(_0x9cb9('0x3'));var fs=require('fs');var path=require(_0x9cb9('0x4'));var rimraf=require('rimraf');var config=require(_0x9cb9('0x5'));var attributes=require(_0x9cb9('0x6'));module['exports']=function(_0x214b72,_0x509cfc){return _0x214b72[_0x9cb9('0x7')](_0x9cb9('0x8'),attributes,{'tableName':_0x9cb9('0x9'),'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 b08e7a8..5132c4d 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 _0x5809=['request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','UserVoiceQueue,\x20%s,\x20%s','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x5809,0x166));var _0x9580=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x5809[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x9580('0x0'));var util=require(_0x9580('0x1'));var moment=require(_0x9580('0x2'));var BPromise=require(_0x9580('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9580('0x4'))['db'];var utils=require(_0x9580('0x5'));var logger=require(_0x9580('0x6'))(_0x9580('0x7'));var config=require(_0x9580('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9580('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x243ea6,_0x318ac4,_0x5acc81){return new BPromise(function(_0x4974f4,_0x19d7df){return client[_0x9580('0xa')](_0x243ea6,_0x5acc81)[_0x9580('0xb')](function(_0x461be9){logger[_0x9580('0xc')](_0x9580('0xd'),_0x318ac4,'request\x20sent');logger[_0x9580('0xe')](_0x9580('0xf'),_0x318ac4,_0x9580('0x10'),JSON[_0x9580('0x11')](_0x461be9));if(_0x461be9[_0x9580('0x12')]){if(_0x461be9['error']['code']===0x1f4){logger[_0x9580('0x12')]('UserVoiceQueue,\x20%s,\x20%s',_0x318ac4,_0x461be9[_0x9580('0x12')][_0x9580('0x13')]);return _0x19d7df(_0x461be9[_0x9580('0x12')][_0x9580('0x13')]);}logger[_0x9580('0x12')]('UserVoiceQueue,\x20%s,\x20%s',_0x318ac4,_0x461be9[_0x9580('0x12')]['message']);return _0x4974f4(_0x461be9['error'][_0x9580('0x13')]);}else{logger[_0x9580('0xc')](_0x9580('0xd'),_0x318ac4,_0x9580('0x10'));_0x4974f4(_0x461be9[_0x9580('0x14')]['message']);}})[_0x9580('0x15')](function(_0x233e34){logger[_0x9580('0x12')](_0x9580('0xd'),_0x318ac4,_0x233e34);_0x19d7df(_0x233e34);});});} \ No newline at end of file +var _0x4f89=['lodash','util','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserVoiceQueue,\x20%s,\x20%s','message','catch'];(function(_0x2adecf,_0x2a9865){var _0x4e1e83=function(_0x5ae089){while(--_0x5ae089){_0x2adecf['push'](_0x2adecf['shift']());}};_0x4e1e83(++_0x2a9865);}(_0x4f89,0x17c));var _0x94f8=function(_0x50afcc,_0x25fd08){_0x50afcc=_0x50afcc-0x0;var _0x3c6ca1=_0x4f89[_0x50afcc];return _0x3c6ca1;};'use strict';var _=require(_0x94f8('0x0'));var util=require(_0x94f8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x94f8('0x2'));var logger=require(_0x94f8('0x3'))(_0x94f8('0x4'));var config=require(_0x94f8('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x94f8('0x6')][_0x94f8('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1683aa,_0x5c2c88,_0x1cf80c){return new BPromise(function(_0x4b57cd,_0x11571f){return client[_0x94f8('0x8')](_0x1683aa,_0x1cf80c)[_0x94f8('0x9')](function(_0x590269){logger[_0x94f8('0xa')]('UserVoiceQueue,\x20%s,\x20%s',_0x5c2c88,_0x94f8('0xb'));logger['debug'](_0x94f8('0xc'),_0x5c2c88,_0x94f8('0xb'),JSON[_0x94f8('0xd')](_0x590269));if(_0x590269[_0x94f8('0xe')]){if(_0x590269[_0x94f8('0xe')][_0x94f8('0xf')]===0x1f4){logger[_0x94f8('0xe')](_0x94f8('0x10'),_0x5c2c88,_0x590269[_0x94f8('0xe')][_0x94f8('0x11')]);return _0x11571f(_0x590269[_0x94f8('0xe')][_0x94f8('0x11')]);}logger[_0x94f8('0xe')](_0x94f8('0x10'),_0x5c2c88,_0x590269[_0x94f8('0xe')]['message']);return _0x4b57cd(_0x590269['error'][_0x94f8('0x11')]);}else{logger[_0x94f8('0xa')]('UserVoiceQueue,\x20%s,\x20%s',_0x5c2c88,'request\x20sent');_0x4b57cd(_0x590269['result'][_0x94f8('0x11')]);}})[_0x94f8('0x12')](function(_0x4773f1){logger[_0x94f8('0xe')]('UserVoiceQueue,\x20%s,\x20%s',_0x5c2c88,_0x4773f1);_0x11571f(_0x4773f1);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index c628a3b..1ba5f13 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 _0x4aa2=['exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x431970,_0x3d390b){var _0x3a347a=function(_0x44cb66){while(--_0x44cb66){_0x431970['push'](_0x431970['shift']());}};_0x3a347a(++_0x3d390b);}(_0x4aa2,0x76));var _0x24aa=function(_0x2bf22d,_0x34479c){_0x2bf22d=_0x2bf22d-0x0;var _0x417874=_0x4aa2[_0x2bf22d];return _0x417874;};'use strict';var multer=require(_0x24aa('0x0'));var util=require(_0x24aa('0x1'));var path=require('path');var timeout=require(_0x24aa('0x2'));var express=require(_0x24aa('0x3'));var router=express[_0x24aa('0x4')]();var auth=require(_0x24aa('0x5'));var interaction=require(_0x24aa('0x6'));var config=require(_0x24aa('0x7'));module[_0x24aa('0x8')]=router; \ No newline at end of file +var _0xb25f=['multer','util','path','connect-timeout','express','Router','../../config/environment'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xb25f,0xe0));var _0xfb25=function(_0x323378,_0x122491){_0x323378=_0x323378-0x0;var _0x176f0f=_0xb25f[_0x323378];return _0x176f0f;};'use strict';var multer=require(_0xfb25('0x0'));var util=require(_0xfb25('0x1'));var path=require(_0xfb25('0x2'));var timeout=require(_0xfb25('0x3'));var express=require(_0xfb25('0x4'));var router=express[_0xfb25('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xfb25('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 3b61b49..10ecd5b 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 _0xaee7=['exports','INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface'];(function(_0xa0d0af,_0xda0936){var _0x488454=function(_0x4097c8){while(--_0x4097c8){_0xa0d0af['push'](_0xa0d0af['shift']());}};_0x488454(++_0xda0936);}(_0xaee7,0x136));var _0x7aee=function(_0x21171a,_0x125ebd){_0x21171a=_0x21171a-0x0;var _0x4acd86=_0xaee7[_0x21171a];return _0x4acd86;};'use strict';var Sequelize=require('sequelize');module[_0x7aee('0x0')]={'uniqueid':{'type':Sequelize[_0x7aee('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x7aee('0x2')},'membername':{'type':Sequelize[_0x7aee('0x3')],'allowNull':![],'comment':_0x7aee('0x2')},'UserId':{'type':Sequelize[_0x7aee('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x7aee('0x4'),'comment':_0x7aee('0x2')},'VoiceQueueId':{'type':Sequelize[_0x7aee('0x1')],'allowNull':![]},'interface':{'type':Sequelize[_0x7aee('0x3')],'allowNull':![],'unique':_0x7aee('0x4'),'comment':_0x7aee('0x2')},'penalty':{'type':Sequelize[_0x7aee('0x1')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0x7aee('0x1')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file +var _0x5419=['sequelize','exports','INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x5419,0x66));var _0x9541=function(_0x33726b,_0x4d1ce3){_0x33726b=_0x33726b-0x0;var _0x3778e5=_0x5419[_0x33726b];return _0x3778e5;};'use strict';var Sequelize=require(_0x9541('0x0'));module[_0x9541('0x1')]={'uniqueid':{'type':Sequelize[_0x9541('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x9541('0x3')},'membername':{'type':Sequelize[_0x9541('0x4')],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize[_0x9541('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x9541('0x4')],'allowNull':![],'unique':_0x9541('0x5'),'comment':_0x9541('0x3')},'VoiceQueueId':{'type':Sequelize[_0x9541('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0x9541('0x4')],'allowNull':![],'unique':_0x9541('0x5'),'comment':_0x9541('0x3')},'penalty':{'type':Sequelize[_0x9541('0x2')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0x9541('0x2')](0xb),'defaultValue':0x0,'comment':_0x9541('0x3')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index fb15dcc..c50fe6f 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 _0x33e6=['hook','events','../../mysqldb','UserVoiceQueueRt','setMaxListeners','save','update','remove'];(function(_0x37b624,_0x28c3aa){var _0x44abd9=function(_0x40c152){while(--_0x40c152){_0x37b624['push'](_0x37b624['shift']());}};_0x44abd9(++_0x28c3aa);}(_0x33e6,0x149));var _0x633e=function(_0x42ee86,_0x6edb51){_0x42ee86=_0x42ee86-0x0;var _0x18ee15=_0x33e6[_0x42ee86];return _0x18ee15;};'use strict';var EventEmitter=require(_0x633e('0x0'));var UserVoiceQueueRt=require(_0x633e('0x1'))['db'][_0x633e('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x633e('0x3')](0x0);var events={'afterCreate':_0x633e('0x4'),'afterUpdate':_0x633e('0x5'),'afterDestroy':_0x633e('0x6')};function emitEvent(_0x563f39){return function(_0x96c4e2,_0x185148,_0x2e2e0c){UserVoiceQueueRtEvents['emit'](_0x563f39+':'+_0x96c4e2['id'],_0x96c4e2);UserVoiceQueueRtEvents['emit'](_0x563f39,_0x96c4e2);_0x2e2e0c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0x633e('0x7')](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x48da=['update','emit','exports','events','setMaxListeners','save'];(function(_0xbba9e3,_0x4a1e71){var _0x41adc7=function(_0x3dfc40){while(--_0x3dfc40){_0xbba9e3['push'](_0xbba9e3['shift']());}};_0x41adc7(++_0x4a1e71);}(_0x48da,0xb7));var _0xa48d=function(_0x1455ca,_0x4bfeaf){_0x1455ca=_0x1455ca-0x0;var _0x32bdb7=_0x48da[_0x1455ca];return _0x32bdb7;};'use strict';var EventEmitter=require(_0xa48d('0x0'));var UserVoiceQueueRt=require('../../mysqldb')['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xa48d('0x1')](0x0);var events={'afterCreate':_0xa48d('0x2'),'afterUpdate':_0xa48d('0x3'),'afterDestroy':'remove'};function emitEvent(_0x4e6421){return function(_0x2cd315,_0x2a69fd,_0x3c8747){UserVoiceQueueRtEvents[_0xa48d('0x4')](_0x4e6421+':'+_0x2cd315['id'],_0x2cd315);UserVoiceQueueRtEvents['emit'](_0x4e6421,_0x2cd315);_0x3c8747(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module[_0xa48d('0x5')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index 84c5dc1..8986c61 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 _0x951c=['user_has_voice_queues_rt','lodash','util','api','moment','bluebird','rimraf','exports','define'];(function(_0x4566c9,_0x280505){var _0x5405c2=function(_0x20e7a6){while(--_0x20e7a6){_0x4566c9['push'](_0x4566c9['shift']());}};_0x5405c2(++_0x280505);}(_0x951c,0x88));var _0xc951=function(_0x571afc,_0x3977c3){_0x571afc=_0x571afc-0x0;var _0x25a305=_0x951c[_0x571afc];return _0x25a305;};'use strict';var _=require(_0xc951('0x0'));var util=require(_0xc951('0x1'));var logger=require('../../config/logger')(_0xc951('0x2'));var moment=require(_0xc951('0x3'));var BPromise=require(_0xc951('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc951('0x5'));var config=require('../../config/environment');var attributes=require('./userVoiceQueueRt.attributes');module[_0xc951('0x6')]=function(_0x1d273b,_0xb5129){return _0x1d273b[_0xc951('0x7')]('UserVoiceQueueRt',attributes,{'tableName':_0xc951('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5ad0=['user_has_voice_queues_rt','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','exports','define','UserVoiceQueueRt'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5ad0,0xfd));var _0x05ad=function(_0x4c78ee,_0x1202fa){_0x4c78ee=_0x4c78ee-0x0;var _0x1124b8=_0x5ad0[_0x4c78ee];return _0x1124b8;};'use strict';var _=require(_0x05ad('0x0'));var util=require(_0x05ad('0x1'));var logger=require(_0x05ad('0x2'))(_0x05ad('0x3'));var moment=require('moment');var BPromise=require(_0x05ad('0x4'));var rp=require(_0x05ad('0x5'));var fs=require('fs');var path=require(_0x05ad('0x6'));var rimraf=require(_0x05ad('0x7'));var config=require('../../config/environment');var attributes=require('./userVoiceQueueRt.attributes');module[_0x05ad('0x8')]=function(_0x233994,_0x622650){return _0x233994[_0x05ad('0x9')](_0x05ad('0xa'),attributes,{'tableName':_0x05ad('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 f1ef929..f3c94cd 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 _0xf8a8=['UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','error','code','message','result','UserVoiceQueueRt','options','raw','where','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','GetVoiceQueueRtPauses','catch','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','request','then','info'];(function(_0x1b80da,_0x156fef){var _0x59c408=function(_0x273559){while(--_0x273559){_0x1b80da['push'](_0x1b80da['shift']());}};_0x59c408(++_0x156fef);}(_0xf8a8,0x115));var _0x8f8a=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xf8a8[_0x4bfac3];return _0x15f0f2;};'use strict';var _=require(_0x8f8a('0x0'));var util=require('util');var moment=require(_0x8f8a('0x1'));var BPromise=require('bluebird');var rs=require(_0x8f8a('0x2'));var fs=require('fs');var Redis=require(_0x8f8a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x8f8a('0x4'));var logger=require(_0x8f8a('0x5'))(_0x8f8a('0x6'));var config=require(_0x8f8a('0x7'));var jayson=require(_0x8f8a('0x8'));var client=jayson['client'][_0x8f8a('0x9')]({'port':0x232a});config['redis']=_[_0x8f8a('0xa')](config[_0x8f8a('0xb')],{'host':_0x8f8a('0xc'),'port':0x18eb});var socket=require(_0x8f8a('0xd'))(new Redis(config[_0x8f8a('0xb')]));require(_0x8f8a('0xe'))[_0x8f8a('0xf')](socket);function respondWithRpcPromise(_0x5d7ab1,_0x1781af,_0xf97465){return new BPromise(function(_0x4a2bcb,_0x13748d){return client[_0x8f8a('0x10')](_0x5d7ab1,_0xf97465)[_0x8f8a('0x11')](function(_0x4415cd){logger[_0x8f8a('0x12')](_0x8f8a('0x13'),_0x1781af,_0x8f8a('0x14'));logger[_0x8f8a('0x15')](_0x8f8a('0x16'),_0x1781af,'request\x20sent',JSON['stringify'](_0x4415cd));if(_0x4415cd[_0x8f8a('0x17')]){if(_0x4415cd[_0x8f8a('0x17')][_0x8f8a('0x18')]===0x1f4){logger[_0x8f8a('0x17')](_0x8f8a('0x13'),_0x1781af,_0x4415cd[_0x8f8a('0x17')][_0x8f8a('0x19')]);return _0x13748d(_0x4415cd[_0x8f8a('0x17')]['message']);}logger[_0x8f8a('0x17')](_0x8f8a('0x13'),_0x1781af,_0x4415cd[_0x8f8a('0x17')]['message']);return _0x4a2bcb(_0x4415cd[_0x8f8a('0x17')][_0x8f8a('0x19')]);}else{logger[_0x8f8a('0x12')](_0x8f8a('0x13'),_0x1781af,_0x8f8a('0x14'));_0x4a2bcb(_0x4415cd[_0x8f8a('0x1a')][_0x8f8a('0x19')]);}})['catch'](function(_0x1747ba){logger[_0x8f8a('0x17')](_0x8f8a('0x13'),_0x1781af,_0x1747ba);_0x13748d(_0x1747ba);});});}exports['GetVoiceQueueRtPauses']=function(_0x1963cd){var _0x2668c3=this;return new Promise(function(_0x235eb5,_0x7750db){return db[_0x8f8a('0x1b')]['findAll']({'raw':_0x1963cd[_0x8f8a('0x1c')]?_0x1963cd[_0x8f8a('0x1c')][_0x8f8a('0x1d')]===undefined?!![]:![]:!![],'where':_0x1963cd[_0x8f8a('0x1c')]?_0x1963cd[_0x8f8a('0x1c')][_0x8f8a('0x1e')]||null:null,'attributes':[[db[_0x8f8a('0x1f')]['fn']('COUNT',db[_0x8f8a('0x1f')]['fn']('IF',db[_0x8f8a('0x1f')][_0x8f8a('0x20')](_0x8f8a('0x21')))),_0x8f8a('0x22')]]})[_0x8f8a('0x11')](function(_0x167402){logger[_0x8f8a('0x12')](_0x8f8a('0x23'),_0x1963cd);logger[_0x8f8a('0x15')]('GetVoiceQueueRtPauses',_0x1963cd,JSON['stringify'](_0x167402));_0x235eb5(_0x167402);})[_0x8f8a('0x24')](function(_0x10a2d5){logger[_0x8f8a('0x17')]('GetVoiceQueueRtPauses',_0x10a2d5[_0x8f8a('0x19')],_0x1963cd);_0x7750db(_0x2668c3[_0x8f8a('0x17')](0x1f4,_0x10a2d5['message']));});});}; \ No newline at end of file +var _0xe22e=['findAll','options','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','GetVoiceQueueRtPauses','lodash','util','moment','bluebird','randomstring','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','register','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','UserVoiceQueueRt'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe22e,0x1f3));var _0xee22=function(_0x2ee20d,_0x354e70){_0x2ee20d=_0x2ee20d-0x0;var _0xade530=_0xe22e[_0x2ee20d];return _0xade530;};'use strict';var _=require(_0xee22('0x0'));var util=require(_0xee22('0x1'));var moment=require(_0xee22('0x2'));var BPromise=require(_0xee22('0x3'));var rs=require(_0xee22('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xee22('0x5'));var config=require(_0xee22('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xee22('0x7')][_0xee22('0x8')]({'port':0x232a});config['redis']=_['defaults'](config[_0xee22('0x9')],{'host':_0xee22('0xa'),'port':0x18eb});var socket=require(_0xee22('0xb'))(new Redis(config[_0xee22('0x9')]));require('./userVoiceQueueRt.socket')[_0xee22('0xc')](socket);function respondWithRpcPromise(_0x19b3ef,_0x3b40be,_0x4e2106){return new BPromise(function(_0x5ca152,_0x293ea4){return client[_0xee22('0xd')](_0x19b3ef,_0x4e2106)[_0xee22('0xe')](function(_0x29189c){logger[_0xee22('0xf')](_0xee22('0x10'),_0x3b40be,'request\x20sent');logger[_0xee22('0x11')]('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x3b40be,_0xee22('0x12'),JSON[_0xee22('0x13')](_0x29189c));if(_0x29189c[_0xee22('0x14')]){if(_0x29189c['error'][_0xee22('0x15')]===0x1f4){logger[_0xee22('0x14')](_0xee22('0x10'),_0x3b40be,_0x29189c[_0xee22('0x14')][_0xee22('0x16')]);return _0x293ea4(_0x29189c[_0xee22('0x14')][_0xee22('0x16')]);}logger['error'](_0xee22('0x10'),_0x3b40be,_0x29189c[_0xee22('0x14')][_0xee22('0x16')]);return _0x5ca152(_0x29189c[_0xee22('0x14')][_0xee22('0x16')]);}else{logger[_0xee22('0xf')](_0xee22('0x10'),_0x3b40be,_0xee22('0x12'));_0x5ca152(_0x29189c[_0xee22('0x17')]['message']);}})[_0xee22('0x18')](function(_0x3ef8e7){logger[_0xee22('0x14')](_0xee22('0x10'),_0x3b40be,_0x3ef8e7);_0x293ea4(_0x3ef8e7);});});}exports['GetVoiceQueueRtPauses']=function(_0x439607){var _0x3872ef=this;return new Promise(function(_0x2e8bc8,_0x58b75e){return db[_0xee22('0x19')][_0xee22('0x1a')]({'raw':_0x439607['options']?_0x439607['options']['raw']===undefined?!![]:![]:!![],'where':_0x439607[_0xee22('0x1b')]?_0x439607[_0xee22('0x1b')][_0xee22('0x1c')]||null:null,'attributes':[[db[_0xee22('0x1d')]['fn'](_0xee22('0x1e'),db[_0xee22('0x1d')]['fn']('IF',db[_0xee22('0x1d')][_0xee22('0x1f')](_0xee22('0x20')))),_0xee22('0x21')]]})[_0xee22('0xe')](function(_0xacc653){logger['info'](_0xee22('0x22'),_0x439607);logger[_0xee22('0x11')](_0xee22('0x22'),_0x439607,JSON[_0xee22('0x13')](_0xacc653));_0x2e8bc8(_0xacc653);})[_0xee22('0x18')](function(_0x337282){logger['error'](_0xee22('0x22'),_0x337282[_0xee22('0x16')],_0x439607);_0x58b75e(_0x3872ef['error'](0x1f4,_0x337282[_0xee22('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index eaf3ce3..05cb16c 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 _0x3458=['userVoiceQueueRt:','save','update','removeListener'];(function(_0x2c9de0,_0xe928bd){var _0x9ceb47=function(_0x4451e6){while(--_0x4451e6){_0x2c9de0['push'](_0x2c9de0['shift']());}};_0x9ceb47(++_0xe928bd);}(_0x3458,0x1a9));var _0x8345=function(_0x1561bd,_0x4c76ad){_0x1561bd=_0x1561bd-0x0;var _0x2df80d=_0x3458[_0x1561bd];return _0x2df80d;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0x8345('0x0'),'remove',_0x8345('0x1')];function createListener(_0x1743b1,_0x33f6b3){return function(_0x272353){_0x33f6b3['emit'](_0x1743b1,_0x272353);};}function removeListener(_0x15209c,_0x516a48){return function(){UserVoiceQueueRtEvents[_0x8345('0x2')](_0x15209c,_0x516a48);};}exports['register']=function(_0x3bffc2){for(var _0x1522ea=0x0,_0x5f0fc9=events['length'];_0x1522ea<_0x5f0fc9;_0x1522ea++){var _0xa98a6c=events[_0x1522ea];var _0xbb45df=createListener(_0x8345('0x3')+_0xa98a6c,_0x3bffc2);UserVoiceQueueRtEvents['on'](_0xa98a6c,_0xbb45df);}}; \ No newline at end of file +var _0xc3d7=['register','userVoiceQueueRt:','save','remove','update'];(function(_0x191154,_0x56f74c){var _0x3dcd73=function(_0x51c321){while(--_0x51c321){_0x191154['push'](_0x191154['shift']());}};_0x3dcd73(++_0x56f74c);}(_0xc3d7,0xac));var _0x7c3d=function(_0x6e743e,_0x326b29){_0x6e743e=_0x6e743e-0x0;var _0x83f589=_0xc3d7[_0x6e743e];return _0x83f589;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0x7c3d('0x0'),_0x7c3d('0x1'),_0x7c3d('0x2')];function createListener(_0x5794ae,_0x2b5cef){return function(_0x2d47e5){_0x2b5cef['emit'](_0x5794ae,_0x2d47e5);};}function removeListener(_0x7f1c9c,_0x1b1866){return function(){UserVoiceQueueRtEvents['removeListener'](_0x7f1c9c,_0x1b1866);};}exports[_0x7c3d('0x3')]=function(_0x5f6393){for(var _0x58a54b=0x0,_0x1ed3a2=events['length'];_0x58a54b<_0x1ed3a2;_0x58a54b++){var _0x638cab=events[_0x58a54b];var _0x1eb531=createListener(_0x7c3d('0x4')+_0x638cab,_0x5f6393);UserVoiceQueueRtEvents['on'](_0x638cab,_0x1eb531);}}; \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index fb62b14..1e0d4ae 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 _0x42f7=['isAuthenticated','post','create','put','update','delete','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./variable.controller','index','get','/:id'];(function(_0x5cbcbd,_0x3447ce){var _0xac7209=function(_0x55af33){while(--_0x55af33){_0x5cbcbd['push'](_0x5cbcbd['shift']());}};_0xac7209(++_0x3447ce);}(_0x42f7,0x19e));var _0x742f=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x42f7[_0xfae23b];return _0x200640;};'use strict';var multer=require(_0x742f('0x0'));var util=require('util');var path=require(_0x742f('0x1'));var timeout=require(_0x742f('0x2'));var express=require(_0x742f('0x3'));var router=express[_0x742f('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x742f('0x5'));var config=require(_0x742f('0x6'));var controller=require(_0x742f('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x742f('0x8')]);router[_0x742f('0x9')](_0x742f('0xa'),auth[_0x742f('0xb')](),controller['show']);router[_0x742f('0xc')]('/',auth[_0x742f('0xb')](),controller[_0x742f('0xd')]);router[_0x742f('0xe')](_0x742f('0xa'),auth[_0x742f('0xb')](),controller[_0x742f('0xf')]);router[_0x742f('0x10')](_0x742f('0xa'),auth[_0x742f('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xa198=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated','show','create','put','update','delete','exports','multer'];(function(_0x2c517c,_0x4112ac){var _0x54ac0f=function(_0x1dc701){while(--_0x1dc701){_0x2c517c['push'](_0x2c517c['shift']());}};_0x54ac0f(++_0x4112ac);}(_0xa198,0x7f));var _0x8a19=function(_0x4035be,_0x292ad9){_0x4035be=_0x4035be-0x0;var _0x6e1c75=_0xa198[_0x4035be];return _0x6e1c75;};'use strict';var multer=require(_0x8a19('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x8a19('0x1'));var express=require(_0x8a19('0x2'));var router=express[_0x8a19('0x3')]();var auth=require(_0x8a19('0x4'));var interaction=require(_0x8a19('0x5'));var config=require(_0x8a19('0x6'));var controller=require(_0x8a19('0x7'));router[_0x8a19('0x8')]('/',auth[_0x8a19('0x9')](),controller['index']);router[_0x8a19('0x8')]('/:id',auth[_0x8a19('0x9')](),controller[_0x8a19('0xa')]);router['post']('/',auth[_0x8a19('0x9')](),controller[_0x8a19('0xb')]);router[_0x8a19('0xc')]('/:id',auth[_0x8a19('0x9')](),controller[_0x8a19('0xd')]);router[_0x8a19('0xe')]('/:id',auth[_0x8a19('0x9')](),controller['destroy']);module[_0x8a19('0xf')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index bb3d8c5..20741ee 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 _0x3ac7=['exports','STRING','name'];(function(_0xf5a67f,_0x14428c){var _0x1da154=function(_0x2748c0){while(--_0x2748c0){_0xf5a67f['push'](_0xf5a67f['shift']());}};_0x1da154(++_0x14428c);}(_0x3ac7,0xe4));var _0x73ac=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x3ac7[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require('sequelize');module[_0x73ac('0x0')]={'name':{'type':Sequelize[_0x73ac('0x1')],'unique':_0x73ac('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x73ac('0x1')]}}; \ No newline at end of file +var _0x8bbd=['sequelize','exports','STRING','name'];(function(_0x31ced5,_0x5d5415){var _0x10d9e5=function(_0x2e51a5){while(--_0x2e51a5){_0x31ced5['push'](_0x31ced5['shift']());}};_0x10d9e5(++_0x5d5415);}(_0x8bbd,0xec));var _0xd8bb=function(_0x3664d2,_0x142756){_0x3664d2=_0x3664d2-0x0;var _0x21ba22=_0x8bbd[_0x3664d2];return _0x21ba22;};'use strict';var Sequelize=require(_0xd8bb('0x0'));module[_0xd8bb('0x1')]={'name':{'type':Sequelize[_0xd8bb('0x2')],'unique':_0xd8bb('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xd8bb('0x2')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 764a538..18b34ac 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 _0x90c2=['apply','reject','save','update','destroy','then','get','Variables','UserProfileResource','stack','name','send','map','fieldName','type','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','Variable','count','includeAll','include','rows','show','params','keys','rawAttributes','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','set','Content-Range'];(function(_0x2bfcb2,_0xc59cdb){var _0xe4b8ca=function(_0x372ac7){while(--_0x372ac7){_0x2bfcb2['push'](_0x2bfcb2['shift']());}};_0xe4b8ca(++_0xc59cdb);}(_0x90c2,0x12e));var _0x290c=function(_0x5d878a,_0x133c99){_0x5d878a=_0x5d878a-0x0;var _0xefbbec=_0x90c2[_0x5d878a];return _0xefbbec;};'use strict';var pdf=require(_0x290c('0x0'));var emlformat=require(_0x290c('0x1'));var rimraf=require(_0x290c('0x2'));var zipdir=require(_0x290c('0x3'));var jsonpatch=require(_0x290c('0x4'));var rp=require(_0x290c('0x5'));var moment=require(_0x290c('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x290c('0x7'));var util=require(_0x290c('0x8'));var path=require(_0x290c('0x9'));var sox=require('sox');var csv=require(_0x290c('0xa'));var ejs=require(_0x290c('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x290c('0xc'));var crypto=require(_0x290c('0xd'));var jsforce=require(_0x290c('0xe'));var deskjs=require(_0x290c('0xf'));var toCsv=require(_0x290c('0xa'));var querystring=require(_0x290c('0x10'));var Papa=require(_0x290c('0x11'));var Redis=require(_0x290c('0x12'));var authService=require(_0x290c('0x13'));var qs=require(_0x290c('0x14'));var as=require(_0x290c('0x15'));var hardwareService=require(_0x290c('0x16'));var logger=require(_0x290c('0x17'))('api');var utils=require(_0x290c('0x18'));var config=require(_0x290c('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x31dce8,_0x4ba4b3){_0x4ba4b3=_0x4ba4b3||0xcc;return function(_0x11f950){if(_0x11f950){return _0x31dce8[_0x290c('0x1a')](_0x4ba4b3);}return _0x31dce8[_0x290c('0x1b')](_0x4ba4b3)[_0x290c('0x1c')]();};}function respondWithResult(_0x24f172,_0x1a17e2){_0x1a17e2=_0x1a17e2||0xc8;return function(_0x4c7ca1){if(_0x4c7ca1){return _0x24f172[_0x290c('0x1b')](_0x1a17e2)[_0x290c('0x1d')](_0x4c7ca1);}};}function respondWithFilteredResult(_0xae0a09,_0x407602){return function(_0x392060){if(_0x392060){var _0x3ffb32=_0x392060['count'],_0xc318b1=_0x407602[_0x290c('0x1e')],_0xe718db=_0x407602['offset']+_0x407602[_0x290c('0x1f')],_0x379e4f;if(_0xe718db>=_0x3ffb32){_0xe718db=_0x3ffb32;_0x379e4f=0xc8;}else{_0x379e4f=0xce;}_0xae0a09[_0x290c('0x1b')](_0x379e4f);return _0xae0a09[_0x290c('0x20')](_0x290c('0x21'),_0xc318b1+'-'+_0xe718db+'/'+_0x3ffb32)[_0x290c('0x1d')](_0x392060);}return null;};}function patchUpdates(_0x296813){return function(_0x7ad0e0){try{jsonpatch[_0x290c('0x22')](_0x7ad0e0,_0x296813,!![]);}catch(_0x340f87){return BPromise[_0x290c('0x23')](_0x340f87);}return _0x7ad0e0[_0x290c('0x24')]();};}function saveUpdates(_0x46bfc2,_0x4cbd38){return function(_0x10453e){if(_0x10453e){return _0x10453e[_0x290c('0x25')](_0x46bfc2)['then'](function(_0x4e4077){return _0x4e4077;});}return null;};}function removeEntity(_0x595690,_0x531131){return function(_0x35c86c){if(_0x35c86c){return _0x35c86c[_0x290c('0x26')]()[_0x290c('0x27')](function(){var _0x38c704=_0x35c86c[_0x290c('0x28')]({'plain':!![]});var _0x5ce862=_0x290c('0x29');return db[_0x290c('0x2a')]['destroy']({'where':{'type':_0x5ce862,'resourceId':_0x38c704['id']}})[_0x290c('0x27')](function(){return _0x35c86c;});})[_0x290c('0x27')](function(){_0x595690[_0x290c('0x1b')](0xcc)[_0x290c('0x1c')]();});}};}function handleEntityNotFound(_0x5a1bb2,_0x747b9b){return function(_0x1abb87){if(!_0x1abb87){_0x5a1bb2[_0x290c('0x1a')](0x194);}return _0x1abb87;};}function handleError(_0x155157,_0xa41570){_0xa41570=_0xa41570||0x1f4;return function(_0xe44394){logger['error'](_0xe44394[_0x290c('0x2b')]);if(_0xe44394[_0x290c('0x2c')]){delete _0xe44394['name'];}_0x155157['status'](_0xa41570)[_0x290c('0x2d')](_0xe44394);};}exports['index']=function(_0x1d763f,_0x9b5892){var _0x79b89f={},_0x40bda2={},_0x542d69={'count':0x0,'rows':[]};var _0x321dd1=_[_0x290c('0x2e')](db['Variable']['rawAttributes'],function(_0x1d78a4){return{'name':_0x1d78a4[_0x290c('0x2f')],'type':_0x1d78a4[_0x290c('0x30')]['key']};});_0x40bda2['model']=_[_0x290c('0x2e')](_0x321dd1,_0x290c('0x2c'));_0x40bda2['query']=_['keys'](_0x1d763f[_0x290c('0x31')]);_0x40bda2[_0x290c('0x32')]=_[_0x290c('0x33')](_0x40bda2[_0x290c('0x34')],_0x40bda2[_0x290c('0x31')]);_0x79b89f[_0x290c('0x35')]=_[_0x290c('0x33')](_0x40bda2['model'],qs[_0x290c('0x36')](_0x1d763f[_0x290c('0x31')][_0x290c('0x36')]));_0x79b89f[_0x290c('0x35')]=_0x79b89f['attributes'][_0x290c('0x37')]?_0x79b89f[_0x290c('0x35')]:_0x40bda2[_0x290c('0x34')];if(!_0x1d763f['query']['hasOwnProperty'](_0x290c('0x38'))){_0x79b89f[_0x290c('0x1f')]=qs[_0x290c('0x1f')](_0x1d763f[_0x290c('0x31')][_0x290c('0x1f')]);_0x79b89f[_0x290c('0x1e')]=qs[_0x290c('0x1e')](_0x1d763f['query'][_0x290c('0x1e')]);}_0x79b89f[_0x290c('0x39')]=qs[_0x290c('0x3a')](_0x1d763f[_0x290c('0x31')][_0x290c('0x3a')]);_0x79b89f[_0x290c('0x3b')]=qs['filters'](_['pick'](_0x1d763f[_0x290c('0x31')],_0x40bda2[_0x290c('0x32')]));if(_0x1d763f[_0x290c('0x31')][_0x290c('0x3c')]){_0x79b89f['where']=_[_0x290c('0x3d')](_0x79b89f[_0x290c('0x3b')],{'$or':_['map'](_0x321dd1,function(_0x49e798){if(_0x49e798[_0x290c('0x30')]!==_0x290c('0x3e')){var _0x2f6220={};_0x2f6220[_0x49e798[_0x290c('0x2c')]]={'$like':'%'+_0x1d763f[_0x290c('0x31')][_0x290c('0x3c')]+'%'};return _0x2f6220;}})});}_0x79b89f=_[_0x290c('0x3d')]({},_0x79b89f,_0x1d763f[_0x290c('0x3f')]);var _0x78096={'where':_0x79b89f[_0x290c('0x3b')]};return db[_0x290c('0x40')][_0x290c('0x41')](_0x78096)['then'](function(_0x2f2c34){_0x542d69[_0x290c('0x41')]=_0x2f2c34;if(_0x1d763f['query'][_0x290c('0x42')]){_0x79b89f[_0x290c('0x43')]=[{'all':!![]}];}return db[_0x290c('0x40')]['findAll'](_0x79b89f);})[_0x290c('0x27')](function(_0x3cd792){_0x542d69[_0x290c('0x44')]=_0x3cd792;return _0x542d69;})[_0x290c('0x27')](respondWithFilteredResult(_0x9b5892,_0x79b89f))['catch'](handleError(_0x9b5892,null));};exports[_0x290c('0x45')]=function(_0x27724a,_0x4d4f11){var _0x2a0ec7={'raw':!![],'where':{'id':_0x27724a[_0x290c('0x46')]['id']}},_0x5d69f7={};_0x5d69f7[_0x290c('0x34')]=_[_0x290c('0x47')](db[_0x290c('0x40')][_0x290c('0x48')]);_0x5d69f7[_0x290c('0x31')]=_['keys'](_0x27724a[_0x290c('0x31')]);_0x5d69f7[_0x290c('0x32')]=_[_0x290c('0x33')](_0x5d69f7[_0x290c('0x34')],_0x5d69f7[_0x290c('0x31')]);_0x2a0ec7[_0x290c('0x35')]=_[_0x290c('0x33')](_0x5d69f7[_0x290c('0x34')],qs[_0x290c('0x36')](_0x27724a['query'][_0x290c('0x36')]));_0x2a0ec7[_0x290c('0x35')]=_0x2a0ec7[_0x290c('0x35')]['length']?_0x2a0ec7[_0x290c('0x35')]:_0x5d69f7['model'];if(_0x27724a['query']['includeAll']){_0x2a0ec7[_0x290c('0x43')]=[{'all':!![]}];}_0x2a0ec7=_[_0x290c('0x3d')]({},_0x2a0ec7,_0x27724a[_0x290c('0x3f')]);return db[_0x290c('0x40')][_0x290c('0x49')](_0x2a0ec7)[_0x290c('0x27')](handleEntityNotFound(_0x4d4f11,null))['then'](respondWithResult(_0x4d4f11,null))[_0x290c('0x4a')](handleError(_0x4d4f11,null));};exports[_0x290c('0x4b')]=function(_0x307d86,_0x12176f){return db[_0x290c('0x40')][_0x290c('0x4b')](_0x307d86[_0x290c('0x4c')],{})[_0x290c('0x27')](function(_0x3fb455){var _0x19c9a7=_0x307d86[_0x290c('0x4d')][_0x290c('0x28')]({'plain':!![]});if(!_0x19c9a7)throw new Error(_0x290c('0x4e'));if(_0x19c9a7[_0x290c('0x4f')]===_0x290c('0x4d')){var _0x5a3916=_0x3fb455['get']({'plain':!![]});var _0x585db1=_0x290c('0x29');return db[_0x290c('0x50')][_0x290c('0x49')]({'where':{'name':_0x585db1,'userProfileId':_0x19c9a7[_0x290c('0x51')]},'raw':!![]})[_0x290c('0x27')](function(_0x3eb24a){if(_0x3eb24a&&_0x3eb24a['autoAssociation']===0x0){return db['UserProfileResource'][_0x290c('0x4b')]({'name':_0x5a3916[_0x290c('0x2c')],'resourceId':_0x5a3916['id'],'type':_0x3eb24a['name'],'sectionId':_0x3eb24a['id']},{})[_0x290c('0x27')](function(){return _0x3fb455;});}else{return _0x3fb455;}})[_0x290c('0x4a')](function(_0x896077){logger[_0x290c('0x52')](_0x290c('0x53'),_0x896077);throw _0x896077;});}return _0x3fb455;})['then'](respondWithResult(_0x12176f,0xc9))[_0x290c('0x4a')](handleError(_0x12176f,null));};exports['update']=function(_0x58a040,_0x3e2b84){if(_0x58a040['body']['id']){delete _0x58a040[_0x290c('0x4c')]['id'];}return db['Variable']['find']({'where':{'id':_0x58a040[_0x290c('0x46')]['id']}})[_0x290c('0x27')](handleEntityNotFound(_0x3e2b84,null))[_0x290c('0x27')](saveUpdates(_0x58a040[_0x290c('0x4c')],null))['then'](respondWithResult(_0x3e2b84,null))[_0x290c('0x4a')](handleError(_0x3e2b84,null));};exports[_0x290c('0x26')]=function(_0x33fa96,_0x355c93){return db[_0x290c('0x40')][_0x290c('0x49')]({'where':{'id':_0x33fa96[_0x290c('0x46')]['id']}})[_0x290c('0x27')](handleEntityNotFound(_0x355c93,null))[_0x290c('0x27')](removeEntity(_0x355c93,null))[_0x290c('0x4a')](handleError(_0x355c93,null));}; \ No newline at end of file +var _0xe292=['lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Variables','UserProfileResource','error','stack','name','send','index','map','Variable','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','count','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','moment','bluebird','path','ejs'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0xe292,0x19e));var _0x2e29=function(_0x37ff79,_0x1f4dbb){_0x37ff79=_0x37ff79-0x0;var _0x275e15=_0xe292[_0x37ff79];return _0x275e15;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x2e29('0x0'));var zipdir=require(_0x2e29('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2e29('0x2'));var BPromise=require(_0x2e29('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2e29('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2e29('0x5'));var fs=require('fs');var _=require(_0x2e29('0x6'));var squel=require(_0x2e29('0x7'));var crypto=require(_0x2e29('0x8'));var jsforce=require(_0x2e29('0x9'));var deskjs=require(_0x2e29('0xa'));var toCsv=require(_0x2e29('0xb'));var querystring=require(_0x2e29('0xc'));var Papa=require(_0x2e29('0xd'));var Redis=require(_0x2e29('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x2e29('0xf'));var as=require(_0x2e29('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2e29('0x11'))(_0x2e29('0x12'));var utils=require(_0x2e29('0x13'));var config=require(_0x2e29('0x14'));var db=require(_0x2e29('0x15'))['db'];function respondWithStatusCode(_0x472415,_0x5aef56){_0x5aef56=_0x5aef56||0xcc;return function(_0x91d02){if(_0x91d02){return _0x472415[_0x2e29('0x16')](_0x5aef56);}return _0x472415[_0x2e29('0x17')](_0x5aef56)[_0x2e29('0x18')]();};}function respondWithResult(_0x43a6b4,_0x4f92c5){_0x4f92c5=_0x4f92c5||0xc8;return function(_0x4b79ad){if(_0x4b79ad){return _0x43a6b4[_0x2e29('0x17')](_0x4f92c5)[_0x2e29('0x19')](_0x4b79ad);}};}function respondWithFilteredResult(_0x326b26,_0x615f4d){return function(_0x22a196){if(_0x22a196){var _0x5dbc41=_0x22a196['count'],_0x5e57c2=_0x615f4d[_0x2e29('0x1a')],_0x231434=_0x615f4d[_0x2e29('0x1a')]+_0x615f4d[_0x2e29('0x1b')],_0x4e6f42;if(_0x231434>=_0x5dbc41){_0x231434=_0x5dbc41;_0x4e6f42=0xc8;}else{_0x4e6f42=0xce;}_0x326b26[_0x2e29('0x17')](_0x4e6f42);return _0x326b26[_0x2e29('0x1c')](_0x2e29('0x1d'),_0x5e57c2+'-'+_0x231434+'/'+_0x5dbc41)[_0x2e29('0x19')](_0x22a196);}return null;};}function patchUpdates(_0x5de5b5){return function(_0x5cdef4){try{jsonpatch[_0x2e29('0x1e')](_0x5cdef4,_0x5de5b5,!![]);}catch(_0x4c56a5){return BPromise[_0x2e29('0x1f')](_0x4c56a5);}return _0x5cdef4[_0x2e29('0x20')]();};}function saveUpdates(_0x1fc213,_0x4c31d4){return function(_0x5c4d4c){if(_0x5c4d4c){return _0x5c4d4c[_0x2e29('0x21')](_0x1fc213)[_0x2e29('0x22')](function(_0x38c5ea){return _0x38c5ea;});}return null;};}function removeEntity(_0xc2314b,_0x5c73c3){return function(_0x16a485){if(_0x16a485){return _0x16a485[_0x2e29('0x23')]()[_0x2e29('0x22')](function(){var _0x1b41c6=_0x16a485[_0x2e29('0x24')]({'plain':!![]});var _0x4d7369=_0x2e29('0x25');return db[_0x2e29('0x26')][_0x2e29('0x23')]({'where':{'type':_0x4d7369,'resourceId':_0x1b41c6['id']}})[_0x2e29('0x22')](function(){return _0x16a485;});})[_0x2e29('0x22')](function(){_0xc2314b[_0x2e29('0x17')](0xcc)[_0x2e29('0x18')]();});}};}function handleEntityNotFound(_0x233e29,_0x258c8e){return function(_0x35a621){if(!_0x35a621){_0x233e29[_0x2e29('0x16')](0x194);}return _0x35a621;};}function handleError(_0x57fa04,_0x35f509){_0x35f509=_0x35f509||0x1f4;return function(_0x19c6ae){logger[_0x2e29('0x27')](_0x19c6ae[_0x2e29('0x28')]);if(_0x19c6ae[_0x2e29('0x29')]){delete _0x19c6ae[_0x2e29('0x29')];}_0x57fa04[_0x2e29('0x17')](_0x35f509)[_0x2e29('0x2a')](_0x19c6ae);};}exports[_0x2e29('0x2b')]=function(_0x3169b5,_0x1317d8){var _0x21f812={},_0x129de8={},_0x208ec1={'count':0x0,'rows':[]};var _0x502567=_[_0x2e29('0x2c')](db[_0x2e29('0x2d')]['rawAttributes'],function(_0x387fd0){return{'name':_0x387fd0[_0x2e29('0x2e')],'type':_0x387fd0['type'][_0x2e29('0x2f')]};});_0x129de8[_0x2e29('0x30')]=_[_0x2e29('0x2c')](_0x502567,_0x2e29('0x29'));_0x129de8[_0x2e29('0x31')]=_['keys'](_0x3169b5[_0x2e29('0x31')]);_0x129de8[_0x2e29('0x32')]=_[_0x2e29('0x33')](_0x129de8[_0x2e29('0x30')],_0x129de8[_0x2e29('0x31')]);_0x21f812['attributes']=_[_0x2e29('0x33')](_0x129de8[_0x2e29('0x30')],qs[_0x2e29('0x34')](_0x3169b5[_0x2e29('0x31')][_0x2e29('0x34')]));_0x21f812['attributes']=_0x21f812[_0x2e29('0x35')][_0x2e29('0x36')]?_0x21f812['attributes']:_0x129de8[_0x2e29('0x30')];if(!_0x3169b5['query'][_0x2e29('0x37')]('nolimit')){_0x21f812[_0x2e29('0x1b')]=qs['limit'](_0x3169b5['query']['limit']);_0x21f812[_0x2e29('0x1a')]=qs[_0x2e29('0x1a')](_0x3169b5[_0x2e29('0x31')][_0x2e29('0x1a')]);}_0x21f812[_0x2e29('0x38')]=qs[_0x2e29('0x39')](_0x3169b5[_0x2e29('0x31')][_0x2e29('0x39')]);_0x21f812[_0x2e29('0x3a')]=qs[_0x2e29('0x32')](_[_0x2e29('0x3b')](_0x3169b5[_0x2e29('0x31')],_0x129de8[_0x2e29('0x32')]));if(_0x3169b5[_0x2e29('0x31')][_0x2e29('0x3c')]){_0x21f812['where']=_[_0x2e29('0x3d')](_0x21f812['where'],{'$or':_[_0x2e29('0x2c')](_0x502567,function(_0x4d7658){if(_0x4d7658[_0x2e29('0x3e')]!==_0x2e29('0x3f')){var _0xe44fa6={};_0xe44fa6[_0x4d7658['name']]={'$like':'%'+_0x3169b5[_0x2e29('0x31')][_0x2e29('0x3c')]+'%'};return _0xe44fa6;}})});}_0x21f812=_[_0x2e29('0x3d')]({},_0x21f812,_0x3169b5['options']);var _0x3e18dc={'where':_0x21f812[_0x2e29('0x3a')]};return db[_0x2e29('0x2d')][_0x2e29('0x40')](_0x3e18dc)[_0x2e29('0x22')](function(_0x371ad4){_0x208ec1[_0x2e29('0x40')]=_0x371ad4;if(_0x3169b5['query'][_0x2e29('0x41')]){_0x21f812[_0x2e29('0x42')]=[{'all':!![]}];}return db['Variable'][_0x2e29('0x43')](_0x21f812);})[_0x2e29('0x22')](function(_0x4dc58d){_0x208ec1[_0x2e29('0x44')]=_0x4dc58d;return _0x208ec1;})['then'](respondWithFilteredResult(_0x1317d8,_0x21f812))[_0x2e29('0x45')](handleError(_0x1317d8,null));};exports[_0x2e29('0x46')]=function(_0x14423e,_0x1cec3e){var _0x340c1a={'raw':!![],'where':{'id':_0x14423e[_0x2e29('0x47')]['id']}},_0x4d4f3c={};_0x4d4f3c[_0x2e29('0x30')]=_[_0x2e29('0x48')](db['Variable'][_0x2e29('0x49')]);_0x4d4f3c[_0x2e29('0x31')]=_[_0x2e29('0x48')](_0x14423e[_0x2e29('0x31')]);_0x4d4f3c[_0x2e29('0x32')]=_[_0x2e29('0x33')](_0x4d4f3c[_0x2e29('0x30')],_0x4d4f3c['query']);_0x340c1a[_0x2e29('0x35')]=_[_0x2e29('0x33')](_0x4d4f3c['model'],qs[_0x2e29('0x34')](_0x14423e[_0x2e29('0x31')]['fields']));_0x340c1a['attributes']=_0x340c1a[_0x2e29('0x35')][_0x2e29('0x36')]?_0x340c1a[_0x2e29('0x35')]:_0x4d4f3c['model'];if(_0x14423e[_0x2e29('0x31')]['includeAll']){_0x340c1a['include']=[{'all':!![]}];}_0x340c1a=_[_0x2e29('0x3d')]({},_0x340c1a,_0x14423e[_0x2e29('0x4a')]);return db[_0x2e29('0x2d')][_0x2e29('0x4b')](_0x340c1a)[_0x2e29('0x22')](handleEntityNotFound(_0x1cec3e,null))['then'](respondWithResult(_0x1cec3e,null))[_0x2e29('0x45')](handleError(_0x1cec3e,null));};exports[_0x2e29('0x4c')]=function(_0x338915,_0x8db8b9){return db[_0x2e29('0x2d')][_0x2e29('0x4c')](_0x338915[_0x2e29('0x4d')],{})[_0x2e29('0x22')](function(_0x23c222){var _0xe2a0bf=_0x338915[_0x2e29('0x4e')][_0x2e29('0x24')]({'plain':!![]});if(!_0xe2a0bf)throw new Error(_0x2e29('0x4f'));if(_0xe2a0bf[_0x2e29('0x50')]==='user'){var _0x3e2f17=_0x23c222[_0x2e29('0x24')]({'plain':!![]});var _0x14d3fe=_0x2e29('0x25');return db[_0x2e29('0x51')][_0x2e29('0x4b')]({'where':{'name':_0x14d3fe,'userProfileId':_0xe2a0bf['userProfileId']},'raw':!![]})[_0x2e29('0x22')](function(_0x3768ab){if(_0x3768ab&&_0x3768ab[_0x2e29('0x52')]===0x0){return db[_0x2e29('0x26')]['create']({'name':_0x3e2f17['name'],'resourceId':_0x3e2f17['id'],'type':_0x3768ab[_0x2e29('0x29')],'sectionId':_0x3768ab['id']},{})[_0x2e29('0x22')](function(){return _0x23c222;});}else{return _0x23c222;}})[_0x2e29('0x45')](function(_0x1a0f20){logger[_0x2e29('0x27')](_0x2e29('0x53'),_0x1a0f20);throw _0x1a0f20;});}return _0x23c222;})[_0x2e29('0x22')](respondWithResult(_0x8db8b9,0xc9))[_0x2e29('0x45')](handleError(_0x8db8b9,null));};exports[_0x2e29('0x21')]=function(_0x1a1715,_0x4485a8){if(_0x1a1715[_0x2e29('0x4d')]['id']){delete _0x1a1715[_0x2e29('0x4d')]['id'];}return db[_0x2e29('0x2d')]['find']({'where':{'id':_0x1a1715[_0x2e29('0x47')]['id']}})[_0x2e29('0x22')](handleEntityNotFound(_0x4485a8,null))[_0x2e29('0x22')](saveUpdates(_0x1a1715[_0x2e29('0x4d')],null))[_0x2e29('0x22')](respondWithResult(_0x4485a8,null))[_0x2e29('0x45')](handleError(_0x4485a8,null));};exports[_0x2e29('0x23')]=function(_0x22ed21,_0x24bf82){return db[_0x2e29('0x2d')]['find']({'where':{'id':_0x22ed21[_0x2e29('0x47')]['id']}})[_0x2e29('0x22')](handleEntityNotFound(_0x24bf82,null))['then'](removeEntity(_0x24bf82,null))['catch'](handleError(_0x24bf82,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index a352462..a356037 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 _0x10dc=['lodash','util','../../config/logger','api','rimraf','../../config/environment','./variable.attributes','exports','define','Variable','tools_variables'];(function(_0x5e991d,_0x47f3d6){var _0x4c5b56=function(_0x12be46){while(--_0x12be46){_0x5e991d['push'](_0x5e991d['shift']());}};_0x4c5b56(++_0x47f3d6);}(_0x10dc,0x13f));var _0xc10d=function(_0x582ccd,_0xa9ab43){_0x582ccd=_0x582ccd-0x0;var _0x11545d=_0x10dc[_0x582ccd];return _0x11545d;};'use strict';var _=require(_0xc10d('0x0'));var util=require(_0xc10d('0x1'));var logger=require(_0xc10d('0x2'))(_0xc10d('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(_0xc10d('0x4'));var config=require(_0xc10d('0x5'));var attributes=require(_0xc10d('0x6'));module[_0xc10d('0x7')]=function(_0x59f835,_0x313755){return _0x59f835[_0xc10d('0x8')](_0xc10d('0x9'),attributes,{'tableName':_0xc10d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2209=['../../config/environment','./variable.attributes','exports','define','Variable','tools_variables','lodash','util','../../config/logger','api','moment','request-promise','rimraf'];(function(_0x191d74,_0x3049a3){var _0x296765=function(_0x52d530){while(--_0x52d530){_0x191d74['push'](_0x191d74['shift']());}};_0x296765(++_0x3049a3);}(_0x2209,0x95));var _0x9220=function(_0x133528,_0x3b7024){_0x133528=_0x133528-0x0;var _0x190853=_0x2209[_0x133528];return _0x190853;};'use strict';var _=require(_0x9220('0x0'));var util=require(_0x9220('0x1'));var logger=require(_0x9220('0x2'))(_0x9220('0x3'));var moment=require(_0x9220('0x4'));var BPromise=require('bluebird');var rp=require(_0x9220('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9220('0x6'));var config=require(_0x9220('0x7'));var attributes=require(_0x9220('0x8'));module[_0x9220('0x9')]=function(_0x45bd2d,_0x300ed6){return _0x45bd2d[_0x9220('0xa')](_0x9220('0xb'),attributes,{'tableName':_0x9220('0xc'),'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 abd4728..a2ba68e 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 _0xfab9=['where','map','include','model','attributes','debug','ShowVariable','stringify','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Variable,\x20%s,\x20%s,\x20%s','error','Variable,\x20%s,\x20%s','message','request\x20sent','result','Variable','find','options','raw'];(function(_0x50d12d,_0x50d101){var _0x3db94f=function(_0x12744b){while(--_0x12744b){_0x50d12d['push'](_0x50d12d['shift']());}};_0x3db94f(++_0x50d101);}(_0xfab9,0xc8));var _0x9fab=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xfab9[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x9fab('0x0'));var util=require(_0x9fab('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9fab('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9fab('0x3'))['db'];var utils=require(_0x9fab('0x4'));var logger=require(_0x9fab('0x5'))(_0x9fab('0x6'));var config=require(_0x9fab('0x7'));var jayson=require(_0x9fab('0x8'));var client=jayson[_0x9fab('0x9')][_0x9fab('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e57ba,_0x33b993,_0x290476){return new BPromise(function(_0x57c861,_0x128cba){return client[_0x9fab('0xb')](_0x1e57ba,_0x290476)[_0x9fab('0xc')](function(_0x34031f){logger[_0x9fab('0xd')]('Variable,\x20%s,\x20%s',_0x33b993,'request\x20sent');logger['debug'](_0x9fab('0xe'),_0x33b993,'request\x20sent',JSON['stringify'](_0x34031f));if(_0x34031f[_0x9fab('0xf')]){if(_0x34031f[_0x9fab('0xf')]['code']===0x1f4){logger[_0x9fab('0xf')](_0x9fab('0x10'),_0x33b993,_0x34031f[_0x9fab('0xf')][_0x9fab('0x11')]);return _0x128cba(_0x34031f[_0x9fab('0xf')][_0x9fab('0x11')]);}logger[_0x9fab('0xf')](_0x9fab('0x10'),_0x33b993,_0x34031f[_0x9fab('0xf')]['message']);return _0x57c861(_0x34031f['error']['message']);}else{logger[_0x9fab('0xd')]('Variable,\x20%s,\x20%s',_0x33b993,_0x9fab('0x12'));_0x57c861(_0x34031f[_0x9fab('0x13')][_0x9fab('0x11')]);}})['catch'](function(_0x3682a4){logger[_0x9fab('0xf')](_0x9fab('0x10'),_0x33b993,_0x3682a4);_0x128cba(_0x3682a4);});});}exports['ShowVariable']=function(_0x111de8){var _0x359d01=this;return new Promise(function(_0x22ade0,_0x2c132b){return db[_0x9fab('0x14')][_0x9fab('0x15')]({'raw':_0x111de8['options']?_0x111de8[_0x9fab('0x16')][_0x9fab('0x17')]===undefined?!![]:![]:!![],'where':_0x111de8[_0x9fab('0x16')]?_0x111de8[_0x9fab('0x16')][_0x9fab('0x18')]||null:null,'attributes':_0x111de8[_0x9fab('0x16')]?_0x111de8['options']['attributes']||null:null,'include':_0x111de8[_0x9fab('0x16')]?_0x111de8[_0x9fab('0x16')]['include']?_[_0x9fab('0x19')](_0x111de8[_0x9fab('0x16')][_0x9fab('0x1a')],function(_0x402dda){return{'model':db[_0x402dda[_0x9fab('0x1b')]],'as':_0x402dda['as'],'attributes':_0x402dda['attributes'],'include':_0x402dda[_0x9fab('0x1a')]?_['map'](_0x402dda['include'],function(_0x19dd6d){return{'model':db[_0x19dd6d[_0x9fab('0x1b')]],'as':_0x19dd6d['as'],'attributes':_0x19dd6d['attributes'],'include':_0x19dd6d['include']?_['map'](_0x19dd6d[_0x9fab('0x1a')],function(_0x5db946){return{'model':db[_0x5db946[_0x9fab('0x1b')]],'as':_0x5db946['as'],'attributes':_0x5db946[_0x9fab('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x9fab('0xc')](function(_0x40e938){logger[_0x9fab('0xd')]('ShowVariable',_0x111de8);logger[_0x9fab('0x1d')](_0x9fab('0x1e'),_0x111de8,JSON[_0x9fab('0x1f')](_0x40e938));_0x22ade0(_0x40e938);})['catch'](function(_0x25a5a2){logger[_0x9fab('0xf')](_0x9fab('0x1e'),_0x25a5a2['message'],_0x111de8);_0x2c132b(_0x359d01[_0x9fab('0xf')](0x1f4,_0x25a5a2[_0x9fab('0x11')]));});});}; \ No newline at end of file +var _0x699f=['util','bluebird','randomstring','ioredis','../../config/utils','client','http','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowVariable','Variable','find','options','raw','attributes','include','map','model','debug','lodash'];(function(_0x52a83e,_0x1a1894){var _0x2cddf4=function(_0xa890cf){while(--_0xa890cf){_0x52a83e['push'](_0x52a83e['shift']());}};_0x2cddf4(++_0x1a1894);}(_0x699f,0x12b));var _0xf699=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0x699f[_0x5f309e];return _0x487b5e;};'use strict';var _=require(_0xf699('0x0'));var util=require(_0xf699('0x1'));var moment=require('moment');var BPromise=require(_0xf699('0x2'));var rs=require(_0xf699('0x3'));var fs=require('fs');var Redis=require(_0xf699('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf699('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf699('0x6')][_0xf699('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x527517,_0x3fd227,_0x246cea){return new BPromise(function(_0xee99fc,_0x12e872){return client[_0xf699('0x8')](_0x527517,_0x246cea)[_0xf699('0x9')](function(_0x506406){logger[_0xf699('0xa')](_0xf699('0xb'),_0x3fd227,_0xf699('0xc'));logger['debug'](_0xf699('0xd'),_0x3fd227,_0xf699('0xc'),JSON[_0xf699('0xe')](_0x506406));if(_0x506406[_0xf699('0xf')]){if(_0x506406[_0xf699('0xf')][_0xf699('0x10')]===0x1f4){logger[_0xf699('0xf')](_0xf699('0xb'),_0x3fd227,_0x506406['error'][_0xf699('0x11')]);return _0x12e872(_0x506406[_0xf699('0xf')][_0xf699('0x11')]);}logger['error']('Variable,\x20%s,\x20%s',_0x3fd227,_0x506406[_0xf699('0xf')][_0xf699('0x11')]);return _0xee99fc(_0x506406['error'][_0xf699('0x11')]);}else{logger[_0xf699('0xa')](_0xf699('0xb'),_0x3fd227,_0xf699('0xc'));_0xee99fc(_0x506406[_0xf699('0x12')]['message']);}})[_0xf699('0x13')](function(_0x4ad8a5){logger['error'](_0xf699('0xb'),_0x3fd227,_0x4ad8a5);_0x12e872(_0x4ad8a5);});});}exports[_0xf699('0x14')]=function(_0x308a15){var _0x25ad13=this;return new Promise(function(_0x2588d9,_0xad0900){return db[_0xf699('0x15')][_0xf699('0x16')]({'raw':_0x308a15[_0xf699('0x17')]?_0x308a15[_0xf699('0x17')][_0xf699('0x18')]===undefined?!![]:![]:!![],'where':_0x308a15[_0xf699('0x17')]?_0x308a15['options']['where']||null:null,'attributes':_0x308a15[_0xf699('0x17')]?_0x308a15[_0xf699('0x17')][_0xf699('0x19')]||null:null,'include':_0x308a15['options']?_0x308a15[_0xf699('0x17')][_0xf699('0x1a')]?_[_0xf699('0x1b')](_0x308a15[_0xf699('0x17')][_0xf699('0x1a')],function(_0x4d9004){return{'model':db[_0x4d9004['model']],'as':_0x4d9004['as'],'attributes':_0x4d9004[_0xf699('0x19')],'include':_0x4d9004[_0xf699('0x1a')]?_[_0xf699('0x1b')](_0x4d9004[_0xf699('0x1a')],function(_0x3483f5){return{'model':db[_0x3483f5[_0xf699('0x1c')]],'as':_0x3483f5['as'],'attributes':_0x3483f5[_0xf699('0x19')],'include':_0x3483f5[_0xf699('0x1a')]?_[_0xf699('0x1b')](_0x3483f5[_0xf699('0x1a')],function(_0x3488d5){return{'model':db[_0x3488d5[_0xf699('0x1c')]],'as':_0x3488d5['as'],'attributes':_0x3488d5[_0xf699('0x19')]};}):[]};}):[]};}):[]:[]})[_0xf699('0x9')](function(_0x408c39){logger[_0xf699('0xa')](_0xf699('0x14'),_0x308a15);logger[_0xf699('0x1d')](_0xf699('0x14'),_0x308a15,JSON[_0xf699('0xe')](_0x408c39));_0x2588d9(_0x408c39);})['catch'](function(_0x5dd2eb){logger[_0xf699('0xf')](_0xf699('0x14'),_0x5dd2eb[_0xf699('0x11')],_0x308a15);_0xad0900(_0x25ad13[_0xf699('0xf')](0x1f4,_0x5dd2eb[_0xf699('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 1fdb042..42e01b1 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 _0x08fd=['exports','express','Router','../../components/auth/service','./version.controller','index','isAuthenticated','canUpdate','fetch','get','/reset','reset','pull','/restart','/migrations'];(function(_0x544ad9,_0x8c5af8){var _0x54165b=function(_0x266756){while(--_0x266756){_0x544ad9['push'](_0x544ad9['shift']());}};_0x54165b(++_0x8c5af8);}(_0x08fd,0xa6));var _0xd08f=function(_0x55887f,_0x130da1){_0x55887f=_0x55887f-0x0;var _0x4b2ba7=_0x08fd[_0x55887f];return _0x4b2ba7;};'use strict';var express=require(_0xd08f('0x0'));var router=express[_0xd08f('0x1')]();var auth=require(_0xd08f('0x2'));var controller=require(_0xd08f('0x3'));router['get']('/',controller[_0xd08f('0x4')]);router['get']('/fetch',auth[_0xd08f('0x5')](),auth[_0xd08f('0x6')](),controller[_0xd08f('0x7')]);router[_0xd08f('0x8')](_0xd08f('0x9'),auth[_0xd08f('0x5')](),auth['canUpdate'](),controller[_0xd08f('0xa')]);router[_0xd08f('0x8')]('/pull',auth['isAuthenticated'](),auth[_0xd08f('0x6')](),controller[_0xd08f('0xb')]);router[_0xd08f('0x8')](_0xd08f('0xc'),auth[_0xd08f('0x5')](),controller['restart']);router['get'](_0xd08f('0xd'),controller['migrations']);module[_0xd08f('0xe')]=router; \ No newline at end of file +var _0x052c=['/restart','/migrations','migrations','exports','Router','../../components/auth/service','./version.controller','get','index','/fetch','isAuthenticated','canUpdate','fetch','/reset','reset','/pull'];(function(_0x28ab07,_0x134567){var _0x27317d=function(_0x363fef){while(--_0x363fef){_0x28ab07['push'](_0x28ab07['shift']());}};_0x27317d(++_0x134567);}(_0x052c,0x164));var _0xc052=function(_0x22b166,_0x7ff07c){_0x22b166=_0x22b166-0x0;var _0x2f8e9f=_0x052c[_0x22b166];return _0x2f8e9f;};'use strict';var express=require('express');var router=express[_0xc052('0x0')]();var auth=require(_0xc052('0x1'));var controller=require(_0xc052('0x2'));router[_0xc052('0x3')]('/',controller[_0xc052('0x4')]);router[_0xc052('0x3')](_0xc052('0x5'),auth[_0xc052('0x6')](),auth[_0xc052('0x7')](),controller[_0xc052('0x8')]);router[_0xc052('0x3')](_0xc052('0x9'),auth['isAuthenticated'](),auth[_0xc052('0x7')](),controller[_0xc052('0xa')]);router[_0xc052('0x3')](_0xc052('0xb'),auth[_0xc052('0x6')](),auth[_0xc052('0x7')](),controller['pull']);router['get'](_0xc052('0xc'),auth['isAuthenticated'](),controller['restart']);router[_0xc052('0x3')](_0xc052('0xd'),controller[_0xc052('0xe')]);module[_0xc052('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 195f35d..aa37979 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 _0xa30a=['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','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','version','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','update','root','index','exports','query','latest','status','json','fetch','origin','master','error','git\x20fetch','git\x20fetch\x20origin\x20master','reset','FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','info','restart','motion2','then','pm2\x20restart\x20motion\x20%s','catch','migrations','readdirSync','join','server','length','.js','push','Migration','sequelize','getQueryInterface'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0xa30a,0xd7));var _0xaa30=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa30a[_0x14add3];return _0x4a174f;};'use strict';var Umzug=require(_0xaa30('0x0'));var path=require(_0xaa30('0x1'));var fs=require('fs');var _=require(_0xaa30('0x2'));var pkginfo=require('pkginfo')(module,_0xaa30('0x3'));var compareVersions=require(_0xaa30('0x4'));var exec=require(_0xaa30('0x5'))[_0xaa30('0x6')];var db=require(_0xaa30('0x7'))['db'];var config=require(_0xaa30('0x8'));var pm2=require(_0xaa30('0x9'));var logger=require('../../config/logger')(_0xaa30('0xa'));var git=require('simple-git')(config[_0xaa30('0xb')]);exports[_0xaa30('0xc')]=function(_0x42dc22,_0x5d076a){var _0xedbc45={'current':module[_0xaa30('0xd')][_0xaa30('0x3')],'phonebar':0x2};if(_0x42dc22[_0xaa30('0xe')]&&_0x42dc22[_0xaa30('0xe')][_0xaa30('0xf')]){return git['fetch']()['tags'](function(_0x12a8ce,_0x4874fe){_0xedbc45[_0xaa30('0xf')]=(_0x12a8ce?module[_0xaa30('0xd')][_0xaa30('0x3')]:_0x4874fe[_0xaa30('0xf')])||'2.0.0';return _0x5d076a[_0xaa30('0x10')](0xc8)[_0xaa30('0x11')](_0xedbc45);});}else{return _0x5d076a[_0xaa30('0x10')](0xc8)['json'](_0xedbc45);}};exports[_0xaa30('0x12')]=function(_0xdea23a,_0x25c02e){return git[_0xaa30('0x12')]([_0xaa30('0x13'),_0xaa30('0x14')],function(_0x3240e9){if(_0x3240e9){logger[_0xaa30('0x15')](_0x3240e9);return _0x25c02e[_0xaa30('0x10')](0x1f4)[_0xaa30('0x11')](_0x3240e9);}logger['info'](_0xaa30('0x16'));return _0x25c02e['status'](0xc8)['json']({'output':_0xaa30('0x17')});});};exports[_0xaa30('0x18')]=function(_0x130606,_0x540e36){return git['reset'](['--hard',_0xaa30('0x19')],function(_0x4acdfa){if(_0x4acdfa){logger[_0xaa30('0x15')](_0x4acdfa);return _0x540e36[_0xaa30('0x10')](0x1f4)['json'](_0x4acdfa);}logger['info']('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x540e36[_0xaa30('0x10')](0xc8)[_0xaa30('0x11')]({'output':_0xaa30('0x1a')});});};exports[_0xaa30('0x1b')]=function(_0x43a526,_0x4aacfd){exec(_0xaa30('0x1c'),function(_0x24bb25,_0x2e16e7,_0x2d9e35){logger[_0xaa30('0x1d')](_0x2e16e7);logger['info'](_0x2d9e35);if(_0x24bb25){logger[_0xaa30('0x15')](_0x24bb25);return _0x4aacfd[_0xaa30('0x10')](0x1f4)[_0xaa30('0x11')](_0x24bb25);}return _0x4aacfd[_0xaa30('0x10')](0xc8)['json']({'output':_0x2e16e7});});};exports[_0xaa30('0x1e')]=function(_0x1be54c,_0x19ba52){return pm2[_0xaa30('0x1e')](_0xaa30('0x1f'))[_0xaa30('0x20')](function(_0x55cccb){logger[_0xaa30('0x1d')](_0xaa30('0x21'),_0x55cccb);return _0x19ba52['status'](0xc8)[_0xaa30('0x11')]({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})[_0xaa30('0x22')](function(_0x33a0c9){logger[_0xaa30('0x15')](_0x33a0c9);return _0x19ba52[_0xaa30('0x10')](0x1f4)[_0xaa30('0x11')](_0x33a0c9);});};exports[_0xaa30('0x23')]=function(_0x6ff09a,_0x39f708){var _0x1f288c=fs[_0xaa30('0x24')](path[_0xaa30('0x25')](config[_0xaa30('0xb')],_0xaa30('0x26'),_0xaa30('0x23')));var _0x40e4ee=[];for(var _0x1a3f64=0x0;_0x1a3f64<_0x1f288c[_0xaa30('0x27')];_0x1a3f64++){var _0x1fa8d4=_0x1f288c[_0x1a3f64]['replace'](_0xaa30('0x28'),'');if(compareVersions(module[_0xaa30('0xd')][_0xaa30('0x3')],_0x1fa8d4)===-0x1){_0x40e4ee[_0xaa30('0x29')](_0x1fa8d4);}}if(_0x40e4ee[_0xaa30('0x27')]){var _0x1dce4a=_0x40e4ee['sort'](compareVersions);var _0x5addbf=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0xaa30('0x2a')],'modelName':_0xaa30('0x2a'),'columnName':_0xaa30('0x3')},'migrations':{'params':[db[_0xaa30('0x2b')][_0xaa30('0x2c')](),db['sequelize']['constructor'],function(){throw new Error(_0xaa30('0x2d'));}],'path':path[_0xaa30('0x25')](config['root'],_0xaa30('0x26'),'migrations'),'pattern':/\.js$/}});_0x5addbf['up']({'migrations':_[_0xaa30('0x2e')](_0x1dce4a,function(_0x5241d2){return _0x5241d2+_0xaa30('0x28');})})[_0xaa30('0x20')](function(){return _0x39f708['status'](0xc8)[_0xaa30('0x11')]({'output':_0xaa30('0x2f')+module[_0xaa30('0xd')][_0xaa30('0x3')]+_0xaa30('0x30')+_[_0xaa30('0x31')](_0x1dce4a),'migrations':_['join'](_0x1dce4a)});})[_0xaa30('0x22')](function(_0x1a2af6){if(_0x1a2af6 instanceof db['sequelize'][_0xaa30('0x32')]){return _0x39f708[_0xaa30('0x10')](0xc8)[_0xaa30('0x11')]({'output':'Database\x20already\x20up-to-date'});}else{return _0x39f708['status'](0x1f4)[_0xaa30('0x11')](_0x1a2af6);}});}else{return _0x39f708[_0xaa30('0x10')](0xc8)[_0xaa30('0x11')]({'output':_0xaa30('0x33')});}}; \ No newline at end of file +var _0xcaaf=['catch','UniqueConstraintError','umzug','lodash','compare-versions','child_process','../../mysqldb','../../config/logger','update','simple-git','root','index','exports','query','latest','version','2.0.0','status','json','fetch','master','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','npm\x20install\x20--production','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','migrations','join','length','replace','.js','push','sort','Migration','sequelize','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','server','map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last'];(function(_0x352e09,_0x37a7da){var _0x1b7094=function(_0x561074){while(--_0x561074){_0x352e09['push'](_0x352e09['shift']());}};_0x1b7094(++_0x37a7da);}(_0xcaaf,0x66));var _0xfcaa=function(_0x4d5a1b,_0x3ead8d){_0x4d5a1b=_0x4d5a1b-0x0;var _0x336a44=_0xcaaf[_0x4d5a1b];return _0x336a44;};'use strict';var Umzug=require(_0xfcaa('0x0'));var path=require('path');var fs=require('fs');var _=require(_0xfcaa('0x1'));var pkginfo=require('pkginfo')(module,'version');var compareVersions=require(_0xfcaa('0x2'));var exec=require(_0xfcaa('0x3'))['exec'];var db=require(_0xfcaa('0x4'))['db'];var config=require('../../config/environment');var pm2=require('../../config/pm2');var logger=require(_0xfcaa('0x5'))(_0xfcaa('0x6'));var git=require(_0xfcaa('0x7'))(config[_0xfcaa('0x8')]);exports[_0xfcaa('0x9')]=function(_0x287c48,_0x15ef84){var _0x4ee7d3={'current':module[_0xfcaa('0xa')]['version'],'phonebar':0x2};if(_0x287c48[_0xfcaa('0xb')]&&_0x287c48['query'][_0xfcaa('0xc')]){return git['fetch']()['tags'](function(_0x345e39,_0x4bf6dd){_0x4ee7d3[_0xfcaa('0xc')]=(_0x345e39?module[_0xfcaa('0xa')][_0xfcaa('0xd')]:_0x4bf6dd[_0xfcaa('0xc')])||_0xfcaa('0xe');return _0x15ef84[_0xfcaa('0xf')](0xc8)[_0xfcaa('0x10')](_0x4ee7d3);});}else{return _0x15ef84[_0xfcaa('0xf')](0xc8)['json'](_0x4ee7d3);}};exports[_0xfcaa('0x11')]=function(_0xf92410,_0x129b69){return git[_0xfcaa('0x11')](['origin',_0xfcaa('0x12')],function(_0x26328d){if(_0x26328d){logger[_0xfcaa('0x13')](_0x26328d);return _0x129b69[_0xfcaa('0xf')](0x1f4)['json'](_0x26328d);}logger[_0xfcaa('0x14')](_0xfcaa('0x15'));return _0x129b69[_0xfcaa('0xf')](0xc8)['json']({'output':_0xfcaa('0x16')});});};exports[_0xfcaa('0x17')]=function(_0x5c0705,_0x4202dc){return git['reset'](['--hard',_0xfcaa('0x18')],function(_0x327f31){if(_0x327f31){logger[_0xfcaa('0x13')](_0x327f31);return _0x4202dc[_0xfcaa('0xf')](0x1f4)[_0xfcaa('0x10')](_0x327f31);}logger[_0xfcaa('0x14')](_0xfcaa('0x19'));return _0x4202dc[_0xfcaa('0xf')](0xc8)[_0xfcaa('0x10')]({'output':_0xfcaa('0x1a')});});};exports['pull']=function(_0x36791f,_0x3d4f89){exec(_0xfcaa('0x1b'),function(_0xc7622,_0xcc1c83,_0x4416ed){logger[_0xfcaa('0x14')](_0xcc1c83);logger[_0xfcaa('0x14')](_0x4416ed);if(_0xc7622){logger[_0xfcaa('0x13')](_0xc7622);return _0x3d4f89['status'](0x1f4)[_0xfcaa('0x10')](_0xc7622);}return _0x3d4f89[_0xfcaa('0xf')](0xc8)[_0xfcaa('0x10')]({'output':_0xcc1c83});});};exports['restart']=function(_0x1d8e09,_0x59c206){return pm2[_0xfcaa('0x1c')](_0xfcaa('0x1d'))[_0xfcaa('0x1e')](function(_0x2c868a){logger[_0xfcaa('0x14')](_0xfcaa('0x1f'),_0x2c868a);return _0x59c206[_0xfcaa('0xf')](0xc8)[_0xfcaa('0x10')]({'output':_0xfcaa('0x20')});})['catch'](function(_0x55f9c9){logger['error'](_0x55f9c9);return _0x59c206['status'](0x1f4)[_0xfcaa('0x10')](_0x55f9c9);});};exports[_0xfcaa('0x21')]=function(_0x545180,_0xa4390a){var _0x4605b5=fs['readdirSync'](path[_0xfcaa('0x22')](config['root'],'server',_0xfcaa('0x21')));var _0x33a478=[];for(var _0x37bc0f=0x0;_0x37bc0f<_0x4605b5[_0xfcaa('0x23')];_0x37bc0f++){var _0x4c8029=_0x4605b5[_0x37bc0f][_0xfcaa('0x24')](_0xfcaa('0x25'),'');if(compareVersions(module['exports'][_0xfcaa('0xd')],_0x4c8029)===-0x1){_0x33a478[_0xfcaa('0x26')](_0x4c8029);}}if(_0x33a478[_0xfcaa('0x23')]){var _0x1c6938=_0x33a478[_0xfcaa('0x27')](compareVersions);var _0x2b2a2d=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0xfcaa('0x28')],'modelName':_0xfcaa('0x28'),'columnName':_0xfcaa('0xd')},'migrations':{'params':[db[_0xfcaa('0x29')]['getQueryInterface'](),db[_0xfcaa('0x29')]['constructor'],function(){throw new Error(_0xfcaa('0x2a'));}],'path':path['join'](config[_0xfcaa('0x8')],_0xfcaa('0x2b'),_0xfcaa('0x21')),'pattern':/\.js$/}});_0x2b2a2d['up']({'migrations':_[_0xfcaa('0x2c')](_0x1c6938,function(_0xc2d8b5){return _0xc2d8b5+_0xfcaa('0x25');})})['then'](function(){return _0xa4390a[_0xfcaa('0xf')](0xc8)[_0xfcaa('0x10')]({'output':_0xfcaa('0x2d')+module[_0xfcaa('0xa')][_0xfcaa('0xd')]+_0xfcaa('0x2e')+_[_0xfcaa('0x2f')](_0x1c6938),'migrations':_[_0xfcaa('0x22')](_0x1c6938)});})[_0xfcaa('0x30')](function(_0x2d9faf){if(_0x2d9faf instanceof db[_0xfcaa('0x29')][_0xfcaa('0x31')]){return _0xa4390a[_0xfcaa('0xf')](0xc8)[_0xfcaa('0x10')]({'output':'Database\x20already\x20up-to-date'});}else{return _0xa4390a['status'](0x1f4)[_0xfcaa('0x10')](_0x2d9faf);}});}else{return _0xa4390a['status'](0xc8)[_0xfcaa('0x10')]({'output':'Database\x20already\x20up-to-date'});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 22b2ee1..ed1cdea 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 _0x4d47=['../../components/auth/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','post','create','put','update','delete','destroy','util','path','connect-timeout','Router'];(function(_0x5c81f8,_0x11e954){var _0x5176c9=function(_0xc9a50f){while(--_0xc9a50f){_0x5c81f8['push'](_0x5c81f8['shift']());}};_0x5176c9(++_0x11e954);}(_0x4d47,0x7a));var _0x74d4=function(_0x286325,_0x4d5b65){_0x286325=_0x286325-0x0;var _0x4c8939=_0x4d47[_0x286325];return _0x4c8939;};'use strict';var multer=require('multer');var util=require(_0x74d4('0x0'));var path=require(_0x74d4('0x1'));var timeout=require(_0x74d4('0x2'));var express=require('express');var router=express[_0x74d4('0x3')]();var auth=require(_0x74d4('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x74d4('0x5'));var controller=require('./voiceAgentReport.controller');router[_0x74d4('0x6')]('/',auth[_0x74d4('0x7')](),controller[_0x74d4('0x8')]);router[_0x74d4('0x6')]('/describe',auth['isAuthenticated'](),controller[_0x74d4('0x9')]);router[_0x74d4('0x6')](_0x74d4('0xa'),auth[_0x74d4('0x7')](),controller[_0x74d4('0xb')]);router[_0x74d4('0xc')]('/',auth[_0x74d4('0x7')](),controller[_0x74d4('0xd')]);router[_0x74d4('0xe')](_0x74d4('0xa'),auth[_0x74d4('0x7')](),controller[_0x74d4('0xf')]);router[_0x74d4('0x10')]('/:id',auth[_0x74d4('0x7')](),controller[_0x74d4('0x11')]);module['exports']=router; \ No newline at end of file +var _0x5c78=['multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','isAuthenticated','index','get','describe','show','put','/:id','update','destroy','exports'];(function(_0xf46a82,_0x7002d6){var _0x5befba=function(_0x316463){while(--_0x316463){_0xf46a82['push'](_0xf46a82['shift']());}};_0x5befba(++_0x7002d6);}(_0x5c78,0x1db));var _0x85c7=function(_0x189048,_0x536f68){_0x189048=_0x189048-0x0;var _0x53d02c=_0x5c78[_0x189048];return _0x53d02c;};'use strict';var multer=require(_0x85c7('0x0'));var util=require(_0x85c7('0x1'));var path=require(_0x85c7('0x2'));var timeout=require(_0x85c7('0x3'));var express=require(_0x85c7('0x4'));var router=express[_0x85c7('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x85c7('0x6'));var config=require(_0x85c7('0x7'));var controller=require(_0x85c7('0x8'));router['get']('/',auth[_0x85c7('0x9')](),controller[_0x85c7('0xa')]);router[_0x85c7('0xb')]('/describe',auth[_0x85c7('0x9')](),controller[_0x85c7('0xc')]);router[_0x85c7('0xb')]('/:id',auth[_0x85c7('0x9')](),controller[_0x85c7('0xd')]);router['post']('/',auth[_0x85c7('0x9')](),controller['create']);router[_0x85c7('0xe')](_0x85c7('0xf'),auth[_0x85c7('0x9')](),controller[_0x85c7('0x10')]);router['delete'](_0x85c7('0xf'),auth[_0x85c7('0x9')](),controller[_0x85c7('0x11')]);module[_0x85c7('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index d6104b1..86de72d 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 _0x8d0e=['BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','INTEGER'];(function(_0x2f1952,_0x553d55){var _0x3e14d5=function(_0x18e80c){while(--_0x18e80c){_0x2f1952['push'](_0x2f1952['shift']());}};_0x3e14d5(++_0x553d55);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x51109f,_0x4e720d){_0x51109f=_0x51109f-0x0;var _0x16ae0a=_0x8d0e[_0x51109f];return _0x16ae0a;};'use strict';var Sequelize=require(_0xe8d0('0x0'));module[_0xe8d0('0x1')]={'type':{'type':Sequelize[_0xe8d0('0x2')]},'uniqueid':{'type':Sequelize[_0xe8d0('0x2')]},'calleridnum':{'type':Sequelize[_0xe8d0('0x2')]},'calleridname':{'type':Sequelize[_0xe8d0('0x2')]},'queue':{'type':Sequelize[_0xe8d0('0x2')]},'interface':{'type':Sequelize[_0xe8d0('0x2')]},'membername':{'type':Sequelize[_0xe8d0('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0xe8d0('0x3')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize[_0xe8d0('0x3')]},'holdtime':{'type':Sequelize[_0xe8d0('0x4')]},'agentcomplete':{'type':Sequelize[_0xe8d0('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xe8d0('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xe8d0('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xe8d0('0x4')]},'agentacw':{'type':Sequelize[_0xe8d0('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xe8d0('0x4')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize[_0xe8d0('0x2')]},'channel':{'type':Sequelize[_0xe8d0('0x2')]},'channelstate':{'type':Sequelize[_0xe8d0('0x4')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xe8d0('0x2')]},'language':{'type':Sequelize[_0xe8d0('0x2')]},'accountcode':{'type':Sequelize[_0xe8d0('0x2')]},'context':{'type':Sequelize[_0xe8d0('0x2')]},'exten':{'type':Sequelize[_0xe8d0('0x2')]},'priority':{'type':Sequelize[_0xe8d0('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xe8d0('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0xe8d0('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xe8d0('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0xe8d0('0x2')]},'destaccountcode':{'type':Sequelize[_0xe8d0('0x2')]},'destcontext':{'type':Sequelize[_0xe8d0('0x2')]},'destexten':{'type':Sequelize[_0xe8d0('0x2')]},'destpriority':{'type':Sequelize[_0xe8d0('0x2')]},'destuniqueid':{'type':Sequelize[_0xe8d0('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0xe8d0('0x2')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xe8d0('0x2')],'comment':_0xe8d0('0x6')},'transferexten':{'type':Sequelize[_0xe8d0('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x2bd8=['DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','STRING'];(function(_0x13b408,_0x56a8e6){var _0x274e77=function(_0x270781){while(--_0x270781){_0x13b408['push'](_0x13b408['shift']());}};_0x274e77(++_0x56a8e6);}(_0x2bd8,0x130));var _0x82bd=function(_0x19ea3d,_0x3d95ca){_0x19ea3d=_0x19ea3d-0x0;var _0x52a06e=_0x2bd8[_0x19ea3d];return _0x52a06e;};'use strict';var Sequelize=require(_0x82bd('0x0'));module['exports']={'type':{'type':Sequelize[_0x82bd('0x1')]},'uniqueid':{'type':Sequelize[_0x82bd('0x1')]},'calleridnum':{'type':Sequelize[_0x82bd('0x1')]},'calleridname':{'type':Sequelize[_0x82bd('0x1')]},'queue':{'type':Sequelize[_0x82bd('0x1')]},'interface':{'type':Sequelize[_0x82bd('0x1')]},'membername':{'type':Sequelize[_0x82bd('0x1')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x82bd('0x2')]},'agentcompleteAt':{'type':Sequelize[_0x82bd('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0x82bd('0x2')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x82bd('0x3')]},'agentcomplete':{'type':Sequelize[_0x82bd('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x82bd('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x82bd('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0x82bd('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x82bd('0x1')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x82bd('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x82bd('0x1')]},'context':{'type':Sequelize[_0x82bd('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x82bd('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x82bd('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x82bd('0x1')]},'destcalleridname':{'type':Sequelize[_0x82bd('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x82bd('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x82bd('0x1')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x82bd('0x1')]},'destcontext':{'type':Sequelize[_0x82bd('0x1')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x82bd('0x1')]},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x82bd('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0x82bd('0x1')]},'transfer':{'type':Sequelize[_0x82bd('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x82bd('0x1')],'comment':_0x82bd('0x5')},'transferexten':{'type':Sequelize[_0x82bd('0x1')]},'transferuniqueid':{'type':Sequelize[_0x82bd('0x1')]},'agententerreason':{'type':Sequelize[_0x82bd('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 8cec5cf..83a9f2c 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 _0x5976=['fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','include','catch','show','params','rawAttributes','includeAll','options','find','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','lodash','crypto','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','count','offset','limit','set','json','apply','reject','save','update','then','destroy','stack','name','send','index','map','VoiceAgentReport'];(function(_0x48602a,_0x36bb27){var _0x561495=function(_0x34855a){while(--_0x34855a){_0x48602a['push'](_0x48602a['shift']());}};_0x561495(++_0x36bb27);}(_0x5976,0x1b4));var _0x6597=function(_0x4fe38c,_0x336a7a){_0x4fe38c=_0x4fe38c-0x0;var _0x2133c4=_0x5976[_0x4fe38c];return _0x2133c4;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x6597('0x0'));var zipdir=require(_0x6597('0x1'));var jsonpatch=require(_0x6597('0x2'));var rp=require(_0x6597('0x3'));var moment=require('moment');var BPromise=require(_0x6597('0x4'));var Mustache=require('mustache');var util=require(_0x6597('0x5'));var path=require('path');var sox=require(_0x6597('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x6597('0x7'));var squel=require('squel');var crypto=require(_0x6597('0x8'));var jsforce=require(_0x6597('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x6597('0xa'));var querystring=require(_0x6597('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6597('0xc'));var qs=require(_0x6597('0xd'));var as=require(_0x6597('0xe'));var hardwareService=require(_0x6597('0xf'));var logger=require(_0x6597('0x10'))(_0x6597('0x11'));var utils=require(_0x6597('0x12'));var config=require(_0x6597('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x575e24,_0x11524d){_0x11524d=_0x11524d||0xcc;return function(_0x52987c){if(_0x52987c){return _0x575e24[_0x6597('0x14')](_0x11524d);}return _0x575e24[_0x6597('0x15')](_0x11524d)[_0x6597('0x16')]();};}function respondWithResult(_0x1a8f9b,_0x2ec51c){_0x2ec51c=_0x2ec51c||0xc8;return function(_0x1064aa){if(_0x1064aa){return _0x1a8f9b[_0x6597('0x15')](_0x2ec51c)['json'](_0x1064aa);}};}function respondWithFilteredResult(_0x31b487,_0x57b299){return function(_0x440e9d){if(_0x440e9d){var _0x58a073=_0x440e9d[_0x6597('0x17')],_0x3c8265=_0x57b299[_0x6597('0x18')],_0xc4f7f3=_0x57b299[_0x6597('0x18')]+_0x57b299[_0x6597('0x19')],_0x2a0dfd;if(_0xc4f7f3>=_0x58a073){_0xc4f7f3=_0x58a073;_0x2a0dfd=0xc8;}else{_0x2a0dfd=0xce;}_0x31b487[_0x6597('0x15')](_0x2a0dfd);return _0x31b487[_0x6597('0x1a')]('Content-Range',_0x3c8265+'-'+_0xc4f7f3+'/'+_0x58a073)[_0x6597('0x1b')](_0x440e9d);}return null;};}function patchUpdates(_0x160f66){return function(_0x4ef25c){try{jsonpatch[_0x6597('0x1c')](_0x4ef25c,_0x160f66,!![]);}catch(_0x3a33f9){return BPromise[_0x6597('0x1d')](_0x3a33f9);}return _0x4ef25c[_0x6597('0x1e')]();};}function saveUpdates(_0x31b6e3,_0xef731c){return function(_0xc74712){if(_0xc74712){return _0xc74712[_0x6597('0x1f')](_0x31b6e3)[_0x6597('0x20')](function(_0x4538c1){return _0x4538c1;});}return null;};}function removeEntity(_0x34bcaf,_0x3edbfe){return function(_0x28eb2e){if(_0x28eb2e){return _0x28eb2e[_0x6597('0x21')]()[_0x6597('0x20')](function(){_0x34bcaf['status'](0xcc)[_0x6597('0x16')]();});}};}function handleEntityNotFound(_0x989464,_0x6779ac){return function(_0x3370d4){if(!_0x3370d4){_0x989464[_0x6597('0x14')](0x194);}return _0x3370d4;};}function handleError(_0x47b225,_0x274c8c){_0x274c8c=_0x274c8c||0x1f4;return function(_0x168439){logger['error'](_0x168439[_0x6597('0x22')]);if(_0x168439[_0x6597('0x23')]){delete _0x168439['name'];}_0x47b225[_0x6597('0x15')](_0x274c8c)[_0x6597('0x24')](_0x168439);};}exports[_0x6597('0x25')]=function(_0x5e1efd,_0x5ea042){var _0x1bb1c5={},_0x217bb5={},_0x314130={'count':0x0,'rows':[]};var _0x2e5071=_[_0x6597('0x26')](db[_0x6597('0x27')]['rawAttributes'],function(_0x210a7e){return{'name':_0x210a7e[_0x6597('0x28')],'type':_0x210a7e[_0x6597('0x29')]['key']};});_0x217bb5[_0x6597('0x2a')]=_[_0x6597('0x26')](_0x2e5071,'name');_0x217bb5[_0x6597('0x2b')]=_[_0x6597('0x2c')](_0x5e1efd[_0x6597('0x2b')]);_0x217bb5[_0x6597('0x2d')]=_[_0x6597('0x2e')](_0x217bb5[_0x6597('0x2a')],_0x217bb5[_0x6597('0x2b')]);_0x1bb1c5[_0x6597('0x2f')]=_[_0x6597('0x2e')](_0x217bb5[_0x6597('0x2a')],qs['fields'](_0x5e1efd[_0x6597('0x2b')][_0x6597('0x30')]));_0x1bb1c5[_0x6597('0x2f')]=_0x1bb1c5['attributes'][_0x6597('0x31')]?_0x1bb1c5[_0x6597('0x2f')]:_0x217bb5[_0x6597('0x2a')];if(!_0x5e1efd[_0x6597('0x2b')][_0x6597('0x32')](_0x6597('0x33'))){_0x1bb1c5[_0x6597('0x19')]=qs['limit'](_0x5e1efd[_0x6597('0x2b')][_0x6597('0x19')]);_0x1bb1c5['offset']=qs[_0x6597('0x18')](_0x5e1efd[_0x6597('0x2b')][_0x6597('0x18')]);}_0x1bb1c5['order']=qs[_0x6597('0x34')](_0x5e1efd['query'][_0x6597('0x34')]);_0x1bb1c5[_0x6597('0x35')]=qs[_0x6597('0x2d')](_[_0x6597('0x36')](_0x5e1efd[_0x6597('0x2b')],_0x217bb5[_0x6597('0x2d')]));if(_0x5e1efd[_0x6597('0x2b')][_0x6597('0x37')]){_0x1bb1c5['where']=_[_0x6597('0x38')](_0x1bb1c5[_0x6597('0x35')],{'$or':_[_0x6597('0x26')](_0x2e5071,function(_0x410b2a){if(_0x410b2a[_0x6597('0x29')]!==_0x6597('0x39')){var _0x39d307={};_0x39d307[_0x410b2a['name']]={'$like':'%'+_0x5e1efd['query'][_0x6597('0x37')]+'%'};return _0x39d307;}})});}_0x1bb1c5=_[_0x6597('0x38')]({},_0x1bb1c5,_0x5e1efd['options']);var _0x5db948={'where':_0x1bb1c5['where']};return db[_0x6597('0x27')][_0x6597('0x17')](_0x5db948)[_0x6597('0x20')](function(_0x5f3984){_0x314130[_0x6597('0x17')]=_0x5f3984;if(_0x5e1efd['query']['includeAll']){_0x1bb1c5[_0x6597('0x3a')]=[{'all':!![]}];}return db['VoiceAgentReport']['findAll'](_0x1bb1c5);})[_0x6597('0x20')](function(_0x5a095a){_0x314130['rows']=_0x5a095a;return _0x314130;})[_0x6597('0x20')](respondWithFilteredResult(_0x5ea042,_0x1bb1c5))[_0x6597('0x3b')](handleError(_0x5ea042,null));};exports[_0x6597('0x3c')]=function(_0x2ee565,_0x3c4a34){var _0x284d03={'raw':![],'where':{'id':_0x2ee565[_0x6597('0x3d')]['id']}},_0x3d4e77={};_0x3d4e77['model']=_['keys'](db['VoiceAgentReport'][_0x6597('0x3e')]);_0x3d4e77[_0x6597('0x2b')]=_['keys'](_0x2ee565[_0x6597('0x2b')]);_0x3d4e77[_0x6597('0x2d')]=_[_0x6597('0x2e')](_0x3d4e77[_0x6597('0x2a')],_0x3d4e77[_0x6597('0x2b')]);_0x284d03[_0x6597('0x2f')]=_[_0x6597('0x2e')](_0x3d4e77[_0x6597('0x2a')],qs[_0x6597('0x30')](_0x2ee565[_0x6597('0x2b')]['fields']));_0x284d03[_0x6597('0x2f')]=_0x284d03[_0x6597('0x2f')]['length']?_0x284d03[_0x6597('0x2f')]:_0x3d4e77['model'];if(_0x2ee565[_0x6597('0x2b')][_0x6597('0x3f')]){_0x284d03[_0x6597('0x3a')]=[{'all':!![]}];}_0x284d03=_['merge']({},_0x284d03,_0x2ee565[_0x6597('0x40')]);return db[_0x6597('0x27')][_0x6597('0x41')](_0x284d03)[_0x6597('0x20')](handleEntityNotFound(_0x3c4a34,null))[_0x6597('0x20')](respondWithResult(_0x3c4a34,null))[_0x6597('0x3b')](handleError(_0x3c4a34,null));};exports['create']=function(_0x50150e,_0x45cdcf){return db[_0x6597('0x27')]['create'](_0x50150e[_0x6597('0x42')],{})[_0x6597('0x20')](respondWithResult(_0x45cdcf,0xc9))[_0x6597('0x3b')](handleError(_0x45cdcf,null));};exports[_0x6597('0x1f')]=function(_0x33fb37,_0x5bb108){if(_0x33fb37[_0x6597('0x42')]['id']){delete _0x33fb37['body']['id'];}return db[_0x6597('0x27')][_0x6597('0x41')]({'where':{'id':_0x33fb37[_0x6597('0x3d')]['id']}})[_0x6597('0x20')](handleEntityNotFound(_0x5bb108,null))[_0x6597('0x20')](saveUpdates(_0x33fb37[_0x6597('0x42')],null))['then'](respondWithResult(_0x5bb108,null))[_0x6597('0x3b')](handleError(_0x5bb108,null));};exports[_0x6597('0x21')]=function(_0x248852,_0x3c1d90){return db[_0x6597('0x27')][_0x6597('0x41')]({'where':{'id':_0x248852['params']['id']}})['then'](handleEntityNotFound(_0x3c1d90,null))['then'](removeEntity(_0x3c1d90,null))[_0x6597('0x3b')](handleError(_0x3c1d90,null));};exports[_0x6597('0x43')]=function(_0x3cffaa,_0xee9f59){return db[_0x6597('0x27')][_0x6597('0x43')]()[_0x6597('0x20')](respondWithResult(_0xee9f59,null))['catch'](handleError(_0xee9f59,null));}; \ No newline at end of file +var _0x25a4=['nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','then','rows','catch','show','params','keys','intersection','length','find','create','body','destroy','describe','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','save','update','error','stack','name','send','map','VoiceAgentReport','rawAttributes','fieldName','type','key','model','query','filters','attributes','fields','hasOwnProperty'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x25a4,0x64));var _0x425a=function(_0x577519,_0x346daf){_0x577519=_0x577519-0x0;var _0x5b12f7=_0x25a4[_0x577519];return _0x5b12f7;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x425a('0x0'));var rimraf=require(_0x425a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x425a('0x2'));var moment=require(_0x425a('0x3'));var BPromise=require(_0x425a('0x4'));var Mustache=require(_0x425a('0x5'));var util=require('util');var path=require(_0x425a('0x6'));var sox=require(_0x425a('0x7'));var csv=require(_0x425a('0x8'));var ejs=require(_0x425a('0x9'));var fs=require('fs');var _=require(_0x425a('0xa'));var squel=require(_0x425a('0xb'));var crypto=require(_0x425a('0xc'));var jsforce=require(_0x425a('0xd'));var deskjs=require(_0x425a('0xe'));var toCsv=require(_0x425a('0x8'));var querystring=require('querystring');var Papa=require(_0x425a('0xf'));var Redis=require(_0x425a('0x10'));var authService=require(_0x425a('0x11'));var qs=require(_0x425a('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x425a('0x13'));var logger=require('../../config/logger')(_0x425a('0x14'));var utils=require(_0x425a('0x15'));var config=require('../../config/environment');var db=require(_0x425a('0x16'))['db'];function respondWithStatusCode(_0x1f8905,_0x57ee6f){_0x57ee6f=_0x57ee6f||0xcc;return function(_0xf0779f){if(_0xf0779f){return _0x1f8905[_0x425a('0x17')](_0x57ee6f);}return _0x1f8905[_0x425a('0x18')](_0x57ee6f)[_0x425a('0x19')]();};}function respondWithResult(_0x5c232f,_0x2b0027){_0x2b0027=_0x2b0027||0xc8;return function(_0x13889b){if(_0x13889b){return _0x5c232f[_0x425a('0x18')](_0x2b0027)[_0x425a('0x1a')](_0x13889b);}};}function respondWithFilteredResult(_0x50bfc9,_0x3eac24){return function(_0x4f900e){if(_0x4f900e){var _0x561cba=_0x4f900e['count'],_0x20b349=_0x3eac24[_0x425a('0x1b')],_0x45bea8=_0x3eac24[_0x425a('0x1b')]+_0x3eac24[_0x425a('0x1c')],_0x488e7b;if(_0x45bea8>=_0x561cba){_0x45bea8=_0x561cba;_0x488e7b=0xc8;}else{_0x488e7b=0xce;}_0x50bfc9[_0x425a('0x18')](_0x488e7b);return _0x50bfc9[_0x425a('0x1d')](_0x425a('0x1e'),_0x20b349+'-'+_0x45bea8+'/'+_0x561cba)[_0x425a('0x1a')](_0x4f900e);}return null;};}function patchUpdates(_0x314389){return function(_0x4ae01e){try{jsonpatch[_0x425a('0x1f')](_0x4ae01e,_0x314389,!![]);}catch(_0x53aba4){return BPromise['reject'](_0x53aba4);}return _0x4ae01e[_0x425a('0x20')]();};}function saveUpdates(_0x7551ba,_0x2f0409){return function(_0x294cb9){if(_0x294cb9){return _0x294cb9[_0x425a('0x21')](_0x7551ba)['then'](function(_0x3899b0){return _0x3899b0;});}return null;};}function removeEntity(_0x372891,_0x41873d){return function(_0x11d12a){if(_0x11d12a){return _0x11d12a['destroy']()['then'](function(){_0x372891[_0x425a('0x18')](0xcc)[_0x425a('0x19')]();});}};}function handleEntityNotFound(_0x43e71f,_0x1e6534){return function(_0x25e6c9){if(!_0x25e6c9){_0x43e71f[_0x425a('0x17')](0x194);}return _0x25e6c9;};}function handleError(_0x55920d,_0x1d32b6){_0x1d32b6=_0x1d32b6||0x1f4;return function(_0x5dcfe4){logger[_0x425a('0x22')](_0x5dcfe4[_0x425a('0x23')]);if(_0x5dcfe4[_0x425a('0x24')]){delete _0x5dcfe4['name'];}_0x55920d['status'](_0x1d32b6)[_0x425a('0x25')](_0x5dcfe4);};}exports['index']=function(_0x33f602,_0x1cca3b){var _0x3e5421={},_0x38e2d7={},_0x2f70e9={'count':0x0,'rows':[]};var _0x156539=_[_0x425a('0x26')](db[_0x425a('0x27')][_0x425a('0x28')],function(_0x1ce648){return{'name':_0x1ce648[_0x425a('0x29')],'type':_0x1ce648[_0x425a('0x2a')][_0x425a('0x2b')]};});_0x38e2d7[_0x425a('0x2c')]=_[_0x425a('0x26')](_0x156539,_0x425a('0x24'));_0x38e2d7[_0x425a('0x2d')]=_['keys'](_0x33f602[_0x425a('0x2d')]);_0x38e2d7[_0x425a('0x2e')]=_['intersection'](_0x38e2d7[_0x425a('0x2c')],_0x38e2d7['query']);_0x3e5421[_0x425a('0x2f')]=_['intersection'](_0x38e2d7[_0x425a('0x2c')],qs[_0x425a('0x30')](_0x33f602[_0x425a('0x2d')][_0x425a('0x30')]));_0x3e5421[_0x425a('0x2f')]=_0x3e5421[_0x425a('0x2f')]['length']?_0x3e5421['attributes']:_0x38e2d7[_0x425a('0x2c')];if(!_0x33f602[_0x425a('0x2d')][_0x425a('0x31')](_0x425a('0x32'))){_0x3e5421[_0x425a('0x1c')]=qs[_0x425a('0x1c')](_0x33f602[_0x425a('0x2d')][_0x425a('0x1c')]);_0x3e5421[_0x425a('0x1b')]=qs[_0x425a('0x1b')](_0x33f602[_0x425a('0x2d')][_0x425a('0x1b')]);}_0x3e5421[_0x425a('0x33')]=qs[_0x425a('0x34')](_0x33f602[_0x425a('0x2d')][_0x425a('0x34')]);_0x3e5421[_0x425a('0x35')]=qs[_0x425a('0x2e')](_[_0x425a('0x36')](_0x33f602[_0x425a('0x2d')],_0x38e2d7['filters']));if(_0x33f602[_0x425a('0x2d')][_0x425a('0x37')]){_0x3e5421[_0x425a('0x35')]=_[_0x425a('0x38')](_0x3e5421[_0x425a('0x35')],{'$or':_[_0x425a('0x26')](_0x156539,function(_0x14acb7){if(_0x14acb7['type']!==_0x425a('0x39')){var _0x1d077a={};_0x1d077a[_0x14acb7['name']]={'$like':'%'+_0x33f602[_0x425a('0x2d')][_0x425a('0x37')]+'%'};return _0x1d077a;}})});}_0x3e5421=_[_0x425a('0x38')]({},_0x3e5421,_0x33f602[_0x425a('0x3a')]);var _0x1cee0d={'where':_0x3e5421['where']};return db[_0x425a('0x27')][_0x425a('0x3b')](_0x1cee0d)['then'](function(_0x48805f){_0x2f70e9[_0x425a('0x3b')]=_0x48805f;if(_0x33f602['query'][_0x425a('0x3c')]){_0x3e5421[_0x425a('0x3d')]=[{'all':!![]}];}return db['VoiceAgentReport']['findAll'](_0x3e5421);})[_0x425a('0x3e')](function(_0x278e12){_0x2f70e9[_0x425a('0x3f')]=_0x278e12;return _0x2f70e9;})['then'](respondWithFilteredResult(_0x1cca3b,_0x3e5421))[_0x425a('0x40')](handleError(_0x1cca3b,null));};exports[_0x425a('0x41')]=function(_0x5187dc,_0x58d698){var _0x5087cd={'raw':![],'where':{'id':_0x5187dc[_0x425a('0x42')]['id']}},_0x439fa8={};_0x439fa8[_0x425a('0x2c')]=_[_0x425a('0x43')](db[_0x425a('0x27')]['rawAttributes']);_0x439fa8[_0x425a('0x2d')]=_[_0x425a('0x43')](_0x5187dc['query']);_0x439fa8['filters']=_['intersection'](_0x439fa8[_0x425a('0x2c')],_0x439fa8[_0x425a('0x2d')]);_0x5087cd[_0x425a('0x2f')]=_[_0x425a('0x44')](_0x439fa8['model'],qs[_0x425a('0x30')](_0x5187dc[_0x425a('0x2d')][_0x425a('0x30')]));_0x5087cd[_0x425a('0x2f')]=_0x5087cd['attributes'][_0x425a('0x45')]?_0x5087cd[_0x425a('0x2f')]:_0x439fa8['model'];if(_0x5187dc[_0x425a('0x2d')][_0x425a('0x3c')]){_0x5087cd[_0x425a('0x3d')]=[{'all':!![]}];}_0x5087cd=_[_0x425a('0x38')]({},_0x5087cd,_0x5187dc[_0x425a('0x3a')]);return db['VoiceAgentReport'][_0x425a('0x46')](_0x5087cd)[_0x425a('0x3e')](handleEntityNotFound(_0x58d698,null))['then'](respondWithResult(_0x58d698,null))[_0x425a('0x40')](handleError(_0x58d698,null));};exports[_0x425a('0x47')]=function(_0x1945d7,_0x3093a9){return db[_0x425a('0x27')][_0x425a('0x47')](_0x1945d7['body'],{})[_0x425a('0x3e')](respondWithResult(_0x3093a9,0xc9))[_0x425a('0x40')](handleError(_0x3093a9,null));};exports['update']=function(_0x1e717c,_0x4bf19c){if(_0x1e717c[_0x425a('0x48')]['id']){delete _0x1e717c['body']['id'];}return db[_0x425a('0x27')][_0x425a('0x46')]({'where':{'id':_0x1e717c[_0x425a('0x42')]['id']}})[_0x425a('0x3e')](handleEntityNotFound(_0x4bf19c,null))[_0x425a('0x3e')](saveUpdates(_0x1e717c[_0x425a('0x48')],null))[_0x425a('0x3e')](respondWithResult(_0x4bf19c,null))['catch'](handleError(_0x4bf19c,null));};exports[_0x425a('0x49')]=function(_0x5618b8,_0x417cd2){return db[_0x425a('0x27')][_0x425a('0x46')]({'where':{'id':_0x5618b8[_0x425a('0x42')]['id']}})[_0x425a('0x3e')](handleEntityNotFound(_0x417cd2,null))[_0x425a('0x3e')](removeEntity(_0x417cd2,null))[_0x425a('0x40')](handleError(_0x417cd2,null));};exports[_0x425a('0x4a')]=function(_0x4ac05f,_0x2dd12e){return db[_0x425a('0x27')]['describe']()[_0x425a('0x3e')](respondWithResult(_0x2dd12e,null))[_0x425a('0x40')](handleError(_0x2dd12e,null));}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.model.js b/server/api/voiceAgentReport/voiceAgentReport.model.js index f0562ca..0960a1f 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 _0x27ff=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent','uniqueid'];(function(_0x102e37,_0x14a181){var _0x35a07c=function(_0x16577f){while(--_0x16577f){_0x102e37['push'](_0x102e37['shift']());}};_0x35a07c(++_0x14a181);}(_0x27ff,0x78));var _0xf27f=function(_0x3564d6,_0x37d1cb){_0x3564d6=_0x3564d6-0x0;var _0x1f2267=_0x27ff[_0x3564d6];return _0x1f2267;};'use strict';var _=require(_0xf27f('0x0'));var util=require('util');var logger=require(_0xf27f('0x1'))(_0xf27f('0x2'));var moment=require(_0xf27f('0x3'));var BPromise=require(_0xf27f('0x4'));var rp=require(_0xf27f('0x5'));var fs=require('fs');var path=require(_0xf27f('0x6'));var rimraf=require(_0xf27f('0x7'));var config=require(_0xf27f('0x8'));var attributes=require(_0xf27f('0x9'));module[_0xf27f('0xa')]=function(_0x10f950,_0x262024){return _0x10f950[_0xf27f('0xb')](_0xf27f('0xc'),attributes,{'tableName':_0xf27f('0xd'),'paranoid':![],'indexes':[{'fields':[_0xf27f('0xe'),'destuniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xd159=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceAgentReport.attributes','VoiceAgentReport','report_agent','uniqueid','destuniqueid','lodash','util','../../config/logger'];(function(_0x5ca669,_0x281a47){var _0x3efaa3=function(_0xecece0){while(--_0xecece0){_0x5ca669['push'](_0x5ca669['shift']());}};_0x3efaa3(++_0x281a47);}(_0xd159,0xed));var _0x9d15=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xd159[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x9d15('0x0'));var util=require(_0x9d15('0x1'));var logger=require(_0x9d15('0x2'))(_0x9d15('0x3'));var moment=require(_0x9d15('0x4'));var BPromise=require(_0x9d15('0x5'));var rp=require(_0x9d15('0x6'));var fs=require('fs');var path=require(_0x9d15('0x7'));var rimraf=require(_0x9d15('0x8'));var config=require(_0x9d15('0x9'));var attributes=require(_0x9d15('0xa'));module['exports']=function(_0x284833,_0x21398a){return _0x284833['define'](_0x9d15('0xb'),attributes,{'tableName':_0x9d15('0xc'),'paranoid':![],'indexes':[{'fields':[_0x9d15('0xd'),_0x9d15('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index ae2e277..691fdcf 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 _0x96b1=['moment','ioredis','../../config/utils','../../config/logger','jayson/promise','then','info','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceAgentReport,\x20%s,\x20%s','message','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','UpdateVoiceAgentReport','update','attributes','lodash','util'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x96b1,0x116));var _0x196b=function(_0x5e2cb4,_0x592c64){_0x5e2cb4=_0x5e2cb4-0x0;var _0x282902=_0x96b1[_0x5e2cb4];return _0x282902;};'use strict';var _=require(_0x196b('0x0'));var util=require(_0x196b('0x1'));var moment=require(_0x196b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x196b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x196b('0x4'));var logger=require(_0x196b('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x196b('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xd4dc11,_0x3059a3,_0x9b72b8){return new BPromise(function(_0x240378,_0x3b9f5b){return client['request'](_0xd4dc11,_0x9b72b8)[_0x196b('0x7')](function(_0x23682d){logger[_0x196b('0x8')]('VoiceAgentReport,\x20%s,\x20%s',_0x3059a3,_0x196b('0x9'));logger[_0x196b('0xa')](_0x196b('0xb'),_0x3059a3,_0x196b('0x9'),JSON[_0x196b('0xc')](_0x23682d));if(_0x23682d[_0x196b('0xd')]){if(_0x23682d[_0x196b('0xd')][_0x196b('0xe')]===0x1f4){logger['error'](_0x196b('0xf'),_0x3059a3,_0x23682d[_0x196b('0xd')][_0x196b('0x10')]);return _0x3b9f5b(_0x23682d['error'][_0x196b('0x10')]);}logger[_0x196b('0xd')](_0x196b('0xf'),_0x3059a3,_0x23682d['error'][_0x196b('0x10')]);return _0x240378(_0x23682d[_0x196b('0xd')][_0x196b('0x10')]);}else{logger[_0x196b('0x8')](_0x196b('0xf'),_0x3059a3,_0x196b('0x9'));_0x240378(_0x23682d[_0x196b('0x11')][_0x196b('0x10')]);}})[_0x196b('0x12')](function(_0x51df6a){logger[_0x196b('0xd')]('VoiceAgentReport,\x20%s,\x20%s',_0x3059a3,_0x51df6a);_0x3b9f5b(_0x51df6a);});});}exports[_0x196b('0x13')]=function(_0x50dd6c){var _0x17d3c5=this;return new Promise(function(_0x23d47b,_0x193275){return db[_0x196b('0x14')][_0x196b('0x15')](_0x50dd6c[_0x196b('0x16')],{'raw':_0x50dd6c['options']?_0x50dd6c[_0x196b('0x17')][_0x196b('0x18')]===undefined?!![]:![]:!![]})[_0x196b('0x7')](function(_0x3e41c7){logger[_0x196b('0x8')](_0x196b('0x13'),_0x50dd6c);logger[_0x196b('0xa')](_0x196b('0x13'),_0x50dd6c,JSON['stringify'](_0x3e41c7));_0x23d47b(_0x3e41c7);})[_0x196b('0x12')](function(_0x86313f){logger[_0x196b('0xd')](_0x196b('0x13'),_0x86313f[_0x196b('0x10')],_0x50dd6c);_0x193275(_0x17d3c5[_0x196b('0xd')](0x1f4,_0x86313f[_0x196b('0x10')]));});});};exports[_0x196b('0x19')]=function(_0x562473){var _0x55b2d6=this;return new Promise(function(_0xe4e423,_0x4a0617){return db[_0x196b('0x14')][_0x196b('0x1a')](_0x562473[_0x196b('0x16')],{'raw':_0x562473[_0x196b('0x17')]?_0x562473['options'][_0x196b('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x562473[_0x196b('0x17')]?_0x562473[_0x196b('0x17')]['where']||null:null,'attributes':_0x562473[_0x196b('0x17')]?_0x562473['options'][_0x196b('0x1b')]||null:null,'limit':_0x562473[_0x196b('0x17')]?_0x562473[_0x196b('0x17')]['limit']||null:null})['then'](function(_0x1a1ff6){logger['info'](_0x196b('0x19'),_0x562473);logger[_0x196b('0xa')](_0x196b('0x19'),_0x562473,JSON[_0x196b('0xc')](_0x1a1ff6));_0xe4e423(_0x1a1ff6);})['catch'](function(_0x17960c){logger[_0x196b('0xd')](_0x196b('0x19'),_0x17960c[_0x196b('0x10')],_0x562473);_0x4a0617(_0x55b2d6[_0x196b('0xd')](0x1f4,_0x17960c['message']));});});}; \ No newline at end of file +var _0xaeb2=['debug','catch','UpdateVoiceAgentReport','VoiceAgentReport','update','attributes','limit','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CreateVoiceAgentReport','create','body','options','raw'];(function(_0x2d2ca2,_0x51873f){var _0x48489d=function(_0x1a2cf7){while(--_0x1a2cf7){_0x2d2ca2['push'](_0x2d2ca2['shift']());}};_0x48489d(++_0x51873f);}(_0xaeb2,0x8c));var _0x2aeb=function(_0x3a6e95,_0x6a6235){_0x3a6e95=_0x3a6e95-0x0;var _0x195e30=_0xaeb2[_0x3a6e95];return _0x195e30;};'use strict';var _=require(_0x2aeb('0x0'));var util=require(_0x2aeb('0x1'));var moment=require(_0x2aeb('0x2'));var BPromise=require(_0x2aeb('0x3'));var rs=require(_0x2aeb('0x4'));var fs=require('fs');var Redis=require(_0x2aeb('0x5'));var db=require(_0x2aeb('0x6'))['db'];var utils=require(_0x2aeb('0x7'));var logger=require(_0x2aeb('0x8'))(_0x2aeb('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2aeb('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5975e6,_0x4ab01f,_0x5cf075){return new BPromise(function(_0x1fd38b,_0x21ac50){return client[_0x2aeb('0xb')](_0x5975e6,_0x5cf075)['then'](function(_0x4e28e6){logger[_0x2aeb('0xc')](_0x2aeb('0xd'),_0x4ab01f,_0x2aeb('0xe'));logger['debug'](_0x2aeb('0xf'),_0x4ab01f,'request\x20sent',JSON[_0x2aeb('0x10')](_0x4e28e6));if(_0x4e28e6[_0x2aeb('0x11')]){if(_0x4e28e6[_0x2aeb('0x11')][_0x2aeb('0x12')]===0x1f4){logger[_0x2aeb('0x11')]('VoiceAgentReport,\x20%s,\x20%s',_0x4ab01f,_0x4e28e6[_0x2aeb('0x11')][_0x2aeb('0x13')]);return _0x21ac50(_0x4e28e6[_0x2aeb('0x11')][_0x2aeb('0x13')]);}logger[_0x2aeb('0x11')](_0x2aeb('0xd'),_0x4ab01f,_0x4e28e6[_0x2aeb('0x11')][_0x2aeb('0x13')]);return _0x1fd38b(_0x4e28e6['error'][_0x2aeb('0x13')]);}else{logger[_0x2aeb('0xc')](_0x2aeb('0xd'),_0x4ab01f,_0x2aeb('0xe'));_0x1fd38b(_0x4e28e6['result'][_0x2aeb('0x13')]);}})['catch'](function(_0x1b7e63){logger[_0x2aeb('0x11')](_0x2aeb('0xd'),_0x4ab01f,_0x1b7e63);_0x21ac50(_0x1b7e63);});});}exports[_0x2aeb('0x14')]=function(_0x180be3){var _0x435720=this;return new Promise(function(_0x2c71ff,_0x55c953){return db['VoiceAgentReport'][_0x2aeb('0x15')](_0x180be3[_0x2aeb('0x16')],{'raw':_0x180be3[_0x2aeb('0x17')]?_0x180be3[_0x2aeb('0x17')][_0x2aeb('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x3f7fe3){logger[_0x2aeb('0xc')](_0x2aeb('0x14'),_0x180be3);logger[_0x2aeb('0x19')]('CreateVoiceAgentReport',_0x180be3,JSON[_0x2aeb('0x10')](_0x3f7fe3));_0x2c71ff(_0x3f7fe3);})[_0x2aeb('0x1a')](function(_0x42d47d){logger[_0x2aeb('0x11')](_0x2aeb('0x14'),_0x42d47d[_0x2aeb('0x13')],_0x180be3);_0x55c953(_0x435720[_0x2aeb('0x11')](0x1f4,_0x42d47d[_0x2aeb('0x13')]));});});};exports[_0x2aeb('0x1b')]=function(_0x4d662e){var _0x2958cd=this;return new Promise(function(_0x3d3be1,_0x54b27a){return db[_0x2aeb('0x1c')][_0x2aeb('0x1d')](_0x4d662e[_0x2aeb('0x16')],{'raw':_0x4d662e['options']?_0x4d662e[_0x2aeb('0x17')][_0x2aeb('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4d662e[_0x2aeb('0x17')]?_0x4d662e[_0x2aeb('0x17')]['where']||null:null,'attributes':_0x4d662e['options']?_0x4d662e[_0x2aeb('0x17')][_0x2aeb('0x1e')]||null:null,'limit':_0x4d662e['options']?_0x4d662e[_0x2aeb('0x17')][_0x2aeb('0x1f')]||null:null})[_0x2aeb('0x20')](function(_0x26a9e8){logger[_0x2aeb('0xc')]('UpdateVoiceAgentReport',_0x4d662e);logger['debug'](_0x2aeb('0x1b'),_0x4d662e,JSON[_0x2aeb('0x10')](_0x26a9e8));_0x3d3be1(_0x26a9e8);})[_0x2aeb('0x1a')](function(_0x210362){logger[_0x2aeb('0x11')](_0x2aeb('0x1b'),_0x210362[_0x2aeb('0x13')],_0x4d662e);_0x54b27a(_0x2958cd[_0x2aeb('0x11')](0x1f4,_0x210362['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 0e54f8a..a3d5e56 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 _0xce9a=['get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','./voiceCallReport.controller'];(function(_0x26ced8,_0x66a949){var _0x47affa=function(_0x5c4186){while(--_0x5c4186){_0x26ced8['push'](_0x26ced8['shift']());}};_0x47affa(++_0x66a949);}(_0xce9a,0xb6));var _0xace9=function(_0x51bb16,_0x5e9c74){_0x51bb16=_0x51bb16-0x0;var _0x41e4e0=_0xce9a[_0x51bb16];return _0x41e4e0;};'use strict';var multer=require(_0xace9('0x0'));var util=require('util');var path=require(_0xace9('0x1'));var timeout=require(_0xace9('0x2'));var express=require(_0xace9('0x3'));var router=express[_0xace9('0x4')]();var auth=require(_0xace9('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xace9('0x6'));router[_0xace9('0x7')]('/',auth['isAuthenticated'](),controller[_0xace9('0x8')]);router[_0xace9('0x7')](_0xace9('0x9'),auth[_0xace9('0xa')](),controller[_0xace9('0xb')]);router['get'](_0xace9('0xc'),auth[_0xace9('0xa')](),controller[_0xace9('0xd')]);router[_0xace9('0xe')]('/',auth[_0xace9('0xa')](),controller[_0xace9('0xf')]);router[_0xace9('0x10')](_0xace9('0xc'),auth[_0xace9('0xa')](),controller[_0xace9('0x11')]);router[_0xace9('0x12')](_0xace9('0xc'),auth[_0xace9('0xa')](),controller[_0xace9('0x13')]);module[_0xace9('0x14')]=router; \ No newline at end of file +var _0xe97a=['isAuthenticated','index','describe','/:id','show','create','update','delete','destroy','multer','util','connect-timeout','Router','../../components/interaction/service','../../config/environment','get'];(function(_0x4a556e,_0x598482){var _0x313f82=function(_0x3d8f6f){while(--_0x3d8f6f){_0x4a556e['push'](_0x4a556e['shift']());}};_0x313f82(++_0x598482);}(_0xe97a,0xe9));var _0xae97=function(_0x1a887f,_0x28423c){_0x1a887f=_0x1a887f-0x0;var _0x1841ff=_0xe97a[_0x1a887f];return _0x1841ff;};'use strict';var multer=require(_0xae97('0x0'));var util=require(_0xae97('0x1'));var path=require('path');var timeout=require(_0xae97('0x2'));var express=require('express');var router=express[_0xae97('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xae97('0x4'));var config=require(_0xae97('0x5'));var controller=require('./voiceCallReport.controller');router[_0xae97('0x6')]('/',auth[_0xae97('0x7')](),controller[_0xae97('0x8')]);router[_0xae97('0x6')]('/describe',auth[_0xae97('0x7')](),controller[_0xae97('0x9')]);router[_0xae97('0x6')](_0xae97('0xa'),auth[_0xae97('0x7')](),controller[_0xae97('0xb')]);router['post']('/',auth[_0xae97('0x7')](),controller[_0xae97('0xc')]);router['put'](_0xae97('0xa'),auth[_0xae97('0x7')](),controller[_0xae97('0xd')]);router[_0xae97('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xae97('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 28fc18c..825c95b 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 _0xa9e0=['dialer','DATE','INTEGER','sequelize','exports','STRING','internal','inbound-fax','outbound-fax'];(function(_0x486b00,_0x501df5){var _0x47ea82=function(_0x997782){while(--_0x997782){_0x486b00['push'](_0x486b00['shift']());}};_0x47ea82(++_0x501df5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'uniqueid':{'type':Sequelize[_0x0a9e('0x2')]},'type':{'type':Sequelize['ENUM']('inbound',_0x0a9e('0x3'),'outbound',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'))},'tag':{'type':Sequelize[_0x0a9e('0x2')]},'accountcode':{'type':Sequelize[_0x0a9e('0x2')]},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize[_0x0a9e('0x2')]},'destinationcontext':{'type':Sequelize[_0x0a9e('0x2')]},'callerid':{'type':Sequelize[_0x0a9e('0x2')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0x0a9e('0x2')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0x0a9e('0x7')]},'answertime':{'type':Sequelize[_0x0a9e('0x7')]},'endtime':{'type':Sequelize[_0x0a9e('0x7')]},'duration':{'type':Sequelize[_0x0a9e('0x8')]},'billableseconds':{'type':Sequelize[_0x0a9e('0x8')]},'mohtime':{'type':Sequelize[_0x0a9e('0x8')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x0a9e('0x2')]},'prefix':{'type':Sequelize[_0x0a9e('0x2')]},'routeid':{'type':Sequelize[_0x0a9e('0x8')]},'sipcallid':{'type':Sequelize[_0x0a9e('0x2')]}}; \ No newline at end of file +var _0xa9e0=['dialer','DATE','INTEGER','sequelize','exports','STRING','internal','inbound-fax','outbound-fax'];(function(_0x3f52d9,_0x1d748c){var _0x21e01f=function(_0x22e584){while(--_0x22e584){_0x3f52d9['push'](_0x3f52d9['shift']());}};_0x21e01f(++_0x1d748c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'uniqueid':{'type':Sequelize[_0x0a9e('0x2')]},'type':{'type':Sequelize['ENUM']('inbound',_0x0a9e('0x3'),'outbound',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'))},'tag':{'type':Sequelize[_0x0a9e('0x2')]},'accountcode':{'type':Sequelize[_0x0a9e('0x2')]},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize[_0x0a9e('0x2')]},'destinationcontext':{'type':Sequelize[_0x0a9e('0x2')]},'callerid':{'type':Sequelize[_0x0a9e('0x2')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0x0a9e('0x2')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0x0a9e('0x7')]},'answertime':{'type':Sequelize[_0x0a9e('0x7')]},'endtime':{'type':Sequelize[_0x0a9e('0x7')]},'duration':{'type':Sequelize[_0x0a9e('0x8')]},'billableseconds':{'type':Sequelize[_0x0a9e('0x8')]},'mohtime':{'type':Sequelize[_0x0a9e('0x8')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x0a9e('0x2')]},'prefix':{'type':Sequelize[_0x0a9e('0x2')]},'routeid':{'type':Sequelize[_0x0a9e('0x8')]},'sipcallid':{'type':Sequelize[_0x0a9e('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 4637c51..fa824cc 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 _0x756a=['api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','set','reject','save','update','then','destroy','name','index','map','VoiceCallReport','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','options','count','includeAll','include','fullname','alias','User','findAll','rows','catch','show','params','rawAttributes','length','merge','find','create','body','describe','uniqueid','user','html-pdf','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x51ab83,_0x2721b9){var _0x14b6de=function(_0x243483){while(--_0x243483){_0x51ab83['push'](_0x51ab83['shift']());}};_0x14b6de(++_0x2721b9);}(_0x756a,0x172));var _0xa756=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0x756a[_0x2a6809];return _0x11c371;};'use strict';var pdf=require(_0xa756('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xa756('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa756('0x2'));var rp=require(_0xa756('0x3'));var moment=require(_0xa756('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa756('0x5'));var util=require(_0xa756('0x6'));var path=require(_0xa756('0x7'));var sox=require(_0xa756('0x8'));var csv=require('to-csv');var ejs=require(_0xa756('0x9'));var fs=require('fs');var _=require(_0xa756('0xa'));var squel=require('squel');var crypto=require(_0xa756('0xb'));var jsforce=require(_0xa756('0xc'));var deskjs=require(_0xa756('0xd'));var toCsv=require(_0xa756('0xe'));var querystring=require(_0xa756('0xf'));var Papa=require(_0xa756('0x10'));var Redis=require(_0xa756('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa756('0x12'));var hardwareService=require(_0xa756('0x13'));var logger=require('../../config/logger')(_0xa756('0x14'));var utils=require(_0xa756('0x15'));var config=require('../../config/environment');var db=require(_0xa756('0x16'))['db'];function respondWithStatusCode(_0x2f79d7,_0x32ac77){_0x32ac77=_0x32ac77||0xcc;return function(_0x3efc2d){if(_0x3efc2d){return _0x2f79d7[_0xa756('0x17')](_0x32ac77);}return _0x2f79d7[_0xa756('0x18')](_0x32ac77)[_0xa756('0x19')]();};}function respondWithResult(_0x31e456,_0x4ee837){_0x4ee837=_0x4ee837||0xc8;return function(_0x40e2c0){if(_0x40e2c0){return _0x31e456[_0xa756('0x18')](_0x4ee837)[_0xa756('0x1a')](_0x40e2c0);}};}function respondWithFilteredResult(_0x2f53dd,_0x15dcc0){return function(_0x539e28){if(_0x539e28){var _0x180443=_0x539e28['count'],_0x34e291=_0x15dcc0['offset'],_0x8602d3=_0x15dcc0[_0xa756('0x1b')]+_0x15dcc0['limit'],_0x4c6b9e;if(_0x8602d3>=_0x180443){_0x8602d3=_0x180443;_0x4c6b9e=0xc8;}else{_0x4c6b9e=0xce;}_0x2f53dd[_0xa756('0x18')](_0x4c6b9e);return _0x2f53dd[_0xa756('0x1c')]('Content-Range',_0x34e291+'-'+_0x8602d3+'/'+_0x180443)[_0xa756('0x1a')](_0x539e28);}return null;};}function patchUpdates(_0x462f93){return function(_0x312996){try{jsonpatch['apply'](_0x312996,_0x462f93,!![]);}catch(_0x588b7b){return BPromise[_0xa756('0x1d')](_0x588b7b);}return _0x312996[_0xa756('0x1e')]();};}function saveUpdates(_0x418333,_0x3fe213){return function(_0x18ada7){if(_0x18ada7){return _0x18ada7[_0xa756('0x1f')](_0x418333)[_0xa756('0x20')](function(_0x22331d){return _0x22331d;});}return null;};}function removeEntity(_0x18b952,_0x41f62f){return function(_0x3716b4){if(_0x3716b4){return _0x3716b4[_0xa756('0x21')]()[_0xa756('0x20')](function(){_0x18b952[_0xa756('0x18')](0xcc)[_0xa756('0x19')]();});}};}function handleEntityNotFound(_0x5b2fb8,_0x2aa78b){return function(_0x5a1410){if(!_0x5a1410){_0x5b2fb8['sendStatus'](0x194);}return _0x5a1410;};}function handleError(_0x5834dd,_0x41093c){_0x41093c=_0x41093c||0x1f4;return function(_0x9d725c){logger['error'](_0x9d725c['stack']);if(_0x9d725c['name']){delete _0x9d725c[_0xa756('0x22')];}_0x5834dd['status'](_0x41093c)['send'](_0x9d725c);};}exports[_0xa756('0x23')]=function(_0x27bc88,_0x420ccb){var _0x3da633={},_0x120f69={},_0x4e4c88={'count':0x0,'rows':[]};var _0x65f562=_[_0xa756('0x24')](db[_0xa756('0x25')]['rawAttributes'],function(_0x325ba3){return{'name':_0x325ba3[_0xa756('0x26')],'type':_0x325ba3[_0xa756('0x27')][_0xa756('0x28')]};});_0x120f69['model']=_[_0xa756('0x24')](_0x65f562,_0xa756('0x22'));_0x120f69[_0xa756('0x29')]=_[_0xa756('0x2a')](_0x27bc88[_0xa756('0x29')]);_0x120f69[_0xa756('0x2b')]=_['intersection'](_0x120f69[_0xa756('0x2c')],_0x120f69[_0xa756('0x29')]);_0x3da633[_0xa756('0x2d')]=_[_0xa756('0x2e')](_0x120f69['model'],qs[_0xa756('0x2f')](_0x27bc88[_0xa756('0x29')][_0xa756('0x2f')]));_0x3da633[_0xa756('0x2d')]=_0x3da633['attributes']['length']?_0x3da633[_0xa756('0x2d')]:_0x120f69[_0xa756('0x2c')];if(!_0x27bc88[_0xa756('0x29')][_0xa756('0x30')](_0xa756('0x31'))){_0x3da633[_0xa756('0x32')]=qs[_0xa756('0x32')](_0x27bc88[_0xa756('0x29')][_0xa756('0x32')]);_0x3da633[_0xa756('0x1b')]=qs[_0xa756('0x1b')](_0x27bc88[_0xa756('0x29')]['offset']);}_0x3da633[_0xa756('0x33')]=qs[_0xa756('0x34')](_0x27bc88[_0xa756('0x29')][_0xa756('0x34')]);_0x3da633[_0xa756('0x35')]=qs[_0xa756('0x2b')](_[_0xa756('0x36')](_0x27bc88[_0xa756('0x29')],_0x120f69[_0xa756('0x2b')]));if(_0x27bc88[_0xa756('0x29')][_0xa756('0x37')]){_0x3da633['where']=_['merge'](_0x3da633[_0xa756('0x35')],{'$or':_[_0xa756('0x24')](_0x65f562,function(_0x4edcda){if(_0x4edcda[_0xa756('0x27')]!==_0xa756('0x38')){var _0x2f201a={};_0x2f201a[_0x4edcda[_0xa756('0x22')]]={'$like':'%'+_0x27bc88['query'][_0xa756('0x37')]+'%'};return _0x2f201a;}})});}_0x3da633=_['merge']({},_0x3da633,_0x27bc88[_0xa756('0x39')]);var _0x1df000={'where':_0x3da633[_0xa756('0x35')]};return db[_0xa756('0x25')][_0xa756('0x3a')](_0x1df000)[_0xa756('0x20')](function(_0x162a75){_0x4e4c88[_0xa756('0x3a')]=_0x162a75;if(_0x27bc88[_0xa756('0x29')][_0xa756('0x3b')]){_0x3da633[_0xa756('0x3c')]=[{'attributes':['id',_0xa756('0x22'),_0xa756('0x3d'),_0xa756('0x3e')],'model':db['User'],'as':_0xa756('0x3f')}];}return db[_0xa756('0x25')][_0xa756('0x40')](_0x3da633);})['then'](function(_0x142e2c){_0x4e4c88[_0xa756('0x41')]=_0x142e2c;return _0x4e4c88;})[_0xa756('0x20')](respondWithFilteredResult(_0x420ccb,_0x3da633))[_0xa756('0x42')](handleError(_0x420ccb,null));};exports[_0xa756('0x43')]=function(_0x51748e,_0x1b8f32){var _0x429511={'raw':!![],'where':{'id':_0x51748e[_0xa756('0x44')]['id']}},_0x379ab3={};_0x379ab3['model']=_['keys'](db[_0xa756('0x25')][_0xa756('0x45')]);_0x379ab3[_0xa756('0x29')]=_[_0xa756('0x2a')](_0x51748e['query']);_0x379ab3['filters']=_[_0xa756('0x2e')](_0x379ab3['model'],_0x379ab3[_0xa756('0x29')]);_0x429511['attributes']=_['intersection'](_0x379ab3['model'],qs['fields'](_0x51748e[_0xa756('0x29')]['fields']));_0x429511[_0xa756('0x2d')]=_0x429511['attributes'][_0xa756('0x46')]?_0x429511[_0xa756('0x2d')]:_0x379ab3['model'];if(_0x51748e[_0xa756('0x29')][_0xa756('0x3b')]){_0x429511['include']=[{'all':!![]}];}_0x429511=_[_0xa756('0x47')]({},_0x429511,_0x51748e[_0xa756('0x39')]);return db[_0xa756('0x25')][_0xa756('0x48')](_0x429511)[_0xa756('0x20')](handleEntityNotFound(_0x1b8f32,null))[_0xa756('0x20')](respondWithResult(_0x1b8f32,null))[_0xa756('0x42')](handleError(_0x1b8f32,null));};exports['create']=function(_0x4d6bbd,_0xca81ad){return db[_0xa756('0x25')][_0xa756('0x49')](_0x4d6bbd[_0xa756('0x4a')],{})[_0xa756('0x20')](respondWithResult(_0xca81ad,0xc9))[_0xa756('0x42')](handleError(_0xca81ad,null));};exports[_0xa756('0x21')]=function(_0x586745,_0x294e0f){return db[_0xa756('0x25')][_0xa756('0x48')]({'where':{'id':_0x586745[_0xa756('0x44')]['id']}})[_0xa756('0x20')](handleEntityNotFound(_0x294e0f,null))[_0xa756('0x20')](removeEntity(_0x294e0f,null))['catch'](handleError(_0x294e0f,null));};exports['describe']=function(_0x6db6f5,_0x85dd93){return db[_0xa756('0x25')][_0xa756('0x4b')]()['then'](respondWithResult(_0x85dd93,null))['catch'](handleError(_0x85dd93,null));};exports[_0xa756('0x1f')]=function(_0x1cc6d7,_0x2d437e){if(_0x1cc6d7[_0xa756('0x4a')][_0xa756('0x4c')]){delete _0x1cc6d7[_0xa756('0x4a')]['uniqueid'];}return db[_0xa756('0x25')][_0xa756('0x48')]({'where':{'uniqueid':_0x1cc6d7['params']['id'],'UserId':{'$or':[null,_0x1cc6d7[_0xa756('0x4d')]['id']]}}})[_0xa756('0x20')](handleEntityNotFound(_0x2d437e,null))['then'](saveUpdates(_0x1cc6d7[_0xa756('0x4a')],null))[_0xa756('0x20')](respondWithResult(_0x2d437e,null))[_0xa756('0x42')](handleError(_0x2d437e,null));}; \ No newline at end of file +var _0xddcb=['error','stack','name','send','index','VoiceCallReport','fieldName','type','map','query','keys','filters','intersection','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','count','includeAll','include','fullname','alias','User','findAll','catch','show','params','rawAttributes','attributes','find','then','create','describe','body','uniqueid','user','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','apply','save','destroy'];(function(_0x550455,_0x1bd3ad){var _0x24683c=function(_0x241501){while(--_0x241501){_0x550455['push'](_0x550455['shift']());}};_0x24683c(++_0x1bd3ad);}(_0xddcb,0x7b));var _0xbddc=function(_0x48c9da,_0x1a1d87){_0x48c9da=_0x48c9da-0x0;var _0x54db8f=_0xddcb[_0x48c9da];return _0x54db8f;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xbddc('0x0'));var jsonpatch=require(_0xbddc('0x1'));var rp=require(_0xbddc('0x2'));var moment=require(_0xbddc('0x3'));var BPromise=require(_0xbddc('0x4'));var Mustache=require(_0xbddc('0x5'));var util=require(_0xbddc('0x6'));var path=require(_0xbddc('0x7'));var sox=require(_0xbddc('0x8'));var csv=require(_0xbddc('0x9'));var ejs=require(_0xbddc('0xa'));var fs=require('fs');var _=require(_0xbddc('0xb'));var squel=require(_0xbddc('0xc'));var crypto=require(_0xbddc('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbddc('0xe'));var Papa=require('papaparse');var Redis=require(_0xbddc('0xf'));var authService=require(_0xbddc('0x10'));var qs=require(_0xbddc('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbddc('0x12'));var logger=require(_0xbddc('0x13'))(_0xbddc('0x14'));var utils=require('../../config/utils');var config=require(_0xbddc('0x15'));var db=require(_0xbddc('0x16'))['db'];function respondWithStatusCode(_0x3207bd,_0x3d5337){_0x3d5337=_0x3d5337||0xcc;return function(_0x3949d9){if(_0x3949d9){return _0x3207bd[_0xbddc('0x17')](_0x3d5337);}return _0x3207bd[_0xbddc('0x18')](_0x3d5337)[_0xbddc('0x19')]();};}function respondWithResult(_0x1ed906,_0x4699c9){_0x4699c9=_0x4699c9||0xc8;return function(_0xb7fece){if(_0xb7fece){return _0x1ed906[_0xbddc('0x18')](_0x4699c9)[_0xbddc('0x1a')](_0xb7fece);}};}function respondWithFilteredResult(_0x3e10e8,_0x42a993){return function(_0x193abd){if(_0x193abd){var _0x8ef9ef=_0x193abd['count'],_0xafcd94=_0x42a993[_0xbddc('0x1b')],_0x1f6c66=_0x42a993[_0xbddc('0x1b')]+_0x42a993[_0xbddc('0x1c')],_0x1a1c35;if(_0x1f6c66>=_0x8ef9ef){_0x1f6c66=_0x8ef9ef;_0x1a1c35=0xc8;}else{_0x1a1c35=0xce;}_0x3e10e8[_0xbddc('0x18')](_0x1a1c35);return _0x3e10e8[_0xbddc('0x1d')]('Content-Range',_0xafcd94+'-'+_0x1f6c66+'/'+_0x8ef9ef)['json'](_0x193abd);}return null;};}function patchUpdates(_0x253b70){return function(_0x3c7857){try{jsonpatch[_0xbddc('0x1e')](_0x3c7857,_0x253b70,!![]);}catch(_0x2cf946){return BPromise['reject'](_0x2cf946);}return _0x3c7857[_0xbddc('0x1f')]();};}function saveUpdates(_0x20a5bc,_0x576eca){return function(_0x1722f2){if(_0x1722f2){return _0x1722f2['update'](_0x20a5bc)['then'](function(_0x54c1e4){return _0x54c1e4;});}return null;};}function removeEntity(_0x117a19,_0x5c078c){return function(_0x46f663){if(_0x46f663){return _0x46f663[_0xbddc('0x20')]()['then'](function(){_0x117a19[_0xbddc('0x18')](0xcc)[_0xbddc('0x19')]();});}};}function handleEntityNotFound(_0x1463a2,_0xee1393){return function(_0x1315e1){if(!_0x1315e1){_0x1463a2[_0xbddc('0x17')](0x194);}return _0x1315e1;};}function handleError(_0x540d6e,_0x5f069c){_0x5f069c=_0x5f069c||0x1f4;return function(_0xc16e5e){logger[_0xbddc('0x21')](_0xc16e5e[_0xbddc('0x22')]);if(_0xc16e5e[_0xbddc('0x23')]){delete _0xc16e5e[_0xbddc('0x23')];}_0x540d6e[_0xbddc('0x18')](_0x5f069c)[_0xbddc('0x24')](_0xc16e5e);};}exports[_0xbddc('0x25')]=function(_0x18259b,_0x77b0a4){var _0x16d7c8={},_0x125226={},_0x4c5084={'count':0x0,'rows':[]};var _0x59db62=_['map'](db[_0xbddc('0x26')]['rawAttributes'],function(_0x1073f3){return{'name':_0x1073f3[_0xbddc('0x27')],'type':_0x1073f3[_0xbddc('0x28')]['key']};});_0x125226['model']=_[_0xbddc('0x29')](_0x59db62,_0xbddc('0x23'));_0x125226[_0xbddc('0x2a')]=_[_0xbddc('0x2b')](_0x18259b[_0xbddc('0x2a')]);_0x125226[_0xbddc('0x2c')]=_[_0xbddc('0x2d')](_0x125226[_0xbddc('0x2e')],_0x125226[_0xbddc('0x2a')]);_0x16d7c8['attributes']=_['intersection'](_0x125226['model'],qs[_0xbddc('0x2f')](_0x18259b[_0xbddc('0x2a')]['fields']));_0x16d7c8['attributes']=_0x16d7c8['attributes'][_0xbddc('0x30')]?_0x16d7c8['attributes']:_0x125226[_0xbddc('0x2e')];if(!_0x18259b[_0xbddc('0x2a')][_0xbddc('0x31')](_0xbddc('0x32'))){_0x16d7c8[_0xbddc('0x1c')]=qs[_0xbddc('0x1c')](_0x18259b[_0xbddc('0x2a')][_0xbddc('0x1c')]);_0x16d7c8[_0xbddc('0x1b')]=qs[_0xbddc('0x1b')](_0x18259b[_0xbddc('0x2a')][_0xbddc('0x1b')]);}_0x16d7c8[_0xbddc('0x33')]=qs['sort'](_0x18259b['query'][_0xbddc('0x34')]);_0x16d7c8[_0xbddc('0x35')]=qs['filters'](_[_0xbddc('0x36')](_0x18259b[_0xbddc('0x2a')],_0x125226['filters']));if(_0x18259b['query']['filter']){_0x16d7c8[_0xbddc('0x35')]=_[_0xbddc('0x37')](_0x16d7c8[_0xbddc('0x35')],{'$or':_[_0xbddc('0x29')](_0x59db62,function(_0xf4d4eb){if(_0xf4d4eb[_0xbddc('0x28')]!==_0xbddc('0x38')){var _0x27ec6a={};_0x27ec6a[_0xf4d4eb[_0xbddc('0x23')]]={'$like':'%'+_0x18259b[_0xbddc('0x2a')][_0xbddc('0x39')]+'%'};return _0x27ec6a;}})});}_0x16d7c8=_[_0xbddc('0x37')]({},_0x16d7c8,_0x18259b[_0xbddc('0x3a')]);var _0x139f7a={'where':_0x16d7c8[_0xbddc('0x35')]};return db[_0xbddc('0x26')][_0xbddc('0x3b')](_0x139f7a)['then'](function(_0x2243f6){_0x4c5084[_0xbddc('0x3b')]=_0x2243f6;if(_0x18259b['query'][_0xbddc('0x3c')]){_0x16d7c8[_0xbddc('0x3d')]=[{'attributes':['id',_0xbddc('0x23'),_0xbddc('0x3e'),_0xbddc('0x3f')],'model':db[_0xbddc('0x40')],'as':_0xbddc('0x40')}];}return db[_0xbddc('0x26')][_0xbddc('0x41')](_0x16d7c8);})['then'](function(_0x48e28e){_0x4c5084['rows']=_0x48e28e;return _0x4c5084;})['then'](respondWithFilteredResult(_0x77b0a4,_0x16d7c8))[_0xbddc('0x42')](handleError(_0x77b0a4,null));};exports[_0xbddc('0x43')]=function(_0x5af1de,_0x3be6f4){var _0x146fab={'raw':!![],'where':{'id':_0x5af1de[_0xbddc('0x44')]['id']}},_0x37f520={};_0x37f520[_0xbddc('0x2e')]=_[_0xbddc('0x2b')](db['VoiceCallReport'][_0xbddc('0x45')]);_0x37f520[_0xbddc('0x2a')]=_[_0xbddc('0x2b')](_0x5af1de[_0xbddc('0x2a')]);_0x37f520['filters']=_[_0xbddc('0x2d')](_0x37f520[_0xbddc('0x2e')],_0x37f520['query']);_0x146fab['attributes']=_[_0xbddc('0x2d')](_0x37f520[_0xbddc('0x2e')],qs[_0xbddc('0x2f')](_0x5af1de['query'][_0xbddc('0x2f')]));_0x146fab[_0xbddc('0x46')]=_0x146fab[_0xbddc('0x46')][_0xbddc('0x30')]?_0x146fab[_0xbddc('0x46')]:_0x37f520[_0xbddc('0x2e')];if(_0x5af1de[_0xbddc('0x2a')][_0xbddc('0x3c')]){_0x146fab[_0xbddc('0x3d')]=[{'all':!![]}];}_0x146fab=_[_0xbddc('0x37')]({},_0x146fab,_0x5af1de[_0xbddc('0x3a')]);return db[_0xbddc('0x26')][_0xbddc('0x47')](_0x146fab)['then'](handleEntityNotFound(_0x3be6f4,null))[_0xbddc('0x48')](respondWithResult(_0x3be6f4,null))[_0xbddc('0x42')](handleError(_0x3be6f4,null));};exports[_0xbddc('0x49')]=function(_0x3cbd20,_0x344f4a){return db[_0xbddc('0x26')][_0xbddc('0x49')](_0x3cbd20['body'],{})[_0xbddc('0x48')](respondWithResult(_0x344f4a,0xc9))['catch'](handleError(_0x344f4a,null));};exports[_0xbddc('0x20')]=function(_0x5592f9,_0x410e8c){return db[_0xbddc('0x26')][_0xbddc('0x47')]({'where':{'id':_0x5592f9[_0xbddc('0x44')]['id']}})['then'](handleEntityNotFound(_0x410e8c,null))[_0xbddc('0x48')](removeEntity(_0x410e8c,null))[_0xbddc('0x42')](handleError(_0x410e8c,null));};exports[_0xbddc('0x4a')]=function(_0x48fb23,_0x5875b4){return db[_0xbddc('0x26')][_0xbddc('0x4a')]()[_0xbddc('0x48')](respondWithResult(_0x5875b4,null))['catch'](handleError(_0x5875b4,null));};exports['update']=function(_0xe7b7c7,_0xc96c2c){if(_0xe7b7c7['body']['uniqueid']){delete _0xe7b7c7[_0xbddc('0x4b')][_0xbddc('0x4c')];}return db[_0xbddc('0x26')][_0xbddc('0x47')]({'where':{'uniqueid':_0xe7b7c7[_0xbddc('0x44')]['id'],'UserId':{'$or':[null,_0xe7b7c7[_0xbddc('0x4d')]['id']]}}})['then'](handleEntityNotFound(_0xc96c2c,null))['then'](saveUpdates(_0xe7b7c7[_0xbddc('0x4b')],null))['then'](respondWithResult(_0xc96c2c,null))[_0xbddc('0x42')](handleError(_0xc96c2c,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index a83189a..436900c 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 _0xb2a7=['path','rimraf','./voiceCallReport.attributes','define','uniqueid','lodash','api','moment','bluebird','request-promise'];(function(_0x3d0396,_0x4c5030){var _0x23bec8=function(_0x90b6aa){while(--_0x90b6aa){_0x3d0396['push'](_0x3d0396['shift']());}};_0x23bec8(++_0x4c5030);}(_0xb2a7,0xa5));var _0x7b2a=function(_0xb5c581,_0x4dc77e){_0xb5c581=_0xb5c581-0x0;var _0xc1cd87=_0xb2a7[_0xb5c581];return _0xc1cd87;};'use strict';var _=require(_0x7b2a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x7b2a('0x1'));var moment=require(_0x7b2a('0x2'));var BPromise=require(_0x7b2a('0x3'));var rp=require(_0x7b2a('0x4'));var fs=require('fs');var path=require(_0x7b2a('0x5'));var rimraf=require(_0x7b2a('0x6'));var config=require('../../config/environment');var attributes=require(_0x7b2a('0x7'));module['exports']=function(_0x143b14,_0x12636a){return _0x143b14[_0x7b2a('0x8')]('VoiceCallReport',attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':[_0x7b2a('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd34a=['VoiceCallReport','report_call','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceCallReport.attributes','exports','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd34a,0x120));var _0xad34=function(_0x4e0f9,_0x28aca2){_0x4e0f9=_0x4e0f9-0x0;var _0x2bf0c1=_0xd34a[_0x4e0f9];return _0x2bf0c1;};'use strict';var _=require(_0xad34('0x0'));var util=require('util');var logger=require(_0xad34('0x1'))(_0xad34('0x2'));var moment=require(_0xad34('0x3'));var BPromise=require(_0xad34('0x4'));var rp=require(_0xad34('0x5'));var fs=require('fs');var path=require(_0xad34('0x6'));var rimraf=require(_0xad34('0x7'));var config=require(_0xad34('0x8'));var attributes=require(_0xad34('0x9'));module[_0xad34('0xa')]=function(_0x301df8,_0x11c745){return _0x301df8[_0xad34('0xb')](_0xad34('0xc'),attributes,{'tableName':_0xad34('0xd'),'paranoid':![],'indexes':[{'fields':[_0xad34('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 74bd2cf..5698cf9 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 _0x596b=['CreateVoiceCallReport','create','body','UpdateVoiceCallReport','update','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','VoiceCallReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','VoiceCallReport','findAll','options','raw','where','attributes','limit','include','map','model','GetVoiceCallReport','debug','stringify'];(function(_0x16f0c1,_0x1c75b2){var _0x392790=function(_0xc427f3){while(--_0xc427f3){_0x16f0c1['push'](_0x16f0c1['shift']());}};_0x392790(++_0x1c75b2);}(_0x596b,0xd2));var _0xb596=function(_0x5eea4e,_0x2b49f3){_0x5eea4e=_0x5eea4e-0x0;var _0x17a0b4=_0x596b[_0x5eea4e];return _0x17a0b4;};'use strict';var _=require(_0xb596('0x0'));var util=require(_0xb596('0x1'));var moment=require('moment');var BPromise=require(_0xb596('0x2'));var rs=require(_0xb596('0x3'));var fs=require('fs');var Redis=require(_0xb596('0x4'));var db=require(_0xb596('0x5'))['db'];var utils=require(_0xb596('0x6'));var logger=require(_0xb596('0x7'))('rpc');var config=require(_0xb596('0x8'));var jayson=require(_0xb596('0x9'));var client=jayson[_0xb596('0xa')][_0xb596('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x50f14b,_0x2f6c4b,_0x3ebfd5){return new BPromise(function(_0x59d16b,_0x17620e){return client[_0xb596('0xc')](_0x50f14b,_0x3ebfd5)[_0xb596('0xd')](function(_0xe3d0cc){logger[_0xb596('0xe')](_0xb596('0xf'),_0x2f6c4b,_0xb596('0x10'));logger['debug'](_0xb596('0x11'),_0x2f6c4b,'request\x20sent',JSON['stringify'](_0xe3d0cc));if(_0xe3d0cc[_0xb596('0x12')]){if(_0xe3d0cc[_0xb596('0x12')][_0xb596('0x13')]===0x1f4){logger[_0xb596('0x12')]('VoiceCallReport,\x20%s,\x20%s',_0x2f6c4b,_0xe3d0cc['error'][_0xb596('0x14')]);return _0x17620e(_0xe3d0cc[_0xb596('0x12')][_0xb596('0x14')]);}logger[_0xb596('0x12')](_0xb596('0xf'),_0x2f6c4b,_0xe3d0cc[_0xb596('0x12')][_0xb596('0x14')]);return _0x59d16b(_0xe3d0cc[_0xb596('0x12')]['message']);}else{logger[_0xb596('0xe')](_0xb596('0xf'),_0x2f6c4b,_0xb596('0x10'));_0x59d16b(_0xe3d0cc[_0xb596('0x15')]['message']);}})[_0xb596('0x16')](function(_0x10ba4b){logger[_0xb596('0x12')](_0xb596('0xf'),_0x2f6c4b,_0x10ba4b);_0x17620e(_0x10ba4b);});});}exports['GetVoiceCallReport']=function(_0x429375){var _0x4c49cf=this;return new Promise(function(_0x594bb1,_0xfc3371){return db[_0xb596('0x17')][_0xb596('0x18')]({'raw':_0x429375['options']?_0x429375[_0xb596('0x19')][_0xb596('0x1a')]===undefined?!![]:![]:!![],'where':_0x429375[_0xb596('0x19')]?_0x429375[_0xb596('0x19')][_0xb596('0x1b')]||null:null,'attributes':_0x429375[_0xb596('0x19')]?_0x429375[_0xb596('0x19')][_0xb596('0x1c')]||null:null,'limit':_0x429375[_0xb596('0x19')]?_0x429375[_0xb596('0x19')][_0xb596('0x1d')]||null:null,'include':_0x429375[_0xb596('0x19')]?_0x429375[_0xb596('0x19')][_0xb596('0x1e')]?_[_0xb596('0x1f')](_0x429375[_0xb596('0x19')][_0xb596('0x1e')],function(_0x452129){return{'model':db[_0x452129[_0xb596('0x20')]],'as':_0x452129['as'],'attributes':_0x452129[_0xb596('0x1c')],'include':_0x452129[_0xb596('0x1e')]?_[_0xb596('0x1f')](_0x452129[_0xb596('0x1e')],function(_0x1e96bd){return{'model':db[_0x1e96bd[_0xb596('0x20')]],'as':_0x1e96bd['as'],'attributes':_0x1e96bd[_0xb596('0x1c')],'include':_0x1e96bd[_0xb596('0x1e')]?_[_0xb596('0x1f')](_0x1e96bd[_0xb596('0x1e')],function(_0x35ed0e){return{'model':db[_0x35ed0e[_0xb596('0x20')]],'as':_0x35ed0e['as'],'attributes':_0x35ed0e[_0xb596('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xb596('0xd')](function(_0x128eee){logger['info'](_0xb596('0x21'),_0x429375);logger[_0xb596('0x22')](_0xb596('0x21'),_0x429375,JSON[_0xb596('0x23')](_0x128eee));_0x594bb1(_0x128eee);})['catch'](function(_0x6d77e7){logger[_0xb596('0x12')](_0xb596('0x21'),_0x6d77e7['message'],_0x429375);_0xfc3371(_0x4c49cf[_0xb596('0x12')](0x1f4,_0x6d77e7[_0xb596('0x14')]));});});};exports[_0xb596('0x24')]=function(_0x5df058){var _0x56c163=this;return new Promise(function(_0x88704e,_0x4dc878){return db[_0xb596('0x17')][_0xb596('0x25')](_0x5df058[_0xb596('0x26')],{'raw':_0x5df058[_0xb596('0x19')]?_0x5df058[_0xb596('0x19')][_0xb596('0x1a')]===undefined?!![]:![]:!![]})[_0xb596('0xd')](function(_0x23c76e){logger[_0xb596('0xe')](_0xb596('0x24'),_0x5df058);logger[_0xb596('0x22')](_0xb596('0x24'),_0x5df058,JSON[_0xb596('0x23')](_0x23c76e));_0x88704e(_0x23c76e);})[_0xb596('0x16')](function(_0x338deb){logger['error']('CreateVoiceCallReport',_0x338deb[_0xb596('0x14')],_0x5df058);_0x4dc878(_0x56c163['error'](0x1f4,_0x338deb[_0xb596('0x14')]));});});};exports[_0xb596('0x27')]=function(_0x33a3ad){var _0x5aa53d=this;return new Promise(function(_0x304086,_0x268d23){return db['VoiceCallReport'][_0xb596('0x28')](_0x33a3ad[_0xb596('0x26')],{'raw':_0x33a3ad['options']?_0x33a3ad[_0xb596('0x19')][_0xb596('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x33a3ad[_0xb596('0x19')]?_0x33a3ad[_0xb596('0x19')][_0xb596('0x1b')]||null:null,'attributes':_0x33a3ad[_0xb596('0x19')]?_0x33a3ad[_0xb596('0x19')]['attributes']||null:null,'limit':_0x33a3ad['options']?_0x33a3ad[_0xb596('0x19')][_0xb596('0x1d')]||null:null})[_0xb596('0xd')](function(_0x357c8c){logger[_0xb596('0xe')](_0xb596('0x27'),_0x33a3ad);logger[_0xb596('0x22')]('UpdateVoiceCallReport',_0x33a3ad,JSON['stringify'](_0x357c8c));_0x304086(_0x357c8c);})[_0xb596('0x16')](function(_0x3ebb2f){logger['error'](_0xb596('0x27'),_0x3ebb2f['message'],_0x33a3ad);_0x268d23(_0x5aa53d[_0xb596('0x12')](0x1f4,_0x3ebb2f['message']));});});}; \ No newline at end of file +var _0x9244=['VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceCallReport,\x20%s,\x20%s','message','info','request\x20sent','result','catch','findAll','options','raw','attributes','limit','include','map','model','GetVoiceCallReport','debug','CreateVoiceCallReport','VoiceCallReport','create','body','where','UpdateVoiceCallReport','lodash','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x3183e6,_0x2c0b14){var _0x17bcbb=function(_0x149b9d){while(--_0x149b9d){_0x3183e6['push'](_0x3183e6['shift']());}};_0x17bcbb(++_0x2c0b14);}(_0x9244,0x64));var _0x4924=function(_0x585da0,_0x2bd9ac){_0x585da0=_0x585da0-0x0;var _0xec87dd=_0x9244[_0x585da0];return _0xec87dd;};'use strict';var _=require(_0x4924('0x0'));var util=require('util');var moment=require(_0x4924('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4924('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x4924('0x3'));var logger=require(_0x4924('0x4'))(_0x4924('0x5'));var config=require(_0x4924('0x6'));var jayson=require(_0x4924('0x7'));var client=jayson[_0x4924('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4be68f,_0xf8b06,_0x50a132){return new BPromise(function(_0x351df8,_0x46828c){return client[_0x4924('0x9')](_0x4be68f,_0x50a132)[_0x4924('0xa')](function(_0x4808c9){logger['info']('VoiceCallReport,\x20%s,\x20%s',_0xf8b06,'request\x20sent');logger['debug'](_0x4924('0xb'),_0xf8b06,'request\x20sent',JSON[_0x4924('0xc')](_0x4808c9));if(_0x4808c9[_0x4924('0xd')]){if(_0x4808c9[_0x4924('0xd')][_0x4924('0xe')]===0x1f4){logger[_0x4924('0xd')](_0x4924('0xf'),_0xf8b06,_0x4808c9[_0x4924('0xd')][_0x4924('0x10')]);return _0x46828c(_0x4808c9[_0x4924('0xd')]['message']);}logger[_0x4924('0xd')](_0x4924('0xf'),_0xf8b06,_0x4808c9['error'][_0x4924('0x10')]);return _0x351df8(_0x4808c9[_0x4924('0xd')][_0x4924('0x10')]);}else{logger[_0x4924('0x11')](_0x4924('0xf'),_0xf8b06,_0x4924('0x12'));_0x351df8(_0x4808c9[_0x4924('0x13')]['message']);}})[_0x4924('0x14')](function(_0x3ad3f1){logger[_0x4924('0xd')](_0x4924('0xf'),_0xf8b06,_0x3ad3f1);_0x46828c(_0x3ad3f1);});});}exports['GetVoiceCallReport']=function(_0x20cc66){var _0xb617f6=this;return new Promise(function(_0x17a646,_0x2c7f4f){return db['VoiceCallReport'][_0x4924('0x15')]({'raw':_0x20cc66[_0x4924('0x16')]?_0x20cc66[_0x4924('0x16')][_0x4924('0x17')]===undefined?!![]:![]:!![],'where':_0x20cc66[_0x4924('0x16')]?_0x20cc66['options']['where']||null:null,'attributes':_0x20cc66[_0x4924('0x16')]?_0x20cc66['options'][_0x4924('0x18')]||null:null,'limit':_0x20cc66[_0x4924('0x16')]?_0x20cc66[_0x4924('0x16')][_0x4924('0x19')]||null:null,'include':_0x20cc66[_0x4924('0x16')]?_0x20cc66['options'][_0x4924('0x1a')]?_[_0x4924('0x1b')](_0x20cc66[_0x4924('0x16')][_0x4924('0x1a')],function(_0x4e5ab7){return{'model':db[_0x4e5ab7[_0x4924('0x1c')]],'as':_0x4e5ab7['as'],'attributes':_0x4e5ab7[_0x4924('0x18')],'include':_0x4e5ab7[_0x4924('0x1a')]?_[_0x4924('0x1b')](_0x4e5ab7[_0x4924('0x1a')],function(_0x566bfd){return{'model':db[_0x566bfd['model']],'as':_0x566bfd['as'],'attributes':_0x566bfd[_0x4924('0x18')],'include':_0x566bfd[_0x4924('0x1a')]?_[_0x4924('0x1b')](_0x566bfd[_0x4924('0x1a')],function(_0x3e72cd){return{'model':db[_0x3e72cd[_0x4924('0x1c')]],'as':_0x3e72cd['as'],'attributes':_0x3e72cd[_0x4924('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1be165){logger[_0x4924('0x11')](_0x4924('0x1d'),_0x20cc66);logger[_0x4924('0x1e')]('GetVoiceCallReport',_0x20cc66,JSON['stringify'](_0x1be165));_0x17a646(_0x1be165);})['catch'](function(_0x2aa533){logger[_0x4924('0xd')](_0x4924('0x1d'),_0x2aa533[_0x4924('0x10')],_0x20cc66);_0x2c7f4f(_0xb617f6[_0x4924('0xd')](0x1f4,_0x2aa533[_0x4924('0x10')]));});});};exports[_0x4924('0x1f')]=function(_0x47d589){var _0x39fea4=this;return new Promise(function(_0x501ccb,_0x3116cb){return db[_0x4924('0x20')][_0x4924('0x21')](_0x47d589[_0x4924('0x22')],{'raw':_0x47d589['options']?_0x47d589[_0x4924('0x16')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x47a34f){logger[_0x4924('0x11')]('CreateVoiceCallReport',_0x47d589);logger[_0x4924('0x1e')](_0x4924('0x1f'),_0x47d589,JSON['stringify'](_0x47a34f));_0x501ccb(_0x47a34f);})[_0x4924('0x14')](function(_0x3dfbc3){logger[_0x4924('0xd')](_0x4924('0x1f'),_0x3dfbc3[_0x4924('0x10')],_0x47d589);_0x3116cb(_0x39fea4[_0x4924('0xd')](0x1f4,_0x3dfbc3[_0x4924('0x10')]));});});};exports['UpdateVoiceCallReport']=function(_0x36b732){var _0x1e25e7=this;return new Promise(function(_0x1a017b,_0x50fe76){return db[_0x4924('0x20')]['update'](_0x36b732[_0x4924('0x22')],{'raw':_0x36b732[_0x4924('0x16')]?_0x36b732[_0x4924('0x16')][_0x4924('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x36b732[_0x4924('0x16')]?_0x36b732[_0x4924('0x16')][_0x4924('0x23')]||null:null,'attributes':_0x36b732['options']?_0x36b732['options'][_0x4924('0x18')]||null:null,'limit':_0x36b732[_0x4924('0x16')]?_0x36b732['options'][_0x4924('0x19')]||null:null})[_0x4924('0xa')](function(_0x39d5c1){logger[_0x4924('0x11')](_0x4924('0x24'),_0x36b732);logger[_0x4924('0x1e')](_0x4924('0x24'),_0x36b732,JSON['stringify'](_0x39d5c1));_0x1a017b(_0x39d5c1);})[_0x4924('0x14')](function(_0x478a23){logger[_0x4924('0xd')](_0x4924('0x24'),_0x478a23['message'],_0x36b732);_0x50fe76(_0x1e25e7[_0x4924('0xd')](0x1f4,_0x478a23[_0x4924('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 1bc50ee..0926652 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 _0x7b58=['./voiceChanSpy.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','exports','multer','util','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x7b58,0xe9));var _0x87b5=function(_0x1d656c,_0x14fba4){_0x1d656c=_0x1d656c-0x0;var _0x4eeb25=_0x7b58[_0x1d656c];return _0x4eeb25;};'use strict';var multer=require(_0x87b5('0x0'));var util=require(_0x87b5('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0x87b5('0x2'));var interaction=require(_0x87b5('0x3'));var config=require(_0x87b5('0x4'));var controller=require(_0x87b5('0x5'));router[_0x87b5('0x6')]('/',auth['isAuthenticated'](),controller[_0x87b5('0x7')]);router['get'](_0x87b5('0x8'),auth[_0x87b5('0x9')](),controller[_0x87b5('0xa')]);router[_0x87b5('0xb')]('/',auth[_0x87b5('0x9')](),controller[_0x87b5('0xc')]);router[_0x87b5('0xd')](_0x87b5('0x8'),auth['isAuthenticated'](),controller[_0x87b5('0xe')]);router[_0x87b5('0xf')](_0x87b5('0x8'),auth[_0x87b5('0x9')](),controller['destroy']);module[_0x87b5('0x10')]=router; \ No newline at end of file +var _0x8375=['/:id','create','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','isAuthenticated','index','get'];(function(_0x43ec4d,_0x291cc1){var _0x2edef3=function(_0x17bdf5){while(--_0x17bdf5){_0x43ec4d['push'](_0x43ec4d['shift']());}};_0x2edef3(++_0x291cc1);}(_0x8375,0xa8));var _0x5837=function(_0x233e09,_0x3c965b){_0x233e09=_0x233e09-0x0;var _0x33baba=_0x8375[_0x233e09];return _0x33baba;};'use strict';var multer=require(_0x5837('0x0'));var util=require(_0x5837('0x1'));var path=require(_0x5837('0x2'));var timeout=require('connect-timeout');var express=require(_0x5837('0x3'));var router=express[_0x5837('0x4')]();var auth=require(_0x5837('0x5'));var interaction=require(_0x5837('0x6'));var config=require(_0x5837('0x7'));var controller=require(_0x5837('0x8'));router['get']('/',auth[_0x5837('0x9')](),controller[_0x5837('0xa')]);router[_0x5837('0xb')](_0x5837('0xc'),auth[_0x5837('0x9')](),controller['show']);router['post']('/',auth[_0x5837('0x9')](),controller[_0x5837('0xd')]);router['put'](_0x5837('0xc'),auth['isAuthenticated'](),controller[_0x5837('0xe')]);router[_0x5837('0xf')](_0x5837('0xc'),auth[_0x5837('0x9')](),controller[_0x5837('0x10')]);module[_0x5837('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 337d2de..5000c3e 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 _0x1ebc=['exports','STRING','name','setDataValue','options','join','getDataValue','split','BOOLEAN','sequelize'];(function(_0x16562e,_0x4fa618){var _0xef599a=function(_0x25b65b){while(--_0x25b65b){_0x16562e['push'](_0x16562e['shift']());}};_0xef599a(++_0x4fa618);}(_0x1ebc,0x1c1));var _0xc1eb=function(_0x2de82f,_0x5a2035){_0x2de82f=_0x2de82f-0x0;var _0x4b528a=_0x1ebc[_0x2de82f];return _0x4b528a;};'use strict';var Sequelize=require(_0xc1eb('0x0'));module[_0xc1eb('0x1')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0xc1eb('0x2')],'unique':_0xc1eb('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0xc1eb('0x2')],'set':function(_0x183a74){this[_0xc1eb('0x4')](_0xc1eb('0x5'),_0x183a74?_0x183a74[_0xc1eb('0x6')](''):[]);},'get':function(){return this[_0xc1eb('0x7')](_0xc1eb('0x5'))?this[_0xc1eb('0x7')](_0xc1eb('0x5'))[_0xc1eb('0x8')](''):[];}},'auth':{'type':Sequelize[_0xc1eb('0x9')],'defaultValue':![]},'password':{'type':Sequelize[_0xc1eb('0x2')]},'record':{'type':Sequelize[_0xc1eb('0x9')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xc1eb('0x2')]},'description':{'type':Sequelize[_0xc1eb('0x2')]}}; \ No newline at end of file +var _0x800d=['STRING','name','join','getDataValue','options','split','BOOLEAN','exports'];(function(_0x6e2e26,_0x5ddf08){var _0x583af2=function(_0x3b2ee6){while(--_0x3b2ee6){_0x6e2e26['push'](_0x6e2e26['shift']());}};_0x583af2(++_0x5ddf08);}(_0x800d,0x1df));var _0xd800=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x800d[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xd800('0x0')]={'name':{'type':Sequelize[_0xd800('0x1')]},'prefix':{'type':Sequelize['STRING'],'unique':_0xd800('0x2'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x41e119){this['setDataValue']('options',_0x41e119?_0x41e119[_0xd800('0x3')](''):[]);},'get':function(){return this[_0xd800('0x4')](_0xd800('0x5'))?this['getDataValue'](_0xd800('0x5'))[_0xd800('0x6')](''):[];}},'auth':{'type':Sequelize[_0xd800('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0xd800('0x1')]},'record':{'type':Sequelize[_0xd800('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xd800('0x1')]},'description':{'type':Sequelize[_0xd800('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 7b83e44..43a2360 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 _0xc8c8=['send','index','map','VoiceChanSpy','rawAttributes','fieldName','type','key','query','keys','filters','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','rows','catch','show','params','intersection','includeAll','include','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','html-pdf','rimraf','zip-dir','fast-json-patch','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','get','ChanSpies','UserProfileResource','error','stack','name'];(function(_0x3aebea,_0x179fb3){var _0x10ee36=function(_0x1658b0){while(--_0x1658b0){_0x3aebea['push'](_0x3aebea['shift']());}};_0x10ee36(++_0x179fb3);}(_0xc8c8,0xd2));var _0x8c8c=function(_0x5301b8,_0x2c6250){_0x5301b8=_0x5301b8-0x0;var _0x402796=_0xc8c8[_0x5301b8];return _0x402796;};'use strict';var pdf=require(_0x8c8c('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x8c8c('0x1'));var zipdir=require(_0x8c8c('0x2'));var jsonpatch=require(_0x8c8c('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8c8c('0x4'));var util=require(_0x8c8c('0x5'));var path=require(_0x8c8c('0x6'));var sox=require('sox');var csv=require(_0x8c8c('0x7'));var ejs=require(_0x8c8c('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x8c8c('0x9'));var crypto=require(_0x8c8c('0xa'));var jsforce=require(_0x8c8c('0xb'));var deskjs=require(_0x8c8c('0xc'));var toCsv=require(_0x8c8c('0x7'));var querystring=require(_0x8c8c('0xd'));var Papa=require(_0x8c8c('0xe'));var Redis=require(_0x8c8c('0xf'));var authService=require(_0x8c8c('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x8c8c('0x11'));var hardwareService=require(_0x8c8c('0x12'));var logger=require(_0x8c8c('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x8c8c('0x14'));var db=require(_0x8c8c('0x15'))['db'];function respondWithStatusCode(_0x2dbf25,_0x4d741f){_0x4d741f=_0x4d741f||0xcc;return function(_0x117124){if(_0x117124){return _0x2dbf25[_0x8c8c('0x16')](_0x4d741f);}return _0x2dbf25[_0x8c8c('0x17')](_0x4d741f)[_0x8c8c('0x18')]();};}function respondWithResult(_0x20b6cf,_0x250965){_0x250965=_0x250965||0xc8;return function(_0x4c7b1f){if(_0x4c7b1f){return _0x20b6cf[_0x8c8c('0x17')](_0x250965)[_0x8c8c('0x19')](_0x4c7b1f);}};}function respondWithFilteredResult(_0x551aa6,_0x3b1240){return function(_0x2506f7){if(_0x2506f7){var _0x8afddc=_0x2506f7['count'],_0x507611=_0x3b1240[_0x8c8c('0x1a')],_0x16a430=_0x3b1240['offset']+_0x3b1240[_0x8c8c('0x1b')],_0x430f9e;if(_0x16a430>=_0x8afddc){_0x16a430=_0x8afddc;_0x430f9e=0xc8;}else{_0x430f9e=0xce;}_0x551aa6['status'](_0x430f9e);return _0x551aa6[_0x8c8c('0x1c')](_0x8c8c('0x1d'),_0x507611+'-'+_0x16a430+'/'+_0x8afddc)['json'](_0x2506f7);}return null;};}function patchUpdates(_0x41d3c9){return function(_0x36e4f7){try{jsonpatch[_0x8c8c('0x1e')](_0x36e4f7,_0x41d3c9,!![]);}catch(_0x224be3){return BPromise[_0x8c8c('0x1f')](_0x224be3);}return _0x36e4f7[_0x8c8c('0x20')]();};}function saveUpdates(_0x5e0efd,_0x11f1bc){return function(_0x18c275){if(_0x18c275){return _0x18c275[_0x8c8c('0x21')](_0x5e0efd)['then'](function(_0x3536b0){return _0x3536b0;});}return null;};}function removeEntity(_0x5022c6,_0x5f5ad8){return function(_0x4e6221){if(_0x4e6221){return _0x4e6221[_0x8c8c('0x22')]()[_0x8c8c('0x23')](function(){var _0x19e66f=_0x4e6221[_0x8c8c('0x24')]({'plain':!![]});var _0x1a47d8=_0x8c8c('0x25');return db[_0x8c8c('0x26')][_0x8c8c('0x22')]({'where':{'type':_0x1a47d8,'resourceId':_0x19e66f['id']}})['then'](function(){return _0x4e6221;});})[_0x8c8c('0x23')](function(){_0x5022c6['status'](0xcc)[_0x8c8c('0x18')]();});}};}function handleEntityNotFound(_0x3c21b5,_0x33bc21){return function(_0xff933){if(!_0xff933){_0x3c21b5[_0x8c8c('0x16')](0x194);}return _0xff933;};}function handleError(_0x4a0bed,_0x7f8001){_0x7f8001=_0x7f8001||0x1f4;return function(_0x16b893){logger[_0x8c8c('0x27')](_0x16b893[_0x8c8c('0x28')]);if(_0x16b893[_0x8c8c('0x29')]){delete _0x16b893[_0x8c8c('0x29')];}_0x4a0bed[_0x8c8c('0x17')](_0x7f8001)[_0x8c8c('0x2a')](_0x16b893);};}exports[_0x8c8c('0x2b')]=function(_0x2d6dc3,_0x9730e7){var _0x7a2f35={},_0x533da8={},_0xce9e41={'count':0x0,'rows':[]};var _0x1ea226=_[_0x8c8c('0x2c')](db[_0x8c8c('0x2d')][_0x8c8c('0x2e')],function(_0x2e9695){return{'name':_0x2e9695[_0x8c8c('0x2f')],'type':_0x2e9695[_0x8c8c('0x30')][_0x8c8c('0x31')]};});_0x533da8['model']=_[_0x8c8c('0x2c')](_0x1ea226,_0x8c8c('0x29'));_0x533da8[_0x8c8c('0x32')]=_[_0x8c8c('0x33')](_0x2d6dc3['query']);_0x533da8[_0x8c8c('0x34')]=_['intersection'](_0x533da8['model'],_0x533da8[_0x8c8c('0x32')]);_0x7a2f35['attributes']=_['intersection'](_0x533da8[_0x8c8c('0x35')],qs[_0x8c8c('0x36')](_0x2d6dc3[_0x8c8c('0x32')][_0x8c8c('0x36')]));_0x7a2f35[_0x8c8c('0x37')]=_0x7a2f35[_0x8c8c('0x37')][_0x8c8c('0x38')]?_0x7a2f35[_0x8c8c('0x37')]:_0x533da8['model'];if(!_0x2d6dc3[_0x8c8c('0x32')][_0x8c8c('0x39')](_0x8c8c('0x3a'))){_0x7a2f35[_0x8c8c('0x1b')]=qs[_0x8c8c('0x1b')](_0x2d6dc3[_0x8c8c('0x32')]['limit']);_0x7a2f35[_0x8c8c('0x1a')]=qs[_0x8c8c('0x1a')](_0x2d6dc3[_0x8c8c('0x32')][_0x8c8c('0x1a')]);}_0x7a2f35[_0x8c8c('0x3b')]=qs[_0x8c8c('0x3c')](_0x2d6dc3[_0x8c8c('0x32')][_0x8c8c('0x3c')]);_0x7a2f35[_0x8c8c('0x3d')]=qs[_0x8c8c('0x34')](_[_0x8c8c('0x3e')](_0x2d6dc3[_0x8c8c('0x32')],_0x533da8[_0x8c8c('0x34')]));if(_0x2d6dc3[_0x8c8c('0x32')][_0x8c8c('0x3f')]){_0x7a2f35[_0x8c8c('0x3d')]=_[_0x8c8c('0x40')](_0x7a2f35['where'],{'$or':_[_0x8c8c('0x2c')](_0x1ea226,function(_0x592341){if(_0x592341[_0x8c8c('0x30')]!==_0x8c8c('0x41')){var _0x5e5c42={};_0x5e5c42[_0x592341[_0x8c8c('0x29')]]={'$like':'%'+_0x2d6dc3[_0x8c8c('0x32')]['filter']+'%'};return _0x5e5c42;}})});}_0x7a2f35=_[_0x8c8c('0x40')]({},_0x7a2f35,_0x2d6dc3[_0x8c8c('0x42')]);var _0x22d007={'where':_0x7a2f35[_0x8c8c('0x3d')]};return db[_0x8c8c('0x2d')]['count'](_0x22d007)[_0x8c8c('0x23')](function(_0x1fca7c){_0xce9e41[_0x8c8c('0x43')]=_0x1fca7c;if(_0x2d6dc3[_0x8c8c('0x32')]['includeAll']){_0x7a2f35['include']=[{'all':!![]}];}return db[_0x8c8c('0x2d')]['findAll'](_0x7a2f35);})[_0x8c8c('0x23')](function(_0x4cb301){_0xce9e41[_0x8c8c('0x44')]=_0x4cb301;return _0xce9e41;})[_0x8c8c('0x23')](respondWithFilteredResult(_0x9730e7,_0x7a2f35))[_0x8c8c('0x45')](handleError(_0x9730e7,null));};exports[_0x8c8c('0x46')]=function(_0x1f5f20,_0x16e370){var _0x207485={'raw':![],'where':{'id':_0x1f5f20[_0x8c8c('0x47')]['id']}},_0x42446b={};_0x42446b[_0x8c8c('0x35')]=_[_0x8c8c('0x33')](db[_0x8c8c('0x2d')][_0x8c8c('0x2e')]);_0x42446b[_0x8c8c('0x32')]=_[_0x8c8c('0x33')](_0x1f5f20[_0x8c8c('0x32')]);_0x42446b[_0x8c8c('0x34')]=_[_0x8c8c('0x48')](_0x42446b['model'],_0x42446b[_0x8c8c('0x32')]);_0x207485[_0x8c8c('0x37')]=_[_0x8c8c('0x48')](_0x42446b[_0x8c8c('0x35')],qs[_0x8c8c('0x36')](_0x1f5f20[_0x8c8c('0x32')][_0x8c8c('0x36')]));_0x207485[_0x8c8c('0x37')]=_0x207485[_0x8c8c('0x37')][_0x8c8c('0x38')]?_0x207485['attributes']:_0x42446b[_0x8c8c('0x35')];if(_0x1f5f20[_0x8c8c('0x32')][_0x8c8c('0x49')]){_0x207485[_0x8c8c('0x4a')]=[{'all':!![]}];}_0x207485=_[_0x8c8c('0x40')]({},_0x207485,_0x1f5f20[_0x8c8c('0x42')]);return db[_0x8c8c('0x2d')]['find'](_0x207485)[_0x8c8c('0x23')](handleEntityNotFound(_0x16e370,null))[_0x8c8c('0x23')](respondWithResult(_0x16e370,null))[_0x8c8c('0x45')](handleError(_0x16e370,null));};exports[_0x8c8c('0x4b')]=function(_0x136622,_0x2411c6){return db['VoiceChanSpy'][_0x8c8c('0x4b')](_0x136622['body'],{})[_0x8c8c('0x23')](function(_0x7520a5){var _0x40eca8=_0x136622[_0x8c8c('0x4c')][_0x8c8c('0x24')]({'plain':!![]});if(!_0x40eca8)throw new Error(_0x8c8c('0x4d'));if(_0x40eca8[_0x8c8c('0x4e')]===_0x8c8c('0x4c')){var _0x25fe61=_0x7520a5[_0x8c8c('0x24')]({'plain':!![]});var _0x222384='ChanSpies';return db[_0x8c8c('0x4f')][_0x8c8c('0x50')]({'where':{'name':_0x222384,'userProfileId':_0x40eca8[_0x8c8c('0x51')]},'raw':!![]})[_0x8c8c('0x23')](function(_0x5438a0){if(_0x5438a0&&_0x5438a0['autoAssociation']===0x0){return db[_0x8c8c('0x26')]['create']({'name':_0x25fe61['name'],'resourceId':_0x25fe61['id'],'type':_0x5438a0['name'],'sectionId':_0x5438a0['id']},{})[_0x8c8c('0x23')](function(){return _0x7520a5;});}else{return _0x7520a5;}})['catch'](function(_0x634c9c){logger[_0x8c8c('0x27')](_0x8c8c('0x52'),_0x634c9c);throw _0x634c9c;});}return _0x7520a5;})[_0x8c8c('0x23')](respondWithResult(_0x2411c6,0xc9))['catch'](handleError(_0x2411c6,null));};exports[_0x8c8c('0x21')]=function(_0x363f98,_0x2a9c3c){if(_0x363f98[_0x8c8c('0x53')]['id']){delete _0x363f98['body']['id'];}return db[_0x8c8c('0x2d')][_0x8c8c('0x50')]({'where':{'id':_0x363f98[_0x8c8c('0x47')]['id']}})[_0x8c8c('0x23')](handleEntityNotFound(_0x2a9c3c,null))['then'](saveUpdates(_0x363f98[_0x8c8c('0x53')],null))[_0x8c8c('0x23')](respondWithResult(_0x2a9c3c,null))[_0x8c8c('0x45')](handleError(_0x2a9c3c,null));};exports[_0x8c8c('0x22')]=function(_0x1bf463,_0x2bad54){return db['VoiceChanSpy']['find']({'where':{'id':_0x1bf463[_0x8c8c('0x47')]['id']}})[_0x8c8c('0x23')](handleEntityNotFound(_0x2bad54,null))['then'](removeEntity(_0x2bad54,null))[_0x8c8c('0x45')](handleError(_0x2bad54,null));}; \ No newline at end of file +var _0x9785=['request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','Content-Range','apply','reject','save','update','then','destroy','get','ChanSpies','UserProfileResource','error','name','send','map','VoiceChanSpy','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','nolimit','sort','filters','where','merge','VIRTUAL','count','includeAll','include','rows','catch','params','keys','options','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x583bf0,_0x4b59aa){var _0x210ec6=function(_0x3a7abb){while(--_0x3a7abb){_0x583bf0['push'](_0x583bf0['shift']());}};_0x210ec6(++_0x4b59aa);}(_0x9785,0x1cf));var _0x5978=function(_0x5e36d1,_0x471178){_0x5e36d1=_0x5e36d1-0x0;var _0x950b9e=_0x9785[_0x5e36d1];return _0x950b9e;};'use strict';var pdf=require(_0x5978('0x0'));var emlformat=require(_0x5978('0x1'));var rimraf=require(_0x5978('0x2'));var zipdir=require(_0x5978('0x3'));var jsonpatch=require(_0x5978('0x4'));var rp=require(_0x5978('0x5'));var moment=require(_0x5978('0x6'));var BPromise=require(_0x5978('0x7'));var Mustache=require(_0x5978('0x8'));var util=require('util');var path=require(_0x5978('0x9'));var sox=require(_0x5978('0xa'));var csv=require(_0x5978('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x5978('0xc'));var squel=require(_0x5978('0xd'));var crypto=require(_0x5978('0xe'));var jsforce=require(_0x5978('0xf'));var deskjs=require(_0x5978('0x10'));var toCsv=require(_0x5978('0xb'));var querystring=require('querystring');var Papa=require(_0x5978('0x11'));var Redis=require(_0x5978('0x12'));var authService=require(_0x5978('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x5978('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5978('0x15'))(_0x5978('0x16'));var utils=require('../../config/utils');var config=require(_0x5978('0x17'));var db=require(_0x5978('0x18'))['db'];function respondWithStatusCode(_0x3594cd,_0x361d0b){_0x361d0b=_0x361d0b||0xcc;return function(_0x5d9de0){if(_0x5d9de0){return _0x3594cd[_0x5978('0x19')](_0x361d0b);}return _0x3594cd[_0x5978('0x1a')](_0x361d0b)[_0x5978('0x1b')]();};}function respondWithResult(_0x36aa52,_0x5593b6){_0x5593b6=_0x5593b6||0xc8;return function(_0x26d5f0){if(_0x26d5f0){return _0x36aa52[_0x5978('0x1a')](_0x5593b6)[_0x5978('0x1c')](_0x26d5f0);}};}function respondWithFilteredResult(_0x525be2,_0x4f078f){return function(_0x31c66d){if(_0x31c66d){var _0x2e40ae=_0x31c66d['count'],_0x5c4cc3=_0x4f078f[_0x5978('0x1d')],_0x14516f=_0x4f078f[_0x5978('0x1d')]+_0x4f078f[_0x5978('0x1e')],_0x124504;if(_0x14516f>=_0x2e40ae){_0x14516f=_0x2e40ae;_0x124504=0xc8;}else{_0x124504=0xce;}_0x525be2[_0x5978('0x1a')](_0x124504);return _0x525be2['set'](_0x5978('0x1f'),_0x5c4cc3+'-'+_0x14516f+'/'+_0x2e40ae)[_0x5978('0x1c')](_0x31c66d);}return null;};}function patchUpdates(_0x4e4028){return function(_0x4ceff2){try{jsonpatch[_0x5978('0x20')](_0x4ceff2,_0x4e4028,!![]);}catch(_0x3de09d){return BPromise[_0x5978('0x21')](_0x3de09d);}return _0x4ceff2[_0x5978('0x22')]();};}function saveUpdates(_0x56c423,_0x505c2b){return function(_0x41e49a){if(_0x41e49a){return _0x41e49a[_0x5978('0x23')](_0x56c423)[_0x5978('0x24')](function(_0x19fef8){return _0x19fef8;});}return null;};}function removeEntity(_0x1f7bce,_0x3837c4){return function(_0x2347a3){if(_0x2347a3){return _0x2347a3[_0x5978('0x25')]()[_0x5978('0x24')](function(){var _0x4a3938=_0x2347a3[_0x5978('0x26')]({'plain':!![]});var _0x208274=_0x5978('0x27');return db[_0x5978('0x28')][_0x5978('0x25')]({'where':{'type':_0x208274,'resourceId':_0x4a3938['id']}})[_0x5978('0x24')](function(){return _0x2347a3;});})['then'](function(){_0x1f7bce[_0x5978('0x1a')](0xcc)[_0x5978('0x1b')]();});}};}function handleEntityNotFound(_0x4e98b6,_0x18de2c){return function(_0x1ed97c){if(!_0x1ed97c){_0x4e98b6['sendStatus'](0x194);}return _0x1ed97c;};}function handleError(_0x10e6ed,_0x367df9){_0x367df9=_0x367df9||0x1f4;return function(_0x123669){logger[_0x5978('0x29')](_0x123669['stack']);if(_0x123669[_0x5978('0x2a')]){delete _0x123669[_0x5978('0x2a')];}_0x10e6ed[_0x5978('0x1a')](_0x367df9)[_0x5978('0x2b')](_0x123669);};}exports['index']=function(_0x3792cf,_0x3cfa84){var _0x338230={},_0x491df2={},_0x4dce7f={'count':0x0,'rows':[]};var _0x4ec57b=_[_0x5978('0x2c')](db[_0x5978('0x2d')][_0x5978('0x2e')],function(_0x40eb2c){return{'name':_0x40eb2c[_0x5978('0x2f')],'type':_0x40eb2c[_0x5978('0x30')][_0x5978('0x31')]};});_0x491df2[_0x5978('0x32')]=_[_0x5978('0x2c')](_0x4ec57b,_0x5978('0x2a'));_0x491df2[_0x5978('0x33')]=_['keys'](_0x3792cf[_0x5978('0x33')]);_0x491df2['filters']=_[_0x5978('0x34')](_0x491df2[_0x5978('0x32')],_0x491df2[_0x5978('0x33')]);_0x338230[_0x5978('0x35')]=_['intersection'](_0x491df2['model'],qs[_0x5978('0x36')](_0x3792cf[_0x5978('0x33')][_0x5978('0x36')]));_0x338230[_0x5978('0x35')]=_0x338230[_0x5978('0x35')]['length']?_0x338230['attributes']:_0x491df2['model'];if(!_0x3792cf[_0x5978('0x33')]['hasOwnProperty'](_0x5978('0x37'))){_0x338230['limit']=qs[_0x5978('0x1e')](_0x3792cf[_0x5978('0x33')][_0x5978('0x1e')]);_0x338230[_0x5978('0x1d')]=qs['offset'](_0x3792cf[_0x5978('0x33')][_0x5978('0x1d')]);}_0x338230['order']=qs[_0x5978('0x38')](_0x3792cf[_0x5978('0x33')][_0x5978('0x38')]);_0x338230['where']=qs[_0x5978('0x39')](_['pick'](_0x3792cf['query'],_0x491df2[_0x5978('0x39')]));if(_0x3792cf[_0x5978('0x33')]['filter']){_0x338230[_0x5978('0x3a')]=_[_0x5978('0x3b')](_0x338230[_0x5978('0x3a')],{'$or':_['map'](_0x4ec57b,function(_0x4e0e2a){if(_0x4e0e2a['type']!==_0x5978('0x3c')){var _0x10162e={};_0x10162e[_0x4e0e2a[_0x5978('0x2a')]]={'$like':'%'+_0x3792cf[_0x5978('0x33')]['filter']+'%'};return _0x10162e;}})});}_0x338230=_[_0x5978('0x3b')]({},_0x338230,_0x3792cf['options']);var _0xdd7c13={'where':_0x338230[_0x5978('0x3a')]};return db[_0x5978('0x2d')]['count'](_0xdd7c13)[_0x5978('0x24')](function(_0x392b33){_0x4dce7f[_0x5978('0x3d')]=_0x392b33;if(_0x3792cf[_0x5978('0x33')][_0x5978('0x3e')]){_0x338230[_0x5978('0x3f')]=[{'all':!![]}];}return db['VoiceChanSpy']['findAll'](_0x338230);})[_0x5978('0x24')](function(_0x3a0df2){_0x4dce7f[_0x5978('0x40')]=_0x3a0df2;return _0x4dce7f;})[_0x5978('0x24')](respondWithFilteredResult(_0x3cfa84,_0x338230))[_0x5978('0x41')](handleError(_0x3cfa84,null));};exports['show']=function(_0x2fd9f3,_0x28e156){var _0x1d564d={'raw':![],'where':{'id':_0x2fd9f3[_0x5978('0x42')]['id']}},_0x369503={};_0x369503['model']=_['keys'](db[_0x5978('0x2d')][_0x5978('0x2e')]);_0x369503[_0x5978('0x33')]=_[_0x5978('0x43')](_0x2fd9f3[_0x5978('0x33')]);_0x369503[_0x5978('0x39')]=_['intersection'](_0x369503[_0x5978('0x32')],_0x369503['query']);_0x1d564d[_0x5978('0x35')]=_[_0x5978('0x34')](_0x369503[_0x5978('0x32')],qs[_0x5978('0x36')](_0x2fd9f3[_0x5978('0x33')]['fields']));_0x1d564d[_0x5978('0x35')]=_0x1d564d[_0x5978('0x35')]['length']?_0x1d564d[_0x5978('0x35')]:_0x369503[_0x5978('0x32')];if(_0x2fd9f3[_0x5978('0x33')]['includeAll']){_0x1d564d['include']=[{'all':!![]}];}_0x1d564d=_[_0x5978('0x3b')]({},_0x1d564d,_0x2fd9f3[_0x5978('0x44')]);return db[_0x5978('0x2d')]['find'](_0x1d564d)[_0x5978('0x24')](handleEntityNotFound(_0x28e156,null))[_0x5978('0x24')](respondWithResult(_0x28e156,null))[_0x5978('0x41')](handleError(_0x28e156,null));};exports[_0x5978('0x45')]=function(_0x3b782a,_0x312251){return db[_0x5978('0x2d')][_0x5978('0x45')](_0x3b782a[_0x5978('0x46')],{})['then'](function(_0x5a710e){var _0xdfdeb8=_0x3b782a[_0x5978('0x47')][_0x5978('0x26')]({'plain':!![]});if(!_0xdfdeb8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xdfdeb8[_0x5978('0x48')]===_0x5978('0x47')){var _0x5e8b1f=_0x5a710e[_0x5978('0x26')]({'plain':!![]});var _0x2115ac=_0x5978('0x27');return db[_0x5978('0x49')]['find']({'where':{'name':_0x2115ac,'userProfileId':_0xdfdeb8[_0x5978('0x4a')]},'raw':!![]})['then'](function(_0x281ccb){if(_0x281ccb&&_0x281ccb[_0x5978('0x4b')]===0x0){return db['UserProfileResource']['create']({'name':_0x5e8b1f[_0x5978('0x2a')],'resourceId':_0x5e8b1f['id'],'type':_0x281ccb[_0x5978('0x2a')],'sectionId':_0x281ccb['id']},{})['then'](function(){return _0x5a710e;});}else{return _0x5a710e;}})['catch'](function(_0x4197bb){logger[_0x5978('0x29')](_0x5978('0x4c'),_0x4197bb);throw _0x4197bb;});}return _0x5a710e;})[_0x5978('0x24')](respondWithResult(_0x312251,0xc9))[_0x5978('0x41')](handleError(_0x312251,null));};exports[_0x5978('0x23')]=function(_0x6a2d81,_0x3c03ce){if(_0x6a2d81[_0x5978('0x46')]['id']){delete _0x6a2d81[_0x5978('0x46')]['id'];}return db[_0x5978('0x2d')][_0x5978('0x4d')]({'where':{'id':_0x6a2d81[_0x5978('0x42')]['id']}})[_0x5978('0x24')](handleEntityNotFound(_0x3c03ce,null))[_0x5978('0x24')](saveUpdates(_0x6a2d81[_0x5978('0x46')],null))[_0x5978('0x24')](respondWithResult(_0x3c03ce,null))[_0x5978('0x41')](handleError(_0x3c03ce,null));};exports['destroy']=function(_0x5c6033,_0x1b1eaf){return db[_0x5978('0x2d')][_0x5978('0x4d')]({'where':{'id':_0x5c6033[_0x5978('0x42')]['id']}})[_0x5978('0x24')](handleEntityNotFound(_0x1b1eaf,null))[_0x5978('0x24')](removeEntity(_0x1b1eaf,null))[_0x5978('0x41')](handleError(_0x1b1eaf,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 8b6e91f..003a9b7 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 _0xe7ea=['then','VoiceExtension','bulkCreate','destroy','lodash','bluebird','./voiceChanSpy.attributes','from-sip','format','%s%s','prefix','system','merge','Set','chanspy','push','MixMonitor','${UNIQUEID}.%s,ab','recordingFormat','password','ChanSpy','SIP/%s,%s','options','join','StopMixMonitor','length','concat','internal','name','User','agent','catch','exports','VoiceChanSpy','voice_chanspy'];(function(_0x57a50f,_0x1cdd39){var _0x142447=function(_0x498f9f){while(--_0x498f9f){_0x57a50f['push'](_0x57a50f['shift']());}};_0x142447(++_0x1cdd39);}(_0xe7ea,0x185));var _0xae7e=function(_0x167b19,_0x56081a){_0x167b19=_0x167b19-0x0;var _0x1fcca2=_0xe7ea[_0x167b19];return _0x1fcca2;};'use strict';var _=require(_0xae7e('0x0'));var util=require('util');var BPromise=require(_0xae7e('0x1'));var attributes=require(_0xae7e('0x2'));var getUserApplications=function(_0x5b0c1f,_0x150cc1,_0x127b37){var _0x1af791=0x1;var _0x4fcc5a=[];var _0x26728c={'context':_0x150cc1['context']||_0xae7e('0x3'),'exten':util[_0xae7e('0x4')](_0xae7e('0x5'),_0x5b0c1f[_0xae7e('0x6')],_0x127b37),'type':_0xae7e('0x7'),'isApp':![],'ChanSpyId':_0x5b0c1f['id'],'UserId':_0x150cc1['id']};_0x4fcc5a['push'](_[_0xae7e('0x8')]({'app':_0xae7e('0x9'),'appdata':util[_0xae7e('0x4')]('CDR(type)=%s',_0xae7e('0xa')),'priority':_0x1af791++},_0x26728c));if(_0x5b0c1f['record']){_0x4fcc5a[_0xae7e('0xb')](_[_0xae7e('0x8')]({'app':_0xae7e('0xc'),'appdata':util[_0xae7e('0x4')](_0xae7e('0xd'),_0x5b0c1f[_0xae7e('0xe')]),'priority':_0x1af791++},_0x26728c));}if(_0x5b0c1f['auth']){_0x4fcc5a[_0xae7e('0xb')](_[_0xae7e('0x8')]({'app':'Authenticate','appdata':_0x5b0c1f[_0xae7e('0xf')],'priority':_0x1af791++},_0x26728c));}_0x4fcc5a[_0xae7e('0xb')](_[_0xae7e('0x8')]({'app':_0xae7e('0x10'),'appdata':util[_0xae7e('0x4')](_0xae7e('0x11'),_0x150cc1['name'],_0x5b0c1f[_0xae7e('0x12')]?_0x5b0c1f[_0xae7e('0x12')][_0xae7e('0x13')](''):''),'priority':_0x1af791++},_0x26728c));if(_0x5b0c1f['record']){_0x4fcc5a['push'](_[_0xae7e('0x8')]({'app':_0xae7e('0x14'),'priority':_0x1af791++},_0x26728c));}return _0x4fcc5a;};var getChanSpyApplications=function(_0x4df021,_0x12e164){var _0x43f185=[];for(var _0xf3312e=0x0,_0x58a964=0x1;_0xf3312e<_0x12e164[_0xae7e('0x15')];_0xf3312e++,_0x58a964=0x1){_0x43f185=_0x43f185[_0xae7e('0x16')](getUserApplications(_0x4df021,_0x12e164[_0xf3312e],_0x12e164[_0xf3312e]['internal']));if(_0x12e164[_0xf3312e][_0xae7e('0x17')]!=_0x12e164[_0xf3312e]['name']){_0x43f185=_0x43f185[_0xae7e('0x16')](getUserApplications(_0x4df021,_0x12e164[_0xf3312e],_0x12e164[_0xf3312e][_0xae7e('0x18')]));}}return _0x43f185;};var getChanSpyPromise=function(_0x58bca5,_0x3c58a4){return new BPromise(function(_0x52fb21,_0x4b5db4){return _0x58bca5[_0xae7e('0x19')]['findAll']({'attributes':['id',_0xae7e('0x18'),_0xae7e('0x17')],'where':{'role':_0xae7e('0x1a'),'chanspy':!![]},'raw':!![]})['then'](function(_0x24bdd4){if(_0x24bdd4){return _0x52fb21(getChanSpyApplications(_0x3c58a4,_0x24bdd4));}return _0x52fb21([]);})[_0xae7e('0x1b')](function(_0x2aaa77){_0x4b5db4(_0x2aaa77);});});};module[_0xae7e('0x1c')]=function(_0x1478af,_0x527118){var _0x1f18d9=_0x1478af['models'];return _0x1478af['define'](_0xae7e('0x1d'),attributes,{'tableName':_0xae7e('0x1e'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x1a54a0,_0x84bc70,_0x456ce1){return getChanSpyPromise(_0x1f18d9,_0x1a54a0)[_0xae7e('0x1f')](function(_0x3c6d37){if(_0x3c6d37&&_0x3c6d37['length']){return _0x1f18d9[_0xae7e('0x20')][_0xae7e('0x21')](_0x3c6d37);}})['then'](function(){_0x456ce1();})['catch'](function(_0x4f38c3){_0x456ce1(_0x4f38c3);});},'afterUpdate':function(_0x1ad41b,_0x4aa87e,_0x285a6d){return _0x1f18d9[_0xae7e('0x20')][_0xae7e('0x22')]({'where':{'ChanSpyId':_0x1ad41b['id']}})['then'](function(){return getChanSpyPromise(_0x1f18d9,_0x1ad41b);})['then'](function(_0xb93ae1){if(_0xb93ae1&&_0xb93ae1['length']){return _0x1f18d9[_0xae7e('0x20')][_0xae7e('0x21')](_0xb93ae1);}})[_0xae7e('0x1f')](function(){_0x285a6d();})[_0xae7e('0x1b')](function(_0x1e7414){_0x285a6d(_0x1e7414);});},'afterDestroy':function(_0x538d61,_0x2dc160,_0x5de795){return _0x1f18d9['VoiceExtension'][_0xae7e('0x22')]({'where':{'ChanSpyId':_0x538d61['id']}})['then'](function(){_0x5de795();})[_0xae7e('0x1b')](function(_0x118f56){_0x5de795(_0x118f56);});}}});}; \ No newline at end of file +var _0x3be8=['MixMonitor','${UNIQUEID}.%s,ab','recordingFormat','auth','Authenticate','ChanSpy','SIP/%s,%s','name','options','length','internal','concat','agent','then','catch','exports','models','define','VoiceChanSpy','voice_chanspy','VoiceExtension','destroy','bulkCreate','util','bluebird','context','format','%s%s','prefix','system','Set','CDR(type)=%s','record','push','merge'];(function(_0x2ef816,_0x4a8328){var _0x276a0c=function(_0x2ea489){while(--_0x2ea489){_0x2ef816['push'](_0x2ef816['shift']());}};_0x276a0c(++_0x4a8328);}(_0x3be8,0x198));var _0x83be=function(_0x1f36a0,_0x43d338){_0x1f36a0=_0x1f36a0-0x0;var _0xe00103=_0x3be8[_0x1f36a0];return _0xe00103;};'use strict';var _=require('lodash');var util=require(_0x83be('0x0'));var BPromise=require(_0x83be('0x1'));var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x138d68,_0x42519f,_0x36a262){var _0x54482e=0x1;var _0x35926a=[];var _0x2411df={'context':_0x42519f[_0x83be('0x2')]||'from-sip','exten':util[_0x83be('0x3')](_0x83be('0x4'),_0x138d68[_0x83be('0x5')],_0x36a262),'type':_0x83be('0x6'),'isApp':![],'ChanSpyId':_0x138d68['id'],'UserId':_0x42519f['id']};_0x35926a['push'](_['merge']({'app':_0x83be('0x7'),'appdata':util[_0x83be('0x3')](_0x83be('0x8'),'chanspy'),'priority':_0x54482e++},_0x2411df));if(_0x138d68[_0x83be('0x9')]){_0x35926a[_0x83be('0xa')](_[_0x83be('0xb')]({'app':_0x83be('0xc'),'appdata':util[_0x83be('0x3')](_0x83be('0xd'),_0x138d68[_0x83be('0xe')]),'priority':_0x54482e++},_0x2411df));}if(_0x138d68[_0x83be('0xf')]){_0x35926a[_0x83be('0xa')](_[_0x83be('0xb')]({'app':_0x83be('0x10'),'appdata':_0x138d68['password'],'priority':_0x54482e++},_0x2411df));}_0x35926a[_0x83be('0xa')](_[_0x83be('0xb')]({'app':_0x83be('0x11'),'appdata':util[_0x83be('0x3')](_0x83be('0x12'),_0x42519f[_0x83be('0x13')],_0x138d68[_0x83be('0x14')]?_0x138d68[_0x83be('0x14')]['join'](''):''),'priority':_0x54482e++},_0x2411df));if(_0x138d68['record']){_0x35926a[_0x83be('0xa')](_[_0x83be('0xb')]({'app':'StopMixMonitor','priority':_0x54482e++},_0x2411df));}return _0x35926a;};var getChanSpyApplications=function(_0x385c6e,_0x240167){var _0x49e5ae=[];for(var _0x5780ca=0x0,_0x27fa03=0x1;_0x5780ca<_0x240167[_0x83be('0x15')];_0x5780ca++,_0x27fa03=0x1){_0x49e5ae=_0x49e5ae['concat'](getUserApplications(_0x385c6e,_0x240167[_0x5780ca],_0x240167[_0x5780ca][_0x83be('0x16')]));if(_0x240167[_0x5780ca]['internal']!=_0x240167[_0x5780ca][_0x83be('0x13')]){_0x49e5ae=_0x49e5ae[_0x83be('0x17')](getUserApplications(_0x385c6e,_0x240167[_0x5780ca],_0x240167[_0x5780ca][_0x83be('0x13')]));}}return _0x49e5ae;};var getChanSpyPromise=function(_0x10d8d4,_0x474e2d){return new BPromise(function(_0x2175e5,_0x1e04fc){return _0x10d8d4['User']['findAll']({'attributes':['id',_0x83be('0x13'),'internal'],'where':{'role':_0x83be('0x18'),'chanspy':!![]},'raw':!![]})[_0x83be('0x19')](function(_0x336e68){if(_0x336e68){return _0x2175e5(getChanSpyApplications(_0x474e2d,_0x336e68));}return _0x2175e5([]);})[_0x83be('0x1a')](function(_0x1fa4db){_0x1e04fc(_0x1fa4db);});});};module[_0x83be('0x1b')]=function(_0x486352,_0x38421d){var _0x2416ce=_0x486352[_0x83be('0x1c')];return _0x486352[_0x83be('0x1d')](_0x83be('0x1e'),attributes,{'tableName':_0x83be('0x1f'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x52bb32,_0x5e8b2b,_0x2dfd31){return getChanSpyPromise(_0x2416ce,_0x52bb32)['then'](function(_0x14c10a){if(_0x14c10a&&_0x14c10a[_0x83be('0x15')]){return _0x2416ce[_0x83be('0x20')]['bulkCreate'](_0x14c10a);}})['then'](function(){_0x2dfd31();})[_0x83be('0x1a')](function(_0x19084a){_0x2dfd31(_0x19084a);});},'afterUpdate':function(_0x828df8,_0x85d091,_0x210bbc){return _0x2416ce['VoiceExtension'][_0x83be('0x21')]({'where':{'ChanSpyId':_0x828df8['id']}})['then'](function(){return getChanSpyPromise(_0x2416ce,_0x828df8);})[_0x83be('0x19')](function(_0x367b9e){if(_0x367b9e&&_0x367b9e[_0x83be('0x15')]){return _0x2416ce[_0x83be('0x20')][_0x83be('0x22')](_0x367b9e);}})['then'](function(){_0x210bbc();})['catch'](function(_0x38f9c3){_0x210bbc(_0x38f9c3);});},'afterDestroy':function(_0x12ee7f,_0x5b0d02,_0x4b45f1){return _0x2416ce[_0x83be('0x20')][_0x83be('0x21')]({'where':{'ChanSpyId':_0x12ee7f['id']}})['then'](function(){_0x4b45f1();})[_0x83be('0x1a')](function(_0x29625f){_0x4b45f1(_0x29625f);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index fcf7581..d110ae8 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 _0xe0c1=['client','http','request','info','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceChanSpy,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/environment'];(function(_0x2ce1f7,_0x2b2478){var _0x3630fe=function(_0x5419e5){while(--_0x5419e5){_0x2ce1f7['push'](_0x2ce1f7['shift']());}};_0x3630fe(++_0x2b2478);}(_0xe0c1,0x1c6));var _0x1e0c=function(_0x4a159d,_0x28db19){_0x4a159d=_0x4a159d-0x0;var _0x1e4caa=_0xe0c1[_0x4a159d];return _0x1e4caa;};'use strict';var _=require(_0x1e0c('0x0'));var util=require(_0x1e0c('0x1'));var moment=require(_0x1e0c('0x2'));var BPromise=require('bluebird');var rs=require(_0x1e0c('0x3'));var fs=require('fs');var Redis=require(_0x1e0c('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x1e0c('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x1e0c('0x6')][_0x1e0c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x19c36c,_0x487a0d,_0x50f1d1){return new BPromise(function(_0x5dd605,_0x5d21ec){return client[_0x1e0c('0x8')](_0x19c36c,_0x50f1d1)['then'](function(_0x58328d){logger[_0x1e0c('0x9')]('VoiceChanSpy,\x20%s,\x20%s',_0x487a0d,_0x1e0c('0xa'));logger[_0x1e0c('0xb')](_0x1e0c('0xc'),_0x487a0d,'request\x20sent',JSON[_0x1e0c('0xd')](_0x58328d));if(_0x58328d[_0x1e0c('0xe')]){if(_0x58328d['error'][_0x1e0c('0xf')]===0x1f4){logger[_0x1e0c('0xe')](_0x1e0c('0x10'),_0x487a0d,_0x58328d[_0x1e0c('0xe')][_0x1e0c('0x11')]);return _0x5d21ec(_0x58328d[_0x1e0c('0xe')][_0x1e0c('0x11')]);}logger[_0x1e0c('0xe')](_0x1e0c('0x10'),_0x487a0d,_0x58328d[_0x1e0c('0xe')][_0x1e0c('0x11')]);return _0x5dd605(_0x58328d['error'][_0x1e0c('0x11')]);}else{logger['info'](_0x1e0c('0x10'),_0x487a0d,_0x1e0c('0xa'));_0x5dd605(_0x58328d[_0x1e0c('0x12')]['message']);}})[_0x1e0c('0x13')](function(_0x37dbb3){logger[_0x1e0c('0xe')](_0x1e0c('0x10'),_0x487a0d,_0x37dbb3);_0x5d21ec(_0x37dbb3);});});} \ No newline at end of file +var _0x2b7b=['code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x2087a4,_0x373dc2){var _0x1b9dc2=function(_0x3796cb){while(--_0x3796cb){_0x2087a4['push'](_0x2087a4['shift']());}};_0x1b9dc2(++_0x373dc2);}(_0x2b7b,0xd6));var _0xb2b7=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0x2b7b[_0x2dea24];return _0x309d58;};'use strict';var _=require(_0xb2b7('0x0'));var util=require(_0xb2b7('0x1'));var moment=require(_0xb2b7('0x2'));var BPromise=require('bluebird');var rs=require(_0xb2b7('0x3'));var fs=require('fs');var Redis=require(_0xb2b7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb2b7('0x5'));var logger=require(_0xb2b7('0x6'))(_0xb2b7('0x7'));var config=require('../../config/environment');var jayson=require(_0xb2b7('0x8'));var client=jayson[_0xb2b7('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x161368,_0x52979f,_0x5d6cb3){return new BPromise(function(_0x5cf602,_0x4e0de8){return client[_0xb2b7('0xa')](_0x161368,_0x5d6cb3)['then'](function(_0x36b858){logger[_0xb2b7('0xb')](_0xb2b7('0xc'),_0x52979f,_0xb2b7('0xd'));logger[_0xb2b7('0xe')]('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0x52979f,_0xb2b7('0xd'),JSON[_0xb2b7('0xf')](_0x36b858));if(_0x36b858[_0xb2b7('0x10')]){if(_0x36b858[_0xb2b7('0x10')][_0xb2b7('0x11')]===0x1f4){logger[_0xb2b7('0x10')](_0xb2b7('0xc'),_0x52979f,_0x36b858[_0xb2b7('0x10')][_0xb2b7('0x12')]);return _0x4e0de8(_0x36b858[_0xb2b7('0x10')][_0xb2b7('0x12')]);}logger[_0xb2b7('0x10')](_0xb2b7('0xc'),_0x52979f,_0x36b858['error'][_0xb2b7('0x12')]);return _0x5cf602(_0x36b858[_0xb2b7('0x10')][_0xb2b7('0x12')]);}else{logger['info']('VoiceChanSpy,\x20%s,\x20%s',_0x52979f,_0xb2b7('0xd'));_0x5cf602(_0x36b858[_0xb2b7('0x13')][_0xb2b7('0x12')]);}})[_0xb2b7('0x14')](function(_0x2615cc){logger[_0xb2b7('0x10')](_0xb2b7('0xc'),_0x52979f,_0x2615cc);_0x4e0de8(_0x2615cc);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index b0d8c5b..648c908 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 _0x25ba=['destroy','exports','multer','connect-timeout','express','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','post','create','put','update'];(function(_0x146eff,_0x361bcd){var _0x36209e=function(_0x9c6dda){while(--_0x9c6dda){_0x146eff['push'](_0x146eff['shift']());}};_0x36209e(++_0x361bcd);}(_0x25ba,0x162));var _0xa25b=function(_0x989175,_0x334788){_0x989175=_0x989175-0x0;var _0x2e5dac=_0x25ba[_0x989175];return _0x2e5dac;};'use strict';var multer=require(_0xa25b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa25b('0x1'));var express=require(_0xa25b('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xa25b('0x3'));var config=require(_0xa25b('0x4'));var controller=require('./voiceContext.controller');router['get']('/',auth[_0xa25b('0x5')](),controller[_0xa25b('0x6')]);router[_0xa25b('0x7')](_0xa25b('0x8'),auth[_0xa25b('0x5')](),controller[_0xa25b('0x9')]);router[_0xa25b('0xa')]('/',auth[_0xa25b('0x5')](),controller[_0xa25b('0xb')]);router[_0xa25b('0xc')](_0xa25b('0x8'),auth['isAuthenticated'](),controller[_0xa25b('0xd')]);router['delete'](_0xa25b('0x8'),auth[_0xa25b('0x5')](),controller[_0xa25b('0xe')]);module[_0xa25b('0xf')]=router; \ No newline at end of file +var _0x20b5=['put','/:id','update','delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','./voiceContext.controller','get','isAuthenticated','index','show','post','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x20b5,0x1e1));var _0x520b=function(_0x510752,_0x3383fc){_0x510752=_0x510752-0x0;var _0x17102d=_0x20b5[_0x510752];return _0x17102d;};'use strict';var multer=require(_0x520b('0x0'));var util=require('util');var path=require(_0x520b('0x1'));var timeout=require('connect-timeout');var express=require(_0x520b('0x2'));var router=express[_0x520b('0x3')]();var auth=require(_0x520b('0x4'));var interaction=require(_0x520b('0x5'));var config=require('../../config/environment');var controller=require(_0x520b('0x6'));router[_0x520b('0x7')]('/',auth[_0x520b('0x8')](),controller[_0x520b('0x9')]);router['get']('/:id',auth[_0x520b('0x8')](),controller[_0x520b('0xa')]);router[_0x520b('0xb')]('/',auth[_0x520b('0x8')](),controller[_0x520b('0xc')]);router[_0x520b('0xd')](_0x520b('0xe'),auth['isAuthenticated'](),controller[_0x520b('0xf')]);router[_0x520b('0x10')]('/:id',auth[_0x520b('0x8')](),controller[_0x520b('0x11')]);module[_0x520b('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 9e1384f..7220ace 100644 --- a/server/api/voiceContext/voiceContext.attributes.js +++ b/server/api/voiceContext/voiceContext.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['sequelize','exports','STRING','name','BOOLEAN'];(function(_0x25261f,_0x1787c5){var _0x3bcc56=function(_0x219b74){while(--_0x219b74){_0x25261f['push'](_0x25261f['shift']());}};_0x3bcc56(++_0x1787c5);}(_0x34e8,0x12c));var _0x834e=function(_0x2d603d,_0x1f79d3){_0x2d603d=_0x2d603d-0x0;var _0x41e79e=_0x34e8[_0x2d603d];return _0x41e79e;};'use strict';var Sequelize=require(_0x834e('0x0'));module[_0x834e('0x1')]={'name':{'type':Sequelize[_0x834e('0x2')],'unique':_0x834e('0x3')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x834e('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x9957=['name','BOOLEAN','sequelize','exports','STRING'];(function(_0x30fd3c,_0x51b3be){var _0x4e9d54=function(_0x2f84c9){while(--_0x2f84c9){_0x30fd3c['push'](_0x30fd3c['shift']());}};_0x4e9d54(++_0x51b3be);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'name':{'type':Sequelize[_0x7995('0x2')],'unique':_0x7995('0x3')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x7995('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index 895755c..c75e08a 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 _0xc6de=['path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','test','then','VoiceContext,\x20%s,\x20%s','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','result','catch','sendStatus','status','end','count','offset','set','Content-Range','json','apply','reject','save','update','destroy','get','stack','name','send','index','map','VoiceContext','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','limit','order','sort','filter','merge','VIRTUAL','where','include','findAll','show','params','includeAll','options','find','create','body','readFileSync','join','root','server/files/templates/context.ejs','/etc/asterisk/extensions_xcally_contexts.conf','Reload','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','utf8','render','chan_sip.so','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util'];(function(_0x22416b,_0x57990d){var _0x28367d=function(_0x355d01){while(--_0x355d01){_0x22416b['push'](_0x22416b['shift']());}};_0x28367d(++_0x57990d);}(_0xc6de,0x193));var _0xec6d=function(_0x16ed87,_0x1be1a2){_0x16ed87=_0x16ed87-0x0;var _0xc1a1d8=_0xc6de[_0x16ed87];return _0xc1a1d8;};'use strict';var pdf=require(_0xec6d('0x0'));var emlformat=require(_0xec6d('0x1'));var rimraf=require(_0xec6d('0x2'));var zipdir=require(_0xec6d('0x3'));var jsonpatch=require(_0xec6d('0x4'));var rp=require(_0xec6d('0x5'));var moment=require('moment');var BPromise=require(_0xec6d('0x6'));var Mustache=require(_0xec6d('0x7'));var util=require(_0xec6d('0x8'));var path=require(_0xec6d('0x9'));var sox=require(_0xec6d('0xa'));var csv=require(_0xec6d('0xb'));var ejs=require(_0xec6d('0xc'));var fs=require('fs');var _=require(_0xec6d('0xd'));var squel=require(_0xec6d('0xe'));var crypto=require(_0xec6d('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xec6d('0x10'));var toCsv=require(_0xec6d('0xb'));var querystring=require('querystring');var Papa=require(_0xec6d('0x11'));var Redis=require(_0xec6d('0x12'));var authService=require(_0xec6d('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xec6d('0x14'));var hardwareService=require(_0xec6d('0x15'));var logger=require(_0xec6d('0x16'))(_0xec6d('0x17'));var utils=require(_0xec6d('0x18'));var config=require(_0xec6d('0x19'));var db=require(_0xec6d('0x1a'))['db'];var jayson=require(_0xec6d('0x1b'));var client=jayson[_0xec6d('0x1c')]['http']({'port':0x232a});function checkPasswordPattern(_0x121361,_0x48e8d1,_0x4e7c95){if(_0x4e7c95){var _0x5cd358=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5cd358[_0xec6d('0x1d')](_0x48e8d1)){return _0x121361;}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 _0x121361;}}function respondWithRpcPromise(_0x245101,_0x37fb69,_0x56bba6,_0x3d34f4){return new BPromise(function(_0x2f2ea8,_0x1484b7){var _0x4d8dba=_0x3d34f4||client;return _0x4d8dba['request'](_0x245101,_0x56bba6)[_0xec6d('0x1e')](function(_0x25c72d){logger['info'](_0xec6d('0x1f'),_0x37fb69,'request\x20sent');logger['debug'](_0xec6d('0x20'),_0x37fb69,_0xec6d('0x21'),JSON['stringify'](_0x25c72d));if(_0x25c72d[_0xec6d('0x22')]){if(_0x25c72d[_0xec6d('0x22')]['code']===0x1f4){logger[_0xec6d('0x22')]('VoiceContext,\x20%s,\x20%s',_0x37fb69,_0x25c72d['error'][_0xec6d('0x23')]);return _0x1484b7(_0x25c72d[_0xec6d('0x22')][_0xec6d('0x23')]);}logger['error'](_0xec6d('0x1f'),_0x37fb69,_0x25c72d[_0xec6d('0x22')][_0xec6d('0x23')]);return _0x2f2ea8(_0x25c72d[_0xec6d('0x22')]['message']);}else{logger[_0xec6d('0x24')](_0xec6d('0x1f'),_0x37fb69,_0xec6d('0x21'));_0x2f2ea8(_0x25c72d[_0xec6d('0x25')][_0xec6d('0x23')]);}})[_0xec6d('0x26')](function(_0x273068){logger['error']('VoiceContext,\x20%s,\x20%s',_0x37fb69,_0x273068);_0x1484b7(_0x273068);});});}function respondWithStatusCode(_0x33a7cd,_0x4a6da1){_0x4a6da1=_0x4a6da1||0xcc;return function(_0x7443b0){if(_0x7443b0){return _0x33a7cd[_0xec6d('0x27')](_0x4a6da1);}return _0x33a7cd[_0xec6d('0x28')](_0x4a6da1)[_0xec6d('0x29')]();};}function respondWithResult(_0x48690d,_0x465f88){_0x465f88=_0x465f88||0xc8;return function(_0x80ece){if(_0x80ece){return _0x48690d[_0xec6d('0x28')](_0x465f88)['json'](_0x80ece);}};}function respondWithFilteredResult(_0x1dfbeb,_0x1a524c){return function(_0x31709a){if(_0x31709a){var _0x1f1b9f=_0x31709a[_0xec6d('0x2a')],_0x1c6652=_0x1a524c['offset'],_0x50ea54=_0x1a524c[_0xec6d('0x2b')]+_0x1a524c['limit'],_0x19eef1;if(_0x50ea54>=_0x1f1b9f){_0x50ea54=_0x1f1b9f;_0x19eef1=0xc8;}else{_0x19eef1=0xce;}_0x1dfbeb['status'](_0x19eef1);return _0x1dfbeb[_0xec6d('0x2c')](_0xec6d('0x2d'),_0x1c6652+'-'+_0x50ea54+'/'+_0x1f1b9f)[_0xec6d('0x2e')](_0x31709a);}return null;};}function patchUpdates(_0x4d05d9){return function(_0x25b0e5){try{jsonpatch[_0xec6d('0x2f')](_0x25b0e5,_0x4d05d9,!![]);}catch(_0x27ae5c){return BPromise[_0xec6d('0x30')](_0x27ae5c);}return _0x25b0e5[_0xec6d('0x31')]();};}function saveUpdates(_0x5e925b,_0x23bcbb){return function(_0x505fa4){if(_0x505fa4){return _0x505fa4[_0xec6d('0x32')](_0x5e925b)[_0xec6d('0x1e')](function(_0x533ff1){return _0x533ff1;});}return null;};}function removeEntity(_0x4adcc2,_0x22d6b7){return function(_0x3fb571){if(_0x3fb571){return _0x3fb571[_0xec6d('0x33')]()[_0xec6d('0x1e')](function(){var _0x1a13a9=_0x3fb571[_0xec6d('0x34')]({'plain':!![]});var _0xfe1a4a='Contexts';return db['UserProfileResource'][_0xec6d('0x33')]({'where':{'type':_0xfe1a4a,'resourceId':_0x1a13a9['id']}})[_0xec6d('0x1e')](function(){return _0x3fb571;});})['then'](function(){_0x4adcc2['status'](0xcc)[_0xec6d('0x29')]();});}};}function handleEntityNotFound(_0x2c9f3c,_0x4631e9){return function(_0x2cd6a6){if(!_0x2cd6a6){_0x2c9f3c[_0xec6d('0x27')](0x194);}return _0x2cd6a6;};}function handleError(_0x1d12c1,_0x1980e3){_0x1980e3=_0x1980e3||0x1f4;return function(_0x55854a){logger[_0xec6d('0x22')](_0x55854a[_0xec6d('0x35')]);if(_0x55854a[_0xec6d('0x36')]){delete _0x55854a['name'];}_0x1d12c1[_0xec6d('0x28')](_0x1980e3)[_0xec6d('0x37')](_0x55854a);};}exports[_0xec6d('0x38')]=function(_0x3d56c6,_0x37aa26){var _0x17f13c={},_0x19edf6={},_0x846107={'count':0x0,'rows':[]};var _0x3ee0fe=_[_0xec6d('0x39')](db[_0xec6d('0x3a')][_0xec6d('0x3b')],function(_0x24fe87){return{'name':_0x24fe87[_0xec6d('0x3c')],'type':_0x24fe87[_0xec6d('0x3d')]['key']};});_0x19edf6[_0xec6d('0x3e')]=_[_0xec6d('0x39')](_0x3ee0fe,_0xec6d('0x36'));_0x19edf6[_0xec6d('0x3f')]=_[_0xec6d('0x40')](_0x3d56c6['query']);_0x19edf6[_0xec6d('0x41')]=_['intersection'](_0x19edf6[_0xec6d('0x3e')],_0x19edf6[_0xec6d('0x3f')]);_0x17f13c[_0xec6d('0x42')]=_[_0xec6d('0x43')](_0x19edf6['model'],qs[_0xec6d('0x44')](_0x3d56c6['query'][_0xec6d('0x44')]));_0x17f13c['attributes']=_0x17f13c[_0xec6d('0x42')]['length']?_0x17f13c[_0xec6d('0x42')]:_0x19edf6[_0xec6d('0x3e')];if(!_0x3d56c6[_0xec6d('0x3f')][_0xec6d('0x45')](_0xec6d('0x46'))){_0x17f13c['limit']=qs[_0xec6d('0x47')](_0x3d56c6['query'][_0xec6d('0x47')]);_0x17f13c[_0xec6d('0x2b')]=qs[_0xec6d('0x2b')](_0x3d56c6[_0xec6d('0x3f')][_0xec6d('0x2b')]);}_0x17f13c[_0xec6d('0x48')]=qs[_0xec6d('0x49')](_0x3d56c6['query']['sort']);_0x17f13c['where']=qs[_0xec6d('0x41')](_['pick'](_0x3d56c6['query'],_0x19edf6[_0xec6d('0x41')]));if(_0x3d56c6[_0xec6d('0x3f')][_0xec6d('0x4a')]){_0x17f13c['where']=_[_0xec6d('0x4b')](_0x17f13c['where'],{'$or':_[_0xec6d('0x39')](_0x3ee0fe,function(_0x51cc35){if(_0x51cc35[_0xec6d('0x3d')]!==_0xec6d('0x4c')){var _0xc845b5={};_0xc845b5[_0x51cc35['name']]={'$like':'%'+_0x3d56c6[_0xec6d('0x3f')][_0xec6d('0x4a')]+'%'};return _0xc845b5;}})});}_0x17f13c=_[_0xec6d('0x4b')]({},_0x17f13c,_0x3d56c6['options']);var _0x3d4407={'where':_0x17f13c[_0xec6d('0x4d')]};return db[_0xec6d('0x3a')][_0xec6d('0x2a')](_0x3d4407)[_0xec6d('0x1e')](function(_0xb4dfe0){_0x846107['count']=_0xb4dfe0;if(_0x3d56c6[_0xec6d('0x3f')]['includeAll']){_0x17f13c[_0xec6d('0x4e')]=[{'all':!![]}];}return db['VoiceContext'][_0xec6d('0x4f')](_0x17f13c);})[_0xec6d('0x1e')](function(_0x721f09){_0x846107['rows']=_0x721f09;return _0x846107;})['then'](respondWithFilteredResult(_0x37aa26,_0x17f13c))[_0xec6d('0x26')](handleError(_0x37aa26,null));};exports[_0xec6d('0x50')]=function(_0x36cbce,_0x4bd51c){var _0x25fa34={'raw':![],'where':{'id':_0x36cbce[_0xec6d('0x51')]['id']}},_0x77bbc6={};_0x77bbc6[_0xec6d('0x3e')]=_[_0xec6d('0x40')](db[_0xec6d('0x3a')][_0xec6d('0x3b')]);_0x77bbc6[_0xec6d('0x3f')]=_['keys'](_0x36cbce[_0xec6d('0x3f')]);_0x77bbc6[_0xec6d('0x41')]=_[_0xec6d('0x43')](_0x77bbc6[_0xec6d('0x3e')],_0x77bbc6['query']);_0x25fa34[_0xec6d('0x42')]=_[_0xec6d('0x43')](_0x77bbc6[_0xec6d('0x3e')],qs[_0xec6d('0x44')](_0x36cbce[_0xec6d('0x3f')][_0xec6d('0x44')]));_0x25fa34['attributes']=_0x25fa34[_0xec6d('0x42')]['length']?_0x25fa34[_0xec6d('0x42')]:_0x77bbc6['model'];if(_0x36cbce[_0xec6d('0x3f')][_0xec6d('0x52')]){_0x25fa34['include']=[{'all':!![]}];}_0x25fa34=_[_0xec6d('0x4b')]({},_0x25fa34,_0x36cbce[_0xec6d('0x53')]);return db[_0xec6d('0x3a')][_0xec6d('0x54')](_0x25fa34)[_0xec6d('0x1e')](handleEntityNotFound(_0x4bd51c,null))[_0xec6d('0x1e')](respondWithResult(_0x4bd51c,null))[_0xec6d('0x26')](handleError(_0x4bd51c,null));};exports[_0xec6d('0x55')]=function(_0xf30335,_0x2c63f2,_0x44c971){var _0x16b68d;return db[_0xec6d('0x3a')][_0xec6d('0x55')](_0xf30335[_0xec6d('0x56')],{'raw':!![]})[_0xec6d('0x1e')](function(_0x3c9991){_0x16b68d=_0x3c9991;return db[_0xec6d('0x3a')][_0xec6d('0x4f')]({'raw':!![]});})['then'](function(_0x613972){var _0x5a890f=fs[_0xec6d('0x57')](path[_0xec6d('0x58')](config[_0xec6d('0x59')],_0xec6d('0x5a')),'utf8');var _0x17ae55=ejs['render'](_0x5a890f,{'contexts':_0x613972||[]});fs['writeFileSync'](_0xec6d('0x5b'),_0x17ae55);})[_0xec6d('0x1e')](function(){return respondWithRpcPromise(_0xec6d('0x5c'),_0xec6d('0x55'),{'module':'chan_sip.so'});})['then'](function(){var _0x21ad74=_0xf30335[_0xec6d('0x5d')]['get']({'plain':!![]});if(!_0x21ad74)throw new Error(_0xec6d('0x5e'));if(_0x21ad74['role']==='user'){var _0x13c4c7=_0x16b68d['get']({'plain':!![]});return db[_0xec6d('0x5f')][_0xec6d('0x54')]({'where':{'name':'Contexts','userProfileId':_0x21ad74[_0xec6d('0x60')]},'raw':!![]})[_0xec6d('0x1e')](function(_0x514508){if(_0x514508&&_0x514508[_0xec6d('0x61')]===0x0){return db[_0xec6d('0x62')][_0xec6d('0x55')]({'name':_0x13c4c7[_0xec6d('0x36')],'resourceId':_0x13c4c7['id'],'type':_0x514508[_0xec6d('0x36')],'sectionId':_0x514508['id']},{})[_0xec6d('0x1e')](function(){return _0x16b68d;});}else{return _0x16b68d;}})['catch'](function(_0x4215b2){logger[_0xec6d('0x22')](_0xec6d('0x63'),_0x4215b2);throw _0x4215b2;});}return _0x16b68d;})[_0xec6d('0x1e')](respondWithResult(_0x2c63f2,0xc9))[_0xec6d('0x26')](handleError(_0x2c63f2,null));};exports['update']=function(_0x36bf35,_0x2c6c4d,_0x145aaa){var _0x2f5def;return db[_0xec6d('0x3a')][_0xec6d('0x54')]({'where':{'id':_0x36bf35[_0xec6d('0x51')]['id']}})['then'](handleEntityNotFound(_0x2c6c4d,null))[_0xec6d('0x1e')](saveUpdates(_0x36bf35['body'],null))[_0xec6d('0x1e')](function(_0x4aef96){if(_0x4aef96){_0x2f5def=_0x4aef96;return db[_0xec6d('0x3a')][_0xec6d('0x4f')]({'raw':!![]});}})[_0xec6d('0x1e')](function(_0x22d4db){var _0x7885c4=fs[_0xec6d('0x57')](path[_0xec6d('0x58')](config[_0xec6d('0x59')],_0xec6d('0x5a')),_0xec6d('0x64'));var _0xde0567=ejs[_0xec6d('0x65')](_0x7885c4,{'contexts':_0x22d4db||[]});fs['writeFileSync']('/etc/asterisk/extensions_xcally_contexts.conf',_0xde0567);})[_0xec6d('0x1e')](function(){return respondWithRpcPromise(_0xec6d('0x5c'),_0xec6d('0x32'),{'module':_0xec6d('0x66')});})['then'](function(){return _0x2f5def;})['then'](respondWithResult(_0x2c6c4d,null))[_0xec6d('0x26')](handleError(_0x2c6c4d,null));};exports[_0xec6d('0x33')]=function(_0x3b8f6b,_0x4ae649,_0xd68b63){var _0x32041e;return db[_0xec6d('0x3a')][_0xec6d('0x54')]({'where':{'id':_0x3b8f6b[_0xec6d('0x51')]['id']}})[_0xec6d('0x1e')](handleEntityNotFound(_0x4ae649,null))[_0xec6d('0x1e')](removeEntity(_0x4ae649,null))[_0xec6d('0x1e')](function(){return db[_0xec6d('0x3a')][_0xec6d('0x4f')]({'raw':!![]});})['then'](function(_0x3e192a){var _0x26188f=fs[_0xec6d('0x57')](path['join'](config[_0xec6d('0x59')],_0xec6d('0x5a')),_0xec6d('0x64'));var _0x7aa978=ejs[_0xec6d('0x65')](_0x26188f,{'contexts':_0x3e192a});fs['writeFileSync'](_0xec6d('0x5b'),_0x7aa978);return respondWithRpcPromise(_0xec6d('0x5c'),'destroy',{'module':'chan_sip.so'});})[_0xec6d('0x26')](handleError(_0x4ae649,null));}; \ No newline at end of file +var _0x7ea5=['chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','root','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','client','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','VoiceContext,\x20%s,\x20%s','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','status','end','count','offset','set','Content-Range','json','apply','reject','save','update','destroy','get','Contexts','UserProfileResource','sendStatus','stack','name','index','map','VoiceContext','rawAttributes','type','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','merge','filter','options','includeAll','include','findAll','rows','show','params','find','create','body','join','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x7ea5,0x1ca));var _0x57ea=function(_0x26c207,_0x2a6990){_0x26c207=_0x26c207-0x0;var _0x482006=_0x7ea5[_0x26c207];return _0x482006;};'use strict';var pdf=require(_0x57ea('0x0'));var emlformat=require(_0x57ea('0x1'));var rimraf=require(_0x57ea('0x2'));var zipdir=require(_0x57ea('0x3'));var jsonpatch=require(_0x57ea('0x4'));var rp=require(_0x57ea('0x5'));var moment=require(_0x57ea('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x57ea('0x7'));var util=require(_0x57ea('0x8'));var path=require(_0x57ea('0x9'));var sox=require(_0x57ea('0xa'));var csv=require(_0x57ea('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x57ea('0xc'));var squel=require(_0x57ea('0xd'));var crypto=require(_0x57ea('0xe'));var jsforce=require(_0x57ea('0xf'));var deskjs=require(_0x57ea('0x10'));var toCsv=require(_0x57ea('0xb'));var querystring=require(_0x57ea('0x11'));var Papa=require(_0x57ea('0x12'));var Redis=require(_0x57ea('0x13'));var authService=require(_0x57ea('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x57ea('0x15'));var hardwareService=require(_0x57ea('0x16'));var logger=require(_0x57ea('0x17'))(_0x57ea('0x18'));var utils=require('../../config/utils');var config=require(_0x57ea('0x19'));var db=require(_0x57ea('0x1a'))['db'];var jayson=require(_0x57ea('0x1b'));var client=jayson[_0x57ea('0x1c')]['http']({'port':0x232a});function checkPasswordPattern(_0x4a7b55,_0x40977c,_0x465ca4){if(_0x465ca4){var _0x5f3bad=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5f3bad[_0x57ea('0x1d')](_0x40977c)){return _0x4a7b55;}else{throw new db[(_0x57ea('0x1e'))][(_0x57ea('0x1f'))](_0x57ea('0x20'));}}else{return _0x4a7b55;}}function respondWithRpcPromise(_0xe66187,_0x1efad2,_0x977325,_0x120e45){return new BPromise(function(_0x1c4c3f,_0x4d290d){var _0x28d199=_0x120e45||client;return _0x28d199[_0x57ea('0x21')](_0xe66187,_0x977325)[_0x57ea('0x22')](function(_0x437db1){logger[_0x57ea('0x23')](_0x57ea('0x24'),_0x1efad2,'request\x20sent');logger['debug'](_0x57ea('0x25'),_0x1efad2,_0x57ea('0x26'),JSON[_0x57ea('0x27')](_0x437db1));if(_0x437db1['error']){if(_0x437db1[_0x57ea('0x28')][_0x57ea('0x29')]===0x1f4){logger[_0x57ea('0x28')](_0x57ea('0x24'),_0x1efad2,_0x437db1[_0x57ea('0x28')]['message']);return _0x4d290d(_0x437db1[_0x57ea('0x28')][_0x57ea('0x2a')]);}logger[_0x57ea('0x28')](_0x57ea('0x24'),_0x1efad2,_0x437db1[_0x57ea('0x28')][_0x57ea('0x2a')]);return _0x1c4c3f(_0x437db1[_0x57ea('0x28')][_0x57ea('0x2a')]);}else{logger[_0x57ea('0x23')]('VoiceContext,\x20%s,\x20%s',_0x1efad2,_0x57ea('0x26'));_0x1c4c3f(_0x437db1[_0x57ea('0x2b')]['message']);}})[_0x57ea('0x2c')](function(_0x59f425){logger[_0x57ea('0x28')]('VoiceContext,\x20%s,\x20%s',_0x1efad2,_0x59f425);_0x4d290d(_0x59f425);});});}function respondWithStatusCode(_0x2eaa50,_0x413c32){_0x413c32=_0x413c32||0xcc;return function(_0x2d59b7){if(_0x2d59b7){return _0x2eaa50['sendStatus'](_0x413c32);}return _0x2eaa50[_0x57ea('0x2d')](_0x413c32)[_0x57ea('0x2e')]();};}function respondWithResult(_0x3761f7,_0x4c4700){_0x4c4700=_0x4c4700||0xc8;return function(_0x206144){if(_0x206144){return _0x3761f7['status'](_0x4c4700)['json'](_0x206144);}};}function respondWithFilteredResult(_0x222bfc,_0xca5b67){return function(_0x27deb3){if(_0x27deb3){var _0x38429a=_0x27deb3[_0x57ea('0x2f')],_0x4fe329=_0xca5b67[_0x57ea('0x30')],_0x5f5bda=_0xca5b67[_0x57ea('0x30')]+_0xca5b67['limit'],_0xe31f94;if(_0x5f5bda>=_0x38429a){_0x5f5bda=_0x38429a;_0xe31f94=0xc8;}else{_0xe31f94=0xce;}_0x222bfc[_0x57ea('0x2d')](_0xe31f94);return _0x222bfc[_0x57ea('0x31')](_0x57ea('0x32'),_0x4fe329+'-'+_0x5f5bda+'/'+_0x38429a)[_0x57ea('0x33')](_0x27deb3);}return null;};}function patchUpdates(_0x1950cc){return function(_0x5df58a){try{jsonpatch[_0x57ea('0x34')](_0x5df58a,_0x1950cc,!![]);}catch(_0x2e3100){return BPromise[_0x57ea('0x35')](_0x2e3100);}return _0x5df58a[_0x57ea('0x36')]();};}function saveUpdates(_0x38ede3,_0xc61e89){return function(_0x2b808b){if(_0x2b808b){return _0x2b808b[_0x57ea('0x37')](_0x38ede3)[_0x57ea('0x22')](function(_0x40e4d5){return _0x40e4d5;});}return null;};}function removeEntity(_0x3a8966,_0x3f0643){return function(_0x5e5751){if(_0x5e5751){return _0x5e5751[_0x57ea('0x38')]()['then'](function(){var _0x5790d2=_0x5e5751[_0x57ea('0x39')]({'plain':!![]});var _0x4dbe12=_0x57ea('0x3a');return db[_0x57ea('0x3b')][_0x57ea('0x38')]({'where':{'type':_0x4dbe12,'resourceId':_0x5790d2['id']}})[_0x57ea('0x22')](function(){return _0x5e5751;});})['then'](function(){_0x3a8966[_0x57ea('0x2d')](0xcc)[_0x57ea('0x2e')]();});}};}function handleEntityNotFound(_0x2d11cd,_0x32a175){return function(_0x2e0f57){if(!_0x2e0f57){_0x2d11cd[_0x57ea('0x3c')](0x194);}return _0x2e0f57;};}function handleError(_0x35d853,_0x137a3c){_0x137a3c=_0x137a3c||0x1f4;return function(_0x8442b6){logger[_0x57ea('0x28')](_0x8442b6[_0x57ea('0x3d')]);if(_0x8442b6['name']){delete _0x8442b6[_0x57ea('0x3e')];}_0x35d853[_0x57ea('0x2d')](_0x137a3c)['send'](_0x8442b6);};}exports[_0x57ea('0x3f')]=function(_0x932901,_0x101a0f){var _0x491b05={},_0x4a1af2={},_0x50abcd={'count':0x0,'rows':[]};var _0x3948c1=_[_0x57ea('0x40')](db[_0x57ea('0x41')][_0x57ea('0x42')],function(_0x32377a){return{'name':_0x32377a['fieldName'],'type':_0x32377a[_0x57ea('0x43')]['key']};});_0x4a1af2[_0x57ea('0x44')]=_['map'](_0x3948c1,'name');_0x4a1af2[_0x57ea('0x45')]=_[_0x57ea('0x46')](_0x932901['query']);_0x4a1af2['filters']=_['intersection'](_0x4a1af2[_0x57ea('0x44')],_0x4a1af2[_0x57ea('0x45')]);_0x491b05[_0x57ea('0x47')]=_[_0x57ea('0x48')](_0x4a1af2['model'],qs[_0x57ea('0x49')](_0x932901[_0x57ea('0x45')]['fields']));_0x491b05[_0x57ea('0x47')]=_0x491b05[_0x57ea('0x47')][_0x57ea('0x4a')]?_0x491b05[_0x57ea('0x47')]:_0x4a1af2[_0x57ea('0x44')];if(!_0x932901[_0x57ea('0x45')][_0x57ea('0x4b')](_0x57ea('0x4c'))){_0x491b05['limit']=qs['limit'](_0x932901[_0x57ea('0x45')][_0x57ea('0x4d')]);_0x491b05[_0x57ea('0x30')]=qs[_0x57ea('0x30')](_0x932901['query']['offset']);}_0x491b05[_0x57ea('0x4e')]=qs[_0x57ea('0x4f')](_0x932901['query'][_0x57ea('0x4f')]);_0x491b05[_0x57ea('0x50')]=qs[_0x57ea('0x51')](_[_0x57ea('0x52')](_0x932901['query'],_0x4a1af2[_0x57ea('0x51')]));if(_0x932901['query']['filter']){_0x491b05[_0x57ea('0x50')]=_[_0x57ea('0x53')](_0x491b05['where'],{'$or':_['map'](_0x3948c1,function(_0x26e704){if(_0x26e704[_0x57ea('0x43')]!=='VIRTUAL'){var _0x273dc0={};_0x273dc0[_0x26e704['name']]={'$like':'%'+_0x932901[_0x57ea('0x45')][_0x57ea('0x54')]+'%'};return _0x273dc0;}})});}_0x491b05=_[_0x57ea('0x53')]({},_0x491b05,_0x932901[_0x57ea('0x55')]);var _0x3d24ee={'where':_0x491b05[_0x57ea('0x50')]};return db['VoiceContext'][_0x57ea('0x2f')](_0x3d24ee)[_0x57ea('0x22')](function(_0x490e8d){_0x50abcd[_0x57ea('0x2f')]=_0x490e8d;if(_0x932901[_0x57ea('0x45')][_0x57ea('0x56')]){_0x491b05[_0x57ea('0x57')]=[{'all':!![]}];}return db['VoiceContext'][_0x57ea('0x58')](_0x491b05);})['then'](function(_0xc7b50f){_0x50abcd[_0x57ea('0x59')]=_0xc7b50f;return _0x50abcd;})[_0x57ea('0x22')](respondWithFilteredResult(_0x101a0f,_0x491b05))[_0x57ea('0x2c')](handleError(_0x101a0f,null));};exports[_0x57ea('0x5a')]=function(_0x4e17cb,_0x5cf911){var _0x1b13e4={'raw':![],'where':{'id':_0x4e17cb[_0x57ea('0x5b')]['id']}},_0x48ac3d={};_0x48ac3d[_0x57ea('0x44')]=_['keys'](db[_0x57ea('0x41')][_0x57ea('0x42')]);_0x48ac3d[_0x57ea('0x45')]=_[_0x57ea('0x46')](_0x4e17cb[_0x57ea('0x45')]);_0x48ac3d['filters']=_['intersection'](_0x48ac3d[_0x57ea('0x44')],_0x48ac3d[_0x57ea('0x45')]);_0x1b13e4[_0x57ea('0x47')]=_['intersection'](_0x48ac3d[_0x57ea('0x44')],qs[_0x57ea('0x49')](_0x4e17cb[_0x57ea('0x45')][_0x57ea('0x49')]));_0x1b13e4[_0x57ea('0x47')]=_0x1b13e4['attributes'][_0x57ea('0x4a')]?_0x1b13e4[_0x57ea('0x47')]:_0x48ac3d[_0x57ea('0x44')];if(_0x4e17cb[_0x57ea('0x45')]['includeAll']){_0x1b13e4['include']=[{'all':!![]}];}_0x1b13e4=_[_0x57ea('0x53')]({},_0x1b13e4,_0x4e17cb['options']);return db['VoiceContext'][_0x57ea('0x5c')](_0x1b13e4)[_0x57ea('0x22')](handleEntityNotFound(_0x5cf911,null))['then'](respondWithResult(_0x5cf911,null))[_0x57ea('0x2c')](handleError(_0x5cf911,null));};exports['create']=function(_0x526554,_0x208e20,_0x5d9ad3){var _0x1f9506;return db[_0x57ea('0x41')][_0x57ea('0x5d')](_0x526554[_0x57ea('0x5e')],{'raw':!![]})[_0x57ea('0x22')](function(_0x1f73f7){_0x1f9506=_0x1f73f7;return db[_0x57ea('0x41')][_0x57ea('0x58')]({'raw':!![]});})[_0x57ea('0x22')](function(_0x173298){var _0x4b30a4=fs['readFileSync'](path[_0x57ea('0x5f')](config['root'],_0x57ea('0x60')),_0x57ea('0x61'));var _0x2b9ddf=ejs[_0x57ea('0x62')](_0x4b30a4,{'contexts':_0x173298||[]});fs[_0x57ea('0x63')](_0x57ea('0x64'),_0x2b9ddf);})[_0x57ea('0x22')](function(){return respondWithRpcPromise(_0x57ea('0x65'),_0x57ea('0x5d'),{'module':_0x57ea('0x66')});})['then'](function(){var _0x5a2d6b=_0x526554[_0x57ea('0x67')][_0x57ea('0x39')]({'plain':!![]});if(!_0x5a2d6b)throw new Error(_0x57ea('0x68'));if(_0x5a2d6b[_0x57ea('0x69')]===_0x57ea('0x67')){var _0x3fae68=_0x1f9506[_0x57ea('0x39')]({'plain':!![]});return db[_0x57ea('0x6a')][_0x57ea('0x5c')]({'where':{'name':'Contexts','userProfileId':_0x5a2d6b[_0x57ea('0x6b')]},'raw':!![]})[_0x57ea('0x22')](function(_0x1c136c){if(_0x1c136c&&_0x1c136c[_0x57ea('0x6c')]===0x0){return db[_0x57ea('0x3b')][_0x57ea('0x5d')]({'name':_0x3fae68[_0x57ea('0x3e')],'resourceId':_0x3fae68['id'],'type':_0x1c136c[_0x57ea('0x3e')],'sectionId':_0x1c136c['id']},{})['then'](function(){return _0x1f9506;});}else{return _0x1f9506;}})[_0x57ea('0x2c')](function(_0x5d9a34){logger[_0x57ea('0x28')](_0x57ea('0x6d'),_0x5d9a34);throw _0x5d9a34;});}return _0x1f9506;})[_0x57ea('0x22')](respondWithResult(_0x208e20,0xc9))['catch'](handleError(_0x208e20,null));};exports[_0x57ea('0x37')]=function(_0x1e4bd2,_0x31fda3,_0x56ee69){var _0x5e0b4f;return db[_0x57ea('0x41')][_0x57ea('0x5c')]({'where':{'id':_0x1e4bd2[_0x57ea('0x5b')]['id']}})['then'](handleEntityNotFound(_0x31fda3,null))['then'](saveUpdates(_0x1e4bd2[_0x57ea('0x5e')],null))[_0x57ea('0x22')](function(_0x265b75){if(_0x265b75){_0x5e0b4f=_0x265b75;return db['VoiceContext']['findAll']({'raw':!![]});}})[_0x57ea('0x22')](function(_0x66d3d6){var _0xa35c38=fs[_0x57ea('0x6e')](path[_0x57ea('0x5f')](config[_0x57ea('0x6f')],_0x57ea('0x60')),'utf8');var _0x59d4b3=ejs[_0x57ea('0x62')](_0xa35c38,{'contexts':_0x66d3d6||[]});fs['writeFileSync'](_0x57ea('0x64'),_0x59d4b3);})[_0x57ea('0x22')](function(){return respondWithRpcPromise('Reload',_0x57ea('0x37'),{'module':_0x57ea('0x66')});})['then'](function(){return _0x5e0b4f;})[_0x57ea('0x22')](respondWithResult(_0x31fda3,null))[_0x57ea('0x2c')](handleError(_0x31fda3,null));};exports['destroy']=function(_0x1d4839,_0x411a51,_0x501109){var _0x1dbf47;return db['VoiceContext']['find']({'where':{'id':_0x1d4839[_0x57ea('0x5b')]['id']}})[_0x57ea('0x22')](handleEntityNotFound(_0x411a51,null))['then'](removeEntity(_0x411a51,null))[_0x57ea('0x22')](function(){return db[_0x57ea('0x41')][_0x57ea('0x58')]({'raw':!![]});})['then'](function(_0x1e6a64){var _0x97d791=fs[_0x57ea('0x6e')](path['join'](config[_0x57ea('0x6f')],_0x57ea('0x60')),_0x57ea('0x61'));var _0x3e1a49=ejs[_0x57ea('0x62')](_0x97d791,{'contexts':_0x1e6a64});fs[_0x57ea('0x63')](_0x57ea('0x64'),_0x3e1a49);return respondWithRpcPromise('Reload','destroy',{'module':_0x57ea('0x66')});})[_0x57ea('0x2c')](handleError(_0x411a51,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index b7fc1ef..0c062d7 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 _0x9397=['lodash','../../config/logger','api','moment','rimraf','../../config/environment','./voiceContext.attributes','define','VoiceContext','voice_contexts'];(function(_0x2a5794,_0x39ccc6){var _0x1f4925=function(_0x3d74d6){while(--_0x3d74d6){_0x2a5794['push'](_0x2a5794['shift']());}};_0x1f4925(++_0x39ccc6);}(_0x9397,0xbe));var _0x7939=function(_0x2867d8,_0xef3ee0){_0x2867d8=_0x2867d8-0x0;var _0x3b8176=_0x9397[_0x2867d8];return _0x3b8176;};'use strict';var _=require(_0x7939('0x0'));var util=require('util');var logger=require(_0x7939('0x1'))(_0x7939('0x2'));var moment=require(_0x7939('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7939('0x4'));var config=require(_0x7939('0x5'));var attributes=require(_0x7939('0x6'));module['exports']=function(_0x20ba84,_0x8be80e){return _0x20ba84[_0x7939('0x7')](_0x7939('0x8'),attributes,{'tableName':_0x7939('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe14d=['path','rimraf','define','VoiceContext','voice_contexts','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x40663f,_0x3cdb1d){var _0x5d9a52=function(_0x4f5330){while(--_0x4f5330){_0x40663f['push'](_0x40663f['shift']());}};_0x5d9a52(++_0x3cdb1d);}(_0xe14d,0x149));var _0xde14=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xe14d[_0x311c35];return _0x5cc50c;};'use strict';var _=require(_0xde14('0x0'));var util=require(_0xde14('0x1'));var logger=require(_0xde14('0x2'))(_0xde14('0x3'));var moment=require(_0xde14('0x4'));var BPromise=require(_0xde14('0x5'));var rp=require(_0xde14('0x6'));var fs=require('fs');var path=require(_0xde14('0x7'));var rimraf=require(_0xde14('0x8'));var config=require('../../config/environment');var attributes=require('./voiceContext.attributes');module['exports']=function(_0x48fef8,_0x31686b){return _0x48fef8[_0xde14('0x9')](_0xde14('0xa'),attributes,{'tableName':_0xde14('0xb'),'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 3a4d354..cbc1c07 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 _0x5635=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','VoiceContext,\x20%s,\x20%s','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','util','bluebird'];(function(_0xaa2c62,_0x1626a4){var _0x3cd23e=function(_0x510a36){while(--_0x510a36){_0xaa2c62['push'](_0xaa2c62['shift']());}};_0x3cd23e(++_0x1626a4);}(_0x5635,0xbb));var _0x5563=function(_0x409f0d,_0xfc9d08){_0x409f0d=_0x409f0d-0x0;var _0x1dcec2=_0x5635[_0x409f0d];return _0x1dcec2;};'use strict';var _=require('lodash');var util=require(_0x5563('0x0'));var moment=require('moment');var BPromise=require(_0x5563('0x1'));var rs=require(_0x5563('0x2'));var fs=require('fs');var Redis=require(_0x5563('0x3'));var db=require(_0x5563('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5563('0x5'))(_0x5563('0x6'));var config=require(_0x5563('0x7'));var jayson=require(_0x5563('0x8'));var client=jayson[_0x5563('0x9')][_0x5563('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x477c7b,_0x307f1a,_0x2dcf5b){return new BPromise(function(_0x36d77f,_0x479c2f){return client['request'](_0x477c7b,_0x2dcf5b)[_0x5563('0xb')](function(_0x89306f){logger[_0x5563('0xc')](_0x5563('0xd'),_0x307f1a,'request\x20sent');logger[_0x5563('0xe')](_0x5563('0xf'),_0x307f1a,'request\x20sent',JSON[_0x5563('0x10')](_0x89306f));if(_0x89306f[_0x5563('0x11')]){if(_0x89306f[_0x5563('0x11')][_0x5563('0x12')]===0x1f4){logger[_0x5563('0x11')]('VoiceContext,\x20%s,\x20%s',_0x307f1a,_0x89306f[_0x5563('0x11')][_0x5563('0x13')]);return _0x479c2f(_0x89306f['error'][_0x5563('0x13')]);}logger[_0x5563('0x11')](_0x5563('0xd'),_0x307f1a,_0x89306f[_0x5563('0x11')][_0x5563('0x13')]);return _0x36d77f(_0x89306f[_0x5563('0x11')][_0x5563('0x13')]);}else{logger[_0x5563('0xc')](_0x5563('0xd'),_0x307f1a,_0x5563('0x14'));_0x36d77f(_0x89306f['result'][_0x5563('0x13')]);}})['catch'](function(_0x211b09){logger[_0x5563('0x11')](_0x5563('0xd'),_0x307f1a,_0x211b09);_0x479c2f(_0x211b09);});});} \ No newline at end of file +var _0xe78b=['request','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x5d6e9d,_0x3ecb12){var _0x3b28f6=function(_0xb36bbc){while(--_0xb36bbc){_0x5d6e9d['push'](_0x5d6e9d['shift']());}};_0x3b28f6(++_0x3ecb12);}(_0xe78b,0x1c2));var _0xbe78=function(_0x282442,_0x135555){_0x282442=_0x282442-0x0;var _0xf97807=_0xe78b[_0x282442];return _0xf97807;};'use strict';var _=require(_0xbe78('0x0'));var util=require(_0xbe78('0x1'));var moment=require('moment');var BPromise=require(_0xbe78('0x2'));var rs=require(_0xbe78('0x3'));var fs=require('fs');var Redis=require(_0xbe78('0x4'));var db=require(_0xbe78('0x5'))['db'];var utils=require(_0xbe78('0x6'));var logger=require(_0xbe78('0x7'))(_0xbe78('0x8'));var config=require(_0xbe78('0x9'));var jayson=require(_0xbe78('0xa'));var client=jayson[_0xbe78('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b82a2,_0x26eb67,_0x556406){return new BPromise(function(_0x42436b,_0x940572){return client[_0xbe78('0xc')](_0x5b82a2,_0x556406)['then'](function(_0x2a9d30){logger[_0xbe78('0xd')](_0xbe78('0xe'),_0x26eb67,_0xbe78('0xf'));logger[_0xbe78('0x10')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x26eb67,'request\x20sent',JSON['stringify'](_0x2a9d30));if(_0x2a9d30[_0xbe78('0x11')]){if(_0x2a9d30[_0xbe78('0x11')][_0xbe78('0x12')]===0x1f4){logger[_0xbe78('0x11')](_0xbe78('0xe'),_0x26eb67,_0x2a9d30[_0xbe78('0x11')][_0xbe78('0x13')]);return _0x940572(_0x2a9d30[_0xbe78('0x11')][_0xbe78('0x13')]);}logger['error']('VoiceContext,\x20%s,\x20%s',_0x26eb67,_0x2a9d30[_0xbe78('0x11')][_0xbe78('0x13')]);return _0x42436b(_0x2a9d30['error'][_0xbe78('0x13')]);}else{logger[_0xbe78('0xd')](_0xbe78('0xe'),_0x26eb67,_0xbe78('0xf'));_0x42436b(_0x2a9d30[_0xbe78('0x14')][_0xbe78('0x13')]);}})['catch'](function(_0x458128){logger[_0xbe78('0x11')](_0xbe78('0xe'),_0x26eb67,_0x458128);_0x940572(_0x458128);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 6e5fba0..e1e99e8 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 _0xcea7=['/:id','update','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','index','/describe','describe','show','create'];(function(_0x41ad07,_0x41bf12){var _0x3bcff1=function(_0x2f191a){while(--_0x2f191a){_0x41ad07['push'](_0x41ad07['shift']());}};_0x3bcff1(++_0x41bf12);}(_0xcea7,0x122));var _0x7cea=function(_0x198e0c,_0x38581d){_0x198e0c=_0x198e0c-0x0;var _0x5c7387=_0xcea7[_0x198e0c];return _0x5c7387;};'use strict';var multer=require(_0x7cea('0x0'));var util=require(_0x7cea('0x1'));var path=require(_0x7cea('0x2'));var timeout=require(_0x7cea('0x3'));var express=require(_0x7cea('0x4'));var router=express[_0x7cea('0x5')]();var auth=require(_0x7cea('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7cea('0x7'));var controller=require(_0x7cea('0x8'));router[_0x7cea('0x9')]('/',auth[_0x7cea('0xa')](),controller[_0x7cea('0xb')]);router[_0x7cea('0x9')](_0x7cea('0xc'),auth['isAuthenticated'](),controller[_0x7cea('0xd')]);router[_0x7cea('0x9')]('/:id',auth[_0x7cea('0xa')](),controller[_0x7cea('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x7cea('0xf')]);router['put'](_0x7cea('0x10'),auth['isAuthenticated'](),controller[_0x7cea('0x11')]);router['delete'](_0x7cea('0x10'),auth[_0x7cea('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x9040=['delete','destroy','multer','util','connect-timeout','Router','../../components/auth/service','./voiceDialReport.controller','isAuthenticated','get','/describe','describe','/:id','show','post','create','put','update'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x9040,0x1d6));var _0x0904=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0x9040[_0x5447fd];return _0x15b28a;};'use strict';var multer=require(_0x0904('0x0'));var util=require(_0x0904('0x1'));var path=require('path');var timeout=require(_0x0904('0x2'));var express=require('express');var router=express[_0x0904('0x3')]();var auth=require(_0x0904('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0904('0x5'));router['get']('/',auth[_0x0904('0x6')](),controller['index']);router[_0x0904('0x7')](_0x0904('0x8'),auth['isAuthenticated'](),controller[_0x0904('0x9')]);router['get'](_0x0904('0xa'),auth['isAuthenticated'](),controller[_0x0904('0xb')]);router[_0x0904('0xc')]('/',auth[_0x0904('0x6')](),controller[_0x0904('0xd')]);router[_0x0904('0xe')](_0x0904('0xa'),auth[_0x0904('0x6')](),controller[_0x0904('0xf')]);router[_0x0904('0x10')](_0x0904('0xa'),auth[_0x0904('0x6')](),controller[_0x0904('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index ce47dde..08fe348 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 _0xf759=['exports','STRING','INTEGER','DATE','called,connect,complete','sequelize'];(function(_0x32baad,_0x4a3ed5){var _0x525d14=function(_0x125a7c){while(--_0x125a7c){_0x32baad['push'](_0x32baad['shift']());}};_0x525d14(++_0x4a3ed5);}(_0xf759,0x1c1));var _0x9f75=function(_0x3955a2,_0x3bcf09){_0x3955a2=_0x3955a2-0x0;var _0x4bf579=_0xf759[_0x3955a2];return _0x4bf579;};'use strict';var Sequelize=require(_0x9f75('0x0'));module[_0x9f75('0x1')]={'privilege':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x9f75('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x9f75('0x2')]},'calleridnum':{'type':Sequelize[_0x9f75('0x2')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x9f75('0x2')]},'connectedlinename':{'type':Sequelize[_0x9f75('0x2')]},'language':{'type':Sequelize[_0x9f75('0x2')]},'accountcode':{'type':Sequelize[_0x9f75('0x2')]},'context':{'type':Sequelize[_0x9f75('0x2')]},'exten':{'type':Sequelize[_0x9f75('0x2')]},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x9f75('0x2')]},'linkedid':{'type':Sequelize[_0x9f75('0x2')]},'destchannel':{'type':Sequelize[_0x9f75('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x9f75('0x2')]},'destcalleridnum':{'type':Sequelize[_0x9f75('0x2')]},'destcalleridname':{'type':Sequelize[_0x9f75('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x9f75('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x9f75('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x9f75('0x2')]},'destpriority':{'type':Sequelize[_0x9f75('0x3')]},'destuniqueid':{'type':Sequelize[_0x9f75('0x2')]},'destlinkedid':{'type':Sequelize[_0x9f75('0x2')]},'dialstring':{'type':Sequelize[_0x9f75('0x2')]},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x9f75('0x4')]},'answertime':{'type':Sequelize[_0x9f75('0x4')]},'endtime':{'type':Sequelize[_0x9f75('0x4')]},'lastevent':{'type':Sequelize[_0x9f75('0x2')],'comment':_0x9f75('0x5')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize[_0x9f75('0x3')]},'holdtime':{'type':Sequelize[_0x9f75('0x3')]},'billableseconds':{'type':Sequelize[_0x9f75('0x3')]}}; \ No newline at end of file +var _0xb282=['INTEGER','DATE','called,connect,complete','sequelize','exports','STRING'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0xb282,0xe1));var _0x2b28=function(_0x4e5e6f,_0x2af76a){_0x4e5e6f=_0x4e5e6f-0x0;var _0x586743=_0xb282[_0x4e5e6f];return _0x586743;};'use strict';var Sequelize=require(_0x2b28('0x0'));module[_0x2b28('0x1')]={'privilege':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x2b28('0x2')]},'channelstate':{'type':Sequelize[_0x2b28('0x3')]},'channelstatedesc':{'type':Sequelize[_0x2b28('0x2')]},'calleridnum':{'type':Sequelize[_0x2b28('0x2')]},'calleridname':{'type':Sequelize[_0x2b28('0x2')]},'connectedlinenum':{'type':Sequelize[_0x2b28('0x2')]},'connectedlinename':{'type':Sequelize[_0x2b28('0x2')]},'language':{'type':Sequelize[_0x2b28('0x2')]},'accountcode':{'type':Sequelize[_0x2b28('0x2')]},'context':{'type':Sequelize[_0x2b28('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x2b28('0x2')]},'linkedid':{'type':Sequelize[_0x2b28('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x2b28('0x2')]},'destcalleridname':{'type':Sequelize[_0x2b28('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x2b28('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x2b28('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x2b28('0x2')]},'destcontext':{'type':Sequelize[_0x2b28('0x2')]},'destexten':{'type':Sequelize[_0x2b28('0x2')]},'destpriority':{'type':Sequelize[_0x2b28('0x3')]},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize[_0x2b28('0x2')]},'dialstring':{'type':Sequelize[_0x2b28('0x2')]},'dialstatus':{'type':Sequelize[_0x2b28('0x2')]},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x2b28('0x4')]},'lastevent':{'type':Sequelize['STRING'],'comment':_0x2b28('0x5')},'routeId':{'type':Sequelize[_0x2b28('0x3')]},'duration':{'type':Sequelize[_0x2b28('0x3')]},'holdtime':{'type':Sequelize[_0x2b28('0x3')]},'billableseconds':{'type':Sequelize[_0x2b28('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 14f9cb0..927ea84 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 _0x29fd=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','then','destroy','error','name','send','index','map','fieldName','type','key','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','VoiceDialReport','includeAll','include','rows','catch','show','model','rawAttributes','find','create','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel','crypto'];(function(_0x19b3f9,_0xade753){var _0x18c3f6=function(_0x21439f){while(--_0x21439f){_0x19b3f9['push'](_0x19b3f9['shift']());}};_0x18c3f6(++_0xade753);}(_0x29fd,0x8d));var _0xd29f=function(_0x1db97,_0x5b1528){_0x1db97=_0x1db97-0x0;var _0x37948d=_0x29fd[_0x1db97];return _0x37948d;};'use strict';var pdf=require(_0xd29f('0x0'));var emlformat=require(_0xd29f('0x1'));var rimraf=require(_0xd29f('0x2'));var zipdir=require(_0xd29f('0x3'));var jsonpatch=require(_0xd29f('0x4'));var rp=require(_0xd29f('0x5'));var moment=require(_0xd29f('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xd29f('0x7'));var util=require('util');var path=require(_0xd29f('0x8'));var sox=require(_0xd29f('0x9'));var csv=require(_0xd29f('0xa'));var ejs=require(_0xd29f('0xb'));var fs=require('fs');var _=require(_0xd29f('0xc'));var squel=require(_0xd29f('0xd'));var crypto=require(_0xd29f('0xe'));var jsforce=require(_0xd29f('0xf'));var deskjs=require(_0xd29f('0x10'));var toCsv=require(_0xd29f('0xa'));var querystring=require(_0xd29f('0x11'));var Papa=require(_0xd29f('0x12'));var Redis=require(_0xd29f('0x13'));var authService=require(_0xd29f('0x14'));var qs=require(_0xd29f('0x15'));var as=require(_0xd29f('0x16'));var hardwareService=require(_0xd29f('0x17'));var logger=require('../../config/logger')(_0xd29f('0x18'));var utils=require(_0xd29f('0x19'));var config=require(_0xd29f('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d9025,_0x1abb30){_0x1abb30=_0x1abb30||0xcc;return function(_0x4a001f){if(_0x4a001f){return _0x1d9025[_0xd29f('0x1b')](_0x1abb30);}return _0x1d9025[_0xd29f('0x1c')](_0x1abb30)[_0xd29f('0x1d')]();};}function respondWithResult(_0x78011a,_0x7b7690){_0x7b7690=_0x7b7690||0xc8;return function(_0x86de6f){if(_0x86de6f){return _0x78011a[_0xd29f('0x1c')](_0x7b7690)[_0xd29f('0x1e')](_0x86de6f);}};}function respondWithFilteredResult(_0x5d503f,_0x3da37c){return function(_0x5aa072){if(_0x5aa072){var _0x163282=_0x5aa072[_0xd29f('0x1f')],_0x1f19cc=_0x3da37c[_0xd29f('0x20')],_0x502f85=_0x3da37c[_0xd29f('0x20')]+_0x3da37c[_0xd29f('0x21')],_0x2bba85;if(_0x502f85>=_0x163282){_0x502f85=_0x163282;_0x2bba85=0xc8;}else{_0x2bba85=0xce;}_0x5d503f[_0xd29f('0x1c')](_0x2bba85);return _0x5d503f[_0xd29f('0x22')]('Content-Range',_0x1f19cc+'-'+_0x502f85+'/'+_0x163282)[_0xd29f('0x1e')](_0x5aa072);}return null;};}function patchUpdates(_0x21fe83){return function(_0x144b5d){try{jsonpatch[_0xd29f('0x23')](_0x144b5d,_0x21fe83,!![]);}catch(_0x3ae0d4){return BPromise[_0xd29f('0x24')](_0x3ae0d4);}return _0x144b5d[_0xd29f('0x25')]();};}function saveUpdates(_0x584f82,_0x49106d){return function(_0x59bdd9){if(_0x59bdd9){return _0x59bdd9[_0xd29f('0x26')](_0x584f82)[_0xd29f('0x27')](function(_0x2373c3){return _0x2373c3;});}return null;};}function removeEntity(_0x4bc9bc,_0x2f1bfe){return function(_0xd37bf5){if(_0xd37bf5){return _0xd37bf5[_0xd29f('0x28')]()[_0xd29f('0x27')](function(){_0x4bc9bc[_0xd29f('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c574a,_0x494a5d){return function(_0x43b43a){if(!_0x43b43a){_0x1c574a[_0xd29f('0x1b')](0x194);}return _0x43b43a;};}function handleError(_0x549519,_0x25a1a1){_0x25a1a1=_0x25a1a1||0x1f4;return function(_0x51c04a){logger[_0xd29f('0x29')](_0x51c04a['stack']);if(_0x51c04a['name']){delete _0x51c04a[_0xd29f('0x2a')];}_0x549519[_0xd29f('0x1c')](_0x25a1a1)[_0xd29f('0x2b')](_0x51c04a);};}exports[_0xd29f('0x2c')]=function(_0x38ca87,_0x5014d8){var _0x506092={},_0x1c789c={},_0xe4d15c={'count':0x0,'rows':[]};var _0x2231ac=_[_0xd29f('0x2d')](db['VoiceDialReport']['rawAttributes'],function(_0x44942b){return{'name':_0x44942b[_0xd29f('0x2e')],'type':_0x44942b[_0xd29f('0x2f')][_0xd29f('0x30')]};});_0x1c789c['model']=_['map'](_0x2231ac,_0xd29f('0x2a'));_0x1c789c[_0xd29f('0x31')]=_[_0xd29f('0x32')](_0x38ca87['query']);_0x1c789c[_0xd29f('0x33')]=_[_0xd29f('0x34')](_0x1c789c['model'],_0x1c789c['query']);_0x506092[_0xd29f('0x35')]=_[_0xd29f('0x34')](_0x1c789c['model'],qs[_0xd29f('0x36')](_0x38ca87[_0xd29f('0x31')][_0xd29f('0x36')]));_0x506092[_0xd29f('0x35')]=_0x506092[_0xd29f('0x35')][_0xd29f('0x37')]?_0x506092['attributes']:_0x1c789c['model'];if(!_0x38ca87[_0xd29f('0x31')]['hasOwnProperty'](_0xd29f('0x38'))){_0x506092[_0xd29f('0x21')]=qs['limit'](_0x38ca87[_0xd29f('0x31')][_0xd29f('0x21')]);_0x506092[_0xd29f('0x20')]=qs[_0xd29f('0x20')](_0x38ca87[_0xd29f('0x31')]['offset']);}_0x506092[_0xd29f('0x39')]=qs[_0xd29f('0x3a')](_0x38ca87[_0xd29f('0x31')][_0xd29f('0x3a')]);_0x506092[_0xd29f('0x3b')]=qs[_0xd29f('0x33')](_[_0xd29f('0x3c')](_0x38ca87['query'],_0x1c789c[_0xd29f('0x33')]));if(_0x38ca87['query'][_0xd29f('0x3d')]){_0x506092[_0xd29f('0x3b')]=_['merge'](_0x506092[_0xd29f('0x3b')],{'$or':_[_0xd29f('0x2d')](_0x2231ac,function(_0x2a759d){if(_0x2a759d['type']!==_0xd29f('0x3e')){var _0x458d77={};_0x458d77[_0x2a759d['name']]={'$like':'%'+_0x38ca87['query']['filter']+'%'};return _0x458d77;}})});}_0x506092=_[_0xd29f('0x3f')]({},_0x506092,_0x38ca87[_0xd29f('0x40')]);var _0x31319f={'where':_0x506092[_0xd29f('0x3b')]};return db[_0xd29f('0x41')]['count'](_0x31319f)['then'](function(_0x2919b7){_0xe4d15c[_0xd29f('0x1f')]=_0x2919b7;if(_0x38ca87['query'][_0xd29f('0x42')]){_0x506092[_0xd29f('0x43')]=[{'all':!![]}];}return db[_0xd29f('0x41')]['findAll'](_0x506092);})[_0xd29f('0x27')](function(_0x52d640){_0xe4d15c[_0xd29f('0x44')]=_0x52d640;return _0xe4d15c;})[_0xd29f('0x27')](respondWithFilteredResult(_0x5014d8,_0x506092))[_0xd29f('0x45')](handleError(_0x5014d8,null));};exports[_0xd29f('0x46')]=function(_0x4c3697,_0x165637){var _0x3a4e93={'raw':!![],'where':{'id':_0x4c3697['params']['id']}},_0x4b38d9={};_0x4b38d9[_0xd29f('0x47')]=_['keys'](db[_0xd29f('0x41')][_0xd29f('0x48')]);_0x4b38d9[_0xd29f('0x31')]=_['keys'](_0x4c3697['query']);_0x4b38d9['filters']=_[_0xd29f('0x34')](_0x4b38d9[_0xd29f('0x47')],_0x4b38d9[_0xd29f('0x31')]);_0x3a4e93[_0xd29f('0x35')]=_[_0xd29f('0x34')](_0x4b38d9['model'],qs[_0xd29f('0x36')](_0x4c3697[_0xd29f('0x31')][_0xd29f('0x36')]));_0x3a4e93[_0xd29f('0x35')]=_0x3a4e93[_0xd29f('0x35')][_0xd29f('0x37')]?_0x3a4e93[_0xd29f('0x35')]:_0x4b38d9['model'];if(_0x4c3697[_0xd29f('0x31')]['includeAll']){_0x3a4e93[_0xd29f('0x43')]=[{'all':!![]}];}_0x3a4e93=_[_0xd29f('0x3f')]({},_0x3a4e93,_0x4c3697[_0xd29f('0x40')]);return db[_0xd29f('0x41')][_0xd29f('0x49')](_0x3a4e93)[_0xd29f('0x27')](handleEntityNotFound(_0x165637,null))[_0xd29f('0x27')](respondWithResult(_0x165637,null))[_0xd29f('0x45')](handleError(_0x165637,null));};exports[_0xd29f('0x4a')]=function(_0x2e35ad,_0x4ce11a){return db['VoiceDialReport'][_0xd29f('0x4a')](_0x2e35ad[_0xd29f('0x4b')],{})['then'](respondWithResult(_0x4ce11a,0xc9))[_0xd29f('0x45')](handleError(_0x4ce11a,null));};exports[_0xd29f('0x26')]=function(_0x32f56e,_0x1a9c71){if(_0x32f56e[_0xd29f('0x4b')]['id']){delete _0x32f56e['body']['id'];}return db[_0xd29f('0x41')][_0xd29f('0x49')]({'where':{'id':_0x32f56e[_0xd29f('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1a9c71,null))[_0xd29f('0x27')](saveUpdates(_0x32f56e['body'],null))[_0xd29f('0x27')](respondWithResult(_0x1a9c71,null))[_0xd29f('0x45')](handleError(_0x1a9c71,null));};exports['destroy']=function(_0x4870b0,_0x38451d){return db['VoiceDialReport']['find']({'where':{'id':_0x4870b0['params']['id']}})[_0xd29f('0x27')](handleEntityNotFound(_0x38451d,null))[_0xd29f('0x27')](removeEntity(_0x38451d,null))['catch'](handleError(_0x38451d,null));};exports[_0xd29f('0x4d')]=function(_0x9430ce,_0x599fc1){return db['VoiceDialReport']['describe']()[_0xd29f('0x27')](respondWithResult(_0x599fc1,null))[_0xd29f('0x45')](handleError(_0x599fc1,null));}; \ No newline at end of file +var _0xcd40=['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/environment','../../mysqldb','sendStatus','end','status','json','offset','apply','save','update','then','destroy','error','stack','name','send','index','VoiceDialReport','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','find','create','body','params','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','path','sox','to-csv'];(function(_0x2ef4e2,_0x19bcb0){var _0x561342=function(_0x2acd5f){while(--_0x2acd5f){_0x2ef4e2['push'](_0x2ef4e2['shift']());}};_0x561342(++_0x19bcb0);}(_0xcd40,0xdb));var _0x0cd4=function(_0x4e5c37,_0x170d7b){_0x4e5c37=_0x4e5c37-0x0;var _0x2a80d1=_0xcd40[_0x4e5c37];return _0x2a80d1;};'use strict';var pdf=require(_0x0cd4('0x0'));var emlformat=require(_0x0cd4('0x1'));var rimraf=require(_0x0cd4('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0cd4('0x3'));var rp=require(_0x0cd4('0x4'));var moment=require(_0x0cd4('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x0cd4('0x6'));var sox=require(_0x0cd4('0x7'));var csv=require(_0x0cd4('0x8'));var ejs=require(_0x0cd4('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x0cd4('0xa'));var crypto=require(_0x0cd4('0xb'));var jsforce=require(_0x0cd4('0xc'));var deskjs=require(_0x0cd4('0xd'));var toCsv=require('to-csv');var querystring=require(_0x0cd4('0xe'));var Papa=require(_0x0cd4('0xf'));var Redis=require(_0x0cd4('0x10'));var authService=require(_0x0cd4('0x11'));var qs=require(_0x0cd4('0x12'));var as=require(_0x0cd4('0x13'));var hardwareService=require(_0x0cd4('0x14'));var logger=require(_0x0cd4('0x15'))(_0x0cd4('0x16'));var utils=require('../../config/utils');var config=require(_0x0cd4('0x17'));var db=require(_0x0cd4('0x18'))['db'];function respondWithStatusCode(_0xd5c0fb,_0x1fb422){_0x1fb422=_0x1fb422||0xcc;return function(_0x531138){if(_0x531138){return _0xd5c0fb[_0x0cd4('0x19')](_0x1fb422);}return _0xd5c0fb['status'](_0x1fb422)[_0x0cd4('0x1a')]();};}function respondWithResult(_0x26033c,_0x53657a){_0x53657a=_0x53657a||0xc8;return function(_0xafa8fd){if(_0xafa8fd){return _0x26033c[_0x0cd4('0x1b')](_0x53657a)[_0x0cd4('0x1c')](_0xafa8fd);}};}function respondWithFilteredResult(_0x3c5ac9,_0x1871c9){return function(_0x2be1a0){if(_0x2be1a0){var _0x141490=_0x2be1a0['count'],_0x26befe=_0x1871c9[_0x0cd4('0x1d')],_0x49cc79=_0x1871c9[_0x0cd4('0x1d')]+_0x1871c9['limit'],_0x412f6a;if(_0x49cc79>=_0x141490){_0x49cc79=_0x141490;_0x412f6a=0xc8;}else{_0x412f6a=0xce;}_0x3c5ac9[_0x0cd4('0x1b')](_0x412f6a);return _0x3c5ac9['set']('Content-Range',_0x26befe+'-'+_0x49cc79+'/'+_0x141490)[_0x0cd4('0x1c')](_0x2be1a0);}return null;};}function patchUpdates(_0x46f22f){return function(_0x475013){try{jsonpatch[_0x0cd4('0x1e')](_0x475013,_0x46f22f,!![]);}catch(_0x477727){return BPromise['reject'](_0x477727);}return _0x475013[_0x0cd4('0x1f')]();};}function saveUpdates(_0x4cdd61,_0x1ec710){return function(_0x3cd861){if(_0x3cd861){return _0x3cd861[_0x0cd4('0x20')](_0x4cdd61)[_0x0cd4('0x21')](function(_0x1e66c0){return _0x1e66c0;});}return null;};}function removeEntity(_0x18c258,_0x58bc5c){return function(_0x2e24f8){if(_0x2e24f8){return _0x2e24f8[_0x0cd4('0x22')]()['then'](function(){_0x18c258[_0x0cd4('0x1b')](0xcc)[_0x0cd4('0x1a')]();});}};}function handleEntityNotFound(_0x4cb033,_0x4ff3c5){return function(_0x174b1f){if(!_0x174b1f){_0x4cb033[_0x0cd4('0x19')](0x194);}return _0x174b1f;};}function handleError(_0x1ce521,_0x189807){_0x189807=_0x189807||0x1f4;return function(_0x2fe26b){logger[_0x0cd4('0x23')](_0x2fe26b[_0x0cd4('0x24')]);if(_0x2fe26b['name']){delete _0x2fe26b[_0x0cd4('0x25')];}_0x1ce521[_0x0cd4('0x1b')](_0x189807)[_0x0cd4('0x26')](_0x2fe26b);};}exports[_0x0cd4('0x27')]=function(_0x441729,_0x4d2d4a){var _0x238d07={},_0x184434={},_0x5c35dd={'count':0x0,'rows':[]};var _0x1fbf60=_['map'](db[_0x0cd4('0x28')][_0x0cd4('0x29')],function(_0x315bd8){return{'name':_0x315bd8[_0x0cd4('0x2a')],'type':_0x315bd8[_0x0cd4('0x2b')][_0x0cd4('0x2c')]};});_0x184434['model']=_[_0x0cd4('0x2d')](_0x1fbf60,_0x0cd4('0x25'));_0x184434[_0x0cd4('0x2e')]=_[_0x0cd4('0x2f')](_0x441729['query']);_0x184434[_0x0cd4('0x30')]=_[_0x0cd4('0x31')](_0x184434['model'],_0x184434[_0x0cd4('0x2e')]);_0x238d07[_0x0cd4('0x32')]=_['intersection'](_0x184434[_0x0cd4('0x33')],qs[_0x0cd4('0x34')](_0x441729['query']['fields']));_0x238d07[_0x0cd4('0x32')]=_0x238d07[_0x0cd4('0x32')][_0x0cd4('0x35')]?_0x238d07[_0x0cd4('0x32')]:_0x184434[_0x0cd4('0x33')];if(!_0x441729[_0x0cd4('0x2e')][_0x0cd4('0x36')](_0x0cd4('0x37'))){_0x238d07[_0x0cd4('0x38')]=qs['limit'](_0x441729[_0x0cd4('0x2e')]['limit']);_0x238d07[_0x0cd4('0x1d')]=qs[_0x0cd4('0x1d')](_0x441729[_0x0cd4('0x2e')]['offset']);}_0x238d07[_0x0cd4('0x39')]=qs['sort'](_0x441729[_0x0cd4('0x2e')][_0x0cd4('0x3a')]);_0x238d07[_0x0cd4('0x3b')]=qs['filters'](_[_0x0cd4('0x3c')](_0x441729[_0x0cd4('0x2e')],_0x184434['filters']));if(_0x441729[_0x0cd4('0x2e')][_0x0cd4('0x3d')]){_0x238d07[_0x0cd4('0x3b')]=_[_0x0cd4('0x3e')](_0x238d07['where'],{'$or':_['map'](_0x1fbf60,function(_0x50a527){if(_0x50a527[_0x0cd4('0x2b')]!==_0x0cd4('0x3f')){var _0x511a12={};_0x511a12[_0x50a527[_0x0cd4('0x25')]]={'$like':'%'+_0x441729[_0x0cd4('0x2e')][_0x0cd4('0x3d')]+'%'};return _0x511a12;}})});}_0x238d07=_[_0x0cd4('0x3e')]({},_0x238d07,_0x441729[_0x0cd4('0x40')]);var _0x551c6c={'where':_0x238d07['where']};return db['VoiceDialReport'][_0x0cd4('0x41')](_0x551c6c)['then'](function(_0x275a9b){_0x5c35dd[_0x0cd4('0x41')]=_0x275a9b;if(_0x441729['query'][_0x0cd4('0x42')]){_0x238d07[_0x0cd4('0x43')]=[{'all':!![]}];}return db[_0x0cd4('0x28')][_0x0cd4('0x44')](_0x238d07);})[_0x0cd4('0x21')](function(_0x5ef980){_0x5c35dd[_0x0cd4('0x45')]=_0x5ef980;return _0x5c35dd;})[_0x0cd4('0x21')](respondWithFilteredResult(_0x4d2d4a,_0x238d07))[_0x0cd4('0x46')](handleError(_0x4d2d4a,null));};exports[_0x0cd4('0x47')]=function(_0x214e71,_0x3373a7){var _0x42b66a={'raw':!![],'where':{'id':_0x214e71['params']['id']}},_0x76377={};_0x76377[_0x0cd4('0x33')]=_[_0x0cd4('0x2f')](db[_0x0cd4('0x28')][_0x0cd4('0x29')]);_0x76377['query']=_['keys'](_0x214e71[_0x0cd4('0x2e')]);_0x76377[_0x0cd4('0x30')]=_[_0x0cd4('0x31')](_0x76377[_0x0cd4('0x33')],_0x76377[_0x0cd4('0x2e')]);_0x42b66a[_0x0cd4('0x32')]=_['intersection'](_0x76377[_0x0cd4('0x33')],qs[_0x0cd4('0x34')](_0x214e71[_0x0cd4('0x2e')][_0x0cd4('0x34')]));_0x42b66a['attributes']=_0x42b66a[_0x0cd4('0x32')][_0x0cd4('0x35')]?_0x42b66a[_0x0cd4('0x32')]:_0x76377[_0x0cd4('0x33')];if(_0x214e71[_0x0cd4('0x2e')][_0x0cd4('0x42')]){_0x42b66a[_0x0cd4('0x43')]=[{'all':!![]}];}_0x42b66a=_[_0x0cd4('0x3e')]({},_0x42b66a,_0x214e71[_0x0cd4('0x40')]);return db[_0x0cd4('0x28')][_0x0cd4('0x48')](_0x42b66a)[_0x0cd4('0x21')](handleEntityNotFound(_0x3373a7,null))['then'](respondWithResult(_0x3373a7,null))[_0x0cd4('0x46')](handleError(_0x3373a7,null));};exports[_0x0cd4('0x49')]=function(_0x20f1c9,_0x2f80f2){return db[_0x0cd4('0x28')]['create'](_0x20f1c9['body'],{})[_0x0cd4('0x21')](respondWithResult(_0x2f80f2,0xc9))[_0x0cd4('0x46')](handleError(_0x2f80f2,null));};exports[_0x0cd4('0x20')]=function(_0x347d5a,_0x4e31e8){if(_0x347d5a[_0x0cd4('0x4a')]['id']){delete _0x347d5a[_0x0cd4('0x4a')]['id'];}return db['VoiceDialReport'][_0x0cd4('0x48')]({'where':{'id':_0x347d5a[_0x0cd4('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4e31e8,null))['then'](saveUpdates(_0x347d5a['body'],null))[_0x0cd4('0x21')](respondWithResult(_0x4e31e8,null))['catch'](handleError(_0x4e31e8,null));};exports[_0x0cd4('0x22')]=function(_0x1ca109,_0xe6fdf6){return db[_0x0cd4('0x28')]['find']({'where':{'id':_0x1ca109[_0x0cd4('0x4b')]['id']}})[_0x0cd4('0x21')](handleEntityNotFound(_0xe6fdf6,null))['then'](removeEntity(_0xe6fdf6,null))[_0x0cd4('0x46')](handleError(_0xe6fdf6,null));};exports['describe']=function(_0x16c271,_0x328160){return db['VoiceDialReport']['describe']()['then'](respondWithResult(_0x328160,null))[_0x0cd4('0x46')](handleError(_0x328160,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index f32b83a..4efabe4 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 _0xfd0b=['./voiceDialReport.attributes','exports','define','VoiceDialReport','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xfd0b,0x118));var _0xbfd0=function(_0x1935fd,_0x3f4938){_0x1935fd=_0x1935fd-0x0;var _0x25f25f=_0xfd0b[_0x1935fd];return _0x25f25f;};'use strict';var _=require(_0xbfd0('0x0'));var util=require('util');var logger=require(_0xbfd0('0x1'))(_0xbfd0('0x2'));var moment=require('moment');var BPromise=require(_0xbfd0('0x3'));var rp=require(_0xbfd0('0x4'));var fs=require('fs');var path=require(_0xbfd0('0x5'));var rimraf=require(_0xbfd0('0x6'));var config=require(_0xbfd0('0x7'));var attributes=require(_0xbfd0('0x8'));module[_0xbfd0('0x9')]=function(_0x12e463,_0x40e2dc){return _0x12e463[_0xbfd0('0xa')](_0xbfd0('0xb'),attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x57eb=['../../config/logger','api','moment','rimraf','../../config/environment','define','VoiceDialReport','report_dial','uniqueid','lodash','util'];(function(_0x223f68,_0x44b79c){var _0x311a51=function(_0x3ce127){while(--_0x3ce127){_0x223f68['push'](_0x223f68['shift']());}};_0x311a51(++_0x44b79c);}(_0x57eb,0xf0));var _0xb57e=function(_0x306ddc,_0x9c4d60){_0x306ddc=_0x306ddc-0x0;var _0x11767f=_0x57eb[_0x306ddc];return _0x11767f;};'use strict';var _=require(_0xb57e('0x0'));var util=require(_0xb57e('0x1'));var logger=require(_0xb57e('0x2'))(_0xb57e('0x3'));var moment=require(_0xb57e('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb57e('0x5'));var config=require(_0xb57e('0x6'));var attributes=require('./voiceDialReport.attributes');module['exports']=function(_0x18356e,_0x656be2){return _0x18356e[_0xb57e('0x7')](_0xb57e('0x8'),attributes,{'tableName':_0xb57e('0x9'),'paranoid':![],'indexes':[{'fields':[_0xb57e('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index d8704cb..7638210 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 _0x8a55=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateVoiceDialReport','options','catch','VoiceDialReport','update','body','limit','UpdateVoiceDialReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x1c2a5d,_0x3ce7aa){var _0x43ca69=function(_0x12b795){while(--_0x12b795){_0x1c2a5d['push'](_0x1c2a5d['shift']());}};_0x43ca69(++_0x3ce7aa);}(_0x8a55,0x185));var _0x58a5=function(_0x282558,_0x2fcf63){_0x282558=_0x282558-0x0;var _0x396941=_0x8a55[_0x282558];return _0x396941;};'use strict';var _=require(_0x58a5('0x0'));var util=require(_0x58a5('0x1'));var moment=require(_0x58a5('0x2'));var BPromise=require(_0x58a5('0x3'));var rs=require(_0x58a5('0x4'));var fs=require('fs');var Redis=require(_0x58a5('0x5'));var db=require(_0x58a5('0x6'))['db'];var utils=require(_0x58a5('0x7'));var logger=require('../../config/logger')(_0x58a5('0x8'));var config=require(_0x58a5('0x9'));var jayson=require(_0x58a5('0xa'));var client=jayson[_0x58a5('0xb')][_0x58a5('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1690bc,_0x1f135e,_0xd63fc7){return new BPromise(function(_0x36d8a4,_0x59860d){return client[_0x58a5('0xd')](_0x1690bc,_0xd63fc7)[_0x58a5('0xe')](function(_0x2cca61){logger[_0x58a5('0xf')](_0x58a5('0x10'),_0x1f135e,_0x58a5('0x11'));logger[_0x58a5('0x12')](_0x58a5('0x13'),_0x1f135e,_0x58a5('0x11'),JSON[_0x58a5('0x14')](_0x2cca61));if(_0x2cca61[_0x58a5('0x15')]){if(_0x2cca61[_0x58a5('0x15')][_0x58a5('0x16')]===0x1f4){logger[_0x58a5('0x15')]('VoiceDialReport,\x20%s,\x20%s',_0x1f135e,_0x2cca61[_0x58a5('0x15')][_0x58a5('0x17')]);return _0x59860d(_0x2cca61[_0x58a5('0x15')][_0x58a5('0x17')]);}logger[_0x58a5('0x15')]('VoiceDialReport,\x20%s,\x20%s',_0x1f135e,_0x2cca61['error'][_0x58a5('0x17')]);return _0x36d8a4(_0x2cca61[_0x58a5('0x15')][_0x58a5('0x17')]);}else{logger[_0x58a5('0xf')](_0x58a5('0x10'),_0x1f135e,'request\x20sent');_0x36d8a4(_0x2cca61[_0x58a5('0x18')][_0x58a5('0x17')]);}})['catch'](function(_0x2594e3){logger[_0x58a5('0x15')]('VoiceDialReport,\x20%s,\x20%s',_0x1f135e,_0x2594e3);_0x59860d(_0x2594e3);});});}exports[_0x58a5('0x19')]=function(_0x32203a){var _0x59c170=this;return new Promise(function(_0x5dfadd,_0x24aa8f){return db['VoiceDialReport']['create'](_0x32203a['body'],{'raw':_0x32203a[_0x58a5('0x1a')]?_0x32203a[_0x58a5('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x58a5('0xe')](function(_0x8860d7){logger[_0x58a5('0xf')]('CreateVoiceDialReport',_0x32203a);logger[_0x58a5('0x12')](_0x58a5('0x19'),_0x32203a,JSON[_0x58a5('0x14')](_0x8860d7));_0x5dfadd(_0x8860d7);})[_0x58a5('0x1b')](function(_0x4b0df7){logger['error'](_0x58a5('0x19'),_0x4b0df7[_0x58a5('0x17')],_0x32203a);_0x24aa8f(_0x59c170[_0x58a5('0x15')](0x1f4,_0x4b0df7['message']));});});};exports['UpdateVoiceDialReport']=function(_0x2da18b){var _0x48e5cf=this;return new Promise(function(_0x206eea,_0xf1b3fc){return db[_0x58a5('0x1c')][_0x58a5('0x1d')](_0x2da18b[_0x58a5('0x1e')],{'raw':_0x2da18b['options']?_0x2da18b[_0x58a5('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2da18b[_0x58a5('0x1a')]?_0x2da18b[_0x58a5('0x1a')]['where']||null:null,'attributes':_0x2da18b[_0x58a5('0x1a')]?_0x2da18b[_0x58a5('0x1a')]['attributes']||null:null,'limit':_0x2da18b[_0x58a5('0x1a')]?_0x2da18b[_0x58a5('0x1a')][_0x58a5('0x1f')]||null:null})['then'](function(_0x34bd7a){logger[_0x58a5('0xf')](_0x58a5('0x20'),_0x2da18b);logger[_0x58a5('0x12')](_0x58a5('0x20'),_0x2da18b,JSON['stringify'](_0x34bd7a));_0x206eea(_0x34bd7a);})[_0x58a5('0x1b')](function(_0x2912bc){logger[_0x58a5('0x15')](_0x58a5('0x20'),_0x2912bc[_0x58a5('0x17')],_0x2da18b);_0xf1b3fc(_0x48e5cf[_0x58a5('0x15')](0x1f4,_0x2912bc['message']));});});}; \ No newline at end of file +var _0x6658=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateVoiceDialReport','VoiceDialReport','create','body','options','raw','UpdateVoiceDialReport','update','attributes','limit'];(function(_0x463309,_0x5c55c8){var _0x9c8877=function(_0x55e6b2){while(--_0x55e6b2){_0x463309['push'](_0x463309['shift']());}};_0x9c8877(++_0x5c55c8);}(_0x6658,0x198));var _0x8665=function(_0x2a4dc1,_0x200a22){_0x2a4dc1=_0x2a4dc1-0x0;var _0x3f0062=_0x6658[_0x2a4dc1];return _0x3f0062;};'use strict';var _=require(_0x8665('0x0'));var util=require(_0x8665('0x1'));var moment=require(_0x8665('0x2'));var BPromise=require(_0x8665('0x3'));var rs=require(_0x8665('0x4'));var fs=require('fs');var Redis=require(_0x8665('0x5'));var db=require(_0x8665('0x6'))['db'];var utils=require(_0x8665('0x7'));var logger=require('../../config/logger')(_0x8665('0x8'));var config=require(_0x8665('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8665('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x290df7,_0x24c89f,_0x242f58){return new BPromise(function(_0xe73687,_0x861e11){return client[_0x8665('0xb')](_0x290df7,_0x242f58)[_0x8665('0xc')](function(_0x5c25bf){logger[_0x8665('0xd')](_0x8665('0xe'),_0x24c89f,_0x8665('0xf'));logger[_0x8665('0x10')](_0x8665('0x11'),_0x24c89f,_0x8665('0xf'),JSON[_0x8665('0x12')](_0x5c25bf));if(_0x5c25bf[_0x8665('0x13')]){if(_0x5c25bf[_0x8665('0x13')][_0x8665('0x14')]===0x1f4){logger[_0x8665('0x13')](_0x8665('0xe'),_0x24c89f,_0x5c25bf[_0x8665('0x13')][_0x8665('0x15')]);return _0x861e11(_0x5c25bf['error'][_0x8665('0x15')]);}logger['error'](_0x8665('0xe'),_0x24c89f,_0x5c25bf[_0x8665('0x13')][_0x8665('0x15')]);return _0xe73687(_0x5c25bf[_0x8665('0x13')][_0x8665('0x15')]);}else{logger[_0x8665('0xd')]('VoiceDialReport,\x20%s,\x20%s',_0x24c89f,_0x8665('0xf'));_0xe73687(_0x5c25bf[_0x8665('0x16')]['message']);}})[_0x8665('0x17')](function(_0x53dcb5){logger[_0x8665('0x13')](_0x8665('0xe'),_0x24c89f,_0x53dcb5);_0x861e11(_0x53dcb5);});});}exports[_0x8665('0x18')]=function(_0x50ba7d){var _0x331e01=this;return new Promise(function(_0x235617,_0x5b7984){return db[_0x8665('0x19')][_0x8665('0x1a')](_0x50ba7d[_0x8665('0x1b')],{'raw':_0x50ba7d['options']?_0x50ba7d[_0x8665('0x1c')][_0x8665('0x1d')]===undefined?!![]:![]:!![]})[_0x8665('0xc')](function(_0x549a0a){logger['info']('CreateVoiceDialReport',_0x50ba7d);logger[_0x8665('0x10')]('CreateVoiceDialReport',_0x50ba7d,JSON[_0x8665('0x12')](_0x549a0a));_0x235617(_0x549a0a);})['catch'](function(_0x34b622){logger['error']('CreateVoiceDialReport',_0x34b622[_0x8665('0x15')],_0x50ba7d);_0x5b7984(_0x331e01[_0x8665('0x13')](0x1f4,_0x34b622['message']));});});};exports[_0x8665('0x1e')]=function(_0x1d7f74){var _0x189df6=this;return new Promise(function(_0x38a01a,_0x4aa420){return db[_0x8665('0x19')][_0x8665('0x1f')](_0x1d7f74[_0x8665('0x1b')],{'raw':_0x1d7f74[_0x8665('0x1c')]?_0x1d7f74[_0x8665('0x1c')][_0x8665('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d7f74[_0x8665('0x1c')]?_0x1d7f74[_0x8665('0x1c')]['where']||null:null,'attributes':_0x1d7f74[_0x8665('0x1c')]?_0x1d7f74[_0x8665('0x1c')][_0x8665('0x20')]||null:null,'limit':_0x1d7f74['options']?_0x1d7f74[_0x8665('0x1c')][_0x8665('0x21')]||null:null})[_0x8665('0xc')](function(_0x1f4ebd){logger[_0x8665('0xd')](_0x8665('0x1e'),_0x1d7f74);logger[_0x8665('0x10')](_0x8665('0x1e'),_0x1d7f74,JSON['stringify'](_0x1f4ebd));_0x38a01a(_0x1f4ebd);})[_0x8665('0x17')](function(_0x46c326){logger['error'](_0x8665('0x1e'),_0x46c326[_0x8665('0x15')],_0x1d7f74);_0x4aa420(_0x189df6[_0x8665('0x13')](0x1f4,_0x46c326['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index aabdbbf..32543ca 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 _0x3c75=['express','Router','../../components/auth/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','/:id','show','post','create','/:id/applications','addApplications','put','destroy','exports','multer','util','path','connect-timeout'];(function(_0x37695c,_0x222432){var _0x50e5b1=function(_0x592a11){while(--_0x592a11){_0x37695c['push'](_0x37695c['shift']());}};_0x50e5b1(++_0x222432);}(_0x3c75,0x1f4));var _0x53c7=function(_0x14a45a,_0x3d9e16){_0x14a45a=_0x14a45a-0x0;var _0x370f90=_0x3c75[_0x14a45a];return _0x370f90;};'use strict';var multer=require(_0x53c7('0x0'));var util=require(_0x53c7('0x1'));var path=require(_0x53c7('0x2'));var timeout=require(_0x53c7('0x3'));var express=require(_0x53c7('0x4'));var router=express[_0x53c7('0x5')]();var auth=require(_0x53c7('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x53c7('0x7'));var controller=require(_0x53c7('0x8'));router[_0x53c7('0x9')]('/',auth[_0x53c7('0xa')](),controller[_0x53c7('0xb')]);router[_0x53c7('0x9')](_0x53c7('0xc'),auth[_0x53c7('0xa')](),controller[_0x53c7('0xd')]);router[_0x53c7('0xe')]('/',auth['isAuthenticated'](),controller[_0x53c7('0xf')]);router[_0x53c7('0xe')](_0x53c7('0x10'),auth['isAuthenticated'](),controller[_0x53c7('0x11')]);router[_0x53c7('0x12')](_0x53c7('0xc'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x53c7('0xc'),auth['isAuthenticated'](),controller[_0x53c7('0x13')]);module[_0x53c7('0x14')]=router; \ No newline at end of file +var _0xd124=['connect-timeout','express','../../config/environment','./voiceExtension.controller','get','index','/:id','isAuthenticated','create','post','put','update','delete','exports','multer','path'];(function(_0x6d6c99,_0x3f8e4e){var _0x48da84=function(_0x4ae00e){while(--_0x4ae00e){_0x6d6c99['push'](_0x6d6c99['shift']());}};_0x48da84(++_0x3f8e4e);}(_0xd124,0x1ee));var _0x4d12=function(_0xedd3e9,_0x2b2fdf){_0xedd3e9=_0xedd3e9-0x0;var _0x346990=_0xd124[_0xedd3e9];return _0x346990;};'use strict';var multer=require(_0x4d12('0x0'));var util=require('util');var path=require(_0x4d12('0x1'));var timeout=require(_0x4d12('0x2'));var express=require(_0x4d12('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x4d12('0x4'));var controller=require(_0x4d12('0x5'));router[_0x4d12('0x6')]('/',auth['isAuthenticated'](),controller[_0x4d12('0x7')]);router[_0x4d12('0x6')](_0x4d12('0x8'),auth[_0x4d12('0x9')](),controller['show']);router['post']('/',auth[_0x4d12('0x9')](),controller[_0x4d12('0xa')]);router[_0x4d12('0xb')]('/:id/applications',auth[_0x4d12('0x9')](),controller['addApplications']);router[_0x4d12('0xc')](_0x4d12('0x8'),auth[_0x4d12('0x9')](),controller[_0x4d12('0xd')]);router[_0x4d12('0xe')](_0x4d12('0x8'),auth[_0x4d12('0x9')](),controller['destroy']);module[_0x4d12('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index e2e7687..45d5f8f 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(_0x57fd59,_0x49ff36){var _0x29e757=function(_0x451738){while(--_0x451738){_0x57fd59['push'](_0x57fd59['shift']());}};_0x29e757(++_0x49ff36);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'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(_0x14c08d,_0x40658f){var _0x19bd56=function(_0x463d71){while(--_0x463d71){_0x14c08d['push'](_0x14c08d['shift']());}};_0x19bd56(++_0x40658f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'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 5c97555..823333e 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 _0x0406=['model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','options','VoiceExtension','count','includeAll','include','findAll','rows','catch','show','params','create','body','startsWith','exten','concat','user','role','InboundRoutes','InternalRoutes','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','description','cutdigits','mandatoryDisposition','findOne','transaction','VoiceExtensionId','findAndCountAll','cast(priority\x20as\x20unsigned)','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','end','json','offset','limit','set','apply','reject','save','update','then','destroy','get','inbound','OutboundRoutes','outbound','internal','filter','value','includes','find','type','UserProfileResource','error','name','send','index','map','rawAttributes','query','keys','filters','intersection'];(function(_0x5c58ae,_0x5af158){var _0x49a91f=function(_0x3ea453){while(--_0x3ea453){_0x5c58ae['push'](_0x5c58ae['shift']());}};_0x49a91f(++_0x5af158);}(_0x0406,0x165));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('fast-json-patch');var rp=require(_0x6040('0x4'));var moment=require(_0x6040('0x5'));var BPromise=require(_0x6040('0x6'));var Mustache=require(_0x6040('0x7'));var util=require(_0x6040('0x8'));var path=require(_0x6040('0x9'));var sox=require(_0x6040('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x6040('0xb'));var crypto=require(_0x6040('0xc'));var jsforce=require(_0x6040('0xd'));var deskjs=require(_0x6040('0xe'));var toCsv=require(_0x6040('0xf'));var querystring=require('querystring');var Papa=require(_0x6040('0x10'));var Redis=require('ioredis');var authService=require(_0x6040('0x11'));var qs=require(_0x6040('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6040('0x13'));var logger=require('../../config/logger')(_0x6040('0x14'));var utils=require(_0x6040('0x15'));var config=require('../../config/environment');var db=require(_0x6040('0x16'))['db'];config[_0x6040('0x17')]=_[_0x6040('0x18')](config[_0x6040('0x17')],{'host':_0x6040('0x19'),'port':0x18eb});var socket=require(_0x6040('0x1a'))(new Redis(config[_0x6040('0x17')]));require(_0x6040('0x1b'))[_0x6040('0x1c')](socket);function respondWithStatusCode(_0xf97f33,_0x3769d4){_0x3769d4=_0x3769d4||0xcc;return function(_0x3c0508){if(_0x3c0508){return _0xf97f33[_0x6040('0x1d')](_0x3769d4);}return _0xf97f33[_0x6040('0x1e')](_0x3769d4)[_0x6040('0x1f')]();};}function respondWithResult(_0x45b626,_0x1b3f58){_0x1b3f58=_0x1b3f58||0xc8;return function(_0x10852e){if(_0x10852e){return _0x45b626[_0x6040('0x1e')](_0x1b3f58)[_0x6040('0x20')](_0x10852e);}};}function respondWithFilteredResult(_0x360586,_0x374e5c){return function(_0x29052f){if(_0x29052f){var _0x78a3fb=_0x29052f['count'],_0x49620f=_0x374e5c[_0x6040('0x21')],_0x28b4a5=_0x374e5c['offset']+_0x374e5c[_0x6040('0x22')],_0x471903;if(_0x28b4a5>=_0x78a3fb){_0x28b4a5=_0x78a3fb;_0x471903=0xc8;}else{_0x471903=0xce;}_0x360586[_0x6040('0x1e')](_0x471903);return _0x360586[_0x6040('0x23')]('Content-Range',_0x49620f+'-'+_0x28b4a5+'/'+_0x78a3fb)[_0x6040('0x20')](_0x29052f);}return null;};}function patchUpdates(_0x48ff5b){return function(_0x5bbe3a){try{jsonpatch[_0x6040('0x24')](_0x5bbe3a,_0x48ff5b,!![]);}catch(_0x48d189){return BPromise[_0x6040('0x25')](_0x48d189);}return _0x5bbe3a[_0x6040('0x26')]();};}function saveUpdates(_0x32816c,_0x3837f5){return function(_0x35132e){if(_0x35132e){return _0x35132e[_0x6040('0x27')](_0x32816c)[_0x6040('0x28')](function(_0x10a0f0){return _0x10a0f0;});}return null;};}function removeEntity(_0x49e0d2,_0x25832b){return function(_0x58f51a){if(_0x58f51a){return _0x58f51a[_0x6040('0x29')]()[_0x6040('0x28')](function(){var _0xae7d39=_0x58f51a[_0x6040('0x2a')]({'plain':!![]});var _0x32ffa4=[{'name':'InboundRoutes','value':_0x6040('0x2b'),'ignore':![]},{'name':_0x6040('0x2c'),'value':_0x6040('0x2d'),'ignore':![]},{'name':'InternalRoutes','value':_0x6040('0x2e'),'ignore':![]}];var _0x908636=_(_0x32ffa4)[_0x6040('0x2f')]('ignore')['map'](_0x6040('0x30'))['value']();if(_[_0x6040('0x31')](_0x908636,_0xae7d39['type'])){return;}var _0x3263c8=_[_0x6040('0x32')](_0x32ffa4,[_0x6040('0x30'),_0xae7d39[_0x6040('0x33')]])['name'];return db[_0x6040('0x34')]['destroy']({'where':{'type':_0x3263c8,'resourceId':_0xae7d39['id']}})[_0x6040('0x28')](function(){return _0x58f51a;});})[_0x6040('0x28')](function(){_0x49e0d2[_0x6040('0x1e')](0xcc)[_0x6040('0x1f')]();});}};}function handleEntityNotFound(_0x13dca3,_0x2445bb){return function(_0x8a5f99){if(!_0x8a5f99){_0x13dca3['sendStatus'](0x194);}return _0x8a5f99;};}function handleError(_0x5269c8,_0x37c4d8){_0x37c4d8=_0x37c4d8||0x1f4;return function(_0xcb35e3){logger[_0x6040('0x35')](_0xcb35e3['stack']);if(_0xcb35e3[_0x6040('0x36')]){delete _0xcb35e3[_0x6040('0x36')];}_0x5269c8[_0x6040('0x1e')](_0x37c4d8)[_0x6040('0x37')](_0xcb35e3);};}exports[_0x6040('0x38')]=function(_0x24809a,_0x7fabfb){var _0x2f103b={},_0x4ccc20={},_0x3f8cfe={'count':0x0,'rows':[]};var _0xd7f6f0=_[_0x6040('0x39')](db['VoiceExtension'][_0x6040('0x3a')],function(_0x9a6f24){return{'name':_0x9a6f24['fieldName'],'type':_0x9a6f24[_0x6040('0x33')]['key']};});_0x4ccc20['model']=_[_0x6040('0x39')](_0xd7f6f0,_0x6040('0x36'));_0x4ccc20[_0x6040('0x3b')]=_[_0x6040('0x3c')](_0x24809a[_0x6040('0x3b')]);_0x4ccc20[_0x6040('0x3d')]=_[_0x6040('0x3e')](_0x4ccc20[_0x6040('0x3f')],_0x4ccc20['query']);_0x2f103b[_0x6040('0x40')]=_[_0x6040('0x3e')](_0x4ccc20[_0x6040('0x3f')],qs['fields'](_0x24809a[_0x6040('0x3b')][_0x6040('0x41')]));_0x2f103b[_0x6040('0x40')]=_0x2f103b['attributes'][_0x6040('0x42')]?_0x2f103b[_0x6040('0x40')]:_0x4ccc20[_0x6040('0x3f')];if(!_0x24809a['query'][_0x6040('0x43')](_0x6040('0x44'))){_0x2f103b[_0x6040('0x22')]=qs[_0x6040('0x22')](_0x24809a[_0x6040('0x3b')][_0x6040('0x22')]);_0x2f103b[_0x6040('0x21')]=qs['offset'](_0x24809a[_0x6040('0x3b')][_0x6040('0x21')]);}_0x2f103b['order']=qs[_0x6040('0x45')](_0x24809a[_0x6040('0x3b')][_0x6040('0x45')]);_0x2f103b[_0x6040('0x46')]=qs[_0x6040('0x3d')](_[_0x6040('0x47')](_0x24809a[_0x6040('0x3b')],_0x4ccc20[_0x6040('0x3d')]));if(_0x24809a[_0x6040('0x3b')][_0x6040('0x2f')]){_0x2f103b[_0x6040('0x46')]=_[_0x6040('0x48')](_0x2f103b[_0x6040('0x46')],{'$or':_[_0x6040('0x39')](_0xd7f6f0,function(_0x591dff){if(_0x591dff[_0x6040('0x33')]!==_0x6040('0x49')){var _0x33857d={};_0x33857d[_0x591dff[_0x6040('0x36')]]={'$like':'%'+_0x24809a[_0x6040('0x3b')]['filter']+'%'};return _0x33857d;}})});}_0x2f103b=_[_0x6040('0x48')]({},_0x2f103b,_0x24809a[_0x6040('0x4a')]);var _0x26e797={'where':_0x2f103b[_0x6040('0x46')]};return db[_0x6040('0x4b')][_0x6040('0x4c')](_0x26e797)[_0x6040('0x28')](function(_0x5d56ce){_0x3f8cfe[_0x6040('0x4c')]=_0x5d56ce;if(_0x24809a[_0x6040('0x3b')][_0x6040('0x4d')]){_0x2f103b[_0x6040('0x4e')]=[{'all':!![]}];}return db[_0x6040('0x4b')][_0x6040('0x4f')](_0x2f103b);})['then'](function(_0xf7c989){_0x3f8cfe[_0x6040('0x50')]=_0xf7c989;return _0x3f8cfe;})[_0x6040('0x28')](respondWithFilteredResult(_0x7fabfb,_0x2f103b))[_0x6040('0x51')](handleError(_0x7fabfb,null));};exports[_0x6040('0x52')]=function(_0x5afb4e,_0x4449d4){var _0x3ab86b={'raw':![],'where':{'id':_0x5afb4e['params']['id']}},_0x339b8b={};_0x339b8b[_0x6040('0x3f')]=_[_0x6040('0x3c')](db[_0x6040('0x4b')][_0x6040('0x3a')]);_0x339b8b[_0x6040('0x3b')]=_[_0x6040('0x3c')](_0x5afb4e[_0x6040('0x3b')]);_0x339b8b[_0x6040('0x3d')]=_[_0x6040('0x3e')](_0x339b8b['model'],_0x339b8b[_0x6040('0x3b')]);_0x3ab86b[_0x6040('0x40')]=_[_0x6040('0x3e')](_0x339b8b[_0x6040('0x3f')],qs['fields'](_0x5afb4e[_0x6040('0x3b')][_0x6040('0x41')]));_0x3ab86b[_0x6040('0x40')]=_0x3ab86b['attributes']['length']?_0x3ab86b[_0x6040('0x40')]:_0x339b8b['model'];if(_0x5afb4e[_0x6040('0x3b')][_0x6040('0x4d')]){_0x3ab86b[_0x6040('0x4e')]=[{'all':!![]}];}_0x3ab86b=_[_0x6040('0x48')]({},_0x3ab86b,_0x5afb4e[_0x6040('0x4a')]);return db[_0x6040('0x4b')][_0x6040('0x32')](_0x3ab86b)['then'](handleEntityNotFound(_0x4449d4,null))['then'](respondWithResult(_0x4449d4,null))['catch'](handleError(_0x4449d4,null));};exports[_0x6040('0x29')]=function(_0x2a1bb9,_0x52284f){return db[_0x6040('0x4b')][_0x6040('0x32')]({'where':{'id':_0x2a1bb9[_0x6040('0x53')]['id']}})[_0x6040('0x28')](handleEntityNotFound(_0x52284f,null))[_0x6040('0x28')](removeEntity(_0x52284f,null))[_0x6040('0x51')](handleError(_0x52284f,null));};exports[_0x6040('0x54')]=function(_0x238422,_0x2c311f){if(_0x238422[_0x6040('0x55')][_0x6040('0x33')]===_0x6040('0x2d')&&!_[_0x6040('0x56')](_0x238422[_0x6040('0x55')][_0x6040('0x57')],'_')){_0x238422[_0x6040('0x55')]['exten']='_'[_0x6040('0x58')](_0x238422['body'][_0x6040('0x57')]);}return db['VoiceExtension'][_0x6040('0x54')](_0x238422['body'],{'raw':![]})[_0x6040('0x28')](function(_0x2c7f37){var _0x642504=_0x238422[_0x6040('0x59')]['get']({'plain':!![]});if(!_0x642504)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x642504[_0x6040('0x5a')]===_0x6040('0x59')){var _0x3cfb50=_0x2c7f37[_0x6040('0x2a')]({'plain':!![]});var _0x2f2b8e=[{'name':_0x6040('0x5b'),'value':_0x6040('0x2b')},{'name':_0x6040('0x2c'),'value':'outbound'},{'name':_0x6040('0x5c'),'value':_0x6040('0x2e')}];var _0x4e5588=_['find'](_0x2f2b8e,['value',_0x3cfb50[_0x6040('0x33')]])[_0x6040('0x36')];return db[_0x6040('0x5d')][_0x6040('0x32')]({'where':{'name':_0x4e5588,'userProfileId':_0x642504[_0x6040('0x5e')]},'raw':!![]})[_0x6040('0x28')](function(_0x560f66){if(_0x560f66&&_0x560f66['autoAssociation']===0x0){return db[_0x6040('0x34')]['create']({'name':_0x3cfb50[_0x6040('0x36')],'resourceId':_0x3cfb50['id'],'type':_0x560f66[_0x6040('0x36')],'sectionId':_0x560f66['id']},{})[_0x6040('0x28')](function(){return _0x2c7f37;});}else{return _0x2c7f37;}})[_0x6040('0x51')](function(_0xce0a00){logger['error'](_0x6040('0x5f'),_0xce0a00);throw _0xce0a00;});}return _0x2c7f37;})[_0x6040('0x28')](respondWithResult(_0x2c311f,0xc9))[_0x6040('0x51')](handleError(_0x2c311f,null));};exports[_0x6040('0x27')]=function(_0x18891b,_0x3753e8){if(_0x18891b[_0x6040('0x55')]['id']){delete _0x18891b[_0x6040('0x55')]['id'];}return db[_0x6040('0x4b')][_0x6040('0x32')]({'where':{'id':_0x18891b[_0x6040('0x53')]['id']}})[_0x6040('0x28')](handleEntityNotFound(_0x3753e8,null))[_0x6040('0x28')](function(_0x47576b){if(_0x47576b){return db[_0x6040('0x4b')][_0x6040('0x27')](_['pick'](_0x18891b['body'],[_0x6040('0x57'),_0x6040('0x60'),_0x6040('0x61'),'recordingFormat',_0x6040('0x62'),_0x6040('0x63')]),{'where':{'context':_0x47576b[_0x6040('0x60')],'exten':_0x47576b[_0x6040('0x57')]},'individualHooks':!![]})['then'](function(_0x1f48c6){return _0x1f48c6;});}return null;})[_0x6040('0x28')](respondWithStatusCode(_0x3753e8,null))[_0x6040('0x51')](handleError(_0x3753e8,null));};exports['addApplications']=function(_0x5dbb03,_0x30b55a,_0x405190){return db['VoiceExtension'][_0x6040('0x64')]({'where':{'id':_0x5dbb03['params']['id']}})['then'](handleEntityNotFound(_0x30b55a,null))[_0x6040('0x28')](function(_0x3d7118){if(_0x3d7118){return db['sequelize'][_0x6040('0x65')](function(_0x14974a){return db['VoiceExtension'][_0x6040('0x29')]({'where':{'VoiceExtensionId':_0x5dbb03[_0x6040('0x53')]['id']},'transaction':_0x14974a})[_0x6040('0x28')](function(_0x20b0e1){var _0x3d1a4d=_[_0x6040('0x39')](_0x5dbb03[_0x6040('0x55')],function(_0x556813){_0x556813[_0x6040('0x66')]=_0x5dbb03[_0x6040('0x53')]['id'];return _0x556813;});return db[_0x6040('0x4b')]['bulkCreate'](_0x3d1a4d,{'transaction':_0x14974a});});})[_0x6040('0x28')](function(){return db[_0x6040('0x4b')][_0x6040('0x67')]({'where':{'isApp':!![],'VoiceExtensionId':_0x5dbb03[_0x6040('0x53')]['id']},'order':_0x6040('0x68')});});}})[_0x6040('0x28')](respondWithResult(_0x30b55a,null))['catch'](handleError(_0x30b55a,null));}; \ No newline at end of file +var _0x752a=['map','value','includes','type','name','UserProfileResource','error','send','VoiceExtension','rawAttributes','fieldName','key','query','keys','filters','intersection','attributes','model','fields','nolimit','offset','order','sort','where','pick','merge','include','findAll','rows','catch','params','length','includeAll','options','find','create','body','startsWith','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OutboundRoutes','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','exten','description','recordingFormat','cutdigits','mandatoryDisposition','context','addApplications','sequelize','transaction','bulkCreate','findAndCountAll','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','count','limit','Content-Range','json','apply','reject','then','destroy','get','InboundRoutes','outbound','InternalRoutes','internal','filter','ignore'];(function(_0x10cd5d,_0x29b79b){var _0x259525=function(_0x2865f7){while(--_0x2865f7){_0x10cd5d['push'](_0x10cd5d['shift']());}};_0x259525(++_0x29b79b);}(_0x752a,0x109));var _0xa752=function(_0x3e531a,_0x28a82a){_0x3e531a=_0x3e531a-0x0;var _0x3c2574=_0x752a[_0x3e531a];return _0x3c2574;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa752('0x0'));var rimraf=require(_0xa752('0x1'));var zipdir=require(_0xa752('0x2'));var jsonpatch=require(_0xa752('0x3'));var rp=require('request-promise');var moment=require(_0xa752('0x4'));var BPromise=require(_0xa752('0x5'));var Mustache=require(_0xa752('0x6'));var util=require(_0xa752('0x7'));var path=require(_0xa752('0x8'));var sox=require(_0xa752('0x9'));var csv=require(_0xa752('0xa'));var ejs=require(_0xa752('0xb'));var fs=require('fs');var _=require(_0xa752('0xc'));var squel=require(_0xa752('0xd'));var crypto=require(_0xa752('0xe'));var jsforce=require(_0xa752('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xa752('0xa'));var querystring=require(_0xa752('0x10'));var Papa=require('papaparse');var Redis=require(_0xa752('0x11'));var authService=require(_0xa752('0x12'));var qs=require(_0xa752('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa752('0x14'));var logger=require('../../config/logger')(_0xa752('0x15'));var utils=require(_0xa752('0x16'));var config=require('../../config/environment');var db=require(_0xa752('0x17'))['db'];config[_0xa752('0x18')]=_[_0xa752('0x19')](config['redis'],{'host':_0xa752('0x1a'),'port':0x18eb});var socket=require(_0xa752('0x1b'))(new Redis(config[_0xa752('0x18')]));require('./voiceExtension.socket')[_0xa752('0x1c')](socket);function respondWithStatusCode(_0x29a4df,_0x122237){_0x122237=_0x122237||0xcc;return function(_0x403d00){if(_0x403d00){return _0x29a4df[_0xa752('0x1d')](_0x122237);}return _0x29a4df[_0xa752('0x1e')](_0x122237)[_0xa752('0x1f')]();};}function respondWithResult(_0x33c9ff,_0x4e7077){_0x4e7077=_0x4e7077||0xc8;return function(_0x59e985){if(_0x59e985){return _0x33c9ff[_0xa752('0x1e')](_0x4e7077)['json'](_0x59e985);}};}function respondWithFilteredResult(_0x4ca753,_0x5b5835){return function(_0x20ed42){if(_0x20ed42){var _0x4b3522=_0x20ed42[_0xa752('0x20')],_0xe80bcc=_0x5b5835['offset'],_0x2ed6d3=_0x5b5835['offset']+_0x5b5835[_0xa752('0x21')],_0x5a84a6;if(_0x2ed6d3>=_0x4b3522){_0x2ed6d3=_0x4b3522;_0x5a84a6=0xc8;}else{_0x5a84a6=0xce;}_0x4ca753[_0xa752('0x1e')](_0x5a84a6);return _0x4ca753['set'](_0xa752('0x22'),_0xe80bcc+'-'+_0x2ed6d3+'/'+_0x4b3522)[_0xa752('0x23')](_0x20ed42);}return null;};}function patchUpdates(_0x562b70){return function(_0xf41b95){try{jsonpatch[_0xa752('0x24')](_0xf41b95,_0x562b70,!![]);}catch(_0x1f9e80){return BPromise[_0xa752('0x25')](_0x1f9e80);}return _0xf41b95['save']();};}function saveUpdates(_0x57e40e,_0x10f48c){return function(_0x3f51f0){if(_0x3f51f0){return _0x3f51f0['update'](_0x57e40e)[_0xa752('0x26')](function(_0x2574bf){return _0x2574bf;});}return null;};}function removeEntity(_0x1ad315,_0x1efcbe){return function(_0x19b5be){if(_0x19b5be){return _0x19b5be[_0xa752('0x27')]()[_0xa752('0x26')](function(){var _0x7485dc=_0x19b5be[_0xa752('0x28')]({'plain':!![]});var _0x305b48=[{'name':_0xa752('0x29'),'value':'inbound','ignore':![]},{'name':'OutboundRoutes','value':_0xa752('0x2a'),'ignore':![]},{'name':_0xa752('0x2b'),'value':_0xa752('0x2c'),'ignore':![]}];var _0x205dd3=_(_0x305b48)[_0xa752('0x2d')](_0xa752('0x2e'))[_0xa752('0x2f')]('value')[_0xa752('0x30')]();if(_[_0xa752('0x31')](_0x205dd3,_0x7485dc[_0xa752('0x32')])){return;}var _0x3cec55=_['find'](_0x305b48,['value',_0x7485dc[_0xa752('0x32')]])[_0xa752('0x33')];return db[_0xa752('0x34')]['destroy']({'where':{'type':_0x3cec55,'resourceId':_0x7485dc['id']}})[_0xa752('0x26')](function(){return _0x19b5be;});})[_0xa752('0x26')](function(){_0x1ad315[_0xa752('0x1e')](0xcc)[_0xa752('0x1f')]();});}};}function handleEntityNotFound(_0x6f2584,_0x62a8b6){return function(_0x5245a4){if(!_0x5245a4){_0x6f2584[_0xa752('0x1d')](0x194);}return _0x5245a4;};}function handleError(_0x2dae7f,_0x2a6ad0){_0x2a6ad0=_0x2a6ad0||0x1f4;return function(_0x29069a){logger[_0xa752('0x35')](_0x29069a['stack']);if(_0x29069a[_0xa752('0x33')]){delete _0x29069a[_0xa752('0x33')];}_0x2dae7f[_0xa752('0x1e')](_0x2a6ad0)[_0xa752('0x36')](_0x29069a);};}exports['index']=function(_0x1bafd0,_0x3e41e4){var _0x1ece9e={},_0x40ad84={},_0x3adbd6={'count':0x0,'rows':[]};var _0x1ace2b=_[_0xa752('0x2f')](db[_0xa752('0x37')][_0xa752('0x38')],function(_0x1650f5){return{'name':_0x1650f5[_0xa752('0x39')],'type':_0x1650f5['type'][_0xa752('0x3a')]};});_0x40ad84['model']=_['map'](_0x1ace2b,'name');_0x40ad84[_0xa752('0x3b')]=_[_0xa752('0x3c')](_0x1bafd0['query']);_0x40ad84[_0xa752('0x3d')]=_[_0xa752('0x3e')](_0x40ad84['model'],_0x40ad84['query']);_0x1ece9e[_0xa752('0x3f')]=_[_0xa752('0x3e')](_0x40ad84[_0xa752('0x40')],qs[_0xa752('0x41')](_0x1bafd0[_0xa752('0x3b')]['fields']));_0x1ece9e[_0xa752('0x3f')]=_0x1ece9e[_0xa752('0x3f')]['length']?_0x1ece9e[_0xa752('0x3f')]:_0x40ad84[_0xa752('0x40')];if(!_0x1bafd0[_0xa752('0x3b')]['hasOwnProperty'](_0xa752('0x42'))){_0x1ece9e[_0xa752('0x21')]=qs['limit'](_0x1bafd0['query'][_0xa752('0x21')]);_0x1ece9e[_0xa752('0x43')]=qs['offset'](_0x1bafd0[_0xa752('0x3b')][_0xa752('0x43')]);}_0x1ece9e[_0xa752('0x44')]=qs[_0xa752('0x45')](_0x1bafd0['query']['sort']);_0x1ece9e[_0xa752('0x46')]=qs[_0xa752('0x3d')](_[_0xa752('0x47')](_0x1bafd0[_0xa752('0x3b')],_0x40ad84['filters']));if(_0x1bafd0[_0xa752('0x3b')][_0xa752('0x2d')]){_0x1ece9e[_0xa752('0x46')]=_['merge'](_0x1ece9e[_0xa752('0x46')],{'$or':_['map'](_0x1ace2b,function(_0x55eef0){if(_0x55eef0[_0xa752('0x32')]!=='VIRTUAL'){var _0x26bbb6={};_0x26bbb6[_0x55eef0[_0xa752('0x33')]]={'$like':'%'+_0x1bafd0['query'][_0xa752('0x2d')]+'%'};return _0x26bbb6;}})});}_0x1ece9e=_[_0xa752('0x48')]({},_0x1ece9e,_0x1bafd0['options']);var _0x17b692={'where':_0x1ece9e[_0xa752('0x46')]};return db[_0xa752('0x37')]['count'](_0x17b692)['then'](function(_0xd44f2c){_0x3adbd6['count']=_0xd44f2c;if(_0x1bafd0[_0xa752('0x3b')]['includeAll']){_0x1ece9e[_0xa752('0x49')]=[{'all':!![]}];}return db[_0xa752('0x37')][_0xa752('0x4a')](_0x1ece9e);})['then'](function(_0x707447){_0x3adbd6[_0xa752('0x4b')]=_0x707447;return _0x3adbd6;})[_0xa752('0x26')](respondWithFilteredResult(_0x3e41e4,_0x1ece9e))[_0xa752('0x4c')](handleError(_0x3e41e4,null));};exports['show']=function(_0x37646c,_0x1850c8){var _0x2486e1={'raw':![],'where':{'id':_0x37646c[_0xa752('0x4d')]['id']}},_0x196a48={};_0x196a48['model']=_[_0xa752('0x3c')](db['VoiceExtension']['rawAttributes']);_0x196a48[_0xa752('0x3b')]=_['keys'](_0x37646c[_0xa752('0x3b')]);_0x196a48['filters']=_['intersection'](_0x196a48[_0xa752('0x40')],_0x196a48[_0xa752('0x3b')]);_0x2486e1[_0xa752('0x3f')]=_['intersection'](_0x196a48['model'],qs[_0xa752('0x41')](_0x37646c[_0xa752('0x3b')][_0xa752('0x41')]));_0x2486e1[_0xa752('0x3f')]=_0x2486e1[_0xa752('0x3f')][_0xa752('0x4e')]?_0x2486e1[_0xa752('0x3f')]:_0x196a48[_0xa752('0x40')];if(_0x37646c[_0xa752('0x3b')][_0xa752('0x4f')]){_0x2486e1['include']=[{'all':!![]}];}_0x2486e1=_[_0xa752('0x48')]({},_0x2486e1,_0x37646c[_0xa752('0x50')]);return db[_0xa752('0x37')][_0xa752('0x51')](_0x2486e1)['then'](handleEntityNotFound(_0x1850c8,null))[_0xa752('0x26')](respondWithResult(_0x1850c8,null))[_0xa752('0x4c')](handleError(_0x1850c8,null));};exports[_0xa752('0x27')]=function(_0x1975ee,_0x3c7601){return db[_0xa752('0x37')][_0xa752('0x51')]({'where':{'id':_0x1975ee[_0xa752('0x4d')]['id']}})[_0xa752('0x26')](handleEntityNotFound(_0x3c7601,null))[_0xa752('0x26')](removeEntity(_0x3c7601,null))['catch'](handleError(_0x3c7601,null));};exports[_0xa752('0x52')]=function(_0x706ec2,_0x1054f3){if(_0x706ec2[_0xa752('0x53')][_0xa752('0x32')]===_0xa752('0x2a')&&!_[_0xa752('0x54')](_0x706ec2[_0xa752('0x53')]['exten'],'_')){_0x706ec2[_0xa752('0x53')]['exten']='_'[_0xa752('0x55')](_0x706ec2[_0xa752('0x53')]['exten']);}return db[_0xa752('0x37')][_0xa752('0x52')](_0x706ec2[_0xa752('0x53')],{'raw':![]})[_0xa752('0x26')](function(_0x5718d8){var _0x527c59=_0x706ec2[_0xa752('0x56')]['get']({'plain':!![]});if(!_0x527c59)throw new Error(_0xa752('0x57'));if(_0x527c59[_0xa752('0x58')]===_0xa752('0x56')){var _0x279d2e=_0x5718d8[_0xa752('0x28')]({'plain':!![]});var _0x49bb9b=[{'name':_0xa752('0x29'),'value':'inbound'},{'name':_0xa752('0x59'),'value':'outbound'},{'name':_0xa752('0x2b'),'value':_0xa752('0x2c')}];var _0x38adcc=_['find'](_0x49bb9b,['value',_0x279d2e[_0xa752('0x32')]])[_0xa752('0x33')];return db[_0xa752('0x5a')][_0xa752('0x51')]({'where':{'name':_0x38adcc,'userProfileId':_0x527c59['userProfileId']},'raw':!![]})['then'](function(_0x1574ee){if(_0x1574ee&&_0x1574ee['autoAssociation']===0x0){return db[_0xa752('0x34')][_0xa752('0x52')]({'name':_0x279d2e[_0xa752('0x33')],'resourceId':_0x279d2e['id'],'type':_0x1574ee[_0xa752('0x33')],'sectionId':_0x1574ee['id']},{})[_0xa752('0x26')](function(){return _0x5718d8;});}else{return _0x5718d8;}})[_0xa752('0x4c')](function(_0x3fae13){logger[_0xa752('0x35')](_0xa752('0x5b'),_0x3fae13);throw _0x3fae13;});}return _0x5718d8;})[_0xa752('0x26')](respondWithResult(_0x1054f3,0xc9))[_0xa752('0x4c')](handleError(_0x1054f3,null));};exports[_0xa752('0x5c')]=function(_0x201aba,_0x363088){if(_0x201aba[_0xa752('0x53')]['id']){delete _0x201aba[_0xa752('0x53')]['id'];}return db[_0xa752('0x37')][_0xa752('0x51')]({'where':{'id':_0x201aba[_0xa752('0x4d')]['id']}})[_0xa752('0x26')](handleEntityNotFound(_0x363088,null))[_0xa752('0x26')](function(_0x2d2ceb){if(_0x2d2ceb){return db[_0xa752('0x37')][_0xa752('0x5c')](_[_0xa752('0x47')](_0x201aba['body'],[_0xa752('0x5d'),'context',_0xa752('0x5e'),_0xa752('0x5f'),_0xa752('0x60'),_0xa752('0x61')]),{'where':{'context':_0x2d2ceb[_0xa752('0x62')],'exten':_0x2d2ceb[_0xa752('0x5d')]},'individualHooks':!![]})['then'](function(_0x89202){return _0x89202;});}return null;})[_0xa752('0x26')](respondWithStatusCode(_0x363088,null))[_0xa752('0x4c')](handleError(_0x363088,null));};exports[_0xa752('0x63')]=function(_0x1a1f3c,_0x4bb15e,_0x398280){return db[_0xa752('0x37')]['findOne']({'where':{'id':_0x1a1f3c[_0xa752('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4bb15e,null))['then'](function(_0x4fe2b3){if(_0x4fe2b3){return db[_0xa752('0x64')][_0xa752('0x65')](function(_0x339260){return db[_0xa752('0x37')][_0xa752('0x27')]({'where':{'VoiceExtensionId':_0x1a1f3c[_0xa752('0x4d')]['id']},'transaction':_0x339260})[_0xa752('0x26')](function(_0x5e86e2){var _0x18a4dd=_[_0xa752('0x2f')](_0x1a1f3c[_0xa752('0x53')],function(_0x300b22){_0x300b22['VoiceExtensionId']=_0x1a1f3c[_0xa752('0x4d')]['id'];return _0x300b22;});return db['VoiceExtension'][_0xa752('0x66')](_0x18a4dd,{'transaction':_0x339260});});})[_0xa752('0x26')](function(){return db[_0xa752('0x37')][_0xa752('0x67')]({'where':{'isApp':!![],'VoiceExtensionId':_0x1a1f3c[_0xa752('0x4d')]['id']},'order':'cast(priority\x20as\x20unsigned)'});});}})[_0xa752('0x26')](respondWithResult(_0x4bb15e,null))[_0xa752('0x4c')](handleError(_0x4bb15e,null));}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 15d7522..aeecbed 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 _0xb4e4=['exports','VoiceExtension','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0xb4e4,0x119));var _0x4b4e=function(_0x3abd00,_0xa7acfa){_0x3abd00=_0x3abd00-0x0;var _0x2bfad7=_0xb4e4[_0x3abd00];return _0x2bfad7;};'use strict';var EventEmitter=require('events');var VoiceExtension=require('../../mysqldb')['db'][_0x4b4e('0x0')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x4b4e('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4b4e('0x2'),'afterDestroy':_0x4b4e('0x3')};function emitEvent(_0x8eeddd){return function(_0x5a5adc,_0xc0fb91,_0xb84768){VoiceExtensionEvents['emit'](_0x8eeddd+':'+_0x5a5adc['id'],_0x5a5adc);VoiceExtensionEvents[_0x4b4e('0x4')](_0x8eeddd,_0x5a5adc);_0xb84768(null);};}for(var e in events){if(events[_0x4b4e('0x5')](e)){var event=events[e];VoiceExtension[_0x4b4e('0x6')](e,emitEvent(event));}}module[_0x4b4e('0x7')]=VoiceExtensionEvents; \ No newline at end of file +var _0x7886=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceExtension','setMaxListeners'];(function(_0x3e79c2,_0x83e06e){var _0x1c6684=function(_0x53ab03){while(--_0x53ab03){_0x3e79c2['push'](_0x3e79c2['shift']());}};_0x1c6684(++_0x83e06e);}(_0x7886,0xc4));var _0x6788=function(_0x410918,_0x5d4ee0){_0x410918=_0x410918-0x0;var _0x4151e6=_0x7886[_0x410918];return _0x4151e6;};'use strict';var EventEmitter=require(_0x6788('0x0'));var VoiceExtension=require(_0x6788('0x1'))['db'][_0x6788('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x6788('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6788('0x4'),'afterDestroy':_0x6788('0x5')};function emitEvent(_0x3de92b){return function(_0x4eddaa,_0x4aa323,_0x80577){VoiceExtensionEvents[_0x6788('0x6')](_0x3de92b+':'+_0x4eddaa['id'],_0x4eddaa);VoiceExtensionEvents[_0x6788('0x6')](_0x3de92b,_0x4eddaa);_0x80577(null);};}for(var e in events){if(events[_0x6788('0x7')](e)){var event=events[e];VoiceExtension[_0x6788('0x8')](e,emitEvent(event));}}module[_0x6788('0x9')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 061ff55..5cf857a 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 _0x59f1=['VoiceExtension','util','api','bluebird','request-promise','path','../../config/environment','./voiceExtension.attributes','exports','define'];(function(_0x3f8d25,_0x59a9d2){var _0x387dde=function(_0x3ab4ed){while(--_0x3ab4ed){_0x3f8d25['push'](_0x3f8d25['shift']());}};_0x387dde(++_0x59a9d2);}(_0x59f1,0x6f));var _0x159f=function(_0x1909bc,_0x37aa8e){_0x1909bc=_0x1909bc-0x0;var _0x47a10b=_0x59f1[_0x1909bc];return _0x47a10b;};'use strict';var _=require('lodash');var util=require(_0x159f('0x0'));var logger=require('../../config/logger')(_0x159f('0x1'));var moment=require('moment');var BPromise=require(_0x159f('0x2'));var rp=require(_0x159f('0x3'));var fs=require('fs');var path=require(_0x159f('0x4'));var rimraf=require('rimraf');var config=require(_0x159f('0x5'));var attributes=require(_0x159f('0x6'));module[_0x159f('0x7')]=function(_0x391977,_0x45adfa){return _0x391977[_0x159f('0x8')](_0x159f('0x9'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7d69=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','exports','define','VoiceExtension'];(function(_0x160015,_0x4f0786){var _0x496b78=function(_0x3dffb7){while(--_0x3dffb7){_0x160015['push'](_0x160015['shift']());}};_0x496b78(++_0x4f0786);}(_0x7d69,0xf2));var _0x97d6=function(_0x345fbb,_0x44d54a){_0x345fbb=_0x345fbb-0x0;var _0xa0e3de=_0x7d69[_0x345fbb];return _0xa0e3de;};'use strict';var _=require(_0x97d6('0x0'));var util=require(_0x97d6('0x1'));var logger=require(_0x97d6('0x2'))(_0x97d6('0x3'));var moment=require(_0x97d6('0x4'));var BPromise=require(_0x97d6('0x5'));var rp=require(_0x97d6('0x6'));var fs=require('fs');var path=require(_0x97d6('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./voiceExtension.attributes');module[_0x97d6('0x8')]=function(_0x36ff6e,_0x5d66cf){return _0x36ff6e[_0x97d6('0x9')](_0x97d6('0xa'),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 1166d5d..a11b364 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 _0xe36f=['client','http','redis','localhost','socket.io-emitter','register','info','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','VoiceExtension,\x20%s,\x20%s','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','limit','include','map','model','attributes','then','util','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1ed944,_0x4d4caa){var _0x2f8d62=function(_0x31ef35){while(--_0x31ef35){_0x1ed944['push'](_0x1ed944['shift']());}};_0x2f8d62(++_0x4d4caa);}(_0xe36f,0x119));var _0xfe36=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe36f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xfe36('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfe36('0x1'))['db'];var utils=require(_0xfe36('0x2'));var logger=require(_0xfe36('0x3'))(_0xfe36('0x4'));var config=require(_0xfe36('0x5'));var jayson=require(_0xfe36('0x6'));var client=jayson[_0xfe36('0x7')][_0xfe36('0x8')]({'port':0x232a});config[_0xfe36('0x9')]=_['defaults'](config[_0xfe36('0x9')],{'host':_0xfe36('0xa'),'port':0x18eb});var socket=require(_0xfe36('0xb'))(new Redis(config[_0xfe36('0x9')]));require('./voiceExtension.socket')[_0xfe36('0xc')](socket);function respondWithRpcPromise(_0x41639e,_0x991b93,_0x2c930d){return new BPromise(function(_0x618ce6,_0x1f7f87){return client['request'](_0x41639e,_0x2c930d)['then'](function(_0x4c4fed){logger[_0xfe36('0xd')]('VoiceExtension,\x20%s,\x20%s',_0x991b93,'request\x20sent');logger[_0xfe36('0xe')](_0xfe36('0xf'),_0x991b93,_0xfe36('0x10'),JSON[_0xfe36('0x11')](_0x4c4fed));if(_0x4c4fed[_0xfe36('0x12')]){if(_0x4c4fed[_0xfe36('0x12')][_0xfe36('0x13')]===0x1f4){logger[_0xfe36('0x12')]('VoiceExtension,\x20%s,\x20%s',_0x991b93,_0x4c4fed[_0xfe36('0x12')][_0xfe36('0x14')]);return _0x1f7f87(_0x4c4fed[_0xfe36('0x12')][_0xfe36('0x14')]);}logger[_0xfe36('0x12')](_0xfe36('0x15'),_0x991b93,_0x4c4fed[_0xfe36('0x12')][_0xfe36('0x14')]);return _0x618ce6(_0x4c4fed['error'][_0xfe36('0x14')]);}else{logger['info'](_0xfe36('0x15'),_0x991b93,_0xfe36('0x10'));_0x618ce6(_0x4c4fed[_0xfe36('0x16')][_0xfe36('0x14')]);}})[_0xfe36('0x17')](function(_0x412d56){logger[_0xfe36('0x12')](_0xfe36('0x15'),_0x991b93,_0x412d56);_0x1f7f87(_0x412d56);});});}exports[_0xfe36('0x18')]=function(_0x35928f){var _0x504c6c=this;return new Promise(function(_0x390a1b,_0x3f3263){return db[_0xfe36('0x19')][_0xfe36('0x1a')]({'raw':_0x35928f[_0xfe36('0x1b')]?_0x35928f[_0xfe36('0x1b')][_0xfe36('0x1c')]===undefined?!![]:![]:!![],'where':_0x35928f[_0xfe36('0x1b')]?_0x35928f[_0xfe36('0x1b')][_0xfe36('0x1d')]||null:null,'attributes':_0x35928f[_0xfe36('0x1b')]?_0x35928f[_0xfe36('0x1b')]['attributes']||null:null,'limit':_0x35928f['options']?_0x35928f[_0xfe36('0x1b')][_0xfe36('0x1e')]||null:null,'include':_0x35928f['options']?_0x35928f[_0xfe36('0x1b')][_0xfe36('0x1f')]?_[_0xfe36('0x20')](_0x35928f['options']['include'],function(_0x5321a9){return{'model':db[_0x5321a9[_0xfe36('0x21')]],'as':_0x5321a9['as'],'attributes':_0x5321a9[_0xfe36('0x22')],'include':_0x5321a9['include']?_[_0xfe36('0x20')](_0x5321a9[_0xfe36('0x1f')],function(_0x777bf4){return{'model':db[_0x777bf4[_0xfe36('0x21')]],'as':_0x777bf4['as'],'attributes':_0x777bf4[_0xfe36('0x22')],'include':_0x777bf4[_0xfe36('0x1f')]?_[_0xfe36('0x20')](_0x777bf4[_0xfe36('0x1f')],function(_0x386d71){return{'model':db[_0x386d71[_0xfe36('0x21')]],'as':_0x386d71['as'],'attributes':_0x386d71[_0xfe36('0x22')]};}):[]};}):[]};}):[]:[]})[_0xfe36('0x23')](function(_0x19e92c){logger[_0xfe36('0xd')](_0xfe36('0x18'),_0x35928f);logger['debug']('GetVoiceExtension',_0x35928f,JSON[_0xfe36('0x11')](_0x19e92c));_0x390a1b(_0x19e92c);})['catch'](function(_0x56bbc0){logger[_0xfe36('0x12')](_0xfe36('0x18'),_0x56bbc0[_0xfe36('0x14')],_0x35928f);_0x3f3263(_0x504c6c[_0xfe36('0x12')](0x1f4,_0x56bbc0[_0xfe36('0x14')]));});});}; \ No newline at end of file +var _0x12d7=['then','request\x20sent','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','message','VoiceExtension,\x20%s,\x20%s','info','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','attributes','limit','include','map','model','debug','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request'];(function(_0x2d1351,_0x5dd9c4){var _0x5d6786=function(_0x2ac772){while(--_0x2ac772){_0x2d1351['push'](_0x2d1351['shift']());}};_0x5d6786(++_0x5dd9c4);}(_0x12d7,0x1e9));var _0x712d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x12d7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x712d('0x0'));var util=require(_0x712d('0x1'));var moment=require('moment');var BPromise=require(_0x712d('0x2'));var rs=require(_0x712d('0x3'));var fs=require('fs');var Redis=require(_0x712d('0x4'));var db=require(_0x712d('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x712d('0x6'));var config=require('../../config/environment');var jayson=require(_0x712d('0x7'));var client=jayson[_0x712d('0x8')][_0x712d('0x9')]({'port':0x232a});config[_0x712d('0xa')]=_['defaults'](config[_0x712d('0xa')],{'host':_0x712d('0xb'),'port':0x18eb});var socket=require(_0x712d('0xc'))(new Redis(config[_0x712d('0xa')]));require('./voiceExtension.socket')[_0x712d('0xd')](socket);function respondWithRpcPromise(_0x540346,_0x4546c0,_0x3f19a0){return new BPromise(function(_0x498b83,_0x358a4e){return client[_0x712d('0xe')](_0x540346,_0x3f19a0)[_0x712d('0xf')](function(_0x2de4eb){logger['info']('VoiceExtension,\x20%s,\x20%s',_0x4546c0,_0x712d('0x10'));logger['debug'](_0x712d('0x11'),_0x4546c0,_0x712d('0x10'),JSON[_0x712d('0x12')](_0x2de4eb));if(_0x2de4eb[_0x712d('0x13')]){if(_0x2de4eb['error']['code']===0x1f4){logger[_0x712d('0x13')]('VoiceExtension,\x20%s,\x20%s',_0x4546c0,_0x2de4eb['error'][_0x712d('0x14')]);return _0x358a4e(_0x2de4eb[_0x712d('0x13')][_0x712d('0x14')]);}logger['error'](_0x712d('0x15'),_0x4546c0,_0x2de4eb[_0x712d('0x13')][_0x712d('0x14')]);return _0x498b83(_0x2de4eb[_0x712d('0x13')][_0x712d('0x14')]);}else{logger[_0x712d('0x16')](_0x712d('0x15'),_0x4546c0,'request\x20sent');_0x498b83(_0x2de4eb[_0x712d('0x17')]['message']);}})[_0x712d('0x18')](function(_0x2a8e8b){logger['error'](_0x712d('0x15'),_0x4546c0,_0x2a8e8b);_0x358a4e(_0x2a8e8b);});});}exports[_0x712d('0x19')]=function(_0x1979c0){var _0x5d5772=this;return new Promise(function(_0x5dad27,_0x38af4d){return db[_0x712d('0x1a')][_0x712d('0x1b')]({'raw':_0x1979c0[_0x712d('0x1c')]?_0x1979c0[_0x712d('0x1c')][_0x712d('0x1d')]===undefined?!![]:![]:!![],'where':_0x1979c0[_0x712d('0x1c')]?_0x1979c0['options']['where']||null:null,'attributes':_0x1979c0['options']?_0x1979c0[_0x712d('0x1c')][_0x712d('0x1e')]||null:null,'limit':_0x1979c0['options']?_0x1979c0['options'][_0x712d('0x1f')]||null:null,'include':_0x1979c0[_0x712d('0x1c')]?_0x1979c0[_0x712d('0x1c')][_0x712d('0x20')]?_[_0x712d('0x21')](_0x1979c0['options']['include'],function(_0x2c0c6d){return{'model':db[_0x2c0c6d[_0x712d('0x22')]],'as':_0x2c0c6d['as'],'attributes':_0x2c0c6d[_0x712d('0x1e')],'include':_0x2c0c6d['include']?_['map'](_0x2c0c6d[_0x712d('0x20')],function(_0x2f8eff){return{'model':db[_0x2f8eff[_0x712d('0x22')]],'as':_0x2f8eff['as'],'attributes':_0x2f8eff[_0x712d('0x1e')],'include':_0x2f8eff[_0x712d('0x20')]?_[_0x712d('0x21')](_0x2f8eff['include'],function(_0x320d84){return{'model':db[_0x320d84[_0x712d('0x22')]],'as':_0x320d84['as'],'attributes':_0x320d84[_0x712d('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x712d('0xf')](function(_0xbfc5d1){logger[_0x712d('0x16')]('GetVoiceExtension',_0x1979c0);logger[_0x712d('0x23')](_0x712d('0x19'),_0x1979c0,JSON[_0x712d('0x12')](_0xbfc5d1));_0x5dad27(_0xbfc5d1);})[_0x712d('0x18')](function(_0x3a6d50){logger[_0x712d('0x13')](_0x712d('0x19'),_0x3a6d50['message'],_0x1979c0);_0x38af4d(_0x5d5772['error'](0x1f4,_0x3a6d50['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index a2a90d3..a9c66ed 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 _0x7d60=['./voiceExtension.events','save','remove','update','removeListener','register','length','voiceExtension:'];(function(_0x236d24,_0x29e80a){var _0x1574cf=function(_0x5d1dad){while(--_0x5d1dad){_0x236d24['push'](_0x236d24['shift']());}};_0x1574cf(++_0x29e80a);}(_0x7d60,0x138));var _0x07d6=function(_0x44538c,_0x223671){_0x44538c=_0x44538c-0x0;var _0x3d283a=_0x7d60[_0x44538c];return _0x3d283a;};'use strict';var VoiceExtensionEvents=require(_0x07d6('0x0'));var events=[_0x07d6('0x1'),_0x07d6('0x2'),_0x07d6('0x3')];function createListener(_0x543a75,_0x469126){return function(_0x2b7c13){_0x469126['emit'](_0x543a75,_0x2b7c13);};}function removeListener(_0x390520,_0x56ae0d){return function(){VoiceExtensionEvents[_0x07d6('0x4')](_0x390520,_0x56ae0d);};}exports[_0x07d6('0x5')]=function(_0x52ad74){for(var _0x2fd56f=0x0,_0x14ade0=events[_0x07d6('0x6')];_0x2fd56f<_0x14ade0;_0x2fd56f++){var _0x132519=events[_0x2fd56f];var _0x174bc2=createListener(_0x07d6('0x7')+_0x132519,_0x52ad74);VoiceExtensionEvents['on'](_0x132519,_0x174bc2);}}; \ No newline at end of file +var _0xcfbe=['remove','update','emit','removeListener','register','length','./voiceExtension.events'];(function(_0x4c1531,_0x274c0b){var _0x3a6889=function(_0x57077a){while(--_0x57077a){_0x4c1531['push'](_0x4c1531['shift']());}};_0x3a6889(++_0x274c0b);}(_0xcfbe,0x13a));var _0xecfb=function(_0x397843,_0x57b73f){_0x397843=_0x397843-0x0;var _0x2f2492=_0xcfbe[_0x397843];return _0x2f2492;};'use strict';var VoiceExtensionEvents=require(_0xecfb('0x0'));var events=['save',_0xecfb('0x1'),_0xecfb('0x2')];function createListener(_0x5a5a11,_0x303638){return function(_0x2d9fd1){_0x303638[_0xecfb('0x3')](_0x5a5a11,_0x2d9fd1);};}function removeListener(_0x2fde14,_0x59761f){return function(){VoiceExtensionEvents[_0xecfb('0x4')](_0x2fde14,_0x59761f);};}exports[_0xecfb('0x5')]=function(_0x496471){for(var _0x190ac2=0x0,_0x44b00b=events[_0xecfb('0x6')];_0x190ac2<_0x44b00b;_0x190ac2++){var _0x2367ef=events[_0x190ac2];var _0x52221e=createListener('voiceExtension:'+_0x2367ef,_0x496471);VoiceExtensionEvents['on'](_0x2367ef,_0x52221e);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 9eb4db3..a65f685 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 _0x21f3=['update','delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceMail.controller','isAuthenticated','index','get','/:id','show','/:id/messages','post'];(function(_0x4cf8d4,_0x5aee73){var _0x2c1beb=function(_0x39b0a4){while(--_0x39b0a4){_0x4cf8d4['push'](_0x4cf8d4['shift']());}};_0x2c1beb(++_0x5aee73);}(_0x21f3,0x18f));var _0x321f=function(_0x6b213c,_0x4d0f2f){_0x6b213c=_0x6b213c-0x0;var _0x3e1179=_0x21f3[_0x6b213c];return _0x3e1179;};'use strict';var multer=require('multer');var util=require(_0x321f('0x0'));var path=require(_0x321f('0x1'));var timeout=require(_0x321f('0x2'));var express=require(_0x321f('0x3'));var router=express[_0x321f('0x4')]();var auth=require(_0x321f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x321f('0x6'));var controller=require(_0x321f('0x7'));router['get']('/',auth[_0x321f('0x8')](),controller[_0x321f('0x9')]);router[_0x321f('0xa')](_0x321f('0xb'),auth[_0x321f('0x8')](),controller[_0x321f('0xc')]);router[_0x321f('0xa')](_0x321f('0xd'),auth['isAuthenticated'](),controller['getMessages']);router[_0x321f('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x321f('0xb'),auth[_0x321f('0x8')](),controller[_0x321f('0xf')]);router[_0x321f('0x10')](_0x321f('0xb'),auth[_0x321f('0x8')](),controller['destroy']);module[_0x321f('0x11')]=router; \ No newline at end of file +var _0x8781=['../../config/environment','./voiceMail.controller','get','index','/:id','isAuthenticated','/:id/messages','getMessages','post','create','put','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x31172e,_0xa59e5){var _0x414ada=function(_0x37ede4){while(--_0x37ede4){_0x31172e['push'](_0x31172e['shift']());}};_0x414ada(++_0xa59e5);}(_0x8781,0x19d));var _0x1878=function(_0x5a1e42,_0x4b0c2d){_0x5a1e42=_0x5a1e42-0x0;var _0x57405d=_0x8781[_0x5a1e42];return _0x57405d;};'use strict';var multer=require(_0x1878('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x1878('0x1'));var express=require(_0x1878('0x2'));var router=express[_0x1878('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x1878('0x4'));var config=require(_0x1878('0x5'));var controller=require(_0x1878('0x6'));router[_0x1878('0x7')]('/',auth['isAuthenticated'](),controller[_0x1878('0x8')]);router[_0x1878('0x7')](_0x1878('0x9'),auth[_0x1878('0xa')](),controller['show']);router[_0x1878('0x7')](_0x1878('0xb'),auth[_0x1878('0xa')](),controller[_0x1878('0xc')]);router[_0x1878('0xd')]('/',auth[_0x1878('0xa')](),controller[_0x1878('0xe')]);router[_0x1878('0xf')](_0x1878('0x9'),auth[_0x1878('0xa')](),controller['update']);router[_0x1878('0x10')](_0x1878('0x9'),auth[_0x1878('0xa')](),controller[_0x1878('0x11')]);module[_0x1878('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 98ec9e7..bd67dd3 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 _0xd7d1=['\x20-\x20','getDataValue','mailbox','sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue','string','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL'];(function(_0x2c1dcd,_0x350452){var _0x158ce5=function(_0x5c1c57){while(--_0x5c1c57){_0x2c1dcd['push'](_0x2c1dcd['shift']());}};_0x158ce5(++_0x350452);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x51aceb,_0x21fda6){_0x51aceb=_0x51aceb-0x0;var _0x42aac4=_0xd7d1[_0x51aceb];return _0x42aac4;};'use strict';var Sequelize=require(_0x1d7d('0x0'));module[_0x1d7d('0x1')]={'customer_id':{'type':Sequelize[_0x1d7d('0x2')]},'context':{'type':Sequelize[_0x1d7d('0x2')],'defaultValue':_0x1d7d('0x3'),'unique':_0x1d7d('0x4')},'mailbox':{'type':Sequelize[_0x1d7d('0x2')],'defaultValue':'','allowNull':![],'unique':_0x1d7d('0x4')},'password':{'type':Sequelize[_0x1d7d('0x2')]},'fullname':{'type':Sequelize[_0x1d7d('0x2')]},'email':{'type':Sequelize[_0x1d7d('0x2')],'validate':{'isEmail':!![]},'set':function(_0x1a2564){this[_0x1d7d('0x5')]('email',typeof _0x1a2564===_0x1d7d('0x6')&&_0x1a2564[_0x1d7d('0x7')]()?_0x1a2564[_0x1d7d('0x7')]():null);}},'pager':{'type':Sequelize[_0x1d7d('0x2')]},'tz':{'type':Sequelize[_0x1d7d('0x2')],'defaultValue':_0x1d7d('0x8')},'attach':{'type':Sequelize[_0x1d7d('0x9')](_0x1d7d('0xa'),'no'),'defaultValue':_0x1d7d('0xa'),'allowNull':![]},'saycid':{'type':Sequelize[_0x1d7d('0x9')](_0x1d7d('0xa'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0x1d7d('0x2')]},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0x1d7d('0x9')](_0x1d7d('0xa'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x1d7d('0x9')](_0x1d7d('0xa'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0x1d7d('0xa'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x1d7d('0xb'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x1d7d('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM'](_0x1d7d('0xa'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x1d7d('0x9')](_0x1d7d('0xa'),'no'),'defaultValue':_0x1d7d('0xa'),'allowNull':![]},'forcename':{'type':Sequelize[_0x1d7d('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x1d7d('0x9')](_0x1d7d('0xa'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0x1d7d('0xa'),'no'),'defaultValue':_0x1d7d('0xa'),'allowNull':![]},'stamp':{'type':_0x1d7d('0xc')},'emailsubject':{'type':Sequelize[_0x1d7d('0x2')]},'emailbody':{'type':Sequelize[_0x1d7d('0x2')]},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x1d7d('0xd')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x1d7d('0xe')],'get':function(){return this['getDataValue']('fullname')+_0x1d7d('0xf')+this[_0x1d7d('0x10')](_0x1d7d('0x11'));}}}; \ No newline at end of file +var _0xed3c=['INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','sequelize','exports','STRING','contest_mailbox','setDataValue','email','yes','ENUM','TINYINT(4)','TIMESTAMP'];(function(_0xdffb1d,_0x398ce7){var _0x56dedd=function(_0x10a2c1){while(--_0x10a2c1){_0xdffb1d['push'](_0xdffb1d['shift']());}};_0x56dedd(++_0x398ce7);}(_0xed3c,0x1a6));var _0xced3=function(_0x4e8022,_0x53229d){_0x4e8022=_0x4e8022-0x0;var _0xf5e73f=_0xed3c[_0x4e8022];return _0xf5e73f;};'use strict';var Sequelize=require(_0xced3('0x0'));module[_0xced3('0x1')]={'customer_id':{'type':Sequelize[_0xced3('0x2')]},'context':{'type':Sequelize[_0xced3('0x2')],'defaultValue':'from-voicemail','unique':_0xced3('0x3')},'mailbox':{'type':Sequelize[_0xced3('0x2')],'defaultValue':'','allowNull':![],'unique':_0xced3('0x3')},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xced3('0x2')],'validate':{'isEmail':!![]},'set':function(_0x1ada18){this[_0xced3('0x4')](_0xced3('0x5'),typeof _0x1ada18==='string'&&_0x1ada18['trim']()?_0x1ada18['trim']():null);}},'pager':{'type':Sequelize[_0xced3('0x2')]},'tz':{'type':Sequelize['STRING'],'defaultValue':'central'},'attach':{'type':Sequelize['ENUM'](_0xced3('0x6'),'no'),'defaultValue':_0xced3('0x6'),'allowNull':![]},'saycid':{'type':Sequelize[_0xced3('0x7')](_0xced3('0x6'),'no'),'defaultValue':_0xced3('0x6'),'allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize[_0xced3('0x2')]},'review':{'type':Sequelize[_0xced3('0x7')](_0xced3('0x6'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0xced3('0x6'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xced3('0x7')](_0xced3('0x6'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xced3('0x7')](_0xced3('0x6'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xced3('0x8'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xced3('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xced3('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xced3('0x7')](_0xced3('0x6'),'no'),'defaultValue':_0xced3('0x6'),'allowNull':![]},'forcename':{'type':Sequelize[_0xced3('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xced3('0x7')](_0xced3('0x6'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0xced3('0x6'),'no'),'defaultValue':_0xced3('0x6'),'allowNull':![]},'stamp':{'type':_0xced3('0x9')},'emailsubject':{'type':Sequelize[_0xced3('0x2')]},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize[_0xced3('0xa')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xced3('0xb')],'get':function(){return this[_0xced3('0xc')](_0xced3('0xd'))+_0xced3('0xe')+this[_0xced3('0xc')](_0xced3('0xf'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 535818e..86e4f32 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 _0x193f=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','apply','reject','save','update','then','destroy','get','Voicemails','UserProfileResource','end','error','stack','name','send','index','map','VoiceMail','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','keys','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','VoiceMailMessage','nolimit','mailbox','findAndCountAll','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x193f,0x9f));var _0xf193=function(_0x49052b,_0x3ba709){_0x49052b=_0x49052b-0x0;var _0x48c045=_0x193f[_0x49052b];return _0x48c045;};'use strict';var pdf=require(_0xf193('0x0'));var emlformat=require(_0xf193('0x1'));var rimraf=require(_0xf193('0x2'));var zipdir=require(_0xf193('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf193('0x4'));var moment=require(_0xf193('0x5'));var BPromise=require(_0xf193('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf193('0x7'));var sox=require(_0xf193('0x8'));var csv=require(_0xf193('0x9'));var ejs=require(_0xf193('0xa'));var fs=require('fs');var _=require(_0xf193('0xb'));var squel=require(_0xf193('0xc'));var crypto=require(_0xf193('0xd'));var jsforce=require(_0xf193('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xf193('0x9'));var querystring=require(_0xf193('0xf'));var Papa=require('papaparse');var Redis=require(_0xf193('0x10'));var authService=require(_0xf193('0x11'));var qs=require(_0xf193('0x12'));var as=require(_0xf193('0x13'));var hardwareService=require(_0xf193('0x14'));var logger=require('../../config/logger')(_0xf193('0x15'));var utils=require(_0xf193('0x16'));var config=require(_0xf193('0x17'));var db=require(_0xf193('0x18'))['db'];function respondWithStatusCode(_0x115b07,_0x597513){_0x597513=_0x597513||0xcc;return function(_0x88205a){if(_0x88205a){return _0x115b07[_0xf193('0x19')](_0x597513);}return _0x115b07[_0xf193('0x1a')](_0x597513)['end']();};}function respondWithResult(_0x2a9398,_0x2ef0d9){_0x2ef0d9=_0x2ef0d9||0xc8;return function(_0x40a581){if(_0x40a581){return _0x2a9398[_0xf193('0x1a')](_0x2ef0d9)[_0xf193('0x1b')](_0x40a581);}};}function respondWithFilteredResult(_0x230a6a,_0x4b8226){return function(_0x296d6e){if(_0x296d6e){var _0x27d488=_0x296d6e[_0xf193('0x1c')],_0x3cdfa9=_0x4b8226[_0xf193('0x1d')],_0x15148f=_0x4b8226['offset']+_0x4b8226[_0xf193('0x1e')],_0x2ae0b7;if(_0x15148f>=_0x27d488){_0x15148f=_0x27d488;_0x2ae0b7=0xc8;}else{_0x2ae0b7=0xce;}_0x230a6a['status'](_0x2ae0b7);return _0x230a6a['set']('Content-Range',_0x3cdfa9+'-'+_0x15148f+'/'+_0x27d488)[_0xf193('0x1b')](_0x296d6e);}return null;};}function patchUpdates(_0x106094){return function(_0x2a09b7){try{jsonpatch[_0xf193('0x1f')](_0x2a09b7,_0x106094,!![]);}catch(_0x27a8c9){return BPromise[_0xf193('0x20')](_0x27a8c9);}return _0x2a09b7[_0xf193('0x21')]();};}function saveUpdates(_0x2be34b,_0x5167cc){return function(_0x2b1fdd){if(_0x2b1fdd){return _0x2b1fdd[_0xf193('0x22')](_0x2be34b)[_0xf193('0x23')](function(_0x3ac69d){return _0x3ac69d;});}return null;};}function removeEntity(_0x9e6979,_0x544111){return function(_0x40baa8){if(_0x40baa8){return _0x40baa8[_0xf193('0x24')]()[_0xf193('0x23')](function(){var _0x3d4404=_0x40baa8[_0xf193('0x25')]({'plain':!![]});var _0x79e4d2=_0xf193('0x26');return db[_0xf193('0x27')][_0xf193('0x24')]({'where':{'type':_0x79e4d2,'resourceId':_0x3d4404['id']}})['then'](function(){return _0x40baa8;});})[_0xf193('0x23')](function(){_0x9e6979[_0xf193('0x1a')](0xcc)[_0xf193('0x28')]();});}};}function handleEntityNotFound(_0x2d3c1d,_0x42f7c2){return function(_0x2aa2ba){if(!_0x2aa2ba){_0x2d3c1d[_0xf193('0x19')](0x194);}return _0x2aa2ba;};}function handleError(_0x195ee1,_0x212582){_0x212582=_0x212582||0x1f4;return function(_0x3c5d39){logger[_0xf193('0x29')](_0x3c5d39[_0xf193('0x2a')]);if(_0x3c5d39[_0xf193('0x2b')]){delete _0x3c5d39[_0xf193('0x2b')];}_0x195ee1[_0xf193('0x1a')](_0x212582)[_0xf193('0x2c')](_0x3c5d39);};}exports[_0xf193('0x2d')]=function(_0x1a85f3,_0x505ce5){var _0x187254={},_0x4cef97={},_0x29c826={'count':0x0,'rows':[]};var _0x35fc96=_[_0xf193('0x2e')](db[_0xf193('0x2f')][_0xf193('0x30')],function(_0x3749ae){return{'name':_0x3749ae[_0xf193('0x31')],'type':_0x3749ae['type'][_0xf193('0x32')]};});_0x4cef97[_0xf193('0x33')]=_[_0xf193('0x2e')](_0x35fc96,'name');_0x4cef97[_0xf193('0x34')]=_['keys'](_0x1a85f3[_0xf193('0x34')]);_0x4cef97[_0xf193('0x35')]=_[_0xf193('0x36')](_0x4cef97['model'],_0x4cef97[_0xf193('0x34')]);_0x187254[_0xf193('0x37')]=_[_0xf193('0x36')](_0x4cef97[_0xf193('0x33')],qs[_0xf193('0x38')](_0x1a85f3['query'][_0xf193('0x38')]));_0x187254[_0xf193('0x37')]=_0x187254[_0xf193('0x37')][_0xf193('0x39')]?_0x187254['attributes']:_0x4cef97['model'];if(!_0x1a85f3[_0xf193('0x34')][_0xf193('0x3a')]('nolimit')){_0x187254[_0xf193('0x1e')]=qs[_0xf193('0x1e')](_0x1a85f3['query']['limit']);_0x187254[_0xf193('0x1d')]=qs[_0xf193('0x1d')](_0x1a85f3[_0xf193('0x34')][_0xf193('0x1d')]);}_0x187254[_0xf193('0x3b')]=qs[_0xf193('0x3c')](_0x1a85f3[_0xf193('0x34')][_0xf193('0x3c')]);_0x187254[_0xf193('0x3d')]=qs[_0xf193('0x35')](_[_0xf193('0x3e')](_0x1a85f3[_0xf193('0x34')],_0x4cef97['filters']));if(_0x1a85f3[_0xf193('0x34')]['filter']){_0x187254[_0xf193('0x3d')]=_[_0xf193('0x3f')](_0x187254['where'],{'$or':_[_0xf193('0x2e')](_0x35fc96,function(_0x4d955a){if(_0x4d955a['type']!==_0xf193('0x40')){var _0x89cc51={};_0x89cc51[_0x4d955a[_0xf193('0x2b')]]={'$like':'%'+_0x1a85f3[_0xf193('0x34')][_0xf193('0x41')]+'%'};return _0x89cc51;}})});}_0x187254=_[_0xf193('0x3f')]({},_0x187254,_0x1a85f3[_0xf193('0x42')]);var _0x59c10a={'where':_0x187254[_0xf193('0x3d')]};return db[_0xf193('0x2f')][_0xf193('0x1c')](_0x59c10a)[_0xf193('0x23')](function(_0x53f4d5){_0x29c826[_0xf193('0x1c')]=_0x53f4d5;if(_0x1a85f3[_0xf193('0x34')][_0xf193('0x43')]){_0x187254[_0xf193('0x44')]=[{'all':!![]}];}return db[_0xf193('0x2f')]['findAll'](_0x187254);})[_0xf193('0x23')](function(_0x3b5057){_0x29c826[_0xf193('0x45')]=_0x3b5057;return _0x29c826;})[_0xf193('0x23')](respondWithFilteredResult(_0x505ce5,_0x187254))[_0xf193('0x46')](handleError(_0x505ce5,null));};exports[_0xf193('0x47')]=function(_0x179ab1,_0x2b173b){var _0xa79f6b={'raw':!![],'where':{'id':_0x179ab1[_0xf193('0x48')]['id']}},_0x37418f={};_0x37418f[_0xf193('0x33')]=_[_0xf193('0x49')](db[_0xf193('0x2f')][_0xf193('0x30')]);_0x37418f[_0xf193('0x34')]=_[_0xf193('0x49')](_0x179ab1[_0xf193('0x34')]);_0x37418f[_0xf193('0x35')]=_[_0xf193('0x36')](_0x37418f[_0xf193('0x33')],_0x37418f['query']);_0xa79f6b[_0xf193('0x37')]=_['intersection'](_0x37418f[_0xf193('0x33')],qs[_0xf193('0x38')](_0x179ab1[_0xf193('0x34')][_0xf193('0x38')]));_0xa79f6b['attributes']=_0xa79f6b[_0xf193('0x37')][_0xf193('0x39')]?_0xa79f6b[_0xf193('0x37')]:_0x37418f[_0xf193('0x33')];if(_0x179ab1[_0xf193('0x34')][_0xf193('0x43')]){_0xa79f6b['include']=[{'all':!![]}];}_0xa79f6b=_[_0xf193('0x3f')]({},_0xa79f6b,_0x179ab1[_0xf193('0x42')]);return db[_0xf193('0x2f')][_0xf193('0x4a')](_0xa79f6b)[_0xf193('0x23')](handleEntityNotFound(_0x2b173b,null))['then'](respondWithResult(_0x2b173b,null))['catch'](handleError(_0x2b173b,null));};exports['create']=function(_0x5861fd,_0x43cce2){return db[_0xf193('0x2f')][_0xf193('0x4b')](_0x5861fd['body'],{})[_0xf193('0x23')](function(_0x2eed7f){var _0x4f95e4=_0x5861fd['user']['get']({'plain':!![]});if(!_0x4f95e4)throw new Error(_0xf193('0x4c'));if(_0x4f95e4[_0xf193('0x4d')]===_0xf193('0x4e')){var _0x151fcf=_0x2eed7f[_0xf193('0x25')]({'plain':!![]});var _0x35f19e='Voicemails';return db[_0xf193('0x4f')][_0xf193('0x4a')]({'where':{'name':_0x35f19e,'userProfileId':_0x4f95e4[_0xf193('0x50')]},'raw':!![]})[_0xf193('0x23')](function(_0x8908dd){if(_0x8908dd&&_0x8908dd[_0xf193('0x51')]===0x0){return db[_0xf193('0x27')][_0xf193('0x4b')]({'name':_0x151fcf[_0xf193('0x2b')],'resourceId':_0x151fcf['id'],'type':_0x8908dd[_0xf193('0x2b')],'sectionId':_0x8908dd['id']},{})[_0xf193('0x23')](function(){return _0x2eed7f;});}else{return _0x2eed7f;}})[_0xf193('0x46')](function(_0xf484df){logger[_0xf193('0x29')](_0xf193('0x52'),_0xf484df);throw _0xf484df;});}return _0x2eed7f;})[_0xf193('0x23')](respondWithResult(_0x43cce2,0xc9))[_0xf193('0x46')](handleError(_0x43cce2,null));};exports['update']=function(_0x39e912,_0x122ae9){if(_0x39e912['body']['id']){delete _0x39e912[_0xf193('0x53')]['id'];}return db['VoiceMail'][_0xf193('0x4a')]({'where':{'id':_0x39e912[_0xf193('0x48')]['id']}})[_0xf193('0x23')](handleEntityNotFound(_0x122ae9,null))[_0xf193('0x23')](saveUpdates(_0x39e912[_0xf193('0x53')],null))[_0xf193('0x23')](respondWithResult(_0x122ae9,null))['catch'](handleError(_0x122ae9,null));};exports[_0xf193('0x24')]=function(_0x4c03c4,_0x576e40){return db['VoiceMail'][_0xf193('0x4a')]({'where':{'id':_0x4c03c4['params']['id']}})[_0xf193('0x23')](handleEntityNotFound(_0x576e40,null))[_0xf193('0x23')](removeEntity(_0x576e40,null))[_0xf193('0x46')](handleError(_0x576e40,null));};exports['getMessages']=function(_0x4fafb8,_0x346465,_0x108046){return db[_0xf193('0x2f')]['findOne']({'where':{'id':_0x4fafb8['params']['id']}})['then'](handleEntityNotFound(_0x346465,null))[_0xf193('0x23')](function(_0x125e93){var _0x223c5f;var _0x46ccab={},_0x1c52d3={};_0x1c52d3[_0xf193('0x33')]=_[_0xf193('0x49')](db[_0xf193('0x54')][_0xf193('0x30')]);_0x1c52d3['query']=_[_0xf193('0x49')](_0x4fafb8[_0xf193('0x34')]);_0x1c52d3[_0xf193('0x35')]=_['intersection'](_0x1c52d3[_0xf193('0x33')],_0x1c52d3['query']);_0x46ccab[_0xf193('0x37')]=_['intersection'](_0x1c52d3[_0xf193('0x33')],qs[_0xf193('0x38')](_0x4fafb8['query'][_0xf193('0x38')]));_0x46ccab[_0xf193('0x37')]=_0x46ccab[_0xf193('0x37')][_0xf193('0x39')]?_0x46ccab['attributes']:_0x1c52d3['model'];if(!_0x4fafb8[_0xf193('0x34')][_0xf193('0x3a')](_0xf193('0x55'))){_0x46ccab['limit']=qs[_0xf193('0x1e')](_0x4fafb8[_0xf193('0x34')]['limit']);_0x46ccab[_0xf193('0x1d')]=qs[_0xf193('0x1d')](_0x4fafb8[_0xf193('0x34')][_0xf193('0x1d')]);}_0x46ccab[_0xf193('0x3b')]=qs[_0xf193('0x3c')](_0x4fafb8['query'][_0xf193('0x3c')]);_0x46ccab[_0xf193('0x3d')]=qs[_0xf193('0x35')](_[_0xf193('0x3e')](_0x4fafb8[_0xf193('0x34')],_0x1c52d3['filters']));if(_0x4fafb8['query'][_0xf193('0x41')]){_0x46ccab[_0xf193('0x3d')]=_[_0xf193('0x3f')](_0x46ccab['where'],{'$or':_[_0xf193('0x2e')](_0x46ccab[_0xf193('0x37')],function(_0x1fc326){var _0x175ad0={};_0x175ad0[_0x1fc326]={'$like':'%'+_0x4fafb8['query'][_0xf193('0x41')]+'%'};return _0x175ad0;})});}_0x46ccab[_0xf193('0x3d')]=_['merge'](_0x46ccab[_0xf193('0x3d')],{'mailboxuser':_0x125e93[_0xf193('0x56')]});_0x46ccab=_[_0xf193('0x3f')]({},_0x46ccab,_0x4fafb8[_0xf193('0x42')]);return db[_0xf193('0x54')][_0xf193('0x57')](_0x46ccab)[_0xf193('0x23')](respondWithFilteredResult(_0x346465,_0x46ccab));})[_0xf193('0x46')](handleError(_0x346465,null));}; \ No newline at end of file +var _0xf6cf=['role','Voicemails','UserProfileSection','find','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','update','getMessages','VoiceMailMessage','nolimit','mailbox','findAndCountAll','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','jsforce','desk.js','to-csv','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','reject','save','then','destroy','get','error','stack','name','send','index','map','VoiceMail','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','limit','offset','order','sort','pick','filter','where','VIRTUAL','merge','count','findAll','rows','show','params','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x351509,_0x54725c){var _0x4e9861=function(_0x54f92c){while(--_0x54f92c){_0x351509['push'](_0x351509['shift']());}};_0x4e9861(++_0x54725c);}(_0xf6cf,0x156));var _0xff6c=function(_0x31f2d3,_0x3644fd){_0x31f2d3=_0x31f2d3-0x0;var _0x47e2c4=_0xf6cf[_0x31f2d3];return _0x47e2c4;};'use strict';var pdf=require(_0xff6c('0x0'));var emlformat=require(_0xff6c('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xff6c('0x2'));var jsonpatch=require(_0xff6c('0x3'));var rp=require(_0xff6c('0x4'));var moment=require(_0xff6c('0x5'));var BPromise=require(_0xff6c('0x6'));var Mustache=require(_0xff6c('0x7'));var util=require(_0xff6c('0x8'));var path=require(_0xff6c('0x9'));var sox=require(_0xff6c('0xa'));var csv=require('to-csv');var ejs=require(_0xff6c('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xff6c('0xc'));var deskjs=require(_0xff6c('0xd'));var toCsv=require(_0xff6c('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xff6c('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xff6c('0x10'));var as=require(_0xff6c('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xff6c('0x12'))('api');var utils=require(_0xff6c('0x13'));var config=require('../../config/environment');var db=require(_0xff6c('0x14'))['db'];function respondWithStatusCode(_0x1d2cf0,_0x443393){_0x443393=_0x443393||0xcc;return function(_0x1cb936){if(_0x1cb936){return _0x1d2cf0[_0xff6c('0x15')](_0x443393);}return _0x1d2cf0[_0xff6c('0x16')](_0x443393)[_0xff6c('0x17')]();};}function respondWithResult(_0x399d63,_0x4e8bd2){_0x4e8bd2=_0x4e8bd2||0xc8;return function(_0x5a7492){if(_0x5a7492){return _0x399d63[_0xff6c('0x16')](_0x4e8bd2)['json'](_0x5a7492);}};}function respondWithFilteredResult(_0x234080,_0x3ea649){return function(_0x30fe15){if(_0x30fe15){var _0x36526a=_0x30fe15['count'],_0x4bc305=_0x3ea649['offset'],_0x29b98c=_0x3ea649['offset']+_0x3ea649['limit'],_0x217c1c;if(_0x29b98c>=_0x36526a){_0x29b98c=_0x36526a;_0x217c1c=0xc8;}else{_0x217c1c=0xce;}_0x234080['status'](_0x217c1c);return _0x234080['set']('Content-Range',_0x4bc305+'-'+_0x29b98c+'/'+_0x36526a)[_0xff6c('0x18')](_0x30fe15);}return null;};}function patchUpdates(_0x58e9f1){return function(_0x3a07aa){try{jsonpatch['apply'](_0x3a07aa,_0x58e9f1,!![]);}catch(_0x49d292){return BPromise[_0xff6c('0x19')](_0x49d292);}return _0x3a07aa[_0xff6c('0x1a')]();};}function saveUpdates(_0x40edc8,_0x37845f){return function(_0x4906e6){if(_0x4906e6){return _0x4906e6['update'](_0x40edc8)[_0xff6c('0x1b')](function(_0x549ec3){return _0x549ec3;});}return null;};}function removeEntity(_0xb3f1f7,_0xe924eb){return function(_0x443a55){if(_0x443a55){return _0x443a55[_0xff6c('0x1c')]()[_0xff6c('0x1b')](function(){var _0x13ecd7=_0x443a55[_0xff6c('0x1d')]({'plain':!![]});var _0x324649='Voicemails';return db['UserProfileResource'][_0xff6c('0x1c')]({'where':{'type':_0x324649,'resourceId':_0x13ecd7['id']}})[_0xff6c('0x1b')](function(){return _0x443a55;});})[_0xff6c('0x1b')](function(){_0xb3f1f7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x290a04,_0x2c8626){return function(_0x4c5ebb){if(!_0x4c5ebb){_0x290a04[_0xff6c('0x15')](0x194);}return _0x4c5ebb;};}function handleError(_0xd0921e,_0x3b82cc){_0x3b82cc=_0x3b82cc||0x1f4;return function(_0xe3fdef){logger[_0xff6c('0x1e')](_0xe3fdef[_0xff6c('0x1f')]);if(_0xe3fdef['name']){delete _0xe3fdef[_0xff6c('0x20')];}_0xd0921e['status'](_0x3b82cc)[_0xff6c('0x21')](_0xe3fdef);};}exports[_0xff6c('0x22')]=function(_0x4e848d,_0x1e0f25){var _0x32b8ac={},_0x436f9a={},_0x38a2bf={'count':0x0,'rows':[]};var _0x1b9d8d=_[_0xff6c('0x23')](db[_0xff6c('0x24')][_0xff6c('0x25')],function(_0xcb9567){return{'name':_0xcb9567[_0xff6c('0x26')],'type':_0xcb9567[_0xff6c('0x27')]['key']};});_0x436f9a[_0xff6c('0x28')]=_[_0xff6c('0x23')](_0x1b9d8d,_0xff6c('0x20'));_0x436f9a[_0xff6c('0x29')]=_[_0xff6c('0x2a')](_0x4e848d[_0xff6c('0x29')]);_0x436f9a[_0xff6c('0x2b')]=_[_0xff6c('0x2c')](_0x436f9a[_0xff6c('0x28')],_0x436f9a['query']);_0x32b8ac['attributes']=_['intersection'](_0x436f9a[_0xff6c('0x28')],qs[_0xff6c('0x2d')](_0x4e848d[_0xff6c('0x29')][_0xff6c('0x2d')]));_0x32b8ac[_0xff6c('0x2e')]=_0x32b8ac['attributes'][_0xff6c('0x2f')]?_0x32b8ac[_0xff6c('0x2e')]:_0x436f9a[_0xff6c('0x28')];if(!_0x4e848d['query'][_0xff6c('0x30')]('nolimit')){_0x32b8ac[_0xff6c('0x31')]=qs[_0xff6c('0x31')](_0x4e848d['query'][_0xff6c('0x31')]);_0x32b8ac[_0xff6c('0x32')]=qs[_0xff6c('0x32')](_0x4e848d[_0xff6c('0x29')][_0xff6c('0x32')]);}_0x32b8ac[_0xff6c('0x33')]=qs[_0xff6c('0x34')](_0x4e848d[_0xff6c('0x29')][_0xff6c('0x34')]);_0x32b8ac['where']=qs[_0xff6c('0x2b')](_[_0xff6c('0x35')](_0x4e848d[_0xff6c('0x29')],_0x436f9a[_0xff6c('0x2b')]));if(_0x4e848d[_0xff6c('0x29')][_0xff6c('0x36')]){_0x32b8ac[_0xff6c('0x37')]=_['merge'](_0x32b8ac[_0xff6c('0x37')],{'$or':_[_0xff6c('0x23')](_0x1b9d8d,function(_0x14ca51){if(_0x14ca51['type']!==_0xff6c('0x38')){var _0x9e9a36={};_0x9e9a36[_0x14ca51[_0xff6c('0x20')]]={'$like':'%'+_0x4e848d[_0xff6c('0x29')][_0xff6c('0x36')]+'%'};return _0x9e9a36;}})});}_0x32b8ac=_[_0xff6c('0x39')]({},_0x32b8ac,_0x4e848d['options']);var _0x4d55bd={'where':_0x32b8ac[_0xff6c('0x37')]};return db[_0xff6c('0x24')][_0xff6c('0x3a')](_0x4d55bd)[_0xff6c('0x1b')](function(_0x3ae09d){_0x38a2bf['count']=_0x3ae09d;if(_0x4e848d[_0xff6c('0x29')]['includeAll']){_0x32b8ac['include']=[{'all':!![]}];}return db[_0xff6c('0x24')][_0xff6c('0x3b')](_0x32b8ac);})[_0xff6c('0x1b')](function(_0x4e7937){_0x38a2bf[_0xff6c('0x3c')]=_0x4e7937;return _0x38a2bf;})[_0xff6c('0x1b')](respondWithFilteredResult(_0x1e0f25,_0x32b8ac))['catch'](handleError(_0x1e0f25,null));};exports[_0xff6c('0x3d')]=function(_0x32e5fc,_0x5f1caf){var _0x535685={'raw':!![],'where':{'id':_0x32e5fc[_0xff6c('0x3e')]['id']}},_0x54a6c3={};_0x54a6c3['model']=_[_0xff6c('0x2a')](db[_0xff6c('0x24')][_0xff6c('0x25')]);_0x54a6c3[_0xff6c('0x29')]=_[_0xff6c('0x2a')](_0x32e5fc['query']);_0x54a6c3['filters']=_['intersection'](_0x54a6c3[_0xff6c('0x28')],_0x54a6c3['query']);_0x535685['attributes']=_[_0xff6c('0x2c')](_0x54a6c3[_0xff6c('0x28')],qs[_0xff6c('0x2d')](_0x32e5fc[_0xff6c('0x29')][_0xff6c('0x2d')]));_0x535685['attributes']=_0x535685[_0xff6c('0x2e')][_0xff6c('0x2f')]?_0x535685[_0xff6c('0x2e')]:_0x54a6c3['model'];if(_0x32e5fc[_0xff6c('0x29')]['includeAll']){_0x535685['include']=[{'all':!![]}];}_0x535685=_[_0xff6c('0x39')]({},_0x535685,_0x32e5fc[_0xff6c('0x3f')]);return db['VoiceMail']['find'](_0x535685)[_0xff6c('0x1b')](handleEntityNotFound(_0x5f1caf,null))[_0xff6c('0x1b')](respondWithResult(_0x5f1caf,null))['catch'](handleError(_0x5f1caf,null));};exports[_0xff6c('0x40')]=function(_0xf5fbaa,_0x2a005d){return db[_0xff6c('0x24')]['create'](_0xf5fbaa[_0xff6c('0x41')],{})[_0xff6c('0x1b')](function(_0x56cbcc){var _0x3c9ce4=_0xf5fbaa[_0xff6c('0x42')][_0xff6c('0x1d')]({'plain':!![]});if(!_0x3c9ce4)throw new Error(_0xff6c('0x43'));if(_0x3c9ce4[_0xff6c('0x44')]===_0xff6c('0x42')){var _0x294dbe=_0x56cbcc[_0xff6c('0x1d')]({'plain':!![]});var _0x529fbe=_0xff6c('0x45');return db[_0xff6c('0x46')][_0xff6c('0x47')]({'where':{'name':_0x529fbe,'userProfileId':_0x3c9ce4[_0xff6c('0x48')]},'raw':!![]})[_0xff6c('0x1b')](function(_0xe972a7){if(_0xe972a7&&_0xe972a7['autoAssociation']===0x0){return db[_0xff6c('0x49')][_0xff6c('0x40')]({'name':_0x294dbe[_0xff6c('0x20')],'resourceId':_0x294dbe['id'],'type':_0xe972a7['name'],'sectionId':_0xe972a7['id']},{})[_0xff6c('0x1b')](function(){return _0x56cbcc;});}else{return _0x56cbcc;}})['catch'](function(_0x44b6b3){logger['error'](_0xff6c('0x4a'),_0x44b6b3);throw _0x44b6b3;});}return _0x56cbcc;})['then'](respondWithResult(_0x2a005d,0xc9))[_0xff6c('0x4b')](handleError(_0x2a005d,null));};exports[_0xff6c('0x4c')]=function(_0x918306,_0x59a2ca){if(_0x918306[_0xff6c('0x41')]['id']){delete _0x918306[_0xff6c('0x41')]['id'];}return db[_0xff6c('0x24')][_0xff6c('0x47')]({'where':{'id':_0x918306[_0xff6c('0x3e')]['id']}})[_0xff6c('0x1b')](handleEntityNotFound(_0x59a2ca,null))['then'](saveUpdates(_0x918306['body'],null))[_0xff6c('0x1b')](respondWithResult(_0x59a2ca,null))[_0xff6c('0x4b')](handleError(_0x59a2ca,null));};exports[_0xff6c('0x1c')]=function(_0x1c0b78,_0x4433a3){return db[_0xff6c('0x24')][_0xff6c('0x47')]({'where':{'id':_0x1c0b78[_0xff6c('0x3e')]['id']}})['then'](handleEntityNotFound(_0x4433a3,null))[_0xff6c('0x1b')](removeEntity(_0x4433a3,null))[_0xff6c('0x4b')](handleError(_0x4433a3,null));};exports[_0xff6c('0x4d')]=function(_0x186c42,_0x3584b0,_0x33ab9f){return db[_0xff6c('0x24')]['findOne']({'where':{'id':_0x186c42['params']['id']}})['then'](handleEntityNotFound(_0x3584b0,null))[_0xff6c('0x1b')](function(_0x56e898){var _0x36bd1f;var _0x398abe={},_0x38fb15={};_0x38fb15['model']=_[_0xff6c('0x2a')](db[_0xff6c('0x4e')][_0xff6c('0x25')]);_0x38fb15['query']=_[_0xff6c('0x2a')](_0x186c42[_0xff6c('0x29')]);_0x38fb15[_0xff6c('0x2b')]=_[_0xff6c('0x2c')](_0x38fb15['model'],_0x38fb15[_0xff6c('0x29')]);_0x398abe['attributes']=_['intersection'](_0x38fb15[_0xff6c('0x28')],qs[_0xff6c('0x2d')](_0x186c42[_0xff6c('0x29')]['fields']));_0x398abe[_0xff6c('0x2e')]=_0x398abe[_0xff6c('0x2e')][_0xff6c('0x2f')]?_0x398abe[_0xff6c('0x2e')]:_0x38fb15[_0xff6c('0x28')];if(!_0x186c42['query'][_0xff6c('0x30')](_0xff6c('0x4f'))){_0x398abe['limit']=qs[_0xff6c('0x31')](_0x186c42['query'][_0xff6c('0x31')]);_0x398abe[_0xff6c('0x32')]=qs[_0xff6c('0x32')](_0x186c42['query'][_0xff6c('0x32')]);}_0x398abe[_0xff6c('0x33')]=qs[_0xff6c('0x34')](_0x186c42['query'][_0xff6c('0x34')]);_0x398abe[_0xff6c('0x37')]=qs[_0xff6c('0x2b')](_[_0xff6c('0x35')](_0x186c42[_0xff6c('0x29')],_0x38fb15['filters']));if(_0x186c42[_0xff6c('0x29')][_0xff6c('0x36')]){_0x398abe[_0xff6c('0x37')]=_[_0xff6c('0x39')](_0x398abe[_0xff6c('0x37')],{'$or':_[_0xff6c('0x23')](_0x398abe[_0xff6c('0x2e')],function(_0x40ebd0){var _0x574366={};_0x574366[_0x40ebd0]={'$like':'%'+_0x186c42['query']['filter']+'%'};return _0x574366;})});}_0x398abe[_0xff6c('0x37')]=_[_0xff6c('0x39')](_0x398abe[_0xff6c('0x37')],{'mailboxuser':_0x56e898[_0xff6c('0x50')]});_0x398abe=_[_0xff6c('0x39')]({},_0x398abe,_0x186c42[_0xff6c('0x3f')]);return db[_0xff6c('0x4e')][_0xff6c('0x51')](_0x398abe)[_0xff6c('0x1b')](respondWithFilteredResult(_0x3584b0,_0x398abe));})[_0xff6c('0x4b')](handleError(_0x3584b0,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index e8b9d1b..a4abdc3 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 _0x03fa=['VoiceMail','mailbox_context','mailbox','context','lodash','api','moment','bluebird','request-promise','rimraf','define'];(function(_0x3c97e3,_0x321677){var _0x9bb0ed=function(_0x3a0cb6){while(--_0x3a0cb6){_0x3c97e3['push'](_0x3c97e3['shift']());}};_0x9bb0ed(++_0x321677);}(_0x03fa,0x117));var _0xa03f=function(_0x3a7fea,_0x23ace8){_0x3a7fea=_0x3a7fea-0x0;var _0x473d0c=_0x03fa[_0x3a7fea];return _0x473d0c;};'use strict';var _=require(_0xa03f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa03f('0x1'));var moment=require(_0xa03f('0x2'));var BPromise=require(_0xa03f('0x3'));var rp=require(_0xa03f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa03f('0x5'));var config=require('../../config/environment');var attributes=require('./voiceMail.attributes');module['exports']=function(_0x40108a,_0x1bb9e6){return _0x40108a[_0xa03f('0x6')](_0xa03f('0x7'),attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':_0xa03f('0x8'),'fields':[_0xa03f('0x9'),_0xa03f('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd6f9=['mailbox','context','lodash','util','moment','bluebird','request-promise','path','../../config/environment','./voiceMail.attributes','exports','voice_voicemail'];(function(_0x42c7c5,_0xe5858b){var _0x5810bd=function(_0x4edb0f){while(--_0x4edb0f){_0x42c7c5['push'](_0x42c7c5['shift']());}};_0x5810bd(++_0xe5858b);}(_0xd6f9,0x1ca));var _0x9d6f=function(_0x445101,_0x2414bf){_0x445101=_0x445101-0x0;var _0x3c3d04=_0xd6f9[_0x445101];return _0x3c3d04;};'use strict';var _=require(_0x9d6f('0x0'));var util=require(_0x9d6f('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x9d6f('0x2'));var BPromise=require(_0x9d6f('0x3'));var rp=require(_0x9d6f('0x4'));var fs=require('fs');var path=require(_0x9d6f('0x5'));var rimraf=require('rimraf');var config=require(_0x9d6f('0x6'));var attributes=require(_0x9d6f('0x7'));module[_0x9d6f('0x8')]=function(_0x5ec60d,_0x12d741){return _0x5ec60d['define']('VoiceMail',attributes,{'tableName':_0x9d6f('0x9'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0x9d6f('0xa'),_0x9d6f('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 55d3b6b..8b3f932 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 _0x69af=['stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','VoiceMail,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x3744b3,_0x4a3423){var _0x4ed7b4=function(_0x343e9a){while(--_0x343e9a){_0x3744b3['push'](_0x3744b3['shift']());}};_0x4ed7b4(++_0x4a3423);}(_0x69af,0x102));var _0xf69a=function(_0x5289d2,_0x4e0154){_0x5289d2=_0x5289d2-0x0;var _0x31ace6=_0x69af[_0x5289d2];return _0x31ace6;};'use strict';var _=require(_0xf69a('0x0'));var util=require(_0xf69a('0x1'));var moment=require(_0xf69a('0x2'));var BPromise=require(_0xf69a('0x3'));var rs=require(_0xf69a('0x4'));var fs=require('fs');var Redis=require(_0xf69a('0x5'));var db=require(_0xf69a('0x6'))['db'];var utils=require(_0xf69a('0x7'));var logger=require(_0xf69a('0x8'))(_0xf69a('0x9'));var config=require(_0xf69a('0xa'));var jayson=require(_0xf69a('0xb'));var client=jayson[_0xf69a('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5607a8,_0x39f7d5,_0x186b48){return new BPromise(function(_0x31741d,_0x505e49){return client['request'](_0x5607a8,_0x186b48)[_0xf69a('0xd')](function(_0x42fd7d){logger[_0xf69a('0xe')](_0xf69a('0xf'),_0x39f7d5,'request\x20sent');logger[_0xf69a('0x10')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x39f7d5,_0xf69a('0x11'),JSON[_0xf69a('0x12')](_0x42fd7d));if(_0x42fd7d['error']){if(_0x42fd7d[_0xf69a('0x13')]['code']===0x1f4){logger[_0xf69a('0x13')]('VoiceMail,\x20%s,\x20%s',_0x39f7d5,_0x42fd7d[_0xf69a('0x13')][_0xf69a('0x14')]);return _0x505e49(_0x42fd7d[_0xf69a('0x13')][_0xf69a('0x14')]);}logger[_0xf69a('0x13')](_0xf69a('0xf'),_0x39f7d5,_0x42fd7d[_0xf69a('0x13')][_0xf69a('0x14')]);return _0x31741d(_0x42fd7d[_0xf69a('0x13')]['message']);}else{logger['info'](_0xf69a('0xf'),_0x39f7d5,_0xf69a('0x11'));_0x31741d(_0x42fd7d[_0xf69a('0x15')]['message']);}})[_0xf69a('0x16')](function(_0x43a212){logger[_0xf69a('0x13')]('VoiceMail,\x20%s,\x20%s',_0x39f7d5,_0x43a212);_0x505e49(_0x43a212);});});} \ No newline at end of file +var _0x69f1=['request\x20sent','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','info','VoiceMail,\x20%s,\x20%s','debug'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x69f1,0x11d));var _0x169f=function(_0x38b499,_0x296665){_0x38b499=_0x38b499-0x0;var _0x183e2e=_0x69f1[_0x38b499];return _0x183e2e;};'use strict';var _=require(_0x169f('0x0'));var util=require(_0x169f('0x1'));var moment=require('moment');var BPromise=require(_0x169f('0x2'));var rs=require(_0x169f('0x3'));var fs=require('fs');var Redis=require(_0x169f('0x4'));var db=require(_0x169f('0x5'))['db'];var utils=require(_0x169f('0x6'));var logger=require(_0x169f('0x7'))(_0x169f('0x8'));var config=require('../../config/environment');var jayson=require(_0x169f('0x9'));var client=jayson[_0x169f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c95e5,_0xf26032,_0x51e830){return new BPromise(function(_0x60574c,_0x23fd38){return client[_0x169f('0xb')](_0x3c95e5,_0x51e830)['then'](function(_0x31f863){logger[_0x169f('0xc')](_0x169f('0xd'),_0xf26032,'request\x20sent');logger[_0x169f('0xe')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0xf26032,_0x169f('0xf'),JSON['stringify'](_0x31f863));if(_0x31f863[_0x169f('0x10')]){if(_0x31f863['error'][_0x169f('0x11')]===0x1f4){logger['error'](_0x169f('0xd'),_0xf26032,_0x31f863[_0x169f('0x10')][_0x169f('0x12')]);return _0x23fd38(_0x31f863[_0x169f('0x10')][_0x169f('0x12')]);}logger['error'](_0x169f('0xd'),_0xf26032,_0x31f863[_0x169f('0x10')][_0x169f('0x12')]);return _0x60574c(_0x31f863[_0x169f('0x10')]['message']);}else{logger[_0x169f('0xc')](_0x169f('0xd'),_0xf26032,_0x169f('0xf'));_0x60574c(_0x31f863[_0x169f('0x13')][_0x169f('0x12')]);}})['catch'](function(_0x19f356){logger[_0x169f('0x10')]('VoiceMail,\x20%s,\x20%s',_0xf26032,_0x19f356);_0x23fd38(_0x19f356);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 1b51b58..449ee1a 100644 --- a/server/api/voiceMailMessage/index.js +++ b/server/api/voiceMailMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3f8a=['download','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','/:id','show','/:id/download'];(function(_0x87bec4,_0x5560b3){var _0x591d16=function(_0x2258ca){while(--_0x2258ca){_0x87bec4['push'](_0x87bec4['shift']());}};_0x591d16(++_0x5560b3);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0xf03bd9,_0x240cc6){_0xf03bd9=_0xf03bd9-0x0;var _0x2900cc=_0x3f8a[_0xf03bd9];return _0x2900cc;};'use strict';var multer=require(_0xa3f8('0x0'));var util=require(_0xa3f8('0x1'));var path=require(_0xa3f8('0x2'));var timeout=require(_0xa3f8('0x3'));var express=require('express');var router=express[_0xa3f8('0x4')]();var auth=require(_0xa3f8('0x5'));var interaction=require(_0xa3f8('0x6'));var config=require(_0xa3f8('0x7'));var controller=require(_0xa3f8('0x8'));router[_0xa3f8('0x9')]('/',auth[_0xa3f8('0xa')](),controller[_0xa3f8('0xb')]);router[_0xa3f8('0x9')](_0xa3f8('0xc'),auth[_0xa3f8('0xa')](),controller[_0xa3f8('0xd')]);router[_0xa3f8('0x9')](_0xa3f8('0xe'),auth[_0xa3f8('0xa')](),controller[_0xa3f8('0xf')]);router[_0xa3f8('0x10')]('/',auth['isAuthenticated'](),controller[_0xa3f8('0x11')]);router[_0xa3f8('0x12')](_0xa3f8('0xc'),auth[_0xa3f8('0xa')](),controller['update']);router[_0xa3f8('0x13')](_0xa3f8('0xc'),auth[_0xa3f8('0xa')](),controller[_0xa3f8('0x14')]);module[_0xa3f8('0x15')]=router; \ No newline at end of file +var _0x5fc3=['express','Router','../../components/auth/service','../../components/interaction/service','./voiceMailMessage.controller','get','isAuthenticated','/:id','show','/:id/download','download','post','put','update','delete','destroy','multer','util','connect-timeout'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x5fc3,0xa8));var _0x35fc=function(_0x4eaa4c,_0x2f7422){_0x4eaa4c=_0x4eaa4c-0x0;var _0x15aec6=_0x5fc3[_0x4eaa4c];return _0x15aec6;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var auth=require(_0x35fc('0x5'));var interaction=require(_0x35fc('0x6'));var config=require('../../config/environment');var controller=require(_0x35fc('0x7'));router[_0x35fc('0x8')]('/',auth[_0x35fc('0x9')](),controller['index']);router['get'](_0x35fc('0xa'),auth['isAuthenticated'](),controller[_0x35fc('0xb')]);router[_0x35fc('0x8')](_0x35fc('0xc'),auth[_0x35fc('0x9')](),controller[_0x35fc('0xd')]);router[_0x35fc('0xe')]('/',auth[_0x35fc('0x9')](),controller['create']);router[_0x35fc('0xf')](_0x35fc('0xa'),auth['isAuthenticated'](),controller[_0x35fc('0x10')]);router[_0x35fc('0x11')]('/:id',auth[_0x35fc('0x9')](),controller[_0x35fc('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 608cbdf..41f40a6 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 _0x463b=['getDataValue','STRING','BLOB','TIMESTAMP','sequelize','VIRTUAL'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x463b,0x1cc));var _0xb463=function(_0x1e506e,_0x456653){_0x1e506e=_0x1e506e-0x0;var _0x3eeb60=_0x463b[_0x1e506e];return _0x3eeb60;};'use strict';var Sequelize=require(_0xb463('0x0'));module['exports']={'name':{'type':Sequelize[_0xb463('0x1')],'get':function(_0x3300be){return this[_0xb463('0x2')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xb463('0x3')],'defaultValue':''},'context':{'type':Sequelize[_0xb463('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xb463('0x3')],'defaultValue':''},'callerid':{'type':Sequelize[_0xb463('0x3')],'defaultValue':''},'origtime':{'type':Sequelize[_0xb463('0x3')],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xb463('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xb463('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0xb463('0x4')]('long'),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0xb463('0x3')],'defaultValue':''},'stamp':{'type':_0xb463('0x5'),'allowNull':![]}}; \ No newline at end of file +var _0xcd87=['VIRTUAL','getDataValue','INTEGER','STRING','BLOB','long','sequelize','exports'];(function(_0x57cc22,_0x2d351f){var _0x6f7bdc=function(_0x4935b5){while(--_0x4935b5){_0x57cc22['push'](_0x57cc22['shift']());}};_0x6f7bdc(++_0x2d351f);}(_0xcd87,0x146));var _0x7cd8=function(_0x2707c9,_0x1cdfdd){_0x2707c9=_0x2707c9-0x0;var _0x1d01b4=_0xcd87[_0x2707c9];return _0x1d01b4;};'use strict';var Sequelize=require(_0x7cd8('0x0'));module[_0x7cd8('0x1')]={'name':{'type':Sequelize[_0x7cd8('0x2')],'get':function(_0x24e139){return this[_0x7cd8('0x3')]('id');}},'msgnum':{'type':Sequelize[_0x7cd8('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x7cd8('0x5')],'defaultValue':''},'context':{'type':Sequelize[_0x7cd8('0x5')],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0x7cd8('0x5')],'defaultValue':''},'origtime':{'type':Sequelize[_0x7cd8('0x5')],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x7cd8('0x5')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x7cd8('0x5')],'defaultValue':''},'recording':{'type':Sequelize[_0x7cd8('0x6')](_0x7cd8('0x7')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0x7cd8('0x5')],'defaultValue':''},'stamp':{'type':'TIMESTAMP','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index f7900ed..ee29d58 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 _0x5c12=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','json','count','offset','Content-Range','reject','save','update','then','destroy','end','error','name','send','index','map','VoiceMailMessage','type','key','model','differenceBy','query','keys','filters','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','options','include','findAll','catch','show','params','intersection','fields','includeAll','find','create','body','download','recording','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','msg_id','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','set','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs'];(function(_0xfb42e6,_0x5f5d4b){var _0x27265b=function(_0x163e81){while(--_0x163e81){_0xfb42e6['push'](_0xfb42e6['shift']());}};_0x27265b(++_0x5f5d4b);}(_0x5c12,0x188));var _0x25c1=function(_0x503306,_0x356f2f){_0x503306=_0x503306-0x0;var _0x44a99d=_0x5c12[_0x503306];return _0x44a99d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x25c1('0x0'));var rimraf=require(_0x25c1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x25c1('0x2'));var rp=require(_0x25c1('0x3'));var moment=require(_0x25c1('0x4'));var BPromise=require(_0x25c1('0x5'));var Mustache=require(_0x25c1('0x6'));var util=require(_0x25c1('0x7'));var path=require(_0x25c1('0x8'));var sox=require('sox');var csv=require(_0x25c1('0x9'));var ejs=require(_0x25c1('0xa'));var fs=require('fs');var _=require(_0x25c1('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x25c1('0xc'));var deskjs=require(_0x25c1('0xd'));var toCsv=require(_0x25c1('0x9'));var querystring=require(_0x25c1('0xe'));var Papa=require(_0x25c1('0xf'));var Redis=require('ioredis');var authService=require(_0x25c1('0x10'));var qs=require(_0x25c1('0x11'));var as=require(_0x25c1('0x12'));var hardwareService=require(_0x25c1('0x13'));var logger=require(_0x25c1('0x14'))('api');var utils=require(_0x25c1('0x15'));var config=require(_0x25c1('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x256ecd,_0x209af5){_0x209af5=_0x209af5||0xcc;return function(_0x323d3c){if(_0x323d3c){return _0x256ecd[_0x25c1('0x17')](_0x209af5);}return _0x256ecd['status'](_0x209af5)['end']();};}function respondWithResult(_0x4ef5d7,_0x54f6f4){_0x54f6f4=_0x54f6f4||0xc8;return function(_0x3ef429){if(_0x3ef429){return _0x4ef5d7[_0x25c1('0x18')](_0x54f6f4)[_0x25c1('0x19')](_0x3ef429);}};}function respondWithFilteredResult(_0x6eba15,_0x17a032){return function(_0x4ea926){if(_0x4ea926){var _0x4638f0=_0x4ea926[_0x25c1('0x1a')],_0x55b62d=_0x17a032[_0x25c1('0x1b')],_0x5d631e=_0x17a032['offset']+_0x17a032['limit'],_0x5b852a;if(_0x5d631e>=_0x4638f0){_0x5d631e=_0x4638f0;_0x5b852a=0xc8;}else{_0x5b852a=0xce;}_0x6eba15[_0x25c1('0x18')](_0x5b852a);return _0x6eba15['set'](_0x25c1('0x1c'),_0x55b62d+'-'+_0x5d631e+'/'+_0x4638f0)[_0x25c1('0x19')](_0x4ea926);}return null;};}function patchUpdates(_0x5c3c5d){return function(_0x4dd4f3){try{jsonpatch['apply'](_0x4dd4f3,_0x5c3c5d,!![]);}catch(_0x2ce1ce){return BPromise[_0x25c1('0x1d')](_0x2ce1ce);}return _0x4dd4f3[_0x25c1('0x1e')]();};}function saveUpdates(_0x1bf95d,_0x481c12){return function(_0x119639){if(_0x119639){return _0x119639[_0x25c1('0x1f')](_0x1bf95d)[_0x25c1('0x20')](function(_0x29e637){return _0x29e637;});}return null;};}function removeEntity(_0x517a46,_0x4c3259){return function(_0x2a8a84){if(_0x2a8a84){return _0x2a8a84[_0x25c1('0x21')]()[_0x25c1('0x20')](function(){_0x517a46[_0x25c1('0x18')](0xcc)[_0x25c1('0x22')]();});}};}function handleEntityNotFound(_0x1a4b89,_0x2ba595){return function(_0x324ea9){if(!_0x324ea9){_0x1a4b89[_0x25c1('0x17')](0x194);}return _0x324ea9;};}function handleError(_0x261604,_0x2f78dd){_0x2f78dd=_0x2f78dd||0x1f4;return function(_0x284daa){logger[_0x25c1('0x23')](_0x284daa['stack']);if(_0x284daa[_0x25c1('0x24')]){delete _0x284daa[_0x25c1('0x24')];}_0x261604[_0x25c1('0x18')](_0x2f78dd)[_0x25c1('0x25')](_0x284daa);};}exports[_0x25c1('0x26')]=function(_0x326a5f,_0x5ad776){var _0x17c924={},_0x428ce8={},_0x6cb14f={'count':0x0,'rows':[]};var _0x38c1d5=_[_0x25c1('0x27')](db[_0x25c1('0x28')]['rawAttributes'],function(_0x1e498){return{'name':_0x1e498['fieldName'],'type':_0x1e498[_0x25c1('0x29')][_0x25c1('0x2a')]};});_0x428ce8[_0x25c1('0x2b')]=_[_0x25c1('0x2c')](_[_0x25c1('0x27')](_0x38c1d5,_0x25c1('0x24')),[_0x25c1('0x24')]);_0x428ce8[_0x25c1('0x2d')]=_[_0x25c1('0x2e')](_0x326a5f['query']);_0x428ce8[_0x25c1('0x2f')]=_['intersection'](_0x428ce8['model'],_0x428ce8[_0x25c1('0x2d')]);_0x17c924[_0x25c1('0x30')]=_['intersection'](_0x428ce8[_0x25c1('0x2b')],qs['fields'](_0x326a5f[_0x25c1('0x2d')]['fields']));_0x17c924[_0x25c1('0x30')]=_0x17c924[_0x25c1('0x30')][_0x25c1('0x31')]?_0x17c924[_0x25c1('0x30')]:_0x428ce8[_0x25c1('0x2b')];if(!_0x326a5f[_0x25c1('0x2d')][_0x25c1('0x32')](_0x25c1('0x33'))){_0x17c924['limit']=qs[_0x25c1('0x34')](_0x326a5f['query'][_0x25c1('0x34')]);_0x17c924['offset']=qs[_0x25c1('0x1b')](_0x326a5f[_0x25c1('0x2d')][_0x25c1('0x1b')]);}_0x17c924[_0x25c1('0x35')]=qs[_0x25c1('0x36')](_0x326a5f[_0x25c1('0x2d')][_0x25c1('0x36')]);_0x17c924[_0x25c1('0x37')]=qs[_0x25c1('0x2f')](_[_0x25c1('0x38')](_0x326a5f[_0x25c1('0x2d')],_0x428ce8[_0x25c1('0x2f')]));if(_0x326a5f[_0x25c1('0x2d')][_0x25c1('0x39')]){_0x17c924[_0x25c1('0x37')]=_[_0x25c1('0x3a')](_0x17c924[_0x25c1('0x37')],{'$or':_[_0x25c1('0x27')](_0x38c1d5,function(_0x12cdee){if(_0x12cdee[_0x25c1('0x29')]!=='VIRTUAL'){var _0x32cc49={};_0x32cc49[_0x12cdee[_0x25c1('0x24')]]={'$like':'%'+_0x326a5f['query'][_0x25c1('0x39')]+'%'};return _0x32cc49;}})});}_0x17c924=_['merge']({},_0x17c924,_0x326a5f[_0x25c1('0x3b')]);var _0x4f978c={'where':_0x17c924[_0x25c1('0x37')]};return db[_0x25c1('0x28')][_0x25c1('0x1a')](_0x4f978c)[_0x25c1('0x20')](function(_0xbc20a3){_0x6cb14f['count']=_0xbc20a3;if(_0x326a5f[_0x25c1('0x2d')]['includeAll']){_0x17c924[_0x25c1('0x3c')]=[{'all':!![]}];}return db[_0x25c1('0x28')][_0x25c1('0x3d')](_0x17c924);})[_0x25c1('0x20')](function(_0x57c65a){_0x6cb14f['rows']=_0x57c65a;return _0x6cb14f;})['then'](respondWithFilteredResult(_0x5ad776,_0x17c924))[_0x25c1('0x3e')](handleError(_0x5ad776,null));};exports[_0x25c1('0x3f')]=function(_0x530967,_0x198dfa){var _0x58792d={'raw':!![],'where':{'id':_0x530967[_0x25c1('0x40')]['id']}},_0x3d5172={};_0x3d5172[_0x25c1('0x2b')]=_['keys'](db['VoiceMailMessage']['rawAttributes']);_0x3d5172[_0x25c1('0x2d')]=_[_0x25c1('0x2e')](_0x530967['query']);_0x3d5172[_0x25c1('0x2f')]=_[_0x25c1('0x41')](_0x3d5172[_0x25c1('0x2b')],_0x3d5172['query']);_0x58792d['attributes']=_['intersection'](_0x3d5172['model'],qs[_0x25c1('0x42')](_0x530967[_0x25c1('0x2d')]['fields']));_0x58792d[_0x25c1('0x30')]=_0x58792d[_0x25c1('0x30')][_0x25c1('0x31')]?_0x58792d[_0x25c1('0x30')]:_0x3d5172[_0x25c1('0x2b')];if(_0x530967[_0x25c1('0x2d')][_0x25c1('0x43')]){_0x58792d['include']=[{'all':!![]}];}_0x58792d=_['merge']({},_0x58792d,_0x530967[_0x25c1('0x3b')]);return db[_0x25c1('0x28')][_0x25c1('0x44')](_0x58792d)['then'](handleEntityNotFound(_0x198dfa,null))[_0x25c1('0x20')](respondWithResult(_0x198dfa,null))[_0x25c1('0x3e')](handleError(_0x198dfa,null));};exports[_0x25c1('0x45')]=function(_0xa009d1,_0x557ca3){return db[_0x25c1('0x28')][_0x25c1('0x45')](_0xa009d1[_0x25c1('0x46')],{})[_0x25c1('0x20')](respondWithResult(_0x557ca3,0xc9))['catch'](handleError(_0x557ca3,null));};exports['update']=function(_0x13ac06,_0x2cd055){if(_0x13ac06[_0x25c1('0x46')]['id']){delete _0x13ac06[_0x25c1('0x46')]['id'];}return db['VoiceMailMessage'][_0x25c1('0x44')]({'where':{'id':_0x13ac06[_0x25c1('0x40')]['id']}})['then'](handleEntityNotFound(_0x2cd055,null))[_0x25c1('0x20')](saveUpdates(_0x13ac06[_0x25c1('0x46')],null))[_0x25c1('0x20')](respondWithResult(_0x2cd055,null))[_0x25c1('0x3e')](handleError(_0x2cd055,null));};exports['destroy']=function(_0x4b2e06,_0x5034ba){return db[_0x25c1('0x28')][_0x25c1('0x44')]({'where':{'id':_0x4b2e06['params']['id']}})[_0x25c1('0x20')](handleEntityNotFound(_0x5034ba,null))[_0x25c1('0x20')](removeEntity(_0x5034ba,null))['catch'](handleError(_0x5034ba,null));};exports[_0x25c1('0x47')]=function(_0x1b938e,_0x2b58a3,_0x2b3bcb){return db[_0x25c1('0x28')][_0x25c1('0x44')]({'where':{'id':_0x1b938e[_0x25c1('0x40')]['id']},'attributes':['id','recording','msg_id']})['then'](handleEntityNotFound(_0x2b58a3,null))[_0x25c1('0x20')](function(_0x5c588c){if(_0x5c588c){if(!_0x5c588c[_0x25c1('0x48')]){throw new db[(_0x25c1('0x49'))][(_0x25c1('0x4a'))](_0x25c1('0x4b'));}var _0x40fe57={'Content-Type':_0x25c1('0x4c'),'Content-Disposition':'attachment'};if(_0x5c588c[_0x25c1('0x4d')]){_0x40fe57[_0x25c1('0x4e')]=_0x25c1('0x4f')+_0x5c588c[_0x25c1('0x4d')]+_0x25c1('0x50');}_0x2b58a3[_0x25c1('0x51')](_0x40fe57);return _0x2b58a3['send'](new Buffer(_0x5c588c[_0x25c1('0x48')]));}})[_0x25c1('0x3e')](handleError(_0x2b58a3,null));}; \ No newline at end of file +var _0x5292=['findAll','catch','show','length','find','create','body','update','params','recording','msg_id','VoiceMailMessage\x20not\x20found','attachment','attachment;\x20filename=\x22','.wav\x22','set','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','lodash','squel','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','end','json','count','offset','limit','apply','save','then','destroy','stack','name','send','index','map','rawAttributes','type','key','differenceBy','query','keys','filters','model','attributes','intersection','fields','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','VoiceMailMessage','includeAll','include'];(function(_0x1c3a72,_0x518b66){var _0x1eec42=function(_0x1b5fd0){while(--_0x1b5fd0){_0x1c3a72['push'](_0x1c3a72['shift']());}};_0x1eec42(++_0x518b66);}(_0x5292,0xf7));var _0x2529=function(_0x469ac7,_0x38e416){_0x469ac7=_0x469ac7-0x0;var _0x22f3b0=_0x5292[_0x469ac7];return _0x22f3b0;};'use strict';var pdf=require(_0x2529('0x0'));var emlformat=require(_0x2529('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x2529('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2529('0x3'));var moment=require(_0x2529('0x4'));var BPromise=require(_0x2529('0x5'));var Mustache=require(_0x2529('0x6'));var util=require('util');var path=require(_0x2529('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x2529('0x8'));var squel=require(_0x2529('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2529('0xa'));var toCsv=require(_0x2529('0xb'));var querystring=require('querystring');var Papa=require(_0x2529('0xc'));var Redis=require(_0x2529('0xd'));var authService=require(_0x2529('0xe'));var qs=require(_0x2529('0xf'));var as=require(_0x2529('0x10'));var hardwareService=require(_0x2529('0x11'));var logger=require(_0x2529('0x12'))(_0x2529('0x13'));var utils=require('../../config/utils');var config=require(_0x2529('0x14'));var db=require(_0x2529('0x15'))['db'];function respondWithStatusCode(_0x521a43,_0xe333c9){_0xe333c9=_0xe333c9||0xcc;return function(_0x23bfaf){if(_0x23bfaf){return _0x521a43[_0x2529('0x16')](_0xe333c9);}return _0x521a43[_0x2529('0x17')](_0xe333c9)[_0x2529('0x18')]();};}function respondWithResult(_0x31c39c,_0x3f3b40){_0x3f3b40=_0x3f3b40||0xc8;return function(_0x5245cf){if(_0x5245cf){return _0x31c39c[_0x2529('0x17')](_0x3f3b40)[_0x2529('0x19')](_0x5245cf);}};}function respondWithFilteredResult(_0x301eec,_0x19e4bf){return function(_0x1cc716){if(_0x1cc716){var _0x2598a1=_0x1cc716[_0x2529('0x1a')],_0x1a1ccc=_0x19e4bf['offset'],_0xf10dfb=_0x19e4bf[_0x2529('0x1b')]+_0x19e4bf[_0x2529('0x1c')],_0x574975;if(_0xf10dfb>=_0x2598a1){_0xf10dfb=_0x2598a1;_0x574975=0xc8;}else{_0x574975=0xce;}_0x301eec[_0x2529('0x17')](_0x574975);return _0x301eec['set']('Content-Range',_0x1a1ccc+'-'+_0xf10dfb+'/'+_0x2598a1)[_0x2529('0x19')](_0x1cc716);}return null;};}function patchUpdates(_0x3e0be5){return function(_0x41e530){try{jsonpatch[_0x2529('0x1d')](_0x41e530,_0x3e0be5,!![]);}catch(_0x2a1a94){return BPromise['reject'](_0x2a1a94);}return _0x41e530[_0x2529('0x1e')]();};}function saveUpdates(_0x34aafd,_0x1ca15f){return function(_0xeff5a6){if(_0xeff5a6){return _0xeff5a6['update'](_0x34aafd)[_0x2529('0x1f')](function(_0x40f2bc){return _0x40f2bc;});}return null;};}function removeEntity(_0x87a9da,_0x5b4760){return function(_0x3d5d17){if(_0x3d5d17){return _0x3d5d17[_0x2529('0x20')]()[_0x2529('0x1f')](function(){_0x87a9da[_0x2529('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2736f6,_0x2d0c6d){return function(_0x400a01){if(!_0x400a01){_0x2736f6[_0x2529('0x16')](0x194);}return _0x400a01;};}function handleError(_0x4454a5,_0xbb3c1b){_0xbb3c1b=_0xbb3c1b||0x1f4;return function(_0x53464a){logger['error'](_0x53464a[_0x2529('0x21')]);if(_0x53464a[_0x2529('0x22')]){delete _0x53464a[_0x2529('0x22')];}_0x4454a5[_0x2529('0x17')](_0xbb3c1b)[_0x2529('0x23')](_0x53464a);};}exports[_0x2529('0x24')]=function(_0x22ceec,_0x2f512c){var _0x20c135={},_0x113df6={},_0x5852aa={'count':0x0,'rows':[]};var _0x1c5209=_[_0x2529('0x25')](db['VoiceMailMessage'][_0x2529('0x26')],function(_0x3c46c6){return{'name':_0x3c46c6['fieldName'],'type':_0x3c46c6[_0x2529('0x27')][_0x2529('0x28')]};});_0x113df6['model']=_[_0x2529('0x29')](_[_0x2529('0x25')](_0x1c5209,'name'),[_0x2529('0x22')]);_0x113df6[_0x2529('0x2a')]=_[_0x2529('0x2b')](_0x22ceec[_0x2529('0x2a')]);_0x113df6[_0x2529('0x2c')]=_['intersection'](_0x113df6[_0x2529('0x2d')],_0x113df6[_0x2529('0x2a')]);_0x20c135[_0x2529('0x2e')]=_[_0x2529('0x2f')](_0x113df6[_0x2529('0x2d')],qs[_0x2529('0x30')](_0x22ceec[_0x2529('0x2a')]['fields']));_0x20c135['attributes']=_0x20c135[_0x2529('0x2e')]['length']?_0x20c135[_0x2529('0x2e')]:_0x113df6['model'];if(!_0x22ceec['query']['hasOwnProperty'](_0x2529('0x31'))){_0x20c135[_0x2529('0x1c')]=qs[_0x2529('0x1c')](_0x22ceec['query'][_0x2529('0x1c')]);_0x20c135['offset']=qs['offset'](_0x22ceec['query'][_0x2529('0x1b')]);}_0x20c135[_0x2529('0x32')]=qs[_0x2529('0x33')](_0x22ceec[_0x2529('0x2a')][_0x2529('0x33')]);_0x20c135[_0x2529('0x34')]=qs[_0x2529('0x2c')](_[_0x2529('0x35')](_0x22ceec[_0x2529('0x2a')],_0x113df6[_0x2529('0x2c')]));if(_0x22ceec[_0x2529('0x2a')][_0x2529('0x36')]){_0x20c135[_0x2529('0x34')]=_['merge'](_0x20c135['where'],{'$or':_[_0x2529('0x25')](_0x1c5209,function(_0x1a44fb){if(_0x1a44fb['type']!==_0x2529('0x37')){var _0x18b4c1={};_0x18b4c1[_0x1a44fb[_0x2529('0x22')]]={'$like':'%'+_0x22ceec[_0x2529('0x2a')][_0x2529('0x36')]+'%'};return _0x18b4c1;}})});}_0x20c135=_[_0x2529('0x38')]({},_0x20c135,_0x22ceec[_0x2529('0x39')]);var _0x5cfbe5={'where':_0x20c135[_0x2529('0x34')]};return db[_0x2529('0x3a')][_0x2529('0x1a')](_0x5cfbe5)['then'](function(_0x1393b7){_0x5852aa[_0x2529('0x1a')]=_0x1393b7;if(_0x22ceec[_0x2529('0x2a')][_0x2529('0x3b')]){_0x20c135[_0x2529('0x3c')]=[{'all':!![]}];}return db[_0x2529('0x3a')][_0x2529('0x3d')](_0x20c135);})[_0x2529('0x1f')](function(_0x179e6d){_0x5852aa['rows']=_0x179e6d;return _0x5852aa;})[_0x2529('0x1f')](respondWithFilteredResult(_0x2f512c,_0x20c135))[_0x2529('0x3e')](handleError(_0x2f512c,null));};exports[_0x2529('0x3f')]=function(_0x3b4e47,_0x99ffb){var _0x3905d2={'raw':!![],'where':{'id':_0x3b4e47['params']['id']}},_0x327dde={};_0x327dde[_0x2529('0x2d')]=_[_0x2529('0x2b')](db[_0x2529('0x3a')][_0x2529('0x26')]);_0x327dde[_0x2529('0x2a')]=_['keys'](_0x3b4e47[_0x2529('0x2a')]);_0x327dde[_0x2529('0x2c')]=_[_0x2529('0x2f')](_0x327dde[_0x2529('0x2d')],_0x327dde[_0x2529('0x2a')]);_0x3905d2[_0x2529('0x2e')]=_['intersection'](_0x327dde['model'],qs['fields'](_0x3b4e47['query'][_0x2529('0x30')]));_0x3905d2['attributes']=_0x3905d2[_0x2529('0x2e')][_0x2529('0x40')]?_0x3905d2[_0x2529('0x2e')]:_0x327dde[_0x2529('0x2d')];if(_0x3b4e47[_0x2529('0x2a')]['includeAll']){_0x3905d2[_0x2529('0x3c')]=[{'all':!![]}];}_0x3905d2=_['merge']({},_0x3905d2,_0x3b4e47[_0x2529('0x39')]);return db['VoiceMailMessage'][_0x2529('0x41')](_0x3905d2)['then'](handleEntityNotFound(_0x99ffb,null))[_0x2529('0x1f')](respondWithResult(_0x99ffb,null))[_0x2529('0x3e')](handleError(_0x99ffb,null));};exports['create']=function(_0x100ad2,_0x480ebf){return db[_0x2529('0x3a')][_0x2529('0x42')](_0x100ad2[_0x2529('0x43')],{})[_0x2529('0x1f')](respondWithResult(_0x480ebf,0xc9))[_0x2529('0x3e')](handleError(_0x480ebf,null));};exports[_0x2529('0x44')]=function(_0x41728f,_0x1a5f03){if(_0x41728f[_0x2529('0x43')]['id']){delete _0x41728f['body']['id'];}return db['VoiceMailMessage'][_0x2529('0x41')]({'where':{'id':_0x41728f[_0x2529('0x45')]['id']}})[_0x2529('0x1f')](handleEntityNotFound(_0x1a5f03,null))[_0x2529('0x1f')](saveUpdates(_0x41728f['body'],null))['then'](respondWithResult(_0x1a5f03,null))[_0x2529('0x3e')](handleError(_0x1a5f03,null));};exports['destroy']=function(_0x2e5bfc,_0x298647){return db[_0x2529('0x3a')][_0x2529('0x41')]({'where':{'id':_0x2e5bfc[_0x2529('0x45')]['id']}})[_0x2529('0x1f')](handleEntityNotFound(_0x298647,null))[_0x2529('0x1f')](removeEntity(_0x298647,null))[_0x2529('0x3e')](handleError(_0x298647,null));};exports['download']=function(_0x5ad307,_0x23d123,_0xeef7cb){return db[_0x2529('0x3a')][_0x2529('0x41')]({'where':{'id':_0x5ad307[_0x2529('0x45')]['id']},'attributes':['id',_0x2529('0x46'),_0x2529('0x47')]})[_0x2529('0x1f')](handleEntityNotFound(_0x23d123,null))[_0x2529('0x1f')](function(_0x3f9b73){if(_0x3f9b73){if(!_0x3f9b73[_0x2529('0x46')]){throw new db['Sequelize']['ValidationError'](_0x2529('0x48'));}var _0x3ac9e2={'Content-Type':'audio/wav','Content-Disposition':_0x2529('0x49')};if(_0x3f9b73[_0x2529('0x47')]){_0x3ac9e2['Content-Disposition']=_0x2529('0x4a')+_0x3f9b73[_0x2529('0x47')]+_0x2529('0x4b');}_0x23d123[_0x2529('0x4c')](_0x3ac9e2);return _0x23d123[_0x2529('0x23')](new Buffer(_0x3f9b73[_0x2529('0x46')]));}})[_0x2529('0x3e')](handleError(_0x23d123,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 841021a..5a7bb84 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 _0x79b8=['dir','util','api','request-promise','path','rimraf','./voiceMailMessage.attributes','define'];(function(_0x5c7a85,_0x41dd19){var _0x35290f=function(_0x26215b){while(--_0x26215b){_0x5c7a85['push'](_0x5c7a85['shift']());}};_0x35290f(++_0x41dd19);}(_0x79b8,0xb1));var _0x879b=function(_0x17b287,_0x4bed1c){_0x17b287=_0x17b287-0x0;var _0x177054=_0x79b8[_0x17b287];return _0x177054;};'use strict';var _=require('lodash');var util=require(_0x879b('0x0'));var logger=require('../../config/logger')(_0x879b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x879b('0x2'));var fs=require('fs');var path=require(_0x879b('0x3'));var rimraf=require(_0x879b('0x4'));var config=require('../../config/environment');var attributes=require(_0x879b('0x5'));module['exports']=function(_0x4cf1dc,_0x15b363){return _0x4cf1dc[_0x879b('0x6')]('VoiceMailMessage',attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0x879b('0x7'),'fields':[_0x879b('0x7')]}],'timestamps':![]});}; \ No newline at end of file +var _0xb060=['bluebird','request-promise','path','rimraf','../../config/environment','./voiceMailMessage.attributes','exports','VoiceMailMessage','voice_voicemail_messages','dir','util','../../config/logger','api'];(function(_0x49b2aa,_0x217ce2){var _0x1dc003=function(_0x555129){while(--_0x555129){_0x49b2aa['push'](_0x49b2aa['shift']());}};_0x1dc003(++_0x217ce2);}(_0xb060,0xda));var _0x0b06=function(_0x5b5dcf,_0xad0570){_0x5b5dcf=_0x5b5dcf-0x0;var _0x470c28=_0xb060[_0x5b5dcf];return _0x470c28;};'use strict';var _=require('lodash');var util=require(_0x0b06('0x0'));var logger=require(_0x0b06('0x1'))(_0x0b06('0x2'));var moment=require('moment');var BPromise=require(_0x0b06('0x3'));var rp=require(_0x0b06('0x4'));var fs=require('fs');var path=require(_0x0b06('0x5'));var rimraf=require(_0x0b06('0x6'));var config=require(_0x0b06('0x7'));var attributes=require(_0x0b06('0x8'));module[_0x0b06('0x9')]=function(_0x82d5cd,_0x739b5e){return _0x82d5cd['define'](_0x0b06('0xa'),attributes,{'tableName':_0x0b06('0xb'),'paranoid':![],'indexes':[{'name':_0x0b06('0xc'),'fields':[_0x0b06('0xc')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index d17e266..74c8aed 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 _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x35b6e7,_0x5246ce){var _0x1e8948=function(_0xa1adcc){while(--_0xa1adcc){_0x35b6e7['push'](_0x35b6e7['shift']());}};_0x1e8948(++_0x5246ce);}(_0xdb28,0x106));var _0x8db2=function(_0xfd62e8,_0x590655){_0xfd62e8=_0xfd62e8-0x0;var _0x4450d3=_0xdb28[_0xfd62e8];return _0x4450d3;};'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});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});} \ No newline at end of file +var _0x66fa=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','VoiceMailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','VoiceMailMessage,\x20%s,\x20%s','message','catch','lodash'];(function(_0x1a8f6d,_0x52823b){var _0x1ea9bb=function(_0xbe24f9){while(--_0xbe24f9){_0x1a8f6d['push'](_0x1a8f6d['shift']());}};_0x1ea9bb(++_0x52823b);}(_0x66fa,0x117));var _0xa66f=function(_0x3c9fc0,_0x1e9b1f){_0x3c9fc0=_0x3c9fc0-0x0;var _0x56e65a=_0x66fa[_0x3c9fc0];return _0x56e65a;};'use strict';var _=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var moment=require('moment');var BPromise=require(_0xa66f('0x2'));var rs=require(_0xa66f('0x3'));var fs=require('fs');var Redis=require(_0xa66f('0x4'));var db=require(_0xa66f('0x5'))['db'];var utils=require(_0xa66f('0x6'));var logger=require(_0xa66f('0x7'))(_0xa66f('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa66f('0x9')][_0xa66f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2f0b78,_0x1d02fc,_0x38b58b){return new BPromise(function(_0x5096bf,_0x39c1ef){return client['request'](_0x2f0b78,_0x38b58b)[_0xa66f('0xb')](function(_0x597c7c){logger[_0xa66f('0xc')]('VoiceMailMessage,\x20%s,\x20%s',_0x1d02fc,'request\x20sent');logger['debug'](_0xa66f('0xd'),_0x1d02fc,_0xa66f('0xe'),JSON['stringify'](_0x597c7c));if(_0x597c7c[_0xa66f('0xf')]){if(_0x597c7c['error'][_0xa66f('0x10')]===0x1f4){logger['error'](_0xa66f('0x11'),_0x1d02fc,_0x597c7c[_0xa66f('0xf')][_0xa66f('0x12')]);return _0x39c1ef(_0x597c7c['error']['message']);}logger[_0xa66f('0xf')]('VoiceMailMessage,\x20%s,\x20%s',_0x1d02fc,_0x597c7c['error']['message']);return _0x5096bf(_0x597c7c[_0xa66f('0xf')][_0xa66f('0x12')]);}else{logger[_0xa66f('0xc')](_0xa66f('0x11'),_0x1d02fc,_0xa66f('0xe'));_0x5096bf(_0x597c7c['result']['message']);}})[_0xa66f('0x13')](function(_0x32d338){logger[_0xa66f('0xf')](_0xa66f('0x11'),_0x1d02fc,_0x32d338);_0x39c1ef(_0x32d338);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 30cf44e..b1549a4 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 _0x22db=['put','delete','destroy','removeSound','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','isAuthenticated','index','/:id','show','get','/:id/sounds','getSounds','post','addSound'];(function(_0x6a427f,_0x338fa5){var _0x18c497=function(_0x3a6dcd){while(--_0x3a6dcd){_0x6a427f['push'](_0x6a427f['shift']());}};_0x18c497(++_0x338fa5);}(_0x22db,0x15e));var _0xb22d=function(_0x4704dc,_0x575a5f){_0x4704dc=_0x4704dc-0x0;var _0x254d81=_0x22db[_0x4704dc];return _0x254d81;};'use strict';var multer=require(_0xb22d('0x0'));var util=require(_0xb22d('0x1'));var path=require(_0xb22d('0x2'));var timeout=require(_0xb22d('0x3'));var express=require('express');var router=express[_0xb22d('0x4')]();var auth=require(_0xb22d('0x5'));var interaction=require(_0xb22d('0x6'));var config=require(_0xb22d('0x7'));var controller=require(_0xb22d('0x8'));router['get']('/',auth[_0xb22d('0x9')](),controller[_0xb22d('0xa')]);router['get'](_0xb22d('0xb'),auth[_0xb22d('0x9')](),controller[_0xb22d('0xc')]);router[_0xb22d('0xd')](_0xb22d('0xe'),auth[_0xb22d('0x9')](),controller[_0xb22d('0xf')]);router[_0xb22d('0x10')]('/',auth[_0xb22d('0x9')](),controller['create']);router[_0xb22d('0x10')](_0xb22d('0xe'),auth[_0xb22d('0x9')](),controller[_0xb22d('0x11')]);router[_0xb22d('0x12')](_0xb22d('0xb'),auth[_0xb22d('0x9')](),controller['update']);router[_0xb22d('0x13')](_0xb22d('0xb'),auth[_0xb22d('0x9')](),controller[_0xb22d('0x14')]);router[_0xb22d('0x13')]('/:id/sounds/:id2',auth[_0xb22d('0x9')](),controller[_0xb22d('0x15')]);module[_0xb22d('0x16')]=router; \ No newline at end of file +var _0x924e=['removeSound','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./voiceMusicOnHold.controller','index','get','/:id','/:id/sounds','isAuthenticated','getSounds','create','post','addSound','put','update','delete','destroy','/:id/sounds/:id2'];(function(_0x55a6d6,_0x164f00){var _0x3c94c6=function(_0x34678b){while(--_0x34678b){_0x55a6d6['push'](_0x55a6d6['shift']());}};_0x3c94c6(++_0x164f00);}(_0x924e,0x121));var _0xe924=function(_0xf2d2fc,_0x3a53d1){_0xf2d2fc=_0xf2d2fc-0x0;var _0x429091=_0x924e[_0xf2d2fc];return _0x429091;};'use strict';var multer=require(_0xe924('0x0'));var util=require(_0xe924('0x1'));var path=require(_0xe924('0x2'));var timeout=require(_0xe924('0x3'));var express=require(_0xe924('0x4'));var router=express[_0xe924('0x5')]();var auth=require(_0xe924('0x6'));var interaction=require(_0xe924('0x7'));var config=require('../../config/environment');var controller=require(_0xe924('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xe924('0x9')]);router[_0xe924('0xa')](_0xe924('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xe924('0xa')](_0xe924('0xc'),auth[_0xe924('0xd')](),controller[_0xe924('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xe924('0xf')]);router[_0xe924('0x10')]('/:id/sounds',auth[_0xe924('0xd')](),controller[_0xe924('0x11')]);router[_0xe924('0x12')](_0xe924('0xb'),auth['isAuthenticated'](),controller[_0xe924('0x13')]);router[_0xe924('0x14')](_0xe924('0xb'),auth['isAuthenticated'](),controller[_0xe924('0x15')]);router[_0xe924('0x14')](_0xe924('0x16'),auth[_0xe924('0xd')](),controller[_0xe924('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 423a44b..942b61a 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 _0x1331=['ENUM','custom','mp3nb','quietmp3','mp3','files','alpha','TIMESTAMP','BOOLEAN','sequelize','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1331,0xae));var _0x1133=function(_0x398633,_0x34906d){_0x398633=_0x398633-0x0;var _0x3a7998=_0x1331[_0x398633];return _0x3a7998;};'use strict';var Sequelize=require(_0x1133('0x0'));module['exports']={'name':{'type':Sequelize[_0x1133('0x1')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize[_0x1133('0x2')](_0x1133('0x3'),'files',_0x1133('0x4'),'quietmp3nb',_0x1133('0x5'),_0x1133('0x6')),'allowNull':!![],'defaultValue':_0x1133('0x7')},'directory':{'type':Sequelize[_0x1133('0x1')],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize[_0x1133('0x1')],'allowNull':!![],'defaultValue':_0x1133('0x8')},'format':{'type':Sequelize[_0x1133('0x1')],'allowNull':!![]},'stamp':{'type':_0x1133('0x9')},'defaultEntry':{'type':Sequelize[_0x1133('0xa')],'defaultValue':0x0}}; \ No newline at end of file +var _0x3f04=['alpha','BOOLEAN','sequelize','exports','name','ENUM','custom','files','STRING'];(function(_0x1ca413,_0x31295b){var _0x51050c=function(_0x3167f9){while(--_0x3167f9){_0x1ca413['push'](_0x1ca413['shift']());}};_0x51050c(++_0x31295b);}(_0x3f04,0x1a9));var _0x43f0=function(_0x4851bf,_0x2713ea){_0x4851bf=_0x4851bf-0x0;var _0x37a58a=_0x3f04[_0x4851bf];return _0x37a58a;};'use strict';var Sequelize=require(_0x43f0('0x0'));module[_0x43f0('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x43f0('0x2')},'mode':{'type':Sequelize[_0x43f0('0x3')](_0x43f0('0x4'),'files','mp3nb','quietmp3nb','quietmp3','mp3'),'allowNull':!![],'defaultValue':_0x43f0('0x5')},'directory':{'type':Sequelize[_0x43f0('0x6')],'allowNull':!![]},'application':{'type':Sequelize[_0x43f0('0x6')],'allowNull':!![]},'digit':{'type':Sequelize[_0x43f0('0x6')],'allowNull':!![]},'sort':{'type':Sequelize[_0x43f0('0x6')],'allowNull':!![],'defaultValue':_0x43f0('0x7')},'format':{'type':Sequelize[_0x43f0('0x6')],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize[_0x43f0('0x8')],'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 5f9f405..4db6de5 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 _0x46bc=['query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','options','include','findAll','rows','show','params','length','includeAll','find','catch','body','create','sequelize','mode','files','directory','root','server/files/moh','mkdirSync','0777','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','transaction','readdirSync','forEach','unlinkSync','join','rmdirSync','Sequelize','ValidationError','message','addSound','findOne','save_name','createdAt','server/files/sounds/converted','%s.%s','basename','extname','converted_format','format','symlinkSync','removeSound','id2','Sound','filter','getSounds','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','sendStatus','status','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','MusicOnHolds','UserProfileResource','end','error','stack','name','send','index','VoiceMusicOnHold','rawAttributes','fieldName','key','model','map','keys','filters','intersection'];(function(_0x26c9d2,_0x1186f5){var _0x305623=function(_0x2c64cc){while(--_0x2c64cc){_0x26c9d2['push'](_0x26c9d2['shift']());}};_0x305623(++_0x1186f5);}(_0x46bc,0x196));var _0xc46b=function(_0x4702ee,_0xaf6a45){_0x4702ee=_0x4702ee-0x0;var _0x62ca7d=_0x46bc[_0x4702ee];return _0x62ca7d;};'use strict';var pdf=require(_0xc46b('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xc46b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc46b('0x2'));var rp=require(_0xc46b('0x3'));var moment=require(_0xc46b('0x4'));var BPromise=require(_0xc46b('0x5'));var Mustache=require('mustache');var util=require(_0xc46b('0x6'));var path=require('path');var sox=require(_0xc46b('0x7'));var csv=require(_0xc46b('0x8'));var ejs=require(_0xc46b('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xc46b('0xa'));var jsforce=require(_0xc46b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xc46b('0x8'));var querystring=require(_0xc46b('0xc'));var Papa=require(_0xc46b('0xd'));var Redis=require('ioredis');var authService=require(_0xc46b('0xe'));var qs=require(_0xc46b('0xf'));var as=require(_0xc46b('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc46b('0x11'))(_0xc46b('0x12'));var utils=require('../../config/utils');var config=require(_0xc46b('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x7cdf80,_0xa039b1){_0xa039b1=_0xa039b1||0xcc;return function(_0xcf66ce){if(_0xcf66ce){return _0x7cdf80[_0xc46b('0x14')](_0xa039b1);}return _0x7cdf80['status'](_0xa039b1)['end']();};}function respondWithResult(_0x3a008d,_0x25a01d){_0x25a01d=_0x25a01d||0xc8;return function(_0x68aafb){if(_0x68aafb){return _0x3a008d[_0xc46b('0x15')](_0x25a01d)['json'](_0x68aafb);}};}function respondWithFilteredResult(_0x547350,_0x6ffa80){return function(_0x31e2b5){if(_0x31e2b5){var _0xa5cebb=_0x31e2b5[_0xc46b('0x16')],_0x1e223a=_0x6ffa80[_0xc46b('0x17')],_0xd4b513=_0x6ffa80[_0xc46b('0x17')]+_0x6ffa80[_0xc46b('0x18')],_0xe22a36;if(_0xd4b513>=_0xa5cebb){_0xd4b513=_0xa5cebb;_0xe22a36=0xc8;}else{_0xe22a36=0xce;}_0x547350[_0xc46b('0x15')](_0xe22a36);return _0x547350[_0xc46b('0x19')](_0xc46b('0x1a'),_0x1e223a+'-'+_0xd4b513+'/'+_0xa5cebb)['json'](_0x31e2b5);}return null;};}function patchUpdates(_0x1efe17){return function(_0x1f01db){try{jsonpatch[_0xc46b('0x1b')](_0x1f01db,_0x1efe17,!![]);}catch(_0x4e61b6){return BPromise[_0xc46b('0x1c')](_0x4e61b6);}return _0x1f01db[_0xc46b('0x1d')]();};}function saveUpdates(_0x52f2c4,_0x34a32a){return function(_0x1aba5f){if(_0x1aba5f){return _0x1aba5f[_0xc46b('0x1e')](_0x52f2c4)[_0xc46b('0x1f')](function(_0x4bfd16){return _0x4bfd16;});}return null;};}function removeEntity(_0x4cd1f9,_0xb0f04c){return function(_0x5cf486){if(_0x5cf486){return _0x5cf486[_0xc46b('0x20')]()[_0xc46b('0x1f')](function(){var _0x30c356=_0x5cf486['get']({'plain':!![]});var _0x4aa401=_0xc46b('0x21');return db[_0xc46b('0x22')][_0xc46b('0x20')]({'where':{'type':_0x4aa401,'resourceId':_0x30c356['id']}})[_0xc46b('0x1f')](function(){return _0x5cf486;});})['then'](function(){_0x4cd1f9['status'](0xcc)[_0xc46b('0x23')]();});}};}function handleEntityNotFound(_0x12eea3,_0x43cb8f){return function(_0x2d0b36){if(!_0x2d0b36){_0x12eea3['sendStatus'](0x194);}return _0x2d0b36;};}function handleError(_0x2610c9,_0x56defe){_0x56defe=_0x56defe||0x1f4;return function(_0x37f0ea){logger[_0xc46b('0x24')](_0x37f0ea[_0xc46b('0x25')]);if(_0x37f0ea[_0xc46b('0x26')]){delete _0x37f0ea[_0xc46b('0x26')];}_0x2610c9[_0xc46b('0x15')](_0x56defe)[_0xc46b('0x27')](_0x37f0ea);};}exports[_0xc46b('0x28')]=function(_0x38371d,_0x525fc7){var _0x16b251={},_0x366639={},_0x66c65f={'count':0x0,'rows':[]};var _0x5a121e=_['map'](db[_0xc46b('0x29')][_0xc46b('0x2a')],function(_0x2f35e0){return{'name':_0x2f35e0[_0xc46b('0x2b')],'type':_0x2f35e0['type'][_0xc46b('0x2c')]};});_0x366639[_0xc46b('0x2d')]=_[_0xc46b('0x2e')](_0x5a121e,_0xc46b('0x26'));_0x366639['query']=_[_0xc46b('0x2f')](_0x38371d['query']);_0x366639[_0xc46b('0x30')]=_[_0xc46b('0x31')](_0x366639[_0xc46b('0x2d')],_0x366639[_0xc46b('0x32')]);_0x16b251[_0xc46b('0x33')]=_['intersection'](_0x366639[_0xc46b('0x2d')],qs[_0xc46b('0x34')](_0x38371d['query'][_0xc46b('0x34')]));_0x16b251[_0xc46b('0x33')]=_0x16b251[_0xc46b('0x33')]['length']?_0x16b251[_0xc46b('0x33')]:_0x366639[_0xc46b('0x2d')];if(!_0x38371d[_0xc46b('0x32')][_0xc46b('0x35')](_0xc46b('0x36'))){_0x16b251[_0xc46b('0x18')]=qs[_0xc46b('0x18')](_0x38371d[_0xc46b('0x32')]['limit']);_0x16b251[_0xc46b('0x17')]=qs[_0xc46b('0x17')](_0x38371d[_0xc46b('0x32')]['offset']);}_0x16b251[_0xc46b('0x37')]=qs[_0xc46b('0x38')](_0x38371d[_0xc46b('0x32')][_0xc46b('0x38')]);_0x16b251[_0xc46b('0x39')]=qs[_0xc46b('0x30')](_[_0xc46b('0x3a')](_0x38371d['query'],_0x366639[_0xc46b('0x30')]));if(_0x38371d['query']['filter']){_0x16b251['where']=_[_0xc46b('0x3b')](_0x16b251[_0xc46b('0x39')],{'$or':_[_0xc46b('0x2e')](_0x5a121e,function(_0x5c4783){if(_0x5c4783[_0xc46b('0x3c')]!==_0xc46b('0x3d')){var _0x4c50b5={};_0x4c50b5[_0x5c4783[_0xc46b('0x26')]]={'$like':'%'+_0x38371d[_0xc46b('0x32')]['filter']+'%'};return _0x4c50b5;}})});}_0x16b251=_[_0xc46b('0x3b')]({},_0x16b251,_0x38371d[_0xc46b('0x3e')]);var _0x319cf8={'where':_0x16b251['where']};return db[_0xc46b('0x29')][_0xc46b('0x16')](_0x319cf8)[_0xc46b('0x1f')](function(_0x870448){_0x66c65f[_0xc46b('0x16')]=_0x870448;if(_0x38371d[_0xc46b('0x32')]['includeAll']){_0x16b251[_0xc46b('0x3f')]=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0xc46b('0x40')](_0x16b251);})['then'](function(_0x411a44){_0x66c65f[_0xc46b('0x41')]=_0x411a44;return _0x66c65f;})['then'](respondWithFilteredResult(_0x525fc7,_0x16b251))['catch'](handleError(_0x525fc7,null));};exports[_0xc46b('0x42')]=function(_0x2e1b4b,_0x2e0082){var _0x131997={'raw':![],'where':{'id':_0x2e1b4b[_0xc46b('0x43')]['id']}},_0x875947={};_0x875947['model']=_[_0xc46b('0x2f')](db['VoiceMusicOnHold'][_0xc46b('0x2a')]);_0x875947[_0xc46b('0x32')]=_[_0xc46b('0x2f')](_0x2e1b4b['query']);_0x875947['filters']=_['intersection'](_0x875947['model'],_0x875947['query']);_0x131997[_0xc46b('0x33')]=_[_0xc46b('0x31')](_0x875947[_0xc46b('0x2d')],qs[_0xc46b('0x34')](_0x2e1b4b[_0xc46b('0x32')][_0xc46b('0x34')]));_0x131997['attributes']=_0x131997[_0xc46b('0x33')][_0xc46b('0x44')]?_0x131997[_0xc46b('0x33')]:_0x875947[_0xc46b('0x2d')];if(_0x2e1b4b['query'][_0xc46b('0x45')]){_0x131997['include']=[{'all':!![]}];}_0x131997=_[_0xc46b('0x3b')]({},_0x131997,_0x2e1b4b[_0xc46b('0x3e')]);return db[_0xc46b('0x29')][_0xc46b('0x46')](_0x131997)['then'](handleEntityNotFound(_0x2e0082,null))[_0xc46b('0x1f')](respondWithResult(_0x2e0082,null))[_0xc46b('0x47')](handleError(_0x2e0082,null));};exports[_0xc46b('0x1e')]=function(_0x2a82dc,_0x17e83a){if(_0x2a82dc[_0xc46b('0x48')]['id']){delete _0x2a82dc[_0xc46b('0x48')]['id'];}return db[_0xc46b('0x29')][_0xc46b('0x46')]({'where':{'id':_0x2a82dc['params']['id']}})['then'](handleEntityNotFound(_0x17e83a,null))[_0xc46b('0x1f')](saveUpdates(_0x2a82dc[_0xc46b('0x48')],null))[_0xc46b('0x1f')](respondWithResult(_0x17e83a,null))[_0xc46b('0x47')](handleError(_0x17e83a,null));};exports[_0xc46b('0x49')]=function(_0xb1c548,_0x3b9f69,_0x47ac44){return db[_0xc46b('0x4a')]['transaction'](function(_0x550f17){if(_0xb1c548[_0xc46b('0x48')][_0xc46b('0x4b')]===_0xc46b('0x4c')){_0xb1c548[_0xc46b('0x48')][_0xc46b('0x4d')]=path['join'](config[_0xc46b('0x4e')],_0xc46b('0x4f'),_0xb1c548[_0xc46b('0x48')][_0xc46b('0x26')]);}return db['VoiceMusicOnHold']['create'](_0xb1c548['body'],{'transaction':_0x550f17})[_0xc46b('0x1f')](function(_0x57c547){if(_0xb1c548[_0xc46b('0x48')][_0xc46b('0x4b')]===_0xc46b('0x4c')){fs[_0xc46b('0x50')](_0x57c547['directory'],parseInt(_0xc46b('0x51'),0x8));}var _0x103a3f=_0xb1c548[_0xc46b('0x52')][_0xc46b('0x53')]({'plain':!![]});if(!_0x103a3f)throw new Error(_0xc46b('0x54'));if(_0x103a3f['role']===_0xc46b('0x52')){var _0x5bcef4=_0x57c547[_0xc46b('0x53')]({'plain':!![]});return db[_0xc46b('0x55')][_0xc46b('0x46')]({'where':{'name':_0xc46b('0x21'),'userProfileId':_0x103a3f[_0xc46b('0x56')]},'raw':!![]})[_0xc46b('0x1f')](function(_0x2d90df){if(_0x2d90df&&_0x2d90df[_0xc46b('0x57')]===0x0){return db['UserProfileResource']['create']({'name':_0x5bcef4[_0xc46b('0x26')],'resourceId':_0x5bcef4['id'],'type':_0x2d90df[_0xc46b('0x26')],'sectionId':_0x2d90df['id']},{})[_0xc46b('0x1f')](function(){return _0x57c547;});}else{return _0x57c547;}})[_0xc46b('0x47')](function(_0x2e18bc){logger[_0xc46b('0x24')](_0xc46b('0x58'),_0x2e18bc);});}return _0x57c547;});})[_0xc46b('0x1f')](respondWithResult(_0x3b9f69,0xc9))[_0xc46b('0x47')](handleError(_0x3b9f69,null));};exports[_0xc46b('0x20')]=function(_0x437f76,_0x5bded4,_0x4270d8){var _0xe94455;return db[_0xc46b('0x29')][_0xc46b('0x46')]({'where':{'id':_0x437f76[_0xc46b('0x43')]['id']}})[_0xc46b('0x1f')](function(_0xe2e902){if(_0xe2e902){return db['sequelize'][_0xc46b('0x59')](function(_0x31ed9b){return _0xe2e902[_0xc46b('0x20')]({'transaction':_0x31ed9b,'raw':!![]})[_0xc46b('0x1f')](function(_0x27ac95){if(_0x27ac95[_0xc46b('0x4d')]){fs[_0xc46b('0x5a')](_0x27ac95[_0xc46b('0x4d')])[_0xc46b('0x5b')](function(_0x3725f1){fs[_0xc46b('0x5c')](path[_0xc46b('0x5d')](_0x27ac95['directory'],_0x3725f1));});fs[_0xc46b('0x5e')](_0x27ac95[_0xc46b('0x4d')]);}return _0x27ac95;});})[_0xc46b('0x47')](function(_0x578133){throw new db[(_0xc46b('0x5f'))][(_0xc46b('0x60'))](_0x578133[_0xc46b('0x61')]);});}})['then'](handleEntityNotFound(_0x5bded4,null))['then'](removeEntity(_0x5bded4,null))[_0xc46b('0x47')](handleError(_0x5bded4,null));};exports['addSound']=function(_0x45598c,_0x3ad42b,_0x45ca47){return db['sequelize'][_0xc46b('0x59')](function(_0x587920){var _0x500000;return db[_0xc46b('0x29')][_0xc46b('0x46')]({'where':{'id':_0x45598c['params']['id']}})[_0xc46b('0x1f')](function(_0x22f449){if(_0x22f449){_0x500000=_0x22f449;return _0x22f449[_0xc46b('0x62')](_0x45598c[_0xc46b('0x48')]['id'],{'transaction':_0x587920});}})['then'](function(_0x4659c0){if(_0x4659c0){return db['Sound'][_0xc46b('0x63')]({'where':{'id':_0x45598c['body']['id']},'attributes':['id',_0xc46b('0x26'),_0xc46b('0x64'),'converted_format',_0xc46b('0x65')],'raw':!![]});}})[_0xc46b('0x1f')](function(_0x5e150e){if(_0x5e150e){var _0x4740b4=path[_0xc46b('0x5d')](config[_0xc46b('0x4e')],_0xc46b('0x66'),util['format'](_0xc46b('0x67'),path[_0xc46b('0x68')](_0x5e150e['save_name'],path[_0xc46b('0x69')](_0x5e150e['save_name'])),_0x5e150e[_0xc46b('0x6a')]));var _0x138337=path[_0xc46b('0x5d')](config[_0xc46b('0x4e')],'server/files/moh',_0x500000['name'],util[_0xc46b('0x6b')](_0xc46b('0x67'),_0x5e150e[_0xc46b('0x26')],_0x5e150e['converted_format']));fs[_0xc46b('0x6c')](_0x4740b4,_0x138337);return _0x5e150e;}})['catch'](function(_0x54fb5e){throw new db[(_0xc46b('0x5f'))][(_0xc46b('0x60'))](_0x54fb5e[_0xc46b('0x61')]);});})[_0xc46b('0x1f')](handleEntityNotFound(_0x3ad42b,null))[_0xc46b('0x1f')](respondWithResult(_0x3ad42b,0xc9))[_0xc46b('0x47')](handleError(_0x3ad42b,null));};exports[_0xc46b('0x6d')]=function(_0x317300,_0x5d9a1a,_0x8aa7b9){return db['sequelize'][_0xc46b('0x59')](function(_0x2a5ea3){var _0xd6d41b;return db[_0xc46b('0x29')][_0xc46b('0x63')]({'where':{'id':_0x317300[_0xc46b('0x43')]['id']}})[_0xc46b('0x1f')](handleEntityNotFound(_0x5d9a1a,null))['then'](function(_0x589703){if(_0x589703){_0xd6d41b=_0x589703;return _0x589703[_0xc46b('0x6d')](_0x317300[_0xc46b('0x43')][_0xc46b('0x6e')]);}})['then'](function(_0x467e1c){if(_0x467e1c){return db[_0xc46b('0x6f')][_0xc46b('0x63')]({'where':{'id':_0x317300[_0xc46b('0x43')][_0xc46b('0x6e')]},'attributes':['id','name','save_name',_0xc46b('0x6a'),_0xc46b('0x65')],'raw':!![]});}})[_0xc46b('0x1f')](function(_0x39b5eb){if(_0x39b5eb){fs[_0xc46b('0x5c')](path[_0xc46b('0x5d')](_0xd6d41b[_0xc46b('0x4d')],util['format'](_0xc46b('0x67'),_0x39b5eb[_0xc46b('0x26')],_0x39b5eb[_0xc46b('0x6a')])));return _0x39b5eb;}})[_0xc46b('0x47')](function(_0x1462f7){throw new db['Sequelize'][(_0xc46b('0x60'))](_0x1462f7['message']);});})[_0xc46b('0x1f')](handleEntityNotFound(_0x5d9a1a,null))['then'](respondWithStatusCode(_0x5d9a1a,0xcc))['catch'](handleError(_0x5d9a1a,null));};exports['getSounds']=function(_0x153a32,_0x29621e,_0x36fb54){var _0x585e9c={};var _0x2ce21d={};var _0x458548;var _0x588fda;return db[_0xc46b('0x29')]['findOne']({'where':{'id':_0x153a32[_0xc46b('0x43')]['id']}})[_0xc46b('0x1f')](handleEntityNotFound(_0x29621e,null))[_0xc46b('0x1f')](function(_0x11066a){if(_0x11066a){_0x458548=_0x11066a;_0x2ce21d[_0xc46b('0x2d')]=_[_0xc46b('0x2f')](db['Sound']['rawAttributes']);_0x2ce21d[_0xc46b('0x32')]=_[_0xc46b('0x2f')](_0x153a32[_0xc46b('0x32')]);_0x2ce21d[_0xc46b('0x30')]=_[_0xc46b('0x31')](_0x2ce21d[_0xc46b('0x2d')],_0x2ce21d[_0xc46b('0x32')]);_0x585e9c[_0xc46b('0x33')]=_[_0xc46b('0x31')](_0x2ce21d[_0xc46b('0x2d')],qs['fields'](_0x153a32['query'][_0xc46b('0x34')]));_0x585e9c[_0xc46b('0x33')]=_0x585e9c['attributes'][_0xc46b('0x44')]?_0x585e9c[_0xc46b('0x33')]:_0x2ce21d[_0xc46b('0x2d')];_0x585e9c[_0xc46b('0x37')]=qs[_0xc46b('0x38')](_0x153a32['query'][_0xc46b('0x38')]);_0x585e9c['where']=qs[_0xc46b('0x30')](_['pick'](_0x153a32[_0xc46b('0x32')],_0x2ce21d[_0xc46b('0x30')]));if(_0x153a32[_0xc46b('0x32')][_0xc46b('0x70')]){_0x585e9c[_0xc46b('0x39')]=_['merge'](_0x585e9c[_0xc46b('0x39')],{'$or':_[_0xc46b('0x2e')](_0x585e9c[_0xc46b('0x33')],function(_0x3043b0){var _0x189b9f={};_0x189b9f[_0x3043b0]={'$like':'%'+_0x153a32[_0xc46b('0x32')][_0xc46b('0x70')]+'%'};return _0x189b9f;})});}_0x585e9c=_[_0xc46b('0x3b')]({},_0x585e9c,_0x153a32[_0xc46b('0x3e')]);return _0x458548[_0xc46b('0x71')](_0x585e9c);}})['then'](function(_0x39bed6){if(_0x39bed6){_0x588fda=_0x39bed6['length'];if(!_0x153a32[_0xc46b('0x32')][_0xc46b('0x35')](_0xc46b('0x36'))){_0x585e9c[_0xc46b('0x18')]=qs[_0xc46b('0x18')](_0x153a32[_0xc46b('0x32')][_0xc46b('0x18')]);_0x585e9c[_0xc46b('0x17')]=qs[_0xc46b('0x17')](_0x153a32['query'][_0xc46b('0x17')]);}return _0x458548[_0xc46b('0x71')](_0x585e9c);}})[_0xc46b('0x1f')](function(_0x14f50a){if(_0x14f50a){return _0x14f50a?{'count':_0x588fda,'rows':_0x14f50a}:null;}})[_0xc46b('0x1f')](respondWithResult(_0x29621e,null))[_0xc46b('0x47')](handleError(_0x29621e,null));}; \ No newline at end of file +var _0xe434=['../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','apply','reject','save','destroy','get','then','error','stack','name','send','index','map','VoiceMusicOnHold','rawAttributes','fieldName','type','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','update','body','find','create','sequelize','transaction','directory','join','root','server/files/moh','mode','files','mkdirSync','0777','role','MusicOnHolds','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','Sequelize','ValidationError','message','addSound','Sound','save_name','converted_format','format','%s.%s','extname','findOne','removeSound','id2','createdAt','unlinkSync','getSounds','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs'];(function(_0x143d70,_0x25e5e3){var _0x26f063=function(_0x52ba29){while(--_0x52ba29){_0x143d70['push'](_0x143d70['shift']());}};_0x26f063(++_0x25e5e3);}(_0xe434,0x132));var _0x4e43=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xe434[_0xc6be3a];return _0x56a310;};'use strict';var pdf=require(_0x4e43('0x0'));var emlformat=require(_0x4e43('0x1'));var rimraf=require(_0x4e43('0x2'));var zipdir=require(_0x4e43('0x3'));var jsonpatch=require(_0x4e43('0x4'));var rp=require('request-promise');var moment=require(_0x4e43('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4e43('0x6'));var util=require(_0x4e43('0x7'));var path=require(_0x4e43('0x8'));var sox=require(_0x4e43('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x4e43('0xa'));var crypto=require(_0x4e43('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x4e43('0xc'));var toCsv=require(_0x4e43('0xd'));var querystring=require(_0x4e43('0xe'));var Papa=require(_0x4e43('0xf'));var Redis=require('ioredis');var authService=require(_0x4e43('0x10'));var qs=require(_0x4e43('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4e43('0x12'));var logger=require('../../config/logger')(_0x4e43('0x13'));var utils=require(_0x4e43('0x14'));var config=require(_0x4e43('0x15'));var db=require(_0x4e43('0x16'))['db'];function respondWithStatusCode(_0xfacf0c,_0xa694bf){_0xa694bf=_0xa694bf||0xcc;return function(_0x19c530){if(_0x19c530){return _0xfacf0c[_0x4e43('0x17')](_0xa694bf);}return _0xfacf0c[_0x4e43('0x18')](_0xa694bf)['end']();};}function respondWithResult(_0x36d011,_0x1791a4){_0x1791a4=_0x1791a4||0xc8;return function(_0x40f4f2){if(_0x40f4f2){return _0x36d011['status'](_0x1791a4)[_0x4e43('0x19')](_0x40f4f2);}};}function respondWithFilteredResult(_0x226165,_0x43fd0c){return function(_0x287dc3){if(_0x287dc3){var _0x6057b9=_0x287dc3[_0x4e43('0x1a')],_0x5f526c=_0x43fd0c[_0x4e43('0x1b')],_0x2ac1e3=_0x43fd0c[_0x4e43('0x1b')]+_0x43fd0c[_0x4e43('0x1c')],_0x1de93c;if(_0x2ac1e3>=_0x6057b9){_0x2ac1e3=_0x6057b9;_0x1de93c=0xc8;}else{_0x1de93c=0xce;}_0x226165[_0x4e43('0x18')](_0x1de93c);return _0x226165[_0x4e43('0x1d')]('Content-Range',_0x5f526c+'-'+_0x2ac1e3+'/'+_0x6057b9)[_0x4e43('0x19')](_0x287dc3);}return null;};}function patchUpdates(_0x2e3d28){return function(_0x502645){try{jsonpatch[_0x4e43('0x1e')](_0x502645,_0x2e3d28,!![]);}catch(_0x7a8655){return BPromise[_0x4e43('0x1f')](_0x7a8655);}return _0x502645[_0x4e43('0x20')]();};}function saveUpdates(_0x17d9bf,_0x123334){return function(_0x2a1d97){if(_0x2a1d97){return _0x2a1d97['update'](_0x17d9bf)['then'](function(_0x816b23){return _0x816b23;});}return null;};}function removeEntity(_0x40eefa,_0x5cff3f){return function(_0x452a81){if(_0x452a81){return _0x452a81[_0x4e43('0x21')]()['then'](function(){var _0xe6ac96=_0x452a81[_0x4e43('0x22')]({'plain':!![]});var _0x42f0cd='MusicOnHolds';return db['UserProfileResource']['destroy']({'where':{'type':_0x42f0cd,'resourceId':_0xe6ac96['id']}})['then'](function(){return _0x452a81;});})[_0x4e43('0x23')](function(){_0x40eefa['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4358ec,_0x385d7c){return function(_0x3a5766){if(!_0x3a5766){_0x4358ec[_0x4e43('0x17')](0x194);}return _0x3a5766;};}function handleError(_0x2f0528,_0x56f6c8){_0x56f6c8=_0x56f6c8||0x1f4;return function(_0x30276d){logger[_0x4e43('0x24')](_0x30276d[_0x4e43('0x25')]);if(_0x30276d[_0x4e43('0x26')]){delete _0x30276d[_0x4e43('0x26')];}_0x2f0528[_0x4e43('0x18')](_0x56f6c8)[_0x4e43('0x27')](_0x30276d);};}exports[_0x4e43('0x28')]=function(_0x3c3809,_0x5a0615){var _0x34211a={},_0x37a0b9={},_0x2cfc2e={'count':0x0,'rows':[]};var _0x1fb201=_[_0x4e43('0x29')](db[_0x4e43('0x2a')][_0x4e43('0x2b')],function(_0x3739ba){return{'name':_0x3739ba[_0x4e43('0x2c')],'type':_0x3739ba[_0x4e43('0x2d')][_0x4e43('0x2e')]};});_0x37a0b9['model']=_[_0x4e43('0x29')](_0x1fb201,_0x4e43('0x26'));_0x37a0b9[_0x4e43('0x2f')]=_[_0x4e43('0x30')](_0x3c3809['query']);_0x37a0b9['filters']=_[_0x4e43('0x31')](_0x37a0b9[_0x4e43('0x32')],_0x37a0b9['query']);_0x34211a['attributes']=_[_0x4e43('0x31')](_0x37a0b9[_0x4e43('0x32')],qs[_0x4e43('0x33')](_0x3c3809[_0x4e43('0x2f')][_0x4e43('0x33')]));_0x34211a['attributes']=_0x34211a[_0x4e43('0x34')][_0x4e43('0x35')]?_0x34211a['attributes']:_0x37a0b9[_0x4e43('0x32')];if(!_0x3c3809['query'][_0x4e43('0x36')](_0x4e43('0x37'))){_0x34211a[_0x4e43('0x1c')]=qs[_0x4e43('0x1c')](_0x3c3809[_0x4e43('0x2f')]['limit']);_0x34211a[_0x4e43('0x1b')]=qs[_0x4e43('0x1b')](_0x3c3809[_0x4e43('0x2f')][_0x4e43('0x1b')]);}_0x34211a[_0x4e43('0x38')]=qs[_0x4e43('0x39')](_0x3c3809['query'][_0x4e43('0x39')]);_0x34211a[_0x4e43('0x3a')]=qs[_0x4e43('0x3b')](_[_0x4e43('0x3c')](_0x3c3809[_0x4e43('0x2f')],_0x37a0b9[_0x4e43('0x3b')]));if(_0x3c3809[_0x4e43('0x2f')]['filter']){_0x34211a[_0x4e43('0x3a')]=_[_0x4e43('0x3d')](_0x34211a[_0x4e43('0x3a')],{'$or':_[_0x4e43('0x29')](_0x1fb201,function(_0xe40f16){if(_0xe40f16[_0x4e43('0x2d')]!==_0x4e43('0x3e')){var _0x51f2d3={};_0x51f2d3[_0xe40f16['name']]={'$like':'%'+_0x3c3809[_0x4e43('0x2f')][_0x4e43('0x3f')]+'%'};return _0x51f2d3;}})});}_0x34211a=_['merge']({},_0x34211a,_0x3c3809[_0x4e43('0x40')]);var _0x2d6f53={'where':_0x34211a['where']};return db[_0x4e43('0x2a')][_0x4e43('0x1a')](_0x2d6f53)[_0x4e43('0x23')](function(_0x387805){_0x2cfc2e[_0x4e43('0x1a')]=_0x387805;if(_0x3c3809[_0x4e43('0x2f')][_0x4e43('0x41')]){_0x34211a[_0x4e43('0x42')]=[{'all':!![]}];}return db[_0x4e43('0x2a')][_0x4e43('0x43')](_0x34211a);})[_0x4e43('0x23')](function(_0x55affa){_0x2cfc2e['rows']=_0x55affa;return _0x2cfc2e;})[_0x4e43('0x23')](respondWithFilteredResult(_0x5a0615,_0x34211a))[_0x4e43('0x44')](handleError(_0x5a0615,null));};exports[_0x4e43('0x45')]=function(_0x350098,_0x4f5c81){var _0x32abd1={'raw':![],'where':{'id':_0x350098[_0x4e43('0x46')]['id']}},_0x36da2e={};_0x36da2e['model']=_[_0x4e43('0x30')](db['VoiceMusicOnHold']['rawAttributes']);_0x36da2e['query']=_[_0x4e43('0x30')](_0x350098[_0x4e43('0x2f')]);_0x36da2e['filters']=_['intersection'](_0x36da2e[_0x4e43('0x32')],_0x36da2e[_0x4e43('0x2f')]);_0x32abd1[_0x4e43('0x34')]=_['intersection'](_0x36da2e[_0x4e43('0x32')],qs[_0x4e43('0x33')](_0x350098[_0x4e43('0x2f')][_0x4e43('0x33')]));_0x32abd1['attributes']=_0x32abd1[_0x4e43('0x34')][_0x4e43('0x35')]?_0x32abd1[_0x4e43('0x34')]:_0x36da2e['model'];if(_0x350098[_0x4e43('0x2f')][_0x4e43('0x41')]){_0x32abd1[_0x4e43('0x42')]=[{'all':!![]}];}_0x32abd1=_[_0x4e43('0x3d')]({},_0x32abd1,_0x350098[_0x4e43('0x40')]);return db['VoiceMusicOnHold']['find'](_0x32abd1)['then'](handleEntityNotFound(_0x4f5c81,null))['then'](respondWithResult(_0x4f5c81,null))[_0x4e43('0x44')](handleError(_0x4f5c81,null));};exports[_0x4e43('0x47')]=function(_0x4d2c4a,_0x3be07d){if(_0x4d2c4a[_0x4e43('0x48')]['id']){delete _0x4d2c4a[_0x4e43('0x48')]['id'];}return db[_0x4e43('0x2a')][_0x4e43('0x49')]({'where':{'id':_0x4d2c4a[_0x4e43('0x46')]['id']}})[_0x4e43('0x23')](handleEntityNotFound(_0x3be07d,null))[_0x4e43('0x23')](saveUpdates(_0x4d2c4a['body'],null))[_0x4e43('0x23')](respondWithResult(_0x3be07d,null))[_0x4e43('0x44')](handleError(_0x3be07d,null));};exports[_0x4e43('0x4a')]=function(_0x61ff12,_0x5e50b0,_0x354d61){return db[_0x4e43('0x4b')][_0x4e43('0x4c')](function(_0x22b96e){if(_0x61ff12[_0x4e43('0x48')]['mode']==='files'){_0x61ff12[_0x4e43('0x48')][_0x4e43('0x4d')]=path[_0x4e43('0x4e')](config[_0x4e43('0x4f')],_0x4e43('0x50'),_0x61ff12[_0x4e43('0x48')]['name']);}return db[_0x4e43('0x2a')][_0x4e43('0x4a')](_0x61ff12[_0x4e43('0x48')],{'transaction':_0x22b96e})[_0x4e43('0x23')](function(_0x1eadef){if(_0x61ff12[_0x4e43('0x48')][_0x4e43('0x51')]===_0x4e43('0x52')){fs[_0x4e43('0x53')](_0x1eadef[_0x4e43('0x4d')],parseInt(_0x4e43('0x54'),0x8));}var _0x6380dc=_0x61ff12['user'][_0x4e43('0x22')]({'plain':!![]});if(!_0x6380dc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x6380dc[_0x4e43('0x55')]==='user'){var _0x4bbaeb=_0x1eadef[_0x4e43('0x22')]({'plain':!![]});return db['UserProfileSection'][_0x4e43('0x49')]({'where':{'name':_0x4e43('0x56'),'userProfileId':_0x6380dc['userProfileId']},'raw':!![]})['then'](function(_0x30b77d){if(_0x30b77d&&_0x30b77d[_0x4e43('0x57')]===0x0){return db[_0x4e43('0x58')][_0x4e43('0x4a')]({'name':_0x4bbaeb[_0x4e43('0x26')],'resourceId':_0x4bbaeb['id'],'type':_0x30b77d[_0x4e43('0x26')],'sectionId':_0x30b77d['id']},{})[_0x4e43('0x23')](function(){return _0x1eadef;});}else{return _0x1eadef;}})[_0x4e43('0x44')](function(_0x5d5c86){logger[_0x4e43('0x24')](_0x4e43('0x59'),_0x5d5c86);});}return _0x1eadef;});})[_0x4e43('0x23')](respondWithResult(_0x5e50b0,0xc9))[_0x4e43('0x44')](handleError(_0x5e50b0,null));};exports[_0x4e43('0x21')]=function(_0x12e033,_0x2be07c,_0x3cf22c){var _0x155aa9;return db[_0x4e43('0x2a')][_0x4e43('0x49')]({'where':{'id':_0x12e033['params']['id']}})[_0x4e43('0x23')](function(_0x3ae124){if(_0x3ae124){return db[_0x4e43('0x4b')][_0x4e43('0x4c')](function(_0x7794e3){return _0x3ae124['destroy']({'transaction':_0x7794e3,'raw':!![]})[_0x4e43('0x23')](function(_0x5df91e){if(_0x5df91e[_0x4e43('0x4d')]){fs[_0x4e43('0x5a')](_0x5df91e[_0x4e43('0x4d')])[_0x4e43('0x5b')](function(_0x465f4e){fs['unlinkSync'](path[_0x4e43('0x4e')](_0x5df91e[_0x4e43('0x4d')],_0x465f4e));});fs['rmdirSync'](_0x5df91e[_0x4e43('0x4d')]);}return _0x5df91e;});})['catch'](function(_0x384f46){throw new db[(_0x4e43('0x5c'))][(_0x4e43('0x5d'))](_0x384f46[_0x4e43('0x5e')]);});}})['then'](handleEntityNotFound(_0x2be07c,null))[_0x4e43('0x23')](removeEntity(_0x2be07c,null))[_0x4e43('0x44')](handleError(_0x2be07c,null));};exports['addSound']=function(_0x38a087,_0x4207e7,_0x2ac200){return db[_0x4e43('0x4b')]['transaction'](function(_0x15980f){var _0x32e9e3;return db[_0x4e43('0x2a')]['find']({'where':{'id':_0x38a087['params']['id']}})[_0x4e43('0x23')](function(_0x5dad28){if(_0x5dad28){_0x32e9e3=_0x5dad28;return _0x5dad28[_0x4e43('0x5f')](_0x38a087[_0x4e43('0x48')]['id'],{'transaction':_0x15980f});}})['then'](function(_0x2c2e66){if(_0x2c2e66){return db[_0x4e43('0x60')]['findOne']({'where':{'id':_0x38a087['body']['id']},'attributes':['id','name',_0x4e43('0x61'),_0x4e43('0x62'),'createdAt'],'raw':!![]});}})[_0x4e43('0x23')](function(_0x4b3e9c){if(_0x4b3e9c){var _0x22afa5=path[_0x4e43('0x4e')](config['root'],'server/files/sounds/converted',util[_0x4e43('0x63')](_0x4e43('0x64'),path['basename'](_0x4b3e9c[_0x4e43('0x61')],path[_0x4e43('0x65')](_0x4b3e9c['save_name'])),_0x4b3e9c[_0x4e43('0x62')]));var _0x3d79d8=path[_0x4e43('0x4e')](config['root'],'server/files/moh',_0x32e9e3[_0x4e43('0x26')],util['format']('%s.%s',_0x4b3e9c[_0x4e43('0x26')],_0x4b3e9c[_0x4e43('0x62')]));fs['symlinkSync'](_0x22afa5,_0x3d79d8);return _0x4b3e9c;}})[_0x4e43('0x44')](function(_0x2bb9dc){throw new db[(_0x4e43('0x5c'))][(_0x4e43('0x5d'))](_0x2bb9dc[_0x4e43('0x5e')]);});})[_0x4e43('0x23')](handleEntityNotFound(_0x4207e7,null))[_0x4e43('0x23')](respondWithResult(_0x4207e7,0xc9))['catch'](handleError(_0x4207e7,null));};exports['removeSound']=function(_0x3dbea4,_0x2b21b9,_0x1b4e44){return db[_0x4e43('0x4b')][_0x4e43('0x4c')](function(_0x541e16){var _0x2f79b7;return db['VoiceMusicOnHold'][_0x4e43('0x66')]({'where':{'id':_0x3dbea4[_0x4e43('0x46')]['id']}})[_0x4e43('0x23')](handleEntityNotFound(_0x2b21b9,null))[_0x4e43('0x23')](function(_0x2bae80){if(_0x2bae80){_0x2f79b7=_0x2bae80;return _0x2bae80[_0x4e43('0x67')](_0x3dbea4['params'][_0x4e43('0x68')]);}})[_0x4e43('0x23')](function(_0x276230){if(_0x276230){return db[_0x4e43('0x60')]['findOne']({'where':{'id':_0x3dbea4['params'][_0x4e43('0x68')]},'attributes':['id',_0x4e43('0x26'),'save_name',_0x4e43('0x62'),_0x4e43('0x69')],'raw':!![]});}})['then'](function(_0x4d9390){if(_0x4d9390){fs[_0x4e43('0x6a')](path[_0x4e43('0x4e')](_0x2f79b7['directory'],util[_0x4e43('0x63')](_0x4e43('0x64'),_0x4d9390[_0x4e43('0x26')],_0x4d9390[_0x4e43('0x62')])));return _0x4d9390;}})[_0x4e43('0x44')](function(_0x1ddd3c){throw new db['Sequelize'][(_0x4e43('0x5d'))](_0x1ddd3c[_0x4e43('0x5e')]);});})[_0x4e43('0x23')](handleEntityNotFound(_0x2b21b9,null))[_0x4e43('0x23')](respondWithStatusCode(_0x2b21b9,0xcc))[_0x4e43('0x44')](handleError(_0x2b21b9,null));};exports[_0x4e43('0x6b')]=function(_0x30cfb1,_0x466476,_0x494237){var _0x81c9b9={};var _0x5b9ec2={};var _0x2b0b1f;var _0x38901a;return db[_0x4e43('0x2a')][_0x4e43('0x66')]({'where':{'id':_0x30cfb1['params']['id']}})['then'](handleEntityNotFound(_0x466476,null))[_0x4e43('0x23')](function(_0x5e94e8){if(_0x5e94e8){_0x2b0b1f=_0x5e94e8;_0x5b9ec2['model']=_[_0x4e43('0x30')](db[_0x4e43('0x60')][_0x4e43('0x2b')]);_0x5b9ec2[_0x4e43('0x2f')]=_[_0x4e43('0x30')](_0x30cfb1['query']);_0x5b9ec2['filters']=_[_0x4e43('0x31')](_0x5b9ec2['model'],_0x5b9ec2[_0x4e43('0x2f')]);_0x81c9b9['attributes']=_['intersection'](_0x5b9ec2['model'],qs[_0x4e43('0x33')](_0x30cfb1[_0x4e43('0x2f')]['fields']));_0x81c9b9[_0x4e43('0x34')]=_0x81c9b9[_0x4e43('0x34')][_0x4e43('0x35')]?_0x81c9b9[_0x4e43('0x34')]:_0x5b9ec2['model'];_0x81c9b9[_0x4e43('0x38')]=qs[_0x4e43('0x39')](_0x30cfb1[_0x4e43('0x2f')][_0x4e43('0x39')]);_0x81c9b9['where']=qs[_0x4e43('0x3b')](_[_0x4e43('0x3c')](_0x30cfb1[_0x4e43('0x2f')],_0x5b9ec2[_0x4e43('0x3b')]));if(_0x30cfb1[_0x4e43('0x2f')][_0x4e43('0x3f')]){_0x81c9b9[_0x4e43('0x3a')]=_[_0x4e43('0x3d')](_0x81c9b9['where'],{'$or':_[_0x4e43('0x29')](_0x81c9b9[_0x4e43('0x34')],function(_0x37fa51){var _0x2daf88={};_0x2daf88[_0x37fa51]={'$like':'%'+_0x30cfb1[_0x4e43('0x2f')][_0x4e43('0x3f')]+'%'};return _0x2daf88;})});}_0x81c9b9=_['merge']({},_0x81c9b9,_0x30cfb1[_0x4e43('0x40')]);return _0x2b0b1f['getSounds'](_0x81c9b9);}})['then'](function(_0x18b935){if(_0x18b935){_0x38901a=_0x18b935[_0x4e43('0x35')];if(!_0x30cfb1[_0x4e43('0x2f')][_0x4e43('0x36')]('nolimit')){_0x81c9b9[_0x4e43('0x1c')]=qs['limit'](_0x30cfb1[_0x4e43('0x2f')][_0x4e43('0x1c')]);_0x81c9b9[_0x4e43('0x1b')]=qs['offset'](_0x30cfb1[_0x4e43('0x2f')][_0x4e43('0x1b')]);}return _0x2b0b1f[_0x4e43('0x6b')](_0x81c9b9);}})[_0x4e43('0x23')](function(_0x472921){if(_0x472921){return _0x472921?{'count':_0x38901a,'rows':_0x472921}:null;}})[_0x4e43('0x23')](respondWithResult(_0x466476,null))[_0x4e43('0x44')](handleError(_0x466476,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 5bb229d..d6c843d 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 _0x579f=['exports','define','voice_musiconhold','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x2e06ab,_0x444394){var _0x6138d3=function(_0x26b147){while(--_0x26b147){_0x2e06ab['push'](_0x2e06ab['shift']());}};_0x6138d3(++_0x444394);}(_0x579f,0x10b));var _0xf579=function(_0x3b4324,_0x5a06cd){_0x3b4324=_0x3b4324-0x0;var _0x51bb2d=_0x579f[_0x3b4324];return _0x51bb2d;};'use strict';var _=require(_0xf579('0x0'));var util=require(_0xf579('0x1'));var logger=require('../../config/logger')(_0xf579('0x2'));var moment=require(_0xf579('0x3'));var BPromise=require(_0xf579('0x4'));var rp=require(_0xf579('0x5'));var fs=require('fs');var path=require(_0xf579('0x6'));var rimraf=require('rimraf');var config=require(_0xf579('0x7'));var attributes=require('./voiceMusicOnHold.attributes');module[_0xf579('0x8')]=function(_0x2e0d23,_0x4508bc){return _0x2e0d23[_0xf579('0x9')]('VoiceMusicOnHold',attributes,{'tableName':_0xf579('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3453=['rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x3d5be9,_0x1b057d){var _0x5636ac=function(_0x37a1f8){while(--_0x37a1f8){_0x3d5be9['push'](_0x3d5be9['shift']());}};_0x5636ac(++_0x1b057d);}(_0x3453,0x16e));var _0x3345=function(_0x541406,_0x262478){_0x541406=_0x541406-0x0;var _0x5da0bf=_0x3453[_0x541406];return _0x5da0bf;};'use strict';var _=require(_0x3345('0x0'));var util=require(_0x3345('0x1'));var logger=require(_0x3345('0x2'))('api');var moment=require(_0x3345('0x3'));var BPromise=require(_0x3345('0x4'));var rp=require(_0x3345('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3345('0x6'));var config=require(_0x3345('0x7'));var attributes=require(_0x3345('0x8'));module[_0x3345('0x9')]=function(_0x5cbac2,_0x5065b4){return _0x5cbac2[_0x3345('0xa')](_0x3345('0xb'),attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js index 2b83b06..e5a3985 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 _0x4f97=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','error','VoiceMusicOnHold,\x20%s,\x20%s','message','util','moment'];(function(_0x1ac6ec,_0x1f81fc){var _0x48a489=function(_0xf38b04){while(--_0xf38b04){_0x1ac6ec['push'](_0x1ac6ec['shift']());}};_0x48a489(++_0x1f81fc);}(_0x4f97,0x1c0));var _0x74f9=function(_0x5e61b5,_0x51466c){_0x5e61b5=_0x5e61b5-0x0;var _0x3fb986=_0x4f97[_0x5e61b5];return _0x3fb986;};'use strict';var _=require('lodash');var util=require(_0x74f9('0x0'));var moment=require(_0x74f9('0x1'));var BPromise=require(_0x74f9('0x2'));var rs=require(_0x74f9('0x3'));var fs=require('fs');var Redis=require(_0x74f9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x74f9('0x5'));var logger=require(_0x74f9('0x6'))(_0x74f9('0x7'));var config=require(_0x74f9('0x8'));var jayson=require(_0x74f9('0x9'));var client=jayson[_0x74f9('0xa')][_0x74f9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x373c84,_0x33012c,_0x52abd9){return new BPromise(function(_0x30845b,_0xfe3df9){return client['request'](_0x373c84,_0x52abd9)[_0x74f9('0xc')](function(_0x31cae5){logger[_0x74f9('0xd')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x33012c,_0x74f9('0xe'));logger['debug']('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0x33012c,'request\x20sent',JSON['stringify'](_0x31cae5));if(_0x31cae5[_0x74f9('0xf')]){if(_0x31cae5[_0x74f9('0xf')]['code']===0x1f4){logger[_0x74f9('0xf')](_0x74f9('0x10'),_0x33012c,_0x31cae5['error'][_0x74f9('0x11')]);return _0xfe3df9(_0x31cae5[_0x74f9('0xf')]['message']);}logger['error'](_0x74f9('0x10'),_0x33012c,_0x31cae5[_0x74f9('0xf')][_0x74f9('0x11')]);return _0x30845b(_0x31cae5[_0x74f9('0xf')][_0x74f9('0x11')]);}else{logger[_0x74f9('0xd')](_0x74f9('0x10'),_0x33012c,_0x74f9('0xe'));_0x30845b(_0x31cae5['result']['message']);}})['catch'](function(_0x2d7ce8){logger['error'](_0x74f9('0x10'),_0x33012c,_0x2d7ce8);_0xfe3df9(_0x2d7ce8);});});} \ No newline at end of file +var _0xba1e=['client','http','request','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x142249,_0x170a77){var _0x45beb0=function(_0x55711b){while(--_0x55711b){_0x142249['push'](_0x142249['shift']());}};_0x45beb0(++_0x170a77);}(_0xba1e,0x107));var _0xeba1=function(_0x281a20,_0x387a8c){_0x281a20=_0x281a20-0x0;var _0x1f87ae=_0xba1e[_0x281a20];return _0x1f87ae;};'use strict';var _=require(_0xeba1('0x0'));var util=require(_0xeba1('0x1'));var moment=require(_0xeba1('0x2'));var BPromise=require('bluebird');var rs=require(_0xeba1('0x3'));var fs=require('fs');var Redis=require(_0xeba1('0x4'));var db=require(_0xeba1('0x5'))['db'];var utils=require(_0xeba1('0x6'));var logger=require(_0xeba1('0x7'))(_0xeba1('0x8'));var config=require('../../config/environment');var jayson=require(_0xeba1('0x9'));var client=jayson[_0xeba1('0xa')][_0xeba1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2ca1a5,_0x48ff33,_0x9d75ac){return new BPromise(function(_0x4e3357,_0x4a727b){return client[_0xeba1('0xc')](_0x2ca1a5,_0x9d75ac)['then'](function(_0x3cb818){logger[_0xeba1('0xd')](_0xeba1('0xe'),_0x48ff33,_0xeba1('0xf'));logger['debug'](_0xeba1('0x10'),_0x48ff33,_0xeba1('0xf'),JSON['stringify'](_0x3cb818));if(_0x3cb818[_0xeba1('0x11')]){if(_0x3cb818['error'][_0xeba1('0x12')]===0x1f4){logger[_0xeba1('0x11')](_0xeba1('0xe'),_0x48ff33,_0x3cb818['error'][_0xeba1('0x13')]);return _0x4a727b(_0x3cb818[_0xeba1('0x11')][_0xeba1('0x13')]);}logger[_0xeba1('0x11')](_0xeba1('0xe'),_0x48ff33,_0x3cb818[_0xeba1('0x11')]['message']);return _0x4e3357(_0x3cb818[_0xeba1('0x11')][_0xeba1('0x13')]);}else{logger['info'](_0xeba1('0xe'),_0x48ff33,_0xeba1('0xf'));_0x4e3357(_0x3cb818[_0xeba1('0x14')]['message']);}})['catch'](function(_0x18504d){logger[_0xeba1('0x11')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x48ff33,_0x18504d);_0x4a727b(_0x18504d);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index c96b25a..1ce5bb0 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 _0xb711=['post','create','addAgents','put','delete','destroy','removeAgents','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./voicePrefix.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/users','getAgents'];(function(_0x369e78,_0x3f4329){var _0x41fad8=function(_0x5c9852){while(--_0x5c9852){_0x369e78['push'](_0x369e78['shift']());}};_0x41fad8(++_0x3f4329);}(_0xb711,0xed));var _0x1b71=function(_0x55a9a2,_0x50061f){_0x55a9a2=_0x55a9a2-0x0;var _0x48f783=_0xb711[_0x55a9a2];return _0x48f783;};'use strict';var multer=require(_0x1b71('0x0'));var util=require('util');var path=require(_0x1b71('0x1'));var timeout=require(_0x1b71('0x2'));var express=require(_0x1b71('0x3'));var router=express[_0x1b71('0x4')]();var auth=require(_0x1b71('0x5'));var interaction=require(_0x1b71('0x6'));var config=require('../../config/environment');var controller=require(_0x1b71('0x7'));router[_0x1b71('0x8')]('/',auth[_0x1b71('0x9')](),controller['index']);router['get'](_0x1b71('0xa'),auth[_0x1b71('0x9')](),controller[_0x1b71('0xb')]);router[_0x1b71('0x8')](_0x1b71('0xc'),auth['isAuthenticated'](),controller[_0x1b71('0xd')]);router[_0x1b71('0x8')](_0x1b71('0xe'),auth[_0x1b71('0x9')](),controller[_0x1b71('0xf')]);router[_0x1b71('0x10')]('/',auth[_0x1b71('0x9')](),controller[_0x1b71('0x11')]);router[_0x1b71('0x10')]('/:id/users',auth[_0x1b71('0x9')](),controller[_0x1b71('0x12')]);router[_0x1b71('0x13')](_0x1b71('0xc'),auth[_0x1b71('0x9')](),controller['update']);router[_0x1b71('0x14')]('/:id',auth[_0x1b71('0x9')](),controller[_0x1b71('0x15')]);router[_0x1b71('0x14')](_0x1b71('0xe'),auth[_0x1b71('0x9')](),controller[_0x1b71('0x16')]);module['exports']=router; \ No newline at end of file +var _0x3715=['removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','index','/describe','describe','show','/:id/users','create','post','addAgents','put','/:id','update','delete','destroy'];(function(_0x12130f,_0x11ad1a){var _0x252dac=function(_0x47b0e4){while(--_0x47b0e4){_0x12130f['push'](_0x12130f['shift']());}};_0x252dac(++_0x11ad1a);}(_0x3715,0x120));var _0x5371=function(_0x2ad899,_0x4f899f){_0x2ad899=_0x2ad899-0x0;var _0x4443ec=_0x3715[_0x2ad899];return _0x4443ec;};'use strict';var multer=require(_0x5371('0x0'));var util=require(_0x5371('0x1'));var path=require(_0x5371('0x2'));var timeout=require(_0x5371('0x3'));var express=require(_0x5371('0x4'));var router=express[_0x5371('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x5371('0x6'));var config=require(_0x5371('0x7'));var controller=require(_0x5371('0x8'));router[_0x5371('0x9')]('/',auth[_0x5371('0xa')](),controller[_0x5371('0xb')]);router[_0x5371('0x9')](_0x5371('0xc'),auth[_0x5371('0xa')](),controller[_0x5371('0xd')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x5371('0xe')]);router['get'](_0x5371('0xf'),auth['isAuthenticated'](),controller['getAgents']);router['post']('/',auth[_0x5371('0xa')](),controller[_0x5371('0x10')]);router[_0x5371('0x11')](_0x5371('0xf'),auth[_0x5371('0xa')](),controller[_0x5371('0x12')]);router[_0x5371('0x13')](_0x5371('0x14'),auth[_0x5371('0xa')](),controller[_0x5371('0x15')]);router[_0x5371('0x16')]('/:id',auth[_0x5371('0xa')](),controller[_0x5371('0x17')]);router[_0x5371('0x16')](_0x5371('0xf'),auth['isAuthenticated'](),controller[_0x5371('0x18')]);module[_0x5371('0x19')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 8b19c57..00f9df4 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 _0x86af=['VIRTUAL','getDataValue','name','exports','STRING'];(function(_0x35919b,_0x3a8cf1){var _0x1982e4=function(_0x365dba){while(--_0x365dba){_0x35919b['push'](_0x35919b['shift']());}};_0x1982e4(++_0x3a8cf1);}(_0x86af,0x152));var _0xf86a=function(_0x18c23c,_0x5d31df){_0x18c23c=_0x18c23c-0x0;var _0xa3b55=_0x86af[_0x18c23c];return _0xa3b55;};'use strict';var Sequelize=require('sequelize');module[_0xf86a('0x0')]={'name':{'type':Sequelize[_0xf86a('0x1')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0xf86a('0x2')],'get':function(_0x2aa06c){return'system-'+this[_0xf86a('0x3')](_0xf86a('0x4'))+'-';}},'description':{'type':Sequelize[_0xf86a('0x1')]},'callerIdAll':{'type':Sequelize[_0xf86a('0x1')]},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x0442=['exports','STRING','VIRTUAL','getDataValue','name','INTEGER','sequelize'];(function(_0x420ddd,_0x1ad6b7){var _0x4872e4=function(_0x55b85e){while(--_0x55b85e){_0x420ddd['push'](_0x420ddd['shift']());}};_0x4872e4(++_0x1ad6b7);}(_0x0442,0x1e2));var _0x2044=function(_0x2fd160,_0x53c0d6){_0x2fd160=_0x2fd160-0x0;var _0x5c2031=_0x0442[_0x2fd160];return _0x5c2031;};'use strict';var Sequelize=require(_0x2044('0x0'));module[_0x2044('0x1')]={'name':{'type':Sequelize[_0x2044('0x2')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0x2044('0x3')],'get':function(_0x40febd){return'system-'+this[_0x2044('0x4')](_0x2044('0x5'))+'-';}},'description':{'type':Sequelize[_0x2044('0x2')]},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize[_0x2044('0x6')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 3d154f0..9eb2cb2 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 _0x92ea=['then','error','stack','name','index','map','VoicePrefix','rawAttributes','type','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','rows','show','params','include','find','catch','describe','create','transaction','body','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','from-sip','exten','app','system','Voice\x20Prefix\x20Extension','priority','appdata','prefix','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','Set','CDR(prefix)=','PREFIX-CALLERIDALL=','callerIdAll','push','No\x20callerid\x20available','goto','context','${EXTEN:','charAt','system-','sequelize','addAgents','ids','omit','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','nolimit','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','status','end','count','offset','limit','set','Content-Range','reject','save','update','get','VoicePrefixes','UserProfileResource','destroy'];(function(_0x4295fd,_0x1f2573){var _0x96f34e=function(_0x32bf59){while(--_0x32bf59){_0x4295fd['push'](_0x4295fd['shift']());}};_0x96f34e(++_0x1f2573);}(_0x92ea,0x1c2));var _0xa92e=function(_0xb63fce,_0x195630){_0xb63fce=_0xb63fce-0x0;var _0x42c1ed=_0x92ea[_0xb63fce];return _0x42c1ed;};'use strict';var pdf=require(_0xa92e('0x0'));var emlformat=require(_0xa92e('0x1'));var rimraf=require(_0xa92e('0x2'));var zipdir=require(_0xa92e('0x3'));var jsonpatch=require(_0xa92e('0x4'));var rp=require('request-promise');var moment=require(_0xa92e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xa92e('0x6'));var util=require(_0xa92e('0x7'));var path=require(_0xa92e('0x8'));var sox=require('sox');var csv=require(_0xa92e('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xa92e('0xa'));var crypto=require(_0xa92e('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xa92e('0xc'));var toCsv=require(_0xa92e('0x9'));var querystring=require(_0xa92e('0xd'));var Papa=require('papaparse');var Redis=require(_0xa92e('0xe'));var authService=require(_0xa92e('0xf'));var qs=require(_0xa92e('0x10'));var as=require(_0xa92e('0x11'));var hardwareService=require(_0xa92e('0x12'));var logger=require('../../config/logger')(_0xa92e('0x13'));var utils=require('../../config/utils');var config=require(_0xa92e('0x14'));var db=require(_0xa92e('0x15'))['db'];config[_0xa92e('0x16')]=_[_0xa92e('0x17')](config[_0xa92e('0x16')],{'host':_0xa92e('0x18'),'port':0x18eb});var socket=require(_0xa92e('0x19'))(new Redis(config['redis']));require(_0xa92e('0x1a'))[_0xa92e('0x1b')](socket);function respondWithStatusCode(_0x1dbb1b,_0xd8fa97){_0xd8fa97=_0xd8fa97||0xcc;return function(_0x4503f5){if(_0x4503f5){return _0x1dbb1b['sendStatus'](_0xd8fa97);}return _0x1dbb1b[_0xa92e('0x1c')](_0xd8fa97)[_0xa92e('0x1d')]();};}function respondWithResult(_0xd014c8,_0x387cb3){_0x387cb3=_0x387cb3||0xc8;return function(_0x4056b0){if(_0x4056b0){return _0xd014c8[_0xa92e('0x1c')](_0x387cb3)['json'](_0x4056b0);}};}function respondWithFilteredResult(_0xed442c,_0x3c03d6){return function(_0x1e6c01){if(_0x1e6c01){var _0x41ef69=_0x1e6c01[_0xa92e('0x1e')],_0x282736=_0x3c03d6[_0xa92e('0x1f')],_0x5e5958=_0x3c03d6['offset']+_0x3c03d6[_0xa92e('0x20')],_0x369a15;if(_0x5e5958>=_0x41ef69){_0x5e5958=_0x41ef69;_0x369a15=0xc8;}else{_0x369a15=0xce;}_0xed442c['status'](_0x369a15);return _0xed442c[_0xa92e('0x21')](_0xa92e('0x22'),_0x282736+'-'+_0x5e5958+'/'+_0x41ef69)['json'](_0x1e6c01);}return null;};}function patchUpdates(_0x5f544e){return function(_0x175699){try{jsonpatch['apply'](_0x175699,_0x5f544e,!![]);}catch(_0x5a8c17){return BPromise[_0xa92e('0x23')](_0x5a8c17);}return _0x175699[_0xa92e('0x24')]();};}function saveUpdates(_0x490bfb,_0x23985e){return function(_0x3878c8){if(_0x3878c8){return _0x3878c8[_0xa92e('0x25')](_0x490bfb)['then'](function(_0x2c2d5f){return _0x2c2d5f;});}return null;};}function removeEntity(_0x336f86,_0x3bc772){return function(_0x41af0e){if(_0x41af0e){return _0x41af0e['destroy']()['then'](function(){var _0x38d02b=_0x41af0e[_0xa92e('0x26')]({'plain':!![]});var _0x4a49b4=_0xa92e('0x27');return db[_0xa92e('0x28')][_0xa92e('0x29')]({'where':{'type':_0x4a49b4,'resourceId':_0x38d02b['id']}})[_0xa92e('0x2a')](function(){return _0x41af0e;});})[_0xa92e('0x2a')](function(){_0x336f86[_0xa92e('0x1c')](0xcc)[_0xa92e('0x1d')]();});}};}function handleEntityNotFound(_0x22d0d2,_0x5b870d){return function(_0x58af47){if(!_0x58af47){_0x22d0d2['sendStatus'](0x194);}return _0x58af47;};}function handleError(_0x3457fc,_0x58b010){_0x58b010=_0x58b010||0x1f4;return function(_0x55c802){logger[_0xa92e('0x2b')](_0x55c802[_0xa92e('0x2c')]);if(_0x55c802['name']){delete _0x55c802[_0xa92e('0x2d')];}_0x3457fc['status'](_0x58b010)['send'](_0x55c802);};}exports[_0xa92e('0x2e')]=function(_0x3b722e,_0x20dd6e){var _0x2ff1b6={},_0x53af62={},_0x1b371d={'count':0x0,'rows':[]};var _0x4c530d=_[_0xa92e('0x2f')](db[_0xa92e('0x30')][_0xa92e('0x31')],function(_0x537b7d){return{'name':_0x537b7d['fieldName'],'type':_0x537b7d[_0xa92e('0x32')]['key']};});_0x53af62['model']=_['map'](_0x4c530d,_0xa92e('0x2d'));_0x53af62['query']=_[_0xa92e('0x33')](_0x3b722e[_0xa92e('0x34')]);_0x53af62[_0xa92e('0x35')]=_[_0xa92e('0x36')](_0x53af62[_0xa92e('0x37')],_0x53af62[_0xa92e('0x34')]);_0x2ff1b6['attributes']=_[_0xa92e('0x36')](_0x53af62['model'],qs['fields'](_0x3b722e['query'][_0xa92e('0x38')]));_0x2ff1b6[_0xa92e('0x39')]=_0x2ff1b6[_0xa92e('0x39')][_0xa92e('0x3a')]?_0x2ff1b6[_0xa92e('0x39')]:_0x53af62['model'];if(!_0x3b722e[_0xa92e('0x34')][_0xa92e('0x3b')]('nolimit')){_0x2ff1b6[_0xa92e('0x20')]=qs[_0xa92e('0x20')](_0x3b722e['query'][_0xa92e('0x20')]);_0x2ff1b6[_0xa92e('0x1f')]=qs['offset'](_0x3b722e[_0xa92e('0x34')][_0xa92e('0x1f')]);}_0x2ff1b6[_0xa92e('0x3c')]=qs[_0xa92e('0x3d')](_0x3b722e[_0xa92e('0x34')][_0xa92e('0x3d')]);_0x2ff1b6[_0xa92e('0x3e')]=qs[_0xa92e('0x35')](_[_0xa92e('0x3f')](_0x3b722e[_0xa92e('0x34')],_0x53af62['filters']));if(_0x3b722e['query'][_0xa92e('0x40')]){_0x2ff1b6[_0xa92e('0x3e')]=_['merge'](_0x2ff1b6[_0xa92e('0x3e')],{'$or':_['map'](_0x4c530d,function(_0x449131){if(_0x449131[_0xa92e('0x32')]!==_0xa92e('0x41')){var _0xe1b033={};_0xe1b033[_0x449131[_0xa92e('0x2d')]]={'$like':'%'+_0x3b722e[_0xa92e('0x34')][_0xa92e('0x40')]+'%'};return _0xe1b033;}})});}_0x2ff1b6=_[_0xa92e('0x42')]({},_0x2ff1b6,_0x3b722e[_0xa92e('0x43')]);var _0x236de4={'where':_0x2ff1b6[_0xa92e('0x3e')]};return db[_0xa92e('0x30')][_0xa92e('0x1e')](_0x236de4)[_0xa92e('0x2a')](function(_0x46f49f){_0x1b371d[_0xa92e('0x1e')]=_0x46f49f;if(_0x3b722e[_0xa92e('0x34')][_0xa92e('0x44')]){_0x2ff1b6['include']=[{'all':!![]}];}return db[_0xa92e('0x30')]['findAll'](_0x2ff1b6);})[_0xa92e('0x2a')](function(_0x27e9b3){_0x1b371d[_0xa92e('0x45')]=_0x27e9b3;return _0x1b371d;})[_0xa92e('0x2a')](respondWithFilteredResult(_0x20dd6e,_0x2ff1b6))['catch'](handleError(_0x20dd6e,null));};exports[_0xa92e('0x46')]=function(_0x18a289,_0x5ba0da){var _0x3f4991={'raw':![],'where':{'id':_0x18a289[_0xa92e('0x47')]['id']}},_0x193b32={};_0x193b32['model']=_['keys'](db[_0xa92e('0x30')]['rawAttributes']);_0x193b32['query']=_[_0xa92e('0x33')](_0x18a289[_0xa92e('0x34')]);_0x193b32[_0xa92e('0x35')]=_[_0xa92e('0x36')](_0x193b32['model'],_0x193b32[_0xa92e('0x34')]);_0x3f4991[_0xa92e('0x39')]=_['intersection'](_0x193b32[_0xa92e('0x37')],qs[_0xa92e('0x38')](_0x18a289['query']['fields']));_0x3f4991[_0xa92e('0x39')]=_0x3f4991[_0xa92e('0x39')][_0xa92e('0x3a')]?_0x3f4991[_0xa92e('0x39')]:_0x193b32['model'];if(_0x18a289[_0xa92e('0x34')]['includeAll']){_0x3f4991[_0xa92e('0x48')]=[{'all':!![]}];}_0x3f4991=_['merge']({},_0x3f4991,_0x18a289[_0xa92e('0x43')]);return db['VoicePrefix'][_0xa92e('0x49')](_0x3f4991)['then'](handleEntityNotFound(_0x5ba0da,null))[_0xa92e('0x2a')](respondWithResult(_0x5ba0da,null))[_0xa92e('0x4a')](handleError(_0x5ba0da,null));};exports[_0xa92e('0x29')]=function(_0x304090,_0x4bfb32){return db[_0xa92e('0x30')]['find']({'where':{'id':_0x304090[_0xa92e('0x47')]['id']}})[_0xa92e('0x2a')](handleEntityNotFound(_0x4bfb32,null))[_0xa92e('0x2a')](removeEntity(_0x4bfb32,null))[_0xa92e('0x4a')](handleError(_0x4bfb32,null));};exports[_0xa92e('0x4b')]=function(_0x250aba,_0x52b1cc){return db[_0xa92e('0x30')][_0xa92e('0x4b')]()['then'](respondWithResult(_0x52b1cc,null))[_0xa92e('0x4a')](handleError(_0x52b1cc,null));};exports[_0xa92e('0x4c')]=function(_0xdf4ba5,_0x140137){var _0x429732;return db['sequelize'][_0xa92e('0x4d')](function(_0x10db02){return db[_0xa92e('0x30')][_0xa92e('0x4c')](_0xdf4ba5[_0xa92e('0x4e')],{'transaction':_0x10db02})[_0xa92e('0x2a')](function(_0x445b59){_0x429732=_0x445b59['get']({'plain':!![]});return db[_0xa92e('0x4f')]['find']({'where':{'id':_0x429732[_0xa92e('0x50')]},'raw':!![]})[_0xa92e('0x2a')](function(_0x5824d1){return createVoicePrefixExtensions(_0x429732,_0x5824d1,_0x10db02);});});})[_0xa92e('0x2a')](function(){var _0x5dede0=_0xdf4ba5[_0xa92e('0x51')][_0xa92e('0x26')]({'plain':!![]});if(!_0x5dede0)throw new Error(_0xa92e('0x52'));if(_0x5dede0[_0xa92e('0x53')]===_0xa92e('0x51')){var _0x524f86=_0x429732;return db[_0xa92e('0x54')][_0xa92e('0x49')]({'where':{'name':_0xa92e('0x27'),'userProfileId':_0x5dede0[_0xa92e('0x55')]},'raw':!![]})[_0xa92e('0x2a')](function(_0x552c3c){if(_0x552c3c&&_0x552c3c[_0xa92e('0x56')]===0x0){return db[_0xa92e('0x28')][_0xa92e('0x4c')]({'name':_0x524f86[_0xa92e('0x2d')],'resourceId':_0x524f86['id'],'type':_0x552c3c[_0xa92e('0x2d')],'sectionId':_0x552c3c['id']},{})['then'](function(){return _0x429732;});}else{return _0x429732;}})[_0xa92e('0x4a')](function(_0x458be4){logger['error'](_0xa92e('0x57'),_0x458be4);throw _0x458be4;});}return _0x429732;})[_0xa92e('0x2a')](respondWithResult(_0x140137,null))[_0xa92e('0x4a')](handleError(_0x140137,null));};function Extension(_0x39072d,_0x47a9be,_0x5b0845,_0x4613d6){this['context']=_0xa92e('0x58');this[_0xa92e('0x59')]=_0x39072d;this[_0xa92e('0x5a')]=_0x5b0845;this[_0xa92e('0x32')]=_0xa92e('0x5b');this['description']=_0xa92e('0x5c');this[_0xa92e('0x5d')]=_0x47a9be;this[_0xa92e('0x5e')]=_0x4613d6;}function createVoicePrefixExtensions(_0x2cb36c,_0x309131,_0x3780a9){return new BPromise(function(_0x10c2e5,_0xb2ed89){var _0x12748e=new Extension(formatPrefixName(_0x2cb36c[_0xa92e('0x5f')]),0x1,'NoOp',_0xa92e('0x60'));_0x12748e['VoicePrefixId']=_0x2cb36c['id'];return db['VoiceExtension'][_0xa92e('0x4c')](_0x12748e,{'transaction':_0x3780a9})[_0xa92e('0x2a')](function(_0x2831bb){var _0x4981d8=_0x2831bb[_0xa92e('0x26')]({'plain':!![]});var _0x598505=_[_0xa92e('0x2f')](addVoicePrefixExtensions(_0x2cb36c,_0x309131),function(_0x446e43){_0x446e43[_0xa92e('0x50')]=_0x4981d8['id'];_0x446e43[_0xa92e('0x61')]=_0x2cb36c['id'];return _0x446e43;});return db[_0xa92e('0x4f')][_0xa92e('0x62')](_0x598505,{'transaction':_0x3780a9})[_0xa92e('0x2a')](function(_0x340b3c){if(!_0x340b3c){return _0xb2ed89(_0xa92e('0x63'));}else{return _0x10c2e5(_0x340b3c);}})[_0xa92e('0x4a')](function(_0x235994){return _0xb2ed89(_0x235994);});});;});};function addVoicePrefixExtensions(_0xa94570,_0x3cb496){var _0x482683=[];var _0x1e21ba=formatPrefixName(_0xa94570[_0xa92e('0x5f')]);_0x482683['push'](new Extension(_0x1e21ba,0x2,_0xa92e('0x64'),_0xa92e('0x65')+_0xa94570['name']));if(_0xa94570['callerIdAll']){_0x482683['push'](new Extension(_0x1e21ba,0x3,'Set',_0xa92e('0x66')+_0xa94570[_0xa92e('0x67')]));}else{_0x482683[_0xa92e('0x68')](new Extension(_0x1e21ba,0x3,'NoOp',_0xa92e('0x69')));}_0x482683['push'](new Extension(_0x1e21ba,0x4,_0xa92e('0x6a'),_0x3cb496[_0xa92e('0x6b')]+','+_0xa92e('0x6c')+(0x8+_0xa94570[_0xa92e('0x2d')][_0xa92e('0x3a')])+'}'+','+0x1));return _0x482683;}function formatPrefixName(_0x3efe79){var _0x3b6324='_';for(var _0x2ad42b=0x0;_0x2ad42b<_0x3efe79['length'];_0x2ad42b++){if(_0x3efe79[_0xa92e('0x6d')](_0x2ad42b)=='-'){_0x3b6324+=_0x3efe79[_0xa92e('0x6d')](_0x2ad42b);}else{_0x3b6324+='['+_0x3efe79[_0xa92e('0x6d')](_0x2ad42b)+']';}}_0x3b6324+='.';return _0x3b6324;}exports[_0xa92e('0x25')]=function(_0x2d21bd,_0x4c8487,_0x19d424){var _0x196a30=_0x2d21bd['body'];_0x196a30[_0xa92e('0x5f')]=_0xa92e('0x6e')+_0x196a30[_0xa92e('0x2d')]+'-';return db[_0xa92e('0x6f')][_0xa92e('0x4d')](function(_0xa9b7a8){return db[_0xa92e('0x30')][_0xa92e('0x25')](_0x196a30,{'where':{'id':_0x196a30['id']},'transaction':_0xa9b7a8})[_0xa92e('0x2a')](function(){return db[_0xa92e('0x4f')][_0xa92e('0x29')]({'where':{'VoicePrefixId':_0x196a30['id']},'transaction':_0xa9b7a8})[_0xa92e('0x2a')](function(){return db[_0xa92e('0x4f')]['find']({'where':{'id':_0x196a30[_0xa92e('0x50')]},'raw':!![]})[_0xa92e('0x2a')](function(_0x3c723b){return createVoicePrefixExtensions(_0x196a30,_0x3c723b,_0xa9b7a8);});});});})[_0xa92e('0x2a')](function(){return db[_0xa92e('0x30')]['findById'](_0x196a30['id']);})[_0xa92e('0x2a')](respondWithResult(_0x4c8487,null))[_0xa92e('0x4a')](handleError(_0x4c8487,null));};exports[_0xa92e('0x70')]=function(_0x58d1cd,_0x1b49db,_0x305e67){return db[_0xa92e('0x30')][_0xa92e('0x49')]({'where':{'id':_0x58d1cd[_0xa92e('0x47')]['id']}})[_0xa92e('0x2a')](handleEntityNotFound(_0x1b49db,null))[_0xa92e('0x2a')](function(_0x46f917){if(_0x46f917){return _0x46f917[_0xa92e('0x70')](_0x58d1cd['body'][_0xa92e('0x71')],_[_0xa92e('0x72')](_0x58d1cd[_0xa92e('0x4e')],[_0xa92e('0x71'),'id'])||{})['spread'](function(_0x58b39a){for(var _0x12a92e=0x0;_0x12a92e<_0x58d1cd[_0xa92e('0x4e')][_0xa92e('0x71')]['length'];_0x12a92e+=0x1){socket[_0xa92e('0x73')](_0xa92e('0x74'),{'UserId':_0x58d1cd[_0xa92e('0x4e')]['ids'][_0x12a92e],'VoicePrefixId':_0x58d1cd[_0xa92e('0x47')]['id']});}return _0x58b39a;});}})[_0xa92e('0x2a')](respondWithResult(_0x1b49db,null))[_0xa92e('0x4a')](handleError(_0x1b49db,null));};exports[_0xa92e('0x75')]=function(_0x2f5620,_0x4fbba4,_0x3868e2){return db[_0xa92e('0x30')][_0xa92e('0x49')]({'where':{'id':_0x2f5620[_0xa92e('0x47')]['id']}})[_0xa92e('0x2a')](handleEntityNotFound(_0x4fbba4,null))[_0xa92e('0x2a')](function(_0x25a509){if(_0x25a509){return _0x25a509[_0xa92e('0x75')](_0x2f5620[_0xa92e('0x34')][_0xa92e('0x71')])[_0xa92e('0x2a')](function(){if(_[_0xa92e('0x76')](_0x2f5620['query'][_0xa92e('0x71')])){for(var _0x568bdc=0x0;_0x568bdc<_0x2f5620['query'][_0xa92e('0x71')][_0xa92e('0x3a')];_0x568bdc+=0x1){socket[_0xa92e('0x73')](_0xa92e('0x77'),{'UserId':Number(_0x2f5620[_0xa92e('0x34')][_0xa92e('0x71')][_0x568bdc]),'VoicePrefixId':Number(_0x2f5620['params']['id'])});}}else{socket['emit'](_0xa92e('0x77'),{'UserId':Number(_0x2f5620[_0xa92e('0x34')][_0xa92e('0x71')]),'VoicePrefixId':Number(_0x2f5620[_0xa92e('0x47')]['id'])});}});}})['then'](respondWithStatusCode(_0x4fbba4,null))[_0xa92e('0x4a')](handleError(_0x4fbba4,null));};exports[_0xa92e('0x78')]=function(_0x4499bc,_0x47bed4,_0x2d69f7){var _0xc202c0={};var _0x42f637={};var _0x5453c2;var _0x531241;return db[_0xa92e('0x30')][_0xa92e('0x79')]({'where':{'id':_0x4499bc[_0xa92e('0x47')]['id']}})['then'](handleEntityNotFound(_0x47bed4,null))['then'](function(_0x2cf5a2){if(_0x2cf5a2){_0x5453c2=_0x2cf5a2;_0x42f637['model']=_[_0xa92e('0x33')](db['User'][_0xa92e('0x31')]);_0x42f637[_0xa92e('0x34')]=_[_0xa92e('0x33')](_0x4499bc[_0xa92e('0x34')]);_0x42f637[_0xa92e('0x35')]=_['intersection'](_0x42f637['model'],_0x42f637['query']);_0xc202c0[_0xa92e('0x39')]=_[_0xa92e('0x36')](_0x42f637[_0xa92e('0x37')],qs[_0xa92e('0x38')](_0x4499bc[_0xa92e('0x34')][_0xa92e('0x38')]));_0xc202c0[_0xa92e('0x39')]=_0xc202c0['attributes'][_0xa92e('0x3a')]?_0xc202c0[_0xa92e('0x39')]:_0x42f637[_0xa92e('0x37')];_0xc202c0[_0xa92e('0x3c')]=qs[_0xa92e('0x3d')](_0x4499bc[_0xa92e('0x34')][_0xa92e('0x3d')]);_0xc202c0[_0xa92e('0x3e')]=qs[_0xa92e('0x35')](_['pick'](_0x4499bc[_0xa92e('0x34')],_0x42f637[_0xa92e('0x35')]));if(_0x4499bc[_0xa92e('0x34')]['filter']){_0xc202c0[_0xa92e('0x3e')]=_[_0xa92e('0x42')](_0xc202c0[_0xa92e('0x3e')],{'$or':_[_0xa92e('0x2f')](_0xc202c0['attributes'],function(_0x534951){var _0x276298={};_0x276298[_0x534951]={'$like':'%'+_0x4499bc[_0xa92e('0x34')][_0xa92e('0x40')]+'%'};return _0x276298;})});}_0xc202c0=_[_0xa92e('0x42')]({},_0xc202c0,_0x4499bc['options']);return _0x5453c2['getAgents'](_0xc202c0);}})[_0xa92e('0x2a')](function(_0x5c848b){if(_0x5c848b){_0x531241=_0x5c848b[_0xa92e('0x3a')];if(!_0x4499bc[_0xa92e('0x34')][_0xa92e('0x3b')](_0xa92e('0x7a'))){_0xc202c0[_0xa92e('0x20')]=qs[_0xa92e('0x20')](_0x4499bc[_0xa92e('0x34')]['limit']);_0xc202c0[_0xa92e('0x1f')]=qs[_0xa92e('0x1f')](_0x4499bc[_0xa92e('0x34')]['offset']);}return _0x5453c2[_0xa92e('0x78')](_0xc202c0);}})[_0xa92e('0x2a')](function(_0x20479f){if(_0x20479f){return _0x20479f?{'count':_0x531241,'rows':_0x20479f}:null;}})[_0xa92e('0x2a')](respondWithResult(_0x47bed4,null))[_0xa92e('0x4a')](handleError(_0x47bed4,null));}; \ No newline at end of file +var _0xd8be=['charAt','system-','transaction','addAgents','ids','omit','emit','userVoicePrefix:save','removeAgents','userVoicePrefix:remove','findOne','User','order','sort','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','count','offset','limit','Content-Range','reject','save','update','destroy','then','error','stack','name','send','map','VoicePrefix','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','include','find','describe','create','sequelize','body','get','VoiceExtensionId','user','role','UserProfileSection','VoicePrefixes','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','from-sip','app','description','Voice\x20Prefix\x20Extension','appdata','prefix','VoicePrefixId','VoiceExtension','bulkCreate','push','CDR(prefix)=','callerIdAll','Set','PREFIX-CALLERIDALL=','NoOp','No\x20callerid\x20available','goto','context','${EXTEN:'];(function(_0x3524e3,_0x4341da){var _0x119544=function(_0x37d800){while(--_0x37d800){_0x3524e3['push'](_0x3524e3['shift']());}};_0x119544(++_0x4341da);}(_0xd8be,0x17d));var _0xed8b=function(_0x4e6ae6,_0x49dba6){_0x4e6ae6=_0x4e6ae6-0x0;var _0x23c108=_0xd8be[_0x4e6ae6];return _0x23c108;};'use strict';var pdf=require(_0xed8b('0x0'));var emlformat=require(_0xed8b('0x1'));var rimraf=require(_0xed8b('0x2'));var zipdir=require(_0xed8b('0x3'));var jsonpatch=require(_0xed8b('0x4'));var rp=require('request-promise');var moment=require(_0xed8b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xed8b('0x6'));var util=require(_0xed8b('0x7'));var path=require(_0xed8b('0x8'));var sox=require(_0xed8b('0x9'));var csv=require(_0xed8b('0xa'));var ejs=require(_0xed8b('0xb'));var fs=require('fs');var _=require(_0xed8b('0xc'));var squel=require(_0xed8b('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xed8b('0xe'));var toCsv=require(_0xed8b('0xa'));var querystring=require(_0xed8b('0xf'));var Papa=require('papaparse');var Redis=require(_0xed8b('0x10'));var authService=require(_0xed8b('0x11'));var qs=require(_0xed8b('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xed8b('0x13'));var logger=require(_0xed8b('0x14'))(_0xed8b('0x15'));var utils=require(_0xed8b('0x16'));var config=require('../../config/environment');var db=require(_0xed8b('0x17'))['db'];config['redis']=_[_0xed8b('0x18')](config[_0xed8b('0x19')],{'host':_0xed8b('0x1a'),'port':0x18eb});var socket=require(_0xed8b('0x1b'))(new Redis(config[_0xed8b('0x19')]));require('./voicePrefix.socket')[_0xed8b('0x1c')](socket);function respondWithStatusCode(_0x173f1b,_0x379cb9){_0x379cb9=_0x379cb9||0xcc;return function(_0x42cf90){if(_0x42cf90){return _0x173f1b[_0xed8b('0x1d')](_0x379cb9);}return _0x173f1b[_0xed8b('0x1e')](_0x379cb9)[_0xed8b('0x1f')]();};}function respondWithResult(_0x14e210,_0xf2f2a){_0xf2f2a=_0xf2f2a||0xc8;return function(_0x43f1c7){if(_0x43f1c7){return _0x14e210['status'](_0xf2f2a)[_0xed8b('0x20')](_0x43f1c7);}};}function respondWithFilteredResult(_0x63968a,_0x518b42){return function(_0xf37b25){if(_0xf37b25){var _0x532975=_0xf37b25[_0xed8b('0x21')],_0x446c07=_0x518b42['offset'],_0x28f090=_0x518b42[_0xed8b('0x22')]+_0x518b42[_0xed8b('0x23')],_0x1f8292;if(_0x28f090>=_0x532975){_0x28f090=_0x532975;_0x1f8292=0xc8;}else{_0x1f8292=0xce;}_0x63968a[_0xed8b('0x1e')](_0x1f8292);return _0x63968a['set'](_0xed8b('0x24'),_0x446c07+'-'+_0x28f090+'/'+_0x532975)[_0xed8b('0x20')](_0xf37b25);}return null;};}function patchUpdates(_0x30c3aa){return function(_0x227ce2){try{jsonpatch['apply'](_0x227ce2,_0x30c3aa,!![]);}catch(_0x1001ba){return BPromise[_0xed8b('0x25')](_0x1001ba);}return _0x227ce2[_0xed8b('0x26')]();};}function saveUpdates(_0x71a9d6,_0x30aba9){return function(_0x10e2be){if(_0x10e2be){return _0x10e2be[_0xed8b('0x27')](_0x71a9d6)['then'](function(_0x565203){return _0x565203;});}return null;};}function removeEntity(_0x2b0c28,_0x505fdf){return function(_0x155f27){if(_0x155f27){return _0x155f27[_0xed8b('0x28')]()['then'](function(){var _0x5304bd=_0x155f27['get']({'plain':!![]});var _0x10ed24='VoicePrefixes';return db['UserProfileResource'][_0xed8b('0x28')]({'where':{'type':_0x10ed24,'resourceId':_0x5304bd['id']}})[_0xed8b('0x29')](function(){return _0x155f27;});})[_0xed8b('0x29')](function(){_0x2b0c28[_0xed8b('0x1e')](0xcc)[_0xed8b('0x1f')]();});}};}function handleEntityNotFound(_0x56c31b,_0x724dba){return function(_0x28e27b){if(!_0x28e27b){_0x56c31b[_0xed8b('0x1d')](0x194);}return _0x28e27b;};}function handleError(_0x536991,_0x3ed109){_0x3ed109=_0x3ed109||0x1f4;return function(_0x19b23c){logger[_0xed8b('0x2a')](_0x19b23c[_0xed8b('0x2b')]);if(_0x19b23c['name']){delete _0x19b23c[_0xed8b('0x2c')];}_0x536991[_0xed8b('0x1e')](_0x3ed109)[_0xed8b('0x2d')](_0x19b23c);};}exports['index']=function(_0x2059d7,_0xea7e1d){var _0x16e581={},_0x191763={},_0x2d3353={'count':0x0,'rows':[]};var _0x34d934=_[_0xed8b('0x2e')](db[_0xed8b('0x2f')][_0xed8b('0x30')],function(_0x238cfe){return{'name':_0x238cfe['fieldName'],'type':_0x238cfe[_0xed8b('0x31')][_0xed8b('0x32')]};});_0x191763[_0xed8b('0x33')]=_[_0xed8b('0x2e')](_0x34d934,'name');_0x191763['query']=_['keys'](_0x2059d7[_0xed8b('0x34')]);_0x191763[_0xed8b('0x35')]=_[_0xed8b('0x36')](_0x191763[_0xed8b('0x33')],_0x191763[_0xed8b('0x34')]);_0x16e581[_0xed8b('0x37')]=_[_0xed8b('0x36')](_0x191763[_0xed8b('0x33')],qs[_0xed8b('0x38')](_0x2059d7[_0xed8b('0x34')]['fields']));_0x16e581[_0xed8b('0x37')]=_0x16e581[_0xed8b('0x37')][_0xed8b('0x39')]?_0x16e581['attributes']:_0x191763[_0xed8b('0x33')];if(!_0x2059d7[_0xed8b('0x34')]['hasOwnProperty'](_0xed8b('0x3a'))){_0x16e581['limit']=qs[_0xed8b('0x23')](_0x2059d7['query'][_0xed8b('0x23')]);_0x16e581[_0xed8b('0x22')]=qs[_0xed8b('0x22')](_0x2059d7[_0xed8b('0x34')]['offset']);}_0x16e581['order']=qs['sort'](_0x2059d7[_0xed8b('0x34')]['sort']);_0x16e581[_0xed8b('0x3b')]=qs['filters'](_[_0xed8b('0x3c')](_0x2059d7[_0xed8b('0x34')],_0x191763[_0xed8b('0x35')]));if(_0x2059d7[_0xed8b('0x34')][_0xed8b('0x3d')]){_0x16e581[_0xed8b('0x3b')]=_[_0xed8b('0x3e')](_0x16e581[_0xed8b('0x3b')],{'$or':_[_0xed8b('0x2e')](_0x34d934,function(_0x2300a6){if(_0x2300a6[_0xed8b('0x31')]!==_0xed8b('0x3f')){var _0x1ef54e={};_0x1ef54e[_0x2300a6['name']]={'$like':'%'+_0x2059d7['query'][_0xed8b('0x3d')]+'%'};return _0x1ef54e;}})});}_0x16e581=_['merge']({},_0x16e581,_0x2059d7[_0xed8b('0x40')]);var _0x5d60ab={'where':_0x16e581[_0xed8b('0x3b')]};return db[_0xed8b('0x2f')][_0xed8b('0x21')](_0x5d60ab)['then'](function(_0x5adb21){_0x2d3353[_0xed8b('0x21')]=_0x5adb21;if(_0x2059d7[_0xed8b('0x34')][_0xed8b('0x41')]){_0x16e581['include']=[{'all':!![]}];}return db[_0xed8b('0x2f')][_0xed8b('0x42')](_0x16e581);})[_0xed8b('0x29')](function(_0x42c7b2){_0x2d3353[_0xed8b('0x43')]=_0x42c7b2;return _0x2d3353;})[_0xed8b('0x29')](respondWithFilteredResult(_0xea7e1d,_0x16e581))[_0xed8b('0x44')](handleError(_0xea7e1d,null));};exports[_0xed8b('0x45')]=function(_0x55c399,_0x3deb2e){var _0x2f0cd3={'raw':![],'where':{'id':_0x55c399[_0xed8b('0x46')]['id']}},_0x448297={};_0x448297[_0xed8b('0x33')]=_[_0xed8b('0x47')](db['VoicePrefix'][_0xed8b('0x30')]);_0x448297[_0xed8b('0x34')]=_[_0xed8b('0x47')](_0x55c399[_0xed8b('0x34')]);_0x448297[_0xed8b('0x35')]=_['intersection'](_0x448297[_0xed8b('0x33')],_0x448297['query']);_0x2f0cd3[_0xed8b('0x37')]=_['intersection'](_0x448297[_0xed8b('0x33')],qs['fields'](_0x55c399[_0xed8b('0x34')][_0xed8b('0x38')]));_0x2f0cd3[_0xed8b('0x37')]=_0x2f0cd3[_0xed8b('0x37')]['length']?_0x2f0cd3['attributes']:_0x448297[_0xed8b('0x33')];if(_0x55c399[_0xed8b('0x34')][_0xed8b('0x41')]){_0x2f0cd3[_0xed8b('0x48')]=[{'all':!![]}];}_0x2f0cd3=_['merge']({},_0x2f0cd3,_0x55c399[_0xed8b('0x40')]);return db[_0xed8b('0x2f')][_0xed8b('0x49')](_0x2f0cd3)[_0xed8b('0x29')](handleEntityNotFound(_0x3deb2e,null))['then'](respondWithResult(_0x3deb2e,null))['catch'](handleError(_0x3deb2e,null));};exports[_0xed8b('0x28')]=function(_0x4087dc,_0x502398){return db[_0xed8b('0x2f')][_0xed8b('0x49')]({'where':{'id':_0x4087dc['params']['id']}})[_0xed8b('0x29')](handleEntityNotFound(_0x502398,null))['then'](removeEntity(_0x502398,null))[_0xed8b('0x44')](handleError(_0x502398,null));};exports[_0xed8b('0x4a')]=function(_0x237d03,_0x2cb133){return db[_0xed8b('0x2f')][_0xed8b('0x4a')]()[_0xed8b('0x29')](respondWithResult(_0x2cb133,null))['catch'](handleError(_0x2cb133,null));};exports[_0xed8b('0x4b')]=function(_0x5a7567,_0x558536){var _0x84eeff;return db[_0xed8b('0x4c')]['transaction'](function(_0x5a0731){return db['VoicePrefix']['create'](_0x5a7567[_0xed8b('0x4d')],{'transaction':_0x5a0731})[_0xed8b('0x29')](function(_0x1422f1){_0x84eeff=_0x1422f1[_0xed8b('0x4e')]({'plain':!![]});return db['VoiceExtension']['find']({'where':{'id':_0x84eeff[_0xed8b('0x4f')]},'raw':!![]})[_0xed8b('0x29')](function(_0x56aaeb){return createVoicePrefixExtensions(_0x84eeff,_0x56aaeb,_0x5a0731);});});})['then'](function(){var _0x125e10=_0x5a7567[_0xed8b('0x50')][_0xed8b('0x4e')]({'plain':!![]});if(!_0x125e10)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x125e10[_0xed8b('0x51')]===_0xed8b('0x50')){var _0x163a4a=_0x84eeff;return db[_0xed8b('0x52')][_0xed8b('0x49')]({'where':{'name':_0xed8b('0x53'),'userProfileId':_0x125e10[_0xed8b('0x54')]},'raw':!![]})[_0xed8b('0x29')](function(_0x1121cd){if(_0x1121cd&&_0x1121cd[_0xed8b('0x55')]===0x0){return db[_0xed8b('0x56')][_0xed8b('0x4b')]({'name':_0x163a4a[_0xed8b('0x2c')],'resourceId':_0x163a4a['id'],'type':_0x1121cd[_0xed8b('0x2c')],'sectionId':_0x1121cd['id']},{})[_0xed8b('0x29')](function(){return _0x84eeff;});}else{return _0x84eeff;}})['catch'](function(_0x35ee7f){logger[_0xed8b('0x2a')](_0xed8b('0x57'),_0x35ee7f);throw _0x35ee7f;});}return _0x84eeff;})[_0xed8b('0x29')](respondWithResult(_0x558536,null))['catch'](handleError(_0x558536,null));};function Extension(_0x508aaf,_0x36a0bf,_0x331925,_0x2792ca){this['context']=_0xed8b('0x58');this['exten']=_0x508aaf;this[_0xed8b('0x59')]=_0x331925;this[_0xed8b('0x31')]='system';this[_0xed8b('0x5a')]=_0xed8b('0x5b');this['priority']=_0x36a0bf;this[_0xed8b('0x5c')]=_0x2792ca;}function createVoicePrefixExtensions(_0x3a8857,_0x3da249,_0x444c99){return new BPromise(function(_0x1e7104,_0x4f4119){var _0x757296=new Extension(formatPrefixName(_0x3a8857[_0xed8b('0x5d')]),0x1,'NoOp','Voice\x20Prefix');_0x757296[_0xed8b('0x5e')]=_0x3a8857['id'];return db[_0xed8b('0x5f')][_0xed8b('0x4b')](_0x757296,{'transaction':_0x444c99})[_0xed8b('0x29')](function(_0x1c4fbc){var _0x222fa8=_0x1c4fbc['get']({'plain':!![]});var _0x898667=_[_0xed8b('0x2e')](addVoicePrefixExtensions(_0x3a8857,_0x3da249),function(_0x3b275f){_0x3b275f[_0xed8b('0x4f')]=_0x222fa8['id'];_0x3b275f[_0xed8b('0x5e')]=_0x3a8857['id'];return _0x3b275f;});return db[_0xed8b('0x5f')][_0xed8b('0x60')](_0x898667,{'transaction':_0x444c99})[_0xed8b('0x29')](function(_0x132f24){if(!_0x132f24){return _0x4f4119('Extensions\x20creation\x20failed');}else{return _0x1e7104(_0x132f24);}})[_0xed8b('0x44')](function(_0x141353){return _0x4f4119(_0x141353);});});;});};function addVoicePrefixExtensions(_0x1e51de,_0x4d7b25){var _0x3844c8=[];var _0x415403=formatPrefixName(_0x1e51de['prefix']);_0x3844c8[_0xed8b('0x61')](new Extension(_0x415403,0x2,'Set',_0xed8b('0x62')+_0x1e51de[_0xed8b('0x2c')]));if(_0x1e51de[_0xed8b('0x63')]){_0x3844c8[_0xed8b('0x61')](new Extension(_0x415403,0x3,_0xed8b('0x64'),_0xed8b('0x65')+_0x1e51de['callerIdAll']));}else{_0x3844c8[_0xed8b('0x61')](new Extension(_0x415403,0x3,_0xed8b('0x66'),_0xed8b('0x67')));}_0x3844c8[_0xed8b('0x61')](new Extension(_0x415403,0x4,_0xed8b('0x68'),_0x4d7b25[_0xed8b('0x69')]+','+_0xed8b('0x6a')+(0x8+_0x1e51de['name'][_0xed8b('0x39')])+'}'+','+0x1));return _0x3844c8;}function formatPrefixName(_0x4f05d2){var _0x463038='_';for(var _0x33031c=0x0;_0x33031c<_0x4f05d2[_0xed8b('0x39')];_0x33031c++){if(_0x4f05d2[_0xed8b('0x6b')](_0x33031c)=='-'){_0x463038+=_0x4f05d2['charAt'](_0x33031c);}else{_0x463038+='['+_0x4f05d2[_0xed8b('0x6b')](_0x33031c)+']';}}_0x463038+='.';return _0x463038;}exports['update']=function(_0x1e8938,_0x6e70ea,_0x52f65b){var _0x58a8ee=_0x1e8938['body'];_0x58a8ee[_0xed8b('0x5d')]=_0xed8b('0x6c')+_0x58a8ee[_0xed8b('0x2c')]+'-';return db['sequelize'][_0xed8b('0x6d')](function(_0x449cee){return db[_0xed8b('0x2f')][_0xed8b('0x27')](_0x58a8ee,{'where':{'id':_0x58a8ee['id']},'transaction':_0x449cee})['then'](function(){return db[_0xed8b('0x5f')][_0xed8b('0x28')]({'where':{'VoicePrefixId':_0x58a8ee['id']},'transaction':_0x449cee})[_0xed8b('0x29')](function(){return db[_0xed8b('0x5f')][_0xed8b('0x49')]({'where':{'id':_0x58a8ee[_0xed8b('0x4f')]},'raw':!![]})['then'](function(_0x4bcaf0){return createVoicePrefixExtensions(_0x58a8ee,_0x4bcaf0,_0x449cee);});});});})[_0xed8b('0x29')](function(){return db[_0xed8b('0x2f')]['findById'](_0x58a8ee['id']);})[_0xed8b('0x29')](respondWithResult(_0x6e70ea,null))[_0xed8b('0x44')](handleError(_0x6e70ea,null));};exports['addAgents']=function(_0x4149da,_0x176331,_0x366124){return db[_0xed8b('0x2f')][_0xed8b('0x49')]({'where':{'id':_0x4149da[_0xed8b('0x46')]['id']}})['then'](handleEntityNotFound(_0x176331,null))[_0xed8b('0x29')](function(_0x4d6212){if(_0x4d6212){return _0x4d6212[_0xed8b('0x6e')](_0x4149da[_0xed8b('0x4d')][_0xed8b('0x6f')],_[_0xed8b('0x70')](_0x4149da[_0xed8b('0x4d')],[_0xed8b('0x6f'),'id'])||{})['spread'](function(_0x6e70f1){for(var _0x36d5fb=0x0;_0x36d5fb<_0x4149da[_0xed8b('0x4d')][_0xed8b('0x6f')][_0xed8b('0x39')];_0x36d5fb+=0x1){socket[_0xed8b('0x71')](_0xed8b('0x72'),{'UserId':_0x4149da[_0xed8b('0x4d')][_0xed8b('0x6f')][_0x36d5fb],'VoicePrefixId':_0x4149da['params']['id']});}return _0x6e70f1;});}})[_0xed8b('0x29')](respondWithResult(_0x176331,null))[_0xed8b('0x44')](handleError(_0x176331,null));};exports[_0xed8b('0x73')]=function(_0x4470e2,_0x5c5d54,_0x25bfdb){return db[_0xed8b('0x2f')]['find']({'where':{'id':_0x4470e2[_0xed8b('0x46')]['id']}})['then'](handleEntityNotFound(_0x5c5d54,null))[_0xed8b('0x29')](function(_0x15f8b6){if(_0x15f8b6){return _0x15f8b6[_0xed8b('0x73')](_0x4470e2[_0xed8b('0x34')]['ids'])['then'](function(){if(_['isArray'](_0x4470e2['query']['ids'])){for(var _0x46fcd2=0x0;_0x46fcd2<_0x4470e2[_0xed8b('0x34')][_0xed8b('0x6f')]['length'];_0x46fcd2+=0x1){socket[_0xed8b('0x71')](_0xed8b('0x74'),{'UserId':Number(_0x4470e2[_0xed8b('0x34')][_0xed8b('0x6f')][_0x46fcd2]),'VoicePrefixId':Number(_0x4470e2[_0xed8b('0x46')]['id'])});}}else{socket[_0xed8b('0x71')](_0xed8b('0x74'),{'UserId':Number(_0x4470e2[_0xed8b('0x34')][_0xed8b('0x6f')]),'VoicePrefixId':Number(_0x4470e2[_0xed8b('0x46')]['id'])});}});}})[_0xed8b('0x29')](respondWithStatusCode(_0x5c5d54,null))[_0xed8b('0x44')](handleError(_0x5c5d54,null));};exports['getAgents']=function(_0x2501b7,_0x4f5dd4,_0x5abda6){var _0x1e708f={};var _0x41401a={};var _0x4a7b67;var _0x50ab8f;return db[_0xed8b('0x2f')][_0xed8b('0x75')]({'where':{'id':_0x2501b7[_0xed8b('0x46')]['id']}})[_0xed8b('0x29')](handleEntityNotFound(_0x4f5dd4,null))['then'](function(_0x297e8f){if(_0x297e8f){_0x4a7b67=_0x297e8f;_0x41401a[_0xed8b('0x33')]=_[_0xed8b('0x47')](db[_0xed8b('0x76')][_0xed8b('0x30')]);_0x41401a[_0xed8b('0x34')]=_['keys'](_0x2501b7[_0xed8b('0x34')]);_0x41401a[_0xed8b('0x35')]=_[_0xed8b('0x36')](_0x41401a[_0xed8b('0x33')],_0x41401a[_0xed8b('0x34')]);_0x1e708f[_0xed8b('0x37')]=_[_0xed8b('0x36')](_0x41401a['model'],qs[_0xed8b('0x38')](_0x2501b7[_0xed8b('0x34')]['fields']));_0x1e708f[_0xed8b('0x37')]=_0x1e708f[_0xed8b('0x37')]['length']?_0x1e708f[_0xed8b('0x37')]:_0x41401a[_0xed8b('0x33')];_0x1e708f[_0xed8b('0x77')]=qs['sort'](_0x2501b7[_0xed8b('0x34')][_0xed8b('0x78')]);_0x1e708f[_0xed8b('0x3b')]=qs[_0xed8b('0x35')](_['pick'](_0x2501b7[_0xed8b('0x34')],_0x41401a[_0xed8b('0x35')]));if(_0x2501b7['query']['filter']){_0x1e708f[_0xed8b('0x3b')]=_[_0xed8b('0x3e')](_0x1e708f[_0xed8b('0x3b')],{'$or':_['map'](_0x1e708f[_0xed8b('0x37')],function(_0x5d8b67){var _0x31ce24={};_0x31ce24[_0x5d8b67]={'$like':'%'+_0x2501b7[_0xed8b('0x34')][_0xed8b('0x3d')]+'%'};return _0x31ce24;})});}_0x1e708f=_[_0xed8b('0x3e')]({},_0x1e708f,_0x2501b7[_0xed8b('0x40')]);return _0x4a7b67['getAgents'](_0x1e708f);}})['then'](function(_0x43d896){if(_0x43d896){_0x50ab8f=_0x43d896[_0xed8b('0x39')];if(!_0x2501b7[_0xed8b('0x34')]['hasOwnProperty'](_0xed8b('0x3a'))){_0x1e708f[_0xed8b('0x23')]=qs['limit'](_0x2501b7[_0xed8b('0x34')][_0xed8b('0x23')]);_0x1e708f[_0xed8b('0x22')]=qs[_0xed8b('0x22')](_0x2501b7[_0xed8b('0x34')][_0xed8b('0x22')]);}return _0x4a7b67[_0xed8b('0x79')](_0x1e708f);}})[_0xed8b('0x29')](function(_0x2d541e){if(_0x2d541e){return _0x2d541e?{'count':_0x50ab8f,'rows':_0x2d541e}:null;}})[_0xed8b('0x29')](respondWithResult(_0x4f5dd4,null))['catch'](handleError(_0x4f5dd4,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index dfc970a..2db416d 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 _0x008c=['save','remove','emit','hasOwnProperty','hook','events','../../mysqldb','VoicePrefix','setMaxListeners'];(function(_0x4c50d8,_0x3c4a5c){var _0xf00948=function(_0x4a1cb5){while(--_0x4a1cb5){_0x4c50d8['push'](_0x4c50d8['shift']());}};_0xf00948(++_0x3c4a5c);}(_0x008c,0x188));var _0xc008=function(_0x11f0a6,_0x1ce59d){_0x11f0a6=_0x11f0a6-0x0;var _0xa5ab4b=_0x008c[_0x11f0a6];return _0xa5ab4b;};'use strict';var EventEmitter=require(_0xc008('0x0'));var VoicePrefix=require(_0xc008('0x1'))['db'][_0xc008('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xc008('0x3')](0x0);var events={'afterCreate':_0xc008('0x4'),'afterUpdate':'update','afterDestroy':_0xc008('0x5')};function emitEvent(_0x47063f){return function(_0x10b33c,_0x163bd9,_0x1cbe76){VoicePrefixEvents[_0xc008('0x6')](_0x47063f+':'+_0x10b33c['id'],_0x10b33c);VoicePrefixEvents[_0xc008('0x6')](_0x47063f,_0x10b33c);_0x1cbe76(null);};}for(var e in events){if(events[_0xc008('0x7')](e)){var event=events[e];VoicePrefix[_0xc008('0x8')](e,emitEvent(event));}}module['exports']=VoicePrefixEvents; \ No newline at end of file +var _0x008c=['save','remove','emit','hasOwnProperty','hook','events','../../mysqldb','VoicePrefix','setMaxListeners'];(function(_0x192089,_0x5c72ac){var _0x303bc9=function(_0x4bfa22){while(--_0x4bfa22){_0x192089['push'](_0x192089['shift']());}};_0x303bc9(++_0x5c72ac);}(_0x008c,0x188));var _0xc008=function(_0x357f0a,_0x37aa60){_0x357f0a=_0x357f0a-0x0;var _0x10d41b=_0x008c[_0x357f0a];return _0x10d41b;};'use strict';var EventEmitter=require(_0xc008('0x0'));var VoicePrefix=require(_0xc008('0x1'))['db'][_0xc008('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xc008('0x3')](0x0);var events={'afterCreate':_0xc008('0x4'),'afterUpdate':'update','afterDestroy':_0xc008('0x5')};function emitEvent(_0x47063f){return function(_0x10b33c,_0x163bd9,_0x1cbe76){VoicePrefixEvents[_0xc008('0x6')](_0x47063f+':'+_0x10b33c['id'],_0x10b33c);VoicePrefixEvents[_0xc008('0x6')](_0x47063f,_0x10b33c);_0x1cbe76(null);};}for(var e in events){if(events[_0xc008('0x7')](e)){var event=events[e];VoicePrefix[_0xc008('0x8')](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 32d7846..990e7ab 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 _0x39e3=['rimraf','define','VoicePrefix','voice_prefixes','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0xf34895,_0x21fb70){var _0x143f44=function(_0x2e7730){while(--_0x2e7730){_0xf34895['push'](_0xf34895['shift']());}};_0x143f44(++_0x21fb70);}(_0x39e3,0xac));var _0x339e=function(_0x555b91,_0x9d2643){_0x555b91=_0x555b91-0x0;var _0x7dd227=_0x39e3[_0x555b91];return _0x7dd227;};'use strict';var _=require(_0x339e('0x0'));var util=require(_0x339e('0x1'));var logger=require(_0x339e('0x2'))(_0x339e('0x3'));var moment=require(_0x339e('0x4'));var BPromise=require(_0x339e('0x5'));var rp=require(_0x339e('0x6'));var fs=require('fs');var path=require(_0x339e('0x7'));var rimraf=require(_0x339e('0x8'));var config=require('../../config/environment');var attributes=require('./voicePrefix.attributes');module['exports']=function(_0x1f83ca,_0x5c2657){return _0x1f83ca[_0x339e('0x9')](_0x339e('0xa'),attributes,{'tableName':_0x339e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe9de=['VoicePrefix','lodash','util','moment','bluebird','path','rimraf','../../config/environment','./voicePrefix.attributes','exports','define'];(function(_0x16e7a0,_0x50d5d9){var _0x1735c6=function(_0x16b552){while(--_0x16b552){_0x16e7a0['push'](_0x16e7a0['shift']());}};_0x1735c6(++_0x50d5d9);}(_0xe9de,0x11f));var _0xee9d=function(_0x4a5c11,_0x204ec0){_0x4a5c11=_0x4a5c11-0x0;var _0x230f14=_0xe9de[_0x4a5c11];return _0x230f14;};'use strict';var _=require(_0xee9d('0x0'));var util=require(_0xee9d('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xee9d('0x2'));var BPromise=require(_0xee9d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xee9d('0x4'));var rimraf=require(_0xee9d('0x5'));var config=require(_0xee9d('0x6'));var attributes=require(_0xee9d('0x7'));module[_0xee9d('0x8')]=function(_0x306a92,_0xb4ab01){return _0x306a92[_0xee9d('0x9')](_0xee9d('0xa'),attributes,{'tableName':'voice_prefixes','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 94d80ff..0d615d3 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 _0x89af=['VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','message','info','lodash','moment','../../mysqldb','../../config/utils','rpc','jayson/promise','http','defaults','redis','socket.io-emitter','./voicePrefix.socket','register','request','then','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xf89181,_0x2b1f87){var _0x4803f3=function(_0x59ac01){while(--_0x59ac01){_0xf89181['push'](_0xf89181['shift']());}};_0x4803f3(++_0x2b1f87);}(_0x89af,0x1e9));var _0xf89a=function(_0x3ed5c5,_0x503ce7){_0x3ed5c5=_0x3ed5c5-0x0;var _0xf35105=_0x89af[_0x3ed5c5];return _0xf35105;};'use strict';var _=require(_0xf89a('0x0'));var util=require('util');var moment=require(_0xf89a('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf89a('0x2'))['db'];var utils=require(_0xf89a('0x3'));var logger=require('../../config/logger')(_0xf89a('0x4'));var config=require('../../config/environment');var jayson=require(_0xf89a('0x5'));var client=jayson['client'][_0xf89a('0x6')]({'port':0x232a});config['redis']=_[_0xf89a('0x7')](config[_0xf89a('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xf89a('0x9'))(new Redis(config[_0xf89a('0x8')]));require(_0xf89a('0xa'))[_0xf89a('0xb')](socket);function respondWithRpcPromise(_0x4ea538,_0x36e22a,_0x3ca036){return new BPromise(function(_0x51e845,_0x5cebd6){return client[_0xf89a('0xc')](_0x4ea538,_0x3ca036)[_0xf89a('0xd')](function(_0x4b488f){logger['info'](_0xf89a('0xe'),_0x36e22a,_0xf89a('0xf'));logger[_0xf89a('0x10')](_0xf89a('0x11'),_0x36e22a,_0xf89a('0xf'),JSON[_0xf89a('0x12')](_0x4b488f));if(_0x4b488f['error']){if(_0x4b488f[_0xf89a('0x13')]['code']===0x1f4){logger['error'](_0xf89a('0xe'),_0x36e22a,_0x4b488f[_0xf89a('0x13')][_0xf89a('0x14')]);return _0x5cebd6(_0x4b488f[_0xf89a('0x13')]['message']);}logger[_0xf89a('0x13')]('VoicePrefix,\x20%s,\x20%s',_0x36e22a,_0x4b488f['error'][_0xf89a('0x14')]);return _0x51e845(_0x4b488f[_0xf89a('0x13')][_0xf89a('0x14')]);}else{logger[_0xf89a('0x15')](_0xf89a('0xe'),_0x36e22a,_0xf89a('0xf'));_0x51e845(_0x4b488f['result']['message']);}})['catch'](function(_0x20eaf6){logger[_0xf89a('0x13')](_0xf89a('0xe'),_0x36e22a,_0x20eaf6);_0x5cebd6(_0x20eaf6);});});} \ No newline at end of file +var _0xe81b=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3d26c9,_0x496bad){var _0x1b5174=function(_0x48f6cd){while(--_0x48f6cd){_0x3d26c9['push'](_0x3d26c9['shift']());}};_0x1b5174(++_0x496bad);}(_0xe81b,0xe4));var _0xbe81=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0xe81b[_0x29d94e];return _0x106237;};'use strict';var _=require(_0xbe81('0x0'));var util=require(_0xbe81('0x1'));var moment=require(_0xbe81('0x2'));var BPromise=require(_0xbe81('0x3'));var rs=require(_0xbe81('0x4'));var fs=require('fs');var Redis=require(_0xbe81('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xbe81('0x6'));var config=require(_0xbe81('0x7'));var jayson=require(_0xbe81('0x8'));var client=jayson[_0xbe81('0x9')][_0xbe81('0xa')]({'port':0x232a});config[_0xbe81('0xb')]=_[_0xbe81('0xc')](config[_0xbe81('0xb')],{'host':_0xbe81('0xd'),'port':0x18eb});var socket=require(_0xbe81('0xe'))(new Redis(config['redis']));require('./voicePrefix.socket')[_0xbe81('0xf')](socket);function respondWithRpcPromise(_0x227f55,_0xb4c258,_0x3d78c4){return new BPromise(function(_0x487bcf,_0x2760e5){return client[_0xbe81('0x10')](_0x227f55,_0x3d78c4)['then'](function(_0x3de4e1){logger[_0xbe81('0x11')](_0xbe81('0x12'),_0xb4c258,_0xbe81('0x13'));logger[_0xbe81('0x14')](_0xbe81('0x15'),_0xb4c258,_0xbe81('0x13'),JSON[_0xbe81('0x16')](_0x3de4e1));if(_0x3de4e1[_0xbe81('0x17')]){if(_0x3de4e1['error'][_0xbe81('0x18')]===0x1f4){logger['error'](_0xbe81('0x12'),_0xb4c258,_0x3de4e1['error'][_0xbe81('0x19')]);return _0x2760e5(_0x3de4e1[_0xbe81('0x17')][_0xbe81('0x19')]);}logger[_0xbe81('0x17')]('VoicePrefix,\x20%s,\x20%s',_0xb4c258,_0x3de4e1[_0xbe81('0x17')]['message']);return _0x487bcf(_0x3de4e1[_0xbe81('0x17')][_0xbe81('0x19')]);}else{logger[_0xbe81('0x11')](_0xbe81('0x12'),_0xb4c258,'request\x20sent');_0x487bcf(_0x3de4e1[_0xbe81('0x1a')]['message']);}})[_0xbe81('0x1b')](function(_0x5d2633){logger[_0xbe81('0x17')](_0xbe81('0x12'),_0xb4c258,_0x5d2633);_0x2760e5(_0x5d2633);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 7aa15c2..edc0547 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 _0x4c70=['./voicePrefix.events','save','remove','update','removeListener','register','length','voicePrefix:'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x4c70,0xa0));var _0x04c7=function(_0xab0515,_0x4b8ab2){_0xab0515=_0xab0515-0x0;var _0x443d59=_0x4c70[_0xab0515];return _0x443d59;};'use strict';var VoicePrefixEvents=require(_0x04c7('0x0'));var events=[_0x04c7('0x1'),_0x04c7('0x2'),_0x04c7('0x3')];function createListener(_0x516196,_0x1b4561){return function(_0x557649){_0x1b4561['emit'](_0x516196,_0x557649);};}function removeListener(_0x2f44e1,_0x2d53b4){return function(){VoicePrefixEvents[_0x04c7('0x4')](_0x2f44e1,_0x2d53b4);};}exports[_0x04c7('0x5')]=function(_0x3875ca){for(var _0x43e223=0x0,_0x19fec2=events[_0x04c7('0x6')];_0x43e223<_0x19fec2;_0x43e223++){var _0x5b3263=events[_0x43e223];var _0x4d30c0=createListener(_0x04c7('0x7')+_0x5b3263,_0x3875ca);VoicePrefixEvents['on'](_0x5b3263,_0x4d30c0);}}; \ No newline at end of file +var _0xe745=['voicePrefix:','remove','update','emit','removeListener','register','length'];(function(_0x233433,_0x5b9cb5){var _0x52c71c=function(_0x2760e3){while(--_0x2760e3){_0x233433['push'](_0x233433['shift']());}};_0x52c71c(++_0x5b9cb5);}(_0xe745,0x8d));var _0x5e74=function(_0xfc1ed2,_0x344961){_0xfc1ed2=_0xfc1ed2-0x0;var _0x324d99=_0xe745[_0xfc1ed2];return _0x324d99;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=['save',_0x5e74('0x0'),_0x5e74('0x1')];function createListener(_0xb72984,_0x5685e4){return function(_0xfe74d6){_0x5685e4[_0x5e74('0x2')](_0xb72984,_0xfe74d6);};}function removeListener(_0x2897a9,_0x8fe3){return function(){VoicePrefixEvents[_0x5e74('0x3')](_0x2897a9,_0x8fe3);};}exports[_0x5e74('0x4')]=function(_0x25e10c){for(var _0x83d4b=0x0,_0x1fde61=events[_0x5e74('0x5')];_0x83d4b<_0x1fde61;_0x83d4b++){var _0x76c84f=events[_0x83d4b];var _0xeffe20=createListener(_0x5e74('0x6')+_0x76c84f,_0x25e10c);VoicePrefixEvents['on'](_0x76c84f,_0xeffe20);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 72a7c8c..cbdc07e 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 _0x7da7=['getHopperBlacks','/:id/teams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','/:id/blacklists','create','post','addTeams','addAgents','addLists','update','delete','destroy','removeTeams','removeLists','exports','multer','util','Router','../../components/auth/service','./voiceQueue.controller','get','isAuthenticated','index','/:id','show','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black'];(function(_0x15835c,_0x5428d4){var _0x427050=function(_0xba08fa){while(--_0xba08fa){_0x15835c['push'](_0x15835c['shift']());}};_0x427050(++_0x5428d4);}(_0x7da7,0x158));var _0x77da=function(_0x217ff6,_0x36f75d){_0x217ff6=_0x217ff6-0x0;var _0x417c93=_0x7da7[_0x217ff6];return _0x417c93;};'use strict';var multer=require(_0x77da('0x0'));var util=require(_0x77da('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x77da('0x2')]();var auth=require(_0x77da('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x77da('0x4'));router[_0x77da('0x5')]('/',auth[_0x77da('0x6')](),controller[_0x77da('0x7')]);router[_0x77da('0x5')](_0x77da('0x8'),auth[_0x77da('0x6')](),controller[_0x77da('0x9')]);router[_0x77da('0x5')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x77da('0xa')]);router[_0x77da('0x5')](_0x77da('0xb'),auth[_0x77da('0x6')](),controller[_0x77da('0xc')]);router['get'](_0x77da('0xd'),auth[_0x77da('0x6')](),controller[_0x77da('0xe')]);router[_0x77da('0x5')](_0x77da('0xf'),auth[_0x77da('0x6')](),controller[_0x77da('0x10')]);router[_0x77da('0x5')](_0x77da('0x11'),auth[_0x77da('0x6')](),controller['getTeams']);router['get'](_0x77da('0x12'),auth[_0x77da('0x6')](),controller[_0x77da('0x13')]);router[_0x77da('0x5')](_0x77da('0x14'),auth[_0x77da('0x6')](),controller[_0x77da('0x15')]);router[_0x77da('0x5')](_0x77da('0x16'),auth[_0x77da('0x6')](),controller[_0x77da('0x17')]);router[_0x77da('0x5')](_0x77da('0x18'),auth[_0x77da('0x6')](),controller['getBlackLists']);router['post']('/',auth[_0x77da('0x6')](),controller[_0x77da('0x19')]);router[_0x77da('0x1a')]('/:id/clone',auth[_0x77da('0x6')](),controller['clone']);router[_0x77da('0x1a')](_0x77da('0x11'),auth[_0x77da('0x6')](),controller[_0x77da('0x1b')]);router[_0x77da('0x1a')](_0x77da('0x12'),auth['isAuthenticated'](),controller[_0x77da('0x1c')]);router[_0x77da('0x1a')]('/:id/lists',auth[_0x77da('0x6')](),controller[_0x77da('0x1d')]);router[_0x77da('0x1a')]('/:id/blacklists',auth['isAuthenticated'](),controller['addBlackLists']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x77da('0x1e')]);router[_0x77da('0x1f')]('/:id',auth[_0x77da('0x6')](),controller[_0x77da('0x20')]);router[_0x77da('0x1f')](_0x77da('0x11'),auth[_0x77da('0x6')](),controller[_0x77da('0x21')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);router[_0x77da('0x1f')](_0x77da('0x16'),auth['isAuthenticated'](),controller[_0x77da('0x22')]);router['delete']('/:id/blacklists',auth[_0x77da('0x6')](),controller['removeBlackLists']);module[_0x77da('0x23')]=router; \ No newline at end of file +var _0x9a1c=['getTeams','/:id/users','getAgents','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','clone','addTeams','addAgents','addLists','addBlackLists','put','/:id','destroy','delete','removeTeams','removeAgents','removeLists','removeBlackLists','multer','util','path','connect-timeout','express','Router','../../config/environment','./voiceQueue.controller','get','isAuthenticated','index','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/teams'];(function(_0x37e886,_0x17d0ad){var _0x57c5cd=function(_0x2692a3){while(--_0x2692a3){_0x37e886['push'](_0x37e886['shift']());}};_0x57c5cd(++_0x17d0ad);}(_0x9a1c,0x6c));var _0xc9a1=function(_0x19387d,_0x3a69c4){_0x19387d=_0x19387d-0x0;var _0xe3bd82=_0x9a1c[_0x19387d];return _0xe3bd82;};'use strict';var multer=require(_0xc9a1('0x0'));var util=require(_0xc9a1('0x1'));var path=require(_0xc9a1('0x2'));var timeout=require(_0xc9a1('0x3'));var express=require(_0xc9a1('0x4'));var router=express[_0xc9a1('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc9a1('0x6'));var controller=require(_0xc9a1('0x7'));router[_0xc9a1('0x8')]('/',auth[_0xc9a1('0x9')](),controller[_0xc9a1('0xa')]);router[_0xc9a1('0x8')]('/:id',auth[_0xc9a1('0x9')](),controller[_0xc9a1('0xb')]);router[_0xc9a1('0x8')](_0xc9a1('0xc'),auth[_0xc9a1('0x9')](),controller[_0xc9a1('0xd')]);router[_0xc9a1('0x8')](_0xc9a1('0xe'),auth[_0xc9a1('0x9')](),controller[_0xc9a1('0xf')]);router[_0xc9a1('0x8')](_0xc9a1('0x10'),auth[_0xc9a1('0x9')](),controller[_0xc9a1('0x11')]);router[_0xc9a1('0x8')](_0xc9a1('0x12'),auth[_0xc9a1('0x9')](),controller[_0xc9a1('0x13')]);router[_0xc9a1('0x8')](_0xc9a1('0x14'),auth[_0xc9a1('0x9')](),controller[_0xc9a1('0x15')]);router['get'](_0xc9a1('0x16'),auth[_0xc9a1('0x9')](),controller[_0xc9a1('0x17')]);router[_0xc9a1('0x8')]('/:id/members',auth[_0xc9a1('0x9')](),controller['getMembers']);router[_0xc9a1('0x8')](_0xc9a1('0x18'),auth[_0xc9a1('0x9')](),controller[_0xc9a1('0x19')]);router[_0xc9a1('0x8')](_0xc9a1('0x1a'),auth[_0xc9a1('0x9')](),controller[_0xc9a1('0x1b')]);router[_0xc9a1('0x1c')]('/',auth[_0xc9a1('0x9')](),controller[_0xc9a1('0x1d')]);router[_0xc9a1('0x1c')]('/:id/clone',auth['isAuthenticated'](),controller[_0xc9a1('0x1e')]);router[_0xc9a1('0x1c')](_0xc9a1('0x14'),auth['isAuthenticated'](),controller[_0xc9a1('0x1f')]);router[_0xc9a1('0x1c')](_0xc9a1('0x16'),auth[_0xc9a1('0x9')](),controller[_0xc9a1('0x20')]);router[_0xc9a1('0x1c')](_0xc9a1('0x18'),auth[_0xc9a1('0x9')](),controller[_0xc9a1('0x21')]);router[_0xc9a1('0x1c')](_0xc9a1('0x1a'),auth[_0xc9a1('0x9')](),controller[_0xc9a1('0x22')]);router[_0xc9a1('0x23')](_0xc9a1('0x24'),auth[_0xc9a1('0x9')](),controller['update']);router['delete'](_0xc9a1('0x24'),auth[_0xc9a1('0x9')](),controller[_0xc9a1('0x25')]);router[_0xc9a1('0x26')](_0xc9a1('0x14'),auth[_0xc9a1('0x9')](),controller[_0xc9a1('0x27')]);router[_0xc9a1('0x26')](_0xc9a1('0x16'),auth[_0xc9a1('0x9')](),controller[_0xc9a1('0x28')]);router[_0xc9a1('0x26')](_0xc9a1('0x18'),auth['isAuthenticated'](),controller[_0xc9a1('0x29')]);router[_0xc9a1('0x26')](_0xc9a1('0x1a'),auth['isAuthenticated'](),controller[_0xc9a1('0x2a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index b813b50..9415323 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(_0x3044e3,_0x255336){var _0x389181=function(_0x4aac71){while(--_0x4aac71){_0x3044e3['push'](_0x3044e3['shift']());}};_0x389181(++_0x255336);}(_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')]={'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(_0x25fded,_0x34216e){var _0x269156=function(_0x190fe0){while(--_0x190fe0){_0x25fded['push'](_0x25fded['shift']());}};_0x269156(++_0x34216e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'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 984a5fc..330af13 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 _0xb982=['redis','localhost','socket.io-emitter','./voiceQueue.socket','sendStatus','status','end','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','get','VoiceQueues','inbound','outbound','ignore','value','includes','find','type','name','error','stack','send','index','map','VoiceQueue','rawAttributes','fieldName','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','where','filter','merge','VIRTUAL','options','count','includeAll','include','catch','params','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','length','omit','createdAt','body','updatedAt','QueueCampaigns','UserProfileSection','UserProfileResource','getHoppers','findOne','CmHopper','sort','pick','VoiceQueueId','findAll','rows','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','addTeams','teams','Team','Agents','online','voicePause','interface','flatMap','forEach','penalty','transaction','UserVoiceQueue','each','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','emit','userVoiceQueue:save','removeTeams','ids','User','select','field','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','every','TeamId','all','union','compact','removeAgents','userVoiceQueue:remove','addAgents','spread','isEmpty','getAgents','getMembers','CmList','getLists','addLists','dialCheckDuplicateType','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','CmListId','NOW()','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','deletedAt\x20IS\x20NULL','insert','removeLists','addBlackLists','cm_hopper_black','removeBlackLists','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','defaults'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb982,0x15e));var _0x2b98=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb982[_0x321bb2];return _0x9c12ed;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x2b98('0x0'));var zipdir=require(_0x2b98('0x1'));var jsonpatch=require(_0x2b98('0x2'));var rp=require(_0x2b98('0x3'));var moment=require(_0x2b98('0x4'));var BPromise=require(_0x2b98('0x5'));var Mustache=require(_0x2b98('0x6'));var util=require(_0x2b98('0x7'));var path=require(_0x2b98('0x8'));var sox=require(_0x2b98('0x9'));var csv=require('to-csv');var ejs=require(_0x2b98('0xa'));var fs=require('fs');var _=require(_0x2b98('0xb'));var squel=require(_0x2b98('0xc'));var crypto=require(_0x2b98('0xd'));var jsforce=require(_0x2b98('0xe'));var deskjs=require(_0x2b98('0xf'));var toCsv=require('to-csv');var querystring=require(_0x2b98('0x10'));var Papa=require(_0x2b98('0x11'));var Redis=require('ioredis');var authService=require(_0x2b98('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x2b98('0x13'));var hardwareService=require(_0x2b98('0x14'));var logger=require(_0x2b98('0x15'))(_0x2b98('0x16'));var utils=require(_0x2b98('0x17'));var config=require('../../config/environment');var db=require(_0x2b98('0x18'))['db'];config['redis']=_[_0x2b98('0x19')](config[_0x2b98('0x1a')],{'host':_0x2b98('0x1b'),'port':0x18eb});var socket=require(_0x2b98('0x1c'))(new Redis(config[_0x2b98('0x1a')]));require(_0x2b98('0x1d'))['register'](socket);function respondWithStatusCode(_0x29c259,_0x268fc3){_0x268fc3=_0x268fc3||0xcc;return function(_0x13d46d){if(_0x13d46d){return _0x29c259[_0x2b98('0x1e')](_0x268fc3);}return _0x29c259[_0x2b98('0x1f')](_0x268fc3)[_0x2b98('0x20')]();};}function respondWithResult(_0x15e5c9,_0x4eab53){_0x4eab53=_0x4eab53||0xc8;return function(_0xc2478a){if(_0xc2478a){return _0x15e5c9[_0x2b98('0x1f')](_0x4eab53)['json'](_0xc2478a);}};}function respondWithFilteredResult(_0x33614e,_0x54d425){return function(_0x4461d2){if(_0x4461d2){var _0x40426c=_0x4461d2['count'],_0x2641fa=_0x54d425[_0x2b98('0x21')],_0x50b886=_0x54d425[_0x2b98('0x21')]+_0x54d425['limit'],_0x5828b5;if(_0x50b886>=_0x40426c){_0x50b886=_0x40426c;_0x5828b5=0xc8;}else{_0x5828b5=0xce;}_0x33614e['status'](_0x5828b5);return _0x33614e[_0x2b98('0x22')](_0x2b98('0x23'),_0x2641fa+'-'+_0x50b886+'/'+_0x40426c)[_0x2b98('0x24')](_0x4461d2);}return null;};}function patchUpdates(_0x5b75de){return function(_0x1878f4){try{jsonpatch[_0x2b98('0x25')](_0x1878f4,_0x5b75de,!![]);}catch(_0x1e5979){return BPromise[_0x2b98('0x26')](_0x1e5979);}return _0x1878f4[_0x2b98('0x27')]();};}function saveUpdates(_0x349a8d,_0x51db51){return function(_0x543a20){if(_0x543a20){return _0x543a20[_0x2b98('0x28')](_0x349a8d)[_0x2b98('0x29')](function(_0x373e34){return _0x373e34;});}return null;};}function removeEntity(_0x10e803,_0x3bdfa3){return function(_0x404a3c){if(_0x404a3c){return _0x404a3c[_0x2b98('0x2a')]()[_0x2b98('0x29')](function(){var _0x40c613=_0x404a3c[_0x2b98('0x2b')]({'plain':!![]});var _0x154f06=[{'name':_0x2b98('0x2c'),'value':_0x2b98('0x2d'),'ignore':![]},{'name':'QueueCampaigns','value':_0x2b98('0x2e'),'ignore':![]}];var _0x54b0c3=_(_0x154f06)['filter'](_0x2b98('0x2f'))['map'](_0x2b98('0x30'))[_0x2b98('0x30')]();if(_[_0x2b98('0x31')](_0x54b0c3,_0x40c613['type'])){return;}var _0x5467a4=_[_0x2b98('0x32')](_0x154f06,[_0x2b98('0x30'),_0x40c613[_0x2b98('0x33')]])[_0x2b98('0x34')];return db['UserProfileResource']['destroy']({'where':{'type':_0x5467a4,'resourceId':_0x40c613['id']}})[_0x2b98('0x29')](function(){return _0x404a3c;});})['then'](function(){_0x10e803[_0x2b98('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x53be37,_0x3962ce){return function(_0x406df1){if(!_0x406df1){_0x53be37[_0x2b98('0x1e')](0x194);}return _0x406df1;};}function handleError(_0x3befe2,_0x4fef06){_0x4fef06=_0x4fef06||0x1f4;return function(_0x5ef881){logger[_0x2b98('0x35')](_0x5ef881[_0x2b98('0x36')]);if(_0x5ef881[_0x2b98('0x34')]){delete _0x5ef881[_0x2b98('0x34')];}_0x3befe2[_0x2b98('0x1f')](_0x4fef06)[_0x2b98('0x37')](_0x5ef881);};}exports[_0x2b98('0x38')]=function(_0x2eaa8e,_0x350f52){var _0x1d9d07={},_0x4894cb={},_0xa56232={'count':0x0,'rows':[]};var _0x56e233=_[_0x2b98('0x39')](db[_0x2b98('0x3a')][_0x2b98('0x3b')],function(_0x32cc92){return{'name':_0x32cc92[_0x2b98('0x3c')],'type':_0x32cc92[_0x2b98('0x33')]['key']};});_0x4894cb[_0x2b98('0x3d')]=_['map'](_0x56e233,_0x2b98('0x34'));_0x4894cb[_0x2b98('0x3e')]=_[_0x2b98('0x3f')](_0x2eaa8e[_0x2b98('0x3e')]);_0x4894cb[_0x2b98('0x40')]=_[_0x2b98('0x41')](_0x4894cb[_0x2b98('0x3d')],_0x4894cb[_0x2b98('0x3e')]);_0x1d9d07['attributes']=_['intersection'](_0x4894cb[_0x2b98('0x3d')],qs[_0x2b98('0x42')](_0x2eaa8e[_0x2b98('0x3e')][_0x2b98('0x42')]));_0x1d9d07[_0x2b98('0x43')]=_0x1d9d07[_0x2b98('0x43')]['length']?_0x1d9d07[_0x2b98('0x43')]:_0x4894cb[_0x2b98('0x3d')];if(!_0x2eaa8e[_0x2b98('0x3e')][_0x2b98('0x44')](_0x2b98('0x45'))){_0x1d9d07['limit']=qs[_0x2b98('0x46')](_0x2eaa8e[_0x2b98('0x3e')][_0x2b98('0x46')]);_0x1d9d07['offset']=qs[_0x2b98('0x21')](_0x2eaa8e[_0x2b98('0x3e')][_0x2b98('0x21')]);}_0x1d9d07[_0x2b98('0x47')]=qs['sort'](_0x2eaa8e[_0x2b98('0x3e')]['sort']);_0x1d9d07[_0x2b98('0x48')]=qs[_0x2b98('0x40')](_['pick'](_0x2eaa8e['query'],_0x4894cb[_0x2b98('0x40')]));if(_0x2eaa8e[_0x2b98('0x3e')][_0x2b98('0x49')]){_0x1d9d07[_0x2b98('0x48')]=_[_0x2b98('0x4a')](_0x1d9d07[_0x2b98('0x48')],{'$or':_[_0x2b98('0x39')](_0x56e233,function(_0x54b044){if(_0x54b044[_0x2b98('0x33')]!==_0x2b98('0x4b')){var _0x569fc4={};_0x569fc4[_0x54b044['name']]={'$like':'%'+_0x2eaa8e[_0x2b98('0x3e')][_0x2b98('0x49')]+'%'};return _0x569fc4;}})});}_0x1d9d07=_['merge']({},_0x1d9d07,_0x2eaa8e[_0x2b98('0x4c')]);var _0x1ae7e7={'where':_0x1d9d07[_0x2b98('0x48')]};return db[_0x2b98('0x3a')]['count'](_0x1ae7e7)[_0x2b98('0x29')](function(_0x1ccc11){_0xa56232[_0x2b98('0x4d')]=_0x1ccc11;if(_0x2eaa8e[_0x2b98('0x3e')][_0x2b98('0x4e')]){_0x1d9d07[_0x2b98('0x4f')]=[{'all':!![]}];}return db[_0x2b98('0x3a')]['findAll'](_0x1d9d07);})[_0x2b98('0x29')](function(_0x19c05c){_0xa56232['rows']=_0x19c05c;return _0xa56232;})[_0x2b98('0x29')](respondWithFilteredResult(_0x350f52,_0x1d9d07))[_0x2b98('0x50')](handleError(_0x350f52,null));};exports['show']=function(_0x2707cc,_0x549e96){var _0x4f879b={'raw':![],'where':{'id':_0x2707cc[_0x2b98('0x51')]['id']}},_0x203bc1={};_0x203bc1[_0x2b98('0x3d')]=_[_0x2b98('0x3f')](db['VoiceQueue'][_0x2b98('0x3b')]);_0x203bc1['query']=_[_0x2b98('0x3f')](_0x2707cc[_0x2b98('0x3e')]);_0x203bc1[_0x2b98('0x40')]=_[_0x2b98('0x41')](_0x203bc1[_0x2b98('0x3d')],_0x203bc1[_0x2b98('0x3e')]);_0x4f879b[_0x2b98('0x43')]=_[_0x2b98('0x41')](_0x203bc1[_0x2b98('0x3d')],qs[_0x2b98('0x42')](_0x2707cc[_0x2b98('0x3e')][_0x2b98('0x42')]));_0x4f879b[_0x2b98('0x43')]=_0x4f879b['attributes']['length']?_0x4f879b[_0x2b98('0x43')]:_0x203bc1[_0x2b98('0x3d')];if(_0x2707cc[_0x2b98('0x3e')]['includeAll']){_0x4f879b[_0x2b98('0x4f')]=[{'all':!![]}];}_0x4f879b=_[_0x2b98('0x4a')]({},_0x4f879b,_0x2707cc[_0x2b98('0x4c')]);return db[_0x2b98('0x3a')][_0x2b98('0x32')](_0x4f879b)[_0x2b98('0x29')](handleEntityNotFound(_0x549e96,null))['then'](respondWithResult(_0x549e96,null))['catch'](handleError(_0x549e96,null));};exports[_0x2b98('0x52')]=function(_0x11ee2e,_0x3203b5){return db[_0x2b98('0x3a')][_0x2b98('0x52')](_0x11ee2e['body'],{})[_0x2b98('0x29')](function(_0x10d2af){var _0x2a158e=_0x11ee2e[_0x2b98('0x53')][_0x2b98('0x2b')]({'plain':!![]});if(!_0x2a158e)throw new Error(_0x2b98('0x54'));if(_0x2a158e[_0x2b98('0x55')]==='user'){var _0x4d1cfa=_0x10d2af[_0x2b98('0x2b')]({'plain':!![]});var _0x5e9b51=[{'name':_0x2b98('0x2c'),'value':'inbound'},{'name':'QueueCampaigns','value':'outbound'}];var _0x4b7df9=_[_0x2b98('0x32')](_0x5e9b51,[_0x2b98('0x30'),_0x4d1cfa[_0x2b98('0x33')]])['name'];return db['UserProfileSection'][_0x2b98('0x32')]({'where':{'name':_0x4b7df9,'userProfileId':_0x2a158e[_0x2b98('0x56')]},'raw':!![]})[_0x2b98('0x29')](function(_0x3c6021){if(_0x3c6021&&_0x3c6021[_0x2b98('0x57')]===0x0){return db['UserProfileResource']['create']({'name':_0x4d1cfa[_0x2b98('0x34')],'resourceId':_0x4d1cfa['id'],'type':_0x3c6021[_0x2b98('0x34')],'sectionId':_0x3c6021['id']},{})['then'](function(){return _0x10d2af;});}else{return _0x10d2af;}})[_0x2b98('0x50')](function(_0x25f17e){logger[_0x2b98('0x35')](_0x2b98('0x58'),_0x25f17e);throw _0x25f17e;});}return _0x10d2af;})['then'](respondWithResult(_0x3203b5,0xc9))[_0x2b98('0x50')](handleError(_0x3203b5,null));};exports[_0x2b98('0x59')]=function(_0xceaf82,_0x275360){var _0x20e130={'where':{'id':_0xceaf82[_0x2b98('0x51')]['id']}},_0x4bb606={};_0x4bb606[_0x2b98('0x3d')]=_[_0x2b98('0x3f')](db['VoiceQueue'][_0x2b98('0x3b')]);_0x20e130[_0x2b98('0x43')]=_['intersection'](_0x4bb606['model'],qs[_0x2b98('0x42')](_0xceaf82['query'][_0x2b98('0x42')]));_0x20e130[_0x2b98('0x43')]=_0x20e130['attributes'][_0x2b98('0x5a')]?_0x20e130[_0x2b98('0x43')]:_0x4bb606[_0x2b98('0x3d')];if(_0xceaf82[_0x2b98('0x3e')]['includeAll']){_0x20e130['include']=[{'all':!![]}];}_0x20e130=_['merge']({},_0x20e130,_0xceaf82[_0x2b98('0x4c')]);return db['VoiceQueue'][_0x2b98('0x32')](_0x20e130)['then'](handleEntityNotFound(_0x275360,null))[_0x2b98('0x29')](function(_0x2440c9){if(_0x2440c9){var _0x228822=_0x2440c9[_0x2b98('0x2b')]({'plain':!![]});_0x228822=qs[_0x2b98('0x5b')](_0x228822,['id',_0x2b98('0x5c'),'updatedAt']);_0xceaf82[_0x2b98('0x5d')]=_[_0x2b98('0x5b')](_0xceaf82[_0x2b98('0x5d')],['id',_0x2b98('0x5c'),_0x2b98('0x5e')]);return db[_0x2b98('0x3a')]['create'](_[_0x2b98('0x4a')](_0x228822,_0xceaf82[_0x2b98('0x5d')]),{'include':_0xceaf82[_0x2b98('0x3e')]['includeAll']?[{'all':!![]}]:undefined})[_0x2b98('0x29')](function(_0x571b63){var _0x3e116f=_0xceaf82['user']['get']({'plain':!![]});if(!_0x3e116f)throw new Error(_0x2b98('0x54'));if(_0x3e116f[_0x2b98('0x55')]===_0x2b98('0x53')){var _0xe87e1d=_0x571b63[_0x2b98('0x2b')]({'plain':!![]});var _0x24225e=[{'name':_0x2b98('0x2c'),'value':'inbound'},{'name':_0x2b98('0x5f'),'value':_0x2b98('0x2e')}];var _0x25679c=_[_0x2b98('0x32')](_0x24225e,['value',_0xe87e1d['type']])[_0x2b98('0x34')];return db[_0x2b98('0x60')]['find']({'where':{'name':_0x25679c,'userProfileId':_0x3e116f['userProfileId']},'raw':!![]})[_0x2b98('0x29')](function(_0x43d091){if(_0x43d091&&_0x43d091[_0x2b98('0x57')]===0x0){return db[_0x2b98('0x61')][_0x2b98('0x52')]({'name':_0xe87e1d[_0x2b98('0x34')],'resourceId':_0xe87e1d['id'],'type':_0x43d091[_0x2b98('0x34')],'sectionId':_0x43d091['id']},{})[_0x2b98('0x29')](function(){return _0x571b63;});}else{return _0x571b63;}})[_0x2b98('0x50')](function(_0x501f8c){logger[_0x2b98('0x35')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x501f8c);throw _0x501f8c;});}return _0x571b63;});}})[_0x2b98('0x29')](respondWithResult(_0x275360,0xc9))[_0x2b98('0x50')](handleError(_0x275360,null));};exports[_0x2b98('0x28')]=function(_0x30f140,_0x5461a8){if(_0x30f140['body']['id']){delete _0x30f140[_0x2b98('0x5d')]['id'];}return db[_0x2b98('0x3a')][_0x2b98('0x32')]({'where':{'id':_0x30f140[_0x2b98('0x51')]['id']}})[_0x2b98('0x29')](handleEntityNotFound(_0x5461a8,null))['then'](saveUpdates(_0x30f140[_0x2b98('0x5d')],null))[_0x2b98('0x29')](respondWithResult(_0x5461a8,null))[_0x2b98('0x50')](handleError(_0x5461a8,null));};exports['destroy']=function(_0x4d4542,_0x4f0bf7){return db['VoiceQueue']['find']({'where':{'id':_0x4d4542['params']['id']}})[_0x2b98('0x29')](handleEntityNotFound(_0x4f0bf7,null))['then'](removeEntity(_0x4f0bf7,null))[_0x2b98('0x50')](handleError(_0x4f0bf7,null));};exports[_0x2b98('0x62')]=function(_0x108d61,_0x298551,_0x15191b){var _0x3d8263={'raw':![],'where':{}};var _0x528b73={};var _0x55fe32={'count':0x0,'rows':[]};return db[_0x2b98('0x3a')][_0x2b98('0x63')]({'where':{'id':_0x108d61[_0x2b98('0x51')]['id']}})[_0x2b98('0x29')](handleEntityNotFound(_0x298551,null))[_0x2b98('0x29')](function(_0x466137){if(_0x466137){_0x528b73[_0x2b98('0x3d')]=_['keys'](db[_0x2b98('0x64')][_0x2b98('0x3b')]);_0x528b73[_0x2b98('0x3e')]=_[_0x2b98('0x3f')](_0x108d61[_0x2b98('0x3e')]);_0x528b73[_0x2b98('0x40')]=_[_0x2b98('0x41')](_0x528b73[_0x2b98('0x3d')],_0x528b73[_0x2b98('0x3e')]);_0x3d8263[_0x2b98('0x43')]=_[_0x2b98('0x41')](_0x528b73['model'],qs[_0x2b98('0x42')](_0x108d61[_0x2b98('0x3e')][_0x2b98('0x42')]));_0x3d8263[_0x2b98('0x43')]=_0x3d8263[_0x2b98('0x43')]['length']?_0x3d8263[_0x2b98('0x43')]:_0x528b73[_0x2b98('0x3d')];if(!_0x108d61[_0x2b98('0x3e')][_0x2b98('0x44')](_0x2b98('0x45'))){_0x3d8263[_0x2b98('0x46')]=qs[_0x2b98('0x46')](_0x108d61['query'][_0x2b98('0x46')]);_0x3d8263[_0x2b98('0x21')]=qs[_0x2b98('0x21')](_0x108d61['query'][_0x2b98('0x21')]);}_0x3d8263['order']=qs['sort'](_0x108d61['query'][_0x2b98('0x65')]);_0x3d8263[_0x2b98('0x48')]=qs[_0x2b98('0x40')](_[_0x2b98('0x66')](_0x108d61['query'],_0x528b73['filters']));_0x3d8263[_0x2b98('0x48')][_0x2b98('0x67')]=_0x466137['id'];if(_0x108d61[_0x2b98('0x3e')][_0x2b98('0x49')]){_0x3d8263[_0x2b98('0x48')]=_[_0x2b98('0x4a')](_0x3d8263[_0x2b98('0x48')],{'$or':_[_0x2b98('0x39')](_0x3d8263[_0x2b98('0x43')],function(_0xe91f5){var _0x28675c={};_0x28675c[_0xe91f5]={'$like':'%'+_0x108d61['query']['filter']+'%'};return _0x28675c;})});}_0x3d8263=_['merge']({},_0x3d8263,_0x108d61[_0x2b98('0x4c')]);return db['CmHopper'][_0x2b98('0x4d')]({'where':_0x3d8263[_0x2b98('0x48')]})['then'](function(_0x3396f0){_0x55fe32[_0x2b98('0x4d')]=_0x3396f0;if(_0x108d61[_0x2b98('0x3e')][_0x2b98('0x4e')]){_0x3d8263[_0x2b98('0x4f')]=[{'all':!![]}];}return db[_0x2b98('0x64')][_0x2b98('0x68')](_0x3d8263);})['then'](function(_0x5cf1f8){_0x55fe32[_0x2b98('0x69')]=_0x5cf1f8;return _0x55fe32;});}})[_0x2b98('0x29')](respondWithFilteredResult(_0x298551,_0x3d8263))[_0x2b98('0x50')](handleError(_0x298551,null));};exports[_0x2b98('0x6a')]=function(_0x155d01,_0x3b7f26,_0x38b769){var _0x24a572={'raw':!![],'where':{}};var _0x52d07d={};var _0x3481da={'count':0x0,'rows':[]};return db[_0x2b98('0x3a')]['findOne']({'where':{'id':_0x155d01[_0x2b98('0x51')]['id']}})[_0x2b98('0x29')](handleEntityNotFound(_0x3b7f26,null))[_0x2b98('0x29')](function(_0x2b3602){if(_0x2b3602){_0x52d07d['model']=_[_0x2b98('0x3f')](db[_0x2b98('0x6b')][_0x2b98('0x3b')]);_0x52d07d['query']=_[_0x2b98('0x3f')](_0x155d01[_0x2b98('0x3e')]);_0x52d07d[_0x2b98('0x40')]=_[_0x2b98('0x41')](_0x52d07d[_0x2b98('0x3d')],_0x52d07d[_0x2b98('0x3e')]);_0x24a572[_0x2b98('0x43')]=_[_0x2b98('0x41')](_0x52d07d[_0x2b98('0x3d')],qs[_0x2b98('0x42')](_0x155d01[_0x2b98('0x3e')][_0x2b98('0x42')]));_0x24a572[_0x2b98('0x43')]=_0x24a572['attributes'][_0x2b98('0x5a')]?_0x24a572[_0x2b98('0x43')]:_0x52d07d[_0x2b98('0x3d')];if(!_0x155d01[_0x2b98('0x3e')][_0x2b98('0x44')]('nolimit')){_0x24a572[_0x2b98('0x46')]=qs['limit'](_0x155d01['query'][_0x2b98('0x46')]);_0x24a572[_0x2b98('0x21')]=qs[_0x2b98('0x21')](_0x155d01['query'][_0x2b98('0x21')]);}_0x24a572['order']=qs[_0x2b98('0x65')](_0x155d01[_0x2b98('0x3e')][_0x2b98('0x65')]);_0x24a572[_0x2b98('0x48')]=qs['filters'](_[_0x2b98('0x66')](_0x155d01[_0x2b98('0x3e')],_0x52d07d[_0x2b98('0x40')]));_0x24a572[_0x2b98('0x48')][_0x2b98('0x67')]=_0x2b3602['id'];if(_0x155d01[_0x2b98('0x3e')][_0x2b98('0x49')]){_0x24a572[_0x2b98('0x48')]=_[_0x2b98('0x4a')](_0x24a572[_0x2b98('0x48')],{'$or':_[_0x2b98('0x39')](_0x24a572[_0x2b98('0x43')],function(_0x3958cd){var _0x273fec={};_0x273fec[_0x3958cd]={'$like':'%'+_0x155d01[_0x2b98('0x3e')][_0x2b98('0x49')]+'%'};return _0x273fec;})});}_0x24a572=_[_0x2b98('0x4a')]({},_0x24a572,_0x155d01[_0x2b98('0x4c')]);return db[_0x2b98('0x6b')]['count']({'where':_0x24a572[_0x2b98('0x48')]})[_0x2b98('0x29')](function(_0x392173){_0x3481da['count']=_0x392173;if(_0x155d01[_0x2b98('0x3e')]['includeAll']){_0x24a572[_0x2b98('0x4f')]=[{'all':!![]}];}return db[_0x2b98('0x6b')][_0x2b98('0x68')](_0x24a572);})[_0x2b98('0x29')](function(_0x606589){_0x3481da['rows']=_0x606589;return _0x3481da;});}})[_0x2b98('0x29')](respondWithFilteredResult(_0x3b7f26,_0x24a572))[_0x2b98('0x50')](handleError(_0x3b7f26,null));};exports[_0x2b98('0x6c')]=function(_0x37fef7,_0x5f1195,_0x41e25e){var _0x1165c7={'raw':!![],'where':{}};var _0xedc964={};var _0x595a48={'count':0x0,'rows':[]};return db[_0x2b98('0x3a')]['findOne']({'where':{'id':_0x37fef7[_0x2b98('0x51')]['id']}})[_0x2b98('0x29')](handleEntityNotFound(_0x5f1195,null))[_0x2b98('0x29')](function(_0x1a4f60){if(_0x1a4f60){_0xedc964[_0x2b98('0x3d')]=_['keys'](db[_0x2b98('0x6d')][_0x2b98('0x3b')]);_0xedc964['query']=_['keys'](_0x37fef7[_0x2b98('0x3e')]);_0xedc964[_0x2b98('0x40')]=_[_0x2b98('0x41')](_0xedc964['model'],_0xedc964[_0x2b98('0x3e')]);_0x1165c7[_0x2b98('0x43')]=_['intersection'](_0xedc964[_0x2b98('0x3d')],qs['fields'](_0x37fef7[_0x2b98('0x3e')]['fields']));_0x1165c7[_0x2b98('0x43')]=_0x1165c7[_0x2b98('0x43')][_0x2b98('0x5a')]?_0x1165c7[_0x2b98('0x43')]:_0xedc964[_0x2b98('0x3d')];if(!_0x37fef7['query'][_0x2b98('0x44')](_0x2b98('0x45'))){_0x1165c7[_0x2b98('0x46')]=qs[_0x2b98('0x46')](_0x37fef7[_0x2b98('0x3e')][_0x2b98('0x46')]);_0x1165c7[_0x2b98('0x21')]=qs[_0x2b98('0x21')](_0x37fef7[_0x2b98('0x3e')][_0x2b98('0x21')]);}_0x1165c7['order']=qs[_0x2b98('0x65')](_0x37fef7[_0x2b98('0x3e')][_0x2b98('0x65')]);_0x1165c7['where']=qs[_0x2b98('0x40')](_[_0x2b98('0x66')](_0x37fef7[_0x2b98('0x3e')],_0xedc964['filters']));_0x1165c7['where'][_0x2b98('0x67')]=_0x1a4f60['id'];if(_0x37fef7[_0x2b98('0x3e')][_0x2b98('0x49')]){_0x1165c7[_0x2b98('0x48')]=_['merge'](_0x1165c7[_0x2b98('0x48')],{'$or':_['map'](_0x1165c7[_0x2b98('0x43')],function(_0x51c885){var _0xb4addf={};_0xb4addf[_0x51c885]={'$like':'%'+_0x37fef7[_0x2b98('0x3e')][_0x2b98('0x49')]+'%'};return _0xb4addf;})});}_0x1165c7=_[_0x2b98('0x4a')]({},_0x1165c7,_0x37fef7[_0x2b98('0x4c')]);return db[_0x2b98('0x6d')][_0x2b98('0x4d')]({'where':_0x1165c7['where']})['then'](function(_0x3967de){_0x595a48[_0x2b98('0x4d')]=_0x3967de;if(_0x37fef7['query']['includeAll']){_0x1165c7[_0x2b98('0x4f')]=[{'all':!![]}];}return db[_0x2b98('0x6d')][_0x2b98('0x68')](_0x1165c7);})[_0x2b98('0x29')](function(_0x1cdfb7){_0x595a48[_0x2b98('0x69')]=_0x1cdfb7;return _0x595a48;});}})[_0x2b98('0x29')](respondWithFilteredResult(_0x5f1195,_0x1165c7))[_0x2b98('0x50')](handleError(_0x5f1195,null));};exports[_0x2b98('0x6e')]=function(_0x55da7b,_0x7e4fac,_0x4a123c){var _0x45e5ab={'raw':!![],'where':{}};var _0x56aa42={};var _0x3f81d8={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x2b98('0x63')]({'where':{'id':_0x55da7b[_0x2b98('0x51')]['id']}})[_0x2b98('0x29')](handleEntityNotFound(_0x7e4fac,null))[_0x2b98('0x29')](function(_0x3487fb){if(_0x3487fb){_0x56aa42[_0x2b98('0x3d')]=_[_0x2b98('0x3f')](db['CmHopperBlack'][_0x2b98('0x3b')]);_0x56aa42['query']=_[_0x2b98('0x3f')](_0x55da7b[_0x2b98('0x3e')]);_0x56aa42[_0x2b98('0x40')]=_[_0x2b98('0x41')](_0x56aa42[_0x2b98('0x3d')],_0x56aa42[_0x2b98('0x3e')]);_0x45e5ab['attributes']=_[_0x2b98('0x41')](_0x56aa42['model'],qs[_0x2b98('0x42')](_0x55da7b['query']['fields']));_0x45e5ab[_0x2b98('0x43')]=_0x45e5ab['attributes'][_0x2b98('0x5a')]?_0x45e5ab[_0x2b98('0x43')]:_0x56aa42[_0x2b98('0x3d')];if(!_0x55da7b[_0x2b98('0x3e')][_0x2b98('0x44')](_0x2b98('0x45'))){_0x45e5ab[_0x2b98('0x46')]=qs[_0x2b98('0x46')](_0x55da7b[_0x2b98('0x3e')][_0x2b98('0x46')]);_0x45e5ab[_0x2b98('0x21')]=qs['offset'](_0x55da7b['query'][_0x2b98('0x21')]);}_0x45e5ab[_0x2b98('0x47')]=qs[_0x2b98('0x65')](_0x55da7b[_0x2b98('0x3e')][_0x2b98('0x65')]);_0x45e5ab['where']=qs[_0x2b98('0x40')](_['pick'](_0x55da7b[_0x2b98('0x3e')],_0x56aa42[_0x2b98('0x40')]));_0x45e5ab[_0x2b98('0x48')][_0x2b98('0x67')]=_0x3487fb['id'];if(_0x55da7b[_0x2b98('0x3e')]['filter']){_0x45e5ab[_0x2b98('0x48')]=_[_0x2b98('0x4a')](_0x45e5ab['where'],{'$or':_['map'](_0x45e5ab[_0x2b98('0x43')],function(_0x29794e){var _0x354e4d={};_0x354e4d[_0x29794e]={'$like':'%'+_0x55da7b[_0x2b98('0x3e')][_0x2b98('0x49')]+'%'};return _0x354e4d;})});}_0x45e5ab=_['merge']({},_0x45e5ab,_0x55da7b[_0x2b98('0x4c')]);return db[_0x2b98('0x6f')][_0x2b98('0x4d')]({'where':_0x45e5ab[_0x2b98('0x48')]})[_0x2b98('0x29')](function(_0x4b0511){_0x3f81d8[_0x2b98('0x4d')]=_0x4b0511;if(_0x55da7b['query'][_0x2b98('0x4e')]){_0x45e5ab[_0x2b98('0x4f')]=[{'all':!![]}];}return db[_0x2b98('0x6f')][_0x2b98('0x68')](_0x45e5ab);})[_0x2b98('0x29')](function(_0x21902d){_0x3f81d8['rows']=_0x21902d;return _0x3f81d8;});}})['then'](respondWithFilteredResult(_0x7e4fac,_0x45e5ab))[_0x2b98('0x50')](handleError(_0x7e4fac,null));};exports[_0x2b98('0x70')]=function(_0x2d5592,_0x2c6e5b,_0xc52da8){var _0x3a3cbe={};var _0x1576cc={};var _0x12aa6e;var _0x64ee9f;return db[_0x2b98('0x3a')][_0x2b98('0x63')]({'where':{'id':_0x2d5592['params']['id']}})['then'](handleEntityNotFound(_0x2c6e5b,null))[_0x2b98('0x29')](function(_0x16bb30){if(_0x16bb30){_0x12aa6e=_0x16bb30;_0x1576cc[_0x2b98('0x3d')]=_['keys'](db['Team']['rawAttributes']);_0x1576cc[_0x2b98('0x3e')]=_[_0x2b98('0x3f')](_0x2d5592[_0x2b98('0x3e')]);_0x1576cc[_0x2b98('0x40')]=_['intersection'](_0x1576cc[_0x2b98('0x3d')],_0x1576cc[_0x2b98('0x3e')]);_0x3a3cbe['attributes']=_['intersection'](_0x1576cc[_0x2b98('0x3d')],qs[_0x2b98('0x42')](_0x2d5592[_0x2b98('0x3e')]['fields']));_0x3a3cbe[_0x2b98('0x43')]=_0x3a3cbe[_0x2b98('0x43')][_0x2b98('0x5a')]?_0x3a3cbe[_0x2b98('0x43')]:_0x1576cc[_0x2b98('0x3d')];_0x3a3cbe[_0x2b98('0x47')]=qs[_0x2b98('0x65')](_0x2d5592['query'][_0x2b98('0x65')]);_0x3a3cbe['where']=qs[_0x2b98('0x40')](_['pick'](_0x2d5592[_0x2b98('0x3e')],_0x1576cc[_0x2b98('0x40')]));if(_0x2d5592[_0x2b98('0x3e')]['filter']){_0x3a3cbe[_0x2b98('0x48')]=_[_0x2b98('0x4a')](_0x3a3cbe['where'],{'$or':_[_0x2b98('0x39')](_0x3a3cbe[_0x2b98('0x43')],function(_0x441646){var _0x8e1c3b={};_0x8e1c3b[_0x441646]={'$like':'%'+_0x2d5592[_0x2b98('0x3e')][_0x2b98('0x49')]+'%'};return _0x8e1c3b;})});}_0x3a3cbe=_[_0x2b98('0x4a')]({},_0x3a3cbe,_0x2d5592[_0x2b98('0x4c')]);return _0x12aa6e[_0x2b98('0x70')](_0x3a3cbe);}})['then'](function(_0x5c9403){if(_0x5c9403){_0x64ee9f=_0x5c9403[_0x2b98('0x5a')];if(!_0x2d5592[_0x2b98('0x3e')][_0x2b98('0x44')](_0x2b98('0x45'))){_0x3a3cbe['limit']=qs[_0x2b98('0x46')](_0x2d5592[_0x2b98('0x3e')][_0x2b98('0x46')]);_0x3a3cbe[_0x2b98('0x21')]=qs[_0x2b98('0x21')](_0x2d5592['query']['offset']);}return _0x12aa6e[_0x2b98('0x70')](_0x3a3cbe);}})[_0x2b98('0x29')](function(_0x4da9e7){if(_0x4da9e7){return _0x4da9e7?{'count':_0x64ee9f,'rows':_0x4da9e7}:null;}})['then'](respondWithResult(_0x2c6e5b,null))[_0x2b98('0x50')](handleError(_0x2c6e5b,null));};exports[_0x2b98('0x71')]=function(_0x2676b1,_0x5cab32,_0x238f22){var _0x359c61=_0x2676b1['body'][_0x2b98('0x72')];var _0x304872=_['map'](_0x359c61,'id');return db[_0x2b98('0x73')][_0x2b98('0x68')]({'where':{'id':_0x304872},'attributes':['id'],'include':[{'model':db['User'],'as':_0x2b98('0x74'),'attributes':['id','name',_0x2b98('0x75'),_0x2b98('0x76'),_0x2b98('0x77')],'raw':!![]}]})[_0x2b98('0x29')](function(_0x46bd7a){if(_0x46bd7a){var _0x2f057a=_[_0x2b98('0x78')](_0x46bd7a,function(_0x5bb932){var _0x533726=_0x5bb932[_0x2b98('0x2b')]({'plain':!![]});_0x533726[_0x2b98('0x74')][_0x2b98('0x79')](function(_0x1bd03d){_0x1bd03d['penalty']=_[_0x2b98('0x32')](_0x359c61,{'id':_0x533726['id']})[_0x2b98('0x7a')];});return _0x533726[_0x2b98('0x74')];});return db[_0x2b98('0x3a')][_0x2b98('0x32')]({'where':{'id':_0x2676b1[_0x2b98('0x51')]['id']}})[_0x2b98('0x29')](function(_0x2befb1){return db['sequelize'][_0x2b98('0x7b')](function(_0x367536){return _0x2befb1[_0x2b98('0x71')](_0x304872,{'transaction':_0x367536})[_0x2b98('0x29')](function(){return BPromise['each'](_0x2f057a,function(_0x12cb9d){return db[_0x2b98('0x7c')]['findOrCreate']({'where':{'UserId':_0x12cb9d['id'],'VoiceQueueId':_0x2676b1[_0x2b98('0x51')]['id']},'defaults':{'penalty':_0x12cb9d[_0x2b98('0x7a')]},'transaction':_0x367536});});})[_0x2b98('0x29')](function(){return BPromise[_0x2b98('0x7d')](_['filter'](_0x2f057a,{'online':!![]}),function(_0x11510b){return db[_0x2b98('0x7e')][_0x2b98('0x7f')]({'membername':_0x11510b[_0x2b98('0x34')],'UserId':_0x11510b['id'],'queue_name':_0x2befb1[_0x2b98('0x34')],'VoiceQueueId':_0x2befb1['id'],'interface':_[_0x2b98('0x80')](_0x11510b[_0x2b98('0x77')])?util[_0x2b98('0x81')](_0x2b98('0x82'),_0x11510b[_0x2b98('0x34')]):_0x11510b[_0x2b98('0x77')],'paused':_0x11510b[_0x2b98('0x76')]||![],'penalty':_0x11510b[_0x2b98('0x7a')]},{'transaction':_0x367536});});})['then'](function(){_0x2f057a['forEach'](function(_0xafed48){socket[_0x2b98('0x83')](_0x2b98('0x84'),{'UserId':_0xafed48['id'],'VoiceQueueId':_0x2befb1['id']});});});});});}})['then'](respondWithStatusCode(_0x5cab32,null))['catch'](handleError(_0x5cab32,null));};exports[_0x2b98('0x85')]=function(_0x5ca260,_0x2877bf,_0x58b62d){return db[_0x2b98('0x73')][_0x2b98('0x68')]({'where':{'id':_0x5ca260[_0x2b98('0x3e')][_0x2b98('0x86')]},'attributes':['id'],'include':[{'model':db[_0x2b98('0x87')],'as':_0x2b98('0x74'),'attributes':['id'],'raw':!![]}]})[_0x2b98('0x29')](handleEntityNotFound(_0x2877bf,null))['then'](function(_0x3be788){var _0x11f282=_['map'](_0x3be788,'id');var _0x3d4805=[];var _0x5c9c98=[];var _0x5ed2c1=squel[_0x2b98('0x88')]();_0x5ed2c1[_0x2b98('0x89')](_0x2b98('0x8a'))[_0x2b98('0x8b')](_0x2b98('0x8c'),'tq')[_0x2b98('0x8d')](_0x2b98('0x8e'),'ut',_0x2b98('0x8f'))['where'](_0x2b98('0x90'),_0x5ca260[_0x2b98('0x51')]['id']);for(var _0x2ffc4d=0x0;_0x2ffc4d<_0x3be788[_0x2b98('0x5a')];_0x2ffc4d+=0x1){let _0xddaf0b=_0x3be788[_0x2ffc4d];for(var _0x2fcd67=0x0;_0x2fcd67<_0xddaf0b[_0x2b98('0x74')]['length'];_0x2fcd67+=0x1){let _0x3de396=_0xddaf0b['Agents'][_0x2fcd67];var _0x309e93=_0x5ed2c1[_0x2b98('0x59')]();_0x309e93[_0x2b98('0x48')](_0x2b98('0x91'),_0x3de396['id']);_0x5c9c98[_0x2b98('0x92')](db[_0x2b98('0x93')][_0x2b98('0x3e')](_0x309e93[_0x2b98('0x94')](),{'type':db[_0x2b98('0x93')][_0x2b98('0x95')]['SELECT']})[_0x2b98('0x29')](function(_0x267978){if(_0x267978[_0x2b98('0x5a')]===0x1){return _0x3de396['id'];}else{var _0x287795=_[_0x2b98('0x96')](_['map'](_0x267978,_0x2b98('0x97')),function(_0x39404a){return _['includes'](_0x11f282,_0x39404a);});if(_0x287795){return _0x3de396['id'];}}}));}}return BPromise[_0x2b98('0x98')](_0x5c9c98)[_0x2b98('0x29')](function(_0x468e76){_0x3d4805=_(_0x3d4805)[_0x2b98('0x99')](_0x468e76)[_0x2b98('0x9a')]()[_0x2b98('0x30')]();return db[_0x2b98('0x3a')][_0x2b98('0x32')]({'where':{'id':_0x5ca260['params']['id']}})[_0x2b98('0x29')](function(_0x19ec1a){return db['sequelize'][_0x2b98('0x7b')](function(_0x194aba){return _0x19ec1a['removeTeams'](_0x5ca260['query'][_0x2b98('0x86')],{'transaction':_0x194aba})[_0x2b98('0x29')](function(){if(!_['isEmpty'](_0x3d4805)){return _0x19ec1a[_0x2b98('0x9b')](_0x3d4805,{'transaction':_0x194aba})[_0x2b98('0x29')](function(){return db[_0x2b98('0x7e')][_0x2b98('0x2a')]({'where':{'VoiceQueueId':_0x5ca260[_0x2b98('0x51')]['id'],'UserId':_0x3d4805},'transaction':_0x194aba});});}})[_0x2b98('0x29')](function(){_0x3d4805[_0x2b98('0x79')](function(_0x371a39){socket[_0x2b98('0x83')](_0x2b98('0x9c'),{'UserId':_0x371a39,'VoiceQueueId':_0x19ec1a['id']});});});});});});})['then'](respondWithStatusCode(_0x2877bf,null))[_0x2b98('0x50')](handleError(_0x2877bf,null));};exports[_0x2b98('0x9d')]=function(_0x527a63,_0x4015d3,_0x2e24bd){var _0x5d7fa3,_0x4172f6;return db['VoiceQueue'][_0x2b98('0x32')]({'where':{'id':_0x527a63[_0x2b98('0x51')]['id']}})[_0x2b98('0x29')](handleEntityNotFound(_0x4015d3,null))[_0x2b98('0x29')](function(_0x53f472){if(_0x53f472){_0x4172f6=_0x53f472;return _0x53f472[_0x2b98('0x9d')](_0x527a63[_0x2b98('0x5d')][_0x2b98('0x86')],_[_0x2b98('0x5b')](_0x527a63['body'],[_0x2b98('0x86'),'id'])||{})[_0x2b98('0x9e')](function(_0x5f0f84){for(var _0x39dfde=0x0;_0x39dfde<_0x527a63[_0x2b98('0x5d')]['ids'][_0x2b98('0x5a')];_0x39dfde+=0x1){socket[_0x2b98('0x83')](_0x2b98('0x84'),{'UserId':_0x527a63[_0x2b98('0x5d')]['ids'][_0x39dfde],'VoiceQueueId':_0x527a63[_0x2b98('0x51')]['id']});}return _0x5f0f84;});}})['then'](function(_0x5232ae){_0x5d7fa3=_0x5232ae||[];if(_0x4172f6){return db[_0x2b98('0x87')][_0x2b98('0x68')]({'where':{'id':_0x527a63[_0x2b98('0x5d')][_0x2b98('0x86')]},'attributes':['id',_0x2b98('0x34'),_0x2b98('0x75'),_0x2b98('0x76'),_0x2b98('0x77')],'raw':!![]});}})[_0x2b98('0x29')](function(_0x33c8fa){if(!_[_0x2b98('0x9f')](_0x33c8fa)){var _0x19ef84=[];for(var _0x39eae1=0x0;_0x39eae1<_0x33c8fa[_0x2b98('0x5a')];_0x39eae1++){if(_0x33c8fa[_0x39eae1]['online']){_0x19ef84[_0x2b98('0x92')](db[_0x2b98('0x7e')][_0x2b98('0x7f')]({'membername':_0x33c8fa[_0x39eae1][_0x2b98('0x34')],'UserId':_0x33c8fa[_0x39eae1]['id'],'queue_name':_0x4172f6[_0x2b98('0x34')],'VoiceQueueId':_0x4172f6['id'],'interface':_[_0x2b98('0x80')](_0x33c8fa[_0x39eae1][_0x2b98('0x77')])?util[_0x2b98('0x81')](_0x2b98('0x82'),_0x33c8fa[_0x39eae1][_0x2b98('0x34')]):_0x33c8fa[_0x39eae1][_0x2b98('0x77')],'paused':_0x33c8fa[_0x39eae1][_0x2b98('0x76')]||![],'penalty':_0x527a63[_0x2b98('0x5d')][_0x2b98('0x7a')]||0x0}));}}return BPromise['all'](_0x19ef84);}})[_0x2b98('0x29')](function(){return _0x5d7fa3;})[_0x2b98('0x29')](respondWithResult(_0x4015d3,null))[_0x2b98('0x50')](handleError(_0x4015d3,null));};exports[_0x2b98('0x9b')]=function(_0x31977a,_0x277143,_0x50bd41){return db['VoiceQueue'][_0x2b98('0x32')]({'where':{'id':_0x31977a[_0x2b98('0x51')]['id']}})[_0x2b98('0x29')](handleEntityNotFound(_0x277143,null))[_0x2b98('0x29')](function(_0x4cef45){if(_0x4cef45){return _0x4cef45[_0x2b98('0x9b')](_0x31977a['query'][_0x2b98('0x86')])[_0x2b98('0x29')](function(){if(_['isArray'](_0x31977a[_0x2b98('0x3e')]['ids'])){for(var _0x555980=0x0;_0x555980<_0x31977a[_0x2b98('0x3e')][_0x2b98('0x86')][_0x2b98('0x5a')];_0x555980+=0x1){socket['emit']('userVoiceQueue:remove',{'UserId':Number(_0x31977a[_0x2b98('0x3e')][_0x2b98('0x86')][_0x555980]),'VoiceQueueId':Number(_0x31977a[_0x2b98('0x51')]['id'])});}}else{socket[_0x2b98('0x83')](_0x2b98('0x9c'),{'UserId':Number(_0x31977a[_0x2b98('0x3e')][_0x2b98('0x86')]),'VoiceQueueId':Number(_0x31977a[_0x2b98('0x51')]['id'])});}});}})[_0x2b98('0x29')](function(_0x140ac2){return db['UserVoiceQueueRt']['destroy']({'where':{'VoiceQueueId':_0x31977a[_0x2b98('0x51')]['id'],'UserId':_0x31977a['query'][_0x2b98('0x86')]}})[_0x2b98('0x29')](function(){return _0x140ac2;});})[_0x2b98('0x29')](respondWithStatusCode(_0x277143,null))[_0x2b98('0x50')](handleError(_0x277143,null));};exports[_0x2b98('0xa0')]=function(_0x3af9f2,_0x119c2a,_0x3f8f13){var _0x13cc85={};var _0x56319a={};var _0x14b6f9;var _0x44309a;return db[_0x2b98('0x3a')][_0x2b98('0x63')]({'where':{'id':_0x3af9f2[_0x2b98('0x51')]['id']}})[_0x2b98('0x29')](handleEntityNotFound(_0x119c2a,null))['then'](function(_0x324bee){if(_0x324bee){_0x14b6f9=_0x324bee;_0x56319a[_0x2b98('0x3d')]=_[_0x2b98('0x3f')](db[_0x2b98('0x87')][_0x2b98('0x3b')]);_0x56319a['query']=_[_0x2b98('0x3f')](_0x3af9f2[_0x2b98('0x3e')]);_0x56319a[_0x2b98('0x40')]=_[_0x2b98('0x41')](_0x56319a[_0x2b98('0x3d')],_0x56319a['query']);_0x13cc85['attributes']=_[_0x2b98('0x41')](_0x56319a['model'],qs[_0x2b98('0x42')](_0x3af9f2[_0x2b98('0x3e')][_0x2b98('0x42')]));_0x13cc85['attributes']=_0x13cc85[_0x2b98('0x43')][_0x2b98('0x5a')]?_0x13cc85[_0x2b98('0x43')]:_0x56319a[_0x2b98('0x3d')];_0x13cc85[_0x2b98('0x47')]=qs[_0x2b98('0x65')](_0x3af9f2['query']['sort']);_0x13cc85['where']=qs[_0x2b98('0x40')](_[_0x2b98('0x66')](_0x3af9f2[_0x2b98('0x3e')],_0x56319a[_0x2b98('0x40')]));if(_0x3af9f2[_0x2b98('0x3e')][_0x2b98('0x49')]){_0x13cc85[_0x2b98('0x48')]=_[_0x2b98('0x4a')](_0x13cc85[_0x2b98('0x48')],{'$or':_['map'](_0x13cc85[_0x2b98('0x43')],function(_0x2857f1){var _0x530cc0={};_0x530cc0[_0x2857f1]={'$like':'%'+_0x3af9f2[_0x2b98('0x3e')][_0x2b98('0x49')]+'%'};return _0x530cc0;})});}_0x13cc85=_['merge']({},_0x13cc85,_0x3af9f2[_0x2b98('0x4c')]);return _0x14b6f9[_0x2b98('0xa0')](_0x13cc85);}})[_0x2b98('0x29')](function(_0x5502c7){if(_0x5502c7){_0x44309a=_0x5502c7[_0x2b98('0x5a')];if(!_0x3af9f2[_0x2b98('0x3e')][_0x2b98('0x44')](_0x2b98('0x45'))){_0x13cc85[_0x2b98('0x46')]=qs[_0x2b98('0x46')](_0x3af9f2[_0x2b98('0x3e')][_0x2b98('0x46')]);_0x13cc85['offset']=qs[_0x2b98('0x21')](_0x3af9f2[_0x2b98('0x3e')][_0x2b98('0x21')]);}return _0x14b6f9[_0x2b98('0xa0')](_0x13cc85);}})[_0x2b98('0x29')](function(_0x2f6cf3){if(_0x2f6cf3){return _0x2f6cf3?{'count':_0x44309a,'rows':_0x2f6cf3}:null;}})[_0x2b98('0x29')](respondWithResult(_0x119c2a,null))[_0x2b98('0x50')](handleError(_0x119c2a,null));};exports['getMembers']=function(_0x3afc30,_0x1e1ad9,_0x199d49){var _0x11c0ab={};var _0x5972eb={};var _0x227b4c;var _0x48ff54;return db[_0x2b98('0x3a')][_0x2b98('0x63')]({'where':{'id':_0x3afc30[_0x2b98('0x51')]['id']}})['then'](handleEntityNotFound(_0x1e1ad9,null))['then'](function(_0xff04e4){if(_0xff04e4){_0x227b4c=_0xff04e4;_0x5972eb[_0x2b98('0x3d')]=_[_0x2b98('0x3f')](db[_0x2b98('0x7e')][_0x2b98('0x3b')]);_0x5972eb[_0x2b98('0x3e')]=_[_0x2b98('0x3f')](_0x3afc30[_0x2b98('0x3e')]);_0x5972eb[_0x2b98('0x40')]=_[_0x2b98('0x41')](_0x5972eb[_0x2b98('0x3d')],_0x5972eb[_0x2b98('0x3e')]);_0x11c0ab['attributes']=_['intersection'](_0x5972eb['model'],qs[_0x2b98('0x42')](_0x3afc30[_0x2b98('0x3e')][_0x2b98('0x42')]));_0x11c0ab[_0x2b98('0x43')]=_0x11c0ab[_0x2b98('0x43')][_0x2b98('0x5a')]?_0x11c0ab['attributes']:_0x5972eb[_0x2b98('0x3d')];_0x11c0ab[_0x2b98('0x47')]=qs[_0x2b98('0x65')](_0x3afc30[_0x2b98('0x3e')]['sort']);_0x11c0ab['where']=qs[_0x2b98('0x40')](_['pick'](_0x3afc30[_0x2b98('0x3e')],_0x5972eb['filters']));if(_0x3afc30[_0x2b98('0x3e')]['filter']){_0x11c0ab['where']=_['merge'](_0x11c0ab[_0x2b98('0x48')],{'$or':_[_0x2b98('0x39')](_0x11c0ab[_0x2b98('0x43')],function(_0x29e061){var _0x639279={};_0x639279[_0x29e061]={'$like':'%'+_0x3afc30[_0x2b98('0x3e')][_0x2b98('0x49')]+'%'};return _0x639279;})});}_0x11c0ab=_['merge']({},_0x11c0ab,_0x3afc30[_0x2b98('0x4c')]);return _0x227b4c[_0x2b98('0xa1')](_0x11c0ab);}})[_0x2b98('0x29')](function(_0x54137d){if(_0x54137d){_0x48ff54=_0x54137d[_0x2b98('0x5a')];if(!_0x3afc30[_0x2b98('0x3e')][_0x2b98('0x44')](_0x2b98('0x45'))){_0x11c0ab['limit']=qs[_0x2b98('0x46')](_0x3afc30[_0x2b98('0x3e')][_0x2b98('0x46')]);_0x11c0ab['offset']=qs[_0x2b98('0x21')](_0x3afc30[_0x2b98('0x3e')][_0x2b98('0x21')]);}return _0x227b4c[_0x2b98('0xa1')](_0x11c0ab);}})[_0x2b98('0x29')](function(_0x53347f){return _0x53347f?{'count':_0x48ff54,'rows':_0x53347f}:null;})[_0x2b98('0x29')](respondWithResult(_0x1e1ad9,null))['catch'](handleError(_0x1e1ad9,null));};exports['getLists']=function(_0x5423af,_0x190bdf,_0x425038){var _0x529707={};var _0x440111={};var _0x1c7d6c;var _0x4c43d3;return db[_0x2b98('0x3a')][_0x2b98('0x63')]({'where':{'id':_0x5423af[_0x2b98('0x51')]['id']}})[_0x2b98('0x29')](handleEntityNotFound(_0x190bdf,null))['then'](function(_0xd3220f){if(_0xd3220f){_0x1c7d6c=_0xd3220f;_0x440111[_0x2b98('0x3d')]=_[_0x2b98('0x3f')](db[_0x2b98('0xa2')][_0x2b98('0x3b')]);_0x440111[_0x2b98('0x3e')]=_['keys'](_0x5423af[_0x2b98('0x3e')]);_0x440111[_0x2b98('0x40')]=_['intersection'](_0x440111['model'],_0x440111[_0x2b98('0x3e')]);_0x529707[_0x2b98('0x43')]=_['intersection'](_0x440111[_0x2b98('0x3d')],qs[_0x2b98('0x42')](_0x5423af['query'][_0x2b98('0x42')]));_0x529707[_0x2b98('0x43')]=_0x529707[_0x2b98('0x43')][_0x2b98('0x5a')]?_0x529707[_0x2b98('0x43')]:_0x440111['model'];_0x529707[_0x2b98('0x47')]=qs['sort'](_0x5423af['query']['sort']);_0x529707[_0x2b98('0x48')]=qs[_0x2b98('0x40')](_[_0x2b98('0x66')](_0x5423af[_0x2b98('0x3e')],_0x440111[_0x2b98('0x40')]));if(_0x5423af['query'][_0x2b98('0x49')]){_0x529707[_0x2b98('0x48')]=_[_0x2b98('0x4a')](_0x529707['where'],{'$or':_[_0x2b98('0x39')](_0x529707['attributes'],function(_0x3a992f){var _0x3521e5={};_0x3521e5[_0x3a992f]={'$like':'%'+_0x5423af[_0x2b98('0x3e')]['filter']+'%'};return _0x3521e5;})});}_0x529707=_[_0x2b98('0x4a')]({},_0x529707,_0x5423af['options']);return _0x1c7d6c[_0x2b98('0xa3')](_0x529707);}})[_0x2b98('0x29')](function(_0x543887){if(_0x543887){_0x4c43d3=_0x543887[_0x2b98('0x5a')];if(!_0x5423af[_0x2b98('0x3e')][_0x2b98('0x44')]('nolimit')){_0x529707['limit']=qs[_0x2b98('0x46')](_0x5423af[_0x2b98('0x3e')][_0x2b98('0x46')]);_0x529707['offset']=qs[_0x2b98('0x21')](_0x5423af['query'][_0x2b98('0x21')]);}return _0x1c7d6c[_0x2b98('0xa3')](_0x529707);}})[_0x2b98('0x29')](function(_0x127f75){if(_0x127f75){return _0x127f75?{'count':_0x4c43d3,'rows':_0x127f75}:null;}})[_0x2b98('0x29')](respondWithResult(_0x190bdf,null))['catch'](handleError(_0x190bdf,null));};exports[_0x2b98('0xa4')]=function(_0x1ae4fa,_0x2687c6,_0x4e30b9){var _0x5d8b30,_0x2ea7ca;return db['VoiceQueue'][_0x2b98('0x32')]({'where':{'id':_0x1ae4fa[_0x2b98('0x51')]['id']}})[_0x2b98('0x29')](handleEntityNotFound(_0x2687c6,null))['then'](function(_0x307564){if(_0x307564){_0x2ea7ca=_0x307564;return _0x307564[_0x2b98('0xa4')](_0x1ae4fa['body'][_0x2b98('0x86')],_[_0x2b98('0x5b')](_0x1ae4fa['body'],[_0x2b98('0x86'),'id'])||{});}return null;})[_0x2b98('0x9e')](function(_0x3779c1){var _0x397e5d;_0x5d8b30=_0x3779c1||[];var _0x4c76d6=[];if(_0x3779c1){for(var _0x49ddaf=0x0;_0x49ddaf<_0x3779c1['length'];_0x49ddaf+=0x1){var _0xa44e54=_0x3779c1[_0x49ddaf]['get']({'plain':!![]});_0x2ea7ca[_0x2b98('0xa5')]=_0x1ae4fa[_0x2b98('0x5d')][_0x2b98('0xa5')]?_0x1ae4fa[_0x2b98('0x5d')]['dialCheckDuplicateType']:_0x2ea7ca[_0x2b98('0xa5')];switch(_0x2ea7ca['dialCheckDuplicateType']){case'always':_0x397e5d=squel['insert']()[_0x2b98('0xa6')](_0x2b98('0xa7'))[_0x2b98('0xa8')]([_0x2b98('0xa9'),_0x2b98('0xaa'),_0x2b98('0xab'),_0x2b98('0xac'),'VoiceQueueId',_0x2b98('0x5c'),_0x2b98('0x5e')],squel[_0x2b98('0x88')]()[_0x2b98('0x89')](_0x2b98('0xa9'),_0x2b98('0xa9'))['field']('NOW()',_0x2b98('0xaa'))[_0x2b98('0x89')]('id','ContactId')[_0x2b98('0x89')](_0xa44e54[_0x2b98('0xad')]['toString'](),'ListId')[_0x2b98('0x89')](_0x1ae4fa['params']['id'][_0x2b98('0x94')](),'VoiceQueueId')['field'](_0x2b98('0xae'),_0x2b98('0x5c'))[_0x2b98('0x89')](_0x2b98('0xae'),'updatedAt')[_0x2b98('0x8b')](_0x2b98('0xaf'))[_0x2b98('0x48')]('deletedAt\x20IS\x20NULL')[_0x2b98('0x48')](_0x2b98('0xb0'),_0xa44e54[_0x2b98('0xad')][_0x2b98('0x94')]())[_0x2b98('0x48')](_0x2b98('0xb1'))[_0x2b98('0x48')](_0x2b98('0xb2'),squel[_0x2b98('0x88')]()[_0x2b98('0x89')]('COALESCE(calleridnum,\x27\x27)')[_0x2b98('0x8b')](_0x2b98('0xb3'))['where'](_0x2b98('0x90'),_0x1ae4fa[_0x2b98('0x51')]['id'][_0x2b98('0x94')]()))['where'](_0x2b98('0xb2'),squel[_0x2b98('0x88')]()['field'](_0x2b98('0xb4'))[_0x2b98('0x8b')](_0x2b98('0xa7'))[_0x2b98('0x48')](_0x2b98('0x90'),_0x1ae4fa[_0x2b98('0x51')]['id'][_0x2b98('0x94')]())))[_0x2b98('0x94')]();break;case _0x2b98('0xb5'):_0x397e5d=squel['insert']()[_0x2b98('0xa6')](_0x2b98('0xa7'))['fromQuery']([_0x2b98('0xa9'),'scheduledAt',_0x2b98('0xab'),_0x2b98('0xac'),'VoiceQueueId','createdAt',_0x2b98('0x5e')],squel['select']()[_0x2b98('0x89')](_0x2b98('0xa9'),_0x2b98('0xa9'))[_0x2b98('0x89')]('NOW()',_0x2b98('0xaa'))[_0x2b98('0x89')]('id',_0x2b98('0xab'))[_0x2b98('0x89')](_0xa44e54[_0x2b98('0xad')]['toString'](),_0x2b98('0xac'))[_0x2b98('0x89')](_0x1ae4fa[_0x2b98('0x51')]['id']['toString'](),_0x2b98('0x67'))[_0x2b98('0x89')](_0x2b98('0xae'),_0x2b98('0x5c'))[_0x2b98('0x89')](_0x2b98('0xae'),_0x2b98('0x5e'))[_0x2b98('0x8b')]('cm_contacts')['where'](_0x2b98('0xb6'))['where'](_0x2b98('0xb0'),_0xa44e54[_0x2b98('0xad')]['toString']())[_0x2b98('0x48')]('phone\x20IS\x20NOT\x20NULL')[_0x2b98('0x48')](_0x2b98('0xb2'),squel[_0x2b98('0x88')]()[_0x2b98('0x89')](_0x2b98('0xb4'))[_0x2b98('0x8b')](_0x2b98('0xa7'))[_0x2b98('0x48')](_0x2b98('0x90'),_0x1ae4fa[_0x2b98('0x51')]['id'][_0x2b98('0x94')]())))[_0x2b98('0x94')]();break;default:_0x397e5d=squel[_0x2b98('0xb7')]()[_0x2b98('0xa6')](_0x2b98('0xa7'))[_0x2b98('0xa8')]([_0x2b98('0xa9'),'scheduledAt',_0x2b98('0xab'),'ListId',_0x2b98('0x67'),_0x2b98('0x5c'),'updatedAt'],squel[_0x2b98('0x88')]()[_0x2b98('0x89')](_0x2b98('0xa9'),'phone')['field'](_0x2b98('0xae'),_0x2b98('0xaa'))[_0x2b98('0x89')]('id',_0x2b98('0xab'))[_0x2b98('0x89')](_0xa44e54[_0x2b98('0xad')][_0x2b98('0x94')](),_0x2b98('0xac'))[_0x2b98('0x89')](_0x1ae4fa[_0x2b98('0x51')]['id'][_0x2b98('0x94')](),'VoiceQueueId')[_0x2b98('0x89')](_0x2b98('0xae'),_0x2b98('0x5c'))[_0x2b98('0x89')](_0x2b98('0xae'),_0x2b98('0x5e'))['from']('cm_contacts')[_0x2b98('0x48')](_0x2b98('0xb6'))['where'](_0x2b98('0xb0'),_0xa44e54[_0x2b98('0xad')][_0x2b98('0x94')]())['where']('phone\x20IS\x20NOT\x20NULL'))[_0x2b98('0x94')]();}_0x4c76d6[_0x2b98('0x92')](db[_0x2b98('0x93')][_0x2b98('0x3e')](_0x397e5d));}return BPromise['all'](_0x4c76d6);}})[_0x2b98('0x29')](function(){return _0x5d8b30;})[_0x2b98('0x29')](respondWithResult(_0x2687c6,null))[_0x2b98('0x50')](handleError(_0x2687c6,null));};exports[_0x2b98('0xb8')]=function(_0x434727,_0x44b856,_0x45b24f){return db[_0x2b98('0x3a')][_0x2b98('0x32')]({'where':{'id':_0x434727[_0x2b98('0x51')]['id']}})[_0x2b98('0x29')](handleEntityNotFound(_0x44b856,null))[_0x2b98('0x29')](function(_0x2e1a2c){if(_0x2e1a2c){return _0x2e1a2c['removeLists'](_0x434727[_0x2b98('0x3e')][_0x2b98('0x86')]);}})['then'](function(_0x186912){if(_0x186912){return db[_0x2b98('0x64')]['destroy']({'where':{'ListId':_0x434727['query']['ids'],'VoiceQueueId':_0x434727['params']['id']}})[_0x2b98('0x29')](function(){return _0x186912;});}})['then'](respondWithStatusCode(_0x44b856,null))[_0x2b98('0x50')](handleError(_0x44b856,null));};exports['getBlackLists']=function(_0x109743,_0x418abe,_0x2442ee){var _0x399003={};var _0x28eadc={};var _0x1ec990;var _0x27ef7b;return db[_0x2b98('0x3a')][_0x2b98('0x63')]({'where':{'id':_0x109743[_0x2b98('0x51')]['id']}})[_0x2b98('0x29')](handleEntityNotFound(_0x418abe,null))['then'](function(_0xe2a17c){if(_0xe2a17c){_0x1ec990=_0xe2a17c;_0x28eadc[_0x2b98('0x3d')]=_['keys'](db[_0x2b98('0xa2')]['rawAttributes']);_0x28eadc['query']=_[_0x2b98('0x3f')](_0x109743[_0x2b98('0x3e')]);_0x28eadc['filters']=_['intersection'](_0x28eadc[_0x2b98('0x3d')],_0x28eadc['query']);_0x399003[_0x2b98('0x43')]=_[_0x2b98('0x41')](_0x28eadc[_0x2b98('0x3d')],qs[_0x2b98('0x42')](_0x109743[_0x2b98('0x3e')][_0x2b98('0x42')]));_0x399003[_0x2b98('0x43')]=_0x399003[_0x2b98('0x43')][_0x2b98('0x5a')]?_0x399003[_0x2b98('0x43')]:_0x28eadc[_0x2b98('0x3d')];_0x399003[_0x2b98('0x47')]=qs[_0x2b98('0x65')](_0x109743[_0x2b98('0x3e')][_0x2b98('0x65')]);_0x399003[_0x2b98('0x48')]=qs[_0x2b98('0x40')](_[_0x2b98('0x66')](_0x109743['query'],_0x28eadc[_0x2b98('0x40')]));if(_0x109743[_0x2b98('0x3e')]['filter']){_0x399003[_0x2b98('0x48')]=_[_0x2b98('0x4a')](_0x399003['where'],{'$or':_[_0x2b98('0x39')](_0x399003[_0x2b98('0x43')],function(_0x2744b9){var _0x566d74={};_0x566d74[_0x2744b9]={'$like':'%'+_0x109743[_0x2b98('0x3e')]['filter']+'%'};return _0x566d74;})});}_0x399003=_['merge']({},_0x399003,_0x109743[_0x2b98('0x4c')]);return _0x1ec990['getBlackLists'](_0x399003);}})[_0x2b98('0x29')](function(_0x31b4b1){if(_0x31b4b1){_0x27ef7b=_0x31b4b1[_0x2b98('0x5a')];if(!_0x109743['query'][_0x2b98('0x44')](_0x2b98('0x45'))){_0x399003[_0x2b98('0x46')]=qs['limit'](_0x109743['query'][_0x2b98('0x46')]);_0x399003[_0x2b98('0x21')]=qs['offset'](_0x109743[_0x2b98('0x3e')][_0x2b98('0x21')]);}return _0x1ec990['getBlackLists'](_0x399003);}})[_0x2b98('0x29')](function(_0x5af338){if(_0x5af338){return _0x5af338?{'count':_0x27ef7b,'rows':_0x5af338}:null;}})[_0x2b98('0x29')](respondWithResult(_0x418abe,null))[_0x2b98('0x50')](handleError(_0x418abe,null));};exports[_0x2b98('0xb9')]=function(_0x1a1caf,_0x2cb269,_0x2ec0ab){var _0x2aa996,_0x15b1b7;return db[_0x2b98('0x3a')]['find']({'where':{'id':_0x1a1caf[_0x2b98('0x51')]['id']}})[_0x2b98('0x29')](handleEntityNotFound(_0x2cb269,null))[_0x2b98('0x29')](function(_0x335c25){if(_0x335c25){_0x15b1b7=_0x335c25;return _0x335c25['addBlackLists'](_0x1a1caf[_0x2b98('0x5d')][_0x2b98('0x86')],_['omit'](_0x1a1caf[_0x2b98('0x5d')],[_0x2b98('0x86'),'id'])||{});}return null;})[_0x2b98('0x9e')](function(_0x5dc0ed){var _0x4a370b;_0x2aa996=_0x5dc0ed||[];var _0x29bf31=[];if(_0x5dc0ed){for(var _0x2f8fc5=0x0;_0x2f8fc5<_0x5dc0ed['length'];_0x2f8fc5+=0x1){var _0x16f03e=_0x5dc0ed[_0x2f8fc5][_0x2b98('0x2b')]({'plain':!![]});_0x4a370b=squel[_0x2b98('0xb7')]()['into'](_0x2b98('0xba'))[_0x2b98('0xa8')](['phone',_0x2b98('0xab'),_0x2b98('0xac'),'VoiceQueueId','createdAt',_0x2b98('0x5e')],squel['select']()[_0x2b98('0x89')](_0x2b98('0xa9'),_0x2b98('0xa9'))['field']('id',_0x2b98('0xab'))[_0x2b98('0x89')](_0x16f03e[_0x2b98('0xad')][_0x2b98('0x94')](),_0x2b98('0xac'))[_0x2b98('0x89')](_0x1a1caf['params']['id'][_0x2b98('0x94')](),_0x2b98('0x67'))['field'](_0x2b98('0xae'),_0x2b98('0x5c'))[_0x2b98('0x89')](_0x2b98('0xae'),'updatedAt')[_0x2b98('0x8b')](_0x2b98('0xaf'))[_0x2b98('0x48')](_0x2b98('0xb6'))[_0x2b98('0x48')]('ListId\x20=\x20?',_0x16f03e[_0x2b98('0xad')][_0x2b98('0x94')]())[_0x2b98('0x48')](_0x2b98('0xb1')))[_0x2b98('0x94')]();_0x29bf31[_0x2b98('0x92')](db['sequelize'][_0x2b98('0x3e')](_0x4a370b));}return BPromise['all'](_0x29bf31);}})[_0x2b98('0x29')](function(){return _0x2aa996;})[_0x2b98('0x29')](respondWithResult(_0x2cb269,null))['catch'](handleError(_0x2cb269,null));};exports[_0x2b98('0xbb')]=function(_0x1f5104,_0x155d36,_0x262c6c){return db[_0x2b98('0x3a')]['find']({'where':{'id':_0x1f5104[_0x2b98('0x51')]['id']}})[_0x2b98('0x29')](handleEntityNotFound(_0x155d36,null))[_0x2b98('0x29')](function(_0x5032b3){if(_0x5032b3){return _0x5032b3['removeBlackLists'](_0x1f5104[_0x2b98('0x3e')][_0x2b98('0x86')]);}})[_0x2b98('0x29')](function(_0x489ebd){if(_0x489ebd){return db['CmHopperBlack'][_0x2b98('0x2a')]({'where':{'ListId':_0x1f5104['query'][_0x2b98('0x86')],'VoiceQueueId':_0x1f5104['params']['id']}})['then'](function(){return _0x489ebd;});}})[_0x2b98('0x29')](respondWithStatusCode(_0x155d36,null))[_0x2b98('0x50')](handleError(_0x155d36,null));}; \ No newline at end of file +var _0x85d3=['toString','cm_contacts','ListId\x20=\x20?','CmListId','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','VoiceQueueId\x20=\x20?','onlyIfOpen','phone\x20IS\x20NOT\x20NULL','COALESCE(phone,\x27\x27)','removeLists','getBlackLists','addBlackLists','cm_hopper_black','deletedAt\x20IS\x20NULL','removeBlackLists','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','./voiceQueue.socket','register','sendStatus','status','end','count','offset','limit','set','Content-Range','json','destroy','get','VoiceQueues','QueueCampaigns','outbound','filter','ignore','map','value','type','find','name','UserProfileResource','then','error','stack','send','index','VoiceQueue','rawAttributes','fieldName','key','model','filters','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','includeAll','include','findAll','catch','keys','intersection','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','clone','length','createdAt','updatedAt','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','getHoppers','findOne','CmHopper','VoiceQueueId','rows','getHopperHistories','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','addTeams','teams','Team','User','Agents','voicePause','interface','flatMap','forEach','penalty','sequelize','transaction','each','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','upsert','format','SIP/%s','emit','userVoiceQueue:save','removeTeams','ids','select','field','tq.TeamId','from','team_has_voice_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','all','union','compact','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','omit','spread','online','isNil','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ListId','NOW()','ContactId'];(function(_0x3bd46c,_0x30513c){var _0x7f9270=function(_0x499bff){while(--_0x499bff){_0x3bd46c['push'](_0x3bd46c['shift']());}};_0x7f9270(++_0x30513c);}(_0x85d3,0xc8));var _0x385d=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x85d3[_0x6c993a];return _0x27f547;};'use strict';var pdf=require(_0x385d('0x0'));var emlformat=require(_0x385d('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x385d('0x2'));var rp=require(_0x385d('0x3'));var moment=require(_0x385d('0x4'));var BPromise=require(_0x385d('0x5'));var Mustache=require(_0x385d('0x6'));var util=require(_0x385d('0x7'));var path=require('path');var sox=require(_0x385d('0x8'));var csv=require('to-csv');var ejs=require(_0x385d('0x9'));var fs=require('fs');var _=require(_0x385d('0xa'));var squel=require(_0x385d('0xb'));var crypto=require(_0x385d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x385d('0xd'));var toCsv=require(_0x385d('0xe'));var querystring=require(_0x385d('0xf'));var Papa=require(_0x385d('0x10'));var Redis=require(_0x385d('0x11'));var authService=require(_0x385d('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x385d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x385d('0x14'));var utils=require(_0x385d('0x15'));var config=require(_0x385d('0x16'));var db=require(_0x385d('0x17'))['db'];config[_0x385d('0x18')]=_[_0x385d('0x19')](config[_0x385d('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x385d('0x18')]));require(_0x385d('0x1a'))[_0x385d('0x1b')](socket);function respondWithStatusCode(_0x4b1693,_0x20c391){_0x20c391=_0x20c391||0xcc;return function(_0x1ee2de){if(_0x1ee2de){return _0x4b1693[_0x385d('0x1c')](_0x20c391);}return _0x4b1693[_0x385d('0x1d')](_0x20c391)[_0x385d('0x1e')]();};}function respondWithResult(_0x435c7f,_0x411f19){_0x411f19=_0x411f19||0xc8;return function(_0x57160b){if(_0x57160b){return _0x435c7f[_0x385d('0x1d')](_0x411f19)['json'](_0x57160b);}};}function respondWithFilteredResult(_0xfef673,_0x3e8ef7){return function(_0x14b8ee){if(_0x14b8ee){var _0x10f83b=_0x14b8ee[_0x385d('0x1f')],_0x5cf730=_0x3e8ef7[_0x385d('0x20')],_0x2cb176=_0x3e8ef7[_0x385d('0x20')]+_0x3e8ef7[_0x385d('0x21')],_0x5dc6bf;if(_0x2cb176>=_0x10f83b){_0x2cb176=_0x10f83b;_0x5dc6bf=0xc8;}else{_0x5dc6bf=0xce;}_0xfef673['status'](_0x5dc6bf);return _0xfef673[_0x385d('0x22')](_0x385d('0x23'),_0x5cf730+'-'+_0x2cb176+'/'+_0x10f83b)[_0x385d('0x24')](_0x14b8ee);}return null;};}function patchUpdates(_0x2b867c){return function(_0x472212){try{jsonpatch['apply'](_0x472212,_0x2b867c,!![]);}catch(_0x217d8c){return BPromise['reject'](_0x217d8c);}return _0x472212['save']();};}function saveUpdates(_0x446152,_0x85afff){return function(_0x1ec5d3){if(_0x1ec5d3){return _0x1ec5d3['update'](_0x446152)['then'](function(_0x45b989){return _0x45b989;});}return null;};}function removeEntity(_0x438b31,_0x52b031){return function(_0x51eeef){if(_0x51eeef){return _0x51eeef[_0x385d('0x25')]()['then'](function(){var _0x107933=_0x51eeef[_0x385d('0x26')]({'plain':!![]});var _0x2d89e2=[{'name':_0x385d('0x27'),'value':'inbound','ignore':![]},{'name':_0x385d('0x28'),'value':_0x385d('0x29'),'ignore':![]}];var _0x5ee78d=_(_0x2d89e2)[_0x385d('0x2a')](_0x385d('0x2b'))[_0x385d('0x2c')](_0x385d('0x2d'))[_0x385d('0x2d')]();if(_['includes'](_0x5ee78d,_0x107933[_0x385d('0x2e')])){return;}var _0x532926=_[_0x385d('0x2f')](_0x2d89e2,[_0x385d('0x2d'),_0x107933['type']])[_0x385d('0x30')];return db[_0x385d('0x31')][_0x385d('0x25')]({'where':{'type':_0x532926,'resourceId':_0x107933['id']}})[_0x385d('0x32')](function(){return _0x51eeef;});})['then'](function(){_0x438b31['status'](0xcc)[_0x385d('0x1e')]();});}};}function handleEntityNotFound(_0x5db573,_0x538004){return function(_0x287142){if(!_0x287142){_0x5db573[_0x385d('0x1c')](0x194);}return _0x287142;};}function handleError(_0x13fda6,_0x3f7539){_0x3f7539=_0x3f7539||0x1f4;return function(_0x4d7438){logger[_0x385d('0x33')](_0x4d7438[_0x385d('0x34')]);if(_0x4d7438[_0x385d('0x30')]){delete _0x4d7438[_0x385d('0x30')];}_0x13fda6[_0x385d('0x1d')](_0x3f7539)[_0x385d('0x35')](_0x4d7438);};}exports[_0x385d('0x36')]=function(_0x11f122,_0x471860){var _0x10b6ac={},_0x1a2226={},_0x942d62={'count':0x0,'rows':[]};var _0x51de5b=_[_0x385d('0x2c')](db[_0x385d('0x37')][_0x385d('0x38')],function(_0x2fc6c3){return{'name':_0x2fc6c3[_0x385d('0x39')],'type':_0x2fc6c3[_0x385d('0x2e')][_0x385d('0x3a')]};});_0x1a2226[_0x385d('0x3b')]=_['map'](_0x51de5b,_0x385d('0x30'));_0x1a2226['query']=_['keys'](_0x11f122['query']);_0x1a2226[_0x385d('0x3c')]=_['intersection'](_0x1a2226[_0x385d('0x3b')],_0x1a2226[_0x385d('0x3d')]);_0x10b6ac[_0x385d('0x3e')]=_['intersection'](_0x1a2226[_0x385d('0x3b')],qs[_0x385d('0x3f')](_0x11f122[_0x385d('0x3d')]['fields']));_0x10b6ac[_0x385d('0x3e')]=_0x10b6ac[_0x385d('0x3e')]['length']?_0x10b6ac[_0x385d('0x3e')]:_0x1a2226[_0x385d('0x3b')];if(!_0x11f122['query'][_0x385d('0x40')](_0x385d('0x41'))){_0x10b6ac[_0x385d('0x21')]=qs[_0x385d('0x21')](_0x11f122[_0x385d('0x3d')][_0x385d('0x21')]);_0x10b6ac[_0x385d('0x20')]=qs[_0x385d('0x20')](_0x11f122['query'][_0x385d('0x20')]);}_0x10b6ac[_0x385d('0x42')]=qs[_0x385d('0x43')](_0x11f122[_0x385d('0x3d')][_0x385d('0x43')]);_0x10b6ac[_0x385d('0x44')]=qs[_0x385d('0x3c')](_[_0x385d('0x45')](_0x11f122['query'],_0x1a2226[_0x385d('0x3c')]));if(_0x11f122[_0x385d('0x3d')][_0x385d('0x2a')]){_0x10b6ac[_0x385d('0x44')]=_[_0x385d('0x46')](_0x10b6ac[_0x385d('0x44')],{'$or':_[_0x385d('0x2c')](_0x51de5b,function(_0x4388cb){if(_0x4388cb[_0x385d('0x2e')]!=='VIRTUAL'){var _0x53d635={};_0x53d635[_0x4388cb[_0x385d('0x30')]]={'$like':'%'+_0x11f122[_0x385d('0x3d')]['filter']+'%'};return _0x53d635;}})});}_0x10b6ac=_[_0x385d('0x46')]({},_0x10b6ac,_0x11f122[_0x385d('0x47')]);var _0x3002e8={'where':_0x10b6ac[_0x385d('0x44')]};return db[_0x385d('0x37')][_0x385d('0x1f')](_0x3002e8)['then'](function(_0x2f7db2){_0x942d62['count']=_0x2f7db2;if(_0x11f122[_0x385d('0x3d')][_0x385d('0x48')]){_0x10b6ac[_0x385d('0x49')]=[{'all':!![]}];}return db[_0x385d('0x37')][_0x385d('0x4a')](_0x10b6ac);})['then'](function(_0x1b88d6){_0x942d62['rows']=_0x1b88d6;return _0x942d62;})[_0x385d('0x32')](respondWithFilteredResult(_0x471860,_0x10b6ac))[_0x385d('0x4b')](handleError(_0x471860,null));};exports['show']=function(_0x1ab705,_0x3aa4fc){var _0x19813a={'raw':![],'where':{'id':_0x1ab705['params']['id']}},_0x183de0={};_0x183de0[_0x385d('0x3b')]=_['keys'](db[_0x385d('0x37')][_0x385d('0x38')]);_0x183de0[_0x385d('0x3d')]=_[_0x385d('0x4c')](_0x1ab705[_0x385d('0x3d')]);_0x183de0['filters']=_[_0x385d('0x4d')](_0x183de0[_0x385d('0x3b')],_0x183de0['query']);_0x19813a[_0x385d('0x3e')]=_[_0x385d('0x4d')](_0x183de0[_0x385d('0x3b')],qs[_0x385d('0x3f')](_0x1ab705['query'][_0x385d('0x3f')]));_0x19813a[_0x385d('0x3e')]=_0x19813a[_0x385d('0x3e')]['length']?_0x19813a[_0x385d('0x3e')]:_0x183de0[_0x385d('0x3b')];if(_0x1ab705['query'][_0x385d('0x48')]){_0x19813a[_0x385d('0x49')]=[{'all':!![]}];}_0x19813a=_[_0x385d('0x46')]({},_0x19813a,_0x1ab705[_0x385d('0x47')]);return db[_0x385d('0x37')][_0x385d('0x2f')](_0x19813a)[_0x385d('0x32')](handleEntityNotFound(_0x3aa4fc,null))[_0x385d('0x32')](respondWithResult(_0x3aa4fc,null))['catch'](handleError(_0x3aa4fc,null));};exports[_0x385d('0x4e')]=function(_0x8d87b3,_0x2d5994){return db[_0x385d('0x37')]['create'](_0x8d87b3[_0x385d('0x4f')],{})['then'](function(_0x33efc0){var _0x3726fc=_0x8d87b3['user'][_0x385d('0x26')]({'plain':!![]});if(!_0x3726fc)throw new Error(_0x385d('0x50'));if(_0x3726fc[_0x385d('0x51')]===_0x385d('0x52')){var _0x373d5a=_0x33efc0[_0x385d('0x26')]({'plain':!![]});var _0x3323c0=[{'name':_0x385d('0x27'),'value':'inbound'},{'name':'QueueCampaigns','value':_0x385d('0x29')}];var _0x2d3e84=_['find'](_0x3323c0,[_0x385d('0x2d'),_0x373d5a[_0x385d('0x2e')]])[_0x385d('0x30')];return db[_0x385d('0x53')][_0x385d('0x2f')]({'where':{'name':_0x2d3e84,'userProfileId':_0x3726fc[_0x385d('0x54')]},'raw':!![]})[_0x385d('0x32')](function(_0x5eea70){if(_0x5eea70&&_0x5eea70[_0x385d('0x55')]===0x0){return db[_0x385d('0x31')][_0x385d('0x4e')]({'name':_0x373d5a[_0x385d('0x30')],'resourceId':_0x373d5a['id'],'type':_0x5eea70[_0x385d('0x30')],'sectionId':_0x5eea70['id']},{})['then'](function(){return _0x33efc0;});}else{return _0x33efc0;}})[_0x385d('0x4b')](function(_0x130d22){logger[_0x385d('0x33')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x130d22);throw _0x130d22;});}return _0x33efc0;})[_0x385d('0x32')](respondWithResult(_0x2d5994,0xc9))[_0x385d('0x4b')](handleError(_0x2d5994,null));};exports[_0x385d('0x56')]=function(_0x27e38b,_0x5f2aa1){var _0x2962e5={'where':{'id':_0x27e38b['params']['id']}},_0x1a1ae6={};_0x1a1ae6[_0x385d('0x3b')]=_['keys'](db['VoiceQueue'][_0x385d('0x38')]);_0x2962e5[_0x385d('0x3e')]=_[_0x385d('0x4d')](_0x1a1ae6[_0x385d('0x3b')],qs['fields'](_0x27e38b[_0x385d('0x3d')][_0x385d('0x3f')]));_0x2962e5[_0x385d('0x3e')]=_0x2962e5[_0x385d('0x3e')][_0x385d('0x57')]?_0x2962e5['attributes']:_0x1a1ae6['model'];if(_0x27e38b[_0x385d('0x3d')][_0x385d('0x48')]){_0x2962e5['include']=[{'all':!![]}];}_0x2962e5=_[_0x385d('0x46')]({},_0x2962e5,_0x27e38b[_0x385d('0x47')]);return db[_0x385d('0x37')][_0x385d('0x2f')](_0x2962e5)[_0x385d('0x32')](handleEntityNotFound(_0x5f2aa1,null))[_0x385d('0x32')](function(_0x18cf94){if(_0x18cf94){var _0x3990e8=_0x18cf94[_0x385d('0x26')]({'plain':!![]});_0x3990e8=qs['omit'](_0x3990e8,['id',_0x385d('0x58'),_0x385d('0x59')]);_0x27e38b[_0x385d('0x4f')]=_['omit'](_0x27e38b['body'],['id',_0x385d('0x58'),'updatedAt']);return db[_0x385d('0x37')][_0x385d('0x4e')](_[_0x385d('0x46')](_0x3990e8,_0x27e38b[_0x385d('0x4f')]),{'include':_0x27e38b['query']['includeAll']?[{'all':!![]}]:undefined})[_0x385d('0x32')](function(_0x14ee5b){var _0x153207=_0x27e38b[_0x385d('0x52')]['get']({'plain':!![]});if(!_0x153207)throw new Error(_0x385d('0x50'));if(_0x153207[_0x385d('0x51')]===_0x385d('0x52')){var _0x7c5081=_0x14ee5b['get']({'plain':!![]});var _0xb53a50=[{'name':_0x385d('0x27'),'value':'inbound'},{'name':_0x385d('0x28'),'value':_0x385d('0x29')}];var _0x319d3e=_[_0x385d('0x2f')](_0xb53a50,[_0x385d('0x2d'),_0x7c5081[_0x385d('0x2e')]])['name'];return db[_0x385d('0x53')][_0x385d('0x2f')]({'where':{'name':_0x319d3e,'userProfileId':_0x153207['userProfileId']},'raw':!![]})['then'](function(_0x45ade7){if(_0x45ade7&&_0x45ade7['autoAssociation']===0x0){return db[_0x385d('0x31')][_0x385d('0x4e')]({'name':_0x7c5081['name'],'resourceId':_0x7c5081['id'],'type':_0x45ade7[_0x385d('0x30')],'sectionId':_0x45ade7['id']},{})[_0x385d('0x32')](function(){return _0x14ee5b;});}else{return _0x14ee5b;}})['catch'](function(_0x48c95d){logger[_0x385d('0x33')](_0x385d('0x5a'),_0x48c95d);throw _0x48c95d;});}return _0x14ee5b;});}})['then'](respondWithResult(_0x5f2aa1,0xc9))[_0x385d('0x4b')](handleError(_0x5f2aa1,null));};exports['update']=function(_0x38d8ce,_0x4e2ad6){if(_0x38d8ce[_0x385d('0x4f')]['id']){delete _0x38d8ce[_0x385d('0x4f')]['id'];}return db[_0x385d('0x37')][_0x385d('0x2f')]({'where':{'id':_0x38d8ce[_0x385d('0x5b')]['id']}})[_0x385d('0x32')](handleEntityNotFound(_0x4e2ad6,null))[_0x385d('0x32')](saveUpdates(_0x38d8ce[_0x385d('0x4f')],null))[_0x385d('0x32')](respondWithResult(_0x4e2ad6,null))[_0x385d('0x4b')](handleError(_0x4e2ad6,null));};exports[_0x385d('0x25')]=function(_0x4f5e3a,_0x55d887){return db['VoiceQueue'][_0x385d('0x2f')]({'where':{'id':_0x4f5e3a[_0x385d('0x5b')]['id']}})['then'](handleEntityNotFound(_0x55d887,null))['then'](removeEntity(_0x55d887,null))['catch'](handleError(_0x55d887,null));};exports[_0x385d('0x5c')]=function(_0x567bbd,_0x3589ff,_0x1823b3){var _0x4e7f81={'raw':![],'where':{}};var _0x3910ee={};var _0x5b0924={'count':0x0,'rows':[]};return db[_0x385d('0x37')][_0x385d('0x5d')]({'where':{'id':_0x567bbd['params']['id']}})['then'](handleEntityNotFound(_0x3589ff,null))[_0x385d('0x32')](function(_0x5a73bb){if(_0x5a73bb){_0x3910ee['model']=_[_0x385d('0x4c')](db[_0x385d('0x5e')][_0x385d('0x38')]);_0x3910ee[_0x385d('0x3d')]=_[_0x385d('0x4c')](_0x567bbd[_0x385d('0x3d')]);_0x3910ee[_0x385d('0x3c')]=_[_0x385d('0x4d')](_0x3910ee[_0x385d('0x3b')],_0x3910ee[_0x385d('0x3d')]);_0x4e7f81[_0x385d('0x3e')]=_[_0x385d('0x4d')](_0x3910ee[_0x385d('0x3b')],qs['fields'](_0x567bbd[_0x385d('0x3d')][_0x385d('0x3f')]));_0x4e7f81[_0x385d('0x3e')]=_0x4e7f81[_0x385d('0x3e')]['length']?_0x4e7f81[_0x385d('0x3e')]:_0x3910ee[_0x385d('0x3b')];if(!_0x567bbd[_0x385d('0x3d')][_0x385d('0x40')](_0x385d('0x41'))){_0x4e7f81[_0x385d('0x21')]=qs[_0x385d('0x21')](_0x567bbd[_0x385d('0x3d')]['limit']);_0x4e7f81[_0x385d('0x20')]=qs[_0x385d('0x20')](_0x567bbd[_0x385d('0x3d')]['offset']);}_0x4e7f81[_0x385d('0x42')]=qs['sort'](_0x567bbd[_0x385d('0x3d')][_0x385d('0x43')]);_0x4e7f81['where']=qs[_0x385d('0x3c')](_[_0x385d('0x45')](_0x567bbd[_0x385d('0x3d')],_0x3910ee[_0x385d('0x3c')]));_0x4e7f81[_0x385d('0x44')][_0x385d('0x5f')]=_0x5a73bb['id'];if(_0x567bbd['query']['filter']){_0x4e7f81[_0x385d('0x44')]=_[_0x385d('0x46')](_0x4e7f81[_0x385d('0x44')],{'$or':_[_0x385d('0x2c')](_0x4e7f81[_0x385d('0x3e')],function(_0x5c9712){var _0x14ff80={};_0x14ff80[_0x5c9712]={'$like':'%'+_0x567bbd[_0x385d('0x3d')][_0x385d('0x2a')]+'%'};return _0x14ff80;})});}_0x4e7f81=_[_0x385d('0x46')]({},_0x4e7f81,_0x567bbd['options']);return db[_0x385d('0x5e')][_0x385d('0x1f')]({'where':_0x4e7f81[_0x385d('0x44')]})[_0x385d('0x32')](function(_0x5904e1){_0x5b0924['count']=_0x5904e1;if(_0x567bbd[_0x385d('0x3d')][_0x385d('0x48')]){_0x4e7f81[_0x385d('0x49')]=[{'all':!![]}];}return db[_0x385d('0x5e')][_0x385d('0x4a')](_0x4e7f81);})[_0x385d('0x32')](function(_0xc62000){_0x5b0924[_0x385d('0x60')]=_0xc62000;return _0x5b0924;});}})[_0x385d('0x32')](respondWithFilteredResult(_0x3589ff,_0x4e7f81))[_0x385d('0x4b')](handleError(_0x3589ff,null));};exports[_0x385d('0x61')]=function(_0x2ff4dc,_0x11b97f,_0x6f92c1){var _0x4b1767={'raw':!![],'where':{}};var _0x398ed6={};var _0x378d1b={'count':0x0,'rows':[]};return db[_0x385d('0x37')][_0x385d('0x5d')]({'where':{'id':_0x2ff4dc['params']['id']}})[_0x385d('0x32')](handleEntityNotFound(_0x11b97f,null))[_0x385d('0x32')](function(_0x4f90cc){if(_0x4f90cc){_0x398ed6[_0x385d('0x3b')]=_['keys'](db[_0x385d('0x62')][_0x385d('0x38')]);_0x398ed6[_0x385d('0x3d')]=_[_0x385d('0x4c')](_0x2ff4dc[_0x385d('0x3d')]);_0x398ed6['filters']=_[_0x385d('0x4d')](_0x398ed6['model'],_0x398ed6[_0x385d('0x3d')]);_0x4b1767[_0x385d('0x3e')]=_[_0x385d('0x4d')](_0x398ed6[_0x385d('0x3b')],qs[_0x385d('0x3f')](_0x2ff4dc[_0x385d('0x3d')][_0x385d('0x3f')]));_0x4b1767[_0x385d('0x3e')]=_0x4b1767['attributes'][_0x385d('0x57')]?_0x4b1767['attributes']:_0x398ed6['model'];if(!_0x2ff4dc[_0x385d('0x3d')][_0x385d('0x40')](_0x385d('0x41'))){_0x4b1767[_0x385d('0x21')]=qs['limit'](_0x2ff4dc[_0x385d('0x3d')][_0x385d('0x21')]);_0x4b1767['offset']=qs[_0x385d('0x20')](_0x2ff4dc['query'][_0x385d('0x20')]);}_0x4b1767[_0x385d('0x42')]=qs[_0x385d('0x43')](_0x2ff4dc['query']['sort']);_0x4b1767[_0x385d('0x44')]=qs[_0x385d('0x3c')](_[_0x385d('0x45')](_0x2ff4dc['query'],_0x398ed6[_0x385d('0x3c')]));_0x4b1767[_0x385d('0x44')][_0x385d('0x5f')]=_0x4f90cc['id'];if(_0x2ff4dc[_0x385d('0x3d')]['filter']){_0x4b1767[_0x385d('0x44')]=_[_0x385d('0x46')](_0x4b1767['where'],{'$or':_[_0x385d('0x2c')](_0x4b1767['attributes'],function(_0x1b12c7){var _0x228e80={};_0x228e80[_0x1b12c7]={'$like':'%'+_0x2ff4dc['query'][_0x385d('0x2a')]+'%'};return _0x228e80;})});}_0x4b1767=_[_0x385d('0x46')]({},_0x4b1767,_0x2ff4dc['options']);return db['CmHopperHistory']['count']({'where':_0x4b1767[_0x385d('0x44')]})['then'](function(_0x51db05){_0x378d1b['count']=_0x51db05;if(_0x2ff4dc[_0x385d('0x3d')][_0x385d('0x48')]){_0x4b1767['include']=[{'all':!![]}];}return db[_0x385d('0x62')][_0x385d('0x4a')](_0x4b1767);})['then'](function(_0x3e4810){_0x378d1b[_0x385d('0x60')]=_0x3e4810;return _0x378d1b;});}})[_0x385d('0x32')](respondWithFilteredResult(_0x11b97f,_0x4b1767))[_0x385d('0x4b')](handleError(_0x11b97f,null));};exports['getHopperFinals']=function(_0x1532b2,_0x5d3995,_0x585f76){var _0x9f4851={'raw':!![],'where':{}};var _0x56b235={};var _0xbcbd56={'count':0x0,'rows':[]};return db[_0x385d('0x37')][_0x385d('0x5d')]({'where':{'id':_0x1532b2['params']['id']}})[_0x385d('0x32')](handleEntityNotFound(_0x5d3995,null))[_0x385d('0x32')](function(_0x299dda){if(_0x299dda){_0x56b235[_0x385d('0x3b')]=_[_0x385d('0x4c')](db[_0x385d('0x63')]['rawAttributes']);_0x56b235[_0x385d('0x3d')]=_[_0x385d('0x4c')](_0x1532b2['query']);_0x56b235['filters']=_[_0x385d('0x4d')](_0x56b235['model'],_0x56b235[_0x385d('0x3d')]);_0x9f4851['attributes']=_[_0x385d('0x4d')](_0x56b235['model'],qs['fields'](_0x1532b2[_0x385d('0x3d')][_0x385d('0x3f')]));_0x9f4851[_0x385d('0x3e')]=_0x9f4851[_0x385d('0x3e')][_0x385d('0x57')]?_0x9f4851['attributes']:_0x56b235[_0x385d('0x3b')];if(!_0x1532b2[_0x385d('0x3d')][_0x385d('0x40')]('nolimit')){_0x9f4851[_0x385d('0x21')]=qs[_0x385d('0x21')](_0x1532b2['query'][_0x385d('0x21')]);_0x9f4851[_0x385d('0x20')]=qs[_0x385d('0x20')](_0x1532b2[_0x385d('0x3d')][_0x385d('0x20')]);}_0x9f4851[_0x385d('0x42')]=qs[_0x385d('0x43')](_0x1532b2[_0x385d('0x3d')][_0x385d('0x43')]);_0x9f4851[_0x385d('0x44')]=qs[_0x385d('0x3c')](_[_0x385d('0x45')](_0x1532b2[_0x385d('0x3d')],_0x56b235['filters']));_0x9f4851[_0x385d('0x44')][_0x385d('0x5f')]=_0x299dda['id'];if(_0x1532b2[_0x385d('0x3d')][_0x385d('0x2a')]){_0x9f4851[_0x385d('0x44')]=_[_0x385d('0x46')](_0x9f4851['where'],{'$or':_[_0x385d('0x2c')](_0x9f4851[_0x385d('0x3e')],function(_0x3fe27f){var _0x4d3d76={};_0x4d3d76[_0x3fe27f]={'$like':'%'+_0x1532b2[_0x385d('0x3d')]['filter']+'%'};return _0x4d3d76;})});}_0x9f4851=_[_0x385d('0x46')]({},_0x9f4851,_0x1532b2[_0x385d('0x47')]);return db[_0x385d('0x63')][_0x385d('0x1f')]({'where':_0x9f4851[_0x385d('0x44')]})['then'](function(_0x5b3418){_0xbcbd56[_0x385d('0x1f')]=_0x5b3418;if(_0x1532b2[_0x385d('0x3d')][_0x385d('0x48')]){_0x9f4851['include']=[{'all':!![]}];}return db[_0x385d('0x63')]['findAll'](_0x9f4851);})['then'](function(_0x23d714){_0xbcbd56[_0x385d('0x60')]=_0x23d714;return _0xbcbd56;});}})[_0x385d('0x32')](respondWithFilteredResult(_0x5d3995,_0x9f4851))['catch'](handleError(_0x5d3995,null));};exports[_0x385d('0x64')]=function(_0x5354df,_0x103170,_0x45994f){var _0x3e9d77={'raw':!![],'where':{}};var _0x2c668b={};var _0x4b18c2={'count':0x0,'rows':[]};return db[_0x385d('0x37')][_0x385d('0x5d')]({'where':{'id':_0x5354df[_0x385d('0x5b')]['id']}})[_0x385d('0x32')](handleEntityNotFound(_0x103170,null))[_0x385d('0x32')](function(_0xcaa2fc){if(_0xcaa2fc){_0x2c668b['model']=_['keys'](db[_0x385d('0x65')][_0x385d('0x38')]);_0x2c668b[_0x385d('0x3d')]=_['keys'](_0x5354df[_0x385d('0x3d')]);_0x2c668b['filters']=_['intersection'](_0x2c668b[_0x385d('0x3b')],_0x2c668b[_0x385d('0x3d')]);_0x3e9d77[_0x385d('0x3e')]=_[_0x385d('0x4d')](_0x2c668b[_0x385d('0x3b')],qs[_0x385d('0x3f')](_0x5354df[_0x385d('0x3d')][_0x385d('0x3f')]));_0x3e9d77[_0x385d('0x3e')]=_0x3e9d77[_0x385d('0x3e')]['length']?_0x3e9d77['attributes']:_0x2c668b[_0x385d('0x3b')];if(!_0x5354df[_0x385d('0x3d')][_0x385d('0x40')](_0x385d('0x41'))){_0x3e9d77['limit']=qs['limit'](_0x5354df[_0x385d('0x3d')][_0x385d('0x21')]);_0x3e9d77[_0x385d('0x20')]=qs[_0x385d('0x20')](_0x5354df['query'][_0x385d('0x20')]);}_0x3e9d77[_0x385d('0x42')]=qs[_0x385d('0x43')](_0x5354df['query']['sort']);_0x3e9d77[_0x385d('0x44')]=qs['filters'](_['pick'](_0x5354df[_0x385d('0x3d')],_0x2c668b[_0x385d('0x3c')]));_0x3e9d77['where'][_0x385d('0x5f')]=_0xcaa2fc['id'];if(_0x5354df[_0x385d('0x3d')][_0x385d('0x2a')]){_0x3e9d77['where']=_['merge'](_0x3e9d77[_0x385d('0x44')],{'$or':_['map'](_0x3e9d77[_0x385d('0x3e')],function(_0x56a4a1){var _0x45421a={};_0x45421a[_0x56a4a1]={'$like':'%'+_0x5354df[_0x385d('0x3d')][_0x385d('0x2a')]+'%'};return _0x45421a;})});}_0x3e9d77=_[_0x385d('0x46')]({},_0x3e9d77,_0x5354df[_0x385d('0x47')]);return db['CmHopperBlack']['count']({'where':_0x3e9d77['where']})['then'](function(_0x1f6594){_0x4b18c2['count']=_0x1f6594;if(_0x5354df[_0x385d('0x3d')][_0x385d('0x48')]){_0x3e9d77[_0x385d('0x49')]=[{'all':!![]}];}return db[_0x385d('0x65')]['findAll'](_0x3e9d77);})[_0x385d('0x32')](function(_0x121610){_0x4b18c2['rows']=_0x121610;return _0x4b18c2;});}})[_0x385d('0x32')](respondWithFilteredResult(_0x103170,_0x3e9d77))[_0x385d('0x4b')](handleError(_0x103170,null));};exports[_0x385d('0x66')]=function(_0x17165f,_0x3d4c99,_0x42f3d0){var _0x2cba9d={};var _0x31ad30={};var _0x278595;var _0x1c1a41;return db[_0x385d('0x37')][_0x385d('0x5d')]({'where':{'id':_0x17165f['params']['id']}})['then'](handleEntityNotFound(_0x3d4c99,null))[_0x385d('0x32')](function(_0x266c15){if(_0x266c15){_0x278595=_0x266c15;_0x31ad30[_0x385d('0x3b')]=_[_0x385d('0x4c')](db['Team'][_0x385d('0x38')]);_0x31ad30[_0x385d('0x3d')]=_[_0x385d('0x4c')](_0x17165f['query']);_0x31ad30['filters']=_[_0x385d('0x4d')](_0x31ad30[_0x385d('0x3b')],_0x31ad30[_0x385d('0x3d')]);_0x2cba9d[_0x385d('0x3e')]=_[_0x385d('0x4d')](_0x31ad30['model'],qs[_0x385d('0x3f')](_0x17165f['query'][_0x385d('0x3f')]));_0x2cba9d[_0x385d('0x3e')]=_0x2cba9d[_0x385d('0x3e')][_0x385d('0x57')]?_0x2cba9d[_0x385d('0x3e')]:_0x31ad30[_0x385d('0x3b')];_0x2cba9d[_0x385d('0x42')]=qs[_0x385d('0x43')](_0x17165f[_0x385d('0x3d')][_0x385d('0x43')]);_0x2cba9d[_0x385d('0x44')]=qs[_0x385d('0x3c')](_['pick'](_0x17165f['query'],_0x31ad30[_0x385d('0x3c')]));if(_0x17165f[_0x385d('0x3d')][_0x385d('0x2a')]){_0x2cba9d['where']=_[_0x385d('0x46')](_0x2cba9d[_0x385d('0x44')],{'$or':_[_0x385d('0x2c')](_0x2cba9d[_0x385d('0x3e')],function(_0x41b676){var _0x2598d4={};_0x2598d4[_0x41b676]={'$like':'%'+_0x17165f[_0x385d('0x3d')][_0x385d('0x2a')]+'%'};return _0x2598d4;})});}_0x2cba9d=_['merge']({},_0x2cba9d,_0x17165f[_0x385d('0x47')]);return _0x278595[_0x385d('0x66')](_0x2cba9d);}})['then'](function(_0x741f88){if(_0x741f88){_0x1c1a41=_0x741f88[_0x385d('0x57')];if(!_0x17165f[_0x385d('0x3d')][_0x385d('0x40')]('nolimit')){_0x2cba9d[_0x385d('0x21')]=qs[_0x385d('0x21')](_0x17165f[_0x385d('0x3d')][_0x385d('0x21')]);_0x2cba9d['offset']=qs[_0x385d('0x20')](_0x17165f[_0x385d('0x3d')][_0x385d('0x20')]);}return _0x278595[_0x385d('0x66')](_0x2cba9d);}})[_0x385d('0x32')](function(_0x3f7cf6){if(_0x3f7cf6){return _0x3f7cf6?{'count':_0x1c1a41,'rows':_0x3f7cf6}:null;}})['then'](respondWithResult(_0x3d4c99,null))[_0x385d('0x4b')](handleError(_0x3d4c99,null));};exports[_0x385d('0x67')]=function(_0xf905a3,_0x57a7b,_0x343932){var _0x4173ae=_0xf905a3[_0x385d('0x4f')][_0x385d('0x68')];var _0x2c7678=_[_0x385d('0x2c')](_0x4173ae,'id');return db[_0x385d('0x69')][_0x385d('0x4a')]({'where':{'id':_0x2c7678},'attributes':['id'],'include':[{'model':db[_0x385d('0x6a')],'as':_0x385d('0x6b'),'attributes':['id',_0x385d('0x30'),'online',_0x385d('0x6c'),_0x385d('0x6d')],'raw':!![]}]})[_0x385d('0x32')](function(_0x15acc6){if(_0x15acc6){var _0x1569b7=_[_0x385d('0x6e')](_0x15acc6,function(_0x315032){var _0x59a283=_0x315032['get']({'plain':!![]});_0x59a283[_0x385d('0x6b')][_0x385d('0x6f')](function(_0x1d52e7){_0x1d52e7[_0x385d('0x70')]=_[_0x385d('0x2f')](_0x4173ae,{'id':_0x59a283['id']})[_0x385d('0x70')];});return _0x59a283[_0x385d('0x6b')];});return db[_0x385d('0x37')][_0x385d('0x2f')]({'where':{'id':_0xf905a3[_0x385d('0x5b')]['id']}})['then'](function(_0x33fb08){return db[_0x385d('0x71')][_0x385d('0x72')](function(_0x1d254a){return _0x33fb08['addTeams'](_0x2c7678,{'transaction':_0x1d254a})[_0x385d('0x32')](function(){return BPromise[_0x385d('0x73')](_0x1569b7,function(_0x16e5e5){return db[_0x385d('0x74')][_0x385d('0x75')]({'where':{'UserId':_0x16e5e5['id'],'VoiceQueueId':_0xf905a3[_0x385d('0x5b')]['id']},'defaults':{'penalty':_0x16e5e5[_0x385d('0x70')]},'transaction':_0x1d254a});});})[_0x385d('0x32')](function(){return BPromise['each'](_['filter'](_0x1569b7,{'online':!![]}),function(_0x5239dc){return db[_0x385d('0x76')][_0x385d('0x77')]({'membername':_0x5239dc[_0x385d('0x30')],'UserId':_0x5239dc['id'],'queue_name':_0x33fb08[_0x385d('0x30')],'VoiceQueueId':_0x33fb08['id'],'interface':_['isNil'](_0x5239dc[_0x385d('0x6d')])?util[_0x385d('0x78')](_0x385d('0x79'),_0x5239dc[_0x385d('0x30')]):_0x5239dc[_0x385d('0x6d')],'paused':_0x5239dc[_0x385d('0x6c')]||![],'penalty':_0x5239dc[_0x385d('0x70')]},{'transaction':_0x1d254a});});})[_0x385d('0x32')](function(){_0x1569b7[_0x385d('0x6f')](function(_0x31dc5e){socket[_0x385d('0x7a')](_0x385d('0x7b'),{'UserId':_0x31dc5e['id'],'VoiceQueueId':_0x33fb08['id']});});});});});}})['then'](respondWithStatusCode(_0x57a7b,null))[_0x385d('0x4b')](handleError(_0x57a7b,null));};exports[_0x385d('0x7c')]=function(_0x3ff7fa,_0x47ba58,_0x3f5cb4){return db[_0x385d('0x69')][_0x385d('0x4a')]({'where':{'id':_0x3ff7fa['query'][_0x385d('0x7d')]},'attributes':['id'],'include':[{'model':db[_0x385d('0x6a')],'as':_0x385d('0x6b'),'attributes':['id'],'raw':!![]}]})[_0x385d('0x32')](handleEntityNotFound(_0x47ba58,null))[_0x385d('0x32')](function(_0x412826){var _0x19e95b=_[_0x385d('0x2c')](_0x412826,'id');var _0x4e7c77=[];var _0x11f074=[];var _0x2df205=squel[_0x385d('0x7e')]();_0x2df205[_0x385d('0x7f')](_0x385d('0x80'))[_0x385d('0x81')](_0x385d('0x82'),'tq')['join'](_0x385d('0x83'),'ut',_0x385d('0x84'))[_0x385d('0x44')]('VoiceQueueId\x20=\x20?',_0x3ff7fa['params']['id']);for(var _0x23bd8e=0x0;_0x23bd8e<_0x412826[_0x385d('0x57')];_0x23bd8e+=0x1){let _0xd01d71=_0x412826[_0x23bd8e];for(var _0x49425f=0x0;_0x49425f<_0xd01d71['Agents'][_0x385d('0x57')];_0x49425f+=0x1){let _0x3483be=_0xd01d71[_0x385d('0x6b')][_0x49425f];var _0x47e5a9=_0x2df205[_0x385d('0x56')]();_0x47e5a9[_0x385d('0x44')](_0x385d('0x85'),_0x3483be['id']);_0x11f074[_0x385d('0x86')](db[_0x385d('0x71')][_0x385d('0x3d')](_0x47e5a9['toString'](),{'type':db[_0x385d('0x71')][_0x385d('0x87')][_0x385d('0x88')]})[_0x385d('0x32')](function(_0xb467b4){if(_0xb467b4[_0x385d('0x57')]===0x1){return _0x3483be['id'];}else{var _0x4f09fc=_[_0x385d('0x89')](_[_0x385d('0x2c')](_0xb467b4,_0x385d('0x8a')),function(_0x59e38c){return _['includes'](_0x19e95b,_0x59e38c);});if(_0x4f09fc){return _0x3483be['id'];}}}));}}return BPromise[_0x385d('0x8b')](_0x11f074)['then'](function(_0x35c1a7){_0x4e7c77=_(_0x4e7c77)[_0x385d('0x8c')](_0x35c1a7)[_0x385d('0x8d')]()[_0x385d('0x2d')]();return db[_0x385d('0x37')][_0x385d('0x2f')]({'where':{'id':_0x3ff7fa['params']['id']}})[_0x385d('0x32')](function(_0x209f7b){return db[_0x385d('0x71')]['transaction'](function(_0x13baaf){return _0x209f7b['removeTeams'](_0x3ff7fa[_0x385d('0x3d')][_0x385d('0x7d')],{'transaction':_0x13baaf})[_0x385d('0x32')](function(){if(!_[_0x385d('0x8e')](_0x4e7c77)){return _0x209f7b[_0x385d('0x8f')](_0x4e7c77,{'transaction':_0x13baaf})['then'](function(){return db[_0x385d('0x76')]['destroy']({'where':{'VoiceQueueId':_0x3ff7fa[_0x385d('0x5b')]['id'],'UserId':_0x4e7c77},'transaction':_0x13baaf});});}})[_0x385d('0x32')](function(){_0x4e7c77[_0x385d('0x6f')](function(_0x39eee3){socket[_0x385d('0x7a')](_0x385d('0x90'),{'UserId':_0x39eee3,'VoiceQueueId':_0x209f7b['id']});});});});});});})[_0x385d('0x32')](respondWithStatusCode(_0x47ba58,null))['catch'](handleError(_0x47ba58,null));};exports[_0x385d('0x91')]=function(_0x33e2e4,_0x43c6a5,_0x21cbee){var _0x2b096a,_0xcc6fe3;return db[_0x385d('0x37')]['find']({'where':{'id':_0x33e2e4[_0x385d('0x5b')]['id']}})[_0x385d('0x32')](handleEntityNotFound(_0x43c6a5,null))[_0x385d('0x32')](function(_0x44a48c){if(_0x44a48c){_0xcc6fe3=_0x44a48c;return _0x44a48c[_0x385d('0x91')](_0x33e2e4[_0x385d('0x4f')][_0x385d('0x7d')],_[_0x385d('0x92')](_0x33e2e4[_0x385d('0x4f')],['ids','id'])||{})[_0x385d('0x93')](function(_0x45acca){for(var _0x542236=0x0;_0x542236<_0x33e2e4[_0x385d('0x4f')][_0x385d('0x7d')][_0x385d('0x57')];_0x542236+=0x1){socket[_0x385d('0x7a')]('userVoiceQueue:save',{'UserId':_0x33e2e4['body']['ids'][_0x542236],'VoiceQueueId':_0x33e2e4[_0x385d('0x5b')]['id']});}return _0x45acca;});}})[_0x385d('0x32')](function(_0x250af6){_0x2b096a=_0x250af6||[];if(_0xcc6fe3){return db['User'][_0x385d('0x4a')]({'where':{'id':_0x33e2e4[_0x385d('0x4f')][_0x385d('0x7d')]},'attributes':['id',_0x385d('0x30'),_0x385d('0x94'),_0x385d('0x6c'),_0x385d('0x6d')],'raw':!![]});}})[_0x385d('0x32')](function(_0x424c4f){if(!_[_0x385d('0x8e')](_0x424c4f)){var _0x4ee183=[];for(var _0x13ac3f=0x0;_0x13ac3f<_0x424c4f[_0x385d('0x57')];_0x13ac3f++){if(_0x424c4f[_0x13ac3f][_0x385d('0x94')]){_0x4ee183['push'](db[_0x385d('0x76')][_0x385d('0x77')]({'membername':_0x424c4f[_0x13ac3f][_0x385d('0x30')],'UserId':_0x424c4f[_0x13ac3f]['id'],'queue_name':_0xcc6fe3['name'],'VoiceQueueId':_0xcc6fe3['id'],'interface':_[_0x385d('0x95')](_0x424c4f[_0x13ac3f][_0x385d('0x6d')])?util[_0x385d('0x78')]('SIP/%s',_0x424c4f[_0x13ac3f][_0x385d('0x30')]):_0x424c4f[_0x13ac3f][_0x385d('0x6d')],'paused':_0x424c4f[_0x13ac3f]['voicePause']||![],'penalty':_0x33e2e4[_0x385d('0x4f')]['penalty']||0x0}));}}return BPromise[_0x385d('0x8b')](_0x4ee183);}})['then'](function(){return _0x2b096a;})[_0x385d('0x32')](respondWithResult(_0x43c6a5,null))['catch'](handleError(_0x43c6a5,null));};exports[_0x385d('0x8f')]=function(_0x537cf6,_0xc5c4c2,_0x6649cd){return db[_0x385d('0x37')][_0x385d('0x2f')]({'where':{'id':_0x537cf6[_0x385d('0x5b')]['id']}})[_0x385d('0x32')](handleEntityNotFound(_0xc5c4c2,null))['then'](function(_0x465699){if(_0x465699){return _0x465699[_0x385d('0x8f')](_0x537cf6['query'][_0x385d('0x7d')])['then'](function(){if(_['isArray'](_0x537cf6[_0x385d('0x3d')][_0x385d('0x7d')])){for(var _0x4c2333=0x0;_0x4c2333<_0x537cf6['query'][_0x385d('0x7d')][_0x385d('0x57')];_0x4c2333+=0x1){socket[_0x385d('0x7a')](_0x385d('0x90'),{'UserId':Number(_0x537cf6[_0x385d('0x3d')][_0x385d('0x7d')][_0x4c2333]),'VoiceQueueId':Number(_0x537cf6[_0x385d('0x5b')]['id'])});}}else{socket[_0x385d('0x7a')]('userVoiceQueue:remove',{'UserId':Number(_0x537cf6[_0x385d('0x3d')][_0x385d('0x7d')]),'VoiceQueueId':Number(_0x537cf6['params']['id'])});}});}})[_0x385d('0x32')](function(_0x543eb8){return db[_0x385d('0x76')]['destroy']({'where':{'VoiceQueueId':_0x537cf6[_0x385d('0x5b')]['id'],'UserId':_0x537cf6[_0x385d('0x3d')][_0x385d('0x7d')]}})[_0x385d('0x32')](function(){return _0x543eb8;});})[_0x385d('0x32')](respondWithStatusCode(_0xc5c4c2,null))[_0x385d('0x4b')](handleError(_0xc5c4c2,null));};exports[_0x385d('0x96')]=function(_0x1bb8be,_0x1b3387,_0x57785f){var _0x4e7b5a={};var _0x1b0a60={};var _0x2d2b66;var _0x3a2dbe;return db[_0x385d('0x37')]['findOne']({'where':{'id':_0x1bb8be['params']['id']}})[_0x385d('0x32')](handleEntityNotFound(_0x1b3387,null))['then'](function(_0x148841){if(_0x148841){_0x2d2b66=_0x148841;_0x1b0a60[_0x385d('0x3b')]=_['keys'](db['User'][_0x385d('0x38')]);_0x1b0a60[_0x385d('0x3d')]=_[_0x385d('0x4c')](_0x1bb8be[_0x385d('0x3d')]);_0x1b0a60[_0x385d('0x3c')]=_[_0x385d('0x4d')](_0x1b0a60[_0x385d('0x3b')],_0x1b0a60[_0x385d('0x3d')]);_0x4e7b5a[_0x385d('0x3e')]=_[_0x385d('0x4d')](_0x1b0a60[_0x385d('0x3b')],qs[_0x385d('0x3f')](_0x1bb8be[_0x385d('0x3d')][_0x385d('0x3f')]));_0x4e7b5a[_0x385d('0x3e')]=_0x4e7b5a['attributes'][_0x385d('0x57')]?_0x4e7b5a[_0x385d('0x3e')]:_0x1b0a60['model'];_0x4e7b5a[_0x385d('0x42')]=qs['sort'](_0x1bb8be['query']['sort']);_0x4e7b5a[_0x385d('0x44')]=qs[_0x385d('0x3c')](_['pick'](_0x1bb8be[_0x385d('0x3d')],_0x1b0a60[_0x385d('0x3c')]));if(_0x1bb8be[_0x385d('0x3d')][_0x385d('0x2a')]){_0x4e7b5a[_0x385d('0x44')]=_[_0x385d('0x46')](_0x4e7b5a[_0x385d('0x44')],{'$or':_['map'](_0x4e7b5a['attributes'],function(_0x15cf85){var _0x912b03={};_0x912b03[_0x15cf85]={'$like':'%'+_0x1bb8be[_0x385d('0x3d')][_0x385d('0x2a')]+'%'};return _0x912b03;})});}_0x4e7b5a=_[_0x385d('0x46')]({},_0x4e7b5a,_0x1bb8be['options']);return _0x2d2b66['getAgents'](_0x4e7b5a);}})[_0x385d('0x32')](function(_0x839081){if(_0x839081){_0x3a2dbe=_0x839081['length'];if(!_0x1bb8be[_0x385d('0x3d')]['hasOwnProperty'](_0x385d('0x41'))){_0x4e7b5a[_0x385d('0x21')]=qs[_0x385d('0x21')](_0x1bb8be[_0x385d('0x3d')][_0x385d('0x21')]);_0x4e7b5a['offset']=qs[_0x385d('0x20')](_0x1bb8be[_0x385d('0x3d')][_0x385d('0x20')]);}return _0x2d2b66[_0x385d('0x96')](_0x4e7b5a);}})[_0x385d('0x32')](function(_0x211f6f){if(_0x211f6f){return _0x211f6f?{'count':_0x3a2dbe,'rows':_0x211f6f}:null;}})[_0x385d('0x32')](respondWithResult(_0x1b3387,null))[_0x385d('0x4b')](handleError(_0x1b3387,null));};exports[_0x385d('0x97')]=function(_0xf181c4,_0x12808d,_0x1fd87e){var _0x411e5e={};var _0x17804c={};var _0x3a4a6d;var _0x49d829;return db[_0x385d('0x37')]['findOne']({'where':{'id':_0xf181c4['params']['id']}})[_0x385d('0x32')](handleEntityNotFound(_0x12808d,null))[_0x385d('0x32')](function(_0x510215){if(_0x510215){_0x3a4a6d=_0x510215;_0x17804c['model']=_[_0x385d('0x4c')](db[_0x385d('0x76')][_0x385d('0x38')]);_0x17804c[_0x385d('0x3d')]=_[_0x385d('0x4c')](_0xf181c4['query']);_0x17804c['filters']=_[_0x385d('0x4d')](_0x17804c[_0x385d('0x3b')],_0x17804c[_0x385d('0x3d')]);_0x411e5e[_0x385d('0x3e')]=_[_0x385d('0x4d')](_0x17804c[_0x385d('0x3b')],qs[_0x385d('0x3f')](_0xf181c4[_0x385d('0x3d')][_0x385d('0x3f')]));_0x411e5e['attributes']=_0x411e5e[_0x385d('0x3e')][_0x385d('0x57')]?_0x411e5e[_0x385d('0x3e')]:_0x17804c[_0x385d('0x3b')];_0x411e5e[_0x385d('0x42')]=qs['sort'](_0xf181c4['query'][_0x385d('0x43')]);_0x411e5e[_0x385d('0x44')]=qs[_0x385d('0x3c')](_[_0x385d('0x45')](_0xf181c4['query'],_0x17804c[_0x385d('0x3c')]));if(_0xf181c4[_0x385d('0x3d')][_0x385d('0x2a')]){_0x411e5e[_0x385d('0x44')]=_[_0x385d('0x46')](_0x411e5e[_0x385d('0x44')],{'$or':_[_0x385d('0x2c')](_0x411e5e['attributes'],function(_0x27c35c){var _0x4e2acc={};_0x4e2acc[_0x27c35c]={'$like':'%'+_0xf181c4[_0x385d('0x3d')][_0x385d('0x2a')]+'%'};return _0x4e2acc;})});}_0x411e5e=_[_0x385d('0x46')]({},_0x411e5e,_0xf181c4[_0x385d('0x47')]);return _0x3a4a6d[_0x385d('0x97')](_0x411e5e);}})['then'](function(_0x57620d){if(_0x57620d){_0x49d829=_0x57620d[_0x385d('0x57')];if(!_0xf181c4[_0x385d('0x3d')][_0x385d('0x40')](_0x385d('0x41'))){_0x411e5e['limit']=qs['limit'](_0xf181c4['query']['limit']);_0x411e5e[_0x385d('0x20')]=qs[_0x385d('0x20')](_0xf181c4[_0x385d('0x3d')][_0x385d('0x20')]);}return _0x3a4a6d['getMembers'](_0x411e5e);}})[_0x385d('0x32')](function(_0x51f90a){return _0x51f90a?{'count':_0x49d829,'rows':_0x51f90a}:null;})[_0x385d('0x32')](respondWithResult(_0x12808d,null))[_0x385d('0x4b')](handleError(_0x12808d,null));};exports[_0x385d('0x98')]=function(_0x567717,_0x59c8fc,_0x50525e){var _0x5470b8={};var _0x5a8703={};var _0x4be617;var _0x4fbbdc;return db[_0x385d('0x37')][_0x385d('0x5d')]({'where':{'id':_0x567717[_0x385d('0x5b')]['id']}})[_0x385d('0x32')](handleEntityNotFound(_0x59c8fc,null))[_0x385d('0x32')](function(_0x4be4d9){if(_0x4be4d9){_0x4be617=_0x4be4d9;_0x5a8703['model']=_['keys'](db[_0x385d('0x99')]['rawAttributes']);_0x5a8703[_0x385d('0x3d')]=_[_0x385d('0x4c')](_0x567717[_0x385d('0x3d')]);_0x5a8703['filters']=_[_0x385d('0x4d')](_0x5a8703[_0x385d('0x3b')],_0x5a8703[_0x385d('0x3d')]);_0x5470b8['attributes']=_['intersection'](_0x5a8703[_0x385d('0x3b')],qs[_0x385d('0x3f')](_0x567717[_0x385d('0x3d')][_0x385d('0x3f')]));_0x5470b8['attributes']=_0x5470b8[_0x385d('0x3e')][_0x385d('0x57')]?_0x5470b8[_0x385d('0x3e')]:_0x5a8703['model'];_0x5470b8['order']=qs[_0x385d('0x43')](_0x567717[_0x385d('0x3d')][_0x385d('0x43')]);_0x5470b8[_0x385d('0x44')]=qs['filters'](_[_0x385d('0x45')](_0x567717[_0x385d('0x3d')],_0x5a8703[_0x385d('0x3c')]));if(_0x567717[_0x385d('0x3d')]['filter']){_0x5470b8['where']=_[_0x385d('0x46')](_0x5470b8[_0x385d('0x44')],{'$or':_[_0x385d('0x2c')](_0x5470b8[_0x385d('0x3e')],function(_0x108b8c){var _0x50cac6={};_0x50cac6[_0x108b8c]={'$like':'%'+_0x567717[_0x385d('0x3d')][_0x385d('0x2a')]+'%'};return _0x50cac6;})});}_0x5470b8=_['merge']({},_0x5470b8,_0x567717[_0x385d('0x47')]);return _0x4be617[_0x385d('0x98')](_0x5470b8);}})[_0x385d('0x32')](function(_0x27dd8e){if(_0x27dd8e){_0x4fbbdc=_0x27dd8e[_0x385d('0x57')];if(!_0x567717[_0x385d('0x3d')]['hasOwnProperty'](_0x385d('0x41'))){_0x5470b8[_0x385d('0x21')]=qs[_0x385d('0x21')](_0x567717['query'][_0x385d('0x21')]);_0x5470b8[_0x385d('0x20')]=qs[_0x385d('0x20')](_0x567717[_0x385d('0x3d')][_0x385d('0x20')]);}return _0x4be617['getLists'](_0x5470b8);}})[_0x385d('0x32')](function(_0xb3aa84){if(_0xb3aa84){return _0xb3aa84?{'count':_0x4fbbdc,'rows':_0xb3aa84}:null;}})['then'](respondWithResult(_0x59c8fc,null))[_0x385d('0x4b')](handleError(_0x59c8fc,null));};exports['addLists']=function(_0x82cf64,_0x5e1025,_0x341cfe){var _0x12cc5c,_0x17098a;return db[_0x385d('0x37')][_0x385d('0x2f')]({'where':{'id':_0x82cf64[_0x385d('0x5b')]['id']}})[_0x385d('0x32')](handleEntityNotFound(_0x5e1025,null))[_0x385d('0x32')](function(_0x1a1bdf){if(_0x1a1bdf){_0x17098a=_0x1a1bdf;return _0x1a1bdf[_0x385d('0x9a')](_0x82cf64['body'][_0x385d('0x7d')],_[_0x385d('0x92')](_0x82cf64[_0x385d('0x4f')],[_0x385d('0x7d'),'id'])||{});}return null;})[_0x385d('0x93')](function(_0x2f069c){var _0x1259a7;_0x12cc5c=_0x2f069c||[];var _0x2cd969=[];if(_0x2f069c){for(var _0x1b82d9=0x0;_0x1b82d9<_0x2f069c[_0x385d('0x57')];_0x1b82d9+=0x1){var _0x4867f0=_0x2f069c[_0x1b82d9][_0x385d('0x26')]({'plain':!![]});_0x17098a[_0x385d('0x9b')]=_0x82cf64[_0x385d('0x4f')][_0x385d('0x9b')]?_0x82cf64[_0x385d('0x4f')][_0x385d('0x9b')]:_0x17098a[_0x385d('0x9b')];switch(_0x17098a[_0x385d('0x9b')]){case _0x385d('0x9c'):_0x1259a7=squel[_0x385d('0x9d')]()[_0x385d('0x9e')](_0x385d('0x9f'))[_0x385d('0xa0')]([_0x385d('0xa1'),_0x385d('0xa2'),'ContactId',_0x385d('0xa3'),_0x385d('0x5f'),_0x385d('0x58'),_0x385d('0x59')],squel[_0x385d('0x7e')]()[_0x385d('0x7f')](_0x385d('0xa1'),_0x385d('0xa1'))['field'](_0x385d('0xa4'),_0x385d('0xa2'))[_0x385d('0x7f')]('id',_0x385d('0xa5'))[_0x385d('0x7f')](_0x4867f0['CmListId'][_0x385d('0xa6')](),_0x385d('0xa3'))[_0x385d('0x7f')](_0x82cf64[_0x385d('0x5b')]['id'][_0x385d('0xa6')](),_0x385d('0x5f'))[_0x385d('0x7f')](_0x385d('0xa4'),_0x385d('0x58'))[_0x385d('0x7f')](_0x385d('0xa4'),_0x385d('0x59'))['from'](_0x385d('0xa7'))[_0x385d('0x44')]('deletedAt\x20IS\x20NULL')['where'](_0x385d('0xa8'),_0x4867f0[_0x385d('0xa9')][_0x385d('0xa6')]())[_0x385d('0x44')]('phone\x20IS\x20NOT\x20NULL')[_0x385d('0x44')](_0x385d('0xaa'),squel[_0x385d('0x7e')]()[_0x385d('0x7f')](_0x385d('0xab'))[_0x385d('0x81')](_0x385d('0xac'))['where'](_0x385d('0xad'),_0x82cf64[_0x385d('0x5b')]['id'][_0x385d('0xa6')]()))[_0x385d('0x44')](_0x385d('0xaa'),squel[_0x385d('0x7e')]()[_0x385d('0x7f')]('COALESCE(phone,\x27\x27)')['from'](_0x385d('0x9f'))[_0x385d('0x44')](_0x385d('0xad'),_0x82cf64['params']['id']['toString']())))[_0x385d('0xa6')]();break;case _0x385d('0xae'):_0x1259a7=squel['insert']()['into'](_0x385d('0x9f'))[_0x385d('0xa0')]([_0x385d('0xa1'),_0x385d('0xa2'),_0x385d('0xa5'),_0x385d('0xa3'),_0x385d('0x5f'),_0x385d('0x58'),_0x385d('0x59')],squel[_0x385d('0x7e')]()[_0x385d('0x7f')](_0x385d('0xa1'),_0x385d('0xa1'))['field'](_0x385d('0xa4'),_0x385d('0xa2'))[_0x385d('0x7f')]('id',_0x385d('0xa5'))[_0x385d('0x7f')](_0x4867f0['CmListId'][_0x385d('0xa6')](),_0x385d('0xa3'))['field'](_0x82cf64[_0x385d('0x5b')]['id'][_0x385d('0xa6')](),_0x385d('0x5f'))[_0x385d('0x7f')](_0x385d('0xa4'),_0x385d('0x58'))['field']('NOW()',_0x385d('0x59'))[_0x385d('0x81')](_0x385d('0xa7'))[_0x385d('0x44')]('deletedAt\x20IS\x20NULL')['where'](_0x385d('0xa8'),_0x4867f0[_0x385d('0xa9')][_0x385d('0xa6')]())['where'](_0x385d('0xaf'))['where'](_0x385d('0xaa'),squel[_0x385d('0x7e')]()[_0x385d('0x7f')](_0x385d('0xb0'))[_0x385d('0x81')](_0x385d('0x9f'))[_0x385d('0x44')]('VoiceQueueId\x20=\x20?',_0x82cf64['params']['id'][_0x385d('0xa6')]())))[_0x385d('0xa6')]();break;default:_0x1259a7=squel['insert']()[_0x385d('0x9e')](_0x385d('0x9f'))[_0x385d('0xa0')](['phone',_0x385d('0xa2'),_0x385d('0xa5'),_0x385d('0xa3'),_0x385d('0x5f'),_0x385d('0x58'),_0x385d('0x59')],squel[_0x385d('0x7e')]()[_0x385d('0x7f')](_0x385d('0xa1'),_0x385d('0xa1'))[_0x385d('0x7f')](_0x385d('0xa4'),_0x385d('0xa2'))[_0x385d('0x7f')]('id',_0x385d('0xa5'))[_0x385d('0x7f')](_0x4867f0[_0x385d('0xa9')]['toString'](),'ListId')[_0x385d('0x7f')](_0x82cf64[_0x385d('0x5b')]['id'][_0x385d('0xa6')](),'VoiceQueueId')[_0x385d('0x7f')](_0x385d('0xa4'),_0x385d('0x58'))[_0x385d('0x7f')](_0x385d('0xa4'),'updatedAt')[_0x385d('0x81')]('cm_contacts')[_0x385d('0x44')]('deletedAt\x20IS\x20NULL')['where'](_0x385d('0xa8'),_0x4867f0[_0x385d('0xa9')][_0x385d('0xa6')]())['where'](_0x385d('0xaf')))[_0x385d('0xa6')]();}_0x2cd969[_0x385d('0x86')](db[_0x385d('0x71')][_0x385d('0x3d')](_0x1259a7));}return BPromise['all'](_0x2cd969);}})[_0x385d('0x32')](function(){return _0x12cc5c;})['then'](respondWithResult(_0x5e1025,null))[_0x385d('0x4b')](handleError(_0x5e1025,null));};exports[_0x385d('0xb1')]=function(_0x177638,_0xf36d90,_0x5ae97f){return db['VoiceQueue'][_0x385d('0x2f')]({'where':{'id':_0x177638[_0x385d('0x5b')]['id']}})['then'](handleEntityNotFound(_0xf36d90,null))[_0x385d('0x32')](function(_0x3709e4){if(_0x3709e4){return _0x3709e4[_0x385d('0xb1')](_0x177638[_0x385d('0x3d')][_0x385d('0x7d')]);}})['then'](function(_0x5eec97){if(_0x5eec97){return db[_0x385d('0x5e')][_0x385d('0x25')]({'where':{'ListId':_0x177638[_0x385d('0x3d')][_0x385d('0x7d')],'VoiceQueueId':_0x177638[_0x385d('0x5b')]['id']}})[_0x385d('0x32')](function(){return _0x5eec97;});}})[_0x385d('0x32')](respondWithStatusCode(_0xf36d90,null))[_0x385d('0x4b')](handleError(_0xf36d90,null));};exports[_0x385d('0xb2')]=function(_0x226310,_0x2f3ec5,_0x2bb60b){var _0x3a1c96={};var _0x534524={};var _0x30cdfb;var _0x2452e2;return db['VoiceQueue'][_0x385d('0x5d')]({'where':{'id':_0x226310[_0x385d('0x5b')]['id']}})[_0x385d('0x32')](handleEntityNotFound(_0x2f3ec5,null))['then'](function(_0x9ea854){if(_0x9ea854){_0x30cdfb=_0x9ea854;_0x534524['model']=_[_0x385d('0x4c')](db[_0x385d('0x99')][_0x385d('0x38')]);_0x534524[_0x385d('0x3d')]=_[_0x385d('0x4c')](_0x226310['query']);_0x534524[_0x385d('0x3c')]=_[_0x385d('0x4d')](_0x534524[_0x385d('0x3b')],_0x534524['query']);_0x3a1c96[_0x385d('0x3e')]=_[_0x385d('0x4d')](_0x534524[_0x385d('0x3b')],qs[_0x385d('0x3f')](_0x226310[_0x385d('0x3d')][_0x385d('0x3f')]));_0x3a1c96['attributes']=_0x3a1c96['attributes']['length']?_0x3a1c96[_0x385d('0x3e')]:_0x534524['model'];_0x3a1c96['order']=qs['sort'](_0x226310[_0x385d('0x3d')][_0x385d('0x43')]);_0x3a1c96[_0x385d('0x44')]=qs[_0x385d('0x3c')](_[_0x385d('0x45')](_0x226310[_0x385d('0x3d')],_0x534524['filters']));if(_0x226310[_0x385d('0x3d')][_0x385d('0x2a')]){_0x3a1c96[_0x385d('0x44')]=_[_0x385d('0x46')](_0x3a1c96[_0x385d('0x44')],{'$or':_[_0x385d('0x2c')](_0x3a1c96[_0x385d('0x3e')],function(_0x3bfe09){var _0x5f2909={};_0x5f2909[_0x3bfe09]={'$like':'%'+_0x226310[_0x385d('0x3d')][_0x385d('0x2a')]+'%'};return _0x5f2909;})});}_0x3a1c96=_[_0x385d('0x46')]({},_0x3a1c96,_0x226310['options']);return _0x30cdfb[_0x385d('0xb2')](_0x3a1c96);}})[_0x385d('0x32')](function(_0x25ee02){if(_0x25ee02){_0x2452e2=_0x25ee02[_0x385d('0x57')];if(!_0x226310[_0x385d('0x3d')][_0x385d('0x40')](_0x385d('0x41'))){_0x3a1c96[_0x385d('0x21')]=qs['limit'](_0x226310[_0x385d('0x3d')][_0x385d('0x21')]);_0x3a1c96[_0x385d('0x20')]=qs[_0x385d('0x20')](_0x226310[_0x385d('0x3d')]['offset']);}return _0x30cdfb['getBlackLists'](_0x3a1c96);}})['then'](function(_0x33b317){if(_0x33b317){return _0x33b317?{'count':_0x2452e2,'rows':_0x33b317}:null;}})[_0x385d('0x32')](respondWithResult(_0x2f3ec5,null))[_0x385d('0x4b')](handleError(_0x2f3ec5,null));};exports[_0x385d('0xb3')]=function(_0x1559c2,_0x71cdae,_0x5eb886){var _0x47b38f,_0x26b503;return db[_0x385d('0x37')][_0x385d('0x2f')]({'where':{'id':_0x1559c2[_0x385d('0x5b')]['id']}})[_0x385d('0x32')](handleEntityNotFound(_0x71cdae,null))['then'](function(_0x5e306a){if(_0x5e306a){_0x26b503=_0x5e306a;return _0x5e306a[_0x385d('0xb3')](_0x1559c2[_0x385d('0x4f')][_0x385d('0x7d')],_[_0x385d('0x92')](_0x1559c2[_0x385d('0x4f')],[_0x385d('0x7d'),'id'])||{});}return null;})[_0x385d('0x93')](function(_0x354ca7){var _0x15c00c;_0x47b38f=_0x354ca7||[];var _0x852fde=[];if(_0x354ca7){for(var _0x52ede1=0x0;_0x52ede1<_0x354ca7[_0x385d('0x57')];_0x52ede1+=0x1){var _0x3b3735=_0x354ca7[_0x52ede1][_0x385d('0x26')]({'plain':!![]});_0x15c00c=squel[_0x385d('0x9d')]()[_0x385d('0x9e')](_0x385d('0xb4'))['fromQuery']([_0x385d('0xa1'),_0x385d('0xa5'),_0x385d('0xa3'),_0x385d('0x5f'),_0x385d('0x58'),_0x385d('0x59')],squel[_0x385d('0x7e')]()[_0x385d('0x7f')]('phone',_0x385d('0xa1'))[_0x385d('0x7f')]('id',_0x385d('0xa5'))[_0x385d('0x7f')](_0x3b3735[_0x385d('0xa9')][_0x385d('0xa6')](),'ListId')[_0x385d('0x7f')](_0x1559c2[_0x385d('0x5b')]['id'][_0x385d('0xa6')](),_0x385d('0x5f'))[_0x385d('0x7f')](_0x385d('0xa4'),_0x385d('0x58'))[_0x385d('0x7f')](_0x385d('0xa4'),_0x385d('0x59'))['from'](_0x385d('0xa7'))[_0x385d('0x44')](_0x385d('0xb5'))[_0x385d('0x44')](_0x385d('0xa8'),_0x3b3735[_0x385d('0xa9')]['toString']())['where'](_0x385d('0xaf')))[_0x385d('0xa6')]();_0x852fde['push'](db['sequelize'][_0x385d('0x3d')](_0x15c00c));}return BPromise['all'](_0x852fde);}})['then'](function(){return _0x47b38f;})[_0x385d('0x32')](respondWithResult(_0x71cdae,null))['catch'](handleError(_0x71cdae,null));};exports[_0x385d('0xb6')]=function(_0x3fdd61,_0x30f35f,_0x5d5d46){return db['VoiceQueue'][_0x385d('0x2f')]({'where':{'id':_0x3fdd61[_0x385d('0x5b')]['id']}})[_0x385d('0x32')](handleEntityNotFound(_0x30f35f,null))[_0x385d('0x32')](function(_0x53391f){if(_0x53391f){return _0x53391f[_0x385d('0xb6')](_0x3fdd61['query'][_0x385d('0x7d')]);}})['then'](function(_0x5ba2c9){if(_0x5ba2c9){return db[_0x385d('0x65')][_0x385d('0x25')]({'where':{'ListId':_0x3fdd61[_0x385d('0x3d')][_0x385d('0x7d')],'VoiceQueueId':_0x3fdd61['params']['id']}})[_0x385d('0x32')](function(){return _0x5ba2c9;});}})[_0x385d('0x32')](respondWithStatusCode(_0x30f35f,null))['catch'](handleError(_0x30f35f,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index af6f3d4..0254199 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 _0xe7c8=['hook','exports','events','../../mysqldb','save','emit','hasOwnProperty'];(function(_0x1d0f0c,_0x215829){var _0x1c66e8=function(_0x27635c){while(--_0x27635c){_0x1d0f0c['push'](_0x1d0f0c['shift']());}};_0x1c66e8(++_0x215829);}(_0xe7c8,0x8e));var _0x8e7c=function(_0x25db26,_0x48f45f){_0x25db26=_0x25db26-0x0;var _0x748fa6=_0xe7c8[_0x25db26];return _0x748fa6;};'use strict';var EventEmitter=require(_0x8e7c('0x0'));var VoiceQueue=require(_0x8e7c('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8e7c('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xc51c94){return function(_0x172297,_0x434434,_0x231da3){VoiceQueueEvents[_0x8e7c('0x3')](_0xc51c94+':'+_0x172297['id'],_0x172297);VoiceQueueEvents[_0x8e7c('0x3')](_0xc51c94,_0x172297);_0x231da3(null);};}for(var e in events){if(events[_0x8e7c('0x4')](e)){var event=events[e];VoiceQueue[_0x8e7c('0x5')](e,emitEvent(event));}}module[_0x8e7c('0x6')]=VoiceQueueEvents; \ No newline at end of file +var _0xeada=['remove','emit','hasOwnProperty','exports','VoiceQueue','update'];(function(_0x303bd9,_0x3d3b8f){var _0x5df1b4=function(_0x49990c){while(--_0x49990c){_0x303bd9['push'](_0x303bd9['shift']());}};_0x5df1b4(++_0x3d3b8f);}(_0xeada,0x88));var _0xaead=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xeada[_0x2641f9];return _0x585741;};'use strict';var EventEmitter=require('events');var VoiceQueue=require('../../mysqldb')['db'][_0xaead('0x0')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xaead('0x1'),'afterDestroy':_0xaead('0x2')};function emitEvent(_0x5b2844){return function(_0x55914b,_0x5345cf,_0x5065fc){VoiceQueueEvents['emit'](_0x5b2844+':'+_0x55914b['id'],_0x55914b);VoiceQueueEvents[_0xaead('0x3')](_0x5b2844,_0x55914b);_0x5065fc(null);};}for(var e in events){if(events[_0xaead('0x4')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0xaead('0x5')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index da04cdc..dfe1e62 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 _0x2726=['path','rimraf','./voiceQueue.attributes','VoiceQueue','util','api','moment','bluebird','request-promise'];(function(_0x3a7a89,_0x159336){var _0x2b5e68=function(_0x5f0f14){while(--_0x5f0f14){_0x3a7a89['push'](_0x3a7a89['shift']());}};_0x2b5e68(++_0x159336);}(_0x2726,0xa6));var _0x6272=function(_0x2bcd1f,_0x4f1972){_0x2bcd1f=_0x2bcd1f-0x0;var _0x2381ca=_0x2726[_0x2bcd1f];return _0x2381ca;};'use strict';var _=require('lodash');var util=require(_0x6272('0x0'));var logger=require('../../config/logger')(_0x6272('0x1'));var moment=require(_0x6272('0x2'));var BPromise=require(_0x6272('0x3'));var rp=require(_0x6272('0x4'));var fs=require('fs');var path=require(_0x6272('0x5'));var rimraf=require(_0x6272('0x6'));var config=require('../../config/environment');var attributes=require(_0x6272('0x7'));module['exports']=function(_0x4a235a,_0x5e25c4){return _0x4a235a['define'](_0x6272('0x8'),attributes,{'tableName':'voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdc7f=['moment','bluebird','request-promise','rimraf','../../config/environment','./voiceQueue.attributes','exports','define','VoiceQueue','lodash','api'];(function(_0x201f9a,_0x166d01){var _0x34f934=function(_0x1f10ec){while(--_0x1f10ec){_0x201f9a['push'](_0x201f9a['shift']());}};_0x34f934(++_0x166d01);}(_0xdc7f,0x18a));var _0xfdc7=function(_0x1cd47d,_0x55bc75){_0x1cd47d=_0x1cd47d-0x0;var _0x29d52f=_0xdc7f[_0x1cd47d];return _0x29d52f;};'use strict';var _=require(_0xfdc7('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xfdc7('0x1'));var moment=require(_0xfdc7('0x2'));var BPromise=require(_0xfdc7('0x3'));var rp=require(_0xfdc7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfdc7('0x5'));var config=require(_0xfdc7('0x6'));var attributes=require(_0xfdc7('0x7'));module[_0xfdc7('0x8')]=function(_0x557cea,_0x118865){return _0x557cea[_0xfdc7('0x9')](_0xfdc7('0xa'),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 78c2d22..b93a418 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 _0x064a=['find','util','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','http','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetVoiceQueue','findAll','options','where','attributes','limit','include','map','model','stringify','ShowVoiceQueue','VoiceQueue'];(function(_0x5d06e8,_0x146c15){var _0x2994de=function(_0x136a62){while(--_0x136a62){_0x5d06e8['push'](_0x5d06e8['shift']());}};_0x2994de(++_0x146c15);}(_0x064a,0xba));var _0xa064=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x064a[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0xa064('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa064('0x1'));var fs=require('fs');var Redis=require(_0xa064('0x2'));var db=require(_0xa064('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa064('0x4'))('rpc');var config=require(_0xa064('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa064('0x6')]({'port':0x232a});config[_0xa064('0x7')]=_['defaults'](config['redis'],{'host':_0xa064('0x8'),'port':0x18eb});var socket=require(_0xa064('0x9'))(new Redis(config[_0xa064('0x7')]));require(_0xa064('0xa'))[_0xa064('0xb')](socket);function respondWithRpcPromise(_0x26eae9,_0x4a4f4b,_0x189b02){return new BPromise(function(_0x1d270c,_0x35907b){return client[_0xa064('0xc')](_0x26eae9,_0x189b02)[_0xa064('0xd')](function(_0x3e8494){logger[_0xa064('0xe')](_0xa064('0xf'),_0x4a4f4b,_0xa064('0x10'));logger[_0xa064('0x11')](_0xa064('0x12'),_0x4a4f4b,_0xa064('0x10'),JSON['stringify'](_0x3e8494));if(_0x3e8494[_0xa064('0x13')]){if(_0x3e8494['error'][_0xa064('0x14')]===0x1f4){logger[_0xa064('0x13')](_0xa064('0xf'),_0x4a4f4b,_0x3e8494[_0xa064('0x13')][_0xa064('0x15')]);return _0x35907b(_0x3e8494[_0xa064('0x13')]['message']);}logger[_0xa064('0x13')](_0xa064('0xf'),_0x4a4f4b,_0x3e8494[_0xa064('0x13')][_0xa064('0x15')]);return _0x1d270c(_0x3e8494[_0xa064('0x13')][_0xa064('0x15')]);}else{logger['info'](_0xa064('0xf'),_0x4a4f4b,_0xa064('0x10'));_0x1d270c(_0x3e8494[_0xa064('0x16')][_0xa064('0x15')]);}})[_0xa064('0x17')](function(_0x1cfcef){logger[_0xa064('0x13')](_0xa064('0xf'),_0x4a4f4b,_0x1cfcef);_0x35907b(_0x1cfcef);});});}exports[_0xa064('0x18')]=function(_0x1a9e53){var _0x2cca34=this;return new Promise(function(_0x148e66,_0x115bba){return db['VoiceQueue'][_0xa064('0x19')]({'raw':_0x1a9e53[_0xa064('0x1a')]?_0x1a9e53[_0xa064('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x1a9e53[_0xa064('0x1a')]?_0x1a9e53[_0xa064('0x1a')][_0xa064('0x1b')]||null:null,'attributes':_0x1a9e53[_0xa064('0x1a')]?_0x1a9e53[_0xa064('0x1a')][_0xa064('0x1c')]||null:null,'limit':_0x1a9e53[_0xa064('0x1a')]?_0x1a9e53[_0xa064('0x1a')][_0xa064('0x1d')]||null:null,'include':_0x1a9e53['options']?_0x1a9e53['options'][_0xa064('0x1e')]?_[_0xa064('0x1f')](_0x1a9e53[_0xa064('0x1a')]['include'],function(_0x268b6e){return{'model':db[_0x268b6e[_0xa064('0x20')]],'as':_0x268b6e['as'],'attributes':_0x268b6e[_0xa064('0x1c')],'include':_0x268b6e[_0xa064('0x1e')]?_[_0xa064('0x1f')](_0x268b6e[_0xa064('0x1e')],function(_0x1154ec){return{'model':db[_0x1154ec[_0xa064('0x20')]],'as':_0x1154ec['as'],'attributes':_0x1154ec['attributes'],'include':_0x1154ec[_0xa064('0x1e')]?_[_0xa064('0x1f')](_0x1154ec[_0xa064('0x1e')],function(_0x35765d){return{'model':db[_0x35765d['model']],'as':_0x35765d['as'],'attributes':_0x35765d[_0xa064('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa064('0xd')](function(_0x1cbd4e){logger['info'](_0xa064('0x18'),_0x1a9e53);logger[_0xa064('0x11')](_0xa064('0x18'),_0x1a9e53,JSON[_0xa064('0x21')](_0x1cbd4e));_0x148e66(_0x1cbd4e);})['catch'](function(_0x165098){logger[_0xa064('0x13')](_0xa064('0x18'),_0x165098['message'],_0x1a9e53);_0x115bba(_0x2cca34['error'](0x1f4,_0x165098['message']));});});};exports[_0xa064('0x22')]=function(_0x1f623a){var _0x9c051=this;return new Promise(function(_0x2bf3ad,_0x328b8a){return db[_0xa064('0x23')][_0xa064('0x24')]({'raw':_0x1f623a[_0xa064('0x1a')]?_0x1f623a[_0xa064('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x1f623a[_0xa064('0x1a')]?_0x1f623a[_0xa064('0x1a')][_0xa064('0x1b')]||null:null,'attributes':_0x1f623a[_0xa064('0x1a')]?_0x1f623a[_0xa064('0x1a')][_0xa064('0x1c')]||null:null,'include':_0x1f623a[_0xa064('0x1a')]?_0x1f623a[_0xa064('0x1a')]['include']?_[_0xa064('0x1f')](_0x1f623a['options']['include'],function(_0x15d4c8){return{'model':db[_0x15d4c8[_0xa064('0x20')]],'as':_0x15d4c8['as'],'attributes':_0x15d4c8[_0xa064('0x1c')],'include':_0x15d4c8[_0xa064('0x1e')]?_[_0xa064('0x1f')](_0x15d4c8[_0xa064('0x1e')],function(_0x412e63){return{'model':db[_0x412e63[_0xa064('0x20')]],'as':_0x412e63['as'],'attributes':_0x412e63[_0xa064('0x1c')],'include':_0x412e63[_0xa064('0x1e')]?_[_0xa064('0x1f')](_0x412e63[_0xa064('0x1e')],function(_0x49f521){return{'model':db[_0x49f521[_0xa064('0x20')]],'as':_0x49f521['as'],'attributes':_0x49f521[_0xa064('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa064('0xd')](function(_0x50fc58){logger[_0xa064('0xe')](_0xa064('0x22'),_0x1f623a);logger[_0xa064('0x11')](_0xa064('0x22'),_0x1f623a,JSON[_0xa064('0x21')](_0x50fc58));_0x2bf3ad(_0x50fc58);})[_0xa064('0x17')](function(_0x20f363){logger[_0xa064('0x13')](_0xa064('0x22'),_0x20f363[_0xa064('0x15')],_0x1f623a);_0x328b8a(_0x9c051['error'](0x1f4,_0x20f363[_0xa064('0x15')]));});});}; \ No newline at end of file +var _0x2a89=['jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetVoiceQueue','options','raw','attributes','limit','include','map','model','VoiceQueue','find','where','ShowVoiceQueue','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x4af01e,_0x543f5c){var _0x178c11=function(_0x2c2f76){while(--_0x2c2f76){_0x4af01e['push'](_0x4af01e['shift']());}};_0x178c11(++_0x543f5c);}(_0x2a89,0xed));var _0x92a8=function(_0x2352c4,_0x6a499c){_0x2352c4=_0x2352c4-0x0;var _0x3ef48b=_0x2a89[_0x2352c4];return _0x3ef48b;};'use strict';var _=require(_0x92a8('0x0'));var util=require('util');var moment=require(_0x92a8('0x1'));var BPromise=require(_0x92a8('0x2'));var rs=require(_0x92a8('0x3'));var fs=require('fs');var Redis=require(_0x92a8('0x4'));var db=require(_0x92a8('0x5'))['db'];var utils=require(_0x92a8('0x6'));var logger=require(_0x92a8('0x7'))('rpc');var config=require(_0x92a8('0x8'));var jayson=require(_0x92a8('0x9'));var client=jayson[_0x92a8('0xa')][_0x92a8('0xb')]({'port':0x232a});config['redis']=_[_0x92a8('0xc')](config[_0x92a8('0xd')],{'host':_0x92a8('0xe'),'port':0x18eb});var socket=require(_0x92a8('0xf'))(new Redis(config[_0x92a8('0xd')]));require('./voiceQueue.socket')[_0x92a8('0x10')](socket);function respondWithRpcPromise(_0x3bce30,_0x16ea81,_0x1b040d){return new BPromise(function(_0xd7655c,_0x45600f){return client[_0x92a8('0x11')](_0x3bce30,_0x1b040d)[_0x92a8('0x12')](function(_0x3f926e){logger[_0x92a8('0x13')](_0x92a8('0x14'),_0x16ea81,_0x92a8('0x15'));logger[_0x92a8('0x16')](_0x92a8('0x17'),_0x16ea81,_0x92a8('0x15'),JSON[_0x92a8('0x18')](_0x3f926e));if(_0x3f926e[_0x92a8('0x19')]){if(_0x3f926e['error']['code']===0x1f4){logger[_0x92a8('0x19')](_0x92a8('0x14'),_0x16ea81,_0x3f926e[_0x92a8('0x19')][_0x92a8('0x1a')]);return _0x45600f(_0x3f926e[_0x92a8('0x19')]['message']);}logger[_0x92a8('0x19')](_0x92a8('0x14'),_0x16ea81,_0x3f926e[_0x92a8('0x19')]['message']);return _0xd7655c(_0x3f926e[_0x92a8('0x19')]['message']);}else{logger[_0x92a8('0x13')](_0x92a8('0x14'),_0x16ea81,_0x92a8('0x15'));_0xd7655c(_0x3f926e[_0x92a8('0x1b')][_0x92a8('0x1a')]);}})[_0x92a8('0x1c')](function(_0x22101a){logger[_0x92a8('0x19')](_0x92a8('0x14'),_0x16ea81,_0x22101a);_0x45600f(_0x22101a);});});}exports[_0x92a8('0x1d')]=function(_0x29f786){var _0x255370=this;return new Promise(function(_0x4037bf,_0x397219){return db['VoiceQueue']['findAll']({'raw':_0x29f786[_0x92a8('0x1e')]?_0x29f786[_0x92a8('0x1e')][_0x92a8('0x1f')]===undefined?!![]:![]:!![],'where':_0x29f786[_0x92a8('0x1e')]?_0x29f786[_0x92a8('0x1e')]['where']||null:null,'attributes':_0x29f786['options']?_0x29f786[_0x92a8('0x1e')][_0x92a8('0x20')]||null:null,'limit':_0x29f786[_0x92a8('0x1e')]?_0x29f786[_0x92a8('0x1e')][_0x92a8('0x21')]||null:null,'include':_0x29f786[_0x92a8('0x1e')]?_0x29f786[_0x92a8('0x1e')][_0x92a8('0x22')]?_[_0x92a8('0x23')](_0x29f786['options'][_0x92a8('0x22')],function(_0x21da12){return{'model':db[_0x21da12['model']],'as':_0x21da12['as'],'attributes':_0x21da12[_0x92a8('0x20')],'include':_0x21da12[_0x92a8('0x22')]?_[_0x92a8('0x23')](_0x21da12[_0x92a8('0x22')],function(_0x229efa){return{'model':db[_0x229efa[_0x92a8('0x24')]],'as':_0x229efa['as'],'attributes':_0x229efa[_0x92a8('0x20')],'include':_0x229efa[_0x92a8('0x22')]?_['map'](_0x229efa['include'],function(_0x5b5127){return{'model':db[_0x5b5127['model']],'as':_0x5b5127['as'],'attributes':_0x5b5127[_0x92a8('0x20')]};}):[]};}):[]};}):[]:[]})[_0x92a8('0x12')](function(_0x81c989){logger[_0x92a8('0x13')](_0x92a8('0x1d'),_0x29f786);logger[_0x92a8('0x16')]('GetVoiceQueue',_0x29f786,JSON[_0x92a8('0x18')](_0x81c989));_0x4037bf(_0x81c989);})['catch'](function(_0x20aa0a){logger[_0x92a8('0x19')](_0x92a8('0x1d'),_0x20aa0a['message'],_0x29f786);_0x397219(_0x255370[_0x92a8('0x19')](0x1f4,_0x20aa0a[_0x92a8('0x1a')]));});});};exports['ShowVoiceQueue']=function(_0x1aa7bd){var _0x58b26f=this;return new Promise(function(_0x136d01,_0xd0c5c6){return db[_0x92a8('0x25')][_0x92a8('0x26')]({'raw':_0x1aa7bd[_0x92a8('0x1e')]?_0x1aa7bd[_0x92a8('0x1e')][_0x92a8('0x1f')]===undefined?!![]:![]:!![],'where':_0x1aa7bd[_0x92a8('0x1e')]?_0x1aa7bd[_0x92a8('0x1e')][_0x92a8('0x27')]||null:null,'attributes':_0x1aa7bd[_0x92a8('0x1e')]?_0x1aa7bd[_0x92a8('0x1e')][_0x92a8('0x20')]||null:null,'include':_0x1aa7bd[_0x92a8('0x1e')]?_0x1aa7bd['options'][_0x92a8('0x22')]?_[_0x92a8('0x23')](_0x1aa7bd['options'][_0x92a8('0x22')],function(_0x5113a0){return{'model':db[_0x5113a0[_0x92a8('0x24')]],'as':_0x5113a0['as'],'attributes':_0x5113a0['attributes'],'include':_0x5113a0[_0x92a8('0x22')]?_[_0x92a8('0x23')](_0x5113a0[_0x92a8('0x22')],function(_0x48e2a3){return{'model':db[_0x48e2a3[_0x92a8('0x24')]],'as':_0x48e2a3['as'],'attributes':_0x48e2a3[_0x92a8('0x20')],'include':_0x48e2a3[_0x92a8('0x22')]?_[_0x92a8('0x23')](_0x48e2a3['include'],function(_0x39ddcc){return{'model':db[_0x39ddcc[_0x92a8('0x24')]],'as':_0x39ddcc['as'],'attributes':_0x39ddcc['attributes']};}):[]};}):[]};}):[]:[]})[_0x92a8('0x12')](function(_0x1f28dc){logger[_0x92a8('0x13')]('ShowVoiceQueue',_0x1aa7bd);logger['debug'](_0x92a8('0x28'),_0x1aa7bd,JSON[_0x92a8('0x18')](_0x1f28dc));_0x136d01(_0x1f28dc);})[_0x92a8('0x1c')](function(_0xca62b){logger[_0x92a8('0x19')](_0x92a8('0x28'),_0xca62b[_0x92a8('0x1a')],_0x1aa7bd);_0xd0c5c6(_0x58b26f['error'](0x1f4,_0xca62b[_0x92a8('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index d5f0a21..d7211a0 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 _0x9c13=['voiceQueue:','./voiceQueue.events','save','remove','update','emit','removeListener'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9c13,0x127));var _0x39c1=function(_0x590b63,_0x14debb){_0x590b63=_0x590b63-0x0;var _0x3c9380=_0x9c13[_0x590b63];return _0x3c9380;};'use strict';var VoiceQueueEvents=require(_0x39c1('0x0'));var events=[_0x39c1('0x1'),_0x39c1('0x2'),_0x39c1('0x3')];function createListener(_0x3bac13,_0x4b6d42){return function(_0x48b7c2){_0x4b6d42[_0x39c1('0x4')](_0x3bac13,_0x48b7c2);};}function removeListener(_0x28e250,_0x1ecf8e){return function(){VoiceQueueEvents[_0x39c1('0x5')](_0x28e250,_0x1ecf8e);};}exports['register']=function(_0x26ec94){for(var _0x1e98e4=0x0,_0x4bd4ef=events['length'];_0x1e98e4<_0x4bd4ef;_0x1e98e4++){var _0x16c4c5=events[_0x1e98e4];var _0x63e648=createListener(_0x39c1('0x6')+_0x16c4c5,_0x26ec94);VoiceQueueEvents['on'](_0x16c4c5,_0x63e648);}}; \ No newline at end of file +var _0x153b=['./voiceQueue.events','save','remove','update','emit','register','length'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x153b,0x9a));var _0xb153=function(_0x49c2b2,_0x37f4c0){_0x49c2b2=_0x49c2b2-0x0;var _0x49c575=_0x153b[_0x49c2b2];return _0x49c575;};'use strict';var VoiceQueueEvents=require(_0xb153('0x0'));var events=[_0xb153('0x1'),_0xb153('0x2'),_0xb153('0x3')];function createListener(_0x6d119c,_0x2c3bb0){return function(_0x5d114f){_0x2c3bb0[_0xb153('0x4')](_0x6d119c,_0x5d114f);};}function removeListener(_0x3a8e82,_0x40afba){return function(){VoiceQueueEvents['removeListener'](_0x3a8e82,_0x40afba);};}exports[_0xb153('0x5')]=function(_0x7b28cc){for(var _0x5c594a=0x0,_0x2ad2b5=events[_0xb153('0x6')];_0x5c594a<_0x2ad2b5;_0x5c594a++){var _0x423c5f=events[_0x5c594a];var _0x251e19=createListener('voiceQueue:'+_0x423c5f,_0x7b28cc);VoiceQueueEvents['on'](_0x423c5f,_0x251e19);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index ae454f0..a2a67d3 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 _0xd046=['Router','../../config/environment','get','/describe','/index','isAuthenticated','create','put','/:id','delete','destroy','exports','util','path','connect-timeout'];(function(_0x36958,_0x28eaa6){var _0x401eec=function(_0x42e71e){while(--_0x42e71e){_0x36958['push'](_0x36958['shift']());}};_0x401eec(++_0x28eaa6);}(_0xd046,0x129));var _0x6d04=function(_0x1d7f41,_0x78db44){_0x1d7f41=_0x1d7f41-0x0;var _0x464066=_0xd046[_0x1d7f41];return _0x464066;};'use strict';var multer=require('multer');var util=require(_0x6d04('0x0'));var path=require(_0x6d04('0x1'));var timeout=require(_0x6d04('0x2'));var express=require('express');var router=express[_0x6d04('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6d04('0x4'));var controller=require('./voiceQueueReport.controller');router[_0x6d04('0x5')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6d04('0x5')](_0x6d04('0x6'),auth['isAuthenticated'](),controller['describe']);router[_0x6d04('0x5')](_0x6d04('0x7'),auth['isAuthenticated'](),controller['getVoiceQueuesReport']);router[_0x6d04('0x5')]('/:id',auth[_0x6d04('0x8')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x6d04('0x9')]);router[_0x6d04('0xa')](_0x6d04('0xb'),auth[_0x6d04('0x8')](),controller['update']);router[_0x6d04('0xc')](_0x6d04('0xb'),auth[_0x6d04('0x8')](),controller[_0x6d04('0xd')]);module[_0x6d04('0xe')]=router; \ No newline at end of file +var _0x6365=['./voiceQueueReport.controller','isAuthenticated','index','get','/describe','describe','getVoiceQueuesReport','/:id','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x38a2d3,_0x5bbb2a){var _0x42649f=function(_0x20c726){while(--_0x20c726){_0x38a2d3['push'](_0x38a2d3['shift']());}};_0x42649f(++_0x5bbb2a);}(_0x6365,0x148));var _0x5636=function(_0x13ff4f,_0x1a1906){_0x13ff4f=_0x13ff4f-0x0;var _0x54aee7=_0x6365[_0x13ff4f];return _0x54aee7;};'use strict';var multer=require(_0x5636('0x0'));var util=require(_0x5636('0x1'));var path=require(_0x5636('0x2'));var timeout=require(_0x5636('0x3'));var express=require('express');var router=express[_0x5636('0x4')]();var auth=require(_0x5636('0x5'));var interaction=require(_0x5636('0x6'));var config=require(_0x5636('0x7'));var controller=require(_0x5636('0x8'));router['get']('/',auth[_0x5636('0x9')](),controller[_0x5636('0xa')]);router[_0x5636('0xb')](_0x5636('0xc'),auth['isAuthenticated'](),controller[_0x5636('0xd')]);router[_0x5636('0xb')]('/index',auth['isAuthenticated'](),controller[_0x5636('0xe')]);router[_0x5636('0xb')](_0x5636('0xf'),auth[_0x5636('0x9')](),controller['show']);router['post']('/',auth[_0x5636('0x9')](),controller['create']);router[_0x5636('0x10')](_0x5636('0xf'),auth[_0x5636('0x9')](),controller[_0x5636('0x11')]);router[_0x5636('0x12')](_0x5636('0xf'),auth['isAuthenticated'](),controller[_0x5636('0x13')]);module[_0x5636('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index f4baaab..7afc592 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 _0x10fa=['format','diff','seconds','queuecallerleaveAt','setDataValue','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','sequelize','moment','exports','STRING','DATE','getDataValue'];(function(_0x5a16a6,_0x13eaa0){var _0x48e7b8=function(_0x4f0b7a){while(--_0x4f0b7a){_0x5a16a6['push'](_0x5a16a6['shift']());}};_0x48e7b8(++_0x13eaa0);}(_0x10fa,0x144));var _0xa10f=function(_0x594596,_0x2633f4){_0x594596=_0x594596-0x0;var _0x58a0e9=_0x10fa[_0x594596];return _0x58a0e9;};'use strict';var Sequelize=require(_0xa10f('0x0'));var moment=require(_0xa10f('0x1'));module[_0xa10f('0x2')]={'type':{'type':Sequelize[_0xa10f('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xa10f('0x3')]},'calleridname':{'type':Sequelize[_0xa10f('0x3')]},'queue':{'type':Sequelize[_0xa10f('0x3')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0xa10f('0x4')],'set':function(_0x654b0a){var _0x2a3bbf=moment(_0x654b0a);var _0x127957=moment(this[_0xa10f('0x5')]('queuecallerjoinAt'))[_0xa10f('0x6')]('YYYY-MM-DD\x20HH:mm:ss');var _0x50c681=_0x2a3bbf[_0xa10f('0x7')](_0x127957,_0xa10f('0x8'));this['setDataValue'](_0xa10f('0x9'),_0x654b0a);this[_0xa10f('0xa')](_0xa10f('0xb'),_0x50c681||null);}},'position':{'type':Sequelize[_0xa10f('0xc')]},'count':{'type':Sequelize[_0xa10f('0xc')]},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xa10f('0x4')]},'queuecallercomplete':{'type':Sequelize[_0xa10f('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xa10f('0x4')]},'queuecallerexit':{'type':Sequelize[_0xa10f('0xd')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xa10f('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0xa10f('0x3')],'comment':_0xa10f('0xe')},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xa10f('0x3')]},'connectedlinename':{'type':Sequelize[_0xa10f('0x3')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xa10f('0x3')]},'exten':{'type':Sequelize[_0xa10f('0x3')]},'priority':{'type':Sequelize[_0xa10f('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0xa10f('0xc')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0xa10f('0xd')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0xa10f('0x3')]},'transferuniqueid':{'type':Sequelize[_0xa10f('0x3')]},'disposition':{'type':Sequelize[_0xa10f('0x3')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x5da7=['sequelize','STRING','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','DATE','FORWARD,\x20BLIND,\x20ATTENDED'];(function(_0x26abc4,_0x52fbef){var _0xbfcce3=function(_0x147441){while(--_0x147441){_0x26abc4['push'](_0x26abc4['shift']());}};_0xbfcce3(++_0x52fbef);}(_0x5da7,0x177));var _0x75da=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5da7[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x75da('0x0'));var moment=require('moment');module['exports']={'type':{'type':Sequelize[_0x75da('0x1')]},'uniqueid':{'type':Sequelize[_0x75da('0x1')]},'calleridnum':{'type':Sequelize[_0x75da('0x1')]},'calleridname':{'type':Sequelize[_0x75da('0x1')]},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x54c93d){var _0x1f4fc1=moment(_0x54c93d);var _0x2d1a18=moment(this[_0x75da('0x2')](_0x75da('0x3')))[_0x75da('0x4')](_0x75da('0x5'));var _0x276d7e=_0x1f4fc1[_0x75da('0x6')](_0x2d1a18,_0x75da('0x7'));this[_0x75da('0x8')](_0x75da('0x9'),_0x54c93d);this[_0x75da('0x8')](_0x75da('0xa'),_0x276d7e||null);}},'position':{'type':Sequelize[_0x75da('0xb')]},'count':{'type':Sequelize[_0x75da('0xb')]},'queuecallerabandon':{'type':Sequelize[_0x75da('0xc')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x75da('0xd')]},'queuecallercomplete':{'type':Sequelize[_0x75da('0xc')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x75da('0xd')]},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0x75da('0x1')],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize[_0x75da('0xb')]},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x75da('0x1')]},'accountcode':{'type':Sequelize[_0x75da('0x1')]},'context':{'type':Sequelize[_0x75da('0x1')]},'exten':{'type':Sequelize[_0x75da('0x1')]},'priority':{'type':Sequelize[_0x75da('0x1')]},'holdtime':{'type':Sequelize[_0x75da('0xb')]},'mohtime':{'type':Sequelize[_0x75da('0xb')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x75da('0xc')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x75da('0xc')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x75da('0xe')},'transferexten':{'type':Sequelize[_0x75da('0x1')]},'transferuniqueid':{'type':Sequelize[_0x75da('0x1')]},'disposition':{'type':Sequelize[_0x75da('0x1')]},'queuecallerenterreason':{'type':Sequelize[_0x75da('0xb')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index 2d08f46..99a56b2 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 _0x2ef3=['intersection','attributes','length','order','sort','where','filters','pick','filter','map','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','fields','find','create','body','update','params','destroy','describe','getVoiceQueuesReport','hasOwnProperty','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','then','error','stack','name','index','VoiceQueueReport','rawAttributes','fieldName','type','key','model','keys','query'];(function(_0x19865b,_0x279613){var _0x186b3a=function(_0xe8278a){while(--_0xe8278a){_0x19865b['push'](_0x19865b['shift']());}};_0x186b3a(++_0x279613);}(_0x2ef3,0xba));var _0x32ef=function(_0x46bacb,_0x5a1297){_0x46bacb=_0x46bacb-0x0;var _0x5d65da=_0x2ef3[_0x46bacb];return _0x5d65da;};'use strict';var pdf=require(_0x32ef('0x0'));var emlformat=require(_0x32ef('0x1'));var rimraf=require(_0x32ef('0x2'));var zipdir=require(_0x32ef('0x3'));var jsonpatch=require(_0x32ef('0x4'));var rp=require(_0x32ef('0x5'));var moment=require('moment');var BPromise=require(_0x32ef('0x6'));var Mustache=require(_0x32ef('0x7'));var util=require('util');var path=require(_0x32ef('0x8'));var sox=require(_0x32ef('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0xf'));var querystring=require(_0x32ef('0x10'));var Papa=require(_0x32ef('0x11'));var Redis=require(_0x32ef('0x12'));var authService=require(_0x32ef('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x14'));var logger=require(_0x32ef('0x15'))(_0x32ef('0x16'));var utils=require(_0x32ef('0x17'));var config=require('../../config/environment');var db=require(_0x32ef('0x18'))['db'];config['redis']=_[_0x32ef('0x19')](config['redis'],{'host':_0x32ef('0x1a'),'port':0x18eb});var socket=require(_0x32ef('0x1b'))(new Redis(config['redis']));require('./voiceQueueReport.socket')[_0x32ef('0x1c')](socket);function respondWithStatusCode(_0x4d8009,_0x326fce){_0x326fce=_0x326fce||0xcc;return function(_0x40a6e6){if(_0x40a6e6){return _0x4d8009[_0x32ef('0x1d')](_0x326fce);}return _0x4d8009[_0x32ef('0x1e')](_0x326fce)['end']();};}function respondWithResult(_0x55bf0b,_0x531e30){_0x531e30=_0x531e30||0xc8;return function(_0x13db1a){if(_0x13db1a){return _0x55bf0b[_0x32ef('0x1e')](_0x531e30)[_0x32ef('0x1f')](_0x13db1a);}};}function respondWithFilteredResult(_0x53a5ca,_0x5d559b){return function(_0x1eb468){if(_0x1eb468){var _0x1a9476=_0x1eb468[_0x32ef('0x20')],_0x286bfb=_0x5d559b['offset'],_0x57863c=_0x5d559b[_0x32ef('0x21')]+_0x5d559b[_0x32ef('0x22')],_0xbe37f6;if(_0x57863c>=_0x1a9476){_0x57863c=_0x1a9476;_0xbe37f6=0xc8;}else{_0xbe37f6=0xce;}_0x53a5ca[_0x32ef('0x1e')](_0xbe37f6);return _0x53a5ca[_0x32ef('0x23')](_0x32ef('0x24'),_0x286bfb+'-'+_0x57863c+'/'+_0x1a9476)[_0x32ef('0x1f')](_0x1eb468);}return null;};}function patchUpdates(_0x4de441){return function(_0x3c5b78){try{jsonpatch['apply'](_0x3c5b78,_0x4de441,!![]);}catch(_0x309866){return BPromise[_0x32ef('0x25')](_0x309866);}return _0x3c5b78['save']();};}function saveUpdates(_0x1af371,_0x97780){return function(_0x5e8898){if(_0x5e8898){return _0x5e8898['update'](_0x1af371)['then'](function(_0x22f2d7){return _0x22f2d7;});}return null;};}function removeEntity(_0xb30fab,_0x225feb){return function(_0x478bef){if(_0x478bef){return _0x478bef['destroy']()[_0x32ef('0x26')](function(){_0xb30fab['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x278495,_0x14d4b3){return function(_0x371540){if(!_0x371540){_0x278495[_0x32ef('0x1d')](0x194);}return _0x371540;};}function handleError(_0x15ce54,_0x234175){_0x234175=_0x234175||0x1f4;return function(_0x1874ea){logger[_0x32ef('0x27')](_0x1874ea[_0x32ef('0x28')]);if(_0x1874ea[_0x32ef('0x29')]){delete _0x1874ea[_0x32ef('0x29')];}_0x15ce54[_0x32ef('0x1e')](_0x234175)['send'](_0x1874ea);};}exports[_0x32ef('0x2a')]=function(_0x2f5d06,_0x5a04cd){var _0x12de1a={},_0x3c569d={},_0x30b250={'count':0x0,'rows':[]};var _0x26e207=_['map'](db[_0x32ef('0x2b')][_0x32ef('0x2c')],function(_0x31dbc3){return{'name':_0x31dbc3[_0x32ef('0x2d')],'type':_0x31dbc3[_0x32ef('0x2e')][_0x32ef('0x2f')]};});_0x3c569d[_0x32ef('0x30')]=_['map'](_0x26e207,_0x32ef('0x29'));_0x3c569d['query']=_[_0x32ef('0x31')](_0x2f5d06[_0x32ef('0x32')]);_0x3c569d['filters']=_[_0x32ef('0x33')](_0x3c569d[_0x32ef('0x30')],_0x3c569d[_0x32ef('0x32')]);_0x12de1a[_0x32ef('0x34')]=_[_0x32ef('0x33')](_0x3c569d['model'],qs['fields'](_0x2f5d06[_0x32ef('0x32')]['fields']));_0x12de1a[_0x32ef('0x34')]=_0x12de1a[_0x32ef('0x34')][_0x32ef('0x35')]?_0x12de1a[_0x32ef('0x34')]:_0x3c569d[_0x32ef('0x30')];if(!_0x2f5d06[_0x32ef('0x32')]['hasOwnProperty']('nolimit')){_0x12de1a['limit']=qs[_0x32ef('0x22')](_0x2f5d06[_0x32ef('0x32')][_0x32ef('0x22')]);_0x12de1a['offset']=qs['offset'](_0x2f5d06[_0x32ef('0x32')][_0x32ef('0x21')]);}_0x12de1a[_0x32ef('0x36')]=qs['sort'](_0x2f5d06['query'][_0x32ef('0x37')]);_0x12de1a[_0x32ef('0x38')]=qs[_0x32ef('0x39')](_[_0x32ef('0x3a')](_0x2f5d06[_0x32ef('0x32')],_0x3c569d[_0x32ef('0x39')]));if(_0x2f5d06[_0x32ef('0x32')][_0x32ef('0x3b')]){_0x12de1a[_0x32ef('0x38')]=_['merge'](_0x12de1a[_0x32ef('0x38')],{'$or':_[_0x32ef('0x3c')](_0x26e207,function(_0x14b54f){if(_0x14b54f['type']!==_0x32ef('0x3d')){var _0x17e489={};_0x17e489[_0x14b54f[_0x32ef('0x29')]]={'$like':'%'+_0x2f5d06[_0x32ef('0x32')][_0x32ef('0x3b')]+'%'};return _0x17e489;}})});}_0x12de1a=_[_0x32ef('0x3e')]({},_0x12de1a,_0x2f5d06[_0x32ef('0x3f')]);var _0x1cebed={'where':_0x12de1a[_0x32ef('0x38')]};return db[_0x32ef('0x2b')][_0x32ef('0x20')](_0x1cebed)[_0x32ef('0x26')](function(_0x48e071){_0x30b250[_0x32ef('0x20')]=_0x48e071;if(_0x2f5d06[_0x32ef('0x32')][_0x32ef('0x40')]){_0x12de1a[_0x32ef('0x41')]=[{'all':!![]}];}return db[_0x32ef('0x2b')][_0x32ef('0x42')](_0x12de1a);})[_0x32ef('0x26')](function(_0x596d5a){_0x30b250['rows']=_0x596d5a;return _0x30b250;})[_0x32ef('0x26')](respondWithFilteredResult(_0x5a04cd,_0x12de1a))[_0x32ef('0x43')](handleError(_0x5a04cd,null));};exports[_0x32ef('0x44')]=function(_0x765c63,_0x5dca14){var _0x2901a1={'raw':![],'where':{'id':_0x765c63['params']['id']}},_0x1f323a={};_0x1f323a[_0x32ef('0x30')]=_['keys'](db[_0x32ef('0x2b')][_0x32ef('0x2c')]);_0x1f323a[_0x32ef('0x32')]=_[_0x32ef('0x31')](_0x765c63[_0x32ef('0x32')]);_0x1f323a[_0x32ef('0x39')]=_[_0x32ef('0x33')](_0x1f323a[_0x32ef('0x30')],_0x1f323a[_0x32ef('0x32')]);_0x2901a1[_0x32ef('0x34')]=_['intersection'](_0x1f323a[_0x32ef('0x30')],qs['fields'](_0x765c63[_0x32ef('0x32')][_0x32ef('0x45')]));_0x2901a1[_0x32ef('0x34')]=_0x2901a1['attributes'][_0x32ef('0x35')]?_0x2901a1[_0x32ef('0x34')]:_0x1f323a[_0x32ef('0x30')];if(_0x765c63[_0x32ef('0x32')][_0x32ef('0x40')]){_0x2901a1[_0x32ef('0x41')]=[{'all':!![]}];}_0x2901a1=_[_0x32ef('0x3e')]({},_0x2901a1,_0x765c63['options']);return db['VoiceQueueReport'][_0x32ef('0x46')](_0x2901a1)[_0x32ef('0x26')](handleEntityNotFound(_0x5dca14,null))[_0x32ef('0x26')](respondWithResult(_0x5dca14,null))[_0x32ef('0x43')](handleError(_0x5dca14,null));};exports[_0x32ef('0x47')]=function(_0xd67dc9,_0x44ad11){return db[_0x32ef('0x2b')][_0x32ef('0x47')](_0xd67dc9[_0x32ef('0x48')],{})[_0x32ef('0x26')](respondWithResult(_0x44ad11,0xc9))[_0x32ef('0x43')](handleError(_0x44ad11,null));};exports[_0x32ef('0x49')]=function(_0x4c2534,_0x420f00){if(_0x4c2534[_0x32ef('0x48')]['id']){delete _0x4c2534[_0x32ef('0x48')]['id'];}return db[_0x32ef('0x2b')][_0x32ef('0x46')]({'where':{'id':_0x4c2534[_0x32ef('0x4a')]['id']}})[_0x32ef('0x26')](handleEntityNotFound(_0x420f00,null))[_0x32ef('0x26')](saveUpdates(_0x4c2534[_0x32ef('0x48')],null))[_0x32ef('0x26')](respondWithResult(_0x420f00,null))[_0x32ef('0x43')](handleError(_0x420f00,null));};exports[_0x32ef('0x4b')]=function(_0x272377,_0x326445){return db[_0x32ef('0x2b')][_0x32ef('0x46')]({'where':{'id':_0x272377[_0x32ef('0x4a')]['id']}})[_0x32ef('0x26')](handleEntityNotFound(_0x326445,null))['then'](removeEntity(_0x326445,null))['catch'](handleError(_0x326445,null));};exports[_0x32ef('0x4c')]=function(_0x259c32,_0xa9bf19){return db[_0x32ef('0x2b')][_0x32ef('0x4c')]()[_0x32ef('0x26')](respondWithResult(_0xa9bf19,null))[_0x32ef('0x43')](handleError(_0xa9bf19,null));};exports[_0x32ef('0x4d')]=function(_0x15b640,_0x368bf1){var _0x3697a7={},_0x4a6fd2={},_0x21216d={'count':0x0,'rows':[]};_0x4a6fd2[_0x32ef('0x30')]=_[_0x32ef('0x31')](db[_0x32ef('0x2b')][_0x32ef('0x2c')]);_0x4a6fd2[_0x32ef('0x32')]=_['keys'](_0x15b640[_0x32ef('0x32')]);_0x4a6fd2[_0x32ef('0x39')]=_[_0x32ef('0x33')](_0x4a6fd2['model'],_0x4a6fd2[_0x32ef('0x32')]);_0x3697a7['attributes']=_[_0x32ef('0x33')](_0x4a6fd2[_0x32ef('0x30')],qs['fields'](_0x15b640[_0x32ef('0x32')]['fields']));_0x3697a7[_0x32ef('0x34')]=_0x3697a7[_0x32ef('0x34')][_0x32ef('0x35')]?_0x3697a7[_0x32ef('0x34')]:_0x4a6fd2[_0x32ef('0x30')];if(!_0x15b640[_0x32ef('0x32')][_0x32ef('0x4e')]('nolimit')){_0x3697a7['limit']=qs[_0x32ef('0x22')](_0x15b640['query']['limit']);_0x3697a7[_0x32ef('0x21')]=qs[_0x32ef('0x21')](_0x15b640[_0x32ef('0x32')][_0x32ef('0x21')]);}_0x3697a7[_0x32ef('0x36')]=qs[_0x32ef('0x37')](_0x15b640[_0x32ef('0x32')][_0x32ef('0x37')]);_0x3697a7[_0x32ef('0x38')]=qs[_0x32ef('0x39')](_['pick'](_0x15b640['query'],_0x4a6fd2[_0x32ef('0x39')]));if(_0x15b640[_0x32ef('0x32')]['filter']){_0x3697a7[_0x32ef('0x38')]=_[_0x32ef('0x3e')](_0x3697a7[_0x32ef('0x38')],{'$or':_['map'](_0x3697a7[_0x32ef('0x34')],function(_0x3c31d0){var _0x20dcc5={};_0x20dcc5[_0x3c31d0]={'$like':'%'+_0x15b640['query']['filter']+'%'};return _0x20dcc5;})});}_0x3697a7=_[_0x32ef('0x3e')]({},_0x3697a7,_0x15b640['options']);var _0x17f447={'where':_0x3697a7['where']};return db['VoiceQueueReport'][_0x32ef('0x20')](_0x17f447)[_0x32ef('0x26')](function(_0x10cb37){_0x21216d['count']=_0x10cb37;if(_0x15b640[_0x32ef('0x32')][_0x32ef('0x40')]){_0x3697a7[_0x32ef('0x41')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x32ef('0x42')](_0x3697a7);})[_0x32ef('0x26')](function(_0x4c3bab){_0x21216d['rows']=_0x4c3bab;return _0x21216d;})[_0x32ef('0x26')](respondWithFilteredResult(_0x368bf1,_0x3697a7,_0x32ef('0x4d')))[_0x32ef('0x43')](handleError(_0x368bf1,null,_0x32ef('0x4d')));}; \ No newline at end of file +var _0x1967=['../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','end','status','json','count','offset','reject','save','update','then','destroy','name','index','VoiceQueueReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','options','create','body','params','describe','getVoiceQueuesReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0x1967,0x173));var _0x7196=function(_0x14db64,_0x1ead09){_0x14db64=_0x14db64-0x0;var _0x17875d=_0x1967[_0x14db64];return _0x17875d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7196('0x0'));var rimraf=require(_0x7196('0x1'));var zipdir=require(_0x7196('0x2'));var jsonpatch=require(_0x7196('0x3'));var rp=require(_0x7196('0x4'));var moment=require(_0x7196('0x5'));var BPromise=require(_0x7196('0x6'));var Mustache=require(_0x7196('0x7'));var util=require(_0x7196('0x8'));var path=require(_0x7196('0x9'));var sox=require('sox');var csv=require(_0x7196('0xa'));var ejs=require(_0x7196('0xb'));var fs=require('fs');var _=require(_0x7196('0xc'));var squel=require(_0x7196('0xd'));var crypto=require(_0x7196('0xe'));var jsforce=require(_0x7196('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7196('0xa'));var querystring=require(_0x7196('0x10'));var Papa=require(_0x7196('0x11'));var Redis=require(_0x7196('0x12'));var authService=require(_0x7196('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7196('0x14'));var logger=require(_0x7196('0x15'))(_0x7196('0x16'));var utils=require(_0x7196('0x17'));var config=require(_0x7196('0x18'));var db=require(_0x7196('0x19'))['db'];config[_0x7196('0x1a')]=_[_0x7196('0x1b')](config[_0x7196('0x1a')],{'host':_0x7196('0x1c'),'port':0x18eb});var socket=require(_0x7196('0x1d'))(new Redis(config['redis']));require(_0x7196('0x1e'))[_0x7196('0x1f')](socket);function respondWithStatusCode(_0x3545aa,_0xf098c1){_0xf098c1=_0xf098c1||0xcc;return function(_0x511aa1){if(_0x511aa1){return _0x3545aa[_0x7196('0x20')](_0xf098c1);}return _0x3545aa['status'](_0xf098c1)[_0x7196('0x21')]();};}function respondWithResult(_0x2590a6,_0xf7e97){_0xf7e97=_0xf7e97||0xc8;return function(_0x3ed1ad){if(_0x3ed1ad){return _0x2590a6[_0x7196('0x22')](_0xf7e97)[_0x7196('0x23')](_0x3ed1ad);}};}function respondWithFilteredResult(_0x22bd62,_0x1ed296){return function(_0x3e4e69){if(_0x3e4e69){var _0x32fe2b=_0x3e4e69[_0x7196('0x24')],_0x385f2d=_0x1ed296[_0x7196('0x25')],_0x5b716a=_0x1ed296[_0x7196('0x25')]+_0x1ed296['limit'],_0x4c4f91;if(_0x5b716a>=_0x32fe2b){_0x5b716a=_0x32fe2b;_0x4c4f91=0xc8;}else{_0x4c4f91=0xce;}_0x22bd62[_0x7196('0x22')](_0x4c4f91);return _0x22bd62['set']('Content-Range',_0x385f2d+'-'+_0x5b716a+'/'+_0x32fe2b)[_0x7196('0x23')](_0x3e4e69);}return null;};}function patchUpdates(_0x627223){return function(_0x8dee9d){try{jsonpatch['apply'](_0x8dee9d,_0x627223,!![]);}catch(_0x57c390){return BPromise[_0x7196('0x26')](_0x57c390);}return _0x8dee9d[_0x7196('0x27')]();};}function saveUpdates(_0x598a26,_0x18649b){return function(_0x27ff84){if(_0x27ff84){return _0x27ff84[_0x7196('0x28')](_0x598a26)[_0x7196('0x29')](function(_0x38b3d6){return _0x38b3d6;});}return null;};}function removeEntity(_0x549f34,_0x3f8178){return function(_0x520d01){if(_0x520d01){return _0x520d01[_0x7196('0x2a')]()[_0x7196('0x29')](function(){_0x549f34[_0x7196('0x22')](0xcc)[_0x7196('0x21')]();});}};}function handleEntityNotFound(_0x70aa65,_0x43f6a2){return function(_0x530ab5){if(!_0x530ab5){_0x70aa65['sendStatus'](0x194);}return _0x530ab5;};}function handleError(_0x1482e5,_0x2d284f){_0x2d284f=_0x2d284f||0x1f4;return function(_0x184c09){logger['error'](_0x184c09['stack']);if(_0x184c09[_0x7196('0x2b')]){delete _0x184c09[_0x7196('0x2b')];}_0x1482e5[_0x7196('0x22')](_0x2d284f)['send'](_0x184c09);};}exports[_0x7196('0x2c')]=function(_0x4ecea1,_0x4fd339){var _0x59d79d={},_0x30151f={},_0x985727={'count':0x0,'rows':[]};var _0x1257ad=_['map'](db[_0x7196('0x2d')][_0x7196('0x2e')],function(_0x2f9583){return{'name':_0x2f9583[_0x7196('0x2f')],'type':_0x2f9583['type'][_0x7196('0x30')]};});_0x30151f[_0x7196('0x31')]=_[_0x7196('0x32')](_0x1257ad,_0x7196('0x2b'));_0x30151f[_0x7196('0x33')]=_[_0x7196('0x34')](_0x4ecea1[_0x7196('0x33')]);_0x30151f[_0x7196('0x35')]=_[_0x7196('0x36')](_0x30151f[_0x7196('0x31')],_0x30151f[_0x7196('0x33')]);_0x59d79d['attributes']=_[_0x7196('0x36')](_0x30151f['model'],qs[_0x7196('0x37')](_0x4ecea1['query'][_0x7196('0x37')]));_0x59d79d[_0x7196('0x38')]=_0x59d79d['attributes'][_0x7196('0x39')]?_0x59d79d[_0x7196('0x38')]:_0x30151f[_0x7196('0x31')];if(!_0x4ecea1[_0x7196('0x33')][_0x7196('0x3a')]('nolimit')){_0x59d79d[_0x7196('0x3b')]=qs[_0x7196('0x3b')](_0x4ecea1[_0x7196('0x33')][_0x7196('0x3b')]);_0x59d79d[_0x7196('0x25')]=qs[_0x7196('0x25')](_0x4ecea1['query'][_0x7196('0x25')]);}_0x59d79d[_0x7196('0x3c')]=qs[_0x7196('0x3d')](_0x4ecea1['query'][_0x7196('0x3d')]);_0x59d79d[_0x7196('0x3e')]=qs[_0x7196('0x35')](_[_0x7196('0x3f')](_0x4ecea1[_0x7196('0x33')],_0x30151f[_0x7196('0x35')]));if(_0x4ecea1[_0x7196('0x33')][_0x7196('0x40')]){_0x59d79d[_0x7196('0x3e')]=_[_0x7196('0x41')](_0x59d79d['where'],{'$or':_[_0x7196('0x32')](_0x1257ad,function(_0x17cefd){if(_0x17cefd['type']!==_0x7196('0x42')){var _0x54767f={};_0x54767f[_0x17cefd['name']]={'$like':'%'+_0x4ecea1[_0x7196('0x33')][_0x7196('0x40')]+'%'};return _0x54767f;}})});}_0x59d79d=_['merge']({},_0x59d79d,_0x4ecea1['options']);var _0x1bad95={'where':_0x59d79d[_0x7196('0x3e')]};return db[_0x7196('0x2d')]['count'](_0x1bad95)[_0x7196('0x29')](function(_0x2d13a5){_0x985727[_0x7196('0x24')]=_0x2d13a5;if(_0x4ecea1[_0x7196('0x33')][_0x7196('0x43')]){_0x59d79d[_0x7196('0x44')]=[{'all':!![]}];}return db[_0x7196('0x2d')][_0x7196('0x45')](_0x59d79d);})['then'](function(_0x89c8ea){_0x985727[_0x7196('0x46')]=_0x89c8ea;return _0x985727;})['then'](respondWithFilteredResult(_0x4fd339,_0x59d79d))[_0x7196('0x47')](handleError(_0x4fd339,null));};exports[_0x7196('0x48')]=function(_0x48178f,_0x471915){var _0x471bb2={'raw':![],'where':{'id':_0x48178f['params']['id']}},_0x3b78c8={};_0x3b78c8[_0x7196('0x31')]=_[_0x7196('0x34')](db['VoiceQueueReport'][_0x7196('0x2e')]);_0x3b78c8[_0x7196('0x33')]=_['keys'](_0x48178f[_0x7196('0x33')]);_0x3b78c8['filters']=_['intersection'](_0x3b78c8['model'],_0x3b78c8['query']);_0x471bb2['attributes']=_[_0x7196('0x36')](_0x3b78c8['model'],qs[_0x7196('0x37')](_0x48178f[_0x7196('0x33')][_0x7196('0x37')]));_0x471bb2[_0x7196('0x38')]=_0x471bb2['attributes'][_0x7196('0x39')]?_0x471bb2['attributes']:_0x3b78c8[_0x7196('0x31')];if(_0x48178f[_0x7196('0x33')][_0x7196('0x43')]){_0x471bb2['include']=[{'all':!![]}];}_0x471bb2=_[_0x7196('0x41')]({},_0x471bb2,_0x48178f[_0x7196('0x49')]);return db[_0x7196('0x2d')]['find'](_0x471bb2)['then'](handleEntityNotFound(_0x471915,null))[_0x7196('0x29')](respondWithResult(_0x471915,null))['catch'](handleError(_0x471915,null));};exports[_0x7196('0x4a')]=function(_0x582884,_0x53b4c7){return db[_0x7196('0x2d')]['create'](_0x582884['body'],{})['then'](respondWithResult(_0x53b4c7,0xc9))[_0x7196('0x47')](handleError(_0x53b4c7,null));};exports['update']=function(_0x48e3b5,_0x28591e){if(_0x48e3b5[_0x7196('0x4b')]['id']){delete _0x48e3b5[_0x7196('0x4b')]['id'];}return db[_0x7196('0x2d')]['find']({'where':{'id':_0x48e3b5[_0x7196('0x4c')]['id']}})['then'](handleEntityNotFound(_0x28591e,null))[_0x7196('0x29')](saveUpdates(_0x48e3b5[_0x7196('0x4b')],null))['then'](respondWithResult(_0x28591e,null))[_0x7196('0x47')](handleError(_0x28591e,null));};exports[_0x7196('0x2a')]=function(_0x3fe092,_0x4fa18f){return db[_0x7196('0x2d')]['find']({'where':{'id':_0x3fe092[_0x7196('0x4c')]['id']}})[_0x7196('0x29')](handleEntityNotFound(_0x4fa18f,null))[_0x7196('0x29')](removeEntity(_0x4fa18f,null))[_0x7196('0x47')](handleError(_0x4fa18f,null));};exports[_0x7196('0x4d')]=function(_0x19733a,_0x7e0d3){return db[_0x7196('0x2d')]['describe']()['then'](respondWithResult(_0x7e0d3,null))[_0x7196('0x47')](handleError(_0x7e0d3,null));};exports[_0x7196('0x4e')]=function(_0x40f820,_0xe4b032){var _0x4ebcd7={},_0x76b189={},_0x6948a={'count':0x0,'rows':[]};_0x76b189[_0x7196('0x31')]=_[_0x7196('0x34')](db[_0x7196('0x2d')][_0x7196('0x2e')]);_0x76b189[_0x7196('0x33')]=_[_0x7196('0x34')](_0x40f820[_0x7196('0x33')]);_0x76b189[_0x7196('0x35')]=_[_0x7196('0x36')](_0x76b189['model'],_0x76b189[_0x7196('0x33')]);_0x4ebcd7[_0x7196('0x38')]=_[_0x7196('0x36')](_0x76b189['model'],qs[_0x7196('0x37')](_0x40f820['query'][_0x7196('0x37')]));_0x4ebcd7[_0x7196('0x38')]=_0x4ebcd7[_0x7196('0x38')][_0x7196('0x39')]?_0x4ebcd7[_0x7196('0x38')]:_0x76b189['model'];if(!_0x40f820[_0x7196('0x33')]['hasOwnProperty']('nolimit')){_0x4ebcd7['limit']=qs[_0x7196('0x3b')](_0x40f820[_0x7196('0x33')][_0x7196('0x3b')]);_0x4ebcd7[_0x7196('0x25')]=qs[_0x7196('0x25')](_0x40f820[_0x7196('0x33')][_0x7196('0x25')]);}_0x4ebcd7['order']=qs[_0x7196('0x3d')](_0x40f820[_0x7196('0x33')][_0x7196('0x3d')]);_0x4ebcd7[_0x7196('0x3e')]=qs[_0x7196('0x35')](_['pick'](_0x40f820['query'],_0x76b189[_0x7196('0x35')]));if(_0x40f820[_0x7196('0x33')][_0x7196('0x40')]){_0x4ebcd7[_0x7196('0x3e')]=_[_0x7196('0x41')](_0x4ebcd7[_0x7196('0x3e')],{'$or':_[_0x7196('0x32')](_0x4ebcd7[_0x7196('0x38')],function(_0x13e9d0){var _0x2caadd={};_0x2caadd[_0x13e9d0]={'$like':'%'+_0x40f820[_0x7196('0x33')]['filter']+'%'};return _0x2caadd;})});}_0x4ebcd7=_[_0x7196('0x41')]({},_0x4ebcd7,_0x40f820[_0x7196('0x49')]);var _0x27d5d7={'where':_0x4ebcd7[_0x7196('0x3e')]};return db['VoiceQueueReport'][_0x7196('0x24')](_0x27d5d7)[_0x7196('0x29')](function(_0x1f3acc){_0x6948a[_0x7196('0x24')]=_0x1f3acc;if(_0x40f820[_0x7196('0x33')][_0x7196('0x43')]){_0x4ebcd7[_0x7196('0x44')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x7196('0x45')](_0x4ebcd7);})[_0x7196('0x29')](function(_0x40df9b){_0x6948a[_0x7196('0x46')]=_0x40df9b;return _0x6948a;})['then'](respondWithFilteredResult(_0xe4b032,_0x4ebcd7,_0x7196('0x4e')))[_0x7196('0x47')](handleError(_0xe4b032,null,_0x7196('0x4e')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 2513bd0..e7e0dea 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 _0x3397=['hasOwnProperty','hook','../../mysqldb','VoiceQueueReport','setMaxListeners','update','remove','emit'];(function(_0x534a1f,_0x3e6c67){var _0x18c7fc=function(_0x4a9fd0){while(--_0x4a9fd0){_0x534a1f['push'](_0x534a1f['shift']());}};_0x18c7fc(++_0x3e6c67);}(_0x3397,0x6a));var _0x7339=function(_0x473ee7,_0x4dd754){_0x473ee7=_0x473ee7-0x0;var _0x30f0d4=_0x3397[_0x473ee7];return _0x30f0d4;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require(_0x7339('0x0'))['db'][_0x7339('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x7339('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7339('0x3'),'afterDestroy':_0x7339('0x4')};function emitEvent(_0x373c38){return function(_0x271d95,_0x170e10,_0x3e69f2){VoiceQueueReportEvents['emit'](_0x373c38+':'+_0x271d95['id'],_0x271d95);VoiceQueueReportEvents[_0x7339('0x5')](_0x373c38,_0x271d95);_0x3e69f2(null);};}for(var e in events){if(events[_0x7339('0x6')](e)){var event=events[e];VoiceQueueReport[_0x7339('0x7')](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents; \ No newline at end of file +var _0x83d6=['save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','VoiceQueueReport','setMaxListeners'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x83d6,0x115));var _0x683d=function(_0x897921,_0x5dc83c){_0x897921=_0x897921-0x0;var _0xad42d5=_0x83d6[_0x897921];return _0xad42d5;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require(_0x683d('0x0'))['db'][_0x683d('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x683d('0x2')](0x0);var events={'afterCreate':_0x683d('0x3'),'afterUpdate':_0x683d('0x4'),'afterDestroy':_0x683d('0x5')};function emitEvent(_0x4ce216){return function(_0x5670e1,_0x372a4c,_0x2bbf2d){VoiceQueueReportEvents[_0x683d('0x6')](_0x4ce216+':'+_0x5670e1['id'],_0x5670e1);VoiceQueueReportEvents[_0x683d('0x6')](_0x4ce216,_0x5670e1);_0x2bbf2d(null);};}for(var e in events){if(events[_0x683d('0x7')](e)){var event=events[e];VoiceQueueReport[_0x683d('0x8')](e,emitEvent(event));}}module[_0x683d('0x9')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 610bffc..029d692 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 _0xbaf0=['define','VoiceQueueReport','report_queue','calleridnum','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceQueueReport.attributes','exports'];(function(_0x37783e,_0x12c836){var _0xb12a76=function(_0x43f66c){while(--_0x43f66c){_0x37783e['push'](_0x37783e['shift']());}};_0xb12a76(++_0x12c836);}(_0xbaf0,0x12a));var _0x0baf=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xbaf0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':[_0x0baf('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbaf0=['define','VoiceQueueReport','report_queue','calleridnum','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceQueueReport.attributes','exports'];(function(_0x27e1ff,_0x155c24){var _0x3c8486=function(_0x50a736){while(--_0x50a736){_0x27e1ff['push'](_0x27e1ff['shift']());}};_0x3c8486(++_0x155c24);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xbaf0[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':[_0x0baf('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 325875f..2e5fe84 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 _0x7a1b=['then','CreateVoiceQueueReport','create','body','UpdateVoiceQueueReport','update','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','http','redis','localhost','request','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','where','attributes','limit','include','model','map'];(function(_0x4e2964,_0x1bf262){var _0x57d48f=function(_0x285c51){while(--_0x285c51){_0x4e2964['push'](_0x4e2964['shift']());}};_0x57d48f(++_0x1bf262);}(_0x7a1b,0x81));var _0xb7a1=function(_0x4aa391,_0x473a14){_0x4aa391=_0x4aa391-0x0;var _0x50dc8c=_0x7a1b[_0x4aa391];return _0x50dc8c;};'use strict';var _=require(_0xb7a1('0x0'));var util=require(_0xb7a1('0x1'));var moment=require(_0xb7a1('0x2'));var BPromise=require(_0xb7a1('0x3'));var rs=require(_0xb7a1('0x4'));var fs=require('fs');var Redis=require(_0xb7a1('0x5'));var db=require(_0xb7a1('0x6'))['db'];var utils=require(_0xb7a1('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xb7a1('0x8'));var client=jayson['client'][_0xb7a1('0x9')]({'port':0x232a});config[_0xb7a1('0xa')]=_['defaults'](config['redis'],{'host':_0xb7a1('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./voiceQueueReport.socket')['register'](socket);function respondWithRpcPromise(_0x290e9b,_0x4b9a41,_0x35bfa1){return new BPromise(function(_0x23afd4,_0x4aad2f){return client[_0xb7a1('0xc')](_0x290e9b,_0x35bfa1)['then'](function(_0x5db9f2){logger[_0xb7a1('0xd')](_0xb7a1('0xe'),_0x4b9a41,_0xb7a1('0xf'));logger[_0xb7a1('0x10')](_0xb7a1('0x11'),_0x4b9a41,_0xb7a1('0xf'),JSON[_0xb7a1('0x12')](_0x5db9f2));if(_0x5db9f2[_0xb7a1('0x13')]){if(_0x5db9f2[_0xb7a1('0x13')][_0xb7a1('0x14')]===0x1f4){logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x4b9a41,_0x5db9f2['error'][_0xb7a1('0x15')]);return _0x4aad2f(_0x5db9f2['error'][_0xb7a1('0x15')]);}logger['error'](_0xb7a1('0xe'),_0x4b9a41,_0x5db9f2[_0xb7a1('0x13')][_0xb7a1('0x15')]);return _0x23afd4(_0x5db9f2['error']['message']);}else{logger['info'](_0xb7a1('0xe'),_0x4b9a41,'request\x20sent');_0x23afd4(_0x5db9f2[_0xb7a1('0x16')][_0xb7a1('0x15')]);}})[_0xb7a1('0x17')](function(_0x5ad3dd){logger[_0xb7a1('0x13')](_0xb7a1('0xe'),_0x4b9a41,_0x5ad3dd);_0x4aad2f(_0x5ad3dd);});});}exports[_0xb7a1('0x18')]=function(_0x53428e){var _0x5eba06=this;return new Promise(function(_0x82c955,_0x5a9324){return db[_0xb7a1('0x19')][_0xb7a1('0x1a')]({'raw':_0x53428e[_0xb7a1('0x1b')]?_0x53428e[_0xb7a1('0x1b')][_0xb7a1('0x1c')]===undefined?!![]:![]:!![],'where':_0x53428e[_0xb7a1('0x1b')]?_0x53428e['options'][_0xb7a1('0x1d')]||null:null,'attributes':_0x53428e[_0xb7a1('0x1b')]?_0x53428e[_0xb7a1('0x1b')][_0xb7a1('0x1e')]||null:null,'limit':_0x53428e[_0xb7a1('0x1b')]?_0x53428e[_0xb7a1('0x1b')][_0xb7a1('0x1f')]||null:null,'include':_0x53428e[_0xb7a1('0x1b')]?_0x53428e[_0xb7a1('0x1b')][_0xb7a1('0x20')]?_['map'](_0x53428e[_0xb7a1('0x1b')]['include'],function(_0x3f12ff){return{'model':db[_0x3f12ff[_0xb7a1('0x21')]],'as':_0x3f12ff['as'],'attributes':_0x3f12ff[_0xb7a1('0x1e')],'include':_0x3f12ff['include']?_['map'](_0x3f12ff[_0xb7a1('0x20')],function(_0x16f9fe){return{'model':db[_0x16f9fe[_0xb7a1('0x21')]],'as':_0x16f9fe['as'],'attributes':_0x16f9fe[_0xb7a1('0x1e')],'include':_0x16f9fe[_0xb7a1('0x20')]?_[_0xb7a1('0x22')](_0x16f9fe[_0xb7a1('0x20')],function(_0x2b38d2){return{'model':db[_0x2b38d2[_0xb7a1('0x21')]],'as':_0x2b38d2['as'],'attributes':_0x2b38d2[_0xb7a1('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xb7a1('0x23')](function(_0x2d435c){logger['info'](_0xb7a1('0x18'),_0x53428e);logger[_0xb7a1('0x10')](_0xb7a1('0x18'),_0x53428e,JSON[_0xb7a1('0x12')](_0x2d435c));_0x82c955(_0x2d435c);})[_0xb7a1('0x17')](function(_0x545298){logger['error'](_0xb7a1('0x18'),_0x545298['message'],_0x53428e);_0x5a9324(_0x5eba06[_0xb7a1('0x13')](0x1f4,_0x545298[_0xb7a1('0x15')]));});});};exports[_0xb7a1('0x24')]=function(_0x4a268a){var _0x4ee1ef=this;return new Promise(function(_0x40c929,_0x4c08f3){return db[_0xb7a1('0x19')][_0xb7a1('0x25')](_0x4a268a[_0xb7a1('0x26')],{'raw':_0x4a268a[_0xb7a1('0x1b')]?_0x4a268a['options'][_0xb7a1('0x1c')]===undefined?!![]:![]:!![]})[_0xb7a1('0x23')](function(_0x43432a){logger['info'](_0xb7a1('0x24'),_0x4a268a);logger[_0xb7a1('0x10')](_0xb7a1('0x24'),_0x4a268a,JSON[_0xb7a1('0x12')](_0x43432a));_0x40c929(_0x43432a);})[_0xb7a1('0x17')](function(_0x45f0b2){logger['error'](_0xb7a1('0x24'),_0x45f0b2['message'],_0x4a268a);_0x4c08f3(_0x4ee1ef[_0xb7a1('0x13')](0x1f4,_0x45f0b2[_0xb7a1('0x15')]));});});};exports[_0xb7a1('0x27')]=function(_0x3256a0){var _0x2ac800=this;return new Promise(function(_0x2b07b6,_0xc636ce){return db['VoiceQueueReport'][_0xb7a1('0x28')](_0x3256a0[_0xb7a1('0x26')],{'raw':_0x3256a0[_0xb7a1('0x1b')]?_0x3256a0[_0xb7a1('0x1b')][_0xb7a1('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3256a0[_0xb7a1('0x1b')]?_0x3256a0[_0xb7a1('0x1b')][_0xb7a1('0x1d')]||null:null,'attributes':_0x3256a0[_0xb7a1('0x1b')]?_0x3256a0[_0xb7a1('0x1b')]['attributes']||null:null,'limit':_0x3256a0[_0xb7a1('0x1b')]?_0x3256a0[_0xb7a1('0x1b')]['limit']||null:null})[_0xb7a1('0x23')](function(_0x5f4dd7){logger[_0xb7a1('0xd')](_0xb7a1('0x27'),_0x3256a0);logger[_0xb7a1('0x10')](_0xb7a1('0x27'),_0x3256a0,JSON[_0xb7a1('0x12')](_0x5f4dd7));_0x2b07b6(_0x5f4dd7);})[_0xb7a1('0x17')](function(_0x5a8416){logger[_0xb7a1('0x13')](_0xb7a1('0x27'),_0x5a8416['message'],_0x3256a0);_0xc636ce(_0x2ac800[_0xb7a1('0x13')](0x1f4,_0x5a8416[_0xb7a1('0x15')]));});});}; \ No newline at end of file +var _0xf30b=['redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','where','attributes','limit','include','map','model','CreateVoiceQueueReport','create','body','UpdateVoiceQueueReport','update','lodash','util','bluebird','../../config/logger','../../config/environment','jayson/promise','defaults'];(function(_0x118f5d,_0x1d33d1){var _0x36726e=function(_0x18d9b5){while(--_0x18d9b5){_0x118f5d['push'](_0x118f5d['shift']());}};_0x36726e(++_0x1d33d1);}(_0xf30b,0x141));var _0xbf30=function(_0x2cdec6,_0x39d4c8){_0x2cdec6=_0x2cdec6-0x0;var _0xa36703=_0xf30b[_0x2cdec6];return _0xa36703;};'use strict';var _=require(_0xbf30('0x0'));var util=require(_0xbf30('0x1'));var moment=require('moment');var BPromise=require(_0xbf30('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbf30('0x3'))('rpc');var config=require(_0xbf30('0x4'));var jayson=require(_0xbf30('0x5'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0xbf30('0x6')](config[_0xbf30('0x7')],{'host':_0xbf30('0x8'),'port':0x18eb});var socket=require(_0xbf30('0x9'))(new Redis(config[_0xbf30('0x7')]));require(_0xbf30('0xa'))[_0xbf30('0xb')](socket);function respondWithRpcPromise(_0x5e1440,_0x30673e,_0x3145aa){return new BPromise(function(_0x334020,_0x3b497f){return client[_0xbf30('0xc')](_0x5e1440,_0x3145aa)[_0xbf30('0xd')](function(_0x737791){logger[_0xbf30('0xe')](_0xbf30('0xf'),_0x30673e,_0xbf30('0x10'));logger[_0xbf30('0x11')](_0xbf30('0x12'),_0x30673e,_0xbf30('0x10'),JSON[_0xbf30('0x13')](_0x737791));if(_0x737791[_0xbf30('0x14')]){if(_0x737791[_0xbf30('0x14')][_0xbf30('0x15')]===0x1f4){logger[_0xbf30('0x14')](_0xbf30('0xf'),_0x30673e,_0x737791[_0xbf30('0x14')][_0xbf30('0x16')]);return _0x3b497f(_0x737791['error'][_0xbf30('0x16')]);}logger['error'](_0xbf30('0xf'),_0x30673e,_0x737791['error'][_0xbf30('0x16')]);return _0x334020(_0x737791['error'][_0xbf30('0x16')]);}else{logger[_0xbf30('0xe')](_0xbf30('0xf'),_0x30673e,_0xbf30('0x10'));_0x334020(_0x737791[_0xbf30('0x17')][_0xbf30('0x16')]);}})[_0xbf30('0x18')](function(_0x39ef00){logger[_0xbf30('0x14')](_0xbf30('0xf'),_0x30673e,_0x39ef00);_0x3b497f(_0x39ef00);});});}exports[_0xbf30('0x19')]=function(_0x57a226){var _0x19e934=this;return new Promise(function(_0x3674a1,_0x20e1ce){return db[_0xbf30('0x1a')][_0xbf30('0x1b')]({'raw':_0x57a226[_0xbf30('0x1c')]?_0x57a226['options'][_0xbf30('0x1d')]===undefined?!![]:![]:!![],'where':_0x57a226[_0xbf30('0x1c')]?_0x57a226['options'][_0xbf30('0x1e')]||null:null,'attributes':_0x57a226[_0xbf30('0x1c')]?_0x57a226[_0xbf30('0x1c')][_0xbf30('0x1f')]||null:null,'limit':_0x57a226[_0xbf30('0x1c')]?_0x57a226[_0xbf30('0x1c')][_0xbf30('0x20')]||null:null,'include':_0x57a226[_0xbf30('0x1c')]?_0x57a226[_0xbf30('0x1c')][_0xbf30('0x21')]?_[_0xbf30('0x22')](_0x57a226[_0xbf30('0x1c')][_0xbf30('0x21')],function(_0x57ca8c){return{'model':db[_0x57ca8c[_0xbf30('0x23')]],'as':_0x57ca8c['as'],'attributes':_0x57ca8c['attributes'],'include':_0x57ca8c['include']?_[_0xbf30('0x22')](_0x57ca8c[_0xbf30('0x21')],function(_0x4f0c60){return{'model':db[_0x4f0c60[_0xbf30('0x23')]],'as':_0x4f0c60['as'],'attributes':_0x4f0c60['attributes'],'include':_0x4f0c60[_0xbf30('0x21')]?_[_0xbf30('0x22')](_0x4f0c60[_0xbf30('0x21')],function(_0x5e1074){return{'model':db[_0x5e1074['model']],'as':_0x5e1074['as'],'attributes':_0x5e1074[_0xbf30('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xbf30('0xd')](function(_0x20576a){logger[_0xbf30('0xe')](_0xbf30('0x19'),_0x57a226);logger[_0xbf30('0x11')](_0xbf30('0x19'),_0x57a226,JSON['stringify'](_0x20576a));_0x3674a1(_0x20576a);})['catch'](function(_0x4a5f8a){logger[_0xbf30('0x14')]('GetVoiceQueueReport',_0x4a5f8a[_0xbf30('0x16')],_0x57a226);_0x20e1ce(_0x19e934[_0xbf30('0x14')](0x1f4,_0x4a5f8a[_0xbf30('0x16')]));});});};exports[_0xbf30('0x24')]=function(_0x1fef2e){var _0x4b619b=this;return new Promise(function(_0x24750d,_0x54cd9a){return db[_0xbf30('0x1a')][_0xbf30('0x25')](_0x1fef2e[_0xbf30('0x26')],{'raw':_0x1fef2e['options']?_0x1fef2e[_0xbf30('0x1c')][_0xbf30('0x1d')]===undefined?!![]:![]:!![]})[_0xbf30('0xd')](function(_0x255e53){logger[_0xbf30('0xe')](_0xbf30('0x24'),_0x1fef2e);logger['debug'](_0xbf30('0x24'),_0x1fef2e,JSON[_0xbf30('0x13')](_0x255e53));_0x24750d(_0x255e53);})[_0xbf30('0x18')](function(_0x2f3ffa){logger['error'](_0xbf30('0x24'),_0x2f3ffa[_0xbf30('0x16')],_0x1fef2e);_0x54cd9a(_0x4b619b[_0xbf30('0x14')](0x1f4,_0x2f3ffa[_0xbf30('0x16')]));});});};exports[_0xbf30('0x27')]=function(_0xdb229e){var _0x10d8bc=this;return new Promise(function(_0x4ea716,_0x1aad31){return db[_0xbf30('0x1a')][_0xbf30('0x28')](_0xdb229e[_0xbf30('0x26')],{'raw':_0xdb229e[_0xbf30('0x1c')]?_0xdb229e[_0xbf30('0x1c')][_0xbf30('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xdb229e[_0xbf30('0x1c')]?_0xdb229e[_0xbf30('0x1c')]['where']||null:null,'attributes':_0xdb229e[_0xbf30('0x1c')]?_0xdb229e[_0xbf30('0x1c')]['attributes']||null:null,'limit':_0xdb229e[_0xbf30('0x1c')]?_0xdb229e[_0xbf30('0x1c')][_0xbf30('0x20')]||null:null})[_0xbf30('0xd')](function(_0xcea98a){logger['info'](_0xbf30('0x27'),_0xdb229e);logger[_0xbf30('0x11')](_0xbf30('0x27'),_0xdb229e,JSON[_0xbf30('0x13')](_0xcea98a));_0x4ea716(_0xcea98a);})[_0xbf30('0x18')](function(_0x403694){logger[_0xbf30('0x14')](_0xbf30('0x27'),_0x403694['message'],_0xdb229e);_0x1aad31(_0x10d8bc['error'](0x1f4,_0x403694[_0xbf30('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 09973e2..9a4c4ab 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 _0xccbd=['voiceQueueReport:','save','remove','emit','removeListener','length'];(function(_0xda4cb2,_0x21d68c){var _0x2a6cae=function(_0x1f2c1e){while(--_0x1f2c1e){_0xda4cb2['push'](_0xda4cb2['shift']());}};_0x2a6cae(++_0x21d68c);}(_0xccbd,0xe5));var _0xdccb=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xccbd[_0x8c43de];return _0xa6591b;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0xdccb('0x0'),_0xdccb('0x1'),'update'];function createListener(_0x2376f0,_0x5e7185){return function(_0x5ec833){_0x5e7185[_0xdccb('0x2')](_0x2376f0,_0x5ec833);};}function removeListener(_0x2fc6c8,_0x409cf3){return function(){VoiceQueueReportEvents[_0xdccb('0x3')](_0x2fc6c8,_0x409cf3);};}exports['register']=function(_0x8c6ae6){for(var _0x16bdef=0x0,_0x2bd497=events[_0xdccb('0x4')];_0x16bdef<_0x2bd497;_0x16bdef++){var _0xc9bc31=events[_0x16bdef];var _0x38d9c1=createListener(_0xdccb('0x5')+_0xc9bc31,_0x8c6ae6);VoiceQueueReportEvents['on'](_0xc9bc31,_0x38d9c1);}}; \ No newline at end of file +var _0xa0a5=['removeListener','register','length','voiceQueueReport:','save','remove','update','emit'];(function(_0xd3cc23,_0x2ee708){var _0x4b7869=function(_0xdd9b63){while(--_0xdd9b63){_0xd3cc23['push'](_0xd3cc23['shift']());}};_0x4b7869(++_0x2ee708);}(_0xa0a5,0x1f4));var _0x5a0a=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xa0a5[_0x465028];return _0xb783d4;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0x5a0a('0x0'),_0x5a0a('0x1'),_0x5a0a('0x2')];function createListener(_0x26243f,_0x468ef4){return function(_0x30539a){_0x468ef4[_0x5a0a('0x3')](_0x26243f,_0x30539a);};}function removeListener(_0x663c27,_0x27921d){return function(){VoiceQueueReportEvents[_0x5a0a('0x4')](_0x663c27,_0x27921d);};}exports[_0x5a0a('0x5')]=function(_0x380ca6){for(var _0x472beb=0x0,_0x1a2973=events[_0x5a0a('0x6')];_0x472beb<_0x1a2973;_0x472beb++){var _0x1cbfa3=events[_0x472beb];var _0x3c65bd=createListener(_0x5a0a('0x7')+_0x1cbfa3,_0x380ca6);VoiceQueueReportEvents['on'](_0x1cbfa3,_0x3c65bd);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index e0c45ce..61a8faf 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 _0x5d50=['isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./voiceQueuesLog.controller','get'];(function(_0x29df9a,_0x42aff3){var _0x3a8e96=function(_0x70fbe7){while(--_0x70fbe7){_0x29df9a['push'](_0x29df9a['shift']());}};_0x3a8e96(++_0x42aff3);}(_0x5d50,0xad));var _0x05d5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5d50[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x05d5('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x05d5('0x1'));var express=require(_0x05d5('0x2'));var router=express['Router']();var auth=require(_0x05d5('0x3'));var interaction=require(_0x05d5('0x4'));var config=require('../../config/environment');var controller=require(_0x05d5('0x5'));router[_0x05d5('0x6')]('/',auth[_0x05d5('0x7')](),controller[_0x05d5('0x8')]);router[_0x05d5('0x6')](_0x05d5('0x9'),auth['isAuthenticated'](),controller[_0x05d5('0xa')]);router[_0x05d5('0xb')]('/',auth['isAuthenticated'](),controller[_0x05d5('0xc')]);router[_0x05d5('0xd')](_0x05d5('0x9'),auth[_0x05d5('0x7')](),controller[_0x05d5('0xe')]);router[_0x05d5('0xf')](_0x05d5('0x9'),auth[_0x05d5('0x7')](),controller[_0x05d5('0x10')]);module[_0x05d5('0x11')]=router; \ No newline at end of file +var _0xfe96=['create','put','update','delete','destroy','multer','path','connect-timeout','./voiceQueuesLog.controller','isAuthenticated','get','/:id'];(function(_0x439433,_0x34813c){var _0x52de3f=function(_0x40e52e){while(--_0x40e52e){_0x439433['push'](_0x439433['shift']());}};_0x52de3f(++_0x34813c);}(_0xfe96,0xdd));var _0x6fe9=function(_0x2ac30f,_0x498784){_0x2ac30f=_0x2ac30f-0x0;var _0x1ac3e7=_0xfe96[_0x2ac30f];return _0x1ac3e7;};'use strict';var multer=require(_0x6fe9('0x0'));var util=require('util');var path=require(_0x6fe9('0x1'));var timeout=require(_0x6fe9('0x2'));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(_0x6fe9('0x3'));router['get']('/',auth[_0x6fe9('0x4')](),controller['index']);router[_0x6fe9('0x5')](_0x6fe9('0x6'),auth[_0x6fe9('0x4')](),controller['show']);router['post']('/',auth[_0x6fe9('0x4')](),controller[_0x6fe9('0x7')]);router[_0x6fe9('0x8')](_0x6fe9('0x6'),auth[_0x6fe9('0x4')](),controller[_0x6fe9('0x9')]);router[_0x6fe9('0xa')](_0x6fe9('0x6'),auth[_0x6fe9('0x4')](),controller[_0x6fe9('0xb')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 65f6d70..3324419 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 _0x742d=['sequelize','moment','exports','STRING','DATE','format'];(function(_0x4c9278,_0x324a88){var _0x7844a9=function(_0x24e5dc){while(--_0x24e5dc){_0x4c9278['push'](_0x4c9278['shift']());}};_0x7844a9(++_0x324a88);}(_0x742d,0x66));var _0xd742=function(_0x278d9f,_0x1122d9){_0x278d9f=_0x278d9f-0x0;var _0x5c8889=_0x742d[_0x278d9f];return _0x5c8889;};'use strict';var Sequelize=require(_0xd742('0x0'));var moment=require(_0xd742('0x1'));module[_0xd742('0x2')]={'time':{'type':Sequelize[_0xd742('0x3')]},'callid':{'type':Sequelize[_0xd742('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xd742('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xd742('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xd742('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xd742('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xd742('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xd742('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xd742('0x4')],'allowNull':![],'defaultValue':moment()[_0xd742('0x5')]('YYYY-MM-DD\x20HH:mm:ss')}}; \ No newline at end of file +var _0x537f=['DATE','format','YYYY-MM-DD\x20HH:mm:ss','sequelize','moment','exports','STRING'];(function(_0x58d690,_0x5a792e){var _0x3faf59=function(_0xba78ae){while(--_0xba78ae){_0x58d690['push'](_0x58d690['shift']());}};_0x3faf59(++_0x5a792e);}(_0x537f,0x106));var _0xf537=function(_0x2db429,_0x494c1d){_0x2db429=_0x2db429-0x0;var _0x30325f=_0x537f[_0x2db429];return _0x30325f;};'use strict';var Sequelize=require(_0xf537('0x0'));var moment=require(_0xf537('0x1'));module[_0xf537('0x2')]={'time':{'type':Sequelize[_0xf537('0x3')]},'callid':{'type':Sequelize[_0xf537('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xf537('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xf537('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xf537('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xf537('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xf537('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xf537('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xf537('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xf537('0x4')],'allowNull':![],'defaultValue':moment()[_0xf537('0x5')](_0xf537('0x6'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index f0d815e..08c176e 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 _0x7e19=['desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','map','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','catch','include','options','find','body','VoiceQueuesLog','params','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','ejs','lodash'];(function(_0x1c1ce0,_0x18d3ed){var _0x431b43=function(_0x3b409d){while(--_0x3b409d){_0x1c1ce0['push'](_0x1c1ce0['shift']());}};_0x431b43(++_0x18d3ed);}(_0x7e19,0xbb));var _0x97e1=function(_0xbc2fda,_0x1cf03d){_0xbc2fda=_0xbc2fda-0x0;var _0x3a8f3e=_0x7e19[_0xbc2fda];return _0x3a8f3e;};'use strict';var pdf=require(_0x97e1('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x97e1('0x1'));var zipdir=require(_0x97e1('0x2'));var jsonpatch=require(_0x97e1('0x3'));var rp=require('request-promise');var moment=require(_0x97e1('0x4'));var BPromise=require(_0x97e1('0x5'));var Mustache=require('mustache');var util=require(_0x97e1('0x6'));var path=require(_0x97e1('0x7'));var sox=require(_0x97e1('0x8'));var csv=require('to-csv');var ejs=require(_0x97e1('0x9'));var fs=require('fs');var _=require(_0x97e1('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x97e1('0xb'));var toCsv=require(_0x97e1('0xc'));var querystring=require(_0x97e1('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x97e1('0xe'));var qs=require(_0x97e1('0xf'));var as=require(_0x97e1('0x10'));var hardwareService=require(_0x97e1('0x11'));var logger=require(_0x97e1('0x12'))(_0x97e1('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xfec0ad,_0xddaf32){_0xddaf32=_0xddaf32||0xcc;return function(_0x221b94){if(_0x221b94){return _0xfec0ad[_0x97e1('0x14')](_0xddaf32);}return _0xfec0ad[_0x97e1('0x15')](_0xddaf32)[_0x97e1('0x16')]();};}function respondWithResult(_0x3280bc,_0x2be9e7){_0x2be9e7=_0x2be9e7||0xc8;return function(_0x665e83){if(_0x665e83){return _0x3280bc[_0x97e1('0x15')](_0x2be9e7)[_0x97e1('0x17')](_0x665e83);}};}function respondWithFilteredResult(_0x36903a,_0x248644){return function(_0x221da4){if(_0x221da4){var _0x3cad8a=_0x221da4[_0x97e1('0x18')],_0x3b355b=_0x248644[_0x97e1('0x19')],_0x257ab2=_0x248644[_0x97e1('0x19')]+_0x248644[_0x97e1('0x1a')],_0x1cfa77;if(_0x257ab2>=_0x3cad8a){_0x257ab2=_0x3cad8a;_0x1cfa77=0xc8;}else{_0x1cfa77=0xce;}_0x36903a[_0x97e1('0x15')](_0x1cfa77);return _0x36903a[_0x97e1('0x1b')](_0x97e1('0x1c'),_0x3b355b+'-'+_0x257ab2+'/'+_0x3cad8a)['json'](_0x221da4);}return null;};}function patchUpdates(_0x58e9aa){return function(_0x5d698e){try{jsonpatch[_0x97e1('0x1d')](_0x5d698e,_0x58e9aa,!![]);}catch(_0x1f751b){return BPromise[_0x97e1('0x1e')](_0x1f751b);}return _0x5d698e[_0x97e1('0x1f')]();};}function saveUpdates(_0x4a8ade,_0x344d9d){return function(_0x119336){if(_0x119336){return _0x119336[_0x97e1('0x20')](_0x4a8ade)[_0x97e1('0x21')](function(_0x15153d){return _0x15153d;});}return null;};}function removeEntity(_0x6a91f4,_0x146df6){return function(_0x2dfe13){if(_0x2dfe13){return _0x2dfe13[_0x97e1('0x22')]()[_0x97e1('0x21')](function(){_0x6a91f4[_0x97e1('0x15')](0xcc)[_0x97e1('0x16')]();});}};}function handleEntityNotFound(_0x3abdd0,_0x1a9a7d){return function(_0x283df4){if(!_0x283df4){_0x3abdd0['sendStatus'](0x194);}return _0x283df4;};}function handleError(_0x442046,_0x74231b){_0x74231b=_0x74231b||0x1f4;return function(_0x1148be){logger['error'](_0x1148be[_0x97e1('0x23')]);if(_0x1148be[_0x97e1('0x24')]){delete _0x1148be[_0x97e1('0x24')];}_0x442046[_0x97e1('0x15')](_0x74231b)[_0x97e1('0x25')](_0x1148be);};}exports['index']=function(_0x1fc885,_0x4d2a7c){var _0x5d8aa4={},_0x52ba4c={},_0x377a4f={'count':0x0,'rows':[]};var _0xe01129=_[_0x97e1('0x26')](db['VoiceQueuesLog']['rawAttributes'],function(_0x2ef3b5){return{'name':_0x2ef3b5[_0x97e1('0x27')],'type':_0x2ef3b5[_0x97e1('0x28')][_0x97e1('0x29')]};});_0x52ba4c[_0x97e1('0x2a')]=_[_0x97e1('0x26')](_0xe01129,_0x97e1('0x24'));_0x52ba4c[_0x97e1('0x2b')]=_[_0x97e1('0x2c')](_0x1fc885[_0x97e1('0x2b')]);_0x52ba4c['filters']=_[_0x97e1('0x2d')](_0x52ba4c[_0x97e1('0x2a')],_0x52ba4c[_0x97e1('0x2b')]);_0x5d8aa4[_0x97e1('0x2e')]=_[_0x97e1('0x2d')](_0x52ba4c[_0x97e1('0x2a')],qs[_0x97e1('0x2f')](_0x1fc885['query']['fields']));_0x5d8aa4['attributes']=_0x5d8aa4[_0x97e1('0x2e')][_0x97e1('0x30')]?_0x5d8aa4['attributes']:_0x52ba4c[_0x97e1('0x2a')];if(!_0x1fc885[_0x97e1('0x2b')][_0x97e1('0x31')](_0x97e1('0x32'))){_0x5d8aa4['limit']=qs['limit'](_0x1fc885[_0x97e1('0x2b')][_0x97e1('0x1a')]);_0x5d8aa4['offset']=qs[_0x97e1('0x19')](_0x1fc885[_0x97e1('0x2b')][_0x97e1('0x19')]);}_0x5d8aa4['order']=qs['sort'](_0x1fc885[_0x97e1('0x2b')][_0x97e1('0x33')]);_0x5d8aa4[_0x97e1('0x34')]=qs[_0x97e1('0x35')](_[_0x97e1('0x36')](_0x1fc885['query'],_0x52ba4c[_0x97e1('0x35')]));if(_0x1fc885[_0x97e1('0x2b')][_0x97e1('0x37')]){_0x5d8aa4[_0x97e1('0x34')]=_[_0x97e1('0x38')](_0x5d8aa4[_0x97e1('0x34')],{'$or':_[_0x97e1('0x26')](_0xe01129,function(_0x2e6737){if(_0x2e6737[_0x97e1('0x28')]!==_0x97e1('0x39')){var _0x2c6862={};_0x2c6862[_0x2e6737[_0x97e1('0x24')]]={'$like':'%'+_0x1fc885[_0x97e1('0x2b')][_0x97e1('0x37')]+'%'};return _0x2c6862;}})});}_0x5d8aa4=_[_0x97e1('0x38')]({},_0x5d8aa4,_0x1fc885['options']);var _0x13d7e7={'where':_0x5d8aa4[_0x97e1('0x34')]};return db['VoiceQueuesLog'][_0x97e1('0x18')](_0x13d7e7)[_0x97e1('0x21')](function(_0xf8891a){_0x377a4f[_0x97e1('0x18')]=_0xf8891a;if(_0x1fc885[_0x97e1('0x2b')][_0x97e1('0x3a')]){_0x5d8aa4['include']=[{'all':!![]}];}return db['VoiceQueuesLog']['findAll'](_0x5d8aa4);})[_0x97e1('0x21')](function(_0x594a21){_0x377a4f['rows']=_0x594a21;return _0x377a4f;})[_0x97e1('0x21')](respondWithFilteredResult(_0x4d2a7c,_0x5d8aa4))[_0x97e1('0x3b')](handleError(_0x4d2a7c,null));};exports['show']=function(_0xa3fe9f,_0x34f823){var _0x50968f={'raw':!![],'where':{'id':_0xa3fe9f['params']['id']}},_0x4a4df3={};_0x4a4df3[_0x97e1('0x2a')]=_[_0x97e1('0x2c')](db['VoiceQueuesLog']['rawAttributes']);_0x4a4df3[_0x97e1('0x2b')]=_['keys'](_0xa3fe9f[_0x97e1('0x2b')]);_0x4a4df3['filters']=_['intersection'](_0x4a4df3[_0x97e1('0x2a')],_0x4a4df3['query']);_0x50968f[_0x97e1('0x2e')]=_['intersection'](_0x4a4df3['model'],qs['fields'](_0xa3fe9f['query'][_0x97e1('0x2f')]));_0x50968f[_0x97e1('0x2e')]=_0x50968f['attributes']['length']?_0x50968f[_0x97e1('0x2e')]:_0x4a4df3[_0x97e1('0x2a')];if(_0xa3fe9f[_0x97e1('0x2b')]['includeAll']){_0x50968f[_0x97e1('0x3c')]=[{'all':!![]}];}_0x50968f=_[_0x97e1('0x38')]({},_0x50968f,_0xa3fe9f[_0x97e1('0x3d')]);return db['VoiceQueuesLog'][_0x97e1('0x3e')](_0x50968f)['then'](handleEntityNotFound(_0x34f823,null))['then'](respondWithResult(_0x34f823,null))[_0x97e1('0x3b')](handleError(_0x34f823,null));};exports['create']=function(_0x35610c,_0xd47785){return db['VoiceQueuesLog']['create'](_0x35610c['body'],{})[_0x97e1('0x21')](respondWithResult(_0xd47785,0xc9))[_0x97e1('0x3b')](handleError(_0xd47785,null));};exports[_0x97e1('0x20')]=function(_0x56513f,_0x180aca){if(_0x56513f[_0x97e1('0x3f')]['id']){delete _0x56513f[_0x97e1('0x3f')]['id'];}return db[_0x97e1('0x40')]['find']({'where':{'id':_0x56513f[_0x97e1('0x41')]['id']}})[_0x97e1('0x21')](handleEntityNotFound(_0x180aca,null))[_0x97e1('0x21')](saveUpdates(_0x56513f['body'],null))[_0x97e1('0x21')](respondWithResult(_0x180aca,null))[_0x97e1('0x3b')](handleError(_0x180aca,null));};exports[_0x97e1('0x22')]=function(_0x1f8a89,_0x575e81){return db[_0x97e1('0x40')][_0x97e1('0x3e')]({'where':{'id':_0x1f8a89[_0x97e1('0x41')]['id']}})['then'](handleEntityNotFound(_0x575e81,null))[_0x97e1('0x21')](removeEntity(_0x575e81,null))[_0x97e1('0x3b')](handleError(_0x575e81,null));}; \ No newline at end of file +var _0xdc18=['index','map','VoiceQueuesLog','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','filter','includeAll','include','params','keys','length','options','find','catch','create','body','html-pdf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name'];(function(_0x3f9024,_0x48d0e5){var _0x3c931c=function(_0x336fdf){while(--_0x336fdf){_0x3f9024['push'](_0x3f9024['shift']());}};_0x3c931c(++_0x48d0e5);}(_0xdc18,0x1b6));var _0x8dc1=function(_0x31f070,_0x2d7596){_0x31f070=_0x31f070-0x0;var _0x454a0b=_0xdc18[_0x31f070];return _0x454a0b;};'use strict';var pdf=require(_0x8dc1('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8dc1('0x1'));var rp=require(_0x8dc1('0x2'));var moment=require(_0x8dc1('0x3'));var BPromise=require(_0x8dc1('0x4'));var Mustache=require(_0x8dc1('0x5'));var util=require(_0x8dc1('0x6'));var path=require(_0x8dc1('0x7'));var sox=require(_0x8dc1('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x8dc1('0x9'));var squel=require(_0x8dc1('0xa'));var crypto=require(_0x8dc1('0xb'));var jsforce=require(_0x8dc1('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8dc1('0xd'));var Papa=require('papaparse');var Redis=require(_0x8dc1('0xe'));var authService=require(_0x8dc1('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x8dc1('0x10'));var hardwareService=require(_0x8dc1('0x11'));var logger=require('../../config/logger')(_0x8dc1('0x12'));var utils=require(_0x8dc1('0x13'));var config=require('../../config/environment');var db=require(_0x8dc1('0x14'))['db'];function respondWithStatusCode(_0x251ecc,_0x4dfd0a){_0x4dfd0a=_0x4dfd0a||0xcc;return function(_0x4b6f6b){if(_0x4b6f6b){return _0x251ecc['sendStatus'](_0x4dfd0a);}return _0x251ecc[_0x8dc1('0x15')](_0x4dfd0a)[_0x8dc1('0x16')]();};}function respondWithResult(_0x42ef43,_0x5869ab){_0x5869ab=_0x5869ab||0xc8;return function(_0x1b6f61){if(_0x1b6f61){return _0x42ef43[_0x8dc1('0x15')](_0x5869ab)[_0x8dc1('0x17')](_0x1b6f61);}};}function respondWithFilteredResult(_0x1cccff,_0x2282af){return function(_0x3c133c){if(_0x3c133c){var _0xecf82a=_0x3c133c[_0x8dc1('0x18')],_0x5203d6=_0x2282af[_0x8dc1('0x19')],_0x138a66=_0x2282af[_0x8dc1('0x19')]+_0x2282af[_0x8dc1('0x1a')],_0x39aa27;if(_0x138a66>=_0xecf82a){_0x138a66=_0xecf82a;_0x39aa27=0xc8;}else{_0x39aa27=0xce;}_0x1cccff[_0x8dc1('0x15')](_0x39aa27);return _0x1cccff[_0x8dc1('0x1b')](_0x8dc1('0x1c'),_0x5203d6+'-'+_0x138a66+'/'+_0xecf82a)['json'](_0x3c133c);}return null;};}function patchUpdates(_0x5e2f41){return function(_0x50ed13){try{jsonpatch[_0x8dc1('0x1d')](_0x50ed13,_0x5e2f41,!![]);}catch(_0x31f25e){return BPromise[_0x8dc1('0x1e')](_0x31f25e);}return _0x50ed13[_0x8dc1('0x1f')]();};}function saveUpdates(_0x54d1d2,_0x3f5201){return function(_0x1a566f){if(_0x1a566f){return _0x1a566f[_0x8dc1('0x20')](_0x54d1d2)[_0x8dc1('0x21')](function(_0x200615){return _0x200615;});}return null;};}function removeEntity(_0x4fe6d0,_0x339cb0){return function(_0x182488){if(_0x182488){return _0x182488[_0x8dc1('0x22')]()[_0x8dc1('0x21')](function(){_0x4fe6d0[_0x8dc1('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2316f2,_0x4a1d4c){return function(_0x5eee84){if(!_0x5eee84){_0x2316f2['sendStatus'](0x194);}return _0x5eee84;};}function handleError(_0x5ab505,_0xd77e38){_0xd77e38=_0xd77e38||0x1f4;return function(_0x58fdb3){logger[_0x8dc1('0x23')](_0x58fdb3[_0x8dc1('0x24')]);if(_0x58fdb3[_0x8dc1('0x25')]){delete _0x58fdb3['name'];}_0x5ab505[_0x8dc1('0x15')](_0xd77e38)['send'](_0x58fdb3);};}exports[_0x8dc1('0x26')]=function(_0x1a576d,_0x10bc2b){var _0x1c60a1={},_0x119404={},_0x4a4fa9={'count':0x0,'rows':[]};var _0x20ec73=_[_0x8dc1('0x27')](db[_0x8dc1('0x28')][_0x8dc1('0x29')],function(_0x2dcf02){return{'name':_0x2dcf02[_0x8dc1('0x2a')],'type':_0x2dcf02[_0x8dc1('0x2b')][_0x8dc1('0x2c')]};});_0x119404[_0x8dc1('0x2d')]=_[_0x8dc1('0x27')](_0x20ec73,_0x8dc1('0x25'));_0x119404[_0x8dc1('0x2e')]=_['keys'](_0x1a576d[_0x8dc1('0x2e')]);_0x119404[_0x8dc1('0x2f')]=_['intersection'](_0x119404['model'],_0x119404[_0x8dc1('0x2e')]);_0x1c60a1[_0x8dc1('0x30')]=_[_0x8dc1('0x31')](_0x119404[_0x8dc1('0x2d')],qs[_0x8dc1('0x32')](_0x1a576d[_0x8dc1('0x2e')][_0x8dc1('0x32')]));_0x1c60a1[_0x8dc1('0x30')]=_0x1c60a1[_0x8dc1('0x30')]['length']?_0x1c60a1[_0x8dc1('0x30')]:_0x119404[_0x8dc1('0x2d')];if(!_0x1a576d[_0x8dc1('0x2e')][_0x8dc1('0x33')](_0x8dc1('0x34'))){_0x1c60a1[_0x8dc1('0x1a')]=qs[_0x8dc1('0x1a')](_0x1a576d['query'][_0x8dc1('0x1a')]);_0x1c60a1[_0x8dc1('0x19')]=qs[_0x8dc1('0x19')](_0x1a576d['query'][_0x8dc1('0x19')]);}_0x1c60a1['order']=qs['sort'](_0x1a576d[_0x8dc1('0x2e')][_0x8dc1('0x35')]);_0x1c60a1['where']=qs['filters'](_['pick'](_0x1a576d['query'],_0x119404[_0x8dc1('0x2f')]));if(_0x1a576d[_0x8dc1('0x2e')]['filter']){_0x1c60a1[_0x8dc1('0x36')]=_[_0x8dc1('0x37')](_0x1c60a1['where'],{'$or':_['map'](_0x20ec73,function(_0xc51ee5){if(_0xc51ee5[_0x8dc1('0x2b')]!==_0x8dc1('0x38')){var _0x266c43={};_0x266c43[_0xc51ee5[_0x8dc1('0x25')]]={'$like':'%'+_0x1a576d[_0x8dc1('0x2e')][_0x8dc1('0x39')]+'%'};return _0x266c43;}})});}_0x1c60a1=_[_0x8dc1('0x37')]({},_0x1c60a1,_0x1a576d['options']);var _0x4b3f79={'where':_0x1c60a1['where']};return db[_0x8dc1('0x28')][_0x8dc1('0x18')](_0x4b3f79)[_0x8dc1('0x21')](function(_0x260c47){_0x4a4fa9['count']=_0x260c47;if(_0x1a576d['query'][_0x8dc1('0x3a')]){_0x1c60a1[_0x8dc1('0x3b')]=[{'all':!![]}];}return db[_0x8dc1('0x28')]['findAll'](_0x1c60a1);})[_0x8dc1('0x21')](function(_0x40b61a){_0x4a4fa9['rows']=_0x40b61a;return _0x4a4fa9;})['then'](respondWithFilteredResult(_0x10bc2b,_0x1c60a1))['catch'](handleError(_0x10bc2b,null));};exports['show']=function(_0x83e8d9,_0x1d637b){var _0x4c5c8c={'raw':!![],'where':{'id':_0x83e8d9[_0x8dc1('0x3c')]['id']}},_0x39aca6={};_0x39aca6[_0x8dc1('0x2d')]=_[_0x8dc1('0x3d')](db[_0x8dc1('0x28')][_0x8dc1('0x29')]);_0x39aca6[_0x8dc1('0x2e')]=_[_0x8dc1('0x3d')](_0x83e8d9['query']);_0x39aca6[_0x8dc1('0x2f')]=_['intersection'](_0x39aca6[_0x8dc1('0x2d')],_0x39aca6[_0x8dc1('0x2e')]);_0x4c5c8c[_0x8dc1('0x30')]=_[_0x8dc1('0x31')](_0x39aca6['model'],qs[_0x8dc1('0x32')](_0x83e8d9[_0x8dc1('0x2e')][_0x8dc1('0x32')]));_0x4c5c8c[_0x8dc1('0x30')]=_0x4c5c8c['attributes'][_0x8dc1('0x3e')]?_0x4c5c8c[_0x8dc1('0x30')]:_0x39aca6[_0x8dc1('0x2d')];if(_0x83e8d9['query'][_0x8dc1('0x3a')]){_0x4c5c8c['include']=[{'all':!![]}];}_0x4c5c8c=_['merge']({},_0x4c5c8c,_0x83e8d9[_0x8dc1('0x3f')]);return db[_0x8dc1('0x28')][_0x8dc1('0x40')](_0x4c5c8c)[_0x8dc1('0x21')](handleEntityNotFound(_0x1d637b,null))['then'](respondWithResult(_0x1d637b,null))[_0x8dc1('0x41')](handleError(_0x1d637b,null));};exports[_0x8dc1('0x42')]=function(_0x3ad2e6,_0x2e6dad){return db[_0x8dc1('0x28')][_0x8dc1('0x42')](_0x3ad2e6['body'],{})[_0x8dc1('0x21')](respondWithResult(_0x2e6dad,0xc9))['catch'](handleError(_0x2e6dad,null));};exports['update']=function(_0x3fed77,_0x1c94c2){if(_0x3fed77[_0x8dc1('0x43')]['id']){delete _0x3fed77[_0x8dc1('0x43')]['id'];}return db[_0x8dc1('0x28')][_0x8dc1('0x40')]({'where':{'id':_0x3fed77[_0x8dc1('0x3c')]['id']}})[_0x8dc1('0x21')](handleEntityNotFound(_0x1c94c2,null))[_0x8dc1('0x21')](saveUpdates(_0x3fed77[_0x8dc1('0x43')],null))[_0x8dc1('0x21')](respondWithResult(_0x1c94c2,null))[_0x8dc1('0x41')](handleError(_0x1c94c2,null));};exports['destroy']=function(_0x5271e,_0x52c64c){return db['VoiceQueuesLog'][_0x8dc1('0x40')]({'where':{'id':_0x5271e[_0x8dc1('0x3c')]['id']}})[_0x8dc1('0x21')](handleEntityNotFound(_0x52c64c,null))[_0x8dc1('0x21')](removeEntity(_0x52c64c,null))[_0x8dc1('0x41')](handleError(_0x52c64c,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 07ac022..19c5871 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 _0x562e=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','voice_queues_log','event_dtm','dtm','lodash','util','api'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x562e,0x1af));var _0xe562=function(_0x1be93c,_0x5ba741){_0x1be93c=_0x1be93c-0x0;var _0xf1abe0=_0x562e[_0x1be93c];return _0xf1abe0;};'use strict';var _=require(_0xe562('0x0'));var util=require(_0xe562('0x1'));var logger=require('../../config/logger')(_0xe562('0x2'));var moment=require(_0xe562('0x3'));var BPromise=require(_0xe562('0x4'));var rp=require(_0xe562('0x5'));var fs=require('fs');var path=require(_0xe562('0x6'));var rimraf=require(_0xe562('0x7'));var config=require(_0xe562('0x8'));var attributes=require(_0xe562('0x9'));module[_0xe562('0xa')]=function(_0x276719,_0x4520ef){return _0x276719['define']('VoiceQueuesLog',attributes,{'tableName':_0xe562('0xb'),'paranoid':![],'indexes':[{'name':_0xe562('0xc'),'fields':['event',_0xe562('0xd')]}],'timestamps':![]});}; \ No newline at end of file +var _0x6524=['bluebird','path','rimraf','../../config/environment','exports','define','VoiceQueuesLog','voice_queues_log','event_dtm','event','lodash','util','../../config/logger','api'];(function(_0x5d7740,_0x383e86){var _0x1223e7=function(_0x51baf3){while(--_0x51baf3){_0x5d7740['push'](_0x5d7740['shift']());}};_0x1223e7(++_0x383e86);}(_0x6524,0x96));var _0x4652=function(_0xdfa64,_0x2bad52){_0xdfa64=_0xdfa64-0x0;var _0x37433b=_0x6524[_0xdfa64];return _0x37433b;};'use strict';var _=require(_0x4652('0x0'));var util=require(_0x4652('0x1'));var logger=require(_0x4652('0x2'))(_0x4652('0x3'));var moment=require('moment');var BPromise=require(_0x4652('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4652('0x5'));var rimraf=require(_0x4652('0x6'));var config=require(_0x4652('0x7'));var attributes=require('./voiceQueuesLog.attributes');module[_0x4652('0x8')]=function(_0x116cac,_0x3fdce){return _0x116cac[_0x4652('0x9')](_0x4652('0xa'),attributes,{'tableName':_0x4652('0xb'),'paranoid':![],'indexes':[{'name':_0x4652('0xc'),'fields':[_0x4652('0xd'),'dtm']}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 6580002..a660f1b 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 _0xac4a=['VoiceQueuesLog,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','then','info','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xac4a,0x13f));var _0xaac4=function(_0x314730,_0x5f5585){_0x314730=_0x314730-0x0;var _0x3f9c60=_0xac4a[_0x314730];return _0x3f9c60;};'use strict';var _=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var moment=require(_0xaac4('0x2'));var BPromise=require(_0xaac4('0x3'));var rs=require(_0xaac4('0x4'));var fs=require('fs');var Redis=require(_0xaac4('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xaac4('0x6'))(_0xaac4('0x7'));var config=require(_0xaac4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xaac4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cdfc5,_0x5870e8,_0x1e4283){return new BPromise(function(_0x27354c,_0x567295){return client['request'](_0x1cdfc5,_0x1e4283)[_0xaac4('0xa')](function(_0x50d114){logger[_0xaac4('0xb')]('VoiceQueuesLog,\x20%s,\x20%s',_0x5870e8,'request\x20sent');logger[_0xaac4('0xc')](_0xaac4('0xd'),_0x5870e8,_0xaac4('0xe'),JSON[_0xaac4('0xf')](_0x50d114));if(_0x50d114[_0xaac4('0x10')]){if(_0x50d114['error']['code']===0x1f4){logger[_0xaac4('0x10')](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')]['message']);return _0x567295(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}logger['error'](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);return _0x27354c(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}else{logger[_0xaac4('0xb')](_0xaac4('0x11'),_0x5870e8,_0xaac4('0xe'));_0x27354c(_0x50d114[_0xaac4('0x13')][_0xaac4('0x12')]);}})[_0xaac4('0x14')](function(_0x1766c2){logger[_0xaac4('0x10')]('VoiceQueuesLog,\x20%s,\x20%s',_0x5870e8,_0x1766c2);_0x567295(_0x1766c2);});});} \ No newline at end of file +var _0xe493=['../../config/utils','rpc','jayson/promise','client','http','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x215d8d,_0x171971){var _0x499bfe=function(_0x3eaa98){while(--_0x3eaa98){_0x215d8d['push'](_0x215d8d['shift']());}};_0x499bfe(++_0x171971);}(_0xe493,0x7e));var _0x3e49=function(_0x13a903,_0x5139e8){_0x13a903=_0x13a903-0x0;var _0x59f6dc=_0xe493[_0x13a903];return _0x59f6dc;};'use strict';var _=require(_0x3e49('0x0'));var util=require(_0x3e49('0x1'));var moment=require(_0x3e49('0x2'));var BPromise=require(_0x3e49('0x3'));var rs=require(_0x3e49('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3e49('0x5'))['db'];var utils=require(_0x3e49('0x6'));var logger=require('../../config/logger')(_0x3e49('0x7'));var config=require('../../config/environment');var jayson=require(_0x3e49('0x8'));var client=jayson[_0x3e49('0x9')][_0x3e49('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3f7821,_0x12dd84,_0x3626b6){return new BPromise(function(_0x4e96ac,_0x56b767){return client['request'](_0x3f7821,_0x3626b6)[_0x3e49('0xb')](function(_0x8b8c0e){logger[_0x3e49('0xc')](_0x3e49('0xd'),_0x12dd84,_0x3e49('0xe'));logger[_0x3e49('0xf')](_0x3e49('0x10'),_0x12dd84,_0x3e49('0xe'),JSON[_0x3e49('0x11')](_0x8b8c0e));if(_0x8b8c0e[_0x3e49('0x12')]){if(_0x8b8c0e[_0x3e49('0x12')]['code']===0x1f4){logger[_0x3e49('0x12')](_0x3e49('0xd'),_0x12dd84,_0x8b8c0e['error'][_0x3e49('0x13')]);return _0x56b767(_0x8b8c0e[_0x3e49('0x12')]['message']);}logger[_0x3e49('0x12')](_0x3e49('0xd'),_0x12dd84,_0x8b8c0e['error'][_0x3e49('0x13')]);return _0x4e96ac(_0x8b8c0e[_0x3e49('0x12')][_0x3e49('0x13')]);}else{logger[_0x3e49('0xc')](_0x3e49('0xd'),_0x12dd84,_0x3e49('0xe'));_0x4e96ac(_0x8b8c0e[_0x3e49('0x14')][_0x3e49('0x13')]);}})[_0x3e49('0x15')](function(_0x1d9cce){logger[_0x3e49('0x12')](_0x3e49('0xd'),_0x12dd84,_0x1d9cce);_0x56b767(_0x1d9cce);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 9a28be7..a5bca78 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 _0xce97=['get','isAuthenticated','index','/describe','/:id/download','downloads','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller'];(function(_0xa42d2,_0x212a45){var _0x5db68b=function(_0x348dd8){while(--_0x348dd8){_0xa42d2['push'](_0xa42d2['shift']());}};_0x5db68b(++_0x212a45);}(_0xce97,0x131));var _0x7ce9=function(_0x4abd82,_0x209993){_0x4abd82=_0x4abd82-0x0;var _0x9c15c3=_0xce97[_0x4abd82];return _0x9c15c3;};'use strict';var multer=require(_0x7ce9('0x0'));var util=require(_0x7ce9('0x1'));var path=require(_0x7ce9('0x2'));var timeout=require(_0x7ce9('0x3'));var express=require(_0x7ce9('0x4'));var router=express[_0x7ce9('0x5')]();var auth=require(_0x7ce9('0x6'));var interaction=require(_0x7ce9('0x7'));var config=require(_0x7ce9('0x8'));var controller=require(_0x7ce9('0x9'));router[_0x7ce9('0xa')]('/',auth[_0x7ce9('0xb')](),controller[_0x7ce9('0xc')]);router[_0x7ce9('0xa')](_0x7ce9('0xd'),auth[_0x7ce9('0xb')](),controller['describe']);router[_0x7ce9('0xa')]('/:id',auth[_0x7ce9('0xb')](),controller['show']);router['get'](_0x7ce9('0xe'),auth[_0x7ce9('0xb')](),controller['download']);router['get']('/:id/downloads',controller[_0x7ce9('0xf')]);router['post']('/',auth[_0x7ce9('0xb')](),controller['create']);router['put']('/:id',auth[_0x7ce9('0xb')](),controller[_0x7ce9('0x10')]);router[_0x7ce9('0x11')](_0x7ce9('0x12'),auth[_0x7ce9('0xb')](),controller[_0x7ce9('0x13')]);module[_0x7ce9('0x14')]=router; \ No newline at end of file +var _0x27d8=['destroy','exports','util','path','express','../../components/interaction/service','./voiceRecording.controller','index','/describe','isAuthenticated','describe','get','show','download','downloads','put','/:id','update','delete'];(function(_0x50a448,_0x3d1a4d){var _0x5da8c6=function(_0x3310a6){while(--_0x3310a6){_0x50a448['push'](_0x50a448['shift']());}};_0x5da8c6(++_0x3d1a4d);}(_0x27d8,0x132));var _0x827d=function(_0x5ed54b,_0x3a2827){_0x5ed54b=_0x5ed54b-0x0;var _0x4b58c7=_0x27d8[_0x5ed54b];return _0x4b58c7;};'use strict';var multer=require('multer');var util=require(_0x827d('0x0'));var path=require(_0x827d('0x1'));var timeout=require('connect-timeout');var express=require(_0x827d('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x827d('0x3'));var config=require('../../config/environment');var controller=require(_0x827d('0x4'));router['get']('/',auth['isAuthenticated'](),controller[_0x827d('0x5')]);router['get'](_0x827d('0x6'),auth[_0x827d('0x7')](),controller[_0x827d('0x8')]);router[_0x827d('0x9')]('/:id',auth[_0x827d('0x7')](),controller[_0x827d('0xa')]);router[_0x827d('0x9')]('/:id/download',auth[_0x827d('0x7')](),controller[_0x827d('0xb')]);router[_0x827d('0x9')]('/:id/downloads',controller[_0x827d('0xc')]);router['post']('/',auth[_0x827d('0x7')](),controller['create']);router[_0x827d('0xd')](_0x827d('0xe'),auth[_0x827d('0x7')](),controller[_0x827d('0xf')]);router[_0x827d('0x10')](_0x827d('0xe'),auth[_0x827d('0x7')](),controller[_0x827d('0x11')]);module[_0x827d('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index c6231ca..a270ab4 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 _0x8e61=['path','exports','VIRTUAL','getDataValue','extname','STRING','setDataValue','channel','membername','DATE','createdAt','MM-DD-YYYY\x20HH:mm','toString','updatedAt','format','sequelize'];(function(_0x2603fc,_0x25cc88){var _0x1342bf=function(_0x48637c){while(--_0x48637c){_0x2603fc['push'](_0x2603fc['shift']());}};_0x1342bf(++_0x25cc88);}(_0x8e61,0x1ef));var _0x18e6=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0x8e61[_0x33032e];return _0x13316b;};'use strict';var Sequelize=require(_0x18e6('0x0'));var moment=require('moment');var path=require(_0x18e6('0x1'));module[_0x18e6('0x2')]={'format':{'type':Sequelize[_0x18e6('0x3')],'get':function(){return this[_0x18e6('0x4')]('value')?path[_0x18e6('0x5')](this[_0x18e6('0x4')]('value')):undefined;}},'uniqueid':{'type':Sequelize[_0x18e6('0x6')]},'channel':{'type':Sequelize[_0x18e6('0x6')],'set':function(_0x55d97b){if(_0x55d97b){this[_0x18e6('0x7')](_0x18e6('0x8'),_0x55d97b);this[_0x18e6('0x7')](_0x18e6('0x9'),_0x55d97b['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x18e6('0x6')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x18e6('0x6')]},'exten':{'type':Sequelize[_0x18e6('0x6')]},'value':{'type':Sequelize[_0x18e6('0x6')]},'type':{'type':Sequelize[_0x18e6('0x6')]},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize[_0x18e6('0x6')]},'userDisposition':{'type':Sequelize[_0x18e6('0x6')]},'createdAt':{'type':Sequelize[_0x18e6('0xa')],'get':function(){return moment(this['getDataValue'](_0x18e6('0xb')))['format'](_0x18e6('0xc'))[_0x18e6('0xd')]();}},'updatedAt':{'type':Sequelize[_0x18e6('0xa')],'get':function(){return moment(this[_0x18e6('0x4')](_0x18e6('0xe')))[_0x18e6('0xf')](_0x18e6('0xc'))['toString']();}}}; \ No newline at end of file +var _0x93e2=['createdAt','format','MM-DD-YYYY\x20HH:mm','DATE','toString','exports','getDataValue','value','extname','STRING','setDataValue','channel','split','INTEGER'];(function(_0x2ad4c9,_0x2c6e67){var _0x2e4982=function(_0x418956){while(--_0x418956){_0x2ad4c9['push'](_0x2ad4c9['shift']());}};_0x2e4982(++_0x2c6e67);}(_0x93e2,0x139));var _0x293e=function(_0x3398ff,_0x4231df){_0x3398ff=_0x3398ff-0x0;var _0x415895=_0x93e2[_0x3398ff];return _0x415895;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');var path=require('path');module[_0x293e('0x0')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x293e('0x1')](_0x293e('0x2'))?path[_0x293e('0x3')](this['getDataValue'](_0x293e('0x2'))):undefined;}},'uniqueid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x293e('0x4')],'set':function(_0xcb33e4){if(_0xcb33e4){this[_0x293e('0x5')](_0x293e('0x6'),_0xcb33e4);this[_0x293e('0x5')]('membername',_0xcb33e4[_0x293e('0x7')](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x293e('0x4')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x293e('0x4')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x293e('0x4')]},'accountcode':{'type':Sequelize[_0x293e('0x4')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x293e('0x4')]},'value':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x293e('0x4')]},'rating':{'type':Sequelize[_0x293e('0x8')],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize[_0x293e('0x4')]},'userDisposition':{'type':Sequelize[_0x293e('0x4')]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue'](_0x293e('0x9')))[_0x293e('0xa')](_0x293e('0xb'))['toString']();}},'updatedAt':{'type':Sequelize[_0x293e('0xc')],'get':function(){return moment(this['getDataValue']('updatedAt'))[_0x293e('0xa')]('MM-DD-YYYY\x20HH:mm')[_0x293e('0xd')]();}}}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.controller.js b/server/api/voiceRecording/voiceRecording.controller.js index 6b2659f..fb2fc50 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 _0x8ccd=['apply','update','then','destroy','sendStatus','error','stack','name','send','index','VoiceRecording','fieldName','type','key','model','differenceBy','map','format','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','rawAttributes','length','find','create','body','describe','download','uniqueid','value','%s.cypher','existsSync','secrets','recording','ValidationError','filename','unlink','message','VoiceRecording\x20not\x20found','Not\x20found','downloads','sequelize','col','token','$and','decryptFile','Entity\x20not\x20found','info','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','html-pdf','rimraf','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','end','status','json','count','offset','limit','set','Content-Range'];(function(_0x38cb73,_0x283829){var _0x332884=function(_0x574a09){while(--_0x574a09){_0x38cb73['push'](_0x38cb73['shift']());}};_0x332884(++_0x283829);}(_0x8ccd,0x173));var _0xd8cc=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0x8ccd[_0x1f9f37];return _0x21c080;};'use strict';var pdf=require(_0xd8cc('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xd8cc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd8cc('0x2'));var rp=require(_0xd8cc('0x3'));var moment=require('moment');var BPromise=require(_0xd8cc('0x4'));var Mustache=require(_0xd8cc('0x5'));var util=require('util');var path=require('path');var sox=require(_0xd8cc('0x6'));var csv=require(_0xd8cc('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xd8cc('0x8'));var crypto=require(_0xd8cc('0x9'));var jsforce=require(_0xd8cc('0xa'));var deskjs=require(_0xd8cc('0xb'));var toCsv=require(_0xd8cc('0x7'));var querystring=require('querystring');var Papa=require(_0xd8cc('0xc'));var Redis=require(_0xd8cc('0xd'));var authService=require(_0xd8cc('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xd8cc('0xf'));var hardwareService=require(_0xd8cc('0x10'));var logger=require(_0xd8cc('0x11'))(_0xd8cc('0x12'));var utils=require(_0xd8cc('0x13'));var config=require('../../config/environment');var db=require(_0xd8cc('0x14'))['db'];function respondWithStatusCode(_0x1b612e,_0x162217){_0x162217=_0x162217||0xcc;return function(_0x5ccd02){if(_0x5ccd02){return _0x1b612e['sendStatus'](_0x162217);}return _0x1b612e['status'](_0x162217)[_0xd8cc('0x15')]();};}function respondWithResult(_0x4c255a,_0xfd3138){_0xfd3138=_0xfd3138||0xc8;return function(_0x5d9805){if(_0x5d9805){return _0x4c255a[_0xd8cc('0x16')](_0xfd3138)[_0xd8cc('0x17')](_0x5d9805);}};}function respondWithFilteredResult(_0x2ffbb6,_0x57f15d){return function(_0x1e43aa){if(_0x1e43aa){var _0x3601f5=_0x1e43aa[_0xd8cc('0x18')],_0x18b508=_0x57f15d[_0xd8cc('0x19')],_0x5b0185=_0x57f15d[_0xd8cc('0x19')]+_0x57f15d[_0xd8cc('0x1a')],_0x27d099;if(_0x5b0185>=_0x3601f5){_0x5b0185=_0x3601f5;_0x27d099=0xc8;}else{_0x27d099=0xce;}_0x2ffbb6[_0xd8cc('0x16')](_0x27d099);return _0x2ffbb6[_0xd8cc('0x1b')](_0xd8cc('0x1c'),_0x18b508+'-'+_0x5b0185+'/'+_0x3601f5)[_0xd8cc('0x17')](_0x1e43aa);}return null;};}function patchUpdates(_0x3e0638){return function(_0x158f54){try{jsonpatch[_0xd8cc('0x1d')](_0x158f54,_0x3e0638,!![]);}catch(_0x5238c9){return BPromise['reject'](_0x5238c9);}return _0x158f54['save']();};}function saveUpdates(_0x53c4a9,_0x524387){return function(_0x28cb55){if(_0x28cb55){return _0x28cb55[_0xd8cc('0x1e')](_0x53c4a9)[_0xd8cc('0x1f')](function(_0x496d92){return _0x496d92;});}return null;};}function removeEntity(_0x140e10,_0x20b5f1){return function(_0x621404){if(_0x621404){return _0x621404[_0xd8cc('0x20')]()['then'](function(){_0x140e10['status'](0xcc)[_0xd8cc('0x15')]();});}};}function handleEntityNotFound(_0x3c21d5,_0x48015f){return function(_0x3d4894){if(!_0x3d4894){_0x3c21d5[_0xd8cc('0x21')](0x194);}return _0x3d4894;};}function handleError(_0x1c3f3f,_0x4b6bf9){_0x4b6bf9=_0x4b6bf9||0x1f4;return function(_0xbefcb4){logger[_0xd8cc('0x22')](_0xbefcb4[_0xd8cc('0x23')]);if(_0xbefcb4[_0xd8cc('0x24')]){delete _0xbefcb4['name'];}_0x1c3f3f[_0xd8cc('0x16')](_0x4b6bf9)[_0xd8cc('0x25')](_0xbefcb4);};}exports[_0xd8cc('0x26')]=function(_0x4b3f54,_0x26191e){var _0x540923={},_0x3d8fb9={},_0x5c0eed={'count':0x0,'rows':[]};var _0x18f8b8=_['map'](db[_0xd8cc('0x27')]['rawAttributes'],function(_0x99c16e){return{'name':_0x99c16e[_0xd8cc('0x28')],'type':_0x99c16e[_0xd8cc('0x29')][_0xd8cc('0x2a')]};});_0x3d8fb9[_0xd8cc('0x2b')]=_[_0xd8cc('0x2c')](_[_0xd8cc('0x2d')](_0x18f8b8,_0xd8cc('0x24')),[_0xd8cc('0x2e')]);_0x3d8fb9['query']=_[_0xd8cc('0x2f')](_0x4b3f54[_0xd8cc('0x30')]);_0x3d8fb9[_0xd8cc('0x31')]=_[_0xd8cc('0x32')](_0x3d8fb9['model'],_0x3d8fb9['query']);_0x540923[_0xd8cc('0x33')]=_[_0xd8cc('0x32')](_0x3d8fb9['model'],qs[_0xd8cc('0x34')](_0x4b3f54[_0xd8cc('0x30')][_0xd8cc('0x34')]));_0x540923[_0xd8cc('0x33')]=_0x540923[_0xd8cc('0x33')]['length']?_0x540923['attributes']:_0x3d8fb9['model'];if(!_0x4b3f54['query'][_0xd8cc('0x35')](_0xd8cc('0x36'))){_0x540923['limit']=qs[_0xd8cc('0x1a')](_0x4b3f54[_0xd8cc('0x30')][_0xd8cc('0x1a')]);_0x540923[_0xd8cc('0x19')]=qs[_0xd8cc('0x19')](_0x4b3f54[_0xd8cc('0x30')][_0xd8cc('0x19')]);}_0x540923[_0xd8cc('0x37')]=qs['sort'](_0x4b3f54[_0xd8cc('0x30')][_0xd8cc('0x38')]);_0x540923[_0xd8cc('0x39')]=qs[_0xd8cc('0x31')](_[_0xd8cc('0x3a')](_0x4b3f54[_0xd8cc('0x30')],_0x3d8fb9[_0xd8cc('0x31')]));if(_0x4b3f54['query'][_0xd8cc('0x3b')]){_0x540923['where']=_[_0xd8cc('0x3c')](_0x540923['where'],{'$or':_[_0xd8cc('0x2d')](_0x18f8b8,function(_0x4e956b){if(_0x4e956b['type']!==_0xd8cc('0x3d')){var _0x6d888c={};_0x6d888c[_0x4e956b[_0xd8cc('0x24')]]={'$like':'%'+_0x4b3f54[_0xd8cc('0x30')]['filter']+'%'};return _0x6d888c;}})});}_0x540923=_[_0xd8cc('0x3c')]({},_0x540923,_0x4b3f54[_0xd8cc('0x3e')]);var _0x1371cc={'where':_0x540923[_0xd8cc('0x39')]};return db[_0xd8cc('0x27')][_0xd8cc('0x18')](_0x1371cc)['then'](function(_0x1bb579){_0x5c0eed['count']=_0x1bb579;if(_0x4b3f54[_0xd8cc('0x30')][_0xd8cc('0x3f')]){_0x540923['include']=[{'all':!![]}];}return db[_0xd8cc('0x27')][_0xd8cc('0x40')](_0x540923);})[_0xd8cc('0x1f')](function(_0x5b1d8c){_0x5c0eed[_0xd8cc('0x41')]=_0x5b1d8c;return _0x5c0eed;})['then'](respondWithFilteredResult(_0x26191e,_0x540923))[_0xd8cc('0x42')](handleError(_0x26191e,null));};exports[_0xd8cc('0x43')]=function(_0x3a7d16,_0x1636ca){var _0x2942ef={'raw':![],'where':{'id':_0x3a7d16[_0xd8cc('0x44')]['id']}},_0x5e5a03={};_0x5e5a03['model']=_[_0xd8cc('0x2f')](db[_0xd8cc('0x27')][_0xd8cc('0x45')]);_0x5e5a03[_0xd8cc('0x30')]=_['keys'](_0x3a7d16['query']);_0x5e5a03['filters']=_[_0xd8cc('0x32')](_0x5e5a03['model'],_0x5e5a03['query']);_0x2942ef[_0xd8cc('0x33')]=_[_0xd8cc('0x32')](_0x5e5a03['model'],qs[_0xd8cc('0x34')](_0x3a7d16[_0xd8cc('0x30')]['fields']));_0x2942ef[_0xd8cc('0x33')]=_0x2942ef[_0xd8cc('0x33')][_0xd8cc('0x46')]?_0x2942ef[_0xd8cc('0x33')]:_0x5e5a03[_0xd8cc('0x2b')];if(_0x3a7d16['query'][_0xd8cc('0x3f')]){_0x2942ef['include']=[{'all':!![]}];}_0x2942ef=_['merge']({},_0x2942ef,_0x3a7d16[_0xd8cc('0x3e')]);return db['VoiceRecording'][_0xd8cc('0x47')](_0x2942ef)[_0xd8cc('0x1f')](handleEntityNotFound(_0x1636ca,null))[_0xd8cc('0x1f')](respondWithResult(_0x1636ca,null))['catch'](handleError(_0x1636ca,null));};exports[_0xd8cc('0x48')]=function(_0x1086df,_0x66ecce){return db[_0xd8cc('0x27')][_0xd8cc('0x48')](_0x1086df[_0xd8cc('0x49')],{})[_0xd8cc('0x1f')](respondWithResult(_0x66ecce,0xc9))[_0xd8cc('0x42')](handleError(_0x66ecce,null));};exports[_0xd8cc('0x1e')]=function(_0x4d7d7b,_0x34f421){if(_0x4d7d7b[_0xd8cc('0x49')]['id']){delete _0x4d7d7b[_0xd8cc('0x49')]['id'];}return db[_0xd8cc('0x27')][_0xd8cc('0x47')]({'where':{'id':_0x4d7d7b['params']['id']}})[_0xd8cc('0x1f')](handleEntityNotFound(_0x34f421,null))['then'](saveUpdates(_0x4d7d7b[_0xd8cc('0x49')],null))[_0xd8cc('0x1f')](respondWithResult(_0x34f421,null))['catch'](handleError(_0x34f421,null));};exports[_0xd8cc('0x4a')]=function(_0x138bf3,_0x2ad1ea){return db[_0xd8cc('0x27')][_0xd8cc('0x4a')]()['then'](respondWithResult(_0x2ad1ea,null))['catch'](handleError(_0x2ad1ea,null));};exports[_0xd8cc('0x4b')]=function(_0x18d1e1,_0xf3b8b7,_0x1bd450){var _0xb4541a=require('../../components/encryptor');var _0x3227cf=![];var _0x1aa165={};if(_0x18d1e1['query'][_0xd8cc('0x29')]&&_0x18d1e1[_0xd8cc('0x30')]['type']===_0xd8cc('0x4c')){_0x1aa165['uniqueid']=_0x18d1e1[_0xd8cc('0x44')]['id'];}else{_0x1aa165['id']=_0x18d1e1[_0xd8cc('0x44')]['id'];}return db['VoiceRecording'][_0xd8cc('0x47')]({'where':_0x1aa165,'attributes':['id',_0xd8cc('0x4d')],'raw':!![]})[_0xd8cc('0x1f')](handleEntityNotFound(_0xf3b8b7,null))[_0xd8cc('0x1f')](function(_0x2e94e1){if(_0x2e94e1){var _0x5d221e=_0x2e94e1[_0xd8cc('0x4d')];var _0x143ad0=util[_0xd8cc('0x2e')](_0xd8cc('0x4e'),_0x5d221e);if(fs[_0xd8cc('0x4f')](_0x143ad0)){_0x3227cf=!![];return _0xb4541a['decryptFile'](_0x143ad0,_0x5d221e,config[_0xd8cc('0x50')][_0xd8cc('0x51')])[_0xd8cc('0x1f')](function(){return _0x2e94e1;});}return _0x2e94e1;}})['then'](function(_0x2f42ac){if(_0x2f42ac){var _0x33c476=_0x2f42ac[_0xd8cc('0x4d')];if(!fs[_0xd8cc('0x4f')](_0x33c476)){throw new db['Sequelize'][(_0xd8cc('0x52'))]('VoiceRecording\x20not\x20found');}if(_0x2f42ac[_0xd8cc('0x53')]){return _0xf3b8b7[_0xd8cc('0x4b')](_0x33c476,_0x2f42ac['filename']+path['extname'](_0x33c476),function(){if(_0x3227cf){fs[_0xd8cc('0x54')](_0x33c476);}});}else{return _0xf3b8b7[_0xd8cc('0x4b')](_0x33c476,function(_0x3db546){if(_0x3227cf){fs[_0xd8cc('0x54')](_0x33c476);}});}}})[_0xd8cc('0x42')](function(_0x152181){if(_0x152181[_0xd8cc('0x55')]===_0xd8cc('0x56')){_0xf3b8b7['status'](0x194)[_0xd8cc('0x25')](_0xd8cc('0x57'));}else{return handleError(_0xf3b8b7,null);}});};exports[_0xd8cc('0x58')]=function(_0x2b3a1d,_0x290842,_0x430de3){var _0x1918c5=require('../../components/encryptor');var _0x3d3467=![];var _0x2d9b83={'$and':[db[_0xd8cc('0x59')][_0xd8cc('0x39')](db[_0xd8cc('0x59')]['fn']('MD5',db[_0xd8cc('0x59')][_0xd8cc('0x5a')](_0xd8cc('0x4c'))),_0x2b3a1d['query'][_0xd8cc('0x5b')])]};if(_0x2b3a1d[_0xd8cc('0x30')][_0xd8cc('0x29')]&&_0x2b3a1d[_0xd8cc('0x30')]['type']===_0xd8cc('0x4c')){_0x2d9b83[_0xd8cc('0x5c')]['push']({'uniqueid':_0x2b3a1d[_0xd8cc('0x44')]['id']});}else{_0x2d9b83[_0xd8cc('0x5c')]['push']({'id':_0x2b3a1d[_0xd8cc('0x44')]['id']});}return db[_0xd8cc('0x27')][_0xd8cc('0x47')]({'where':_0x2d9b83,'attributes':['id',_0xd8cc('0x4d')],'raw':!![]})[_0xd8cc('0x1f')](handleEntityNotFound(_0x290842,null))['then'](function(_0x475ff2){if(_0x475ff2){var _0x3ca811=util[_0xd8cc('0x2e')](_0xd8cc('0x4e'),_0x475ff2[_0xd8cc('0x4d')]);if(fs[_0xd8cc('0x4f')](_0x3ca811)){_0x3d3467=!![];return _0x1918c5[_0xd8cc('0x5d')](_0x3ca811,_0x475ff2[_0xd8cc('0x4d')],config[_0xd8cc('0x50')][_0xd8cc('0x51')])[_0xd8cc('0x1f')](function(){return _0x475ff2;});}return _0x475ff2;}})[_0xd8cc('0x1f')](function(_0x1401c5){if(_0x1401c5){if(!fs[_0xd8cc('0x4f')](_0x1401c5[_0xd8cc('0x4d')])){throw new db['Sequelize']['ValidationError'](_0xd8cc('0x56'));}if(_0x1401c5[_0xd8cc('0x53')]){return _0x290842['download'](_0x1401c5[_0xd8cc('0x4d')],_0x1401c5[_0xd8cc('0x53')]+path['extname'](_0x1401c5[_0xd8cc('0x4d')]),function(){if(_0x3d3467){fs['unlink'](_0x1401c5[_0xd8cc('0x4d')]);}});}else{return _0x290842[_0xd8cc('0x4b')](_0x1401c5['value'],function(_0x1b27fe){if(_0x3d3467){fs['unlink'](_0x1401c5[_0xd8cc('0x4d')]);}});}}})[_0xd8cc('0x42')](handleError(_0x290842,null));};exports['destroy']=function(_0x2c3da1,_0x12c4b9){return db['VoiceRecording']['find']({'where':{'id':_0x2c3da1['params']['id']}})[_0xd8cc('0x1f')](function(_0x3b228c){if(!_0x3b228c)throw new ReferenceError(_0xd8cc('0x5e'));return _0x3b228c;})[_0xd8cc('0x1f')](function(_0xbb79fe){var _0x5d9f57=_0xbb79fe[_0xd8cc('0x4d')];logger[_0xd8cc('0x5f')]('cancellazione\x20fisica\x20documento\x20%s',_0x5d9f57);if(!_['isNil'](_0xbb79fe[_0xd8cc('0x4d')])&&fs[_0xd8cc('0x4f')](_0x5d9f57)){logger[_0xd8cc('0x5f')]('File:\x20\x22'+_0x5d9f57+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x5d9f57);}_0x5d9f57=_0x5d9f57+'.cypher';if(!_[_0xd8cc('0x60')](_0xbb79fe['value'])&&fs[_0xd8cc('0x4f')](_0x5d9f57)){logger[_0xd8cc('0x5f')](_0xd8cc('0x61')+_0x5d9f57+_0xd8cc('0x62'));fs[_0xd8cc('0x63')](_0x5d9f57);}return _0xbb79fe;})[_0xd8cc('0x1f')](function(_0x47ae02){if(!_0x47ae02)throw new InternalError();return _0x47ae02['destroy']();})['then'](function(){_0x12c4b9['status'](0xcc)[_0xd8cc('0x15')]();})[_0xd8cc('0x42')](handleError(_0x12c4b9,null));}; \ No newline at end of file +var _0x431c=['info','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','File:\x20\x22','unlinkSync','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','save','update','destroy','then','stack','name','send','map','rawAttributes','fieldName','type','key','model','differenceBy','query','keys','intersection','attributes','fields','nolimit','limit','order','sort','pick','filter','where','options','VoiceRecording','includeAll','findAll','catch','show','params','filters','length','include','merge','find','create','body','describe','download','../../components/encryptor','uniqueid','value','format','existsSync','secrets','recording','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','downloads','sequelize','MD5','col','token','$and','push','decryptFile','Sequelize','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','isNil'];(function(_0x4700fa,_0x36e5df){var _0x2a872f=function(_0x580455){while(--_0x580455){_0x4700fa['push'](_0x4700fa['shift']());}};_0x2a872f(++_0x36e5df);}(_0x431c,0xd5));var _0xc431=function(_0x3a86fd,_0x2437d7){_0x3a86fd=_0x3a86fd-0x0;var _0x1fd2c9=_0x431c[_0x3a86fd];return _0x1fd2c9;};'use strict';var pdf=require(_0xc431('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xc431('0x1'));var zipdir=require(_0xc431('0x2'));var jsonpatch=require(_0xc431('0x3'));var rp=require(_0xc431('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc431('0x5'));var util=require(_0xc431('0x6'));var path=require(_0xc431('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc431('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xc431('0x9'));var crypto=require(_0xc431('0xa'));var jsforce=require(_0xc431('0xb'));var deskjs=require(_0xc431('0xc'));var toCsv=require(_0xc431('0xd'));var querystring=require(_0xc431('0xe'));var Papa=require(_0xc431('0xf'));var Redis=require('ioredis');var authService=require(_0xc431('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc431('0x11'));var logger=require(_0xc431('0x12'))(_0xc431('0x13'));var utils=require(_0xc431('0x14'));var config=require(_0xc431('0x15'));var db=require(_0xc431('0x16'))['db'];function respondWithStatusCode(_0x52b1de,_0x4e2cfd){_0x4e2cfd=_0x4e2cfd||0xcc;return function(_0x537fec){if(_0x537fec){return _0x52b1de[_0xc431('0x17')](_0x4e2cfd);}return _0x52b1de[_0xc431('0x18')](_0x4e2cfd)[_0xc431('0x19')]();};}function respondWithResult(_0x536ee4,_0x4f727a){_0x4f727a=_0x4f727a||0xc8;return function(_0x10580a){if(_0x10580a){return _0x536ee4[_0xc431('0x18')](_0x4f727a)[_0xc431('0x1a')](_0x10580a);}};}function respondWithFilteredResult(_0x3fda9a,_0x56ee91){return function(_0x2698fe){if(_0x2698fe){var _0x16ae63=_0x2698fe[_0xc431('0x1b')],_0x4c26ce=_0x56ee91['offset'],_0x523f98=_0x56ee91[_0xc431('0x1c')]+_0x56ee91['limit'],_0x37b8a5;if(_0x523f98>=_0x16ae63){_0x523f98=_0x16ae63;_0x37b8a5=0xc8;}else{_0x37b8a5=0xce;}_0x3fda9a[_0xc431('0x18')](_0x37b8a5);return _0x3fda9a[_0xc431('0x1d')](_0xc431('0x1e'),_0x4c26ce+'-'+_0x523f98+'/'+_0x16ae63)['json'](_0x2698fe);}return null;};}function patchUpdates(_0x236aff){return function(_0x44d5f2){try{jsonpatch['apply'](_0x44d5f2,_0x236aff,!![]);}catch(_0x3ac13e){return BPromise['reject'](_0x3ac13e);}return _0x44d5f2[_0xc431('0x1f')]();};}function saveUpdates(_0x4858b6,_0x370b00){return function(_0x27025e){if(_0x27025e){return _0x27025e[_0xc431('0x20')](_0x4858b6)['then'](function(_0xbf68b9){return _0xbf68b9;});}return null;};}function removeEntity(_0x571f0a,_0x459b21){return function(_0x4ac216){if(_0x4ac216){return _0x4ac216[_0xc431('0x21')]()[_0xc431('0x22')](function(){_0x571f0a[_0xc431('0x18')](0xcc)[_0xc431('0x19')]();});}};}function handleEntityNotFound(_0x585d1c,_0x6a5dad){return function(_0x239d63){if(!_0x239d63){_0x585d1c[_0xc431('0x17')](0x194);}return _0x239d63;};}function handleError(_0x24b640,_0x3cea2c){_0x3cea2c=_0x3cea2c||0x1f4;return function(_0x322db8){logger['error'](_0x322db8[_0xc431('0x23')]);if(_0x322db8[_0xc431('0x24')]){delete _0x322db8[_0xc431('0x24')];}_0x24b640['status'](_0x3cea2c)[_0xc431('0x25')](_0x322db8);};}exports['index']=function(_0x3e1d0a,_0x2e7b61){var _0x3c860f={},_0x12fac5={},_0x2a72db={'count':0x0,'rows':[]};var _0x59f6c0=_[_0xc431('0x26')](db['VoiceRecording'][_0xc431('0x27')],function(_0x492f34){return{'name':_0x492f34[_0xc431('0x28')],'type':_0x492f34[_0xc431('0x29')][_0xc431('0x2a')]};});_0x12fac5[_0xc431('0x2b')]=_[_0xc431('0x2c')](_[_0xc431('0x26')](_0x59f6c0,_0xc431('0x24')),['format']);_0x12fac5[_0xc431('0x2d')]=_[_0xc431('0x2e')](_0x3e1d0a[_0xc431('0x2d')]);_0x12fac5['filters']=_[_0xc431('0x2f')](_0x12fac5[_0xc431('0x2b')],_0x12fac5[_0xc431('0x2d')]);_0x3c860f[_0xc431('0x30')]=_[_0xc431('0x2f')](_0x12fac5[_0xc431('0x2b')],qs[_0xc431('0x31')](_0x3e1d0a['query'][_0xc431('0x31')]));_0x3c860f[_0xc431('0x30')]=_0x3c860f[_0xc431('0x30')]['length']?_0x3c860f[_0xc431('0x30')]:_0x12fac5[_0xc431('0x2b')];if(!_0x3e1d0a[_0xc431('0x2d')]['hasOwnProperty'](_0xc431('0x32'))){_0x3c860f[_0xc431('0x33')]=qs[_0xc431('0x33')](_0x3e1d0a[_0xc431('0x2d')][_0xc431('0x33')]);_0x3c860f[_0xc431('0x1c')]=qs[_0xc431('0x1c')](_0x3e1d0a[_0xc431('0x2d')][_0xc431('0x1c')]);}_0x3c860f[_0xc431('0x34')]=qs[_0xc431('0x35')](_0x3e1d0a[_0xc431('0x2d')][_0xc431('0x35')]);_0x3c860f['where']=qs['filters'](_[_0xc431('0x36')](_0x3e1d0a[_0xc431('0x2d')],_0x12fac5['filters']));if(_0x3e1d0a[_0xc431('0x2d')][_0xc431('0x37')]){_0x3c860f[_0xc431('0x38')]=_['merge'](_0x3c860f[_0xc431('0x38')],{'$or':_[_0xc431('0x26')](_0x59f6c0,function(_0x1cdac9){if(_0x1cdac9[_0xc431('0x29')]!=='VIRTUAL'){var _0x106fe9={};_0x106fe9[_0x1cdac9[_0xc431('0x24')]]={'$like':'%'+_0x3e1d0a[_0xc431('0x2d')]['filter']+'%'};return _0x106fe9;}})});}_0x3c860f=_['merge']({},_0x3c860f,_0x3e1d0a[_0xc431('0x39')]);var _0x5ca6bb={'where':_0x3c860f[_0xc431('0x38')]};return db[_0xc431('0x3a')]['count'](_0x5ca6bb)[_0xc431('0x22')](function(_0x522c3d){_0x2a72db['count']=_0x522c3d;if(_0x3e1d0a[_0xc431('0x2d')][_0xc431('0x3b')]){_0x3c860f['include']=[{'all':!![]}];}return db[_0xc431('0x3a')][_0xc431('0x3c')](_0x3c860f);})[_0xc431('0x22')](function(_0x3cd7c2){_0x2a72db['rows']=_0x3cd7c2;return _0x2a72db;})[_0xc431('0x22')](respondWithFilteredResult(_0x2e7b61,_0x3c860f))[_0xc431('0x3d')](handleError(_0x2e7b61,null));};exports[_0xc431('0x3e')]=function(_0x56594a,_0x78ecdb){var _0x320f12={'raw':![],'where':{'id':_0x56594a[_0xc431('0x3f')]['id']}},_0x19aa90={};_0x19aa90[_0xc431('0x2b')]=_['keys'](db[_0xc431('0x3a')]['rawAttributes']);_0x19aa90[_0xc431('0x2d')]=_[_0xc431('0x2e')](_0x56594a[_0xc431('0x2d')]);_0x19aa90[_0xc431('0x40')]=_[_0xc431('0x2f')](_0x19aa90[_0xc431('0x2b')],_0x19aa90[_0xc431('0x2d')]);_0x320f12[_0xc431('0x30')]=_[_0xc431('0x2f')](_0x19aa90[_0xc431('0x2b')],qs[_0xc431('0x31')](_0x56594a[_0xc431('0x2d')][_0xc431('0x31')]));_0x320f12['attributes']=_0x320f12[_0xc431('0x30')][_0xc431('0x41')]?_0x320f12[_0xc431('0x30')]:_0x19aa90[_0xc431('0x2b')];if(_0x56594a[_0xc431('0x2d')][_0xc431('0x3b')]){_0x320f12[_0xc431('0x42')]=[{'all':!![]}];}_0x320f12=_[_0xc431('0x43')]({},_0x320f12,_0x56594a['options']);return db[_0xc431('0x3a')][_0xc431('0x44')](_0x320f12)['then'](handleEntityNotFound(_0x78ecdb,null))['then'](respondWithResult(_0x78ecdb,null))[_0xc431('0x3d')](handleError(_0x78ecdb,null));};exports[_0xc431('0x45')]=function(_0x4f4679,_0x58d780){return db[_0xc431('0x3a')][_0xc431('0x45')](_0x4f4679[_0xc431('0x46')],{})['then'](respondWithResult(_0x58d780,0xc9))[_0xc431('0x3d')](handleError(_0x58d780,null));};exports[_0xc431('0x20')]=function(_0x10e721,_0x303af7){if(_0x10e721['body']['id']){delete _0x10e721['body']['id'];}return db[_0xc431('0x3a')]['find']({'where':{'id':_0x10e721[_0xc431('0x3f')]['id']}})['then'](handleEntityNotFound(_0x303af7,null))['then'](saveUpdates(_0x10e721[_0xc431('0x46')],null))[_0xc431('0x22')](respondWithResult(_0x303af7,null))[_0xc431('0x3d')](handleError(_0x303af7,null));};exports[_0xc431('0x47')]=function(_0x279add,_0x325ae3){return db['VoiceRecording']['describe']()[_0xc431('0x22')](respondWithResult(_0x325ae3,null))[_0xc431('0x3d')](handleError(_0x325ae3,null));};exports[_0xc431('0x48')]=function(_0x2de87b,_0x44f5f1,_0x20ecfb){var _0x141b19=require(_0xc431('0x49'));var _0x244a9=![];var _0x52319a={};if(_0x2de87b['query'][_0xc431('0x29')]&&_0x2de87b['query'][_0xc431('0x29')]==='uniqueid'){_0x52319a[_0xc431('0x4a')]=_0x2de87b[_0xc431('0x3f')]['id'];}else{_0x52319a['id']=_0x2de87b[_0xc431('0x3f')]['id'];}return db[_0xc431('0x3a')][_0xc431('0x44')]({'where':_0x52319a,'attributes':['id',_0xc431('0x4b')],'raw':!![]})[_0xc431('0x22')](handleEntityNotFound(_0x44f5f1,null))[_0xc431('0x22')](function(_0x309e7b){if(_0x309e7b){var _0x4c1905=_0x309e7b[_0xc431('0x4b')];var _0x5c1095=util[_0xc431('0x4c')]('%s.cypher',_0x4c1905);if(fs[_0xc431('0x4d')](_0x5c1095)){_0x244a9=!![];return _0x141b19['decryptFile'](_0x5c1095,_0x4c1905,config[_0xc431('0x4e')][_0xc431('0x4f')])['then'](function(){return _0x309e7b;});}return _0x309e7b;}})['then'](function(_0x1e5385){if(_0x1e5385){var _0x8f87ab=_0x1e5385['value'];if(!fs['existsSync'](_0x8f87ab)){throw new db['Sequelize'][(_0xc431('0x50'))](_0xc431('0x51'));}if(_0x1e5385[_0xc431('0x52')]){return _0x44f5f1[_0xc431('0x48')](_0x8f87ab,_0x1e5385['filename']+path[_0xc431('0x53')](_0x8f87ab),function(){if(_0x244a9){fs[_0xc431('0x54')](_0x8f87ab);}});}else{return _0x44f5f1['download'](_0x8f87ab,function(_0x42bf57){if(_0x244a9){fs[_0xc431('0x54')](_0x8f87ab);}});}}})[_0xc431('0x3d')](function(_0x519c3a){if(_0x519c3a[_0xc431('0x55')]==='VoiceRecording\x20not\x20found'){_0x44f5f1[_0xc431('0x18')](0x194)[_0xc431('0x25')](_0xc431('0x56'));}else{return handleError(_0x44f5f1,null);}});};exports[_0xc431('0x57')]=function(_0x335656,_0x9a2705,_0x53ec48){var _0x2e49cd=require('../../components/encryptor');var _0x4da447=![];var _0x3230d3={'$and':[db[_0xc431('0x58')][_0xc431('0x38')](db['sequelize']['fn'](_0xc431('0x59'),db[_0xc431('0x58')][_0xc431('0x5a')]('uniqueid')),_0x335656['query'][_0xc431('0x5b')])]};if(_0x335656[_0xc431('0x2d')]['type']&&_0x335656[_0xc431('0x2d')][_0xc431('0x29')]==='uniqueid'){_0x3230d3[_0xc431('0x5c')][_0xc431('0x5d')]({'uniqueid':_0x335656['params']['id']});}else{_0x3230d3[_0xc431('0x5c')]['push']({'id':_0x335656[_0xc431('0x3f')]['id']});}return db['VoiceRecording'][_0xc431('0x44')]({'where':_0x3230d3,'attributes':['id',_0xc431('0x4b')],'raw':!![]})[_0xc431('0x22')](handleEntityNotFound(_0x9a2705,null))['then'](function(_0x71056c){if(_0x71056c){var _0x1dd449=util['format']('%s.cypher',_0x71056c['value']);if(fs[_0xc431('0x4d')](_0x1dd449)){_0x4da447=!![];return _0x2e49cd[_0xc431('0x5e')](_0x1dd449,_0x71056c[_0xc431('0x4b')],config[_0xc431('0x4e')][_0xc431('0x4f')])[_0xc431('0x22')](function(){return _0x71056c;});}return _0x71056c;}})[_0xc431('0x22')](function(_0x25acfe){if(_0x25acfe){if(!fs[_0xc431('0x4d')](_0x25acfe[_0xc431('0x4b')])){throw new db[(_0xc431('0x5f'))][(_0xc431('0x50'))](_0xc431('0x51'));}if(_0x25acfe[_0xc431('0x52')]){return _0x9a2705[_0xc431('0x48')](_0x25acfe[_0xc431('0x4b')],_0x25acfe[_0xc431('0x52')]+path['extname'](_0x25acfe[_0xc431('0x4b')]),function(){if(_0x4da447){fs[_0xc431('0x54')](_0x25acfe[_0xc431('0x4b')]);}});}else{return _0x9a2705[_0xc431('0x48')](_0x25acfe[_0xc431('0x4b')],function(_0x149418){if(_0x4da447){fs['unlink'](_0x25acfe[_0xc431('0x4b')]);}});}}})['catch'](handleError(_0x9a2705,null));};exports[_0xc431('0x21')]=function(_0x1f59f1,_0xb903bc){return db[_0xc431('0x3a')][_0xc431('0x44')]({'where':{'id':_0x1f59f1['params']['id']}})[_0xc431('0x22')](function(_0xef4e22){if(!_0xef4e22)throw new ReferenceError(_0xc431('0x60'));return _0xef4e22;})['then'](function(_0xb927f6){var _0x118d78=_0xb927f6['value'];logger['info'](_0xc431('0x61'),_0x118d78);if(!_[_0xc431('0x62')](_0xb927f6['value'])&&fs[_0xc431('0x4d')](_0x118d78)){logger[_0xc431('0x63')]('File:\x20\x22'+_0x118d78+_0xc431('0x64'));fs['unlinkSync'](_0x118d78);}_0x118d78=_0x118d78+_0xc431('0x65');if(!_[_0xc431('0x62')](_0xb927f6[_0xc431('0x4b')])&&fs[_0xc431('0x4d')](_0x118d78)){logger['info'](_0xc431('0x66')+_0x118d78+_0xc431('0x64'));fs[_0xc431('0x67')](_0x118d78);}return _0xb927f6;})[_0xc431('0x22')](function(_0x5ba039){if(!_0x5ba039)throw new InternalError();return _0x5ba039[_0xc431('0x21')]();})['then'](function(){_0xb903bc[_0xc431('0x18')](0xcc)['end']();})[_0xc431('0x3d')](handleError(_0xb903bc,null));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 50003ad..b90c2d0 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 _0x6686=['voice_recordings','uniqueid','lodash','../../config/logger','api','moment','path','rimraf','../../config/environment','./voiceRecording.attributes','define','VoiceRecording'];(function(_0x3f0b30,_0x159bc8){var _0x2748a5=function(_0x3b42cc){while(--_0x3b42cc){_0x3f0b30['push'](_0x3f0b30['shift']());}};_0x2748a5(++_0x159bc8);}(_0x6686,0x122));var _0x6668=function(_0x4c9d1f,_0x273d59){_0x4c9d1f=_0x4c9d1f-0x0;var _0x24fe45=_0x6686[_0x4c9d1f];return _0x24fe45;};'use strict';var _=require(_0x6668('0x0'));var util=require('util');var logger=require(_0x6668('0x1'))(_0x6668('0x2'));var moment=require(_0x6668('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6668('0x4'));var rimraf=require(_0x6668('0x5'));var config=require(_0x6668('0x6'));var attributes=require(_0x6668('0x7'));module['exports']=function(_0x348f3a,_0x431f95){return _0x348f3a[_0x6668('0x8')](_0x6668('0x9'),attributes,{'tableName':_0x6668('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x6668('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe926=['bluebird','request-promise','path','rimraf','../../config/environment','./voiceRecording.attributes','exports','define','voice_recordings','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe926,0xfa));var _0x6e92=function(_0x252328,_0x4c22f0){_0x252328=_0x252328-0x0;var _0xaa85b7=_0xe926[_0x252328];return _0xaa85b7;};'use strict';var _=require(_0x6e92('0x0'));var util=require(_0x6e92('0x1'));var logger=require(_0x6e92('0x2'))(_0x6e92('0x3'));var moment=require(_0x6e92('0x4'));var BPromise=require(_0x6e92('0x5'));var rp=require(_0x6e92('0x6'));var fs=require('fs');var path=require(_0x6e92('0x7'));var rimraf=require(_0x6e92('0x8'));var config=require(_0x6e92('0x9'));var attributes=require(_0x6e92('0xa'));module[_0x6e92('0xb')]=function(_0x2e5b19,_0x1c1a25){return _0x2e5b19[_0x6e92('0xc')]('VoiceRecording',attributes,{'tableName':_0x6e92('0xd'),'paranoid':![],'indexes':[{'name':_0x6e92('0xe'),'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 2a1feb4..67b67cf 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(_0x21b99d,_0x46fbc9){var _0x31335a=function(_0x3985a8){while(--_0x3985a8){_0x21b99d['push'](_0x21b99d['shift']());}};_0x31335a(++_0x46fbc9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa9e0[_0x5c351c];return _0x26f3b3;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}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(_0x3e779c,_0x546ea2){var _0x22ab11=function(_0x4f2b7a){while(--_0x4f2b7a){_0x3e779c['push'](_0x3e779c['shift']());}};_0x22ab11(++_0x546ea2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'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 f46f5c2..d8bdc3f 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 _0x0295=['delete','exports','multer','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','/:id','put'];(function(_0x5cdae9,_0x5e30a9){var _0x417701=function(_0x3e0142){while(--_0x3e0142){_0x5cdae9['push'](_0x5cdae9['shift']());}};_0x417701(++_0x5e30a9);}(_0x0295,0x1f0));var _0x5029=function(_0x2f52d1,_0x36e3b1){_0x2f52d1=_0x2f52d1-0x0;var _0x3f9871=_0x0295[_0x2f52d1];return _0x3f9871;};'use strict';var multer=require(_0x5029('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5029('0x1'));var express=require('express');var router=express['Router']();var auth=require(_0x5029('0x2'));var interaction=require(_0x5029('0x3'));var config=require(_0x5029('0x4'));var controller=require(_0x5029('0x5'));router[_0x5029('0x6')]('/',auth[_0x5029('0x7')](),controller[_0x5029('0x8')]);router[_0x5029('0x6')](_0x5029('0x9'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x5029('0x7')](),controller['create']);router[_0x5029('0xa')]('/:id',auth[_0x5029('0x7')](),controller['update']);router[_0x5029('0xb')](_0x5029('0x9'),auth[_0x5029('0x7')](),controller['destroy']);module[_0x5029('0xc')]=router; \ No newline at end of file +var _0x46ed=['multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports'];(function(_0x383953,_0x4251f9){var _0x571e17=function(_0x51da42){while(--_0x51da42){_0x383953['push'](_0x383953['shift']());}};_0x571e17(++_0x4251f9);}(_0x46ed,0x168));var _0xd46e=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x46ed[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0xd46e('0x0'));var util=require(_0xd46e('0x1'));var path=require('path');var timeout=require(_0xd46e('0x2'));var express=require(_0xd46e('0x3'));var router=express[_0xd46e('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xd46e('0x5'));var config=require(_0xd46e('0x6'));var controller=require('./voiceTransferReport.controller');router[_0xd46e('0x7')]('/',auth[_0xd46e('0x8')](),controller[_0xd46e('0x9')]);router[_0xd46e('0x7')](_0xd46e('0xa'),auth[_0xd46e('0x8')](),controller[_0xd46e('0xb')]);router[_0xd46e('0xc')]('/',auth[_0xd46e('0x8')](),controller[_0xd46e('0xd')]);router[_0xd46e('0xe')]('/:id',auth[_0xd46e('0x8')](),controller[_0xd46e('0xf')]);router['delete'](_0xd46e('0xa'),auth[_0xd46e('0x8')](),controller[_0xd46e('0x10')]);module[_0xd46e('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 83831ca..9fdd2bc 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 _0xff4d=['STRING','exports','ENUM','attended'];(function(_0xd446fa,_0x596d33){var _0x5561f8=function(_0x3a0dd2){while(--_0x3a0dd2){_0xd446fa['push'](_0xd446fa['shift']());}};_0x5561f8(++_0x596d33);}(_0xff4d,0xd1));var _0xdff4=function(_0x575d0,_0x45eb69){_0x575d0=_0x575d0-0x0;var _0x1a6e7b=_0xff4d[_0x575d0];return _0x1a6e7b;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0xdff4('0x0')]={'type':{'type':Sequelize[_0xdff4('0x1')]('blind',_0xdff4('0x2'))},'result':{'type':Sequelize[_0xdff4('0x3')]},'transfererchannel':{'type':Sequelize[_0xdff4('0x3')]},'transferercalleridnum':{'type':Sequelize[_0xdff4('0x3')]},'transferercalleridname':{'type':Sequelize[_0xdff4('0x3')]},'transfererconnectedlinenum':{'type':Sequelize[_0xdff4('0x3')]},'transfererconnectedlinename':{'type':Sequelize[_0xdff4('0x3')]},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize[_0xdff4('0x3')]},'transfererexten':{'type':Sequelize[_0xdff4('0x3')]},'transfererlinkedid':{'type':Sequelize[_0xdff4('0x3')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0xdff4('0x3')]},'transfereecalleridname':{'type':Sequelize[_0xdff4('0x3')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xdff4('0x3')]},'transfereeconnectedlinename':{'type':Sequelize[_0xdff4('0x3')]},'transfereeaccountcode':{'type':Sequelize[_0xdff4('0x3')]},'transfereecontext':{'type':Sequelize[_0xdff4('0x3')]},'transfereeexten':{'type':Sequelize['STRING']},'transfereelinkedid':{'type':Sequelize[_0xdff4('0x3')]},'isexternal':{'type':Sequelize[_0xdff4('0x1')]('Yes','No')},'context':{'type':Sequelize[_0xdff4('0x3')]},'extension':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8738=['attended','STRING','Yes','moment','ENUM','blind'];(function(_0x5555f8,_0x2bd7ec){var _0x39a854=function(_0x1d8867){while(--_0x1d8867){_0x5555f8['push'](_0x5555f8['shift']());}};_0x39a854(++_0x2bd7ec);}(_0x8738,0x93));var _0x8873=function(_0xfa2db,_0x46872f){_0xfa2db=_0xfa2db-0x0;var _0x4d4200=_0x8738[_0xfa2db];return _0x4d4200;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x8873('0x0'));module['exports']={'type':{'type':Sequelize[_0x8873('0x1')](_0x8873('0x2'),_0x8873('0x3'))},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0x8873('0x4')]},'transferercalleridnum':{'type':Sequelize[_0x8873('0x4')]},'transferercalleridname':{'type':Sequelize[_0x8873('0x4')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0x8873('0x4')]},'transfereraccountcode':{'type':Sequelize[_0x8873('0x4')]},'transferercontext':{'type':Sequelize[_0x8873('0x4')]},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize[_0x8873('0x4')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0x8873('0x4')]},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize[_0x8873('0x4')]},'transfereeconnectedlinename':{'type':Sequelize[_0x8873('0x4')]},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize[_0x8873('0x4')]},'transfereeexten':{'type':Sequelize[_0x8873('0x4')]},'transfereelinkedid':{'type':Sequelize[_0x8873('0x4')]},'isexternal':{'type':Sequelize[_0x8873('0x1')](_0x8873('0x5'),'No')},'context':{'type':Sequelize[_0x8873('0x4')]},'extension':{'type':Sequelize[_0x8873('0x4')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index e1ebf20..65fa93c 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 _0xbdb7=['filters','intersection','attributes','length','hasOwnProperty','order','sort','where','filter','merge','includeAll','include','findAll','rows','show','params','fields','options','find','catch','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','sendStatus','count','offset','limit','status','set','json','apply','reject','save','update','then','destroy','end','name','send','index','map','VoiceTransferReport','rawAttributes','fieldName','type','key','model','query','keys'];(function(_0x434008,_0x1c4e31){var _0x5cc937=function(_0xea5dad){while(--_0xea5dad){_0x434008['push'](_0x434008['shift']());}};_0x5cc937(++_0x1c4e31);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x340fc7,_0x12a901){_0x340fc7=_0x340fc7-0x0;var _0x586c93=_0xbdb7[_0x340fc7];return _0x586c93;};'use strict';var pdf=require(_0x7bdb('0x0'));var emlformat=require(_0x7bdb('0x1'));var rimraf=require(_0x7bdb('0x2'));var zipdir=require(_0x7bdb('0x3'));var jsonpatch=require(_0x7bdb('0x4'));var rp=require(_0x7bdb('0x5'));var moment=require(_0x7bdb('0x6'));var BPromise=require(_0x7bdb('0x7'));var Mustache=require(_0x7bdb('0x8'));var util=require('util');var path=require(_0x7bdb('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7bdb('0xa'));var fs=require('fs');var _=require(_0x7bdb('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7bdb('0xc'));var deskjs=require(_0x7bdb('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7bdb('0xe'));var Redis=require(_0x7bdb('0xf'));var authService=require(_0x7bdb('0x10'));var qs=require(_0x7bdb('0x11'));var as=require(_0x7bdb('0x12'));var hardwareService=require(_0x7bdb('0x13'));var logger=require(_0x7bdb('0x14'))(_0x7bdb('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3053d0,_0x25e3cb){_0x25e3cb=_0x25e3cb||0xcc;return function(_0x496613){if(_0x496613){return _0x3053d0[_0x7bdb('0x16')](_0x25e3cb);}return _0x3053d0['status'](_0x25e3cb)['end']();};}function respondWithResult(_0x2abca6,_0x46dd4a){_0x46dd4a=_0x46dd4a||0xc8;return function(_0x4fd91a){if(_0x4fd91a){return _0x2abca6['status'](_0x46dd4a)['json'](_0x4fd91a);}};}function respondWithFilteredResult(_0x4476ff,_0x195b2e){return function(_0xe9919f){if(_0xe9919f){var _0x25d417=_0xe9919f[_0x7bdb('0x17')],_0x31c909=_0x195b2e['offset'],_0xbde12a=_0x195b2e[_0x7bdb('0x18')]+_0x195b2e[_0x7bdb('0x19')],_0x3e96ac;if(_0xbde12a>=_0x25d417){_0xbde12a=_0x25d417;_0x3e96ac=0xc8;}else{_0x3e96ac=0xce;}_0x4476ff[_0x7bdb('0x1a')](_0x3e96ac);return _0x4476ff[_0x7bdb('0x1b')]('Content-Range',_0x31c909+'-'+_0xbde12a+'/'+_0x25d417)[_0x7bdb('0x1c')](_0xe9919f);}return null;};}function patchUpdates(_0x23e9eb){return function(_0x5b8481){try{jsonpatch[_0x7bdb('0x1d')](_0x5b8481,_0x23e9eb,!![]);}catch(_0x31f78e){return BPromise[_0x7bdb('0x1e')](_0x31f78e);}return _0x5b8481[_0x7bdb('0x1f')]();};}function saveUpdates(_0x112793,_0x5bfc35){return function(_0x49f353){if(_0x49f353){return _0x49f353[_0x7bdb('0x20')](_0x112793)[_0x7bdb('0x21')](function(_0x5daea4){return _0x5daea4;});}return null;};}function removeEntity(_0x341fe4,_0x118ea1){return function(_0x346c72){if(_0x346c72){return _0x346c72[_0x7bdb('0x22')]()[_0x7bdb('0x21')](function(){_0x341fe4['status'](0xcc)[_0x7bdb('0x23')]();});}};}function handleEntityNotFound(_0xdad53d,_0x40c447){return function(_0x3a456f){if(!_0x3a456f){_0xdad53d['sendStatus'](0x194);}return _0x3a456f;};}function handleError(_0x4d6e44,_0x3c423f){_0x3c423f=_0x3c423f||0x1f4;return function(_0x5eface){logger['error'](_0x5eface['stack']);if(_0x5eface[_0x7bdb('0x24')]){delete _0x5eface['name'];}_0x4d6e44[_0x7bdb('0x1a')](_0x3c423f)[_0x7bdb('0x25')](_0x5eface);};}exports[_0x7bdb('0x26')]=function(_0x7c09cf,_0x2a494e){var _0x523869={},_0x10e818={},_0x32242d={'count':0x0,'rows':[]};var _0x399b62=_[_0x7bdb('0x27')](db[_0x7bdb('0x28')][_0x7bdb('0x29')],function(_0x1e9996){return{'name':_0x1e9996[_0x7bdb('0x2a')],'type':_0x1e9996[_0x7bdb('0x2b')][_0x7bdb('0x2c')]};});_0x10e818[_0x7bdb('0x2d')]=_[_0x7bdb('0x27')](_0x399b62,'name');_0x10e818[_0x7bdb('0x2e')]=_[_0x7bdb('0x2f')](_0x7c09cf[_0x7bdb('0x2e')]);_0x10e818[_0x7bdb('0x30')]=_[_0x7bdb('0x31')](_0x10e818['model'],_0x10e818[_0x7bdb('0x2e')]);_0x523869[_0x7bdb('0x32')]=_[_0x7bdb('0x31')](_0x10e818[_0x7bdb('0x2d')],qs['fields'](_0x7c09cf['query']['fields']));_0x523869[_0x7bdb('0x32')]=_0x523869['attributes'][_0x7bdb('0x33')]?_0x523869['attributes']:_0x10e818[_0x7bdb('0x2d')];if(!_0x7c09cf[_0x7bdb('0x2e')][_0x7bdb('0x34')]('nolimit')){_0x523869[_0x7bdb('0x19')]=qs['limit'](_0x7c09cf['query'][_0x7bdb('0x19')]);_0x523869['offset']=qs[_0x7bdb('0x18')](_0x7c09cf['query']['offset']);}_0x523869[_0x7bdb('0x35')]=qs[_0x7bdb('0x36')](_0x7c09cf[_0x7bdb('0x2e')][_0x7bdb('0x36')]);_0x523869[_0x7bdb('0x37')]=qs[_0x7bdb('0x30')](_['pick'](_0x7c09cf[_0x7bdb('0x2e')],_0x10e818[_0x7bdb('0x30')]));if(_0x7c09cf[_0x7bdb('0x2e')][_0x7bdb('0x38')]){_0x523869[_0x7bdb('0x37')]=_[_0x7bdb('0x39')](_0x523869[_0x7bdb('0x37')],{'$or':_[_0x7bdb('0x27')](_0x399b62,function(_0xde82a0){if(_0xde82a0['type']!=='VIRTUAL'){var _0x19c237={};_0x19c237[_0xde82a0[_0x7bdb('0x24')]]={'$like':'%'+_0x7c09cf[_0x7bdb('0x2e')][_0x7bdb('0x38')]+'%'};return _0x19c237;}})});}_0x523869=_[_0x7bdb('0x39')]({},_0x523869,_0x7c09cf['options']);var _0x55f020={'where':_0x523869[_0x7bdb('0x37')]};return db['VoiceTransferReport'][_0x7bdb('0x17')](_0x55f020)['then'](function(_0x212b50){_0x32242d['count']=_0x212b50;if(_0x7c09cf['query'][_0x7bdb('0x3a')]){_0x523869[_0x7bdb('0x3b')]=[{'all':!![]}];}return db[_0x7bdb('0x28')][_0x7bdb('0x3c')](_0x523869);})[_0x7bdb('0x21')](function(_0x2b4829){_0x32242d[_0x7bdb('0x3d')]=_0x2b4829;return _0x32242d;})['then'](respondWithFilteredResult(_0x2a494e,_0x523869))['catch'](handleError(_0x2a494e,null));};exports[_0x7bdb('0x3e')]=function(_0x206888,_0x2dbb43){var _0x3509e4={'raw':!![],'where':{'id':_0x206888[_0x7bdb('0x3f')]['id']}},_0x39fbca={};_0x39fbca[_0x7bdb('0x2d')]=_['keys'](db['VoiceTransferReport'][_0x7bdb('0x29')]);_0x39fbca[_0x7bdb('0x2e')]=_[_0x7bdb('0x2f')](_0x206888[_0x7bdb('0x2e')]);_0x39fbca['filters']=_[_0x7bdb('0x31')](_0x39fbca['model'],_0x39fbca[_0x7bdb('0x2e')]);_0x3509e4[_0x7bdb('0x32')]=_[_0x7bdb('0x31')](_0x39fbca[_0x7bdb('0x2d')],qs[_0x7bdb('0x40')](_0x206888[_0x7bdb('0x2e')][_0x7bdb('0x40')]));_0x3509e4[_0x7bdb('0x32')]=_0x3509e4[_0x7bdb('0x32')]['length']?_0x3509e4[_0x7bdb('0x32')]:_0x39fbca[_0x7bdb('0x2d')];if(_0x206888['query'][_0x7bdb('0x3a')]){_0x3509e4['include']=[{'all':!![]}];}_0x3509e4=_[_0x7bdb('0x39')]({},_0x3509e4,_0x206888[_0x7bdb('0x41')]);return db[_0x7bdb('0x28')][_0x7bdb('0x42')](_0x3509e4)[_0x7bdb('0x21')](handleEntityNotFound(_0x2dbb43,null))['then'](respondWithResult(_0x2dbb43,null))[_0x7bdb('0x43')](handleError(_0x2dbb43,null));};exports[_0x7bdb('0x44')]=function(_0x12d889,_0x3eda2e){return db[_0x7bdb('0x28')]['create'](_0x12d889[_0x7bdb('0x45')],{})[_0x7bdb('0x21')](respondWithResult(_0x3eda2e,0xc9))[_0x7bdb('0x43')](handleError(_0x3eda2e,null));};exports[_0x7bdb('0x20')]=function(_0x259007,_0x25c534){if(_0x259007[_0x7bdb('0x45')]['id']){delete _0x259007[_0x7bdb('0x45')]['id'];}return db[_0x7bdb('0x28')][_0x7bdb('0x42')]({'where':{'id':_0x259007['params']['id']}})[_0x7bdb('0x21')](handleEntityNotFound(_0x25c534,null))['then'](saveUpdates(_0x259007['body'],null))[_0x7bdb('0x21')](respondWithResult(_0x25c534,null))[_0x7bdb('0x43')](handleError(_0x25c534,null));};exports['destroy']=function(_0x37780a,_0x186809){return db['VoiceTransferReport']['find']({'where':{'id':_0x37780a['params']['id']}})[_0x7bdb('0x21')](handleEntityNotFound(_0x186809,null))[_0x7bdb('0x21')](removeEntity(_0x186809,null))[_0x7bdb('0x43')](handleError(_0x186809,null));}; \ No newline at end of file +var _0xbaf0=['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','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','end','error','stack','name','send','index','map','VoiceTransferReport','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xbaf0[_0x6c993a];return _0x27f547;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0baf('0x0'));var rimraf=require(_0x0baf('0x1'));var zipdir=require(_0x0baf('0x2'));var jsonpatch=require(_0x0baf('0x3'));var rp=require(_0x0baf('0x4'));var moment=require(_0x0baf('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0baf('0x6'));var util=require(_0x0baf('0x7'));var path=require(_0x0baf('0x8'));var sox=require(_0x0baf('0x9'));var csv=require(_0x0baf('0xa'));var ejs=require(_0x0baf('0xb'));var fs=require('fs');var _=require(_0x0baf('0xc'));var squel=require(_0x0baf('0xd'));var crypto=require(_0x0baf('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0baf('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0baf('0x10'));var Papa=require(_0x0baf('0x11'));var Redis=require(_0x0baf('0x12'));var authService=require(_0x0baf('0x13'));var qs=require(_0x0baf('0x14'));var as=require(_0x0baf('0x15'));var hardwareService=require(_0x0baf('0x16'));var logger=require(_0x0baf('0x17'))(_0x0baf('0x18'));var utils=require(_0x0baf('0x19'));var config=require(_0x0baf('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5a53e2,_0x465dd7){_0x465dd7=_0x465dd7||0xcc;return function(_0xe4378c){if(_0xe4378c){return _0x5a53e2[_0x0baf('0x1b')](_0x465dd7);}return _0x5a53e2[_0x0baf('0x1c')](_0x465dd7)['end']();};}function respondWithResult(_0x2ab33e,_0x49e44b){_0x49e44b=_0x49e44b||0xc8;return function(_0x1c76a8){if(_0x1c76a8){return _0x2ab33e[_0x0baf('0x1c')](_0x49e44b)[_0x0baf('0x1d')](_0x1c76a8);}};}function respondWithFilteredResult(_0x2bc381,_0xb8339e){return function(_0x469599){if(_0x469599){var _0x4f80a8=_0x469599[_0x0baf('0x1e')],_0x4cd79d=_0xb8339e[_0x0baf('0x1f')],_0x2312c7=_0xb8339e[_0x0baf('0x1f')]+_0xb8339e[_0x0baf('0x20')],_0x38395b;if(_0x2312c7>=_0x4f80a8){_0x2312c7=_0x4f80a8;_0x38395b=0xc8;}else{_0x38395b=0xce;}_0x2bc381['status'](_0x38395b);return _0x2bc381[_0x0baf('0x21')](_0x0baf('0x22'),_0x4cd79d+'-'+_0x2312c7+'/'+_0x4f80a8)[_0x0baf('0x1d')](_0x469599);}return null;};}function patchUpdates(_0x3e9cb4){return function(_0x47070d){try{jsonpatch[_0x0baf('0x23')](_0x47070d,_0x3e9cb4,!![]);}catch(_0x4ff793){return BPromise['reject'](_0x4ff793);}return _0x47070d[_0x0baf('0x24')]();};}function saveUpdates(_0x154f48,_0x32e839){return function(_0x1848e8){if(_0x1848e8){return _0x1848e8[_0x0baf('0x25')](_0x154f48)[_0x0baf('0x26')](function(_0x210cd8){return _0x210cd8;});}return null;};}function removeEntity(_0x636a13,_0x2c42e2){return function(_0x15a2c3){if(_0x15a2c3){return _0x15a2c3['destroy']()[_0x0baf('0x26')](function(){_0x636a13['status'](0xcc)[_0x0baf('0x27')]();});}};}function handleEntityNotFound(_0x5dbf00,_0x4de74c){return function(_0x2ef0aa){if(!_0x2ef0aa){_0x5dbf00['sendStatus'](0x194);}return _0x2ef0aa;};}function handleError(_0x4be1b9,_0x47c4b){_0x47c4b=_0x47c4b||0x1f4;return function(_0x27b59c){logger[_0x0baf('0x28')](_0x27b59c[_0x0baf('0x29')]);if(_0x27b59c[_0x0baf('0x2a')]){delete _0x27b59c['name'];}_0x4be1b9[_0x0baf('0x1c')](_0x47c4b)[_0x0baf('0x2b')](_0x27b59c);};}exports[_0x0baf('0x2c')]=function(_0x366e71,_0x3843b8){var _0x3b9b31={},_0x453525={},_0x549fd0={'count':0x0,'rows':[]};var _0x1590b4=_[_0x0baf('0x2d')](db[_0x0baf('0x2e')][_0x0baf('0x2f')],function(_0x55c715){return{'name':_0x55c715[_0x0baf('0x30')],'type':_0x55c715[_0x0baf('0x31')]['key']};});_0x453525[_0x0baf('0x32')]=_[_0x0baf('0x2d')](_0x1590b4,_0x0baf('0x2a'));_0x453525[_0x0baf('0x33')]=_[_0x0baf('0x34')](_0x366e71[_0x0baf('0x33')]);_0x453525[_0x0baf('0x35')]=_['intersection'](_0x453525[_0x0baf('0x32')],_0x453525[_0x0baf('0x33')]);_0x3b9b31[_0x0baf('0x36')]=_[_0x0baf('0x37')](_0x453525[_0x0baf('0x32')],qs[_0x0baf('0x38')](_0x366e71[_0x0baf('0x33')][_0x0baf('0x38')]));_0x3b9b31[_0x0baf('0x36')]=_0x3b9b31[_0x0baf('0x36')][_0x0baf('0x39')]?_0x3b9b31[_0x0baf('0x36')]:_0x453525[_0x0baf('0x32')];if(!_0x366e71[_0x0baf('0x33')]['hasOwnProperty'](_0x0baf('0x3a'))){_0x3b9b31['limit']=qs[_0x0baf('0x20')](_0x366e71[_0x0baf('0x33')][_0x0baf('0x20')]);_0x3b9b31[_0x0baf('0x1f')]=qs['offset'](_0x366e71[_0x0baf('0x33')][_0x0baf('0x1f')]);}_0x3b9b31['order']=qs[_0x0baf('0x3b')](_0x366e71[_0x0baf('0x33')][_0x0baf('0x3b')]);_0x3b9b31[_0x0baf('0x3c')]=qs[_0x0baf('0x35')](_[_0x0baf('0x3d')](_0x366e71[_0x0baf('0x33')],_0x453525[_0x0baf('0x35')]));if(_0x366e71['query'][_0x0baf('0x3e')]){_0x3b9b31[_0x0baf('0x3c')]=_['merge'](_0x3b9b31[_0x0baf('0x3c')],{'$or':_['map'](_0x1590b4,function(_0x5c545f){if(_0x5c545f[_0x0baf('0x31')]!==_0x0baf('0x3f')){var _0x5d3ad1={};_0x5d3ad1[_0x5c545f['name']]={'$like':'%'+_0x366e71[_0x0baf('0x33')][_0x0baf('0x3e')]+'%'};return _0x5d3ad1;}})});}_0x3b9b31=_[_0x0baf('0x40')]({},_0x3b9b31,_0x366e71[_0x0baf('0x41')]);var _0x15eb5c={'where':_0x3b9b31[_0x0baf('0x3c')]};return db[_0x0baf('0x2e')][_0x0baf('0x1e')](_0x15eb5c)[_0x0baf('0x26')](function(_0x36c6d2){_0x549fd0[_0x0baf('0x1e')]=_0x36c6d2;if(_0x366e71[_0x0baf('0x33')][_0x0baf('0x42')]){_0x3b9b31[_0x0baf('0x43')]=[{'all':!![]}];}return db['VoiceTransferReport'][_0x0baf('0x44')](_0x3b9b31);})[_0x0baf('0x26')](function(_0x4f1de9){_0x549fd0[_0x0baf('0x45')]=_0x4f1de9;return _0x549fd0;})[_0x0baf('0x26')](respondWithFilteredResult(_0x3843b8,_0x3b9b31))[_0x0baf('0x46')](handleError(_0x3843b8,null));};exports[_0x0baf('0x47')]=function(_0x2e20c8,_0x456d0b){var _0x57b581={'raw':!![],'where':{'id':_0x2e20c8[_0x0baf('0x48')]['id']}},_0x23ad34={};_0x23ad34['model']=_[_0x0baf('0x34')](db[_0x0baf('0x2e')][_0x0baf('0x2f')]);_0x23ad34[_0x0baf('0x33')]=_['keys'](_0x2e20c8[_0x0baf('0x33')]);_0x23ad34[_0x0baf('0x35')]=_[_0x0baf('0x37')](_0x23ad34[_0x0baf('0x32')],_0x23ad34[_0x0baf('0x33')]);_0x57b581[_0x0baf('0x36')]=_[_0x0baf('0x37')](_0x23ad34[_0x0baf('0x32')],qs[_0x0baf('0x38')](_0x2e20c8[_0x0baf('0x33')]['fields']));_0x57b581[_0x0baf('0x36')]=_0x57b581[_0x0baf('0x36')][_0x0baf('0x39')]?_0x57b581[_0x0baf('0x36')]:_0x23ad34[_0x0baf('0x32')];if(_0x2e20c8['query'][_0x0baf('0x42')]){_0x57b581[_0x0baf('0x43')]=[{'all':!![]}];}_0x57b581=_[_0x0baf('0x40')]({},_0x57b581,_0x2e20c8[_0x0baf('0x41')]);return db[_0x0baf('0x2e')]['find'](_0x57b581)[_0x0baf('0x26')](handleEntityNotFound(_0x456d0b,null))[_0x0baf('0x26')](respondWithResult(_0x456d0b,null))[_0x0baf('0x46')](handleError(_0x456d0b,null));};exports[_0x0baf('0x49')]=function(_0x41599f,_0x22d10f){return db[_0x0baf('0x2e')]['create'](_0x41599f[_0x0baf('0x4a')],{})[_0x0baf('0x26')](respondWithResult(_0x22d10f,0xc9))[_0x0baf('0x46')](handleError(_0x22d10f,null));};exports['update']=function(_0x3c9de3,_0x2222b6){if(_0x3c9de3[_0x0baf('0x4a')]['id']){delete _0x3c9de3[_0x0baf('0x4a')]['id'];}return db[_0x0baf('0x2e')][_0x0baf('0x4b')]({'where':{'id':_0x3c9de3[_0x0baf('0x48')]['id']}})['then'](handleEntityNotFound(_0x2222b6,null))[_0x0baf('0x26')](saveUpdates(_0x3c9de3[_0x0baf('0x4a')],null))[_0x0baf('0x26')](respondWithResult(_0x2222b6,null))[_0x0baf('0x46')](handleError(_0x2222b6,null));};exports[_0x0baf('0x4c')]=function(_0xc427b2,_0x40d4a6){return db[_0x0baf('0x2e')][_0x0baf('0x4b')]({'where':{'id':_0xc427b2[_0x0baf('0x48')]['id']}})[_0x0baf('0x26')](handleEntityNotFound(_0x40d4a6,null))['then'](removeEntity(_0x40d4a6,null))['catch'](handleError(_0x40d4a6,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 390ae10..d38a5dd 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 _0xd8a2=['moment','bluebird','request-promise','rimraf','../../config/environment','exports','VoiceTransferReport','report_call_transfer','lodash','util','../../config/logger','api'];(function(_0x211308,_0x55e902){var _0x3384bf=function(_0xa5afe8){while(--_0xa5afe8){_0x211308['push'](_0x211308['shift']());}};_0x3384bf(++_0x55e902);}(_0xd8a2,0x128));var _0x2d8a=function(_0x383c09,_0x367c2b){_0x383c09=_0x383c09-0x0;var _0x3175e6=_0xd8a2[_0x383c09];return _0x3175e6;};'use strict';var _=require(_0x2d8a('0x0'));var util=require(_0x2d8a('0x1'));var logger=require(_0x2d8a('0x2'))(_0x2d8a('0x3'));var moment=require(_0x2d8a('0x4'));var BPromise=require(_0x2d8a('0x5'));var rp=require(_0x2d8a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2d8a('0x7'));var config=require(_0x2d8a('0x8'));var attributes=require('./voiceTransferReport.attributes');module[_0x2d8a('0x9')]=function(_0x564381,_0x2c0854){return _0x564381['define'](_0x2d8a('0xa'),attributes,{'tableName':_0x2d8a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd350=['exports','define','report_call_transfer','lodash','../../config/logger','api','bluebird','request-promise','path','../../config/environment'];(function(_0x54ac7d,_0x3bf75c){var _0x1a7779=function(_0xf37327){while(--_0xf37327){_0x54ac7d['push'](_0x54ac7d['shift']());}};_0x1a7779(++_0x3bf75c);}(_0xd350,0x7b));var _0x0d35=function(_0xaaf2e2,_0x19d28a){_0xaaf2e2=_0xaaf2e2-0x0;var _0x28bc36=_0xd350[_0xaaf2e2];return _0x28bc36;};'use strict';var _=require(_0x0d35('0x0'));var util=require('util');var logger=require(_0x0d35('0x1'))(_0x0d35('0x2'));var moment=require('moment');var BPromise=require(_0x0d35('0x3'));var rp=require(_0x0d35('0x4'));var fs=require('fs');var path=require(_0x0d35('0x5'));var rimraf=require('rimraf');var config=require(_0x0d35('0x6'));var attributes=require('./voiceTransferReport.attributes');module[_0x0d35('0x7')]=function(_0x5d342c,_0x2b5df5){return _0x5d342c[_0x0d35('0x8')]('VoiceTransferReport',attributes,{'tableName':_0x0d35('0x9'),'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 33f6a8e..3774e72 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 _0xc35c=['request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','body','raw','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x597543,_0xec533b){var _0x42b2aa=function(_0x487272){while(--_0x487272){_0x597543['push'](_0x597543['shift']());}};_0x42b2aa(++_0xec533b);}(_0xc35c,0x101));var _0xcc35=function(_0x293eeb,_0x287065){_0x293eeb=_0x293eeb-0x0;var _0x2fed88=_0xc35c[_0x293eeb];return _0x2fed88;};'use strict';var _=require(_0xcc35('0x0'));var util=require(_0xcc35('0x1'));var moment=require('moment');var BPromise=require(_0xcc35('0x2'));var rs=require(_0xcc35('0x3'));var fs=require('fs');var Redis=require(_0xcc35('0x4'));var db=require(_0xcc35('0x5'))['db'];var utils=require(_0xcc35('0x6'));var logger=require(_0xcc35('0x7'))(_0xcc35('0x8'));var config=require(_0xcc35('0x9'));var jayson=require(_0xcc35('0xa'));var client=jayson[_0xcc35('0xb')][_0xcc35('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x22396b,_0x5b9705,_0xe563ed){return new BPromise(function(_0x223085,_0xc4abae){return client[_0xcc35('0xd')](_0x22396b,_0xe563ed)[_0xcc35('0xe')](function(_0x368668){logger[_0xcc35('0xf')](_0xcc35('0x10'),_0x5b9705,_0xcc35('0x11'));logger[_0xcc35('0x12')](_0xcc35('0x13'),_0x5b9705,_0xcc35('0x11'),JSON[_0xcc35('0x14')](_0x368668));if(_0x368668[_0xcc35('0x15')]){if(_0x368668[_0xcc35('0x15')][_0xcc35('0x16')]===0x1f4){logger[_0xcc35('0x15')](_0xcc35('0x10'),_0x5b9705,_0x368668[_0xcc35('0x15')][_0xcc35('0x17')]);return _0xc4abae(_0x368668[_0xcc35('0x15')]['message']);}logger[_0xcc35('0x15')]('VoiceTransferReport,\x20%s,\x20%s',_0x5b9705,_0x368668[_0xcc35('0x15')][_0xcc35('0x17')]);return _0x223085(_0x368668[_0xcc35('0x15')][_0xcc35('0x17')]);}else{logger['info'](_0xcc35('0x10'),_0x5b9705,'request\x20sent');_0x223085(_0x368668[_0xcc35('0x18')][_0xcc35('0x17')]);}})[_0xcc35('0x19')](function(_0x4a4877){logger[_0xcc35('0x15')]('VoiceTransferReport,\x20%s,\x20%s',_0x5b9705,_0x4a4877);_0xc4abae(_0x4a4877);});});}exports[_0xcc35('0x1a')]=function(_0x4fefec){var _0x5c91fb=this;return new Promise(function(_0x2ae498,_0x192cfd){return db[_0xcc35('0x1b')]['create'](_0x4fefec[_0xcc35('0x1c')],{'raw':_0x4fefec['options']?_0x4fefec['options'][_0xcc35('0x1d')]===undefined?!![]:![]:!![]})[_0xcc35('0xe')](function(_0x21773f){logger[_0xcc35('0xf')](_0xcc35('0x1a'),_0x4fefec);logger[_0xcc35('0x12')](_0xcc35('0x1a'),_0x4fefec,JSON[_0xcc35('0x14')](_0x21773f));_0x2ae498(_0x21773f);})['catch'](function(_0x280743){logger[_0xcc35('0x15')](_0xcc35('0x1a'),_0x280743[_0xcc35('0x17')],_0x4fefec);_0x192cfd(_0x5c91fb[_0xcc35('0x15')](0x1f4,_0x280743[_0xcc35('0x17')]));});});}; \ No newline at end of file +var _0x5e1d=['info','request\x20sent','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceTransferReport,\x20%s,\x20%s','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','debug','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','client','request','then'];(function(_0x35f1ca,_0xc8fa0){var _0x4dd2e1=function(_0x261311){while(--_0x261311){_0x35f1ca['push'](_0x35f1ca['shift']());}};_0x4dd2e1(++_0xc8fa0);}(_0x5e1d,0x170));var _0xd5e1=function(_0x277e28,_0x469e21){_0x277e28=_0x277e28-0x0;var _0x39b502=_0x5e1d[_0x277e28];return _0x39b502;};'use strict';var _=require('lodash');var util=require(_0xd5e1('0x0'));var moment=require(_0xd5e1('0x1'));var BPromise=require(_0xd5e1('0x2'));var rs=require(_0xd5e1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd5e1('0x4'))(_0xd5e1('0x5'));var config=require(_0xd5e1('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xd5e1('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4983c9,_0x4793d2,_0x208983){return new BPromise(function(_0xd10cfb,_0x3a5869){return client[_0xd5e1('0x8')](_0x4983c9,_0x208983)[_0xd5e1('0x9')](function(_0xedcc76){logger[_0xd5e1('0xa')]('VoiceTransferReport,\x20%s,\x20%s',_0x4793d2,_0xd5e1('0xb'));logger['debug'](_0xd5e1('0xc'),_0x4793d2,_0xd5e1('0xb'),JSON[_0xd5e1('0xd')](_0xedcc76));if(_0xedcc76[_0xd5e1('0xe')]){if(_0xedcc76[_0xd5e1('0xe')][_0xd5e1('0xf')]===0x1f4){logger[_0xd5e1('0xe')](_0xd5e1('0x10'),_0x4793d2,_0xedcc76[_0xd5e1('0xe')][_0xd5e1('0x11')]);return _0x3a5869(_0xedcc76[_0xd5e1('0xe')][_0xd5e1('0x11')]);}logger[_0xd5e1('0xe')](_0xd5e1('0x10'),_0x4793d2,_0xedcc76['error'][_0xd5e1('0x11')]);return _0xd10cfb(_0xedcc76[_0xd5e1('0xe')][_0xd5e1('0x11')]);}else{logger[_0xd5e1('0xa')](_0xd5e1('0x10'),_0x4793d2,'request\x20sent');_0xd10cfb(_0xedcc76[_0xd5e1('0x12')][_0xd5e1('0x11')]);}})[_0xd5e1('0x13')](function(_0x4f3d87){logger['error'](_0xd5e1('0x10'),_0x4793d2,_0x4f3d87);_0x3a5869(_0x4f3d87);});});}exports[_0xd5e1('0x14')]=function(_0x662f0b){var _0x37cb10=this;return new Promise(function(_0x174675,_0x19c643){return db[_0xd5e1('0x15')][_0xd5e1('0x16')](_0x662f0b[_0xd5e1('0x17')],{'raw':_0x662f0b[_0xd5e1('0x18')]?_0x662f0b['options'][_0xd5e1('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1bdc3e){logger[_0xd5e1('0xa')](_0xd5e1('0x14'),_0x662f0b);logger[_0xd5e1('0x1a')](_0xd5e1('0x14'),_0x662f0b,JSON[_0xd5e1('0xd')](_0x1bdc3e));_0x174675(_0x1bdc3e);})[_0xd5e1('0x13')](function(_0x140e3a){logger[_0xd5e1('0xe')](_0xd5e1('0x14'),_0x140e3a[_0xd5e1('0x11')],_0x662f0b);_0x19c643(_0x37cb10['error'](0x1f4,_0x140e3a[_0xd5e1('0x11')]));});});}; \ No newline at end of file diff --git a/server/app.js b/server/app.js index afc9355..1fdd7d4 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbf2c=['./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','sequelize','then','info','start','map','filter','online','name','join','None','seedDB','./config/seedDB','default','./config/license','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','./mysqldb','./rpc','./config/environment','./config/logger'];(function(_0x2ec38d,_0x392bc2){var _0x2f4ccd=function(_0x21a706){while(--_0x21a706){_0x2ec38d['push'](_0x2ec38d['shift']());}};_0x2f4ccd(++_0x392bc2);}(_0xbf2c,0x1b6));var _0xcbf2=function(_0x2b68e4,_0x156d43){_0x2b68e4=_0x2b68e4-0x0;var _0x423c29=_0xbf2c[_0x2b68e4];return _0x423c29;};'use strict';var _=require('lodash');var mysqldb=require(_0xcbf2('0x0'));var rpc=require(_0xcbf2('0x1'));var config=require(_0xcbf2('0x2'));var logger=require(_0xcbf2('0x3'))('app');var pm2=require(_0xcbf2('0x4'));var pm2Config=require(_0xcbf2('0x5'));var schedule=require(_0xcbf2('0x6'));var chat=require(_0xcbf2('0x7'));function main(){return mysqldb['db'][_0xcbf2('0x8')]['sync']()[_0xcbf2('0x9')](function(){return rpc['listen']();})[_0xcbf2('0x9')](function(_0x55f37c){logger[_0xcbf2('0xa')](_0x55f37c);return chat['start']();})[_0xcbf2('0x9')](function(){return schedule[_0xcbf2('0xb')]();})[_0xcbf2('0x9')](function(_0x437bb2){logger['info'](_0x437bb2);return pm2[_0xcbf2('0xb')](pm2Config);})['then'](function(_0x315f77){logger[_0xcbf2('0xa')]('Online\x20apps:',_[_0xcbf2('0xc')](_[_0xcbf2('0xd')](_0x315f77,{'status':_0xcbf2('0xe')}),'name')['join']());logger['info']('Offline\x20apps:',_[_0xcbf2('0xc')](_[_0xcbf2('0xd')](_0x315f77,function(_0x4aa7bf){return _0x4aa7bf['status']!==_0xcbf2('0xe');}),_0xcbf2('0xf'))[_0xcbf2('0x10')]()||_0xcbf2('0x11'));config[_0xcbf2('0x12')]&&require(_0xcbf2('0x13'))[_0xcbf2('0x14')]();require(_0xcbf2('0x15'))[_0xcbf2('0x14')]();})[_0xcbf2('0x16')](function(_0x2355e6){logger[_0xcbf2('0x17')](_0xcbf2('0x18'),_0x2355e6);process[_0xcbf2('0x19')](0x1);});}main(); \ No newline at end of file +var _0x483b=['lodash','./mysqldb','./rpc','./config/environment','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','sync','listen','then','info','start','map','online','name','join','Offline\x20apps:','None','seedDB','./config/seedDB','default','./config/license','catch','exit'];(function(_0x4324f6,_0x1c83e3){var _0x593e15=function(_0x39fe38){while(--_0x39fe38){_0x4324f6['push'](_0x4324f6['shift']());}};_0x593e15(++_0x1c83e3);}(_0x483b,0xe1));var _0xb483=function(_0x3dc29b,_0x3d6975){_0x3dc29b=_0x3dc29b-0x0;var _0x55de09=_0x483b[_0x3dc29b];return _0x55de09;};'use strict';var _=require(_0xb483('0x0'));var mysqldb=require(_0xb483('0x1'));var rpc=require(_0xb483('0x2'));var config=require(_0xb483('0x3'));var logger=require('./config/logger')('app');var pm2=require(_0xb483('0x4'));var pm2Config=require(_0xb483('0x5'));var schedule=require(_0xb483('0x6'));var chat=require(_0xb483('0x7'));function main(){return mysqldb['db']['sequelize'][_0xb483('0x8')]()['then'](function(){return rpc[_0xb483('0x9')]();})[_0xb483('0xa')](function(_0x45abe8){logger[_0xb483('0xb')](_0x45abe8);return chat[_0xb483('0xc')]();})[_0xb483('0xa')](function(){return schedule['start']();})[_0xb483('0xa')](function(_0x255a56){logger[_0xb483('0xb')](_0x255a56);return pm2[_0xb483('0xc')](pm2Config);})[_0xb483('0xa')](function(_0x58fb5f){logger[_0xb483('0xb')]('Online\x20apps:',_[_0xb483('0xd')](_['filter'](_0x58fb5f,{'status':_0xb483('0xe')}),_0xb483('0xf'))[_0xb483('0x10')]());logger[_0xb483('0xb')](_0xb483('0x11'),_[_0xb483('0xd')](_['filter'](_0x58fb5f,function(_0x4843e8){return _0x4843e8['status']!==_0xb483('0xe');}),_0xb483('0xf'))[_0xb483('0x10')]()||_0xb483('0x12'));config[_0xb483('0x13')]&&require(_0xb483('0x14'))[_0xb483('0x15')]();require(_0xb483('0x16'))[_0xb483('0x15')]();})[_0xb483('0x17')](function(_0x3431cf){logger['error']('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x3431cf);process[_0xb483('0x18')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index de414f1..6014fdc 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 _0xdd4f=['fullname','name','internal','userpic','md5secret','voicePause','chatPause','faxPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarRemoteControl','hotdesk','interface','userProfileId','isChatInteractionAuthorized','isAuthenticated','user','ChatInteraction','findOne','params','closed','disposition','then','status','unmanaged','json','Unmanaged.','Forbidden.','use','headers','startsWith','authorization','User','find','authenticate','pass','Wrong\x20credentials.','catch','Bearer','query','apikey','getUuid','nonce','Invalid\x20API\x20access\x20key','Unknown\x20authorization\x20format','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','update','isMiddleware','signToken','setTokenCookie','cookie','motion.token','redirect','/dashboards/general','retrieveApiKey','isNil','apiKeyNonce','apiKeyIat','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','promisify','sign','secret','secrets','payload','options','randomBytes','toString','hex','floor','HS512','../../mysqldb','jsonwebtoken','express-jwt','basic-auth','crypto','bluebird','session','role'];(function(_0x29af6a,_0x5028db){var _0x3698a=function(_0x53eab1){while(--_0x53eab1){_0x29af6a['push'](_0x29af6a['shift']());}};_0x3698a(++_0x5028db);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0x2911ba,_0xd8d18c){_0x2911ba=_0x2911ba-0x0;var _0x186453=_0xdd4f[_0x2911ba];return _0x186453;};'use strict';var db=require(_0xfdd4('0x0'))['db'];var config=require('../../config/environment');var hardwareConf=require('../../config/license/hardware');var _=require('lodash');var jwt=require(_0xfdd4('0x1'));var expressJwt=require(_0xfdd4('0x2'));var compose=require('composable-middleware');var basicAuth=require(_0xfdd4('0x3'));var crypto=require(_0xfdd4('0x4'));var BPromise=require(_0xfdd4('0x5'));var validateJwt=expressJwt({'secret':config['secrets'][_0xfdd4('0x6')]});var userAttributes=['id',_0xfdd4('0x7'),_0xfdd4('0x8'),_0xfdd4('0x9'),_0xfdd4('0xa'),'email',_0xfdd4('0xb'),'permissions',_0xfdd4('0xc'),_0xfdd4('0xd'),_0xfdd4('0xe'),'mailPause',_0xfdd4('0xf'),'smsPause',_0xfdd4('0x10'),_0xfdd4('0x11'),_0xfdd4('0x12'),_0xfdd4('0x13'),_0xfdd4('0x14'),_0xfdd4('0x15'),_0xfdd4('0x16'),_0xfdd4('0x17'),_0xfdd4('0x18'),_0xfdd4('0x19'),_0xfdd4('0x1a'),'phoneBarEnableRecording',_0xfdd4('0x1b'),_0xfdd4('0x1c'),_0xfdd4('0x1d'),'phoneBarPrefixRequired',_0xfdd4('0x1e'),'phoneBarRemoteControlPort',_0xfdd4('0x1f'),_0xfdd4('0x20'),_0xfdd4('0x21')];exports[_0xfdd4('0x22')]=function(){return this[_0xfdd4('0x23')](!![])['use'](function(_0x47ed1d,_0x559c77,_0x3a966d){if(_0x47ed1d[_0xfdd4('0x24')]){_0x3a966d();}else{return db[_0xfdd4('0x25')][_0xfdd4('0x26')]({'where':{'id':_0x47ed1d[_0xfdd4('0x27')]['id']},'attributes':['id',_0xfdd4('0x28'),_0xfdd4('0x29')],'raw':!![]})[_0xfdd4('0x2a')](function(_0x32e00d){if(_0x32e00d&&_0x32e00d['closed']){return _0x559c77[_0xfdd4('0x2b')](_0x32e00d[_0xfdd4('0x29')]===_0xfdd4('0x2c')?0x195:0x193)[_0xfdd4('0x2d')]({'message':_0x32e00d[_0xfdd4('0x29')]===_0xfdd4('0x2c')?_0xfdd4('0x2e'):_0xfdd4('0x2f')});}else{_0x3a966d();}})['catch'](function(_0x2147e6){_0x3a966d(_0x2147e6);});}});};exports[_0xfdd4('0x23')]=function isAuthenticated(_0x2a24e8){return compose()[_0xfdd4('0x30')](function(_0xb7856d,_0x144acd,_0x451767){if(_0xb7856d[_0xfdd4('0x31')]['authorization']){if(_[_0xfdd4('0x32')](_0xb7856d[_0xfdd4('0x31')][_0xfdd4('0x33')],'Basic')){var _0x58fe0d=basicAuth(_0xb7856d);db[_0xfdd4('0x34')][_0xfdd4('0x35')]({'where':{'name':_0x58fe0d[_0xfdd4('0x9')]}})[_0xfdd4('0x2a')](function(_0x4a8790){if(!_0x4a8790||!_0x4a8790[_0xfdd4('0x36')](_0x58fe0d[_0xfdd4('0x37')])){return _0x144acd[_0xfdd4('0x2b')](0x191)[_0xfdd4('0x2d')]({'message':_0xfdd4('0x38')});}_0xb7856d[_0xfdd4('0x24')]={'id':_0x4a8790['id']};_0x451767();})[_0xfdd4('0x39')](function(_0x37b7a2){_0x451767(_0x37b7a2);});}else if(_['startsWith'](_0xb7856d[_0xfdd4('0x31')][_0xfdd4('0x33')],_0xfdd4('0x3a'))){validateJwt(_0xb7856d,_0x144acd,_0x451767);}else{if(_0x2a24e8){_0x451767();}else{return _0x144acd[_0xfdd4('0x2b')](0x193)[_0xfdd4('0x2d')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0xb7856d[_0xfdd4('0x3b')][_0xfdd4('0x3c')]){try{var _0xbf38b4={'audience':hardwareConf[_0xfdd4('0x3d')](),'issuer':hardwareConf[_0xfdd4('0x3d')]()};verifyJwt(_0xb7856d['query'][_0xfdd4('0x3c')],_0xbf38b4)[_0xfdd4('0x2a')](function(_0x2ab99e){return db['User'][_0xfdd4('0x35')]({'where':{'id':_0x2ab99e['sub']}})[_0xfdd4('0x2a')](function(_0x2b22f9){if(!_0x2b22f9||!_['isEqual'](_0x2b22f9['apiKeyNonce'],_0x2ab99e[_0xfdd4('0x3e')])){return _0x144acd[_0xfdd4('0x2b')](0x191)['json']({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}_0xb7856d[_0xfdd4('0x24')]={'id':_0x2b22f9['id']};_0x451767();});})[_0xfdd4('0x39')](function(){return _0x144acd[_0xfdd4('0x2b')](0x191)[_0xfdd4('0x2d')]({'message':_0xfdd4('0x3f')});});}catch(_0x265cab){_0x451767(_0x265cab);}}else if(_0x2a24e8){_0x451767();}else{return _0x144acd[_0xfdd4('0x2b')](0x193)[_0xfdd4('0x2d')]({'message':_0xfdd4('0x40')});}})[_0xfdd4('0x30')](function(_0x6ffe30,_0x12b8b1,_0xa5c90e){if(_0x6ffe30[_0xfdd4('0x24')]){db[_0xfdd4('0x34')][_0xfdd4('0x35')]({'where':{'id':_0x6ffe30[_0xfdd4('0x24')]['id']},'attributes':userAttributes})[_0xfdd4('0x2a')](function(_0x2abe77){if(!_0x2abe77){return _0x12b8b1[_0xfdd4('0x2b')](0x194)[_0xfdd4('0x2d')]({'message':_0xfdd4('0x41')});}_0x6ffe30[_0xfdd4('0x24')]=_0x2abe77;_0xa5c90e();})[_0xfdd4('0x39')](function(_0x301824){_0xa5c90e(_0x301824);});}else if(_0x2a24e8){_0xa5c90e();}else{return _0x12b8b1[_0xfdd4('0x2b')](0x194)['json']({'message':_0xfdd4('0x42')});}});};exports[_0xfdd4('0x43')]=function canUpdate(){return compose()[_0xfdd4('0x30')](function(_0x439389,_0x2850f5,_0x5842f1){return require('../../config/license/util')[_0xfdd4('0x44')]()['then'](function(_0xeca9d){if(_0xeca9d[_0xfdd4('0x45')]){_0x5842f1();}else{return _0x2850f5[_0xfdd4('0x2b')](0x193)[_0xfdd4('0x2d')]({'message':'Forbidden'});}})[_0xfdd4('0x39')](function(_0x3feb36){_0x5842f1(_0x3feb36);});});};exports[_0xfdd4('0x46')]=function(_0x2ee857,_0x35b719,_0x7e171){_0x2ee857[_0xfdd4('0x46')]=!![];return _0x7e171();};exports[_0xfdd4('0x47')]=function signToken(_0xe65944){return signJwt(_0xe65944);};exports[_0xfdd4('0x48')]=function(_0x5bcbc8,_0xa7d254){if(!_0x5bcbc8[_0xfdd4('0x24')]){return _0xa7d254[_0xfdd4('0x2b')](0x194)[_0xfdd4('0x2d')]({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x3e2bda={'payload':{'id':_0x5bcbc8[_0xfdd4('0x24')]['id'],'role':_0x5bcbc8[_0xfdd4('0x24')][_0xfdd4('0x7')]},'options':{'expiresIn':0x15180}};return signJwt(_0x3e2bda)[_0xfdd4('0x2a')](function(_0x496747){_0xa7d254[_0xfdd4('0x49')](_0xfdd4('0x4a'),_0x496747);_0xa7d254[_0xfdd4('0x4b')](_0xfdd4('0x4c'));})[_0xfdd4('0x39')](function(_0x1fc778){return _0xa7d254[_0xfdd4('0x2b')](0x1f4)['send'](_0x1fc778);});};exports[_0xfdd4('0x4d')]=function(_0x586713){if(_[_0xfdd4('0x4e')](_0x586713[_0xfdd4('0x4f')])||_[_0xfdd4('0x4e')](_0x586713[_0xfdd4('0x50')])){return null;}else{return createJwt(_0x586713);}};exports['generateApiKey']=function(_0x419578){_0x419578[_0xfdd4('0x4f')]=generateNonce();_0x419578['apiKeyIat']=generateIssuedAt();return createJwt(_0x419578);};exports[_0xfdd4('0x51')]=function(_0xbfaa53,_0x48d422){var _0x218ca5=_0xbfaa53['query']['apikey'];if(_0x218ca5){var _0x4c3dbf={'nonce':_0x48d422[_0xfdd4('0x4f')],'iat':_0x48d422[_0xfdd4('0x50')],'audience':hardwareConf[_0xfdd4('0x3d')](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x218ca5,_0x4c3dbf)[_0xfdd4('0x2a')](function(){return generateApiKey(_0x48d422);});}else{throw{'message':_0xfdd4('0x52')};}};function signJwt(_0x4d11d1){var _0x25e3c9=BPromise[_0xfdd4('0x53')](jwt[_0xfdd4('0x54')],{'context':jwt});var _0x2bb94a=_0x4d11d1[_0xfdd4('0x55')]||config[_0xfdd4('0x56')][_0xfdd4('0x6')];return new BPromise(function(_0x2bec0c,_0x393c11){_0x25e3c9(_0x4d11d1[_0xfdd4('0x57')],_0x2bb94a,_0x4d11d1[_0xfdd4('0x58')])[_0xfdd4('0x2a')](function(_0x300965){_0x2bec0c(_0x300965);})[_0xfdd4('0x39')](function(_0x55065e){_0x393c11(_0x55065e);});});}function verifyJwt(_0x4dd1a2,_0x43e631,_0x222902){var _0x1296e6=BPromise[_0xfdd4('0x53')](jwt['verify'],{'context':jwt});var _0x3c6828=_0x222902||config[_0xfdd4('0x56')]['session'];return new BPromise(function(_0x58cdab,_0x53c66d){_0x1296e6(_0x4dd1a2,_0x3c6828,_0x43e631)['then'](function(_0x557cb3){_0x58cdab(_0x557cb3);})[_0xfdd4('0x39')](function(_0x88e9ef){_0x53c66d(_0x88e9ef);});});}function generateNonce(){return crypto[_0xfdd4('0x59')](0x10)[_0xfdd4('0x5a')](_0xfdd4('0x5b'));}function generateIssuedAt(){return Math[_0xfdd4('0x5c')](Date['now']()/0x3e8)[_0xfdd4('0x5a')]();}function createJwt(_0x1f521a){var _0x1dd417={'payload':{'iat':_0x1f521a[_0xfdd4('0x50')],'nonce':_0x1f521a['apiKeyNonce']},'options':{'algorithm':_0xfdd4('0x5d'),'subject':_0x1f521a['id'][_0xfdd4('0x5a')](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf[_0xfdd4('0x3d')]()}};return signJwt(_0x1dd417)[_0xfdd4('0x2a')](function(_0x555e50){return{'iat':_0x1f521a['apiKeyIat'],'nonce':_0x1f521a[_0xfdd4('0x4f')],'token':_0x555e50};});} \ No newline at end of file +var _0x7916=['query','apikey','getUuid','User','find','sub','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','Invalid\x20API\x20access\x20key','Unknown\x20authorization\x20format','canUpdate','getLicense','Forbidden','isMiddleware','signToken','setTokenCookie','cookie','motion.token','redirect','/dashboards/general','retrieveApiKey','isNil','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','promisify','sign','secret','session','options','verify','randomBytes','toString','hex','now','../../mysqldb','../../config/license/hardware','lodash','express-jwt','composable-middleware','basic-auth','crypto','secrets','role','fullname','internal','userpic','voicePause','chatPause','faxPause','smsPause','openchannelPause','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarPrefixRequired','phoneBarRemoteControlPort','interface','userProfileId','isAuthenticated','user','ChatInteraction','params','disposition','then','closed','status','unmanaged','Forbidden.','catch','use','headers','authorization','authenticate','json'];(function(_0x39cdb8,_0x15ee98){var _0x44bbc9=function(_0x395338){while(--_0x395338){_0x39cdb8['push'](_0x39cdb8['shift']());}};_0x44bbc9(++_0x15ee98);}(_0x7916,0x128));var _0x6791=function(_0x290d35,_0x5e0f78){_0x290d35=_0x290d35-0x0;var _0x112b51=_0x7916[_0x290d35];return _0x112b51;};'use strict';var db=require(_0x6791('0x0'))['db'];var config=require('../../config/environment');var hardwareConf=require(_0x6791('0x1'));var _=require(_0x6791('0x2'));var jwt=require('jsonwebtoken');var expressJwt=require(_0x6791('0x3'));var compose=require(_0x6791('0x4'));var basicAuth=require(_0x6791('0x5'));var crypto=require(_0x6791('0x6'));var BPromise=require('bluebird');var validateJwt=expressJwt({'secret':config[_0x6791('0x7')]['session']});var userAttributes=['id',_0x6791('0x8'),_0x6791('0x9'),'name',_0x6791('0xa'),'email',_0x6791('0xb'),'permissions','md5secret',_0x6791('0xc'),_0x6791('0xd'),'mailPause',_0x6791('0xe'),_0x6791('0xf'),_0x6791('0x10'),'pauseType',_0x6791('0x11'),_0x6791('0x12'),_0x6791('0x13'),_0x6791('0x14'),_0x6791('0x15'),_0x6791('0x16'),_0x6791('0x17'),_0x6791('0x18'),_0x6791('0x19'),_0x6791('0x1a'),_0x6791('0x1b'),'phoneBarEnableSettings','phoneBarExpires',_0x6791('0x1c'),'phoneBarRemoteControl',_0x6791('0x1d'),'hotdesk',_0x6791('0x1e'),_0x6791('0x1f')];exports['isChatInteractionAuthorized']=function(){return this[_0x6791('0x20')](!![])['use'](function(_0x3856ac,_0x150d1f,_0x596a06){if(_0x3856ac[_0x6791('0x21')]){_0x596a06();}else{return db[_0x6791('0x22')]['findOne']({'where':{'id':_0x3856ac[_0x6791('0x23')]['id']},'attributes':['id','closed',_0x6791('0x24')],'raw':!![]})[_0x6791('0x25')](function(_0x669270){if(_0x669270&&_0x669270[_0x6791('0x26')]){return _0x150d1f[_0x6791('0x27')](_0x669270[_0x6791('0x24')]===_0x6791('0x28')?0x195:0x193)['json']({'message':_0x669270[_0x6791('0x24')]===_0x6791('0x28')?'Unmanaged.':_0x6791('0x29')});}else{_0x596a06();}})[_0x6791('0x2a')](function(_0x595cf2){_0x596a06(_0x595cf2);});}});};exports[_0x6791('0x20')]=function isAuthenticated(_0x309610){return compose()[_0x6791('0x2b')](function(_0x12d83b,_0x56ad28,_0x3e17b3){if(_0x12d83b[_0x6791('0x2c')]['authorization']){if(_['startsWith'](_0x12d83b['headers'][_0x6791('0x2d')],'Basic')){var _0x1d27c0=basicAuth(_0x12d83b);db['User']['find']({'where':{'name':_0x1d27c0['name']}})[_0x6791('0x25')](function(_0x23442e){if(!_0x23442e||!_0x23442e[_0x6791('0x2e')](_0x1d27c0['pass'])){return _0x56ad28[_0x6791('0x27')](0x191)[_0x6791('0x2f')]({'message':'Wrong\x20credentials.'});}_0x12d83b[_0x6791('0x21')]={'id':_0x23442e['id']};_0x3e17b3();})['catch'](function(_0x424b0e){_0x3e17b3(_0x424b0e);});}else if(_['startsWith'](_0x12d83b['headers'][_0x6791('0x2d')],'Bearer')){validateJwt(_0x12d83b,_0x56ad28,_0x3e17b3);}else{if(_0x309610){_0x3e17b3();}else{return _0x56ad28[_0x6791('0x27')](0x193)[_0x6791('0x2f')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x12d83b[_0x6791('0x30')][_0x6791('0x31')]){try{var _0x234c5e={'audience':hardwareConf[_0x6791('0x32')](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x12d83b['query'][_0x6791('0x31')],_0x234c5e)['then'](function(_0x3ddbee){return db[_0x6791('0x33')][_0x6791('0x34')]({'where':{'id':_0x3ddbee[_0x6791('0x35')]}})[_0x6791('0x25')](function(_0x127bfa){if(!_0x127bfa||!_[_0x6791('0x36')](_0x127bfa[_0x6791('0x37')],_0x3ddbee[_0x6791('0x38')])){return _0x56ad28[_0x6791('0x27')](0x191)['json']({'message':_0x6791('0x39')});}_0x12d83b[_0x6791('0x21')]={'id':_0x127bfa['id']};_0x3e17b3();});})[_0x6791('0x2a')](function(){return _0x56ad28[_0x6791('0x27')](0x191)[_0x6791('0x2f')]({'message':_0x6791('0x3a')});});}catch(_0x5c437f){_0x3e17b3(_0x5c437f);}}else if(_0x309610){_0x3e17b3();}else{return _0x56ad28['status'](0x193)['json']({'message':_0x6791('0x3b')});}})[_0x6791('0x2b')](function(_0x252916,_0x549636,_0x5657c0){if(_0x252916[_0x6791('0x21')]){db[_0x6791('0x33')][_0x6791('0x34')]({'where':{'id':_0x252916[_0x6791('0x21')]['id']},'attributes':userAttributes})['then'](function(_0x4430cf){if(!_0x4430cf){return _0x549636[_0x6791('0x27')](0x194)[_0x6791('0x2f')]({'message':'User\x20not\x20found.'});}_0x252916[_0x6791('0x21')]=_0x4430cf;_0x5657c0();})['catch'](function(_0x4ee010){_0x5657c0(_0x4ee010);});}else if(_0x309610){_0x5657c0();}else{return _0x549636[_0x6791('0x27')](0x194)[_0x6791('0x2f')]({'message':'User\x20object\x20not\x20found.'});}});};exports[_0x6791('0x3c')]=function canUpdate(){return compose()[_0x6791('0x2b')](function(_0x407882,_0x333ad5,_0x3e5676){return require('../../config/license/util')[_0x6791('0x3d')]()[_0x6791('0x25')](function(_0x2d0dd8){if(_0x2d0dd8['update']){_0x3e5676();}else{return _0x333ad5[_0x6791('0x27')](0x193)[_0x6791('0x2f')]({'message':_0x6791('0x3e')});}})['catch'](function(_0x11a012){_0x3e5676(_0x11a012);});});};exports[_0x6791('0x3f')]=function(_0x13be81,_0x122aa5,_0x593fda){_0x13be81[_0x6791('0x3f')]=!![];return _0x593fda();};exports[_0x6791('0x40')]=function signToken(_0x3e95b6){return signJwt(_0x3e95b6);};exports[_0x6791('0x41')]=function(_0x12f121,_0x2f3cda){if(!_0x12f121[_0x6791('0x21')]){return _0x2f3cda[_0x6791('0x27')](0x194)[_0x6791('0x2f')]({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x52c03a={'payload':{'id':_0x12f121[_0x6791('0x21')]['id'],'role':_0x12f121[_0x6791('0x21')]['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x52c03a)[_0x6791('0x25')](function(_0x1c9913){_0x2f3cda[_0x6791('0x42')](_0x6791('0x43'),_0x1c9913);_0x2f3cda[_0x6791('0x44')](_0x6791('0x45'));})[_0x6791('0x2a')](function(_0x58f6da){return _0x2f3cda[_0x6791('0x27')](0x1f4)['send'](_0x58f6da);});};exports[_0x6791('0x46')]=function(_0xfc170e){if(_[_0x6791('0x47')](_0xfc170e[_0x6791('0x37')])||_['isNil'](_0xfc170e[_0x6791('0x48')])){return null;}else{return createJwt(_0xfc170e);}};exports[_0x6791('0x49')]=function(_0xeb9d45){_0xeb9d45[_0x6791('0x37')]=generateNonce();_0xeb9d45[_0x6791('0x48')]=generateIssuedAt();return createJwt(_0xeb9d45);};exports[_0x6791('0x4a')]=function(_0x91a161,_0x453ccd){var _0x57e39f=_0x91a161[_0x6791('0x30')][_0x6791('0x31')];if(_0x57e39f){var _0x3124bc={'nonce':_0x453ccd[_0x6791('0x37')],'iat':_0x453ccd['apiKeyIat'],'audience':hardwareConf[_0x6791('0x32')](),'issuer':hardwareConf[_0x6791('0x32')]()};return verifyJwt(_0x57e39f,_0x3124bc)['then'](function(){return generateApiKey(_0x453ccd);});}else{throw{'message':_0x6791('0x4b')};}};function signJwt(_0x54ef7b){var _0x38b6b5=BPromise[_0x6791('0x4c')](jwt[_0x6791('0x4d')],{'context':jwt});var _0x3ddccc=_0x54ef7b[_0x6791('0x4e')]||config[_0x6791('0x7')][_0x6791('0x4f')];return new BPromise(function(_0x286d46,_0x299689){_0x38b6b5(_0x54ef7b['payload'],_0x3ddccc,_0x54ef7b[_0x6791('0x50')])['then'](function(_0x10e806){_0x286d46(_0x10e806);})[_0x6791('0x2a')](function(_0x276002){_0x299689(_0x276002);});});}function verifyJwt(_0x304a7e,_0x6ab7f6,_0x5f5a74){var _0x2bc08d=BPromise[_0x6791('0x4c')](jwt[_0x6791('0x51')],{'context':jwt});var _0x3d22f3=_0x5f5a74||config[_0x6791('0x7')]['session'];return new BPromise(function(_0x1a902c,_0x42948b){_0x2bc08d(_0x304a7e,_0x3d22f3,_0x6ab7f6)['then'](function(_0x3df699){_0x1a902c(_0x3df699);})['catch'](function(_0x3d4b7e){_0x42948b(_0x3d4b7e);});});}function generateNonce(){return crypto[_0x6791('0x52')](0x10)[_0x6791('0x53')](_0x6791('0x54'));}function generateIssuedAt(){return Math['floor'](Date[_0x6791('0x55')]()/0x3e8)[_0x6791('0x53')]();}function createJwt(_0x5655c8){var _0x189b22={'payload':{'iat':_0x5655c8[_0x6791('0x48')],'nonce':_0x5655c8[_0x6791('0x37')]},'options':{'algorithm':'HS512','subject':_0x5655c8['id'][_0x6791('0x53')](),'issuer':hardwareConf[_0x6791('0x32')](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x189b22)[_0x6791('0x25')](function(_0x2cec8d){return{'iat':_0x5655c8['apiKeyIat'],'nonce':_0x5655c8[_0x6791('0x37')],'token':_0x2cec8d};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index c1bd188..123a310 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 _0xe706=['unlink','crypto','bluebird','aes192','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','algorithm','data','update','end','final','binary','write','close','createDecipher'];(function(_0x590a0c,_0xab1f66){var _0x32add4=function(_0x8e9352){while(--_0x8e9352){_0x590a0c['push'](_0x590a0c['shift']());}};_0x32add4(++_0xab1f66);}(_0xe706,0xa3));var _0x6e70=function(_0x5d7747,_0x55c074){_0x5d7747=_0x5d7747-0x0;var _0x291142=_0xe706[_0x5d7747];return _0x291142;};'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 +var _0xcb91=['unlink','createReadStream','createWriteStream','createDecipher','update','aes192','hasOwnProperty','createCipher','algorithm','data','binary','write','end','final','close'];(function(_0x42777b,_0x29d3fb){var _0x2fb268=function(_0x79e091){while(--_0x79e091){_0x42777b['push'](_0x42777b['shift']());}};_0x2fb268(++_0x29d3fb);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x272638,_0x42b993){_0x272638=_0x272638-0x0;var _0x19d027=_0xcb91[_0x272638];return _0x19d027;};'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 diff --git a/server/components/export/csv.js b/server/components/export/csv.js index e817123..c0cd396 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 _0xcb91=['splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','length','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','.csv','join','each','push','%s%d.%s','csv','%s.%s','writeFileSync','CSV','Completed','zip','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','lodash','to-csv','bluebird','zip-dir','../../mysqldb','../../config/logger','analytics','argv','savename','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','split'];(function(_0x2a49fc,_0x11b180){var _0x124cf2=function(_0x4b58c7){while(--_0x4b58c7){_0x2a49fc['push'](_0x2a49fc['shift']());}};_0x124cf2(++_0x11b180);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4409e7,_0x307f17){_0x4409e7=_0x4409e7-0x0;var _0x24c751=_0xcb91[_0x4409e7];return _0x24c751;};'use strict';var util=require('util');var path=require('path');var _=require(_0x1cb9('0x0'));var csv=require(_0x1cb9('0x1'));var fs=require('fs');var BPromise=require(_0x1cb9('0x2'));var zipdir=require(_0x1cb9('0x3'));var rimraf=require('rimraf');var db=require(_0x1cb9('0x4'))['db'];var dbH=require(_0x1cb9('0x4'))['dbH'];var logger=require(_0x1cb9('0x5'))(_0x1cb9('0x6'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x1cb9('0x7')][0x3];var PATH=process[_0x1cb9('0x7')][0x4];function analyticExtractedReport(_0x4ffe20,_0x38737d){var _0x12567c={'status':_0x4ffe20};var _0x59d1be={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x38737d){_0x12567c[_0x1cb9('0x8')]=_0x38737d;}return db['AnalyticExtractedReport']['update'](_0x12567c,_0x59d1be);}function main(){var _0x45a12f=0x1388;var _0x2fa15c;logger[_0x1cb9('0x9')](util[_0x1cb9('0xa')](_0x1cb9('0xb'),EXTRACTED_REPORT_ID,'CSV'));return db[_0x1cb9('0xc')][_0x1cb9('0xd')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x1cb9('0xe'),_0x1cb9('0xf')]})[_0x1cb9('0x10')](function(_0x5445e1){if(_0x5445e1){_0x2fa15c=_0x5445e1;_0x45a12f=_0x2fa15c['splitSizeCsv']||0x1388;}})['then'](function(){return dbH[_0x1cb9('0x11')][_0x1cb9('0x12')](util[_0x1cb9('0xa')](_0x1cb9('0x13'),QUERY),{'type':dbH['sequelize'][_0x1cb9('0x14')][_0x1cb9('0x15')]});})[_0x1cb9('0x10')](function(_0x8dfa55){if(!_0x8dfa55[0x0][_0x1cb9('0x16')]){return analyticExtractedReport('Empty');}var _0x5572cb=[];var _0xd446a3=0x0;var _0x3cc765=!![];if(_0x8dfa55&&_0x8dfa55[_0x1cb9('0x17')]){var _0x3f1376=_0x8dfa55[0x0][_0x1cb9('0x16')]%(_0xd446a3+_0x45a12f);if(_0x2fa15c[_0x1cb9('0xe')]){for(;_0x3cc765;_0xd446a3+=_0x45a12f,_0x3f1376=_0x8dfa55[0x0][_0x1cb9('0x16')]%(_0xd446a3+_0x45a12f)){if(_0x3f1376==0x0||_0x3f1376==_0x8dfa55[0x0]['num']){_0x3cc765=![];}_0x5572cb['push'](dbH[_0x1cb9('0x11')][_0x1cb9('0x12')](util[_0x1cb9('0xa')](_0x1cb9('0x18'),QUERY,_0x45a12f,_0xd446a3),{'type':dbH[_0x1cb9('0x11')][_0x1cb9('0x14')][_0x1cb9('0x15')]}));}}else{_0x5572cb['push'](dbH['sequelize'][_0x1cb9('0x12')](QUERY,{'type':dbH['sequelize'][_0x1cb9('0x14')][_0x1cb9('0x15')]}));}}var _0x523b26=path['dirname'](PATH);var _0x2e3854=path[_0x1cb9('0x19')](PATH,_0x1cb9('0x1a'));var _0x4601b8=_0x2fa15c[_0x1cb9('0xe')]&&_0x5572cb[_0x1cb9('0x17')]>0x1;var _0x59ebea=[];if(!fs['existsSync'](path[_0x1cb9('0x1b')](_0x523b26,_0x2e3854))&&_0x4601b8){fs['mkdirSync'](path[_0x1cb9('0x1b')](_0x523b26,_0x2e3854));}return BPromise[_0x1cb9('0x1c')](_0x5572cb,function(_0x69b4c8){_0x59ebea[_0x1cb9('0x1d')](_0x69b4c8);})[_0x1cb9('0x10')](function(){for(var _0x53f9fa=0x0;_0x53f9fa<_0x59ebea[_0x1cb9('0x17')];_0x53f9fa+=0x1){var _0x9df250;var _0x4c8d76=_0x59ebea[_0x53f9fa];if(_0x4601b8){_0x9df250=path[_0x1cb9('0x1b')](_0x523b26,_0x2e3854,util[_0x1cb9('0xa')](_0x1cb9('0x1e'),_0x2e3854,_0x53f9fa,_0x1cb9('0x1f')));}else{_0x9df250=path[_0x1cb9('0x1b')](_0x523b26,util[_0x1cb9('0xa')](_0x1cb9('0x20'),_0x2e3854,_0x1cb9('0x1f')));}fs[_0x1cb9('0x21')](_0x9df250,csv(_0x4c8d76));}})[_0x1cb9('0x10')](function(){if(_0x4601b8){zipdir(path['join'](_0x523b26,_0x2e3854),{'saveTo':path[_0x1cb9('0x1b')](_0x523b26,util['format'](_0x1cb9('0x20'),_0x2e3854,'zip'))},function(_0x278327,_0x41011c){});rimraf(path[_0x1cb9('0x1b')](_0x523b26,_0x2e3854),function(){});}})[_0x1cb9('0x10')](function(){logger['info'](util[_0x1cb9('0xa')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x1cb9('0x22')));return analyticExtractedReport(_0x1cb9('0x23'),_0x4601b8?util[_0x1cb9('0xa')]('%s.%s',_0x2e3854,_0x4601b8?_0x1cb9('0x24'):'csv'):null);});})[_0x1cb9('0x25')](function(_0x58f4f5){logger[_0x1cb9('0x9')](util[_0x1cb9('0xa')](_0x1cb9('0x26'),EXTRACTED_REPORT_ID,_0x1cb9('0x22')),util['inspect'](_0x58f4f5,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x1cb9('0x27'));});}main(); \ No newline at end of file +var _0xedd9=['path','lodash','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','info','format','CSV','Setting','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','length','push','dirname','basename','existsSync','mkdirSync','join','each','%s.%s','writeFileSync','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','csv','inspect','Failed'];(function(_0x20c9b2,_0x55d7b1){var _0x2c6030=function(_0x10845f){while(--_0x10845f){_0x20c9b2['push'](_0x20c9b2['shift']());}};_0x2c6030(++_0x55d7b1);}(_0xedd9,0xfc));var _0x9edd=function(_0x1a07ef,_0x57325f){_0x1a07ef=_0x1a07ef-0x0;var _0x5b4edb=_0xedd9[_0x1a07ef];return _0x5b4edb;};'use strict';var util=require('util');var path=require(_0x9edd('0x0'));var _=require(_0x9edd('0x1'));var csv=require(_0x9edd('0x2'));var fs=require('fs');var BPromise=require(_0x9edd('0x3'));var zipdir=require(_0x9edd('0x4'));var rimraf=require(_0x9edd('0x5'));var db=require(_0x9edd('0x6'))['db'];var dbH=require(_0x9edd('0x6'))['dbH'];var logger=require(_0x9edd('0x7'))(_0x9edd('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0x9edd('0x9')][0x2]);var QUERY=process[_0x9edd('0x9')][0x3];var PATH=process['argv'][0x4];function analyticExtractedReport(_0xf0b2d8,_0x571af9){var _0x172522={'status':_0xf0b2d8};var _0x190185={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x571af9){_0x172522[_0x9edd('0xa')]=_0x571af9;}return db[_0x9edd('0xb')]['update'](_0x172522,_0x190185);}function main(){var _0x494a24=0x1388;var _0x5d2f90;logger[_0x9edd('0xc')](util[_0x9edd('0xd')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x9edd('0xe')));return db[_0x9edd('0xf')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x9edd('0x10'),_0x9edd('0x11')]})[_0x9edd('0x12')](function(_0xfd544a){if(_0xfd544a){_0x5d2f90=_0xfd544a;_0x494a24=_0x5d2f90[_0x9edd('0x11')]||0x1388;}})[_0x9edd('0x12')](function(){return dbH[_0x9edd('0x13')][_0x9edd('0x14')](util['format'](_0x9edd('0x15'),QUERY),{'type':dbH[_0x9edd('0x13')][_0x9edd('0x16')][_0x9edd('0x17')]});})[_0x9edd('0x12')](function(_0x338f3c){if(!_0x338f3c[0x0][_0x9edd('0x18')]){return analyticExtractedReport(_0x9edd('0x19'));}var _0x4ea60f=[];var _0x5f5bf4=0x0;var _0x448996=!![];if(_0x338f3c&&_0x338f3c[_0x9edd('0x1a')]){var _0x5acf65=_0x338f3c[0x0][_0x9edd('0x18')]%(_0x5f5bf4+_0x494a24);if(_0x5d2f90[_0x9edd('0x10')]){for(;_0x448996;_0x5f5bf4+=_0x494a24,_0x5acf65=_0x338f3c[0x0][_0x9edd('0x18')]%(_0x5f5bf4+_0x494a24)){if(_0x5acf65==0x0||_0x5acf65==_0x338f3c[0x0]['num']){_0x448996=![];}_0x4ea60f[_0x9edd('0x1b')](dbH['sequelize'][_0x9edd('0x14')](util[_0x9edd('0xd')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x494a24,_0x5f5bf4),{'type':dbH['sequelize'][_0x9edd('0x16')]['SELECT']}));}}else{_0x4ea60f[_0x9edd('0x1b')](dbH['sequelize']['query'](QUERY,{'type':dbH[_0x9edd('0x13')][_0x9edd('0x16')]['SELECT']}));}}var _0x5823bc=path[_0x9edd('0x1c')](PATH);var _0x186186=path[_0x9edd('0x1d')](PATH,'.csv');var _0x3741c8=_0x5d2f90[_0x9edd('0x10')]&&_0x4ea60f[_0x9edd('0x1a')]>0x1;var _0x2ca65f=[];if(!fs[_0x9edd('0x1e')](path['join'](_0x5823bc,_0x186186))&&_0x3741c8){fs[_0x9edd('0x1f')](path[_0x9edd('0x20')](_0x5823bc,_0x186186));}return BPromise[_0x9edd('0x21')](_0x4ea60f,function(_0x2f9f86){_0x2ca65f[_0x9edd('0x1b')](_0x2f9f86);})['then'](function(){for(var _0x4b3d1b=0x0;_0x4b3d1b<_0x2ca65f[_0x9edd('0x1a')];_0x4b3d1b+=0x1){var _0xfeca7b;var _0x8d67aa=_0x2ca65f[_0x4b3d1b];if(_0x3741c8){_0xfeca7b=path[_0x9edd('0x20')](_0x5823bc,_0x186186,util[_0x9edd('0xd')]('%s%d.%s',_0x186186,_0x4b3d1b,'csv'));}else{_0xfeca7b=path[_0x9edd('0x20')](_0x5823bc,util[_0x9edd('0xd')](_0x9edd('0x22'),_0x186186,'csv'));}fs[_0x9edd('0x23')](_0xfeca7b,csv(_0x8d67aa));}})[_0x9edd('0x12')](function(){if(_0x3741c8){zipdir(path[_0x9edd('0x20')](_0x5823bc,_0x186186),{'saveTo':path[_0x9edd('0x20')](_0x5823bc,util['format'](_0x9edd('0x22'),_0x186186,_0x9edd('0x24')))},function(_0xbe87e1,_0x12c1bc){});rimraf(path[_0x9edd('0x20')](_0x5823bc,_0x186186),function(){});}})[_0x9edd('0x12')](function(){logger[_0x9edd('0xc')](util[_0x9edd('0xd')](_0x9edd('0x25'),EXTRACTED_REPORT_ID,_0x9edd('0xe')));return analyticExtractedReport(_0x9edd('0x26'),_0x3741c8?util[_0x9edd('0xd')](_0x9edd('0x22'),_0x186186,_0x3741c8?_0x9edd('0x24'):_0x9edd('0x27')):null);});})['catch'](function(_0x1453d2){logger[_0x9edd('0xc')](util[_0x9edd('0xd')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x9edd('0xe')),util[_0x9edd('0x28')](_0x1453d2,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x9edd('0x29'));});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index be68ea6..21e18dd 100644 --- a/server/components/export/pdf.js +++ b/server/components/export/pdf.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['format','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','existsSync','join','mkdirSync','each','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','endDate','landscape','black','body','toString','/fonts/Roboto-Medium.ttf','/fonts/Roboto-Italic.ttf','/fonts/Roboto-MediumItalic.ttf','createPdfKitDocument','%s%d.%s','pdf','pipe','finish','error','log','err','%s.%s','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','findOne','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','lodash','bluebird','pdfmake/src/printer','zip-dir','rimraf','../../mysqldb','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','hasOwnProperty','tableHeader','num','Empty','dirname','basename','.pdf','Setting','find','split','splitSizePdf','then','length','push','sequelize','query'];(function(_0x59b83d,_0x219677){var _0x24aff0=function(_0x2bbb90){while(--_0x2bbb90){_0x59b83d['push'](_0x59b83d['shift']());}};_0x24aff0(++_0x219677);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0d8b('0x0'));var fs=require('fs');var BPromise=require(_0x0d8b('0x1'));var util=require('util');var path=require('path');var moment=require('moment');var PdfPrinter=require(_0x0d8b('0x2'));var zipdir=require(_0x0d8b('0x3'));var rimraf=require(_0x0d8b('0x4'));var db=require(_0x0d8b('0x5'))['db'];var dbH=require(_0x0d8b('0x5'))['dbH'];var logger=require('../../config/logger')(_0x0d8b('0x6'));var EXTRACTED_REPORT_ID=Number(process[_0x0d8b('0x7')][0x2]);var QUERY=process[_0x0d8b('0x7')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0x0d8b('0x7')][0x5];var FORMAT=_0x0d8b('0x8');var _extractedReport;function analyticExtractedReport(_0x58e4e2,_0x129310){var _0x348e65={'status':_0x58e4e2};var _0x3b027f={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x129310){_0x348e65[_0x0d8b('0x9')]=_0x129310;}return db[_0x0d8b('0xa')][_0x0d8b('0xb')](_0x348e65,_0x3b027f);}function getHeader(_0x2c5e9e){var _0x28f87c=[];for(var _0x48fa16 in _0x2c5e9e){if(_0x2c5e9e[_0x0d8b('0xc')](_0x48fa16)){_0x28f87c['push']({'text':_0x48fa16,'style':_0x0d8b('0xd')});}}return _0x28f87c;}function extractReport(_0xc574a3){var _0x340cc4=0x1388;var _0x92cdd8;if(!_0xc574a3[0x0][_0x0d8b('0xe')]){return analyticExtractedReport(_0x0d8b('0xf'));}var _0x15dd0f=[];var _0x31a8cc=0x0;var _0x1d4bbc=!![];var _0x2ce75e=path[_0x0d8b('0x10')](PATH);var _0xe65334=path[_0x0d8b('0x11')](PATH,_0x0d8b('0x12'));var _0x4f6f21=![];var _0x23eb7b=[];return db[_0x0d8b('0x13')][_0x0d8b('0x14')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x0d8b('0x15'),_0x0d8b('0x16')]})['then'](function(_0x106a01){if(_0x106a01){_0x92cdd8=_0x106a01;_0x340cc4=_0x92cdd8[_0x0d8b('0x16')]||0x3e8;}})[_0x0d8b('0x17')](function(){if(_0xc574a3&&_0xc574a3[_0x0d8b('0x18')]){var _0x333674=_0xc574a3[0x0][_0x0d8b('0xe')]%(_0x31a8cc+_0x340cc4);if(_0x92cdd8[_0x0d8b('0x15')]){for(;_0x1d4bbc;_0x31a8cc+=_0x340cc4,_0x333674=_0xc574a3[0x0][_0x0d8b('0xe')]%(_0x31a8cc+_0x340cc4)){if(_0x333674==0x0||_0x333674==_0xc574a3[0x0]['num']){_0x1d4bbc=![];}_0x15dd0f[_0x0d8b('0x19')](dbH[_0x0d8b('0x1a')][_0x0d8b('0x1b')](util[_0x0d8b('0x1c')](_0x0d8b('0x1d'),QUERY,_0x340cc4,_0x31a8cc),{'type':dbH[_0x0d8b('0x1a')][_0x0d8b('0x1e')][_0x0d8b('0x1f')]}));}}else{_0x15dd0f['push'](dbH['sequelize'][_0x0d8b('0x1b')](QUERY,{'type':dbH['sequelize']['QueryTypes']['SELECT']}));}}_0x4f6f21=_0x92cdd8[_0x0d8b('0x15')]&&_0x15dd0f[_0x0d8b('0x18')]>0x1;if(!fs[_0x0d8b('0x20')](path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334))&&_0x4f6f21){fs[_0x0d8b('0x22')](path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334));}return BPromise[_0x0d8b('0x23')](_0x15dd0f,function(_0x4562cb){_0x23eb7b[_0x0d8b('0x19')](_0x4562cb);});})['then'](function(){return BPromise[_0x0d8b('0x23')](_0x15dd0f,function(_0x4463ee,_0x5363e3){var _0xe1ef20;var _0x4a0ae4=util[_0x0d8b('0x1c')](_0x0d8b('0x24'),NAME,_extractedReport[_0x0d8b('0x25')],moment(_extractedReport['startDate'])['format'](FORMAT),moment(_extractedReport[_0x0d8b('0x26')])[_0x0d8b('0x1c')](FORMAT));var _0x4c05ee={'pageSize':'A4','pageOrientation':_0x0d8b('0x27'),'content':[{'text':_0x4a0ae4,'style':'header'}],'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x0d8b('0x28')}}};var _0x4b59e5={'headerRows':0x1,'body':[]};_0x4b59e5[_0x0d8b('0x29')]['push'](getHeader(_0x4463ee[0x0]));var _0x2ab00d;for(var _0x546bf6=0x0;_0x546bf6<_0x4463ee[_0x0d8b('0x18')];_0x546bf6+=0x1){_0x2ab00d=[];for(var _0x544735 in _0x4463ee[_0x546bf6]){if(_0x4463ee[_0x546bf6][_0x0d8b('0xc')](_0x544735)){_0x2ab00d[_0x0d8b('0x19')](_0x4463ee[_0x546bf6][_0x544735]?_[_0x0d8b('0x2a')](_0x4463ee[_0x546bf6][_0x544735]):'');}}_0x4b59e5['body']['push'](_0x2ab00d);}_0x4c05ee['content'][_0x0d8b('0x19')]({'table':_0x4b59e5});return new BPromise(function(_0x5515d2,_0x3cdf3c){var _0x54f6f3=new PdfPrinter({'Roboto':{'normal':__dirname+'/fonts/Roboto-Regular.ttf','bold':__dirname+_0x0d8b('0x2b'),'italics':__dirname+_0x0d8b('0x2c'),'bolditalics':__dirname+_0x0d8b('0x2d')}});var _0xdeee5d=_0x54f6f3[_0x0d8b('0x2e')](_0x4c05ee);if(_0x4f6f21){_0xe1ef20=path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334,util[_0x0d8b('0x1c')](_0x0d8b('0x2f'),_0xe65334,_0x5363e3,'pdf'));}else{_0xe1ef20=path[_0x0d8b('0x21')](_0x2ce75e,util[_0x0d8b('0x1c')]('%s.%s',_0xe65334,_0x0d8b('0x30')));}var _0x23f7f6=_0xdeee5d[_0x0d8b('0x31')](fs['createWriteStream'](_0xe1ef20));_0x23f7f6['on'](_0x0d8b('0x32'),function(){_0x5515d2();});_0x23f7f6['on'](_0x0d8b('0x33'),function(_0x206157){console[_0x0d8b('0x34')](_0x0d8b('0x35'),_0x206157);_0x3cdf3c(_0x206157);});_0xdeee5d['end']();});});})[_0x0d8b('0x17')](function(){if(_0x4f6f21){return new BPromise(function(_0x1649fc,_0x5ad0fe){zipdir(path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334),{'saveTo':path[_0x0d8b('0x21')](_0x2ce75e,util[_0x0d8b('0x1c')](_0x0d8b('0x36'),_0xe65334,_0x0d8b('0x37')))},function(_0x519088){if(_0x519088){_0x5ad0fe(_0x519088);}else{_0x1649fc();}});});}})['then'](function(){if(_0x4f6f21){rimraf(path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334),function(){});}})['then'](function(){logger['info'](util[_0x0d8b('0x1c')](_0x0d8b('0x38'),EXTRACTED_REPORT_ID,_0x0d8b('0x39')));return analyticExtractedReport(_0x0d8b('0x3a'),_0x4f6f21?util[_0x0d8b('0x1c')](_0x0d8b('0x36'),_0xe65334,_0x4f6f21?'zip':_0x0d8b('0x30')):null);});}function main(){logger[_0x0d8b('0x3b')](util[_0x0d8b('0x1c')](_0x0d8b('0x3c'),EXTRACTED_REPORT_ID,_0x0d8b('0x3d')));return db[_0x0d8b('0xa')][_0x0d8b('0x3e')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x1d06b6){_extractedReport=_0x1d06b6;return dbH[_0x0d8b('0x1a')][_0x0d8b('0x1b')](util[_0x0d8b('0x1c')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x0d8b('0x1a')]['QueryTypes'][_0x0d8b('0x1f')]});})[_0x0d8b('0x17')](extractReport)[_0x0d8b('0x3f')](function(_0x26ac10){logger[_0x0d8b('0x3b')](util[_0x0d8b('0x1c')](_0x0d8b('0x40'),EXTRACTED_REPORT_ID,_0x0d8b('0x3d')),util[_0x0d8b('0x41')](_0x26ac10,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x0d8b('0x42'));});}main(); \ No newline at end of file +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(_0x27a3d6,_0xa0cbc8){var _0x138268=function(_0x431b15){while(--_0x431b15){_0x27a3d6['push'](_0x27a3d6['shift']());}};_0x138268(++_0xa0cbc8);}(_0xb10b,0x12a));var _0xbb10=function(_0x4d2aea,_0x4a8f11){_0x4d2aea=_0x4d2aea-0x0;var _0x1715b8=_0xb10b[_0x4d2aea];return _0x1715b8;};'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 af8e73c..f57808a 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 _0x3189=['zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','split','splitSizeXlsx','then','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','push','query','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','.xlsx','join','mkdirSync','each','length','%s.%s','xlsx','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','lodash','json2xls','bluebird'];(function(_0x1601ba,_0x3a6377){var _0x40ffbd=function(_0x13517f){while(--_0x13517f){_0x1601ba['push'](_0x1601ba['shift']());}};_0x40ffbd(++_0x3a6377);}(_0x3189,0x19a));var _0x9318=function(_0x248fd6,_0x489ba5){_0x248fd6=_0x248fd6-0x0;var _0x37a548=_0x3189[_0x248fd6];return _0x37a548;};'use strict';var util=require(_0x9318('0x0'));var path=require('path');var _=require(_0x9318('0x1'));var fs=require('fs');var json2xls=require(_0x9318('0x2'));var BPromise=require(_0x9318('0x3'));var zipdir=require(_0x9318('0x4'));var rimraf=require(_0x9318('0x5'));var db=require('../../mysqldb')['db'];var dbH=require(_0x9318('0x6'))[_0x9318('0x7')];var logger=require(_0x9318('0x8'))(_0x9318('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0x9318('0xa')][0x2]);var QUERY=process[_0x9318('0xa')][0x3];var PATH=process['argv'][0x4];function analyticExtractedReport(_0x406c79,_0x47cc66){var _0x582fe9={'status':_0x406c79};var _0x2deb10={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x47cc66){_0x582fe9[_0x9318('0xb')]=_0x47cc66;}return db['AnalyticExtractedReport'][_0x9318('0xc')](_0x582fe9,_0x2deb10);}function main(){var _0xbf34cf=0x1388;var _0x194853;logger[_0x9318('0xd')](util[_0x9318('0xe')](_0x9318('0xf'),EXTRACTED_REPORT_ID,_0x9318('0x10')));return db[_0x9318('0x11')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x9318('0x12'),_0x9318('0x13')]})[_0x9318('0x14')](function(_0xbb9434){if(_0xbb9434){_0x194853=_0xbb9434;_0xbf34cf=_0x194853[_0x9318('0x13')]||0x1388;}})[_0x9318('0x14')](function(){return dbH[_0x9318('0x15')]['query'](util['format'](_0x9318('0x16'),QUERY),{'type':dbH[_0x9318('0x15')][_0x9318('0x17')][_0x9318('0x18')]});})[_0x9318('0x14')](function(_0x296844){if(!_0x296844[0x0][_0x9318('0x19')]){return analyticExtractedReport(_0x9318('0x1a'));}var _0x15dc1f=[];var _0x330dad=0x0;var _0x9cecf8=!![];if(_0x194853[_0x9318('0x12')]){if(_0x296844&&_0x296844['length']){var _0x1c66d2=_0x296844[0x0]['num']%(_0x330dad+_0xbf34cf);for(;_0x9cecf8;_0x330dad+=_0xbf34cf,_0x1c66d2=_0x296844[0x0]['num']%(_0x330dad+_0xbf34cf)){if(_0x1c66d2==0x0||_0x1c66d2==_0x296844[0x0][_0x9318('0x19')]){_0x9cecf8=![];}_0x15dc1f[_0x9318('0x1b')](dbH[_0x9318('0x15')][_0x9318('0x1c')](util['format'](_0x9318('0x1d'),QUERY,_0xbf34cf,_0x330dad),{'type':dbH[_0x9318('0x15')]['QueryTypes'][_0x9318('0x18')]}));}}}else{_0x15dc1f[_0x9318('0x1b')](dbH[_0x9318('0x15')][_0x9318('0x1c')](QUERY,{'type':dbH[_0x9318('0x15')][_0x9318('0x17')][_0x9318('0x18')]}));}var _0x5d8ac5=path[_0x9318('0x1e')](PATH);var _0x543921=path['basename'](PATH,_0x9318('0x1f'));var _0x28ad69=_0x194853[_0x9318('0x12')]&&_0x15dc1f['length']>0x1;var _0x1b6809=[];if(!fs['existsSync'](path[_0x9318('0x20')](_0x5d8ac5,_0x543921))&&_0x28ad69){fs[_0x9318('0x21')](path[_0x9318('0x20')](_0x5d8ac5,_0x543921));}return BPromise[_0x9318('0x22')](_0x15dc1f,function(_0x1741ce){_0x1b6809[_0x9318('0x1b')](_0x1741ce);})[_0x9318('0x14')](function(){for(var _0x291793=0x0;_0x291793<_0x1b6809[_0x9318('0x23')];_0x291793+=0x1){var _0x30f2ce;var _0x21e25f=_0x1b6809[_0x291793];if(_0x28ad69){_0x30f2ce=path[_0x9318('0x20')](_0x5d8ac5,_0x543921,util[_0x9318('0xe')]('%s%d.%s',_0x543921,_0x291793,'xlsx'));}else{_0x30f2ce=path['join'](_0x5d8ac5,util[_0x9318('0xe')](_0x9318('0x24'),_0x543921,_0x9318('0x25')));}fs[_0x9318('0x26')](_0x30f2ce,json2xls(_0x21e25f),'binary');}})[_0x9318('0x14')](function(){if(_0x28ad69){zipdir(path[_0x9318('0x20')](_0x5d8ac5,_0x543921),{'saveTo':path[_0x9318('0x20')](_0x5d8ac5,util[_0x9318('0xe')]('%s.%s',_0x543921,_0x9318('0x27')))},function(_0x4b66c0,_0x2e3e89){});rimraf(path[_0x9318('0x20')](_0x5d8ac5,_0x543921),function(){});}})['then'](function(){logger['info'](util['format'](_0x9318('0x28'),EXTRACTED_REPORT_ID,_0x9318('0x10')));return analyticExtractedReport(_0x9318('0x29'),_0x28ad69?util[_0x9318('0xe')](_0x9318('0x24'),_0x543921,_0x28ad69?_0x9318('0x27'):'xlsx'):null);});})[_0x9318('0x2a')](function(_0x568b6c){logger['info'](util['format'](_0x9318('0x2b'),EXTRACTED_REPORT_ID,_0x9318('0x10')),util[_0x9318('0x2c')](_0x568b6c,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x9318('0x2d'));});}main(); \ No newline at end of file +var _0x9648=['Setting','find','split','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','num','Empty','length','push','SELECT','basename','.xlsx','join','mkdirSync','%s%d.%s','xlsx','%s.%s','writeFileSync','binary','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','util','lodash','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX'];(function(_0x468be0,_0x50b945){var _0x3c71ec=function(_0x40ad7c){while(--_0x40ad7c){_0x468be0['push'](_0x468be0['shift']());}};_0x3c71ec(++_0x50b945);}(_0x9648,0xa4));var _0x8964=function(_0x47ef86,_0x49f0fb){_0x47ef86=_0x47ef86-0x0;var _0x58c2d1=_0x9648[_0x47ef86];return _0x58c2d1;};'use strict';var util=require(_0x8964('0x0'));var path=require('path');var _=require(_0x8964('0x1'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0x8964('0x2'));var zipdir=require(_0x8964('0x3'));var rimraf=require(_0x8964('0x4'));var db=require(_0x8964('0x5'))['db'];var dbH=require('../../mysqldb')[_0x8964('0x6')];var logger=require(_0x8964('0x7'))(_0x8964('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0x8964('0x9')][0x2]);var QUERY=process[_0x8964('0x9')][0x3];var PATH=process[_0x8964('0x9')][0x4];function analyticExtractedReport(_0x54fea9,_0x13b24f){var _0x11bf9a={'status':_0x54fea9};var _0x4a04b7={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x13b24f){_0x11bf9a[_0x8964('0xa')]=_0x13b24f;}return db['AnalyticExtractedReport'][_0x8964('0xb')](_0x11bf9a,_0x4a04b7);}function main(){var _0x5ef044=0x1388;var _0x72b40e;logger[_0x8964('0xc')](util[_0x8964('0xd')](_0x8964('0xe'),EXTRACTED_REPORT_ID,_0x8964('0xf')));return db[_0x8964('0x10')][_0x8964('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x8964('0x12'),_0x8964('0x13')]})[_0x8964('0x14')](function(_0x223bdf){if(_0x223bdf){_0x72b40e=_0x223bdf;_0x5ef044=_0x72b40e[_0x8964('0x13')]||0x1388;}})[_0x8964('0x14')](function(){return dbH[_0x8964('0x15')][_0x8964('0x16')](util[_0x8964('0xd')](_0x8964('0x17'),QUERY),{'type':dbH[_0x8964('0x15')][_0x8964('0x18')]['SELECT']});})[_0x8964('0x14')](function(_0x1a67c1){if(!_0x1a67c1[0x0][_0x8964('0x19')]){return analyticExtractedReport(_0x8964('0x1a'));}var _0x59b3da=[];var _0x22e15f=0x0;var _0x571075=!![];if(_0x72b40e['split']){if(_0x1a67c1&&_0x1a67c1[_0x8964('0x1b')]){var _0x44ef82=_0x1a67c1[0x0][_0x8964('0x19')]%(_0x22e15f+_0x5ef044);for(;_0x571075;_0x22e15f+=_0x5ef044,_0x44ef82=_0x1a67c1[0x0][_0x8964('0x19')]%(_0x22e15f+_0x5ef044)){if(_0x44ef82==0x0||_0x44ef82==_0x1a67c1[0x0][_0x8964('0x19')]){_0x571075=![];}_0x59b3da[_0x8964('0x1c')](dbH[_0x8964('0x15')][_0x8964('0x16')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x5ef044,_0x22e15f),{'type':dbH['sequelize'][_0x8964('0x18')][_0x8964('0x1d')]}));}}}else{_0x59b3da[_0x8964('0x1c')](dbH[_0x8964('0x15')][_0x8964('0x16')](QUERY,{'type':dbH[_0x8964('0x15')][_0x8964('0x18')][_0x8964('0x1d')]}));}var _0x234405=path['dirname'](PATH);var _0x315d24=path[_0x8964('0x1e')](PATH,_0x8964('0x1f'));var _0x159286=_0x72b40e[_0x8964('0x12')]&&_0x59b3da[_0x8964('0x1b')]>0x1;var _0xd0d0fe=[];if(!fs['existsSync'](path[_0x8964('0x20')](_0x234405,_0x315d24))&&_0x159286){fs[_0x8964('0x21')](path[_0x8964('0x20')](_0x234405,_0x315d24));}return BPromise['each'](_0x59b3da,function(_0x5bfcb6){_0xd0d0fe[_0x8964('0x1c')](_0x5bfcb6);})[_0x8964('0x14')](function(){for(var _0x81b509=0x0;_0x81b509<_0xd0d0fe[_0x8964('0x1b')];_0x81b509+=0x1){var _0xa73997;var _0x4555ca=_0xd0d0fe[_0x81b509];if(_0x159286){_0xa73997=path[_0x8964('0x20')](_0x234405,_0x315d24,util[_0x8964('0xd')](_0x8964('0x22'),_0x315d24,_0x81b509,_0x8964('0x23')));}else{_0xa73997=path[_0x8964('0x20')](_0x234405,util[_0x8964('0xd')](_0x8964('0x24'),_0x315d24,_0x8964('0x23')));}fs[_0x8964('0x25')](_0xa73997,json2xls(_0x4555ca),_0x8964('0x26'));}})['then'](function(){if(_0x159286){zipdir(path[_0x8964('0x20')](_0x234405,_0x315d24),{'saveTo':path[_0x8964('0x20')](_0x234405,util['format'](_0x8964('0x24'),_0x315d24,'zip'))},function(_0x33822a,_0x14ad40){});rimraf(path[_0x8964('0x20')](_0x234405,_0x315d24),function(){});}})['then'](function(){logger[_0x8964('0xc')](util[_0x8964('0xd')](_0x8964('0x27'),EXTRACTED_REPORT_ID,_0x8964('0xf')));return analyticExtractedReport(_0x8964('0x28'),_0x159286?util[_0x8964('0xd')](_0x8964('0x24'),_0x315d24,_0x159286?'zip':_0x8964('0x23')):null);});})[_0x8964('0x29')](function(_0x37ce2b){logger[_0x8964('0xc')](util['format'](_0x8964('0x2a'),EXTRACTED_REPORT_ID,_0x8964('0xf')),util[_0x8964('0x2b')](_0x37ce2b,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x8964('0x2c'));});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index d18d6e2..de1bf45 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 _0x5081=['context','VoiceExtensionId','outbound','CDR(destination)=','cutdigits','${EXTEN}','CDR(routeid)=','ExecIf','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','updatedAt','interval','*,*,*,*','IntervalId','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','last','concat','Hangup','transaction','destroy','sortBy','error','lodash','util','models','Interval','findAll','then','intervals','VoiceExtension','uniq','map','filter','exten','queue','playback','hasOwnProperty','priority','extensions','extension','push','type','Set','format'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5081,0x148));var _0x1508=function(_0x28709d,_0x4c2e79){_0x28709d=_0x28709d-0x0;var _0x13c317=_0x5081[_0x28709d];return _0x13c317;};'use strict';var _=require(_0x1508('0x0'));var util=require(_0x1508('0x1'));function rewrite(_0x3d56df,_0x578a19){var _0x2b637f=this;return _0x3d56df[_0x1508('0x2')][_0x1508('0x3')][_0x1508('0x4')]({'raw':!![]})[_0x1508('0x5')](function(_0x9a3746){_0x2b637f[_0x1508('0x6')]=_0x9a3746;return _0x3d56df[_0x1508('0x2')]['VoiceExtension'][_0x1508('0x4')]({'where':{'IntervalId':_0x578a19['IntervalId']},'raw':!![]});})[_0x1508('0x5')](function(_0x308003){return _0x3d56df[_0x1508('0x2')][_0x1508('0x7')][_0x1508('0x4')]({'where':{'exten':{'$in':_[_0x1508('0x8')](_[_0x1508('0x9')](_0x308003,'exten'))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0x1508('0x5')](function(_0x29aeab){var _0x5b03d8=_[_0x1508('0xa')](_0x29aeab,{'priority':'1'});var _0x3a0c07=_['filter'](_0x29aeab,{'isApp':0x1});var _0x174c34=_['groupBy'](_0x3a0c07,_0x1508('0xb'));var _0x3a47e4=[_0x1508('0xc'),_0x1508('0xd')];var _0x4cd713=[];var _0x8f028e=[];for(var _0x34e949 in _0x174c34){if(_0x174c34[_0x1508('0xe')](_0x34e949)){_0x2b637f[_0x1508('0xf')]=0x2;_0x2b637f[_0x1508('0x10')]=[];_0x2b637f[_0x1508('0x11')]=_['find'](_0x5b03d8,{'exten':_0x174c34[_0x34e949][0x0][_0x1508('0xb')]});_0x2b637f['extensions'][_0x1508('0x12')]({'type':_0x174c34[_0x34e949][0x0][_0x1508('0x13')],'app':_0x1508('0x14'),'appdata':util[_0x1508('0x15')]('CDR(type)=%s',_0x174c34[_0x34e949][0x0][_0x1508('0x13')]),'context':_0x174c34[_0x34e949][0x0][_0x1508('0x16')],'exten':_0x174c34[_0x34e949][0x0][_0x1508('0xb')],'priority':_0x2b637f[_0x1508('0xf')]++,'VoiceExtensionId':_0x174c34[_0x34e949][0x0][_0x1508('0x17')]});if(_0x174c34[_0x34e949][0x0][_0x1508('0x13')]===_0x1508('0x18')){if(_0x2b637f[_0x1508('0x11')]){_0x2b637f['extensions'][_0x1508('0x12')]({'type':_0x174c34[_0x34e949][0x0][_0x1508('0x13')],'app':_0x1508('0x14'),'appdata':_0x1508('0x19')+(_0x2b637f[_0x1508('0x11')][_0x1508('0x1a')]?'${EXTEN:'+_0x2b637f['extension'][_0x1508('0x1a')]+'}':_0x1508('0x1b')),'context':_0x174c34[_0x34e949][0x0][_0x1508('0x16')],'exten':_0x174c34[_0x34e949][0x0][_0x1508('0xb')],'priority':_0x2b637f[_0x1508('0xf')]++,'VoiceExtensionId':_0x174c34[_0x34e949][0x0]['VoiceExtensionId']});}_0x2b637f['extensions']['push']({'type':_0x174c34[_0x34e949][0x0][_0x1508('0x13')],'app':_0x1508('0x14'),'appdata':_0x1508('0x1c')+_0x174c34[_0x34e949][0x0][_0x1508('0x17')],'context':_0x174c34[_0x34e949][0x0][_0x1508('0x16')],'exten':_0x174c34[_0x34e949][0x0]['exten'],'priority':_0x2b637f[_0x1508('0xf')]++,'VoiceExtensionId':_0x174c34[_0x34e949][0x0][_0x1508('0x17')]});var _0x398501=_0x2b637f[_0x1508('0xf')]++;_0x2b637f[_0x1508('0x10')][_0x1508('0x12')]({'type':_0x174c34[_0x34e949][0x0]['type'],'app':_0x1508('0x1d'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x398501+0x2)+_0x1508('0x1e')+(_0x398501+0x1)+')','context':_0x174c34[_0x34e949][0x0][_0x1508('0x16')],'exten':_0x174c34[_0x34e949][0x0][_0x1508('0xb')],'priority':_0x398501,'VoiceExtensionId':_0x174c34[_0x34e949][0x0][_0x1508('0x17')]});if(_0x2b637f[_0x1508('0x11')]){_0x2b637f[_0x1508('0x10')][_0x1508('0x12')]({'type':_0x174c34[_0x34e949][0x0][_0x1508('0x13')],'app':_0x1508('0x14'),'appdata':_0x2b637f[_0x1508('0x11')]['cutdigits']?_0x1508('0x1f')+_0x2b637f[_0x1508('0x11')]['cutdigits']+'}':_0x1508('0x20'),'context':_0x174c34[_0x34e949][0x0][_0x1508('0x16')],'exten':_0x174c34[_0x34e949][0x0]['exten'],'priority':_0x2b637f[_0x1508('0xf')]++,'VoiceExtensionId':_0x174c34[_0x34e949][0x0][_0x1508('0x17')]});}_0x2b637f[_0x1508('0x10')][_0x1508('0x12')]({'type':_0x174c34[_0x34e949][0x0]['type'],'app':'Set','appdata':_0x1508('0x21')+_0x174c34[_0x34e949][0x0][_0x1508('0x17')],'context':_0x174c34[_0x34e949][0x0][_0x1508('0x16')],'exten':_0x174c34[_0x34e949][0x0][_0x1508('0xb')],'priority':_0x2b637f['priority']++,'VoiceExtensionId':_0x174c34[_0x34e949][0x0][_0x1508('0x17')]});if(_0x2b637f[_0x1508('0x11')]&&_0x2b637f[_0x1508('0x11')][_0x1508('0xe')](_0x1508('0x22'))&&_0x2b637f[_0x1508('0x11')]['recordingFormat']!==_0x1508('0x23')){_0x2b637f[_0x1508('0x10')][_0x1508('0x12')]({'type':_0x174c34[_0x34e949][0x0]['type'],'app':_0x1508('0x14'),'appdata':_0x1508('0x24'),'context':_0x174c34[_0x34e949][0x0][_0x1508('0x16')],'exten':_0x174c34[_0x34e949][0x0][_0x1508('0xb')],'priority':_0x2b637f['priority']++,'VoiceExtensionId':_0x174c34[_0x34e949][0x0]['VoiceExtensionId']});_0x2b637f[_0x1508('0x10')][_0x1508('0x12')]({'type':_0x174c34[_0x34e949][0x0][_0x1508('0x13')],'app':_0x1508('0x14'),'appdata':_0x1508('0x25')+_0x2b637f[_0x1508('0x11')][_0x1508('0x22')]||_0x1508('0x26'),'context':_0x174c34[_0x34e949][0x0]['context'],'exten':_0x174c34[_0x34e949][0x0][_0x1508('0xb')],'priority':_0x2b637f[_0x1508('0xf')]++,'VoiceExtensionId':_0x174c34[_0x34e949][0x0][_0x1508('0x17')]});}}_0x2b637f[_0x1508('0x10')]['push']({'type':_0x174c34[_0x34e949][0x0][_0x1508('0x13')],'app':_0x1508('0x14'),'appdata':_0x1508('0x27'),'context':_0x174c34[_0x34e949][0x0][_0x1508('0x16')],'exten':_0x174c34[_0x34e949][0x0][_0x1508('0xb')],'priority':_0x2b637f['priority']++,'VoiceExtensionId':_0x174c34[_0x34e949][0x0][_0x1508('0x17')]});_0x2b637f['extensions'][_0x1508('0x12')]({'type':_0x174c34[_0x34e949][0x0][_0x1508('0x13')],'app':_0x1508('0x14'),'appdata':_0x1508('0x28'),'context':_0x174c34[_0x34e949][0x0][_0x1508('0x16')],'exten':_0x174c34[_0x34e949][0x0]['exten'],'priority':_0x2b637f[_0x1508('0xf')]++,'VoiceExtensionId':_0x174c34[_0x34e949][0x0][_0x1508('0x17')]});_0x2b637f[_0x1508('0x10')][_0x1508('0x12')]({'type':_0x174c34[_0x34e949][0x0][_0x1508('0x13')],'app':_0x1508('0x14'),'appdata':_0x1508('0x29'),'context':_0x174c34[_0x34e949][0x0]['context'],'exten':_0x174c34[_0x34e949][0x0][_0x1508('0xb')],'priority':_0x2b637f[_0x1508('0xf')]++,'VoiceExtensionId':_0x174c34[_0x34e949][0x0][_0x1508('0x17')]});for(var _0x5a3c89=0x0,_0x1dbf41=0x0;_0x5a3c89<_0x174c34[_0x34e949][_0x1508('0x2a')];_0x5a3c89+=0x1,_0x1dbf41=0x0){var _0x5a2527=_0x174c34[_0x34e949][_0x5a3c89];if(_0x5a2527[_0x1508('0x13')]){_0x5a2527[_0x1508('0x13')]=_0x5a2527[_0x1508('0x13')][_0x1508('0x2b')]();}var _0x195ec6=[];var _0x5bc063=[];delete _0x5a2527['id'];delete _0x5a2527['createdAt'];delete _0x5a2527[_0x1508('0x2c')];var _0xae9be7=_0x5a2527[_0x1508('0x2d')]!==_0x1508('0x2e')?[_0x5a2527[_0x1508('0x2d')]]:_0x5a2527[_0x1508('0x2f')]?_[_0x1508('0x9')](_[_0x1508('0xa')](_0x2b637f[_0x1508('0x6')],{'IntervalId':_0x5a2527[_0x1508('0x2f')]}),_0x1508('0x2d')):[];if(_0x5a2527[_0x1508('0xe')](_0x1508('0x30'))){if(_0x5a2527[_0x1508('0x30')]&&_0x5a2527['tag']!=='--'){_0x195ec6[_0x1508('0x12')]({'type':_0x5a2527['type'],'app':'Set','appdata':_0x1508('0x31')+_0x5a2527['tag'],'context':_0x5a2527[_0x1508('0x16')],'exten':_0x5a2527['exten'],'priority':_0xae9be7[_0x1508('0x2a')]+_0x2b637f[_0x1508('0xf')]+_0x1dbf41++,'VoiceExtensionId':_0x5a2527['VoiceExtensionId']});}}if(_0x5a2527[_0x1508('0x13')]===_0x1508('0x18')&&_0x5a2527[_0x1508('0xe')](_0x1508('0x32'))){if(_0x5a2527[_0x1508('0x32')]){_0x195ec6[_0x1508('0x12')]({'type':_0x5a2527[_0x1508('0x13')],'app':_0x1508('0x1d'),'appdata':_0x1508('0x33')+_0x5a2527[_0x1508('0x32')]+')','context':_0x5a2527['context'],'exten':_0x5a2527[_0x1508('0xb')],'priority':_0xae9be7[_0x1508('0x2a')]+_0x2b637f[_0x1508('0xf')]+_0x1dbf41++,'VoiceExtensionId':_0x5a2527[_0x1508('0x17')]});}else{_0x195ec6[_0x1508('0x12')]({'type':_0x5a2527['type'],'app':_0x1508('0x1d'),'appdata':_0x1508('0x34'),'context':_0x5a2527[_0x1508('0x16')],'exten':_0x5a2527[_0x1508('0xb')],'priority':_0xae9be7[_0x1508('0x2a')]+_0x2b637f[_0x1508('0xf')]+_0x1dbf41++,'VoiceExtensionId':_0x5a2527['VoiceExtensionId']});}}if(_0x5a2527[_0x1508('0xe')](_0x1508('0x35'))){if(_0x3a47e4[_0x1508('0x36')](_0x5a2527['app']['toLowerCase']())>=0x0&&_0x5a2527[_0x1508('0x37')]!==_0x1508('0x38')){if(_0x5a2527['answer']){_0x195ec6[_0x1508('0x12')]({'type':_0x5a2527[_0x1508('0x13')],'app':_0x1508('0x1d'),'appdata':_0x1508('0x39'),'context':_0x5a2527['context'],'exten':_0x5a2527['exten'],'priority':_0xae9be7['length']+_0x2b637f[_0x1508('0xf')]+_0x1dbf41++,'VoiceExtensionId':_0x5a2527[_0x1508('0x17')]});_0x195ec6[_0x1508('0x12')]({'type':_0x5a2527[_0x1508('0x13')],'app':_0x1508('0x14'),'appdata':_0x1508('0x3a'),'context':_0x5a2527[_0x1508('0x16')],'exten':_0x5a2527['exten'],'priority':_0xae9be7[_0x1508('0x2a')]+_0x2b637f[_0x1508('0xf')]+_0x1dbf41++,'VoiceExtensionId':_0x5a2527[_0x1508('0x17')]});}else{_0x195ec6[_0x1508('0x12')]({'type':_0x5a2527[_0x1508('0x13')],'app':_0x1508('0x1d'),'appdata':_0x1508('0x3b'),'context':_0x5a2527['context'],'exten':_0x5a2527[_0x1508('0xb')],'priority':_0xae9be7[_0x1508('0x2a')]+_0x2b637f['priority']+_0x1dbf41++,'VoiceExtensionId':_0x5a2527[_0x1508('0x17')]});_0x195ec6[_0x1508('0x12')]({'type':_0x5a2527[_0x1508('0x13')],'app':_0x1508('0x14'),'appdata':_0x1508('0x3c'),'context':_0x5a2527[_0x1508('0x16')],'exten':_0x5a2527[_0x1508('0xb')],'priority':_0xae9be7[_0x1508('0x2a')]+_0x2b637f[_0x1508('0xf')]+_0x1dbf41++,'VoiceExtensionId':_0x5a2527[_0x1508('0x17')]});}}}for(var _0x52e813=0x0;_0x52e813<_0xae9be7['length'];_0x52e813+=0x1){var _0x594384=_0x2b637f[_0x1508('0xf')]+_0xae9be7[_0x1508('0x2a')];var _0xb97752=_0x52e813===_0xae9be7[_0x1508('0x2a')]-0x1?_0x2b637f[_0x1508('0xf')]+_0x195ec6[_0x1508('0x2a')]+_0x5bc063[_0x1508('0x2a')]+0x2:_0x2b637f[_0x1508('0xf')]+_0x52e813+0x1;_0x195ec6[_0x1508('0x3d')](_0x52e813,0x0,{'type':_0x5a2527[_0x1508('0x13')],'app':'GotoIfTime','appdata':_0xae9be7[_0x52e813]+'?'+_0x5a2527[_0x1508('0x16')]+_0x1508('0x3e')+_0x594384+':'+_0x5a2527[_0x1508('0x16')]+',${EXTEN},'+_0xb97752,'exten':_0x5a2527[_0x1508('0xb')],'context':_0x5a2527[_0x1508('0x16')],'priority':_0x2b637f[_0x1508('0xf')]+_0x52e813,'VoiceExtensionId':_0x174c34[_0x34e949][0x0][_0x1508('0x17')]});}_0x5a2527[_0x1508('0xf')]=_0x195ec6[_0x1508('0x2a')]?_[_0x1508('0x3f')](_0x195ec6)[_0x1508('0xf')]+0x1:_0x2b637f[_0x1508('0xf')];_0x2b637f[_0x1508('0xf')]=(_0x5bc063[_0x1508('0x2a')]?_[_0x1508('0x3f')](_0x5bc063)[_0x1508('0xf')]:_0x5a2527[_0x1508('0xf')])+0x1;_0x2b637f[_0x1508('0x10')]=_[_0x1508('0x40')](_0x2b637f[_0x1508('0x10')],_0x195ec6,[_0x5a2527],_0x5bc063);}_0x2b637f[_0x1508('0x10')][_0x1508('0x12')]({'type':_0x174c34[_0x34e949][0x0][_0x1508('0x13')],'app':_0x1508('0x41'),'exten':_0x174c34[_0x34e949][0x0][_0x1508('0xb')],'context':_0x174c34[_0x34e949][0x0][_0x1508('0x16')],'priority':_0x2b637f[_0x1508('0xf')],'VoiceExtensionId':_0x174c34[_0x34e949][0x0][_0x1508('0x17')]});_0x4cd713[_0x1508('0x12')](_0x174c34[_0x34e949][0x0]['VoiceExtensionId']);_0x8f028e=_[_0x1508('0x40')](_0x8f028e,_0x2b637f[_0x1508('0x10')]);}}return _0x3d56df[_0x1508('0x42')](function(_0x54a7bc){return _0x3d56df[_0x1508('0x2')][_0x1508('0x7')][_0x1508('0x43')]({'where':{'VoiceExtensionId':{'$in':_0x4cd713}},'transaction':_0x54a7bc})[_0x1508('0x5')](function(_0x1c4d56){return _0x3d56df[_0x1508('0x2')]['VoiceExtension']['bulkCreate'](_[_0x1508('0x44')](_0x8f028e,_0x1508('0xf')),{'transaction':_0x54a7bc});});});})['catch'](function(_0x1e4ad7){console[_0x1508('0x45')](_0x1e4ad7);});}exports['rewrite']=rewrite; \ No newline at end of file +var _0x1aee=['intervals','VoiceExtension','map','filter','groupBy','exten','queue','playback','hasOwnProperty','priority','extensions','extension','find','push','type','Set','CDR(type)=%s','VoiceExtensionId','outbound','CDR(destination)=','${EXTEN:','${EXTEN}','CDR(routeid)=','context','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','cutdigits','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','toLowerCase','interval','*,*,*,*','IntervalId','tag','length','callerID','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','app','appType','custom','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','Hangup','concat','transaction','destroy','bulkCreate','sortBy','catch','rewrite','lodash','util','models','Interval','then'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x1aee,0x1d0));var _0xe1ae=function(_0x28a5ad,_0x520afa){_0x28a5ad=_0x28a5ad-0x0;var _0x176b8a=_0x1aee[_0x28a5ad];return _0x176b8a;};'use strict';var _=require(_0xe1ae('0x0'));var util=require(_0xe1ae('0x1'));function rewrite(_0x37c04f,_0x492dd7){var _0x251e3e=this;return _0x37c04f[_0xe1ae('0x2')][_0xe1ae('0x3')]['findAll']({'raw':!![]})[_0xe1ae('0x4')](function(_0x5d2e12){_0x251e3e[_0xe1ae('0x5')]=_0x5d2e12;return _0x37c04f['models'][_0xe1ae('0x6')]['findAll']({'where':{'IntervalId':_0x492dd7['IntervalId']},'raw':!![]});})[_0xe1ae('0x4')](function(_0x2f8651){return _0x37c04f[_0xe1ae('0x2')][_0xe1ae('0x6')]['findAll']({'where':{'exten':{'$in':_['uniq'](_[_0xe1ae('0x7')](_0x2f8651,'exten'))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0xe1ae('0x4')](function(_0x5d0780){var _0x1e95e4=_[_0xe1ae('0x8')](_0x5d0780,{'priority':'1'});var _0x53d009=_['filter'](_0x5d0780,{'isApp':0x1});var _0x393b98=_[_0xe1ae('0x9')](_0x53d009,_0xe1ae('0xa'));var _0x240434=[_0xe1ae('0xb'),_0xe1ae('0xc')];var _0x590f78=[];var _0x25f7c5=[];for(var _0x4915f5 in _0x393b98){if(_0x393b98[_0xe1ae('0xd')](_0x4915f5)){_0x251e3e[_0xe1ae('0xe')]=0x2;_0x251e3e[_0xe1ae('0xf')]=[];_0x251e3e[_0xe1ae('0x10')]=_[_0xe1ae('0x11')](_0x1e95e4,{'exten':_0x393b98[_0x4915f5][0x0]['exten']});_0x251e3e[_0xe1ae('0xf')][_0xe1ae('0x12')]({'type':_0x393b98[_0x4915f5][0x0][_0xe1ae('0x13')],'app':_0xe1ae('0x14'),'appdata':util['format'](_0xe1ae('0x15'),_0x393b98[_0x4915f5][0x0][_0xe1ae('0x13')]),'context':_0x393b98[_0x4915f5][0x0]['context'],'exten':_0x393b98[_0x4915f5][0x0]['exten'],'priority':_0x251e3e['priority']++,'VoiceExtensionId':_0x393b98[_0x4915f5][0x0][_0xe1ae('0x16')]});if(_0x393b98[_0x4915f5][0x0][_0xe1ae('0x13')]===_0xe1ae('0x17')){if(_0x251e3e[_0xe1ae('0x10')]){_0x251e3e[_0xe1ae('0xf')][_0xe1ae('0x12')]({'type':_0x393b98[_0x4915f5][0x0][_0xe1ae('0x13')],'app':_0xe1ae('0x14'),'appdata':_0xe1ae('0x18')+(_0x251e3e['extension']['cutdigits']?_0xe1ae('0x19')+_0x251e3e['extension']['cutdigits']+'}':_0xe1ae('0x1a')),'context':_0x393b98[_0x4915f5][0x0]['context'],'exten':_0x393b98[_0x4915f5][0x0]['exten'],'priority':_0x251e3e['priority']++,'VoiceExtensionId':_0x393b98[_0x4915f5][0x0]['VoiceExtensionId']});}_0x251e3e[_0xe1ae('0xf')][_0xe1ae('0x12')]({'type':_0x393b98[_0x4915f5][0x0]['type'],'app':_0xe1ae('0x14'),'appdata':_0xe1ae('0x1b')+_0x393b98[_0x4915f5][0x0][_0xe1ae('0x16')],'context':_0x393b98[_0x4915f5][0x0][_0xe1ae('0x1c')],'exten':_0x393b98[_0x4915f5][0x0][_0xe1ae('0xa')],'priority':_0x251e3e[_0xe1ae('0xe')]++,'VoiceExtensionId':_0x393b98[_0x4915f5][0x0][_0xe1ae('0x16')]});var _0x506789=_0x251e3e[_0xe1ae('0xe')]++;_0x251e3e[_0xe1ae('0xf')][_0xe1ae('0x12')]({'type':_0x393b98[_0x4915f5][0x0]['type'],'app':'ExecIf','appdata':_0xe1ae('0x1d')+(_0x506789+0x2)+_0xe1ae('0x1e')+(_0x506789+0x1)+')','context':_0x393b98[_0x4915f5][0x0][_0xe1ae('0x1c')],'exten':_0x393b98[_0x4915f5][0x0][_0xe1ae('0xa')],'priority':_0x506789,'VoiceExtensionId':_0x393b98[_0x4915f5][0x0][_0xe1ae('0x16')]});if(_0x251e3e[_0xe1ae('0x10')]){_0x251e3e['extensions'][_0xe1ae('0x12')]({'type':_0x393b98[_0x4915f5][0x0]['type'],'app':_0xe1ae('0x14'),'appdata':_0x251e3e[_0xe1ae('0x10')][_0xe1ae('0x1f')]?_0xe1ae('0x20')+_0x251e3e[_0xe1ae('0x10')][_0xe1ae('0x1f')]+'}':_0xe1ae('0x21'),'context':_0x393b98[_0x4915f5][0x0][_0xe1ae('0x1c')],'exten':_0x393b98[_0x4915f5][0x0][_0xe1ae('0xa')],'priority':_0x251e3e[_0xe1ae('0xe')]++,'VoiceExtensionId':_0x393b98[_0x4915f5][0x0][_0xe1ae('0x16')]});}_0x251e3e[_0xe1ae('0xf')]['push']({'type':_0x393b98[_0x4915f5][0x0][_0xe1ae('0x13')],'app':_0xe1ae('0x14'),'appdata':_0xe1ae('0x22')+_0x393b98[_0x4915f5][0x0]['VoiceExtensionId'],'context':_0x393b98[_0x4915f5][0x0]['context'],'exten':_0x393b98[_0x4915f5][0x0][_0xe1ae('0xa')],'priority':_0x251e3e['priority']++,'VoiceExtensionId':_0x393b98[_0x4915f5][0x0][_0xe1ae('0x16')]});if(_0x251e3e['extension']&&_0x251e3e[_0xe1ae('0x10')][_0xe1ae('0xd')](_0xe1ae('0x23'))&&_0x251e3e['extension'][_0xe1ae('0x23')]!==_0xe1ae('0x24')){_0x251e3e['extensions'][_0xe1ae('0x12')]({'type':_0x393b98[_0x4915f5][0x0][_0xe1ae('0x13')],'app':_0xe1ae('0x14'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x393b98[_0x4915f5][0x0]['context'],'exten':_0x393b98[_0x4915f5][0x0][_0xe1ae('0xa')],'priority':_0x251e3e[_0xe1ae('0xe')]++,'VoiceExtensionId':_0x393b98[_0x4915f5][0x0]['VoiceExtensionId']});_0x251e3e[_0xe1ae('0xf')][_0xe1ae('0x12')]({'type':_0x393b98[_0x4915f5][0x0][_0xe1ae('0x13')],'app':_0xe1ae('0x14'),'appdata':_0xe1ae('0x25')+_0x251e3e[_0xe1ae('0x10')][_0xe1ae('0x23')]||_0xe1ae('0x26'),'context':_0x393b98[_0x4915f5][0x0][_0xe1ae('0x1c')],'exten':_0x393b98[_0x4915f5][0x0][_0xe1ae('0xa')],'priority':_0x251e3e[_0xe1ae('0xe')]++,'VoiceExtensionId':_0x393b98[_0x4915f5][0x0][_0xe1ae('0x16')]});}}_0x251e3e[_0xe1ae('0xf')]['push']({'type':_0x393b98[_0x4915f5][0x0][_0xe1ae('0x13')],'app':_0xe1ae('0x14'),'appdata':_0xe1ae('0x27'),'context':_0x393b98[_0x4915f5][0x0][_0xe1ae('0x1c')],'exten':_0x393b98[_0x4915f5][0x0][_0xe1ae('0xa')],'priority':_0x251e3e[_0xe1ae('0xe')]++,'VoiceExtensionId':_0x393b98[_0x4915f5][0x0][_0xe1ae('0x16')]});_0x251e3e[_0xe1ae('0xf')][_0xe1ae('0x12')]({'type':_0x393b98[_0x4915f5][0x0][_0xe1ae('0x13')],'app':_0xe1ae('0x14'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x393b98[_0x4915f5][0x0]['context'],'exten':_0x393b98[_0x4915f5][0x0][_0xe1ae('0xa')],'priority':_0x251e3e[_0xe1ae('0xe')]++,'VoiceExtensionId':_0x393b98[_0x4915f5][0x0][_0xe1ae('0x16')]});_0x251e3e[_0xe1ae('0xf')][_0xe1ae('0x12')]({'type':_0x393b98[_0x4915f5][0x0][_0xe1ae('0x13')],'app':_0xe1ae('0x14'),'appdata':_0xe1ae('0x28'),'context':_0x393b98[_0x4915f5][0x0][_0xe1ae('0x1c')],'exten':_0x393b98[_0x4915f5][0x0][_0xe1ae('0xa')],'priority':_0x251e3e[_0xe1ae('0xe')]++,'VoiceExtensionId':_0x393b98[_0x4915f5][0x0][_0xe1ae('0x16')]});for(var _0xe94b7=0x0,_0x3efbf9=0x0;_0xe94b7<_0x393b98[_0x4915f5]['length'];_0xe94b7+=0x1,_0x3efbf9=0x0){var _0xc97cdc=_0x393b98[_0x4915f5][_0xe94b7];if(_0xc97cdc[_0xe1ae('0x13')]){_0xc97cdc[_0xe1ae('0x13')]=_0xc97cdc[_0xe1ae('0x13')][_0xe1ae('0x29')]();}var _0x2bbdc4=[];var _0x5400d7=[];delete _0xc97cdc['id'];delete _0xc97cdc['createdAt'];delete _0xc97cdc['updatedAt'];var _0xe0bf2e=_0xc97cdc[_0xe1ae('0x2a')]!==_0xe1ae('0x2b')?[_0xc97cdc[_0xe1ae('0x2a')]]:_0xc97cdc[_0xe1ae('0x2c')]?_[_0xe1ae('0x7')](_[_0xe1ae('0x8')](_0x251e3e[_0xe1ae('0x5')],{'IntervalId':_0xc97cdc[_0xe1ae('0x2c')]}),_0xe1ae('0x2a')):[];if(_0xc97cdc['hasOwnProperty'](_0xe1ae('0x2d'))){if(_0xc97cdc[_0xe1ae('0x2d')]&&_0xc97cdc['tag']!=='--'){_0x2bbdc4[_0xe1ae('0x12')]({'type':_0xc97cdc[_0xe1ae('0x13')],'app':_0xe1ae('0x14'),'appdata':'CDR(tag)='+_0xc97cdc[_0xe1ae('0x2d')],'context':_0xc97cdc[_0xe1ae('0x1c')],'exten':_0xc97cdc[_0xe1ae('0xa')],'priority':_0xe0bf2e[_0xe1ae('0x2e')]+_0x251e3e['priority']+_0x3efbf9++,'VoiceExtensionId':_0xc97cdc[_0xe1ae('0x16')]});}}if(_0xc97cdc[_0xe1ae('0x13')]===_0xe1ae('0x17')&&_0xc97cdc['hasOwnProperty']('callerID')){if(_0xc97cdc[_0xe1ae('0x2f')]){_0x2bbdc4['push']({'type':_0xc97cdc['type'],'app':_0xe1ae('0x30'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0xc97cdc[_0xe1ae('0x2f')]+')','context':_0xc97cdc[_0xe1ae('0x1c')],'exten':_0xc97cdc[_0xe1ae('0xa')],'priority':_0xe0bf2e[_0xe1ae('0x2e')]+_0x251e3e['priority']+_0x3efbf9++,'VoiceExtensionId':_0xc97cdc[_0xe1ae('0x16')]});}else{_0x2bbdc4['push']({'type':_0xc97cdc[_0xe1ae('0x13')],'app':'ExecIf','appdata':_0xe1ae('0x31'),'context':_0xc97cdc[_0xe1ae('0x1c')],'exten':_0xc97cdc['exten'],'priority':_0xe0bf2e[_0xe1ae('0x2e')]+_0x251e3e[_0xe1ae('0xe')]+_0x3efbf9++,'VoiceExtensionId':_0xc97cdc['VoiceExtensionId']});}}if(_0xc97cdc[_0xe1ae('0xd')](_0xe1ae('0x32'))){if(_0x240434['indexOf'](_0xc97cdc[_0xe1ae('0x33')][_0xe1ae('0x29')]())>=0x0&&_0xc97cdc[_0xe1ae('0x34')]!==_0xe1ae('0x35')){if(_0xc97cdc[_0xe1ae('0x32')]){_0x2bbdc4[_0xe1ae('0x12')]({'type':_0xc97cdc[_0xe1ae('0x13')],'app':_0xe1ae('0x30'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0xc97cdc[_0xe1ae('0x1c')],'exten':_0xc97cdc['exten'],'priority':_0xe0bf2e[_0xe1ae('0x2e')]+_0x251e3e[_0xe1ae('0xe')]+_0x3efbf9++,'VoiceExtensionId':_0xc97cdc[_0xe1ae('0x16')]});_0x2bbdc4[_0xe1ae('0x12')]({'type':_0xc97cdc[_0xe1ae('0x13')],'app':_0xe1ae('0x14'),'appdata':_0xe1ae('0x36'),'context':_0xc97cdc[_0xe1ae('0x1c')],'exten':_0xc97cdc[_0xe1ae('0xa')],'priority':_0xe0bf2e['length']+_0x251e3e[_0xe1ae('0xe')]+_0x3efbf9++,'VoiceExtensionId':_0xc97cdc[_0xe1ae('0x16')]});}else{_0x2bbdc4[_0xe1ae('0x12')]({'type':_0xc97cdc[_0xe1ae('0x13')],'app':_0xe1ae('0x30'),'appdata':_0xe1ae('0x37'),'context':_0xc97cdc[_0xe1ae('0x1c')],'exten':_0xc97cdc['exten'],'priority':_0xe0bf2e[_0xe1ae('0x2e')]+_0x251e3e[_0xe1ae('0xe')]+_0x3efbf9++,'VoiceExtensionId':_0xc97cdc[_0xe1ae('0x16')]});_0x2bbdc4[_0xe1ae('0x12')]({'type':_0xc97cdc[_0xe1ae('0x13')],'app':_0xe1ae('0x14'),'appdata':_0xe1ae('0x38'),'context':_0xc97cdc[_0xe1ae('0x1c')],'exten':_0xc97cdc[_0xe1ae('0xa')],'priority':_0xe0bf2e[_0xe1ae('0x2e')]+_0x251e3e[_0xe1ae('0xe')]+_0x3efbf9++,'VoiceExtensionId':_0xc97cdc[_0xe1ae('0x16')]});}}}for(var _0x2d5d3b=0x0;_0x2d5d3b<_0xe0bf2e[_0xe1ae('0x2e')];_0x2d5d3b+=0x1){var _0x4bed1e=_0x251e3e['priority']+_0xe0bf2e['length'];var _0x50459e=_0x2d5d3b===_0xe0bf2e[_0xe1ae('0x2e')]-0x1?_0x251e3e['priority']+_0x2bbdc4[_0xe1ae('0x2e')]+_0x5400d7[_0xe1ae('0x2e')]+0x2:_0x251e3e[_0xe1ae('0xe')]+_0x2d5d3b+0x1;_0x2bbdc4['splice'](_0x2d5d3b,0x0,{'type':_0xc97cdc['type'],'app':_0xe1ae('0x39'),'appdata':_0xe0bf2e[_0x2d5d3b]+'?'+_0xc97cdc[_0xe1ae('0x1c')]+_0xe1ae('0x3a')+_0x4bed1e+':'+_0xc97cdc[_0xe1ae('0x1c')]+_0xe1ae('0x3a')+_0x50459e,'exten':_0xc97cdc[_0xe1ae('0xa')],'context':_0xc97cdc[_0xe1ae('0x1c')],'priority':_0x251e3e[_0xe1ae('0xe')]+_0x2d5d3b,'VoiceExtensionId':_0x393b98[_0x4915f5][0x0][_0xe1ae('0x16')]});}_0xc97cdc[_0xe1ae('0xe')]=_0x2bbdc4[_0xe1ae('0x2e')]?_['last'](_0x2bbdc4)[_0xe1ae('0xe')]+0x1:_0x251e3e[_0xe1ae('0xe')];_0x251e3e[_0xe1ae('0xe')]=(_0x5400d7['length']?_['last'](_0x5400d7)[_0xe1ae('0xe')]:_0xc97cdc[_0xe1ae('0xe')])+0x1;_0x251e3e[_0xe1ae('0xf')]=_['concat'](_0x251e3e[_0xe1ae('0xf')],_0x2bbdc4,[_0xc97cdc],_0x5400d7);}_0x251e3e[_0xe1ae('0xf')][_0xe1ae('0x12')]({'type':_0x393b98[_0x4915f5][0x0][_0xe1ae('0x13')],'app':_0xe1ae('0x3b'),'exten':_0x393b98[_0x4915f5][0x0][_0xe1ae('0xa')],'context':_0x393b98[_0x4915f5][0x0][_0xe1ae('0x1c')],'priority':_0x251e3e[_0xe1ae('0xe')],'VoiceExtensionId':_0x393b98[_0x4915f5][0x0][_0xe1ae('0x16')]});_0x590f78[_0xe1ae('0x12')](_0x393b98[_0x4915f5][0x0][_0xe1ae('0x16')]);_0x25f7c5=_[_0xe1ae('0x3c')](_0x25f7c5,_0x251e3e['extensions']);}}return _0x37c04f[_0xe1ae('0x3d')](function(_0x3e73ec){return _0x37c04f[_0xe1ae('0x2')][_0xe1ae('0x6')][_0xe1ae('0x3e')]({'where':{'VoiceExtensionId':{'$in':_0x590f78}},'transaction':_0x3e73ec})[_0xe1ae('0x4')](function(_0x3d0a00){return _0x37c04f[_0xe1ae('0x2')][_0xe1ae('0x6')][_0xe1ae('0x3f')](_[_0xe1ae('0x40')](_0x25f7c5,_0xe1ae('0xe')),{'transaction':_0x3e73ec});});});})[_0xe1ae('0x41')](function(_0x1003df){console['error'](_0x1003df);});}exports[_0xe1ae('0x42')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 0b1355d..6434891 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(_0x2cf76d,_0xad89c9){var _0x4e5b25=function(_0x22a838){while(--_0x22a838){_0x2cf76d['push'](_0x2cf76d['shift']());}};_0x4e5b25(++_0xad89c9);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3ce2c4,_0x4544c1){_0x3ce2c4=_0x3ce2c4-0x0;var _0x4047c1=_0xcb91[_0x3ce2c4];return _0x4047c1;};'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(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_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 a4a0d8b..32e1a54 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 _0x5332=['.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','fromQuery','scheduledat','ContactId','ListId','createdAt','updatedAt','UserId','recallme','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','cm_contacts.createdAt\x20=\x20?','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_hopper','toString','cm_contacts.ListId','field','cm_hopper_black','ListId\x20=\x20?','\x20=\x20?','concat','keys','CompanyId','fields',')\x20NOT\x20IN\x20?','id\x20IN\x20?','min_id','group','info','Received\x20SIGINT','message','exit','errors','code','sequelize','query','push','catch','error','main','stringify','send','binding','socket_timestamp','root','server/files/tmp','header','writeFileSync','parse','createReadStream','data','hasOwnProperty','trim','replace','YYYY-MM-DD\x20HH:mm:ss','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','priority','isNaN','includes','agent\x20not\x20exists','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','firstName','\x20not\x20specified','length','SystemRow','appendFileSync','rows','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','isNil',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues_has_cm_lists','VoiceQueueId','voice_queues_has_cm_blacklists','voice_queues','campaigns_has_cm_lists','campaigns','CampaignId','campaigns_has_cm_blacklists','each','then','affectedRows','emit','contact:import:','unlink','complete','argv','arguments\x20\x20\x20','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','papaparse','util','bluebird','moment','squel','../../../mysqldb','../../../config/environment','import','redis','localhost','socket.io-emitter','format','test','select','phone','from','join','.id\x20=\x20','where','\x20=\x20'];(function(_0x3a0d2e,_0x4dc328){var _0x193e69=function(_0x33fd86){while(--_0x33fd86){_0x3a0d2e['push'](_0x3a0d2e['shift']());}};_0x193e69(++_0x4dc328);}(_0x5332,0x103));var _0x2533=function(_0x2403cb,_0x486689){_0x2403cb=_0x2403cb-0x0;var _0x4ed02c=_0x5332[_0x2403cb];return _0x4ed02c;};'use strict';var fs=require('fs');var path=require(_0x2533('0x0'));var _=require('lodash');var Papa=require(_0x2533('0x1'));var util=require(_0x2533('0x2'));var BPromise=require(_0x2533('0x3'));var moment=require(_0x2533('0x4'));var squel=require(_0x2533('0x5'));var Redis=require('ioredis');var db=require(_0x2533('0x6'))['db'];var config=require(_0x2533('0x7'));var logger=require('../../../config/logger')(_0x2533('0x8'));config[_0x2533('0x9')]=_['defaults'](config[_0x2533('0x9')],{'host':_0x2533('0xa'),'port':0x18eb});var socket=require(_0x2533('0xb'))(new Redis(config[_0x2533('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x2533('0xc')]('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x59caa5){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))*$/[_0x2533('0xd')](_0x59caa5);}function selectNotIn(_0x28c756,_0x27a124,_0x1dd408,_0x38741a,_0x18f1ff){return squel[_0x2533('0xe')]()['field'](_0x2533('0xf'))[_0x2533('0x10')](_0x38741a)[_0x2533('0x11')](_0x27a124,null,_0x27a124+_0x2533('0x12')+_0x38741a+'.'+_0x1dd408)[_0x2533('0x13')](_0x38741a+'.'+_0x1dd408+_0x2533('0x14')+_0x28c756+'.'+_0x1dd408)[_0x2533('0x13')](_0x27a124+_0x2533('0x15')+_0x18f1ff[_0x2533('0x11')]()+')');}function insertCmHopper(_0x4ac1ea,_0x5e458e,_0x470c43,_0x54bf4e,_0x13de38){var _0x3beb6b=[_0x2533('0x16'),_0x2533('0x17'),'cm_contacts.id','cm_contacts.ListId',_0x5e458e+'.'+_0x54bf4e,_0x2533('0x18'),_0x2533('0x19'),_0x2533('0x1a'),_0x2533('0x1b'),'\x22'+_0x13de38+'\x22'];return squel[_0x2533('0x1c')]()[_0x2533('0x1d')]('cm_hopper')[_0x2533('0x1e')]([_0x2533('0xf'),_0x2533('0x1f'),_0x2533('0x20'),_0x2533('0x21'),_0x54bf4e,_0x2533('0x22'),_0x2533('0x23'),'priority',_0x2533('0x24'),_0x2533('0x25')],squel['select']()['fields'](_0x3beb6b)[_0x2533('0x10')](_0x5e458e)[_0x2533('0x11')](_0x2533('0x26'),null,_0x2533('0x27')+_0x5e458e+_0x2533('0x28'))[_0x2533('0x11')](_0x470c43,null,_0x470c43+_0x2533('0x12')+_0x5e458e+'.'+_0x54bf4e)[_0x2533('0x13')](_0x5e458e+'.CmListId\x20=\x20?',_0x4ac1ea)[_0x2533('0x13')](_0x2533('0x29'),NOW)['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x5e458e,_0x470c43,_0x54bf4e,'cm_hopper',[_0x2533('0x2a'),_0x2533('0x2b')]))['where'](_0x2533('0x2c'),selectNotIn(_0x5e458e,_0x470c43,_0x54bf4e,_0x2533('0x2d'),[_0x2533('0x2a')])))[_0x2533('0x2e')]();}function insertCmHopperBlack(_0x542a47,_0x4a1f4a,_0x43c278,_0x254efb){var _0x2577d7=[_0x2533('0x16'),'cm_contacts.id',_0x2533('0x2f'),_0x4a1f4a+'.'+_0x254efb,_0x2533('0x18'),_0x2533('0x19')];return squel[_0x2533('0x1c')]()[_0x2533('0x1d')]('cm_hopper_black')[_0x2533('0x1e')]([_0x2533('0xf'),_0x2533('0x20'),'ListId',_0x254efb,'createdAt',_0x2533('0x23')],squel[_0x2533('0xe')]()['fields'](_0x2577d7)[_0x2533('0x10')](_0x4a1f4a)[_0x2533('0x11')](_0x2533('0x26'),null,_0x2533('0x27')+_0x4a1f4a+_0x2533('0x28'))[_0x2533('0x11')](_0x43c278,null,_0x43c278+'.id\x20=\x20'+_0x4a1f4a+'.'+_0x254efb)[_0x2533('0x13')](_0x4a1f4a+'.CmListId\x20=\x20?',_0x542a47)['where'](_0x2533('0x29'),NOW)[_0x2533('0x13')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x2533('0xe')]()[_0x2533('0x30')](_0x2533('0xf'))[_0x2533('0x10')](_0x2533('0x31'))[_0x2533('0x13')](_0x2533('0x32'),_0x542a47)[_0x2533('0x13')](_0x254efb+_0x2533('0x33'),_0x4a1f4a+'.'+_0x254efb)))[_0x2533('0x2e')]();}function insertCmContact(_0xcb9d58,_0x29eded,_0x1eef63,_0x17d50d){var _0x5e03ca=_[_0x2533('0x34')](_[_0x2533('0x35')](_0x17d50d),[_0x2533('0x21'),_0x2533('0x36'),'createdAt','updatedAt']);return squel[_0x2533('0x1c')]()['into'](_0x2533('0x26'))[_0x2533('0x1e')](_0x5e03ca,squel[_0x2533('0xe')]()[_0x2533('0x37')](_0x5e03ca)[_0x2533('0x10')](_0x29eded)[_0x2533('0x13')]('('+_0x1eef63[_0x2533('0x11')](',')+_0x2533('0x38'),squel[_0x2533('0xe')]()[_0x2533('0x37')](_0x1eef63)['from'](_0x2533('0x26'))[_0x2533('0x13')](_0x2533('0x32'),_0xcb9d58)[_0x2533('0x13')]('deletedAt\x20IS\x20NULL'))['where'](_0x2533('0x39'),squel[_0x2533('0xe')]()[_0x2533('0x30')]('MIN(id)',_0x2533('0x3a'))['from'](_0x29eded)[_0x2533('0x3b')](_0x1eef63[_0x2533('0x11')](','))))['toString']();}function handleStop(){logger[_0x2533('0x3c')](_0x2533('0x3d'));stopped=!![];}function handleUncaughtException(_0x32ff3e){logger['error'](_0x32ff3e[_0x2533('0x3e')]);process[_0x2533('0x3f')](0x1);}function handleError(_0x51ea5d,_0xe673af){stats[_0x2533('0x40')]['push']({'name':_0xe673af[_0x2533('0x41')],'message':_0xe673af[_0x2533('0x3e')],'row':_0x51ea5d});}function handleQuery(_0x27b785){logger[_0x2533('0x3c')](_0x27b785);return db[_0x2533('0x42')][_0x2533('0x43')](_0x27b785)['spread'](function(_0x4f72f5){results[_0x2533('0x44')](_0x4f72f5);})[_0x2533('0x45')](function(_0x3130b0){logger[_0x2533('0x46')](_0x3130b0[_0x2533('0x3e')]);});}function main(_0x552126,_0x208e87,_0x3b015a,_0x45219a){logger[_0x2533('0x3c')](_0x2533('0x47'),_0x552126,JSON[_0x2533('0x48')](_0x208e87));process[_0x2533('0x49')]('start');var _0x50c781=_0x208e87[_0x2533('0x4a')];var _0x33ce75=_0x208e87[_0x2533('0x4b')];var _0x5c3771=path['join'](config[_0x2533('0x4c')],_0x2533('0x4d'),_0x33ce75+'.csv');var _0x2861b9=_[_0x2533('0x35')](_0x50c781)[_0x2533('0x11')]();logger['info'](_0x2533('0x4e'),_0x2861b9);fs[_0x2533('0x4f')](_0x5c3771,_0x2861b9+'\x0a');Papa[_0x2533('0x50')](fs[_0x2533('0x51')](_0x552126),{'header':!![],'skipEmptyLines':!![],'step':function(_0x5e787b,_0x1be7b9){try{for(var _0x2a4d2b=0x0,_0x54cdcd=[];_0x2a4d2b<_0x5e787b[_0x2533('0x52')]['length'];_0x2a4d2b++){stats['rows']+=0x1;if(_0x5e787b[_0x2533('0x40')][_0x2a4d2b]){handleError(_0x5e787b['data'][_0x2a4d2b],_0x5e787b[_0x2533('0x40')][_0x2a4d2b]);}else{var _0x3f5a38=[];for(var _0x51134a in _0x50c781){if(_0x50c781[_0x2533('0x53')](_0x51134a)){if(_0x5e787b[_0x2533('0x52')][_0x2a4d2b][_0x50c781[_0x51134a]]){var _0x22e685=_[_0x2533('0x54')](_0x5e787b['data'][_0x2a4d2b][_0x50c781[_0x51134a]][_0x2533('0x55')](/"/g,'\x27'));switch(_0x51134a){case _0x2533('0x1f'):var _0x26b041=moment(_0x22e685,_0x2533('0x56'),!![]);if(_0x26b041[_0x2533('0x57')]()){_0x54cdcd[_0x2533('0x44')]('\x22'+_0x22e685+'\x22');}else{_0x3f5a38[_0x2533('0x44')](_0x2533('0x58'));}break;case _0x2533('0x59'):var _0xd22252=parseInt(_0x22e685);_0x22e685=_[_0x2533('0x5a')](_0xd22252)||_0xd22252<0x0||_0xd22252>0x4?_0x45219a?0x3:0x2:_0xd22252;_0x54cdcd[_0x2533('0x44')]('\x22'+_0x22e685+'\x22');break;case _0x2533('0x24'):var _0x133605=parseInt(_0x22e685);if(_['isNumber'](_0x133605)&&_[_0x2533('0x5b')](_0x3b015a,_0x133605)){_0x54cdcd[_0x2533('0x44')]('\x22'+_0x133605+'\x22');}else{_0x3f5a38[_0x2533('0x44')](_0x2533('0x5c'));}break;case'email':if(isEmail(_0x22e685)){_0x54cdcd['push']('\x22'+_0x22e685+'\x22');}else{_0x3f5a38[_0x2533('0x44')](_0x2533('0x5d'));}break;case _0x2533('0x5e'):var _0x1d6584=moment(_0x22e685,_0x2533('0x5f'),!![]);if(_0x1d6584[_0x2533('0x57')]()){_0x54cdcd[_0x2533('0x44')]('\x22'+_0x22e685+'\x22');}else{_0x3f5a38[_0x2533('0x44')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x54cdcd[_0x2533('0x44')]('\x22'+_0x22e685+'\x22');}}else{switch(_0x51134a){case _0x2533('0x60'):case _0x2533('0xf'):_0x3f5a38[_0x2533('0x44')](_0x51134a+_0x2533('0x61'));break;default:_0x54cdcd['push']('\x22\x22');}}}}if(_0x3f5a38[_0x2533('0x62')]){handleError(_0x5e787b[_0x2533('0x52')][_0x2a4d2b],{'code':_0x2533('0x63'),'message':_0x3f5a38[_0x2533('0x11')]()});}else{fs[_0x2533('0x64')](_0x5c3771,_0x54cdcd[_0x2533('0x11')]()+'\x0a');}_0x54cdcd=[];}if(!(stats[_0x2533('0x65')]%0xc8)){socket['emit']('contact:import:'+_0x33ce75,stats);stats[_0x2533('0x40')]=[];}}if(stopped){logger[_0x2533('0x3c')](_0x2533('0x66'));_0x1be7b9[_0x2533('0x67')]();}}catch(_0x5498da){handleError(_0x5e787b[_0x2533('0x52')][_0x2a4d2b],{'code':_0x2533('0x68'),'message':_0x5498da[_0x2533('0x3e')]});logger[_0x2533('0x46')](_0x2533('0x69'),_0x5498da[_0x2533('0x3e')]);}},'complete':function(){try{var _0x28fc67=[];var _0x344088='cm_contacts';if(_0x208e87[_0x2533('0x6a')]&&_0x208e87['duplicates']['length']){_0x344088=_0x2533('0x6b')+_0x33ce75;_0x28fc67[_0x2533('0x44')](_0x2533('0x6c')+_0x344088+_0x2533('0x6d'));}var _0x3d08ac=util[_0x2533('0xc')]('LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',_0x5c3771,_0x344088,_0x2861b9,_0x208e87[_0x2533('0x21')],_0x208e87[_0x2533('0x36')]||null,NOW,NOW);if(_[_0x2533('0x6e')](_0x50c781[_0x2533('0x1f')])){_0x3d08ac+=_0x2533('0x6f');}_0x28fc67[_0x2533('0x44')](_0x3d08ac);if(_0x208e87['duplicates']&&_0x208e87[_0x2533('0x6a')]['length']){_0x28fc67[_0x2533('0x44')](insertCmContact(_0x208e87[_0x2533('0x21')],_0x344088,_0x208e87[_0x2533('0x6a')],_0x50c781));_0x28fc67[_0x2533('0x44')](_0x2533('0x70')+_0x344088+';');}_0x28fc67['push'](insertCmHopper(_0x208e87[_0x2533('0x21')],_0x2533('0x71'),'voice_queues',_0x2533('0x72'),_0x45219a));_0x28fc67['push'](insertCmHopperBlack(_0x208e87[_0x2533('0x21')],_0x2533('0x73'),_0x2533('0x74'),_0x2533('0x72')));_0x28fc67[_0x2533('0x44')](insertCmHopper(_0x208e87[_0x2533('0x21')],_0x2533('0x75'),_0x2533('0x76'),_0x2533('0x77'),_0x45219a));_0x28fc67[_0x2533('0x44')](insertCmHopperBlack(_0x208e87['ListId'],_0x2533('0x78'),'campaigns','CampaignId'));BPromise[_0x2533('0x79')](_0x28fc67,handleQuery)[_0x2533('0x7a')](function(_0x45e581){stats['finish']=!![];stats[_0x2533('0x7b')]=_0x208e87[_0x2533('0x6a')]&&_0x208e87[_0x2533('0x6a')][_0x2533('0x62')]?results[0x2][_0x2533('0x7b')]:results[0x0][_0x2533('0x7b')];socket[_0x2533('0x7c')](_0x2533('0x7d')+_0x33ce75,stats);fs[_0x2533('0x7e')](_0x552126);fs['unlink'](_0x5c3771);process[_0x2533('0x3f')](0x0);})[_0x2533('0x45')](function(_0x2929ff){logger['error'](_0x2929ff[_0x2533('0x3e')]);process[_0x2533('0x3f')](0x1);});}catch(_0x2e181c){logger['error'](_0x2533('0x7f'),_0x2e181c[_0x2533('0x3e')]);process[_0x2533('0x3f')](0x1);}},'error':function(_0x1ffb81,_0x594639,_0x3df18d,_0x147847){throw new Error(_0x147847);}});}function validate(){if(process[_0x2533('0x80')]&&process[_0x2533('0x80')][_0x2533('0x62')]<0x4){throw new Error(_0x2533('0x81'));}var _0x26f006=path[_0x2533('0x11')](config[_0x2533('0x4c')],_0x2533('0x4d'),process[_0x2533('0x80')][0x2]);if(!fs['existsSync'](_0x26f006)){throw new Error(_0x2533('0x82'));}var _0x5c8837={};try{_0x5c8837=JSON[_0x2533('0x50')](process[_0x2533('0x80')][0x3]);if(!_0x5c8837['binding']){throw new Error(_0x2533('0x83'));}if(!_0x5c8837[_0x2533('0x4a')][_0x2533('0xf')]){throw new Error(_0x2533('0x84'));}if(!_0x5c8837[_0x2533('0x4a')][_0x2533('0x60')]){throw new Error(_0x2533('0x85'));}var _0x528366=0x0;if(_0x5c8837[_0x2533('0x4a')][_0x2533('0x24')]){_0x528366=0x1;}if(!_0x5c8837['ListId']){throw new Error(_0x2533('0x86'));}}catch(_0x114e2f){throw new Error(_0x2533('0x87'));}var _0x617a54=[];try{_0x617a54=_[_0x2533('0x88')](JSON[_0x2533('0x50')](process[_0x2533('0x80')][0x4]),'id');}catch(_0x4ff201){logger[_0x2533('0x3c')](_0x2533('0x89'));}main(_0x26f006,_0x5c8837,_0x617a54,_0x528366);}validate();process['on'](_0x2533('0x8a'),handleStop);process['on'](_0x2533('0x8b'),handleUncaughtException); \ No newline at end of file +var _0x7679=['voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','campaigns','CampaignId','campaigns_has_cm_blacklists','each','then','affectedRows','unlink','complete','argv','arguments\x20\x20\x20','root','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','SIGINT','path','papaparse','bluebird','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','defaults','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','select','field','phone','from','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','join','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','insert','into','fromQuery','scheduledat','ListId','createdAt','UserId','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_hopper','\x22always\x22','cm_hopper_black','ContactId','updatedAt','ListId\x20=\x20?','\x20=\x20?','concat','keys','CompanyId','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','group','Received\x20SIGINT','error','message','exit','errors','push','code','info','sequelize','query','spread','catch','stringify','send','start','binding','socket_timestamp','server/files/tmp','.csv','header','parse','createReadStream','length','rows','data','hasOwnProperty','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','priority','isNaN','isNumber','includes','agent\x20not\x20exists','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','appendFileSync','emit','contact:import:','Abort\x20parser','SystemError','duplicates','cm_contacts_','\x20LIKE\x20cm_contacts;','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','isNil','voice_queues_has_cm_lists'];(function(_0x5e1324,_0x303748){var _0x22dfd1=function(_0x35dc41){while(--_0x35dc41){_0x5e1324['push'](_0x5e1324['shift']());}};_0x22dfd1(++_0x303748);}(_0x7679,0x9b));var _0x9767=function(_0x5c7fce,_0x3fbe4c){_0x5c7fce=_0x5c7fce-0x0;var _0x216760=_0x7679[_0x5c7fce];return _0x216760;};'use strict';var fs=require('fs');var path=require(_0x9767('0x0'));var _=require('lodash');var Papa=require(_0x9767('0x1'));var util=require('util');var BPromise=require(_0x9767('0x2'));var moment=require('moment');var squel=require(_0x9767('0x3'));var Redis=require(_0x9767('0x4'));var db=require(_0x9767('0x5'))['db'];var config=require(_0x9767('0x6'));var logger=require(_0x9767('0x7'))(_0x9767('0x8'));config[_0x9767('0x9')]=_[_0x9767('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x9767('0xb'))(new Redis(config[_0x9767('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x9767('0xc')](_0x9767('0xd'));function isEmail(_0x247224){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'](_0x247224);}function selectNotIn(_0x31e6cd,_0x33cb96,_0x550e3e,_0x450bd1,_0x31dea5){return squel[_0x9767('0xe')]()[_0x9767('0xf')](_0x9767('0x10'))[_0x9767('0x11')](_0x450bd1)['join'](_0x33cb96,null,_0x33cb96+_0x9767('0x12')+_0x450bd1+'.'+_0x550e3e)[_0x9767('0x13')](_0x450bd1+'.'+_0x550e3e+_0x9767('0x14')+_0x31e6cd+'.'+_0x550e3e)[_0x9767('0x13')](_0x33cb96+_0x9767('0x15')+_0x31dea5[_0x9767('0x16')]()+')');}function insertCmHopper(_0x1c3c06,_0x371226,_0x59d42e,_0x1d301d,_0xc6a7ab){var _0x135969=[_0x9767('0x17'),_0x9767('0x18'),_0x9767('0x19'),_0x9767('0x1a'),_0x371226+'.'+_0x1d301d,_0x9767('0x1b'),_0x9767('0x1c'),_0x9767('0x1d'),'cm_contacts.UserId','\x22'+_0xc6a7ab+'\x22'];return squel[_0x9767('0x1e')]()[_0x9767('0x1f')]('cm_hopper')[_0x9767('0x20')]([_0x9767('0x10'),_0x9767('0x21'),'ContactId',_0x9767('0x22'),_0x1d301d,_0x9767('0x23'),'updatedAt','priority',_0x9767('0x24'),_0x9767('0x25')],squel[_0x9767('0xe')]()[_0x9767('0x26')](_0x135969)[_0x9767('0x11')](_0x371226)['join'](_0x9767('0x27'),null,_0x9767('0x28')+_0x371226+_0x9767('0x29'))[_0x9767('0x16')](_0x59d42e,null,_0x59d42e+_0x9767('0x12')+_0x371226+'.'+_0x1d301d)[_0x9767('0x13')](_0x371226+'.CmListId\x20=\x20?',_0x1c3c06)[_0x9767('0x13')](_0x9767('0x2a'),NOW)[_0x9767('0x13')](_0x9767('0x2b'),selectNotIn(_0x371226,_0x59d42e,_0x1d301d,_0x9767('0x2c'),[_0x9767('0x2d'),'\x22onlyIfOpen\x22']))[_0x9767('0x13')](_0x9767('0x2b'),selectNotIn(_0x371226,_0x59d42e,_0x1d301d,_0x9767('0x2c'),['\x22always\x22'])))['toString']();}function insertCmHopperBlack(_0x141c3b,_0x239e63,_0x3378ed,_0x3f53cf){var _0x4dc34a=[_0x9767('0x17'),'cm_contacts.id',_0x9767('0x1a'),_0x239e63+'.'+_0x3f53cf,_0x9767('0x1b'),_0x9767('0x1c')];return squel[_0x9767('0x1e')]()[_0x9767('0x1f')](_0x9767('0x2e'))[_0x9767('0x20')]([_0x9767('0x10'),_0x9767('0x2f'),_0x9767('0x22'),_0x3f53cf,_0x9767('0x23'),_0x9767('0x30')],squel[_0x9767('0xe')]()['fields'](_0x4dc34a)[_0x9767('0x11')](_0x239e63)[_0x9767('0x16')](_0x9767('0x27'),null,_0x9767('0x28')+_0x239e63+_0x9767('0x29'))[_0x9767('0x16')](_0x3378ed,null,_0x3378ed+_0x9767('0x12')+_0x239e63+'.'+_0x3f53cf)[_0x9767('0x13')](_0x239e63+'.CmListId\x20=\x20?',_0x141c3b)['where'](_0x9767('0x2a'),NOW)[_0x9767('0x13')](_0x9767('0x2b'),squel[_0x9767('0xe')]()['field']('phone')[_0x9767('0x11')](_0x9767('0x2e'))['where'](_0x9767('0x31'),_0x141c3b)[_0x9767('0x13')](_0x3f53cf+_0x9767('0x32'),_0x239e63+'.'+_0x3f53cf)))['toString']();}function insertCmContact(_0x2a283f,_0x81649e,_0x40c093,_0x187c15){var _0x40fdf5=_[_0x9767('0x33')](_[_0x9767('0x34')](_0x187c15),[_0x9767('0x22'),_0x9767('0x35'),'createdAt',_0x9767('0x30')]);return squel[_0x9767('0x1e')]()[_0x9767('0x1f')]('cm_contacts')[_0x9767('0x20')](_0x40fdf5,squel[_0x9767('0xe')]()['fields'](_0x40fdf5)[_0x9767('0x11')](_0x81649e)['where']('('+_0x40c093['join'](',')+')\x20NOT\x20IN\x20?',squel['select']()[_0x9767('0x26')](_0x40c093)['from']('cm_contacts')[_0x9767('0x13')]('ListId\x20=\x20?',_0x2a283f)[_0x9767('0x13')](_0x9767('0x36')))[_0x9767('0x13')](_0x9767('0x37'),squel[_0x9767('0xe')]()[_0x9767('0xf')](_0x9767('0x38'),_0x9767('0x39'))[_0x9767('0x11')](_0x81649e)[_0x9767('0x3a')](_0x40c093['join'](','))))['toString']();}function handleStop(){logger['info'](_0x9767('0x3b'));stopped=!![];}function handleUncaughtException(_0x4c15a5){logger[_0x9767('0x3c')](_0x4c15a5[_0x9767('0x3d')]);process[_0x9767('0x3e')](0x1);}function handleError(_0xd55cc4,_0x4a1d60){stats[_0x9767('0x3f')][_0x9767('0x40')]({'name':_0x4a1d60[_0x9767('0x41')],'message':_0x4a1d60[_0x9767('0x3d')],'row':_0xd55cc4});}function handleQuery(_0x4b777f){logger[_0x9767('0x42')](_0x4b777f);return db[_0x9767('0x43')][_0x9767('0x44')](_0x4b777f)[_0x9767('0x45')](function(_0x185862){results[_0x9767('0x40')](_0x185862);})[_0x9767('0x46')](function(_0x2d8c4c){logger['error'](_0x2d8c4c['message']);});}function main(_0x4163fe,_0x1aefc4,_0x36908a,_0x4040a2){logger['info']('main',_0x4163fe,JSON[_0x9767('0x47')](_0x1aefc4));process[_0x9767('0x48')](_0x9767('0x49'));var _0x16b7fb=_0x1aefc4[_0x9767('0x4a')];var _0x12de74=_0x1aefc4[_0x9767('0x4b')];var _0x1b2f40=path[_0x9767('0x16')](config['root'],_0x9767('0x4c'),_0x12de74+_0x9767('0x4d'));var _0x15af8d=_['keys'](_0x16b7fb)[_0x9767('0x16')]();logger[_0x9767('0x42')](_0x9767('0x4e'),_0x15af8d);fs['writeFileSync'](_0x1b2f40,_0x15af8d+'\x0a');Papa[_0x9767('0x4f')](fs[_0x9767('0x50')](_0x4163fe),{'header':!![],'skipEmptyLines':!![],'step':function(_0x4bfd84,_0x5e0a56){try{for(var _0x47e897=0x0,_0x179773=[];_0x47e897<_0x4bfd84['data'][_0x9767('0x51')];_0x47e897++){stats[_0x9767('0x52')]+=0x1;if(_0x4bfd84[_0x9767('0x3f')][_0x47e897]){handleError(_0x4bfd84[_0x9767('0x53')][_0x47e897],_0x4bfd84[_0x9767('0x3f')][_0x47e897]);}else{var _0xe22a8d=[];for(var _0x3206bf in _0x16b7fb){if(_0x16b7fb[_0x9767('0x54')](_0x3206bf)){if(_0x4bfd84[_0x9767('0x53')][_0x47e897][_0x16b7fb[_0x3206bf]]){var _0xfdaa43=_['trim'](_0x4bfd84[_0x9767('0x53')][_0x47e897][_0x16b7fb[_0x3206bf]][_0x9767('0x55')](/"/g,'\x27'));switch(_0x3206bf){case _0x9767('0x21'):var _0x3f7065=moment(_0xfdaa43,_0x9767('0xd'),!![]);if(_0x3f7065[_0x9767('0x56')]()){_0x179773['push']('\x22'+_0xfdaa43+'\x22');}else{_0xe22a8d[_0x9767('0x40')](_0x9767('0x57'));}break;case _0x9767('0x58'):var _0xb7747a=parseInt(_0xfdaa43);_0xfdaa43=_[_0x9767('0x59')](_0xb7747a)||_0xb7747a<0x0||_0xb7747a>0x4?_0x4040a2?0x3:0x2:_0xb7747a;_0x179773[_0x9767('0x40')]('\x22'+_0xfdaa43+'\x22');break;case'UserId':var _0x5af73b=parseInt(_0xfdaa43);if(_[_0x9767('0x5a')](_0x5af73b)&&_[_0x9767('0x5b')](_0x36908a,_0x5af73b)){_0x179773[_0x9767('0x40')]('\x22'+_0x5af73b+'\x22');}else{_0xe22a8d['push'](_0x9767('0x5c'));}break;case'email':if(isEmail(_0xfdaa43)){_0x179773[_0x9767('0x40')]('\x22'+_0xfdaa43+'\x22');}else{_0xe22a8d[_0x9767('0x40')]('email\x20wrong\x20format');}break;case _0x9767('0x5d'):var _0x39638d=moment(_0xfdaa43,_0x9767('0x5e'),!![]);if(_0x39638d[_0x9767('0x56')]()){_0x179773[_0x9767('0x40')]('\x22'+_0xfdaa43+'\x22');}else{_0xe22a8d['push'](_0x9767('0x5f'));}break;default:_0x179773['push']('\x22'+_0xfdaa43+'\x22');}}else{switch(_0x3206bf){case _0x9767('0x60'):case'phone':_0xe22a8d[_0x9767('0x40')](_0x3206bf+_0x9767('0x61'));break;default:_0x179773[_0x9767('0x40')]('\x22\x22');}}}}if(_0xe22a8d[_0x9767('0x51')]){handleError(_0x4bfd84[_0x9767('0x53')][_0x47e897],{'code':'SystemRow','message':_0xe22a8d[_0x9767('0x16')]()});}else{fs[_0x9767('0x62')](_0x1b2f40,_0x179773[_0x9767('0x16')]()+'\x0a');}_0x179773=[];}if(!(stats[_0x9767('0x52')]%0xc8)){socket[_0x9767('0x63')](_0x9767('0x64')+_0x12de74,stats);stats['errors']=[];}}if(stopped){logger['info'](_0x9767('0x65'));_0x5e0a56['abort']();}}catch(_0x158856){handleError(_0x4bfd84['data'][_0x47e897],{'code':_0x9767('0x66'),'message':_0x158856['message']});logger[_0x9767('0x3c')]('step',_0x158856[_0x9767('0x3d')]);}},'complete':function(){try{var _0x2d5da6=[];var _0x3c9b90=_0x9767('0x27');if(_0x1aefc4['duplicates']&&_0x1aefc4[_0x9767('0x67')]['length']){_0x3c9b90=_0x9767('0x68')+_0x12de74;_0x2d5da6[_0x9767('0x40')]('CREATE\x20TABLE\x20'+_0x3c9b90+_0x9767('0x69'));}var _0x1bcc4f=util['format'](_0x9767('0x6a'),_0x1b2f40,_0x3c9b90,_0x15af8d,_0x1aefc4[_0x9767('0x22')],_0x1aefc4[_0x9767('0x35')]||null,NOW,NOW);if(_[_0x9767('0x6b')](_0x16b7fb[_0x9767('0x21')])){_0x1bcc4f+=',\x20scheduledAt\x20=\x20NOW()';}_0x2d5da6[_0x9767('0x40')](_0x1bcc4f);if(_0x1aefc4[_0x9767('0x67')]&&_0x1aefc4[_0x9767('0x67')][_0x9767('0x51')]){_0x2d5da6[_0x9767('0x40')](insertCmContact(_0x1aefc4[_0x9767('0x22')],_0x3c9b90,_0x1aefc4[_0x9767('0x67')],_0x16b7fb));_0x2d5da6['push']('DROP\x20TABLE\x20'+_0x3c9b90+';');}_0x2d5da6[_0x9767('0x40')](insertCmHopper(_0x1aefc4[_0x9767('0x22')],_0x9767('0x6c'),_0x9767('0x6d'),_0x9767('0x6e'),_0x4040a2));_0x2d5da6[_0x9767('0x40')](insertCmHopperBlack(_0x1aefc4[_0x9767('0x22')],_0x9767('0x6f'),_0x9767('0x6d'),_0x9767('0x6e')));_0x2d5da6['push'](insertCmHopper(_0x1aefc4[_0x9767('0x22')],_0x9767('0x70'),_0x9767('0x71'),_0x9767('0x72'),_0x4040a2));_0x2d5da6['push'](insertCmHopperBlack(_0x1aefc4[_0x9767('0x22')],_0x9767('0x73'),'campaigns',_0x9767('0x72')));BPromise[_0x9767('0x74')](_0x2d5da6,handleQuery)[_0x9767('0x75')](function(_0x57f39b){stats['finish']=!![];stats['affectedRows']=_0x1aefc4[_0x9767('0x67')]&&_0x1aefc4[_0x9767('0x67')]['length']?results[0x2][_0x9767('0x76')]:results[0x0][_0x9767('0x76')];socket['emit'](_0x9767('0x64')+_0x12de74,stats);fs['unlink'](_0x4163fe);fs[_0x9767('0x77')](_0x1b2f40);process[_0x9767('0x3e')](0x0);})[_0x9767('0x46')](function(_0x2a7b29){logger[_0x9767('0x3c')](_0x2a7b29['message']);process[_0x9767('0x3e')](0x1);});}catch(_0x4c312e){logger['error'](_0x9767('0x78'),_0x4c312e[_0x9767('0x3d')]);process[_0x9767('0x3e')](0x1);}},'error':function(_0x543053,_0x2e2f3f,_0x3a7cdd,_0x530ad7){throw new Error(_0x530ad7);}});}function validate(){if(process['argv']&&process[_0x9767('0x79')][_0x9767('0x51')]<0x4){throw new Error(_0x9767('0x7a'));}var _0x2e2646=path[_0x9767('0x16')](config[_0x9767('0x7b')],_0x9767('0x4c'),process[_0x9767('0x79')][0x2]);if(!fs[_0x9767('0x7c')](_0x2e2646)){throw new Error(_0x9767('0x7d'));}var _0x11a1d6={};try{_0x11a1d6=JSON[_0x9767('0x4f')](process[_0x9767('0x79')][0x3]);if(!_0x11a1d6['binding']){throw new Error(_0x9767('0x7e'));}if(!_0x11a1d6[_0x9767('0x4a')][_0x9767('0x10')]){throw new Error(_0x9767('0x7f'));}if(!_0x11a1d6[_0x9767('0x4a')][_0x9767('0x60')]){throw new Error('firstName\x20is\x20mandatory');}var _0x47929b=0x0;if(_0x11a1d6[_0x9767('0x4a')]['UserId']){_0x47929b=0x1;}if(!_0x11a1d6['ListId']){throw new Error(_0x9767('0x80'));}}catch(_0x4ece47){throw new Error(_0x9767('0x81'));}var _0x410d9c=[];try{_0x410d9c=_[_0x9767('0x82')](JSON[_0x9767('0x4f')](process['argv'][0x4]),'id');}catch(_0x3d3e46){logger[_0x9767('0x42')]('No\x20agent\x20available');}main(_0x2e2646,_0x11a1d6,_0x410d9c,_0x47929b);}validate();process['on'](_0x9767('0x83'),handleStop);process['on']('uncaughtException',handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index 7e59be3..350b049 100644 --- a/server/components/integrations/configuration.js +++ b/server/components/integrations/configuration.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd4a2=['Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','agentcalledAt','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','Called\x20Number','starttime','Answer\x20Time','answertime','Complete\x20Time','endtime','Duration','duration','Billable\x20Time','billableseconds','getSubjects','[xCALLY\x20Ticket]','voice','inbound','push','variable','queue','calleridnum','outbound','string','Outbound\x20Call','destcalleridnum','getDescriptions','toLowerCase','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','Caller\x20Name','destexten','Queue','UniqueId','uniqueid','Date','Agent\x20Name','destcalleridname'];(function(_0x3074f3,_0x4f2c03){var _0x53f112=function(_0x4a17af){while(--_0x4a17af){_0x3074f3['push'](_0x3074f3['shift']());}};_0x53f112(++_0x4f2c03);}(_0xd4a2,0x173));var _0x2d4a=function(_0x34c4bc,_0x2eda5e){_0x34c4bc=_0x34c4bc-0x0;var _0x293a40=_0xd4a2[_0x34c4bc];return _0x293a40;};'use strict';exports[_0x2d4a('0x0')]=function(_0x5d70e1,_0x4e88a9){var _0xfba415=[{'type':'string','content':_0x2d4a('0x1'),'variableName':null}];switch(_0x5d70e1['toLowerCase']()){case _0x2d4a('0x2'):switch(_0x4e88a9['toLowerCase']()){case _0x2d4a('0x3'):_0xfba415[_0x2d4a('0x4')]({'type':_0x2d4a('0x5'),'content':'','variableName':_0x2d4a('0x6')});_0xfba415[_0x2d4a('0x4')]({'type':'variable','content':'','variableName':_0x2d4a('0x7')});break;case _0x2d4a('0x8'):_0xfba415[_0x2d4a('0x4')]({'type':_0x2d4a('0x9'),'content':_0x2d4a('0xa'),'variableName':null});_0xfba415[_0x2d4a('0x4')]({'type':_0x2d4a('0x5'),'content':'','variableName':_0x2d4a('0xb')});break;}}return _0xfba415;};exports[_0x2d4a('0xc')]=function(_0x4738dc,_0x3abbbd){var _0xce6af6=[];switch(_0x4738dc['toLowerCase']()){case'voice':switch(_0x3abbbd[_0x2d4a('0xd')]()){case'inbound':_0xce6af6=[{'type':_0x2d4a('0x9'),'content':_0x2d4a('0xe'),'key':null,'keyType':null,'variableName':null},{'type':_0x2d4a('0xf'),'content':'','key':_0x2d4a('0x10'),'keyType':_0x2d4a('0x5'),'variableName':_0x2d4a('0x7')},{'type':_0x2d4a('0xf'),'content':'','key':_0x2d4a('0x11'),'keyType':'variable','variableName':'calleridname'},{'type':_0x2d4a('0xf'),'content':'','key':'Call\x20To','keyType':_0x2d4a('0x5'),'variableName':_0x2d4a('0x12')},{'type':_0x2d4a('0xf'),'content':'','key':_0x2d4a('0x13'),'keyType':'variable','variableName':_0x2d4a('0x6')},{'type':'keyValue','content':'','key':_0x2d4a('0x14'),'keyType':'variable','variableName':_0x2d4a('0x15')},{'type':_0x2d4a('0xf'),'content':'','key':_0x2d4a('0x16'),'keyType':_0x2d4a('0x5'),'variableName':'agentcalledAt'},{'type':'string','content':'***\x20Agent\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x2d4a('0xf'),'content':'','key':_0x2d4a('0x17'),'keyType':_0x2d4a('0x5'),'variableName':_0x2d4a('0x18')},{'type':_0x2d4a('0xf'),'content':'','key':_0x2d4a('0x19'),'keyType':'variable','variableName':'destcalleridnum'},{'type':_0x2d4a('0x9'),'content':_0x2d4a('0x1a'),'key':null,'keyType':null,'variableName':null},{'type':_0x2d4a('0xf'),'content':'','key':_0x2d4a('0x1b'),'keyType':_0x2d4a('0x5'),'variableName':_0x2d4a('0x1c')},{'type':_0x2d4a('0xf'),'content':'','key':_0x2d4a('0x1d'),'keyType':'variable','variableName':_0x2d4a('0x1e')},{'type':_0x2d4a('0xf'),'content':'','key':_0x2d4a('0x1f'),'keyType':_0x2d4a('0x5'),'variableName':_0x2d4a('0x20')},{'type':_0x2d4a('0xf'),'content':'','key':_0x2d4a('0x21'),'keyType':_0x2d4a('0x5'),'variableName':'holdtime'},{'type':'keyValue','content':'','key':'Talk\x20Time','keyType':_0x2d4a('0x5'),'variableName':'talktime'}];break;case _0x2d4a('0x8'):_0xce6af6=[{'type':_0x2d4a('0x9'),'content':_0x2d4a('0xe'),'variableName':null},{'type':_0x2d4a('0xf'),'content':'','key':_0x2d4a('0x22'),'keyType':_0x2d4a('0x5'),'keyContent':'','variableName':_0x2d4a('0xb')},{'type':_0x2d4a('0xf'),'content':'','key':'Member\x20Name','keyType':_0x2d4a('0x5'),'keyContent':'','variableName':'membername'},{'type':_0x2d4a('0xf'),'content':'','key':_0x2d4a('0x14'),'keyType':_0x2d4a('0x5'),'keyContent':'','variableName':_0x2d4a('0x15')},{'type':_0x2d4a('0xf'),'content':'','key':_0x2d4a('0x16'),'keyType':_0x2d4a('0x5'),'keyContent':'','variableName':_0x2d4a('0x23')},{'type':'string','content':_0x2d4a('0x1a')},{'type':_0x2d4a('0xf'),'content':'','key':_0x2d4a('0x24'),'keyType':_0x2d4a('0x5'),'keyContent':'','variableName':_0x2d4a('0x25')},{'type':'keyValue','content':'','key':_0x2d4a('0x26'),'keyType':_0x2d4a('0x5'),'keyContent':'','variableName':_0x2d4a('0x27')},{'type':_0x2d4a('0xf'),'content':'','key':_0x2d4a('0x28'),'keyType':'variable','keyContent':'','variableName':_0x2d4a('0x29')},{'type':_0x2d4a('0xf'),'content':'','key':_0x2d4a('0x2a'),'keyType':_0x2d4a('0x5'),'keyContent':'','variableName':_0x2d4a('0x2b')}];break;}}return _0xce6af6;}; \ No newline at end of file +var _0xb6fa=['Call\x20To','Date','agentcalledAt','***\x20Agent\x20Info\x20***','destcalleridname','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','agentconnectAt','Agent\x20Complete','Hold\x20Time','holdtime','Talk\x20Time','talktime','Called\x20Number','Member\x20Name','starttime','answertime','Complete\x20Time','endtime','duration','getSubjects','toLowerCase','voice','inbound','push','variable','queue','calleridnum','outbound','string','Outbound\x20Call','destcalleridnum','getDescriptions','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','Caller\x20Name','calleridname'];(function(_0x58e469,_0x95ee3e){var _0x4c01c5=function(_0x1ef7ae){while(--_0x1ef7ae){_0x58e469['push'](_0x58e469['shift']());}};_0x4c01c5(++_0x95ee3e);}(_0xb6fa,0x1c2));var _0xab6f=function(_0x5ce3c8,_0x2503bd){_0x5ce3c8=_0x5ce3c8-0x0;var _0xa76867=_0xb6fa[_0x5ce3c8];return _0xa76867;};'use strict';exports[_0xab6f('0x0')]=function(_0x5762b4,_0x4b0e89){var _0x46bd0e=[{'type':'string','content':'[xCALLY\x20Ticket]','variableName':null}];switch(_0x5762b4[_0xab6f('0x1')]()){case _0xab6f('0x2'):switch(_0x4b0e89['toLowerCase']()){case _0xab6f('0x3'):_0x46bd0e[_0xab6f('0x4')]({'type':_0xab6f('0x5'),'content':'','variableName':_0xab6f('0x6')});_0x46bd0e[_0xab6f('0x4')]({'type':_0xab6f('0x5'),'content':'','variableName':_0xab6f('0x7')});break;case _0xab6f('0x8'):_0x46bd0e[_0xab6f('0x4')]({'type':_0xab6f('0x9'),'content':_0xab6f('0xa'),'variableName':null});_0x46bd0e[_0xab6f('0x4')]({'type':_0xab6f('0x5'),'content':'','variableName':_0xab6f('0xb')});break;}}return _0x46bd0e;};exports[_0xab6f('0xc')]=function(_0x17cbab,_0x4838a8){var _0x599560=[];switch(_0x17cbab[_0xab6f('0x1')]()){case _0xab6f('0x2'):switch(_0x4838a8['toLowerCase']()){case _0xab6f('0x3'):_0x599560=[{'type':_0xab6f('0x9'),'content':_0xab6f('0xd'),'key':null,'keyType':null,'variableName':null},{'type':_0xab6f('0xe'),'content':'','key':_0xab6f('0xf'),'keyType':_0xab6f('0x5'),'variableName':_0xab6f('0x7')},{'type':'keyValue','content':'','key':_0xab6f('0x10'),'keyType':_0xab6f('0x5'),'variableName':_0xab6f('0x11')},{'type':'keyValue','content':'','key':_0xab6f('0x12'),'keyType':'variable','variableName':'destexten'},{'type':_0xab6f('0xe'),'content':'','key':'Queue','keyType':_0xab6f('0x5'),'variableName':_0xab6f('0x6')},{'type':_0xab6f('0xe'),'content':'','key':'UniqueId','keyType':_0xab6f('0x5'),'variableName':'uniqueid'},{'type':_0xab6f('0xe'),'content':'','key':_0xab6f('0x13'),'keyType':_0xab6f('0x5'),'variableName':_0xab6f('0x14')},{'type':_0xab6f('0x9'),'content':_0xab6f('0x15'),'key':null,'keyType':null,'variableName':null},{'type':_0xab6f('0xe'),'content':'','key':'Agent\x20Name','keyType':_0xab6f('0x5'),'variableName':_0xab6f('0x16')},{'type':_0xab6f('0xe'),'content':'','key':'Agent\x20Number','keyType':_0xab6f('0x5'),'variableName':_0xab6f('0xb')},{'type':_0xab6f('0x9'),'content':_0xab6f('0x17'),'key':null,'keyType':null,'variableName':null},{'type':_0xab6f('0xe'),'content':'','key':_0xab6f('0x18'),'keyType':'variable','variableName':'agentcalledAt'},{'type':_0xab6f('0xe'),'content':'','key':_0xab6f('0x19'),'keyType':_0xab6f('0x5'),'variableName':_0xab6f('0x1a')},{'type':_0xab6f('0xe'),'content':'','key':_0xab6f('0x1b'),'keyType':_0xab6f('0x5'),'variableName':'agentcompleteAt'},{'type':_0xab6f('0xe'),'content':'','key':_0xab6f('0x1c'),'keyType':'variable','variableName':_0xab6f('0x1d')},{'type':_0xab6f('0xe'),'content':'','key':_0xab6f('0x1e'),'keyType':_0xab6f('0x5'),'variableName':_0xab6f('0x1f')}];break;case'outbound':_0x599560=[{'type':_0xab6f('0x9'),'content':_0xab6f('0xd'),'variableName':null},{'type':'keyValue','content':'','key':_0xab6f('0x20'),'keyType':_0xab6f('0x5'),'keyContent':'','variableName':_0xab6f('0xb')},{'type':_0xab6f('0xe'),'content':'','key':_0xab6f('0x21'),'keyType':_0xab6f('0x5'),'keyContent':'','variableName':'membername'},{'type':_0xab6f('0xe'),'content':'','key':'UniqueId','keyType':'variable','keyContent':'','variableName':'uniqueid'},{'type':'keyValue','content':'','key':'Date','keyType':_0xab6f('0x5'),'keyContent':'','variableName':_0xab6f('0x22')},{'type':_0xab6f('0x9'),'content':_0xab6f('0x17')},{'type':_0xab6f('0xe'),'content':'','key':'Answer\x20Time','keyType':_0xab6f('0x5'),'keyContent':'','variableName':_0xab6f('0x23')},{'type':_0xab6f('0xe'),'content':'','key':_0xab6f('0x24'),'keyType':_0xab6f('0x5'),'keyContent':'','variableName':_0xab6f('0x25')},{'type':_0xab6f('0xe'),'content':'','key':'Duration','keyType':_0xab6f('0x5'),'keyContent':'','variableName':_0xab6f('0x26')},{'type':_0xab6f('0xe'),'content':'','key':'Billable\x20Time','keyType':_0xab6f('0x5'),'keyContent':'','variableName':'billableseconds'}];break;}}return _0x599560;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index 9439d87..90a6af1 100644 --- a/server/components/interaction/service.js +++ b/server/components/interaction/service.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fa2=['mail-interactions','upperFirst','InteractionId','unknown','toLowerCase','toUpperCase','name','stringify','null','findOne','then','update','info','catch','error','user','query','clone','omit','body','phone','fax','mobile','../../config/logger','openchannel-interactions'];(function(_0x5ddce4,_0x44cbe4){var _0x39676f=function(_0x10526f){while(--_0x10526f){_0x5ddce4['push'](_0x5ddce4['shift']());}};_0x39676f(++_0x44cbe4);}(_0x5fa2,0x18e));var _0x25fa=function(_0x2bff01,_0x1d1396){_0x2bff01=_0x2bff01-0x0;var _0x9e6bef=_0x5fa2[_0x2bff01];return _0x9e6bef;};'use strict';var _=require('lodash');var db=require('../../mysqldb')['db'];var loggers={'openchannel':require(_0x25fa('0x0'))(_0x25fa('0x1')),'mail':require(_0x25fa('0x0'))(_0x25fa('0x2')),'fax':require(_0x25fa('0x0'))('fax-interactions'),'sms':require(_0x25fa('0x0'))('sms-interactions'),'chat':require(_0x25fa('0x0'))('chat-interactions')};function getInteractionId(_0x4ff2f6,_0x596e41,_0x4cbc0c){if(_0x4ff2f6&&_0x4ff2f6[_[_0x25fa('0x3')](_0x4cbc0c)+_0x25fa('0x4')]){return _0x4ff2f6[_[_0x25fa('0x3')](_0x4cbc0c)+_0x25fa('0x4')];}else if(_0x4ff2f6&&_0x4ff2f6['id']){return _0x4ff2f6['id'];}else if(_0x596e41&&_0x596e41['id']){return _0x596e41['id'];}else{return _0x25fa('0x5');}}function log(_0x349231,_0x4f64be,_0x1631f5,_0x2295e6,_0x36a0d5,_0x307b0a){loggers[_0x36a0d5[_0x25fa('0x6')]()][_0x349231]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x307b0a[_0x25fa('0x7')](),_0x4f64be?_0x4f64be['id']:null,_0x4f64be?_0x4f64be[_0x25fa('0x8')]:null,_0x4f64be?_0x4f64be['role']:null,getInteractionId(_0x1631f5,_0x2295e6,_0x36a0d5),_0x1631f5?JSON[_0x25fa('0x9')](_0x1631f5):_0x25fa('0xa'));}function updateUser(_0x14e344,_0x2f535e,_0x50ab8c,_0x40d169,_0x3706f1){db[_['upperFirst'](_0x40d169)+'Interaction'][_0x25fa('0xb')]({'where':{'id':getInteractionId(_0x2f535e,_0x50ab8c,_0x40d169)}})[_0x25fa('0xc')](function(_0x2246f7){if(_0x2246f7){return _0x2246f7[_0x25fa('0xd')]({'UserId':_0x14e344?_0x14e344['id']:null});}})[_0x25fa('0xc')](function(_0x43ba7d){if(_0x43ba7d){log(_0x25fa('0xe'),_0x14e344,_0x2f535e,_0x50ab8c,_0x40d169,_0x3706f1);}})[_0x25fa('0xf')](function(){log(_0x25fa('0x10'),_0x14e344,_0x2f535e,_0x50ab8c,_0x40d169,_0x3706f1);});}exports['tracked']=function(_0x26d622,_0x507c52){return function(_0x3410da,_0x3b4880,_0x5017ab){var _0x40e05d=_0x3410da[_0x25fa('0x11')];var _0x15eaa4={};var _0x3b675b=_0x3410da[_0x25fa('0x12')];if(_0x15eaa4){_0x15eaa4=_[_0x25fa('0x13')](_0x3410da['body']);_0x15eaa4=_[_0x25fa('0x14')](_0x15eaa4,[_0x25fa('0x15'),'html',_0x25fa('0x16'),_0x25fa('0x17'),_0x25fa('0x18')]);}updateUser(_0x40e05d,_0x15eaa4,_0x3b675b,_0x26d622,_0x507c52);_0x5017ab(null);};}; \ No newline at end of file +var _0xbeea=['mail-interactions','fax-interactions','sms-interactions','upperFirst','InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','null','findOne','then','catch','error','tracked','user','query','clone','body','html','phone','fax','../../config/logger','openchannel-interactions'];(function(_0x12bba0,_0x822898){var _0x5376ff=function(_0x37f1e9){while(--_0x37f1e9){_0x12bba0['push'](_0x12bba0['shift']());}};_0x5376ff(++_0x822898);}(_0xbeea,0x18e));var _0xabee=function(_0x14d2f3,_0x4742a1){_0x14d2f3=_0x14d2f3-0x0;var _0xdac8b0=_0xbeea[_0x14d2f3];return _0xdac8b0;};'use strict';var _=require('lodash');var db=require('../../mysqldb')['db'];var loggers={'openchannel':require(_0xabee('0x0'))(_0xabee('0x1')),'mail':require('../../config/logger')(_0xabee('0x2')),'fax':require('../../config/logger')(_0xabee('0x3')),'sms':require(_0xabee('0x0'))(_0xabee('0x4')),'chat':require(_0xabee('0x0'))('chat-interactions')};function getInteractionId(_0x508587,_0x41f2c8,_0x213064){if(_0x508587&&_0x508587[_[_0xabee('0x5')](_0x213064)+_0xabee('0x6')]){return _0x508587[_[_0xabee('0x5')](_0x213064)+'InteractionId'];}else if(_0x508587&&_0x508587['id']){return _0x508587['id'];}else if(_0x41f2c8&&_0x41f2c8['id']){return _0x41f2c8['id'];}else{return _0xabee('0x7');}}function log(_0x527b4f,_0x3ee081,_0x483a74,_0x5a7bcd,_0x45f90d,_0x44f6c0){loggers[_0x45f90d[_0xabee('0x8')]()][_0x527b4f](_0xabee('0x9'),_0x44f6c0[_0xabee('0xa')](),_0x3ee081?_0x3ee081['id']:null,_0x3ee081?_0x3ee081[_0xabee('0xb')]:null,_0x3ee081?_0x3ee081['role']:null,getInteractionId(_0x483a74,_0x5a7bcd,_0x45f90d),_0x483a74?JSON['stringify'](_0x483a74):_0xabee('0xc'));}function updateUser(_0x5d2003,_0x4e4972,_0x4ac79f,_0x53d819,_0xd5c981){db[_[_0xabee('0x5')](_0x53d819)+'Interaction'][_0xabee('0xd')]({'where':{'id':getInteractionId(_0x4e4972,_0x4ac79f,_0x53d819)}})[_0xabee('0xe')](function(_0x5cffa7){if(_0x5cffa7){return _0x5cffa7['update']({'UserId':_0x5d2003?_0x5d2003['id']:null});}})[_0xabee('0xe')](function(_0x2e0aa0){if(_0x2e0aa0){log('info',_0x5d2003,_0x4e4972,_0x4ac79f,_0x53d819,_0xd5c981);}})[_0xabee('0xf')](function(){log(_0xabee('0x10'),_0x5d2003,_0x4e4972,_0x4ac79f,_0x53d819,_0xd5c981);});}exports[_0xabee('0x11')]=function(_0x17e199,_0x51db91){return function(_0x51c508,_0x337aaf,_0x38bae5){var _0x8a78f3=_0x51c508[_0xabee('0x12')];var _0x20b4dc={};var _0x7bc9a0=_0x51c508[_0xabee('0x13')];if(_0x20b4dc){_0x20b4dc=_[_0xabee('0x14')](_0x51c508[_0xabee('0x15')]);_0x20b4dc=_['omit'](_0x20b4dc,[_0xabee('0x15'),_0xabee('0x16'),_0xabee('0x17'),_0xabee('0x18'),'mobile']);}updateUser(_0x8a78f3,_0x20b4dc,_0x7bc9a0,_0x17e199,_0x51db91);_0x38bae5(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 48b6a18..133b919 100644 --- a/server/components/license/service.js +++ b/server/components/license/service.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2e8e=['utf8','parse','hasOwnProperty','use','License','findOne','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','admin','user','isUserLimit','crypto','composable-middleware','../../mysqldb','data1','license','split','createDecipher','format','%s:%s:%s','update','base64','final'];(function(_0x3011b7,_0x56b4b0){var _0x304ca2=function(_0x5832be){while(--_0x5832be){_0x3011b7['push'](_0x3011b7['shift']());}};_0x304ca2(++_0x56b4b0);}(_0x2e8e,0x133));var _0xe2e8=function(_0x52f159,_0x419d8a){_0x52f159=_0x52f159-0x0;var _0x156799=_0x2e8e[_0x52f159];return _0x156799;};'use strict';var crypto=require(_0xe2e8('0x0'));var util=require('util');var compose=require(_0xe2e8('0x1'));var db=require(_0xe2e8('0x2'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x19649a,_0x5e15d8){if(_0x19649a&&_0x5e15d8){if(_0x5e15d8[_0xe2e8('0x3')]&&_0x5e15d8[_0xe2e8('0x4')]){var _0x56857d=_0x5e15d8['data1'];var _0x570a83=_0x5e15d8['license'];var _0x35bbe3=_0x56857d[_0xe2e8('0x5')]('-')[0x4];var _0x32b59a=_0x56857d[_0xe2e8('0x5')]('-')[0x0];var _0x1ff48f=crypto[_0xe2e8('0x6')]('aes-256-ctr',util[_0xe2e8('0x7')](_0xe2e8('0x8'),_0x35bbe3,_0x56857d,_0x32b59a));var _0xd8e75b=_0x1ff48f[_0xe2e8('0x9')](_0x570a83,_0xe2e8('0xa'),'utf8');_0xd8e75b+=_0x1ff48f[_0xe2e8('0xb')](_0xe2e8('0xc'));var _0xadfd95=JSON[_0xe2e8('0xd')](_0xd8e75b);return _0xadfd95[_0xe2e8('0xe')](_0x19649a)?_0xadfd95[_0x19649a]:null;}}return null;}function isLimit(_0x163282,_0x10a439,_0x3312d0,_0x50ed6c){var _0x2903b5=_0x10a439;return compose()[_0xe2e8('0xf')](function(_0xeaf36b,_0x4a2243,_0xbfdce4){return db[_0xe2e8('0x10')][_0xe2e8('0x11')]({'where':{'id':0x1},'raw':!![]})[_0xe2e8('0x12')](function(_0xcee2ff){var _0xea33=getValueFromLicense(_0x163282,_0xcee2ff);return _0xea33?_0xea33:_0x2903b5;})[_0xe2e8('0x12')](function(_0x33216d){_0x2903b5=_0x33216d;return _0x3312d0[_0xe2e8('0x13')](_0x50ed6c);})['then'](function(_0x30080c){if(_0x30080c>=_0x2903b5){return _0x4a2243[_0xe2e8('0x14')](0x193)[_0xe2e8('0x15')]({'message':util[_0xe2e8('0x7')](_0xe2e8('0x16'),_0x163282)});}_0xbfdce4();})[_0xe2e8('0x17')](function(_0x1c885d){_0xbfdce4(_0x1c885d);});});}function isUserLimit(){return isLimit(_0xe2e8('0x18'),0x1,db[_0xe2e8('0x19')],{'where':{'$or':[{'role':_0xe2e8('0x1a')},{'role':_0xe2e8('0x1b')}]}});}exports[_0xe2e8('0x1c')]=isUserLimit; \ No newline at end of file +var _0x9fff=['data1','license','split','aes-256-ctr','format','update','base64','utf8','parse','use','findOne','then','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','admin','crypto','composable-middleware','../../mysqldb','../../config/environment'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0x9fff,0x122));var _0xf9ff=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9fff[_0x3dd15e];return _0x231fd0;};'use strict';var crypto=require(_0xf9ff('0x0'));var util=require('util');var compose=require(_0xf9ff('0x1'));var db=require(_0xf9ff('0x2'))['db'];var config=require(_0xf9ff('0x3'));function getValueFromLicense(_0x3522fb,_0x2d4283){if(_0x3522fb&&_0x2d4283){if(_0x2d4283[_0xf9ff('0x4')]&&_0x2d4283[_0xf9ff('0x5')]){var _0x370cd0=_0x2d4283[_0xf9ff('0x4')];var _0x44182e=_0x2d4283[_0xf9ff('0x5')];var _0x1ea725=_0x370cd0[_0xf9ff('0x6')]('-')[0x4];var _0x49c722=_0x370cd0[_0xf9ff('0x6')]('-')[0x0];var _0x3c795d=crypto['createDecipher'](_0xf9ff('0x7'),util[_0xf9ff('0x8')]('%s:%s:%s',_0x1ea725,_0x370cd0,_0x49c722));var _0x21fad9=_0x3c795d[_0xf9ff('0x9')](_0x44182e,_0xf9ff('0xa'),'utf8');_0x21fad9+=_0x3c795d['final'](_0xf9ff('0xb'));var _0x21fd35=JSON[_0xf9ff('0xc')](_0x21fad9);return _0x21fd35['hasOwnProperty'](_0x3522fb)?_0x21fd35[_0x3522fb]:null;}}return null;}function isLimit(_0x19a28d,_0x156d43,_0x48de8c,_0x1d5e71){var _0x498370=_0x156d43;return compose()[_0xf9ff('0xd')](function(_0x378291,_0x349b0c,_0x34cc91){return db['License'][_0xf9ff('0xe')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x3cb93b){var _0x3d3745=getValueFromLicense(_0x19a28d,_0x3cb93b);return _0x3d3745?_0x3d3745:_0x498370;})[_0xf9ff('0xf')](function(_0x24139d){_0x498370=_0x24139d;return _0x48de8c['count'](_0x1d5e71);})[_0xf9ff('0xf')](function(_0x3f44be){if(_0x3f44be>=_0x498370){return _0x349b0c['status'](0x193)[_0xf9ff('0x10')]({'message':util[_0xf9ff('0x8')](_0xf9ff('0x11'),_0x19a28d)});}_0x34cc91();})[_0xf9ff('0x12')](function(_0x3513e9){_0x34cc91(_0x3513e9);});});}function isUserLimit(){return isLimit(_0xf9ff('0x13'),0x1,db['User'],{'where':{'$or':[{'role':_0xf9ff('0x14')},{'role':'user'}]}});}exports['isUserLimit']=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index b4944bc..7939b13 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 _0xa8d8=['$in','NOT\x20IN\x20?','=\x20?','<>\x20?','$substring','$startsWith','$endsWith','$lt','>\x20?','<=\x20?','$gte','>=\x20?','start','pop','utcOffset','format','add','minutes','seconds','lodash','moment','sqlOperator','startsWith','and','[$and]','replace','[$or]','length','split','slice','shift','match','forEach','indexOf','map','conditions','DATE','$eq','operator','$between','value','includes','$gt','$lte','days','YYYY-MM-DD','castTo','text','CAST(','\x20AS\x20','$ne','$notIn','\x20OR\x20','field'];(function(_0x20fd05,_0x28be1c){var _0x3e474b=function(_0x3af475){while(--_0x3af475){_0x20fd05['push'](_0x20fd05['shift']());}};_0x3e474b(++_0x28be1c);}(_0xa8d8,0x7f));var _0x8a8d=function(_0x4934aa,_0x55d2a3){_0x4934aa=_0x4934aa-0x0;var _0x59dd38=_0xa8d8[_0x4934aa];return _0x59dd38;};'use strict';var _=require(_0x8a8d('0x0'));var moment=require(_0x8a8d('0x1'));exports['parseSearch']=function(_0x2e6558){var _0x99d764={'conditions':[]};_0x99d764[_0x8a8d('0x2')]=_[_0x8a8d('0x3')](_0x2e6558,'[$or]')?'or':_0x8a8d('0x4');var _0x2aea8a=_0x2e6558['replace'](_0x8a8d('0x5'),'')[_0x8a8d('0x6')](_0x8a8d('0x7'),'')['split']('||');for(var _0x24a96e=0x0;_0x24a96e<_0x2aea8a[_0x8a8d('0x8')];_0x24a96e++){var _0x3737d2=_0x2aea8a[_0x24a96e][_0x8a8d('0x9')](':=');var _0x78b801=_0x3737d2[0x0];var _0x2f4527=_0x3737d2[_0x8a8d('0xa')](0x1);_0x2f4527['forEach'](function(_0x4c9742){var _0x4b952b=_0x4c9742[_0x8a8d('0x9')]('[')[_0x8a8d('0xb')]();var _0x4da04f=_0x4c9742[_0x8a8d('0xc')](/\[(.*?)\]/g);_0x4da04f[_0x8a8d('0xd')](function(_0x50f746){var _0x3fe631=_0x50f746['split']('[')['filter'](function(_0x3b4100){return _0x3b4100[_0x8a8d('0xe')](']')>-0x1;})[_0x8a8d('0xf')](function(_0x5b3771){return _0x5b3771[_0x8a8d('0x9')](']')[0x0];})[0x0];_0x99d764[_0x8a8d('0x10')]['push']({'field':_0x78b801,'operator':_0x4b952b,'value':_0x3fe631});});});}return _0x99d764;};exports['buildExpression']=function(_0x44a777,_0xd0da67,_0x36c608){var _0x4b1c71={};if(_0xd0da67===_0x8a8d('0x11')){if(_0x36c608['operator']===_0x8a8d('0x12')){_0x36c608[_0x8a8d('0x13')]=_0x8a8d('0x14');_0x36c608[_0x8a8d('0x15')]+=','+_0x36c608[_0x8a8d('0x15')];}else if(_[_0x8a8d('0x16')]([_0x8a8d('0x17'),_0x8a8d('0x18')],_0x36c608[_0x8a8d('0x13')])){_0x36c608[_0x8a8d('0x15')]=moment(_0x36c608['value'])['add'](0x1,_0x8a8d('0x19'))['format'](_0x8a8d('0x1a'));}}if(_0x36c608[_0x8a8d('0x1b')]){_0xd0da67=_0x36c608[_0x8a8d('0x1b')];_0x4b1c71[_0x8a8d('0x1c')]=_0x8a8d('0x1d')+_0x44a777+'.'+_0x36c608['field']+_0x8a8d('0x1e')+_0x36c608[_0x8a8d('0x1b')]+')\x20'+parseOperator(_0x36c608[_0x8a8d('0x13')]);}else{_0x4b1c71[_0x8a8d('0x1c')]=_0x44a777+'.'+_0x36c608['field']+'\x20'+parseOperator(_0x36c608[_0x8a8d('0x13')]);}if(_[_0x8a8d('0x16')]([_0x8a8d('0x1f'),_0x8a8d('0x20')],_0x36c608['operator']))_0x4b1c71[_0x8a8d('0x1c')]='('+_0x4b1c71['text']+_0x8a8d('0x21')+_0x44a777+'.'+_0x36c608[_0x8a8d('0x22')]+'\x20IS\x20NULL)';_0x4b1c71['value']=parseValue(_0xd0da67,_0x36c608['operator'],_0x36c608['value']);return _0x4b1c71;};function parseOperator(_0xf8fdd9){var _0x36d0f9;switch(_0xf8fdd9){case _0x8a8d('0x23'):_0x36d0f9='IN\x20?';break;case _0x8a8d('0x20'):_0x36d0f9=_0x8a8d('0x24');break;case _0x8a8d('0x12'):_0x36d0f9=_0x8a8d('0x25');break;case'$ne':_0x36d0f9=_0x8a8d('0x26');break;case _0x8a8d('0x27'):case _0x8a8d('0x28'):case _0x8a8d('0x29'):_0x36d0f9='LIKE\x20?';break;case _0x8a8d('0x2a'):_0x36d0f9='<\x20?';break;case _0x8a8d('0x17'):_0x36d0f9=_0x8a8d('0x2b');break;case _0x8a8d('0x18'):_0x36d0f9=_0x8a8d('0x2c');break;case _0x8a8d('0x2d'):_0x36d0f9=_0x8a8d('0x2e');break;case _0x8a8d('0x14'):_0x36d0f9='BETWEEN\x20?\x20AND\x20?';break;}return _0x36d0f9;}function parseValue(_0x3e109e,_0x53824c,_0x1731a7){var _0x393ba9={'start':undefined,'end':undefined};switch(_0x53824c){case _0x8a8d('0x23'):case'$notIn':_0x393ba9[_0x8a8d('0x2f')]=_0x1731a7[_0x8a8d('0x9')](',');break;case'$substring':_0x393ba9[_0x8a8d('0x2f')]='%'+_0x1731a7+'%';break;case'$startsWith':_0x393ba9[_0x8a8d('0x2f')]=_0x1731a7+'%';break;case _0x8a8d('0x29'):_0x393ba9[_0x8a8d('0x2f')]='%'+_0x1731a7;break;case _0x8a8d('0x14'):var _0x2e6b22=_0x1731a7['split'](',');var _0x1731a7=_0x2e6b22[_0x8a8d('0xb')]();var _0x56cd02=_0x2e6b22[_0x8a8d('0x30')]();if(_0x3e109e===_0x8a8d('0x11')){_0x1731a7=moment(_0x1731a7)[_0x8a8d('0x31')](0x0,!![])[_0x8a8d('0x32')]();_0x56cd02=moment(_0x56cd02)[_0x8a8d('0x31')](0x0,!![])[_0x8a8d('0x33')](0x17,'hours')[_0x8a8d('0x33')](0x3b,_0x8a8d('0x34'))[_0x8a8d('0x33')](0x3b,_0x8a8d('0x35'))[_0x8a8d('0x32')]();}_0x393ba9={'start':_0x1731a7,'end':_0x56cd02};break;default:_0x393ba9[_0x8a8d('0x2f')]=_0x1731a7;break;}return _0x393ba9;} \ No newline at end of file +var _0xfe6d=['forEach','shift','map','push','buildExpression','operator','$eq','$between','value','includes','$gt','add','days','format','YYYY-MM-DD','text','CAST(','field','\x20AS\x20','castTo','$ne','$notIn','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','=\x20?','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','>\x20?','$lte','$gte','BETWEEN\x20?\x20AND\x20?','start','pop','DATE','utcOffset','hours','minutes','seconds','lodash','moment','parseSearch','sqlOperator','startsWith','[$or]','and','replace','[$and]','split','length','slice'];(function(_0x4fa0ea,_0x2cd534){var _0x51d027=function(_0xe67342){while(--_0xe67342){_0x4fa0ea['push'](_0x4fa0ea['shift']());}};_0x51d027(++_0x2cd534);}(_0xfe6d,0x1e3));var _0xdfe6=function(_0x9edfd5,_0x286486){_0x9edfd5=_0x9edfd5-0x0;var _0x330738=_0xfe6d[_0x9edfd5];return _0x330738;};'use strict';var _=require(_0xdfe6('0x0'));var moment=require(_0xdfe6('0x1'));exports[_0xdfe6('0x2')]=function(_0x57a1bf){var _0x5217f6={'conditions':[]};_0x5217f6[_0xdfe6('0x3')]=_[_0xdfe6('0x4')](_0x57a1bf,_0xdfe6('0x5'))?'or':_0xdfe6('0x6');var _0x4b6185=_0x57a1bf[_0xdfe6('0x7')](_0xdfe6('0x8'),'')['replace'](_0xdfe6('0x5'),'')[_0xdfe6('0x9')]('||');for(var _0x255d06=0x0;_0x255d06<_0x4b6185[_0xdfe6('0xa')];_0x255d06++){var _0x519bdc=_0x4b6185[_0x255d06][_0xdfe6('0x9')](':=');var _0x158b42=_0x519bdc[0x0];var _0x5dd1e7=_0x519bdc[_0xdfe6('0xb')](0x1);_0x5dd1e7[_0xdfe6('0xc')](function(_0x39f557){var _0x22b47b=_0x39f557[_0xdfe6('0x9')]('[')[_0xdfe6('0xd')]();var _0x2c446b=_0x39f557['match'](/\[(.*?)\]/g);_0x2c446b['forEach'](function(_0x2d5323){var _0x42a73f=_0x2d5323[_0xdfe6('0x9')]('[')['filter'](function(_0x222c5a){return _0x222c5a['indexOf'](']')>-0x1;})[_0xdfe6('0xe')](function(_0x275f26){return _0x275f26['split'](']')[0x0];})[0x0];_0x5217f6['conditions'][_0xdfe6('0xf')]({'field':_0x158b42,'operator':_0x22b47b,'value':_0x42a73f});});});}return _0x5217f6;};exports[_0xdfe6('0x10')]=function(_0x22e365,_0x1b3a65,_0x5ad572){var _0xf32ffc={};if(_0x1b3a65==='DATE'){if(_0x5ad572[_0xdfe6('0x11')]===_0xdfe6('0x12')){_0x5ad572['operator']=_0xdfe6('0x13');_0x5ad572[_0xdfe6('0x14')]+=','+_0x5ad572['value'];}else if(_[_0xdfe6('0x15')]([_0xdfe6('0x16'),'$lte'],_0x5ad572[_0xdfe6('0x11')])){_0x5ad572[_0xdfe6('0x14')]=moment(_0x5ad572['value'])[_0xdfe6('0x17')](0x1,_0xdfe6('0x18'))[_0xdfe6('0x19')](_0xdfe6('0x1a'));}}if(_0x5ad572['castTo']){_0x1b3a65=_0x5ad572['castTo'];_0xf32ffc[_0xdfe6('0x1b')]=_0xdfe6('0x1c')+_0x22e365+'.'+_0x5ad572[_0xdfe6('0x1d')]+_0xdfe6('0x1e')+_0x5ad572[_0xdfe6('0x1f')]+')\x20'+parseOperator(_0x5ad572[_0xdfe6('0x11')]);}else{_0xf32ffc[_0xdfe6('0x1b')]=_0x22e365+'.'+_0x5ad572['field']+'\x20'+parseOperator(_0x5ad572[_0xdfe6('0x11')]);}if(_['includes']([_0xdfe6('0x20'),_0xdfe6('0x21')],_0x5ad572[_0xdfe6('0x11')]))_0xf32ffc[_0xdfe6('0x1b')]='('+_0xf32ffc[_0xdfe6('0x1b')]+'\x20OR\x20'+_0x22e365+'.'+_0x5ad572[_0xdfe6('0x1d')]+_0xdfe6('0x22');_0xf32ffc[_0xdfe6('0x14')]=parseValue(_0x1b3a65,_0x5ad572[_0xdfe6('0x11')],_0x5ad572[_0xdfe6('0x14')]);return _0xf32ffc;};function parseOperator(_0x538e8b){var _0x6e414d;switch(_0x538e8b){case _0xdfe6('0x23'):_0x6e414d=_0xdfe6('0x24');break;case _0xdfe6('0x21'):_0x6e414d=_0xdfe6('0x25');break;case'$eq':_0x6e414d=_0xdfe6('0x26');break;case _0xdfe6('0x20'):_0x6e414d=_0xdfe6('0x27');break;case _0xdfe6('0x28'):case _0xdfe6('0x29'):case _0xdfe6('0x2a'):_0x6e414d=_0xdfe6('0x2b');break;case'$lt':_0x6e414d='<\x20?';break;case _0xdfe6('0x16'):_0x6e414d=_0xdfe6('0x2c');break;case _0xdfe6('0x2d'):_0x6e414d='<=\x20?';break;case _0xdfe6('0x2e'):_0x6e414d='>=\x20?';break;case _0xdfe6('0x13'):_0x6e414d=_0xdfe6('0x2f');break;}return _0x6e414d;}function parseValue(_0x3b7178,_0x8e69ac,_0x35ac7c){var _0xb02a93={'start':undefined,'end':undefined};switch(_0x8e69ac){case _0xdfe6('0x23'):case _0xdfe6('0x21'):_0xb02a93['start']=_0x35ac7c[_0xdfe6('0x9')](',');break;case _0xdfe6('0x28'):_0xb02a93[_0xdfe6('0x30')]='%'+_0x35ac7c+'%';break;case'$startsWith':_0xb02a93[_0xdfe6('0x30')]=_0x35ac7c+'%';break;case _0xdfe6('0x2a'):_0xb02a93[_0xdfe6('0x30')]='%'+_0x35ac7c;break;case _0xdfe6('0x13'):var _0x59bfb5=_0x35ac7c[_0xdfe6('0x9')](',');var _0x35ac7c=_0x59bfb5[_0xdfe6('0xd')]();var _0x2a68c3=_0x59bfb5[_0xdfe6('0x31')]();if(_0x3b7178===_0xdfe6('0x32')){_0x35ac7c=moment(_0x35ac7c)[_0xdfe6('0x33')](0x0,!![])['format']();_0x2a68c3=moment(_0x2a68c3)['utcOffset'](0x0,!![])[_0xdfe6('0x17')](0x17,_0xdfe6('0x34'))[_0xdfe6('0x17')](0x3b,_0xdfe6('0x35'))['add'](0x3b,_0xdfe6('0x36'))['format']();}_0xb02a93={'start':_0x35ac7c,'end':_0x2a68c3};break;default:_0xb02a93[_0xdfe6('0x30')]=_0x35ac7c;break;}return _0xb02a93;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 9213042..3d8338e 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 _0x7d9c=['sort','map','indexOf','priority','col','unsigned','DESC','cast','ASC','omit','length','isString','hasOwnProperty','match','^[0-9]*$','isEmail','forEach','push','toString','lodash','split','filters','isEmpty','isArray','parse','limit','offset'];(function(_0x4f0f76,_0x421046){var _0x243d18=function(_0x3c3a8d){while(--_0x3c3a8d){_0x4f0f76['push'](_0x4f0f76['shift']());}};_0x243d18(++_0x421046);}(_0x7d9c,0x13c));var _0xc7d9=function(_0x15063b,_0x157045){_0x15063b=_0x15063b-0x0;var _0x381de5=_0x7d9c[_0x15063b];return _0x381de5;};'use strict';var _=require(_0xc7d9('0x0'));var sequelize=require('sequelize');var LIMIT_VALUE=0xfa;exports['fields']=function(_0x4a7bc4){var _0x562a94=null;if(_0x4a7bc4){_0x562a94=_0x4a7bc4[_0xc7d9('0x1')](',');}return _0x562a94;};exports[_0xc7d9('0x2')]=function(_0x241878){var _0x178983={};if(!_[_0xc7d9('0x3')](_0x241878)){_0x178983={};_['forOwn'](_0x241878,function(_0x1680d6,_0x45ab3c){try{_0x178983[_0x45ab3c]=_[_0xc7d9('0x4')](_0x1680d6)?_0x1680d6:JSON[_0xc7d9('0x5')](_0x1680d6);}catch(_0x34db03){_0x178983[_0x45ab3c]=_0x1680d6['split'](',');}});}return _0x178983;};exports[_0xc7d9('0x6')]=function(_0x8e800d){_0x8e800d=parseInt(_0x8e800d,0xa);if(!_0x8e800d||_0x8e800d<0x0){_0x8e800d=LIMIT_VALUE;}return _0x8e800d;};exports[_0xc7d9('0x7')]=function(_0xa8c8d5){_0xa8c8d5=parseInt(_0xa8c8d5,0xa);if(!_0xa8c8d5||_0xa8c8d5<0x0){_0xa8c8d5=0x0;}return _0xa8c8d5;};exports[_0xc7d9('0x8')]=function(_0x5eb907){var _0x3387f8,_0x9cf69b=null;if(_0x5eb907){_0x3387f8=_0x5eb907[_0xc7d9('0x1')](',');_0x9cf69b=_[_0xc7d9('0x9')](_0x3387f8,function(_0x2ea84b){if(_0x2ea84b[_0xc7d9('0xa')]('-')===0x0){return[_0x2ea84b===_0xc7d9('0xb')?sequelize['cast'](sequelize[_0xc7d9('0xc')](_0xc7d9('0xb')),_0xc7d9('0xd')):_0x2ea84b['substr'](0x1),_0xc7d9('0xe')];}else{return[_0x2ea84b===_0xc7d9('0xb')?sequelize[_0xc7d9('0xf')](sequelize[_0xc7d9('0xc')](_0xc7d9('0xb')),_0xc7d9('0xd')):_0x2ea84b,_0xc7d9('0x10')];}});}return _0x9cf69b;};exports[_0xc7d9('0x11')]=function(_0xa6685e,_0x248634){if(_[_0xc7d9('0x3')](_0xa6685e)){return _0xa6685e;}if(_[_0xc7d9('0x4')](_0xa6685e)){for(var _0x1ad8ea=0x0;_0x1ad8ea<_0xa6685e[_0xc7d9('0x12')];_0x1ad8ea+=0x1){_0xa6685e[_0x1ad8ea]=this[_0xc7d9('0x11')](_0xa6685e[_0x1ad8ea],_0x248634);}return _0xa6685e;}if(!_['isObject'](_0xa6685e)){return _0xa6685e;}if(_[_0xc7d9('0x13')](_0x248634)){_0x248634=[_0x248634];}if(!_[_0xc7d9('0x4')](_0x248634)){return _0xa6685e;}for(var _0x58ec22=0x0;_0x58ec22<_0x248634[_0xc7d9('0x12')];_0x58ec22+=0x1){_['unset'](_0xa6685e,_0x248634[_0x58ec22]);}for(var _0x3aa1ed in _0xa6685e){if(_0xa6685e[_0xc7d9('0x14')](_0x3aa1ed)){_0xa6685e[_0x3aa1ed]=this['omit'](_0xa6685e[_0x3aa1ed],_0x248634);}}return _0xa6685e;};exports['isNumeric']=function(_0x3e1a52){return _0x3e1a52[_0xc7d9('0x15')](RegExp(_0xc7d9('0x16')))?!![]:![];};exports[_0xc7d9('0x17')]=function(_0x2186b0){return _0x2186b0[_0xc7d9('0x15')](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x3f9e1f){var _0x66c368=[];_0x3f9e1f[_0xc7d9('0x1')]('\x20')[_0xc7d9('0x18')](function(_0x2e9d8b){_0x66c368[_0xc7d9('0x19')]('+'+_0x2e9d8b[_0xc7d9('0x1a')]()+'*');});return _0x66c368['join']('\x20');}; \ No newline at end of file +var _0xb35c=['isString','hasOwnProperty','isNumeric','match','isEmail','getFullTextValue','push','toString','join','lodash','sequelize','isEmpty','forOwn','isArray','parse','split','offset','sort','map','priority','col','DESC','cast','unsigned','ASC','omit','length','isObject'];(function(_0x26ff5c,_0x3f3c92){var _0x13c345=function(_0x5d6cef){while(--_0x5d6cef){_0x26ff5c['push'](_0x26ff5c['shift']());}};_0x13c345(++_0x3f3c92);}(_0xb35c,0x79));var _0xcb35=function(_0x3852e4,_0x43479f){_0x3852e4=_0x3852e4-0x0;var _0x2f63ba=_0xb35c[_0x3852e4];return _0x2f63ba;};'use strict';var _=require(_0xcb35('0x0'));var sequelize=require(_0xcb35('0x1'));var LIMIT_VALUE=0xfa;exports['fields']=function(_0x6df6dd){var _0x485695=null;if(_0x6df6dd){_0x485695=_0x6df6dd['split'](',');}return _0x485695;};exports['filters']=function(_0x2bc325){var _0x226771={};if(!_[_0xcb35('0x2')](_0x2bc325)){_0x226771={};_[_0xcb35('0x3')](_0x2bc325,function(_0x4ffd62,_0x4ae994){try{_0x226771[_0x4ae994]=_[_0xcb35('0x4')](_0x4ffd62)?_0x4ffd62:JSON[_0xcb35('0x5')](_0x4ffd62);}catch(_0x49105a){_0x226771[_0x4ae994]=_0x4ffd62[_0xcb35('0x6')](',');}});}return _0x226771;};exports['limit']=function(_0x28d111){_0x28d111=parseInt(_0x28d111,0xa);if(!_0x28d111||_0x28d111<0x0){_0x28d111=LIMIT_VALUE;}return _0x28d111;};exports[_0xcb35('0x7')]=function(_0x18d17f){_0x18d17f=parseInt(_0x18d17f,0xa);if(!_0x18d17f||_0x18d17f<0x0){_0x18d17f=0x0;}return _0x18d17f;};exports[_0xcb35('0x8')]=function(_0x24e752){var _0x14fbbd,_0x579a48=null;if(_0x24e752){_0x14fbbd=_0x24e752[_0xcb35('0x6')](',');_0x579a48=_[_0xcb35('0x9')](_0x14fbbd,function(_0x847017){if(_0x847017['indexOf']('-')===0x0){return[_0x847017===_0xcb35('0xa')?sequelize['cast'](sequelize[_0xcb35('0xb')](_0xcb35('0xa')),'unsigned'):_0x847017['substr'](0x1),_0xcb35('0xc')];}else{return[_0x847017===_0xcb35('0xa')?sequelize[_0xcb35('0xd')](sequelize[_0xcb35('0xb')](_0xcb35('0xa')),_0xcb35('0xe')):_0x847017,_0xcb35('0xf')];}});}return _0x579a48;};exports[_0xcb35('0x10')]=function(_0x27460b,_0x2a858f){if(_[_0xcb35('0x2')](_0x27460b)){return _0x27460b;}if(_[_0xcb35('0x4')](_0x27460b)){for(var _0x48ce0c=0x0;_0x48ce0c<_0x27460b[_0xcb35('0x11')];_0x48ce0c+=0x1){_0x27460b[_0x48ce0c]=this[_0xcb35('0x10')](_0x27460b[_0x48ce0c],_0x2a858f);}return _0x27460b;}if(!_[_0xcb35('0x12')](_0x27460b)){return _0x27460b;}if(_[_0xcb35('0x13')](_0x2a858f)){_0x2a858f=[_0x2a858f];}if(!_[_0xcb35('0x4')](_0x2a858f)){return _0x27460b;}for(var _0x38638f=0x0;_0x38638f<_0x2a858f['length'];_0x38638f+=0x1){_['unset'](_0x27460b,_0x2a858f[_0x38638f]);}for(var _0x21a515 in _0x27460b){if(_0x27460b[_0xcb35('0x14')](_0x21a515)){_0x27460b[_0x21a515]=this[_0xcb35('0x10')](_0x27460b[_0x21a515],_0x2a858f);}}return _0x27460b;};exports[_0xcb35('0x15')]=function(_0x1938a8){return _0x1938a8[_0xcb35('0x16')](RegExp('^[0-9]*$'))?!![]:![];};exports[_0xcb35('0x17')]=function(_0x88d05f){return _0x88d05f[_0xcb35('0x16')](/^\S+@\S+$/)?!![]:![];};exports[_0xcb35('0x18')]=function(_0x4e28ba){var _0x51d33a=[];_0x4e28ba[_0xcb35('0x6')]('\x20')['forEach'](function(_0x17d6fc){_0x51d33a[_0xcb35('0x19')]('+'+_0x17d6fc[_0xcb35('0x1a')]()+'*');});return _0x51d33a[_0xcb35('0x1b')]('\x20');}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 849da88..987c983 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4228=['appPath','join','root','public','development','test','client','json\x20replacer','toISOString','split','use','static','views','html','ejs','view\x20engine','urlencoded','json','50mb','express','serve-favicon','body-parser','method-override','cookie-parser','errorhandler','path','passport','cors','moment','./environment','default','get','env','production','set'];(function(_0x5eebe0,_0x13e01d){var _0x3c07e1=function(_0x2266c8){while(--_0x2266c8){_0x5eebe0['push'](_0x5eebe0['shift']());}};_0x3c07e1(++_0x13e01d);}(_0x4228,0x194));var _0x8422=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4228[_0x3dd15e];return _0x231fd0;};'use strict';var express=require(_0x8422('0x0'));var favicon=require(_0x8422('0x1'));var bodyParser=require(_0x8422('0x2'));var methodOverride=require(_0x8422('0x3'));var cookieParser=require(_0x8422('0x4'));var errorHandler=require(_0x8422('0x5'));var path=require(_0x8422('0x6'));var passport=require(_0x8422('0x7'));var cors=require(_0x8422('0x8'));var moment=require(_0x8422('0x9'));var config=require(_0x8422('0xa'));var db=require('../mysqldb')['db'];exports[_0x8422('0xb')]=function(_0x10e13f){var _0x2174fa=_0x10e13f[_0x8422('0xc')](_0x8422('0xd'));if(_0x2174fa===_0x8422('0xe')){_0x10e13f[_0x8422('0xf')](_0x8422('0x10'),path[_0x8422('0x11')](config[_0x8422('0x12')],_0x8422('0x13')));}if(_0x2174fa===_0x8422('0x14')||_0x2174fa===_0x8422('0x15')){_0x10e13f[_0x8422('0xf')]('appPath',path['join'](config[_0x8422('0x12')],_0x8422('0x16')));_0x10e13f['use'](errorHandler());}_0x10e13f[_0x8422('0xf')](_0x8422('0x17'),function(_0x1fc471,_0x52655a){if(this[_0x1fc471]instanceof Date){_0x52655a=this[_0x1fc471][_0x8422('0x18')]()[_0x8422('0x19')]('.')[0x0]+'Z';}return _0x52655a;});_0x10e13f[_0x8422('0x1a')](express[_0x8422('0x1b')](_0x10e13f[_0x8422('0xc')]('appPath')));_0x10e13f[_0x8422('0xf')](_0x8422('0x1c'),config[_0x8422('0x12')]+'/server/views');_0x10e13f['engine'](_0x8422('0x1d'),require(_0x8422('0x1e'))['renderFile']);_0x10e13f[_0x8422('0xf')](_0x8422('0x1f'),_0x8422('0x1d'));_0x10e13f[_0x8422('0x1a')](bodyParser[_0x8422('0x20')]({'limit':'50mb','extended':!![]}));_0x10e13f['use'](bodyParser[_0x8422('0x21')]({'limit':_0x8422('0x22')}));_0x10e13f[_0x8422('0x1a')](cors());_0x10e13f[_0x8422('0x1a')](methodOverride());_0x10e13f[_0x8422('0x1a')](cookieParser());_0x10e13f[_0x8422('0x1a')](passport['initialize']());}; \ No newline at end of file +var _0x4cb3=['root','development','test','client','json\x20replacer','split','use','views','/server/views','engine','html','renderFile','view\x20engine','50mb','initialize','serve-favicon','body-parser','method-override','errorhandler','path','passport','cors','moment','./environment','default','get','env','production','set','appPath','join'];(function(_0x2f847f,_0x543c2d){var _0xc2ab79=function(_0xcb23e6){while(--_0xcb23e6){_0x2f847f['push'](_0x2f847f['shift']());}};_0xc2ab79(++_0x543c2d);}(_0x4cb3,0xaa));var _0x34cb=function(_0x38a3b1,_0x44fa22){_0x38a3b1=_0x38a3b1-0x0;var _0x29ac54=_0x4cb3[_0x38a3b1];return _0x29ac54;};'use strict';var express=require('express');var favicon=require(_0x34cb('0x0'));var bodyParser=require(_0x34cb('0x1'));var methodOverride=require(_0x34cb('0x2'));var cookieParser=require('cookie-parser');var errorHandler=require(_0x34cb('0x3'));var path=require(_0x34cb('0x4'));var passport=require(_0x34cb('0x5'));var cors=require(_0x34cb('0x6'));var moment=require(_0x34cb('0x7'));var config=require(_0x34cb('0x8'));var db=require('../mysqldb')['db'];exports[_0x34cb('0x9')]=function(_0x160daa){var _0x291d16=_0x160daa[_0x34cb('0xa')](_0x34cb('0xb'));if(_0x291d16===_0x34cb('0xc')){_0x160daa[_0x34cb('0xd')](_0x34cb('0xe'),path[_0x34cb('0xf')](config[_0x34cb('0x10')],'public'));}if(_0x291d16===_0x34cb('0x11')||_0x291d16===_0x34cb('0x12')){_0x160daa[_0x34cb('0xd')]('appPath',path[_0x34cb('0xf')](config['root'],_0x34cb('0x13')));_0x160daa['use'](errorHandler());}_0x160daa[_0x34cb('0xd')](_0x34cb('0x14'),function(_0x4fc227,_0x20bff0){if(this[_0x4fc227]instanceof Date){_0x20bff0=this[_0x4fc227]['toISOString']()[_0x34cb('0x15')]('.')[0x0]+'Z';}return _0x20bff0;});_0x160daa[_0x34cb('0x16')](express['static'](_0x160daa[_0x34cb('0xa')](_0x34cb('0xe'))));_0x160daa['set'](_0x34cb('0x17'),config[_0x34cb('0x10')]+_0x34cb('0x18'));_0x160daa[_0x34cb('0x19')](_0x34cb('0x1a'),require('ejs')[_0x34cb('0x1b')]);_0x160daa[_0x34cb('0xd')](_0x34cb('0x1c'),_0x34cb('0x1a'));_0x160daa[_0x34cb('0x16')](bodyParser['urlencoded']({'limit':_0x34cb('0x1d'),'extended':!![]}));_0x160daa[_0x34cb('0x16')](bodyParser['json']({'limit':_0x34cb('0x1d')}));_0x160daa[_0x34cb('0x16')](cors());_0x160daa[_0x34cb('0x16')](methodOverride());_0x160daa[_0x34cb('0x16')](cookieParser());_0x160daa['use'](passport[_0x34cb('0x1e')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 6e01b0a..7a34bb2 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 _0xd67b=['getUuid','platform','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','macAddress','ipAddress','update','substring','crypto','child_process','execSync','networkInterfaces','orderBy','length','filter','family','IPv4','internal','concat','head','mac','address','getFirstInterface','cpus','map','model','join','createHash','md5','digest','hex'];(function(_0x5c8a11,_0x10805f){var _0x116b22=function(_0x10a697){while(--_0x10a697){_0x5c8a11['push'](_0x5c8a11['shift']());}};_0x116b22(++_0x10805f);}(_0xd67b,0x133));var _0xbd67=function(_0x46252a,_0x37c865){_0x46252a=_0x46252a-0x0;var _0x410388=_0xd67b[_0x46252a];return _0x410388;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0xbd67('0x0'));var machine=require('bimedia-machine-uuid');var exec=require(_0xbd67('0x1'))[_0xbd67('0x2')];function getInterfaces(){var _0x317e33=[];var _0x5e967b=os[_0xbd67('0x3')]();var _0x50da5a=_[_0xbd67('0x4')](_['keys'](_0x5e967b));for(var _0x309962=0x0;_0x309962<_0x50da5a[_0xbd67('0x5')];_0x309962++){var _0x2ad142=_0x5e967b[_0x50da5a[_0x309962]][_0xbd67('0x6')](function(_0x1860c9){return _0x1860c9[_0xbd67('0x7')]===_0xbd67('0x8')&&_0x1860c9[_0xbd67('0x9')]===![];});_0x317e33=_0x317e33[_0xbd67('0xa')](_0x2ad142);}return _0x317e33;}function getFirstInterface(){var _0x461231=_[_0xbd67('0xb')](getInterfaces());return{'macAddress':_0x461231&&_0x461231[_0xbd67('0xc')]?_0x461231[_0xbd67('0xc')]:'00:00:00:00:00:00','ipAddress':_0x461231&&_0x461231['address']?_0x461231[_0xbd67('0xd')]:'127.0.0.1'};}exports[_0xbd67('0xe')]=getFirstInterface;function getCPUhash(){var _0xb6b4b5=_[_0xbd67('0x4')](os[_0xbd67('0xf')]()[_0xbd67('0x10')](function(_0xb05237){return _0xb05237[_0xbd67('0x11')];}))[_0xbd67('0x12')](':');return crypto[_0xbd67('0x13')](_0xbd67('0x14'))['update'](_0xb6b4b5)[_0xbd67('0x15')](_0xbd67('0x16'));}exports[_0xbd67('0x17')]=function(){switch(os[_0xbd67('0x18')]()){case _0xbd67('0x19'):return exec(_0xbd67('0x1a'),{'encoding':_0xbd67('0x1b')})[_0xbd67('0x1c')]('\x0d\x0a','');default:var _0xa45c76=getFirstInterface();var _0x140df9=getCPUhash();var _0x591de9=_0x140df9+'|'+os['hostname']()+'|'+_0xa45c76[_0xbd67('0x1d')]+'|'+_0xa45c76[_0xbd67('0x1e')];var _0xff31b=crypto['createHash'](_0xbd67('0x14'))[_0xbd67('0x1f')](_0x591de9)[_0xbd67('0x15')]('hex');return _0xff31b[_0xbd67('0x20')](0x0,0x8)+'-'+_0xff31b['substring'](0x8,0xc)+'-'+_0xff31b[_0xbd67('0x20')](0xc,0x10)+'-'+_0xff31b[_0xbd67('0x20')](0x10,0x14)+'-'+_0xff31b[_0xbd67('0x20')](0x14);}}; \ No newline at end of file +var _0x3ca4=['replace','hostname','md5','substring','lodash','crypto','bimedia-machine-uuid','networkInterfaces','orderBy','keys','filter','family','IPv4','internal','concat','mac','00:00:00:00:00:00','address','getFirstInterface','cpus','map','model','join','createHash','update','digest','getUuid','win32','utf8'];(function(_0x16e5d8,_0x1b4e03){var _0x5a0db5=function(_0x5120de){while(--_0x5120de){_0x16e5d8['push'](_0x16e5d8['shift']());}};_0x5a0db5(++_0x1b4e03);}(_0x3ca4,0x17d));var _0x43ca=function(_0x5706d4,_0x4cde78){_0x5706d4=_0x5706d4-0x0;var _0x5e2920=_0x3ca4[_0x5706d4];return _0x5e2920;};'use strict';var _=require(_0x43ca('0x0'));var os=require('os');var crypto=require(_0x43ca('0x1'));var machine=require(_0x43ca('0x2'));var exec=require('child_process')['execSync'];function getInterfaces(){var _0x7e0bc1=[];var _0x368156=os[_0x43ca('0x3')]();var _0x23ce52=_[_0x43ca('0x4')](_[_0x43ca('0x5')](_0x368156));for(var _0x404034=0x0;_0x404034<_0x23ce52['length'];_0x404034++){var _0x14c38c=_0x368156[_0x23ce52[_0x404034]][_0x43ca('0x6')](function(_0x2e6edf){return _0x2e6edf[_0x43ca('0x7')]===_0x43ca('0x8')&&_0x2e6edf[_0x43ca('0x9')]===![];});_0x7e0bc1=_0x7e0bc1[_0x43ca('0xa')](_0x14c38c);}return _0x7e0bc1;}function getFirstInterface(){var _0x13e99d=_['head'](getInterfaces());return{'macAddress':_0x13e99d&&_0x13e99d['mac']?_0x13e99d[_0x43ca('0xb')]:_0x43ca('0xc'),'ipAddress':_0x13e99d&&_0x13e99d[_0x43ca('0xd')]?_0x13e99d[_0x43ca('0xd')]:'127.0.0.1'};}exports[_0x43ca('0xe')]=getFirstInterface;function getCPUhash(){var _0x411a00=_[_0x43ca('0x4')](os[_0x43ca('0xf')]()[_0x43ca('0x10')](function(_0x246ead){return _0x246ead[_0x43ca('0x11')];}))[_0x43ca('0x12')](':');return crypto[_0x43ca('0x13')]('md5')[_0x43ca('0x14')](_0x411a00)[_0x43ca('0x15')]('hex');}exports[_0x43ca('0x16')]=function(){switch(os['platform']()){case _0x43ca('0x17'):return exec('dmidecode\x20--string\x20system-uuid',{'encoding':_0x43ca('0x18')})[_0x43ca('0x19')]('\x0d\x0a','');default:var _0x51a517=getFirstInterface();var _0xd306dc=getCPUhash();var _0x366180=_0xd306dc+'|'+os[_0x43ca('0x1a')]()+'|'+_0x51a517['macAddress']+'|'+_0x51a517['ipAddress'];var _0x48a75c=crypto['createHash'](_0x43ca('0x1b'))[_0x43ca('0x14')](_0x366180)[_0x43ca('0x15')]('hex');return _0x48a75c[_0x43ca('0x1c')](0x0,0x8)+'-'+_0x48a75c[_0x43ca('0x1c')](0x8,0xc)+'-'+_0x48a75c[_0x43ca('0x1c')](0xc,0x10)+'-'+_0x48a75c['substring'](0x10,0x14)+'-'+_0x48a75c[_0x43ca('0x1c')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index c920b38..79da735 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 _0xb6a6=['exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','createCipher','aes-256-ctr','session','utf8','base64','final','createDecipher','secrets','update','||FIELD||VALUE||\x0a','User','findOne','admin','fullname','email','|reason|','|name|','|email|','getFirstInterface','ipAddress','openIssue','get','data2','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','data1','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','diff','DEMO\x20START\x20AT\x20%s','catch','error','message','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','crypto','bluebird','pkginfo','version','../../mysqldb','../environment','../logger','license','../../api/jira/jira.controller','format'];(function(_0x1edb0f,_0x184554){var _0x5bb45b=function(_0x425c95){while(--_0x425c95){_0x1edb0f['push'](_0x1edb0f['shift']());}};_0x5bb45b(++_0x184554);}(_0xb6a6,0x1a0));var _0x6b6a=function(_0x94c1fe,_0x2b71a1){_0x94c1fe=_0x94c1fe-0x0;var _0x171613=_0xb6a6[_0x94c1fe];return _0x171613;};'use strict';var util=require(_0x6b6a('0x0'));var crypto=require(_0x6b6a('0x1'));var moment=require('moment');var rp=require('request-promise');var BPromise=require(_0x6b6a('0x2'));var pkginfo=require(_0x6b6a('0x3'))(module,_0x6b6a('0x4'));var db=require(_0x6b6a('0x5'))['db'];var config=require(_0x6b6a('0x6'));var hardware=require('./hardware');var logger=require(_0x6b6a('0x7'))(_0x6b6a('0x8'));var jira=require(_0x6b6a('0x9'));var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;var oldToken;function httpRequest(_0x3ad201){return new BPromise(function(_0x1895f7,_0x59e90c){var _0x43f878=util[_0x6b6a('0xa')]('%s/api/servers/%s/check?version=%s',HOST,_0x3ad201,module[_0x6b6a('0xb')]['version']);if(oldToken){_0x43f878=util[_0x6b6a('0xa')](_0x6b6a('0xc'),HOST,_0x3ad201,module[_0x6b6a('0xb')]['version'],oldToken);}var _0x519b68={'uri':_0x43f878,'method':_0x6b6a('0xd'),'timeout':0xea60,'json':!![]};return rp(_0x519b68)[_0x6b6a('0xe')](function(_0x47c2dd){_0x1895f7(_0x47c2dd);})['catch'](function(_0x2f4f5c){_0x59e90c(_0x2f4f5c);});});}function encryptDate(_0x44758d){var _0x51aad7=crypto[_0x6b6a('0xf')](_0x6b6a('0x10'),config['secrets'][_0x6b6a('0x11')]);var _0x3d74e7=_0x51aad7['update'](_0x44758d,_0x6b6a('0x12'),_0x6b6a('0x13'));_0x3d74e7+=_0x51aad7[_0x6b6a('0x14')](_0x6b6a('0x13'));return _0x3d74e7;}function decryptDate(_0x56dc6a){var _0x6155e8=crypto[_0x6b6a('0x15')]('aes-256-ctr',config[_0x6b6a('0x16')][_0x6b6a('0x11')]);var _0x126189=_0x6155e8[_0x6b6a('0x17')](_0x56dc6a,_0x6b6a('0x13'),'utf8');_0x126189+=_0x6155e8[_0x6b6a('0x14')](_0x6b6a('0x12'));return _0x126189;}function sendJiraAlert(_0x3b7181,_0x580d86,_0x2a577c){var _0x4fd022=_0x6b6a('0x18');return db[_0x6b6a('0x19')][_0x6b6a('0x1a')]({'where':{'role':_0x6b6a('0x1b')},'attributes':[_0x6b6a('0x1c'),_0x6b6a('0x1d')],'raw':!![]})['then'](function(_0x4d6373){ADMIN=_0x4d6373;_0x4fd022+=_0x6b6a('0x1e')+_0x2a577c+'|\x0a';_0x4fd022+='|uuid|'+_0x3b7181+'|\x0a';_0x4fd022+='|machineUuid|'+_0x580d86+'|\x0a';_0x4fd022+=_0x6b6a('0x1f')+ADMIN['fullname']+'|\x0a';_0x4fd022+=_0x6b6a('0x20')+ADMIN[_0x6b6a('0x1d')]+'|\x0a';return _0x4fd022;})[_0x6b6a('0xe')](function(_0x26e9a3){var _0x37a295=hardware[_0x6b6a('0x21')]()[_0x6b6a('0x22')];return jira[_0x6b6a('0x23')]({'key':'MOTLICENSE','summary':'Motion\x20License\x20Alert','description':_0x26e9a3,'issuetype':'Alert','oldToken':_0x3b7181,'newToken':_0x580d86,'email':ADMIN[_0x6b6a('0x1d')],'name':ADMIN['fullname'],'reason':GRAY_PERIOD_REASON,'ip':_0x37a295});});}function manageLicense(_0x1807ee,_0x4c4ca5){var _0x56f08f=_0x4c4ca5[_0x6b6a('0x24')]({'plain':!![]});httpRequest(_0x1807ee)['then'](function(_0x13b237){if(oldToken){oldToken=undefined;}if(_0x13b237['active']){if(!_0x56f08f['license']&&_0x56f08f['license']!=_0x13b237[_0x6b6a('0x8')]||_0x56f08f[_0x6b6a('0x8')]&&_0x56f08f[_0x6b6a('0x25')]){logger['info'](_0x6b6a('0x26'));}if(_0x56f08f['license']&&!_0x56f08f[_0x6b6a('0x25')]&&_0x56f08f[_0x6b6a('0x8')]!=_0x13b237[_0x6b6a('0x8')]){logger[_0x6b6a('0x27')](_0x6b6a('0x28'));}if(_0x56f08f[_0x6b6a('0x8')]&&!_0x56f08f['data2']&&_0x56f08f['license']==_0x13b237[_0x6b6a('0x8')]){return _0x4c4ca5;}return _0x4c4ca5['update']({'data1':_0x1807ee,'data2':null,'license':_0x13b237['license']});}else{if(_0x13b237['license']||_0x56f08f[_0x6b6a('0x8')]){if(!_0x56f08f[_0x6b6a('0x25')]){if(_0x56f08f[_0x6b6a('0x29')]==_0x1807ee){GRAY_PERIOD_REASON=_0x6b6a('0x2a');logger[_0x6b6a('0x27')](_0x6b6a('0x2b'));}else{GRAY_PERIOD_REASON=_0x6b6a('0x2c');oldToken=_0x56f08f[_0x6b6a('0x29')];logger[_0x6b6a('0x27')](_0x6b6a('0x2d'),_0x56f08f[_0x6b6a('0x29')],_0x1807ee);}sendJiraAlert(_0x56f08f[_0x6b6a('0x29')],_0x13b237['uuid'],GRAY_PERIOD_REASON);logger[_0x6b6a('0x27')](_0x6b6a('0x2e'),GRAY_PERIOD_REASON[_0x6b6a('0x2f')](),moment()[_0x6b6a('0xa')](_0x6b6a('0x30')));return _0x4c4ca5[_0x6b6a('0x17')]({'data2':encryptDate(moment()['format'](_0x6b6a('0x30')))});}else{if(moment()[_0x6b6a('0x31')](decryptDate(_0x56f08f[_0x6b6a('0x25')]),'days')>DAYS){logger[_0x6b6a('0x27')](_0x6b6a('0x32'),moment()[_0x6b6a('0xa')](_0x6b6a('0x30')));return _0x4c4ca5[_0x6b6a('0x17')]({'data1':_0x1807ee,'data2':null,'license':null});}}}else{if(_0x56f08f['data1']!=_0x1807ee){logger[_0x6b6a('0x27')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x56f08f[_0x6b6a('0x29')],_0x1807ee);return _0x4c4ca5[_0x6b6a('0x17')]({'data1':_0x1807ee,'data2':null,'license':null});}}}return _0x4c4ca5;})[_0x6b6a('0xe')](function(_0x98d6e5){_0x4c4ca5=_0x98d6e5;})[_0x6b6a('0x33')](function(_0x2dbde3){logger[_0x6b6a('0x34')](_0x2dbde3[_0x6b6a('0x35')]);})[_0x6b6a('0x36')](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x4c4ca5);},TIME);});}function defaultLicense(){var _0x31782f=hardware[_0x6b6a('0x37')]();if(_0x31782f){return db[_0x6b6a('0x38')][_0x6b6a('0x39')]({'where':{'id':0x1},'defaults':{'data1':_0x31782f}})[_0x6b6a('0x3a')](function(_0x3e0f6b,_0x2a7425){logger[_0x6b6a('0x27')](_0x6b6a('0x3b'),_0x31782f);manageLicense(_0x31782f,_0x3e0f6b);})[_0x6b6a('0x33')](function(_0x13cceb){logger[_0x6b6a('0x34')](_0x13cceb[_0x6b6a('0x35')]);});}}exports[_0x6b6a('0x3c')]=defaultLicense; \ No newline at end of file +var _0xb44a=['|email|','email','getFirstInterface','ipAddress','Motion\x20License\x20Alert','get','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','data2','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','data1','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','uuid','YYYY-MM-DD\x20HH:mm','diff','days','DEMO\x20START\x20AT\x20%s','error','message','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','moment','bluebird','../../mysqldb','./hardware','../logger','license','../../api/jira/jira.controller','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','version','%s/api/servers/%s/check?version=%s&oldtoken=%s','then','catch','secrets','utf8','base64','final','session','update','||FIELD||VALUE||\x0a','User','findOne','admin','fullname','|reason|','|uuid|','|machineUuid|','|name|'];(function(_0x2555ac,_0x313acb){var _0x6de096=function(_0x1931f6){while(--_0x1931f6){_0x2555ac['push'](_0x2555ac['shift']());}};_0x6de096(++_0x313acb);}(_0xb44a,0x1c2));var _0xab44=function(_0x235482,_0x14b833){_0x235482=_0x235482-0x0;var _0x5f5bea=_0xb44a[_0x235482];return _0x5f5bea;};'use strict';var util=require('util');var crypto=require('crypto');var moment=require(_0xab44('0x0'));var rp=require('request-promise');var BPromise=require(_0xab44('0x1'));var pkginfo=require('pkginfo')(module,'version');var db=require(_0xab44('0x2'))['db'];var config=require('../environment');var hardware=require(_0xab44('0x3'));var logger=require(_0xab44('0x4'))(_0xab44('0x5'));var jira=require(_0xab44('0x6'));var HOST=_0xab44('0x7');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;var oldToken;function httpRequest(_0x3303b1){return new BPromise(function(_0x3ead8d,_0x495825){var _0x137a8c=util[_0xab44('0x8')](_0xab44('0x9'),HOST,_0x3303b1,module[_0xab44('0xa')][_0xab44('0xb')]);if(oldToken){_0x137a8c=util['format'](_0xab44('0xc'),HOST,_0x3303b1,module['exports'][_0xab44('0xb')],oldToken);}var _0x5168fa={'uri':_0x137a8c,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x5168fa)[_0xab44('0xd')](function(_0x6746cc){_0x3ead8d(_0x6746cc);})[_0xab44('0xe')](function(_0x34ca94){_0x495825(_0x34ca94);});});}function encryptDate(_0x2208fb){var _0x237c26=crypto['createCipher']('aes-256-ctr',config[_0xab44('0xf')]['session']);var _0x15db10=_0x237c26['update'](_0x2208fb,_0xab44('0x10'),_0xab44('0x11'));_0x15db10+=_0x237c26[_0xab44('0x12')](_0xab44('0x11'));return _0x15db10;}function decryptDate(_0x31404d){var _0x41701b=crypto['createDecipher']('aes-256-ctr',config[_0xab44('0xf')][_0xab44('0x13')]);var _0x14fe36=_0x41701b[_0xab44('0x14')](_0x31404d,_0xab44('0x11'),_0xab44('0x10'));_0x14fe36+=_0x41701b[_0xab44('0x12')](_0xab44('0x10'));return _0x14fe36;}function sendJiraAlert(_0x310b15,_0xc4b3dc,_0x27fc7f){var _0x5cc897=_0xab44('0x15');return db[_0xab44('0x16')][_0xab44('0x17')]({'where':{'role':_0xab44('0x18')},'attributes':[_0xab44('0x19'),'email'],'raw':!![]})[_0xab44('0xd')](function(_0x59da3b){ADMIN=_0x59da3b;_0x5cc897+=_0xab44('0x1a')+_0x27fc7f+'|\x0a';_0x5cc897+=_0xab44('0x1b')+_0x310b15+'|\x0a';_0x5cc897+=_0xab44('0x1c')+_0xc4b3dc+'|\x0a';_0x5cc897+=_0xab44('0x1d')+ADMIN['fullname']+'|\x0a';_0x5cc897+=_0xab44('0x1e')+ADMIN[_0xab44('0x1f')]+'|\x0a';return _0x5cc897;})[_0xab44('0xd')](function(_0x3b17d5){var _0x11f0b=hardware[_0xab44('0x20')]()[_0xab44('0x21')];return jira['openIssue']({'key':'MOTLICENSE','summary':_0xab44('0x22'),'description':_0x3b17d5,'issuetype':'Alert','oldToken':_0x310b15,'newToken':_0xc4b3dc,'email':ADMIN[_0xab44('0x1f')],'name':ADMIN['fullname'],'reason':GRAY_PERIOD_REASON,'ip':_0x11f0b});});}function manageLicense(_0x2a1bbc,_0x5ac42f){var _0x531583=_0x5ac42f[_0xab44('0x23')]({'plain':!![]});httpRequest(_0x2a1bbc)[_0xab44('0xd')](function(_0x259192){if(oldToken){oldToken=undefined;}if(_0x259192[_0xab44('0x24')]){if(!_0x531583[_0xab44('0x5')]&&_0x531583['license']!=_0x259192[_0xab44('0x5')]||_0x531583[_0xab44('0x5')]&&_0x531583['data2']){logger[_0xab44('0x25')](_0xab44('0x26'));}if(_0x531583[_0xab44('0x5')]&&!_0x531583[_0xab44('0x27')]&&_0x531583[_0xab44('0x5')]!=_0x259192[_0xab44('0x5')]){logger['info'](_0xab44('0x28'));}if(_0x531583[_0xab44('0x5')]&&!_0x531583[_0xab44('0x27')]&&_0x531583['license']==_0x259192['license']){return _0x5ac42f;}return _0x5ac42f[_0xab44('0x14')]({'data1':_0x2a1bbc,'data2':null,'license':_0x259192['license']});}else{if(_0x259192['license']||_0x531583[_0xab44('0x5')]){if(!_0x531583[_0xab44('0x27')]){if(_0x531583[_0xab44('0x29')]==_0x2a1bbc){GRAY_PERIOD_REASON=_0xab44('0x2a');logger[_0xab44('0x25')](_0xab44('0x2b'));}else{GRAY_PERIOD_REASON=_0xab44('0x2c');oldToken=_0x531583[_0xab44('0x29')];logger[_0xab44('0x25')](_0xab44('0x2d'),_0x531583[_0xab44('0x29')],_0x2a1bbc);}sendJiraAlert(_0x531583[_0xab44('0x29')],_0x259192[_0xab44('0x2e')],GRAY_PERIOD_REASON);logger[_0xab44('0x25')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON['toUpperCase'](),moment()[_0xab44('0x8')](_0xab44('0x2f')));return _0x5ac42f['update']({'data2':encryptDate(moment()[_0xab44('0x8')](_0xab44('0x2f')))});}else{if(moment()[_0xab44('0x30')](decryptDate(_0x531583[_0xab44('0x27')]),_0xab44('0x31'))>DAYS){logger[_0xab44('0x25')](_0xab44('0x32'),moment()[_0xab44('0x8')](_0xab44('0x2f')));return _0x5ac42f[_0xab44('0x14')]({'data1':_0x2a1bbc,'data2':null,'license':null});}}}else{if(_0x531583[_0xab44('0x29')]!=_0x2a1bbc){logger[_0xab44('0x25')](_0xab44('0x2d'),_0x531583[_0xab44('0x29')],_0x2a1bbc);return _0x5ac42f[_0xab44('0x14')]({'data1':_0x2a1bbc,'data2':null,'license':null});}}}return _0x5ac42f;})[_0xab44('0xd')](function(_0x21e777){_0x5ac42f=_0x21e777;})[_0xab44('0xe')](function(_0x519fb5){logger[_0xab44('0x33')](_0x519fb5[_0xab44('0x34')]);})[_0xab44('0x35')](function(){setTimeout(function(){manageLicense(hardware[_0xab44('0x36')](),_0x5ac42f);},TIME);});}function defaultLicense(){var _0x4a720d=hardware[_0xab44('0x36')]();if(_0x4a720d){return db[_0xab44('0x37')][_0xab44('0x38')]({'where':{'id':0x1},'defaults':{'data1':_0x4a720d}})[_0xab44('0x39')](function(_0x411d6c,_0x4f5cf3){logger[_0xab44('0x25')](_0xab44('0x3a'),_0x4a720d);manageLicense(_0x4a720d,_0x411d6c);})[_0xab44('0xe')](function(_0x5b4f4d){logger[_0xab44('0x33')](_0x5b4f4d[_0xab44('0x34')]);});}}exports[_0xab44('0x3b')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index a7aeed1..80a5f26 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 _0xdd4f=['%s:%s:%s','base64','utf8','parse','uuid','machineUuid','getUuid','secrets','update','final','deadline','add','days','grayReason','changed','2027-01-01T00:00:00.000Z','message','Demo\x20license','getLicense','License','find','checkLicense','crypto','util','lodash','moment','./hardware','../../mysqldb','license','isEmpty','data1','data2','split','createDecipher','aes-256-ctr','format'];(function(_0x3980d3,_0x1af200){var _0x5b95ab=function(_0x1c9f1b){while(--_0x1c9f1b){_0x3980d3['push'](_0x3980d3['shift']());}};_0x5b95ab(++_0x1af200);}(_0xdd4f,0x1ea));var _0xfdd4=function(_0x56cd0e,_0x42adec){_0x56cd0e=_0x56cd0e-0x0;var _0x19a2a5=_0xdd4f[_0x56cd0e];return _0x19a2a5;};'use strict';var crypto=require(_0xfdd4('0x0'));var util=require(_0xfdd4('0x1'));var _=require(_0xfdd4('0x2'));var moment=require(_0xfdd4('0x3'));var hardware=require(_0xfdd4('0x4'));var config=require('../environment');var db=require(_0xfdd4('0x5'))['db'];function checkLicense(_0x239d56,_0xd14730){if(_0x239d56){try{var _0x5c9861=_0xd14730||_0x239d56[_0xfdd4('0x6')];if(_[_0xfdd4('0x7')](_0x5c9861)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x517e25=_0x239d56[_0xfdd4('0x8')];var _0x176b6a=_0x239d56[_0xfdd4('0x9')];var _0xbb95c7=_0x517e25[_0xfdd4('0xa')]('-')[0x4];var _0x21f7ba=_0x517e25[_0xfdd4('0xa')]('-')[0x0];var _0x153a41=crypto[_0xfdd4('0xb')](_0xfdd4('0xc'),util[_0xfdd4('0xd')](_0xfdd4('0xe'),_0xbb95c7,_0x517e25,_0x21f7ba));var _0x27c34d=_0x153a41['update'](_0x5c9861,_0xfdd4('0xf'),'utf8');_0x27c34d+=_0x153a41['final'](_0xfdd4('0x10'));var _0x2ca35c=JSON[_0xfdd4('0x11')](_0x27c34d);_0x2ca35c['demo']=![];_0x2ca35c[_0xfdd4('0x12')]=_0x517e25;_0x2ca35c[_0xfdd4('0x13')]=hardware[_0xfdd4('0x14')]();if(_0x176b6a){var _0x362036=crypto['createDecipher'](_0xfdd4('0xc'),config[_0xfdd4('0x15')]['session']);var _0x9488e7=_0x362036[_0xfdd4('0x16')](_0x176b6a,_0xfdd4('0xf'),'utf8');_0x9488e7+=_0x362036[_0xfdd4('0x17')](_0xfdd4('0x10'));_0x2ca35c['gray']=_0x9488e7;_0x2ca35c[_0xfdd4('0x18')]=moment(_0x9488e7)[_0xfdd4('0x19')](0x7,_0xfdd4('0x1a'))['format']();_0x2ca35c[_0xfdd4('0x1b')]=_0x2ca35c[_0xfdd4('0x12')]!=_0x2ca35c[_0xfdd4('0x13')]?_0xfdd4('0x1c'):'disabled';}return _0x2ca35c;}catch(_0x482e95){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xfdd4('0x1d'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','uuid':_0x239d56['data1'],'machineUuid':hardware[_0xfdd4('0x14')](),'message':_0x482e95[_0xfdd4('0x1e')],'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xfdd4('0x1f'),'uuid':_0x239d56[_0xfdd4('0x8')],'machineUuid':hardware[_0xfdd4('0x14')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}exports[_0xfdd4('0x20')]=function(_0x1638a9){return db[_0xfdd4('0x21')][_0xfdd4('0x22')](_['defaults'](_0x1638a9,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x2cd10a){return checkLicense(_0x2cd10a,null);});};exports[_0xfdd4('0x23')]=checkLicense; \ No newline at end of file +var _0x12be=['./hardware','../environment','license','isEmpty','License\x20key\x20value\x20not\x20found','data1','data2','split','createDecipher','%s:%s:%s','utf8','demo','uuid','machineUuid','getUuid','aes-256-ctr','session','base64','final','gray','add','days','format','grayReason','changed','disabled','Demo\x20license','getLicense','License','find','checkLicense','crypto','util','lodash'];(function(_0x5bd2d4,_0x4fb19b){var _0x3d26cf=function(_0x366514){while(--_0x366514){_0x5bd2d4['push'](_0x5bd2d4['shift']());}};_0x3d26cf(++_0x4fb19b);}(_0x12be,0xc9));var _0xe12b=function(_0x5ad0d7,_0x2645f8){_0x5ad0d7=_0x5ad0d7-0x0;var _0xd83bd=_0x12be[_0x5ad0d7];return _0xd83bd;};'use strict';var crypto=require(_0xe12b('0x0'));var util=require(_0xe12b('0x1'));var _=require(_0xe12b('0x2'));var moment=require('moment');var hardware=require(_0xe12b('0x3'));var config=require(_0xe12b('0x4'));var db=require('../../mysqldb')['db'];function checkLicense(_0x445268,_0x3c7c68){if(_0x445268){try{var _0x4a393b=_0x3c7c68||_0x445268[_0xe12b('0x5')];if(_[_0xe12b('0x6')](_0x4a393b)){throw new Error(_0xe12b('0x7'));}var _0x177cb1=_0x445268[_0xe12b('0x8')];var _0x2b515b=_0x445268[_0xe12b('0x9')];var _0x364d68=_0x177cb1[_0xe12b('0xa')]('-')[0x4];var _0x428c02=_0x177cb1[_0xe12b('0xa')]('-')[0x0];var _0x30afc7=crypto[_0xe12b('0xb')]('aes-256-ctr',util['format'](_0xe12b('0xc'),_0x364d68,_0x177cb1,_0x428c02));var _0x47c9ea=_0x30afc7['update'](_0x4a393b,'base64',_0xe12b('0xd'));_0x47c9ea+=_0x30afc7['final']('utf8');var _0x4faccd=JSON['parse'](_0x47c9ea);_0x4faccd[_0xe12b('0xe')]=![];_0x4faccd[_0xe12b('0xf')]=_0x177cb1;_0x4faccd[_0xe12b('0x10')]=hardware[_0xe12b('0x11')]();if(_0x2b515b){var _0x307949=crypto[_0xe12b('0xb')](_0xe12b('0x12'),config['secrets'][_0xe12b('0x13')]);var _0xc4b4e3=_0x307949['update'](_0x2b515b,_0xe12b('0x14'),'utf8');_0xc4b4e3+=_0x307949[_0xe12b('0x15')](_0xe12b('0xd'));_0x4faccd[_0xe12b('0x16')]=_0xc4b4e3;_0x4faccd['deadline']=moment(_0xc4b4e3)[_0xe12b('0x17')](0x7,_0xe12b('0x18'))[_0xe12b('0x19')]();_0x4faccd[_0xe12b('0x1a')]=_0x4faccd[_0xe12b('0xf')]!=_0x4faccd[_0xe12b('0x10')]?_0xe12b('0x1b'):_0xe12b('0x1c');}return _0x4faccd;}catch(_0x17fb75){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','uuid':_0x445268[_0xe12b('0x8')],'machineUuid':hardware['getUuid'](),'message':_0x17fb75['message'],'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xe12b('0x1d'),'uuid':_0x445268[_0xe12b('0x8')],'machineUuid':hardware[_0xe12b('0x11')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}exports[_0xe12b('0x1e')]=function(_0xf30d39){return db[_0xe12b('0x1f')][_0xe12b('0x20')](_['defaults'](_0xf30d39,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x212415){return checkLicense(_0x212415,null);});};exports[_0xe12b('0x21')]=checkLicense; \ No newline at end of file diff --git a/server/config/local.env.js b/server/config/local.env.js index 91608d3..c25ba15 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 _0x370e=['secret','exports','http://localhost:9000','myappanuglar-secret','app-id'];(function(_0x57b4f3,_0x3aec3d){var _0x542345=function(_0x2bbf07){while(--_0x2bbf07){_0x57b4f3['push'](_0x57b4f3['shift']());}};_0x542345(++_0x3aec3d);}(_0x370e,0xab));var _0xe370=function(_0x3391f8,_0x2ac058){_0x3391f8=_0x3391f8-0x0;var _0x406c1e=_0x370e[_0x3391f8];return _0x406c1e;};'use strict';module[_0xe370('0x0')]={'DOMAIN':_0xe370('0x1'),'SESSION_SECRET':_0xe370('0x2'),'GOOGLE_ID':_0xe370('0x3'),'GOOGLE_SECRET':_0xe370('0x4'),'DEBUG':''}; \ No newline at end of file +var _0x8a72=['myappanuglar-secret','secret'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x8a72,0xa6));var _0x28a7=function(_0x2fb01c,_0x269e89){_0x2fb01c=_0x2fb01c-0x0;var _0x46063a=_0x8a72[_0x2fb01c];return _0x46063a;};'use strict';module['exports']={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0x28a7('0x0'),'GOOGLE_ID':'app-id','GOOGLE_SECRET':_0x28a7('0x1'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index b085aa1..256864c 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4504=['moment','util','path','INFO','/var','log','format','%s-%s.log','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','toUpperCase','exports','Logger','transports','%s-%s','info','Console','env'];(function(_0x237c10,_0x4ddf14){var _0x4db781=function(_0x44661d){while(--_0x44661d){_0x237c10['push'](_0x237c10['shift']());}};_0x4db781(++_0x4ddf14);}(_0x4504,0xc6));var _0x4450=function(_0x19379b,_0x1190d3){_0x19379b=_0x19379b-0x0;var _0x7510e4=_0x4504[_0x19379b];return _0x7510e4;};'use strict';var moment=require(_0x4450('0x0'));var winston=require('winston');var util=require(_0x4450('0x1'));var path=require(_0x4450('0x2'));var debugLevel=_0x4450('0x3');function filename(_0x5e23d9,_0x1f4e96){return path['join'](_0x4450('0x4'),_0x4450('0x5'),'xcally',util[_0x4450('0x6')](_0x4450('0x7'),_0x5e23d9,_0x1f4e96));}function formatter(_0x43c1db,_0x472939){return util['format'](_0x4450('0x8'),moment()[_0x4450('0x6')](_0x4450('0x9')),_0x472939['level'][_0x4450('0xa')](),_0x43c1db,_0x472939['message']);}module[_0x4450('0xb')]=function(_0x10bb83){return new winston[(_0x4450('0xc'))]({'transports':[new winston[(_0x4450('0xd'))]['File']({'name':util['format'](_0x4450('0xe'),_0x10bb83,'error'),'filename':filename(_0x10bb83,'error'),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x12a010){return formatter(_0x10bb83,_0x12a010);}}),new winston['transports']['File']({'name':util[_0x4450('0x6')]('%s-%s',_0x10bb83,_0x4450('0xf')),'filename':filename(_0x10bb83,_0x4450('0xf')),'level':'info','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x2ea3f9){return formatter(_0x10bb83,_0x2ea3f9);}}),new winston[(_0x4450('0xd'))][(_0x4450('0x10'))]({'level':process[_0x4450('0x11')]['debugLevel']||debugLevel,'json':![],'formatter':function(_0x7fe1b4){return formatter(_0x10bb83,_0x7fe1b4);}})]});}; \ No newline at end of file +var _0x341e=['level','Logger','File','error','transports','info','Console','env','debugLevel','moment','winston','util','path','INFO','/var','xcally','format','%s-%s.log'];(function(_0x2cc594,_0x4d727b){var _0x4abff7=function(_0x22b01d){while(--_0x22b01d){_0x2cc594['push'](_0x2cc594['shift']());}};_0x4abff7(++_0x4d727b);}(_0x341e,0xbd));var _0xe341=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x341e[_0x4a9fb1];return _0x348672;};'use strict';var moment=require(_0xe341('0x0'));var winston=require(_0xe341('0x1'));var util=require(_0xe341('0x2'));var path=require(_0xe341('0x3'));var debugLevel=_0xe341('0x4');function filename(_0x21cf1e,_0xe2b2ef){return path['join'](_0xe341('0x5'),'log',_0xe341('0x6'),util[_0xe341('0x7')](_0xe341('0x8'),_0x21cf1e,_0xe2b2ef));}function formatter(_0x2c8bd7,_0x10efc2){return util[_0xe341('0x7')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0xe341('0x7')]('YYYY-MM-DD\x20HH:mm:ss'),_0x10efc2[_0xe341('0x9')]['toUpperCase'](),_0x2c8bd7,_0x10efc2['message']);}module['exports']=function(_0x3ef147){return new winston[(_0xe341('0xa'))]({'transports':[new winston['transports'][(_0xe341('0xb'))]({'name':util[_0xe341('0x7')]('%s-%s',_0x3ef147,_0xe341('0xc')),'filename':filename(_0x3ef147,_0xe341('0xc')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x124eb2){return formatter(_0x3ef147,_0x124eb2);}}),new winston[(_0xe341('0xd'))][(_0xe341('0xb'))]({'name':util[_0xe341('0x7')]('%s-%s',_0x3ef147,_0xe341('0xe')),'filename':filename(_0x3ef147,_0xe341('0xe')),'level':_0xe341('0xe'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x4757cc){return formatter(_0x3ef147,_0x4757cc);}}),new winston[(_0xe341('0xd'))][(_0xe341('0xf'))]({'level':process[_0xe341('0x10')][_0xe341('0x11')]||debugLevel,'json':![],'formatter':function(_0x4499e7){return formatter(_0x3ef147,_0x4499e7);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 571559e..64803ce 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 _0xc9b4=['../../services/email/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','path','express','join','ami','../../services/ami/index.js','../../services/agi/index.js','email'];(function(_0x457759,_0x51c94d){var _0x48a949=function(_0x56cd20){while(--_0x56cd20){_0x457759['push'](_0x457759['shift']());}};_0x48a949(++_0x51c94d);}(_0xc9b4,0xa2));var _0x4c9b=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xc9b4[_0x1cfa0d];return _0xe33279;};'use strict';var path=require(_0x4c9b('0x0'));var os=require('os');var config={'apps':[{'name':_0x4c9b('0x1'),'script':path[_0x4c9b('0x2')](__dirname,'../../services/express/index.js')},{'name':_0x4c9b('0x3'),'script':path[_0x4c9b('0x2')](__dirname,_0x4c9b('0x4'))},{'name':'agi','script':path[_0x4c9b('0x2')](__dirname,_0x4c9b('0x5'))},{'name':_0x4c9b('0x6'),'script':path[_0x4c9b('0x2')](__dirname,_0x4c9b('0x7'))},{'name':_0x4c9b('0x8'),'script':path[_0x4c9b('0x2')](__dirname,_0x4c9b('0x9'))},{'name':_0x4c9b('0xa'),'script':path[_0x4c9b('0x2')](__dirname,_0x4c9b('0xb'))}]};module[_0x4c9b('0xc')]=config; \ No newline at end of file +var _0x3280=['exports','express','join','../../services/express/index.js','ami','../../services/ami/index.js','agi','email','../../services/email/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js'];(function(_0x1ccc4e,_0x18918f){var _0x1965fe=function(_0x2adf50){while(--_0x2adf50){_0x1ccc4e['push'](_0x1ccc4e['shift']());}};_0x1965fe(++_0x18918f);}(_0x3280,0x17a));var _0x0328=function(_0xc58097,_0x2b92bb){_0xc58097=_0xc58097-0x0;var _0x51b38d=_0x3280[_0xc58097];return _0x51b38d;};'use strict';var path=require('path');var os=require('os');var config={'apps':[{'name':_0x0328('0x0'),'script':path[_0x0328('0x1')](__dirname,_0x0328('0x2'))},{'name':_0x0328('0x3'),'script':path[_0x0328('0x1')](__dirname,_0x0328('0x4'))},{'name':_0x0328('0x5'),'script':path[_0x0328('0x1')](__dirname,'../../services/agi/index.js')},{'name':_0x0328('0x6'),'script':path[_0x0328('0x1')](__dirname,_0x0328('0x7'))},{'name':_0x0328('0x8'),'script':path[_0x0328('0x1')](__dirname,_0x0328('0x9'))},{'name':_0x0328('0xa'),'script':path[_0x0328('0x1')](__dirname,_0x0328('0xb'))}]};module[_0x0328('0xc')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 8655d0f..3be3c2c 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 _0xee87=['bluebird','connect','connected','then','start','disconnect','stop','restart','list','describe','delete','dump','saved'];(function(_0x3530a0,_0xbfa8dc){var _0x210774=function(_0x46a671){while(--_0x46a671){_0x3530a0['push'](_0x3530a0['shift']());}};_0x210774(++_0xbfa8dc);}(_0xee87,0x193));var _0x7ee8=function(_0x42dce4,_0x1dce20){_0x42dce4=_0x42dce4-0x0;var _0x197857=_0xee87[_0x42dce4];return _0x197857;};'use strict';var pm2=require('pm2');var BPromise=require(_0x7ee8('0x0'));var config=require('./config');function connect(){return new BPromise(function(_0x4de157,_0x4d7a1d){return pm2[_0x7ee8('0x1')](function(_0xe4d376){if(_0xe4d376){return _0x4d7a1d(_0xe4d376);}return _0x4de157(_0x7ee8('0x2'));});});};exports['start']=function(_0x375133){return connect()[_0x7ee8('0x3')](function(){return new BPromise(function(_0x5b530b,_0x34ee4a){return pm2[_0x7ee8('0x4')](_0x375133,function(_0x2fe0fb,_0x3ac05f){if(_0x2fe0fb){return _0x34ee4a(_0x2fe0fb);}pm2[_0x7ee8('0x5')]();return _0x5b530b(_0x3ac05f);});});});};exports[_0x7ee8('0x6')]=function(_0x2d26bd){return connect()[_0x7ee8('0x3')](function(){return new BPromise(function(_0x17f8db,_0x4d193a){return pm2[_0x7ee8('0x6')](_0x2d26bd,function(_0x21c346,_0x25b94d){if(_0x21c346){return _0x4d193a(_0x21c346);}pm2['disconnect']();return _0x17f8db(_0x25b94d);});});});};exports[_0x7ee8('0x7')]=function(_0x283388){return connect()[_0x7ee8('0x3')](function(){return new BPromise(function(_0x2aecd4,_0x5cf98b){return pm2[_0x7ee8('0x7')](_0x283388,function(_0xcc032,_0x322707){if(_0xcc032){return _0x5cf98b(_0xcc032);}pm2[_0x7ee8('0x5')]();return _0x2aecd4(_0x322707);});});});};exports[_0x7ee8('0x8')]=function(){return connect()[_0x7ee8('0x3')](function(){return new BPromise(function(_0x3971ff,_0x179a75){return pm2[_0x7ee8('0x8')](function(_0x170d84,_0x24d5e8){if(_0x170d84){return _0x179a75(_0x170d84);}pm2[_0x7ee8('0x5')]();return _0x3971ff(_0x24d5e8);});});});};exports[_0x7ee8('0x9')]=function(_0x3ff469){return connect()[_0x7ee8('0x3')](function(){return new BPromise(function(_0xd275fb,_0x1ddb6a){return pm2[_0x7ee8('0x9')](_0x3ff469,function(_0x154272,_0x3b2c7e){if(_0x154272){return _0x1ddb6a(_0x154272);}pm2['disconnect']();return _0xd275fb(_0x3b2c7e);});});});};exports[_0x7ee8('0xa')]=function(_0x6e4192){return connect()[_0x7ee8('0x3')](function(){return new BPromise(function(_0x155790,_0x2ef79f){return pm2[_0x7ee8('0xa')](_0x6e4192,function(_0x13ee8e,_0x4a8125){if(_0x13ee8e){return _0x2ef79f(_0x13ee8e);}pm2[_0x7ee8('0x5')]();return _0x155790(_0x4a8125);});});});};exports['dump']=function(){return connect()[_0x7ee8('0x3')](function(){return new BPromise(function(_0x48bd15,_0x2d668a){return pm2[_0x7ee8('0xb')](function(_0x37ca34){if(_0x37ca34){return _0x2d668a(_0x37ca34);}return _0x48bd15(_0x7ee8('0xc'));});});});}; \ No newline at end of file +var _0x49f8=['then','start','stop','restart','disconnect','describe','dump','saved','pm2','bluebird','connect'];(function(_0x218552,_0x3fde7e){var _0x4666ab=function(_0x446dc6){while(--_0x446dc6){_0x218552['push'](_0x218552['shift']());}};_0x4666ab(++_0x3fde7e);}(_0x49f8,0x105));var _0x849f=function(_0x40042d,_0x3ce810){_0x40042d=_0x40042d-0x0;var _0x3889a1=_0x49f8[_0x40042d];return _0x3889a1;};'use strict';var pm2=require(_0x849f('0x0'));var BPromise=require(_0x849f('0x1'));var config=require('./config');function connect(){return new BPromise(function(_0x5a4c98,_0x45d0ec){return pm2[_0x849f('0x2')](function(_0x1bc1f6){if(_0x1bc1f6){return _0x45d0ec(_0x1bc1f6);}return _0x5a4c98('connected');});});};exports['start']=function(_0x4a72fa){return connect()[_0x849f('0x3')](function(){return new BPromise(function(_0x3e37b5,_0x43aa94){return pm2[_0x849f('0x4')](_0x4a72fa,function(_0x23bb68,_0x5ea5f3){if(_0x23bb68){return _0x43aa94(_0x23bb68);}pm2['disconnect']();return _0x3e37b5(_0x5ea5f3);});});});};exports[_0x849f('0x5')]=function(_0x3796c1){return connect()[_0x849f('0x3')](function(){return new BPromise(function(_0x536ec5,_0x39edb4){return pm2[_0x849f('0x5')](_0x3796c1,function(_0x22b239,_0x5ad93a){if(_0x22b239){return _0x39edb4(_0x22b239);}pm2['disconnect']();return _0x536ec5(_0x5ad93a);});});});};exports[_0x849f('0x6')]=function(_0x9dd875){return connect()[_0x849f('0x3')](function(){return new BPromise(function(_0x30ce3b,_0x3aef49){return pm2[_0x849f('0x6')](_0x9dd875,function(_0x54be42,_0x112258){if(_0x54be42){return _0x3aef49(_0x54be42);}pm2['disconnect']();return _0x30ce3b(_0x112258);});});});};exports['list']=function(){return connect()[_0x849f('0x3')](function(){return new BPromise(function(_0x16bb36,_0x586ae6){return pm2['list'](function(_0x3461ec,_0x289b28){if(_0x3461ec){return _0x586ae6(_0x3461ec);}pm2[_0x849f('0x7')]();return _0x16bb36(_0x289b28);});});});};exports[_0x849f('0x8')]=function(_0x2ea069){return connect()[_0x849f('0x3')](function(){return new BPromise(function(_0x3b1a71,_0x12196d){return pm2[_0x849f('0x8')](_0x2ea069,function(_0x2933cf,_0x51ea1b){if(_0x2933cf){return _0x12196d(_0x2933cf);}pm2[_0x849f('0x7')]();return _0x3b1a71(_0x51ea1b);});});});};exports['delete']=function(_0x3e7127){return connect()['then'](function(){return new BPromise(function(_0x11832a,_0x592c51){return pm2['delete'](_0x3e7127,function(_0x1d7537,_0x11b938){if(_0x1d7537){return _0x592c51(_0x1d7537);}pm2[_0x849f('0x7')]();return _0x11832a(_0x11b938);});});});};exports['dump']=function(){return connect()[_0x849f('0x3')](function(){return new BPromise(function(_0x26f8ee,_0x597cc1){return pm2[_0x849f('0x9')](function(_0x16bbae){if(_0x16bbae){return _0x597cc1(_0x16bbae);}return _0x26f8ee(_0x849f('0xa'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 837d2b5..63b8278 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 _0x97e7=['minutes','then','ChatInteraction','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','emit','chatInteraction:update','catch','error','start','lodash','../../config/environment','defaults','redis','localhost','Setting','find','chatTimeout','findAll','lastMsgAt'];(function(_0x13137e,_0x29c0f3){var _0x346261=function(_0x8c7d4f){while(--_0x8c7d4f){_0x13137e['push'](_0x13137e['shift']());}};_0x346261(++_0x29c0f3);}(_0x97e7,0x1ae));var _0x797e=function(_0x23df7b,_0x47a8db){_0x23df7b=_0x23df7b-0x0;var _0x249fb=_0x97e7[_0x23df7b];return _0x249fb;};'use strict';var _=require(_0x797e('0x0'));var moment=require('moment');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var config=require(_0x797e('0x1'));config['redis']=_[_0x797e('0x2')](config[_0x797e('0x3')],{'host':_0x797e('0x4'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function closeInteractions(){var _0x5baf19=0x0;var _0x3a092c=[];return db[_0x797e('0x5')][_0x797e('0x6')]({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})['then'](function(_0x246eaf){_0x5baf19=_0x246eaf[_0x797e('0x7')];if(_0x5baf19){return db['ChatInteraction'][_0x797e('0x8')]({'raw':!![],'attributes':['id',_0x797e('0x9')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x246eaf[_0x797e('0x7')],_0x797e('0xa'))}}});}else{return[];}})[_0x797e('0xb')](function(_0x55a6e1){_0x3a092c=_0x55a6e1;if(_0x5baf19){return db[_0x797e('0xc')]['update']({'closeReason':_0x797e('0xd'),'disposition':_0x797e('0xe'),'closed':!![],'closedAt':moment()[_0x797e('0xf')](_0x797e('0x10'))},{'where':{'id':_['map'](_0x3a092c||[],'id')}});}})[_0x797e('0xb')](function(_0x23885f){for(var _0x35e1e2=0x0;_0x35e1e2<_0x3a092c['length'];_0x35e1e2++){io[_0x797e('0x11')](_0x797e('0x12'),{'id':_0x3a092c[_0x35e1e2]['id'],'closed':!![]});}})[_0x797e('0x13')](function(_0x405632){console[_0x797e('0x14')](_0x405632);});}exports[_0x797e('0x15')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xe0ea=['then','ChatInteraction','minutes','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','chatInteraction:update','catch','start','lodash','moment','../../mysqldb','../../config/environment','redis','defaults','localhost','socket.io-emitter','Setting','find','chatTimeout'];(function(_0x509ce9,_0x5687cc){var _0x1f05d9=function(_0x4a90fd){while(--_0x4a90fd){_0x509ce9['push'](_0x509ce9['shift']());}};_0x1f05d9(++_0x5687cc);}(_0xe0ea,0x79));var _0xae0e=function(_0x518ba1,_0x150e64){_0x518ba1=_0x518ba1-0x0;var _0x254b0d=_0xe0ea[_0x518ba1];return _0x254b0d;};'use strict';var _=require(_0xae0e('0x0'));var moment=require(_0xae0e('0x1'));var Redis=require('ioredis');var db=require(_0xae0e('0x2'))['db'];var config=require(_0xae0e('0x3'));config[_0xae0e('0x4')]=_[_0xae0e('0x5')](config[_0xae0e('0x4')],{'host':_0xae0e('0x6'),'port':0x18eb});var io=require(_0xae0e('0x7'))(new Redis(config[_0xae0e('0x4')]));function closeInteractions(){var _0x382bb4=0x0;var _0x16cc1f=[];return db[_0xae0e('0x8')][_0xae0e('0x9')]({'raw':!![],'attributes':['id',_0xae0e('0xa')],'where':{'id':0x1}})[_0xae0e('0xb')](function(_0x8d99a8){_0x382bb4=_0x8d99a8[_0xae0e('0xa')];if(_0x382bb4){return db[_0xae0e('0xc')]['findAll']({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x8d99a8[_0xae0e('0xa')],_0xae0e('0xd'))}}});}else{return[];}})[_0xae0e('0xb')](function(_0x198d3c){_0x16cc1f=_0x198d3c;if(_0x382bb4){return db[_0xae0e('0xc')][_0xae0e('0xe')]({'closeReason':_0xae0e('0xf'),'disposition':_0xae0e('0x10'),'closed':!![],'closedAt':moment()[_0xae0e('0x11')](_0xae0e('0x12'))},{'where':{'id':_['map'](_0x16cc1f||[],'id')}});}})[_0xae0e('0xb')](function(_0x3d27a4){for(var _0x8a971=0x0;_0x8a971<_0x16cc1f['length'];_0x8a971++){io['emit'](_0xae0e('0x13'),{'id':_0x16cc1f[_0x8a971]['id'],'closed':!![]});}})[_0xae0e('0x14')](function(_0x3df860){console['error'](_0x3df860);});}exports[_0xae0e('0x15')]=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 04c9a5a..4e2bbf1 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 _0x0e18=['no\x20report\x20id','Schedule','MailServerOut','jobs','map','toString','keyBy','difference','length','exists','stop','deleteJob','delete\x20cron','toRun','index','my\x20id','resolve','run\x20job','cron','active','isBetween','endAt','add','start','add\x20cron','stop\x20cron','startAt','update\x20cron','run','util','lodash','moment','jayson/promise','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','Smtp','service','MailAccount','host','port','authentication','auth','user','pass','\x22%s\x22\x20<%s>','name','bcc','format','Report\x20%s\x20last\x20%s\x20%s','subtractUnit','join','savename','%s.%s','basename','extname','zip','existsSync','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','Sent','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','empty\x20file,\x20email\x20not\x20sent','request','SendMail','error','email\x20sent','catch','data','isNil','subtractUnit\x20null\x20or\x20undefined','subtract','subtractNumber','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','then'];(function(_0x641f18,_0x2919e8){var _0x16eefe=function(_0x578a89){while(--_0x578a89){_0x641f18['push'](_0x641f18['shift']());}};_0x16eefe(++_0x2919e8);}(_0x0e18,0x79));var _0x80e1=function(_0x9d9e88,_0x17bde6){_0x9d9e88=_0x9d9e88-0x0;var _0x25bbd7=_0x0e18[_0x9d9e88];return _0x25bbd7;};'use strict';var fs=require('fs');var util=require(_0x80e1('0x0'));var path=require('path');var _=require(_0x80e1('0x1'));var moment=require(_0x80e1('0x2'));var CronJobManager=require('cron-job-manager');var jayson=require(_0x80e1('0x3'));var BPromise=require('bluebird');var logger=require(_0x80e1('0x4'))(_0x80e1('0x5'));var db=require(_0x80e1('0x6'))['db'];var analyticCustomReportController=require(_0x80e1('0x7'));var analyticDefaultReportController=require(_0x80e1('0x8'));var client=jayson[_0x80e1('0x9')][_0x80e1('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x2958d2,_0x20281a){return function(){logger[_0x80e1('0xb')](_0x80e1('0xc'),_0x2958d2[_0x80e1('0xd')]);var _0x5914c1=!![];var _0x4198b3={'tls':{'rejectUnauthorized':![]}};if(_0x2958d2['MailAccount'][_0x80e1('0xe')][_0x80e1('0xf')]){_0x4198b3[_0x80e1('0xf')]=_0x2958d2[_0x80e1('0x10')][_0x80e1('0xe')][_0x80e1('0xf')];}else{_0x4198b3['host']=_0x2958d2[_0x80e1('0x10')][_0x80e1('0xe')][_0x80e1('0x11')];_0x4198b3[_0x80e1('0x12')]=_0x2958d2[_0x80e1('0x10')]['Smtp'][_0x80e1('0x12')];_0x4198b3['secure']=_0x2958d2['MailAccount'][_0x80e1('0xe')]['secure'];}if(_0x2958d2['MailAccount']['Smtp'][_0x80e1('0x13')]){_0x4198b3[_0x80e1('0x14')]={'user':_0x2958d2[_0x80e1('0x10')][_0x80e1('0xe')][_0x80e1('0x15')],'pass':_0x2958d2[_0x80e1('0x10')][_0x80e1('0xe')][_0x80e1('0x16')]};}var _0xe1449b={'account':_0x4198b3,'message':{'from':util['format'](_0x80e1('0x17'),_0x2958d2['MailAccount'][_0x80e1('0x18')],_0x2958d2[_0x80e1('0x10')][_0x80e1('0xd')]||_0x2958d2['MailAccount'][_0x80e1('0xe')]['user']),'to':_0x2958d2[_0x80e1('0xd')],'cc':_0x2958d2['cc'],'bcc':_0x2958d2[_0x80e1('0x19')],'subject':util[_0x80e1('0x1a')](_0x80e1('0x1b'),_0x20281a[_0x80e1('0x18')],_0x2958d2['subtractNumber'],_0x2958d2[_0x80e1('0x1c')])}};var _0x20c29f=path[_0x80e1('0x1d')](__dirname,'../../files/reports');var _0x11169a=_0x20281a[_0x80e1('0x1e')];var _0x34057f=util[_0x80e1('0x1a')](_0x80e1('0x1f'),path[_0x80e1('0x20')](_0x20281a[_0x80e1('0x1e')],path[_0x80e1('0x21')](_0x20281a[_0x80e1('0x1e')])),_0x80e1('0x22'));var _0x43f2a6=path[_0x80e1('0x1d')](_0x20c29f,_0x11169a);var _0x43e707=path[_0x80e1('0x1d')](_0x20c29f,_0x34057f);if(fs[_0x80e1('0x23')](_0x43f2a6)){_0x20281a['status']='Sent';_0xe1449b[_0x80e1('0x24')][_0x80e1('0x25')]=[{'filename':_0x11169a,'path':_0x43f2a6}];_0xe1449b[_0x80e1('0x24')][_0x80e1('0x26')]=util['format'](_0x80e1('0x27'),JSON[_0x80e1('0x28')](_0x20281a,null,0x2));}else if(fs[_0x80e1('0x23')](_0x43e707)){_0x20281a['status']=_0x80e1('0x29');_0xe1449b[_0x80e1('0x24')][_0x80e1('0x25')]=[{'filename':_0x34057f,'path':_0x43e707}];}else{_0xe1449b[_0x80e1('0x24')][_0x80e1('0x26')]=_0x80e1('0x2a');if(!_0x2958d2['sendIfEmpty']){_0x5914c1=![];logger[_0x80e1('0xb')](_0x80e1('0x2b'));}}if(_0x5914c1){return client[_0x80e1('0x2c')](_0x80e1('0x2d'),_0xe1449b)['then'](function(_0xdc8dfa){if(_0xdc8dfa[_0x80e1('0x2e')]){return logger[_0x80e1('0x2e')]('error\x20mail',JSON[_0x80e1('0x28')](_0xdc8dfa));}return logger[_0x80e1('0xb')](_0x80e1('0x2f'));})[_0x80e1('0x30')](function(_0x13b5e2){return logger['error']('error\x20mail',JSON[_0x80e1('0x28')](_0x13b5e2));});}};}function handleError(){return function(_0x48ad6e){return logger['error'](JSON[_0x80e1('0x28')](_0x48ad6e));};}function handleResult(_0x3fa58f){return function(_0x2fb25d){logger[_0x80e1('0xb')](_0x80e1('0x31'),JSON[_0x80e1('0x28')](_0x2fb25d));if(_0x3fa58f[_0x80e1('0x10')]&&_0x3fa58f[_0x80e1('0x10')][_0x80e1('0xe')]&&!_[_0x80e1('0x32')](_0x3fa58f[_0x80e1('0xd')])){setTimeout(handleSendEmail(_0x3fa58f,_0x2fb25d),0x3c*0x3e8);}};}function handleJob(_0x41b6a9){return function(){try{if(_['isNil'](_0x41b6a9['subtractNumber'])){return logger[_0x80e1('0xb')]('subtractNumber\x20null\x20or\x20undefined');}if(_['isNil'](_0x41b6a9[_0x80e1('0x1c')])){return logger[_0x80e1('0xb')](_0x80e1('0x33'));}var _0x23552a={'startDate':moment()[_0x80e1('0x34')](_0x41b6a9[_0x80e1('0x35')],_0x41b6a9[_0x80e1('0x1c')])[_0x80e1('0x1a')](_0x80e1('0x36')),'endDate':moment()[_0x80e1('0x1a')]('YYYY-MM-DD\x20HH:mm:ss'),'type':_0x80e1('0x37'),'output':_0x41b6a9[_0x80e1('0x38')],'name':_0x41b6a9[_0x80e1('0x18')]};if(!_[_0x80e1('0x32')](_0x41b6a9[_0x80e1('0x39')])){logger[_0x80e1('0xb')](_0x80e1('0x3a'),_0x41b6a9[_0x80e1('0x39')]);return analyticDefaultReportController[_0x80e1('0x3b')]({'id':_0x41b6a9['DefaultReportId']},_0x23552a)['then'](handleResult(_0x41b6a9))[_0x80e1('0x30')](handleError());}if(!_['isNil'](_0x41b6a9[_0x80e1('0x3c')])){logger[_0x80e1('0xb')](_0x80e1('0x3d'),_0x41b6a9[_0x80e1('0x3c')]);return analyticCustomReportController[_0x80e1('0x3b')]({'id':_0x41b6a9['CustomReportId']},_0x23552a)[_0x80e1('0x3e')](handleResult(_0x41b6a9))[_0x80e1('0x30')](handleError());}}catch(_0x1f5b14){logger[_0x80e1('0x2e')](JSON[_0x80e1('0x28')](_0x1f5b14));}return logger[_0x80e1('0xb')](_0x80e1('0x3f'));};}function getJobs(_0x5b1618){var _0x2a5ad2={};if(_0x5b1618){_0x2a5ad2['id']=_0x5b1618;}return db[_0x80e1('0x40')]['findAll']({'where':_0x2a5ad2,'include':[{'model':db[_0x80e1('0x10')],'attributes':['id',_0x80e1('0x18'),'email'],'include':[{'model':db[_0x80e1('0x41')],'as':_0x80e1('0xe')}]}]})[_0x80e1('0x3e')](function(_0x4c7cfc){var _0x575f88=_['keys'](manager[_0x80e1('0x42')]);var _0xa0da35=_[_0x80e1('0x43')](_0x4c7cfc,function(_0x3394bc){return _0x3394bc['id'][_0x80e1('0x44')]();});var _0x4d7dcf=_[_0x80e1('0x45')](_0x4c7cfc,function(_0x48a624){return _0x48a624['id'][_0x80e1('0x44')]();});var _0x484482=_0x5b1618?_0xa0da35:_[_0x80e1('0x46')](_0xa0da35,_0x575f88);var _0x5de66a=_['intersection'](_0xa0da35,_0x575f88);var _0x5b7c8d=_[_0x80e1('0x46')](_0x575f88,_0xa0da35);var _0x4187fd;var _0xdf6353;for(_0x4187fd=0x0;_0x4187fd<_0x5b7c8d[_0x80e1('0x47')]&&!_0x5b1618;_0x4187fd+=0x1){_0xdf6353=_0x5b7c8d[_0x4187fd][_0x80e1('0x44')]();if(manager[_0x80e1('0x48')](_0xdf6353)){manager[_0x80e1('0x49')](_0xdf6353);manager[_0x80e1('0x4a')](_0xdf6353);logger['info'](_0x80e1('0x4b'),_0xdf6353);}}logger[_0x80e1('0xb')](_0x80e1('0x4c'),JSON[_0x80e1('0x28')](_0x484482));for(_0x4187fd=0x0;_0x4187fd<_0x484482[_0x80e1('0x47')];_0x4187fd+=0x1){_0xdf6353=_0x484482[_0x4187fd][_0x80e1('0x44')]();logger['info'](_0x80e1('0x4d'),_0xdf6353);if(_0x5b1618){logger[_0x80e1('0xb')](_0x80e1('0x4e'),_0x5b1618);logger[_0x80e1('0xb')](JSON['stringify'](_0x4d7dcf[_0xdf6353]));BPromise[_0x80e1('0x4f')]()[_0x80e1('0x3e')](handleJob(_0x4d7dcf[_0xdf6353]));logger[_0x80e1('0xb')](_0x80e1('0x50'),_0x4d7dcf[_0xdf6353]['name'],_0x4d7dcf[_0xdf6353][_0x80e1('0x51')]);}else if(_0x4d7dcf[_0xdf6353][_0x80e1('0x51')]&&_0x4d7dcf[_0xdf6353][_0x80e1('0x52')]&&moment()[_0x80e1('0x53')](_0x4d7dcf[_0xdf6353]['startAt'],_0x4d7dcf[_0xdf6353][_0x80e1('0x54')])){manager[_0x80e1('0x55')](_0xdf6353,_0x4d7dcf[_0xdf6353][_0x80e1('0x51')],handleJob(_0x4d7dcf[_0xdf6353]));manager[_0x80e1('0x56')](_0xdf6353);logger[_0x80e1('0xb')](_0x80e1('0x57'),_0x4d7dcf[_0xdf6353][_0x80e1('0x18')],_0x4d7dcf[_0xdf6353][_0x80e1('0x51')]);}else if(manager[_0x80e1('0x48')](_0xdf6353)){manager[_0x80e1('0x49')](_0xdf6353);manager['deleteJob'](_0xdf6353);logger[_0x80e1('0xb')](_0x80e1('0x58'),_0x4d7dcf[_0xdf6353][_0x80e1('0x18')],_0x4d7dcf[_0xdf6353]['cron']);}}for(_0x4187fd=0x0,_0xdf6353;_0x4187fd<_0x5de66a['length']&&!_0x5b1618;_0x4187fd+=0x1){_0xdf6353=_0x5de66a[_0x4187fd][_0x80e1('0x44')]();if(manager[_0x80e1('0x48')](_0xdf6353)){if(_0x4d7dcf[_0xdf6353]['cron']&&_0x4d7dcf[_0xdf6353][_0x80e1('0x52')]&&moment()[_0x80e1('0x53')](_0x4d7dcf[_0xdf6353][_0x80e1('0x59')],_0x4d7dcf[_0xdf6353][_0x80e1('0x54')])){manager['update'](_0xdf6353,_0x4d7dcf[_0xdf6353]['cron'],handleJob(_0x4d7dcf[_0xdf6353]));logger[_0x80e1('0xb')](_0x80e1('0x5a'),_0x4d7dcf[_0xdf6353]['name'],_0x4d7dcf[_0xdf6353][_0x80e1('0x51')]);}else{manager['stop'](_0xdf6353);manager[_0x80e1('0x4a')](_0xdf6353);logger[_0x80e1('0xb')](_0x80e1('0x58'),_0x4d7dcf[_0xdf6353]['name'],_0x4d7dcf[_0xdf6353][_0x80e1('0x51')]);}}}})[_0x80e1('0x30')](function(_0x57ea26){logger[_0x80e1('0x2e')](JSON[_0x80e1('0x28')](_0x57ea26));});}exports[_0x80e1('0x5b')]=function(_0x4c5066){return getJobs(_0x4c5066);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0xb00d=['email','MailAccount','service','Smtp','host','port','secure','auth','user','pass','format','\x22%s\x22\x20<%s>','name','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractUnit','join','../../files/reports','savename','%s.%s','basename','extname','zip','existsSync','status','attachments','message','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','Sent','sendIfEmpty','info','SendMail','then','error','email\x20sent','catch','error\x20mail','data','isNil','subtractNumber','subtractNumber\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','exec\x20custom\x20report\x20id:%s','CustomReportId','no\x20report\x20id','Schedule','findAll','MailServerOut','keys','jobs','map','toString','keyBy','difference','length','exists','stop','deleteJob','delete\x20cron','index','my\x20id','resolve','run\x20job','cron','isBetween','endAt','add','start','active','update','update\x20cron','stop\x20cron','run','util','path','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','Try\x20to\x20send\x20a\x20mail\x20to'];(function(_0x58106b,_0x2da0b4){var _0x55fe73=function(_0x4376ce){while(--_0x4376ce){_0x58106b['push'](_0x58106b['shift']());}};_0x55fe73(++_0x2da0b4);}(_0xb00d,0xae));var _0xdb00=function(_0x37c07d,_0xdbdb5f){_0x37c07d=_0x37c07d-0x0;var _0x10dadc=_0xb00d[_0x37c07d];return _0x10dadc;};'use strict';var fs=require('fs');var util=require(_0xdb00('0x0'));var path=require(_0xdb00('0x1'));var _=require('lodash');var moment=require('moment');var CronJobManager=require(_0xdb00('0x2'));var jayson=require(_0xdb00('0x3'));var BPromise=require(_0xdb00('0x4'));var logger=require(_0xdb00('0x5'))(_0xdb00('0x6'));var db=require(_0xdb00('0x7'))['db'];var analyticCustomReportController=require(_0xdb00('0x8'));var analyticDefaultReportController=require(_0xdb00('0x9'));var client=jayson[_0xdb00('0xa')]['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x38b873,_0x4d0cd8){return function(){logger['info'](_0xdb00('0xb'),_0x38b873[_0xdb00('0xc')]);var _0x515387=!![];var _0x2962f2={'tls':{'rejectUnauthorized':![]}};if(_0x38b873[_0xdb00('0xd')]['Smtp'][_0xdb00('0xe')]){_0x2962f2[_0xdb00('0xe')]=_0x38b873[_0xdb00('0xd')][_0xdb00('0xf')]['service'];}else{_0x2962f2[_0xdb00('0x10')]=_0x38b873[_0xdb00('0xd')][_0xdb00('0xf')][_0xdb00('0x10')];_0x2962f2[_0xdb00('0x11')]=_0x38b873[_0xdb00('0xd')][_0xdb00('0xf')][_0xdb00('0x11')];_0x2962f2['secure']=_0x38b873['MailAccount'][_0xdb00('0xf')][_0xdb00('0x12')];}if(_0x38b873['MailAccount'][_0xdb00('0xf')]['authentication']){_0x2962f2[_0xdb00('0x13')]={'user':_0x38b873[_0xdb00('0xd')][_0xdb00('0xf')][_0xdb00('0x14')],'pass':_0x38b873['MailAccount'][_0xdb00('0xf')][_0xdb00('0x15')]};}var _0x1b91c6={'account':_0x2962f2,'message':{'from':util[_0xdb00('0x16')](_0xdb00('0x17'),_0x38b873[_0xdb00('0xd')][_0xdb00('0x18')],_0x38b873[_0xdb00('0xd')]['email']||_0x38b873[_0xdb00('0xd')][_0xdb00('0xf')]['user']),'to':_0x38b873[_0xdb00('0xc')],'cc':_0x38b873['cc'],'bcc':_0x38b873[_0xdb00('0x19')],'subject':util[_0xdb00('0x16')](_0xdb00('0x1a'),_0x4d0cd8['name'],_0x38b873['subtractNumber'],_0x38b873[_0xdb00('0x1b')])}};var _0x2bb5f5=path[_0xdb00('0x1c')](__dirname,_0xdb00('0x1d'));var _0x85725=_0x4d0cd8[_0xdb00('0x1e')];var _0x173180=util[_0xdb00('0x16')](_0xdb00('0x1f'),path[_0xdb00('0x20')](_0x4d0cd8[_0xdb00('0x1e')],path[_0xdb00('0x21')](_0x4d0cd8[_0xdb00('0x1e')])),_0xdb00('0x22'));var _0x31d2d3=path[_0xdb00('0x1c')](_0x2bb5f5,_0x85725);var _0x25f2c3=path[_0xdb00('0x1c')](_0x2bb5f5,_0x173180);if(fs[_0xdb00('0x23')](_0x31d2d3)){_0x4d0cd8[_0xdb00('0x24')]='Sent';_0x1b91c6['message'][_0xdb00('0x25')]=[{'filename':_0x85725,'path':_0x31d2d3}];_0x1b91c6[_0xdb00('0x26')][_0xdb00('0x27')]=util[_0xdb00('0x16')](_0xdb00('0x28'),JSON[_0xdb00('0x29')](_0x4d0cd8,null,0x2));}else if(fs[_0xdb00('0x23')](_0x25f2c3)){_0x4d0cd8['status']=_0xdb00('0x2a');_0x1b91c6[_0xdb00('0x26')][_0xdb00('0x25')]=[{'filename':_0x173180,'path':_0x25f2c3}];}else{_0x1b91c6[_0xdb00('0x26')][_0xdb00('0x27')]='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x38b873[_0xdb00('0x2b')]){_0x515387=![];logger[_0xdb00('0x2c')]('empty\x20file,\x20email\x20not\x20sent');}}if(_0x515387){return client['request'](_0xdb00('0x2d'),_0x1b91c6)[_0xdb00('0x2e')](function(_0x581aab){if(_0x581aab[_0xdb00('0x2f')]){return logger[_0xdb00('0x2f')]('error\x20mail',JSON[_0xdb00('0x29')](_0x581aab));}return logger[_0xdb00('0x2c')](_0xdb00('0x30'));})[_0xdb00('0x31')](function(_0x4ed62c){return logger[_0xdb00('0x2f')](_0xdb00('0x32'),JSON[_0xdb00('0x29')](_0x4ed62c));});}};}function handleError(){return function(_0x14442d){return logger[_0xdb00('0x2f')](JSON['stringify'](_0x14442d));};}function handleResult(_0x473d9e){return function(_0x423a87){logger['info'](_0xdb00('0x33'),JSON[_0xdb00('0x29')](_0x423a87));if(_0x473d9e[_0xdb00('0xd')]&&_0x473d9e[_0xdb00('0xd')][_0xdb00('0xf')]&&!_[_0xdb00('0x34')](_0x473d9e['email'])){setTimeout(handleSendEmail(_0x473d9e,_0x423a87),0x3c*0x3e8);}};}function handleJob(_0x214369){return function(){try{if(_[_0xdb00('0x34')](_0x214369[_0xdb00('0x35')])){return logger[_0xdb00('0x2c')](_0xdb00('0x36'));}if(_[_0xdb00('0x34')](_0x214369['subtractUnit'])){return logger[_0xdb00('0x2c')]('subtractUnit\x20null\x20or\x20undefined');}var _0x80b51a={'startDate':moment()[_0xdb00('0x37')](_0x214369[_0xdb00('0x35')],_0x214369['subtractUnit'])[_0xdb00('0x16')](_0xdb00('0x38')),'endDate':moment()[_0xdb00('0x16')](_0xdb00('0x38')),'type':_0xdb00('0x39'),'output':_0x214369[_0xdb00('0x3a')],'name':_0x214369[_0xdb00('0x18')]};if(!_[_0xdb00('0x34')](_0x214369[_0xdb00('0x3b')])){logger[_0xdb00('0x2c')](_0xdb00('0x3c'),_0x214369[_0xdb00('0x3b')]);return analyticDefaultReportController[_0xdb00('0x3d')]({'id':_0x214369[_0xdb00('0x3b')]},_0x80b51a)[_0xdb00('0x2e')](handleResult(_0x214369))[_0xdb00('0x31')](handleError());}if(!_['isNil'](_0x214369['CustomReportId'])){logger[_0xdb00('0x2c')](_0xdb00('0x3e'),_0x214369[_0xdb00('0x3f')]);return analyticCustomReportController[_0xdb00('0x3d')]({'id':_0x214369[_0xdb00('0x3f')]},_0x80b51a)['then'](handleResult(_0x214369))['catch'](handleError());}}catch(_0x55af89){logger[_0xdb00('0x2f')](JSON[_0xdb00('0x29')](_0x55af89));}return logger[_0xdb00('0x2c')](_0xdb00('0x40'));};}function getJobs(_0xe9fcbd){var _0x5195ee={};if(_0xe9fcbd){_0x5195ee['id']=_0xe9fcbd;}return db[_0xdb00('0x41')][_0xdb00('0x42')]({'where':_0x5195ee,'include':[{'model':db['MailAccount'],'attributes':['id',_0xdb00('0x18'),'email'],'include':[{'model':db[_0xdb00('0x43')],'as':_0xdb00('0xf')}]}]})[_0xdb00('0x2e')](function(_0x472b80){var _0x1c7d66=_[_0xdb00('0x44')](manager[_0xdb00('0x45')]);var _0x6a4e0d=_[_0xdb00('0x46')](_0x472b80,function(_0x1cefc9){return _0x1cefc9['id'][_0xdb00('0x47')]();});var _0x41a083=_[_0xdb00('0x48')](_0x472b80,function(_0x4e5266){return _0x4e5266['id']['toString']();});var _0x1dddda=_0xe9fcbd?_0x6a4e0d:_[_0xdb00('0x49')](_0x6a4e0d,_0x1c7d66);var _0x229eeb=_['intersection'](_0x6a4e0d,_0x1c7d66);var _0x3b61f8=_[_0xdb00('0x49')](_0x1c7d66,_0x6a4e0d);var _0x4339e1;var _0x1898d8;for(_0x4339e1=0x0;_0x4339e1<_0x3b61f8[_0xdb00('0x4a')]&&!_0xe9fcbd;_0x4339e1+=0x1){_0x1898d8=_0x3b61f8[_0x4339e1][_0xdb00('0x47')]();if(manager[_0xdb00('0x4b')](_0x1898d8)){manager[_0xdb00('0x4c')](_0x1898d8);manager[_0xdb00('0x4d')](_0x1898d8);logger[_0xdb00('0x2c')](_0xdb00('0x4e'),_0x1898d8);}}logger['info']('toRun',JSON['stringify'](_0x1dddda));for(_0x4339e1=0x0;_0x4339e1<_0x1dddda['length'];_0x4339e1+=0x1){_0x1898d8=_0x1dddda[_0x4339e1][_0xdb00('0x47')]();logger[_0xdb00('0x2c')](_0xdb00('0x4f'),_0x1898d8);if(_0xe9fcbd){logger[_0xdb00('0x2c')](_0xdb00('0x50'),_0xe9fcbd);logger[_0xdb00('0x2c')](JSON['stringify'](_0x41a083[_0x1898d8]));BPromise[_0xdb00('0x51')]()['then'](handleJob(_0x41a083[_0x1898d8]));logger['info'](_0xdb00('0x52'),_0x41a083[_0x1898d8][_0xdb00('0x18')],_0x41a083[_0x1898d8]['cron']);}else if(_0x41a083[_0x1898d8][_0xdb00('0x53')]&&_0x41a083[_0x1898d8]['active']&&moment()[_0xdb00('0x54')](_0x41a083[_0x1898d8]['startAt'],_0x41a083[_0x1898d8][_0xdb00('0x55')])){manager[_0xdb00('0x56')](_0x1898d8,_0x41a083[_0x1898d8][_0xdb00('0x53')],handleJob(_0x41a083[_0x1898d8]));manager[_0xdb00('0x57')](_0x1898d8);logger['info']('add\x20cron',_0x41a083[_0x1898d8][_0xdb00('0x18')],_0x41a083[_0x1898d8][_0xdb00('0x53')]);}else if(manager[_0xdb00('0x4b')](_0x1898d8)){manager['stop'](_0x1898d8);manager['deleteJob'](_0x1898d8);logger[_0xdb00('0x2c')]('stop\x20cron',_0x41a083[_0x1898d8][_0xdb00('0x18')],_0x41a083[_0x1898d8][_0xdb00('0x53')]);}}for(_0x4339e1=0x0,_0x1898d8;_0x4339e1<_0x229eeb[_0xdb00('0x4a')]&&!_0xe9fcbd;_0x4339e1+=0x1){_0x1898d8=_0x229eeb[_0x4339e1]['toString']();if(manager[_0xdb00('0x4b')](_0x1898d8)){if(_0x41a083[_0x1898d8]['cron']&&_0x41a083[_0x1898d8][_0xdb00('0x58')]&&moment()[_0xdb00('0x54')](_0x41a083[_0x1898d8]['startAt'],_0x41a083[_0x1898d8][_0xdb00('0x55')])){manager[_0xdb00('0x59')](_0x1898d8,_0x41a083[_0x1898d8][_0xdb00('0x53')],handleJob(_0x41a083[_0x1898d8]));logger[_0xdb00('0x2c')](_0xdb00('0x5a'),_0x41a083[_0x1898d8][_0xdb00('0x18')],_0x41a083[_0x1898d8]['cron']);}else{manager[_0xdb00('0x4c')](_0x1898d8);manager['deleteJob'](_0x1898d8);logger[_0xdb00('0x2c')](_0xdb00('0x5b'),_0x41a083[_0x1898d8][_0xdb00('0x18')],_0x41a083[_0x1898d8][_0xdb00('0x53')]);}}}})['catch'](function(_0x985dc4){logger[_0xdb00('0x2f')](JSON[_0xdb00('0x29')](_0x985dc4));});}exports[_0xdb00('0x5c')]=function(_0x3ff921){return getJobs(_0x3ff921);};exports[_0xdb00('0x57')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index a56cc0c..75c18a1 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6519=['util','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','destroy','then','log','finished\x20populating','contacts1','CmHopper','CmContact','catch'];(function(_0x117eb2,_0x39a648){var _0x1ee6f0=function(_0x58735f){while(--_0x58735f){_0x117eb2['push'](_0x117eb2['shift']());}};_0x1ee6f0(++_0x39a648);}(_0x6519,0x70));var _0x9651=function(_0x11090e,_0x2f1226){_0x11090e=_0x11090e-0x0;var _0x103e19=_0x6519[_0x11090e];return _0x103e19;};'use strict';var util=require(_0x9651('0x0'));var db=require(_0x9651('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x9651('0x2')]({'id':i,'firstName':_0x9651('0x3')+i,'lastName':_0x9651('0x4')+i,'phone':0xf879fb460+i,'email':_0x9651('0x5')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'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[_0x9651('0x2')]({'id':i,'firstName':_0x9651('0x3')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x9651('0x5')+i+_0x9651('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x9651('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x9651('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x9651('0x7')](),'updatedAt':Date[_0x9651('0x7')]()});}db['CmContact'][_0x9651('0x8')]({'where':{}})[_0x9651('0x9')](function(){return db['CmContact']['bulkCreate'](contacts);})[_0x9651('0x9')](function(){console[_0x9651('0xa')](_0x9651('0xb'),_0x9651('0xc'));return db[_0x9651('0xd')][_0x9651('0x8')]({'where':{}});})[_0x9651('0x9')](function(){return db[_0x9651('0xd')]['bulkCreate'](hopper);})[_0x9651('0x9')](function(){console['log']('finished\x20populating','hopper1');return db[_0x9651('0xe')]['bulkCreate'](contacts2);})['then'](function(){console[_0x9651('0xa')](_0x9651('0xb'),'contacts2');return db['CmHopper']['bulkCreate'](hopper2);})['then'](function(){console[_0x9651('0xa')](_0x9651('0xb'),'hopper2');})[_0x9651('0xf')](function(_0x4bb663){console[_0x9651('0xa')](_0x4bb663);}); \ No newline at end of file +var _0x3ae4=['Innocenzo','Biondo','destroy','then','CmContact','finished\x20populating','contacts1','CmHopper','log','hopper1','contacts2','hopper2','catch','util','push','innocenzo.biondo','@xcally.com','now'];(function(_0xa97e09,_0x246cb4){var _0x45a807=function(_0x2e499e){while(--_0x2e499e){_0xa97e09['push'](_0xa97e09['shift']());}};_0x45a807(++_0x246cb4);}(_0x3ae4,0x187));var _0x43ae=function(_0x3c3abe,_0x1bd43d){_0x3c3abe=_0x3c3abe-0x0;var _0xd550cc=_0x3ae4[_0x3c3abe];return _0xd550cc;};'use strict';var util=require(_0x43ae('0x0'));var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x43ae('0x1')]({'id':i,'firstName':'Innocenzo'+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x43ae('0x2')+i+_0x43ae('0x3')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x43ae('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x43ae('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x43ae('0x4')](),'updatedAt':Date[_0x43ae('0x4')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x43ae('0x1')]({'id':i,'firstName':_0x43ae('0x5')+i,'lastName':_0x43ae('0x6')+i,'phone':0xf879fb460+i,'email':_0x43ae('0x2')+i+_0x43ae('0x3')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x43ae('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x43ae('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x43ae('0x4')](),'updatedAt':Date[_0x43ae('0x4')]()});}db['CmContact'][_0x43ae('0x7')]({'where':{}})[_0x43ae('0x8')](function(){return db[_0x43ae('0x9')]['bulkCreate'](contacts);})[_0x43ae('0x8')](function(){console['log'](_0x43ae('0xa'),_0x43ae('0xb'));return db['CmHopper'][_0x43ae('0x7')]({'where':{}});})[_0x43ae('0x8')](function(){return db[_0x43ae('0xc')]['bulkCreate'](hopper);})[_0x43ae('0x8')](function(){console[_0x43ae('0xd')](_0x43ae('0xa'),_0x43ae('0xe'));return db[_0x43ae('0x9')]['bulkCreate'](contacts2);})[_0x43ae('0x8')](function(){console[_0x43ae('0xd')](_0x43ae('0xa'),_0x43ae('0xf'));return db[_0x43ae('0xc')]['bulkCreate'](hopper2);})['then'](function(){console[_0x43ae('0xd')](_0x43ae('0xa'),_0x43ae('0x10'));})[_0x43ae('0x11')](function(_0x5c711d){console['log'](_0x5c711d);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 98ab663..38246f1 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a9e=['ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','then','log','add\x20user','catch','util','../mysqldb','push','format','%s%s','agent','friend','udp','all'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7a9e,0x1eb));var _0xe7a9=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x7a9e[_0x4a9fb1];return _0x348672;};'use strict';var util=require(_0xe7a9('0x0'));var db=require(_0xe7a9('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xe7a9('0x2')]({'name':util[_0xe7a9('0x3')](_0xe7a9('0x4'),_0xe7a9('0x5'),i),'fullname':util['format']('%s%s',_0xe7a9('0x5'),i),'email':util[_0xe7a9('0x3')]('%s%s@xcally.com',_0xe7a9('0x5'),i),'role':_0xe7a9('0x5'),'password':'password','internal':0xfa0+i,'type':_0xe7a9('0x6'),'transport':[_0xe7a9('0x7'),'ws','wss'],'disallow':[_0xe7a9('0x8')],'allow':[_0xe7a9('0x9')],'defaultuser':util[_0xe7a9('0x3')](_0xe7a9('0x4'),_0xe7a9('0x5'),i),'encryption':_0xe7a9('0xa'),'avpf':_0xe7a9('0xa'),'force_avp':_0xe7a9('0xa'),'icesupport':_0xe7a9('0xa'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':_0xe7a9('0xb'),'dtlsprivatekey':_0xe7a9('0xc'),'dtlssetup':_0xe7a9('0xd'),'callerid':util['format'](_0xe7a9('0xe'),util[_0xe7a9('0x3')](_0xe7a9('0x4'),_0xe7a9('0x5'),i),0xfa0+i)});}db[_0xe7a9('0xf')]['bulkCreate'](users)[_0xe7a9('0x10')](function(){console[_0xe7a9('0x11')](_0xe7a9('0x12'));})[_0xe7a9('0x13')](function(_0x1072f9){console[_0xe7a9('0x11')](_0x1072f9);}); \ No newline at end of file +var _0x07fd=['actpass','\x22%s\x22\x20<%s>','User','then','log','catch','util','../mysqldb','%s%s','format','%s%s@xcally.com','agent','password','friend','udp','wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key'];(function(_0x3b4386,_0x5686b4){var _0x5642c2=function(_0x902060){while(--_0x902060){_0x3b4386['push'](_0x3b4386['shift']());}};_0x5642c2(++_0x5686b4);}(_0x07fd,0x84));var _0xd07f=function(_0x25f94c,_0x43702f){_0x25f94c=_0x25f94c-0x0;var _0x2693f0=_0x07fd[_0x25f94c];return _0x2693f0;};'use strict';var util=require(_0xd07f('0x0'));var db=require(_0xd07f('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util['format'](_0xd07f('0x2'),'agent',i),'fullname':util[_0xd07f('0x3')](_0xd07f('0x2'),'agent',i),'email':util['format'](_0xd07f('0x4'),_0xd07f('0x5'),i),'role':'agent','password':_0xd07f('0x6'),'internal':0xfa0+i,'type':_0xd07f('0x7'),'transport':[_0xd07f('0x8'),'ws',_0xd07f('0x9')],'disallow':[_0xd07f('0xa')],'allow':[_0xd07f('0xb')],'defaultuser':util['format']('%s%s','agent',i),'encryption':_0xd07f('0xc'),'avpf':'yes','force_avp':_0xd07f('0xc'),'icesupport':_0xd07f('0xc'),'dtlsenable':_0xd07f('0xc'),'dtlsverify':'no','dtlscertfile':_0xd07f('0xd'),'dtlsprivatekey':_0xd07f('0xe'),'dtlssetup':_0xd07f('0xf'),'callerid':util['format'](_0xd07f('0x10'),util['format'](_0xd07f('0x2'),_0xd07f('0x5'),i),0xfa0+i)});}db[_0xd07f('0x11')]['bulkCreate'](users)[_0xd07f('0x12')](function(){console[_0xd07f('0x13')]('add\x20user');})[_0xd07f('0x14')](function(_0x39cd35){console[_0xd07f('0x13')](_0x39cd35);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 22086e8..8a1617d 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbd9f=['default','connection','setMaxListeners','address','request','remoteAddress','remotePort','connectedAt','SocketIO\x20','nsp','disconnect','DISCONNECTED','CONNECTED','lodash','bluebird','name','User','agent','telephone','type','findOne','then','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','findAll','Telephones','IvrCampaigns','UserProfileResource','resourceId','map','where','Campaign','ivr','format','%s:queue:%s','Agents','length','user:%s','query','find','role','userProfileId','handshake','ChatInteraction','ChatInteractions','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','admin','voice:inbound','include','push','VoiceQueue','ChatQueue','SmsQueue','MailQueue','Trunk','user','voice:outbound','VoiceQueues','ChatQueues','FaxQueue','Trunks','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','all','voice','chat','sms','mail','openchannel','telephone:%s','trunk:%s','leave','removeChatInteractions','emit','user_has_chat_interactions:remove','user_has_mail_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','catch','log','join'];(function(_0x50d5ad,_0x61a6f){var _0x9f6ffc=function(_0x5764d5){while(--_0x5764d5){_0x50d5ad['push'](_0x50d5ad['shift']());}};_0x9f6ffc(++_0x61a6f);}(_0xbd9f,0x1e3));var _0xfbd9=function(_0x31ce0d,_0x3588fe){_0x31ce0d=_0x31ce0d-0x0;var _0x328b03=_0xbd9f[_0x31ce0d];return _0x328b03;};'use strict';var _=require(_0xfbd9('0x0'));var util=require('util');var BPromise=require(_0xfbd9('0x1'));var db=require('../mysqldb')['db'];var config=require('./environment');var queryQueues={'attributes':['id',_0xfbd9('0x2')],'include':[{'as':'Agents','model':db[_0xfbd9('0x3')],'attributes':['id',_0xfbd9('0x2'),'role'],'raw':!![],'where':{'role':_0xfbd9('0x4')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xfbd9('0x2')],'where':{'role':_0xfbd9('0x5')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id',_0xfbd9('0x2')],'where':{'role':_0xfbd9('0x4')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xfbd9('0x2'),_0xfbd9('0x6')],'where':{'type':'ivr'}};function getAssociatedResources(_0x4b1543,_0x2b78f3,_0x13e0da){return db['UserProfileSection'][_0xfbd9('0x7')]({'where':{'name':_0x4b1543,'userProfileId':_0x2b78f3},'raw':!![]})[_0xfbd9('0x8')](function(_0xb9105){if(_0xb9105){if(_0xb9105['autoAssociation']){switch(_0x4b1543){case'VoiceQueues':case'ChatQueues':case _0xfbd9('0x9'):case _0xfbd9('0xa'):case _0xfbd9('0xb'):case _0xfbd9('0xc'):return db[_0x13e0da][_0xfbd9('0xd')](queryQueues);case _0xfbd9('0xe'):return db[_0x13e0da]['findAll'](queryTelephones);case'Trunks':return db[_0x13e0da][_0xfbd9('0xd')](queryTrunks);case _0xfbd9('0xf'):return db[_0x13e0da]['findAll'](queryCampaigns);}}else{return db[_0xfbd9('0x10')][_0xfbd9('0xd')]({'attributes':[_0xfbd9('0x11')],'where':{'sectionId':_0xb9105['id']},'raw':!![]})[_0xfbd9('0x8')](function(_0x14ed03){if(_0x14ed03){var _0xa92db3={'where':{'id':_[_0xfbd9('0x12')](_0x14ed03,_0xfbd9('0x11'))},'raw':!![]};switch(_0x13e0da){case _0xfbd9('0x3'):_0xa92db3[_0xfbd9('0x13')]['role']='telephone';break;case _0xfbd9('0x14'):_0xa92db3[_0xfbd9('0x13')][_0xfbd9('0x6')]=_0xfbd9('0x15');break;}return db[_0x13e0da][_0xfbd9('0xd')](_0xa92db3);}else{return[];}});}}else{return[];}})[_0xfbd9('0x8')](function(_0x214a5b){return _0x214a5b;});}function joinOrLeaveQueues(_0x1e5cc5,_0x53e8eb,_0x27dcc3,_0x4f7cb0){_0x1e5cc5[_0x53e8eb](util[_0xfbd9('0x16')](_0xfbd9('0x17'),_0x27dcc3,_0x4f7cb0[_0xfbd9('0x2')]));if(_0x4f7cb0[_0xfbd9('0x18')]){for(var _0x22149d=0x0;_0x22149d<_0x4f7cb0[_0xfbd9('0x18')][_0xfbd9('0x19')];_0x22149d+=0x1){_0x1e5cc5[_0x53e8eb](util['format'](_0xfbd9('0x1a'),_0x4f7cb0[_0xfbd9('0x18')][_0x22149d][_0xfbd9('0x2')]));}}}function joinOrLeave(_0x3bc70a,_0x1905d1,_0xf44bda){var _0x4ae481;if(_0x3bc70a['handshake'][_0xfbd9('0x1b')]['id']){db[_0xfbd9('0x3')][_0xfbd9('0x1c')]({'attributes':['id',_0xfbd9('0x2'),_0xfbd9('0x1d'),_0xfbd9('0x1e')],'where':{'id':_0x3bc70a[_0xfbd9('0x1f')][_0xfbd9('0x1b')]['id']},'include':[{'model':db[_0xfbd9('0x20')],'as':_0xfbd9('0x21'),'attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':_0xfbd9('0x22'),'attributes':['id'],'raw':!![]},{'model':db[_0xfbd9('0x23')],'as':_0xfbd9('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0xfbd9('0x25')],'as':_0xfbd9('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0xfbd9('0x27')],'as':_0xfbd9('0x28'),'attributes':['id'],'raw':!![]}]})[_0xfbd9('0x8')](function(_0x31670b){if(_0x31670b){_0x4ae481=_0x31670b;_0x3bc70a[_0x1905d1](util[_0xfbd9('0x16')]('user:%s',_0x31670b[_0xfbd9('0x2')]));var _0x1ff650=[];switch(_0x31670b[_0xfbd9('0x1d')]){case _0xfbd9('0x29'):_0x3bc70a[_0x1905d1](_0xfbd9('0x2a'));_0x3bc70a[_0x1905d1]('voice:outbound');if(queryQueues['hasOwnProperty'](_0xfbd9('0x2b'))){delete queryQueues['include'];}_0x1ff650[_0xfbd9('0x2c')](db[_0xfbd9('0x2d')][_0xfbd9('0xd')](queryQueues));_0x1ff650[_0xfbd9('0x2c')](db[_0xfbd9('0x2e')]['findAll'](queryQueues));_0x1ff650[_0xfbd9('0x2c')](db['FaxQueue'][_0xfbd9('0xd')](queryQueues));_0x1ff650['push'](db[_0xfbd9('0x2f')]['findAll'](queryQueues));_0x1ff650[_0xfbd9('0x2c')](db[_0xfbd9('0x30')][_0xfbd9('0xd')](queryQueues));_0x1ff650[_0xfbd9('0x2c')](db['OpenchannelQueue'][_0xfbd9('0xd')](queryQueues));_0x1ff650[_0xfbd9('0x2c')](db['User']['findAll'](queryTelephones));_0x1ff650[_0xfbd9('0x2c')](db[_0xfbd9('0x31')][_0xfbd9('0xd')](queryTrunks));_0x1ff650[_0xfbd9('0x2c')](db[_0xfbd9('0x14')][_0xfbd9('0xd')](queryCampaigns));_0x1ff650[_0xfbd9('0x2c')](db[_0xfbd9('0x3')]['findAll'](queryAgents));break;case _0xfbd9('0x32'):_0x3bc70a[_0x1905d1](_0xfbd9('0x2a'));_0x3bc70a[_0x1905d1](_0xfbd9('0x33'));_0x1ff650[_0xfbd9('0x2c')](getAssociatedResources(_0xfbd9('0x34'),_0x31670b[_0xfbd9('0x1e')],_0xfbd9('0x2d')));_0x1ff650[_0xfbd9('0x2c')](getAssociatedResources(_0xfbd9('0x35'),_0x31670b['userProfileId'],'ChatQueue'));_0x1ff650['push'](getAssociatedResources(_0xfbd9('0x9'),_0x31670b[_0xfbd9('0x1e')],_0xfbd9('0x36')));_0x1ff650[_0xfbd9('0x2c')](getAssociatedResources(_0xfbd9('0xa'),_0x31670b[_0xfbd9('0x1e')],_0xfbd9('0x2f')));_0x1ff650['push'](getAssociatedResources(_0xfbd9('0xb'),_0x31670b[_0xfbd9('0x1e')],_0xfbd9('0x30')));_0x1ff650[_0xfbd9('0x2c')](getAssociatedResources(_0xfbd9('0xc'),_0x31670b[_0xfbd9('0x1e')],'OpenchannelQueue'));_0x1ff650[_0xfbd9('0x2c')](getAssociatedResources(_0xfbd9('0xe'),_0x31670b['userProfileId'],_0xfbd9('0x3')));_0x1ff650[_0xfbd9('0x2c')](getAssociatedResources(_0xfbd9('0x37'),_0x31670b[_0xfbd9('0x1e')],_0xfbd9('0x31')));_0x1ff650[_0xfbd9('0x2c')](getAssociatedResources('IvrCampaigns',_0x31670b[_0xfbd9('0x1e')],_0xfbd9('0x14')));_0x1ff650[_0xfbd9('0x2c')](db[_0xfbd9('0x3')][_0xfbd9('0xd')](queryAgents));break;case _0xfbd9('0x4'):_0x3bc70a[_0x1905d1](_0xfbd9('0x2a'));_0x3bc70a[_0x1905d1]('voice:outbound');_0x1ff650[_0xfbd9('0x2c')](_0x31670b[_0xfbd9('0x38')]({'attributes':['id','name']}));_0x1ff650[_0xfbd9('0x2c')](_0x31670b[_0xfbd9('0x39')]({'attributes':['id',_0xfbd9('0x2')]}));_0x1ff650[_0xfbd9('0x2c')](_0x31670b[_0xfbd9('0x3a')]({'attributes':['id',_0xfbd9('0x2')]}));_0x1ff650[_0xfbd9('0x2c')](_0x31670b[_0xfbd9('0x3b')]({'attributes':['id','name']}));_0x1ff650['push'](_0x31670b[_0xfbd9('0x3c')]({'attributes':['id',_0xfbd9('0x2')]}));_0x1ff650[_0xfbd9('0x2c')](_0x31670b['getOpenchannelQueues']({'attributes':['id',_0xfbd9('0x2')]}));break;}return BPromise[_0xfbd9('0x3d')](_0x1ff650);}})[_0xfbd9('0x8')](function(_0x1f4e96){if(_0x1f4e96&&_0x1f4e96[_0xfbd9('0x19')]){for(var _0x4a51a8=0x0;_0x4a51a8<_0x1f4e96[_0xfbd9('0x19')];_0x4a51a8+=0x1){for(var _0x2e1f3b=0x0;_0x2e1f3b<_0x1f4e96[_0x4a51a8][_0xfbd9('0x19')];_0x2e1f3b+=0x1){switch(_0x4a51a8){case 0x0:joinOrLeaveQueues(_0x3bc70a,_0x1905d1,_0xfbd9('0x3e'),_0x1f4e96[_0x4a51a8][_0x2e1f3b]);break;case 0x1:joinOrLeaveQueues(_0x3bc70a,_0x1905d1,_0xfbd9('0x3f'),_0x1f4e96[_0x4a51a8][_0x2e1f3b]);break;case 0x2:joinOrLeaveQueues(_0x3bc70a,_0x1905d1,'fax',_0x1f4e96[_0x4a51a8][_0x2e1f3b]);break;case 0x3:joinOrLeaveQueues(_0x3bc70a,_0x1905d1,_0xfbd9('0x40'),_0x1f4e96[_0x4a51a8][_0x2e1f3b]);break;case 0x4:joinOrLeaveQueues(_0x3bc70a,_0x1905d1,_0xfbd9('0x41'),_0x1f4e96[_0x4a51a8][_0x2e1f3b]);break;case 0x5:joinOrLeaveQueues(_0x3bc70a,_0x1905d1,_0xfbd9('0x42'),_0x1f4e96[_0x4a51a8][_0x2e1f3b]);break;case 0x6:_0x3bc70a[_0x1905d1](util[_0xfbd9('0x16')](_0xfbd9('0x43'),_0x1f4e96[_0x4a51a8][_0x2e1f3b][_0xfbd9('0x2')]));break;case 0x7:_0x3bc70a[_0x1905d1](util[_0xfbd9('0x16')](_0xfbd9('0x44'),_0x1f4e96[_0x4a51a8][_0x2e1f3b][_0xfbd9('0x2')]));break;case 0x8:_0x3bc70a[_0x1905d1](util[_0xfbd9('0x16')]('campaign:%s:%s',_0x1f4e96[_0x4a51a8][_0x2e1f3b][_0xfbd9('0x6')],_0x1f4e96[_0x4a51a8][_0x2e1f3b][_0xfbd9('0x2')]));break;case 0x9:_0x3bc70a[_0x1905d1](util[_0xfbd9('0x16')]('user:%s',_0x1f4e96[_0x4a51a8][_0x2e1f3b][_0xfbd9('0x2')]));break;}}}}})[_0xfbd9('0x8')](function(){if(_0x1905d1===_0xfbd9('0x45')){var _0x351f88=_[_0xfbd9('0x12')](_0x4ae481[_0xfbd9('0x21')],'id');return _0x4ae481[_0xfbd9('0x46')](_0x351f88)[_0xfbd9('0x8')](function(){for(var _0x562b8d=0x0;_0x562b8d<_0x351f88[_0xfbd9('0x19')];_0x562b8d+=0x1){_0xf44bda[_0xfbd9('0x47')](_0xfbd9('0x48'),{'ChatInteractionId':Number(_0x351f88[_0x562b8d]),'UserId':Number(_0x4ae481['id'])});}});}})[_0xfbd9('0x8')](function(){if(_0x1905d1==='leave'){var _0x162cb8=_[_0xfbd9('0x12')](_0x4ae481[_0xfbd9('0x22')],'id');return _0x4ae481['removeMailInteractions'](_0x162cb8)[_0xfbd9('0x8')](function(){for(var _0x2908f5=0x0;_0x2908f5<_0x162cb8[_0xfbd9('0x19')];_0x2908f5+=0x1){_0xf44bda[_0xfbd9('0x47')](_0xfbd9('0x49'),{'MailInteractionId':Number(_0x162cb8[_0x2908f5]),'UserId':Number(_0x4ae481['id'])});}});}})[_0xfbd9('0x8')](function(){if(_0x1905d1==='leave'){var _0x533849=_[_0xfbd9('0x12')](_0x4ae481[_0xfbd9('0x24')],'id');return _0x4ae481['removeFaxInteractions'](_0x533849)[_0xfbd9('0x8')](function(){for(var _0x267e41=0x0;_0x267e41<_0x533849['length'];_0x267e41+=0x1){_0xf44bda[_0xfbd9('0x47')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x533849[_0x267e41]),'UserId':Number(_0x4ae481['id'])});}});}})[_0xfbd9('0x8')](function(){if(_0x1905d1===_0xfbd9('0x45')){var _0x4c13d4=_[_0xfbd9('0x12')](_0x4ae481[_0xfbd9('0x26')],'id');return _0x4ae481[_0xfbd9('0x4a')](_0x4c13d4)[_0xfbd9('0x8')](function(){for(var _0x5a3a05=0x0;_0x5a3a05<_0x4c13d4[_0xfbd9('0x19')];_0x5a3a05+=0x1){_0xf44bda[_0xfbd9('0x47')](_0xfbd9('0x4b'),{'SmsInteractionId':Number(_0x4c13d4[_0x5a3a05]),'UserId':Number(_0x4ae481['id'])});}});}})[_0xfbd9('0x8')](function(){if(_0x1905d1==='leave'){var _0x2342c9=_['map'](_0x4ae481[_0xfbd9('0x28')],'id');return _0x4ae481[_0xfbd9('0x4c')](_0x2342c9)[_0xfbd9('0x8')](function(){for(var _0x39829f=0x0;_0x39829f<_0x2342c9['length'];_0x39829f+=0x1){_0xf44bda[_0xfbd9('0x47')](_0xfbd9('0x4d'),{'OpenchannelInteractionId':Number(_0x2342c9[_0x39829f]),'UserId':Number(_0x4ae481['id'])});}});}})[_0xfbd9('0x4e')](function(_0x472d49){_0x3bc70a[_0xfbd9('0x4f')](_0x472d49);});}}function onDisconnect(_0x13bf2b,_0x2d9446){joinOrLeave(_0x13bf2b,_0xfbd9('0x45'),_0x2d9446);}function onConnect(_0x59b77d){joinOrLeave(_0x59b77d,_0xfbd9('0x50'));}exports[_0xfbd9('0x51')]=function(_0x3a6cf0){_0x3a6cf0['on'](_0xfbd9('0x52'),function(_0x51e334){_0x51e334[_0xfbd9('0x53')](0x0);_0x51e334[_0xfbd9('0x54')]=_0x51e334[_0xfbd9('0x55')][_0xfbd9('0x52')][_0xfbd9('0x56')]+':'+_0x51e334[_0xfbd9('0x55')]['connection'][_0xfbd9('0x57')];_0x51e334[_0xfbd9('0x58')]=new Date();_0x51e334[_0xfbd9('0x4f')]=function(_0xe731fa){console[_0xfbd9('0x4f')](_0xfbd9('0x59')+_0x51e334[_0xfbd9('0x5a')][_0xfbd9('0x2')]+'['+_0x51e334['address']+']',_0xe731fa);};_0x51e334['on'](_0xfbd9('0x5b'),function(){onDisconnect(_0x51e334,_0x3a6cf0);_0x51e334['log'](_0xfbd9('0x5c'));});onConnect(_0x51e334);_0x51e334[_0xfbd9('0x4f')](_0xfbd9('0x5d'));});}; \ No newline at end of file +var _0x4aaa=['removeOpenchannelInteractions','user_has_openchannel_interactions:remove','default','connection','setMaxListeners','address','remoteAddress','request','remotePort','connectedAt','log','SocketIO\x20','nsp','disconnect','DISCONNECTED','lodash','util','bluebird','../mysqldb','./environment','name','Agents','User','agent','telephone','type','ivr','UserProfileSection','findOne','then','VoiceQueues','ChatQueues','MailQueues','OpenchannelQueues','findAll','Trunks','IvrCampaigns','UserProfileResource','resourceId','map','where','role','format','%s:queue:%s','length','user:%s','handshake','query','find','userProfileId','ChatInteraction','ChatInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','SmsQueue','MailQueue','OpenchannelQueue','Trunk','user','FaxQueue','SmsQueues','Telephones','getVoiceQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','all','chat','sms','mail','openchannel','telephone:%s','trunk:%s','campaign:%s:%s','leave','emit','MailInteractions','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove'];(function(_0x214666,_0xa58f19){var _0xbe195e=function(_0x32f7fe){while(--_0x32f7fe){_0x214666['push'](_0x214666['shift']());}};_0xbe195e(++_0xa58f19);}(_0x4aaa,0x6c));var _0xa4aa=function(_0x49c2f1,_0x257043){_0x49c2f1=_0x49c2f1-0x0;var _0x936421=_0x4aaa[_0x49c2f1];return _0x936421;};'use strict';var _=require(_0xa4aa('0x0'));var util=require(_0xa4aa('0x1'));var BPromise=require(_0xa4aa('0x2'));var db=require(_0xa4aa('0x3'))['db'];var config=require(_0xa4aa('0x4'));var queryQueues={'attributes':['id',_0xa4aa('0x5')],'include':[{'as':_0xa4aa('0x6'),'model':db[_0xa4aa('0x7')],'attributes':['id',_0xa4aa('0x5'),'role'],'raw':!![],'where':{'role':_0xa4aa('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xa4aa('0x5')],'where':{'role':_0xa4aa('0x9')}};var queryTrunks={'raw':!![],'attributes':['id',_0xa4aa('0x5')]};var queryAgents={'raw':!![],'attributes':['id',_0xa4aa('0x5')],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id','name',_0xa4aa('0xa')],'where':{'type':_0xa4aa('0xb')}};function getAssociatedResources(_0x210f51,_0x5c0da4,_0xe7527b){return db[_0xa4aa('0xc')][_0xa4aa('0xd')]({'where':{'name':_0x210f51,'userProfileId':_0x5c0da4},'raw':!![]})[_0xa4aa('0xe')](function(_0x4eab38){if(_0x4eab38){if(_0x4eab38['autoAssociation']){switch(_0x210f51){case _0xa4aa('0xf'):case _0xa4aa('0x10'):case'FaxQueues':case'SmsQueues':case _0xa4aa('0x11'):case _0xa4aa('0x12'):return db[_0xe7527b][_0xa4aa('0x13')](queryQueues);case'Telephones':return db[_0xe7527b][_0xa4aa('0x13')](queryTelephones);case _0xa4aa('0x14'):return db[_0xe7527b][_0xa4aa('0x13')](queryTrunks);case _0xa4aa('0x15'):return db[_0xe7527b][_0xa4aa('0x13')](queryCampaigns);}}else{return db[_0xa4aa('0x16')][_0xa4aa('0x13')]({'attributes':[_0xa4aa('0x17')],'where':{'sectionId':_0x4eab38['id']},'raw':!![]})[_0xa4aa('0xe')](function(_0x4c5827){if(_0x4c5827){var _0x23bd3c={'where':{'id':_[_0xa4aa('0x18')](_0x4c5827,_0xa4aa('0x17'))},'raw':!![]};switch(_0xe7527b){case _0xa4aa('0x7'):_0x23bd3c[_0xa4aa('0x19')][_0xa4aa('0x1a')]=_0xa4aa('0x9');break;case'Campaign':_0x23bd3c[_0xa4aa('0x19')][_0xa4aa('0xa')]='ivr';break;}return db[_0xe7527b][_0xa4aa('0x13')](_0x23bd3c);}else{return[];}});}}else{return[];}})['then'](function(_0x58ba9a){return _0x58ba9a;});}function joinOrLeaveQueues(_0x118e83,_0x408647,_0x5e651a,_0x5529bc){_0x118e83[_0x408647](util[_0xa4aa('0x1b')](_0xa4aa('0x1c'),_0x5e651a,_0x5529bc[_0xa4aa('0x5')]));if(_0x5529bc[_0xa4aa('0x6')]){for(var _0x3e73cb=0x0;_0x3e73cb<_0x5529bc['Agents'][_0xa4aa('0x1d')];_0x3e73cb+=0x1){_0x118e83[_0x408647](util[_0xa4aa('0x1b')](_0xa4aa('0x1e'),_0x5529bc[_0xa4aa('0x6')][_0x3e73cb][_0xa4aa('0x5')]));}}}function joinOrLeave(_0x3ea3ad,_0x1d27ac,_0x41e7d0){var _0x46ecbd;if(_0x3ea3ad[_0xa4aa('0x1f')][_0xa4aa('0x20')]['id']){db[_0xa4aa('0x7')][_0xa4aa('0x21')]({'attributes':['id',_0xa4aa('0x5'),_0xa4aa('0x1a'),_0xa4aa('0x22')],'where':{'id':_0x3ea3ad['handshake'][_0xa4aa('0x20')]['id']},'include':[{'model':db[_0xa4aa('0x23')],'as':_0xa4aa('0x24'),'attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xa4aa('0x25')],'as':_0xa4aa('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0xa4aa('0x27')],'as':_0xa4aa('0x28'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0xa4aa('0x29'),'attributes':['id'],'raw':!![]}]})[_0xa4aa('0xe')](function(_0x469d2c){if(_0x469d2c){_0x46ecbd=_0x469d2c;_0x3ea3ad[_0x1d27ac](util[_0xa4aa('0x1b')](_0xa4aa('0x1e'),_0x469d2c[_0xa4aa('0x5')]));var _0x52e622=[];switch(_0x469d2c[_0xa4aa('0x1a')]){case _0xa4aa('0x2a'):_0x3ea3ad[_0x1d27ac](_0xa4aa('0x2b'));_0x3ea3ad[_0x1d27ac](_0xa4aa('0x2c'));if(queryQueues[_0xa4aa('0x2d')](_0xa4aa('0x2e'))){delete queryQueues['include'];}_0x52e622[_0xa4aa('0x2f')](db[_0xa4aa('0x30')][_0xa4aa('0x13')](queryQueues));_0x52e622['push'](db[_0xa4aa('0x31')][_0xa4aa('0x13')](queryQueues));_0x52e622['push'](db['FaxQueue'][_0xa4aa('0x13')](queryQueues));_0x52e622[_0xa4aa('0x2f')](db[_0xa4aa('0x32')][_0xa4aa('0x13')](queryQueues));_0x52e622[_0xa4aa('0x2f')](db[_0xa4aa('0x33')][_0xa4aa('0x13')](queryQueues));_0x52e622[_0xa4aa('0x2f')](db[_0xa4aa('0x34')]['findAll'](queryQueues));_0x52e622[_0xa4aa('0x2f')](db[_0xa4aa('0x7')]['findAll'](queryTelephones));_0x52e622[_0xa4aa('0x2f')](db[_0xa4aa('0x35')][_0xa4aa('0x13')](queryTrunks));_0x52e622[_0xa4aa('0x2f')](db['Campaign'][_0xa4aa('0x13')](queryCampaigns));_0x52e622[_0xa4aa('0x2f')](db[_0xa4aa('0x7')][_0xa4aa('0x13')](queryAgents));break;case _0xa4aa('0x36'):_0x3ea3ad[_0x1d27ac](_0xa4aa('0x2b'));_0x3ea3ad[_0x1d27ac](_0xa4aa('0x2c'));_0x52e622[_0xa4aa('0x2f')](getAssociatedResources('VoiceQueues',_0x469d2c[_0xa4aa('0x22')],'VoiceQueue'));_0x52e622[_0xa4aa('0x2f')](getAssociatedResources(_0xa4aa('0x10'),_0x469d2c[_0xa4aa('0x22')],_0xa4aa('0x31')));_0x52e622[_0xa4aa('0x2f')](getAssociatedResources('FaxQueues',_0x469d2c[_0xa4aa('0x22')],_0xa4aa('0x37')));_0x52e622['push'](getAssociatedResources(_0xa4aa('0x38'),_0x469d2c[_0xa4aa('0x22')],_0xa4aa('0x32')));_0x52e622[_0xa4aa('0x2f')](getAssociatedResources(_0xa4aa('0x11'),_0x469d2c[_0xa4aa('0x22')],'MailQueue'));_0x52e622[_0xa4aa('0x2f')](getAssociatedResources(_0xa4aa('0x12'),_0x469d2c[_0xa4aa('0x22')],_0xa4aa('0x34')));_0x52e622[_0xa4aa('0x2f')](getAssociatedResources(_0xa4aa('0x39'),_0x469d2c[_0xa4aa('0x22')],_0xa4aa('0x7')));_0x52e622[_0xa4aa('0x2f')](getAssociatedResources(_0xa4aa('0x14'),_0x469d2c[_0xa4aa('0x22')],_0xa4aa('0x35')));_0x52e622[_0xa4aa('0x2f')](getAssociatedResources('IvrCampaigns',_0x469d2c[_0xa4aa('0x22')],'Campaign'));_0x52e622[_0xa4aa('0x2f')](db['User'][_0xa4aa('0x13')](queryAgents));break;case _0xa4aa('0x8'):_0x3ea3ad[_0x1d27ac](_0xa4aa('0x2b'));_0x3ea3ad[_0x1d27ac](_0xa4aa('0x2c'));_0x52e622[_0xa4aa('0x2f')](_0x469d2c[_0xa4aa('0x3a')]({'attributes':['id','name']}));_0x52e622[_0xa4aa('0x2f')](_0x469d2c['getChatQueues']({'attributes':['id','name']}));_0x52e622[_0xa4aa('0x2f')](_0x469d2c[_0xa4aa('0x3b')]({'attributes':['id',_0xa4aa('0x5')]}));_0x52e622[_0xa4aa('0x2f')](_0x469d2c[_0xa4aa('0x3c')]({'attributes':['id',_0xa4aa('0x5')]}));_0x52e622['push'](_0x469d2c[_0xa4aa('0x3d')]({'attributes':['id',_0xa4aa('0x5')]}));_0x52e622['push'](_0x469d2c[_0xa4aa('0x3e')]({'attributes':['id','name']}));break;}return BPromise[_0xa4aa('0x3f')](_0x52e622);}})[_0xa4aa('0xe')](function(_0x285f70){if(_0x285f70&&_0x285f70['length']){for(var _0x7f4359=0x0;_0x7f4359<_0x285f70[_0xa4aa('0x1d')];_0x7f4359+=0x1){for(var _0x5469=0x0;_0x5469<_0x285f70[_0x7f4359][_0xa4aa('0x1d')];_0x5469+=0x1){switch(_0x7f4359){case 0x0:joinOrLeaveQueues(_0x3ea3ad,_0x1d27ac,'voice',_0x285f70[_0x7f4359][_0x5469]);break;case 0x1:joinOrLeaveQueues(_0x3ea3ad,_0x1d27ac,_0xa4aa('0x40'),_0x285f70[_0x7f4359][_0x5469]);break;case 0x2:joinOrLeaveQueues(_0x3ea3ad,_0x1d27ac,'fax',_0x285f70[_0x7f4359][_0x5469]);break;case 0x3:joinOrLeaveQueues(_0x3ea3ad,_0x1d27ac,_0xa4aa('0x41'),_0x285f70[_0x7f4359][_0x5469]);break;case 0x4:joinOrLeaveQueues(_0x3ea3ad,_0x1d27ac,_0xa4aa('0x42'),_0x285f70[_0x7f4359][_0x5469]);break;case 0x5:joinOrLeaveQueues(_0x3ea3ad,_0x1d27ac,_0xa4aa('0x43'),_0x285f70[_0x7f4359][_0x5469]);break;case 0x6:_0x3ea3ad[_0x1d27ac](util['format'](_0xa4aa('0x44'),_0x285f70[_0x7f4359][_0x5469][_0xa4aa('0x5')]));break;case 0x7:_0x3ea3ad[_0x1d27ac](util[_0xa4aa('0x1b')](_0xa4aa('0x45'),_0x285f70[_0x7f4359][_0x5469][_0xa4aa('0x5')]));break;case 0x8:_0x3ea3ad[_0x1d27ac](util['format'](_0xa4aa('0x46'),_0x285f70[_0x7f4359][_0x5469][_0xa4aa('0xa')],_0x285f70[_0x7f4359][_0x5469][_0xa4aa('0x5')]));break;case 0x9:_0x3ea3ad[_0x1d27ac](util[_0xa4aa('0x1b')]('user:%s',_0x285f70[_0x7f4359][_0x5469][_0xa4aa('0x5')]));break;}}}}})['then'](function(){if(_0x1d27ac===_0xa4aa('0x47')){var _0x587fc5=_[_0xa4aa('0x18')](_0x46ecbd[_0xa4aa('0x24')],'id');return _0x46ecbd['removeChatInteractions'](_0x587fc5)['then'](function(){for(var _0x5ea914=0x0;_0x5ea914<_0x587fc5[_0xa4aa('0x1d')];_0x5ea914+=0x1){_0x41e7d0[_0xa4aa('0x48')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x587fc5[_0x5ea914]),'UserId':Number(_0x46ecbd['id'])});}});}})[_0xa4aa('0xe')](function(){if(_0x1d27ac==='leave'){var _0x45a55d=_[_0xa4aa('0x18')](_0x46ecbd[_0xa4aa('0x49')],'id');return _0x46ecbd[_0xa4aa('0x4a')](_0x45a55d)['then'](function(){for(var _0x433d0d=0x0;_0x433d0d<_0x45a55d[_0xa4aa('0x1d')];_0x433d0d+=0x1){_0x41e7d0['emit'](_0xa4aa('0x4b'),{'MailInteractionId':Number(_0x45a55d[_0x433d0d]),'UserId':Number(_0x46ecbd['id'])});}});}})[_0xa4aa('0xe')](function(){if(_0x1d27ac===_0xa4aa('0x47')){var _0x312c65=_[_0xa4aa('0x18')](_0x46ecbd[_0xa4aa('0x26')],'id');return _0x46ecbd[_0xa4aa('0x4c')](_0x312c65)[_0xa4aa('0xe')](function(){for(var _0x1312be=0x0;_0x1312be<_0x312c65[_0xa4aa('0x1d')];_0x1312be+=0x1){_0x41e7d0['emit'](_0xa4aa('0x4d'),{'FaxInteractionId':Number(_0x312c65[_0x1312be]),'UserId':Number(_0x46ecbd['id'])});}});}})[_0xa4aa('0xe')](function(){if(_0x1d27ac===_0xa4aa('0x47')){var _0x49fe6f=_[_0xa4aa('0x18')](_0x46ecbd[_0xa4aa('0x28')],'id');return _0x46ecbd['removeSmsInteractions'](_0x49fe6f)['then'](function(){for(var _0x5d77fb=0x0;_0x5d77fb<_0x49fe6f['length'];_0x5d77fb+=0x1){_0x41e7d0[_0xa4aa('0x48')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x49fe6f[_0x5d77fb]),'UserId':Number(_0x46ecbd['id'])});}});}})[_0xa4aa('0xe')](function(){if(_0x1d27ac==='leave'){var _0x3c38ca=_[_0xa4aa('0x18')](_0x46ecbd[_0xa4aa('0x29')],'id');return _0x46ecbd[_0xa4aa('0x4e')](_0x3c38ca)[_0xa4aa('0xe')](function(){for(var _0x35e79b=0x0;_0x35e79b<_0x3c38ca[_0xa4aa('0x1d')];_0x35e79b+=0x1){_0x41e7d0[_0xa4aa('0x48')](_0xa4aa('0x4f'),{'OpenchannelInteractionId':Number(_0x3c38ca[_0x35e79b]),'UserId':Number(_0x46ecbd['id'])});}});}})['catch'](function(_0x1745e6){_0x3ea3ad['log'](_0x1745e6);});}}function onDisconnect(_0x57259c,_0x45b314){joinOrLeave(_0x57259c,_0xa4aa('0x47'),_0x45b314);}function onConnect(_0x3660c5){joinOrLeave(_0x3660c5,'join');}exports[_0xa4aa('0x50')]=function(_0x21016e){_0x21016e['on'](_0xa4aa('0x51'),function(_0x5ed307){_0x5ed307[_0xa4aa('0x52')](0x0);_0x5ed307[_0xa4aa('0x53')]=_0x5ed307['request']['connection'][_0xa4aa('0x54')]+':'+_0x5ed307[_0xa4aa('0x55')]['connection'][_0xa4aa('0x56')];_0x5ed307[_0xa4aa('0x57')]=new Date();_0x5ed307['log']=function(_0x521d51){console[_0xa4aa('0x58')](_0xa4aa('0x59')+_0x5ed307[_0xa4aa('0x5a')][_0xa4aa('0x5')]+'['+_0x5ed307['address']+']',_0x521d51);};_0x5ed307['on'](_0xa4aa('0x5b'),function(){onDisconnect(_0x5ed307,_0x21016e);_0x5ed307[_0xa4aa('0x58')](_0xa4aa('0x5c'));});onConnect(_0x5ed307);_0x5ed307[_0xa4aa('0x58')]('CONNECTED');});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 81f826c..df781b1 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 _0x10fa=['toLowerCase','condition','util','../../mysqldb','jayson/promise','../logger','client','http','Chat','afterCreate','newinteraction','ChatInteraction','afterUpdate','newmessage','Sms','SmsInteraction','SmsMessage','Fax','FaxInteraction','FaxMessage','Mail','closedinteraction','Openchannel','OpenchannelInteraction','OpenchannelMessage','EventManager','Trigger,\x20%s','error','code','catch','event','UserId','User','find','name','then','interface','format','channel','outgoingmessage','get','opened','closed','SIP/%s','length','model'];(function(_0x205012,_0x22efba){var _0x375a5f=function(_0x42f591){while(--_0x42f591){_0x205012['push'](_0x205012['shift']());}};_0x375a5f(++_0x22efba);}(_0x10fa,0x144));var _0xa10f=function(_0x4ff1fc,_0x45f7e3){_0x4ff1fc=_0x4ff1fc-0x0;var _0x145ad0=_0x10fa[_0x4ff1fc];return _0x145ad0;};'use strict';var util=require(_0xa10f('0x0'));var db=require(_0xa10f('0x1'))['db'];var jayson=require(_0xa10f('0x2'));var logger=require(_0xa10f('0x3'))('triggers');var client=jayson[_0xa10f('0x4')][_0xa10f('0x5')]({'port':0x232a});var triggers=[{'channel':_0xa10f('0x6'),'model':'ChatInteraction','event':_0xa10f('0x7'),'condition':_0xa10f('0x8'),'callback':afterCreate},{'channel':_0xa10f('0x6'),'model':_0xa10f('0x9'),'event':_0xa10f('0xa'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xa10f('0x6'),'model':'ChatMessage','event':'afterCreate','condition':_0xa10f('0xb'),'callback':afterCreateMessage},{'channel':_0xa10f('0xc'),'model':'SmsInteraction','event':_0xa10f('0x7'),'condition':_0xa10f('0x8'),'callback':afterCreate},{'channel':_0xa10f('0xc'),'model':_0xa10f('0xd'),'event':_0xa10f('0xa'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xa10f('0xc'),'model':_0xa10f('0xe'),'event':_0xa10f('0x7'),'condition':_0xa10f('0xb'),'callback':afterCreateMessage},{'channel':_0xa10f('0xf'),'model':_0xa10f('0x10'),'event':_0xa10f('0x7'),'condition':'newinteraction','callback':afterCreate},{'channel':'Fax','model':_0xa10f('0x10'),'event':_0xa10f('0xa'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xa10f('0xf'),'model':_0xa10f('0x11'),'event':_0xa10f('0x7'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0xa10f('0x12'),'model':'MailInteraction','event':'afterCreate','condition':_0xa10f('0x8'),'callback':afterCreate},{'channel':'Mail','model':'MailInteraction','event':_0xa10f('0xa'),'condition':_0xa10f('0x13'),'callback':afterUpdate},{'channel':_0xa10f('0x12'),'model':'MailMessage','event':_0xa10f('0x7'),'condition':_0xa10f('0xb'),'callback':afterCreateMessage},{'channel':_0xa10f('0x14'),'model':_0xa10f('0x15'),'event':_0xa10f('0x7'),'condition':'newinteraction','callback':afterCreate},{'channel':_0xa10f('0x14'),'model':_0xa10f('0x15'),'event':_0xa10f('0xa'),'condition':_0xa10f('0x13'),'callback':afterUpdate},{'channel':_0xa10f('0x14'),'model':_0xa10f('0x16'),'event':_0xa10f('0x7'),'condition':_0xa10f('0xb'),'callback':afterCreateMessage}];function request(_0x444018){return client['request'](_0xa10f('0x17'),_0x444018)['then'](function(_0x160d92){logger['info'](_0xa10f('0x18'),'EventManager',_0x160d92);if(_0x160d92['error']){if(_0x160d92[_0xa10f('0x19')][_0xa10f('0x1a')]===0x1f4){logger['error']('Trigger,\x20%s',_0xa10f('0x17'),_0x160d92[_0xa10f('0x19')]);}}})[_0xa10f('0x1b')](function(_0x5e7534){logger[_0xa10f('0x19')](_0xa10f('0x18'),_0xa10f('0x17'),_0x5e7534);});}function afterCreateMessage(_0x435649,_0x2f86cb){return function(_0x54314e,_0x4fd545){_0x54314e=_0x54314e['get']({'plain':!![]});_0x54314e['channel']=_0x435649;_0x54314e[_0xa10f('0x1c')]=_0x54314e['direction'];if(_0x54314e[_0xa10f('0x1d')]){return db[_0xa10f('0x1e')][_0xa10f('0x1f')]({'where':{'id':_0x54314e[_0xa10f('0x1d')]},'attributes':['id',_0xa10f('0x20')],'raw':!![]})[_0xa10f('0x21')](function(_0x425093){_0x54314e[_0xa10f('0x22')]=util[_0xa10f('0x23')]('SIP/%s',_0x425093[_0xa10f('0x20')]);_0x54314e[_0xa10f('0x24')]=_0x435649;return request({'event':'incomingmessage','message':_0x54314e});})[_0xa10f('0x1b')](function(_0x4d51e7){console[_0xa10f('0x19')](_0x4d51e7);});}else{return request({'event':_0xa10f('0x25'),'message':_0x54314e});}};}function afterCreate(_0x1f096a,_0x5addcf){return function(_0x1844f1,_0x2f5805){_0x1844f1=_0x1844f1[_0xa10f('0x26')]({'plain':!![]});_0x1844f1[_0xa10f('0x24')]=_0x1f096a;_0x1844f1[_0xa10f('0x1c')]=_0xa10f('0x27');return request({'event':_0x5addcf,'message':_0x1844f1});};}function afterUpdate(_0x104817,_0x5f49a4){return function(_0x42b646,_0x33e19d){if(_0x42b646['changed'](_0xa10f('0x28'))&&_0x42b646[_0xa10f('0x28')]){_0x42b646=_0x42b646[_0xa10f('0x26')]({'plain':!![]});_0x42b646[_0xa10f('0x24')]=_0x104817;_0x42b646[_0xa10f('0x1c')]=_0xa10f('0x28');if(_0x42b646['UserId']){return db[_0xa10f('0x1e')]['find']({'where':{'id':_0x42b646[_0xa10f('0x1d')]},'attributes':['id',_0xa10f('0x20')],'raw':!![]})[_0xa10f('0x21')](function(_0x43619f){_0x42b646[_0xa10f('0x22')]=util[_0xa10f('0x23')](_0xa10f('0x29'),_0x43619f['name']);return request({'event':_0x5f49a4,'message':_0x42b646});})[_0xa10f('0x1b')](function(_0x20a93f){console[_0xa10f('0x19')](_0x20a93f);});}else{return request({'event':_0x5f49a4,'message':_0x42b646});}}};}exports['default']=function(){for(var _0x2ea762=0x0;_0x2ea762=_0x51fd76[_0x9831('0x14')]){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x1fe155(_0x3a4422);})[_0x9831('0x15')](function(_0x334284){_0x5464fc(_0x334284);});});}; \ No newline at end of file +var _0x7cc1=['getLicense','role','agent','User','count','then','agents','Maximum\x20login\x20has\x20been\x20reached','bluebird','../mysqldb','./license/util','voice','mail','chat','fax','sms','openchannel','includes','clearBlockUser','isUndefined','blockedAt','updateAttributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7cc1,0x110));var _0x17cc=function(_0x33d9ec,_0x101bee){_0x33d9ec=_0x33d9ec-0x0;var _0x3476e6=_0x7cc1[_0x33d9ec];return _0x3476e6;};'use strict';var _=require('lodash');var BPromise=require(_0x17cc('0x0'));var db=require(_0x17cc('0x1'))['db'];var util=require(_0x17cc('0x2'));var channels=[_0x17cc('0x3'),_0x17cc('0x4'),_0x17cc('0x5'),_0x17cc('0x6'),_0x17cc('0x7'),_0x17cc('0x8')];exports['getChannels']=function(){return channels;};exports['isValidChannel']=function(_0x3f3541){_0x3f3541=_0x3f3541['toLowerCase']();return _[_0x17cc('0x9')](channels,_0x3f3541);};exports[_0x17cc('0xa')]=function(_0x30de90,_0x5d69f2,_0xd4ba0a,_0x516873){var _0x4dc4e5={'loginAttempts':_0x5d69f2,'blocked':_0xd4ba0a};if(!_[_0x17cc('0xb')](_0x516873)){_0x4dc4e5[_0x17cc('0xc')]=_0x516873;}return _0x30de90[_0x17cc('0xd')](_0x4dc4e5);};exports[_0x17cc('0xe')]=function(_0x96250d){return new BPromise(function(_0x39f770,_0x81a98){var _0x4d2ae7=0x0;if(_0x96250d[_0x17cc('0xf')]!==_0x17cc('0x10')){_0x39f770(_0x96250d);}db[_0x17cc('0x11')][_0x17cc('0x12')]({'where':{'role':_0x17cc('0x10'),'online':!![],'id':{'$ne':_0x96250d['id']}}})[_0x17cc('0x13')](function(_0x4415c5){_0x4d2ae7=_0x4415c5;return util['getLicense']();})[_0x17cc('0x13')](function(_0x382b18){if(_0x382b18&&_0x382b18[_0x17cc('0x14')]&&_0x4d2ae7>=_0x382b18[_0x17cc('0x14')]){throw Error(_0x17cc('0x15'));}_0x39f770(_0x96250d);})['catch'](function(_0x541f5a){_0x81a98(_0x541f5a);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index d6711b2..90aeecd 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x60f8=['render','json','send','404','status'];(function(_0x184268,_0x5572bd){var _0x2e6086=function(_0x3c62f9){while(--_0x3c62f9){_0x184268['push'](_0x184268['shift']());}};_0x2e6086(++_0x5572bd);}(_0x60f8,0x148));var _0x860f=function(_0x48b2cb,_0x5da5e7){_0x48b2cb=_0x48b2cb-0x0;var _0x3ad90f=_0x60f8[_0x48b2cb];return _0x3ad90f;};'use strict';module['exports'][0x194]=function pageNotFound(_0x34a06c,_0xda1832){var _0x17a9b8=_0x860f('0x0');var _0x18d19f=0x194;var _0x103920={'status':_0x18d19f};_0xda1832[_0x860f('0x1')](_0x103920[_0x860f('0x1')]);_0xda1832[_0x860f('0x2')](_0x17a9b8,{},function(_0x41d0bb,_0xe202f6){if(_0x41d0bb){return _0xda1832[_0x860f('0x1')](_0x103920['status'])[_0x860f('0x3')](_0x103920);}_0xda1832[_0x860f('0x4')](_0xe202f6);});}; \ No newline at end of file +var _0x4749=['404','status','render','json','send','exports'];(function(_0x2406b4,_0x2f9771){var _0x7f3752=function(_0x583971){while(--_0x583971){_0x2406b4['push'](_0x2406b4['shift']());}};_0x7f3752(++_0x2f9771);}(_0x4749,0x1c7));var _0x9474=function(_0xb5203d,_0x237622){_0xb5203d=_0xb5203d-0x0;var _0x5e4ea7=_0x4749[_0xb5203d];return _0x5e4ea7;};'use strict';module[_0x9474('0x0')][0x194]=function pageNotFound(_0x520acd,_0x2130ea){var _0x40fb66=_0x9474('0x1');var _0x391d2a=0x194;var _0x53438f={'status':_0x391d2a};_0x2130ea[_0x9474('0x2')](_0x53438f[_0x9474('0x2')]);_0x2130ea[_0x9474('0x3')](_0x40fb66,{},function(_0x50bcc2,_0x2f2140){if(_0x50bcc2){return _0x2130ea[_0x9474('0x2')](_0x53438f[_0x9474('0x2')])[_0x9474('0x4')](_0x53438f);}_0x2130ea[_0x9474('0x5')](_0x2f2140);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 027d655..d7665d2 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0eff=['ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','hasOne','VoiceMail','hasMany','Recordings','UserId','VoiceQueuesRt','cascade','HopperFinals','HopperHistory','OpenchannelInteraction','OpenchannelInteractions','ChatInteractions','SmsInteraction','SmsInteractions','FaxInteractions','MailInteractions','belongsToMany','Contacts','cm_user_has_contacts','CmList','Lists','user_has_teams','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','VoiceQueues','MailQueues','ChatQueues','FaxQueue','FaxQueues','cm_user_has_lists','VoicePrefixes','user_has_voice_prefixes','ChatWebsites','user_has_chat_websites','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccount','user_has_openchannel_accounts','SmsAccounts','SquareProjects','user_has_square_projects','VoiceChanSpy','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperHistories','CmHopperBlack','HopperBlacks','belongsTo','Trunk','TrunkId','TrunkBackup','Interval','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Teams','team_has_voice_queues','BlackLists','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','QueueCalls','uniqueid','VoiceAgentReport','Contact','ContactId','MailServerIn','MailAccountId','Imap','Smtp','Dispositions','Answers','Interactions','ListId','TemplateId','team_has_mail_queues','MailInteractionId','Owner','Tag','mail_interaction_has_tags','ThroughTags','Users','user_has_mail_interactions','MailMessage','Attachments','Interaction','MailApplication','restrict','TagId','List','Items','FaxAccountId','Account','Tags','fax_interaction_has_tags','FaxInteractionId','SmsAccountId','user_has_sms_accounts','SmsInteractionId','sms_interaction_has_tags','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','user_has_openchannel_interactions','AttachmentId','team_has_openchannel_queues','ChatWebsiteId','ProactiveActions','OpenchannelQueueReport','Agent','Queue','ChatMessage','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','chat_group_has_users','ChatProactiveAction','Website','CompanyId','JscriptySessions','Company','cm_contact_has_tags','Campaign','CampaignId','Automation','All','OneAll','AutomationAllId','Any','OneAny','AutomationAnyId','Actions','AutomationId','Extensions','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','Mohs','Trigger','AllConditions','AllCondition','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','Fields','MetricId','Configurations','Subjects','SubjectId','Descriptions','DescriptionId','FieldId','AccountId','Subject','Description','Field','VariableId','DeskAccount','DeskConfiguration','int_desk_configuration_has_tags','ZohoAccount','ZohoConfiguration','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','VtigerField','Dynamics365Account','FreshsalesAccount','FreshsalesConfiguration','FreshsalesField','FromId','ToId','SessionId','ProjectId','team_has_fax_queues','SmsQueues','OpenchannelQueues','TrunkBackupId','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToUserId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToAccount','FromOpenchannelAccountId','ToAgent','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsAccountId','CustomFields','Queues','userProfileId','UserProfileSection','UserProfileSections','Resources','sectionId','exports','path','../config/environment','jstz','determine','sequelize','defaultsDeep','xcall','xC@LL1234','mysql','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','motion2','127.0.0.1','database','username','password','options','User','import','../api/user/user.model','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','VoiceMailMessage','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','ChatWebsite','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.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','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','VoiceQueuesLog','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Template','../api/template/template.model','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','AnalyticDefaultReport','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','SalesforceConfiguration','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intZohoAccount/intZohoAccount.model','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','ZendeskField','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','VtigerAccount','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','../api/intFreshsalesAccount/intFreshsalesAccount.model','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','../api/intFreshsalesField/intFreshsalesField.model','Network','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','../api/squareReport/squareReport.model','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','../api/license/license.model','../api/campaign/campaign.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model'];(function(_0x1ceaa3,_0x4974b9){var _0x146d3b=function(_0x1f7312){while(--_0x1f7312){_0x1ceaa3['push'](_0x1ceaa3['shift']());}};_0x146d3b(++_0x4974b9);}(_0x0eff,0xeb));var _0xf0ef=function(_0x8e8ca7,_0x5a5e07){_0x8e8ca7=_0x8e8ca7-0x0;var _0x561381=_0x0eff[_0x8e8ca7];return _0x561381;};'use strict';var path=require(_0xf0ef('0x0'));var config=require(_0xf0ef('0x1'));var Sequelize=require('sequelize');var _=require('lodash');var jstz=require(_0xf0ef('0x2'));var timezone=jstz[_0xf0ef('0x3')]();config[_0xf0ef('0x4')]=_[_0xf0ef('0x5')](config[_0xf0ef('0x4')],{'database':'motion2','username':_0xf0ef('0x6'),'password':_0xf0ef('0x7'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0xf0ef('0x8'),'dialectOptions':{'charset':_0xf0ef('0x9')},'logging':![],'timezone':timezone[_0xf0ef('0xa')](),'define':{'charset':_0xf0ef('0xb'),'collate':_0xf0ef('0xc')}}});config[_0xf0ef('0xd')]=_[_0xf0ef('0x5')](config[_0xf0ef('0xd')],{'database':_0xf0ef('0xe'),'username':_0xf0ef('0x6'),'password':_0xf0ef('0x7'),'options':{'host':_0xf0ef('0xf'),'port':0xcea,'dialect':_0xf0ef('0x8'),'dialectOptions':{'charset':_0xf0ef('0x9')},'logging':![],'timezone':timezone[_0xf0ef('0xa')](),'define':{'charset':'utf8','collate':_0xf0ef('0xc')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xf0ef('0x4')][_0xf0ef('0x10')],config[_0xf0ef('0x4')][_0xf0ef('0x11')],config[_0xf0ef('0x4')][_0xf0ef('0x12')],config[_0xf0ef('0x4')][_0xf0ef('0x13')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xf0ef('0xd')][_0xf0ef('0x10')],config[_0xf0ef('0xd')][_0xf0ef('0x11')],config[_0xf0ef('0xd')][_0xf0ef('0x12')],config['sequelizeHistory'][_0xf0ef('0x13')])};db[_0xf0ef('0x14')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0x16'));db['VoiceChanSpy']=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0x17'));db[_0xf0ef('0x18')]=db['sequelize']['import'](_0xf0ef('0x19'));db[_0xf0ef('0x1a')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')]('../api/voiceExtension/voiceExtension.model');db[_0xf0ef('0x1b')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0x1c'));db[_0xf0ef('0x1d')]=db[_0xf0ef('0x4')]['import'](_0xf0ef('0x1e'));db[_0xf0ef('0x1f')]=db[_0xf0ef('0x4')]['import'](_0xf0ef('0x20'));db[_0xf0ef('0x21')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0x22'));db['VoiceMail']=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0x23'));db[_0xf0ef('0x24')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')]('../api/voiceMailMessage/voiceMailMessage.model');db[_0xf0ef('0x25')]=db['sequelize'][_0xf0ef('0x15')](_0xf0ef('0x26'));db[_0xf0ef('0x27')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0x28'));db['VoiceAgentReport']=db['sequelize']['import'](_0xf0ef('0x29'));db[_0xf0ef('0x2a')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0x2b'));db[_0xf0ef('0x2c')]=db[_0xf0ef('0x4')]['import']('../api/memberReport/memberReport.model');db['Trunk']=db['sequelize'][_0xf0ef('0x15')](_0xf0ef('0x2d'));db[_0xf0ef('0x2e')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0x2f'));db[_0xf0ef('0x30')]=db['sequelize'][_0xf0ef('0x15')](_0xf0ef('0x31'));db[_0xf0ef('0x32')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')]('../api/userVoiceQueue/userVoiceQueue.model');db[_0xf0ef('0x33')]=db['sequelize'][_0xf0ef('0x15')](_0xf0ef('0x34'));db[_0xf0ef('0x35')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0x36'));db[_0xf0ef('0x37')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0x38'));db[_0xf0ef('0x39')]=db['sequelize'][_0xf0ef('0x15')](_0xf0ef('0x3a'));db[_0xf0ef('0x3b')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0x3c'));db['MailServerIn']=db[_0xf0ef('0x4')]['import'](_0xf0ef('0x3d'));db[_0xf0ef('0x3e')]=db[_0xf0ef('0x4')]['import'](_0xf0ef('0x3f'));db[_0xf0ef('0x40')]=db[_0xf0ef('0x4')]['import'](_0xf0ef('0x41'));db[_0xf0ef('0x42')]=db[_0xf0ef('0x4')]['import']('../api/mailQueue/mailQueue.model');db[_0xf0ef('0x43')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0x44'));db[_0xf0ef('0x45')]=db['sequelize'][_0xf0ef('0x15')]('../api/mailInteraction/mailInteraction.model');db['MailMessage']=db[_0xf0ef('0x4')]['import']('../api/mailMessage/mailMessage.model');db['MailApplication']=db['sequelize'][_0xf0ef('0x15')](_0xf0ef('0x46'));db[_0xf0ef('0x47')]=db['sequelize'][_0xf0ef('0x15')](_0xf0ef('0x48'));db[_0xf0ef('0x49')]=db[_0xf0ef('0x4')]['import'](_0xf0ef('0x4a'));db[_0xf0ef('0x4b')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')]('../api/dashboardItem/dashboardItem.model');db[_0xf0ef('0x4c')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0x4d'));db[_0xf0ef('0x4e')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')]('../api/faxApplication/faxApplication.model');db[_0xf0ef('0x4f')]=db[_0xf0ef('0x4')]['import'](_0xf0ef('0x50'));db[_0xf0ef('0x51')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0x52'));db['FaxQueue']=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0x53'));db[_0xf0ef('0x54')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0x55'));db[_0xf0ef('0x56')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0x57'));db[_0xf0ef('0x58')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0x59'));db['SmsInteraction']=db[_0xf0ef('0x4')]['import'](_0xf0ef('0x5a'));db[_0xf0ef('0x5b')]=db['sequelize'][_0xf0ef('0x15')](_0xf0ef('0x5c'));db[_0xf0ef('0x5d')]=db[_0xf0ef('0x4')]['import'](_0xf0ef('0x5e'));db['OpenchannelAccount']=db[_0xf0ef('0x4')]['import'](_0xf0ef('0x5f'));db[_0xf0ef('0x60')]=db['sequelize'][_0xf0ef('0x15')](_0xf0ef('0x61'));db['OpenchannelInteraction']=db['sequelize']['import'](_0xf0ef('0x62'));db[_0xf0ef('0x63')]=db['sequelize'][_0xf0ef('0x15')](_0xf0ef('0x64'));db[_0xf0ef('0x65')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')]('../api/openchannelQueue/openchannelQueue.model');db[_0xf0ef('0x66')]=db['sequelize']['import']('../api/chatWebsite/chatWebsite.model');db['OpenchannelQueueReport']=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0x67'));db[_0xf0ef('0x68')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0x69'));db[_0xf0ef('0x6a')]=db[_0xf0ef('0x4')]['import'](_0xf0ef('0x6b'));db['ChatMessage']=db['sequelize'][_0xf0ef('0x15')]('../api/chatMessage/chatMessage.model');db[_0xf0ef('0x6c')]=db['sequelize'][_0xf0ef('0x15')](_0xf0ef('0x6d'));db[_0xf0ef('0x6e')]=db['sequelize'][_0xf0ef('0x15')](_0xf0ef('0x6f'));db[_0xf0ef('0x70')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0x71'));db['ChatProactiveAction']=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0x72'));db[_0xf0ef('0x73')]=db['sequelize'][_0xf0ef('0x15')](_0xf0ef('0x74'));db[_0xf0ef('0x75')]=db[_0xf0ef('0x4')]['import'](_0xf0ef('0x76'));db[_0xf0ef('0x77')]=db[_0xf0ef('0x4')]['import'](_0xf0ef('0x78'));db['CmHopperBlack']=db['sequelize'][_0xf0ef('0x15')]('../api/cmHopperBlack/cmHopperBlack.model');db[_0xf0ef('0x79')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0x7a'));db[_0xf0ef('0x7b')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0x7c'));db[_0xf0ef('0x7d')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0x7e'));db[_0xf0ef('0x7f')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0x80'));db[_0xf0ef('0x81')]=db['sequelize'][_0xf0ef('0x15')](_0xf0ef('0x82'));db['Automation']=db['sequelize'][_0xf0ef('0x15')](_0xf0ef('0x83'));db[_0xf0ef('0x84')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0x85'));db[_0xf0ef('0x86')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0x87'));db[_0xf0ef('0x88')]=db[_0xf0ef('0x4')]['import']('../api/condition/condition.model');db['Interval']=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0x89'));db[_0xf0ef('0x8a')]=db['sequelize']['import'](_0xf0ef('0x8b'));db[_0xf0ef('0x8c')]=db['sequelize']['import']('../api/cdr/cdr.model');db[_0xf0ef('0x8d')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')]('../api/voiceQueuesLog/voiceQueuesLog.model');db[_0xf0ef('0x8e')]=db[_0xf0ef('0x4')]['import'](_0xf0ef('0x8f'));db[_0xf0ef('0x90')]=db[_0xf0ef('0x4')]['import'](_0xf0ef('0x91'));db['Tag']=db[_0xf0ef('0x4')][_0xf0ef('0x15')]('../api/tag/tag.model');db[_0xf0ef('0x92')]=db['sequelize'][_0xf0ef('0x15')](_0xf0ef('0x93'));db['Trigger']=db['sequelize']['import'](_0xf0ef('0x94'));db[_0xf0ef('0x95')]=db[_0xf0ef('0x4')]['import'](_0xf0ef('0x96'));db[_0xf0ef('0x97')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0x98'));db[_0xf0ef('0x99')]=db[_0xf0ef('0x4')]['import'](_0xf0ef('0x9a'));db[_0xf0ef('0x9b')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')]('../api/analyticCustomReport/analyticCustomReport.model');db[_0xf0ef('0x9c')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')]('../api/analyticDefaultReport/analyticDefaultReport.model');db[_0xf0ef('0x9d')]=db[_0xf0ef('0x4')]['import'](_0xf0ef('0x9e'));db[_0xf0ef('0x9f')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0xa0'));db[_0xf0ef('0xa1')]=db['sequelize']['import'](_0xf0ef('0xa2'));db[_0xf0ef('0xa3')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0xa4'));db[_0xf0ef('0xa5')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')]('../api/intSalesforceAccount/intSalesforceAccount.model');db[_0xf0ef('0xa6')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')]('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db[_0xf0ef('0xa7')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0xa8'));db[_0xf0ef('0xa9')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0xaa'));db[_0xf0ef('0xab')]=db[_0xf0ef('0x4')]['import']('../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model');db[_0xf0ef('0xac')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0xad'));db['DeskAccount']=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0xae'));db['DeskConfiguration']=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0xaf'));db[_0xf0ef('0xb0')]=db['sequelize'][_0xf0ef('0x15')]('../api/intDeskField/intDeskField.model');db['ZohoAccount']=db[_0xf0ef('0x4')]['import'](_0xf0ef('0xb1'));db['ZohoConfiguration']=db['sequelize'][_0xf0ef('0x15')](_0xf0ef('0xb2'));db[_0xf0ef('0xb3')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0xb4'));db[_0xf0ef('0xb5')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0xb6'));db[_0xf0ef('0xb7')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')]('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0xf0ef('0xb8')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')]('../api/intZendeskField/intZendeskField.model');db[_0xf0ef('0xb9')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0xba'));db[_0xf0ef('0xbb')]=db['sequelize'][_0xf0ef('0x15')](_0xf0ef('0xbc'));db[_0xf0ef('0xbd')]=db['sequelize'][_0xf0ef('0x15')]('../api/intFreshdeskField/intFreshdeskField.model');db[_0xf0ef('0xbe')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')]('../api/intVtigerAccount/intVtigerAccount.model');db[_0xf0ef('0xbf')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0xc0'));db['VtigerField']=db['sequelize']['import']('../api/intVtigerField/intVtigerField.model');db[_0xf0ef('0xc1')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0xc2'));db[_0xf0ef('0xc3')]=db[_0xf0ef('0x4')]['import'](_0xf0ef('0xc4'));db[_0xf0ef('0xc5')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0xc6'));db['Dynamics365Account']=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0xc7'));db[_0xf0ef('0xc8')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0xc9'));db[_0xf0ef('0xca')]=db['sequelize'][_0xf0ef('0x15')](_0xf0ef('0xcb'));db['FreshsalesAccount']=db['sequelize'][_0xf0ef('0x15')](_0xf0ef('0xcc'));db['FreshsalesConfiguration']=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0xcd'));db['FreshsalesField']=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0xce'));db[_0xf0ef('0x97')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0x98'));db[_0xf0ef('0xcf')]=db[_0xf0ef('0x4')]['import']('../api/network/network.model');db[_0xf0ef('0xd0')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0xd1'));db[_0xf0ef('0xd2')]=db['sequelize'][_0xf0ef('0x15')](_0xf0ef('0xd3'));db[_0xf0ef('0xd4')]=db[_0xf0ef('0x4')]['import'](_0xf0ef('0xd5'));db[_0xf0ef('0xd6')]=db['sequelize'][_0xf0ef('0x15')](_0xf0ef('0xd7'));db[_0xf0ef('0xd8')]=db['sequelize'][_0xf0ef('0x15')](_0xf0ef('0xd9'));db[_0xf0ef('0xda')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0xdb'));db['SquareReport']=db['sequelize'][_0xf0ef('0x15')](_0xf0ef('0xdc'));db['SquareDetailsReport']=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0xdd'));db[_0xf0ef('0xde')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')]('../api/jscriptyProject/jscriptyProject.model');db['Setting']=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0xdf'));db['SquareOdbc']=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0xe0'));db[_0xf0ef('0xe1')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0xe2'));db[_0xf0ef('0xe3')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0xe4'));db[_0xf0ef('0xe5')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0xe6'));db[_0xf0ef('0xe7')]=db[_0xf0ef('0x4')]['import'](_0xf0ef('0xe8'));db['License']=db['sequelize'][_0xf0ef('0x15')](_0xf0ef('0xe9'));db['Campaign']=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0xea'));db['Migration']=db['sequelize'][_0xf0ef('0x15')]('../api/migration/migration.model');db[_0xf0ef('0xeb')]=db['sequelize']['import'](_0xf0ef('0xec'));db[_0xf0ef('0xed')]=db[_0xf0ef('0x4')]['import'](_0xf0ef('0xee'));db[_0xf0ef('0xef')]=db[_0xf0ef('0x4')]['import'](_0xf0ef('0xf0'));db[_0xf0ef('0xf1')]=db[_0xf0ef('0x4')]['import'](_0xf0ef('0xf2'));db[_0xf0ef('0xf3')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0xf4'));db[_0xf0ef('0xf5')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0xf6'));db[_0xf0ef('0xf7')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')]('../api/smsTransferReport/smsTransferReport.model');db['CmList']=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0xf8'));db[_0xf0ef('0xf9')]=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0xfa'));db[_0xf0ef('0xfb')]=db['sequelize'][_0xf0ef('0x15')]('../api/userProfile/userProfile.model');db['UserProfileSection']=db[_0xf0ef('0x4')][_0xf0ef('0x15')](_0xf0ef('0xfc'));db[_0xf0ef('0xfd')]=db['sequelize'][_0xf0ef('0x15')](_0xf0ef('0xfe'));db[_0xf0ef('0x14')][_0xf0ef('0xff')](db[_0xf0ef('0x100')],{'as':_0xf0ef('0x100'),'onDelete':'cascade','foreignKey':'UserId'});db['User'][_0xf0ef('0x101')](db['VoiceRecording'],{'as':_0xf0ef('0x102'),'foreignKey':_0xf0ef('0x103')});db[_0xf0ef('0x14')]['hasMany'](db[_0xf0ef('0x30')],{'as':_0xf0ef('0x104'),'foreignKey':_0xf0ef('0x103')});db[_0xf0ef('0x14')]['hasMany'](db[_0xf0ef('0x1a')],{'as':'Extensions','onDelete':_0xf0ef('0x105'),'hooks':!![]});db[_0xf0ef('0x14')][_0xf0ef('0x101')](db['CmHopperFinal'],{'as':_0xf0ef('0x106'),'foreignKey':_0xf0ef('0x103')});db['User'][_0xf0ef('0x101')](db[_0xf0ef('0x7b')],{'as':_0xf0ef('0x107'),'foreignKey':_0xf0ef('0x103')});db[_0xf0ef('0x14')]['hasMany'](db[_0xf0ef('0x7d')],{'as':_0xf0ef('0x7d'),'foreignKey':'UserId'});db[_0xf0ef('0x14')][_0xf0ef('0x101')](db[_0xf0ef('0x108')],{'as':_0xf0ef('0x109'),'foreignKey':'UserId'});db[_0xf0ef('0x14')][_0xf0ef('0x101')](db[_0xf0ef('0x6a')],{'as':_0xf0ef('0x10a'),'foreignKey':_0xf0ef('0x103')});db[_0xf0ef('0x14')][_0xf0ef('0x101')](db[_0xf0ef('0x10b')],{'as':_0xf0ef('0x10c'),'foreignKey':_0xf0ef('0x103')});db[_0xf0ef('0x14')]['hasMany'](db['FaxInteraction'],{'as':_0xf0ef('0x10d'),'foreignKey':_0xf0ef('0x103')});db[_0xf0ef('0x14')][_0xf0ef('0x101')](db[_0xf0ef('0x45')],{'as':_0xf0ef('0x10e'),'foreignKey':_0xf0ef('0x103')});db[_0xf0ef('0x14')]['belongsTo'](db['UserProfile'],{'as':_0xf0ef('0xfb'),'foreignKey':'userProfileId'});db[_0xf0ef('0x14')]['belongsToMany'](db['ChatGroup'],{'as':'Groups','through':'chat_group_has_users'});db[_0xf0ef('0x14')][_0xf0ef('0x10f')](db[_0xf0ef('0x75')],{'as':_0xf0ef('0x110'),'through':_0xf0ef('0x111')});db['User']['belongsToMany'](db[_0xf0ef('0x112')],{'as':_0xf0ef('0x113'),'through':'cm_user_has_lists'});db[_0xf0ef('0x14')][_0xf0ef('0x10f')](db[_0xf0ef('0xe7')],{'through':_0xf0ef('0x114')});db[_0xf0ef('0x14')][_0xf0ef('0x10f')](db[_0xf0ef('0x45')],{'as':'MailInteractions','through':'user_has_mail_interactions'});db['User'][_0xf0ef('0x10f')](db['ChatInteraction'],{'as':_0xf0ef('0x10a'),'through':_0xf0ef('0x115')});db['User']['belongsToMany'](db[_0xf0ef('0x4f')],{'as':'FaxInteractions','through':_0xf0ef('0x116')});db[_0xf0ef('0x14')][_0xf0ef('0x10f')](db['SmsInteraction'],{'as':'SmsInteractions','through':_0xf0ef('0x117')});db[_0xf0ef('0x14')][_0xf0ef('0x10f')](db['OpenchannelInteraction'],{'as':_0xf0ef('0x109'),'through':'user_has_openchannel_interactions'});db[_0xf0ef('0x14')][_0xf0ef('0x10f')](db[_0xf0ef('0x1d')],{'as':_0xf0ef('0x118'),'through':_0xf0ef('0x32'),'required':![]});db[_0xf0ef('0x14')][_0xf0ef('0x10f')](db[_0xf0ef('0x42')],{'as':_0xf0ef('0x119'),'through':_0xf0ef('0x35'),'required':![]});db[_0xf0ef('0x14')]['belongsToMany'](db[_0xf0ef('0x6e')],{'as':_0xf0ef('0x11a'),'through':_0xf0ef('0x33'),'required':![],'hooks':!![]});db[_0xf0ef('0x14')][_0xf0ef('0x10f')](db[_0xf0ef('0x11b')],{'as':_0xf0ef('0x11c'),'through':'UserFaxQueue','required':![]});db[_0xf0ef('0x14')]['belongsToMany'](db[_0xf0ef('0x5d')],{'as':'SmsQueues','through':_0xf0ef('0x39'),'required':![]});db[_0xf0ef('0x14')][_0xf0ef('0x10f')](db[_0xf0ef('0x65')],{'as':'OpenchannelQueues','through':'UserOpenchannelQueue','required':![]});db[_0xf0ef('0x14')][_0xf0ef('0x10f')](db[_0xf0ef('0x112')],{'through':_0xf0ef('0x11d')});db['User']['belongsToMany'](db['VoicePrefix'],{'as':_0xf0ef('0x11e'),'through':_0xf0ef('0x11f'),'required':![]});db[_0xf0ef('0x14')][_0xf0ef('0x10f')](db[_0xf0ef('0x66')],{'as':_0xf0ef('0x120'),'through':_0xf0ef('0x121')});db[_0xf0ef('0x14')]['belongsToMany'](db[_0xf0ef('0x4c')],{'as':'FaxAccounts','through':_0xf0ef('0x122')});db[_0xf0ef('0x14')]['belongsToMany'](db['MailAccount'],{'as':_0xf0ef('0x123'),'through':_0xf0ef('0x124')});db[_0xf0ef('0x14')][_0xf0ef('0x10f')](db[_0xf0ef('0x125')],{'as':'OpenchannelAccounts','through':_0xf0ef('0x126')});db[_0xf0ef('0x14')]['belongsToMany'](db[_0xf0ef('0x56')],{'as':_0xf0ef('0x127'),'through':'user_has_sms_accounts'});db['User'][_0xf0ef('0x10f')](db[_0xf0ef('0xe1')],{'as':_0xf0ef('0x128'),'through':_0xf0ef('0x129')});db[_0xf0ef('0x12a')][_0xf0ef('0x101')](db[_0xf0ef('0x1a')],{'as':'SpiedAgents','onDelete':_0xf0ef('0x105'),'foreignKey':'ChanSpyId'});db['VoiceContext'][_0xf0ef('0x101')](db[_0xf0ef('0x1a')],{'onDelete':_0xf0ef('0x105')});db['VoiceExtension'][_0xf0ef('0x101')](db['VoiceExtension'],{'as':_0xf0ef('0x12b'),'onDelete':_0xf0ef('0x105')});db[_0xf0ef('0x1b')][_0xf0ef('0x10f')](db[_0xf0ef('0x90')],{'as':_0xf0ef('0x12c'),'through':_0xf0ef('0x12d')});db[_0xf0ef('0x1d')][_0xf0ef('0x101')](db[_0xf0ef('0x30')],{'as':_0xf0ef('0x12e'),'foreignKey':_0xf0ef('0x12f')});db[_0xf0ef('0x1d')][_0xf0ef('0x101')](db[_0xf0ef('0x77')],{'as':_0xf0ef('0x130'),'foreignKey':_0xf0ef('0x12f')});db[_0xf0ef('0x1d')][_0xf0ef('0x101')](db['CmHopperFinal'],{'as':_0xf0ef('0x106'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0xf0ef('0x101')](db[_0xf0ef('0x7b')],{'as':_0xf0ef('0x131'),'foreignKey':_0xf0ef('0x12f')});db[_0xf0ef('0x1d')][_0xf0ef('0x101')](db[_0xf0ef('0x7d')],{'as':'ReportAgentPreview','foreignKey':_0xf0ef('0x12f')});db[_0xf0ef('0x1d')][_0xf0ef('0x101')](db[_0xf0ef('0x132')],{'as':_0xf0ef('0x133'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0xf0ef('0x101')](db[_0xf0ef('0xd8')],{'as':'JscriptySessions','foreignKey':_0xf0ef('0x12f')});db[_0xf0ef('0x1d')][_0xf0ef('0x134')](db[_0xf0ef('0x135')],{'as':'Trunk','foreignKey':_0xf0ef('0x136')});db[_0xf0ef('0x1d')][_0xf0ef('0x134')](db[_0xf0ef('0x135')],{'as':_0xf0ef('0x137'),'foreignKey':'TrunkBackupId'});db[_0xf0ef('0x1d')][_0xf0ef('0x134')](db[_0xf0ef('0x138')],{'as':'Interval','foreignKey':_0xf0ef('0x139')});db[_0xf0ef('0x1d')]['belongsTo'](db['Pause'],{'as':_0xf0ef('0x13a'),'foreignKey':_0xf0ef('0x13b')});db[_0xf0ef('0x1d')][_0xf0ef('0x10f')](db['CmList'],{'as':_0xf0ef('0x113'),'through':_0xf0ef('0x13c')});db[_0xf0ef('0x1d')][_0xf0ef('0x10f')](db[_0xf0ef('0x14')],{'as':_0xf0ef('0x13d'),'through':_0xf0ef('0x32')});db[_0xf0ef('0x1d')][_0xf0ef('0x10f')](db[_0xf0ef('0xe7')],{'as':_0xf0ef('0x13e'),'through':_0xf0ef('0x13f')});db[_0xf0ef('0x1d')][_0xf0ef('0x10f')](db[_0xf0ef('0x112')],{'as':_0xf0ef('0x140'),'through':_0xf0ef('0x141')});db[_0xf0ef('0x1f')]['belongsTo'](db[_0xf0ef('0x14')],{'as':'User','foreignKey':_0xf0ef('0x103')});db[_0xf0ef('0x21')][_0xf0ef('0x134')](db[_0xf0ef('0x14')],{'as':'User','foreignKey':_0xf0ef('0x103')});db[_0xf0ef('0x100')][_0xf0ef('0x101')](db[_0xf0ef('0x24')],{'as':_0xf0ef('0x142'),'onDelete':_0xf0ef('0x105'),'foreignKey':_0xf0ef('0x143'),'sourceKey':_0xf0ef('0x144')});db[_0xf0ef('0x24')][_0xf0ef('0x134')](db[_0xf0ef('0x100')],{'foreignKey':_0xf0ef('0x143'),'targetKey':_0xf0ef('0x144')});db[_0xf0ef('0x25')][_0xf0ef('0x101')](db['VoiceQueueReport'],{'as':_0xf0ef('0x145'),'foreignKey':_0xf0ef('0x146'),'constraints':![]});db[_0xf0ef('0x25')][_0xf0ef('0x101')](db[_0xf0ef('0x147')],{'as':'AgentReports','foreignKey':_0xf0ef('0x146'),'constraints':![]});db[_0xf0ef('0x25')][_0xf0ef('0x134')](db[_0xf0ef('0x14')],{'as':_0xf0ef('0x14'),'foreignKey':'UserId'});db[_0xf0ef('0x25')][_0xf0ef('0x134')](db[_0xf0ef('0x75')],{'as':_0xf0ef('0x148'),'foreignKey':_0xf0ef('0x149')});db[_0xf0ef('0x14a')][_0xf0ef('0x134')](db['MailAccount'],{'as':'MailAccount','foreignKey':_0xf0ef('0x14b')});db[_0xf0ef('0x3e')][_0xf0ef('0x134')](db['MailAccount'],{'as':'MailAccount','foreignKey':_0xf0ef('0x14b')});db[_0xf0ef('0x40')]['hasOne'](db['MailServerIn'],{'as':_0xf0ef('0x14c'),'onDelete':_0xf0ef('0x105')});db[_0xf0ef('0x40')][_0xf0ef('0xff')](db['MailServerOut'],{'as':_0xf0ef('0x14d'),'onDelete':_0xf0ef('0x105')});db[_0xf0ef('0x40')][_0xf0ef('0x101')](db[_0xf0ef('0x86')],{'as':_0xf0ef('0x14e'),'foreignKey':_0xf0ef('0x14b')});db[_0xf0ef('0x40')][_0xf0ef('0x101')](db[_0xf0ef('0x84')],{'as':_0xf0ef('0x14f'),'foreignKey':_0xf0ef('0x14b')});db[_0xf0ef('0x40')][_0xf0ef('0x101')](db['MailMessage'],{'as':_0xf0ef('0x142'),'foreignKey':_0xf0ef('0x14b')});db['MailAccount'][_0xf0ef('0x101')](db[_0xf0ef('0x45')],{'as':_0xf0ef('0x150')});db[_0xf0ef('0x40')][_0xf0ef('0x101')](db['MailApplication'],{'as':_0xf0ef('0x12b')});db[_0xf0ef('0x40')][_0xf0ef('0x134')](db['CmList'],{'as':'List','foreignKey':_0xf0ef('0x151')});db[_0xf0ef('0x40')][_0xf0ef('0x134')](db['Template'],{'as':_0xf0ef('0x92'),'foreignKey':_0xf0ef('0x152')});db[_0xf0ef('0x40')][_0xf0ef('0x134')](db[_0xf0ef('0x8a')],{'as':_0xf0ef('0x13a'),'foreignKey':_0xf0ef('0x13b')});db[_0xf0ef('0x40')]['belongsToMany'](db[_0xf0ef('0x14')],{'as':_0xf0ef('0x13d'),'through':_0xf0ef('0x124')});db[_0xf0ef('0x42')][_0xf0ef('0x10f')](db[_0xf0ef('0x14')],{'as':_0xf0ef('0x13d'),'through':_0xf0ef('0x35')});db[_0xf0ef('0x42')]['belongsToMany'](db[_0xf0ef('0xe7')],{'through':_0xf0ef('0x153'),'as':_0xf0ef('0x13e')});db[_0xf0ef('0x45')][_0xf0ef('0x101')](db['MailMessage'],{'as':'Messages','onDelete':'cascade','foreignKey':_0xf0ef('0x154')});db[_0xf0ef('0x45')]['belongsTo'](db[_0xf0ef('0x40')],{'as':'Account','foreignKey':_0xf0ef('0x14b')});db[_0xf0ef('0x45')][_0xf0ef('0x134')](db[_0xf0ef('0x75')],{'as':'Contact','foreignKey':_0xf0ef('0x149')});db[_0xf0ef('0x45')]['belongsTo'](db[_0xf0ef('0x14')],{'as':_0xf0ef('0x155'),'foreignKey':_0xf0ef('0x103')});db[_0xf0ef('0x45')][_0xf0ef('0x10f')](db[_0xf0ef('0x156')],{'through':'mail_interaction_has_tags','as':'Tags'});db[_0xf0ef('0x45')]['belongsToMany'](db['Tag'],{'through':_0xf0ef('0x157'),'as':_0xf0ef('0x158')});db[_0xf0ef('0x45')][_0xf0ef('0x10f')](db[_0xf0ef('0x14')],{'as':_0xf0ef('0x159'),'through':_0xf0ef('0x15a'),'foreignKey':_0xf0ef('0x154')});db[_0xf0ef('0x15b')]['hasMany'](db[_0xf0ef('0xeb')],{'as':_0xf0ef('0x15c'),'onDelete':_0xf0ef('0x105')});db['MailMessage'][_0xf0ef('0x134')](db[_0xf0ef('0x14')],{'as':_0xf0ef('0x14')});db['MailMessage'][_0xf0ef('0x134')](db[_0xf0ef('0x75')],{'onDelete':'cascade','as':_0xf0ef('0x148')});db[_0xf0ef('0x15b')][_0xf0ef('0x134')](db['MailInteraction'],{'as':_0xf0ef('0x15d'),'foreignKey':_0xf0ef('0x154')});db[_0xf0ef('0x15b')]['belongsTo'](db['MailAccount'],{'as':'Account','foreignKey':_0xf0ef('0x14b')});db[_0xf0ef('0x15e')]['belongsTo'](db[_0xf0ef('0x14')],{'onDelete':'restrict'});db[_0xf0ef('0x15e')][_0xf0ef('0x134')](db[_0xf0ef('0x42')],{'onDelete':_0xf0ef('0x15f')});db[_0xf0ef('0x15e')][_0xf0ef('0x134')](db[_0xf0ef('0x40')],{'onDelete':_0xf0ef('0x15f')});db[_0xf0ef('0x15e')]['belongsTo'](db[_0xf0ef('0x138')],{'onDelete':'restrict','foreignKey':_0xf0ef('0x139')});db[_0xf0ef('0x15e')][_0xf0ef('0x134')](db[_0xf0ef('0x156')],{'onDelete':_0xf0ef('0x15f'),'foreignKey':_0xf0ef('0x160')});db['MailQueueReport']['belongsTo'](db[_0xf0ef('0x40')],{});db[_0xf0ef('0x47')][_0xf0ef('0x134')](db[_0xf0ef('0x112')],{'as':_0xf0ef('0x161'),'foreignKey':_0xf0ef('0x151')});db[_0xf0ef('0x47')][_0xf0ef('0x134')](db[_0xf0ef('0x75')],{'as':'Contact','foreignKey':_0xf0ef('0x149')});db[_0xf0ef('0x47')][_0xf0ef('0x134')](db[_0xf0ef('0x45')],{});db[_0xf0ef('0x47')][_0xf0ef('0x134')](db[_0xf0ef('0x15b')],{});db[_0xf0ef('0x47')][_0xf0ef('0x134')](db['User'],{});db[_0xf0ef('0x47')][_0xf0ef('0x134')](db[_0xf0ef('0x42')],{});db[_0xf0ef('0x49')]['hasMany'](db[_0xf0ef('0x4b')],{'as':_0xf0ef('0x162'),'onDelete':'cascade'});db['FaxAccount'][_0xf0ef('0x101')](db['Disposition'],{'as':'Dispositions','foreignKey':_0xf0ef('0x163')});db[_0xf0ef('0x4c')][_0xf0ef('0x101')](db['CannedAnswer'],{'as':_0xf0ef('0x14f'),'foreignKey':_0xf0ef('0x163')});db[_0xf0ef('0x4c')][_0xf0ef('0x101')](db[_0xf0ef('0x4f')],{'as':_0xf0ef('0x150')});db[_0xf0ef('0x4c')][_0xf0ef('0x101')](db['FaxApplication'],{'as':'Applications'});db[_0xf0ef('0x4c')][_0xf0ef('0x101')](db['VoiceExtension'],{'as':'Exntensions','onDelete':_0xf0ef('0x105')});db['FaxAccount'][_0xf0ef('0x101')](db[_0xf0ef('0x51')],{'as':_0xf0ef('0x142')});db[_0xf0ef('0x4c')]['belongsTo'](db[_0xf0ef('0x135')],{'as':_0xf0ef('0x135')});db[_0xf0ef('0x4c')][_0xf0ef('0x134')](db['CmList'],{'as':_0xf0ef('0x161'),'foreignKey':_0xf0ef('0x151')});db['FaxAccount'][_0xf0ef('0x134')](db[_0xf0ef('0x8a')],{'as':_0xf0ef('0x13a'),'foreignKey':_0xf0ef('0x13b')});db[_0xf0ef('0x4c')][_0xf0ef('0x10f')](db['User'],{'as':_0xf0ef('0x13d'),'through':'user_has_fax_accounts'});db['FaxApplication'][_0xf0ef('0x134')](db[_0xf0ef('0x14')],{'onDelete':'restrict'});db['FaxApplication'][_0xf0ef('0x134')](db[_0xf0ef('0x11b')],{'onDelete':'restrict'});db[_0xf0ef('0x4e')][_0xf0ef('0x134')](db['FaxAccount'],{'onDelete':_0xf0ef('0x15f')});db[_0xf0ef('0x4e')][_0xf0ef('0x134')](db['Tag'],{'onDelete':'restrict','foreignKey':_0xf0ef('0x160')});db[_0xf0ef('0x4f')][_0xf0ef('0x101')](db[_0xf0ef('0x51')],{'as':_0xf0ef('0x142'),'onDelete':_0xf0ef('0x105'),'foreignKey':'FaxInteractionId'});db['FaxInteraction'][_0xf0ef('0x134')](db['FaxAccount'],{'as':_0xf0ef('0x164'),'foreignKey':'FaxAccountId'});db[_0xf0ef('0x4f')][_0xf0ef('0x134')](db[_0xf0ef('0x75')],{'as':_0xf0ef('0x148'),'foreignKey':_0xf0ef('0x149')});db[_0xf0ef('0x4f')]['belongsTo'](db['User'],{'as':_0xf0ef('0x155'),'foreignKey':_0xf0ef('0x103')});db['FaxInteraction'][_0xf0ef('0x10f')](db[_0xf0ef('0x156')],{'through':'fax_interaction_has_tags','as':_0xf0ef('0x165')});db[_0xf0ef('0x4f')][_0xf0ef('0x10f')](db['Tag'],{'through':_0xf0ef('0x166'),'as':'ThroughTags'});db['FaxInteraction'][_0xf0ef('0x10f')](db['User'],{'as':'Users','through':_0xf0ef('0x116'),'foreignKey':_0xf0ef('0x167')});db[_0xf0ef('0x51')][_0xf0ef('0x134')](db[_0xf0ef('0x14')],{'onDelete':_0xf0ef('0x105'),'as':_0xf0ef('0x14')});db[_0xf0ef('0x51')][_0xf0ef('0x134')](db[_0xf0ef('0x4f')],{'as':_0xf0ef('0x15d'),'foreignKey':_0xf0ef('0x167')});db['FaxMessage'][_0xf0ef('0x134')](db[_0xf0ef('0x75')],{'onDelete':'cascade','as':_0xf0ef('0x148')});db[_0xf0ef('0x51')][_0xf0ef('0x134')](db[_0xf0ef('0xeb')],{'as':_0xf0ef('0xeb'),'foreignKey':'AttachmentId'});db[_0xf0ef('0x51')]['belongsTo'](db[_0xf0ef('0x4c')],{'as':_0xf0ef('0x164'),'foreignKey':_0xf0ef('0x163')});db['FaxQueue'][_0xf0ef('0x10f')](db[_0xf0ef('0x14')],{'as':'Agents','through':_0xf0ef('0x37')});db[_0xf0ef('0x11b')]['belongsToMany'](db[_0xf0ef('0xe7')],{'through':'team_has_fax_queues','as':_0xf0ef('0x13e')});db[_0xf0ef('0x54')]['belongsTo'](db['FaxAccount'],{});db['FaxQueueReport'][_0xf0ef('0x134')](db[_0xf0ef('0x112')],{'as':_0xf0ef('0x161'),'foreignKey':_0xf0ef('0x151')});db[_0xf0ef('0x54')][_0xf0ef('0x134')](db[_0xf0ef('0x75')],{'as':_0xf0ef('0x148'),'foreignKey':_0xf0ef('0x149')});db[_0xf0ef('0x54')][_0xf0ef('0x134')](db[_0xf0ef('0x4f')],{});db[_0xf0ef('0x54')]['belongsTo'](db[_0xf0ef('0x51')],{});db[_0xf0ef('0x54')][_0xf0ef('0x134')](db[_0xf0ef('0x14')],{});db[_0xf0ef('0x54')][_0xf0ef('0x134')](db['FaxQueue'],{});db[_0xf0ef('0x56')][_0xf0ef('0x101')](db[_0xf0ef('0x86')],{'as':_0xf0ef('0x14e'),'foreignKey':_0xf0ef('0x168')});db[_0xf0ef('0x56')][_0xf0ef('0x101')](db['CannedAnswer'],{'as':_0xf0ef('0x14f'),'foreignKey':_0xf0ef('0x168')});db['SmsAccount']['hasMany'](db[_0xf0ef('0x5b')],{'as':_0xf0ef('0x142'),'foreignKey':'SmsAccountId'});db[_0xf0ef('0x56')][_0xf0ef('0x101')](db['SmsInteraction'],{'as':_0xf0ef('0x150')});db['SmsAccount'][_0xf0ef('0x101')](db[_0xf0ef('0x58')],{'as':_0xf0ef('0x12b')});db['SmsAccount'][_0xf0ef('0x134')](db[_0xf0ef('0x112')],{'as':_0xf0ef('0x161'),'foreignKey':_0xf0ef('0x151')});db['SmsAccount'][_0xf0ef('0x134')](db[_0xf0ef('0x8a')],{'as':_0xf0ef('0x13a'),'foreignKey':_0xf0ef('0x13b')});db[_0xf0ef('0x56')][_0xf0ef('0x10f')](db['User'],{'as':_0xf0ef('0x13d'),'through':_0xf0ef('0x169')});db[_0xf0ef('0x58')][_0xf0ef('0x134')](db[_0xf0ef('0x14')],{'onDelete':'restrict'});db[_0xf0ef('0x58')][_0xf0ef('0x134')](db[_0xf0ef('0x5d')],{'onDelete':_0xf0ef('0x15f')});db[_0xf0ef('0x58')]['belongsTo'](db['SmsAccount'],{'onDelete':'restrict'});db['SmsApplication'][_0xf0ef('0x134')](db['Interval'],{'onDelete':_0xf0ef('0x15f'),'foreignKey':_0xf0ef('0x139')});db[_0xf0ef('0x58')][_0xf0ef('0x134')](db[_0xf0ef('0x156')],{'onDelete':_0xf0ef('0x15f'),'foreignKey':_0xf0ef('0x160')});db['SmsInteraction'][_0xf0ef('0x101')](db[_0xf0ef('0x5b')],{'as':_0xf0ef('0x142'),'onDelete':'cascade','foreignKey':_0xf0ef('0x16a')});db[_0xf0ef('0x10b')][_0xf0ef('0x134')](db[_0xf0ef('0x56')],{'as':_0xf0ef('0x164'),'foreignKey':_0xf0ef('0x168')});db[_0xf0ef('0x10b')][_0xf0ef('0x134')](db[_0xf0ef('0x75')],{'as':_0xf0ef('0x148'),'foreignKey':_0xf0ef('0x149')});db[_0xf0ef('0x10b')]['belongsTo'](db[_0xf0ef('0x14')],{'as':_0xf0ef('0x155'),'foreignKey':'UserId'});db[_0xf0ef('0x10b')][_0xf0ef('0x10f')](db[_0xf0ef('0x156')],{'through':_0xf0ef('0x16b'),'as':_0xf0ef('0x165')});db['SmsInteraction']['belongsToMany'](db[_0xf0ef('0x156')],{'through':_0xf0ef('0x16b'),'as':_0xf0ef('0x158')});db[_0xf0ef('0x10b')]['belongsToMany'](db[_0xf0ef('0x14')],{'as':_0xf0ef('0x159'),'through':_0xf0ef('0x117'),'foreignKey':_0xf0ef('0x16a')});db[_0xf0ef('0x5b')]['belongsTo'](db[_0xf0ef('0x14')],{'as':_0xf0ef('0x14')});db[_0xf0ef('0x5b')][_0xf0ef('0x134')](db['CmContact'],{'onDelete':_0xf0ef('0x105'),'as':_0xf0ef('0x148')});db['SmsMessage'][_0xf0ef('0x134')](db[_0xf0ef('0x10b')],{'onDelete':_0xf0ef('0x105'),'as':_0xf0ef('0x15d'),'foreignKey':_0xf0ef('0x16a')});db[_0xf0ef('0x5b')][_0xf0ef('0x134')](db['SmsAccount'],{'as':_0xf0ef('0x164'),'foreignKey':_0xf0ef('0x168')});db[_0xf0ef('0x5d')][_0xf0ef('0x10f')](db[_0xf0ef('0x14')],{'as':_0xf0ef('0x13d'),'through':'UserSmsQueue','foreignKey':'SmsQueueId'});db[_0xf0ef('0x5d')][_0xf0ef('0x10f')](db[_0xf0ef('0xe7')],{'through':_0xf0ef('0x16c'),'as':_0xf0ef('0x13e')});db[_0xf0ef('0x125')][_0xf0ef('0x101')](db['Disposition'],{'as':_0xf0ef('0x14e'),'foreignKey':_0xf0ef('0x16d')});db[_0xf0ef('0x125')][_0xf0ef('0x101')](db[_0xf0ef('0x84')],{'as':_0xf0ef('0x14f'),'foreignKey':_0xf0ef('0x16d')});db[_0xf0ef('0x125')][_0xf0ef('0x101')](db['OpenchannelInteraction'],{'as':_0xf0ef('0x150'),'foreignKey':_0xf0ef('0x16d')});db[_0xf0ef('0x125')]['hasMany'](db['OpenchannelMessage'],{'as':_0xf0ef('0x142'),'foreignKey':_0xf0ef('0x16d')});db[_0xf0ef('0x125')][_0xf0ef('0x101')](db[_0xf0ef('0x60')],{'as':_0xf0ef('0x12b'),'foreignKey':_0xf0ef('0x16d')});db[_0xf0ef('0x125')][_0xf0ef('0x134')](db['CmList'],{'as':_0xf0ef('0x161'),'foreignKey':'ListId'});db['OpenchannelAccount'][_0xf0ef('0x134')](db['Pause'],{'as':_0xf0ef('0x13a'),'foreignKey':_0xf0ef('0x13b')});db[_0xf0ef('0x125')][_0xf0ef('0x10f')](db[_0xf0ef('0x14')],{'as':_0xf0ef('0x13d'),'through':_0xf0ef('0x126')});db[_0xf0ef('0x60')][_0xf0ef('0x134')](db[_0xf0ef('0x14')],{'onDelete':_0xf0ef('0x15f')});db[_0xf0ef('0x60')][_0xf0ef('0x134')](db[_0xf0ef('0x65')],{'onDelete':_0xf0ef('0x15f'),'foreignKey':_0xf0ef('0x16e')});db[_0xf0ef('0x60')]['belongsTo'](db[_0xf0ef('0x125')],{'onDelete':_0xf0ef('0x15f'),'foreignKey':_0xf0ef('0x16d')});db[_0xf0ef('0x60')][_0xf0ef('0x134')](db[_0xf0ef('0x138')],{'onDelete':_0xf0ef('0x15f'),'foreignKey':_0xf0ef('0x139')});db[_0xf0ef('0x60')]['belongsTo'](db[_0xf0ef('0x156')],{'onDelete':'restrict','foreignKey':_0xf0ef('0x160')});db[_0xf0ef('0x108')][_0xf0ef('0x101')](db['OpenchannelMessage'],{'as':_0xf0ef('0x142'),'onDelete':_0xf0ef('0x105'),'foreignKey':_0xf0ef('0x16f')});db[_0xf0ef('0x108')][_0xf0ef('0x134')](db[_0xf0ef('0x125')],{'as':_0xf0ef('0x164'),'foreignKey':_0xf0ef('0x16d')});db[_0xf0ef('0x108')][_0xf0ef('0x134')](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db['OpenchannelInteraction'][_0xf0ef('0x134')](db[_0xf0ef('0x14')],{'as':_0xf0ef('0x155'),'foreignKey':_0xf0ef('0x103')});db[_0xf0ef('0x108')][_0xf0ef('0x10f')](db[_0xf0ef('0x156')],{'through':_0xf0ef('0x170'),'as':_0xf0ef('0x165')});db['OpenchannelInteraction'][_0xf0ef('0x10f')](db['Tag'],{'through':_0xf0ef('0x170'),'as':'ThroughTags'});db[_0xf0ef('0x108')]['belongsToMany'](db[_0xf0ef('0x14')],{'as':_0xf0ef('0x159'),'through':_0xf0ef('0x171'),'foreignKey':_0xf0ef('0x16f')});db[_0xf0ef('0x63')][_0xf0ef('0x134')](db[_0xf0ef('0x14')],{'onDelete':_0xf0ef('0x105'),'as':_0xf0ef('0x14')});db[_0xf0ef('0x63')][_0xf0ef('0x134')](db[_0xf0ef('0x75')],{'onDelete':_0xf0ef('0x105'),'as':_0xf0ef('0x148')});db[_0xf0ef('0x63')][_0xf0ef('0x134')](db[_0xf0ef('0x108')],{'onDelete':'cascade','as':_0xf0ef('0x15d'),'foreignKey':_0xf0ef('0x16f')});db[_0xf0ef('0x63')][_0xf0ef('0x134')](db[_0xf0ef('0xeb')],{'as':_0xf0ef('0xeb'),'foreignKey':_0xf0ef('0x172')});db[_0xf0ef('0x63')][_0xf0ef('0x134')](db['OpenchannelAccount'],{'as':_0xf0ef('0x164'),'foreignKey':_0xf0ef('0x16d')});db[_0xf0ef('0x65')][_0xf0ef('0x10f')](db[_0xf0ef('0x14')],{'as':_0xf0ef('0x13d'),'through':_0xf0ef('0x3b'),'foreignKey':_0xf0ef('0x16e')});db[_0xf0ef('0x65')][_0xf0ef('0x10f')](db[_0xf0ef('0xe7')],{'through':_0xf0ef('0x173'),'as':_0xf0ef('0x13e')});db[_0xf0ef('0x66')][_0xf0ef('0x101')](db[_0xf0ef('0x86')],{'as':_0xf0ef('0x14e'),'foreignKey':'ChatWebsiteId'});db[_0xf0ef('0x66')][_0xf0ef('0x101')](db[_0xf0ef('0x84')],{'as':_0xf0ef('0x14f'),'foreignKey':_0xf0ef('0x174')});db[_0xf0ef('0x66')][_0xf0ef('0x101')](db['ChatProactiveAction'],{'as':_0xf0ef('0x175')});db[_0xf0ef('0x66')][_0xf0ef('0x101')](db[_0xf0ef('0x6a')],{'as':_0xf0ef('0x150')});db[_0xf0ef('0x66')][_0xf0ef('0x101')](db[_0xf0ef('0x68')],{'as':'Applications'});db[_0xf0ef('0x66')][_0xf0ef('0x101')](db['ChatMessage'],{'as':'Messages'});db['ChatWebsite'][_0xf0ef('0x134')](db[_0xf0ef('0x112')],{'as':_0xf0ef('0x161'),'foreignKey':_0xf0ef('0x151')});db[_0xf0ef('0x66')][_0xf0ef('0x134')](db[_0xf0ef('0x138')],{'as':'Interval','foreignKey':_0xf0ef('0x139')});db[_0xf0ef('0x66')][_0xf0ef('0x134')](db['Pause'],{'as':_0xf0ef('0x13a'),'foreignKey':_0xf0ef('0x13b')});db[_0xf0ef('0x66')][_0xf0ef('0x10f')](db[_0xf0ef('0x14')],{'as':_0xf0ef('0x13d'),'through':_0xf0ef('0x121')});db[_0xf0ef('0x176')][_0xf0ef('0x134')](db[_0xf0ef('0x125')],{});db[_0xf0ef('0x176')][_0xf0ef('0x134')](db[_0xf0ef('0x112')],{'as':_0xf0ef('0x161'),'foreignKey':_0xf0ef('0x151')});db[_0xf0ef('0x176')][_0xf0ef('0x134')](db['CmContact'],{'as':'Contact','foreignKey':_0xf0ef('0x149')});db[_0xf0ef('0x176')][_0xf0ef('0x134')](db[_0xf0ef('0x108')],{});db[_0xf0ef('0x176')][_0xf0ef('0x134')](db[_0xf0ef('0x63')],{});db[_0xf0ef('0x176')][_0xf0ef('0x134')](db[_0xf0ef('0x14')],{});db[_0xf0ef('0x176')]['belongsTo'](db[_0xf0ef('0x65')],{});db[_0xf0ef('0x68')]['belongsTo'](db[_0xf0ef('0x14')],{'as':_0xf0ef('0x177'),'foreignKey':_0xf0ef('0x103'),'onDelete':_0xf0ef('0x15f')});db[_0xf0ef('0x68')][_0xf0ef('0x134')](db['ChatQueue'],{'as':_0xf0ef('0x178'),'foreignKey':'ChatQueueId','onDelete':_0xf0ef('0x15f')});db[_0xf0ef('0x68')][_0xf0ef('0x134')](db[_0xf0ef('0x66')],{'as':'Website','foreignKey':_0xf0ef('0x174'),'onDelete':'restrict'});db[_0xf0ef('0x68')]['belongsTo'](db[_0xf0ef('0x156')],{'onDelete':_0xf0ef('0x15f'),'foreignKey':'TagId'});db['ChatInteraction'][_0xf0ef('0x101')](db[_0xf0ef('0x179')],{'as':_0xf0ef('0x142'),'onDelete':'cascade','foreignKey':_0xf0ef('0x17a')});db['ChatInteraction'][_0xf0ef('0x134')](db[_0xf0ef('0x66')],{'as':_0xf0ef('0x164'),'foreignKey':'ChatWebsiteId'});db[_0xf0ef('0x6a')]['belongsTo'](db[_0xf0ef('0x75')],{'as':_0xf0ef('0x148'),'foreignKey':_0xf0ef('0x149')});db['ChatInteraction'][_0xf0ef('0x134')](db[_0xf0ef('0x14')],{'as':_0xf0ef('0x155'),'foreignKey':_0xf0ef('0x103')});db[_0xf0ef('0x6a')]['belongsToMany'](db['Tag'],{'through':_0xf0ef('0x17b'),'as':'Tags'});db[_0xf0ef('0x6a')]['belongsToMany'](db[_0xf0ef('0x156')],{'through':_0xf0ef('0x17b'),'as':_0xf0ef('0x158')});db['ChatInteraction']['belongsToMany'](db[_0xf0ef('0x14')],{'as':_0xf0ef('0x159'),'through':_0xf0ef('0x115'),'foreignKey':_0xf0ef('0x17a')});db[_0xf0ef('0x179')][_0xf0ef('0x134')](db[_0xf0ef('0x14')],{'onDelete':_0xf0ef('0x105'),'as':_0xf0ef('0x14')});db[_0xf0ef('0x179')][_0xf0ef('0x134')](db[_0xf0ef('0x75')],{'onDelete':_0xf0ef('0x105'),'as':_0xf0ef('0x148'),'foreignKey':_0xf0ef('0x149')});db[_0xf0ef('0x179')]['belongsTo'](db[_0xf0ef('0x6a')],{'onDelete':_0xf0ef('0x105'),'as':'Interaction','foreignKey':_0xf0ef('0x17a')});db['ChatMessage'][_0xf0ef('0x134')](db[_0xf0ef('0xeb')],{'as':_0xf0ef('0xeb'),'foreignKey':'AttachmentId'});db['ChatMessage'][_0xf0ef('0x134')](db[_0xf0ef('0x66')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0xf0ef('0x6c')][_0xf0ef('0x134')](db[_0xf0ef('0x75')],{'onDelete':'cascade','as':_0xf0ef('0x148'),'foreignKey':_0xf0ef('0x149')});db[_0xf0ef('0x6c')][_0xf0ef('0x134')](db[_0xf0ef('0x66')],{'as':'Account','foreignKey':_0xf0ef('0x174')});db['ChatQueue'][_0xf0ef('0x10f')](db['User'],{'as':'Agents','through':_0xf0ef('0x33'),'hooks':!![]});db[_0xf0ef('0x6e')][_0xf0ef('0x10f')](db['Team'],{'through':_0xf0ef('0x17c'),'as':'Teams'});db[_0xf0ef('0x70')][_0xf0ef('0x101')](db[_0xf0ef('0xd2')],{'as':'Messages','foreignKey':'ChatGroupId','onDelete':_0xf0ef('0x105')});db[_0xf0ef('0x70')]['belongsToMany'](db[_0xf0ef('0x14')],{'as':_0xf0ef('0x12e'),'through':_0xf0ef('0x17d')});db[_0xf0ef('0x17e')][_0xf0ef('0x134')](db[_0xf0ef('0x66')],{'as':_0xf0ef('0x17f'),'foreignKey':_0xf0ef('0x174')});db[_0xf0ef('0x73')][_0xf0ef('0x101')](db[_0xf0ef('0x75')],{'as':_0xf0ef('0x110'),'foreignKey':_0xf0ef('0x180')});db[_0xf0ef('0x75')][_0xf0ef('0x101')](db['CmHopper'],{'as':_0xf0ef('0x130'),'foreignKey':_0xf0ef('0x149')});db[_0xf0ef('0x75')][_0xf0ef('0x101')](db[_0xf0ef('0x79')],{'as':'HopperFinals','foreignKey':_0xf0ef('0x149')});db[_0xf0ef('0x75')][_0xf0ef('0x101')](db[_0xf0ef('0x7b')],{'as':_0xf0ef('0x131'),'foreignKey':_0xf0ef('0x149')});db[_0xf0ef('0x75')][_0xf0ef('0x101')](db[_0xf0ef('0x7d')],{'as':_0xf0ef('0x7d'),'foreignKey':_0xf0ef('0x149')});db[_0xf0ef('0x75')][_0xf0ef('0x101')](db[_0xf0ef('0xd8')],{'as':_0xf0ef('0x181'),'foreignKey':_0xf0ef('0x149')});db[_0xf0ef('0x75')][_0xf0ef('0x101')](db[_0xf0ef('0x108')],{'as':_0xf0ef('0x109'),'foreignKey':_0xf0ef('0x149'),'onDelete':_0xf0ef('0x15f')});db[_0xf0ef('0x75')]['hasMany'](db[_0xf0ef('0x6a')],{'as':'ChatInteractions','foreignKey':_0xf0ef('0x149'),'onDelete':'restrict'});db[_0xf0ef('0x75')][_0xf0ef('0x101')](db[_0xf0ef('0x10b')],{'as':_0xf0ef('0x10c'),'foreignKey':_0xf0ef('0x149'),'onDelete':'restrict'});db[_0xf0ef('0x75')]['hasMany'](db['FaxInteraction'],{'as':_0xf0ef('0x10d'),'foreignKey':_0xf0ef('0x149'),'onDelete':_0xf0ef('0x15f')});db[_0xf0ef('0x75')][_0xf0ef('0x101')](db['MailInteraction'],{'as':_0xf0ef('0x10e'),'foreignKey':_0xf0ef('0x149'),'onDelete':_0xf0ef('0x15f')});db[_0xf0ef('0x75')][_0xf0ef('0x134')](db['CmCompany'],{'as':_0xf0ef('0x182'),'foreignKey':_0xf0ef('0x180')});db[_0xf0ef('0x75')][_0xf0ef('0x134')](db['CmList'],{'as':'List','foreignKey':_0xf0ef('0x151'),'onDelete':_0xf0ef('0x105')});db[_0xf0ef('0x75')][_0xf0ef('0x10f')](db[_0xf0ef('0x14')],{'as':_0xf0ef('0x159'),'through':'cm_user_has_contacts'});db[_0xf0ef('0x75')][_0xf0ef('0x10f')](db['Tag'],{'as':_0xf0ef('0x165'),'through':_0xf0ef('0x183')});db['CmContact'][_0xf0ef('0x10f')](db[_0xf0ef('0x156')],{'through':_0xf0ef('0x183'),'as':_0xf0ef('0x158')});db[_0xf0ef('0x77')][_0xf0ef('0x134')](db[_0xf0ef('0x75')],{'as':'Contact','foreignKey':_0xf0ef('0x149'),'onDelete':_0xf0ef('0x105')});db[_0xf0ef('0x77')][_0xf0ef('0x134')](db[_0xf0ef('0x112')],{'as':_0xf0ef('0x161'),'foreignKey':_0xf0ef('0x151'),'onDelete':_0xf0ef('0x105')});db[_0xf0ef('0x77')][_0xf0ef('0x134')](db[_0xf0ef('0x14')],{'as':'Agent','foreignKey':'UserId'});db[_0xf0ef('0x77')][_0xf0ef('0x134')](db[_0xf0ef('0x1d')],{'as':_0xf0ef('0x178'),'foreignKey':'VoiceQueueId','onDelete':_0xf0ef('0x105')});db['CmHopper'][_0xf0ef('0x134')](db[_0xf0ef('0x184')],{'as':_0xf0ef('0x184'),'foreignKey':'CampaignId','onDelete':_0xf0ef('0x105')});db[_0xf0ef('0x77')][_0xf0ef('0x134')](db[_0xf0ef('0x14')],{'as':_0xf0ef('0x155'),'foreignKey':'OwnerId'});db[_0xf0ef('0x132')][_0xf0ef('0x134')](db[_0xf0ef('0x75')],{'as':_0xf0ef('0x148'),'foreignKey':_0xf0ef('0x149'),'onDelete':_0xf0ef('0x105')});db[_0xf0ef('0x132')][_0xf0ef('0x134')](db[_0xf0ef('0x112')],{'as':_0xf0ef('0x161'),'foreignKey':_0xf0ef('0x151'),'onDelete':_0xf0ef('0x105')});db[_0xf0ef('0x132')]['belongsTo'](db[_0xf0ef('0x1d')],{'as':_0xf0ef('0x178'),'foreignKey':'VoiceQueueId','onDelete':_0xf0ef('0x105')});db[_0xf0ef('0x132')][_0xf0ef('0x134')](db[_0xf0ef('0x184')],{'as':_0xf0ef('0x184'),'foreignKey':_0xf0ef('0x185'),'onDelete':_0xf0ef('0x105')});db[_0xf0ef('0x186')][_0xf0ef('0x101')](db[_0xf0ef('0x88')],{'as':{'plural':_0xf0ef('0x187'),'singular':_0xf0ef('0x188')},'foreignKey':_0xf0ef('0x189'),'onDelete':'cascade','hooks':!![]});db['Automation'][_0xf0ef('0x101')](db[_0xf0ef('0x88')],{'as':{'plural':_0xf0ef('0x18a'),'singular':_0xf0ef('0x18b')},'foreignKey':_0xf0ef('0x18c'),'onDelete':_0xf0ef('0x105'),'hooks':!![]});db[_0xf0ef('0x186')][_0xf0ef('0x101')](db[_0xf0ef('0x81')],{'as':_0xf0ef('0x18d'),'foreignKey':_0xf0ef('0x18e'),'onDelete':_0xf0ef('0x105'),'hooks':!![]});db['Interval'][_0xf0ef('0x101')](db[_0xf0ef('0x138')],{'as':'Intervals','foreignKey':'IntervalId','onDelete':_0xf0ef('0x105'),'hooks':!![],'required':![]});db[_0xf0ef('0x138')]['hasMany'](db[_0xf0ef('0x1a')],{'as':_0xf0ef('0x18f'),'foreignKey':_0xf0ef('0x139'),'onDelete':_0xf0ef('0x15f')});db[_0xf0ef('0x138')][_0xf0ef('0x101')](db[_0xf0ef('0x15e')],{'as':_0xf0ef('0x190'),'foreignKey':_0xf0ef('0x139')});db[_0xf0ef('0x138')][_0xf0ef('0x101')](db[_0xf0ef('0x68')],{'as':_0xf0ef('0x191'),'foreignKey':_0xf0ef('0x139')});db[_0xf0ef('0x138')]['hasMany'](db[_0xf0ef('0x4e')],{'as':_0xf0ef('0x192'),'foreignKey':'IntervalId'});db[_0xf0ef('0x138')][_0xf0ef('0x101')](db['SmsApplication'],{'as':_0xf0ef('0x193'),'foreignKey':'IntervalId'});db['Schedule'][_0xf0ef('0x134')](db[_0xf0ef('0x40')],{});db[_0xf0ef('0x8e')][_0xf0ef('0x134')](db['AnalyticDefaultReport'],{'foreignKey':_0xf0ef('0x194')});db[_0xf0ef('0x8e')][_0xf0ef('0x134')](db[_0xf0ef('0x9b')],{'foreignKey':_0xf0ef('0x195')});db['Sound'][_0xf0ef('0x10f')](db[_0xf0ef('0x1b')],{'as':_0xf0ef('0x196'),'through':_0xf0ef('0x12d'),'onDelete':'restrict'});db[_0xf0ef('0x156')]['belongsToMany'](db['CmContact'],{'through':'cm_contact_has_tags'});db['Tag']['belongsToMany'](db[_0xf0ef('0x6a')],{'through':_0xf0ef('0x17b')});db['Tag'][_0xf0ef('0x10f')](db[_0xf0ef('0x45')],{'through':_0xf0ef('0x157')});db['Tag'][_0xf0ef('0x10f')](db[_0xf0ef('0x10b')],{'through':_0xf0ef('0x16b')});db[_0xf0ef('0x156')][_0xf0ef('0x10f')](db['FaxInteraction'],{'through':'fax_interaction_has_tags'});db[_0xf0ef('0x156')][_0xf0ef('0x10f')](db[_0xf0ef('0x108')],{'through':_0xf0ef('0x170')});db[_0xf0ef('0x197')][_0xf0ef('0x101')](db['Condition'],{'as':{'plural':_0xf0ef('0x198'),'singular':_0xf0ef('0x199')},'foreignKey':'TriggerAllId','onDelete':'cascade','hooks':!![]});db[_0xf0ef('0x197')][_0xf0ef('0x101')](db[_0xf0ef('0x88')],{'as':{'plural':_0xf0ef('0x19a'),'singular':_0xf0ef('0x19b')},'foreignKey':_0xf0ef('0x19c'),'onDelete':_0xf0ef('0x105'),'hooks':!![]});db[_0xf0ef('0x197')][_0xf0ef('0x101')](db[_0xf0ef('0x81')],{'as':_0xf0ef('0x18d'),'foreignKey':_0xf0ef('0x19d'),'onDelete':_0xf0ef('0x105'),'hooks':!![]});db[_0xf0ef('0x9b')][_0xf0ef('0x101')](db[_0xf0ef('0xa1')],{'as':_0xf0ef('0x19e'),'onDelete':'cascade','foreignKey':_0xf0ef('0x195'),'hooks':!![]});db[_0xf0ef('0x9c')]['hasMany'](db[_0xf0ef('0xa1')],{'as':_0xf0ef('0x19e'),'onDelete':_0xf0ef('0x105'),'foreignKey':_0xf0ef('0x194')});db[_0xf0ef('0x9f')][_0xf0ef('0x101')](db[_0xf0ef('0xa1')],{'as':_0xf0ef('0x19e'),'onDelete':_0xf0ef('0x105'),'foreignKey':_0xf0ef('0x19f')});db[_0xf0ef('0xa1')][_0xf0ef('0x134')](db['AnalyticMetric'],{'foreignKey':_0xf0ef('0x19f')});db[_0xf0ef('0xa5')][_0xf0ef('0x101')](db['SalesforceConfiguration'],{'as':_0xf0ef('0x1a0'),'onDelete':_0xf0ef('0x105'),'foreignKey':'AccountId'});db['SalesforceConfiguration'][_0xf0ef('0x101')](db[_0xf0ef('0xa7')],{'as':_0xf0ef('0x1a1'),'onDelete':'cascade','foreignKey':_0xf0ef('0x1a2')});db[_0xf0ef('0xa6')][_0xf0ef('0x101')](db[_0xf0ef('0xa7')],{'as':_0xf0ef('0x1a3'),'onDelete':'cascade','foreignKey':_0xf0ef('0x1a4')});db[_0xf0ef('0xa6')]['hasMany'](db['SalesforceField'],{'as':'Fields','onDelete':_0xf0ef('0x105'),'foreignKey':_0xf0ef('0x1a5')});db[_0xf0ef('0xa6')]['belongsTo'](db[_0xf0ef('0xa5')],{'as':_0xf0ef('0x164'),'foreignKey':_0xf0ef('0x1a6')});db[_0xf0ef('0xa7')][_0xf0ef('0x101')](db['SalesforceField'],{'as':_0xf0ef('0x1a7'),'foreignKey':_0xf0ef('0x1a2')});db[_0xf0ef('0xa7')][_0xf0ef('0x101')](db['SalesforceField'],{'as':_0xf0ef('0x1a8'),'foreignKey':'DescriptionId'});db['SalesforceField'][_0xf0ef('0x101')](db[_0xf0ef('0xa7')],{'as':_0xf0ef('0x1a9'),'foreignKey':_0xf0ef('0x1a5')});db[_0xf0ef('0xa7')][_0xf0ef('0x134')](db[_0xf0ef('0x95')],{'as':_0xf0ef('0x95'),'foreignKey':_0xf0ef('0x1aa')});db[_0xf0ef('0xa9')]['hasMany'](db[_0xf0ef('0xab')],{'as':_0xf0ef('0x1a0'),'onDelete':'cascade','foreignKey':_0xf0ef('0x1a6')});db[_0xf0ef('0xab')][_0xf0ef('0x101')](db[_0xf0ef('0xac')],{'as':_0xf0ef('0x1a1'),'onDelete':_0xf0ef('0x105'),'foreignKey':_0xf0ef('0x1a2')});db[_0xf0ef('0xab')][_0xf0ef('0x101')](db['SugarcrmField'],{'as':_0xf0ef('0x1a3'),'onDelete':_0xf0ef('0x105'),'foreignKey':_0xf0ef('0x1a4')});db[_0xf0ef('0xab')][_0xf0ef('0x101')](db[_0xf0ef('0xac')],{'as':_0xf0ef('0x19e'),'onDelete':'cascade','foreignKey':_0xf0ef('0x1a5')});db[_0xf0ef('0xab')][_0xf0ef('0x134')](db[_0xf0ef('0xa9')],{'as':'Account','foreignKey':'AccountId'});db['SugarcrmField'][_0xf0ef('0x101')](db[_0xf0ef('0xac')],{'as':_0xf0ef('0x1a7'),'foreignKey':'SubjectId'});db[_0xf0ef('0xac')]['hasMany'](db['SugarcrmField'],{'as':_0xf0ef('0x1a8'),'foreignKey':_0xf0ef('0x1a4')});db[_0xf0ef('0xac')][_0xf0ef('0x101')](db[_0xf0ef('0xac')],{'as':'Field','foreignKey':_0xf0ef('0x1a5')});db[_0xf0ef('0xac')][_0xf0ef('0x134')](db[_0xf0ef('0x95')],{'as':_0xf0ef('0x95'),'foreignKey':'VariableId'});db[_0xf0ef('0x1ab')]['hasMany'](db[_0xf0ef('0x1ac')],{'as':_0xf0ef('0x1a0'),'onDelete':'cascade','foreignKey':_0xf0ef('0x1a6')});db[_0xf0ef('0x1ac')][_0xf0ef('0x101')](db[_0xf0ef('0xb0')],{'as':_0xf0ef('0x1a1'),'onDelete':_0xf0ef('0x105'),'foreignKey':_0xf0ef('0x1a2')});db[_0xf0ef('0x1ac')]['hasMany'](db['DeskField'],{'as':_0xf0ef('0x1a3'),'onDelete':_0xf0ef('0x105'),'foreignKey':'DescriptionId'});db['DeskConfiguration'][_0xf0ef('0x101')](db[_0xf0ef('0xb0')],{'as':_0xf0ef('0x19e'),'onDelete':_0xf0ef('0x105'),'foreignKey':_0xf0ef('0x1a5')});db[_0xf0ef('0x1ac')][_0xf0ef('0x134')](db[_0xf0ef('0x1ab')],{'as':_0xf0ef('0x164'),'foreignKey':_0xf0ef('0x1a6')});db['DeskConfiguration'][_0xf0ef('0x10f')](db[_0xf0ef('0x156')],{'through':_0xf0ef('0x1ad')});db[_0xf0ef('0xb0')][_0xf0ef('0x101')](db[_0xf0ef('0xb0')],{'as':_0xf0ef('0x1a7'),'foreignKey':_0xf0ef('0x1a2')});db['DeskField']['hasMany'](db[_0xf0ef('0xb0')],{'as':_0xf0ef('0x1a8'),'foreignKey':_0xf0ef('0x1a4')});db['DeskField'][_0xf0ef('0x101')](db[_0xf0ef('0xb0')],{'as':_0xf0ef('0x1a9'),'foreignKey':_0xf0ef('0x1a5')});db['DeskField'][_0xf0ef('0x134')](db[_0xf0ef('0x95')],{'as':'Variable','foreignKey':_0xf0ef('0x1aa')});db[_0xf0ef('0x1ae')][_0xf0ef('0x101')](db[_0xf0ef('0x1af')],{'as':_0xf0ef('0x1a0'),'onDelete':_0xf0ef('0x105'),'foreignKey':_0xf0ef('0x1a6')});db[_0xf0ef('0x1af')][_0xf0ef('0x101')](db['ZohoField'],{'as':_0xf0ef('0x1a1'),'onDelete':_0xf0ef('0x105'),'foreignKey':_0xf0ef('0x1a2')});db['ZohoConfiguration'][_0xf0ef('0x101')](db['ZohoField'],{'as':_0xf0ef('0x1a3'),'onDelete':_0xf0ef('0x105'),'foreignKey':_0xf0ef('0x1a4')});db[_0xf0ef('0x1af')][_0xf0ef('0x101')](db[_0xf0ef('0xb3')],{'as':_0xf0ef('0x19e'),'onDelete':'cascade','foreignKey':'FieldId'});db[_0xf0ef('0x1af')][_0xf0ef('0x134')](db[_0xf0ef('0x1ae')],{'as':_0xf0ef('0x164'),'foreignKey':_0xf0ef('0x1a6')});db[_0xf0ef('0xb3')][_0xf0ef('0x101')](db[_0xf0ef('0xb3')],{'as':_0xf0ef('0x1a7'),'foreignKey':'SubjectId'});db[_0xf0ef('0xb3')][_0xf0ef('0x101')](db[_0xf0ef('0xb3')],{'as':_0xf0ef('0x1a8'),'foreignKey':_0xf0ef('0x1a4')});db[_0xf0ef('0xb3')]['hasMany'](db[_0xf0ef('0xb3')],{'as':_0xf0ef('0x1a9'),'foreignKey':_0xf0ef('0x1a5')});db[_0xf0ef('0xb3')][_0xf0ef('0x134')](db[_0xf0ef('0x95')],{'as':_0xf0ef('0x95'),'foreignKey':'VariableId'});db[_0xf0ef('0xb5')][_0xf0ef('0x101')](db[_0xf0ef('0xb7')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0xf0ef('0x1a6')});db[_0xf0ef('0xb7')][_0xf0ef('0x101')](db['ZendeskField'],{'as':'Subjects','foreignKey':'SubjectId'});db['ZendeskConfiguration'][_0xf0ef('0x101')](db[_0xf0ef('0xb8')],{'as':_0xf0ef('0x1a3'),'foreignKey':'DescriptionId'});db[_0xf0ef('0xb7')][_0xf0ef('0x101')](db[_0xf0ef('0xb8')],{'as':'Fields','foreignKey':_0xf0ef('0x1a5')});db[_0xf0ef('0xb7')][_0xf0ef('0x134')](db[_0xf0ef('0xb5')],{'as':_0xf0ef('0x164'),'foreignKey':'AccountId'});db['ZendeskConfiguration'][_0xf0ef('0x10f')](db[_0xf0ef('0x156')],{'through':_0xf0ef('0x1b0')});db[_0xf0ef('0xb8')][_0xf0ef('0x101')](db['ZendeskField'],{'as':'Subject','foreignKey':_0xf0ef('0x1a2')});db[_0xf0ef('0xb8')][_0xf0ef('0x101')](db[_0xf0ef('0xb8')],{'as':_0xf0ef('0x1a8'),'foreignKey':'DescriptionId'});db[_0xf0ef('0xb8')]['hasMany'](db[_0xf0ef('0xb8')],{'as':_0xf0ef('0x1a9'),'foreignKey':_0xf0ef('0x1a5')});db['ZendeskField'][_0xf0ef('0x134')](db[_0xf0ef('0x95')],{'as':_0xf0ef('0x95'),'foreignKey':'VariableId'});db[_0xf0ef('0xb9')]['hasMany'](db[_0xf0ef('0xbb')],{'as':_0xf0ef('0x1a0'),'onDelete':_0xf0ef('0x105'),'foreignKey':_0xf0ef('0x1a6')});db[_0xf0ef('0xbb')][_0xf0ef('0x101')](db[_0xf0ef('0xbd')],{'as':'Subjects','onDelete':_0xf0ef('0x105'),'foreignKey':'SubjectId'});db[_0xf0ef('0xbb')][_0xf0ef('0x101')](db[_0xf0ef('0xbd')],{'as':'Descriptions','onDelete':_0xf0ef('0x105'),'foreignKey':_0xf0ef('0x1a4')});db[_0xf0ef('0xbb')][_0xf0ef('0x101')](db[_0xf0ef('0xbd')],{'as':_0xf0ef('0x19e'),'onDelete':_0xf0ef('0x105'),'foreignKey':_0xf0ef('0x1a5')});db[_0xf0ef('0xbb')][_0xf0ef('0x134')](db[_0xf0ef('0xb9')],{'as':_0xf0ef('0x164'),'foreignKey':_0xf0ef('0x1a6')});db[_0xf0ef('0xbb')][_0xf0ef('0x10f')](db[_0xf0ef('0x156')],{'through':_0xf0ef('0x1b1')});db[_0xf0ef('0xbd')][_0xf0ef('0x101')](db[_0xf0ef('0xbd')],{'as':_0xf0ef('0x1a7'),'foreignKey':_0xf0ef('0x1a2')});db[_0xf0ef('0xbd')][_0xf0ef('0x101')](db['FreshdeskField'],{'as':_0xf0ef('0x1a8'),'foreignKey':_0xf0ef('0x1a4')});db[_0xf0ef('0xbd')]['hasMany'](db['FreshdeskField'],{'as':_0xf0ef('0x1a9'),'foreignKey':_0xf0ef('0x1a5')});db[_0xf0ef('0xbd')][_0xf0ef('0x134')](db[_0xf0ef('0x95')],{'as':_0xf0ef('0x95'),'foreignKey':'VariableId'});db[_0xf0ef('0xbe')][_0xf0ef('0x101')](db[_0xf0ef('0xbf')],{'as':_0xf0ef('0x1a0'),'onDelete':_0xf0ef('0x105'),'foreignKey':_0xf0ef('0x1a6')});db[_0xf0ef('0xbf')][_0xf0ef('0x101')](db[_0xf0ef('0x1b2')],{'as':_0xf0ef('0x1a1'),'foreignKey':'SubjectId'});db['VtigerConfiguration']['hasMany'](db[_0xf0ef('0x1b2')],{'as':_0xf0ef('0x1a3'),'foreignKey':_0xf0ef('0x1a4')});db['VtigerConfiguration'][_0xf0ef('0x101')](db[_0xf0ef('0x1b2')],{'as':_0xf0ef('0x19e'),'foreignKey':_0xf0ef('0x1a5')});db['VtigerConfiguration'][_0xf0ef('0x134')](db[_0xf0ef('0xbe')],{'as':'Account','foreignKey':_0xf0ef('0x1a6')});db[_0xf0ef('0x1b2')][_0xf0ef('0x101')](db[_0xf0ef('0x1b2')],{'as':_0xf0ef('0x1a7'),'foreignKey':_0xf0ef('0x1a2')});db[_0xf0ef('0x1b2')][_0xf0ef('0x101')](db[_0xf0ef('0x1b2')],{'as':_0xf0ef('0x1a8'),'foreignKey':'DescriptionId'});db[_0xf0ef('0x1b2')][_0xf0ef('0x101')](db['VtigerField'],{'as':_0xf0ef('0x1a9'),'foreignKey':_0xf0ef('0x1a5')});db[_0xf0ef('0x1b2')][_0xf0ef('0x134')](db[_0xf0ef('0x95')],{'as':_0xf0ef('0x95'),'foreignKey':_0xf0ef('0x1aa')});db[_0xf0ef('0xc1')][_0xf0ef('0x101')](db[_0xf0ef('0xc3')],{'as':_0xf0ef('0x1a0'),'onDelete':_0xf0ef('0x105'),'foreignKey':'AccountId'});db[_0xf0ef('0xc3')][_0xf0ef('0x101')](db[_0xf0ef('0xc5')],{'as':'Subjects','foreignKey':_0xf0ef('0x1a2')});db['ServicenowConfiguration'][_0xf0ef('0x101')](db[_0xf0ef('0xc5')],{'as':'Descriptions','foreignKey':_0xf0ef('0x1a4')});db['ServicenowConfiguration'][_0xf0ef('0x101')](db['ServicenowField'],{'as':_0xf0ef('0x19e'),'foreignKey':'FieldId'});db['ServicenowConfiguration'][_0xf0ef('0x134')](db[_0xf0ef('0xc1')],{'as':_0xf0ef('0x164'),'foreignKey':'AccountId'});db[_0xf0ef('0xc5')]['hasMany'](db['ServicenowField'],{'as':_0xf0ef('0x1a7'),'foreignKey':_0xf0ef('0x1a2')});db[_0xf0ef('0xc5')][_0xf0ef('0x101')](db[_0xf0ef('0xc5')],{'as':_0xf0ef('0x1a8'),'foreignKey':_0xf0ef('0x1a4')});db['ServicenowField'][_0xf0ef('0x101')](db[_0xf0ef('0xc5')],{'as':_0xf0ef('0x1a9'),'foreignKey':_0xf0ef('0x1a5')});db[_0xf0ef('0xc5')][_0xf0ef('0x134')](db[_0xf0ef('0x95')],{'as':_0xf0ef('0x95'),'foreignKey':'VariableId'});db[_0xf0ef('0x1b3')][_0xf0ef('0x101')](db[_0xf0ef('0xc8')],{'as':_0xf0ef('0x1a0'),'onDelete':_0xf0ef('0x105'),'foreignKey':'AccountId'});db[_0xf0ef('0xc8')][_0xf0ef('0x101')](db['Dynamics365Field'],{'as':_0xf0ef('0x1a1'),'onDelete':'cascade','foreignKey':_0xf0ef('0x1a2')});db[_0xf0ef('0xc8')][_0xf0ef('0x101')](db[_0xf0ef('0xca')],{'as':_0xf0ef('0x1a3'),'onDelete':'cascade','foreignKey':_0xf0ef('0x1a4')});db[_0xf0ef('0xc8')][_0xf0ef('0x101')](db['Dynamics365Field'],{'as':'Fields','onDelete':_0xf0ef('0x105'),'foreignKey':_0xf0ef('0x1a5')});db['Dynamics365Configuration'][_0xf0ef('0x134')](db[_0xf0ef('0x1b3')],{'as':'Account','foreignKey':'AccountId'});db['Dynamics365Field'][_0xf0ef('0x101')](db[_0xf0ef('0xca')],{'as':_0xf0ef('0x1a7'),'foreignKey':_0xf0ef('0x1a2')});db[_0xf0ef('0xca')][_0xf0ef('0x101')](db['Dynamics365Field'],{'as':_0xf0ef('0x1a8'),'foreignKey':_0xf0ef('0x1a4')});db[_0xf0ef('0xca')][_0xf0ef('0x101')](db[_0xf0ef('0xca')],{'as':'Field','foreignKey':_0xf0ef('0x1a5')});db[_0xf0ef('0xca')][_0xf0ef('0x134')](db[_0xf0ef('0x95')],{'as':'Variable','foreignKey':_0xf0ef('0x1aa')});db[_0xf0ef('0x1b4')][_0xf0ef('0x101')](db[_0xf0ef('0x1b5')],{'as':'Configurations','onDelete':_0xf0ef('0x105'),'foreignKey':_0xf0ef('0x1a6')});db[_0xf0ef('0x1b5')][_0xf0ef('0x101')](db[_0xf0ef('0x1b6')],{'as':_0xf0ef('0x1a1'),'foreignKey':'SubjectId'});db[_0xf0ef('0x1b5')][_0xf0ef('0x101')](db['FreshsalesField'],{'as':_0xf0ef('0x1a3'),'foreignKey':_0xf0ef('0x1a4')});db[_0xf0ef('0x1b5')][_0xf0ef('0x101')](db[_0xf0ef('0x1b6')],{'as':'Fields','foreignKey':'FieldId'});db[_0xf0ef('0x1b5')]['belongsTo'](db[_0xf0ef('0x1b4')],{'as':_0xf0ef('0x164'),'foreignKey':_0xf0ef('0x1a6')});db[_0xf0ef('0x1b6')]['hasMany'](db[_0xf0ef('0x1b6')],{'as':_0xf0ef('0x1a7'),'foreignKey':'SubjectId'});db[_0xf0ef('0x1b6')][_0xf0ef('0x101')](db[_0xf0ef('0x1b6')],{'as':_0xf0ef('0x1a8'),'foreignKey':_0xf0ef('0x1a4')});db[_0xf0ef('0x1b6')][_0xf0ef('0x101')](db[_0xf0ef('0x1b6')],{'as':_0xf0ef('0x1a9'),'foreignKey':_0xf0ef('0x1a5')});db[_0xf0ef('0x1b6')][_0xf0ef('0x134')](db[_0xf0ef('0x95')],{'as':'Variable','foreignKey':_0xf0ef('0x1aa')});db['ChatQueueReport'][_0xf0ef('0x134')](db[_0xf0ef('0x66')],{});db['ChatQueueReport']['belongsTo'](db[_0xf0ef('0x112')],{'as':_0xf0ef('0x161'),'foreignKey':_0xf0ef('0x151')});db[_0xf0ef('0xd0')][_0xf0ef('0x134')](db[_0xf0ef('0x75')],{'as':_0xf0ef('0x148'),'foreignKey':_0xf0ef('0x149')});db[_0xf0ef('0xd0')][_0xf0ef('0x134')](db['ChatInteraction'],{});db[_0xf0ef('0xd0')][_0xf0ef('0x134')](db[_0xf0ef('0x179')],{});db['ChatQueueReport'][_0xf0ef('0x134')](db[_0xf0ef('0x14')],{});db[_0xf0ef('0xd0')][_0xf0ef('0x134')](db[_0xf0ef('0x6e')],{});db['ChatInternalMessage'][_0xf0ef('0x134')](db[_0xf0ef('0x14')],{'onDelete':_0xf0ef('0x105'),'foreignKey':_0xf0ef('0x1b7')});db[_0xf0ef('0xd2')][_0xf0ef('0x134')](db[_0xf0ef('0x14')],{'onDelete':_0xf0ef('0x105'),'foreignKey':_0xf0ef('0x1b8')});db[_0xf0ef('0xd8')]['hasMany'](db[_0xf0ef('0xd6')],{'foreignKey':_0xf0ef('0x1b9'),'onDelete':_0xf0ef('0x105')});db[_0xf0ef('0xd8')]['hasMany'](db[_0xf0ef('0xd4')],{'foreignKey':'SessionId','onDelete':_0xf0ef('0x105')});db['SmsQueueReport'][_0xf0ef('0x134')](db[_0xf0ef('0x56')],{});db[_0xf0ef('0xda')][_0xf0ef('0x134')](db[_0xf0ef('0x112')],{'as':_0xf0ef('0x161'),'foreignKey':_0xf0ef('0x151')});db['SmsQueueReport'][_0xf0ef('0x134')](db[_0xf0ef('0x75')],{'as':'Contact','foreignKey':_0xf0ef('0x149')});db[_0xf0ef('0xda')][_0xf0ef('0x134')](db[_0xf0ef('0x10b')],{});db[_0xf0ef('0xda')]['belongsTo'](db[_0xf0ef('0x5b')],{});db[_0xf0ef('0xda')]['belongsTo'](db['User'],{});db[_0xf0ef('0xda')][_0xf0ef('0x134')](db['SmsQueue'],{});db[_0xf0ef('0xde')][_0xf0ef('0x101')](db[_0xf0ef('0xd8')],{'foreignKey':_0xf0ef('0x1ba')});db[_0xf0ef('0xde')][_0xf0ef('0x101')](db[_0xf0ef('0xd6')],{'foreignKey':_0xf0ef('0x1ba')});db[_0xf0ef('0xde')][_0xf0ef('0x101')](db[_0xf0ef('0xd4')],{'foreignKey':_0xf0ef('0x1ba')});db[_0xf0ef('0xe1')][_0xf0ef('0x10f')](db[_0xf0ef('0x14')],{'as':'Users','through':_0xf0ef('0x129')});db[_0xf0ef('0xe7')]['belongsToMany'](db[_0xf0ef('0x14')],{'as':_0xf0ef('0x13d'),'through':_0xf0ef('0x114')});db['Team']['belongsToMany'](db[_0xf0ef('0x1d')],{'through':_0xf0ef('0x13f'),'as':_0xf0ef('0x118')});db[_0xf0ef('0xe7')]['belongsToMany'](db[_0xf0ef('0x42')],{'through':_0xf0ef('0x153'),'as':_0xf0ef('0x119')});db[_0xf0ef('0xe7')][_0xf0ef('0x10f')](db[_0xf0ef('0x6e')],{'through':_0xf0ef('0x17c'),'as':_0xf0ef('0x11a')});db[_0xf0ef('0xe7')][_0xf0ef('0x10f')](db[_0xf0ef('0x11b')],{'through':_0xf0ef('0x1bb'),'as':'FaxQueues'});db[_0xf0ef('0xe7')]['belongsToMany'](db['SmsQueue'],{'through':_0xf0ef('0x16c'),'as':_0xf0ef('0x1bc')});db[_0xf0ef('0xe7')][_0xf0ef('0x10f')](db[_0xf0ef('0x65')],{'through':_0xf0ef('0x173'),'as':_0xf0ef('0x1bd')});db['Campaign'][_0xf0ef('0x101')](db[_0xf0ef('0x77')],{'as':'Hoppers','foreignKey':_0xf0ef('0x185')});db['Campaign'][_0xf0ef('0x101')](db[_0xf0ef('0x79')],{'as':'HopperFinals','foreignKey':_0xf0ef('0x185')});db[_0xf0ef('0x184')][_0xf0ef('0x101')](db[_0xf0ef('0x7b')],{'as':_0xf0ef('0x131'),'foreignKey':'CampaignId'});db['Campaign'][_0xf0ef('0x101')](db[_0xf0ef('0x132')],{'as':'HopperBlacks','foreignKey':'CampaignId'});db[_0xf0ef('0x184')][_0xf0ef('0x134')](db['Trunk'],{'as':_0xf0ef('0x135'),'foreignKey':_0xf0ef('0x136')});db[_0xf0ef('0x184')]['belongsTo'](db[_0xf0ef('0x135')],{'as':_0xf0ef('0x137'),'foreignKey':_0xf0ef('0x1be')});db[_0xf0ef('0x184')][_0xf0ef('0x134')](db[_0xf0ef('0x138')],{'as':_0xf0ef('0x138'),'foreignKey':_0xf0ef('0x139')});db[_0xf0ef('0x184')]['belongsTo'](db['SquareProject'],{'as':'SquareProject','foreignKey':_0xf0ef('0x1bf')});db[_0xf0ef('0x184')][_0xf0ef('0x10f')](db[_0xf0ef('0x112')],{'as':_0xf0ef('0x113'),'through':_0xf0ef('0x1c0')});db[_0xf0ef('0x184')][_0xf0ef('0x10f')](db['CmList'],{'as':_0xf0ef('0x140'),'through':_0xf0ef('0x1c1')});db[_0xf0ef('0xef')]['belongsTo'](db[_0xf0ef('0x15b')],{});db[_0xf0ef('0xef')][_0xf0ef('0x134')](db['MailInteraction'],{});db[_0xf0ef('0xef')]['belongsTo'](db['MailAccount'],{'foreignKey':_0xf0ef('0x1c2'),'as':_0xf0ef('0x1c3')});db['MailTransferReport'][_0xf0ef('0x134')](db[_0xf0ef('0x14')],{'foreignKey':_0xf0ef('0x1c4'),'as':_0xf0ef('0x1c5')});db['MailTransferReport'][_0xf0ef('0x134')](db['User'],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0xf0ef('0xef')][_0xf0ef('0x134')](db[_0xf0ef('0x42')],{'foreignKey':_0xf0ef('0x1c6'),'as':_0xf0ef('0x1c7')});db['MailTransferReport']['belongsTo'](db[_0xf0ef('0x40')],{'foreignKey':_0xf0ef('0x1c8'),'as':'ToAccount'});db['ChatTransferReport'][_0xf0ef('0x134')](db[_0xf0ef('0x179')],{});db[_0xf0ef('0xf1')][_0xf0ef('0x134')](db['ChatInteraction'],{});db[_0xf0ef('0xf1')][_0xf0ef('0x134')](db[_0xf0ef('0x66')],{'foreignKey':'FromChatWebsiteId','as':'FromAccount'});db[_0xf0ef('0xf1')]['belongsTo'](db['User'],{'foreignKey':_0xf0ef('0x1c4'),'as':_0xf0ef('0x1c5')});db[_0xf0ef('0xf1')][_0xf0ef('0x134')](db[_0xf0ef('0x14')],{'foreignKey':_0xf0ef('0x1c9'),'as':'ToAgent'});db[_0xf0ef('0xf1')]['belongsTo'](db[_0xf0ef('0x6e')],{'foreignKey':_0xf0ef('0x1ca'),'as':'ToQueue'});db[_0xf0ef('0xf1')]['belongsTo'](db[_0xf0ef('0x66')],{'foreignKey':_0xf0ef('0x1cb'),'as':'ToAccount'});db[_0xf0ef('0xf3')][_0xf0ef('0x134')](db[_0xf0ef('0x51')],{});db[_0xf0ef('0xf3')]['belongsTo'](db[_0xf0ef('0x4f')],{});db['FaxTransferReport'][_0xf0ef('0x134')](db[_0xf0ef('0x4c')],{'foreignKey':_0xf0ef('0x1cc'),'as':_0xf0ef('0x1c3')});db[_0xf0ef('0xf3')][_0xf0ef('0x134')](db[_0xf0ef('0x14')],{'foreignKey':_0xf0ef('0x1c4'),'as':_0xf0ef('0x1c5')});db[_0xf0ef('0xf3')][_0xf0ef('0x134')](db[_0xf0ef('0x14')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0xf0ef('0xf3')]['belongsTo'](db[_0xf0ef('0x11b')],{'foreignKey':'ToFaxQueueId','as':_0xf0ef('0x1c7')});db['FaxTransferReport'][_0xf0ef('0x134')](db[_0xf0ef('0x4c')],{'foreignKey':'ToFaxAccountId','as':_0xf0ef('0x1cd')});db[_0xf0ef('0xf5')][_0xf0ef('0x134')](db[_0xf0ef('0x63')],{});db['OpenchannelTransferReport'][_0xf0ef('0x134')](db[_0xf0ef('0x108')],{});db[_0xf0ef('0xf5')][_0xf0ef('0x134')](db[_0xf0ef('0x125')],{'foreignKey':_0xf0ef('0x1ce'),'as':_0xf0ef('0x1c3')});db[_0xf0ef('0xf5')][_0xf0ef('0x134')](db[_0xf0ef('0x14')],{'foreignKey':'FromUserId','as':'FromAgent'});db['OpenchannelTransferReport'][_0xf0ef('0x134')](db['User'],{'foreignKey':'ToUserId','as':_0xf0ef('0x1cf')});db['OpenchannelTransferReport']['belongsTo'](db['OpenchannelQueue'],{'foreignKey':_0xf0ef('0x1d0'),'as':_0xf0ef('0x1c7')});db[_0xf0ef('0xf5')][_0xf0ef('0x134')](db['OpenchannelAccount'],{'foreignKey':_0xf0ef('0x1d1'),'as':_0xf0ef('0x1cd')});db['SmsTransferReport']['belongsTo'](db[_0xf0ef('0x5b')],{});db['SmsTransferReport'][_0xf0ef('0x134')](db[_0xf0ef('0x10b')],{});db['SmsTransferReport'][_0xf0ef('0x134')](db[_0xf0ef('0x56')],{'foreignKey':_0xf0ef('0x1d2'),'as':_0xf0ef('0x1c3')});db[_0xf0ef('0xf7')][_0xf0ef('0x134')](db[_0xf0ef('0x14')],{'foreignKey':_0xf0ef('0x1c4'),'as':'FromAgent'});db[_0xf0ef('0xf7')]['belongsTo'](db[_0xf0ef('0x14')],{'foreignKey':_0xf0ef('0x1c9'),'as':_0xf0ef('0x1cf')});db[_0xf0ef('0xf7')]['belongsTo'](db[_0xf0ef('0x5d')],{'foreignKey':'ToSmsQueueId','as':_0xf0ef('0x1c7')});db['SmsTransferReport'][_0xf0ef('0x134')](db[_0xf0ef('0x56')],{'foreignKey':_0xf0ef('0x1d3'),'as':_0xf0ef('0x1cd')});db[_0xf0ef('0x112')][_0xf0ef('0x101')](db[_0xf0ef('0x86')],{'as':_0xf0ef('0x14e'),'foreignKey':_0xf0ef('0x151')});db[_0xf0ef('0x112')][_0xf0ef('0x101')](db[_0xf0ef('0x7f')],{'as':_0xf0ef('0x1d4'),'foreignKey':'ListId'});db[_0xf0ef('0x112')][_0xf0ef('0x101')](db[_0xf0ef('0x75')],{'as':_0xf0ef('0x110'),'onDelete':_0xf0ef('0x105'),'foreignKey':_0xf0ef('0x151')});db[_0xf0ef('0x112')][_0xf0ef('0x101')](db['CmHopperFinal'],{'as':_0xf0ef('0x106'),'foreignKey':_0xf0ef('0x151')});db[_0xf0ef('0x112')][_0xf0ef('0x101')](db['CmHopperHistory'],{'as':_0xf0ef('0x107'),'foreignKey':_0xf0ef('0x151')});db[_0xf0ef('0x112')][_0xf0ef('0x101')](db[_0xf0ef('0x7d')],{'as':_0xf0ef('0x7d'),'foreignKey':_0xf0ef('0x151')});db[_0xf0ef('0x112')]['belongsToMany'](db['VoiceQueue'],{'as':_0xf0ef('0x1d5'),'through':_0xf0ef('0x13c')});db['CmList']['belongsToMany'](db[_0xf0ef('0x14')],{'as':_0xf0ef('0x13d'),'through':_0xf0ef('0x11d')});db[_0xf0ef('0xf9')][_0xf0ef('0x101')](db[_0xf0ef('0x1a')],{'as':_0xf0ef('0x18f'),'onDelete':'restrict'});db['VoicePrefix'][_0xf0ef('0x10f')](db[_0xf0ef('0x14')],{'as':_0xf0ef('0x13d'),'through':_0xf0ef('0x11f')});db[_0xf0ef('0xfb')]['hasMany'](db[_0xf0ef('0x14')],{'as':_0xf0ef('0x159'),'foreignKey':_0xf0ef('0x1d6')});db['UserProfile']['hasMany'](db[_0xf0ef('0x1d7')],{'as':_0xf0ef('0x1d8'),'foreignKey':_0xf0ef('0x1d6'),'onDelete':'cascade'});db[_0xf0ef('0x1d7')][_0xf0ef('0x101')](db[_0xf0ef('0xfd')],{'as':_0xf0ef('0x1d9'),'foreignKey':_0xf0ef('0x1da'),'onDelete':_0xf0ef('0x105')});module[_0xf0ef('0x1db')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0xbccd=['VoiceExtension','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','../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','MemberReport','Trunk','../api/trunk/trunk.model','VoiceTransferReport','UserVoiceQueueRt','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','../api/userOpenchannelQueue/userOpenchannelQueue.model','../api/mailServerIn/mailServerIn.model','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','MailApplication','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','Dashboard','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','FaxQueue','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsApplication','SmsInteraction','SmsMessage','../api/smsMessage/smsMessage.model','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','ChatApplication','../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','ChatProactiveAction','CmCompany','../api/cmCompany/cmCompany.model','CmHopper','CmHopperBlack','CmHopperFinal','../api/cmHopperHistory/cmHopperHistory.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','Automation','../api/automation/automation.model','CannedAnswer','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','../api/template/template.model','Trigger','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','../api/analyticMetric/analyticMetric.model','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','SugarcrmField','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','ZohoField','ZendeskAccount','../api/intZendeskConfiguration/intZendeskConfiguration.model','../api/intZendeskField/intZendeskField.model','../api/intFreshdeskAccount/intFreshdeskAccount.model','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareDetailsReport','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','SquareRecording','../api/squareRecording/squareRecording.model','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','../api/license/license.model','Campaign','../api/campaign/campaign.model','Attachment','../api/attachment/attachment.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','../api/cmList/cmList.model','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','User','VoiceMail','cascade','UserId','hasMany','Recordings','VoiceQueuesRt','Extensions','HopperFinals','CmHopperHistory','HopperHistory','ReportAgentPreview','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteraction','FaxInteractions','belongsTo','userProfileId','belongsToMany','CmContact','Contacts','cm_user_has_contacts','Lists','user_has_teams','MailInteractions','user_has_mail_interactions','user_has_fax_interactions','user_has_sms_interactions','VoiceQueues','UserVoiceQueue','ChatQueues','FaxQueues','SmsQueue','SmsQueues','UserSmsQueue','OpenchannelQueue','UserOpenchannelQueue','VoicePrefix','VoicePrefixes','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','SmsAccount','user_has_sms_accounts','user_has_square_projects','SpiedAgents','ChanSpyId','moh_has_sounds','VoiceQueue','VoiceQueueId','Hoppers','JscriptySessions','TrunkId','IntervalId','Pause','mandatoryDispositionPause','mandatoryDispositionPauseId','Teams','team_has_voice_queues','BlackLists','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','QueueCalls','uniqueid','AgentReports','Contact','MailAccountId','MailServerOut','hasOne','MailServerIn','Imap','Smtp','Answers','Interactions','Applications','ListId','Template','TemplateId','Agents','team_has_mail_queues','MailInteractionId','Account','mail_interaction_has_tags','Tags','ThroughTags','restrict','TagId','MailQueueReport','List','ContactId','Items','Dispositions','FaxAccountId','FaxMessage','FaxApplication','FaxInteractionId','Owner','fax_interaction_has_tags','Interaction','team_has_fax_queues','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','Users','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','user_has_openchannel_interactions','AttachmentId','ChatWebsiteId','ProactiveActions','OpenchannelQueueReport','Agent','Queue','ChatQueueId','ChatInteractionId','chat_interaction_has_tags','ChatGroupId','chat_group_has_users','Company','CompanyId','cm_contact_has_tags','OwnerId','CampaignId','All','OneAll','Any','OneAny','AutomationAnyId','AutomationId','Intervals','MailApplications','ChatApplications','FaxApplications','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','Actions','TriggerId','AnalyticFieldReport','Fields','CustomReportId','DefaultReportId','AnalyticMetric','MetricId','SalesforceAccount','AccountId','Subjects','SubjectId','Descriptions','DescriptionId','Subject','Field','FieldId','VariableId','Configurations','Description','DeskAccount','int_desk_configuration_has_tags','ZendeskConfiguration','ZendeskField','int_zendesk_configuration_has_tags','FreshdeskAccount','FreshdeskConfiguration','VtigerConfiguration','ServicenowAccount','Dynamics365Account','Dynamics365Field','FreshsalesConfiguration','FreshsalesField','FromId','ToId','SessionId','ProjectId','team_has_chat_queues','team_has_openchannel_queues','OpenchannelQueues','HopperHistories','HopperBlacks','TrunkBackup','TrunkBackupId','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromUserId','FromAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','FromChatWebsiteId','FromAccount','ToUserId','ToAgent','FromFaxAccountId','ToFaxAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','ToSmsQueueId','CustomFields','Queues','voice_queues_has_cm_lists','cm_user_has_lists','user_has_voice_prefixes','UserProfileSections','UserProfileResource','Resources','sectionId','exports','path','lodash','jstz','determine','sequelize','defaultsDeep','xcall','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','database','username','options','password','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model'];(function(_0x59c907,_0x164eb9){var _0x27cb0e=function(_0x46e89a){while(--_0x46e89a){_0x59c907['push'](_0x59c907['shift']());}};_0x27cb0e(++_0x164eb9);}(_0xbccd,0x1b0));var _0xdbcc=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0xbccd[_0x279d37];return _0x530173;};'use strict';var path=require(_0xdbcc('0x0'));var config=require('../config/environment');var Sequelize=require('sequelize');var _=require(_0xdbcc('0x1'));var jstz=require(_0xdbcc('0x2'));var timezone=jstz[_0xdbcc('0x3')]();config[_0xdbcc('0x4')]=_[_0xdbcc('0x5')](config[_0xdbcc('0x4')],{'database':'motion2','username':_0xdbcc('0x6'),'password':_0xdbcc('0x7'),'options':{'host':_0xdbcc('0x8'),'port':0xcea,'dialect':_0xdbcc('0x9'),'dialectOptions':{'charset':_0xdbcc('0xa')},'logging':![],'timezone':timezone[_0xdbcc('0xb')](),'define':{'charset':_0xdbcc('0xc'),'collate':_0xdbcc('0xd')}}});config[_0xdbcc('0xe')]=_[_0xdbcc('0x5')](config[_0xdbcc('0xe')],{'database':'motion2','username':'xcall','password':_0xdbcc('0x7'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0xdbcc('0x9'),'dialectOptions':{'charset':_0xdbcc('0xa')},'logging':![],'timezone':timezone[_0xdbcc('0xb')](),'define':{'charset':_0xdbcc('0xc'),'collate':_0xdbcc('0xd')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xdbcc('0x4')][_0xdbcc('0xf')],config['sequelize'][_0xdbcc('0x10')],config['sequelize']['password'],config['sequelize'][_0xdbcc('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xdbcc('0xe')][_0xdbcc('0xf')],config[_0xdbcc('0xe')][_0xdbcc('0x10')],config[_0xdbcc('0xe')][_0xdbcc('0x12')],config[_0xdbcc('0xe')]['options'])};db['User']=db[_0xdbcc('0x4')][_0xdbcc('0x13')](_0xdbcc('0x14'));db[_0xdbcc('0x15')]=db[_0xdbcc('0x4')][_0xdbcc('0x13')](_0xdbcc('0x16'));db[_0xdbcc('0x17')]=db[_0xdbcc('0x4')][_0xdbcc('0x13')](_0xdbcc('0x18'));db[_0xdbcc('0x19')]=db[_0xdbcc('0x4')]['import']('../api/voiceExtension/voiceExtension.model');db[_0xdbcc('0x1a')]=db[_0xdbcc('0x4')]['import'](_0xdbcc('0x1b'));db['VoiceQueue']=db[_0xdbcc('0x4')]['import']('../api/voiceQueue/voiceQueue.model');db[_0xdbcc('0x1c')]=db[_0xdbcc('0x4')][_0xdbcc('0x13')](_0xdbcc('0x1d'));db[_0xdbcc('0x1e')]=db[_0xdbcc('0x4')][_0xdbcc('0x13')](_0xdbcc('0x1f'));db['VoiceMail']=db[_0xdbcc('0x4')]['import'](_0xdbcc('0x20'));db[_0xdbcc('0x21')]=db['sequelize'][_0xdbcc('0x13')](_0xdbcc('0x22'));db[_0xdbcc('0x23')]=db['sequelize']['import'](_0xdbcc('0x24'));db[_0xdbcc('0x25')]=db[_0xdbcc('0x4')]['import'](_0xdbcc('0x26'));db[_0xdbcc('0x27')]=db['sequelize'][_0xdbcc('0x13')](_0xdbcc('0x28'));db[_0xdbcc('0x29')]=db['sequelize'][_0xdbcc('0x13')]('../api/voiceQueueReport/voiceQueueReport.model');db[_0xdbcc('0x2a')]=db['sequelize'][_0xdbcc('0x13')]('../api/memberReport/memberReport.model');db[_0xdbcc('0x2b')]=db[_0xdbcc('0x4')][_0xdbcc('0x13')](_0xdbcc('0x2c'));db[_0xdbcc('0x2d')]=db[_0xdbcc('0x4')][_0xdbcc('0x13')]('../api/voiceTransferReport/voiceTransferReport.model');db[_0xdbcc('0x2e')]=db['sequelize'][_0xdbcc('0x13')]('../api/userVoiceQueueRt/userVoiceQueueRt.model');db['UserVoiceQueue']=db[_0xdbcc('0x4')][_0xdbcc('0x13')]('../api/userVoiceQueue/userVoiceQueue.model');db[_0xdbcc('0x2f')]=db['sequelize'][_0xdbcc('0x13')](_0xdbcc('0x30'));db[_0xdbcc('0x31')]=db[_0xdbcc('0x4')][_0xdbcc('0x13')]('../api/userMailQueue/userMailQueue.model');db[_0xdbcc('0x32')]=db[_0xdbcc('0x4')][_0xdbcc('0x13')](_0xdbcc('0x33'));db['UserSmsQueue']=db['sequelize'][_0xdbcc('0x13')]('../api/userSmsQueue/userSmsQueue.model');db['UserOpenchannelQueue']=db[_0xdbcc('0x4')][_0xdbcc('0x13')](_0xdbcc('0x34'));db['MailServerIn']=db['sequelize'][_0xdbcc('0x13')](_0xdbcc('0x35'));db['MailServerOut']=db['sequelize'][_0xdbcc('0x13')](_0xdbcc('0x36'));db[_0xdbcc('0x37')]=db[_0xdbcc('0x4')][_0xdbcc('0x13')](_0xdbcc('0x38'));db[_0xdbcc('0x39')]=db['sequelize'][_0xdbcc('0x13')]('../api/mailQueue/mailQueue.model');db[_0xdbcc('0x3a')]=db[_0xdbcc('0x4')]['import'](_0xdbcc('0x3b'));db[_0xdbcc('0x3c')]=db[_0xdbcc('0x4')][_0xdbcc('0x13')](_0xdbcc('0x3d'));db[_0xdbcc('0x3e')]=db[_0xdbcc('0x4')][_0xdbcc('0x13')]('../api/mailMessage/mailMessage.model');db[_0xdbcc('0x3f')]=db[_0xdbcc('0x4')][_0xdbcc('0x13')](_0xdbcc('0x40'));db['MailQueueReport']=db[_0xdbcc('0x4')][_0xdbcc('0x13')](_0xdbcc('0x41'));db[_0xdbcc('0x42')]=db[_0xdbcc('0x4')][_0xdbcc('0x13')]('../api/dashboard/dashboard.model');db[_0xdbcc('0x43')]=db['sequelize']['import'](_0xdbcc('0x44'));db[_0xdbcc('0x45')]=db[_0xdbcc('0x4')]['import'](_0xdbcc('0x46'));db['FaxApplication']=db[_0xdbcc('0x4')][_0xdbcc('0x13')](_0xdbcc('0x47'));db['FaxInteraction']=db[_0xdbcc('0x4')][_0xdbcc('0x13')](_0xdbcc('0x48'));db['FaxMessage']=db[_0xdbcc('0x4')][_0xdbcc('0x13')]('../api/faxMessage/faxMessage.model');db[_0xdbcc('0x49')]=db[_0xdbcc('0x4')][_0xdbcc('0x13')]('../api/faxQueue/faxQueue.model');db[_0xdbcc('0x4a')]=db[_0xdbcc('0x4')][_0xdbcc('0x13')](_0xdbcc('0x4b'));db['SmsAccount']=db[_0xdbcc('0x4')][_0xdbcc('0x13')]('../api/smsAccount/smsAccount.model');db[_0xdbcc('0x4c')]=db[_0xdbcc('0x4')][_0xdbcc('0x13')]('../api/smsApplication/smsApplication.model');db[_0xdbcc('0x4d')]=db[_0xdbcc('0x4')][_0xdbcc('0x13')]('../api/smsInteraction/smsInteraction.model');db[_0xdbcc('0x4e')]=db[_0xdbcc('0x4')][_0xdbcc('0x13')](_0xdbcc('0x4f'));db['SmsQueue']=db['sequelize'][_0xdbcc('0x13')](_0xdbcc('0x50'));db[_0xdbcc('0x51')]=db['sequelize'][_0xdbcc('0x13')](_0xdbcc('0x52'));db[_0xdbcc('0x53')]=db[_0xdbcc('0x4')]['import'](_0xdbcc('0x54'));db[_0xdbcc('0x55')]=db[_0xdbcc('0x4')][_0xdbcc('0x13')](_0xdbcc('0x56'));db[_0xdbcc('0x57')]=db['sequelize']['import'](_0xdbcc('0x58'));db['OpenchannelQueue']=db[_0xdbcc('0x4')]['import']('../api/openchannelQueue/openchannelQueue.model');db[_0xdbcc('0x59')]=db['sequelize'][_0xdbcc('0x13')](_0xdbcc('0x5a'));db['OpenchannelQueueReport']=db[_0xdbcc('0x4')][_0xdbcc('0x13')]('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0xdbcc('0x5b')]=db[_0xdbcc('0x4')][_0xdbcc('0x13')](_0xdbcc('0x5c'));db[_0xdbcc('0x5d')]=db[_0xdbcc('0x4')][_0xdbcc('0x13')](_0xdbcc('0x5e'));db[_0xdbcc('0x5f')]=db['sequelize'][_0xdbcc('0x13')](_0xdbcc('0x60'));db[_0xdbcc('0x61')]=db['sequelize'][_0xdbcc('0x13')](_0xdbcc('0x62'));db[_0xdbcc('0x63')]=db[_0xdbcc('0x4')]['import'](_0xdbcc('0x64'));db[_0xdbcc('0x65')]=db['sequelize'][_0xdbcc('0x13')](_0xdbcc('0x66'));db[_0xdbcc('0x67')]=db[_0xdbcc('0x4')][_0xdbcc('0x13')]('../api/chatProactiveAction/chatProactiveAction.model');db[_0xdbcc('0x68')]=db[_0xdbcc('0x4')]['import'](_0xdbcc('0x69'));db['CmContact']=db['sequelize'][_0xdbcc('0x13')]('../api/cmContact/cmContact.model');db[_0xdbcc('0x6a')]=db[_0xdbcc('0x4')]['import']('../api/cmHopper/cmHopper.model');db[_0xdbcc('0x6b')]=db[_0xdbcc('0x4')][_0xdbcc('0x13')]('../api/cmHopperBlack/cmHopperBlack.model');db[_0xdbcc('0x6c')]=db['sequelize'][_0xdbcc('0x13')]('../api/cmHopperFinal/cmHopperFinal.model');db['CmHopperHistory']=db['sequelize'][_0xdbcc('0x13')](_0xdbcc('0x6d'));db['ReportAgentPreview']=db[_0xdbcc('0x4')][_0xdbcc('0x13')]('../api/reportAgentPreview/reportAgentPreview.model');db[_0xdbcc('0x6e')]=db[_0xdbcc('0x4')][_0xdbcc('0x13')](_0xdbcc('0x6f'));db[_0xdbcc('0x70')]=db[_0xdbcc('0x4')][_0xdbcc('0x13')]('../api/action/action.model');db[_0xdbcc('0x71')]=db[_0xdbcc('0x4')][_0xdbcc('0x13')](_0xdbcc('0x72'));db[_0xdbcc('0x73')]=db[_0xdbcc('0x4')][_0xdbcc('0x13')]('../api/cannedAnswer/cannedAnswer.model');db[_0xdbcc('0x74')]=db['sequelize'][_0xdbcc('0x13')](_0xdbcc('0x75'));db[_0xdbcc('0x76')]=db[_0xdbcc('0x4')][_0xdbcc('0x13')](_0xdbcc('0x77'));db[_0xdbcc('0x78')]=db[_0xdbcc('0x4')][_0xdbcc('0x13')](_0xdbcc('0x79'));db['Pause']=db[_0xdbcc('0x4')][_0xdbcc('0x13')](_0xdbcc('0x7a'));db[_0xdbcc('0x7b')]=db[_0xdbcc('0x4')][_0xdbcc('0x13')](_0xdbcc('0x7c'));db[_0xdbcc('0x7d')]=db['sequelize']['import'](_0xdbcc('0x7e'));db[_0xdbcc('0x7f')]=db[_0xdbcc('0x4')][_0xdbcc('0x13')]('../api/schedule/schedule.model');db[_0xdbcc('0x80')]=db[_0xdbcc('0x4')][_0xdbcc('0x13')](_0xdbcc('0x81'));db[_0xdbcc('0x82')]=db[_0xdbcc('0x4')][_0xdbcc('0x13')](_0xdbcc('0x83'));db['Template']=db[_0xdbcc('0x4')]['import'](_0xdbcc('0x84'));db[_0xdbcc('0x85')]=db[_0xdbcc('0x4')][_0xdbcc('0x13')]('../api/trigger/trigger.model');db[_0xdbcc('0x86')]=db[_0xdbcc('0x4')]['import'](_0xdbcc('0x87'));db[_0xdbcc('0x88')]=db[_0xdbcc('0x4')][_0xdbcc('0x13')](_0xdbcc('0x89'));db[_0xdbcc('0x8a')]=db[_0xdbcc('0x4')]['import'](_0xdbcc('0x8b'));db[_0xdbcc('0x8c')]=db[_0xdbcc('0x4')][_0xdbcc('0x13')]('../api/analyticCustomReport/analyticCustomReport.model');db[_0xdbcc('0x8d')]=db[_0xdbcc('0x4')][_0xdbcc('0x13')](_0xdbcc('0x8e'));db[_0xdbcc('0x8f')]=db[_0xdbcc('0x4')]['import'](_0xdbcc('0x90'));db['AnalyticMetric']=db[_0xdbcc('0x4')][_0xdbcc('0x13')](_0xdbcc('0x91'));db['AnalyticFieldReport']=db[_0xdbcc('0x4')][_0xdbcc('0x13')](_0xdbcc('0x92'));db[_0xdbcc('0x93')]=db[_0xdbcc('0x4')][_0xdbcc('0x13')](_0xdbcc('0x94'));db['SalesforceAccount']=db[_0xdbcc('0x4')][_0xdbcc('0x13')](_0xdbcc('0x95'));db[_0xdbcc('0x96')]=db[_0xdbcc('0x4')][_0xdbcc('0x13')](_0xdbcc('0x97'));db[_0xdbcc('0x98')]=db['sequelize'][_0xdbcc('0x13')](_0xdbcc('0x99'));db[_0xdbcc('0x9a')]=db[_0xdbcc('0x4')][_0xdbcc('0x13')](_0xdbcc('0x9b'));db[_0xdbcc('0x9c')]=db[_0xdbcc('0x4')]['import']('../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model');db[_0xdbcc('0x9d')]=db[_0xdbcc('0x4')][_0xdbcc('0x13')]('../api/intSugarcrmField/intSugarcrmField.model');db['DeskAccount']=db[_0xdbcc('0x4')]['import']('../api/intDeskAccount/intDeskAccount.model');db[_0xdbcc('0x9e')]=db[_0xdbcc('0x4')][_0xdbcc('0x13')](_0xdbcc('0x9f'));db[_0xdbcc('0xa0')]=db[_0xdbcc('0x4')][_0xdbcc('0x13')](_0xdbcc('0xa1'));db[_0xdbcc('0xa2')]=db[_0xdbcc('0x4')]['import'](_0xdbcc('0xa3'));db[_0xdbcc('0xa4')]=db[_0xdbcc('0x4')]['import']('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0xdbcc('0xa5')]=db[_0xdbcc('0x4')]['import']('../api/intZohoField/intZohoField.model');db[_0xdbcc('0xa6')]=db[_0xdbcc('0x4')][_0xdbcc('0x13')]('../api/intZendeskAccount/intZendeskAccount.model');db['ZendeskConfiguration']=db[_0xdbcc('0x4')][_0xdbcc('0x13')](_0xdbcc('0xa7'));db['ZendeskField']=db[_0xdbcc('0x4')][_0xdbcc('0x13')](_0xdbcc('0xa8'));db['FreshdeskAccount']=db[_0xdbcc('0x4')][_0xdbcc('0x13')](_0xdbcc('0xa9'));db['FreshdeskConfiguration']=db['sequelize'][_0xdbcc('0x13')](_0xdbcc('0xaa'));db[_0xdbcc('0xab')]=db[_0xdbcc('0x4')][_0xdbcc('0x13')]('../api/intFreshdeskField/intFreshdeskField.model');db[_0xdbcc('0xac')]=db['sequelize'][_0xdbcc('0x13')](_0xdbcc('0xad'));db['VtigerConfiguration']=db['sequelize'][_0xdbcc('0x13')](_0xdbcc('0xae'));db[_0xdbcc('0xaf')]=db['sequelize'][_0xdbcc('0x13')]('../api/intVtigerField/intVtigerField.model');db['ServicenowAccount']=db[_0xdbcc('0x4')][_0xdbcc('0x13')](_0xdbcc('0xb0'));db[_0xdbcc('0xb1')]=db['sequelize']['import'](_0xdbcc('0xb2'));db[_0xdbcc('0xb3')]=db[_0xdbcc('0x4')][_0xdbcc('0x13')](_0xdbcc('0xb4'));db['Dynamics365Account']=db[_0xdbcc('0x4')][_0xdbcc('0x13')](_0xdbcc('0xb5'));db[_0xdbcc('0xb6')]=db['sequelize'][_0xdbcc('0x13')](_0xdbcc('0xb7'));db['Dynamics365Field']=db['sequelize']['import']('../api/intDynamics365Field/intDynamics365Field.model');db[_0xdbcc('0xb8')]=db[_0xdbcc('0x4')][_0xdbcc('0x13')](_0xdbcc('0xb9'));db['FreshsalesConfiguration']=db['sequelize'][_0xdbcc('0x13')](_0xdbcc('0xba'));db['FreshsalesField']=db[_0xdbcc('0x4')]['import'](_0xdbcc('0xbb'));db[_0xdbcc('0x88')]=db[_0xdbcc('0x4')][_0xdbcc('0x13')](_0xdbcc('0x89'));db[_0xdbcc('0xbc')]=db['sequelize'][_0xdbcc('0x13')](_0xdbcc('0xbd'));db[_0xdbcc('0xbe')]=db[_0xdbcc('0x4')][_0xdbcc('0x13')](_0xdbcc('0xbf'));db[_0xdbcc('0xc0')]=db[_0xdbcc('0x4')]['import']('../api/chatInternalMessage/chatInternalMessage.model');db[_0xdbcc('0xc1')]=db['sequelize'][_0xdbcc('0x13')](_0xdbcc('0xc2'));db[_0xdbcc('0xc3')]=db[_0xdbcc('0x4')]['import'](_0xdbcc('0xc4'));db[_0xdbcc('0xc5')]=db[_0xdbcc('0x4')][_0xdbcc('0x13')](_0xdbcc('0xc6'));db[_0xdbcc('0xc7')]=db[_0xdbcc('0x4')][_0xdbcc('0x13')](_0xdbcc('0xc8'));db['SquareReport']=db[_0xdbcc('0x4')][_0xdbcc('0x13')]('../api/squareReport/squareReport.model');db[_0xdbcc('0xc9')]=db['sequelize'][_0xdbcc('0x13')]('../api/squareReportDetail/squareReportDetail.model');db[_0xdbcc('0xca')]=db[_0xdbcc('0x4')][_0xdbcc('0x13')](_0xdbcc('0xcb'));db[_0xdbcc('0xcc')]=db['sequelize']['import'](_0xdbcc('0xcd'));db[_0xdbcc('0xce')]=db[_0xdbcc('0x4')]['import'](_0xdbcc('0xcf'));db[_0xdbcc('0xd0')]=db[_0xdbcc('0x4')]['import']('../api/squareProject/squareProject.model');db[_0xdbcc('0xd1')]=db[_0xdbcc('0x4')][_0xdbcc('0x13')](_0xdbcc('0xd2'));db['SquareMessage']=db['sequelize'][_0xdbcc('0x13')](_0xdbcc('0xd3'));db[_0xdbcc('0xd4')]=db[_0xdbcc('0x4')][_0xdbcc('0x13')](_0xdbcc('0xd5'));db['License']=db[_0xdbcc('0x4')][_0xdbcc('0x13')](_0xdbcc('0xd6'));db[_0xdbcc('0xd7')]=db[_0xdbcc('0x4')][_0xdbcc('0x13')](_0xdbcc('0xd8'));db['Migration']=db[_0xdbcc('0x4')][_0xdbcc('0x13')]('../api/migration/migration.model');db[_0xdbcc('0xd9')]=db[_0xdbcc('0x4')][_0xdbcc('0x13')](_0xdbcc('0xda'));db['Plugin']=db[_0xdbcc('0x4')][_0xdbcc('0x13')]('../api/plugin/plugin.model');db[_0xdbcc('0xdb')]=db[_0xdbcc('0x4')][_0xdbcc('0x13')](_0xdbcc('0xdc'));db[_0xdbcc('0xdd')]=db['sequelize']['import'](_0xdbcc('0xde'));db[_0xdbcc('0xdf')]=db[_0xdbcc('0x4')][_0xdbcc('0x13')](_0xdbcc('0xe0'));db[_0xdbcc('0xe1')]=db[_0xdbcc('0x4')][_0xdbcc('0x13')](_0xdbcc('0xe2'));db[_0xdbcc('0xe3')]=db[_0xdbcc('0x4')][_0xdbcc('0x13')](_0xdbcc('0xe4'));db[_0xdbcc('0xe5')]=db[_0xdbcc('0x4')][_0xdbcc('0x13')](_0xdbcc('0xe6'));db['VoicePrefix']=db[_0xdbcc('0x4')][_0xdbcc('0x13')](_0xdbcc('0xe7'));db[_0xdbcc('0xe8')]=db['sequelize'][_0xdbcc('0x13')](_0xdbcc('0xe9'));db[_0xdbcc('0xea')]=db[_0xdbcc('0x4')][_0xdbcc('0x13')]('../api/userProfileSection/userProfileSection.model');db['UserProfileResource']=db[_0xdbcc('0x4')][_0xdbcc('0x13')]('../api/userProfileResource/userProfileResource.model');db[_0xdbcc('0xeb')]['hasOne'](db[_0xdbcc('0xec')],{'as':_0xdbcc('0xec'),'onDelete':_0xdbcc('0xed'),'foreignKey':_0xdbcc('0xee')});db[_0xdbcc('0xeb')][_0xdbcc('0xef')](db['VoiceRecording'],{'as':_0xdbcc('0xf0'),'foreignKey':'UserId'});db['User'][_0xdbcc('0xef')](db[_0xdbcc('0x2e')],{'as':_0xdbcc('0xf1'),'foreignKey':_0xdbcc('0xee')});db[_0xdbcc('0xeb')][_0xdbcc('0xef')](db[_0xdbcc('0x19')],{'as':_0xdbcc('0xf2'),'onDelete':_0xdbcc('0xed'),'hooks':!![]});db[_0xdbcc('0xeb')][_0xdbcc('0xef')](db[_0xdbcc('0x6c')],{'as':_0xdbcc('0xf3'),'foreignKey':_0xdbcc('0xee')});db[_0xdbcc('0xeb')][_0xdbcc('0xef')](db[_0xdbcc('0xf4')],{'as':_0xdbcc('0xf5'),'foreignKey':'UserId'});db['User']['hasMany'](db[_0xdbcc('0xf6')],{'as':'ReportAgentPreview','foreignKey':'UserId'});db['User'][_0xdbcc('0xef')](db[_0xdbcc('0x55')],{'as':_0xdbcc('0xf7'),'foreignKey':_0xdbcc('0xee')});db[_0xdbcc('0xeb')][_0xdbcc('0xef')](db['ChatInteraction'],{'as':_0xdbcc('0xf8'),'foreignKey':_0xdbcc('0xee')});db[_0xdbcc('0xeb')][_0xdbcc('0xef')](db[_0xdbcc('0x4d')],{'as':_0xdbcc('0xf9'),'foreignKey':_0xdbcc('0xee')});db[_0xdbcc('0xeb')][_0xdbcc('0xef')](db[_0xdbcc('0xfa')],{'as':_0xdbcc('0xfb'),'foreignKey':'UserId'});db[_0xdbcc('0xeb')][_0xdbcc('0xef')](db[_0xdbcc('0x3c')],{'as':'MailInteractions','foreignKey':'UserId'});db['User'][_0xdbcc('0xfc')](db[_0xdbcc('0xe8')],{'as':_0xdbcc('0xe8'),'foreignKey':_0xdbcc('0xfd')});db[_0xdbcc('0xeb')][_0xdbcc('0xfe')](db[_0xdbcc('0x65')],{'as':'Groups','through':'chat_group_has_users'});db[_0xdbcc('0xeb')][_0xdbcc('0xfe')](db[_0xdbcc('0xff')],{'as':_0xdbcc('0x100'),'through':_0xdbcc('0x101')});db[_0xdbcc('0xeb')][_0xdbcc('0xfe')](db[_0xdbcc('0xe5')],{'as':_0xdbcc('0x102'),'through':'cm_user_has_lists'});db[_0xdbcc('0xeb')][_0xdbcc('0xfe')](db[_0xdbcc('0xd4')],{'through':_0xdbcc('0x103')});db[_0xdbcc('0xeb')][_0xdbcc('0xfe')](db[_0xdbcc('0x3c')],{'as':_0xdbcc('0x104'),'through':_0xdbcc('0x105')});db[_0xdbcc('0xeb')]['belongsToMany'](db[_0xdbcc('0x5d')],{'as':_0xdbcc('0xf8'),'through':'user_has_chat_interactions'});db[_0xdbcc('0xeb')][_0xdbcc('0xfe')](db[_0xdbcc('0xfa')],{'as':_0xdbcc('0xfb'),'through':_0xdbcc('0x106')});db['User'][_0xdbcc('0xfe')](db[_0xdbcc('0x4d')],{'as':_0xdbcc('0xf9'),'through':_0xdbcc('0x107')});db[_0xdbcc('0xeb')][_0xdbcc('0xfe')](db[_0xdbcc('0x55')],{'as':'OpenchannelInteractions','through':'user_has_openchannel_interactions'});db['User'][_0xdbcc('0xfe')](db['VoiceQueue'],{'as':_0xdbcc('0x108'),'through':_0xdbcc('0x109'),'required':![]});db[_0xdbcc('0xeb')]['belongsToMany'](db[_0xdbcc('0x39')],{'as':'MailQueues','through':_0xdbcc('0x31'),'required':![]});db[_0xdbcc('0xeb')][_0xdbcc('0xfe')](db['ChatQueue'],{'as':_0xdbcc('0x10a'),'through':_0xdbcc('0x2f'),'required':![],'hooks':!![]});db[_0xdbcc('0xeb')][_0xdbcc('0xfe')](db[_0xdbcc('0x49')],{'as':_0xdbcc('0x10b'),'through':_0xdbcc('0x32'),'required':![]});db[_0xdbcc('0xeb')]['belongsToMany'](db[_0xdbcc('0x10c')],{'as':_0xdbcc('0x10d'),'through':_0xdbcc('0x10e'),'required':![]});db[_0xdbcc('0xeb')][_0xdbcc('0xfe')](db[_0xdbcc('0x10f')],{'as':'OpenchannelQueues','through':_0xdbcc('0x110'),'required':![]});db[_0xdbcc('0xeb')][_0xdbcc('0xfe')](db['CmList'],{'through':'cm_user_has_lists'});db[_0xdbcc('0xeb')]['belongsToMany'](db[_0xdbcc('0x111')],{'as':_0xdbcc('0x112'),'through':'user_has_voice_prefixes','required':![]});db[_0xdbcc('0xeb')][_0xdbcc('0xfe')](db[_0xdbcc('0x59')],{'as':_0xdbcc('0x113'),'through':_0xdbcc('0x114')});db[_0xdbcc('0xeb')]['belongsToMany'](db[_0xdbcc('0x45')],{'as':_0xdbcc('0x115'),'through':_0xdbcc('0x116')});db[_0xdbcc('0xeb')][_0xdbcc('0xfe')](db['MailAccount'],{'as':_0xdbcc('0x117'),'through':_0xdbcc('0x118')});db[_0xdbcc('0xeb')][_0xdbcc('0xfe')](db[_0xdbcc('0x51')],{'as':_0xdbcc('0x119'),'through':'user_has_openchannel_accounts'});db[_0xdbcc('0xeb')][_0xdbcc('0xfe')](db[_0xdbcc('0x11a')],{'as':'SmsAccounts','through':_0xdbcc('0x11b')});db[_0xdbcc('0xeb')][_0xdbcc('0xfe')](db[_0xdbcc('0xd0')],{'as':'SquareProjects','through':_0xdbcc('0x11c')});db['VoiceChanSpy'][_0xdbcc('0xef')](db[_0xdbcc('0x19')],{'as':_0xdbcc('0x11d'),'onDelete':_0xdbcc('0xed'),'foreignKey':_0xdbcc('0x11e')});db[_0xdbcc('0x17')][_0xdbcc('0xef')](db[_0xdbcc('0x19')],{'onDelete':_0xdbcc('0xed')});db[_0xdbcc('0x19')][_0xdbcc('0xef')](db['VoiceExtension'],{'as':'Applications','onDelete':_0xdbcc('0xed')});db[_0xdbcc('0x1a')][_0xdbcc('0xfe')](db[_0xdbcc('0x80')],{'as':'Sounds','through':_0xdbcc('0x11f')});db[_0xdbcc('0x120')][_0xdbcc('0xef')](db[_0xdbcc('0x2e')],{'as':'Members','foreignKey':_0xdbcc('0x121')});db['VoiceQueue'][_0xdbcc('0xef')](db[_0xdbcc('0x6a')],{'as':_0xdbcc('0x122'),'foreignKey':'VoiceQueueId'});db[_0xdbcc('0x120')]['hasMany'](db['CmHopperFinal'],{'as':_0xdbcc('0xf3'),'foreignKey':_0xdbcc('0x121')});db[_0xdbcc('0x120')][_0xdbcc('0xef')](db[_0xdbcc('0xf4')],{'as':'HopperHistories','foreignKey':_0xdbcc('0x121')});db['VoiceQueue'][_0xdbcc('0xef')](db[_0xdbcc('0xf6')],{'as':_0xdbcc('0xf6'),'foreignKey':_0xdbcc('0x121')});db[_0xdbcc('0x120')][_0xdbcc('0xef')](db[_0xdbcc('0x6b')],{'as':'HopperBlacks','foreignKey':'VoiceQueueId'});db['VoiceQueue']['hasMany'](db[_0xdbcc('0xc5')],{'as':_0xdbcc('0x123'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0xdbcc('0xfc')](db[_0xdbcc('0x2b')],{'as':_0xdbcc('0x2b'),'foreignKey':_0xdbcc('0x124')});db[_0xdbcc('0x120')]['belongsTo'](db['Trunk'],{'as':'TrunkBackup','foreignKey':'TrunkBackupId'});db[_0xdbcc('0x120')][_0xdbcc('0xfc')](db['Interval'],{'as':_0xdbcc('0x78'),'foreignKey':_0xdbcc('0x125')});db[_0xdbcc('0x120')][_0xdbcc('0xfc')](db[_0xdbcc('0x126')],{'as':_0xdbcc('0x127'),'foreignKey':_0xdbcc('0x128')});db[_0xdbcc('0x120')][_0xdbcc('0xfe')](db['CmList'],{'as':_0xdbcc('0x102'),'through':'voice_queues_has_cm_lists'});db[_0xdbcc('0x120')]['belongsToMany'](db[_0xdbcc('0xeb')],{'as':'Agents','through':_0xdbcc('0x109')});db[_0xdbcc('0x120')]['belongsToMany'](db[_0xdbcc('0xd4')],{'as':_0xdbcc('0x129'),'through':_0xdbcc('0x12a')});db[_0xdbcc('0x120')]['belongsToMany'](db['CmList'],{'as':_0xdbcc('0x12b'),'through':_0xdbcc('0x12c')});db[_0xdbcc('0x1c')][_0xdbcc('0xfc')](db[_0xdbcc('0xeb')],{'as':_0xdbcc('0xeb'),'foreignKey':_0xdbcc('0xee')});db[_0xdbcc('0x1e')][_0xdbcc('0xfc')](db[_0xdbcc('0xeb')],{'as':'User','foreignKey':_0xdbcc('0xee')});db['VoiceMail'][_0xdbcc('0xef')](db[_0xdbcc('0x21')],{'as':_0xdbcc('0x12d'),'onDelete':_0xdbcc('0xed'),'foreignKey':_0xdbcc('0x12e'),'sourceKey':_0xdbcc('0x12f')});db[_0xdbcc('0x21')][_0xdbcc('0xfc')](db[_0xdbcc('0xec')],{'foreignKey':_0xdbcc('0x12e'),'targetKey':_0xdbcc('0x12f')});db[_0xdbcc('0x23')][_0xdbcc('0xef')](db[_0xdbcc('0x29')],{'as':_0xdbcc('0x130'),'foreignKey':_0xdbcc('0x131'),'constraints':![]});db[_0xdbcc('0x23')]['hasMany'](db[_0xdbcc('0x27')],{'as':_0xdbcc('0x132'),'foreignKey':_0xdbcc('0x131'),'constraints':![]});db[_0xdbcc('0x23')][_0xdbcc('0xfc')](db['User'],{'as':_0xdbcc('0xeb'),'foreignKey':_0xdbcc('0xee')});db[_0xdbcc('0x23')]['belongsTo'](db[_0xdbcc('0xff')],{'as':_0xdbcc('0x133'),'foreignKey':'ContactId'});db['MailServerIn']['belongsTo'](db['MailAccount'],{'as':'MailAccount','foreignKey':_0xdbcc('0x134')});db[_0xdbcc('0x135')][_0xdbcc('0xfc')](db[_0xdbcc('0x37')],{'as':_0xdbcc('0x37'),'foreignKey':_0xdbcc('0x134')});db[_0xdbcc('0x37')][_0xdbcc('0x136')](db[_0xdbcc('0x137')],{'as':_0xdbcc('0x138'),'onDelete':_0xdbcc('0xed')});db['MailAccount']['hasOne'](db[_0xdbcc('0x135')],{'as':_0xdbcc('0x139'),'onDelete':_0xdbcc('0xed')});db[_0xdbcc('0x37')][_0xdbcc('0xef')](db[_0xdbcc('0x74')],{'as':'Dispositions','foreignKey':'MailAccountId'});db[_0xdbcc('0x37')][_0xdbcc('0xef')](db['CannedAnswer'],{'as':_0xdbcc('0x13a'),'foreignKey':_0xdbcc('0x134')});db[_0xdbcc('0x37')][_0xdbcc('0xef')](db['MailMessage'],{'as':'Messages','foreignKey':'MailAccountId'});db['MailAccount'][_0xdbcc('0xef')](db[_0xdbcc('0x3c')],{'as':_0xdbcc('0x13b')});db['MailAccount'][_0xdbcc('0xef')](db[_0xdbcc('0x3f')],{'as':_0xdbcc('0x13c')});db[_0xdbcc('0x37')][_0xdbcc('0xfc')](db['CmList'],{'as':'List','foreignKey':_0xdbcc('0x13d')});db[_0xdbcc('0x37')][_0xdbcc('0xfc')](db['Template'],{'as':_0xdbcc('0x13e'),'foreignKey':_0xdbcc('0x13f')});db[_0xdbcc('0x37')]['belongsTo'](db['Pause'],{'as':_0xdbcc('0x127'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xdbcc('0x37')][_0xdbcc('0xfe')](db[_0xdbcc('0xeb')],{'as':_0xdbcc('0x140'),'through':_0xdbcc('0x118')});db[_0xdbcc('0x39')][_0xdbcc('0xfe')](db[_0xdbcc('0xeb')],{'as':_0xdbcc('0x140'),'through':_0xdbcc('0x31')});db['MailQueue']['belongsToMany'](db[_0xdbcc('0xd4')],{'through':_0xdbcc('0x141'),'as':_0xdbcc('0x129')});db[_0xdbcc('0x3c')][_0xdbcc('0xef')](db[_0xdbcc('0x3e')],{'as':'Messages','onDelete':_0xdbcc('0xed'),'foreignKey':_0xdbcc('0x142')});db[_0xdbcc('0x3c')][_0xdbcc('0xfc')](db[_0xdbcc('0x37')],{'as':_0xdbcc('0x143'),'foreignKey':'MailAccountId'});db[_0xdbcc('0x3c')][_0xdbcc('0xfc')](db[_0xdbcc('0xff')],{'as':_0xdbcc('0x133'),'foreignKey':'ContactId'});db[_0xdbcc('0x3c')][_0xdbcc('0xfc')](db['User'],{'as':'Owner','foreignKey':_0xdbcc('0xee')});db[_0xdbcc('0x3c')][_0xdbcc('0xfe')](db[_0xdbcc('0x82')],{'through':_0xdbcc('0x144'),'as':_0xdbcc('0x145')});db[_0xdbcc('0x3c')][_0xdbcc('0xfe')](db['Tag'],{'through':_0xdbcc('0x144'),'as':_0xdbcc('0x146')});db[_0xdbcc('0x3c')]['belongsToMany'](db[_0xdbcc('0xeb')],{'as':'Users','through':_0xdbcc('0x105'),'foreignKey':_0xdbcc('0x142')});db[_0xdbcc('0x3e')]['hasMany'](db[_0xdbcc('0xd9')],{'as':'Attachments','onDelete':'cascade'});db[_0xdbcc('0x3e')]['belongsTo'](db[_0xdbcc('0xeb')],{'as':'User'});db[_0xdbcc('0x3e')][_0xdbcc('0xfc')](db['CmContact'],{'onDelete':_0xdbcc('0xed'),'as':_0xdbcc('0x133')});db[_0xdbcc('0x3e')]['belongsTo'](db[_0xdbcc('0x3c')],{'as':'Interaction','foreignKey':_0xdbcc('0x142')});db[_0xdbcc('0x3e')][_0xdbcc('0xfc')](db[_0xdbcc('0x37')],{'as':_0xdbcc('0x143'),'foreignKey':'MailAccountId'});db['MailApplication'][_0xdbcc('0xfc')](db[_0xdbcc('0xeb')],{'onDelete':_0xdbcc('0x147')});db[_0xdbcc('0x3f')][_0xdbcc('0xfc')](db[_0xdbcc('0x39')],{'onDelete':_0xdbcc('0x147')});db[_0xdbcc('0x3f')]['belongsTo'](db[_0xdbcc('0x37')],{'onDelete':_0xdbcc('0x147')});db[_0xdbcc('0x3f')]['belongsTo'](db['Interval'],{'onDelete':_0xdbcc('0x147'),'foreignKey':_0xdbcc('0x125')});db['MailApplication'][_0xdbcc('0xfc')](db['Tag'],{'onDelete':_0xdbcc('0x147'),'foreignKey':_0xdbcc('0x148')});db[_0xdbcc('0x149')][_0xdbcc('0xfc')](db[_0xdbcc('0x37')],{});db[_0xdbcc('0x149')][_0xdbcc('0xfc')](db['CmList'],{'as':_0xdbcc('0x14a'),'foreignKey':'ListId'});db['MailQueueReport'][_0xdbcc('0xfc')](db[_0xdbcc('0xff')],{'as':_0xdbcc('0x133'),'foreignKey':_0xdbcc('0x14b')});db[_0xdbcc('0x149')][_0xdbcc('0xfc')](db[_0xdbcc('0x3c')],{});db[_0xdbcc('0x149')][_0xdbcc('0xfc')](db[_0xdbcc('0x3e')],{});db[_0xdbcc('0x149')][_0xdbcc('0xfc')](db[_0xdbcc('0xeb')],{});db[_0xdbcc('0x149')]['belongsTo'](db[_0xdbcc('0x39')],{});db['Dashboard'][_0xdbcc('0xef')](db[_0xdbcc('0x43')],{'as':_0xdbcc('0x14c'),'onDelete':'cascade'});db[_0xdbcc('0x45')][_0xdbcc('0xef')](db[_0xdbcc('0x74')],{'as':_0xdbcc('0x14d'),'foreignKey':_0xdbcc('0x14e')});db[_0xdbcc('0x45')]['hasMany'](db[_0xdbcc('0x73')],{'as':'Answers','foreignKey':_0xdbcc('0x14e')});db[_0xdbcc('0x45')][_0xdbcc('0xef')](db['FaxInteraction'],{'as':_0xdbcc('0x13b')});db['FaxAccount'][_0xdbcc('0xef')](db['FaxApplication'],{'as':_0xdbcc('0x13c')});db[_0xdbcc('0x45')][_0xdbcc('0xef')](db[_0xdbcc('0x19')],{'as':'Exntensions','onDelete':'cascade'});db[_0xdbcc('0x45')][_0xdbcc('0xef')](db[_0xdbcc('0x14f')],{'as':_0xdbcc('0x12d')});db[_0xdbcc('0x45')][_0xdbcc('0xfc')](db[_0xdbcc('0x2b')],{'as':'Trunk'});db[_0xdbcc('0x45')][_0xdbcc('0xfc')](db['CmList'],{'as':'List','foreignKey':_0xdbcc('0x13d')});db[_0xdbcc('0x45')][_0xdbcc('0xfc')](db[_0xdbcc('0x126')],{'as':_0xdbcc('0x127'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xdbcc('0x45')]['belongsToMany'](db[_0xdbcc('0xeb')],{'as':'Agents','through':_0xdbcc('0x116')});db['FaxApplication'][_0xdbcc('0xfc')](db[_0xdbcc('0xeb')],{'onDelete':'restrict'});db[_0xdbcc('0x150')][_0xdbcc('0xfc')](db['FaxQueue'],{'onDelete':'restrict'});db[_0xdbcc('0x150')]['belongsTo'](db[_0xdbcc('0x45')],{'onDelete':'restrict'});db[_0xdbcc('0x150')]['belongsTo'](db[_0xdbcc('0x82')],{'onDelete':_0xdbcc('0x147'),'foreignKey':_0xdbcc('0x148')});db[_0xdbcc('0xfa')]['hasMany'](db[_0xdbcc('0x14f')],{'as':_0xdbcc('0x12d'),'onDelete':'cascade','foreignKey':_0xdbcc('0x151')});db[_0xdbcc('0xfa')][_0xdbcc('0xfc')](db['FaxAccount'],{'as':_0xdbcc('0x143'),'foreignKey':_0xdbcc('0x14e')});db['FaxInteraction'][_0xdbcc('0xfc')](db[_0xdbcc('0xff')],{'as':'Contact','foreignKey':_0xdbcc('0x14b')});db[_0xdbcc('0xfa')][_0xdbcc('0xfc')](db[_0xdbcc('0xeb')],{'as':_0xdbcc('0x152'),'foreignKey':_0xdbcc('0xee')});db['FaxInteraction'][_0xdbcc('0xfe')](db[_0xdbcc('0x82')],{'through':_0xdbcc('0x153'),'as':_0xdbcc('0x145')});db[_0xdbcc('0xfa')][_0xdbcc('0xfe')](db['Tag'],{'through':_0xdbcc('0x153'),'as':_0xdbcc('0x146')});db[_0xdbcc('0xfa')]['belongsToMany'](db[_0xdbcc('0xeb')],{'as':'Users','through':_0xdbcc('0x106'),'foreignKey':_0xdbcc('0x151')});db[_0xdbcc('0x14f')][_0xdbcc('0xfc')](db[_0xdbcc('0xeb')],{'onDelete':_0xdbcc('0xed'),'as':_0xdbcc('0xeb')});db[_0xdbcc('0x14f')][_0xdbcc('0xfc')](db[_0xdbcc('0xfa')],{'as':_0xdbcc('0x154'),'foreignKey':_0xdbcc('0x151')});db[_0xdbcc('0x14f')]['belongsTo'](db['CmContact'],{'onDelete':_0xdbcc('0xed'),'as':'Contact'});db[_0xdbcc('0x14f')][_0xdbcc('0xfc')](db['Attachment'],{'as':_0xdbcc('0xd9'),'foreignKey':'AttachmentId'});db[_0xdbcc('0x14f')][_0xdbcc('0xfc')](db[_0xdbcc('0x45')],{'as':'Account','foreignKey':_0xdbcc('0x14e')});db[_0xdbcc('0x49')][_0xdbcc('0xfe')](db[_0xdbcc('0xeb')],{'as':_0xdbcc('0x140'),'through':_0xdbcc('0x32')});db['FaxQueue']['belongsToMany'](db[_0xdbcc('0xd4')],{'through':_0xdbcc('0x155'),'as':_0xdbcc('0x129')});db[_0xdbcc('0x4a')]['belongsTo'](db[_0xdbcc('0x45')],{});db[_0xdbcc('0x4a')]['belongsTo'](db[_0xdbcc('0xe5')],{'as':'List','foreignKey':_0xdbcc('0x13d')});db['FaxQueueReport'][_0xdbcc('0xfc')](db[_0xdbcc('0xff')],{'as':_0xdbcc('0x133'),'foreignKey':_0xdbcc('0x14b')});db[_0xdbcc('0x4a')][_0xdbcc('0xfc')](db['FaxInteraction'],{});db['FaxQueueReport'][_0xdbcc('0xfc')](db[_0xdbcc('0x14f')],{});db[_0xdbcc('0x4a')][_0xdbcc('0xfc')](db[_0xdbcc('0xeb')],{});db[_0xdbcc('0x4a')][_0xdbcc('0xfc')](db[_0xdbcc('0x49')],{});db[_0xdbcc('0x11a')]['hasMany'](db[_0xdbcc('0x74')],{'as':_0xdbcc('0x14d'),'foreignKey':_0xdbcc('0x156')});db[_0xdbcc('0x11a')][_0xdbcc('0xef')](db[_0xdbcc('0x73')],{'as':_0xdbcc('0x13a'),'foreignKey':_0xdbcc('0x156')});db[_0xdbcc('0x11a')][_0xdbcc('0xef')](db[_0xdbcc('0x4e')],{'as':_0xdbcc('0x12d'),'foreignKey':_0xdbcc('0x156')});db[_0xdbcc('0x11a')][_0xdbcc('0xef')](db[_0xdbcc('0x4d')],{'as':_0xdbcc('0x13b')});db[_0xdbcc('0x11a')][_0xdbcc('0xef')](db[_0xdbcc('0x4c')],{'as':_0xdbcc('0x13c')});db[_0xdbcc('0x11a')]['belongsTo'](db[_0xdbcc('0xe5')],{'as':'List','foreignKey':_0xdbcc('0x13d')});db[_0xdbcc('0x11a')][_0xdbcc('0xfc')](db['Pause'],{'as':_0xdbcc('0x127'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xdbcc('0x11a')][_0xdbcc('0xfe')](db[_0xdbcc('0xeb')],{'as':_0xdbcc('0x140'),'through':_0xdbcc('0x11b')});db['SmsApplication']['belongsTo'](db[_0xdbcc('0xeb')],{'onDelete':_0xdbcc('0x147')});db['SmsApplication']['belongsTo'](db[_0xdbcc('0x10c')],{'onDelete':_0xdbcc('0x147')});db[_0xdbcc('0x4c')]['belongsTo'](db['SmsAccount'],{'onDelete':'restrict'});db[_0xdbcc('0x4c')][_0xdbcc('0xfc')](db['Interval'],{'onDelete':_0xdbcc('0x147'),'foreignKey':_0xdbcc('0x125')});db[_0xdbcc('0x4c')][_0xdbcc('0xfc')](db[_0xdbcc('0x82')],{'onDelete':_0xdbcc('0x147'),'foreignKey':_0xdbcc('0x148')});db['SmsInteraction'][_0xdbcc('0xef')](db['SmsMessage'],{'as':'Messages','onDelete':'cascade','foreignKey':_0xdbcc('0x157')});db[_0xdbcc('0x4d')][_0xdbcc('0xfc')](db[_0xdbcc('0x11a')],{'as':'Account','foreignKey':_0xdbcc('0x156')});db[_0xdbcc('0x4d')][_0xdbcc('0xfc')](db['CmContact'],{'as':_0xdbcc('0x133'),'foreignKey':_0xdbcc('0x14b')});db[_0xdbcc('0x4d')][_0xdbcc('0xfc')](db[_0xdbcc('0xeb')],{'as':_0xdbcc('0x152'),'foreignKey':_0xdbcc('0xee')});db[_0xdbcc('0x4d')][_0xdbcc('0xfe')](db[_0xdbcc('0x82')],{'through':_0xdbcc('0x158'),'as':_0xdbcc('0x145')});db[_0xdbcc('0x4d')][_0xdbcc('0xfe')](db['Tag'],{'through':'sms_interaction_has_tags','as':_0xdbcc('0x146')});db[_0xdbcc('0x4d')]['belongsToMany'](db['User'],{'as':_0xdbcc('0x159'),'through':'user_has_sms_interactions','foreignKey':_0xdbcc('0x157')});db['SmsMessage'][_0xdbcc('0xfc')](db[_0xdbcc('0xeb')],{'as':'User'});db[_0xdbcc('0x4e')][_0xdbcc('0xfc')](db[_0xdbcc('0xff')],{'onDelete':_0xdbcc('0xed'),'as':_0xdbcc('0x133')});db[_0xdbcc('0x4e')][_0xdbcc('0xfc')](db[_0xdbcc('0x4d')],{'onDelete':_0xdbcc('0xed'),'as':_0xdbcc('0x154'),'foreignKey':'SmsInteractionId'});db[_0xdbcc('0x4e')][_0xdbcc('0xfc')](db['SmsAccount'],{'as':'Account','foreignKey':_0xdbcc('0x156')});db[_0xdbcc('0x10c')][_0xdbcc('0xfe')](db[_0xdbcc('0xeb')],{'as':_0xdbcc('0x140'),'through':_0xdbcc('0x10e'),'foreignKey':'SmsQueueId'});db[_0xdbcc('0x10c')]['belongsToMany'](db[_0xdbcc('0xd4')],{'through':_0xdbcc('0x15a'),'as':_0xdbcc('0x129')});db[_0xdbcc('0x51')][_0xdbcc('0xef')](db[_0xdbcc('0x74')],{'as':_0xdbcc('0x14d'),'foreignKey':_0xdbcc('0x15b')});db[_0xdbcc('0x51')][_0xdbcc('0xef')](db[_0xdbcc('0x73')],{'as':_0xdbcc('0x13a'),'foreignKey':_0xdbcc('0x15b')});db['OpenchannelAccount']['hasMany'](db[_0xdbcc('0x55')],{'as':_0xdbcc('0x13b'),'foreignKey':'OpenchannelAccountId'});db[_0xdbcc('0x51')][_0xdbcc('0xef')](db['OpenchannelMessage'],{'as':'Messages','foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0xdbcc('0xef')](db['OpenchannelApplication'],{'as':_0xdbcc('0x13c'),'foreignKey':'OpenchannelAccountId'});db[_0xdbcc('0x51')][_0xdbcc('0xfc')](db[_0xdbcc('0xe5')],{'as':_0xdbcc('0x14a'),'foreignKey':_0xdbcc('0x13d')});db[_0xdbcc('0x51')][_0xdbcc('0xfc')](db[_0xdbcc('0x126')],{'as':_0xdbcc('0x127'),'foreignKey':_0xdbcc('0x128')});db[_0xdbcc('0x51')][_0xdbcc('0xfe')](db['User'],{'as':'Agents','through':'user_has_openchannel_accounts'});db[_0xdbcc('0x53')]['belongsTo'](db['User'],{'onDelete':'restrict'});db[_0xdbcc('0x53')][_0xdbcc('0xfc')](db[_0xdbcc('0x10f')],{'onDelete':_0xdbcc('0x147'),'foreignKey':_0xdbcc('0x15c')});db[_0xdbcc('0x53')]['belongsTo'](db[_0xdbcc('0x51')],{'onDelete':_0xdbcc('0x147'),'foreignKey':_0xdbcc('0x15b')});db[_0xdbcc('0x53')][_0xdbcc('0xfc')](db['Interval'],{'onDelete':_0xdbcc('0x147'),'foreignKey':_0xdbcc('0x125')});db[_0xdbcc('0x53')]['belongsTo'](db[_0xdbcc('0x82')],{'onDelete':_0xdbcc('0x147'),'foreignKey':_0xdbcc('0x148')});db[_0xdbcc('0x55')][_0xdbcc('0xef')](db['OpenchannelMessage'],{'as':_0xdbcc('0x12d'),'onDelete':'cascade','foreignKey':_0xdbcc('0x15d')});db[_0xdbcc('0x55')][_0xdbcc('0xfc')](db[_0xdbcc('0x51')],{'as':_0xdbcc('0x143'),'foreignKey':_0xdbcc('0x15b')});db[_0xdbcc('0x55')][_0xdbcc('0xfc')](db[_0xdbcc('0xff')],{'as':_0xdbcc('0x133'),'foreignKey':_0xdbcc('0x14b')});db[_0xdbcc('0x55')][_0xdbcc('0xfc')](db[_0xdbcc('0xeb')],{'as':_0xdbcc('0x152'),'foreignKey':_0xdbcc('0xee')});db[_0xdbcc('0x55')][_0xdbcc('0xfe')](db['Tag'],{'through':_0xdbcc('0x15e'),'as':_0xdbcc('0x145')});db['OpenchannelInteraction'][_0xdbcc('0xfe')](db[_0xdbcc('0x82')],{'through':_0xdbcc('0x15e'),'as':'ThroughTags'});db[_0xdbcc('0x55')][_0xdbcc('0xfe')](db[_0xdbcc('0xeb')],{'as':_0xdbcc('0x159'),'through':_0xdbcc('0x15f'),'foreignKey':_0xdbcc('0x15d')});db['OpenchannelMessage']['belongsTo'](db[_0xdbcc('0xeb')],{'onDelete':_0xdbcc('0xed'),'as':_0xdbcc('0xeb')});db[_0xdbcc('0x57')][_0xdbcc('0xfc')](db['CmContact'],{'onDelete':_0xdbcc('0xed'),'as':_0xdbcc('0x133')});db[_0xdbcc('0x57')]['belongsTo'](db[_0xdbcc('0x55')],{'onDelete':_0xdbcc('0xed'),'as':'Interaction','foreignKey':_0xdbcc('0x15d')});db['OpenchannelMessage'][_0xdbcc('0xfc')](db[_0xdbcc('0xd9')],{'as':'Attachment','foreignKey':_0xdbcc('0x160')});db[_0xdbcc('0x57')][_0xdbcc('0xfc')](db[_0xdbcc('0x51')],{'as':_0xdbcc('0x143'),'foreignKey':_0xdbcc('0x15b')});db[_0xdbcc('0x10f')][_0xdbcc('0xfe')](db[_0xdbcc('0xeb')],{'as':_0xdbcc('0x140'),'through':_0xdbcc('0x110'),'foreignKey':'OpenchannelQueueId'});db['OpenchannelQueue'][_0xdbcc('0xfe')](db['Team'],{'through':'team_has_openchannel_queues','as':'Teams'});db[_0xdbcc('0x59')][_0xdbcc('0xef')](db[_0xdbcc('0x74')],{'as':_0xdbcc('0x14d'),'foreignKey':_0xdbcc('0x161')});db[_0xdbcc('0x59')][_0xdbcc('0xef')](db[_0xdbcc('0x73')],{'as':_0xdbcc('0x13a'),'foreignKey':'ChatWebsiteId'});db[_0xdbcc('0x59')][_0xdbcc('0xef')](db[_0xdbcc('0x67')],{'as':_0xdbcc('0x162')});db[_0xdbcc('0x59')][_0xdbcc('0xef')](db[_0xdbcc('0x5d')],{'as':'Interactions'});db[_0xdbcc('0x59')][_0xdbcc('0xef')](db[_0xdbcc('0x5b')],{'as':'Applications'});db[_0xdbcc('0x59')]['hasMany'](db['ChatMessage'],{'as':'Messages'});db[_0xdbcc('0x59')][_0xdbcc('0xfc')](db['CmList'],{'as':_0xdbcc('0x14a'),'foreignKey':_0xdbcc('0x13d')});db[_0xdbcc('0x59')][_0xdbcc('0xfc')](db[_0xdbcc('0x78')],{'as':'Interval','foreignKey':_0xdbcc('0x125')});db[_0xdbcc('0x59')][_0xdbcc('0xfc')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0xdbcc('0x128')});db['ChatWebsite'][_0xdbcc('0xfe')](db[_0xdbcc('0xeb')],{'as':_0xdbcc('0x140'),'through':'user_has_chat_websites'});db[_0xdbcc('0x163')][_0xdbcc('0xfc')](db[_0xdbcc('0x51')],{});db[_0xdbcc('0x163')][_0xdbcc('0xfc')](db[_0xdbcc('0xe5')],{'as':_0xdbcc('0x14a'),'foreignKey':_0xdbcc('0x13d')});db[_0xdbcc('0x163')]['belongsTo'](db[_0xdbcc('0xff')],{'as':'Contact','foreignKey':_0xdbcc('0x14b')});db[_0xdbcc('0x163')]['belongsTo'](db['OpenchannelInteraction'],{});db[_0xdbcc('0x163')][_0xdbcc('0xfc')](db[_0xdbcc('0x57')],{});db[_0xdbcc('0x163')]['belongsTo'](db[_0xdbcc('0xeb')],{});db[_0xdbcc('0x163')]['belongsTo'](db[_0xdbcc('0x10f')],{});db[_0xdbcc('0x5b')][_0xdbcc('0xfc')](db[_0xdbcc('0xeb')],{'as':_0xdbcc('0x164'),'foreignKey':_0xdbcc('0xee'),'onDelete':_0xdbcc('0x147')});db[_0xdbcc('0x5b')][_0xdbcc('0xfc')](db[_0xdbcc('0x63')],{'as':_0xdbcc('0x165'),'foreignKey':_0xdbcc('0x166'),'onDelete':_0xdbcc('0x147')});db['ChatApplication'][_0xdbcc('0xfc')](db[_0xdbcc('0x59')],{'as':'Website','foreignKey':_0xdbcc('0x161'),'onDelete':_0xdbcc('0x147')});db[_0xdbcc('0x5b')]['belongsTo'](db[_0xdbcc('0x82')],{'onDelete':_0xdbcc('0x147'),'foreignKey':_0xdbcc('0x148')});db[_0xdbcc('0x5d')][_0xdbcc('0xef')](db[_0xdbcc('0x5f')],{'as':'Messages','onDelete':_0xdbcc('0xed'),'foreignKey':_0xdbcc('0x167')});db[_0xdbcc('0x5d')]['belongsTo'](db[_0xdbcc('0x59')],{'as':_0xdbcc('0x143'),'foreignKey':_0xdbcc('0x161')});db[_0xdbcc('0x5d')][_0xdbcc('0xfc')](db['CmContact'],{'as':_0xdbcc('0x133'),'foreignKey':'ContactId'});db['ChatInteraction'][_0xdbcc('0xfc')](db['User'],{'as':_0xdbcc('0x152'),'foreignKey':_0xdbcc('0xee')});db[_0xdbcc('0x5d')][_0xdbcc('0xfe')](db[_0xdbcc('0x82')],{'through':_0xdbcc('0x168'),'as':'Tags'});db[_0xdbcc('0x5d')][_0xdbcc('0xfe')](db[_0xdbcc('0x82')],{'through':'chat_interaction_has_tags','as':'ThroughTags'});db[_0xdbcc('0x5d')][_0xdbcc('0xfe')](db[_0xdbcc('0xeb')],{'as':'Users','through':'user_has_chat_interactions','foreignKey':_0xdbcc('0x167')});db['ChatMessage'][_0xdbcc('0xfc')](db[_0xdbcc('0xeb')],{'onDelete':_0xdbcc('0xed'),'as':_0xdbcc('0xeb')});db[_0xdbcc('0x5f')][_0xdbcc('0xfc')](db[_0xdbcc('0xff')],{'onDelete':_0xdbcc('0xed'),'as':_0xdbcc('0x133'),'foreignKey':_0xdbcc('0x14b')});db[_0xdbcc('0x5f')][_0xdbcc('0xfc')](db[_0xdbcc('0x5d')],{'onDelete':_0xdbcc('0xed'),'as':_0xdbcc('0x154'),'foreignKey':'ChatInteractionId'});db[_0xdbcc('0x5f')][_0xdbcc('0xfc')](db[_0xdbcc('0xd9')],{'as':_0xdbcc('0xd9'),'foreignKey':_0xdbcc('0x160')});db[_0xdbcc('0x5f')]['belongsTo'](db[_0xdbcc('0x59')],{'as':_0xdbcc('0x143'),'foreignKey':'ChatWebsiteId'});db[_0xdbcc('0x61')]['belongsTo'](db[_0xdbcc('0xff')],{'onDelete':_0xdbcc('0xed'),'as':'Contact','foreignKey':'ContactId'});db[_0xdbcc('0x61')][_0xdbcc('0xfc')](db[_0xdbcc('0x59')],{'as':_0xdbcc('0x143'),'foreignKey':'ChatWebsiteId'});db[_0xdbcc('0x63')][_0xdbcc('0xfe')](db['User'],{'as':_0xdbcc('0x140'),'through':_0xdbcc('0x2f'),'hooks':!![]});db[_0xdbcc('0x63')][_0xdbcc('0xfe')](db[_0xdbcc('0xd4')],{'through':'team_has_chat_queues','as':_0xdbcc('0x129')});db[_0xdbcc('0x65')][_0xdbcc('0xef')](db[_0xdbcc('0xc0')],{'as':_0xdbcc('0x12d'),'foreignKey':_0xdbcc('0x169'),'onDelete':_0xdbcc('0xed')});db['ChatGroup']['belongsToMany'](db['User'],{'as':'Members','through':_0xdbcc('0x16a')});db['ChatProactiveAction'][_0xdbcc('0xfc')](db[_0xdbcc('0x59')],{'as':'Website','foreignKey':_0xdbcc('0x161')});db[_0xdbcc('0x68')]['hasMany'](db[_0xdbcc('0xff')],{'as':'Contacts','foreignKey':'CompanyId'});db[_0xdbcc('0xff')][_0xdbcc('0xef')](db['CmHopper'],{'as':'Hoppers','foreignKey':_0xdbcc('0x14b')});db[_0xdbcc('0xff')]['hasMany'](db[_0xdbcc('0x6c')],{'as':_0xdbcc('0xf3'),'foreignKey':'ContactId'});db[_0xdbcc('0xff')][_0xdbcc('0xef')](db[_0xdbcc('0xf4')],{'as':'HopperHistories','foreignKey':'ContactId'});db[_0xdbcc('0xff')][_0xdbcc('0xef')](db[_0xdbcc('0xf6')],{'as':_0xdbcc('0xf6'),'foreignKey':_0xdbcc('0x14b')});db['CmContact'][_0xdbcc('0xef')](db[_0xdbcc('0xc5')],{'as':_0xdbcc('0x123'),'foreignKey':_0xdbcc('0x14b')});db[_0xdbcc('0xff')][_0xdbcc('0xef')](db['OpenchannelInteraction'],{'as':_0xdbcc('0xf7'),'foreignKey':_0xdbcc('0x14b'),'onDelete':_0xdbcc('0x147')});db[_0xdbcc('0xff')][_0xdbcc('0xef')](db['ChatInteraction'],{'as':'ChatInteractions','foreignKey':_0xdbcc('0x14b'),'onDelete':_0xdbcc('0x147')});db[_0xdbcc('0xff')][_0xdbcc('0xef')](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':_0xdbcc('0x14b'),'onDelete':_0xdbcc('0x147')});db[_0xdbcc('0xff')][_0xdbcc('0xef')](db['FaxInteraction'],{'as':_0xdbcc('0xfb'),'foreignKey':_0xdbcc('0x14b'),'onDelete':_0xdbcc('0x147')});db[_0xdbcc('0xff')][_0xdbcc('0xef')](db[_0xdbcc('0x3c')],{'as':_0xdbcc('0x104'),'foreignKey':_0xdbcc('0x14b'),'onDelete':'restrict'});db['CmContact'][_0xdbcc('0xfc')](db[_0xdbcc('0x68')],{'as':_0xdbcc('0x16b'),'foreignKey':_0xdbcc('0x16c')});db['CmContact']['belongsTo'](db['CmList'],{'as':_0xdbcc('0x14a'),'foreignKey':_0xdbcc('0x13d'),'onDelete':_0xdbcc('0xed')});db[_0xdbcc('0xff')]['belongsToMany'](db[_0xdbcc('0xeb')],{'as':_0xdbcc('0x159'),'through':_0xdbcc('0x101')});db['CmContact']['belongsToMany'](db[_0xdbcc('0x82')],{'as':_0xdbcc('0x145'),'through':'cm_contact_has_tags'});db[_0xdbcc('0xff')][_0xdbcc('0xfe')](db[_0xdbcc('0x82')],{'through':_0xdbcc('0x16d'),'as':_0xdbcc('0x146')});db[_0xdbcc('0x6a')][_0xdbcc('0xfc')](db[_0xdbcc('0xff')],{'as':_0xdbcc('0x133'),'foreignKey':'ContactId','onDelete':_0xdbcc('0xed')});db[_0xdbcc('0x6a')][_0xdbcc('0xfc')](db[_0xdbcc('0xe5')],{'as':_0xdbcc('0x14a'),'foreignKey':'ListId','onDelete':'cascade'});db['CmHopper'][_0xdbcc('0xfc')](db[_0xdbcc('0xeb')],{'as':_0xdbcc('0x164'),'foreignKey':_0xdbcc('0xee')});db[_0xdbcc('0x6a')][_0xdbcc('0xfc')](db[_0xdbcc('0x120')],{'as':_0xdbcc('0x165'),'foreignKey':_0xdbcc('0x121'),'onDelete':_0xdbcc('0xed')});db[_0xdbcc('0x6a')][_0xdbcc('0xfc')](db[_0xdbcc('0xd7')],{'as':_0xdbcc('0xd7'),'foreignKey':'CampaignId','onDelete':_0xdbcc('0xed')});db[_0xdbcc('0x6a')][_0xdbcc('0xfc')](db[_0xdbcc('0xeb')],{'as':_0xdbcc('0x152'),'foreignKey':_0xdbcc('0x16e')});db[_0xdbcc('0x6b')][_0xdbcc('0xfc')](db[_0xdbcc('0xff')],{'as':'Contact','foreignKey':_0xdbcc('0x14b'),'onDelete':_0xdbcc('0xed')});db[_0xdbcc('0x6b')][_0xdbcc('0xfc')](db[_0xdbcc('0xe5')],{'as':_0xdbcc('0x14a'),'foreignKey':'ListId','onDelete':_0xdbcc('0xed')});db[_0xdbcc('0x6b')][_0xdbcc('0xfc')](db[_0xdbcc('0x120')],{'as':_0xdbcc('0x165'),'foreignKey':_0xdbcc('0x121'),'onDelete':_0xdbcc('0xed')});db[_0xdbcc('0x6b')]['belongsTo'](db[_0xdbcc('0xd7')],{'as':'Campaign','foreignKey':_0xdbcc('0x16f'),'onDelete':'cascade'});db[_0xdbcc('0x71')]['hasMany'](db['Condition'],{'as':{'plural':_0xdbcc('0x170'),'singular':_0xdbcc('0x171')},'foreignKey':'AutomationAllId','onDelete':'cascade','hooks':!![]});db[_0xdbcc('0x71')][_0xdbcc('0xef')](db[_0xdbcc('0x76')],{'as':{'plural':_0xdbcc('0x172'),'singular':_0xdbcc('0x173')},'foreignKey':_0xdbcc('0x174'),'onDelete':_0xdbcc('0xed'),'hooks':!![]});db['Automation'][_0xdbcc('0xef')](db['Action'],{'as':'Actions','foreignKey':_0xdbcc('0x175'),'onDelete':_0xdbcc('0xed'),'hooks':!![]});db['Interval']['hasMany'](db[_0xdbcc('0x78')],{'as':_0xdbcc('0x176'),'foreignKey':_0xdbcc('0x125'),'onDelete':_0xdbcc('0xed'),'hooks':!![],'required':![]});db[_0xdbcc('0x78')]['hasMany'](db[_0xdbcc('0x19')],{'as':'Extensions','foreignKey':'IntervalId','onDelete':'restrict'});db['Interval'][_0xdbcc('0xef')](db['MailApplication'],{'as':_0xdbcc('0x177'),'foreignKey':'IntervalId'});db[_0xdbcc('0x78')][_0xdbcc('0xef')](db['ChatApplication'],{'as':_0xdbcc('0x178'),'foreignKey':'IntervalId'});db[_0xdbcc('0x78')][_0xdbcc('0xef')](db[_0xdbcc('0x150')],{'as':_0xdbcc('0x179'),'foreignKey':_0xdbcc('0x125')});db[_0xdbcc('0x78')][_0xdbcc('0xef')](db[_0xdbcc('0x4c')],{'as':'SmsApplications','foreignKey':_0xdbcc('0x125')});db[_0xdbcc('0x7f')][_0xdbcc('0xfc')](db['MailAccount'],{});db[_0xdbcc('0x7f')][_0xdbcc('0xfc')](db[_0xdbcc('0x8d')],{'foreignKey':'DefaultReportId'});db['Schedule'][_0xdbcc('0xfc')](db[_0xdbcc('0x8c')],{'foreignKey':'CustomReportId'});db[_0xdbcc('0x80')]['belongsToMany'](db['VoiceMusicOnHold'],{'as':'Mohs','through':'moh_has_sounds','onDelete':_0xdbcc('0x147')});db[_0xdbcc('0x82')][_0xdbcc('0xfe')](db[_0xdbcc('0xff')],{'through':_0xdbcc('0x16d')});db['Tag'][_0xdbcc('0xfe')](db[_0xdbcc('0x5d')],{'through':_0xdbcc('0x168')});db['Tag'][_0xdbcc('0xfe')](db[_0xdbcc('0x3c')],{'through':_0xdbcc('0x144')});db['Tag'][_0xdbcc('0xfe')](db[_0xdbcc('0x4d')],{'through':_0xdbcc('0x158')});db[_0xdbcc('0x82')]['belongsToMany'](db[_0xdbcc('0xfa')],{'through':_0xdbcc('0x153')});db[_0xdbcc('0x82')]['belongsToMany'](db['OpenchannelInteraction'],{'through':_0xdbcc('0x15e')});db[_0xdbcc('0x85')][_0xdbcc('0xef')](db[_0xdbcc('0x76')],{'as':{'plural':_0xdbcc('0x17a'),'singular':_0xdbcc('0x17b')},'foreignKey':_0xdbcc('0x17c'),'onDelete':_0xdbcc('0xed'),'hooks':!![]});db['Trigger']['hasMany'](db[_0xdbcc('0x76')],{'as':{'plural':_0xdbcc('0x17d'),'singular':_0xdbcc('0x17e')},'foreignKey':_0xdbcc('0x17f'),'onDelete':_0xdbcc('0xed'),'hooks':!![]});db['Trigger'][_0xdbcc('0xef')](db[_0xdbcc('0x70')],{'as':_0xdbcc('0x180'),'foreignKey':_0xdbcc('0x181'),'onDelete':_0xdbcc('0xed'),'hooks':!![]});db[_0xdbcc('0x8c')][_0xdbcc('0xef')](db[_0xdbcc('0x182')],{'as':_0xdbcc('0x183'),'onDelete':_0xdbcc('0xed'),'foreignKey':_0xdbcc('0x184'),'hooks':!![]});db['AnalyticDefaultReport'][_0xdbcc('0xef')](db[_0xdbcc('0x182')],{'as':'Fields','onDelete':_0xdbcc('0xed'),'foreignKey':_0xdbcc('0x185')});db[_0xdbcc('0x186')][_0xdbcc('0xef')](db['AnalyticFieldReport'],{'as':_0xdbcc('0x183'),'onDelete':'cascade','foreignKey':_0xdbcc('0x187')});db[_0xdbcc('0x182')][_0xdbcc('0xfc')](db[_0xdbcc('0x186')],{'foreignKey':_0xdbcc('0x187')});db[_0xdbcc('0x188')][_0xdbcc('0xef')](db[_0xdbcc('0x96')],{'as':'Configurations','onDelete':_0xdbcc('0xed'),'foreignKey':_0xdbcc('0x189')});db['SalesforceConfiguration'][_0xdbcc('0xef')](db[_0xdbcc('0x98')],{'as':_0xdbcc('0x18a'),'onDelete':_0xdbcc('0xed'),'foreignKey':_0xdbcc('0x18b')});db[_0xdbcc('0x96')]['hasMany'](db['SalesforceField'],{'as':_0xdbcc('0x18c'),'onDelete':'cascade','foreignKey':_0xdbcc('0x18d')});db[_0xdbcc('0x96')]['hasMany'](db[_0xdbcc('0x98')],{'as':'Fields','onDelete':_0xdbcc('0xed'),'foreignKey':'FieldId'});db[_0xdbcc('0x96')][_0xdbcc('0xfc')](db['SalesforceAccount'],{'as':_0xdbcc('0x143'),'foreignKey':_0xdbcc('0x189')});db[_0xdbcc('0x98')]['hasMany'](db[_0xdbcc('0x98')],{'as':_0xdbcc('0x18e'),'foreignKey':_0xdbcc('0x18b')});db[_0xdbcc('0x98')][_0xdbcc('0xef')](db[_0xdbcc('0x98')],{'as':'Description','foreignKey':_0xdbcc('0x18d')});db[_0xdbcc('0x98')]['hasMany'](db[_0xdbcc('0x98')],{'as':_0xdbcc('0x18f'),'foreignKey':_0xdbcc('0x190')});db[_0xdbcc('0x98')][_0xdbcc('0xfc')](db[_0xdbcc('0x86')],{'as':_0xdbcc('0x86'),'foreignKey':_0xdbcc('0x191')});db[_0xdbcc('0x9a')][_0xdbcc('0xef')](db[_0xdbcc('0x9c')],{'as':_0xdbcc('0x192'),'onDelete':'cascade','foreignKey':_0xdbcc('0x189')});db[_0xdbcc('0x9c')][_0xdbcc('0xef')](db['SugarcrmField'],{'as':'Subjects','onDelete':_0xdbcc('0xed'),'foreignKey':_0xdbcc('0x18b')});db[_0xdbcc('0x9c')][_0xdbcc('0xef')](db[_0xdbcc('0x9d')],{'as':'Descriptions','onDelete':_0xdbcc('0xed'),'foreignKey':'DescriptionId'});db['SugarcrmConfiguration'][_0xdbcc('0xef')](db[_0xdbcc('0x9d')],{'as':_0xdbcc('0x183'),'onDelete':_0xdbcc('0xed'),'foreignKey':_0xdbcc('0x190')});db[_0xdbcc('0x9c')][_0xdbcc('0xfc')](db['SugarcrmAccount'],{'as':_0xdbcc('0x143'),'foreignKey':_0xdbcc('0x189')});db[_0xdbcc('0x9d')][_0xdbcc('0xef')](db[_0xdbcc('0x9d')],{'as':_0xdbcc('0x18e'),'foreignKey':_0xdbcc('0x18b')});db[_0xdbcc('0x9d')][_0xdbcc('0xef')](db[_0xdbcc('0x9d')],{'as':_0xdbcc('0x193'),'foreignKey':'DescriptionId'});db['SugarcrmField'][_0xdbcc('0xef')](db[_0xdbcc('0x9d')],{'as':'Field','foreignKey':_0xdbcc('0x190')});db[_0xdbcc('0x9d')]['belongsTo'](db[_0xdbcc('0x86')],{'as':_0xdbcc('0x86'),'foreignKey':_0xdbcc('0x191')});db[_0xdbcc('0x194')][_0xdbcc('0xef')](db['DeskConfiguration'],{'as':_0xdbcc('0x192'),'onDelete':_0xdbcc('0xed'),'foreignKey':'AccountId'});db[_0xdbcc('0x9e')]['hasMany'](db['DeskField'],{'as':_0xdbcc('0x18a'),'onDelete':_0xdbcc('0xed'),'foreignKey':_0xdbcc('0x18b')});db[_0xdbcc('0x9e')][_0xdbcc('0xef')](db[_0xdbcc('0xa0')],{'as':_0xdbcc('0x18c'),'onDelete':'cascade','foreignKey':_0xdbcc('0x18d')});db[_0xdbcc('0x9e')][_0xdbcc('0xef')](db[_0xdbcc('0xa0')],{'as':'Fields','onDelete':'cascade','foreignKey':_0xdbcc('0x190')});db['DeskConfiguration'][_0xdbcc('0xfc')](db[_0xdbcc('0x194')],{'as':_0xdbcc('0x143'),'foreignKey':_0xdbcc('0x189')});db[_0xdbcc('0x9e')][_0xdbcc('0xfe')](db[_0xdbcc('0x82')],{'through':_0xdbcc('0x195')});db[_0xdbcc('0xa0')][_0xdbcc('0xef')](db[_0xdbcc('0xa0')],{'as':_0xdbcc('0x18e'),'foreignKey':_0xdbcc('0x18b')});db[_0xdbcc('0xa0')][_0xdbcc('0xef')](db[_0xdbcc('0xa0')],{'as':'Description','foreignKey':_0xdbcc('0x18d')});db['DeskField'][_0xdbcc('0xef')](db[_0xdbcc('0xa0')],{'as':_0xdbcc('0x18f'),'foreignKey':_0xdbcc('0x190')});db[_0xdbcc('0xa0')][_0xdbcc('0xfc')](db[_0xdbcc('0x86')],{'as':_0xdbcc('0x86'),'foreignKey':'VariableId'});db[_0xdbcc('0xa2')][_0xdbcc('0xef')](db[_0xdbcc('0xa4')],{'as':_0xdbcc('0x192'),'onDelete':_0xdbcc('0xed'),'foreignKey':_0xdbcc('0x189')});db[_0xdbcc('0xa4')][_0xdbcc('0xef')](db[_0xdbcc('0xa5')],{'as':_0xdbcc('0x18a'),'onDelete':_0xdbcc('0xed'),'foreignKey':_0xdbcc('0x18b')});db[_0xdbcc('0xa4')][_0xdbcc('0xef')](db[_0xdbcc('0xa5')],{'as':_0xdbcc('0x18c'),'onDelete':_0xdbcc('0xed'),'foreignKey':_0xdbcc('0x18d')});db[_0xdbcc('0xa4')][_0xdbcc('0xef')](db[_0xdbcc('0xa5')],{'as':_0xdbcc('0x183'),'onDelete':_0xdbcc('0xed'),'foreignKey':_0xdbcc('0x190')});db[_0xdbcc('0xa4')][_0xdbcc('0xfc')](db['ZohoAccount'],{'as':_0xdbcc('0x143'),'foreignKey':_0xdbcc('0x189')});db[_0xdbcc('0xa5')]['hasMany'](db[_0xdbcc('0xa5')],{'as':_0xdbcc('0x18e'),'foreignKey':'SubjectId'});db[_0xdbcc('0xa5')][_0xdbcc('0xef')](db['ZohoField'],{'as':'Description','foreignKey':'DescriptionId'});db[_0xdbcc('0xa5')][_0xdbcc('0xef')](db['ZohoField'],{'as':_0xdbcc('0x18f'),'foreignKey':'FieldId'});db['ZohoField'][_0xdbcc('0xfc')](db[_0xdbcc('0x86')],{'as':_0xdbcc('0x86'),'foreignKey':'VariableId'});db[_0xdbcc('0xa6')]['hasMany'](db['ZendeskConfiguration'],{'as':'Configurations','onDelete':_0xdbcc('0xed'),'foreignKey':_0xdbcc('0x189')});db[_0xdbcc('0x196')][_0xdbcc('0xef')](db[_0xdbcc('0x197')],{'as':_0xdbcc('0x18a'),'foreignKey':_0xdbcc('0x18b')});db['ZendeskConfiguration'][_0xdbcc('0xef')](db[_0xdbcc('0x197')],{'as':'Descriptions','foreignKey':_0xdbcc('0x18d')});db[_0xdbcc('0x196')]['hasMany'](db[_0xdbcc('0x197')],{'as':'Fields','foreignKey':_0xdbcc('0x190')});db[_0xdbcc('0x196')][_0xdbcc('0xfc')](db[_0xdbcc('0xa6')],{'as':_0xdbcc('0x143'),'foreignKey':_0xdbcc('0x189')});db['ZendeskConfiguration']['belongsToMany'](db['Tag'],{'through':_0xdbcc('0x198')});db['ZendeskField'][_0xdbcc('0xef')](db['ZendeskField'],{'as':_0xdbcc('0x18e'),'foreignKey':_0xdbcc('0x18b')});db['ZendeskField'][_0xdbcc('0xef')](db['ZendeskField'],{'as':_0xdbcc('0x193'),'foreignKey':_0xdbcc('0x18d')});db[_0xdbcc('0x197')][_0xdbcc('0xef')](db[_0xdbcc('0x197')],{'as':_0xdbcc('0x18f'),'foreignKey':_0xdbcc('0x190')});db[_0xdbcc('0x197')][_0xdbcc('0xfc')](db[_0xdbcc('0x86')],{'as':_0xdbcc('0x86'),'foreignKey':_0xdbcc('0x191')});db[_0xdbcc('0x199')][_0xdbcc('0xef')](db['FreshdeskConfiguration'],{'as':'Configurations','onDelete':_0xdbcc('0xed'),'foreignKey':'AccountId'});db['FreshdeskConfiguration'][_0xdbcc('0xef')](db[_0xdbcc('0xab')],{'as':_0xdbcc('0x18a'),'onDelete':_0xdbcc('0xed'),'foreignKey':_0xdbcc('0x18b')});db['FreshdeskConfiguration']['hasMany'](db['FreshdeskField'],{'as':'Descriptions','onDelete':_0xdbcc('0xed'),'foreignKey':_0xdbcc('0x18d')});db[_0xdbcc('0x19a')][_0xdbcc('0xef')](db['FreshdeskField'],{'as':_0xdbcc('0x183'),'onDelete':_0xdbcc('0xed'),'foreignKey':_0xdbcc('0x190')});db[_0xdbcc('0x19a')]['belongsTo'](db[_0xdbcc('0x199')],{'as':'Account','foreignKey':'AccountId'});db[_0xdbcc('0x19a')][_0xdbcc('0xfe')](db[_0xdbcc('0x82')],{'through':'int_freshdesk_configuration_has_tags'});db['FreshdeskField'][_0xdbcc('0xef')](db[_0xdbcc('0xab')],{'as':_0xdbcc('0x18e'),'foreignKey':_0xdbcc('0x18b')});db[_0xdbcc('0xab')]['hasMany'](db['FreshdeskField'],{'as':'Description','foreignKey':_0xdbcc('0x18d')});db[_0xdbcc('0xab')][_0xdbcc('0xef')](db[_0xdbcc('0xab')],{'as':_0xdbcc('0x18f'),'foreignKey':'FieldId'});db[_0xdbcc('0xab')]['belongsTo'](db[_0xdbcc('0x86')],{'as':_0xdbcc('0x86'),'foreignKey':_0xdbcc('0x191')});db[_0xdbcc('0xac')][_0xdbcc('0xef')](db[_0xdbcc('0x19b')],{'as':_0xdbcc('0x192'),'onDelete':_0xdbcc('0xed'),'foreignKey':_0xdbcc('0x189')});db[_0xdbcc('0x19b')][_0xdbcc('0xef')](db['VtigerField'],{'as':_0xdbcc('0x18a'),'foreignKey':_0xdbcc('0x18b')});db[_0xdbcc('0x19b')][_0xdbcc('0xef')](db[_0xdbcc('0xaf')],{'as':_0xdbcc('0x18c'),'foreignKey':'DescriptionId'});db[_0xdbcc('0x19b')][_0xdbcc('0xef')](db['VtigerField'],{'as':'Fields','foreignKey':'FieldId'});db[_0xdbcc('0x19b')][_0xdbcc('0xfc')](db[_0xdbcc('0xac')],{'as':'Account','foreignKey':_0xdbcc('0x189')});db[_0xdbcc('0xaf')][_0xdbcc('0xef')](db['VtigerField'],{'as':'Subject','foreignKey':_0xdbcc('0x18b')});db[_0xdbcc('0xaf')][_0xdbcc('0xef')](db[_0xdbcc('0xaf')],{'as':_0xdbcc('0x193'),'foreignKey':_0xdbcc('0x18d')});db[_0xdbcc('0xaf')][_0xdbcc('0xef')](db[_0xdbcc('0xaf')],{'as':_0xdbcc('0x18f'),'foreignKey':_0xdbcc('0x190')});db[_0xdbcc('0xaf')]['belongsTo'](db[_0xdbcc('0x86')],{'as':_0xdbcc('0x86'),'foreignKey':_0xdbcc('0x191')});db[_0xdbcc('0x19c')][_0xdbcc('0xef')](db[_0xdbcc('0xb1')],{'as':_0xdbcc('0x192'),'onDelete':_0xdbcc('0xed'),'foreignKey':_0xdbcc('0x189')});db[_0xdbcc('0xb1')][_0xdbcc('0xef')](db[_0xdbcc('0xb3')],{'as':_0xdbcc('0x18a'),'foreignKey':_0xdbcc('0x18b')});db['ServicenowConfiguration'][_0xdbcc('0xef')](db[_0xdbcc('0xb3')],{'as':_0xdbcc('0x18c'),'foreignKey':_0xdbcc('0x18d')});db['ServicenowConfiguration'][_0xdbcc('0xef')](db[_0xdbcc('0xb3')],{'as':_0xdbcc('0x183'),'foreignKey':'FieldId'});db[_0xdbcc('0xb1')]['belongsTo'](db['ServicenowAccount'],{'as':_0xdbcc('0x143'),'foreignKey':'AccountId'});db[_0xdbcc('0xb3')][_0xdbcc('0xef')](db['ServicenowField'],{'as':_0xdbcc('0x18e'),'foreignKey':_0xdbcc('0x18b')});db[_0xdbcc('0xb3')]['hasMany'](db[_0xdbcc('0xb3')],{'as':'Description','foreignKey':_0xdbcc('0x18d')});db[_0xdbcc('0xb3')][_0xdbcc('0xef')](db[_0xdbcc('0xb3')],{'as':_0xdbcc('0x18f'),'foreignKey':_0xdbcc('0x190')});db[_0xdbcc('0xb3')][_0xdbcc('0xfc')](db['Variable'],{'as':_0xdbcc('0x86'),'foreignKey':_0xdbcc('0x191')});db[_0xdbcc('0x19d')][_0xdbcc('0xef')](db['Dynamics365Configuration'],{'as':'Configurations','onDelete':_0xdbcc('0xed'),'foreignKey':_0xdbcc('0x189')});db[_0xdbcc('0xb6')][_0xdbcc('0xef')](db[_0xdbcc('0x19e')],{'as':_0xdbcc('0x18a'),'onDelete':_0xdbcc('0xed'),'foreignKey':_0xdbcc('0x18b')});db[_0xdbcc('0xb6')][_0xdbcc('0xef')](db[_0xdbcc('0x19e')],{'as':_0xdbcc('0x18c'),'onDelete':_0xdbcc('0xed'),'foreignKey':_0xdbcc('0x18d')});db[_0xdbcc('0xb6')][_0xdbcc('0xef')](db[_0xdbcc('0x19e')],{'as':_0xdbcc('0x183'),'onDelete':_0xdbcc('0xed'),'foreignKey':_0xdbcc('0x190')});db[_0xdbcc('0xb6')][_0xdbcc('0xfc')](db['Dynamics365Account'],{'as':_0xdbcc('0x143'),'foreignKey':_0xdbcc('0x189')});db[_0xdbcc('0x19e')][_0xdbcc('0xef')](db[_0xdbcc('0x19e')],{'as':_0xdbcc('0x18e'),'foreignKey':_0xdbcc('0x18b')});db[_0xdbcc('0x19e')][_0xdbcc('0xef')](db[_0xdbcc('0x19e')],{'as':_0xdbcc('0x193'),'foreignKey':_0xdbcc('0x18d')});db[_0xdbcc('0x19e')]['hasMany'](db[_0xdbcc('0x19e')],{'as':_0xdbcc('0x18f'),'foreignKey':_0xdbcc('0x190')});db[_0xdbcc('0x19e')][_0xdbcc('0xfc')](db[_0xdbcc('0x86')],{'as':'Variable','foreignKey':_0xdbcc('0x191')});db[_0xdbcc('0xb8')][_0xdbcc('0xef')](db[_0xdbcc('0x19f')],{'as':'Configurations','onDelete':_0xdbcc('0xed'),'foreignKey':_0xdbcc('0x189')});db[_0xdbcc('0x19f')][_0xdbcc('0xef')](db['FreshsalesField'],{'as':_0xdbcc('0x18a'),'foreignKey':_0xdbcc('0x18b')});db['FreshsalesConfiguration']['hasMany'](db[_0xdbcc('0x1a0')],{'as':_0xdbcc('0x18c'),'foreignKey':'DescriptionId'});db[_0xdbcc('0x19f')][_0xdbcc('0xef')](db[_0xdbcc('0x1a0')],{'as':_0xdbcc('0x183'),'foreignKey':_0xdbcc('0x190')});db[_0xdbcc('0x19f')][_0xdbcc('0xfc')](db[_0xdbcc('0xb8')],{'as':'Account','foreignKey':_0xdbcc('0x189')});db[_0xdbcc('0x1a0')][_0xdbcc('0xef')](db['FreshsalesField'],{'as':_0xdbcc('0x18e'),'foreignKey':'SubjectId'});db['FreshsalesField'][_0xdbcc('0xef')](db[_0xdbcc('0x1a0')],{'as':'Description','foreignKey':_0xdbcc('0x18d')});db[_0xdbcc('0x1a0')][_0xdbcc('0xef')](db[_0xdbcc('0x1a0')],{'as':'Field','foreignKey':_0xdbcc('0x190')});db[_0xdbcc('0x1a0')][_0xdbcc('0xfc')](db['Variable'],{'as':_0xdbcc('0x86'),'foreignKey':'VariableId'});db[_0xdbcc('0xbe')][_0xdbcc('0xfc')](db['ChatWebsite'],{});db[_0xdbcc('0xbe')][_0xdbcc('0xfc')](db[_0xdbcc('0xe5')],{'as':_0xdbcc('0x14a'),'foreignKey':_0xdbcc('0x13d')});db[_0xdbcc('0xbe')][_0xdbcc('0xfc')](db[_0xdbcc('0xff')],{'as':'Contact','foreignKey':_0xdbcc('0x14b')});db[_0xdbcc('0xbe')][_0xdbcc('0xfc')](db[_0xdbcc('0x5d')],{});db['ChatQueueReport']['belongsTo'](db[_0xdbcc('0x5f')],{});db[_0xdbcc('0xbe')][_0xdbcc('0xfc')](db[_0xdbcc('0xeb')],{});db[_0xdbcc('0xbe')]['belongsTo'](db[_0xdbcc('0x63')],{});db['ChatInternalMessage'][_0xdbcc('0xfc')](db[_0xdbcc('0xeb')],{'onDelete':_0xdbcc('0xed'),'foreignKey':_0xdbcc('0x1a1')});db['ChatInternalMessage'][_0xdbcc('0xfc')](db[_0xdbcc('0xeb')],{'onDelete':'cascade','foreignKey':_0xdbcc('0x1a2')});db[_0xdbcc('0xc5')][_0xdbcc('0xef')](db[_0xdbcc('0xc3')],{'foreignKey':_0xdbcc('0x1a3'),'onDelete':_0xdbcc('0xed')});db['JscriptySessionReport']['hasMany'](db[_0xdbcc('0xc1')],{'foreignKey':_0xdbcc('0x1a3'),'onDelete':'cascade'});db['SmsQueueReport']['belongsTo'](db['SmsAccount'],{});db[_0xdbcc('0xc7')][_0xdbcc('0xfc')](db[_0xdbcc('0xe5')],{'as':_0xdbcc('0x14a'),'foreignKey':_0xdbcc('0x13d')});db[_0xdbcc('0xc7')][_0xdbcc('0xfc')](db[_0xdbcc('0xff')],{'as':'Contact','foreignKey':_0xdbcc('0x14b')});db[_0xdbcc('0xc7')][_0xdbcc('0xfc')](db[_0xdbcc('0x4d')],{});db[_0xdbcc('0xc7')][_0xdbcc('0xfc')](db[_0xdbcc('0x4e')],{});db[_0xdbcc('0xc7')][_0xdbcc('0xfc')](db[_0xdbcc('0xeb')],{});db[_0xdbcc('0xc7')][_0xdbcc('0xfc')](db[_0xdbcc('0x10c')],{});db['JscriptyProject']['hasMany'](db[_0xdbcc('0xc5')],{'foreignKey':_0xdbcc('0x1a4')});db[_0xdbcc('0xca')][_0xdbcc('0xef')](db[_0xdbcc('0xc3')],{'foreignKey':_0xdbcc('0x1a4')});db['JscriptyProject']['hasMany'](db['JscriptyAnswerReport'],{'foreignKey':_0xdbcc('0x1a4')});db[_0xdbcc('0xd0')]['belongsToMany'](db[_0xdbcc('0xeb')],{'as':_0xdbcc('0x159'),'through':_0xdbcc('0x11c')});db[_0xdbcc('0xd4')][_0xdbcc('0xfe')](db[_0xdbcc('0xeb')],{'as':_0xdbcc('0x140'),'through':_0xdbcc('0x103')});db['Team']['belongsToMany'](db[_0xdbcc('0x120')],{'through':_0xdbcc('0x12a'),'as':_0xdbcc('0x108')});db[_0xdbcc('0xd4')][_0xdbcc('0xfe')](db[_0xdbcc('0x39')],{'through':_0xdbcc('0x141'),'as':'MailQueues'});db['Team']['belongsToMany'](db['ChatQueue'],{'through':_0xdbcc('0x1a5'),'as':'ChatQueues'});db[_0xdbcc('0xd4')][_0xdbcc('0xfe')](db[_0xdbcc('0x49')],{'through':'team_has_fax_queues','as':_0xdbcc('0x10b')});db[_0xdbcc('0xd4')][_0xdbcc('0xfe')](db[_0xdbcc('0x10c')],{'through':_0xdbcc('0x15a'),'as':_0xdbcc('0x10d')});db['Team'][_0xdbcc('0xfe')](db[_0xdbcc('0x10f')],{'through':_0xdbcc('0x1a6'),'as':_0xdbcc('0x1a7')});db[_0xdbcc('0xd7')]['hasMany'](db[_0xdbcc('0x6a')],{'as':_0xdbcc('0x122'),'foreignKey':'CampaignId'});db[_0xdbcc('0xd7')][_0xdbcc('0xef')](db[_0xdbcc('0x6c')],{'as':'HopperFinals','foreignKey':_0xdbcc('0x16f')});db[_0xdbcc('0xd7')][_0xdbcc('0xef')](db['CmHopperHistory'],{'as':_0xdbcc('0x1a8'),'foreignKey':_0xdbcc('0x16f')});db[_0xdbcc('0xd7')][_0xdbcc('0xef')](db[_0xdbcc('0x6b')],{'as':_0xdbcc('0x1a9'),'foreignKey':'CampaignId'});db['Campaign'][_0xdbcc('0xfc')](db[_0xdbcc('0x2b')],{'as':_0xdbcc('0x2b'),'foreignKey':_0xdbcc('0x124')});db['Campaign'][_0xdbcc('0xfc')](db['Trunk'],{'as':_0xdbcc('0x1aa'),'foreignKey':_0xdbcc('0x1ab')});db[_0xdbcc('0xd7')][_0xdbcc('0xfc')](db[_0xdbcc('0x78')],{'as':_0xdbcc('0x78'),'foreignKey':_0xdbcc('0x125')});db[_0xdbcc('0xd7')][_0xdbcc('0xfc')](db[_0xdbcc('0xd0')],{'as':_0xdbcc('0xd0'),'foreignKey':_0xdbcc('0x1ac')});db[_0xdbcc('0xd7')]['belongsToMany'](db['CmList'],{'as':'Lists','through':_0xdbcc('0x1ad')});db['Campaign'][_0xdbcc('0xfe')](db[_0xdbcc('0xe5')],{'as':_0xdbcc('0x12b'),'through':_0xdbcc('0x1ae')});db['MailTransferReport'][_0xdbcc('0xfc')](db['MailMessage'],{});db[_0xdbcc('0xdb')][_0xdbcc('0xfc')](db[_0xdbcc('0x3c')],{});db[_0xdbcc('0xdb')][_0xdbcc('0xfc')](db[_0xdbcc('0x37')],{'foreignKey':_0xdbcc('0x1af'),'as':'FromAccount'});db['MailTransferReport'][_0xdbcc('0xfc')](db[_0xdbcc('0xeb')],{'foreignKey':_0xdbcc('0x1b0'),'as':_0xdbcc('0x1b1')});db[_0xdbcc('0xdb')][_0xdbcc('0xfc')](db[_0xdbcc('0xeb')],{'foreignKey':'ToUserId','as':'ToAgent'});db['MailTransferReport'][_0xdbcc('0xfc')](db[_0xdbcc('0x39')],{'foreignKey':_0xdbcc('0x1b2'),'as':_0xdbcc('0x1b3')});db[_0xdbcc('0xdb')]['belongsTo'](db['MailAccount'],{'foreignKey':_0xdbcc('0x1b4'),'as':_0xdbcc('0x1b5')});db['ChatTransferReport']['belongsTo'](db['ChatMessage'],{});db[_0xdbcc('0xdd')]['belongsTo'](db[_0xdbcc('0x5d')],{});db[_0xdbcc('0xdd')][_0xdbcc('0xfc')](db[_0xdbcc('0x59')],{'foreignKey':_0xdbcc('0x1b6'),'as':_0xdbcc('0x1b7')});db['ChatTransferReport'][_0xdbcc('0xfc')](db[_0xdbcc('0xeb')],{'foreignKey':_0xdbcc('0x1b0'),'as':_0xdbcc('0x1b1')});db['ChatTransferReport'][_0xdbcc('0xfc')](db[_0xdbcc('0xeb')],{'foreignKey':_0xdbcc('0x1b8'),'as':_0xdbcc('0x1b9')});db['ChatTransferReport'][_0xdbcc('0xfc')](db[_0xdbcc('0x63')],{'foreignKey':'ToChatQueueId','as':_0xdbcc('0x1b3')});db['ChatTransferReport']['belongsTo'](db[_0xdbcc('0x59')],{'foreignKey':'ToChatWebsiteId','as':_0xdbcc('0x1b5')});db[_0xdbcc('0xdf')][_0xdbcc('0xfc')](db[_0xdbcc('0x14f')],{});db[_0xdbcc('0xdf')][_0xdbcc('0xfc')](db[_0xdbcc('0xfa')],{});db[_0xdbcc('0xdf')][_0xdbcc('0xfc')](db['FaxAccount'],{'foreignKey':_0xdbcc('0x1ba'),'as':_0xdbcc('0x1b7')});db['FaxTransferReport']['belongsTo'](db['User'],{'foreignKey':_0xdbcc('0x1b0'),'as':_0xdbcc('0x1b1')});db[_0xdbcc('0xdf')][_0xdbcc('0xfc')](db[_0xdbcc('0xeb')],{'foreignKey':_0xdbcc('0x1b8'),'as':'ToAgent'});db[_0xdbcc('0xdf')][_0xdbcc('0xfc')](db[_0xdbcc('0x49')],{'foreignKey':'ToFaxQueueId','as':_0xdbcc('0x1b3')});db[_0xdbcc('0xdf')][_0xdbcc('0xfc')](db[_0xdbcc('0x45')],{'foreignKey':_0xdbcc('0x1bb'),'as':'ToAccount'});db[_0xdbcc('0xe1')][_0xdbcc('0xfc')](db[_0xdbcc('0x57')],{});db[_0xdbcc('0xe1')][_0xdbcc('0xfc')](db[_0xdbcc('0x55')],{});db[_0xdbcc('0xe1')][_0xdbcc('0xfc')](db[_0xdbcc('0x51')],{'foreignKey':'FromOpenchannelAccountId','as':_0xdbcc('0x1b7')});db[_0xdbcc('0xe1')]['belongsTo'](db[_0xdbcc('0xeb')],{'foreignKey':_0xdbcc('0x1b0'),'as':'FromAgent'});db[_0xdbcc('0xe1')][_0xdbcc('0xfc')](db['User'],{'foreignKey':'ToUserId','as':_0xdbcc('0x1b9')});db[_0xdbcc('0xe1')]['belongsTo'](db['OpenchannelQueue'],{'foreignKey':_0xdbcc('0x1bc'),'as':'ToQueue'});db[_0xdbcc('0xe1')]['belongsTo'](db[_0xdbcc('0x51')],{'foreignKey':_0xdbcc('0x1bd'),'as':_0xdbcc('0x1b5')});db[_0xdbcc('0xe3')]['belongsTo'](db['SmsMessage'],{});db['SmsTransferReport'][_0xdbcc('0xfc')](db['SmsInteraction'],{});db[_0xdbcc('0xe3')][_0xdbcc('0xfc')](db[_0xdbcc('0x11a')],{'foreignKey':'FromSmsAccountId','as':_0xdbcc('0x1b7')});db[_0xdbcc('0xe3')]['belongsTo'](db[_0xdbcc('0xeb')],{'foreignKey':'FromUserId','as':_0xdbcc('0x1b1')});db[_0xdbcc('0xe3')]['belongsTo'](db[_0xdbcc('0xeb')],{'foreignKey':'ToUserId','as':_0xdbcc('0x1b9')});db[_0xdbcc('0xe3')][_0xdbcc('0xfc')](db[_0xdbcc('0x10c')],{'foreignKey':_0xdbcc('0x1be'),'as':_0xdbcc('0x1b3')});db['SmsTransferReport'][_0xdbcc('0xfc')](db['SmsAccount'],{'foreignKey':'ToSmsAccountId','as':_0xdbcc('0x1b5')});db[_0xdbcc('0xe5')][_0xdbcc('0xef')](db[_0xdbcc('0x74')],{'as':_0xdbcc('0x14d'),'foreignKey':_0xdbcc('0x13d')});db[_0xdbcc('0xe5')][_0xdbcc('0xef')](db['CmCustomField'],{'as':_0xdbcc('0x1bf'),'foreignKey':'ListId'});db[_0xdbcc('0xe5')][_0xdbcc('0xef')](db[_0xdbcc('0xff')],{'as':'Contacts','onDelete':_0xdbcc('0xed'),'foreignKey':_0xdbcc('0x13d')});db[_0xdbcc('0xe5')][_0xdbcc('0xef')](db[_0xdbcc('0x6c')],{'as':_0xdbcc('0xf3'),'foreignKey':_0xdbcc('0x13d')});db[_0xdbcc('0xe5')][_0xdbcc('0xef')](db[_0xdbcc('0xf4')],{'as':_0xdbcc('0xf5'),'foreignKey':_0xdbcc('0x13d')});db['CmList'][_0xdbcc('0xef')](db['ReportAgentPreview'],{'as':_0xdbcc('0xf6'),'foreignKey':'ListId'});db[_0xdbcc('0xe5')][_0xdbcc('0xfe')](db[_0xdbcc('0x120')],{'as':_0xdbcc('0x1c0'),'through':_0xdbcc('0x1c1')});db['CmList'][_0xdbcc('0xfe')](db[_0xdbcc('0xeb')],{'as':_0xdbcc('0x140'),'through':_0xdbcc('0x1c2')});db['VoicePrefix'][_0xdbcc('0xef')](db['VoiceExtension'],{'as':_0xdbcc('0xf2'),'onDelete':'restrict'});db[_0xdbcc('0x111')][_0xdbcc('0xfe')](db[_0xdbcc('0xeb')],{'as':_0xdbcc('0x140'),'through':_0xdbcc('0x1c3')});db[_0xdbcc('0xe8')][_0xdbcc('0xef')](db[_0xdbcc('0xeb')],{'as':_0xdbcc('0x159'),'foreignKey':_0xdbcc('0xfd')});db[_0xdbcc('0xe8')][_0xdbcc('0xef')](db[_0xdbcc('0xea')],{'as':_0xdbcc('0x1c4'),'foreignKey':'userProfileId','onDelete':_0xdbcc('0xed')});db['UserProfileSection'][_0xdbcc('0xef')](db[_0xdbcc('0x1c5')],{'as':_0xdbcc('0x1c6'),'foreignKey':_0xdbcc('0x1c7'),'onDelete':'cascade'});module[_0xdbcc('0x1c8')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 18ff3b8..17cd345 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb3da=['./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelQueue','./api/openchannelQueueReport','/api/chat/applications','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','./api/chatQueue','/api/chat/groups','/api/cm/companies','./api/cmCompany','/api/cm/contacts','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','./api/cmHopperFinal','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','./api/action','/api/automations','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','./api/tag','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','./api/intZohoConfiguration','/api/integrations/zoho/fields','/api/integrations/zendesk/accounts','./api/intZendeskAccount','./api/intZendeskConfiguration','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','./api/intVtigerAccount','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intDynamics365Account','./api/intDynamics365Configuration','./api/intDynamics365Field','/api/integrations/freshsales/accounts','/api/integrations/freshsales/configurations','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','/api/square/odbc','./api/squareOdbc','/api/square/recordings','/api/square/messages','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','./api/migration','/api/plugins','./api/plugin','/api/mail/reports/transfer','/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/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/jira','./api/jira','./api/rpc','/api/version','./api/system','/api/pm2','./api/pm2','join','root','/apidoc','static','/www','/demo','snippet','1.0.16','/plugins','/server/files/plugins','/:url(api|auth|components|app|bower_components|assets)/*','get','route','sendFile','resolve','appPath','/index.html','path','express-winston','./errors','./config/logger','api','auth','logger','format','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','method','headers','x-forwarded-for','connection','remoteAddress','responseTime','user','role','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','body','device','agent_id','url','statusCode','name','other','agent_name','test','use','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','./api/voiceMailMessage','/api/voice/calls/reports','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','./api/memberReport','/api/trunks','/api/voice/transfers/reports','/api/mail/out_servers','./api/mailServerOut','./api/mailAccount','./api/mailQueue','./api/mailSubstatus','/api/mail/interactions','/api/mail/messages','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboardItem','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/queues','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xb3da,0xb3));var _0xab3d=function(_0x13fee9,_0x53a287){_0x13fee9=_0x13fee9-0x0;var _0x423626=_0xb3da[_0x13fee9];return _0x423626;};'use strict';var path=require(_0xab3d('0x0'));var express=require('express');var ewinston=require(_0xab3d('0x1'));var util=require('util');var errors=require(_0xab3d('0x2'));var config=require('./config/environment');var logger=require(_0xab3d('0x3'))(_0xab3d('0x4'));var authLogger=require(_0xab3d('0x3'))(_0xab3d('0x5'));exports['default']=function(_0x529bb4){_0x529bb4['use'](ewinston[_0xab3d('0x6')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x357530,_0x2c656f){return util[_0xab3d('0x7')](_0xab3d('0x8'),_0x357530[_0xab3d('0x9')],_0x357530[_0xab3d('0xa')]['x-forwarded-for']?_0x357530[_0xab3d('0xa')][_0xab3d('0xb')]:_0x357530[_0xab3d('0xc')][_0xab3d('0xd')]||_0x357530['ip'],_0x357530['url'],_0x2c656f['statusCode'],_0x2c656f[_0xab3d('0xe')],_0x357530[_0xab3d('0xf')]?_0x357530[_0xab3d('0xf')]['id']:null,_0x357530[_0xab3d('0xf')]?_0x357530[_0xab3d('0xf')]['name']:null,_0x357530[_0xab3d('0xf')]?_0x357530['user'][_0xab3d('0x10')]:null);}}));_0x529bb4['use'](ewinston[_0xab3d('0x6')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x5bddac,_0x1b067b){var _0x285759=_0xab3d('0x11');if(_0x5bddac['body']&&_0x5bddac[_0xab3d('0x12')][_0xab3d('0x13')]&&_0x5bddac[_0xab3d('0x12')][_0xab3d('0x14')]){_0x285759='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util[_0xab3d('0x7')](_0x285759,_0x5bddac[_0xab3d('0x9')],_0x5bddac['headers'][_0xab3d('0xb')]?_0x5bddac['headers'][_0xab3d('0xb')]:_0x5bddac[_0xab3d('0xc')][_0xab3d('0xd')]||_0x5bddac['ip'],_0x5bddac[_0xab3d('0x15')],_0x1b067b[_0xab3d('0x16')],_0x1b067b[_0xab3d('0xe')],_0x5bddac[_0xab3d('0xf')]?_0x5bddac[_0xab3d('0xf')]['id']:null,_0x5bddac[_0xab3d('0xf')]?_0x5bddac['user'][_0xab3d('0x17')]:null,_0x5bddac['user']?_0x5bddac[_0xab3d('0xf')]['role']:null,_0x5bddac[_0xab3d('0x12')]&&_0x5bddac[_0xab3d('0x12')][_0xab3d('0x13')]?_0x5bddac[_0xab3d('0x12')][_0xab3d('0x13')]:_0xab3d('0x18'),_0x5bddac[_0xab3d('0x12')]&&_0x5bddac[_0xab3d('0x12')][_0xab3d('0x14')]?_0x5bddac[_0xab3d('0x12')][_0xab3d('0x14')]:'',_0x5bddac['body']&&_0x5bddac[_0xab3d('0x12')][_0xab3d('0x19')]?_0x5bddac[_0xab3d('0x12')][_0xab3d('0x19')]:'');},'ignoreRoute':function(_0x3e5111){var _0x11c8b0=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x11c8b0[_0xab3d('0x1a')](_0x3e5111[_0xab3d('0x15')]);}}));_0x529bb4[_0xab3d('0x1b')]('/api/users',require(_0xab3d('0x1c')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x1d'),require(_0xab3d('0x1e')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x1f'),require('./api/voiceContext'));_0x529bb4[_0xab3d('0x1b')]('/api/voice/extensions',require(_0xab3d('0x20')));_0x529bb4['use'](_0xab3d('0x21'),require(_0xab3d('0x22')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x23'),require('./api/voiceQueue'));_0x529bb4['use']('/api/voice/recordings',require('./api/voiceRecording'));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x24'),require(_0xab3d('0x25')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x26'),require(_0xab3d('0x27')));_0x529bb4[_0xab3d('0x1b')]('/api/voice/mails/messages',require(_0xab3d('0x28')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x29'),require('./api/voiceCallReport'));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x2a'),require(_0xab3d('0x2b')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x2c'),require(_0xab3d('0x2d')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x2e'),require(_0xab3d('0x2f')));_0x529bb4[_0xab3d('0x1b')]('/api/members/reports',require(_0xab3d('0x30')));_0x529bb4['use'](_0xab3d('0x31'),require('./api/trunk'));_0x529bb4['use'](_0xab3d('0x32'),require('./api/voiceTransferReport'));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x33'),require(_0xab3d('0x34')));_0x529bb4['use']('/api/mail/accounts',require(_0xab3d('0x35')));_0x529bb4[_0xab3d('0x1b')]('/api/mail/queues',require(_0xab3d('0x36')));_0x529bb4[_0xab3d('0x1b')]('/api/mail/substatuses',require(_0xab3d('0x37')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x38'),require('./api/mailInteraction'));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x39'),require('./api/mailMessage'));_0x529bb4['use'](_0xab3d('0x3a'),require(_0xab3d('0x3b')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x3c'),require(_0xab3d('0x3d')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x3e'),require('./api/dashboard'));_0x529bb4[_0xab3d('0x1b')]('/api/dashboards/items',require(_0xab3d('0x3f')));_0x529bb4[_0xab3d('0x1b')]('/api/fax/accounts',require(_0xab3d('0x40')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x41'),require(_0xab3d('0x42')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x43'),require(_0xab3d('0x44')));_0x529bb4['use'](_0xab3d('0x45'),require(_0xab3d('0x46')));_0x529bb4['use'](_0xab3d('0x47'),require(_0xab3d('0x48')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x49'),require(_0xab3d('0x4a')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x4b'),require('./api/smsAccount'));_0x529bb4['use'](_0xab3d('0x4c'),require(_0xab3d('0x4d')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x4e'),require(_0xab3d('0x4f')));_0x529bb4[_0xab3d('0x1b')]('/api/sms/messages',require('./api/smsMessage'));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x50'),require('./api/smsQueue'));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x51'),require(_0xab3d('0x52')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x53'),require(_0xab3d('0x54')));_0x529bb4['use'](_0xab3d('0x55'),require('./api/openchannelInteraction'));_0x529bb4[_0xab3d('0x1b')]('/api/openchannel/messages',require('./api/openchannelMessage'));_0x529bb4[_0xab3d('0x1b')]('/api/openchannel/queues',require(_0xab3d('0x56')));_0x529bb4[_0xab3d('0x1b')]('/api/chat/websites',require('./api/chatWebsite'));_0x529bb4[_0xab3d('0x1b')]('/api/openchannel/reports/queue',require(_0xab3d('0x57')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x58'),require('./api/chatApplication'));_0x529bb4['use'](_0xab3d('0x59'),require(_0xab3d('0x5a')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x5b'),require(_0xab3d('0x5c')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x5d'),require(_0xab3d('0x5e')));_0x529bb4[_0xab3d('0x1b')]('/api/chat/queues',require(_0xab3d('0x5f')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x60'),require('./api/chatGroup'));_0x529bb4[_0xab3d('0x1b')]('/api/chat/proactive_actions',require('./api/chatProactiveAction'));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x61'),require(_0xab3d('0x62')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x63'),require('./api/cmContact'));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x64'),require(_0xab3d('0x65')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x66'),require(_0xab3d('0x67')));_0x529bb4['use']('/api/cm/hopper_final',require(_0xab3d('0x68')));_0x529bb4[_0xab3d('0x1b')]('/api/cm/hopper_history',require(_0xab3d('0x69')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x6a'),require(_0xab3d('0x6b')));_0x529bb4[_0xab3d('0x1b')]('/api/actions',require(_0xab3d('0x6c')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x6d'),require('./api/automation'));_0x529bb4['use'](_0xab3d('0x6e'),require(_0xab3d('0x6f')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x70'),require(_0xab3d('0x71')));_0x529bb4['use'](_0xab3d('0x72'),require(_0xab3d('0x73')));_0x529bb4['use']('/api/intervals',require(_0xab3d('0x74')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x75'),require(_0xab3d('0x76')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x77'),require(_0xab3d('0x78')));_0x529bb4[_0xab3d('0x1b')]('/api/voiceQueuesLog',require(_0xab3d('0x79')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x7a'),require(_0xab3d('0x7b')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x7c'),require(_0xab3d('0x7d')));_0x529bb4[_0xab3d('0x1b')]('/api/tags',require(_0xab3d('0x7e')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x7f'),require(_0xab3d('0x80')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x81'),require(_0xab3d('0x82')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x83'),require(_0xab3d('0x84')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x85'),require(_0xab3d('0x86')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x87'),require(_0xab3d('0x88')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x89'),require(_0xab3d('0x8a')));_0x529bb4['use']('/api/analytics/default_reports',require(_0xab3d('0x8b')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x8c'),require('./api/analyticExtractedReport'));_0x529bb4['use']('/api/analytics/metrics',require(_0xab3d('0x8d')));_0x529bb4['use'](_0xab3d('0x8e'),require(_0xab3d('0x8f')));_0x529bb4['use'](_0xab3d('0x90'),require(_0xab3d('0x91')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x92'),require(_0xab3d('0x93')));_0x529bb4['use'](_0xab3d('0x94'),require('./api/intSalesforceConfiguration'));_0x529bb4[_0xab3d('0x1b')]('/api/integrations/salesforce/fields',require(_0xab3d('0x95')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x96'),require(_0xab3d('0x97')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x98'),require(_0xab3d('0x99')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x9a'),require(_0xab3d('0x9b')));_0x529bb4['use']('/api/integrations/desk/accounts',require(_0xab3d('0x9c')));_0x529bb4['use'](_0xab3d('0x9d'),require('./api/intDeskConfiguration'));_0x529bb4[_0xab3d('0x1b')]('/api/integrations/desk/fields',require(_0xab3d('0x9e')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0x9f'),require(_0xab3d('0xa0')));_0x529bb4[_0xab3d('0x1b')]('/api/integrations/zoho/configurations',require(_0xab3d('0xa1')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0xa2'),require('./api/intZohoField'));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0xa3'),require(_0xab3d('0xa4')));_0x529bb4[_0xab3d('0x1b')]('/api/integrations/zendesk/configurations',require(_0xab3d('0xa5')));_0x529bb4['use']('/api/integrations/zendesk/fields',require('./api/intZendeskField'));_0x529bb4[_0xab3d('0x1b')]('/api/integrations/freshdesk/accounts',require('./api/intFreshdeskAccount'));_0x529bb4['use'](_0xab3d('0xa6'),require(_0xab3d('0xa7')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0xa8'),require(_0xab3d('0xa9')));_0x529bb4[_0xab3d('0x1b')]('/api/integrations/vtiger/accounts',require(_0xab3d('0xaa')));_0x529bb4['use']('/api/integrations/vtiger/configurations',require(_0xab3d('0xab')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0xac'),require(_0xab3d('0xad')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0xae'),require(_0xab3d('0xaf')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0xb0'),require(_0xab3d('0xb1')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0xb2'),require('./api/intServicenowField'));_0x529bb4[_0xab3d('0x1b')]('/api/integrations/dynamics365/accounts',require(_0xab3d('0xb3')));_0x529bb4[_0xab3d('0x1b')]('/api/integrations/dynamics365/configurations',require(_0xab3d('0xb4')));_0x529bb4[_0xab3d('0x1b')]('/api/integrations/dynamics365/fields',require(_0xab3d('0xb5')));_0x529bb4['use'](_0xab3d('0xb6'),require('./api/intFreshsalesAccount'));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0xb7'),require('./api/intFreshsalesConfiguration'));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0xb8'),require(_0xab3d('0xb9')));_0x529bb4['use'](_0xab3d('0xba'),require(_0xab3d('0xbb')));_0x529bb4[_0xab3d('0x1b')]('/api/chat/reports/queue',require(_0xab3d('0xbc')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0xbd'),require(_0xab3d('0xbe')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0xbf'),require('./api/jscriptyAnswerReport'));_0x529bb4['use'](_0xab3d('0xc0'),require(_0xab3d('0xc1')));_0x529bb4[_0xab3d('0x1b')]('/api/jscripty/sessions/reports',require(_0xab3d('0xc2')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0xc3'),require(_0xab3d('0xc4')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0xc5'),require(_0xab3d('0xc6')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0xc7'),require(_0xab3d('0xc8')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0xc9'),require(_0xab3d('0xca')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0xcb'),require('./api/setting'));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0xcc'),require(_0xab3d('0xcd')));_0x529bb4[_0xab3d('0x1b')]('/api/square/projects',require('./api/squareProject'));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0xce'),require('./api/squareRecording'));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0xcf'),require('./api/squareMessage'));_0x529bb4[_0xab3d('0x1b')]('/api/teams',require(_0xab3d('0xd0')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0xd1'),require(_0xab3d('0xd2')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0xd3'),require(_0xab3d('0xd4')));_0x529bb4[_0xab3d('0x1b')]('/api/migrations',require(_0xab3d('0xd5')));_0x529bb4['use']('/api/attachments',require('./api/attachment'));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0xd6'),require(_0xab3d('0xd7')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0xd8'),require('./api/mailTransferReport'));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0xd9'),require(_0xab3d('0xda')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0xdb'),require(_0xab3d('0xdc')));_0x529bb4['use'](_0xab3d('0xdd'),require(_0xab3d('0xde')));_0x529bb4['use'](_0xab3d('0xdf'),require(_0xab3d('0xe0')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0xe1'),require(_0xab3d('0xe2')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0xe3'),require(_0xab3d('0xe4')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0xe5'),require(_0xab3d('0xe6')));_0x529bb4['use'](_0xab3d('0xe7'),require(_0xab3d('0xe8')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0xe9'),require(_0xab3d('0xea')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0xeb'),require(_0xab3d('0xec')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0xed'),require(_0xab3d('0xee')));_0x529bb4['use'](_0xab3d('0xef'),require(_0xab3d('0xf0')));_0x529bb4['use']('/api/rpc',require(_0xab3d('0xf1')));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0xf2'),require('./api/version'));_0x529bb4[_0xab3d('0x1b')]('/api/system',require(_0xab3d('0xf3')));_0x529bb4['use'](_0xab3d('0xf4'),require(_0xab3d('0xf5')));_0x529bb4[_0xab3d('0x1b')]('/apidoc',express['static'](path[_0xab3d('0xf6')](config[_0xab3d('0xf7')],_0xab3d('0xf8'))));_0x529bb4[_0xab3d('0x1b')]('/www',express[_0xab3d('0xf9')](path[_0xab3d('0xf6')](config[_0xab3d('0xf7')],_0xab3d('0xfa'))));_0x529bb4['use']('/demo',express[_0xab3d('0xf9')](path['join'](config[_0xab3d('0xf7')],_0xab3d('0xfb'))));_0x529bb4[_0xab3d('0x1b')]('/snippet',express[_0xab3d('0xf9')](path[_0xab3d('0xf6')](config['root'],_0xab3d('0xfc'),_0xab3d('0xfd'))));_0x529bb4[_0xab3d('0x1b')](_0xab3d('0xfe'),express[_0xab3d('0xf9')](path[_0xab3d('0xf6')](config[_0xab3d('0xf7')],_0xab3d('0xff'))));_0x529bb4['route'](_0xab3d('0x100'))[_0xab3d('0x101')](errors[0x194]);_0x529bb4[_0xab3d('0x102')]('/*')[_0xab3d('0x101')](function(_0x472c22,_0x5ada4a){_0x5ada4a[_0xab3d('0x103')](path[_0xab3d('0x104')](_0x529bb4[_0xab3d('0x101')](_0xab3d('0x105'))+_0xab3d('0x106')));});}; \ No newline at end of file +var _0xe6b5=['auth','default','logger','format','method','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','responseTime','user','name','role','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','body','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','device','other','agent_name','test','/api/users','/api/voice/chanspy','./api/voiceChanSpy','./api/voiceContext','/api/voice/extensions','/api/voice/mohs','./api/voiceMusicOnHold','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','/api/voice/queues/reports','/api/members/reports','/api/trunks','./api/trunk','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/applications','./api/mailApplication','./api/mailQueueReport','./api/dashboard','/api/dashboards/items','/api/fax/accounts','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','/api/chat/websites','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','/api/chat/messages','./api/chatMessage','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','./api/cmHopperFinal','/api/cm/hopper_history','/api/cm/custom_fields','/api/actions','./api/action','/api/automations','./api/automation','./api/cannedAnswer','/api/dispositions','/api/conditions','./api/condition','./api/interval','/api/pauses','./api/pause','./api/cdr','/api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','./api/tag','/api/templates','./api/template','/api/triggers','./api/trigger','./api/variable','/api/integrations','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','/api/analytics/extracted_reports','./api/analyticExtractedReport','./api/analyticMetric','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','./api/intDeskAccount','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','/api/integrations/zoho/configurations','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','./api/intVtigerAccount','/api/integrations/vtiger/configurations','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','/api/integrations/servicenow/configurations','/api/integrations/servicenow/fields','./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/intFreshsalesAccount','/api/integrations/freshsales/configurations','/api/integrations/freshsales/fields','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/squareReport','/api/square/details/reports','/api/jscripty/projects','./api/jscriptyProject','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/messages','/api/license','/api/campaigns','./api/campaign','/api/migrations','./api/attachment','/api/plugins','./api/plugin','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','./api/openchannelTransferReport','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/jira','./api/jira','/api/rpc','/api/version','./api/system','/api/pm2','./api/pm2','/apidoc','join','root','/www','/demo','/snippet','static','snippet','1.0.16','/plugins','/:url(api|auth|components|app|bower_components|assets)/*','get','route','sendFile','resolve','appPath','path','express','express-winston','./errors','./config/environment','./config/logger','api'];(function(_0x5a66e6,_0x296d7d){var _0x5502bd=function(_0x468cc2){while(--_0x468cc2){_0x5a66e6['push'](_0x5a66e6['shift']());}};_0x5502bd(++_0x296d7d);}(_0xe6b5,0x100));var _0x5e6b=function(_0x2684c,_0x4d4ede){_0x2684c=_0x2684c-0x0;var _0x496a95=_0xe6b5[_0x2684c];return _0x496a95;};'use strict';var path=require(_0x5e6b('0x0'));var express=require(_0x5e6b('0x1'));var ewinston=require(_0x5e6b('0x2'));var util=require('util');var errors=require(_0x5e6b('0x3'));var config=require(_0x5e6b('0x4'));var logger=require(_0x5e6b('0x5'))(_0x5e6b('0x6'));var authLogger=require(_0x5e6b('0x5'))(_0x5e6b('0x7'));exports[_0x5e6b('0x8')]=function(_0x4b5619){_0x4b5619['use'](ewinston[_0x5e6b('0x9')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0xec8778,_0x4dd7fb){return util[_0x5e6b('0xa')]('%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s',_0xec8778[_0x5e6b('0xb')],_0xec8778[_0x5e6b('0xc')][_0x5e6b('0xd')]?_0xec8778[_0x5e6b('0xc')][_0x5e6b('0xd')]:_0xec8778[_0x5e6b('0xe')][_0x5e6b('0xf')]||_0xec8778['ip'],_0xec8778[_0x5e6b('0x10')],_0x4dd7fb[_0x5e6b('0x11')],_0x4dd7fb[_0x5e6b('0x12')],_0xec8778[_0x5e6b('0x13')]?_0xec8778[_0x5e6b('0x13')]['id']:null,_0xec8778[_0x5e6b('0x13')]?_0xec8778[_0x5e6b('0x13')][_0x5e6b('0x14')]:null,_0xec8778[_0x5e6b('0x13')]?_0xec8778[_0x5e6b('0x13')][_0x5e6b('0x15')]:null);}}));_0x4b5619[_0x5e6b('0x16')](ewinston['logger']({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x2d79d9,_0xdaf546){var _0x261ea8=_0x5e6b('0x17');if(_0x2d79d9['body']&&_0x2d79d9[_0x5e6b('0x18')]['device']&&_0x2d79d9[_0x5e6b('0x18')][_0x5e6b('0x19')]){_0x261ea8=_0x5e6b('0x1a');}return util[_0x5e6b('0xa')](_0x261ea8,_0x2d79d9['method'],_0x2d79d9['headers']['x-forwarded-for']?_0x2d79d9[_0x5e6b('0xc')][_0x5e6b('0xd')]:_0x2d79d9[_0x5e6b('0xe')]['remoteAddress']||_0x2d79d9['ip'],_0x2d79d9[_0x5e6b('0x10')],_0xdaf546[_0x5e6b('0x11')],_0xdaf546[_0x5e6b('0x12')],_0x2d79d9[_0x5e6b('0x13')]?_0x2d79d9[_0x5e6b('0x13')]['id']:null,_0x2d79d9[_0x5e6b('0x13')]?_0x2d79d9[_0x5e6b('0x13')][_0x5e6b('0x14')]:null,_0x2d79d9[_0x5e6b('0x13')]?_0x2d79d9[_0x5e6b('0x13')][_0x5e6b('0x15')]:null,_0x2d79d9[_0x5e6b('0x18')]&&_0x2d79d9[_0x5e6b('0x18')][_0x5e6b('0x1b')]?_0x2d79d9[_0x5e6b('0x18')][_0x5e6b('0x1b')]:_0x5e6b('0x1c'),_0x2d79d9[_0x5e6b('0x18')]&&_0x2d79d9[_0x5e6b('0x18')][_0x5e6b('0x19')]?_0x2d79d9[_0x5e6b('0x18')]['agent_id']:'',_0x2d79d9[_0x5e6b('0x18')]&&_0x2d79d9[_0x5e6b('0x18')][_0x5e6b('0x1d')]?_0x2d79d9[_0x5e6b('0x18')][_0x5e6b('0x1d')]:'');},'ignoreRoute':function(_0x5cd225){var _0x399fff=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x399fff[_0x5e6b('0x1e')](_0x5cd225['url']);}}));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0x1f'),require('./api/user'));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0x20'),require(_0x5e6b('0x21')));_0x4b5619[_0x5e6b('0x16')]('/api/voice/contexts',require(_0x5e6b('0x22')));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0x23'),require('./api/voiceExtension'));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0x24'),require(_0x5e6b('0x25')));_0x4b5619[_0x5e6b('0x16')]('/api/voice/queues',require(_0x5e6b('0x26')));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0x27'),require(_0x5e6b('0x28')));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0x29'),require('./api/screenRecording'));_0x4b5619['use']('/api/voice/mails',require('./api/voiceMail'));_0x4b5619[_0x5e6b('0x16')]('/api/voice/mails/messages',require(_0x5e6b('0x2a')));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0x2b'),require(_0x5e6b('0x2c')));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0x2d'),require(_0x5e6b('0x2e')));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0x2f'),require('./api/voiceAgentReport'));_0x4b5619['use'](_0x5e6b('0x30'),require('./api/voiceQueueReport'));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0x31'),require('./api/memberReport'));_0x4b5619['use'](_0x5e6b('0x32'),require(_0x5e6b('0x33')));_0x4b5619[_0x5e6b('0x16')]('/api/voice/transfers/reports',require(_0x5e6b('0x34')));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0x35'),require(_0x5e6b('0x36')));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0x37'),require(_0x5e6b('0x38')));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0x39'),require(_0x5e6b('0x3a')));_0x4b5619[_0x5e6b('0x16')]('/api/mail/substatuses',require(_0x5e6b('0x3b')));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0x3c'),require(_0x5e6b('0x3d')));_0x4b5619[_0x5e6b('0x16')]('/api/mail/messages',require('./api/mailMessage'));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0x3e'),require(_0x5e6b('0x3f')));_0x4b5619['use']('/api/mail/reports/queue',require(_0x5e6b('0x40')));_0x4b5619['use']('/api/dashboards',require(_0x5e6b('0x41')));_0x4b5619['use'](_0x5e6b('0x42'),require('./api/dashboardItem'));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0x43'),require('./api/faxAccount'));_0x4b5619[_0x5e6b('0x16')]('/api/fax/applications',require('./api/faxApplication'));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0x44'),require(_0x5e6b('0x45')));_0x4b5619['use'](_0x5e6b('0x46'),require(_0x5e6b('0x47')));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0x48'),require(_0x5e6b('0x49')));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0x4a'),require(_0x5e6b('0x4b')));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0x4c'),require(_0x5e6b('0x4d')));_0x4b5619['use']('/api/sms/applications',require(_0x5e6b('0x4e')));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0x4f'),require(_0x5e6b('0x50')));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0x51'),require(_0x5e6b('0x52')));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0x53'),require(_0x5e6b('0x54')));_0x4b5619[_0x5e6b('0x16')]('/api/openchannel/accounts',require('./api/openchannelAccount'));_0x4b5619[_0x5e6b('0x16')]('/api/openchannel/applications',require(_0x5e6b('0x55')));_0x4b5619['use'](_0x5e6b('0x56'),require(_0x5e6b('0x57')));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0x58'),require(_0x5e6b('0x59')));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0x5a'),require('./api/openchannelQueue'));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0x5b'),require('./api/chatWebsite'));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0x5c'),require(_0x5e6b('0x5d')));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0x5e'),require(_0x5e6b('0x5f')));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0x60'),require('./api/chatInteraction'));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0x61'),require(_0x5e6b('0x62')));_0x4b5619['use']('/api/chat/offline_messages',require(_0x5e6b('0x63')));_0x4b5619['use'](_0x5e6b('0x64'),require(_0x5e6b('0x65')));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0x66'),require(_0x5e6b('0x67')));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0x68'),require(_0x5e6b('0x69')));_0x4b5619[_0x5e6b('0x16')]('/api/cm/companies',require('./api/cmCompany'));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0x6a'),require(_0x5e6b('0x6b')));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0x6c'),require(_0x5e6b('0x6d')));_0x4b5619['use'](_0x5e6b('0x6e'),require(_0x5e6b('0x6f')));_0x4b5619[_0x5e6b('0x16')]('/api/cm/hopper_final',require(_0x5e6b('0x70')));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0x71'),require('./api/cmHopperHistory'));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0x72'),require('./api/cmCustomField'));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0x73'),require(_0x5e6b('0x74')));_0x4b5619['use'](_0x5e6b('0x75'),require(_0x5e6b('0x76')));_0x4b5619[_0x5e6b('0x16')]('/api/canned_answers',require(_0x5e6b('0x77')));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0x78'),require('./api/disposition'));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0x79'),require(_0x5e6b('0x7a')));_0x4b5619[_0x5e6b('0x16')]('/api/intervals',require(_0x5e6b('0x7b')));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0x7c'),require(_0x5e6b('0x7d')));_0x4b5619['use']('/api/cdr',require(_0x5e6b('0x7e')));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0x7f'),require('./api/voiceQueuesLog'));_0x4b5619['use'](_0x5e6b('0x80'),require(_0x5e6b('0x81')));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0x82'),require(_0x5e6b('0x83')));_0x4b5619['use']('/api/tags',require(_0x5e6b('0x84')));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0x85'),require(_0x5e6b('0x86')));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0x87'),require(_0x5e6b('0x88')));_0x4b5619[_0x5e6b('0x16')]('/api/variables',require(_0x5e6b('0x89')));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0x8a'),require('./api/integration'));_0x4b5619['use'](_0x5e6b('0x8b'),require(_0x5e6b('0x8c')));_0x4b5619['use'](_0x5e6b('0x8d'),require(_0x5e6b('0x8e')));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0x8f'),require('./api/analyticDefaultReport'));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0x90'),require(_0x5e6b('0x91')));_0x4b5619[_0x5e6b('0x16')]('/api/analytics/metrics',require(_0x5e6b('0x92')));_0x4b5619[_0x5e6b('0x16')]('/api/analytics/field_reports',require('./api/analyticFieldReport'));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0x93'),require(_0x5e6b('0x94')));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0x95'),require(_0x5e6b('0x96')));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0x97'),require(_0x5e6b('0x98')));_0x4b5619['use'](_0x5e6b('0x99'),require(_0x5e6b('0x9a')));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0x9b'),require('./api/intSugarcrmAccount'));_0x4b5619['use'](_0x5e6b('0x9c'),require(_0x5e6b('0x9d')));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0x9e'),require(_0x5e6b('0x9f')));_0x4b5619[_0x5e6b('0x16')]('/api/integrations/desk/accounts',require(_0x5e6b('0xa0')));_0x4b5619['use']('/api/integrations/desk/configurations',require(_0x5e6b('0xa1')));_0x4b5619['use'](_0x5e6b('0xa2'),require(_0x5e6b('0xa3')));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0xa4'),require('./api/intZohoAccount'));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0xa5'),require('./api/intZohoConfiguration'));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0xa6'),require(_0x5e6b('0xa7')));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0xa8'),require(_0x5e6b('0xa9')));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0xaa'),require(_0x5e6b('0xab')));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0xac'),require('./api/intZendeskField'));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0xad'),require(_0x5e6b('0xae')));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0xaf'),require(_0x5e6b('0xb0')));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0xb1'),require(_0x5e6b('0xb2')));_0x4b5619[_0x5e6b('0x16')]('/api/integrations/vtiger/accounts',require(_0x5e6b('0xb3')));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0xb4'),require('./api/intVtigerConfiguration'));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0xb5'),require(_0x5e6b('0xb6')));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0xb7'),require('./api/intServicenowAccount'));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0xb8'),require('./api/intServicenowConfiguration'));_0x4b5619['use'](_0x5e6b('0xb9'),require(_0x5e6b('0xba')));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0xbb'),require(_0x5e6b('0xbc')));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0xbd'),require(_0x5e6b('0xbe')));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0xbf'),require(_0x5e6b('0xc0')));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0xc1'),require(_0x5e6b('0xc2')));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0xc3'),require('./api/intFreshsalesConfiguration'));_0x4b5619['use'](_0x5e6b('0xc4'),require('./api/intFreshsalesField'));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0xc5'),require(_0x5e6b('0xc6')));_0x4b5619['use'](_0x5e6b('0xc7'),require(_0x5e6b('0xc8')));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0xc9'),require('./api/chatInternalMessage'));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0xca'),require(_0x5e6b('0xcb')));_0x4b5619['use'](_0x5e6b('0xcc'),require('./api/jscriptyQuestionReport'));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0xcd'),require(_0x5e6b('0xce')));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0xcf'),require('./api/smsQueueReport'));_0x4b5619[_0x5e6b('0x16')]('/api/square/reports',require(_0x5e6b('0xd0')));_0x4b5619['use'](_0x5e6b('0xd1'),require('./api/squareReportDetail'));_0x4b5619['use'](_0x5e6b('0xd2'),require(_0x5e6b('0xd3')));_0x4b5619[_0x5e6b('0x16')]('/api/settings',require('./api/setting'));_0x4b5619[_0x5e6b('0x16')]('/api/square/odbc',require(_0x5e6b('0xd4')));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0xd5'),require(_0x5e6b('0xd6')));_0x4b5619[_0x5e6b('0x16')]('/api/square/recordings',require('./api/squareRecording'));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0xd7'),require('./api/squareMessage'));_0x4b5619[_0x5e6b('0x16')]('/api/teams',require('./api/team'));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0xd8'),require('./api/license'));_0x4b5619['use'](_0x5e6b('0xd9'),require(_0x5e6b('0xda')));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0xdb'),require('./api/migration'));_0x4b5619[_0x5e6b('0x16')]('/api/attachments',require(_0x5e6b('0xdc')));_0x4b5619['use'](_0x5e6b('0xdd'),require(_0x5e6b('0xde')));_0x4b5619[_0x5e6b('0x16')]('/api/mail/reports/transfer',require('./api/mailTransferReport'));_0x4b5619[_0x5e6b('0x16')]('/api/chat/reports/transfer',require(_0x5e6b('0xdf')));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0xe0'),require(_0x5e6b('0xe1')));_0x4b5619[_0x5e6b('0x16')]('/api/openchannel/reports/transfer',require(_0x5e6b('0xe2')));_0x4b5619[_0x5e6b('0x16')]('/api/sms/reports/transfer',require('./api/smsTransferReport'));_0x4b5619['use']('/api/cm/lists',require(_0x5e6b('0xe3')));_0x4b5619['use'](_0x5e6b('0xe4'),require(_0x5e6b('0xe5')));_0x4b5619['use'](_0x5e6b('0xe6'),require(_0x5e6b('0xe7')));_0x4b5619['use'](_0x5e6b('0xe8'),require(_0x5e6b('0xe9')));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0xea'),require(_0x5e6b('0xeb')));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0xec'),require(_0x5e6b('0xed')));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0xee'),require(_0x5e6b('0xef')));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0xf0'),require(_0x5e6b('0xf1')));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0xf2'),require('./api/rpc'));_0x4b5619['use'](_0x5e6b('0xf3'),require('./api/version'));_0x4b5619[_0x5e6b('0x16')]('/api/system',require(_0x5e6b('0xf4')));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0xf5'),require(_0x5e6b('0xf6')));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0xf7'),express['static'](path[_0x5e6b('0xf8')](config[_0x5e6b('0xf9')],_0x5e6b('0xf7'))));_0x4b5619['use'](_0x5e6b('0xfa'),express['static'](path[_0x5e6b('0xf8')](config[_0x5e6b('0xf9')],'/www')));_0x4b5619[_0x5e6b('0x16')]('/demo',express['static'](path[_0x5e6b('0xf8')](config['root'],_0x5e6b('0xfb'))));_0x4b5619[_0x5e6b('0x16')](_0x5e6b('0xfc'),express[_0x5e6b('0xfd')](path['join'](config[_0x5e6b('0xf9')],_0x5e6b('0xfe'),_0x5e6b('0xff'))));_0x4b5619['use'](_0x5e6b('0x100'),express[_0x5e6b('0xfd')](path['join'](config[_0x5e6b('0xf9')],'/server/files/plugins')));_0x4b5619['route'](_0x5e6b('0x101'))[_0x5e6b('0x102')](errors[0x194]);_0x4b5619[_0x5e6b('0x103')]('/*')[_0x5e6b('0x102')](function(_0x42a329,_0xe7da55){_0xe7da55[_0x5e6b('0x104')](path[_0x5e6b('0x105')](_0x4b5619[_0x5e6b('0x102')](_0x5e6b('0x106'))+'/index.html'));});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 4bf31be..13741b0 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa937=['../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/interval/interval.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','rpc','port','localhost','error','listen','log','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','../config/environment','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/faxAccount/faxAccount.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/cmContact/cmContact.rpc'];(function(_0x1cd674,_0x8d3638){var _0x27928f=function(_0x5e3c70){while(--_0x5e3c70){_0x1cd674['push'](_0x1cd674['shift']());}};_0x27928f(++_0x8d3638);}(_0xa937,0xa8));var _0x7a93=function(_0x4ac8a3,_0xfd9cc0){_0x4ac8a3=_0x4ac8a3-0x0;var _0x1e2dd0=_0xa937[_0x4ac8a3];return _0x1e2dd0;};'use strict';var jayson=require(_0x7a93('0x0'));var BPromise=require('bluebird');var _=require('lodash');var config=require(_0x7a93('0x1'));exports['listen']=function(){return new BPromise(function(_0x5daf18,_0xcaa84b){var _0x51e8c8={};_0x51e8c8=_['merge'](_0x51e8c8,require('../api/user/user.rpc'));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require(_0x7a93('0x3')));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require('../api/voiceQueue/voiceQueue.rpc'));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require(_0x7a93('0x4')));_0x51e8c8=_['merge'](_0x51e8c8,require(_0x7a93('0x5')));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require(_0x7a93('0x6')));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require(_0x7a93('0x7')));_0x51e8c8=_['merge'](_0x51e8c8,require(_0x7a93('0x8')));_0x51e8c8=_['merge'](_0x51e8c8,require(_0x7a93('0x9')));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require(_0x7a93('0xa')));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require(_0x7a93('0xb')));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require(_0x7a93('0xc')));_0x51e8c8=_['merge'](_0x51e8c8,require('../api/mailServerIn/mailServerIn.rpc'));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require(_0x7a93('0xd')));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require(_0x7a93('0xe')));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require('../api/mailInteraction/mailInteraction.rpc'));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require(_0x7a93('0xf')));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require(_0x7a93('0x10')));_0x51e8c8=_['merge'](_0x51e8c8,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require(_0x7a93('0x11')));_0x51e8c8=_['merge'](_0x51e8c8,require('../api/faxApplication/faxApplication.rpc'));_0x51e8c8=_['merge'](_0x51e8c8,require(_0x7a93('0x12')));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require(_0x7a93('0x13')));_0x51e8c8=_['merge'](_0x51e8c8,require(_0x7a93('0x14')));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require(_0x7a93('0x15')));_0x51e8c8=_['merge'](_0x51e8c8,require(_0x7a93('0x16')));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require('../api/smsInteraction/smsInteraction.rpc'));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require(_0x7a93('0x17')));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require(_0x7a93('0x18')));_0x51e8c8=_['merge'](_0x51e8c8,require(_0x7a93('0x19')));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require(_0x7a93('0x1a')));_0x51e8c8=_['merge'](_0x51e8c8,require(_0x7a93('0x1b')));_0x51e8c8=_['merge'](_0x51e8c8,require(_0x7a93('0x1c')));_0x51e8c8=_['merge'](_0x51e8c8,require(_0x7a93('0x1d')));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require(_0x7a93('0x1e')));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require(_0x7a93('0x1f')));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require('../api/chatQueue/chatQueue.rpc'));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require(_0x7a93('0x20')));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require(_0x7a93('0x21')));_0x51e8c8=_['merge'](_0x51e8c8,require(_0x7a93('0x22')));_0x51e8c8=_['merge'](_0x51e8c8,require(_0x7a93('0x23')));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require(_0x7a93('0x24')));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x51e8c8=_['merge'](_0x51e8c8,require(_0x7a93('0x25')));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require('../api/pause/pause.rpc'));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require(_0x7a93('0x26')));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require(_0x7a93('0x27')));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require(_0x7a93('0x28')));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require('../api/variable/variable.rpc'));_0x51e8c8=_['merge'](_0x51e8c8,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require(_0x7a93('0x29')));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require(_0x7a93('0x2a')));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require(_0x7a93('0x2b')));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require(_0x7a93('0x2c')));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require(_0x7a93('0x2d')));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require(_0x7a93('0x2e')));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require(_0x7a93('0x2f')));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require(_0x7a93('0x30')));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require(_0x7a93('0x31')));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require(_0x7a93('0x32')));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require(_0x7a93('0x33')));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require(_0x7a93('0x34')));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require(_0x7a93('0x35')));_0x51e8c8=_['merge'](_0x51e8c8,require(_0x7a93('0x36')));_0x51e8c8=_['merge'](_0x51e8c8,require(_0x7a93('0x37')));_0x51e8c8=_['merge'](_0x51e8c8,require('../api/squareMessage/squareMessage.rpc'));_0x51e8c8=_[_0x7a93('0x2')](_0x51e8c8,require('../api/campaign/campaign.rpc'));_0x51e8c8=_['merge'](_0x51e8c8,require(_0x7a93('0x38')));_0x51e8c8=_['merge'](_0x51e8c8,require(_0x7a93('0x39')));var _0x1a4b4d=jayson['server'](_0x51e8c8)['http']();var _0x34f193=config[_0x7a93('0x3a')][_0x7a93('0x3b')]||config['port']+0x1;var _0x5c343b=config['rpc']['ip']||_0x7a93('0x3c');_0x1a4b4d['on'](_0x7a93('0x3d'),function(_0x9ea057){return _0xcaa84b(_0x9ea057);});_0x1a4b4d[_0x7a93('0x3e')](_0x34f193,_0x5c343b,function(){console[_0x7a93('0x3f')]('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x5c343b,_0x34f193);require(_0x7a93('0x40'))[_0x7a93('0x41')]();return _0x5daf18(_0x7a93('0x42')+_0x5c343b+':'+_0x34f193);});});}; \ No newline at end of file +var _0x37c5=['../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/pause/pause.rpc','../api/template/template.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareProject/squareProject.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/plugin/plugin.rpc','server','http','port','rpc','localhost','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','RPC\x20listening\x20on\x20','jayson/promise','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc'];(function(_0x2edfb3,_0x1267bd){var _0x3df862=function(_0x5f5bd7){while(--_0x5f5bd7){_0x2edfb3['push'](_0x2edfb3['shift']());}};_0x3df862(++_0x1267bd);}(_0x37c5,0x1dd));var _0x537c=function(_0x478118,_0xb14a9b){_0x478118=_0x478118-0x0;var _0x170e47=_0x37c5[_0x478118];return _0x170e47;};'use strict';var jayson=require(_0x537c('0x0'));var BPromise=require('bluebird');var _=require('lodash');var config=require(_0x537c('0x1'));exports[_0x537c('0x2')]=function(){return new BPromise(function(_0x4c1bd1,_0x4bea9b){var _0x511c74={};_0x511c74=_[_0x537c('0x3')](_0x511c74,require(_0x537c('0x4')));_0x511c74=_[_0x537c('0x3')](_0x511c74,require(_0x537c('0x5')));_0x511c74=_[_0x537c('0x3')](_0x511c74,require(_0x537c('0x6')));_0x511c74=_['merge'](_0x511c74,require(_0x537c('0x7')));_0x511c74=_[_0x537c('0x3')](_0x511c74,require(_0x537c('0x8')));_0x511c74=_[_0x537c('0x3')](_0x511c74,require(_0x537c('0x9')));_0x511c74=_[_0x537c('0x3')](_0x511c74,require(_0x537c('0xa')));_0x511c74=_['merge'](_0x511c74,require(_0x537c('0xb')));_0x511c74=_[_0x537c('0x3')](_0x511c74,require('../api/memberReport/memberReport.rpc'));_0x511c74=_[_0x537c('0x3')](_0x511c74,require(_0x537c('0xc')));_0x511c74=_['merge'](_0x511c74,require(_0x537c('0xd')));_0x511c74=_[_0x537c('0x3')](_0x511c74,require(_0x537c('0xe')));_0x511c74=_[_0x537c('0x3')](_0x511c74,require(_0x537c('0xf')));_0x511c74=_[_0x537c('0x3')](_0x511c74,require(_0x537c('0x10')));_0x511c74=_[_0x537c('0x3')](_0x511c74,require(_0x537c('0x11')));_0x511c74=_[_0x537c('0x3')](_0x511c74,require(_0x537c('0x12')));_0x511c74=_['merge'](_0x511c74,require(_0x537c('0x13')));_0x511c74=_[_0x537c('0x3')](_0x511c74,require(_0x537c('0x14')));_0x511c74=_[_0x537c('0x3')](_0x511c74,require(_0x537c('0x15')));_0x511c74=_[_0x537c('0x3')](_0x511c74,require(_0x537c('0x16')));_0x511c74=_[_0x537c('0x3')](_0x511c74,require(_0x537c('0x17')));_0x511c74=_['merge'](_0x511c74,require(_0x537c('0x18')));_0x511c74=_[_0x537c('0x3')](_0x511c74,require(_0x537c('0x19')));_0x511c74=_[_0x537c('0x3')](_0x511c74,require(_0x537c('0x1a')));_0x511c74=_[_0x537c('0x3')](_0x511c74,require(_0x537c('0x1b')));_0x511c74=_[_0x537c('0x3')](_0x511c74,require(_0x537c('0x1c')));_0x511c74=_[_0x537c('0x3')](_0x511c74,require(_0x537c('0x1d')));_0x511c74=_[_0x537c('0x3')](_0x511c74,require(_0x537c('0x1e')));_0x511c74=_[_0x537c('0x3')](_0x511c74,require(_0x537c('0x1f')));_0x511c74=_[_0x537c('0x3')](_0x511c74,require(_0x537c('0x20')));_0x511c74=_['merge'](_0x511c74,require(_0x537c('0x21')));_0x511c74=_[_0x537c('0x3')](_0x511c74,require(_0x537c('0x22')));_0x511c74=_['merge'](_0x511c74,require(_0x537c('0x23')));_0x511c74=_[_0x537c('0x3')](_0x511c74,require(_0x537c('0x24')));_0x511c74=_[_0x537c('0x3')](_0x511c74,require(_0x537c('0x25')));_0x511c74=_[_0x537c('0x3')](_0x511c74,require(_0x537c('0x26')));_0x511c74=_[_0x537c('0x3')](_0x511c74,require('../api/chatQueue/chatQueue.rpc'));_0x511c74=_[_0x537c('0x3')](_0x511c74,require('../api/cmContact/cmContact.rpc'));_0x511c74=_[_0x537c('0x3')](_0x511c74,require(_0x537c('0x27')));_0x511c74=_['merge'](_0x511c74,require(_0x537c('0x28')));_0x511c74=_[_0x537c('0x3')](_0x511c74,require(_0x537c('0x29')));_0x511c74=_['merge'](_0x511c74,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x511c74=_[_0x537c('0x3')](_0x511c74,require(_0x537c('0x2a')));_0x511c74=_[_0x537c('0x3')](_0x511c74,require('../api/interval/interval.rpc'));_0x511c74=_[_0x537c('0x3')](_0x511c74,require(_0x537c('0x2b')));_0x511c74=_[_0x537c('0x3')](_0x511c74,require('../api/sound/sound.rpc'));_0x511c74=_[_0x537c('0x3')](_0x511c74,require(_0x537c('0x2c')));_0x511c74=_['merge'](_0x511c74,require('../api/trigger/trigger.rpc'));_0x511c74=_[_0x537c('0x3')](_0x511c74,require('../api/variable/variable.rpc'));_0x511c74=_['merge'](_0x511c74,require(_0x537c('0x2d')));_0x511c74=_[_0x537c('0x3')](_0x511c74,require(_0x537c('0x2e')));_0x511c74=_[_0x537c('0x3')](_0x511c74,require(_0x537c('0x2f')));_0x511c74=_[_0x537c('0x3')](_0x511c74,require(_0x537c('0x30')));_0x511c74=_[_0x537c('0x3')](_0x511c74,require(_0x537c('0x31')));_0x511c74=_[_0x537c('0x3')](_0x511c74,require(_0x537c('0x32')));_0x511c74=_[_0x537c('0x3')](_0x511c74,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x511c74=_['merge'](_0x511c74,require(_0x537c('0x33')));_0x511c74=_[_0x537c('0x3')](_0x511c74,require(_0x537c('0x34')));_0x511c74=_['merge'](_0x511c74,require(_0x537c('0x35')));_0x511c74=_[_0x537c('0x3')](_0x511c74,require(_0x537c('0x36')));_0x511c74=_['merge'](_0x511c74,require(_0x537c('0x37')));_0x511c74=_[_0x537c('0x3')](_0x511c74,require('../api/squareReport/squareReport.rpc'));_0x511c74=_['merge'](_0x511c74,require(_0x537c('0x38')));_0x511c74=_[_0x537c('0x3')](_0x511c74,require('../api/squareOdbc/squareOdbc.rpc'));_0x511c74=_[_0x537c('0x3')](_0x511c74,require(_0x537c('0x39')));_0x511c74=_['merge'](_0x511c74,require('../api/squareRecording/squareRecording.rpc'));_0x511c74=_[_0x537c('0x3')](_0x511c74,require(_0x537c('0x3a')));_0x511c74=_[_0x537c('0x3')](_0x511c74,require(_0x537c('0x3b')));_0x511c74=_[_0x537c('0x3')](_0x511c74,require('../api/attachment/attachment.rpc'));_0x511c74=_['merge'](_0x511c74,require(_0x537c('0x3c')));var _0x49647f=jayson[_0x537c('0x3d')](_0x511c74)[_0x537c('0x3e')]();var _0x8ee4d4=config['rpc']['port']||config[_0x537c('0x3f')]+0x1;var _0x3cdba1=config[_0x537c('0x40')]['ip']||_0x537c('0x41');_0x49647f['on'](_0x537c('0x42'),function(_0x1924d4){return _0x4bea9b(_0x1924d4);});_0x49647f[_0x537c('0x2')](_0x8ee4d4,_0x3cdba1,function(){console[_0x537c('0x43')](_0x537c('0x44'),_0x3cdba1,_0x8ee4d4);require(_0x537c('0x45'))['default']();return _0x4c1bd1(_0x537c('0x46')+_0x3cdba1+':'+_0x8ee4d4);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 9f42eb5..7f808a1 100644 --- a/server/services/agi/channel.js +++ b/server/services/agi/channel.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','join','EXEC\x20%s\x20%s','setExtension','SET\x20EXTENSION\x20%s','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','isNumber','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','setPriority','GOTO\x20%s\x20%s\x20%s','getVariable','wav','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','events','./error','setEncoding','utf8','headers','emit','ready','line','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','substr','indexOf','length','match','error','code','close','E_AGI_SOCKET_CLOSE','E_AGI_SOCKET_TIMEOUT','destroy','pipe','write','inherits','prototype','command','sync','answer','getData','sendRequest'];(function(_0x1fe62f,_0x6355f7){var _0x10e913=function(_0x1acbe8){while(--_0x1acbe8){_0x1fe62f['push'](_0x1fe62f['shift']());}};_0x10e913(++_0x6355f7);}(_0x70e0,0x17b));var _0x070e=function(_0x544c53,_0x332882){_0x544c53=_0x544c53-0x0;var _0x272e16=_0x70e0[_0x544c53];return _0x272e16;};'use strict';var util=require(_0x070e('0x0'));var _=require(_0x070e('0x1'));var EventEmitter=require(_0x070e('0x2'))['EventEmitter'];var AGIReply=require('./reply');var AGIError=require(_0x070e('0x3'));function AGIChannel(_0xee173){var _0x277d32=this,_0x2593e5=new AGIReply(),_0x5c90fc=![],_0x7bce9b={};EventEmitter['call'](_0x277d32);_0xee173[_0x070e('0x4')]('utf8');_0xee173['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x2593e5['setEncoding'](_0x070e('0x5'));_0x2593e5['on'](_0x070e('0x6'),function(_0x604664){for(var _0x2611e6 in _0x604664){_0x277d32[_0x2611e6]=_0x604664[_0x2611e6];}_0x277d32[_0x070e('0x7')](_0x070e('0x8'));});_0x2593e5['on'](_0x070e('0x9'),function(_0x4e99e6){if(_0x4e99e6['toLowerCase']()==_0x070e('0xa')){_0x277d32[_0x070e('0x7')](_0x070e('0xa'));return;}if(_0x4e99e6[_0x070e('0xb')](0x0,0xb)==_0x070e('0xc')){_0x5c90fc=!![];}if(_0x5c90fc){_0x7bce9b['rx']+=_0x4e99e6+'\x0a';if(_0x4e99e6[_0x070e('0xd')](_0x070e('0xe'))!=-0x1){_0x5c90fc=![];}}else{_0x7bce9b['rx']=_0x4e99e6;}if(_0x5c90fc){return;}if(typeof _0x7bce9b['cb']==_0x070e('0xf')){var _0x39d2b9=_0x7bce9b['rx']['substring'](0x0,0x3),_0x5bf079=null,_0x2930b8=null;_0x39d2b9=parseInt(_0x39d2b9);if(isNaN(_0x39d2b9)){_0x7bce9b['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x39d2b9!=0xc8){_0x7bce9b['cb'](null,{'code':_0x39d2b9,'result':-0x1,'extra':'KO'});return;}_0x5bf079=_0x7bce9b['rx'][_0x070e('0xb')](0x4)['replace']('result=','');if(_0x5bf079['indexOf']('\x20')!=-0x1){_0x5bf079=_0x5bf079[_0x070e('0x10')](0x0,_0x5bf079[_0x070e('0x11')]('\x20'));}if(_['startsWith'](_0x5bf079,'-1')){_0x5bf079=parseInt(_0x5bf079);}_0x2930b8=_0x7bce9b['rx']['split']('\x20');if(_0x2930b8[_0x070e('0x12')]==0x3){_0x2930b8=_0x2930b8[0x2][_0x070e('0xb')](0x1,_0x2930b8[0x2][_0x070e('0x12')]-0x1);}else if(_0x2930b8[_0x070e('0x12')]>0x3){var _0x5bc71e=/\((.+)\)/;var _0x49861b=_0x7bce9b['rx'][_0x070e('0x13')](_0x5bc71e);if(_0x49861b){_0x2930b8=_0x49861b[0x1];}else{_0x2930b8=null;}}else{_0x2930b8=null;}_0x7bce9b['cb'](null,{'code':_0x39d2b9,'result':_0x5bf079,'extra':_0x2930b8});}});_0xee173['on'](_0x070e('0x14'),function(_0x38f6e6){_0x277d32[_0x070e('0x7')](_0x070e('0x14'),new AGIError('E_AGI_SOCKET_ERROR',_0x38f6e6[_0x070e('0x15')]));});_0xee173['on'](_0x070e('0x16'),function(){_0x277d32[_0x070e('0x7')](_0x070e('0x16'),new AGIError(_0x070e('0x17')));});_0xee173['on']('timeout',function(){_0x277d32['emit']('timeout',new AGIError(_0x070e('0x18')));_0xee173[_0x070e('0x19')]();});_0xee173[_0x070e('0x1a')](_0x2593e5);this['command']=function(_0x5b184,_0x5dc5d2){var _0x5b184=_0x5b184||'',_0x5dc5d2=typeof _0x5dc5d2==_0x070e('0xf')?_0x5dc5d2:new Function();_0x7bce9b={'tx':_0x5b184,'rx':'','cb':_0x5dc5d2};_0xee173[_0x070e('0x1b')](_0x5b184+'\x0a');},this[_0x070e('0x16')]=function(){_0xee173[_0x070e('0x19')]();};}util[_0x070e('0x1c')](AGIChannel,EventEmitter);AGIChannel[_0x070e('0x1d')]['sendRequest']=function(_0x2f8055){return this[_0x070e('0x1e')][_0x070e('0x1f')](this,_0x2f8055);};AGIChannel['prototype'][_0x070e('0x20')]=function(){return this['sendRequest']('ANSWER');};AGIChannel[_0x070e('0x1d')][_0x070e('0x21')]=function(_0x41deb1,_0x1743cc,_0x4763c6){_0x41deb1=_0x41deb1===undefined?'beep':_0x41deb1;_0x1743cc=_0x1743cc===undefined?'5':_0x1743cc;_0x4763c6=_0x4763c6===undefined?'1':_0x4763c6;return this[_0x070e('0x22')](util[_0x070e('0x23')](_0x070e('0x24'),_0x41deb1,_0x1743cc*0x3e8,_0x4763c6));};AGIChannel[_0x070e('0x1d')][_0x070e('0x25')]=function(_0x28d7f2){_0x28d7f2=_0x28d7f2||_0x070e('0x26');return this[_0x070e('0x22')](util['format'](_0x070e('0x27'),_0x28d7f2));};AGIChannel[_0x070e('0x1d')][_0x070e('0x28')]=function(_0x56fc12,_0x5c5f0d){if(_[_0x070e('0x29')](_0x5c5f0d)){return this[_0x070e('0x22')](util[_0x070e('0x23')]('EXEC\x20%s\x20%s',_0x56fc12,_0x5c5f0d[_0x070e('0x2a')](',')));}return this[_0x070e('0x22')](util[_0x070e('0x23')](_0x070e('0x2b'),_0x56fc12,_0x5c5f0d));};AGIChannel['prototype']['setContext']=function(_0x523b75){return this['sendRequest'](util[_0x070e('0x23')]('SET\x20CONTEXT\x20%s',_0x523b75));};AGIChannel[_0x070e('0x1d')][_0x070e('0x2c')]=function(_0x4f8130){return this['sendRequest'](util[_0x070e('0x23')](_0x070e('0x2d'),_0x4f8130));};AGIChannel['prototype']['setPriority']=function(_0x41ade4){return this[_0x070e('0x22')](util[_0x070e('0x23')](_0x070e('0x2e'),_0x41ade4));};AGIChannel[_0x070e('0x1d')]['hangup']=function(){return this['sendRequest'](_0x070e('0x2f'));};AGIChannel[_0x070e('0x1d')][_0x070e('0x30')]=function(_0xf57ed,_0xf11439){var _0x4deaf8=_[_0x070e('0x31')](_0xf11439)||_[_0x070e('0x32')](_0xf11439)?_0xf11439['toString']():_0xf11439;return this[_0x070e('0x22')](util[_0x070e('0x23')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0xf57ed,_0x4deaf8?_0x4deaf8['toString']()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x070e('0x1d')][_0x070e('0x33')]=function(_0x39dfaa,_0x334733){return this[_0x070e('0x22')](util['format'](_0x070e('0x34'),_0x39dfaa,_0x334733));};AGIChannel[_0x070e('0x1d')][_0x070e('0x35')]=function(_0x487276,_0x268c5d){return this[_0x070e('0x22')](util[_0x070e('0x23')]('SAY\x20DIGITS\x20%s\x20%s',_0x487276,_0x268c5d));};AGIChannel[_0x070e('0x1d')][_0x070e('0x36')]=function(_0x4800a9,_0x173602){return this['sendRequest'](util[_0x070e('0x23')](_0x070e('0x37'),_0x4800a9,_0x173602));};AGIChannel[_0x070e('0x1d')][_0x070e('0x38')]=function(_0xd03404,_0x47b929,_0xd18220){_0x47b929=_0x47b929||this['extension'];_0xd18220=_0xd18220||0x1;this['setContext'](_0xd03404);this[_0x070e('0x2c')](_0x47b929);this[_0x070e('0x39')](_0xd18220);return this[_0x070e('0x25')](util['format'](_0x070e('0x3a'),_0xd03404,_0x47b929,_0xd18220));};AGIChannel[_0x070e('0x1d')][_0x070e('0x3b')]=function(_0x7dc240){return this['sendRequest'](util[_0x070e('0x23')]('GET\x20VARIABLE\x20\x22%s\x22',_0x7dc240));};AGIChannel['prototype']['recordFile']=function(_0x3feb83,_0x926533,_0x26b3e2,_0x29dccd,_0x34f23e,_0x562aa4){_0x926533=_0x926533||_0x070e('0x3c');_0x26b3e2=_0x26b3e2||'';_0x29dccd=_0x29dccd===undefined?-0x1:_0x29dccd==='-1'?-0x1:_0x29dccd*0x3e8;_0x34f23e=_0x34f23e===undefined?'':'s='+_0x34f23e;_0x562aa4=_0x562aa4?'BEEP':'';return this[_0x070e('0x22')](util[_0x070e('0x23')](_0x070e('0x3d'),_0x3feb83,_0x926533,_0x26b3e2,_0x29dccd,_0x562aa4,_0x34f23e));};AGIChannel['prototype']['streamFile']=function(_0x261a27,_0x5ee4b8){_0x5ee4b8=_0x5ee4b8||'';return this[_0x070e('0x22')](util[_0x070e('0x23')](_0x070e('0x3e'),_0x261a27,_0x5ee4b8));};AGIChannel['prototype'][_0x070e('0x3f')]=function(_0x20a1ee){return this['exec']('AGI',_0x20a1ee);};AGIChannel[_0x070e('0x1d')][_0x070e('0x40')]=function(_0x2d43ce){return this[_0x070e('0x28')](_0x070e('0x41'),_0x2d43ce);};AGIChannel['prototype'][_0x070e('0x14')]=function(_0x3f6c64,_0x427fa7){this[_0x070e('0x25')](util[_0x070e('0x23')](_0x070e('0x42'),_0x3f6c64['id'],_0x3f6c64[_0x070e('0x43')],_0x427fa7));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x070e('0x44')]=AGIChannel; \ No newline at end of file +var _0xe706=['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','AGI','wait','WAIT','label','exports','util','lodash','events','./reply','./error','call','setEncoding','utf8','setTimeout','headers','emit','ready','line','toLowerCase','hangup','search','520\x20End\x20of\x20proper','function','substring','no\x20code','indexOf','startsWith','split','length','error','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','write','inherits','command','sync','answer','sendRequest','prototype','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','join','EXEC\x20%s\x20%s','SET\x20CONTEXT\x20%s','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','SAY\x20NUMBER\x20%s\x20%s','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','setExtension','noop','GOTO\x20%s\x20%s\x20%s','getVariable','recordFile'];(function(_0x2636ee,_0xa2019b){var _0x5be81e=function(_0x2093a4){while(--_0x2093a4){_0x2636ee['push'](_0x2636ee['shift']());}};_0x5be81e(++_0xa2019b);}(_0xe706,0xa3));var _0x6e70=function(_0x430e15,_0x4ae0f2){_0x430e15=_0x430e15-0x0;var _0x16c170=_0xe706[_0x430e15];return _0x16c170;};'use strict';var util=require(_0x6e70('0x0'));var _=require(_0x6e70('0x1'));var EventEmitter=require(_0x6e70('0x2'))['EventEmitter'];var AGIReply=require(_0x6e70('0x3'));var AGIError=require(_0x6e70('0x4'));function AGIChannel(_0x2ca810){var _0x7dfbc3=this,_0x142c27=new AGIReply(),_0x2164a4=![],_0x376a8d={};EventEmitter[_0x6e70('0x5')](_0x7dfbc3);_0x2ca810[_0x6e70('0x6')](_0x6e70('0x7'));_0x2ca810[_0x6e70('0x8')](0x8*0x3c*0x3c*0x3e8);_0x142c27[_0x6e70('0x6')](_0x6e70('0x7'));_0x142c27['on'](_0x6e70('0x9'),function(_0x3c4843){for(var _0x449b48 in _0x3c4843){_0x7dfbc3[_0x449b48]=_0x3c4843[_0x449b48];}_0x7dfbc3[_0x6e70('0xa')](_0x6e70('0xb'));});_0x142c27['on'](_0x6e70('0xc'),function(_0x463853){if(_0x463853[_0x6e70('0xd')]()==_0x6e70('0xe')){_0x7dfbc3[_0x6e70('0xa')](_0x6e70('0xe'));return;}if(_0x463853['substring'](0x0,0xb)=='520-Invalid'){_0x2164a4=!![];}if(_0x2164a4){_0x376a8d['rx']+=_0x463853+'\x0a';if(_0x463853[_0x6e70('0xf')](_0x6e70('0x10'))!=-0x1){_0x2164a4=![];}}else{_0x376a8d['rx']=_0x463853;}if(_0x2164a4){return;}if(typeof _0x376a8d['cb']==_0x6e70('0x11')){var _0x27dd9b=_0x376a8d['rx'][_0x6e70('0x12')](0x0,0x3),_0x3b38f3=null,_0x310eb7=null;_0x27dd9b=parseInt(_0x27dd9b);if(isNaN(_0x27dd9b)){_0x376a8d['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x6e70('0x13')});return;}if(_0x27dd9b!=0xc8){_0x376a8d['cb'](null,{'code':_0x27dd9b,'result':-0x1,'extra':'KO'});return;}_0x3b38f3=_0x376a8d['rx']['substring'](0x4)['replace']('result=','');if(_0x3b38f3[_0x6e70('0x14')]('\x20')!=-0x1){_0x3b38f3=_0x3b38f3['substr'](0x0,_0x3b38f3['indexOf']('\x20'));}if(_[_0x6e70('0x15')](_0x3b38f3,'-1')){_0x3b38f3=parseInt(_0x3b38f3);}_0x310eb7=_0x376a8d['rx'][_0x6e70('0x16')]('\x20');if(_0x310eb7['length']==0x3){_0x310eb7=_0x310eb7[0x2][_0x6e70('0x12')](0x1,_0x310eb7[0x2]['length']-0x1);}else if(_0x310eb7[_0x6e70('0x17')]>0x3){var _0x161f23=/\((.+)\)/;var _0x4ca554=_0x376a8d['rx']['match'](_0x161f23);if(_0x4ca554){_0x310eb7=_0x4ca554[0x1];}else{_0x310eb7=null;}}else{_0x310eb7=null;}_0x376a8d['cb'](null,{'code':_0x27dd9b,'result':_0x3b38f3,'extra':_0x310eb7});}});_0x2ca810['on'](_0x6e70('0x18'),function(_0x5ea7a5){_0x7dfbc3[_0x6e70('0xa')](_0x6e70('0x18'),new AGIError('E_AGI_SOCKET_ERROR',_0x5ea7a5['code']));});_0x2ca810['on'](_0x6e70('0x19'),function(){_0x7dfbc3[_0x6e70('0xa')](_0x6e70('0x19'),new AGIError(_0x6e70('0x1a')));});_0x2ca810['on'](_0x6e70('0x1b'),function(){_0x7dfbc3[_0x6e70('0xa')](_0x6e70('0x1b'),new AGIError(_0x6e70('0x1c')));_0x2ca810[_0x6e70('0x1d')]();});_0x2ca810[_0x6e70('0x1e')](_0x142c27);this['command']=function(_0x228350,_0x344b65){var _0x228350=_0x228350||'',_0x344b65=typeof _0x344b65==_0x6e70('0x11')?_0x344b65:new Function();_0x376a8d={'tx':_0x228350,'rx':'','cb':_0x344b65};_0x2ca810[_0x6e70('0x1f')](_0x228350+'\x0a');},this[_0x6e70('0x19')]=function(){_0x2ca810['destroy']();};}util[_0x6e70('0x20')](AGIChannel,EventEmitter);AGIChannel['prototype']['sendRequest']=function(_0x4e97c7){return this[_0x6e70('0x21')][_0x6e70('0x22')](this,_0x4e97c7);};AGIChannel['prototype'][_0x6e70('0x23')]=function(){return this[_0x6e70('0x24')]('ANSWER');};AGIChannel[_0x6e70('0x25')][_0x6e70('0x26')]=function(_0x2bb231,_0x4a67ac,_0x54a5fe){_0x2bb231=_0x2bb231===undefined?_0x6e70('0x27'):_0x2bb231;_0x4a67ac=_0x4a67ac===undefined?'5':_0x4a67ac;_0x54a5fe=_0x54a5fe===undefined?'1':_0x54a5fe;return this[_0x6e70('0x24')](util[_0x6e70('0x28')](_0x6e70('0x29'),_0x2bb231,_0x4a67ac*0x3e8,_0x54a5fe));};AGIChannel[_0x6e70('0x25')]['noop']=function(_0x1952ea){_0x1952ea=_0x1952ea||_0x6e70('0x2a');return this[_0x6e70('0x24')](util[_0x6e70('0x28')](_0x6e70('0x2b'),_0x1952ea));};AGIChannel[_0x6e70('0x25')][_0x6e70('0x2c')]=function(_0x24114a,_0x3a0821){if(_[_0x6e70('0x2d')](_0x3a0821)){return this['sendRequest'](util[_0x6e70('0x28')]('EXEC\x20%s\x20%s',_0x24114a,_0x3a0821[_0x6e70('0x2e')](',')));}return this['sendRequest'](util[_0x6e70('0x28')](_0x6e70('0x2f'),_0x24114a,_0x3a0821));};AGIChannel[_0x6e70('0x25')]['setContext']=function(_0x38c40d){return this[_0x6e70('0x24')](util['format'](_0x6e70('0x30'),_0x38c40d));};AGIChannel[_0x6e70('0x25')]['setExtension']=function(_0x10d8f6){return this[_0x6e70('0x24')](util[_0x6e70('0x28')](_0x6e70('0x31'),_0x10d8f6));};AGIChannel[_0x6e70('0x25')][_0x6e70('0x32')]=function(_0x44b19d){return this[_0x6e70('0x24')](util[_0x6e70('0x28')](_0x6e70('0x33'),_0x44b19d));};AGIChannel['prototype'][_0x6e70('0xe')]=function(){return this['sendRequest'](_0x6e70('0x34'));};AGIChannel[_0x6e70('0x25')][_0x6e70('0x35')]=function(_0x32d12d,_0x233a83){var _0x989b80=_[_0x6e70('0x36')](_0x233a83)||_[_0x6e70('0x37')](_0x233a83)?_0x233a83[_0x6e70('0x38')]():_0x233a83;return this[_0x6e70('0x24')](util[_0x6e70('0x28')](_0x6e70('0x39'),_0x32d12d,_0x989b80?_0x989b80[_0x6e70('0x38')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype']['sayNumber']=function(_0x155a46,_0x3841a0){return this[_0x6e70('0x24')](util[_0x6e70('0x28')](_0x6e70('0x3a'),_0x155a46,_0x3841a0));};AGIChannel[_0x6e70('0x25')]['sayDigits']=function(_0x3b508c,_0x9e7ad2){return this[_0x6e70('0x24')](util[_0x6e70('0x28')](_0x6e70('0x3b'),_0x3b508c,_0x9e7ad2));};AGIChannel[_0x6e70('0x25')][_0x6e70('0x3c')]=function(_0x16fc7d,_0x5be100){return this[_0x6e70('0x24')](util[_0x6e70('0x28')](_0x6e70('0x3d'),_0x16fc7d,_0x5be100));};AGIChannel[_0x6e70('0x25')][_0x6e70('0x3e')]=function(_0x1de947,_0x21b0e7,_0x4a8adc){_0x21b0e7=_0x21b0e7||this['extension'];_0x4a8adc=_0x4a8adc||0x1;this['setContext'](_0x1de947);this[_0x6e70('0x3f')](_0x21b0e7);this[_0x6e70('0x32')](_0x4a8adc);return this[_0x6e70('0x40')](util[_0x6e70('0x28')](_0x6e70('0x41'),_0x1de947,_0x21b0e7,_0x4a8adc));};AGIChannel['prototype'][_0x6e70('0x42')]=function(_0x2a58d7){return this[_0x6e70('0x24')](util['format']('GET\x20VARIABLE\x20\x22%s\x22',_0x2a58d7));};AGIChannel['prototype'][_0x6e70('0x43')]=function(_0x5cca5b,_0x42f49a,_0x39913a,_0x3fed21,_0x75a90d,_0x59c87d){_0x42f49a=_0x42f49a||_0x6e70('0x44');_0x39913a=_0x39913a||'';_0x3fed21=_0x3fed21===undefined?-0x1:_0x3fed21==='-1'?-0x1:_0x3fed21*0x3e8;_0x75a90d=_0x75a90d===undefined?'':'s='+_0x75a90d;_0x59c87d=_0x59c87d?'BEEP':'';return this[_0x6e70('0x24')](util[_0x6e70('0x28')](_0x6e70('0x45'),_0x5cca5b,_0x42f49a,_0x39913a,_0x3fed21,_0x59c87d,_0x75a90d));};AGIChannel[_0x6e70('0x25')]['streamFile']=function(_0x291de6,_0x44b637){_0x44b637=_0x44b637||'';return this[_0x6e70('0x24')](util[_0x6e70('0x28')](_0x6e70('0x46'),_0x291de6,_0x44b637));};AGIChannel[_0x6e70('0x25')][_0x6e70('0x47')]=function(_0x552e7e){return this[_0x6e70('0x2c')](_0x6e70('0x48'),_0x552e7e);};AGIChannel[_0x6e70('0x25')][_0x6e70('0x49')]=function(_0x3f86cf){return this[_0x6e70('0x2c')](_0x6e70('0x4a'),_0x3f86cf);};AGIChannel['prototype'][_0x6e70('0x18')]=function(_0x50cdf1,_0x11794e){this[_0x6e70('0x40')](util['format']('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x50cdf1['id'],_0x50cdf1[_0x6e70('0x4b')],_0x11794e));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x6e70('0x4c')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 509ce73..156eb7a 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 _0x1629=['format','apply','message','name','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Missing\x20\x27ivr.entry\x27\x20menu.'];(function(_0x5254d4,_0x50ea9e){var _0x2b4046=function(_0x41513d){while(--_0x41513d){_0x5254d4['push'](_0x5254d4['shift']());}};_0x2b4046(++_0x50ea9e);}(_0x1629,0x1d8));var _0x9162=function(_0x36b16a,_0x3a2de4){_0x36b16a=_0x36b16a-0x0;var _0x3f2dc9=_0x1629[_0x36b16a];return _0x3f2dc9;};'use strict';var util=require(_0x9162('0x0'));var error={'E_AGI_UNDEFINED':_0x9162('0x1'),'E_AGI_ARGUMENT_PORT':_0x9162('0x2'),'E_AGI_SERVER_ERROR':_0x9162('0x3'),'E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':_0x9162('0x4'),'E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':_0x9162('0x5'),'E_AGI_SOCKET_TIMEOUT':_0x9162('0x6'),'E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':_0x9162('0x7')};function AGIError(_0x1defdd){var _0x1defdd=_0x1defdd||null,_0xc579ed=_0xc579ed||[],_0x11d90b=0x1,_0x168267='';if(!error[_0x1defdd]){_0x1defdd='E_AGI_UNDEFINED';}_0xc579ed['push'](error[_0x1defdd]);while(arguments[_0x11d90b]){_0xc579ed['push'](arguments[_0x11d90b]);_0x11d90b++;}_0x168267=util[_0x9162('0x8')][_0x9162('0x9')](util,_0xc579ed);this[_0x9162('0xa')]=_0x168267;this[_0x9162('0xb')]=_0x1defdd;}module['exports']=AGIError; \ No newline at end of file +var _0xc560=['util','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20closed.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.entry\x27\x20menu.','push','format','message','name','exports'];(function(_0x1c42c1,_0x141fec){var _0x3f961a=function(_0xede8c){while(--_0xede8c){_0x1c42c1['push'](_0x1c42c1['shift']());}};_0x3f961a(++_0x141fec);}(_0xc560,0x82));var _0x0c56=function(_0x5b3cf3,_0xf1afd9){_0x5b3cf3=_0x5b3cf3-0x0;var _0x579424=_0xc560[_0x5b3cf3];return _0x579424;};'use strict';var util=require(_0x0c56('0x0'));var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':_0x0c56('0x1'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':_0x0c56('0x2'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':_0x0c56('0x3'),'E_AGI_SOCKET_CLOSE':_0x0c56('0x4'),'E_AGI_SOCKET_TIMEOUT':_0x0c56('0x5'),'E_AGI_COMMAND_EMPTY':_0x0c56('0x6'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':_0x0c56('0x7')};function AGIError(_0x2bc0a0){var _0x2bc0a0=_0x2bc0a0||null,_0x1245b3=_0x1245b3||[],_0x501a0b=0x1,_0x429ad1='';if(!error[_0x2bc0a0]){_0x2bc0a0='E_AGI_UNDEFINED';}_0x1245b3[_0x0c56('0x8')](error[_0x2bc0a0]);while(arguments[_0x501a0b]){_0x1245b3[_0x0c56('0x8')](arguments[_0x501a0b]);_0x501a0b++;}_0x429ad1=util[_0x0c56('0x9')]['apply'](util,_0x1245b3);this[_0x0c56('0xa')]=_0x429ad1;this[_0x0c56('0xb')]=_0x2bc0a0;}module[_0x0c56('0xc')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index 0dfb92a..c64a084 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 _0x657b=['default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','condition\x20not\x20found','exports','lodash','../../../config/logger','agi','menu','getdigits','vertices','edges','prototype','addVertex','addEdge','numberOfEdges','size','relations','getVertex','traverseBFS','info','no\x20vertex\x20found','stop\x20traverse','no\x20edge/s\x20available','length','condition','agicommand','target','default','vswitch'];(function(_0x265486,_0x472288){var _0x1a8e11=function(_0x149a1e){while(--_0x149a1e){_0x265486['push'](_0x265486['shift']());}};_0x1a8e11(++_0x472288);}(_0x657b,0x131));var _0xb657=function(_0x180099,_0x1ce5f8){_0x180099=_0x180099-0x0;var _0x9d4132=_0x657b[_0x180099];return _0x9d4132;};'use strict';var _=require(_0xb657('0x0'));var logger=require(_0xb657('0x1'))(_0xb657('0x2'));var verticesWithRetry=[_0xb657('0x3'),_0xb657('0x4'),'getsecretdigits'];var Graph=function(){this[_0xb657('0x5')]={};this[_0xb657('0x6')]={};this['numberOfEdges']=0x0;};Graph[_0xb657('0x7')][_0xb657('0x8')]=function(_0x42a145){this[_0xb657('0x5')][_0x42a145['id']]=_0x42a145;this[_0xb657('0x6')][_0x42a145['id']]=[];};Graph['prototype'][_0xb657('0x9')]=function(_0x55acdf,_0x326dd7,_0x42a844){this[_0xb657('0x6')][_0x55acdf]['push']({'target':_0x326dd7,'condition':_0x42a844});this[_0xb657('0xa')]+=0x1;};Graph['prototype'][_0xb657('0xb')]=function(){return _['size'](this[_0xb657('0x5')]);};Graph[_0xb657('0x7')][_0xb657('0xc')]=function(){return this['numberOfEdges'];};Graph[_0xb657('0x7')][_0xb657('0xd')]=function(_0x193129){return this[_0xb657('0x5')][_0x193129];};Graph['prototype'][_0xb657('0xe')]=function(_0x3ebcc2,_0x558eba){if(!this[_0xb657('0x5')][_0x3ebcc2]){return logger[_0xb657('0xf')](_0xb657('0x10'));}var _0x3ca0b4=_0x558eba(this['vertices'][_0x3ebcc2]);if(!_0x3ca0b4){return logger[_0xb657('0xf')](_0xb657('0x11'));}if(this['edges'][_0x3ebcc2]['length']===0x0){return logger[_0xb657('0xf')](_0xb657('0x12'));}for(var _0x2c1fb7=0x0,_0x9dc84c=[],_0x17c045=![];_0x2c1fb7\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','dnid','uniqueid','arg_1','callerid','evtHangup','toJson','mxGraphModel','root','agicommand','hasOwnProperty','retry','maxRetry','addVertex','mxCell','isArray','length','target','value','getSquareProject','then','catch','createSquareReport','indexOf','substring','inspect','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','hangup','sync','production','start','joinAt','YYYY-MM-DD\x20HH:mm:ss','omit','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','toString','agicommand\x20not\x20found','finally','clear','isUndefined','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s'];(function(_0x39690b,_0x41a11b){var _0x133a33=function(_0x56106a){while(--_0x56106a){_0x39690b['push'](_0x39690b['shift']());}};_0x133a33(++_0x41a11b);}(_0xed1f,0x6a));var _0xfed1=function(_0x3fba9f,_0x3b7b9b){_0x3fba9f=_0x3fba9f-0x0;var _0x192cf1=_0xed1f[_0x3fba9f];return _0x192cf1;};'use strict';var parser=require(_0xfed1('0x0'));var _=require(_0xfed1('0x1'));var syncho=require(_0xfed1('0x2'));var util=require(_0xfed1('0x3'));var moment=require(_0xfed1('0x4'));var config=require(_0xfed1('0x5'));var logger=require(_0xfed1('0x6'))(_0xfed1('0x7'));var utilLicense=require(_0xfed1('0x8'));var rpc=require(_0xfed1('0x9'));var mailRpc=require(_0xfed1('0xa'));var Graph=require(_0xfed1('0xb'));var Vertices=require(_0xfed1('0xc'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0xfed1('0x7')]=_[_0xfed1('0xd')](config[_0xfed1('0x7')],{'ip':_0xfed1('0xe'),'port':0x11dd});function connectionHandler(_0x2967ef){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x2967ef);agiHandler(_0x2967ef);}catch(_0x42dd5c){logger[_0xfed1('0xf')](_0x42dd5c['stack']);}});});}function listeningHandler(){console[_0xfed1('0x10')](_0xfed1('0x11'),config['agi'][_0xfed1('0x12')]);logger['info'](util[_0xfed1('0x13')](_0xfed1('0x14'),config['agi']['ip'],config['agi'][_0xfed1('0x12')]));}function errorHandler(_0xe84ba6){if(_0xe84ba6&&_0xe84ba6['name']&&_0xe84ba6[_0xfed1('0x15')]){logger['error'](util['format'](_0xfed1('0x16'),_0xe84ba6[_0xfed1('0x17')],_0xe84ba6['message']));}else{logger[_0xfed1('0xf')](util['format']('[ERROR]\x20%s',_0xe84ba6[_0xfed1('0x18')]));}}function closeHandler(){logger[_0xfed1('0x19')](util[_0xfed1('0x13')](_0xfed1('0x1a'),this['arg_1'],this[_0xfed1('0x1b')],this['callerid'],this[_0xfed1('0x1c')],this[_0xfed1('0x1d')]));try{createSquareReport(this);}catch(_0x489a0f){logger[_0xfed1('0xf')](_0x489a0f[_0xfed1('0x18')]);}}function timeoutHandler(){logger['info'](util['format']('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0xfed1('0x1e')],this['calleridname'],this[_0xfed1('0x1f')],this[_0xfed1('0x1c')],this['uniqueid']));}function hangupHandler(){logger[_0xfed1('0x19')](util[_0xfed1('0x13')]('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0xfed1('0x1e')],this[_0xfed1('0x1b')],this[_0xfed1('0x1f')],this[_0xfed1('0x1c')],this['uniqueid']));this[_0xfed1('0x20')]=!![];}function getRoot(_0x59333e){return parser[_0xfed1('0x21')](_0x59333e,{'object':!![]})[_0xfed1('0x22')][_0xfed1('0x23')];}function addVertex(_0x532ec2,_0x41d22c,_0x594917){_0x41d22c[_0xfed1('0x24')]=_0x594917;if(_0x41d22c[_0xfed1('0x25')](_0xfed1('0x26'))){_0x41d22c[_0xfed1('0x27')]=parseInt(_0x41d22c[_0xfed1('0x26')],0xa);}_0x532ec2[_0xfed1('0x28')](_['omit'](_0x41d22c,_0xfed1('0x29')));}function initGraph(_0xcb1cdc,_0x49072b){var _0x1d6c72=new Graph();for(var _0x2b9dd2 in _0xcb1cdc){if(_0xcb1cdc[_0xfed1('0x25')](_0x2b9dd2)){if(_[_0xfed1('0x2a')](_0xcb1cdc[_0x2b9dd2])){for(var _0x3b9122=0x0;_0x3b9122<_0xcb1cdc[_0x2b9dd2][_0xfed1('0x2b')];_0x3b9122+=0x1){addVertex(_0x1d6c72,_0xcb1cdc[_0x2b9dd2][_0x3b9122],_0x2b9dd2);}}else{addVertex(_0x1d6c72,_0xcb1cdc[_0x2b9dd2],_0x2b9dd2);}}}for(var _0x583953=0x0;_0x583953<_0x49072b[_0xfed1('0x2b')];_0x583953+=0x1){if(_0x49072b[_0x583953]['source']&&_0x49072b[_0x583953][_0xfed1('0x2c')]){_0x1d6c72['addEdge'](_0x49072b[_0x583953]['source'],_0x49072b[_0x583953][_0xfed1('0x2c')],_0x49072b[_0x583953][_0xfed1('0x2d')]);}}return _0x1d6c72;}function getSquareProject(_0x2d334e,_0x599c23){rpc[_0xfed1('0x2e')](_0x2d334e)[_0xfed1('0x2f')](function(_0x13f414){_0x599c23(null,_0x13f414);})[_0xfed1('0x30')](function(_0x12399f){_0x599c23(null,_0x12399f);});}function createSquareReport(_0x30272b,_0x5ccc3a){rpc[_0xfed1('0x31')](_0x30272b)[_0xfed1('0x2f')](function(_0x4fc309){if(_0x5ccc3a){_0x5ccc3a(null,_0x4fc309);}})['catch'](function(_0x28bd98){if(_0x5ccc3a){_0x5ccc3a(null,_0x28bd98);}});}function setChannelVariables(_0x2d10f5){for(var _0x2def09 in _0x2d10f5){if(_0x2d10f5[_0xfed1('0x25')](_0x2def09)){if(_0x2def09[_0xfed1('0x32')]('agi_')===0x0){_0x2d10f5[_0x2def09[_0xfed1('0x33')](0x4)]=_0x2d10f5[_0x2def09];delete _0x2d10f5[_0x2def09];}}}}function getLogFromObject(_0x21b292){return util[_0xfed1('0x34')](_0x21b292,{'showHidden':![],'depth':null});}function agiHandler(_0x349de1){var _0xa4c53c,_0x4fde94,_0x1da4b7,_0x4a81be,_0x11c5bd;logger[_0xfed1('0x35')](_0xfed1('0x36'),JSON[_0xfed1('0x37')](_0x349de1,null,0x2));logger[_0xfed1('0x19')](util[_0xfed1('0x13')](_0xfed1('0x38'),_0x349de1[_0xfed1('0x1e')],_0x349de1['calleridname'],_0x349de1[_0xfed1('0x1f')],_0x349de1[_0xfed1('0x1c')],_0x349de1[_0xfed1('0x1d')]));_0x349de1['on'](_0xfed1('0xf'),errorHandler);_0x349de1['on']('close',closeHandler);_0x349de1['on']('timeout',timeoutHandler);_0x349de1[_0xfed1('0x20')]=![];_0x349de1['on'](_0xfed1('0x39'),hangupHandler);var _0x1d06af=getSquareProject[_0xfed1('0x3a')](null,_0x349de1[_0xfed1('0x1e')]);if(_0x1d06af){if(_0x1d06af[_0xfed1('0x3b')]){_0xa4c53c=getRoot(_0x1d06af[_0xfed1('0x3b')]);if(_0xa4c53c&&_0xa4c53c[_0xfed1('0x3c')]){logger['debug']('root',JSON[_0xfed1('0x37')](_0xa4c53c,null,0x2));_0x349de1[_0xfed1('0x3d')]=moment()['format'](_0xfed1('0x3e'));_0x4fde94=initGraph(_[_0xfed1('0x3f')](_0xa4c53c,_0xfed1('0x29')),_0xa4c53c[_0xfed1('0x29')]);_0x1da4b7=new Vertices(_0x349de1,rpc,mailRpc);logger[_0xfed1('0x19')](util[_0xfed1('0x13')](_0xfed1('0x40'),_0x349de1[_0xfed1('0x1e')],_0x349de1[_0xfed1('0x1b')],_0x349de1['callerid'],_0x349de1['dnid'],_0x349de1['uniqueid']));_0x4fde94[_0xfed1('0x41')](_0xa4c53c[_0xfed1('0x3c')]['id'],function(_0x2f8f08){try{_0x2f8f08=_0x1da4b7['clear'](_0x2f8f08);logger[_0xfed1('0x35')]('vertex',JSON[_0xfed1('0x37')](_0x2f8f08,null,0x2));if(_0x2f8f08[_0xfed1('0x24')]===_0xfed1('0x42')){logger['info'](_0xfed1('0x43'));_0x349de1[_0xfed1('0x44')]=_0x2f8f08[_0xfed1('0x44')]||_0x349de1['context'];_0x349de1[_0xfed1('0x45')]=_0x2f8f08['extension'];_0x349de1[_0xfed1('0x46')]=_0x2f8f08[_0xfed1('0x46')]?_0x2f8f08[_0xfed1('0x46')]-0x1:0x1;return null;}else if(_0x2f8f08&&_0x1da4b7[_0x2f8f08[_0xfed1('0x24')]]){_0x11c5bd=_0x1da4b7[_0x2f8f08[_0xfed1('0x24')]](_0x2f8f08);logger[_0xfed1('0x19')](_0xfed1('0x47'),JSON[_0xfed1('0x37')](_0x11c5bd,null,0x2));if(_0x11c5bd&&_0x11c5bd[_0xfed1('0x48')]===AGI_CODE_SUCCESS&&_0x11c5bd['result']!==AGI_RESULT_ERROR&&!_0x349de1[_0xfed1('0x20')]){logger[_0xfed1('0x35')](_0xfed1('0x47'),getLogFromObject(_0x11c5bd));return _['isUndefined'](_0x11c5bd['result'])?null:_0x11c5bd[_0xfed1('0x49')][_0xfed1('0x4a')]();}else{logger[_0xfed1('0xf')](_0xfed1('0x47'),getLogFromObject(_0x11c5bd));return null;}}else{logger[_0xfed1('0xf')](_0xfed1('0x4b'));return null;}}catch(_0x2547ee){logger[_0xfed1('0xf')](_0x2547ee[_0xfed1('0x18')]);return null;}});if(_0xa4c53c[_0xfed1('0x4c')]){logger[_0xfed1('0x19')](util[_0xfed1('0x13')]('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x349de1[_0xfed1('0x1e')],_0x349de1[_0xfed1('0x1b')],_0x349de1[_0xfed1('0x1f')],_0x349de1[_0xfed1('0x1c')],_0x349de1[_0xfed1('0x1d')]));_0x4fde94[_0xfed1('0x41')](_0xa4c53c['finally']['id'],function(_0x1dd879){try{_0x1dd879=_0x1da4b7[_0xfed1('0x4d')](_0x1dd879);logger[_0xfed1('0x35')]('vertex',JSON[_0xfed1('0x37')](_0x1dd879,null,0x2));if(_0x1dd879&&_0x1da4b7[_0x1dd879[_0xfed1('0x24')]]){_0x11c5bd=_0x1da4b7[_0x1dd879[_0xfed1('0x24')]](_0x1dd879);if(_0x11c5bd){logger[_0xfed1('0x35')]('response',getLogFromObject(_0x11c5bd));return _[_0xfed1('0x4e')](_0x11c5bd[_0xfed1('0x49')])?null:_0x11c5bd[_0xfed1('0x49')][_0xfed1('0x4a')]();}else{logger[_0xfed1('0xf')](_0xfed1('0x47'),getLogFromObject(_0x11c5bd));return null;}}else{logger[_0xfed1('0xf')](_0xfed1('0x4b'));return null;}}catch(_0x2365db){logger[_0xfed1('0xf')](_0x2365db[_0xfed1('0x18')]);return null;}});}logger[_0xfed1('0x19')](util[_0xfed1('0x13')](_0xfed1('0x4f'),_0x349de1[_0xfed1('0x1e')],_0x349de1[_0xfed1('0x1b')],_0x349de1[_0xfed1('0x1f')],_0x349de1[_0xfed1('0x1c')],_0x349de1['uniqueid']));logger['info'](util[_0xfed1('0x13')](_0xfed1('0x50'),_0x349de1[_0xfed1('0x44')],_0x349de1[_0xfed1('0x45')],parseInt(_0x349de1['priority'],0xa)+0x1));_0x349de1[_0xfed1('0x51')](_0x349de1[_0xfed1('0x44')],_0x349de1['extension'],parseInt(_0x349de1['priority'],0xa)+0x1);_0x349de1['close']();}}else{logger[_0xfed1('0xf')](util[_0xfed1('0x13')](_0xfed1('0x52'),_0x349de1[_0xfed1('0x1e')]));_0x349de1[_0xfed1('0x51')](_0x349de1[_0xfed1('0x44')],_0x349de1[_0xfed1('0x45')],parseInt(_0x349de1[_0xfed1('0x46')],0xa)+0x1);_0x349de1[_0xfed1('0x53')]();}}else{logger[_0xfed1('0xf')](util['format']('Project\x20%s\x20not\x20found',_0x349de1[_0xfed1('0x1e')]));_0x349de1[_0xfed1('0x51')](_0x349de1[_0xfed1('0x44')],_0x349de1[_0xfed1('0x45')],parseInt(_0x349de1[_0xfed1('0x46')],0xa)+0x1);_0x349de1[_0xfed1('0x53')]();}}function main(){var _0x122702;return utilLicense[_0xfed1('0x54')]()[_0xfed1('0x2f')](function(_0x427fa6){if(_0x427fa6){if(_0x427fa6[_0xfed1('0x55')]){if(_0x427fa6[_0xfed1('0x56')]&&_0x427fa6[_0xfed1('0x56')]>0x0){logger[_0xfed1('0x19')](util[_0xfed1('0x13')](_0xfed1('0x57'),_0x427fa6[_0xfed1('0x56')]));_0x122702=_0x427fa6['callysquare'];}else{logger['info'](_0xfed1('0x58'));}}else{logger[_0xfed1('0x19')](_0xfed1('0x59'));_0x122702=-0x1;}}})[_0xfed1('0x30')](function(_0x23a4f0){logger[_0xfed1('0xf')](_0xfed1('0x5a'),_0x23a4f0[_0xfed1('0x18')]);})[_0xfed1('0x4c')](function(){var _0x1f2250=require(_0xfed1('0x5b'))(config[_0xfed1('0x7')][_0xfed1('0x12')],config[_0xfed1('0x7')]['ip'],_0x122702);_0x1f2250['on']('error',errorHandler);_0x1f2250['on'](_0xfed1('0x5c'),listeningHandler);_0x1f2250['on']('connection',connectionHandler);_0x1f2250['on']('close',closeHandler);});}main(); \ No newline at end of file +var _0x7118=['Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','port','[%s]\x20%s','name','message','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','dnid','uniqueid','callerid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','mxGraphModel','root','agicommand','hasOwnProperty','retry','addVertex','omit','mxCell','isArray','length','source','target','addEdge','getSquareProject','catch','indexOf','agi_','substring','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','hangup','sync','production','start','joinAt','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','isUndefined','result','toString','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','finally','agicommand\x20not\x20found','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','continueAt','Project\x20%s\x20not\x20published','Project\x20%s\x20not\x20found','getLicense','then','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','connection','syncho','util','../../config/environment','../../config/logger','agi','../../config/license/util','./rpc','./mailRpc','./graph','defaults','127.0.0.1','nextTick','error','stack','log'];(function(_0x24a9b3,_0x303ed0){var _0x22c0c7=function(_0x45ac8a){while(--_0x45ac8a){_0x24a9b3['push'](_0x24a9b3['shift']());}};_0x22c0c7(++_0x303ed0);}(_0x7118,0x159));var _0x8711=function(_0x4b00a6,_0x188ce4){_0x4b00a6=_0x4b00a6-0x0;var _0x1d840a=_0x7118[_0x4b00a6];return _0x1d840a;};'use strict';var parser=require('xml2json');var _=require('lodash');var syncho=require(_0x8711('0x0'));var util=require(_0x8711('0x1'));var moment=require('moment');var config=require(_0x8711('0x2'));var logger=require(_0x8711('0x3'))(_0x8711('0x4'));var utilLicense=require(_0x8711('0x5'));var rpc=require(_0x8711('0x6'));var mailRpc=require(_0x8711('0x7'));var Graph=require(_0x8711('0x8'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x8711('0x4')]=_[_0x8711('0x9')](config[_0x8711('0x4')],{'ip':_0x8711('0xa'),'port':0x11dd});function connectionHandler(_0x189349){process[_0x8711('0xb')](function(){syncho(function(){try{setChannelVariables(_0x189349);agiHandler(_0x189349);}catch(_0x7f7ca7){logger[_0x8711('0xc')](_0x7f7ca7[_0x8711('0xd')]);}});});}function listeningHandler(){console[_0x8711('0xe')](_0x8711('0xf'),config['agi']['port']);logger[_0x8711('0x10')](util[_0x8711('0x11')](_0x8711('0x12'),config['agi']['ip'],config['agi'][_0x8711('0x13')]));}function errorHandler(_0x89db9a){if(_0x89db9a&&_0x89db9a['name']&&_0x89db9a['message']){logger[_0x8711('0xc')](util[_0x8711('0x11')](_0x8711('0x14'),_0x89db9a[_0x8711('0x15')],_0x89db9a[_0x8711('0x16')]));}else{logger[_0x8711('0xc')](util[_0x8711('0x11')]('[ERROR]\x20%s',_0x89db9a[_0x8711('0xd')]));}}function closeHandler(){logger[_0x8711('0x10')](util[_0x8711('0x11')](_0x8711('0x17'),this[_0x8711('0x18')],this[_0x8711('0x19')],this['callerid'],this[_0x8711('0x1a')],this[_0x8711('0x1b')]));try{createSquareReport(this);}catch(_0x1c2cb5){logger[_0x8711('0xc')](_0x1c2cb5[_0x8711('0xd')]);}}function timeoutHandler(){logger['info'](util['format']('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x8711('0x18')],this[_0x8711('0x19')],this[_0x8711('0x1c')],this['dnid'],this['uniqueid']));}function hangupHandler(){logger[_0x8711('0x10')](util[_0x8711('0x11')](_0x8711('0x1d'),this[_0x8711('0x18')],this[_0x8711('0x19')],this[_0x8711('0x1c')],this[_0x8711('0x1a')],this[_0x8711('0x1b')]));this[_0x8711('0x1e')]=!![];}function getRoot(_0x41369d){return parser['toJson'](_0x41369d,{'object':!![]})[_0x8711('0x1f')][_0x8711('0x20')];}function addVertex(_0x3302b9,_0x939ef3,_0x4cf830){_0x939ef3[_0x8711('0x21')]=_0x4cf830;if(_0x939ef3[_0x8711('0x22')](_0x8711('0x23'))){_0x939ef3['maxRetry']=parseInt(_0x939ef3[_0x8711('0x23')],0xa);}_0x3302b9[_0x8711('0x24')](_[_0x8711('0x25')](_0x939ef3,_0x8711('0x26')));}function initGraph(_0x3f937b,_0x514956){var _0x494683=new Graph();for(var _0x515a74 in _0x3f937b){if(_0x3f937b[_0x8711('0x22')](_0x515a74)){if(_[_0x8711('0x27')](_0x3f937b[_0x515a74])){for(var _0x2d0901=0x0;_0x2d0901<_0x3f937b[_0x515a74][_0x8711('0x28')];_0x2d0901+=0x1){addVertex(_0x494683,_0x3f937b[_0x515a74][_0x2d0901],_0x515a74);}}else{addVertex(_0x494683,_0x3f937b[_0x515a74],_0x515a74);}}}for(var _0x12cfdc=0x0;_0x12cfdc<_0x514956[_0x8711('0x28')];_0x12cfdc+=0x1){if(_0x514956[_0x12cfdc][_0x8711('0x29')]&&_0x514956[_0x12cfdc][_0x8711('0x2a')]){_0x494683[_0x8711('0x2b')](_0x514956[_0x12cfdc]['source'],_0x514956[_0x12cfdc][_0x8711('0x2a')],_0x514956[_0x12cfdc]['value']);}}return _0x494683;}function getSquareProject(_0x28c2d5,_0xd0c671){rpc[_0x8711('0x2c')](_0x28c2d5)['then'](function(_0x440bc8){_0xd0c671(null,_0x440bc8);})['catch'](function(_0x2c4ba3){_0xd0c671(null,_0x2c4ba3);});}function createSquareReport(_0xa85687,_0x230376){rpc['createSquareReport'](_0xa85687)['then'](function(_0x465c5b){if(_0x230376){_0x230376(null,_0x465c5b);}})[_0x8711('0x2d')](function(_0x35af69){if(_0x230376){_0x230376(null,_0x35af69);}});}function setChannelVariables(_0x6ab2c7){for(var _0x1c2fae in _0x6ab2c7){if(_0x6ab2c7[_0x8711('0x22')](_0x1c2fae)){if(_0x1c2fae[_0x8711('0x2e')](_0x8711('0x2f'))===0x0){_0x6ab2c7[_0x1c2fae[_0x8711('0x30')](0x4)]=_0x6ab2c7[_0x1c2fae];delete _0x6ab2c7[_0x1c2fae];}}}}function getLogFromObject(_0x36f3bd){return util['inspect'](_0x36f3bd,{'showHidden':![],'depth':null});}function agiHandler(_0x3ede91){var _0x11c1e9,_0xa22baf,_0x285390,_0x11e2fc,_0x23a78b;logger[_0x8711('0x31')](_0x8711('0x32'),JSON[_0x8711('0x33')](_0x3ede91,null,0x2));logger[_0x8711('0x10')](util['format'](_0x8711('0x34'),_0x3ede91[_0x8711('0x18')],_0x3ede91[_0x8711('0x19')],_0x3ede91[_0x8711('0x1c')],_0x3ede91[_0x8711('0x1a')],_0x3ede91['uniqueid']));_0x3ede91['on'](_0x8711('0xc'),errorHandler);_0x3ede91['on'](_0x8711('0x35'),closeHandler);_0x3ede91['on'](_0x8711('0x36'),timeoutHandler);_0x3ede91['evtHangup']=![];_0x3ede91['on'](_0x8711('0x37'),hangupHandler);var _0x37fc30=getSquareProject[_0x8711('0x38')](null,_0x3ede91[_0x8711('0x18')]);if(_0x37fc30){if(_0x37fc30[_0x8711('0x39')]){_0x11c1e9=getRoot(_0x37fc30[_0x8711('0x39')]);if(_0x11c1e9&&_0x11c1e9[_0x8711('0x3a')]){logger['debug'](_0x8711('0x20'),JSON[_0x8711('0x33')](_0x11c1e9,null,0x2));_0x3ede91[_0x8711('0x3b')]=moment()[_0x8711('0x11')]('YYYY-MM-DD\x20HH:mm:ss');_0xa22baf=initGraph(_['omit'](_0x11c1e9,_0x8711('0x26')),_0x11c1e9[_0x8711('0x26')]);_0x285390=new Vertices(_0x3ede91,rpc,mailRpc);logger[_0x8711('0x10')](util[_0x8711('0x11')](_0x8711('0x3c'),_0x3ede91[_0x8711('0x18')],_0x3ede91[_0x8711('0x19')],_0x3ede91[_0x8711('0x1c')],_0x3ede91[_0x8711('0x1a')],_0x3ede91[_0x8711('0x1b')]));_0xa22baf[_0x8711('0x3d')](_0x11c1e9[_0x8711('0x3a')]['id'],function(_0x1efd42){try{_0x1efd42=_0x285390[_0x8711('0x3e')](_0x1efd42);logger[_0x8711('0x31')](_0x8711('0x3f'),JSON[_0x8711('0x33')](_0x1efd42,null,0x2));if(_0x1efd42[_0x8711('0x21')]===_0x8711('0x40')){logger[_0x8711('0x10')](_0x8711('0x41'));_0x3ede91['context']=_0x1efd42[_0x8711('0x42')]||_0x3ede91['context'];_0x3ede91[_0x8711('0x43')]=_0x1efd42[_0x8711('0x43')];_0x3ede91[_0x8711('0x44')]=_0x1efd42[_0x8711('0x44')]?_0x1efd42['priority']-0x1:0x1;return null;}else if(_0x1efd42&&_0x285390[_0x1efd42[_0x8711('0x21')]]){_0x23a78b=_0x285390[_0x1efd42[_0x8711('0x21')]](_0x1efd42);logger[_0x8711('0x10')](_0x8711('0x45'),JSON[_0x8711('0x33')](_0x23a78b,null,0x2));if(_0x23a78b&&_0x23a78b[_0x8711('0x46')]===AGI_CODE_SUCCESS&&_0x23a78b['result']!==AGI_RESULT_ERROR&&!_0x3ede91[_0x8711('0x1e')]){logger[_0x8711('0x31')](_0x8711('0x45'),getLogFromObject(_0x23a78b));return _[_0x8711('0x47')](_0x23a78b['result'])?null:_0x23a78b[_0x8711('0x48')][_0x8711('0x49')]();}else{logger[_0x8711('0xc')](_0x8711('0x45'),getLogFromObject(_0x23a78b));return null;}}else{logger[_0x8711('0xc')]('agicommand\x20not\x20found');return null;}}catch(_0x4a0436){logger[_0x8711('0xc')](_0x4a0436[_0x8711('0xd')]);return null;}});if(_0x11c1e9['finally']){logger[_0x8711('0x10')](util[_0x8711('0x11')](_0x8711('0x4a'),_0x3ede91[_0x8711('0x18')],_0x3ede91['calleridname'],_0x3ede91[_0x8711('0x1c')],_0x3ede91[_0x8711('0x1a')],_0x3ede91[_0x8711('0x1b')]));_0xa22baf['traverseBFS'](_0x11c1e9[_0x8711('0x4b')]['id'],function(_0x29b79e){try{_0x29b79e=_0x285390['clear'](_0x29b79e);logger[_0x8711('0x31')](_0x8711('0x3f'),JSON['stringify'](_0x29b79e,null,0x2));if(_0x29b79e&&_0x285390[_0x29b79e[_0x8711('0x21')]]){_0x23a78b=_0x285390[_0x29b79e[_0x8711('0x21')]](_0x29b79e);if(_0x23a78b){logger['debug'](_0x8711('0x45'),getLogFromObject(_0x23a78b));return _[_0x8711('0x47')](_0x23a78b[_0x8711('0x48')])?null:_0x23a78b[_0x8711('0x48')]['toString']();}else{logger[_0x8711('0xc')](_0x8711('0x45'),getLogFromObject(_0x23a78b));return null;}}else{logger['error'](_0x8711('0x4c'));return null;}}catch(_0x209813){logger['error'](_0x209813['stack']);return null;}});}logger['info'](util['format'](_0x8711('0x4d'),_0x3ede91[_0x8711('0x18')],_0x3ede91[_0x8711('0x19')],_0x3ede91[_0x8711('0x1c')],_0x3ede91[_0x8711('0x1a')],_0x3ede91[_0x8711('0x1b')]));logger[_0x8711('0x10')](util['format']('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x3ede91['context'],_0x3ede91[_0x8711('0x43')],parseInt(_0x3ede91[_0x8711('0x44')],0xa)+0x1));_0x3ede91[_0x8711('0x4e')](_0x3ede91[_0x8711('0x42')],_0x3ede91[_0x8711('0x43')],parseInt(_0x3ede91[_0x8711('0x44')],0xa)+0x1);_0x3ede91['close']();}}else{logger[_0x8711('0xc')](util[_0x8711('0x11')](_0x8711('0x4f'),_0x3ede91['arg_1']));_0x3ede91[_0x8711('0x4e')](_0x3ede91[_0x8711('0x42')],_0x3ede91[_0x8711('0x43')],parseInt(_0x3ede91[_0x8711('0x44')],0xa)+0x1);_0x3ede91[_0x8711('0x35')]();}}else{logger[_0x8711('0xc')](util[_0x8711('0x11')](_0x8711('0x50'),_0x3ede91['arg_1']));_0x3ede91[_0x8711('0x4e')](_0x3ede91['context'],_0x3ede91[_0x8711('0x43')],parseInt(_0x3ede91['priority'],0xa)+0x1);_0x3ede91['close']();}}function main(){var _0x4f6f3d;return utilLicense[_0x8711('0x51')]()[_0x8711('0x52')](function(_0x5a1468){if(_0x5a1468){if(_0x5a1468[_0x8711('0x53')]){if(_0x5a1468['callysquare']&&_0x5a1468[_0x8711('0x54')]>0x0){logger[_0x8711('0x10')](util['format'](_0x8711('0x55'),_0x5a1468['callysquare']));_0x4f6f3d=_0x5a1468[_0x8711('0x54')];}else{logger[_0x8711('0x10')]('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger['info'](_0x8711('0x56'));_0x4f6f3d=-0x1;}}})['catch'](function(_0x15c02f){logger[_0x8711('0xc')](_0x8711('0x57'),_0x15c02f[_0x8711('0xd')]);})[_0x8711('0x4b')](function(){var _0x5dfb08=require(_0x8711('0x58'))(config[_0x8711('0x4')][_0x8711('0x13')],config[_0x8711('0x4')]['ip'],_0x4f6f3d);_0x5dfb08['on'](_0x8711('0xc'),errorHandler);_0x5dfb08['on']('listening',listeningHandler);_0x5dfb08['on'](_0x8711('0x59'),connectionHandler);_0x5dfb08['on'](_0x8711('0x35'),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 0d44f5e..dd74b0a 100644 --- a/server/services/agi/mailRpc/index.js +++ b/server/services/agi/mailRpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x814b=['bluebird','jayson/promise','client','http','request','then','error','result','catch','sendMailMessage','SendMail'];(function(_0x287ecf,_0x2afd02){var _0x5514f3=function(_0xaf56c0){while(--_0xaf56c0){_0x287ecf['push'](_0x287ecf['shift']());}};_0x5514f3(++_0x2afd02);}(_0x814b,0x1a2));var _0xb814=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x814b[_0x173441];return _0x2423a8;};'use strict';var BPromise=require(_0xb814('0x0'));var jayson=require(_0xb814('0x1'));var client=jayson[_0xb814('0x2')][_0xb814('0x3')]({'port':0x232b});function request(_0xfbb64b,_0x477725){return new BPromise(function(_0x4a98af,_0x38c21a){return client[_0xb814('0x4')](_0xfbb64b,_0x477725)[_0xb814('0x5')](function(_0x4237bc){if(_0x4237bc[_0xb814('0x6')]){return _0x38c21a(_0x4237bc[_0xb814('0x6')]['message']);}else{return _0x4a98af(_0x4237bc[_0xb814('0x7')]);}})[_0xb814('0x8')](function(_0x5c8539){return _0x38c21a(_0x5c8539);});});}exports[_0xb814('0x9')]=function(_0x2913a6,_0x186d5a){return request(_0xb814('0xa'),{'account':_0x2913a6,'message':_0x186d5a});}; \ No newline at end of file +var _0x814b=['bluebird','jayson/promise','client','http','request','then','error','result','catch','sendMailMessage','SendMail'];(function(_0x48508a,_0x3f62b4){var _0x3a051a=function(_0x491725){while(--_0x491725){_0x48508a['push'](_0x48508a['shift']());}};_0x3a051a(++_0x3f62b4);}(_0x814b,0x1a2));var _0xb814=function(_0x243bba,_0x1ea69f){_0x243bba=_0x243bba-0x0;var _0x12e696=_0x814b[_0x243bba];return _0x12e696;};'use strict';var BPromise=require(_0xb814('0x0'));var jayson=require(_0xb814('0x1'));var client=jayson[_0xb814('0x2')][_0xb814('0x3')]({'port':0x232b});function request(_0xfbb64b,_0x477725){return new BPromise(function(_0x4a98af,_0x38c21a){return client[_0xb814('0x4')](_0xfbb64b,_0x477725)[_0xb814('0x5')](function(_0x4237bc){if(_0x4237bc[_0xb814('0x6')]){return _0x38c21a(_0x4237bc[_0xb814('0x6')]['message']);}else{return _0x4a98af(_0x4237bc[_0xb814('0x7')]);}})[_0xb814('0x8')](function(_0x5c8539){return _0x38c21a(_0x5c8539);});});}exports[_0xb814('0x9')]=function(_0x2913a6,_0x186d5a){return request(_0xb814('0xa'),{'account':_0x2913a6,'message':_0x186d5a});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index ec11e3a..e682d9a 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(_0x4370f0,_0x1331f7){var _0x21c39e=function(_0x5dba63){while(--_0x5dba63){_0x4370f0['push'](_0x4370f0['shift']());}};_0x21c39e(++_0x1331f7);}(_0x5f2f,0x73));var _0xf5f2=function(_0x521500,_0x4cc29f){_0x521500=_0x521500-0x0;var _0x4c0a73=_0x5f2f[_0x521500];return _0x4c0a73;};'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 _0xb10b=['call','_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','_localBuffer','toString','indexOf','substring','split','trim','slice','length','emit','headers','line','exports','util','Transform'];(function(_0xed5f9c,_0x5a25cd){var _0x3a1c43=function(_0x251202){while(--_0x251202){_0xed5f9c['push'](_0xed5f9c['shift']());}};_0x3a1c43(++_0x5a25cd);}(_0xb10b,0x12a));var _0xbb10=function(_0x35000d,_0xc8945c){_0x35000d=_0x35000d-0x0;var _0x2b856f=_0xb10b[_0x35000d];return _0x2b856f;};'use strict';var util=require(_0xbb10('0x0'));var Transform=require('stream')[_0xbb10('0x1')];function AGIReply(_0x35bc5f){Transform[_0xbb10('0x2')](this,_0x35bc5f);this['_localBuffer']='';this[_0xbb10('0x3')]=![];}util[_0xbb10('0x4')](AGIReply,Transform);AGIReply[_0xbb10('0x5')][_0xbb10('0x6')]=function(_0x49baf4,_0x312b72,_0x481979){var _0x328583='\x0a',_0x3cdd53=['\x0a\x0a',_0xbb10('0x7')],_0x513741=-0x1,_0x1b9e94=-0x1,_0x3fb675='',_0x21370f=0x0,_0x1c3ee5='',_0x2353ef='';this[_0xbb10('0x8')]+=_0x49baf4[_0xbb10('0x9')]();_0x1c3ee5=this['_localBuffer'];if(!this['_inBody']){_0x21370f=0x0;while(_0x3cdd53[_0x21370f]){while((_0x1b9e94=_0x1c3ee5[_0xbb10('0xa')](_0x3cdd53[_0x21370f]))!=-0x1){_0x3fb675=_0x3cdd53[_0x21370f];_0x2353ef=_0x1c3ee5[_0xbb10('0xb')](0x0,_0x1b9e94);_0x1c3ee5=_0x1c3ee5[_0xbb10('0xb')](_0x1b9e94+_0x3fb675['length']);var _0x408248=_0x2353ef[_0xbb10('0xc')](_0x328583),_0x5be7e0=0x0,_0x44fb19={},_0x916a32='',_0x285009='',_0x193a27=-0x1;while(_0x408248[_0x5be7e0]){_0x193a27=_0x408248[_0x5be7e0][_0xbb10('0xa')](':');if(_0x193a27!=-0x1){_0x916a32=_0x408248[_0x5be7e0]['slice'](0x0,_0x193a27)[_0xbb10('0xd')]();_0x285009=_0x408248[_0x5be7e0][_0xbb10('0xe')](_0x193a27+0x1)[_0xbb10('0xd')]();if(_0x916a32[_0xbb10('0xf')]>0x0){_0x44fb19[_0x916a32]=_0x285009;}}else{}_0x5be7e0++;}this[_0xbb10('0x10')](_0xbb10('0x11'),_0x44fb19);this[_0xbb10('0x3')]=!![];}_0x21370f++;}this[_0xbb10('0x8')]=_0x1c3ee5;}else{while((_0x513741=_0x1c3ee5[_0xbb10('0xa')](_0x328583))!=-0x1){_0x2353ef=_0x1c3ee5[_0xbb10('0xb')](0x0,_0x513741);this['emit'](_0xbb10('0x12'),_0x2353ef);_0x1c3ee5=_0x1c3ee5[_0xbb10('0xb')](_0x513741+_0x328583[_0xbb10('0xf')]);}this[_0xbb10('0x8')]=_0x1c3ee5;}_0x481979();};module[_0xbb10('0x13')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 47ba7aa..68d5301 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 _0x4c7a=['ShowInterval','getSmsAccountById','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ListId','then','CreateCmContact','getPauseById','agentLogin','PauseUser','agentUnpause','agentLogout','LogoutUser','bluebird','moment','lodash','util','jayson/promise','client','http','request','error','message','result','getSquareProject','ShowSquareProject','production','getMailAccountById','ShowMailAccount','MailServerOut','name','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','ShowTrunk','getSoundById','save_name'];(function(_0x2da3b9,_0x34705d){var _0x42eb65=function(_0x1c4d12){while(--_0x1c4d12){_0x2da3b9['push'](_0x2da3b9['shift']());}};_0x42eb65(++_0x34705d);}(_0x4c7a,0x125));var _0xa4c7=function(_0x25e4a0,_0x5c7774){_0x25e4a0=_0x25e4a0-0x0;var _0x470799=_0x4c7a[_0x25e4a0];return _0x470799;};'use strict';var BPromise=require(_0xa4c7('0x0'));var moment=require(_0xa4c7('0x1'));var _=require(_0xa4c7('0x2'));var util=require(_0xa4c7('0x3'));var jayson=require(_0xa4c7('0x4'));var client=jayson[_0xa4c7('0x5')][_0xa4c7('0x6')]({'port':0x2329});function request(_0x18761f,_0x4e4a11){return new BPromise(function(_0x35b6f5,_0x3c6825){return client[_0xa4c7('0x7')](_0x18761f,_0x4e4a11)['then'](function(_0x450e60){if(_0x450e60[_0xa4c7('0x8')]){return _0x3c6825(_0x450e60[_0xa4c7('0x8')][_0xa4c7('0x9')]);}else{return _0x35b6f5(_0x450e60[_0xa4c7('0xa')]);}})['catch'](function(_0x35db6e){return _0x3c6825(_0x35db6e);});});}exports[_0xa4c7('0xb')]=function(_0x20cc5d){return request(_0xa4c7('0xc'),{'options':{'raw':![],'where':{'name':_0x20cc5d},'attributes':[_0xa4c7('0xd')]}});};exports[_0xa4c7('0xe')]=function(_0x112fbc){return request(_0xa4c7('0xf'),{'options':{'raw':![],'where':{'id':_0x112fbc},'include':[{'model':_0xa4c7('0x10'),'as':'Smtp'}],'attributes':['id',_0xa4c7('0x11'),_0xa4c7('0x12')]}});};exports[_0xa4c7('0x13')]=function(_0x2fb9ed){return request(_0xa4c7('0xc'),{'options':{'where':{'id':_0x2fb9ed},'attributes':[_0xa4c7('0x11')]}});};exports[_0xa4c7('0x14')]=function(_0xc22791){return request(_0xa4c7('0x15'),{'options':{'where':{'id':_0xc22791},'attributes':[_0xa4c7('0x11')]}});};exports['getVariableById']=function(_0x51834f){return request(_0xa4c7('0x16'),{'options':{'where':{'id':_0x51834f},'attributes':[_0xa4c7('0x11')]}});};exports[_0xa4c7('0x17')]=function(_0x3523e8){return request(_0xa4c7('0x18'),{'options':{'where':{'id':_0x3523e8},'attributes':[_0xa4c7('0x19')]}});};exports[_0xa4c7('0x1a')]=function(_0x52ec3b){return request(_0xa4c7('0x1b'),{'options':{'where':{'id':_0x52ec3b},'attributes':[_0xa4c7('0x11')]}});};exports['getTrunkById']=function(_0x31c1c3){return request(_0xa4c7('0x1c'),{'options':{'where':{'id':_0x31c1c3},'attributes':[_0xa4c7('0x11')]}});};exports[_0xa4c7('0x1d')]=function(_0x1c4d4a){return request('ShowSound',{'options':{'where':{'id':_0x1c4d4a},'attributes':[_0xa4c7('0x1e')]}});};exports['getIntervalById']=function(_0x47608f){return request(_0xa4c7('0x1f'),{'options':{'raw':![],'where':{'id':_0x47608f},'include':[{'model':'Interval','as':'Intervals'}]}});};exports[_0xa4c7('0x20')]=function(_0x2c020c){return request('ShowSmsAccount',{'options':{'where':{'id':_0x2c020c},'attributes':['id','name']}});};exports['createSmsMessage']=function(_0x2a3ccb){return request(_0xa4c7('0x21'),{'body':_0x2a3ccb});};exports[_0xa4c7('0x22')]=function(_0x3e133b){return request(_0xa4c7('0x23'),{'body':_0x3e133b});};exports[_0xa4c7('0x24')]=function(_0x6386ca){return request(_0xa4c7('0x25'),{'body':_[_0xa4c7('0x26')](_0x6386ca,{'project_name':_0x6386ca[_0xa4c7('0x27')],'prev_project_name':_0x6386ca['arg_2']||'','is_subproject':_0x6386ca[_0xa4c7('0x28')]?!![]:![],'leaveAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')})});};exports['createSquareRecording']=function(_0x29bd41){return request(_0xa4c7('0x29'),{'body':_0x29bd41});};exports[_0xa4c7('0x2a')]=function(_0x41c1d1){return request(_0xa4c7('0x2b'),{'body':_0x41c1d1});};exports[_0xa4c7('0x2c')]=function(_0x232362){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x232362['phone'],'ListId':_0x232362[_0xa4c7('0x2d')]}}})[_0xa4c7('0x2e')](function(_0x64468d){if(_0x64468d){return _0x64468d;}return request(_0xa4c7('0x2f'),{'body':_0x232362});});};exports[_0xa4c7('0x30')]=function(_0x56ad81){return request('ShowPause',{'options':{'where':{'id':_0x56ad81},'attributes':[_0xa4c7('0x11')]}});};exports[_0xa4c7('0x31')]=function(_0x782118,_0x4889f8){return request('LoginUser',{'body':{'interface':_0x4889f8},'options':{'where':_0x782118}});};exports['agentPause']=function(_0x343934,_0x5bc48f,_0x4572be){return request(_0xa4c7('0x32'),{'body':{'type':_0x5bc48f,'uniqueid':_0x4572be},'options':{'where':_0x343934}});};exports[_0xa4c7('0x33')]=function(_0x559add){return request('UnpauseUser',{'body':{},'options':{'where':_0x559add}});};exports[_0xa4c7('0x34')]=function(_0x1bf12a){return request(_0xa4c7('0x35'),{'body':{},'options':{'where':_0x1bf12a}});}; \ No newline at end of file +var _0xfce5=['getPauseById','ShowPause','LoginUser','agentPause','PauseUser','UnpauseUser','moment','lodash','util','http','request','then','error','message','result','catch','getSquareProject','ShowSquareProject','production','getMailAccountById','Smtp','email','getSquareProjectById','name','getVoiceQueueById','getVariableById','getUserById','ShowUser','getTrunkById','ShowTrunk','getSoundById','ShowSound','save_name','getIntervalById','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','ListId','CreateCmContact'];(function(_0x2004ee,_0x55d639){var _0x43b160=function(_0x190f7c){while(--_0x190f7c){_0x2004ee['push'](_0x2004ee['shift']());}};_0x43b160(++_0x55d639);}(_0xfce5,0x70));var _0x5fce=function(_0x1a968e,_0x3f45f4){_0x1a968e=_0x1a968e-0x0;var _0x2c7b23=_0xfce5[_0x1a968e];return _0x2c7b23;};'use strict';var BPromise=require('bluebird');var moment=require(_0x5fce('0x0'));var _=require(_0x5fce('0x1'));var util=require(_0x5fce('0x2'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5fce('0x3')]({'port':0x2329});function request(_0xae4356,_0x43e54b){return new BPromise(function(_0x2c44cf,_0x22a0b2){return client[_0x5fce('0x4')](_0xae4356,_0x43e54b)[_0x5fce('0x5')](function(_0x4abcb0){if(_0x4abcb0[_0x5fce('0x6')]){return _0x22a0b2(_0x4abcb0['error'][_0x5fce('0x7')]);}else{return _0x2c44cf(_0x4abcb0[_0x5fce('0x8')]);}})[_0x5fce('0x9')](function(_0x5a4a8b){return _0x22a0b2(_0x5a4a8b);});});}exports[_0x5fce('0xa')]=function(_0x5db8ac){return request(_0x5fce('0xb'),{'options':{'raw':![],'where':{'name':_0x5db8ac},'attributes':[_0x5fce('0xc')]}});};exports[_0x5fce('0xd')]=function(_0xc3bae3){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0xc3bae3},'include':[{'model':'MailServerOut','as':_0x5fce('0xe')}],'attributes':['id','name',_0x5fce('0xf')]}});};exports[_0x5fce('0x10')]=function(_0x2157e7){return request(_0x5fce('0xb'),{'options':{'where':{'id':_0x2157e7},'attributes':[_0x5fce('0x11')]}});};exports[_0x5fce('0x12')]=function(_0x58652c){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x58652c},'attributes':[_0x5fce('0x11')]}});};exports[_0x5fce('0x13')]=function(_0x572d3a){return request('ShowVariable',{'options':{'where':{'id':_0x572d3a},'attributes':[_0x5fce('0x11')]}});};exports['getSquareOdbcById']=function(_0x261744){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x261744},'attributes':['dsn']}});};exports[_0x5fce('0x14')]=function(_0x12a07b){return request(_0x5fce('0x15'),{'options':{'where':{'id':_0x12a07b},'attributes':['name']}});};exports[_0x5fce('0x16')]=function(_0x244061){return request(_0x5fce('0x17'),{'options':{'where':{'id':_0x244061},'attributes':['name']}});};exports[_0x5fce('0x18')]=function(_0x4e58c1){return request(_0x5fce('0x19'),{'options':{'where':{'id':_0x4e58c1},'attributes':[_0x5fce('0x1a')]}});};exports[_0x5fce('0x1b')]=function(_0x391624){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x391624},'include':[{'model':_0x5fce('0x1c'),'as':_0x5fce('0x1d')}]}});};exports[_0x5fce('0x1e')]=function(_0xf60840){return request(_0x5fce('0x1f'),{'options':{'where':{'id':_0xf60840},'attributes':['id',_0x5fce('0x11')]}});};exports[_0x5fce('0x20')]=function(_0x4f7175){return request(_0x5fce('0x21'),{'body':_0x4f7175});};exports[_0x5fce('0x22')]=function(_0x957441){return request(_0x5fce('0x23'),{'body':_0x957441});};exports[_0x5fce('0x24')]=function(_0x47987c){return request('CreateSquareReport',{'body':_['merge'](_0x47987c,{'project_name':_0x47987c['arg_1'],'prev_project_name':_0x47987c[_0x5fce('0x25')]||'','is_subproject':_0x47987c[_0x5fce('0x25')]?!![]:![],'leaveAt':moment()[_0x5fce('0x26')](_0x5fce('0x27'))})});};exports['createSquareRecording']=function(_0x3c6706){return request(_0x5fce('0x28'),{'body':_0x3c6706});};exports[_0x5fce('0x29')]=function(_0x4305f8){return request(_0x5fce('0x2a'),{'body':_0x4305f8});};exports[_0x5fce('0x2b')]=function(_0x636fd8){return request(_0x5fce('0x2c'),{'options':{'raw':![],'where':{'phone':_0x636fd8['phone'],'ListId':_0x636fd8[_0x5fce('0x2d')]}}})[_0x5fce('0x5')](function(_0x181e50){if(_0x181e50){return _0x181e50;}return request(_0x5fce('0x2e'),{'body':_0x636fd8});});};exports[_0x5fce('0x2f')]=function(_0x199d6e){return request(_0x5fce('0x30'),{'options':{'where':{'id':_0x199d6e},'attributes':[_0x5fce('0x11')]}});};exports['agentLogin']=function(_0x5582ed,_0x1ef70d){return request(_0x5fce('0x31'),{'body':{'interface':_0x1ef70d},'options':{'where':_0x5582ed}});};exports[_0x5fce('0x32')]=function(_0x31f910,_0x1681f3,_0x5f35c5){return request(_0x5fce('0x33'),{'body':{'type':_0x1681f3,'uniqueid':_0x5f35c5},'options':{'where':_0x31f910}});};exports['agentUnpause']=function(_0x395030){return request(_0x5fce('0x34'),{'body':{},'options':{'where':_0x395030}});};exports['agentLogout']=function(_0x2a3fc6){return request('LogoutUser',{'body':{},'options':{'where':_0x2a3fc6}});}; \ 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 a80910b..5a04df1 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 _0xadb8=['exports'];(function(_0x2cd809,_0x4cdedd){var _0x5a1519=function(_0x510aaa){while(--_0x510aaa){_0x2cd809['push'](_0x2cd809['shift']());}};_0x5a1519(++_0x4cdedd);}(_0xadb8,0x1d0));var _0x8adb=function(_0x548200,_0x3241b8){_0x548200=_0x548200-0x0;var _0x1a6d74=_0xadb8[_0x548200];return _0x1a6d74;};var polly=require('./polly');var lex=require('./lex');module[_0x8adb('0x0')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x8d0e=['./polly','./lex','exports'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x121795,_0x2b9933){_0x121795=_0x121795-0x0;var _0x115087=_0x8d0e[_0x121795];return _0x115087;};var polly=require(_0xe8d0('0x0'));var lex=require(_0xe8d0('0x1'));module[_0xe8d0('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 9c2fee2..875d396 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 _0x2e35=['./lib/api','exports'];(function(_0x3dd570,_0x317dd9){var _0x472b8a=function(_0x17ec39){while(--_0x17ec39){_0x3dd570['push'](_0x3dd570['shift']());}};_0x472b8a(++_0x317dd9);}(_0x2e35,0x1d0));var _0x52e3=function(_0x3efe11,_0xbf5471){_0x3efe11=_0x3efe11-0x0;var _0x6be032=_0x2e35[_0x3efe11];return _0x6be032;};'use strict';var lex=require(_0x52e3('0x0'));module[_0x52e3('0x1')]=function(_0x1dc2a2,_0x5b86c0,_0x145ad0,_0xcbe6c5,_0x16d807,_0x3dc244){return lex(_0x1dc2a2,_0x5b86c0,_0x145ad0,_0xcbe6c5,_0x16d807,_0x3dc244);}; \ No newline at end of file +var _0x3a25=['exports','./lib/api'];(function(_0x10c5b6,_0x5cb5b7){var _0x3b8f14=function(_0x849790){while(--_0x849790){_0x10c5b6['push'](_0x10c5b6['shift']());}};_0x3b8f14(++_0x5cb5b7);}(_0x3a25,0x15d));var _0x53a2=function(_0x19b076,_0x37c508){_0x19b076=_0x19b076-0x0;var _0x4ad4a4=_0x3a25[_0x19b076];return _0x4ad4a4;};'use strict';var lex=require(_0x53a2('0x0'));module[_0x53a2('0x1')]=function(_0x200e41,_0x133802,_0x23a126,_0x8efef2,_0x119389,_0x1f138b){return lex(_0x200e41,_0x133802,_0x23a126,_0x8efef2,_0x119389,_0x1f138b);}; \ 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 f8a0a95..9b169a5 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 _0x5f4c=['hasOwnProperty','slot_','exports','$LATEST','bluebird','aws-sdk','postText','slots'];(function(_0xbd3b52,_0x48ffdb){var _0x895a50=function(_0x4ff71e){while(--_0x4ff71e){_0xbd3b52['push'](_0xbd3b52['shift']());}};_0x895a50(++_0x48ffdb);}(_0x5f4c,0x1bc));var _0xc5f4=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x5f4c[_0x465028];return _0xb783d4;};'use strict';var BPromise=require(_0xc5f4('0x0'));var AWS=require(_0xc5f4('0x1'));function lexResult(_0x25f5b0,_0x30b001){return new BPromise(function(_0x2e2f35,_0x3a8182){_0x25f5b0[_0xc5f4('0x2')](_0x30b001,function(_0x422f56,_0x3886b3){if(_0x422f56){_0x3a8182(_0x422f56);}if(_0x3886b3[_0xc5f4('0x3')]){for(const _0xb1669b in _0x3886b3[_0xc5f4('0x3')]){if(_0x3886b3[_0xc5f4('0x3')][_0xc5f4('0x4')](_0xb1669b)){var _0x3f457f=_0x3886b3[_0xc5f4('0x3')][_0xb1669b];_0x3886b3[_0xc5f4('0x5')+_0xb1669b]=_0x3f457f;}}}_0x2e2f35(_0x3886b3);});});}module[_0xc5f4('0x6')]=function(_0x115417,_0x431b39,_0xd4b731,_0x254b23,_0x365bcb,_0x217f4b){var _0x5d9212=new AWS['LexRuntime']({'accessKeyId':_0x431b39,'secretAccessKey':_0xd4b731,'region':_0x254b23});var _0x586633={'botAlias':_0xc5f4('0x7'),'botName':_0x217f4b,'inputText':_0x365bcb,'userId':_0x115417};return lexResult(_0x5d9212,_0x586633);}; \ No newline at end of file +var _0x9a71=['postText','slots','slot_','exports','$LATEST','bluebird','aws-sdk'];(function(_0x51aa57,_0x573b46){var _0x21ebd9=function(_0x597aab){while(--_0x597aab){_0x51aa57['push'](_0x51aa57['shift']());}};_0x21ebd9(++_0x573b46);}(_0x9a71,0x178));var _0x19a7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9a71[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0x19a7('0x0'));var AWS=require(_0x19a7('0x1'));function lexResult(_0x492a81,_0x1c633d){return new BPromise(function(_0x355945,_0x3ce554){_0x492a81[_0x19a7('0x2')](_0x1c633d,function(_0x12d63c,_0x5b650c){if(_0x12d63c){_0x3ce554(_0x12d63c);}if(_0x5b650c[_0x19a7('0x3')]){for(const _0x214a10 in _0x5b650c[_0x19a7('0x3')]){if(_0x5b650c[_0x19a7('0x3')]['hasOwnProperty'](_0x214a10)){var _0x3e4607=_0x5b650c[_0x19a7('0x3')][_0x214a10];_0x5b650c[_0x19a7('0x4')+_0x214a10]=_0x3e4607;}}}_0x355945(_0x5b650c);});});}module[_0x19a7('0x5')]=function(_0x133b4a,_0x39a980,_0x4f918c,_0x1d7603,_0x54449d,_0x5dcdf2){var _0x1fa36e=new AWS['LexRuntime']({'accessKeyId':_0x39a980,'secretAccessKey':_0x4f918c,'region':_0x1d7603});var _0x2307e4={'botAlias':_0x19a7('0x6'),'botName':_0x5dcdf2,'inputText':_0x54449d,'userId':_0x133b4a};return lexResult(_0x1fa36e,_0x2307e4);}; \ 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 d2900ae..35a8226 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 _0x16e1=['./lib/api'];(function(_0x58c2ac,_0x58c01b){var _0x10cb51=function(_0x57d85d){while(--_0x57d85d){_0x58c2ac['push'](_0x58c2ac['shift']());}};_0x10cb51(++_0x58c01b);}(_0x16e1,0x1ea));var _0x116e=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x16e1[_0x273c39];return _0x46d6b5;};'use strict';var polly=require(_0x116e('0x0'));module['exports']=function(_0x44fc39,_0x1f5e0f,_0x1718f0,_0x24cb92,_0x4405e8,_0x304b3d,_0x34eac8){return polly(_0x44fc39,_0x1f5e0f,_0x1718f0,_0x24cb92,_0x4405e8,_0x304b3d,_0x34eac8);}; \ No newline at end of file +'use strict';var polly=require('./lib/api');module['exports']=function(_0x3dae41,_0x50bac7,_0x1b1b7b,_0x403c0b,_0x25de50,_0xdfb4d4,_0x107244){return polly(_0x3dae41,_0x50bac7,_0x1b1b7b,_0x403c0b,_0x25de50,_0xdfb4d4,_0x107244);}; \ 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 48b4a1c..e283203 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 _0x2f2b=['exports','text','randomstring','aws-sdk','synthesizeSpeech','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!'];(function(_0x264b16,_0x1de7a6){var _0x5606d4=function(_0x14e1c9){while(--_0x14e1c9){_0x264b16['push'](_0x264b16['shift']());}};_0x5606d4(++_0x1de7a6);}(_0x2f2b,0xb2));var _0xb2f2=function(_0xfd7388,_0x5c64c7){_0xfd7388=_0xfd7388-0x0;var _0x39edf4=_0x2f2b[_0xfd7388];return _0x39edf4;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require('bluebird');var rs=require(_0xb2f2('0x0'));var AWS=require(_0xb2f2('0x1'));function pollyResult(_0x1aff0d,_0xdb44dc,_0xd075c8){return new BPromise(function(_0x53a678,_0x1d604c){_0x1aff0d[_0xb2f2('0x2')](_0xdb44dc,function(_0x569675,_0x30517d){if(_0x569675){_0x1d604c(_0x569675);}else if(_0x30517d){if(_0x30517d[_0xb2f2('0x3')]instanceof Buffer){fs['writeFile'](_0xd075c8,_0x30517d[_0xb2f2('0x3')],function(_0x1ce6c6){if(_0x1ce6c6){_0x1d604c(_0x1ce6c6);}else{_0x53a678();}});}else{_0x1d604c(new Error(_0xb2f2('0x4')));}}else{_0x1d604c(new Error(_0xb2f2('0x5')));}});});}module[_0xb2f2('0x6')]=function(_0x4f98e9,_0x49566d,_0x345548,_0x548813,_0x5b0277,_0x55bf67,_0x4edf96){var _0x2c9c14=new AWS['Polly']({'accessKeyId':_0x4f98e9,'secretAccessKey':_0x49566d,'region':_0x345548});var _0x41cedb={'Text':_0x5b0277,'TextType':_0x55bf67||_0xb2f2('0x7'),'OutputFormat':'mp3','VoiceId':_0x548813};return pollyResult(_0x2c9c14,_0x41cedb,_0x4edf96);}; \ No newline at end of file +var _0x5826=['path','randomstring','aws-sdk','synthesizeSpeech','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','mp3'];(function(_0x172be5,_0x51cae2){var _0x3662b1=function(_0x29db51){while(--_0x29db51){_0x172be5['push'](_0x172be5['shift']());}};_0x3662b1(++_0x51cae2);}(_0x5826,0xfd));var _0x6582=function(_0x323b5c,_0x2ac11a){_0x323b5c=_0x323b5c-0x0;var _0x235dab=_0x5826[_0x323b5c];return _0x235dab;};'use strict';var fs=require('fs');var path=require(_0x6582('0x0'));var BPromise=require('bluebird');var rs=require(_0x6582('0x1'));var AWS=require(_0x6582('0x2'));function pollyResult(_0x3c2064,_0x2b88d1,_0x1c8d56){return new BPromise(function(_0x39915a,_0x5b583c){_0x3c2064[_0x6582('0x3')](_0x2b88d1,function(_0xc02a50,_0x427a62){if(_0xc02a50){_0x5b583c(_0xc02a50);}else if(_0x427a62){if(_0x427a62[_0x6582('0x4')]instanceof Buffer){fs[_0x6582('0x5')](_0x1c8d56,_0x427a62[_0x6582('0x4')],function(_0x7f3b85){if(_0x7f3b85){_0x5b583c(_0x7f3b85);}else{_0x39915a();}});}else{_0x5b583c(new Error(_0x6582('0x6')));}}else{_0x5b583c(new Error(_0x6582('0x7')));}});});}module[_0x6582('0x8')]=function(_0x46d18f,_0xd729a,_0x4362da,_0x166e02,_0x342394,_0x4d46aa,_0x372e2b){var _0x106cfa=new AWS[(_0x6582('0x9'))]({'accessKeyId':_0x46d18f,'secretAccessKey':_0xd729a,'region':_0x4362da});var _0x1a61cd={'Text':_0x342394,'TextType':_0x4d46aa||'text','OutputFormat':_0x6582('0xa'),'VoiceId':_0x166e02};return pollyResult(_0x106cfa,_0x1a61cd,_0x372e2b);}; \ 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 20903b7..fc71960 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 _0x154e=['./lib/api'];(function(_0x17a245,_0x6cc8b7){var _0x30e0ce=function(_0x3f3226){while(--_0x3f3226){_0x17a245['push'](_0x17a245['shift']());}};_0x30e0ce(++_0x6cc8b7);}(_0x154e,0xec));var _0xe154=function(_0x530b56,_0x22c9d9){_0x530b56=_0x530b56-0x0;var _0x59c652=_0x154e[_0x530b56];return _0x59c652;};'use strict';var asr=require(_0xe154('0x0'));module['exports']=function(_0x4c5e14,_0x1eec45,_0x5030e2,_0x106764){return asr(_0x4c5e14,_0x1eec45,_0x5030e2);}; \ No newline at end of file +var _0x08a2=['exports','./lib/api'];(function(_0x36a2f2,_0x58f440){var _0xf454a1=function(_0x596d9b){while(--_0x596d9b){_0x36a2f2['push'](_0x36a2f2['shift']());}};_0xf454a1(++_0x58f440);}(_0x08a2,0x83));var _0x208a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x08a2[_0x20a584];return _0x4b41a8;};'use strict';var asr=require(_0x208a('0x0'));module[_0x208a('0x1')]=function(_0x3593db,_0x1cf012,_0x26ef96,_0x26f4b2){return asr(_0x3593db,_0x1cf012,_0x26ef96);}; \ 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 e1beba8..a69004f 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 _0xf518=['8000','url','bluebird','https://speech.googleapis.com','exports','length','string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','POST','LINEAR16'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xf518,0x127));var _0x8f51=function(_0x146837,_0x2aa6a2){_0x146837=_0x146837-0x0;var _0x3d7e60=_0xf518[_0x146837];return _0x3d7e60;};'use strict';var url=require(_0x8f51('0x0'));var BPromise=require(_0x8f51('0x1'));var fs=require('fs');var host=_0x8f51('0x2');module[_0x8f51('0x3')]=function(_0x3314e6,_0xe06733,_0x264d33){return new BPromise(function(_0x5cded3,_0x539555){var _0x5b8dbe;if(typeof _0x3314e6!=='string'||_0x3314e6[_0x8f51('0x4')]===0x0){return _0x539555('filepath\x20should\x20be\x20a\x20string');}if(typeof _0xe06733!==_0x8f51('0x5')||_0xe06733[_0x8f51('0x4')]===0x0){return _0x539555('key\x20should\x20be\x20a\x20string');}if(typeof _0x264d33!==_0x8f51('0x6')&&(typeof _0x264d33!==_0x8f51('0x5')||_0x264d33[_0x8f51('0x4')]===0x0)){return _0x539555(_0x8f51('0x7'));}try{_0x5b8dbe=fs[_0x8f51('0x8')](_0x3314e6)[_0x8f51('0x9')](_0x8f51('0xa'));}catch(_0x54412d){return _0x539555(_0x54412d);}return _0x5cded3({'method':_0x8f51('0xb'),'uri':host+'/v1/speech:recognize?key='+_0xe06733,'body':{'config':{'encoding':_0x8f51('0xc'),'sampleRateHertz':_0x8f51('0xd'),'languageCode':_0x264d33},'audio':{'content':_0x5b8dbe}},'json':!![]});});}; \ No newline at end of file +var _0x01fb=['https://speech.googleapis.com','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined','string','toString','base64','POST','/v1/speech:recognize?key=','8000','url'];(function(_0x448d48,_0x582940){var _0x372720=function(_0xa1eea6){while(--_0xa1eea6){_0x448d48['push'](_0x448d48['shift']());}};_0x372720(++_0x582940);}(_0x01fb,0xef));var _0xb01f=function(_0x3d327e,_0x14d317){_0x3d327e=_0x3d327e-0x0;var _0x3df7f5=_0x01fb[_0x3d327e];return _0x3df7f5;};'use strict';var url=require(_0xb01f('0x0'));var BPromise=require('bluebird');var fs=require('fs');var host=_0xb01f('0x1');module['exports']=function(_0x57a42a,_0x154625,_0x4736cc){return new BPromise(function(_0x5ef38b,_0x39cbf1){var _0x1cd138;if(typeof _0x57a42a!=='string'||_0x57a42a[_0xb01f('0x2')]===0x0){return _0x39cbf1(_0xb01f('0x3'));}if(typeof _0x154625!=='string'||_0x154625[_0xb01f('0x2')]===0x0){return _0x39cbf1(_0xb01f('0x4'));}if(typeof _0x4736cc!==_0xb01f('0x5')&&(typeof _0x4736cc!==_0xb01f('0x6')||_0x4736cc['length']===0x0)){return _0x39cbf1('lang\x20should\x20be\x20a\x20string');}try{_0x1cd138=fs['readFileSync'](_0x57a42a)[_0xb01f('0x7')](_0xb01f('0x8'));}catch(_0x5d7ca3){return _0x39cbf1(_0x5d7ca3);}return _0x5ef38b({'method':_0xb01f('0x9'),'uri':host+_0xb01f('0xa')+_0x154625,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':_0xb01f('0xb'),'languageCode':_0x4736cc},'audio':{'content':_0x1cd138}},'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 2dcbe1e..bacce4f 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 _0x288a=['exports'];(function(_0xa9dd88,_0x358002){var _0x33678d=function(_0x13b817){while(--_0x13b817){_0xa9dd88['push'](_0xa9dd88['shift']());}};_0x33678d(++_0x358002);}(_0x288a,0x188));var _0xa288=function(_0x1cba08,_0x21b768){_0x1cba08=_0x1cba08-0x0;var _0x2d6e52=_0x288a[_0x1cba08];return _0x2d6e52;};var asr=require('./asr');module[_0xa288('0x0')]={'asr':asr}; \ No newline at end of file +var _0xef7e=['./asr'];(function(_0x2e422e,_0x4bb72d){var _0x19fdc7=function(_0x59e9b6){while(--_0x59e9b6){_0x2e422e['push'](_0x2e422e['shift']());}};_0x19fdc7(++_0x4bb72d);}(_0xef7e,0x194));var _0xeef7=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xef7e[_0xa464c9];return _0x3d73c4;};var asr=require(_0xeef7('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 775b2b4..78cb00d 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 _0x85b6=['result','source','resolvedQuery','action','actionIncomplete','fulfillment','score','status','code','metadata','isFallbackIntent','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','sestekNDA','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','path','http','url','parse','bluebird','randomstring','sox','request-promise','util','querystring','google-tts-api','apiai-promise','./google','./aws','./tilde','./sestek','../../../config/logger','agi','protocol','https:','host','WHAT_EVER','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','close','download\x20error','pipe','end','data','transcode','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','base64','then','chmodSync','777','readFileSync','googleCloudTTS','?key=','ssml','input','voice','MP3','text:synthesize','POST','.mp3','from','audioContent','writeFile','unlink','split','goggleTTS\x20path','googleASR','asr','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','stringify'];(function(_0x3b9437,_0x31b422){var _0x2ed95d=function(_0x2b332e){while(--_0x2b332e){_0x3b9437['push'](_0x3b9437['shift']());}};_0x2ed95d(++_0x31b422);}(_0x85b6,0x91));var _0x685b=function(_0x5ec688,_0x115f65){_0x5ec688=_0x5ec688-0x0;var _0x557ef0=_0x85b6[_0x5ec688];return _0x557ef0;};'use strict';var fs=require('fs');var path=require(_0x685b('0x0'));var http=require(_0x685b('0x1'));var https=require('https');var urlParse=require(_0x685b('0x2'))[_0x685b('0x3')];var BPromise=require(_0x685b('0x4'));var rs=require(_0x685b('0x5'));var sox=require(_0x685b('0x6'));var rp=require(_0x685b('0x7'));var util=require(_0x685b('0x8'));var querystring=require(_0x685b('0x9'));var tts=require(_0x685b('0xa'));var apiai=require(_0x685b('0xb'));var md5=require('md5');var google=require(_0x685b('0xc'));var aws=require(_0x685b('0xd'));var tilde=require(_0x685b('0xe'));var sestek=require(_0x685b('0xf'));var logger=require(_0x685b('0x10'))(_0x685b('0x11'));var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0x353732,_0x171dc7){return new BPromise(function(_0x445497,_0x296bf1){var _0x2d5243=urlParse(_0x353732);var _0x213551=_0x2d5243[_0x685b('0x12')]===_0x685b('0x13')?https:http;var _0x56cd09={'host':_0x2d5243[_0x685b('0x14')],'path':_0x2d5243[_0x685b('0x0')],'headers':{'user-agent':_0x685b('0x15')}};_0x213551[_0x685b('0x16')](_0x56cd09,function(_0x296832){if(_0x296832[_0x685b('0x17')]!==0xc8){logger[_0x685b('0x18')](_0x685b('0x19')+_0x353732+_0x685b('0x1a')+_0x296832['statusCode']+'\x20('+_0x296832[_0x685b('0x1b')]+')');_0x296bf1(new Error(_0x685b('0x19')+_0x353732+_0x685b('0x1a')+_0x296832[_0x685b('0x17')]+'\x20('+_0x296832['statusMessage']+')'));return;}var _0x1ce9f8=fs[_0x685b('0x1c')](_0x171dc7);_0x1ce9f8['on'](_0x685b('0x1d'),function(){logger[_0x685b('0x1e')](_0x685b('0x1f'));_0x1ce9f8[_0x685b('0x20')](_0x445497);});_0x1ce9f8['on'](_0x685b('0x18'),function(_0x12b21f){fs['unlink'](_0x171dc7);logger[_0x685b('0x18')](_0x685b('0x21'),_0x12b21f);_0x296bf1(_0x12b21f);});_0x296832[_0x685b('0x22')](_0x1ce9f8);})['on']('error',function(_0xd1b6e7){logger[_0x685b('0x18')](_0xd1b6e7);_0x296bf1(_0xd1b6e7);})[_0x685b('0x23')]();});}function uploadFile(_0x2202b6){return new BPromise(function(_0x59a9ca,_0x54b9c9){var _0x4138f4=urlParse(_0x2202b6);var _0x38c87b=_0x4138f4[_0x685b('0x12')]===_0x685b('0x13')?https:http;var _0x3fe325={'host':_0x4138f4[_0x685b('0x14')],'path':_0x4138f4[_0x685b('0x0')],'headers':{'user-agent':'WHAT_EVER'}};_0x38c87b['get'](_0x3fe325,function(_0x569b1b){if(_0x569b1b[_0x685b('0x17')]!==0xc8){_0x54b9c9(new Error(_0x685b('0x19')+_0x2202b6+_0x685b('0x1a')+_0x569b1b[_0x685b('0x17')]+'\x20('+_0x569b1b[_0x685b('0x1b')]+')'));return;}var _0x2d5111='';_0x569b1b['on'](_0x685b('0x24'),function(_0x342bc5){_0x2d5111+=_0x342bc5;});_0x569b1b['on'](_0x685b('0x23'),function(){_0x59a9ca(_0x2d5111);});})['on'](_0x685b('0x18'),function(_0xedd1a2){_0x54b9c9(_0xedd1a2);})[_0x685b('0x23')]();});}function convertFile(_0x548ec4,_0x5dda9f){return new BPromise(function(_0xc659fc,_0x2d3ec5){var _0x34916e=sox[_0x685b('0x25')](_0x548ec4,_0x5dda9f,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x34916e['on'](_0x685b('0x18'),function(_0x55963e){logger[_0x685b('0x18')](_0x685b('0x26'),_0x55963e);_0x2d3ec5(_0x55963e);});_0x34916e['on']('end',function(){logger[_0x685b('0x1e')](_0x685b('0x27'));_0xc659fc();});_0x34916e[_0x685b('0x28')]();});}function base64Decode(_0x40dd25,_0x3cdb25){var _0x437991=path[_0x685b('0x29')](__dirname,_0x685b('0x2a'),rs[_0x685b('0x2b')](0x4)+_0x685b('0x2c'));fs['writeFileSync'](_0x437991,_0x40dd25,_0x685b('0x2d'));return convertFile(_0x437991,_0x3cdb25)[_0x685b('0x2e')](function(){try{fs['unlink'](_0x437991);fs[_0x685b('0x2f')](_0x3cdb25,_0x685b('0x30'));}catch(_0xa92829){logger['error'](_0xa92829);}return _0x3cdb25['split']('.')[0x0];});}function base64Encode(_0x95cf01){var _0x235687=fs[_0x685b('0x31')](_0x95cf01);return new Buffer(_0x235687)['toString']('base64');}exports[_0x685b('0x32')]=function(_0x5ed218,_0x2df873,_0x5b7f75,_0x5f02af,_0x419a1a,_0x3d3358){var _0x3e8f40,_0x189144;var _0x3b9249='https://texttospeech.googleapis.com/v1/';var _0x5b4e6d=_0x685b('0x33')+_0x5ed218;var _0x5f3fda={};if(_0x2df873===_0x685b('0x34')){_0x5f3fda['input']={'ssml':_0x5b7f75};}else{_0x5f3fda[_0x685b('0x35')]={'text':_0x5b7f75};};_0x5f3fda[_0x685b('0x36')]={'languageCode':_0x5f02af,'ssmlGender':_0x419a1a};_0x5f3fda['audioConfig']={'audioEncoding':_0x685b('0x37'),'sampleRateHertz':0x1f40};var _0x4b910e={'url':_0x3b9249+_0x685b('0x38')+_0x5b4e6d,'method':_0x685b('0x39'),'json':!![],'body':_0x5f3fda};return rp(_0x4b910e)[_0x685b('0x2e')](function(_0x4b4ff9){return new BPromise(function(_0x572e87,_0x28f2f8){_0x3e8f40=path[_0x685b('0x29')](__dirname,_0x685b('0x2a'),rs[_0x685b('0x2b')](0x4)+_0x685b('0x3a'));var _0x17a46d=Buffer[_0x685b('0x3b')](_0x4b4ff9[_0x685b('0x3c')],_0x685b('0x2d'));return fs[_0x685b('0x3d')](_0x3e8f40,_0x17a46d,function(_0x277dd9){_0x28f2f8(_0x277dd9);},function(_0x6c8861){fs[_0x685b('0x2f')](_0x3e8f40,'777');_0x572e87(_0x6c8861);});});})[_0x685b('0x2e')](function(_0x44799a){_0x189144=path[_0x685b('0x29')](__dirname,_0x685b('0x2a'),rs[_0x685b('0x2b')](0x4)+'.wav');return convertFile(_0x3e8f40,_0x189144);})['then'](function(){try{fs[_0x685b('0x3e')](_0x3e8f40);fs[_0x685b('0x2f')](_0x189144,_0x685b('0x30'));}catch(_0x497114){logger[_0x685b('0x18')](_0x497114);}logger['info']('googleCloudTTS\x20path',_0x189144[_0x685b('0x3f')]('.')[0x0]);return _0x189144[_0x685b('0x3f')]('.')[0x0];});};exports['googleTTS']=function(_0x4ce504,_0xf9d913){var _0x50f02a,_0x2f7f73;return tts(_0x4ce504,_0xf9d913||'en',0x1)['then'](function(_0x5bd4f3){logger[_0x685b('0x1e')](_0x5bd4f3);_0x50f02a=path[_0x685b('0x29')](__dirname,'tmp',rs[_0x685b('0x2b')](0x4)+'.mp3');return downloadFile(_0x5bd4f3,_0x50f02a);})[_0x685b('0x2e')](function(){_0x2f7f73=path['resolve'](__dirname,_0x685b('0x2a'),rs[_0x685b('0x2b')](0x4)+_0x685b('0x2c'));return convertFile(_0x50f02a,_0x2f7f73);})[_0x685b('0x2e')](function(){try{fs[_0x685b('0x3e')](_0x50f02a);fs['chmodSync'](_0x2f7f73,_0x685b('0x30'));}catch(_0xe27097){logger[_0x685b('0x18')](_0xe27097);}logger[_0x685b('0x1e')](_0x685b('0x40'),_0x2f7f73[_0x685b('0x3f')]('.')[0x0]);return _0x2f7f73[_0x685b('0x3f')]('.')[0x0];});};exports[_0x685b('0x41')]=function(_0x185245,_0x358f7a,_0x515d48){return google[_0x685b('0x42')](_0x185245,_0x358f7a,_0x515d48)[_0x685b('0x2e')](function(_0x20481b){logger[_0x685b('0x1e')](_0x20481b[_0x685b('0x43')]);return rp(_0x20481b);})[_0x685b('0x2e')](function(_0x2dba44){var _0xba2915='';var _0x34b8b6=0x0;try{fs['unlink'](_0x185245);}catch(_0x2b3187){logger[_0x685b('0x18')](_0x2b3187);}if(_0x2dba44&&_0x2dba44[_0x685b('0x44')]){_0xba2915=_0x2dba44[_0x685b('0x44')][_0x685b('0x45')](function(_0x20946f){return _0x20946f&&_0x20946f[_0x685b('0x46')][0x0]&&_0x20946f[_0x685b('0x46')][0x0]['transcript']?_0x20946f[_0x685b('0x46')][0x0][_0x685b('0x47')]:'';})[_0x685b('0x48')]('\x0a');_0x34b8b6=_0x2dba44['results']['map'](function(_0x406f69){return _0x406f69&&_0x406f69[_0x685b('0x46')][0x0]&&_0x406f69[_0x685b('0x46')][0x0][_0x685b('0x49')]?_0x406f69['alternatives'][0x0][_0x685b('0x49')]:0x0;})['join']('\x0a');}logger[_0x685b('0x1e')](_0x685b('0x4a'),_0xba2915);logger['info'](_0x685b('0x4b'),_0x34b8b6);return{'transcript':_0xba2915,'confidence':_0x34b8b6};})[_0x685b('0x4c')](function(_0x3f0407){logger[_0x685b('0x18')](_0x685b('0x4d'),_0x3f0407[_0x685b('0x17')],_0x3f0407[_0x685b('0x4e')],_0x3f0407[_0x685b('0x4f')]);});};exports[_0x685b('0x50')]=function(_0x103934,_0x2ca085,_0x5a340e,_0x3f3ffe){var _0xf0a58e=apiai(_0x2ca085,{'language':_0x3f3ffe||'en'});return _0xf0a58e[_0x685b('0x51')](_0x5a340e,{'sessionId':md5(_0x103934)})[_0x685b('0x2e')](function(_0x487ba3){logger[_0x685b('0x1e')](JSON[_0x685b('0x52')](_0x487ba3));return{'source':_0x487ba3[_0x685b('0x53')][_0x685b('0x54')],'resolvedQuery':_0x487ba3[_0x685b('0x53')][_0x685b('0x55')],'action':_0x487ba3[_0x685b('0x53')][_0x685b('0x56')],'actionIncomplete':_0x487ba3[_0x685b('0x53')][_0x685b('0x57')],'speech':_0x487ba3[_0x685b('0x53')][_0x685b('0x58')]['speech'],'score':_0x487ba3['result'][_0x685b('0x59')],'statusCode':_0x487ba3[_0x685b('0x5a')][_0x685b('0x5b')],'endConversation':_0x487ba3[_0x685b('0x53')][_0x685b('0x5c')]['endConversation']||![],'isFallbackIntent':_0x487ba3['result'][_0x685b('0x5c')][_0x685b('0x5d')]};});};exports['tildeASR']=function(_0x2c0dc9,_0x1d1d13,_0x42a202,_0x4d8cd3){return tilde[_0x685b('0x42')](_0x2c0dc9,_0x1d1d13,_0x42a202,_0x4d8cd3)['then'](function(_0x3a6da3){try{fs[_0x685b('0x3e')](_0x2c0dc9);}catch(_0x22d79c){logger[_0x685b('0x18')](_0x22d79c);}logger['info']('Tilde\x20ASR\x20transcription',_0x3a6da3['transcript']);logger[_0x685b('0x1e')](_0x685b('0x5e'),_0x3a6da3[_0x685b('0x49')]);return _0x3a6da3;});};exports[_0x685b('0x5f')]=function(_0x588e87,_0x4eedd0,_0x1eae90,_0x134953,_0x39de13,_0x4e5293){var _0x5d96de=path[_0x685b('0x29')](__dirname,_0x685b('0x2a'),rs[_0x685b('0x2b')](0x4)+_0x685b('0x3a'));var _0x6d26e0;return aws[_0x685b('0x60')](_0x588e87,_0x4eedd0,_0x1eae90,_0x134953,_0x39de13,_0x4e5293,_0x5d96de)[_0x685b('0x2e')](function(){_0x6d26e0=path['resolve'](__dirname,_0x685b('0x2a'),rs[_0x685b('0x2b')](0x4)+_0x685b('0x2c'));return convertFile(_0x5d96de,_0x6d26e0);})['then'](function(){try{fs[_0x685b('0x3e')](_0x5d96de);fs['chmodSync'](_0x6d26e0,'777');}catch(_0x26c1d1){logger[_0x685b('0x18')](_0x26c1d1);}return _0x6d26e0[_0x685b('0x3f')]('.')[0x0];});};exports[_0x685b('0x61')]=function(_0x480bf4,_0x14435a,_0x500cae,_0x23465b,_0xe9bc31,_0x5ad534){return aws[_0x685b('0x62')](_0x480bf4,_0x14435a,_0x500cae,_0x23465b,_0xe9bc31,_0x5ad534)[_0x685b('0x2e')](function(_0x37977c){logger[_0x685b('0x1e')](JSON[_0x685b('0x52')](_0x37977c));return _0x37977c;});};exports[_0x685b('0x63')]=function(_0x41aaee,_0x423868,_0xf224a9,_0x68bf76){var _0x34fc68=util[_0x685b('0x64')](_0x685b('0x65'),ISPEECH_API,_0x41aaee,encodeURIComponent(_0x423868),_0xf224a9,_0x68bf76);var _0x28c2ad=path['resolve'](__dirname,_0x685b('0x2a'),rs['generate'](0x4)+'.mp3');var _0x1ff53a;return downloadFile(_0x34fc68,_0x28c2ad)['then'](function(){_0x1ff53a=path[_0x685b('0x29')](__dirname,_0x685b('0x2a'),rs['generate'](0x4)+_0x685b('0x2c'));return convertFile(_0x28c2ad,_0x1ff53a);})[_0x685b('0x2e')](function(){try{fs['unlink'](_0x28c2ad);fs[_0x685b('0x2f')](_0x1ff53a,_0x685b('0x30'));}catch(_0x5e7a4a){logger[_0x685b('0x18')](_0x5e7a4a);}return _0x1ff53a[_0x685b('0x3f')]('.')[0x0];});};exports[_0x685b('0x66')]=function(_0x3905ff,_0x1fe9e2,_0x5a6aea,_0x55d4c5){var _0x47d96e=util[_0x685b('0x64')](_0x685b('0x67'),ISPEECH_API,_0x1fe9e2,_0x5a6aea,base64Encode(_0x3905ff),_0x55d4c5?util[_0x685b('0x64')]('model=%s',encodeURIComponent(_0x55d4c5)):'freeform=3');return uploadFile(_0x47d96e)[_0x685b('0x2e')](function(_0x266d37){return querystring[_0x685b('0x3')](_0x266d37);});};exports[_0x685b('0x68')]=function(_0x55b218,_0x37c4f8){return sestek[_0x685b('0x69')](_0x55b218,_0x37c4f8)[_0x685b('0x2e')](function(_0x5961b6){logger[_0x685b('0x1e')](JSON[_0x685b('0x52')](_0x5961b6));var _0x6a5277={'speech':_0x5961b6[_0x685b('0x6a')],'action':_0x5961b6['channelData']?_0x5961b6[_0x685b('0x6b')][_0x685b('0x6c')]:undefined,'actiondata':_0x5961b6[_0x685b('0x6b')]?_0x5961b6[_0x685b('0x6b')][_0x685b('0x6d')]:undefined};if(_0x5961b6[_0x685b('0x6b')]&&_0x5961b6[_0x685b('0x6b')]['AudioFromTts']){return base64Decode(_0x5961b6[_0x685b('0x6b')][_0x685b('0x6e')][_0x685b('0x6f')],path[_0x685b('0x29')](__dirname,_0x685b('0x2a'),rs[_0x685b('0x2b')](0x4)+_0x685b('0x2c')))[_0x685b('0x2e')](function(_0x416533){_0x6a5277[_0x685b('0x70')]=_0x416533;return _0x6a5277;});}return _0x6a5277;});};exports[_0x685b('0x71')]=function(){return __dirname;}; \ No newline at end of file +var _0xce0a=['input','voice','then','.mp3','from','audioContent','tmp','googleCloudTTS\x20path','googleTTS','goggleTTS\x20path','asr','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','catch','[%s]\x20%s:%s','name','message','textRequest','stringify','result','source','fulfillment','speech','score','status','code','metadata','endConversation','isFallbackIntent','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','freeform=3','sestekNDA','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','http','https','url','parse','randomstring','util','querystring','google-tts-api','apiai-promise','md5','./google','./tilde','../../../config/logger','https://api.ispeech.org/api/rest','host','WHAT_EVER','get','statusCode','\x20failed,\x20status\x20code\x20=\x20','statusMessage','request\x20to\x20','info','close','error','unlink','download\x20error','pipe','protocol','https:','path','end','wav','finish\x20to\x20convert','start','resolve','generate','.wav','writeFileSync','base64','chmodSync','777','split','readFileSync','googleCloudTTS','ssml'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xce0a,0xf6));var _0xace0=function(_0xf84870,_0x4dc38f){_0xf84870=_0xf84870-0x0;var _0x4541a4=_0xce0a[_0xf84870];return _0x4541a4;};'use strict';var fs=require('fs');var path=require('path');var http=require(_0xace0('0x0'));var https=require(_0xace0('0x1'));var urlParse=require(_0xace0('0x2'))[_0xace0('0x3')];var BPromise=require('bluebird');var rs=require(_0xace0('0x4'));var sox=require('sox');var rp=require('request-promise');var util=require(_0xace0('0x5'));var querystring=require(_0xace0('0x6'));var tts=require(_0xace0('0x7'));var apiai=require(_0xace0('0x8'));var md5=require(_0xace0('0x9'));var google=require(_0xace0('0xa'));var aws=require('./aws');var tilde=require(_0xace0('0xb'));var sestek=require('./sestek');var logger=require(_0xace0('0xc'))('agi');var ISPEECH_API=_0xace0('0xd');function downloadFile(_0x493967,_0x261ca6){return new BPromise(function(_0x433a30,_0x685adb){var _0xfb4d56=urlParse(_0x493967);var _0x2b6051=_0xfb4d56['protocol']==='https:'?https:http;var _0xb8b816={'host':_0xfb4d56[_0xace0('0xe')],'path':_0xfb4d56['path'],'headers':{'user-agent':_0xace0('0xf')}};_0x2b6051[_0xace0('0x10')](_0xb8b816,function(_0xd2c260){if(_0xd2c260[_0xace0('0x11')]!==0xc8){logger['error']('request\x20to\x20'+_0x493967+_0xace0('0x12')+_0xd2c260[_0xace0('0x11')]+'\x20('+_0xd2c260[_0xace0('0x13')]+')');_0x685adb(new Error(_0xace0('0x14')+_0x493967+'\x20failed,\x20status\x20code\x20=\x20'+_0xd2c260[_0xace0('0x11')]+'\x20('+_0xd2c260['statusMessage']+')'));return;}var _0xa35ede=fs['createWriteStream'](_0x261ca6);_0xa35ede['on']('finish',function(){logger[_0xace0('0x15')]('finish\x20download\x20file');_0xa35ede[_0xace0('0x16')](_0x433a30);});_0xa35ede['on'](_0xace0('0x17'),function(_0x2cdc64){fs[_0xace0('0x18')](_0x261ca6);logger[_0xace0('0x17')](_0xace0('0x19'),_0x2cdc64);_0x685adb(_0x2cdc64);});_0xd2c260[_0xace0('0x1a')](_0xa35ede);})['on'](_0xace0('0x17'),function(_0x20d939){logger[_0xace0('0x17')](_0x20d939);_0x685adb(_0x20d939);})['end']();});}function uploadFile(_0x483960){return new BPromise(function(_0x2d57f4,_0x5f5266){var _0x1cc747=urlParse(_0x483960);var _0x22f76f=_0x1cc747[_0xace0('0x1b')]===_0xace0('0x1c')?https:http;var _0x318303={'host':_0x1cc747[_0xace0('0xe')],'path':_0x1cc747[_0xace0('0x1d')],'headers':{'user-agent':'WHAT_EVER'}};_0x22f76f[_0xace0('0x10')](_0x318303,function(_0x29e467){if(_0x29e467[_0xace0('0x11')]!==0xc8){_0x5f5266(new Error('request\x20to\x20'+_0x483960+_0xace0('0x12')+_0x29e467['statusCode']+'\x20('+_0x29e467[_0xace0('0x13')]+')'));return;}var _0x5e0df6='';_0x29e467['on']('data',function(_0x282783){_0x5e0df6+=_0x282783;});_0x29e467['on'](_0xace0('0x1e'),function(){_0x2d57f4(_0x5e0df6);});})['on']('error',function(_0x187fad){_0x5f5266(_0x187fad);})['end']();});}function convertFile(_0x702f79,_0x54190b){return new BPromise(function(_0x1769a3,_0x345c7b){var _0x47f954=sox['transcode'](_0x702f79,_0x54190b,{'sampleRate':0x1f40,'format':_0xace0('0x1f'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x47f954['on'](_0xace0('0x17'),function(_0x1a828e){logger[_0xace0('0x17')]('error\x20convert',_0x1a828e);_0x345c7b(_0x1a828e);});_0x47f954['on']('end',function(){logger[_0xace0('0x15')](_0xace0('0x20'));_0x1769a3();});_0x47f954[_0xace0('0x21')]();});}function base64Decode(_0x3053e1,_0x1df92a){var _0x11adb5=path[_0xace0('0x22')](__dirname,'tmp',rs[_0xace0('0x23')](0x4)+_0xace0('0x24'));fs[_0xace0('0x25')](_0x11adb5,_0x3053e1,_0xace0('0x26'));return convertFile(_0x11adb5,_0x1df92a)['then'](function(){try{fs[_0xace0('0x18')](_0x11adb5);fs[_0xace0('0x27')](_0x1df92a,_0xace0('0x28'));}catch(_0x52087f){logger[_0xace0('0x17')](_0x52087f);}return _0x1df92a[_0xace0('0x29')]('.')[0x0];});}function base64Encode(_0x168112){var _0x46edb0=fs[_0xace0('0x2a')](_0x168112);return new Buffer(_0x46edb0)['toString'](_0xace0('0x26'));}exports[_0xace0('0x2b')]=function(_0x1109a4,_0x5e9e41,_0x551272,_0x56cab4,_0x135195,_0x49bfee){var _0x17cab4,_0x5f4c19;var _0x2fde28='https://texttospeech.googleapis.com/v1/';var _0x10aac4='?key='+_0x1109a4;var _0x4b66bd={};if(_0x5e9e41===_0xace0('0x2c')){_0x4b66bd[_0xace0('0x2d')]={'ssml':_0x551272};}else{_0x4b66bd[_0xace0('0x2d')]={'text':_0x551272};};_0x4b66bd[_0xace0('0x2e')]={'languageCode':_0x56cab4,'ssmlGender':_0x135195};_0x4b66bd['audioConfig']={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x40baeb={'url':_0x2fde28+'text:synthesize'+_0x10aac4,'method':'POST','json':!![],'body':_0x4b66bd};return rp(_0x40baeb)[_0xace0('0x2f')](function(_0x163817){return new BPromise(function(_0x2c3b9a,_0x1bb498){_0x17cab4=path['resolve'](__dirname,'tmp',rs['generate'](0x4)+_0xace0('0x30'));var _0x13b2f1=Buffer[_0xace0('0x31')](_0x163817[_0xace0('0x32')],_0xace0('0x26'));return fs['writeFile'](_0x17cab4,_0x13b2f1,function(_0x2f729c){_0x1bb498(_0x2f729c);},function(_0x18f86b){fs[_0xace0('0x27')](_0x17cab4,_0xace0('0x28'));_0x2c3b9a(_0x18f86b);});});})[_0xace0('0x2f')](function(_0x439b8c){_0x5f4c19=path[_0xace0('0x22')](__dirname,_0xace0('0x33'),rs[_0xace0('0x23')](0x4)+_0xace0('0x24'));return convertFile(_0x17cab4,_0x5f4c19);})[_0xace0('0x2f')](function(){try{fs[_0xace0('0x18')](_0x17cab4);fs[_0xace0('0x27')](_0x5f4c19,_0xace0('0x28'));}catch(_0x2a7f9f){logger[_0xace0('0x17')](_0x2a7f9f);}logger[_0xace0('0x15')](_0xace0('0x34'),_0x5f4c19[_0xace0('0x29')]('.')[0x0]);return _0x5f4c19[_0xace0('0x29')]('.')[0x0];});};exports[_0xace0('0x35')]=function(_0x46a103,_0x16cddb){var _0x3883a5,_0x35dec1;return tts(_0x46a103,_0x16cddb||'en',0x1)[_0xace0('0x2f')](function(_0x487f4a){logger[_0xace0('0x15')](_0x487f4a);_0x3883a5=path['resolve'](__dirname,_0xace0('0x33'),rs[_0xace0('0x23')](0x4)+'.mp3');return downloadFile(_0x487f4a,_0x3883a5);})[_0xace0('0x2f')](function(){_0x35dec1=path[_0xace0('0x22')](__dirname,'tmp',rs['generate'](0x4)+'.wav');return convertFile(_0x3883a5,_0x35dec1);})[_0xace0('0x2f')](function(){try{fs[_0xace0('0x18')](_0x3883a5);fs[_0xace0('0x27')](_0x35dec1,_0xace0('0x28'));}catch(_0x4197bb){logger['error'](_0x4197bb);}logger[_0xace0('0x15')](_0xace0('0x36'),_0x35dec1[_0xace0('0x29')]('.')[0x0]);return _0x35dec1[_0xace0('0x29')]('.')[0x0];});};exports['googleASR']=function(_0xdffbdc,_0x23e909,_0xa2ffdd){return google[_0xace0('0x37')](_0xdffbdc,_0x23e909,_0xa2ffdd)['then'](function(_0xfeb684){logger[_0xace0('0x15')](_0xfeb684[_0xace0('0x38')]);return rp(_0xfeb684);})[_0xace0('0x2f')](function(_0x59367d){var _0x64b114='';var _0x3763c7=0x0;try{fs[_0xace0('0x18')](_0xdffbdc);}catch(_0x377049){logger[_0xace0('0x17')](_0x377049);}if(_0x59367d&&_0x59367d[_0xace0('0x39')]){_0x64b114=_0x59367d[_0xace0('0x39')][_0xace0('0x3a')](function(_0x5a50ab){return _0x5a50ab&&_0x5a50ab[_0xace0('0x3b')][0x0]&&_0x5a50ab[_0xace0('0x3b')][0x0][_0xace0('0x3c')]?_0x5a50ab['alternatives'][0x0]['transcript']:'';})[_0xace0('0x3d')]('\x0a');_0x3763c7=_0x59367d[_0xace0('0x39')][_0xace0('0x3a')](function(_0x102bc1){return _0x102bc1&&_0x102bc1[_0xace0('0x3b')][0x0]&&_0x102bc1[_0xace0('0x3b')][0x0][_0xace0('0x3e')]?_0x102bc1[_0xace0('0x3b')][0x0]['confidence']:0x0;})[_0xace0('0x3d')]('\x0a');}logger['info'](_0xace0('0x3f'),_0x64b114);logger[_0xace0('0x15')]('googleASR\x20confidence',_0x3763c7);return{'transcript':_0x64b114,'confidence':_0x3763c7};})[_0xace0('0x40')](function(_0x250067){logger[_0xace0('0x17')](_0xace0('0x41'),_0x250067[_0xace0('0x11')],_0x250067[_0xace0('0x42')],_0x250067[_0xace0('0x43')]);});};exports['googleDialogflow']=function(_0x53c6bd,_0x4e99cc,_0x34663e,_0x4abcba){var _0x318719=apiai(_0x4e99cc,{'language':_0x4abcba||'en'});return _0x318719[_0xace0('0x44')](_0x34663e,{'sessionId':md5(_0x53c6bd)})[_0xace0('0x2f')](function(_0xa76b6e){logger[_0xace0('0x15')](JSON[_0xace0('0x45')](_0xa76b6e));return{'source':_0xa76b6e[_0xace0('0x46')][_0xace0('0x47')],'resolvedQuery':_0xa76b6e[_0xace0('0x46')]['resolvedQuery'],'action':_0xa76b6e[_0xace0('0x46')]['action'],'actionIncomplete':_0xa76b6e[_0xace0('0x46')]['actionIncomplete'],'speech':_0xa76b6e[_0xace0('0x46')][_0xace0('0x48')][_0xace0('0x49')],'score':_0xa76b6e[_0xace0('0x46')][_0xace0('0x4a')],'statusCode':_0xa76b6e[_0xace0('0x4b')][_0xace0('0x4c')],'endConversation':_0xa76b6e[_0xace0('0x46')][_0xace0('0x4d')][_0xace0('0x4e')]||![],'isFallbackIntent':_0xa76b6e[_0xace0('0x46')][_0xace0('0x4d')][_0xace0('0x4f')]};});};exports['tildeASR']=function(_0x411d41,_0x5ea6a7,_0x1cdd07,_0x26e27b){return tilde[_0xace0('0x37')](_0x411d41,_0x5ea6a7,_0x1cdd07,_0x26e27b)[_0xace0('0x2f')](function(_0x187a09){try{fs[_0xace0('0x18')](_0x411d41);}catch(_0x595aed){logger[_0xace0('0x17')](_0x595aed);}logger[_0xace0('0x15')](_0xace0('0x50'),_0x187a09['transcript']);logger[_0xace0('0x15')](_0xace0('0x51'),_0x187a09[_0xace0('0x3e')]);return _0x187a09;});};exports['awsPolly']=function(_0x253e8a,_0x550930,_0xebd4e0,_0x20d119,_0x58fc4b,_0x42def3){var _0x178072=path[_0xace0('0x22')](__dirname,'tmp',rs[_0xace0('0x23')](0x4)+_0xace0('0x30'));var _0x543c7f;return aws['polly'](_0x253e8a,_0x550930,_0xebd4e0,_0x20d119,_0x58fc4b,_0x42def3,_0x178072)['then'](function(){_0x543c7f=path[_0xace0('0x22')](__dirname,'tmp',rs[_0xace0('0x23')](0x4)+'.wav');return convertFile(_0x178072,_0x543c7f);})[_0xace0('0x2f')](function(){try{fs[_0xace0('0x18')](_0x178072);fs['chmodSync'](_0x543c7f,'777');}catch(_0x5d100e){logger[_0xace0('0x17')](_0x5d100e);}return _0x543c7f[_0xace0('0x29')]('.')[0x0];});};exports[_0xace0('0x52')]=function(_0x2fe0fc,_0x50d93f,_0x4dea94,_0x2c34a,_0x1448df,_0x2c2a2d){return aws[_0xace0('0x53')](_0x2fe0fc,_0x50d93f,_0x4dea94,_0x2c34a,_0x1448df,_0x2c2a2d)[_0xace0('0x2f')](function(_0x51af5d){logger[_0xace0('0x15')](JSON[_0xace0('0x45')](_0x51af5d));return _0x51af5d;});};exports[_0xace0('0x54')]=function(_0x3c273d,_0x3a5f2b,_0x1922b7,_0x355f76){var _0x4113d5=util[_0xace0('0x55')](_0xace0('0x56'),ISPEECH_API,_0x3c273d,encodeURIComponent(_0x3a5f2b),_0x1922b7,_0x355f76);var _0x1955b9=path[_0xace0('0x22')](__dirname,_0xace0('0x33'),rs[_0xace0('0x23')](0x4)+_0xace0('0x30'));var _0x3f9ff3;return downloadFile(_0x4113d5,_0x1955b9)[_0xace0('0x2f')](function(){_0x3f9ff3=path[_0xace0('0x22')](__dirname,_0xace0('0x33'),rs[_0xace0('0x23')](0x4)+_0xace0('0x24'));return convertFile(_0x1955b9,_0x3f9ff3);})[_0xace0('0x2f')](function(){try{fs['unlink'](_0x1955b9);fs[_0xace0('0x27')](_0x3f9ff3,_0xace0('0x28'));}catch(_0x590d64){logger[_0xace0('0x17')](_0x590d64);}return _0x3f9ff3[_0xace0('0x29')]('.')[0x0];});};exports['ispeechASR']=function(_0x103b3a,_0x456cef,_0x34a286,_0x4ea8a0){var _0xf0a6ec=util[_0xace0('0x55')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x456cef,_0x34a286,base64Encode(_0x103b3a),_0x4ea8a0?util['format']('model=%s',encodeURIComponent(_0x4ea8a0)):_0xace0('0x57'));return uploadFile(_0xf0a6ec)[_0xace0('0x2f')](function(_0x195c0e){return querystring[_0xace0('0x3')](_0x195c0e);});};exports[_0xace0('0x58')]=function(_0x586d42,_0xde5a76){return sestek['nda'](_0x586d42,_0xde5a76)[_0xace0('0x2f')](function(_0x501b7b){logger[_0xace0('0x15')](JSON[_0xace0('0x45')](_0x501b7b));var _0x5167f1={'speech':_0x501b7b[_0xace0('0x59')],'action':_0x501b7b['channelData']?_0x501b7b[_0xace0('0x5a')][_0xace0('0x5b')]:undefined,'actiondata':_0x501b7b['channelData']?_0x501b7b[_0xace0('0x5a')][_0xace0('0x5c')]:undefined};if(_0x501b7b['channelData']&&_0x501b7b[_0xace0('0x5a')][_0xace0('0x5d')]){return base64Decode(_0x501b7b[_0xace0('0x5a')][_0xace0('0x5d')][_0xace0('0x5e')],path[_0xace0('0x22')](__dirname,'tmp',rs['generate'](0x4)+_0xace0('0x24')))[_0xace0('0x2f')](function(_0x1b5332){_0x5167f1[_0xace0('0x5f')]=_0x1b5332;return _0x5167f1;});}return _0x5167f1;});};exports[_0xace0('0x60')]=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 b371639..100fb14 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 _0xaf9a=['exports','./nda'];(function(_0x56d04c,_0x3762c4){var _0x278a10=function(_0x420def){while(--_0x420def){_0x56d04c['push'](_0x56d04c['shift']());}};_0x278a10(++_0x3762c4);}(_0xaf9a,0x1bd));var _0xaaf9=function(_0x4ca7bc,_0x279008){_0x4ca7bc=_0x4ca7bc-0x0;var _0x55cf12=_0xaf9a[_0x4ca7bc];return _0x55cf12;};var nda=require(_0xaaf9('0x0'));module[_0xaaf9('0x1')]={'nda':nda}; \ No newline at end of file +var _0x9657=['./nda'];(function(_0xcbbd3f,_0xa768a1){var _0x486eb3=function(_0x17074d){while(--_0x17074d){_0xcbbd3f['push'](_0xcbbd3f['shift']());}};_0x486eb3(++_0xa768a1);}(_0x9657,0x193));var _0x7965=function(_0x39cbfb,_0x184941){_0x39cbfb=_0x39cbfb-0x0;var _0x44b43a=_0x9657[_0x39cbfb];return _0x44b43a;};var nda=require(_0x7965('0x0'));module['exports']={'nda':nda}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js index a0abff7..450d91a 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 _0xfa98=['resolve','ndauth_url','/token','username','password','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','callerid','calleridname','dnid','text','Bearer\x20','project','body','channelData','ProjectName','ndagenerate_audio','audio/wav','custom_action','custom_action_data','CustomActionData','info','stringify','request-promise','url','exports'];(function(_0x25e934,_0x4757dd){var _0x162c25=function(_0x5c8c4e){while(--_0x5c8c4e){_0x25e934['push'](_0x25e934['shift']());}};_0x162c25(++_0x4757dd);}(_0xfa98,0x193));var _0x8fa9=function(_0x11e92e,_0x2125b4){_0x11e92e=_0x11e92e-0x0;var _0x4b235d=_0xfa98[_0x11e92e];return _0x4b235d;};'use strict';var rp=require(_0x8fa9('0x0'));var url=require(_0x8fa9('0x1'));var logger=require('../../../../../config/logger')('agi');module[_0x8fa9('0x2')]=function(_0x3682a5,_0x191994){var _0x4c181a={'method':'POST','uri':url[_0x8fa9('0x3')](_0x191994[_0x8fa9('0x4')],_0x8fa9('0x5')),'form':{'grant_type':'password','username':_0x191994[_0x8fa9('0x6')],'password':_0x191994[_0x8fa9('0x7')]},'json':!![]};return rp(_0x4c181a)['then'](function(_0x537d9b){var _0x35e721={'method':'POST','uri':url[_0x8fa9('0x3')](_0x191994['ndassistant_url'],_0x8fa9('0x8')),'body':{'type':_0x191994[_0x8fa9('0x9')]||_0x8fa9('0xa'),'channelId':_0x8fa9('0xb'),'conversation':{'id':_0x3682a5[_0x8fa9('0xc')]},'from':{'id':_0x3682a5[_0x8fa9('0xd')],'name':_0x3682a5[_0x8fa9('0xe')]},'recipient':{'id':_0x3682a5[_0x8fa9('0xf')],'name':_0x3682a5['extension']},'text':_0x191994[_0x8fa9('0x10')],'channelData':{}},'headers':{'Authorization':_0x8fa9('0x11')+_0x537d9b['access_token']},'json':!![]};if(_0x191994[_0x8fa9('0x12')]){_0x35e721[_0x8fa9('0x13')][_0x8fa9('0x14')][_0x8fa9('0x15')]=_0x191994[_0x8fa9('0x12')];}if(_0x191994[_0x8fa9('0x16')]=='1'){_0x35e721[_0x8fa9('0x13')][_0x8fa9('0x14')]['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x8fa9('0x17')};}if(_0x191994[_0x8fa9('0x18')]){_0x35e721[_0x8fa9('0x13')][_0x8fa9('0x14')]['CustomAction']=_0x191994['custom_action'];if(_0x191994[_0x8fa9('0x19')]){_0x35e721[_0x8fa9('0x13')][_0x8fa9('0x14')][_0x8fa9('0x1a')]=_0x191994[_0x8fa9('0x19')];}}logger[_0x8fa9('0x1b')](JSON[_0x8fa9('0x1c')](_0x35e721));return rp(_0x35e721);});}; \ No newline at end of file +var _0x3e5d=['CustomAction','custom_action_data','info','../../../../../config/logger','POST','resolve','ndauth_url','/token','password','ndassistant_url','ndaactivity_type','message','Nda','callerid','calleridname','extension','text','Bearer\x20','project','channelData','body','AudioOutputSettings','custom_action'];(function(_0x4b0df5,_0x5cfeb5){var _0x144800=function(_0x3ece1e){while(--_0x3ece1e){_0x4b0df5['push'](_0x4b0df5['shift']());}};_0x144800(++_0x5cfeb5);}(_0x3e5d,0x1b8));var _0xd3e5=function(_0x5c68b9,_0x2a99f0){_0x5c68b9=_0x5c68b9-0x0;var _0x4c7263=_0x3e5d[_0x5c68b9];return _0x4c7263;};'use strict';var rp=require('request-promise');var url=require('url');var logger=require(_0xd3e5('0x0'))('agi');module['exports']=function(_0x2034a2,_0x30e4ca){var _0xef735c={'method':_0xd3e5('0x1'),'uri':url[_0xd3e5('0x2')](_0x30e4ca[_0xd3e5('0x3')],_0xd3e5('0x4')),'form':{'grant_type':_0xd3e5('0x5'),'username':_0x30e4ca['username'],'password':_0x30e4ca[_0xd3e5('0x5')]},'json':!![]};return rp(_0xef735c)['then'](function(_0x2f1db7){var _0xf2d629={'method':_0xd3e5('0x1'),'uri':url['resolve'](_0x30e4ca[_0xd3e5('0x6')],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x30e4ca[_0xd3e5('0x7')]||_0xd3e5('0x8'),'channelId':_0xd3e5('0x9'),'conversation':{'id':_0x2034a2['uniqueid']},'from':{'id':_0x2034a2[_0xd3e5('0xa')],'name':_0x2034a2[_0xd3e5('0xb')]},'recipient':{'id':_0x2034a2['dnid'],'name':_0x2034a2[_0xd3e5('0xc')]},'text':_0x30e4ca[_0xd3e5('0xd')],'channelData':{}},'headers':{'Authorization':_0xd3e5('0xe')+_0x2f1db7['access_token']},'json':!![]};if(_0x30e4ca[_0xd3e5('0xf')]){_0xf2d629['body'][_0xd3e5('0x10')]['ProjectName']=_0x30e4ca['project'];}if(_0x30e4ca['ndagenerate_audio']=='1'){_0xf2d629[_0xd3e5('0x11')]['channelData'][_0xd3e5('0x12')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x30e4ca[_0xd3e5('0x13')]){_0xf2d629['body'][_0xd3e5('0x10')][_0xd3e5('0x14')]=_0x30e4ca['custom_action'];if(_0x30e4ca[_0xd3e5('0x15')]){_0xf2d629[_0xd3e5('0x11')]['channelData']['CustomActionData']=_0x30e4ca[_0xd3e5('0x15')];}}logger[_0xd3e5('0x16')](JSON['stringify'](_0xf2d629));return rp(_0xf2d629);});}; \ 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 3b2d731..d1d727f 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 _0x4e06=['exports','./lib/api'];(function(_0x29f557,_0xec2fdf){var _0x95cf83=function(_0x3eb587){while(--_0x3eb587){_0x29f557['push'](_0x29f557['shift']());}};_0x95cf83(++_0xec2fdf);}(_0x4e06,0xad));var _0x64e0=function(_0x50d1c6,_0x40051c){_0x50d1c6=_0x50d1c6-0x0;var _0x3cd375=_0x4e06[_0x50d1c6];return _0x3cd375;};'use strict';var asr=require(_0x64e0('0x0'));module[_0x64e0('0x1')]=function(_0x4d0909,_0x32cb55,_0x157548,_0x96efa6){return asr(_0x4d0909,_0x32cb55,_0x157548,_0x96efa6);}; \ No newline at end of file +var _0xd4aa=['exports','./lib/api'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xd4aa,0x99));var _0xad4a=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xd4aa[_0x465a0c];return _0x1e202e;};'use strict';var asr=require(_0xad4a('0x0'));module[_0xad4a('0x1')]=function(_0x448819,_0x34f11a,_0x4cc4b6,_0x24243a){return asr(_0x448819,_0x34f11a,_0x4cc4b6,_0x24243a);}; \ 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 2a03d1c..d243741 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 _0xdb87=['close','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','final','info','Tilde\x20ASR\x20hypoteses','transcript','hypotheses','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','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','bluebird','lodash','moment','../../../../../../config/logger','exports','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','digest','Open\x20Tilde\x20ASR\x20socket','stringify','send'];(function(_0x206487,_0x28eec1){var _0x2714c7=function(_0x298179){while(--_0x298179){_0x206487['push'](_0x206487['shift']());}};_0x2714c7(++_0x28eec1);}(_0xdb87,0x1af));var _0x7db8=function(_0x6dcbd0,_0x344a04){_0x6dcbd0=_0x6dcbd0-0x0;var _0x4c2c2a=_0xdb87[_0x6dcbd0];return _0x4c2c2a;};'use strict';var BPromise=require(_0x7db8('0x0'));var _=require(_0x7db8('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x7db8('0x2'));var crypto=require('crypto');var logger=require(_0x7db8('0x3'))('agi');module[_0x7db8('0x4')]=function(_0x1e0b53,_0x26fb20,_0x25e783,_0x2b877b){return new BPromise(function(_0x596239,_0x1f242b){logger['info']('Tilde\x20URI',_0x2b877b||_0x7db8('0x5'));var _0x33870d=new WebSocket(_0x2b877b||_0x7db8('0x5'),{'perMessageDeflate':![]});var _0x3dea4c='';var _0xe01055='0';var _0x2f6558='1';var _0x21c582=_0x7db8('0x6');function _0xd2dd62(_0xa3a3df){var _0x4c8838=crypto[_0x7db8('0x7')](_0x7db8('0x8'));_0x4c8838['update'](_0xa3a3df);return _0x4c8838[_0x7db8('0x9')]('hex');}function _0xdbb5e0(){try{logger['info'](_0x7db8('0xa'));var _0x24c1dc=moment()['unix']();var _0x4c1235=_0xd2dd62(_0x24c1dc+_0x26fb20+_0x25e783);_0x33870d['send'](JSON[_0x7db8('0xb')]({'appID':_0x26fb20,'timestamp':_0x24c1dc,'appKey':_0x4c1235}));var _0x21bdcb=fs['createReadStream'](_0x1e0b53);_0x21bdcb['on']('data',function(_0x4749ee){_0x33870d[_0x7db8('0xc')](_0x4749ee);});_0x21bdcb['on'](_0x7db8('0xd'),function(){_0x33870d[_0x7db8('0xc')](_0x7db8('0xe'));});}catch(_0x480dfd){logger[_0x7db8('0xf')](_0x7db8('0x10'),JSON[_0x7db8('0xb')](_0x480dfd));_0x33870d[_0x7db8('0x11')]();}}function _0x5b6118(_0x5c0df5){try{if(_0x5c0df5){var _0x79bcf1=JSON[_0x7db8('0x12')](_0x5c0df5);switch(_0x79bcf1[_0x7db8('0x13')]){case 0x0:if(_0x79bcf1['result']){if(_0x79bcf1[_0x7db8('0x14')][_0x7db8('0x15')]){logger[_0x7db8('0x16')](_0x7db8('0x17'),JSON[_0x7db8('0xb')](_0x79bcf1[_0x7db8('0x14')]['hypotheses']));_0x3dea4c=_0x79bcf1[_0x7db8('0x14')]['hypotheses'][0x0][_0x7db8('0x18')];_0xe01055=_0x79bcf1[_0x7db8('0x14')][_0x7db8('0x19')][0x0][_0x7db8('0x1a')];_0x2f6558='0';_0x21c582='Success.';_0x33870d[_0x7db8('0x11')]();}}break;case 0x1:logger[_0x7db8('0x16')]('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x2f6558='1';_0x21c582='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0x7db8('0x16')]('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0x2f6558='2';_0x21c582=_0x7db8('0x1b');break;case 0x9:logger[_0x7db8('0x16')](_0x7db8('0x1c'));_0x2f6558='9';_0x21c582=_0x7db8('0x1c');break;case 0xa:logger['info']('Authentication\x20failed.');_0x2f6558='10';_0x21c582=_0x7db8('0x1d');break;case 0xb:logger[_0x7db8('0x16')](_0x7db8('0x1e'));_0x2f6558='11';_0x21c582=_0x7db8('0x1e');}}}catch(_0x5e6ce7){logger[_0x7db8('0xf')](_0x7db8('0x1f'),JSON[_0x7db8('0xb')](_0x5e6ce7));_0x33870d[_0x7db8('0x11')]();}}function _0x3d8b07(){logger[_0x7db8('0x16')]('Close\x20Tilde\x20ASR\x20socket');_0x596239({'transcript':_0x3dea4c,'confidence':_0xe01055,'status':_0x2f6558,'status_message':_0x21c582});}function _0x3b02ba(_0x3c3f1e){logger[_0x7db8('0xf')](_0x7db8('0x20'));if(!_[_0x7db8('0x21')](_0x3c3f1e)){logger['error'](_[_0x7db8('0x22')](_0x3c3f1e)?JSON[_0x7db8('0xb')](_0x3c3f1e):_0x3c3f1e);}}_0x33870d['on'](_0x7db8('0x23'),_0xdbb5e0);_0x33870d['on'](_0x7db8('0x24'),_0x5b6118);_0x33870d['on'](_0x7db8('0xd'),_0x3d8b07);_0x33870d['on'](_0x7db8('0xf'),_0x3b02ba);});}; \ No newline at end of file +var _0xd162=['hypotheses','transcript','likelihood','Success.','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','error','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isObject','open','bluebird','moment','crypto','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','sha1','update','digest','hex','unix','send','createReadStream','data','close','EOS','Tilde\x20ASR\x20send\x20error','stringify','terminate','status','result','final','Tilde\x20ASR\x20hypoteses'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0xd162,0x177));var _0x2d16=function(_0x52ab62,_0x203d25){_0x52ab62=_0x52ab62-0x0;var _0x42f499=_0xd162[_0x52ab62];return _0x42f499;};'use strict';var BPromise=require(_0x2d16('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x2d16('0x1'));var crypto=require(_0x2d16('0x2'));var logger=require('../../../../../../config/logger')(_0x2d16('0x3'));module[_0x2d16('0x4')]=function(_0x19d86e,_0x55a3f6,_0x1ad3c5,_0x3b0f41){return new BPromise(function(_0x46d83e,_0x479f24){logger[_0x2d16('0x5')](_0x2d16('0x6'),_0x3b0f41||_0x2d16('0x7'));var _0x421593=new WebSocket(_0x3b0f41||_0x2d16('0x7'),{'perMessageDeflate':![]});var _0x3325c0='';var _0x133836='0';var _0x42688c='1';var _0x58fd1a='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x564683(_0x34e8d6){var _0x43d66f=crypto['createHash'](_0x2d16('0x8'));_0x43d66f[_0x2d16('0x9')](_0x34e8d6);return _0x43d66f[_0x2d16('0xa')](_0x2d16('0xb'));}function _0x3c0a0a(){try{logger[_0x2d16('0x5')]('Open\x20Tilde\x20ASR\x20socket');var _0x193ba4=moment()[_0x2d16('0xc')]();var _0x160507=_0x564683(_0x193ba4+_0x55a3f6+_0x1ad3c5);_0x421593[_0x2d16('0xd')](JSON['stringify']({'appID':_0x55a3f6,'timestamp':_0x193ba4,'appKey':_0x160507}));var _0x3932e5=fs[_0x2d16('0xe')](_0x19d86e);_0x3932e5['on'](_0x2d16('0xf'),function(_0x284c2e){_0x421593['send'](_0x284c2e);});_0x3932e5['on'](_0x2d16('0x10'),function(){_0x421593[_0x2d16('0xd')](_0x2d16('0x11'));});}catch(_0x4c18f7){logger['error'](_0x2d16('0x12'),JSON[_0x2d16('0x13')](_0x4c18f7));_0x421593[_0x2d16('0x14')]();}}function _0x13ab41(_0x1090a3){try{if(_0x1090a3){var _0x38cd9e=JSON['parse'](_0x1090a3);switch(_0x38cd9e[_0x2d16('0x15')]){case 0x0:if(_0x38cd9e[_0x2d16('0x16')]){if(_0x38cd9e[_0x2d16('0x16')][_0x2d16('0x17')]){logger[_0x2d16('0x5')](_0x2d16('0x18'),JSON[_0x2d16('0x13')](_0x38cd9e[_0x2d16('0x16')][_0x2d16('0x19')]));_0x3325c0=_0x38cd9e[_0x2d16('0x16')][_0x2d16('0x19')][0x0][_0x2d16('0x1a')];_0x133836=_0x38cd9e[_0x2d16('0x16')][_0x2d16('0x19')][0x0][_0x2d16('0x1b')];_0x42688c='0';_0x58fd1a=_0x2d16('0x1c');_0x421593[_0x2d16('0x14')]();}}break;case 0x1:logger[_0x2d16('0x5')](_0x2d16('0x1d'));_0x42688c='1';_0x58fd1a=_0x2d16('0x1d');break;case 0x2:logger[_0x2d16('0x5')](_0x2d16('0x1e'));_0x42688c='2';_0x58fd1a='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger[_0x2d16('0x5')](_0x2d16('0x1f'));_0x42688c='9';_0x58fd1a=_0x2d16('0x1f');break;case 0xa:logger['info'](_0x2d16('0x20'));_0x42688c='10';_0x58fd1a='Authentication\x20failed.';break;case 0xb:logger['info'](_0x2d16('0x21'));_0x42688c='11';_0x58fd1a=_0x2d16('0x21');}}}catch(_0x1e37e4){logger[_0x2d16('0x22')](_0x2d16('0x23'),JSON[_0x2d16('0x13')](_0x1e37e4));_0x421593[_0x2d16('0x14')]();}}function _0x4fbc5a(){logger[_0x2d16('0x5')](_0x2d16('0x24'));_0x46d83e({'transcript':_0x3325c0,'confidence':_0x133836,'status':_0x42688c,'status_message':_0x58fd1a});}function _0x11b22b(_0x386959){logger[_0x2d16('0x22')](_0x2d16('0x25'));if(!_['isNil'](_0x386959)){logger[_0x2d16('0x22')](_[_0x2d16('0x26')](_0x386959)?JSON[_0x2d16('0x13')](_0x386959):_0x386959);}}_0x421593['on'](_0x2d16('0x27'),_0x3c0a0a);_0x421593['on']('message',_0x13ab41);_0x421593['on'](_0x2d16('0x10'),_0x4fbc5a);_0x421593['on'](_0x2d16('0x22'),_0x11b22b);});}; \ 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 865d752..10cb4be 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 _0xde80=['exports','./asr'];(function(_0x5e9d62,_0x2ab24b){var _0xc1cfdb=function(_0x34dc7e){while(--_0x34dc7e){_0x5e9d62['push'](_0x5e9d62['shift']());}};_0xc1cfdb(++_0x2ab24b);}(_0xde80,0x1d1));var _0x0de8=function(_0x845f8f,_0x29564a){_0x845f8f=_0x845f8f-0x0;var _0x3a2bd9=_0xde80[_0x845f8f];return _0x3a2bd9;};var asr=require(_0x0de8('0x0'));module[_0x0de8('0x1')]={'asr':asr}; \ No newline at end of file +var asr=require('./asr');module['exports']={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 0c0713e..e2e0523 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 _0xadec=['EventEmitter','./error','call','emit','createServer','listen','listening','connection','getConnections','error','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','code','close','E_AGI_SERVER_CLOSE','nextTick','inherits','exports','util','net','events'];(function(_0x1fa649,_0x44ed31){var _0x5f167c=function(_0x2d1256){while(--_0x2d1256){_0x1fa649['push'](_0x1fa649['shift']());}};_0x5f167c(++_0x44ed31);}(_0xadec,0x156));var _0xcade=function(_0x3ac326,_0x2a22de){_0x3ac326=_0x3ac326-0x0;var _0x9ddf0a=_0xadec[_0x3ac326];return _0x9ddf0a;};'use strict';var util=require(_0xcade('0x0'));var net=require(_0xcade('0x1'));var EventEmitter=require(_0xcade('0x2'))[_0xcade('0x3')];var AGIError=require(_0xcade('0x4'));var AGIChannel=require('./channel');var AGIServer=function(_0x55ad3c,_0x570d9c,_0x475533){var _0x875b81=this,_0x55ad3c=_0x55ad3c||0x11dd,_0x570d9c=_0x570d9c||'127.0.0.1',_0x4da887=null,_0x5c8b77=0x0;EventEmitter[_0xcade('0x5')](_0x875b81);function _0x4c36e8(){if(!_0x55ad3c){_0x875b81[_0xcade('0x6')]('error',new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x4da887=net[_0xcade('0x7')]();_0x4da887[_0xcade('0x8')](_0x55ad3c,_0x570d9c);_0x4da887['on'](_0xcade('0x9'),function(){_0x875b81['emit'](_0xcade('0x9'));});_0x4da887['on'](_0xcade('0xa'),function(_0x1339b6){_0x4da887[_0xcade('0xb')](function(_0x15f6f8,_0x2ad733){if(_0x15f6f8){_0x875b81[_0xcade('0x6')](_0xcade('0xc'),new AGIError(_0xcade('0xd'),_0x15f6f8));}else if(_0x475533&&_0x475533<0x0){_0x875b81[_0xcade('0x6')](_0xcade('0xc'),new AGIError(_0xcade('0xe')));_0x1339b6[_0xcade('0xf')]();}else if(_0x475533&&_0x475533>0x0&&_0x475533<_0x2ad733){_0x5c8b77+=0x1;_0x875b81[_0xcade('0x6')]('error',new AGIError(_0xcade('0x10'),_0x5c8b77));_0x1339b6[_0xcade('0xf')]();}else{var _0x2c5976=new AGIChannel(_0x1339b6);_0x2c5976['on']('ready',function(){_0x875b81[_0xcade('0x6')](_0xcade('0xa'),_0x2c5976);});}});});_0x4da887['on']('error',function(_0x135fb7){_0x875b81[_0xcade('0x6')](_0xcade('0xc'),new AGIError('E_AGI_SERVER_ERROR',_0x135fb7[_0xcade('0x11')]));});_0x4da887['on'](_0xcade('0x12'),function(){_0x875b81[_0xcade('0x6')]('close',new AGIError(_0xcade('0x13')));});}process[_0xcade('0x14')](function(){_0x4c36e8();});};util[_0xcade('0x15')](AGIServer,EventEmitter);module[_0xcade('0x16')]=function(_0x42bb52,_0x137534,_0x1e0ead){return new AGIServer(_0x42bb52,_0x137534,_0x1e0ead);}; \ No newline at end of file +var _0x833b=['exports','net','EventEmitter','./channel','call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listen','connection','getConnections','E_AGI_SERVER_ERROR','destroy','E_AGI_SERVER_MAXCONNECTION','ready','close','E_AGI_SERVER_CLOSE','nextTick'];(function(_0x25ab0a,_0x546d22){var _0x29f291=function(_0x34fff7){while(--_0x34fff7){_0x25ab0a['push'](_0x25ab0a['shift']());}};_0x29f291(++_0x546d22);}(_0x833b,0x131));var _0xb833=function(_0x3fba9f,_0x3b7b9b){_0x3fba9f=_0x3fba9f-0x0;var _0x192cf1=_0x833b[_0x3fba9f];return _0x192cf1;};'use strict';var util=require('util');var net=require(_0xb833('0x0'));var EventEmitter=require('events')[_0xb833('0x1')];var AGIError=require('./error');var AGIChannel=require(_0xb833('0x2'));var AGIServer=function(_0x54d82d,_0x66e74c,_0x37ea87){var _0x1f9d90=this,_0x54d82d=_0x54d82d||0x11dd,_0x66e74c=_0x66e74c||'127.0.0.1',_0x35b3f0=null,_0x4422a2=0x0;EventEmitter[_0xb833('0x3')](_0x1f9d90);function _0xb60891(){if(!_0x54d82d){_0x1f9d90[_0xb833('0x4')](_0xb833('0x5'),new AGIError(_0xb833('0x6')));return![];}_0x35b3f0=net[_0xb833('0x7')]();_0x35b3f0[_0xb833('0x8')](_0x54d82d,_0x66e74c);_0x35b3f0['on']('listening',function(){_0x1f9d90[_0xb833('0x4')]('listening');});_0x35b3f0['on'](_0xb833('0x9'),function(_0x2dc315){_0x35b3f0[_0xb833('0xa')](function(_0x193b4d,_0x492017){if(_0x193b4d){_0x1f9d90['emit'](_0xb833('0x5'),new AGIError(_0xb833('0xb'),_0x193b4d));}else if(_0x37ea87&&_0x37ea87<0x0){_0x1f9d90['emit'](_0xb833('0x5'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x2dc315[_0xb833('0xc')]();}else if(_0x37ea87&&_0x37ea87>0x0&&_0x37ea87<_0x492017){_0x4422a2+=0x1;_0x1f9d90[_0xb833('0x4')](_0xb833('0x5'),new AGIError(_0xb833('0xd'),_0x4422a2));_0x2dc315[_0xb833('0xc')]();}else{var _0x42a8ac=new AGIChannel(_0x2dc315);_0x42a8ac['on'](_0xb833('0xe'),function(){_0x1f9d90[_0xb833('0x4')]('connection',_0x42a8ac);});}});});_0x35b3f0['on'](_0xb833('0x5'),function(_0x371871){_0x1f9d90['emit']('error',new AGIError(_0xb833('0xb'),_0x371871['code']));});_0x35b3f0['on'](_0xb833('0xf'),function(){_0x1f9d90[_0xb833('0x4')]('close',new AGIError(_0xb833('0x10')));});}process[_0xb833('0x11')](function(){_0xb60891();});};util['inherits'](AGIServer,EventEmitter);module[_0xb833('0x12')]=function(_0x3bfb12,_0x38eaac,_0x50a6e9){return new AGIServer(_0x3bfb12,_0x38eaac,_0x50a6e9);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 4fcf9e6..16e4978 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 _0x2519=['sms_account_id','no\x20sms\x20account\x20found','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','subproject','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','agi://%s/square,\x22%s\x22,\x22%s\x22','host','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','command','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','Enter\x20in\x20SWITCH\x20(%s)\x20block','replaceAll','join','exports','path','util','lodash','shelljs','odbc','moment','mustache','../../config/logger','agi','menu','getdigits','getsecretdigits','channel','getVariable','getVariableById','then','name','catch','prototype','rpc','getVoiceQueueById','getSquareProject','getSquareOdbc','dsn','getUser','getUserById','getTrunkById','getSoundById','getSoundPath','save_name','getMailAccount','sendMailMessage','getIntervals','IntervalId','interval','map','Intervals','format','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Query\x20executed\x20correctly\x20%s','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','calleridname','extension','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','list_id','scheduledAt','callback','callback_priority','getPause','agentPause','agent','agentUnpause','agentLogout','%s/%s@from-sip/n','LOCAL','agentLogin','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','MALE','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','url','method','timeout','number','includes','POST','PUT','toUpperCase','body','rawBody','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','rawHeaders','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','render','parse','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','ispeechTTS','key','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','model','aws_access_key_id','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_secret_access_key','aws_bot_name','googleASR','tildeASR','appid','appsecret','clear','hasOwnProperty','isString','replaceObjectAllVariables','recursiveNodeIndex','isPlainObject','isArray','saveRestApiResult','length','%s.%s','replaceAllVariables','split','extra','toString','getAndSetVariable','result','setVariable','maxRetry','Enter\x20in\x20AGI\x20(%s)\x20block','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','no\x20list\x20selected','add','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','application','noop','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','no\x20text\x20configured','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20found','DIAL','SIP/%s','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','out','Dialogflow\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','no\x20ndauth\x20url\x20configured','password','sestekNDA','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','getTrunk','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','getSound','file_id','no\x20file\x20audio\x20found','getData','response','test','mindigit','maxdigit','generate','hiddendigitspos','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','goalname','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','awsPolly','aws\x20Polly\x20%s\x20file\x20created','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','Trying\x20Amazon\x20Lex:\x20%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','beep','NOBEEP','recordFile','intKey','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','%s/recordings/%s','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','context','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','true','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','wav','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','Enter\x20in\x20MATH\x20(%s)\x20block','math\x20%s','operation','%s[%s]','variable\x20%s[key]\x20set','retry','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','no\x20file\x20audio\x20selected','Executed\x20command\x20%s\x20%s','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','gosub','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%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','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_MESSAGE','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','digits','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','sayPhonetic','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','user','bcc','subject','service','port','secure','authentication','auth','pass','debug','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','Enter\x20in\x20SENDSMS\x20(%s)\x20block'];(function(_0x307d86,_0x9264f2){var _0x361745=function(_0x1b64e1){while(--_0x1b64e1){_0x307d86['push'](_0x307d86['shift']());}};_0x361745(++_0x9264f2);}(_0x2519,0x1cf));var _0x9251=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x2519[_0x321bb2];return _0x9c12ed;};'use strict';var fs=require('fs');var path=require(_0x9251('0x0'));var util=require(_0x9251('0x1'));var _=require(_0x9251('0x2'));var sh=require(_0x9251('0x3'));var odbc=require(_0x9251('0x4'))();var rs=require('randomstring');var moment=require(_0x9251('0x5'));var Mustache=require(_0x9251('0x6'));var rp=require('request-promise');var logger=require(_0x9251('0x7'))(_0x9251('0x8'));var config=require('../../config/environment');var scripts=require('./scripts');var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=['rawHeaders','rawBody'];var verticesWithRetry=[_0x9251('0x9'),_0x9251('0xa'),_0x9251('0xb')];var AGIVertices=function(_0x1678c7,_0x4dad39,_0x5e399d){this[_0x9251('0xc')]=_0x1678c7;this['rpc']=_0x4dad39;this['mailRpc']=_0x5e399d;};AGIVertices['prototype'][_0x9251('0xd')]=function(_0x47f3e9,_0x5a7eee){this['rpc'][_0x9251('0xe')](_0x47f3e9)[_0x9251('0xf')](function(_0x414392){_0x5a7eee(null,_0x414392?_0x414392[_0x9251('0x10')]:![]);})[_0x9251('0x11')](function(_0x3997dc){_0x5a7eee(_0x3997dc);});};AGIVertices[_0x9251('0x12')]['getVoiceQueue']=function(_0x51a9a1,_0x2a9995){this[_0x9251('0x13')][_0x9251('0x14')](_0x51a9a1)[_0x9251('0xf')](function(_0x822a60){_0x2a9995(null,_0x822a60?_0x822a60[_0x9251('0x10')]:![]);})[_0x9251('0x11')](function(_0x5977f3){_0x2a9995(_0x5977f3);});};AGIVertices['prototype'][_0x9251('0x15')]=function(_0x1cc625,_0x108dae){this[_0x9251('0x13')]['getSquareProjectById'](_0x1cc625)[_0x9251('0xf')](function(_0x562c63){_0x108dae(null,_0x562c63?_0x562c63[_0x9251('0x10')]:![]);})[_0x9251('0x11')](function(_0x355aa8){_0x108dae(_0x355aa8);});};AGIVertices['prototype'][_0x9251('0x16')]=function(_0x27ce1c,_0x1b7c5f){this[_0x9251('0x13')]['getSquareOdbcById'](_0x27ce1c)[_0x9251('0xf')](function(_0x4948a0){_0x1b7c5f(null,_0x4948a0?_0x4948a0[_0x9251('0x17')]:![]);})[_0x9251('0x11')](function(_0x3e2af5){_0x1b7c5f(_0x3e2af5);});};AGIVertices[_0x9251('0x12')][_0x9251('0x18')]=function(_0x3a37df,_0x184ce0){this['rpc'][_0x9251('0x19')](_0x3a37df)[_0x9251('0xf')](function(_0x5535a0){_0x184ce0(null,_0x5535a0?_0x5535a0['name']:![]);})['catch'](function(_0x6c7fcb){_0x184ce0(_0x6c7fcb);});};AGIVertices[_0x9251('0x12')]['getTrunk']=function(_0x295687,_0x1d1fa5){this[_0x9251('0x13')][_0x9251('0x1a')](_0x295687)[_0x9251('0xf')](function(_0xd6def1){_0x1d1fa5(null,_0xd6def1?_0xd6def1[_0x9251('0x10')]:![]);})['catch'](function(_0x350b46){_0x1d1fa5(_0x350b46);});};AGIVertices['prototype']['getSound']=function(_0x5ef58d,_0x439379){var _0xc6b972=this;this['rpc'][_0x9251('0x1b')](_0x5ef58d)[_0x9251('0xf')](function(_0x377839){_0x439379(null,_0x377839?_0xc6b972[_0x9251('0x1c')](_0x377839[_0x9251('0x1d')]):![]);})[_0x9251('0x11')](function(_0x1b5fe2){_0x439379(_0x1b5fe2);});};AGIVertices['prototype'][_0x9251('0x1e')]=function(_0x1907a7,_0x5b4154){this[_0x9251('0x13')]['getMailAccountById'](_0x1907a7)[_0x9251('0xf')](function(_0x25173e){_0x5b4154(null,_0x25173e?_0x25173e:![]);})[_0x9251('0x11')](function(_0x1ec10a){_0x5b4154(_0x1ec10a);});};AGIVertices[_0x9251('0x12')][_0x9251('0x1f')]=function(_0x322178,_0x1b1bf2,_0xc65338){this['mailRpc'][_0x9251('0x1f')](_0x322178,_0x1b1bf2)['then'](function(){_0xc65338(null);})[_0x9251('0x11')](function(_0x3e50c1){_0xc65338(_0x3e50c1);});};AGIVertices['prototype'][_0x9251('0x20')]=function(_0x1c4f4f,_0x3d0618){this[_0x9251('0x13')]['getIntervalById'](_0x1c4f4f)[_0x9251('0xf')](function(_0x348b1b){if(_0x348b1b){if(_0x348b1b[_0x9251('0x21')]){_0x3d0618(null,[_0x348b1b[_0x9251('0x22')]]);}else{_0x3d0618(null,_[_0x9251('0x23')](_0x348b1b[_0x9251('0x24')],_0x9251('0x22')));}}else{_0x3d0618(null,![]);}})[_0x9251('0x11')](function(_0x4f7a5e){_0x3d0618(_0x4f7a5e);});};AGIVertices['prototype']['getSoundPath']=function(_0x1c5a32){return util[_0x9251('0x25')]('%s/sounds/converted/%s',FILES_PATH,_0x1c5a32);};AGIVertices['prototype'][_0x9251('0x26')]=function(_0x4df389,_0x364648,_0x3659c0){odbc[_0x9251('0x27')](_0x4df389,function(_0x3197f3){if(_0x3197f3){logger[_0x9251('0x28')](_0x9251('0x29'),_0x3197f3);_0x3659c0(_0x3197f3);}else{logger[_0x9251('0x2a')](_0x9251('0x2b'));odbc[_0x9251('0x2c')](_0x364648,function(_0x48d4fb,_0x81d1e2){if(_0x48d4fb){logger['info']('Error\x20executing\x20query\x20%s',_0x364648);_0x3659c0(_0x48d4fb);}else{logger[_0x9251('0x2a')](_0x9251('0x2d'),_0x364648);odbc['close'](function(_0x5136ce){if(_0x5136ce){logger['error'](_0x9251('0x2e'),_0x5136ce);}_0x3659c0(null,_0x81d1e2);});}});}});};AGIVertices['prototype'][_0x9251('0x2f')]=function(_0x24d7c4,_0x3d2a10){this[_0x9251('0x13')]['getSmsAccountById'](_0x24d7c4)[_0x9251('0xf')](function(_0x25dcd5){_0x3d2a10(null,_0x25dcd5?_0x25dcd5:![]);})[_0x9251('0x11')](function(_0x372acf){_0x3d2a10(_0x372acf);});};AGIVertices[_0x9251('0x12')][_0x9251('0x30')]=function(_0x961997,_0x1de7b3){this[_0x9251('0x13')][_0x9251('0x30')](_0x961997)[_0x9251('0xf')](function(_0x1614d1){_0x1de7b3(null,_0x1614d1);})['catch'](function(_0xd76563){_0x1de7b3(_0xd76563);});};AGIVertices[_0x9251('0x12')][_0x9251('0x31')]=function(_0x1801f5,_0x4e8807,_0xbcc9c8){this[_0x9251('0x13')]['createSquareDetailsReport']({'uniqueid':this['channel'][_0x9251('0x32')],'node':_0x1801f5[_0x9251('0x33')],'application':_0x1801f5[_0x9251('0x34')],'data':_0x4e8807||null,'project_name':this['channel'][_0x9251('0x35')],'callerid':this[_0x9251('0xc')][_0x9251('0x36')]})[_0x9251('0xf')](function(_0x113a3){if(_0xbcc9c8){_0xbcc9c8(null,_0x113a3);}})[_0x9251('0x11')](function(_0x32578f){if(_0xbcc9c8){_0xbcc9c8(_0x32578f);}});};AGIVertices[_0x9251('0x12')]['createSquareRecording']=function(_0x5a10ca,_0x374969,_0x28f8fb,_0x5397a1){this[_0x9251('0x13')][_0x9251('0x37')]({'uniqueid':this[_0x9251('0xc')]['uniqueid'],'callerid':this[_0x9251('0xc')]['callerid'],'calleridname':this[_0x9251('0xc')][_0x9251('0x38')],'context':this[_0x9251('0xc')]['context'],'extension':this[_0x9251('0xc')][_0x9251('0x39')],'priority':this[_0x9251('0xc')][_0x9251('0x3a')],'accountcode':this[_0x9251('0xc')][_0x9251('0x3b')],'dnid':this['channel'][_0x9251('0x3c')],'projectName':this[_0x9251('0xc')]['arg_1'],'saveName':_0x374969,'filename':_0x5a10ca[_0x9251('0x3d')]||_0x374969,'savePath':_0x28f8fb})['then'](function(_0x499f48){_0x5397a1(null,_0x499f48);})['catch'](function(_0x276d36){_0x5397a1(_0x276d36);});};AGIVertices[_0x9251('0x12')]['createSquareMessage']=function(_0x125946,_0x5edd5b,_0x2900c5){this[_0x9251('0x13')][_0x9251('0x3e')]({'uniqueid':this[_0x9251('0xc')][_0x9251('0x32')],'body':_0x125946,'direction':_0x5edd5b})[_0x9251('0xf')](function(_0x379078){if(_0x2900c5){_0x2900c5(null,_0x379078);}})[_0x9251('0x11')](function(_0x36402b){if(_0x2900c5){_0x2900c5(_0x36402b);}});};AGIVertices[_0x9251('0x12')][_0x9251('0x3f')]=function(_0x3a82b1,_0x15eb4e){this[_0x9251('0x13')][_0x9251('0x3f')]({'firstName':_[_0x9251('0x40')](_0x3a82b1[_0x9251('0x10')])||_[_0x9251('0x41')](_0x3a82b1[_0x9251('0x10')])?_0x9251('0x42')+Math[_0x9251('0x43')]():_0x3a82b1[_0x9251('0x10')],'lastName':_[_0x9251('0x40')](_0x3a82b1[_0x9251('0x44')])||_[_0x9251('0x41')](_0x3a82b1['lastName'])?null:_0x3a82b1[_0x9251('0x44')],'phone':_0x3a82b1[_0x9251('0x45')],'ListId':_0x3a82b1[_0x9251('0x46')],'scheduledat':_0x3a82b1[_0x9251('0x47')],'callbackUniqueid':this['channel']['uniqueid'],'tags':_0x9251('0x48'),'description':'Callback\x20scheduled\x20at\x20'+_0x3a82b1[_0x9251('0x47')]['toString'](),'priority':_0x3a82b1[_0x9251('0x49')]})[_0x9251('0xf')](function(_0x1cab1b){_0x15eb4e(null,_0x1cab1b);})[_0x9251('0x11')](function(_0x8e72bc){_0x15eb4e(_0x8e72bc);});};AGIVertices[_0x9251('0x12')][_0x9251('0x4a')]=function(_0x7c1ff9,_0x37e06b){this[_0x9251('0x13')]['getPauseById'](_0x7c1ff9)[_0x9251('0xf')](function(_0x45fe36){_0x37e06b(null,_0x45fe36?_0x45fe36[_0x9251('0x10')]:![]);})['catch'](function(_0x4deba8){_0x37e06b(_0x4deba8);});};AGIVertices['prototype'][_0x9251('0x4b')]=function(_0x91f94,_0x5d1cea,_0x25bf6c){var _0x4702e9={'role':_0x9251('0x4c')};_0x4702e9[_0x91f94]=this['channel'][_0x9251('0x36')];this[_0x9251('0x13')][_0x9251('0x4b')](_0x4702e9,_0x5d1cea,this['channel']['uniqueid'])[_0x9251('0xf')](function(_0x518303){_0x25bf6c(null,_[_0x9251('0x41')](_0x518303)?![]:!![]);})['catch'](function(_0x13e56c){logger[_0x9251('0x28')](_0x13e56c);_0x25bf6c(null,![]);});};AGIVertices[_0x9251('0x12')][_0x9251('0x4d')]=function(_0x3f4de6,_0x453985){var _0x1881c6={'role':_0x9251('0x4c')};_0x1881c6[_0x3f4de6]=this[_0x9251('0xc')][_0x9251('0x36')];this['rpc'][_0x9251('0x4d')](_0x1881c6)[_0x9251('0xf')](function(_0x5cae26){_0x453985(null,_[_0x9251('0x41')](_0x5cae26)?![]:!![]);})[_0x9251('0x11')](function(_0x541f7c){logger[_0x9251('0x28')](_0x541f7c);_0x453985(null,![]);});};AGIVertices['prototype']['agentLogout']=function(_0x529833,_0x1d952b){var _0x1d94ab={'role':_0x9251('0x4c')};_0x1d94ab[_0x529833]=this[_0x9251('0xc')][_0x9251('0x36')];this[_0x9251('0x13')][_0x9251('0x4e')](_0x1d94ab)[_0x9251('0xf')](function(_0x2c1419){_0x1d952b(null,_[_0x9251('0x41')](_0x2c1419)?![]:!![]);})[_0x9251('0x11')](function(_0x55f825){logger[_0x9251('0x28')](_0x55f825);_0x1d952b(null,![]);});};AGIVertices[_0x9251('0x12')]['agentLogin']=function(_0x14da51,_0x415439){var _0x51cf26={'role':'agent'};_0x51cf26[_0x14da51]=this[_0x9251('0xc')][_0x9251('0x36')];var _0x77c7e7=_0x14da51!='internal'?util[_0x9251('0x25')](_0x9251('0x4f'),_0x9251('0x50'),this[_0x9251('0xc')]['callerid']):undefined;this[_0x9251('0x13')][_0x9251('0x51')](_0x51cf26,_0x77c7e7)['then'](function(_0x1eb19d){_0x415439(null,_[_0x9251('0x41')](_0x1eb19d)?![]:!![]);})['catch'](function(_0x5351ee){logger[_0x9251('0x28')](_0x5351ee);_0x415439(null,![]);});};AGIVertices[_0x9251('0x12')][_0x9251('0x52')]=function(_0x5ba7d6,_0xcc3bcd){sh[_0x9251('0x53')](_[_0x9251('0x54')](_0x5ba7d6),function(_0x314ed4,_0x36e9d9){var _0x2a01e3=_0x36e9d9[_0x9251('0x55')](/(\r\n|\n|\r)/gm,'');_0xcc3bcd(null,_0x2a01e3);});};AGIVertices[_0x9251('0x12')][_0x9251('0x56')]=function(_0x1c79e8,_0x2c7d66){scripts[_0x9251('0x56')](_0x1c79e8[_0x9251('0x57')],_0x1c79e8[_0x9251('0x58')]||_0x9251('0x59'),_0x1c79e8[_0x9251('0x59')],_0x1c79e8[_0x9251('0x5a')]||_0x9251('0x5b'),_0x1c79e8['ssmlGender']||_0x9251('0x5c'),_0x1c79e8[_0x9251('0x5d')]||_0x9251('0x5e'))['then'](function(_0x305448){_0x2c7d66(null,_0x305448);})[_0x9251('0x11')](function(_0x30c48c){_0x2c7d66(_0x30c48c);});};AGIVertices['prototype'][_0x9251('0x5f')]=function(_0x476707,_0x1328dc){scripts[_0x9251('0x5f')](_0x476707[_0x9251('0x59')],_0x476707[_0x9251('0x60')]||'en',0x1)[_0x9251('0xf')](function(_0x1c4589){_0x1328dc(null,_0x1c4589);})[_0x9251('0x11')](function(_0x521e8b){_0x1328dc(_0x521e8b);});};AGIVertices[_0x9251('0x12')][_0x9251('0x61')]=function(_0x1ec019,_0x13f4c2){var _0x5830ae={'uri':_0x1ec019[_0x9251('0x62')],'method':_0x1ec019[_0x9251('0x63')],'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x1ec019[_0x9251('0x64')])===_0x9251('0x65')&&parseInt(_0x1ec019[_0x9251('0x64')])>=0x1?parseInt(_0x1ec019['timeout'])*0x3e8:0x5*0x3e8};if(_[_0x9251('0x66')]([_0x9251('0x67'),_0x9251('0x68')],_0x5830ae[_0x9251('0x63')][_0x9251('0x69')]())){try{_0x5830ae[_0x9251('0x6a')]=_0x1ec019['rawBody']?JSON['parse'](_0x1ec019[_0x9251('0x6b')]):{};}catch(_0x40040d){logger[_0x9251('0x28')](_0x9251('0x6c'),_0x40040d);}}try{_0x5830ae[_0x9251('0x6d')]=_0x1ec019[_0x9251('0x6e')]?JSON['parse'](_0x1ec019[_0x9251('0x6e')]):{};}catch(_0x485c2d){logger[_0x9251('0x28')](_0x9251('0x6f'),_0x485c2d);}if(_0x1ec019[_0x9251('0x70')]){try{var _0x13ae5e=require(_0x1ec019['computedVariables'])[_0x9251('0x71')](this,_0x5830ae);_0x5830ae['uri']=Mustache[_0x9251('0x72')](_0x1ec019[_0x9251('0x62')],_0x13ae5e,{},['$$','$$']);if(_0x5830ae[_0x9251('0x6d')]){_0x5830ae['headers']=JSON[_0x9251('0x73')](Mustache[_0x9251('0x72')](JSON[_0x9251('0x74')](_0x5830ae[_0x9251('0x6d')]),_0x13ae5e,{},['$$','$$']));}if(_0x5830ae[_0x9251('0x6a')]){_0x5830ae[_0x9251('0x6a')]=JSON[_0x9251('0x73')](Mustache[_0x9251('0x72')](JSON[_0x9251('0x74')](_0x5830ae[_0x9251('0x6a')]),_0x13ae5e,{},['$$','$$']));}}catch(_0x49c589){logger[_0x9251('0x28')](_0x9251('0x75'),_0x49c589);}}rp(_0x5830ae)[_0x9251('0xf')](function(_0x412d8e){var _0x4ef5b5={'statusCode':_0x412d8e[_0x9251('0x76')]||0xc8,'statusMessage':_0x412d8e['statusMessage']||'OK','headers':_0x412d8e[_0x9251('0x6d')]||{},'body':_0x412d8e['body']||{}};_0x13f4c2(null,_0x4ef5b5);})[_0x9251('0x11')](function(_0x225568){var _0x368cfe={'statusCode':_0x225568[_0x9251('0x76')]||0x1f4,'statusMessage':_0x225568[_0x9251('0x77')]||_0x9251('0x78'),'headers':_0x225568[_0x9251('0x79')][_0x9251('0x6d')]||{},'body':_0x225568[_0x9251('0x79')][_0x9251('0x6a')]||{}};_0x13f4c2(null,_0x368cfe);});};AGIVertices[_0x9251('0x12')]['googleDialogflow']=function(_0x304af5,_0x14054a){scripts[_0x9251('0x7a')](this[_0x9251('0xc')]['uniqueid'],_0x304af5['key'],_0x304af5[_0x9251('0x59')],_0x304af5['dialogflow_language']||'en')['then'](function(_0x3c9886){_0x14054a(null,_0x3c9886);})[_0x9251('0x11')](function(_0x1384ef){_0x14054a(_0x1384ef);});};AGIVertices['prototype']['sestekNDA']=function(_0x1312e0,_0x17048a){scripts['sestekNDA'](this[_0x9251('0xc')],_0x1312e0)[_0x9251('0xf')](function(_0x38bc03){_0x17048a(null,_0x38bc03);})[_0x9251('0x11')](function(_0x5e3cbb){_0x17048a(_0x5e3cbb);});};AGIVertices[_0x9251('0x12')][_0x9251('0x7b')]=function(_0x3c60d7,_0x59ecf3){scripts[_0x9251('0x7b')](_0x3c60d7[_0x9251('0x7c')],_0x3c60d7[_0x9251('0x59')],_0x3c60d7[_0x9251('0x7d')]||_0x9251('0x5b'),_0x3c60d7[_0x9251('0x7e')])[_0x9251('0xf')](function(_0xaab177){_0x59ecf3(null,_0xaab177);})[_0x9251('0x11')](function(_0x461145){_0x59ecf3(_0x461145);});};AGIVertices[_0x9251('0x12')][_0x9251('0x7f')]=function(_0x5e4349,_0x3944e5,_0x5a5074){scripts[_0x9251('0x7f')](_0x3944e5,_0x5e4349[_0x9251('0x7c')],_0x5e4349[_0x9251('0x80')]||_0x9251('0x5b'),this[_0x9251('0x81')](_0x5e4349[_0x9251('0x82')])?_0x5e4349[_0x9251('0x82')]:undefined)['then'](function(_0x369933){_0x5a5074(null,_0x369933);})[_0x9251('0x11')](function(_0x1d9651){_0x5a5074(_0x1d9651);});};AGIVertices['prototype']['awsPolly']=function(_0x9b83be,_0x10d00e){scripts['awsPolly'](_0x9b83be[_0x9251('0x83')],_0x9b83be['aws_secret_access_key'],_0x9b83be[_0x9251('0x84')],_0x9b83be[_0x9251('0x85')]||_0x9251('0x86'),_0x9b83be[_0x9251('0x59')],_0x9b83be[_0x9251('0x87')]||'text')['then'](function(_0x2340c5){_0x10d00e(null,_0x2340c5);})[_0x9251('0x11')](function(_0x3b62ac){_0x10d00e(_0x3b62ac);});};AGIVertices[_0x9251('0x12')]['awsLex']=function(_0x5cf1e3,_0x4ffd2b){scripts[_0x9251('0x88')](this[_0x9251('0xc')][_0x9251('0x32')],_0x5cf1e3[_0x9251('0x83')],_0x5cf1e3[_0x9251('0x89')],_0x5cf1e3['aws_lex_region'],_0x5cf1e3['text'],_0x5cf1e3[_0x9251('0x8a')])['then'](function(_0x1e547b){_0x4ffd2b(null,_0x1e547b);})['catch'](function(_0xa72ab9){_0x4ffd2b(_0xa72ab9);});};AGIVertices[_0x9251('0x12')]['googleASR']=function(_0x205d31,_0xdd785d,_0x5ed975){scripts[_0x9251('0x8b')](_0xdd785d,_0x205d31['key'],_0x205d31['google_asr_language']||_0x9251('0x5b'))[_0x9251('0xf')](function(_0x4ff54f){_0x5ed975(null,_0x4ff54f);})[_0x9251('0x11')](function(_0x2079a2){_0x5ed975(_0x2079a2);});};AGIVertices[_0x9251('0x12')][_0x9251('0x8c')]=function(_0x4e087f,_0x20a8bd,_0x553825){scripts['tildeASR'](_0x20a8bd,_0x4e087f[_0x9251('0x8d')],_0x4e087f[_0x9251('0x8e')],_0x4e087f['uri'])[_0x9251('0xf')](function(_0x3d364f){_0x553825(null,_0x3d364f);})[_0x9251('0x11')](function(_0x48544d){_0x553825(_0x48544d);});};AGIVertices[_0x9251('0x12')][_0x9251('0x8f')]=function(_0xa45441){var _0xcb61be=_[_0x9251('0x66')](verticesWithRetry,_0xa45441[_0x9251('0x34')])?_0xa45441:_['clone'](_0xa45441);for(var _0x2af032 in _0xcb61be){if(_0xcb61be[_0x9251('0x90')](_0x2af032)){if(_0xcb61be[_0x2af032]&&_[_0x9251('0x91')](_0xcb61be[_0x2af032])){if(_[_0x9251('0x66')](recursiveMapAttributes,_0x2af032)){_0xcb61be[_0x2af032]=this[_0x9251('0x92')](_0xcb61be[_0x2af032]);}else{_0xcb61be[_0x2af032]=this['replaceAllVariables'](_0xcb61be[_0x2af032]);}}}}return _0xcb61be;};AGIVertices[_0x9251('0x12')][_0x9251('0x93')]=function(_0x1657c){for(var _0x50aa8d in _0x1657c){if(_0x1657c[_0x9251('0x90')](_0x50aa8d)){if(_[_0x9251('0x94')](_0x1657c[_0x50aa8d])){this[_0x9251('0x93')](_0x1657c[_0x50aa8d]);}else if(_[_0x9251('0x95')](_0x1657c[_0x50aa8d])){for(var _0x4db582=0x0;_0x4db582<_0x1657c[_0x50aa8d]['length'];_0x4db582++){this[_0x9251('0x93')](_0x1657c[_0x50aa8d][_0x4db582]);}}else if(_[_0x9251('0x91')](_0x1657c[_0x50aa8d])){_0x1657c[_0x50aa8d]=this['replaceAllVariables'](_0x1657c[_0x50aa8d]);}}}};AGIVertices[_0x9251('0x12')][_0x9251('0x96')]=function(_0x6b3dd5,_0x330f48){for(var _0x4f90c3 in _0x6b3dd5){if(_0x6b3dd5[_0x9251('0x90')](_0x4f90c3)){if(_['isPlainObject'](_0x6b3dd5[_0x4f90c3])){if(!_[_0x9251('0x40')](_0x6b3dd5[_0x4f90c3])){this[_0x9251('0x96')](_0x6b3dd5[_0x4f90c3],util[_0x9251('0x25')]('%s.%s',_0x330f48,_0x4f90c3));}}else if(_['isArray'](_0x6b3dd5[_0x4f90c3])){for(var _0x5c7bb6=0x0;_0x5c7bb6<_0x6b3dd5[_0x4f90c3][_0x9251('0x97')];_0x5c7bb6++){this[_0x9251('0x96')](_0x6b3dd5[_0x4f90c3][_0x5c7bb6],util[_0x9251('0x25')](_0x9251('0x98'),_0x330f48,_0x4f90c3+'['+_0x5c7bb6+']'));}}else{if(!_['isNil'](_0x6b3dd5[_0x4f90c3])){this['channel']['setVariable'](util[_0x9251('0x25')](_0x9251('0x98'),_0x330f48,_0x4f90c3),_0x6b3dd5[_0x4f90c3]);}}}}};AGIVertices[_0x9251('0x12')]['replaceObjectAllVariables']=function(_0x4d463c){try{var _0x77b483=JSON[_0x9251('0x73')](_0x4d463c);this[_0x9251('0x93')](_0x77b483);return JSON[_0x9251('0x74')](_0x77b483);}catch(_0x4501fd){return this[_0x9251('0x99')](_0x4d463c);}};AGIVertices['prototype'][_0x9251('0x99')]=function(_0x4c73f1){var _0x333494=_0x4c73f1[_0x9251('0x9a')]('{');for(var _0xe668e1=0x1;_0xe668e1<_0x333494['length'];_0xe668e1+=0x1){var _0xe1d5bf=_0x333494[_0xe668e1][_0x9251('0x9a')]('}');if(_0xe1d5bf['length']>0x1){_0x4c73f1=_0x4c73f1['replaceAll']('{'+_0xe1d5bf[0x0]+'}',this[_0x9251('0xc')][_0x9251('0xd')](_0xe1d5bf[0x0])[_0x9251('0x9b')]||_0xe1d5bf[0x0]);}}if(_0x333494[_0x9251('0x97')]===0x1){return _0x4c73f1[_0x9251('0x9c')]();}return this['replaceAllVariables'](_0x4c73f1);};AGIVertices['prototype'][_0x9251('0x9d')]=function(_0x4f9100,_0x5c5cef){var _0x5c1378=this['channel'][_0x9251('0xd')](_0x4f9100);if(_0x5c1378[_0x9251('0x9e')]===-0x1){return _0x5c1378;}logger[_0x9251('0x2a')](util[_0x9251('0x25')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x5c5cef,_0x5c1378['extra']));return this['channel'][_0x9251('0x9f')](_0x5c5cef,_0x5c1378[_0x9251('0x9b')]);};AGIVertices[_0x9251('0x12')][_0x9251('0x81')]=function(_0x193709){return _0x193709&&_0x193709!=='0'&&_0x193709!=='-1'&&_0x193709!=='';};AGIVertices[_0x9251('0x12')][_0x9251('0xa0')]=function(_0x13aefb){this[_0x9251('0x31')][_0x9251('0x71')](this,_0x13aefb,'-');_0x13aefb['retry']=_0x13aefb[_0x9251('0xa0')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x9251('0x12')][_0x9251('0x8')]=function(_0x15e0b1){logger[_0x9251('0x2a')](util[_0x9251('0x25')](_0x9251('0xa1'),_0x15e0b1[_0x9251('0x33')]));return this[_0x9251('0xc')][_0x9251('0x8')]([_0x15e0b1['command'],_0x15e0b1[_0x9251('0xa2')]]);};AGIVertices[_0x9251('0x12')][_0x9251('0xa3')]=function(_0x4e9d05){logger[_0x9251('0x2a')](util[_0x9251('0x25')](_0x9251('0xa4'),_0x4e9d05[_0x9251('0x33')]));if(this['isConfigured'](_0x4e9d05[_0x9251('0x64')])){logger[_0x9251('0x2a')](util[_0x9251('0x25')](_0x9251('0xa5'),_0x4e9d05[_0x9251('0x64')]));var _0x425c14=this[_0x9251('0xc')][_0x9251('0xa6')](_0x4e9d05[_0x9251('0x64')]);if(_0x425c14['result']===-0x1){return _0x425c14;}}return this[_0x9251('0xc')][_0x9251('0xa3')]();};AGIVertices[_0x9251('0x12')]['callback']=function(_0x5c8d5f){logger[_0x9251('0x2a')](util[_0x9251('0x25')]('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x5c8d5f[_0x9251('0x33')]));if(!this[_0x9251('0x81')](_0x5c8d5f[_0x9251('0x46')])){return this[_0x9251('0xc')][_0x9251('0x28')](_0x5c8d5f,_0x9251('0xa7'));}_0x5c8d5f[_0x9251('0x47')]=moment();if(this['isConfigured'](_0x5c8d5f['delay'])){_0x5c8d5f['scheduledAt']=moment()[_0x9251('0xa8')](_0x5c8d5f['delay'],'minutes');}if(!this['isConfigured'](_0x5c8d5f[_0x9251('0x49')])){_0x5c8d5f['callback_priority']=0x2;}this['createCmContact'][_0x9251('0x71')](this,_0x5c8d5f);return this['channel']['noop'](util[_0x9251('0x25')](_0x9251('0xa9'),_0x5c8d5f['phone'],_0x5c8d5f['list_id'],_0x5c8d5f[_0x9251('0x47')]));};AGIVertices[_0x9251('0x12')]['custom_app']=function(_0x209b79){logger[_0x9251('0x2a')](util[_0x9251('0x25')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x209b79[_0x9251('0x33')]));var _0x47c235=this[_0x9251('0xc')]['exec'](_0x209b79[_0x9251('0xaa')],_0x209b79[_0x9251('0x79')]);if(_0x47c235[_0x9251('0x9e')]===-0x1){return _0x47c235;}return this[_0x9251('0xc')][_0x9251('0xab')](util[_0x9251('0x25')]('Executed\x20command\x20%s\x20%s',_0x209b79['application'],_0x209b79['options']));};AGIVertices[_0x9251('0x12')][_0x9251('0xac')]=function(_0x5a2052){logger[_0x9251('0x2a')](util[_0x9251('0x25')](_0x9251('0xad'),_0x5a2052['label']));if(!this[_0x9251('0x81')](_0x5a2052['text'])){return this[_0x9251('0xc')]['noop']('no\x20text\x20configured');}var _0xf83339='\x22'+_0x5a2052[_0x9251('0x59')]+'\x22';if(this[_0x9251('0x81')](_0x5a2052[_0x9251('0x79')])){_0xf83339+=','+_0x5a2052[_0x9251('0x79')];}var _0x5ee8ff=this[_0x9251('0xc')][_0x9251('0x53')](_0x9251('0xae'),_0xf83339);if(_0x5ee8ff[_0x9251('0x9e')]===-0x1){return _0x5ee8ff;}return this[_0x9251('0xc')]['noop'](util['format'](_0x9251('0xaf'),_0xf83339));};AGIVertices[_0x9251('0x12')][_0x9251('0xb0')]=function(_0x1fe9c8){logger[_0x9251('0x2a')](util[_0x9251('0x25')](_0x9251('0xb1'),_0x1fe9c8[_0x9251('0x33')]));if(!this['isConfigured'](_0x1fe9c8[_0x9251('0x59')])){return this[_0x9251('0xc')][_0x9251('0xab')](_0x9251('0xb2'));}var _0x52abb1='\x22'+_0x1fe9c8['text']+'\x22';if(this[_0x9251('0x81')](_0x1fe9c8[_0x9251('0x79')])){_0x52abb1+=','+_0x1fe9c8['options'];}var _0x5af6a6=this[_0x9251('0xc')][_0x9251('0x53')]('MRCPSynth',_0x52abb1);if(_0x5af6a6[_0x9251('0x9e')]===-0x1){return _0x5af6a6;}return this[_0x9251('0xc')][_0x9251('0xab')](util['format'](_0x9251('0xaf'),_0x52abb1));};AGIVertices[_0x9251('0x12')]['lumenvoxasr']=function(_0xb02614){logger['info'](util[_0x9251('0x25')](_0x9251('0xb3'),_0xb02614[_0x9251('0x33')]));if(!this['isConfigured'](_0xb02614[_0x9251('0xb4')])){return this[_0x9251('0xc')]['noop'](_0x9251('0xb5'));}var _0x5368ce=_0xb02614[_0x9251('0xb4')];if(this[_0x9251('0x81')](_0xb02614[_0x9251('0x79')])){_0x5368ce+=','+_0xb02614[_0x9251('0x79')];}var _0x2c0ae8=this[_0x9251('0xc')][_0x9251('0x53')](_0x9251('0xb6'),_0x5368ce);if(_0x2c0ae8[_0x9251('0x9e')]===-0x1){return _0x2c0ae8;}var _0x184146=this[_0x9251('0x9d')](_0x9251('0xb7'),'LUMENVOX_ASR_CONFIDENCE');if(_0x184146[_0x9251('0x9e')]===-0x1){return _0x184146;}var _0x16057b=this[_0x9251('0x9d')](_0x9251('0xb8'),_0x9251('0xb9'));if(_0x16057b[_0x9251('0x9e')]===-0x1){return _0x16057b;}var _0x3a9292=this[_0x9251('0x9d')](_0x9251('0xba'),_0x9251('0xbb'));if(_0x3a9292[_0x9251('0x9e')]===-0x1){return _0x3a9292;}return this[_0x9251('0xc')][_0x9251('0xab')](util[_0x9251('0x25')](_0x9251('0xbc'),_0x5368ce));};AGIVertices[_0x9251('0x12')]['sestekasr']=function(_0x335a5e){logger[_0x9251('0x2a')](util[_0x9251('0x25')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x335a5e[_0x9251('0x33')]));if(!this[_0x9251('0x81')](_0x335a5e['grammar'])){return this[_0x9251('0xc')][_0x9251('0xab')](_0x9251('0xb5'));}var _0x562100=_0x335a5e[_0x9251('0xb4')];if(this['isConfigured'](_0x335a5e[_0x9251('0x79')])){_0x562100+=','+_0x335a5e['options'];}var _0x4a2de2=this[_0x9251('0xc')][_0x9251('0x53')](_0x9251('0xb6'),_0x562100);if(_0x4a2de2[_0x9251('0x9e')]===-0x1){return _0x4a2de2;}var _0x1c4b2a=this['getAndSetVariable']('RECOG_CONFIDENCE()',_0x9251('0xbd'));if(_0x1c4b2a['result']===-0x1){return _0x1c4b2a;}var _0x5a6e5e=this[_0x9251('0x9d')](_0x9251('0xb8'),_0x9251('0xbe'));if(_0x5a6e5e['result']===-0x1){return _0x5a6e5e;}var _0x249859=this[_0x9251('0x9d')]('RECOG_INSTANCE()',_0x9251('0xbf'));if(_0x249859[_0x9251('0x9e')]===-0x1){return _0x249859;}return this['channel']['noop'](util[_0x9251('0x25')](_0x9251('0xbc'),_0x562100));};AGIVertices[_0x9251('0x12')][_0x9251('0xc0')]=function(_0x27a646){logger[_0x9251('0x2a')](util['format']('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x27a646[_0x9251('0x33')]));if(!this[_0x9251('0x81')](_0x27a646[_0x9251('0xc1')])){return this[_0x9251('0xc')][_0x9251('0x28')](_0x27a646,_0x9251('0xc2'));}var _0x521936=this['getSquareOdbc'][_0x9251('0x71')](this,_0x27a646[_0x9251('0xc1')]);if(!_0x521936){return this['channel'][_0x9251('0x28')](_0x27a646,_0x9251('0xc3'));}if(!this['isConfigured'](_0x27a646['query'])){return this['channel'][_0x9251('0x28')](_0x27a646,'no\x20query\x20configured');}var _0x1d0957=_0x27a646['query'][_0x9251('0x55')](/(\r\n|\n|\r)/gm,'\x20');this[_0x9251('0xc')][_0x9251('0xab')](util[_0x9251('0x25')](_0x9251('0xc4'),_0x1d0957));var _0x329d09=this[_0x9251('0x26')]['sync'](this,_0x521936,_0x1d0957);this[_0x9251('0x31')][_0x9251('0x71')](this,_0x27a646,_0x1d0957);if(!this[_0x9251('0x81')](_0x27a646[_0x9251('0xc5')])){return this['channel'][_0x9251('0xab')](_0x9251('0xc6'));}var _0x45bf34=this[_0x9251('0xd')][_0x9251('0x71')](this,_0x27a646['variable_id']);if(!_0x45bf34){return this[_0x9251('0xc')][_0x9251('0x28')](_0x27a646,_0x9251('0xc7'));}var _0x612938=this;_0x329d09[_0x9251('0xc8')](function(_0x5d6ac9,_0x1878fb){Object[_0x9251('0xc9')](_0x5d6ac9)[_0x9251('0xc8')](function(_0x298a8b){_0x612938['channel']['setVariable'](util[_0x9251('0x25')](_0x9251('0xca'),_0x45bf34,_0x1878fb,_0x298a8b),_0x5d6ac9[_0x298a8b]);});});this['channel']['setVariable'](util[_0x9251('0x25')](_0x9251('0xcb'),_0x45bf34),_0x329d09[_0x9251('0x97')]);return this['channel'][_0x9251('0xab')](util['format'](_0x9251('0xcc'),_0x45bf34));};AGIVertices[_0x9251('0x12')]['dial']=function(_0x446091){logger['debug'](util[_0x9251('0x25')](_0x9251('0xcd'),_0x446091[_0x9251('0x33')]));if(!this[_0x9251('0x81')](_0x446091[_0x9251('0xce')])){return this['channel'][_0x9251('0x28')](_0x446091,'no\x20user\x20selected');}var _0x5b3c4a=this['getUser'][_0x9251('0x71')](this,_0x446091[_0x9251('0xce')]);if(!_0x5b3c4a){return this[_0x9251('0xc')][_0x9251('0x28')](_0x446091,_0x9251('0xcf'));}var _0x46e1d6=this[_0x9251('0xc')][_0x9251('0x53')](_0x9251('0xd0'),[util[_0x9251('0x25')](_0x9251('0xd1'),_0x5b3c4a),_0x446091[_0x9251('0x64')],_0x446091[_0x9251('0xd2')],_0x446091['url']]);if(_0x46e1d6[_0x9251('0x9e')]===-0x1){return _0x46e1d6;}return this['channel']['noop'](util[_0x9251('0x25')](_0x9251('0xd3'),_0x9251('0xd0')));};AGIVertices[_0x9251('0x12')][_0x9251('0xd4')]=function(_0x5d84ce){logger[_0x9251('0x2a')](util[_0x9251('0x25')](_0x9251('0xd5'),_0x5d84ce[_0x9251('0x33')]));if(!this[_0x9251('0x81')](_0x5d84ce[_0x9251('0x7c')])){return this['channel'][_0x9251('0xab')](_0x9251('0xd6'));}if(!this[_0x9251('0x81')](_0x5d84ce['text'])){return this[_0x9251('0xc')][_0x9251('0xab')](_0x9251('0xb2'));}this['channel'][_0x9251('0xd7')]=!![];this['createSquareDetailsReport'](_0x5d84ce);this[_0x9251('0x3e')](_0x5d84ce[_0x9251('0x59')],'in');this[_0x9251('0xc')]['noop'](util[_0x9251('0x25')](_0x9251('0xd8'),_0x5d84ce[_0x9251('0x59')]));var _0x28b88e=this['googleDialogflow']['sync'](this,_0x5d84ce);if(_0x28b88e){for(var _0x20a92b in _0x28b88e){if(_0x28b88e[_0x9251('0x90')](_0x20a92b)){this[_0x9251('0xc')][_0x9251('0x9f')](util[_0x9251('0x25')](_0x9251('0xd9'),_0x20a92b[_0x9251('0x69')]()),_0x28b88e[_0x20a92b]);}}this['createSquareMessage'](_0x28b88e[_0x9251('0xda')],_0x9251('0xdb'));return this['channel']['noop'](util['format']('Dialogflow\x20Result\x20%s',_0x28b88e[_0x9251('0xda')]));}return this[_0x9251('0xc')][_0x9251('0x28')](_0x5d84ce,_0x9251('0xdc'));};AGIVertices[_0x9251('0x12')][_0x9251('0xdd')]=function(_0x5c9c58){logger[_0x9251('0x2a')](util['format'](_0x9251('0xde'),_0x5c9c58[_0x9251('0x33')]));if(!this[_0x9251('0x81')](_0x5c9c58['ndauth_url'])){return this[_0x9251('0xc')]['noop'](_0x9251('0xdf'));}if(!this[_0x9251('0x81')](_0x5c9c58['username'])){return this['channel'][_0x9251('0xab')]('no\x20username\x20configured');}if(!this[_0x9251('0x81')](_0x5c9c58[_0x9251('0xe0')])){return this[_0x9251('0xc')][_0x9251('0xab')]('no\x20password\x20configured');}if(!this[_0x9251('0x81')](_0x5c9c58['ndassistant_url'])){return this[_0x9251('0xc')][_0x9251('0xab')](_0x9251('0xb2'));}this['channel'][_0x9251('0xd7')]=!![];this[_0x9251('0x31')](_0x5c9c58);this[_0x9251('0x3e')](_0x5c9c58[_0x9251('0x59')],'in');this['channel'][_0x9251('0xab')](util[_0x9251('0x25')]('Trying\x20SestekNDA:\x20%s',_0x5c9c58['text']));var _0x58cee9=this[_0x9251('0xe1')]['sync'](this,_0x5c9c58);if(_0x58cee9){for(var _0x3279f4 in _0x58cee9){if(_0x58cee9[_0x9251('0x90')](_0x3279f4)){this['channel'][_0x9251('0x9f')](util['format']('SESTEK_NDA_%s',_0x3279f4[_0x9251('0x69')]()),_0x58cee9[_0x3279f4]);}}this[_0x9251('0x3e')](_0x58cee9[_0x9251('0xda')],_0x9251('0xdb'));if(_0x58cee9[_0x9251('0xe2')]){this[_0x9251('0xc')][_0x9251('0xab')](util[_0x9251('0x25')](_0x9251('0xe3'),_0x58cee9[_0x9251('0xe2')]));var _0x18904f=this[_0x9251('0xc')][_0x9251('0xe4')](_0x58cee9[_0x9251('0xe2')]);try{fs[_0x9251('0xe5')](_0x58cee9[_0x9251('0xe2')]+_0x9251('0xe6'));}catch(_0x1d79e7){logger['error'](_0x1d79e7);}return _0x18904f;}else{return this[_0x9251('0xc')][_0x9251('0xab')](util[_0x9251('0x25')](_0x9251('0xe7'),_0x58cee9[_0x9251('0xda')]));}}return this[_0x9251('0xc')][_0x9251('0x28')](_0x5c9c58,_0x9251('0xe8'));};AGIVertices[_0x9251('0x12')][_0x9251('0xe9')]=function(_0x205276){logger[_0x9251('0x2a')](util['format']('Enter\x20in\x20END\x20(%s)\x20block',_0x205276[_0x9251('0x33')]));return this['channel']['noop']('end');};AGIVertices[_0x9251('0x12')][_0x9251('0xea')]=function(_0x33fa82){logger['info'](util[_0x9251('0x25')](_0x9251('0xeb'),_0x33fa82[_0x9251('0x33')]));var _0x34ab7a='';if(_0x33fa82[_0x9251('0xec')]){if(!this[_0x9251('0x81')](_0x33fa82['trunk_id'])){return this[_0x9251('0xc')][_0x9251('0x28')](_0x33fa82,'no\x20trunk\x20selected');}else{var _0x382d1e=parseInt(_0x33fa82[_0x9251('0xec')],0xa);if(isNaN(_0x382d1e)){_0x34ab7a=_0x33fa82[_0x9251('0xec')];}else{_0x34ab7a=this[_0x9251('0xed')][_0x9251('0x71')](this,_0x33fa82['trunk_id']);if(!_0x34ab7a){return this['channel'][_0x9251('0x28')](_0x33fa82,_0x9251('0xee'));}}}}else if(_0x33fa82[_0x9251('0xef')]){_0x34ab7a=_0x33fa82[_0x9251('0xef')];}else{return this[_0x9251('0xc')][_0x9251('0x28')](_0x33fa82,'no\x20trunk\x20selected');}var _0x3645f3=this['channel'][_0x9251('0x53')]('DIAL',[util['format'](_0x9251('0xf0'),_0x34ab7a,_0x33fa82['phone']),_0x33fa82[_0x9251('0x64')],_0x33fa82[_0x9251('0xd2')],_0x33fa82['url']]);if(_0x3645f3[_0x9251('0x9e')]===-0x1){return _0x3645f3;}return this['channel']['noop'](util[_0x9251('0x25')]('Executed\x20command\x20%s',_0x9251('0xd0')));};AGIVertices['prototype'][_0x9251('0xf1')]=function(_0x29c270){logger[_0x9251('0x2a')](util['format']('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x29c270['label']));return this[_0x9251('0xc')][_0x9251('0xab')](_0x9251('0xf1'));};AGIVertices[_0x9251('0x12')]['getdigits']=function(_0x19faa6){logger[_0x9251('0x2a')](util[_0x9251('0x25')](_0x9251('0xf2'),_0x19faa6['label']));if(_0x19faa6['retry']===0x0){return this[_0x9251('0xa0')](_0x19faa6);}_0x19faa6['retry']-=0x1;if(!this[_0x9251('0x81')](_0x19faa6['file_id'])){return this['channel'][_0x9251('0x28')](_0x19faa6,'no\x20file\x20audio\x20selected');}var _0x42ec7e=this[_0x9251('0xf3')][_0x9251('0x71')](this,_0x19faa6[_0x9251('0xf4')]);if(!_0x42ec7e){return this[_0x9251('0xc')]['error'](_0x19faa6,_0x9251('0xf5'));}if(!this[_0x9251('0x81')](_0x19faa6[_0x9251('0xc5')])){return this[_0x9251('0xc')]['error'](_0x9251('0xc6'));}var _0x359d0e=this['channel'][_0x9251('0xf6')](_0x42ec7e,_0x19faa6[_0x9251('0xf7')],_0x19faa6['maxdigit']);var _0x607120=_0x359d0e[_0x9251('0x9e')]?_0x359d0e[_0x9251('0x9e')][_0x9251('0x9c')]():'';logger[_0x9251('0x2a')](_0x9251('0xf8'),JSON[_0x9251('0x74')](_0x359d0e));if(_0x359d0e[_0x9251('0x9e')]===-0x1){this[_0x9251('0x31')][_0x9251('0x71')](this,_0x19faa6,_0x607120);return _0x359d0e;}else if(_0x359d0e[_0x9251('0x9b')]===_0x9251('0x64')){_0x359d0e[_0x9251('0x9e')]=_0x607120['length']>=parseInt(_0x19faa6[_0x9251('0xf9')])?'x':'i';}else{_0x359d0e[_0x9251('0x9e')]=_0x607120[_0x9251('0x97')]>=parseInt(_0x19faa6[_0x9251('0xf9')])&&_0x607120[_0x9251('0x97')]<=parseInt(_0x19faa6[_0x9251('0xfa')])?'x':'i';}var _0x1be9f6=this[_0x9251('0xd')][_0x9251('0x71')](this,_0x19faa6[_0x9251('0xc5')]);if(!_0x1be9f6){return this[_0x9251('0xc')][_0x9251('0x28')](_0x19faa6,'no\x20variable\x20found');}this[_0x9251('0xc')][_0x9251('0x9f')](_0x1be9f6,_0x607120);if(this['isConfigured'](_0x19faa6['hiddendigitsnum'])){var _0x2743d2=parseInt(_0x19faa6['hiddendigitsnum'],0xa);var _0x24d705=rs[_0x9251('0xfb')]({'charset':'*','length':_0x2743d2});var _0x2e0891=_0x607120[_0x9251('0x97')];if(_0x2e0891>0x0){if(_0x2e0891>_0x2743d2){this[_0x9251('0x31')]['sync'](this,_0x19faa6,_0x19faa6[_0x9251('0xfc')]==='first'?_0x24d705+_0x607120[_0x9251('0xfd')](_0x2743d2):_0x607120[_0x9251('0xfd')](0x0,_0x2e0891-_0x2743d2)+_0x24d705);}else{this['createSquareDetailsReport']['sync'](this,_0x19faa6,rs[_0x9251('0xfb')]({'charset':'*','length':_0x2e0891}));}}else{this[_0x9251('0x31')][_0x9251('0x71')](this,_0x19faa6,'');}}else{this[_0x9251('0x31')][_0x9251('0x71')](this,_0x19faa6,_0x607120);}return _0x359d0e;};AGIVertices[_0x9251('0x12')][_0x9251('0xb')]=function(_0x9d65fa){logger[_0x9251('0x2a')](util[_0x9251('0x25')](_0x9251('0xfe'),_0x9d65fa[_0x9251('0x33')]));return this[_0x9251('0xa')](_0x9d65fa);};AGIVertices[_0x9251('0x12')][_0x9251('0xff')]=function(_0x16eddd){logger[_0x9251('0x2a')](util['format']('Enter\x20in\x20GOAL\x20(%s)\x20block',_0x16eddd[_0x9251('0x33')]));this[_0x9251('0x31')][_0x9251('0x71')](this,_0x16eddd,_0x16eddd[_0x9251('0x100')]);return this[_0x9251('0xc')][_0x9251('0xab')](util[_0x9251('0x25')]('GOAL\x20%s',_0x16eddd[_0x9251('0x100')]));};AGIVertices[_0x9251('0x12')][_0x9251('0x101')]=function(_0x3e0979){logger['info'](util[_0x9251('0x25')](_0x9251('0x102'),_0x3e0979['label']));if(!this['isConfigured'](_0x3e0979[_0x9251('0x83')])||!this[_0x9251('0x81')](_0x3e0979[_0x9251('0x89')])){return this[_0x9251('0xc')][_0x9251('0xab')](_0x9251('0x103'));}if(!this['isConfigured'](_0x3e0979[_0x9251('0x59')])){return this[_0x9251('0xc')][_0x9251('0xab')](_0x9251('0xb2'));}this[_0x9251('0xc')]['noop'](util[_0x9251('0x25')]('Trying\x20aws\x20Polly\x20%s',_0x3e0979[_0x9251('0x59')]));var _0x3129c6=this[_0x9251('0x104')][_0x9251('0x71')](this,_0x3e0979);if(_0x3129c6){this[_0x9251('0xc')]['noop'](util[_0x9251('0x25')](_0x9251('0x105'),_0x3129c6));var _0x55e535=this[_0x9251('0xc')][_0x9251('0xe4')](_0x3129c6);try{fs[_0x9251('0xe5')](_0x3129c6+'.wav');}catch(_0x292ce5){logger['error'](_0x292ce5);}return _0x55e535;}return this['channel'][_0x9251('0x28')](_0x3e0979,'aws\x20Polly\x20is\x20unreachable');};AGIVertices[_0x9251('0x12')]['awslex']=function(_0x5d25e2){logger[_0x9251('0x2a')](util[_0x9251('0x25')](_0x9251('0x106'),_0x5d25e2[_0x9251('0x33')]));if(!this[_0x9251('0x81')](_0x5d25e2[_0x9251('0x83')])||!this[_0x9251('0x81')](_0x5d25e2[_0x9251('0x89')])){return this[_0x9251('0xc')][_0x9251('0xab')]('no\x20valid\x20credentials\x20configured');}if(!this[_0x9251('0x81')](_0x5d25e2[_0x9251('0x8a')])){return this[_0x9251('0xc')][_0x9251('0xab')]('no\x20bot\x20name\x20configured');}if(!this[_0x9251('0x81')](_0x5d25e2['text'])){return this[_0x9251('0xc')][_0x9251('0xab')](_0x9251('0xb2'));}this[_0x9251('0xc')][_0x9251('0xd7')]=!![];this['createSquareDetailsReport'](_0x5d25e2);this[_0x9251('0x3e')](_0x5d25e2['text'],'in');this[_0x9251('0xc')][_0x9251('0xab')](util[_0x9251('0x25')](_0x9251('0x107'),_0x5d25e2[_0x9251('0x59')]));var _0x211138=this['awsLex'][_0x9251('0x71')](this,_0x5d25e2);if(_0x211138){for(var _0x4d644d in _0x211138){if(_0x211138[_0x9251('0x90')](_0x4d644d)&&_[_0x9251('0x91')](_0x211138[_0x4d644d])){this[_0x9251('0xc')][_0x9251('0x9f')](util[_0x9251('0x25')]('AWS_LEX_%s',_0x4d644d[_0x9251('0x69')]()),_0x211138[_0x4d644d]);}}if(_[_0x9251('0x41')](_0x211138[_0x9251('0x77')])){return this[_0x9251('0xc')][_0x9251('0xab')](_0x9251('0x108'));}else{this[_0x9251('0x3e')](_0x211138[_0x9251('0x77')],'out');return this[_0x9251('0xc')][_0x9251('0xab')](util['format'](_0x9251('0x109'),_0x211138[_0x9251('0x77')]));}}return this['channel'][_0x9251('0x28')](_0x5d25e2,_0x9251('0x10a'));};AGIVertices['prototype']['googleasr']=function(_0x18cc95){logger['info'](util['format']('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0x18cc95[_0x9251('0x33')],_0x18cc95[_0x9251('0x64')]));if(!this[_0x9251('0x81')](_0x18cc95['key'])){return this['channel'][_0x9251('0xab')]('no\x20key\x20configured');}var _0x5950e4='wav';var _0x3f0c62=util[_0x9251('0x25')]('%s/recordings/%s',FILES_PATH,rs['generate'](0x4));var _0x43bd45=util[_0x9251('0x25')](_0x9251('0x98'),_0x3f0c62,_0x5950e4);var _0x2b7cf3=!![];if(_0x18cc95[_0x9251('0x10b')]===_0x9251('0x10c')){_0x2b7cf3=![];}var _0x121aca=this['channel'][_0x9251('0x10d')](_0x3f0c62,_0x5950e4,_0x18cc95[_0x9251('0x10e')],_0x18cc95[_0x9251('0x64')],undefined,_0x2b7cf3);if(_0x121aca[_0x9251('0x9e')]!==-0x1){this[_0x9251('0xc')][_0x9251('0xab')](util['format']('google\x20%s\x20file\x20created',_0x43bd45));var _0x232e33=this[_0x9251('0x8b')][_0x9251('0x71')](this,_0x18cc95,_0x43bd45);if(_0x232e33){for(var _0x5e5e08 in _0x232e33){if(_0x232e33['hasOwnProperty'](_0x5e5e08)){this[_0x9251('0xc')][_0x9251('0x9f')](util[_0x9251('0x25')]('GOOGLE_ASR_%s',_0x5e5e08[_0x9251('0x69')]()),_0x232e33[_0x5e5e08]);}}return this['channel']['noop'](util[_0x9251('0x25')](_0x9251('0x10f'),JSON['stringify'](_0x232e33)));}}return _0x121aca;};AGIVertices['prototype'][_0x9251('0x110')]=function(_0x7d2e02){logger[_0x9251('0x2a')](util['format'](_0x9251('0x111'),_0x7d2e02[_0x9251('0x33')]));if(!this['isConfigured'](_0x7d2e02['appid'])){return this[_0x9251('0xc')]['noop'](_0x9251('0x112'));}if(!this[_0x9251('0x81')](_0x7d2e02[_0x9251('0x8e')])){return this['channel'][_0x9251('0xab')](_0x9251('0x113'));}var _0x2ba5a4='wav';var _0x5b4b67=util[_0x9251('0x25')](_0x9251('0x114'),FILES_PATH,rs[_0x9251('0xfb')](0x4));var _0x461187=util[_0x9251('0x25')](_0x9251('0x98'),_0x5b4b67,_0x2ba5a4);var _0x8bb25d=!![];if(_0x7d2e02['beep']===_0x9251('0x10c')){_0x8bb25d=![];}var _0x2538ad=this[_0x9251('0xc')]['recordFile'](_0x5b4b67,_0x2ba5a4,_0x7d2e02[_0x9251('0x10e')],_0x7d2e02['timeout'],undefined,_0x8bb25d);if(_0x2538ad[_0x9251('0x9e')]!==-0x1){this[_0x9251('0xc')]['noop'](util[_0x9251('0x25')](_0x9251('0x115'),_0x461187));var _0x36f4b5=this['tildeASR'][_0x9251('0x71')](this,_0x7d2e02,_0x461187);if(_0x36f4b5){for(var _0x41b9f9 in _0x36f4b5){if(_0x36f4b5[_0x9251('0x90')](_0x41b9f9)){this[_0x9251('0xc')]['setVariable'](util[_0x9251('0x25')](_0x9251('0x116'),_0x41b9f9[_0x9251('0x69')]()),_0x36f4b5[_0x41b9f9]);}}return this['channel'][_0x9251('0xab')](util[_0x9251('0x25')](_0x9251('0x117'),JSON['stringify'](_0x36f4b5)));}}return _0x2538ad;};AGIVertices[_0x9251('0x12')]['gotoc']=function(_0xa4e1a0){logger[_0x9251('0x2a')](util[_0x9251('0x25')](_0x9251('0x118'),_0xa4e1a0['label']));return this['channel'][_0x9251('0x119')](_0xa4e1a0[_0x9251('0x11a')],_0xa4e1a0[_0x9251('0x39')],_0xa4e1a0['priority']);};AGIVertices[_0x9251('0x12')]['gotoif']=function(_0x30be00){logger['info'](util[_0x9251('0x25')](_0x9251('0x11b'),_0x30be00[_0x9251('0x33')]));if(!this[_0x9251('0x81')](_0x30be00[_0x9251('0x11c')])){return this[_0x9251('0xc')][_0x9251('0x28')](_0x30be00,'no\x20condition\x20configured');}try{var _0x207449=eval(_0x30be00['condition'])?'true':_0x9251('0x11d');this[_0x9251('0xc')][_0x9251('0xab')](util['format'](_0x9251('0x11e'),_0x30be00[_0x9251('0x11c')],_0x207449));return{'code':0xc8,'result':_0x207449};}catch(_0x4c4d11){return{'code':0xc8,'result':_0x9251('0x11d')};}};AGIVertices[_0x9251('0x12')][_0x9251('0x11f')]=function(_0x543a47){logger['info'](util[_0x9251('0x25')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x543a47[_0x9251('0x33')]));if(!this[_0x9251('0x81')](_0x543a47[_0x9251('0x120')])){return this[_0x9251('0xc')][_0x9251('0x28')](_0x543a47,_0x9251('0x121'));}var _0x51193c=this[_0x9251('0x20')]['sync'](this,_0x543a47[_0x9251('0x120')]);if(!_0x51193c){return this['channel'][_0x9251('0x28')](_0x543a47,_0x9251('0x122'));}for(var _0x56dbc4=0x0;_0x56dbc4<_0x51193c[_0x9251('0x97')];_0x56dbc4+=0x1){var _0x4c0f3e=this[_0x9251('0xc')]['getVariable'](util[_0x9251('0x25')](_0x9251('0x123'),_0x51193c[_0x56dbc4]));if(_0x4c0f3e['result']===-0x1){return _0x4c0f3e;}logger[_0x9251('0x2a')](util[_0x9251('0x25')](_0x9251('0x124'),_0x51193c[_0x56dbc4],_0x4c0f3e[_0x9251('0x9b')]));if(_0x4c0f3e[_0x9251('0x9b')]===_0x9251('0x125')){logger[_0x9251('0x2a')](util[_0x9251('0x25')](_0x9251('0x124'),_0x51193c[_0x56dbc4],_0x9251('0x125')));this[_0x9251('0xc')][_0x9251('0xab')](util[_0x9251('0x25')](_0x9251('0x124'),_0x51193c[_0x56dbc4],_0x9251('0x125')));return{'code':0xc8,'result':_0x9251('0x125')};}else{logger[_0x9251('0x2a')](util[_0x9251('0x25')](_0x9251('0x124'),_0x51193c[_0x56dbc4],_0x9251('0x11d')));this[_0x9251('0xc')][_0x9251('0xab')](util['format']('IFTIME\x20%s\x20%s',_0x51193c[_0x56dbc4],_0x9251('0x11d')));}}return{'code':0xc8,'result':'false'};};AGIVertices[_0x9251('0x12')][_0x9251('0x126')]=function(_0x42f57a){logger['info'](util[_0x9251('0x25')]('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x42f57a[_0x9251('0x33')]));return this[_0x9251('0xc')]['hangup']();};AGIVertices[_0x9251('0x12')][_0x9251('0x127')]=function(_0x8814f){logger[_0x9251('0x2a')](util[_0x9251('0x25')](_0x9251('0x128'),_0x8814f[_0x9251('0x33')]));if(!this[_0x9251('0x81')](_0x8814f['key'])){return this['channel'][_0x9251('0xab')]('no\x20key\x20configured');}var _0x1b6745=_0x9251('0x129');var _0x10a067=util['format'](_0x9251('0x114'),FILES_PATH,rs['generate'](0x4));var _0x331828=util['format']('%s.%s',_0x10a067,_0x1b6745);var _0x2d977a=!![];if(_0x8814f[_0x9251('0x10b')]==='NOBEEP'){_0x2d977a=![];}var _0x32fb8a=this[_0x9251('0xc')][_0x9251('0x10d')](_0x10a067,_0x1b6745,_0x8814f[_0x9251('0x10e')],_0x8814f['timeout'],undefined,_0x2d977a);if(_0x32fb8a[_0x9251('0x9e')]!==-0x1){this[_0x9251('0xc')]['noop'](util[_0x9251('0x25')](_0x9251('0x12a'),_0x331828));var _0x107dac=this[_0x9251('0x7f')][_0x9251('0x71')](this,_0x8814f,_0x331828);if(_0x107dac){for(var _0x2a4deb in _0x107dac){if(_0x107dac[_0x9251('0x90')](_0x2a4deb)){this['channel'][_0x9251('0x9f')](util['format'](_0x9251('0x12b'),_0x2a4deb[_0x9251('0x69')]()),_0x107dac[_0x2a4deb]);}}return this[_0x9251('0xc')][_0x9251('0xab')](util['format'](_0x9251('0x12c'),JSON['stringify'](_0x107dac)));}}return _0x32fb8a;};AGIVertices[_0x9251('0x12')]['ispeechtts']=function(_0x5e23c9){logger[_0x9251('0x2a')](util[_0x9251('0x25')](_0x9251('0x12d'),_0x5e23c9[_0x9251('0x33')]));if(!this[_0x9251('0x81')](_0x5e23c9['key'])){return this[_0x9251('0xc')]['noop'](_0x9251('0xd6'));}if(!this[_0x9251('0x81')](_0x5e23c9[_0x9251('0x59')])){return this[_0x9251('0xc')][_0x9251('0xab')]('no\x20text\x20configured');}this['channel']['noop'](util[_0x9251('0x25')](_0x9251('0x12e'),_0x5e23c9[_0x9251('0x59')]));var _0x573c9e=this['ispeechTTS']['sync'](this,_0x5e23c9);if(_0x573c9e){this[_0x9251('0xc')][_0x9251('0xab')](util[_0x9251('0x25')](_0x9251('0x12a'),_0x573c9e));var _0x8a878b=this[_0x9251('0xc')][_0x9251('0xe4')](_0x573c9e,_0x5e23c9[_0x9251('0x10e')]);try{fs[_0x9251('0xe5')](_0x573c9e+'.wav');}catch(_0x5f13e1){logger[_0x9251('0x28')](_0x5f13e1);}return _0x8a878b;}return this[_0x9251('0xc')]['error'](_0x5e23c9,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices['prototype'][_0x9251('0x12f')]=function(_0x5cf5e4){logger[_0x9251('0x2a')](util[_0x9251('0x25')](_0x9251('0x130'),_0x5cf5e4[_0x9251('0x33')]));if(!this[_0x9251('0x81')](_0x5cf5e4[_0x9251('0x131')])){return this['channel']['error'](_0x5cf5e4,_0x9251('0x132'));}logger[_0x9251('0x2a')](util[_0x9251('0x25')](_0x9251('0x133'),this[_0x9251('0xc')][_0x9251('0x36')],_0x5cf5e4[_0x9251('0x131')]));var _0x1e802e=this[_0x9251('0x51')][_0x9251('0x71')](this,_0x5cf5e4[_0x9251('0x131')]);if(_0x1e802e){logger[_0x9251('0x2a')](util[_0x9251('0x25')](_0x9251('0x134'),this[_0x9251('0xc')][_0x9251('0x36')],_0x5cf5e4[_0x9251('0x131')]));this[_0x9251('0xc')]['noop'](util[_0x9251('0x25')](_0x9251('0x134'),this[_0x9251('0xc')][_0x9251('0x36')],_0x5cf5e4[_0x9251('0x131')]));return{'code':0xc8,'result':_0x9251('0x135')};}else{logger[_0x9251('0x2a')](util[_0x9251('0x25')](_0x9251('0x136'),this[_0x9251('0xc')][_0x9251('0x36')],_0x5cf5e4['findBy']));this['channel'][_0x9251('0xab')](util[_0x9251('0x25')](_0x9251('0x136'),this[_0x9251('0xc')][_0x9251('0x36')],_0x5cf5e4[_0x9251('0x131')]));return{'code':0xc8,'result':_0x9251('0x137')};}};AGIVertices[_0x9251('0x12')][_0x9251('0x138')]=function(_0x41fcf1){logger['info'](util['format'](_0x9251('0x139'),_0x41fcf1['label']));if(!this['isConfigured'](_0x41fcf1['findBy'])){return this[_0x9251('0xc')][_0x9251('0x28')](_0x41fcf1,_0x9251('0x132'));}logger[_0x9251('0x2a')](util[_0x9251('0x25')](_0x9251('0x133'),this[_0x9251('0xc')]['callerid'],_0x41fcf1['findBy']));var _0x112db6=this[_0x9251('0x4e')][_0x9251('0x71')](this,_0x41fcf1[_0x9251('0x131')]);if(_0x112db6){logger[_0x9251('0x2a')](util[_0x9251('0x25')](_0x9251('0x134'),this[_0x9251('0xc')]['callerid'],_0x41fcf1[_0x9251('0x131')]));this[_0x9251('0xc')][_0x9251('0xab')](util[_0x9251('0x25')](_0x9251('0x134'),this['channel'][_0x9251('0x36')],_0x41fcf1[_0x9251('0x131')]));return{'code':0xc8,'result':'success'};}else{logger['info'](util[_0x9251('0x25')](_0x9251('0x136'),this[_0x9251('0xc')][_0x9251('0x36')],_0x41fcf1[_0x9251('0x131')]));this[_0x9251('0xc')][_0x9251('0xab')](util['format'](_0x9251('0x136'),this[_0x9251('0xc')][_0x9251('0x36')],_0x41fcf1[_0x9251('0x131')]));return{'code':0xc8,'result':_0x9251('0x137')};}};AGIVertices[_0x9251('0x12')]['math']=function(_0x2f98d8){logger['info'](util[_0x9251('0x25')](_0x9251('0x13a'),_0x2f98d8[_0x9251('0x33')]));if(!this[_0x9251('0x81')](_0x2f98d8['operation'])){return this['channel']['error'](_0x2f98d8,'no\x20operation\x20configured');}this[_0x9251('0xc')]['noop'](util['format'](_0x9251('0x13b'),_0x2f98d8['operation']));var _0x126b9c=eval(_0x2f98d8[_0x9251('0x13c')]);if(!this[_0x9251('0x81')](_0x2f98d8[_0x9251('0xc5')])){return this['channel']['noop']('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x2e2ccc=this[_0x9251('0xd')][_0x9251('0x71')](this,_0x2f98d8[_0x9251('0xc5')]);if(!_0x2e2ccc){return this[_0x9251('0xc')][_0x9251('0x28')](_0x2f98d8,_0x9251('0xc7'));}if(_[_0x9251('0x95')](_0x126b9c)){var _0x55e71d=this;_0x126b9c[_0x9251('0xc8')](function(_0x29903b,_0x439c58){_0x55e71d['channel']['setVariable'](util['format'](_0x9251('0x13d'),_0x2e2ccc,_0x439c58),_0x29903b);});return this[_0x9251('0xc')][_0x9251('0xab')](util[_0x9251('0x25')](_0x9251('0x13e'),_0x2e2ccc));}else{return this[_0x9251('0xc')]['setVariable'](_0x2e2ccc,_0x126b9c);}};AGIVertices[_0x9251('0x12')][_0x9251('0x9')]=function(_0x334c73){logger['info'](util['format']('Enter\x20in\x20MENU\x20(%s)\x20block',_0x334c73[_0x9251('0x33')]));if(_0x334c73[_0x9251('0x13f')]===0x0){return this['maxRetry'](_0x334c73);}_0x334c73[_0x9251('0x13f')]-=0x1;if(!this[_0x9251('0x81')](_0x334c73[_0x9251('0xf4')])){return this[_0x9251('0xc')]['error'](_0x334c73,'no\x20file\x20audio\x20selected');}var _0xd1428b=this[_0x9251('0xf3')][_0x9251('0x71')](this,_0x334c73[_0x9251('0xf4')]);if(!_0xd1428b){return this['channel'][_0x9251('0x28')](_0x334c73,_0x9251('0xf5'));}var _0x1e5258=this[_0x9251('0xc')][_0x9251('0xf6')](_0xd1428b,_0x334c73[_0x9251('0xf7')],_0x334c73[_0x9251('0x140')]);var _0x511f8d=_0x1e5258[_0x9251('0x9e')];if(_0x1e5258['result']===-0x1){this[_0x9251('0x31')]['sync'](this,_0x334c73,'-1');return _0x1e5258;}else if(_0x1e5258[_0x9251('0x9b')]==='timeout'){_0x1e5258[_0x9251('0x9e')]=_0x1e5258[_0x9251('0x9e')][_0x9251('0x97')]>0x0?_0x1e5258[_0x9251('0x9e')]:'t';}else if(_[_0x9251('0x40')](_0x1e5258[_0x9251('0x9e')])){_0x1e5258[_0x9251('0x9e')]='#';_0x511f8d='#';}if(!this[_0x9251('0x81')](_0x334c73[_0x9251('0xc5')])){this[_0x9251('0xc')][_0x9251('0xab')](_0x9251('0xc6'));}else{var _0x269d9a=this['getVariable']['sync'](this,_0x334c73[_0x9251('0xc5')]);if(!_0x269d9a){return this[_0x9251('0xc')][_0x9251('0x28')](_0x334c73,'no\x20variable\x20found');}this['channel'][_0x9251('0x9f')](_0x269d9a,_0x511f8d);}this['createSquareDetailsReport'][_0x9251('0x71')](this,_0x334c73,_0x511f8d);return _0x1e5258;};AGIVertices[_0x9251('0x12')]['noop']=function(_0x16fc1d){logger['info'](util[_0x9251('0x25')](_0x9251('0x141'),_0x16fc1d[_0x9251('0x33')]));return this[_0x9251('0xc')][_0x9251('0xab')](_0x16fc1d[_0x9251('0x142')]||_0x16fc1d['label']);};AGIVertices[_0x9251('0x12')][_0x9251('0x143')]=function(_0x4875ca){logger[_0x9251('0x2a')](util['format'](_0x9251('0x144'),_0x4875ca[_0x9251('0x33')]));if(!this[_0x9251('0x81')](_0x4875ca['findBy'])){return this[_0x9251('0xc')][_0x9251('0x28')](_0x4875ca,_0x9251('0x132'));}logger[_0x9251('0x2a')](util[_0x9251('0x25')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel'][_0x9251('0x36')],_0x4875ca['findBy']));var _0x4027a6=this[_0x9251('0x4a')]['sync'](this,_0x4875ca[_0x9251('0x145')]);var _0x11ad09=this[_0x9251('0x4b')]['sync'](this,_0x4875ca[_0x9251('0x131')],_0x4027a6);if(_0x11ad09){logger['info'](util['format'](_0x9251('0x134'),this[_0x9251('0xc')][_0x9251('0x36')],_0x4875ca['findBy']));this[_0x9251('0xc')][_0x9251('0xab')](util[_0x9251('0x25')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x9251('0xc')][_0x9251('0x36')],_0x4875ca[_0x9251('0x131')]));return{'code':0xc8,'result':_0x9251('0x135')};}else{logger[_0x9251('0x2a')](util[_0x9251('0x25')](_0x9251('0x136'),this['channel']['callerid'],_0x4875ca[_0x9251('0x131')]));this[_0x9251('0xc')][_0x9251('0xab')](util[_0x9251('0x25')](_0x9251('0x134'),this[_0x9251('0xc')][_0x9251('0x36')],_0x4875ca[_0x9251('0x131')]));return{'code':0xc8,'result':_0x9251('0x137')};}};AGIVertices['prototype'][_0x9251('0x146')]=function(_0x49015b){logger['info'](util[_0x9251('0x25')](_0x9251('0x147'),_0x49015b[_0x9251('0x33')]));if(!this['isConfigured'](_0x49015b[_0x9251('0xf4')])){return this[_0x9251('0xc')][_0x9251('0x28')](_0x49015b,_0x9251('0x148'));}var _0x94d90c=this[_0x9251('0xf3')][_0x9251('0x71')](this,_0x49015b[_0x9251('0xf4')]);if(!_0x94d90c){return this[_0x9251('0xc')][_0x9251('0x28')](_0x49015b,'no\x20file\x20audio\x20found');}var _0x34a6a7=this[_0x9251('0xc')][_0x9251('0x53')]('PLAYBACK',[_0x94d90c,_0x49015b[_0x9251('0xd2')]]);if(_0x34a6a7[_0x9251('0x9e')]===-0x1){return _0x34a6a7;}return this['channel'][_0x9251('0xab')](util['format'](_0x9251('0x149'),'PLAYBACK',_0x94d90c));};AGIVertices['prototype'][_0x9251('0x14a')]=function(_0xbf50d7){logger[_0x9251('0x2a')](util['format'](_0x9251('0x14b'),_0xbf50d7[_0x9251('0x33')]));if(!this['isConfigured'](_0xbf50d7[_0x9251('0x14c')])){return this[_0x9251('0xc')][_0x9251('0x28')](_0xbf50d7,'no\x20queue\x20selected');}var _0x229cb8='';var _0x45674f=parseInt(_0xbf50d7[_0x9251('0x14c')],0xa);if(isNaN(_0x45674f)){_0x229cb8=_0xbf50d7[_0x9251('0x14c')];}else{_0x229cb8=this['getVoiceQueue'][_0x9251('0x71')](this,_0xbf50d7['queue_id']);if(!_0x229cb8){return this[_0x9251('0xc')][_0x9251('0x28')](_0xbf50d7,_0x9251('0x14d'));}}var _0x196e7c='';if(this['isConfigured'](_0xbf50d7[_0x9251('0xf4')])){var _0xfdd847=this[_0x9251('0xf3')][_0x9251('0x71')](this,_0xbf50d7[_0x9251('0xf4')]);if(_0xfdd847){_0x196e7c=_0xfdd847;}}this['createSquareDetailsReport'][_0x9251('0x71')](this,_0xbf50d7,_0x229cb8);if(_0xbf50d7[_0x9251('0xd2')][_0x9251('0x14e')]('x')<0x0){_0xbf50d7[_0x9251('0xd2')]+='x';}if(_0xbf50d7[_0x9251('0xd2')][_0x9251('0x14e')]('X')<0x0){_0xbf50d7[_0x9251('0xd2')]+='X';}this['channel'][_0x9251('0x9f')](_0x9251('0x14f'),_0x229cb8?_0x229cb8[_0x9251('0x150')]():'');var _0x55f8ba=this[_0x9251('0xc')][_0x9251('0x53')](_0x9251('0x151'),[_0x229cb8,_0xbf50d7[_0x9251('0xd2')],_0xbf50d7[_0x9251('0x62')],_0x196e7c,_0xbf50d7[_0x9251('0x64')],_0xbf50d7['agi'],_0xbf50d7['macro'],_0xbf50d7[_0x9251('0x152')],'',_0xbf50d7['position']]);if(_0x55f8ba[_0x9251('0x9e')]===-0x1){return _0x55f8ba;}return this[_0x9251('0xc')][_0x9251('0xab')](util['format'](_0x9251('0x149'),_0x9251('0x151'),_0x229cb8));};AGIVertices['prototype'][_0x9251('0x153')]=function(_0x55573d){logger['info'](util[_0x9251('0x25')](_0x9251('0x154'),_0x55573d[_0x9251('0x33')]));var _0xe3c8dc=_0x55573d[_0x9251('0x155')]||'wav';var _0x54687c=util[_0x9251('0x25')](_0x9251('0x156'),this['channel'][_0x9251('0x32')],rs[_0x9251('0xfb')](0x5));var _0x532046=util[_0x9251('0x25')](_0x9251('0x157'),FILES_PATH,_0x54687c,_0xe3c8dc);var _0x1fd232=util[_0x9251('0x25')](_0x9251('0x114'),FILES_PATH,_0x54687c);this['createSquareRecording'][_0x9251('0x71')](this,_0x55573d,_0x54687c,_0x532046);this['channel'][_0x9251('0x9f')](_0x9251('0x158'),_0x54687c);logger[_0x9251('0x2a')](_0x9251('0x159'),_0x1fd232,_0xe3c8dc,_0x55573d[_0x9251('0x15a')],_0x55573d[_0x9251('0x64')]);return this[_0x9251('0xc')]['recordFile'](_0x1fd232,_0xe3c8dc,_0x55573d[_0x9251('0x15a')],_0x55573d[_0x9251('0x64')],undefined,!![]);};AGIVertices[_0x9251('0x12')][_0x9251('0x15b')]=function(_0x5d40d3){logger[_0x9251('0x2a')](util[_0x9251('0x25')](_0x9251('0x15c'),_0x5d40d3[_0x9251('0x33')]));if(!this[_0x9251('0x81')](_0x5d40d3[_0x9251('0x62')])){return this['channel']['noop'](_0x9251('0x15d'));}var _0x5795ab=this[_0x9251('0x61')]['sync'](this,_0x5d40d3);logger[_0x9251('0x2a')](util[_0x9251('0x25')]('Response:',util['inspect'](_0x5795ab,{'showHidden':![],'depth':null})));if(!this[_0x9251('0x81')](_0x5d40d3[_0x9251('0xc5')])){return this['channel']['noop'](_0x9251('0x15e'));}var _0x119a41=this[_0x9251('0xd')][_0x9251('0x71')](this,_0x5d40d3[_0x9251('0xc5')]);if(!_0x119a41){return this[_0x9251('0xc')][_0x9251('0x28')](_0x5d40d3,_0x9251('0xc7'));}this['channel'][_0x9251('0x9f')](util[_0x9251('0x25')]('%s_STATUS_CODE',_0x119a41),_0x5795ab[_0x9251('0x76')]?_0x5795ab['statusCode']:'200');this[_0x9251('0xc')][_0x9251('0x9f')](util[_0x9251('0x25')](_0x9251('0x15f'),_0x119a41),_0x5795ab['statusMessage']?_0x5795ab['statusMessage']:'OK');if(_0x5795ab['body']){try{this[_0x9251('0x96')](_0x5795ab[_0x9251('0x6a')],_0x119a41);}catch(_0x249e76){logger['error'](util['format']('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x119a41));}}return this['channel'][_0x9251('0xab')](util[_0x9251('0x25')]('variable\x20%s\x20set',_0x119a41));};AGIVertices['prototype'][_0x9251('0x160')]=function(_0x5f5574){logger[_0x9251('0x2a')](util[_0x9251('0x25')](_0x9251('0x161'),_0x5f5574[_0x9251('0x33')]));return this['channel']['sayDigits'](_0x5f5574[_0x9251('0x162')][_0x9251('0x55')](/\s+/g,''),_0x5f5574[_0x9251('0x15a')]);};AGIVertices[_0x9251('0x12')]['saynumber']=function(_0x142993){logger['info'](util[_0x9251('0x25')](_0x9251('0x163'),_0x142993[_0x9251('0x33')]));return this[_0x9251('0xc')][_0x9251('0x164')](_0x142993[_0x9251('0x65')][_0x9251('0x55')](/\s+/g,''),_0x142993[_0x9251('0x15a')]);};AGIVertices['prototype'][_0x9251('0x165')]=function(_0x239676){logger[_0x9251('0x2a')](util[_0x9251('0x25')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x239676['label']));return this[_0x9251('0xc')][_0x9251('0x166')](_0x239676[_0x9251('0x59')],_0x239676[_0x9251('0x15a')]);};AGIVertices[_0x9251('0x12')]['sendMail']=function(_0x5105c4){logger['info'](util['format'](_0x9251('0x167'),_0x5105c4[_0x9251('0x33')]));if(!this[_0x9251('0x81')](_0x5105c4['account_id'])){return this[_0x9251('0xc')][_0x9251('0xab')]('no\x20mail\x20account\x20configured');}var _0x49123c=this[_0x9251('0x1e')][_0x9251('0x71')](this,_0x5105c4[_0x9251('0x168')]);if(!_0x49123c||!_0x49123c[_0x9251('0x169')]){return this[_0x9251('0xc')][_0x9251('0x28')](_0x5105c4,_0x9251('0x16a'));}var _0x5cbbc8={'from':util[_0x9251('0x25')](_0x9251('0x16b'),_0x49123c[_0x9251('0x10')],_0x49123c['email']||_0x49123c[_0x9251('0x169')][_0x9251('0x16c')]),'to':_0x5105c4['to']||'','cc':_0x5105c4['cc']||'','bcc':_0x5105c4[_0x9251('0x16d')]||'','subject':_0x5105c4[_0x9251('0x16e')],'html':_0x5105c4[_0x9251('0x59')],'text':_0x5105c4[_0x9251('0x59')]};var _0x4b24df={'tls':{'rejectUnauthorized':![]}};if(_0x49123c[_0x9251('0x169')][_0x9251('0x16f')]){_0x4b24df[_0x9251('0x16f')]=_0x49123c[_0x9251('0x169')][_0x9251('0x16f')];}else{_0x4b24df['host']=_0x49123c[_0x9251('0x169')]['host'];_0x4b24df[_0x9251('0x170')]=_0x49123c[_0x9251('0x169')]['port'];_0x4b24df['secure']=_0x49123c[_0x9251('0x169')][_0x9251('0x171')];}if(_0x49123c[_0x9251('0x169')][_0x9251('0x172')]){_0x4b24df[_0x9251('0x173')]={'user':_0x49123c[_0x9251('0x169')]['user'],'pass':_0x49123c[_0x9251('0x169')][_0x9251('0x174')]};}if(this[_0x9251('0x81')](_0x5105c4['template_id'])){}logger[_0x9251('0x175')](_0x9251('0x176'),JSON['stringify'](_0x5cbbc8));this[_0x9251('0x31')][_0x9251('0x71')](this,_0x5105c4,_0x5105c4['account_id']);this[_0x9251('0xc')][_0x9251('0xab')](util[_0x9251('0x25')](_0x9251('0x177'),_0x49123c['name']));this[_0x9251('0x1f')][_0x9251('0x71')](this,_0x4b24df,_0x5cbbc8);return this[_0x9251('0xc')][_0x9251('0xab')](_0x9251('0x178'));};AGIVertices['prototype'][_0x9251('0x179')]=function(_0x50427b){logger[_0x9251('0x2a')](util[_0x9251('0x25')](_0x9251('0x17a'),_0x50427b[_0x9251('0x33')]));return this[_0x9251('0xc')][_0x9251('0xab')](_0x9251('0x17b'));};AGIVertices[_0x9251('0x12')]['sendSMS']=function(_0x2c6dc0){logger[_0x9251('0x2a')](util['format'](_0x9251('0x17c'),_0x2c6dc0[_0x9251('0x33')]));if(!this['isConfigured'](_0x2c6dc0[_0x9251('0x17d')])){return this[_0x9251('0xc')][_0x9251('0xab')]('no\x20sms\x20account\x20configured');}var _0x56200c=this[_0x9251('0x2f')]['sync'](this,_0x2c6dc0[_0x9251('0x17d')]);if(!_0x56200c){return this['channel'][_0x9251('0x28')](_0x2c6dc0,_0x9251('0x17e'));}var _0x43b86d={'body':_0x2c6dc0['sms_text'],'phone':_0x2c6dc0['to']||'','SmsAccountId':_0x56200c['id']};logger[_0x9251('0x175')](_0x9251('0x17f'),JSON['stringify'](_0x43b86d));this[_0x9251('0x31')][_0x9251('0x71')](this,_0x2c6dc0,_0x2c6dc0[_0x9251('0x17d')]);this['channel'][_0x9251('0xab')](util[_0x9251('0x25')](_0x9251('0x180'),_0x56200c[_0x9251('0x10')]));this[_0x9251('0x30')][_0x9251('0x71')](this,_0x43b86d);return this[_0x9251('0xc')][_0x9251('0xab')](_0x9251('0x181'));};AGIVertices['prototype']['set']=function(_0x5437e4){logger[_0x9251('0x2a')](util[_0x9251('0x25')](_0x9251('0x182'),_0x5437e4[_0x9251('0x33')]));if(!this[_0x9251('0x81')](_0x5437e4[_0x9251('0xc5')])){return this['channel'][_0x9251('0x28')](_0x5437e4,_0x9251('0x183'));}var _0x303721=this[_0x9251('0xd')][_0x9251('0x71')](this,_0x5437e4[_0x9251('0xc5')]);if(!_0x303721){return this[_0x9251('0xc')][_0x9251('0x28')](_0x5437e4,_0x9251('0xc7'));}return this[_0x9251('0xc')][_0x9251('0x9f')](_0x303721,_0x5437e4['variable_value']);};AGIVertices['prototype']['start']=function(_0x4c0881){logger['info'](util[_0x9251('0x25')](_0x9251('0x184'),_0x4c0881[_0x9251('0x33')]));this[_0x9251('0xc')][_0x9251('0xab')](_0x9251('0x185'));if(_0x4c0881[_0x9251('0xa3')]===_0x9251('0x186')){this['channel'][_0x9251('0xab')](_0x9251('0x187'));return this[_0x9251('0xc')][_0x9251('0xa3')]();}return this['channel'][_0x9251('0xab')]('Skipped\x20Answer');};AGIVertices[_0x9251('0x12')][_0x9251('0x188')]=function(_0x42ad0b){logger['info'](util[_0x9251('0x25')]('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x42ad0b[_0x9251('0x33')]));if(!this['isConfigured'](_0x42ad0b[_0x9251('0x189')])){return this[_0x9251('0xc')][_0x9251('0x28')](_0x42ad0b,_0x9251('0x18a'));}var _0x21af37=this[_0x9251('0x15')][_0x9251('0x71')](this,_0x42ad0b['project_id']);if(!this[_0x9251('0x81')](_0x21af37)){return this[_0x9251('0xc')][_0x9251('0x28')](_0x42ad0b,util[_0x9251('0x25')](_0x9251('0x18b'),_0x42ad0b[_0x9251('0x189')]));}if(_0x21af37===this['channel'][_0x9251('0x35')]){return this[_0x9251('0xc')][_0x9251('0x28')](_0x42ad0b,_0x9251('0x18c'));}this[_0x9251('0x31')][_0x9251('0x71')](this,_0x42ad0b,_0x21af37);var _0xe86052=this['channel'][_0x9251('0x53')]('AGI',util['format'](_0x9251('0x18d'),config[_0x9251('0x8')][_0x9251('0x18e')]||_0x9251('0x18f'),_0x21af37,this[_0x9251('0xc')][_0x9251('0x35')]));if(_0xe86052[_0x9251('0x9e')]===-0x1){return _0xe86052;}return this[_0x9251('0xc')][_0x9251('0xab')](util[_0x9251('0x25')]('Executed\x20command\x20%s\x20%s','AGI',_0x21af37));};AGIVertices[_0x9251('0x12')][_0x9251('0x190')]=function(_0x569376){logger[_0x9251('0x2a')](util[_0x9251('0x25')](_0x9251('0x191'),_0x569376[_0x9251('0x33')]));var _0x3a8102=this[_0x9251('0x52')][_0x9251('0x71')](this,_0x569376['command']);this['createSquareDetailsReport']['sync'](this,_0x569376,_0x569376[_0x9251('0x192')]);if(this['isConfigured'](_0x569376[_0x9251('0xc5')])){var _0x5f416f=this['getVariable']['sync'](this,_0x569376[_0x9251('0xc5')]);if(_0x5f416f){this[_0x9251('0xc')][_0x9251('0x9f')](_0x5f416f,_0x3a8102);return this[_0x9251('0xc')][_0x9251('0xab')](util[_0x9251('0x25')](_0x9251('0x193'),_0x569376[_0x9251('0x192')],_0x5f416f));}}return this[_0x9251('0xc')][_0x9251('0xab')](util[_0x9251('0x25')](_0x9251('0x194'),_0x569376[_0x9251('0x192')]));};AGIVertices[_0x9251('0x12')][_0x9251('0x195')]=function(_0x411910){logger[_0x9251('0x2a')](util[_0x9251('0x25')](_0x9251('0x196'),_0x411910[_0x9251('0x33')]));if(!this[_0x9251('0x81')](_0x411910[_0x9251('0x57')])){return this[_0x9251('0xc')][_0x9251('0xab')](_0x9251('0x197'));}if(!this[_0x9251('0x81')](_0x411910[_0x9251('0x59')])){return this[_0x9251('0xc')][_0x9251('0xab')](_0x9251('0xb2'));}this[_0x9251('0xc')][_0x9251('0xab')](util[_0x9251('0x25')](_0x9251('0x198'),_0x411910[_0x9251('0x59')]));var _0x2608f3=this[_0x9251('0x56')][_0x9251('0x71')](this,_0x411910);if(_0x2608f3){this['channel'][_0x9251('0xab')](util[_0x9251('0x25')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x2608f3));var _0x49571e=this[_0x9251('0xc')][_0x9251('0xe4')](_0x2608f3);try{fs[_0x9251('0xe5')](_0x2608f3+_0x9251('0xe6'));}catch(_0xd87716){logger[_0x9251('0x28')](_0xd87716);}return _0x49571e;}return this[_0x9251('0xc')]['error'](_0x411910,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices[_0x9251('0x12')]['tts']=function(_0x3e6318){logger[_0x9251('0x2a')](util[_0x9251('0x25')](_0x9251('0x199'),_0x3e6318[_0x9251('0x33')]));if(!this['isConfigured'](_0x3e6318[_0x9251('0x59')])){return this[_0x9251('0xc')]['noop']('no\x20text\x20configured');}this[_0x9251('0xc')]['noop'](util[_0x9251('0x25')](_0x9251('0x19a'),_0x3e6318[_0x9251('0x59')]));var _0x2beff3=this['googleTTS']['sync'](this,_0x3e6318);if(_0x2beff3){this[_0x9251('0xc')][_0x9251('0xab')](util['format']('Google\x20TTS\x20%s\x20file\x20created',_0x2beff3));var _0x15307c=this[_0x9251('0xc')][_0x9251('0xe4')](_0x2beff3);try{fs[_0x9251('0xe5')](_0x2beff3+_0x9251('0xe6'));}catch(_0x5c0434){logger[_0x9251('0x28')](_0x5c0434);}return _0x15307c;}return this[_0x9251('0xc')][_0x9251('0x28')](_0x3e6318,_0x9251('0x19b'));};AGIVertices[_0x9251('0x12')][_0x9251('0x19c')]=function(_0x2d41c7){logger[_0x9251('0x2a')](util[_0x9251('0x25')](_0x9251('0x19d'),_0x2d41c7[_0x9251('0x33')]));if(!this['isConfigured'](_0x2d41c7['findBy'])){return this[_0x9251('0xc')]['error'](_0x2d41c7,_0x9251('0x132'));}logger[_0x9251('0x2a')](util[_0x9251('0x25')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel'][_0x9251('0x36')],_0x2d41c7[_0x9251('0x131')]));var _0x3e0f46=this['agentUnpause'][_0x9251('0x71')](this,_0x2d41c7[_0x9251('0x131')]);if(_0x3e0f46){logger[_0x9251('0x2a')](util['format'](_0x9251('0x134'),this[_0x9251('0xc')]['callerid'],_0x2d41c7[_0x9251('0x131')]));this[_0x9251('0xc')][_0x9251('0xab')](util[_0x9251('0x25')](_0x9251('0x134'),this[_0x9251('0xc')][_0x9251('0x36')],_0x2d41c7[_0x9251('0x131')]));return{'code':0xc8,'result':_0x9251('0x135')};}else{logger[_0x9251('0x2a')](util[_0x9251('0x25')](_0x9251('0x136'),this[_0x9251('0xc')][_0x9251('0x36')],_0x2d41c7[_0x9251('0x131')]));this[_0x9251('0xc')][_0x9251('0xab')](util[_0x9251('0x25')](_0x9251('0x136'),this[_0x9251('0xc')][_0x9251('0x36')],_0x2d41c7['findBy']));return{'code':0xc8,'result':_0x9251('0x137')};}};AGIVertices['prototype'][_0x9251('0x19e')]=function(_0x2df775){logger[_0x9251('0x2a')](util[_0x9251('0x25')](_0x9251('0x19f'),_0x2df775['label']));var _0x585a7b=this[_0x9251('0xc')][_0x9251('0x53')](_0x9251('0x1a0'),[_0x2df775[_0x9251('0x1a1')],_0x2df775[_0x9251('0x79')]]);if(_0x585a7b[_0x9251('0x9e')]===-0x1){return _0x585a7b;}return this[_0x9251('0xc')][_0x9251('0xab')](util[_0x9251('0x25')](_0x9251('0x149'),_0x9251('0x1a0'),_0x2df775[_0x9251('0x1a1')]));};AGIVertices[_0x9251('0x12')]['vswitch']=function(_0x7f9062){logger['info'](util[_0x9251('0x25')](_0x9251('0x1a2'),_0x7f9062[_0x9251('0x33')]));if(!this['isConfigured'](_0x7f9062[_0x9251('0xc5')])){return this[_0x9251('0xc')][_0x9251('0x28')](_0x7f9062,'no\x20variable\x20selected');}var _0x5cdfde=this['getVariable'][_0x9251('0x71')](this,_0x7f9062[_0x9251('0xc5')]);if(!_0x5cdfde){return this[_0x9251('0xc')][_0x9251('0x28')](_0x7f9062,'no\x20variable\x20found');}var _0xcdce34=this[_0x9251('0xc')][_0x9251('0xd')](_0x5cdfde);return{'code':0xc8,'result':_0xcdce34[_0x9251('0x9b')]?_0xcdce34['extra']:'-'};};String[_0x9251('0x12')][_0x9251('0x1a3')]=function(_0x3e150d,_0x974114){return this[_0x9251('0x9a')](_0x3e150d)[_0x9251('0x1a4')](_0x974114);};module[_0x9251('0x1a5')]=AGIVertices; \ No newline at end of file +var _0x92aa=['AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','system','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','mailbox','VOICEMAIL','Enter\x20in\x20SWITCH\x20(%s)\x20block','replaceAll','join','exports','lodash','shelljs','odbc','randomstring','moment','mustache','request-promise','../../config/logger','/var/opt/motion2/server/files','rawBody','menu','getdigits','getsecretdigits','rpc','mailRpc','getVariable','name','catch','getVoiceQueue','getVoiceQueueById','then','getSquareProject','getSquareProjectById','prototype','getSquareOdbc','getSquareOdbcById','dsn','getUserById','getTrunk','getTrunkById','getSoundById','getSoundPath','save_name','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','open','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Query\x20executed\x20correctly\x20%s','close','error','getSmsAccountById','createSmsMessage','createSquareDetailsReport','channel','uniqueid','label','agicommand','arg_1','createSquareRecording','callerid','calleridname','extension','priority','accountcode','dnid','createSquareMessage','createCmContact','callback_','isEmpty','isNil','lastName','phone','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','callback_priority','getPause','getPauseById','agentPause','agentUnpause','agent','agentLogout','agentLogin','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','MP3','googleTTS','google_tts_language','restAPI','url','method','timeout','includes','POST','PUT','toUpperCase','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','rawHeaders','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','body','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','isConfigured','model','awsPolly','aws_secret_access_key','aws_polly_region','aws_polly_voice','aws_text_type','awsLex','aws_access_key_id','aws_lex_region','aws_bot_name','googleASR','google_asr_language','en-US','appid','appsecret','clear','clone','hasOwnProperty','isString','replaceObjectAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','replaceAllVariables','saveRestApiResult','%s.%s','split','toString','getAndSetVariable','result','extra','setVariable','maxRetry','retry','agi','Enter\x20in\x20AGI\x20(%s)\x20block','command','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','delay','add','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','noop','Executed\x20command\x20%s\x20%s','application','lumenvoxtts','no\x20text\x20configured','Executed\x20command\x20MRCPSynth\x20%s','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','grammar','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','sestekasr','MRCPRecog','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','no\x20query\x20configured','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','dial','sip_id','getUser','no\x20user\x20found','DIAL','SIP/%s','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','sesteknda','ndauth_url','no\x20ndauth\x20url\x20configured','no\x20username\x20configured','no\x20password\x20configured','Trying\x20SestekNDA:\x20%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','SestekNDA\x20Result\x20%s','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20found','trunk_name','no\x20trunk\x20selected','opts','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','getSound','file_id','no\x20file\x20audio\x20found','response','maxdigit','test','mindigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','googleasr','%s/recordings/%s','beep','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appsecret\x20configured','wav','recordFile','intKey','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','true','false','EVAL\x20CONDITION\x20%s\x20%s','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','Enter\x20in\x20HANGUP\x20(%s)\x20block','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','NOBEEP','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','.wav','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','AGENT\x20%s\x20FOUND\x20BY','failure','no\x20operation\x20configured','math\x20%s','operation','%s[%s]','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20selected','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','PLAYBACK','queue','queue_id','no\x20queue\x20selected','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','number','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','no\x20mail\x20account\x20configured','account_id','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','user','bcc','subject','service','host','port','secure','authentication','pass','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','getSmsAccount','no\x20sms\x20account\x20found','debug','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','set','Enter\x20in\x20SET\x20(%s)\x20block','variable_value','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','Skipped\x20Answer','subproject','project_id','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project'];(function(_0x1e9aea,_0x1bcc51){var _0x4b5147=function(_0x5819a3){while(--_0x5819a3){_0x1e9aea['push'](_0x1e9aea['shift']());}};_0x4b5147(++_0x1bcc51);}(_0x92aa,0x1c5));var _0xa92a=function(_0x1d31ec,_0x36daa2){_0x1d31ec=_0x1d31ec-0x0;var _0x3c7247=_0x92aa[_0x1d31ec];return _0x3c7247;};'use strict';var fs=require('fs');var path=require('path');var util=require('util');var _=require(_0xa92a('0x0'));var sh=require(_0xa92a('0x1'));var odbc=require(_0xa92a('0x2'))();var rs=require(_0xa92a('0x3'));var moment=require(_0xa92a('0x4'));var Mustache=require(_0xa92a('0x5'));var rp=require(_0xa92a('0x6'));var logger=require(_0xa92a('0x7'))('agi');var config=require('../../config/environment');var scripts=require('./scripts');var FILES_PATH=_0xa92a('0x8');var recursiveMapAttributes=['rawHeaders',_0xa92a('0x9')];var verticesWithRetry=[_0xa92a('0xa'),_0xa92a('0xb'),_0xa92a('0xc')];var AGIVertices=function(_0x4043ed,_0x4e6335,_0x5d952d){this['channel']=_0x4043ed;this[_0xa92a('0xd')]=_0x4e6335;this[_0xa92a('0xe')]=_0x5d952d;};AGIVertices['prototype'][_0xa92a('0xf')]=function(_0x25b651,_0x4e0cfd){this[_0xa92a('0xd')]['getVariableById'](_0x25b651)['then'](function(_0x92d18){_0x4e0cfd(null,_0x92d18?_0x92d18[_0xa92a('0x10')]:![]);})[_0xa92a('0x11')](function(_0x45330e){_0x4e0cfd(_0x45330e);});};AGIVertices['prototype'][_0xa92a('0x12')]=function(_0x39d092,_0x1fce44){this[_0xa92a('0xd')][_0xa92a('0x13')](_0x39d092)[_0xa92a('0x14')](function(_0x1110b3){_0x1fce44(null,_0x1110b3?_0x1110b3[_0xa92a('0x10')]:![]);})[_0xa92a('0x11')](function(_0x456075){_0x1fce44(_0x456075);});};AGIVertices['prototype'][_0xa92a('0x15')]=function(_0xe2a9c9,_0x3b0186){this[_0xa92a('0xd')][_0xa92a('0x16')](_0xe2a9c9)['then'](function(_0x3ea9b6){_0x3b0186(null,_0x3ea9b6?_0x3ea9b6[_0xa92a('0x10')]:![]);})[_0xa92a('0x11')](function(_0x5ca962){_0x3b0186(_0x5ca962);});};AGIVertices[_0xa92a('0x17')][_0xa92a('0x18')]=function(_0x1bdb70,_0x1d6576){this[_0xa92a('0xd')][_0xa92a('0x19')](_0x1bdb70)[_0xa92a('0x14')](function(_0x3fad85){_0x1d6576(null,_0x3fad85?_0x3fad85[_0xa92a('0x1a')]:![]);})[_0xa92a('0x11')](function(_0x47bf1b){_0x1d6576(_0x47bf1b);});};AGIVertices[_0xa92a('0x17')]['getUser']=function(_0x48e0ee,_0x158423){this['rpc'][_0xa92a('0x1b')](_0x48e0ee)[_0xa92a('0x14')](function(_0x3b6d59){_0x158423(null,_0x3b6d59?_0x3b6d59['name']:![]);})[_0xa92a('0x11')](function(_0x3063e1){_0x158423(_0x3063e1);});};AGIVertices[_0xa92a('0x17')][_0xa92a('0x1c')]=function(_0x28a72d,_0x364f06){this[_0xa92a('0xd')][_0xa92a('0x1d')](_0x28a72d)[_0xa92a('0x14')](function(_0x4d2369){_0x364f06(null,_0x4d2369?_0x4d2369[_0xa92a('0x10')]:![]);})['catch'](function(_0x36fc98){_0x364f06(_0x36fc98);});};AGIVertices[_0xa92a('0x17')]['getSound']=function(_0x4980ef,_0x28b535){var _0x1e20d7=this;this[_0xa92a('0xd')][_0xa92a('0x1e')](_0x4980ef)['then'](function(_0x4f8a52){_0x28b535(null,_0x4f8a52?_0x1e20d7[_0xa92a('0x1f')](_0x4f8a52[_0xa92a('0x20')]):![]);})['catch'](function(_0x40ab2a){_0x28b535(_0x40ab2a);});};AGIVertices[_0xa92a('0x17')]['getMailAccount']=function(_0x172c9b,_0x20b558){this[_0xa92a('0xd')][_0xa92a('0x21')](_0x172c9b)['then'](function(_0x240c57){_0x20b558(null,_0x240c57?_0x240c57:![]);})[_0xa92a('0x11')](function(_0xc62cb6){_0x20b558(_0xc62cb6);});};AGIVertices[_0xa92a('0x17')]['sendMailMessage']=function(_0x8a050d,_0x5db06d,_0x2992bf){this[_0xa92a('0xe')][_0xa92a('0x22')](_0x8a050d,_0x5db06d)[_0xa92a('0x14')](function(){_0x2992bf(null);})[_0xa92a('0x11')](function(_0x30bebd){_0x2992bf(_0x30bebd);});};AGIVertices[_0xa92a('0x17')][_0xa92a('0x23')]=function(_0x410905,_0x37413d){this[_0xa92a('0xd')][_0xa92a('0x24')](_0x410905)[_0xa92a('0x14')](function(_0x3e1cd7){if(_0x3e1cd7){if(_0x3e1cd7[_0xa92a('0x25')]){_0x37413d(null,[_0x3e1cd7[_0xa92a('0x26')]]);}else{_0x37413d(null,_['map'](_0x3e1cd7[_0xa92a('0x27')],_0xa92a('0x26')));}}else{_0x37413d(null,![]);}})['catch'](function(_0x4e37f7){_0x37413d(_0x4e37f7);});};AGIVertices[_0xa92a('0x17')][_0xa92a('0x1f')]=function(_0x2ec928){return util[_0xa92a('0x28')](_0xa92a('0x29'),FILES_PATH,_0x2ec928);};AGIVertices['prototype'][_0xa92a('0x2a')]=function(_0x21885b,_0xe258da,_0xddd0e){odbc[_0xa92a('0x2b')](_0x21885b,function(_0x380d55){if(_0x380d55){logger['error'](_0xa92a('0x2c'),_0x380d55);_0xddd0e(_0x380d55);}else{logger[_0xa92a('0x2d')](_0xa92a('0x2e'));odbc[_0xa92a('0x2f')](_0xe258da,function(_0x4e6df0,_0x486cff){if(_0x4e6df0){logger['info']('Error\x20executing\x20query\x20%s',_0xe258da);_0xddd0e(_0x4e6df0);}else{logger[_0xa92a('0x2d')](_0xa92a('0x30'),_0xe258da);odbc[_0xa92a('0x31')](function(_0x1c2a68){if(_0x1c2a68){logger[_0xa92a('0x32')]('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x1c2a68);}_0xddd0e(null,_0x486cff);});}});}});};AGIVertices['prototype']['getSmsAccount']=function(_0x570535,_0x820c7b){this[_0xa92a('0xd')][_0xa92a('0x33')](_0x570535)[_0xa92a('0x14')](function(_0x5806ac){_0x820c7b(null,_0x5806ac?_0x5806ac:![]);})[_0xa92a('0x11')](function(_0x50ff98){_0x820c7b(_0x50ff98);});};AGIVertices[_0xa92a('0x17')][_0xa92a('0x34')]=function(_0xbb0181,_0x14cd2c){this[_0xa92a('0xd')][_0xa92a('0x34')](_0xbb0181)[_0xa92a('0x14')](function(_0x5a357f){_0x14cd2c(null,_0x5a357f);})['catch'](function(_0x5e3914){_0x14cd2c(_0x5e3914);});};AGIVertices[_0xa92a('0x17')][_0xa92a('0x35')]=function(_0x204fd2,_0x286e8a,_0x24ffaf){this[_0xa92a('0xd')][_0xa92a('0x35')]({'uniqueid':this[_0xa92a('0x36')][_0xa92a('0x37')],'node':_0x204fd2[_0xa92a('0x38')],'application':_0x204fd2[_0xa92a('0x39')],'data':_0x286e8a||null,'project_name':this[_0xa92a('0x36')][_0xa92a('0x3a')],'callerid':this[_0xa92a('0x36')]['callerid']})[_0xa92a('0x14')](function(_0x50abab){if(_0x24ffaf){_0x24ffaf(null,_0x50abab);}})['catch'](function(_0x3d0f3f){if(_0x24ffaf){_0x24ffaf(_0x3d0f3f);}});};AGIVertices[_0xa92a('0x17')][_0xa92a('0x3b')]=function(_0x276f35,_0x39c350,_0x125812,_0x37926a){this[_0xa92a('0xd')]['createSquareRecording']({'uniqueid':this[_0xa92a('0x36')]['uniqueid'],'callerid':this['channel'][_0xa92a('0x3c')],'calleridname':this['channel'][_0xa92a('0x3d')],'context':this[_0xa92a('0x36')]['context'],'extension':this['channel'][_0xa92a('0x3e')],'priority':this['channel'][_0xa92a('0x3f')],'accountcode':this[_0xa92a('0x36')][_0xa92a('0x40')],'dnid':this[_0xa92a('0x36')][_0xa92a('0x41')],'projectName':this[_0xa92a('0x36')][_0xa92a('0x3a')],'saveName':_0x39c350,'filename':_0x276f35['file']||_0x39c350,'savePath':_0x125812})['then'](function(_0x22a0e2){_0x37926a(null,_0x22a0e2);})[_0xa92a('0x11')](function(_0x2c753e){_0x37926a(_0x2c753e);});};AGIVertices[_0xa92a('0x17')][_0xa92a('0x42')]=function(_0x3bcf35,_0x5ba92f,_0x3317dd){this[_0xa92a('0xd')][_0xa92a('0x42')]({'uniqueid':this[_0xa92a('0x36')][_0xa92a('0x37')],'body':_0x3bcf35,'direction':_0x5ba92f})[_0xa92a('0x14')](function(_0x113cb3){if(_0x3317dd){_0x3317dd(null,_0x113cb3);}})[_0xa92a('0x11')](function(_0x3ca52e){if(_0x3317dd){_0x3317dd(_0x3ca52e);}});};AGIVertices['prototype']['createCmContact']=function(_0x5dda61,_0x12c8d9){this['rpc'][_0xa92a('0x43')]({'firstName':_['isEmpty'](_0x5dda61[_0xa92a('0x10')])||_['isNil'](_0x5dda61[_0xa92a('0x10')])?_0xa92a('0x44')+Math['random']():_0x5dda61[_0xa92a('0x10')],'lastName':_[_0xa92a('0x45')](_0x5dda61['lastName'])||_[_0xa92a('0x46')](_0x5dda61[_0xa92a('0x47')])?null:_0x5dda61[_0xa92a('0x47')],'phone':_0x5dda61[_0xa92a('0x48')],'ListId':_0x5dda61[_0xa92a('0x49')],'scheduledat':_0x5dda61[_0xa92a('0x4a')],'callbackUniqueid':this[_0xa92a('0x36')][_0xa92a('0x37')],'tags':_0xa92a('0x4b'),'description':_0xa92a('0x4c')+_0x5dda61['scheduledAt']['toString'](),'priority':_0x5dda61[_0xa92a('0x4d')]})['then'](function(_0x5da4c7){_0x12c8d9(null,_0x5da4c7);})[_0xa92a('0x11')](function(_0x139a81){_0x12c8d9(_0x139a81);});};AGIVertices[_0xa92a('0x17')][_0xa92a('0x4e')]=function(_0x211720,_0x1d853f){this[_0xa92a('0xd')][_0xa92a('0x4f')](_0x211720)[_0xa92a('0x14')](function(_0x593e4e){_0x1d853f(null,_0x593e4e?_0x593e4e[_0xa92a('0x10')]:![]);})[_0xa92a('0x11')](function(_0x210fc1){_0x1d853f(_0x210fc1);});};AGIVertices[_0xa92a('0x17')][_0xa92a('0x50')]=function(_0x50c07c,_0x58c55e,_0x80d4a8){var _0x16a1f6={'role':'agent'};_0x16a1f6[_0x50c07c]=this[_0xa92a('0x36')]['callerid'];this['rpc'][_0xa92a('0x50')](_0x16a1f6,_0x58c55e,this['channel'][_0xa92a('0x37')])[_0xa92a('0x14')](function(_0x401e61){_0x80d4a8(null,_['isNil'](_0x401e61)?![]:!![]);})[_0xa92a('0x11')](function(_0x4bf7ed){logger[_0xa92a('0x32')](_0x4bf7ed);_0x80d4a8(null,![]);});};AGIVertices[_0xa92a('0x17')][_0xa92a('0x51')]=function(_0x22278f,_0x1b898f){var _0x25eb46={'role':_0xa92a('0x52')};_0x25eb46[_0x22278f]=this[_0xa92a('0x36')]['callerid'];this['rpc'][_0xa92a('0x51')](_0x25eb46)[_0xa92a('0x14')](function(_0x5b026f){_0x1b898f(null,_[_0xa92a('0x46')](_0x5b026f)?![]:!![]);})[_0xa92a('0x11')](function(_0x44a326){logger[_0xa92a('0x32')](_0x44a326);_0x1b898f(null,![]);});};AGIVertices['prototype'][_0xa92a('0x53')]=function(_0x426713,_0x556f64){var _0x53fead={'role':_0xa92a('0x52')};_0x53fead[_0x426713]=this['channel']['callerid'];this[_0xa92a('0xd')][_0xa92a('0x53')](_0x53fead)[_0xa92a('0x14')](function(_0x56736a){_0x556f64(null,_[_0xa92a('0x46')](_0x56736a)?![]:!![]);})['catch'](function(_0x21b14c){logger[_0xa92a('0x32')](_0x21b14c);_0x556f64(null,![]);});};AGIVertices[_0xa92a('0x17')][_0xa92a('0x54')]=function(_0x2bee08,_0x2004b3){var _0x3951b5={'role':_0xa92a('0x52')};_0x3951b5[_0x2bee08]=this[_0xa92a('0x36')]['callerid'];var _0x4dc189=_0x2bee08!='internal'?util['format']('%s/%s@from-sip/n','LOCAL',this[_0xa92a('0x36')][_0xa92a('0x3c')]):undefined;this[_0xa92a('0xd')][_0xa92a('0x54')](_0x3951b5,_0x4dc189)['then'](function(_0x1878a7){_0x2004b3(null,_[_0xa92a('0x46')](_0x1878a7)?![]:!![]);})[_0xa92a('0x11')](function(_0x119f17){logger[_0xa92a('0x32')](_0x119f17);_0x2004b3(null,![]);});};AGIVertices[_0xa92a('0x17')][_0xa92a('0x55')]=function(_0x2d5f97,_0x557f21){sh[_0xa92a('0x56')](_[_0xa92a('0x57')](_0x2d5f97),function(_0x4a3485,_0x1ba9a2){var _0x2fd43f=_0x1ba9a2[_0xa92a('0x58')](/(\r\n|\n|\r)/gm,'');_0x557f21(null,_0x2fd43f);});};AGIVertices[_0xa92a('0x17')][_0xa92a('0x59')]=function(_0x315020,_0x3899ae){scripts[_0xa92a('0x59')](_0x315020[_0xa92a('0x5a')],_0x315020[_0xa92a('0x5b')]||_0xa92a('0x5c'),_0x315020[_0xa92a('0x5c')],_0x315020[_0xa92a('0x5d')]||'en-US',_0x315020['ssmlGender']||'MALE',_0x315020['audioEncoding']||_0xa92a('0x5e'))['then'](function(_0x456a50){_0x3899ae(null,_0x456a50);})[_0xa92a('0x11')](function(_0x37a650){_0x3899ae(_0x37a650);});};AGIVertices[_0xa92a('0x17')]['googleTTS']=function(_0x10077f,_0x41f1bf){scripts[_0xa92a('0x5f')](_0x10077f['text'],_0x10077f[_0xa92a('0x60')]||'en',0x1)[_0xa92a('0x14')](function(_0x1225aa){_0x41f1bf(null,_0x1225aa);})[_0xa92a('0x11')](function(_0x37a680){_0x41f1bf(_0x37a680);});};AGIVertices['prototype'][_0xa92a('0x61')]=function(_0x282de5,_0x2a9f24){var _0x50695={'uri':_0x282de5[_0xa92a('0x62')],'method':_0x282de5[_0xa92a('0x63')],'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x282de5[_0xa92a('0x64')])==='number'&&parseInt(_0x282de5['timeout'])>=0x1?parseInt(_0x282de5[_0xa92a('0x64')])*0x3e8:0x5*0x3e8};if(_[_0xa92a('0x65')]([_0xa92a('0x66'),_0xa92a('0x67')],_0x50695[_0xa92a('0x63')][_0xa92a('0x68')]())){try{_0x50695['body']=_0x282de5['rawBody']?JSON[_0xa92a('0x69')](_0x282de5[_0xa92a('0x9')]):{};}catch(_0x1f1be0){logger['error'](_0xa92a('0x6a'),_0x1f1be0);}}try{_0x50695[_0xa92a('0x6b')]=_0x282de5[_0xa92a('0x6c')]?JSON['parse'](_0x282de5['rawHeaders']):{};}catch(_0x50b8){logger[_0xa92a('0x32')](_0xa92a('0x6d'),_0x50b8);}if(_0x282de5['computedVariables']){try{var _0x53b595=require(_0x282de5[_0xa92a('0x6e')])[_0xa92a('0x6f')](this,_0x50695);_0x50695[_0xa92a('0x70')]=Mustache[_0xa92a('0x71')](_0x282de5[_0xa92a('0x62')],_0x53b595,{},['$$','$$']);if(_0x50695[_0xa92a('0x6b')]){_0x50695[_0xa92a('0x6b')]=JSON[_0xa92a('0x69')](Mustache[_0xa92a('0x71')](JSON['stringify'](_0x50695['headers']),_0x53b595,{},['$$','$$']));}if(_0x50695[_0xa92a('0x72')]){_0x50695[_0xa92a('0x72')]=JSON[_0xa92a('0x69')](Mustache['render'](JSON[_0xa92a('0x73')](_0x50695['body']),_0x53b595,{},['$$','$$']));}}catch(_0x5d8aba){logger[_0xa92a('0x32')](_0xa92a('0x74'),_0x5d8aba);}}rp(_0x50695)['then'](function(_0xa31137){var _0x39181d={'statusCode':_0xa31137[_0xa92a('0x75')]||0xc8,'statusMessage':_0xa31137[_0xa92a('0x76')]||'OK','headers':_0xa31137[_0xa92a('0x6b')]||{},'body':_0xa31137[_0xa92a('0x72')]||{}};_0x2a9f24(null,_0x39181d);})['catch'](function(_0x584296){var _0x563fa5={'statusCode':_0x584296[_0xa92a('0x75')]||0x1f4,'statusMessage':_0x584296[_0xa92a('0x77')]||_0xa92a('0x78'),'headers':_0x584296[_0xa92a('0x79')]['headers']||{},'body':_0x584296[_0xa92a('0x79')][_0xa92a('0x72')]||{}};_0x2a9f24(null,_0x563fa5);});};AGIVertices[_0xa92a('0x17')]['googleDialogflow']=function(_0xea0f37,_0x42f2c5){scripts[_0xa92a('0x7a')](this[_0xa92a('0x36')][_0xa92a('0x37')],_0xea0f37[_0xa92a('0x7b')],_0xea0f37[_0xa92a('0x5c')],_0xea0f37[_0xa92a('0x7c')]||'en')[_0xa92a('0x14')](function(_0x286629){_0x42f2c5(null,_0x286629);})['catch'](function(_0x5b53f9){_0x42f2c5(_0x5b53f9);});};AGIVertices['prototype'][_0xa92a('0x7d')]=function(_0x1ec256,_0x33d180){scripts[_0xa92a('0x7d')](this['channel'],_0x1ec256)[_0xa92a('0x14')](function(_0x163cad){_0x33d180(null,_0x163cad);})[_0xa92a('0x11')](function(_0x2f80f0){_0x33d180(_0x2f80f0);});};AGIVertices[_0xa92a('0x17')]['ispeechTTS']=function(_0x590cb5,_0x46f9a1){scripts[_0xa92a('0x7e')](_0x590cb5[_0xa92a('0x7b')],_0x590cb5[_0xa92a('0x5c')],_0x590cb5[_0xa92a('0x7f')]||'en-US',_0x590cb5[_0xa92a('0x80')])[_0xa92a('0x14')](function(_0x46e36e){_0x46f9a1(null,_0x46e36e);})[_0xa92a('0x11')](function(_0x25f97c){_0x46f9a1(_0x25f97c);});};AGIVertices[_0xa92a('0x17')][_0xa92a('0x81')]=function(_0xdebe1,_0x81f31d,_0x4c2e6e){scripts[_0xa92a('0x81')](_0x81f31d,_0xdebe1[_0xa92a('0x7b')],_0xdebe1['ispeech_asr_language']||'en-US',this[_0xa92a('0x82')](_0xdebe1[_0xa92a('0x83')])?_0xdebe1[_0xa92a('0x83')]:undefined)[_0xa92a('0x14')](function(_0x22be54){_0x4c2e6e(null,_0x22be54);})[_0xa92a('0x11')](function(_0x510f81){_0x4c2e6e(_0x510f81);});};AGIVertices[_0xa92a('0x17')][_0xa92a('0x84')]=function(_0x15da1f,_0x4a12b2){scripts[_0xa92a('0x84')](_0x15da1f['aws_access_key_id'],_0x15da1f[_0xa92a('0x85')],_0x15da1f[_0xa92a('0x86')],_0x15da1f[_0xa92a('0x87')]||'Amy',_0x15da1f['text'],_0x15da1f[_0xa92a('0x88')]||'text')[_0xa92a('0x14')](function(_0xca0463){_0x4a12b2(null,_0xca0463);})[_0xa92a('0x11')](function(_0x4d40d4){_0x4a12b2(_0x4d40d4);});};AGIVertices[_0xa92a('0x17')]['awsLex']=function(_0x550d85,_0x446144){scripts[_0xa92a('0x89')](this[_0xa92a('0x36')][_0xa92a('0x37')],_0x550d85[_0xa92a('0x8a')],_0x550d85[_0xa92a('0x85')],_0x550d85[_0xa92a('0x8b')],_0x550d85[_0xa92a('0x5c')],_0x550d85[_0xa92a('0x8c')])[_0xa92a('0x14')](function(_0x13bd90){_0x446144(null,_0x13bd90);})[_0xa92a('0x11')](function(_0x34f9d3){_0x446144(_0x34f9d3);});};AGIVertices[_0xa92a('0x17')][_0xa92a('0x8d')]=function(_0x3f6560,_0x1bc5ee,_0x4f3b9b){scripts['googleASR'](_0x1bc5ee,_0x3f6560['key'],_0x3f6560[_0xa92a('0x8e')]||_0xa92a('0x8f'))[_0xa92a('0x14')](function(_0x454e3f){_0x4f3b9b(null,_0x454e3f);})[_0xa92a('0x11')](function(_0x5c6ba9){_0x4f3b9b(_0x5c6ba9);});};AGIVertices[_0xa92a('0x17')]['tildeASR']=function(_0x40f528,_0x5394b3,_0x5a8278){scripts['tildeASR'](_0x5394b3,_0x40f528[_0xa92a('0x90')],_0x40f528[_0xa92a('0x91')],_0x40f528[_0xa92a('0x70')])[_0xa92a('0x14')](function(_0x5054e0){_0x5a8278(null,_0x5054e0);})[_0xa92a('0x11')](function(_0x14a07a){_0x5a8278(_0x14a07a);});};AGIVertices[_0xa92a('0x17')][_0xa92a('0x92')]=function(_0x12a69c){var _0x182513=_[_0xa92a('0x65')](verticesWithRetry,_0x12a69c[_0xa92a('0x39')])?_0x12a69c:_[_0xa92a('0x93')](_0x12a69c);for(var _0xa41163 in _0x182513){if(_0x182513[_0xa92a('0x94')](_0xa41163)){if(_0x182513[_0xa41163]&&_[_0xa92a('0x95')](_0x182513[_0xa41163])){if(_['includes'](recursiveMapAttributes,_0xa41163)){_0x182513[_0xa41163]=this[_0xa92a('0x96')](_0x182513[_0xa41163]);}else{_0x182513[_0xa41163]=this['replaceAllVariables'](_0x182513[_0xa41163]);}}}}return _0x182513;};AGIVertices[_0xa92a('0x17')][_0xa92a('0x97')]=function(_0x592e3c){for(var _0xe0fcc1 in _0x592e3c){if(_0x592e3c['hasOwnProperty'](_0xe0fcc1)){if(_[_0xa92a('0x98')](_0x592e3c[_0xe0fcc1])){this[_0xa92a('0x97')](_0x592e3c[_0xe0fcc1]);}else if(_[_0xa92a('0x99')](_0x592e3c[_0xe0fcc1])){for(var _0x4d0055=0x0;_0x4d0055<_0x592e3c[_0xe0fcc1][_0xa92a('0x9a')];_0x4d0055++){this[_0xa92a('0x97')](_0x592e3c[_0xe0fcc1][_0x4d0055]);}}else if(_[_0xa92a('0x95')](_0x592e3c[_0xe0fcc1])){_0x592e3c[_0xe0fcc1]=this[_0xa92a('0x9b')](_0x592e3c[_0xe0fcc1]);}}}};AGIVertices[_0xa92a('0x17')][_0xa92a('0x9c')]=function(_0x2414ba,_0x17556c){for(var _0x45377e in _0x2414ba){if(_0x2414ba[_0xa92a('0x94')](_0x45377e)){if(_[_0xa92a('0x98')](_0x2414ba[_0x45377e])){if(!_['isEmpty'](_0x2414ba[_0x45377e])){this['saveRestApiResult'](_0x2414ba[_0x45377e],util['format'](_0xa92a('0x9d'),_0x17556c,_0x45377e));}}else if(_[_0xa92a('0x99')](_0x2414ba[_0x45377e])){for(var _0x3ed7bf=0x0;_0x3ed7bf<_0x2414ba[_0x45377e][_0xa92a('0x9a')];_0x3ed7bf++){this['saveRestApiResult'](_0x2414ba[_0x45377e][_0x3ed7bf],util[_0xa92a('0x28')](_0xa92a('0x9d'),_0x17556c,_0x45377e+'['+_0x3ed7bf+']'));}}else{if(!_[_0xa92a('0x46')](_0x2414ba[_0x45377e])){this['channel']['setVariable'](util['format'](_0xa92a('0x9d'),_0x17556c,_0x45377e),_0x2414ba[_0x45377e]);}}}}};AGIVertices[_0xa92a('0x17')]['replaceObjectAllVariables']=function(_0x3689dd){try{var _0x22c5ee=JSON['parse'](_0x3689dd);this['recursiveNodeIndex'](_0x22c5ee);return JSON[_0xa92a('0x73')](_0x22c5ee);}catch(_0x38cc47){return this[_0xa92a('0x9b')](_0x3689dd);}};AGIVertices[_0xa92a('0x17')]['replaceAllVariables']=function(_0x449014){var _0x353712=_0x449014[_0xa92a('0x9e')]('{');for(var _0x4ac4f2=0x1;_0x4ac4f2<_0x353712[_0xa92a('0x9a')];_0x4ac4f2+=0x1){var _0x32d372=_0x353712[_0x4ac4f2][_0xa92a('0x9e')]('}');if(_0x32d372[_0xa92a('0x9a')]>0x1){_0x449014=_0x449014['replaceAll']('{'+_0x32d372[0x0]+'}',this[_0xa92a('0x36')][_0xa92a('0xf')](_0x32d372[0x0])['extra']||_0x32d372[0x0]);}}if(_0x353712[_0xa92a('0x9a')]===0x1){return _0x449014[_0xa92a('0x9f')]();}return this[_0xa92a('0x9b')](_0x449014);};AGIVertices[_0xa92a('0x17')][_0xa92a('0xa0')]=function(_0x337e05,_0x2699d6){var _0x554a45=this[_0xa92a('0x36')][_0xa92a('0xf')](_0x337e05);if(_0x554a45[_0xa92a('0xa1')]===-0x1){return _0x554a45;}logger[_0xa92a('0x2d')](util[_0xa92a('0x28')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x2699d6,_0x554a45[_0xa92a('0xa2')]));return this[_0xa92a('0x36')][_0xa92a('0xa3')](_0x2699d6,_0x554a45[_0xa92a('0xa2')]);};AGIVertices[_0xa92a('0x17')][_0xa92a('0x82')]=function(_0x16852e){return _0x16852e&&_0x16852e!=='0'&&_0x16852e!=='-1'&&_0x16852e!=='';};AGIVertices[_0xa92a('0x17')][_0xa92a('0xa4')]=function(_0x571c43){this[_0xa92a('0x35')][_0xa92a('0x6f')](this,_0x571c43,'-');_0x571c43[_0xa92a('0xa5')]=_0x571c43[_0xa92a('0xa4')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xa92a('0x17')][_0xa92a('0xa6')]=function(_0xe12066){logger['info'](util[_0xa92a('0x28')](_0xa92a('0xa7'),_0xe12066['label']));return this[_0xa92a('0x36')]['agi']([_0xe12066[_0xa92a('0xa8')],_0xe12066['args']]);};AGIVertices[_0xa92a('0x17')][_0xa92a('0xa9')]=function(_0x471adc){logger['info'](util[_0xa92a('0x28')](_0xa92a('0xaa'),_0x471adc[_0xa92a('0x38')]));if(this['isConfigured'](_0x471adc['timeout'])){logger[_0xa92a('0x2d')](util['format']('Wait\x20%s\x20seconds\x20before\x20answer',_0x471adc[_0xa92a('0x64')]));var _0x500911=this[_0xa92a('0x36')][_0xa92a('0xab')](_0x471adc['timeout']);if(_0x500911[_0xa92a('0xa1')]===-0x1){return _0x500911;}}return this[_0xa92a('0x36')][_0xa92a('0xa9')]();};AGIVertices[_0xa92a('0x17')][_0xa92a('0x4b')]=function(_0x44d358){logger[_0xa92a('0x2d')](util[_0xa92a('0x28')](_0xa92a('0xac'),_0x44d358[_0xa92a('0x38')]));if(!this['isConfigured'](_0x44d358[_0xa92a('0x49')])){return this[_0xa92a('0x36')][_0xa92a('0x32')](_0x44d358,'no\x20list\x20selected');}_0x44d358[_0xa92a('0x4a')]=moment();if(this[_0xa92a('0x82')](_0x44d358[_0xa92a('0xad')])){_0x44d358[_0xa92a('0x4a')]=moment()[_0xa92a('0xae')](_0x44d358[_0xa92a('0xad')],_0xa92a('0xaf'));}if(!this[_0xa92a('0x82')](_0x44d358[_0xa92a('0x4d')])){_0x44d358[_0xa92a('0x4d')]=0x2;}this[_0xa92a('0x43')][_0xa92a('0x6f')](this,_0x44d358);return this[_0xa92a('0x36')]['noop'](util[_0xa92a('0x28')](_0xa92a('0xb0'),_0x44d358[_0xa92a('0x48')],_0x44d358[_0xa92a('0x49')],_0x44d358[_0xa92a('0x4a')]));};AGIVertices[_0xa92a('0x17')][_0xa92a('0xb1')]=function(_0x4501b3){logger[_0xa92a('0x2d')](util[_0xa92a('0x28')](_0xa92a('0xb2'),_0x4501b3[_0xa92a('0x38')]));var _0x765de5=this['channel']['exec'](_0x4501b3['application'],_0x4501b3[_0xa92a('0x79')]);if(_0x765de5['result']===-0x1){return _0x765de5;}return this[_0xa92a('0x36')][_0xa92a('0xb3')](util['format'](_0xa92a('0xb4'),_0x4501b3[_0xa92a('0xb5')],_0x4501b3[_0xa92a('0x79')]));};AGIVertices[_0xa92a('0x17')][_0xa92a('0xb6')]=function(_0x9c9341){logger[_0xa92a('0x2d')](util[_0xa92a('0x28')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x9c9341[_0xa92a('0x38')]));if(!this[_0xa92a('0x82')](_0x9c9341[_0xa92a('0x5c')])){return this[_0xa92a('0x36')][_0xa92a('0xb3')](_0xa92a('0xb7'));}var _0x1f5638='\x22'+_0x9c9341[_0xa92a('0x5c')]+'\x22';if(this['isConfigured'](_0x9c9341['options'])){_0x1f5638+=','+_0x9c9341[_0xa92a('0x79')];}var _0x313256=this[_0xa92a('0x36')]['exec']('MRCPSynth',_0x1f5638);if(_0x313256[_0xa92a('0xa1')]===-0x1){return _0x313256;}return this[_0xa92a('0x36')][_0xa92a('0xb3')](util[_0xa92a('0x28')](_0xa92a('0xb8'),_0x1f5638));};AGIVertices[_0xa92a('0x17')][_0xa92a('0xb9')]=function(_0x415798){logger[_0xa92a('0x2d')](util[_0xa92a('0x28')](_0xa92a('0xba'),_0x415798['label']));if(!this[_0xa92a('0x82')](_0x415798['text'])){return this[_0xa92a('0x36')][_0xa92a('0xb3')]('no\x20text\x20configured');}var _0x24489d='\x22'+_0x415798['text']+'\x22';if(this[_0xa92a('0x82')](_0x415798['options'])){_0x24489d+=','+_0x415798['options'];}var _0x4d731=this[_0xa92a('0x36')][_0xa92a('0x56')]('MRCPSynth',_0x24489d);if(_0x4d731['result']===-0x1){return _0x4d731;}return this[_0xa92a('0x36')][_0xa92a('0xb3')](util[_0xa92a('0x28')](_0xa92a('0xb8'),_0x24489d));};AGIVertices[_0xa92a('0x17')]['lumenvoxasr']=function(_0x3bc1cf){logger[_0xa92a('0x2d')](util[_0xa92a('0x28')](_0xa92a('0xbb'),_0x3bc1cf['label']));if(!this[_0xa92a('0x82')](_0x3bc1cf[_0xa92a('0xbc')])){return this[_0xa92a('0x36')][_0xa92a('0xb3')]('no\x20grammar\x20configured');}var _0x28e9ad=_0x3bc1cf[_0xa92a('0xbc')];if(this[_0xa92a('0x82')](_0x3bc1cf[_0xa92a('0x79')])){_0x28e9ad+=','+_0x3bc1cf[_0xa92a('0x79')];}var _0x23741f=this['channel'][_0xa92a('0x56')]('MRCPRecog',_0x28e9ad);if(_0x23741f[_0xa92a('0xa1')]===-0x1){return _0x23741f;}var _0x136520=this[_0xa92a('0xa0')](_0xa92a('0xbd'),_0xa92a('0xbe'));if(_0x136520['result']===-0x1){return _0x136520;}var _0x26ab40=this['getAndSetVariable'](_0xa92a('0xbf'),_0xa92a('0xc0'));if(_0x26ab40[_0xa92a('0xa1')]===-0x1){return _0x26ab40;}var _0x52ece5=this['getAndSetVariable'](_0xa92a('0xc1'),'LUMENVOX_ASR_INSTANCE');if(_0x52ece5['result']===-0x1){return _0x52ece5;}return this[_0xa92a('0x36')][_0xa92a('0xb3')](util[_0xa92a('0x28')]('Executed\x20command\x20MRCPRecog\x20%s',_0x28e9ad));};AGIVertices[_0xa92a('0x17')][_0xa92a('0xc2')]=function(_0x345ecb){logger['info'](util['format']('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x345ecb[_0xa92a('0x38')]));if(!this[_0xa92a('0x82')](_0x345ecb['grammar'])){return this[_0xa92a('0x36')]['noop']('no\x20grammar\x20configured');}var _0x3bcacc=_0x345ecb['grammar'];if(this[_0xa92a('0x82')](_0x345ecb['options'])){_0x3bcacc+=','+_0x345ecb[_0xa92a('0x79')];}var _0x287a84=this[_0xa92a('0x36')][_0xa92a('0x56')](_0xa92a('0xc3'),_0x3bcacc);if(_0x287a84[_0xa92a('0xa1')]===-0x1){return _0x287a84;}var _0x1f144e=this[_0xa92a('0xa0')]('RECOG_CONFIDENCE()','SESTEK_ASR_CONFIDENCE');if(_0x1f144e[_0xa92a('0xa1')]===-0x1){return _0x1f144e;}var _0x2a905a=this[_0xa92a('0xa0')]('RECOG_INPUT()',_0xa92a('0xc4'));if(_0x2a905a[_0xa92a('0xa1')]===-0x1){return _0x2a905a;}var _0x2a7a66=this[_0xa92a('0xa0')]('RECOG_INSTANCE()',_0xa92a('0xc5'));if(_0x2a7a66[_0xa92a('0xa1')]===-0x1){return _0x2a7a66;}return this[_0xa92a('0x36')][_0xa92a('0xb3')](util[_0xa92a('0x28')]('Executed\x20command\x20MRCPRecog\x20%s',_0x3bcacc));};AGIVertices[_0xa92a('0x17')][_0xa92a('0xc6')]=function(_0x31d7aa){logger[_0xa92a('0x2d')](util[_0xa92a('0x28')]('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x31d7aa['label']));if(!this[_0xa92a('0x82')](_0x31d7aa[_0xa92a('0xc7')])){return this[_0xa92a('0x36')][_0xa92a('0x32')](_0x31d7aa,_0xa92a('0xc8'));}var _0x2cce2e=this['getSquareOdbc'][_0xa92a('0x6f')](this,_0x31d7aa['odbc_id']);if(!_0x2cce2e){return this[_0xa92a('0x36')][_0xa92a('0x32')](_0x31d7aa,_0xa92a('0xc9'));}if(!this[_0xa92a('0x82')](_0x31d7aa['query'])){return this[_0xa92a('0x36')][_0xa92a('0x32')](_0x31d7aa,_0xa92a('0xca'));}var _0x4b1c6b=_0x31d7aa[_0xa92a('0x2f')][_0xa92a('0x58')](/(\r\n|\n|\r)/gm,'\x20');this[_0xa92a('0x36')][_0xa92a('0xb3')](util[_0xa92a('0x28')]('query:\x20%s',_0x4b1c6b));var _0x490a14=this[_0xa92a('0x2a')][_0xa92a('0x6f')](this,_0x2cce2e,_0x4b1c6b);this[_0xa92a('0x35')][_0xa92a('0x6f')](this,_0x31d7aa,_0x4b1c6b);if(!this[_0xa92a('0x82')](_0x31d7aa[_0xa92a('0xcb')])){return this[_0xa92a('0x36')]['noop'](_0xa92a('0xcc'));}var _0x558a95=this['getVariable']['sync'](this,_0x31d7aa[_0xa92a('0xcb')]);if(!_0x558a95){return this[_0xa92a('0x36')]['error'](_0x31d7aa,_0xa92a('0xcd'));}var _0x335286=this;_0x490a14[_0xa92a('0xce')](function(_0x54ed06,_0x25c0aa){Object[_0xa92a('0xcf')](_0x54ed06)['forEach'](function(_0x5d9a0d){_0x335286['channel'][_0xa92a('0xa3')](util['format'](_0xa92a('0xd0'),_0x558a95,_0x25c0aa,_0x5d9a0d),_0x54ed06[_0x5d9a0d]);});});this[_0xa92a('0x36')][_0xa92a('0xa3')](util[_0xa92a('0x28')](_0xa92a('0xd1'),_0x558a95),_0x490a14[_0xa92a('0x9a')]);return this[_0xa92a('0x36')][_0xa92a('0xb3')](util['format']('variable\x20%s\x20set',_0x558a95));};AGIVertices[_0xa92a('0x17')][_0xa92a('0xd2')]=function(_0x59ed50){logger['debug'](util[_0xa92a('0x28')]('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x59ed50[_0xa92a('0x38')]));if(!this[_0xa92a('0x82')](_0x59ed50[_0xa92a('0xd3')])){return this[_0xa92a('0x36')]['error'](_0x59ed50,'no\x20user\x20selected');}var _0x544ee5=this[_0xa92a('0xd4')]['sync'](this,_0x59ed50['sip_id']);if(!_0x544ee5){return this[_0xa92a('0x36')][_0xa92a('0x32')](_0x59ed50,_0xa92a('0xd5'));}var _0x498252=this[_0xa92a('0x36')][_0xa92a('0x56')](_0xa92a('0xd6'),[util['format'](_0xa92a('0xd7'),_0x544ee5),_0x59ed50[_0xa92a('0x64')],_0x59ed50['opts'],_0x59ed50[_0xa92a('0x62')]]);if(_0x498252[_0xa92a('0xa1')]===-0x1){return _0x498252;}return this[_0xa92a('0x36')][_0xa92a('0xb3')](util[_0xa92a('0x28')](_0xa92a('0xd8'),_0xa92a('0xd6')));};AGIVertices[_0xa92a('0x17')][_0xa92a('0xd9')]=function(_0x68d6f1){logger[_0xa92a('0x2d')](util[_0xa92a('0x28')](_0xa92a('0xda'),_0x68d6f1[_0xa92a('0x38')]));if(!this['isConfigured'](_0x68d6f1[_0xa92a('0x7b')])){return this[_0xa92a('0x36')][_0xa92a('0xb3')](_0xa92a('0xdb'));}if(!this['isConfigured'](_0x68d6f1[_0xa92a('0x5c')])){return this[_0xa92a('0x36')][_0xa92a('0xb3')](_0xa92a('0xb7'));}this['channel'][_0xa92a('0xdc')]=!![];this[_0xa92a('0x35')](_0x68d6f1);this[_0xa92a('0x42')](_0x68d6f1[_0xa92a('0x5c')],'in');this[_0xa92a('0x36')][_0xa92a('0xb3')](util[_0xa92a('0x28')](_0xa92a('0xdd'),_0x68d6f1[_0xa92a('0x5c')]));var _0x4c37f0=this[_0xa92a('0x7a')]['sync'](this,_0x68d6f1);if(_0x4c37f0){for(var _0x388876 in _0x4c37f0){if(_0x4c37f0['hasOwnProperty'](_0x388876)){this['channel'][_0xa92a('0xa3')](util[_0xa92a('0x28')](_0xa92a('0xde'),_0x388876[_0xa92a('0x68')]()),_0x4c37f0[_0x388876]);}}this[_0xa92a('0x42')](_0x4c37f0[_0xa92a('0xdf')],_0xa92a('0xe0'));return this[_0xa92a('0x36')][_0xa92a('0xb3')](util['format'](_0xa92a('0xe1'),_0x4c37f0[_0xa92a('0xdf')]));}return this[_0xa92a('0x36')][_0xa92a('0x32')](_0x68d6f1,_0xa92a('0xe2'));};AGIVertices[_0xa92a('0x17')][_0xa92a('0xe3')]=function(_0x2bdad5){logger[_0xa92a('0x2d')](util[_0xa92a('0x28')]('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x2bdad5[_0xa92a('0x38')]));if(!this[_0xa92a('0x82')](_0x2bdad5[_0xa92a('0xe4')])){return this[_0xa92a('0x36')][_0xa92a('0xb3')](_0xa92a('0xe5'));}if(!this[_0xa92a('0x82')](_0x2bdad5['username'])){return this['channel'][_0xa92a('0xb3')](_0xa92a('0xe6'));}if(!this['isConfigured'](_0x2bdad5['password'])){return this[_0xa92a('0x36')][_0xa92a('0xb3')](_0xa92a('0xe7'));}if(!this[_0xa92a('0x82')](_0x2bdad5['ndassistant_url'])){return this['channel'][_0xa92a('0xb3')](_0xa92a('0xb7'));}this['channel'][_0xa92a('0xdc')]=!![];this[_0xa92a('0x35')](_0x2bdad5);this[_0xa92a('0x42')](_0x2bdad5['text'],'in');this[_0xa92a('0x36')][_0xa92a('0xb3')](util[_0xa92a('0x28')](_0xa92a('0xe8'),_0x2bdad5['text']));var _0x112a80=this[_0xa92a('0x7d')][_0xa92a('0x6f')](this,_0x2bdad5);if(_0x112a80){for(var _0x24d3bb in _0x112a80){if(_0x112a80[_0xa92a('0x94')](_0x24d3bb)){this[_0xa92a('0x36')]['setVariable'](util['format']('SESTEK_NDA_%s',_0x24d3bb[_0xa92a('0x68')]()),_0x112a80[_0x24d3bb]);}}this[_0xa92a('0x42')](_0x112a80[_0xa92a('0xdf')],'out');if(_0x112a80[_0xa92a('0xe9')]){this[_0xa92a('0x36')][_0xa92a('0xb3')](util[_0xa92a('0x28')](_0xa92a('0xea'),_0x112a80[_0xa92a('0xe9')]));var _0x1bcb36=this[_0xa92a('0x36')][_0xa92a('0xeb')](_0x112a80['audiofile']);try{fs[_0xa92a('0xec')](_0x112a80['audiofile']+'.wav');}catch(_0x3b1e20){logger['error'](_0x3b1e20);}return _0x1bcb36;}else{return this[_0xa92a('0x36')][_0xa92a('0xb3')](util[_0xa92a('0x28')](_0xa92a('0xed'),_0x112a80[_0xa92a('0xdf')]));}}return this[_0xa92a('0x36')][_0xa92a('0x32')](_0x2bdad5,'SestekNDA\x20is\x20unreachable');};AGIVertices[_0xa92a('0x17')]['end']=function(_0x429e4a){logger[_0xa92a('0x2d')](util[_0xa92a('0x28')]('Enter\x20in\x20END\x20(%s)\x20block',_0x429e4a['label']));return this[_0xa92a('0x36')][_0xa92a('0xb3')]('end');};AGIVertices[_0xa92a('0x17')][_0xa92a('0xee')]=function(_0x398f9f){logger['info'](util['format'](_0xa92a('0xef'),_0x398f9f[_0xa92a('0x38')]));var _0xf68b41='';if(_0x398f9f['trunk_id']){if(!this[_0xa92a('0x82')](_0x398f9f['trunk_id'])){return this[_0xa92a('0x36')][_0xa92a('0x32')](_0x398f9f,'no\x20trunk\x20selected');}else{var _0x3936e0=parseInt(_0x398f9f[_0xa92a('0xf0')],0xa);if(isNaN(_0x3936e0)){_0xf68b41=_0x398f9f[_0xa92a('0xf0')];}else{_0xf68b41=this['getTrunk']['sync'](this,_0x398f9f[_0xa92a('0xf0')]);if(!_0xf68b41){return this[_0xa92a('0x36')][_0xa92a('0x32')](_0x398f9f,_0xa92a('0xf1'));}}}}else if(_0x398f9f['trunk_name']){_0xf68b41=_0x398f9f[_0xa92a('0xf2')];}else{return this['channel'][_0xa92a('0x32')](_0x398f9f,_0xa92a('0xf3'));}var _0x128d58=this[_0xa92a('0x36')]['exec'](_0xa92a('0xd6'),[util[_0xa92a('0x28')]('SIP/%s/%s',_0xf68b41,_0x398f9f[_0xa92a('0x48')]),_0x398f9f[_0xa92a('0x64')],_0x398f9f[_0xa92a('0xf4')],_0x398f9f[_0xa92a('0x62')]]);if(_0x128d58[_0xa92a('0xa1')]===-0x1){return _0x128d58;}return this[_0xa92a('0x36')][_0xa92a('0xb3')](util[_0xa92a('0x28')]('Executed\x20command\x20%s',_0xa92a('0xd6')));};AGIVertices[_0xa92a('0x17')][_0xa92a('0xf5')]=function(_0x62f9f){logger[_0xa92a('0x2d')](util[_0xa92a('0x28')]('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x62f9f[_0xa92a('0x38')]));return this[_0xa92a('0x36')][_0xa92a('0xb3')](_0xa92a('0xf5'));};AGIVertices['prototype'][_0xa92a('0xb')]=function(_0x186bc8){logger[_0xa92a('0x2d')](util[_0xa92a('0x28')](_0xa92a('0xf6'),_0x186bc8['label']));if(_0x186bc8['retry']===0x0){return this['maxRetry'](_0x186bc8);}_0x186bc8[_0xa92a('0xa5')]-=0x1;if(!this['isConfigured'](_0x186bc8['file_id'])){return this['channel'][_0xa92a('0x32')](_0x186bc8,'no\x20file\x20audio\x20selected');}var _0xe7a621=this[_0xa92a('0xf7')][_0xa92a('0x6f')](this,_0x186bc8[_0xa92a('0xf8')]);if(!_0xe7a621){return this[_0xa92a('0x36')][_0xa92a('0x32')](_0x186bc8,_0xa92a('0xf9'));}if(!this[_0xa92a('0x82')](_0x186bc8[_0xa92a('0xcb')])){return this[_0xa92a('0x36')][_0xa92a('0x32')](_0xa92a('0xcc'));}var _0x31d6ef=this[_0xa92a('0x36')]['getData'](_0xe7a621,_0x186bc8[_0xa92a('0xfa')],_0x186bc8[_0xa92a('0xfb')]);var _0x1ada22=_0x31d6ef[_0xa92a('0xa1')]?_0x31d6ef['result']['toString']():'';logger[_0xa92a('0x2d')](_0xa92a('0xfc'),JSON[_0xa92a('0x73')](_0x31d6ef));if(_0x31d6ef[_0xa92a('0xa1')]===-0x1){this[_0xa92a('0x35')][_0xa92a('0x6f')](this,_0x186bc8,_0x1ada22);return _0x31d6ef;}else if(_0x31d6ef[_0xa92a('0xa2')]===_0xa92a('0x64')){_0x31d6ef['result']=_0x1ada22['length']>=parseInt(_0x186bc8['mindigit'])?'x':'i';}else{_0x31d6ef['result']=_0x1ada22[_0xa92a('0x9a')]>=parseInt(_0x186bc8[_0xa92a('0xfd')])&&_0x1ada22['length']<=parseInt(_0x186bc8[_0xa92a('0xfb')])?'x':'i';}var _0xca878c=this[_0xa92a('0xf')]['sync'](this,_0x186bc8[_0xa92a('0xcb')]);if(!_0xca878c){return this[_0xa92a('0x36')]['error'](_0x186bc8,_0xa92a('0xcd'));}this[_0xa92a('0x36')][_0xa92a('0xa3')](_0xca878c,_0x1ada22);if(this[_0xa92a('0x82')](_0x186bc8[_0xa92a('0xfe')])){var _0x3130c2=parseInt(_0x186bc8['hiddendigitsnum'],0xa);var _0x3b9e3d=rs[_0xa92a('0xff')]({'charset':'*','length':_0x3130c2});var _0x1f7cac=_0x1ada22['length'];if(_0x1f7cac>0x0){if(_0x1f7cac>_0x3130c2){this['createSquareDetailsReport'][_0xa92a('0x6f')](this,_0x186bc8,_0x186bc8[_0xa92a('0x100')]===_0xa92a('0x101')?_0x3b9e3d+_0x1ada22[_0xa92a('0x102')](_0x3130c2):_0x1ada22[_0xa92a('0x102')](0x0,_0x1f7cac-_0x3130c2)+_0x3b9e3d);}else{this['createSquareDetailsReport'][_0xa92a('0x6f')](this,_0x186bc8,rs['generate']({'charset':'*','length':_0x1f7cac}));}}else{this[_0xa92a('0x35')][_0xa92a('0x6f')](this,_0x186bc8,'');}}else{this[_0xa92a('0x35')]['sync'](this,_0x186bc8,_0x1ada22);}return _0x31d6ef;};AGIVertices[_0xa92a('0x17')][_0xa92a('0xc')]=function(_0x5a3e33){logger[_0xa92a('0x2d')](util[_0xa92a('0x28')](_0xa92a('0x103'),_0x5a3e33[_0xa92a('0x38')]));return this['getdigits'](_0x5a3e33);};AGIVertices[_0xa92a('0x17')][_0xa92a('0x104')]=function(_0x2b44d3){logger[_0xa92a('0x2d')](util['format'](_0xa92a('0x105'),_0x2b44d3[_0xa92a('0x38')]));this['createSquareDetailsReport']['sync'](this,_0x2b44d3,_0x2b44d3[_0xa92a('0x106')]);return this[_0xa92a('0x36')]['noop'](util['format'](_0xa92a('0x107'),_0x2b44d3[_0xa92a('0x106')]));};AGIVertices[_0xa92a('0x17')]['awspolly']=function(_0x44ac20){logger['info'](util[_0xa92a('0x28')](_0xa92a('0x108'),_0x44ac20[_0xa92a('0x38')]));if(!this[_0xa92a('0x82')](_0x44ac20[_0xa92a('0x8a')])||!this['isConfigured'](_0x44ac20[_0xa92a('0x85')])){return this['channel'][_0xa92a('0xb3')](_0xa92a('0x109'));}if(!this[_0xa92a('0x82')](_0x44ac20[_0xa92a('0x5c')])){return this[_0xa92a('0x36')]['noop'](_0xa92a('0xb7'));}this[_0xa92a('0x36')]['noop'](util[_0xa92a('0x28')](_0xa92a('0x10a'),_0x44ac20[_0xa92a('0x5c')]));var _0x36836a=this['awsPolly'][_0xa92a('0x6f')](this,_0x44ac20);if(_0x36836a){this[_0xa92a('0x36')][_0xa92a('0xb3')](util[_0xa92a('0x28')](_0xa92a('0x10b'),_0x36836a));var _0x355169=this[_0xa92a('0x36')][_0xa92a('0xeb')](_0x36836a);try{fs[_0xa92a('0xec')](_0x36836a+'.wav');}catch(_0x43a70d){logger['error'](_0x43a70d);}return _0x355169;}return this[_0xa92a('0x36')][_0xa92a('0x32')](_0x44ac20,'aws\x20Polly\x20is\x20unreachable');};AGIVertices[_0xa92a('0x17')][_0xa92a('0x10c')]=function(_0x519c98){logger[_0xa92a('0x2d')](util['format'](_0xa92a('0x10d'),_0x519c98[_0xa92a('0x38')]));if(!this['isConfigured'](_0x519c98[_0xa92a('0x8a')])||!this['isConfigured'](_0x519c98['aws_secret_access_key'])){return this[_0xa92a('0x36')]['noop'](_0xa92a('0x109'));}if(!this[_0xa92a('0x82')](_0x519c98[_0xa92a('0x8c')])){return this[_0xa92a('0x36')][_0xa92a('0xb3')](_0xa92a('0x10e'));}if(!this[_0xa92a('0x82')](_0x519c98[_0xa92a('0x5c')])){return this['channel']['noop']('no\x20text\x20configured');}this['channel'][_0xa92a('0xdc')]=!![];this['createSquareDetailsReport'](_0x519c98);this[_0xa92a('0x42')](_0x519c98[_0xa92a('0x5c')],'in');this[_0xa92a('0x36')][_0xa92a('0xb3')](util['format'](_0xa92a('0x10f'),_0x519c98['text']));var _0x1a9676=this[_0xa92a('0x89')][_0xa92a('0x6f')](this,_0x519c98);if(_0x1a9676){for(var _0x25a5a7 in _0x1a9676){if(_0x1a9676[_0xa92a('0x94')](_0x25a5a7)&&_[_0xa92a('0x95')](_0x1a9676[_0x25a5a7])){this['channel'][_0xa92a('0xa3')](util[_0xa92a('0x28')](_0xa92a('0x110'),_0x25a5a7[_0xa92a('0x68')]()),_0x1a9676[_0x25a5a7]);}}if(_[_0xa92a('0x46')](_0x1a9676[_0xa92a('0x77')])){return this['channel']['noop'](_0xa92a('0x111'));}else{this['createSquareMessage'](_0x1a9676[_0xa92a('0x77')],_0xa92a('0xe0'));return this[_0xa92a('0x36')][_0xa92a('0xb3')](util[_0xa92a('0x28')](_0xa92a('0x112'),_0x1a9676['message']));}}return this[_0xa92a('0x36')]['error'](_0x519c98,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices['prototype'][_0xa92a('0x113')]=function(_0xbebe53){logger[_0xa92a('0x2d')](util['format']('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0xbebe53[_0xa92a('0x38')],_0xbebe53['timeout']));if(!this[_0xa92a('0x82')](_0xbebe53[_0xa92a('0x7b')])){return this[_0xa92a('0x36')][_0xa92a('0xb3')]('no\x20key\x20configured');}var _0x94ee51='wav';var _0x2a10a8=util[_0xa92a('0x28')](_0xa92a('0x114'),FILES_PATH,rs[_0xa92a('0xff')](0x4));var _0x36c5e4=util['format'](_0xa92a('0x9d'),_0x2a10a8,_0x94ee51);var _0x1a891b=!![];if(_0xbebe53[_0xa92a('0x115')]==='NOBEEP'){_0x1a891b=![];}var _0x31c034=this[_0xa92a('0x36')]['recordFile'](_0x2a10a8,_0x94ee51,_0xbebe53['intKey'],_0xbebe53[_0xa92a('0x64')],undefined,_0x1a891b);if(_0x31c034[_0xa92a('0xa1')]!==-0x1){this[_0xa92a('0x36')][_0xa92a('0xb3')](util[_0xa92a('0x28')]('google\x20%s\x20file\x20created',_0x36c5e4));var _0x5ada3a=this[_0xa92a('0x8d')]['sync'](this,_0xbebe53,_0x36c5e4);if(_0x5ada3a){for(var _0x7b3c18 in _0x5ada3a){if(_0x5ada3a[_0xa92a('0x94')](_0x7b3c18)){this['channel'][_0xa92a('0xa3')](util[_0xa92a('0x28')](_0xa92a('0x116'),_0x7b3c18[_0xa92a('0x68')]()),_0x5ada3a[_0x7b3c18]);}}return this[_0xa92a('0x36')]['noop'](util[_0xa92a('0x28')](_0xa92a('0x117'),JSON[_0xa92a('0x73')](_0x5ada3a)));}}return _0x31c034;};AGIVertices['prototype'][_0xa92a('0x118')]=function(_0x437cbb){logger[_0xa92a('0x2d')](util[_0xa92a('0x28')](_0xa92a('0x119'),_0x437cbb[_0xa92a('0x38')]));if(!this[_0xa92a('0x82')](_0x437cbb[_0xa92a('0x90')])){return this[_0xa92a('0x36')][_0xa92a('0xb3')]('no\x20appid\x20configured');}if(!this[_0xa92a('0x82')](_0x437cbb[_0xa92a('0x91')])){return this[_0xa92a('0x36')][_0xa92a('0xb3')](_0xa92a('0x11a'));}var _0x14f80e=_0xa92a('0x11b');var _0x38c036=util[_0xa92a('0x28')](_0xa92a('0x114'),FILES_PATH,rs['generate'](0x4));var _0x4a4bf6=util[_0xa92a('0x28')](_0xa92a('0x9d'),_0x38c036,_0x14f80e);var _0x37a802=!![];if(_0x437cbb[_0xa92a('0x115')]==='NOBEEP'){_0x37a802=![];}var _0x4c8e55=this[_0xa92a('0x36')][_0xa92a('0x11c')](_0x38c036,_0x14f80e,_0x437cbb[_0xa92a('0x11d')],_0x437cbb[_0xa92a('0x64')],undefined,_0x37a802);if(_0x4c8e55[_0xa92a('0xa1')]!==-0x1){this[_0xa92a('0x36')][_0xa92a('0xb3')](util[_0xa92a('0x28')]('tilde\x20%s\x20file\x20created',_0x4a4bf6));var _0x16cad2=this['tildeASR'][_0xa92a('0x6f')](this,_0x437cbb,_0x4a4bf6);if(_0x16cad2){for(var _0x4d0b32 in _0x16cad2){if(_0x16cad2['hasOwnProperty'](_0x4d0b32)){this[_0xa92a('0x36')][_0xa92a('0xa3')](util[_0xa92a('0x28')](_0xa92a('0x11e'),_0x4d0b32[_0xa92a('0x68')]()),_0x16cad2[_0x4d0b32]);}}return this['channel'][_0xa92a('0xb3')](util[_0xa92a('0x28')](_0xa92a('0x11f'),JSON[_0xa92a('0x73')](_0x16cad2)));}}return _0x4c8e55;};AGIVertices[_0xa92a('0x17')][_0xa92a('0x120')]=function(_0x153a91){logger[_0xa92a('0x2d')](util[_0xa92a('0x28')](_0xa92a('0x121'),_0x153a91[_0xa92a('0x38')]));return this[_0xa92a('0x36')][_0xa92a('0x122')](_0x153a91['context'],_0x153a91[_0xa92a('0x3e')],_0x153a91['priority']);};AGIVertices['prototype'][_0xa92a('0x123')]=function(_0x397ca6){logger['info'](util[_0xa92a('0x28')](_0xa92a('0x124'),_0x397ca6['label']));if(!this[_0xa92a('0x82')](_0x397ca6[_0xa92a('0x125')])){return this[_0xa92a('0x36')][_0xa92a('0x32')](_0x397ca6,'no\x20condition\x20configured');}try{var _0x123f5a=eval(_0x397ca6[_0xa92a('0x125')])?_0xa92a('0x126'):_0xa92a('0x127');this['channel'][_0xa92a('0xb3')](util['format'](_0xa92a('0x128'),_0x397ca6['condition'],_0x123f5a));return{'code':0xc8,'result':_0x123f5a};}catch(_0x41833b){return{'code':0xc8,'result':_0xa92a('0x127')};}};AGIVertices['prototype']['gotoiftime']=function(_0x36087f){logger[_0xa92a('0x2d')](util[_0xa92a('0x28')](_0xa92a('0x129'),_0x36087f[_0xa92a('0x38')]));if(!this[_0xa92a('0x82')](_0x36087f[_0xa92a('0x12a')])){return this[_0xa92a('0x36')][_0xa92a('0x32')](_0x36087f,_0xa92a('0x12b'));}var _0x4462c1=this[_0xa92a('0x23')][_0xa92a('0x6f')](this,_0x36087f['interval_id']);if(!_0x4462c1){return this['channel'][_0xa92a('0x32')](_0x36087f,_0xa92a('0x12c'));}for(var _0x30cedd=0x0;_0x30cedd<_0x4462c1['length'];_0x30cedd+=0x1){var _0x403eab=this[_0xa92a('0x36')][_0xa92a('0xf')](util[_0xa92a('0x28')](_0xa92a('0x12d'),_0x4462c1[_0x30cedd]));if(_0x403eab[_0xa92a('0xa1')]===-0x1){return _0x403eab;}logger['info'](util[_0xa92a('0x28')]('IFTIME\x20%s\x20%s',_0x4462c1[_0x30cedd],_0x403eab[_0xa92a('0xa2')]));if(_0x403eab[_0xa92a('0xa2')]===_0xa92a('0x126')){logger[_0xa92a('0x2d')](util[_0xa92a('0x28')]('IFTIME\x20%s\x20%s',_0x4462c1[_0x30cedd],_0xa92a('0x126')));this[_0xa92a('0x36')][_0xa92a('0xb3')](util[_0xa92a('0x28')](_0xa92a('0x12e'),_0x4462c1[_0x30cedd],_0xa92a('0x126')));return{'code':0xc8,'result':_0xa92a('0x126')};}else{logger['info'](util[_0xa92a('0x28')](_0xa92a('0x12e'),_0x4462c1[_0x30cedd],_0xa92a('0x127')));this[_0xa92a('0x36')][_0xa92a('0xb3')](util[_0xa92a('0x28')]('IFTIME\x20%s\x20%s',_0x4462c1[_0x30cedd],_0xa92a('0x127')));}}return{'code':0xc8,'result':'false'};};AGIVertices['prototype']['hangup']=function(_0x1fbca0){logger['info'](util[_0xa92a('0x28')](_0xa92a('0x12f'),_0x1fbca0[_0xa92a('0x38')]));return this[_0xa92a('0x36')][_0xa92a('0x130')]();};AGIVertices[_0xa92a('0x17')][_0xa92a('0x131')]=function(_0x12efb3){logger[_0xa92a('0x2d')](util['format'](_0xa92a('0x132'),_0x12efb3[_0xa92a('0x38')]));if(!this[_0xa92a('0x82')](_0x12efb3['key'])){return this[_0xa92a('0x36')][_0xa92a('0xb3')](_0xa92a('0xdb'));}var _0x1922ce='wav';var _0x4d00b3=util[_0xa92a('0x28')](_0xa92a('0x114'),FILES_PATH,rs[_0xa92a('0xff')](0x4));var _0x291546=util[_0xa92a('0x28')](_0xa92a('0x9d'),_0x4d00b3,_0x1922ce);var _0x4a4edb=!![];if(_0x12efb3['beep']===_0xa92a('0x133')){_0x4a4edb=![];}var _0x4ee2ed=this['channel'][_0xa92a('0x11c')](_0x4d00b3,_0x1922ce,_0x12efb3[_0xa92a('0x11d')],_0x12efb3[_0xa92a('0x64')],undefined,_0x4a4edb);if(_0x4ee2ed['result']!==-0x1){this[_0xa92a('0x36')][_0xa92a('0xb3')](util['format'](_0xa92a('0x134'),_0x291546));var _0x3f9535=this[_0xa92a('0x81')]['sync'](this,_0x12efb3,_0x291546);if(_0x3f9535){for(var _0x2ca1e0 in _0x3f9535){if(_0x3f9535[_0xa92a('0x94')](_0x2ca1e0)){this[_0xa92a('0x36')][_0xa92a('0xa3')](util[_0xa92a('0x28')](_0xa92a('0x135'),_0x2ca1e0[_0xa92a('0x68')]()),_0x3f9535[_0x2ca1e0]);}}return this[_0xa92a('0x36')][_0xa92a('0xb3')](util[_0xa92a('0x28')](_0xa92a('0x136'),JSON[_0xa92a('0x73')](_0x3f9535)));}}return _0x4ee2ed;};AGIVertices[_0xa92a('0x17')][_0xa92a('0x137')]=function(_0x37747c){logger[_0xa92a('0x2d')](util[_0xa92a('0x28')](_0xa92a('0x138'),_0x37747c[_0xa92a('0x38')]));if(!this['isConfigured'](_0x37747c[_0xa92a('0x7b')])){return this[_0xa92a('0x36')][_0xa92a('0xb3')](_0xa92a('0xdb'));}if(!this[_0xa92a('0x82')](_0x37747c[_0xa92a('0x5c')])){return this[_0xa92a('0x36')]['noop'](_0xa92a('0xb7'));}this[_0xa92a('0x36')][_0xa92a('0xb3')](util[_0xa92a('0x28')](_0xa92a('0x139'),_0x37747c['text']));var _0x362cda=this[_0xa92a('0x7e')][_0xa92a('0x6f')](this,_0x37747c);if(_0x362cda){this[_0xa92a('0x36')][_0xa92a('0xb3')](util[_0xa92a('0x28')](_0xa92a('0x134'),_0x362cda));var _0x8641da=this['channel'][_0xa92a('0xeb')](_0x362cda,_0x37747c['intKey']);try{fs[_0xa92a('0xec')](_0x362cda+_0xa92a('0x13a'));}catch(_0x95fb1c){logger['error'](_0x95fb1c);}return _0x8641da;}return this[_0xa92a('0x36')]['error'](_0x37747c,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices['prototype'][_0xa92a('0x13b')]=function(_0x29acc6){logger[_0xa92a('0x2d')](util[_0xa92a('0x28')](_0xa92a('0x13c'),_0x29acc6[_0xa92a('0x38')]));if(!this[_0xa92a('0x82')](_0x29acc6[_0xa92a('0x13d')])){return this[_0xa92a('0x36')]['error'](_0x29acc6,_0xa92a('0x13e'));}logger[_0xa92a('0x2d')](util[_0xa92a('0x28')](_0xa92a('0x13f'),this[_0xa92a('0x36')]['callerid'],_0x29acc6['findBy']));var _0x2a3bc5=this[_0xa92a('0x54')][_0xa92a('0x6f')](this,_0x29acc6[_0xa92a('0x13d')]);if(_0x2a3bc5){logger['info'](util['format']('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0xa92a('0x3c')],_0x29acc6[_0xa92a('0x13d')]));this[_0xa92a('0x36')][_0xa92a('0xb3')](util[_0xa92a('0x28')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xa92a('0x36')][_0xa92a('0x3c')],_0x29acc6[_0xa92a('0x13d')]));return{'code':0xc8,'result':_0xa92a('0x140')};}else{logger[_0xa92a('0x2d')](util[_0xa92a('0x28')](_0xa92a('0x141'),this[_0xa92a('0x36')][_0xa92a('0x3c')],_0x29acc6['findBy']));this[_0xa92a('0x36')][_0xa92a('0xb3')](util[_0xa92a('0x28')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xa92a('0x36')]['callerid'],_0x29acc6[_0xa92a('0x13d')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xa92a('0x17')][_0xa92a('0x142')]=function(_0x40c191){logger[_0xa92a('0x2d')](util[_0xa92a('0x28')](_0xa92a('0x143'),_0x40c191[_0xa92a('0x38')]));if(!this[_0xa92a('0x82')](_0x40c191[_0xa92a('0x13d')])){return this[_0xa92a('0x36')][_0xa92a('0x32')](_0x40c191,_0xa92a('0x13e'));}logger[_0xa92a('0x2d')](util[_0xa92a('0x28')](_0xa92a('0x13f'),this[_0xa92a('0x36')][_0xa92a('0x3c')],_0x40c191[_0xa92a('0x13d')]));var _0x319b8e=this[_0xa92a('0x53')][_0xa92a('0x6f')](this,_0x40c191['findBy']);if(_0x319b8e){logger[_0xa92a('0x2d')](util['format'](_0xa92a('0x144'),this[_0xa92a('0x36')][_0xa92a('0x3c')],_0x40c191[_0xa92a('0x13d')]));this[_0xa92a('0x36')][_0xa92a('0xb3')](util[_0xa92a('0x28')](_0xa92a('0x144'),this[_0xa92a('0x36')][_0xa92a('0x3c')],_0x40c191[_0xa92a('0x13d')]));return{'code':0xc8,'result':_0xa92a('0x140')};}else{logger[_0xa92a('0x2d')](util[_0xa92a('0x28')](_0xa92a('0x141'),this[_0xa92a('0x36')][_0xa92a('0x3c')],_0x40c191[_0xa92a('0x13d')]));this[_0xa92a('0x36')]['noop'](util['format'](_0xa92a('0x141'),this[_0xa92a('0x36')]['callerid'],_0x40c191[_0xa92a('0x13d')]));return{'code':0xc8,'result':_0xa92a('0x145')};}};AGIVertices[_0xa92a('0x17')]['math']=function(_0x46d930){logger[_0xa92a('0x2d')](util[_0xa92a('0x28')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0x46d930[_0xa92a('0x38')]));if(!this[_0xa92a('0x82')](_0x46d930['operation'])){return this[_0xa92a('0x36')]['error'](_0x46d930,_0xa92a('0x146'));}this[_0xa92a('0x36')][_0xa92a('0xb3')](util[_0xa92a('0x28')](_0xa92a('0x147'),_0x46d930[_0xa92a('0x148')]));var _0x33a1f7=eval(_0x46d930[_0xa92a('0x148')]);if(!this[_0xa92a('0x82')](_0x46d930[_0xa92a('0xcb')])){return this[_0xa92a('0x36')]['noop'](_0xa92a('0xcc'));}var _0x5eaf2f=this['getVariable']['sync'](this,_0x46d930['variable_id']);if(!_0x5eaf2f){return this['channel']['error'](_0x46d930,'no\x20variable\x20found');}if(_[_0xa92a('0x99')](_0x33a1f7)){var _0x168619=this;_0x33a1f7[_0xa92a('0xce')](function(_0x44547b,_0x2ba57a){_0x168619[_0xa92a('0x36')][_0xa92a('0xa3')](util['format'](_0xa92a('0x149'),_0x5eaf2f,_0x2ba57a),_0x44547b);});return this[_0xa92a('0x36')][_0xa92a('0xb3')](util[_0xa92a('0x28')]('variable\x20%s[key]\x20set',_0x5eaf2f));}else{return this[_0xa92a('0x36')][_0xa92a('0xa3')](_0x5eaf2f,_0x33a1f7);}};AGIVertices[_0xa92a('0x17')][_0xa92a('0xa')]=function(_0x5afd9b){logger[_0xa92a('0x2d')](util[_0xa92a('0x28')](_0xa92a('0x14a'),_0x5afd9b['label']));if(_0x5afd9b[_0xa92a('0xa5')]===0x0){return this[_0xa92a('0xa4')](_0x5afd9b);}_0x5afd9b[_0xa92a('0xa5')]-=0x1;if(!this['isConfigured'](_0x5afd9b[_0xa92a('0xf8')])){return this[_0xa92a('0x36')][_0xa92a('0x32')](_0x5afd9b,_0xa92a('0x14b'));}var _0x5b65b2=this['getSound'][_0xa92a('0x6f')](this,_0x5afd9b[_0xa92a('0xf8')]);if(!_0x5b65b2){return this[_0xa92a('0x36')][_0xa92a('0x32')](_0x5afd9b,_0xa92a('0xf9'));}var _0x20bae8=this[_0xa92a('0x36')]['getData'](_0x5b65b2,_0x5afd9b[_0xa92a('0xfa')],_0x5afd9b[_0xa92a('0x14c')]);var _0x210a44=_0x20bae8[_0xa92a('0xa1')];if(_0x20bae8[_0xa92a('0xa1')]===-0x1){this['createSquareDetailsReport'][_0xa92a('0x6f')](this,_0x5afd9b,'-1');return _0x20bae8;}else if(_0x20bae8['extra']===_0xa92a('0x64')){_0x20bae8[_0xa92a('0xa1')]=_0x20bae8[_0xa92a('0xa1')][_0xa92a('0x9a')]>0x0?_0x20bae8[_0xa92a('0xa1')]:'t';}else if(_[_0xa92a('0x45')](_0x20bae8[_0xa92a('0xa1')])){_0x20bae8[_0xa92a('0xa1')]='#';_0x210a44='#';}if(!this[_0xa92a('0x82')](_0x5afd9b['variable_id'])){this['channel'][_0xa92a('0xb3')]('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x3c061f=this[_0xa92a('0xf')][_0xa92a('0x6f')](this,_0x5afd9b[_0xa92a('0xcb')]);if(!_0x3c061f){return this[_0xa92a('0x36')][_0xa92a('0x32')](_0x5afd9b,'no\x20variable\x20found');}this[_0xa92a('0x36')][_0xa92a('0xa3')](_0x3c061f,_0x210a44);}this[_0xa92a('0x35')][_0xa92a('0x6f')](this,_0x5afd9b,_0x210a44);return _0x20bae8;};AGIVertices['prototype'][_0xa92a('0xb3')]=function(_0x28195d){logger['info'](util[_0xa92a('0x28')](_0xa92a('0x14d'),_0x28195d[_0xa92a('0x38')]));return this[_0xa92a('0x36')][_0xa92a('0xb3')](_0x28195d[_0xa92a('0x14e')]||_0x28195d['label']);};AGIVertices[_0xa92a('0x17')][_0xa92a('0x14f')]=function(_0x127c54){logger['info'](util[_0xa92a('0x28')](_0xa92a('0x150'),_0x127c54['label']));if(!this[_0xa92a('0x82')](_0x127c54[_0xa92a('0x13d')])){return this[_0xa92a('0x36')]['error'](_0x127c54,_0xa92a('0x13e'));}logger[_0xa92a('0x2d')](util[_0xa92a('0x28')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xa92a('0x36')][_0xa92a('0x3c')],_0x127c54[_0xa92a('0x13d')]));var _0x5d2af4=this[_0xa92a('0x4e')]['sync'](this,_0x127c54[_0xa92a('0x151')]);var _0x1a01cf=this[_0xa92a('0x50')]['sync'](this,_0x127c54['findBy'],_0x5d2af4);if(_0x1a01cf){logger['info'](util[_0xa92a('0x28')](_0xa92a('0x144'),this[_0xa92a('0x36')][_0xa92a('0x3c')],_0x127c54[_0xa92a('0x13d')]));this[_0xa92a('0x36')][_0xa92a('0xb3')](util[_0xa92a('0x28')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xa92a('0x36')][_0xa92a('0x3c')],_0x127c54['findBy']));return{'code':0xc8,'result':_0xa92a('0x140')};}else{logger[_0xa92a('0x2d')](util[_0xa92a('0x28')](_0xa92a('0x141'),this[_0xa92a('0x36')][_0xa92a('0x3c')],_0x127c54[_0xa92a('0x13d')]));this[_0xa92a('0x36')][_0xa92a('0xb3')](util[_0xa92a('0x28')](_0xa92a('0x144'),this[_0xa92a('0x36')][_0xa92a('0x3c')],_0x127c54[_0xa92a('0x13d')]));return{'code':0xc8,'result':_0xa92a('0x145')};}};AGIVertices['prototype'][_0xa92a('0x152')]=function(_0x13dccf){logger['info'](util['format']('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x13dccf[_0xa92a('0x38')]));if(!this[_0xa92a('0x82')](_0x13dccf['file_id'])){return this[_0xa92a('0x36')][_0xa92a('0x32')](_0x13dccf,_0xa92a('0x14b'));}var _0x33569b=this['getSound'][_0xa92a('0x6f')](this,_0x13dccf[_0xa92a('0xf8')]);if(!_0x33569b){return this['channel'][_0xa92a('0x32')](_0x13dccf,_0xa92a('0xf9'));}var _0x3edcd5=this['channel'][_0xa92a('0x56')](_0xa92a('0x153'),[_0x33569b,_0x13dccf[_0xa92a('0xf4')]]);if(_0x3edcd5[_0xa92a('0xa1')]===-0x1){return _0x3edcd5;}return this[_0xa92a('0x36')][_0xa92a('0xb3')](util[_0xa92a('0x28')](_0xa92a('0xb4'),_0xa92a('0x153'),_0x33569b));};AGIVertices[_0xa92a('0x17')][_0xa92a('0x154')]=function(_0x439fe3){logger['info'](util[_0xa92a('0x28')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x439fe3['label']));if(!this['isConfigured'](_0x439fe3[_0xa92a('0x155')])){return this[_0xa92a('0x36')][_0xa92a('0x32')](_0x439fe3,_0xa92a('0x156'));}var _0x56ffdb='';var _0x11fb34=parseInt(_0x439fe3[_0xa92a('0x155')],0xa);if(isNaN(_0x11fb34)){_0x56ffdb=_0x439fe3['queue_id'];}else{_0x56ffdb=this[_0xa92a('0x12')][_0xa92a('0x6f')](this,_0x439fe3[_0xa92a('0x155')]);if(!_0x56ffdb){return this[_0xa92a('0x36')][_0xa92a('0x32')](_0x439fe3,'no\x20queue\x20found');}}var _0x52cdf3='';if(this[_0xa92a('0x82')](_0x439fe3[_0xa92a('0xf8')])){var _0x132622=this[_0xa92a('0xf7')][_0xa92a('0x6f')](this,_0x439fe3[_0xa92a('0xf8')]);if(_0x132622){_0x52cdf3=_0x132622;}}this['createSquareDetailsReport']['sync'](this,_0x439fe3,_0x56ffdb);if(_0x439fe3[_0xa92a('0xf4')][_0xa92a('0x157')]('x')<0x0){_0x439fe3[_0xa92a('0xf4')]+='x';}if(_0x439fe3[_0xa92a('0xf4')]['indexOf']('X')<0x0){_0x439fe3[_0xa92a('0xf4')]+='X';}this[_0xa92a('0x36')][_0xa92a('0xa3')](_0xa92a('0x158'),_0x56ffdb?_0x56ffdb[_0xa92a('0x159')]():'');var _0x31bbd0=this[_0xa92a('0x36')]['exec'](_0xa92a('0x15a'),[_0x56ffdb,_0x439fe3[_0xa92a('0xf4')],_0x439fe3[_0xa92a('0x62')],_0x52cdf3,_0x439fe3[_0xa92a('0x64')],_0x439fe3[_0xa92a('0xa6')],_0x439fe3['macro'],_0x439fe3[_0xa92a('0x15b')],'',_0x439fe3[_0xa92a('0x15c')]]);if(_0x31bbd0['result']===-0x1){return _0x31bbd0;}return this['channel'][_0xa92a('0xb3')](util[_0xa92a('0x28')](_0xa92a('0xb4'),'QUEUE',_0x56ffdb));};AGIVertices[_0xa92a('0x17')][_0xa92a('0x15d')]=function(_0x10d589){logger['info'](util[_0xa92a('0x28')](_0xa92a('0x15e'),_0x10d589['label']));var _0x38e12e=_0x10d589[_0xa92a('0x15f')]||_0xa92a('0x11b');var _0x328ce2=util['format']('%s_%s',this[_0xa92a('0x36')][_0xa92a('0x37')],rs[_0xa92a('0xff')](0x5));var _0x154ca1=util[_0xa92a('0x28')]('%s/recordings/%s.%s',FILES_PATH,_0x328ce2,_0x38e12e);var _0x4f7f87=util[_0xa92a('0x28')](_0xa92a('0x114'),FILES_PATH,_0x328ce2);this[_0xa92a('0x3b')][_0xa92a('0x6f')](this,_0x10d589,_0x328ce2,_0x154ca1);this[_0xa92a('0x36')][_0xa92a('0xa3')](_0xa92a('0x160'),_0x328ce2);logger[_0xa92a('0x2d')](_0xa92a('0x161'),_0x4f7f87,_0x38e12e,_0x10d589[_0xa92a('0x162')],_0x10d589[_0xa92a('0x64')]);return this['channel'][_0xa92a('0x11c')](_0x4f7f87,_0x38e12e,_0x10d589[_0xa92a('0x162')],_0x10d589[_0xa92a('0x64')],undefined,!![]);};AGIVertices[_0xa92a('0x17')][_0xa92a('0x163')]=function(_0x3e6a79){logger['info'](util[_0xa92a('0x28')](_0xa92a('0x164'),_0x3e6a79[_0xa92a('0x38')]));if(!this[_0xa92a('0x82')](_0x3e6a79[_0xa92a('0x62')])){return this[_0xa92a('0x36')][_0xa92a('0xb3')](_0xa92a('0x165'));}var _0x29779b=this['restAPI']['sync'](this,_0x3e6a79);logger[_0xa92a('0x2d')](util[_0xa92a('0x28')]('Response:',util[_0xa92a('0x166')](_0x29779b,{'showHidden':![],'depth':null})));if(!this[_0xa92a('0x82')](_0x3e6a79['variable_id'])){return this[_0xa92a('0x36')][_0xa92a('0xb3')](_0xa92a('0x167'));}var _0x548366=this[_0xa92a('0xf')][_0xa92a('0x6f')](this,_0x3e6a79[_0xa92a('0xcb')]);if(!_0x548366){return this[_0xa92a('0x36')]['error'](_0x3e6a79,'no\x20variable\x20found');}this['channel']['setVariable'](util[_0xa92a('0x28')](_0xa92a('0x168'),_0x548366),_0x29779b[_0xa92a('0x75')]?_0x29779b['statusCode']:_0xa92a('0x169'));this[_0xa92a('0x36')][_0xa92a('0xa3')](util[_0xa92a('0x28')](_0xa92a('0x16a'),_0x548366),_0x29779b[_0xa92a('0x76')]?_0x29779b['statusMessage']:'OK');if(_0x29779b['body']){try{this['saveRestApiResult'](_0x29779b[_0xa92a('0x72')],_0x548366);}catch(_0x4a6400){logger[_0xa92a('0x32')](util[_0xa92a('0x28')](_0xa92a('0x16b'),_0x548366));}}return this[_0xa92a('0x36')][_0xa92a('0xb3')](util[_0xa92a('0x28')]('variable\x20%s\x20set',_0x548366));};AGIVertices[_0xa92a('0x17')][_0xa92a('0x16c')]=function(_0x44f22a){logger[_0xa92a('0x2d')](util['format'](_0xa92a('0x16d'),_0x44f22a[_0xa92a('0x38')]));return this['channel'][_0xa92a('0x16e')](_0x44f22a[_0xa92a('0x16f')][_0xa92a('0x58')](/\s+/g,''),_0x44f22a[_0xa92a('0x162')]);};AGIVertices[_0xa92a('0x17')]['saynumber']=function(_0x3a8d17){logger['info'](util['format'](_0xa92a('0x170'),_0x3a8d17[_0xa92a('0x38')]));return this['channel']['sayNumber'](_0x3a8d17[_0xa92a('0x171')][_0xa92a('0x58')](/\s+/g,''),_0x3a8d17['escape_digits']);};AGIVertices['prototype']['sayphonetic']=function(_0x20246c){logger[_0xa92a('0x2d')](util[_0xa92a('0x28')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x20246c[_0xa92a('0x38')]));return this[_0xa92a('0x36')][_0xa92a('0x172')](_0x20246c['text'],_0x20246c['escape_digits']);};AGIVertices[_0xa92a('0x17')][_0xa92a('0x173')]=function(_0x3dd2af){logger[_0xa92a('0x2d')](util[_0xa92a('0x28')](_0xa92a('0x174'),_0x3dd2af['label']));if(!this[_0xa92a('0x82')](_0x3dd2af['account_id'])){return this['channel'][_0xa92a('0xb3')](_0xa92a('0x175'));}var _0x2926b2=this['getMailAccount'][_0xa92a('0x6f')](this,_0x3dd2af[_0xa92a('0x176')]);if(!_0x2926b2||!_0x2926b2[_0xa92a('0x177')]){return this[_0xa92a('0x36')][_0xa92a('0x32')](_0x3dd2af,_0xa92a('0x178'));}var _0x3aaaf6={'from':util[_0xa92a('0x28')](_0xa92a('0x179'),_0x2926b2[_0xa92a('0x10')],_0x2926b2['email']||_0x2926b2['Smtp'][_0xa92a('0x17a')]),'to':_0x3dd2af['to']||'','cc':_0x3dd2af['cc']||'','bcc':_0x3dd2af[_0xa92a('0x17b')]||'','subject':_0x3dd2af[_0xa92a('0x17c')],'html':_0x3dd2af['text'],'text':_0x3dd2af[_0xa92a('0x5c')]};var _0x2dd587={'tls':{'rejectUnauthorized':![]}};if(_0x2926b2[_0xa92a('0x177')][_0xa92a('0x17d')]){_0x2dd587[_0xa92a('0x17d')]=_0x2926b2[_0xa92a('0x177')][_0xa92a('0x17d')];}else{_0x2dd587[_0xa92a('0x17e')]=_0x2926b2[_0xa92a('0x177')][_0xa92a('0x17e')];_0x2dd587[_0xa92a('0x17f')]=_0x2926b2['Smtp'][_0xa92a('0x17f')];_0x2dd587['secure']=_0x2926b2[_0xa92a('0x177')][_0xa92a('0x180')];}if(_0x2926b2['Smtp'][_0xa92a('0x181')]){_0x2dd587['auth']={'user':_0x2926b2[_0xa92a('0x177')]['user'],'pass':_0x2926b2['Smtp'][_0xa92a('0x182')]};}if(this[_0xa92a('0x82')](_0x3dd2af['template_id'])){}logger['debug'](_0xa92a('0x183'),JSON[_0xa92a('0x73')](_0x3aaaf6));this['createSquareDetailsReport'][_0xa92a('0x6f')](this,_0x3dd2af,_0x3dd2af[_0xa92a('0x176')]);this[_0xa92a('0x36')][_0xa92a('0xb3')](util[_0xa92a('0x28')](_0xa92a('0x184'),_0x2926b2['name']));this['sendMailMessage'][_0xa92a('0x6f')](this,_0x2dd587,_0x3aaaf6);return this[_0xa92a('0x36')][_0xa92a('0xb3')](_0xa92a('0x185'));};AGIVertices[_0xa92a('0x17')][_0xa92a('0x186')]=function(_0x405fc4){logger[_0xa92a('0x2d')](util['format'](_0xa92a('0x187'),_0x405fc4[_0xa92a('0x38')]));return this[_0xa92a('0x36')]['noop']('SENDFAX\x20block\x20not\x20implemented');};AGIVertices['prototype'][_0xa92a('0x188')]=function(_0x397b60){logger[_0xa92a('0x2d')](util[_0xa92a('0x28')](_0xa92a('0x189'),_0x397b60[_0xa92a('0x38')]));if(!this['isConfigured'](_0x397b60[_0xa92a('0x18a')])){return this[_0xa92a('0x36')]['noop'](_0xa92a('0x18b'));}var _0x39a82e=this[_0xa92a('0x18c')]['sync'](this,_0x397b60[_0xa92a('0x18a')]);if(!_0x39a82e){return this[_0xa92a('0x36')][_0xa92a('0x32')](_0x397b60,_0xa92a('0x18d'));}var _0x30d9bc={'body':_0x397b60['sms_text'],'phone':_0x397b60['to']||'','SmsAccountId':_0x39a82e['id']};logger[_0xa92a('0x18e')](_0xa92a('0x18f'),JSON[_0xa92a('0x73')](_0x30d9bc));this['createSquareDetailsReport'][_0xa92a('0x6f')](this,_0x397b60,_0x397b60[_0xa92a('0x18a')]);this[_0xa92a('0x36')][_0xa92a('0xb3')](util[_0xa92a('0x28')](_0xa92a('0x190'),_0x39a82e['name']));this[_0xa92a('0x34')][_0xa92a('0x6f')](this,_0x30d9bc);return this[_0xa92a('0x36')][_0xa92a('0xb3')]('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0xa92a('0x17')][_0xa92a('0x191')]=function(_0x34eb69){logger[_0xa92a('0x2d')](util['format'](_0xa92a('0x192'),_0x34eb69[_0xa92a('0x38')]));if(!this[_0xa92a('0x82')](_0x34eb69[_0xa92a('0xcb')])){return this[_0xa92a('0x36')][_0xa92a('0x32')](_0x34eb69,'no\x20variable\x20selected');}var _0x534500=this[_0xa92a('0xf')][_0xa92a('0x6f')](this,_0x34eb69[_0xa92a('0xcb')]);if(!_0x534500){return this['channel']['error'](_0x34eb69,_0xa92a('0xcd'));}return this[_0xa92a('0x36')][_0xa92a('0xa3')](_0x534500,_0x34eb69[_0xa92a('0x193')]);};AGIVertices[_0xa92a('0x17')]['start']=function(_0x33cb36){logger[_0xa92a('0x2d')](util['format'](_0xa92a('0x194'),_0x33cb36['label']));this['channel'][_0xa92a('0xb3')](_0xa92a('0x195'));if(_0x33cb36[_0xa92a('0xa9')]===_0xa92a('0x196')){this[_0xa92a('0x36')][_0xa92a('0xb3')](_0xa92a('0x197'));return this[_0xa92a('0x36')][_0xa92a('0xa9')]();}return this[_0xa92a('0x36')][_0xa92a('0xb3')](_0xa92a('0x198'));};AGIVertices[_0xa92a('0x17')][_0xa92a('0x199')]=function(_0x646756){logger['info'](util[_0xa92a('0x28')]('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x646756[_0xa92a('0x38')]));if(!this[_0xa92a('0x82')](_0x646756[_0xa92a('0x19a')])){return this[_0xa92a('0x36')]['error'](_0x646756,'no\x20subproject\x20selected');}var _0x1a226c=this[_0xa92a('0x15')][_0xa92a('0x6f')](this,_0x646756[_0xa92a('0x19a')]);if(!this[_0xa92a('0x82')](_0x1a226c)){return this[_0xa92a('0x36')][_0xa92a('0x32')](_0x646756,util[_0xa92a('0x28')](_0xa92a('0x19b'),_0x646756[_0xa92a('0x19a')]));}if(_0x1a226c===this['channel'][_0xa92a('0x3a')]){return this[_0xa92a('0x36')][_0xa92a('0x32')](_0x646756,_0xa92a('0x19c'));}this['createSquareDetailsReport']['sync'](this,_0x646756,_0x1a226c);var _0x73ecd0=this[_0xa92a('0x36')][_0xa92a('0x56')](_0xa92a('0x19d'),util[_0xa92a('0x28')](_0xa92a('0x19e'),config[_0xa92a('0xa6')][_0xa92a('0x17e')]||_0xa92a('0x19f'),_0x1a226c,this[_0xa92a('0x36')][_0xa92a('0x3a')]));if(_0x73ecd0['result']===-0x1){return _0x73ecd0;}return this[_0xa92a('0x36')][_0xa92a('0xb3')](util[_0xa92a('0x28')](_0xa92a('0xb4'),_0xa92a('0x19d'),_0x1a226c));};AGIVertices[_0xa92a('0x17')][_0xa92a('0x1a0')]=function(_0x12ab47){logger['info'](util[_0xa92a('0x28')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x12ab47[_0xa92a('0x38')]));var _0x8bc2a1=this[_0xa92a('0x55')][_0xa92a('0x6f')](this,_0x12ab47[_0xa92a('0xa8')]);this[_0xa92a('0x35')]['sync'](this,_0x12ab47,_0x12ab47[_0xa92a('0xa8')]);if(this[_0xa92a('0x82')](_0x12ab47[_0xa92a('0xcb')])){var _0x561a16=this[_0xa92a('0xf')][_0xa92a('0x6f')](this,_0x12ab47['variable_id']);if(_0x561a16){this['channel'][_0xa92a('0xa3')](_0x561a16,_0x8bc2a1);return this[_0xa92a('0x36')][_0xa92a('0xb3')](util['format']('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x12ab47[_0xa92a('0xa8')],_0x561a16));}}return this['channel']['noop'](util['format'](_0xa92a('0x1a1'),_0x12ab47[_0xa92a('0xa8')]));};AGIVertices['prototype'][_0xa92a('0x1a2')]=function(_0x2664fa){logger[_0xa92a('0x2d')](util['format']('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x2664fa['label']));if(!this[_0xa92a('0x82')](_0x2664fa['apiKey'])){return this['channel'][_0xa92a('0xb3')]('no\x20apiKey\x20configured');}if(!this[_0xa92a('0x82')](_0x2664fa[_0xa92a('0x5c')])){return this[_0xa92a('0x36')][_0xa92a('0xb3')]('no\x20text\x20configured');}this[_0xa92a('0x36')][_0xa92a('0xb3')](util[_0xa92a('0x28')]('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x2664fa[_0xa92a('0x5c')]));var _0x24ab1d=this[_0xa92a('0x59')][_0xa92a('0x6f')](this,_0x2664fa);if(_0x24ab1d){this[_0xa92a('0x36')]['noop'](util[_0xa92a('0x28')](_0xa92a('0x1a3'),_0x24ab1d));var _0x8ef881=this[_0xa92a('0x36')]['streamFile'](_0x24ab1d);try{fs[_0xa92a('0xec')](_0x24ab1d+'.wav');}catch(_0x26af7b){logger[_0xa92a('0x32')](_0x26af7b);}return _0x8ef881;}return this[_0xa92a('0x36')][_0xa92a('0x32')](_0x2664fa,_0xa92a('0x1a4'));};AGIVertices[_0xa92a('0x17')]['tts']=function(_0xd31c6e){logger['info'](util['format'](_0xa92a('0x1a5'),_0xd31c6e[_0xa92a('0x38')]));if(!this[_0xa92a('0x82')](_0xd31c6e[_0xa92a('0x5c')])){return this[_0xa92a('0x36')][_0xa92a('0xb3')]('no\x20text\x20configured');}this['channel'][_0xa92a('0xb3')](util[_0xa92a('0x28')](_0xa92a('0x1a6'),_0xd31c6e[_0xa92a('0x5c')]));var _0x255369=this[_0xa92a('0x5f')][_0xa92a('0x6f')](this,_0xd31c6e);if(_0x255369){this[_0xa92a('0x36')][_0xa92a('0xb3')](util[_0xa92a('0x28')](_0xa92a('0x1a7'),_0x255369));var _0x2c4ba7=this[_0xa92a('0x36')][_0xa92a('0xeb')](_0x255369);try{fs[_0xa92a('0xec')](_0x255369+_0xa92a('0x13a'));}catch(_0x30fdd2){logger[_0xa92a('0x32')](_0x30fdd2);}return _0x2c4ba7;}return this['channel'][_0xa92a('0x32')](_0xd31c6e,_0xa92a('0x1a8'));};AGIVertices[_0xa92a('0x17')]['unpause']=function(_0x3af36a){logger[_0xa92a('0x2d')](util['format']('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x3af36a[_0xa92a('0x38')]));if(!this['isConfigured'](_0x3af36a['findBy'])){return this[_0xa92a('0x36')][_0xa92a('0x32')](_0x3af36a,'no\x20find\x20by\x20configured');}logger[_0xa92a('0x2d')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xa92a('0x36')]['callerid'],_0x3af36a[_0xa92a('0x13d')]));var _0x156e07=this[_0xa92a('0x51')][_0xa92a('0x6f')](this,_0x3af36a[_0xa92a('0x13d')]);if(_0x156e07){logger[_0xa92a('0x2d')](util[_0xa92a('0x28')](_0xa92a('0x144'),this[_0xa92a('0x36')][_0xa92a('0x3c')],_0x3af36a[_0xa92a('0x13d')]));this[_0xa92a('0x36')][_0xa92a('0xb3')](util[_0xa92a('0x28')](_0xa92a('0x144'),this[_0xa92a('0x36')][_0xa92a('0x3c')],_0x3af36a[_0xa92a('0x13d')]));return{'code':0xc8,'result':_0xa92a('0x140')};}else{logger['info'](util[_0xa92a('0x28')](_0xa92a('0x141'),this[_0xa92a('0x36')]['callerid'],_0x3af36a[_0xa92a('0x13d')]));this[_0xa92a('0x36')][_0xa92a('0xb3')](util[_0xa92a('0x28')](_0xa92a('0x141'),this[_0xa92a('0x36')][_0xa92a('0x3c')],_0x3af36a[_0xa92a('0x13d')]));return{'code':0xc8,'result':_0xa92a('0x145')};}};AGIVertices['prototype'][_0xa92a('0x1a9')]=function(_0x409c53){logger[_0xa92a('0x2d')](util[_0xa92a('0x28')](_0xa92a('0x1aa'),_0x409c53[_0xa92a('0x38')]));var _0x264b58=this[_0xa92a('0x36')][_0xa92a('0x56')]('VOICEMAIL',[_0x409c53[_0xa92a('0x1ab')],_0x409c53[_0xa92a('0x79')]]);if(_0x264b58[_0xa92a('0xa1')]===-0x1){return _0x264b58;}return this['channel'][_0xa92a('0xb3')](util['format']('Executed\x20command\x20%s\x20%s',_0xa92a('0x1ac'),_0x409c53[_0xa92a('0x1ab')]));};AGIVertices['prototype']['vswitch']=function(_0x19fea0){logger[_0xa92a('0x2d')](util[_0xa92a('0x28')](_0xa92a('0x1ad'),_0x19fea0['label']));if(!this['isConfigured'](_0x19fea0[_0xa92a('0xcb')])){return this[_0xa92a('0x36')][_0xa92a('0x32')](_0x19fea0,'no\x20variable\x20selected');}var _0x2e04df=this[_0xa92a('0xf')]['sync'](this,_0x19fea0[_0xa92a('0xcb')]);if(!_0x2e04df){return this[_0xa92a('0x36')][_0xa92a('0x32')](_0x19fea0,_0xa92a('0xcd'));}var _0x2ffb04=this['channel'][_0xa92a('0xf')](_0x2e04df);return{'code':0xc8,'result':_0x2ffb04['extra']?_0x2ffb04['extra']:'-'};};String[_0xa92a('0x17')][_0xa92a('0x1ae')]=function(_0x27244b,_0x47d968){return this['split'](_0x27244b)[_0xa92a('0x1af')](_0x47d968);};module[_0xa92a('0x1b0')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index d54e590..39fb059 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 _0xbec5=['syncAttendedTransfer','syncBlindTransfer','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','interface','queue','mandatoryDisposition','mandatoryDispositionPause','name','Action','then','getAgent','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','acwTimeout','stopAcw','YYYY-MM-DD\x20HH:mm:ss','uniqueid','lastPauseAt','timer','update','[%s][UPDATE][ACWTIME:%s]','catch','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','error','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','[ACW][START]\x20%s','message','[TIMER][STOP][AGENT:%s]','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','linkedid','[ACW][syncHangupRequest]\x20%s','syncHangup','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','util','lodash','../ami','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer'];(function(_0x456f0,_0x7a092e){var _0x520823=function(_0x536c56){while(--_0x536c56){_0x456f0['push'](_0x456f0['shift']());}};_0x520823(++_0x7a092e);}(_0xbec5,0xe5));var _0x5bec=function(_0x25a0b9,_0x86e28f){_0x25a0b9=_0x25a0b9-0x0;var _0x30b9ab=_0xbec5[_0x25a0b9];return _0x30b9ab;};'use strict';var util=require(_0x5bec('0x0'));var _=require(_0x5bec('0x1'));var moment=require('moment');var ami=require(_0x5bec('0x2'));var logger=require(_0x5bec('0x3'))(_0x5bec('0x4'));var RpcUser=require(_0x5bec('0x5'));var RpcVoiceAgentReport=require(_0x5bec('0x6'));function Acw(_0x4ee982){this[_0x5bec('0x7')]=_0x4ee982[_0x5bec('0x7')];this[_0x5bec('0x8')]=_0x4ee982['agents'];this[_0x5bec('0x9')]=_0x4ee982[_0x5bec('0x9')];this[_0x5bec('0xa')]={};ami['on'](_0x5bec('0xb'),this[_0x5bec('0xc')][_0x5bec('0xd')](this));ami['on'](_0x5bec('0xe'),this[_0x5bec('0xf')]['bind'](this));ami['on'](_0x5bec('0x10'),this['syncHangup'][_0x5bec('0xd')](this));ami['on'](_0x5bec('0x11'),this[_0x5bec('0x12')]['bind'](this));ami['on'](_0x5bec('0x13'),this[_0x5bec('0x14')][_0x5bec('0xd')](this));ami['on']('blindtransfer',this[_0x5bec('0x15')][_0x5bec('0xd')](this));ami['on']('custom:agentConnectPreview',this[_0x5bec('0x16')][_0x5bec('0xd')](this));}function getDiff(_0x35393a){var _0x6888a4=moment()[_0x5bec('0x17')](0x0);var _0xcd6d90=moment(_0x35393a)[_0x5bec('0x17')](0x0);return _0x6888a4[_0x5bec('0x18')](_0xcd6d90,_0x5bec('0x19'));}Acw[_0x5bec('0x1a')][_0x5bec('0x1b')]=function(_0x325daf){try{var _0x11fb8e=this;var _0x506639=this['channels'][_0x325daf][_0x5bec('0x1c')];var _0x773740=this[_0x5bec('0xa')][_0x325daf][_0x5bec('0x1d')];var _0x5cd7ae=this['voiceQueues'][_0x773740];var _0x3cd354=![];var _0x6c0d35='ACW';if(_0x5cd7ae[_0x5bec('0x1e')]){if(_0x5cd7ae[_0x5bec('0x1f')][_0x5bec('0x20')]){_0x3cd354=!![];_0x6c0d35=_0x5cd7ae[_0x5bec('0x1f')]['name'];}}ami[_0x5bec('0x21')]({'action':'QueuePause','interface':_0x506639,'paused':!![],'reason':_0x6c0d35})[_0x5bec('0x22')](function(_0x208d99){if(_0x11fb8e[_0x5bec('0x8')][_0x506639]){return RpcUser[_0x5bec('0x23')](_0x11fb8e[_0x5bec('0x8')][_0x506639]['id'])['then'](function(_0x232584){if(_0x232584&&!_0x232584['voicePause']){logger[_0x5bec('0x24')](_0x5bec('0x25'),_0x325daf,_0x506639,_0x773740);var _0x5b2636=_0x11fb8e[_0x5bec('0xa')][_0x325daf][_0x5bec('0x26')]&&_0x11fb8e['channels'][_0x325daf][_0x5bec('0x27')]?_0x11fb8e[_0x5bec('0xa')][_0x325daf][_0x5bec('0x27')]:_0x325daf;return RpcUser[_0x5bec('0x28')](_0x11fb8e[_0x5bec('0x8')][_0x506639],_0x6c0d35,_0x5b2636)[_0x5bec('0x22')](function(_0x2dc014){if(!_0x3cd354){_0x11fb8e['timers'][_0x506639]={};logger['info']('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x325daf,_0x11fb8e[_0x5bec('0x7')][_0x773740][_0x5bec('0x29')],_0x506639,_0x773740);_0x11fb8e[_0x5bec('0x9')][_0x506639]['timer']=setTimeout(_0x11fb8e[_0x5bec('0x2a')][_0x5bec('0xd')](_0x11fb8e,_0x506639),_0x11fb8e['voiceQueues'][_0x773740][_0x5bec('0x29')]*0x3e8);_0x11fb8e[_0x5bec('0x9')][_0x506639]['lastPauseAt']=moment()['format'](_0x5bec('0x2b'));_0x11fb8e[_0x5bec('0x9')][_0x506639][_0x5bec('0x2c')]=_0x325daf;_0x11fb8e[_0x5bec('0x9')][_0x506639][_0x5bec('0x1d')]=_0x773740;_0x11fb8e[_0x5bec('0x9')][_0x506639]['updateAcw']=function(){var _0x2987ca=getDiff(_0x11fb8e['timers'][_0x506639][_0x5bec('0x2d')]);clearTimeout(_0x11fb8e[_0x5bec('0x9')][_0x506639][_0x5bec('0x2e')]);_0x11fb8e[_0x5bec('0x9')][_0x506639]['timer']=![];RpcVoiceAgentReport[_0x5bec('0x2f')]({'acwtime':_0x2987ca},_0x11fb8e[_0x5bec('0x9')][_0x506639][_0x5bec('0x2c')],_0x506639)['then'](function(_0xf6ae6b){logger['info'](_0x5bec('0x30'),_0x325daf,_0x2987ca,_0xf6ae6b);})[_0x5bec('0x31')](function(_0x29df14){logger['error'](_0x5bec('0x32'),_0x325daf,_0x29df14);});delete _0x11fb8e[_0x5bec('0x9')][_0x506639];};}});}else{logger['info'](_0x5bec('0x33'),_0x325daf,_0x506639,_0x773740);}});}})[_0x5bec('0x31')](function(_0x24aa2f){logger[_0x5bec('0x34')](_0x5bec('0x35'),_0x325daf,_0x11fb8e['voiceQueues'][_0x773740][_0x5bec('0x29')],_0x506639,_0x773740);})['finally'](function(){delete _0x11fb8e[_0x5bec('0xa')][_0x325daf];});}catch(_0x384f04){logger[_0x5bec('0x34')](_0x5bec('0x36'),_0x384f04[_0x5bec('0x37')]);}};Acw[_0x5bec('0x1a')]['stopAcw']=function(_0x1c6cc3){try{var _0xb515bb=this;if(_0xb515bb[_0x5bec('0x9')][_0x1c6cc3]){_0xb515bb['timers'][_0x1c6cc3][_0x5bec('0x2e')]=![];var _0x355707=_0xb515bb['timers'][_0x1c6cc3][_0x5bec('0x2c')];var _0x58c34e=_0xb515bb[_0x5bec('0x9')][_0x1c6cc3][_0x5bec('0x1d')];var _0x402e5d=_0xb515bb['voiceQueues'][_0x58c34e][_0x5bec('0x29')];logger[_0x5bec('0x24')](_0x5bec('0x38'),_0x1c6cc3);RpcUser[_0x5bec('0x39')](this[_0x5bec('0x8')][_0x1c6cc3]);RpcVoiceAgentReport[_0x5bec('0x2f')]({'acwtime':_0x402e5d,'agentacw':!![]},_0x355707,_0x1c6cc3)[_0x5bec('0x22')](function(_0x4a8b0b){logger[_0x5bec('0x24')](_0x5bec('0x30'),_0x355707,_0x402e5d,_0x4a8b0b);})[_0x5bec('0x31')](function(_0x414d59){logger['error'](_0x5bec('0x32'),_0x355707,_0x414d59);});}else{logger[_0x5bec('0x34')](_0x5bec('0x3a'),_0x1c6cc3);if(_0xb515bb['timers']){logger['info'](_0x5bec('0x3b'),JSON[_0x5bec('0x3c')](_0xb515bb[_0x5bec('0x9')]));}}}catch(_0x11f667){logger[_0x5bec('0x34')]('[ACW][STOP]\x20%s',_0x11f667['message']);}};Acw[_0x5bec('0x1a')]['syncAgentConnect']=function(_0x39597c){try{if(this[_0x5bec('0x7')][_0x39597c[_0x5bec('0x1d')]]&&(this['voiceQueues'][_0x39597c[_0x5bec('0x1d')]][_0x5bec('0x4')]||this['voiceQueues'][_0x39597c[_0x5bec('0x1d')]][_0x5bec('0x1e')])){if(this[_0x5bec('0x8')][_0x39597c[_0x5bec('0x1c')]]){this[_0x5bec('0xa')][_0x39597c[_0x5bec('0x2c')]]={'queue':_0x39597c[_0x5bec('0x1d')],'interface':_0x39597c['interface'],'destlinkedid':_0x39597c['destlinkedid']};}}}catch(_0x776912){logger['error']('[ACW][syncAgentConnect]\x20%s',_0x776912[_0x5bec('0x37')]);}};Acw['prototype']['syncAgentConnectPreview']=function(_0x48bff0){try{if(this[_0x5bec('0x7')][_0x48bff0[_0x5bec('0x1d')]]&&(this[_0x5bec('0x7')][_0x48bff0[_0x5bec('0x1d')]]['acw']||this[_0x5bec('0x7')][_0x48bff0[_0x5bec('0x1d')]][_0x5bec('0x1e')])){if(this[_0x5bec('0x8')][_0x48bff0['interface']]){this[_0x5bec('0xa')][_0x48bff0[_0x5bec('0x2c')]]={'queue':_0x48bff0[_0x5bec('0x1d')],'interface':_0x48bff0['interface']};}}}catch(_0x2752ba){logger['error'](_0x5bec('0x3d'),_0x2752ba[_0x5bec('0x37')]);}};Acw[_0x5bec('0x1a')][_0x5bec('0xf')]=function(_0x54b11a){try{if(this[_0x5bec('0xa')][_0x54b11a[_0x5bec('0x2c')]]&&_[_0x5bec('0x3e')](this[_0x5bec('0xa')][_0x54b11a[_0x5bec('0x2c')]][_0x5bec('0x26')])){logger[_0x5bec('0x24')]('[%s][HANGUP:UNIQUEID]',_0x54b11a[_0x5bec('0x2c')]);this[_0x5bec('0x1b')](_0x54b11a['uniqueid']);}else if(this[_0x5bec('0xa')][_0x54b11a[_0x5bec('0x3f')]]&&_[_0x5bec('0x3e')](this[_0x5bec('0xa')][_0x54b11a[_0x5bec('0x3f')]][_0x5bec('0x26')])){logger[_0x5bec('0x24')]('[%s][HANGUP:LINKEDID]',_0x54b11a[_0x5bec('0x3f')]);this['startAcw'](_0x54b11a[_0x5bec('0x3f')]);}}catch(_0x208c7b){logger[_0x5bec('0x34')](_0x5bec('0x40'),_0x208c7b[_0x5bec('0x37')]);}};Acw[_0x5bec('0x1a')][_0x5bec('0x41')]=function(_0x3bc0c9){try{if(this[_0x5bec('0xa')][_0x3bc0c9[_0x5bec('0x2c')]]&&this['channels'][_0x3bc0c9[_0x5bec('0x2c')]]['attended']){logger['info'](_0x5bec('0x42'),_0x3bc0c9['uniqueid']);this['startAcw'](_0x3bc0c9[_0x5bec('0x2c')]);}else if(this[_0x5bec('0xa')][_0x3bc0c9[_0x5bec('0x3f')]]&&this['channels'][_0x3bc0c9[_0x5bec('0x3f')]][_0x5bec('0x26')]){logger[_0x5bec('0x24')](_0x5bec('0x43'),_0x3bc0c9['linkedid']);this[_0x5bec('0x1b')](_0x3bc0c9[_0x5bec('0x3f')]);}}catch(_0x9cae50){logger[_0x5bec('0x34')](_0x5bec('0x44'),_0x9cae50[_0x5bec('0x37')]);}};Acw[_0x5bec('0x1a')]['syncAttendedTransfer']=function(_0x504dda){try{if(!_[_0x5bec('0x45')](this['channels'][_0x504dda[_0x5bec('0x46')]])){this[_0x5bec('0x1b')](_0x504dda['transfereeuniqueid']);if(this[_0x5bec('0xa')][_0x504dda['secondtransfereruniqueid']]){this[_0x5bec('0xa')][_0x504dda[_0x5bec('0x47')]][_0x5bec('0x26')]=!![];this[_0x5bec('0xa')][_0x504dda[_0x5bec('0x48')]]=this[_0x5bec('0xa')][_0x504dda[_0x5bec('0x47')]];delete this[_0x5bec('0xa')][_0x504dda[_0x5bec('0x47')]];}}else if(!_[_0x5bec('0x45')](this[_0x5bec('0xa')][_0x504dda[_0x5bec('0x48')]])){this[_0x5bec('0x1b')](_0x504dda[_0x5bec('0x48')]);if(this['channels'][_0x504dda[_0x5bec('0x49')]]){this[_0x5bec('0xa')][_0x504dda[_0x5bec('0x49')]]['attended']=!![];this[_0x5bec('0xa')][_0x504dda[_0x5bec('0x46')]]=this[_0x5bec('0xa')][_0x504dda[_0x5bec('0x49')]];delete this[_0x5bec('0xa')][_0x504dda['origtransfereruniqueid']];}}}catch(_0x3e3108){logger[_0x5bec('0x34')](_0x5bec('0x4a'),_0x3e3108[_0x5bec('0x37')]);}};Acw['prototype'][_0x5bec('0x15')]=function(_0x5dda24){try{if(this[_0x5bec('0xa')][_0x5dda24[_0x5bec('0x4b')]]){logger[_0x5bec('0x24')](_0x5bec('0x4c'),JSON['stringify'](_0x5dda24[_0x5bec('0x4b')]));this[_0x5bec('0x1b')](_0x5dda24[_0x5bec('0x4b')]);}else if(this[_0x5bec('0xa')][_0x5dda24[_0x5bec('0x4d')]]){logger[_0x5bec('0x24')](_0x5bec('0x4e'),JSON[_0x5bec('0x3c')](_0x5dda24[_0x5bec('0x4d')]));this[_0x5bec('0x1b')](_0x5dda24[_0x5bec('0x4d')]);}}catch(_0x42d4e4){logger[_0x5bec('0x34')](_0x5bec('0x4f'),_0x42d4e4[_0x5bec('0x37')]);}};Acw['prototype'][_0x5bec('0x12')]=function(_0x27c160){try{if(this['voiceQueues'][_0x27c160[_0x5bec('0x1d')]]&&this['voiceQueues'][_0x27c160[_0x5bec('0x1d')]][_0x5bec('0x50')]==='all'){if(this['agents'][_0x27c160[_0x5bec('0x1c')]]){logger[_0x5bec('0x24')](_0x5bec('0x51'),_0x27c160[_0x5bec('0x2c')],_0x27c160[_0x5bec('0x1c')],_0x27c160['queue']);return RpcUser[_0x5bec('0x28')](this[_0x5bec('0x8')][_0x27c160['interface']],_0x5bec('0x52'),_0x27c160[_0x5bec('0x2c')]);}}}catch(_0x44a945){logger[_0x5bec('0x34')]('[ACW][syncAgentRingNoAnswer]\x20%s',_0x44a945[_0x5bec('0x37')]);}};module['exports']=Acw; \ No newline at end of file +var _0xbec5=['syncAttendedTransfer','syncBlindTransfer','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','interface','queue','mandatoryDisposition','mandatoryDispositionPause','name','Action','then','getAgent','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','acwTimeout','stopAcw','YYYY-MM-DD\x20HH:mm:ss','uniqueid','lastPauseAt','timer','update','[%s][UPDATE][ACWTIME:%s]','catch','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','error','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','[ACW][START]\x20%s','message','[TIMER][STOP][AGENT:%s]','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','linkedid','[ACW][syncHangupRequest]\x20%s','syncHangup','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','util','lodash','../ami','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer'];(function(_0x18c4a8,_0x1a2d29){var _0x5690e1=function(_0x43ac1d){while(--_0x43ac1d){_0x18c4a8['push'](_0x18c4a8['shift']());}};_0x5690e1(++_0x1a2d29);}(_0xbec5,0xe5));var _0x5bec=function(_0x15876a,_0x15383d){_0x15876a=_0x15876a-0x0;var _0xbd900f=_0xbec5[_0x15876a];return _0xbd900f;};'use strict';var util=require(_0x5bec('0x0'));var _=require(_0x5bec('0x1'));var moment=require('moment');var ami=require(_0x5bec('0x2'));var logger=require(_0x5bec('0x3'))(_0x5bec('0x4'));var RpcUser=require(_0x5bec('0x5'));var RpcVoiceAgentReport=require(_0x5bec('0x6'));function Acw(_0x4ee982){this[_0x5bec('0x7')]=_0x4ee982[_0x5bec('0x7')];this[_0x5bec('0x8')]=_0x4ee982['agents'];this[_0x5bec('0x9')]=_0x4ee982[_0x5bec('0x9')];this[_0x5bec('0xa')]={};ami['on'](_0x5bec('0xb'),this[_0x5bec('0xc')][_0x5bec('0xd')](this));ami['on'](_0x5bec('0xe'),this[_0x5bec('0xf')]['bind'](this));ami['on'](_0x5bec('0x10'),this['syncHangup'][_0x5bec('0xd')](this));ami['on'](_0x5bec('0x11'),this[_0x5bec('0x12')]['bind'](this));ami['on'](_0x5bec('0x13'),this[_0x5bec('0x14')][_0x5bec('0xd')](this));ami['on']('blindtransfer',this[_0x5bec('0x15')][_0x5bec('0xd')](this));ami['on']('custom:agentConnectPreview',this[_0x5bec('0x16')][_0x5bec('0xd')](this));}function getDiff(_0x35393a){var _0x6888a4=moment()[_0x5bec('0x17')](0x0);var _0xcd6d90=moment(_0x35393a)[_0x5bec('0x17')](0x0);return _0x6888a4[_0x5bec('0x18')](_0xcd6d90,_0x5bec('0x19'));}Acw[_0x5bec('0x1a')][_0x5bec('0x1b')]=function(_0x325daf){try{var _0x11fb8e=this;var _0x506639=this['channels'][_0x325daf][_0x5bec('0x1c')];var _0x773740=this[_0x5bec('0xa')][_0x325daf][_0x5bec('0x1d')];var _0x5cd7ae=this['voiceQueues'][_0x773740];var _0x3cd354=![];var _0x6c0d35='ACW';if(_0x5cd7ae[_0x5bec('0x1e')]){if(_0x5cd7ae[_0x5bec('0x1f')][_0x5bec('0x20')]){_0x3cd354=!![];_0x6c0d35=_0x5cd7ae[_0x5bec('0x1f')]['name'];}}ami[_0x5bec('0x21')]({'action':'QueuePause','interface':_0x506639,'paused':!![],'reason':_0x6c0d35})[_0x5bec('0x22')](function(_0x208d99){if(_0x11fb8e[_0x5bec('0x8')][_0x506639]){return RpcUser[_0x5bec('0x23')](_0x11fb8e[_0x5bec('0x8')][_0x506639]['id'])['then'](function(_0x232584){if(_0x232584&&!_0x232584['voicePause']){logger[_0x5bec('0x24')](_0x5bec('0x25'),_0x325daf,_0x506639,_0x773740);var _0x5b2636=_0x11fb8e[_0x5bec('0xa')][_0x325daf][_0x5bec('0x26')]&&_0x11fb8e['channels'][_0x325daf][_0x5bec('0x27')]?_0x11fb8e[_0x5bec('0xa')][_0x325daf][_0x5bec('0x27')]:_0x325daf;return RpcUser[_0x5bec('0x28')](_0x11fb8e[_0x5bec('0x8')][_0x506639],_0x6c0d35,_0x5b2636)[_0x5bec('0x22')](function(_0x2dc014){if(!_0x3cd354){_0x11fb8e['timers'][_0x506639]={};logger['info']('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x325daf,_0x11fb8e[_0x5bec('0x7')][_0x773740][_0x5bec('0x29')],_0x506639,_0x773740);_0x11fb8e[_0x5bec('0x9')][_0x506639]['timer']=setTimeout(_0x11fb8e[_0x5bec('0x2a')][_0x5bec('0xd')](_0x11fb8e,_0x506639),_0x11fb8e['voiceQueues'][_0x773740][_0x5bec('0x29')]*0x3e8);_0x11fb8e[_0x5bec('0x9')][_0x506639]['lastPauseAt']=moment()['format'](_0x5bec('0x2b'));_0x11fb8e[_0x5bec('0x9')][_0x506639][_0x5bec('0x2c')]=_0x325daf;_0x11fb8e[_0x5bec('0x9')][_0x506639][_0x5bec('0x1d')]=_0x773740;_0x11fb8e[_0x5bec('0x9')][_0x506639]['updateAcw']=function(){var _0x2987ca=getDiff(_0x11fb8e['timers'][_0x506639][_0x5bec('0x2d')]);clearTimeout(_0x11fb8e[_0x5bec('0x9')][_0x506639][_0x5bec('0x2e')]);_0x11fb8e[_0x5bec('0x9')][_0x506639]['timer']=![];RpcVoiceAgentReport[_0x5bec('0x2f')]({'acwtime':_0x2987ca},_0x11fb8e[_0x5bec('0x9')][_0x506639][_0x5bec('0x2c')],_0x506639)['then'](function(_0xf6ae6b){logger['info'](_0x5bec('0x30'),_0x325daf,_0x2987ca,_0xf6ae6b);})[_0x5bec('0x31')](function(_0x29df14){logger['error'](_0x5bec('0x32'),_0x325daf,_0x29df14);});delete _0x11fb8e[_0x5bec('0x9')][_0x506639];};}});}else{logger['info'](_0x5bec('0x33'),_0x325daf,_0x506639,_0x773740);}});}})[_0x5bec('0x31')](function(_0x24aa2f){logger[_0x5bec('0x34')](_0x5bec('0x35'),_0x325daf,_0x11fb8e['voiceQueues'][_0x773740][_0x5bec('0x29')],_0x506639,_0x773740);})['finally'](function(){delete _0x11fb8e[_0x5bec('0xa')][_0x325daf];});}catch(_0x384f04){logger[_0x5bec('0x34')](_0x5bec('0x36'),_0x384f04[_0x5bec('0x37')]);}};Acw[_0x5bec('0x1a')]['stopAcw']=function(_0x1c6cc3){try{var _0xb515bb=this;if(_0xb515bb[_0x5bec('0x9')][_0x1c6cc3]){_0xb515bb['timers'][_0x1c6cc3][_0x5bec('0x2e')]=![];var _0x355707=_0xb515bb['timers'][_0x1c6cc3][_0x5bec('0x2c')];var _0x58c34e=_0xb515bb[_0x5bec('0x9')][_0x1c6cc3][_0x5bec('0x1d')];var _0x402e5d=_0xb515bb['voiceQueues'][_0x58c34e][_0x5bec('0x29')];logger[_0x5bec('0x24')](_0x5bec('0x38'),_0x1c6cc3);RpcUser[_0x5bec('0x39')](this[_0x5bec('0x8')][_0x1c6cc3]);RpcVoiceAgentReport[_0x5bec('0x2f')]({'acwtime':_0x402e5d,'agentacw':!![]},_0x355707,_0x1c6cc3)[_0x5bec('0x22')](function(_0x4a8b0b){logger[_0x5bec('0x24')](_0x5bec('0x30'),_0x355707,_0x402e5d,_0x4a8b0b);})[_0x5bec('0x31')](function(_0x414d59){logger['error'](_0x5bec('0x32'),_0x355707,_0x414d59);});}else{logger[_0x5bec('0x34')](_0x5bec('0x3a'),_0x1c6cc3);if(_0xb515bb['timers']){logger['info'](_0x5bec('0x3b'),JSON[_0x5bec('0x3c')](_0xb515bb[_0x5bec('0x9')]));}}}catch(_0x11f667){logger[_0x5bec('0x34')]('[ACW][STOP]\x20%s',_0x11f667['message']);}};Acw[_0x5bec('0x1a')]['syncAgentConnect']=function(_0x39597c){try{if(this[_0x5bec('0x7')][_0x39597c[_0x5bec('0x1d')]]&&(this['voiceQueues'][_0x39597c[_0x5bec('0x1d')]][_0x5bec('0x4')]||this['voiceQueues'][_0x39597c[_0x5bec('0x1d')]][_0x5bec('0x1e')])){if(this[_0x5bec('0x8')][_0x39597c[_0x5bec('0x1c')]]){this[_0x5bec('0xa')][_0x39597c[_0x5bec('0x2c')]]={'queue':_0x39597c[_0x5bec('0x1d')],'interface':_0x39597c['interface'],'destlinkedid':_0x39597c['destlinkedid']};}}}catch(_0x776912){logger['error']('[ACW][syncAgentConnect]\x20%s',_0x776912[_0x5bec('0x37')]);}};Acw['prototype']['syncAgentConnectPreview']=function(_0x48bff0){try{if(this[_0x5bec('0x7')][_0x48bff0[_0x5bec('0x1d')]]&&(this[_0x5bec('0x7')][_0x48bff0[_0x5bec('0x1d')]]['acw']||this[_0x5bec('0x7')][_0x48bff0[_0x5bec('0x1d')]][_0x5bec('0x1e')])){if(this[_0x5bec('0x8')][_0x48bff0['interface']]){this[_0x5bec('0xa')][_0x48bff0[_0x5bec('0x2c')]]={'queue':_0x48bff0[_0x5bec('0x1d')],'interface':_0x48bff0['interface']};}}}catch(_0x2752ba){logger['error'](_0x5bec('0x3d'),_0x2752ba[_0x5bec('0x37')]);}};Acw[_0x5bec('0x1a')][_0x5bec('0xf')]=function(_0x54b11a){try{if(this[_0x5bec('0xa')][_0x54b11a[_0x5bec('0x2c')]]&&_[_0x5bec('0x3e')](this[_0x5bec('0xa')][_0x54b11a[_0x5bec('0x2c')]][_0x5bec('0x26')])){logger[_0x5bec('0x24')]('[%s][HANGUP:UNIQUEID]',_0x54b11a[_0x5bec('0x2c')]);this[_0x5bec('0x1b')](_0x54b11a['uniqueid']);}else if(this[_0x5bec('0xa')][_0x54b11a[_0x5bec('0x3f')]]&&_[_0x5bec('0x3e')](this[_0x5bec('0xa')][_0x54b11a[_0x5bec('0x3f')]][_0x5bec('0x26')])){logger[_0x5bec('0x24')]('[%s][HANGUP:LINKEDID]',_0x54b11a[_0x5bec('0x3f')]);this['startAcw'](_0x54b11a[_0x5bec('0x3f')]);}}catch(_0x208c7b){logger[_0x5bec('0x34')](_0x5bec('0x40'),_0x208c7b[_0x5bec('0x37')]);}};Acw[_0x5bec('0x1a')][_0x5bec('0x41')]=function(_0x3bc0c9){try{if(this[_0x5bec('0xa')][_0x3bc0c9[_0x5bec('0x2c')]]&&this['channels'][_0x3bc0c9[_0x5bec('0x2c')]]['attended']){logger['info'](_0x5bec('0x42'),_0x3bc0c9['uniqueid']);this['startAcw'](_0x3bc0c9[_0x5bec('0x2c')]);}else if(this[_0x5bec('0xa')][_0x3bc0c9[_0x5bec('0x3f')]]&&this['channels'][_0x3bc0c9[_0x5bec('0x3f')]][_0x5bec('0x26')]){logger[_0x5bec('0x24')](_0x5bec('0x43'),_0x3bc0c9['linkedid']);this[_0x5bec('0x1b')](_0x3bc0c9[_0x5bec('0x3f')]);}}catch(_0x9cae50){logger[_0x5bec('0x34')](_0x5bec('0x44'),_0x9cae50[_0x5bec('0x37')]);}};Acw[_0x5bec('0x1a')]['syncAttendedTransfer']=function(_0x504dda){try{if(!_[_0x5bec('0x45')](this['channels'][_0x504dda[_0x5bec('0x46')]])){this[_0x5bec('0x1b')](_0x504dda['transfereeuniqueid']);if(this[_0x5bec('0xa')][_0x504dda['secondtransfereruniqueid']]){this[_0x5bec('0xa')][_0x504dda[_0x5bec('0x47')]][_0x5bec('0x26')]=!![];this[_0x5bec('0xa')][_0x504dda[_0x5bec('0x48')]]=this[_0x5bec('0xa')][_0x504dda[_0x5bec('0x47')]];delete this[_0x5bec('0xa')][_0x504dda[_0x5bec('0x47')]];}}else if(!_[_0x5bec('0x45')](this[_0x5bec('0xa')][_0x504dda[_0x5bec('0x48')]])){this[_0x5bec('0x1b')](_0x504dda[_0x5bec('0x48')]);if(this['channels'][_0x504dda[_0x5bec('0x49')]]){this[_0x5bec('0xa')][_0x504dda[_0x5bec('0x49')]]['attended']=!![];this[_0x5bec('0xa')][_0x504dda[_0x5bec('0x46')]]=this[_0x5bec('0xa')][_0x504dda[_0x5bec('0x49')]];delete this[_0x5bec('0xa')][_0x504dda['origtransfereruniqueid']];}}}catch(_0x3e3108){logger[_0x5bec('0x34')](_0x5bec('0x4a'),_0x3e3108[_0x5bec('0x37')]);}};Acw['prototype'][_0x5bec('0x15')]=function(_0x5dda24){try{if(this[_0x5bec('0xa')][_0x5dda24[_0x5bec('0x4b')]]){logger[_0x5bec('0x24')](_0x5bec('0x4c'),JSON['stringify'](_0x5dda24[_0x5bec('0x4b')]));this[_0x5bec('0x1b')](_0x5dda24[_0x5bec('0x4b')]);}else if(this[_0x5bec('0xa')][_0x5dda24[_0x5bec('0x4d')]]){logger[_0x5bec('0x24')](_0x5bec('0x4e'),JSON[_0x5bec('0x3c')](_0x5dda24[_0x5bec('0x4d')]));this[_0x5bec('0x1b')](_0x5dda24[_0x5bec('0x4d')]);}}catch(_0x42d4e4){logger[_0x5bec('0x34')](_0x5bec('0x4f'),_0x42d4e4[_0x5bec('0x37')]);}};Acw['prototype'][_0x5bec('0x12')]=function(_0x27c160){try{if(this['voiceQueues'][_0x27c160[_0x5bec('0x1d')]]&&this['voiceQueues'][_0x27c160[_0x5bec('0x1d')]][_0x5bec('0x50')]==='all'){if(this['agents'][_0x27c160[_0x5bec('0x1c')]]){logger[_0x5bec('0x24')](_0x5bec('0x51'),_0x27c160[_0x5bec('0x2c')],_0x27c160[_0x5bec('0x1c')],_0x27c160['queue']);return RpcUser[_0x5bec('0x28')](this[_0x5bec('0x8')][_0x27c160['interface']],_0x5bec('0x52'),_0x27c160[_0x5bec('0x2c')]);}}}catch(_0x44a945){logger[_0x5bec('0x34')]('[ACW][syncAgentRingNoAnswer]\x20%s',_0x44a945[_0x5bec('0x37')]);}};module['exports']=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 8b54d1b..39f61be 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 _0xbd18=['username','password','keepConnected','Action','action','error','format','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','info','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','catch','log','exports','bluebird','moment','util','lodash','../../config/logger','../../config/environment','asterisk','port'];(function(_0x2c7e03,_0x5b8cc3){var _0x310885=function(_0xdb0446){while(--_0xdb0446){_0x2c7e03['push'](_0x2c7e03['shift']());}};_0x310885(++_0x5b8cc3);}(_0xbd18,0xe2));var _0x8bd1=function(_0x42dfed,_0x26b1d7){_0x42dfed=_0x42dfed-0x0;var _0x22bdf7=_0xbd18[_0x42dfed];return _0x22bdf7;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0x8bd1('0x0'));var moment=require(_0x8bd1('0x1'));var util=require(_0x8bd1('0x2'));var _=require(_0x8bd1('0x3'));var logger=require(_0x8bd1('0x4'))('ami');var config=require(_0x8bd1('0x5'));var ami=new Manager(config[_0x8bd1('0x6')][_0x8bd1('0x7')],config['asterisk']['ip'],config[_0x8bd1('0x6')][_0x8bd1('0x8')],config[_0x8bd1('0x6')][_0x8bd1('0x9')],!![]);ami[_0x8bd1('0xa')]();ami[_0x8bd1('0xb')]=BPromise['promisify'](ami[_0x8bd1('0xc')]);function error(_0x49583e){logger[_0x8bd1('0xd')](util[_0x8bd1('0xe')]('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config[_0x8bd1('0x6')][_0x8bd1('0x8')],config[_0x8bd1('0x6')]['ip'],config[_0x8bd1('0x6')][_0x8bd1('0x7')],util[_0x8bd1('0xf')](_0x49583e,![],null)));}function close(){logger[_0x8bd1('0xd')](util[_0x8bd1('0xe')](_0x8bd1('0x10'),config['asterisk'][_0x8bd1('0x8')],config['asterisk']['ip'],config['asterisk'][_0x8bd1('0x7')]));}ami[_0x8bd1('0x11')]=function(){return function(){return ami['Action']({'action':_0x8bd1('0x12')});};};ami[_0x8bd1('0x13')]=function(){return function(){return ami[_0x8bd1('0xb')]({'action':_0x8bd1('0x14')});};};ami[_0x8bd1('0x15')]=function(){return function(){return ami[_0x8bd1('0xb')]({'action':'sippeerstatus'});};};ami[_0x8bd1('0x16')]=function(){return function(){return ami[_0x8bd1('0xb')]({'action':_0x8bd1('0x17')});};};ami[_0x8bd1('0x18')]=function(){return function(){return ami[_0x8bd1('0xb')]({'action':_0x8bd1('0x19')});};};function connect(_0x3e476d){logger['info'](util['format'](_0x8bd1('0x1a'),config[_0x8bd1('0x6')]['username'],config[_0x8bd1('0x6')]['ip'],config[_0x8bd1('0x6')][_0x8bd1('0x7')]));ami[_0x8bd1('0x1b')]('error',error);ami[_0x8bd1('0x1b')](_0x8bd1('0x1c'),close);}ami['on'](_0x8bd1('0x1d'),connect);ami['on']('shutdown',function(_0x5456c6){logger[_0x8bd1('0x1e')](util[_0x8bd1('0xe')](_0x8bd1('0x1f'),config[_0x8bd1('0x6')][_0x8bd1('0x8')],config[_0x8bd1('0x6')]['ip'],config['asterisk']['port'],util[_0x8bd1('0xf')](_0x5456c6,![],null)));});ami['on'](_0x8bd1('0x20'),function(_0x430d2b){logger['info'](util[_0x8bd1('0xe')](_0x8bd1('0x21'),config[_0x8bd1('0x6')][_0x8bd1('0x8')],config[_0x8bd1('0x6')]['ip'],config['asterisk'][_0x8bd1('0x7')]));return BPromise[_0x8bd1('0x22')]()[_0x8bd1('0x23')](ami[_0x8bd1('0x11')]())[_0x8bd1('0x23')](ami['actionDeviceStateList']())['then'](ami['actionSipPeerStatus']())[_0x8bd1('0x23')](ami[_0x8bd1('0x16')]())[_0x8bd1('0x23')](ami['actionCoreShowChannels']())[_0x8bd1('0x24')](function(_0x13405a){console[_0x8bd1('0x25')](_0x13405a);});});ami[_0x8bd1('0x1b')](_0x8bd1('0xd'),error);ami['once'](_0x8bd1('0x1c'),close);module[_0x8bd1('0x26')]=ami; \ No newline at end of file +var _0x7c50=['exports','asterisk-manager','bluebird','moment','lodash','../../config/logger','ami','asterisk','port','username','action','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','error','format','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','Action','sipshowregistry','actionDeviceStateList','devicestatelist','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','inspect','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionSipPeerStatus','catch','log'];(function(_0xbe08b1,_0x5678f6){var _0x12109d=function(_0x27adac){while(--_0x27adac){_0xbe08b1['push'](_0xbe08b1['shift']());}};_0x12109d(++_0x5678f6);}(_0x7c50,0x95));var _0x07c5=function(_0x1a8f86,_0x5ed9c4){_0x1a8f86=_0x1a8f86-0x0;var _0x20d876=_0x7c50[_0x1a8f86];return _0x20d876;};'use strict';var Manager=require(_0x07c5('0x0'));var BPromise=require(_0x07c5('0x1'));var moment=require(_0x07c5('0x2'));var util=require('util');var _=require(_0x07c5('0x3'));var logger=require(_0x07c5('0x4'))(_0x07c5('0x5'));var config=require('../../config/environment');var ami=new Manager(config[_0x07c5('0x6')][_0x07c5('0x7')],config[_0x07c5('0x6')]['ip'],config[_0x07c5('0x6')][_0x07c5('0x8')],config[_0x07c5('0x6')]['password'],!![]);ami['keepConnected']();ami['Action']=BPromise['promisify'](ami[_0x07c5('0x9')]);function error(_0x159838){logger['error'](util['format'](_0x07c5('0xa'),config['asterisk'][_0x07c5('0x8')],config[_0x07c5('0x6')]['ip'],config[_0x07c5('0x6')][_0x07c5('0x7')],util['inspect'](_0x159838,![],null)));}function close(){logger[_0x07c5('0xb')](util[_0x07c5('0xc')](_0x07c5('0xd'),config[_0x07c5('0x6')][_0x07c5('0x8')],config[_0x07c5('0x6')]['ip'],config[_0x07c5('0x6')][_0x07c5('0x7')]));}ami[_0x07c5('0xe')]=function(){return function(){return ami[_0x07c5('0xf')]({'action':_0x07c5('0x10')});};};ami[_0x07c5('0x11')]=function(){return function(){return ami[_0x07c5('0xf')]({'action':_0x07c5('0x12')});};};ami['actionSipPeerStatus']=function(){return function(){return ami[_0x07c5('0xf')]({'action':_0x07c5('0x13')});};};ami[_0x07c5('0x14')]=function(){return function(){return ami[_0x07c5('0xf')]({'action':_0x07c5('0x15')});};};ami[_0x07c5('0x16')]=function(){return function(){return ami[_0x07c5('0xf')]({'action':'coreshowchannels'});};};function connect(_0x1e7799){logger[_0x07c5('0x17')](util[_0x07c5('0xc')](_0x07c5('0x18'),config['asterisk'][_0x07c5('0x8')],config[_0x07c5('0x6')]['ip'],config['asterisk'][_0x07c5('0x7')]));ami[_0x07c5('0x19')](_0x07c5('0xb'),error);ami[_0x07c5('0x19')](_0x07c5('0x1a'),close);}ami['on'](_0x07c5('0x1b'),connect);ami['on'](_0x07c5('0x1c'),function(_0x29b187){logger[_0x07c5('0x17')](util[_0x07c5('0xc')]('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config[_0x07c5('0x6')][_0x07c5('0x8')],config['asterisk']['ip'],config['asterisk'][_0x07c5('0x7')],util[_0x07c5('0x1d')](_0x29b187,![],null)));});ami['on']('fullybooted',function(_0x18da58){logger[_0x07c5('0x17')](util[_0x07c5('0xc')](_0x07c5('0x1e'),config['asterisk'][_0x07c5('0x8')],config[_0x07c5('0x6')]['ip'],config[_0x07c5('0x6')][_0x07c5('0x7')]));return BPromise[_0x07c5('0x1f')]()[_0x07c5('0x20')](ami['actionSipShowRegistry']())[_0x07c5('0x20')](ami[_0x07c5('0x11')]())['then'](ami[_0x07c5('0x21')]())[_0x07c5('0x20')](ami[_0x07c5('0x14')]())[_0x07c5('0x20')](ami['actionCoreShowChannels']())[_0x07c5('0x22')](function(_0x37709a){console[_0x07c5('0x23')](_0x37709a);});});ami[_0x07c5('0x19')](_0x07c5('0xb'),error);ami['once']('close',close);module[_0x07c5('0x24')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index b9e40aa..732c37a 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 _0xe9e1=['Request','request','then','memberReport','error','result','catch','rpc','exports','bluebird','../../config/logger','ami','client'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe9e1,0x15b));var _0x1e9e=function(_0x450897,_0x3a7927){_0x450897=_0x450897-0x0;var _0x27902e=_0xe9e1[_0x450897];return _0x27902e;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x1e9e('0x0'));var logger=require(_0x1e9e('0x1'))(_0x1e9e('0x2'));var client=jayson[_0x1e9e('0x3')]['http']({'port':0x2329});client[_0x1e9e('0x4')]=function(_0x1889ad,_0x29fb82){return new BPromise(function(_0x4a222c,_0x3c7078){return client[_0x1e9e('0x5')](_0x1889ad,_0x29fb82)[_0x1e9e('0x6')](function(_0x1930df){logger['debug']('rpc',_0x1e9e('0x7'),_0x1889ad,_0x29fb82,_0x1930df);if(_0x1930df['error']){logger[_0x1e9e('0x8')]('rpc',_0x1e9e('0x7'),_0x1889ad,_0x1930df[_0x1e9e('0x8')]['message'],_0x29fb82);return _0x3c7078(_0x1930df[_0x1e9e('0x8')]['message']);}else{return _0x4a222c(_0x1930df[_0x1e9e('0x9')]);}})[_0x1e9e('0xa')](function(_0x383865){logger['error'](_0x1e9e('0xb'),_0x1e9e('0x7'),_0x1889ad,_0x383865,_0x29fb82);return _0x3c7078(_0x383865);});});};module[_0x1e9e('0xc')]=client; \ No newline at end of file +var _0x1d37=['exports','jayson/promise','bluebird','ami','client','http','Request','request','then','debug','rpc','memberReport','error','message','result','catch'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x1d37,0x1a1));var _0x71d3=function(_0x1c6ef2,_0x8d926a){_0x1c6ef2=_0x1c6ef2-0x0;var _0x404b8c=_0x1d37[_0x1c6ef2];return _0x404b8c;};'use strict';var jayson=require(_0x71d3('0x0'));var BPromise=require(_0x71d3('0x1'));var logger=require('../../config/logger')(_0x71d3('0x2'));var client=jayson[_0x71d3('0x3')][_0x71d3('0x4')]({'port':0x2329});client[_0x71d3('0x5')]=function(_0x295dba,_0x123c5f){return new BPromise(function(_0x12f057,_0x3de550){return client[_0x71d3('0x6')](_0x295dba,_0x123c5f)[_0x71d3('0x7')](function(_0x1535eb){logger[_0x71d3('0x8')](_0x71d3('0x9'),_0x71d3('0xa'),_0x295dba,_0x123c5f,_0x1535eb);if(_0x1535eb[_0x71d3('0xb')]){logger[_0x71d3('0xb')](_0x71d3('0x9'),'memberReport',_0x295dba,_0x1535eb[_0x71d3('0xb')][_0x71d3('0xc')],_0x123c5f);return _0x3de550(_0x1535eb[_0x71d3('0xb')][_0x71d3('0xc')]);}else{return _0x12f057(_0x1535eb[_0x71d3('0xd')]);}})[_0x71d3('0xe')](function(_0x34ead9){logger[_0x71d3('0xb')](_0x71d3('0x9'),_0x71d3('0xa'),_0x295dba,_0x34ead9,_0x123c5f);return _0x3de550(_0x34ead9);});});};module[_0x71d3('0xf')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index 8e75272..2fa7234 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 _0x0b41=['UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','callback','callbackuniqueid','callbackat','recallme','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','getQueue','exports','util','moment','isNil','string','voiceQueue','uniqueid','name','Contact','phone','firstName','lastName','number','queue','active','type','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId'];(function(_0x1693e4,_0x465a6e){var _0xdae816=function(_0x52e01a){while(--_0x52e01a){_0x1693e4['push'](_0x1693e4['shift']());}};_0xdae816(++_0x465a6e);}(_0x0b41,0x6a));var _0x10b4=function(_0x342ff0,_0x58ccbf){_0x342ff0=_0x342ff0-0x0;var _0x4e95a1=_0x0b41[_0x342ff0];return _0x4e95a1;};'use strict';var util=require(_0x10b4('0x0'));var _=require('lodash');var moment=require(_0x10b4('0x1'));function checkNameSurname(_0x9189f7,_0x5f3552,_0x9abb2c){var _0x23f353='';if(!_[_0x10b4('0x2')](_0x5f3552)&&'string'===typeof _0x5f3552){_0x23f353+=_0x5f3552;}if(!_[_0x10b4('0x2')](_0x9abb2c)&&_0x10b4('0x3')===typeof _0x9abb2c){_0x23f353+='\x20'+_0x9abb2c;}if(_0x23f353!==''){return _0x23f353;}return _0x9189f7;}function Action(_0x1208dc,_0x277f6c,_0x22f6a1){this[_0x10b4('0x4')]=_0x1208dc;this[_0x10b4('0x5')]=_0x22f6a1||undefined;this[_0x10b4('0x6')]=checkNameSurname(_0x277f6c[_0x10b4('0x7')][_0x10b4('0x8')],_0x277f6c[_0x10b4('0x7')][_0x10b4('0x9')],_0x277f6c[_0x10b4('0x7')][_0x10b4('0xa')]);this[_0x10b4('0xb')]=_0x277f6c[_0x10b4('0x7')][_0x10b4('0x8')];this[_0x10b4('0xc')]=_0x1208dc['name'];this['active']=_0x277f6c[_0x10b4('0xd')]||![];this['type']=_0x1208dc[_0x10b4('0xe')];this['dialQueueTimeout']=_0x1208dc['dialQueueTimeout']||0x3;this[_0x10b4('0xf')]=_0x277f6c['scheduledat'];this[_0x10b4('0x10')]=_0x277f6c[_0x10b4('0x10')];this[_0x10b4('0x11')]=_0x277f6c[_0x10b4('0x11')];this[_0x10b4('0x12')]=_0x277f6c[_0x10b4('0x12')];this[_0x10b4('0x13')]=_0x277f6c[_0x10b4('0x13')];this[_0x10b4('0x14')]=_0x277f6c[_0x10b4('0x14')];this[_0x10b4('0x15')]=_0x277f6c['countabandonedretry'];this[_0x10b4('0x16')]=_0x277f6c['countmachineretry'];this[_0x10b4('0x17')]=_0x277f6c[_0x10b4('0x17')];this[_0x10b4('0x18')]=_0x277f6c[_0x10b4('0x18')];this[_0x10b4('0x19')]=_0x277f6c[_0x10b4('0x19')];this['UserId']=_0x277f6c[_0x10b4('0x1a')];this['VoiceQueueId']=_0x277f6c[_0x10b4('0x1b')];this[_0x10b4('0x1c')]=_0x277f6c[_0x10b4('0x1c')];this[_0x10b4('0x1d')]=_0x277f6c['id'];this[_0x10b4('0x1e')]=_0x277f6c[_0x10b4('0x7')]['firstName']||'';this[_0x10b4('0x1f')]=moment()[_0x10b4('0x20')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x10b4('0x21')]=_0x277f6c[_0x10b4('0x21')];this['callbackuniqueid']=_0x277f6c[_0x10b4('0x22')];this[_0x10b4('0x23')]=_0x277f6c[_0x10b4('0x23')];this[_0x10b4('0x24')]=_0x277f6c['recallme'];this['originatecalleridnum']='';this[_0x10b4('0x25')]='';}Action[_0x10b4('0x26')][_0x10b4('0x27')]=function(){return util[_0x10b4('0x20')](_0x10b4('0x28'),this['name'],this[_0x10b4('0x4')][_0x10b4('0x29')]>0x0?this[_0x10b4('0xb')]['substring'](this[_0x10b4('0x4')][_0x10b4('0x29')]):this[_0x10b4('0xb')]);};Action[_0x10b4('0x26')][_0x10b4('0x2a')]=function(){return this[_0x10b4('0xc')];};module[_0x10b4('0x2b')]=Action; \ No newline at end of file +var _0x464b=['substring','exports','util','lodash','moment','isNil','string','voiceQueue','name','Contact','phone','firstName','lastName','number','queue','active','type','scheduledat','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','ListId','UserId','VoiceQueueId','CampaignId','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','prototype','\x22%s\x22\x20<%s>'];(function(_0x21a4c0,_0x2e8541){var _0xb7e1fc=function(_0x3016e8){while(--_0x3016e8){_0x21a4c0['push'](_0x21a4c0['shift']());}};_0xb7e1fc(++_0x2e8541);}(_0x464b,0x161));var _0xb464=function(_0x5131a9,_0x25fd3e){_0x5131a9=_0x5131a9-0x0;var _0xe4b61e=_0x464b[_0x5131a9];return _0xe4b61e;};'use strict';var util=require(_0xb464('0x0'));var _=require(_0xb464('0x1'));var moment=require(_0xb464('0x2'));function checkNameSurname(_0x20fbd7,_0x422838,_0xadfc5d){var _0x1ac1fa='';if(!_[_0xb464('0x3')](_0x422838)&&_0xb464('0x4')===typeof _0x422838){_0x1ac1fa+=_0x422838;}if(!_[_0xb464('0x3')](_0xadfc5d)&&_0xb464('0x4')===typeof _0xadfc5d){_0x1ac1fa+='\x20'+_0xadfc5d;}if(_0x1ac1fa!==''){return _0x1ac1fa;}return _0x20fbd7;}function Action(_0x274da9,_0x4553f7,_0x58b7ff){this[_0xb464('0x5')]=_0x274da9;this['uniqueid']=_0x58b7ff||undefined;this[_0xb464('0x6')]=checkNameSurname(_0x4553f7[_0xb464('0x7')][_0xb464('0x8')],_0x4553f7[_0xb464('0x7')][_0xb464('0x9')],_0x4553f7[_0xb464('0x7')][_0xb464('0xa')]);this[_0xb464('0xb')]=_0x4553f7[_0xb464('0x7')][_0xb464('0x8')];this[_0xb464('0xc')]=_0x274da9[_0xb464('0x6')];this[_0xb464('0xd')]=_0x4553f7[_0xb464('0xd')]||![];this['type']=_0x274da9[_0xb464('0xe')];this['dialQueueTimeout']=_0x274da9['dialQueueTimeout']||0x3;this[_0xb464('0xf')]=_0x4553f7[_0xb464('0xf')];this['countbusyretry']=_0x4553f7['countbusyretry'];this[_0xb464('0x10')]=_0x4553f7[_0xb464('0x10')];this[_0xb464('0x11')]=_0x4553f7['countnoanswerretry'];this[_0xb464('0x12')]=_0x4553f7[_0xb464('0x12')];this[_0xb464('0x13')]=_0x4553f7[_0xb464('0x13')];this[_0xb464('0x14')]=_0x4553f7[_0xb464('0x14')];this[_0xb464('0x15')]=_0x4553f7[_0xb464('0x15')];this['countagentrejectretry']=_0x4553f7['countagentrejectretry'];this['ContactId']=_0x4553f7['ContactId'];this[_0xb464('0x16')]=_0x4553f7[_0xb464('0x16')];this[_0xb464('0x17')]=_0x4553f7['UserId'];this[_0xb464('0x18')]=_0x4553f7[_0xb464('0x18')];this[_0xb464('0x19')]=_0x4553f7['CampaignId'];this['idHopper']=_0x4553f7['id'];this[_0xb464('0x1a')]=_0x4553f7[_0xb464('0x7')][_0xb464('0x9')]||'';this[_0xb464('0x1b')]=moment()[_0xb464('0x1c')](_0xb464('0x1d'));this[_0xb464('0x1e')]=_0x4553f7['callback'];this[_0xb464('0x1f')]=_0x4553f7[_0xb464('0x1f')];this[_0xb464('0x20')]=_0x4553f7['callbackat'];this['recallme']=_0x4553f7[_0xb464('0x21')];this[_0xb464('0x22')]='';this['originatecalleridname']='';}Action[_0xb464('0x23')]['getCaller']=function(){return util[_0xb464('0x1c')](_0xb464('0x24'),this[_0xb464('0x6')],this[_0xb464('0x5')]['dialCutDigit']>0x0?this[_0xb464('0xb')][_0xb464('0x25')](this[_0xb464('0x5')]['dialCutDigit']):this[_0xb464('0xb')]);};Action[_0xb464('0x23')]['getQueue']=function(){return this[_0xb464('0xc')];};module[_0xb464('0x26')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index 166e4e2..8cc932a 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 _0x68a9=['callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','milliseconds','diff','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','calleridname','name','number','responsetime','answertime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','starttime','talktime','membername','reason','callback','callbackuniqueid'];(function(_0x2e5cbf,_0x538abd){var _0xf5577b=function(_0x28b8e1){while(--_0x28b8e1){_0x2e5cbf['push'](_0x2e5cbf['shift']());}};_0xf5577b(++_0x538abd);}(_0x68a9,0x1c2));var _0x968a=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0x68a9[_0x5447fd];return _0x15b28a;};'use strict';var util=require('util');var _=require(_0x968a('0x0'));var moment=require('moment');function getSeconds(_0x59f3f8,_0x2c4dbf){var _0x39fb83=moment(_0x59f3f8)[_0x968a('0x1')](0x0);var _0x1e77e6=moment(_0x2c4dbf)[_0x968a('0x1')](0x0);return _0x39fb83[_0x968a('0x2')](_0x1e77e6,'seconds');}function AgentComplete(_0x487a8f,_0x57acac){this[_0x968a('0x3')]=0x4;this[_0x968a('0x4')]=_0x968a('0x5');this[_0x968a('0x6')]=_0x487a8f[_0x968a('0x6')];this['type']=_0x487a8f[_0x968a('0x7')];this[_0x968a('0x8')]=_0x487a8f[_0x968a('0x7')]===_0x968a('0x9')?_0x968a('0xa'):_0x487a8f['type'];this[_0x968a('0xb')]=_0x487a8f[_0x968a('0xb')];this[_0x968a('0xc')]=_0x487a8f[_0x968a('0xc')];this[_0x968a('0xd')]=_0x487a8f[_0x968a('0xd')];this[_0x968a('0xe')]=_0x487a8f[_0x968a('0xb')]+_0x487a8f[_0x968a('0xc')]+_0x487a8f[_0x968a('0xd')]+_0x487a8f[_0x968a('0xf')]+_0x487a8f['countdropretry']+_0x487a8f[_0x968a('0x10')]+_0x487a8f[_0x968a('0x11')]+_0x487a8f[_0x968a('0x12')];this[_0x968a('0xf')]=_0x487a8f[_0x968a('0xf')];this[_0x968a('0x13')]=_0x487a8f[_0x968a('0x13')];this['countabandonedretry']=_0x487a8f['countabandonedretry'];this['countmachineretry']=_0x487a8f[_0x968a('0x11')];this[_0x968a('0x12')]=_0x487a8f[_0x968a('0x12')];this['uniqueid']=_0x57acac['uniqueid'];this[_0x968a('0x14')]=_0x487a8f[_0x968a('0x15')];this['calleridnum']=_0x487a8f[_0x968a('0x16')];this['starttime']=_0x487a8f['starttime'];this['responsetime']=_0x487a8f[_0x968a('0x17')];this[_0x968a('0x18')]=_0x487a8f[_0x968a('0x18')];this['endtime']=moment()[_0x968a('0x19')](_0x968a('0x1a'));this[_0x968a('0x1b')]=getSeconds(_0x487a8f[_0x968a('0x17')],_0x487a8f[_0x968a('0x1c')]);this['holdtime']=getSeconds(_0x487a8f[_0x968a('0x18')],_0x487a8f['responsetime']);this[_0x968a('0x1d')]=getSeconds(this['endtime'],_0x487a8f['answertime']);this[_0x968a('0xa')]=_0x57acac[_0x968a('0xa')];this[_0x968a('0x1e')]=_0x57acac['membername'];this[_0x968a('0x1f')]=_0x57acac[_0x968a('0x1f')];this[_0x968a('0x20')]=_0x487a8f[_0x968a('0x20')];this[_0x968a('0x21')]=_0x487a8f[_0x968a('0x21')];this['callbackat']=_0x487a8f[_0x968a('0x22')];this[_0x968a('0x23')]=_0x487a8f[_0x968a('0x23')];this[_0x968a('0x24')]=_0x487a8f['ContactId'];this[_0x968a('0x25')]=_0x487a8f['ListId'];this[_0x968a('0x26')]=_0x487a8f[_0x968a('0x26')];this[_0x968a('0x27')]=_0x487a8f['VoiceQueueId'];this[_0x968a('0x28')]=_0x487a8f[_0x968a('0x28')];this[_0x968a('0x29')]=_0x487a8f[_0x968a('0x29')]||'';this[_0x968a('0x2a')]=_0x487a8f[_0x968a('0x2a')]||'';}module[_0x968a('0x2b')]=AgentComplete; \ No newline at end of file +var _0x0b6d=['countabandonedretry','countmachineretry','countnosuchnumberretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','moment','milliseconds','diff','seconds','statedesc','scheduledat','type','campaigntype','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry'];(function(_0x41d1ac,_0x15611f){var _0x12d712=function(_0x29ccad){while(--_0x29ccad){_0x41d1ac['push'](_0x41d1ac['shift']());}};_0x12d712(++_0x15611f);}(_0x0b6d,0xa8));var _0xd0b6=function(_0xc8a931,_0x260690){_0xc8a931=_0xc8a931-0x0;var _0x28bd27=_0x0b6d[_0xc8a931];return _0x28bd27;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0xd0b6('0x0'));function getSeconds(_0x4536c9,_0x242e32){var _0x561f66=moment(_0x4536c9)[_0xd0b6('0x1')](0x0);var _0x38b04c=moment(_0x242e32)['milliseconds'](0x0);return _0x561f66[_0xd0b6('0x2')](_0x38b04c,_0xd0b6('0x3'));}function AgentComplete(_0x3426f2,_0x4f1ea0){this['state']=0x4;this[_0xd0b6('0x4')]='Answer';this['scheduledat']=_0x3426f2[_0xd0b6('0x5')];this[_0xd0b6('0x6')]=_0x3426f2[_0xd0b6('0x6')];this[_0xd0b6('0x7')]=_0x3426f2[_0xd0b6('0x6')]==='outbound'?'queue':_0x3426f2[_0xd0b6('0x6')];this['countbusyretry']=_0x3426f2[_0xd0b6('0x8')];this[_0xd0b6('0x9')]=_0x3426f2[_0xd0b6('0x9')];this['countnoanswerretry']=_0x3426f2[_0xd0b6('0xa')];this['countglobal']=_0x3426f2[_0xd0b6('0x8')]+_0x3426f2[_0xd0b6('0x9')]+_0x3426f2[_0xd0b6('0xa')]+_0x3426f2['countnosuchnumberretry']+_0x3426f2[_0xd0b6('0xb')]+_0x3426f2[_0xd0b6('0xc')]+_0x3426f2[_0xd0b6('0xd')]+_0x3426f2['countagentrejectretry'];this[_0xd0b6('0xe')]=_0x3426f2[_0xd0b6('0xe')];this['countdropretry']=_0x3426f2[_0xd0b6('0xb')];this[_0xd0b6('0xc')]=_0x3426f2['countabandonedretry'];this[_0xd0b6('0xd')]=_0x3426f2['countmachineretry'];this[_0xd0b6('0xf')]=_0x3426f2['countagentrejectretry'];this['uniqueid']=_0x4f1ea0[_0xd0b6('0x10')];this[_0xd0b6('0x11')]=_0x3426f2[_0xd0b6('0x12')];this[_0xd0b6('0x13')]=_0x3426f2[_0xd0b6('0x14')];this[_0xd0b6('0x15')]=_0x3426f2['starttime'];this[_0xd0b6('0x16')]=_0x3426f2[_0xd0b6('0x16')];this[_0xd0b6('0x17')]=_0x3426f2[_0xd0b6('0x17')];this[_0xd0b6('0x18')]=moment()[_0xd0b6('0x19')](_0xd0b6('0x1a'));this[_0xd0b6('0x1b')]=getSeconds(_0x3426f2['responsetime'],_0x3426f2[_0xd0b6('0x15')]);this[_0xd0b6('0x1c')]=getSeconds(_0x3426f2[_0xd0b6('0x17')],_0x3426f2['responsetime']);this[_0xd0b6('0x1d')]=getSeconds(this[_0xd0b6('0x18')],_0x3426f2[_0xd0b6('0x17')]);this[_0xd0b6('0x1e')]=_0x4f1ea0[_0xd0b6('0x1e')];this[_0xd0b6('0x1f')]=_0x4f1ea0[_0xd0b6('0x1f')];this['reason']=_0x4f1ea0[_0xd0b6('0x20')];this[_0xd0b6('0x21')]=_0x3426f2[_0xd0b6('0x21')];this[_0xd0b6('0x22')]=_0x3426f2[_0xd0b6('0x22')];this['callbackat']=_0x3426f2[_0xd0b6('0x23')];this[_0xd0b6('0x24')]=_0x3426f2[_0xd0b6('0x24')];this[_0xd0b6('0x25')]=_0x3426f2['ContactId'];this['ListId']=_0x3426f2[_0xd0b6('0x26')];this['UserId']=_0x3426f2[_0xd0b6('0x27')];this[_0xd0b6('0x28')]=_0x3426f2[_0xd0b6('0x28')];this['CampaignId']=_0x3426f2[_0xd0b6('0x29')];this[_0xd0b6('0x2a')]=_0x3426f2[_0xd0b6('0x2a')]||'';this[_0xd0b6('0x2b')]=_0x3426f2[_0xd0b6('0x2b')]||'';}module[_0xd0b6('0x2c')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index 5c73216..733b43c 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 _0x8f8c=['endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','milliseconds','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','responsetime'];(function(_0xc64d26,_0x5d235c){var _0x59e9f8=function(_0x1036b7){while(--_0x1036b7){_0xc64d26['push'](_0xc64d26['shift']());}};_0x59e9f8(++_0x5d235c);}(_0x8f8c,0x16d));var _0xc8f8=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x8f8c[_0x3ab51d];return _0x29a04e;};'use strict';var util=require('util');var _=require('lodash');var moment=require('moment');function getSeconds(_0x20011c,_0x2e0480){var _0x33807e=moment(_0x20011c)[_0xc8f8('0x0')](0x0);var _0x58dc7e=moment(_0x2e0480)[_0xc8f8('0x0')](0x0);return _0x33807e['diff'](_0x58dc7e,_0xc8f8('0x1'));}function Final(_0x15dace){this[_0xc8f8('0x2')]=_0x15dace['uniqueid'];this[_0xc8f8('0x3')]=_0x15dace[_0xc8f8('0x3')];this[_0xc8f8('0x4')]=_0x15dace[_0xc8f8('0x4')];this[_0xc8f8('0x5')]=_0x15dace['type']===_0xc8f8('0x6')?_0xc8f8('0x7'):_0x15dace[_0xc8f8('0x4')];this[_0xc8f8('0x8')]=_0x15dace[_0xc8f8('0x8')];this['countcongestionretry']=_0x15dace[_0xc8f8('0x9')];this['countnoanswerretry']=_0x15dace[_0xc8f8('0xa')];this[_0xc8f8('0xb')]=_0x15dace[_0xc8f8('0x8')]+_0x15dace['countcongestionretry']+_0x15dace['countnoanswerretry']+_0x15dace[_0xc8f8('0xc')]+_0x15dace[_0xc8f8('0xd')]+_0x15dace[_0xc8f8('0xe')]+_0x15dace['countmachineretry']+_0x15dace['countagentrejectretry'];this[_0xc8f8('0xc')]=_0x15dace['countnosuchnumberretry'];this[_0xc8f8('0xd')]=_0x15dace['countdropretry'];this[_0xc8f8('0xe')]=_0x15dace[_0xc8f8('0xe')];this['countmachineretry']=_0x15dace[_0xc8f8('0xf')];this[_0xc8f8('0x10')]=_0x15dace[_0xc8f8('0x10')];this[_0xc8f8('0x7')]=_0x15dace[_0xc8f8('0x7')];this[_0xc8f8('0x11')]=_0x15dace[_0xc8f8('0x11')];this[_0xc8f8('0x12')]=_0x15dace[_0xc8f8('0x12')];this['starttime']=_0x15dace['starttime'];this[_0xc8f8('0x13')]=_0x15dace[_0xc8f8('0x13')];this[_0xc8f8('0x14')]=_0x15dace[_0xc8f8('0x13')];this[_0xc8f8('0x15')]=_0x15dace[_0xc8f8('0x15')]||0x0;this[_0xc8f8('0x16')]=_0x15dace[_0xc8f8('0x16')]||0x0;this[_0xc8f8('0x17')]=_0x15dace[_0xc8f8('0x17')]||0x0;this[_0xc8f8('0x18')]=_0x15dace[_0xc8f8('0x18')];this[_0xc8f8('0x19')]=_0x15dace[_0xc8f8('0x19')];this[_0xc8f8('0x1a')]=_0x15dace[_0xc8f8('0x1a')];this[_0xc8f8('0x1b')]=_0x15dace[_0xc8f8('0x1b')];this['ContactId']=_0x15dace[_0xc8f8('0x1c')];this['ListId']=_0x15dace['ListId'];this[_0xc8f8('0x1d')]=_0x15dace[_0xc8f8('0x1d')];this[_0xc8f8('0x1e')]=_0x15dace[_0xc8f8('0x1e')];this['CampaignId']=_0x15dace[_0xc8f8('0x1f')];this['originatecalleridnum']=_0x15dace[_0xc8f8('0x20')]||'';this[_0xc8f8('0x21')]=_0x15dace[_0xc8f8('0x21')]||'';}module[_0xc8f8('0x22')]=Final; \ No newline at end of file +var _0x75c3=['countagentrejectretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','exports','lodash','moment','milliseconds','diff','uniqueid','scheduledat','type','outbound','queue','countcongestionretry','countnoanswerretry','countglobal','countbusyretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry'];(function(_0x537252,_0x1931e9){var _0x229b9d=function(_0x4ab8f0){while(--_0x4ab8f0){_0x537252['push'](_0x537252['shift']());}};_0x229b9d(++_0x1931e9);}(_0x75c3,0x1d0));var _0x375c=function(_0x3377e3,_0x2a4fe8){_0x3377e3=_0x3377e3-0x0;var _0x530ca1=_0x75c3[_0x3377e3];return _0x530ca1;};'use strict';var util=require('util');var _=require(_0x375c('0x0'));var moment=require(_0x375c('0x1'));function getSeconds(_0x6ab541,_0x4bf51e){var _0x5efc3a=moment(_0x6ab541)[_0x375c('0x2')](0x0);var _0x3da487=moment(_0x4bf51e)['milliseconds'](0x0);return _0x5efc3a[_0x375c('0x3')](_0x3da487,'seconds');}function Final(_0x555562){this[_0x375c('0x4')]=_0x555562[_0x375c('0x4')];this[_0x375c('0x5')]=_0x555562[_0x375c('0x5')];this['type']=_0x555562['type'];this['campaigntype']=_0x555562[_0x375c('0x6')]===_0x375c('0x7')?_0x375c('0x8'):_0x555562[_0x375c('0x6')];this['countbusyretry']=_0x555562['countbusyretry'];this[_0x375c('0x9')]=_0x555562[_0x375c('0x9')];this['countnoanswerretry']=_0x555562[_0x375c('0xa')];this[_0x375c('0xb')]=_0x555562[_0x375c('0xc')]+_0x555562['countcongestionretry']+_0x555562[_0x375c('0xa')]+_0x555562[_0x375c('0xd')]+_0x555562[_0x375c('0xe')]+_0x555562['countabandonedretry']+_0x555562['countmachineretry']+_0x555562['countagentrejectretry'];this[_0x375c('0xd')]=_0x555562[_0x375c('0xd')];this['countdropretry']=_0x555562[_0x375c('0xe')];this[_0x375c('0xf')]=_0x555562[_0x375c('0xf')];this[_0x375c('0x10')]=_0x555562[_0x375c('0x10')];this['countagentrejectretry']=_0x555562[_0x375c('0x11')];this[_0x375c('0x8')]=_0x555562[_0x375c('0x8')];this[_0x375c('0x12')]=_0x555562[_0x375c('0x12')];this['calleridnum']=_0x555562[_0x375c('0x13')];this[_0x375c('0x14')]=_0x555562[_0x375c('0x14')];this[_0x375c('0x15')]=_0x555562[_0x375c('0x15')];this[_0x375c('0x16')]=_0x555562[_0x375c('0x15')];this['ringtime']=_0x555562[_0x375c('0x17')]||0x0;this[_0x375c('0x18')]=_0x555562[_0x375c('0x18')]||0x0;this[_0x375c('0x19')]=_0x555562[_0x375c('0x19')]||0x0;this[_0x375c('0x1a')]=_0x555562[_0x375c('0x1a')];this[_0x375c('0x1b')]=_0x555562['callbackuniqueid'];this[_0x375c('0x1c')]=_0x555562[_0x375c('0x1c')];this['recallme']=_0x555562[_0x375c('0x1d')];this[_0x375c('0x1e')]=_0x555562['ContactId'];this[_0x375c('0x1f')]=_0x555562[_0x375c('0x1f')];this[_0x375c('0x20')]=_0x555562[_0x375c('0x20')];this[_0x375c('0x21')]=_0x555562[_0x375c('0x21')];this[_0x375c('0x22')]=_0x555562[_0x375c('0x22')];this[_0x375c('0x23')]=_0x555562[_0x375c('0x23')]||'';this['originatecalleridname']=_0x555562['originatecalleridname']||'';}module[_0x375c('0x24')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index 7bc11b8..fac46a3 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 _0xa426=['countmachineretry','countnosuchnumberretry','countdropretry','countagentrejectretry','uniqueid','calleridname','name','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','membername','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','moment','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countabandonedretry'];(function(_0x2fd54f,_0x5c652d){var _0x1d9f20=function(_0x33e523){while(--_0x33e523){_0x2fd54f['push'](_0x2fd54f['shift']());}};_0x1d9f20(++_0x5c652d);}(_0xa426,0x1d3));var _0x6a42=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0xa426[_0x4f9b18];return _0x29f20c;};'use strict';var util=require(_0x6a42('0x0'));var _=require('lodash');var moment=require(_0x6a42('0x1'));function getSeconds(_0x221fb7,_0x13873f){var _0x124f48=moment(_0x221fb7)[_0x6a42('0x2')](0x0);var _0x4a474d=moment(_0x13873f)['milliseconds'](0x0);return _0x124f48[_0x6a42('0x3')](_0x4a474d,_0x6a42('0x4'));}function Hangup(_0x2f7608,_0x51e391){this[_0x6a42('0x5')]=0x4;this[_0x6a42('0x6')]=_0x6a42('0x7');this[_0x6a42('0x8')]=_0x2f7608[_0x6a42('0x8')];this[_0x6a42('0x9')]=_0x2f7608['type'];this[_0x6a42('0xa')]=_0x2f7608[_0x6a42('0x9')]===_0x6a42('0xb')?_0x6a42('0xc'):_0x2f7608[_0x6a42('0x9')];this['countbusyretry']=_0x2f7608[_0x6a42('0xd')];this[_0x6a42('0xe')]=_0x2f7608[_0x6a42('0xe')];this['countnoanswerretry']=_0x2f7608[_0x6a42('0xf')];this['countglobal']=_0x2f7608[_0x6a42('0xd')]+_0x2f7608[_0x6a42('0xe')]+_0x2f7608['countnoanswerretry']+_0x2f7608['countnosuchnumberretry']+_0x2f7608['countdropretry']+_0x2f7608[_0x6a42('0x10')]+_0x2f7608[_0x6a42('0x11')]+_0x2f7608['countagentrejectretry'];this['countnosuchnumberretry']=_0x2f7608[_0x6a42('0x12')];this[_0x6a42('0x13')]=_0x2f7608[_0x6a42('0x13')];this[_0x6a42('0x10')]=_0x2f7608[_0x6a42('0x10')];this[_0x6a42('0x11')]=_0x2f7608['countmachineretry'];this[_0x6a42('0x14')]=_0x2f7608['countagentrejectretry'];this[_0x6a42('0x15')]=_0x51e391['uniqueid'];this[_0x6a42('0x16')]=_0x2f7608[_0x6a42('0x17')];this['calleridnum']=_0x2f7608[_0x6a42('0x18')];this['starttime']=_0x2f7608[_0x6a42('0x19')];this[_0x6a42('0x1a')]=_0x2f7608['responsetime'];this[_0x6a42('0x1b')]=moment()[_0x6a42('0x1c')](_0x6a42('0x1d'));this[_0x6a42('0x1e')]=getSeconds(_0x2f7608[_0x6a42('0x1a')],_0x2f7608[_0x6a42('0x19')]);this['holdtime']=0x0;this['talktime']=getSeconds(this['endtime'],_0x2f7608[_0x6a42('0x1a')]);this[_0x6a42('0xc')]=_0x2f7608[_0x6a42('0xc')];this[_0x6a42('0x1f')]='IVR';this[_0x6a42('0x20')]=_0x51e391[_0x6a42('0x21')];this['callback']=_0x2f7608[_0x6a42('0x22')];this[_0x6a42('0x23')]=_0x2f7608[_0x6a42('0x23')];this[_0x6a42('0x24')]=_0x2f7608[_0x6a42('0x24')];this[_0x6a42('0x25')]=_0x2f7608['recallme'];this[_0x6a42('0x26')]=_0x2f7608['ContactId'];this['ListId']=_0x2f7608[_0x6a42('0x27')];this['UserId']=_0x2f7608[_0x6a42('0x28')];this[_0x6a42('0x29')]=_0x2f7608['VoiceQueueId'];this[_0x6a42('0x2a')]=_0x2f7608[_0x6a42('0x2a')];}module[_0x6a42('0x2b')]=Hangup; \ No newline at end of file +var _0x9abb=['countmachineretry','countagentrejectretry','uniqueid','name','calleridnum','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','reason','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','CampaignId','moment','milliseconds','diff','seconds','state','statedesc','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countdropretry'];(function(_0x18cac4,_0x57a4d5){var _0x2227c6=function(_0x72934d){while(--_0x72934d){_0x18cac4['push'](_0x18cac4['shift']());}};_0x2227c6(++_0x57a4d5);}(_0x9abb,0xde));var _0xb9ab=function(_0x3e3c9c,_0x70a08b){_0x3e3c9c=_0x3e3c9c-0x0;var _0x56be9f=_0x9abb[_0x3e3c9c];return _0x56be9f;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0xb9ab('0x0'));function getSeconds(_0x3f44e1,_0x3a1c86){var _0x357339=moment(_0x3f44e1)[_0xb9ab('0x1')](0x0);var _0x32c7dd=moment(_0x3a1c86)[_0xb9ab('0x1')](0x0);return _0x357339[_0xb9ab('0x2')](_0x32c7dd,_0xb9ab('0x3'));}function Hangup(_0x9243e8,_0x391a58){this[_0xb9ab('0x4')]=0x4;this[_0xb9ab('0x5')]='Answer';this[_0xb9ab('0x6')]=_0x9243e8['scheduledat'];this[_0xb9ab('0x7')]=_0x9243e8[_0xb9ab('0x7')];this[_0xb9ab('0x8')]=_0x9243e8[_0xb9ab('0x7')]===_0xb9ab('0x9')?_0xb9ab('0xa'):_0x9243e8[_0xb9ab('0x7')];this['countbusyretry']=_0x9243e8[_0xb9ab('0xb')];this[_0xb9ab('0xc')]=_0x9243e8['countcongestionretry'];this[_0xb9ab('0xd')]=_0x9243e8['countnoanswerretry'];this[_0xb9ab('0xe')]=_0x9243e8[_0xb9ab('0xb')]+_0x9243e8[_0xb9ab('0xc')]+_0x9243e8[_0xb9ab('0xd')]+_0x9243e8[_0xb9ab('0xf')]+_0x9243e8['countdropretry']+_0x9243e8[_0xb9ab('0x10')]+_0x9243e8['countmachineretry']+_0x9243e8['countagentrejectretry'];this[_0xb9ab('0xf')]=_0x9243e8['countnosuchnumberretry'];this[_0xb9ab('0x11')]=_0x9243e8[_0xb9ab('0x11')];this[_0xb9ab('0x10')]=_0x9243e8['countabandonedretry'];this[_0xb9ab('0x12')]=_0x9243e8[_0xb9ab('0x12')];this[_0xb9ab('0x13')]=_0x9243e8['countagentrejectretry'];this['uniqueid']=_0x391a58[_0xb9ab('0x14')];this['calleridname']=_0x9243e8[_0xb9ab('0x15')];this[_0xb9ab('0x16')]=_0x9243e8[_0xb9ab('0x17')];this[_0xb9ab('0x18')]=_0x9243e8[_0xb9ab('0x18')];this['responsetime']=_0x9243e8[_0xb9ab('0x19')];this[_0xb9ab('0x1a')]=moment()[_0xb9ab('0x1b')](_0xb9ab('0x1c'));this[_0xb9ab('0x1d')]=getSeconds(_0x9243e8[_0xb9ab('0x19')],_0x9243e8[_0xb9ab('0x18')]);this[_0xb9ab('0x1e')]=0x0;this['talktime']=getSeconds(this[_0xb9ab('0x1a')],_0x9243e8[_0xb9ab('0x19')]);this['queue']=_0x9243e8[_0xb9ab('0xa')];this['membername']='IVR';this[_0xb9ab('0x1f')]=_0x391a58['cause-txt'];this['callback']=_0x9243e8[_0xb9ab('0x20')];this[_0xb9ab('0x21')]=_0x9243e8[_0xb9ab('0x21')];this[_0xb9ab('0x22')]=_0x9243e8[_0xb9ab('0x22')];this[_0xb9ab('0x23')]=_0x9243e8['recallme'];this['ContactId']=_0x9243e8['ContactId'];this[_0xb9ab('0x24')]=_0x9243e8[_0xb9ab('0x24')];this[_0xb9ab('0x25')]=_0x9243e8[_0xb9ab('0x25')];this[_0xb9ab('0x26')]=_0x9243e8[_0xb9ab('0x26')];this[_0xb9ab('0x27')]=_0x9243e8[_0xb9ab('0x27')];}module['exports']=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index 548fc2e..1b4b407 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 _0xa72e=['countcongestionretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','calleridname','name','calleridnum','starttime','responsetime','endtime','ringtime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','queue','countbusyretry'];(function(_0x119b3e,_0x588d50){var _0x1169ae=function(_0x377422){while(--_0x377422){_0x119b3e['push'](_0x119b3e['shift']());}};_0x1169ae(++_0x588d50);}(_0xa72e,0xa4));var _0xea72=function(_0x309f3f,_0x3a133d){_0x309f3f=_0x309f3f-0x0;var _0x2b3ec4=_0xa72e[_0x309f3f];return _0x2b3ec4;};'use strict';var util=require(_0xea72('0x0'));var _=require(_0xea72('0x1'));var moment=require('moment');function getSeconds(_0x13256a,_0x1af3a4){var _0x2030e2=moment(_0x13256a)[_0xea72('0x2')](0x0);var _0x2d62ac=moment(_0x1af3a4)['milliseconds'](0x0);return _0x2030e2[_0xea72('0x3')](_0x2d62ac,_0xea72('0x4'));}function History(_0x2cb61d){this[_0xea72('0x5')]=_0x2cb61d[_0xea72('0x5')];this[_0xea72('0x6')]=_0x2cb61d['scheduledat']||undefined;this[_0xea72('0x7')]=_0x2cb61d[_0xea72('0x7')];this[_0xea72('0x8')]=_0x2cb61d['type']==='outbound'?_0xea72('0x9'):_0x2cb61d['type'];this[_0xea72('0xa')]=_0x2cb61d[_0xea72('0xa')];this[_0xea72('0xb')]=_0x2cb61d[_0xea72('0xb')];this['countnoanswerretry']=_0x2cb61d['countnoanswerretry'];this['countglobal']=_0x2cb61d[_0xea72('0xa')]+_0x2cb61d[_0xea72('0xb')]+_0x2cb61d['countnoanswerretry']+_0x2cb61d[_0xea72('0xc')]+_0x2cb61d[_0xea72('0xd')]+_0x2cb61d['countabandonedretry']+_0x2cb61d[_0xea72('0xe')]+_0x2cb61d[_0xea72('0xf')];this[_0xea72('0xc')]=_0x2cb61d[_0xea72('0xc')];this['countdropretry']=_0x2cb61d[_0xea72('0xd')];this[_0xea72('0x10')]=_0x2cb61d[_0xea72('0x10')];this[_0xea72('0xe')]=_0x2cb61d[_0xea72('0xe')];this['countagentrejectretry']=_0x2cb61d[_0xea72('0xf')];this[_0xea72('0x9')]=_0x2cb61d[_0xea72('0x9')];this[_0xea72('0x11')]=_0x2cb61d[_0xea72('0x12')];this[_0xea72('0x13')]=_0x2cb61d['number'];this[_0xea72('0x14')]=_0x2cb61d['starttime'];this[_0xea72('0x15')]=_0x2cb61d[_0xea72('0x15')];this[_0xea72('0x16')]=_0x2cb61d['responsetime'];this[_0xea72('0x17')]=getSeconds(_0x2cb61d[_0xea72('0x15')],_0x2cb61d[_0xea72('0x14')]);this['holdtime']=0x0;this['talktime']=0x0;this[_0xea72('0x18')]=_0x2cb61d['callback'];this[_0xea72('0x19')]=_0x2cb61d[_0xea72('0x19')];this['callbackat']=_0x2cb61d[_0xea72('0x1a')];this[_0xea72('0x1b')]=_0x2cb61d[_0xea72('0x1b')];this[_0xea72('0x1c')]=_0x2cb61d[_0xea72('0x1c')];this['ListId']=_0x2cb61d[_0xea72('0x1d')];this[_0xea72('0x1e')]=_0x2cb61d[_0xea72('0x1e')];this['VoiceQueueId']=_0x2cb61d[_0xea72('0x1f')];this[_0xea72('0x20')]=_0x2cb61d[_0xea72('0x20')];this[_0xea72('0x21')]=_0x2cb61d[_0xea72('0x21')]||'';this['originatecalleridname']=_0x2cb61d[_0xea72('0x22')]||'';}module['exports']=History; \ No newline at end of file +var _0x0064=['countnosuchnumberretry','countabandonedretry','countagentrejectretry','countdropretry','countmachineretry','calleridname','name','calleridnum','number','starttime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','seconds','uniqueid','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal'];(function(_0x5ad56a,_0x3355e6){var _0x32a28d=function(_0x883884){while(--_0x883884){_0x5ad56a['push'](_0x5ad56a['shift']());}};_0x32a28d(++_0x3355e6);}(_0x0064,0x68));var _0x4006=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0064[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var _=require(_0x4006('0x0'));var moment=require(_0x4006('0x1'));function getSeconds(_0x2d5111,_0x24571d){var _0x4022ac=moment(_0x2d5111)[_0x4006('0x2')](0x0);var _0x5ed96f=moment(_0x24571d)[_0x4006('0x2')](0x0);return _0x4022ac['diff'](_0x5ed96f,_0x4006('0x3'));}function History(_0x4376f5){this[_0x4006('0x4')]=_0x4376f5[_0x4006('0x4')];this[_0x4006('0x5')]=_0x4376f5[_0x4006('0x5')]||undefined;this[_0x4006('0x6')]=_0x4376f5[_0x4006('0x6')];this[_0x4006('0x7')]=_0x4376f5['type']==='outbound'?_0x4006('0x8'):_0x4376f5[_0x4006('0x6')];this[_0x4006('0x9')]=_0x4376f5[_0x4006('0x9')];this['countcongestionretry']=_0x4376f5[_0x4006('0xa')];this[_0x4006('0xb')]=_0x4376f5[_0x4006('0xb')];this[_0x4006('0xc')]=_0x4376f5[_0x4006('0x9')]+_0x4376f5[_0x4006('0xa')]+_0x4376f5[_0x4006('0xb')]+_0x4376f5[_0x4006('0xd')]+_0x4376f5['countdropretry']+_0x4376f5[_0x4006('0xe')]+_0x4376f5['countmachineretry']+_0x4376f5[_0x4006('0xf')];this[_0x4006('0xd')]=_0x4376f5[_0x4006('0xd')];this[_0x4006('0x10')]=_0x4376f5['countdropretry'];this[_0x4006('0xe')]=_0x4376f5[_0x4006('0xe')];this[_0x4006('0x11')]=_0x4376f5[_0x4006('0x11')];this[_0x4006('0xf')]=_0x4376f5[_0x4006('0xf')];this[_0x4006('0x8')]=_0x4376f5[_0x4006('0x8')];this[_0x4006('0x12')]=_0x4376f5[_0x4006('0x13')];this[_0x4006('0x14')]=_0x4376f5[_0x4006('0x15')];this[_0x4006('0x16')]=_0x4376f5[_0x4006('0x16')];this['responsetime']=_0x4376f5['responsetime'];this['endtime']=_0x4376f5[_0x4006('0x17')];this[_0x4006('0x18')]=getSeconds(_0x4376f5[_0x4006('0x17')],_0x4376f5[_0x4006('0x16')]);this[_0x4006('0x19')]=0x0;this[_0x4006('0x1a')]=0x0;this['callback']=_0x4376f5[_0x4006('0x1b')];this[_0x4006('0x1c')]=_0x4376f5[_0x4006('0x1c')];this[_0x4006('0x1d')]=_0x4376f5[_0x4006('0x1d')];this[_0x4006('0x1e')]=_0x4376f5[_0x4006('0x1e')];this[_0x4006('0x1f')]=_0x4376f5[_0x4006('0x1f')];this[_0x4006('0x20')]=_0x4376f5[_0x4006('0x20')];this['UserId']=_0x4376f5[_0x4006('0x21')];this[_0x4006('0x22')]=_0x4376f5['VoiceQueueId'];this[_0x4006('0x23')]=_0x4376f5['CampaignId'];this[_0x4006('0x24')]=_0x4376f5[_0x4006('0x24')]||'';this[_0x4006('0x25')]=_0x4376f5['originatecalleridname']||'';}module[_0x4006('0x26')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index b7ed22c..97522d1 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 _0xd92b=['\x20Timezone\x20unknow\x20','isArray','Action','command','iftime\x20%s,%s','interval','timezones','content','indexOf','true','all','some','INTERVAL_IS_OVERTIME','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','dialPowerLevel','predictive','Queue','method\x20not\x20recognized','launchHandleIvr','handleIvr','dialActive','loggedIn','checkIsTrunkReachable','dialGlobalInterval','dialTimezone','checkIfTimeIntervals','pow','random','match','actionOriginate','originate','Contact','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueTimeout','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','dialCutDigit','substring','trim','from-sip','dialOriginateTimeout','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','Error','originate\x20action\x20Error','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countmachineretry','dialGlobalMaxRetry','dialNoAnswerMaxRetry','[rescheduleContact][NoAnswer]','countbusyretry','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','[rescheduleContact][Machine]','countagentrejectretry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','object','[callProgressDetecting]','evt\x20is\x20undefine','reason','NoSuchNumber','[syncAgentComplete][createHistory][0]','reason\x200\x20no\x20such\x20number....','createStateFinal','outboundNoAnswerCallsDay','NoAnswer','countglobal','reason\x203\x20ringing\x20no\x20answer','stateGlobal','[syncAgentComplete][createHistory][5]','dialBusyMaxRetry','reason\x205\x20busy','Congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','[syncAgentComplete][createHistory][11]','reason\x2011\x20abandoned','AgentReject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Success','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','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(','agentBusyFactor','Unknown\x20Predictive','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','predictiveIntervalAnsweredCalls','busyFactor','[getDataPredictive]','check\x20failure','floor','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','queuestatus','[booked][checkContactBlack][else]','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','scheduledat','dialRecallMeTimeout','Agent','voicePause','log','Contact\x20updated','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','limitCalls','temp','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','dialLimitQueue','not_inuse','tryOriginatePredictive','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','abandonmentRate','--------\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','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','----\x20Agent\x20Busy\x20Factor\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','[busyFactor]','Umin\x20=\x20','exports','util','lodash','uuid','moment','md5','ioredis','dialer','../../../config/logger','booked','predictiveCalls','syncQueueSummary','redis','defaults','localhost','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/voiceQueueRt','./history','./final','./agentComplete','./queueCallerAbandon','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','tail','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','actions','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','bind','syncQueueCallerAbandon','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','isUndefined','message','AGENTS_NOT_LOGGED','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','name','isEmpty','[ifTime][Action]','stringify','milliseconds','seconds','emit','outbound','answered','available','pTalking','sumBillable','sumDuration','talking','total','type','waiting','loggedInDb','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','callerid','voice:queue:%s','voice_queue:save','ivr','format','campaign:ivr:%s','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','predictiveIntervalAvgHoldtime','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','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','clearing\x20variable\x20start\x20predictive','handlePredictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','length','hasOwnProperty','[decremetOriginate]\x20is\x20null\x20or\x20undefined','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contactsRescheduled','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','IS_DISACTIVED','statedesc','endtime','starttime','clearZombieChannels','[uniqueid]','[actions]','sequence','enqueue','isNil','status','[Dialer][checkChannel]','queue','[Dialer][checkChannel][ivr]','countReScheduled','catch','[countReScheduled]\x20','resolve','then','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','[moveContactManagedDialer]\x20','updateOriginated','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','saveInDb','ContactId','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','isSuccess','SIP/%s','reachable','unmonitored','createHistory','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','HANGUP','uniqueid','state','HangupInAMD','membername','AMD','[syncHangupInAMD][createHistory]','value','MACHINE','[syncMachine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','[syncMachineIvr][createHistory]','[syncHangupIvr][createHistory]','moveContactManagedDialer','dialQueueProject','AnswerAGI','[syncHangupIvr]','Unknow','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','YYYY-MM-DD\x20HH:mm:ss','[syncAgentComplete]','queueCallerAbandonCreateState','[syncAgentComplete][createHistory]','[syncQueueCallerAbandon]\x20[Drop]','responsetime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','TIMEOUT','countdropretry','dialDropMaxRetry','add','dialDropRetryFrequency','minutes','[rescheduleContact][Drop]','Abandoned','dropreason','CALLEREXIT','countabandonedretry','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','channel','actionid','strategy','locked','paused','stateinterface','push','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','pick','run','idHopper','finally','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[Catch][Preview][syncQueueStatusComplete]','[booked][RR][finaly]','[booked][unlock2]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','checkIfTime','ifTime','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','Failure','\x20Intervals\x20is\x20empty\x20','TIMEZONE_UNKNOW'];(function(_0x370d7f,_0x275283){var _0x5b8e64=function(_0x493928){while(--_0x493928){_0x370d7f['push'](_0x370d7f['shift']());}};_0x5b8e64(++_0x275283);}(_0xd92b,0xe5));var _0xbd92=function(_0x451bb4,_0x15877e){_0x451bb4=_0x451bb4-0x0;var _0x2c53a9=_0xd92b[_0x451bb4];return _0x2c53a9;};'use strict';var util=require(_0xbd92('0x0'));var _=require(_0xbd92('0x1'));var BPromise=require('bluebird');var uuid=require(_0xbd92('0x2'));var moment=require(_0xbd92('0x3'));var rr=require('rr');var md5=require(_0xbd92('0x4'));var Redis=require(_0xbd92('0x5'));var config=require('../../../config/environment/');var logger=require('../../../config/logger')(_0xbd92('0x6'));var loggerBooked=require(_0xbd92('0x7'))(_0xbd92('0x8'));var loggerPredictive=require(_0xbd92('0x7'))('predictive');var loggerPredictiveCalls=require('../../../config/logger')(_0xbd92('0x9'));var loggerSyncQueueSummary=require(_0xbd92('0x7'))(_0xbd92('0xa'));var ami=require('../ami');config[_0xbd92('0xb')]=_[_0xbd92('0xc')](config['redis'],{'host':_0xbd92('0xd'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var cmHopper=require(_0xbd92('0xe'));var cmHopperFinal=require(_0xbd92('0xf'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0xbd92('0x10'));var Action=require('./action');var History=require(_0xbd92('0x11'));var Final=require(_0xbd92('0x12'));var AgentComplete=require(_0xbd92('0x13'));var QueueCallerAbandon=require(_0xbd92('0x14'));var Hangup=require('./hangup');var ipAgi=process[_0xbd92('0x15')][_0xbd92('0x16')]||_0xbd92('0x17');var strategy={'rrmemory':_0xbd92('0x18'),'roundrobin':_0xbd92('0x19')};var Sequence=function(){};Sequence[_0xbd92('0x1a')]['enqueue']=function(_0x2b259e){this['tail']=this[_0xbd92('0x1b')]?this[_0xbd92('0x1b')]['finally'](_0x2b259e):_0x2b259e();};function Dialer(_0xcaa1c2,_0x2729f4){this['sequence']=new Sequence();this[_0xbd92('0x1c')]=_0x2729f4;this[_0xbd92('0x1d')]=_0xcaa1c2[_0xbd92('0x1d')];this[_0xbd92('0x1e')]=_0xcaa1c2['campaigns'];this[_0xbd92('0x1f')]=_0xcaa1c2[_0xbd92('0x1f')];this[_0xbd92('0x20')]=_0xcaa1c2[_0xbd92('0x20')];this[_0xbd92('0x21')]=config[_0xbd92('0x21')]||0x2;this['channels']={};this[_0xbd92('0x22')]={};this[_0xbd92('0x23')]={};this[_0xbd92('0x24')]={};this[_0xbd92('0x25')]={};this[_0xbd92('0x26')]={};this[_0xbd92('0x27')]={};this[_0xbd92('0x28')]={};this[_0xbd92('0x29')]={};this[_0xbd92('0x2a')]={};ami['on'](_0xbd92('0x2b'),this['syncAgentConnect'][_0xbd92('0x2c')](this));ami['on']('queuecallerabandon',this[_0xbd92('0x2d')][_0xbd92('0x2c')](this));ami['on']('originateresponse',this[_0xbd92('0x2e')][_0xbd92('0x2c')](this));ami['on'](_0xbd92('0x2f'),this[_0xbd92('0x30')][_0xbd92('0x2c')](this));ami['on'](_0xbd92('0x31'),this[_0xbd92('0xa')]['bind'](this));ami['on'](_0xbd92('0x32'),this[_0xbd92('0x33')]['bind'](this));ami['on'](_0xbd92('0x34'),this[_0xbd92('0x35')][_0xbd92('0x2c')](this));ami['on'](_0xbd92('0x36'),this[_0xbd92('0x37')][_0xbd92('0x2c')](this));ami['on'](_0xbd92('0x38'),this[_0xbd92('0x39')][_0xbd92('0x2c')](this));ami['on'](_0xbd92('0x3a'),this[_0xbd92('0x3b')][_0xbd92('0x2c')](this));this[_0xbd92('0x3c')]();this[_0xbd92('0x3d')]();}function isNotNull(_0x5e6641){return _0x5e6641!==null&&!_[_0xbd92('0x3e')](_0x5e6641);}function checkIsLoggedIn(_0x1e0ae5,_0x596c09){return function(){if(_0x596c09<=0x0){_0x1e0ae5[_0xbd92('0x3f')]=_0xbd92('0x40');throw _0x1e0ae5['name']+_0xbd92('0x41');}};}function isActive(_0x2f9cae){return _0x2f9cae;}function checkIsActive(_0x130615,_0x47e918){return function(){if(!isActive(_0x47e918)){_0x130615[_0xbd92('0x3f')]=_0xbd92('0x42');throw _0x130615['name']+_0xbd92('0x43');}};}function checkInterval(_0x16c60a){return function(){if(!isNotNull(_0x16c60a[_0xbd92('0x44')])){_0x16c60a[_0xbd92('0x3f')]=_0xbd92('0x45');throw _0x16c60a['name']+_0xbd92('0x46');}if(!isNotNull(_0x16c60a[_0xbd92('0x44')][_0xbd92('0x47')])){_0x16c60a[_0xbd92('0x3f')]=_0xbd92('0x45');throw _0x16c60a[_0xbd92('0x48')]+_0xbd92('0x46');}if(!isNotNull(_[_0xbd92('0x49')](_0x16c60a[_0xbd92('0x44')][_0xbd92('0x47')]))){_0x16c60a['message']=_0xbd92('0x45');throw _0x16c60a[_0xbd92('0x48')]+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0x359c89,_0x312bb1,_0x46a914){return{'action':_0x359c89,'response':_0x312bb1,'message':_0x46a914,'stack':_0x46a914};}function myreject(_0x27a169){return function(_0x3380cc){return _0x27a169(msgResponse(_0xbd92('0x4a'),'Error',JSON[_0xbd92('0x4b')](_0x3380cc)));};}function getSeconds(_0x57a25b,_0x5e74df){var _0x296b85=moment(_0x57a25b)[_0xbd92('0x4c')](0x0);var _0x593616=moment(_0x5e74df)[_0xbd92('0x4c')](0x0);return _0x296b85['diff'](_0x593616,_0xbd92('0x4d'));}function emit(_0x5b0690,_0x2dd6db,_0x3a52a8){io['to'](_0x5b0690)[_0xbd92('0x4e')](_0x2dd6db,_0x3a52a8);}function emitVoiceQueueSummary(_0x104366){if(_0x104366['type']===_0xbd92('0x4f')){var _0x57f5e1={'id':_0x104366['id'],'name':_0x104366[_0xbd92('0x48')],'strategy':_0x104366['strategy'],'answered':_0x104366[_0xbd92('0x50')],'available':_0x104366[_0xbd92('0x51')],'loggedIn':_0x104366['loggedIn'],'pTalking':_0x104366[_0xbd92('0x52')],'sumBillable':_0x104366[_0xbd92('0x53')],'sumDuration':_0x104366[_0xbd92('0x54')],'sumHoldTime':_0x104366['sumHoldTime']||0x0,'talking':_0x104366[_0xbd92('0x55')],'total':_0x104366[_0xbd92('0x56')],'type':_0x104366[_0xbd92('0x57')],'unmanaged':_0x104366['unmanaged'],'abandoned':_0x104366['abandoned'],'waiting':_0x104366[_0xbd92('0x58')],'loggedInDb':_0x104366[_0xbd92('0x59')],'dialActive':_0x104366['dialActive'],'dialMethod':_0x104366[_0xbd92('0x5a')],'dialOriginateCallerIdName':_0x104366[_0xbd92('0x5b')],'dialOriginateCallerIdNumber':_0x104366[_0xbd92('0x5c')],'dialOriginateTimeout':_0x104366['dialOriginateTimeout'],'dialPrefix':_0x104366[_0xbd92('0x5d')],'outboundAnswerAgiCallsDay':_0x104366[_0xbd92('0x5e')],'outboundAnswerCallsDay':_0x104366[_0xbd92('0x5f')],'outboundBlacklistCallsDay':_0x104366['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x104366[_0xbd92('0x60')],'outboundCongestionCallsDay':_0x104366[_0xbd92('0x61')],'outboundDropCallsDayACS':_0x104366[_0xbd92('0x62')],'outboundDropCallsDayCallersExit':_0x104366[_0xbd92('0x63')],'outboundDropCallsDayTimeout':_0x104366[_0xbd92('0x64')],'outboundNoAnswerCallsDay':_0x104366['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x104366[_0xbd92('0x65')],'outboundOriginateFailureCallsDay':_0x104366['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x104366['outboundReCallsDay'],'outboundRejectCallsDay':_0x104366[_0xbd92('0x66')],'outboundUnknownCallsDay':_0x104366[_0xbd92('0x67')],'predictiveIntervalAnsweredCalls':_0x104366['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x104366['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x104366['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x104366['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x104366['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x104366['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x104366['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x104366[_0xbd92('0x68')],'predictiveIntervalMultiplicativeFactor':_0x104366[_0xbd92('0x69')],'predictiveIntervalPauses':_0x104366[_0xbd92('0x6a')],'predictiveIntervalAvailable':_0x104366[_0xbd92('0x6b')],'predictiveIntervalTotalCalls':_0x104366[_0xbd92('0x6c')],'message':_0x104366[_0xbd92('0x3f')],'originated':_0x104366[_0xbd92('0x6d')],'erlangCalls':_0x104366[_0xbd92('0x6e')],'erlangCallToSecond':_0x104366[_0xbd92('0x6f')],'erlangAbandonmentRate':_0x104366[_0xbd92('0x70')],'erlangBusyFactor':_0x104366[_0xbd92('0x71')],'startPredictive':_0x104366[_0xbd92('0x26')],'startProgressive':_0x104366['startProgressive']};if(_0x104366[_0xbd92('0x72')]){_0x57f5e1['Trunk']={'id':_0x104366[_0xbd92('0x72')]['id'],'name':_0x104366[_0xbd92('0x72')][_0xbd92('0x48')],'active':_0x104366[_0xbd92('0x72')][_0xbd92('0x73')],'callerid':_0x104366['Trunk'][_0xbd92('0x74')]};}if(_0x104366[_0xbd92('0x44')]){_0x57f5e1['Interval']={'id':_0x104366[_0xbd92('0x44')]['id'],'name':_0x104366[_0xbd92('0x44')][_0xbd92('0x48')]};}var _0x4991cd=md5(JSON[_0xbd92('0x4b')](_0x57f5e1));if(_0x104366['md5']!==_0x4991cd){_0x104366[_0xbd92('0x4')]=_0x4991cd;emit(util['format'](_0xbd92('0x75'),_0x57f5e1[_0xbd92('0x48')]),_0xbd92('0x76'),_0x57f5e1);}}}function emitCampaignSummary(_0x3bff98){if(_0x3bff98[_0xbd92('0x57')]===_0xbd92('0x77')){emit(util[_0xbd92('0x78')](_0xbd92('0x79'),_0x3bff98['name']),'campaign:save',_0x3bff98);}}function checkGetDataPredictive(_0x10472e){if(isNotNull(_0x10472e)){if(!_[_0xbd92('0x49')](_0x10472e)){loggerPredictive[_0xbd92('0x7a')](_0xbd92('0x7b'));loggerPredictive[_0xbd92('0x7a')](_0xbd92('0x7c'),_0x10472e['predictiveIntervalTotalCalls']);loggerPredictive['info']('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x10472e['predictiveIntervalAnsweredCalls']);loggerPredictive[_0xbd92('0x7a')](_0xbd92('0x7d'),_0x10472e['predictiveIntervalDroppedCallsTimeout']);loggerPredictive[_0xbd92('0x7a')](_0xbd92('0x7e'),_0x10472e[_0xbd92('0x7f')]);loggerPredictive['info']('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x10472e['predictiveIntervalAvgHoldtime']);loggerPredictive['info'](_0xbd92('0x80'),_0x10472e[_0xbd92('0x81')]);loggerPredictive[_0xbd92('0x7a')](_0xbd92('0x82'));if(_0x10472e[_0xbd92('0x6c')]>0x0){if(!_['isUndefined'](_0x10472e[_0xbd92('0x81')])&&_0x10472e['predictiveIntervalAvgTalktime']>0x0){return!![];}else{loggerPredictive['info'](_0xbd92('0x83'));}if(!_[_0xbd92('0x3e')](_0x10472e['predictiveIntervalAvgHoldtime'])&&_0x10472e[_0xbd92('0x84')]>0x0){return!![];}else{loggerPredictive[_0xbd92('0x7a')](_0xbd92('0x85'));}}else{loggerPredictive[_0xbd92('0x7a')](_0xbd92('0x86'));}}else{loggerPredictive[_0xbd92('0x7a')](_0xbd92('0x87'));}}else{loggerPredictive['info']('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x1763e6){return function(_0x5d2b80){loggerPredictive['info']('---------\x20ErlangB\x20---------');loggerPredictive[_0xbd92('0x7a')](_0xbd92('0x88'),_0x5d2b80[_0xbd92('0x6e')]);loggerPredictive[_0xbd92('0x7a')](_0xbd92('0x89'),_0x5d2b80[_0xbd92('0x6f')]);loggerPredictive[_0xbd92('0x7a')](_0xbd92('0x8a'),_0x5d2b80[_0xbd92('0x70')]);loggerPredictive[_0xbd92('0x7a')](_0xbd92('0x8b'),_0x5d2b80[_0xbd92('0x71')]);loggerPredictive[_0xbd92('0x7a')](_0xbd92('0x8a'),_0x5d2b80['erlangAbandonmentRate']);loggerPredictive['info']('---------------------------');_[_0xbd92('0x8c')](_0x1763e6,_0x5d2b80);};}function getDiff(_0x42002a){var _0x3eb04c=moment()[_0xbd92('0x4c')](0x0);var _0x1c7f30=moment(_0x42002a)['milliseconds'](0x0);return _0x3eb04c[_0xbd92('0x8d')](_0x1c7f30,_0xbd92('0x4d'));}function ifInterval(_0x16afff,_0xe89fd0){if(_['isUndefined'](_0xe89fd0)){return![];}if(getDiff(_0xe89fd0)<_0x16afff*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0x224fc7){if(isNotNull(_0x224fc7)){if(!_[_0xbd92('0x3e')](_0x224fc7[_0xbd92('0x27')])){_0x224fc7[_0xbd92('0x27')]=undefined;loggerPredictive['info'](_0x224fc7[_0xbd92('0x48')],_0xbd92('0x8e'));}if(!_[_0xbd92('0x3e')](_0x224fc7[_0xbd92('0x26')])){_0x224fc7['startPredictive']=undefined;loggerPredictive[_0xbd92('0x7a')](_0x224fc7[_0xbd92('0x48')],_0xbd92('0x8f'));}if(!_[_0xbd92('0x3e')](_0x224fc7[_0xbd92('0x90')])){clearInterval(_0x224fc7[_0xbd92('0x90')]);_0x224fc7[_0xbd92('0x90')]=undefined;loggerPredictive[_0xbd92('0x7a')](_0x224fc7[_0xbd92('0x48')],'clearing\x20variable\x20handle\x20predictive');}}}function erlangb(_0x1917cb,_0x57e4b4){if(_0x57e4b4===0x0){return 0x0;}var _0x753ec6=0x1;for(var _0x574148=0x1;_0x574148<=_0x57e4b4;_0x574148+=0x1){_0x753ec6=0x1+_0x753ec6*_0x574148/_0x1917cb;}return 0x1/_0x753ec6;}function isVoiceQueueOutbound(_0x126291){return _0x126291===_0xbd92('0x4f');}function isNotPreview(_0x446090){return _0x446090!==_0xbd92('0x1c');}function isCampaignIvr(_0x3c10f4){return _0x3c10f4===_0xbd92('0x77');}function getCallerId(_0x42e5ff,_0xd65867,_0x2a3b1d){if(!_[_0xbd92('0x3e')](_0x2a3b1d)&&_0xbd92('0x91')===typeof _0x2a3b1d&&!_['isEmpty'](_0x2a3b1d)){if(!_[_0xbd92('0x3e')](_0xd65867)&&_0xbd92('0x91')===typeof _0xd65867&&!_[_0xbd92('0x49')](_0xd65867)){return util['format'](_0xbd92('0x92'),_0xd65867,_0x2a3b1d);}return util[_0xbd92('0x78')](_0xbd92('0x92'),_0x2a3b1d,_0x2a3b1d);}if(!_['isUndefined'](_0x42e5ff)&&_0xbd92('0x91')===typeof _0x42e5ff&&!_[_0xbd92('0x49')](_0x42e5ff)){return _0x42e5ff;}return _0xbd92('0x93');}function loggerCatchQueueSummary(_0x1b4b1c,_0x2494d8){return function(_0x37dec2){freeVariablesPredictive(_0x2494d8);emitVoiceQueueSummary(_0x2494d8);emitCampaignSummary(_0x2494d8);loggerSyncQueueSummary[_0xbd92('0x94')](_0x1b4b1c,util[_0xbd92('0x95')](_0x37dec2,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x598c02,_0x971542){return function(_0x204f82){loggerPredictive[_0xbd92('0x94')](_0x971542[_0xbd92('0x48')],_0x598c02);loggerPredictive[_0xbd92('0x94')](_0x204f82[_0xbd92('0x96')]);freeVariablesPredictive(_0x971542);};}function loggerCatch(_0x18945a){return function(_0x399fb2){logger[_0xbd92('0x94')](_0x18945a,util[_0xbd92('0x95')](_0x399fb2,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x5c7214){return _0x5c7214&&!_['isUndefined'](_0x5c7214)&&_0x5c7214[_0xbd92('0x97')]>0x0;}function decremetOriginate(_0x3ebf93){if(!_[_0xbd92('0x3e')](_0x3ebf93)&&_0x3ebf93!==null){if(_0x3ebf93[_0xbd92('0x98')](_0xbd92('0x6d'))){if(_0x3ebf93[_0xbd92('0x6d')]>0x0){_0x3ebf93[_0xbd92('0x6d')]-=0x1;}else{logger[_0xbd92('0x94')]('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0xbd92('0x94')](_0xbd92('0x99'));}}function checkContactLowerLimitOriginate(_0x2a4404,_0x3dcae1,_0x2ecbb7){if(_0x3dcae1>_0x2ecbb7){for(var _0x4d64e0=0x0;_0x4d64e0<_0x3dcae1-_0x2ecbb7;_0x4d64e0+=0x1){decremetOriginate(_0x2a4404);}}}function loggerGetContactDialer(_0x13ca79,_0x2d3819,_0x2c5f8b){return function(_0x510eef){checkContactLowerLimitOriginate(_0x2d3819,_0x2c5f8b,0x0);logger[_0xbd92('0x94')](_0x13ca79,util[_0xbd92('0x95')](_0x510eef,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x2593ea){return function(_0x13e34a){if(isNotNull(_0x13e34a)&&isNotNull(_0x13e34a[0x0])){if(_0x13e34a[0x0]['contactsRescheduled']>0x0){_0x2593ea[_0xbd92('0x3f')]=_0xbd92('0x9a');logger[_0xbd92('0x7a')](_0xbd92('0x9b')+_0x2593ea[_0xbd92('0x48')],_0x13e34a[0x0][_0xbd92('0x9c')],_0xbd92('0x9d'));}else{_0x2593ea[_0xbd92('0x3f')]=_0xbd92('0x9e');logger['info'](_0xbd92('0x9f')+_0x2593ea[_0xbd92('0x48')]);}}};}function notSendMessagesQueue(_0x322c8c){if(_0x322c8c[_0xbd92('0xa0')]){freeVariablesPredictive(_0x322c8c);if(_0x322c8c['originated']===0x0&&_0x322c8c[_0xbd92('0x55')]===0x0&&_0x322c8c[_0xbd92('0x58')]===0x0&&(_0x322c8c['pTalking']||0x0)===0x0){_0x322c8c[_0xbd92('0xa0')]=![];_0x322c8c[_0xbd92('0x51')]=0x0;_0x322c8c['message']=_0xbd92('0x42');loggerSyncQueueSummary[_0xbd92('0x94')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x322c8c[_0xbd92('0x48')],'is\x20not\x20active');}else{_0x322c8c[_0xbd92('0x3f')]='IS_DISACTIVED';loggerSyncQueueSummary[_0xbd92('0x94')](_0xbd92('0xa1'),_0x322c8c[_0xbd92('0x48')],_0xbd92('0xa2'));}emitVoiceQueueSummary(_0x322c8c);}}function notSendMessagesCampaign(_0x5a7a74){if(_0x5a7a74[_0xbd92('0xa0')]){if(_0x5a7a74[_0xbd92('0x6d')]===0x0){_0x5a7a74['sendMessageOneNotActive']=![];_0x5a7a74['message']=_0xbd92('0x42');loggerSyncQueueSummary[_0xbd92('0x94')](_0xbd92('0xa3'),_0x5a7a74[_0xbd92('0x48')],_0xbd92('0xa4'));}else{_0x5a7a74[_0xbd92('0x3f')]=_0xbd92('0xa5');loggerSyncQueueSummary[_0xbd92('0x94')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x5a7a74[_0xbd92('0x48')],'is\x20disactive');}emitCampaignSummary(_0x5a7a74);}}function createObjHistory(_0x37cec2,_0x528f15,_0x317fee,_0x184d29,_0x2926c6){_0x37cec2[_0xbd92('0x3f')]=_0x317fee;var _0x540bbd=new Action(_0x37cec2,_0x528f15);var _0x491269=new History(_0x540bbd);_0x491269['state']=_0x184d29;_0x491269[_0xbd92('0xa6')]=_0x2926c6;_0x491269[_0xbd92('0xa7')]=_0x540bbd[_0xbd92('0xa8')];return _0x491269;}Dialer[_0xbd92('0x1a')]['loopClearZombieChannels']=function(){var _0x535e77=this;setInterval(function(){_0x535e77[_0xbd92('0xa9')](_0x535e77['uniqueId'],_0xbd92('0xaa'));_0x535e77[_0xbd92('0xa9')](_0x535e77['actions'],_0xbd92('0xab'));},0x32c8);};Dialer[_0xbd92('0x1a')]['clearZombieChannels']=function(_0x4d83a9,_0x1b5073){var _0x71b56b=this;for(var _0x47b716 in _0x4d83a9){if(_0x4d83a9[_0xbd92('0x98')](_0x47b716)){this[_0xbd92('0xac')][_0xbd92('0xad')](function(){if(!_[_0xbd92('0xae')](_0x4d83a9[_0x47b716])){return ami['Action']({'action':_0xbd92('0xaf'),'channel':_0x4d83a9[_0x47b716]['channel']})['catch'](function(_0x2fc919){if(_0x2fc919[_0xbd92('0x3f')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x4d83a9[_0x47b716]&&_0x4d83a9[_0x47b716][_0xbd92('0x57')]!==_0xbd92('0x77')){_0x71b56b['updateOriginated'](_0x71b56b['voiceQueues'][_0x4d83a9[_0x47b716]['queue']]);logger[_0xbd92('0x94')](_0xbd92('0xb0'),_0x1b5073,_0x47b716,_0x4d83a9[_0x47b716][_0xbd92('0xb1')]);delete _0x4d83a9[_0x47b716];}if(_0x4d83a9[_0x47b716]&&_0x4d83a9[_0x47b716]['type']===_0xbd92('0x77')){_0x71b56b['updateOriginated'](_0x71b56b[_0xbd92('0x1e')][_0x4d83a9[_0x47b716][_0xbd92('0xb1')]]);logger[_0xbd92('0x94')](_0xbd92('0xb2'),_0x1b5073,_0x47b716,_0x4d83a9[_0x47b716]['queue']);delete _0x4d83a9[_0x47b716];}},0x2328);}});}});}}};Dialer['prototype'][_0xbd92('0xb3')]=function(_0x4ffc86){return BPromise['resolve']()['then'](cmHopper[_0xbd92('0xb3')](_0x4ffc86))[_0xbd92('0xb4')](loggerCatch(_0xbd92('0xb5')));};Dialer[_0xbd92('0x1a')]['checkIsBlackList']=function(_0x74adf4){return BPromise[_0xbd92('0xb6')]()[_0xbd92('0xb7')](cmHopperBlack[_0xbd92('0xb8')](_0x74adf4))[_0xbd92('0xb4')](loggerCatch(_0xbd92('0xb9')));};Dialer[_0xbd92('0x1a')]['checkIsBlackListIvr']=function(_0x3aed3f){return BPromise['resolve']()[_0xbd92('0xb7')](cmHopperBlack[_0xbd92('0xba')](_0x3aed3f))[_0xbd92('0xb4')](loggerCatch(_0xbd92('0xbb')));};Dialer[_0xbd92('0x1a')][_0xbd92('0xbc')]=function(_0x3fd2be){return BPromise[_0xbd92('0xb6')]()[_0xbd92('0xb7')](cmHopperHistory['avgHandleTime'](_0x3fd2be))['catch'](loggerCatch('[averageHandleTime]\x20'));};Dialer[_0xbd92('0x1a')][_0xbd92('0xbd')]=function(_0x6cfaa0){return BPromise[_0xbd92('0xb6')]()[_0xbd92('0xb7')](cmHopper['rescheduleContact'](_0x6cfaa0))[_0xbd92('0xb4')](loggerCatch(_0xbd92('0xbe')));};Dialer['prototype'][_0xbd92('0xbf')]=function(_0x384ca1,_0x444603,_0x3428ad){return BPromise[_0xbd92('0xb6')]()['then'](cmHopper[_0xbd92('0xbf')](_0x384ca1,_0x444603,_0x3428ad))[_0xbd92('0xb4')](loggerCatch(_0xbd92('0xc0')));};Dialer[_0xbd92('0x1a')][_0xbd92('0xc1')]=function(_0x14e141,_0x196ec6,_0x541929,_0x51e372){return BPromise[_0xbd92('0xb6')]()[_0xbd92('0xb7')](cmHopper[_0xbd92('0xc1')](_0x14e141,_0x196ec6,_0x541929,_0x51e372))['catch'](loggerCatch(_0xbd92('0xc2')));};Dialer[_0xbd92('0x1a')][_0xbd92('0xc3')]=function(_0x2ad713,_0x48d277,_0x5352a0){return BPromise[_0xbd92('0xb6')]()[_0xbd92('0xb7')](cmHopper[_0xbd92('0xc3')](_0x2ad713,_0x48d277,_0x5352a0))['catch'](loggerCatch(_0xbd92('0xc2')));};Dialer[_0xbd92('0x1a')][_0xbd92('0xc4')]=function(_0x54441e){return BPromise[_0xbd92('0xb6')]()[_0xbd92('0xb7')](voiceQueueRt[_0xbd92('0xc4')](_0x54441e))['catch'](loggerCatch(_0xbd92('0xc5')));};Dialer['prototype']['moveContactManagedDialer']=function(_0x1891e6){return BPromise[_0xbd92('0xb6')]()[_0xbd92('0xb7')](cmHopper['moveContactManagedDialer'](_0x1891e6))['catch'](loggerCatch(_0xbd92('0xc6')));};Dialer[_0xbd92('0x1a')]['createHistory']=function(_0x173994){return BPromise[_0xbd92('0xb6')]()[_0xbd92('0xb7')](cmHopperHistory['createHistory'](_0x173994))[_0xbd92('0xb4')](loggerCatch('[createHistory]\x20'));};Dialer[_0xbd92('0x1a')][_0xbd92('0xc7')]=function(_0x3c8a9f){if(!_[_0xbd92('0x3e')](_0x3c8a9f)&&_0x3c8a9f!==null){if(_0x3c8a9f[_0xbd92('0x98')](_0xbd92('0x6d'))){if(_0x3c8a9f[_0xbd92('0x6d')]>0x0){_0x3c8a9f[_0xbd92('0x6d')]-=0x1;}else{logger['error']('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0xbd92('0x94')](_0xbd92('0xc8'));}};Dialer[_0xbd92('0x1a')][_0xbd92('0xc9')]=function(_0x21a1de,_0x287e92){var _0x572cdb=this;return function(_0x54edd9){_0x572cdb['updateOriginated'](_0x287e92);logger['error'](_0x21a1de,util[_0xbd92('0x95')](_0x54edd9,{'showHidden':![],'depth':null}));};};Dialer[_0xbd92('0x1a')][_0xbd92('0xca')]=function(_0x1b40e9,_0x468352,_0x19c805){var _0x401b67={'state':0x19,'statedesc':_0xbd92('0xcb')};this[_0xbd92('0xc7')](_0x468352);this[_0xbd92('0xcc')](_['merge'](_0x401b67,_['pick'](_0x19c805,[_0xbd92('0xcd'),_0xbd92('0xce'),_0xbd92('0xcf'),_0xbd92('0xd0'),_0xbd92('0xd1')])),_0xbd92('0xd2'),'[emptyContact]');logger[_0xbd92('0x94')](_0x1b40e9);};Dialer['prototype'][_0xbd92('0xd3')]=function(_0x4c4cec){return _0x4c4cec==='Success';};Dialer['prototype']['isTrunkReachable']=function(_0x5f243d){return!_['isUndefined'](_0x5f243d)&&_0x5f243d&&!_['isUndefined'](_0x5f243d[_0xbd92('0x48')])&&!_['isUndefined'](_0x5f243d[_0xbd92('0x73')])&&_0x5f243d[_0xbd92('0x73')]&&(this[_0xbd92('0x20')][util['format'](_0xbd92('0xd4'),_0x5f243d[_0xbd92('0x48')])]['status']===_0xbd92('0xd5')||this[_0xbd92('0x20')][util[_0xbd92('0x78')](_0xbd92('0xd4'),_0x5f243d[_0xbd92('0x48')])][_0xbd92('0xaf')]===_0xbd92('0xd6'));};Dialer[_0xbd92('0x1a')][_0xbd92('0xcc')]=function(_0x55059c,_0x557e36,_0xe51bcb){this[_0xbd92('0xd7')](_0x55059c)[_0xbd92('0xb4')](loggerCatch(_0x557e36));this['moveContactManagedDialer'](_0x55059c)[_0xbd92('0xb4')](loggerCatch(_0xe51bcb));};Dialer[_0xbd92('0x1a')]['syncVarSet']=function(_0x530a9e){var _0x57165e=this['uniqueId'][_0x530a9e['uniqueid']];var _0xdb2d4e;if(!_['isNil'](_0x530a9e)&&!_[_0xbd92('0xae')](_0x530a9e[_0xbd92('0xd8')])&&!_[_0xbd92('0xae')](_0x530a9e[_0xbd92('0xd8')][_0xbd92('0xd9')])&&_0x530a9e[_0xbd92('0xda')]===_0xbd92('0xdb')&&_0x57165e){if(_0x57165e[_0xbd92('0x57')]!==_0xbd92('0x77')&&this[_0xbd92('0x1d')][_0x57165e[_0xbd92('0xb1')]][_0xbd92('0xdc')]&&_0x530a9e['value']===_0xbd92('0xdd')){delete this[_0xbd92('0x24')][_0x530a9e[_0xbd92('0xde')]];this['updateOriginated'](this['voiceQueues'][_0x57165e['queue']]);this[_0xbd92('0x1d')][_0x57165e['queue']]['outboundAnswerCallsDay']+=0x1;this['voiceQueues'][_0x57165e['queue']][_0xbd92('0x5e')]+=0x1;_0xdb2d4e=new Hangup(_0x57165e,_0x530a9e);_0xdb2d4e[_0xbd92('0xdf')]=0x12;_0xdb2d4e[_0xbd92('0xa6')]=_0xbd92('0xe0');_0xdb2d4e[_0xbd92('0xe1')]=_0xbd92('0xe2');this['saveInDb'](_0xdb2d4e,_0xbd92('0xe3'),'[syncHangupInAMD]');}if(_0x57165e[_0xbd92('0x57')]!==_0xbd92('0x77')&&this[_0xbd92('0x1d')][_0x57165e['queue']][_0xbd92('0xdc')]&&_0x530a9e[_0xbd92('0xe4')]===_0xbd92('0xe5')){delete this[_0xbd92('0x24')][_0x530a9e[_0xbd92('0xde')]];this[_0xbd92('0xc7')](this[_0xbd92('0x1d')][_0x57165e[_0xbd92('0xb1')]]);this['voiceQueues'][_0x57165e[_0xbd92('0xb1')]][_0xbd92('0x5f')]+=0x1;this[_0xbd92('0x1d')][_0x57165e[_0xbd92('0xb1')]][_0xbd92('0x5e')]+=0x1;_0xdb2d4e=new Hangup(_0x57165e,_0x530a9e);_0xdb2d4e['state']=0x13;_0xdb2d4e['statedesc']='Machine';_0xdb2d4e[_0xbd92('0xe1')]='AMD';_0xdb2d4e['amd']=!![];this[_0xbd92('0xcc')](_0xdb2d4e,'[syncMachine][createHistory]',_0xbd92('0xe6'));}if(_0x57165e[_0xbd92('0x57')]===_0xbd92('0x77')&&this[_0xbd92('0x1e')][_0x57165e[_0xbd92('0xb1')]][_0xbd92('0xdc')]&&_0x530a9e['value']===_0xbd92('0xdd')){delete this[_0xbd92('0x24')][_0x530a9e['uniqueid']];this[_0xbd92('0xc7')](this[_0xbd92('0x1e')][_0x57165e[_0xbd92('0xb1')]]);_0xdb2d4e=new Hangup(_0x57165e,_0x530a9e);_0xdb2d4e[_0xbd92('0xdf')]=0x12;_0xdb2d4e[_0xbd92('0xa6')]=_0xbd92('0xe0');_0xdb2d4e['membername']=_0xbd92('0xe2');this[_0xbd92('0xcc')](_0xdb2d4e,_0xbd92('0xe7'),_0xbd92('0xe8'));}if(_0x57165e[_0xbd92('0x57')]===_0xbd92('0x77')&&this[_0xbd92('0x1e')][_0x57165e['queue']][_0xbd92('0xdc')]&&_0x530a9e[_0xbd92('0xe4')]===_0xbd92('0xe5')){delete this['uniqueId'][_0x530a9e[_0xbd92('0xde')]];this[_0xbd92('0xc7')](this[_0xbd92('0x1e')][_0x57165e[_0xbd92('0xb1')]]);_0xdb2d4e=new Hangup(_0x57165e,_0x530a9e);_0xdb2d4e[_0xbd92('0xdf')]=0x13;_0xdb2d4e['statedesc']='Machine';_0xdb2d4e[_0xbd92('0xe1')]=_0xbd92('0xe2');_0xdb2d4e['amd']=!![];this[_0xbd92('0xcc')](_0xdb2d4e,_0xbd92('0xe9'),'[syncMachineIvr]');}}};Dialer[_0xbd92('0x1a')][_0xbd92('0x33')]=function(_0x4c9d45){var _0x7a3ed7=this[_0xbd92('0x24')][_0x4c9d45[_0xbd92('0xde')]];var _0x74b886=this;var _0x15d9bb;if(_0x7a3ed7&&_0x7a3ed7[_0xbd92('0x57')]===_0xbd92('0x77')){delete this[_0xbd92('0x24')][_0x4c9d45[_0xbd92('0xde')]];this[_0xbd92('0xc7')](this[_0xbd92('0x1e')][_0x7a3ed7[_0xbd92('0xb1')]]);this[_0xbd92('0x1e')][_0x7a3ed7[_0xbd92('0xb1')]]['ivrAnswerCallsDay']+=0x1;_0x15d9bb=new Hangup(_0x7a3ed7,_0x4c9d45);this['createHistory'](_0x15d9bb)[_0xbd92('0xb4')](loggerCatch(_0xbd92('0xea')));this[_0xbd92('0xeb')](_0x15d9bb)['catch'](loggerCatch('[syncHangupIvr]'));}if(_0x7a3ed7&&_0x7a3ed7[_0xbd92('0x57')]!=='ivr'&&isNotNull(this[_0xbd92('0x1d')][_0x7a3ed7['queue']][_0xbd92('0xec')])){delete this[_0xbd92('0x24')][_0x4c9d45[_0xbd92('0xde')]];this[_0xbd92('0xc7')](this[_0xbd92('0x1d')][_0x7a3ed7[_0xbd92('0xb1')]]);this['voiceQueues'][_0x7a3ed7[_0xbd92('0xb1')]][_0xbd92('0x5f')]+=0x1;this[_0xbd92('0x1d')][_0x7a3ed7[_0xbd92('0xb1')]][_0xbd92('0x5e')]+=0x1;_0x15d9bb=new Hangup(_0x7a3ed7,_0x4c9d45);_0x15d9bb[_0xbd92('0xdf')]=0x10;_0x15d9bb[_0xbd92('0xa6')]=_0xbd92('0xed');_0x15d9bb[_0xbd92('0xe1')]='AGI';this[_0xbd92('0xd7')](_0x15d9bb)[_0xbd92('0xb4')](loggerCatch(_0xbd92('0xea')));this[_0xbd92('0xeb')](_0x15d9bb)[_0xbd92('0xb4')](loggerCatch(_0xbd92('0xee')));}if(_0x7a3ed7&&_0x7a3ed7[_0xbd92('0x57')]!==_0xbd92('0x77')&&!isNotNull(this[_0xbd92('0x1d')][_0x7a3ed7[_0xbd92('0xb1')]][_0xbd92('0xec')])){delete this[_0xbd92('0x24')][_0x4c9d45[_0xbd92('0xde')]];this[_0xbd92('0xc7')](this[_0xbd92('0x1d')][_0x7a3ed7[_0xbd92('0xb1')]]);this[_0xbd92('0x1d')][_0x7a3ed7['queue']][_0xbd92('0x67')]+=0x1;_0x15d9bb=new Hangup(_0x7a3ed7,_0x4c9d45);_0x15d9bb['state']=0xc;_0x15d9bb[_0xbd92('0xa6')]=_0x4c9d45['cause-txt'];_0x15d9bb['membername']=_0xbd92('0xef');this[_0xbd92('0xd7')](_0x15d9bb)['catch'](loggerCatch(_0xbd92('0xea')));this[_0xbd92('0xeb')](_0x15d9bb)[_0xbd92('0xb4')](loggerCatch(_0xbd92('0xee')));}};Dialer[_0xbd92('0x1a')][_0xbd92('0x30')]=function(_0x291dfc){var _0x4fdb53=this['uniqueId'][_0x291dfc['uniqueid']];var _0x459dd0=this;if(this[_0xbd92('0x1d')][_0x291dfc['queue']]){if(_0x4fdb53&&_0x4fdb53[_0xbd92('0x57')]!=='ivr'){delete this['uniqueId'][_0x291dfc['uniqueid']];this['voiceQueues'][_0x291dfc[_0xbd92('0xb1')]]['outboundAnswerCallsDay']+=0x1;var _0x57cb0a=new AgentComplete(_0x4fdb53,_0x291dfc);if(_0x291dfc['reason']===_0xbd92('0xf0')){_0x57cb0a[_0xbd92('0xf1')]=this[_0xbd92('0x1d')][_0x291dfc[_0xbd92('0xb1')]][_0xbd92('0xf2')]&&this['voiceQueues'][_0x291dfc[_0xbd92('0xb1')]][_0xbd92('0xf3')]?moment()[_0xbd92('0x78')](_0xbd92('0xf4')):undefined;}this[_0xbd92('0xd7')](_0x57cb0a)[_0xbd92('0xb4')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0xbd92('0xeb')](_0x57cb0a)[_0xbd92('0xb4')](loggerCatch(_0xbd92('0xf5')));}}};Dialer['prototype']['syncAgentConnect']=function(_0x23a625){if(this[_0xbd92('0x1d')][_0x23a625[_0xbd92('0xb1')]]){if(this[_0xbd92('0x24')][_0x23a625[_0xbd92('0xde')]]&&this[_0xbd92('0x24')][_0x23a625[_0xbd92('0xde')]][_0xbd92('0x57')]!==_0xbd92('0x77')){this[_0xbd92('0xc7')](this[_0xbd92('0x1d')][_0x23a625['queue']]);this[_0xbd92('0x24')][_0x23a625[_0xbd92('0xde')]]['answertime']=moment()[_0xbd92('0x78')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer[_0xbd92('0x1a')][_0xbd92('0xf6')]=function(_0x1dd7ff){this['createHistory'](_0x1dd7ff)[_0xbd92('0xb4')](loggerCatch(_0xbd92('0xf7')));this[_0xbd92('0xeb')](_0x1dd7ff)[_0xbd92('0xb4')](loggerCatch(_0xbd92('0xf8')));};Dialer[_0xbd92('0x1a')][_0xbd92('0x2d')]=function(_0x1c2227){var _0x413f1a=this[_0xbd92('0x24')][_0x1c2227[_0xbd92('0xde')]];var _0x2462fb=this;if(this['voiceQueues'][_0x1c2227[_0xbd92('0xb1')]]){if(_0x413f1a&&_0x413f1a[_0xbd92('0x57')]!==_0xbd92('0x77')){delete this[_0xbd92('0x24')][_0x1c2227[_0xbd92('0xde')]];this[_0xbd92('0xc7')](this[_0xbd92('0x1d')][_0x1c2227['queue']]);_0x413f1a['droptime']=moment()[_0xbd92('0x78')](_0xbd92('0xf4'));var _0x30b7b9=new QueueCallerAbandon(_0x413f1a,_0x1c2227);if(getSeconds(_0x413f1a['droptime'],_0x413f1a[_0xbd92('0xf9')])>=_0x413f1a['dialQueueTimeout']){this['voiceQueues'][_0x1c2227[_0xbd92('0xb1')]][_0xbd92('0xfa')]+=0x1;this[_0xbd92('0x1d')][_0x1c2227['queue']][_0xbd92('0x64')]+=0x1;this[_0xbd92('0x1d')][_0x1c2227[_0xbd92('0xb1')]][_0xbd92('0xfb')]+=0x1;_0x30b7b9['state']=0xa;_0x30b7b9[_0xbd92('0xa6')]=_0xbd92('0xfc');_0x30b7b9['dropreason']=_0xbd92('0xfd');_0x30b7b9[_0xbd92('0xf1')]=this[_0xbd92('0x1d')][_0x1c2227['queue']][_0xbd92('0xf2')]?moment()[_0xbd92('0x78')](_0xbd92('0xf4')):undefined;if(_0x30b7b9[_0xbd92('0xfe')]>=this[_0xbd92('0x1d')][_0x1c2227[_0xbd92('0xb1')]][_0xbd92('0xff')]){this[_0xbd92('0xf6')](_0x30b7b9);}else{this['rescheduleContact']({'active':![],'countdropretry':_0x30b7b9['countdropretry']+=0x1,'scheduledat':moment()[_0xbd92('0x100')](this[_0xbd92('0x1d')][_0x1c2227[_0xbd92('0xb1')]][_0xbd92('0x101')],_0xbd92('0x102'))[_0xbd92('0x78')](_0xbd92('0xf4')),'ContactId':_0x413f1a[_0xbd92('0xcd')],'ListId':_0x413f1a[_0xbd92('0xce')],'VoiceQueueId':_0x413f1a[_0xbd92('0xd0')]||undefined,'CampaignId':_0x413f1a[_0xbd92('0xd1')]||undefined})['catch'](loggerCatch(_0xbd92('0x103')));}}else{this[_0xbd92('0x1d')][_0x1c2227['queue']][_0xbd92('0x7f')]+=0x1;this['voiceQueues'][_0x1c2227[_0xbd92('0xb1')]]['outboundDropCallsDayCallersExit']+=0x1;_0x30b7b9['state']=0xb;_0x30b7b9[_0xbd92('0xa6')]=_0xbd92('0x104');_0x30b7b9[_0xbd92('0x105')]=_0xbd92('0x106');if(_0x30b7b9[_0xbd92('0x107')]>=this[_0xbd92('0x1d')][_0x1c2227['queue']][_0xbd92('0x108')]){this['queueCallerAbandonCreateState'](_0x30b7b9);}else{this['rescheduleContact']({'active':![],'countabandonedretry':_0x30b7b9[_0xbd92('0x107')]+=0x1,'scheduledat':moment()[_0xbd92('0x100')](this[_0xbd92('0x1d')][_0x1c2227[_0xbd92('0xb1')]]['dialAbandonedRetryFrequency'],'minutes')[_0xbd92('0x78')](_0xbd92('0xf4')),'ContactId':_0x413f1a[_0xbd92('0xcd')],'ListId':_0x413f1a['ListId'],'VoiceQueueId':_0x413f1a['VoiceQueueId']||undefined,'CampaignId':_0x413f1a[_0xbd92('0xd1')]||undefined})[_0xbd92('0xb4')](loggerCatch(_0xbd92('0x109')));}}}}};Dialer[_0xbd92('0x1a')][_0xbd92('0x35')]=function(_0x3a22ca){if(this[_0xbd92('0x22')][_0x3a22ca[_0xbd92('0xde')]]){this[_0xbd92('0x22')][_0x3a22ca[_0xbd92('0xde')]][_0xbd92('0x10a')]=_0x3a22ca[_0xbd92('0x10a')];}if(this[_0xbd92('0x24')][_0x3a22ca[_0xbd92('0xde')]]){this['uniqueId'][_0x3a22ca[_0xbd92('0xde')]][_0xbd92('0x10a')]=_0x3a22ca[_0xbd92('0x10a')];}};Dialer['prototype'][_0xbd92('0x39')]=function(_0x343026){if(strategy[this[_0xbd92('0x1d')][this[_0xbd92('0x22')][_0x343026[_0xbd92('0x10b')]][_0xbd92('0xb1')]][_0xbd92('0x10c')]]===_0xbd92('0x19')){if(this[_0xbd92('0x22')][_0x343026[_0xbd92('0x10b')]]&&_['isNil'](this[_0xbd92('0x22')][_0x343026[_0xbd92('0x10b')]][_0xbd92('0x10d')])&&_0x343026[_0xbd92('0xaf')]==='1'&&_0x343026[_0xbd92('0x10e')]==='0'){if(this['agents'][_0x343026[_0xbd92('0x10f')]]){if(!this[_0xbd92('0x1f')][_0x343026[_0xbd92('0x10f')]][_0xbd92('0x10d')]){this['agents'][_0x343026['stateinterface']][_0xbd92('0x10d')]=!![];this[_0xbd92('0x22')][_0x343026[_0xbd92('0x10b')]][_0xbd92('0x10d')]=!![];this[_0xbd92('0x22')][_0x343026[_0xbd92('0x10b')]][_0xbd92('0x10f')]=_0x343026[_0xbd92('0x10f')];}}}}else if((strategy[this[_0xbd92('0x1d')][this['actions'][_0x343026[_0xbd92('0x10b')]][_0xbd92('0xb1')]][_0xbd92('0x10c')]]||_0xbd92('0x18'))===_0xbd92('0x18')){if(this[_0xbd92('0x22')][_0x343026[_0xbd92('0x10b')]]){if(this[_0xbd92('0x1f')][_0x343026[_0xbd92('0x10f')]]){this[_0xbd92('0x22')][_0x343026[_0xbd92('0x10b')]][_0xbd92('0x10f')]=_0x343026[_0xbd92('0x10f')];if(_[_0xbd92('0xae')](this[_0xbd92('0x29')][this[_0xbd92('0x22')][_0x343026[_0xbd92('0x10b')]][_0xbd92('0xb1')]])){this[_0xbd92('0x29')][this[_0xbd92('0x22')][_0x343026['actionid']][_0xbd92('0xb1')]]=[];}this['queueBooked'][this[_0xbd92('0x22')][_0x343026[_0xbd92('0x10b')]][_0xbd92('0xb1')]][_0xbd92('0x110')](_['merge'](_['pick'](this[_0xbd92('0x22')][_0x343026[_0xbd92('0x10b')]],['idHopper',_0xbd92('0x10f')]),{'status':_0x343026[_0xbd92('0xaf')],'paused':_0x343026['paused']}));}}}};function unlockQueueStatus(_0x980a96,_0x38a5cb){setTimeout(function(){if(_[_0xbd92('0x3e')](_0x980a96[_0xbd92('0x111')])){loggerBooked[_0xbd92('0x94')](_0xbd92('0x112'),_0x38a5cb);}_0x980a96[_0xbd92('0x111')]=!![];loggerBooked[_0xbd92('0x7a')](_0xbd92('0x113'),_0x38a5cb,JSON[_0xbd92('0x4b')](_[_0xbd92('0x114')](_0x980a96,['name',_0xbd92('0x111')])));},0x1f3);}Dialer[_0xbd92('0x1a')]['syncQueueStatusComplete']=function(_0x51aa8f){var _0xb677f8=this;var _0x57c5a1=_0xb677f8['voiceQueues'][_0xb677f8[_0xbd92('0x22')][_0x51aa8f[_0xbd92('0x10b')]][_0xbd92('0xb1')]];if(strategy[this[_0xbd92('0x1d')][this[_0xbd92('0x22')][_0x51aa8f[_0xbd92('0x10b')]]['queue']][_0xbd92('0x10c')]]==='roundrobin'){if(this['actions'][_0x51aa8f[_0xbd92('0x10b')]]&&this[_0xbd92('0x22')][_0x51aa8f[_0xbd92('0x10b')]]['stateinterface']){this['preview'][_0xbd92('0x115')](this[_0xbd92('0x22')][_0x51aa8f[_0xbd92('0x10b')]][_0xbd92('0x116')],this['actions'][_0x51aa8f['actionid']]['stateinterface'])[_0xbd92('0xb4')](function(_0x589db4){logger[_0xbd92('0x94')]('[Catch][Preview][syncQueueStatusComplete]',util[_0xbd92('0x95')](_0x589db4,{'showHidden':![],'depth':null}));})[_0xbd92('0x117')](function(){_0xb677f8[_0xbd92('0xc7')](_0xb677f8[_0xbd92('0x1d')][_0xb677f8['actions'][_0x51aa8f[_0xbd92('0x10b')]]['queue']]);_0xb677f8[_0xbd92('0x1f')][_0xb677f8[_0xbd92('0x22')][_0x51aa8f[_0xbd92('0x10b')]][_0xbd92('0x10f')]][_0xbd92('0x10d')]=![];delete _0xb677f8[_0xbd92('0x22')][_0x51aa8f['actionid']];unlockQueueStatus(_0x57c5a1);});}else{this[_0xbd92('0xc7')](this[_0xbd92('0x1d')][this['actions'][_0x51aa8f[_0xbd92('0x10b')]][_0xbd92('0xb1')]]);this[_0xbd92('0xbd')]({'active':![],'ContactId':this['actions'][_0x51aa8f[_0xbd92('0x10b')]]['ContactId'],'ListId':this[_0xbd92('0x22')][_0x51aa8f[_0xbd92('0x10b')]][_0xbd92('0xce')],'VoiceQueueId':this['actions'][_0x51aa8f[_0xbd92('0x10b')]][_0xbd92('0xd0')]||undefined,'CampaignId':this[_0xbd92('0x22')][_0x51aa8f[_0xbd92('0x10b')]]['CampaignId']||undefined})['catch'](loggerCatch(_0xbd92('0x118')));delete this[_0xbd92('0x22')][_0x51aa8f[_0xbd92('0x10b')]];unlockQueueStatus(_0x57c5a1);}}else if((strategy[this[_0xbd92('0x1d')][this[_0xbd92('0x22')][_0x51aa8f['actionid']][_0xbd92('0xb1')]][_0xbd92('0x10c')]]||_0xbd92('0x18'))===_0xbd92('0x18')){var _0x30c9cb;if(this['actions'][_0x51aa8f[_0xbd92('0x10b')]]&&!_[_0xbd92('0x49')](this[_0xbd92('0x29')][this[_0xbd92('0x22')][_0x51aa8f['actionid']][_0xbd92('0xb1')]])){if(this[_0xbd92('0x2a')][_0xb677f8[_0xbd92('0x22')][_0x51aa8f[_0xbd92('0x10b')]][_0xbd92('0xb1')]]){this['queueBookedRR'][_0xb677f8[_0xbd92('0x22')][_0x51aa8f[_0xbd92('0x10b')]]['queue']]=this[_0xbd92('0x2a')][this['actions'][_0x51aa8f[_0xbd92('0x10b')]][_0xbd92('0xb1')]]?this[_0xbd92('0x2a')][this[_0xbd92('0x22')][_0x51aa8f[_0xbd92('0x10b')]][_0xbd92('0xb1')]]:this[_0xbd92('0x29')][this[_0xbd92('0x22')][_0x51aa8f[_0xbd92('0x10b')]][_0xbd92('0xb1')]]?this[_0xbd92('0x29')][this['actions'][_0x51aa8f[_0xbd92('0x10b')]][_0xbd92('0xb1')]][_0xbd92('0x119')]||0x0:0x0;}this[_0xbd92('0x29')][this[_0xbd92('0x22')][_0x51aa8f[_0xbd92('0x10b')]]['queue']][_0xbd92('0x119')]=this[_0xbd92('0x2a')][this[_0xbd92('0x22')][_0x51aa8f[_0xbd92('0x10b')]][_0xbd92('0xb1')]];for(var _0x13538e=0x0;_0x13538e=0x0?!![]:![];})[_0xbd92('0xb4')](myreject(_0x323ed0)));}}else{_0x472517[_0xbd92('0x110')](ami['Action']({'action':_0xbd92('0x131'),'command':util['format'](_0xbd92('0x132'),_0xdad01c,!_[_0xbd92('0x3e')](config[_0xbd92('0x134')][_0x26c9e6])?_0x26c9e6:'')})[_0xbd92('0xb7')](function(_0x25c815){return _0x25c815[_0xbd92('0x135')]['indexOf']('true')>=0x0?!![]:![];})[_0xbd92('0xb4')](myreject(_0x323ed0)));}BPromise[_0xbd92('0x138')](_0x472517)[_0xbd92('0xb7')](function(_0x358123){var _0x43b119=_[_0xbd92('0x139')](_0x358123);if(_0x43b119){return _0x15da91(_0x43b119);}else{_0x3182a8[_0xbd92('0x3f')]=_0x4f5fac?'GLOBAL_INTERVAL_IS_OVERTIME':_0xbd92('0x13a');return _0x323ed0(msgResponse('[ifTime][promiseAll]',_0xbd92('0x12b'),_0xbd92('0x13b')+_0x4f5fac+'\x20'+_0x37271b+_0xbd92('0x13c')+util[_0xbd92('0x95')](_0xdad01c,{'showHidden':![],'depth':null})+_0xbd92('0x13d')+_0x26c9e6));}})[_0xbd92('0xb4')](function(_0x4c12ff){return _0x323ed0(msgResponse('ifTime',_0xbd92('0x12b'),JSON[_0xbd92('0x4b')](_0x4c12ff)));});});};Dialer[_0xbd92('0x1a')][_0xbd92('0x13e')]=function(_0x3edc9b){var _0x12563c=this;return function(){switch(_0x3edc9b[_0xbd92('0x5a')]){case _0xbd92('0x13f'):freeVariablesPredictive(_0x3edc9b);_0x12563c[_0xbd92('0x140')](_0x3edc9b,0x1);break;case'power':freeVariablesPredictive(_0x3edc9b);_0x12563c[_0xbd92('0x140')](_0x3edc9b,_0x3edc9b[_0xbd92('0x141')]);break;case _0xbd92('0x142'):_0x12563c[_0xbd92('0x142')](_0x3edc9b);break;case _0xbd92('0x8'):freeVariablesPredictive(_0x3edc9b);_0x12563c[_0xbd92('0x140')](_0x3edc9b,0x1);break;default:freeVariablesPredictive(_0x3edc9b);logger[_0xbd92('0x94')](_0xbd92('0x143'),_0x3edc9b['name'],_0xbd92('0x144'));}};};Dialer[_0xbd92('0x1a')][_0xbd92('0x145')]=function(_0x24b057){var _0x32b269=this;return function(){_0x32b269[_0xbd92('0x146')](_0x24b057);};};Dialer['prototype'][_0xbd92('0xa')]=function(_0x4bf009){var _0x37a399=this;if(isNotPreview(_0x4bf009['dialMethod'])){if(isVoiceQueueOutbound(_0x4bf009[_0xbd92('0x57')])&&isActive(_0x4bf009[_0xbd92('0x147')])){_0x4bf009[_0xbd92('0xa0')]=!![];BPromise[_0xbd92('0xb6')]()[_0xbd92('0xb7')](checkIsLoggedIn(_0x4bf009,_0x4bf009[_0xbd92('0x148')]))[_0xbd92('0xb7')](checkIsActive(_0x4bf009,_0x4bf009['dialActive']))[_0xbd92('0xb7')](checkInterval(_0x4bf009))[_0xbd92('0xb7')](_0x37a399[_0xbd92('0x149')](_0x4bf009))[_0xbd92('0xb7')](_0x37a399[_0xbd92('0x127')](_0x4bf009[_0xbd92('0x14a')],_0x4bf009[_0xbd92('0x14b')],_0x4bf009['name'],_0x4bf009))['then'](_0x37a399[_0xbd92('0x14c')](_0x4bf009[_0xbd92('0x44')],_0x4bf009[_0xbd92('0x14b')],_0x4bf009['name'],_0x4bf009))['then'](_0x37a399[_0xbd92('0x13e')](_0x4bf009))['catch'](loggerCatchQueueSummary('[syncQueueSummary]',_0x4bf009));}else{notSendMessagesQueue(_0x4bf009);}}else{freeVariablesPredictive(_0x4bf009);}};Dialer[_0xbd92('0x1a')][_0xbd92('0x123')]=function(){var _0x1554fb=this;var _0x33be62;for(var _0x483f67 in this[_0xbd92('0x1e')]){if(this[_0xbd92('0x1e')][_0xbd92('0x98')](_0x483f67)){_0x33be62=this[_0xbd92('0x1e')][_0x483f67];if(isCampaignIvr(_0x33be62[_0xbd92('0x57')])&&isActive(_0x33be62['active'])){_0x33be62[_0xbd92('0xa0')]=!![];BPromise[_0xbd92('0xb6')]()[_0xbd92('0xb7')](checkIsActive(_0x33be62,_0x33be62['active']))['then'](checkInterval(_0x33be62))['then'](_0x1554fb['checkIsTrunkReachable'](_0x33be62))[_0xbd92('0xb7')](_0x1554fb[_0xbd92('0x127')](_0x33be62['dialGlobalInterval'],_0x33be62[_0xbd92('0x14b')],_0x33be62['name'],_0x33be62))[_0xbd92('0xb7')](_0x1554fb[_0xbd92('0x14c')](_0x33be62[_0xbd92('0x44')],_0x33be62[_0xbd92('0x14b')],_0x33be62[_0xbd92('0x48')],_0x33be62))[_0xbd92('0xb7')](_0x1554fb[_0xbd92('0x145')](_0x33be62))[_0xbd92('0xb4')](loggerCatchQueueSummary('[syncCampaigns]',_0x33be62));}else{notSendMessagesCampaign(_0x33be62);}}}};function getCallerIdRandom(_0x4c053c,_0x55422c){var _0x71feb1,_0x1a0c82,_0x50751f;if(_0x55422c<=0x0){_0x55422c=0x1;}_0x71feb1=new RegExp('\x5cw{0,'+_0x55422c+'}$');_0x1a0c82=Math[_0xbd92('0x14d')](0xa,_0x55422c-0x1);_0x50751f=Math['pow'](0xa,_0x55422c)-0x1;return util[_0xbd92('0x78')]('%s',_['replace'](_0x4c053c,_0x71feb1,_[_0xbd92('0x14e')](_0x1a0c82,_0x50751f)));}function extractCalleridName(_0x2444bf){var _0x3175b1=_0x2444bf[_0xbd92('0x14f')](/"(.*?)"/);return _0x3175b1?_0x3175b1[0x1]:_0x2444bf;}function extractCalleridNumber(_0xa0a9b8){var _0x2131df=_0xa0a9b8[_0xbd92('0x14f')](/<(.*?)>/);return _0x2131df?_0x2131df[0x1]:_0xa0a9b8;}Dialer[_0xbd92('0x1a')][_0xbd92('0x150')]=function(_0x440a7c,_0x18549e){var _0x2ca1d5=this;var _0x5059bc=uuid['v4']();this[_0xbd92('0x22')][_0x5059bc]=new Action(_0x440a7c,_0x18549e,_0x5059bc);return new BPromise(function(_0x11edfb,_0x4c400b){if(_[_0xbd92('0x3e')](_0x440a7c)&&'object'!==typeof _0x440a7c){return _0x4c400b(msgResponse(_0xbd92('0x151'),_0xbd92('0x12b'),'voiceQueue\x20is\x20undefine'));}if(_['isUndefined'](_0x18549e[_0xbd92('0x152')][_0xbd92('0x153')])||_0x18549e[_0xbd92('0x152')]['phone']===null){return _0x4c400b(msgResponse(_0xbd92('0x151'),_0xbd92('0x12b'),_0xbd92('0x154')));}var _0x5bc5cf={'XMD-CALLERID':_0x2ca1d5[_0xbd92('0x22')][_0x5059bc][_0xbd92('0x155')](),'XMD-AGI':_0x440a7c[_0xbd92('0xec')]?util[_0xbd92('0x78')]('\x22agi://%s/square,%s\x22',ipAgi,_0x440a7c[_0xbd92('0xec')]):'NONE','XMD-AGIAFTER':_0x440a7c[_0xbd92('0xf2')]?util[_0xbd92('0x78')](_0xbd92('0x156'),ipAgi,_0x440a7c[_0xbd92('0xf2')]):_0xbd92('0x157'),'XMD-QUEUE':_0x440a7c[_0xbd92('0x57')]==='outbound'?util[_0xbd92('0x78')](_0xbd92('0x158'),_0x440a7c[_0xbd92('0x48')],_0x440a7c['dialQueueOptions']||'',_0x440a7c[_0xbd92('0xf3')]?'c':'',_0x440a7c[_0xbd92('0x159')]||0x3):_0xbd92('0x157'),'XMD-CONTACTID':_0x18549e['ContactId'],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x2ca1d5[_0xbd92('0x22')][_0x5059bc][_0xbd92('0x155')](),'XMD-AMD':_0x440a7c[_0xbd92('0xdc')]?_0xbd92('0x15a'):_0xbd92('0x157'),'XMD-DESTINATION':_0xbd92('0xdb')};if(_0x440a7c['dialAMDActive']){_0x5bc5cf[_0xbd92('0x15b')]=_0x440a7c[_0xbd92('0x15c')]||0x9c4;_0x5bc5cf[_0xbd92('0x15d')]=_0x440a7c[_0xbd92('0x15e')]||0x5dc;_0x5bc5cf[_0xbd92('0x15f')]=_0x440a7c[_0xbd92('0x160')]||0x320;_0x5bc5cf[_0xbd92('0x161')]=_0x440a7c[_0xbd92('0x162')]||0x1388;_0x5bc5cf[_0xbd92('0x163')]=_0x440a7c[_0xbd92('0x164')]||0x64;_0x5bc5cf[_0xbd92('0x165')]=_0x440a7c[_0xbd92('0x166')]||0x32;_0x5bc5cf[_0xbd92('0x167')]=_0x440a7c[_0xbd92('0x168')]||0x3;_0x5bc5cf[_0xbd92('0x169')]=_0x440a7c[_0xbd92('0x16a')]||0x100;_0x5bc5cf[_0xbd92('0x16b')]=_0x440a7c[_0xbd92('0x16c')]||0x1388;}if(_0x440a7c[_0xbd92('0x57')]===_0xbd92('0x4f')){_0x5bc5cf[_0xbd92('0x16d')]=_0x18549e[_0xbd92('0xd0')];}else{_0x5bc5cf[_0xbd92('0x16e')]=_0x18549e['CampaignId'];}for(var _0x2dfa8c in _0x18549e[_0xbd92('0x152')]){if(_0x18549e[_0xbd92('0x152')][_0xbd92('0x98')](_0x2dfa8c)){if(isNotNull(_0x18549e[_0xbd92('0x152')][_0x2dfa8c])&&_0x2dfa8c!=='id'&&_0x2dfa8c!==_0xbd92('0x16f')&&_0x2dfa8c!==_0xbd92('0x170')&&_0x2dfa8c!==_0xbd92('0x171')){_0x5bc5cf[util['format'](_0xbd92('0x172'),_0xbd92('0x173'),_[_0xbd92('0x174')](_0x2dfa8c))]=_0x18549e[_0xbd92('0x152')][_0x2dfa8c];}}}var _0xeda24c=_0x2ca1d5[_0xbd92('0x124')](_0x440a7c[_0xbd92('0x72')])?getCallerId(_0x440a7c[_0xbd92('0x72')][_0xbd92('0x74')],_0x440a7c['dialOriginateCallerIdName'],_0x440a7c[_0xbd92('0x175')]>0x0?getCallerIdRandom(_0x440a7c['dialOriginateCallerIdNumber'],_0x440a7c[_0xbd92('0x175')]):_0x440a7c[_0xbd92('0x5c')]):getCallerId(_['isNil'](_0x440a7c[_0xbd92('0x125')])?_0x440a7c[_0xbd92('0x72')]['callerid']:_0x440a7c[_0xbd92('0x125')][_0xbd92('0x74')],_0x440a7c[_0xbd92('0x5b')],_0x440a7c[_0xbd92('0x175')]>0x0?getCallerIdRandom(_0x440a7c[_0xbd92('0x5c')],_0x440a7c[_0xbd92('0x175')]):_0x440a7c[_0xbd92('0x5c')]);if(_0xeda24c){_0x5bc5cf[_0xbd92('0x176')]=_0x2ca1d5[_0xbd92('0x22')][_0x5059bc]['originatecalleridname']=extractCalleridName(_0xeda24c);_0x5bc5cf[_0xbd92('0x177')]=_0x2ca1d5[_0xbd92('0x22')][_0x5059bc][_0xbd92('0x178')]=extractCalleridNumber(_0xeda24c);}return ami[_0xbd92('0x130')]({'actionid':_0x5059bc,'action':_0xbd92('0x151'),'channel':_0x2ca1d5[_0xbd92('0x124')](_0x440a7c[_0xbd92('0x72')])?util[_0xbd92('0x78')](_0xbd92('0x179'),_0x440a7c['Trunk'][_0xbd92('0x48')],isNotNull(_0x440a7c[_0xbd92('0x5d')])?_0x440a7c[_0xbd92('0x5d')]['trim']()||'':'',_0x440a7c[_0xbd92('0x17a')]>0x0?_0x18549e[_0xbd92('0x152')][_0xbd92('0x153')][_0xbd92('0x17b')](_0x440a7c[_0xbd92('0x17a')]):_0x18549e[_0xbd92('0x152')]['phone']):util[_0xbd92('0x78')](_0xbd92('0x179'),_[_0xbd92('0xae')](_0x440a7c[_0xbd92('0x125')])?_0x440a7c[_0xbd92('0x72')][_0xbd92('0x48')]:_0x440a7c[_0xbd92('0x125')]['name'],isNotNull(_0x440a7c[_0xbd92('0x5d')])?_0x440a7c[_0xbd92('0x5d')][_0xbd92('0x17c')]()||'':'',_0x440a7c[_0xbd92('0x17a')]>0x0?_0x18549e['Contact']['phone']['substring'](_0x440a7c[_0xbd92('0x17a')]):_0x18549e[_0xbd92('0x152')][_0xbd92('0x153')]),'callerid':_0xeda24c,'Exten':_0xbd92('0xdb'),'Context':_0xbd92('0x17d'),'Priority':'1','variable':_0x5bc5cf,'timeout':(_0x440a7c[_0xbd92('0x17e')]||0x1e)*0x3e8,'async':!![],'channelid':_0x5059bc})['then'](function(_0x281a4e){return _0x11edfb(_0x281a4e);})[_0xbd92('0xb4')](function(_0x22f96a){_0x440a7c[_0xbd92('0x17f')]+=0x1;var _0x4e6d2a=new History(_0x2ca1d5[_0xbd92('0x22')][_0x5059bc]);logger['error'](util[_0xbd92('0x78')](_0xbd92('0x180'),JSON[_0xbd92('0x4b')](_0x22f96a)));_0x4e6d2a[_0xbd92('0xdf')]=0xe;_0x4e6d2a[_0xbd92('0xa6')]=_0xbd92('0x181');_0x4e6d2a[_0xbd92('0xa8')]=moment()[_0xbd92('0x78')](_0xbd92('0xf4'));_0x4e6d2a[_0xbd92('0xa7')]=_0x4e6d2a[_0xbd92('0xa8')];_0x2ca1d5[_0xbd92('0xd7')](_0x4e6d2a)[_0xbd92('0xb4')](loggerCatch(_0xbd92('0x182')));_0x2ca1d5[_0xbd92('0xeb')](_0x4e6d2a)[_0xbd92('0xb4')](loggerCatch(_0xbd92('0x182')))[_0xbd92('0x117')](function(){delete _0x2ca1d5[_0xbd92('0x22')][_0x5059bc];return _0x4c400b(msgResponse(_0xbd92('0x151'),_0xbd92('0x183'),_0xbd92('0x184')));});});});};Dialer[_0xbd92('0x1a')][_0xbd92('0x2e')]=function(_0x267ed5){var _0x52d366=this[_0xbd92('0x22')][_0x267ed5[_0xbd92('0x10b')]];var _0x2d6cf5=this;if(_0x52d366){delete this[_0xbd92('0x22')][_0x267ed5[_0xbd92('0x10b')]];_0x52d366['responsetime']=moment()[_0xbd92('0x78')](_0xbd92('0xf4'));var _0x4380bc=_0x52d366[_0xbd92('0x57')]===_0xbd92('0x77')?this[_0xbd92('0x1e')][_0x52d366[_0xbd92('0xb1')]]:this['voiceQueues'][_0x52d366[_0xbd92('0x185')]()];if(!this[_0xbd92('0xd3')](_0x267ed5[_0xbd92('0x186')])){this[_0xbd92('0xc7')](_0x4380bc);return this[_0xbd92('0x187')](_0x52d366,_0x4380bc,_0x267ed5)[_0xbd92('0xb7')](function(_0x511fb4){})[_0xbd92('0xb4')](loggerCatch(_0xbd92('0x188')));}else{this[_0xbd92('0x24')][_0x267ed5['uniqueid']]=_0x52d366;}}};Dialer[_0xbd92('0x1a')][_0xbd92('0x189')]=function(_0x8a4dcf,_0x3b0806,_0x4f0daf){var _0x35b7ba=new History(_0x3b0806);if(_0x35b7ba['countbusyretry']+_0x35b7ba[_0xbd92('0x18a')]+_0x35b7ba[_0xbd92('0x18b')]+_0x35b7ba[_0xbd92('0x18c')]+_0x35b7ba['countdropretry']+_0x35b7ba[_0xbd92('0x107')]+_0x35b7ba[_0xbd92('0x18d')]+_0x35b7ba['countagentrejectretry']>=_0x4f0daf[_0xbd92('0x18e')]-0x1){return!![];}switch(_0x8a4dcf){case 0x3:if(_0x35b7ba[_0xbd92('0x18b')]>=_0x4f0daf[_0xbd92('0x18f')]-0x1){return!![];}else{this[_0xbd92('0xbd')]({'active':![],'countnoanswerretry':_0x35b7ba['countnoanswerretry']+=0x1,'scheduledat':moment()[_0xbd92('0x100')](_0x4f0daf['dialNoAnswerRetryFrequency'],_0xbd92('0x102'))[_0xbd92('0x78')](_0xbd92('0xf4')),'ContactId':_0x35b7ba[_0xbd92('0xcd')],'ListId':_0x35b7ba[_0xbd92('0xce')],'VoiceQueueId':_0x35b7ba[_0xbd92('0xd0')]||undefined,'CampaignId':_0x35b7ba[_0xbd92('0xd1')]||undefined})[_0xbd92('0xb4')](loggerCatch(_0xbd92('0x190')));}break;case 0x5:if(_0x35b7ba[_0xbd92('0x191')]>=_0x4f0daf['dialBusyMaxRetry']-0x1){return!![];}else{this[_0xbd92('0xbd')]({'active':![],'countbusyretry':_0x35b7ba['countbusyretry']+=0x1,'scheduledat':moment()[_0xbd92('0x100')](_0x4f0daf['dialBusyRetryFrequency'],_0xbd92('0x102'))[_0xbd92('0x78')](_0xbd92('0xf4')),'ContactId':_0x35b7ba[_0xbd92('0xcd')],'ListId':_0x35b7ba['ListId'],'VoiceQueueId':_0x35b7ba[_0xbd92('0xd0')]||undefined,'CampaignId':_0x35b7ba[_0xbd92('0xd1')]||undefined})['catch'](loggerCatch('[rescheduleContact]\x20[Busy]'));}break;case 0x8:if(_0x35b7ba[_0xbd92('0x18a')]>=_0x4f0daf[_0xbd92('0x192')]-0x1){return!![];}else{this[_0xbd92('0xbd')]({'active':![],'countcongestionretry':_0x35b7ba[_0xbd92('0x18a')]+=0x1,'scheduledat':moment()['add'](_0x4f0daf[_0xbd92('0x193')],_0xbd92('0x102'))['format'](_0xbd92('0xf4')),'ContactId':_0x35b7ba[_0xbd92('0xcd')],'ListId':_0x35b7ba[_0xbd92('0xce')],'VoiceQueueId':_0x35b7ba[_0xbd92('0xd0')]||undefined,'CampaignId':_0x35b7ba[_0xbd92('0xd1')]||undefined})[_0xbd92('0xb4')](loggerCatch('[rescheduleContact]\x20[Congestion]'));}break;case 0x0:if(_0x35b7ba['countnosuchnumberretry']>=_0x4f0daf['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{this[_0xbd92('0xbd')]({'active':![],'countnosuchnumberretry':_0x35b7ba[_0xbd92('0x18c')]+=0x1,'scheduledat':moment()[_0xbd92('0x100')](_0x4f0daf['dialNoSuchNumberRetryFrequency'],_0xbd92('0x102'))[_0xbd92('0x78')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x35b7ba[_0xbd92('0xcd')],'ListId':_0x35b7ba['ListId'],'VoiceQueueId':_0x35b7ba['VoiceQueueId']||undefined,'CampaignId':_0x35b7ba[_0xbd92('0xd1')]||undefined})[_0xbd92('0xb4')](loggerCatch(_0xbd92('0x194')));}break;case 0xa:if(_0x35b7ba['countdropretry']>=_0x4f0daf[_0xbd92('0xff')]-0x1){return!![];}else{this[_0xbd92('0xbd')]({'active':![],'countdropretry':_0x35b7ba[_0xbd92('0xfe')]+=0x1,'scheduledat':moment()[_0xbd92('0x100')](_0x4f0daf[_0xbd92('0x101')],'minutes')['format'](_0xbd92('0xf4')),'ContactId':_0x35b7ba[_0xbd92('0xcd')],'ListId':_0x35b7ba[_0xbd92('0xce')],'VoiceQueueId':_0x35b7ba['VoiceQueueId']||undefined,'CampaignId':_0x35b7ba[_0xbd92('0xd1')]||undefined})[_0xbd92('0xb4')](loggerCatch('[rescheduleContact][Drop]'));}break;case 0xb:if(_0x35b7ba[_0xbd92('0x107')]>=_0x4f0daf[_0xbd92('0x108')]-0x1){return!![];}else{this[_0xbd92('0xbd')]({'active':![],'countabandonedretry':_0x35b7ba[_0xbd92('0x107')]+=0x1,'scheduledat':moment()[_0xbd92('0x100')](_0x4f0daf[_0xbd92('0x195')],'minutes')[_0xbd92('0x78')](_0xbd92('0xf4')),'ContactId':_0x35b7ba[_0xbd92('0xcd')],'ListId':_0x35b7ba['ListId'],'VoiceQueueId':_0x35b7ba[_0xbd92('0xd0')]||undefined,'CampaignId':_0x35b7ba[_0xbd92('0xd1')]||undefined})[_0xbd92('0xb4')](loggerCatch(_0xbd92('0x109')));}break;case 0x13:if(_0x35b7ba['countmachineretry']>=_0x4f0daf[_0xbd92('0x196')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countmachineretry':_0x35b7ba[_0xbd92('0x18d')]+=0x1,'scheduledat':moment()[_0xbd92('0x100')](_0x4f0daf[_0xbd92('0x197')],_0xbd92('0x102'))[_0xbd92('0x78')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x35b7ba[_0xbd92('0xcd')],'ListId':_0x35b7ba[_0xbd92('0xce')],'VoiceQueueId':_0x35b7ba[_0xbd92('0xd0')]||undefined,'CampaignId':_0x35b7ba[_0xbd92('0xd1')]||undefined})[_0xbd92('0xb4')](loggerCatch(_0xbd92('0x198')));}break;case 0x14:if(_0x35b7ba[_0xbd92('0x199')]>=_0x4f0daf[_0xbd92('0x19a')]-0x1){return!![];}else{this[_0xbd92('0xbd')]({'active':![],'countagentrejectretry':_0x35b7ba[_0xbd92('0x199')]+=0x1,'scheduledat':moment()[_0xbd92('0x100')](_0x4f0daf[_0xbd92('0x19b')],_0xbd92('0x102'))[_0xbd92('0x78')](_0xbd92('0xf4')),'ContactId':_0x35b7ba[_0xbd92('0xcd')],'ListId':_0x35b7ba[_0xbd92('0xce')],'VoiceQueueId':_0x35b7ba[_0xbd92('0xd0')]||undefined,'CampaignId':_0x35b7ba[_0xbd92('0xd1')]||undefined})[_0xbd92('0xb4')](loggerCatch(_0xbd92('0x19c')));}break;default:return!![];}};Dialer['prototype'][_0xbd92('0x187')]=function(_0xa1060b,_0x19ac2d,_0x2bd6ad){var _0x41d515=this;var _0x4c4b91=new History(_0xa1060b);return new BPromise(function(_0xfbb965,_0x1b872a){if(_['isUndefined'](_0x19ac2d)&&_0xbd92('0x19d')!==typeof _0x19ac2d){return _0x1b872a(msgResponse(_0xbd92('0x19e'),'Failure','entity\x20is\x20undefine'));}if(_['isUndefined'](_0x2bd6ad)&&_0xbd92('0x19d')!==typeof _0x2bd6ad){return _0x1b872a(msgResponse(_0xbd92('0x19e'),_0xbd92('0x12b'),_0xbd92('0x19f')));}switch(_0x2bd6ad[_0xbd92('0x1a0')]){case'0':_0x19ac2d['outboundNoSuchCallsDay']+=0x1;_0x4c4b91[_0xbd92('0xdf')]=0x0;_0x4c4b91['statedesc']=_0xbd92('0x1a1');_0x41d515[_0xbd92('0xd7')](_0x4c4b91)[_0xbd92('0xb4')](loggerCatch(_0xbd92('0x1a2')));if(_0x41d515[_0xbd92('0x189')](0x0,_0xa1060b,_0x19ac2d)){if(_0x4c4b91[_0xbd92('0x191')]+_0x4c4b91[_0xbd92('0x18a')]+_0x4c4b91[_0xbd92('0x18b')]+_0x4c4b91[_0xbd92('0x18c')]+_0x4c4b91[_0xbd92('0xfe')]+_0x4c4b91[_0xbd92('0x107')]+_0x4c4b91[_0xbd92('0x18d')]+_0x4c4b91['countagentrejectretry']>=_0x19ac2d[_0xbd92('0x18e')]){_0x41d515['stateGlobal'](_0x4c4b91,_0xfbb965,_0x1b872a,_0xbd92('0x1a3'));}else{_0x41d515[_0xbd92('0x1a4')](_0x4c4b91,_0xfbb965,_0x1b872a,_0xbd92('0x1a3'));}}break;case'3':_0x19ac2d[_0xbd92('0x1a5')]+=0x1;_0x4c4b91[_0xbd92('0xdf')]=0x3;_0x4c4b91[_0xbd92('0xa6')]=_0xbd92('0x1a6');_0x4c4b91['countnoanswerretry']+=0x1;_0x4c4b91[_0xbd92('0x1a7')]+=0x1;_0x41d515[_0xbd92('0xd7')](_0x4c4b91)['catch'](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x41d515['checkRetriveMax'](0x3,_0xa1060b,_0x19ac2d)){if(_0x4c4b91['countnoanswerretry']>=_0x19ac2d[_0xbd92('0x18f')]){_0x41d515['createStateFinal'](_0x4c4b91,_0xfbb965,_0x1b872a,_0xbd92('0x1a8'));}else{_0x41d515[_0xbd92('0x1a9')](_0x4c4b91,_0xfbb965,_0x1b872a,_0xbd92('0x1a8'));}}break;case'5':_0x19ac2d[_0xbd92('0x60')]+=0x1;_0x4c4b91['state']=0x5;_0x4c4b91[_0xbd92('0xa6')]='Busy';_0x4c4b91[_0xbd92('0x191')]+=0x1;_0x4c4b91[_0xbd92('0x1a7')]+=0x1;_0x41d515[_0xbd92('0xd7')](_0x4c4b91)['catch'](loggerCatch(_0xbd92('0x1aa')));if(_0x41d515[_0xbd92('0x189')](0x5,_0xa1060b,_0x19ac2d)){if(_0x4c4b91['countbusyretry']>=_0x19ac2d[_0xbd92('0x1ab')]){_0x41d515['createStateFinal'](_0x4c4b91,_0xfbb965,_0x1b872a,_0xbd92('0x1ac'));}else{_0x41d515['stateGlobal'](_0x4c4b91,_0xfbb965,_0x1b872a,_0xbd92('0x1ac'));}}break;case'8':_0x19ac2d['outboundCongestionCallsDay']+=0x1;_0x4c4b91[_0xbd92('0xdf')]=0x8;_0x4c4b91[_0xbd92('0xa6')]=_0xbd92('0x1ad');_0x4c4b91['countcongestionretry']+=0x1;_0x4c4b91['countglobal']+=0x1;_0x41d515['createHistory'](_0x4c4b91)[_0xbd92('0xb4')](loggerCatch(_0xbd92('0x1ae')));if(_0x41d515['checkRetriveMax'](0x8,_0xa1060b,_0x19ac2d)){if(_0x4c4b91[_0xbd92('0x18a')]>=_0x19ac2d[_0xbd92('0x192')]){_0x41d515[_0xbd92('0x1a4')](_0x4c4b91,_0xfbb965,_0x1b872a,_0xbd92('0x1af'));}else{_0x41d515[_0xbd92('0x1a9')](_0x4c4b91,_0xfbb965,_0x1b872a,_0xbd92('0x1af'));}}break;case'11':_0x19ac2d[_0xbd92('0x1b0')]+=0x1;_0x4c4b91['state']=0xb;_0x4c4b91[_0xbd92('0xa6')]=_0xbd92('0x104');_0x4c4b91[_0xbd92('0x107')]+=0x1;_0x4c4b91[_0xbd92('0x1a7')]+=0x1;_0x41d515[_0xbd92('0xd7')](_0x4c4b91)[_0xbd92('0xb4')](loggerCatch(_0xbd92('0x1b1')));if(_0x41d515[_0xbd92('0x189')](0xb,_0xa1060b,_0x19ac2d)){if(_0x4c4b91[_0xbd92('0x107')]>=_0x19ac2d[_0xbd92('0x108')]){_0x41d515[_0xbd92('0x1a4')](_0x4c4b91,_0xfbb965,_0x1b872a,_0xbd92('0x1b2'));}else{_0x41d515['stateGlobal'](_0x4c4b91,_0xfbb965,_0x1b872a,_0xbd92('0x1b2'));}}break;case'20':_0x19ac2d[_0xbd92('0x66')]+=0x1;_0x4c4b91['state']=0x14;_0x4c4b91[_0xbd92('0xa6')]=_0xbd92('0x1b3');_0x4c4b91[_0xbd92('0x199')]+=0x1;_0x4c4b91[_0xbd92('0x1a7')]+=0x1;_0x41d515[_0xbd92('0xd7')](_0x4c4b91)['catch'](loggerCatch(_0xbd92('0x1b4')));if(_0x41d515['checkRetriveMax'](0x14,_0xa1060b,_0x19ac2d)){if(_0x4c4b91[_0xbd92('0x199')]>=_0x19ac2d[_0xbd92('0x19a')]){_0x41d515[_0xbd92('0x1a4')](_0x4c4b91,_0xfbb965,_0x1b872a,_0xbd92('0x1b5'));}else{_0x41d515[_0xbd92('0x1a9')](_0x4c4b91,_0xfbb965,_0x1b872a,'reason\x2020\x20agentreject');}}break;default:_0x19ac2d[_0xbd92('0x67')]+=0x1;_0x4c4b91['state']=0xc;_0x4c4b91['statedesc']=_0x2bd6ad['reason'];_0x41d515[_0xbd92('0xd7')](_0x4c4b91)['catch'](loggerCatch(_0xbd92('0x1b6')));if(_0x41d515[_0xbd92('0x189')](_0x2bd6ad['reason'],_0xa1060b,_0x19ac2d)){if(_0x4c4b91['countbusyretry']+_0x4c4b91[_0xbd92('0x18a')]+_0x4c4b91['countnoanswerretry']+_0x4c4b91['countnosuchnumberretry']+_0x4c4b91[_0xbd92('0xfe')]+_0x4c4b91[_0xbd92('0x107')]+_0x4c4b91[_0xbd92('0x18d')]+_0x4c4b91['countagentrejectretry']>=_0x19ac2d[_0xbd92('0x18e')]){_0x41d515[_0xbd92('0x1a9')](_0x4c4b91,_0xfbb965,_0x1b872a,_0x2bd6ad['reason']);}else{_0x41d515[_0xbd92('0x1a4')](_0x4c4b91,_0xfbb965,_0x1b872a,_0x2bd6ad[_0xbd92('0x1a0')]);}}}});};Dialer['prototype'][_0xbd92('0x1a9')]=function(_0x581e79,_0x5eda9e,_0x3adc7c,_0x97b3ba){var _0x35e760=new Final(_0x581e79);_0x35e760[_0xbd92('0xdf')]=0xf;_0x35e760['statedesc']='Global';this[_0xbd92('0x1a4')](_0x35e760,_0x5eda9e,_0x3adc7c,_0x97b3ba);};Dialer[_0xbd92('0x1a')]['createStateFinal']=function(_0x1b337d,_0x51d601,_0x72d2a1,_0x2f2cb3){this[_0xbd92('0xeb')](_0x1b337d)[_0xbd92('0xb7')](function(_0x1f7666){return _0x51d601(msgResponse(_0xbd92('0x19e'),_0xbd92('0x1b7'),_0x2f2cb3));})[_0xbd92('0xb4')](function(_0x236b8d){return _0x72d2a1(msgResponse('[moveContactManagedDialer][0]',_0xbd92('0x12b'),_0xbd92('0x1b8')));});};Dialer[_0xbd92('0x1a')][_0xbd92('0x142')]=function(_0x5d2e93){var _0x1d9f37=this;var _0x4a2b72=_0x5d2e93[_0xbd92('0x1b9')]/0x64;var _0x2800a7=_0x5d2e93[_0xbd92('0x64')]/(_0x5d2e93['outboundDropCallsDayTimeout']+_0x5d2e93[_0xbd92('0x5f')]);var _0x287a97=Math[_0xbd92('0x1ba')](_0x5d2e93['predictiveIntervalAvailable']*(_0x5d2e93[_0xbd92('0x1bb')]/0x64));var _0x596781=Math[_0xbd92('0x1ba')](_0x5d2e93[_0xbd92('0x6b')]*(_0x5d2e93[_0xbd92('0x1bc')]/0x64));var _0x3ed6bf=_0x5d2e93[_0xbd92('0x51')]+_0x5d2e93[_0xbd92('0x55')];var _0x59da0f=Math['floor'](_0x5d2e93[_0xbd92('0x6e')]*_0x5d2e93[_0xbd92('0x70')]*_0x5d2e93['predictiveIntervalHitRate']*_0x5d2e93[_0xbd92('0x69')]);if(_['isUndefined'](_0x5d2e93[_0xbd92('0x27')])){if(!_[_0xbd92('0x3e')](_0x5d2e93[_0xbd92('0x26')])){_0x5d2e93[_0xbd92('0x26')]=undefined;loggerPredictive[_0xbd92('0x94')](_0xbd92('0x1bd'),_0xbd92('0x1be'));}if(!_[_0xbd92('0x3e')](_0x5d2e93['handlePredictive'])){loggerPredictive['error']('[startMethodPredictive][StartProgressive]',_0xbd92('0x1bf'));clearInterval(_0x5d2e93[_0xbd92('0x90')]);_0x5d2e93[_0xbd92('0x90')]=undefined;}_0x5d2e93[_0xbd92('0x27')]=moment()[_0xbd92('0x78')](_0xbd92('0xf4'));loggerPredictive['info'](_0x5d2e93[_0xbd92('0x48')],_0xbd92('0x1c0'),_0x5d2e93[_0xbd92('0x27')]);this[_0xbd92('0x140')](_0x5d2e93,0x1);}else if(ifInterval(_0x5d2e93[_0xbd92('0x1c1')],_0x5d2e93[_0xbd92('0x27')])){this[_0xbd92('0x140')](_0x5d2e93,0x1);loggerPredictiveCalls[_0xbd92('0x7a')](_0xbd92('0x1c2'),_0x5d2e93[_0xbd92('0x27')],_0x5d2e93[_0xbd92('0x48')]);_0x5d2e93['erlangCalls']=0x0;_0x5d2e93['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x4a2b72<_0x2800a7&&_0x5d2e93[_0xbd92('0x1c3')]===_0xbd92('0x1c4')){freeVariablesPredictive(_0x5d2e93);loggerPredictive[_0xbd92('0x7a')](_0xbd92('0x1c5'),'Dropped\x20calls\x20day',_0x2800a7,'startProgressive',_0x5d2e93[_0xbd92('0x48')]);}else if(_0x59da0f<_0x5d2e93['predictiveIntervalErlangCallsDroppedCalls']&&_0x5d2e93[_0xbd92('0x1c3')]===_0xbd92('0x1c4')){freeVariablesPredictive(_0x5d2e93);loggerPredictive[_0xbd92('0x7a')](_0xbd92('0x1c6'),_0xbd92('0x1c7'),_0x59da0f,_0xbd92('0x1c8'),_0x5d2e93[_0xbd92('0xfb')],_0xbd92('0x27'),_0x5d2e93[_0xbd92('0x48')]);}else if(!ifInterval(_0x5d2e93[_0xbd92('0x1c1')],_0x5d2e93[_0xbd92('0x27')])&&_['isUndefined'](_0x5d2e93[_0xbd92('0x26')])&&!_[_0xbd92('0x3e')](_0x5d2e93[_0xbd92('0x27')])){_0x5d2e93[_0xbd92('0x26')]=moment()['format'](_0xbd92('0xf4'));loggerPredictive[_0xbd92('0x7a')](_0x5d2e93[_0xbd92('0x48')],'started\x20in\x20predictive\x20at',_0x5d2e93[_0xbd92('0x26')]);this[_0xbd92('0xbc')](_0x5d2e93[_0xbd92('0x1c1')])[_0xbd92('0xb7')](this[_0xbd92('0x1c9')](_0x5d2e93))[_0xbd92('0xb7')](mergeDataErlangB(_0x5d2e93))[_0xbd92('0xb7')](this[_0xbd92('0x1ca')](_0x5d2e93))[_0xbd92('0xb4')](loggerCatchPredictive(_0xbd92('0x1cb'),_0x5d2e93));}else if(!ifInterval(_0x5d2e93[_0xbd92('0x1c1')],_0x5d2e93['startPredictive'])){_0x5d2e93[_0xbd92('0xfb')]=0x0;_0x5d2e93[_0xbd92('0x26')]=moment()[_0xbd92('0x78')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xbd92('0x7a')](_0x5d2e93[_0xbd92('0x48')],_0xbd92('0x1cc'),_0x5d2e93[_0xbd92('0x26')]);clearInterval(_0x5d2e93[_0xbd92('0x90')]);_0x5d2e93['handlePredictive']=undefined;this[_0xbd92('0xbc')](_0x5d2e93[_0xbd92('0x1c1')])[_0xbd92('0xb7')](this[_0xbd92('0x1c9')](_0x5d2e93))['then'](mergeDataErlangB(_0x5d2e93))[_0xbd92('0xb7')](this[_0xbd92('0x1ca')](_0x5d2e93))['catch'](loggerCatchPredictive(_0xbd92('0x1cd'),_0x5d2e93));}else if(_0x5d2e93[_0xbd92('0x6b')]&&_0x3ed6bf<_0x5d2e93[_0xbd92('0x6b')]-_0x596781){freeVariablesPredictive(_0x5d2e93);loggerPredictive['info'](_0x5d2e93['name'],_0xbd92('0x1ce'),_0x3ed6bf,_0xbd92('0x1cf'),_0x5d2e93[_0xbd92('0x6b')],'-',_0x596781,'=',_0x5d2e93[_0xbd92('0x6b')]-_0x596781,')');}else if(_0x5d2e93[_0xbd92('0x6b')]&&_0x3ed6bf>_0x5d2e93[_0xbd92('0x6b')]+_0x287a97){freeVariablesPredictive(_0x5d2e93);loggerPredictive['info'](_0x5d2e93['name'],_0xbd92('0x1ce'),_0x3ed6bf,')\x20are\x20more\x20than\x20threshold\x20(',_0x5d2e93[_0xbd92('0x6b')],'+',_0x287a97,'=',_0x5d2e93[_0xbd92('0x6b')]+_0x287a97,')');}};Dialer['prototype'][_0xbd92('0x1c9')]=function(_0x2c161e){var _0x2b5801=this;return function(_0x363623){return new BPromise(function(_0x136606,_0x5c44d8){_[_0xbd92('0x8c')](_0x2c161e,_0x363623[0x0]);if(checkGetDataPredictive(_0x363623[0x0])){var _0x382dab=_0x2c161e[_0xbd92('0x6b')]=_0x2c161e['talking']+_0x2c161e[_0xbd92('0x51')];var _0x2a882a=_0x2c161e[_0xbd92('0x1c1')]*0x3c;var _0x413ca9=_0x363623[0x0][_0xbd92('0x81')]+_0x363623[0x0][_0xbd92('0x84')];var _0x5a64e3=(_0x363623[0x0]['predictiveIntervalAnsweredCalls']+_0x363623[0x0][_0xbd92('0xfa')]+_0x363623[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x363623[0x0][_0xbd92('0x6c')];_0x2c161e[_0xbd92('0x68')]=_0x5a64e3>0x0?_0x5a64e3:0x1;switch(_0x2c161e[_0xbd92('0x1c3')]){case'dropRate':var _0x5368d3=_0x2c161e[_0xbd92('0x1b9')]/0x64;return _0x2b5801['abandonmentRate'](_0x382dab,_0x2a882a,_0x413ca9,_0x5a64e3,_0x5368d3)[_0xbd92('0xb7')](function(_0x4efa8d){return _0x136606(_0x4efa8d);});case _0xbd92('0x1d0'):var _0x3ba003=_0x2c161e['dialPredictiveOptimizationPercentage']/0x64;return _0x2b5801['busyFactor'](_0x382dab,_0x2a882a,_0x413ca9,_0x5a64e3,_0x3ba003)[_0xbd92('0xb7')](function(_0x32b08c){return _0x136606(_0x32b08c);});default:return _0x5c44d8(msgResponse('[getDataPredictive]','Failure',_0xbd92('0x1d1')));}}else{return _0x5c44d8(msgResponse('[getDataPredictive]',_0xbd92('0x12b'),'check\x20failure'));}});};};Dialer[_0xbd92('0x1a')][_0xbd92('0x1d2')]=function(_0x58c9b3){var _0x35bd89=this;return function(_0xad8b95){return new BPromise(function(_0x4be049,_0x400bb0){_[_0xbd92('0x8c')](_0x58c9b3,_0xad8b95[0x0]);if(checkGetDataPredictive(_0xad8b95[0x0])){loggerPredictive[_0xbd92('0x7a')](JSON[_0xbd92('0x4b')](_0xad8b95[0x0]));if(_0x58c9b3[_0xbd92('0x1c3')]===_0xbd92('0x1c4')){return _0x35bd89[_0xbd92('0xc4')](_0x58c9b3['id'])[_0xbd92('0xb7')](function(_0x580828){var _0x3c8f88=_0x58c9b3[_0xbd92('0x148')]-_0x580828[0x0][_0xbd92('0x1d3')];var _0x23bc03=_0x58c9b3[_0xbd92('0x1c1')]*0x3c;var _0x439d34=_0xad8b95[0x0]['predictiveIntervalAvgTalktime']+_0xad8b95[0x0][_0xbd92('0x84')];var _0x21d8ef=(_0xad8b95[0x0]['predictiveIntervalAnsweredCalls']+_0xad8b95[0x0]['predictiveIntervalDroppedCallsTimeout']+_0xad8b95[0x0][_0xbd92('0x7f')])/_0xad8b95[0x0][_0xbd92('0x6c')];var _0x4f8f32=_0x58c9b3['dialPredictiveOptimizationPercentage']/0x64;_0x58c9b3[_0xbd92('0x6a')]=_0x580828[0x0]['outboundQueuePauses']||0x0;_0x58c9b3[_0xbd92('0x68')]=_0x21d8ef>0x0?_0x21d8ef:0x1;return _0x35bd89['abandonmentRate'](_0x3c8f88,_0x23bc03,_0x439d34,_0x21d8ef,_0x4f8f32);})[_0xbd92('0xb7')](function(_0xe2b3eb){return _0x4be049(_0xe2b3eb);})[_0xbd92('0xb4')](function(_0x31f26d){return _0x400bb0(msgResponse(_0xbd92('0x1d4'),_0xbd92('0x12b'),JSON['stringify'](_0x31f26d)));});}if(_0x58c9b3[_0xbd92('0x1c3')]===_0xbd92('0x1d0')){return _0x35bd89[_0xbd92('0xc4')](_0x58c9b3['id'])['then'](function(_0x46f855){var _0x4f74ec=_0x58c9b3[_0xbd92('0x148')]-_0x46f855[0x0]['outboundQueuePauses'];var _0x5e430c=_0x58c9b3[_0xbd92('0x1c1')]*0x3c;var _0x3a7436=_0xad8b95[0x0]['predictiveIntervalAvgTalktime']+_0xad8b95[0x0]['predictiveIntervalAvgHoldtime'];var _0x1cd55c=(_0xad8b95[0x0][_0xbd92('0x1d5')]+_0xad8b95[0x0]['predictiveIntervalDroppedCallsTimeout']+_0xad8b95[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0xad8b95[0x0][_0xbd92('0x6c')];var _0x1ba644=_0x58c9b3[_0xbd92('0x1b9')]/0x64;_0x58c9b3[_0xbd92('0x6a')]=_0x46f855[0x0][_0xbd92('0x1d3')]||0x0;_0x58c9b3[_0xbd92('0x68')]=_0x1cd55c>0x0?_0x1cd55c:0x1;return _0x35bd89[_0xbd92('0x1d6')](_0x4f74ec,_0x5e430c,_0x3a7436,_0x1cd55c,_0x1ba644);})[_0xbd92('0xb7')](function(_0x15d93a){return _0x4be049(_0x15d93a);})[_0xbd92('0xb4')](function(_0xd08005){return _0x400bb0(msgResponse('[CatchErlangB]',_0xbd92('0x12b'),JSON['stringify'](_0xd08005)));});}}else{return _0x400bb0(msgResponse(_0xbd92('0x1d7'),_0xbd92('0x12b'),_0xbd92('0x1d8')));}});};};Dialer[_0xbd92('0x1a')][_0xbd92('0x1ca')]=function(_0x2a187c){var _0x11b550=this;return function(){var _0x1a960b=0x0;var _0xc3da93=Math[_0xbd92('0x1d9')](_0x2a187c['erlangCallToSecond']*0x3e8);if(_0xc3da93>0x0){_0xc3da93=_0xc3da93<0x64?0x64:_0xc3da93;loggerPredictive[_0xbd92('0x7a')](_0x2a187c[_0xbd92('0x48')],_0xbd92('0x1da'),_0xc3da93,_0xbd92('0x4c'));_0x2a187c[_0xbd92('0x90')]=setInterval(function(){_0x11b550['handlePredictive'](_0x2a187c);loggerPredictiveCalls[_0xbd92('0x7a')](_0xbd92('0x1db'),_0x1a960b+=0x1);},_0xc3da93);}else{loggerPredictive[_0xbd92('0x7a')](_0x2a187c[_0xbd92('0x48')],_0xbd92('0x1dc'));}};};Dialer[_0xbd92('0x1a')][_0xbd92('0x1dd')]=function(_0x3a3ee0,_0x28b383){var _0x5a4172=this;return function(_0x316bd2){if(_[_0xbd92('0x49')](_0x316bd2)){if(_[_0xbd92('0xae')](_0x28b383[_0xbd92('0xcf')])||!_0x28b383[_0xbd92('0x1de')]){if(_0x3a3ee0[_0xbd92('0x5a')]===_0xbd92('0x8')){_0x3a3ee0[_0xbd92('0x111')]=_[_0xbd92('0x3e')](_0x3a3ee0[_0xbd92('0x111')])?!![]:_0x3a3ee0[_0xbd92('0x111')];var _0x108b0c=uuid['v4']();_0x5a4172[_0xbd92('0x22')][_0x108b0c]=new Action(_0x3a3ee0,_0x28b383,_0x108b0c);loggerBooked[_0xbd92('0x7a')](_0xbd92('0x1df'),_0x108b0c,_0xbd92('0x1e0'),JSON[_0xbd92('0x4b')](_0x3a3ee0['queueStatusComplete']),'Queue:\x20',_0x3a3ee0[_0xbd92('0x48')]);if(_0x3a3ee0[_0xbd92('0x111')]){_0x3a3ee0[_0xbd92('0x111')]=![];_0x5a4172[_0xbd92('0x29')][_0x5a4172[_0xbd92('0x22')][_0x108b0c][_0xbd92('0xb1')]]=[];ami[_0xbd92('0x130')]({'actionid':_0x108b0c,'action':_0xbd92('0x1e1'),'queue':_0x3a3ee0[_0xbd92('0x48')]})[_0xbd92('0xb4')](function(_0x32d0c6){_0x5a4172['updateOriginated'](_0x3a3ee0);_0x5a4172[_0xbd92('0xbd')]({'active':![],'ContactId':_0x5a4172[_0xbd92('0x22')][_0x108b0c]['ContactId'],'ListId':_0x5a4172['actions'][_0x108b0c]['ListId'],'VoiceQueueId':_0x5a4172[_0xbd92('0x22')][_0x108b0c][_0xbd92('0xd0')]||undefined,'CampaignId':_0x5a4172[_0xbd92('0x22')][_0x108b0c][_0xbd92('0xd1')]||undefined})['catch'](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x5a4172['actions'][_0x108b0c];});}else{loggerBooked[_0xbd92('0x7a')](_0xbd92('0x1e2'),JSON[_0xbd92('0x4b')](_0x3a3ee0['queueStatusComplete']),_0xbd92('0x1e3'),_0x3a3ee0['name']);_0x5a4172[_0xbd92('0xc7')](_0x3a3ee0);_0x5a4172[_0xbd92('0xbd')]({'active':![],'ContactId':_0x5a4172[_0xbd92('0x22')][_0x108b0c][_0xbd92('0xcd')],'ListId':_0x5a4172['actions'][_0x108b0c][_0xbd92('0xce')],'VoiceQueueId':_0x5a4172[_0xbd92('0x22')][_0x108b0c][_0xbd92('0xd0')]||undefined,'CampaignId':_0x5a4172[_0xbd92('0x22')][_0x108b0c][_0xbd92('0xd1')]||undefined})[_0xbd92('0xb4')](loggerCatch(_0xbd92('0x1e4')));delete _0x5a4172[_0xbd92('0x22')][_0x108b0c];}}else{return _0x5a4172['actionOriginate'](_0x3a3ee0,_0x28b383);}}else{if(getDiff(_0x28b383[_0xbd92('0x1e5')])<_0x3a3ee0[_0xbd92('0x1e6')]*0x3c){if(_0x28b383[_0xbd92('0x1e7')]&&!_0x28b383[_0xbd92('0x1e7')][_0xbd92('0x1e8')]){_0x5a4172[_0xbd92('0x1c')][_0xbd92('0x115')](_0x28b383['id'])[_0xbd92('0x117')](function(){_0x5a4172[_0xbd92('0xc7')](_0x3a3ee0);});}else{_0x5a4172['unlockContact']({'active':![]},_0x28b383['id'],0x1)[_0xbd92('0x117')](function(){console[_0xbd92('0x1e9')](_0xbd92('0x1ea'));_0x5a4172[_0xbd92('0xc7')](_0x3a3ee0);});}}else{_0x3a3ee0['outboundReCallsDay']+=0x1;_0x5a4172['updateOriginated'](_0x3a3ee0);if(_0x3a3ee0[_0xbd92('0x1eb')]){_0x5a4172[_0xbd92('0xbd')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x28b383['ContactId'],'ListId':_0x28b383['ListId'],'VoiceQueueId':_0x28b383[_0xbd92('0xd0')]||undefined,'CampaignId':_0x28b383[_0xbd92('0xd1')]||undefined})[_0xbd92('0xb4')](loggerCatch(_0xbd92('0x1ec')));_0x5a4172[_0xbd92('0xd7')](createObjHistory(_0x3a3ee0,_0x28b383,'RECALLINQUEUE',0x17,_0xbd92('0x1ed')))[_0xbd92('0xb4')](loggerCatch(_0xbd92('0x1ee')));}else{_0x5a4172[_0xbd92('0xcc')](createObjHistory(_0x3a3ee0,_0x28b383,_0xbd92('0x1ef'),0x16,_0xbd92('0x1f0')),'[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]');}}}}else{_0x3a3ee0['outboundBlacklistCallsDay']+=0x1;_0x5a4172[_0xbd92('0xcc')](createObjHistory(_0x3a3ee0,_0x28b383,_0xbd92('0x1f1'),0xd,_0xbd92('0x1f2')),_0xbd92('0x1f3'),_0xbd92('0x1f4'));throw'inBlackList';}};};Dialer[_0xbd92('0x1a')]['handleIvr']=function(_0x564a87){var _0xdd5c4a=this;var _0x259a75=[];var _0x3fe36a=_0x564a87[_0xbd92('0x1f5')]-_0x564a87[_0xbd92('0x6d')]-_0x564a87[_0xbd92('0x1f6')];emitCampaignSummary(_0x564a87);if(_0x3fe36a>0x0){if(_0x3fe36a>this['maxNumberOriginate']){_0x3fe36a=this[_0xbd92('0x21')];}_0x564a87[_0xbd92('0x1f6')]+=_0x3fe36a;this[_0xbd92('0xc3')](_0x564a87['id'],_0x3fe36a,_0x564a87[_0xbd92('0x1f7')])[_0xbd92('0xb7')](function(_0x114cdb){_0x564a87[_0xbd92('0x1f6')]-=_0x3fe36a;_0x564a87[_0xbd92('0x1f6')]=_0x564a87[_0xbd92('0x1f6')]>0x0?_0x564a87['temp']:0x0;if(!checkContactEmpty(_0x114cdb)){_0x564a87[_0xbd92('0x3f')]='AVAILABLE_CONTACTS_FINISHED';logger[_0xbd92('0x7a')](_0xbd92('0x1f8')+_0x564a87['name']);}else{_0x564a87['originated']+=_0x114cdb[_0xbd92('0x97')];_0x564a87[_0xbd92('0x3f')]=_0xbd92('0x1f9');for(var _0xbfc770=0x0;_0xbfc770<_0x114cdb[_0xbd92('0x97')];_0xbfc770+=0x1){_0x564a87[_0xbd92('0x1fa')]+=0x1;if(_[_0xbd92('0xae')](_0x114cdb[_0xbfc770])||_[_0xbd92('0xae')](_0x114cdb[_0xbfc770][_0xbd92('0x152')])||_[_0xbd92('0xae')](_0x114cdb[_0xbfc770]['Contact'][_0xbd92('0x153')])){_0xdd5c4a['emptyContact'](_0xbd92('0x1fb'),_0x564a87,_0x114cdb[_0xbfc770]);}else{_0xdd5c4a[_0xbd92('0xba')](_[_0xbd92('0x114')](_0x114cdb[_0xbfc770],[_0xbd92('0xd1'),_0xbd92('0x1fc')]))[_0xbd92('0xb7')](_0xdd5c4a[_0xbd92('0x1dd')](_0x564a87,_0x114cdb[_0xbfc770]))['catch'](_0xdd5c4a['loggerHandler'](_0xbd92('0x1fd'),_0x564a87));}}}})[_0xbd92('0xb4')](loggerGetContactDialer('[getContactCampaign2]',_0x564a87,_0x3fe36a));}};Dialer[_0xbd92('0x1a')][_0xbd92('0x140')]=function(_0x477a1f,_0x3aafdb){var _0x295c71=this;var _0x446a72=[];var _0x4653e7=_0x3aafdb>=0x1?_0x3aafdb:0x1;var _0x305bce=[];if(_0x477a1f[_0xbd92('0x5a')]===_0xbd92('0x8')){_0x4653e7=0x1;}var _0x45daba=Math[_0xbd92('0x1d9')](_0x477a1f['available']*_0x4653e7)-_0x477a1f[_0xbd92('0x6d')]-_0x477a1f[_0xbd92('0x1f6')];emitVoiceQueueSummary(_0x477a1f);if(_0x477a1f[_0xbd92('0x1fe')]>0x0){var _0x1fed04=_0x477a1f[_0xbd92('0x1fe')]-_0x477a1f['originated']-_0x477a1f[_0xbd92('0x55')]-_0x477a1f[_0xbd92('0x1f6')]-_0x477a1f[_0xbd92('0x52')];if(_0x45daba>_0x1fed04){_0x45daba=_0x1fed04;}}if(_0x45daba>0x0){if(_0x477a1f['dialMethod']===_0xbd92('0x8')){_0x45daba=0x1;}if(_0x45daba>this[_0xbd92('0x21')]){_0x45daba=this[_0xbd92('0x21')];}_0x477a1f[_0xbd92('0x1f6')]+=_0x45daba;for(var _0xb8eb58 in this[_0xbd92('0x1f')]){if(this['agents'][_0xbd92('0x98')](_0xb8eb58)){if(this[_0xbd92('0x1f')][_0xb8eb58]['state']===_0xbd92('0x1ff')&&this[_0xbd92('0x1f')][_0xb8eb58][_0xbd92('0xaf')]===_0xbd92('0xd5')){_0x446a72[_0xbd92('0x110')](this[_0xbd92('0x1f')][_0xb8eb58]['id']);}}}this['getContactDialer'](_0x477a1f['id'],_0x446a72,_0x45daba,_0x477a1f[_0xbd92('0x1f7')])[_0xbd92('0xb7')](function(_0x2c4d45){_0x477a1f[_0xbd92('0x1f6')]-=_0x45daba;_0x477a1f[_0xbd92('0x1f6')]=_0x477a1f[_0xbd92('0x1f6')]>0x0?_0x477a1f['temp']:0x0;if(!checkContactEmpty(_0x2c4d45)){_0x295c71[_0xbd92('0xb3')](_0x477a1f)[_0xbd92('0xb7')](sendMessageReschedule(_0x477a1f))['catch'](loggerCatch(_0xbd92('0xb5')));}else{_0x477a1f[_0xbd92('0x6d')]+=_0x2c4d45['length'];_0x477a1f[_0xbd92('0x3f')]=_0x477a1f[_0xbd92('0x5a')]===_0xbd92('0x8')?_0xbd92('0x15a'):_0xbd92('0x1f9');for(var _0x18fffc=0x0;_0x18fffc<_0x2c4d45[_0xbd92('0x97')];_0x18fffc+=0x1){if(_[_0xbd92('0xae')](_0x2c4d45[_0x18fffc])||_[_0xbd92('0xae')](_0x2c4d45[_0x18fffc]['Contact'])||_[_0xbd92('0xae')](_0x2c4d45[_0x18fffc][_0xbd92('0x152')][_0xbd92('0x153')])){_0x295c71['emptyContact'](_0xbd92('0x1fb'),_0x477a1f,_0x2c4d45[_0x18fffc]);}else{_0x295c71[_0xbd92('0xb8')](_['pick'](_0x2c4d45[_0x18fffc],[_0xbd92('0xd0'),_0xbd92('0x1fc')]))['then'](_0x295c71[_0xbd92('0x1dd')](_0x477a1f,_0x2c4d45[_0x18fffc]))['catch'](_0x295c71['loggerHandler'](_0xbd92('0x1fb'),_0x477a1f));}}}})[_0xbd92('0xb4')](loggerGetContactDialer('[getContactDialer2]',_0x477a1f,_0x45daba));}};Dialer['prototype'][_0xbd92('0x90')]=function(_0x2840fe){var _0x349464=this;if(_0x2840fe['dialLimitQueue']>0x0){var _0x51e1a6=_0x2840fe[_0xbd92('0x1fe')]-_0x2840fe['originated']-_0x2840fe[_0xbd92('0x55')];if(_0x51e1a6>0x0){this[_0xbd92('0x200')](_0x2840fe);}else{loggerPredictiveCalls[_0xbd92('0x7a')]('[handlePredictive][limitChannel]');}}else{this[_0xbd92('0x200')](_0x2840fe);}};Dialer[_0xbd92('0x1a')][_0xbd92('0x200')]=function(_0x24a071){var _0x39d477=this;var _0x37ece4=[];_0x24a071['originated']+=0x1;for(var _0x565eb4 in this['agents']){if(this['agents'][_0xbd92('0x98')](_0x565eb4)){if(this['agents'][_0x565eb4][_0xbd92('0xdf')]==='not_inuse'&&this['agents'][_0x565eb4][_0xbd92('0xaf')]===_0xbd92('0xd5')){_0x37ece4[_0xbd92('0x110')](this[_0xbd92('0x1f')][_0x565eb4]['id']);}}}this[_0xbd92('0xc1')](_0x24a071['id'],_0x37ece4,0x1,_0x24a071[_0xbd92('0x1f7')])['then'](function(_0xe25ae0){if(!checkContactEmpty(_0xe25ae0)){checkContactLowerLimitOriginate(_0x24a071,0x1,0x0);_0x39d477[_0xbd92('0xb3')](_0x24a071)['then'](sendMessageReschedule(_0x24a071))['catch'](loggerCatch(_0xbd92('0xb5')));}else{_0x24a071[_0xbd92('0x3f')]=_0xbd92('0x1f9');if(_[_0xbd92('0xae')](_0xe25ae0[0x0])||_[_0xbd92('0xae')](_0xe25ae0[0x0][_0xbd92('0x152')])||_[_0xbd92('0xae')](_0xe25ae0[0x0][_0xbd92('0x152')][_0xbd92('0x153')])){_0x39d477[_0xbd92('0xca')](_0xbd92('0x1fb'),_0x24a071,_0xe25ae0[0x0]);}else{_0x39d477[_0xbd92('0xb8')](_[_0xbd92('0x114')](_0xe25ae0[0x0],['VoiceQueueId','Contact.phone']))['then'](_0x39d477[_0xbd92('0x1dd')](_0x24a071,_0xe25ae0[0x0]))[_0xbd92('0xb4')](_0x39d477[_0xbd92('0xc9')](_0xbd92('0x201'),_0x24a071));}}})['catch'](loggerGetContactDialer(_0xbd92('0x202'),_0x24a071,0x1));emitVoiceQueueSummary(_0x24a071);};Dialer[_0xbd92('0x1a')][_0xbd92('0x203')]=function(_0x16f848,_0x4189ab,_0x5a2d4a,_0x4edb54,_0x16da49,_0xd9f027){loggerPredictive[_0xbd92('0x7a')](_0xbd92('0x204'));loggerPredictive[_0xbd92('0x7a')](_0xbd92('0x205'),_0x16f848);loggerPredictive[_0xbd92('0x7a')](_0xbd92('0x206'),_0x4189ab);loggerPredictive['info']('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',_0x5a2d4a);loggerPredictive['info'](_0xbd92('0x207'),_0x4edb54);loggerPredictive['info'](_0xbd92('0x208'),_0x16da49);loggerPredictive[_0xbd92('0x7a')]('---------------------------');return new BPromise(function(_0x3f6e54,_0x4110ff){if(_0x16f848<=0x0||isNaN(_0x16f848)){return _0x4110ff(msgResponse(_0xbd92('0x209'),_0xbd92('0x183'),_0xbd92('0x20a')+_0x16f848));}if(_0x5a2d4a<=0x0||isNaN(_0x5a2d4a)){return _0x4110ff(msgResponse(_0xbd92('0x209'),_0xbd92('0x183'),_0xbd92('0x20b')+_0x5a2d4a));}if(_0x4edb54<=0x0||isNaN(_0x4edb54)){return _0x4110ff(msgResponse(_0xbd92('0x209'),'Error',_0xbd92('0x20c')+_0x4edb54));}if(_0x4189ab<=0x0||isNaN(_0x4189ab)){return _0x4110ff(msgResponse(_0xbd92('0x209'),_0xbd92('0x183'),_0xbd92('0x20d')+_0x4189ab));}if(_0x16da49<=0x0||isNaN(_0x16da49)){return _0x4110ff(msgResponse(_0xbd92('0x209'),'Error','Amax\x20=\x20'+_0x16da49));}_0xd9f027=_0xd9f027||0x0;var _0x474395=0x1/_0x5a2d4a;var _0x3110f1=0x0;var _0x4e8520=0x0;var _0x6524a4=0x0;var _0x201f8c=0x0;for(var _0x52a337=0x0;_0x6524a4<_0x16da49;_0x52a337+=0x1){_0x4e8520=_0x52a337/_0x4189ab;_0x3110f1=(_0x4edb54*_0x4e8520+_0xd9f027)/_0x474395;_0x6524a4=erlangb(_0x3110f1,_0x16f848);_0x201f8c=_0x3110f1/_0x16f848*(0x1-erlangb(_0x3110f1,_0x16f848));}return _0x3f6e54({'erlangCalls':_0x52a337,'erlangCallToSecond':_0x4189ab/_0x52a337,'erlangAbandonmentRate':_0x6524a4,'erlangBusyFactor':_0x201f8c});});};Dialer['prototype']['busyFactor']=function(_0x4b32cd,_0xcf1208,_0x5e1294,_0x1fecea,_0x523cb0,_0xa3660a){loggerPredictive[_0xbd92('0x7a')](_0xbd92('0x20e'));loggerPredictive[_0xbd92('0x7a')](_0xbd92('0x205'),_0x4b32cd);loggerPredictive[_0xbd92('0x7a')](_0xbd92('0x206'),_0xcf1208);loggerPredictive[_0xbd92('0x7a')](_0xbd92('0x20f'),_0x5e1294);loggerPredictive['info'](_0xbd92('0x207'),_0x1fecea);loggerPredictive[_0xbd92('0x7a')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x523cb0);loggerPredictive[_0xbd92('0x7a')](_0xbd92('0x82'));return new BPromise(function(_0x346a39,_0x3411f9){if(_0x4b32cd<=0x0||isNaN(_0x4b32cd)){return _0x3411f9(msgResponse(_0xbd92('0x210'),_0xbd92('0x183'),_0xbd92('0x20a')+_0x4b32cd));}if(_0x5e1294<=0x0||isNaN(_0x5e1294)){return _0x3411f9(msgResponse(_0xbd92('0x210'),'Error',_0xbd92('0x20b')+_0x5e1294));}if(_0x1fecea<=0x0||isNaN(_0x1fecea)){return _0x3411f9(msgResponse(_0xbd92('0x210'),_0xbd92('0x183'),_0xbd92('0x20c')+_0x1fecea));}if(_0xcf1208<=0x0||isNaN(_0xcf1208)){return _0x3411f9(msgResponse(_0xbd92('0x210'),_0xbd92('0x183'),'interval\x20=\x20'+_0xcf1208));}if(_0x523cb0<=0x0||isNaN(_0x523cb0)){return _0x3411f9(msgResponse('[busyFactor]',_0xbd92('0x183'),_0xbd92('0x211')+_0x523cb0));}_0xa3660a=_0xa3660a||0x0;var _0x1b5904=0x1/_0x5e1294;var _0x3901ed=0x0;var _0x5396f4=0x0;var _0x27a6e0=0x0;var _0x2a7365=0x0;for(var _0x370311=0x0;_0x2a7365<_0x523cb0;_0x370311+=0x1){_0x5396f4=_0x370311/_0xcf1208;_0x3901ed=(_0x1fecea*_0x5396f4+_0xa3660a)/_0x1b5904;_0x27a6e0=erlangb(_0x3901ed,_0x4b32cd);_0x2a7365=_0x3901ed/_0x4b32cd*(0x1-erlangb(_0x3901ed,_0x4b32cd));}return _0x346a39({'erlangCalls':_0x370311,'erlangCallToSecond':_0xcf1208/_0x370311,'erlangAbandonmentRate':_0x27a6e0,'erlangBusyFactor':_0x2a7365});});};module[_0xbd92('0x212')]=Dialer; \ No newline at end of file +var _0xf7fd=['sumBillable','sumDuration','talking','total','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startProgressive','Trunk','callerid','md5','format','voice:queue:%s','campaign:ivr:%s','campaign:save','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','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','clearing\x20variable\x20start\x20progressive','handlePredictive','clearing\x20variable\x20handle\x20predictive','ivr','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','length','hasOwnProperty','[decremetOriginate]\x20object\x20originated\x20is\x20negative','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','[getContactDialer2][Empty]','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','sendMessageOneNotActive','state','statedesc','endtime','starttime','prototype','clearZombieChannels','actions','[actions]','isNil','Action','status','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','countReScheduled','resolve','then','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','getContactDialerIvr','[getContactDialer]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','saveInDb','pick','ContactId','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','isTrunkReachable','active','SIP/%s','reachable','createHistory','uniqueid','variable','amdstatus','xcally-motion-dialer','dialAMDActive','HANGUP','outboundAnswerAgiCallsDay','HangupInAMD','membername','AMD','[syncHangupInAMD][createHistory]','MACHINE','outboundAnswerCallsDay','[syncMachine]','value','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','Machine','amd','[syncMachineIvr][createHistory]','[syncMachineIvr]','[syncHangupIvr][createHistory]','dialQueueProject','AGI','[syncHangupIvr]','cause-txt','Unknow','reason','agent','agiafterat','dialAgiAfterHangupAgent','YYYY-MM-DD\x20HH:mm:ss','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','[syncAgentComplete][createHistory]','[syncQueueCallerAbandon]\x20[Drop]','syncQueueCallerAbandon','droptime','dialQueueTimeout','Drop','dropreason','dialQueueProject2','countdropretry','dialDropMaxRetry','add','dialDropRetryFrequency','minutes','[rescheduleContact][Drop]','predictiveIntervalDroppedCallsCallersExit','CALLEREXIT','dialAbandonedMaxRetry','countabandonedretry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','channel','actionid','locked','paused','stateinterface','push','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','syncQueueStatusComplete','run','idHopper','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][unlock]','[booked][unlock2]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','TrunkBackup','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','isArray','iftime\x20%s,%s','interval','content','command','indexOf','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','dialPowerLevel','Queue','method\x20not\x20recognized','launchHandleIvr','checkIsTrunkReachable','dialGlobalInterval','dialTimezone','[syncQueueSummary]','syncCampaigns','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialer','getCaller','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','tags','createdAt','%s%s','XMD-','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','trim','dialCutDigit','substring','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','responsetime','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countmachineretry','countagentrejectretry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialMachineMaxRetry','dialMachineRetryFrequency','[rescheduleContact][Machine]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','entity\x20is\x20undefine','[callProgressDetecting]','NoSuchNumber','[syncAgentComplete][createHistory][0]','dialGlobalMaxRetry','stateGlobal','reason\x200\x20no\x20such\x20number....','createStateFinal','NoAnswer','countglobal','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','countbusyretry','reason\x205\x20busy','Congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','[syncAgentComplete][createHistory][11]','reason\x2011\x20abandoned','AgentReject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','outboundUnknownCallsDay','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','predictiveIntervalMaxThreshold','round','predictiveIntervalAvailable','predictiveIntervalMinThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','dialPredictiveInterval','started\x20in\x20predictive\x20at','getDataPredictive','recalculate\x20predictive\x20at','startMethodPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','dialPredictiveOptimizationPercentage','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','predictiveIntervalDroppedCallsTimeout','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','Agent','log','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','handleIvr','limitCalls','temp','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','Contact.phone','[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','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','Amax\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','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','p\x20=\x20','exports','lodash','uuid','ioredis','../../../config/environment/','../../../config/logger','booked','predictive','predictiveCalls','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./history','./final','./agentComplete','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','enqueue','tail','finally','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','contactsId','uniqueId','optionPredictive','startPredictive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','bind','originateresponse','agentcomplete','syncAgentComplete','custom:queuesummary','hangup','syncHangup','syncNewExten','syncVarSet','syncQueueMember','loopCampaigns','loopClearZombieChannels','isUndefined','AGENTS_NOT_LOGGED','name','NOT_ACTIVE','\x20NOT\x20Active','Interval','message','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','[ifTime][Action]','Error','stringify','milliseconds','diff','seconds','emit','type','outbound','strategy','answered','available','loggedIn','pTalking'];(function(_0x46eb14,_0x1b26b6){var _0x1cf264=function(_0x32fd98){while(--_0x32fd98){_0x46eb14['push'](_0x46eb14['shift']());}};_0x1cf264(++_0x1b26b6);}(_0xf7fd,0x1c3));var _0xdf7f=function(_0x1abb09,_0x18ee91){_0x1abb09=_0x1abb09-0x0;var _0xea1c07=_0xf7fd[_0x1abb09];return _0xea1c07;};'use strict';var util=require('util');var _=require(_0xdf7f('0x0'));var BPromise=require('bluebird');var uuid=require(_0xdf7f('0x1'));var moment=require('moment');var rr=require('rr');var md5=require('md5');var Redis=require(_0xdf7f('0x2'));var config=require(_0xdf7f('0x3'));var logger=require('../../../config/logger')('dialer');var loggerBooked=require(_0xdf7f('0x4'))(_0xdf7f('0x5'));var loggerPredictive=require('../../../config/logger')(_0xdf7f('0x6'));var loggerPredictiveCalls=require(_0xdf7f('0x4'))(_0xdf7f('0x7'));var loggerSyncQueueSummary=require(_0xdf7f('0x4'))(_0xdf7f('0x8'));var ami=require(_0xdf7f('0x9'));config[_0xdf7f('0xa')]=_[_0xdf7f('0xb')](config['redis'],{'host':_0xdf7f('0xc'),'port':0x18eb});var io=require(_0xdf7f('0xd'))(new Redis(config['redis']));var cmHopper=require(_0xdf7f('0xe'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0xdf7f('0xf'));var cmHopperBlack=require(_0xdf7f('0x10'));var voiceQueueRt=require(_0xdf7f('0x11'));var Action=require(_0xdf7f('0x12'));var History=require(_0xdf7f('0x13'));var Final=require(_0xdf7f('0x14'));var AgentComplete=require(_0xdf7f('0x15'));var QueueCallerAbandon=require(_0xdf7f('0x16'));var Hangup=require(_0xdf7f('0x17'));var ipAgi=process[_0xdf7f('0x18')][_0xdf7f('0x19')]||_0xdf7f('0x1a');var strategy={'rrmemory':_0xdf7f('0x1b'),'roundrobin':_0xdf7f('0x1c')};var Sequence=function(){};Sequence['prototype'][_0xdf7f('0x1d')]=function(_0x738dcd){this[_0xdf7f('0x1e')]=this[_0xdf7f('0x1e')]?this['tail'][_0xdf7f('0x1f')](_0x738dcd):_0x738dcd();};function Dialer(_0x37eb01,_0x90aaa8){this['sequence']=new Sequence();this[_0xdf7f('0x20')]=_0x90aaa8;this[_0xdf7f('0x21')]=_0x37eb01[_0xdf7f('0x21')];this[_0xdf7f('0x22')]=_0x37eb01[_0xdf7f('0x22')];this[_0xdf7f('0x23')]=_0x37eb01[_0xdf7f('0x23')];this[_0xdf7f('0x24')]=_0x37eb01['trunks'];this[_0xdf7f('0x25')]=config[_0xdf7f('0x25')]||0x2;this[_0xdf7f('0x26')]={};this['actions']={};this[_0xdf7f('0x27')]={};this[_0xdf7f('0x28')]={};this[_0xdf7f('0x29')]={};this[_0xdf7f('0x2a')]={};this['startProgressive']={};this[_0xdf7f('0x2b')]={};this[_0xdf7f('0x2c')]={};this[_0xdf7f('0x2d')]={};ami['on'](_0xdf7f('0x2e'),this[_0xdf7f('0x2f')]['bind'](this));ami['on']('queuecallerabandon',this['syncQueueCallerAbandon'][_0xdf7f('0x30')](this));ami['on'](_0xdf7f('0x31'),this['syncOriginateResponse'][_0xdf7f('0x30')](this));ami['on'](_0xdf7f('0x32'),this[_0xdf7f('0x33')][_0xdf7f('0x30')](this));ami['on'](_0xdf7f('0x34'),this[_0xdf7f('0x8')][_0xdf7f('0x30')](this));ami['on'](_0xdf7f('0x35'),this[_0xdf7f('0x36')][_0xdf7f('0x30')](this));ami['on']('newexten',this[_0xdf7f('0x37')][_0xdf7f('0x30')](this));ami['on']('varset',this[_0xdf7f('0x38')]['bind'](this));ami['on']('queuemember',this[_0xdf7f('0x39')][_0xdf7f('0x30')](this));ami['on']('queuestatuscomplete',this['syncQueueStatusComplete'][_0xdf7f('0x30')](this));this[_0xdf7f('0x3a')]();this[_0xdf7f('0x3b')]();}function isNotNull(_0x321314){return _0x321314!==null&&!_[_0xdf7f('0x3c')](_0x321314);}function checkIsLoggedIn(_0x4f8c26,_0x4711cc){return function(){if(_0x4711cc<=0x0){_0x4f8c26['message']=_0xdf7f('0x3d');throw _0x4f8c26[_0xdf7f('0x3e')]+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x2eb29d){return _0x2eb29d;}function checkIsActive(_0x3f9d16,_0x2907ea){return function(){if(!isActive(_0x2907ea)){_0x3f9d16['message']=_0xdf7f('0x3f');throw _0x3f9d16[_0xdf7f('0x3e')]+_0xdf7f('0x40');}};}function checkInterval(_0x3c6578){return function(){if(!isNotNull(_0x3c6578[_0xdf7f('0x41')])){_0x3c6578[_0xdf7f('0x42')]=_0xdf7f('0x43');throw _0x3c6578['name']+_0xdf7f('0x44');}if(!isNotNull(_0x3c6578[_0xdf7f('0x41')][_0xdf7f('0x45')])){_0x3c6578[_0xdf7f('0x42')]=_0xdf7f('0x43');throw _0x3c6578[_0xdf7f('0x3e')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0xdf7f('0x46')](_0x3c6578[_0xdf7f('0x41')]['Intervals']))){_0x3c6578[_0xdf7f('0x42')]='INTERVAL_IS_NULL';throw _0x3c6578[_0xdf7f('0x3e')]+_0xdf7f('0x44');}};}function msgResponse(_0x3288e3,_0x558e27,_0x5314a6){return{'action':_0x3288e3,'response':_0x558e27,'message':_0x5314a6,'stack':_0x5314a6};}function myreject(_0x2a2489){return function(_0x3e79f4){return _0x2a2489(msgResponse(_0xdf7f('0x47'),_0xdf7f('0x48'),JSON[_0xdf7f('0x49')](_0x3e79f4)));};}function getSeconds(_0x4e0d7f,_0x3291f3){var _0x319cd6=moment(_0x4e0d7f)['milliseconds'](0x0);var _0xc70fc5=moment(_0x3291f3)[_0xdf7f('0x4a')](0x0);return _0x319cd6[_0xdf7f('0x4b')](_0xc70fc5,_0xdf7f('0x4c'));}function emit(_0x3d46a1,_0x44993e,_0x54cef3){io['to'](_0x3d46a1)[_0xdf7f('0x4d')](_0x44993e,_0x54cef3);}function emitVoiceQueueSummary(_0x8dfb58){if(_0x8dfb58[_0xdf7f('0x4e')]===_0xdf7f('0x4f')){var _0x973adb={'id':_0x8dfb58['id'],'name':_0x8dfb58[_0xdf7f('0x3e')],'strategy':_0x8dfb58[_0xdf7f('0x50')],'answered':_0x8dfb58[_0xdf7f('0x51')],'available':_0x8dfb58[_0xdf7f('0x52')],'loggedIn':_0x8dfb58[_0xdf7f('0x53')],'pTalking':_0x8dfb58[_0xdf7f('0x54')],'sumBillable':_0x8dfb58[_0xdf7f('0x55')],'sumDuration':_0x8dfb58[_0xdf7f('0x56')],'sumHoldTime':_0x8dfb58['sumHoldTime']||0x0,'talking':_0x8dfb58[_0xdf7f('0x57')],'total':_0x8dfb58[_0xdf7f('0x58')],'type':_0x8dfb58[_0xdf7f('0x4e')],'unmanaged':_0x8dfb58['unmanaged'],'abandoned':_0x8dfb58[_0xdf7f('0x59')],'waiting':_0x8dfb58[_0xdf7f('0x5a')],'loggedInDb':_0x8dfb58[_0xdf7f('0x5b')],'dialActive':_0x8dfb58[_0xdf7f('0x5c')],'dialMethod':_0x8dfb58[_0xdf7f('0x5d')],'dialOriginateCallerIdName':_0x8dfb58[_0xdf7f('0x5e')],'dialOriginateCallerIdNumber':_0x8dfb58[_0xdf7f('0x5f')],'dialOriginateTimeout':_0x8dfb58[_0xdf7f('0x60')],'dialPrefix':_0x8dfb58[_0xdf7f('0x61')],'outboundAnswerAgiCallsDay':_0x8dfb58['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x8dfb58['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x8dfb58['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x8dfb58[_0xdf7f('0x62')],'outboundCongestionCallsDay':_0x8dfb58[_0xdf7f('0x63')],'outboundDropCallsDayACS':_0x8dfb58[_0xdf7f('0x64')],'outboundDropCallsDayCallersExit':_0x8dfb58[_0xdf7f('0x65')],'outboundDropCallsDayTimeout':_0x8dfb58[_0xdf7f('0x66')],'outboundNoAnswerCallsDay':_0x8dfb58[_0xdf7f('0x67')],'outboundNoSuchCallsDay':_0x8dfb58[_0xdf7f('0x68')],'outboundOriginateFailureCallsDay':_0x8dfb58[_0xdf7f('0x69')],'outboundReCallsDay':_0x8dfb58['outboundReCallsDay'],'outboundRejectCallsDay':_0x8dfb58[_0xdf7f('0x6a')],'outboundUnknownCallsDay':_0x8dfb58['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x8dfb58[_0xdf7f('0x6b')],'predictiveIntervalAvgHoldtime':_0x8dfb58[_0xdf7f('0x6c')],'predictiveIntervalAvgTalktime':_0x8dfb58['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x8dfb58['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x8dfb58['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x8dfb58[_0xdf7f('0x6d')],'predictiveIntervalErlangCallsDroppedCalls':_0x8dfb58[_0xdf7f('0x6e')],'predictiveIntervalHitRate':_0x8dfb58[_0xdf7f('0x6f')],'predictiveIntervalMultiplicativeFactor':_0x8dfb58[_0xdf7f('0x70')],'predictiveIntervalPauses':_0x8dfb58[_0xdf7f('0x71')],'predictiveIntervalAvailable':_0x8dfb58['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x8dfb58[_0xdf7f('0x72')],'message':_0x8dfb58['message'],'originated':_0x8dfb58[_0xdf7f('0x73')],'erlangCalls':_0x8dfb58[_0xdf7f('0x74')],'erlangCallToSecond':_0x8dfb58[_0xdf7f('0x75')],'erlangAbandonmentRate':_0x8dfb58[_0xdf7f('0x76')],'erlangBusyFactor':_0x8dfb58[_0xdf7f('0x77')],'startPredictive':_0x8dfb58[_0xdf7f('0x2a')],'startProgressive':_0x8dfb58[_0xdf7f('0x78')]};if(_0x8dfb58['Trunk']){_0x973adb[_0xdf7f('0x79')]={'id':_0x8dfb58['Trunk']['id'],'name':_0x8dfb58[_0xdf7f('0x79')][_0xdf7f('0x3e')],'active':_0x8dfb58['Trunk']['active'],'callerid':_0x8dfb58[_0xdf7f('0x79')][_0xdf7f('0x7a')]};}if(_0x8dfb58['Interval']){_0x973adb['Interval']={'id':_0x8dfb58[_0xdf7f('0x41')]['id'],'name':_0x8dfb58[_0xdf7f('0x41')]['name']};}var _0x1b5ad4=md5(JSON[_0xdf7f('0x49')](_0x973adb));if(_0x8dfb58[_0xdf7f('0x7b')]!==_0x1b5ad4){_0x8dfb58[_0xdf7f('0x7b')]=_0x1b5ad4;emit(util[_0xdf7f('0x7c')](_0xdf7f('0x7d'),_0x973adb[_0xdf7f('0x3e')]),'voice_queue:save',_0x973adb);}}}function emitCampaignSummary(_0x27541e){if(_0x27541e[_0xdf7f('0x4e')]==='ivr'){emit(util[_0xdf7f('0x7c')](_0xdf7f('0x7e'),_0x27541e[_0xdf7f('0x3e')]),_0xdf7f('0x7f'),_0x27541e);}}function checkGetDataPredictive(_0x20feb4){if(isNotNull(_0x20feb4)){if(!_[_0xdf7f('0x46')](_0x20feb4)){loggerPredictive[_0xdf7f('0x80')](_0xdf7f('0x81'));loggerPredictive[_0xdf7f('0x80')](_0xdf7f('0x82'),_0x20feb4[_0xdf7f('0x72')]);loggerPredictive[_0xdf7f('0x80')](_0xdf7f('0x83'),_0x20feb4[_0xdf7f('0x6b')]);loggerPredictive[_0xdf7f('0x80')](_0xdf7f('0x84'),_0x20feb4['predictiveIntervalDroppedCallsTimeout']);loggerPredictive['info'](_0xdf7f('0x85'),_0x20feb4['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive['info'](_0xdf7f('0x86'),_0x20feb4[_0xdf7f('0x6c')]);loggerPredictive[_0xdf7f('0x80')](_0xdf7f('0x87'),_0x20feb4[_0xdf7f('0x88')]);loggerPredictive['info'](_0xdf7f('0x89'));if(_0x20feb4[_0xdf7f('0x72')]>0x0){if(!_[_0xdf7f('0x3c')](_0x20feb4[_0xdf7f('0x88')])&&_0x20feb4['predictiveIntervalAvgTalktime']>0x0){return!![];}else{loggerPredictive['info']('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}if(!_[_0xdf7f('0x3c')](_0x20feb4[_0xdf7f('0x6c')])&&_0x20feb4[_0xdf7f('0x6c')]>0x0){return!![];}else{loggerPredictive['info'](_0xdf7f('0x8a'));}}else{loggerPredictive[_0xdf7f('0x80')](_0xdf7f('0x8b'));}}else{loggerPredictive[_0xdf7f('0x80')](_0xdf7f('0x8c'));}}else{loggerPredictive[_0xdf7f('0x80')](_0xdf7f('0x8c'));}return![];}function mergeDataErlangB(_0x34e359){return function(_0x5db851){loggerPredictive['info']('---------\x20ErlangB\x20---------');loggerPredictive[_0xdf7f('0x80')](_0xdf7f('0x8d'),_0x5db851[_0xdf7f('0x74')]);loggerPredictive[_0xdf7f('0x80')](_0xdf7f('0x8e'),_0x5db851[_0xdf7f('0x75')]);loggerPredictive[_0xdf7f('0x80')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5db851[_0xdf7f('0x76')]);loggerPredictive[_0xdf7f('0x80')](_0xdf7f('0x8f'),_0x5db851[_0xdf7f('0x77')]);loggerPredictive[_0xdf7f('0x80')](_0xdf7f('0x90'),_0x5db851[_0xdf7f('0x76')]);loggerPredictive[_0xdf7f('0x80')]('---------------------------');_[_0xdf7f('0x91')](_0x34e359,_0x5db851);};}function getDiff(_0x5aa1e3){var _0x24ab9f=moment()[_0xdf7f('0x4a')](0x0);var _0x32a0de=moment(_0x5aa1e3)['milliseconds'](0x0);return _0x24ab9f[_0xdf7f('0x4b')](_0x32a0de,_0xdf7f('0x4c'));}function ifInterval(_0x3f34a1,_0xf9f48b){if(_[_0xdf7f('0x3c')](_0xf9f48b)){return![];}if(getDiff(_0xf9f48b)<_0x3f34a1*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0x6027ad){if(isNotNull(_0x6027ad)){if(!_[_0xdf7f('0x3c')](_0x6027ad['startProgressive'])){_0x6027ad[_0xdf7f('0x78')]=undefined;loggerPredictive[_0xdf7f('0x80')](_0x6027ad[_0xdf7f('0x3e')],_0xdf7f('0x92'));}if(!_[_0xdf7f('0x3c')](_0x6027ad[_0xdf7f('0x2a')])){_0x6027ad[_0xdf7f('0x2a')]=undefined;loggerPredictive[_0xdf7f('0x80')](_0x6027ad[_0xdf7f('0x3e')],'clearing\x20variable\x20start\x20predictive');}if(!_['isUndefined'](_0x6027ad[_0xdf7f('0x93')])){clearInterval(_0x6027ad['handlePredictive']);_0x6027ad[_0xdf7f('0x93')]=undefined;loggerPredictive[_0xdf7f('0x80')](_0x6027ad[_0xdf7f('0x3e')],_0xdf7f('0x94'));}}}function erlangb(_0x299995,_0x10739c){if(_0x10739c===0x0){return 0x0;}var _0x51b404=0x1;for(var _0x3bcae1=0x1;_0x3bcae1<=_0x10739c;_0x3bcae1+=0x1){_0x51b404=0x1+_0x51b404*_0x3bcae1/_0x299995;}return 0x1/_0x51b404;}function isVoiceQueueOutbound(_0x22298b){return _0x22298b===_0xdf7f('0x4f');}function isNotPreview(_0x412ec6){return _0x412ec6!==_0xdf7f('0x20');}function isCampaignIvr(_0x38a984){return _0x38a984===_0xdf7f('0x95');}function getCallerId(_0x28f5b9,_0x176b39,_0x448578){if(!_[_0xdf7f('0x3c')](_0x448578)&&_0xdf7f('0x96')===typeof _0x448578&&!_['isEmpty'](_0x448578)){if(!_[_0xdf7f('0x3c')](_0x176b39)&&_0xdf7f('0x96')===typeof _0x176b39&&!_['isEmpty'](_0x176b39)){return util[_0xdf7f('0x7c')](_0xdf7f('0x97'),_0x176b39,_0x448578);}return util['format']('\x22%s\x22\x20<%s>',_0x448578,_0x448578);}if(!_['isUndefined'](_0x28f5b9)&&_0xdf7f('0x96')===typeof _0x28f5b9&&!_[_0xdf7f('0x46')](_0x28f5b9)){return _0x28f5b9;}return _0xdf7f('0x98');}function loggerCatchQueueSummary(_0x2e0909,_0x3cb186){return function(_0x4e8f48){freeVariablesPredictive(_0x3cb186);emitVoiceQueueSummary(_0x3cb186);emitCampaignSummary(_0x3cb186);loggerSyncQueueSummary[_0xdf7f('0x99')](_0x2e0909,util[_0xdf7f('0x9a')](_0x4e8f48,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x37a127,_0x2d0461){return function(_0x2d64a5){loggerPredictive[_0xdf7f('0x99')](_0x2d0461[_0xdf7f('0x3e')],_0x37a127);loggerPredictive[_0xdf7f('0x99')](_0x2d64a5[_0xdf7f('0x9b')]);freeVariablesPredictive(_0x2d0461);};}function loggerCatch(_0x1f56f8){return function(_0x2ff558){logger[_0xdf7f('0x99')](_0x1f56f8,util[_0xdf7f('0x9a')](_0x2ff558,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x152bc9){return _0x152bc9&&!_[_0xdf7f('0x3c')](_0x152bc9)&&_0x152bc9[_0xdf7f('0x9c')]>0x0;}function decremetOriginate(_0x3e9bed){if(!_[_0xdf7f('0x3c')](_0x3e9bed)&&_0x3e9bed!==null){if(_0x3e9bed[_0xdf7f('0x9d')](_0xdf7f('0x73'))){if(_0x3e9bed[_0xdf7f('0x73')]>0x0){_0x3e9bed[_0xdf7f('0x73')]-=0x1;}else{logger[_0xdf7f('0x99')](_0xdf7f('0x9e'));}}}else{logger[_0xdf7f('0x99')]('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x53902d,_0x1054ce,_0x3aa5ee){if(_0x1054ce>_0x3aa5ee){for(var _0x18de83=0x0;_0x18de83<_0x1054ce-_0x3aa5ee;_0x18de83+=0x1){decremetOriginate(_0x53902d);}}}function loggerGetContactDialer(_0x285149,_0x239169,_0x2be5cc){return function(_0x39e614){checkContactLowerLimitOriginate(_0x239169,_0x2be5cc,0x0);logger[_0xdf7f('0x99')](_0x285149,util[_0xdf7f('0x9a')](_0x39e614,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x5aff6f){return function(_0x1a9d08){if(isNotNull(_0x1a9d08)&&isNotNull(_0x1a9d08[0x0])){if(_0x1a9d08[0x0][_0xdf7f('0x9f')]>0x0){_0x5aff6f[_0xdf7f('0x42')]=_0xdf7f('0xa0');logger[_0xdf7f('0x80')](_0xdf7f('0xa1')+_0x5aff6f[_0xdf7f('0x3e')],_0x1a9d08[0x0][_0xdf7f('0x9f')],_0xdf7f('0xa2'));}else{_0x5aff6f[_0xdf7f('0x42')]='AVAILABLE_CONTACTS_FINISHED';logger[_0xdf7f('0x80')](_0xdf7f('0xa3')+_0x5aff6f['name']);}}};}function notSendMessagesQueue(_0x237626){if(_0x237626['sendMessageOneNotActive']){freeVariablesPredictive(_0x237626);if(_0x237626['originated']===0x0&&_0x237626[_0xdf7f('0x57')]===0x0&&_0x237626[_0xdf7f('0x5a')]===0x0&&(_0x237626['pTalking']||0x0)===0x0){_0x237626['sendMessageOneNotActive']=![];_0x237626[_0xdf7f('0x52')]=0x0;_0x237626[_0xdf7f('0x42')]='NOT_ACTIVE';loggerSyncQueueSummary[_0xdf7f('0x99')](_0xdf7f('0xa4'),_0x237626[_0xdf7f('0x3e')],_0xdf7f('0xa5'));}else{_0x237626[_0xdf7f('0x42')]=_0xdf7f('0xa6');loggerSyncQueueSummary[_0xdf7f('0x99')](_0xdf7f('0xa4'),_0x237626[_0xdf7f('0x3e')],_0xdf7f('0xa7'));}emitVoiceQueueSummary(_0x237626);}}function notSendMessagesCampaign(_0x1a5c65){if(_0x1a5c65[_0xdf7f('0xa8')]){if(_0x1a5c65[_0xdf7f('0x73')]===0x0){_0x1a5c65[_0xdf7f('0xa8')]=![];_0x1a5c65[_0xdf7f('0x42')]=_0xdf7f('0x3f');loggerSyncQueueSummary['error']('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x1a5c65['name'],_0xdf7f('0xa5'));}else{_0x1a5c65[_0xdf7f('0x42')]=_0xdf7f('0xa6');loggerSyncQueueSummary['error']('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x1a5c65[_0xdf7f('0x3e')],_0xdf7f('0xa7'));}emitCampaignSummary(_0x1a5c65);}}function createObjHistory(_0x24d101,_0x952d91,_0x54b4c0,_0x189fdd,_0x3c4677){_0x24d101[_0xdf7f('0x42')]=_0x54b4c0;var _0x2a254e=new Action(_0x24d101,_0x952d91);var _0x3ecf52=new History(_0x2a254e);_0x3ecf52[_0xdf7f('0xa9')]=_0x189fdd;_0x3ecf52[_0xdf7f('0xaa')]=_0x3c4677;_0x3ecf52[_0xdf7f('0xab')]=_0x2a254e[_0xdf7f('0xac')];return _0x3ecf52;}Dialer[_0xdf7f('0xad')]['loopClearZombieChannels']=function(){var _0x8c4fa0=this;setInterval(function(){_0x8c4fa0[_0xdf7f('0xae')](_0x8c4fa0[_0xdf7f('0x28')],'[uniqueid]');_0x8c4fa0[_0xdf7f('0xae')](_0x8c4fa0[_0xdf7f('0xaf')],_0xdf7f('0xb0'));},0x32c8);};Dialer['prototype'][_0xdf7f('0xae')]=function(_0x30ad53,_0x12e255){var _0x2cfac7=this;for(var _0x187291 in _0x30ad53){if(_0x30ad53[_0xdf7f('0x9d')](_0x187291)){this['sequence']['enqueue'](function(){if(!_[_0xdf7f('0xb1')](_0x30ad53[_0x187291])){return ami[_0xdf7f('0xb2')]({'action':_0xdf7f('0xb3'),'channel':_0x30ad53[_0x187291]['channel']})[_0xdf7f('0xb4')](function(_0x552cf3){if(_0x552cf3['message']===_0xdf7f('0xb5')){setTimeout(function(){if(_0x30ad53[_0x187291]&&_0x30ad53[_0x187291][_0xdf7f('0x4e')]!==_0xdf7f('0x95')){_0x2cfac7[_0xdf7f('0xb6')](_0x2cfac7[_0xdf7f('0x21')][_0x30ad53[_0x187291][_0xdf7f('0xb7')]]);logger[_0xdf7f('0x99')](_0xdf7f('0xb8'),_0x12e255,_0x187291,_0x30ad53[_0x187291][_0xdf7f('0xb7')]);delete _0x30ad53[_0x187291];}if(_0x30ad53[_0x187291]&&_0x30ad53[_0x187291]['type']==='ivr'){_0x2cfac7['updateOriginated'](_0x2cfac7[_0xdf7f('0x22')][_0x30ad53[_0x187291]['queue']]);logger[_0xdf7f('0x99')]('[Dialer][checkChannel][ivr]',_0x12e255,_0x187291,_0x30ad53[_0x187291]['queue']);delete _0x30ad53[_0x187291];}},0x2328);}});}});}}};Dialer[_0xdf7f('0xad')][_0xdf7f('0xb9')]=function(_0x3f4d39){return BPromise[_0xdf7f('0xba')]()[_0xdf7f('0xbb')](cmHopper[_0xdf7f('0xb9')](_0x3f4d39))[_0xdf7f('0xb4')](loggerCatch(_0xdf7f('0xbc')));};Dialer['prototype'][_0xdf7f('0xbd')]=function(_0x34c720){return BPromise['resolve']()[_0xdf7f('0xbb')](cmHopperBlack[_0xdf7f('0xbd')](_0x34c720))[_0xdf7f('0xb4')](loggerCatch(_0xdf7f('0xbe')));};Dialer['prototype'][_0xdf7f('0xbf')]=function(_0x3debc0){return BPromise[_0xdf7f('0xba')]()['then'](cmHopperBlack[_0xdf7f('0xbf')](_0x3debc0))['catch'](loggerCatch('[checkIsBlackListIvr]\x20'));};Dialer[_0xdf7f('0xad')][_0xdf7f('0xc0')]=function(_0xa08272){return BPromise[_0xdf7f('0xba')]()[_0xdf7f('0xbb')](cmHopperHistory[_0xdf7f('0xc1')](_0xa08272))[_0xdf7f('0xb4')](loggerCatch(_0xdf7f('0xc2')));};Dialer[_0xdf7f('0xad')][_0xdf7f('0xc3')]=function(_0x4a50b6){return BPromise[_0xdf7f('0xba')]()[_0xdf7f('0xbb')](cmHopper[_0xdf7f('0xc3')](_0x4a50b6))[_0xdf7f('0xb4')](loggerCatch(_0xdf7f('0xc4')));};Dialer[_0xdf7f('0xad')][_0xdf7f('0xc5')]=function(_0x4e4fd7,_0x5b223c,_0x50fe10){return BPromise[_0xdf7f('0xba')]()[_0xdf7f('0xbb')](cmHopper[_0xdf7f('0xc5')](_0x4e4fd7,_0x5b223c,_0x50fe10))[_0xdf7f('0xb4')](loggerCatch(_0xdf7f('0xc6')));};Dialer[_0xdf7f('0xad')]['getContactDialer']=function(_0x14bdd5,_0x44f7ff,_0x559ecd,_0x4290af){return BPromise[_0xdf7f('0xba')]()[_0xdf7f('0xbb')](cmHopper[_0xdf7f('0xc7')](_0x14bdd5,_0x44f7ff,_0x559ecd,_0x4290af))[_0xdf7f('0xb4')](loggerCatch('[getContactDialer]\x20'));};Dialer['prototype'][_0xdf7f('0xc8')]=function(_0x53891d,_0x1c9ee3,_0x4550c0){return BPromise[_0xdf7f('0xba')]()[_0xdf7f('0xbb')](cmHopper['getContactDialerIvr'](_0x53891d,_0x1c9ee3,_0x4550c0))[_0xdf7f('0xb4')](loggerCatch(_0xdf7f('0xc9')));};Dialer[_0xdf7f('0xad')][_0xdf7f('0xca')]=function(_0x770b02){return BPromise[_0xdf7f('0xba')]()[_0xdf7f('0xbb')](voiceQueueRt[_0xdf7f('0xca')](_0x770b02))[_0xdf7f('0xb4')](loggerCatch(_0xdf7f('0xcb')));};Dialer[_0xdf7f('0xad')]['moveContactManagedDialer']=function(_0x29f5ea){return BPromise[_0xdf7f('0xba')]()[_0xdf7f('0xbb')](cmHopper[_0xdf7f('0xcc')](_0x29f5ea))[_0xdf7f('0xb4')](loggerCatch(_0xdf7f('0xcd')));};Dialer[_0xdf7f('0xad')]['createHistory']=function(_0x155921){return BPromise[_0xdf7f('0xba')]()[_0xdf7f('0xbb')](cmHopperHistory['createHistory'](_0x155921))[_0xdf7f('0xb4')](loggerCatch(_0xdf7f('0xce')));};Dialer['prototype']['updateOriginated']=function(_0x3507e5){if(!_[_0xdf7f('0x3c')](_0x3507e5)&&_0x3507e5!==null){if(_0x3507e5[_0xdf7f('0x9d')](_0xdf7f('0x73'))){if(_0x3507e5[_0xdf7f('0x73')]>0x0){_0x3507e5[_0xdf7f('0x73')]-=0x1;}else{logger['error'](_0xdf7f('0xcf'));}}}else{logger['error'](_0xdf7f('0xd0'));}};Dialer[_0xdf7f('0xad')][_0xdf7f('0xd1')]=function(_0x13a4e5,_0x5cb216){var _0x350685=this;return function(_0x2c4522){_0x350685['updateOriginated'](_0x5cb216);logger[_0xdf7f('0x99')](_0x13a4e5,util[_0xdf7f('0x9a')](_0x2c4522,{'showHidden':![],'depth':null}));};};Dialer[_0xdf7f('0xad')][_0xdf7f('0xd2')]=function(_0xfa4193,_0x38ae2e,_0x4c8495){var _0x4ebab5={'state':0x19,'statedesc':'notFound'};this[_0xdf7f('0xb6')](_0x38ae2e);this[_0xdf7f('0xd3')](_[_0xdf7f('0x91')](_0x4ebab5,_[_0xdf7f('0xd4')](_0x4c8495,[_0xdf7f('0xd5'),_0xdf7f('0xd6'),_0xdf7f('0xd7'),_0xdf7f('0xd8'),_0xdf7f('0xd9')])),_0xdf7f('0xda'),_0xdf7f('0xdb'));logger[_0xdf7f('0x99')](_0xfa4193);};Dialer[_0xdf7f('0xad')][_0xdf7f('0xdc')]=function(_0x11e697){return _0x11e697===_0xdf7f('0xdd');};Dialer[_0xdf7f('0xad')][_0xdf7f('0xde')]=function(_0x3d324d){return!_['isUndefined'](_0x3d324d)&&_0x3d324d&&!_[_0xdf7f('0x3c')](_0x3d324d[_0xdf7f('0x3e')])&&!_[_0xdf7f('0x3c')](_0x3d324d['active'])&&_0x3d324d[_0xdf7f('0xdf')]&&(this[_0xdf7f('0x24')][util[_0xdf7f('0x7c')](_0xdf7f('0xe0'),_0x3d324d[_0xdf7f('0x3e')])][_0xdf7f('0xb3')]===_0xdf7f('0xe1')||this[_0xdf7f('0x24')][util[_0xdf7f('0x7c')]('SIP/%s',_0x3d324d[_0xdf7f('0x3e')])]['status']==='unmonitored');};Dialer[_0xdf7f('0xad')][_0xdf7f('0xd3')]=function(_0x5838eb,_0x2f3273,_0x88c861){this[_0xdf7f('0xe2')](_0x5838eb)[_0xdf7f('0xb4')](loggerCatch(_0x2f3273));this[_0xdf7f('0xcc')](_0x5838eb)['catch'](loggerCatch(_0x88c861));};Dialer['prototype']['syncVarSet']=function(_0x4d7015){var _0x34f0a7=this[_0xdf7f('0x28')][_0x4d7015[_0xdf7f('0xe3')]];var _0x593884;if(!_['isNil'](_0x4d7015)&&!_['isNil'](_0x4d7015[_0xdf7f('0xe4')])&&!_[_0xdf7f('0xb1')](_0x4d7015[_0xdf7f('0xe4')][_0xdf7f('0xe5')])&&_0x4d7015['exten']===_0xdf7f('0xe6')&&_0x34f0a7){if(_0x34f0a7[_0xdf7f('0x4e')]!==_0xdf7f('0x95')&&this[_0xdf7f('0x21')][_0x34f0a7[_0xdf7f('0xb7')]][_0xdf7f('0xe7')]&&_0x4d7015['value']===_0xdf7f('0xe8')){delete this[_0xdf7f('0x28')][_0x4d7015[_0xdf7f('0xe3')]];this[_0xdf7f('0xb6')](this['voiceQueues'][_0x34f0a7[_0xdf7f('0xb7')]]);this[_0xdf7f('0x21')][_0x34f0a7['queue']]['outboundAnswerCallsDay']+=0x1;this[_0xdf7f('0x21')][_0x34f0a7[_0xdf7f('0xb7')]][_0xdf7f('0xe9')]+=0x1;_0x593884=new Hangup(_0x34f0a7,_0x4d7015);_0x593884[_0xdf7f('0xa9')]=0x12;_0x593884[_0xdf7f('0xaa')]=_0xdf7f('0xea');_0x593884[_0xdf7f('0xeb')]=_0xdf7f('0xec');this[_0xdf7f('0xd3')](_0x593884,_0xdf7f('0xed'),'[syncHangupInAMD]');}if(_0x34f0a7[_0xdf7f('0x4e')]!==_0xdf7f('0x95')&&this[_0xdf7f('0x21')][_0x34f0a7['queue']][_0xdf7f('0xe7')]&&_0x4d7015['value']===_0xdf7f('0xee')){delete this['uniqueId'][_0x4d7015['uniqueid']];this[_0xdf7f('0xb6')](this['voiceQueues'][_0x34f0a7[_0xdf7f('0xb7')]]);this['voiceQueues'][_0x34f0a7[_0xdf7f('0xb7')]][_0xdf7f('0xef')]+=0x1;this[_0xdf7f('0x21')][_0x34f0a7[_0xdf7f('0xb7')]]['outboundAnswerAgiCallsDay']+=0x1;_0x593884=new Hangup(_0x34f0a7,_0x4d7015);_0x593884[_0xdf7f('0xa9')]=0x13;_0x593884[_0xdf7f('0xaa')]='Machine';_0x593884[_0xdf7f('0xeb')]=_0xdf7f('0xec');_0x593884['amd']=!![];this['saveInDb'](_0x593884,'[syncMachine][createHistory]',_0xdf7f('0xf0'));}if(_0x34f0a7[_0xdf7f('0x4e')]===_0xdf7f('0x95')&&this[_0xdf7f('0x22')][_0x34f0a7[_0xdf7f('0xb7')]]['dialAMDActive']&&_0x4d7015[_0xdf7f('0xf1')]===_0xdf7f('0xe8')){delete this[_0xdf7f('0x28')][_0x4d7015['uniqueid']];this[_0xdf7f('0xb6')](this['campaigns'][_0x34f0a7[_0xdf7f('0xb7')]]);_0x593884=new Hangup(_0x34f0a7,_0x4d7015);_0x593884['state']=0x12;_0x593884[_0xdf7f('0xaa')]='HangupInAMD';_0x593884['membername']=_0xdf7f('0xec');this[_0xdf7f('0xd3')](_0x593884,_0xdf7f('0xf2'),_0xdf7f('0xf3'));}if(_0x34f0a7['type']===_0xdf7f('0x95')&&this[_0xdf7f('0x22')][_0x34f0a7[_0xdf7f('0xb7')]][_0xdf7f('0xe7')]&&_0x4d7015['value']===_0xdf7f('0xee')){delete this[_0xdf7f('0x28')][_0x4d7015['uniqueid']];this[_0xdf7f('0xb6')](this[_0xdf7f('0x22')][_0x34f0a7['queue']]);_0x593884=new Hangup(_0x34f0a7,_0x4d7015);_0x593884[_0xdf7f('0xa9')]=0x13;_0x593884['statedesc']=_0xdf7f('0xf4');_0x593884[_0xdf7f('0xeb')]=_0xdf7f('0xec');_0x593884[_0xdf7f('0xf5')]=!![];this[_0xdf7f('0xd3')](_0x593884,_0xdf7f('0xf6'),_0xdf7f('0xf7'));}}};Dialer[_0xdf7f('0xad')]['syncHangup']=function(_0x1c8b86){var _0x2a2c82=this['uniqueId'][_0x1c8b86[_0xdf7f('0xe3')]];var _0x24e878=this;var _0x84f21;if(_0x2a2c82&&_0x2a2c82[_0xdf7f('0x4e')]==='ivr'){delete this['uniqueId'][_0x1c8b86[_0xdf7f('0xe3')]];this[_0xdf7f('0xb6')](this['campaigns'][_0x2a2c82[_0xdf7f('0xb7')]]);this['campaigns'][_0x2a2c82['queue']]['ivrAnswerCallsDay']+=0x1;_0x84f21=new Hangup(_0x2a2c82,_0x1c8b86);this[_0xdf7f('0xe2')](_0x84f21)[_0xdf7f('0xb4')](loggerCatch(_0xdf7f('0xf8')));this[_0xdf7f('0xcc')](_0x84f21)[_0xdf7f('0xb4')](loggerCatch('[syncHangupIvr]'));}if(_0x2a2c82&&_0x2a2c82[_0xdf7f('0x4e')]!==_0xdf7f('0x95')&&isNotNull(this['voiceQueues'][_0x2a2c82[_0xdf7f('0xb7')]][_0xdf7f('0xf9')])){delete this[_0xdf7f('0x28')][_0x1c8b86[_0xdf7f('0xe3')]];this[_0xdf7f('0xb6')](this['voiceQueues'][_0x2a2c82[_0xdf7f('0xb7')]]);this[_0xdf7f('0x21')][_0x2a2c82['queue']][_0xdf7f('0xef')]+=0x1;this[_0xdf7f('0x21')][_0x2a2c82[_0xdf7f('0xb7')]][_0xdf7f('0xe9')]+=0x1;_0x84f21=new Hangup(_0x2a2c82,_0x1c8b86);_0x84f21['state']=0x10;_0x84f21[_0xdf7f('0xaa')]='AnswerAGI';_0x84f21[_0xdf7f('0xeb')]=_0xdf7f('0xfa');this[_0xdf7f('0xe2')](_0x84f21)[_0xdf7f('0xb4')](loggerCatch(_0xdf7f('0xf8')));this[_0xdf7f('0xcc')](_0x84f21)[_0xdf7f('0xb4')](loggerCatch(_0xdf7f('0xfb')));}if(_0x2a2c82&&_0x2a2c82[_0xdf7f('0x4e')]!==_0xdf7f('0x95')&&!isNotNull(this['voiceQueues'][_0x2a2c82[_0xdf7f('0xb7')]][_0xdf7f('0xf9')])){delete this[_0xdf7f('0x28')][_0x1c8b86[_0xdf7f('0xe3')]];this[_0xdf7f('0xb6')](this['voiceQueues'][_0x2a2c82[_0xdf7f('0xb7')]]);this[_0xdf7f('0x21')][_0x2a2c82[_0xdf7f('0xb7')]]['outboundUnknownCallsDay']+=0x1;_0x84f21=new Hangup(_0x2a2c82,_0x1c8b86);_0x84f21[_0xdf7f('0xa9')]=0xc;_0x84f21[_0xdf7f('0xaa')]=_0x1c8b86[_0xdf7f('0xfc')];_0x84f21[_0xdf7f('0xeb')]=_0xdf7f('0xfd');this[_0xdf7f('0xe2')](_0x84f21)[_0xdf7f('0xb4')](loggerCatch(_0xdf7f('0xf8')));this[_0xdf7f('0xcc')](_0x84f21)[_0xdf7f('0xb4')](loggerCatch(_0xdf7f('0xfb')));}};Dialer[_0xdf7f('0xad')][_0xdf7f('0x33')]=function(_0x315953){var _0x157f12=this['uniqueId'][_0x315953[_0xdf7f('0xe3')]];var _0x4a8ed6=this;if(this[_0xdf7f('0x21')][_0x315953[_0xdf7f('0xb7')]]){if(_0x157f12&&_0x157f12[_0xdf7f('0x4e')]!==_0xdf7f('0x95')){delete this[_0xdf7f('0x28')][_0x315953[_0xdf7f('0xe3')]];this[_0xdf7f('0x21')][_0x315953[_0xdf7f('0xb7')]]['outboundAnswerCallsDay']+=0x1;var _0x565303=new AgentComplete(_0x157f12,_0x315953);if(_0x315953[_0xdf7f('0xfe')]===_0xdf7f('0xff')){_0x565303[_0xdf7f('0x100')]=this[_0xdf7f('0x21')][_0x315953[_0xdf7f('0xb7')]]['dialQueueProject2']&&this[_0xdf7f('0x21')][_0x315953[_0xdf7f('0xb7')]][_0xdf7f('0x101')]?moment()[_0xdf7f('0x7c')](_0xdf7f('0x102')):undefined;}this[_0xdf7f('0xe2')](_0x565303)['catch'](loggerCatch('[syncAgentComplete][createHistory]'));this[_0xdf7f('0xcc')](_0x565303)[_0xdf7f('0xb4')](loggerCatch(_0xdf7f('0x103')));}}};Dialer['prototype'][_0xdf7f('0x2f')]=function(_0x413eb3){if(this['voiceQueues'][_0x413eb3[_0xdf7f('0xb7')]]){if(this[_0xdf7f('0x28')][_0x413eb3['uniqueid']]&&this['uniqueId'][_0x413eb3[_0xdf7f('0xe3')]][_0xdf7f('0x4e')]!==_0xdf7f('0x95')){this[_0xdf7f('0xb6')](this['voiceQueues'][_0x413eb3[_0xdf7f('0xb7')]]);this[_0xdf7f('0x28')][_0x413eb3[_0xdf7f('0xe3')]][_0xdf7f('0x104')]=moment()[_0xdf7f('0x7c')](_0xdf7f('0x102'));}}};Dialer['prototype'][_0xdf7f('0x105')]=function(_0x10e2ba){this[_0xdf7f('0xe2')](_0x10e2ba)[_0xdf7f('0xb4')](loggerCatch(_0xdf7f('0x106')));this[_0xdf7f('0xcc')](_0x10e2ba)[_0xdf7f('0xb4')](loggerCatch(_0xdf7f('0x107')));};Dialer[_0xdf7f('0xad')][_0xdf7f('0x108')]=function(_0x36623b){var _0x5f20ff=this['uniqueId'][_0x36623b[_0xdf7f('0xe3')]];var _0x4b886a=this;if(this[_0xdf7f('0x21')][_0x36623b[_0xdf7f('0xb7')]]){if(_0x5f20ff&&_0x5f20ff[_0xdf7f('0x4e')]!==_0xdf7f('0x95')){delete this[_0xdf7f('0x28')][_0x36623b['uniqueid']];this['updateOriginated'](this[_0xdf7f('0x21')][_0x36623b['queue']]);_0x5f20ff[_0xdf7f('0x109')]=moment()[_0xdf7f('0x7c')]('YYYY-MM-DD\x20HH:mm:ss');var _0x45a134=new QueueCallerAbandon(_0x5f20ff,_0x36623b);if(getSeconds(_0x5f20ff[_0xdf7f('0x109')],_0x5f20ff['responsetime'])>=_0x5f20ff[_0xdf7f('0x10a')]){this['voiceQueues'][_0x36623b['queue']]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0xdf7f('0x21')][_0x36623b[_0xdf7f('0xb7')]][_0xdf7f('0x66')]+=0x1;this['voiceQueues'][_0x36623b[_0xdf7f('0xb7')]]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x45a134[_0xdf7f('0xa9')]=0xa;_0x45a134[_0xdf7f('0xaa')]=_0xdf7f('0x10b');_0x45a134[_0xdf7f('0x10c')]='TIMEOUT';_0x45a134[_0xdf7f('0x100')]=this['voiceQueues'][_0x36623b[_0xdf7f('0xb7')]][_0xdf7f('0x10d')]?moment()[_0xdf7f('0x7c')](_0xdf7f('0x102')):undefined;if(_0x45a134[_0xdf7f('0x10e')]>=this[_0xdf7f('0x21')][_0x36623b[_0xdf7f('0xb7')]][_0xdf7f('0x10f')]-0x1){this[_0xdf7f('0x105')](_0x45a134);}else{this['rescheduleContact']({'active':![],'countdropretry':_0x45a134[_0xdf7f('0x10e')]+=0x1,'scheduledat':moment()[_0xdf7f('0x110')](this[_0xdf7f('0x21')][_0x36623b[_0xdf7f('0xb7')]][_0xdf7f('0x111')],_0xdf7f('0x112'))[_0xdf7f('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x5f20ff[_0xdf7f('0xd5')],'ListId':_0x5f20ff['ListId'],'VoiceQueueId':_0x5f20ff[_0xdf7f('0xd8')]||undefined,'CampaignId':_0x5f20ff[_0xdf7f('0xd9')]||undefined})['catch'](loggerCatch(_0xdf7f('0x113')));}}else{this[_0xdf7f('0x21')][_0x36623b[_0xdf7f('0xb7')]][_0xdf7f('0x114')]+=0x1;this[_0xdf7f('0x21')][_0x36623b[_0xdf7f('0xb7')]][_0xdf7f('0x65')]+=0x1;_0x45a134['state']=0xb;_0x45a134[_0xdf7f('0xaa')]='Abandoned';_0x45a134[_0xdf7f('0x10c')]=_0xdf7f('0x115');if(_0x45a134['countabandonedretry']>=this['voiceQueues'][_0x36623b[_0xdf7f('0xb7')]][_0xdf7f('0x116')]-0x1){this[_0xdf7f('0x105')](_0x45a134);}else{this['rescheduleContact']({'active':![],'countabandonedretry':_0x45a134[_0xdf7f('0x117')]+=0x1,'scheduledat':moment()['add'](this['voiceQueues'][_0x36623b[_0xdf7f('0xb7')]][_0xdf7f('0x118')],_0xdf7f('0x112'))['format'](_0xdf7f('0x102')),'ContactId':_0x5f20ff['ContactId'],'ListId':_0x5f20ff['ListId'],'VoiceQueueId':_0x5f20ff['VoiceQueueId']||undefined,'CampaignId':_0x5f20ff[_0xdf7f('0xd9')]||undefined})[_0xdf7f('0xb4')](loggerCatch(_0xdf7f('0x119')));}}}}};Dialer['prototype']['syncNewExten']=function(_0x58f9a0){if(this[_0xdf7f('0xaf')][_0x58f9a0[_0xdf7f('0xe3')]]){this[_0xdf7f('0xaf')][_0x58f9a0[_0xdf7f('0xe3')]]['channel']=_0x58f9a0[_0xdf7f('0x11a')];}if(this[_0xdf7f('0x28')][_0x58f9a0[_0xdf7f('0xe3')]]){this['uniqueId'][_0x58f9a0[_0xdf7f('0xe3')]]['channel']=_0x58f9a0[_0xdf7f('0x11a')];}};Dialer['prototype'][_0xdf7f('0x39')]=function(_0x4990f3){if(strategy[this['voiceQueues'][this[_0xdf7f('0xaf')][_0x4990f3['actionid']][_0xdf7f('0xb7')]]['strategy']]===_0xdf7f('0x1c')){if(this[_0xdf7f('0xaf')][_0x4990f3[_0xdf7f('0x11b')]]&&_['isNil'](this[_0xdf7f('0xaf')][_0x4990f3[_0xdf7f('0x11b')]][_0xdf7f('0x11c')])&&_0x4990f3['status']==='1'&&_0x4990f3[_0xdf7f('0x11d')]==='0'){if(this[_0xdf7f('0x23')][_0x4990f3[_0xdf7f('0x11e')]]){if(!this[_0xdf7f('0x23')][_0x4990f3[_0xdf7f('0x11e')]][_0xdf7f('0x11c')]){this[_0xdf7f('0x23')][_0x4990f3['stateinterface']][_0xdf7f('0x11c')]=!![];this[_0xdf7f('0xaf')][_0x4990f3[_0xdf7f('0x11b')]][_0xdf7f('0x11c')]=!![];this['actions'][_0x4990f3['actionid']][_0xdf7f('0x11e')]=_0x4990f3[_0xdf7f('0x11e')];}}}}else if((strategy[this[_0xdf7f('0x21')][this[_0xdf7f('0xaf')][_0x4990f3[_0xdf7f('0x11b')]][_0xdf7f('0xb7')]][_0xdf7f('0x50')]]||_0xdf7f('0x1b'))===_0xdf7f('0x1b')){if(this['actions'][_0x4990f3[_0xdf7f('0x11b')]]){if(this[_0xdf7f('0x23')][_0x4990f3[_0xdf7f('0x11e')]]){this[_0xdf7f('0xaf')][_0x4990f3[_0xdf7f('0x11b')]][_0xdf7f('0x11e')]=_0x4990f3[_0xdf7f('0x11e')];if(_[_0xdf7f('0xb1')](this[_0xdf7f('0x2c')][this['actions'][_0x4990f3[_0xdf7f('0x11b')]][_0xdf7f('0xb7')]])){this[_0xdf7f('0x2c')][this[_0xdf7f('0xaf')][_0x4990f3[_0xdf7f('0x11b')]][_0xdf7f('0xb7')]]=[];}this[_0xdf7f('0x2c')][this[_0xdf7f('0xaf')][_0x4990f3['actionid']][_0xdf7f('0xb7')]][_0xdf7f('0x11f')](_[_0xdf7f('0x91')](_[_0xdf7f('0xd4')](this[_0xdf7f('0xaf')][_0x4990f3['actionid']],['idHopper','stateinterface']),{'status':_0x4990f3[_0xdf7f('0xb3')],'paused':_0x4990f3[_0xdf7f('0x11d')]}));}}}};function unlockQueueStatus(_0x4a0f78,_0x34a7d1){setTimeout(function(){if(_[_0xdf7f('0x3c')](_0x4a0f78[_0xdf7f('0x120')])){loggerBooked[_0xdf7f('0x99')](_0xdf7f('0x121'),_0x34a7d1);}_0x4a0f78[_0xdf7f('0x120')]=!![];loggerBooked[_0xdf7f('0x80')](_0xdf7f('0x122'),_0x34a7d1,JSON[_0xdf7f('0x49')](_[_0xdf7f('0xd4')](_0x4a0f78,[_0xdf7f('0x3e'),_0xdf7f('0x120')])));},0x1f3);}Dialer[_0xdf7f('0xad')][_0xdf7f('0x123')]=function(_0x2ef3fa){var _0x25399f=this;var _0xa563e0=_0x25399f[_0xdf7f('0x21')][_0x25399f[_0xdf7f('0xaf')][_0x2ef3fa[_0xdf7f('0x11b')]][_0xdf7f('0xb7')]];if(strategy[this['voiceQueues'][this[_0xdf7f('0xaf')][_0x2ef3fa[_0xdf7f('0x11b')]][_0xdf7f('0xb7')]][_0xdf7f('0x50')]]===_0xdf7f('0x1c')){if(this[_0xdf7f('0xaf')][_0x2ef3fa[_0xdf7f('0x11b')]]&&this['actions'][_0x2ef3fa[_0xdf7f('0x11b')]]['stateinterface']){this[_0xdf7f('0x20')][_0xdf7f('0x124')](this['actions'][_0x2ef3fa[_0xdf7f('0x11b')]][_0xdf7f('0x125')],this['actions'][_0x2ef3fa[_0xdf7f('0x11b')]][_0xdf7f('0x11e')])[_0xdf7f('0xb4')](function(_0x3aad3c){logger[_0xdf7f('0x99')](_0xdf7f('0x126'),util[_0xdf7f('0x9a')](_0x3aad3c,{'showHidden':![],'depth':null}));})['finally'](function(){_0x25399f[_0xdf7f('0xb6')](_0x25399f[_0xdf7f('0x21')][_0x25399f[_0xdf7f('0xaf')][_0x2ef3fa[_0xdf7f('0x11b')]]['queue']]);_0x25399f[_0xdf7f('0x23')][_0x25399f[_0xdf7f('0xaf')][_0x2ef3fa[_0xdf7f('0x11b')]][_0xdf7f('0x11e')]][_0xdf7f('0x11c')]=![];delete _0x25399f[_0xdf7f('0xaf')][_0x2ef3fa[_0xdf7f('0x11b')]];unlockQueueStatus(_0xa563e0);});}else{this[_0xdf7f('0xb6')](this[_0xdf7f('0x21')][this[_0xdf7f('0xaf')][_0x2ef3fa[_0xdf7f('0x11b')]]['queue']]);this[_0xdf7f('0xc3')]({'active':![],'ContactId':this[_0xdf7f('0xaf')][_0x2ef3fa[_0xdf7f('0x11b')]]['ContactId'],'ListId':this[_0xdf7f('0xaf')][_0x2ef3fa[_0xdf7f('0x11b')]]['ListId'],'VoiceQueueId':this[_0xdf7f('0xaf')][_0x2ef3fa[_0xdf7f('0x11b')]][_0xdf7f('0xd8')]||undefined,'CampaignId':this[_0xdf7f('0xaf')][_0x2ef3fa[_0xdf7f('0x11b')]][_0xdf7f('0xd9')]||undefined})[_0xdf7f('0xb4')](loggerCatch(_0xdf7f('0x127')));delete this[_0xdf7f('0xaf')][_0x2ef3fa[_0xdf7f('0x11b')]];unlockQueueStatus(_0xa563e0);}}else if((strategy[this['voiceQueues'][this['actions'][_0x2ef3fa[_0xdf7f('0x11b')]][_0xdf7f('0xb7')]]['strategy']]||'rrmemory')===_0xdf7f('0x1b')){var _0x16624e;if(this[_0xdf7f('0xaf')][_0x2ef3fa[_0xdf7f('0x11b')]]&&!_[_0xdf7f('0x46')](this[_0xdf7f('0x2c')][this[_0xdf7f('0xaf')][_0x2ef3fa[_0xdf7f('0x11b')]][_0xdf7f('0xb7')]])){if(this[_0xdf7f('0x2d')][_0x25399f[_0xdf7f('0xaf')][_0x2ef3fa[_0xdf7f('0x11b')]]['queue']]){this[_0xdf7f('0x2d')][_0x25399f[_0xdf7f('0xaf')][_0x2ef3fa[_0xdf7f('0x11b')]][_0xdf7f('0xb7')]]=this['queueBookedRR'][this[_0xdf7f('0xaf')][_0x2ef3fa[_0xdf7f('0x11b')]][_0xdf7f('0xb7')]]?this[_0xdf7f('0x2d')][this[_0xdf7f('0xaf')][_0x2ef3fa[_0xdf7f('0x11b')]][_0xdf7f('0xb7')]]:this[_0xdf7f('0x2c')][this['actions'][_0x2ef3fa[_0xdf7f('0x11b')]][_0xdf7f('0xb7')]]?this[_0xdf7f('0x2c')][this[_0xdf7f('0xaf')][_0x2ef3fa['actionid']]['queue']][_0xdf7f('0x128')]||0x0:0x0;}this['queueBooked'][this[_0xdf7f('0xaf')][_0x2ef3fa[_0xdf7f('0x11b')]]['queue']][_0xdf7f('0x128')]=this[_0xdf7f('0x2d')][this[_0xdf7f('0xaf')][_0x2ef3fa['actionid']][_0xdf7f('0xb7')]];for(var _0x1f8f2e=0x0;_0x1f8f2e=0x0?!![]:![];})[_0xdf7f('0xb4')](myreject(_0x3e134e)));}}else{_0x5a034c[_0xdf7f('0x11f')](ami[_0xdf7f('0xb2')]({'action':_0xdf7f('0x140'),'command':util[_0xdf7f('0x7c')](_0xdf7f('0x13d'),_0x3f1973,!_[_0xdf7f('0x3c')](config[_0xdf7f('0x13a')][_0x464919])?_0x464919:'')})[_0xdf7f('0xbb')](function(_0x1fc95c){return _0x1fc95c[_0xdf7f('0x13f')][_0xdf7f('0x141')]('true')>=0x0?!![]:![];})[_0xdf7f('0xb4')](myreject(_0x3e134e)));}BPromise[_0xdf7f('0x142')](_0x5a034c)[_0xdf7f('0xbb')](function(_0x3f59ea){var _0x2a607e=_[_0xdf7f('0x143')](_0x3f59ea);if(_0x2a607e){return _0x43fe73(_0x2a607e);}else{_0x506935['message']=_0x40d7d6?_0xdf7f('0x144'):_0xdf7f('0x145');return _0x3e134e(msgResponse(_0xdf7f('0x146'),'Failure',_0xdf7f('0x147')+_0x40d7d6+'\x20'+_0x16fb65+_0xdf7f('0x148')+util[_0xdf7f('0x9a')](_0x3f1973,{'showHidden':![],'depth':null})+_0xdf7f('0x149')+_0x464919));}})[_0xdf7f('0xb4')](function(_0x458620){return _0x3e134e(msgResponse(_0xdf7f('0x134'),'Failure',JSON[_0xdf7f('0x49')](_0x458620)));});});};Dialer['prototype'][_0xdf7f('0x14a')]=function(_0x477861){var _0x273952=this;return function(){switch(_0x477861['dialMethod']){case _0xdf7f('0x14b'):freeVariablesPredictive(_0x477861);_0x273952[_0xdf7f('0x14c')](_0x477861,0x1);break;case'power':freeVariablesPredictive(_0x477861);_0x273952[_0xdf7f('0x14c')](_0x477861,_0x477861[_0xdf7f('0x14d')]);break;case _0xdf7f('0x6'):_0x273952[_0xdf7f('0x6')](_0x477861);break;case _0xdf7f('0x5'):freeVariablesPredictive(_0x477861);_0x273952['handlePower'](_0x477861,0x1);break;default:freeVariablesPredictive(_0x477861);logger[_0xdf7f('0x99')](_0xdf7f('0x14e'),_0x477861[_0xdf7f('0x3e')],_0xdf7f('0x14f'));}};};Dialer[_0xdf7f('0xad')][_0xdf7f('0x150')]=function(_0x122e18){var _0x52d65b=this;return function(){_0x52d65b['handleIvr'](_0x122e18);};};Dialer['prototype']['syncQueueSummary']=function(_0x499ea5){var _0x1c663a=this;if(isNotPreview(_0x499ea5[_0xdf7f('0x5d')])){if(isVoiceQueueOutbound(_0x499ea5[_0xdf7f('0x4e')])&&isActive(_0x499ea5[_0xdf7f('0x5c')])){_0x499ea5[_0xdf7f('0xa8')]=!![];BPromise['resolve']()['then'](checkIsLoggedIn(_0x499ea5,_0x499ea5[_0xdf7f('0x53')]))[_0xdf7f('0xbb')](checkIsActive(_0x499ea5,_0x499ea5[_0xdf7f('0x5c')]))[_0xdf7f('0xbb')](checkInterval(_0x499ea5))[_0xdf7f('0xbb')](_0x1c663a[_0xdf7f('0x151')](_0x499ea5))[_0xdf7f('0xbb')](_0x1c663a[_0xdf7f('0x133')](_0x499ea5[_0xdf7f('0x152')],_0x499ea5[_0xdf7f('0x153')],_0x499ea5['name'],_0x499ea5))[_0xdf7f('0xbb')](_0x1c663a[_0xdf7f('0x135')](_0x499ea5[_0xdf7f('0x41')],_0x499ea5[_0xdf7f('0x153')],_0x499ea5['name'],_0x499ea5))[_0xdf7f('0xbb')](_0x1c663a['checkDialMethod'](_0x499ea5))[_0xdf7f('0xb4')](loggerCatchQueueSummary(_0xdf7f('0x154'),_0x499ea5));}else{notSendMessagesQueue(_0x499ea5);}}else{freeVariablesPredictive(_0x499ea5);}};Dialer[_0xdf7f('0xad')][_0xdf7f('0x155')]=function(){var _0x47c518=this;var _0x1adfe2;for(var _0x4e23b7 in this['campaigns']){if(this[_0xdf7f('0x22')][_0xdf7f('0x9d')](_0x4e23b7)){_0x1adfe2=this[_0xdf7f('0x22')][_0x4e23b7];if(isCampaignIvr(_0x1adfe2['type'])&&isActive(_0x1adfe2['active'])){_0x1adfe2[_0xdf7f('0xa8')]=!![];BPromise[_0xdf7f('0xba')]()[_0xdf7f('0xbb')](checkIsActive(_0x1adfe2,_0x1adfe2['active']))['then'](checkInterval(_0x1adfe2))[_0xdf7f('0xbb')](_0x47c518['checkIsTrunkReachable'](_0x1adfe2))['then'](_0x47c518[_0xdf7f('0x133')](_0x1adfe2[_0xdf7f('0x152')],_0x1adfe2['dialTimezone'],_0x1adfe2[_0xdf7f('0x3e')],_0x1adfe2))['then'](_0x47c518[_0xdf7f('0x135')](_0x1adfe2[_0xdf7f('0x41')],_0x1adfe2['dialTimezone'],_0x1adfe2['name'],_0x1adfe2))[_0xdf7f('0xbb')](_0x47c518[_0xdf7f('0x150')](_0x1adfe2))[_0xdf7f('0xb4')](loggerCatchQueueSummary(_0xdf7f('0x156'),_0x1adfe2));}else{notSendMessagesCampaign(_0x1adfe2);}}}};function getCallerIdRandom(_0x25c684,_0x56db41){var _0x5d0307,_0x2b2998,_0x439abd;if(_0x56db41<=0x0){_0x56db41=0x1;}_0x5d0307=new RegExp(_0xdf7f('0x157')+_0x56db41+'}$');_0x2b2998=Math[_0xdf7f('0x158')](0xa,_0x56db41-0x1);_0x439abd=Math[_0xdf7f('0x158')](0xa,_0x56db41)-0x1;return util['format']('%s',_[_0xdf7f('0x159')](_0x25c684,_0x5d0307,_[_0xdf7f('0x15a')](_0x2b2998,_0x439abd)));}function extractCalleridName(_0x4fbea6){var _0x58fe39=_0x4fbea6[_0xdf7f('0x15b')](/"(.*?)"/);return _0x58fe39?_0x58fe39[0x1]:_0x4fbea6;}function extractCalleridNumber(_0x4d76ba){var _0x43d0a1=_0x4d76ba[_0xdf7f('0x15b')](/<(.*?)>/);return _0x43d0a1?_0x43d0a1[0x1]:_0x4d76ba;}Dialer[_0xdf7f('0xad')][_0xdf7f('0x15c')]=function(_0x9ec8aa,_0x558d66){var _0x2c3f06=this;var _0x13fae1=uuid['v4']();this['actions'][_0x13fae1]=new Action(_0x9ec8aa,_0x558d66,_0x13fae1);return new BPromise(function(_0x15a411,_0xbcbdd){if(_['isUndefined'](_0x9ec8aa)&&_0xdf7f('0x15d')!==typeof _0x9ec8aa){return _0xbcbdd(msgResponse(_0xdf7f('0x15e'),_0xdf7f('0x136'),_0xdf7f('0x15f')));}if(_['isUndefined'](_0x558d66[_0xdf7f('0x160')][_0xdf7f('0x161')])||_0x558d66[_0xdf7f('0x160')][_0xdf7f('0x161')]===null){return _0xbcbdd(msgResponse('originate',_0xdf7f('0x136'),_0xdf7f('0x162')));}var _0x45cddb={'XMD-CALLERID':_0x2c3f06[_0xdf7f('0xaf')][_0x13fae1]['getCaller'](),'XMD-AGI':_0x9ec8aa['dialQueueProject']?util[_0xdf7f('0x7c')](_0xdf7f('0x163'),ipAgi,_0x9ec8aa['dialQueueProject']):_0xdf7f('0x164'),'XMD-AGIAFTER':_0x9ec8aa[_0xdf7f('0x10d')]?util[_0xdf7f('0x7c')](_0xdf7f('0x163'),ipAgi,_0x9ec8aa[_0xdf7f('0x10d')]):'NONE','XMD-QUEUE':_0x9ec8aa[_0xdf7f('0x4e')]===_0xdf7f('0x4f')?util[_0xdf7f('0x7c')](_0xdf7f('0x165'),_0x9ec8aa[_0xdf7f('0x3e')],_0x9ec8aa['dialQueueOptions']||'',_0x9ec8aa[_0xdf7f('0x101')]?'c':'',_0x9ec8aa[_0xdf7f('0x10a')]||0x3):'NONE','XMD-CONTACTID':_0x558d66[_0xdf7f('0xd5')],'XMD-CDRTYPE':_0xdf7f('0x166'),'CALLERID(all)':_0x2c3f06[_0xdf7f('0xaf')][_0x13fae1][_0xdf7f('0x167')](),'XMD-AMD':_0x9ec8aa[_0xdf7f('0xe7')]?_0xdf7f('0x168'):_0xdf7f('0x164'),'XMD-DESTINATION':_0xdf7f('0xe6')};if(_0x9ec8aa[_0xdf7f('0xe7')]){_0x45cddb[_0xdf7f('0x169')]=_0x9ec8aa['dialAMDInitialSilence']||0x9c4;_0x45cddb['XMD-AMDGREETING']=_0x9ec8aa[_0xdf7f('0x16a')]||0x5dc;_0x45cddb[_0xdf7f('0x16b')]=_0x9ec8aa['dialAMDAfterGreetingSilence']||0x320;_0x45cddb['XMD-AMDTOTALANALYSISTIME']=_0x9ec8aa[_0xdf7f('0x16c')]||0x1388;_0x45cddb['XMD-AMDMINWORDLENGTH']=_0x9ec8aa[_0xdf7f('0x16d')]||0x64;_0x45cddb['XMD-AMDBETWEENWORDSSILENCE']=_0x9ec8aa[_0xdf7f('0x16e')]||0x32;_0x45cddb[_0xdf7f('0x16f')]=_0x9ec8aa[_0xdf7f('0x170')]||0x3;_0x45cddb[_0xdf7f('0x171')]=_0x9ec8aa[_0xdf7f('0x172')]||0x100;_0x45cddb[_0xdf7f('0x173')]=_0x9ec8aa[_0xdf7f('0x174')]||0x1388;}if(_0x9ec8aa[_0xdf7f('0x4e')]===_0xdf7f('0x4f')){_0x45cddb['XMD-VOICEQUEUEID']=_0x558d66[_0xdf7f('0xd8')];}else{_0x45cddb['XMD-CAMPAIGNID']=_0x558d66[_0xdf7f('0xd9')];}for(var _0x21beda in _0x558d66[_0xdf7f('0x160')]){if(_0x558d66[_0xdf7f('0x160')][_0xdf7f('0x9d')](_0x21beda)){if(isNotNull(_0x558d66['Contact'][_0x21beda])&&_0x21beda!=='id'&&_0x21beda!==_0xdf7f('0x175')&&_0x21beda!==_0xdf7f('0x176')&&_0x21beda!=='updatedAt'){_0x45cddb[util[_0xdf7f('0x7c')](_0xdf7f('0x177'),_0xdf7f('0x178'),_['toUpper'](_0x21beda))]=_0x558d66[_0xdf7f('0x160')][_0x21beda];}}}var _0xa3ba1f=_0x2c3f06[_0xdf7f('0xde')](_0x9ec8aa[_0xdf7f('0x79')])?getCallerId(_0x9ec8aa[_0xdf7f('0x79')][_0xdf7f('0x7a')],_0x9ec8aa['dialOriginateCallerIdName'],_0x9ec8aa[_0xdf7f('0x179')]>0x0?getCallerIdRandom(_0x9ec8aa[_0xdf7f('0x5f')],_0x9ec8aa[_0xdf7f('0x179')]):_0x9ec8aa[_0xdf7f('0x5f')]):getCallerId(_['isNil'](_0x9ec8aa[_0xdf7f('0x131')])?_0x9ec8aa[_0xdf7f('0x79')][_0xdf7f('0x7a')]:_0x9ec8aa[_0xdf7f('0x131')][_0xdf7f('0x7a')],_0x9ec8aa['dialOriginateCallerIdName'],_0x9ec8aa[_0xdf7f('0x179')]>0x0?getCallerIdRandom(_0x9ec8aa['dialOriginateCallerIdNumber'],_0x9ec8aa[_0xdf7f('0x179')]):_0x9ec8aa[_0xdf7f('0x5f')]);if(_0xa3ba1f){_0x45cddb[_0xdf7f('0x17a')]=_0x2c3f06[_0xdf7f('0xaf')][_0x13fae1]['originatecalleridname']=extractCalleridName(_0xa3ba1f);_0x45cddb[_0xdf7f('0x17b')]=_0x2c3f06[_0xdf7f('0xaf')][_0x13fae1][_0xdf7f('0x17c')]=extractCalleridNumber(_0xa3ba1f);}return ami[_0xdf7f('0xb2')]({'actionid':_0x13fae1,'action':_0xdf7f('0x15e'),'channel':_0x2c3f06[_0xdf7f('0xde')](_0x9ec8aa['Trunk'])?util[_0xdf7f('0x7c')](_0xdf7f('0x17d'),_0x9ec8aa['Trunk'][_0xdf7f('0x3e')],isNotNull(_0x9ec8aa['dialPrefix'])?_0x9ec8aa[_0xdf7f('0x61')][_0xdf7f('0x17e')]()||'':'',_0x9ec8aa[_0xdf7f('0x17f')]>0x0?_0x558d66[_0xdf7f('0x160')][_0xdf7f('0x161')][_0xdf7f('0x180')](_0x9ec8aa[_0xdf7f('0x17f')]):_0x558d66[_0xdf7f('0x160')][_0xdf7f('0x161')]):util[_0xdf7f('0x7c')](_0xdf7f('0x17d'),_[_0xdf7f('0xb1')](_0x9ec8aa[_0xdf7f('0x131')])?_0x9ec8aa[_0xdf7f('0x79')][_0xdf7f('0x3e')]:_0x9ec8aa[_0xdf7f('0x131')]['name'],isNotNull(_0x9ec8aa[_0xdf7f('0x61')])?_0x9ec8aa['dialPrefix'][_0xdf7f('0x17e')]()||'':'',_0x9ec8aa[_0xdf7f('0x17f')]>0x0?_0x558d66[_0xdf7f('0x160')][_0xdf7f('0x161')]['substring'](_0x9ec8aa['dialCutDigit']):_0x558d66[_0xdf7f('0x160')][_0xdf7f('0x161')]),'callerid':_0xa3ba1f,'Exten':'xcally-motion-dialer','Context':_0xdf7f('0x181'),'Priority':'1','variable':_0x45cddb,'timeout':(_0x9ec8aa[_0xdf7f('0x60')]||0x1e)*0x3e8,'async':!![],'channelid':_0x13fae1})['then'](function(_0x2efa9a){return _0x15a411(_0x2efa9a);})['catch'](function(_0x263344){_0x9ec8aa[_0xdf7f('0x69')]+=0x1;var _0x2f19c7=new History(_0x2c3f06[_0xdf7f('0xaf')][_0x13fae1]);logger[_0xdf7f('0x99')](util[_0xdf7f('0x7c')](_0xdf7f('0x182'),JSON['stringify'](_0x263344)));_0x2f19c7[_0xdf7f('0xa9')]=0xe;_0x2f19c7[_0xdf7f('0xaa')]=_0xdf7f('0x183');_0x2f19c7[_0xdf7f('0xac')]=moment()[_0xdf7f('0x7c')](_0xdf7f('0x102'));_0x2f19c7[_0xdf7f('0xab')]=_0x2f19c7[_0xdf7f('0xac')];_0x2c3f06[_0xdf7f('0xe2')](_0x2f19c7)['catch'](loggerCatch(_0xdf7f('0x184')));_0x2c3f06[_0xdf7f('0xcc')](_0x2f19c7)['catch'](loggerCatch('[originate][error]'))[_0xdf7f('0x1f')](function(){delete _0x2c3f06[_0xdf7f('0xaf')][_0x13fae1];return _0xbcbdd(msgResponse(_0xdf7f('0x15e'),_0xdf7f('0x48'),_0xdf7f('0x185')));});});});};Dialer[_0xdf7f('0xad')]['syncOriginateResponse']=function(_0x3a32ed){var _0x385584=this[_0xdf7f('0xaf')][_0x3a32ed[_0xdf7f('0x11b')]];var _0x5c82c9=this;if(_0x385584){delete this[_0xdf7f('0xaf')][_0x3a32ed['actionid']];_0x385584[_0xdf7f('0x186')]=moment()[_0xdf7f('0x7c')](_0xdf7f('0x102'));var _0x1405f5=_0x385584['type']==='ivr'?this[_0xdf7f('0x22')][_0x385584['queue']]:this['voiceQueues'][_0x385584['getQueue']()];if(!this['isSuccess'](_0x3a32ed['response'])){this[_0xdf7f('0xb6')](_0x1405f5);return this[_0xdf7f('0x187')](_0x385584,_0x1405f5,_0x3a32ed)[_0xdf7f('0xbb')](function(_0x4b9ef7){})[_0xdf7f('0xb4')](loggerCatch(_0xdf7f('0x188')));}else{this[_0xdf7f('0x28')][_0x3a32ed[_0xdf7f('0xe3')]]=_0x385584;}}};Dialer['prototype'][_0xdf7f('0x189')]=function(_0x2e6586,_0x54078c,_0xa37b57){var _0x246f79=new History(_0x54078c);if(_0x246f79['countbusyretry']+_0x246f79[_0xdf7f('0x18a')]+_0x246f79[_0xdf7f('0x18b')]+_0x246f79[_0xdf7f('0x18c')]+_0x246f79[_0xdf7f('0x10e')]+_0x246f79[_0xdf7f('0x117')]+_0x246f79[_0xdf7f('0x18d')]+_0x246f79[_0xdf7f('0x18e')]>=_0xa37b57['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x2e6586){case 0x3:if(_0x246f79['countnoanswerretry']>=_0xa37b57[_0xdf7f('0x18f')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnoanswerretry':_0x246f79[_0xdf7f('0x18b')]+=0x1,'scheduledat':moment()['add'](_0xa37b57[_0xdf7f('0x190')],_0xdf7f('0x112'))['format'](_0xdf7f('0x102')),'ContactId':_0x246f79['ContactId'],'ListId':_0x246f79[_0xdf7f('0xd6')],'VoiceQueueId':_0x246f79[_0xdf7f('0xd8')]||undefined,'CampaignId':_0x246f79['CampaignId']||undefined})[_0xdf7f('0xb4')](loggerCatch(_0xdf7f('0x191')));}break;case 0x5:if(_0x246f79['countbusyretry']>=_0xa37b57['dialBusyMaxRetry']-0x1){return!![];}else{this[_0xdf7f('0xc3')]({'active':![],'countbusyretry':_0x246f79['countbusyretry']+=0x1,'scheduledat':moment()[_0xdf7f('0x110')](_0xa37b57[_0xdf7f('0x192')],_0xdf7f('0x112'))[_0xdf7f('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x246f79['ContactId'],'ListId':_0x246f79[_0xdf7f('0xd6')],'VoiceQueueId':_0x246f79[_0xdf7f('0xd8')]||undefined,'CampaignId':_0x246f79[_0xdf7f('0xd9')]||undefined})[_0xdf7f('0xb4')](loggerCatch(_0xdf7f('0x193')));}break;case 0x8:if(_0x246f79[_0xdf7f('0x18a')]>=_0xa37b57[_0xdf7f('0x194')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countcongestionretry':_0x246f79[_0xdf7f('0x18a')]+=0x1,'scheduledat':moment()[_0xdf7f('0x110')](_0xa37b57[_0xdf7f('0x195')],_0xdf7f('0x112'))[_0xdf7f('0x7c')](_0xdf7f('0x102')),'ContactId':_0x246f79[_0xdf7f('0xd5')],'ListId':_0x246f79[_0xdf7f('0xd6')],'VoiceQueueId':_0x246f79[_0xdf7f('0xd8')]||undefined,'CampaignId':_0x246f79[_0xdf7f('0xd9')]||undefined})[_0xdf7f('0xb4')](loggerCatch('[rescheduleContact]\x20[Congestion]'));}break;case 0x0:if(_0x246f79['countnosuchnumberretry']>=_0xa37b57[_0xdf7f('0x196')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x246f79['countnosuchnumberretry']+=0x1,'scheduledat':moment()[_0xdf7f('0x110')](_0xa37b57[_0xdf7f('0x197')],_0xdf7f('0x112'))['format'](_0xdf7f('0x102')),'ContactId':_0x246f79[_0xdf7f('0xd5')],'ListId':_0x246f79[_0xdf7f('0xd6')],'VoiceQueueId':_0x246f79[_0xdf7f('0xd8')]||undefined,'CampaignId':_0x246f79[_0xdf7f('0xd9')]||undefined})[_0xdf7f('0xb4')](loggerCatch(_0xdf7f('0x198')));}break;case 0xa:if(_0x246f79['countdropretry']>=_0xa37b57['dialDropMaxRetry']-0x1){return!![];}else{this[_0xdf7f('0xc3')]({'active':![],'countdropretry':_0x246f79[_0xdf7f('0x10e')]+=0x1,'scheduledat':moment()[_0xdf7f('0x110')](_0xa37b57[_0xdf7f('0x111')],_0xdf7f('0x112'))[_0xdf7f('0x7c')](_0xdf7f('0x102')),'ContactId':_0x246f79[_0xdf7f('0xd5')],'ListId':_0x246f79[_0xdf7f('0xd6')],'VoiceQueueId':_0x246f79[_0xdf7f('0xd8')]||undefined,'CampaignId':_0x246f79[_0xdf7f('0xd9')]||undefined})[_0xdf7f('0xb4')](loggerCatch(_0xdf7f('0x113')));}break;case 0xb:if(_0x246f79[_0xdf7f('0x117')]>=_0xa37b57[_0xdf7f('0x116')]-0x1){return!![];}else{this[_0xdf7f('0xc3')]({'active':![],'countabandonedretry':_0x246f79[_0xdf7f('0x117')]+=0x1,'scheduledat':moment()['add'](_0xa37b57[_0xdf7f('0x118')],_0xdf7f('0x112'))['format'](_0xdf7f('0x102')),'ContactId':_0x246f79[_0xdf7f('0xd5')],'ListId':_0x246f79[_0xdf7f('0xd6')],'VoiceQueueId':_0x246f79[_0xdf7f('0xd8')]||undefined,'CampaignId':_0x246f79[_0xdf7f('0xd9')]||undefined})[_0xdf7f('0xb4')](loggerCatch(_0xdf7f('0x119')));}break;case 0x13:if(_0x246f79[_0xdf7f('0x18d')]>=_0xa37b57[_0xdf7f('0x199')]-0x1){return!![];}else{this[_0xdf7f('0xc3')]({'active':![],'countmachineretry':_0x246f79[_0xdf7f('0x18d')]+=0x1,'scheduledat':moment()[_0xdf7f('0x110')](_0xa37b57[_0xdf7f('0x19a')],_0xdf7f('0x112'))['format'](_0xdf7f('0x102')),'ContactId':_0x246f79[_0xdf7f('0xd5')],'ListId':_0x246f79['ListId'],'VoiceQueueId':_0x246f79[_0xdf7f('0xd8')]||undefined,'CampaignId':_0x246f79[_0xdf7f('0xd9')]||undefined})[_0xdf7f('0xb4')](loggerCatch(_0xdf7f('0x19b')));}break;case 0x14:if(_0x246f79[_0xdf7f('0x18e')]>=_0xa37b57[_0xdf7f('0x19c')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countagentrejectretry':_0x246f79['countagentrejectretry']+=0x1,'scheduledat':moment()[_0xdf7f('0x110')](_0xa37b57[_0xdf7f('0x19d')],_0xdf7f('0x112'))['format'](_0xdf7f('0x102')),'ContactId':_0x246f79['ContactId'],'ListId':_0x246f79[_0xdf7f('0xd6')],'VoiceQueueId':_0x246f79['VoiceQueueId']||undefined,'CampaignId':_0x246f79[_0xdf7f('0xd9')]||undefined})[_0xdf7f('0xb4')](loggerCatch('[rescheduleContact][AgentReject]'));}break;default:return!![];}};Dialer['prototype'][_0xdf7f('0x187')]=function(_0x185dc1,_0x297fbe,_0x2e5167){var _0x530576=this;var _0x2e8b8d=new History(_0x185dc1);return new BPromise(function(_0x1563af,_0x1534f7){if(_[_0xdf7f('0x3c')](_0x297fbe)&&_0xdf7f('0x15d')!==typeof _0x297fbe){return _0x1534f7(msgResponse('[callProgressDetecting]',_0xdf7f('0x136'),_0xdf7f('0x19e')));}if(_[_0xdf7f('0x3c')](_0x2e5167)&&'object'!==typeof _0x2e5167){return _0x1534f7(msgResponse(_0xdf7f('0x19f'),_0xdf7f('0x136'),'evt\x20is\x20undefine'));}switch(_0x2e5167[_0xdf7f('0xfe')]){case'0':_0x297fbe[_0xdf7f('0x68')]+=0x1;_0x2e8b8d['state']=0x0;_0x2e8b8d[_0xdf7f('0xaa')]=_0xdf7f('0x1a0');_0x530576['createHistory'](_0x2e8b8d)['catch'](loggerCatch(_0xdf7f('0x1a1')));if(_0x530576[_0xdf7f('0x189')](0x0,_0x185dc1,_0x297fbe)){if(_0x2e8b8d['countbusyretry']+_0x2e8b8d[_0xdf7f('0x18a')]+_0x2e8b8d['countnoanswerretry']+_0x2e8b8d[_0xdf7f('0x18c')]+_0x2e8b8d[_0xdf7f('0x10e')]+_0x2e8b8d['countabandonedretry']+_0x2e8b8d[_0xdf7f('0x18d')]+_0x2e8b8d['countagentrejectretry']>=_0x297fbe[_0xdf7f('0x1a2')]){_0x530576[_0xdf7f('0x1a3')](_0x2e8b8d,_0x1563af,_0x1534f7,_0xdf7f('0x1a4'));}else{_0x530576[_0xdf7f('0x1a5')](_0x2e8b8d,_0x1563af,_0x1534f7,_0xdf7f('0x1a4'));}}break;case'3':_0x297fbe[_0xdf7f('0x67')]+=0x1;_0x2e8b8d[_0xdf7f('0xa9')]=0x3;_0x2e8b8d[_0xdf7f('0xaa')]=_0xdf7f('0x1a6');_0x2e8b8d[_0xdf7f('0x18b')]+=0x1;_0x2e8b8d[_0xdf7f('0x1a7')]+=0x1;_0x530576[_0xdf7f('0xe2')](_0x2e8b8d)[_0xdf7f('0xb4')](loggerCatch(_0xdf7f('0x1a8')));if(_0x530576['checkRetriveMax'](0x3,_0x185dc1,_0x297fbe)){if(_0x2e8b8d['countnoanswerretry']>=_0x297fbe['dialNoAnswerMaxRetry']){_0x530576[_0xdf7f('0x1a5')](_0x2e8b8d,_0x1563af,_0x1534f7,_0xdf7f('0x1a9'));}else{_0x530576[_0xdf7f('0x1a3')](_0x2e8b8d,_0x1563af,_0x1534f7,_0xdf7f('0x1a9'));}}break;case'5':_0x297fbe['outboundBusyCallsDay']+=0x1;_0x2e8b8d[_0xdf7f('0xa9')]=0x5;_0x2e8b8d['statedesc']=_0xdf7f('0x1aa');_0x2e8b8d['countbusyretry']+=0x1;_0x2e8b8d[_0xdf7f('0x1a7')]+=0x1;_0x530576['createHistory'](_0x2e8b8d)[_0xdf7f('0xb4')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x530576['checkRetriveMax'](0x5,_0x185dc1,_0x297fbe)){if(_0x2e8b8d[_0xdf7f('0x1ab')]>=_0x297fbe['dialBusyMaxRetry']){_0x530576[_0xdf7f('0x1a5')](_0x2e8b8d,_0x1563af,_0x1534f7,'reason\x205\x20busy');}else{_0x530576[_0xdf7f('0x1a3')](_0x2e8b8d,_0x1563af,_0x1534f7,_0xdf7f('0x1ac'));}}break;case'8':_0x297fbe[_0xdf7f('0x63')]+=0x1;_0x2e8b8d[_0xdf7f('0xa9')]=0x8;_0x2e8b8d[_0xdf7f('0xaa')]=_0xdf7f('0x1ad');_0x2e8b8d[_0xdf7f('0x18a')]+=0x1;_0x2e8b8d['countglobal']+=0x1;_0x530576[_0xdf7f('0xe2')](_0x2e8b8d)[_0xdf7f('0xb4')](loggerCatch(_0xdf7f('0x1ae')));if(_0x530576['checkRetriveMax'](0x8,_0x185dc1,_0x297fbe)){if(_0x2e8b8d[_0xdf7f('0x18a')]>=_0x297fbe[_0xdf7f('0x194')]){_0x530576[_0xdf7f('0x1a5')](_0x2e8b8d,_0x1563af,_0x1534f7,_0xdf7f('0x1af'));}else{_0x530576[_0xdf7f('0x1a3')](_0x2e8b8d,_0x1563af,_0x1534f7,_0xdf7f('0x1af'));}}break;case'11':_0x297fbe['outboundAbandonedCallsDay']+=0x1;_0x2e8b8d[_0xdf7f('0xa9')]=0xb;_0x2e8b8d['statedesc']='Abandoned';_0x2e8b8d[_0xdf7f('0x117')]+=0x1;_0x2e8b8d['countglobal']+=0x1;_0x530576[_0xdf7f('0xe2')](_0x2e8b8d)[_0xdf7f('0xb4')](loggerCatch(_0xdf7f('0x1b0')));if(_0x530576[_0xdf7f('0x189')](0xb,_0x185dc1,_0x297fbe)){if(_0x2e8b8d['countabandonedretry']>=_0x297fbe[_0xdf7f('0x116')]){_0x530576['createStateFinal'](_0x2e8b8d,_0x1563af,_0x1534f7,_0xdf7f('0x1b1'));}else{_0x530576[_0xdf7f('0x1a3')](_0x2e8b8d,_0x1563af,_0x1534f7,'reason\x2011\x20abandoned');}}break;case'20':_0x297fbe[_0xdf7f('0x6a')]+=0x1;_0x2e8b8d['state']=0x14;_0x2e8b8d['statedesc']=_0xdf7f('0x1b2');_0x2e8b8d[_0xdf7f('0x18e')]+=0x1;_0x2e8b8d['countglobal']+=0x1;_0x530576[_0xdf7f('0xe2')](_0x2e8b8d)[_0xdf7f('0xb4')](loggerCatch(_0xdf7f('0x1b3')));if(_0x530576[_0xdf7f('0x189')](0x14,_0x185dc1,_0x297fbe)){if(_0x2e8b8d[_0xdf7f('0x18e')]>=_0x297fbe[_0xdf7f('0x19c')]){_0x530576[_0xdf7f('0x1a5')](_0x2e8b8d,_0x1563af,_0x1534f7,_0xdf7f('0x1b4'));}else{_0x530576[_0xdf7f('0x1a3')](_0x2e8b8d,_0x1563af,_0x1534f7,_0xdf7f('0x1b4'));}}break;default:_0x297fbe[_0xdf7f('0x1b5')]+=0x1;_0x2e8b8d[_0xdf7f('0xa9')]=0xc;_0x2e8b8d[_0xdf7f('0xaa')]=_0x2e5167[_0xdf7f('0xfe')];_0x530576[_0xdf7f('0xe2')](_0x2e8b8d)[_0xdf7f('0xb4')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x530576[_0xdf7f('0x189')](_0x2e5167['reason'],_0x185dc1,_0x297fbe)){if(_0x2e8b8d['countbusyretry']+_0x2e8b8d[_0xdf7f('0x18a')]+_0x2e8b8d[_0xdf7f('0x18b')]+_0x2e8b8d['countnosuchnumberretry']+_0x2e8b8d[_0xdf7f('0x10e')]+_0x2e8b8d[_0xdf7f('0x117')]+_0x2e8b8d[_0xdf7f('0x18d')]+_0x2e8b8d[_0xdf7f('0x18e')]>=_0x297fbe[_0xdf7f('0x1a2')]){_0x530576[_0xdf7f('0x1a3')](_0x2e8b8d,_0x1563af,_0x1534f7,_0x2e5167[_0xdf7f('0xfe')]);}else{_0x530576[_0xdf7f('0x1a5')](_0x2e8b8d,_0x1563af,_0x1534f7,_0x2e5167[_0xdf7f('0xfe')]);}}}});};Dialer['prototype'][_0xdf7f('0x1a3')]=function(_0x5eb81c,_0x86b5fc,_0x7959cc,_0xd0ca72){var _0x123f8c=new Final(_0x5eb81c);_0x123f8c[_0xdf7f('0xa9')]=0xf;_0x123f8c['statedesc']=_0xdf7f('0x1b6');this[_0xdf7f('0x1a5')](_0x123f8c,_0x86b5fc,_0x7959cc,_0xd0ca72);};Dialer[_0xdf7f('0xad')][_0xdf7f('0x1a5')]=function(_0x65969a,_0x17531c,_0x3a4fae,_0x5dc1dc){this[_0xdf7f('0xcc')](_0x65969a)[_0xdf7f('0xbb')](function(_0x55ef6f){return _0x17531c(msgResponse(_0xdf7f('0x19f'),_0xdf7f('0xdd'),_0x5dc1dc));})[_0xdf7f('0xb4')](function(_0x579f11){return _0x3a4fae(msgResponse(_0xdf7f('0x1b7'),_0xdf7f('0x136'),_0xdf7f('0x1b8')));});};Dialer['prototype'][_0xdf7f('0x6')]=function(_0x2f1feb){var _0x5dc5b6=this;var _0x3214b7=_0x2f1feb['dialPredictiveOptimizationPercentage']/0x64;var _0x36d89b=_0x2f1feb[_0xdf7f('0x66')]/(_0x2f1feb[_0xdf7f('0x66')]+_0x2f1feb[_0xdf7f('0xef')]);var _0x2c8c76=Math['round'](_0x2f1feb['predictiveIntervalAvailable']*(_0x2f1feb[_0xdf7f('0x1b9')]/0x64));var _0x20cb4a=Math[_0xdf7f('0x1ba')](_0x2f1feb[_0xdf7f('0x1bb')]*(_0x2f1feb[_0xdf7f('0x1bc')]/0x64));var _0x1bf715=_0x2f1feb[_0xdf7f('0x52')]+_0x2f1feb[_0xdf7f('0x57')];var _0x3d0f77=Math[_0xdf7f('0x1bd')](_0x2f1feb['erlangCalls']*_0x2f1feb[_0xdf7f('0x76')]*_0x2f1feb[_0xdf7f('0x6f')]*_0x2f1feb['predictiveIntervalMultiplicativeFactor']);if(_[_0xdf7f('0x3c')](_0x2f1feb[_0xdf7f('0x78')])){if(!_[_0xdf7f('0x3c')](_0x2f1feb[_0xdf7f('0x2a')])){_0x2f1feb['startPredictive']=undefined;loggerPredictive['error'](_0xdf7f('0x1be'),_0xdf7f('0x1bf'));}if(!_[_0xdf7f('0x3c')](_0x2f1feb[_0xdf7f('0x93')])){loggerPredictive[_0xdf7f('0x99')](_0xdf7f('0x1be'),_0xdf7f('0x1c0'));clearInterval(_0x2f1feb[_0xdf7f('0x93')]);_0x2f1feb['handlePredictive']=undefined;}_0x2f1feb['startProgressive']=moment()['format'](_0xdf7f('0x102'));loggerPredictive['info'](_0x2f1feb[_0xdf7f('0x3e')],_0xdf7f('0x1c1'),_0x2f1feb['startProgressive']);this['handlePower'](_0x2f1feb,0x1);}else if(ifInterval(_0x2f1feb['dialPredictiveInterval'],_0x2f1feb['startProgressive'])){this[_0xdf7f('0x14c')](_0x2f1feb,0x1);loggerPredictiveCalls['info'](_0xdf7f('0x1c2'),_0x2f1feb[_0xdf7f('0x78')],_0x2f1feb[_0xdf7f('0x3e')]);_0x2f1feb[_0xdf7f('0x74')]=0x0;_0x2f1feb['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x3214b7<_0x36d89b&&_0x2f1feb[_0xdf7f('0x1c3')]==='dropRate'){freeVariablesPredictive(_0x2f1feb);loggerPredictive[_0xdf7f('0x80')](_0xdf7f('0x1c4'),'Dropped\x20calls\x20day',_0x36d89b,_0xdf7f('0x78'),_0x2f1feb['name']);}else if(_0x3d0f77<_0x2f1feb[_0xdf7f('0x6e')]&&_0x2f1feb[_0xdf7f('0x1c3')]===_0xdf7f('0x1c5')){freeVariablesPredictive(_0x2f1feb);loggerPredictive[_0xdf7f('0x80')](_0xdf7f('0x1c6'),_0xdf7f('0x1c7'),_0x3d0f77,_0xdf7f('0x1c8'),_0x2f1feb[_0xdf7f('0x6e')],'startProgressive',_0x2f1feb[_0xdf7f('0x3e')]);}else if(!ifInterval(_0x2f1feb[_0xdf7f('0x1c9')],_0x2f1feb[_0xdf7f('0x78')])&&_['isUndefined'](_0x2f1feb[_0xdf7f('0x2a')])&&!_[_0xdf7f('0x3c')](_0x2f1feb[_0xdf7f('0x78')])){_0x2f1feb[_0xdf7f('0x2a')]=moment()[_0xdf7f('0x7c')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xdf7f('0x80')](_0x2f1feb[_0xdf7f('0x3e')],_0xdf7f('0x1ca'),_0x2f1feb[_0xdf7f('0x2a')]);this['averageHandleTime'](_0x2f1feb[_0xdf7f('0x1c9')])['then'](this[_0xdf7f('0x1cb')](_0x2f1feb))['then'](mergeDataErlangB(_0x2f1feb))[_0xdf7f('0xbb')](this['startMethodPredictive'](_0x2f1feb))[_0xdf7f('0xb4')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x2f1feb));}else if(!ifInterval(_0x2f1feb[_0xdf7f('0x1c9')],_0x2f1feb[_0xdf7f('0x2a')])){_0x2f1feb[_0xdf7f('0x6e')]=0x0;_0x2f1feb['startPredictive']=moment()[_0xdf7f('0x7c')](_0xdf7f('0x102'));loggerPredictive[_0xdf7f('0x80')](_0x2f1feb[_0xdf7f('0x3e')],_0xdf7f('0x1cc'),_0x2f1feb[_0xdf7f('0x2a')]);clearInterval(_0x2f1feb[_0xdf7f('0x93')]);_0x2f1feb['handlePredictive']=undefined;this[_0xdf7f('0xc0')](_0x2f1feb[_0xdf7f('0x1c9')])[_0xdf7f('0xbb')](this['getDataPredictive'](_0x2f1feb))[_0xdf7f('0xbb')](mergeDataErlangB(_0x2f1feb))['then'](this[_0xdf7f('0x1cd')](_0x2f1feb))[_0xdf7f('0xb4')](loggerCatchPredictive(_0xdf7f('0x1ce'),_0x2f1feb));}else if(_0x2f1feb[_0xdf7f('0x1bb')]&&_0x1bf715<_0x2f1feb[_0xdf7f('0x1bb')]-_0x20cb4a){freeVariablesPredictive(_0x2f1feb);loggerPredictive[_0xdf7f('0x80')](_0x2f1feb[_0xdf7f('0x3e')],_0xdf7f('0x1cf'),_0x1bf715,_0xdf7f('0x1d0'),_0x2f1feb[_0xdf7f('0x1bb')],'-',_0x20cb4a,'=',_0x2f1feb[_0xdf7f('0x1bb')]-_0x20cb4a,')');}else if(_0x2f1feb[_0xdf7f('0x1bb')]&&_0x1bf715>_0x2f1feb[_0xdf7f('0x1bb')]+_0x2c8c76){freeVariablesPredictive(_0x2f1feb);loggerPredictive[_0xdf7f('0x80')](_0x2f1feb[_0xdf7f('0x3e')],_0xdf7f('0x1cf'),_0x1bf715,_0xdf7f('0x1d1'),_0x2f1feb[_0xdf7f('0x1bb')],'+',_0x2c8c76,'=',_0x2f1feb[_0xdf7f('0x1bb')]+_0x2c8c76,')');}};Dialer[_0xdf7f('0xad')][_0xdf7f('0x1cb')]=function(_0x30d672){var _0x62dfab=this;return function(_0x1c4f2b){return new BPromise(function(_0x9b4d54,_0x5795d6){_[_0xdf7f('0x91')](_0x30d672,_0x1c4f2b[0x0]);if(checkGetDataPredictive(_0x1c4f2b[0x0])){var _0x5693f7=_0x30d672[_0xdf7f('0x1bb')]=_0x30d672['talking']+_0x30d672[_0xdf7f('0x52')];var _0x100199=_0x30d672[_0xdf7f('0x1c9')]*0x3c;var _0x5d17ff=_0x1c4f2b[0x0][_0xdf7f('0x88')]+_0x1c4f2b[0x0][_0xdf7f('0x6c')];var _0x32eebf=(_0x1c4f2b[0x0]['predictiveIntervalAnsweredCalls']+_0x1c4f2b[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x1c4f2b[0x0][_0xdf7f('0x114')])/_0x1c4f2b[0x0][_0xdf7f('0x72')];_0x30d672['predictiveIntervalHitRate']=_0x32eebf>0x0?_0x32eebf:0x1;switch(_0x30d672[_0xdf7f('0x1c3')]){case'dropRate':var _0x2d9d53=_0x30d672[_0xdf7f('0x1d2')]/0x64;return _0x62dfab[_0xdf7f('0x1d3')](_0x5693f7,_0x100199,_0x5d17ff,_0x32eebf,_0x2d9d53)[_0xdf7f('0xbb')](function(_0x31af83){return _0x9b4d54(_0x31af83);});case _0xdf7f('0x1d4'):var _0x1bf466=_0x30d672[_0xdf7f('0x1d2')]/0x64;return _0x62dfab[_0xdf7f('0x1d5')](_0x5693f7,_0x100199,_0x5d17ff,_0x32eebf,_0x1bf466)[_0xdf7f('0xbb')](function(_0x22414f){return _0x9b4d54(_0x22414f);});default:return _0x5795d6(msgResponse(_0xdf7f('0x1d6'),_0xdf7f('0x136'),'Unknown\x20Predictive'));}}else{return _0x5795d6(msgResponse(_0xdf7f('0x1d6'),_0xdf7f('0x136'),_0xdf7f('0x1d7')));}});};};Dialer[_0xdf7f('0xad')][_0xdf7f('0x1d8')]=function(_0x462472){var _0x1642f9=this;return function(_0x2d7207){return new BPromise(function(_0x5343bb,_0x1325f3){_[_0xdf7f('0x91')](_0x462472,_0x2d7207[0x0]);if(checkGetDataPredictive(_0x2d7207[0x0])){loggerPredictive[_0xdf7f('0x80')](JSON[_0xdf7f('0x49')](_0x2d7207[0x0]));if(_0x462472[_0xdf7f('0x1c3')]===_0xdf7f('0x1c5')){return _0x1642f9[_0xdf7f('0xca')](_0x462472['id'])[_0xdf7f('0xbb')](function(_0x558eba){var _0x33c766=_0x462472[_0xdf7f('0x53')]-_0x558eba[0x0][_0xdf7f('0x1d9')];var _0x4c1d30=_0x462472[_0xdf7f('0x1c9')]*0x3c;var _0x28306c=_0x2d7207[0x0][_0xdf7f('0x88')]+_0x2d7207[0x0][_0xdf7f('0x6c')];var _0x1510aa=(_0x2d7207[0x0][_0xdf7f('0x6b')]+_0x2d7207[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x2d7207[0x0][_0xdf7f('0x114')])/_0x2d7207[0x0]['predictiveIntervalTotalCalls'];var _0x30addf=_0x462472[_0xdf7f('0x1d2')]/0x64;_0x462472[_0xdf7f('0x71')]=_0x558eba[0x0]['outboundQueuePauses']||0x0;_0x462472['predictiveIntervalHitRate']=_0x1510aa>0x0?_0x1510aa:0x1;return _0x1642f9[_0xdf7f('0x1d3')](_0x33c766,_0x4c1d30,_0x28306c,_0x1510aa,_0x30addf);})[_0xdf7f('0xbb')](function(_0x4e1362){return _0x5343bb(_0x4e1362);})['catch'](function(_0x3a3ffd){return _0x1325f3(msgResponse(_0xdf7f('0x1da'),'Failure',JSON[_0xdf7f('0x49')](_0x3a3ffd)));});}if(_0x462472[_0xdf7f('0x1c3')]===_0xdf7f('0x1d4')){return _0x1642f9[_0xdf7f('0xca')](_0x462472['id'])[_0xdf7f('0xbb')](function(_0x20feef){var _0x555604=_0x462472[_0xdf7f('0x53')]-_0x20feef[0x0][_0xdf7f('0x1d9')];var _0x1fc291=_0x462472[_0xdf7f('0x1c9')]*0x3c;var _0x1ecc2d=_0x2d7207[0x0][_0xdf7f('0x88')]+_0x2d7207[0x0]['predictiveIntervalAvgHoldtime'];var _0x29513e=(_0x2d7207[0x0][_0xdf7f('0x6b')]+_0x2d7207[0x0][_0xdf7f('0x1db')]+_0x2d7207[0x0][_0xdf7f('0x114')])/_0x2d7207[0x0][_0xdf7f('0x72')];var _0x833b3a=_0x462472[_0xdf7f('0x1d2')]/0x64;_0x462472[_0xdf7f('0x71')]=_0x20feef[0x0]['outboundQueuePauses']||0x0;_0x462472[_0xdf7f('0x6f')]=_0x29513e>0x0?_0x29513e:0x1;return _0x1642f9[_0xdf7f('0x1d5')](_0x555604,_0x1fc291,_0x1ecc2d,_0x29513e,_0x833b3a);})['then'](function(_0x17dace){return _0x5343bb(_0x17dace);})[_0xdf7f('0xb4')](function(_0x3895ed){return _0x1325f3(msgResponse(_0xdf7f('0x1da'),_0xdf7f('0x136'),JSON[_0xdf7f('0x49')](_0x3895ed)));});}}else{return _0x1325f3(msgResponse(_0xdf7f('0x1d6'),'Failure',_0xdf7f('0x1d7')));}});};};Dialer[_0xdf7f('0xad')][_0xdf7f('0x1cd')]=function(_0x505ce2){var _0x46e25e=this;return function(){var _0x4be46c=0x0;var _0x17163f=Math['floor'](_0x505ce2[_0xdf7f('0x75')]*0x3e8);if(_0x17163f>0x0){_0x17163f=_0x17163f<0x64?0x64:_0x17163f;loggerPredictive[_0xdf7f('0x80')](_0x505ce2[_0xdf7f('0x3e')],'one\x20call\x20every:',_0x17163f,_0xdf7f('0x4a'));_0x505ce2[_0xdf7f('0x93')]=setInterval(function(){_0x46e25e[_0xdf7f('0x93')](_0x505ce2);loggerPredictiveCalls['info'](_0xdf7f('0x1dc'),_0x4be46c+=0x1);},_0x17163f);}else{loggerPredictive[_0xdf7f('0x80')](_0x505ce2[_0xdf7f('0x3e')],_0xdf7f('0x1dd'));}};};Dialer['prototype'][_0xdf7f('0x1de')]=function(_0x451b5f,_0x1e65bd){var _0x32f1e4=this;return function(_0x2e9736){if(_[_0xdf7f('0x46')](_0x2e9736)){if(_[_0xdf7f('0xb1')](_0x1e65bd[_0xdf7f('0xd7')])||!_0x1e65bd[_0xdf7f('0x1df')]){if(_0x451b5f[_0xdf7f('0x5d')]===_0xdf7f('0x5')){_0x451b5f['queueStatusComplete']=_['isUndefined'](_0x451b5f['queueStatusComplete'])?!![]:_0x451b5f[_0xdf7f('0x120')];var _0x3bc7d7=uuid['v4']();_0x32f1e4[_0xdf7f('0xaf')][_0x3bc7d7]=new Action(_0x451b5f,_0x1e65bd,_0x3bc7d7);loggerBooked[_0xdf7f('0x80')](_0xdf7f('0x1e0'),_0x3bc7d7,_0xdf7f('0x1e1'),JSON[_0xdf7f('0x49')](_0x451b5f[_0xdf7f('0x120')]),_0xdf7f('0x1e2'),_0x451b5f[_0xdf7f('0x3e')]);if(_0x451b5f['queueStatusComplete']){_0x451b5f['queueStatusComplete']=![];_0x32f1e4[_0xdf7f('0x2c')][_0x32f1e4['actions'][_0x3bc7d7][_0xdf7f('0xb7')]]=[];ami[_0xdf7f('0xb2')]({'actionid':_0x3bc7d7,'action':_0xdf7f('0x1e3'),'queue':_0x451b5f[_0xdf7f('0x3e')]})[_0xdf7f('0xb4')](function(_0x3e0421){_0x32f1e4[_0xdf7f('0xb6')](_0x451b5f);_0x32f1e4[_0xdf7f('0xc3')]({'active':![],'ContactId':_0x32f1e4[_0xdf7f('0xaf')][_0x3bc7d7]['ContactId'],'ListId':_0x32f1e4[_0xdf7f('0xaf')][_0x3bc7d7]['ListId'],'VoiceQueueId':_0x32f1e4['actions'][_0x3bc7d7][_0xdf7f('0xd8')]||undefined,'CampaignId':_0x32f1e4[_0xdf7f('0xaf')][_0x3bc7d7]['CampaignId']||undefined})[_0xdf7f('0xb4')](loggerCatch(_0xdf7f('0x1e4')));delete _0x32f1e4[_0xdf7f('0xaf')][_0x3bc7d7];});}else{loggerBooked[_0xdf7f('0x80')](_0xdf7f('0x1e5'),JSON['stringify'](_0x451b5f[_0xdf7f('0x120')]),_0xdf7f('0x1e2'),_0x451b5f[_0xdf7f('0x3e')]);_0x32f1e4[_0xdf7f('0xb6')](_0x451b5f);_0x32f1e4[_0xdf7f('0xc3')]({'active':![],'ContactId':_0x32f1e4[_0xdf7f('0xaf')][_0x3bc7d7][_0xdf7f('0xd5')],'ListId':_0x32f1e4[_0xdf7f('0xaf')][_0x3bc7d7][_0xdf7f('0xd6')],'VoiceQueueId':_0x32f1e4[_0xdf7f('0xaf')][_0x3bc7d7][_0xdf7f('0xd8')]||undefined,'CampaignId':_0x32f1e4[_0xdf7f('0xaf')][_0x3bc7d7][_0xdf7f('0xd9')]||undefined})['catch'](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x32f1e4[_0xdf7f('0xaf')][_0x3bc7d7];}}else{return _0x32f1e4[_0xdf7f('0x15c')](_0x451b5f,_0x1e65bd);}}else{if(getDiff(_0x1e65bd[_0xdf7f('0x1e6')])<_0x451b5f[_0xdf7f('0x1e7')]*0x3c){if(_0x1e65bd[_0xdf7f('0x1e8')]&&!_0x1e65bd[_0xdf7f('0x1e8')]['voicePause']){_0x32f1e4[_0xdf7f('0x20')][_0xdf7f('0x124')](_0x1e65bd['id'])[_0xdf7f('0x1f')](function(){_0x32f1e4[_0xdf7f('0xb6')](_0x451b5f);});}else{_0x32f1e4[_0xdf7f('0xc5')]({'active':![]},_0x1e65bd['id'],0x1)[_0xdf7f('0x1f')](function(){console[_0xdf7f('0x1e9')]('Contact\x20updated');_0x32f1e4[_0xdf7f('0xb6')](_0x451b5f);});}}else{_0x451b5f[_0xdf7f('0x1ea')]+=0x1;_0x32f1e4[_0xdf7f('0xb6')](_0x451b5f);if(_0x451b5f[_0xdf7f('0x1eb')]){_0x32f1e4[_0xdf7f('0xc3')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x1e65bd[_0xdf7f('0xd5')],'ListId':_0x1e65bd[_0xdf7f('0xd6')],'VoiceQueueId':_0x1e65bd[_0xdf7f('0xd8')]||undefined,'CampaignId':_0x1e65bd[_0xdf7f('0xd9')]||undefined})[_0xdf7f('0xb4')](loggerCatch(_0xdf7f('0x1ec')));_0x32f1e4['createHistory'](createObjHistory(_0x451b5f,_0x1e65bd,_0xdf7f('0x1ed'),0x17,_0xdf7f('0x1ee')))['catch'](loggerCatch(_0xdf7f('0x1ef')));}else{_0x32f1e4['saveInDb'](createObjHistory(_0x451b5f,_0x1e65bd,_0xdf7f('0x1f0'),0x16,_0xdf7f('0x1f1')),'[Originate][HistoryRecallClose][historyCatch]',_0xdf7f('0x1f2'));}}}}else{_0x451b5f[_0xdf7f('0x1f3')]+=0x1;_0x32f1e4['saveInDb'](createObjHistory(_0x451b5f,_0x1e65bd,_0xdf7f('0x1f4'),0xd,_0xdf7f('0x1f5')),_0xdf7f('0x1f6'),_0xdf7f('0x1f7'));throw _0xdf7f('0x1f8');}};};Dialer[_0xdf7f('0xad')][_0xdf7f('0x1f9')]=function(_0x317d0f){var _0x4d7806=this;var _0x28edda=[];var _0x59ee28=_0x317d0f[_0xdf7f('0x1fa')]-_0x317d0f[_0xdf7f('0x73')]-_0x317d0f[_0xdf7f('0x1fb')];emitCampaignSummary(_0x317d0f);if(_0x59ee28>0x0){if(_0x59ee28>this[_0xdf7f('0x25')]){_0x59ee28=this[_0xdf7f('0x25')];}_0x317d0f[_0xdf7f('0x1fb')]+=_0x59ee28;this[_0xdf7f('0xc8')](_0x317d0f['id'],_0x59ee28,_0x317d0f[_0xdf7f('0x1fc')])[_0xdf7f('0xbb')](function(_0x6cc4b7){_0x317d0f['temp']-=_0x59ee28;_0x317d0f['temp']=_0x317d0f[_0xdf7f('0x1fb')]>0x0?_0x317d0f[_0xdf7f('0x1fb')]:0x0;if(!checkContactEmpty(_0x6cc4b7)){_0x317d0f[_0xdf7f('0x42')]='AVAILABLE_CONTACTS_FINISHED';logger[_0xdf7f('0x80')](_0xdf7f('0x1fd')+_0x317d0f[_0xdf7f('0x3e')]);}else{_0x317d0f[_0xdf7f('0x73')]+=_0x6cc4b7[_0xdf7f('0x9c')];_0x317d0f['message']=_0xdf7f('0x1fe');for(var _0x280c11=0x0;_0x280c11<_0x6cc4b7[_0xdf7f('0x9c')];_0x280c11+=0x1){_0x317d0f[_0xdf7f('0x1ff')]+=0x1;if(_[_0xdf7f('0xb1')](_0x6cc4b7[_0x280c11])||_[_0xdf7f('0xb1')](_0x6cc4b7[_0x280c11][_0xdf7f('0x160')])||_['isNil'](_0x6cc4b7[_0x280c11]['Contact']['phone'])){_0x4d7806[_0xdf7f('0xd2')](_0xdf7f('0x200'),_0x317d0f,_0x6cc4b7[_0x280c11]);}else{_0x4d7806[_0xdf7f('0xbf')](_[_0xdf7f('0xd4')](_0x6cc4b7[_0x280c11],[_0xdf7f('0xd9'),'Contact.phone']))[_0xdf7f('0xbb')](_0x4d7806[_0xdf7f('0x1de')](_0x317d0f,_0x6cc4b7[_0x280c11]))[_0xdf7f('0xb4')](_0x4d7806[_0xdf7f('0xd1')](_0xdf7f('0x201'),_0x317d0f));}}}})[_0xdf7f('0xb4')](loggerGetContactDialer(_0xdf7f('0x202'),_0x317d0f,_0x59ee28));}};Dialer[_0xdf7f('0xad')][_0xdf7f('0x14c')]=function(_0x2716ee,_0x6002f2){var _0x2d54ba=this;var _0x449d4a=[];var _0x305543=_0x6002f2>=0x1?_0x6002f2:0x1;var _0x61cdb4=[];if(_0x2716ee[_0xdf7f('0x5d')]===_0xdf7f('0x5')){_0x305543=0x1;}var _0x3967ce=Math[_0xdf7f('0x1bd')](_0x2716ee[_0xdf7f('0x52')]*_0x305543)-_0x2716ee[_0xdf7f('0x73')]-_0x2716ee[_0xdf7f('0x1fb')];emitVoiceQueueSummary(_0x2716ee);if(_0x2716ee[_0xdf7f('0x203')]>0x0){var _0xe426f0=_0x2716ee[_0xdf7f('0x203')]-_0x2716ee[_0xdf7f('0x73')]-_0x2716ee[_0xdf7f('0x57')]-_0x2716ee[_0xdf7f('0x1fb')]-_0x2716ee[_0xdf7f('0x54')];if(_0x3967ce>_0xe426f0){_0x3967ce=_0xe426f0;}}if(_0x3967ce>0x0){if(_0x2716ee['dialMethod']===_0xdf7f('0x5')){_0x3967ce=0x1;}if(_0x3967ce>this[_0xdf7f('0x25')]){_0x3967ce=this['maxNumberOriginate'];}_0x2716ee[_0xdf7f('0x1fb')]+=_0x3967ce;for(var _0x1b831a in this[_0xdf7f('0x23')]){if(this['agents'][_0xdf7f('0x9d')](_0x1b831a)){if(this['agents'][_0x1b831a][_0xdf7f('0xa9')]===_0xdf7f('0x204')&&this[_0xdf7f('0x23')][_0x1b831a][_0xdf7f('0xb3')]==='reachable'){_0x449d4a[_0xdf7f('0x11f')](this[_0xdf7f('0x23')][_0x1b831a]['id']);}}}this[_0xdf7f('0xc7')](_0x2716ee['id'],_0x449d4a,_0x3967ce,_0x2716ee[_0xdf7f('0x1fc')])[_0xdf7f('0xbb')](function(_0x5a72c3){_0x2716ee[_0xdf7f('0x1fb')]-=_0x3967ce;_0x2716ee[_0xdf7f('0x1fb')]=_0x2716ee[_0xdf7f('0x1fb')]>0x0?_0x2716ee[_0xdf7f('0x1fb')]:0x0;if(!checkContactEmpty(_0x5a72c3)){_0x2d54ba[_0xdf7f('0xb9')](_0x2716ee)[_0xdf7f('0xbb')](sendMessageReschedule(_0x2716ee))['catch'](loggerCatch(_0xdf7f('0xbc')));}else{_0x2716ee[_0xdf7f('0x73')]+=_0x5a72c3[_0xdf7f('0x9c')];_0x2716ee['message']=_0x2716ee[_0xdf7f('0x5d')]===_0xdf7f('0x5')?'ACTIVE':_0xdf7f('0x1fe');for(var _0x42a398=0x0;_0x42a398<_0x5a72c3[_0xdf7f('0x9c')];_0x42a398+=0x1){if(_[_0xdf7f('0xb1')](_0x5a72c3[_0x42a398])||_['isNil'](_0x5a72c3[_0x42a398]['Contact'])||_[_0xdf7f('0xb1')](_0x5a72c3[_0x42a398][_0xdf7f('0x160')][_0xdf7f('0x161')])){_0x2d54ba[_0xdf7f('0xd2')]('[actionOriginate]\x20',_0x2716ee,_0x5a72c3[_0x42a398]);}else{_0x2d54ba[_0xdf7f('0xbd')](_[_0xdf7f('0xd4')](_0x5a72c3[_0x42a398],[_0xdf7f('0xd8'),'Contact.phone']))[_0xdf7f('0xbb')](_0x2d54ba['checkContactBlack'](_0x2716ee,_0x5a72c3[_0x42a398]))[_0xdf7f('0xb4')](_0x2d54ba[_0xdf7f('0xd1')](_0xdf7f('0x200'),_0x2716ee));}}}})['catch'](loggerGetContactDialer(_0xdf7f('0x205'),_0x2716ee,_0x3967ce));}};Dialer[_0xdf7f('0xad')][_0xdf7f('0x93')]=function(_0x44f919){var _0x4eec50=this;if(_0x44f919[_0xdf7f('0x203')]>0x0){var _0x353c26=_0x44f919[_0xdf7f('0x203')]-_0x44f919['originated']-_0x44f919[_0xdf7f('0x57')];if(_0x353c26>0x0){this[_0xdf7f('0x206')](_0x44f919);}else{loggerPredictiveCalls[_0xdf7f('0x80')](_0xdf7f('0x207'));}}else{this[_0xdf7f('0x206')](_0x44f919);}};Dialer[_0xdf7f('0xad')][_0xdf7f('0x206')]=function(_0x58d1f5){var _0x5108c3=this;var _0x287fbd=[];_0x58d1f5[_0xdf7f('0x73')]+=0x1;for(var _0x9629de in this[_0xdf7f('0x23')]){if(this['agents'][_0xdf7f('0x9d')](_0x9629de)){if(this[_0xdf7f('0x23')][_0x9629de][_0xdf7f('0xa9')]==='not_inuse'&&this['agents'][_0x9629de]['status']==='reachable'){_0x287fbd[_0xdf7f('0x11f')](this[_0xdf7f('0x23')][_0x9629de]['id']);}}}this[_0xdf7f('0xc7')](_0x58d1f5['id'],_0x287fbd,0x1,_0x58d1f5['dialOrderByScheduledAt'])['then'](function(_0x394272){if(!checkContactEmpty(_0x394272)){checkContactLowerLimitOriginate(_0x58d1f5,0x1,0x0);_0x5108c3[_0xdf7f('0xb9')](_0x58d1f5)['then'](sendMessageReschedule(_0x58d1f5))[_0xdf7f('0xb4')](loggerCatch(_0xdf7f('0xbc')));}else{_0x58d1f5[_0xdf7f('0x42')]=_0xdf7f('0x1fe');if(_['isNil'](_0x394272[0x0])||_[_0xdf7f('0xb1')](_0x394272[0x0][_0xdf7f('0x160')])||_[_0xdf7f('0xb1')](_0x394272[0x0]['Contact'][_0xdf7f('0x161')])){_0x5108c3[_0xdf7f('0xd2')](_0xdf7f('0x200'),_0x58d1f5,_0x394272[0x0]);}else{_0x5108c3[_0xdf7f('0xbd')](_[_0xdf7f('0xd4')](_0x394272[0x0],[_0xdf7f('0xd8'),_0xdf7f('0x208')]))[_0xdf7f('0xbb')](_0x5108c3['checkContactBlack'](_0x58d1f5,_0x394272[0x0]))[_0xdf7f('0xb4')](_0x5108c3[_0xdf7f('0xd1')]('[actionOriginatePredictive]\x20',_0x58d1f5));}}})[_0xdf7f('0xb4')](loggerGetContactDialer(_0xdf7f('0x209'),_0x58d1f5,0x1));emitVoiceQueueSummary(_0x58d1f5);};Dialer[_0xdf7f('0xad')][_0xdf7f('0x1d3')]=function(_0x2bc60f,_0x57b437,_0x3d8025,_0x4c996f,_0x4d4cd8,_0x16548b){loggerPredictive[_0xdf7f('0x80')](_0xdf7f('0x20a'));loggerPredictive['info'](_0xdf7f('0x20b'),_0x2bc60f);loggerPredictive[_0xdf7f('0x80')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x57b437);loggerPredictive[_0xdf7f('0x80')]('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',_0x3d8025);loggerPredictive[_0xdf7f('0x80')](_0xdf7f('0x20c'),_0x4c996f);loggerPredictive[_0xdf7f('0x80')](_0xdf7f('0x20d'),_0x4d4cd8);loggerPredictive[_0xdf7f('0x80')](_0xdf7f('0x89'));return new BPromise(function(_0x33e4a4,_0x1e69dd){if(_0x2bc60f<=0x0||isNaN(_0x2bc60f)){return _0x1e69dd(msgResponse(_0xdf7f('0x20e'),_0xdf7f('0x48'),_0xdf7f('0x20f')+_0x2bc60f));}if(_0x3d8025<=0x0||isNaN(_0x3d8025)){return _0x1e69dd(msgResponse(_0xdf7f('0x20e'),'Error',_0xdf7f('0x210')+_0x3d8025));}if(_0x4c996f<=0x0||isNaN(_0x4c996f)){return _0x1e69dd(msgResponse(_0xdf7f('0x20e'),_0xdf7f('0x48'),'p\x20=\x20'+_0x4c996f));}if(_0x57b437<=0x0||isNaN(_0x57b437)){return _0x1e69dd(msgResponse('[abandonmentRate]',_0xdf7f('0x48'),'interval\x20=\x20'+_0x57b437));}if(_0x4d4cd8<=0x0||isNaN(_0x4d4cd8)){return _0x1e69dd(msgResponse('[abandonmentRate]','Error',_0xdf7f('0x211')+_0x4d4cd8));}_0x16548b=_0x16548b||0x0;var _0x221317=0x1/_0x3d8025;var _0x480a96=0x0;var _0x23e67b=0x0;var _0x1f34a4=0x0;var _0x232585=0x0;for(var _0x190b65=0x0;_0x1f34a4<_0x4d4cd8;_0x190b65+=0x1){_0x23e67b=_0x190b65/_0x57b437;_0x480a96=(_0x4c996f*_0x23e67b+_0x16548b)/_0x221317;_0x1f34a4=erlangb(_0x480a96,_0x2bc60f);_0x232585=_0x480a96/_0x2bc60f*(0x1-erlangb(_0x480a96,_0x2bc60f));}return _0x33e4a4({'erlangCalls':_0x190b65,'erlangCallToSecond':_0x57b437/_0x190b65,'erlangAbandonmentRate':_0x1f34a4,'erlangBusyFactor':_0x232585});});};Dialer[_0xdf7f('0xad')]['busyFactor']=function(_0x2cba2c,_0x1229d0,_0x5f42a0,_0x3f5e78,_0x61949,_0x593c17){loggerPredictive[_0xdf7f('0x80')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0xdf7f('0x80')](_0xdf7f('0x20b'),_0x2cba2c);loggerPredictive['info'](_0xdf7f('0x212'),_0x1229d0);loggerPredictive['info'](_0xdf7f('0x213'),_0x5f42a0);loggerPredictive['info'](_0xdf7f('0x20c'),_0x3f5e78);loggerPredictive[_0xdf7f('0x80')](_0xdf7f('0x214'),_0x61949);loggerPredictive['info'](_0xdf7f('0x89'));return new BPromise(function(_0x1e3fe0,_0x5d3b2c){if(_0x2cba2c<=0x0||isNaN(_0x2cba2c)){return _0x5d3b2c(msgResponse(_0xdf7f('0x215'),_0xdf7f('0x48'),_0xdf7f('0x20f')+_0x2cba2c));}if(_0x5f42a0<=0x0||isNaN(_0x5f42a0)){return _0x5d3b2c(msgResponse(_0xdf7f('0x215'),_0xdf7f('0x48'),_0xdf7f('0x210')+_0x5f42a0));}if(_0x3f5e78<=0x0||isNaN(_0x3f5e78)){return _0x5d3b2c(msgResponse('[busyFactor]','Error',_0xdf7f('0x216')+_0x3f5e78));}if(_0x1229d0<=0x0||isNaN(_0x1229d0)){return _0x5d3b2c(msgResponse('[busyFactor]',_0xdf7f('0x48'),'interval\x20=\x20'+_0x1229d0));}if(_0x61949<=0x0||isNaN(_0x61949)){return _0x5d3b2c(msgResponse('[busyFactor]',_0xdf7f('0x48'),'Umin\x20=\x20'+_0x61949));}_0x593c17=_0x593c17||0x0;var _0x2da3a5=0x1/_0x5f42a0;var _0x240d79=0x0;var _0x59cd1c=0x0;var _0xa4bde8=0x0;var _0x2985f3=0x0;for(var _0x1e5ef8=0x0;_0x2985f3<_0x61949;_0x1e5ef8+=0x1){_0x59cd1c=_0x1e5ef8/_0x1229d0;_0x240d79=(_0x3f5e78*_0x59cd1c+_0x593c17)/_0x2da3a5;_0xa4bde8=erlangb(_0x240d79,_0x2cba2c);_0x2985f3=_0x240d79/_0x2cba2c*(0x1-erlangb(_0x240d79,_0x2cba2c));}return _0x1e3fe0({'erlangCalls':_0x1e5ef8,'erlangCallToSecond':_0x1229d0/_0x1e5ef8,'erlangAbandonmentRate':_0xa4bde8,'erlangBusyFactor':_0x2985f3});});};module[_0xdf7f('0x217')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index 967363e..fb72aba 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 _0x5fcf=['UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','seconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countagentrejectretry','countnosuchnumberretry','countmachineretry','uniqueid','calleridnum','number','starttime','responsetime','droptime','endtime','ringtime','holdtime','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId'];(function(_0xe7bd04,_0x1fe665){var _0x40c965=function(_0x17e42f){while(--_0x17e42f){_0xe7bd04['push'](_0xe7bd04['shift']());}};_0x40c965(++_0x1fe665);}(_0x5fcf,0x192));var _0xf5fc=function(_0x4e5750,_0x2e6c39){_0x4e5750=_0x4e5750-0x0;var _0x44b411=_0x5fcf[_0x4e5750];return _0x44b411;};'use strict';var util=require(_0xf5fc('0x0'));var _=require(_0xf5fc('0x1'));var moment=require(_0xf5fc('0x2'));function getSeconds(_0xe6814a,_0x488753){var _0x5663d9=moment(_0xe6814a)[_0xf5fc('0x3')](0x0);var _0x3c5fc2=moment(_0x488753)[_0xf5fc('0x3')](0x0);return _0x5663d9['diff'](_0x3c5fc2,_0xf5fc('0x4'));}function QueueCallerAbandon(_0x1a2d3b,_0x501974){this[_0xf5fc('0x5')]=_0x1a2d3b['scheduledat'];this['type']=_0x1a2d3b[_0xf5fc('0x6')];this[_0xf5fc('0x7')]=_0x1a2d3b[_0xf5fc('0x6')]===_0xf5fc('0x8')?_0xf5fc('0x9'):_0x1a2d3b[_0xf5fc('0x6')];this[_0xf5fc('0xa')]=_0x1a2d3b[_0xf5fc('0xa')];this[_0xf5fc('0xb')]=_0x1a2d3b[_0xf5fc('0xb')];this[_0xf5fc('0xc')]=_0x1a2d3b[_0xf5fc('0xc')];this[_0xf5fc('0xd')]=_0x1a2d3b[_0xf5fc('0xa')]+_0x1a2d3b[_0xf5fc('0xb')]+_0x1a2d3b[_0xf5fc('0xc')]+_0x1a2d3b['countnosuchnumberretry']+_0x1a2d3b[_0xf5fc('0xe')]+_0x1a2d3b[_0xf5fc('0xf')]+_0x1a2d3b['countmachineretry']+_0x1a2d3b[_0xf5fc('0x10')];this[_0xf5fc('0x11')]=_0x1a2d3b[_0xf5fc('0x11')];this[_0xf5fc('0xe')]=_0x1a2d3b[_0xf5fc('0xe')];this[_0xf5fc('0xf')]=_0x1a2d3b['countabandonedretry'];this['countmachineretry']=_0x1a2d3b[_0xf5fc('0x12')];this[_0xf5fc('0x10')]=_0x1a2d3b[_0xf5fc('0x10')];this[_0xf5fc('0x13')]=_0x501974[_0xf5fc('0x13')];this['calleridname']=_0x1a2d3b['name'];this[_0xf5fc('0x14')]=_0x1a2d3b[_0xf5fc('0x15')];this[_0xf5fc('0x16')]=_0x1a2d3b['starttime'];this[_0xf5fc('0x17')]=_0x1a2d3b[_0xf5fc('0x17')];this[_0xf5fc('0x18')]=_0x1a2d3b[_0xf5fc('0x18')];this[_0xf5fc('0x19')]=this[_0xf5fc('0x18')];this[_0xf5fc('0x1a')]=getSeconds(_0x1a2d3b[_0xf5fc('0x17')],_0x1a2d3b[_0xf5fc('0x16')]);this[_0xf5fc('0x1b')]=getSeconds(this[_0xf5fc('0x18')],_0x1a2d3b['responsetime']);this[_0xf5fc('0x1c')]=0x0;this['queue']=_0x501974[_0xf5fc('0x9')];this[_0xf5fc('0x1d')]=_0x501974[_0xf5fc('0x1e')];this['reason']=_0x501974[_0xf5fc('0x1f')];this[_0xf5fc('0x20')]=_0x1a2d3b[_0xf5fc('0x20')];this[_0xf5fc('0x21')]=_0x1a2d3b[_0xf5fc('0x21')];this[_0xf5fc('0x22')]=_0x1a2d3b['callbackat'];this[_0xf5fc('0x23')]=_0x1a2d3b[_0xf5fc('0x23')];this[_0xf5fc('0x24')]=_0x1a2d3b[_0xf5fc('0x24')];this[_0xf5fc('0x25')]=_0x1a2d3b['ListId'];this[_0xf5fc('0x26')]=_0x1a2d3b['UserId'];this[_0xf5fc('0x27')]=_0x1a2d3b[_0xf5fc('0x27')];this[_0xf5fc('0x28')]=_0x1a2d3b['CampaignId'];this['originatecalleridnum']=_0x1a2d3b[_0xf5fc('0x29')]||'';this['originatecalleridname']=_0x1a2d3b[_0xf5fc('0x2a')]||'';}module[_0xf5fc('0x2b')]=QueueCallerAbandon; \ No newline at end of file +var _0x0695=['callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','exports','util','lodash','moment','milliseconds','diff','seconds','scheduledat','type','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','uniqueid','calleridname','name','calleridnum','number','starttime','droptime','endtime','responsetime','talktime','queue','membername','connectedlinename','reason','callback','callbackuniqueid'];(function(_0x5e0833,_0x11d762){var _0x55f01c=function(_0xc30fb2){while(--_0xc30fb2){_0x5e0833['push'](_0x5e0833['shift']());}};_0x55f01c(++_0x11d762);}(_0x0695,0x183));var _0x5069=function(_0x4420ec,_0x4d2f9e){_0x4420ec=_0x4420ec-0x0;var _0x530b66=_0x0695[_0x4420ec];return _0x530b66;};'use strict';var util=require(_0x5069('0x0'));var _=require(_0x5069('0x1'));var moment=require(_0x5069('0x2'));function getSeconds(_0x120e26,_0xb57b3){var _0x1711a7=moment(_0x120e26)[_0x5069('0x3')](0x0);var _0x34805d=moment(_0xb57b3)[_0x5069('0x3')](0x0);return _0x1711a7[_0x5069('0x4')](_0x34805d,_0x5069('0x5'));}function QueueCallerAbandon(_0x2b27be,_0x3d5420){this[_0x5069('0x6')]=_0x2b27be[_0x5069('0x6')];this['type']=_0x2b27be[_0x5069('0x7')];this['campaigntype']=_0x2b27be[_0x5069('0x7')]==='outbound'?'queue':_0x2b27be[_0x5069('0x7')];this[_0x5069('0x8')]=_0x2b27be[_0x5069('0x8')];this[_0x5069('0x9')]=_0x2b27be[_0x5069('0x9')];this[_0x5069('0xa')]=_0x2b27be[_0x5069('0xa')];this[_0x5069('0xb')]=_0x2b27be['countbusyretry']+_0x2b27be[_0x5069('0x9')]+_0x2b27be['countnoanswerretry']+_0x2b27be[_0x5069('0xc')]+_0x2b27be[_0x5069('0xd')]+_0x2b27be['countabandonedretry']+_0x2b27be[_0x5069('0xe')]+_0x2b27be[_0x5069('0xf')];this['countnosuchnumberretry']=_0x2b27be[_0x5069('0xc')];this[_0x5069('0xd')]=_0x2b27be[_0x5069('0xd')];this[_0x5069('0x10')]=_0x2b27be[_0x5069('0x10')];this[_0x5069('0xe')]=_0x2b27be[_0x5069('0xe')];this[_0x5069('0xf')]=_0x2b27be[_0x5069('0xf')];this[_0x5069('0x11')]=_0x3d5420['uniqueid'];this[_0x5069('0x12')]=_0x2b27be[_0x5069('0x13')];this[_0x5069('0x14')]=_0x2b27be[_0x5069('0x15')];this[_0x5069('0x16')]=_0x2b27be[_0x5069('0x16')];this['responsetime']=_0x2b27be['responsetime'];this[_0x5069('0x17')]=_0x2b27be[_0x5069('0x17')];this[_0x5069('0x18')]=this['droptime'];this['ringtime']=getSeconds(_0x2b27be[_0x5069('0x19')],_0x2b27be['starttime']);this['holdtime']=getSeconds(this[_0x5069('0x17')],_0x2b27be[_0x5069('0x19')]);this[_0x5069('0x1a')]=0x0;this[_0x5069('0x1b')]=_0x3d5420[_0x5069('0x1b')];this[_0x5069('0x1c')]=_0x3d5420[_0x5069('0x1d')];this['reason']=_0x3d5420[_0x5069('0x1e')];this[_0x5069('0x1f')]=_0x2b27be[_0x5069('0x1f')];this['callbackuniqueid']=_0x2b27be[_0x5069('0x20')];this[_0x5069('0x21')]=_0x2b27be['callbackat'];this[_0x5069('0x22')]=_0x2b27be[_0x5069('0x22')];this[_0x5069('0x23')]=_0x2b27be[_0x5069('0x23')];this[_0x5069('0x24')]=_0x2b27be[_0x5069('0x24')];this[_0x5069('0x25')]=_0x2b27be[_0x5069('0x25')];this[_0x5069('0x26')]=_0x2b27be['VoiceQueueId'];this[_0x5069('0x27')]=_0x2b27be[_0x5069('0x27')];this[_0x5069('0x28')]=_0x2b27be[_0x5069('0x28')]||'';this['originatecalleridname']=_0x2b27be['originatecalleridname']||'';}module[_0x5069('0x29')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 218a584..ef0f3b6 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 _0xd223=['localstationid','headerinfo','path','AttachmentId','exports','util','lodash','uniqueid','channel','%s/%s/%s','tech','Trunk','name','fax'];(function(_0x131e60,_0x5352ce){var _0x4bc497=function(_0x2a758e){while(--_0x2a758e){_0x131e60['push'](_0x131e60['shift']());}};_0x4bc497(++_0x5352ce);}(_0xd223,0xe5));var _0x3d22=function(_0x2843ee,_0x423d24){_0x2843ee=_0x2843ee-0x0;var _0x11295d=_0xd223[_0x2843ee];return _0x11295d;};'use strict';var util=require(_0x3d22('0x0'));var _=require(_0x3d22('0x1'));var moment=require('moment');function Action(_0x59c577,_0x115403,_0xbad4c6){this[_0x3d22('0x2')]=_0x59c577||undefined;this[_0x3d22('0x3')]=util['format'](_0x3d22('0x4'),_0x115403[_0x3d22('0x5')],_0x115403[_0x3d22('0x6')][_0x3d22('0x7')],_0xbad4c6[_0x3d22('0x8')]);this['localstationid']=_0x115403[_0x3d22('0x9')];this['headerinfo']=_0x115403[_0x3d22('0xa')];this[_0x3d22('0xb')]=_0xbad4c6[_0x3d22('0xb')];this['AttachmentId']=_0xbad4c6[_0x3d22('0xc')];}module[_0x3d22('0xd')]=Action; \ No newline at end of file +var _0xb9b1=['tech','name','fax','localstationid','path','AttachmentId','exports','lodash','moment','uniqueid','channel','format'];(function(_0x14b464,_0x5139ea){var _0xd22441=function(_0x38428c){while(--_0x38428c){_0x14b464['push'](_0x14b464['shift']());}};_0xd22441(++_0x5139ea);}(_0xb9b1,0x1e7));var _0x1b9b=function(_0x2895ca,_0x11e52d){_0x2895ca=_0x2895ca-0x0;var _0x3a1c83=_0xb9b1[_0x2895ca];return _0x3a1c83;};'use strict';var util=require('util');var _=require(_0x1b9b('0x0'));var moment=require(_0x1b9b('0x1'));function Action(_0x24cefa,_0x2355f6,_0x57a74e){this[_0x1b9b('0x2')]=_0x24cefa||undefined;this[_0x1b9b('0x3')]=util[_0x1b9b('0x4')]('%s/%s/%s',_0x2355f6[_0x1b9b('0x5')],_0x2355f6['Trunk'][_0x1b9b('0x6')],_0x57a74e[_0x1b9b('0x7')]);this[_0x1b9b('0x8')]=_0x2355f6[_0x1b9b('0x8')];this['headerinfo']=_0x2355f6['headerinfo'];this[_0x1b9b('0x9')]=_0x57a74e['path'];this[_0x1b9b('0xa')]=_0x57a74e[_0x1b9b('0xa')];}module[_0x1b9b('0xb')]=Action; \ No newline at end of file diff --git a/server/services/ami/fax/index.js b/server/services/ami/fax/index.js index 9102152..c174731 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 _0xbf6c=['syncNewchannel','context','from-voip-provider','exten','localstationid','uniqueid','channel','name','\x20syncNewchannel\x20','info','variable','hasOwnProperty','value','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','notify','error','\x20notify\x20','stringify','catch','\x20receiveFax\x20','merge','pick','reason','update','SENDING\x20FAILED\x20','then','logger','[Fax][Message][Error][NoUpdate2]','[Fax][Message][NoUpdate1]','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','faxstatus','updateStatus','faxstatusstring','SENDING\x20FAILED:\x20','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','Trunk\x20Reachable','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','format','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','variablesAction','Action','addVariables','isTrunkReachable','active','isNil','trunks','SIP/%s','reachable','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','util','lodash','uuid','moment','path','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','actions','newchannel','varset','syncVarSet','bind','syncNewState','newexten','syncNewExten','syncFaxStatus','receivefax','syncReceiveFax','hangup','originateresponse','prototype'];(function(_0xfbdff6,_0x2af690){var _0x4cb9be=function(_0x4022d8){while(--_0x4022d8){_0xfbdff6['push'](_0xfbdff6['shift']());}};_0x4cb9be(++_0x2af690);}(_0xbf6c,0x1a6));var _0xcbf6=function(_0x4f7196,_0x5371b){_0x4f7196=_0x4f7196-0x0;var _0xfc3c7b=_0xbf6c[_0x4f7196];return _0xfc3c7b;};'use strict';var util=require(_0xcbf6('0x0'));var _=require(_0xcbf6('0x1'));var BPromise=require('bluebird');var uuid=require(_0xcbf6('0x2'));var moment=require(_0xcbf6('0x3'));var path=require(_0xcbf6('0x4'));var tiff2pdf=require(_0xcbf6('0x5'));var gs=require(_0xcbf6('0x6'));var logger=require(_0xcbf6('0x7'))(_0xcbf6('0x8'));var ami=require(_0xcbf6('0x9'));var rpcDb=require('./rpcDb');var Channel=require('./channel');var ut=require('./util/util');var Action=require(_0xcbf6('0xa'));var faxAccount=require(_0xcbf6('0xb'));var attachment=require(_0xcbf6('0xc'));var faxMessage=require(_0xcbf6('0xd'));function Fax(_0x40d87b){this[_0xcbf6('0xe')]={};this['faxAccounts']=_0x40d87b[_0xcbf6('0xf')];this['trunks']=_0x40d87b['trunks'];this[_0xcbf6('0x10')]={};ami['on'](_0xcbf6('0x11'),this['syncNewchannel']['bind'](this));ami['on'](_0xcbf6('0x12'),this[_0xcbf6('0x13')][_0xcbf6('0x14')](this));ami['on']('newstate',this[_0xcbf6('0x15')]['bind'](this));ami['on'](_0xcbf6('0x16'),this[_0xcbf6('0x17')][_0xcbf6('0x14')](this));ami['on']('faxstatus',this[_0xcbf6('0x18')]['bind'](this));ami['on'](_0xcbf6('0x19'),this[_0xcbf6('0x1a')][_0xcbf6('0x14')](this));ami['on'](_0xcbf6('0x1b'),this['syncHangup'][_0xcbf6('0x14')](this));ami['on'](_0xcbf6('0x1c'),this['syncOriginateResponse']['bind'](this));}Fax[_0xcbf6('0x1d')][_0xcbf6('0x1e')]=function(_0x1e2181){if(_0x1e2181[_0xcbf6('0x1f')]===_0xcbf6('0x20')){for(var _0x4cc121 in this[_0xcbf6('0xf')]){if(this[_0xcbf6('0xf')]['hasOwnProperty'](_0x4cc121)){if(_0x1e2181[_0xcbf6('0x21')]===this[_0xcbf6('0xf')][_0x4cc121][_0xcbf6('0x22')]){this['channels'][_0x1e2181[_0xcbf6('0x23')]]={};this[_0xcbf6('0xe')][_0x1e2181[_0xcbf6('0x23')]][_0xcbf6('0x24')]=_0x1e2181[_0xcbf6('0x24')];this[_0xcbf6('0xe')][_0x1e2181[_0xcbf6('0x23')]]['id']=this[_0xcbf6('0xf')][_0x4cc121]['id'];this[_0xcbf6('0xe')][_0x1e2181[_0xcbf6('0x23')]]['name']=this['faxAccounts'][_0x4cc121][_0xcbf6('0x25')];logger['info'](_0x1e2181[_0xcbf6('0x23')],_0xcbf6('0x26'));}}}}if(this[_0xcbf6('0x10')][_0x1e2181['uniqueid']]){this['channels'][_0x1e2181[_0xcbf6('0x23')]]={};this['channels'][_0x1e2181[_0xcbf6('0x23')]][_0xcbf6('0x24')]=_0x1e2181[_0xcbf6('0x24')];logger[_0xcbf6('0x27')](_0x1e2181[_0xcbf6('0x23')],_0xcbf6('0x26'));}};Fax[_0xcbf6('0x1d')][_0xcbf6('0x13')]=function(_0x3c1716){if(this[_0xcbf6('0xe')][_0x3c1716[_0xcbf6('0x23')]]){for(var _0x6f8214 in _0x3c1716[_0xcbf6('0x28')]){if(_0x3c1716[_0xcbf6('0x28')][_0xcbf6('0x29')](_0x6f8214)){this[_0xcbf6('0xe')][_0x3c1716['uniqueid']][_0x6f8214]=_0x3c1716[_0xcbf6('0x2a')];}}}};Fax['prototype'][_0xcbf6('0x15')]=function(_0x32baa1){if(this['channels'][_0x32baa1[_0xcbf6('0x23')]]){this[_0xcbf6('0xe')][_0x32baa1[_0xcbf6('0x23')]]['channelstate']=_0x32baa1['channelstate'];this['channels'][_0x32baa1[_0xcbf6('0x23')]][_0xcbf6('0x2b')]=_0x32baa1['channelstatedesc'];}};Fax[_0xcbf6('0x1d')][_0xcbf6('0x17')]=function(_0x50d702){if(this[_0xcbf6('0xe')][_0x50d702['uniqueid']]){for(var _0x1a84cb in _0x50d702[_0xcbf6('0x28')]){if(_0x50d702['variable']['hasOwnProperty'](_0x1a84cb)){this[_0xcbf6('0xe')][_0x50d702[_0xcbf6('0x23')]][_0x1a84cb]=_0x50d702[_0xcbf6('0x2a')];}}}};Fax[_0xcbf6('0x1d')][_0xcbf6('0x18')]=function(_0xb7a7dc){if(this[_0xcbf6('0xe')][_0xb7a7dc['uniqueid']]){this[_0xcbf6('0xe')][_0xb7a7dc[_0xcbf6('0x23')]]['operation']=_0xb7a7dc[_0xcbf6('0x2c')];this['channels'][_0xb7a7dc[_0xcbf6('0x23')]][_0xcbf6('0x2d')]=_0xb7a7dc['status'];this[_0xcbf6('0xe')][_0xb7a7dc[_0xcbf6('0x23')]]['localstationid']=_0xb7a7dc[_0xcbf6('0x22')];this[_0xcbf6('0xe')][_0xb7a7dc['uniqueid']][_0xcbf6('0x2e')]=_0xb7a7dc['filename'];logger[_0xcbf6('0x27')](_0xb7a7dc[_0xcbf6('0x23')],_0xcbf6('0x2f'));}};Fax['prototype'][_0xcbf6('0x1a')]=function(_0x1445d8){var _0x6be4f0=this;if(this[_0xcbf6('0xe')][_0x1445d8['uniqueid']]){var _0x42e077=this[_0xcbf6('0xe')][_0x1445d8[_0xcbf6('0x23')]]['id'];this['channels'][_0x1445d8[_0xcbf6('0x23')]][_0xcbf6('0x30')]=_0x1445d8[_0xcbf6('0x30')];this[_0xcbf6('0xe')][_0x1445d8[_0xcbf6('0x23')]][_0xcbf6('0x31')]=_0x1445d8['pagestransferred'];this[_0xcbf6('0xe')][_0x1445d8[_0xcbf6('0x23')]][_0xcbf6('0x22')]=_0x1445d8[_0xcbf6('0x22')];this[_0xcbf6('0xe')][_0x1445d8['uniqueid']][_0xcbf6('0x32')]=_0x1445d8[_0xcbf6('0x32')];this[_0xcbf6('0xe')][_0x1445d8['uniqueid']][_0xcbf6('0x33')]=_0x1445d8[_0xcbf6('0x33')];this[_0xcbf6('0xe')][_0x1445d8[_0xcbf6('0x23')]][_0xcbf6('0x2e')]=_0x1445d8['filename'];this['channels'][_0x1445d8[_0xcbf6('0x23')]][_0xcbf6('0x34')]=_0x1445d8[_0xcbf6('0x34')];if(this[_0xcbf6('0xe')][_0x1445d8['uniqueid']][_0xcbf6('0x31')]>0x0){tiff2pdf(_0x1445d8[_0xcbf6('0x2e')],'/var/opt/motion2/server/files/attachments/',function(_0xedc089){logger[_0xcbf6('0x27')](_0x1445d8[_0xcbf6('0x23')],_0xcbf6('0x35'),_0xedc089[_0xcbf6('0x36')]);attachment[_0xcbf6('0x37')]({'name':path[_0xcbf6('0x38')](_0x1445d8['filename'])[_0xcbf6('0x25')],'basename':path[_0xcbf6('0x38')](_0x1445d8[_0xcbf6('0x2e')])[_0xcbf6('0x25')]+_0xcbf6('0x39'),'type':_0xcbf6('0x3a')})['then'](function(_0x5cd722){faxAccount[_0xcbf6('0x3b')](_0x42e077,{'from':_0x1445d8[_0xcbf6('0x34')],'mapKey':_0xcbf6('0x8'),'body':path[_0xcbf6('0x38')](_0x1445d8[_0xcbf6('0x2e')])[_0xcbf6('0x25')]+'.pdf','AttachmentId':_0x5cd722['id']})['catch'](function(_0x4fb7b2){logger[_0xcbf6('0x3c')](_0x1445d8[_0xcbf6('0x23')],_0xcbf6('0x3d'),JSON[_0xcbf6('0x3e')](_0x4fb7b2));});})[_0xcbf6('0x3f')](function(_0x4c610b){logger[_0xcbf6('0x3c')](_0x1445d8[_0xcbf6('0x23')],_0xcbf6('0x40'),JSON[_0xcbf6('0x3e')](_0x4c610b));});});}logger['info'](_0x1445d8[_0xcbf6('0x23')],_0xcbf6('0x40'));}};Fax[_0xcbf6('0x1d')]['syncOriginateResponse']=function(_0x2941d7){if(this['actions'][_0x2941d7[_0xcbf6('0x23')]]){_[_0xcbf6('0x41')](this['channels'][_0x2941d7[_0xcbf6('0x23')]],_[_0xcbf6('0x42')](_0x2941d7,['response',_0xcbf6('0x43')]));}};function updateStatus(_0x4671ae){if(_0x4671ae['AttachmentId']){faxMessage[_0xcbf6('0x44')](_0x4671ae['AttachmentId'],{'failMessage':_0xcbf6('0x45')})[_0xcbf6('0x46')](function(_0x4ba487){ut[_0xcbf6('0x47')]('[Fax][Message][Error][Updated]',_0x4ba487);})[_0xcbf6('0x3f')](function(_0x1394ff){ut[_0xcbf6('0x47')]('[Fax][Message][Error][NoUpdate1]',_0x1394ff);});}else{ut['logger'](_0xcbf6('0x48'));}}Fax[_0xcbf6('0x1d')]['updateStatus']=function(_0x1790bf,_0x5eb748,_0x34a51c){var _0x272ad2=this;var _0x55bc8c={};if(_0x5eb748){_0x55bc8c={'read':_0x5eb748};}else{_0x55bc8c={'failMessage':_0x34a51c};}if(this[_0xcbf6('0x10')][_0x1790bf]['AttachmentId']){faxMessage[_0xcbf6('0x44')](this[_0xcbf6('0x10')][_0x1790bf]['AttachmentId'],_0x55bc8c)['then'](function(_0x5050e0){ut[_0xcbf6('0x47')]('[Fax][Message][Updated]',_0x5050e0);})[_0xcbf6('0x3f')](function(_0x5df064){ut[_0xcbf6('0x47')](_0xcbf6('0x49'),_0x5df064);})['finally'](function(){delete _0x272ad2['channels'][_0x1790bf];delete _0x272ad2[_0xcbf6('0x10')][_0x1790bf];});}else{ut[_0xcbf6('0x47')](_0xcbf6('0x4a'));delete this[_0xcbf6('0xe')][_0x1790bf];delete this[_0xcbf6('0x10')][_0x1790bf];}};Fax[_0xcbf6('0x1d')]['syncHangup']=function(_0x8d52e3){var _0x4eb380=this;if(this[_0xcbf6('0xe')][_0x8d52e3[_0xcbf6('0x23')]]){if(this[_0xcbf6('0x10')][_0x8d52e3[_0xcbf6('0x23')]]){this[_0xcbf6('0xe')][_0x8d52e3[_0xcbf6('0x23')]]['id']=this['actions'][_0x8d52e3['uniqueid']]['id'];this[_0xcbf6('0xe')][_0x8d52e3[_0xcbf6('0x23')]][_0xcbf6('0x25')]=this['actions'][_0x8d52e3[_0xcbf6('0x23')]][_0xcbf6('0x25')];}logger['info'](_0x8d52e3[_0xcbf6('0x23')],this[_0xcbf6('0x10')][_0x8d52e3[_0xcbf6('0x23')]]?_0xcbf6('0x4b'):_0xcbf6('0x4c'),JSON[_0xcbf6('0x3e')](this[_0xcbf6('0xe')][_0x8d52e3[_0xcbf6('0x23')]]));if(this[_0xcbf6('0x10')][_0x8d52e3[_0xcbf6('0x23')]]){if(this[_0xcbf6('0xe')][_0x8d52e3[_0xcbf6('0x23')]][_0xcbf6('0x4d')]>0x0&&this[_0xcbf6('0xe')][_0x8d52e3[_0xcbf6('0x23')]][_0xcbf6('0x4e')]==='SUCCESS'){this[_0xcbf6('0x4f')](_0x8d52e3[_0xcbf6('0x23')],!![]);}else{this[_0xcbf6('0x4f')](_0x8d52e3['uniqueid'],![],this[_0xcbf6('0xe')][_0x8d52e3[_0xcbf6('0x23')]][_0xcbf6('0x50')]?_0xcbf6('0x51')+this[_0xcbf6('0xe')][_0x8d52e3['uniqueid']][_0xcbf6('0x50')]:'SENDING\x20FAILED');}}}};Fax[_0xcbf6('0x1d')][_0xcbf6('0x52')]=function(_0x4ccc75){var _0x551990=this;return new BPromise(function(_0x3454ab,_0x396739){_0x551990[_0xcbf6('0x53')](_0x4ccc75,_0x551990[_0xcbf6('0xf')][_0x4ccc75[_0xcbf6('0x54')]])[_0xcbf6('0x46')](function(_0x50056d){ut[_0xcbf6('0x47')](_0xcbf6('0x55'),_0x50056d);_0x3454ab(ut[_0xcbf6('0x36')]('Fax\x20received'));})['catch'](function(_0xa20a81){ut['logger']('[Fax][execOriginate][failure]',_0xa20a81);updateStatus(_0x4ccc75);_0x396739(ut['message'](_0xcbf6('0x56')));});});};Fax[_0xcbf6('0x1d')][_0xcbf6('0x57')]=function(_0x15a686){var _0x32d49a=this;return new BPromise(function(_0x4b119a,_0x2835ea){var _0x442e3f=_0x32d49a[_0xcbf6('0x58')](_0x32d49a[_0xcbf6('0xf')][_0x15a686[_0xcbf6('0x54')]][_0xcbf6('0x59')],_0x15a686);if(_0x442e3f['isValid']){_0x4b119a(ut['message'](_0xcbf6('0x5a')));}else{_0x2835ea(ut[_0xcbf6('0x36')](_0x442e3f[_0xcbf6('0x36')]));}});};function originate(_0x4333cf,_0x21eee0,_0x33cebe){return new BPromise(function(_0x4aa3f7,_0xfaed1d){if(_0x33cebe){var _0xf3bc61=util['format'](_0xcbf6('0x5b'),path[_0xcbf6('0x38')](_0x4333cf[_0xcbf6('0x4')])[_0xcbf6('0x25')],_0x4333cf[_0xcbf6('0x4')]);gs[_0xcbf6('0x5c')](_0xf3bc61)[_0xcbf6('0x46')](function(){_0x4333cf['path']=util[_0xcbf6('0x5d')]('%s/%s.tif',path[_0xcbf6('0x38')](_0x4333cf[_0xcbf6('0x4')])[_0xcbf6('0x5e')],path[_0xcbf6('0x38')](_0x4333cf['path'])['name']);_0x21eee0[_0xcbf6('0x5f')]=_0x4333cf[_0xcbf6('0x4')];ut[_0xcbf6('0x47')](_0xcbf6('0x60'),'');ami['Action'](ut[_0xcbf6('0x61')](_0x4333cf,_0x21eee0))[_0xcbf6('0x46')](function(_0x5bec98){_0x4aa3f7(_0x5bec98);})[_0xcbf6('0x3f')](function(_0x5713da){_0xfaed1d(_0x5713da);});})[_0xcbf6('0x3f')](function(_0x2ede64){_0xfaed1d(_0x2ede64);});}else{ami[_0xcbf6('0x62')](ut['variablesAction'](_0x4333cf,_0x21eee0))[_0xcbf6('0x46')](function(_0x5de403){_0x4aa3f7(_0x5de403);})[_0xcbf6('0x3f')](function(_0x1983c4){_0xfaed1d(_0x1983c4);});}});}Fax['prototype']['execOriginate']=function(_0x5ab6b0,_0x54eca7){var _0xe31ac7=this;return new BPromise(function(_0xb6c53e,_0x4efd8b){var _0x53bca6=uuid['v4']();var _0x519ab0=ut[_0xcbf6('0x63')](_0x5ab6b0,_0x54eca7);_0xe31ac7[_0xcbf6('0x10')][_0x53bca6]=new Action(_0x53bca6,_0x54eca7,_0x5ab6b0);var _0x396712=_0xe31ac7[_0xcbf6('0x10')][_0x53bca6];if(path['parse'](_0x5ab6b0[_0xcbf6('0x4')])['ext']===_0xcbf6('0x39')){originate(_0x396712,_0x519ab0,!![])[_0xcbf6('0x46')](function(_0x2b3044){_0xb6c53e(_0x2b3044);})['catch'](function(_0x4dc508){_0x4efd8b(_0x4dc508);});}else{originate(_0x396712,_0x519ab0,![])[_0xcbf6('0x46')](function(_0x1579ee){_0xb6c53e(_0x1579ee);})[_0xcbf6('0x3f')](function(_0x8a42da){_0x4efd8b(_0x8a42da);});}});};Fax[_0xcbf6('0x1d')][_0xcbf6('0x64')]=function(_0x364543){return!_['isNil'](_0x364543)&&!_['isNil'](_0x364543['name'])&&!_['isNil'](_0x364543[_0xcbf6('0x65')])&&_0x364543[_0xcbf6('0x65')]&&!_[_0xcbf6('0x66')](this[_0xcbf6('0x67')][util['format'](_0xcbf6('0x68'),_0x364543[_0xcbf6('0x25')])])&&!_[_0xcbf6('0x66')](this[_0xcbf6('0x67')][util[_0xcbf6('0x5d')](_0xcbf6('0x68'),_0x364543[_0xcbf6('0x25')])][_0xcbf6('0x2d')])&&(this[_0xcbf6('0x67')][util[_0xcbf6('0x5d')]('SIP/%s',_0x364543['name'])][_0xcbf6('0x2d')]===_0xcbf6('0x69')||this[_0xcbf6('0x67')][util[_0xcbf6('0x5d')](_0xcbf6('0x68'),_0x364543[_0xcbf6('0x25')])][_0xcbf6('0x2d')]==='unmonitored');};Fax['prototype'][_0xcbf6('0x58')]=function(_0x67e9e0,_0x15683b){if(!this[_0xcbf6('0x64')](_0x67e9e0)){ut[_0xcbf6('0x47')](_0xcbf6('0x6a'),_[_0xcbf6('0x66')](_0x67e9e0)?'':_0x67e9e0[_0xcbf6('0x25')]+_0xcbf6('0x6b'));return{'isValid':![],'message':_0xcbf6('0x6c')};}if(_[_0xcbf6('0x66')](_0x15683b[_0xcbf6('0x8')])){ut['logger'](_0xcbf6('0x6d'),JSON[_0xcbf6('0x3e')](_0x15683b));return{'isValid':![],'message':_0xcbf6('0x6e')};}if(_[_0xcbf6('0x66')](_0x15683b[_0xcbf6('0x4')])){ut[_0xcbf6('0x47')](_0xcbf6('0x6f'),JSON['stringify'](_0x15683b));return{'isValid':![],'message':_0xcbf6('0x70')};}return{'isValid':!![],'message':'Is\x20Valid'};};module['exports']=Fax; \ No newline at end of file +var _0x8d2b=['Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','util','lodash','uuid','moment','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','syncNewchannel','bind','varset','syncVarSet','newstate','syncNewState','newexten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','syncHangup','originateresponse','syncOriginateResponse','prototype','context','hasOwnProperty','exten','localstationid','uniqueid','channel','name','\x20syncNewchannel\x20','info','variable','value','channelstate','channelstatedesc','syncNewExten','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','parse','.pdf','application/pdf','then','notify','catch','error','stringify','\x20receiveFax\x20','merge','pick','response','reason','AttachmentId','update','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','message','Fax\x20received','checkAfterSend','checkTrunk','Trunk','isValid','format','path','execute','%s/%s.tif','XMF-PATH'];(function(_0x3ccea2,_0x624323){var _0xeb988=function(_0x565fe4){while(--_0x565fe4){_0x3ccea2['push'](_0x3ccea2['shift']());}};_0xeb988(++_0x624323);}(_0x8d2b,0x1f2));var _0xb8d2=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0x8d2b[_0x34bc30];return _0x5706de;};'use strict';var util=require(_0xb8d2('0x0'));var _=require(_0xb8d2('0x1'));var BPromise=require('bluebird');var uuid=require(_0xb8d2('0x2'));var moment=require(_0xb8d2('0x3'));var path=require('path');var tiff2pdf=require(_0xb8d2('0x4'));var gs=require(_0xb8d2('0x5'));var logger=require(_0xb8d2('0x6'))(_0xb8d2('0x7'));var ami=require(_0xb8d2('0x8'));var rpcDb=require(_0xb8d2('0x9'));var Channel=require(_0xb8d2('0xa'));var ut=require(_0xb8d2('0xb'));var Action=require(_0xb8d2('0xc'));var faxAccount=require(_0xb8d2('0xd'));var attachment=require(_0xb8d2('0xe'));var faxMessage=require(_0xb8d2('0xf'));function Fax(_0x2519b9){this[_0xb8d2('0x10')]={};this[_0xb8d2('0x11')]=_0x2519b9[_0xb8d2('0x11')];this[_0xb8d2('0x12')]=_0x2519b9[_0xb8d2('0x12')];this[_0xb8d2('0x13')]={};ami['on']('newchannel',this[_0xb8d2('0x14')][_0xb8d2('0x15')](this));ami['on'](_0xb8d2('0x16'),this[_0xb8d2('0x17')]['bind'](this));ami['on'](_0xb8d2('0x18'),this[_0xb8d2('0x19')][_0xb8d2('0x15')](this));ami['on'](_0xb8d2('0x1a'),this['syncNewExten'][_0xb8d2('0x15')](this));ami['on'](_0xb8d2('0x1b'),this[_0xb8d2('0x1c')][_0xb8d2('0x15')](this));ami['on'](_0xb8d2('0x1d'),this[_0xb8d2('0x1e')][_0xb8d2('0x15')](this));ami['on']('hangup',this[_0xb8d2('0x1f')][_0xb8d2('0x15')](this));ami['on'](_0xb8d2('0x20'),this[_0xb8d2('0x21')][_0xb8d2('0x15')](this));}Fax[_0xb8d2('0x22')][_0xb8d2('0x14')]=function(_0x327667){if(_0x327667[_0xb8d2('0x23')]==='from-voip-provider'){for(var _0x17b21b in this['faxAccounts']){if(this['faxAccounts'][_0xb8d2('0x24')](_0x17b21b)){if(_0x327667[_0xb8d2('0x25')]===this[_0xb8d2('0x11')][_0x17b21b][_0xb8d2('0x26')]){this[_0xb8d2('0x10')][_0x327667[_0xb8d2('0x27')]]={};this[_0xb8d2('0x10')][_0x327667[_0xb8d2('0x27')]][_0xb8d2('0x28')]=_0x327667[_0xb8d2('0x28')];this[_0xb8d2('0x10')][_0x327667[_0xb8d2('0x27')]]['id']=this[_0xb8d2('0x11')][_0x17b21b]['id'];this[_0xb8d2('0x10')][_0x327667[_0xb8d2('0x27')]][_0xb8d2('0x29')]=this[_0xb8d2('0x11')][_0x17b21b][_0xb8d2('0x29')];logger['info'](_0x327667[_0xb8d2('0x27')],_0xb8d2('0x2a'));}}}}if(this[_0xb8d2('0x13')][_0x327667[_0xb8d2('0x27')]]){this[_0xb8d2('0x10')][_0x327667[_0xb8d2('0x27')]]={};this[_0xb8d2('0x10')][_0x327667['uniqueid']][_0xb8d2('0x28')]=_0x327667[_0xb8d2('0x28')];logger[_0xb8d2('0x2b')](_0x327667[_0xb8d2('0x27')],_0xb8d2('0x2a'));}};Fax['prototype']['syncVarSet']=function(_0x4ed6ec){if(this[_0xb8d2('0x10')][_0x4ed6ec[_0xb8d2('0x27')]]){for(var _0x3c2c71 in _0x4ed6ec[_0xb8d2('0x2c')]){if(_0x4ed6ec[_0xb8d2('0x2c')][_0xb8d2('0x24')](_0x3c2c71)){this[_0xb8d2('0x10')][_0x4ed6ec[_0xb8d2('0x27')]][_0x3c2c71]=_0x4ed6ec[_0xb8d2('0x2d')];}}}};Fax['prototype'][_0xb8d2('0x19')]=function(_0x25b45b){if(this[_0xb8d2('0x10')][_0x25b45b[_0xb8d2('0x27')]]){this[_0xb8d2('0x10')][_0x25b45b[_0xb8d2('0x27')]][_0xb8d2('0x2e')]=_0x25b45b[_0xb8d2('0x2e')];this[_0xb8d2('0x10')][_0x25b45b[_0xb8d2('0x27')]][_0xb8d2('0x2f')]=_0x25b45b['channelstatedesc'];}};Fax[_0xb8d2('0x22')][_0xb8d2('0x30')]=function(_0x21e030){if(this[_0xb8d2('0x10')][_0x21e030[_0xb8d2('0x27')]]){for(var _0x2cae37 in _0x21e030[_0xb8d2('0x2c')]){if(_0x21e030[_0xb8d2('0x2c')][_0xb8d2('0x24')](_0x2cae37)){this[_0xb8d2('0x10')][_0x21e030[_0xb8d2('0x27')]][_0x2cae37]=_0x21e030[_0xb8d2('0x2d')];}}}};Fax['prototype'][_0xb8d2('0x1c')]=function(_0x159a33){if(this[_0xb8d2('0x10')][_0x159a33[_0xb8d2('0x27')]]){this['channels'][_0x159a33['uniqueid']][_0xb8d2('0x31')]=_0x159a33[_0xb8d2('0x31')];this['channels'][_0x159a33[_0xb8d2('0x27')]][_0xb8d2('0x32')]=_0x159a33['status'];this[_0xb8d2('0x10')][_0x159a33[_0xb8d2('0x27')]][_0xb8d2('0x26')]=_0x159a33[_0xb8d2('0x26')];this[_0xb8d2('0x10')][_0x159a33[_0xb8d2('0x27')]][_0xb8d2('0x33')]=_0x159a33['filename'];logger[_0xb8d2('0x2b')](_0x159a33['uniqueid'],_0xb8d2('0x34'));}};Fax[_0xb8d2('0x22')][_0xb8d2('0x1e')]=function(_0x57d54e){var _0xb64d91=this;if(this[_0xb8d2('0x10')][_0x57d54e['uniqueid']]){var _0x13eae8=this[_0xb8d2('0x10')][_0x57d54e[_0xb8d2('0x27')]]['id'];this['channels'][_0x57d54e[_0xb8d2('0x27')]]['remotestationid']=_0x57d54e[_0xb8d2('0x35')];this[_0xb8d2('0x10')][_0x57d54e['uniqueid']][_0xb8d2('0x36')]=_0x57d54e['pagestransferred'];this['channels'][_0x57d54e[_0xb8d2('0x27')]][_0xb8d2('0x26')]=_0x57d54e[_0xb8d2('0x26')];this['channels'][_0x57d54e[_0xb8d2('0x27')]]['resolution']=_0x57d54e[_0xb8d2('0x37')];this['channels'][_0x57d54e[_0xb8d2('0x27')]][_0xb8d2('0x38')]=_0x57d54e[_0xb8d2('0x38')];this[_0xb8d2('0x10')][_0x57d54e[_0xb8d2('0x27')]][_0xb8d2('0x33')]=_0x57d54e[_0xb8d2('0x33')];this[_0xb8d2('0x10')][_0x57d54e[_0xb8d2('0x27')]][_0xb8d2('0x39')]=_0x57d54e[_0xb8d2('0x39')];if(this[_0xb8d2('0x10')][_0x57d54e[_0xb8d2('0x27')]][_0xb8d2('0x36')]>0x0){tiff2pdf(_0x57d54e[_0xb8d2('0x33')],_0xb8d2('0x3a'),function(_0x325457){logger[_0xb8d2('0x2b')](_0x57d54e['uniqueid'],'\x20result\x20conversion\x20file\x20',_0x325457['message']);attachment['create']({'name':path[_0xb8d2('0x3b')](_0x57d54e[_0xb8d2('0x33')])[_0xb8d2('0x29')],'basename':path[_0xb8d2('0x3b')](_0x57d54e[_0xb8d2('0x33')])['name']+_0xb8d2('0x3c'),'type':_0xb8d2('0x3d')})[_0xb8d2('0x3e')](function(_0x560d30){faxAccount[_0xb8d2('0x3f')](_0x13eae8,{'from':_0x57d54e[_0xb8d2('0x39')],'mapKey':_0xb8d2('0x7'),'body':path['parse'](_0x57d54e[_0xb8d2('0x33')])[_0xb8d2('0x29')]+'.pdf','AttachmentId':_0x560d30['id']})[_0xb8d2('0x40')](function(_0x546076){logger[_0xb8d2('0x41')](_0x57d54e['uniqueid'],'\x20notify\x20',JSON[_0xb8d2('0x42')](_0x546076));});})[_0xb8d2('0x40')](function(_0x3c98d7){logger[_0xb8d2('0x41')](_0x57d54e[_0xb8d2('0x27')],_0xb8d2('0x43'),JSON[_0xb8d2('0x42')](_0x3c98d7));});});}logger[_0xb8d2('0x2b')](_0x57d54e[_0xb8d2('0x27')],'\x20receiveFax\x20');}};Fax[_0xb8d2('0x22')]['syncOriginateResponse']=function(_0x1e0325){if(this[_0xb8d2('0x13')][_0x1e0325[_0xb8d2('0x27')]]){_[_0xb8d2('0x44')](this[_0xb8d2('0x10')][_0x1e0325[_0xb8d2('0x27')]],_[_0xb8d2('0x45')](_0x1e0325,[_0xb8d2('0x46'),_0xb8d2('0x47')]));}};function updateStatus(_0xfdf389){if(_0xfdf389[_0xb8d2('0x48')]){faxMessage[_0xb8d2('0x49')](_0xfdf389[_0xb8d2('0x48')],{'failMessage':'SENDING\x20FAILED\x20'})[_0xb8d2('0x3e')](function(_0xdad7e){ut[_0xb8d2('0x4a')]('[Fax][Message][Error][Updated]',_0xdad7e);})['catch'](function(_0x3ff9dc){ut[_0xb8d2('0x4a')](_0xb8d2('0x4b'),_0x3ff9dc);});}else{ut[_0xb8d2('0x4a')](_0xb8d2('0x4c'));}}Fax[_0xb8d2('0x22')][_0xb8d2('0x4d')]=function(_0x2fc3f6,_0x5387cb,_0x2f3e63){var _0x37e29c=this;var _0x43ccea={};if(_0x5387cb){_0x43ccea={'read':_0x5387cb};}else{_0x43ccea={'failMessage':_0x2f3e63};}if(this[_0xb8d2('0x13')][_0x2fc3f6][_0xb8d2('0x48')]){faxMessage[_0xb8d2('0x49')](this[_0xb8d2('0x13')][_0x2fc3f6][_0xb8d2('0x48')],_0x43ccea)['then'](function(_0x871862){ut[_0xb8d2('0x4a')](_0xb8d2('0x4e'),_0x871862);})['catch'](function(_0x584a6a){ut['logger'](_0xb8d2('0x4f'),_0x584a6a);})[_0xb8d2('0x50')](function(){delete _0x37e29c[_0xb8d2('0x10')][_0x2fc3f6];delete _0x37e29c[_0xb8d2('0x13')][_0x2fc3f6];});}else{ut[_0xb8d2('0x4a')](_0xb8d2('0x51'));delete this['channels'][_0x2fc3f6];delete this[_0xb8d2('0x13')][_0x2fc3f6];}};Fax[_0xb8d2('0x22')]['syncHangup']=function(_0x31647f){var _0x29d0f8=this;if(this[_0xb8d2('0x10')][_0x31647f['uniqueid']]){if(this[_0xb8d2('0x13')][_0x31647f[_0xb8d2('0x27')]]){this[_0xb8d2('0x10')][_0x31647f[_0xb8d2('0x27')]]['id']=this[_0xb8d2('0x13')][_0x31647f[_0xb8d2('0x27')]]['id'];this[_0xb8d2('0x10')][_0x31647f[_0xb8d2('0x27')]][_0xb8d2('0x29')]=this[_0xb8d2('0x13')][_0x31647f[_0xb8d2('0x27')]]['name'];}logger[_0xb8d2('0x2b')](_0x31647f['uniqueid'],this['actions'][_0x31647f['uniqueid']]?'\x20hangup\x20sendFile\x20':_0xb8d2('0x52'),JSON[_0xb8d2('0x42')](this[_0xb8d2('0x10')][_0x31647f[_0xb8d2('0x27')]]));if(this[_0xb8d2('0x13')][_0x31647f[_0xb8d2('0x27')]]){if(this[_0xb8d2('0x10')][_0x31647f[_0xb8d2('0x27')]][_0xb8d2('0x53')]>0x0&&this[_0xb8d2('0x10')][_0x31647f['uniqueid']][_0xb8d2('0x1b')]===_0xb8d2('0x54')){this[_0xb8d2('0x4d')](_0x31647f[_0xb8d2('0x27')],!![]);}else{this[_0xb8d2('0x4d')](_0x31647f[_0xb8d2('0x27')],![],this[_0xb8d2('0x10')][_0x31647f[_0xb8d2('0x27')]][_0xb8d2('0x55')]?'SENDING\x20FAILED:\x20'+this[_0xb8d2('0x10')][_0x31647f['uniqueid']][_0xb8d2('0x55')]:_0xb8d2('0x56'));}}}};Fax[_0xb8d2('0x22')][_0xb8d2('0x57')]=function(_0x5c7548){var _0x23cad4=this;return new BPromise(function(_0x1cbc19,_0x5231c5){_0x23cad4[_0xb8d2('0x58')](_0x5c7548,_0x23cad4['faxAccounts'][_0x5c7548[_0xb8d2('0x59')]])[_0xb8d2('0x3e')](function(_0x3ab4ec){ut[_0xb8d2('0x4a')](_0xb8d2('0x5a'),_0x3ab4ec);_0x1cbc19(ut[_0xb8d2('0x5b')](_0xb8d2('0x5c')));})['catch'](function(_0x40150b){ut['logger']('[Fax][execOriginate][failure]',_0x40150b);updateStatus(_0x5c7548);_0x5231c5(ut['message']('Fax\x20failed'));});});};Fax[_0xb8d2('0x22')][_0xb8d2('0x5d')]=function(_0x5faf46){var _0x3d3993=this;return new BPromise(function(_0x3142e5,_0x16ad0b){var _0xa9fe6f=_0x3d3993[_0xb8d2('0x5e')](_0x3d3993[_0xb8d2('0x11')][_0x5faf46['FaxAccountId']][_0xb8d2('0x5f')],_0x5faf46);if(_0xa9fe6f[_0xb8d2('0x60')]){_0x3142e5(ut[_0xb8d2('0x5b')]('Trunk\x20Reachable'));}else{_0x16ad0b(ut[_0xb8d2('0x5b')](_0xa9fe6f[_0xb8d2('0x5b')]));}});};function originate(_0x135d1d,_0x37e8b9,_0x4f2041){return new BPromise(function(_0x1dbfc9,_0x2d7aa0){if(_0x4f2041){var _0x2f553f=util[_0xb8d2('0x61')]('gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit',path[_0xb8d2('0x3b')](_0x135d1d[_0xb8d2('0x62')])[_0xb8d2('0x29')],_0x135d1d[_0xb8d2('0x62')]);gs[_0xb8d2('0x63')](_0x2f553f)[_0xb8d2('0x3e')](function(){_0x135d1d[_0xb8d2('0x62')]=util[_0xb8d2('0x61')](_0xb8d2('0x64'),path[_0xb8d2('0x3b')](_0x135d1d[_0xb8d2('0x62')])['dir'],path[_0xb8d2('0x3b')](_0x135d1d[_0xb8d2('0x62')])[_0xb8d2('0x29')]);_0x37e8b9[_0xb8d2('0x65')]=_0x135d1d['path'];ut[_0xb8d2('0x4a')]('Convert\x20pdf\x20to\x20tif','');ami[_0xb8d2('0x66')](ut[_0xb8d2('0x67')](_0x135d1d,_0x37e8b9))[_0xb8d2('0x3e')](function(_0x301c86){_0x1dbfc9(_0x301c86);})['catch'](function(_0x25774d){_0x2d7aa0(_0x25774d);});})[_0xb8d2('0x40')](function(_0x554142){_0x2d7aa0(_0x554142);});}else{ami['Action'](ut[_0xb8d2('0x67')](_0x135d1d,_0x37e8b9))['then'](function(_0x2b9f1f){_0x1dbfc9(_0x2b9f1f);})[_0xb8d2('0x40')](function(_0x3428f5){_0x2d7aa0(_0x3428f5);});}});}Fax[_0xb8d2('0x22')]['execOriginate']=function(_0x576f1c,_0x168c19){var _0x14fd23=this;return new BPromise(function(_0x5d62bd,_0x14876f){var _0x326f26=uuid['v4']();var _0x166de5=ut[_0xb8d2('0x68')](_0x576f1c,_0x168c19);_0x14fd23[_0xb8d2('0x13')][_0x326f26]=new Action(_0x326f26,_0x168c19,_0x576f1c);var _0xd43109=_0x14fd23['actions'][_0x326f26];if(path['parse'](_0x576f1c[_0xb8d2('0x62')])[_0xb8d2('0x69')]==='.pdf'){originate(_0xd43109,_0x166de5,!![])[_0xb8d2('0x3e')](function(_0x553b1e){_0x5d62bd(_0x553b1e);})[_0xb8d2('0x40')](function(_0x559eff){_0x14876f(_0x559eff);});}else{originate(_0xd43109,_0x166de5,![])[_0xb8d2('0x3e')](function(_0x504897){_0x5d62bd(_0x504897);})[_0xb8d2('0x40')](function(_0x3ff954){_0x14876f(_0x3ff954);});}});};Fax[_0xb8d2('0x22')][_0xb8d2('0x6a')]=function(_0x39c43e){return!_[_0xb8d2('0x6b')](_0x39c43e)&&!_[_0xb8d2('0x6b')](_0x39c43e[_0xb8d2('0x29')])&&!_[_0xb8d2('0x6b')](_0x39c43e[_0xb8d2('0x6c')])&&_0x39c43e[_0xb8d2('0x6c')]&&!_[_0xb8d2('0x6b')](this[_0xb8d2('0x12')][util[_0xb8d2('0x61')](_0xb8d2('0x6d'),_0x39c43e[_0xb8d2('0x29')])])&&!_[_0xb8d2('0x6b')](this['trunks'][util[_0xb8d2('0x61')](_0xb8d2('0x6d'),_0x39c43e['name'])][_0xb8d2('0x32')])&&(this[_0xb8d2('0x12')][util[_0xb8d2('0x61')](_0xb8d2('0x6d'),_0x39c43e[_0xb8d2('0x29')])][_0xb8d2('0x32')]===_0xb8d2('0x6e')||this[_0xb8d2('0x12')][util[_0xb8d2('0x61')](_0xb8d2('0x6d'),_0x39c43e[_0xb8d2('0x29')])]['status']==='unmonitored');};Fax[_0xb8d2('0x22')][_0xb8d2('0x5e')]=function(_0x408881,_0x4ee018){if(!this[_0xb8d2('0x6a')](_0x408881)){ut[_0xb8d2('0x4a')](_0xb8d2('0x6f'),_['isNil'](_0x408881)?'':_0x408881['name']+_0xb8d2('0x70'));return{'isValid':![],'message':_0xb8d2('0x71')};}if(_[_0xb8d2('0x6b')](_0x4ee018['fax'])){ut[_0xb8d2('0x4a')](_0xb8d2('0x72'),JSON[_0xb8d2('0x42')](_0x4ee018));return{'isValid':![],'message':_0xb8d2('0x73')};}if(_[_0xb8d2('0x6b')](_0x4ee018['path'])){ut['logger'](_0xb8d2('0x74'),JSON[_0xb8d2('0x42')](_0x4ee018));return{'isValid':![],'message':_0xb8d2('0x75')};}return{'isValid':!![],'message':_0xb8d2('0x76')};};module[_0xb8d2('0x77')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 31eed1f..094b084 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 _0xf878=['../../../config/logger','preview','lodash','../rpc/faxAccount','inspect','resolve','then','notify','[Notify]\x20','util','bluebird'];(function(_0xe63cd6,_0xee3ea8){var _0x2c418c=function(_0x16a004){while(--_0x16a004){_0xe63cd6['push'](_0xe63cd6['shift']());}};_0x2c418c(++_0xee3ea8);}(_0xf878,0x106));var _0x8f87=function(_0x54c4bf,_0xa4f756){_0x54c4bf=_0x54c4bf-0x0;var _0x59e060=_0xf878[_0x54c4bf];return _0x59e060;};'use strict';var util=require(_0x8f87('0x0'));var BPromise=require(_0x8f87('0x1'));var logger=require(_0x8f87('0x2'))(_0x8f87('0x3'));var _=require(_0x8f87('0x4'));var faxAccount=require(_0x8f87('0x5'));function loggerCatch(_0x30f3c0){return function(_0x288b98){logger['error'](_0x30f3c0,util[_0x8f87('0x6')](_0x288b98,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x4d47d2,_0x14e2a0){return BPromise[_0x8f87('0x7')]()[_0x8f87('0x8')](faxAccount[_0x8f87('0x9')](_0x4d47d2,_0x14e2a0))['catch'](loggerCatch(_0x8f87('0xa')));}; \ No newline at end of file +var _0x4c42=['[Notify]\x20','bluebird','../../../config/logger','preview','lodash','../rpc/faxAccount','inspect','notify','resolve','then','catch'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0x4c42,0xb1));var _0x24c4=function(_0x7e4982,_0x59c890){_0x7e4982=_0x7e4982-0x0;var _0x5ad5f2=_0x4c42[_0x7e4982];return _0x5ad5f2;};'use strict';var util=require('util');var BPromise=require(_0x24c4('0x0'));var logger=require(_0x24c4('0x1'))(_0x24c4('0x2'));var _=require(_0x24c4('0x3'));var faxAccount=require(_0x24c4('0x4'));function loggerCatch(_0x34af86){return function(_0x223a55){logger['error'](_0x34af86,util[_0x24c4('0x5')](_0x223a55,{'showHidden':![],'depth':null}));};}exports[_0x24c4('0x6')]=function(_0x4fcb92,_0x5c9790){return BPromise[_0x24c4('0x7')]()[_0x24c4('0x8')](faxAccount[_0x24c4('0x6')](_0x4fcb92,_0x5c9790))[_0x24c4('0x9')](loggerCatch(_0x24c4('0xa')));}; \ No newline at end of file diff --git a/server/services/ami/fax/util/gs.js b/server/services/ami/fax/util/gs.js index 8703ca2..91a78d6 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 _0x475d=['execute','Exec\x20gs','inspect','util','bluebird','child_process'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x475d,0x1e9));var _0xd475=function(_0x11b1b3,_0xf3cc69){_0x11b1b3=_0x11b1b3-0x0;var _0x437029=_0x475d[_0x11b1b3];return _0x437029;};'use strict';var util=require(_0xd475('0x0'));var logger=require('../../../../config/logger')('fax');var BPromise=require(_0xd475('0x1'));var exec=require(_0xd475('0x2'))['exec'];exports[_0xd475('0x3')]=function(_0x2537e2){return new BPromise(function(_0x496332,_0x3d9f30){exec(_0x2537e2,function(_0x3db165,_0x135111,_0x5991fe){logger['info'](_0xd475('0x4'),_0x135111);if(_0x3db165){logger['info'](_0xd475('0x4'),'\x20Error\x20:',util[_0xd475('0x5')](_0x3db165,{'showHidden':![],'depth':null}),_0x135111,_0x5991fe);_0x3d9f30(_0x3db165);}_0x496332(_0x135111);});});}; \ No newline at end of file +var _0x2df4=['fax','bluebird','child_process','exec','info','Exec\x20gs','inspect'];(function(_0x278d34,_0x162031){var _0x95cb31=function(_0x274c7b){while(--_0x274c7b){_0x278d34['push'](_0x278d34['shift']());}};_0x95cb31(++_0x162031);}(_0x2df4,0x173));var _0x42df=function(_0x1ad9b4,_0x5df9ed){_0x1ad9b4=_0x1ad9b4-0x0;var _0xbbee74=_0x2df4[_0x1ad9b4];return _0xbbee74;};'use strict';var util=require('util');var logger=require('../../../../config/logger')(_0x42df('0x0'));var BPromise=require(_0x42df('0x1'));var exec=require(_0x42df('0x2'))[_0x42df('0x3')];exports['execute']=function(_0xd60822){return new BPromise(function(_0x4217a2,_0x1c7b01){exec(_0xd60822,function(_0x5a496f,_0x6584d3,_0x2e8be9){logger[_0x42df('0x4')](_0x42df('0x5'),_0x6584d3);if(_0x5a496f){logger['info']('Exec\x20gs','\x20Error\x20:',util[_0x42df('0x6')](_0x5a496f,{'showHidden':![],'depth':null}),_0x6584d3,_0x2e8be9);_0x1c7b01(_0x5a496f);}_0x4217a2(_0x6584d3);});});}; \ 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 f5f9a48..e29b827 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 _0xb469=['util','lodash','moment','../../../../config/logger','fax','message','inspect','addVariables','headerinfo','maxrate','format','\x22%s\x22','gateway','t38timeout','path','originate','channel','from-sip','\x22%s\x22\x20<%s>','localstationid','uniqueid'];(function(_0x1f5877,_0x1fa3f8){var _0x7e26c7=function(_0x50f2f1){while(--_0x50f2f1){_0x1f5877['push'](_0x1f5877['shift']());}};_0x7e26c7(++_0x1fa3f8);}(_0xb469,0x13b));var _0x9b46=function(_0x4656df,_0x41a612){_0x4656df=_0x4656df-0x0;var _0x1ff404=_0xb469[_0x4656df];return _0x1ff404;};'use strict';var util=require(_0x9b46('0x0'));var _=require(_0x9b46('0x1'));var moment=require(_0x9b46('0x2'));var logger=require(_0x9b46('0x3'))(_0x9b46('0x4'));exports[_0x9b46('0x5')]=function(_0x9212ae){return{'message':_0x9212ae};};exports['logger']=function(_0x31f853,_0x45322f){logger['info'](_0x31f853,util[_0x9b46('0x6')](_0x45322f,{'showHidden':![],'depth':null}));};exports[_0x9b46('0x7')]=function(_0x50b49e,_0x1b2dd3){var _0x5bd834={'XMF-ECM':_0x1b2dd3['ecm'],'XMF-HEADERINFO':_0x1b2dd3[_0x9b46('0x8')],'XMF-MINRATE':_0x1b2dd3['minrate'],'XMF-MAXRATE':_0x1b2dd3[_0x9b46('0x9')],'XMF-MODEM':util[_0x9b46('0xa')](_0x9b46('0xb'),_0x1b2dd3['modem']),'XMF-GATEWAY':_0x1b2dd3[_0x9b46('0xc')],'XMF-FAXDETECT':_0x1b2dd3['faxdetect'],'XMF-T38TIMEOUT':_0x1b2dd3[_0x9b46('0xd')],'XMF-LOCALSTATIONID':_0x1b2dd3['localstationid'],'XMF-PATH':_0x50b49e[_0x9b46('0xe')]};return _0x5bd834;};exports['variablesAction']=function(_0x672157,_0x233b6b){return{'actionid':_0x672157['uniqueid'],'action':_0x9b46('0xf'),'channel':_0x672157[_0x9b46('0x10')],'Exten':'xcally-motion-fax','Context':_0x9b46('0x11'),'Priority':'1','callerid':util[_0x9b46('0xa')](_0x9b46('0x12'),_0x672157[_0x9b46('0x8')]?_0x672157[_0x9b46('0x8')]:'',_0x672157[_0x9b46('0x13')]),'variable':_0x233b6b,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x672157[_0x9b46('0x14')]};}; \ No newline at end of file +var _0xd64b=['xcally-motion-fax','from-sip','format','\x22%s\x22\x20<%s>','util','moment','fax','message','logger','ecm','headerinfo','minrate','maxrate','modem','gateway','faxdetect','localstationid','path','variablesAction','uniqueid','channel'];(function(_0x17bf52,_0x18f994){var _0x5a5c87=function(_0x3e871e){while(--_0x3e871e){_0x17bf52['push'](_0x17bf52['shift']());}};_0x5a5c87(++_0x18f994);}(_0xd64b,0xc1));var _0xbd64=function(_0x5be869,_0x9b30d2){_0x5be869=_0x5be869-0x0;var _0x514548=_0xd64b[_0x5be869];return _0x514548;};'use strict';var util=require(_0xbd64('0x0'));var _=require('lodash');var moment=require(_0xbd64('0x1'));var logger=require('../../../../config/logger')(_0xbd64('0x2'));exports[_0xbd64('0x3')]=function(_0x64bd3b){return{'message':_0x64bd3b};};exports[_0xbd64('0x4')]=function(_0x30fe29,_0x5458d8){logger['info'](_0x30fe29,util['inspect'](_0x5458d8,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x58e9e7,_0x32995f){var _0x3e700e={'XMF-ECM':_0x32995f[_0xbd64('0x5')],'XMF-HEADERINFO':_0x32995f[_0xbd64('0x6')],'XMF-MINRATE':_0x32995f[_0xbd64('0x7')],'XMF-MAXRATE':_0x32995f[_0xbd64('0x8')],'XMF-MODEM':util['format']('\x22%s\x22',_0x32995f[_0xbd64('0x9')]),'XMF-GATEWAY':_0x32995f[_0xbd64('0xa')],'XMF-FAXDETECT':_0x32995f[_0xbd64('0xb')],'XMF-T38TIMEOUT':_0x32995f['t38timeout'],'XMF-LOCALSTATIONID':_0x32995f[_0xbd64('0xc')],'XMF-PATH':_0x58e9e7[_0xbd64('0xd')]};return _0x3e700e;};exports[_0xbd64('0xe')]=function(_0x18bde8,_0x593c79){return{'actionid':_0x18bde8[_0xbd64('0xf')],'action':'originate','channel':_0x18bde8[_0xbd64('0x10')],'Exten':_0xbd64('0x11'),'Context':_0xbd64('0x12'),'Priority':'1','callerid':util[_0xbd64('0x13')](_0xbd64('0x14'),_0x18bde8[_0xbd64('0x6')]?_0x18bde8[_0xbd64('0x6')]:'',_0x18bde8[_0xbd64('0xc')]),'variable':_0x593c79,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x18bde8[_0xbd64('0xf')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 2c058cb..c00be8a 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 _0x92b8=['then','getAgents','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','initSalesforceAccounts','getSugarcrmAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','initVoiceCallReports','log','listen','sync','catch','moment','./server','./realtime','./acw','./trigger','./preview','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','hour','resolve'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x92b8,0xa2));var _0x892b=function(_0x569bcc,_0x33bbcf){_0x569bcc=_0x569bcc-0x0;var _0x4b020e=_0x92b8[_0x569bcc];return _0x4b020e;};'use strict';var BPromise=require('bluebird');var util=require('util');var moment=require(_0x892b('0x0'));var server=require(_0x892b('0x1'));var Realtime=require(_0x892b('0x2'));var Report=require('./report');var Acw=require(_0x892b('0x3'));var Trigger=require(_0x892b('0x4'));var Dialer=require('./dialer');var Preview=require(_0x892b('0x5'));var Fax=require('./fax');var user=require('./rpc/user');var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0x892b('0x6'));var voiceCallReport=require(_0x892b('0x7'));var trunk=require(_0x892b('0x8'));var trigger=require(_0x892b('0x9'));var template=require(_0x892b('0xa'));var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require('./rpc/campaign');var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require('./rpc/faxAccount');var zendesk=require('./rpc/integrations/zendesk');var salesforce=require(_0x892b('0xb'));var sugarcrm=require(_0x892b('0xc'));var freshdesk=require('./rpc/integrations/freshdesk');var desk=require('./rpc/integrations/desk');var zoho=require(_0x892b('0xd'));var vtiger=require(_0x892b('0xe'));var freshsales=require(_0x892b('0xf'));var servicenow=require(_0x892b('0x10'));var dynamics365=require(_0x892b('0x11'));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()[_0x892b('0x12')](_0x892b('0x13'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get'](_0x892b('0x13'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x892b('0x14')]()[_0x892b('0x15')](user[_0x892b('0x16')]())[_0x892b('0x15')](realtime[_0x892b('0x17')]())[_0x892b('0x15')](user[_0x892b('0x18')]())['then'](realtime[_0x892b('0x19')]())[_0x892b('0x15')](trunk[_0x892b('0x1a')]())['then'](realtime[_0x892b('0x1b')]())[_0x892b('0x15')](voiceQueue[_0x892b('0x1c')]())[_0x892b('0x15')](realtime['initVoiceQueues']())['then'](trigger[_0x892b('0x1d')]())['then'](realtime[_0x892b('0x1e')]())[_0x892b('0x15')](template[_0x892b('0x1f')]())[_0x892b('0x15')](realtime[_0x892b('0x20')]())[_0x892b('0x15')](zendesk[_0x892b('0x21')]())['then'](realtime[_0x892b('0x22')]())[_0x892b('0x15')](salesforce['getSalesforceAccounts']())['then'](realtime[_0x892b('0x23')]())[_0x892b('0x15')](sugarcrm[_0x892b('0x24')]())[_0x892b('0x15')](realtime['initSugarcrmAccounts']())[_0x892b('0x15')](freshdesk['getFreshdeskAccounts']())[_0x892b('0x15')](realtime[_0x892b('0x25')]())[_0x892b('0x15')](desk[_0x892b('0x26')]())[_0x892b('0x15')](realtime[_0x892b('0x27')]())[_0x892b('0x15')](zoho[_0x892b('0x28')]())['then'](realtime['initZohoAccounts']())[_0x892b('0x15')](vtiger[_0x892b('0x29')]())[_0x892b('0x15')](realtime[_0x892b('0x2a')]())[_0x892b('0x15')](freshsales[_0x892b('0x2b')]())['then'](realtime['initFreshsalesAccounts']())[_0x892b('0x15')](servicenow[_0x892b('0x2c')]())[_0x892b('0x15')](realtime[_0x892b('0x2d')]())[_0x892b('0x15')](dynamics365[_0x892b('0x2e')]())[_0x892b('0x15')](realtime[_0x892b('0x2f')]())[_0x892b('0x15')](campaign[_0x892b('0x30')]())['then'](realtime[_0x892b('0x31')]())[_0x892b('0x15')](voiceExtension[_0x892b('0x32')]())[_0x892b('0x15')](realtime[_0x892b('0x33')]())[_0x892b('0x15')](faxAccount['getFaxAccounts']())[_0x892b('0x15')](realtime['initFaxAccounts']())[_0x892b('0x15')](function(){return realtime;});}function initParams(){return BPromise[_0x892b('0x14')]()[_0x892b('0x15')](voiceQueueReport[_0x892b('0x34')]())['then'](realtime[_0x892b('0x35')]())['then'](cmHopperHistory[_0x892b('0x36')]())['then'](realtime[_0x892b('0x37')]())[_0x892b('0x15')](cmHopperHistory['getCampaignHopperHistory']())[_0x892b('0x15')](realtime['initCampaignHopperHistory']())[_0x892b('0x15')](voiceCallReport['getVoiceCallReports']())[_0x892b('0x15')](realtime[_0x892b('0x38')]())[_0x892b('0x15')](function(_0x2ccd24){})['catch'](function(_0x1eed21){console[_0x892b('0x39')](_0x1eed21);});}function main(){return server[_0x892b('0x3a')](realtime,preview,fax)[_0x892b('0x15')](function(_0x22a02b){return initRealtime();})[_0x892b('0x15')](function(){return initParams();})['then'](function(){report[_0x892b('0x3b')]();setInterval(initRealtime,0x1388);})[_0x892b('0x3c')](function(_0x28b665){console[_0x892b('0x39')](_0x28b665);});}main(); \ No newline at end of file +var _0x5239=['get','hour','resolve','then','getAgents','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','getTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','initSalesforceAccounts','getSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','initVoiceCallReports','catch','log','sync','bluebird','util','moment','./server','./realtime','./report','./acw','./trigger','./dialer','./preview','./rpc/user','./rpc/voiceQueueReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/servicenow','./rpc/integrations/dynamics365'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0x5239,0x72));var _0x9523=function(_0x53ddd5,_0x5da79c){_0x53ddd5=_0x53ddd5-0x0;var _0x49486b=_0x5239[_0x53ddd5];return _0x49486b;};'use strict';var BPromise=require(_0x9523('0x0'));var util=require(_0x9523('0x1'));var moment=require(_0x9523('0x2'));var server=require(_0x9523('0x3'));var Realtime=require(_0x9523('0x4'));var Report=require(_0x9523('0x5'));var Acw=require(_0x9523('0x6'));var Trigger=require(_0x9523('0x7'));var Dialer=require(_0x9523('0x8'));var Preview=require(_0x9523('0x9'));var Fax=require('./fax');var user=require(_0x9523('0xa'));var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0x9523('0xb'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0x9523('0xc'));var trigger=require(_0x9523('0xd'));var template=require(_0x9523('0xe'));var cmHopperHistory=require(_0x9523('0xf'));var campaign=require(_0x9523('0x10'));var voiceExtension=require(_0x9523('0x11'));var faxAccount=require(_0x9523('0x12'));var zendesk=require(_0x9523('0x13'));var salesforce=require(_0x9523('0x14'));var sugarcrm=require(_0x9523('0x15'));var freshdesk=require(_0x9523('0x16'));var desk=require(_0x9523('0x17'));var zoho=require('./rpc/integrations/zoho');var vtiger=require('./rpc/integrations/vtiger');var freshsales=require('./rpc/integrations/freshsales');var servicenow=require(_0x9523('0x18'));var dynamics365=require(_0x9523('0x19'));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()[_0x9523('0x1a')](_0x9523('0x1b'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get']('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x9523('0x1c')]()[_0x9523('0x1d')](user[_0x9523('0x1e')]())['then'](realtime[_0x9523('0x1f')]())[_0x9523('0x1d')](user[_0x9523('0x20')]())['then'](realtime[_0x9523('0x21')]())['then'](trunk[_0x9523('0x22')]())[_0x9523('0x1d')](realtime[_0x9523('0x23')]())[_0x9523('0x1d')](voiceQueue[_0x9523('0x24')]())[_0x9523('0x1d')](realtime['initVoiceQueues']())[_0x9523('0x1d')](trigger[_0x9523('0x25')]())['then'](realtime['initTriggers']())['then'](template[_0x9523('0x26')]())[_0x9523('0x1d')](realtime[_0x9523('0x27')]())[_0x9523('0x1d')](zendesk[_0x9523('0x28')]())[_0x9523('0x1d')](realtime[_0x9523('0x29')]())[_0x9523('0x1d')](salesforce['getSalesforceAccounts']())['then'](realtime[_0x9523('0x2a')]())[_0x9523('0x1d')](sugarcrm[_0x9523('0x2b')]())[_0x9523('0x1d')](realtime['initSugarcrmAccounts']())[_0x9523('0x1d')](freshdesk[_0x9523('0x2c')]())['then'](realtime[_0x9523('0x2d')]())[_0x9523('0x1d')](desk[_0x9523('0x2e')]())[_0x9523('0x1d')](realtime[_0x9523('0x2f')]())[_0x9523('0x1d')](zoho[_0x9523('0x30')]())['then'](realtime[_0x9523('0x31')]())[_0x9523('0x1d')](vtiger[_0x9523('0x32')]())[_0x9523('0x1d')](realtime[_0x9523('0x33')]())[_0x9523('0x1d')](freshsales['getFreshsalesAccounts']())[_0x9523('0x1d')](realtime['initFreshsalesAccounts']())[_0x9523('0x1d')](servicenow[_0x9523('0x34')]())[_0x9523('0x1d')](realtime[_0x9523('0x35')]())[_0x9523('0x1d')](dynamics365[_0x9523('0x36')]())['then'](realtime[_0x9523('0x37')]())[_0x9523('0x1d')](campaign[_0x9523('0x38')]())[_0x9523('0x1d')](realtime[_0x9523('0x39')]())[_0x9523('0x1d')](voiceExtension[_0x9523('0x3a')]())['then'](realtime[_0x9523('0x3b')]())[_0x9523('0x1d')](faxAccount[_0x9523('0x3c')]())[_0x9523('0x1d')](realtime['initFaxAccounts']())[_0x9523('0x1d')](function(){return realtime;});}function initParams(){return BPromise[_0x9523('0x1c')]()['then'](voiceQueueReport['getVoiceQueueReports']())[_0x9523('0x1d')](realtime[_0x9523('0x3d')]())[_0x9523('0x1d')](cmHopperHistory[_0x9523('0x3e')]())[_0x9523('0x1d')](realtime[_0x9523('0x3f')]())[_0x9523('0x1d')](cmHopperHistory[_0x9523('0x40')]())[_0x9523('0x1d')](realtime[_0x9523('0x41')]())[_0x9523('0x1d')](voiceCallReport['getVoiceCallReports']())['then'](realtime[_0x9523('0x42')]())['then'](function(_0x4eb72b){})[_0x9523('0x43')](function(_0x12f09e){console[_0x9523('0x44')](_0x12f09e);});}function main(){return server['listen'](realtime,preview,fax)[_0x9523('0x1d')](function(_0x385436){return initRealtime();})['then'](function(){return initParams();})['then'](function(){report[_0x9523('0x45')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x3db92e){console['log'](_0x3db92e);});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index 96cf7eb..456fa2c 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 _0xa9fc=['emit','user:save','exports','lodash','util','moment','ioredis','defaults','localhost','socket.io-emitter','redis','name','email','fullname','unknown','stateTime','address','mobile','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','local','updateStatusRealtime','state','toLowerCase','inuse','talking','statePause','toNumber','format','accountcode','status','stringify','md5','user:%s'];(function(_0xfc816d,_0x991e19){var _0x4adc22=function(_0x9b75d2){while(--_0x9b75d2){_0xfc816d['push'](_0xfc816d['shift']());}};_0x4adc22(++_0x991e19);}(_0xa9fc,0x1a5));var _0xca9f=function(_0x888385,_0x9cdc66){_0x888385=_0x888385-0x0;var _0x22d5c2=_0xa9fc[_0x888385];return _0x22d5c2;};'use strict';var _=require(_0xca9f('0x0'));var util=require(_0xca9f('0x1'));var moment=require(_0xca9f('0x2'));var md5=require('md5');var Redis=require(_0xca9f('0x3'));var config=require('../../../config/environment');config['redis']=_[_0xca9f('0x4')](config['redis'],{'host':_0xca9f('0x5'),'port':0x18eb});var io=require(_0xca9f('0x6'))(new Redis(config[_0xca9f('0x7')]));function Agent(_0x23a79c){this['id']=_0x23a79c['id']||0x0;this[_0xca9f('0x8')]=_0x23a79c[_0xca9f('0x8')]||'';this[_0xca9f('0x9')]=_0x23a79c[_0xca9f('0x9')]||'';this['accountcode']=_0x23a79c['accountcode']||'';this[_0xca9f('0xa')]=_0x23a79c[_0xca9f('0xa')]||'';this['state']=_0xca9f('0xb');this[_0xca9f('0xc')]=0x0;this['status']=_0xca9f('0xb');this[_0xca9f('0xd')]='';this['phone']='';this[_0xca9f('0xe')]='';this['interface']='';this[_0xca9f('0xf')]=_0x23a79c[_0xca9f('0xf')]||![];this[_0xca9f('0x10')]=_0xca9f('0xb');this[_0xca9f('0x11')]=0x0;this[_0xca9f('0x12')]='';this[_0xca9f('0x13')]='';this[_0xca9f('0x14')]=![];this[_0xca9f('0x15')]=![];this['md5']='';}Agent['prototype'][_0xca9f('0x16')]=function(_0x4c93b4){var _0x33b195;if(_0x4c93b4&&_0x4c93b4[_0xca9f('0x17')]){_0x33b195=_0x4c93b4[_0xca9f('0x17')][_0xca9f('0x18')]();switch(_0x33b195){case'not_inuse':_0x33b195='idle';break;case _0xca9f('0x19'):_0x33b195=_0xca9f('0x1a');break;}}if(_0x33b195&&this[_0xca9f('0x10')]!==_0x33b195||_0x4c93b4[_0xca9f('0x1b')]){this[_0xca9f('0x11')]=_[_0xca9f('0x1c')](moment()[_0xca9f('0x1d')]('x'));}if(_0x33b195){this[_0xca9f('0x10')]=_0x33b195;}var _0x16123d={'id':this['id'],'name':this['name'],'email':this['email'],'accountcode':this[_0xca9f('0x1e')],'fullname':this[_0xca9f('0xa')],'state':this[_0xca9f('0x17')],'stateTime':this[_0xca9f('0xc')],'status':this[_0xca9f('0x1f')],'address':this[_0xca9f('0xd')],'online':this[_0xca9f('0xf')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this['voiceStatusTime'],'voiceStatusCallerIdNumber':this[_0xca9f('0x12')],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this['interface'],'onhold':this[_0xca9f('0x14')]};var _0x4c904c=md5(JSON[_0xca9f('0x20')](_0x16123d));if(this['md5']!==_0x4c904c){this[_0xca9f('0x21')]=_0x4c904c;io['to'](util['format'](_0xca9f('0x22'),_0x16123d[_0xca9f('0x8')]))[_0xca9f('0x23')](_0xca9f('0x24'),_0x16123d);}};module[_0xca9f('0x25')]=Agent; \ No newline at end of file +var _0xdfa0=['online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','local','prototype','updateStatusRealtime','state','toLowerCase','not_inuse','inuse','talking','statePause','toNumber','status','format','emit','user:save','exports','lodash','util','moment','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','email','accountcode','fullname','unknown','address','phone','interface'];(function(_0xa1ecc0,_0x5792a9){var _0x1b9754=function(_0x7c0695){while(--_0x7c0695){_0xa1ecc0['push'](_0xa1ecc0['shift']());}};_0x1b9754(++_0x5792a9);}(_0xdfa0,0xf9));var _0x0dfa=function(_0x397712,_0x4e312b){_0x397712=_0x397712-0x0;var _0x1e62da=_0xdfa0[_0x397712];return _0x1e62da;};'use strict';var _=require(_0x0dfa('0x0'));var util=require(_0x0dfa('0x1'));var moment=require(_0x0dfa('0x2'));var md5=require(_0x0dfa('0x3'));var Redis=require(_0x0dfa('0x4'));var config=require(_0x0dfa('0x5'));config[_0x0dfa('0x6')]=_['defaults'](config[_0x0dfa('0x6')],{'host':_0x0dfa('0x7'),'port':0x18eb});var io=require(_0x0dfa('0x8'))(new Redis(config[_0x0dfa('0x6')]));function Agent(_0x52008b){this['id']=_0x52008b['id']||0x0;this[_0x0dfa('0x9')]=_0x52008b[_0x0dfa('0x9')]||'';this['email']=_0x52008b[_0x0dfa('0xa')]||'';this[_0x0dfa('0xb')]=_0x52008b[_0x0dfa('0xb')]||'';this[_0x0dfa('0xc')]=_0x52008b['fullname']||'';this['state']='unknown';this['stateTime']=0x0;this['status']=_0x0dfa('0xd');this[_0x0dfa('0xe')]='';this[_0x0dfa('0xf')]='';this['mobile']='';this[_0x0dfa('0x10')]='';this['online']=_0x52008b[_0x0dfa('0x11')]||![];this[_0x0dfa('0x12')]=_0x0dfa('0xd');this[_0x0dfa('0x13')]=0x0;this[_0x0dfa('0x14')]='';this[_0x0dfa('0x15')]='';this[_0x0dfa('0x16')]=![];this[_0x0dfa('0x17')]=![];this[_0x0dfa('0x3')]='';}Agent[_0x0dfa('0x18')][_0x0dfa('0x19')]=function(_0x101cea){var _0x323d9f;if(_0x101cea&&_0x101cea['state']){_0x323d9f=_0x101cea[_0x0dfa('0x1a')][_0x0dfa('0x1b')]();switch(_0x323d9f){case _0x0dfa('0x1c'):_0x323d9f='idle';break;case _0x0dfa('0x1d'):_0x323d9f=_0x0dfa('0x1e');break;}}if(_0x323d9f&&this[_0x0dfa('0x12')]!==_0x323d9f||_0x101cea[_0x0dfa('0x1f')]){this[_0x0dfa('0x13')]=_[_0x0dfa('0x20')](moment()['format']('x'));}if(_0x323d9f){this['voiceStatus']=_0x323d9f;}var _0x534c9f={'id':this['id'],'name':this[_0x0dfa('0x9')],'email':this['email'],'accountcode':this[_0x0dfa('0xb')],'fullname':this['fullname'],'state':this[_0x0dfa('0x1a')],'stateTime':this['stateTime'],'status':this[_0x0dfa('0x21')],'address':this[_0x0dfa('0xe')],'online':this[_0x0dfa('0x11')],'voiceStatus':this[_0x0dfa('0x12')],'voiceStatusTime':this['voiceStatusTime'],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x0dfa('0x15')],'interface':this[_0x0dfa('0x10')],'onhold':this[_0x0dfa('0x16')]};var _0x234274=md5(JSON['stringify'](_0x534c9f));if(this[_0x0dfa('0x3')]!==_0x234274){this[_0x0dfa('0x3')]=_0x234274;io['to'](util[_0x0dfa('0x22')]('user:%s',_0x534c9f[_0x0dfa('0x9')]))[_0x0dfa('0x23')](_0x0dfa('0x24'),_0x534c9f);}};module[_0x0dfa('0x25')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index bfba8df..bcd2244 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 _0xb10b=['dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','name','type','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry'];(function(_0x2ff6ce,_0x54e97e){var _0x4f18ec=function(_0x53e931){while(--_0x53e931){_0x2ff6ce['push'](_0x2ff6ce['shift']());}};_0x4f18ec(++_0x54e97e);}(_0xb10b,0x12a));var _0xbb10=function(_0x516a58,_0x55347f){_0x516a58=_0x516a58-0x0;var _0x3527f3=_0xb10b[_0x516a58];return _0x3527f3;};'use strict';function Campaign(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'campaign';this[_0xbb10('0x2')]=0x0;this[_0xbb10('0x3')]=0x0;this[_0xbb10('0x4')]=0x0;this[_0xbb10('0x5')]=0x0;this[_0xbb10('0x6')]='';this[_0xbb10('0x7')]=!![];this['active']=_0x13ce8d[_0xbb10('0x8')];this[_0xbb10('0x9')]=_0x13ce8d['limitCalls'];this[_0xbb10('0xa')]=_0x13ce8d[_0xbb10('0xa')]||null;this[_0xbb10('0xb')]=_0x13ce8d[_0xbb10('0xb')]?_0x13ce8d[_0xbb10('0xb')]:null;this[_0xbb10('0xc')]=_0x13ce8d[_0xbb10('0xc')];this[_0xbb10('0xd')]=_0x13ce8d['dialOriginateCallerIdNumber'];this['dialOriginateTimeout']=_0x13ce8d[_0xbb10('0xe')]||0x1e;this[_0xbb10('0xf')]=_0x13ce8d[_0xbb10('0xf')];this['dialCongestionRetryFrequency']=_0x13ce8d[_0xbb10('0x10')];this['dialBusyMaxRetry']=_0x13ce8d[_0xbb10('0x11')];this[_0xbb10('0x12')]=_0x13ce8d[_0xbb10('0x12')];this[_0xbb10('0x13')]=_0x13ce8d[_0xbb10('0x13')];this[_0xbb10('0x14')]=_0x13ce8d['dialNoAnswerRetryFrequency'];this[_0xbb10('0x15')]=_0x13ce8d[_0xbb10('0x15')];this[_0xbb10('0x16')]=_0x13ce8d[_0xbb10('0x16')]||_0xbb10('0x17');this[_0xbb10('0x18')]=_0x13ce8d[_0xbb10('0x18')]||undefined;this[_0xbb10('0x19')]=_0x13ce8d[_0xbb10('0x19')]||undefined;this[_0xbb10('0x1a')]=_0x13ce8d['dialCutDigit']||undefined;this[_0xbb10('0x1b')]=_0x13ce8d[_0xbb10('0x1b')]?_0x13ce8d[_0xbb10('0x1b')]:undefined;this[_0xbb10('0x1c')]=_0x13ce8d[_0xbb10('0x1c')]?_0x13ce8d[_0xbb10('0x1c')]:undefined;this[_0xbb10('0x1d')]=_0x13ce8d[_0xbb10('0x1d')]?_0x13ce8d[_0xbb10('0x1d')]:undefined;this[_0xbb10('0x1e')]=_0x13ce8d['SquareProject']?_0x13ce8d[_0xbb10('0x1e')]:undefined;this[_0xbb10('0x1f')]=_0x13ce8d[_0xbb10('0x1e')]?_0x13ce8d[_0xbb10('0x1e')][_0xbb10('0x0')]:undefined;this[_0xbb10('0x20')]=_0x13ce8d['dialAMDActive']||![];this[_0xbb10('0x21')]=_0x13ce8d[_0xbb10('0x21')];this['dialAMDGreeting']=_0x13ce8d['dialAMDGreeting'];this[_0xbb10('0x22')]=_0x13ce8d[_0xbb10('0x22')];this[_0xbb10('0x23')]=_0x13ce8d[_0xbb10('0x23')];this[_0xbb10('0x24')]=_0x13ce8d[_0xbb10('0x24')];this[_0xbb10('0x25')]=_0x13ce8d[_0xbb10('0x25')];this[_0xbb10('0x26')]=_0x13ce8d[_0xbb10('0x26')];this[_0xbb10('0x27')]=_0x13ce8d[_0xbb10('0x27')];this['dialAMDMaximumWordLength']=_0x13ce8d['dialAMDMaximumWordLength'];}module['exports']=Campaign; \ No newline at end of file +var _0xb10b=['dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','name','type','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry'];(function(_0x2d2998,_0x4783d8){var _0x3c9531=function(_0x5789df){while(--_0x5789df){_0x2d2998['push'](_0x2d2998['shift']());}};_0x3c9531(++_0x4783d8);}(_0xb10b,0x12a));var _0xbb10=function(_0xf18977,_0x87ecc4){_0xf18977=_0xf18977-0x0;var _0x360bb8=_0xb10b[_0xf18977];return _0x360bb8;};'use strict';function Campaign(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'campaign';this[_0xbb10('0x2')]=0x0;this[_0xbb10('0x3')]=0x0;this[_0xbb10('0x4')]=0x0;this[_0xbb10('0x5')]=0x0;this[_0xbb10('0x6')]='';this[_0xbb10('0x7')]=!![];this['active']=_0x13ce8d[_0xbb10('0x8')];this[_0xbb10('0x9')]=_0x13ce8d['limitCalls'];this[_0xbb10('0xa')]=_0x13ce8d[_0xbb10('0xa')]||null;this[_0xbb10('0xb')]=_0x13ce8d[_0xbb10('0xb')]?_0x13ce8d[_0xbb10('0xb')]:null;this[_0xbb10('0xc')]=_0x13ce8d[_0xbb10('0xc')];this[_0xbb10('0xd')]=_0x13ce8d['dialOriginateCallerIdNumber'];this['dialOriginateTimeout']=_0x13ce8d[_0xbb10('0xe')]||0x1e;this[_0xbb10('0xf')]=_0x13ce8d[_0xbb10('0xf')];this['dialCongestionRetryFrequency']=_0x13ce8d[_0xbb10('0x10')];this['dialBusyMaxRetry']=_0x13ce8d[_0xbb10('0x11')];this[_0xbb10('0x12')]=_0x13ce8d[_0xbb10('0x12')];this[_0xbb10('0x13')]=_0x13ce8d[_0xbb10('0x13')];this[_0xbb10('0x14')]=_0x13ce8d['dialNoAnswerRetryFrequency'];this[_0xbb10('0x15')]=_0x13ce8d[_0xbb10('0x15')];this[_0xbb10('0x16')]=_0x13ce8d[_0xbb10('0x16')]||_0xbb10('0x17');this[_0xbb10('0x18')]=_0x13ce8d[_0xbb10('0x18')]||undefined;this[_0xbb10('0x19')]=_0x13ce8d[_0xbb10('0x19')]||undefined;this[_0xbb10('0x1a')]=_0x13ce8d['dialCutDigit']||undefined;this[_0xbb10('0x1b')]=_0x13ce8d[_0xbb10('0x1b')]?_0x13ce8d[_0xbb10('0x1b')]:undefined;this[_0xbb10('0x1c')]=_0x13ce8d[_0xbb10('0x1c')]?_0x13ce8d[_0xbb10('0x1c')]:undefined;this[_0xbb10('0x1d')]=_0x13ce8d[_0xbb10('0x1d')]?_0x13ce8d[_0xbb10('0x1d')]:undefined;this[_0xbb10('0x1e')]=_0x13ce8d['SquareProject']?_0x13ce8d[_0xbb10('0x1e')]:undefined;this[_0xbb10('0x1f')]=_0x13ce8d[_0xbb10('0x1e')]?_0x13ce8d[_0xbb10('0x1e')][_0xbb10('0x0')]:undefined;this[_0xbb10('0x20')]=_0x13ce8d['dialAMDActive']||![];this[_0xbb10('0x21')]=_0x13ce8d[_0xbb10('0x21')];this['dialAMDGreeting']=_0x13ce8d['dialAMDGreeting'];this[_0xbb10('0x22')]=_0x13ce8d[_0xbb10('0x22')];this[_0xbb10('0x23')]=_0x13ce8d[_0xbb10('0x23')];this[_0xbb10('0x24')]=_0x13ce8d[_0xbb10('0x24')];this[_0xbb10('0x25')]=_0x13ce8d[_0xbb10('0x25')];this[_0xbb10('0x26')]=_0x13ce8d[_0xbb10('0x26')];this[_0xbb10('0x27')]=_0x13ce8d[_0xbb10('0x27')];this['dialAMDMaximumWordLength']=_0x13ce8d['dialAMDMaximumWordLength'];}module['exports']=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 5073ff1..06109fc 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 _0x3aee=['context','exten','answered','answertime','endtime','unmanaged','abandoned','lastdata','billableseconds','holdtime','type','monitorFilename','queue','monitors','transfercalleridnum','transferconnectedlinenum','mohtime','starttime','channel','calleridnum','calleridname','connectedlinenum','connectedlinename','accountcode'];(function(_0x46d137,_0x1321d8){var _0x3096f5=function(_0x56e735){while(--_0x56e735){_0x46d137['push'](_0x46d137['shift']());}};_0x3096f5(++_0x1321d8);}(_0x3aee,0x131));var _0xe3ae=function(_0x191154,_0x56f74c){_0x191154=_0x191154-0x0;var _0x3dcd73=_0x3aee[_0x191154];return _0x3dcd73;};'use strict';function Channel(){this[_0xe3ae('0x0')]=null;this[_0xe3ae('0x1')]='';this['destinationchannel']='';this[_0xe3ae('0x2')]=0x0;this[_0xe3ae('0x3')]='';this[_0xe3ae('0x4')]=undefined;this[_0xe3ae('0x5')]=undefined;this[_0xe3ae('0x6')]=0x0;this[_0xe3ae('0x7')]='';this['uniqueid']=0x0;this['linkedid']=0x0;this[_0xe3ae('0x8')]=0x0;this[_0xe3ae('0x9')]=![];this[_0xe3ae('0xa')]=null;this[_0xe3ae('0xb')]=null;this[_0xe3ae('0xc')]=![];this[_0xe3ae('0xd')]=![];this['lastapplication']='';this[_0xe3ae('0xe')]='';this['duration']=0x0;this[_0xe3ae('0xf')]=0x0;this[_0xe3ae('0x10')]=0x0;this[_0xe3ae('0x11')]=null;this['tag']=null;this['disposition']=null;this['monitor']=![];this[_0xe3ae('0x12')]=null;this[_0xe3ae('0x13')]=null;this[_0xe3ae('0x14')]=[];this[_0xe3ae('0x15')]=undefined;this[_0xe3ae('0x16')]=undefined;this[_0xe3ae('0x17')]=0x0;}module['exports']=Channel; \ No newline at end of file +var _0x2340=['tag','disposition','monitor','monitorFilename','queue','monitors','transfercalleridnum','transferconnectedlinenum','mohtime','exports','starttime','channel','destinationchannel','calleridnum','connectedlinenum','connectedlinename','accountcode','uniqueid','linkedid','exten','answered','answertime','endtime','unmanaged','abandoned','lastapplication','lastdata','duration'];(function(_0x2dfef3,_0x36987a){var _0x21b948=function(_0x4a9f9c){while(--_0x4a9f9c){_0x2dfef3['push'](_0x2dfef3['shift']());}};_0x21b948(++_0x36987a);}(_0x2340,0x1e6));var _0x0234=function(_0x32fb47,_0x456617){_0x32fb47=_0x32fb47-0x0;var _0x1d85e5=_0x2340[_0x32fb47];return _0x1d85e5;};'use strict';function Channel(){this[_0x0234('0x0')]=null;this[_0x0234('0x1')]='';this[_0x0234('0x2')]='';this[_0x0234('0x3')]=0x0;this['calleridname']='';this[_0x0234('0x4')]=undefined;this[_0x0234('0x5')]=undefined;this[_0x0234('0x6')]=0x0;this['context']='';this[_0x0234('0x7')]=0x0;this[_0x0234('0x8')]=0x0;this[_0x0234('0x9')]=0x0;this[_0x0234('0xa')]=![];this[_0x0234('0xb')]=null;this[_0x0234('0xc')]=null;this[_0x0234('0xd')]=![];this[_0x0234('0xe')]=![];this[_0x0234('0xf')]='';this[_0x0234('0x10')]='';this[_0x0234('0x11')]=0x0;this['billableseconds']=0x0;this['holdtime']=0x0;this['type']=null;this[_0x0234('0x12')]=null;this[_0x0234('0x13')]=null;this[_0x0234('0x14')]=![];this[_0x0234('0x15')]=null;this[_0x0234('0x16')]=null;this[_0x0234('0x17')]=[];this[_0x0234('0x18')]=undefined;this[_0x0234('0x19')]=undefined;this[_0x0234('0x1a')]=0x0;}module[_0x0234('0x1b')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 2245be3..88db0f1 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 _0xa992=['token','tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa992,0x18c));var _0x2a99=function(_0x491439,_0x50ce14){_0x491439=_0x491439-0x0;var _0x230aa7=_0xa992[_0x491439];return _0x230aa7;};'use strict';function DeskAccount(_0x90172){this['id']=_0x90172['id']||0x0;this[_0x2a99('0x0')]=_0x90172[_0x2a99('0x0')]||'';this[_0x2a99('0x1')]=_0x90172['username']||'';this[_0x2a99('0x2')]=_0x90172[_0x2a99('0x2')]||'';this[_0x2a99('0x3')]=_0x90172[_0x2a99('0x3')]||'';this[_0x2a99('0x4')]=_0x90172[_0x2a99('0x4')]||'';this[_0x2a99('0x5')]=_0x90172[_0x2a99('0x5')]||'';this[_0x2a99('0x6')]=_0x90172[_0x2a99('0x6')]||'';this['token']=_0x90172[_0x2a99('0x7')]||'';this[_0x2a99('0x8')]=_0x90172[_0x2a99('0x8')]||'';this[_0x2a99('0x9')]=_0x90172[_0x2a99('0x9')]||'';this[_0x2a99('0xa')]=_0x90172[_0x2a99('0xa')]||'';this[_0x2a99('0xb')]=_0x90172[_0x2a99('0xb')]||{};}module[_0x2a99('0xc')]=DeskAccount; \ No newline at end of file +var _0x782e=['serverUrl','Configurations','exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type'];(function(_0x157c1b,_0xa14471){var _0x436e11=function(_0x48aee2){while(--_0x48aee2){_0x157c1b['push'](_0x157c1b['shift']());}};_0x436e11(++_0xa14471);}(_0x782e,0xb9));var _0xe782=function(_0x5918ff,_0x36c3bc){_0x5918ff=_0x5918ff-0x0;var _0x5e5ef8=_0x782e[_0x5918ff];return _0x5e5ef8;};'use strict';function DeskAccount(_0x19e010){this['id']=_0x19e010['id']||0x0;this['name']=_0x19e010[_0xe782('0x0')]||'';this[_0xe782('0x1')]=_0x19e010['username']||'';this[_0xe782('0x2')]=_0x19e010[_0xe782('0x2')]||'';this['authType']=_0x19e010[_0xe782('0x3')]||'';this[_0xe782('0x4')]=_0x19e010[_0xe782('0x4')]||'';this[_0xe782('0x5')]=_0x19e010['consumerKey']||'';this[_0xe782('0x6')]=_0x19e010['consumerSecret']||'';this['token']=_0x19e010[_0xe782('0x7')]||'';this['tokenSecret']=_0x19e010[_0xe782('0x8')]||'';this[_0xe782('0x9')]=_0x19e010[_0xe782('0x9')]||'';this[_0xe782('0xa')]=_0x19e010[_0xe782('0xa')]||'';this[_0xe782('0xb')]=_0x19e010[_0xe782('0xb')]||{};}module[_0xe782('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 4193054..e510957 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 _0x79df=['exports','name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','Configurations'];(function(_0x29ac27,_0x525d68){var _0x3d7230=function(_0x3d3a16){while(--_0x3d3a16){_0x29ac27['push'](_0x29ac27['shift']());}};_0x3d7230(++_0x525d68);}(_0x79df,0xc9));var _0xf79d=function(_0x295a9a,_0x2fd84c){_0x295a9a=_0x295a9a-0x0;var _0x3655d5=_0x79df[_0x295a9a];return _0x3655d5;};'use strict';function Dynamics365Account(_0xe8070){this['id']=_0xe8070['id']||0x0;this[_0xf79d('0x0')]=_0xe8070[_0xf79d('0x0')]||'';this[_0xf79d('0x1')]=_0xe8070['username']||'';this[_0xf79d('0x2')]=_0xe8070['password']||'';this[_0xf79d('0x3')]=_0xe8070['remoteUri']||'';this[_0xf79d('0x4')]=_0xe8070[_0xf79d('0x4')]||'';this[_0xf79d('0x5')]=_0xe8070[_0xf79d('0x5')]||'';this[_0xf79d('0x6')]=_0xe8070[_0xf79d('0x6')]||{};this[_0xf79d('0x7')]=_0xe8070[_0xf79d('0x7')]||'';this[_0xf79d('0x8')]=_0xe8070[_0xf79d('0x8')]||{};}module[_0xf79d('0x9')]=Dynamics365Account; \ No newline at end of file +var _0x6cfe=['clientId','clientSecret','serverUrl','Configurations','exports','name','username','password','remoteUri','tenantId'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x6cfe,0xaf));var _0xe6cf=function(_0x3adc73,_0x2f442a){_0x3adc73=_0x3adc73-0x0;var _0x1c1001=_0x6cfe[_0x3adc73];return _0x1c1001;};'use strict';function Dynamics365Account(_0x2a2993){this['id']=_0x2a2993['id']||0x0;this[_0xe6cf('0x0')]=_0x2a2993['name']||'';this[_0xe6cf('0x1')]=_0x2a2993[_0xe6cf('0x1')]||'';this['password']=_0x2a2993[_0xe6cf('0x2')]||'';this['remoteUri']=_0x2a2993[_0xe6cf('0x3')]||'';this[_0xe6cf('0x4')]=_0x2a2993['tenantId']||'';this['clientId']=_0x2a2993[_0xe6cf('0x5')]||'';this['clientSecret']=_0x2a2993[_0xe6cf('0x6')]||{};this[_0xe6cf('0x7')]=_0x2a2993[_0xe6cf('0x7')]||'';this[_0xe6cf('0x8')]=_0x2a2993['Configurations']||{};}module[_0xe6cf('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 36e6cff..938115c 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 _0x4f9a=['modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate'];(function(_0x2642cb,_0x4b917f){var _0xe6e41=function(_0x281676){while(--_0x281676){_0x2642cb['push'](_0x2642cb['shift']());}};_0xe6e41(++_0x4b917f);}(_0x4f9a,0xd1));var _0xa4f9=function(_0x4cc89d,_0x5bc1cf){_0x4cc89d=_0x4cc89d-0x0;var _0x5764f6=_0x4f9a[_0x4cc89d];return _0x5764f6;};'use strict';function FaxAccount(_0x264f92){this['id']=_0x264f92['id']||0x0;this[_0xa4f9('0x0')]=_0x264f92[_0xa4f9('0x0')]||'';this[_0xa4f9('0x1')]=_0x264f92[_0xa4f9('0x1')];this['ecm']=_0x264f92[_0xa4f9('0x2')];this['headerinfo']=_0x264f92[_0xa4f9('0x3')];this[_0xa4f9('0x4')]=_0x264f92[_0xa4f9('0x4')];this[_0xa4f9('0x5')]=_0x264f92[_0xa4f9('0x5')]||0x960;this[_0xa4f9('0x6')]=_0x264f92[_0xa4f9('0x6')]||0x3840;this['modem']=_0x264f92[_0xa4f9('0x7')]||_0xa4f9('0x8');this[_0xa4f9('0x9')]=_0x264f92['gateway']||'no';this[_0xa4f9('0xa')]=_0x264f92[_0xa4f9('0xa')]||'no';this[_0xa4f9('0xb')]=_0x264f92[_0xa4f9('0xb')]||0x1388;this[_0xa4f9('0xc')]=_0x264f92[_0xa4f9('0xc')]||_0xa4f9('0xd');this[_0xa4f9('0xe')]=_0x264f92[_0xa4f9('0xe')]?_0x264f92[_0xa4f9('0xe')]:undefined;this[_0xa4f9('0xf')]=_0x264f92['ListId'];this[_0xa4f9('0x10')]=_0x264f92[_0xa4f9('0x10')];}module[_0xa4f9('0x11')]=FaxAccount; \ No newline at end of file +var _0x961e=['tech','SIP','Trunk','ListId','key','exports','name','description','ecm','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x961e,0xd2));var _0xe961=function(_0x6bafd7,_0x580532){_0x6bafd7=_0x6bafd7-0x0;var _0xac2bb4=_0x961e[_0x6bafd7];return _0xac2bb4;};'use strict';function FaxAccount(_0x660381){this['id']=_0x660381['id']||0x0;this[_0xe961('0x0')]=_0x660381[_0xe961('0x0')]||'';this[_0xe961('0x1')]=_0x660381[_0xe961('0x1')];this[_0xe961('0x2')]=_0x660381[_0xe961('0x2')];this['headerinfo']=_0x660381['headerinfo'];this[_0xe961('0x3')]=_0x660381['localstationid'];this[_0xe961('0x4')]=_0x660381['minrate']||0x960;this['maxrate']=_0x660381[_0xe961('0x5')]||0x3840;this[_0xe961('0x6')]=_0x660381[_0xe961('0x6')]||_0xe961('0x7');this[_0xe961('0x8')]=_0x660381[_0xe961('0x8')]||'no';this[_0xe961('0x9')]=_0x660381[_0xe961('0x9')]||'no';this[_0xe961('0xa')]=_0x660381[_0xe961('0xa')]||0x1388;this[_0xe961('0xb')]=_0x660381['tech']||_0xe961('0xc');this[_0xe961('0xd')]=_0x660381[_0xe961('0xd')]?_0x660381[_0xe961('0xd')]:undefined;this[_0xe961('0xe')]=_0x660381[_0xe961('0xe')];this[_0xe961('0xf')]=_0x660381['key'];}module[_0xe961('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 f85341e..a4c4e4d 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 _0xece5=['token','remoteUri','serverUrl','Configurations','name','username'];(function(_0x596712,_0x52a01e){var _0x164810=function(_0x19508b){while(--_0x19508b){_0x596712['push'](_0x596712['shift']());}};_0x164810(++_0x52a01e);}(_0xece5,0x1ea));var _0x5ece=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xece5[_0x8c43de];return _0xa6591b;};'use strict';function FreshdeskAccount(_0x35b585){this['id']=_0x35b585['id']||0x0;this['name']=_0x35b585[_0x5ece('0x0')]||'';this[_0x5ece('0x1')]=_0x35b585[_0x5ece('0x1')]||'';this['apiKey']=_0x35b585[_0x5ece('0x2')]||'';this[_0x5ece('0x3')]=_0x35b585[_0x5ece('0x3')]||'';this[_0x5ece('0x4')]=_0x35b585['serverUrl']||'';this[_0x5ece('0x5')]=_0x35b585['Configurations']||{};}module['exports']=FreshdeskAccount; \ No newline at end of file +var _0x5641=['name','username','apiKey','remoteUri','Configurations','exports'];(function(_0x1dad92,_0x2f948c){var _0x90a9f6=function(_0x5644db){while(--_0x5644db){_0x1dad92['push'](_0x1dad92['shift']());}};_0x90a9f6(++_0x2f948c);}(_0x5641,0x1bc));var _0x1564=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0x5641[_0x5e3b04];return _0x1fc44d;};'use strict';function FreshdeskAccount(_0x5f5186){this['id']=_0x5f5186['id']||0x0;this[_0x1564('0x0')]=_0x5f5186[_0x1564('0x0')]||'';this[_0x1564('0x1')]=_0x5f5186[_0x1564('0x1')]||'';this[_0x1564('0x2')]=_0x5f5186['token']||'';this[_0x1564('0x3')]=_0x5f5186[_0x1564('0x3')]||'';this['serverUrl']=_0x5f5186['serverUrl']||'';this[_0x1564('0x4')]=_0x5f5186[_0x1564('0x4')]||{};}module[_0x1564('0x5')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index 2566223..f22029f 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 _0xe3b7=['remoteUri','serverUrl','Configurations','exports','name','username','token'];(function(_0x34b7ef,_0x1a42f8){var _0x12f9b0=function(_0x2628f0){while(--_0x2628f0){_0x34b7ef['push'](_0x34b7ef['shift']());}};_0x12f9b0(++_0x1a42f8);}(_0xe3b7,0x17e));var _0x7e3b=function(_0x409353,_0xe9f04d){_0x409353=_0x409353-0x0;var _0x4f4b59=_0xe3b7[_0x409353];return _0x4f4b59;};'use strict';function FreshsalesAccount(_0x14ee77){this['id']=_0x14ee77['id']||0x0;this[_0x7e3b('0x0')]=_0x14ee77[_0x7e3b('0x0')]||'';this[_0x7e3b('0x1')]=_0x14ee77[_0x7e3b('0x1')]||'';this['apiKey']=_0x14ee77[_0x7e3b('0x2')]||'';this[_0x7e3b('0x3')]=_0x14ee77[_0x7e3b('0x3')]||'';this[_0x7e3b('0x4')]=_0x14ee77[_0x7e3b('0x4')]||'';this[_0x7e3b('0x5')]=_0x14ee77[_0x7e3b('0x5')]||{};}module[_0x7e3b('0x6')]=FreshsalesAccount; \ No newline at end of file +var _0x2f2c=['serverUrl','Configurations','exports','name','username','remoteUri'];(function(_0x4a97e6,_0x1aca09){var _0x365d3a=function(_0x39f7d0){while(--_0x39f7d0){_0x4a97e6['push'](_0x4a97e6['shift']());}};_0x365d3a(++_0x1aca09);}(_0x2f2c,0xf9));var _0xc2f2=function(_0x3e0000,_0x14b2fa){_0x3e0000=_0x3e0000-0x0;var _0x5a7761=_0x2f2c[_0x3e0000];return _0x5a7761;};'use strict';function FreshsalesAccount(_0x127a8f){this['id']=_0x127a8f['id']||0x0;this['name']=_0x127a8f[_0xc2f2('0x0')]||'';this[_0xc2f2('0x1')]=_0x127a8f[_0xc2f2('0x1')]||'';this['apiKey']=_0x127a8f['token']||'';this[_0xc2f2('0x2')]=_0x127a8f[_0xc2f2('0x2')]||'';this['serverUrl']=_0x127a8f[_0xc2f2('0x3')]||'';this[_0xc2f2('0x4')]=_0x127a8f[_0xc2f2('0x4')]||{};}module[_0xc2f2('0x5')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 8f8fd0a..574b6f9 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 _0xeaab=['queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','accountcode','context','exten','priority','holdtime','assigned','lastAssignedTo','mohtime','exports','type','inbound','calleridnum','calleridname','queue'];(function(_0x4ad7f7,_0xf0d103){var _0x54bfee=function(_0x5d715c){while(--_0x5d715c){_0x4ad7f7['push'](_0x4ad7f7['shift']());}};_0x54bfee(++_0xf0d103);}(_0xeaab,0x14d));var _0xbeaa=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xeaab[_0xa464c9];return _0x3d73c4;};'use strict';function QueueReport(){this[_0xbeaa('0x0')]=_0xbeaa('0x1');this['uniqueid']='';this[_0xbeaa('0x2')]='';this[_0xbeaa('0x3')]='';this[_0xbeaa('0x4')]='';this['queuecallerjoinAt']=null;this[_0xbeaa('0x5')]=null;this[_0xbeaa('0x6')]=0x1;this[_0xbeaa('0x7')]=0x1;this[_0xbeaa('0x8')]=![];this[_0xbeaa('0x9')]=null;this[_0xbeaa('0xa')]=![];this['queuecallercompleteAt']=null;this[_0xbeaa('0xb')]=![];this[_0xbeaa('0xc')]=null;this[_0xbeaa('0xd')]=0x1;this[_0xbeaa('0xe')]='';this[_0xbeaa('0xf')]='';this[_0xbeaa('0x10')]='';this[_0xbeaa('0x11')]='';this[_0xbeaa('0x12')]='';this[_0xbeaa('0x13')]='';this[_0xbeaa('0x14')]='';this[_0xbeaa('0x15')]=0x0;this[_0xbeaa('0x16')]=![];this[_0xbeaa('0x17')]='';this[_0xbeaa('0x18')]=0x0;this['variables']={};}module[_0xbeaa('0x19')]=QueueReport; \ No newline at end of file +var _0xddd1=['queuecallerabandonAt','queuecallerexit','queuecallerexitAt','channel','connectedlinenum','connectedlinename','accountcode','context','exten','assigned','mohtime','exports','type','inbound','uniqueid','calleridname','queue','position','count','queuecallerabandon'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0xddd1,0x1ec));var _0x1ddd=function(_0x5367ea,_0x359e60){_0x5367ea=_0x5367ea-0x0;var _0x884942=_0xddd1[_0x5367ea];return _0x884942;};'use strict';function QueueReport(){this[_0x1ddd('0x0')]=_0x1ddd('0x1');this[_0x1ddd('0x2')]='';this['calleridnum']='';this[_0x1ddd('0x3')]='';this[_0x1ddd('0x4')]='';this['queuecallerjoinAt']=null;this['queuecallerleaveAt']=null;this[_0x1ddd('0x5')]=0x1;this[_0x1ddd('0x6')]=0x1;this[_0x1ddd('0x7')]=![];this[_0x1ddd('0x8')]=null;this['queuecallercomplete']=![];this['queuecallercompleteAt']=null;this[_0x1ddd('0x9')]=![];this[_0x1ddd('0xa')]=null;this['originalposition']=0x1;this[_0x1ddd('0xb')]='';this[_0x1ddd('0xc')]='';this[_0x1ddd('0xd')]='';this[_0x1ddd('0xe')]='';this[_0x1ddd('0xf')]='';this[_0x1ddd('0x10')]='';this['priority']='';this['holdtime']=0x0;this[_0x1ddd('0x11')]=![];this['lastAssignedTo']='';this[_0x1ddd('0x12')]=0x0;this['variables']={};}module[_0x1ddd('0x13')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index add8fd9..f6ea534 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 _0xefc9=['remoteUri','password','clientId','clientSecret','securityToken','type','serverUrl','Configurations','exports','name','username'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xefc9,0x1ed));var _0x9efc=function(_0x5c4e78,_0x240beb){_0x5c4e78=_0x5c4e78-0x0;var _0x1957a6=_0xefc9[_0x5c4e78];return _0x1957a6;};'use strict';function SalesforceAccount(_0x5ca4c9){this['id']=_0x5ca4c9['id']||0x0;this[_0x9efc('0x0')]=_0x5ca4c9[_0x9efc('0x0')]||'';this[_0x9efc('0x1')]=_0x5ca4c9[_0x9efc('0x1')]||'';this[_0x9efc('0x2')]=_0x5ca4c9[_0x9efc('0x2')]||'';this[_0x9efc('0x3')]=_0x5ca4c9[_0x9efc('0x3')]||'';this[_0x9efc('0x4')]=_0x5ca4c9[_0x9efc('0x4')]||'';this[_0x9efc('0x5')]=_0x5ca4c9[_0x9efc('0x5')]||'';this[_0x9efc('0x6')]=_0x5ca4c9[_0x9efc('0x6')]||'';this['type']=_0x5ca4c9[_0x9efc('0x7')]||'integrationTab';this[_0x9efc('0x8')]=_0x5ca4c9[_0x9efc('0x8')]||'';this[_0x9efc('0x9')]=_0x5ca4c9['Configurations']||{};}module[_0x9efc('0xa')]=SalesforceAccount; \ No newline at end of file +var _0x19b4=['password','clientId','clientSecret','securityToken','type','serverUrl','Configurations','exports','name','username','remoteUri'];(function(_0x8162ab,_0x90a1b7){var _0x5cf1d4=function(_0x5d572b){while(--_0x5d572b){_0x8162ab['push'](_0x8162ab['shift']());}};_0x5cf1d4(++_0x90a1b7);}(_0x19b4,0xa2));var _0x419b=function(_0x285122,_0x293e57){_0x285122=_0x285122-0x0;var _0x1d2d4d=_0x19b4[_0x285122];return _0x1d2d4d;};'use strict';function SalesforceAccount(_0x4f551f){this['id']=_0x4f551f['id']||0x0;this['name']=_0x4f551f[_0x419b('0x0')]||'';this[_0x419b('0x1')]=_0x4f551f['username']||'';this[_0x419b('0x2')]=_0x4f551f['remoteUri']||'';this[_0x419b('0x3')]=_0x4f551f[_0x419b('0x3')]||'';this['clientId']=_0x4f551f[_0x419b('0x4')]||'';this[_0x419b('0x5')]=_0x4f551f[_0x419b('0x5')]||'';this['securityToken']=_0x4f551f[_0x419b('0x6')]||'';this['type']=_0x4f551f[_0x419b('0x7')]||'integrationTab';this[_0x419b('0x8')]=_0x4f551f[_0x419b('0x8')]||'';this[_0x419b('0x9')]=_0x4f551f[_0x419b('0x9')]||{};}module[_0x419b('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 65f15df..2da5546 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 _0x61e0=['password','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x1a18a2,_0x28e00d){var _0x598eb0=function(_0x2cd4b8){while(--_0x2cd4b8){_0x1a18a2['push'](_0x1a18a2['shift']());}};_0x598eb0(++_0x28e00d);}(_0x61e0,0xc2));var _0x061e=function(_0x29e8ff,_0x15353b){_0x29e8ff=_0x29e8ff-0x0;var _0x334fab=_0x61e0[_0x29e8ff];return _0x334fab;};'use strict';function ServicenowAccount(_0x8d5e8b){this['id']=_0x8d5e8b['id']||0x0;this[_0x061e('0x0')]=_0x8d5e8b[_0x061e('0x0')]||'';this[_0x061e('0x1')]=_0x8d5e8b[_0x061e('0x1')]||'';this[_0x061e('0x2')]=_0x8d5e8b['password']||'';this[_0x061e('0x3')]=_0x8d5e8b['remoteUri']||'';this[_0x061e('0x4')]=_0x8d5e8b[_0x061e('0x4')]||'';this[_0x061e('0x5')]=_0x8d5e8b[_0x061e('0x5')]||{};}module[_0x061e('0x6')]=ServicenowAccount; \ No newline at end of file +var _0xd78e=['Configurations','exports','name','username','password','remoteUri','serverUrl'];(function(_0x1f3aec,_0x24c18e){var _0x409f0d=function(_0x52b818){while(--_0x52b818){_0x1f3aec['push'](_0x1f3aec['shift']());}};_0x409f0d(++_0x24c18e);}(_0xd78e,0x144));var _0xed78=function(_0x480bc8,_0x1fac40){_0x480bc8=_0x480bc8-0x0;var _0x28c245=_0xd78e[_0x480bc8];return _0x28c245;};'use strict';function ServicenowAccount(_0x566a52){this['id']=_0x566a52['id']||0x0;this[_0xed78('0x0')]=_0x566a52[_0xed78('0x0')]||'';this[_0xed78('0x1')]=_0x566a52[_0xed78('0x1')]||'';this['password']=_0x566a52[_0xed78('0x2')]||'';this[_0xed78('0x3')]=_0x566a52['remoteUri']||'';this[_0xed78('0x4')]=_0x566a52['serverUrl']||'';this['Configurations']=_0x566a52[_0xed78('0x5')]||{};}module[_0xed78('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 2e5f5f7..c4f4187 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 _0x30bd=['username','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x5effd0,_0x810199){var _0x2e3a15=function(_0x2190ea){while(--_0x2190ea){_0x5effd0['push'](_0x5effd0['shift']());}};_0x2e3a15(++_0x810199);}(_0x30bd,0x6b));var _0xd30b=function(_0x589573,_0x2f2a57){_0x589573=_0x589573-0x0;var _0x6b908b=_0x30bd[_0x589573];return _0x6b908b;};'use strict';function SugarcrmAccount(_0x5c6a44){this['id']=_0x5c6a44['id']||0x0;this[_0xd30b('0x0')]=_0x5c6a44[_0xd30b('0x0')]||'';this[_0xd30b('0x1')]=_0x5c6a44[_0xd30b('0x1')]||'';this['password']=_0x5c6a44['password']||'';this[_0xd30b('0x2')]=_0x5c6a44[_0xd30b('0x2')]||'';this[_0xd30b('0x3')]=_0x5c6a44[_0xd30b('0x3')]||'';this[_0xd30b('0x4')]=_0x5c6a44[_0xd30b('0x4')]||{};}module[_0xd30b('0x5')]=SugarcrmAccount; \ No newline at end of file +var _0x7c46=['name','username','password','remoteUri','serverUrl','Configurations','exports'];(function(_0x3b29d5,_0x12faa2){var _0x20b96d=function(_0x284207){while(--_0x284207){_0x3b29d5['push'](_0x3b29d5['shift']());}};_0x20b96d(++_0x12faa2);}(_0x7c46,0x16c));var _0x67c4=function(_0x8acf30,_0x4bbdfb){_0x8acf30=_0x8acf30-0x0;var _0x129a78=_0x7c46[_0x8acf30];return _0x129a78;};'use strict';function SugarcrmAccount(_0x42c6eb){this['id']=_0x42c6eb['id']||0x0;this[_0x67c4('0x0')]=_0x42c6eb[_0x67c4('0x0')]||'';this['username']=_0x42c6eb[_0x67c4('0x1')]||'';this[_0x67c4('0x2')]=_0x42c6eb[_0x67c4('0x2')]||'';this[_0x67c4('0x3')]=_0x42c6eb[_0x67c4('0x3')]||'';this[_0x67c4('0x4')]=_0x42c6eb[_0x67c4('0x4')]||'';this[_0x67c4('0x5')]=_0x42c6eb['Configurations']||{};}module[_0x67c4('0x6')]=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index 2f3fc54..300b78b 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 _0xed19=['unknown','stateTime','status','address','name','accountcode','state'];(function(_0x4ba52c,_0x36da44){var _0x1cc213=function(_0x500f6e){while(--_0x500f6e){_0x4ba52c['push'](_0x4ba52c['shift']());}};_0x1cc213(++_0x36da44);}(_0xed19,0x13f));var _0x9ed1=function(_0x3688d5,_0x51d2b7){_0x3688d5=_0x3688d5-0x0;var _0x3013c4=_0xed19[_0x3688d5];return _0x3013c4;};'use strict';function Telephone(_0x4b3071){this['id']=_0x4b3071['id']||0x0;this[_0x9ed1('0x0')]=_0x4b3071['name']||'';this[_0x9ed1('0x1')]=_0x4b3071[_0x9ed1('0x1')]||'';this[_0x9ed1('0x2')]=_0x9ed1('0x3');this[_0x9ed1('0x4')]=0x0;this[_0x9ed1('0x5')]=_0x9ed1('0x3');this[_0x9ed1('0x6')]='';}module['exports']=Telephone; \ No newline at end of file +var _0xb91c=['accountcode','unknown','stateTime','status','address','exports','name'];(function(_0x3ecdcd,_0x25b453){var _0x506d95=function(_0x297e94){while(--_0x297e94){_0x3ecdcd['push'](_0x3ecdcd['shift']());}};_0x506d95(++_0x25b453);}(_0xb91c,0x110));var _0xcb91=function(_0x1b31fe,_0xeb3d0b){_0x1b31fe=_0x1b31fe-0x0;var _0x4e2c05=_0xb91c[_0x1b31fe];return _0x4e2c05;};'use strict';function Telephone(_0x57b600){this['id']=_0x57b600['id']||0x0;this[_0xcb91('0x0')]=_0x57b600['name']||'';this[_0xcb91('0x1')]=_0x57b600[_0xcb91('0x1')]||'';this['state']=_0xcb91('0x2');this[_0xcb91('0x3')]=0x0;this[_0xcb91('0x4')]=_0xcb91('0x2');this[_0xcb91('0x5')]='';}module[_0xcb91('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 e3cdff8..9af36eb 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 _0x2cca=['html','exports','name'];(function(_0x3d829d,_0x5af899){var _0x318701=function(_0x30e7cd){while(--_0x30e7cd){_0x3d829d['push'](_0x3d829d['shift']());}};_0x318701(++_0x5af899);}(_0x2cca,0xa4));var _0xa2cc=function(_0x2d616f,_0x1f7460){_0x2d616f=_0x2d616f-0x0;var _0x44ec34=_0x2cca[_0x2d616f];return _0x44ec34;};'use strict';function template(_0xd76f59){this['id']=_0xd76f59['id']||0x0;this['name']=_0xd76f59[_0xa2cc('0x0')]||'';this[_0xa2cc('0x1')]=_0xd76f59[_0xa2cc('0x1')]||'';}module[_0xa2cc('0x2')]=template; \ No newline at end of file +var _0xdf54=['exports','name','html'];(function(_0xb449a7,_0x3b08fe){var _0x32a90d=function(_0x46cc65){while(--_0x46cc65){_0xb449a7['push'](_0xb449a7['shift']());}};_0x32a90d(++_0x3b08fe);}(_0xdf54,0x85));var _0x4df5=function(_0xf443aa,_0x9ae41e){_0xf443aa=_0xf443aa-0x0;var _0x2d809a=_0xdf54[_0xf443aa];return _0x2d809a;};'use strict';function template(_0x3d3bf3){this['id']=_0x3d3bf3['id']||0x0;this[_0x4df5('0x0')]=_0x3d3bf3[_0x4df5('0x0')]||'';this[_0x4df5('0x1')]=_0x3d3bf3[_0x4df5('0x1')]||'';}module[_0x4df5('0x2')]=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index 60b4a17..f6d9710 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 _0x00bb=['status','AllConditions','AnyConditions','exports','name','channel'];(function(_0x1cf317,_0x1cb57d){var _0x53412e=function(_0xfb3ca9){while(--_0xfb3ca9){_0x1cf317['push'](_0x1cf317['shift']());}};_0x53412e(++_0x1cb57d);}(_0x00bb,0x1d8));var _0xb00b=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0x00bb[_0x134c2e];return _0x2825db;};'use strict';function Trigger(_0x4b870b){this['id']=_0x4b870b['id']||0x0;this[_0xb00b('0x0')]=_0x4b870b[_0xb00b('0x0')]||'';this['channel']=_0x4b870b[_0xb00b('0x1')]||'voice';this[_0xb00b('0x2')]=_0x4b870b[_0xb00b('0x2')]||![];this['AllConditions']=_0x4b870b[_0xb00b('0x3')]||[];this[_0xb00b('0x4')]=_0x4b870b['AnyConditions']||[];this['Actions']=_0x4b870b['Actions']||[];}module[_0xb00b('0x5')]=Trigger; \ No newline at end of file +var _0x3e74=['Actions','name','channel','status','AllConditions','AnyConditions'];(function(_0x2d962d,_0x5cfc2c){var _0x26dfab=function(_0x3edc50){while(--_0x3edc50){_0x2d962d['push'](_0x2d962d['shift']());}};_0x26dfab(++_0x5cfc2c);}(_0x3e74,0x175));var _0x43e7=function(_0x1b2ed4,_0x5aea8c){_0x1b2ed4=_0x1b2ed4-0x0;var _0x174833=_0x3e74[_0x1b2ed4];return _0x174833;};'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 diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 20ca665..ecf01cd 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 _0xc120=['domain','domainport','stateRegistry','registrationtime','active','name','stateTime','status','unknown','registry','indexOf','split','host','port'];(function(_0x404309,_0x1882cc){var _0xa4e7cf=function(_0x2e5f4c){while(--_0x2e5f4c){_0x404309['push'](_0x404309['shift']());}};_0xa4e7cf(++_0x1882cc);}(_0xc120,0xf2));var _0x0c12=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xc120[_0xf50820];return _0x2a9b10;};'use strict';function Trunk(_0x559b0d){this['id']=_0x559b0d['id']||0x0;this[_0x0c12('0x0')]=_0x559b0d[_0x0c12('0x0')]||![];this[_0x0c12('0x1')]=_0x559b0d[_0x0c12('0x1')]||'';this['state']='unknown';this[_0x0c12('0x2')]=0x0;this[_0x0c12('0x3')]=_0x0c12('0x4');this['registry']=_0x559b0d[_0x0c12('0x5')]&&_0x559b0d['registry'][_0x0c12('0x6')](':')?_0x559b0d['registry'][_0x0c12('0x7')](':')[0x0]:'';this[_0x0c12('0x8')]='';this[_0x0c12('0x9')]='';this[_0x0c12('0xa')]='';this[_0x0c12('0xb')]='';this['refresh']='';this[_0x0c12('0xc')]=_0x0c12('0x4');this[_0x0c12('0xd')]='';this['address']='';}module['exports']=Trunk; \ No newline at end of file +var _0x833e=['unknown','stateTime','status','registry','indexOf','split','host','domainport','refresh','registrationtime','address','exports','active','name','state'];(function(_0xabc186,_0x1bdafb){var _0x6b35c1=function(_0x57c2f7){while(--_0x57c2f7){_0xabc186['push'](_0xabc186['shift']());}};_0x6b35c1(++_0x1bdafb);}(_0x833e,0xc0));var _0xe833=function(_0x35219c,_0x3e3e3f){_0x35219c=_0x35219c-0x0;var _0x4866e7=_0x833e[_0x35219c];return _0x4866e7;};'use strict';function Trunk(_0x129af9){this['id']=_0x129af9['id']||0x0;this[_0xe833('0x0')]=_0x129af9[_0xe833('0x0')]||![];this[_0xe833('0x1')]=_0x129af9[_0xe833('0x1')]||'';this[_0xe833('0x2')]=_0xe833('0x3');this[_0xe833('0x4')]=0x0;this[_0xe833('0x5')]=_0xe833('0x3');this[_0xe833('0x6')]=_0x129af9[_0xe833('0x6')]&&_0x129af9[_0xe833('0x6')][_0xe833('0x7')](':')?_0x129af9[_0xe833('0x6')][_0xe833('0x8')](':')[0x0]:'';this[_0xe833('0x9')]='';this['port']='';this['domain']='';this[_0xe833('0xa')]='';this[_0xe833('0xb')]='';this['stateRegistry']=_0xe833('0x3');this[_0xe833('0xc')]='';this[_0xe833('0xd')]='';}module[_0xe833('0xe')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index e424342..c0e9b5d 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 _0x96f2=['mandatoryDisposition','exten','recordingFormat','none'];(function(_0x1ca095,_0x523467){var _0x50bbec=function(_0x219c24){while(--_0x219c24){_0x1ca095['push'](_0x1ca095['shift']());}};_0x50bbec(++_0x523467);}(_0x96f2,0x1b1));var _0x296f=function(_0xdbed59,_0x531e7a){_0xdbed59=_0xdbed59-0x0;var _0x2d1566=_0x96f2[_0xdbed59];return _0x2d1566;};'use strict';function voiceExtension(_0xe7ebfc){this['id']=_0xe7ebfc['id']||0x0;this[_0x296f('0x0')]=_0xe7ebfc[_0x296f('0x0')]||'';this[_0x296f('0x1')]=_0xe7ebfc[_0x296f('0x1')]||_0x296f('0x2');this[_0x296f('0x3')]=_0xe7ebfc['mandatoryDisposition']||![];}module['exports']=voiceExtension; \ No newline at end of file +var _0x1981=['none','mandatoryDisposition','exten','recordingFormat'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1981,0x8e));var _0x1198=function(_0x370852,_0x2c7e62){_0x370852=_0x370852-0x0;var _0x40cc7e=_0x1981[_0x370852];return _0x40cc7e;};'use strict';function voiceExtension(_0x269727){this['id']=_0x269727['id']||0x0;this['exten']=_0x269727[_0x1198('0x0')]||'';this[_0x1198('0x1')]=_0x269727[_0x1198('0x1')]||_0x1198('0x2');this[_0x1198('0x3')]=_0x269727[_0x1198('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 50ffeba..aaed937 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 _0x1cb5=['dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','busy','invalid','ringinuse','onhold','wav','wav49','gsm','rrmemory','roundrobin','name','monitor_format','type','talking','total','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','loggedIn','acw','acwTimeout','autopause','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalAvailable','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalHitRate','erlangCalls','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue'];(function(_0x4579fb,_0xc68e9a){var _0xa250a=function(_0x37104c){while(--_0x37104c){_0x4579fb['push'](_0x4579fb['shift']());}};_0xa250a(++_0xc68e9a);}(_0x1cb5,0x1ca));var _0x51cb=function(_0x106f46,_0x5ad31e){_0x106f46=_0x106f46-0x0;var _0x2d0b6d=_0x1cb5[_0x106f46];return _0x2d0b6d;};'use strict';var statusDesc=['unknown','not_inuse','inuse',_0x51cb('0x0'),_0x51cb('0x1'),'unavailable','ringing',_0x51cb('0x2'),_0x51cb('0x3')];var monitorFormat={'wav':_0x51cb('0x4'),'wav49':_0x51cb('0x5'),'gsm':_0x51cb('0x6')};var strategy={'rrmemory':_0x51cb('0x7'),'roundrobin':_0x51cb('0x8')};function VoiceQueue(_0x2c777d){this['id']=_0x2c777d['id']||0x0;this[_0x51cb('0x9')]=_0x2c777d['name']||'';this['monitor_format']=_0x2c777d[_0x51cb('0xa')]||'';this[_0x51cb('0xb')]=_0x2c777d[_0x51cb('0xb')]||'inbound';this['waiting']=0x0;this[_0x51cb('0xc')]=0x0;this[_0x51cb('0xd')]=0x0;this[_0x51cb('0xe')]=0x0;this[_0x51cb('0xf')]=0x0;this[_0x51cb('0x10')]=0x0;this[_0x51cb('0x11')]=0x0;this[_0x51cb('0x12')]=0x0;this[_0x51cb('0x13')]=0x0;this[_0x51cb('0x14')]=0x0;this['available']=0x0;this[_0x51cb('0x15')]=_0x2c777d[_0x51cb('0x15')]||![];this[_0x51cb('0x16')]=_0x2c777d['acwTimeout']||0xa;this[_0x51cb('0x17')]=_0x2c777d[_0x51cb('0x17')]||'no';this['sendMessageOneNotActive']=!![];this['message']='';this[_0x51cb('0x18')]=0x0;this[_0x51cb('0x19')]=0x0;this[_0x51cb('0x1a')]=_0x2c777d[_0x51cb('0x1a')]||null;this[_0x51cb('0x1b')]=_0x2c777d[_0x51cb('0x1b')]?_0x2c777d[_0x51cb('0x1b')]:null;this[_0x51cb('0x1c')]=_0x2c777d[_0x51cb('0x1c')];this[_0x51cb('0x1d')]=_0x2c777d[_0x51cb('0x1d')]||'progressive';this[_0x51cb('0x1e')]=_0x2c777d['dialLimitChannel']||0x0;this[_0x51cb('0x1f')]=_0x2c777d[_0x51cb('0x1f')]||0x0;this[_0x51cb('0x20')]=_0x2c777d[_0x51cb('0x20')]||0x1;this[_0x51cb('0x21')]=_0x2c777d[_0x51cb('0x21')]||'dropRate';this[_0x51cb('0x22')]=_0x2c777d[_0x51cb('0x22')]||0.03;this['dialPredictiveInterval']=_0x2c777d[_0x51cb('0x23')]||0x258;this[_0x51cb('0x24')]=_0x2c777d[_0x51cb('0x24')]||_0x51cb('0x25');this[_0x51cb('0x26')]=_0x2c777d[_0x51cb('0x26')]||'anonymous';this[_0x51cb('0x27')]=_0x2c777d['dialOriginateTimeout']||0x1e;this[_0x51cb('0x28')]=_0x2c777d[_0x51cb('0x28')]||_0x51cb('0x29');this[_0x51cb('0x2a')]=_0x2c777d[_0x51cb('0x2a')]||0x3;this[_0x51cb('0x2b')]=_0x2c777d[_0x51cb('0x2b')]||undefined;this[_0x51cb('0x2c')]=_0x2c777d[_0x51cb('0x2c')]||0x3;this[_0x51cb('0x2d')]=_0x2c777d[_0x51cb('0x2d')]||0x96;this['dialBusyMaxRetry']=_0x2c777d[_0x51cb('0x2e')]||0x3;this[_0x51cb('0x2f')]=_0x2c777d['dialBusyRetryFrequency']||0x96;this[_0x51cb('0x30')]=_0x2c777d[_0x51cb('0x30')]||0x3;this[_0x51cb('0x31')]=_0x2c777d[_0x51cb('0x31')]||0x96;this['dialNoSuchNumberMaxRetry']=_0x2c777d[_0x51cb('0x32')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x2c777d[_0x51cb('0x33')]||0x96;this[_0x51cb('0x34')]=_0x2c777d['dialDropMaxRetry']||0x3;this[_0x51cb('0x35')]=_0x2c777d[_0x51cb('0x35')]||0x96;this[_0x51cb('0x36')]=_0x2c777d[_0x51cb('0x36')]||0x3;this[_0x51cb('0x37')]=_0x2c777d['dialAbandonedRetryFrequency']||0x96;this['dialMachineMaxRetry']=_0x2c777d[_0x51cb('0x38')]||0x3;this[_0x51cb('0x39')]=_0x2c777d['dialMachineRetryFrequency']||0x96;this[_0x51cb('0x3a')]=_0x2c777d[_0x51cb('0x3a')]||0x3;this[_0x51cb('0x3b')]=_0x2c777d[_0x51cb('0x3b')]||0x96;this[_0x51cb('0x3c')]=_0x2c777d['dialGlobalMaxRetry']||0x4;this[_0x51cb('0x3d')]=_0x2c777d[_0x51cb('0x3d')]?_0x2c777d[_0x51cb('0x3d')]:undefined;this[_0x51cb('0x3e')]=_0x2c777d[_0x51cb('0x3e')]?_0x2c777d['TrunkBackup']:undefined;this[_0x51cb('0x3f')]=_0x2c777d[_0x51cb('0x3f')]||undefined;this[_0x51cb('0x40')]=_0x2c777d[_0x51cb('0x40')]?_0x2c777d['Interval']:undefined;this[_0x51cb('0x41')]=_0x2c777d[_0x51cb('0x41')]||_0x51cb('0x42');this[_0x51cb('0x43')]=_0x2c777d[_0x51cb('0x43')]||undefined;this[_0x51cb('0x44')]=_0x2c777d['dialCutDigit']||undefined;this[_0x51cb('0x45')]=strategy[_0x2c777d[_0x51cb('0x45')]]||_0x51cb('0x7');this[_0x51cb('0x46')]=!![];this[_0x51cb('0x47')]=_0x2c777d[_0x51cb('0x47')]||![];this['dialAMDInitialSilence']=_0x2c777d[_0x51cb('0x48')];this[_0x51cb('0x49')]=_0x2c777d['dialAMDGreeting'];this[_0x51cb('0x4a')]=_0x2c777d[_0x51cb('0x4a')];this[_0x51cb('0x4b')]=_0x2c777d[_0x51cb('0x4b')];this[_0x51cb('0x4c')]=_0x2c777d[_0x51cb('0x4c')];this[_0x51cb('0x4d')]=_0x2c777d[_0x51cb('0x4d')];this[_0x51cb('0x4e')]=_0x2c777d[_0x51cb('0x4e')];this['dialAMDSilenceThreshold']=_0x2c777d[_0x51cb('0x4f')];this[_0x51cb('0x50')]=_0x2c777d[_0x51cb('0x50')];this['outboundRejectCallsDay']=0x0;this[_0x51cb('0x51')]=0x0;this['timeout']=_0x2c777d[_0x51cb('0x52')];this[_0x51cb('0x53')]=0x0;this[_0x51cb('0x54')]=0x0;this[_0x51cb('0x55')]=0x0;this[_0x51cb('0x56')]=0x0;this['outboundCongestionCallsDay']=0x0;this[_0x51cb('0x57')]=0x0;this['outboundUnknownCallsDay']=0x0;this['outboundBlacklistCallsDay']=0x0;this[_0x51cb('0x58')]=0x0;this['outboundDropCallsDayCallersExit']=0x0;this['outboundDropCallsDayTimeout']=0x0;this[_0x51cb('0x59')]=0x0;this[_0x51cb('0x5a')]=0x0;this[_0x51cb('0x5b')]=0x0;this[_0x51cb('0x5c')]=undefined;this[_0x51cb('0x5d')]=undefined;this[_0x51cb('0x5e')]=undefined;this[_0x51cb('0x5f')]=1.05;this[_0x51cb('0x60')]=0x0;this[_0x51cb('0x61')]=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0x51cb('0x62')]=0x0;this['predictiveIntervalPauses']=0x0;this[_0x51cb('0x63')]=0x0;this['predictiveIntervalMaxThreshold']=_0x2c777d[_0x51cb('0x64')]||0x14;this['predictiveIntervalMinThreshold']=_0x2c777d['dialPredictiveIntervalMaxThreshold']||0xa;this[_0x51cb('0x65')]=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this[_0x51cb('0x66')]=0x1;this[_0x51cb('0x67')]=0x0;this['erlangCallToSecond']=0x0;this['erlangAbandonmentRate']=0x0;this[_0x51cb('0x68')]=0x0;this[_0x51cb('0x69')]=_0x2c777d[_0x51cb('0x69')]||0x1e;this[_0x51cb('0x6a')]=_0x2c777d[_0x51cb('0x6a')]||![];this[_0x51cb('0x6b')]=_0x2c777d[_0x51cb('0x6b')]||undefined;this[_0x51cb('0x6c')]=_0x2c777d['dialAgiAfterHangupClient']||![];this[_0x51cb('0x6d')]=_0x2c777d['dialAgiAfterHangupAgent']||![];this[_0x51cb('0xa')]=monitorFormat[_0x2c777d[_0x51cb('0xa')]]?monitorFormat[_0x2c777d[_0x51cb('0xa')]]:undefined;this[_0x51cb('0x6e')]=_0x2c777d['mandatoryDisposition']||![];this['mandatoryDispositionPause']=_0x2c777d['mandatoryDispositionPause']?_0x2c777d[_0x51cb('0x6f')]:undefined;}module[_0x51cb('0x70')]=VoiceQueue; \ No newline at end of file +var _0x0219=['TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','busy','invalid','unavailable','ringing','ringinuse','wav','wav49','gsm','rrmemory','roundrobin','type','inbound','talking','total','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','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','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk'];(function(_0x2fb932,_0x2b0044){var _0x438dd4=function(_0x2c7ec2){while(--_0x2c7ec2){_0x2fb932['push'](_0x2fb932['shift']());}};_0x438dd4(++_0x2b0044);}(_0x0219,0x12c));var _0x9021=function(_0x5bde88,_0x2a5f6d){_0x5bde88=_0x5bde88-0x0;var _0x1a6aff=_0x0219[_0x5bde88];return _0x1a6aff;};'use strict';var statusDesc=[_0x9021('0x0'),_0x9021('0x1'),_0x9021('0x2'),_0x9021('0x3'),_0x9021('0x4'),_0x9021('0x5'),_0x9021('0x6'),_0x9021('0x7'),'onhold'];var monitorFormat={'wav':_0x9021('0x8'),'wav49':_0x9021('0x9'),'gsm':_0x9021('0xa')};var strategy={'rrmemory':_0x9021('0xb'),'roundrobin':_0x9021('0xc')};function VoiceQueue(_0x3100c0){this['id']=_0x3100c0['id']||0x0;this['name']=_0x3100c0['name']||'';this['monitor_format']=_0x3100c0['monitor_format']||'';this[_0x9021('0xd')]=_0x3100c0[_0x9021('0xd')]||_0x9021('0xe');this['waiting']=0x0;this[_0x9021('0xf')]=0x0;this[_0x9021('0x10')]=0x0;this[_0x9021('0x11')]=0x0;this[_0x9021('0x12')]=0x0;this[_0x9021('0x13')]=0x0;this[_0x9021('0x14')]=0x0;this[_0x9021('0x15')]=0x0;this['abandoned']=0x0;this[_0x9021('0x16')]=0x0;this[_0x9021('0x17')]=0x0;this['acw']=_0x3100c0[_0x9021('0x18')]||![];this[_0x9021('0x19')]=_0x3100c0[_0x9021('0x19')]||0xa;this['autopause']=_0x3100c0[_0x9021('0x1a')]||'no';this[_0x9021('0x1b')]=!![];this[_0x9021('0x1c')]='';this['originated']=0x0;this['temp']=0x0;this[_0x9021('0x1d')]=_0x3100c0[_0x9021('0x1d')]||null;this[_0x9021('0x1e')]=_0x3100c0[_0x9021('0x1e')]?_0x3100c0['dialGlobalInterval']:null;this[_0x9021('0x1f')]=_0x3100c0[_0x9021('0x1f')];this['dialMethod']=_0x3100c0[_0x9021('0x20')]||_0x9021('0x21');this[_0x9021('0x22')]=_0x3100c0['dialLimitChannel']||0x0;this[_0x9021('0x23')]=_0x3100c0['dialLimitQueue']||0x0;this[_0x9021('0x24')]=_0x3100c0['dialPowerLevel']||0x1;this['dialPredictiveOptimization']=_0x3100c0[_0x9021('0x25')]||_0x9021('0x26');this['dialPredictiveOptimizationPercentage']=_0x3100c0[_0x9021('0x27')]||0.03;this['dialPredictiveInterval']=_0x3100c0[_0x9021('0x28')]||0x258;this[_0x9021('0x29')]=_0x3100c0[_0x9021('0x29')]||_0x9021('0x2a');this[_0x9021('0x2b')]=_0x3100c0[_0x9021('0x2b')]||_0x9021('0x2a');this['dialOriginateTimeout']=_0x3100c0[_0x9021('0x2c')]||0x1e;this[_0x9021('0x2d')]=_0x3100c0['dialQueueOptions']||_0x9021('0x2e');this[_0x9021('0x2f')]=_0x3100c0[_0x9021('0x2f')]||0x3;this[_0x9021('0x30')]=_0x3100c0[_0x9021('0x30')]||undefined;this[_0x9021('0x31')]=_0x3100c0['dialCongestionMaxRetry']||0x3;this[_0x9021('0x32')]=_0x3100c0['dialCongestionRetryFrequency']||0x96;this['dialBusyMaxRetry']=_0x3100c0[_0x9021('0x33')]||0x3;this[_0x9021('0x34')]=_0x3100c0[_0x9021('0x34')]||0x96;this['dialNoAnswerMaxRetry']=_0x3100c0[_0x9021('0x35')]||0x3;this[_0x9021('0x36')]=_0x3100c0['dialNoAnswerRetryFrequency']||0x96;this['dialNoSuchNumberMaxRetry']=_0x3100c0[_0x9021('0x37')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x3100c0[_0x9021('0x38')]||0x96;this[_0x9021('0x39')]=_0x3100c0[_0x9021('0x39')]||0x3;this['dialDropRetryFrequency']=_0x3100c0[_0x9021('0x3a')]||0x96;this[_0x9021('0x3b')]=_0x3100c0[_0x9021('0x3b')]||0x3;this['dialAbandonedRetryFrequency']=_0x3100c0[_0x9021('0x3c')]||0x96;this[_0x9021('0x3d')]=_0x3100c0[_0x9021('0x3d')]||0x3;this['dialMachineRetryFrequency']=_0x3100c0['dialMachineRetryFrequency']||0x96;this[_0x9021('0x3e')]=_0x3100c0['dialAgentRejectMaxRetry']||0x3;this[_0x9021('0x3f')]=_0x3100c0[_0x9021('0x3f')]||0x96;this[_0x9021('0x40')]=_0x3100c0[_0x9021('0x40')]||0x4;this[_0x9021('0x41')]=_0x3100c0[_0x9021('0x41')]?_0x3100c0[_0x9021('0x41')]:undefined;this['TrunkBackup']=_0x3100c0[_0x9021('0x42')]?_0x3100c0[_0x9021('0x42')]:undefined;this[_0x9021('0x43')]=_0x3100c0[_0x9021('0x43')]||undefined;this['Interval']=_0x3100c0[_0x9021('0x44')]?_0x3100c0[_0x9021('0x44')]:undefined;this[_0x9021('0x45')]=_0x3100c0[_0x9021('0x45')]||'DESC';this[_0x9021('0x46')]=_0x3100c0[_0x9021('0x46')]||undefined;this['dialCutDigit']=_0x3100c0[_0x9021('0x47')]||undefined;this[_0x9021('0x48')]=strategy[_0x3100c0[_0x9021('0x48')]]||'rrmemory';this['queueStatusComplete']=!![];this[_0x9021('0x49')]=_0x3100c0[_0x9021('0x49')]||![];this['dialAMDInitialSilence']=_0x3100c0[_0x9021('0x4a')];this[_0x9021('0x4b')]=_0x3100c0[_0x9021('0x4b')];this[_0x9021('0x4c')]=_0x3100c0['dialAMDAfterGreetingSilence'];this['dialAMDTotalAnalysisTime']=_0x3100c0['dialAMDTotalAnalysisTime'];this[_0x9021('0x4d')]=_0x3100c0[_0x9021('0x4d')];this[_0x9021('0x4e')]=_0x3100c0[_0x9021('0x4e')];this[_0x9021('0x4f')]=_0x3100c0['dialAMDMaximumNumberOfWords'];this['dialAMDSilenceThreshold']=_0x3100c0[_0x9021('0x50')];this[_0x9021('0x51')]=_0x3100c0['dialAMDMaximumWordLength'];this[_0x9021('0x52')]=0x0;this[_0x9021('0x53')]=0x0;this[_0x9021('0x54')]=_0x3100c0[_0x9021('0x54')];this[_0x9021('0x55')]=0x0;this[_0x9021('0x56')]=0x0;this[_0x9021('0x57')]=0x0;this['outboundBusyCallsDay']=0x0;this['outboundCongestionCallsDay']=0x0;this[_0x9021('0x58')]=0x0;this[_0x9021('0x59')]=0x0;this[_0x9021('0x5a')]=0x0;this[_0x9021('0x5b')]=0x0;this[_0x9021('0x5c')]=0x0;this[_0x9021('0x5d')]=0x0;this[_0x9021('0x5e')]=0x0;this[_0x9021('0x5f')]=0x0;this[_0x9021('0x60')]=0x0;this[_0x9021('0x61')]=undefined;this[_0x9021('0x62')]=undefined;this['handlePredictive']=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this[_0x9021('0x63')]=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this[_0x9021('0x64')]=0x0;this[_0x9021('0x65')]=0x0;this[_0x9021('0x66')]=0x0;this[_0x9021('0x67')]=0x0;this[_0x9021('0x68')]=0x0;this[_0x9021('0x69')]=0x0;this[_0x9021('0x6a')]=_0x3100c0['dialPredictiveIntervalMaxThreshold']||0x14;this[_0x9021('0x6b')]=_0x3100c0[_0x9021('0x6c')]||0xa;this[_0x9021('0x6d')]=0x0;this[_0x9021('0x6e')]=0x0;this['predictiveIntervalHitRate']=0x1;this[_0x9021('0x6f')]=0x0;this[_0x9021('0x70')]=0x0;this[_0x9021('0x71')]=0x0;this['erlangBusyFactor']=0x0;this[_0x9021('0x72')]=_0x3100c0['dialRecallMeTimeout']||0x1e;this['dialRecallInQueue']=_0x3100c0[_0x9021('0x73')]||![];this[_0x9021('0x74')]=_0x3100c0['dialQueueProject2']||undefined;this[_0x9021('0x75')]=_0x3100c0[_0x9021('0x75')]||![];this[_0x9021('0x76')]=_0x3100c0['dialAgiAfterHangupAgent']||![];this['monitor_format']=monitorFormat[_0x3100c0['monitor_format']]?monitorFormat[_0x3100c0['monitor_format']]:undefined;this[_0x9021('0x77')]=_0x3100c0[_0x9021('0x77')]||![];this[_0x9021('0x78')]=_0x3100c0[_0x9021('0x78')]?_0x3100c0[_0x9021('0x78')]:undefined;}module[_0x9021('0x79')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 6ce7b33..edbad8b 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 _0x6cd7=['Configurations','exports','name','username','accessKey','remoteUri','serverUrl'];(function(_0x57c10b,_0x47e0e7){var _0x2d4228=function(_0x4c8f0c){while(--_0x4c8f0c){_0x57c10b['push'](_0x57c10b['shift']());}};_0x2d4228(++_0x47e0e7);}(_0x6cd7,0xdb));var _0x76cd=function(_0x1c0b91,_0x691caf){_0x1c0b91=_0x1c0b91-0x0;var _0x3d1ab4=_0x6cd7[_0x1c0b91];return _0x3d1ab4;};'use strict';function VtigerAccount(_0x1e9204){this['id']=_0x1e9204['id']||0x0;this[_0x76cd('0x0')]=_0x1e9204[_0x76cd('0x0')]||'';this['username']=_0x1e9204[_0x76cd('0x1')]||'';this['accessKey']=_0x1e9204[_0x76cd('0x2')]||'';this[_0x76cd('0x3')]=_0x1e9204[_0x76cd('0x3')]||'';this[_0x76cd('0x4')]=_0x1e9204['serverUrl']||'';this[_0x76cd('0x5')]=_0x1e9204[_0x76cd('0x5')]||{};}module[_0x76cd('0x6')]=VtigerAccount; \ No newline at end of file +var _0x264e=['name','username','accessKey','remoteUri','serverUrl','Configurations'];(function(_0x110afb,_0x2b486b){var _0x5f28fe=function(_0x1dc674){while(--_0x1dc674){_0x110afb['push'](_0x110afb['shift']());}};_0x5f28fe(++_0x2b486b);}(_0x264e,0xd2));var _0xe264=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x264e[_0x122ef9];return _0x42fba0;};'use strict';function VtigerAccount(_0x5a2110){this['id']=_0x5a2110['id']||0x0;this[_0xe264('0x0')]=_0x5a2110[_0xe264('0x0')]||'';this['username']=_0x5a2110[_0xe264('0x1')]||'';this[_0xe264('0x2')]=_0x5a2110[_0xe264('0x2')]||'';this[_0xe264('0x3')]=_0x5a2110[_0xe264('0x3')]||'';this[_0xe264('0x4')]=_0x5a2110[_0xe264('0x4')]||'';this[_0xe264('0x5')]=_0x5a2110['Configurations']||{};}module['exports']=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index 3870b96..0cb21ec 100644 --- a/server/services/ami/model/zendeskAccount.js +++ b/server/services/ami/model/zendeskAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b0e=['exports','name','username','password','token','remoteUri','authType','type','serverUrl','Configurations'];(function(_0x582274,_0x2cbd9c){var _0x8f14d3=function(_0x1cfe08){while(--_0x1cfe08){_0x582274['push'](_0x582274['shift']());}};_0x8f14d3(++_0x2cbd9c);}(_0x0b0e,0x187));var _0xe0b0=function(_0x37d0bc,_0x109b96){_0x37d0bc=_0x37d0bc-0x0;var _0x170e60=_0x0b0e[_0x37d0bc];return _0x170e60;};'use strict';function ZendeskAccount(_0x29cd1e){this['id']=_0x29cd1e['id']||0x0;this['name']=_0x29cd1e[_0xe0b0('0x0')]||'';this['username']=_0x29cd1e[_0xe0b0('0x1')]||'';this[_0xe0b0('0x2')]=_0x29cd1e[_0xe0b0('0x2')]||'';this[_0xe0b0('0x3')]=_0x29cd1e[_0xe0b0('0x3')]||'';this[_0xe0b0('0x4')]=_0x29cd1e[_0xe0b0('0x4')]||'';this[_0xe0b0('0x5')]=_0x29cd1e[_0xe0b0('0x5')]||'';this[_0xe0b0('0x6')]=_0x29cd1e[_0xe0b0('0x6')]||'integrationTab';this['serverUrl']=_0x29cd1e[_0xe0b0('0x7')]||'';this[_0xe0b0('0x8')]=_0x29cd1e[_0xe0b0('0x8')]||{};}module[_0xe0b0('0x9')]=ZendeskAccount; \ No newline at end of file +var _0x5f66=['remoteUri','authType','integrationTab','serverUrl','Configurations','exports','name','username','password','token'];(function(_0x7a3c6d,_0x20c4d1){var _0x4fbd47=function(_0x5d4866){while(--_0x5d4866){_0x7a3c6d['push'](_0x7a3c6d['shift']());}};_0x4fbd47(++_0x20c4d1);}(_0x5f66,0x1a0));var _0x65f6=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x5f66[_0x297fd3];return _0x2af381;};'use strict';function ZendeskAccount(_0x253044){this['id']=_0x253044['id']||0x0;this[_0x65f6('0x0')]=_0x253044['name']||'';this[_0x65f6('0x1')]=_0x253044[_0x65f6('0x1')]||'';this[_0x65f6('0x2')]=_0x253044[_0x65f6('0x2')]||'';this[_0x65f6('0x3')]=_0x253044['token']||'';this[_0x65f6('0x4')]=_0x253044['remoteUri']||'';this[_0x65f6('0x5')]=_0x253044[_0x65f6('0x5')]||'';this['type']=_0x253044['type']||_0x65f6('0x6');this[_0x65f6('0x7')]=_0x253044[_0x65f6('0x7')]||'';this[_0x65f6('0x8')]=_0x253044[_0x65f6('0x8')]||{};}module[_0x65f6('0x9')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index e571a2b..4ea7650 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 _0x15f9=['serverUrl','code','refreshToken','Configurations','exports','name','description','host','zone','clientId','clientSecret'];(function(_0x223461,_0x2bca70){var _0x4dbe0a=function(_0x3c3cb6){while(--_0x3c3cb6){_0x223461['push'](_0x223461['shift']());}};_0x4dbe0a(++_0x2bca70);}(_0x15f9,0xf7));var _0x915f=function(_0x31c297,_0xce6ca4){_0x31c297=_0x31c297-0x0;var _0x3b14d3=_0x15f9[_0x31c297];return _0x3b14d3;};'use strict';function ZohoAccount(_0x4272c8){this['id']=_0x4272c8['id']||0x0;this[_0x915f('0x0')]=_0x4272c8[_0x915f('0x0')]||'';this[_0x915f('0x1')]=_0x4272c8[_0x915f('0x1')]||'';this[_0x915f('0x2')]=_0x4272c8[_0x915f('0x2')]||'';this[_0x915f('0x3')]=_0x4272c8[_0x915f('0x3')]||'';this['clientId']=_0x4272c8[_0x915f('0x4')]||'';this[_0x915f('0x5')]=_0x4272c8[_0x915f('0x5')]||'';this[_0x915f('0x6')]=_0x4272c8['serverUrl']||'';this[_0x915f('0x7')]=_0x4272c8[_0x915f('0x7')]||'';this[_0x915f('0x8')]=_0x4272c8[_0x915f('0x8')]||'';this['Configurations']=_0x4272c8[_0x915f('0x9')]||{};}module[_0x915f('0xa')]=ZohoAccount; \ No newline at end of file +var _0x980c=['clientSecret','serverUrl','code','refreshToken','name','description','host','zone','clientId'];(function(_0x4073ea,_0x56357c){var _0x44df4a=function(_0x165cf9){while(--_0x165cf9){_0x4073ea['push'](_0x4073ea['shift']());}};_0x44df4a(++_0x56357c);}(_0x980c,0x100));var _0xc980=function(_0x6a55e7,_0x44953d){_0x6a55e7=_0x6a55e7-0x0;var _0x1cf871=_0x980c[_0x6a55e7];return _0x1cf871;};'use strict';function ZohoAccount(_0xd39c9e){this['id']=_0xd39c9e['id']||0x0;this[_0xc980('0x0')]=_0xd39c9e[_0xc980('0x0')]||'';this[_0xc980('0x1')]=_0xd39c9e[_0xc980('0x1')]||'';this[_0xc980('0x2')]=_0xd39c9e[_0xc980('0x2')]||'';this[_0xc980('0x3')]=_0xd39c9e[_0xc980('0x3')]||'';this[_0xc980('0x4')]=_0xd39c9e[_0xc980('0x4')]||'';this['clientSecret']=_0xd39c9e[_0xc980('0x5')]||'';this[_0xc980('0x6')]=_0xd39c9e[_0xc980('0x6')]||'';this[_0xc980('0x7')]=_0xd39c9e[_0xc980('0x7')]||'';this[_0xc980('0x8')]=_0xd39c9e[_0xc980('0x8')]||'';this['Configurations']=_0xd39c9e['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 4926626..e35bfe8 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 _0x148a=['util','lodash','moment','string','isNil','uniqueid','idContact','queue','name','type','campaigntype','dialAnswer','membername','Agent','channelAgent','format','SIP/%s','calleridname','Contact','firstName','lastName','active','phone','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','originatecalleridname','prototype','getCaller','number','exports'];(function(_0x1bdc3a,_0x587df1){var _0x5af657=function(_0x680323){while(--_0x680323){_0x1bdc3a['push'](_0x1bdc3a['shift']());}};_0x5af657(++_0x587df1);}(_0x148a,0x10e));var _0xa148=function(_0x58063b,_0x1a76a1){_0x58063b=_0x58063b-0x0;var _0x313a60=_0x148a[_0x58063b];return _0x313a60;};'use strict';var util=require(_0xa148('0x0'));var _=require(_0xa148('0x1'));var moment=require(_0xa148('0x2'));function checkNameSurname(_0x4357c4,_0x1bd28e,_0x191f8a){var _0x50143e='';if(!_['isNil'](_0x1bd28e)&&_0xa148('0x3')===typeof _0x1bd28e){_0x50143e+=_0x1bd28e;}if(!_[_0xa148('0x4')](_0x191f8a)&&_0xa148('0x3')===typeof _0x191f8a){_0x50143e+='\x20'+_0x191f8a;}if(_0x50143e!==''){return _0x50143e;}return _0x4357c4;}function Action(_0x50f775,_0x2b06a8,_0x49f653,_0x32bf07,_0x6d3c63){this[_0xa148('0x5')]=_0x49f653||undefined;this[_0xa148('0x6')]=_0x50f775['id'];this[_0xa148('0x7')]=_0x2b06a8[_0xa148('0x8')];this[_0xa148('0x9')]=_0x2b06a8[_0xa148('0x9')];this[_0xa148('0xa')]=_0xa148('0x7');this[_0xa148('0xb')]=![];this[_0xa148('0xc')]=_[_0xa148('0x4')](_0x50f775['Agent'])?undefined:_0x50f775[_0xa148('0xd')]['name'];this[_0xa148('0xe')]=this[_0xa148('0xc')]?util[_0xa148('0xf')](_0xa148('0x10'),this['membername']):_0x32bf07||undefined;this[_0xa148('0x11')]=checkNameSurname(_0x50f775[_0xa148('0x12')]['phone'],_0x50f775[_0xa148('0x12')][_0xa148('0x13')],_0x50f775[_0xa148('0x12')][_0xa148('0x14')]);this[_0xa148('0x15')]=_0x50f775[_0xa148('0x15')]||![];this['calleridnum']=_0x50f775['Contact'][_0xa148('0x16')];this['scheduledat']=_0x50f775[_0xa148('0x17')];this[_0xa148('0x18')]=_0x50f775[_0xa148('0x18')]||0x0;this[_0xa148('0x19')]=_0x50f775[_0xa148('0x19')]||0x0;this['countnoanswerretry']=_0x50f775[_0xa148('0x1a')]||0x0;this[_0xa148('0x1b')]=(_0x50f775[_0xa148('0x18')]||0x0)+(_0x50f775['countcongestionretry']||0x0)+(_0x50f775[_0xa148('0x1a')]||0x0);this[_0xa148('0x1c')]=_0x50f775[_0xa148('0x1c')]||0x0;this[_0xa148('0x1d')]=_0x50f775['countdropretry']||0x0;this[_0xa148('0x1e')]=_0x50f775[_0xa148('0x1e')]||0x0;this[_0xa148('0x1f')]=_0x50f775[_0xa148('0x1f')]||0x0;this['countagentrejectretry']=_0x50f775[_0xa148('0x20')]||0x0;this[_0xa148('0x21')]=_0x50f775['callback'];this[_0xa148('0x22')]=_0x50f775[_0xa148('0x22')];this[_0xa148('0x23')]=_0x50f775[_0xa148('0x23')];this[_0xa148('0x24')]=_0x50f775[_0xa148('0x24')];this['ContactId']=_0x50f775[_0xa148('0x25')];this[_0xa148('0x26')]=_0x50f775['ListId'];this['UserId']=_[_0xa148('0x4')](_0x50f775[_0xa148('0xd')])?_0x50f775['UserId']:_0x50f775[_0xa148('0xd')]['id'];this['VoiceQueueId']=_0x50f775[_0xa148('0x27')];this['originatecalleridnum']='';this[_0xa148('0x28')]='';}Action[_0xa148('0x29')][_0xa148('0x2a')]=function(){return util[_0xa148('0xf')]('\x22%s\x22\x20<%s>',this[_0xa148('0x11')],this[_0xa148('0x2b')]);};module[_0xa148('0x2c')]=Action; \ No newline at end of file +var _0xcf26=['Agent','VoiceQueueId','originatecalleridnum','originatecalleridname','number','exports','isNil','string','uniqueid','queue','name','type','membername','channelAgent','format','SIP/%s','calleridname','phone','Contact','firstName','lastName','active','calleridnum','scheduledat','countcongestionretry','countnoanswerretry','countbusyretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xcf26,0x13e));var _0x6cf2=function(_0x27b4c7,_0xd847e6){_0x27b4c7=_0x27b4c7-0x0;var _0x3000b9=_0xcf26[_0x27b4c7];return _0x3000b9;};'use strict';var util=require('util');var _=require('lodash');var moment=require('moment');function checkNameSurname(_0x5f5450,_0x2202aa,_0x3f12dc){var _0x349d66='';if(!_[_0x6cf2('0x0')](_0x2202aa)&&_0x6cf2('0x1')===typeof _0x2202aa){_0x349d66+=_0x2202aa;}if(!_[_0x6cf2('0x0')](_0x3f12dc)&&_0x6cf2('0x1')===typeof _0x3f12dc){_0x349d66+='\x20'+_0x3f12dc;}if(_0x349d66!==''){return _0x349d66;}return _0x5f5450;}function Action(_0x3ac91a,_0x35db6e,_0x274acf,_0x1e072e,_0x414c1f){this[_0x6cf2('0x2')]=_0x274acf||undefined;this['idContact']=_0x3ac91a['id'];this[_0x6cf2('0x3')]=_0x35db6e[_0x6cf2('0x4')];this[_0x6cf2('0x5')]=_0x35db6e['type'];this['campaigntype']=_0x6cf2('0x3');this['dialAnswer']=![];this[_0x6cf2('0x6')]=_[_0x6cf2('0x0')](_0x3ac91a['Agent'])?undefined:_0x3ac91a['Agent'][_0x6cf2('0x4')];this[_0x6cf2('0x7')]=this['membername']?util[_0x6cf2('0x8')](_0x6cf2('0x9'),this[_0x6cf2('0x6')]):_0x1e072e||undefined;this[_0x6cf2('0xa')]=checkNameSurname(_0x3ac91a['Contact'][_0x6cf2('0xb')],_0x3ac91a[_0x6cf2('0xc')][_0x6cf2('0xd')],_0x3ac91a[_0x6cf2('0xc')][_0x6cf2('0xe')]);this[_0x6cf2('0xf')]=_0x3ac91a[_0x6cf2('0xf')]||![];this[_0x6cf2('0x10')]=_0x3ac91a[_0x6cf2('0xc')][_0x6cf2('0xb')];this[_0x6cf2('0x11')]=_0x3ac91a[_0x6cf2('0x11')];this['countbusyretry']=_0x3ac91a['countbusyretry']||0x0;this[_0x6cf2('0x12')]=_0x3ac91a[_0x6cf2('0x12')]||0x0;this[_0x6cf2('0x13')]=_0x3ac91a[_0x6cf2('0x13')]||0x0;this['countglobal']=(_0x3ac91a[_0x6cf2('0x14')]||0x0)+(_0x3ac91a[_0x6cf2('0x12')]||0x0)+(_0x3ac91a['countnoanswerretry']||0x0);this[_0x6cf2('0x15')]=_0x3ac91a['countnosuchnumberretry']||0x0;this['countdropretry']=_0x3ac91a[_0x6cf2('0x16')]||0x0;this[_0x6cf2('0x17')]=_0x3ac91a[_0x6cf2('0x17')]||0x0;this[_0x6cf2('0x18')]=_0x3ac91a[_0x6cf2('0x18')]||0x0;this[_0x6cf2('0x19')]=_0x3ac91a['countagentrejectretry']||0x0;this[_0x6cf2('0x1a')]=_0x3ac91a[_0x6cf2('0x1a')];this[_0x6cf2('0x1b')]=_0x3ac91a[_0x6cf2('0x1b')];this[_0x6cf2('0x1c')]=_0x3ac91a[_0x6cf2('0x1c')];this[_0x6cf2('0x1d')]=_0x3ac91a[_0x6cf2('0x1d')];this[_0x6cf2('0x1e')]=_0x3ac91a[_0x6cf2('0x1e')];this[_0x6cf2('0x1f')]=_0x3ac91a[_0x6cf2('0x1f')];this[_0x6cf2('0x20')]=_[_0x6cf2('0x0')](_0x3ac91a[_0x6cf2('0x21')])?_0x3ac91a[_0x6cf2('0x20')]:_0x3ac91a['Agent']['id'];this[_0x6cf2('0x22')]=_0x3ac91a[_0x6cf2('0x22')];this[_0x6cf2('0x23')]='';this[_0x6cf2('0x24')]='';}Action['prototype']['getCaller']=function(){return util[_0x6cf2('0x8')]('\x22%s\x22\x20<%s>',this['calleridname'],this[_0x6cf2('0x25')]);};module[_0x6cf2('0x26')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index dbfc551..e547e71 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 _0xb6a0=['voice_queue:save','info','stringify','format','voice:queue:%s','voice_queue_channel:remove','sendMessageOneNotActive','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','\x20is\x20disactive','prototype','clearZombieChannels','hasOwnProperty','recallMe','isNil','actions','originated:\x20','queue','pTalking:\x20','pTalking','dialAnswer','contactId','UserId','ListId','status','channel','No\x20such\x20channel','[clearZombieChannel]','loggerError','[Dialer][checkChannel][Preview]','[action]','size','getContactRecallMe','then','length','scheduledat','dialRecallMeTimeout','Agent','run','logger2','[RecallMe]','catch','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','createCustomerHistory','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','AGENTS_NOT_LOGGED','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','callProgressDetectingCustomer','countglobal','totalGlobal','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','[callProgressDetectingCustomer][logNoSuchGlobal]','countnosuchnumberretry','dialNoSuchNumberMaxRetry','scheduledAt','activeContact','linkedid','ANSWER','responsetime','answertime','uniqueid','\x20Queue','emit','custom:agentconnect','buildObj','connect','buildAcw','custom:agentcomplete','complete','decrementTalkink','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','Busy','[callProgressDetectingCustomer][logBusy]','Global','countbusyretry','dialBusyMaxRetry','rescheduleContact','unlockAgent','NOANSWER','countnoanswerretry','NoAnswer','[callProgressDetectingCustomer][logNoAnswer]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','CONGESTION','countcongestionretry','Congestion','[callProgressDetectingCustomer][logCongestionGlobal]','[callProgressDetectingCustomer][logCongestion]','dialBusyRetryFrequency','CANCEL','outboundRejectCallsDay','[syncHangupRequest][logAgentReject]','unlockContact','idContact','disableContact','ABANDONED','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','cause-txt','dialstatus','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','isUndefined','object','reason','createAgentHistory','logAgent','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','updateOriginated','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','VoiceQueueId','Contact\x20is\x20undefined','Queue','lookAgent','isEmpty','execCall','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','Calling','[Preview][execCall][failure]','Call\x20failed','outboundBlacklistCallsDay','logBlacklist','createHistory','Contact\x20in\x20black\x20List','SIP/%s','reachable','pick','unlock','execRun','getContactPreview','recallme','validateContact','isValid','Contact.phone','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','ACTIVE','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','isActive','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','trim','dialCutDigit','substring','phone','getCallerId','callerid','getCallerIdRandom','dialOriginateCallerIdNumber','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdName','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','Action','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','logLookAgent','clone','isFailure','response','custom:agentringnoanswer','rejected','Answer','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','dialQueueProject','channelstate','transfer','callProgressDetectingAgent','syncHangupRequest','addVariable','variables','keys','variable','value','error','[syncVarSet][Preview]','inspect','syncAttendedTransfer','transfertargetlinkedid','syncBlindTransfer','transfererlinkedid','util','lodash','bluebird','uuid','moment','../../../config/environment','../../../config/logger','preview','actionPreview','../ami','./rpcDb','./action','./util/util','defaults','localhost','redis','enqueue','tail','finally','sequence','voiceQueues','trunks','agents','clockClearZombieChannels','originateresponse','bind','syncHangup','hanguprequest','dialend','syncDialEnd','newexten','syncNewExten','syncVarSet','attendedtransfer','blindtransfer','loopCampaigns','campaignsPreview','outbound','name','strategy','answered','loggedIn','sumBillable','sumHoldTime','talking','total','type','unmanaged','abandoned','loggedInDb','dialActive','dialMethod','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','message','originated','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','Interval','md5'];(function(_0x40aebe,_0x4f0548){var _0x32baa3=function(_0x34de7d){while(--_0x34de7d){_0x40aebe['push'](_0x40aebe['shift']());}};_0x32baa3(++_0x4f0548);}(_0xb6a0,0xee));var _0x0b6a=function(_0x81240d,_0x4f77c8){_0x81240d=_0x81240d-0x0;var _0x176e3e=_0xb6a0[_0x81240d];return _0x176e3e;};'use strict';var util=require(_0x0b6a('0x0'));var _=require(_0x0b6a('0x1'));var BPromise=require(_0x0b6a('0x2'));var uuid=require(_0x0b6a('0x3'));var moment=require(_0x0b6a('0x4'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x0b6a('0x5'));var logger=require(_0x0b6a('0x6'))(_0x0b6a('0x7'));var loggerAction=require(_0x0b6a('0x6'))(_0x0b6a('0x8'));var ami=require(_0x0b6a('0x9'));var rpcDb=require(_0x0b6a('0xa'));var Action=require(_0x0b6a('0xb'));var ut=require(_0x0b6a('0xc'));config['redis']=_[_0x0b6a('0xd')](config['redis'],{'host':_0x0b6a('0xe'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0b6a('0xf')]));var Sequence=function(){};Sequence['prototype'][_0x0b6a('0x10')]=function(_0x26ac7d){this[_0x0b6a('0x11')]=this[_0x0b6a('0x11')]?this['tail'][_0x0b6a('0x12')](_0x26ac7d):_0x26ac7d();};function Preview(_0x3598ee){this[_0x0b6a('0x13')]=new Sequence();this['campaignsPreview']=_0x3598ee[_0x0b6a('0x14')];this[_0x0b6a('0x15')]=_0x3598ee[_0x0b6a('0x15')];this['actions']={};this[_0x0b6a('0x16')]=_0x3598ee[_0x0b6a('0x16')];this[_0x0b6a('0x17')]=0x0;ami['on'](_0x0b6a('0x18'),this['syncOriginateResponse'][_0x0b6a('0x19')](this));ami['on']('hangup',this[_0x0b6a('0x1a')][_0x0b6a('0x19')](this));ami['on'](_0x0b6a('0x1b'),this['syncHangupRequest'][_0x0b6a('0x19')](this));ami['on'](_0x0b6a('0x1c'),this[_0x0b6a('0x1d')][_0x0b6a('0x19')](this));ami['on'](_0x0b6a('0x1e'),this[_0x0b6a('0x1f')][_0x0b6a('0x19')](this));ami['on']('varset',this[_0x0b6a('0x20')][_0x0b6a('0x19')](this));ami['on'](_0x0b6a('0x21'),this['syncAttendedTransfer']['bind'](this));ami['on'](_0x0b6a('0x22'),this['syncBlindTransfer'][_0x0b6a('0x19')](this));this[_0x0b6a('0x23')](this[_0x0b6a('0x24')]);}function emit(_0x4e40cd,_0x3ad8a9,_0xe9927c){io['to'](_0x4e40cd)['emit'](_0x3ad8a9,_0xe9927c);}function emitCampaignPreview(_0x26eac1){if(_0x26eac1['type']===_0x0b6a('0x25')){var _0x18b988={'id':_0x26eac1['id'],'name':_0x26eac1[_0x0b6a('0x26')],'strategy':_0x26eac1[_0x0b6a('0x27')],'answered':_0x26eac1[_0x0b6a('0x28')],'available':_0x26eac1['available'],'loggedIn':_0x26eac1[_0x0b6a('0x29')],'pTalking':_0x26eac1['pTalking'],'sumBillable':_0x26eac1[_0x0b6a('0x2a')],'sumDuration':_0x26eac1['sumDuration'],'sumHoldTime':_0x26eac1[_0x0b6a('0x2b')]||0x0,'talking':_0x26eac1[_0x0b6a('0x2c')],'total':_0x26eac1[_0x0b6a('0x2d')],'type':_0x26eac1[_0x0b6a('0x2e')],'unmanaged':_0x26eac1[_0x0b6a('0x2f')],'abandoned':_0x26eac1[_0x0b6a('0x30')],'waiting':_0x26eac1['waiting'],'loggedInDb':_0x26eac1[_0x0b6a('0x31')],'dialActive':_0x26eac1[_0x0b6a('0x32')],'dialMethod':_0x26eac1[_0x0b6a('0x33')],'dialOriginateCallerIdName':_0x26eac1['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x26eac1['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x26eac1[_0x0b6a('0x34')],'dialPrefix':_0x26eac1[_0x0b6a('0x35')],'outboundAnswerAgiCallsDay':_0x26eac1[_0x0b6a('0x36')],'outboundAnswerCallsDay':_0x26eac1[_0x0b6a('0x37')],'outboundBlacklistCallsDay':_0x26eac1['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x26eac1['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x26eac1[_0x0b6a('0x38')],'outboundDropCallsDayACS':_0x26eac1[_0x0b6a('0x39')],'outboundDropCallsDayCallersExit':_0x26eac1['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x26eac1[_0x0b6a('0x3a')],'outboundNoAnswerCallsDay':_0x26eac1[_0x0b6a('0x3b')],'outboundNoSuchCallsDay':_0x26eac1[_0x0b6a('0x3c')],'outboundOriginateFailureCallsDay':_0x26eac1[_0x0b6a('0x3d')],'outboundReCallsDay':_0x26eac1[_0x0b6a('0x3e')],'outboundRejectCallsDay':_0x26eac1['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x26eac1[_0x0b6a('0x3f')],'outboundAbandonedCallsDay':_0x26eac1[_0x0b6a('0x40')],'predictiveIntervalAnsweredCalls':_0x26eac1[_0x0b6a('0x41')],'predictiveIntervalAvgHoldtime':_0x26eac1['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x26eac1[_0x0b6a('0x42')],'predictiveIntervalDroppedCallsCallersExit':_0x26eac1['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x26eac1[_0x0b6a('0x43')],'predictiveIntervalErlangCalls':_0x26eac1[_0x0b6a('0x44')],'predictiveIntervalErlangCallsDroppedCalls':_0x26eac1[_0x0b6a('0x45')],'predictiveIntervalHitRate':_0x26eac1[_0x0b6a('0x46')],'predictiveIntervalMultiplicativeFactor':_0x26eac1['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x26eac1['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x26eac1['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x26eac1['predictiveIntervalTotalCalls'],'message':_0x26eac1[_0x0b6a('0x47')],'originated':_0x26eac1[_0x0b6a('0x48')],'erlangCalls':_0x26eac1['erlangCalls'],'erlangCallToSecond':_0x26eac1[_0x0b6a('0x49')],'erlangAbandonmentRate':_0x26eac1[_0x0b6a('0x4a')],'erlangBusyFactor':_0x26eac1[_0x0b6a('0x4b')],'startPredictive':_0x26eac1[_0x0b6a('0x4c')],'startProgressive':_0x26eac1[_0x0b6a('0x4d')]};if(_0x26eac1[_0x0b6a('0x4e')]){_0x18b988['Trunk']={'id':_0x26eac1[_0x0b6a('0x4e')]['id'],'name':_0x26eac1[_0x0b6a('0x4e')][_0x0b6a('0x26')],'active':_0x26eac1[_0x0b6a('0x4e')][_0x0b6a('0x4f')],'callerid':_0x26eac1[_0x0b6a('0x4e')]['callerid']};}if(_0x26eac1[_0x0b6a('0x50')]){_0x18b988[_0x0b6a('0x50')]={'id':_0x26eac1[_0x0b6a('0x50')]['id'],'name':_0x26eac1[_0x0b6a('0x50')]['name']};}var _0x42d899=md5(JSON['stringify'](_0x18b988));if(_0x26eac1[_0x0b6a('0x51')]!==_0x42d899){_0x26eac1[_0x0b6a('0x51')]=_0x42d899;emit(util['format']('voice:queue:%s',_0x18b988[_0x0b6a('0x26')]),_0x0b6a('0x52'),_0x18b988);}}}function emitVoiceQueueChannelRemove(_0x58771c){logger[_0x0b6a('0x53')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON[_0x0b6a('0x54')](_0x58771c));emit(util[_0x0b6a('0x55')](_0x0b6a('0x56'),_0x58771c['name']),_0x0b6a('0x57'),_0x58771c);}function notSendMessagesQueue(_0x157864){if(_0x157864['sendMessageOneNotActive']){if(_0x157864['originated']===0x0&&_0x157864['pTalking']===0x0){_0x157864[_0x0b6a('0x58')]=![];_0x157864['available']=0x0;_0x157864['paused']=0x0;_0x157864['message']=_0x0b6a('0x59');ut[_0x0b6a('0x5a')](_0x0b6a('0x5b'),_0x157864[_0x0b6a('0x26')]+_0x0b6a('0x5c'));}else{_0x157864['message']=_0x0b6a('0x5d');ut[_0x0b6a('0x5a')](_0x0b6a('0x5b'),_0x157864[_0x0b6a('0x26')]+_0x0b6a('0x5e'));}emitCampaignPreview(_0x157864);}}Preview[_0x0b6a('0x5f')][_0x0b6a('0x23')]=function(){var _0x374de9=this;setInterval(function(){_0x374de9['syncCampaigns']();},0x7cf);};Preview['prototype']['syncCampaigns']=function(){var _0x206055=this[_0x0b6a('0x24')];this['clockClearZombieChannels']+=0x1;for(var _0x5e9d0a in _0x206055){if(_0x206055['hasOwnProperty'](_0x5e9d0a)&&(_0x206055[_0x5e9d0a][_0x0b6a('0x33')]===_0x0b6a('0x7')||_0x206055[_0x5e9d0a][_0x0b6a('0x33')]==='booked')&&_0x206055[_0x5e9d0a][_0x0b6a('0x2e')]==='outbound'){if(this[_0x0b6a('0x17')]>0x7){this['clockClearZombieChannels']=0x0;this[_0x0b6a('0x60')]();}}if(_0x206055[_0x0b6a('0x61')](_0x5e9d0a)&&_0x206055[_0x5e9d0a][_0x0b6a('0x33')]===_0x0b6a('0x7')&&_0x206055[_0x5e9d0a][_0x0b6a('0x2e')]===_0x0b6a('0x25')){if(_0x206055[_0x5e9d0a][_0x0b6a('0x32')]){this['setMessage'](_0x206055[_0x5e9d0a]);this[_0x0b6a('0x62')](_0x206055[_0x5e9d0a]);}else{notSendMessagesQueue(_0x206055[_0x5e9d0a]);}}}};Preview[_0x0b6a('0x5f')]['clearZombieChannel']=function(_0x2e66e1){var _0x2df9b0=this;this[_0x0b6a('0x13')][_0x0b6a('0x10')](function(){if(!_[_0x0b6a('0x63')](_0x2df9b0['actions'][_0x2e66e1])){loggerAction[_0x0b6a('0x53')]('[clearZombieChannels][talking]',_0x2e66e1,'Queue',_0x2df9b0[_0x0b6a('0x64')][_0x2e66e1]['queue'],_0x0b6a('0x65'),JSON[_0x0b6a('0x54')](_0x2df9b0['campaignsPreview'][_0x2df9b0['actions'][_0x2e66e1][_0x0b6a('0x66')]][_0x0b6a('0x48')]),_0x0b6a('0x67'),JSON[_0x0b6a('0x54')](_0x2df9b0[_0x0b6a('0x24')][_0x2df9b0[_0x0b6a('0x64')][_0x2e66e1]['queue']][_0x0b6a('0x68')]),JSON[_0x0b6a('0x54')](_0x2df9b0[_0x0b6a('0x64')][_0x2e66e1][_0x0b6a('0x69')]),JSON[_0x0b6a('0x54')](_['pick'](_0x2df9b0[_0x0b6a('0x64')][_0x2e66e1],[_0x0b6a('0x6a'),_0x0b6a('0x6b'),'VoiceQueueId',_0x0b6a('0x6c')])));return ami['Action']({'action':_0x0b6a('0x6d'),'channel':_0x2df9b0[_0x0b6a('0x64')][_0x2e66e1][_0x0b6a('0x6e')]})['catch'](function(_0x248d8a){if(_0x248d8a[_0x0b6a('0x47')]===_0x0b6a('0x6f')){setTimeout(function(){if(_0x2df9b0[_0x0b6a('0x64')][_0x2e66e1]){ut['updateOriginated'](_0x2df9b0[_0x0b6a('0x24')][_0x2df9b0[_0x0b6a('0x64')][_0x2e66e1][_0x0b6a('0x66')]],_0x0b6a('0x70'));if(_0x2df9b0[_0x0b6a('0x64')][_0x2e66e1][_0x0b6a('0x69')]===!![]){ut['decrementTalkink'](_0x2df9b0[_0x0b6a('0x24')][_0x2df9b0[_0x0b6a('0x64')][_0x2e66e1][_0x0b6a('0x66')]],_0x0b6a('0x70'));ut[_0x0b6a('0x71')]('[Dialer][checkChannel][pTalking][Preview]'+_0x2e66e1,_0x2df9b0[_0x0b6a('0x64')][_0x2e66e1][_0x0b6a('0x66')]);}ut[_0x0b6a('0x71')](_0x0b6a('0x72')+_0x2e66e1,_0x2df9b0['actions'][_0x2e66e1][_0x0b6a('0x66')]);delete _0x2df9b0[_0x0b6a('0x64')][_0x2e66e1];}},0x2328);}});}});};Preview[_0x0b6a('0x5f')][_0x0b6a('0x60')]=function(){var _0x1622f0=this;loggerAction[_0x0b6a('0x53')](_0x0b6a('0x73'),_[_0x0b6a('0x74')](this[_0x0b6a('0x64')]));for(var _0x2e3917 in this[_0x0b6a('0x64')]){if(_0x1622f0['actions'][_0x0b6a('0x61')](_0x2e3917)){_0x1622f0['clearZombieChannel'](_0x2e3917);}}};Preview[_0x0b6a('0x5f')][_0x0b6a('0x62')]=function(_0x2fd636){var _0x424d9e=this;rpcDb[_0x0b6a('0x75')](_0x2fd636['id'],ut['agentReadyId'](this[_0x0b6a('0x16')]))[_0x0b6a('0x76')](function(_0xb51901){if(!_[_0x0b6a('0x63')](_0xb51901)){for(var _0x148013=0x0;_0x148013<_0xb51901[_0x0b6a('0x77')];_0x148013+=0x1){if(ut['getDiff'](_0xb51901[_0x148013][_0x0b6a('0x78')])<_0x2fd636[_0x0b6a('0x79')]*0x3c){if(_0xb51901[_0x148013]['Agent']&&!_0xb51901[_0x148013][_0x0b6a('0x7a')]['voicePause']){_0x424d9e[_0x0b6a('0x7b')](_0xb51901[_0x148013]['id'])[_0x0b6a('0x76')](ut[_0x0b6a('0x7c')](_0x0b6a('0x7d')))[_0x0b6a('0x7e')](ut[_0x0b6a('0x7c')](_0x0b6a('0x7d')));}else{rpcDb['disableContact'](_0xb51901[_0x148013]['id']);}}else{var _0x5cfedf=new Action(_0xb51901[_0x148013],_0x2fd636);_0x5cfedf[_0x0b6a('0x7f')]=moment()[_0x0b6a('0x55')](_0x0b6a('0x80'));_0x2fd636[_0x0b6a('0x3e')]+=0x1;ut[_0x0b6a('0x81')](_0x5cfedf,0x17,_0x0b6a('0x82'));if(_0x2fd636[_0x0b6a('0x83')]){rpcDb[_0x0b6a('0x84')](ut[_0x0b6a('0x85')](_0xb51901[_0x148013]));rpcDb['createCustomerHistory'](_0x5cfedf,_0x0b6a('0x86'));}else{ut['logCustomer'](_0x5cfedf,0x16,_0x0b6a('0x87'));rpcDb[_0x0b6a('0x88')](_0x5cfedf,_0x0b6a('0x89'));rpcDb[_0x0b6a('0x8a')](_0x5cfedf,'[HistoryRecallClose]');}}}}})[_0x0b6a('0x7e')](ut['logger2'](_0x0b6a('0x8b')));};Preview[_0x0b6a('0x5f')]['setMessage']=function(_0x4f8679){_0x4f8679[_0x0b6a('0x58')]=!![];if(ut[_0x0b6a('0x8c')](_0x4f8679[_0x0b6a('0x29')])){_0x4f8679[_0x0b6a('0x47')]=_0x0b6a('0x8d');}else if(!ut['isActive'](_0x4f8679[_0x0b6a('0x32')])){_0x4f8679[_0x0b6a('0x47')]=_0x0b6a('0x59');}else if(!this[_0x0b6a('0x8e')](_0x4f8679[_0x0b6a('0x4e')])){if(!this[_0x0b6a('0x8e')](_0x4f8679[_0x0b6a('0x8f')])){_0x4f8679['message']=_0x0b6a('0x90');}else{_0x4f8679[_0x0b6a('0x47')]='ACTIVE';}}else{_0x4f8679['message']='ACTIVE';}emitCampaignPreview(_0x4f8679);};Preview[_0x0b6a('0x5f')][_0x0b6a('0x91')]=function(_0x263262,_0x5b7eef,_0x10f6f6){var _0x260c81=this;var _0x2f601b=this[_0x0b6a('0x64')][_0x5b7eef];var _0xecd5b=this['campaignsPreview'][_0x2f601b[_0x0b6a('0x66')]];var _0x69f9ea;if(_0xecd5b){switch(_0x10f6f6){case'1':_0xecd5b[_0x0b6a('0x3c')]+=0x1;_0x2f601b[_0x0b6a('0x92')]=ut[_0x0b6a('0x93')](_0x2f601b);ut[_0x0b6a('0x81')](_0x2f601b,0x0,'NoSuchNumber');rpcDb[_0x0b6a('0x88')](_0x2f601b,_0x0b6a('0x94'));if(ut[_0x0b6a('0x93')](_0x2f601b)>=_0xecd5b[_0x0b6a('0x95')]){_0x69f9ea=ut[_0x0b6a('0x96')](_0x2f601b,0xf,'Global');rpcDb[_0x0b6a('0x8a')](_0x69f9ea,_0x0b6a('0x97'));}else{if(_0x2f601b[_0x0b6a('0x98')]>=_0xecd5b[_0x0b6a('0x99')]){rpcDb[_0x0b6a('0x8a')](_0x2f601b,_0x0b6a('0x97'));}else{rpcDb['rescheduleContact'](ut[_0x0b6a('0x9a')](_0x2f601b,_0x0b6a('0x98'),_0xecd5b['dialNoSuchNumberRetryFrequency']),_0x2f601b['unlockAgent'],_0x2f601b[_0x0b6a('0x9b')]);}}delete this[_0x0b6a('0x64')][_0x263262[_0x0b6a('0x9c')]];break;case _0x0b6a('0x9d'):var _0x331c21=moment()[_0x0b6a('0x55')](_0x0b6a('0x80'));_0x2f601b[_0x0b6a('0x9e')]=_0x331c21;_0x2f601b[_0x0b6a('0x9f')]=_0x331c21;_0x2f601b[_0x0b6a('0x69')]=!![];_0xecd5b[_0x0b6a('0x68')]+=0x1;logger[_0x0b6a('0x53')]('[syncHangup][talking][increment]',_0x2f601b[_0x0b6a('0xa0')],_0x0b6a('0xa1'),_0xecd5b[_0x0b6a('0x26')],'pTalking:\x20',_0xecd5b[_0x0b6a('0x68')]);ami[_0x0b6a('0xa2')](_0x0b6a('0xa3'),ut[_0x0b6a('0xa4')](_0x2f601b,_0x0b6a('0xa5')));if(_0xecd5b['acw']){ami[_0x0b6a('0xa2')]('custom:agentConnectPreview',ut[_0x0b6a('0xa6')](_0x2f601b));}break;case'16':ami[_0x0b6a('0xa2')](_0x0b6a('0xa7'),ut[_0x0b6a('0xa4')](_0x2f601b,'complete'));emitVoiceQueueChannelRemove(ut[_0x0b6a('0xa4')](_0x2f601b,_0x0b6a('0xa8')));_0xecd5b[_0x0b6a('0x37')]+=0x1;_0xecd5b['total']+=0x1;_0xecd5b['answered']+=0x1;ut[_0x0b6a('0xa9')](_0xecd5b,'[16]');_0x2f601b['countglobal']=ut['totalGlobal'](_0x2f601b);ut[_0x0b6a('0x81')](_0x2f601b,0x4,'Answer');rpcDb[_0x0b6a('0x88')](_0x2f601b,_0x0b6a('0xaa'));rpcDb[_0x0b6a('0x8a')](_0x2f601b,_0x0b6a('0xab'));rpcDb[_0x0b6a('0xac')](_0x2f601b);_0xecd5b['sumDuration']+=_0x2f601b[_0x0b6a('0xad')];_0xecd5b['sumBillable']+=_0x2f601b['talktime'];logger['info'](_0x0b6a('0xae'),_0x2f601b[_0x0b6a('0xa0')],'\x20Queue',_0xecd5b[_0x0b6a('0x26')],'pTalking:\x20',_0xecd5b['pTalking']);delete this['actions'][_0x263262[_0x0b6a('0x9c')]];break;case'BUSY':_0xecd5b['outboundBusyCallsDay']+=0x1;_0x2f601b['countbusyretry']+=0x1;_0x2f601b[_0x0b6a('0x92')]=ut['totalGlobal'](_0x2f601b);ut['logCustomer'](_0x2f601b,0x5,_0x0b6a('0xaf'));rpcDb[_0x0b6a('0x88')](_0x2f601b,_0x0b6a('0xb0'));if(ut['totalGlobal'](_0x2f601b)>=_0xecd5b[_0x0b6a('0x95')]){_0x69f9ea=ut[_0x0b6a('0x96')](_0x2f601b,0xf,_0x0b6a('0xb1'));rpcDb['createCustomerFinal'](_0x69f9ea,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x2f601b[_0x0b6a('0xb2')]>=_0xecd5b[_0x0b6a('0xb3')]){rpcDb[_0x0b6a('0x8a')](_0x2f601b,_0x0b6a('0xb0'));}else{rpcDb[_0x0b6a('0xb4')](ut[_0x0b6a('0x9a')](_0x2f601b,_0x0b6a('0xb2'),_0xecd5b['dialBusyRetryFrequency']),_0x2f601b[_0x0b6a('0xb5')],_0x2f601b['activeContact']);}}break;case _0x0b6a('0xb6'):_0xecd5b[_0x0b6a('0x3b')]+=0x1;_0x2f601b[_0x0b6a('0xb7')]+=0x1;_0x2f601b['countglobal']=ut['totalGlobal'](_0x2f601b);ut['logCustomer'](_0x2f601b,0x3,_0x0b6a('0xb8'));rpcDb[_0x0b6a('0x88')](_0x2f601b,_0x0b6a('0xb9'));if(ut['totalGlobal'](_0x2f601b)>=_0xecd5b[_0x0b6a('0x95')]){_0x69f9ea=ut[_0x0b6a('0x96')](_0x2f601b,0xf,_0x0b6a('0xb1'));rpcDb[_0x0b6a('0x8a')](_0x69f9ea,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x2f601b['countnoanswerretry']>=_0xecd5b[_0x0b6a('0xba')]){rpcDb[_0x0b6a('0x8a')](_0x2f601b,_0x0b6a('0xb9'));}else{rpcDb[_0x0b6a('0xb4')](ut[_0x0b6a('0x9a')](_0x2f601b,_0x0b6a('0xb7'),_0xecd5b[_0x0b6a('0xbb')]),_0x2f601b['unlockAgent'],_0x2f601b[_0x0b6a('0x9b')]);}}break;case _0x0b6a('0xbc'):_0xecd5b[_0x0b6a('0x38')]+=0x1;_0x2f601b[_0x0b6a('0xbd')]+=0x1;_0x2f601b['countglobal']=ut[_0x0b6a('0x93')](_0x2f601b);ut[_0x0b6a('0x81')](_0x2f601b,0x8,_0x0b6a('0xbe'));rpcDb['createCustomerHistory'](_0x2f601b,'[callProgressDetectingCustomer][logCongestion]');if(ut[_0x0b6a('0x93')](_0x2f601b)>=_0xecd5b[_0x0b6a('0x95')]){_0x69f9ea=ut[_0x0b6a('0x96')](_0x2f601b,0xf,_0x0b6a('0xb1'));rpcDb['createCustomerFinal'](_0x69f9ea,_0x0b6a('0xbf'));}else{if(_0x2f601b[_0x0b6a('0xbd')]>=_0xecd5b['dialCongestionMaxRetry']){rpcDb['createCustomerFinal'](_0x2f601b,_0x0b6a('0xc0'));}else{rpcDb[_0x0b6a('0xb4')](ut[_0x0b6a('0x9a')](_0x2f601b,_0x0b6a('0xbd'),_0xecd5b[_0x0b6a('0xc1')]),_0x2f601b[_0x0b6a('0xb5')],_0x2f601b[_0x0b6a('0x9b')]);}}break;case _0x0b6a('0xc2'):_0xecd5b[_0x0b6a('0xc3')]+=0x1;_0x2f601b['countglobal']=ut[_0x0b6a('0x93')](_0x2f601b);ut[_0x0b6a('0x81')](_0x2f601b,0x14,'AgentReject');rpcDb[_0x0b6a('0x88')](_0x2f601b,_0x0b6a('0xc4'));if(_0x2f601b['unlockAgent']){rpcDb[_0x0b6a('0xc5')](_0x2f601b[_0x0b6a('0xc6')]);}if(_0x2f601b[_0x0b6a('0x9b')]){rpcDb[_0x0b6a('0xc7')](_0x2f601b[_0x0b6a('0xc6')]);}break;case _0x0b6a('0xc8'):_0xecd5b[_0x0b6a('0x40')]+=0x1;_0x2f601b[_0x0b6a('0xc9')]+=0x1;_0x2f601b[_0x0b6a('0x92')]=ut[_0x0b6a('0x93')](_0x2f601b);ut['logCustomer'](_0x2f601b,0xb,_0x0b6a('0xca'));rpcDb['createCustomerHistory'](_0x2f601b,_0x0b6a('0xcb'));if(ut[_0x0b6a('0x93')](_0x2f601b)>=_0xecd5b[_0x0b6a('0x95')]){_0x69f9ea=ut[_0x0b6a('0x96')](_0x2f601b,0xf,_0x0b6a('0xb1'));rpcDb['createCustomerFinal'](_0x69f9ea,_0x0b6a('0xcb'));}else{if(_0x2f601b[_0x0b6a('0xcc')]>=_0xecd5b[_0x0b6a('0xcd')]){rpcDb[_0x0b6a('0x8a')](_0x2f601b,'[callProgressDetectingCustomer][logAbandoned]');}else{rpcDb[_0x0b6a('0xb4')](ut[_0x0b6a('0x9a')](_0x2f601b,_0x0b6a('0xc9'),_0xecd5b[_0x0b6a('0xce')]),_0x2f601b['unlockAgent'],_0x2f601b['activeContact']);}}break;default:if(_0x2f601b['dialAnswer']){ut[_0x0b6a('0xa9')](_0xecd5b,_0x0b6a('0xcf'));ut['loggerError'](_0x0b6a('0xd0')+_0xecd5b[_0x0b6a('0x26')],_0x263262);}_0xecd5b[_0x0b6a('0x3f')]+=0x1;_0x2f601b['countglobal']=ut[_0x0b6a('0x93')](_0x2f601b);ut['logCustomer'](_0x2f601b,0xc,_0x263262[_0x0b6a('0xd1')]||_0x263262[_0x0b6a('0xd2')]);rpcDb[_0x0b6a('0x88')](_0x2f601b,_0x0b6a('0xd3'));if(ut['totalGlobal'](_0x2f601b)>=_0xecd5b['dialGlobalMaxRetry']){_0x69f9ea=ut[_0x0b6a('0x96')](_0x2f601b,0xf,_0x0b6a('0xb1'));rpcDb[_0x0b6a('0x8a')](_0x69f9ea,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb['createCustomerFinal'](_0x2f601b,_0x0b6a('0xd4'));}delete this['actions'][_0x263262[_0x0b6a('0x9c')]];}if(!(_0x2f601b['dialAnswer']&&_0x10f6f6==='16')){ut['updateOriginated'](_0xecd5b,_0x0b6a('0xd5'));logger[_0x0b6a('0x53')](_0x0b6a('0xd6'),_0x2f601b['uniqueid'],_0x0b6a('0xa1'),_0xecd5b[_0x0b6a('0x26')],'originated:\x20',_0xecd5b[_0x0b6a('0x48')]);}if(_0x10f6f6!==_0x0b6a('0x9d')){delete this[_0x0b6a('0x64')][_0x263262[_0x0b6a('0x9c')]];delete this[_0x0b6a('0x64')][_0x263262[_0x0b6a('0xd7')]];}}};Preview[_0x0b6a('0x5f')]['callProgressDetectingAgent']=function(_0x443edf,_0x1085d4,_0x26191e){if(_[_0x0b6a('0xd8')](_0x1085d4)&&'object'!==typeof _0x1085d4){return;}if(_[_0x0b6a('0xd8')](_0x26191e)&&_0x0b6a('0xd9')!==typeof _0x26191e){return;}switch(_0x26191e[_0x0b6a('0xda')]){case'0':ut['logAgent'](_0x443edf,0x0,'NoSuchNumber');rpcDb[_0x0b6a('0xdb')](_0x443edf,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut[_0x0b6a('0xdc')](_0x443edf,0x3,_0x0b6a('0xb8'));rpcDb[_0x0b6a('0xdb')](_0x443edf,_0x0b6a('0xdd'));break;case'5':ut[_0x0b6a('0xdc')](_0x443edf,0x5,_0x0b6a('0xaf'));rpcDb[_0x0b6a('0xdb')](_0x443edf,_0x0b6a('0xde'));break;case'8':ut[_0x0b6a('0xdc')](_0x443edf,0x8,_0x0b6a('0xbe'));rpcDb[_0x0b6a('0xdb')](_0x443edf,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut[_0x0b6a('0xdc')](_0x443edf,0x16,_0x0b6a('0xdf'));rpcDb[_0x0b6a('0xdb')](_0x443edf,_0x0b6a('0xe0'));break;default:ut[_0x0b6a('0xdc')](_0x443edf,0xc,_0x26191e['reason']);rpcDb['createAgentHistory'](_0x443edf,'[callProgressDetectingAgent][logCongestion]');}ut[_0x0b6a('0xe1')](_0x1085d4,_0x0b6a('0xe2'));logger[_0x0b6a('0x53')](_0x0b6a('0xe3'),_0x443edf[_0x0b6a('0xa0')],_0x0b6a('0xa1'),_0x1085d4['name'],'originated:\x20',_0x1085d4['originated']);delete this[_0x0b6a('0x64')][_0x443edf[_0x0b6a('0xa0')]];};Preview[_0x0b6a('0x5f')][_0x0b6a('0xe4')]=function(_0x3de4e4,_0x2c7bf4,_0x1d0efb,_0x23fe95,_0x1002a7){var _0x440c78=this;return new BPromise(function(_0x3e58be,_0xa00b82){if(_['isNil'](_0x2c7bf4)||_[_0x0b6a('0x63')](_0x2c7bf4[_0x0b6a('0xe5')])||_[_0x0b6a('0x63')](_0x2c7bf4[_0x0b6a('0xe5')]['phone'])||_['isNil'](_0x2c7bf4[_0x0b6a('0xe6')])){_0xa00b82(ut[_0x0b6a('0x47')](_0x0b6a('0xe7'),_0x23fe95,_0x1002a7));return;}var _0x360438=uuid['v4']();var _0x104168=_0x440c78[_0x0b6a('0x24')][_0x2c7bf4[_0x0b6a('0xe8')]['name']];var _0x46ba6f=_0x1d0efb?_0x440c78[_0x0b6a('0x16')][_0x1d0efb]['id']:undefined;_0x440c78[_0x0b6a('0x64')][_0x360438]=new Action(_0x2c7bf4,_0x104168,_0x360438,_0x1d0efb,_0x46ba6f);var _0x2f6a3c=_0x440c78[_0x0b6a('0x64')][_0x360438];_0x2f6a3c['unlockAgent']=_0x23fe95;_0x2f6a3c[_0x0b6a('0x9b')]=_0x1002a7;_0x2f6a3c[_0x0b6a('0xe9')]=_0x1d0efb;if(_[_0x0b6a('0xea')](_0x3de4e4)){_0x440c78[_0x0b6a('0xeb')](_0x2f6a3c,_0x104168,_0x2c7bf4,_0x1d0efb)[_0x0b6a('0x76')](function(_0x475e7a){logger[_0x0b6a('0x53')]('[Preview][execCall][success]',_0x0b6a('0xec')+_0x2f6a3c[_0x0b6a('0x66')]+_0x0b6a('0xed')+_0x2f6a3c[_0x0b6a('0xc6')],JSON[_0x0b6a('0x54')](_0x475e7a));ami[_0x0b6a('0xa2')](_0x0b6a('0xee'),ut[_0x0b6a('0xa4')](_0x2f6a3c,'called'));_0x3e58be(ut[_0x0b6a('0x47')](_0x0b6a('0xef')));})['catch'](function(_0x25e9fc){ut[_0x0b6a('0x5a')](_0x0b6a('0xf0'),_0x25e9fc);_0xa00b82(ut['message'](_0x0b6a('0xf1'),_0x23fe95,_0x1002a7));});}else{_0x104168[_0x0b6a('0xf2')]+=0x1;ut[_0x0b6a('0xf3')](_0x2f6a3c);rpcDb[_0x0b6a('0xf4')](_0x2f6a3c,'[Blacklist][error]');delete _0x440c78['actions'][_0x360438];_0xa00b82(ut[_0x0b6a('0x47')](_0x0b6a('0xf5'),_0x23fe95,_0x1002a7));}});};Preview[_0x0b6a('0x5f')][_0x0b6a('0x8e')]=function(_0xb84120){return!_[_0x0b6a('0x63')](_0xb84120)&&!_[_0x0b6a('0x63')](_0xb84120[_0x0b6a('0x26')])&&!_[_0x0b6a('0x63')](_0xb84120[_0x0b6a('0x4f')])&&_0xb84120[_0x0b6a('0x4f')]&&!_[_0x0b6a('0x63')](this[_0x0b6a('0x15')][util['format'](_0x0b6a('0xf6'),_0xb84120[_0x0b6a('0x26')])])&&!_[_0x0b6a('0x63')](this[_0x0b6a('0x15')][util['format']('SIP/%s',_0xb84120[_0x0b6a('0x26')])][_0x0b6a('0x6d')])&&(this['trunks'][util[_0x0b6a('0x55')]('SIP/%s',_0xb84120['name'])][_0x0b6a('0x6d')]===_0x0b6a('0xf7')||this[_0x0b6a('0x15')][util['format']('SIP/%s',_0xb84120['name'])][_0x0b6a('0x6d')]==='unmonitored');};Preview[_0x0b6a('0x5f')][_0x0b6a('0x7b')]=function(_0x1bdc8c,_0x32c99d){var _0x1f0b49=this;return new BPromise(function(_0x4041b3,_0x5c27bc){_0x1f0b49['execRun'](_0x1bdc8c,_0x32c99d)['then'](function(_0x456c56){_0x4041b3(_[_0x0b6a('0xf8')](_0x456c56,[_0x0b6a('0x47')]));})[_0x0b6a('0x7e')](function(_0x1d48c5){if(_0x1d48c5[_0x0b6a('0xf9')]){rpcDb[_0x0b6a('0xc5')](_0x1bdc8c);}if(_0x1d48c5['active']){rpcDb['disableContact'](_0x1bdc8c);}_0x5c27bc(_[_0x0b6a('0xf8')](_0x1d48c5,[_0x0b6a('0x47')]));});});};Preview[_0x0b6a('0x5f')][_0x0b6a('0xfa')]=function(_0x51b3f3,_0x551bf4){var _0xaacbfe=this;return new BPromise(function(_0x2f25cc,_0x134b29){var _0x3cc13d,_0x2058ea;rpcDb[_0x0b6a('0xfb')](_0x51b3f3)[_0x0b6a('0x76')](function(_0x41bab8){if(!_[_0x0b6a('0x63')](_0x41bab8[0x0])){_0x2058ea=_0x41bab8[0x0][_0x0b6a('0xfc')]?![]:!![];_0x3cc13d=_0x41bab8[0x0][_0x0b6a('0xfc')]?!![]:![];_0x3cc13d=_0x551bf4?!![]:_0x3cc13d;}var _0x19a298=_0xaacbfe[_0x0b6a('0xfd')](_0x41bab8);if(_0x19a298[_0x0b6a('0xfe')]){rpcDb['checkIsBlackList'](_[_0x0b6a('0xf8')](_0x41bab8[0x0],['VoiceQueueId',_0x0b6a('0xff')]))[_0x0b6a('0x76')](function(_0xbd930){_0xaacbfe[_0x0b6a('0xe4')](_0xbd930,_0x41bab8[0x0],_0x551bf4,_0x2058ea,_0x3cc13d)[_0x0b6a('0x76')](function(_0x17908e){_0x2f25cc(_0x17908e);})[_0x0b6a('0x7e')](function(_0x3863ac){_0x134b29(_0x3863ac);});})['catch'](function(_0x21abee){ut['logger'](_0x0b6a('0x100'),_0x21abee);_0x134b29(ut[_0x0b6a('0x47')]('Call\x20unsuccessful',_0x2058ea,_0x3cc13d));});}else{_0x134b29(ut[_0x0b6a('0x47')](_0x19a298[_0x0b6a('0x47')],_0x2058ea,_0x3cc13d));}})['catch'](function(_0x2120d4){ut[_0x0b6a('0x5a')](_0x0b6a('0x101'),_0x2120d4);_0x134b29(ut[_0x0b6a('0x47')](_0x0b6a('0x102'),![],!![]));});});};Preview[_0x0b6a('0x5f')]['validateContact']=function(_0x344e8f){if(_['isNil'](_0x344e8f)||_[_0x0b6a('0xea')](_0x344e8f)||!_[_0x0b6a('0x63')](_0x344e8f[0x0][_0x0b6a('0x7a')])&&_[_0x0b6a('0x63')](_0x344e8f[0x0][_0x0b6a('0x7a')][_0x0b6a('0x26')])){ut['logger'](_0x0b6a('0x103'),_0x344e8f);return{'isValid':![],'message':_0x0b6a('0x104')};}var _0x16ec6b=this[_0x0b6a('0x24')][_0x344e8f[0x0][_0x0b6a('0xe8')][_0x0b6a('0x26')]];_0x16ec6b['message']=_0x0b6a('0x105');if(_[_0x0b6a('0x63')](_0x16ec6b)){ut['logger'](_0x0b6a('0x106'),_0x16ec6b);return{'isValid':![],'message':_0x0b6a('0x107')};}if(!this[_0x0b6a('0x8e')](_0x16ec6b[_0x0b6a('0x4e')])){ut[_0x0b6a('0x5a')](_0x0b6a('0x108'),_0x0b6a('0x109')+_0x16ec6b['name']+'\x20Trunk\x20is\x20not\x20active');if(!this['isTrunkReachable'](_0x16ec6b[_0x0b6a('0x8f')])){ut['logger'](_0x0b6a('0x108'),_0x16ec6b[_0x0b6a('0x26')]+_0x0b6a('0x10a'));return{'isValid':![],'message':_0x0b6a('0x10b')};}}if(!ut[_0x0b6a('0x10c')](_0x16ec6b['dialActive'])){ut[_0x0b6a('0x5a')](_0x0b6a('0x10d'),_0x16ec6b[_0x0b6a('0x26')]+_0x0b6a('0x10e'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x16ec6b[_0x0b6a('0x26')]+_0x0b6a('0x10e')};}return{'isValid':!![],'message':_0x0b6a('0x10f')};};Preview[_0x0b6a('0x5f')][_0x0b6a('0xeb')]=function(_0x83fbbc,_0x2f6dcb,_0x62f79b,_0x474cea){var _0x4c992e=this;return new BPromise(function(_0x55393f,_0x11a38b){var _0x5c2eaf=_0x83fbbc[_0x0b6a('0xa0')];var _0x184dd9=_0x4c992e[_0x0b6a('0x8e')](_0x2f6dcb['Trunk'])?util[_0x0b6a('0x55')](_0x0b6a('0x110'),_0x2f6dcb[_0x0b6a('0x4e')][_0x0b6a('0x26')],_[_0x0b6a('0x63')](_0x2f6dcb[_0x0b6a('0x35')])?'':_0x2f6dcb[_0x0b6a('0x35')][_0x0b6a('0x111')]()||'',_0x2f6dcb[_0x0b6a('0x112')]>0x0?_0x62f79b[_0x0b6a('0xe5')]['phone'][_0x0b6a('0x113')](_0x2f6dcb[_0x0b6a('0x112')]):_0x62f79b[_0x0b6a('0xe5')]['phone']):util[_0x0b6a('0x55')]('SIP/%s/%s%s',_['isNil'](_0x2f6dcb[_0x0b6a('0x8f')])?_0x2f6dcb[_0x0b6a('0x4e')]['name']:_0x2f6dcb[_0x0b6a('0x8f')][_0x0b6a('0x26')],_[_0x0b6a('0x63')](_0x2f6dcb[_0x0b6a('0x35')])?'':_0x2f6dcb[_0x0b6a('0x35')]['trim']()||'',_0x2f6dcb[_0x0b6a('0x112')]>0x0?_0x62f79b['Contact'][_0x0b6a('0x114')][_0x0b6a('0x113')](_0x2f6dcb['dialCutDigit']):_0x62f79b[_0x0b6a('0xe5')][_0x0b6a('0x114')]);var _0xc29881=_0x4c992e[_0x0b6a('0x8e')](_0x2f6dcb[_0x0b6a('0x4e')])?ut[_0x0b6a('0x115')](_0x2f6dcb[_0x0b6a('0x4e')][_0x0b6a('0x116')],_0x2f6dcb['dialOriginateCallerIdName'],_0x2f6dcb['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x0b6a('0x117')](_0x2f6dcb[_0x0b6a('0x118')],_0x2f6dcb[_0x0b6a('0x119')]):_0x2f6dcb[_0x0b6a('0x118')]):ut['getCallerId'](_[_0x0b6a('0x63')](_0x2f6dcb[_0x0b6a('0x8f')])?_0x2f6dcb['Trunk'][_0x0b6a('0x116')]:_0x2f6dcb[_0x0b6a('0x8f')][_0x0b6a('0x116')],_0x2f6dcb[_0x0b6a('0x11a')],_0x2f6dcb[_0x0b6a('0x119')]>0x0?ut[_0x0b6a('0x117')](_0x2f6dcb[_0x0b6a('0x118')],_0x2f6dcb[_0x0b6a('0x119')]):_0x2f6dcb['dialOriginateCallerIdNumber']);if(_0xc29881){_0x83fbbc['originatecalleridname']=ut[_0x0b6a('0x11b')](_0xc29881);_0x83fbbc[_0x0b6a('0x11c')]=ut[_0x0b6a('0x11d')](_0xc29881);}var _0x4be70e=ut[_0x0b6a('0x11e')](_0x2f6dcb,_0x62f79b,_0x184dd9,_0xc29881,_0x5c2eaf,_0x83fbbc);_['merge'](_0x83fbbc,ut['toLowerVariables'](_0x4be70e));_0x83fbbc[_0x0b6a('0x7f')]=moment()[_0x0b6a('0x55')](_0x0b6a('0x80'));ami[_0x0b6a('0x11f')](ut[_0x0b6a('0x120')](_0x83fbbc,_0x2f6dcb,_0x4be70e,_0x83fbbc[_0x0b6a('0x9b')],_0x474cea))[_0x0b6a('0x76')](function(_0x39c9c9){_0x2f6dcb[_0x0b6a('0x48')]+=0x1;logger[_0x0b6a('0x53')](_0x0b6a('0x121'),_0x5c2eaf,_0x0b6a('0xa1'),_0x2f6dcb[_0x0b6a('0x26')],_0x0b6a('0x65'),_0x2f6dcb['originated']);_0x55393f(_0x39c9c9);})[_0x0b6a('0x7e')](function(_0x29006f){ut[_0x0b6a('0xdc')](_0x83fbbc,0xe,_0x0b6a('0x122'));rpcDb['createAgentHistory'](_0x83fbbc,_0x0b6a('0x123'));_0x11a38b(_0x29006f);});});};Preview[_0x0b6a('0x5f')][_0x0b6a('0x1f')]=function(_0x11e3e1){if(this[_0x0b6a('0x64')][_0x11e3e1[_0x0b6a('0x9c')]]){this[_0x0b6a('0x64')][_0x11e3e1[_0x0b6a('0x9c')]][_0x0b6a('0x6e')]=_0x11e3e1[_0x0b6a('0x6e')];}};Preview[_0x0b6a('0x5f')]['syncOriginateResponse']=function(_0x4e5bc5){var _0x468fbd=this;var _0x2b13b5=this['actions'][_0x4e5bc5['actionid']];if(_0x2b13b5){if(_0x2b13b5[_0x0b6a('0xe9')]&&this['agents'][_0x2b13b5['lookAgent']]){ut[_0x0b6a('0x124')](_0x2b13b5,this[_0x0b6a('0x16')][_0x2b13b5[_0x0b6a('0xe9')]]['name'],this[_0x0b6a('0x16')][_0x2b13b5[_0x0b6a('0xe9')]]['id']);}var _0x18732a=_[_0x0b6a('0x125')](_0x2b13b5);_0x18732a[_0x0b6a('0x9e')]=moment()[_0x0b6a('0x55')]('YYYY-MM-DD\x20HH:mm:ss');var _0x5b1eff=_0x468fbd[_0x0b6a('0x24')][_0x2b13b5[_0x0b6a('0x66')]];if(ut[_0x0b6a('0x126')](_0x4e5bc5[_0x0b6a('0x127')])){if(_0x2b13b5['unlockAgent']){rpcDb[_0x0b6a('0xc5')](_0x2b13b5[_0x0b6a('0xc6')]);}if(_0x2b13b5[_0x0b6a('0x9b')]){rpcDb[_0x0b6a('0xc7')](_0x2b13b5[_0x0b6a('0xc6')]);}ami[_0x0b6a('0xa2')](_0x0b6a('0x128'),ut['buildObj'](_0x2b13b5,_0x0b6a('0x129')));this['callProgressDetectingAgent'](_0x18732a,_0x5b1eff,_0x4e5bc5);}else{_0x2b13b5[_0x0b6a('0x7f')]=moment()[_0x0b6a('0x55')](_0x0b6a('0x80'));ut['logAgent'](_0x18732a,0x4,_0x0b6a('0x12a'));rpcDb['createAgentHistory'](_0x18732a,_0x0b6a('0x12b'));}}};Preview['prototype'][_0x0b6a('0x1a')]=function(_0x4633e5){var _0x1d1c4e=this;var _0x42a450=this['actions'][_0x4633e5['linkedid']];var _0x113aed;if(_0x42a450){_0x113aed=this[_0x0b6a('0x24')][_0x42a450['queue']];logger[_0x0b6a('0x53')](_0x0b6a('0x12c'),_0x4633e5[_0x0b6a('0x9c')],_0x0b6a('0xa1'),_0x113aed['name'],_0x0b6a('0x67'),_0x113aed[_0x0b6a('0x68')]);}if(this['actions'][_0x4633e5[_0x0b6a('0x9c')]]&&_0x4633e5[_0x0b6a('0x9c')]!==_0x4633e5[_0x0b6a('0xa0')]){if(_0x4633e5[_0x0b6a('0x12d')]==='16'&&this[_0x0b6a('0x64')][_0x4633e5[_0x0b6a('0x9c')]][_0x0b6a('0x69')]){this[_0x0b6a('0x91')](_0x4633e5,_0x4633e5[_0x0b6a('0x9c')],_0x4633e5['cause']);}else if(this[_0x0b6a('0x64')][_0x4633e5[_0x0b6a('0x9c')]][_0x0b6a('0x69')]){logger[_0x0b6a('0x53')](_0x0b6a('0x12e'),_0x4633e5[_0x0b6a('0x9c')],_0x4633e5['cause'],_0x0b6a('0xa1'),_0x113aed[_0x0b6a('0x26')],_0x0b6a('0x67'),_0x113aed[_0x0b6a('0x68')]);this[_0x0b6a('0x91')](_0x4633e5,_0x4633e5['linkedid'],_0x4633e5[_0x0b6a('0x12d')]);}}else if(_0x42a450&&_['isNil'](_0x42a450['statedesc'])&&_0x113aed[_0x0b6a('0x12f')]&&_0x4633e5[_0x0b6a('0x9c')]===_0x4633e5[_0x0b6a('0xa0')]&&_[_0x0b6a('0x63')](_0x4633e5['reason'])&&_0x4633e5[_0x0b6a('0x12d')]==='16'&&_0x4633e5[_0x0b6a('0x130')]==='6'&&_[_0x0b6a('0xd8')](_0x42a450[_0x0b6a('0x131')])){if(_0x42a450[_0x0b6a('0xb5')]){rpcDb[_0x0b6a('0xc5')](_0x42a450['idContact']);}if(_0x42a450['activeContact']){rpcDb[_0x0b6a('0xc7')](_0x42a450[_0x0b6a('0xc6')]);}_0x4633e5['reason']='22';this[_0x0b6a('0x132')](_0x42a450,_0x113aed,_0x4633e5);}else if(_0x42a450&&_0x42a450[_0x0b6a('0x131')]){if(_0x4633e5[_0x0b6a('0x12d')]==='16'&&this['actions'][_0x4633e5['linkedid']][_0x0b6a('0x69')]){logger[_0x0b6a('0x53')]('[syncHangup][talking][transfer]',_0x4633e5['linkedid'],_0x4633e5[_0x0b6a('0x12d')],_0x0b6a('0xa1'),_0x113aed[_0x0b6a('0x26')],_0x0b6a('0x67'),_0x113aed[_0x0b6a('0x68')]);this[_0x0b6a('0x91')](_0x4633e5,_0x4633e5[_0x0b6a('0x9c')],_0x4633e5[_0x0b6a('0x12d')]);}else if(this[_0x0b6a('0x64')][_0x4633e5[_0x0b6a('0x9c')]]['dialAnswer']){logger[_0x0b6a('0x53')]('[syncHangup][talking][cause]',_0x4633e5[_0x0b6a('0x9c')],_0x4633e5[_0x0b6a('0x12d')],_0x0b6a('0xa1'),_0x113aed[_0x0b6a('0x26')],_0x0b6a('0x67'),_0x113aed[_0x0b6a('0x68')]);this[_0x0b6a('0x91')](_0x4633e5,_0x4633e5[_0x0b6a('0x9c')],_0x4633e5[_0x0b6a('0x12d')]);}}};Preview[_0x0b6a('0x5f')][_0x0b6a('0x1d')]=function(_0x5401a4){if(this[_0x0b6a('0x64')][_0x5401a4[_0x0b6a('0xd7')]]&&_0x5401a4[_0x0b6a('0xd7')]!==_0x5401a4['destuniqueid']){this[_0x0b6a('0x91')](_0x5401a4,_0x5401a4[_0x0b6a('0xd7')],_0x5401a4['dialstatus']);}};Preview[_0x0b6a('0x5f')][_0x0b6a('0x133')]=function(_0x59cc8c){if(this[_0x0b6a('0x64')][_0x59cc8c[_0x0b6a('0x9c')]]&&_0x59cc8c['linkedid']!==_0x59cc8c[_0x0b6a('0xa0')]&&!this[_0x0b6a('0x64')][_0x59cc8c[_0x0b6a('0x9c')]][_0x0b6a('0x69')]){if(_0x59cc8c[_0x0b6a('0x12d')]==='1'){this[_0x0b6a('0x91')](_0x59cc8c,_0x59cc8c['linkedid'],_0x59cc8c[_0x0b6a('0x12d')]);}}};Preview[_0x0b6a('0x5f')][_0x0b6a('0x134')]=function(_0x3a1d14,_0x2b28fc,_0x58a069){if(this[_0x0b6a('0x64')][_0x3a1d14]){if(_[_0x0b6a('0x63')](this[_0x0b6a('0x64')][_0x3a1d14]['variables'])){this[_0x0b6a('0x64')][_0x3a1d14][_0x0b6a('0x135')]={};}this[_0x0b6a('0x64')][_0x3a1d14][_0x0b6a('0x135')][_0x2b28fc]=_0x58a069;}};Preview['prototype'][_0x0b6a('0x20')]=function(_0x5b05cb){try{if(!_['isNil'](_0x5b05cb)){if(ut['filterKey'](_[_0x0b6a('0x136')](_0x5b05cb[_0x0b6a('0x137')])[0x0])){this[_0x0b6a('0x134')](_0x5b05cb[_0x0b6a('0xa0')],_[_0x0b6a('0x136')](_0x5b05cb['variable'])[0x0],_0x5b05cb[_0x0b6a('0x138')]);}}}catch(_0x487b3a){logger[_0x0b6a('0x139')](_0x0b6a('0x13a'),util[_0x0b6a('0x13b')](_0x487b3a,{'showHidden':![],'depth':null}));}};Preview[_0x0b6a('0x5f')][_0x0b6a('0x13c')]=function(_0x25895b){if(_0x25895b){if(this[_0x0b6a('0x64')][_0x25895b[_0x0b6a('0x13d')]]){this[_0x0b6a('0x64')][_0x25895b[_0x0b6a('0x13d')]][_0x0b6a('0x131')]=!![];}}};Preview[_0x0b6a('0x5f')][_0x0b6a('0x13e')]=function(_0x4719){if(_0x4719){if(this['actions'][_0x4719[_0x0b6a('0x13f')]]){this['actions'][_0x4719['transfererlinkedid']]['transfer']=!![];}}};module['exports']=Preview; \ No newline at end of file +var _0xe09d=['logger','\x20is\x20not\x20active','IS_DISACTIVED','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20disactive','syncCampaigns','hasOwnProperty','preview','booked','outbound','clearZombieChannels','dialActive','setMessage','clearZombieChannel','enqueue','isNil','actions','[clearZombieChannels][talking]','originated:\x20','queue','pTalking:\x20','dialAnswer','pick','contactId','UserId','VoiceQueueId','ListId','channel','catch','No\x20such\x20channel','updateOriginated','decrementTalkink','[clearZombieChannel]','loggerError','[action]','size','recallMe','getContactRecallMe','agentReadyId','then','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','voicePause','logger2','[RecallMe]','starttime','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','createCustomerHistory','[HistoryRecallClose]','[getContactRecallMe]','IsNotLoggedIn','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countglobal','totalGlobal','NoSuchNumber','[callProgressDetectingCustomer][logNoSuch]','Global','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','countnosuchnumberretry','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','unlockAgent','activeContact','linkedid','ANSWER','format','YYYY-MM-DD\x20HH:mm:ss','answertime','[syncHangup][talking][increment]','uniqueid','emit','buildObj','connect','acw','buildAcw','custom:agentcomplete','complete','[16]','crateCustomerReportQueue','sumDuration','talktime','sumBillable','[syncHangup][talking][decrement]','\x20Queue','BUSY','countbusyretry','Busy','dialGlobalMaxRetry','cloneAction','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','[callProgressDetectingCustomer][logBusy]','NOANSWER','countnoanswerretry','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','CONGESTION','outboundCongestionCallsDay','countcongestionretry','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','CANCEL','AgentReject','[syncHangupRequest][logAgentReject]','unlockContact','idContact','outboundAbandonedCallsDay','countabandonedretry','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','cause-txt','dialstatus','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','NoAnswer','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','Congestion','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','originated','checkInBlack','Contact','phone','Contact\x20is\x20undefined','Queue','lookAgent','isEmpty','execCall','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','called','Calling','createHistory','active','SIP/%s','status','reachable','unmonitored','run','execRun','unlock','disableContact','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','Contact.phone','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','SIP/%s/%s%s','trim','dialCutDigit','substring','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerId','callerid','getCallerIdRandom','originatecalleridname','extractCalleridName','addVariables','merge','Action','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','clone','responsetime','response','custom:agentringnoanswer','rejected','callProgressDetectingAgent','Answer','[callProgressDetectingAgent][logAnswer]','cause','[syncHangup][talking][cause]','statedesc','transfer','destlinkedid','variables','filterKey','keys','variable','addVariable','[syncVarSet][Preview]','inspect','syncBlindTransfer','transfererlinkedid','exports','util','lodash','uuid','moment','md5','../../../config/environment','../../../config/logger','actionPreview','../ami','./rpcDb','./util/util','redis','defaults','localhost','socket.io-emitter','prototype','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncHangupRequest','dialend','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','loopCampaigns','name','strategy','available','loggedIn','talking','type','unmanaged','abandoned','waiting','dialMethod','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','message','erlangCalls','erlangBusyFactor','startPredictive','startProgressive','Trunk','Interval','stringify','voice:queue:%s','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','sendMessageOneNotActive','pTalking','paused'];(function(_0x5db99b,_0xdee23a){var _0x4b2d0e=function(_0x4deee1){while(--_0x4deee1){_0x5db99b['push'](_0x5db99b['shift']());}};_0x4b2d0e(++_0xdee23a);}(_0xe09d,0xea));var _0xde09=function(_0x3538eb,_0x30d222){_0x3538eb=_0x3538eb-0x0;var _0x1020fa=_0xe09d[_0x3538eb];return _0x1020fa;};'use strict';var util=require(_0xde09('0x0'));var _=require(_0xde09('0x1'));var BPromise=require('bluebird');var uuid=require(_0xde09('0x2'));var moment=require(_0xde09('0x3'));var md5=require(_0xde09('0x4'));var Redis=require('ioredis');var config=require(_0xde09('0x5'));var logger=require(_0xde09('0x6'))('preview');var loggerAction=require('../../../config/logger')(_0xde09('0x7'));var ami=require(_0xde09('0x8'));var rpcDb=require(_0xde09('0x9'));var Action=require('./action');var ut=require(_0xde09('0xa'));config[_0xde09('0xb')]=_[_0xde09('0xc')](config[_0xde09('0xb')],{'host':_0xde09('0xd'),'port':0x18eb});var io=require(_0xde09('0xe'))(new Redis(config['redis']));var Sequence=function(){};Sequence[_0xde09('0xf')]['enqueue']=function(_0x2b4d62){this[_0xde09('0x10')]=this[_0xde09('0x10')]?this['tail'][_0xde09('0x11')](_0x2b4d62):_0x2b4d62();};function Preview(_0x418530){this[_0xde09('0x12')]=new Sequence();this[_0xde09('0x13')]=_0x418530[_0xde09('0x14')];this[_0xde09('0x15')]=_0x418530[_0xde09('0x15')];this['actions']={};this['agents']=_0x418530[_0xde09('0x16')];this[_0xde09('0x17')]=0x0;ami['on'](_0xde09('0x18'),this[_0xde09('0x19')][_0xde09('0x1a')](this));ami['on'](_0xde09('0x1b'),this[_0xde09('0x1c')]['bind'](this));ami['on'](_0xde09('0x1d'),this[_0xde09('0x1e')][_0xde09('0x1a')](this));ami['on'](_0xde09('0x1f'),this[_0xde09('0x20')][_0xde09('0x1a')](this));ami['on'](_0xde09('0x21'),this[_0xde09('0x22')][_0xde09('0x1a')](this));ami['on'](_0xde09('0x23'),this[_0xde09('0x24')][_0xde09('0x1a')](this));ami['on'](_0xde09('0x25'),this[_0xde09('0x26')][_0xde09('0x1a')](this));ami['on'](_0xde09('0x27'),this['syncBlindTransfer'][_0xde09('0x1a')](this));this[_0xde09('0x28')](this[_0xde09('0x13')]);}function emit(_0x18e8a1,_0x283145,_0x53be64){io['to'](_0x18e8a1)['emit'](_0x283145,_0x53be64);}function emitCampaignPreview(_0x9eb626){if(_0x9eb626['type']==='outbound'){var _0x21a8e5={'id':_0x9eb626['id'],'name':_0x9eb626[_0xde09('0x29')],'strategy':_0x9eb626[_0xde09('0x2a')],'answered':_0x9eb626['answered'],'available':_0x9eb626[_0xde09('0x2b')],'loggedIn':_0x9eb626[_0xde09('0x2c')],'pTalking':_0x9eb626['pTalking'],'sumBillable':_0x9eb626['sumBillable'],'sumDuration':_0x9eb626['sumDuration'],'sumHoldTime':_0x9eb626['sumHoldTime']||0x0,'talking':_0x9eb626[_0xde09('0x2d')],'total':_0x9eb626['total'],'type':_0x9eb626[_0xde09('0x2e')],'unmanaged':_0x9eb626[_0xde09('0x2f')],'abandoned':_0x9eb626[_0xde09('0x30')],'waiting':_0x9eb626[_0xde09('0x31')],'loggedInDb':_0x9eb626['loggedInDb'],'dialActive':_0x9eb626['dialActive'],'dialMethod':_0x9eb626[_0xde09('0x32')],'dialOriginateCallerIdName':_0x9eb626['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x9eb626[_0xde09('0x33')],'dialOriginateTimeout':_0x9eb626[_0xde09('0x34')],'dialPrefix':_0x9eb626[_0xde09('0x35')],'outboundAnswerAgiCallsDay':_0x9eb626[_0xde09('0x36')],'outboundAnswerCallsDay':_0x9eb626[_0xde09('0x37')],'outboundBlacklistCallsDay':_0x9eb626[_0xde09('0x38')],'outboundBusyCallsDay':_0x9eb626[_0xde09('0x39')],'outboundCongestionCallsDay':_0x9eb626['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x9eb626[_0xde09('0x3a')],'outboundDropCallsDayCallersExit':_0x9eb626['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x9eb626[_0xde09('0x3b')],'outboundNoAnswerCallsDay':_0x9eb626[_0xde09('0x3c')],'outboundNoSuchCallsDay':_0x9eb626[_0xde09('0x3d')],'outboundOriginateFailureCallsDay':_0x9eb626[_0xde09('0x3e')],'outboundReCallsDay':_0x9eb626[_0xde09('0x3f')],'outboundRejectCallsDay':_0x9eb626[_0xde09('0x40')],'outboundUnknownCallsDay':_0x9eb626[_0xde09('0x41')],'outboundAbandonedCallsDay':_0x9eb626['outboundAbandonedCallsDay'],'predictiveIntervalAnsweredCalls':_0x9eb626[_0xde09('0x42')],'predictiveIntervalAvgHoldtime':_0x9eb626[_0xde09('0x43')],'predictiveIntervalAvgTalktime':_0x9eb626[_0xde09('0x44')],'predictiveIntervalDroppedCallsCallersExit':_0x9eb626[_0xde09('0x45')],'predictiveIntervalDroppedCallsTimeout':_0x9eb626[_0xde09('0x46')],'predictiveIntervalErlangCalls':_0x9eb626[_0xde09('0x47')],'predictiveIntervalErlangCallsDroppedCalls':_0x9eb626['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x9eb626[_0xde09('0x48')],'predictiveIntervalMultiplicativeFactor':_0x9eb626[_0xde09('0x49')],'predictiveIntervalPauses':_0x9eb626[_0xde09('0x4a')],'predictiveIntervalAvailable':_0x9eb626['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x9eb626[_0xde09('0x4b')],'message':_0x9eb626[_0xde09('0x4c')],'originated':_0x9eb626['originated'],'erlangCalls':_0x9eb626[_0xde09('0x4d')],'erlangCallToSecond':_0x9eb626['erlangCallToSecond'],'erlangAbandonmentRate':_0x9eb626['erlangAbandonmentRate'],'erlangBusyFactor':_0x9eb626[_0xde09('0x4e')],'startPredictive':_0x9eb626[_0xde09('0x4f')],'startProgressive':_0x9eb626[_0xde09('0x50')]};if(_0x9eb626['Trunk']){_0x21a8e5['Trunk']={'id':_0x9eb626[_0xde09('0x51')]['id'],'name':_0x9eb626['Trunk'][_0xde09('0x29')],'active':_0x9eb626['Trunk']['active'],'callerid':_0x9eb626[_0xde09('0x51')]['callerid']};}if(_0x9eb626['Interval']){_0x21a8e5['Interval']={'id':_0x9eb626['Interval']['id'],'name':_0x9eb626[_0xde09('0x52')][_0xde09('0x29')]};}var _0x1975ef=md5(JSON[_0xde09('0x53')](_0x21a8e5));if(_0x9eb626['md5']!==_0x1975ef){_0x9eb626[_0xde09('0x4')]=_0x1975ef;emit(util['format'](_0xde09('0x54'),_0x21a8e5['name']),_0xde09('0x55'),_0x21a8e5);}}}function emitVoiceQueueChannelRemove(_0x172d02){logger[_0xde09('0x56')](_0xde09('0x57'),JSON[_0xde09('0x53')](_0x172d02));emit(util['format'](_0xde09('0x54'),_0x172d02[_0xde09('0x29')]),_0xde09('0x58'),_0x172d02);}function notSendMessagesQueue(_0x542deb){if(_0x542deb[_0xde09('0x59')]){if(_0x542deb['originated']===0x0&&_0x542deb[_0xde09('0x5a')]===0x0){_0x542deb[_0xde09('0x59')]=![];_0x542deb[_0xde09('0x2b')]=0x0;_0x542deb[_0xde09('0x5b')]=0x0;_0x542deb[_0xde09('0x4c')]='NOT_ACTIVE';ut[_0xde09('0x5c')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x542deb['name']+_0xde09('0x5d'));}else{_0x542deb[_0xde09('0x4c')]=_0xde09('0x5e');ut[_0xde09('0x5c')](_0xde09('0x5f'),_0x542deb[_0xde09('0x29')]+_0xde09('0x60'));}emitCampaignPreview(_0x542deb);}}Preview[_0xde09('0xf')][_0xde09('0x28')]=function(){var _0x109537=this;setInterval(function(){_0x109537[_0xde09('0x61')]();},0x7cf);};Preview[_0xde09('0xf')][_0xde09('0x61')]=function(){var _0x3f8986=this['campaignsPreview'];this[_0xde09('0x17')]+=0x1;for(var _0x5caede in _0x3f8986){if(_0x3f8986[_0xde09('0x62')](_0x5caede)&&(_0x3f8986[_0x5caede][_0xde09('0x32')]===_0xde09('0x63')||_0x3f8986[_0x5caede][_0xde09('0x32')]===_0xde09('0x64'))&&_0x3f8986[_0x5caede][_0xde09('0x2e')]===_0xde09('0x65')){if(this['clockClearZombieChannels']>0x7){this[_0xde09('0x17')]=0x0;this[_0xde09('0x66')]();}}if(_0x3f8986[_0xde09('0x62')](_0x5caede)&&_0x3f8986[_0x5caede][_0xde09('0x32')]===_0xde09('0x63')&&_0x3f8986[_0x5caede]['type']==='outbound'){if(_0x3f8986[_0x5caede][_0xde09('0x67')]){this[_0xde09('0x68')](_0x3f8986[_0x5caede]);this['recallMe'](_0x3f8986[_0x5caede]);}else{notSendMessagesQueue(_0x3f8986[_0x5caede]);}}}};Preview[_0xde09('0xf')][_0xde09('0x69')]=function(_0x11fbbc){var _0x2d200b=this;this[_0xde09('0x12')][_0xde09('0x6a')](function(){if(!_[_0xde09('0x6b')](_0x2d200b[_0xde09('0x6c')][_0x11fbbc])){loggerAction[_0xde09('0x56')](_0xde09('0x6d'),_0x11fbbc,'Queue',_0x2d200b[_0xde09('0x6c')][_0x11fbbc]['queue'],_0xde09('0x6e'),JSON[_0xde09('0x53')](_0x2d200b[_0xde09('0x13')][_0x2d200b[_0xde09('0x6c')][_0x11fbbc][_0xde09('0x6f')]]['originated']),_0xde09('0x70'),JSON[_0xde09('0x53')](_0x2d200b[_0xde09('0x13')][_0x2d200b['actions'][_0x11fbbc][_0xde09('0x6f')]]['pTalking']),JSON['stringify'](_0x2d200b[_0xde09('0x6c')][_0x11fbbc][_0xde09('0x71')]),JSON[_0xde09('0x53')](_[_0xde09('0x72')](_0x2d200b[_0xde09('0x6c')][_0x11fbbc],[_0xde09('0x73'),_0xde09('0x74'),_0xde09('0x75'),_0xde09('0x76')])));return ami['Action']({'action':'status','channel':_0x2d200b[_0xde09('0x6c')][_0x11fbbc][_0xde09('0x77')]})[_0xde09('0x78')](function(_0x47f90a){if(_0x47f90a[_0xde09('0x4c')]===_0xde09('0x79')){setTimeout(function(){if(_0x2d200b['actions'][_0x11fbbc]){ut[_0xde09('0x7a')](_0x2d200b[_0xde09('0x13')][_0x2d200b[_0xde09('0x6c')][_0x11fbbc][_0xde09('0x6f')]],'[clearZombieChannel]');if(_0x2d200b[_0xde09('0x6c')][_0x11fbbc][_0xde09('0x71')]===!![]){ut[_0xde09('0x7b')](_0x2d200b['campaignsPreview'][_0x2d200b['actions'][_0x11fbbc][_0xde09('0x6f')]],_0xde09('0x7c'));ut[_0xde09('0x7d')]('[Dialer][checkChannel][pTalking][Preview]'+_0x11fbbc,_0x2d200b[_0xde09('0x6c')][_0x11fbbc][_0xde09('0x6f')]);}ut[_0xde09('0x7d')]('[Dialer][checkChannel][Preview]'+_0x11fbbc,_0x2d200b[_0xde09('0x6c')][_0x11fbbc][_0xde09('0x6f')]);delete _0x2d200b['actions'][_0x11fbbc];}},0x2328);}});}});};Preview['prototype']['clearZombieChannels']=function(){var _0x408cc0=this;loggerAction[_0xde09('0x56')](_0xde09('0x7e'),_[_0xde09('0x7f')](this[_0xde09('0x6c')]));for(var _0x56e93b in this[_0xde09('0x6c')]){if(_0x408cc0[_0xde09('0x6c')][_0xde09('0x62')](_0x56e93b)){_0x408cc0['clearZombieChannel'](_0x56e93b);}}};Preview['prototype'][_0xde09('0x80')]=function(_0x4e3c57){var _0x1cfecc=this;rpcDb[_0xde09('0x81')](_0x4e3c57['id'],ut[_0xde09('0x82')](this[_0xde09('0x16')]))[_0xde09('0x83')](function(_0x423abe){if(!_[_0xde09('0x6b')](_0x423abe)){for(var _0x503621=0x0;_0x503621<_0x423abe[_0xde09('0x84')];_0x503621+=0x1){if(ut[_0xde09('0x85')](_0x423abe[_0x503621][_0xde09('0x86')])<_0x4e3c57[_0xde09('0x87')]*0x3c){if(_0x423abe[_0x503621]['Agent']&&!_0x423abe[_0x503621][_0xde09('0x88')][_0xde09('0x89')]){_0x1cfecc['run'](_0x423abe[_0x503621]['id'])[_0xde09('0x83')](ut[_0xde09('0x8a')](_0xde09('0x8b')))[_0xde09('0x78')](ut[_0xde09('0x8a')](_0xde09('0x8b')));}else{rpcDb['disableContact'](_0x423abe[_0x503621]['id']);}}else{var _0x329a3c=new Action(_0x423abe[_0x503621],_0x4e3c57);_0x329a3c[_0xde09('0x8c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x4e3c57[_0xde09('0x3f')]+=0x1;ut[_0xde09('0x8d')](_0x329a3c,0x17,_0xde09('0x8e'));if(_0x4e3c57[_0xde09('0x8f')]){rpcDb[_0xde09('0x90')](ut[_0xde09('0x91')](_0x423abe[_0x503621]));rpcDb['createCustomerHistory'](_0x329a3c,_0xde09('0x92'));}else{ut['logCustomer'](_0x329a3c,0x16,_0xde09('0x93'));rpcDb[_0xde09('0x94')](_0x329a3c,_0xde09('0x95'));rpcDb['createCustomerFinal'](_0x329a3c,_0xde09('0x95'));}}}}})[_0xde09('0x78')](ut[_0xde09('0x8a')](_0xde09('0x96')));};Preview[_0xde09('0xf')]['setMessage']=function(_0x415c07){_0x415c07[_0xde09('0x59')]=!![];if(ut[_0xde09('0x97')](_0x415c07[_0xde09('0x2c')])){_0x415c07[_0xde09('0x4c')]='AGENTS_NOT_LOGGED';}else if(!ut[_0xde09('0x98')](_0x415c07['dialActive'])){_0x415c07[_0xde09('0x4c')]='NOT_ACTIVE';}else if(!this[_0xde09('0x99')](_0x415c07['Trunk'])){if(!this[_0xde09('0x99')](_0x415c07[_0xde09('0x9a')])){_0x415c07['message']=_0xde09('0x9b');}else{_0x415c07[_0xde09('0x4c')]=_0xde09('0x9c');}}else{_0x415c07[_0xde09('0x4c')]='ACTIVE';}emitCampaignPreview(_0x415c07);};Preview[_0xde09('0xf')][_0xde09('0x9d')]=function(_0x258b78,_0x5c5cc2,_0xba476c){var _0x56147c=this;var _0x3e4dcf=this['actions'][_0x5c5cc2];var _0x1eb4f9=this[_0xde09('0x13')][_0x3e4dcf[_0xde09('0x6f')]];var _0x9352a6;if(_0x1eb4f9){switch(_0xba476c){case'1':_0x1eb4f9['outboundNoSuchCallsDay']+=0x1;_0x3e4dcf[_0xde09('0x9e')]=ut[_0xde09('0x9f')](_0x3e4dcf);ut[_0xde09('0x8d')](_0x3e4dcf,0x0,_0xde09('0xa0'));rpcDb[_0xde09('0x94')](_0x3e4dcf,_0xde09('0xa1'));if(ut['totalGlobal'](_0x3e4dcf)>=_0x1eb4f9['dialGlobalMaxRetry']){_0x9352a6=ut['cloneAction'](_0x3e4dcf,0xf,_0xde09('0xa2'));rpcDb[_0xde09('0xa3')](_0x9352a6,_0xde09('0xa4'));}else{if(_0x3e4dcf[_0xde09('0xa5')]>=_0x1eb4f9[_0xde09('0xa6')]){rpcDb[_0xde09('0xa3')](_0x3e4dcf,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb[_0xde09('0xa7')](ut[_0xde09('0xa8')](_0x3e4dcf,'countnosuchnumberretry',_0x1eb4f9['dialNoSuchNumberRetryFrequency']),_0x3e4dcf[_0xde09('0xa9')],_0x3e4dcf[_0xde09('0xaa')]);}}delete this[_0xde09('0x6c')][_0x258b78[_0xde09('0xab')]];break;case _0xde09('0xac'):var _0x9149f5=moment()[_0xde09('0xad')](_0xde09('0xae'));_0x3e4dcf['responsetime']=_0x9149f5;_0x3e4dcf[_0xde09('0xaf')]=_0x9149f5;_0x3e4dcf[_0xde09('0x71')]=!![];_0x1eb4f9[_0xde09('0x5a')]+=0x1;logger[_0xde09('0x56')](_0xde09('0xb0'),_0x3e4dcf[_0xde09('0xb1')],'\x20Queue',_0x1eb4f9[_0xde09('0x29')],'pTalking:\x20',_0x1eb4f9['pTalking']);ami[_0xde09('0xb2')]('custom:agentconnect',ut[_0xde09('0xb3')](_0x3e4dcf,_0xde09('0xb4')));if(_0x1eb4f9[_0xde09('0xb5')]){ami['emit']('custom:agentConnectPreview',ut[_0xde09('0xb6')](_0x3e4dcf));}break;case'16':ami[_0xde09('0xb2')](_0xde09('0xb7'),ut[_0xde09('0xb3')](_0x3e4dcf,_0xde09('0xb8')));emitVoiceQueueChannelRemove(ut['buildObj'](_0x3e4dcf,_0xde09('0xb8')));_0x1eb4f9[_0xde09('0x37')]+=0x1;_0x1eb4f9['total']+=0x1;_0x1eb4f9['answered']+=0x1;ut['decrementTalkink'](_0x1eb4f9,_0xde09('0xb9'));_0x3e4dcf[_0xde09('0x9e')]=ut[_0xde09('0x9f')](_0x3e4dcf);ut[_0xde09('0x8d')](_0x3e4dcf,0x4,'Answer');rpcDb['createCustomerHistory'](_0x3e4dcf,'[callProgressDetectingCustomer][logAnswer]');rpcDb['createCustomerFinal'](_0x3e4dcf,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb[_0xde09('0xba')](_0x3e4dcf);_0x1eb4f9[_0xde09('0xbb')]+=_0x3e4dcf[_0xde09('0xbc')];_0x1eb4f9[_0xde09('0xbd')]+=_0x3e4dcf[_0xde09('0xbc')];logger[_0xde09('0x56')](_0xde09('0xbe'),_0x3e4dcf[_0xde09('0xb1')],_0xde09('0xbf'),_0x1eb4f9[_0xde09('0x29')],_0xde09('0x70'),_0x1eb4f9['pTalking']);delete this[_0xde09('0x6c')][_0x258b78['linkedid']];break;case _0xde09('0xc0'):_0x1eb4f9[_0xde09('0x39')]+=0x1;_0x3e4dcf[_0xde09('0xc1')]+=0x1;_0x3e4dcf[_0xde09('0x9e')]=ut[_0xde09('0x9f')](_0x3e4dcf);ut[_0xde09('0x8d')](_0x3e4dcf,0x5,_0xde09('0xc2'));rpcDb['createCustomerHistory'](_0x3e4dcf,'[callProgressDetectingCustomer][logBusy]');if(ut['totalGlobal'](_0x3e4dcf)>=_0x1eb4f9[_0xde09('0xc3')]){_0x9352a6=ut[_0xde09('0xc4')](_0x3e4dcf,0xf,_0xde09('0xa2'));rpcDb['createCustomerFinal'](_0x9352a6,_0xde09('0xc5'));}else{if(_0x3e4dcf[_0xde09('0xc1')]>=_0x1eb4f9[_0xde09('0xc6')]){rpcDb[_0xde09('0xa3')](_0x3e4dcf,_0xde09('0xc7'));}else{rpcDb['rescheduleContact'](ut[_0xde09('0xa8')](_0x3e4dcf,_0xde09('0xc1'),_0x1eb4f9['dialBusyRetryFrequency']),_0x3e4dcf[_0xde09('0xa9')],_0x3e4dcf['activeContact']);}}break;case _0xde09('0xc8'):_0x1eb4f9[_0xde09('0x3c')]+=0x1;_0x3e4dcf[_0xde09('0xc9')]+=0x1;_0x3e4dcf[_0xde09('0x9e')]=ut[_0xde09('0x9f')](_0x3e4dcf);ut['logCustomer'](_0x3e4dcf,0x3,'NoAnswer');rpcDb['createCustomerHistory'](_0x3e4dcf,_0xde09('0xca'));if(ut[_0xde09('0x9f')](_0x3e4dcf)>=_0x1eb4f9[_0xde09('0xc3')]){_0x9352a6=ut['cloneAction'](_0x3e4dcf,0xf,_0xde09('0xa2'));rpcDb[_0xde09('0xa3')](_0x9352a6,_0xde09('0xcb'));}else{if(_0x3e4dcf[_0xde09('0xc9')]>=_0x1eb4f9['dialNoAnswerMaxRetry']){rpcDb['createCustomerFinal'](_0x3e4dcf,_0xde09('0xca'));}else{rpcDb[_0xde09('0xa7')](ut['scheduledAt'](_0x3e4dcf,_0xde09('0xc9'),_0x1eb4f9['dialNoAnswerRetryFrequency']),_0x3e4dcf[_0xde09('0xa9')],_0x3e4dcf['activeContact']);}}break;case _0xde09('0xcc'):_0x1eb4f9[_0xde09('0xcd')]+=0x1;_0x3e4dcf[_0xde09('0xce')]+=0x1;_0x3e4dcf['countglobal']=ut[_0xde09('0x9f')](_0x3e4dcf);ut['logCustomer'](_0x3e4dcf,0x8,'Congestion');rpcDb[_0xde09('0x94')](_0x3e4dcf,_0xde09('0xcf'));if(ut[_0xde09('0x9f')](_0x3e4dcf)>=_0x1eb4f9[_0xde09('0xc3')]){_0x9352a6=ut[_0xde09('0xc4')](_0x3e4dcf,0xf,_0xde09('0xa2'));rpcDb[_0xde09('0xa3')](_0x9352a6,_0xde09('0xd0'));}else{if(_0x3e4dcf[_0xde09('0xce')]>=_0x1eb4f9[_0xde09('0xd1')]){rpcDb[_0xde09('0xa3')](_0x3e4dcf,_0xde09('0xcf'));}else{rpcDb[_0xde09('0xa7')](ut['scheduledAt'](_0x3e4dcf,'countcongestionretry',_0x1eb4f9['dialBusyRetryFrequency']),_0x3e4dcf['unlockAgent'],_0x3e4dcf[_0xde09('0xaa')]);}}break;case _0xde09('0xd2'):_0x1eb4f9[_0xde09('0x40')]+=0x1;_0x3e4dcf[_0xde09('0x9e')]=ut['totalGlobal'](_0x3e4dcf);ut[_0xde09('0x8d')](_0x3e4dcf,0x14,_0xde09('0xd3'));rpcDb[_0xde09('0x94')](_0x3e4dcf,_0xde09('0xd4'));if(_0x3e4dcf[_0xde09('0xa9')]){rpcDb[_0xde09('0xd5')](_0x3e4dcf[_0xde09('0xd6')]);}if(_0x3e4dcf[_0xde09('0xaa')]){rpcDb['disableContact'](_0x3e4dcf[_0xde09('0xd6')]);}break;case'ABANDONED':_0x1eb4f9[_0xde09('0xd7')]+=0x1;_0x3e4dcf[_0xde09('0xd8')]+=0x1;_0x3e4dcf[_0xde09('0x9e')]=ut[_0xde09('0x9f')](_0x3e4dcf);ut[_0xde09('0x8d')](_0x3e4dcf,0xb,'Abandoned');rpcDb[_0xde09('0x94')](_0x3e4dcf,_0xde09('0xd9'));if(ut[_0xde09('0x9f')](_0x3e4dcf)>=_0x1eb4f9['dialGlobalMaxRetry']){_0x9352a6=ut['cloneAction'](_0x3e4dcf,0xf,_0xde09('0xa2'));rpcDb[_0xde09('0xa3')](_0x9352a6,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x3e4dcf[_0xde09('0xda')]>=_0x1eb4f9[_0xde09('0xdb')]){rpcDb[_0xde09('0xa3')](_0x3e4dcf,_0xde09('0xd9'));}else{rpcDb[_0xde09('0xa7')](ut[_0xde09('0xa8')](_0x3e4dcf,_0xde09('0xd8'),_0x1eb4f9[_0xde09('0xdc')]),_0x3e4dcf[_0xde09('0xa9')],_0x3e4dcf[_0xde09('0xaa')]);}}break;default:if(_0x3e4dcf[_0xde09('0x71')]){ut['decrementTalkink'](_0x1eb4f9,_0xde09('0xdd'));ut[_0xde09('0x7d')](_0xde09('0xde')+_0x1eb4f9['name'],_0x258b78);}_0x1eb4f9['outboundUnknownCallsDay']+=0x1;_0x3e4dcf[_0xde09('0x9e')]=ut[_0xde09('0x9f')](_0x3e4dcf);ut[_0xde09('0x8d')](_0x3e4dcf,0xc,_0x258b78[_0xde09('0xdf')]||_0x258b78[_0xde09('0xe0')]);rpcDb[_0xde09('0x94')](_0x3e4dcf,_0xde09('0xe1'));if(ut[_0xde09('0x9f')](_0x3e4dcf)>=_0x1eb4f9[_0xde09('0xc3')]){_0x9352a6=ut['cloneAction'](_0x3e4dcf,0xf,_0xde09('0xa2'));rpcDb[_0xde09('0xa3')](_0x9352a6,_0xde09('0xe2'));}else{rpcDb['createCustomerFinal'](_0x3e4dcf,_0xde09('0xe2'));}delete this[_0xde09('0x6c')][_0x258b78[_0xde09('0xab')]];}if(!(_0x3e4dcf[_0xde09('0x71')]&&_0xba476c==='16')){ut['updateOriginated'](_0x1eb4f9,_0xde09('0xe3'));logger[_0xde09('0x56')]('[originated][decrement][callProgressDetectingCustomer]',_0x3e4dcf[_0xde09('0xb1')],'\x20Queue',_0x1eb4f9[_0xde09('0x29')],_0xde09('0x6e'),_0x1eb4f9['originated']);}if(_0xba476c!=='ANSWER'){delete this[_0xde09('0x6c')][_0x258b78[_0xde09('0xab')]];delete this[_0xde09('0x6c')][_0x258b78['destlinkedid']];}}};Preview[_0xde09('0xf')]['callProgressDetectingAgent']=function(_0x2b5ffb,_0xeb4c92,_0x4f53a3){if(_[_0xde09('0xe4')](_0xeb4c92)&&_0xde09('0xe5')!==typeof _0xeb4c92){return;}if(_['isUndefined'](_0x4f53a3)&&_0xde09('0xe5')!==typeof _0x4f53a3){return;}switch(_0x4f53a3[_0xde09('0xe6')]){case'0':ut[_0xde09('0xe7')](_0x2b5ffb,0x0,_0xde09('0xa0'));rpcDb[_0xde09('0xe8')](_0x2b5ffb,_0xde09('0xe9'));break;case'3':ut['logAgent'](_0x2b5ffb,0x3,_0xde09('0xea'));rpcDb[_0xde09('0xe8')](_0x2b5ffb,_0xde09('0xeb'));break;case'5':ut['logAgent'](_0x2b5ffb,0x5,'Busy');rpcDb[_0xde09('0xe8')](_0x2b5ffb,_0xde09('0xec'));break;case'8':ut[_0xde09('0xe7')](_0x2b5ffb,0x8,_0xde09('0xed'));rpcDb[_0xde09('0xe8')](_0x2b5ffb,_0xde09('0xee'));break;case'22':ut[_0xde09('0xe7')](_0x2b5ffb,0x16,'AnswerAGI');rpcDb[_0xde09('0xe8')](_0x2b5ffb,_0xde09('0xef'));break;default:ut[_0xde09('0xe7')](_0x2b5ffb,0xc,_0x4f53a3[_0xde09('0xe6')]);rpcDb[_0xde09('0xe8')](_0x2b5ffb,_0xde09('0xee'));}ut[_0xde09('0x7a')](_0xeb4c92,_0xde09('0xf0'));logger[_0xde09('0x56')](_0xde09('0xf1'),_0x2b5ffb[_0xde09('0xb1')],'\x20Queue',_0xeb4c92[_0xde09('0x29')],_0xde09('0x6e'),_0xeb4c92[_0xde09('0xf2')]);delete this['actions'][_0x2b5ffb[_0xde09('0xb1')]];};Preview[_0xde09('0xf')][_0xde09('0xf3')]=function(_0x3055b0,_0x57b14c,_0x76feb3,_0x42e36e,_0xed366f){var _0x3d13f3=this;return new BPromise(function(_0x4ff2ac,_0x34c5eb){if(_['isNil'](_0x57b14c)||_[_0xde09('0x6b')](_0x57b14c[_0xde09('0xf4')])||_[_0xde09('0x6b')](_0x57b14c[_0xde09('0xf4')][_0xde09('0xf5')])||_[_0xde09('0x6b')](_0x57b14c[_0xde09('0x75')])){_0x34c5eb(ut[_0xde09('0x4c')](_0xde09('0xf6'),_0x42e36e,_0xed366f));return;}var _0x4f023f=uuid['v4']();var _0x673870=_0x3d13f3[_0xde09('0x13')][_0x57b14c[_0xde09('0xf7')][_0xde09('0x29')]];var _0x285955=_0x76feb3?_0x3d13f3[_0xde09('0x16')][_0x76feb3]['id']:undefined;_0x3d13f3[_0xde09('0x6c')][_0x4f023f]=new Action(_0x57b14c,_0x673870,_0x4f023f,_0x76feb3,_0x285955);var _0x26731d=_0x3d13f3[_0xde09('0x6c')][_0x4f023f];_0x26731d[_0xde09('0xa9')]=_0x42e36e;_0x26731d[_0xde09('0xaa')]=_0xed366f;_0x26731d[_0xde09('0xf8')]=_0x76feb3;if(_[_0xde09('0xf9')](_0x3055b0)){_0x3d13f3[_0xde09('0xfa')](_0x26731d,_0x673870,_0x57b14c,_0x76feb3)['then'](function(_0x330e22){logger[_0xde09('0x56')]('[Preview][execCall][success]',_0xde09('0xfb')+_0x26731d[_0xde09('0x6f')]+_0xde09('0xfc')+_0x26731d[_0xde09('0xd6')],JSON['stringify'](_0x330e22));ami[_0xde09('0xb2')](_0xde09('0xfd'),ut[_0xde09('0xb3')](_0x26731d,_0xde09('0xfe')));_0x4ff2ac(ut['message'](_0xde09('0xff')));})[_0xde09('0x78')](function(_0x3e0154){ut[_0xde09('0x5c')]('[Preview][execCall][failure]',_0x3e0154);_0x34c5eb(ut['message']('Call\x20failed',_0x42e36e,_0xed366f));});}else{_0x673870['outboundBlacklistCallsDay']+=0x1;ut['logBlacklist'](_0x26731d);rpcDb[_0xde09('0x100')](_0x26731d,'[Blacklist][error]');delete _0x3d13f3[_0xde09('0x6c')][_0x4f023f];_0x34c5eb(ut[_0xde09('0x4c')]('Contact\x20in\x20black\x20List',_0x42e36e,_0xed366f));}});};Preview[_0xde09('0xf')][_0xde09('0x99')]=function(_0x1316ee){return!_[_0xde09('0x6b')](_0x1316ee)&&!_[_0xde09('0x6b')](_0x1316ee[_0xde09('0x29')])&&!_[_0xde09('0x6b')](_0x1316ee[_0xde09('0x101')])&&_0x1316ee[_0xde09('0x101')]&&!_['isNil'](this[_0xde09('0x15')][util['format'](_0xde09('0x102'),_0x1316ee[_0xde09('0x29')])])&&!_[_0xde09('0x6b')](this[_0xde09('0x15')][util[_0xde09('0xad')](_0xde09('0x102'),_0x1316ee[_0xde09('0x29')])][_0xde09('0x103')])&&(this[_0xde09('0x15')][util['format']('SIP/%s',_0x1316ee[_0xde09('0x29')])][_0xde09('0x103')]===_0xde09('0x104')||this[_0xde09('0x15')][util[_0xde09('0xad')](_0xde09('0x102'),_0x1316ee[_0xde09('0x29')])]['status']===_0xde09('0x105'));};Preview[_0xde09('0xf')][_0xde09('0x106')]=function(_0x174419,_0x297dfe){var _0x1fbc92=this;return new BPromise(function(_0xa6d1b4,_0x376b87){_0x1fbc92[_0xde09('0x107')](_0x174419,_0x297dfe)[_0xde09('0x83')](function(_0xcc6b58){_0xa6d1b4(_['pick'](_0xcc6b58,[_0xde09('0x4c')]));})['catch'](function(_0x1ad3d3){if(_0x1ad3d3[_0xde09('0x108')]){rpcDb[_0xde09('0xd5')](_0x174419);}if(_0x1ad3d3[_0xde09('0x101')]){rpcDb[_0xde09('0x109')](_0x174419);}_0x376b87(_[_0xde09('0x72')](_0x1ad3d3,[_0xde09('0x4c')]));});});};Preview['prototype']['execRun']=function(_0x397cf5,_0x1dda45){var _0x2a2d5d=this;return new BPromise(function(_0x1e0dfe,_0x4e07d0){var _0x408809,_0x1af3ed;rpcDb[_0xde09('0x10a')](_0x397cf5)[_0xde09('0x83')](function(_0x487b7b){if(!_[_0xde09('0x6b')](_0x487b7b[0x0])){_0x1af3ed=_0x487b7b[0x0]['recallme']?![]:!![];_0x408809=_0x487b7b[0x0][_0xde09('0x10b')]?!![]:![];_0x408809=_0x1dda45?!![]:_0x408809;}var _0x67612b=_0x2a2d5d[_0xde09('0x10c')](_0x487b7b);if(_0x67612b[_0xde09('0x10d')]){rpcDb[_0xde09('0x10e')](_['pick'](_0x487b7b[0x0],['VoiceQueueId',_0xde09('0x10f')]))[_0xde09('0x83')](function(_0xed3d0){_0x2a2d5d['checkInBlack'](_0xed3d0,_0x487b7b[0x0],_0x1dda45,_0x1af3ed,_0x408809)['then'](function(_0x369dd2){_0x1e0dfe(_0x369dd2);})[_0xde09('0x78')](function(_0x109bb5){_0x4e07d0(_0x109bb5);});})['catch'](function(_0x52c607){ut['logger'](_0xde09('0x110'),_0x52c607);_0x4e07d0(ut[_0xde09('0x4c')]('Call\x20unsuccessful',_0x1af3ed,_0x408809));});}else{_0x4e07d0(ut['message'](_0x67612b[_0xde09('0x4c')],_0x1af3ed,_0x408809));}})[_0xde09('0x78')](function(_0x564c27){ut['logger'](_0xde09('0x111'),_0x564c27);_0x4e07d0(ut[_0xde09('0x4c')](_0xde09('0x112'),![],!![]));});});};Preview[_0xde09('0xf')]['validateContact']=function(_0xbe25fd){if(_[_0xde09('0x6b')](_0xbe25fd)||_[_0xde09('0xf9')](_0xbe25fd)||!_['isNil'](_0xbe25fd[0x0][_0xde09('0x88')])&&_[_0xde09('0x6b')](_0xbe25fd[0x0][_0xde09('0x88')][_0xde09('0x29')])){ut[_0xde09('0x5c')](_0xde09('0x113'),_0xbe25fd);return{'isValid':![],'message':_0xde09('0x114')};}var _0x37c801=this[_0xde09('0x13')][_0xbe25fd[0x0][_0xde09('0xf7')][_0xde09('0x29')]];_0x37c801['message']=_0xde09('0x9c');if(_['isNil'](_0x37c801)){ut[_0xde09('0x5c')](_0xde09('0x115'),_0x37c801);return{'isValid':![],'message':_0xde09('0x116')};}if(!this['isTrunkReachable'](_0x37c801[_0xde09('0x51')])){ut[_0xde09('0x5c')](_0xde09('0x117'),_0xde09('0x118')+_0x37c801['name']+_0xde09('0x119'));if(!this[_0xde09('0x99')](_0x37c801['TrunkBackup'])){ut[_0xde09('0x5c')](_0xde09('0x117'),_0x37c801['name']+_0xde09('0x11a'));return{'isValid':![],'message':_0xde09('0x11b')};}}if(!ut['isActive'](_0x37c801[_0xde09('0x67')])){ut['logger'](_0xde09('0x11c'),_0x37c801[_0xde09('0x29')]+'\x20Not\x20Active');return{'isValid':![],'message':_0xde09('0x118')+_0x37c801['name']+'\x20Not\x20Active'};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview['prototype'][_0xde09('0xfa')]=function(_0x3edc57,_0x59930a,_0x104273,_0x588326){var _0x58ebfe=this;return new BPromise(function(_0x13c4c4,_0x3d834c){var _0x1a84c3=_0x3edc57[_0xde09('0xb1')];var _0x1cf3b8=_0x58ebfe[_0xde09('0x99')](_0x59930a[_0xde09('0x51')])?util[_0xde09('0xad')](_0xde09('0x11d'),_0x59930a[_0xde09('0x51')]['name'],_[_0xde09('0x6b')](_0x59930a[_0xde09('0x35')])?'':_0x59930a['dialPrefix'][_0xde09('0x11e')]()||'',_0x59930a[_0xde09('0x11f')]>0x0?_0x104273[_0xde09('0xf4')][_0xde09('0xf5')]['substring'](_0x59930a[_0xde09('0x11f')]):_0x104273[_0xde09('0xf4')][_0xde09('0xf5')]):util[_0xde09('0xad')](_0xde09('0x11d'),_[_0xde09('0x6b')](_0x59930a[_0xde09('0x9a')])?_0x59930a[_0xde09('0x51')][_0xde09('0x29')]:_0x59930a[_0xde09('0x9a')][_0xde09('0x29')],_['isNil'](_0x59930a[_0xde09('0x35')])?'':_0x59930a[_0xde09('0x35')][_0xde09('0x11e')]()||'',_0x59930a[_0xde09('0x11f')]>0x0?_0x104273[_0xde09('0xf4')][_0xde09('0xf5')][_0xde09('0x120')](_0x59930a['dialCutDigit']):_0x104273[_0xde09('0xf4')][_0xde09('0xf5')]);var _0x8c444=_0x58ebfe[_0xde09('0x99')](_0x59930a[_0xde09('0x51')])?ut['getCallerId'](_0x59930a[_0xde09('0x51')]['callerid'],_0x59930a[_0xde09('0x121')],_0x59930a[_0xde09('0x122')]>0x0?ut['getCallerIdRandom'](_0x59930a[_0xde09('0x33')],_0x59930a['dialRandomLastDigitCallerIdNumber']):_0x59930a[_0xde09('0x33')]):ut[_0xde09('0x123')](_[_0xde09('0x6b')](_0x59930a[_0xde09('0x9a')])?_0x59930a[_0xde09('0x51')][_0xde09('0x124')]:_0x59930a[_0xde09('0x9a')]['callerid'],_0x59930a[_0xde09('0x121')],_0x59930a['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0xde09('0x125')](_0x59930a['dialOriginateCallerIdNumber'],_0x59930a[_0xde09('0x122')]):_0x59930a[_0xde09('0x33')]);if(_0x8c444){_0x3edc57[_0xde09('0x126')]=ut[_0xde09('0x127')](_0x8c444);_0x3edc57['originatecalleridnum']=ut['extractCalleridNumber'](_0x8c444);}var _0x18ff78=ut[_0xde09('0x128')](_0x59930a,_0x104273,_0x1cf3b8,_0x8c444,_0x1a84c3,_0x3edc57);_[_0xde09('0x129')](_0x3edc57,ut['toLowerVariables'](_0x18ff78));_0x3edc57[_0xde09('0x8c')]=moment()[_0xde09('0xad')](_0xde09('0xae'));ami[_0xde09('0x12a')](ut['variablesAction'](_0x3edc57,_0x59930a,_0x18ff78,_0x3edc57[_0xde09('0xaa')],_0x588326))[_0xde09('0x83')](function(_0x2efdbb){_0x59930a[_0xde09('0xf2')]+=0x1;logger[_0xde09('0x56')](_0xde09('0x12b'),_0x1a84c3,_0xde09('0xbf'),_0x59930a['name'],'originated:\x20',_0x59930a[_0xde09('0xf2')]);_0x13c4c4(_0x2efdbb);})[_0xde09('0x78')](function(_0xfbecc8){ut[_0xde09('0xe7')](_0x3edc57,0xe,_0xde09('0x12c'));rpcDb[_0xde09('0xe8')](_0x3edc57,_0xde09('0x12d'));_0x3d834c(_0xfbecc8);});});};Preview[_0xde09('0xf')]['syncNewExten']=function(_0x498a8d){if(this['actions'][_0x498a8d[_0xde09('0xab')]]){this[_0xde09('0x6c')][_0x498a8d[_0xde09('0xab')]][_0xde09('0x77')]=_0x498a8d['channel'];}};Preview[_0xde09('0xf')][_0xde09('0x19')]=function(_0xd45b33){var _0x42c1f6=this;var _0xabe2a5=this[_0xde09('0x6c')][_0xd45b33[_0xde09('0x12e')]];if(_0xabe2a5){if(_0xabe2a5['lookAgent']&&this[_0xde09('0x16')][_0xabe2a5[_0xde09('0xf8')]]){ut['logLookAgent'](_0xabe2a5,this[_0xde09('0x16')][_0xabe2a5[_0xde09('0xf8')]][_0xde09('0x29')],this[_0xde09('0x16')][_0xabe2a5[_0xde09('0xf8')]]['id']);}var _0x1ac4de=_[_0xde09('0x12f')](_0xabe2a5);_0x1ac4de[_0xde09('0x130')]=moment()['format'](_0xde09('0xae'));var _0x38d8a0=_0x42c1f6['campaignsPreview'][_0xabe2a5[_0xde09('0x6f')]];if(ut['isFailure'](_0xd45b33[_0xde09('0x131')])){if(_0xabe2a5[_0xde09('0xa9')]){rpcDb[_0xde09('0xd5')](_0xabe2a5[_0xde09('0xd6')]);}if(_0xabe2a5[_0xde09('0xaa')]){rpcDb[_0xde09('0x109')](_0xabe2a5[_0xde09('0xd6')]);}ami[_0xde09('0xb2')](_0xde09('0x132'),ut[_0xde09('0xb3')](_0xabe2a5,_0xde09('0x133')));this[_0xde09('0x134')](_0x1ac4de,_0x38d8a0,_0xd45b33);}else{_0xabe2a5[_0xde09('0x8c')]=moment()[_0xde09('0xad')](_0xde09('0xae'));ut[_0xde09('0xe7')](_0x1ac4de,0x4,_0xde09('0x135'));rpcDb[_0xde09('0xe8')](_0x1ac4de,_0xde09('0x136'));}}};Preview[_0xde09('0xf')][_0xde09('0x1c')]=function(_0x1ac263){var _0x3d5ce4=this;var _0x1a3d46=this[_0xde09('0x6c')][_0x1ac263[_0xde09('0xab')]];var _0xc20b8d;if(_0x1a3d46){_0xc20b8d=this[_0xde09('0x13')][_0x1a3d46[_0xde09('0x6f')]];logger[_0xde09('0x56')]('[syncHangup][talking]',_0x1ac263['linkedid'],_0xde09('0xbf'),_0xc20b8d['name'],_0xde09('0x70'),_0xc20b8d['pTalking']);}if(this[_0xde09('0x6c')][_0x1ac263['linkedid']]&&_0x1ac263[_0xde09('0xab')]!==_0x1ac263[_0xde09('0xb1')]){if(_0x1ac263['cause']==='16'&&this['actions'][_0x1ac263[_0xde09('0xab')]][_0xde09('0x71')]){this[_0xde09('0x9d')](_0x1ac263,_0x1ac263['linkedid'],_0x1ac263[_0xde09('0x137')]);}else if(this[_0xde09('0x6c')][_0x1ac263['linkedid']][_0xde09('0x71')]){logger[_0xde09('0x56')](_0xde09('0x138'),_0x1ac263[_0xde09('0xab')],_0x1ac263['cause'],_0xde09('0xbf'),_0xc20b8d[_0xde09('0x29')],_0xde09('0x70'),_0xc20b8d[_0xde09('0x5a')]);this[_0xde09('0x9d')](_0x1ac263,_0x1ac263[_0xde09('0xab')],_0x1ac263[_0xde09('0x137')]);}}else if(_0x1a3d46&&_[_0xde09('0x6b')](_0x1a3d46[_0xde09('0x139')])&&_0xc20b8d['dialQueueProject']&&_0x1ac263[_0xde09('0xab')]===_0x1ac263[_0xde09('0xb1')]&&_[_0xde09('0x6b')](_0x1ac263[_0xde09('0xe6')])&&_0x1ac263[_0xde09('0x137')]==='16'&&_0x1ac263['channelstate']==='6'&&_[_0xde09('0xe4')](_0x1a3d46[_0xde09('0x13a')])){if(_0x1a3d46[_0xde09('0xa9')]){rpcDb[_0xde09('0xd5')](_0x1a3d46[_0xde09('0xd6')]);}if(_0x1a3d46['activeContact']){rpcDb['disableContact'](_0x1a3d46[_0xde09('0xd6')]);}_0x1ac263[_0xde09('0xe6')]='22';this[_0xde09('0x134')](_0x1a3d46,_0xc20b8d,_0x1ac263);}else if(_0x1a3d46&&_0x1a3d46[_0xde09('0x13a')]){if(_0x1ac263[_0xde09('0x137')]==='16'&&this[_0xde09('0x6c')][_0x1ac263[_0xde09('0xab')]]['dialAnswer']){logger['info']('[syncHangup][talking][transfer]',_0x1ac263[_0xde09('0xab')],_0x1ac263['cause'],_0xde09('0xbf'),_0xc20b8d[_0xde09('0x29')],_0xde09('0x70'),_0xc20b8d[_0xde09('0x5a')]);this['callProgressDetectingCustomer'](_0x1ac263,_0x1ac263[_0xde09('0xab')],_0x1ac263[_0xde09('0x137')]);}else if(this['actions'][_0x1ac263[_0xde09('0xab')]][_0xde09('0x71')]){logger[_0xde09('0x56')](_0xde09('0x138'),_0x1ac263['linkedid'],_0x1ac263[_0xde09('0x137')],'\x20Queue',_0xc20b8d['name'],_0xde09('0x70'),_0xc20b8d[_0xde09('0x5a')]);this[_0xde09('0x9d')](_0x1ac263,_0x1ac263['linkedid'],_0x1ac263['cause']);}}};Preview[_0xde09('0xf')][_0xde09('0x20')]=function(_0x56aee7){if(this['actions'][_0x56aee7['destlinkedid']]&&_0x56aee7[_0xde09('0x13b')]!==_0x56aee7['destuniqueid']){this[_0xde09('0x9d')](_0x56aee7,_0x56aee7['destlinkedid'],_0x56aee7[_0xde09('0xe0')]);}};Preview[_0xde09('0xf')]['syncHangupRequest']=function(_0x598b2d){if(this[_0xde09('0x6c')][_0x598b2d['linkedid']]&&_0x598b2d['linkedid']!==_0x598b2d[_0xde09('0xb1')]&&!this['actions'][_0x598b2d['linkedid']][_0xde09('0x71')]){if(_0x598b2d['cause']==='1'){this[_0xde09('0x9d')](_0x598b2d,_0x598b2d[_0xde09('0xab')],_0x598b2d[_0xde09('0x137')]);}}};Preview[_0xde09('0xf')]['addVariable']=function(_0x442341,_0x12b586,_0xafc8a6){if(this[_0xde09('0x6c')][_0x442341]){if(_[_0xde09('0x6b')](this[_0xde09('0x6c')][_0x442341][_0xde09('0x13c')])){this['actions'][_0x442341][_0xde09('0x13c')]={};}this['actions'][_0x442341][_0xde09('0x13c')][_0x12b586]=_0xafc8a6;}};Preview['prototype'][_0xde09('0x24')]=function(_0x2b33aa){try{if(!_[_0xde09('0x6b')](_0x2b33aa)){if(ut[_0xde09('0x13d')](_[_0xde09('0x13e')](_0x2b33aa[_0xde09('0x13f')])[0x0])){this[_0xde09('0x140')](_0x2b33aa[_0xde09('0xb1')],_[_0xde09('0x13e')](_0x2b33aa[_0xde09('0x13f')])[0x0],_0x2b33aa['value']);}}}catch(_0x37cdac){logger['error'](_0xde09('0x141'),util[_0xde09('0x142')](_0x37cdac,{'showHidden':![],'depth':null}));}};Preview[_0xde09('0xf')][_0xde09('0x26')]=function(_0x17f9c7){if(_0x17f9c7){if(this[_0xde09('0x6c')][_0x17f9c7['transfertargetlinkedid']]){this[_0xde09('0x6c')][_0x17f9c7['transfertargetlinkedid']][_0xde09('0x13a')]=!![];}}};Preview[_0xde09('0xf')][_0xde09('0x143')]=function(_0x503406){if(_0x503406){if(this['actions'][_0x503406[_0xde09('0x144')]]){this['actions'][_0x503406[_0xde09('0x144')]][_0xde09('0x13a')]=!![];}}};module[_0xde09('0x145')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index a79d798..59bd53b 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 _0x0fda=['UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','answertime','connectedlinename','from-sip','xcally-motion-preview','holdtime','assigned','lastAssignedTo','membername','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','[rescheduleContactInQueue]\x20','util','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueReport','error','inspect','resolve','createHistory','catch','[createHistory]\x20','then','moveContactManagedDialer','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerFinal','rescheduleContact'];(function(_0x1dace9,_0x1566ac){var _0xf44d3d=function(_0xd8cf7c){while(--_0xd8cf7c){_0x1dace9['push'](_0x1dace9['shift']());}};_0xf44d3d(++_0x1566ac);}(_0x0fda,0x1a0));var _0xa0fd=function(_0x19b138,_0x32cc07){_0x19b138=_0x19b138-0x0;var _0xfeddf4=_0x0fda[_0x19b138];return _0xfeddf4;};'use strict';var util=require(_0xa0fd('0x0'));var BPromise=require('bluebird');var logger=require(_0xa0fd('0x1'))(_0xa0fd('0x2'));var _=require(_0xa0fd('0x3'));var cmHopper=require(_0xa0fd('0x4'));var cmHopperFinal=require(_0xa0fd('0x5'));var cmHopperHistory=require(_0xa0fd('0x6'));var cmHopperBlack=require(_0xa0fd('0x7'));var voiceQueueRt=require('../rpc/voiceQueueRt');var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0xa0fd('0x8'));function loggerCatch(_0x4aec58){return function(_0x49b3c1){logger[_0xa0fd('0x9')](_0x4aec58,util[_0xa0fd('0xa')](_0x49b3c1,{'showHidden':![],'depth':null}));};}function create(_0x1aab41){return BPromise[_0xa0fd('0xb')]()['then'](cmHopperHistory[_0xa0fd('0xc')](_0x1aab41))[_0xa0fd('0xd')](loggerCatch(_0xa0fd('0xe')));}function createAgent(_0x322a1a){return BPromise['resolve']()[_0xa0fd('0xf')](agentReportPreview[_0xa0fd('0xc')](_0x322a1a))[_0xa0fd('0xd')](loggerCatch('[createHistory]\x20'));}function moveContact(_0x4409e4){return BPromise[_0xa0fd('0xb')]()[_0xa0fd('0xf')](cmHopper[_0xa0fd('0x10')](_0x4409e4,!![]))[_0xa0fd('0xd')](loggerCatch('[moveContactManagedDialer]\x20'));}exports['checkIsBlackList']=function(_0x32dcee){return BPromise[_0xa0fd('0xb')]()['then'](cmHopperBlack[_0xa0fd('0x11')](_0x32dcee))[_0xa0fd('0xd')](loggerCatch(_0xa0fd('0x12')));};exports[_0xa0fd('0x13')]=function(_0x2b0993){return BPromise[_0xa0fd('0xb')]()[_0xa0fd('0xf')](cmHopper['getContactPreview'](_0x2b0993))[_0xa0fd('0xd')](loggerCatch(_0xa0fd('0x14')));};exports['createHistory']=function(_0x50aa6d,_0x205506){create(_0x50aa6d)[_0xa0fd('0xd')](loggerCatch(_0x205506));moveContact(_0x50aa6d)['catch'](loggerCatch(_0x205506));};exports[_0xa0fd('0x15')]=function(_0x22a876,_0x1cb027){createAgent(_0x22a876)['catch'](loggerCatch(_0x1cb027));};exports['createCustomerHistory']=function(_0x46e15a,_0x558109){create(_0x46e15a)[_0xa0fd('0xd')](loggerCatch(_0x558109));};exports[_0xa0fd('0x16')]=function(_0x10f64b,_0x2cf99d){moveContact(_0x10f64b)[_0xa0fd('0xd')](loggerCatch(_0x2cf99d));};exports[_0xa0fd('0x17')]=function(_0x113059,_0x515b0d,_0x166934){if(_0x515b0d){_0x113059[_0xa0fd('0x18')]=null;}if(_0x166934){_0x113059[_0xa0fd('0x19')]=![];}return BPromise[_0xa0fd('0xb')]()[_0xa0fd('0xf')](cmHopper[_0xa0fd('0x17')](_0x113059))[_0xa0fd('0xd')](loggerCatch(_0xa0fd('0x1a')));};exports[_0xa0fd('0x1b')]=function(_0x13fc62){return BPromise[_0xa0fd('0xb')]()[_0xa0fd('0xf')](cmHopper[_0xa0fd('0x1b')](_0x13fc62))['catch'](loggerCatch(_0xa0fd('0x1c')));};exports[_0xa0fd('0x1d')]=function(_0x541118){return BPromise[_0xa0fd('0xb')]()[_0xa0fd('0xf')](cmHopper['unlockContact']({'UserId':null},_0x541118,0x1))['catch'](loggerCatch(_0xa0fd('0x1e')));};exports[_0xa0fd('0x1f')]=function(_0x4d2c96){return BPromise['resolve']()['then'](cmHopper['unlockContact']({'active':![]},_0x4d2c96,0x1))[_0xa0fd('0xd')](loggerCatch('[activeContact]\x20'));};exports[_0xa0fd('0x20')]=function(_0x1db300){var _0x2f5b0d={};_0x2f5b0d['type']=_0x1db300[_0xa0fd('0x21')];_0x2f5b0d[_0xa0fd('0x22')]=_0x1db300[_0xa0fd('0x22')];_0x2f5b0d[_0xa0fd('0x23')]=_0x1db300[_0xa0fd('0x23')];_0x2f5b0d['calleridname']=_0x1db300[_0xa0fd('0x24')];_0x2f5b0d[_0xa0fd('0x25')]=_0x1db300[_0xa0fd('0x25')];_0x2f5b0d[_0xa0fd('0x26')]=_0x1db300['answertime'];_0x2f5b0d[_0xa0fd('0x27')]=_0x1db300[_0xa0fd('0x28')];_0x2f5b0d['queuecallercomplete']=0x1;_0x2f5b0d['queuecallercompleteAt']=_0x1db300['endtime'];_0x2f5b0d[_0xa0fd('0x29')]=_0x1db300['membername'];_0x2f5b0d['context']=_0xa0fd('0x2a');_0x2f5b0d['exten']=_0xa0fd('0x2b');_0x2f5b0d[_0xa0fd('0x2c')]=0x0;_0x2f5b0d[_0xa0fd('0x2d')]=0x1;_0x2f5b0d[_0xa0fd('0x2e')]=_0x1db300[_0xa0fd('0x2f')];_0x2f5b0d[_0xa0fd('0x30')]=_0xa0fd('0x31');return BPromise[_0xa0fd('0xb')]()['then'](voiceQueueReport[_0xa0fd('0x32')](_0x2f5b0d))['catch'](loggerCatch(_0xa0fd('0x33')));};exports['getContactRecallMe']=function(_0x5f4152,_0x33f24b){return BPromise['resolve']()[_0xa0fd('0xf')](cmHopper[_0xa0fd('0x34')](_0x5f4152,_0x33f24b))[_0xa0fd('0xd')](loggerCatch(_0xa0fd('0x35')));};exports['rescheduleContactInQueue']=function(_0x1e4faa){return BPromise[_0xa0fd('0xb')]()[_0xa0fd('0xf')](cmHopper[_0xa0fd('0x17')](_0x1e4faa,!![],!![]))[_0xa0fd('0xd')](loggerCatch(_0xa0fd('0x36')));}; \ No newline at end of file +var _0x723e=['../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','error','inspect','resolve','then','createHistory','[createHistory]\x20','catch','moveContactManagedDialer','[moveContactManagedDialer]\x20','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','rescheduleContact','active','[rescheduleContact]\x20','countReScheduled','unlockContact','[unlockContact]\x20','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridname','queue','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','context','from-sip','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','queuecallerexitreason','create','getContactRecallMe','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','bluebird'];(function(_0x5126dc,_0xcb914){var _0x31fc0c=function(_0x178d47){while(--_0x178d47){_0x5126dc['push'](_0x5126dc['shift']());}};_0x31fc0c(++_0xcb914);}(_0x723e,0x179));var _0xe723=function(_0x15eb76,_0x1946fb){_0x15eb76=_0x15eb76-0x0;var _0x104569=_0x723e[_0x15eb76];return _0x104569;};'use strict';var util=require('util');var BPromise=require(_0xe723('0x0'));var logger=require(_0xe723('0x1'))(_0xe723('0x2'));var _=require(_0xe723('0x3'));var cmHopper=require(_0xe723('0x4'));var cmHopperFinal=require(_0xe723('0x5'));var cmHopperHistory=require(_0xe723('0x6'));var cmHopperBlack=require(_0xe723('0x7'));var voiceQueueRt=require(_0xe723('0x8'));var agentReportPreview=require(_0xe723('0x9'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x32d689){return function(_0x20c13b){logger[_0xe723('0xa')](_0x32d689,util[_0xe723('0xb')](_0x20c13b,{'showHidden':![],'depth':null}));};}function create(_0x2aebbd){return BPromise[_0xe723('0xc')]()[_0xe723('0xd')](cmHopperHistory[_0xe723('0xe')](_0x2aebbd))['catch'](loggerCatch(_0xe723('0xf')));}function createAgent(_0x270346){return BPromise[_0xe723('0xc')]()['then'](agentReportPreview[_0xe723('0xe')](_0x270346))[_0xe723('0x10')](loggerCatch(_0xe723('0xf')));}function moveContact(_0x583291){return BPromise[_0xe723('0xc')]()[_0xe723('0xd')](cmHopper[_0xe723('0x11')](_0x583291,!![]))[_0xe723('0x10')](loggerCatch(_0xe723('0x12')));}exports['checkIsBlackList']=function(_0x29a1e){return BPromise['resolve']()['then'](cmHopperBlack['checkIsBlackList'](_0x29a1e))['catch'](loggerCatch(_0xe723('0x13')));};exports[_0xe723('0x14')]=function(_0x30ce1f){return BPromise[_0xe723('0xc')]()[_0xe723('0xd')](cmHopper['getContactPreview'](_0x30ce1f))[_0xe723('0x10')](loggerCatch(_0xe723('0x15')));};exports[_0xe723('0xe')]=function(_0x2ec702,_0x347fa0){create(_0x2ec702)[_0xe723('0x10')](loggerCatch(_0x347fa0));moveContact(_0x2ec702)[_0xe723('0x10')](loggerCatch(_0x347fa0));};exports[_0xe723('0x16')]=function(_0x17e2c1,_0x3906ea){createAgent(_0x17e2c1)[_0xe723('0x10')](loggerCatch(_0x3906ea));};exports[_0xe723('0x17')]=function(_0x262a8d,_0x367782){create(_0x262a8d)['catch'](loggerCatch(_0x367782));};exports['createCustomerFinal']=function(_0x31c839,_0x1ed6fb){moveContact(_0x31c839)['catch'](loggerCatch(_0x1ed6fb));};exports[_0xe723('0x18')]=function(_0x2762e2,_0x5a8c73,_0x472502){if(_0x5a8c73){_0x2762e2['UserId']=null;}if(_0x472502){_0x2762e2[_0xe723('0x19')]=![];}return BPromise[_0xe723('0xc')]()[_0xe723('0xd')](cmHopper[_0xe723('0x18')](_0x2762e2))[_0xe723('0x10')](loggerCatch(_0xe723('0x1a')));};exports[_0xe723('0x1b')]=function(_0x15196c){return BPromise[_0xe723('0xc')]()[_0xe723('0xd')](cmHopper[_0xe723('0x1b')](_0x15196c))[_0xe723('0x10')](loggerCatch('[countReScheduled]\x20'));};exports[_0xe723('0x1c')]=function(_0x59f095){return BPromise[_0xe723('0xc')]()[_0xe723('0xd')](cmHopper[_0xe723('0x1c')]({'UserId':null},_0x59f095,0x1))[_0xe723('0x10')](loggerCatch(_0xe723('0x1d')));};exports['disableContact']=function(_0x2925bc){return BPromise['resolve']()['then'](cmHopper[_0xe723('0x1c')]({'active':![]},_0x2925bc,0x1))['catch'](loggerCatch(_0xe723('0x1e')));};exports[_0xe723('0x1f')]=function(_0x335c66){var _0x4d55cc={};_0x4d55cc[_0xe723('0x20')]=_0x335c66[_0xe723('0x20')];_0x4d55cc['uniqueid']=_0x335c66[_0xe723('0x21')];_0x4d55cc['calleridnum']=_0x335c66['calleridnum'];_0x4d55cc[_0xe723('0x22')]=_0x335c66[_0xe723('0x22')];_0x4d55cc[_0xe723('0x23')]=_0x335c66[_0xe723('0x23')];_0x4d55cc['queuecallerjoinAt']=_0x335c66['answertime'];_0x4d55cc[_0xe723('0x24')]=_0x335c66['answertime'];_0x4d55cc[_0xe723('0x25')]=0x1;_0x4d55cc[_0xe723('0x26')]=_0x335c66[_0xe723('0x27')];_0x4d55cc[_0xe723('0x28')]=_0x335c66[_0xe723('0x29')];_0x4d55cc[_0xe723('0x2a')]=_0xe723('0x2b');_0x4d55cc[_0xe723('0x2c')]=_0xe723('0x2d');_0x4d55cc[_0xe723('0x2e')]=0x0;_0x4d55cc[_0xe723('0x2f')]=0x1;_0x4d55cc[_0xe723('0x30')]=_0x335c66[_0xe723('0x29')];_0x4d55cc[_0xe723('0x31')]='COMPLETED';return BPromise[_0xe723('0xc')]()['then'](voiceQueueReport[_0xe723('0x32')](_0x4d55cc))[_0xe723('0x10')](loggerCatch('[voiceQueueReport]\x20'));};exports['getContactRecallMe']=function(_0x2f1940,_0x23bbd7){return BPromise[_0xe723('0xc')]()[_0xe723('0xd')](cmHopper[_0xe723('0x33')](_0x2f1940,_0x23bbd7))[_0xe723('0x10')](loggerCatch('[GetContactRecallMe]\x20'));};exports[_0xe723('0x34')]=function(_0x32cca3){return BPromise[_0xe723('0xc')]()[_0xe723('0xd')](cmHopper[_0xe723('0x18')](_0x32cca3,!![],!![]))[_0xe723('0x10')](loggerCatch(_0xe723('0x35')));}; \ No newline at end of file diff --git a/server/services/ami/preview/util/util.js b/server/services/ami/preview/util/util.js index f567029..7c311a5 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 _0xebfb=['lodash','preview','env','XCALLY_IP_AGI','milliseconds','seconds','loggerCatch','error','inspect','logger','info','loggerError','message','isUndefined','isEmpty','string','format','isActive','isNil','addVariables','name','\x22%s\x22\x20<%s>','calleridname','calleridnum','ContactId','dialer','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','dialPreviewUrl','\x22agi://%s/square,%s\x22','NONE','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','state','statedesc','Blacklist','starttime','endtime','YYYY-MM-DD\x20HH:mm:ss','responsetime','ringtime','membername','logCustomer','talktime','answertime','isFailure','Failure','variablesAction','RECALL','BOOKED','channelAgent','from-sip','timeout','totalGlobal','countcongestionretry','clone','Global','scheduledAt','scheduledat','add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','lastevent','queue','interface','buildAcw','agentReadyId','not_inuse','status','push','getDiff','createBody','VoiceQueueId','CampaignId','idContact','campaigntype','active','countbusyretry','countnoanswerretry','countglobal','callback','callbackuniqueid','callbackat','sipcallid','xmd-voicequeueid','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosloss','bridgepeer','getCallerIdRandom','\x5cw{0,','pow','extractCalleridName','match','extractCalleridNumber'];(function(_0xd413a4,_0x3120fe){var _0x9170f4=function(_0x5aa567){while(--_0x5aa567){_0xd413a4['push'](_0xd413a4['shift']());}};_0x9170f4(++_0x3120fe);}(_0xebfb,0x10a));var _0xbebf=function(_0x12a4fa,_0x4b927e){_0x12a4fa=_0x12a4fa-0x0;var _0x5baea6=_0xebfb[_0x12a4fa];return _0x5baea6;};'use strict';var util=require('util');var _=require(_0xbebf('0x0'));var moment=require('moment');var logger=require('../../../../config/logger')(_0xbebf('0x1'));var ipAgi=process[_0xbebf('0x2')][_0xbebf('0x3')]||'127.0.0.1';function getSeconds(_0x3e68e2,_0x32e701){var _0x1fd9d3=moment(_0x3e68e2)[_0xbebf('0x4')](0x0);var _0x5c973b=moment(_0x32e701)[_0xbebf('0x4')](0x0);return _0x1fd9d3['diff'](_0x5c973b,_0xbebf('0x5'));}exports[_0xbebf('0x6')]=function(_0x26dd18){return function(_0x8aca07){logger[_0xbebf('0x7')](_0x26dd18,util[_0xbebf('0x8')](_0x8aca07,{'showHidden':![],'depth':null}));};};exports[_0xbebf('0x9')]=function(_0x371eff,_0x9ddba0){logger[_0xbebf('0xa')](_0x371eff,util[_0xbebf('0x8')](_0x9ddba0,{'showHidden':![],'depth':null}));};exports[_0xbebf('0xb')]=function(_0x21c343,_0x96e001){logger[_0xbebf('0x7')](_0x21c343,util[_0xbebf('0x8')](_0x96e001,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x57331b){return function(_0x3bd580){logger['info'](_0x57331b,util['inspect'](_0x3bd580,{'showHidden':![],'depth':null}));};};exports[_0xbebf('0xc')]=function(_0x3aabf4,_0x46849e,_0x1b6d6b){return{'message':_0x3aabf4,'unlock':_0x46849e,'active':_0x1b6d6b};};exports['getCallerId']=function(_0x2f4a44,_0x972504,_0x47225b){if(!_[_0xbebf('0xd')](_0x47225b)&&'string'===typeof _0x47225b&&!_[_0xbebf('0xe')](_0x47225b)){if(!_['isUndefined'](_0x972504)&&_0xbebf('0xf')===typeof _0x972504&&!_[_0xbebf('0xe')](_0x972504)){return util[_0xbebf('0x10')]('\x22%s\x22\x20<%s>',_0x972504,_0x47225b);}return util[_0xbebf('0x10')]('\x22%s\x22\x20<%s>',_0x47225b,_0x47225b);}if(!_[_0xbebf('0xd')](_0x2f4a44)&&_0xbebf('0xf')===typeof _0x2f4a44&&!_[_0xbebf('0xe')](_0x2f4a44)){return _0x2f4a44;}return'\x22\x22\x20<>';};exports[_0xbebf('0x11')]=function(_0x2d91ff){if(_[_0xbebf('0x12')](_0x2d91ff)){return![];}return _0x2d91ff;};exports[_0xbebf('0x13')]=function(_0x50f76a,_0x34f0c4,_0x95e1b3,_0x544c78,_0x1c41fd,_0x5051cb){var _0x2bf322={'XMD-QUEUE':_0x34f0c4['Queue']?_0x34f0c4['Queue'][_0xbebf('0x14')]:'','XMD-CALLERID':_0x544c78,'XMD-CALLERID-PREVIEW':_0x5051cb?util[_0xbebf('0x10')](_0xbebf('0x15'),_0x5051cb[_0xbebf('0x16')],_0x5051cb[_0xbebf('0x17')]):_0x544c78,'XMD-DIALID':_0x1c41fd,'XMD-CONTACTID':_0x34f0c4[_0xbebf('0x18')],'XMD-CDRTYPE':_0xbebf('0x19'),'CALLERID(all)':_0x544c78,'XMD-VOICEQUEUEID':_0x34f0c4['VoiceQueueId'],'XMD-DIALCHANNEL':_0x95e1b3,'XMD-DIALTIMEOUT':_0x50f76a[_0xbebf('0x1a')]||0x1e,'XMD-DIALOPTIONS':util[_0xbebf('0x10')](_0xbebf('0x1b'),_0x50f76a[_0xbebf('0x1c')]?'g':'',_[_0xbebf('0xe')](_0x50f76a[_0xbebf('0x1d')])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x50f76a[_0xbebf('0x1e')]||'','XMD-AGI':_0x50f76a['dialQueueProject']?util['format'](_0xbebf('0x1f'),ipAgi,_0x50f76a['dialQueueProject']):_0xbebf('0x20'),'XMD-AGIAFTER':_0x50f76a[_0xbebf('0x1c')]?util[_0xbebf('0x10')]('\x22agi://%s/square,%s\x22',ipAgi,_0x50f76a[_0xbebf('0x1c')]):_0xbebf('0x20'),'XMD-ORIGINATECALLERIDNUM':_0x5051cb?_0x5051cb['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x5051cb?_0x5051cb[_0xbebf('0x21')]:'','XMD-DESTINATION':_0xbebf('0x22')};if(!_[_0xbebf('0xe')](_0x50f76a[_0xbebf('0x1d')])){_0x2bf322[util[_0xbebf('0x10')]('%s',_0xbebf('0x23'))]=_0x50f76a['monitor_format'];_0x2bf322[util[_0xbebf('0x10')]('%s',_0xbebf('0x24'))]=_0x1c41fd;}if(_0x34f0c4&&_0x34f0c4[_0xbebf('0x25')]){for(var _0x51c5e4 in _0x34f0c4['Contact']){if(_0x34f0c4['Contact'][_0xbebf('0x26')](_0x51c5e4)){if(!_[_0xbebf('0x12')](_0x34f0c4[_0xbebf('0x25')][_0x51c5e4])&&_0x51c5e4!=='id'&&_0x51c5e4!==_0xbebf('0x27')&&_0x51c5e4!==_0xbebf('0x28')&&_0x51c5e4!==_0xbebf('0x29')){_0x2bf322[util[_0xbebf('0x10')](_0xbebf('0x2a'),_0xbebf('0x2b'),_[_0xbebf('0x2c')](_0x51c5e4))]=_0x34f0c4['Contact'][_0x51c5e4];}}}}return _0x2bf322;};exports[_0xbebf('0x2d')]=function(_0x30a1b0){var _0x4c2872={};for(var _0x28e3b0 in _0x30a1b0){if(_0x30a1b0[_0xbebf('0x26')](_0x28e3b0)){_0x4c2872[util[_0xbebf('0x10')]('%s',_[_0xbebf('0x2e')](_0x28e3b0))]=_0x30a1b0[_0x28e3b0];}}return{'variables':_0x4c2872};};exports[_0xbebf('0x2f')]=function(_0x5ecbb2,_0x534be8){if(!_[_0xbebf('0x12')](_0x5ecbb2)){if(_0x5ecbb2[_0xbebf('0x26')](_0xbebf('0x30'))){if(_0x5ecbb2['originated']>0x0){_0x5ecbb2[_0xbebf('0x30')]-=0x1;}else{logger[_0xbebf('0x7')]('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x534be8);}}}else{logger['error'](_0xbebf('0x31'),_0x534be8);}};exports[_0xbebf('0x32')]=function(_0x40d335){var _0x3e0875=moment()[_0xbebf('0x10')]('YYYY-MM-DD\x20HH:mm:ss');_0x40d335[_0xbebf('0x33')]=0xd;_0x40d335[_0xbebf('0x34')]=_0xbebf('0x35');_0x40d335[_0xbebf('0x36')]=_0x3e0875;_0x40d335['responsetime']=_0x3e0875;_0x40d335[_0xbebf('0x37')]=_0x3e0875;};exports['logAgent']=function(_0x4ee93d,_0x2b4628,_0x25e3e4){var _0x1de2d8=moment()[_0xbebf('0x10')](_0xbebf('0x38'));_0x4ee93d['state']=_0x2b4628;_0x4ee93d[_0xbebf('0x34')]=_0x25e3e4;_0x4ee93d[_0xbebf('0x39')]=_0x1de2d8;_0x4ee93d[_0xbebf('0x3a')]=getSeconds(_0x4ee93d[_0xbebf('0x39')],_0x4ee93d[_0xbebf('0x36')]);};exports['logLookAgent']=function(_0x367443,_0xaa2544,_0x311e36){_0x367443[_0xbebf('0x3b')]=_0xaa2544;_0x367443['UserId']=_0x311e36;};exports[_0xbebf('0x3c')]=function(_0x217ac8,_0x12c1bc,_0x1a4638){var _0x39acba=moment()[_0xbebf('0x10')]('YYYY-MM-DD\x20HH:mm:ss');_0x217ac8[_0xbebf('0x33')]=_0x12c1bc;_0x217ac8['statedesc']=_0x1a4638;_0x217ac8['responsetime']=_0x217ac8[_0xbebf('0x39')]?_0x217ac8[_0xbebf('0x39')]:_0x39acba;_0x217ac8[_0xbebf('0x37')]=_0x217ac8[_0xbebf('0x37')]?_0x217ac8[_0xbebf('0x37')]:_0x39acba;_0x217ac8[_0xbebf('0x3a')]=getSeconds(_0x217ac8[_0xbebf('0x39')]||0x0,_0x217ac8[_0xbebf('0x36')]||0x0);_0x217ac8[_0xbebf('0x3d')]=_0x217ac8[_0xbebf('0x3e')]?getSeconds(_0x217ac8[_0xbebf('0x37')],_0x217ac8[_0xbebf('0x3e')]):0x0;};exports[_0xbebf('0x3f')]=function(_0x239da1){return _0x239da1===_0xbebf('0x40');};exports[_0xbebf('0x41')]=function(_0xa8cd01,_0x39b07f,_0xb9cdf8,_0x437809,_0x43cf4e){var _0x30e4e5=_0x437809?_0xbebf('0x42'):_0xa8cd01['calleridname'];_0x30e4e5=_0x43cf4e?_0xbebf('0x43'):_0x30e4e5;return{'actionid':_0xa8cd01['uniqueid'],'action':'originate','channel':_0xa8cd01[_0xbebf('0x44')],'callerid':util['format'](_0xbebf('0x15'),_0x30e4e5,_0xa8cd01[_0xbebf('0x17')]),'Exten':_0xbebf('0x22'),'Context':_0xbebf('0x45'),'Priority':'1','variable':_0xb9cdf8,'timeout':(_0x39b07f[_0xbebf('0x46')]||0x1e)*0x3e8,'async':!![],'channelid':_0xa8cd01['uniqueid']};};exports[_0xbebf('0x47')]=function(_0xd3dd6d){return _0xd3dd6d['countbusyretry']+_0xd3dd6d[_0xbebf('0x48')]+_0xd3dd6d['countnoanswerretry'];};exports['cloneAction']=function(_0x2fccbd){var _0xd5d58a=_[_0xbebf('0x49')](_0x2fccbd);_0xd5d58a['state']=0xf;_0xd5d58a[_0xbebf('0x34')]=_0xbebf('0x4a');return _0xd5d58a;};exports[_0xbebf('0x4b')]=function(_0x4f7bd0,_0x461f88,_0x26eb7c){var _0x3347a9={};_0x3347a9[_0x461f88]=_0x4f7bd0[_0x461f88];_0x3347a9['active']=![];_0x3347a9[_0xbebf('0x4c')]=moment()[_0xbebf('0x4d')](_0x26eb7c,_0xbebf('0x4e'))[_0xbebf('0x10')]('YYYY-MM-DD\x20HH:mm:ss');_0x3347a9[_0xbebf('0x18')]=_0x4f7bd0[_0xbebf('0x18')];_0x3347a9[_0xbebf('0x4f')]=_0x4f7bd0[_0xbebf('0x4f')];_0x3347a9['VoiceQueueId']=_0x4f7bd0['VoiceQueueId']||undefined;return _0x3347a9;};exports[_0xbebf('0x50')]=function(_0x4db708,_0x4b6e61){if(!_[_0xbebf('0x12')](_0x4db708)){if(_0x4db708['pTalking']>0x0){_0x4db708[_0xbebf('0x51')]-=0x1;}else{logger[_0xbebf('0x7')](_0x4b6e61,_0xbebf('0x52'));}}else{logger[_0xbebf('0x7')](_0x4b6e61,_0xbebf('0x53'));}};exports[_0xbebf('0x54')]=function(_0x4fe9dd){if(_0x4fe9dd<=0x0){return!![];}return![];};exports[_0xbebf('0x55')]=function(_0x1dfb3e,_0x1eb085){_0x1dfb3e[_0xbebf('0x56')]=_0x1eb085;_0x1dfb3e[_0xbebf('0x14')]=_0x1dfb3e[_0xbebf('0x57')];_0x1dfb3e[_0xbebf('0x58')]=_0x1dfb3e[_0xbebf('0x44')];return _0x1dfb3e;};exports[_0xbebf('0x59')]=function(_0x301785){var _0x2ffedd={};_0x2ffedd[_0xbebf('0x57')]=_0x301785[_0xbebf('0x57')];_0x2ffedd[_0xbebf('0x58')]=_0x301785[_0xbebf('0x44')];_0x2ffedd['uniqueid']=_0x301785['uniqueid'];return _0x2ffedd;};exports[_0xbebf('0x5a')]=function(_0x219caa){var _0x3e5e7f=[];for(var _0x347e7c in _0x219caa){if(_0x219caa[_0xbebf('0x26')](_0x347e7c)){if(!_[_0xbebf('0x12')](_0x219caa[_0x347e7c])&&_0x219caa[_0x347e7c][_0xbebf('0x33')]===_0xbebf('0x5b')&&_0x219caa[_0x347e7c][_0xbebf('0x5c')]==='reachable'){_0x3e5e7f[_0xbebf('0x5d')](_0x219caa[_0x347e7c]['id']);}}}return _0x3e5e7f;};exports[_0xbebf('0x5e')]=function(_0x454d90){var _0x48177c=moment()[_0xbebf('0x4')](0x0);var _0x4200f3=moment(_0x454d90)[_0xbebf('0x4')](0x0);return _0x48177c['diff'](_0x4200f3,_0xbebf('0x5'));};exports[_0xbebf('0x5f')]=function(_0x541950){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x541950['ContactId'],'ListId':_0x541950['ListId'],'VoiceQueueId':_0x541950[_0xbebf('0x60')]||undefined,'CampaignId':_0x541950[_0xbebf('0x61')]||undefined};};exports['filterKey']=function(_0x56d1b5){if(_0x56d1b5==='uniqueid'||_0x56d1b5===_0xbebf('0x62')||_0x56d1b5===_0xbebf('0x57')||_0x56d1b5==='type'||_0x56d1b5===_0xbebf('0x63')||_0x56d1b5==='dialAnswer'||_0x56d1b5===_0xbebf('0x3b')||_0x56d1b5==='channelAgent'||_0x56d1b5==='calleridname'||_0x56d1b5===_0xbebf('0x64')||_0x56d1b5===_0xbebf('0x17')||_0x56d1b5===_0xbebf('0x4c')||_0x56d1b5===_0xbebf('0x65')||_0x56d1b5===_0xbebf('0x48')||_0x56d1b5===_0xbebf('0x66')||_0x56d1b5===_0xbebf('0x67')||_0x56d1b5===_0xbebf('0x68')||_0x56d1b5===_0xbebf('0x69')||_0x56d1b5===_0xbebf('0x6a')||_0x56d1b5==='recallme'||_0x56d1b5===_0xbebf('0x18')||_0x56d1b5===_0xbebf('0x4f')||_0x56d1b5==='UserId'||_0x56d1b5===_0xbebf('0x60')||_0x56d1b5===_0xbebf('0x6b')||_0x56d1b5===_0xbebf('0x6c')||_0x56d1b5==='xmd-queue'||_0x56d1b5===_0xbebf('0x6d')||_0x56d1b5===_0xbebf('0x6e')||_0x56d1b5===_0xbebf('0x6f')||_0x56d1b5===_0xbebf('0x70')||_0x56d1b5===_0xbebf('0x71')||_0x56d1b5===_0xbebf('0x72')||_0x56d1b5===_0xbebf('0x73')||_0x56d1b5==='xmd-contactid'||_0x56d1b5==='xmd-cdrtype'||_0x56d1b5===_0xbebf('0x74')||_0x56d1b5===_0xbebf('0x75')||_0x56d1b5===_0xbebf('0x76')||_0x56d1b5===_0xbebf('0x77')||_0x56d1b5==='rtpaudioqosbridged'||_0x56d1b5===_0xbebf('0x78')||_0x56d1b5===_0xbebf('0x79')||_0x56d1b5==='rtpaudioqosloss'||_0x56d1b5===_0xbebf('0x7a')||_0x56d1b5===_0xbebf('0x7b')||_0x56d1b5===_0xbebf('0x7c')||_0x56d1b5==='rtpaudioqos'||_0x56d1b5==='rtpaudioqosbridged'||_0x56d1b5===_0xbebf('0x78')||_0x56d1b5===_0xbebf('0x79')||_0x56d1b5===_0xbebf('0x7d')||_0x56d1b5===_0xbebf('0x7a')||_0x56d1b5===_0xbebf('0x7b')||_0x56d1b5===_0xbebf('0x7c')||_0x56d1b5===_0xbebf('0x7e')||_0x56d1b5==='bridgepvtcallid'||_0x56d1b5===_0xbebf('0x33')||_0x56d1b5===_0xbebf('0x34')){return![];}return!![];};exports[_0xbebf('0x7f')]=function(_0xfe6c31,_0x19b07f){var _0x25b26c,_0x30c785,_0x5b0a65;if(_0x19b07f<=0x0){_0x19b07f=0x1;}_0x25b26c=new RegExp(_0xbebf('0x80')+_0x19b07f+'}$');_0x30c785=Math['pow'](0xa,_0x19b07f-0x1);_0x5b0a65=Math[_0xbebf('0x81')](0xa,_0x19b07f)-0x1;return util['format']('%s',_['replace'](_0xfe6c31,_0x25b26c,_['random'](_0x30c785,_0x5b0a65)));};exports[_0xbebf('0x82')]=function(_0x43963e){var _0x257832=_0x43963e[_0xbebf('0x83')](/"(.*?)"/);return _0x257832?_0x257832[0x1]:_0x43963e;};exports[_0xbebf('0x84')]=function(_0x128118){var _0x52a1e3=_0x128118[_0xbebf('0x83')](/<(.*?)>/);return _0x52a1e3?_0x52a1e3[0x1]:_0x128118;}; \ No newline at end of file +var _0x48c6=['\x22%s\x22\x20<%s>','isUndefined','isActive','isNil','Queue','name','calleridname','ContactId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','originatecalleridnum','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','endtime','logAgent','ringtime','logLookAgent','membername','answertime','Failure','variablesAction','RECALL','BOOKED','uniqueid','originate','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','cloneAction','clone','scheduledAt','active','add','minutes','ListId','VoiceQueueId','decrementTalkink','pTalking','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','lastevent','queue','interface','buildAcw','channelAgent','agentReadyId','not_inuse','status','reachable','push','getDiff','filterKey','type','dialAnswer','calleridnum','scheduledat','countglobal','callback','callbackuniqueid','callbackat','recallme','UserId','sipcallid','xmd-phone','xmd-listid','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-contactid','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','replace','random','extractCalleridName','match','extractCalleridNumber','util','lodash','../../../../config/logger','preview','XCALLY_IP_AGI','milliseconds','seconds','loggerCatch','error','info','inspect','loggerError','logger2','message','getCallerId','string','isEmpty','format'];(function(_0x3a7144,_0x3c4e8a){var _0x2a08f3=function(_0x5b027c){while(--_0x5b027c){_0x3a7144['push'](_0x3a7144['shift']());}};_0x2a08f3(++_0x3c4e8a);}(_0x48c6,0x17d));var _0x648c=function(_0x57d3c5,_0x2eb41a){_0x57d3c5=_0x57d3c5-0x0;var _0x5c5056=_0x48c6[_0x57d3c5];return _0x5c5056;};'use strict';var util=require(_0x648c('0x0'));var _=require(_0x648c('0x1'));var moment=require('moment');var logger=require(_0x648c('0x2'))(_0x648c('0x3'));var ipAgi=process['env'][_0x648c('0x4')]||'127.0.0.1';function getSeconds(_0x2c039c,_0x2346d2){var _0x284131=moment(_0x2c039c)[_0x648c('0x5')](0x0);var _0x5eab0d=moment(_0x2346d2)['milliseconds'](0x0);return _0x284131['diff'](_0x5eab0d,_0x648c('0x6'));}exports[_0x648c('0x7')]=function(_0x21cdfc){return function(_0x536cb6){logger[_0x648c('0x8')](_0x21cdfc,util['inspect'](_0x536cb6,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x5167d4,_0x178248){logger[_0x648c('0x9')](_0x5167d4,util[_0x648c('0xa')](_0x178248,{'showHidden':![],'depth':null}));};exports[_0x648c('0xb')]=function(_0x26e60e,_0x33fa3d){logger['error'](_0x26e60e,util[_0x648c('0xa')](_0x33fa3d,{'showHidden':![],'depth':null}));};exports[_0x648c('0xc')]=function(_0x3d87ff){return function(_0x2c7c15){logger['info'](_0x3d87ff,util['inspect'](_0x2c7c15,{'showHidden':![],'depth':null}));};};exports[_0x648c('0xd')]=function(_0x3de2b4,_0x485d5d,_0x2d0862){return{'message':_0x3de2b4,'unlock':_0x485d5d,'active':_0x2d0862};};exports[_0x648c('0xe')]=function(_0x35f10e,_0xf706ad,_0x24b7e2){if(!_['isUndefined'](_0x24b7e2)&&_0x648c('0xf')===typeof _0x24b7e2&&!_[_0x648c('0x10')](_0x24b7e2)){if(!_['isUndefined'](_0xf706ad)&&_0x648c('0xf')===typeof _0xf706ad&&!_[_0x648c('0x10')](_0xf706ad)){return util[_0x648c('0x11')]('\x22%s\x22\x20<%s>',_0xf706ad,_0x24b7e2);}return util[_0x648c('0x11')](_0x648c('0x12'),_0x24b7e2,_0x24b7e2);}if(!_[_0x648c('0x13')](_0x35f10e)&&'string'===typeof _0x35f10e&&!_['isEmpty'](_0x35f10e)){return _0x35f10e;}return'\x22\x22\x20<>';};exports[_0x648c('0x14')]=function(_0x35471e){if(_[_0x648c('0x15')](_0x35471e)){return![];}return _0x35471e;};exports['addVariables']=function(_0x16c821,_0x300b8,_0x5a17d5,_0x597f24,_0x242977,_0x49500f){var _0x3a0ed2={'XMD-QUEUE':_0x300b8['Queue']?_0x300b8[_0x648c('0x16')][_0x648c('0x17')]:'','XMD-CALLERID':_0x597f24,'XMD-CALLERID-PREVIEW':_0x49500f?util[_0x648c('0x11')](_0x648c('0x12'),_0x49500f[_0x648c('0x18')],_0x49500f['calleridnum']):_0x597f24,'XMD-DIALID':_0x242977,'XMD-CONTACTID':_0x300b8[_0x648c('0x19')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x597f24,'XMD-VOICEQUEUEID':_0x300b8['VoiceQueueId'],'XMD-DIALCHANNEL':_0x5a17d5,'XMD-DIALTIMEOUT':_0x16c821[_0x648c('0x1a')]||0x1e,'XMD-DIALOPTIONS':util['format'](_0x648c('0x1b'),_0x16c821[_0x648c('0x1c')]?'g':'',_[_0x648c('0x10')](_0x16c821[_0x648c('0x1d')])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x16c821[_0x648c('0x1e')]||'','XMD-AGI':_0x16c821[_0x648c('0x1f')]?util[_0x648c('0x11')](_0x648c('0x20'),ipAgi,_0x16c821[_0x648c('0x1f')]):'NONE','XMD-AGIAFTER':_0x16c821['dialQueueProject2']?util[_0x648c('0x11')](_0x648c('0x20'),ipAgi,_0x16c821[_0x648c('0x1c')]):'NONE','XMD-ORIGINATECALLERIDNUM':_0x49500f?_0x49500f[_0x648c('0x21')]:'','XMD-ORIGINATECALLERIDNAME':_0x49500f?_0x49500f[_0x648c('0x22')]:'','XMD-DESTINATION':_0x648c('0x23')};if(!_[_0x648c('0x10')](_0x16c821[_0x648c('0x1d')])){_0x3a0ed2[util[_0x648c('0x11')]('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x16c821[_0x648c('0x1d')];_0x3a0ed2[util[_0x648c('0x11')]('%s',_0x648c('0x24'))]=_0x242977;}if(_0x300b8&&_0x300b8['Contact']){for(var _0x4fc42c in _0x300b8[_0x648c('0x25')]){if(_0x300b8['Contact'][_0x648c('0x26')](_0x4fc42c)){if(!_['isNil'](_0x300b8[_0x648c('0x25')][_0x4fc42c])&&_0x4fc42c!=='id'&&_0x4fc42c!==_0x648c('0x27')&&_0x4fc42c!==_0x648c('0x28')&&_0x4fc42c!==_0x648c('0x29')){_0x3a0ed2[util[_0x648c('0x11')](_0x648c('0x2a'),_0x648c('0x2b'),_[_0x648c('0x2c')](_0x4fc42c))]=_0x300b8[_0x648c('0x25')][_0x4fc42c];}}}}return _0x3a0ed2;};exports['toLowerVariables']=function(_0x4b0c85){var _0x5515c1={};for(var _0x39fc2f in _0x4b0c85){if(_0x4b0c85['hasOwnProperty'](_0x39fc2f)){_0x5515c1[util['format']('%s',_['toLower'](_0x39fc2f))]=_0x4b0c85[_0x39fc2f];}}return{'variables':_0x5515c1};};exports[_0x648c('0x2d')]=function(_0x4b0a27,_0x591897){if(!_[_0x648c('0x15')](_0x4b0a27)){if(_0x4b0a27[_0x648c('0x26')](_0x648c('0x2e'))){if(_0x4b0a27[_0x648c('0x2e')]>0x0){_0x4b0a27['originated']-=0x1;}else{logger[_0x648c('0x8')](_0x648c('0x2f'),_0x591897);}}}else{logger[_0x648c('0x8')](_0x648c('0x30'),_0x591897);}};exports[_0x648c('0x31')]=function(_0x36b36f){var _0xc1c72=moment()[_0x648c('0x11')](_0x648c('0x32'));_0x36b36f[_0x648c('0x33')]=0xd;_0x36b36f[_0x648c('0x34')]=_0x648c('0x35');_0x36b36f[_0x648c('0x36')]=_0xc1c72;_0x36b36f[_0x648c('0x37')]=_0xc1c72;_0x36b36f[_0x648c('0x38')]=_0xc1c72;};exports[_0x648c('0x39')]=function(_0x4c4dd8,_0xde11d2,_0x3dd1ec){var _0x408222=moment()['format'](_0x648c('0x32'));_0x4c4dd8[_0x648c('0x33')]=_0xde11d2;_0x4c4dd8[_0x648c('0x34')]=_0x3dd1ec;_0x4c4dd8['responsetime']=_0x408222;_0x4c4dd8[_0x648c('0x3a')]=getSeconds(_0x4c4dd8[_0x648c('0x37')],_0x4c4dd8[_0x648c('0x36')]);};exports[_0x648c('0x3b')]=function(_0x3b6f46,_0x2b9485,_0x262b74){_0x3b6f46[_0x648c('0x3c')]=_0x2b9485;_0x3b6f46['UserId']=_0x262b74;};exports['logCustomer']=function(_0xa1e6f0,_0x44b9f7,_0x35b102){var _0x3ea19a=moment()[_0x648c('0x11')](_0x648c('0x32'));_0xa1e6f0[_0x648c('0x33')]=_0x44b9f7;_0xa1e6f0[_0x648c('0x34')]=_0x35b102;_0xa1e6f0[_0x648c('0x37')]=_0xa1e6f0[_0x648c('0x37')]?_0xa1e6f0[_0x648c('0x37')]:_0x3ea19a;_0xa1e6f0[_0x648c('0x38')]=_0xa1e6f0[_0x648c('0x38')]?_0xa1e6f0[_0x648c('0x38')]:_0x3ea19a;_0xa1e6f0[_0x648c('0x3a')]=getSeconds(_0xa1e6f0[_0x648c('0x37')]||0x0,_0xa1e6f0[_0x648c('0x36')]||0x0);_0xa1e6f0['talktime']=_0xa1e6f0[_0x648c('0x3d')]?getSeconds(_0xa1e6f0['endtime'],_0xa1e6f0['answertime']):0x0;};exports['isFailure']=function(_0x2d0706){return _0x2d0706===_0x648c('0x3e');};exports[_0x648c('0x3f')]=function(_0x2e58be,_0x20ed58,_0x44f7f2,_0x10eff2,_0x1e80fb){var _0x486727=_0x10eff2?_0x648c('0x40'):_0x2e58be[_0x648c('0x18')];_0x486727=_0x1e80fb?_0x648c('0x41'):_0x486727;return{'actionid':_0x2e58be[_0x648c('0x42')],'action':_0x648c('0x43'),'channel':_0x2e58be['channelAgent'],'callerid':util['format'](_0x648c('0x12'),_0x486727,_0x2e58be['calleridnum']),'Exten':_0x648c('0x23'),'Context':'from-sip','Priority':'1','variable':_0x44f7f2,'timeout':(_0x20ed58['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x2e58be[_0x648c('0x42')]};};exports[_0x648c('0x44')]=function(_0x152135){return _0x152135[_0x648c('0x45')]+_0x152135[_0x648c('0x46')]+_0x152135[_0x648c('0x47')];};exports[_0x648c('0x48')]=function(_0x3f223a){var _0x34bb98=_[_0x648c('0x49')](_0x3f223a);_0x34bb98['state']=0xf;_0x34bb98[_0x648c('0x34')]='Global';return _0x34bb98;};exports[_0x648c('0x4a')]=function(_0x35436a,_0x14e3bc,_0x10b0c5){var _0x533b1f={};_0x533b1f[_0x14e3bc]=_0x35436a[_0x14e3bc];_0x533b1f[_0x648c('0x4b')]=![];_0x533b1f['scheduledat']=moment()[_0x648c('0x4c')](_0x10b0c5,_0x648c('0x4d'))['format'](_0x648c('0x32'));_0x533b1f[_0x648c('0x19')]=_0x35436a[_0x648c('0x19')];_0x533b1f['ListId']=_0x35436a[_0x648c('0x4e')];_0x533b1f[_0x648c('0x4f')]=_0x35436a[_0x648c('0x4f')]||undefined;return _0x533b1f;};exports[_0x648c('0x50')]=function(_0x29f850,_0x546d78){if(!_['isNil'](_0x29f850)){if(_0x29f850[_0x648c('0x51')]>0x0){_0x29f850[_0x648c('0x51')]-=0x1;}else{logger[_0x648c('0x8')](_0x546d78,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger['error'](_0x546d78,_0x648c('0x52'));}};exports[_0x648c('0x53')]=function(_0x1dc677){if(_0x1dc677<=0x0){return!![];}return![];};exports[_0x648c('0x54')]=function(_0x41e8f9,_0x3f02b4){_0x41e8f9[_0x648c('0x55')]=_0x3f02b4;_0x41e8f9[_0x648c('0x17')]=_0x41e8f9[_0x648c('0x56')];_0x41e8f9[_0x648c('0x57')]=_0x41e8f9['channelAgent'];return _0x41e8f9;};exports[_0x648c('0x58')]=function(_0x30dd3c){var _0x4d7cdc={};_0x4d7cdc['queue']=_0x30dd3c[_0x648c('0x56')];_0x4d7cdc[_0x648c('0x57')]=_0x30dd3c[_0x648c('0x59')];_0x4d7cdc[_0x648c('0x42')]=_0x30dd3c[_0x648c('0x42')];return _0x4d7cdc;};exports[_0x648c('0x5a')]=function(_0x272a4b){var _0x329850=[];for(var _0x2ef989 in _0x272a4b){if(_0x272a4b[_0x648c('0x26')](_0x2ef989)){if(!_[_0x648c('0x15')](_0x272a4b[_0x2ef989])&&_0x272a4b[_0x2ef989][_0x648c('0x33')]===_0x648c('0x5b')&&_0x272a4b[_0x2ef989][_0x648c('0x5c')]===_0x648c('0x5d')){_0x329850[_0x648c('0x5e')](_0x272a4b[_0x2ef989]['id']);}}}return _0x329850;};exports[_0x648c('0x5f')]=function(_0x365939){var _0x31bc2c=moment()[_0x648c('0x5')](0x0);var _0x132e25=moment(_0x365939)[_0x648c('0x5')](0x0);return _0x31bc2c['diff'](_0x132e25,_0x648c('0x6'));};exports['createBody']=function(_0x59e4ea){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x59e4ea['ContactId'],'ListId':_0x59e4ea[_0x648c('0x4e')],'VoiceQueueId':_0x59e4ea['VoiceQueueId']||undefined,'CampaignId':_0x59e4ea['CampaignId']||undefined};};exports[_0x648c('0x60')]=function(_0x46896f){if(_0x46896f==='uniqueid'||_0x46896f==='idContact'||_0x46896f===_0x648c('0x56')||_0x46896f===_0x648c('0x61')||_0x46896f==='campaigntype'||_0x46896f===_0x648c('0x62')||_0x46896f===_0x648c('0x3c')||_0x46896f===_0x648c('0x59')||_0x46896f===_0x648c('0x18')||_0x46896f===_0x648c('0x4b')||_0x46896f===_0x648c('0x63')||_0x46896f===_0x648c('0x64')||_0x46896f===_0x648c('0x45')||_0x46896f==='countcongestionretry'||_0x46896f===_0x648c('0x47')||_0x46896f===_0x648c('0x65')||_0x46896f===_0x648c('0x66')||_0x46896f===_0x648c('0x67')||_0x46896f===_0x648c('0x68')||_0x46896f===_0x648c('0x69')||_0x46896f===_0x648c('0x19')||_0x46896f===_0x648c('0x4e')||_0x46896f===_0x648c('0x6a')||_0x46896f==='VoiceQueueId'||_0x46896f===_0x648c('0x6b')||_0x46896f==='xmd-voicequeueid'||_0x46896f==='xmd-queue'||_0x46896f===_0x648c('0x6c')||_0x46896f===_0x648c('0x6d')||_0x46896f==='xmd-dialurl'||_0x46896f===_0x648c('0x6e')||_0x46896f===_0x648c('0x6f')||_0x46896f===_0x648c('0x70')||_0x46896f==='xmd-dialchannel'||_0x46896f===_0x648c('0x71')||_0x46896f==='xmd-cdrtype'||_0x46896f===_0x648c('0x72')||_0x46896f===_0x648c('0x73')||_0x46896f===_0x648c('0x74')||_0x46896f===_0x648c('0x75')||_0x46896f==='rtpaudioqosbridged'||_0x46896f===_0x648c('0x76')||_0x46896f===_0x648c('0x77')||_0x46896f===_0x648c('0x78')||_0x46896f===_0x648c('0x79')||_0x46896f===_0x648c('0x7a')||_0x46896f===_0x648c('0x7b')||_0x46896f===_0x648c('0x75')||_0x46896f===_0x648c('0x7c')||_0x46896f===_0x648c('0x76')||_0x46896f===_0x648c('0x77')||_0x46896f===_0x648c('0x78')||_0x46896f===_0x648c('0x79')||_0x46896f===_0x648c('0x7a')||_0x46896f===_0x648c('0x7b')||_0x46896f===_0x648c('0x7d')||_0x46896f===_0x648c('0x7e')||_0x46896f===_0x648c('0x33')||_0x46896f===_0x648c('0x34')){return![];}return!![];};exports[_0x648c('0x7f')]=function(_0x1acbd7,_0x2d4f19){var _0x3e8da0,_0x50e7b7,_0x25e047;if(_0x2d4f19<=0x0){_0x2d4f19=0x1;}_0x3e8da0=new RegExp('\x5cw{0,'+_0x2d4f19+'}$');_0x50e7b7=Math['pow'](0xa,_0x2d4f19-0x1);_0x25e047=Math['pow'](0xa,_0x2d4f19)-0x1;return util[_0x648c('0x11')]('%s',_[_0x648c('0x80')](_0x1acbd7,_0x3e8da0,_[_0x648c('0x81')](_0x50e7b7,_0x25e047)));};exports[_0x648c('0x82')]=function(_0x39b508){var _0x349d1d=_0x39b508[_0x648c('0x83')](/"(.*?)"/);return _0x349d1d?_0x349d1d[0x1]:_0x39b508;};exports[_0x648c('0x84')]=function(_0x2ffa36){var _0x41a167=_0x2ffa36['match'](/<(.*?)>/);return _0x41a167?_0x41a167[0x1]:_0x2ffa36;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 85c4571..5dd77b4 100644 --- a/server/services/ami/properties.js +++ b/server/services/ami/properties.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['number','boolean','queueremove','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','queueadd','string'];(function(_0x4bfcd2,_0x15ea90){var _0x40380d=function(_0xa1fc0c){while(--_0xa1fc0c){_0x4bfcd2['push'](_0x4bfcd2['shift']());}};_0x40380d(++_0x15ea90);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1a82eb,_0x5d8426){_0x1a82eb=_0x1a82eb-0x0;var _0x5b894a=_0x5f2f[_0x1a82eb];return _0x5b894a;};'use strict';exports[_0xf5f2('0x0')]={'queue':{'type':_0xf5f2('0x1'),'required':!![]},'interface':{'type':_0xf5f2('0x1'),'required':!![]},'membername':{'type':_0xf5f2('0x1'),'required':!![]},'penalty':{'type':_0xf5f2('0x2'),'required':![]},'paused':{'type':_0xf5f2('0x3'),'required':![]}};exports[_0xf5f2('0x4')]={'queue':{'type':_0xf5f2('0x1'),'required':!![]},'interface':{'type':'string','required':!![]}};exports['queuepause']={'interface':{'type':_0xf5f2('0x1'),'required':!![]},'paused':{'type':_0xf5f2('0x3')},'reason':{'type':_0xf5f2('0x1'),'required':![]}};exports[_0xf5f2('0x5')]={'module':{'type':_0xf5f2('0x1'),'required':![]}};exports[_0xf5f2('0x6')]={'uniqueid':{'type':'string','required':!![]}};exports[_0xf5f2('0x7')]={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]},'filename':{'type':_0xf5f2('0x1')},'format':{'type':'string'},'mixmonitorid':{'type':_0xf5f2('0x1')}};exports[_0xf5f2('0x8')]={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':'string'}}; \ No newline at end of file +var _0x5f2f=['number','boolean','queueremove','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','queueadd','string'];(function(_0xedf1fc,_0x205038){var _0x146a05=function(_0x2817ab){while(--_0x2817ab){_0xedf1fc['push'](_0xedf1fc['shift']());}};_0x146a05(++_0x205038);}(_0x5f2f,0x73));var _0xf5f2=function(_0x37f6e3,_0x157758){_0x37f6e3=_0x37f6e3-0x0;var _0x15a502=_0x5f2f[_0x37f6e3];return _0x15a502;};'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 3d2369d..471eccf 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 _0xba5d=['agents','telephones','trunks','voiceQueues','triggers','campaigns','templates','channels','queueChannels','outboundChannels','timers','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','hasOwnProperty','mapKeys','format','SIP/%s','isNil','interface','name','answered','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrAnswerCallsDay','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','length','isUndefined','initTelephones','initVoiceQueues','initTemplates','initZendeskAccounts','initFreshdeskAccounts','freshdeskAccounts','initZohoAccounts','initDeskAccounts','deskAccounts','vtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerexit','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerexitAt','total','queuecallercomplete','initVoiceCallReports','outbound','duration','disposition','ANSWERED','billableseconds','initCampaigns','initVoiceExtensions','voiceExtensions','merge','initFaxAccounts','exports','lodash','moment','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/campaign','../model/voiceExtension','../model/salesforceAccount','../model/freshdeskAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount'];(function(_0x1d830c,_0x13565f){var _0x4b638c=function(_0x4dce6){while(--_0x4dce6){_0x1d830c['push'](_0x1d830c['shift']());}};_0x4b638c(++_0x13565f);}(_0xba5d,0x18b));var _0xdba5=function(_0x3a9dd9,_0x93ae44){_0x3a9dd9=_0x3a9dd9-0x0;var _0x3ff267=_0xba5d[_0x3a9dd9];return _0x3ff267;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0xdba5('0x0'));var moment=require(_0xdba5('0x1'));var Agent=require(_0xdba5('0x2'));var Telephone=require(_0xdba5('0x3'));var Trunk=require(_0xdba5('0x4'));var VoiceQueue=require(_0xdba5('0x5'));var Trigger=require('../model/trigger');var Template=require('../model/template');var Campaign=require(_0xdba5('0x6'));var VoiceExtension=require(_0xdba5('0x7'));var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require(_0xdba5('0x8'));var FreshdeskAccount=require(_0xdba5('0x9'));var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require(_0xdba5('0xa'));var DeskAccount=require(_0xdba5('0xb'));var VtigerAccount=require(_0xdba5('0xc'));var ServicenowAccount=require(_0xdba5('0xd'));var Dynamics365Account=require(_0xdba5('0xe'));var FreshsalesAccount=require(_0xdba5('0xf'));var FaxAccount=require(_0xdba5('0x10'));var Realtime=function(){this[_0xdba5('0x11')]={};this[_0xdba5('0x12')]={};this[_0xdba5('0x13')]={};this[_0xdba5('0x14')]={};this[_0xdba5('0x15')]={};this[_0xdba5('0x16')]={};this[_0xdba5('0x17')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0xdba5('0x18')]={};this[_0xdba5('0x19')]={};this[_0xdba5('0x1a')]={};this[_0xdba5('0x1b')]={};this[_0xdba5('0x1c')]={};this[_0xdba5('0x1d')]={};this[_0xdba5('0x1e')]={};this['freshdeskAccounts']={};this[_0xdba5('0x1f')]={};this['deskAccounts']={};this['vtigerAccounts']={};this[_0xdba5('0x20')]={};this[_0xdba5('0x21')]={};this[_0xdba5('0x22')]={};this[_0xdba5('0x23')]={};};function freeIsNotKey(_0x5756ea,_0x2eeda6,_0x2697d0){var _0x17a64f=_['mapKeys'](_0x5756ea,function(_0x282d18,_0x5b6769){return _0x282d18[_0x2697d0];});for(var _0x4aee98 in _0x2eeda6){if(_0x2eeda6[_0xdba5('0x24')](_0x4aee98)){if(!_0x17a64f[_0x4aee98]){delete _0x2eeda6[_0x4aee98];}}}}function freeIsNotKeySip(_0xb8b5bd,_0x450112){var _0x39797e=_[_0xdba5('0x25')](_0xb8b5bd,function(_0x516eef,_0x38d9ed){return util[_0xdba5('0x26')](_0xdba5('0x27'),_0x516eef['name']);});for(var _0x4e0d36 in _0x450112){if(_0x450112[_0xdba5('0x24')](_0x4e0d36)){if(!_0x39797e[_0x4e0d36]){delete _0x450112[_0x4e0d36];}}}}function freeIsNotKeyAgent(_0x4ead6f,_0x57fcef){var _0x4f8bba=_[_0xdba5('0x25')](_0x4ead6f,function(_0x843616,_0x24d166){var _0x10a1e8=_[_0xdba5('0x28')](_0x843616[_0xdba5('0x29')])?util[_0xdba5('0x26')](_0xdba5('0x27'),_0x843616[_0xdba5('0x2a')]):_0x843616[_0xdba5('0x29')];return _0x10a1e8;});for(var _0x332fbc in _0x57fcef){if(_0x57fcef[_0xdba5('0x24')](_0x332fbc)){if(!_0x4f8bba[_0x332fbc]){delete _0x57fcef[_0x332fbc];}}}}function clearVoiceCallReports(_0x433148){_0x433148['total']=0x0;_0x433148[_0xdba5('0x2b')]=0x0;_0x433148[_0xdba5('0x2c')]=0x0;_0x433148[_0xdba5('0x2d')]=0x0;_0x433148[_0xdba5('0x2e')]=0x0;}function clearCampaigns(_0x897001){if(!_[_0xdba5('0x2f')](_0x897001)){for(var _0x26fa4b in _0x897001){if(_0x897001[_0xdba5('0x24')](_0x26fa4b)){_0x897001[_0x26fa4b]['ivrTotalCallsDays']=0x0;_0x897001[_0x26fa4b][_0xdba5('0x30')]=0x0;}}}}function clearVoiceQueues(_0x3b5c69){if(!_[_0xdba5('0x2f')](_0x3b5c69)){for(var _0x4c7d92 in _0x3b5c69){if(_0x3b5c69[_0xdba5('0x24')](_0x4c7d92)){_0x3b5c69[_0x4c7d92]['total']=0x0;_0x3b5c69[_0x4c7d92][_0xdba5('0x2b')]=0x0;_0x3b5c69[_0x4c7d92][_0xdba5('0x31')]=0x0;_0x3b5c69[_0x4c7d92][_0xdba5('0x32')]=0x0;_0x3b5c69[_0x4c7d92][_0xdba5('0x2c')]=0x0;_0x3b5c69[_0x4c7d92][_0xdba5('0x2d')]=0x0;_0x3b5c69[_0x4c7d92][_0xdba5('0x2e')]=0x0;_0x3b5c69[_0x4c7d92][_0xdba5('0x33')]=0x0;_0x3b5c69[_0x4c7d92]['outboundNoAnswerCallsDay']=0x0;_0x3b5c69[_0x4c7d92][_0xdba5('0x34')]=0x0;_0x3b5c69[_0x4c7d92][_0xdba5('0x35')]=0x0;_0x3b5c69[_0x4c7d92]['outboundNoSuchCallsDay']=0x0;_0x3b5c69[_0x4c7d92]['outboundUnknownCallsDay']=0x0;_0x3b5c69[_0x4c7d92]['outboundDropCallsDayTimeout']=0x0;_0x3b5c69[_0x4c7d92][_0xdba5('0x36')]=0x0;_0x3b5c69[_0x4c7d92][_0xdba5('0x37')]=0x0;_0x3b5c69[_0x4c7d92][_0xdba5('0x38')]=0x0;_0x3b5c69[_0x4c7d92][_0xdba5('0x39')]=0x0;_0x3b5c69[_0x4c7d92][_0xdba5('0x3a')]=0x0;_0x3b5c69[_0x4c7d92][_0xdba5('0x33')]=0x0;_0x3b5c69[_0x4c7d92]['outboundAnswerCallsDay']=0x0;_0x3b5c69[_0x4c7d92][_0xdba5('0x3b')]=!![];}}}}Realtime[_0xdba5('0x3c')][_0xdba5('0x3d')]=function(_0x4e4ad5,_0x22f11e){for(var _0xdf3df9 in _0x22f11e){if(_0x4e4ad5['hasOwnProperty'](_0xdf3df9)){_0x4e4ad5[_0xdf3df9]=_0x22f11e[_0xdf3df9];}}};Realtime['prototype'][_0xdba5('0x3e')]=function(){var _0x199f4e=this;return function(_0xdc60e0){if(_0xdc60e0){freeIsNotKeyAgent(_0xdc60e0,_0x199f4e[_0xdba5('0x11')]);for(var _0x10e065=0x0,_0x18687c={},_0x118b88={};_0x10e065<_0xdc60e0[_0xdba5('0x3f')];_0x10e065+=0x1){_0x18687c=_0xdc60e0[_0x10e065];var _0xe08943=_['isNil'](_0x18687c['interface'])?util[_0xdba5('0x26')](_0xdba5('0x27'),_0x18687c[_0xdba5('0x2a')]):_0x18687c[_0xdba5('0x29')];if(_[_0xdba5('0x40')](_0x199f4e[_0xdba5('0x11')][_0xe08943])){_0x199f4e[_0xdba5('0x11')][_0xe08943]=new Agent(_0x18687c);}else{_0x199f4e[_0xdba5('0x3d')](_0x199f4e[_0xdba5('0x11')][_0xe08943],_0x18687c);}}}return _0x199f4e[_0xdba5('0x11')];};};Realtime['prototype'][_0xdba5('0x41')]=function(){var _0x30fed2=this;return function(_0x5e7484){if(_0x5e7484){freeIsNotKeySip(_0x5e7484,_0x30fed2[_0xdba5('0x12')]);for(var _0x1d4274=0x0,_0x4edb4c={},_0x1b5f2b={};_0x1d4274<_0x5e7484[_0xdba5('0x3f')];_0x1d4274+=0x1){_0x4edb4c=_0x5e7484[_0x1d4274];if(_['isUndefined'](_0x30fed2['telephones'][util['format'](_0xdba5('0x27'),_0x4edb4c[_0xdba5('0x2a')])])){_0x30fed2[_0xdba5('0x12')][util[_0xdba5('0x26')]('SIP/%s',_0x4edb4c[_0xdba5('0x2a')])]=new Telephone(_0x4edb4c);}else{_0x30fed2[_0xdba5('0x3d')](_0x30fed2['telephones'][util[_0xdba5('0x26')](_0xdba5('0x27'),_0x4edb4c['name'])],_0x4edb4c);}}}return _0x30fed2['telephones'];};};Realtime['prototype']['initTrunks']=function(){var _0x3b33dd=this;return function(_0x4b176d){if(_0x4b176d){freeIsNotKeySip(_0x4b176d,_0x3b33dd[_0xdba5('0x13')]);for(var _0x2999dd=0x0,_0x3e0758={},_0x444f50={};_0x2999dd<_0x4b176d[_0xdba5('0x3f')];_0x2999dd+=0x1){_0x3e0758=_0x4b176d[_0x2999dd];if(_[_0xdba5('0x40')](_0x3b33dd[_0xdba5('0x13')][util[_0xdba5('0x26')](_0xdba5('0x27'),_0x3e0758['name'])])){_0x3b33dd[_0xdba5('0x13')][util[_0xdba5('0x26')](_0xdba5('0x27'),_0x3e0758[_0xdba5('0x2a')])]=new Trunk(_0x3e0758);}else{_0x3b33dd[_0xdba5('0x3d')](_0x3b33dd[_0xdba5('0x13')][util['format'](_0xdba5('0x27'),_0x3e0758[_0xdba5('0x2a')])],_0x3e0758);}}}return _0x3b33dd['trunks'];};};Realtime[_0xdba5('0x3c')][_0xdba5('0x42')]=function(){var _0x3f3f62=this;return function(_0x15799e){if(_0x15799e){freeIsNotKey(_0x15799e,_0x3f3f62['voiceQueues'],_0xdba5('0x2a'));for(var _0x8d13c6=0x0,_0x34a2e5={},_0xb336c2={};_0x8d13c6<_0x15799e[_0xdba5('0x3f')];_0x8d13c6+=0x1){_0x34a2e5=_0x15799e[_0x8d13c6];if(_[_0xdba5('0x40')](_0x3f3f62[_0xdba5('0x14')][_0x34a2e5[_0xdba5('0x2a')]])){_0x3f3f62[_0xdba5('0x14')][_0x34a2e5[_0xdba5('0x2a')]]=new VoiceQueue(_0x34a2e5);}else{_0x3f3f62[_0xdba5('0x3d')](_0x3f3f62['voiceQueues'][_0x34a2e5[_0xdba5('0x2a')]],_0x34a2e5);}}}return _0x3f3f62['voiceQueues'];};};Realtime[_0xdba5('0x3c')]['initTriggers']=function(){var _0x267ecb=this;return function(_0x330677){if(_0x330677){freeIsNotKey(_0x330677,_0x267ecb[_0xdba5('0x15')],'id');for(var _0x495f5f=0x0,_0x143162={},_0x12d2d5={};_0x495f5f<_0x330677[_0xdba5('0x3f')];_0x495f5f+=0x1){_0x143162=_0x330677[_0x495f5f];if(_['isUndefined'](_0x267ecb['triggers'][_0x143162['id']])){_0x267ecb[_0xdba5('0x15')][_0x143162['id']]=new Trigger(_0x143162);}else{_0x267ecb[_0xdba5('0x3d')](_0x267ecb[_0xdba5('0x15')][_0x143162['id']],_0x143162);}}}return _0x267ecb[_0xdba5('0x15')];};};Realtime[_0xdba5('0x3c')][_0xdba5('0x43')]=function(){var _0x5ab6ac=this;return function(_0x1f9c99){if(_0x1f9c99){freeIsNotKey(_0x1f9c99,_0x5ab6ac[_0xdba5('0x17')],'id');for(var _0x4174bd=0x0,_0x255c40={},_0x24ac66={};_0x4174bd<_0x1f9c99[_0xdba5('0x3f')];_0x4174bd+=0x1){_0x255c40=_0x1f9c99[_0x4174bd];if(_[_0xdba5('0x40')](_0x5ab6ac[_0xdba5('0x17')][_0x255c40['id']])){_0x5ab6ac[_0xdba5('0x17')][_0x255c40['id']]=new Template(_0x255c40);}else{_0x5ab6ac[_0xdba5('0x3d')](_0x5ab6ac['templates'][_0x255c40['id']],_0x255c40);}}}return _0x5ab6ac[_0xdba5('0x17')];};};Realtime[_0xdba5('0x3c')][_0xdba5('0x44')]=function(){var _0xbf6350=this;return function(_0x4228f9){if(_0x4228f9){freeIsNotKey(_0x4228f9,_0xbf6350[_0xdba5('0x1c')],'id');for(var _0x34c263=0x0,_0x4be315={},_0x26c406={};_0x34c263<_0x4228f9[_0xdba5('0x3f')];_0x34c263+=0x1){_0x4be315=_0x4228f9[_0x34c263];if(_[_0xdba5('0x40')](_0xbf6350['zendeskAccounts'][_0x4be315['id']])){_0xbf6350[_0xdba5('0x1c')][_0x4be315['id']]=new ZendeskAccount(_0x4be315);}else{_0xbf6350[_0xdba5('0x3d')](_0xbf6350[_0xdba5('0x1c')][_0x4be315['id']],_0x4be315);}}}return _0xbf6350[_0xdba5('0x1c')];};};Realtime[_0xdba5('0x3c')]['initSalesforceAccounts']=function(){var _0x8d6e1d=this;return function(_0x4a1f4b){if(_0x4a1f4b){freeIsNotKey(_0x4a1f4b,_0x8d6e1d[_0xdba5('0x1d')],'id');for(var _0xe531e0=0x0,_0x3b10c3={},_0x4eb150={};_0xe531e0<_0x4a1f4b[_0xdba5('0x3f')];_0xe531e0+=0x1){_0x3b10c3=_0x4a1f4b[_0xe531e0];if(_[_0xdba5('0x40')](_0x8d6e1d[_0xdba5('0x1d')][_0x3b10c3['id']])){_0x8d6e1d[_0xdba5('0x1d')][_0x3b10c3['id']]=new SalesforceAccount(_0x3b10c3);}else{_0x8d6e1d[_0xdba5('0x3d')](_0x8d6e1d[_0xdba5('0x1d')][_0x3b10c3['id']],_0x3b10c3);}}}return _0x8d6e1d['salesforceAccounts'];};};Realtime['prototype'][_0xdba5('0x45')]=function(){var _0x5d30b7=this;return function(_0x2468b1){if(_0x2468b1){freeIsNotKey(_0x2468b1,_0x5d30b7['freshdeskAccounts'],'id');for(var _0x202efe=0x0,_0x2d982f={},_0x984dcb={};_0x202efe<_0x2468b1['length'];_0x202efe+=0x1){_0x2d982f=_0x2468b1[_0x202efe];if(_[_0xdba5('0x40')](_0x5d30b7[_0xdba5('0x46')][_0x2d982f['id']])){_0x5d30b7['freshdeskAccounts'][_0x2d982f['id']]=new FreshdeskAccount(_0x2d982f);}else{_0x5d30b7[_0xdba5('0x3d')](_0x5d30b7[_0xdba5('0x46')][_0x2d982f['id']],_0x2d982f);}}}return _0x5d30b7[_0xdba5('0x46')];};};Realtime[_0xdba5('0x3c')][_0xdba5('0x47')]=function(){var _0x50ff90=this;return function(_0x4fa5ee){if(_0x4fa5ee){freeIsNotKey(_0x4fa5ee,_0x50ff90[_0xdba5('0x1f')],'id');for(var _0x2ed736=0x0,_0x25b290={},_0x2ca38a={};_0x2ed736<_0x4fa5ee['length'];_0x2ed736+=0x1){_0x25b290=_0x4fa5ee[_0x2ed736];if(_['isUndefined'](_0x50ff90['zohoAccounts'][_0x25b290['id']])){_0x50ff90[_0xdba5('0x1f')][_0x25b290['id']]=new ZohoAccount(_0x25b290);}else{_0x50ff90[_0xdba5('0x3d')](_0x50ff90[_0xdba5('0x1f')][_0x25b290['id']],_0x25b290);}}}return _0x50ff90['zohoAccounts'];};};Realtime[_0xdba5('0x3c')][_0xdba5('0x48')]=function(){var _0x1bccd6=this;return function(_0x1a8816){if(_0x1a8816){freeIsNotKey(_0x1a8816,_0x1bccd6['deskAccounts'],'id');for(var _0xd3828a=0x0,_0x38c74c={},_0x2b8c45={};_0xd3828a<_0x1a8816[_0xdba5('0x3f')];_0xd3828a+=0x1){_0x38c74c=_0x1a8816[_0xd3828a];if(_[_0xdba5('0x40')](_0x1bccd6[_0xdba5('0x49')][_0x38c74c['id']])){_0x1bccd6[_0xdba5('0x49')][_0x38c74c['id']]=new DeskAccount(_0x38c74c);}else{_0x1bccd6['mergeFromDatabase'](_0x1bccd6[_0xdba5('0x49')][_0x38c74c['id']],_0x38c74c);}}}return _0x1bccd6[_0xdba5('0x49')];};};Realtime[_0xdba5('0x3c')]['initSugarcrmAccounts']=function(){var _0x1bf434=this;return function(_0xb7a1d9){if(_0xb7a1d9){freeIsNotKey(_0xb7a1d9,_0x1bf434[_0xdba5('0x1e')],'id');for(var _0x4519a5=0x0,_0x2ab349={},_0x47373f={};_0x4519a5<_0xb7a1d9['length'];_0x4519a5+=0x1){_0x2ab349=_0xb7a1d9[_0x4519a5];if(_[_0xdba5('0x40')](_0x1bf434[_0xdba5('0x1e')][_0x2ab349['id']])){_0x1bf434['sugarcrmAccounts'][_0x2ab349['id']]=new SugarcrmAccount(_0x2ab349);}else{_0x1bf434['mergeFromDatabase'](_0x1bf434['sugarcrmAccounts'][_0x2ab349['id']],_0x2ab349);}}}return _0x1bf434[_0xdba5('0x1e')];};};Realtime[_0xdba5('0x3c')]['initVtigerAccounts']=function(){var _0x4774b5=this;return function(_0xeae6c4){if(_0xeae6c4){freeIsNotKey(_0xeae6c4,_0x4774b5[_0xdba5('0x4a')],'id');for(var _0x494a6d=0x0,_0x1e4847={},_0x1f7731={};_0x494a6d<_0xeae6c4[_0xdba5('0x3f')];_0x494a6d+=0x1){_0x1e4847=_0xeae6c4[_0x494a6d];if(_['isUndefined'](_0x4774b5[_0xdba5('0x4a')][_0x1e4847['id']])){_0x4774b5['vtigerAccounts'][_0x1e4847['id']]=new VtigerAccount(_0x1e4847);}else{_0x4774b5[_0xdba5('0x3d')](_0x4774b5[_0xdba5('0x4a')][_0x1e4847['id']],_0x1e4847);}}}return _0x4774b5[_0xdba5('0x4a')];};};Realtime[_0xdba5('0x3c')][_0xdba5('0x4b')]=function(){var _0x3c842a=this;return function(_0xa65348){if(_0xa65348){freeIsNotKey(_0xa65348,_0x3c842a['servicenowAccounts'],'id');for(var _0x31894d=0x0,_0x23089a={},_0x2ecaba={};_0x31894d<_0xa65348[_0xdba5('0x3f')];_0x31894d+=0x1){_0x23089a=_0xa65348[_0x31894d];if(_['isUndefined'](_0x3c842a['servicenowAccounts'][_0x23089a['id']])){_0x3c842a[_0xdba5('0x20')][_0x23089a['id']]=new ServicenowAccount(_0x23089a);}else{_0x3c842a[_0xdba5('0x3d')](_0x3c842a[_0xdba5('0x20')][_0x23089a['id']],_0x23089a);}}}return _0x3c842a[_0xdba5('0x20')];};};Realtime[_0xdba5('0x3c')][_0xdba5('0x4c')]=function(){var _0x554a07=this;return function(_0x1f00e6){if(_0x1f00e6){freeIsNotKey(_0x1f00e6,_0x554a07['dynamics365Accounts'],'id');for(var _0xaaab96=0x0,_0x581880={},_0x40bd0a={};_0xaaab96<_0x1f00e6[_0xdba5('0x3f')];_0xaaab96+=0x1){_0x581880=_0x1f00e6[_0xaaab96];if(_[_0xdba5('0x40')](_0x554a07[_0xdba5('0x21')][_0x581880['id']])){_0x554a07[_0xdba5('0x21')][_0x581880['id']]=new Dynamics365Account(_0x581880);}else{_0x554a07[_0xdba5('0x3d')](_0x554a07[_0xdba5('0x21')][_0x581880['id']],_0x581880);}}}return _0x554a07[_0xdba5('0x21')];};};Realtime[_0xdba5('0x3c')]['initFreshsalesAccounts']=function(){var _0x5c1f6d=this;return function(_0x4f3089){if(_0x4f3089){freeIsNotKey(_0x4f3089,_0x5c1f6d[_0xdba5('0x22')],'id');for(var _0x1345ef=0x0,_0x12e457={},_0x4ae1b8={};_0x1345ef<_0x4f3089['length'];_0x1345ef+=0x1){_0x12e457=_0x4f3089[_0x1345ef];if(_[_0xdba5('0x40')](_0x5c1f6d[_0xdba5('0x22')][_0x12e457['id']])){_0x5c1f6d[_0xdba5('0x22')][_0x12e457['id']]=new FreshsalesAccount(_0x12e457);}else{_0x5c1f6d['mergeFromDatabase'](_0x5c1f6d[_0xdba5('0x22')][_0x12e457['id']],_0x12e457);}}}return _0x5c1f6d[_0xdba5('0x22')];};};Realtime[_0xdba5('0x3c')]['initVoiceQueueHopperHistory']=function(){var _0x22edbd=this;return function(_0x2fcb1b){for(var _0x406a30=0x0;_0x406a30<_0x2fcb1b[_0xdba5('0x3f')];_0x406a30+=0x1){_['merge'](_0x22edbd[_0xdba5('0x14')][_0x2fcb1b[_0x406a30]['name']],_0x2fcb1b[_0x406a30]);}return _0x22edbd[_0xdba5('0x14')];};};Realtime[_0xdba5('0x3c')][_0xdba5('0x4d')]=function(){var _0x372ba4=this;return function(_0x455985){clearVoiceQueues(_0x372ba4[_0xdba5('0x14')]);if(_0x455985){_0x455985=_[_0xdba5('0x4e')](_0x455985,_0xdba5('0x4f'));for(var _0x468888 in _0x455985){if(_0x455985[_0xdba5('0x24')](_0x468888)){var _0x91369d={};for(var _0x21e167=0x0;_0x21e167<_0x455985[_0x468888][_0xdba5('0x3f')];_0x21e167+=0x1){var _0x3e2adc=_0x455985[_0x468888][_0x21e167][_0xdba5('0x50')];if(_0x372ba4[_0xdba5('0x14')][_0x3e2adc]){if(_0x455985[_0x468888][_0x21e167][_0xdba5('0x51')]){_0x372ba4[_0xdba5('0x14')][_0x3e2adc][_0xdba5('0x31')]+=0x1;}if(_0x455985[_0x468888][_0x21e167][_0xdba5('0x52')]){_0x372ba4['voiceQueues'][_0x3e2adc]['abandoned']+=0x1;}_0x372ba4['voiceQueues'][_0x3e2adc]['sumHoldTime']+=moment(_0x455985[_0x468888][_0x21e167][_0xdba5('0x53')])[_0xdba5('0x54')](moment(_0x455985[_0x468888][_0x21e167][_0xdba5('0x55')]),_0xdba5('0x56'))||0x0;if(_0x21e167===_0x455985[_0x468888][_0xdba5('0x3f')]-0x1){_0x372ba4[_0xdba5('0x14')][_0x3e2adc][_0xdba5('0x2d')]+=moment(_0x455985[_0x468888][_0x21e167][_0xdba5('0x57')]||_0x455985[_0x468888][_0x21e167]['queuecallerabandonAt']||_0x455985[_0x468888][_0x21e167][_0xdba5('0x58')])[_0xdba5('0x54')](moment(_0x455985[_0x468888][_0x21e167]['queuecallerjoinAt']),_0xdba5('0x56'))||0x0;_0x372ba4[_0xdba5('0x14')][_0x3e2adc][_0xdba5('0x59')]+=0x1;if(_0x455985[_0x468888][_0x21e167][_0xdba5('0x5a')]){_0x372ba4['voiceQueues'][_0x3e2adc][_0xdba5('0x2b')]+=0x1;_0x372ba4[_0xdba5('0x14')][_0x3e2adc][_0xdba5('0x2e')]+=moment(_0x455985[_0x468888][_0x21e167][_0xdba5('0x57')])[_0xdba5('0x54')](moment(_0x455985[_0x468888][_0x21e167][_0xdba5('0x53')]),_0xdba5('0x56'))||0x0;}}else{_0x372ba4[_0xdba5('0x14')][_0x3e2adc][_0xdba5('0x2d')]+=_0x372ba4[_0xdba5('0x14')][_0x3e2adc][_0xdba5('0x2c')]||0x0;}}}}}}return _0x372ba4[_0xdba5('0x14')];};};Realtime[_0xdba5('0x3c')][_0xdba5('0x5b')]=function(){var _0x3158d9=this;return function(_0x4819d8){clearVoiceCallReports(_0x3158d9[_0xdba5('0x5c')]);if(_0x4819d8){for(var _0x4911b9=0x0;_0x4911b9<_0x4819d8[_0xdba5('0x3f')];_0x4911b9+=0x1){_0x3158d9[_0xdba5('0x5c')][_0xdba5('0x59')]+=0x1;_0x3158d9['outbound'][_0xdba5('0x2d')]+=_0x4819d8[_0x4911b9][_0xdba5('0x5d')];if(_0x4819d8[_0x4911b9][_0xdba5('0x5e')]===_0xdba5('0x5f')){_0x3158d9['outbound'][_0xdba5('0x2b')]+=0x1;_0x3158d9[_0xdba5('0x5c')][_0xdba5('0x2c')]+=_0x4819d8[_0x4911b9][_0xdba5('0x5d')]-_0x4819d8[_0x4911b9][_0xdba5('0x60')]||0x0;_0x3158d9['outbound'][_0xdba5('0x2e')]+=_0x4819d8[_0x4911b9][_0xdba5('0x60')];}}}return _0x3158d9[_0xdba5('0x5c')];};};Realtime['prototype'][_0xdba5('0x61')]=function(){var _0x3b00e9=this;return function(_0x383585){if(_0x383585){freeIsNotKey(_0x383585,_0x3b00e9[_0xdba5('0x16')],_0xdba5('0x2a'));for(var _0xf0ef0b=0x0,_0x4931e0={};_0xf0ef0b<_0x383585[_0xdba5('0x3f')];_0xf0ef0b+=0x1){_0x4931e0=_0x383585[_0xf0ef0b];if(_[_0xdba5('0x40')](_0x3b00e9[_0xdba5('0x16')][_0x4931e0[_0xdba5('0x2a')]])){_0x3b00e9[_0xdba5('0x16')][_0x4931e0[_0xdba5('0x2a')]]=new Campaign(_0x4931e0);}else{_0x3b00e9[_0xdba5('0x3d')](_0x3b00e9[_0xdba5('0x16')][_0x4931e0[_0xdba5('0x2a')]],_0x4931e0);}}}return _0x3b00e9['campaigns'];};};Realtime[_0xdba5('0x3c')][_0xdba5('0x62')]=function(){var _0x270ec4=this;return function(_0x5cd93a){if(_0x5cd93a){freeIsNotKey(_0x5cd93a,_0x270ec4['voiceExtensions'],'id');for(var _0x5c5b0c=0x0,_0x2f1c9d={};_0x5c5b0c<_0x5cd93a[_0xdba5('0x3f')];_0x5c5b0c+=0x1){_0x2f1c9d=_0x5cd93a[_0x5c5b0c];if(_['isUndefined'](_0x270ec4['voiceExtensions'][_0x2f1c9d['id']])){_0x270ec4[_0xdba5('0x63')][_0x2f1c9d['id']]=new VoiceExtension(_0x2f1c9d);}else{_0x270ec4['mergeFromDatabase'](_0x270ec4[_0xdba5('0x63')][_0x2f1c9d['id']],_0x2f1c9d);}}}return _0x270ec4['voiceExtensions'];};};Realtime['prototype']['initCampaignHopperHistory']=function(){var _0x1fb5ef=this;return function(_0x1420db){clearCampaigns(_0x1fb5ef[_0xdba5('0x16')]);for(var _0x52da28=0x0;_0x52da28<_0x1420db['length'];_0x52da28+=0x1){_[_0xdba5('0x64')](_0x1fb5ef[_0xdba5('0x16')][_0x1420db[_0x52da28][_0xdba5('0x2a')]],_0x1420db[_0x52da28]);}return _0x1fb5ef['campaigns'];};};Realtime[_0xdba5('0x3c')][_0xdba5('0x65')]=function(){var _0x4973ff=this;return function(_0x52b672){if(_0x52b672){freeIsNotKey(_0x52b672,_0x4973ff[_0xdba5('0x23')],'id');for(var _0x270b6f=0x0,_0x409fb1={},_0x2ef40a={};_0x270b6f<_0x52b672[_0xdba5('0x3f')];_0x270b6f+=0x1){_0x409fb1=_0x52b672[_0x270b6f];if(_[_0xdba5('0x40')](_0x4973ff[_0xdba5('0x23')][_0x409fb1['id']])){_0x4973ff[_0xdba5('0x23')][_0x409fb1['id']]=new FaxAccount(_0x409fb1);}else{_0x4973ff[_0xdba5('0x3d')](_0x4973ff[_0xdba5('0x23')][_0x409fb1['id']],_0x409fb1);}}}return _0x4973ff['faxAccounts'];};};module[_0xdba5('0x66')]=Realtime; \ No newline at end of file +var _0x3c07=['queuecallerleaveAt','diff','queuecallerjoinAt','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','seconds','initVoiceCallReports','outbound','duration','disposition','billableseconds','campaigns','initVoiceExtensions','voiceExtensions','initCampaignHopperHistory','merge','initFaxAccounts','faxAccounts','bluebird','util','lodash','moment','../model/agent','../model/telephone','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','trunks','voiceQueues','triggers','templates','channels','queueChannels','outboundChannels','timers','zendeskAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','mapKeys','hasOwnProperty','format','SIP/%s','interface','name','answered','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','total','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','length','isUndefined','initTelephones','initTrunks','initVoiceQueues','initTemplates','initZendeskAccounts','initSalesforceAccounts','salesforceAccounts','initFreshdeskAccounts','freshdeskAccounts','initZohoAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','initVoiceQueueReports','uniqueid','queue','queuecallerexit','queuecallerabandon'];(function(_0xf0bcac,_0x531755){var _0x4e4c65=function(_0x35a77a){while(--_0x35a77a){_0xf0bcac['push'](_0xf0bcac['shift']());}};_0x4e4c65(++_0x531755);}(_0x3c07,0x80));var _0x73c0=function(_0x6978c0,_0x1f6765){_0x6978c0=_0x6978c0-0x0;var _0x361377=_0x3c07[_0x6978c0];return _0x361377;};'use strict';var BPromise=require(_0x73c0('0x0'));var util=require(_0x73c0('0x1'));var _=require(_0x73c0('0x2'));var moment=require(_0x73c0('0x3'));var Agent=require(_0x73c0('0x4'));var Telephone=require(_0x73c0('0x5'));var Trunk=require('../model/trunk');var VoiceQueue=require(_0x73c0('0x6'));var Trigger=require(_0x73c0('0x7'));var Template=require(_0x73c0('0x8'));var Campaign=require(_0x73c0('0x9'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require(_0x73c0('0xa'));var FreshdeskAccount=require(_0x73c0('0xb'));var SugarcrmAccount=require(_0x73c0('0xc'));var ZohoAccount=require(_0x73c0('0xd'));var DeskAccount=require(_0x73c0('0xe'));var VtigerAccount=require(_0x73c0('0xf'));var ServicenowAccount=require(_0x73c0('0x10'));var Dynamics365Account=require(_0x73c0('0x11'));var FreshsalesAccount=require(_0x73c0('0x12'));var FaxAccount=require(_0x73c0('0x13'));var Realtime=function(){this[_0x73c0('0x14')]={};this[_0x73c0('0x15')]={};this[_0x73c0('0x16')]={};this[_0x73c0('0x17')]={};this[_0x73c0('0x18')]={};this['campaigns']={};this[_0x73c0('0x19')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0x73c0('0x1a')]={};this[_0x73c0('0x1b')]={};this[_0x73c0('0x1c')]={};this[_0x73c0('0x1d')]={};this[_0x73c0('0x1e')]={};this['salesforceAccounts']={};this[_0x73c0('0x1f')]={};this['freshdeskAccounts']={};this[_0x73c0('0x20')]={};this[_0x73c0('0x21')]={};this[_0x73c0('0x22')]={};this[_0x73c0('0x23')]={};this[_0x73c0('0x24')]={};this[_0x73c0('0x25')]={};this['faxAccounts']={};};function freeIsNotKey(_0x3e523b,_0x1f2dff,_0x58d3ac){var _0x4ed4bc=_[_0x73c0('0x26')](_0x3e523b,function(_0x5125c0,_0x55e8c3){return _0x5125c0[_0x58d3ac];});for(var _0x24679b in _0x1f2dff){if(_0x1f2dff[_0x73c0('0x27')](_0x24679b)){if(!_0x4ed4bc[_0x24679b]){delete _0x1f2dff[_0x24679b];}}}}function freeIsNotKeySip(_0x484635,_0x1b966a){var _0x4f67a1=_[_0x73c0('0x26')](_0x484635,function(_0x1a7612,_0x4c2392){return util[_0x73c0('0x28')](_0x73c0('0x29'),_0x1a7612['name']);});for(var _0x146b02 in _0x1b966a){if(_0x1b966a[_0x73c0('0x27')](_0x146b02)){if(!_0x4f67a1[_0x146b02]){delete _0x1b966a[_0x146b02];}}}}function freeIsNotKeyAgent(_0x3722bc,_0x7838ec){var _0x14e4d0=_[_0x73c0('0x26')](_0x3722bc,function(_0x175677,_0x148516){var _0x504da5=_['isNil'](_0x175677[_0x73c0('0x2a')])?util[_0x73c0('0x28')](_0x73c0('0x29'),_0x175677[_0x73c0('0x2b')]):_0x175677[_0x73c0('0x2a')];return _0x504da5;});for(var _0x2fdd6b in _0x7838ec){if(_0x7838ec[_0x73c0('0x27')](_0x2fdd6b)){if(!_0x14e4d0[_0x2fdd6b]){delete _0x7838ec[_0x2fdd6b];}}}}function clearVoiceCallReports(_0x5d94f7){_0x5d94f7['total']=0x0;_0x5d94f7[_0x73c0('0x2c')]=0x0;_0x5d94f7[_0x73c0('0x2d')]=0x0;_0x5d94f7[_0x73c0('0x2e')]=0x0;_0x5d94f7[_0x73c0('0x2f')]=0x0;}function clearCampaigns(_0x2e76c1){if(!_[_0x73c0('0x30')](_0x2e76c1)){for(var _0x2f15bd in _0x2e76c1){if(_0x2e76c1[_0x73c0('0x27')](_0x2f15bd)){_0x2e76c1[_0x2f15bd][_0x73c0('0x31')]=0x0;_0x2e76c1[_0x2f15bd][_0x73c0('0x32')]=0x0;}}}}function clearVoiceQueues(_0x46ae2b){if(!_[_0x73c0('0x30')](_0x46ae2b)){for(var _0x5ef128 in _0x46ae2b){if(_0x46ae2b[_0x73c0('0x27')](_0x5ef128)){_0x46ae2b[_0x5ef128][_0x73c0('0x33')]=0x0;_0x46ae2b[_0x5ef128][_0x73c0('0x2c')]=0x0;_0x46ae2b[_0x5ef128][_0x73c0('0x34')]=0x0;_0x46ae2b[_0x5ef128][_0x73c0('0x35')]=0x0;_0x46ae2b[_0x5ef128][_0x73c0('0x2d')]=0x0;_0x46ae2b[_0x5ef128][_0x73c0('0x2e')]=0x0;_0x46ae2b[_0x5ef128]['sumBillable']=0x0;_0x46ae2b[_0x5ef128][_0x73c0('0x36')]=0x0;_0x46ae2b[_0x5ef128][_0x73c0('0x37')]=0x0;_0x46ae2b[_0x5ef128][_0x73c0('0x38')]=0x0;_0x46ae2b[_0x5ef128]['outboundCongestionCallsDay']=0x0;_0x46ae2b[_0x5ef128][_0x73c0('0x39')]=0x0;_0x46ae2b[_0x5ef128][_0x73c0('0x3a')]=0x0;_0x46ae2b[_0x5ef128][_0x73c0('0x3b')]=0x0;_0x46ae2b[_0x5ef128][_0x73c0('0x3c')]=0x0;_0x46ae2b[_0x5ef128]['outboundBlacklistCallsDay']=0x0;_0x46ae2b[_0x5ef128]['outboundOriginateFailureCallsDay']=0x0;_0x46ae2b[_0x5ef128]['outboundRejectCallsDay']=0x0;_0x46ae2b[_0x5ef128][_0x73c0('0x3d')]=0x0;_0x46ae2b[_0x5ef128][_0x73c0('0x36')]=0x0;_0x46ae2b[_0x5ef128][_0x73c0('0x3e')]=0x0;_0x46ae2b[_0x5ef128][_0x73c0('0x3f')]=!![];}}}}Realtime[_0x73c0('0x40')][_0x73c0('0x41')]=function(_0x3bc15a,_0x3e6521){for(var _0x1ef0fd in _0x3e6521){if(_0x3bc15a[_0x73c0('0x27')](_0x1ef0fd)){_0x3bc15a[_0x1ef0fd]=_0x3e6521[_0x1ef0fd];}}};Realtime[_0x73c0('0x40')][_0x73c0('0x42')]=function(){var _0x5a3425=this;return function(_0x5cfe53){if(_0x5cfe53){freeIsNotKeyAgent(_0x5cfe53,_0x5a3425['agents']);for(var _0x40c033=0x0,_0x3074fe={},_0x4d4604={};_0x40c033<_0x5cfe53[_0x73c0('0x43')];_0x40c033+=0x1){_0x3074fe=_0x5cfe53[_0x40c033];var _0x4b7061=_['isNil'](_0x3074fe[_0x73c0('0x2a')])?util[_0x73c0('0x28')](_0x73c0('0x29'),_0x3074fe[_0x73c0('0x2b')]):_0x3074fe[_0x73c0('0x2a')];if(_[_0x73c0('0x44')](_0x5a3425['agents'][_0x4b7061])){_0x5a3425['agents'][_0x4b7061]=new Agent(_0x3074fe);}else{_0x5a3425[_0x73c0('0x41')](_0x5a3425[_0x73c0('0x14')][_0x4b7061],_0x3074fe);}}}return _0x5a3425[_0x73c0('0x14')];};};Realtime[_0x73c0('0x40')][_0x73c0('0x45')]=function(){var _0x2769b4=this;return function(_0x1d2199){if(_0x1d2199){freeIsNotKeySip(_0x1d2199,_0x2769b4[_0x73c0('0x15')]);for(var _0x43372b=0x0,_0x3f6677={},_0x17dcfd={};_0x43372b<_0x1d2199['length'];_0x43372b+=0x1){_0x3f6677=_0x1d2199[_0x43372b];if(_[_0x73c0('0x44')](_0x2769b4['telephones'][util[_0x73c0('0x28')]('SIP/%s',_0x3f6677[_0x73c0('0x2b')])])){_0x2769b4['telephones'][util[_0x73c0('0x28')](_0x73c0('0x29'),_0x3f6677['name'])]=new Telephone(_0x3f6677);}else{_0x2769b4['mergeFromDatabase'](_0x2769b4[_0x73c0('0x15')][util[_0x73c0('0x28')](_0x73c0('0x29'),_0x3f6677[_0x73c0('0x2b')])],_0x3f6677);}}}return _0x2769b4[_0x73c0('0x15')];};};Realtime[_0x73c0('0x40')][_0x73c0('0x46')]=function(){var _0x2b42f1=this;return function(_0x5acdc3){if(_0x5acdc3){freeIsNotKeySip(_0x5acdc3,_0x2b42f1[_0x73c0('0x16')]);for(var _0x22a1f1=0x0,_0x24dbfc={},_0x413d80={};_0x22a1f1<_0x5acdc3[_0x73c0('0x43')];_0x22a1f1+=0x1){_0x24dbfc=_0x5acdc3[_0x22a1f1];if(_['isUndefined'](_0x2b42f1[_0x73c0('0x16')][util['format'](_0x73c0('0x29'),_0x24dbfc[_0x73c0('0x2b')])])){_0x2b42f1[_0x73c0('0x16')][util['format'](_0x73c0('0x29'),_0x24dbfc[_0x73c0('0x2b')])]=new Trunk(_0x24dbfc);}else{_0x2b42f1['mergeFromDatabase'](_0x2b42f1[_0x73c0('0x16')][util[_0x73c0('0x28')](_0x73c0('0x29'),_0x24dbfc[_0x73c0('0x2b')])],_0x24dbfc);}}}return _0x2b42f1['trunks'];};};Realtime[_0x73c0('0x40')][_0x73c0('0x47')]=function(){var _0x5236f0=this;return function(_0x48cbd7){if(_0x48cbd7){freeIsNotKey(_0x48cbd7,_0x5236f0['voiceQueues'],'name');for(var _0x43eb0e=0x0,_0x4ff388={},_0x2615ee={};_0x43eb0e<_0x48cbd7[_0x73c0('0x43')];_0x43eb0e+=0x1){_0x4ff388=_0x48cbd7[_0x43eb0e];if(_[_0x73c0('0x44')](_0x5236f0[_0x73c0('0x17')][_0x4ff388[_0x73c0('0x2b')]])){_0x5236f0[_0x73c0('0x17')][_0x4ff388[_0x73c0('0x2b')]]=new VoiceQueue(_0x4ff388);}else{_0x5236f0[_0x73c0('0x41')](_0x5236f0[_0x73c0('0x17')][_0x4ff388[_0x73c0('0x2b')]],_0x4ff388);}}}return _0x5236f0[_0x73c0('0x17')];};};Realtime['prototype']['initTriggers']=function(){var _0x2d6723=this;return function(_0x45d727){if(_0x45d727){freeIsNotKey(_0x45d727,_0x2d6723[_0x73c0('0x18')],'id');for(var _0x42a96b=0x0,_0x2102f5={},_0x588c15={};_0x42a96b<_0x45d727['length'];_0x42a96b+=0x1){_0x2102f5=_0x45d727[_0x42a96b];if(_[_0x73c0('0x44')](_0x2d6723[_0x73c0('0x18')][_0x2102f5['id']])){_0x2d6723[_0x73c0('0x18')][_0x2102f5['id']]=new Trigger(_0x2102f5);}else{_0x2d6723[_0x73c0('0x41')](_0x2d6723[_0x73c0('0x18')][_0x2102f5['id']],_0x2102f5);}}}return _0x2d6723['triggers'];};};Realtime[_0x73c0('0x40')][_0x73c0('0x48')]=function(){var _0x26792a=this;return function(_0x5128e6){if(_0x5128e6){freeIsNotKey(_0x5128e6,_0x26792a[_0x73c0('0x19')],'id');for(var _0x72e28b=0x0,_0x27ad7a={},_0x1556dc={};_0x72e28b<_0x5128e6[_0x73c0('0x43')];_0x72e28b+=0x1){_0x27ad7a=_0x5128e6[_0x72e28b];if(_[_0x73c0('0x44')](_0x26792a[_0x73c0('0x19')][_0x27ad7a['id']])){_0x26792a['templates'][_0x27ad7a['id']]=new Template(_0x27ad7a);}else{_0x26792a[_0x73c0('0x41')](_0x26792a[_0x73c0('0x19')][_0x27ad7a['id']],_0x27ad7a);}}}return _0x26792a[_0x73c0('0x19')];};};Realtime[_0x73c0('0x40')][_0x73c0('0x49')]=function(){var _0x1abdb6=this;return function(_0xd1bb0c){if(_0xd1bb0c){freeIsNotKey(_0xd1bb0c,_0x1abdb6[_0x73c0('0x1e')],'id');for(var _0x53e565=0x0,_0x5aa457={},_0x2466ec={};_0x53e565<_0xd1bb0c['length'];_0x53e565+=0x1){_0x5aa457=_0xd1bb0c[_0x53e565];if(_[_0x73c0('0x44')](_0x1abdb6[_0x73c0('0x1e')][_0x5aa457['id']])){_0x1abdb6[_0x73c0('0x1e')][_0x5aa457['id']]=new ZendeskAccount(_0x5aa457);}else{_0x1abdb6[_0x73c0('0x41')](_0x1abdb6[_0x73c0('0x1e')][_0x5aa457['id']],_0x5aa457);}}}return _0x1abdb6[_0x73c0('0x1e')];};};Realtime['prototype'][_0x73c0('0x4a')]=function(){var _0x41db60=this;return function(_0x4b715d){if(_0x4b715d){freeIsNotKey(_0x4b715d,_0x41db60[_0x73c0('0x4b')],'id');for(var _0x1f2101=0x0,_0x2c5368={},_0x4a5a32={};_0x1f2101<_0x4b715d[_0x73c0('0x43')];_0x1f2101+=0x1){_0x2c5368=_0x4b715d[_0x1f2101];if(_[_0x73c0('0x44')](_0x41db60['salesforceAccounts'][_0x2c5368['id']])){_0x41db60[_0x73c0('0x4b')][_0x2c5368['id']]=new SalesforceAccount(_0x2c5368);}else{_0x41db60['mergeFromDatabase'](_0x41db60[_0x73c0('0x4b')][_0x2c5368['id']],_0x2c5368);}}}return _0x41db60[_0x73c0('0x4b')];};};Realtime[_0x73c0('0x40')][_0x73c0('0x4c')]=function(){var _0xad7e6a=this;return function(_0x5c0d3c){if(_0x5c0d3c){freeIsNotKey(_0x5c0d3c,_0xad7e6a['freshdeskAccounts'],'id');for(var _0x32b09e=0x0,_0x171f65={},_0x39b155={};_0x32b09e<_0x5c0d3c[_0x73c0('0x43')];_0x32b09e+=0x1){_0x171f65=_0x5c0d3c[_0x32b09e];if(_[_0x73c0('0x44')](_0xad7e6a[_0x73c0('0x4d')][_0x171f65['id']])){_0xad7e6a[_0x73c0('0x4d')][_0x171f65['id']]=new FreshdeskAccount(_0x171f65);}else{_0xad7e6a['mergeFromDatabase'](_0xad7e6a[_0x73c0('0x4d')][_0x171f65['id']],_0x171f65);}}}return _0xad7e6a['freshdeskAccounts'];};};Realtime[_0x73c0('0x40')][_0x73c0('0x4e')]=function(){var _0x56414a=this;return function(_0x57caa6){if(_0x57caa6){freeIsNotKey(_0x57caa6,_0x56414a[_0x73c0('0x20')],'id');for(var _0x55de4a=0x0,_0x71e9cd={},_0x2c7a71={};_0x55de4a<_0x57caa6[_0x73c0('0x43')];_0x55de4a+=0x1){_0x71e9cd=_0x57caa6[_0x55de4a];if(_[_0x73c0('0x44')](_0x56414a[_0x73c0('0x20')][_0x71e9cd['id']])){_0x56414a[_0x73c0('0x20')][_0x71e9cd['id']]=new ZohoAccount(_0x71e9cd);}else{_0x56414a['mergeFromDatabase'](_0x56414a[_0x73c0('0x20')][_0x71e9cd['id']],_0x71e9cd);}}}return _0x56414a[_0x73c0('0x20')];};};Realtime[_0x73c0('0x40')]['initDeskAccounts']=function(){var _0x4a5c49=this;return function(_0x55c590){if(_0x55c590){freeIsNotKey(_0x55c590,_0x4a5c49['deskAccounts'],'id');for(var _0x123d50=0x0,_0x4cc3bc={},_0x21c820={};_0x123d50<_0x55c590['length'];_0x123d50+=0x1){_0x4cc3bc=_0x55c590[_0x123d50];if(_[_0x73c0('0x44')](_0x4a5c49['deskAccounts'][_0x4cc3bc['id']])){_0x4a5c49[_0x73c0('0x21')][_0x4cc3bc['id']]=new DeskAccount(_0x4cc3bc);}else{_0x4a5c49['mergeFromDatabase'](_0x4a5c49[_0x73c0('0x21')][_0x4cc3bc['id']],_0x4cc3bc);}}}return _0x4a5c49[_0x73c0('0x21')];};};Realtime[_0x73c0('0x40')][_0x73c0('0x4f')]=function(){var _0x34b48a=this;return function(_0x4fece3){if(_0x4fece3){freeIsNotKey(_0x4fece3,_0x34b48a['sugarcrmAccounts'],'id');for(var _0x563368=0x0,_0x3d22bd={},_0x330245={};_0x563368<_0x4fece3[_0x73c0('0x43')];_0x563368+=0x1){_0x3d22bd=_0x4fece3[_0x563368];if(_[_0x73c0('0x44')](_0x34b48a[_0x73c0('0x1f')][_0x3d22bd['id']])){_0x34b48a[_0x73c0('0x1f')][_0x3d22bd['id']]=new SugarcrmAccount(_0x3d22bd);}else{_0x34b48a['mergeFromDatabase'](_0x34b48a[_0x73c0('0x1f')][_0x3d22bd['id']],_0x3d22bd);}}}return _0x34b48a['sugarcrmAccounts'];};};Realtime['prototype'][_0x73c0('0x50')]=function(){var _0x364dc7=this;return function(_0x2a1ebe){if(_0x2a1ebe){freeIsNotKey(_0x2a1ebe,_0x364dc7[_0x73c0('0x22')],'id');for(var _0xe872b6=0x0,_0x14ba69={},_0x1af2a0={};_0xe872b6<_0x2a1ebe[_0x73c0('0x43')];_0xe872b6+=0x1){_0x14ba69=_0x2a1ebe[_0xe872b6];if(_[_0x73c0('0x44')](_0x364dc7[_0x73c0('0x22')][_0x14ba69['id']])){_0x364dc7[_0x73c0('0x22')][_0x14ba69['id']]=new VtigerAccount(_0x14ba69);}else{_0x364dc7['mergeFromDatabase'](_0x364dc7[_0x73c0('0x22')][_0x14ba69['id']],_0x14ba69);}}}return _0x364dc7[_0x73c0('0x22')];};};Realtime[_0x73c0('0x40')][_0x73c0('0x51')]=function(){var _0x1c3794=this;return function(_0x27f767){if(_0x27f767){freeIsNotKey(_0x27f767,_0x1c3794['servicenowAccounts'],'id');for(var _0x3b0d49=0x0,_0x2bb445={},_0x13ff14={};_0x3b0d49<_0x27f767[_0x73c0('0x43')];_0x3b0d49+=0x1){_0x2bb445=_0x27f767[_0x3b0d49];if(_[_0x73c0('0x44')](_0x1c3794[_0x73c0('0x23')][_0x2bb445['id']])){_0x1c3794[_0x73c0('0x23')][_0x2bb445['id']]=new ServicenowAccount(_0x2bb445);}else{_0x1c3794['mergeFromDatabase'](_0x1c3794['servicenowAccounts'][_0x2bb445['id']],_0x2bb445);}}}return _0x1c3794[_0x73c0('0x23')];};};Realtime[_0x73c0('0x40')][_0x73c0('0x52')]=function(){var _0x5cf128=this;return function(_0x84d9a){if(_0x84d9a){freeIsNotKey(_0x84d9a,_0x5cf128[_0x73c0('0x24')],'id');for(var _0x3601f2=0x0,_0x3acee9={},_0x51e8aa={};_0x3601f2<_0x84d9a[_0x73c0('0x43')];_0x3601f2+=0x1){_0x3acee9=_0x84d9a[_0x3601f2];if(_[_0x73c0('0x44')](_0x5cf128['dynamics365Accounts'][_0x3acee9['id']])){_0x5cf128[_0x73c0('0x24')][_0x3acee9['id']]=new Dynamics365Account(_0x3acee9);}else{_0x5cf128[_0x73c0('0x41')](_0x5cf128[_0x73c0('0x24')][_0x3acee9['id']],_0x3acee9);}}}return _0x5cf128[_0x73c0('0x24')];};};Realtime['prototype'][_0x73c0('0x53')]=function(){var _0x3b4241=this;return function(_0x4737f4){if(_0x4737f4){freeIsNotKey(_0x4737f4,_0x3b4241['freshsalesAccounts'],'id');for(var _0x8ea939=0x0,_0x1d0277={},_0x43cc93={};_0x8ea939<_0x4737f4[_0x73c0('0x43')];_0x8ea939+=0x1){_0x1d0277=_0x4737f4[_0x8ea939];if(_[_0x73c0('0x44')](_0x3b4241[_0x73c0('0x25')][_0x1d0277['id']])){_0x3b4241[_0x73c0('0x25')][_0x1d0277['id']]=new FreshsalesAccount(_0x1d0277);}else{_0x3b4241[_0x73c0('0x41')](_0x3b4241[_0x73c0('0x25')][_0x1d0277['id']],_0x1d0277);}}}return _0x3b4241[_0x73c0('0x25')];};};Realtime[_0x73c0('0x40')][_0x73c0('0x54')]=function(){var _0x481d29=this;return function(_0x56f61b){for(var _0x57216f=0x0;_0x57216f<_0x56f61b['length'];_0x57216f+=0x1){_['merge'](_0x481d29[_0x73c0('0x17')][_0x56f61b[_0x57216f][_0x73c0('0x2b')]],_0x56f61b[_0x57216f]);}return _0x481d29[_0x73c0('0x17')];};};Realtime[_0x73c0('0x40')][_0x73c0('0x55')]=function(){var _0x510eed=this;return function(_0x148b72){clearVoiceQueues(_0x510eed[_0x73c0('0x17')]);if(_0x148b72){_0x148b72=_['groupBy'](_0x148b72,_0x73c0('0x56'));for(var _0x3e620e in _0x148b72){if(_0x148b72[_0x73c0('0x27')](_0x3e620e)){var _0x1cc5e7={};for(var _0x1a6c4c=0x0;_0x1a6c4c<_0x148b72[_0x3e620e][_0x73c0('0x43')];_0x1a6c4c+=0x1){var _0x4cc1d2=_0x148b72[_0x3e620e][_0x1a6c4c][_0x73c0('0x57')];if(_0x510eed[_0x73c0('0x17')][_0x4cc1d2]){if(_0x148b72[_0x3e620e][_0x1a6c4c][_0x73c0('0x58')]){_0x510eed[_0x73c0('0x17')][_0x4cc1d2]['unmanaged']+=0x1;}if(_0x148b72[_0x3e620e][_0x1a6c4c][_0x73c0('0x59')]){_0x510eed[_0x73c0('0x17')][_0x4cc1d2][_0x73c0('0x35')]+=0x1;}_0x510eed[_0x73c0('0x17')][_0x4cc1d2]['sumHoldTime']+=moment(_0x148b72[_0x3e620e][_0x1a6c4c][_0x73c0('0x5a')])[_0x73c0('0x5b')](moment(_0x148b72[_0x3e620e][_0x1a6c4c][_0x73c0('0x5c')]),'seconds')||0x0;if(_0x1a6c4c===_0x148b72[_0x3e620e][_0x73c0('0x43')]-0x1){_0x510eed['voiceQueues'][_0x4cc1d2][_0x73c0('0x2e')]+=moment(_0x148b72[_0x3e620e][_0x1a6c4c][_0x73c0('0x5d')]||_0x148b72[_0x3e620e][_0x1a6c4c][_0x73c0('0x5e')]||_0x148b72[_0x3e620e][_0x1a6c4c][_0x73c0('0x5f')])[_0x73c0('0x5b')](moment(_0x148b72[_0x3e620e][_0x1a6c4c]['queuecallerjoinAt']),_0x73c0('0x60'))||0x0;_0x510eed[_0x73c0('0x17')][_0x4cc1d2]['total']+=0x1;if(_0x148b72[_0x3e620e][_0x1a6c4c]['queuecallercomplete']){_0x510eed[_0x73c0('0x17')][_0x4cc1d2]['answered']+=0x1;_0x510eed[_0x73c0('0x17')][_0x4cc1d2][_0x73c0('0x2f')]+=moment(_0x148b72[_0x3e620e][_0x1a6c4c][_0x73c0('0x5d')])[_0x73c0('0x5b')](moment(_0x148b72[_0x3e620e][_0x1a6c4c]['queuecallerleaveAt']),_0x73c0('0x60'))||0x0;}}else{_0x510eed['voiceQueues'][_0x4cc1d2][_0x73c0('0x2e')]+=_0x510eed['voiceQueues'][_0x4cc1d2][_0x73c0('0x2d')]||0x0;}}}}}}return _0x510eed['voiceQueues'];};};Realtime[_0x73c0('0x40')][_0x73c0('0x61')]=function(){var _0x4739fe=this;return function(_0x198e01){clearVoiceCallReports(_0x4739fe['outbound']);if(_0x198e01){for(var _0x269233=0x0;_0x269233<_0x198e01[_0x73c0('0x43')];_0x269233+=0x1){_0x4739fe[_0x73c0('0x62')][_0x73c0('0x33')]+=0x1;_0x4739fe['outbound'][_0x73c0('0x2e')]+=_0x198e01[_0x269233][_0x73c0('0x63')];if(_0x198e01[_0x269233][_0x73c0('0x64')]==='ANSWERED'){_0x4739fe[_0x73c0('0x62')][_0x73c0('0x2c')]+=0x1;_0x4739fe[_0x73c0('0x62')][_0x73c0('0x2d')]+=_0x198e01[_0x269233][_0x73c0('0x63')]-_0x198e01[_0x269233][_0x73c0('0x65')]||0x0;_0x4739fe[_0x73c0('0x62')][_0x73c0('0x2f')]+=_0x198e01[_0x269233]['billableseconds'];}}}return _0x4739fe[_0x73c0('0x62')];};};Realtime['prototype']['initCampaigns']=function(){var _0x1fcfed=this;return function(_0x1c6853){if(_0x1c6853){freeIsNotKey(_0x1c6853,_0x1fcfed[_0x73c0('0x66')],_0x73c0('0x2b'));for(var _0x70cb77=0x0,_0x2f118f={};_0x70cb77<_0x1c6853[_0x73c0('0x43')];_0x70cb77+=0x1){_0x2f118f=_0x1c6853[_0x70cb77];if(_[_0x73c0('0x44')](_0x1fcfed['campaigns'][_0x2f118f[_0x73c0('0x2b')]])){_0x1fcfed[_0x73c0('0x66')][_0x2f118f['name']]=new Campaign(_0x2f118f);}else{_0x1fcfed[_0x73c0('0x41')](_0x1fcfed[_0x73c0('0x66')][_0x2f118f['name']],_0x2f118f);}}}return _0x1fcfed[_0x73c0('0x66')];};};Realtime[_0x73c0('0x40')][_0x73c0('0x67')]=function(){var _0x2be66f=this;return function(_0x233b5b){if(_0x233b5b){freeIsNotKey(_0x233b5b,_0x2be66f['voiceExtensions'],'id');for(var _0x525861=0x0,_0x35c7f5={};_0x525861<_0x233b5b[_0x73c0('0x43')];_0x525861+=0x1){_0x35c7f5=_0x233b5b[_0x525861];if(_['isUndefined'](_0x2be66f[_0x73c0('0x68')][_0x35c7f5['id']])){_0x2be66f['voiceExtensions'][_0x35c7f5['id']]=new VoiceExtension(_0x35c7f5);}else{_0x2be66f[_0x73c0('0x41')](_0x2be66f[_0x73c0('0x68')][_0x35c7f5['id']],_0x35c7f5);}}}return _0x2be66f[_0x73c0('0x68')];};};Realtime[_0x73c0('0x40')][_0x73c0('0x69')]=function(){var _0x5ccc7b=this;return function(_0x15a102){clearCampaigns(_0x5ccc7b[_0x73c0('0x66')]);for(var _0x5e8a1f=0x0;_0x5e8a1f<_0x15a102['length'];_0x5e8a1f+=0x1){_[_0x73c0('0x6a')](_0x5ccc7b[_0x73c0('0x66')][_0x15a102[_0x5e8a1f][_0x73c0('0x2b')]],_0x15a102[_0x5e8a1f]);}return _0x5ccc7b[_0x73c0('0x66')];};};Realtime[_0x73c0('0x40')][_0x73c0('0x6b')]=function(){var _0x263a21=this;return function(_0x391039){if(_0x391039){freeIsNotKey(_0x391039,_0x263a21[_0x73c0('0x6c')],'id');for(var _0x2b27b0=0x0,_0x5c85be={},_0x49aab2={};_0x2b27b0<_0x391039[_0x73c0('0x43')];_0x2b27b0+=0x1){_0x5c85be=_0x391039[_0x2b27b0];if(_[_0x73c0('0x44')](_0x263a21['faxAccounts'][_0x5c85be['id']])){_0x263a21[_0x73c0('0x6c')][_0x5c85be['id']]=new FaxAccount(_0x5c85be);}else{_0x263a21[_0x73c0('0x41')](_0x263a21[_0x73c0('0x6c')][_0x5c85be['id']],_0x5c85be);}}}return _0x263a21['faxAccounts'];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 5abd7ca..3e7ce63 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 _0xe270=['util','../../../config/logger','ami','../ami','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','agents','telephones','prototype','sync','realtime','xdr','disabled','custom:voiceQueueReport','voiceCallReport','bind','custom:voiceAgentReport','voiceAgentReport','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','findAgent','find','accountcode','name','isNil','interface','format','SIP/%s','voiceQueueReport','connectedlinenum','lastAssignedTo','queuecallercomplete','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match','destination','exten','type','dialer','lastapplication','queue','lastdata','context','callerid','from-sip','xcally-motion-preview','calleridpreview','originatecalleridnum','channel','calleridnum','disposition','ANSWERED','calleridname','monitor','monitors','length','monitorFilename','filename','createdAt','connectedlinename','membername','xcally-motion-dialer','isArray','startsWith','substring','mobile','phone','indexOf','exports','lodash','moment'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xe270,0xa4));var _0x0e27=function(_0x5b89c7,_0x22994c){_0x5b89c7=_0x5b89c7-0x0;var _0x332b50=_0xe270[_0x5b89c7];return _0x332b50;};'use strict';var BPromise=require('bluebird');var _=require(_0x0e27('0x0'));var moment=require(_0x0e27('0x1'));var util=require(_0x0e27('0x2'));var config=require('../../../config/environment');var logger=require(_0x0e27('0x3'))(_0x0e27('0x4'));var ami=require(_0x0e27('0x5'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0x0e27('0x6'));var RpcVoiceDialReport=require(_0x0e27('0x7'));var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require(_0x0e27('0x8'));var RpcVoiceRecording=require(_0x0e27('0x9'));var RpcVoiceTransferReport=require(_0x0e27('0xa'));var VoiceQueueReport=require('./voiceQueueReport');var VoiceCallReport=require(_0x0e27('0xb'));var VoiceAgentReport=require(_0x0e27('0xc'));var VoiceDialReport=require(_0x0e27('0xd'));var UserReport=require(_0x0e27('0xe'));function Report(_0x3e5047){this['realtime']=_0x3e5047;this[_0x0e27('0xf')]=_0x3e5047[_0x0e27('0xf')];this[_0x0e27('0x10')]=_0x3e5047[_0x0e27('0x10')];}Report[_0x0e27('0x11')][_0x0e27('0x12')]=function(_0xcb7ef5){var _0x1f8ba7=new VoiceQueueReport(this[_0x0e27('0x13')]);var _0x2f7cff=new VoiceAgentReport(this['realtime']);var _0x142bfd=new VoiceDialReport(this[_0x0e27('0x13')]);var _0x4e7206=new VoiceCallReport(this[_0x0e27('0x13')]);var _0x2f162d=new UserReport(this[_0x0e27('0x13')]);if(config[_0x0e27('0x14')]&&config[_0x0e27('0x14')][_0x0e27('0x15')]){ami['on'](_0x0e27('0x16'),this['voiceQueueReport']['bind'](this));ami['on']('custom:voiceCallReport',this[_0x0e27('0x17')][_0x0e27('0x18')](this));ami['on'](_0x0e27('0x19'),this[_0x0e27('0x1a')][_0x0e27('0x18')](this));ami['on']('custom:voiceDialReport',this[_0x0e27('0x1b')][_0x0e27('0x18')](this));ami['on'](_0x0e27('0x1c'),this[_0x0e27('0x1d')][_0x0e27('0x18')](this));ami['on'](_0x0e27('0x1e'),this[_0x0e27('0x1f')][_0x0e27('0x18')](this));}};Report['prototype'][_0x0e27('0x20')]=function(_0x30766c){var _0x45d05f=undefined;_0x45d05f=_[_0x0e27('0x21')](this[_0x0e27('0xf')],function(_0x1cf80c){return _0x1cf80c[_0x0e27('0x22')]==_0x30766c||_0x1cf80c[_0x0e27('0x23')]==_0x30766c;});if(_[_0x0e27('0x24')](_0x45d05f)){var _0x1d37f2=_[_0x0e27('0x21')](this['telephones'],function(_0x544b31){return _0x544b31[_0x0e27('0x22')]==_0x30766c||_0x544b31['name']==_0x30766c;});if(_0x1d37f2){_0x45d05f=_[_0x0e27('0x21')](this[_0x0e27('0xf')],function(_0x53f48a){return _0x53f48a[_0x0e27('0x25')]==util[_0x0e27('0x26')](_0x0e27('0x27'),_0x1d37f2[_0x0e27('0x23')]);});}}return _0x45d05f;};Report[_0x0e27('0x11')][_0x0e27('0x28')]=function(_0x507722){for(var _0x41bdf5=0x0;_0x41bdf5<_0x507722['length'];_0x41bdf5+=0x1){var _0x1ebd15=this[_0x0e27('0x20')](_0x507722[_0x41bdf5][_0x0e27('0x29')]);if(_0x1ebd15){_0x507722[_0x41bdf5]['accountcode']=_0x1ebd15['accountcode'];_0x507722[_0x41bdf5]['assigned']=!![];_0x507722[_0x41bdf5][_0x0e27('0x2a')]=_0x1ebd15[_0x0e27('0x23')];_0x507722[_0x41bdf5][_0x0e27('0x25')]=_[_0x0e27('0x24')](_0x1ebd15[_0x0e27('0x25')])?util[_0x0e27('0x26')](_0x0e27('0x27'),_0x1ebd15[_0x0e27('0x23')]):_0x1ebd15[_0x0e27('0x25')];if(_0x507722[_0x41bdf5][_0x0e27('0x2b')]){_0x507722[_0x41bdf5]['queuecallercompleteAt']=moment()[_0x0e27('0x26')](_0x0e27('0x2c'));}if(_0x507722[_0x41bdf5][_0x0e27('0x2d')]){_0x507722[_0x41bdf5][_0x0e27('0x2e')]=moment()[_0x0e27('0x26')](_0x0e27('0x2c'));}RpcMemberReport['voiceQueueReport'](_0x507722[_0x41bdf5]);}RpcVoiceQueueReport[_0x0e27('0x2f')](_0x507722[_0x41bdf5]);}};function extractCalleridNumber(_0x425687){var _0x3f5188=_0x425687[_0x0e27('0x30')](/<(.*?)>/);return _0x3f5188?_0x3f5188[0x1]:_0x425687;}Report[_0x0e27('0x11')][_0x0e27('0x17')]=function(_0x2712c4){_0x2712c4[_0x0e27('0x31')]=_0x2712c4['destination']||_0x2712c4[_0x0e27('0x32')];if(_0x2712c4[_0x0e27('0x33')]==_0x0e27('0x34')){_0x2712c4[_0x0e27('0x35')]=_0x0e27('0x36');_0x2712c4[_0x0e27('0x37')]=_0x2712c4[_0x0e27('0x36')];if(_0x2712c4[_0x0e27('0x38')]=='from-voip-provider'){_0x2712c4['accountcode']='';_0x2712c4[_0x0e27('0x31')]=extractCalleridNumber(_0x2712c4[_0x0e27('0x39')]);}else if(_0x2712c4[_0x0e27('0x38')]==_0x0e27('0x3a')){if(_0x2712c4[_0x0e27('0x31')]==_0x0e27('0x3b')){_0x2712c4[_0x0e27('0x31')]=extractCalleridNumber(_0x2712c4[_0x0e27('0x3c')]);_0x2712c4['calleridnum']=_0x2712c4[_0x0e27('0x3d')];_0x2712c4['destinationchannel']=[_0x2712c4[_0x0e27('0x3e')],_0x2712c4[_0x0e27('0x3e')]=_0x2712c4['destinationchannel']][0x0];_0x2712c4[_0x0e27('0x39')]=_0x2712c4[_0x0e27('0x3c')];}else{_0x2712c4[_0x0e27('0x31')]=_0x2712c4[_0x0e27('0x3f')];_0x2712c4[_0x0e27('0x3f')]=_0x2712c4[_0x0e27('0x3d')];if(_0x2712c4[_0x0e27('0x40')]==_0x0e27('0x41')){_0x2712c4[_0x0e27('0x22')]=_0x2712c4[_0x0e27('0x29')];}else{_0x2712c4['accountcode']='';}}}}else{_0x2712c4[_0x0e27('0x39')]=util[_0x0e27('0x26')]('\x22%s\x22\x20<%s>',_0x2712c4[_0x0e27('0x42')],_0x2712c4[_0x0e27('0x3f')]);}RpcVoiceCallReport[_0x0e27('0x2f')](_0x2712c4);if(_0x2712c4[_0x0e27('0x43')]){for(var _0x8dca69=0x0;_0x8dca69<_0x2712c4[_0x0e27('0x44')][_0x0e27('0x45')];_0x8dca69+=0x1){_0x2712c4[_0x0e27('0x46')]=_0x2712c4[_0x0e27('0x44')][_0x8dca69][_0x0e27('0x47')];_0x2712c4[_0x0e27('0x48')]=_0x2712c4[_0x0e27('0x44')][_0x8dca69][_0x0e27('0x48')];if(_0x2712c4[_0x0e27('0x32')]==_0x0e27('0x3b')){_0x2712c4[_0x0e27('0x3f')]=_0x2712c4[_0x0e27('0x29')];_0x2712c4['calleridname']=_0x2712c4[_0x0e27('0x49')];_0x2712c4[_0x0e27('0x29')]=_0x2712c4[_0x0e27('0x22')];_0x2712c4[_0x0e27('0x49')]=_0x2712c4[_0x0e27('0x4a')];_0x2712c4[_0x0e27('0x32')]=_0x2712c4[_0x0e27('0x3d')];}else if(_0x2712c4[_0x0e27('0x32')]==_0x0e27('0x4b')){_0x2712c4['calleridnum']=_0x2712c4['destination'];_0x2712c4[_0x0e27('0x32')]=_0x2712c4['originatecalleridnum'];}RpcVoiceRecording[_0x0e27('0x2f')](_0x2712c4);}}};Report['prototype'][_0x0e27('0x1a')]=function(_0x3fa9f9){if(_[_0x0e27('0x4c')](_0x3fa9f9)){_0x3fa9f9['forEach'](function(_0x15af07){RpcVoiceAgentReport[_0x0e27('0x2f')](_0x15af07);});}else{RpcVoiceAgentReport['create'](_0x3fa9f9);}};Report[_0x0e27('0x11')]['voiceDialReport']=function(_0xe3d350){RpcVoiceDialReport[_0x0e27('0x2f')](_0xe3d350);var _0x5e67a7=undefined;var _0x5d15f4=_0xe3d350[_0x0e27('0x3e')];if(_[_0x0e27('0x4d')](_0x5d15f4,'Local')){var _0x2596f0=_0x5d15f4[_0x0e27('0x4e')](_0x5d15f4['indexOf']('/')+0x1,_0x5d15f4['indexOf']('@'));_0x5e67a7=_[_0x0e27('0x21')](this[_0x0e27('0xf')],function(_0x5bedf7){return _0x5bedf7[_0x0e27('0x4f')]==_0x2596f0||_0x5bedf7[_0x0e27('0x50')]==_0x2596f0||_0x5bedf7[_0x0e27('0x22')]==_0x2596f0;});}else{var _0x2596f0=_0x5d15f4['substring'](_0x5d15f4[_0x0e27('0x51')]('/')+0x1,_0x5d15f4['lastIndexOf']('-'));_0x5e67a7=this['findAgent'](_0x2596f0);}if(_0x5e67a7){_0xe3d350[_0x0e27('0x25')]=_['isNil'](_0x5e67a7['interface'])?util[_0x0e27('0x26')]('SIP/%s',_0x5e67a7[_0x0e27('0x23')]):_0x5e67a7['interface'];_0xe3d350[_0x0e27('0x4a')]=_0x5e67a7[_0x0e27('0x23')];_0xe3d350[_0x0e27('0x22')]=_0x5e67a7['accountcode'];RpcMemberReport[_0x0e27('0x1b')](_0xe3d350);}};Report[_0x0e27('0x11')][_0x0e27('0x1d')]=function(_0xcc234e){RpcVoiceTransferReport[_0x0e27('0x1d')](_0xcc234e);};Report['prototype'][_0x0e27('0x1f')]=function(_0x335a69){RpcVoiceTransferReport[_0x0e27('0x1f')](_0x335a69);};module[_0x0e27('0x52')]=Report; \ No newline at end of file +var _0xc0ff=['queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match','voiceCallReport','destination','exten','type','dialer','lastapplication','lastdata','queue','from-voip-provider','context','from-sip','calleridpreview','calleridnum','originatecalleridnum','destinationchannel','channel','callerid','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname','monitor','monitors','monitorFilename','filename','createdAt','xcally-motion-preview','connectedlinenum','connectedlinename','membername','isArray','startsWith','substring','indexOf','mobile','lastIndexOf','exports','bluebird','lodash','moment','util','../../../config/environment','ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindTransfer','attendedtransfer','attendedTransfer','find','accountcode','name','interface','format','SIP/%s','length','findAgent','assigned','isNil','queuecallercomplete'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0xc0ff,0x136));var _0xfc0f=function(_0x4a4a32,_0x2ba798){_0x4a4a32=_0x4a4a32-0x0;var _0x154d37=_0xc0ff[_0x4a4a32];return _0x154d37;};'use strict';var BPromise=require(_0xfc0f('0x0'));var _=require(_0xfc0f('0x1'));var moment=require(_0xfc0f('0x2'));var util=require(_0xfc0f('0x3'));var config=require(_0xfc0f('0x4'));var logger=require('../../../config/logger')(_0xfc0f('0x5'));var ami=require('../ami');var RpcVoiceAgentReport=require(_0xfc0f('0x6'));var RpcVoiceCallReport=require(_0xfc0f('0x7'));var RpcVoiceDialReport=require(_0xfc0f('0x8'));var RpcMemberReport=require(_0xfc0f('0x9'));var RpcVoiceQueueReport=require(_0xfc0f('0xa'));var RpcVoiceRecording=require(_0xfc0f('0xb'));var RpcVoiceTransferReport=require(_0xfc0f('0xc'));var VoiceQueueReport=require('./voiceQueueReport');var VoiceCallReport=require(_0xfc0f('0xd'));var VoiceAgentReport=require(_0xfc0f('0xe'));var VoiceDialReport=require(_0xfc0f('0xf'));var UserReport=require(_0xfc0f('0x10'));function Report(_0x13366a){this[_0xfc0f('0x11')]=_0x13366a;this[_0xfc0f('0x12')]=_0x13366a['agents'];this['telephones']=_0x13366a[_0xfc0f('0x13')];}Report[_0xfc0f('0x14')][_0xfc0f('0x15')]=function(_0x7a4ec6){var _0x41017f=new VoiceQueueReport(this[_0xfc0f('0x11')]);var _0x7a26e9=new VoiceAgentReport(this[_0xfc0f('0x11')]);var _0x590084=new VoiceDialReport(this['realtime']);var _0x4f6331=new VoiceCallReport(this[_0xfc0f('0x11')]);var _0x48fc6b=new UserReport(this[_0xfc0f('0x11')]);if(config['xdr']&&config[_0xfc0f('0x16')][_0xfc0f('0x17')]){ami['on'](_0xfc0f('0x18'),this[_0xfc0f('0x19')][_0xfc0f('0x1a')](this));ami['on'](_0xfc0f('0x1b'),this['voiceCallReport'][_0xfc0f('0x1a')](this));ami['on'](_0xfc0f('0x1c'),this[_0xfc0f('0x1d')]['bind'](this));ami['on'](_0xfc0f('0x1e'),this[_0xfc0f('0x1f')][_0xfc0f('0x1a')](this));ami['on']('blindtransfer',this[_0xfc0f('0x20')][_0xfc0f('0x1a')](this));ami['on'](_0xfc0f('0x21'),this[_0xfc0f('0x22')]['bind'](this));}};Report[_0xfc0f('0x14')]['findAgent']=function(_0x1ce1ab){var _0x5eafb6=undefined;_0x5eafb6=_[_0xfc0f('0x23')](this[_0xfc0f('0x12')],function(_0x10faac){return _0x10faac[_0xfc0f('0x24')]==_0x1ce1ab||_0x10faac[_0xfc0f('0x25')]==_0x1ce1ab;});if(_['isNil'](_0x5eafb6)){var _0x5c1914=_[_0xfc0f('0x23')](this[_0xfc0f('0x13')],function(_0x48cbe4){return _0x48cbe4[_0xfc0f('0x24')]==_0x1ce1ab||_0x48cbe4[_0xfc0f('0x25')]==_0x1ce1ab;});if(_0x5c1914){_0x5eafb6=_[_0xfc0f('0x23')](this[_0xfc0f('0x12')],function(_0x152b1f){return _0x152b1f[_0xfc0f('0x26')]==util[_0xfc0f('0x27')](_0xfc0f('0x28'),_0x5c1914['name']);});}}return _0x5eafb6;};Report[_0xfc0f('0x14')][_0xfc0f('0x19')]=function(_0x3f9283){for(var _0x3709d0=0x0;_0x3709d0<_0x3f9283[_0xfc0f('0x29')];_0x3709d0+=0x1){var _0x321894=this[_0xfc0f('0x2a')](_0x3f9283[_0x3709d0]['connectedlinenum']);if(_0x321894){_0x3f9283[_0x3709d0][_0xfc0f('0x24')]=_0x321894[_0xfc0f('0x24')];_0x3f9283[_0x3709d0][_0xfc0f('0x2b')]=!![];_0x3f9283[_0x3709d0]['lastAssignedTo']=_0x321894['name'];_0x3f9283[_0x3709d0][_0xfc0f('0x26')]=_[_0xfc0f('0x2c')](_0x321894[_0xfc0f('0x26')])?util[_0xfc0f('0x27')]('SIP/%s',_0x321894['name']):_0x321894[_0xfc0f('0x26')];if(_0x3f9283[_0x3709d0][_0xfc0f('0x2d')]){_0x3f9283[_0x3709d0][_0xfc0f('0x2e')]=moment()[_0xfc0f('0x27')](_0xfc0f('0x2f'));}if(_0x3f9283[_0x3709d0][_0xfc0f('0x30')]){_0x3f9283[_0x3709d0][_0xfc0f('0x31')]=moment()[_0xfc0f('0x27')](_0xfc0f('0x2f'));}RpcMemberReport[_0xfc0f('0x19')](_0x3f9283[_0x3709d0]);}RpcVoiceQueueReport[_0xfc0f('0x32')](_0x3f9283[_0x3709d0]);}};function extractCalleridNumber(_0x565936){var _0x19ebb9=_0x565936[_0xfc0f('0x33')](/<(.*?)>/);return _0x19ebb9?_0x19ebb9[0x1]:_0x565936;}Report[_0xfc0f('0x14')][_0xfc0f('0x34')]=function(_0x4005fc){_0x4005fc[_0xfc0f('0x35')]=_0x4005fc[_0xfc0f('0x35')]||_0x4005fc[_0xfc0f('0x36')];if(_0x4005fc[_0xfc0f('0x37')]==_0xfc0f('0x38')){_0x4005fc[_0xfc0f('0x39')]='queue';_0x4005fc[_0xfc0f('0x3a')]=_0x4005fc[_0xfc0f('0x3b')];if(_0x4005fc['context']==_0xfc0f('0x3c')){_0x4005fc['accountcode']='';_0x4005fc['destination']=extractCalleridNumber(_0x4005fc['callerid']);}else if(_0x4005fc[_0xfc0f('0x3d')]==_0xfc0f('0x3e')){if(_0x4005fc[_0xfc0f('0x35')]=='xcally-motion-preview'){_0x4005fc[_0xfc0f('0x35')]=extractCalleridNumber(_0x4005fc[_0xfc0f('0x3f')]);_0x4005fc[_0xfc0f('0x40')]=_0x4005fc[_0xfc0f('0x41')];_0x4005fc[_0xfc0f('0x42')]=[_0x4005fc[_0xfc0f('0x43')],_0x4005fc[_0xfc0f('0x43')]=_0x4005fc['destinationchannel']][0x0];_0x4005fc[_0xfc0f('0x44')]=_0x4005fc['calleridpreview'];}else{_0x4005fc[_0xfc0f('0x35')]=_0x4005fc['calleridnum'];_0x4005fc[_0xfc0f('0x40')]=_0x4005fc[_0xfc0f('0x41')];if(_0x4005fc[_0xfc0f('0x45')]==_0xfc0f('0x46')){_0x4005fc['accountcode']=_0x4005fc['connectedlinenum'];}else{_0x4005fc[_0xfc0f('0x24')]='';}}}}else{_0x4005fc[_0xfc0f('0x44')]=util[_0xfc0f('0x27')](_0xfc0f('0x47'),_0x4005fc[_0xfc0f('0x48')],_0x4005fc[_0xfc0f('0x40')]);}RpcVoiceCallReport[_0xfc0f('0x32')](_0x4005fc);if(_0x4005fc[_0xfc0f('0x49')]){for(var _0x6d5144=0x0;_0x6d5144<_0x4005fc[_0xfc0f('0x4a')]['length'];_0x6d5144+=0x1){_0x4005fc[_0xfc0f('0x4b')]=_0x4005fc['monitors'][_0x6d5144][_0xfc0f('0x4c')];_0x4005fc['createdAt']=_0x4005fc[_0xfc0f('0x4a')][_0x6d5144][_0xfc0f('0x4d')];if(_0x4005fc[_0xfc0f('0x36')]==_0xfc0f('0x4e')){_0x4005fc[_0xfc0f('0x40')]=_0x4005fc['connectedlinenum'];_0x4005fc[_0xfc0f('0x48')]=_0x4005fc['connectedlinename'];_0x4005fc[_0xfc0f('0x4f')]=_0x4005fc['accountcode'];_0x4005fc[_0xfc0f('0x50')]=_0x4005fc[_0xfc0f('0x51')];_0x4005fc['exten']=_0x4005fc['originatecalleridnum'];}else if(_0x4005fc[_0xfc0f('0x36')]=='xcally-motion-dialer'){_0x4005fc[_0xfc0f('0x40')]=_0x4005fc['destination'];_0x4005fc[_0xfc0f('0x36')]=_0x4005fc['originatecalleridnum'];}RpcVoiceRecording[_0xfc0f('0x32')](_0x4005fc);}}};Report[_0xfc0f('0x14')]['voiceAgentReport']=function(_0x138c70){if(_[_0xfc0f('0x52')](_0x138c70)){_0x138c70['forEach'](function(_0x465a9b){RpcVoiceAgentReport['create'](_0x465a9b);});}else{RpcVoiceAgentReport[_0xfc0f('0x32')](_0x138c70);}};Report[_0xfc0f('0x14')][_0xfc0f('0x1f')]=function(_0x358826){RpcVoiceDialReport['create'](_0x358826);var _0x35eb04=undefined;var _0x57a2df=_0x358826['channel'];if(_[_0xfc0f('0x53')](_0x57a2df,'Local')){var _0x1aa6ad=_0x57a2df[_0xfc0f('0x54')](_0x57a2df[_0xfc0f('0x55')]('/')+0x1,_0x57a2df[_0xfc0f('0x55')]('@'));_0x35eb04=_['find'](this['agents'],function(_0x4555b2){return _0x4555b2[_0xfc0f('0x56')]==_0x1aa6ad||_0x4555b2['phone']==_0x1aa6ad||_0x4555b2[_0xfc0f('0x24')]==_0x1aa6ad;});}else{var _0x1aa6ad=_0x57a2df[_0xfc0f('0x54')](_0x57a2df['indexOf']('/')+0x1,_0x57a2df[_0xfc0f('0x57')]('-'));_0x35eb04=this[_0xfc0f('0x2a')](_0x1aa6ad);}if(_0x35eb04){_0x358826[_0xfc0f('0x26')]=_[_0xfc0f('0x2c')](_0x35eb04[_0xfc0f('0x26')])?util['format'](_0xfc0f('0x28'),_0x35eb04[_0xfc0f('0x25')]):_0x35eb04['interface'];_0x358826[_0xfc0f('0x51')]=_0x35eb04['name'];_0x358826[_0xfc0f('0x24')]=_0x35eb04[_0xfc0f('0x24')];RpcMemberReport[_0xfc0f('0x1f')](_0x358826);}};Report[_0xfc0f('0x14')][_0xfc0f('0x20')]=function(_0xbaa78b){RpcVoiceTransferReport[_0xfc0f('0x20')](_0xbaa78b);};Report['prototype']['attendedTransfer']=function(_0x1dd07a){RpcVoiceTransferReport[_0xfc0f('0x22')](_0x1dd07a);};module[_0xfc0f('0x58')]=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index 7ecbba2..a809bb2 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 _0x31d6=['peerstatus','syncPeerStatus','then','actionDeviceStateList','actionSipPeerStatus','catch','error','inspect','prototype','resolve','[loopSyncRealTimeShow]','isNotNull','isUndefined','emit','find','trunks','username','stateRegistry','state','merge','omit','event','actionid','format','trunk:%s','trunk:save','[syncRegistry][UserReport]','syncDeviceState','device','local','toLowerCase','stateTime','updateStatusRealtime','toNumber','telephone:%s','name','telephone:save','startsWith','Queue','Local','substring','indexOf','mobile','phone','accountcode','[syncDeviceState][UserReport]','peer','registered','status','address','[syncPeerStatus][UserReport]','lodash','moment','bluebird','ioredis','../../../config/environment','ami','../ami','redis','defaults','localhost','socket.io-emitter','agents','telephones','registryentry','syncRegistry','bind','registry','devicestatechange'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x31d6,0x147));var _0x631d=function(_0x25cba8,_0x1d2d23){_0x25cba8=_0x25cba8-0x0;var _0x2e01a8=_0x31d6[_0x25cba8];return _0x2e01a8;};'use strict';var _=require(_0x631d('0x0'));var moment=require(_0x631d('0x1'));var BPromise=require(_0x631d('0x2'));var util=require('util');var Redis=require(_0x631d('0x3'));var config=require(_0x631d('0x4'));var logger=require('../../../config/logger')(_0x631d('0x5'));var ami=require(_0x631d('0x6'));config[_0x631d('0x7')]=_[_0x631d('0x8')](config[_0x631d('0x7')],{'host':_0x631d('0x9'),'port':0x18eb});var io=require(_0x631d('0xa'))(new Redis(config['redis']));function UserReport(_0x1a2bba){this['trunks']=_0x1a2bba['trunks'];this[_0x631d('0xb')]=_0x1a2bba[_0x631d('0xb')];this[_0x631d('0xc')]=_0x1a2bba[_0x631d('0xc')];ami['on'](_0x631d('0xd'),this[_0x631d('0xe')][_0x631d('0xf')](this));ami['on'](_0x631d('0x10'),this[_0x631d('0xe')][_0x631d('0xf')](this));ami['on'](_0x631d('0x11'),this['syncDeviceState'][_0x631d('0xf')](this));ami['on'](_0x631d('0x12'),this[_0x631d('0x13')]['bind'](this));this['loopSyncRealTimeShow']();return BPromise['resolve']()['then'](ami['actionSipShowRegistry']())[_0x631d('0x14')](ami[_0x631d('0x15')]())[_0x631d('0x14')](ami[_0x631d('0x16')]())[_0x631d('0x17')](loggerCatch('[loopSyncRealTimeShow]'));}function loggerCatch(_0x5acf1e){return function(_0x4980da){logger[_0x631d('0x18')](_0x5acf1e,util[_0x631d('0x19')](_0x4980da,{'showHidden':![],'depth':null}));};}UserReport[_0x631d('0x1a')]['loopSyncRealTimeShow']=function(){setInterval(function(){BPromise[_0x631d('0x1b')]()[_0x631d('0x14')](ami['actionSipShowRegistry']())[_0x631d('0x14')](ami[_0x631d('0x15')]())[_0x631d('0x14')](ami[_0x631d('0x16')]())[_0x631d('0x17')](loggerCatch(_0x631d('0x1c')));},0x32c8);};UserReport[_0x631d('0x1a')][_0x631d('0x1d')]=function(_0x39e69e){return _0x39e69e!==null&&!_[_0x631d('0x1e')](_0x39e69e);};UserReport[_0x631d('0x1a')]['emit']=function(_0x20326d,_0xfe7fc9,_0x2b4982){io['to'](_0x20326d)[_0x631d('0x1f')](_0xfe7fc9,_0x2b4982);};UserReport[_0x631d('0x1a')][_0x631d('0xe')]=function(_0x48934c){try{if(this[_0x631d('0x1d')](_0x48934c)){var _0x309904=_[_0x631d('0x20')](this[_0x631d('0x21')],{'registry':_0x48934c[_0x631d('0x22')]});if(_0x309904){_0x48934c[_0x631d('0x23')]=_0x48934c[_0x631d('0x24')];_[_0x631d('0x25')](_0x309904,_[_0x631d('0x26')](_0x48934c,[_0x631d('0x27'),_0x631d('0x28'),_0x631d('0x22'),_0x631d('0x24')]));this[_0x631d('0x1f')](util[_0x631d('0x29')](_0x631d('0x2a'),_0x309904['name']),_0x631d('0x2b'),_0x309904);}}}catch(_0x3a4ead){logger[_0x631d('0x18')](_0x631d('0x2c'),util[_0x631d('0x19')](_0x3a4ead,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0x631d('0x2d')]=function(_0x463f6a){try{if(this[_0x631d('0x1d')](_0x463f6a)){if(this[_0x631d('0xb')][_0x463f6a[_0x631d('0x2e')]]){if(!this[_0x631d('0xb')][_0x463f6a['device']][_0x631d('0x2f')]||_0x463f6a['state'][_0x631d('0x30')]()=='inuse'){this['agents'][_0x463f6a[_0x631d('0x2e')]]['local']=![];if(this[_0x631d('0xb')][_0x463f6a[_0x631d('0x2e')]][_0x631d('0x24')]!==_0x463f6a['state'][_0x631d('0x30')]()){this[_0x631d('0xb')][_0x463f6a[_0x631d('0x2e')]][_0x631d('0x31')]=_['toNumber'](moment()[_0x631d('0x29')]('x'));}this['agents'][_0x463f6a[_0x631d('0x2e')]][_0x631d('0x24')]=_0x463f6a[_0x631d('0x24')][_0x631d('0x30')]();this[_0x631d('0xb')][_0x463f6a['device']][_0x631d('0x32')](_0x463f6a);}}else if(this[_0x631d('0xc')][_0x463f6a[_0x631d('0x2e')]]){if(this[_0x631d('0xc')][_0x463f6a[_0x631d('0x2e')]][_0x631d('0x24')]!==_0x463f6a[_0x631d('0x24')][_0x631d('0x30')]()){this['telephones'][_0x463f6a[_0x631d('0x2e')]][_0x631d('0x31')]=_[_0x631d('0x33')](moment()['format']('x'));}this[_0x631d('0xc')][_0x463f6a[_0x631d('0x2e')]][_0x631d('0x24')]=_0x463f6a[_0x631d('0x24')]['toLowerCase']();this[_0x631d('0x1f')](util[_0x631d('0x29')](_0x631d('0x34'),this[_0x631d('0xc')][_0x463f6a[_0x631d('0x2e')]][_0x631d('0x35')]),_0x631d('0x36'),this['telephones'][_0x463f6a[_0x631d('0x2e')]]);}else if(this['trunks'][_0x463f6a[_0x631d('0x2e')]]){if(this[_0x631d('0x21')][_0x463f6a[_0x631d('0x2e')]][_0x631d('0x24')]!==_0x463f6a[_0x631d('0x24')][_0x631d('0x30')]()){this['trunks'][_0x463f6a[_0x631d('0x2e')]][_0x631d('0x31')]=_['toNumber'](moment()['format']('x'));}this['trunks'][_0x463f6a[_0x631d('0x2e')]][_0x631d('0x24')]=_0x463f6a[_0x631d('0x24')][_0x631d('0x30')]();this[_0x631d('0x1f')](util['format'](_0x631d('0x2a'),this[_0x631d('0x21')][_0x463f6a[_0x631d('0x2e')]][_0x631d('0x35')]),_0x631d('0x2b'),this[_0x631d('0x21')][_0x463f6a[_0x631d('0x2e')]]);}else if(_[_0x631d('0x37')](_0x463f6a[_0x631d('0x2e')],_0x631d('0x38'))){}else if(_[_0x631d('0x37')](_0x463f6a[_0x631d('0x2e')],_0x631d('0x39'))){var _0x2ca9c0=_0x463f6a[_0x631d('0x2e')];var _0x2ae5a8=_0x2ca9c0[_0x631d('0x3a')](_0x2ca9c0[_0x631d('0x3b')]('/')+0x1,_0x2ca9c0[_0x631d('0x3b')]('@'));var _0x39d807=_[_0x631d('0x20')](this[_0x631d('0xb')],function(_0xf51a91){return _0xf51a91[_0x631d('0x3c')]==_0x2ae5a8||_0xf51a91[_0x631d('0x3d')]==_0x2ae5a8||_0xf51a91[_0x631d('0x3e')]==_0x2ae5a8;});if(_0x39d807){if(_0x39d807[_0x631d('0x24')]!==_0x463f6a[_0x631d('0x24')][_0x631d('0x30')]()){_0x39d807['stateTime']=_[_0x631d('0x33')](moment()[_0x631d('0x29')]('x'));}_0x39d807[_0x631d('0x24')]=_0x463f6a[_0x631d('0x24')][_0x631d('0x30')]();_0x39d807[_0x631d('0x2f')]=!![];_0x39d807['updateStatusRealtime'](_0x463f6a);}}else{}}}catch(_0x5c7799){logger[_0x631d('0x18')](_0x631d('0x3f'),util['inspect'](_0x5c7799,{'showHidden':![],'depth':null}));}};UserReport[_0x631d('0x1a')][_0x631d('0x13')]=function(_0x27d627){try{if(this[_0x631d('0x1d')](_0x27d627)&&this['isNotNull'](_0x27d627[_0x631d('0x12')])){if(this['agents'][_0x27d627[_0x631d('0x40')]]){if(!this[_0x631d('0xb')][_0x27d627[_0x631d('0x40')]]['local']||_0x27d627['peerstatus'][_0x631d('0x30')]()==_0x631d('0x41')){this[_0x631d('0xb')][_0x27d627[_0x631d('0x40')]][_0x631d('0x2f')]=![];this[_0x631d('0xb')][_0x27d627[_0x631d('0x40')]][_0x631d('0x42')]=_0x27d627[_0x631d('0x12')][_0x631d('0x30')]();this[_0x631d('0xb')][_0x27d627[_0x631d('0x40')]][_0x631d('0x43')]=_0x27d627['address'];this[_0x631d('0xb')][_0x27d627[_0x631d('0x40')]][_0x631d('0x32')](_0x27d627);}}else if(this['telephones'][_0x27d627['peer']]){this['telephones'][_0x27d627[_0x631d('0x40')]][_0x631d('0x42')]=_0x27d627[_0x631d('0x12')][_0x631d('0x30')]();this[_0x631d('0xc')][_0x27d627[_0x631d('0x40')]][_0x631d('0x43')]=_0x27d627[_0x631d('0x43')];this[_0x631d('0x1f')](util['format'](_0x631d('0x34'),this[_0x631d('0xc')][_0x27d627[_0x631d('0x40')]]['name']),_0x631d('0x36'),this[_0x631d('0xc')][_0x27d627[_0x631d('0x40')]]);}else if(this[_0x631d('0x21')][_0x27d627[_0x631d('0x40')]]){this['trunks'][_0x27d627[_0x631d('0x40')]][_0x631d('0x42')]=_0x27d627[_0x631d('0x12')][_0x631d('0x30')]();this['trunks'][_0x27d627[_0x631d('0x40')]][_0x631d('0x43')]=_0x27d627[_0x631d('0x43')];this[_0x631d('0x1f')](util[_0x631d('0x29')](_0x631d('0x2a'),this[_0x631d('0x21')][_0x27d627[_0x631d('0x40')]][_0x631d('0x35')]),_0x631d('0x2b'),this[_0x631d('0x21')][_0x27d627['peer']]);}else{}}}catch(_0x438f62){logger[_0x631d('0x18')](_0x631d('0x44'),util[_0x631d('0x19')](_0x438f62,{'showHidden':![],'depth':null}));}};module['exports']=UserReport; \ No newline at end of file +var _0x538c=['updateStatusRealtime','toNumber','telephone:%s','telephone:save','startsWith','Queue','Local','substring','indexOf','mobile','[syncDeviceState][UserReport]','peer','registered','status','address','[syncPeerStatus][UserReport]','exports','moment','util','ioredis','../../../config/environment','../../../config/logger','redis','defaults','localhost','trunks','agents','telephones','registryentry','syncRegistry','bind','registry','syncDeviceState','peerstatus','syncPeerStatus','then','actionSipShowRegistry','actionDeviceStateList','actionSipPeerStatus','[loopSyncRealTimeShow]','error','inspect','prototype','loopSyncRealTimeShow','isNotNull','isUndefined','emit','find','username','stateRegistry','state','merge','event','actionid','format','trunk:%s','name','trunk:save','device','local','toLowerCase','inuse','stateTime'];(function(_0x4f1f71,_0xf14f1b){var _0xe514d7=function(_0xfd76e7){while(--_0xfd76e7){_0x4f1f71['push'](_0x4f1f71['shift']());}};_0xe514d7(++_0xf14f1b);}(_0x538c,0x14c));var _0xc538=function(_0x5b46a8,_0x401142){_0x5b46a8=_0x5b46a8-0x0;var _0x13a4b0=_0x538c[_0x5b46a8];return _0x13a4b0;};'use strict';var _=require('lodash');var moment=require(_0xc538('0x0'));var BPromise=require('bluebird');var util=require(_0xc538('0x1'));var Redis=require(_0xc538('0x2'));var config=require(_0xc538('0x3'));var logger=require(_0xc538('0x4'))('ami');var ami=require('../ami');config[_0xc538('0x5')]=_[_0xc538('0x6')](config[_0xc538('0x5')],{'host':_0xc538('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xc538('0x5')]));function UserReport(_0x59bff9){this[_0xc538('0x8')]=_0x59bff9['trunks'];this[_0xc538('0x9')]=_0x59bff9[_0xc538('0x9')];this[_0xc538('0xa')]=_0x59bff9[_0xc538('0xa')];ami['on'](_0xc538('0xb'),this[_0xc538('0xc')][_0xc538('0xd')](this));ami['on'](_0xc538('0xe'),this['syncRegistry'][_0xc538('0xd')](this));ami['on']('devicestatechange',this[_0xc538('0xf')][_0xc538('0xd')](this));ami['on'](_0xc538('0x10'),this[_0xc538('0x11')][_0xc538('0xd')](this));this['loopSyncRealTimeShow']();return BPromise['resolve']()[_0xc538('0x12')](ami[_0xc538('0x13')]())[_0xc538('0x12')](ami[_0xc538('0x14')]())[_0xc538('0x12')](ami[_0xc538('0x15')]())['catch'](loggerCatch(_0xc538('0x16')));}function loggerCatch(_0xa44022){return function(_0x48c850){logger[_0xc538('0x17')](_0xa44022,util[_0xc538('0x18')](_0x48c850,{'showHidden':![],'depth':null}));};}UserReport[_0xc538('0x19')][_0xc538('0x1a')]=function(){setInterval(function(){BPromise['resolve']()['then'](ami[_0xc538('0x13')]())[_0xc538('0x12')](ami['actionDeviceStateList']())['then'](ami[_0xc538('0x15')]())['catch'](loggerCatch(_0xc538('0x16')));},0x32c8);};UserReport[_0xc538('0x19')][_0xc538('0x1b')]=function(_0x588b3f){return _0x588b3f!==null&&!_[_0xc538('0x1c')](_0x588b3f);};UserReport['prototype']['emit']=function(_0x5ebe02,_0x195c5e,_0x4c9c68){io['to'](_0x5ebe02)[_0xc538('0x1d')](_0x195c5e,_0x4c9c68);};UserReport[_0xc538('0x19')]['syncRegistry']=function(_0x3eca02){try{if(this['isNotNull'](_0x3eca02)){var _0x119e9f=_[_0xc538('0x1e')](this[_0xc538('0x8')],{'registry':_0x3eca02[_0xc538('0x1f')]});if(_0x119e9f){_0x3eca02[_0xc538('0x20')]=_0x3eca02[_0xc538('0x21')];_[_0xc538('0x22')](_0x119e9f,_['omit'](_0x3eca02,[_0xc538('0x23'),_0xc538('0x24'),_0xc538('0x1f'),_0xc538('0x21')]));this[_0xc538('0x1d')](util[_0xc538('0x25')](_0xc538('0x26'),_0x119e9f[_0xc538('0x27')]),_0xc538('0x28'),_0x119e9f);}}}catch(_0x32aed8){logger[_0xc538('0x17')]('[syncRegistry][UserReport]',util[_0xc538('0x18')](_0x32aed8,{'showHidden':![],'depth':null}));}};UserReport[_0xc538('0x19')][_0xc538('0xf')]=function(_0x281a96){try{if(this[_0xc538('0x1b')](_0x281a96)){if(this[_0xc538('0x9')][_0x281a96[_0xc538('0x29')]]){if(!this['agents'][_0x281a96[_0xc538('0x29')]][_0xc538('0x2a')]||_0x281a96[_0xc538('0x21')][_0xc538('0x2b')]()==_0xc538('0x2c')){this['agents'][_0x281a96['device']][_0xc538('0x2a')]=![];if(this['agents'][_0x281a96['device']][_0xc538('0x21')]!==_0x281a96[_0xc538('0x21')][_0xc538('0x2b')]()){this[_0xc538('0x9')][_0x281a96[_0xc538('0x29')]][_0xc538('0x2d')]=_['toNumber'](moment()['format']('x'));}this['agents'][_0x281a96['device']][_0xc538('0x21')]=_0x281a96[_0xc538('0x21')][_0xc538('0x2b')]();this[_0xc538('0x9')][_0x281a96[_0xc538('0x29')]][_0xc538('0x2e')](_0x281a96);}}else if(this[_0xc538('0xa')][_0x281a96['device']]){if(this['telephones'][_0x281a96[_0xc538('0x29')]][_0xc538('0x21')]!==_0x281a96[_0xc538('0x21')][_0xc538('0x2b')]()){this[_0xc538('0xa')][_0x281a96[_0xc538('0x29')]]['stateTime']=_[_0xc538('0x2f')](moment()['format']('x'));}this['telephones'][_0x281a96[_0xc538('0x29')]][_0xc538('0x21')]=_0x281a96['state']['toLowerCase']();this['emit'](util[_0xc538('0x25')](_0xc538('0x30'),this[_0xc538('0xa')][_0x281a96[_0xc538('0x29')]][_0xc538('0x27')]),_0xc538('0x31'),this[_0xc538('0xa')][_0x281a96[_0xc538('0x29')]]);}else if(this[_0xc538('0x8')][_0x281a96['device']]){if(this[_0xc538('0x8')][_0x281a96['device']][_0xc538('0x21')]!==_0x281a96['state'][_0xc538('0x2b')]()){this[_0xc538('0x8')][_0x281a96[_0xc538('0x29')]][_0xc538('0x2d')]=_[_0xc538('0x2f')](moment()[_0xc538('0x25')]('x'));}this[_0xc538('0x8')][_0x281a96['device']][_0xc538('0x21')]=_0x281a96[_0xc538('0x21')][_0xc538('0x2b')]();this[_0xc538('0x1d')](util[_0xc538('0x25')](_0xc538('0x26'),this['trunks'][_0x281a96[_0xc538('0x29')]]['name']),_0xc538('0x28'),this[_0xc538('0x8')][_0x281a96[_0xc538('0x29')]]);}else if(_[_0xc538('0x32')](_0x281a96[_0xc538('0x29')],_0xc538('0x33'))){}else if(_['startsWith'](_0x281a96[_0xc538('0x29')],_0xc538('0x34'))){var _0x20cf52=_0x281a96[_0xc538('0x29')];var _0x23a211=_0x20cf52[_0xc538('0x35')](_0x20cf52[_0xc538('0x36')]('/')+0x1,_0x20cf52[_0xc538('0x36')]('@'));var _0x2e93bb=_[_0xc538('0x1e')](this[_0xc538('0x9')],function(_0x5dafa){return _0x5dafa[_0xc538('0x37')]==_0x23a211||_0x5dafa['phone']==_0x23a211||_0x5dafa['accountcode']==_0x23a211;});if(_0x2e93bb){if(_0x2e93bb['state']!==_0x281a96['state'][_0xc538('0x2b')]()){_0x2e93bb['stateTime']=_[_0xc538('0x2f')](moment()[_0xc538('0x25')]('x'));}_0x2e93bb['state']=_0x281a96[_0xc538('0x21')][_0xc538('0x2b')]();_0x2e93bb[_0xc538('0x2a')]=!![];_0x2e93bb['updateStatusRealtime'](_0x281a96);}}else{}}}catch(_0x5e46d5){logger[_0xc538('0x17')](_0xc538('0x38'),util[_0xc538('0x18')](_0x5e46d5,{'showHidden':![],'depth':null}));}};UserReport[_0xc538('0x19')][_0xc538('0x11')]=function(_0x12ea8b){try{if(this[_0xc538('0x1b')](_0x12ea8b)&&this[_0xc538('0x1b')](_0x12ea8b[_0xc538('0x10')])){if(this[_0xc538('0x9')][_0x12ea8b[_0xc538('0x39')]]){if(!this[_0xc538('0x9')][_0x12ea8b[_0xc538('0x39')]][_0xc538('0x2a')]||_0x12ea8b[_0xc538('0x10')][_0xc538('0x2b')]()==_0xc538('0x3a')){this[_0xc538('0x9')][_0x12ea8b['peer']]['local']=![];this[_0xc538('0x9')][_0x12ea8b[_0xc538('0x39')]][_0xc538('0x3b')]=_0x12ea8b[_0xc538('0x10')][_0xc538('0x2b')]();this[_0xc538('0x9')][_0x12ea8b[_0xc538('0x39')]]['address']=_0x12ea8b[_0xc538('0x3c')];this[_0xc538('0x9')][_0x12ea8b[_0xc538('0x39')]][_0xc538('0x2e')](_0x12ea8b);}}else if(this['telephones'][_0x12ea8b[_0xc538('0x39')]]){this[_0xc538('0xa')][_0x12ea8b['peer']][_0xc538('0x3b')]=_0x12ea8b[_0xc538('0x10')]['toLowerCase']();this['telephones'][_0x12ea8b[_0xc538('0x39')]][_0xc538('0x3c')]=_0x12ea8b[_0xc538('0x3c')];this[_0xc538('0x1d')](util['format'](_0xc538('0x30'),this[_0xc538('0xa')][_0x12ea8b[_0xc538('0x39')]][_0xc538('0x27')]),_0xc538('0x31'),this[_0xc538('0xa')][_0x12ea8b['peer']]);}else if(this[_0xc538('0x8')][_0x12ea8b[_0xc538('0x39')]]){this[_0xc538('0x8')][_0x12ea8b[_0xc538('0x39')]][_0xc538('0x3b')]=_0x12ea8b['peerstatus'][_0xc538('0x2b')]();this[_0xc538('0x8')][_0x12ea8b[_0xc538('0x39')]][_0xc538('0x3c')]=_0x12ea8b[_0xc538('0x3c')];this['emit'](util[_0xc538('0x25')](_0xc538('0x26'),this[_0xc538('0x8')][_0x12ea8b[_0xc538('0x39')]][_0xc538('0x27')]),_0xc538('0x28'),this['trunks'][_0x12ea8b['peer']]);}else{}}}catch(_0x42797c){logger['error'](_0xc538('0x3d'),util[_0xc538('0x18')](_0x42797c,{'showHidden':![],'depth':null}));}};module[_0xc538('0x3e')]=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index 3efe42d..b20ecc8 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 _0x6b98=['destchannelstatedesc','destconnectedlinenum','membername','user:agentconnect','custom:agentconnect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','custom:agentansweredelsewhere','[syncAgentConnect][VoiceAgentReport]','inspect','agentringnoanswerAt','reason','rejected','hasOwnProperty','abandoned','custom:agentqueuecallerabandon','[syncQueueCallerAbandon][VoiceAgentReport]','agentcompleteAt','talktime','transfer','agent','acw','acwtime','interface','user:agentcomplete','custom:agentcomplete','[syncAgentComplete][VoiceAgentReport]','syncVarSet','keys','variable','value','addVariable','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberinterface','memberlastcall','memberrealtime','isNil','custom:voiceAgentReport','[syncHangup][VoiceAgentReport]','syncAttendedTransfer','transfereeuniqueid','origtransfereruniqueid','complete','seconds','secondtransfereruniqueid','[syncAttendedTransfer][VoiceAgentReport]','diff','[syncBlindTransfer][VoiceAgentReport]','syncMusicOnHoldStart','channel','substring','lastIndexOf','onhold','[syncMusicOnHoldStart][VoiceAgentReport]','[syncMusicOnHoldStop][VoiceAgentReport]','lodash','moment','util','../../../config/environment','../../../config/logger','../ami','redis','localhost','socket.io-emitter','voiceQueues','agents','agentcalled','syncAgentCalled','bind','agentconnect','syncAgentConnect','agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','syncHangup','musiconholdstart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','blindtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','channels','uniqueid','destuniqueid','format','YYYY-MM-DD\x20HH:mm:ss','variables','queue','type','inbound','merge','omit','event','privilege','custom:agentcalled','user:%s','user:called','error','[syncAgentCalled][VoiceAgentReport]','agentconnectAt','lastevent','connect','connectedlinename','destchannelstate'];(function(_0x837141,_0x162172){var _0x27338e=function(_0x5889){while(--_0x5889){_0x837141['push'](_0x837141['shift']());}};_0x27338e(++_0x162172);}(_0x6b98,0x133));var _0x86b9=function(_0x32b79a,_0xd2538a){_0x32b79a=_0x32b79a-0x0;var _0x483450=_0x6b98[_0x32b79a];return _0x483450;};'use strict';var _=require(_0x86b9('0x0'));var moment=require(_0x86b9('0x1'));var util=require(_0x86b9('0x2'));var Redis=require('ioredis');var config=require(_0x86b9('0x3'));var logger=require(_0x86b9('0x4'))('ami');var ami=require(_0x86b9('0x5'));config['redis']=_['defaults'](config[_0x86b9('0x6')],{'host':_0x86b9('0x7'),'port':0x18eb});var io=require(_0x86b9('0x8'))(new Redis(config[_0x86b9('0x6')]));function VoiceAgentReport(_0x37e17a){this['channels']={};this[_0x86b9('0x9')]=_0x37e17a[_0x86b9('0x9')];this['agents']=_0x37e17a[_0x86b9('0xa')];this['variables']={};ami['on'](_0x86b9('0xb'),this[_0x86b9('0xc')][_0x86b9('0xd')](this));ami['on'](_0x86b9('0xe'),this[_0x86b9('0xf')][_0x86b9('0xd')](this));ami['on'](_0x86b9('0x10'),this[_0x86b9('0x11')][_0x86b9('0xd')](this));ami['on'](_0x86b9('0x12'),this[_0x86b9('0x13')][_0x86b9('0xd')](this));ami['on'](_0x86b9('0x14'),this[_0x86b9('0x15')][_0x86b9('0xd')](this));ami['on']('varset',this['syncVarSet'][_0x86b9('0xd')](this));ami['on']('hangup',this[_0x86b9('0x16')]['bind'](this));ami['on'](_0x86b9('0x17'),this['syncMusicOnHoldStart'][_0x86b9('0xd')](this));ami['on'](_0x86b9('0x18'),this[_0x86b9('0x19')][_0x86b9('0xd')](this));ami['on'](_0x86b9('0x1a'),this['syncAttendedTransfer'][_0x86b9('0xd')](this));ami['on'](_0x86b9('0x1b'),this[_0x86b9('0x1c')][_0x86b9('0xd')](this));}VoiceAgentReport[_0x86b9('0x1d')][_0x86b9('0x1e')]=function(_0x48e266,_0x25c50a,_0x978369){io['to'](_0x48e266)['emit'](_0x25c50a,_0x978369);};VoiceAgentReport[_0x86b9('0x1d')][_0x86b9('0x1f')]=function(_0xbc4a63){return _0xbc4a63!==null&&!_['isUndefined'](_0xbc4a63);};VoiceAgentReport['prototype'][_0x86b9('0xc')]=function(_0x1d9226){try{if(this[_0x86b9('0x1f')](_0x1d9226)){if(_[_0x86b9('0x20')](this[_0x86b9('0x21')][_0x1d9226['uniqueid']])){this['channels'][_0x1d9226[_0x86b9('0x22')]]={};}if(_[_0x86b9('0x20')](this[_0x86b9('0x21')][_0x1d9226[_0x86b9('0x22')]][_0x1d9226[_0x86b9('0x23')]])){this[_0x86b9('0x21')][_0x1d9226[_0x86b9('0x22')]][_0x1d9226[_0x86b9('0x23')]]={'agentcalledAt':moment()[_0x86b9('0x24')](_0x86b9('0x25')),'lastevent':'called','variables':this[_0x86b9('0x26')][_0x1d9226[_0x86b9('0x22')]],'type':this['voiceQueues'][_0x1d9226['queue']]?this[_0x86b9('0x9')][_0x1d9226[_0x86b9('0x27')]][_0x86b9('0x28')]||_0x86b9('0x29'):_0x86b9('0x29')};}_[_0x86b9('0x2a')](this[_0x86b9('0x21')][_0x1d9226['uniqueid']][_0x1d9226[_0x86b9('0x23')]],_[_0x86b9('0x2b')](_0x1d9226,[_0x86b9('0x2c'),_0x86b9('0x2d')]));ami[_0x86b9('0x1e')](_0x86b9('0x2e'),this[_0x86b9('0x21')][_0x1d9226['uniqueid']][_0x1d9226[_0x86b9('0x23')]]);this[_0x86b9('0x1e')](util[_0x86b9('0x24')](_0x86b9('0x2f'),_0x1d9226['membername']),_0x86b9('0x30'),this['channels'][_0x1d9226[_0x86b9('0x22')]][_0x1d9226['destuniqueid']]);}}catch(_0xb1707f){logger[_0x86b9('0x31')](_0x86b9('0x32'),util['inspect'](_0xb1707f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x86b9('0x1d')][_0x86b9('0xf')]=function(_0x8da56d){try{if(this[_0x86b9('0x1f')](_0x8da56d)){if(this['channels'][_0x8da56d['uniqueid']]){for(var _0x3807f2 in this['channels'][_0x8da56d['uniqueid']]){if(this[_0x86b9('0x21')][_0x8da56d[_0x86b9('0x22')]]['hasOwnProperty'](_0x3807f2)){if(_0x8da56d[_0x86b9('0x23')]===_0x3807f2){this[_0x86b9('0x21')][_0x8da56d[_0x86b9('0x22')]][_0x3807f2][_0x86b9('0x33')]=moment()[_0x86b9('0x24')](_0x86b9('0x25'));this[_0x86b9('0x21')][_0x8da56d['uniqueid']][_0x3807f2][_0x86b9('0x34')]=_0x86b9('0x35');this['channels'][_0x8da56d[_0x86b9('0x22')]][_0x3807f2]['holdtime']=_0x8da56d['holdtime'];this[_0x86b9('0x21')][_0x8da56d['uniqueid']][_0x3807f2]['connectedlinenum']=_0x8da56d['connectedlinenum'];this[_0x86b9('0x21')][_0x8da56d[_0x86b9('0x22')]][_0x3807f2][_0x86b9('0x36')]=_0x8da56d[_0x86b9('0x36')];this['channels'][_0x8da56d[_0x86b9('0x22')]][_0x3807f2][_0x86b9('0x37')]=_0x8da56d['destchannelstate'];this[_0x86b9('0x21')][_0x8da56d['uniqueid']][_0x3807f2][_0x86b9('0x38')]=_0x8da56d[_0x86b9('0x38')];_[_0x86b9('0x2a')](this[_0x86b9('0xa')][_0x8da56d['interface']],_['pick'](_0x8da56d,['queue',_0x86b9('0x39')]));this[_0x86b9('0x1e')](util[_0x86b9('0x24')]('user:%s',_0x8da56d[_0x86b9('0x3a')]),_0x86b9('0x3b'),this[_0x86b9('0x21')][_0x8da56d[_0x86b9('0x22')]][_0x8da56d['destuniqueid']]);ami[_0x86b9('0x1e')](_0x86b9('0x3c'),this['channels'][_0x8da56d[_0x86b9('0x22')]][_0x3807f2]);}else if(!this[_0x86b9('0x21')][_0x8da56d[_0x86b9('0x22')]][_0x3807f2]['agentringnoanswer']&&!this[_0x86b9('0x21')][_0x8da56d[_0x86b9('0x22')]][_0x3807f2]['agentcomplete']){this[_0x86b9('0x21')][_0x8da56d[_0x86b9('0x22')]][_0x3807f2]['agentringnoanswer']=!![];this[_0x86b9('0x21')][_0x8da56d[_0x86b9('0x22')]][_0x3807f2]['agentringnoanswerAt']=moment()[_0x86b9('0x24')](_0x86b9('0x25'));this[_0x86b9('0x21')][_0x8da56d[_0x86b9('0x22')]][_0x3807f2]['reason']='answered_elsewhere';this[_0x86b9('0x21')][_0x8da56d['uniqueid']][_0x3807f2][_0x86b9('0x34')]=_0x86b9('0x3d');this['channels'][_0x8da56d[_0x86b9('0x22')]][_0x3807f2][_0x86b9('0x3e')]=_0x8da56d[_0x86b9('0x23')];this[_0x86b9('0x21')][_0x8da56d[_0x86b9('0x22')]][_0x3807f2][_0x86b9('0x3f')]=_0x8da56d[_0x86b9('0x3a')];ami[_0x86b9('0x1e')](_0x86b9('0x40'),this[_0x86b9('0x21')][_0x8da56d[_0x86b9('0x22')]][_0x3807f2]);}}}}}}catch(_0x11de0c){logger[_0x86b9('0x31')](_0x86b9('0x41'),util[_0x86b9('0x42')](_0x11de0c,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x86b9('0x11')]=function(_0x2a6d23){try{if(this[_0x86b9('0x1f')](_0x2a6d23)){if(this['channels'][_0x2a6d23[_0x86b9('0x22')]]&&this[_0x86b9('0x21')][_0x2a6d23['uniqueid']][_0x2a6d23[_0x86b9('0x23')]]){this[_0x86b9('0x21')][_0x2a6d23[_0x86b9('0x22')]][_0x2a6d23['destuniqueid']]['agentringnoanswer']=!![];this['channels'][_0x2a6d23['uniqueid']][_0x2a6d23[_0x86b9('0x23')]][_0x86b9('0x43')]=moment()['format'](_0x86b9('0x25'));this['channels'][_0x2a6d23[_0x86b9('0x22')]][_0x2a6d23[_0x86b9('0x23')]][_0x86b9('0x44')]=_0x86b9('0x45');this[_0x86b9('0x21')][_0x2a6d23[_0x86b9('0x22')]][_0x2a6d23['destuniqueid']][_0x86b9('0x34')]=_0x86b9('0x45');ami[_0x86b9('0x1e')]('custom:agentringnoanswer',this[_0x86b9('0x21')][_0x2a6d23[_0x86b9('0x22')]][_0x2a6d23[_0x86b9('0x23')]]);}}}catch(_0x10362b){logger[_0x86b9('0x31')]('[syncAgentRingNoAnswer][VoiceAgentReport]',util[_0x86b9('0x42')](_0x10362b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x86b9('0x1d')][_0x86b9('0x13')]=function(_0x2a77f7){try{if(this[_0x86b9('0x1f')](_0x2a77f7)){if(this['channels'][_0x2a77f7['uniqueid']]){for(var _0x5c9a14 in this[_0x86b9('0x21')][_0x2a77f7[_0x86b9('0x22')]]){if(this['channels'][_0x2a77f7['uniqueid']][_0x86b9('0x46')](_0x5c9a14)&&!this['channels'][_0x2a77f7['uniqueid']][_0x5c9a14][_0x86b9('0x10')]&&!this['channels'][_0x2a77f7[_0x86b9('0x22')]][_0x5c9a14][_0x86b9('0x14')]){this[_0x86b9('0x21')][_0x2a77f7['uniqueid']][_0x5c9a14]['agentringnoanswer']=!![];this[_0x86b9('0x21')][_0x2a77f7[_0x86b9('0x22')]][_0x5c9a14][_0x86b9('0x43')]=moment()[_0x86b9('0x24')](_0x86b9('0x25'));this['channels'][_0x2a77f7['uniqueid']][_0x5c9a14][_0x86b9('0x44')]=_0x86b9('0x47');this[_0x86b9('0x21')][_0x2a77f7[_0x86b9('0x22')]][_0x5c9a14]['lastevent']=_0x86b9('0x47');ami[_0x86b9('0x1e')](_0x86b9('0x48'),this[_0x86b9('0x21')][_0x2a77f7[_0x86b9('0x22')]][_0x5c9a14]);}}}}}catch(_0x254f83){logger[_0x86b9('0x31')](_0x86b9('0x49'),util[_0x86b9('0x42')](_0x254f83,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x86b9('0x1d')][_0x86b9('0x15')]=function(_0x49a4dd){try{if(this[_0x86b9('0x1f')](_0x49a4dd)){if(this[_0x86b9('0x21')][_0x49a4dd[_0x86b9('0x22')]]){for(var _0x580f9c in this['channels'][_0x49a4dd[_0x86b9('0x22')]]){if(this[_0x86b9('0x21')][_0x49a4dd[_0x86b9('0x22')]]['hasOwnProperty'](_0x580f9c)){if(this[_0x86b9('0x21')][_0x49a4dd[_0x86b9('0x22')]][_0x580f9c][_0x86b9('0x33')]&&!this[_0x86b9('0x21')][_0x49a4dd[_0x86b9('0x22')]][_0x580f9c][_0x86b9('0x14')]){this['channels'][_0x49a4dd[_0x86b9('0x22')]][_0x580f9c][_0x86b9('0x14')]=!![];this[_0x86b9('0x21')][_0x49a4dd[_0x86b9('0x22')]][_0x580f9c][_0x86b9('0x4a')]=moment()[_0x86b9('0x24')](_0x86b9('0x25'));this[_0x86b9('0x21')][_0x49a4dd[_0x86b9('0x22')]][_0x580f9c][_0x86b9('0x34')]='complete';this[_0x86b9('0x21')][_0x49a4dd['uniqueid']][_0x580f9c][_0x86b9('0x4b')]=_0x49a4dd['talktime'];this[_0x86b9('0x21')][_0x49a4dd['uniqueid']][_0x580f9c][_0x86b9('0x44')]=_0x49a4dd[_0x86b9('0x44')]==_0x86b9('0x4c')?_0x86b9('0x4d'):_0x49a4dd[_0x86b9('0x44')];if(this[_0x86b9('0x9')][_0x49a4dd[_0x86b9('0x27')]]&&this[_0x86b9('0x9')][_0x49a4dd[_0x86b9('0x27')]][_0x86b9('0x4e')]){this['channels'][_0x49a4dd[_0x86b9('0x22')]][_0x580f9c]['agentacw']=!![];this['channels'][_0x49a4dd[_0x86b9('0x22')]][_0x580f9c][_0x86b9('0x4f')]=this[_0x86b9('0x9')][_0x49a4dd[_0x86b9('0x27')]]['acwTimeout'];}this[_0x86b9('0xa')][_0x49a4dd[_0x86b9('0x50')]]=_[_0x86b9('0x2b')](this['agents'][_0x49a4dd[_0x86b9('0x50')]],[_0x86b9('0x27'),_0x86b9('0x39')]);this[_0x86b9('0x1e')](util[_0x86b9('0x24')](_0x86b9('0x2f'),_0x49a4dd['membername']),_0x86b9('0x51'),this[_0x86b9('0x21')][_0x49a4dd[_0x86b9('0x22')]][_0x580f9c]);ami[_0x86b9('0x1e')](_0x86b9('0x52'),this[_0x86b9('0x21')][_0x49a4dd[_0x86b9('0x22')]][_0x580f9c]);}}}}}}catch(_0x42ca41){logger[_0x86b9('0x31')](_0x86b9('0x53'),util[_0x86b9('0x42')](_0x42ca41,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x86b9('0x1d')][_0x86b9('0x54')]=function(_0x4d016b){try{if(this['isNotNull'](_0x4d016b)){this['addVariable'](_0x4d016b['uniqueid'],_[_0x86b9('0x55')](_0x4d016b[_0x86b9('0x56')])[0x0],_0x4d016b[_0x86b9('0x57')]);if(this['channels'][_0x4d016b[_0x86b9('0x22')]]){for(var _0x4cc883 in this[_0x86b9('0x21')][_0x4d016b[_0x86b9('0x22')]]){if(this[_0x86b9('0x21')][_0x4d016b['uniqueid']]['hasOwnProperty'](_0x4cc883)){if(_['isUndefined'](this[_0x86b9('0x21')][_0x4d016b[_0x86b9('0x22')]][_0x4cc883][_0x86b9('0x26')])){this['channels'][_0x4d016b[_0x86b9('0x22')]][_0x4cc883][_0x86b9('0x26')]={};}this[_0x86b9('0x21')][_0x4d016b['uniqueid']][_0x4cc883]['variables']=this[_0x86b9('0x26')][_0x4d016b[_0x86b9('0x22')]];}}}}}catch(_0x2b3fce){logger[_0x86b9('0x31')]('[syncVarSet][VoiceAgentReport]',util['inspect'](_0x2b3fce,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x86b9('0x1d')][_0x86b9('0x58')]=function(_0x2ad18a,_0x2921fb,_0xc410ab){var _0x3b4aee=['rtpaudioqos',_0x86b9('0x59'),'rtpaudioqosjitter',_0x86b9('0x5a'),_0x86b9('0x5b'),_0x86b9('0x5c'),_0x86b9('0x5d'),_0x86b9('0x5e'),'sipcallid',_0x86b9('0x5f'),_0x86b9('0x60'),_0x86b9('0x61'),_0x86b9('0x62'),'memberdynamic',_0x86b9('0x63'),_0x86b9('0x64'),'membername','memberpenalty',_0x86b9('0x65')];if(!_[_0x86b9('0x66')](_0x2921fb)&&!_['includes'](_0x3b4aee,_0x2921fb)){if(_[_0x86b9('0x20')](this[_0x86b9('0x26')][_0x2ad18a])){this[_0x86b9('0x26')][_0x2ad18a]={};}this[_0x86b9('0x26')][_0x2ad18a][_0x2921fb]=_0xc410ab;}};VoiceAgentReport[_0x86b9('0x1d')][_0x86b9('0x16')]=function(_0x1e5ab0){try{if(this['isNotNull'](_0x1e5ab0)){if(this[_0x86b9('0x21')][_0x1e5ab0[_0x86b9('0x22')]]){for(var _0x23778a in this[_0x86b9('0x21')][_0x1e5ab0[_0x86b9('0x22')]]){if(this[_0x86b9('0x21')][_0x1e5ab0['uniqueid']][_0x86b9('0x46')](_0x23778a)){if(this['channels'][_0x1e5ab0[_0x86b9('0x22')]][_0x23778a]['reason']==_0x86b9('0x4c')&&this[_0x86b9('0x21')][_0x1e5ab0[_0x86b9('0x22')]][_0x23778a]['agentcomplete']){this['channels'][_0x1e5ab0[_0x86b9('0x22')]][_0x23778a][_0x86b9('0x4a')]=moment()[_0x86b9('0x24')]('YYYY-MM-DD\x20HH:mm:ss');}}}ami[_0x86b9('0x1e')](_0x86b9('0x67'),_['values'](this['channels'][_0x1e5ab0[_0x86b9('0x22')]]));delete this[_0x86b9('0x21')][_0x1e5ab0['uniqueid']];}if(this[_0x86b9('0x26')][_0x1e5ab0['uniqueid']]){delete this[_0x86b9('0x26')][_0x1e5ab0['uniqueid']];}}}catch(_0x371a94){logger['error'](_0x86b9('0x68'),util[_0x86b9('0x42')](_0x371a94,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x86b9('0x1d')][_0x86b9('0x69')]=function(_0x45cd35){try{if(this[_0x86b9('0x1f')](_0x45cd35)){if(this[_0x86b9('0x21')][_0x45cd35[_0x86b9('0x6a')]]){for(var _0x7011d1 in this[_0x86b9('0x21')][_0x45cd35[_0x86b9('0x6a')]]){if(this[_0x86b9('0x21')][_0x45cd35[_0x86b9('0x6a')]][_0x86b9('0x46')](_0x7011d1)){if(_0x45cd35[_0x86b9('0x6b')]===_0x7011d1){var _0x41d358=moment();this[_0x86b9('0x21')][_0x45cd35['transfereeuniqueid']][_0x7011d1][_0x86b9('0x14')]=!![];this['channels'][_0x45cd35[_0x86b9('0x6a')]][_0x7011d1]['agentcompleteAt']=moment()['format'](_0x86b9('0x25'));this['channels'][_0x45cd35[_0x86b9('0x6a')]][_0x7011d1]['reason']=_0x86b9('0x4c');this[_0x86b9('0x21')][_0x45cd35[_0x86b9('0x6a')]][_0x7011d1][_0x86b9('0x34')]=_0x86b9('0x6c');this['channels'][_0x45cd35[_0x86b9('0x6a')]][_0x7011d1][_0x86b9('0x4b')]=_0x41d358['diff'](this['channels'][_0x45cd35[_0x86b9('0x6a')]][_0x7011d1]['agentconnectAt'],_0x86b9('0x6d'));}}}}if(this[_0x86b9('0x21')][_0x45cd35[_0x86b9('0x6e')]]){var _0x319757=this[_0x86b9('0x21')][_0x45cd35[_0x86b9('0x6e')]];this[_0x86b9('0x21')][_0x45cd35[_0x86b9('0x6e')]]=this['channels'][_0x45cd35[_0x86b9('0x6a')]];this[_0x86b9('0x21')][_0x45cd35['transfereeuniqueid']]=_0x319757;}}}catch(_0x151330){logger['error'](_0x86b9('0x6f'),util[_0x86b9('0x42')](_0x151330,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x86b9('0x1d')]['syncBlindTransfer']=function(_0x50b4dc){try{if(this[_0x86b9('0x1f')](_0x50b4dc)){if(this[_0x86b9('0x21')][_0x50b4dc[_0x86b9('0x6a')]]){for(var _0x24ea1d in this[_0x86b9('0x21')][_0x50b4dc[_0x86b9('0x6a')]]){if(this[_0x86b9('0x21')][_0x50b4dc[_0x86b9('0x6a')]][_0x86b9('0x46')](_0x24ea1d)){if(_0x50b4dc['transfereruniqueid']===_0x24ea1d){var _0x2153ac=moment();this[_0x86b9('0x21')][_0x50b4dc[_0x86b9('0x6a')]][_0x24ea1d]['agentcomplete']=!![];this[_0x86b9('0x21')][_0x50b4dc['transfereeuniqueid']][_0x24ea1d][_0x86b9('0x4a')]=_0x2153ac;this[_0x86b9('0x21')][_0x50b4dc[_0x86b9('0x6a')]][_0x24ea1d][_0x86b9('0x44')]=_0x86b9('0x4c');this[_0x86b9('0x21')][_0x50b4dc[_0x86b9('0x6a')]][_0x24ea1d][_0x86b9('0x34')]=_0x86b9('0x6c');this['channels'][_0x50b4dc['transfereeuniqueid']][_0x24ea1d][_0x86b9('0x4b')]=_0x2153ac[_0x86b9('0x70')](this[_0x86b9('0x21')][_0x50b4dc['transfereeuniqueid']][_0x24ea1d][_0x86b9('0x33')],_0x86b9('0x6d'));}}}}}}catch(_0x5b4c2f){logger[_0x86b9('0x31')](_0x86b9('0x71'),util['inspect'](_0x5b4c2f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x86b9('0x1d')][_0x86b9('0x72')]=function(_0xf6ff0c){var _0x254eb1='';try{if(this[_0x86b9('0x1f')](_0xf6ff0c)){if(_0xf6ff0c[_0x86b9('0x73')]){_0x254eb1=_0xf6ff0c[_0x86b9('0x73')][_0x86b9('0x74')](0x0,_0xf6ff0c[_0x86b9('0x73')][_0x86b9('0x75')]('-'));if(this[_0x86b9('0xa')][_0x254eb1]){this[_0x86b9('0xa')][_0x254eb1][_0x86b9('0x76')]=!![];}}}}catch(_0x40cfab){logger[_0x86b9('0x31')](_0x86b9('0x77'),util[_0x86b9('0x42')](_0x40cfab,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x86b9('0x1d')][_0x86b9('0x19')]=function(_0x331d80){var _0x3de8f4='';try{if(this[_0x86b9('0x1f')](_0x331d80)){if(_0x331d80[_0x86b9('0x73')]){_0x3de8f4=_0x331d80[_0x86b9('0x73')][_0x86b9('0x74')](0x0,_0x331d80[_0x86b9('0x73')][_0x86b9('0x75')]('-'));if(this[_0x86b9('0xa')][_0x3de8f4]){this[_0x86b9('0xa')][_0x3de8f4][_0x86b9('0x76')]=![];}}}}catch(_0x3259f0){logger['error'](_0x86b9('0x78'),util['inspect'](_0x3259f0,{'showHidden':![],'depth':null}));}};module['exports']=VoiceAgentReport; \ No newline at end of file +var _0xb2ed=['transfer','agent','agentacw','acwtime','interface','user:agentcomplete','custom:agentcomplete','[syncAgentComplete][VoiceAgentReport]','keys','value','[syncVarSet][VoiceAgentReport]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipuri','bridgepeer','memberinterface','memberlastcall','memberrealtime','isNil','includes','syncHangup','custom:voiceAgentReport','values','[syncHangup][VoiceAgentReport]','syncAttendedTransfer','transfereeuniqueid','origtransfereruniqueid','diff','seconds','secondtransfereruniqueid','[syncAttendedTransfer][VoiceAgentReport]','transfereruniqueid','[syncBlindTransfer][VoiceAgentReport]','channel','lastIndexOf','onhold','[syncMusicOnHoldStart][VoiceAgentReport]','substring','[syncMusicOnHoldStop][VoiceAgentReport]','exports','lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','redis','defaults','localhost','socket.io-emitter','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','agentconnect','syncAgentConnect','bind','agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon','syncQueueCallerAbandon','syncAgentComplete','varset','syncVarSet','hangup','musiconholdstart','syncMusicOnHoldStop','attendedtransfer','blindtransfer','syncBlindTransfer','prototype','emit','isUndefined','isNotNull','uniqueid','destuniqueid','format','YYYY-MM-DD\x20HH:mm:ss','called','queue','type','inbound','merge','omit','event','privilege','custom:agentcalled','membername','user:called','error','[syncAgentCalled][VoiceAgentReport]','inspect','hasOwnProperty','agentconnectAt','lastevent','connect','holdtime','connectedlinenum','connectedlinename','destchannelstate','destchannelstatedesc','destconnectedlinenum','user:%s','agentringnoanswerAt','reason','answered_elsewhere','answeredelsewheredestinationuniqueid','custom:agentansweredelsewhere','rejected','[syncAgentRingNoAnswer][VoiceAgentReport]','agentcomplete','abandoned','custom:agentqueuecallerabandon','[syncQueueCallerAbandon][VoiceAgentReport]','agentcompleteAt','complete','talktime'];(function(_0x5cf50c,_0xfce6af){var _0x1929f4=function(_0x1a5887){while(--_0x1a5887){_0x5cf50c['push'](_0x5cf50c['shift']());}};_0x1929f4(++_0xfce6af);}(_0xb2ed,0xa5));var _0xdb2e=function(_0x582274,_0x2cbd9c){_0x582274=_0x582274-0x0;var _0x8f14d3=_0xb2ed[_0x582274];return _0x8f14d3;};'use strict';var _=require(_0xdb2e('0x0'));var moment=require(_0xdb2e('0x1'));var util=require(_0xdb2e('0x2'));var Redis=require(_0xdb2e('0x3'));var config=require(_0xdb2e('0x4'));var logger=require(_0xdb2e('0x5'))('ami');var ami=require('../ami');config[_0xdb2e('0x6')]=_[_0xdb2e('0x7')](config['redis'],{'host':_0xdb2e('0x8'),'port':0x18eb});var io=require(_0xdb2e('0x9'))(new Redis(config[_0xdb2e('0x6')]));function VoiceAgentReport(_0x2c85c0){this[_0xdb2e('0xa')]={};this[_0xdb2e('0xb')]=_0x2c85c0[_0xdb2e('0xb')];this[_0xdb2e('0xc')]=_0x2c85c0[_0xdb2e('0xc')];this[_0xdb2e('0xd')]={};ami['on'](_0xdb2e('0xe'),this[_0xdb2e('0xf')]['bind'](this));ami['on'](_0xdb2e('0x10'),this[_0xdb2e('0x11')][_0xdb2e('0x12')](this));ami['on'](_0xdb2e('0x13'),this[_0xdb2e('0x14')][_0xdb2e('0x12')](this));ami['on'](_0xdb2e('0x15'),this[_0xdb2e('0x16')][_0xdb2e('0x12')](this));ami['on']('agentcomplete',this[_0xdb2e('0x17')][_0xdb2e('0x12')](this));ami['on'](_0xdb2e('0x18'),this[_0xdb2e('0x19')][_0xdb2e('0x12')](this));ami['on'](_0xdb2e('0x1a'),this['syncHangup'][_0xdb2e('0x12')](this));ami['on'](_0xdb2e('0x1b'),this['syncMusicOnHoldStart'][_0xdb2e('0x12')](this));ami['on']('musiconholdstop',this[_0xdb2e('0x1c')][_0xdb2e('0x12')](this));ami['on'](_0xdb2e('0x1d'),this['syncAttendedTransfer'][_0xdb2e('0x12')](this));ami['on'](_0xdb2e('0x1e'),this[_0xdb2e('0x1f')][_0xdb2e('0x12')](this));}VoiceAgentReport[_0xdb2e('0x20')][_0xdb2e('0x21')]=function(_0x2a827c,_0x5d1bcb,_0x25266){io['to'](_0x2a827c)[_0xdb2e('0x21')](_0x5d1bcb,_0x25266);};VoiceAgentReport[_0xdb2e('0x20')]['isNotNull']=function(_0x477c17){return _0x477c17!==null&&!_[_0xdb2e('0x22')](_0x477c17);};VoiceAgentReport[_0xdb2e('0x20')][_0xdb2e('0xf')]=function(_0x22a357){try{if(this[_0xdb2e('0x23')](_0x22a357)){if(_[_0xdb2e('0x22')](this[_0xdb2e('0xa')][_0x22a357[_0xdb2e('0x24')]])){this[_0xdb2e('0xa')][_0x22a357[_0xdb2e('0x24')]]={};}if(_[_0xdb2e('0x22')](this[_0xdb2e('0xa')][_0x22a357['uniqueid']][_0x22a357[_0xdb2e('0x25')]])){this['channels'][_0x22a357['uniqueid']][_0x22a357[_0xdb2e('0x25')]]={'agentcalledAt':moment()[_0xdb2e('0x26')](_0xdb2e('0x27')),'lastevent':_0xdb2e('0x28'),'variables':this[_0xdb2e('0xd')][_0x22a357[_0xdb2e('0x24')]],'type':this['voiceQueues'][_0x22a357[_0xdb2e('0x29')]]?this[_0xdb2e('0xb')][_0x22a357[_0xdb2e('0x29')]][_0xdb2e('0x2a')]||_0xdb2e('0x2b'):'inbound'};}_[_0xdb2e('0x2c')](this[_0xdb2e('0xa')][_0x22a357[_0xdb2e('0x24')]][_0x22a357[_0xdb2e('0x25')]],_[_0xdb2e('0x2d')](_0x22a357,[_0xdb2e('0x2e'),_0xdb2e('0x2f')]));ami['emit'](_0xdb2e('0x30'),this['channels'][_0x22a357['uniqueid']][_0x22a357[_0xdb2e('0x25')]]);this[_0xdb2e('0x21')](util['format']('user:%s',_0x22a357[_0xdb2e('0x31')]),_0xdb2e('0x32'),this[_0xdb2e('0xa')][_0x22a357['uniqueid']][_0x22a357['destuniqueid']]);}}catch(_0xb9b440){logger[_0xdb2e('0x33')](_0xdb2e('0x34'),util[_0xdb2e('0x35')](_0xb9b440,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xdb2e('0x20')]['syncAgentConnect']=function(_0x26c938){try{if(this[_0xdb2e('0x23')](_0x26c938)){if(this[_0xdb2e('0xa')][_0x26c938[_0xdb2e('0x24')]]){for(var _0x493a2b in this['channels'][_0x26c938[_0xdb2e('0x24')]]){if(this[_0xdb2e('0xa')][_0x26c938[_0xdb2e('0x24')]][_0xdb2e('0x36')](_0x493a2b)){if(_0x26c938[_0xdb2e('0x25')]===_0x493a2b){this['channels'][_0x26c938['uniqueid']][_0x493a2b][_0xdb2e('0x37')]=moment()[_0xdb2e('0x26')](_0xdb2e('0x27'));this[_0xdb2e('0xa')][_0x26c938[_0xdb2e('0x24')]][_0x493a2b][_0xdb2e('0x38')]=_0xdb2e('0x39');this[_0xdb2e('0xa')][_0x26c938['uniqueid']][_0x493a2b][_0xdb2e('0x3a')]=_0x26c938[_0xdb2e('0x3a')];this['channels'][_0x26c938['uniqueid']][_0x493a2b][_0xdb2e('0x3b')]=_0x26c938['connectedlinenum'];this[_0xdb2e('0xa')][_0x26c938['uniqueid']][_0x493a2b][_0xdb2e('0x3c')]=_0x26c938[_0xdb2e('0x3c')];this[_0xdb2e('0xa')][_0x26c938[_0xdb2e('0x24')]][_0x493a2b][_0xdb2e('0x3d')]=_0x26c938[_0xdb2e('0x3d')];this[_0xdb2e('0xa')][_0x26c938[_0xdb2e('0x24')]][_0x493a2b][_0xdb2e('0x3e')]=_0x26c938['destchannelstatedesc'];_[_0xdb2e('0x2c')](this[_0xdb2e('0xc')][_0x26c938['interface']],_['pick'](_0x26c938,[_0xdb2e('0x29'),_0xdb2e('0x3f')]));this['emit'](util['format'](_0xdb2e('0x40'),_0x26c938['membername']),'user:agentconnect',this[_0xdb2e('0xa')][_0x26c938[_0xdb2e('0x24')]][_0x26c938[_0xdb2e('0x25')]]);ami['emit']('custom:agentconnect',this[_0xdb2e('0xa')][_0x26c938['uniqueid']][_0x493a2b]);}else if(!this[_0xdb2e('0xa')][_0x26c938['uniqueid']][_0x493a2b][_0xdb2e('0x13')]&&!this[_0xdb2e('0xa')][_0x26c938[_0xdb2e('0x24')]][_0x493a2b]['agentcomplete']){this[_0xdb2e('0xa')][_0x26c938[_0xdb2e('0x24')]][_0x493a2b]['agentringnoanswer']=!![];this[_0xdb2e('0xa')][_0x26c938['uniqueid']][_0x493a2b][_0xdb2e('0x41')]=moment()[_0xdb2e('0x26')](_0xdb2e('0x27'));this[_0xdb2e('0xa')][_0x26c938[_0xdb2e('0x24')]][_0x493a2b][_0xdb2e('0x42')]='answered_elsewhere';this[_0xdb2e('0xa')][_0x26c938[_0xdb2e('0x24')]][_0x493a2b][_0xdb2e('0x38')]=_0xdb2e('0x43');this[_0xdb2e('0xa')][_0x26c938[_0xdb2e('0x24')]][_0x493a2b][_0xdb2e('0x44')]=_0x26c938[_0xdb2e('0x25')];this['channels'][_0x26c938[_0xdb2e('0x24')]][_0x493a2b]['answeredelsewheremembername']=_0x26c938[_0xdb2e('0x31')];ami[_0xdb2e('0x21')](_0xdb2e('0x45'),this[_0xdb2e('0xa')][_0x26c938[_0xdb2e('0x24')]][_0x493a2b]);}}}}}}catch(_0xb68d3f){logger[_0xdb2e('0x33')]('[syncAgentConnect][VoiceAgentReport]',util[_0xdb2e('0x35')](_0xb68d3f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xdb2e('0x20')]['syncAgentRingNoAnswer']=function(_0x235725){try{if(this[_0xdb2e('0x23')](_0x235725)){if(this[_0xdb2e('0xa')][_0x235725[_0xdb2e('0x24')]]&&this[_0xdb2e('0xa')][_0x235725['uniqueid']][_0x235725[_0xdb2e('0x25')]]){this['channels'][_0x235725[_0xdb2e('0x24')]][_0x235725['destuniqueid']]['agentringnoanswer']=!![];this[_0xdb2e('0xa')][_0x235725[_0xdb2e('0x24')]][_0x235725[_0xdb2e('0x25')]][_0xdb2e('0x41')]=moment()[_0xdb2e('0x26')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x235725[_0xdb2e('0x24')]][_0x235725['destuniqueid']][_0xdb2e('0x42')]=_0xdb2e('0x46');this[_0xdb2e('0xa')][_0x235725[_0xdb2e('0x24')]][_0x235725[_0xdb2e('0x25')]][_0xdb2e('0x38')]='rejected';ami[_0xdb2e('0x21')]('custom:agentringnoanswer',this[_0xdb2e('0xa')][_0x235725[_0xdb2e('0x24')]][_0x235725[_0xdb2e('0x25')]]);}}}catch(_0xb5eff2){logger[_0xdb2e('0x33')](_0xdb2e('0x47'),util[_0xdb2e('0x35')](_0xb5eff2,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xdb2e('0x16')]=function(_0xcfc785){try{if(this[_0xdb2e('0x23')](_0xcfc785)){if(this[_0xdb2e('0xa')][_0xcfc785['uniqueid']]){for(var _0xde766e in this[_0xdb2e('0xa')][_0xcfc785[_0xdb2e('0x24')]]){if(this[_0xdb2e('0xa')][_0xcfc785[_0xdb2e('0x24')]][_0xdb2e('0x36')](_0xde766e)&&!this['channels'][_0xcfc785[_0xdb2e('0x24')]][_0xde766e]['agentringnoanswer']&&!this[_0xdb2e('0xa')][_0xcfc785[_0xdb2e('0x24')]][_0xde766e][_0xdb2e('0x48')]){this['channels'][_0xcfc785[_0xdb2e('0x24')]][_0xde766e][_0xdb2e('0x13')]=!![];this['channels'][_0xcfc785[_0xdb2e('0x24')]][_0xde766e][_0xdb2e('0x41')]=moment()[_0xdb2e('0x26')](_0xdb2e('0x27'));this[_0xdb2e('0xa')][_0xcfc785[_0xdb2e('0x24')]][_0xde766e]['reason']=_0xdb2e('0x49');this[_0xdb2e('0xa')][_0xcfc785[_0xdb2e('0x24')]][_0xde766e][_0xdb2e('0x38')]=_0xdb2e('0x49');ami['emit'](_0xdb2e('0x4a'),this['channels'][_0xcfc785[_0xdb2e('0x24')]][_0xde766e]);}}}}}catch(_0x28e38d){logger[_0xdb2e('0x33')](_0xdb2e('0x4b'),util[_0xdb2e('0x35')](_0x28e38d,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncAgentComplete']=function(_0x293d0f){try{if(this[_0xdb2e('0x23')](_0x293d0f)){if(this[_0xdb2e('0xa')][_0x293d0f['uniqueid']]){for(var _0x25c078 in this[_0xdb2e('0xa')][_0x293d0f[_0xdb2e('0x24')]]){if(this[_0xdb2e('0xa')][_0x293d0f[_0xdb2e('0x24')]][_0xdb2e('0x36')](_0x25c078)){if(this[_0xdb2e('0xa')][_0x293d0f['uniqueid']][_0x25c078][_0xdb2e('0x37')]&&!this[_0xdb2e('0xa')][_0x293d0f[_0xdb2e('0x24')]][_0x25c078][_0xdb2e('0x48')]){this[_0xdb2e('0xa')][_0x293d0f[_0xdb2e('0x24')]][_0x25c078][_0xdb2e('0x48')]=!![];this[_0xdb2e('0xa')][_0x293d0f['uniqueid']][_0x25c078][_0xdb2e('0x4c')]=moment()[_0xdb2e('0x26')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xdb2e('0xa')][_0x293d0f[_0xdb2e('0x24')]][_0x25c078][_0xdb2e('0x38')]=_0xdb2e('0x4d');this[_0xdb2e('0xa')][_0x293d0f[_0xdb2e('0x24')]][_0x25c078][_0xdb2e('0x4e')]=_0x293d0f[_0xdb2e('0x4e')];this[_0xdb2e('0xa')][_0x293d0f[_0xdb2e('0x24')]][_0x25c078][_0xdb2e('0x42')]=_0x293d0f[_0xdb2e('0x42')]==_0xdb2e('0x4f')?_0xdb2e('0x50'):_0x293d0f[_0xdb2e('0x42')];if(this[_0xdb2e('0xb')][_0x293d0f[_0xdb2e('0x29')]]&&this[_0xdb2e('0xb')][_0x293d0f[_0xdb2e('0x29')]]['acw']){this['channels'][_0x293d0f['uniqueid']][_0x25c078][_0xdb2e('0x51')]=!![];this[_0xdb2e('0xa')][_0x293d0f[_0xdb2e('0x24')]][_0x25c078][_0xdb2e('0x52')]=this['voiceQueues'][_0x293d0f[_0xdb2e('0x29')]]['acwTimeout'];}this['agents'][_0x293d0f[_0xdb2e('0x53')]]=_['omit'](this['agents'][_0x293d0f[_0xdb2e('0x53')]],[_0xdb2e('0x29'),'destconnectedlinenum']);this[_0xdb2e('0x21')](util[_0xdb2e('0x26')](_0xdb2e('0x40'),_0x293d0f[_0xdb2e('0x31')]),_0xdb2e('0x54'),this[_0xdb2e('0xa')][_0x293d0f[_0xdb2e('0x24')]][_0x25c078]);ami[_0xdb2e('0x21')](_0xdb2e('0x55'),this[_0xdb2e('0xa')][_0x293d0f[_0xdb2e('0x24')]][_0x25c078]);}}}}}}catch(_0x46d3dd){logger[_0xdb2e('0x33')](_0xdb2e('0x56'),util[_0xdb2e('0x35')](_0x46d3dd,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xdb2e('0x20')][_0xdb2e('0x19')]=function(_0x4d17d1){try{if(this['isNotNull'](_0x4d17d1)){this['addVariable'](_0x4d17d1[_0xdb2e('0x24')],_[_0xdb2e('0x57')](_0x4d17d1['variable'])[0x0],_0x4d17d1[_0xdb2e('0x58')]);if(this[_0xdb2e('0xa')][_0x4d17d1['uniqueid']]){for(var _0x38753c in this[_0xdb2e('0xa')][_0x4d17d1[_0xdb2e('0x24')]]){if(this[_0xdb2e('0xa')][_0x4d17d1[_0xdb2e('0x24')]][_0xdb2e('0x36')](_0x38753c)){if(_['isUndefined'](this[_0xdb2e('0xa')][_0x4d17d1[_0xdb2e('0x24')]][_0x38753c][_0xdb2e('0xd')])){this[_0xdb2e('0xa')][_0x4d17d1['uniqueid']][_0x38753c][_0xdb2e('0xd')]={};}this[_0xdb2e('0xa')][_0x4d17d1['uniqueid']][_0x38753c][_0xdb2e('0xd')]=this['variables'][_0x4d17d1[_0xdb2e('0x24')]];}}}}}catch(_0x4685dd){logger[_0xdb2e('0x33')](_0xdb2e('0x59'),util[_0xdb2e('0x35')](_0x4685dd,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['addVariable']=function(_0x2472e4,_0x762bfe,_0x5c04aa){var _0x1bd1eb=[_0xdb2e('0x5a'),_0xdb2e('0x5b'),'rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss',_0xdb2e('0x5c'),_0xdb2e('0x5d'),_0xdb2e('0x5e'),'sipcallid',_0xdb2e('0x5f'),_0xdb2e('0x60'),'bridgepvtcallid','membercalls','memberdynamic',_0xdb2e('0x61'),_0xdb2e('0x62'),_0xdb2e('0x31'),'memberpenalty',_0xdb2e('0x63')];if(!_[_0xdb2e('0x64')](_0x762bfe)&&!_[_0xdb2e('0x65')](_0x1bd1eb,_0x762bfe)){if(_[_0xdb2e('0x22')](this[_0xdb2e('0xd')][_0x2472e4])){this['variables'][_0x2472e4]={};}this['variables'][_0x2472e4][_0x762bfe]=_0x5c04aa;}};VoiceAgentReport[_0xdb2e('0x20')][_0xdb2e('0x66')]=function(_0x943ca5){try{if(this[_0xdb2e('0x23')](_0x943ca5)){if(this[_0xdb2e('0xa')][_0x943ca5[_0xdb2e('0x24')]]){for(var _0xecce94 in this[_0xdb2e('0xa')][_0x943ca5[_0xdb2e('0x24')]]){if(this[_0xdb2e('0xa')][_0x943ca5[_0xdb2e('0x24')]][_0xdb2e('0x36')](_0xecce94)){if(this[_0xdb2e('0xa')][_0x943ca5[_0xdb2e('0x24')]][_0xecce94]['reason']==_0xdb2e('0x4f')&&this[_0xdb2e('0xa')][_0x943ca5['uniqueid']][_0xecce94]['agentcomplete']){this['channels'][_0x943ca5[_0xdb2e('0x24')]][_0xecce94]['agentcompleteAt']=moment()[_0xdb2e('0x26')](_0xdb2e('0x27'));}}}ami[_0xdb2e('0x21')](_0xdb2e('0x67'),_[_0xdb2e('0x68')](this[_0xdb2e('0xa')][_0x943ca5[_0xdb2e('0x24')]]));delete this['channels'][_0x943ca5['uniqueid']];}if(this['variables'][_0x943ca5[_0xdb2e('0x24')]]){delete this['variables'][_0x943ca5[_0xdb2e('0x24')]];}}}catch(_0x5ae6e4){logger[_0xdb2e('0x33')](_0xdb2e('0x69'),util['inspect'](_0x5ae6e4,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xdb2e('0x6a')]=function(_0x593d10){try{if(this[_0xdb2e('0x23')](_0x593d10)){if(this[_0xdb2e('0xa')][_0x593d10[_0xdb2e('0x6b')]]){for(var _0x188cb1 in this[_0xdb2e('0xa')][_0x593d10[_0xdb2e('0x6b')]]){if(this['channels'][_0x593d10[_0xdb2e('0x6b')]][_0xdb2e('0x36')](_0x188cb1)){if(_0x593d10[_0xdb2e('0x6c')]===_0x188cb1){var _0x1e484a=moment();this[_0xdb2e('0xa')][_0x593d10[_0xdb2e('0x6b')]][_0x188cb1][_0xdb2e('0x48')]=!![];this[_0xdb2e('0xa')][_0x593d10[_0xdb2e('0x6b')]][_0x188cb1][_0xdb2e('0x4c')]=moment()[_0xdb2e('0x26')](_0xdb2e('0x27'));this['channels'][_0x593d10[_0xdb2e('0x6b')]][_0x188cb1][_0xdb2e('0x42')]=_0xdb2e('0x4f');this[_0xdb2e('0xa')][_0x593d10[_0xdb2e('0x6b')]][_0x188cb1][_0xdb2e('0x38')]=_0xdb2e('0x4d');this[_0xdb2e('0xa')][_0x593d10[_0xdb2e('0x6b')]][_0x188cb1]['talktime']=_0x1e484a[_0xdb2e('0x6d')](this[_0xdb2e('0xa')][_0x593d10[_0xdb2e('0x6b')]][_0x188cb1]['agentconnectAt'],_0xdb2e('0x6e'));}}}}if(this[_0xdb2e('0xa')][_0x593d10['secondtransfereruniqueid']]){var _0x12f9bb=this[_0xdb2e('0xa')][_0x593d10[_0xdb2e('0x6f')]];this[_0xdb2e('0xa')][_0x593d10[_0xdb2e('0x6f')]]=this['channels'][_0x593d10['transfereeuniqueid']];this[_0xdb2e('0xa')][_0x593d10[_0xdb2e('0x6b')]]=_0x12f9bb;}}}catch(_0x35c758){logger[_0xdb2e('0x33')](_0xdb2e('0x70'),util[_0xdb2e('0x35')](_0x35c758,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xdb2e('0x1f')]=function(_0x24c530){try{if(this['isNotNull'](_0x24c530)){if(this[_0xdb2e('0xa')][_0x24c530[_0xdb2e('0x6b')]]){for(var _0x4c7e93 in this['channels'][_0x24c530[_0xdb2e('0x6b')]]){if(this['channels'][_0x24c530[_0xdb2e('0x6b')]]['hasOwnProperty'](_0x4c7e93)){if(_0x24c530[_0xdb2e('0x71')]===_0x4c7e93){var _0x2098c0=moment();this[_0xdb2e('0xa')][_0x24c530[_0xdb2e('0x6b')]][_0x4c7e93]['agentcomplete']=!![];this['channels'][_0x24c530['transfereeuniqueid']][_0x4c7e93][_0xdb2e('0x4c')]=_0x2098c0;this[_0xdb2e('0xa')][_0x24c530[_0xdb2e('0x6b')]][_0x4c7e93][_0xdb2e('0x42')]=_0xdb2e('0x4f');this[_0xdb2e('0xa')][_0x24c530['transfereeuniqueid']][_0x4c7e93]['lastevent']='complete';this[_0xdb2e('0xa')][_0x24c530[_0xdb2e('0x6b')]][_0x4c7e93]['talktime']=_0x2098c0[_0xdb2e('0x6d')](this[_0xdb2e('0xa')][_0x24c530[_0xdb2e('0x6b')]][_0x4c7e93][_0xdb2e('0x37')],_0xdb2e('0x6e'));}}}}}}catch(_0x52456b){logger[_0xdb2e('0x33')](_0xdb2e('0x72'),util[_0xdb2e('0x35')](_0x52456b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xdb2e('0x20')]['syncMusicOnHoldStart']=function(_0x365435){var _0x4183a8='';try{if(this[_0xdb2e('0x23')](_0x365435)){if(_0x365435[_0xdb2e('0x73')]){_0x4183a8=_0x365435['channel']['substring'](0x0,_0x365435[_0xdb2e('0x73')][_0xdb2e('0x74')]('-'));if(this[_0xdb2e('0xc')][_0x4183a8]){this[_0xdb2e('0xc')][_0x4183a8][_0xdb2e('0x75')]=!![];}}}}catch(_0x1cc0c5){logger[_0xdb2e('0x33')](_0xdb2e('0x76'),util[_0xdb2e('0x35')](_0x1cc0c5,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xdb2e('0x20')]['syncMusicOnHoldStop']=function(_0x1d1a59){var _0x11b27d='';try{if(this['isNotNull'](_0x1d1a59)){if(_0x1d1a59[_0xdb2e('0x73')]){_0x11b27d=_0x1d1a59[_0xdb2e('0x73')][_0xdb2e('0x77')](0x0,_0x1d1a59[_0xdb2e('0x73')]['lastIndexOf']('-'));if(this[_0xdb2e('0xc')][_0x11b27d]){this[_0xdb2e('0xc')][_0x11b27d][_0xdb2e('0x75')]=![];}}}}catch(_0x5dbf25){logger[_0xdb2e('0x33')](_0xdb2e('0x78'),util[_0xdb2e('0x35')](_0x5dbf25,{'showHidden':![],'depth':null}));}};module[_0xdb2e('0x79')]=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index 4ca796d..75ec9bc 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 _0x6f54=['holdtime','diff','calleridnum','xcally-motion-preview','connectedlinenum','calleridname','destinationchannel','UserId','membername','syncMixMonitorFilename','monitor','endsWith','.wav49','replace','monitorFilename','find','monitors','rec','value','variable','xmd-callerid','xmd-cdrtype','type','xmd-originatecalleridnum','xmd-destination','destination','calleridpreview','sipcalluniqueid','mixmonitor_filename','parse','sipcallid','sipcalllinkedid','[syncVarSet][VoiceCallReport]','endtime','billableseconds','context','omit','user:agentcomplete','[syncHangup][VoiceCallReport]','transfereeuniqueid','origtransferercalleridnum','transfertargetcalleridnum','secondtransfereruniqueid','transfertargetuniqueid','transfercalleridnum','transferconnectedlinenum','origtransfereruniqueid','transfereecalleridnum','extension','BlindTransfer','isNil','mohstarttime','mohtime','milliseconds','exports','bluebird','lodash','moment','util','path','ioredis','../../../config/logger','ami','not_inuse','inuse','invalid','unavailable','ringing','ringinuse','onhold','queue','agi','voicemail','NO\x20ANSWER','FAILED','BUSY','redis','defaults','localhost','socket.io-emitter','channels','agents','coreshowchannel','syncNewExten','bind','newexten','syncNewState','syncVarSet','hangup','syncHangup','syncNewCallerId','syncAttendedTransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','resolve','then','actionCoreShowChannels','catch','log','prototype','isNotNull','isUndefined','emit','linkedid','merge','uniqueid','pick','error','inspect','syncNewChannel','channel','OutgoingSpoolFailed','starttime','format','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','channelstate','keys','from-sip','split','destconnectedlinenum','exten','user:%s','name','user:agentconnect','accountcode','application','applicationdata','appdata','toLowerCase','subtract','duration','seconds','includes','lastapplication','set','startsWith','cdr(','match','answered','answertime'];(function(_0x4cae40,_0x42683a){var _0x215770=function(_0x119f25){while(--_0x119f25){_0x4cae40['push'](_0x4cae40['shift']());}};_0x215770(++_0x42683a);}(_0x6f54,0xc6));var _0x46f5=function(_0xe3b89c,_0xa2b63){_0xe3b89c=_0xe3b89c-0x0;var _0xebe0e7=_0x6f54[_0xe3b89c];return _0xebe0e7;};'use strict';var BPromise=require(_0x46f5('0x0'));var _=require(_0x46f5('0x1'));var moment=require(_0x46f5('0x2'));var util=require(_0x46f5('0x3'));var path=require(_0x46f5('0x4'));var Redis=require(_0x46f5('0x5'));var config=require('../../../config/environment');var logger=require(_0x46f5('0x6'))(_0x46f5('0x7'));var ami=require('../ami');var Channel=require('../model/channel');var statusDesc=['unknown',_0x46f5('0x8'),_0x46f5('0x9'),'busy',_0x46f5('0xa'),_0x46f5('0xb'),_0x46f5('0xc'),_0x46f5('0xd'),_0x46f5('0xe')];var applications=['set',_0x46f5('0xf'),_0x46f5('0x10'),'dial','playback',_0x46f5('0x11')];var dispositions=[_0x46f5('0x12'),_0x46f5('0x13'),_0x46f5('0x13'),'NO\x20ANSWER','NO\x20ANSWER',_0x46f5('0x12'),'ANSWERED',_0x46f5('0x14'),_0x46f5('0x13'),_0x46f5('0x13'),_0x46f5('0x13')];var actions={};config[_0x46f5('0x15')]=_[_0x46f5('0x16')](config[_0x46f5('0x15')],{'host':_0x46f5('0x17'),'port':0x18eb});var io=require(_0x46f5('0x18'))(new Redis(config[_0x46f5('0x15')]));function VoiceCallReport(_0x3f49f6){this[_0x46f5('0x19')]=_0x3f49f6[_0x46f5('0x19')];this[_0x46f5('0x1a')]=_0x3f49f6[_0x46f5('0x1a')];ami['on'](_0x46f5('0x1b'),this[_0x46f5('0x1c')][_0x46f5('0x1d')](this));ami['on'](_0x46f5('0x1e'),this['syncNewExten'][_0x46f5('0x1d')](this));ami['on']('newchannel',this['syncNewChannel'][_0x46f5('0x1d')](this));ami['on']('newstate',this[_0x46f5('0x1f')][_0x46f5('0x1d')](this));ami['on']('varset',this[_0x46f5('0x20')][_0x46f5('0x1d')](this));ami['on'](_0x46f5('0x21'),this[_0x46f5('0x22')]['bind'](this));ami['on']('newcallerid',this[_0x46f5('0x23')][_0x46f5('0x1d')](this));ami['on']('attendedtransfer',this[_0x46f5('0x24')][_0x46f5('0x1d')](this));ami['on']('blindtransfer',this[_0x46f5('0x25')]['bind'](this));ami['on'](_0x46f5('0x26'),this[_0x46f5('0x27')][_0x46f5('0x1d')](this));ami['on']('musiconholdstop',this['syncMusicOnHoldStop'][_0x46f5('0x1d')](this));return BPromise[_0x46f5('0x28')]()[_0x46f5('0x29')](ami[_0x46f5('0x2a')]())[_0x46f5('0x2b')](function(_0x2d8e70){console[_0x46f5('0x2c')](_0x2d8e70);});}VoiceCallReport[_0x46f5('0x2d')][_0x46f5('0x2e')]=function(_0xdff732){return _0xdff732!==null&&!_[_0x46f5('0x2f')](_0xdff732);};VoiceCallReport['prototype'][_0x46f5('0x30')]=function(_0x140d87,_0x50b3c0,_0x1ce46e){io['to'](_0x140d87)[_0x46f5('0x30')](_0x50b3c0,_0x1ce46e);};VoiceCallReport[_0x46f5('0x2d')][_0x46f5('0x23')]=function(_0x1a88c6){try{if(this[_0x46f5('0x2e')](_0x1a88c6)){if(_0x1a88c6['uniqueid']===_0x1a88c6[_0x46f5('0x31')]){if(!_[_0x46f5('0x2f')](this['channels'][_0x1a88c6['uniqueid']])){_[_0x46f5('0x32')](this['channels'][_0x1a88c6[_0x46f5('0x33')]],_[_0x46f5('0x34')](_0x1a88c6,_['keys'](this[_0x46f5('0x19')][_0x1a88c6[_0x46f5('0x33')]])));}}}}catch(_0x66898b){logger[_0x46f5('0x35')]('[syncNewCallerId][VoiceCallReport]',util[_0x46f5('0x36')](_0x66898b,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x46f5('0x37')]=function(_0xf3d512){try{if(this[_0x46f5('0x2e')](_0xf3d512)){if(_0xf3d512[_0x46f5('0x33')]===_0xf3d512[_0x46f5('0x31')]&&_0xf3d512[_0x46f5('0x38')]!=_0x46f5('0x39')){if(_['isUndefined'](this[_0x46f5('0x19')][_0xf3d512[_0x46f5('0x33')]])){this['channels'][_0xf3d512[_0x46f5('0x33')]]=new Channel();this[_0x46f5('0x19')][_0xf3d512['uniqueid']][_0x46f5('0x3a')]=moment()[_0x46f5('0x3b')](_0x46f5('0x3c'));this['channels'][_0xf3d512[_0x46f5('0x33')]][_0x46f5('0x3d')]=dispositions[_[_0x46f5('0x3e')](_0xf3d512[_0x46f5('0x3f')])];_[_0x46f5('0x32')](this[_0x46f5('0x19')][_0xf3d512[_0x46f5('0x33')]],_['pick'](_0xf3d512,_[_0x46f5('0x40')](this[_0x46f5('0x19')][_0xf3d512[_0x46f5('0x33')]])));if(_0xf3d512['context']===_0x46f5('0x41')){if(this[_0x46f5('0x1a')][_0xf3d512['channel'][_0x46f5('0x42')]('-')[0x0]]){this[_0x46f5('0x1a')][_0xf3d512[_0x46f5('0x38')][_0x46f5('0x42')]('-')[0x0]][_0x46f5('0x43')]=_0xf3d512[_0x46f5('0x44')];this[_0x46f5('0x30')](util[_0x46f5('0x3b')](_0x46f5('0x45'),this['agents'][_0xf3d512[_0x46f5('0x38')][_0x46f5('0x42')]('-')[0x0]][_0x46f5('0x46')]),_0x46f5('0x47'),{'destaccountcode':this[_0x46f5('0x1a')][_0xf3d512['channel'][_0x46f5('0x42')]('-')[0x0]][_0x46f5('0x48')],'destconnectedlinenum':_0xf3d512[_0x46f5('0x44')]});}}}}}}catch(_0x3d7398){logger['error']('[syncNewChannel][VoiceCallReport]',util[_0x46f5('0x36')](_0x3d7398,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x46f5('0x2d')][_0x46f5('0x1c')]=function(_0x3a6f68){try{if(this['isNotNull'](_0x3a6f68)){if(_0x3a6f68[_0x46f5('0x33')]===_0x3a6f68[_0x46f5('0x31')]&&_0x3a6f68[_0x46f5('0x44')]!='h'&&_0x3a6f68[_0x46f5('0x38')]!=_0x46f5('0x39')){_0x3a6f68[_0x46f5('0x49')]=_0x3a6f68[_0x46f5('0x49')]['toLowerCase']();_0x3a6f68[_0x46f5('0x4a')]=(_0x3a6f68[_0x46f5('0x4b')]||_0x3a6f68[_0x46f5('0x4a')])[_0x46f5('0x4c')]();if(_[_0x46f5('0x2f')](this[_0x46f5('0x19')][_0x3a6f68[_0x46f5('0x33')]])){this[_0x46f5('0x19')][_0x3a6f68['uniqueid']]=new Channel();this[_0x46f5('0x19')][_0x3a6f68[_0x46f5('0x33')]][_0x46f5('0x3a')]=_0x3a6f68['duration']?moment()[_0x46f5('0x4d')](moment['duration'](_0x3a6f68[_0x46f5('0x4e')])[_0x46f5('0x4f')](),'seconds')[_0x46f5('0x3b')]('YYYY-MM-DD\x20HH:mm:ss'):moment()[_0x46f5('0x3b')](_0x46f5('0x3c'));this['channels'][_0x3a6f68['uniqueid']][_0x46f5('0x3d')]=_0x46f5('0x12');}_[_0x46f5('0x32')](this[_0x46f5('0x19')][_0x3a6f68[_0x46f5('0x33')]],_[_0x46f5('0x34')](_0x3a6f68,_[_0x46f5('0x40')](this[_0x46f5('0x19')][_0x3a6f68['uniqueid']])));if(_[_0x46f5('0x50')](applications,_0x3a6f68[_0x46f5('0x49')])){this['channels'][_0x3a6f68[_0x46f5('0x33')]][_0x46f5('0x51')]=_0x3a6f68['application'];this['channels'][_0x3a6f68[_0x46f5('0x33')]]['lastdata']=_0x3a6f68[_0x46f5('0x4a')];if(_0x3a6f68[_0x46f5('0x49')]===_0x46f5('0x52')&&_[_0x46f5('0x53')](_0x3a6f68['applicationdata'],_0x46f5('0x54'))){var _0x3251a4=_0x3a6f68['applicationdata'][_0x46f5('0x42')]('=');var _0x1f5729=_0x3251a4[0x0][_0x46f5('0x55')](/cdr\((.*)\)/);if(_0x1f5729){this[_0x46f5('0x19')][_0x3a6f68['uniqueid']][_0x1f5729[0x1]]=_0x3251a4[0x1];}}else if(_0x3a6f68['application']==='queue'){this[_0x46f5('0x19')][_0x3a6f68[_0x46f5('0x33')]][_0x46f5('0xf')]=_0x3a6f68['applicationdata'][_0x46f5('0x42')](',')[0x0];}}}}}catch(_0x102e3d){logger[_0x46f5('0x35')]('[syncNewExten][VoiceCallReport]',util[_0x46f5('0x36')](_0x102e3d,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x46f5('0x2d')][_0x46f5('0x1f')]=function(_0x4b0535){try{if(this[_0x46f5('0x2e')](_0x4b0535)){if(_0x4b0535[_0x46f5('0x33')]!==_0x4b0535[_0x46f5('0x31')]){if(this[_0x46f5('0x19')][_0x4b0535[_0x46f5('0x31')]]){if(_0x4b0535['channelstate']==='6'){if(!this['channels'][_0x4b0535[_0x46f5('0x31')]][_0x46f5('0x56')]){var _0x5bde8e=moment();this[_0x46f5('0x19')][_0x4b0535[_0x46f5('0x31')]][_0x46f5('0x56')]=!![];this[_0x46f5('0x19')][_0x4b0535[_0x46f5('0x31')]][_0x46f5('0x57')]=_0x5bde8e[_0x46f5('0x3b')](_0x46f5('0x3c'));if(this['channels'][_0x4b0535['linkedid']][_0x46f5('0x3a')]){this[_0x46f5('0x19')][_0x4b0535[_0x46f5('0x31')]][_0x46f5('0x58')]=_0x5bde8e[_0x46f5('0x59')](this['channels'][_0x4b0535[_0x46f5('0x31')]][_0x46f5('0x3a')],_0x46f5('0x4f'));}}this[_0x46f5('0x19')][_0x4b0535[_0x46f5('0x31')]][_0x46f5('0x31')]=_0x4b0535[_0x46f5('0x33')];if(_0x4b0535[_0x46f5('0x5a')]!==_0x46f5('0x5b')){this['channels'][_0x4b0535[_0x46f5('0x31')]][_0x46f5('0x5c')]=_0x4b0535[_0x46f5('0x5a')];}this[_0x46f5('0x19')][_0x4b0535[_0x46f5('0x31')]]['connectedlinename']=_0x4b0535[_0x46f5('0x5d')];this['channels'][_0x4b0535[_0x46f5('0x31')]][_0x46f5('0x5e')]=_0x4b0535[_0x46f5('0x38')];this[_0x46f5('0x19')][_0x4b0535[_0x46f5('0x31')]][_0x46f5('0x3d')]=dispositions[_[_0x46f5('0x3e')](_0x4b0535['channelstate'])];if(this['agents'][_0x4b0535['channel']['split']('-')[0x0]]){this[_0x46f5('0x19')][_0x4b0535[_0x46f5('0x31')]][_0x46f5('0x5f')]=this[_0x46f5('0x1a')][_0x4b0535[_0x46f5('0x38')][_0x46f5('0x42')]('-')[0x0]]['id'];this[_0x46f5('0x19')][_0x4b0535[_0x46f5('0x31')]][_0x46f5('0x60')]=this[_0x46f5('0x1a')][_0x4b0535['channel'][_0x46f5('0x42')]('-')[0x0]][_0x46f5('0x46')];}}}}else{if(this[_0x46f5('0x19')][_0x4b0535[_0x46f5('0x33')]]){if(_0x4b0535[_0x46f5('0x3f')]==='6'){if(this['agents'][_0x4b0535[_0x46f5('0x38')][_0x46f5('0x42')]('-')[0x0]]){this[_0x46f5('0x19')][_0x4b0535[_0x46f5('0x33')]]['UserId']=this[_0x46f5('0x1a')][_0x4b0535['channel'][_0x46f5('0x42')]('-')[0x0]]['id'];this[_0x46f5('0x19')][_0x4b0535[_0x46f5('0x33')]][_0x46f5('0x60')]=this[_0x46f5('0x1a')][_0x4b0535[_0x46f5('0x38')][_0x46f5('0x42')]('-')[0x0]]['name'];}}}}}}catch(_0xe973dc){logger[_0x46f5('0x35')]('[syncNewState][VoiceCallReport]',util[_0x46f5('0x36')](_0xe973dc,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x46f5('0x2d')][_0x46f5('0x61')]=function(_0x4f780a,_0x3a2498){if(this[_0x46f5('0x19')][_0x4f780a]){this[_0x46f5('0x19')][_0x4f780a][_0x46f5('0x62')]=!![];if(_[_0x46f5('0x63')](_0x3a2498,_0x46f5('0x64'))){_0x3a2498=_0x3a2498[_0x46f5('0x65')](_0x46f5('0x64'),'.WAV');}this['channels'][_0x4f780a][_0x46f5('0x66')]=_0x3a2498;var _0x38b334=_[_0x46f5('0x67')](this[_0x46f5('0x19')][_0x4f780a][_0x46f5('0x68')],{'filename':_0x3a2498});if(_['isNil'](_0x38b334)){this['channels'][_0x4f780a][_0x46f5('0x68')]['push']({'filename':_0x3a2498,'createdAt':moment()['format'](_0x46f5('0x3c')),'mixmonitorid':'','status':_0x46f5('0x69')});}}};VoiceCallReport['prototype'][_0x46f5('0x20')]=function(_0x2d1814){try{if(this[_0x46f5('0x2e')](_0x2d1814)){if(this[_0x46f5('0x19')][_0x2d1814[_0x46f5('0x33')]]&&_0x2d1814[_0x46f5('0x38')]!='OutgoingSpoolFailed'){if(this['isNotNull'](_0x2d1814['variable'])){if(this[_0x46f5('0x2e')](_0x2d1814['variable']['mixmonitor_filename'])){this['syncMixMonitorFilename'](_0x2d1814[_0x46f5('0x33')],_0x2d1814[_0x46f5('0x6a')]);}else if(this[_0x46f5('0x2e')](_0x2d1814[_0x46f5('0x6b')]['xmd-phone'])){this[_0x46f5('0x19')][_0x2d1814['uniqueid']][_0x46f5('0x5a')]=_0x2d1814[_0x46f5('0x6a')];}else if(this[_0x46f5('0x2e')](_0x2d1814['variable'][_0x46f5('0x6c')])){this[_0x46f5('0x19')][_0x2d1814[_0x46f5('0x33')]]['callerid']=_0x2d1814[_0x46f5('0x6a')];}else if(this['isNotNull'](_0x2d1814[_0x46f5('0x6b')][_0x46f5('0x6d')])){this[_0x46f5('0x19')][_0x2d1814[_0x46f5('0x33')]][_0x46f5('0x6e')]=_0x2d1814[_0x46f5('0x6a')];}else if(this[_0x46f5('0x2e')](_0x2d1814[_0x46f5('0x6b')]['xmd-queue'])){this[_0x46f5('0x19')][_0x2d1814['uniqueid']]['queue']=_0x2d1814['value']['split'](',')[0x0];}else if(this[_0x46f5('0x2e')](_0x2d1814[_0x46f5('0x6b')][_0x46f5('0x6f')])){this[_0x46f5('0x19')][_0x2d1814[_0x46f5('0x33')]]['originatecalleridnum']=_0x2d1814['value'];}else if(this[_0x46f5('0x2e')](_0x2d1814[_0x46f5('0x6b')][_0x46f5('0x70')])){this[_0x46f5('0x19')][_0x2d1814[_0x46f5('0x33')]][_0x46f5('0x71')]=_0x2d1814[_0x46f5('0x6a')];}else if(this[_0x46f5('0x2e')](_0x2d1814[_0x46f5('0x6b')]['xmd-callerid-preview'])){this[_0x46f5('0x19')][_0x2d1814[_0x46f5('0x33')]][_0x46f5('0x72')]=_0x2d1814[_0x46f5('0x6a')];}else if(this[_0x46f5('0x2e')](_0x2d1814['variable']['xmcs-queue'])){this[_0x46f5('0x19')][_0x2d1814['uniqueid']][_0x46f5('0xf')]=_0x2d1814[_0x46f5('0x6a')];}else if(this[_0x46f5('0x2e')](_0x2d1814[_0x46f5('0x6b')]['sipcallid'])){this['channels'][_0x2d1814[_0x46f5('0x33')]][_0x46f5('0x73')]=_0x2d1814[_0x46f5('0x6a')];}}}else if(this[_0x46f5('0x2e')](_0x2d1814[_0x46f5('0x6b')][_0x46f5('0x74')])){if(_0x2d1814[_0x46f5('0x6a')]){var _0x37d336=path[_0x46f5('0x75')](_0x2d1814[_0x46f5('0x6a')])[_0x46f5('0x46')];this[_0x46f5('0x61')](_0x37d336,_0x2d1814[_0x46f5('0x6a')]);}}else if(this[_0x46f5('0x19')][_0x2d1814[_0x46f5('0x31')]]){if(this[_0x46f5('0x2e')](_0x2d1814[_0x46f5('0x6b')])){if(this[_0x46f5('0x2e')](_0x2d1814[_0x46f5('0x6b')][_0x46f5('0x76')])){this[_0x46f5('0x19')][_0x2d1814[_0x46f5('0x31')]][_0x46f5('0x77')]=_0x2d1814[_0x46f5('0x6a')];}}}}}catch(_0x463ff0){logger[_0x46f5('0x35')](_0x46f5('0x78'),util[_0x46f5('0x36')](_0x463ff0,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x46f5('0x22')]=function(_0x37fd92){try{if(this[_0x46f5('0x2e')](_0x37fd92)){if(this[_0x46f5('0x19')][_0x37fd92[_0x46f5('0x33')]]){var _0x53599c=moment();this[_0x46f5('0x19')][_0x37fd92[_0x46f5('0x33')]][_0x46f5('0x79')]=_0x53599c[_0x46f5('0x3b')](_0x46f5('0x3c'));this['channels'][_0x37fd92['uniqueid']][_0x46f5('0x4e')]=_0x53599c[_0x46f5('0x59')](this[_0x46f5('0x19')][_0x37fd92['uniqueid']][_0x46f5('0x3a')],'seconds');if(this[_0x46f5('0x19')][_0x37fd92[_0x46f5('0x33')]][_0x46f5('0x56')]){this[_0x46f5('0x19')][_0x37fd92[_0x46f5('0x33')]][_0x46f5('0x7a')]=_0x53599c[_0x46f5('0x59')](this[_0x46f5('0x19')][_0x37fd92[_0x46f5('0x33')]]['answertime'],_0x46f5('0x4f'));this[_0x46f5('0x19')][_0x37fd92[_0x46f5('0x33')]][_0x46f5('0x58')]=this[_0x46f5('0x19')][_0x37fd92['uniqueid']][_0x46f5('0x4e')]-this[_0x46f5('0x19')][_0x37fd92[_0x46f5('0x33')]]['billableseconds'];}if(_0x37fd92[_0x46f5('0x7b')]===_0x46f5('0x41')){if(this[_0x46f5('0x1a')][_0x37fd92[_0x46f5('0x38')][_0x46f5('0x42')]('-')[0x0]]){this[_0x46f5('0x1a')][_0x37fd92[_0x46f5('0x38')]['split']('-')[0x0]]=_[_0x46f5('0x7c')](this[_0x46f5('0x1a')][_0x37fd92['channel'][_0x46f5('0x42')]('-')[0x0]],[_0x46f5('0x43')]);this[_0x46f5('0x30')](util[_0x46f5('0x3b')](_0x46f5('0x45'),this['agents'][_0x37fd92[_0x46f5('0x38')][_0x46f5('0x42')]('-')[0x0]][_0x46f5('0x46')]),_0x46f5('0x7d'),{'destaccountcode':this[_0x46f5('0x1a')][_0x37fd92[_0x46f5('0x38')]['split']('-')[0x0]]['accountcode']});}}ami['emit']('custom:voiceCallReport',this['channels'][_0x37fd92[_0x46f5('0x33')]]);delete this[_0x46f5('0x19')][_0x37fd92[_0x46f5('0x33')]];}}}catch(_0x5a77ec){logger[_0x46f5('0x35')](_0x46f5('0x7e'),util['inspect'](_0x5a77ec,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x46f5('0x24')]=function(_0x561170){try{if(this[_0x46f5('0x2e')](_0x561170)){if(this['channels'][_0x561170[_0x46f5('0x7f')]]){this[_0x46f5('0x19')][_0x561170[_0x46f5('0x7f')]]['transfercalleridnum']=_0x561170[_0x46f5('0x80')];this[_0x46f5('0x19')][_0x561170[_0x46f5('0x7f')]]['transferconnectedlinenum']=_0x561170[_0x46f5('0x81')];if(this[_0x46f5('0x19')][_0x561170[_0x46f5('0x82')]]){var _0x1377c2=this['channels'][_0x561170[_0x46f5('0x82')]];this['channels'][_0x561170[_0x46f5('0x82')]]=this[_0x46f5('0x19')][_0x561170[_0x46f5('0x7f')]];this[_0x46f5('0x19')][_0x561170[_0x46f5('0x7f')]]=_0x1377c2;}}else if(this[_0x46f5('0x19')][_0x561170[_0x46f5('0x83')]]){this['channels'][_0x561170[_0x46f5('0x83')]][_0x46f5('0x84')]=_0x561170[_0x46f5('0x80')];this[_0x46f5('0x19')][_0x561170['transfertargetuniqueid']][_0x46f5('0x85')]=_0x561170[_0x46f5('0x81')];if(this[_0x46f5('0x19')][_0x561170[_0x46f5('0x86')]]){var _0x1377c2=this['channels'][_0x561170[_0x46f5('0x86')]];this['channels'][_0x561170['origtransfereruniqueid']]=this[_0x46f5('0x19')][_0x561170[_0x46f5('0x83')]];this['channels'][_0x561170[_0x46f5('0x83')]]=_0x1377c2;}}}}catch(_0x25527f){logger[_0x46f5('0x35')]('[syncAttendedTransfer][VoiceCallReport]',util[_0x46f5('0x36')](_0x25527f,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x46f5('0x25')]=function(_0x5e4f1e){try{if(this[_0x46f5('0x2e')](_0x5e4f1e)){if(this[_0x46f5('0x19')][_0x5e4f1e[_0x46f5('0x7f')]]){this['channels'][_0x5e4f1e['transfereeuniqueid']][_0x46f5('0x84')]=_0x5e4f1e[_0x46f5('0x87')];this['channels'][_0x5e4f1e[_0x46f5('0x7f')]][_0x46f5('0x85')]=_0x5e4f1e[_0x46f5('0x88')];this['syncHangup']({'event':_0x46f5('0x89'),'uniqueid':_0x5e4f1e[_0x46f5('0x7f')],'context':_0x5e4f1e['context'],'channel':_0x5e4f1e['transfererchannel']});}}}catch(_0x43a368){logger[_0x46f5('0x35')]('[syncBlindTransfer][VoiceCallReport]',util[_0x46f5('0x36')](_0x43a368,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x46f5('0x27')]=function(_0x51bc0f){try{if(this[_0x46f5('0x2e')](_0x51bc0f)){if(this[_0x46f5('0x19')][_0x51bc0f[_0x46f5('0x33')]]){if(!_[_0x46f5('0x8a')](this['channels'][_0x51bc0f[_0x46f5('0x33')]][_0x46f5('0x57')])){this[_0x46f5('0x19')][_0x51bc0f[_0x46f5('0x33')]][_0x46f5('0x8b')]=moment()[_0x46f5('0x3b')](_0x46f5('0x3c'));}}}}catch(_0x181b0c){logger['error']('[syncMusicOnHoldStart][VoiceCallReport]',util[_0x46f5('0x36')](_0x181b0c,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncMusicOnHoldStop']=function(_0x245013){try{if(this[_0x46f5('0x2e')](_0x245013)){if(this['channels'][_0x245013['uniqueid']]){if(!_[_0x46f5('0x8a')](this['channels'][_0x245013[_0x46f5('0x33')]][_0x46f5('0x8b')])){this[_0x46f5('0x19')][_0x245013[_0x46f5('0x33')]][_0x46f5('0x8c')]+=moment()[_0x46f5('0x8d')](0x0)[_0x46f5('0x59')](this[_0x46f5('0x19')][_0x245013[_0x46f5('0x33')]][_0x46f5('0x8b')],_0x46f5('0x4f'));delete this['channels'][_0x245013[_0x46f5('0x33')]]['mohstarttime'];}}}}catch(_0x121844){logger['error']('[syncMusicOnHoldStop][VoiceCallReport]',util[_0x46f5('0x36')](_0x121844,{'showHidden':![],'depth':null}));}};module[_0x46f5('0x8e')]=VoiceCallReport; \ No newline at end of file +var _0x20e7=['calleridname','destinationchannel','UserId','membername','name','syncMixMonitorFilename','endsWith','replace','.wav49','monitorFilename','find','monitors','rec','variable','mixmonitor_filename','value','xmd-phone','xmd-callerid','callerid','xmd-cdrtype','xmd-queue','xmd-originatecalleridnum','originatecalleridnum','xmd-destination','destination','xmd-callerid-preview','calleridpreview','xmcs-queue','sipcalluniqueid','sipcallid','sipcalllinkedid','[syncVarSet][VoiceCallReport]','endtime','billableseconds','omit','user:agentcomplete','custom:voiceCallReport','[syncHangup][VoiceCallReport]','transfereeuniqueid','transferconnectedlinenum','secondtransfereruniqueid','transfertargetuniqueid','transfercalleridnum','origtransferercalleridnum','transfertargetcalleridnum','origtransfereruniqueid','[syncAttendedTransfer][VoiceCallReport]','transfereecalleridnum','extension','syncHangup','BlindTransfer','transfererchannel','[syncBlindTransfer][VoiceCallReport]','mohstarttime','syncMusicOnHoldStop','isNil','mohtime','milliseconds','[syncMusicOnHoldStop][VoiceCallReport]','exports','bluebird','lodash','util','path','../../../config/environment','../../../config/logger','ami','../ami','../model/channel','not_inuse','inuse','busy','invalid','unavailable','ringing','onhold','set','queue','agi','dial','playback','voicemail','NO\x20ANSWER','FAILED','ANSWERED','BUSY','defaults','localhost','socket.io-emitter','redis','channels','agents','syncNewExten','newchannel','syncNewChannel','newstate','syncNewState','bind','varset','syncVarSet','hangup','syncNewCallerId','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','then','catch','log','prototype','isNotNull','isUndefined','emit','uniqueid','linkedid','pick','keys','[syncNewCallerId][VoiceCallReport]','inspect','channel','OutgoingSpoolFailed','starttime','format','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','channelstate','merge','context','from-sip','split','destconnectedlinenum','user:%s','user:agentconnect','accountcode','exten','application','toLowerCase','applicationdata','appdata','duration','seconds','includes','lastapplication','lastdata','startsWith','cdr(','match','error','[syncNewExten][VoiceCallReport]','answered','answertime','holdtime','diff','calleridnum','connectedlinenum'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x20e7,0x178));var _0x720e=function(_0xf550d5,_0x2ab37f){_0xf550d5=_0xf550d5-0x0;var _0x545699=_0x20e7[_0xf550d5];return _0x545699;};'use strict';var BPromise=require(_0x720e('0x0'));var _=require(_0x720e('0x1'));var moment=require('moment');var util=require(_0x720e('0x2'));var path=require(_0x720e('0x3'));var Redis=require('ioredis');var config=require(_0x720e('0x4'));var logger=require(_0x720e('0x5'))(_0x720e('0x6'));var ami=require(_0x720e('0x7'));var Channel=require(_0x720e('0x8'));var statusDesc=['unknown',_0x720e('0x9'),_0x720e('0xa'),_0x720e('0xb'),_0x720e('0xc'),_0x720e('0xd'),_0x720e('0xe'),'ringinuse',_0x720e('0xf')];var applications=[_0x720e('0x10'),_0x720e('0x11'),_0x720e('0x12'),_0x720e('0x13'),_0x720e('0x14'),_0x720e('0x15')];var dispositions=[_0x720e('0x16'),_0x720e('0x17'),_0x720e('0x17'),_0x720e('0x16'),_0x720e('0x16'),_0x720e('0x16'),_0x720e('0x18'),_0x720e('0x19'),'FAILED',_0x720e('0x17'),_0x720e('0x17')];var actions={};config['redis']=_[_0x720e('0x1a')](config['redis'],{'host':_0x720e('0x1b'),'port':0x18eb});var io=require(_0x720e('0x1c'))(new Redis(config[_0x720e('0x1d')]));function VoiceCallReport(_0x154032){this[_0x720e('0x1e')]=_0x154032[_0x720e('0x1e')];this[_0x720e('0x1f')]=_0x154032['agents'];ami['on']('coreshowchannel',this[_0x720e('0x20')]['bind'](this));ami['on']('newexten',this[_0x720e('0x20')]['bind'](this));ami['on'](_0x720e('0x21'),this[_0x720e('0x22')]['bind'](this));ami['on'](_0x720e('0x23'),this[_0x720e('0x24')][_0x720e('0x25')](this));ami['on'](_0x720e('0x26'),this[_0x720e('0x27')][_0x720e('0x25')](this));ami['on'](_0x720e('0x28'),this['syncHangup'][_0x720e('0x25')](this));ami['on']('newcallerid',this[_0x720e('0x29')]['bind'](this));ami['on'](_0x720e('0x2a'),this[_0x720e('0x2b')][_0x720e('0x25')](this));ami['on'](_0x720e('0x2c'),this[_0x720e('0x2d')]['bind'](this));ami['on'](_0x720e('0x2e'),this[_0x720e('0x2f')][_0x720e('0x25')](this));ami['on']('musiconholdstop',this['syncMusicOnHoldStop'][_0x720e('0x25')](this));return BPromise['resolve']()[_0x720e('0x30')](ami['actionCoreShowChannels']())[_0x720e('0x31')](function(_0x36879f){console[_0x720e('0x32')](_0x36879f);});}VoiceCallReport[_0x720e('0x33')][_0x720e('0x34')]=function(_0x2c57fe){return _0x2c57fe!==null&&!_[_0x720e('0x35')](_0x2c57fe);};VoiceCallReport['prototype'][_0x720e('0x36')]=function(_0x296000,_0x431281,_0x320b69){io['to'](_0x296000)['emit'](_0x431281,_0x320b69);};VoiceCallReport[_0x720e('0x33')][_0x720e('0x29')]=function(_0x3eb85c){try{if(this[_0x720e('0x34')](_0x3eb85c)){if(_0x3eb85c[_0x720e('0x37')]===_0x3eb85c[_0x720e('0x38')]){if(!_[_0x720e('0x35')](this['channels'][_0x3eb85c[_0x720e('0x37')]])){_['merge'](this[_0x720e('0x1e')][_0x3eb85c[_0x720e('0x37')]],_[_0x720e('0x39')](_0x3eb85c,_[_0x720e('0x3a')](this[_0x720e('0x1e')][_0x3eb85c[_0x720e('0x37')]])));}}}}catch(_0x346d7e){logger['error'](_0x720e('0x3b'),util[_0x720e('0x3c')](_0x346d7e,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x720e('0x33')][_0x720e('0x22')]=function(_0x31d2c0){try{if(this['isNotNull'](_0x31d2c0)){if(_0x31d2c0['uniqueid']===_0x31d2c0[_0x720e('0x38')]&&_0x31d2c0[_0x720e('0x3d')]!=_0x720e('0x3e')){if(_[_0x720e('0x35')](this[_0x720e('0x1e')][_0x31d2c0[_0x720e('0x37')]])){this[_0x720e('0x1e')][_0x31d2c0[_0x720e('0x37')]]=new Channel();this[_0x720e('0x1e')][_0x31d2c0['uniqueid']][_0x720e('0x3f')]=moment()[_0x720e('0x40')](_0x720e('0x41'));this[_0x720e('0x1e')][_0x31d2c0[_0x720e('0x37')]][_0x720e('0x42')]=dispositions[_[_0x720e('0x43')](_0x31d2c0[_0x720e('0x44')])];_[_0x720e('0x45')](this[_0x720e('0x1e')][_0x31d2c0[_0x720e('0x37')]],_[_0x720e('0x39')](_0x31d2c0,_[_0x720e('0x3a')](this[_0x720e('0x1e')][_0x31d2c0[_0x720e('0x37')]])));if(_0x31d2c0[_0x720e('0x46')]===_0x720e('0x47')){if(this[_0x720e('0x1f')][_0x31d2c0['channel']['split']('-')[0x0]]){this[_0x720e('0x1f')][_0x31d2c0['channel'][_0x720e('0x48')]('-')[0x0]][_0x720e('0x49')]=_0x31d2c0['exten'];this[_0x720e('0x36')](util[_0x720e('0x40')](_0x720e('0x4a'),this[_0x720e('0x1f')][_0x31d2c0[_0x720e('0x3d')][_0x720e('0x48')]('-')[0x0]]['name']),_0x720e('0x4b'),{'destaccountcode':this[_0x720e('0x1f')][_0x31d2c0[_0x720e('0x3d')][_0x720e('0x48')]('-')[0x0]][_0x720e('0x4c')],'destconnectedlinenum':_0x31d2c0[_0x720e('0x4d')]});}}}}}}catch(_0x23dccb){logger['error']('[syncNewChannel][VoiceCallReport]',util[_0x720e('0x3c')](_0x23dccb,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x720e('0x20')]=function(_0xec2397){try{if(this[_0x720e('0x34')](_0xec2397)){if(_0xec2397[_0x720e('0x37')]===_0xec2397[_0x720e('0x38')]&&_0xec2397[_0x720e('0x4d')]!='h'&&_0xec2397[_0x720e('0x3d')]!='OutgoingSpoolFailed'){_0xec2397[_0x720e('0x4e')]=_0xec2397['application'][_0x720e('0x4f')]();_0xec2397[_0x720e('0x50')]=(_0xec2397[_0x720e('0x51')]||_0xec2397[_0x720e('0x50')])['toLowerCase']();if(_['isUndefined'](this[_0x720e('0x1e')][_0xec2397[_0x720e('0x37')]])){this[_0x720e('0x1e')][_0xec2397[_0x720e('0x37')]]=new Channel();this[_0x720e('0x1e')][_0xec2397['uniqueid']][_0x720e('0x3f')]=_0xec2397['duration']?moment()['subtract'](moment[_0x720e('0x52')](_0xec2397[_0x720e('0x52')])[_0x720e('0x53')](),_0x720e('0x53'))[_0x720e('0x40')](_0x720e('0x41')):moment()[_0x720e('0x40')](_0x720e('0x41'));this[_0x720e('0x1e')][_0xec2397[_0x720e('0x37')]][_0x720e('0x42')]=_0x720e('0x16');}_['merge'](this[_0x720e('0x1e')][_0xec2397[_0x720e('0x37')]],_[_0x720e('0x39')](_0xec2397,_[_0x720e('0x3a')](this['channels'][_0xec2397[_0x720e('0x37')]])));if(_[_0x720e('0x54')](applications,_0xec2397[_0x720e('0x4e')])){this[_0x720e('0x1e')][_0xec2397[_0x720e('0x37')]][_0x720e('0x55')]=_0xec2397[_0x720e('0x4e')];this[_0x720e('0x1e')][_0xec2397['uniqueid']][_0x720e('0x56')]=_0xec2397[_0x720e('0x50')];if(_0xec2397['application']==='set'&&_[_0x720e('0x57')](_0xec2397[_0x720e('0x50')],_0x720e('0x58'))){var _0x2e7dfc=_0xec2397[_0x720e('0x50')][_0x720e('0x48')]('=');var _0x54aa85=_0x2e7dfc[0x0][_0x720e('0x59')](/cdr\((.*)\)/);if(_0x54aa85){this['channels'][_0xec2397[_0x720e('0x37')]][_0x54aa85[0x1]]=_0x2e7dfc[0x1];}}else if(_0xec2397[_0x720e('0x4e')]===_0x720e('0x11')){this[_0x720e('0x1e')][_0xec2397[_0x720e('0x37')]][_0x720e('0x11')]=_0xec2397[_0x720e('0x50')]['split'](',')[0x0];}}}}}catch(_0x339e78){logger[_0x720e('0x5a')](_0x720e('0x5b'),util['inspect'](_0x339e78,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x720e('0x33')]['syncNewState']=function(_0x32d276){try{if(this[_0x720e('0x34')](_0x32d276)){if(_0x32d276['uniqueid']!==_0x32d276[_0x720e('0x38')]){if(this['channels'][_0x32d276['linkedid']]){if(_0x32d276['channelstate']==='6'){if(!this['channels'][_0x32d276[_0x720e('0x38')]][_0x720e('0x5c')]){var _0x5aef52=moment();this['channels'][_0x32d276[_0x720e('0x38')]][_0x720e('0x5c')]=!![];this['channels'][_0x32d276['linkedid']][_0x720e('0x5d')]=_0x5aef52[_0x720e('0x40')](_0x720e('0x41'));if(this[_0x720e('0x1e')][_0x32d276['linkedid']][_0x720e('0x3f')]){this[_0x720e('0x1e')][_0x32d276['linkedid']][_0x720e('0x5e')]=_0x5aef52[_0x720e('0x5f')](this[_0x720e('0x1e')][_0x32d276[_0x720e('0x38')]][_0x720e('0x3f')],'seconds');}}this[_0x720e('0x1e')][_0x32d276[_0x720e('0x38')]][_0x720e('0x38')]=_0x32d276[_0x720e('0x37')];if(_0x32d276[_0x720e('0x60')]!=='xcally-motion-preview'){this[_0x720e('0x1e')][_0x32d276[_0x720e('0x38')]][_0x720e('0x61')]=_0x32d276[_0x720e('0x60')];}this[_0x720e('0x1e')][_0x32d276[_0x720e('0x38')]]['connectedlinename']=_0x32d276[_0x720e('0x62')];this[_0x720e('0x1e')][_0x32d276[_0x720e('0x38')]][_0x720e('0x63')]=_0x32d276['channel'];this[_0x720e('0x1e')][_0x32d276[_0x720e('0x38')]][_0x720e('0x42')]=dispositions[_[_0x720e('0x43')](_0x32d276[_0x720e('0x44')])];if(this[_0x720e('0x1f')][_0x32d276[_0x720e('0x3d')][_0x720e('0x48')]('-')[0x0]]){this['channels'][_0x32d276['linkedid']][_0x720e('0x64')]=this['agents'][_0x32d276[_0x720e('0x3d')][_0x720e('0x48')]('-')[0x0]]['id'];this[_0x720e('0x1e')][_0x32d276[_0x720e('0x38')]]['membername']=this[_0x720e('0x1f')][_0x32d276[_0x720e('0x3d')][_0x720e('0x48')]('-')[0x0]]['name'];}}}}else{if(this[_0x720e('0x1e')][_0x32d276[_0x720e('0x37')]]){if(_0x32d276[_0x720e('0x44')]==='6'){if(this[_0x720e('0x1f')][_0x32d276['channel'][_0x720e('0x48')]('-')[0x0]]){this['channels'][_0x32d276['uniqueid']][_0x720e('0x64')]=this[_0x720e('0x1f')][_0x32d276[_0x720e('0x3d')][_0x720e('0x48')]('-')[0x0]]['id'];this['channels'][_0x32d276[_0x720e('0x37')]][_0x720e('0x65')]=this[_0x720e('0x1f')][_0x32d276['channel'][_0x720e('0x48')]('-')[0x0]][_0x720e('0x66')];}}}}}}catch(_0x4914d9){logger[_0x720e('0x5a')]('[syncNewState][VoiceCallReport]',util['inspect'](_0x4914d9,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x720e('0x33')][_0x720e('0x67')]=function(_0x5dfce1,_0x182ea6){if(this[_0x720e('0x1e')][_0x5dfce1]){this[_0x720e('0x1e')][_0x5dfce1]['monitor']=!![];if(_[_0x720e('0x68')](_0x182ea6,'.wav49')){_0x182ea6=_0x182ea6[_0x720e('0x69')](_0x720e('0x6a'),'.WAV');}this[_0x720e('0x1e')][_0x5dfce1][_0x720e('0x6b')]=_0x182ea6;var _0x399d81=_[_0x720e('0x6c')](this['channels'][_0x5dfce1][_0x720e('0x6d')],{'filename':_0x182ea6});if(_['isNil'](_0x399d81)){this[_0x720e('0x1e')][_0x5dfce1][_0x720e('0x6d')]['push']({'filename':_0x182ea6,'createdAt':moment()[_0x720e('0x40')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':'','status':_0x720e('0x6e')});}}};VoiceCallReport[_0x720e('0x33')][_0x720e('0x27')]=function(_0x48b946){try{if(this[_0x720e('0x34')](_0x48b946)){if(this[_0x720e('0x1e')][_0x48b946[_0x720e('0x37')]]&&_0x48b946[_0x720e('0x3d')]!=_0x720e('0x3e')){if(this[_0x720e('0x34')](_0x48b946['variable'])){if(this[_0x720e('0x34')](_0x48b946[_0x720e('0x6f')][_0x720e('0x70')])){this[_0x720e('0x67')](_0x48b946[_0x720e('0x37')],_0x48b946[_0x720e('0x71')]);}else if(this[_0x720e('0x34')](_0x48b946[_0x720e('0x6f')][_0x720e('0x72')])){this[_0x720e('0x1e')][_0x48b946['uniqueid']][_0x720e('0x60')]=_0x48b946[_0x720e('0x71')];}else if(this[_0x720e('0x34')](_0x48b946[_0x720e('0x6f')][_0x720e('0x73')])){this[_0x720e('0x1e')][_0x48b946[_0x720e('0x37')]][_0x720e('0x74')]=_0x48b946['value'];}else if(this[_0x720e('0x34')](_0x48b946[_0x720e('0x6f')][_0x720e('0x75')])){this[_0x720e('0x1e')][_0x48b946[_0x720e('0x37')]]['type']=_0x48b946[_0x720e('0x71')];}else if(this[_0x720e('0x34')](_0x48b946[_0x720e('0x6f')][_0x720e('0x76')])){this[_0x720e('0x1e')][_0x48b946['uniqueid']]['queue']=_0x48b946[_0x720e('0x71')][_0x720e('0x48')](',')[0x0];}else if(this[_0x720e('0x34')](_0x48b946[_0x720e('0x6f')][_0x720e('0x77')])){this['channels'][_0x48b946[_0x720e('0x37')]][_0x720e('0x78')]=_0x48b946[_0x720e('0x71')];}else if(this['isNotNull'](_0x48b946[_0x720e('0x6f')][_0x720e('0x79')])){this[_0x720e('0x1e')][_0x48b946[_0x720e('0x37')]][_0x720e('0x7a')]=_0x48b946[_0x720e('0x71')];}else if(this['isNotNull'](_0x48b946['variable'][_0x720e('0x7b')])){this[_0x720e('0x1e')][_0x48b946[_0x720e('0x37')]][_0x720e('0x7c')]=_0x48b946['value'];}else if(this[_0x720e('0x34')](_0x48b946['variable'][_0x720e('0x7d')])){this[_0x720e('0x1e')][_0x48b946['uniqueid']][_0x720e('0x11')]=_0x48b946[_0x720e('0x71')];}else if(this[_0x720e('0x34')](_0x48b946[_0x720e('0x6f')]['sipcallid'])){this['channels'][_0x48b946[_0x720e('0x37')]][_0x720e('0x7e')]=_0x48b946[_0x720e('0x71')];}}}else if(this[_0x720e('0x34')](_0x48b946[_0x720e('0x6f')][_0x720e('0x70')])){if(_0x48b946[_0x720e('0x71')]){var _0x42a1f6=path['parse'](_0x48b946[_0x720e('0x71')])[_0x720e('0x66')];this['syncMixMonitorFilename'](_0x42a1f6,_0x48b946['value']);}}else if(this[_0x720e('0x1e')][_0x48b946[_0x720e('0x38')]]){if(this['isNotNull'](_0x48b946[_0x720e('0x6f')])){if(this[_0x720e('0x34')](_0x48b946[_0x720e('0x6f')][_0x720e('0x7f')])){this[_0x720e('0x1e')][_0x48b946[_0x720e('0x38')]][_0x720e('0x80')]=_0x48b946['value'];}}}}}catch(_0x5e91d1){logger[_0x720e('0x5a')](_0x720e('0x81'),util['inspect'](_0x5e91d1,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncHangup']=function(_0x26c931){try{if(this[_0x720e('0x34')](_0x26c931)){if(this[_0x720e('0x1e')][_0x26c931[_0x720e('0x37')]]){var _0xbd5a9f=moment();this[_0x720e('0x1e')][_0x26c931['uniqueid']][_0x720e('0x82')]=_0xbd5a9f[_0x720e('0x40')](_0x720e('0x41'));this['channels'][_0x26c931[_0x720e('0x37')]][_0x720e('0x52')]=_0xbd5a9f['diff'](this[_0x720e('0x1e')][_0x26c931[_0x720e('0x37')]][_0x720e('0x3f')],_0x720e('0x53'));if(this[_0x720e('0x1e')][_0x26c931['uniqueid']]['answered']){this[_0x720e('0x1e')][_0x26c931[_0x720e('0x37')]]['billableseconds']=_0xbd5a9f[_0x720e('0x5f')](this[_0x720e('0x1e')][_0x26c931['uniqueid']][_0x720e('0x5d')],_0x720e('0x53'));this[_0x720e('0x1e')][_0x26c931[_0x720e('0x37')]]['holdtime']=this['channels'][_0x26c931[_0x720e('0x37')]][_0x720e('0x52')]-this['channels'][_0x26c931[_0x720e('0x37')]][_0x720e('0x83')];}if(_0x26c931[_0x720e('0x46')]===_0x720e('0x47')){if(this['agents'][_0x26c931[_0x720e('0x3d')][_0x720e('0x48')]('-')[0x0]]){this[_0x720e('0x1f')][_0x26c931[_0x720e('0x3d')][_0x720e('0x48')]('-')[0x0]]=_[_0x720e('0x84')](this[_0x720e('0x1f')][_0x26c931[_0x720e('0x3d')][_0x720e('0x48')]('-')[0x0]],['destconnectedlinenum']);this[_0x720e('0x36')](util['format'](_0x720e('0x4a'),this[_0x720e('0x1f')][_0x26c931[_0x720e('0x3d')][_0x720e('0x48')]('-')[0x0]][_0x720e('0x66')]),_0x720e('0x85'),{'destaccountcode':this[_0x720e('0x1f')][_0x26c931[_0x720e('0x3d')][_0x720e('0x48')]('-')[0x0]][_0x720e('0x4c')]});}}ami[_0x720e('0x36')](_0x720e('0x86'),this[_0x720e('0x1e')][_0x26c931[_0x720e('0x37')]]);delete this['channels'][_0x26c931[_0x720e('0x37')]];}}}catch(_0x2a3041){logger[_0x720e('0x5a')](_0x720e('0x87'),util[_0x720e('0x3c')](_0x2a3041,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x720e('0x33')][_0x720e('0x2b')]=function(_0x3393f0){try{if(this[_0x720e('0x34')](_0x3393f0)){if(this['channels'][_0x3393f0[_0x720e('0x88')]]){this[_0x720e('0x1e')][_0x3393f0[_0x720e('0x88')]]['transfercalleridnum']=_0x3393f0['origtransferercalleridnum'];this[_0x720e('0x1e')][_0x3393f0[_0x720e('0x88')]][_0x720e('0x89')]=_0x3393f0['transfertargetcalleridnum'];if(this[_0x720e('0x1e')][_0x3393f0[_0x720e('0x8a')]]){var _0xe8d1f5=this['channels'][_0x3393f0[_0x720e('0x8a')]];this[_0x720e('0x1e')][_0x3393f0[_0x720e('0x8a')]]=this['channels'][_0x3393f0[_0x720e('0x88')]];this[_0x720e('0x1e')][_0x3393f0[_0x720e('0x88')]]=_0xe8d1f5;}}else if(this[_0x720e('0x1e')][_0x3393f0['transfertargetuniqueid']]){this[_0x720e('0x1e')][_0x3393f0[_0x720e('0x8b')]][_0x720e('0x8c')]=_0x3393f0[_0x720e('0x8d')];this[_0x720e('0x1e')][_0x3393f0[_0x720e('0x8b')]][_0x720e('0x89')]=_0x3393f0[_0x720e('0x8e')];if(this[_0x720e('0x1e')][_0x3393f0[_0x720e('0x8f')]]){var _0xe8d1f5=this[_0x720e('0x1e')][_0x3393f0[_0x720e('0x8f')]];this['channels'][_0x3393f0[_0x720e('0x8f')]]=this[_0x720e('0x1e')][_0x3393f0[_0x720e('0x8b')]];this['channels'][_0x3393f0['transfertargetuniqueid']]=_0xe8d1f5;}}}}catch(_0x4a2d2b){logger['error'](_0x720e('0x90'),util[_0x720e('0x3c')](_0x4a2d2b,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x720e('0x33')][_0x720e('0x2d')]=function(_0x23c3b2){try{if(this[_0x720e('0x34')](_0x23c3b2)){if(this['channels'][_0x23c3b2[_0x720e('0x88')]]){this[_0x720e('0x1e')][_0x23c3b2[_0x720e('0x88')]][_0x720e('0x8c')]=_0x23c3b2[_0x720e('0x91')];this[_0x720e('0x1e')][_0x23c3b2[_0x720e('0x88')]][_0x720e('0x89')]=_0x23c3b2[_0x720e('0x92')];this[_0x720e('0x93')]({'event':_0x720e('0x94'),'uniqueid':_0x23c3b2[_0x720e('0x88')],'context':_0x23c3b2['context'],'channel':_0x23c3b2[_0x720e('0x95')]});}}}catch(_0x8afb1){logger[_0x720e('0x5a')](_0x720e('0x96'),util[_0x720e('0x3c')](_0x8afb1,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x720e('0x33')][_0x720e('0x2f')]=function(_0x24a0ec){try{if(this[_0x720e('0x34')](_0x24a0ec)){if(this[_0x720e('0x1e')][_0x24a0ec[_0x720e('0x37')]]){if(!_['isNil'](this['channels'][_0x24a0ec['uniqueid']][_0x720e('0x5d')])){this[_0x720e('0x1e')][_0x24a0ec[_0x720e('0x37')]][_0x720e('0x97')]=moment()['format'](_0x720e('0x41'));}}}}catch(_0x24aefa){logger[_0x720e('0x5a')]('[syncMusicOnHoldStart][VoiceCallReport]',util[_0x720e('0x3c')](_0x24aefa,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x720e('0x33')][_0x720e('0x98')]=function(_0x18d205){try{if(this['isNotNull'](_0x18d205)){if(this[_0x720e('0x1e')][_0x18d205['uniqueid']]){if(!_[_0x720e('0x99')](this[_0x720e('0x1e')][_0x18d205[_0x720e('0x37')]][_0x720e('0x97')])){this['channels'][_0x18d205[_0x720e('0x37')]][_0x720e('0x9a')]+=moment()[_0x720e('0x9b')](0x0)[_0x720e('0x5f')](this[_0x720e('0x1e')][_0x18d205[_0x720e('0x37')]][_0x720e('0x97')],'seconds');delete this[_0x720e('0x1e')][_0x18d205['uniqueid']][_0x720e('0x97')];}}}}catch(_0x3f86d6){logger[_0x720e('0x5a')](_0x720e('0x9c'),util[_0x720e('0x3c')](_0x3f86d6,{'showHidden':![],'depth':null}));}};module[_0x720e('0x9d')]=VoiceCallReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceDialReport.js b/server/services/ami/report/voiceDialReport.js index afd3f99..dc929b5 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 _0x6709=['rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberlastcall','membername','memberpenalty','memberrealtime','isNil','includes','endtime','duration','starttime','lastevent','complete','total','answertime','answered','holdtime','seconds','billableseconds','diff','sumHoldTime','sumDuration','custom:voiceDialReport','custom:dialend','voice_outbound:save','info','stringify','[syncHangup][VoiceDialReport]','exports','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','defaults','redis','localhost','socket.io-emitter','channels','outboundChannels','outbound','variables','dialbegin','bind','syncDialEnd','varset','hangup','syncHangup','prototype','isNotNull','emit','syncDialBegin','uniqueid','merge','format','YYYY-MM-DD\x20HH:mm:ss','called','channel','substring','lastIndexOf','omit','event','voice:outbound','custom:dialbegin','dialstatus','ANSWER','connectedlinenum','connectedlinename','connect','voice_outbound_channel:save','error','inspect','addVariable','keys','variable','isUndefined','value','[syncVarSet][VoiceDialReport]','rtpaudioqos','rtpaudioqosjitterbridged'];(function(_0x9d461e,_0x55f1b8){var _0x5ee9cd=function(_0x3554f6){while(--_0x3554f6){_0x9d461e['push'](_0x9d461e['shift']());}};_0x5ee9cd(++_0x55f1b8);}(_0x6709,0x12f));var _0x9670=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x6709[_0x5d2803];return _0xdcad2c;};'use strict';var _=require('lodash');var moment=require(_0x9670('0x0'));var util=require(_0x9670('0x1'));var Redis=require(_0x9670('0x2'));var config=require(_0x9670('0x3'));var logger=require(_0x9670('0x4'))(_0x9670('0x5'));var ami=require(_0x9670('0x6'));config['redis']=_[_0x9670('0x7')](config[_0x9670('0x8')],{'host':_0x9670('0x9'),'port':0x18eb});var io=require(_0x9670('0xa'))(new Redis(config[_0x9670('0x8')]));function VoiceDialReport(_0x1832f1){this[_0x9670('0xb')]=_0x1832f1[_0x9670('0xc')];this['outbound']=_0x1832f1[_0x9670('0xd')];this[_0x9670('0xe')]={};ami['on'](_0x9670('0xf'),this['syncDialBegin'][_0x9670('0x10')](this));ami['on']('dialend',this[_0x9670('0x11')]['bind'](this));ami['on'](_0x9670('0x12'),this['syncVarSet']['bind'](this));ami['on'](_0x9670('0x13'),this[_0x9670('0x14')][_0x9670('0x10')](this));}VoiceDialReport[_0x9670('0x15')][_0x9670('0x16')]=function(_0x3cd232){return _0x3cd232!==null&&!_['isUndefined'](_0x3cd232);};VoiceDialReport['prototype'][_0x9670('0x17')]=function(_0x3323ef,_0x1ddf10,_0x17b703){io['to'](_0x3323ef)[_0x9670('0x17')](_0x1ddf10,_0x17b703);};VoiceDialReport[_0x9670('0x15')][_0x9670('0x18')]=function(_0x55da91){try{if(this['isNotNull'](_0x55da91)){if(this[_0x9670('0xb')][_0x55da91[_0x9670('0x19')]]){_[_0x9670('0x1a')](this[_0x9670('0xb')][_0x55da91[_0x9670('0x19')]],{'starttime':moment()[_0x9670('0x1b')](_0x9670('0x1c')),'lastevent':_0x9670('0x1d'),'interface':_0x55da91[_0x9670('0x1e')][_0x9670('0x1f')](0x0,_0x55da91['channel'][_0x9670('0x20')]('-')),'membername':_0x55da91['channel']['substring'](_0x55da91[_0x9670('0x1e')][_0x9670('0x20')]('/')+0x1,_0x55da91['channel']['lastIndexOf']('-'))},_[_0x9670('0x21')](_0x55da91,[_0x9670('0x22'),'privilege']));this[_0x9670('0x17')](_0x9670('0x23'),'voice_outbound_channel:save',this[_0x9670('0xb')][_0x55da91[_0x9670('0x19')]]);ami[_0x9670('0x17')](_0x9670('0x24'),this['channels'][_0x55da91[_0x9670('0x19')]]);}}}catch(_0x314f07){logger['error']('[syncDialBegin][VoiceDialReport]',util['inspect'](_0x314f07,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x9670('0x15')][_0x9670('0x11')]=function(_0x6a8cc7){try{if(this[_0x9670('0x16')](_0x6a8cc7)){if(this[_0x9670('0xb')][_0x6a8cc7['uniqueid']]){this['channels'][_0x6a8cc7[_0x9670('0x19')]]['dialstatus']=_0x6a8cc7['dialstatus'];if(_0x6a8cc7[_0x9670('0x25')]===_0x9670('0x26')){this[_0x9670('0xb')][_0x6a8cc7[_0x9670('0x19')]][_0x9670('0x27')]=_0x6a8cc7[_0x9670('0x27')];this[_0x9670('0xb')][_0x6a8cc7[_0x9670('0x19')]][_0x9670('0x28')]=_0x6a8cc7[_0x9670('0x28')];this[_0x9670('0xb')][_0x6a8cc7[_0x9670('0x19')]]['answertime']=moment()['format'](_0x9670('0x1c'));this['channels'][_0x6a8cc7[_0x9670('0x19')]]['lastevent']=_0x9670('0x29');ami[_0x9670('0x17')]('custom:dialconnect',this[_0x9670('0xb')][_0x6a8cc7['uniqueid']]);}this[_0x9670('0x17')](_0x9670('0x23'),_0x9670('0x2a'),this[_0x9670('0xb')][_0x6a8cc7[_0x9670('0x19')]]);}}}catch(_0x44652d){logger[_0x9670('0x2b')]('[syncDialEnd][VoiceDialReport]',util[_0x9670('0x2c')](_0x44652d,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype']['syncVarSet']=function(_0x4ac23e){try{if(this[_0x9670('0x16')](_0x4ac23e)){this[_0x9670('0x2d')](_0x4ac23e[_0x9670('0x19')],_[_0x9670('0x2e')](_0x4ac23e[_0x9670('0x2f')])[0x0],_0x4ac23e['value']);if(this[_0x9670('0x16')](_0x4ac23e['variable'])&&this[_0x9670('0x16')](_0x4ac23e['variable']['outboundrouteid'])){if(_[_0x9670('0x30')](this[_0x9670('0xb')][_0x4ac23e[_0x9670('0x19')]])){this['channels'][_0x4ac23e[_0x9670('0x19')]]={'routeId':_0x4ac23e[_0x9670('0x31')],'variables':this[_0x9670('0xe')][_0x4ac23e[_0x9670('0x19')]]};this[_0x9670('0x17')](_0x9670('0x23'),_0x9670('0x2a'),this[_0x9670('0xb')][_0x4ac23e['uniqueid']]);}}}}catch(_0x328216){logger[_0x9670('0x2b')](_0x9670('0x32'),util[_0x9670('0x2c')](_0x328216,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x9670('0x15')]['addVariable']=function(_0x30de56,_0x1a6374,_0x22f039){var _0x5f3a45=[_0x9670('0x33'),'rtpaudioqosbridged','rtpaudioqosjitter',_0x9670('0x34'),'rtpaudioqosloss',_0x9670('0x35'),_0x9670('0x36'),_0x9670('0x37'),_0x9670('0x38'),_0x9670('0x39'),_0x9670('0x3a'),_0x9670('0x3b'),_0x9670('0x3c'),_0x9670('0x3d'),'memberinterface',_0x9670('0x3e'),_0x9670('0x3f'),_0x9670('0x40'),_0x9670('0x41')];if(!_[_0x9670('0x42')](_0x1a6374)&&!_[_0x9670('0x43')](_0x5f3a45,_0x1a6374)){if(_[_0x9670('0x30')](this[_0x9670('0xe')][_0x30de56])){this[_0x9670('0xe')][_0x30de56]={};}this[_0x9670('0xe')][_0x30de56][_0x1a6374]=_0x22f039;}};VoiceDialReport[_0x9670('0x15')][_0x9670('0x14')]=function(_0x5a15ff){try{if(this[_0x9670('0x16')](_0x5a15ff)){if(this[_0x9670('0xb')][_0x5a15ff[_0x9670('0x19')]]){this[_0x9670('0xb')][_0x5a15ff['uniqueid']][_0x9670('0x44')]=moment()[_0x9670('0x1b')](_0x9670('0x1c'));this[_0x9670('0xb')][_0x5a15ff[_0x9670('0x19')]][_0x9670('0x45')]=moment(this[_0x9670('0xb')][_0x5a15ff[_0x9670('0x19')]][_0x9670('0x44')])['diff'](this[_0x9670('0xb')][_0x5a15ff[_0x9670('0x19')]][_0x9670('0x46')],'seconds');this[_0x9670('0xb')][_0x5a15ff['uniqueid']][_0x9670('0x47')]=_0x9670('0x48');this[_0x9670('0xd')][_0x9670('0x49')]+=0x1;if(this[_0x9670('0xb')][_0x5a15ff[_0x9670('0x19')]][_0x9670('0x4a')]){this['outbound'][_0x9670('0x4b')]+=0x1;this[_0x9670('0xb')][_0x5a15ff[_0x9670('0x19')]][_0x9670('0x4c')]=moment(this[_0x9670('0xb')][_0x5a15ff[_0x9670('0x19')]][_0x9670('0x4a')])['diff'](this[_0x9670('0xb')][_0x5a15ff[_0x9670('0x19')]][_0x9670('0x46')],_0x9670('0x4d'));this['channels'][_0x5a15ff['uniqueid']][_0x9670('0x4e')]=moment(this[_0x9670('0xb')][_0x5a15ff[_0x9670('0x19')]][_0x9670('0x44')])[_0x9670('0x4f')](this['channels'][_0x5a15ff[_0x9670('0x19')]]['answertime'],_0x9670('0x4d'));this[_0x9670('0xd')][_0x9670('0x50')]+=this[_0x9670('0xb')][_0x5a15ff['uniqueid']][_0x9670('0x4c')]||0x0;this['outbound']['sumBillable']+=this['channels'][_0x5a15ff[_0x9670('0x19')]][_0x9670('0x4e')];}this[_0x9670('0xd')][_0x9670('0x51')]+=this['channels'][_0x5a15ff['uniqueid']][_0x9670('0x45')];ami[_0x9670('0x17')](_0x9670('0x52'),this[_0x9670('0xb')][_0x5a15ff[_0x9670('0x19')]]);ami[_0x9670('0x17')](_0x9670('0x53'),this[_0x9670('0xb')][_0x5a15ff[_0x9670('0x19')]]);this[_0x9670('0x17')]('voice:outbound',_0x9670('0x54'),this[_0x9670('0xd')]);logger[_0x9670('0x55')]('[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event',JSON[_0x9670('0x56')](this[_0x9670('0xb')][_0x5a15ff[_0x9670('0x19')]]));this[_0x9670('0x17')](_0x9670('0x23'),'voice_outbound_channel:remove',this[_0x9670('0xb')][_0x5a15ff[_0x9670('0x19')]]);delete this[_0x9670('0xb')][_0x5a15ff[_0x9670('0x19')]];}if(this[_0x9670('0xe')][_0x5a15ff[_0x9670('0x19')]]){delete this['variables'][_0x5a15ff['uniqueid']];}}}catch(_0x49c187){logger[_0x9670('0x2b')](_0x9670('0x57'),util[_0x9670('0x2c')](_0x49c187,{'showHidden':![],'depth':null}));}};module[_0x9670('0x58')]=VoiceDialReport; \ No newline at end of file +var _0xafae=['called','channel','substring','lastIndexOf','omit','event','privilege','voice:outbound','voice_outbound_channel:save','custom:dialbegin','[syncDialBegin][VoiceDialReport]','inspect','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','lastevent','connect','custom:dialconnect','[syncDialEnd][VoiceDialReport]','syncVarSet','addVariable','value','variable','outboundrouteid','variables','error','[syncVarSet][VoiceDialReport]','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqosrtt','sipcallid','sipuri','bridgepeer','bridgepvtcallid','memberdynamic','memberlastcall','membername','memberpenalty','memberrealtime','isNil','includes','endtime','diff','starttime','seconds','total','answered','holdtime','sumHoldTime','sumBillable','sumDuration','duration','custom:voiceDialReport','custom:dialend','voice_outbound:save','info','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','stringify','[syncHangup][VoiceDialReport]','lodash','moment','util','../../../config/logger','ami','defaults','redis','localhost','socket.io-emitter','outboundChannels','outbound','dialbegin','bind','dialend','syncDialEnd','varset','hangup','syncHangup','prototype','isNotNull','isUndefined','emit','syncDialBegin','channels','uniqueid','merge','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x27078d,_0x148721){var _0x500765=function(_0x22470a){while(--_0x22470a){_0x27078d['push'](_0x27078d['shift']());}};_0x500765(++_0x148721);}(_0xafae,0x98));var _0xeafa=function(_0x3c0b95,_0x26105c){_0x3c0b95=_0x3c0b95-0x0;var _0x3759e0=_0xafae[_0x3c0b95];return _0x3759e0;};'use strict';var _=require(_0xeafa('0x0'));var moment=require(_0xeafa('0x1'));var util=require(_0xeafa('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0xeafa('0x3'))(_0xeafa('0x4'));var ami=require('../ami');config['redis']=_[_0xeafa('0x5')](config[_0xeafa('0x6')],{'host':_0xeafa('0x7'),'port':0x18eb});var io=require(_0xeafa('0x8'))(new Redis(config['redis']));function VoiceDialReport(_0x476899){this['channels']=_0x476899[_0xeafa('0x9')];this[_0xeafa('0xa')]=_0x476899[_0xeafa('0xa')];this['variables']={};ami['on'](_0xeafa('0xb'),this['syncDialBegin'][_0xeafa('0xc')](this));ami['on'](_0xeafa('0xd'),this[_0xeafa('0xe')][_0xeafa('0xc')](this));ami['on'](_0xeafa('0xf'),this['syncVarSet']['bind'](this));ami['on'](_0xeafa('0x10'),this[_0xeafa('0x11')][_0xeafa('0xc')](this));}VoiceDialReport[_0xeafa('0x12')][_0xeafa('0x13')]=function(_0x2ead2a){return _0x2ead2a!==null&&!_[_0xeafa('0x14')](_0x2ead2a);};VoiceDialReport['prototype'][_0xeafa('0x15')]=function(_0x484a58,_0x558300,_0x2d1cb0){io['to'](_0x484a58)[_0xeafa('0x15')](_0x558300,_0x2d1cb0);};VoiceDialReport[_0xeafa('0x12')][_0xeafa('0x16')]=function(_0x4e8af0){try{if(this[_0xeafa('0x13')](_0x4e8af0)){if(this[_0xeafa('0x17')][_0x4e8af0[_0xeafa('0x18')]]){_[_0xeafa('0x19')](this[_0xeafa('0x17')][_0x4e8af0[_0xeafa('0x18')]],{'starttime':moment()[_0xeafa('0x1a')](_0xeafa('0x1b')),'lastevent':_0xeafa('0x1c'),'interface':_0x4e8af0[_0xeafa('0x1d')][_0xeafa('0x1e')](0x0,_0x4e8af0[_0xeafa('0x1d')][_0xeafa('0x1f')]('-')),'membername':_0x4e8af0[_0xeafa('0x1d')][_0xeafa('0x1e')](_0x4e8af0[_0xeafa('0x1d')][_0xeafa('0x1f')]('/')+0x1,_0x4e8af0[_0xeafa('0x1d')][_0xeafa('0x1f')]('-'))},_[_0xeafa('0x20')](_0x4e8af0,[_0xeafa('0x21'),_0xeafa('0x22')]));this['emit'](_0xeafa('0x23'),_0xeafa('0x24'),this[_0xeafa('0x17')][_0x4e8af0['uniqueid']]);ami['emit'](_0xeafa('0x25'),this['channels'][_0x4e8af0[_0xeafa('0x18')]]);}}}catch(_0x5be899){logger['error'](_0xeafa('0x26'),util[_0xeafa('0x27')](_0x5be899,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xeafa('0x12')][_0xeafa('0xe')]=function(_0x4fc887){try{if(this[_0xeafa('0x13')](_0x4fc887)){if(this['channels'][_0x4fc887[_0xeafa('0x18')]]){this[_0xeafa('0x17')][_0x4fc887[_0xeafa('0x18')]][_0xeafa('0x28')]=_0x4fc887[_0xeafa('0x28')];if(_0x4fc887[_0xeafa('0x28')]===_0xeafa('0x29')){this[_0xeafa('0x17')][_0x4fc887[_0xeafa('0x18')]][_0xeafa('0x2a')]=_0x4fc887[_0xeafa('0x2a')];this[_0xeafa('0x17')][_0x4fc887[_0xeafa('0x18')]][_0xeafa('0x2b')]=_0x4fc887['connectedlinename'];this[_0xeafa('0x17')][_0x4fc887[_0xeafa('0x18')]][_0xeafa('0x2c')]=moment()[_0xeafa('0x1a')](_0xeafa('0x1b'));this[_0xeafa('0x17')][_0x4fc887[_0xeafa('0x18')]][_0xeafa('0x2d')]=_0xeafa('0x2e');ami[_0xeafa('0x15')](_0xeafa('0x2f'),this[_0xeafa('0x17')][_0x4fc887[_0xeafa('0x18')]]);}this[_0xeafa('0x15')](_0xeafa('0x23'),'voice_outbound_channel:save',this[_0xeafa('0x17')][_0x4fc887[_0xeafa('0x18')]]);}}}catch(_0x35d224){logger['error'](_0xeafa('0x30'),util[_0xeafa('0x27')](_0x35d224,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xeafa('0x12')][_0xeafa('0x31')]=function(_0x11da33){try{if(this['isNotNull'](_0x11da33)){this[_0xeafa('0x32')](_0x11da33['uniqueid'],_['keys'](_0x11da33['variable'])[0x0],_0x11da33[_0xeafa('0x33')]);if(this['isNotNull'](_0x11da33[_0xeafa('0x34')])&&this[_0xeafa('0x13')](_0x11da33['variable'][_0xeafa('0x35')])){if(_[_0xeafa('0x14')](this[_0xeafa('0x17')][_0x11da33[_0xeafa('0x18')]])){this[_0xeafa('0x17')][_0x11da33[_0xeafa('0x18')]]={'routeId':_0x11da33[_0xeafa('0x33')],'variables':this[_0xeafa('0x36')][_0x11da33['uniqueid']]};this[_0xeafa('0x15')](_0xeafa('0x23'),_0xeafa('0x24'),this['channels'][_0x11da33[_0xeafa('0x18')]]);}}}}catch(_0x115a9c){logger[_0xeafa('0x37')](_0xeafa('0x38'),util[_0xeafa('0x27')](_0x115a9c,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype']['addVariable']=function(_0x56ce82,_0x89d2b6,_0x1f286c){var _0x198c3a=['rtpaudioqos',_0xeafa('0x39'),_0xeafa('0x3a'),'rtpaudioqosjitterbridged',_0xeafa('0x3b'),'rtpaudioqoslossbridged',_0xeafa('0x3c'),'rtpaudioqosrttbridged',_0xeafa('0x3d'),_0xeafa('0x3e'),_0xeafa('0x3f'),_0xeafa('0x40'),'membercalls',_0xeafa('0x41'),'memberinterface',_0xeafa('0x42'),_0xeafa('0x43'),_0xeafa('0x44'),_0xeafa('0x45')];if(!_[_0xeafa('0x46')](_0x89d2b6)&&!_[_0xeafa('0x47')](_0x198c3a,_0x89d2b6)){if(_['isUndefined'](this['variables'][_0x56ce82])){this[_0xeafa('0x36')][_0x56ce82]={};}this[_0xeafa('0x36')][_0x56ce82][_0x89d2b6]=_0x1f286c;}};VoiceDialReport[_0xeafa('0x12')]['syncHangup']=function(_0x582fda){try{if(this[_0xeafa('0x13')](_0x582fda)){if(this[_0xeafa('0x17')][_0x582fda['uniqueid']]){this[_0xeafa('0x17')][_0x582fda[_0xeafa('0x18')]]['endtime']=moment()[_0xeafa('0x1a')](_0xeafa('0x1b'));this['channels'][_0x582fda['uniqueid']]['duration']=moment(this[_0xeafa('0x17')][_0x582fda[_0xeafa('0x18')]][_0xeafa('0x48')])[_0xeafa('0x49')](this[_0xeafa('0x17')][_0x582fda[_0xeafa('0x18')]][_0xeafa('0x4a')],_0xeafa('0x4b'));this[_0xeafa('0x17')][_0x582fda['uniqueid']][_0xeafa('0x2d')]='complete';this[_0xeafa('0xa')][_0xeafa('0x4c')]+=0x1;if(this[_0xeafa('0x17')][_0x582fda[_0xeafa('0x18')]][_0xeafa('0x2c')]){this[_0xeafa('0xa')][_0xeafa('0x4d')]+=0x1;this['channels'][_0x582fda['uniqueid']][_0xeafa('0x4e')]=moment(this[_0xeafa('0x17')][_0x582fda[_0xeafa('0x18')]][_0xeafa('0x2c')])[_0xeafa('0x49')](this[_0xeafa('0x17')][_0x582fda['uniqueid']][_0xeafa('0x4a')],_0xeafa('0x4b'));this[_0xeafa('0x17')][_0x582fda['uniqueid']]['billableseconds']=moment(this[_0xeafa('0x17')][_0x582fda['uniqueid']]['endtime'])['diff'](this[_0xeafa('0x17')][_0x582fda[_0xeafa('0x18')]]['answertime'],_0xeafa('0x4b'));this['outbound'][_0xeafa('0x4f')]+=this[_0xeafa('0x17')][_0x582fda[_0xeafa('0x18')]][_0xeafa('0x4e')]||0x0;this[_0xeafa('0xa')][_0xeafa('0x50')]+=this[_0xeafa('0x17')][_0x582fda[_0xeafa('0x18')]]['billableseconds'];}this['outbound'][_0xeafa('0x51')]+=this[_0xeafa('0x17')][_0x582fda[_0xeafa('0x18')]][_0xeafa('0x52')];ami[_0xeafa('0x15')](_0xeafa('0x53'),this[_0xeafa('0x17')][_0x582fda[_0xeafa('0x18')]]);ami[_0xeafa('0x15')](_0xeafa('0x54'),this['channels'][_0x582fda[_0xeafa('0x18')]]);this[_0xeafa('0x15')](_0xeafa('0x23'),_0xeafa('0x55'),this[_0xeafa('0xa')]);logger[_0xeafa('0x56')](_0xeafa('0x57'),JSON[_0xeafa('0x58')](this['channels'][_0x582fda[_0xeafa('0x18')]]));this[_0xeafa('0x15')]('voice:outbound','voice_outbound_channel:remove',this[_0xeafa('0x17')][_0x582fda[_0xeafa('0x18')]]);delete this['channels'][_0x582fda['uniqueid']];}if(this[_0xeafa('0x36')][_0x582fda[_0xeafa('0x18')]]){delete this['variables'][_0x582fda['uniqueid']];}}}catch(_0x259d0d){logger[_0xeafa('0x37')](_0xeafa('0x59'),util[_0xeafa('0x27')](_0x259d0d,{'showHidden':![],'depth':null}));}};module['exports']=VoiceDialReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceQueueReport.js b/server/services/ami/report/voiceQueueReport.js index e4fd1b0..5afee04 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 _0x47cb=['tail','finally','agents','channels','queueChannels','voiceQueues','flagQueueSummary','campaigns','variables','queuesummary','syncQueueSummary','bind','queuecallerjoin','syncQueueCallerJoin','queuecallerabandon','syncQueueCallerAbandon','syncQueueCallerLeave','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','fullybooted','syncFullyBooted','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncBlindTransfer','loopQueueShow','isUndefined','hasOwnProperty','isEmpty','originated','pTalking','queueStatusComplete','unlockRR','clearZombieChannels','switch','isNil','Action','status','catch','No\x20such\x20channel','[voiceQueueReport][checkChannel]','queueReports','[voiceQueueReport][checkQueueReport]','error','[FullyBooted]\x20clear\x20realtime','clearQueueReport','inspect','emit','voice:queue:%s','name','voice_queue_channel:save','emitVoiceQueueChannelRemove','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','format','voice_queue_channel:remove','emitVoiceQueueSummary','type','inbound','strategy','available','loggedIn','sumDuration','sumHoldTime','total','Trunk','active','callerid','Interval','voice_queue:save','isNotNull','queues','[queues]','loopQueueSummary','then','[queuesummary]','queue','countBy','callers','waiting','toNumber','loggedin','talking','custom:queuesummary','syncQueueSummaryComplete','uniqueid','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','pick','keys','push','last','queuecallercomplete','holdtime','originalposition','queuecallerabandonAt','queuecallerexitreason','ABANDONED','lastAssignedTo','[syncQueueCallerAbandon][VoiceQueueReport]','connectedlinenum','connectedlinename','COMPLETEDBYAGENT','[syncAgentConnect][VoiceQueueReport]','assigned','queuecallerexit','queuecallerexitAt','transfer','reason','COMPLETED','startsWith','channel','toLowerCase','local/','linkedid','add','seconds','FORWARDTRANSFER','transfertype','FORWARD','destexten','COMPLETEDBY','toUpperCase','[syncAgentComplete][VoiceQueueReport]','addVariable','variable','value','queuestatus','CONTINUE','queuecallerleaveAt','[syncVarSet][VoiceQueueReport]','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','membername','memberpenalty','includes','length','unmanaged','abandoned','milliseconds','diff','queuecallercompleteAt','lastevent','custom:queuecallerunmanaged','custom:queuecallerabandon','syncAttendedTransfer','transfereeuniqueid','secondtransfererexten','transferuniqueid','ATTENDEDTRANSFER','ATTENDED','secondtransfereruniqueid','transfertargetuniqueid','transferexten','origtransfererexten','origtransfereruniqueid','[syncAttendedTransfer][VoiceQueueReport]','BLINDTRANSFER','BLIND','extension','BlindTransfer','context','transfererchannel','[syncBlindTransfer][VoiceQueueReport]','mohstarttime','mohtime','[syncMusicOnHoldStop][VoiceQueueReport]','exports','lodash','moment','bluebird','util','md5','../../../config/logger','../ami','../model/queueReport','defaults','localhost','socket.io-emitter','redis','prototype','enqueue'];(function(_0x106926,_0x8deb90){var _0x2ad64c=function(_0x566f12){while(--_0x566f12){_0x106926['push'](_0x106926['shift']());}};_0x2ad64c(++_0x8deb90);}(_0x47cb,0xba));var _0xb47c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x47cb[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xb47c('0x0'));var moment=require(_0xb47c('0x1'));var BPromise=require(_0xb47c('0x2'));var util=require(_0xb47c('0x3'));var md5=require(_0xb47c('0x4'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0xb47c('0x5'))('ami');var ami=require(_0xb47c('0x6'));var QueueReport=require(_0xb47c('0x7'));config['redis']=_[_0xb47c('0x8')](config['redis'],{'host':_0xb47c('0x9'),'port':0x18eb});var io=require(_0xb47c('0xa'))(new Redis(config[_0xb47c('0xb')]));var Sequence=function(){};Sequence[_0xb47c('0xc')][_0xb47c('0xd')]=function(_0x1608eb){this[_0xb47c('0xe')]=this['tail']?this['tail'][_0xb47c('0xf')](_0x1608eb):_0x1608eb();};function VoiceQueueReport(_0x941e98){this['sequence']=new Sequence();this['queueReports']={};this[_0xb47c('0x10')]=_0x941e98['agents'];this[_0xb47c('0x11')]=_0x941e98[_0xb47c('0x12')];this[_0xb47c('0x13')]=_0x941e98[_0xb47c('0x13')];this[_0xb47c('0x14')]=!![];this['campaigns']=_0x941e98[_0xb47c('0x15')];this[_0xb47c('0x16')]={};ami['on'](_0xb47c('0x17'),this[_0xb47c('0x18')]['bind'](this));ami['on']('queuesummarycomplete',this['syncQueueSummaryComplete'][_0xb47c('0x19')](this));ami['on'](_0xb47c('0x1a'),this[_0xb47c('0x1b')]['bind'](this));ami['on'](_0xb47c('0x1c'),this[_0xb47c('0x1d')][_0xb47c('0x19')](this));ami['on']('queuecallerleave',this[_0xb47c('0x1e')][_0xb47c('0x19')](this));ami['on'](_0xb47c('0x1f'),this[_0xb47c('0x20')][_0xb47c('0x19')](this));ami['on']('agentconnect',this['syncAgentConnect'][_0xb47c('0x19')](this));ami['on'](_0xb47c('0x21'),this[_0xb47c('0x22')][_0xb47c('0x19')](this));ami['on'](_0xb47c('0x23'),this[_0xb47c('0x24')][_0xb47c('0x19')](this));ami['on'](_0xb47c('0x25'),this[_0xb47c('0x26')][_0xb47c('0x19')](this));ami['on'](_0xb47c('0x27'),this[_0xb47c('0x28')][_0xb47c('0x19')](this));ami['on'](_0xb47c('0x29'),this[_0xb47c('0x2a')][_0xb47c('0x19')](this));ami['on'](_0xb47c('0x2b'),this['syncAttendedTransfer'][_0xb47c('0x19')](this));ami['on']('blindtransfer',this[_0xb47c('0x2c')][_0xb47c('0x19')](this));this['loopQueueSummary']();this[_0xb47c('0x2d')]();}function isNotNull(_0x1496b9){return _0x1496b9!==null&&!_[_0xb47c('0x2e')](_0x1496b9);}function clearChannels(_0x529126){if(!_['isEmpty'](_0x529126)){for(var _0xb3f240 in _0x529126){if(_0x529126[_0xb47c('0x2f')](_0xb3f240)){delete _0x529126[_0xb3f240];}}}}function clearCampaigns(_0x44f694){if(!_[_0xb47c('0x30')](_0x44f694)){for(var _0x5b35a3 in _0x44f694){if(_0x44f694['hasOwnProperty'](_0x5b35a3)){_0x44f694[_0x5b35a3][_0xb47c('0x31')]=0x0;}}}}function clearVoiceQueues(_0x318ed0){if(!_['isEmpty'](_0x318ed0)){for(var _0x3d53be in _0x318ed0){if(_0x318ed0['hasOwnProperty'](_0x3d53be)){_0x318ed0[_0x3d53be][_0xb47c('0x31')]=0x0;_0x318ed0[_0x3d53be]['talking']=0x0;_0x318ed0[_0x3d53be][_0xb47c('0x32')]=0x0;_0x318ed0[_0x3d53be]['waiting']=0x0;_0x318ed0[_0x3d53be][_0xb47c('0x33')]=!![];}}}}function clearAgentBooked(_0x4f39d7){if(!_[_0xb47c('0x30')](_0x4f39d7)){for(var _0x5b0eb5 in _0x4f39d7){if(_0x4f39d7[_0xb47c('0x2f')](_0x5b0eb5)){_0x4f39d7[_0x5b0eb5][_0xb47c('0x34')]=!![];}}}}VoiceQueueReport[_0xb47c('0xc')][_0xb47c('0x35')]=function(){var _0x4cce45=this;for(var _0x536656 in this[_0xb47c('0x11')]){if(this[_0xb47c('0x11')][_0xb47c('0x2f')](_0x536656)&&!this['channels'][_0x536656][_0xb47c('0x36')]){this['sequence'][_0xb47c('0xd')](function(){if(!_[_0xb47c('0x37')](_0x4cce45[_0xb47c('0x11')][_0x536656])){return ami[_0xb47c('0x38')]({'action':_0xb47c('0x39'),'channel':_0x4cce45[_0xb47c('0x11')][_0x536656]['channel']})[_0xb47c('0x3a')](function(_0x3e0ace){if(_0x3e0ace['message']===_0xb47c('0x3b')){setTimeout(function(){if(_0x4cce45[_0xb47c('0x11')][_0x536656]){delete _0x4cce45[_0xb47c('0x11')][_0x536656];logger['error'](_0xb47c('0x3c'),_0x536656);}if(_0x4cce45['queueReports'][_0x536656]){delete _0x4cce45[_0xb47c('0x3d')][_0x536656];logger['error'](_0xb47c('0x3e'),_0x536656);}if(_0x4cce45[_0xb47c('0x16')][_0x536656]){delete _0x4cce45[_0xb47c('0x16')][_0x536656];logger['error']('[voiceQueueReport][checkVariables]',_0x536656);}},0x1f40);}});}});}}};VoiceQueueReport['prototype'][_0xb47c('0x26')]=function(){logger[_0xb47c('0x3f')](_0xb47c('0x40'));clearChannels(this[_0xb47c('0x11')]);this[_0xb47c('0x41')](this[_0xb47c('0x3d')]);clearAgentBooked(this[_0xb47c('0x10')]);clearVoiceQueues(this['voiceQueues']);clearCampaigns(this[_0xb47c('0x15')]);};VoiceQueueReport[_0xb47c('0xc')][_0xb47c('0x41')]=function(_0x2fb9d2){var _0x3be573=this;if(!_[_0xb47c('0x30')](_0x2fb9d2)){for(var _0x1f539c in _0x2fb9d2){if(_0x2fb9d2['hasOwnProperty'](_0x1f539c)){_0x3be573['emitVoiceQueueChannelRemove'](_0x2fb9d2[_0x1f539c]);delete _0x2fb9d2[_0x1f539c];}}}};function loggerCatch(_0x459267){return function(_0x511513){logger['error'](_0x459267,util[_0xb47c('0x42')](_0x511513,{'showHidden':![],'depth':null}));};}VoiceQueueReport['prototype'][_0xb47c('0x43')]=function(_0x57fb92,_0x259e70,_0x28c4ce){io['to'](_0x57fb92)[_0xb47c('0x43')](_0x259e70,_0x28c4ce);};VoiceQueueReport[_0xb47c('0xc')]['emitVoiceQueueChannelSave']=function(_0x9e1178){this[_0xb47c('0x43')](util['format'](_0xb47c('0x44'),_0x9e1178[_0xb47c('0x45')]),_0xb47c('0x46'),_0x9e1178);};VoiceQueueReport[_0xb47c('0xc')][_0xb47c('0x47')]=function(_0x37fb65){logger[_0xb47c('0x48')](_0xb47c('0x49'),JSON['stringify'](_0x37fb65));this['emit'](util[_0xb47c('0x4a')](_0xb47c('0x44'),_0x37fb65[_0xb47c('0x45')]),_0xb47c('0x4b'),_0x37fb65);};VoiceQueueReport[_0xb47c('0xc')][_0xb47c('0x4c')]=function(_0x43058d){if(_0x43058d[_0xb47c('0x4d')]===_0xb47c('0x4e')){var _0x47423f={'id':_0x43058d['id'],'name':_0x43058d[_0xb47c('0x45')],'strategy':_0x43058d[_0xb47c('0x4f')],'answered':_0x43058d['answered'],'available':_0x43058d[_0xb47c('0x50')],'loggedIn':_0x43058d[_0xb47c('0x51')],'pTalking':_0x43058d[_0xb47c('0x32')],'sumBillable':_0x43058d['sumBillable'],'sumDuration':_0x43058d[_0xb47c('0x52')],'sumHoldTime':_0x43058d[_0xb47c('0x53')]||0x0,'talking':_0x43058d['talking'],'total':_0x43058d[_0xb47c('0x54')],'type':_0x43058d[_0xb47c('0x4d')],'unmanaged':_0x43058d['unmanaged'],'abandoned':_0x43058d['abandoned'],'waiting':_0x43058d['waiting']};if(_0x43058d[_0xb47c('0x55')]){_0x47423f['Trunk']={'id':_0x43058d[_0xb47c('0x55')]['id'],'name':_0x43058d[_0xb47c('0x55')][_0xb47c('0x45')],'active':_0x43058d['Trunk'][_0xb47c('0x56')],'callerid':_0x43058d[_0xb47c('0x55')][_0xb47c('0x57')]};}if(_0x43058d[_0xb47c('0x58')]){_0x47423f[_0xb47c('0x58')]={'id':_0x43058d[_0xb47c('0x58')]['id'],'name':_0x43058d[_0xb47c('0x58')][_0xb47c('0x45')]};}var _0x3af052=md5(JSON['stringify'](_0x47423f));if(_0x43058d['md5']!==_0x3af052){_0x43058d[_0xb47c('0x4')]=_0x3af052;this[_0xb47c('0x43')](util[_0xb47c('0x4a')](_0xb47c('0x44'),_0x47423f[_0xb47c('0x45')]),_0xb47c('0x59'),_0x47423f);}}};VoiceQueueReport[_0xb47c('0xc')][_0xb47c('0x5a')]=function(_0x2dbf22){return _0x2dbf22!==null&&!_[_0xb47c('0x2e')](_0x2dbf22);};VoiceQueueReport['prototype'][_0xb47c('0x2d')]=function(){var _0xdf5bfd=this;setInterval(function(){_0xdf5bfd['clearZombieChannels']();ami['Action']({'action':_0xb47c('0x5b')})[_0xb47c('0x3a')](loggerCatch(_0xb47c('0x5c')));},0x2710);};VoiceQueueReport[_0xb47c('0xc')][_0xb47c('0x5d')]=function(){var _0x484111=this;setInterval(function(){if(_0x484111[_0xb47c('0x14')]){return ami['Action']({'action':_0xb47c('0x17')})[_0xb47c('0x5e')](function(_0x1a7add){_0x484111[_0xb47c('0x14')]=![];})[_0xb47c('0x3a')](loggerCatch(_0xb47c('0x5f')));}},0x3e8);};VoiceQueueReport[_0xb47c('0xc')][_0xb47c('0x18')]=function(_0x34b148){try{if(this[_0xb47c('0x5a')](_0x34b148)&&this[_0xb47c('0x5a')](_0x34b148[_0xb47c('0x60')])){if(this[_0xb47c('0x13')][_0x34b148[_0xb47c('0x60')]]){var _0x1bde1a=_[_0xb47c('0x61')](this[_0xb47c('0x11')],_0xb47c('0x60'))[_0x34b148['queue']]||0x0;var _0x3820ce=_0x1bde1a-_0x34b148[_0xb47c('0x62')];if(this[_0xb47c('0x13')][_0x34b148[_0xb47c('0x60')]][_0xb47c('0x63')]!==_[_0xb47c('0x64')](_0x34b148[_0xb47c('0x62')])||this[_0xb47c('0x13')][_0x34b148['queue']][_0xb47c('0x51')]!==_[_0xb47c('0x64')](_0x34b148[_0xb47c('0x65')])||this['voiceQueues'][_0x34b148[_0xb47c('0x60')]][_0xb47c('0x50')]!==_['toNumber'](_0x34b148[_0xb47c('0x50')])||this[_0xb47c('0x13')][_0x34b148['queue']]['talking']!==_0x3820ce){this[_0xb47c('0x13')][_0x34b148[_0xb47c('0x60')]]['waiting']=_[_0xb47c('0x64')](_0x34b148[_0xb47c('0x62')]);this[_0xb47c('0x13')][_0x34b148[_0xb47c('0x60')]][_0xb47c('0x51')]=_[_0xb47c('0x64')](_0x34b148[_0xb47c('0x65')]);this['voiceQueues'][_0x34b148[_0xb47c('0x60')]]['available']=_[_0xb47c('0x64')](_0x34b148['available']);this[_0xb47c('0x13')][_0x34b148[_0xb47c('0x60')]][_0xb47c('0x66')]=_0x3820ce>0x0?_0x3820ce:0x0;this[_0xb47c('0x13')][_0x34b148[_0xb47c('0x60')]][_0xb47c('0x66')]=this[_0xb47c('0x13')][_0x34b148[_0xb47c('0x60')]][_0xb47c('0x66')]>_['toNumber'](_0x34b148['loggedin'])?_['toNumber'](_0x34b148['loggedin']):this['voiceQueues'][_0x34b148[_0xb47c('0x60')]]['talking'];this[_0xb47c('0x4c')](this[_0xb47c('0x13')][_0x34b148['queue']]);}ami['emit'](_0xb47c('0x67'),this[_0xb47c('0x13')][_0x34b148[_0xb47c('0x60')]]);}}}catch(_0x10452a){logger[_0xb47c('0x3f')]('[syncQueueSummary][VoiceQueueReport]',util[_0xb47c('0x42')](_0x10452a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb47c('0xc')][_0xb47c('0x68')]=function(_0x361fa4){this['flagQueueSummary']=!![];};VoiceQueueReport['prototype']['syncNewExten']=function(_0x591303){};VoiceQueueReport[_0xb47c('0xc')][_0xb47c('0x1b')]=function(_0x3fdc33){try{if(this[_0xb47c('0x5a')](_0x3fdc33)){if(_['isUndefined'](this[_0xb47c('0x3d')][_0x3fdc33[_0xb47c('0x69')]])){this[_0xb47c('0x3d')][_0x3fdc33[_0xb47c('0x69')]]=[];this[_0xb47c('0x11')][_0x3fdc33[_0xb47c('0x69')]]={};}var _0x4fb112=new QueueReport();_0x4fb112[_0xb47c('0x45')]=_0x3fdc33[_0xb47c('0x60')];_0x4fb112['type']=this['voiceQueues'][_0x4fb112[_0xb47c('0x45')]]&&this[_0xb47c('0x13')][_0x4fb112[_0xb47c('0x45')]][_0xb47c('0x4d')]?this[_0xb47c('0x13')][_0x4fb112[_0xb47c('0x45')]]['type']||_0xb47c('0x4e'):_0xb47c('0x4e');_0x4fb112[_0xb47c('0x60')]=_0x3fdc33[_0xb47c('0x60')];_0x4fb112[_0xb47c('0x6a')]=moment()[_0xb47c('0x4a')](_0xb47c('0x6b'));_0x4fb112[_0xb47c('0x6c')]=_0x3fdc33[_0xb47c('0x6c')];_0x4fb112[_0xb47c('0x6d')]=_0x3fdc33[_0xb47c('0x6d')];_['merge'](_0x4fb112,_[_0xb47c('0x6e')](_0x3fdc33,_[_0xb47c('0x6f')](_0x4fb112)));this['queueReports'][_0x3fdc33['uniqueid']][_0xb47c('0x70')](_0x4fb112);this[_0xb47c('0x11')][_0x3fdc33['uniqueid']]=_0x4fb112;this['emitVoiceQueueChannelSave'](_0x4fb112);}}catch(_0x39ccdc){logger[_0xb47c('0x3f')]('[syncQueueCallerJoin][VoiceQueueReport]',util[_0xb47c('0x42')](_0x39ccdc,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb47c('0xc')][_0xb47c('0x1d')]=function(_0x362d78){try{if(this[_0xb47c('0x5a')](_0x362d78)){if(this['queueReports'][_0x362d78['uniqueid']]){var _0x55209d=_[_0xb47c('0x71')](this[_0xb47c('0x3d')][_0x362d78[_0xb47c('0x69')]]);_0x55209d[_0xb47c('0x72')]=![];_0x55209d['queuecallercompleteAt']=null;_0x55209d[_0xb47c('0x73')]=_0x362d78['holdtime'];_0x55209d[_0xb47c('0x74')]=_0x362d78[_0xb47c('0x74')];_0x55209d['queuecallerabandon']=!![];_0x55209d[_0xb47c('0x75')]=moment()[_0xb47c('0x4a')](_0xb47c('0x6b'));_0x55209d[_0xb47c('0x76')]=_0xb47c('0x77');_0x55209d[_0xb47c('0x78')]=null;this['channels'][_0x362d78[_0xb47c('0x69')]]=_0x55209d;this[_0xb47c('0x47')](_0x55209d);}}}catch(_0x1124a3){logger[_0xb47c('0x3f')](_0xb47c('0x79'),util[_0xb47c('0x42')](_0x1124a3,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb47c('0xc')][_0xb47c('0x1e')]=function(_0x3c1af4){try{if(this[_0xb47c('0x5a')](_0x3c1af4)){if(this[_0xb47c('0x3d')][_0x3c1af4[_0xb47c('0x69')]]){var _0x24b0c6=_[_0xb47c('0x71')](this[_0xb47c('0x3d')][_0x3c1af4[_0xb47c('0x69')]]);_0x24b0c6['queuecallerleaveAt']=moment()[_0xb47c('0x4a')](_0xb47c('0x6b'));_0x24b0c6[_0xb47c('0x7a')]=_0x3c1af4['connectedlinenum'];_0x24b0c6[_0xb47c('0x7b')]=_0x3c1af4[_0xb47c('0x7b')];this[_0xb47c('0x11')][_0x3c1af4['uniqueid']]=_0x24b0c6;this['emitVoiceQueueChannelSave'](_0x24b0c6);}}}catch(_0x60ba40){logger['error']('[syncQueueCallerLeave][VoiceQueueReport]',util['inspect'](_0x60ba40,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb47c('0xc')]['syncAgentConnect']=function(_0x511d91){try{if(this[_0xb47c('0x5a')](_0x511d91)){if(this[_0xb47c('0x3d')][_0x511d91[_0xb47c('0x69')]]){var _0x279ca6=_['last'](this[_0xb47c('0x3d')][_0x511d91[_0xb47c('0x69')]]);_0x279ca6[_0xb47c('0x72')]=!![];_0x279ca6['queuecallerexitreason']=_0xb47c('0x7c');}}}catch(_0x5b6610){logger[_0xb47c('0x3f')](_0xb47c('0x7d'),util['inspect'](_0x5b6610,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xb47c('0x20')]=function(_0x5f3d16){try{if(this['isNotNull'](_0x5f3d16)){if(this['queueReports'][_0x5f3d16[_0xb47c('0x69')]]){var _0x528bfe=_['last'](this['queueReports'][_0x5f3d16[_0xb47c('0x69')]]);_0x528bfe[_0xb47c('0x1c')]=![];_0x528bfe[_0xb47c('0x75')]=null;_0x528bfe[_0xb47c('0x7e')]=!![];_0x528bfe['lastAssignedTo']=_0x5f3d16['membername'];_0x528bfe[_0xb47c('0x73')]=_0x5f3d16['holdtime'];_0x528bfe[_0xb47c('0x72')]=!![];_0x528bfe[_0xb47c('0x7f')]=![];_0x528bfe[_0xb47c('0x80')]=null;if(!_0x528bfe[_0xb47c('0x81')]){if(_0x5f3d16[_0xb47c('0x82')]==_0xb47c('0x81')){_0x528bfe['queuecallerexitreason']=_0xb47c('0x83');}else{if(_[_0xb47c('0x84')](_0x5f3d16[_0xb47c('0x85')][_0xb47c('0x86')](),_0xb47c('0x87'))){if(this[_0xb47c('0x3d')][_0x5f3d16[_0xb47c('0x88')]]){var _0x49239f=_[_0xb47c('0x71')](this[_0xb47c('0x3d')][_0x5f3d16[_0xb47c('0x88')]]);_0x49239f['queuecallercomplete']=![];_0x49239f[_0xb47c('0x7f')]=!![];_0x49239f[_0xb47c('0x80')]=moment(_0x528bfe[_0xb47c('0x6a')])[_0xb47c('0x89')](_0x5f3d16['holdtime'],_0xb47c('0x8a'))[_0xb47c('0x4a')](_0xb47c('0x6b'));_0x49239f['queuecallerexitreason']=_0xb47c('0x8b');_0x49239f[_0xb47c('0x81')]=!![];_0x49239f[_0xb47c('0x8c')]=_0xb47c('0x8d');_0x49239f['transferexten']=_0x5f3d16[_0xb47c('0x8e')];_0x49239f['transferuniqueid']=_0x5f3d16[_0xb47c('0x69')];var _0x48d20b=this[_0xb47c('0x3d')][_0x5f3d16[_0xb47c('0x88')]];this[_0xb47c('0x3d')][_0x5f3d16[_0xb47c('0x88')]]=this[_0xb47c('0x3d')][_0x5f3d16[_0xb47c('0x69')]];this[_0xb47c('0x3d')][_0x5f3d16['uniqueid']]=_0x48d20b;}}else{_0x528bfe[_0xb47c('0x76')]=_0xb47c('0x8f')+_0x5f3d16[_0xb47c('0x82')][_0xb47c('0x90')]();}}}this[_0xb47c('0x11')][_0x5f3d16[_0xb47c('0x69')]]=_0x528bfe;this[_0xb47c('0x47')](_0x528bfe);}}}catch(_0x4fc0b9){logger[_0xb47c('0x3f')](_0xb47c('0x91'),util[_0xb47c('0x42')](_0x4fc0b9,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb47c('0xc')][_0xb47c('0x22')]=function(_0x5958a8){try{if(this[_0xb47c('0x5a')](_0x5958a8)){this[_0xb47c('0x92')](_0x5958a8[_0xb47c('0x69')],_['keys'](_0x5958a8[_0xb47c('0x93')])[0x0],_0x5958a8[_0xb47c('0x94')]);if(this['queueReports'][_0x5958a8[_0xb47c('0x69')]]){var _0x2724dc=_[_0xb47c('0x71')](this['queueReports'][_0x5958a8[_0xb47c('0x69')]]);if(_0x2724dc){if(this[_0xb47c('0x5a')](_0x5958a8[_0xb47c('0x93')])&&this[_0xb47c('0x5a')](_0x5958a8[_0xb47c('0x93')][_0xb47c('0x95')])){switch(_0x5958a8['value']){case _0xb47c('0x96'):_0x2724dc[_0xb47c('0x7f')]=![];_0x2724dc[_0xb47c('0x80')]=null;break;default:_0x2724dc['queuecallerexit']=!![];_0x2724dc[_0xb47c('0x80')]=moment()[_0xb47c('0x4a')](_0xb47c('0x6b'));_0x2724dc[_0xb47c('0x97')]=moment()[_0xb47c('0x4a')](_0xb47c('0x6b'));}_0x2724dc['queuecallerabandon']=![];_0x2724dc[_0xb47c('0x75')]=null;_0x2724dc[_0xb47c('0x76')]=_0x5958a8['value'];this[_0xb47c('0x11')][_0x5958a8[_0xb47c('0x69')]]=_0x2724dc;this[_0xb47c('0x47')](_0x2724dc);}else if(this[_0xb47c('0x5a')](_0x5958a8['variable'])&&this['isNotNull'](_0x5958a8[_0xb47c('0x93')]['queueposition'])){if(!_0x2724dc['queuecallerabandon']){_0x2724dc[_0xb47c('0x7f')]=!![];_0x2724dc[_0xb47c('0x80')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x2724dc[_0xb47c('0x76')]='EXITWITHKEY';_0x2724dc['queuecallerleaveAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x5958a8['uniqueid']]=_0x2724dc;}}_0x2724dc[_0xb47c('0x16')]=this[_0xb47c('0x16')][_0x5958a8[_0xb47c('0x69')]];}}}}catch(_0x82acf4){logger[_0xb47c('0x3f')](_0xb47c('0x98'),util[_0xb47c('0x42')](_0x82acf4,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb47c('0xc')]['addVariable']=function(_0x37233d,_0x3de9df,_0x2c0207){var _0x4ccbf0=['rtpaudioqos',_0xb47c('0x99'),'rtpaudioqosjitter',_0xb47c('0x9a'),_0xb47c('0x9b'),'rtpaudioqoslossbridged',_0xb47c('0x9c'),_0xb47c('0x9d'),_0xb47c('0x9e'),'sipuri',_0xb47c('0x9f'),_0xb47c('0xa0'),_0xb47c('0xa1'),_0xb47c('0xa2'),_0xb47c('0xa3'),_0xb47c('0xa4'),_0xb47c('0xa5'),_0xb47c('0xa6'),'memberrealtime'];if(!_[_0xb47c('0x37')](_0x3de9df)&&!_[_0xb47c('0xa7')](_0x4ccbf0,_0x3de9df)){if(_['isUndefined'](this[_0xb47c('0x16')][_0x37233d])){this['variables'][_0x37233d]={};}this[_0xb47c('0x16')][_0x37233d][_0x3de9df]=_0x2c0207;}};VoiceQueueReport[_0xb47c('0xc')][_0xb47c('0x24')]=function(_0x352051){try{if(this[_0xb47c('0x5a')](_0x352051)){if(this[_0xb47c('0x3d')][_0x352051[_0xb47c('0x69')]]){for(var _0x515a28=0x0,_0x4dc7a4={};_0x515a280x0?_0x33f40f:0x0;this[_0x7ac3('0x43')][_0x2f329b[_0x7ac3('0x64')]]['talking']=this[_0x7ac3('0x43')][_0x2f329b[_0x7ac3('0x64')]][_0x7ac3('0x33')]>_[_0x7ac3('0x67')](_0x2f329b[_0x7ac3('0x68')])?_[_0x7ac3('0x67')](_0x2f329b['loggedin']):this[_0x7ac3('0x43')][_0x2f329b[_0x7ac3('0x64')]][_0x7ac3('0x33')];this[_0x7ac3('0x4d')](this[_0x7ac3('0x43')][_0x2f329b[_0x7ac3('0x64')]]);}ami[_0x7ac3('0x46')]('custom:queuesummary',this[_0x7ac3('0x43')][_0x2f329b['queue']]);}}}catch(_0x51ed25){logger[_0x7ac3('0x3f')](_0x7ac3('0x6a'),util[_0x7ac3('0x45')](_0x51ed25,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7ac3('0xd')][_0x7ac3('0x1c')]=function(_0x51184a){this[_0x7ac3('0x15')]=!![];};VoiceQueueReport[_0x7ac3('0xd')][_0x7ac3('0x6b')]=function(_0x8811d0){};VoiceQueueReport[_0x7ac3('0xd')][_0x7ac3('0x1e')]=function(_0x48b6e4){try{if(this['isNotNull'](_0x48b6e4)){if(_[_0x7ac3('0x2f')](this[_0x7ac3('0x11')][_0x48b6e4[_0x7ac3('0x6c')]])){this[_0x7ac3('0x11')][_0x48b6e4[_0x7ac3('0x6c')]]=[];this[_0x7ac3('0x13')][_0x48b6e4[_0x7ac3('0x6c')]]={};}var _0x2e2987=new QueueReport();_0x2e2987['name']=_0x48b6e4['queue'];_0x2e2987[_0x7ac3('0x4e')]=this['voiceQueues'][_0x2e2987[_0x7ac3('0x4c')]]&&this[_0x7ac3('0x43')][_0x2e2987[_0x7ac3('0x4c')]][_0x7ac3('0x4e')]?this['voiceQueues'][_0x2e2987[_0x7ac3('0x4c')]][_0x7ac3('0x4e')]||_0x7ac3('0x4f'):_0x7ac3('0x4f');_0x2e2987[_0x7ac3('0x64')]=_0x48b6e4[_0x7ac3('0x64')];_0x2e2987[_0x7ac3('0x6d')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x2e2987['position']=_0x48b6e4[_0x7ac3('0x6e')];_0x2e2987[_0x7ac3('0x6f')]=_0x48b6e4[_0x7ac3('0x6f')];_[_0x7ac3('0x70')](_0x2e2987,_['pick'](_0x48b6e4,_[_0x7ac3('0x71')](_0x2e2987)));this[_0x7ac3('0x11')][_0x48b6e4['uniqueid']][_0x7ac3('0x72')](_0x2e2987);this[_0x7ac3('0x13')][_0x48b6e4[_0x7ac3('0x6c')]]=_0x2e2987;this[_0x7ac3('0x47')](_0x2e2987);}}catch(_0x13bc23){logger[_0x7ac3('0x3f')](_0x7ac3('0x73'),util['inspect'](_0x13bc23,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7ac3('0xd')][_0x7ac3('0x20')]=function(_0x3993b3){try{if(this[_0x7ac3('0x5e')](_0x3993b3)){if(this[_0x7ac3('0x11')][_0x3993b3[_0x7ac3('0x6c')]]){var _0xa4eec3=_[_0x7ac3('0x74')](this[_0x7ac3('0x11')][_0x3993b3[_0x7ac3('0x6c')]]);_0xa4eec3[_0x7ac3('0x75')]=![];_0xa4eec3[_0x7ac3('0x76')]=null;_0xa4eec3['holdtime']=_0x3993b3['holdtime'];_0xa4eec3['originalposition']=_0x3993b3[_0x7ac3('0x77')];_0xa4eec3[_0x7ac3('0x1f')]=!![];_0xa4eec3['queuecallerabandonAt']=moment()[_0x7ac3('0x48')]('YYYY-MM-DD\x20HH:mm:ss');_0xa4eec3[_0x7ac3('0x78')]=_0x7ac3('0x79');_0xa4eec3['lastAssignedTo']=null;this[_0x7ac3('0x13')][_0x3993b3[_0x7ac3('0x6c')]]=_0xa4eec3;this['emitVoiceQueueChannelRemove'](_0xa4eec3);}}}catch(_0x22bdbe){logger[_0x7ac3('0x3f')](_0x7ac3('0x7a'),util[_0x7ac3('0x45')](_0x22bdbe,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x7ac3('0x7b')]=function(_0x31c1d4){try{if(this[_0x7ac3('0x5e')](_0x31c1d4)){if(this[_0x7ac3('0x11')][_0x31c1d4['uniqueid']]){var _0x1b5153=_[_0x7ac3('0x74')](this[_0x7ac3('0x11')][_0x31c1d4[_0x7ac3('0x6c')]]);_0x1b5153[_0x7ac3('0x7c')]=moment()['format'](_0x7ac3('0x7d'));_0x1b5153[_0x7ac3('0x7e')]=_0x31c1d4['connectedlinenum'];_0x1b5153[_0x7ac3('0x7f')]=_0x31c1d4['connectedlinename'];this[_0x7ac3('0x13')][_0x31c1d4[_0x7ac3('0x6c')]]=_0x1b5153;this[_0x7ac3('0x47')](_0x1b5153);}}}catch(_0x1b1966){logger['error'](_0x7ac3('0x80'),util[_0x7ac3('0x45')](_0x1b1966,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7ac3('0xd')][_0x7ac3('0x23')]=function(_0x530c96){try{if(this[_0x7ac3('0x5e')](_0x530c96)){if(this[_0x7ac3('0x11')][_0x530c96['uniqueid']]){var _0x554fb1=_['last'](this[_0x7ac3('0x11')][_0x530c96['uniqueid']]);_0x554fb1['queuecallercomplete']=!![];_0x554fb1[_0x7ac3('0x78')]=_0x7ac3('0x81');}}}catch(_0x96532b){logger[_0x7ac3('0x3f')](_0x7ac3('0x82'),util[_0x7ac3('0x45')](_0x96532b,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x7ac3('0x83')]=function(_0x13a05f){try{if(this[_0x7ac3('0x5e')](_0x13a05f)){if(this[_0x7ac3('0x11')][_0x13a05f['uniqueid']]){var _0x28d98f=_[_0x7ac3('0x74')](this['queueReports'][_0x13a05f[_0x7ac3('0x6c')]]);_0x28d98f[_0x7ac3('0x1f')]=![];_0x28d98f[_0x7ac3('0x84')]=null;_0x28d98f[_0x7ac3('0x85')]=!![];_0x28d98f[_0x7ac3('0x86')]=_0x13a05f[_0x7ac3('0x87')];_0x28d98f['holdtime']=_0x13a05f['holdtime'];_0x28d98f[_0x7ac3('0x75')]=!![];_0x28d98f['queuecallerexit']=![];_0x28d98f[_0x7ac3('0x88')]=null;if(!_0x28d98f[_0x7ac3('0x89')]){if(_0x13a05f['reason']==_0x7ac3('0x89')){_0x28d98f['queuecallerexitreason']=_0x7ac3('0x8a');}else{if(_[_0x7ac3('0x8b')](_0x13a05f['channel'][_0x7ac3('0x8c')](),_0x7ac3('0x8d'))){if(this[_0x7ac3('0x11')][_0x13a05f[_0x7ac3('0x8e')]]){var _0x584f7e=_[_0x7ac3('0x74')](this[_0x7ac3('0x11')][_0x13a05f[_0x7ac3('0x8e')]]);_0x584f7e['queuecallercomplete']=![];_0x584f7e[_0x7ac3('0x8f')]=!![];_0x584f7e[_0x7ac3('0x88')]=moment(_0x28d98f[_0x7ac3('0x6d')])[_0x7ac3('0x90')](_0x13a05f['holdtime'],_0x7ac3('0x91'))[_0x7ac3('0x48')](_0x7ac3('0x7d'));_0x584f7e[_0x7ac3('0x78')]=_0x7ac3('0x92');_0x584f7e[_0x7ac3('0x89')]=!![];_0x584f7e[_0x7ac3('0x93')]=_0x7ac3('0x94');_0x584f7e[_0x7ac3('0x95')]=_0x13a05f[_0x7ac3('0x96')];_0x584f7e[_0x7ac3('0x97')]=_0x13a05f[_0x7ac3('0x6c')];var _0x522b6f=this[_0x7ac3('0x11')][_0x13a05f[_0x7ac3('0x8e')]];this[_0x7ac3('0x11')][_0x13a05f[_0x7ac3('0x8e')]]=this['queueReports'][_0x13a05f[_0x7ac3('0x6c')]];this['queueReports'][_0x13a05f[_0x7ac3('0x6c')]]=_0x522b6f;}}else{_0x28d98f['queuecallerexitreason']=_0x7ac3('0x98')+_0x13a05f[_0x7ac3('0x99')][_0x7ac3('0x9a')]();}}}this[_0x7ac3('0x13')][_0x13a05f[_0x7ac3('0x6c')]]=_0x28d98f;this[_0x7ac3('0x44')](_0x28d98f);}}}catch(_0x4c040d){logger[_0x7ac3('0x3f')](_0x7ac3('0x9b'),util[_0x7ac3('0x45')](_0x4c040d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7ac3('0xd')][_0x7ac3('0x25')]=function(_0x1578d8){try{if(this[_0x7ac3('0x5e')](_0x1578d8)){this[_0x7ac3('0x9c')](_0x1578d8[_0x7ac3('0x6c')],_[_0x7ac3('0x71')](_0x1578d8[_0x7ac3('0x9d')])[0x0],_0x1578d8[_0x7ac3('0x9e')]);if(this[_0x7ac3('0x11')][_0x1578d8[_0x7ac3('0x6c')]]){var _0xbafe47=_[_0x7ac3('0x74')](this[_0x7ac3('0x11')][_0x1578d8[_0x7ac3('0x6c')]]);if(_0xbafe47){if(this[_0x7ac3('0x5e')](_0x1578d8[_0x7ac3('0x9d')])&&this[_0x7ac3('0x5e')](_0x1578d8[_0x7ac3('0x9d')][_0x7ac3('0x9f')])){switch(_0x1578d8[_0x7ac3('0x9e')]){case'CONTINUE':_0xbafe47[_0x7ac3('0x8f')]=![];_0xbafe47[_0x7ac3('0x88')]=null;break;default:_0xbafe47['queuecallerexit']=!![];_0xbafe47[_0x7ac3('0x88')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0xbafe47[_0x7ac3('0x7c')]=moment()[_0x7ac3('0x48')](_0x7ac3('0x7d'));}_0xbafe47[_0x7ac3('0x1f')]=![];_0xbafe47[_0x7ac3('0x84')]=null;_0xbafe47[_0x7ac3('0x78')]=_0x1578d8[_0x7ac3('0x9e')];this[_0x7ac3('0x13')][_0x1578d8['uniqueid']]=_0xbafe47;this['emitVoiceQueueChannelRemove'](_0xbafe47);}else if(this[_0x7ac3('0x5e')](_0x1578d8[_0x7ac3('0x9d')])&&this[_0x7ac3('0x5e')](_0x1578d8[_0x7ac3('0x9d')][_0x7ac3('0xa0')])){if(!_0xbafe47[_0x7ac3('0x1f')]){_0xbafe47[_0x7ac3('0x8f')]=!![];_0xbafe47['queuecallerexitAt']=moment()[_0x7ac3('0x48')]('YYYY-MM-DD\x20HH:mm:ss');_0xbafe47['queuecallerexitreason']=_0x7ac3('0xa1');_0xbafe47[_0x7ac3('0x7c')]=moment()[_0x7ac3('0x48')](_0x7ac3('0x7d'));this['channels'][_0x1578d8[_0x7ac3('0x6c')]]=_0xbafe47;}}_0xbafe47[_0x7ac3('0x17')]=this[_0x7ac3('0x17')][_0x1578d8['uniqueid']];}}}}catch(_0x17a5c6){logger[_0x7ac3('0x3f')]('[syncVarSet][VoiceQueueReport]',util['inspect'](_0x17a5c6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7ac3('0xd')][_0x7ac3('0x9c')]=function(_0x378cbc,_0x3fcc11,_0x30d0e1){var _0x328a71=[_0x7ac3('0xa2'),_0x7ac3('0xa3'),'rtpaudioqosjitter',_0x7ac3('0xa4'),'rtpaudioqosloss',_0x7ac3('0xa5'),_0x7ac3('0xa6'),'rtpaudioqosrttbridged',_0x7ac3('0xa7'),_0x7ac3('0xa8'),'bridgepeer',_0x7ac3('0xa9'),'membercalls',_0x7ac3('0xaa'),'memberinterface',_0x7ac3('0xab'),_0x7ac3('0x87'),_0x7ac3('0xac'),_0x7ac3('0xad')];if(!_[_0x7ac3('0x3a')](_0x3fcc11)&&!_[_0x7ac3('0xae')](_0x328a71,_0x3fcc11)){if(_[_0x7ac3('0x2f')](this[_0x7ac3('0x17')][_0x378cbc])){this[_0x7ac3('0x17')][_0x378cbc]={};}this['variables'][_0x378cbc][_0x3fcc11]=_0x30d0e1;}};VoiceQueueReport[_0x7ac3('0xd')][_0x7ac3('0x27')]=function(_0x10b77){try{if(this['isNotNull'](_0x10b77)){if(this[_0x7ac3('0x11')][_0x10b77[_0x7ac3('0x6c')]]){for(var _0x2bfa88=0x0,_0x2174c1={};_0x2bfa88=0x0?moment(_0x5c23eb[_0x7462('0x17')])[_0x7462('0x19')](_0x5c23eb['starttime'],_0x7462('0x18')):null,'data1':_0x7462('0x1a'),'data2':_0x5c23eb[_0x7462('0x12')],'data3':_0x5c23eb[_0x7462('0xf')],'data4':_0x5c23eb[_0x7462('0x1b')]||null,'role':_0x7462('0x11'),'internal':_0x5c23eb[_0x7462('0x12')]?_[_0x7462('0x13')](_0x5c23eb[_0x7462('0x12')]):undefined,'uniqueid':_0x5c23eb[_0x7462('0x14')]},'log':_0x7462('0x7')});}; \ No newline at end of file +var _0x3815=['SIP/%s','TALKING','diff','queuecallerleaveAt','seconds','inbound','calleridnum','queue','agent','accountcode','toNumber','uniqueid','CreateMemberReport','voiceDialReport','membername','starttime','endtime','outbound','exten','dialstring','moment','lodash','../client','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','Request','voice','lastAssignedTo','isNil','interface','format'];(function(_0x2c3234,_0x501105){var _0x4ec780=function(_0x447a5f){while(--_0x447a5f){_0x2c3234['push'](_0x2c3234['shift']());}};_0x4ec780(++_0x501105);}(_0x3815,0x1d4));var _0x5381=function(_0x52dc2c,_0x574526){_0x52dc2c=_0x52dc2c-0x0;var _0x26ad0b=_0x3815[_0x52dc2c];return _0x26ad0b;};'use strict';var moment=require(_0x5381('0x0'));var _=require(_0x5381('0x1'));var util=require('util');var client=require(_0x5381('0x2'));exports[_0x5381('0x3')]=function(_0x518109){var _0x33afd8=_0x518109[_0x5381('0x4')]||_0x518109[_0x5381('0x5')];return client[_0x5381('0x6')]('CreateMemberReport',{'body':{'channel':_0x5381('0x7'),'membername':_0x518109[_0x5381('0x8')],'interface':_[_0x5381('0x9')](_0x518109[_0x5381('0xa')])?util[_0x5381('0xb')](_0x5381('0xc'),_0x518109[_0x5381('0x8')]):_0x518109[_0x5381('0xa')],'type':_0x5381('0xd'),'enterAt':_0x518109['queuecallerleaveAt'],'exitAt':_0x33afd8,'duration':moment(_0x33afd8)[_0x5381('0xe')](_0x518109[_0x5381('0xf')],_0x5381('0x10')),'data1':_0x5381('0x11'),'data2':_0x518109[_0x5381('0x12')],'data3':_0x518109['exten'],'data4':null,'data5':_0x518109[_0x5381('0x13')],'role':_0x5381('0x14'),'internal':_0x518109[_0x5381('0x15')]?_[_0x5381('0x16')](_0x518109['accountcode']):undefined,'uniqueid':_0x518109[_0x5381('0x17')]},'log':_0x5381('0x18')});};exports[_0x5381('0x19')]=function(_0x4b6f00){return client[_0x5381('0x6')]('CreateMemberReport',{'body':{'channel':_0x5381('0x7'),'membername':_0x4b6f00[_0x5381('0x1a')],'interface':_0x4b6f00['interface'],'type':_0x5381('0xd'),'enterAt':_0x4b6f00[_0x5381('0x1b')],'exitAt':_0x4b6f00[_0x5381('0x1c')],'duration':moment(_0x4b6f00['endtime'])[_0x5381('0xe')](_0x4b6f00[_0x5381('0x1b')],_0x5381('0x10'))>=0x0?moment(_0x4b6f00[_0x5381('0x1c')])[_0x5381('0xe')](_0x4b6f00[_0x5381('0x1b')],_0x5381('0x10')):null,'data1':_0x5381('0x1d'),'data2':_0x4b6f00['accountcode'],'data3':_0x4b6f00[_0x5381('0x1e')],'data4':_0x4b6f00[_0x5381('0x1f')]||null,'role':_0x5381('0x14'),'internal':_0x4b6f00[_0x5381('0x15')]?_[_0x5381('0x16')](_0x4b6f00['accountcode']):undefined,'uniqueid':_0x4b6f00[_0x5381('0x17')]},'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 f674d84..6543ae5 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 _0x1752=['name','getTemplates','Request','GetTemplate'];(function(_0x4404ff,_0x13d7a9){var _0x5e7b19=function(_0x13847a){while(--_0x13847a){_0x4404ff['push'](_0x4404ff['shift']());}};_0x5e7b19(++_0x13d7a9);}(_0x1752,0xa5));var _0x2175=function(_0xa05eee,_0x1fa6dd){_0xa05eee=_0xa05eee-0x0;var _0x4cbe96=_0x1752[_0xa05eee];return _0x4cbe96;};'use strict';var client=require('../client');exports[_0x2175('0x0')]=function(_0x1fc292){return function(_0x22d3a7){return client[_0x2175('0x1')](_0x2175('0x2'),{'options':{'raw':!![],'attributes':['id',_0x2175('0x3'),'html']},'log':_0x2175('0x2')});};}; \ No newline at end of file +var _0xcea2=['GetTemplate','name','../client','Request'];(function(_0xd79494,_0x1fcda7){var _0x1c1698=function(_0x15e012){while(--_0x15e012){_0xd79494['push'](_0xd79494['shift']());}};_0x1c1698(++_0x1fcda7);}(_0xcea2,0x15a));var _0x2cea=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xcea2[_0x3e5086];return _0xfeb102;};'use strict';var client=require(_0x2cea('0x0'));exports['getTemplates']=function(_0x2e567d){return function(_0x55d6aa){return client[_0x2cea('0x1')](_0x2cea('0x2'),{'options':{'raw':!![],'attributes':['id',_0x2cea('0x3'),'html']},'log':_0x2cea('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 14a8b8b..3f34591 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 _0x084a=['name','status','Condition','AllConditions','operator','value','AnyConditions','Action','data1','data3','data4','data6','getTriggers','Request'];(function(_0x5376c1,_0x106f0d){var _0x3335c2=function(_0x4f464a){while(--_0x4f464a){_0x5376c1['push'](_0x5376c1['shift']());}};_0x3335c2(++_0x106f0d);}(_0x084a,0x7c));var _0xa084=function(_0x3bb143,_0x1289b6){_0x3bb143=_0x3bb143-0x0;var _0x30ca9b=_0x084a[_0x3bb143];return _0x30ca9b;};'use strict';var client=require('../client');exports[_0xa084('0x0')]=function(_0xb66da1){return function(_0x3cdc66){return client[_0xa084('0x1')]('GetTrigger',{'options':{'raw':![],'attributes':['id',_0xa084('0x2'),'channel',_0xa084('0x3')],'include':[{'model':_0xa084('0x4'),'as':_0xa084('0x5'),'attributes':['id','field',_0xa084('0x6'),_0xa084('0x7')]},{'model':_0xa084('0x4'),'as':_0xa084('0x8'),'attributes':['id','field',_0xa084('0x6'),_0xa084('0x7')]},{'model':_0xa084('0x9'),'as':'Actions','attributes':['id','action',_0xa084('0xa'),'data2',_0xa084('0xb'),_0xa084('0xc'),'data5',_0xa084('0xd'),'data7']}]},'log':'GetTrigger'});};}; \ No newline at end of file +var _0x70f7=['../client','getTriggers','name','channel','status','Condition','AllConditions','field','value','AnyConditions','operator','Action','action','data1','data4','data6'];(function(_0x2f7cc0,_0xa7ddc9){var _0x42ac73=function(_0x4d41d7){while(--_0x4d41d7){_0x2f7cc0['push'](_0x2f7cc0['shift']());}};_0x42ac73(++_0xa7ddc9);}(_0x70f7,0xb0));var _0x770f=function(_0x4067ac,_0x363603){_0x4067ac=_0x4067ac-0x0;var _0x53d74d=_0x70f7[_0x4067ac];return _0x53d74d;};'use strict';var client=require(_0x770f('0x0'));exports[_0x770f('0x1')]=function(_0x513690){return function(_0x4e0817){return client['Request']('GetTrigger',{'options':{'raw':![],'attributes':['id',_0x770f('0x2'),_0x770f('0x3'),_0x770f('0x4')],'include':[{'model':_0x770f('0x5'),'as':_0x770f('0x6'),'attributes':['id',_0x770f('0x7'),'operator',_0x770f('0x8')]},{'model':_0x770f('0x5'),'as':_0x770f('0x9'),'attributes':['id',_0x770f('0x7'),_0x770f('0xa'),'value']},{'model':_0x770f('0xb'),'as':'Actions','attributes':['id',_0x770f('0xc'),_0x770f('0xd'),'data2','data3',_0x770f('0xe'),'data5',_0x770f('0xf'),'data7']}]},'log':'GetTrigger'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 37dca62..fb5c06f 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 _0xcfbc=['Request','GetTrunk','../client','getTrunks'];(function(_0xaf166b,_0x1a51cd){var _0x1585b1=function(_0xef7491){while(--_0xef7491){_0xaf166b['push'](_0xaf166b['shift']());}};_0x1585b1(++_0x1a51cd);}(_0xcfbc,0x176));var _0xccfb=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xcfbc[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0xccfb('0x0'));exports[_0xccfb('0x1')]=function(_0x294c81){return function(_0x362d4d){return client[_0xccfb('0x2')](_0xccfb('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name','registry']},'log':_0xccfb('0x3')});};}; \ No newline at end of file +var _0xb2db=['Request','GetTrunk','registry','../client'];(function(_0x40d800,_0x5c4a47){var _0x22fb2f=function(_0x558ef0){while(--_0x558ef0){_0x40d800['push'](_0x40d800['shift']());}};_0x22fb2f(++_0x5c4a47);}(_0xb2db,0x6f));var _0xbb2d=function(_0x4ebdf1,_0xe8e6e0){_0x4ebdf1=_0x4ebdf1-0x0;var _0x5dcf5b=_0xb2db[_0x4ebdf1];return _0x5dcf5b;};'use strict';var client=require(_0xbb2d('0x0'));exports['getTrunks']=function(_0x131c26){return function(_0x5b3bc9){return client[_0xbb2d('0x1')](_0xbb2d('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0xbb2d('0x3')]},'log':_0xbb2d('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index d044479..955e528 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 _0x2d6f=['getTelephones','savePause','Request','saveUnpause','UnpauseUser','getAgent','ShowUser','email','fullname','../client','GetUser','agent','name','online','lastLoginAt','pauseType','lastPauseAt','voicePause','interface','telephone','accountcode'];(function(_0x179b80,_0x440291){var _0x1e8d03=function(_0x466a71){while(--_0x466a71){_0x179b80['push'](_0x179b80['shift']());}};_0x1e8d03(++_0x440291);}(_0x2d6f,0xdb));var _0xf2d6=function(_0x1623c6,_0x5329b5){_0x1623c6=_0x1623c6-0x0;var _0x4ec94b=_0x2d6f[_0x1623c6];return _0x4ec94b;};'use strict';var client=require(_0xf2d6('0x0'));exports['getAgents']=function(){return function(){return client['Request'](_0xf2d6('0x1'),{'options':{'raw':![],'where':{'role':_0xf2d6('0x2')},'attributes':['id',_0xf2d6('0x3'),'email','accountcode','fullname',_0xf2d6('0x4'),_0xf2d6('0x5'),_0xf2d6('0x6'),_0xf2d6('0x7'),_0xf2d6('0x8'),'phone','mobile',_0xf2d6('0x9')]},'log':'getAgents'});};};exports['getTelephones']=function(){return function(){return client['Request'](_0xf2d6('0x1'),{'options':{'raw':!![],'where':{'role':_0xf2d6('0xa')},'attributes':['id','name',_0xf2d6('0xb'),'internal']},'log':_0xf2d6('0xc')});};};exports[_0xf2d6('0xd')]=function(_0x443f3e,_0x16b50c,_0x5df9c0){return client[_0xf2d6('0xe')]('PauseUser',{'body':{'type':_0x16b50c,'uniqueid':_0x5df9c0},'options':{'where':{'id':_0x443f3e['id']}},'log':_0xf2d6('0xd')});};exports[_0xf2d6('0xf')]=function(_0x59c26f){return client[_0xf2d6('0xe')](_0xf2d6('0x10'),{'body':{},'options':{'where':{'id':_0x59c26f['id']}},'log':_0xf2d6('0xd')});};exports[_0xf2d6('0x11')]=function(_0x40fc96){return client['Request'](_0xf2d6('0x12'),{'options':{'raw':![],'where':{'role':_0xf2d6('0x2'),'id':_0x40fc96},'attributes':['id',_0xf2d6('0x3'),_0xf2d6('0x13'),_0xf2d6('0xb'),_0xf2d6('0x14'),_0xf2d6('0x4'),_0xf2d6('0x5'),'pauseType',_0xf2d6('0x7'),_0xf2d6('0x8'),'interface']},'log':'getAgent'});}; \ No newline at end of file +var _0x4f41=['getAgents','Request','GetUser','agent','name','email','accountcode','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','getTelephones','telephone','internal','PauseUser','saveUnpause','savePause','getAgent','ShowUser','interface'];(function(_0x128bef,_0xc7a0af){var _0x1ba862=function(_0x4858e8){while(--_0x4858e8){_0x128bef['push'](_0x128bef['shift']());}};_0x1ba862(++_0xc7a0af);}(_0x4f41,0xa1));var _0x14f4=function(_0x27b070,_0x217d9b){_0x27b070=_0x27b070-0x0;var _0x1d8ecb=_0x4f41[_0x27b070];return _0x1d8ecb;};'use strict';var client=require('../client');exports[_0x14f4('0x0')]=function(){return function(){return client[_0x14f4('0x1')](_0x14f4('0x2'),{'options':{'raw':![],'where':{'role':_0x14f4('0x3')},'attributes':['id',_0x14f4('0x4'),_0x14f4('0x5'),_0x14f4('0x6'),_0x14f4('0x7'),_0x14f4('0x8'),_0x14f4('0x9'),_0x14f4('0xa'),_0x14f4('0xb'),_0x14f4('0xc'),_0x14f4('0xd'),'mobile','interface']},'log':_0x14f4('0x0')});};};exports[_0x14f4('0xe')]=function(){return function(){return client[_0x14f4('0x1')](_0x14f4('0x2'),{'options':{'raw':!![],'where':{'role':_0x14f4('0xf')},'attributes':['id',_0x14f4('0x4'),_0x14f4('0x6'),_0x14f4('0x10')]},'log':_0x14f4('0xe')});};};exports['savePause']=function(_0x16665c,_0x289676,_0x266405){return client[_0x14f4('0x1')](_0x14f4('0x11'),{'body':{'type':_0x289676,'uniqueid':_0x266405},'options':{'where':{'id':_0x16665c['id']}},'log':'savePause'});};exports[_0x14f4('0x12')]=function(_0x105299){return client[_0x14f4('0x1')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x105299['id']}},'log':_0x14f4('0x13')});};exports[_0x14f4('0x14')]=function(_0x19e850){return client[_0x14f4('0x1')](_0x14f4('0x15'),{'options':{'raw':![],'where':{'role':_0x14f4('0x3'),'id':_0x19e850},'attributes':['id',_0x14f4('0x4'),_0x14f4('0x5'),'accountcode',_0x14f4('0x7'),_0x14f4('0x8'),_0x14f4('0x9'),_0x14f4('0xa'),_0x14f4('0xb'),_0x14f4('0xc'),_0x14f4('0x16')]},'log':_0x14f4('0x14')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 125ce52..801a1d2 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 _0x2b29=['UpdateVoiceAgentReport','../client','create','Request','update'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0x2b29,0x6f));var _0x92b2=function(_0x6747cf,_0x1275ad){_0x6747cf=_0x6747cf-0x0;var _0x2fdf55=_0x2b29[_0x6747cf];return _0x2fdf55;};'use strict';var client=require(_0x92b2('0x0'));exports[_0x92b2('0x1')]=function(_0x1438ad){return client[_0x92b2('0x2')]('CreateVoiceAgentReport',{'body':_0x1438ad,'log':'CreateVoiceAgentReport'});};exports[_0x92b2('0x3')]=function(_0x215542,_0x13eae8,_0x421e17){return client[_0x92b2('0x2')](_0x92b2('0x4'),{'body':_0x215542,'options':{'where':{'uniqueid':_0x13eae8,'interface':_0x421e17,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});}; \ No newline at end of file +var _0x4e37=['create','Request','CreateVoiceAgentReport','UpdateVoiceAgentReport','../client'];(function(_0x41358a,_0x322144){var _0x8c40ce=function(_0x14962b){while(--_0x14962b){_0x41358a['push'](_0x41358a['shift']());}};_0x8c40ce(++_0x322144);}(_0x4e37,0x1a8));var _0x74e3=function(_0x47410f,_0x53d9b2){_0x47410f=_0x47410f-0x0;var _0x272541=_0x4e37[_0x47410f];return _0x272541;};'use strict';var client=require(_0x74e3('0x0'));exports[_0x74e3('0x1')]=function(_0x1cab04){return client[_0x74e3('0x2')](_0x74e3('0x3'),{'body':_0x1cab04,'log':_0x74e3('0x3')});};exports['update']=function(_0x2a2ce2,_0x3f2090,_0x130544){return client['Request']('UpdateVoiceAgentReport',{'body':_0x2a2ce2,'options':{'where':{'uniqueid':_0x3f2090,'interface':_0x130544,'agentcomplete':!![]}},'log':_0x74e3('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index cc8c28a..c9d7ac0 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 _0xee39=['day','format','YYYY-MM-DD\x20HH:mm:ss','disposition','billableseconds','GetVoiceCallReports','moment','util','../client','create','Request','CreateVoiceCallReport','context','callerid','DOCUMENTATION','getVoiceCallReports','outbound'];(function(_0x8cbee6,_0x167f90){var _0x4ddc1a=function(_0x549ce1){while(--_0x549ce1){_0x8cbee6['push'](_0x8cbee6['shift']());}};_0x4ddc1a(++_0x167f90);}(_0xee39,0x116));var _0x9ee3=function(_0x4116ec,_0xdeb071){_0x4116ec=_0x4116ec-0x0;var _0x5c5eaa=_0xee39[_0x4116ec];return _0x5c5eaa;};'use strict';var moment=require(_0x9ee3('0x0'));var util=require(_0x9ee3('0x1'));var _=require('lodash');var client=require(_0x9ee3('0x2'));exports[_0x9ee3('0x3')]=function(_0x1d089a){return client[_0x9ee3('0x4')](_0x9ee3('0x5'),{'body':_['merge'](_0x1d089a,{'source':_0x1d089a['calleridnum'],'destinationcontext':_0x1d089a[_0x9ee3('0x6')],'callerid':_0x1d089a[_0x9ee3('0x7')],'amaflags':_0x9ee3('0x8')}),'log':_0x9ee3('0x5')});};exports[_0x9ee3('0x9')]=function(){return function(){return client[_0x9ee3('0x4')]('GetVoiceCallReport',{'options':{'where':{'type':[_0x9ee3('0xa')],'createdAt':{'$between':[moment()['startOf'](_0x9ee3('0xb'))[_0x9ee3('0xc')](_0x9ee3('0xd')),moment()['endOf']('day')[_0x9ee3('0xc')](_0x9ee3('0xd'))]}},'attributes':['type',_0x9ee3('0xe'),'duration',_0x9ee3('0xf')]},'log':_0x9ee3('0x10')});};}; \ No newline at end of file +var _0xec9a=['callerid','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','outbound','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','disposition','duration','billableseconds','moment','util','lodash','../client','create','Request','CreateVoiceCallReport','merge','calleridnum','context'];(function(_0x3f1731,_0x1ae181){var _0x39845b=function(_0x544b09){while(--_0x544b09){_0x3f1731['push'](_0x3f1731['shift']());}};_0x39845b(++_0x1ae181);}(_0xec9a,0xd2));var _0xaec9=function(_0x56a0ea,_0x513e71){_0x56a0ea=_0x56a0ea-0x0;var _0x49dde5=_0xec9a[_0x56a0ea];return _0x49dde5;};'use strict';var moment=require(_0xaec9('0x0'));var util=require(_0xaec9('0x1'));var _=require(_0xaec9('0x2'));var client=require(_0xaec9('0x3'));exports[_0xaec9('0x4')]=function(_0x36fe71){return client[_0xaec9('0x5')](_0xaec9('0x6'),{'body':_[_0xaec9('0x7')](_0x36fe71,{'source':_0x36fe71[_0xaec9('0x8')],'destinationcontext':_0x36fe71[_0xaec9('0x9')],'callerid':_0x36fe71[_0xaec9('0xa')],'amaflags':_0xaec9('0xb')}),'log':'CreateVoiceCallReport'});};exports[_0xaec9('0xc')]=function(){return function(){return client['Request'](_0xaec9('0xd'),{'options':{'where':{'type':[_0xaec9('0xe')],'createdAt':{'$between':[moment()['startOf'](_0xaec9('0xf'))[_0xaec9('0x10')](_0xaec9('0x11')),moment()[_0xaec9('0x12')](_0xaec9('0xf'))[_0xaec9('0x10')](_0xaec9('0x11'))]}},'attributes':['type',_0xaec9('0x13'),_0xaec9('0x14'),_0xaec9('0x15')]},'log':'GetVoiceCallReports'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 1dd6763..7fe0543 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 _0x4b72=['Request','CreateVoiceDialReport','../client','create'];(function(_0x541a67,_0x50728d){var _0x45da2a=function(_0x158929){while(--_0x158929){_0x541a67['push'](_0x541a67['shift']());}};_0x45da2a(++_0x50728d);}(_0x4b72,0xd2));var _0x24b7=function(_0x4ea45b,_0x89b166){_0x4ea45b=_0x4ea45b-0x0;var _0x3cd9d9=_0x4b72[_0x4ea45b];return _0x3cd9d9;};'use strict';var client=require(_0x24b7('0x0'));exports[_0x24b7('0x1')]=function(_0x5cc4f4){return client[_0x24b7('0x2')](_0x24b7('0x3'),{'body':_0x5cc4f4,'log':_0x24b7('0x3')});}; \ No newline at end of file +var _0x207d=['Request','CreateVoiceDialReport','create'];(function(_0x33dc98,_0x322734){var _0x2849fb=function(_0x32a880){while(--_0x32a880){_0x33dc98['push'](_0x33dc98['shift']());}};_0x2849fb(++_0x322734);}(_0x207d,0x1e8));var _0xd207=function(_0x2db4d0,_0x875eaf){_0x2db4d0=_0x2db4d0-0x0;var _0x15b6d9=_0x207d[_0x2db4d0];return _0x15b6d9;};'use strict';var client=require('../client');exports[_0xd207('0x0')]=function(_0x592401){return client[_0xd207('0x1')]('CreateVoiceDialReport',{'body':_0x592401,'log':_0xd207('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index dd40c03..460945d 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 _0x128f=['Request','GetVoiceExtension','exten','recordingFormat','getVoiceExtensions'];(function(_0x2a795b,_0x94cf8){var _0xbdeae=function(_0x53c772){while(--_0x53c772){_0x2a795b['push'](_0x2a795b['shift']());}};_0xbdeae(++_0x94cf8);}(_0x128f,0xff));var _0xf128=function(_0x56a882,_0x55def2){_0x56a882=_0x56a882-0x0;var _0x28fa1e=_0x128f[_0x56a882];return _0x28fa1e;};'use strict';var client=require('../client');exports['getVoiceExtensions']=function(){return function(){return client[_0xf128('0x0')](_0xf128('0x1'),{'options':{'raw':!![],'attributes':['id',_0xf128('0x2'),_0xf128('0x3')],'where':{'VoiceExtensionId':null}},'log':_0xf128('0x4')});};}; \ No newline at end of file +var _0x4ba0=['Request','exten','recordingFormat','getVoiceExtensions','../client'];(function(_0x67f95e,_0x3ca797){var _0x538f5a=function(_0xc919e9){while(--_0xc919e9){_0x67f95e['push'](_0x67f95e['shift']());}};_0x538f5a(++_0x3ca797);}(_0x4ba0,0xe0));var _0x04ba=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0x4ba0[_0x4ae6ef];return _0x3cbb4e;};'use strict';var client=require(_0x04ba('0x0'));exports['getVoiceExtensions']=function(){return function(){return client[_0x04ba('0x1')]('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0x04ba('0x2'),_0x04ba('0x3')],'where':{'VoiceExtensionId':null}},'log':_0x04ba('0x4')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 22e424f..9386352 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 _0x03c6=['GetVoiceQueue','name','acw','acwTimeout','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialTimezone','dialGlobalInterval','dialPrefix','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallInQueue','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','active','Pause','mandatoryDispositionPause','TrunkBackup','callerid','Interval','Intervals','../client','getVoiceQueues','Request'];(function(_0x28345f,_0x5e0b82){var _0x1be19c=function(_0x529fc9){while(--_0x529fc9){_0x28345f['push'](_0x28345f['shift']());}};_0x1be19c(++_0x5e0b82);}(_0x03c6,0x13d));var _0x603c=function(_0x1e9c68,_0x171763){_0x1e9c68=_0x1e9c68-0x0;var _0x138112=_0x03c6[_0x1e9c68];return _0x138112;};'use strict';var client=require(_0x603c('0x0'));exports[_0x603c('0x1')]=function(){return function(){return client[_0x603c('0x2')](_0x603c('0x3'),{'options':{'raw':![],'attributes':['id',_0x603c('0x4'),_0x603c('0x5'),_0x603c('0x6'),'autopause',_0x603c('0x7'),_0x603c('0x8'),_0x603c('0x9'),_0x603c('0xa'),_0x603c('0xb'),_0x603c('0xc'),_0x603c('0xd'),_0x603c('0xe'),_0x603c('0xf'),_0x603c('0x10'),_0x603c('0x11'),_0x603c('0x12'),_0x603c('0x13'),'dialQueueOptions',_0x603c('0x14'),_0x603c('0x15'),_0x603c('0x16'),_0x603c('0x17'),_0x603c('0x18'),_0x603c('0x19'),'dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry',_0x603c('0x1a'),_0x603c('0x1b'),_0x603c('0x1c'),'dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence',_0x603c('0x1d'),'dialAMDAfterGreetingSilence',_0x603c('0x1e'),'dialAMDMinWordLength',_0x603c('0x1f'),_0x603c('0x20'),_0x603c('0x21'),_0x603c('0x22'),_0x603c('0x23'),'dialRecallMeTimeout',_0x603c('0x24'),'dialOrderByScheduledAt',_0x603c('0x25'),_0x603c('0x26'),_0x603c('0x27'),_0x603c('0x7'),_0x603c('0x28'),_0x603c('0x29'),_0x603c('0x2a'),_0x603c('0x2b'),_0x603c('0x2c'),_0x603c('0x2d'),_0x603c('0x2e'),_0x603c('0x2f'),_0x603c('0x30'),_0x603c('0x31'),_0x603c('0x32'),_0x603c('0x33'),_0x603c('0x34'),_0x603c('0x35'),_0x603c('0x36'),_0x603c('0x37')],'include':[{'model':_0x603c('0x38'),'as':_0x603c('0x38'),'attributes':['id',_0x603c('0x4'),'callerid',_0x603c('0x39')]},{'model':_0x603c('0x3a'),'as':_0x603c('0x3b'),'attributes':['id',_0x603c('0x4')]},{'model':_0x603c('0x38'),'as':_0x603c('0x3c'),'attributes':['id','name',_0x603c('0x3d'),_0x603c('0x39')]},{'model':_0x603c('0x3e'),'as':_0x603c('0x3e'),'attributes':['id',_0x603c('0x4')],'include':[{'model':_0x603c('0x3e'),'as':_0x603c('0x3f'),'attributes':['id','name','interval']}]}]},'log':_0x603c('0x1')});};}; \ No newline at end of file +var _0x5d1b=['dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialRecallMeTimeout','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','../client','getVoiceQueues','Request','GetVoiceQueue','name','acw','acwTimeout','monitor_format','type','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdNumber','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialCheckDuplicateType'];(function(_0x297884,_0x64d9be){var _0x37ce87=function(_0x592193){while(--_0x592193){_0x297884['push'](_0x297884['shift']());}};_0x37ce87(++_0x64d9be);}(_0x5d1b,0x132));var _0xb5d1=function(_0x31def2,_0x314684){_0x31def2=_0x31def2-0x0;var _0x2be1d3=_0x5d1b[_0x31def2];return _0x2be1d3;};'use strict';var client=require(_0xb5d1('0x0'));exports[_0xb5d1('0x1')]=function(){return function(){return client[_0xb5d1('0x2')](_0xb5d1('0x3'),{'options':{'raw':![],'attributes':['id',_0xb5d1('0x4'),_0xb5d1('0x5'),_0xb5d1('0x6'),'autopause',_0xb5d1('0x7'),_0xb5d1('0x8'),'dialActive',_0xb5d1('0x9'),_0xb5d1('0xa'),_0xb5d1('0xb'),_0xb5d1('0xc'),_0xb5d1('0xd'),_0xb5d1('0xe'),_0xb5d1('0xf'),'dialOriginateCallerIdName',_0xb5d1('0x10'),'dialOriginateTimeout','dialQueueOptions','dialQueueTimeout',_0xb5d1('0x11'),_0xb5d1('0x12'),_0xb5d1('0x13'),_0xb5d1('0x14'),'dialBusyRetryFrequency',_0xb5d1('0x15'),_0xb5d1('0x16'),'dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix',_0xb5d1('0x17'),_0xb5d1('0x18'),_0xb5d1('0x19'),_0xb5d1('0x1a'),'dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime',_0xb5d1('0x1b'),_0xb5d1('0x1c'),_0xb5d1('0x1d'),'dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout',_0xb5d1('0x1e'),'dialRecallInQueue',_0xb5d1('0x1f'),_0xb5d1('0x20'),_0xb5d1('0x21'),_0xb5d1('0x22'),_0xb5d1('0x7'),_0xb5d1('0x23'),_0xb5d1('0x24'),'dialCutDigit',_0xb5d1('0x25'),_0xb5d1('0x26'),_0xb5d1('0x27'),_0xb5d1('0x28'),'dialAbandonedMaxRetry',_0xb5d1('0x29'),_0xb5d1('0x2a'),_0xb5d1('0x2b'),'dialAgentRejectMaxRetry',_0xb5d1('0x2c'),'mandatoryDisposition',_0xb5d1('0x2d'),_0xb5d1('0x2e')],'include':[{'model':_0xb5d1('0x2f'),'as':_0xb5d1('0x2f'),'attributes':['id',_0xb5d1('0x4'),_0xb5d1('0x30'),_0xb5d1('0x31')]},{'model':_0xb5d1('0x32'),'as':_0xb5d1('0x33'),'attributes':['id',_0xb5d1('0x4')]},{'model':'Trunk','as':_0xb5d1('0x34'),'attributes':['id',_0xb5d1('0x4'),_0xb5d1('0x30'),_0xb5d1('0x31')]},{'model':_0xb5d1('0x35'),'as':_0xb5d1('0x35'),'attributes':['id',_0xb5d1('0x4')],'include':[{'model':_0xb5d1('0x35'),'as':_0xb5d1('0x36'),'attributes':['id',_0xb5d1('0x4'),'interval']}]}]},'log':_0xb5d1('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 3570302..c4288ca 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 _0x16af=['queue','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','queuecallerabandon','GetVoiceQueueReports','lodash','create','Request','CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','uniqueid'];(function(_0x2bd18f,_0x4b227e){var _0x1ea761=function(_0x17c164){while(--_0x17c164){_0x2bd18f['push'](_0x2bd18f['shift']());}};_0x1ea761(++_0x4b227e);}(_0x16af,0x121));var _0xf16a=function(_0x532a30,_0x2ef8ec){_0x532a30=_0x532a30-0x0;var _0x37c732=_0x16af[_0x532a30];return _0x37c732;};'use strict';var moment=require('moment');var _=require(_0xf16a('0x0'));var client=require('../client');exports[_0xf16a('0x1')]=function(_0x358433){return client[_0xf16a('0x2')](_0xf16a('0x3'),{'body':_0x358433,'log':_0xf16a('0x3')});};exports[_0xf16a('0x4')]=function(){return function(){return client[_0xf16a('0x2')](_0xf16a('0x5'),{'options':{'where':{'createdAt':{'$between':[moment()['startOf'](_0xf16a('0x6'))[_0xf16a('0x7')](_0xf16a('0x8')),moment()[_0xf16a('0x9')](_0xf16a('0x6'))[_0xf16a('0x7')](_0xf16a('0x8'))]}},'attributes':[_0xf16a('0xa'),_0xf16a('0xb'),_0xf16a('0xc'),_0xf16a('0xd'),_0xf16a('0xe'),_0xf16a('0xf'),_0xf16a('0x10'),_0xf16a('0x11'),_0xf16a('0x12'),'queuecallerabandonAt']},'log':_0xf16a('0x13')});};}; \ No newline at end of file +var _0x7764=['GetVoiceQueueReport','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','queue','queuecallerjoinAt','queuecallerleaveAt','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','queuecallerabandon','queuecallerabandonAt','GetVoiceQueueReports','moment','lodash','../client','create','Request','CreateVoiceQueueReport'];(function(_0x3b9570,_0x4ead31){var _0x28acdd=function(_0x59b847){while(--_0x59b847){_0x3b9570['push'](_0x3b9570['shift']());}};_0x28acdd(++_0x4ead31);}(_0x7764,0x120));var _0x4776=function(_0x303c30,_0x16edcb){_0x303c30=_0x303c30-0x0;var _0x43161b=_0x7764[_0x303c30];return _0x43161b;};'use strict';var moment=require(_0x4776('0x0'));var _=require(_0x4776('0x1'));var client=require(_0x4776('0x2'));exports[_0x4776('0x3')]=function(_0x3b8670){return client[_0x4776('0x4')]('CreateVoiceQueueReport',{'body':_0x3b8670,'log':_0x4776('0x5')});};exports['getVoiceQueueReports']=function(){return function(){return client[_0x4776('0x4')](_0x4776('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x4776('0x7')](_0x4776('0x8'))[_0x4776('0x9')](_0x4776('0xa')),moment()['endOf'](_0x4776('0x8'))[_0x4776('0x9')](_0x4776('0xa'))]}},'attributes':[_0x4776('0xb'),_0x4776('0xc'),_0x4776('0xd'),_0x4776('0xe'),'queuecallercomplete',_0x4776('0xf'),_0x4776('0x10'),_0x4776('0x11'),_0x4776('0x12'),_0x4776('0x13')]},'log':_0x4776('0x14')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueRt.js b/server/services/ami/rpc/voiceQueueRt.js index 64289bc..eca3579 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 _0xf5ce=['Request','GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses'];(function(_0x3ecf65,_0x3bac13){var _0x1907df=function(_0x247dd9){while(--_0x247dd9){_0x3ecf65['push'](_0x3ecf65['shift']());}};_0x1907df(++_0x3bac13);}(_0xf5ce,0x1e2));var _0xef5c=function(_0x13685d,_0x5644d0){_0x13685d=_0x13685d-0x0;var _0x5a442d=_0xf5ce[_0x13685d];return _0x5a442d;};'use strict';var client=require(_0xef5c('0x0'));exports[_0xef5c('0x1')]=function(_0x1b1b67){return function(){return client[_0xef5c('0x2')](_0xef5c('0x3'),{'options':{'where':{'VoiceQueueId':_0x1b1b67,'paused':!![]},'raw':!![]},'log':_0xef5c('0x1')});};}; \ No newline at end of file +var _0x3121=['GetVoiceQueueRtPauses','getVoiceQueueRtPauses'];(function(_0x42ad5b,_0x2f3b82){var _0x517d48=function(_0x570215){while(--_0x570215){_0x42ad5b['push'](_0x42ad5b['shift']());}};_0x517d48(++_0x2f3b82);}(_0x3121,0x14d));var _0x1312=function(_0x1d7c6c,_0x53d365){_0x1d7c6c=_0x1d7c6c-0x0;var _0x42f723=_0x3121[_0x1d7c6c];return _0x42f723;};'use strict';var client=require('../client');exports[_0x1312('0x0')]=function(_0x185195){return function(){return client['Request'](_0x1312('0x1'),{'options':{'where':{'VoiceQueueId':_0x185195,'paused':!![]},'raw':!![]},'log':_0x1312('0x0')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 9b5a4b5..8f99674 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 _0x1095=['merge','monitorFilename','lodash','Request','CreateVoiceRecording'];(function(_0x2d7648,_0x2140d0){var _0x1145c7=function(_0x3afbac){while(--_0x3afbac){_0x2d7648['push'](_0x2d7648['shift']());}};_0x1145c7(++_0x2140d0);}(_0x1095,0x110));var _0x5109=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x1095[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x5109('0x0'));var client=require('../client');exports['create']=function(_0x4f8c50){return client[_0x5109('0x1')](_0x5109('0x2'),{'body':_[_0x5109('0x3')](_0x4f8c50,{'value':_0x4f8c50[_0x5109('0x4')]}),'log':_0x5109('0x2')});}; \ No newline at end of file +var _0xbd36=['CreateVoiceRecording','merge','lodash','../client','create','Request'];(function(_0x42ca58,_0x423bf9){var _0x1a3a40=function(_0x1d4a8a){while(--_0x1d4a8a){_0x42ca58['push'](_0x42ca58['shift']());}};_0x1a3a40(++_0x423bf9);}(_0xbd36,0x140));var _0x6bd3=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xbd36[_0x2d7f0e];return _0x110b07;};'use strict';var _=require(_0x6bd3('0x0'));var client=require(_0x6bd3('0x1'));exports[_0x6bd3('0x2')]=function(_0x440c13){return client[_0x6bd3('0x3')](_0x6bd3('0x4'),{'body':_[_0x6bd3('0x5')](_0x440c13,{'value':_0x440c13['monitorFilename']}),'log':_0x6bd3('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index df9cb00..d64d284 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 _0x8d87=['Request','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','isexternal','context','extension','CreateVoiceTransferReport','origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetexten','transfertargetlinkedid','origtransferercontext','attended','../client','blindTransfer'];(function(_0x2459fd,_0x575d9b){var _0x364cd2=function(_0x4b22f6){while(--_0x4b22f6){_0x2459fd['push'](_0x2459fd['shift']());}};_0x364cd2(++_0x575d9b);}(_0x8d87,0x170));var _0x78d8=function(_0x4fc5df,_0x3acaab){_0x4fc5df=_0x4fc5df-0x0;var _0x4a18f5=_0x8d87[_0x4fc5df];return _0x4a18f5;};'use strict';var client=require(_0x78d8('0x0'));exports[_0x78d8('0x1')]=function(_0x599b0f){return client[_0x78d8('0x2')]('CreateVoiceTransferReport',{'body':{'result':_0x599b0f[_0x78d8('0x3')],'transfererchannel':_0x599b0f[_0x78d8('0x4')],'transferercalleridnum':_0x599b0f[_0x78d8('0x5')],'transferercalleridname':_0x599b0f[_0x78d8('0x6')],'transfererconnectedlinenum':_0x599b0f[_0x78d8('0x7')],'transfererconnectedlinename':_0x599b0f['transfererconnectedlinename'],'transfereraccountcode':_0x599b0f['transfereraccountcode'],'transferercontext':_0x599b0f['transferercontext'],'transfererexten':_0x599b0f[_0x78d8('0x8')],'transfererlinkedid':_0x599b0f[_0x78d8('0x9')],'transfereechannel':_0x599b0f[_0x78d8('0xa')],'transfereecalleridnum':_0x599b0f[_0x78d8('0xb')],'transfereecalleridname':_0x599b0f[_0x78d8('0xc')],'transfereeconnectedlinenum':_0x599b0f[_0x78d8('0xd')],'transfereeconnectedlinename':_0x599b0f[_0x78d8('0xe')],'transfereeaccountcode':_0x599b0f[_0x78d8('0xf')],'transfereecontext':_0x599b0f[_0x78d8('0x10')],'transfereeexten':_0x599b0f[_0x78d8('0x11')],'transfereelinkedid':_0x599b0f['transfereelinkedid'],'isexternal':_0x599b0f[_0x78d8('0x12')],'context':_0x599b0f[_0x78d8('0x13')],'extension':_0x599b0f[_0x78d8('0x14')],'type':'blind'},'log':_0x78d8('0x15')});};exports['attendedTransfer']=function(_0x3906ed){return client[_0x78d8('0x2')](_0x78d8('0x15'),{'body':{'result':_0x3906ed[_0x78d8('0x3')],'transfererchannel':_0x3906ed[_0x78d8('0x16')],'transferercalleridnum':_0x3906ed[_0x78d8('0x17')],'transferercalleridname':_0x3906ed['origtransferercalleridname'],'transfererconnectedlinenum':_0x3906ed[_0x78d8('0x18')],'transfererconnectedlinename':_0x3906ed['secondtransfererconnectedlinename'],'transfereraccountcode':_0x3906ed[_0x78d8('0x19')],'transferercontext':_0x3906ed[_0x78d8('0x1a')],'transfererexten':_0x3906ed[_0x78d8('0x1b')],'transfererlinkedid':_0x3906ed[_0x78d8('0x1c')],'transfereechannel':_0x3906ed['transfertargetchannel'],'transfereecalleridnum':_0x3906ed[_0x78d8('0x1d')],'transfereecalleridname':_0x3906ed[_0x78d8('0x1e')],'transfereeconnectedlinenum':_0x3906ed[_0x78d8('0x1f')],'transfereeconnectedlinename':_0x3906ed[_0x78d8('0x20')],'transfereeaccountcode':_0x3906ed['transfertargetaccountcode'],'transfereecontext':_0x3906ed['transfertargetcontext'],'transfereeexten':_0x3906ed[_0x78d8('0x21')],'transfereelinkedid':_0x3906ed[_0x78d8('0x22')],'isexternal':_0x3906ed[_0x78d8('0x12')],'context':_0x3906ed[_0x78d8('0x23')],'extension':_0x3906ed['origtransfererexten'],'type':_0x78d8('0x24')},'log':_0x78d8('0x15')});}; \ No newline at end of file +var _0xc55f=['transfererexten','transfereechannel','transfereecalleridnum','transfereecontext','transfereeexten','context','extension','blind','attendedTransfer','origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetaccountcode','transfertargetcontext','transfertargetlinkedid','isexternal','origtransferercontext','origtransfererexten','attended','../client','blindTransfer','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext'];(function(_0x59458d,_0x43e3d3){var _0x4a3a97=function(_0x85313e){while(--_0x85313e){_0x59458d['push'](_0x59458d['shift']());}};_0x4a3a97(++_0x43e3d3);}(_0xc55f,0x1ed));var _0xfc55=function(_0x145a12,_0x2dbb68){_0x145a12=_0x145a12-0x0;var _0xb424b4=_0xc55f[_0x145a12];return _0xb424b4;};'use strict';var client=require(_0xfc55('0x0'));exports[_0xfc55('0x1')]=function(_0x5666b2){return client[_0xfc55('0x2')](_0xfc55('0x3'),{'body':{'result':_0x5666b2[_0xfc55('0x4')],'transfererchannel':_0x5666b2[_0xfc55('0x5')],'transferercalleridnum':_0x5666b2[_0xfc55('0x6')],'transferercalleridname':_0x5666b2['transferercalleridname'],'transfererconnectedlinenum':_0x5666b2[_0xfc55('0x7')],'transfererconnectedlinename':_0x5666b2[_0xfc55('0x8')],'transfereraccountcode':_0x5666b2[_0xfc55('0x9')],'transferercontext':_0x5666b2[_0xfc55('0xa')],'transfererexten':_0x5666b2[_0xfc55('0xb')],'transfererlinkedid':_0x5666b2['transfererlinkedid'],'transfereechannel':_0x5666b2[_0xfc55('0xc')],'transfereecalleridnum':_0x5666b2[_0xfc55('0xd')],'transfereecalleridname':_0x5666b2['transfereecalleridname'],'transfereeconnectedlinenum':_0x5666b2['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x5666b2['transfereeconnectedlinename'],'transfereeaccountcode':_0x5666b2['transfereeaccountcode'],'transfereecontext':_0x5666b2[_0xfc55('0xe')],'transfereeexten':_0x5666b2[_0xfc55('0xf')],'transfereelinkedid':_0x5666b2['transfereelinkedid'],'isexternal':_0x5666b2['isexternal'],'context':_0x5666b2[_0xfc55('0x10')],'extension':_0x5666b2[_0xfc55('0x11')],'type':_0xfc55('0x12')},'log':_0xfc55('0x3')});};exports[_0xfc55('0x13')]=function(_0xd3213a){return client[_0xfc55('0x2')](_0xfc55('0x3'),{'body':{'result':_0xd3213a['result'],'transfererchannel':_0xd3213a[_0xfc55('0x14')],'transferercalleridnum':_0xd3213a[_0xfc55('0x15')],'transferercalleridname':_0xd3213a['origtransferercalleridname'],'transfererconnectedlinenum':_0xd3213a[_0xfc55('0x16')],'transfererconnectedlinename':_0xd3213a['secondtransfererconnectedlinename'],'transfereraccountcode':_0xd3213a[_0xfc55('0x17')],'transferercontext':_0xd3213a['secondtransferercontext'],'transfererexten':_0xd3213a[_0xfc55('0x18')],'transfererlinkedid':_0xd3213a[_0xfc55('0x19')],'transfereechannel':_0xd3213a[_0xfc55('0x1a')],'transfereecalleridnum':_0xd3213a[_0xfc55('0x1b')],'transfereecalleridname':_0xd3213a[_0xfc55('0x1c')],'transfereeconnectedlinenum':_0xd3213a['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0xd3213a['transfertargetconnectedlinename'],'transfereeaccountcode':_0xd3213a[_0xfc55('0x1d')],'transfereecontext':_0xd3213a[_0xfc55('0x1e')],'transfereeexten':_0xd3213a['transfertargetexten'],'transfereelinkedid':_0xd3213a[_0xfc55('0x1f')],'isexternal':_0xd3213a[_0xfc55('0x20')],'context':_0xd3213a[_0xfc55('0x21')],'extension':_0xd3213a[_0xfc55('0x22')],'type':_0xfc55('0x23')},'log':_0xfc55('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index e1e688c..1c44e2e 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 _0x641a=['bluebird','moment','../../../config/environment','../properties','format','%s/%s','SIP','name','timers','timer','updateAcw','updateStatusRealtime','pause','QueuePause','isConnected','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','Reload','Action','then','message','catch','error','command','Command','content','voiceQueues','answered','available','loggedIn','pTalking','sumDuration','sumHoldTime','talking','total','type','unmanaged','waiting','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','length','values','channels','voicechannel','map','find','uniqueid','channel','%s.%s','filename','MixMonitor','monitors','/var/spool/asterisk/monitor/','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','status','wav','StopMixMonitor\x20Success','queueChannels','voicequeuechannelhangup','voicequeuechannelredirect','exten','context','agents','telephones','campaigns','Event\x20name\x20mandatory','custom:','faxAccounts','send','checkAfterSend','server','http','listen','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','jayson/promise','validate'];(function(_0x5ecadc,_0x1cf9f1){var _0x565037=function(_0x22908b){while(--_0x22908b){_0x5ecadc['push'](_0x5ecadc['shift']());}};_0x565037(++_0x1cf9f1);}(_0x641a,0x101));var _0xa641=function(_0x5b7786,_0xe47b5c){_0x5b7786=_0x5b7786-0x0;var _0x5882ab=_0x641a[_0x5b7786];return _0x5882ab;};'use strict';var _=require(_0xa641('0x0'));var util=require('util');var jayson=require(_0xa641('0x1'));var schema=require(_0xa641('0x2'));var BPromise=require(_0xa641('0x3'));var moment=require(_0xa641('0x4'));var config=require(_0xa641('0x5'));var properties=require(_0xa641('0x6'));var ami=require('../ami');exports['listen']=function(_0x174ff1,_0x1e02cb,_0x43f046){return new BPromise(function(_0x55847f,_0x2b1d41){var _0x17ea56={'QueuePause':function(_0x5b5676){return new Promise(function(_0x50fcd4,_0x2a5f24){var _0x31f589=util[_0xa641('0x7')](_0xa641('0x8'),_0xa641('0x9'),_0x5b5676[_0xa641('0xa')]);if(_0x174ff1[_0xa641('0xb')]&&_0x174ff1[_0xa641('0xb')][_0x31f589]&&_0x174ff1['timers'][_0x31f589][_0xa641('0xc')]){_0x174ff1[_0xa641('0xb')][_0x31f589][_0xa641('0xd')]();}if(_0x174ff1['agents'][_0x31f589]){_0x174ff1['agents'][_0x31f589][_0xa641('0xe')]({'statePause':_0x5b5676[_0xa641('0xf')]?!![]:![]});}_0x50fcd4({'code':0xc8,'message':_0xa641('0x10')});});},'Reload':function(_0x5d0d32){var _0x3354ff=this;return new Promise(function(_0x3631a2,_0x6e41a9){if(ami[_0xa641('0x11')]()==![]){return _0x6e41a9(_0x3354ff['error'](0x1f4,[config[_0xa641('0x12')]['ip'],config[_0xa641('0x12')][_0xa641('0x13')],_0xa641('0x14')][_0xa641('0x15')]('\x20')));}_0x5d0d32=_[_0xa641('0x16')](_0x5d0d32,_[_0xa641('0x17')](properties[_0xa641('0x18')]));_0x5d0d32[_0xa641('0x19')]=_0xa641('0x1a');return ami[_0xa641('0x1b')](_0x5d0d32)[_0xa641('0x1c')](function(_0x1221e3){_0x3631a2({'code':0xc8,'message':_0x1221e3[_0xa641('0x1d')]});})[_0xa641('0x1e')](function(_0x544050){_0x6e41a9(_0x3354ff[_0xa641('0x1f')](0x1f5,_0x544050['message']));});});},'Command':function(_0x6bec4a){var _0x4fdbdb=this;return new Promise(function(_0x26d1e8,_0x644765){if(ami[_0xa641('0x11')]()==![]){return _0x644765(_0x4fdbdb[_0xa641('0x1f')](0x1f4,[config[_0xa641('0x12')]['ip'],config[_0xa641('0x12')]['username'],_0xa641('0x14')][_0xa641('0x15')]('\x20')));}_0x6bec4a=_[_0xa641('0x16')](_0x6bec4a,_0xa641('0x20'));_0x6bec4a['action']=_0xa641('0x21');return ami[_0xa641('0x1b')](_0x6bec4a)[_0xa641('0x1c')](function(_0x5dd0ae){_0x26d1e8({'code':0xc8,'message':_0x5dd0ae[_0xa641('0x22')]});})[_0xa641('0x1e')](function(_0x403300){_0x644765(_0x4fdbdb[_0xa641('0x1f')](0x1f5,_0x403300['message']));});});},'VoiceQueues':function(_0x26eaca){return new Promise(function(_0x2f4f14,_0x24c021){var _0x35607b=[];for(var _0x17cf5b in _0x174ff1[_0xa641('0x23')]){if(_0x174ff1['voiceQueues']['hasOwnProperty'](_0x17cf5b)){var _0x30ec7b=_0x174ff1[_0xa641('0x23')][_0x17cf5b];var _0x289f58={'id':_0x30ec7b['id'],'name':_0x30ec7b[_0xa641('0xa')],'strategy':_0x30ec7b['strategy'],'answered':_0x30ec7b[_0xa641('0x24')],'available':_0x30ec7b[_0xa641('0x25')],'loggedIn':_0x30ec7b[_0xa641('0x26')],'pTalking':_0x30ec7b[_0xa641('0x27')],'sumBillable':_0x30ec7b['sumBillable'],'sumDuration':_0x30ec7b[_0xa641('0x28')],'sumHoldTime':_0x30ec7b[_0xa641('0x29')]||0x0,'talking':_0x30ec7b[_0xa641('0x2a')],'total':_0x30ec7b[_0xa641('0x2b')],'type':_0x30ec7b[_0xa641('0x2c')],'unmanaged':_0x30ec7b[_0xa641('0x2d')],'abandoned':_0x30ec7b['abandoned'],'waiting':_0x30ec7b[_0xa641('0x2e')],'loggedInDb':_0x30ec7b[_0xa641('0x2f')]};if(_0x30ec7b[_0xa641('0x2c')]===_0xa641('0x30')){_0x289f58[_0xa641('0x31')]=_0x30ec7b[_0xa641('0x31')];_0x289f58[_0xa641('0x32')]=_0x30ec7b[_0xa641('0x32')];_0x289f58[_0xa641('0x33')]=_0x30ec7b[_0xa641('0x33')];_0x289f58[_0xa641('0x34')]=_0x30ec7b['dialOriginateCallerIdNumber'];_0x289f58[_0xa641('0x35')]=_0x30ec7b[_0xa641('0x35')];_0x289f58['dialPrefix']=_0x30ec7b['dialPrefix'];_0x289f58['outboundAnswerAgiCallsDay']=_0x30ec7b[_0xa641('0x36')];_0x289f58[_0xa641('0x37')]=_0x30ec7b[_0xa641('0x37')];_0x289f58['outboundBlacklistCallsDay']=_0x30ec7b[_0xa641('0x38')];_0x289f58[_0xa641('0x39')]=_0x30ec7b[_0xa641('0x39')];_0x289f58['outboundCongestionCallsDay']=_0x30ec7b['outboundCongestionCallsDay'];_0x289f58[_0xa641('0x3a')]=_0x30ec7b[_0xa641('0x3a')];_0x289f58[_0xa641('0x3b')]=_0x30ec7b[_0xa641('0x3b')];_0x289f58['outboundDropCallsDayTimeout']=_0x30ec7b['outboundDropCallsDayTimeout'];_0x289f58[_0xa641('0x3c')]=_0x30ec7b['outboundNoAnswerCallsDay'];_0x289f58['outboundNoSuchCallsDay']=_0x30ec7b[_0xa641('0x3d')];_0x289f58['outboundOriginateFailureCallsDay']=_0x30ec7b[_0xa641('0x3e')];_0x289f58[_0xa641('0x3f')]=_0x30ec7b[_0xa641('0x3f')];_0x289f58['outboundRejectCallsDay']=_0x30ec7b[_0xa641('0x40')];_0x289f58[_0xa641('0x41')]=_0x30ec7b['outboundUnknownCallsDay'];_0x289f58[_0xa641('0x42')]=_0x30ec7b[_0xa641('0x42')];_0x289f58['predictiveIntervalAvgHoldtime']=_0x30ec7b['predictiveIntervalAvgHoldtime'];_0x289f58[_0xa641('0x43')]=_0x30ec7b[_0xa641('0x43')];_0x289f58[_0xa641('0x44')]=_0x30ec7b[_0xa641('0x44')];_0x289f58[_0xa641('0x45')]=_0x30ec7b['predictiveIntervalDroppedCallsTimeout'];_0x289f58[_0xa641('0x46')]=_0x30ec7b[_0xa641('0x46')];_0x289f58['predictiveIntervalErlangCallsDroppedCalls']=_0x30ec7b[_0xa641('0x47')];_0x289f58[_0xa641('0x48')]=_0x30ec7b[_0xa641('0x48')];_0x289f58[_0xa641('0x49')]=_0x30ec7b[_0xa641('0x49')];_0x289f58['predictiveIntervalPauses']=_0x30ec7b['predictiveIntervalPauses'];_0x289f58['predictiveIntervalAvailable']=_0x30ec7b[_0xa641('0x4a')];_0x289f58[_0xa641('0x4b')]=_0x30ec7b[_0xa641('0x4b')];_0x289f58['message']=_0x30ec7b[_0xa641('0x1d')];_0x289f58[_0xa641('0x4c')]=_0x30ec7b[_0xa641('0x4c')];_0x289f58['erlangCalls']=_0x30ec7b['erlangCalls'];_0x289f58[_0xa641('0x4d')]=_0x30ec7b[_0xa641('0x4d')];_0x289f58[_0xa641('0x4e')]=_0x30ec7b[_0xa641('0x4e')];_0x289f58[_0xa641('0x4f')]=_0x30ec7b[_0xa641('0x4f')];_0x289f58[_0xa641('0x50')]=_0x30ec7b['startPredictive'];_0x289f58['startProgressive']=_0x30ec7b[_0xa641('0x51')];}if(_0x30ec7b['Trunk']){_0x289f58[_0xa641('0x52')]={'id':_0x30ec7b['Trunk']['id'],'name':_0x30ec7b['Trunk']['name'],'active':_0x30ec7b['Trunk'][_0xa641('0x53')],'callerid':_0x30ec7b[_0xa641('0x52')][_0xa641('0x54')]};}if(_0x30ec7b[_0xa641('0x55')]){_0x289f58[_0xa641('0x55')]={'id':_0x30ec7b['Interval']['id'],'name':_0x30ec7b[_0xa641('0x55')][_0xa641('0xa')]};}_0x35607b[_0xa641('0x56')](_0x289f58);}}_0x2f4f14({'count':_0x35607b[_0xa641('0x57')],'rows':_0x35607b});});},'VoiceChannels':function(_0x598099){return new Promise(function(_0x411eaf,_0x5a782d){var _0x3352c9=_[_0xa641('0x58')](_0x174ff1[_0xa641('0x59')]);_0x411eaf({'count':_0x3352c9[_0xa641('0x57')],'rows':_0x3352c9});});},'VoiceChannelMixMonitor':function(_0x17b34a){var _0x4974af=this;return new Promise(function(_0x4da4b9,_0x348891){if(ami[_0xa641('0x11')]()==![]){return _0x348891(_0x4974af[_0xa641('0x1f')](0x1f4,[config[_0xa641('0x12')]['ip'],config[_0xa641('0x12')]['username'],_0xa641('0x14')]['join']('\x20')));}var _0x25543c=schema(properties[_0xa641('0x5a')])[_0xa641('0x2')](_0x17b34a);if(_0x25543c[_0xa641('0x57')]>0x0){return _0x348891(_0x4974af[_0xa641('0x1f')](0x1f4,_[_0xa641('0x5b')](_0x25543c,_0xa641('0x1d'))[_0xa641('0x15')](',\x20')));}var _0x28225f=_[_0xa641('0x5c')](_0x174ff1[_0xa641('0x59')],{'uniqueid':_0x17b34a[_0xa641('0x5d')]});if(_0x28225f&&_0x28225f[_0xa641('0x5e')]){var _0x4e8131=util[_0xa641('0x7')](_0xa641('0x5f'),_0x17b34a[_0xa641('0x60')]||_0x17b34a['uniqueid'],_0x17b34a['format']||'wav');return ami[_0xa641('0x1b')]({'action':_0xa641('0x61'),'channel':_0x28225f[_0xa641('0x5e')],'file':_0x4e8131,'options':'ai(mixmonitorid)'})[_0xa641('0x1c')](function(_0x29d987){var _0x2ffb7e=_[_0xa641('0x5c')](_0x28225f[_0xa641('0x62')],{'filename':_0xa641('0x63')+_0x4e8131['toLowerCase']()});if(_['isNil'](_0x2ffb7e)){_0x28225f[_0xa641('0x62')]['push']({'filename':_0xa641('0x63')+_0x4e8131[_0xa641('0x64')](),'createdAt':moment()[_0xa641('0x7')](_0xa641('0x65')),'mixmonitorid':_0x29d987[_0xa641('0x66')],'status':_0xa641('0x67')});}else{_0x2ffb7e[_0xa641('0x66')]=_0x29d987['mixmonitorid'];_0x2ffb7e['status']=_0xa641('0x67');}_0x4da4b9({'code':0xc8,'message':[_0x17b34a[_0xa641('0x5d')],'MixMonitor\x20Success',_0x29d987['mixmonitorid']]['join']('\x20'),'mixmonitorid':_0x29d987['mixmonitorid']});})[_0xa641('0x1e')](function(_0x3ab760){_0x348891(_0x4974af['error'](0x1f5,[_0x17b34a[_0xa641('0x5d')],_0x3ab760['message'][_0xa641('0x64')]()][_0xa641('0x15')]('\x20')));});}else{return _0x348891(_0x4974af[_0xa641('0x1f')](0x1f5,_0xa641('0x68')));}});},'VoiceChannelStopMixMonitor':function(_0x26f877){var _0x3a92c2=this;return new Promise(function(_0x378d41,_0x35de45){if(ami[_0xa641('0x11')]()==![]){return _0x35de45(_0x3a92c2['error'](0x1f4,[config[_0xa641('0x12')]['ip'],config[_0xa641('0x12')][_0xa641('0x13')],'ami\x20disconnected'][_0xa641('0x15')]('\x20')));}var _0x282c15=schema(properties[_0xa641('0x5a')])[_0xa641('0x2')](_0x26f877);if(_0x282c15['length']>0x0){return _0x35de45(_0x3a92c2[_0xa641('0x1f')](0x1f4,_[_0xa641('0x5b')](_0x282c15,'message')[_0xa641('0x15')](',\x20')));}var _0x58bbe4=_[_0xa641('0x5c')](_0x174ff1[_0xa641('0x59')],{'uniqueid':_0x26f877[_0xa641('0x5d')]});if(_0x58bbe4){return BPromise[_0xa641('0x69')]()[_0xa641('0x1c')](function(){if(_0x58bbe4[_0xa641('0x5e')]){return ami['Action']({'action':_0xa641('0x6a'),'channel':_0x58bbe4['channel'],'mixmonitorid':_0x26f877[_0xa641('0x66')]})[_0xa641('0x1e')](function(_0x59fe01){});}})[_0xa641('0x1c')](function(){if(_0x58bbe4['destinationchannel']){return ami[_0xa641('0x1b')]({'action':_0xa641('0x6a'),'channel':_0x58bbe4[_0xa641('0x6b')],'mixmonitorid':_0x26f877[_0xa641('0x66')]})['catch'](function(_0x412fd3){});}})[_0xa641('0x1c')](function(_0x2f4227){var _0x33c2ea=_[_0xa641('0x5c')](_0x58bbe4[_0xa641('0x62')],{'mixmonitorid':_0x26f877[_0xa641('0x66')]});if(_0x33c2ea){_0x33c2ea[_0xa641('0x6c')]='stop';}})[_0xa641('0x1c')](function(){var _0x2cbfda=util[_0xa641('0x7')](_0xa641('0x5f'),_0x26f877[_0xa641('0x60')]||_0x26f877[_0xa641('0x5d')],_0x26f877['format']||_0xa641('0x6d'));var _0x45d43a=_[_0xa641('0x5c')](_0x58bbe4[_0xa641('0x62')],{'filename':_0xa641('0x63')+_0x2cbfda['toLowerCase']()});if(_0x45d43a){_0x45d43a[_0xa641('0x6c')]='stop';}})['then'](function(){_0x378d41({'code':0xc8,'message':[_0x26f877[_0xa641('0x5d')],_0xa641('0x6e')]['join']('\x20')});})[_0xa641('0x1e')](function(_0x41fcf4){_0x35de45(_0x3a92c2[_0xa641('0x1f')](0x1f5,[_0x26f877[_0xa641('0x5d')],_0x41fcf4[_0xa641('0x1d')][_0xa641('0x64')]()][_0xa641('0x15')]('\x20')));});}else{return _0x35de45(_0x3a92c2[_0xa641('0x1f')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannels':function(_0x4e5fa6){return new Promise(function(_0x1e3ff7,_0x32a779){var _0x38ccea=_[_0xa641('0x58')](_0x174ff1[_0xa641('0x6f')]);_0x1e3ff7({'count':_0x38ccea['length'],'rows':_0x38ccea});});},'VoiceQueuesChannel':function(_0x43beb3){var _0x138bef=this;return new Promise(function(_0x4a76a1,_0x4f0b55){var _0x1b1b22=schema(properties['voicequeuechannel'])[_0xa641('0x2')](_0x43beb3);if(_0x1b1b22['length']>0x0){return _0x4f0b55(_0x138bef[_0xa641('0x1f')](0x1f4,_['map'](_0x1b1b22,_0xa641('0x1d'))['join'](',\x20')));}var _0xae26c3=_[_0xa641('0x5c')](_0x174ff1['queueChannels'],{'uniqueid':_0x43beb3[_0xa641('0x5d')]});if(_0xae26c3){_0x4a76a1(_0xae26c3);}else{return _0x4f0b55(_0x138bef[_0xa641('0x1f')](0x1f5,_0xa641('0x68')));}});},'VoiceQueuesChannelHangup':function(_0x38f180){var _0x1f0e83=this;return new Promise(function(_0x690af0,_0x35746f){if(ami['isConnected']()==![]){return _0x35746f(_0x1f0e83[_0xa641('0x1f')](0x1f4,[config[_0xa641('0x12')]['ip'],config[_0xa641('0x12')]['username'],_0xa641('0x14')][_0xa641('0x15')]('\x20')));}var _0x429304=schema(properties[_0xa641('0x70')])[_0xa641('0x2')](_0x38f180);if(_0x429304[_0xa641('0x57')]>0x0){return _0x35746f(_0x1f0e83[_0xa641('0x1f')](0x1f4,_['map'](_0x429304,'message')['join'](',\x20')));}var _0x11e80d=_[_0xa641('0x5c')](_0x174ff1[_0xa641('0x6f')],{'uniqueid':_0x38f180[_0xa641('0x5d')]});if(_0x11e80d&&_0x11e80d[_0xa641('0x5e')]){return ami[_0xa641('0x1b')]({'action':'Hangup','channel':_0x11e80d[_0xa641('0x5e')]})[_0xa641('0x1c')](function(_0x5bbe8b){_0x690af0({'code':0xc8,'message':[_0x38f180[_0xa641('0x5d')],_0x5bbe8b[_0xa641('0x1d')]['toLowerCase']()]['join']('\x20')});})[_0xa641('0x1e')](function(_0x257039){_0x35746f(_0x1f0e83[_0xa641('0x1f')](0x1f5,[_0x38f180['uniqueid'],_0x257039[_0xa641('0x1d')][_0xa641('0x64')]()][_0xa641('0x15')]('\x20')));});}else{return _0x35746f(_0x1f0e83[_0xa641('0x1f')](0x1f5,_0xa641('0x68')));}});},'VoiceQueuesChannelRedirect':function(_0x5091ba){var _0x404dd8=this;return new Promise(function(_0x25299a,_0x3c7d3c){if(ami[_0xa641('0x11')]()==![]){return _0x3c7d3c(_0x404dd8['error'](0x1f4,[config[_0xa641('0x12')]['ip'],config[_0xa641('0x12')][_0xa641('0x13')],_0xa641('0x14')][_0xa641('0x15')]('\x20')));}var _0x32575c=schema(properties[_0xa641('0x71')])[_0xa641('0x2')](_0x5091ba);if(_0x32575c[_0xa641('0x57')]>0x0){return _0x3c7d3c(_0x404dd8[_0xa641('0x1f')](0x1f4,_[_0xa641('0x5b')](_0x32575c,'message')[_0xa641('0x15')](',\x20')));}var _0x4ef31b=_['find'](_0x174ff1[_0xa641('0x6f')],{'uniqueid':_0x5091ba['uniqueid']});if(_0x4ef31b&&_0x4ef31b[_0xa641('0x5e')]){return ami[_0xa641('0x1b')]({'action':'Redirect','channel':_0x4ef31b[_0xa641('0x5e')],'exten':_0x5091ba[_0xa641('0x72')],'context':_0x5091ba[_0xa641('0x73')]||_0x4ef31b['context'],'priority':0x1})[_0xa641('0x1c')](function(_0x2d3496){_0x25299a({'code':0xc8,'message':[_0x5091ba[_0xa641('0x5d')],_0x2d3496[_0xa641('0x1d')][_0xa641('0x64')]()][_0xa641('0x15')]('\x20')});})[_0xa641('0x1e')](function(_0x1b09ee){_0x3c7d3c(_0x404dd8[_0xa641('0x1f')](0x1f5,[_0x5091ba[_0xa641('0x5d')],_0x1b09ee[_0xa641('0x1d')]['toLowerCase']()][_0xa641('0x15')]('\x20')));});}else{return _0x3c7d3c(_0x404dd8[_0xa641('0x1f')](0x1f5,_0xa641('0x68')));}});},'Agents':function(_0x6d7322){return new Promise(function(_0x4992d9,_0x25a7d5){var _0xe4bd0b=_[_0xa641('0x58')](_0x174ff1[_0xa641('0x74')]);_0x4992d9({'count':_0xe4bd0b[_0xa641('0x57')],'rows':_0xe4bd0b});});},'Telephones':function(_0x5911d8){return new Promise(function(_0x49f372,_0x5f1f55){var _0x3e68f5=_[_0xa641('0x58')](_0x174ff1[_0xa641('0x75')]);_0x49f372({'count':_0x3e68f5[_0xa641('0x57')],'rows':_0x3e68f5});});},'Trunks':function(_0x3e58b4){return new Promise(function(_0xd58ec5,_0x3c3fcb){var _0x291154=_[_0xa641('0x58')](_0x174ff1['trunks']);_0xd58ec5({'count':_0x291154[_0xa641('0x57')],'rows':_0x291154});});},'OutboundChannels':function(_0x5320a4){return new Promise(function(_0x217d50,_0x5f4636){var _0x4c0031=_[_0xa641('0x58')](_0x174ff1['outboundChannels']);_0x217d50({'count':_0x4c0031[_0xa641('0x57')],'rows':_0x4c0031});});},'Outbound':function(_0x442dad){return new Promise(function(_0x224637,_0x11cd52){_0x224637(_0x174ff1[_0xa641('0x30')]);});},'Campaigns':function(_0x1d5457){return new Promise(function(_0x4458b7,_0x3481ab){var _0x2b6c11=_[_0xa641('0x58')](_0x174ff1[_0xa641('0x76')]);_0x4458b7({'count':_0x2b6c11[_0xa641('0x57')],'rows':_0x2b6c11});});},'VoiceQueuesPreview':function(_0x3ff43d){var _0x317331=this;return new Promise(function(_0xcad486,_0x6720e7){_0x1e02cb['run'](_0x3ff43d['id'])['then'](function(_0x5c0187){_0xcad486({'code':0xc8,'message':_0x5c0187['message']});})[_0xa641('0x1e')](function(_0x1a548f){_0x6720e7(_0x317331['error'](0x1f4,_0x1a548f[_0xa641('0x1d')]));});});},'EventManager':function(_0x2de7f6){var _0x4b0c16=this;return new Promise(function(_0x3b0687,_0x29ac7c){if(!_0x2de7f6['event']){return _0x29ac7c(_0x4b0c16[_0xa641('0x1f')](0x1f4,_0xa641('0x77')));}ami['emit'](_0xa641('0x78')+_0x2de7f6['event'],_0x2de7f6[_0xa641('0x1d')]);_0x3b0687({'code':0xc8,'message':_0x2de7f6});});},'FaxAccounts':function(_0xd64c8a){return new Promise(function(_0x1b60d1,_0x59dcdd){var _0x527f67=_[_0xa641('0x58')](_0x174ff1[_0xa641('0x79')]);_0x1b60d1({'count':_0x527f67[_0xa641('0x57')],'rows':_0x527f67});});},'SendFax':function(_0x295aff){var _0x12bb10=this;return new Promise(function(_0x2eb7ff,_0x5efc8c){_0x43f046[_0xa641('0x7a')](_0x295aff)[_0xa641('0x1c')](function(_0x3e8992){_0x2eb7ff({'code':0xc8,'message':_0x3e8992['message']});})[_0xa641('0x1e')](function(_0x3705c2){_0x5efc8c(_0x12bb10[_0xa641('0x1f')](0x1f4,_0x3705c2[_0xa641('0x1d')]));});});},'CheckAfterSend':function(_0x55f15f){var _0x1aa13b=this;return new Promise(function(_0x466b51,_0x5c77b6){_0x43f046[_0xa641('0x7b')](_0x55f15f)[_0xa641('0x1c')](function(_0x23b1ca){_0x466b51({'code':0xc8,'message':_0x23b1ca[_0xa641('0x1d')]});})[_0xa641('0x1e')](function(_0x3ed29c){_0x5c77b6(_0x1aa13b[_0xa641('0x1f')](0x1f4,_0x3ed29c[_0xa641('0x1d')]));});});}};var _0x598471=jayson[_0xa641('0x7c')](_0x17ea56)[_0xa641('0x7d')]();_0x598471['on'](_0xa641('0x1f'),function(_0x3ec3f9){return _0x2b1d41(_0x3ec3f9);});_0x598471[_0xa641('0x7e')](0x232a,_0xa641('0x7f'),function(){console[_0xa641('0x80')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x55847f(_0xa641('0x81')+0x232a);});});}; \ No newline at end of file +var _0x2b43=['event','faxAccounts','send','checkAfterSend','server','http','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','jayson/promise','bluebird','../../../config/environment','../properties','../ami','listen','format','%s/%s','SIP','timers','timer','updateAcw','agents','updateStatusRealtime','pause','QueuePause','error','asterisk','username','ami\x20disconnected','join','keys','module','Reload','Action','then','message','isConnected','command','action','content','catch','voiceQueues','hasOwnProperty','strategy','answered','available','loggedIn','sumBillable','sumDuration','sumHoldTime','total','type','unmanaged','abandoned','waiting','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','name','active','callerid','Interval','push','length','values','channels','voicechannel','validate','find','uniqueid','channel','filename','wav','MixMonitor','isNil','monitors','/var/spool/asterisk/monitor/','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','resolve','StopMixMonitor','destinationchannel','stop','status','voicequeuechannel','map','queueChannels','Channel\x20doesn\x27t\x20exist','Redirect','exten','context','telephones','trunks','outboundChannels','campaigns','run','Event\x20name\x20mandatory','emit','custom:'];(function(_0x39152a,_0x5517d2){var _0x58e3e7=function(_0x14f950){while(--_0x14f950){_0x39152a['push'](_0x39152a['shift']());}};_0x58e3e7(++_0x5517d2);}(_0x2b43,0x93));var _0x32b4=function(_0x43bf64,_0x151ce4){_0x43bf64=_0x43bf64-0x0;var _0x2560f3=_0x2b43[_0x43bf64];return _0x2560f3;};'use strict';var _=require(_0x32b4('0x0'));var util=require(_0x32b4('0x1'));var jayson=require(_0x32b4('0x2'));var schema=require('validate');var BPromise=require(_0x32b4('0x3'));var moment=require('moment');var config=require(_0x32b4('0x4'));var properties=require(_0x32b4('0x5'));var ami=require(_0x32b4('0x6'));exports[_0x32b4('0x7')]=function(_0x31f4d7,_0x5b175f,_0x4163af){return new BPromise(function(_0x368850,_0x5ced0c){var _0x158cac={'QueuePause':function(_0x2a6fbe){return new Promise(function(_0x3828a3,_0x28294b){var _0x1c870f=util[_0x32b4('0x8')](_0x32b4('0x9'),_0x32b4('0xa'),_0x2a6fbe['name']);if(_0x31f4d7[_0x32b4('0xb')]&&_0x31f4d7['timers'][_0x1c870f]&&_0x31f4d7[_0x32b4('0xb')][_0x1c870f][_0x32b4('0xc')]){_0x31f4d7[_0x32b4('0xb')][_0x1c870f][_0x32b4('0xd')]();}if(_0x31f4d7['agents'][_0x1c870f]){_0x31f4d7[_0x32b4('0xe')][_0x1c870f][_0x32b4('0xf')]({'statePause':_0x2a6fbe[_0x32b4('0x10')]?!![]:![]});}_0x3828a3({'code':0xc8,'message':_0x32b4('0x11')});});},'Reload':function(_0x2f8d93){var _0x2259e2=this;return new Promise(function(_0x2fc2bd,_0x31bb65){if(ami['isConnected']()==![]){return _0x31bb65(_0x2259e2[_0x32b4('0x12')](0x1f4,[config['asterisk']['ip'],config[_0x32b4('0x13')][_0x32b4('0x14')],_0x32b4('0x15')][_0x32b4('0x16')]('\x20')));}_0x2f8d93=_['pick'](_0x2f8d93,_[_0x32b4('0x17')](properties[_0x32b4('0x18')]));_0x2f8d93['action']=_0x32b4('0x19');return ami[_0x32b4('0x1a')](_0x2f8d93)[_0x32b4('0x1b')](function(_0x29e4be){_0x2fc2bd({'code':0xc8,'message':_0x29e4be[_0x32b4('0x1c')]});})['catch'](function(_0x2c379f){_0x31bb65(_0x2259e2['error'](0x1f5,_0x2c379f[_0x32b4('0x1c')]));});});},'Command':function(_0x4e5553){var _0x1c628d=this;return new Promise(function(_0x4477e3,_0x474975){if(ami[_0x32b4('0x1d')]()==![]){return _0x474975(_0x1c628d[_0x32b4('0x12')](0x1f4,[config['asterisk']['ip'],config[_0x32b4('0x13')][_0x32b4('0x14')],_0x32b4('0x15')][_0x32b4('0x16')]('\x20')));}_0x4e5553=_['pick'](_0x4e5553,_0x32b4('0x1e'));_0x4e5553[_0x32b4('0x1f')]='Command';return ami[_0x32b4('0x1a')](_0x4e5553)[_0x32b4('0x1b')](function(_0x357f8d){_0x4477e3({'code':0xc8,'message':_0x357f8d[_0x32b4('0x20')]});})[_0x32b4('0x21')](function(_0x17d69b){_0x474975(_0x1c628d[_0x32b4('0x12')](0x1f5,_0x17d69b[_0x32b4('0x1c')]));});});},'VoiceQueues':function(_0x26e4ec){return new Promise(function(_0x5ad4d9,_0x1b702b){var _0x3ae366=[];for(var _0x1fd712 in _0x31f4d7[_0x32b4('0x22')]){if(_0x31f4d7[_0x32b4('0x22')][_0x32b4('0x23')](_0x1fd712)){var _0x48861d=_0x31f4d7['voiceQueues'][_0x1fd712];var _0x5f3038={'id':_0x48861d['id'],'name':_0x48861d['name'],'strategy':_0x48861d[_0x32b4('0x24')],'answered':_0x48861d[_0x32b4('0x25')],'available':_0x48861d[_0x32b4('0x26')],'loggedIn':_0x48861d[_0x32b4('0x27')],'pTalking':_0x48861d['pTalking'],'sumBillable':_0x48861d[_0x32b4('0x28')],'sumDuration':_0x48861d[_0x32b4('0x29')],'sumHoldTime':_0x48861d[_0x32b4('0x2a')]||0x0,'talking':_0x48861d['talking'],'total':_0x48861d[_0x32b4('0x2b')],'type':_0x48861d[_0x32b4('0x2c')],'unmanaged':_0x48861d[_0x32b4('0x2d')],'abandoned':_0x48861d[_0x32b4('0x2e')],'waiting':_0x48861d[_0x32b4('0x2f')],'loggedInDb':_0x48861d[_0x32b4('0x30')]};if(_0x48861d[_0x32b4('0x2c')]===_0x32b4('0x31')){_0x5f3038['dialActive']=_0x48861d[_0x32b4('0x32')];_0x5f3038[_0x32b4('0x33')]=_0x48861d['dialMethod'];_0x5f3038[_0x32b4('0x34')]=_0x48861d[_0x32b4('0x34')];_0x5f3038[_0x32b4('0x35')]=_0x48861d[_0x32b4('0x35')];_0x5f3038[_0x32b4('0x36')]=_0x48861d[_0x32b4('0x36')];_0x5f3038[_0x32b4('0x37')]=_0x48861d[_0x32b4('0x37')];_0x5f3038['outboundAnswerAgiCallsDay']=_0x48861d[_0x32b4('0x38')];_0x5f3038['outboundAnswerCallsDay']=_0x48861d[_0x32b4('0x39')];_0x5f3038[_0x32b4('0x3a')]=_0x48861d[_0x32b4('0x3a')];_0x5f3038[_0x32b4('0x3b')]=_0x48861d[_0x32b4('0x3b')];_0x5f3038[_0x32b4('0x3c')]=_0x48861d['outboundCongestionCallsDay'];_0x5f3038['outboundDropCallsDayACS']=_0x48861d[_0x32b4('0x3d')];_0x5f3038[_0x32b4('0x3e')]=_0x48861d[_0x32b4('0x3e')];_0x5f3038[_0x32b4('0x3f')]=_0x48861d[_0x32b4('0x3f')];_0x5f3038['outboundNoAnswerCallsDay']=_0x48861d[_0x32b4('0x40')];_0x5f3038['outboundNoSuchCallsDay']=_0x48861d[_0x32b4('0x41')];_0x5f3038[_0x32b4('0x42')]=_0x48861d[_0x32b4('0x42')];_0x5f3038[_0x32b4('0x43')]=_0x48861d[_0x32b4('0x43')];_0x5f3038[_0x32b4('0x44')]=_0x48861d['outboundRejectCallsDay'];_0x5f3038[_0x32b4('0x45')]=_0x48861d[_0x32b4('0x45')];_0x5f3038[_0x32b4('0x46')]=_0x48861d[_0x32b4('0x46')];_0x5f3038['predictiveIntervalAvgHoldtime']=_0x48861d['predictiveIntervalAvgHoldtime'];_0x5f3038[_0x32b4('0x47')]=_0x48861d[_0x32b4('0x47')];_0x5f3038[_0x32b4('0x48')]=_0x48861d[_0x32b4('0x48')];_0x5f3038[_0x32b4('0x49')]=_0x48861d[_0x32b4('0x49')];_0x5f3038[_0x32b4('0x4a')]=_0x48861d['predictiveIntervalErlangCalls'];_0x5f3038['predictiveIntervalErlangCallsDroppedCalls']=_0x48861d[_0x32b4('0x4b')];_0x5f3038['predictiveIntervalHitRate']=_0x48861d['predictiveIntervalHitRate'];_0x5f3038[_0x32b4('0x4c')]=_0x48861d[_0x32b4('0x4c')];_0x5f3038['predictiveIntervalPauses']=_0x48861d[_0x32b4('0x4d')];_0x5f3038[_0x32b4('0x4e')]=_0x48861d[_0x32b4('0x4e')];_0x5f3038[_0x32b4('0x4f')]=_0x48861d[_0x32b4('0x4f')];_0x5f3038['message']=_0x48861d[_0x32b4('0x1c')];_0x5f3038['originated']=_0x48861d[_0x32b4('0x50')];_0x5f3038[_0x32b4('0x51')]=_0x48861d['erlangCalls'];_0x5f3038[_0x32b4('0x52')]=_0x48861d[_0x32b4('0x52')];_0x5f3038[_0x32b4('0x53')]=_0x48861d[_0x32b4('0x53')];_0x5f3038[_0x32b4('0x54')]=_0x48861d[_0x32b4('0x54')];_0x5f3038[_0x32b4('0x55')]=_0x48861d[_0x32b4('0x55')];_0x5f3038['startProgressive']=_0x48861d[_0x32b4('0x56')];}if(_0x48861d[_0x32b4('0x57')]){_0x5f3038['Trunk']={'id':_0x48861d[_0x32b4('0x57')]['id'],'name':_0x48861d[_0x32b4('0x57')][_0x32b4('0x58')],'active':_0x48861d[_0x32b4('0x57')][_0x32b4('0x59')],'callerid':_0x48861d[_0x32b4('0x57')][_0x32b4('0x5a')]};}if(_0x48861d[_0x32b4('0x5b')]){_0x5f3038[_0x32b4('0x5b')]={'id':_0x48861d[_0x32b4('0x5b')]['id'],'name':_0x48861d['Interval'][_0x32b4('0x58')]};}_0x3ae366[_0x32b4('0x5c')](_0x5f3038);}}_0x5ad4d9({'count':_0x3ae366[_0x32b4('0x5d')],'rows':_0x3ae366});});},'VoiceChannels':function(_0x30220e){return new Promise(function(_0x113f26,_0x2a911b){var _0x3b3978=_[_0x32b4('0x5e')](_0x31f4d7[_0x32b4('0x5f')]);_0x113f26({'count':_0x3b3978['length'],'rows':_0x3b3978});});},'VoiceChannelMixMonitor':function(_0x4e3496){var _0x542415=this;return new Promise(function(_0xf95c7,_0x12be82){if(ami['isConnected']()==![]){return _0x12be82(_0x542415['error'](0x1f4,[config['asterisk']['ip'],config[_0x32b4('0x13')][_0x32b4('0x14')],_0x32b4('0x15')][_0x32b4('0x16')]('\x20')));}var _0x5e4168=schema(properties[_0x32b4('0x60')])[_0x32b4('0x61')](_0x4e3496);if(_0x5e4168['length']>0x0){return _0x12be82(_0x542415[_0x32b4('0x12')](0x1f4,_['map'](_0x5e4168,_0x32b4('0x1c'))[_0x32b4('0x16')](',\x20')));}var _0x36f9cf=_[_0x32b4('0x62')](_0x31f4d7[_0x32b4('0x5f')],{'uniqueid':_0x4e3496[_0x32b4('0x63')]});if(_0x36f9cf&&_0x36f9cf[_0x32b4('0x64')]){var _0x3d3240=util['format']('%s.%s',_0x4e3496[_0x32b4('0x65')]||_0x4e3496[_0x32b4('0x63')],_0x4e3496[_0x32b4('0x8')]||_0x32b4('0x66'));return ami['Action']({'action':_0x32b4('0x67'),'channel':_0x36f9cf['channel'],'file':_0x3d3240,'options':'ai(mixmonitorid)'})['then'](function(_0x43d0f9){var _0x9aa086=_['find'](_0x36f9cf['monitors'],{'filename':'/var/spool/asterisk/monitor/'+_0x3d3240['toLowerCase']()});if(_[_0x32b4('0x68')](_0x9aa086)){_0x36f9cf[_0x32b4('0x69')]['push']({'filename':_0x32b4('0x6a')+_0x3d3240[_0x32b4('0x6b')](),'createdAt':moment()['format'](_0x32b4('0x6c')),'mixmonitorid':_0x43d0f9[_0x32b4('0x6d')],'status':_0x32b4('0x6e')});}else{_0x9aa086[_0x32b4('0x6d')]=_0x43d0f9[_0x32b4('0x6d')];_0x9aa086['status']=_0x32b4('0x6e');}_0xf95c7({'code':0xc8,'message':[_0x4e3496['uniqueid'],'MixMonitor\x20Success',_0x43d0f9['mixmonitorid']][_0x32b4('0x16')]('\x20'),'mixmonitorid':_0x43d0f9['mixmonitorid']});})['catch'](function(_0x20f966){_0x12be82(_0x542415[_0x32b4('0x12')](0x1f5,[_0x4e3496[_0x32b4('0x63')],_0x20f966[_0x32b4('0x1c')][_0x32b4('0x6b')]()][_0x32b4('0x16')]('\x20')));});}else{return _0x12be82(_0x542415[_0x32b4('0x12')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x5dee90){var _0x3433af=this;return new Promise(function(_0x59161b,_0x12e671){if(ami[_0x32b4('0x1d')]()==![]){return _0x12e671(_0x3433af[_0x32b4('0x12')](0x1f4,[config[_0x32b4('0x13')]['ip'],config[_0x32b4('0x13')][_0x32b4('0x14')],_0x32b4('0x15')][_0x32b4('0x16')]('\x20')));}var _0x30ad79=schema(properties['voicechannel'])[_0x32b4('0x61')](_0x5dee90);if(_0x30ad79[_0x32b4('0x5d')]>0x0){return _0x12e671(_0x3433af[_0x32b4('0x12')](0x1f4,_['map'](_0x30ad79,'message')[_0x32b4('0x16')](',\x20')));}var _0x231a6b=_['find'](_0x31f4d7[_0x32b4('0x5f')],{'uniqueid':_0x5dee90[_0x32b4('0x63')]});if(_0x231a6b){return BPromise[_0x32b4('0x6f')]()[_0x32b4('0x1b')](function(){if(_0x231a6b[_0x32b4('0x64')]){return ami[_0x32b4('0x1a')]({'action':_0x32b4('0x70'),'channel':_0x231a6b[_0x32b4('0x64')],'mixmonitorid':_0x5dee90[_0x32b4('0x6d')]})[_0x32b4('0x21')](function(_0x1f84dc){});}})['then'](function(){if(_0x231a6b[_0x32b4('0x71')]){return ami[_0x32b4('0x1a')]({'action':_0x32b4('0x70'),'channel':_0x231a6b[_0x32b4('0x71')],'mixmonitorid':_0x5dee90[_0x32b4('0x6d')]})[_0x32b4('0x21')](function(_0x393bf0){});}})[_0x32b4('0x1b')](function(_0x14511d){var _0x59fb01=_[_0x32b4('0x62')](_0x231a6b[_0x32b4('0x69')],{'mixmonitorid':_0x5dee90[_0x32b4('0x6d')]});if(_0x59fb01){_0x59fb01['status']=_0x32b4('0x72');}})['then'](function(){var _0x10f145=util[_0x32b4('0x8')]('%s.%s',_0x5dee90['filename']||_0x5dee90['uniqueid'],_0x5dee90[_0x32b4('0x8')]||_0x32b4('0x66'));var _0x104bff=_[_0x32b4('0x62')](_0x231a6b[_0x32b4('0x69')],{'filename':_0x32b4('0x6a')+_0x10f145[_0x32b4('0x6b')]()});if(_0x104bff){_0x104bff[_0x32b4('0x73')]=_0x32b4('0x72');}})['then'](function(){_0x59161b({'code':0xc8,'message':[_0x5dee90[_0x32b4('0x63')],'StopMixMonitor\x20Success'][_0x32b4('0x16')]('\x20')});})[_0x32b4('0x21')](function(_0xe59c9f){_0x12e671(_0x3433af[_0x32b4('0x12')](0x1f5,[_0x5dee90[_0x32b4('0x63')],_0xe59c9f[_0x32b4('0x1c')][_0x32b4('0x6b')]()][_0x32b4('0x16')]('\x20')));});}else{return _0x12e671(_0x3433af[_0x32b4('0x12')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannels':function(_0x5d9a65){return new Promise(function(_0x46e60b,_0x8b4a52){var _0x3fd87f=_['values'](_0x31f4d7['queueChannels']);_0x46e60b({'count':_0x3fd87f[_0x32b4('0x5d')],'rows':_0x3fd87f});});},'VoiceQueuesChannel':function(_0x51c057){var _0x4cf215=this;return new Promise(function(_0x1e937c,_0x3476f5){var _0x503fe7=schema(properties[_0x32b4('0x74')])[_0x32b4('0x61')](_0x51c057);if(_0x503fe7[_0x32b4('0x5d')]>0x0){return _0x3476f5(_0x4cf215[_0x32b4('0x12')](0x1f4,_[_0x32b4('0x75')](_0x503fe7,'message')[_0x32b4('0x16')](',\x20')));}var _0x19bd3a=_[_0x32b4('0x62')](_0x31f4d7[_0x32b4('0x76')],{'uniqueid':_0x51c057[_0x32b4('0x63')]});if(_0x19bd3a){_0x1e937c(_0x19bd3a);}else{return _0x3476f5(_0x4cf215['error'](0x1f5,_0x32b4('0x77')));}});},'VoiceQueuesChannelHangup':function(_0x465839){var _0x45bd42=this;return new Promise(function(_0x3a2906,_0x33d3f1){if(ami[_0x32b4('0x1d')]()==![]){return _0x33d3f1(_0x45bd42[_0x32b4('0x12')](0x1f4,[config['asterisk']['ip'],config[_0x32b4('0x13')][_0x32b4('0x14')],_0x32b4('0x15')][_0x32b4('0x16')]('\x20')));}var _0x2db54c=schema(properties['voicequeuechannelhangup'])[_0x32b4('0x61')](_0x465839);if(_0x2db54c[_0x32b4('0x5d')]>0x0){return _0x33d3f1(_0x45bd42[_0x32b4('0x12')](0x1f4,_['map'](_0x2db54c,'message')[_0x32b4('0x16')](',\x20')));}var _0x529e15=_['find'](_0x31f4d7[_0x32b4('0x76')],{'uniqueid':_0x465839[_0x32b4('0x63')]});if(_0x529e15&&_0x529e15[_0x32b4('0x64')]){return ami[_0x32b4('0x1a')]({'action':'Hangup','channel':_0x529e15[_0x32b4('0x64')]})[_0x32b4('0x1b')](function(_0x4b61de){_0x3a2906({'code':0xc8,'message':[_0x465839[_0x32b4('0x63')],_0x4b61de[_0x32b4('0x1c')][_0x32b4('0x6b')]()][_0x32b4('0x16')]('\x20')});})[_0x32b4('0x21')](function(_0x3b12ec){_0x33d3f1(_0x45bd42[_0x32b4('0x12')](0x1f5,[_0x465839[_0x32b4('0x63')],_0x3b12ec[_0x32b4('0x1c')][_0x32b4('0x6b')]()][_0x32b4('0x16')]('\x20')));});}else{return _0x33d3f1(_0x45bd42[_0x32b4('0x12')](0x1f5,_0x32b4('0x77')));}});},'VoiceQueuesChannelRedirect':function(_0x48deb9){var _0x319c88=this;return new Promise(function(_0x454fa4,_0x54ea2a){if(ami[_0x32b4('0x1d')]()==![]){return _0x54ea2a(_0x319c88[_0x32b4('0x12')](0x1f4,[config[_0x32b4('0x13')]['ip'],config[_0x32b4('0x13')][_0x32b4('0x14')],_0x32b4('0x15')][_0x32b4('0x16')]('\x20')));}var _0xcfbd8e=schema(properties['voicequeuechannelredirect'])['validate'](_0x48deb9);if(_0xcfbd8e[_0x32b4('0x5d')]>0x0){return _0x54ea2a(_0x319c88[_0x32b4('0x12')](0x1f4,_[_0x32b4('0x75')](_0xcfbd8e,_0x32b4('0x1c'))[_0x32b4('0x16')](',\x20')));}var _0x51c00e=_[_0x32b4('0x62')](_0x31f4d7[_0x32b4('0x76')],{'uniqueid':_0x48deb9[_0x32b4('0x63')]});if(_0x51c00e&&_0x51c00e[_0x32b4('0x64')]){return ami[_0x32b4('0x1a')]({'action':_0x32b4('0x78'),'channel':_0x51c00e[_0x32b4('0x64')],'exten':_0x48deb9[_0x32b4('0x79')],'context':_0x48deb9[_0x32b4('0x7a')]||_0x51c00e[_0x32b4('0x7a')],'priority':0x1})[_0x32b4('0x1b')](function(_0xb48408){_0x454fa4({'code':0xc8,'message':[_0x48deb9[_0x32b4('0x63')],_0xb48408[_0x32b4('0x1c')]['toLowerCase']()]['join']('\x20')});})['catch'](function(_0x1bfb6f){_0x54ea2a(_0x319c88[_0x32b4('0x12')](0x1f5,[_0x48deb9[_0x32b4('0x63')],_0x1bfb6f['message'][_0x32b4('0x6b')]()][_0x32b4('0x16')]('\x20')));});}else{return _0x54ea2a(_0x319c88[_0x32b4('0x12')](0x1f5,_0x32b4('0x77')));}});},'Agents':function(_0x19a398){return new Promise(function(_0x3a162a,_0x8a9149){var _0x44c053=_['values'](_0x31f4d7[_0x32b4('0xe')]);_0x3a162a({'count':_0x44c053[_0x32b4('0x5d')],'rows':_0x44c053});});},'Telephones':function(_0x370d14){return new Promise(function(_0x4571e0,_0x43f8a9){var _0x2c6403=_[_0x32b4('0x5e')](_0x31f4d7[_0x32b4('0x7b')]);_0x4571e0({'count':_0x2c6403[_0x32b4('0x5d')],'rows':_0x2c6403});});},'Trunks':function(_0x3c331d){return new Promise(function(_0x56ace9,_0xdb8434){var _0x567e8c=_['values'](_0x31f4d7[_0x32b4('0x7c')]);_0x56ace9({'count':_0x567e8c[_0x32b4('0x5d')],'rows':_0x567e8c});});},'OutboundChannels':function(_0x4efcc2){return new Promise(function(_0x1dae0e,_0x585c05){var _0x26c632=_[_0x32b4('0x5e')](_0x31f4d7[_0x32b4('0x7d')]);_0x1dae0e({'count':_0x26c632[_0x32b4('0x5d')],'rows':_0x26c632});});},'Outbound':function(_0x362278){return new Promise(function(_0x1b1144,_0x1fab03){_0x1b1144(_0x31f4d7[_0x32b4('0x31')]);});},'Campaigns':function(_0x258096){return new Promise(function(_0x18c22e,_0xdf0e72){var _0x13cb46=_[_0x32b4('0x5e')](_0x31f4d7[_0x32b4('0x7e')]);_0x18c22e({'count':_0x13cb46[_0x32b4('0x5d')],'rows':_0x13cb46});});},'VoiceQueuesPreview':function(_0x271b41){var _0x2b5872=this;return new Promise(function(_0x352540,_0x5702aa){_0x5b175f[_0x32b4('0x7f')](_0x271b41['id'])[_0x32b4('0x1b')](function(_0x5f0e57){_0x352540({'code':0xc8,'message':_0x5f0e57[_0x32b4('0x1c')]});})[_0x32b4('0x21')](function(_0x323207){_0x5702aa(_0x2b5872['error'](0x1f4,_0x323207[_0x32b4('0x1c')]));});});},'EventManager':function(_0x521ecd){var _0x5313a1=this;return new Promise(function(_0x50d306,_0x4a966f){if(!_0x521ecd['event']){return _0x4a966f(_0x5313a1['error'](0x1f4,_0x32b4('0x80')));}ami[_0x32b4('0x81')](_0x32b4('0x82')+_0x521ecd[_0x32b4('0x83')],_0x521ecd['message']);_0x50d306({'code':0xc8,'message':_0x521ecd});});},'FaxAccounts':function(_0xbfa7dc){return new Promise(function(_0x36410e,_0x572565){var _0x31c607=_[_0x32b4('0x5e')](_0x31f4d7[_0x32b4('0x84')]);_0x36410e({'count':_0x31c607[_0x32b4('0x5d')],'rows':_0x31c607});});},'SendFax':function(_0x520ea6){var _0x3ac123=this;return new Promise(function(_0x598c96,_0x1a7e0d){_0x4163af[_0x32b4('0x85')](_0x520ea6)[_0x32b4('0x1b')](function(_0x47584d){_0x598c96({'code':0xc8,'message':_0x47584d[_0x32b4('0x1c')]});})[_0x32b4('0x21')](function(_0x5bc92a){_0x1a7e0d(_0x3ac123[_0x32b4('0x12')](0x1f4,_0x5bc92a[_0x32b4('0x1c')]));});});},'CheckAfterSend':function(_0x5e7433){var _0x31a857=this;return new Promise(function(_0x3006c7,_0x528f28){_0x4163af[_0x32b4('0x86')](_0x5e7433)[_0x32b4('0x1b')](function(_0x3f4066){_0x3006c7({'code':0xc8,'message':_0x3f4066[_0x32b4('0x1c')]});})[_0x32b4('0x21')](function(_0x24f610){_0x528f28(_0x31a857['error'](0x1f4,_0x24f610[_0x32b4('0x1c')]));});});}};var _0x41a193=jayson[_0x32b4('0x87')](_0x158cac)[_0x32b4('0x88')]();_0x41a193['on']('error',function(_0x51a00d){return _0x5ced0c(_0x51a00d);});_0x41a193['listen'](0x232a,'127.0.0.1',function(){console[_0x32b4('0x89')](_0x32b4('0x8a'),0x232a);return _0x368850('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 7b21f2a..c5cf1d9 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 _0xa6ce=['lodash','ioredis','../../../../config/logger','trigger','defaults','redis','localhost','socket.io-emitter','info','stringify','emit','exec','autoCreate','data2','data1','calleridnum','routeId','firstName','calleridname','','uniqueid','destcalleridname','destcalleridnum','resolve','then','showContact','omit','xmd-contactid2','format','user:%s','action','merge','createContact','trigger:%s','toLowerCase','catch','Error\x20creating\x20contact','name','bluebird'];(function(_0x2595ed,_0x4047f2){var _0x5ed73b=function(_0x109380){while(--_0x109380){_0x2595ed['push'](_0x2595ed['shift']());}};_0x5ed73b(++_0x4047f2);}(_0xa6ce,0x15e));var _0xea6c=function(_0x45d1fd,_0x463212){_0x45d1fd=_0x45d1fd-0x0;var _0xd0e542=_0xa6ce[_0x45d1fd];return _0xd0e542;};'use strict';var BPromise=require(_0xea6c('0x0'));var util=require('util');var _=require(_0xea6c('0x1'));var Redis=require(_0xea6c('0x2'));var config=require('../../../../config/environment');var logger=require(_0xea6c('0x3'))(_0xea6c('0x4'));var cmContactRpc=require('../../rpc/cmContact');config['redis']=_[_0xea6c('0x5')](config[_0xea6c('0x6')],{'host':_0xea6c('0x7'),'port':0x18eb});var io=require(_0xea6c('0x8'))(new Redis(config[_0xea6c('0x6')]));function emit(_0x8a751f,_0x5c3ba1,_0x2af078){logger[_0xea6c('0x9')](_0x8a751f,_0x5c3ba1,JSON[_0xea6c('0xa')](_0x2af078));io['to'](_0x8a751f)[_0xea6c('0xb')](_0x5c3ba1,_0x2af078);}exports[_0xea6c('0xc')]=function(_0x227f1c,_0x3bf4d2,_0x44a1ba){_0x44a1ba[_0xea6c('0xd')]=0x0;if(_0x3bf4d2[_0xea6c('0xe')]&&parseInt(_0x3bf4d2[_0xea6c('0xe')],0xa)){var _0xb1e8b5={'ListId':parseInt(_0x3bf4d2[_0xea6c('0xf')],0xa),'phone':_0x44a1ba[_0xea6c('0x10')]};if(_['isNil'](_0x44a1ba[_0xea6c('0x11')])){_0xb1e8b5[_0xea6c('0x12')]=_0x44a1ba[_0xea6c('0x13')]&&_0x44a1ba['calleridname']!==_0xea6c('0x14')?_0x44a1ba[_0xea6c('0x13')]:_0x44a1ba['calleridnum']||_0x44a1ba[_0xea6c('0x15')];}else{_0xb1e8b5[_0xea6c('0x12')]=_0x44a1ba[_0xea6c('0x16')]&&_0x44a1ba[_0xea6c('0x16')]!==_0xea6c('0x14')?_0x44a1ba[_0xea6c('0x16')]:_0x44a1ba['destcalleridnum']||_0x44a1ba[_0xea6c('0x15')];_0xb1e8b5['phone']=_0x44a1ba[_0xea6c('0x16')]&&_0x44a1ba[_0xea6c('0x16')]!==_0xea6c('0x14')?_0x44a1ba[_0xea6c('0x16')]:_0x44a1ba[_0xea6c('0x17')]||_0x44a1ba['uniqueid'];}BPromise[_0xea6c('0x18')]()[_0xea6c('0x19')](cmContactRpc[_0xea6c('0x1a')]({'where':_[_0xea6c('0x1b')](_0xb1e8b5,[_0xea6c('0x12')])}))[_0xea6c('0x19')](function(_0x43a03a){if(_0x43a03a){_0x44a1ba[_0xea6c('0x1c')]=_0x43a03a['id'];emit(util[_0xea6c('0x1d')](_0xea6c('0x1e'),_0x227f1c['name']),util[_0xea6c('0x1d')]('trigger:%s',_0x3bf4d2[_0xea6c('0x1f')]['toLowerCase']()),_[_0xea6c('0x20')](_0x44a1ba,{'ListId':parseInt(_0x3bf4d2[_0xea6c('0xf')],0xa)}));return;}else{return BPromise[_0xea6c('0x18')]()['then'](cmContactRpc[_0xea6c('0x21')](_0xb1e8b5));}})[_0xea6c('0x19')](function(_0x499ea6){if(_0x499ea6){_0x44a1ba['xmd-contactid2']=_0x499ea6['id'];emit(util[_0xea6c('0x1d')]('user:%s',_0x227f1c['name']),util[_0xea6c('0x1d')](_0xea6c('0x22'),_0x3bf4d2[_0xea6c('0x1f')][_0xea6c('0x23')]()),_[_0xea6c('0x20')](_0x44a1ba,{'ListId':parseInt(_0x3bf4d2['data1'],0xa)}));}})[_0xea6c('0x24')](function(_0x565358){logger['error'](_0xea6c('0x25'),JSON['stringify'](_0x565358));});}else{if(_0x227f1c){emit(util[_0xea6c('0x1d')](_0xea6c('0x1e'),_0x227f1c[_0xea6c('0x26')]),util[_0xea6c('0x1d')](_0xea6c('0x22'),_0x3bf4d2[_0xea6c('0x1f')][_0xea6c('0x23')]()),_[_0xea6c('0x20')]({'ListId':parseInt(_0x3bf4d2[_0xea6c('0xf')],0xa)},_0x44a1ba));}}}; \ No newline at end of file +var _0xb458=['user:%s','name','trigger:%s','action','toLowerCase','merge','catch','Error\x20creating\x20contact','bluebird','util','lodash','../../../../config/logger','../../rpc/cmContact','redis','defaults','socket.io-emitter','emit','exec','autoCreate','data2','data1','calleridnum','isNil','routeId','firstName','calleridname','','uniqueid','destcalleridname','destcalleridnum','phone','omit','then','xmd-contactid2','format'];(function(_0x3c2e13,_0x16507c){var _0x69202b=function(_0xfecc26){while(--_0xfecc26){_0x3c2e13['push'](_0x3c2e13['shift']());}};_0x69202b(++_0x16507c);}(_0xb458,0x94));var _0x8b45=function(_0x52f3fa,_0x432d38){_0x52f3fa=_0x52f3fa-0x0;var _0x240e29=_0xb458[_0x52f3fa];return _0x240e29;};'use strict';var BPromise=require(_0x8b45('0x0'));var util=require(_0x8b45('0x1'));var _=require(_0x8b45('0x2'));var Redis=require('ioredis');var config=require('../../../../config/environment');var logger=require(_0x8b45('0x3'))('trigger');var cmContactRpc=require(_0x8b45('0x4'));config[_0x8b45('0x5')]=_[_0x8b45('0x6')](config[_0x8b45('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x8b45('0x7'))(new Redis(config[_0x8b45('0x5')]));function emit(_0x97a203,_0x24e0bc,_0x3d3381){logger['info'](_0x97a203,_0x24e0bc,JSON['stringify'](_0x3d3381));io['to'](_0x97a203)[_0x8b45('0x8')](_0x24e0bc,_0x3d3381);}exports[_0x8b45('0x9')]=function(_0x12171b,_0x2a9c49,_0x16ad9a){_0x16ad9a[_0x8b45('0xa')]=0x0;if(_0x2a9c49[_0x8b45('0xb')]&&parseInt(_0x2a9c49[_0x8b45('0xb')],0xa)){var _0x5a53df={'ListId':parseInt(_0x2a9c49[_0x8b45('0xc')],0xa),'phone':_0x16ad9a[_0x8b45('0xd')]};if(_[_0x8b45('0xe')](_0x16ad9a[_0x8b45('0xf')])){_0x5a53df[_0x8b45('0x10')]=_0x16ad9a[_0x8b45('0x11')]&&_0x16ad9a['calleridname']!==_0x8b45('0x12')?_0x16ad9a[_0x8b45('0x11')]:_0x16ad9a[_0x8b45('0xd')]||_0x16ad9a[_0x8b45('0x13')];}else{_0x5a53df[_0x8b45('0x10')]=_0x16ad9a['destcalleridname']&&_0x16ad9a[_0x8b45('0x14')]!==_0x8b45('0x12')?_0x16ad9a[_0x8b45('0x14')]:_0x16ad9a[_0x8b45('0x15')]||_0x16ad9a[_0x8b45('0x13')];_0x5a53df[_0x8b45('0x16')]=_0x16ad9a[_0x8b45('0x14')]&&_0x16ad9a['destcalleridname']!==''?_0x16ad9a[_0x8b45('0x14')]:_0x16ad9a[_0x8b45('0x15')]||_0x16ad9a[_0x8b45('0x13')];}BPromise['resolve']()['then'](cmContactRpc['showContact']({'where':_[_0x8b45('0x17')](_0x5a53df,[_0x8b45('0x10')])}))[_0x8b45('0x18')](function(_0x5390d7){if(_0x5390d7){_0x16ad9a[_0x8b45('0x19')]=_0x5390d7['id'];emit(util[_0x8b45('0x1a')](_0x8b45('0x1b'),_0x12171b[_0x8b45('0x1c')]),util[_0x8b45('0x1a')](_0x8b45('0x1d'),_0x2a9c49[_0x8b45('0x1e')][_0x8b45('0x1f')]()),_[_0x8b45('0x20')](_0x16ad9a,{'ListId':parseInt(_0x2a9c49[_0x8b45('0xc')],0xa)}));return;}else{return BPromise['resolve']()[_0x8b45('0x18')](cmContactRpc['createContact'](_0x5a53df));}})['then'](function(_0x4f5355){if(_0x4f5355){_0x16ad9a[_0x8b45('0x19')]=_0x4f5355['id'];emit(util[_0x8b45('0x1a')](_0x8b45('0x1b'),_0x12171b[_0x8b45('0x1c')]),util[_0x8b45('0x1a')]('trigger:%s',_0x2a9c49[_0x8b45('0x1e')][_0x8b45('0x1f')]()),_['merge'](_0x16ad9a,{'ListId':parseInt(_0x2a9c49[_0x8b45('0xc')],0xa)}));}})[_0x8b45('0x21')](function(_0x28fba8){logger['error'](_0x8b45('0x22'),JSON['stringify'](_0x28fba8));});}else{if(_0x12171b){emit(util[_0x8b45('0x1a')](_0x8b45('0x1b'),_0x12171b[_0x8b45('0x1c')]),util[_0x8b45('0x1a')]('trigger:%s',_0x2a9c49[_0x8b45('0x1e')]['toLowerCase']()),_[_0x8b45('0x20')]({'ListId':parseInt(_0x2a9c49[_0x8b45('0xc')],0xa)},_0x16ad9a));}}}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 608dba7..31cdb24 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 _0x396c=['data6','600','winApplication','winArguments','format','trigger:%s:%s','user:%s','name','trigger:%s','exec','integration','accounts','routeId','urlforward','script','search','replace','AllConditions','every','channel','AnyConditions','some','checkConditions','field','account','chat','operator','value','ChatWebsiteId','upperFirst','AccountId','message','event','queue','agent','membername','lastevent','exports','util','lodash','url','ioredis','./urlforward','./integration','./cmContact','./script','../rpc/cmContact','../../../config/environment','../../../config/logger','../ami','redis','defaults','socket.io-emitter','popup','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','bind','custom:agentconnect','syncCustomEvent','custom:agentringnoanswer','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:closedinteraction','custom:outgoingmessage','custom:acceptmessage','prototype','emit','info','stringify','clone','checkTriggers','hasOwnProperty','status','checkTrigger','merge','variables','Actions','length','interface','action','toLowerCase','contactmanager','motionbar','browser','data1','html','data2','render','template\x20not\x20found','uri','buildUri','data3','data4','uriLocation','windowWidth','isNil','800','data5'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x396c,0x108));var _0xc396=function(_0x2e83f4,_0x48f161){_0x2e83f4=_0x2e83f4-0x0;var _0x502394=_0x396c[_0x2e83f4];return _0x502394;};'use strict';var util=require(_0xc396('0x0'));var _=require(_0xc396('0x1'));var url=require(_0xc396('0x2'));var Mustache=require('mustache');var Redis=require(_0xc396('0x3'));var urlforward=require(_0xc396('0x4'));var integration=require(_0xc396('0x5'));var cmContact=require(_0xc396('0x6'));var script=require(_0xc396('0x7'));var cmContactRpc=require(_0xc396('0x8'));var config=require(_0xc396('0x9'));var logger=require(_0xc396('0xa'))('trigger');var ami=require(_0xc396('0xb'));config[_0xc396('0xc')]=_[_0xc396('0xd')](config[_0xc396('0xc')],{'host':'localhost','port':0x18eb});var io=require(_0xc396('0xe'))(new Redis(config[_0xc396('0xc')]));var operators={'equals':function(_0x3bbf1d,_0x18926c){return _0x3bbf1d==_0x18926c;},'not_equals':function(_0x358add,_0x2ddea5){return _0x358add!=_0x2ddea5;}};var barAndWebActions=[_0xc396('0xf'),_0xc396('0x2'),_0xc396('0x10')];function Trigger(_0x2a0b06){this[_0xc396('0x11')]=_0x2a0b06[_0xc396('0x11')];this[_0xc396('0x12')]=_0x2a0b06[_0xc396('0x12')];this[_0xc396('0x13')]=_0x2a0b06[_0xc396('0x13')];this[_0xc396('0x14')]=_0x2a0b06[_0xc396('0x14')];this[_0xc396('0x15')]=_0x2a0b06[_0xc396('0x15')];this[_0xc396('0x16')]=_0x2a0b06[_0xc396('0x16')];this['freshdeskAccounts']=_0x2a0b06[_0xc396('0x17')];this[_0xc396('0x18')]=_0x2a0b06['salesforceAccounts'];this[_0xc396('0x19')]=_0x2a0b06[_0xc396('0x19')];this[_0xc396('0x1a')]=_0x2a0b06[_0xc396('0x1a')];this[_0xc396('0x1b')]=_0x2a0b06[_0xc396('0x1b')];this['vtigerAccounts']=_0x2a0b06[_0xc396('0x1c')];this[_0xc396('0x1d')]=_0x2a0b06['servicenowAccounts'];this['dynamics365Accounts']=_0x2a0b06[_0xc396('0x1e')];this[_0xc396('0x1f')]=_0x2a0b06[_0xc396('0x1f')];this['accounts']={'zendesk':this[_0xc396('0x16')],'salesforce':this[_0xc396('0x18')],'freshdesk':this[_0xc396('0x17')],'sugarcrm':this[_0xc396('0x19')],'zoho':this['zohoAccounts'],'desk':this[_0xc396('0x1b')],'vtiger':this[_0xc396('0x1c')],'dynamics365':this[_0xc396('0x1e')],'freshsales':this[_0xc396('0x1f')],'servicenow':this[_0xc396('0x1d')]};ami['on']('custom:agentcalled',this['syncCustomEvent'][_0xc396('0x20')](this));ami['on'](_0xc396('0x21'),this[_0xc396('0x22')][_0xc396('0x20')](this));ami['on'](_0xc396('0x23'),this[_0xc396('0x22')]['bind'](this));ami['on']('custom:agentcomplete',this['syncCustomEvent']['bind'](this));ami['on']('custom:queuecallerabandon',this[_0xc396('0x22')][_0xc396('0x20')](this));ami['on'](_0xc396('0x24'),this[_0xc396('0x25')][_0xc396('0x20')](this));ami['on'](_0xc396('0x26'),this[_0xc396('0x25')][_0xc396('0x20')](this));ami['on']('custom:dialend',this[_0xc396('0x25')][_0xc396('0x20')](this));ami['on']('custom:newinteraction',this[_0xc396('0x22')][_0xc396('0x20')](this));ami['on'](_0xc396('0x27'),this[_0xc396('0x22')][_0xc396('0x20')](this));ami['on']('custom:incomingmessage',this[_0xc396('0x22')][_0xc396('0x20')](this));ami['on'](_0xc396('0x28'),this[_0xc396('0x22')][_0xc396('0x20')](this));ami['on'](_0xc396('0x29'),this[_0xc396('0x22')][_0xc396('0x20')](this));ami['on']('custom:rejectmessage',this['syncCustomEvent'][_0xc396('0x20')](this));}Trigger[_0xc396('0x2a')][_0xc396('0x2b')]=function(_0x498872,_0x2f8241,_0x508a73){logger[_0xc396('0x2c')](_0x498872,_0x2f8241,JSON[_0xc396('0x2d')](_0x508a73));io['to'](_0x498872)['emit'](_0x2f8241,_0x508a73);};Trigger['prototype'][_0xc396('0x22')]=function(_0x4b7dad){var _0x408a25=_[_0xc396('0x2e')](_0x4b7dad);this['checkTriggers'](_0x408a25);};Trigger[_0xc396('0x2a')][_0xc396('0x25')]=function(_0x45e8e8){if(this[_0xc396('0x12')][_0x45e8e8['interface']]){this[_0xc396('0x22')](_0x45e8e8);}};Trigger[_0xc396('0x2a')][_0xc396('0x2f')]=function(_0x1386c9){var _0x28882f;for(var _0x1bf852 in this[_0xc396('0x11')]){if(this[_0xc396('0x11')][_0xc396('0x30')](_0x1bf852)){if(this[_0xc396('0x11')][_0x1bf852][_0xc396('0x31')]){_0x28882f=this[_0xc396('0x32')](this['triggers'][_0x1bf852],_0x1386c9);if(_0x28882f){_[_0xc396('0x33')](_0x1386c9,_0x1386c9[_0xc396('0x34')]);for(var _0x516e2f=0x0,_0x564f41,_0x261d49,_0x3f68e6;_0x516e2f0x0){_0x2f031c=_[_0x197c('0x2d')](_0x4e9a06,_0x16e026);}return _0x2f031c;}function getCustomFields(_0x215df1,_0x4422d1){var _0x5df39e=[];var _0x50dea3={'custom_fields':{}};if(_0x215df1['length']>0x0){_['forEach'](_0x215df1,function(_0x5f7425){if(_0x5f7425['type']===_0x197c('0x2e')&&_0x5f7425[_0x197c('0x2f')]&&!_0x5f7425['customField']){_0x50dea3[_0x5f7425[_0x197c('0x2f')]['toLowerCase']()]=_0x5f7425[_0x197c('0x30')][_0x197c('0x23')]();}else if(_0x5f7425[_0x197c('0x31')]===_0x197c('0x2e')&&_0x5f7425[_0x197c('0x32')]&&_0x5f7425[_0x197c('0x33')]){_0x50dea3[_0x197c('0x34')][_0x5f7425[_0x197c('0x32')]]=_0x5f7425[_0x197c('0x30')]['toString']();}else if(_0x5f7425['type']===_0x197c('0x35')&&_0x5f7425[_0x197c('0x36')]&&_0x5f7425[_0x197c('0x32')]&&_0x5f7425[_0x197c('0x33')]){_0x4422d1[_0x5f7425[_0x197c('0x36')]]&&(_0x50dea3[_0x197c('0x34')][_0x5f7425[_0x197c('0x32')]]=_0x4422d1[_0x5f7425['variableName']]['toString']());}else if(_0x5f7425[_0x197c('0x31')]===_0x197c('0x37')&&_0x5f7425['Variable']&&_0x5f7425['Variable'][_0x197c('0x38')]&&_0x5f7425[_0x197c('0x32')]&&_0x5f7425[_0x197c('0x33')]){_0x4422d1[_0x5f7425[_0x197c('0x39')][_0x197c('0x38')][_0x197c('0x3a')]()]&&(_0x50dea3[_0x197c('0x34')][_0x5f7425[_0x197c('0x32')]]=_0x4422d1[_0x5f7425[_0x197c('0x39')]['name'][_0x197c('0x3a')]()][_0x197c('0x23')]());}});}if(_0x50dea3[_0x197c('0x3b')]){_0x50dea3[_0x197c('0x3b')]=Number(_0x50dea3[_0x197c('0x3b')]);}return _0x50dea3;}function getTicket(_0x151e2f,_0x50ec25,_0x2b84a3,_0xfb5f3e,_0x2c6cbc){logger['info'](_0x197c('0x3c'));var _0x34dabc=_[_0x197c('0x3d')]({'subject':intUtil[_0x197c('0x3e')](_0xfb5f3e[_0x197c('0x3f')],_0x2c6cbc,'\x20'),'type':_0x197c('0x40'),'status':_0x197c('0x41'),'labels':[_0x197c('0x42'),_0x197c('0x43'),_0x197c('0x44')]['concat'](getTags(_0xfb5f3e[_0x197c('0x45')],_0x197c('0x38'))),'description':intUtil['getString'](_0xfb5f3e['Descriptions'],_0x2c6cbc,'\x0a'),'_links':{'assigned_user':{'href':util[_0x197c('0xc')](_0x197c('0x46'),_0x50ec25['id']),'class':_0x197c('0x47')}},'message':{'direction':'in','body':intUtil[_0x197c('0x3e')](_0xfb5f3e[_0x197c('0x48')],_0x2c6cbc,'\x0a')}},getCustomFields(_0xfb5f3e['Fields'],_0x2c6cbc));return request({'uri':util[_0x197c('0xc')](_0x197c('0x49'),_0x151e2f[_0x197c('0xe')],_0x2b84a3['id']),'method':_0x197c('0x2a'),'body':_0x34dabc});}exports[_0x197c('0x4a')]=function(_0x4b6901,_0x3e21bd,_0x37bb94,_0x6d7bda,_0x197b27,_0x2f3c4b){var _0x5c3660,_0x3054c2;_0x2f3c4b[_0x197c('0xe')]=intUtil[_0x197c('0x4b')](_0x2f3c4b[_0x197c('0xe')]);_0x2f3c4b[_0x197c('0x4c')]=intUtil[_0x197c('0x4b')](_0x2f3c4b[_0x197c('0x4c')]);if(_0x197b27&&_0x197b27[_0x197c('0x4d')]){logger[_0x197c('0xb')](_0x197c('0x4e'),_0x197c('0x4f'));_0x3e21bd['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2f3c4b['serverUrl'],_0x3e21bd[_0x197c('0x50')],md5(_0x3e21bd[_0x197c('0x50')]));}else{_0x3e21bd['recordingURL']='';}headers[_0x197c('0x51')]=getAuth(_0x2f3c4b);return getUser(_0x2f3c4b,_0x6d7bda[_0x197c('0x52')])['then'](function(_0x2016f2){_0x5c3660=_0x2016f2;logger[_0x197c('0xb')]('The\x20User\x20ID\x20is:',_0x5c3660['id']);return getEndUser(_0x2f3c4b,_0x3e21bd[_0x197c('0x53')],_0x3e21bd[_0x197c('0x54')]);})['then'](function(_0x3b24e2){_0x3054c2=_0x3b24e2;logger[_0x197c('0xb')](_0x197c('0x55'),_0x3054c2['id']);return getTicket(_0x2f3c4b,_0x5c3660,_0x3054c2,_0x37bb94,_0x3e21bd);})['then'](function(_0x3b36e5){if(_0x3b36e5){logger[_0x197c('0xb')](_0x197c('0x56'));logger[_0x197c('0xb')]('The\x20Ticket\x20ID\x20is:',_0x3b36e5['id']);switch(_0x2f3c4b[_0x197c('0x31')]){case _0x197c('0x57'):logger[_0x197c('0xb')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');emit(util[_0x197c('0xc')](_0x197c('0x58'),_0x6d7bda[_0x197c('0x38')]),_0x197c('0x59'),{'recordId':_0x3b36e5['id']});break;case _0x197c('0x5a'):logger[_0x197c('0xb')]('[QUEUE]',_0x197c('0x5b'));emit(util['format'](_0x197c('0x58'),_0x6d7bda[_0x197c('0x38')]),_0x197c('0x5c'),{'uri':util[_0x197c('0xc')](_0x197c('0x5d'),_0x3b36e5['id'])});break;default:logger[_0x197c('0x5e')](_0x197c('0x4e'),_0x197c('0x5f'));}}})['catch'](function(_0xa9cfa1){console[_0x197c('0x5e')](_0xa9cfa1);logger[_0x197c('0x5e')]('[QUEUE]',JSON[_0x197c('0x19')](_0xa9cfa1));});};exports['outbound']=function(_0x204592,_0x1d2a5f,_0x1ec51a,_0x22a106,_0x1d7cdd,_0x304537,_0x360599){var _0x21d21f,_0x544bc5;_0x304537[_0x197c('0xe')]=intUtil[_0x197c('0x4b')](_0x304537[_0x197c('0xe')]);_0x304537['serverUrl']=intUtil[_0x197c('0x4b')](_0x304537[_0x197c('0x4c')]);if(_0x360599&&_0x360599[_0x197c('0x60')]&&_0x360599[_0x197c('0x60')]!==_0x197c('0x61')){logger['info']('[OUTBOUND]',_0x197c('0x4f'));_0x1d2a5f[_0x197c('0x62')]=util[_0x197c('0xc')](_0x197c('0x63'),_0x304537[_0x197c('0x4c')],_0x1d2a5f['uniqueid'],md5(_0x1d2a5f['uniqueid']));}headers[_0x197c('0x51')]=getAuth(_0x304537);return getUser(_0x304537,_0x22a106[_0x197c('0x52')])['then'](function(_0xb3747b){_0x21d21f=_0xb3747b;logger[_0x197c('0xb')](_0x197c('0x64'),_0x21d21f['id']);return getEndUser(_0x304537,_0x1d2a5f[_0x197c('0x65')],_0x1d2a5f[_0x197c('0x66')]);})[_0x197c('0xf')](function(_0x4e8c5b){_0x544bc5=_0x4e8c5b;logger[_0x197c('0xb')](_0x197c('0x55'),_0x544bc5['id']);return getTicket(_0x304537,_0x21d21f,_0x544bc5,_0x1ec51a,_0x1d2a5f);})['then'](function(_0x480cab){if(_0x480cab){logger[_0x197c('0xb')]('Ticket\x20created!');logger[_0x197c('0xb')](_0x197c('0x67'),_0x480cab['id']);switch(_0x304537[_0x197c('0x31')]){case'integrationTab':logger[_0x197c('0xb')](_0x197c('0x4e'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0x197c('0xc')](_0x197c('0x58'),_0x22a106[_0x197c('0x38')]),'trigger:desk:display',{'recordId':_0x480cab['id']});break;case _0x197c('0x5a'):logger[_0x197c('0xb')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x197c('0xc')](_0x197c('0x58'),_0x22a106[_0x197c('0x38')]),'trigger:browser:url',{'uri':util[_0x197c('0xc')](_0x197c('0x68'),_0x304537[_0x197c('0xe')],_0x480cab['id'])});break;default:logger['error'](_0x197c('0x69'),_0x197c('0x5f'));}}})[_0x197c('0x6a')](function(_0x1f0398){logger[_0x197c('0x5e')](_0x197c('0x69'),JSON[_0x197c('0x19')](_0x1f0398));});};exports[_0x197c('0x6b')]=function(_0x1d0bec,_0x42dd11,_0x5ef485,_0x1f7ad0,_0x572649,_0x491162){var _0x4a8e13,_0x500c8f;_0x491162[_0x197c('0xe')]=intUtil[_0x197c('0x4b')](_0x491162[_0x197c('0xe')]);_0x491162[_0x197c('0x4c')]=intUtil['stripTrailingSlash'](_0x491162[_0x197c('0x4c')]);if(_0x572649&&_0x572649['monitor_format']){logger[_0x197c('0xb')]('[ABANDONED]',_0x197c('0x4f'));_0x42dd11['recordingURL']=util[_0x197c('0xc')](_0x197c('0x63'),_0x491162[_0x197c('0x4c')],_0x42dd11[_0x197c('0x50')],md5(_0x42dd11['uniqueid']));}else{_0x42dd11[_0x197c('0x62')]='';}headers[_0x197c('0x51')]=getAuth(_0x491162);return getUser(_0x491162)[_0x197c('0xf')](function(_0x523a69){_0x4a8e13=_0x523a69;logger[_0x197c('0xb')](_0x197c('0x64'),_0x4a8e13['id']);return getEndUser(_0x491162,_0x42dd11[_0x197c('0x53')],_0x42dd11[_0x197c('0x54')]);})[_0x197c('0xf')](function(_0x3d1d6c){_0x500c8f=_0x3d1d6c;logger[_0x197c('0xb')](_0x197c('0x55'),_0x500c8f['id']);return getTicket(_0x491162,_0x4a8e13,_0x500c8f,_0x5ef485,_0x42dd11);})[_0x197c('0xf')](function(_0x1947bd){if(_0x1947bd){logger[_0x197c('0xb')](_0x197c('0x56'));logger[_0x197c('0xb')](_0x197c('0x67'),_0x1947bd['id']);}})[_0x197c('0x6a')](function(_0x18d530){logger[_0x197c('0x5e')](_0x197c('0x6c'),JSON['stringify'](_0x18d530));});}; \ No newline at end of file +var _0xe511=['Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','length','map','string','nameField','customField','toLowerCase','content','toString','type','idField','variable','variableName','custom_fields','customVariable','name','priority','Creating\x20new\x20ticket...','merge','getString','Subjects','phone','new','xCALLY','Motion','concat','Descriptions','/api/v2/users/%d','user','Fields','%s/customers/%d/cases','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','integrationTab','user:%s','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','error','stringify','outbound','[OUTBOUND]','destcalleridname','destcalleridnum','Displaying\x20ticket\x20to\x20agent...','%s/agent/tickets/%s','Desk\x20account\x20type\x20not\x20recognized','catch','[ABANDONED]','lodash','request-promise','util','./util','../../../../config/environment','desk','redis','defaults','socket.io-emitter','emit','validateEmail','info','Getting\x20agent\x20with\x20email','format','remoteUri','then','total_entries','find','_embedded','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','debug','GET','authType','basic','%s:%s','password','token','Basic\x20%s','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search'];(function(_0x38e6bf,_0x4c64a5){var _0x3876bc=function(_0x4f9b8){while(--_0x4f9b8){_0x38e6bf['push'](_0x38e6bf['shift']());}};_0x3876bc(++_0x4c64a5);}(_0xe511,0x16f));var _0x1e51=function(_0x493376,_0x49d7f7){_0x493376=_0x493376-0x0;var _0x29520c=_0xe511[_0x493376];return _0x29520c;};'use strict';var _=require(_0x1e51('0x0'));var rp=require(_0x1e51('0x1'));var md5=require('md5');var util=require(_0x1e51('0x2'));var Redis=require('ioredis');var intUtil=require(_0x1e51('0x3'));var config=require(_0x1e51('0x4'));var logger=require('../../../../config/logger')(_0x1e51('0x5'));config[_0x1e51('0x6')]=_[_0x1e51('0x7')](config[_0x1e51('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x1e51('0x8'))(new Redis(config[_0x1e51('0x6')]));function emit(_0x5c4590,_0x4fa2ba,_0x394ad8){io['to'](_0x5c4590)[_0x1e51('0x9')](_0x4fa2ba,_0x394ad8);}var headers={'Content-Type':'application/json','Accept':'application/json'};function getUser(_0x658941,_0x2712e0){if(intUtil[_0x1e51('0xa')](_0x2712e0)===!![]){logger[_0x1e51('0xb')](_0x1e51('0xc'),_0x2712e0);return request({'uri':util[_0x1e51('0xd')]('%s/users',_0x658941[_0x1e51('0xe')])})[_0x1e51('0xf')](function(_0x3350bb){if(_0x3350bb[_0x1e51('0x10')]){return _[_0x1e51('0x11')](_0x3350bb[_0x1e51('0x12')]['entries'],{'email':_0x2712e0});}})[_0x1e51('0xf')](function(_0x102f01){if(_0x102f01){logger[_0x1e51('0xb')](_0x1e51('0x13'));return _0x102f01;}else{logger[_0x1e51('0xb')](_0x1e51('0x14'));return request({'uri':util[_0x1e51('0xd')](_0x1e51('0x15'),_0x658941[_0x1e51('0xe')])});}});}else{logger[_0x1e51('0xb')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x1e51('0xd')](_0x1e51('0x15'),_0x658941[_0x1e51('0xe')])});}}function request(_0x5857e2){logger[_0x1e51('0x16')]('[HTTP]',JSON['stringify'](_0x5857e2));return rp(_[_0x1e51('0x7')](_0x5857e2,{'method':_0x1e51('0x17'),'headers':headers,'json':!![]}));}function getAuth(_0x40ae4c){var _0x4785a5;if(_0x40ae4c[_0x1e51('0x18')]===_0x1e51('0x19')){_0x4785a5=util['format'](_0x1e51('0x1a'),_0x40ae4c['username'],_0x40ae4c[_0x1e51('0x1b')]);}else if(_0x40ae4c[_0x1e51('0x18')]===_0x1e51('0x1c')){_0x4785a5=util[_0x1e51('0xd')]('%s/token:%s',_0x40ae4c['username'],_0x40ae4c['token']);}return util['format'](_0x1e51('0x1d'),new Buffer(_0x4785a5)['toString'](_0x1e51('0x1e')));}function getEndUser(_0x28aacb,_0x415154,_0x13240f){logger[_0x1e51('0xb')](_0x1e51('0x1f'),_0x13240f);return request({'uri':util[_0x1e51('0xd')](_0x1e51('0x20'),_0x28aacb['remoteUri']),'qs':{'phone':_0x13240f}})['then'](function(_0x43f5c5){if(_0x43f5c5[_0x1e51('0x10')]){logger[_0x1e51('0xb')](_0x1e51('0x21'));return _0x43f5c5['_embedded']['entries'][0x0];}else{logger['info'](_0x1e51('0x22'));return request({'uri':util[_0x1e51('0xd')](_0x1e51('0x23'),_0x28aacb['remoteUri']),'method':_0x1e51('0x24'),'body':{'first_name':_0x415154,'title':_0x415154,'phone_numbers':[{'type':'work','value':_0x13240f}]}});}});}function getTags(_0x5eccee,_0x3349f0){var _0x5c5bbd=[];if(_0x5eccee&&_0x5eccee[_0x1e51('0x25')]>0x0){_0x5c5bbd=_[_0x1e51('0x26')](_0x5eccee,_0x3349f0);}return _0x5c5bbd;}function getCustomFields(_0x56722f,_0x3e6ef2){var _0x10ee23=[];var _0x71c7af={'custom_fields':{}};if(_0x56722f[_0x1e51('0x25')]>0x0){_['forEach'](_0x56722f,function(_0x4cf046){if(_0x4cf046['type']===_0x1e51('0x27')&&_0x4cf046[_0x1e51('0x28')]&&!_0x4cf046[_0x1e51('0x29')]){_0x71c7af[_0x4cf046[_0x1e51('0x28')][_0x1e51('0x2a')]()]=_0x4cf046[_0x1e51('0x2b')][_0x1e51('0x2c')]();}else if(_0x4cf046[_0x1e51('0x2d')]===_0x1e51('0x27')&&_0x4cf046[_0x1e51('0x2e')]&&_0x4cf046[_0x1e51('0x29')]){_0x71c7af['custom_fields'][_0x4cf046[_0x1e51('0x2e')]]=_0x4cf046[_0x1e51('0x2b')][_0x1e51('0x2c')]();}else if(_0x4cf046[_0x1e51('0x2d')]===_0x1e51('0x2f')&&_0x4cf046['variableName']&&_0x4cf046[_0x1e51('0x2e')]&&_0x4cf046['customField']){_0x3e6ef2[_0x4cf046[_0x1e51('0x30')]]&&(_0x71c7af[_0x1e51('0x31')][_0x4cf046[_0x1e51('0x2e')]]=_0x3e6ef2[_0x4cf046['variableName']][_0x1e51('0x2c')]());}else if(_0x4cf046['type']===_0x1e51('0x32')&&_0x4cf046['Variable']&&_0x4cf046['Variable'][_0x1e51('0x33')]&&_0x4cf046[_0x1e51('0x2e')]&&_0x4cf046[_0x1e51('0x29')]){_0x3e6ef2[_0x4cf046['Variable'][_0x1e51('0x33')]['toLowerCase']()]&&(_0x71c7af[_0x1e51('0x31')][_0x4cf046[_0x1e51('0x2e')]]=_0x3e6ef2[_0x4cf046['Variable'][_0x1e51('0x33')][_0x1e51('0x2a')]()][_0x1e51('0x2c')]());}});}if(_0x71c7af[_0x1e51('0x34')]){_0x71c7af[_0x1e51('0x34')]=Number(_0x71c7af[_0x1e51('0x34')]);}return _0x71c7af;}function getTicket(_0x5c57a6,_0x509f7d,_0x56f86a,_0x58cbbe,_0x3c6c35){logger[_0x1e51('0xb')](_0x1e51('0x35'));var _0xcfa1d8=_[_0x1e51('0x36')]({'subject':intUtil[_0x1e51('0x37')](_0x58cbbe[_0x1e51('0x38')],_0x3c6c35,'\x20'),'type':_0x1e51('0x39'),'status':_0x1e51('0x3a'),'labels':[_0x1e51('0x3b'),_0x1e51('0x3c'),'CTI'][_0x1e51('0x3d')](getTags(_0x58cbbe['Tags'],_0x1e51('0x33'))),'description':intUtil[_0x1e51('0x37')](_0x58cbbe[_0x1e51('0x3e')],_0x3c6c35,'\x0a'),'_links':{'assigned_user':{'href':util[_0x1e51('0xd')](_0x1e51('0x3f'),_0x509f7d['id']),'class':_0x1e51('0x40')}},'message':{'direction':'in','body':intUtil[_0x1e51('0x37')](_0x58cbbe[_0x1e51('0x3e')],_0x3c6c35,'\x0a')}},getCustomFields(_0x58cbbe[_0x1e51('0x41')],_0x3c6c35));return request({'uri':util[_0x1e51('0xd')](_0x1e51('0x42'),_0x5c57a6['remoteUri'],_0x56f86a['id']),'method':'POST','body':_0xcfa1d8});}exports[_0x1e51('0x43')]=function(_0x8bb476,_0x3be495,_0x4650e4,_0x1ef3d3,_0x1a9e0d,_0x25592c){var _0x3ca63d,_0x5a6340;_0x25592c[_0x1e51('0xe')]=intUtil[_0x1e51('0x44')](_0x25592c[_0x1e51('0xe')]);_0x25592c[_0x1e51('0x45')]=intUtil[_0x1e51('0x44')](_0x25592c[_0x1e51('0x45')]);if(_0x1a9e0d&&_0x1a9e0d[_0x1e51('0x46')]){logger['info'](_0x1e51('0x47'),_0x1e51('0x48'));_0x3be495['recordingURL']=util[_0x1e51('0xd')](_0x1e51('0x49'),_0x25592c[_0x1e51('0x45')],_0x3be495['uniqueid'],md5(_0x3be495[_0x1e51('0x4a')]));}else{_0x3be495[_0x1e51('0x4b')]='';}headers[_0x1e51('0x4c')]=getAuth(_0x25592c);return getUser(_0x25592c,_0x1ef3d3[_0x1e51('0x4d')])[_0x1e51('0xf')](function(_0x3baebb){_0x3ca63d=_0x3baebb;logger[_0x1e51('0xb')](_0x1e51('0x4e'),_0x3ca63d['id']);return getEndUser(_0x25592c,_0x3be495[_0x1e51('0x4f')],_0x3be495['calleridnum']);})[_0x1e51('0xf')](function(_0x22a898){_0x5a6340=_0x22a898;logger['info'](_0x1e51('0x50'),_0x5a6340['id']);return getTicket(_0x25592c,_0x3ca63d,_0x5a6340,_0x4650e4,_0x3be495);})[_0x1e51('0xf')](function(_0x139e9f){if(_0x139e9f){logger['info'](_0x1e51('0x51'));logger[_0x1e51('0xb')](_0x1e51('0x52'),_0x139e9f['id']);switch(_0x25592c['type']){case _0x1e51('0x53'):logger['info']('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');emit(util[_0x1e51('0xd')](_0x1e51('0x54'),_0x1ef3d3['name']),'trigger:desk:display',{'recordId':_0x139e9f['id']});break;case _0x1e51('0x55'):logger[_0x1e51('0xb')](_0x1e51('0x47'),_0x1e51('0x56'));emit(util[_0x1e51('0xd')](_0x1e51('0x54'),_0x1ef3d3['name']),_0x1e51('0x57'),{'uri':util['format'](_0x1e51('0x58'),_0x139e9f['id'])});break;default:logger[_0x1e51('0x59')]('[QUEUE]','Desk\x20account\x20type\x20not\x20recognized');}}})['catch'](function(_0x5f7b11){console[_0x1e51('0x59')](_0x5f7b11);logger[_0x1e51('0x59')]('[QUEUE]',JSON[_0x1e51('0x5a')](_0x5f7b11));});};exports[_0x1e51('0x5b')]=function(_0x4226da,_0x2100d4,_0x1ccb55,_0x12584c,_0x32fe1f,_0x2ca91f,_0x5b64f6){var _0x37eb4d,_0x7c5f61;_0x2ca91f[_0x1e51('0xe')]=intUtil[_0x1e51('0x44')](_0x2ca91f[_0x1e51('0xe')]);_0x2ca91f[_0x1e51('0x45')]=intUtil['stripTrailingSlash'](_0x2ca91f[_0x1e51('0x45')]);if(_0x5b64f6&&_0x5b64f6['recordingFormat']&&_0x5b64f6['recordingFormat']!=='none'){logger[_0x1e51('0xb')](_0x1e51('0x5c'),_0x1e51('0x48'));_0x2100d4['recordingURL']=util[_0x1e51('0xd')](_0x1e51('0x49'),_0x2ca91f[_0x1e51('0x45')],_0x2100d4['uniqueid'],md5(_0x2100d4[_0x1e51('0x4a')]));}headers[_0x1e51('0x4c')]=getAuth(_0x2ca91f);return getUser(_0x2ca91f,_0x12584c[_0x1e51('0x4d')])['then'](function(_0x2d5e58){_0x37eb4d=_0x2d5e58;logger[_0x1e51('0xb')](_0x1e51('0x4e'),_0x37eb4d['id']);return getEndUser(_0x2ca91f,_0x2100d4[_0x1e51('0x5d')],_0x2100d4[_0x1e51('0x5e')]);})[_0x1e51('0xf')](function(_0x215ff7){_0x7c5f61=_0x215ff7;logger[_0x1e51('0xb')]('The\x20Enduser\x20ID\x20is:',_0x7c5f61['id']);return getTicket(_0x2ca91f,_0x37eb4d,_0x7c5f61,_0x1ccb55,_0x2100d4);})[_0x1e51('0xf')](function(_0x2e78e7){if(_0x2e78e7){logger['info']('Ticket\x20created!');logger['info'](_0x1e51('0x52'),_0x2e78e7['id']);switch(_0x2ca91f[_0x1e51('0x2d')]){case _0x1e51('0x53'):logger[_0x1e51('0xb')](_0x1e51('0x47'),_0x1e51('0x5f'));emit(util[_0x1e51('0xd')](_0x1e51('0x54'),_0x12584c[_0x1e51('0x33')]),'trigger:desk:display',{'recordId':_0x2e78e7['id']});break;case'newTab':logger['info'](_0x1e51('0x47'),_0x1e51('0x56'));emit(util['format']('user:%s',_0x12584c[_0x1e51('0x33')]),_0x1e51('0x57'),{'uri':util['format'](_0x1e51('0x60'),_0x2ca91f[_0x1e51('0xe')],_0x2e78e7['id'])});break;default:logger[_0x1e51('0x59')](_0x1e51('0x5c'),_0x1e51('0x61'));}}})[_0x1e51('0x62')](function(_0x2199e5){logger[_0x1e51('0x59')](_0x1e51('0x5c'),JSON[_0x1e51('0x5a')](_0x2199e5));});};exports['abandoned']=function(_0x178baf,_0x2f5bf1,_0x3657a2,_0x402bbd,_0xc720e2,_0x224dbc){var _0x47cc50,_0x56475b;_0x224dbc[_0x1e51('0xe')]=intUtil[_0x1e51('0x44')](_0x224dbc[_0x1e51('0xe')]);_0x224dbc[_0x1e51('0x45')]=intUtil['stripTrailingSlash'](_0x224dbc['serverUrl']);if(_0xc720e2&&_0xc720e2['monitor_format']){logger[_0x1e51('0xb')](_0x1e51('0x63'),_0x1e51('0x48'));_0x2f5bf1[_0x1e51('0x4b')]=util[_0x1e51('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x224dbc[_0x1e51('0x45')],_0x2f5bf1[_0x1e51('0x4a')],md5(_0x2f5bf1[_0x1e51('0x4a')]));}else{_0x2f5bf1['recordingURL']='';}headers[_0x1e51('0x4c')]=getAuth(_0x224dbc);return getUser(_0x224dbc)[_0x1e51('0xf')](function(_0x45e607){_0x47cc50=_0x45e607;logger['info'](_0x1e51('0x4e'),_0x47cc50['id']);return getEndUser(_0x224dbc,_0x2f5bf1[_0x1e51('0x4f')],_0x2f5bf1['calleridnum']);})['then'](function(_0x40d5e8){_0x56475b=_0x40d5e8;logger['info'](_0x1e51('0x50'),_0x56475b['id']);return getTicket(_0x224dbc,_0x47cc50,_0x56475b,_0x3657a2,_0x2f5bf1);})['then'](function(_0x17a9fd){if(_0x17a9fd){logger[_0x1e51('0xb')](_0x1e51('0x51'));logger[_0x1e51('0xb')]('The\x20Ticket\x20ID\x20is:',_0x17a9fd['id']);}})[_0x1e51('0x62')](function(_0x4c9871){logger['error'](_0x1e51('0x63'),JSON[_0x1e51('0x5a')](_0x4c9871));});}; \ 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 3674bd7..c6c3e9a 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 _0xc058=['odata-entityid','substring','lastIndexOf','enduserId','contactid',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','forEach','type','string','nameField','customField','idField','indexOf','ticketType','incident','incidents','assign','getString','Subjects','Descriptions','Fields','phonecalls','callDirection','queue','/systemusers(','/contacts(','headers','ticketId','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','format','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','abandoned','%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]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\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','defaults','redis','localhost','socket.io-emitter','POST','clientId','remoteUri','username','password','clientSecret','then','catch','error','toUpperCase','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','value','isNil','validateEmail','email','userEmail','length','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','Bearer\x20','4.0'];(function(_0x15c56d,_0x48d214){var _0x321da5=function(_0x21f8c1){while(--_0x21f8c1){_0x15c56d['push'](_0x15c56d['shift']());}};_0x321da5(++_0x48d214);}(_0xc058,0xa0));var _0x8c05=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xc058[_0x432682];return _0x463d05;};'use strict';var _=require(_0x8c05('0x0'));var BPromise=require(_0x8c05('0x1'));var rp=require(_0x8c05('0x2'));var util=require(_0x8c05('0x3'));var intUtil=require(_0x8c05('0x4'));var md5=require(_0x8c05('0x5'));var Redis=require(_0x8c05('0x6'));var logger=require(_0x8c05('0x7'))(_0x8c05('0x8'));var config=require('../../../../config/environment');config['redis']=_[_0x8c05('0x9')](config[_0x8c05('0xa')],{'host':_0x8c05('0xb'),'port':0x18eb});var io=require(_0x8c05('0xc'))(new Redis(config[_0x8c05('0xa')]));function getAuthToken(_0x723c83,_0x11ba33,_0x14ba2e){var _0xe8e6a5={'method':_0x8c05('0xd'),'uri':_0x11ba33,'form':{'client_id':_0x723c83[_0x8c05('0xe')],'resource':_0x723c83[_0x8c05('0xf')],'username':_0x723c83[_0x8c05('0x10')],'password':_0x723c83[_0x8c05('0x11')],'grant_type':_0x8c05('0x11'),'client_secret':_0x723c83[_0x8c05('0x12')]},'json':!![]};return rp(_0xe8e6a5)[_0x8c05('0x13')](function(_0x25e992){return _0x25e992['access_token'];})[_0x8c05('0x14')](function(_0x56c2ad){logger[_0x8c05('0x15')]('['+[_0x14ba2e[_0x8c05('0x16')]()]+']\x20Wrong\x20credentials!');return _0x56c2ad[_0x8c05('0x17')];});}function getUser(_0x12073c,_0x42ac59,_0x405c22,_0xbd8d55,_0x294939,_0x5734cd){return new BPromise(function(_0x57ed2d,_0xb21b3c){return getAuthToken(_0x42ac59,_0xbd8d55,_0x5734cd)[_0x8c05('0x13')](function(_0x59cbb0){var _0xc84ce8={'method':_0x8c05('0x18'),'uri':_0x294939+_0x8c05('0x19'),'headers':{'Authorization':'Bearer\x20'+_0x59cbb0,'OData-Version':'4.0'},'json':!![]};return rp(_0xc84ce8);})[_0x8c05('0x13')](function(_0x2869b3){var _0x3f5c85=_0x2869b3[_0x8c05('0x1a')];var _0xdc2137=![];var _0x3b8d3b=null;if(!_[_0x8c05('0x1b')](_0x405c22)){if(intUtil[_0x8c05('0x1c')](_0x405c22[_0x8c05('0x1d')])){_0x12073c[_0x8c05('0x1e')]=_0x405c22[_0x8c05('0x1d')];for(_0x3b8d3b=0x0;_0x3b8d3b<_0x3f5c85[_0x8c05('0x1f')];_0x3b8d3b++){if(_0x3f5c85[_0x3b8d3b][_0x8c05('0x20')]===_0x405c22[_0x8c05('0x1d')]&&!_0x3f5c85[_0x3b8d3b][_0x8c05('0x21')]){_0xdc2137=!![];logger[_0x8c05('0x22')]('['+[_0x5734cd[_0x8c05('0x16')]()]+_0x8c05('0x23')+_0x3f5c85[_0x3b8d3b][_0x8c05('0x24')]+'!');_0x12073c[_0x8c05('0x25')]=_0x3f5c85[_0x3b8d3b][_0x8c05('0x24')];}}}}if(!_0xdc2137){logger[_0x8c05('0x22')]('['+[_0x5734cd[_0x8c05('0x16')]()]+_0x8c05('0x26'));_0x12073c[_0x8c05('0x1e')]=_0x42ac59['username'];for(_0x3b8d3b=0x0;_0x3b8d3b<_0x3f5c85[_0x8c05('0x1f')];_0x3b8d3b++){if(_0x3f5c85[_0x3b8d3b][_0x8c05('0x20')]===_0x42ac59[_0x8c05('0x10')]){_0x12073c['userId']=_0x3f5c85[_0x3b8d3b][_0x8c05('0x24')];}}}_0x57ed2d(_0x12073c);})['catch'](function(_0x25e1fb){_0xb21b3c(_0x25e1fb[_0x8c05('0x17')]);});});}function createEndUser(_0x38232b,_0x3b7962,_0x121e01,_0x586ad3,_0x5afe6e,_0x3f5c4c){return new BPromise(function(_0x1c8165,_0x165733){return getAuthToken(_0x3b7962,_0x121e01,_0x3f5c4c)[_0x8c05('0x13')](function(_0x5dc961){var _0x25caad=_0x3f5c4c[_0x8c05('0x27')]()===_0x8c05('0x28')?_0x5afe6e[_0x8c05('0x29')]:_0x5afe6e[_0x8c05('0x2a')];var _0x2f7330={'method':_0x8c05('0xd'),'uri':_0x586ad3+_0x8c05('0x2b'),'body':{'telephone1':_0x25caad,'fullname':_0x25caad,'firstname':_0x25caad,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x38232b[_0x8c05('0x25')]+')'},'headers':{'Authorization':_0x8c05('0x2c')+_0x5dc961,'OData-Version':_0x8c05('0x2d')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x2f7330);})[_0x8c05('0x13')](function(_0x58f5f5){var _0x3a9069=_0x58f5f5['headers'][_0x8c05('0x2e')];var _0x4c0a33=_0x3a9069[_0x8c05('0x2f')](_0x3a9069[_0x8c05('0x30')]('(')+0x1,_0x3a9069[_0x8c05('0x30')](')'));_0x38232b[_0x8c05('0x31')]=_0x4c0a33;_0x1c8165(_0x38232b);})[_0x8c05('0x14')](function(_0x1c451c){_0x165733(_0x1c451c['message']);});});}function getEndUser(_0x4a2f96,_0xfbc761,_0x17aca0,_0x3f826a,_0x1d6ec2,_0x3d49ed){return new BPromise(function(_0x4ca593,_0xc43fdd){return getAuthToken(_0xfbc761,_0x17aca0,_0x3d49ed)[_0x8c05('0x13')](function(_0x588124){var _0x5bd086={'method':_0x8c05('0x18'),'uri':_0x3f826a+'contacts?$select=telephone1','headers':{'Authorization':_0x8c05('0x2c')+_0x588124,'If-None-Match':null,'OData-Version':_0x8c05('0x2d')},'json':!![]};return rp(_0x5bd086);})['then'](function(_0x2707f4){var _0x319e40=null;if(_0x2707f4){var _0x316149=_0x2707f4[_0x8c05('0x1a')];var _0x47893c=![];for(_0x319e40=0x0;_0x319e40<_0x316149[_0x8c05('0x1f')];_0x319e40++){var _0x2896f0=_0x3d49ed[_0x8c05('0x27')]()===_0x8c05('0x28')?_0x1d6ec2[_0x8c05('0x29')]:_0x1d6ec2[_0x8c05('0x2a')];if(_0x316149[_0x319e40]['telephone1']===_0x2896f0){_0x47893c=!![];_0x4a2f96[_0x8c05('0x31')]=_0x316149[_0x319e40][_0x8c05('0x32')];}}if(_0x47893c){_0x4ca593(_0x4a2f96);}else{return createEndUser(_0x4a2f96,_0xfbc761,_0x17aca0,_0x3f826a,_0x1d6ec2,_0x3d49ed)[_0x8c05('0x13')](function(_0x2197cc){logger[_0x8c05('0x22')]('['+[_0x3d49ed[_0x8c05('0x16')]()]+_0x8c05('0x33'),_0x2197cc[_0x8c05('0x31')]);_0x4ca593(_0x2197cc);});}}else{return createEndUser(_0x4a2f96,_0xfbc761,_0x17aca0,_0x3f826a,_0x1d6ec2,_0x3d49ed)[_0x8c05('0x13')](function(_0x10ac4f){logger[_0x8c05('0x22')]('['+[_0x3d49ed[_0x8c05('0x16')]()]+_0x8c05('0x34'),_0x10ac4f[_0x8c05('0x31')]);_0x4ca593(_0x10ac4f);});}});});}function getCustomFields(_0xffda8d,_0x1a79f1,_0x300174){var _0x2dc512={};if(_0xffda8d['length']>0x0){_[_0x8c05('0x35')](_0xffda8d,function(_0x1c1567){if(_0x1c1567[_0x8c05('0x36')]===_0x8c05('0x37')&&_0x1c1567[_0x8c05('0x38')]&&!_0x1c1567[_0x8c05('0x39')]){var _0x506f69=_0x1c1567[_0x8c05('0x3a')]['toLowerCase']();var _0x5d00d1=_0x506f69[_0x8c05('0x2f')](0x0,_0x506f69[_0x8c05('0x3b')]('_'));var _0x4a1c7e=_0x506f69[_0x8c05('0x2f')](_0x506f69[_0x8c05('0x3b')]('_')+0x1);if(_0x5d00d1===_0x300174){_0x2dc512[_0x4a1c7e]=_0x1c1567['content'];}}});}return _0x2dc512;}function getTicket(_0x26a3a7,_0x41678e,_0x4bdb55,_0x369955,_0x3c3329,_0x1b80ef,_0x520a64){return new BPromise(function(_0x52df9a,_0x37ff7e){var _0x382a76;return getAuthToken(_0x41678e,_0x4bdb55,_0x520a64)['then'](function(_0x5af01b){if(_0x1b80ef[_0x8c05('0x3c')]===_0x8c05('0x3d')){_0x382a76={'method':'POST','uri':_0x369955+_0x8c05('0x3e'),'body':Object[_0x8c05('0x3f')]({},{'title':intUtil[_0x8c05('0x40')](_0x1b80ef[_0x8c05('0x41')],_0x3c3329,'\x20'),'description':intUtil['getString'](_0x1b80ef[_0x8c05('0x42')],_0x3c3329,'\x0a'),'customerid_contact@odata.bind':'/contacts('+_0x26a3a7[_0x8c05('0x31')]+')','ownerid@odata.bind':'/systemusers('+_0x26a3a7[_0x8c05('0x25')]+')','caseorigincode':'1'},getCustomFields(_0x1b80ef[_0x8c05('0x43')],_0x3c3329,_0x1b80ef[_0x8c05('0x3c')])),'headers':{'Authorization':_0x8c05('0x2c')+_0x5af01b,'OData-Version':_0x8c05('0x2d')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x1b80ef[_0x8c05('0x3c')]==='phonecall'){_0x382a76={'method':'POST','uri':_0x369955+_0x8c05('0x44'),'body':Object['assign']({},{'subject':intUtil[_0x8c05('0x40')](_0x1b80ef[_0x8c05('0x41')],_0x3c3329,'\x20'),'phonenumber':String(_0x3c3329['calleridnum']),'description':intUtil[_0x8c05('0x40')](_0x1b80ef[_0x8c05('0x42')],_0x3c3329,'\x0a'),'regardingobjectid_contact@odata.bind':'/contacts('+_0x26a3a7[_0x8c05('0x31')]+')','ownerid@odata.bind':'/systemusers('+_0x26a3a7['userId']+')','directioncode':_0x26a3a7[_0x8c05('0x45')]===_0x8c05('0x46')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x8c05('0x47')+_0x26a3a7[_0x8c05('0x25')]+')','participationtypemask':_0x26a3a7[_0x8c05('0x45')]===_0x8c05('0x46')?0x2:0x1},{'partyid_contact@odata.bind':_0x8c05('0x48')+_0x26a3a7[_0x8c05('0x31')]+')','participationtypemask':_0x26a3a7[_0x8c05('0x45')]===_0x8c05('0x46')?0x1:0x2}]},getCustomFields(_0x1b80ef[_0x8c05('0x43')],_0x3c3329,_0x1b80ef['ticketType'])),'headers':{'Authorization':_0x8c05('0x2c')+_0x5af01b,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x382a76);})['then'](function(_0x1439f3){var _0x504567=_0x1439f3[_0x8c05('0x49')][_0x8c05('0x2e')];var _0x2253ac=_0x504567[_0x8c05('0x2f')](_0x504567[_0x8c05('0x30')]('(')+0x1,_0x504567['lastIndexOf'](')'));_0x26a3a7[_0x8c05('0x4a')]=_0x2253ac;_0x52df9a(_0x26a3a7);})[_0x8c05('0x14')](function(_0x24208e){_0x37ff7e(_0x24208e['message']);});});}function emit(_0x5d23b4,_0x16be25,_0x17446e,_0x17598f){var _0x85586={'uri':util['format'](_0x8c05('0x4b'),_0x5d23b4,_0x17446e,_0x17598f)};io['to'](util[_0x8c05('0x4c')](_0x8c05('0x4d'),_0x16be25))[_0x8c05('0x4e')](_0x8c05('0x4f'),_0x85586);}exports['cs']=function(_0x225250,_0x4bf60c,_0x20df90,_0x2cf1f5,_0x2586ee,_0x3ffd76,_0x123f99,_0xe9275f){var _0x1a2a9f={};_0x3ffd76[_0x8c05('0xf')]=intUtil[_0x8c05('0x50')](_0x3ffd76['remoteUri']);_0x3ffd76['serverUrl']=intUtil[_0x8c05('0x50')](_0x3ffd76[_0x8c05('0x51')]);_0x1a2a9f['callDirection']=_0xe9275f===_0x8c05('0x46')||_0xe9275f===_0x8c05('0x52')?'queue':'outbound';var _0x17a805=util[_0x8c05('0x4c')](_0x8c05('0x53'),_0x3ffd76['remoteUri']);var _0x34dfb9=util[_0x8c05('0x4c')](_0x8c05('0x54'),_0x3ffd76[_0x8c05('0x55')]);var _0x3149e8=util['format'](_0x8c05('0x56'),_0x3ffd76[_0x8c05('0x51')],_0x4bf60c[_0x8c05('0x57')],md5(_0x4bf60c[_0x8c05('0x57')]));if(_0x2586ee&&_0x2586ee['monitor_format']){logger[_0x8c05('0x22')](_0x8c05('0x58'),_0x8c05('0x59'));_0x4bf60c[_0x8c05('0x5a')]=_0x3149e8;}else if(_0x123f99&&_0x123f99[_0x8c05('0x5b')]&&_0x123f99[_0x8c05('0x5b')]!==_0x8c05('0x5c')){logger[_0x8c05('0x22')](_0x8c05('0x5d'),_0x8c05('0x59'));_0x4bf60c['recordingURL']=_0x3149e8;}else{_0x4bf60c[_0x8c05('0x5a')]='';}return getUser(_0x1a2a9f,_0x3ffd76,_0x2cf1f5,_0x34dfb9,_0x17a805,_0xe9275f)[_0x8c05('0x13')](function(_0x306236){logger[_0x8c05('0x22')]('['+_0xe9275f['toUpperCase']()+_0x8c05('0x5e'),_0x306236['userId']);logger['info']('['+_0xe9275f[_0x8c05('0x16')]()+_0x8c05('0x5f'),_0x306236[_0x8c05('0x1e')]);return getEndUser(_0x306236,_0x3ffd76,_0x34dfb9,_0x17a805,_0x4bf60c,_0xe9275f);})[_0x8c05('0x13')](function(_0x41da9a){logger['info']('['+_0xe9275f[_0x8c05('0x16')]()+_0x8c05('0x60'),_0x41da9a[_0x8c05('0x31')]);logger[_0x8c05('0x22')]('['+_0xe9275f[_0x8c05('0x16')]()+']\x20The\x20Enduser\x20phone\x20is:',_0x4bf60c['calleridnum']);return getTicket(_0x41da9a,_0x3ffd76,_0x34dfb9,_0x17a805,_0x4bf60c,_0x20df90,_0xe9275f);})['then'](function(_0x21621b){logger[_0x8c05('0x22')](util['format']('['+_0xe9275f[_0x8c05('0x16')]()+_0x8c05('0x61'),_0x20df90[_0x8c05('0x3c')],_0x21621b[_0x8c05('0x4a')]));logger[_0x8c05('0x22')](util[_0x8c05('0x4c')]('['+_0xe9275f['toUpperCase']()+_0x8c05('0x62'),_0xe9275f));if(_0xe9275f!==_0x8c05('0x52')){logger[_0x8c05('0x22')]('['+_0xe9275f[_0x8c05('0x16')]()+']',_0x8c05('0x63'));emit(_0x3ffd76[_0x8c05('0xf')],_0x2cf1f5[_0x8c05('0x64')],_0x20df90[_0x8c05('0x3c')],_0x21621b[_0x8c05('0x4a')]);}})['catch'](function(_0x49148f){logger['error']('['+_0xe9275f['toUpperCase']()+_0x8c05('0x65'),util[_0x8c05('0x66')](_0x49148f,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x942b=['/systemusers(','Fields','phonecalls','assign','Subjects','/contacts(','callDirection','queue','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','abandoned','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\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','name',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','bluebird','request-promise','util','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','defaults','socket.io-emitter','POST','remoteUri','password','then','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','validateEmail','email','length','isdisabled',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userEmail','toLowerCase','outbound','contacts','headers','odata-entityid','substring','lastIndexOf','enduserId','destcalleridnum','calleridnum','telephone1','contactid','info','forEach','nameField','customField','indexOf','ticketType','incident','incidents','getString','Descriptions'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x942b,0x1f4));var _0xb942=function(_0x254bd0,_0x1c9bef){_0x254bd0=_0x254bd0-0x0;var _0x3cd1a2=_0x942b[_0x254bd0];return _0x3cd1a2;};'use strict';var _=require('lodash');var BPromise=require(_0xb942('0x0'));var rp=require(_0xb942('0x1'));var util=require(_0xb942('0x2'));var intUtil=require(_0xb942('0x3'));var md5=require(_0xb942('0x4'));var Redis=require(_0xb942('0x5'));var logger=require(_0xb942('0x6'))(_0xb942('0x7'));var config=require(_0xb942('0x8'));config[_0xb942('0x9')]=_[_0xb942('0xa')](config[_0xb942('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0xb942('0xb'))(new Redis(config[_0xb942('0x9')]));function getAuthToken(_0x289b47,_0x13e698,_0x144ac9){var _0x1c4c5b={'method':_0xb942('0xc'),'uri':_0x13e698,'form':{'client_id':_0x289b47['clientId'],'resource':_0x289b47[_0xb942('0xd')],'username':_0x289b47['username'],'password':_0x289b47['password'],'grant_type':_0xb942('0xe'),'client_secret':_0x289b47['clientSecret']},'json':!![]};return rp(_0x1c4c5b)[_0xb942('0xf')](function(_0x1f2690){return _0x1f2690['access_token'];})[_0xb942('0x10')](function(_0x41e712){logger[_0xb942('0x11')]('['+[_0x144ac9[_0xb942('0x12')]()]+_0xb942('0x13'));return _0x41e712[_0xb942('0x14')];});}function getUser(_0x4ad43b,_0x361b2b,_0x544c4c,_0x5ed69b,_0x3052d7,_0x2fcf08){return new BPromise(function(_0x1f433f,_0x1030ba){return getAuthToken(_0x361b2b,_0x5ed69b,_0x2fcf08)['then'](function(_0x28bd17){var _0x7d3fa7={'method':_0xb942('0x15'),'uri':_0x3052d7+_0xb942('0x16'),'headers':{'Authorization':_0xb942('0x17')+_0x28bd17,'OData-Version':_0xb942('0x18')},'json':!![]};return rp(_0x7d3fa7);})['then'](function(_0x571961){var _0x13dd9a=_0x571961[_0xb942('0x19')];var _0x3a159b=![];var _0x205bb9=null;if(!_[_0xb942('0x1a')](_0x544c4c)){if(intUtil[_0xb942('0x1b')](_0x544c4c[_0xb942('0x1c')])){_0x4ad43b['userEmail']=_0x544c4c['email'];for(_0x205bb9=0x0;_0x205bb9<_0x13dd9a[_0xb942('0x1d')];_0x205bb9++){if(_0x13dd9a[_0x205bb9]['internalemailaddress']===_0x544c4c[_0xb942('0x1c')]&&!_0x13dd9a[_0x205bb9][_0xb942('0x1e')]){_0x3a159b=!![];logger['info']('['+[_0x2fcf08[_0xb942('0x12')]()]+_0xb942('0x1f')+_0x13dd9a[_0x205bb9][_0xb942('0x20')]+'!');_0x4ad43b[_0xb942('0x21')]=_0x13dd9a[_0x205bb9]['systemuserid'];}}}}if(!_0x3a159b){logger['info']('['+[_0x2fcf08[_0xb942('0x12')]()]+_0xb942('0x22'));_0x4ad43b[_0xb942('0x23')]=_0x361b2b['username'];for(_0x205bb9=0x0;_0x205bb9<_0x13dd9a[_0xb942('0x1d')];_0x205bb9++){if(_0x13dd9a[_0x205bb9]['internalemailaddress']===_0x361b2b['username']){_0x4ad43b[_0xb942('0x21')]=_0x13dd9a[_0x205bb9]['systemuserid'];}}}_0x1f433f(_0x4ad43b);})[_0xb942('0x10')](function(_0x3f3064){_0x1030ba(_0x3f3064[_0xb942('0x14')]);});});}function createEndUser(_0x26a498,_0x47cacf,_0x1b147d,_0x514d98,_0x5b0f1c,_0x2bc1d1){return new BPromise(function(_0x20d929,_0x43204f){return getAuthToken(_0x47cacf,_0x1b147d,_0x2bc1d1)[_0xb942('0xf')](function(_0x4966a7){var _0x2ccee4=_0x2bc1d1[_0xb942('0x24')]()===_0xb942('0x25')?_0x5b0f1c['destcalleridnum']:_0x5b0f1c['calleridnum'];var _0x3f5830={'method':_0xb942('0xc'),'uri':_0x514d98+_0xb942('0x26'),'body':{'telephone1':_0x2ccee4,'fullname':_0x2ccee4,'firstname':_0x2ccee4,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x26a498[_0xb942('0x21')]+')'},'headers':{'Authorization':'Bearer\x20'+_0x4966a7,'OData-Version':_0xb942('0x18')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x3f5830);})['then'](function(_0x5bc752){var _0x1653a8=_0x5bc752[_0xb942('0x27')][_0xb942('0x28')];var _0x3904d5=_0x1653a8[_0xb942('0x29')](_0x1653a8[_0xb942('0x2a')]('(')+0x1,_0x1653a8[_0xb942('0x2a')](')'));_0x26a498[_0xb942('0x2b')]=_0x3904d5;_0x20d929(_0x26a498);})[_0xb942('0x10')](function(_0x1befe0){_0x43204f(_0x1befe0[_0xb942('0x14')]);});});}function getEndUser(_0x391815,_0x258090,_0x3c3f99,_0x4e4d86,_0x45d106,_0x183b18){return new BPromise(function(_0x4daa3e,_0x5b2ba8){return getAuthToken(_0x258090,_0x3c3f99,_0x183b18)['then'](function(_0x1a443f){var _0x357619={'method':'GET','uri':_0x4e4d86+'contacts?$select=telephone1','headers':{'Authorization':_0xb942('0x17')+_0x1a443f,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x357619);})[_0xb942('0xf')](function(_0x4f8a92){var _0x3c84f8=null;if(_0x4f8a92){var _0xe0b5a4=_0x4f8a92[_0xb942('0x19')];var _0x1cb9dd=![];for(_0x3c84f8=0x0;_0x3c84f8<_0xe0b5a4[_0xb942('0x1d')];_0x3c84f8++){var _0x282dd7=_0x183b18['toLowerCase']()===_0xb942('0x25')?_0x45d106[_0xb942('0x2c')]:_0x45d106[_0xb942('0x2d')];if(_0xe0b5a4[_0x3c84f8][_0xb942('0x2e')]===_0x282dd7){_0x1cb9dd=!![];_0x391815[_0xb942('0x2b')]=_0xe0b5a4[_0x3c84f8][_0xb942('0x2f')];}}if(_0x1cb9dd){_0x4daa3e(_0x391815);}else{return createEndUser(_0x391815,_0x258090,_0x3c3f99,_0x4e4d86,_0x45d106,_0x183b18)[_0xb942('0xf')](function(_0x1b4b65){logger[_0xb942('0x30')]('['+[_0x183b18[_0xb942('0x12')]()]+']\x20Enduser\x20created!',_0x1b4b65[_0xb942('0x2b')]);_0x4daa3e(_0x1b4b65);});}}else{return createEndUser(_0x391815,_0x258090,_0x3c3f99,_0x4e4d86,_0x45d106,_0x183b18)[_0xb942('0xf')](function(_0xf48f3f){logger[_0xb942('0x30')]('['+[_0x183b18['toUpperCase']()]+']\x20Enduser\x20Created!',_0xf48f3f[_0xb942('0x2b')]);_0x4daa3e(_0xf48f3f);});}});});}function getCustomFields(_0xb59837,_0x5a1bee,_0x4c30a3){var _0x119461={};if(_0xb59837[_0xb942('0x1d')]>0x0){_[_0xb942('0x31')](_0xb59837,function(_0x5bd100){if(_0x5bd100['type']==='string'&&_0x5bd100[_0xb942('0x32')]&&!_0x5bd100[_0xb942('0x33')]){var _0x53c043=_0x5bd100['idField'][_0xb942('0x24')]();var _0x269da9=_0x53c043[_0xb942('0x29')](0x0,_0x53c043[_0xb942('0x34')]('_'));var _0x1bcdb5=_0x53c043[_0xb942('0x29')](_0x53c043['indexOf']('_')+0x1);if(_0x269da9===_0x4c30a3){_0x119461[_0x1bcdb5]=_0x5bd100['content'];}}});}return _0x119461;}function getTicket(_0x514cf1,_0x230c25,_0xfa0b46,_0x2a3e27,_0x457110,_0x56f913,_0x552580){return new BPromise(function(_0x511c4f,_0x4ceb65){var _0x3e6b63;return getAuthToken(_0x230c25,_0xfa0b46,_0x552580)[_0xb942('0xf')](function(_0x401d44){if(_0x56f913[_0xb942('0x35')]===_0xb942('0x36')){_0x3e6b63={'method':_0xb942('0xc'),'uri':_0x2a3e27+_0xb942('0x37'),'body':Object['assign']({},{'title':intUtil[_0xb942('0x38')](_0x56f913['Subjects'],_0x457110,'\x20'),'description':intUtil[_0xb942('0x38')](_0x56f913[_0xb942('0x39')],_0x457110,'\x0a'),'customerid_contact@odata.bind':'/contacts('+_0x514cf1[_0xb942('0x2b')]+')','ownerid@odata.bind':_0xb942('0x3a')+_0x514cf1[_0xb942('0x21')]+')','caseorigincode':'1'},getCustomFields(_0x56f913[_0xb942('0x3b')],_0x457110,_0x56f913[_0xb942('0x35')])),'headers':{'Authorization':_0xb942('0x17')+_0x401d44,'OData-Version':_0xb942('0x18')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x56f913['ticketType']==='phonecall'){_0x3e6b63={'method':_0xb942('0xc'),'uri':_0x2a3e27+_0xb942('0x3c'),'body':Object[_0xb942('0x3d')]({},{'subject':intUtil[_0xb942('0x38')](_0x56f913[_0xb942('0x3e')],_0x457110,'\x20'),'phonenumber':String(_0x457110[_0xb942('0x2d')]),'description':intUtil[_0xb942('0x38')](_0x56f913['Descriptions'],_0x457110,'\x0a'),'regardingobjectid_contact@odata.bind':_0xb942('0x3f')+_0x514cf1[_0xb942('0x2b')]+')','ownerid@odata.bind':_0xb942('0x3a')+_0x514cf1[_0xb942('0x21')]+')','directioncode':_0x514cf1[_0xb942('0x40')]===_0xb942('0x41')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0xb942('0x3a')+_0x514cf1['userId']+')','participationtypemask':_0x514cf1[_0xb942('0x40')]===_0xb942('0x41')?0x2:0x1},{'partyid_contact@odata.bind':_0xb942('0x3f')+_0x514cf1[_0xb942('0x2b')]+')','participationtypemask':_0x514cf1[_0xb942('0x40')]==='queue'?0x1:0x2}]},getCustomFields(_0x56f913[_0xb942('0x3b')],_0x457110,_0x56f913[_0xb942('0x35')])),'headers':{'Authorization':'Bearer\x20'+_0x401d44,'OData-Version':_0xb942('0x18')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x3e6b63);})[_0xb942('0xf')](function(_0x5b8e30){var _0x3906b5=_0x5b8e30['headers']['odata-entityid'];var _0x436d60=_0x3906b5[_0xb942('0x29')](_0x3906b5['lastIndexOf']('(')+0x1,_0x3906b5[_0xb942('0x2a')](')'));_0x514cf1[_0xb942('0x42')]=_0x436d60;_0x511c4f(_0x514cf1);})[_0xb942('0x10')](function(_0x4c723f){_0x4ceb65(_0x4c723f[_0xb942('0x14')]);});});}function emit(_0x511d42,_0x173b2b,_0x216f53,_0x3830ee){var _0x5651c1={'uri':util[_0xb942('0x43')](_0xb942('0x44'),_0x511d42,_0x216f53,_0x3830ee)};io['to'](util[_0xb942('0x43')](_0xb942('0x45'),_0x173b2b))[_0xb942('0x46')](_0xb942('0x47'),_0x5651c1);}exports['cs']=function(_0xe6b92c,_0x19bc51,_0x2a6058,_0x1af957,_0x3881a5,_0x26818c,_0x256305,_0x361d2d){var _0x537eb9={};_0x26818c['remoteUri']=intUtil[_0xb942('0x48')](_0x26818c[_0xb942('0xd')]);_0x26818c[_0xb942('0x49')]=intUtil[_0xb942('0x48')](_0x26818c[_0xb942('0x49')]);_0x537eb9['callDirection']=_0x361d2d===_0xb942('0x41')||_0x361d2d===_0xb942('0x4a')?_0xb942('0x41'):_0xb942('0x25');var _0xe4476e=util[_0xb942('0x43')]('%s/api/data/v9.0/',_0x26818c[_0xb942('0xd')]);var _0x3d433a=util[_0xb942('0x43')](_0xb942('0x4b'),_0x26818c[_0xb942('0x4c')]);var _0x225986=util[_0xb942('0x43')](_0xb942('0x4d'),_0x26818c[_0xb942('0x49')],_0x19bc51[_0xb942('0x4e')],md5(_0x19bc51[_0xb942('0x4e')]));if(_0x3881a5&&_0x3881a5[_0xb942('0x4f')]){logger[_0xb942('0x30')](_0xb942('0x50'),_0xb942('0x51'));_0x19bc51[_0xb942('0x52')]=_0x225986;}else if(_0x256305&&_0x256305[_0xb942('0x53')]&&_0x256305[_0xb942('0x53')]!==_0xb942('0x54')){logger[_0xb942('0x30')](_0xb942('0x55'),_0xb942('0x51'));_0x19bc51['recordingURL']=_0x225986;}else{_0x19bc51[_0xb942('0x52')]='';}return getUser(_0x537eb9,_0x26818c,_0x1af957,_0x3d433a,_0xe4476e,_0x361d2d)[_0xb942('0xf')](function(_0x27107d){logger[_0xb942('0x30')]('['+_0x361d2d[_0xb942('0x12')]()+']\x20The\x20User\x20ID\x20is:',_0x27107d[_0xb942('0x21')]);logger[_0xb942('0x30')]('['+_0x361d2d['toUpperCase']()+']\x20The\x20User\x20email\x20is:',_0x27107d[_0xb942('0x23')]);return getEndUser(_0x27107d,_0x26818c,_0x3d433a,_0xe4476e,_0x19bc51,_0x361d2d);})['then'](function(_0x271383){logger[_0xb942('0x30')]('['+_0x361d2d[_0xb942('0x12')]()+_0xb942('0x56'),_0x271383['enduserId']);logger[_0xb942('0x30')]('['+_0x361d2d['toUpperCase']()+_0xb942('0x57'),_0x19bc51['calleridnum']);return getTicket(_0x271383,_0x26818c,_0x3d433a,_0xe4476e,_0x19bc51,_0x2a6058,_0x361d2d);})[_0xb942('0xf')](function(_0x2bbb10){logger[_0xb942('0x30')](util[_0xb942('0x43')]('['+_0x361d2d[_0xb942('0x12')]()+_0xb942('0x58'),_0x2a6058['ticketType'],_0x2bbb10[_0xb942('0x42')]));logger[_0xb942('0x30')](util['format']('['+_0x361d2d[_0xb942('0x12')]()+_0xb942('0x59'),_0x361d2d));if(_0x361d2d!==_0xb942('0x4a')){logger[_0xb942('0x30')]('['+_0x361d2d[_0xb942('0x12')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x26818c[_0xb942('0xd')],_0x1af957[_0xb942('0x5a')],_0x2a6058[_0xb942('0x35')],_0x2bbb10[_0xb942('0x42')]);}})['catch'](function(_0x263daa){logger[_0xb942('0x11')]('['+_0x361d2d[_0xb942('0x12')]()+_0xb942('0x5b'),util[_0xb942('0x5c')](_0x263daa,{'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 02c17e9..7bd7777 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 _0xeb91=['Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','calleridname','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/helpdesk/tickets/%d','catch','outbound','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','abandoned','monitor_format','error','lodash','md5','util','ioredis','../../../../config/environment','../../../../config/logger','freshdesk','defaults','redis','localhost','socket.io-emitter','emit','info','Creating\x20new\x20ticket...','format','calleridnum','getString','Subjects','Descriptions','
','Tags','name','Fields','mapValues','custom_fields','value','%s/api/v2/tickets','remoteUri','POST','then','%s/api/v2/agents','length','Agent\x20found!','find','email','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/contacts','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','toString','debug','[HTTP]','stringify','map','forEach','type','string','nameField','customField','content','idField','push','variable','variableName','Variable','queue','stripTrailingSlash','serverUrl','[QUEUE]'];(function(_0x571a2c,_0x55dbb0){var _0x1cc56a=function(_0x6d59d5){while(--_0x6d59d5){_0x571a2c['push'](_0x571a2c['shift']());}};_0x1cc56a(++_0x55dbb0);}(_0xeb91,0x6c));var _0x1eb9=function(_0x507b3b,_0x30c190){_0x507b3b=_0x507b3b-0x0;var _0xe1e48e=_0xeb91[_0x507b3b];return _0xe1e48e;};'use strict';var _=require(_0x1eb9('0x0'));var rp=require('request-promise');var md5=require(_0x1eb9('0x1'));var util=require(_0x1eb9('0x2'));var Redis=require(_0x1eb9('0x3'));var intUtil=require('./util');var config=require(_0x1eb9('0x4'));var logger=require(_0x1eb9('0x5'))(_0x1eb9('0x6'));config['redis']=_[_0x1eb9('0x7')](config[_0x1eb9('0x8')],{'host':_0x1eb9('0x9'),'port':0x18eb});var io=require(_0x1eb9('0xa'))(new Redis(config[_0x1eb9('0x8')]));var headers={'Content-Type':'application/json','Accept':'application/json'};function emit(_0x5a82ca,_0xd6eb6,_0x1c72c8){io['to'](_0x5a82ca)[_0x1eb9('0xb')](_0xd6eb6,_0x1c72c8);}function getTicket(_0x4fe22f,_0x9d9b8f,_0x14795f,_0xb9c6e7,_0x35aac8){logger[_0x1eb9('0xc')](_0x1eb9('0xd'));var _0x4434f4=_['merge']({'responder_id':_0x9d9b8f['id'],'requester_id':_0x14795f['id'],'name':util[_0x1eb9('0xe')]('Caller\x20-\x20%s',_0x35aac8['calleridname']),'phone':_0x35aac8[_0x1eb9('0xf')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x1eb9('0x10')](_0xb9c6e7[_0x1eb9('0x11')],_0x35aac8,'\x20'),'description':intUtil[_0x1eb9('0x10')](_0xb9c6e7[_0x1eb9('0x12')],_0x35aac8,_0x1eb9('0x13')),'tags':getTags(_0xb9c6e7[_0x1eb9('0x14')],_0x1eb9('0x15'))},getCustomFields(_0xb9c6e7[_0x1eb9('0x16')],_0x35aac8));_0x4434f4['custom_fields']=_[_0x1eb9('0x17')](_['keyBy'](_0x4434f4[_0x1eb9('0x18')],'id'),_0x1eb9('0x19'));return request({'uri':util[_0x1eb9('0xe')](_0x1eb9('0x1a'),_0x4fe22f[_0x1eb9('0x1b')]),'method':_0x1eb9('0x1c'),'body':_0x4434f4})[_0x1eb9('0x1d')](function(_0x51cf30){logger[_0x1eb9('0xc')]('Ticket\x20created!');return _0x51cf30;});}function getUser(_0x43715a,_0x227abd){if(intUtil['validateEmail'](_0x227abd)){return request({'uri':util[_0x1eb9('0xe')](_0x1eb9('0x1e'),_0x43715a[_0x1eb9('0x1b')]),'qs':{'email':_0x227abd}})[_0x1eb9('0x1d')](function(_0x2e04bf){if(_0x2e04bf[_0x1eb9('0x1f')]){logger[_0x1eb9('0xc')](_0x1eb9('0x20'));return _[_0x1eb9('0x21')](_0x2e04bf,function(_0x42f846){return _0x42f846['contact'][_0x1eb9('0x22')]===_0x227abd;});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x1eb9('0xe')]('%s/api/v2/agents/me',_0x43715a['remoteUri'])})[_0x1eb9('0x1d')](function(_0x1b26c7){logger[_0x1eb9('0xc')](_0x1eb9('0x23'));return _0x1b26c7;});}});}else{logger[_0x1eb9('0xc')](_0x1eb9('0x24'));return request({'uri':util[_0x1eb9('0xe')]('%s/api/v2/agents/me',_0x43715a[_0x1eb9('0x1b')])})[_0x1eb9('0x1d')](function(_0x1a5377){logger[_0x1eb9('0xc')](_0x1eb9('0x23'));return _0x1a5377;});}}function getEndUser(_0x4b0237,_0x241500,_0x36e2cf){logger['info']('Searching\x20enduser\x20with\x20phone',_0x36e2cf);return request({'uri':util[_0x1eb9('0xe')](_0x1eb9('0x25'),_0x4b0237[_0x1eb9('0x1b')]),'qs':{'phone':_0x36e2cf}})[_0x1eb9('0x1d')](function(_0x3a274f){if(_0x3a274f[_0x1eb9('0x1f')]){logger[_0x1eb9('0xc')]('Enduser\x20found!');return _[_0x1eb9('0x21')](_0x3a274f,{'phone':_0x36e2cf});}else{logger[_0x1eb9('0xc')](_0x1eb9('0x26'));return request({'uri':util[_0x1eb9('0xe')](_0x1eb9('0x25'),_0x4b0237[_0x1eb9('0x1b')]),'method':_0x1eb9('0x1c'),'body':{'name':_0x241500,'phone':_0x36e2cf}})[_0x1eb9('0x1d')](function(_0x535a85){logger[_0x1eb9('0xc')](_0x1eb9('0x27'));return _0x535a85;});}});}function getAuth(_0x558c3a){return util[_0x1eb9('0xe')]('Basic\x20%s',new Buffer(_0x558c3a['apiKey']+':X')[_0x1eb9('0x28')]('base64'));}function request(_0x43844b){logger[_0x1eb9('0x29')](_0x1eb9('0x2a'),JSON[_0x1eb9('0x2b')](_0x43844b));return rp(_[_0x1eb9('0x7')](_0x43844b,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x386486,_0x5388e6){var _0x4e8836=[];if(_0x386486&&_0x386486[_0x1eb9('0x1f')]>0x0){_0x4e8836=_[_0x1eb9('0x2c')](_0x386486,_0x5388e6);}return _0x4e8836;}function getCustomFields(_0x1cab61,_0x55b175){var _0xcf8780=[];var _0x234e8d={'custom_fields':[]};if(_0x1cab61[_0x1eb9('0x1f')]>0x0){_[_0x1eb9('0x2d')](_0x1cab61,function(_0x2234cb){if(_0x2234cb[_0x1eb9('0x2e')]===_0x1eb9('0x2f')&&_0x2234cb[_0x1eb9('0x30')]&&!_0x2234cb[_0x1eb9('0x31')]){_0x234e8d[_0x2234cb['nameField']['toLowerCase']()]=_0x2234cb[_0x1eb9('0x32')][_0x1eb9('0x28')]();}else if(_0x2234cb[_0x1eb9('0x2e')]===_0x1eb9('0x2f')&&_0x2234cb[_0x1eb9('0x33')]&&_0x2234cb['customField']){_0x234e8d['custom_fields'][_0x1eb9('0x34')]({'id':_0x2234cb[_0x1eb9('0x33')],'value':_0x2234cb['content'][_0x1eb9('0x28')]()});}else if(_0x2234cb[_0x1eb9('0x2e')]===_0x1eb9('0x35')&&_0x2234cb[_0x1eb9('0x36')]&&_0x2234cb['idField']&&_0x2234cb['customField']){_0x55b175[_0x2234cb['variableName']]&&_0x234e8d['custom_fields']['push']({'id':_0x2234cb[_0x1eb9('0x33')],'value':_0x55b175[_0x2234cb[_0x1eb9('0x36')]][_0x1eb9('0x28')]()});}else if(_0x2234cb[_0x1eb9('0x2e')]==='customVariable'&&_0x2234cb[_0x1eb9('0x37')]&&_0x2234cb[_0x1eb9('0x37')][_0x1eb9('0x15')]&&_0x2234cb['idField']&&_0x2234cb['customField']){_0x55b175[_0x2234cb['Variable'][_0x1eb9('0x15')]['toLowerCase']()]&&_0x234e8d[_0x1eb9('0x18')][_0x1eb9('0x34')]({'id':_0x2234cb[_0x1eb9('0x33')],'value':_0x55b175[_0x2234cb[_0x1eb9('0x37')][_0x1eb9('0x15')]['toLowerCase']()][_0x1eb9('0x28')]()});}});}return _0x234e8d;}exports[_0x1eb9('0x38')]=function(_0x4907f1,_0x4f6034,_0x1587fc,_0x248308,_0x31aabb,_0x3fa3ca){var _0x4d6acf,_0xdce671;_0x3fa3ca[_0x1eb9('0x1b')]=intUtil[_0x1eb9('0x39')](_0x3fa3ca[_0x1eb9('0x1b')]);_0x3fa3ca['serverUrl']=intUtil[_0x1eb9('0x39')](_0x3fa3ca[_0x1eb9('0x3a')]);if(_0x31aabb&&_0x31aabb['monitor_format']){logger[_0x1eb9('0xc')](_0x1eb9('0x3b'),_0x1eb9('0x3c'));_0x4f6034[_0x1eb9('0x3d')]=util[_0x1eb9('0xe')](_0x1eb9('0x3e'),_0x3fa3ca[_0x1eb9('0x3a')],_0x4f6034[_0x1eb9('0x3f')],md5(_0x4f6034[_0x1eb9('0x3f')]));}else{_0x4f6034[_0x1eb9('0x3d')]='';}headers[_0x1eb9('0x40')]=getAuth(_0x3fa3ca);return getUser(_0x3fa3ca,_0x248308[_0x1eb9('0x22')])[_0x1eb9('0x1d')](function(_0x31c643){_0x4d6acf=_0x31c643;logger[_0x1eb9('0xc')]('The\x20User\x20ID\x20is:',_0x4d6acf['id']);return getEndUser(_0x3fa3ca,_0x4f6034[_0x1eb9('0x41')],_0x4f6034['calleridnum']);})['then'](function(_0x53b269){_0xdce671=_0x53b269;logger[_0x1eb9('0xc')](_0x1eb9('0x42'),_0xdce671['id']);return getTicket(_0x3fa3ca,_0x4d6acf,_0xdce671,_0x1587fc,_0x4f6034);})['then'](function(_0x4193aa){if(_0x4193aa&&_0x4193aa['id']){logger['info'](_0x1eb9('0x43'));logger[_0x1eb9('0xc')]('The\x20Ticket\x20ID\x20is:',_0x4193aa['id']);logger[_0x1eb9('0xc')](_0x1eb9('0x3b'),_0x1eb9('0x44'));emit(util[_0x1eb9('0xe')]('user:%s',_0x248308[_0x1eb9('0x15')]),_0x1eb9('0x45'),{'uri':util[_0x1eb9('0xe')](_0x1eb9('0x46'),_0x3fa3ca[_0x1eb9('0x1b')],_0x4193aa['id'])});}})[_0x1eb9('0x47')](function(_0x1931fe){logger['error'](_0x1eb9('0x3b'),JSON[_0x1eb9('0x2b')](_0x1931fe));});};exports[_0x1eb9('0x48')]=function(_0x2fe8bd,_0x312200,_0x48dd35,_0xe9b9e9,_0x344788,_0x27f872,_0x53cf3b){var _0x5ed43a,_0x58bba0;_0x27f872[_0x1eb9('0x1b')]=intUtil[_0x1eb9('0x39')](_0x27f872['remoteUri']);_0x27f872['serverUrl']=intUtil[_0x1eb9('0x39')](_0x27f872[_0x1eb9('0x3a')]);if(_0x53cf3b&&_0x53cf3b[_0x1eb9('0x49')]&&_0x53cf3b['recordingFormat']!==_0x1eb9('0x4a')){logger[_0x1eb9('0xc')](_0x1eb9('0x4b'),_0x1eb9('0x3c'));_0x312200[_0x1eb9('0x3d')]=util[_0x1eb9('0xe')](_0x1eb9('0x3e'),_0x27f872[_0x1eb9('0x3a')],_0x312200['uniqueid'],md5(_0x312200[_0x1eb9('0x3f')]));}headers[_0x1eb9('0x40')]=getAuth(_0x27f872);return getUser(_0x27f872,_0xe9b9e9[_0x1eb9('0x22')])[_0x1eb9('0x1d')](function(_0x407b5b){_0x5ed43a=_0x407b5b;logger[_0x1eb9('0xc')](_0x1eb9('0x4c'),_0x5ed43a['id']);return getEndUser(_0x27f872,_0x312200[_0x1eb9('0x4d')],_0x312200[_0x1eb9('0x4e')]);})['then'](function(_0x259136){_0x58bba0=_0x259136;logger[_0x1eb9('0xc')](_0x1eb9('0x42'),_0x58bba0['id']);return getTicket(_0x27f872,_0x5ed43a,_0x58bba0,_0x48dd35,_0x312200);})[_0x1eb9('0x1d')](function(_0x50136f){if(_0x50136f&&_0x50136f['id']){logger[_0x1eb9('0xc')](_0x1eb9('0x43'));logger[_0x1eb9('0xc')](_0x1eb9('0x4f'),_0x50136f['id']);logger[_0x1eb9('0xc')](_0x1eb9('0x4b'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x1eb9('0xe')](_0x1eb9('0x50'),_0xe9b9e9[_0x1eb9('0x15')]),_0x1eb9('0x45'),{'uri':util[_0x1eb9('0xe')](_0x1eb9('0x46'),_0x27f872[_0x1eb9('0x1b')],_0x50136f['id'])});}})[_0x1eb9('0x47')](function(_0x43ce34){logger['error'](_0x1eb9('0x4b'),JSON[_0x1eb9('0x2b')](_0x43ce34));});};exports[_0x1eb9('0x51')]=function(_0xdb8ad,_0x5e92d2,_0x5f3386,_0x303c70,_0x70cd4f,_0x134a2e){var _0x2d4411,_0xc24c0a;_0x134a2e[_0x1eb9('0x1b')]=intUtil[_0x1eb9('0x39')](_0x134a2e[_0x1eb9('0x1b')]);_0x134a2e[_0x1eb9('0x3a')]=intUtil[_0x1eb9('0x39')](_0x134a2e[_0x1eb9('0x3a')]);if(_0x70cd4f&&_0x70cd4f[_0x1eb9('0x52')]){logger[_0x1eb9('0xc')]('[ABANDONED]',_0x1eb9('0x3c'));_0x5e92d2['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x134a2e['serverUrl'],_0x5e92d2[_0x1eb9('0x3f')],md5(_0x5e92d2[_0x1eb9('0x3f')]));}else{_0x5e92d2[_0x1eb9('0x3d')]='';}headers[_0x1eb9('0x40')]=getAuth(_0x134a2e);return getUser(_0x134a2e,'')[_0x1eb9('0x1d')](function(_0x2fa2f6){_0x2d4411=_0x2fa2f6;logger[_0x1eb9('0xc')]('The\x20User\x20ID\x20is:',_0x2d4411['id']);return getEndUser(_0x134a2e,_0x5e92d2[_0x1eb9('0x41')],_0x5e92d2[_0x1eb9('0xf')]);})[_0x1eb9('0x1d')](function(_0x13229e){_0xc24c0a=_0x13229e;logger[_0x1eb9('0xc')](_0x1eb9('0x42'),_0xc24c0a['id']);return getTicket(_0x134a2e,_0x2d4411,_0xc24c0a,_0x5f3386,_0x5e92d2);})[_0x1eb9('0x1d')](function(_0x30e533){if(_0x30e533){logger[_0x1eb9('0xc')](_0x1eb9('0x43'));logger[_0x1eb9('0xc')](_0x1eb9('0x4f'),_0x30e533['id']);}})[_0x1eb9('0x47')](function(_0x2bdb53){logger[_0x1eb9('0x53')]('[ABANDONED]',JSON[_0x1eb9('0x2b')](_0x2bdb53));});}; \ No newline at end of file +var _0x4f42=['%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.','Basic\x20%s','base64','debug','[HTTP]','stringify','defaults','map','forEach','nameField','customField','toLowerCase','content','toString','type','string','idField','variable','variableName','customVariable','Variable','name','queue','serverUrl','stripTrailingSlash','monitor_format','recordingURL','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','[QUEUE]','user:%s','trigger:browser:url','catch','error','outbound','recordingFormat','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','%s/helpdesk/tickets/%d','abandoned','[ABANDONED]','lodash','md5','util','ioredis','./util','../../../../config/environment','freshdesk','redis','localhost','socket.io-emitter','application/json','emit','Creating\x20new\x20ticket...','format','calleridnum','getString','Subjects','Descriptions','
','Fields','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','remoteUri','POST','then','info','Ticket\x20created!','validateEmail','%s/api/v2/agents','length','Agent\x20found!','email'];(function(_0x277757,_0x28f4e0){var _0x2deb13=function(_0x250c55){while(--_0x250c55){_0x277757['push'](_0x277757['shift']());}};_0x2deb13(++_0x28f4e0);}(_0x4f42,0x145));var _0x24f4=function(_0x6c6f23,_0xfb73d3){_0x6c6f23=_0x6c6f23-0x0;var _0x1c73ac=_0x4f42[_0x6c6f23];return _0x1c73ac;};'use strict';var _=require(_0x24f4('0x0'));var rp=require('request-promise');var md5=require(_0x24f4('0x1'));var util=require(_0x24f4('0x2'));var Redis=require(_0x24f4('0x3'));var intUtil=require(_0x24f4('0x4'));var config=require(_0x24f4('0x5'));var logger=require('../../../../config/logger')(_0x24f4('0x6'));config[_0x24f4('0x7')]=_['defaults'](config[_0x24f4('0x7')],{'host':_0x24f4('0x8'),'port':0x18eb});var io=require(_0x24f4('0x9'))(new Redis(config[_0x24f4('0x7')]));var headers={'Content-Type':_0x24f4('0xa'),'Accept':'application/json'};function emit(_0xc83acd,_0x1bf4c2,_0x5718b6){io['to'](_0xc83acd)[_0x24f4('0xb')](_0x1bf4c2,_0x5718b6);}function getTicket(_0x53f0e7,_0x7469d3,_0x19a6ea,_0x2c4065,_0x3c98dc){logger['info'](_0x24f4('0xc'));var _0x15a09f=_['merge']({'responder_id':_0x7469d3['id'],'requester_id':_0x19a6ea['id'],'name':util[_0x24f4('0xd')]('Caller\x20-\x20%s',_0x3c98dc['calleridname']),'phone':_0x3c98dc[_0x24f4('0xe')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x24f4('0xf')](_0x2c4065[_0x24f4('0x10')],_0x3c98dc,'\x20'),'description':intUtil[_0x24f4('0xf')](_0x2c4065[_0x24f4('0x11')],_0x3c98dc,_0x24f4('0x12')),'tags':getTags(_0x2c4065['Tags'],'name')},getCustomFields(_0x2c4065[_0x24f4('0x13')],_0x3c98dc));_0x15a09f[_0x24f4('0x14')]=_[_0x24f4('0x15')](_[_0x24f4('0x16')](_0x15a09f['custom_fields'],'id'),_0x24f4('0x17'));return request({'uri':util[_0x24f4('0xd')](_0x24f4('0x18'),_0x53f0e7[_0x24f4('0x19')]),'method':_0x24f4('0x1a'),'body':_0x15a09f})[_0x24f4('0x1b')](function(_0x4e8dca){logger[_0x24f4('0x1c')](_0x24f4('0x1d'));return _0x4e8dca;});}function getUser(_0x6d1be6,_0x46d313){if(intUtil[_0x24f4('0x1e')](_0x46d313)){return request({'uri':util[_0x24f4('0xd')](_0x24f4('0x1f'),_0x6d1be6[_0x24f4('0x19')]),'qs':{'email':_0x46d313}})['then'](function(_0x1ea832){if(_0x1ea832[_0x24f4('0x20')]){logger[_0x24f4('0x1c')](_0x24f4('0x21'));return _['find'](_0x1ea832,function(_0xd4977){return _0xd4977['contact'][_0x24f4('0x22')]===_0x46d313;});}else{logger[_0x24f4('0x1c')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0x24f4('0x23'),_0x6d1be6['remoteUri'])})['then'](function(_0xabd95d){logger[_0x24f4('0x1c')](_0x24f4('0x24'));return _0xabd95d;});}});}else{logger['info'](_0x24f4('0x25'));return request({'uri':util[_0x24f4('0xd')](_0x24f4('0x23'),_0x6d1be6['remoteUri'])})['then'](function(_0x47d4c2){logger[_0x24f4('0x1c')](_0x24f4('0x24'));return _0x47d4c2;});}}function getEndUser(_0x4799be,_0x5d9ebc,_0x194e24){logger[_0x24f4('0x1c')](_0x24f4('0x26'),_0x194e24);return request({'uri':util[_0x24f4('0xd')](_0x24f4('0x27'),_0x4799be['remoteUri']),'qs':{'phone':_0x194e24}})[_0x24f4('0x1b')](function(_0x53d1f7){if(_0x53d1f7[_0x24f4('0x20')]){logger[_0x24f4('0x1c')](_0x24f4('0x28'));return _[_0x24f4('0x29')](_0x53d1f7,{'phone':_0x194e24});}else{logger['info'](_0x24f4('0x2a'));return request({'uri':util[_0x24f4('0xd')](_0x24f4('0x27'),_0x4799be[_0x24f4('0x19')]),'method':_0x24f4('0x1a'),'body':{'name':_0x5d9ebc,'phone':_0x194e24}})['then'](function(_0x23832c){logger[_0x24f4('0x1c')](_0x24f4('0x2b'));return _0x23832c;});}});}function getAuth(_0x3f4e0d){return util[_0x24f4('0xd')](_0x24f4('0x2c'),new Buffer(_0x3f4e0d['apiKey']+':X')['toString'](_0x24f4('0x2d')));}function request(_0x2a5ff7){logger[_0x24f4('0x2e')](_0x24f4('0x2f'),JSON[_0x24f4('0x30')](_0x2a5ff7));return rp(_[_0x24f4('0x31')](_0x2a5ff7,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x8e45aa,_0x4b1fb8){var _0x2675d4=[];if(_0x8e45aa&&_0x8e45aa[_0x24f4('0x20')]>0x0){_0x2675d4=_[_0x24f4('0x32')](_0x8e45aa,_0x4b1fb8);}return _0x2675d4;}function getCustomFields(_0x3431d2,_0x532f16){var _0x14c4c0=[];var _0x31bbee={'custom_fields':[]};if(_0x3431d2[_0x24f4('0x20')]>0x0){_[_0x24f4('0x33')](_0x3431d2,function(_0x6b7b80){if(_0x6b7b80['type']==='string'&&_0x6b7b80[_0x24f4('0x34')]&&!_0x6b7b80[_0x24f4('0x35')]){_0x31bbee[_0x6b7b80[_0x24f4('0x34')][_0x24f4('0x36')]()]=_0x6b7b80[_0x24f4('0x37')][_0x24f4('0x38')]();}else if(_0x6b7b80[_0x24f4('0x39')]===_0x24f4('0x3a')&&_0x6b7b80[_0x24f4('0x3b')]&&_0x6b7b80[_0x24f4('0x35')]){_0x31bbee['custom_fields']['push']({'id':_0x6b7b80[_0x24f4('0x3b')],'value':_0x6b7b80[_0x24f4('0x37')][_0x24f4('0x38')]()});}else if(_0x6b7b80['type']===_0x24f4('0x3c')&&_0x6b7b80['variableName']&&_0x6b7b80['idField']&&_0x6b7b80[_0x24f4('0x35')]){_0x532f16[_0x6b7b80[_0x24f4('0x3d')]]&&_0x31bbee[_0x24f4('0x14')]['push']({'id':_0x6b7b80['idField'],'value':_0x532f16[_0x6b7b80[_0x24f4('0x3d')]][_0x24f4('0x38')]()});}else if(_0x6b7b80[_0x24f4('0x39')]===_0x24f4('0x3e')&&_0x6b7b80[_0x24f4('0x3f')]&&_0x6b7b80['Variable'][_0x24f4('0x40')]&&_0x6b7b80[_0x24f4('0x3b')]&&_0x6b7b80[_0x24f4('0x35')]){_0x532f16[_0x6b7b80['Variable'][_0x24f4('0x40')][_0x24f4('0x36')]()]&&_0x31bbee[_0x24f4('0x14')]['push']({'id':_0x6b7b80[_0x24f4('0x3b')],'value':_0x532f16[_0x6b7b80[_0x24f4('0x3f')][_0x24f4('0x40')][_0x24f4('0x36')]()][_0x24f4('0x38')]()});}});}return _0x31bbee;}exports[_0x24f4('0x41')]=function(_0x181796,_0x157e42,_0x1d41e5,_0x5bdd8b,_0x498a93,_0x4d6b80){var _0x32c7c4,_0x2ab1d6;_0x4d6b80['remoteUri']=intUtil['stripTrailingSlash'](_0x4d6b80['remoteUri']);_0x4d6b80[_0x24f4('0x42')]=intUtil[_0x24f4('0x43')](_0x4d6b80[_0x24f4('0x42')]);if(_0x498a93&&_0x498a93[_0x24f4('0x44')]){logger[_0x24f4('0x1c')]('[QUEUE]','Recording\x20is\x20enabled!');_0x157e42[_0x24f4('0x45')]=util[_0x24f4('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4d6b80[_0x24f4('0x42')],_0x157e42[_0x24f4('0x46')],md5(_0x157e42[_0x24f4('0x46')]));}else{_0x157e42[_0x24f4('0x45')]='';}headers[_0x24f4('0x47')]=getAuth(_0x4d6b80);return getUser(_0x4d6b80,_0x5bdd8b[_0x24f4('0x22')])[_0x24f4('0x1b')](function(_0x55ee6c){_0x32c7c4=_0x55ee6c;logger['info'](_0x24f4('0x48'),_0x32c7c4['id']);return getEndUser(_0x4d6b80,_0x157e42[_0x24f4('0x49')],_0x157e42[_0x24f4('0xe')]);})[_0x24f4('0x1b')](function(_0x5851eb){_0x2ab1d6=_0x5851eb;logger[_0x24f4('0x1c')](_0x24f4('0x4a'),_0x2ab1d6['id']);return getTicket(_0x4d6b80,_0x32c7c4,_0x2ab1d6,_0x1d41e5,_0x157e42);})[_0x24f4('0x1b')](function(_0x5b5d7e){if(_0x5b5d7e&&_0x5b5d7e['id']){logger[_0x24f4('0x1c')](_0x24f4('0x1d'));logger[_0x24f4('0x1c')](_0x24f4('0x4b'),_0x5b5d7e['id']);logger[_0x24f4('0x1c')](_0x24f4('0x4c'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x24f4('0xd')](_0x24f4('0x4d'),_0x5bdd8b[_0x24f4('0x40')]),_0x24f4('0x4e'),{'uri':util[_0x24f4('0xd')]('%s/helpdesk/tickets/%d',_0x4d6b80[_0x24f4('0x19')],_0x5b5d7e['id'])});}})[_0x24f4('0x4f')](function(_0x5134e1){logger[_0x24f4('0x50')]('[QUEUE]',JSON[_0x24f4('0x30')](_0x5134e1));});};exports[_0x24f4('0x51')]=function(_0x304495,_0x42218e,_0x2368f8,_0x37feee,_0x210521,_0xf81be5,_0x37bf23){var _0x407616,_0x4f03ff;_0xf81be5['remoteUri']=intUtil[_0x24f4('0x43')](_0xf81be5[_0x24f4('0x19')]);_0xf81be5[_0x24f4('0x42')]=intUtil[_0x24f4('0x43')](_0xf81be5[_0x24f4('0x42')]);if(_0x37bf23&&_0x37bf23[_0x24f4('0x52')]&&_0x37bf23[_0x24f4('0x52')]!=='none'){logger['info'](_0x24f4('0x53'),'Recording\x20is\x20enabled!');_0x42218e[_0x24f4('0x45')]=util['format'](_0x24f4('0x54'),_0xf81be5['serverUrl'],_0x42218e['uniqueid'],md5(_0x42218e['uniqueid']));}headers[_0x24f4('0x47')]=getAuth(_0xf81be5);return getUser(_0xf81be5,_0x37feee[_0x24f4('0x22')])['then'](function(_0x1d0a4e){_0x407616=_0x1d0a4e;logger['info'](_0x24f4('0x48'),_0x407616['id']);return getEndUser(_0xf81be5,_0x42218e[_0x24f4('0x55')],_0x42218e[_0x24f4('0x56')]);})[_0x24f4('0x1b')](function(_0x333ed7){_0x4f03ff=_0x333ed7;logger[_0x24f4('0x1c')](_0x24f4('0x4a'),_0x4f03ff['id']);return getTicket(_0xf81be5,_0x407616,_0x4f03ff,_0x2368f8,_0x42218e);})[_0x24f4('0x1b')](function(_0x21ef1b){if(_0x21ef1b&&_0x21ef1b['id']){logger['info'](_0x24f4('0x1d'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x21ef1b['id']);logger['info'](_0x24f4('0x53'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x24f4('0xd')](_0x24f4('0x4d'),_0x37feee['name']),_0x24f4('0x4e'),{'uri':util[_0x24f4('0xd')](_0x24f4('0x57'),_0xf81be5['remoteUri'],_0x21ef1b['id'])});}})[_0x24f4('0x4f')](function(_0x1a1acf){logger[_0x24f4('0x50')](_0x24f4('0x53'),JSON[_0x24f4('0x30')](_0x1a1acf));});};exports[_0x24f4('0x58')]=function(_0x2019f6,_0x481d0c,_0x962d30,_0x20f9eb,_0x1b8c4a,_0x4d7508){var _0x41fb03,_0x3b0ee3;_0x4d7508[_0x24f4('0x19')]=intUtil[_0x24f4('0x43')](_0x4d7508[_0x24f4('0x19')]);_0x4d7508['serverUrl']=intUtil[_0x24f4('0x43')](_0x4d7508['serverUrl']);if(_0x1b8c4a&&_0x1b8c4a['monitor_format']){logger['info'](_0x24f4('0x59'),'Recording\x20is\x20enabled!');_0x481d0c[_0x24f4('0x45')]=util['format'](_0x24f4('0x54'),_0x4d7508['serverUrl'],_0x481d0c[_0x24f4('0x46')],md5(_0x481d0c[_0x24f4('0x46')]));}else{_0x481d0c[_0x24f4('0x45')]='';}headers[_0x24f4('0x47')]=getAuth(_0x4d7508);return getUser(_0x4d7508,'')['then'](function(_0x4888f0){_0x41fb03=_0x4888f0;logger[_0x24f4('0x1c')](_0x24f4('0x48'),_0x41fb03['id']);return getEndUser(_0x4d7508,_0x481d0c[_0x24f4('0x49')],_0x481d0c[_0x24f4('0xe')]);})[_0x24f4('0x1b')](function(_0x4acb66){_0x3b0ee3=_0x4acb66;logger['info'](_0x24f4('0x4a'),_0x3b0ee3['id']);return getTicket(_0x4d7508,_0x41fb03,_0x3b0ee3,_0x962d30,_0x481d0c);})[_0x24f4('0x1b')](function(_0x726df){if(_0x726df){logger[_0x24f4('0x1c')](_0x24f4('0x1d'));logger[_0x24f4('0x1c')](_0x24f4('0x4b'),_0x726df['id']);}})[_0x24f4('0x4f')](function(_0x32388c){logger[_0x24f4('0x50')](_0x24f4('0x59'),JSON[_0x24f4('0x30')](_0x32388c));});}; \ 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 f934730..ca5ce68 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 _0x2760=[']\x20Error\x20running\x20Freshsales\x20integration','md5','util','moment','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','headers','info','Getting\x20admin\x20information','then','users','length','email','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','GET','/api/selector/owners','Getting\x20user\x20list','agentEmail','userEmail','User\x20found:','userId','Admin\x20selected','message','/api/contacts/filters','filters','forEach','name','Getting\x20contact\x20list','/api/contacts/view/','Searching\x20contact\x20with\x20phone','find','contacts','contactNumber','mobile_number','endUserId','Contact\x20found:','Contact\x20created:','POST','/api/contacts','format','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','Descriptions','Contact','add','ticketId','task','Task\x20created:','/contacts/','user:%s','trigger:browser:url','Token\x20token=','apiKey','remoteUri','serverUrl','stripTrailingSlash','username','outbound','destcalleridnum','calleridnum','queue','abandoned','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','[OUTBOUND]'];(function(_0x189d12,_0x17aafc){var _0x39b0ad=function(_0x21a7de){while(--_0x21a7de){_0x189d12['push'](_0x189d12['shift']());}};_0x39b0ad(++_0x17aafc);}(_0x2760,0xaf));var _0x0276=function(_0x2ca9d4,_0x51d5c6){_0x2ca9d4=_0x2ca9d4-0x0;var _0x258956=_0x2760[_0x2ca9d4];return _0x258956;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0x0276('0x0'));var util=require(_0x0276('0x1'));var moment=require(_0x0276('0x2'));var Promise=require(_0x0276('0x3'));var Redis=require(_0x0276('0x4'));var intUtil=require(_0x0276('0x5'));var config=require(_0x0276('0x6'));var logger=require(_0x0276('0x7'))('freshsales');config[_0x0276('0x8')]=_[_0x0276('0x9')](config[_0x0276('0x8')],{'host':_0x0276('0xa'),'port':0x18eb});var io=require(_0x0276('0xb'))(new Redis(config['redis']));function getAdminId(_0x45365a,_0x42a300,_0x565a81,_0xf257bf){return new Promise(function(_0x5b2cdb,_0x3fb127){var _0x15ee18=![];var _0x44e44f={'method':'GET','uri':_0xf257bf+'/api/selector/owners','json':!![]};_0x44e44f[_0x0276('0xc')]=_0x565a81;logger[_0x0276('0xd')](_0x0276('0xe'));return rp(_0x44e44f)[_0x0276('0xf')](function(_0x1336f2){if(_0x1336f2){var _0x3d429e=_0x1336f2[_0x0276('0x10')];var _0x709883=null;for(_0x709883=0x0;_0x709883<_0x3d429e[_0x0276('0x11')];_0x709883++){if(_0x3d429e[_0x709883][_0x0276('0x12')]===_0x45365a[_0x0276('0x13')]){_0x45365a[_0x0276('0x14')]=_0x3d429e[_0x709883]['id'];_0x15ee18=!![];}}if(_0x15ee18){logger[_0x0276('0xd')](_0x0276('0x15'),_0x45365a[_0x0276('0x14')]);_0x5b2cdb(_0x45365a);}else{_0x3fb127({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x3fb127({'statusCode':0x194,'message':_0x0276('0x16')});}})[_0x0276('0x17')](function(_0x5a7c40){logger[_0x0276('0x18')]('['+[_0x42a300[_0x0276('0x19')]()]+']',_0x5a7c40['message']);_0x3fb127(_0x5a7c40);});});}function getUser(_0x10285b,_0x2de2f5,_0x5e551f){return function(_0x34104e){return new Promise(function(_0xd64c6e,_0x31d619){var _0x2d03b4={'method':_0x0276('0x1a'),'uri':_0x5e551f+_0x0276('0x1b'),'json':!![]};_0x2d03b4[_0x0276('0xc')]=_0x2de2f5;logger[_0x0276('0xd')](_0x0276('0x1c'));return rp(_0x2d03b4)[_0x0276('0xf')](function(_0x5ebea9){if(_0x5ebea9){var _0xa3d5e6=_0x5ebea9['users'];var _0x27cd95=![];var _0x46bfc4=null;if(_0x34104e[_0x0276('0x1d')]!==null){logger[_0x0276('0xd')]('Getting\x20user\x20with\x20email',_0x34104e[_0x0276('0x1d')]);_0x34104e[_0x0276('0x1e')]=_0x34104e[_0x0276('0x1d')];for(_0x46bfc4=0x0;_0x46bfc4<_0xa3d5e6[_0x0276('0x11')];_0x46bfc4++){if(_0xa3d5e6[_0x46bfc4][_0x0276('0x12')]===_0x34104e[_0x0276('0x1d')]){_0x27cd95=!![];_0x34104e['userId']=_0xa3d5e6[_0x46bfc4]['id'];logger[_0x0276('0xd')](_0x0276('0x1f'),_0x34104e[_0x0276('0x20')]);}}}if(!_0x27cd95){logger[_0x0276('0xd')](_0x0276('0x21'));_0x34104e[_0x0276('0x1e')]=_0x34104e[_0x0276('0x13')];_0x34104e[_0x0276('0x20')]=_0x34104e[_0x0276('0x14')];_0x27cd95=!![];}if(_0x27cd95){_0xd64c6e(_0x34104e);}else{_0x31d619({'statusCode':0x194,'message':_0x0276('0x16')});}}else{_0x31d619({'statusCode':0x194,'message':_0x0276('0x16')});}})['catch'](function(_0x4c534f){logger[_0x0276('0x18')]('['+[_0x10285b[_0x0276('0x19')]()]+']',_0x4c534f[_0x0276('0x22')]);_0x31d619(_0x4c534f);});});};}function getEndUser(_0x10a2d0,_0x6cdbdb,_0x3fd250){return function(_0x7e5bfd){return new Promise(function(_0xfb61f6,_0x2289a0){var _0x5532e1=0x0;var _0x1316f8={'method':_0x0276('0x1a'),'uri':_0x3fd250+_0x0276('0x23'),'json':!![]};_0x1316f8[_0x0276('0xc')]=_0x6cdbdb;logger['info']('Getting\x20contacts\x20filter');return rp(_0x1316f8)['then'](function(_0x4c9b11){_0x4c9b11[_0x0276('0x24')][_0x0276('0x25')](function(_0x31ced2){if(_0x31ced2[_0x0276('0x26')]==='All\x20Contacts'){_0x5532e1=_0x31ced2['id'];}});})['then'](function(){logger['info'](_0x0276('0x27'));var _0x5665e6={'method':_0x0276('0x1a'),'uri':_0x3fd250+_0x0276('0x28')+_0x5532e1,'json':!![]};_0x5665e6['headers']=_0x6cdbdb;return rp(_0x5665e6);})['then'](function(_0x2eecb4){logger[_0x0276('0xd')](_0x0276('0x29'),_0x7e5bfd['contactNumber']);if(_0x2eecb4['contacts'][_0x0276('0x11')]>0x0){var _0x175844=_[_0x0276('0x2a')](_0x2eecb4[_0x0276('0x2b')],function(_0x273073){if(_0x273073['work_number']===_0x7e5bfd[_0x0276('0x2c')]||_0x273073[_0x0276('0x2d')]===_0x7e5bfd[_0x0276('0x2c')]){return _0x273073;}});if(_0x175844){_0x7e5bfd[_0x0276('0x2e')]=_0x175844['id'];logger[_0x0276('0xd')](_0x0276('0x2f'),_0x7e5bfd['endUserId']);_0xfb61f6(_0x7e5bfd);}else{return createEndUser(_0x7e5bfd,_0x10a2d0,_0x6cdbdb,_0x3fd250)[_0x0276('0xf')](function(_0x3cd844){logger[_0x0276('0xd')](_0x0276('0x30'),_0x7e5bfd[_0x0276('0x2e')]);_0xfb61f6(_0x3cd844);});}}else{return createEndUser(_0x7e5bfd,_0x10a2d0,_0x6cdbdb,_0x3fd250)[_0x0276('0xf')](function(_0x48e9b4){logger[_0x0276('0xd')](_0x0276('0x30'),_0x7e5bfd[_0x0276('0x2e')]);_0xfb61f6(_0x48e9b4);});}})[_0x0276('0x17')](function(_0x5717d3){throw new Error(_0x5717d3[_0x0276('0x22')]);});});};}function createEndUser(_0x2a33b0,_0x5c527b,_0x2ae801,_0x40fd31){return new Promise(function(_0x145a2d,_0x1089f0){var _0x106d2f=moment();var _0x3ea88b={'method':_0x0276('0x31'),'uri':_0x40fd31+_0x0276('0x32'),'body':{'contact':{'last_name':_0x2a33b0[_0x0276('0x2c')],'work_number':_0x2a33b0[_0x0276('0x2c')],'mobile_number':_0x2a33b0[_0x0276('0x2c')],'owner_id':_0x2a33b0[_0x0276('0x20')],'created_at':_0x106d2f[_0x0276('0x33')](_0x0276('0x34'))}},'json':!![]};_0x3ea88b[_0x0276('0xc')]=_0x2ae801;logger['info'](_0x0276('0x35'));return rp(_0x3ea88b)[_0x0276('0xf')](function(_0x1eb44f){_0x2a33b0[_0x0276('0x2e')]=_0x1eb44f[_0x0276('0x36')]['id'];_0x145a2d(_0x2a33b0);})['catch'](function(_0x1768ba){logger['error']('['+[_0x5c527b[_0x0276('0x19')]()]+']',_0x1768ba[_0x0276('0x22')]);_0x1089f0(_0x1768ba[_0x0276('0x22')]);});});}function getTicket(_0x5a32bd,_0x29ae17,_0x1593fd,_0x186a7d,_0x5da4f1){return function(_0x5cd5ca){logger[_0x0276('0xd')](_0x0276('0x37'));return new Promise(function(_0x3ae018,_0x373a72){var _0x3c9e45=moment();var _0x3e6da1={'method':_0x0276('0x31'),'uri':_0x1593fd+_0x0276('0x38'),'body':{'title':intUtil[_0x0276('0x39')](_0x186a7d[_0x0276('0x3a')],_0x5da4f1,'\x20'),'description':intUtil[_0x0276('0x39')](_0x186a7d[_0x0276('0x3b')],_0x5da4f1,'\x0a'),'owner_id':_0x5cd5ca['userId'],'creater_id':_0x5cd5ca[_0x0276('0x14')],'targetable_id':_0x5cd5ca['endUserId'],'targetable_type':_0x0276('0x3c'),'created_at':_0x3c9e45[_0x0276('0x33')](_0x0276('0x34')),'due_date':_0x3c9e45[_0x0276('0x3d')](0x1e,'m')[_0x0276('0x33')](_0x0276('0x34'))},'json':!![]};_0x3e6da1['headers']=_0x29ae17;return rp(_0x3e6da1)['then'](function(_0x4e2524){_0x5cd5ca[_0x0276('0x3e')]=_0x4e2524[_0x0276('0x3f')]['id'];logger['info'](_0x0276('0x40'),_0x5cd5ca['ticketId']);_0x3ae018(_0x5cd5ca);})[_0x0276('0x17')](function(_0x2ff84f){logger[_0x0276('0x18')]('['+[_0x5a32bd[_0x0276('0x19')]()]+']',_0x2ff84f[_0x0276('0x22')]);_0x373a72(_0x2ff84f[_0x0276('0x22')]);});});};}function emit(_0x5b10c7,_0x291984,_0x1ac991){var _0x47e446={'uri':_0x5b10c7+_0x0276('0x41')+_0x1ac991};io['to'](util[_0x0276('0x33')](_0x0276('0x42'),_0x291984))['emit'](_0x0276('0x43'),_0x47e446);}exports['cs']=function(_0x1b62c1,_0x5cd98a,_0x24e73e,_0x2bcf8a,_0x4f6a80,_0x1ef869,_0x710b09,_0x4fa12c){var _0x17cd1e={};var _0x392b7e={'Authorization':_0x0276('0x44')+_0x1ef869[_0x0276('0x45')]};_0x1ef869[_0x0276('0x46')]=intUtil['stripTrailingSlash'](_0x1ef869[_0x0276('0x46')]);_0x1ef869[_0x0276('0x47')]=intUtil[_0x0276('0x48')](_0x1ef869[_0x0276('0x47')]);var _0x4566a1=_0x1ef869[_0x0276('0x46')];_0x17cd1e[_0x0276('0x13')]=_0x1ef869[_0x0276('0x49')];_0x17cd1e[_0x0276('0x2c')]=_0x4fa12c['toLowerCase']()===_0x0276('0x4a')?_0x5cd98a[_0x0276('0x4b')]:_0x5cd98a[_0x0276('0x4c')];_0x17cd1e['callDirection']=_0x4fa12c===_0x0276('0x4d')||_0x4fa12c===_0x0276('0x4e')?_0x0276('0x4d'):'outbound';if(_0x2bcf8a){_0x17cd1e[_0x0276('0x1d')]=_0x2bcf8a[_0x0276('0x12')];}var _0x5ad338=util[_0x0276('0x33')](_0x0276('0x4f'),_0x1ef869[_0x0276('0x47')],_0x5cd98a['uniqueid'],md5(_0x5cd98a['uniqueid']));if(_0x4f6a80&&_0x4f6a80[_0x0276('0x50')]){logger[_0x0276('0xd')](_0x0276('0x51'),'Recording\x20is\x20enabled!');_0x5cd98a[_0x0276('0x52')]=_0x5ad338;}else if(_0x710b09&&_0x710b09['recordingFormat']&&_0x710b09[_0x0276('0x53')]!==_0x0276('0x54')){logger[_0x0276('0xd')](_0x0276('0x55'),'Recording\x20is\x20enabled!');_0x5cd98a[_0x0276('0x52')]=_0x5ad338;}else{_0x5cd98a[_0x0276('0x52')]='';}return getAdminId(_0x17cd1e,_0x4fa12c,_0x392b7e,_0x4566a1)['then'](getUser(_0x4fa12c,_0x392b7e,_0x4566a1))[_0x0276('0xf')](getEndUser(_0x4fa12c,_0x392b7e,_0x4566a1))['then'](getTicket(_0x4fa12c,_0x392b7e,_0x4566a1,_0x24e73e,_0x5cd98a))['then'](function(_0xc52085){logger['info'](util[_0x0276('0x33')]('The\x20ticket\x20ID\x20is:\x20%s',_0xc52085[_0x0276('0x3e')]));if(_0x4fa12c!==_0x0276('0x4e')){logger[_0x0276('0xd')]('['+[_0x4fa12c[_0x0276('0x19')]()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0x4566a1,_0x2bcf8a[_0x0276('0x26')],_0xc52085[_0x0276('0x2e')]);}})[_0x0276('0x17')](function(_0x220a89){logger['error']('['+[_0x4fa12c[_0x0276('0x19')]()]+_0x0276('0x56'),util['inspect'](_0x220a89,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xb887=['toUpperCase','message','headers','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userEmail','userId','User\x20found:','Admin\x20selected','adminId','/api/contacts/filters','Getting\x20contacts\x20filter','filters','forEach','name','All\x20Contacts','Getting\x20contact\x20list','/api/contacts/view/','Searching\x20contact\x20with\x20phone','contactNumber','find','work_number','mobile_number','endUserId','Contact\x20found:','Contact\x20created:','format','YYYY-MM-DDTHH:mm:ss','contact','Creating\x20new\x20task','POST','/api/tasks','getString','Subjects','Contact','ticketId','/contacts/','user:%s','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','outbound','destcalleridnum','calleridnum','callDirection','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingURL','[OUTBOUND]','Recording\x20is\x20enabled!','Displaying\x20task\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Freshsales\x20integration','request-promise','md5','util','moment','bluebird','ioredis','./util','../../../../config/environment','freshsales','redis','defaults','localhost','socket.io-emitter','GET','/api/selector/owners','info','then','users','length','email','adminEmail','Requested\x20Resource\x20not\x20Found','catch','error'];(function(_0x4d1c16,_0x3a2a75){var _0x4aa270=function(_0x5550bc){while(--_0x5550bc){_0x4d1c16['push'](_0x4d1c16['shift']());}};_0x4aa270(++_0x3a2a75);}(_0xb887,0x92));var _0x7b88=function(_0x246d09,_0x430db3){_0x246d09=_0x246d09-0x0;var _0x2c09e2=_0xb887[_0x246d09];return _0x2c09e2;};'use strict';var _=require('lodash');var rp=require(_0x7b88('0x0'));var md5=require(_0x7b88('0x1'));var util=require(_0x7b88('0x2'));var moment=require(_0x7b88('0x3'));var Promise=require(_0x7b88('0x4'));var Redis=require(_0x7b88('0x5'));var intUtil=require(_0x7b88('0x6'));var config=require(_0x7b88('0x7'));var logger=require('../../../../config/logger')(_0x7b88('0x8'));config[_0x7b88('0x9')]=_[_0x7b88('0xa')](config[_0x7b88('0x9')],{'host':_0x7b88('0xb'),'port':0x18eb});var io=require(_0x7b88('0xc'))(new Redis(config[_0x7b88('0x9')]));function getAdminId(_0x341458,_0x2ef530,_0x4d0aa8,_0x4dfaba){return new Promise(function(_0x311574,_0x482c10){var _0x3cbb31=![];var _0x30f78a={'method':_0x7b88('0xd'),'uri':_0x4dfaba+_0x7b88('0xe'),'json':!![]};_0x30f78a['headers']=_0x4d0aa8;logger[_0x7b88('0xf')]('Getting\x20admin\x20information');return rp(_0x30f78a)[_0x7b88('0x10')](function(_0x3f4456){if(_0x3f4456){var _0x4e7ac0=_0x3f4456[_0x7b88('0x11')];var _0x5a9146=null;for(_0x5a9146=0x0;_0x5a9146<_0x4e7ac0[_0x7b88('0x12')];_0x5a9146++){if(_0x4e7ac0[_0x5a9146][_0x7b88('0x13')]===_0x341458[_0x7b88('0x14')]){_0x341458['adminId']=_0x4e7ac0[_0x5a9146]['id'];_0x3cbb31=!![];}}if(_0x3cbb31){logger[_0x7b88('0xf')]('Admin\x20found:',_0x341458['adminId']);_0x311574(_0x341458);}else{_0x482c10({'statusCode':0x194,'message':_0x7b88('0x15')});}}else{_0x482c10({'statusCode':0x194,'message':_0x7b88('0x15')});}})[_0x7b88('0x16')](function(_0xdb82bf){logger[_0x7b88('0x17')]('['+[_0x2ef530[_0x7b88('0x18')]()]+']',_0xdb82bf[_0x7b88('0x19')]);_0x482c10(_0xdb82bf);});});}function getUser(_0x23c058,_0x3ee615,_0x4fdbeb){return function(_0x514575){return new Promise(function(_0x2f80c8,_0x5ed680){var _0xbe4f3f={'method':_0x7b88('0xd'),'uri':_0x4fdbeb+'/api/selector/owners','json':!![]};_0xbe4f3f[_0x7b88('0x1a')]=_0x3ee615;logger['info'](_0x7b88('0x1b'));return rp(_0xbe4f3f)[_0x7b88('0x10')](function(_0x2c6079){if(_0x2c6079){var _0x5a4f9d=_0x2c6079[_0x7b88('0x11')];var _0x571acc=![];var _0x5cc97a=null;if(_0x514575[_0x7b88('0x1c')]!==null){logger[_0x7b88('0xf')](_0x7b88('0x1d'),_0x514575[_0x7b88('0x1c')]);_0x514575[_0x7b88('0x1e')]=_0x514575[_0x7b88('0x1c')];for(_0x5cc97a=0x0;_0x5cc97a<_0x5a4f9d[_0x7b88('0x12')];_0x5cc97a++){if(_0x5a4f9d[_0x5cc97a][_0x7b88('0x13')]===_0x514575[_0x7b88('0x1c')]){_0x571acc=!![];_0x514575[_0x7b88('0x1f')]=_0x5a4f9d[_0x5cc97a]['id'];logger[_0x7b88('0xf')](_0x7b88('0x20'),_0x514575[_0x7b88('0x1f')]);}}}if(!_0x571acc){logger[_0x7b88('0xf')](_0x7b88('0x21'));_0x514575[_0x7b88('0x1e')]=_0x514575['adminEmail'];_0x514575['userId']=_0x514575[_0x7b88('0x22')];_0x571acc=!![];}if(_0x571acc){_0x2f80c8(_0x514575);}else{_0x5ed680({'statusCode':0x194,'message':_0x7b88('0x15')});}}else{_0x5ed680({'statusCode':0x194,'message':_0x7b88('0x15')});}})[_0x7b88('0x16')](function(_0x3e3bed){logger[_0x7b88('0x17')]('['+[_0x23c058[_0x7b88('0x18')]()]+']',_0x3e3bed[_0x7b88('0x19')]);_0x5ed680(_0x3e3bed);});});};}function getEndUser(_0x3bc6c9,_0x1e9ffe,_0x459dcf){return function(_0x58fa56){return new Promise(function(_0x94665b,_0x3240b0){var _0x5c75eb=0x0;var _0x1050bf={'method':_0x7b88('0xd'),'uri':_0x459dcf+_0x7b88('0x23'),'json':!![]};_0x1050bf['headers']=_0x1e9ffe;logger[_0x7b88('0xf')](_0x7b88('0x24'));return rp(_0x1050bf)['then'](function(_0x29d471){_0x29d471[_0x7b88('0x25')][_0x7b88('0x26')](function(_0x2cb35f){if(_0x2cb35f[_0x7b88('0x27')]===_0x7b88('0x28')){_0x5c75eb=_0x2cb35f['id'];}});})[_0x7b88('0x10')](function(){logger['info'](_0x7b88('0x29'));var _0x28db64={'method':_0x7b88('0xd'),'uri':_0x459dcf+_0x7b88('0x2a')+_0x5c75eb,'json':!![]};_0x28db64['headers']=_0x1e9ffe;return rp(_0x28db64);})['then'](function(_0x4b5c96){logger[_0x7b88('0xf')](_0x7b88('0x2b'),_0x58fa56[_0x7b88('0x2c')]);if(_0x4b5c96['contacts']['length']>0x0){var _0x583fc8=_[_0x7b88('0x2d')](_0x4b5c96['contacts'],function(_0x49ffe1){if(_0x49ffe1[_0x7b88('0x2e')]===_0x58fa56[_0x7b88('0x2c')]||_0x49ffe1[_0x7b88('0x2f')]===_0x58fa56[_0x7b88('0x2c')]){return _0x49ffe1;}});if(_0x583fc8){_0x58fa56[_0x7b88('0x30')]=_0x583fc8['id'];logger[_0x7b88('0xf')](_0x7b88('0x31'),_0x58fa56['endUserId']);_0x94665b(_0x58fa56);}else{return createEndUser(_0x58fa56,_0x3bc6c9,_0x1e9ffe,_0x459dcf)[_0x7b88('0x10')](function(_0x427538){logger[_0x7b88('0xf')](_0x7b88('0x32'),_0x58fa56['endUserId']);_0x94665b(_0x427538);});}}else{return createEndUser(_0x58fa56,_0x3bc6c9,_0x1e9ffe,_0x459dcf)[_0x7b88('0x10')](function(_0x557e23){logger[_0x7b88('0xf')](_0x7b88('0x32'),_0x58fa56[_0x7b88('0x30')]);_0x94665b(_0x557e23);});}})['catch'](function(_0x2da2a2){throw new Error(_0x2da2a2[_0x7b88('0x19')]);});});};}function createEndUser(_0x19847f,_0x14dc58,_0x8a68e1,_0x50b205){return new Promise(function(_0x5e7d8e,_0x17a9d5){var _0x133d41=moment();var _0x17bfd3={'method':'POST','uri':_0x50b205+'/api/contacts','body':{'contact':{'last_name':_0x19847f[_0x7b88('0x2c')],'work_number':_0x19847f[_0x7b88('0x2c')],'mobile_number':_0x19847f[_0x7b88('0x2c')],'owner_id':_0x19847f[_0x7b88('0x1f')],'created_at':_0x133d41[_0x7b88('0x33')](_0x7b88('0x34'))}},'json':!![]};_0x17bfd3[_0x7b88('0x1a')]=_0x8a68e1;logger['info']('Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact');return rp(_0x17bfd3)[_0x7b88('0x10')](function(_0x9dfdcb){_0x19847f['endUserId']=_0x9dfdcb[_0x7b88('0x35')]['id'];_0x5e7d8e(_0x19847f);})[_0x7b88('0x16')](function(_0x2cb93d){logger[_0x7b88('0x17')]('['+[_0x14dc58[_0x7b88('0x18')]()]+']',_0x2cb93d[_0x7b88('0x19')]);_0x17a9d5(_0x2cb93d[_0x7b88('0x19')]);});});}function getTicket(_0x3a19ea,_0x253654,_0xe23520,_0x81572e,_0xcbfde6){return function(_0x5bc531){logger['info'](_0x7b88('0x36'));return new Promise(function(_0x372486,_0x4ae0c1){var _0x2808e5=moment();var _0x317fdf={'method':_0x7b88('0x37'),'uri':_0xe23520+_0x7b88('0x38'),'body':{'title':intUtil[_0x7b88('0x39')](_0x81572e[_0x7b88('0x3a')],_0xcbfde6,'\x20'),'description':intUtil[_0x7b88('0x39')](_0x81572e['Descriptions'],_0xcbfde6,'\x0a'),'owner_id':_0x5bc531[_0x7b88('0x1f')],'creater_id':_0x5bc531[_0x7b88('0x22')],'targetable_id':_0x5bc531[_0x7b88('0x30')],'targetable_type':_0x7b88('0x3b'),'created_at':_0x2808e5[_0x7b88('0x33')]('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x2808e5['add'](0x1e,'m')[_0x7b88('0x33')](_0x7b88('0x34'))},'json':!![]};_0x317fdf[_0x7b88('0x1a')]=_0x253654;return rp(_0x317fdf)[_0x7b88('0x10')](function(_0x389bee){_0x5bc531[_0x7b88('0x3c')]=_0x389bee['task']['id'];logger[_0x7b88('0xf')]('Task\x20created:',_0x5bc531['ticketId']);_0x372486(_0x5bc531);})['catch'](function(_0x3b9f90){logger['error']('['+[_0x3a19ea[_0x7b88('0x18')]()]+']',_0x3b9f90[_0x7b88('0x19')]);_0x4ae0c1(_0x3b9f90['message']);});});};}function emit(_0x266deb,_0x28eb26,_0x10df19){var _0x572c78={'uri':_0x266deb+_0x7b88('0x3d')+_0x10df19};io['to'](util['format'](_0x7b88('0x3e'),_0x28eb26))['emit'](_0x7b88('0x3f'),_0x572c78);}exports['cs']=function(_0xcb5d62,_0x231de8,_0x587810,_0x3f423b,_0x4710bd,_0x34da05,_0x38d31c,_0x5ee127){var _0x4712a5={};var _0x55fadd={'Authorization':_0x7b88('0x40')+_0x34da05[_0x7b88('0x41')]};_0x34da05[_0x7b88('0x42')]=intUtil[_0x7b88('0x43')](_0x34da05[_0x7b88('0x42')]);_0x34da05[_0x7b88('0x44')]=intUtil[_0x7b88('0x43')](_0x34da05['serverUrl']);var _0x3b6a61=_0x34da05[_0x7b88('0x42')];_0x4712a5[_0x7b88('0x14')]=_0x34da05[_0x7b88('0x45')];_0x4712a5[_0x7b88('0x2c')]=_0x5ee127[_0x7b88('0x46')]()===_0x7b88('0x47')?_0x231de8[_0x7b88('0x48')]:_0x231de8[_0x7b88('0x49')];_0x4712a5[_0x7b88('0x4a')]=_0x5ee127===_0x7b88('0x4b')||_0x5ee127==='abandoned'?_0x7b88('0x4b'):_0x7b88('0x47');if(_0x3f423b){_0x4712a5[_0x7b88('0x1c')]=_0x3f423b[_0x7b88('0x13')];}var _0x5bb6b0=util['format'](_0x7b88('0x4c'),_0x34da05[_0x7b88('0x44')],_0x231de8[_0x7b88('0x4d')],md5(_0x231de8[_0x7b88('0x4d')]));if(_0x4710bd&&_0x4710bd[_0x7b88('0x4e')]){logger['info'](_0x7b88('0x4f'),'Recording\x20is\x20enabled!');_0x231de8[_0x7b88('0x50')]=_0x5bb6b0;}else if(_0x38d31c&&_0x38d31c['recordingFormat']&&_0x38d31c['recordingFormat']!=='none'){logger['info'](_0x7b88('0x51'),_0x7b88('0x52'));_0x231de8['recordingURL']=_0x5bb6b0;}else{_0x231de8['recordingURL']='';}return getAdminId(_0x4712a5,_0x5ee127,_0x55fadd,_0x3b6a61)[_0x7b88('0x10')](getUser(_0x5ee127,_0x55fadd,_0x3b6a61))[_0x7b88('0x10')](getEndUser(_0x5ee127,_0x55fadd,_0x3b6a61))[_0x7b88('0x10')](getTicket(_0x5ee127,_0x55fadd,_0x3b6a61,_0x587810,_0x231de8))[_0x7b88('0x10')](function(_0x1afac3){logger['info'](util[_0x7b88('0x33')]('The\x20ticket\x20ID\x20is:\x20%s',_0x1afac3[_0x7b88('0x3c')]));if(_0x5ee127!=='abandoned'){logger[_0x7b88('0xf')]('['+[_0x5ee127[_0x7b88('0x18')]()]+']',_0x7b88('0x53'));emit(_0x3b6a61,_0x3f423b[_0x7b88('0x27')],_0x1afac3[_0x7b88('0x30')]);}})[_0x7b88('0x16')](function(_0x9e7d91){logger[_0x7b88('0x17')]('['+[_0x5ee127[_0x7b88('0x18')]()]+_0x7b88('0x54'),util['inspect'](_0x9e7d91,{'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 2343eb3..e417096 100644 --- a/server/services/ami/trigger/integration/index.js +++ b/server/services/ami/trigger/integration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['./vtiger','./servicenow','./dynamics365','./freshsales','salesforce','sugarcrm','freshdesk','vtiger','servicenow','exec','toLowerCase','data1','data2','find','Configurations','data3','queue','routeId','log','abandoned','zendesk','zoho','desk','freshsales','dynamics365','unknown\x20integration','../../../../config/logger','error','[EXEC]','%s\x20configuration\x20#%s\x20not\x20found','format','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./freshdesk','./desk'];(function(_0x1b50ea,_0xe00575){var _0x1dc125=function(_0x313dd4){while(--_0x313dd4){_0x1b50ea['push'](_0x1b50ea['shift']());}};_0x1dc125(++_0xe00575);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var zendesk=require(_0x0a9e('0x2'));var salesforce=require('./salesforce');var sugarcrm=require('./sugarcrm');var freshdesk=require(_0x0a9e('0x3'));var zoho=require('./zoho');var desk=require(_0x0a9e('0x4'));var vtiger=require(_0x0a9e('0x5'));var servicenow=require(_0x0a9e('0x6'));var dynamics365=require(_0x0a9e('0x7'));var freshsales=require(_0x0a9e('0x8'));var integrations=['zendesk',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'zoho','desk',_0x0a9e('0xc'),'dynamics365','freshsales',_0x0a9e('0xd')];exports[_0x0a9e('0xe')]=function(_0x307b3e,_0x3ab53f,_0xfeb75b,_0xbd1168,_0x4a4c56,_0x50dfb2){if(_0xfeb75b){if(_['includes'](integrations,_0x307b3e['data1'][_0x0a9e('0xf')]())){try{var _0x36471c=null;var _0xd5b662='';var _0x26d672=_0xfeb75b[_0x307b3e[_0x0a9e('0x10')][_0x0a9e('0xf')]()];if(_0x26d672){var _0x5db4b0=_0x26d672[_0x307b3e[_0x0a9e('0x11')]];if(_0x5db4b0){var _0x239b12=_[_0x0a9e('0x12')](_0x5db4b0[_0x0a9e('0x13')],{'id':parseInt(_0x307b3e[_0x0a9e('0x14')],0xa)});if(_0x239b12){if(_0xbd1168){if(_0x4a4c56&&_0x3ab53f[_0x0a9e('0x15')]){_0xd5b662='queue';}else if(_0x3ab53f[_0x0a9e('0x16')]){_0xd5b662='outbound';}else{console[_0x0a9e('0x17')]('EVENT\x20UNKNOWN',_0x3ab53f);}}else{_0xd5b662=_0x0a9e('0x18');}switch(_0x307b3e[_0x0a9e('0x10')]['toLowerCase']()){case _0x0a9e('0x19'):zendesk[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case'salesforce':salesforce[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0xa'):sugarcrm[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0xb'):freshdesk[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0x1a'):zoho[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0x1b'):desk[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0xc'):vtiger[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0x1c'):freshsales['cs'](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2,_0xd5b662);case _0x0a9e('0xd'):servicenow['cs'](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2,_0xd5b662);break;case _0x0a9e('0x1d'):dynamics365['cs'](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2,_0xd5b662);break;default:console[_0x0a9e('0x17')](_0x0a9e('0x1e'));}}else{_0x36471c=require(_0x0a9e('0x1f'))(_0x307b3e[_0x0a9e('0x10')]['toLowerCase']());_0x36471c[_0x0a9e('0x20')](_0x0a9e('0x21'),util['format'](_0x0a9e('0x22'),_0x307b3e['data1']['toLowerCase'](),_0x307b3e[_0x0a9e('0x14')]));}}else{_0x36471c=require(_0x0a9e('0x1f'))(_0x307b3e[_0x0a9e('0x10')][_0x0a9e('0xf')]());_0x36471c['error'](_0x0a9e('0x21'),util[_0x0a9e('0x23')](_0x0a9e('0x24'),_0x307b3e[_0x0a9e('0x10')][_0x0a9e('0xf')](),_0x307b3e[_0x0a9e('0x11')]));}}else{}}catch(_0x16b1ca){console['error'](_0x16b1ca);}}}}; \ No newline at end of file +var _0xa9e0=['./vtiger','./servicenow','./dynamics365','./freshsales','salesforce','sugarcrm','freshdesk','vtiger','servicenow','exec','toLowerCase','data1','data2','find','Configurations','data3','queue','routeId','log','abandoned','zendesk','zoho','desk','freshsales','dynamics365','unknown\x20integration','../../../../config/logger','error','[EXEC]','%s\x20configuration\x20#%s\x20not\x20found','format','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./freshdesk','./desk'];(function(_0x4c7e60,_0x1c7c64){var _0x1fd124=function(_0x1d5519){while(--_0x1d5519){_0x4c7e60['push'](_0x4c7e60['shift']());}};_0x1fd124(++_0x1c7c64);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var zendesk=require(_0x0a9e('0x2'));var salesforce=require('./salesforce');var sugarcrm=require('./sugarcrm');var freshdesk=require(_0x0a9e('0x3'));var zoho=require('./zoho');var desk=require(_0x0a9e('0x4'));var vtiger=require(_0x0a9e('0x5'));var servicenow=require(_0x0a9e('0x6'));var dynamics365=require(_0x0a9e('0x7'));var freshsales=require(_0x0a9e('0x8'));var integrations=['zendesk',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'zoho','desk',_0x0a9e('0xc'),'dynamics365','freshsales',_0x0a9e('0xd')];exports[_0x0a9e('0xe')]=function(_0x307b3e,_0x3ab53f,_0xfeb75b,_0xbd1168,_0x4a4c56,_0x50dfb2){if(_0xfeb75b){if(_['includes'](integrations,_0x307b3e['data1'][_0x0a9e('0xf')]())){try{var _0x36471c=null;var _0xd5b662='';var _0x26d672=_0xfeb75b[_0x307b3e[_0x0a9e('0x10')][_0x0a9e('0xf')]()];if(_0x26d672){var _0x5db4b0=_0x26d672[_0x307b3e[_0x0a9e('0x11')]];if(_0x5db4b0){var _0x239b12=_[_0x0a9e('0x12')](_0x5db4b0[_0x0a9e('0x13')],{'id':parseInt(_0x307b3e[_0x0a9e('0x14')],0xa)});if(_0x239b12){if(_0xbd1168){if(_0x4a4c56&&_0x3ab53f[_0x0a9e('0x15')]){_0xd5b662='queue';}else if(_0x3ab53f[_0x0a9e('0x16')]){_0xd5b662='outbound';}else{console[_0x0a9e('0x17')]('EVENT\x20UNKNOWN',_0x3ab53f);}}else{_0xd5b662=_0x0a9e('0x18');}switch(_0x307b3e[_0x0a9e('0x10')]['toLowerCase']()){case _0x0a9e('0x19'):zendesk[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case'salesforce':salesforce[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0xa'):sugarcrm[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0xb'):freshdesk[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0x1a'):zoho[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0x1b'):desk[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0xc'):vtiger[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0x1c'):freshsales['cs'](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2,_0xd5b662);case _0x0a9e('0xd'):servicenow['cs'](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2,_0xd5b662);break;case _0x0a9e('0x1d'):dynamics365['cs'](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2,_0xd5b662);break;default:console[_0x0a9e('0x17')](_0x0a9e('0x1e'));}}else{_0x36471c=require(_0x0a9e('0x1f'))(_0x307b3e[_0x0a9e('0x10')]['toLowerCase']());_0x36471c[_0x0a9e('0x20')](_0x0a9e('0x21'),util['format'](_0x0a9e('0x22'),_0x307b3e['data1']['toLowerCase'](),_0x307b3e[_0x0a9e('0x14')]));}}else{_0x36471c=require(_0x0a9e('0x1f'))(_0x307b3e[_0x0a9e('0x10')][_0x0a9e('0xf')]());_0x36471c['error'](_0x0a9e('0x21'),util[_0x0a9e('0x23')](_0x0a9e('0x24'),_0x307b3e[_0x0a9e('0x10')][_0x0a9e('0xf')](),_0x307b3e[_0x0a9e('0x11')]));}}else{}}catch(_0x16b1ca){console['error'](_0x16b1ca);}}}}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/salesforce.js b/server/services/ami/trigger/integration/salesforce.js index bb5c25d..d2d582c 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 _0x892d=['trigger:browser:url','%s/%s/e','error','outbound','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridnum','Fields','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','instanceUrl','Salesforce\x20account\x20type\x20not\x20recognized','catch','abandoned','[ABANDONED]','isNil','[ABANDONED]\x20Ticket\x20%s\x20created.','[ABANDONED]\x20Integration\x20account\x20type\x20%s.','stringify','lodash','request-promise','moment','md5','jsforce','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','localhost','socket.io-emitter','ticketType','Task','utc','getString','Subjects','Descriptions','WhoId','assign','ContactId','sobject','create','validateEmail','then','length','Email','info','Agent\x20%s\x20found.','resolve','Name','identity','user_id','display_name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','Contact','execute','Lead','find','contact','lead','Case','Phone','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','type','string','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','concat','clientId','clientSecret','login','username','queue','stripTrailingSlash','serverUrl','remoteUri','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','email','calleridname','calleridnum','[QUEUE]\x20Ticket\x20%s\x20created','integrationTab','trigger:salesforce:display','newTab','user:%s'];(function(_0x295e1d,_0x3d162){var _0x3e8464=function(_0x368242){while(--_0x368242){_0x295e1d['push'](_0x295e1d['shift']());}};_0x3e8464(++_0x3d162);}(_0x892d,0xea));var _0xd892=function(_0x2c9573,_0x39dd3e){_0x2c9573=_0x2c9573-0x0;var _0x52d08a=_0x892d[_0x2c9573];return _0x52d08a;};'use strict';var _=require(_0xd892('0x0'));var rp=require(_0xd892('0x1'));var moment=require(_0xd892('0x2'));var BPromise=require('bluebird');var md5=require(_0xd892('0x3'));var jsforce=require(_0xd892('0x4'));var util=require('util');var Redis=require('ioredis');var intUtil=require(_0xd892('0x5'));var config=require(_0xd892('0x6'));var logger=require(_0xd892('0x7'))(_0xd892('0x8'));config[_0xd892('0x9')]=_['defaults'](config[_0xd892('0x9')],{'host':_0xd892('0xa'),'port':0x18eb});var io=require(_0xd892('0xb'))(new Redis(config[_0xd892('0x9')]));function emit(_0x1ad52c,_0x1789d0,_0x4f0070){io['to'](_0x1ad52c)['emit'](_0x1789d0,_0x4f0070);}function getTicket(_0x1d46c7,_0x5e9e97,_0x544da5,_0x4f5a6b,_0x8eadc,_0xf6aad7,_0x4487c0,_0x4c7307){var _0x3655e1={};if(_0x4f5a6b[_0xd892('0xc')]===_0xd892('0xd')){_0x3655e1=Object['assign']({},{'OwnerId':_0x5e9e97['id'],'ActivityDate':moment[_0xd892('0xe')](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil[_0xd892('0xf')](_0x4f5a6b[_0xd892('0x10')],_0x8eadc,'\x20'),'Description':intUtil[_0xd892('0xf')](_0x4f5a6b[_0xd892('0x11')],_0x8eadc,'\x0a')},getCustomFields(_0xf6aad7,_0x8eadc));if(_0x544da5){_0x3655e1[_0xd892('0x12')]=_0x544da5['id'];}}else if(_0x4f5a6b[_0xd892('0xc')]==='Case'){_0x3655e1=Object[_0xd892('0x13')]({},{'OwnerId':_0x5e9e97['id'],'Subject':intUtil[_0xd892('0xf')](_0x4f5a6b['Subjects'],_0x8eadc,'\x20'),'Description':intUtil[_0xd892('0xf')](_0x4f5a6b[_0xd892('0x11')],_0x8eadc,'\x0a')},getCustomFields(_0xf6aad7,_0x8eadc));if(_0x544da5){_0x3655e1[_0xd892('0x14')]=_0x544da5['id'];}}return _0x4487c0[_0xd892('0x15')](_0x4f5a6b['ticketType'])[_0xd892('0x16')](_0x3655e1);}function getUser(_0x5cc0d5,_0x3cd8d6,_0x2c2d0c){if(!_['isNil'](_0x3cd8d6)&&intUtil[_0xd892('0x17')](_0x3cd8d6)){var _0x18f260={'Email':_0x3cd8d6};var _0x9183c3={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x2c2d0c[_0xd892('0x15')]('User')['find'](_0x18f260,_0x9183c3)['execute']()[_0xd892('0x18')](function(_0x260f18){if(_0x260f18[_0xd892('0x19')]){var _0xf3242e=_['find'](_0x260f18,function(_0x341243){return _0x341243[_0xd892('0x1a')]===_0x3cd8d6;});if(_0xf3242e){logger[_0xd892('0x1b')](_0xd892('0x1c'),_0x3cd8d6);return BPromise[_0xd892('0x1d')]({'id':_0xf3242e['Id'],'name':_0xf3242e[_0xd892('0x1e')]});}}else{logger[_0xd892('0x1b')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x3cd8d6);return _0x2c2d0c[_0xd892('0x1f')]()[_0xd892('0x18')](function(_0x385339){return BPromise[_0xd892('0x1d')]({'id':_0x385339[_0xd892('0x20')],'name':_0x385339[_0xd892('0x21')]});});}});}else{logger[_0xd892('0x1b')](_0xd892('0x22'),_0x3cd8d6);return _0x2c2d0c[_0xd892('0x1f')]()['then'](function(_0x4826a4){return BPromise[_0xd892('0x1d')]({'id':_0x4826a4[_0xd892('0x20')],'name':_0x4826a4[_0xd892('0x21')]});});}}function getEndUser(_0x5d5215,_0xfba956,_0x111f83,_0x4835a8,_0x16624a){var _0x41bee4={'Phone':_0x4835a8};var _0x2fcd9e={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xd892('0x1d')]()[_0xd892('0x18')](function(){if(_0xfba956[_0xd892('0xc')]==='Task'){logger['info'](_0xd892('0x23'),_0x4835a8,_0xfba956['moduleSearch']);switch(_0xfba956[_0xd892('0x24')]){case _0xd892('0x25'):return _0x16624a['sobject'](_0xd892('0x26'))['find'](_0x41bee4,_0x2fcd9e)[_0xd892('0x27')]()[_0xd892('0x18')](function(_0x2505d7){if(_0x2505d7&&_0x2505d7['length']){return _0x2505d7;}else{return _0x16624a[_0xd892('0x15')](_0xd892('0x28'))[_0xd892('0x29')](_0x41bee4,_0x2fcd9e);}});case _0xd892('0x2a'):return _0x16624a[_0xd892('0x15')]('Contact')[_0xd892('0x29')](_0x41bee4,_0x2fcd9e)['execute']();case _0xd892('0x2b'):return _0x16624a[_0xd892('0x15')]('Lead')[_0xd892('0x29')](_0x41bee4,_0x2fcd9e);default:return null;}}else if(_0xfba956[_0xd892('0xc')]===_0xd892('0x2c')){logger[_0xd892('0x1b')](_0xd892('0x23'),_0x4835a8,_0xd892('0x2a'));return _0x16624a[_0xd892('0x15')](_0xd892('0x26'))['find'](_0x41bee4,_0x2fcd9e)[_0xd892('0x27')]();}})[_0xd892('0x18')](function(_0x339d36){if(_0x339d36&&_0x339d36[_0xd892('0x19')]){var _0x482c1b=_['find'](_0x339d36,function(_0x57336b){return _0x57336b[_0xd892('0x2d')]===_0x4835a8;});if(_0x482c1b){return BPromise[_0xd892('0x1d')]({'id':_0x482c1b['Id'],'name':_0x482c1b[_0xd892('0x1e')],'phone':_0x482c1b['Phone']});}}})[_0xd892('0x18')](function(_0x55e04a){if(_0x55e04a){logger['info']('Enduser\x20with\x20phone\x20%s\x20found.',_0x4835a8);return BPromise[_0xd892('0x1d')](_0x55e04a);}else{logger[_0xd892('0x1b')](_0xd892('0x2e'),_0x4835a8);var _0x4b5b99={'LastName':_0x111f83!==_0xd892('0x2f')?_0x111f83:util[_0xd892('0x30')](_0xd892('0x31'),_0x4835a8),'Phone':_0x4835a8};if(_0xfba956[_0xd892('0x32')]){if(_0xfba956[_0xd892('0x32')]===_0xd892('0x2a')){logger[_0xd892('0x1b')](_0xd892('0x33'),_0x4835a8,_0xfba956[_0xd892('0x32')]);}else if(_0xfba956[_0xd892('0x32')]===_0xd892('0x2b')&&_0xfba956[_0xd892('0xc')]===_0xd892('0xd')){logger[_0xd892('0x1b')](_0xd892('0x33'),_0x4835a8,_0xfba956[_0xd892('0x32')]);_0x4b5b99[_0xd892('0x34')]=_0xd892('0x35');}else{return null;}}return _0x16624a[_0xd892('0x15')](_[_0xd892('0x36')](_0xfba956[_0xd892('0x32')]))['create'](_0x4b5b99);}});}function getCustomFields(_0xc51eba,_0x279a4b){var _0x42c6d6={};if(_0xc51eba[_0xd892('0x19')]>0x0){_['forEach'](_0xc51eba,function(_0x31081c){if(_0x31081c[_0xd892('0x37')]===_0xd892('0x38')&&_0x31081c[_0xd892('0x39')]){_0x42c6d6[_0x31081c[_0xd892('0x39')]]=_0x31081c[_0xd892('0x3a')][_0xd892('0x3b')]();}else if(_0x31081c[_0xd892('0x37')]===_0xd892('0x3c')&&_0x31081c[_0xd892('0x3d')]&&_0x31081c[_0xd892('0x39')]){_0x279a4b[_0x31081c['variableName']]&&(_0x42c6d6[_0x31081c[_0xd892('0x39')]]=_0x279a4b[_0x31081c[_0xd892('0x3d')]]['toString']());}else if(_0x31081c['type']===_0xd892('0x3e')&&_0x31081c[_0xd892('0x3f')]&&_0x31081c[_0xd892('0x3f')][_0xd892('0x40')]&&_0x31081c[_0xd892('0x39')]){_0x279a4b[_0x31081c[_0xd892('0x3f')][_0xd892('0x40')][_0xd892('0x41')]()]&&(_0x42c6d6[_0x31081c[_0xd892('0x39')]]=_0x279a4b[_0x31081c[_0xd892('0x3f')]['name'][_0xd892('0x41')]()][_0xd892('0x3b')]());}});}return _0x42c6d6;}function getConnection(_0x1f9c2b){var _0x345bac=_0x1f9c2b['password'][_0xd892('0x42')](_0x1f9c2b['securityToken']);var _0x2f7634=new jsforce['Connection']({'oauth2':{'loginUrl':_0x1f9c2b['remoteUri']||'https://login.salesforce.com','clientId':_0x1f9c2b[_0xd892('0x43')],'clientSecret':_0x1f9c2b[_0xd892('0x44')]}});return _0x2f7634[_0xd892('0x45')](_0x1f9c2b[_0xd892('0x46')],_0x345bac)[_0xd892('0x18')](function(){logger[_0xd892('0x1b')]('Connection\x20established.');return _0x2f7634;});}exports[_0xd892('0x47')]=function(_0x136359,_0x1ef78c,_0x2ba810,_0x5656d5,_0xdc1c45,_0x201a54){var _0x4dd3c0,_0x5d12db,_0x179a49,_0x584f9e;_0x201a54['serverUrl']=intUtil[_0xd892('0x48')](_0x201a54[_0xd892('0x49')]);_0x201a54[_0xd892('0x4a')]=intUtil[_0xd892('0x48')](_0x201a54[_0xd892('0x4a')]);if(_0xdc1c45&&_0xdc1c45['monitor_format']){logger[_0xd892('0x1b')](_0xd892('0x4b'),_0xd892('0x4c'));_0x1ef78c[_0xd892('0x4d')]=util[_0xd892('0x30')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x201a54[_0xd892('0x49')],_0x1ef78c[_0xd892('0x4e')],md5(_0x1ef78c[_0xd892('0x4e')]));}else{_0x1ef78c[_0xd892('0x4d')]='';}return getConnection(_0x201a54)['then'](function(_0x2db8df){_0x584f9e=_0x2db8df;return getUser(_0x201a54,_0x5656d5[_0xd892('0x4f')],_0x584f9e);})['then'](function(_0x146c70){_0x4dd3c0=_0x146c70;return getEndUser(_0x201a54,_0x2ba810,_0x1ef78c[_0xd892('0x50')],_0x1ef78c[_0xd892('0x51')],_0x584f9e);})[_0xd892('0x18')](function(_0x114b8e){_0x5d12db=_0x114b8e;return getTicket(_0x201a54,_0x4dd3c0,_0x5d12db,_0x2ba810,_0x1ef78c,_0x2ba810['Fields'],_0x584f9e,'queue');})[_0xd892('0x18')](function(_0x3310f1){_0x179a49=_0x3310f1;logger[_0xd892('0x1b')](_0xd892('0x52'),_0x179a49['id']);logger['info']('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x179a49['id'],_0x5656d5[_0xd892('0x40')],_0x201a54[_0xd892('0x37')]);switch(_0x201a54[_0xd892('0x37')]){case _0xd892('0x53'):emit(util[_0xd892('0x30')]('user:%s',_0x5656d5[_0xd892('0x40')]),_0xd892('0x54'),{'recordId':_0x179a49['id']});break;case _0xd892('0x55'):emit(util[_0xd892('0x30')](_0xd892('0x56'),_0x5656d5[_0xd892('0x40')]),_0xd892('0x57'),{'uri':util[_0xd892('0x30')](_0xd892('0x58'),_0x584f9e['instanceUrl'],_0x179a49['id'])});break;default:logger[_0xd892('0x59')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})['catch'](function(_0x1b01a6){logger[_0xd892('0x59')](_0xd892('0x4b'),JSON['stringify'](_0x1b01a6));});};exports[_0xd892('0x5a')]=function(_0xe142a3,_0x14a5d2,_0x3263aa,_0x3e4080,_0x11705d,_0x3984e1,_0x311766){var _0x309eb0,_0x29a3c6,_0x573962,_0x138232;_0x3984e1[_0xd892('0x49')]=intUtil['stripTrailingSlash'](_0x3984e1[_0xd892('0x49')]);_0x3984e1['remoteUri']=intUtil[_0xd892('0x48')](_0x3984e1[_0xd892('0x4a')]);if(_0x311766&&_0x311766['recordingFormat']&&_0x311766['recordingFormat']!==_0xd892('0x5b')){logger[_0xd892('0x1b')](_0xd892('0x5c'),_0xd892('0x4c'));_0x14a5d2[_0xd892('0x4d')]=util['format'](_0xd892('0x5d'),_0x3984e1[_0xd892('0x49')],_0x14a5d2['uniqueid'],md5(_0x14a5d2[_0xd892('0x4e')]));}return getConnection(_0x3984e1)[_0xd892('0x18')](function(_0x1355db){_0x138232=_0x1355db;return getUser(_0x3984e1,_0x3e4080[_0xd892('0x4f')],_0x138232);})[_0xd892('0x18')](function(_0xc1be10){_0x309eb0=_0xc1be10;return getEndUser(_0x3984e1,_0x3263aa,_0x14a5d2['destcalleridname'],_0x14a5d2[_0xd892('0x5e')],_0x138232);})[_0xd892('0x18')](function(_0x52ac12){_0x29a3c6=_0x52ac12;return getTicket(_0x3984e1,_0x309eb0,_0x29a3c6,_0x3263aa,_0x14a5d2,_0x3263aa[_0xd892('0x5f')],_0x138232,'outbound');})[_0xd892('0x18')](function(_0x36ebac){_0x573962=_0x36ebac;logger[_0xd892('0x1b')](_0xd892('0x60'),_0x573962['id']);logger[_0xd892('0x1b')](_0xd892('0x61'),_0x573962['id'],_0x3e4080[_0xd892('0x40')],_0x3984e1[_0xd892('0x37')]);switch(_0x3984e1['type']){case _0xd892('0x53'):emit(util[_0xd892('0x30')](_0xd892('0x56'),_0x3e4080[_0xd892('0x40')]),_0xd892('0x54'),{'recordId':_0x573962['id']});break;case _0xd892('0x55'):emit(util[_0xd892('0x30')](_0xd892('0x56'),_0x3e4080[_0xd892('0x40')]),_0xd892('0x57'),{'uri':util[_0xd892('0x30')](_0xd892('0x58'),_0x138232[_0xd892('0x62')],_0x573962['id'])});break;default:logger[_0xd892('0x59')](_0xd892('0x5c'),_0xd892('0x63'));}})[_0xd892('0x64')](function(_0x567cb7){logger[_0xd892('0x59')](_0xd892('0x5c'),JSON['stringify'](_0x567cb7));});};exports[_0xd892('0x65')]=function(_0x5f1cf8,_0x46616a,_0x22e243,_0x3b3480,_0x32347a,_0x5deec2){var _0x23403d,_0x46e295,_0x25e139,_0x21c3a7;_0x5deec2[_0xd892('0x49')]=intUtil['stripTrailingSlash'](_0x5deec2[_0xd892('0x49')]);_0x5deec2[_0xd892('0x4a')]=intUtil['stripTrailingSlash'](_0x5deec2[_0xd892('0x4a')]);if(_0x32347a&&_0x32347a['monitor_format']){logger['info'](_0xd892('0x66'),'Recording\x20is\x20enabled!');_0x46616a[_0xd892('0x4d')]=util['format'](_0xd892('0x5d'),_0x5deec2[_0xd892('0x49')],_0x46616a[_0xd892('0x4e')],md5(_0x46616a[_0xd892('0x4e')]));}else{_0x46616a['recordingURL']='';}return getConnection(_0x5deec2)[_0xd892('0x18')](function(_0x3e4aa0){_0x21c3a7=_0x3e4aa0;if(!_[_0xd892('0x67')](_0x3b3480)){return getUser(_0x5deec2,_0x3b3480[_0xd892('0x40')],_0x21c3a7);}else{return getUser(_0x5deec2,null,_0x21c3a7);}})[_0xd892('0x18')](function(_0x195c38){_0x23403d=_0x195c38;return getEndUser(_0x5deec2,_0x22e243,_0x46616a[_0xd892('0x50')],_0x46616a[_0xd892('0x51')],_0x21c3a7);})['then'](function(_0x10bfa9){_0x46e295=_0x10bfa9;return getTicket(_0x5deec2,_0x23403d,_0x46e295,_0x22e243,_0x46616a,_0x22e243[_0xd892('0x5f')],_0x21c3a7);})[_0xd892('0x18')](function(_0x45e6e5){_0x25e139=_0x45e6e5;logger[_0xd892('0x1b')](_0xd892('0x68'),_0x25e139['id']);logger[_0xd892('0x1b')](_0xd892('0x69'),_0x5deec2[_0xd892('0x37')]);})[_0xd892('0x64')](function(_0x5059de){logger[_0xd892('0x59')](_0xd892('0x66'),JSON[_0xd892('0x6a')](_0x5059de));});}; \ No newline at end of file +var _0xf786=['monitor_format','[QUEUE]','recordingURL','uniqueid','email','calleridname','Fields','user:%s','trigger:browser:url','%s/%s/e','instanceUrl','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','stringify','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridnum','integrationTab','trigger:salesforce:display','newTab','Salesforce\x20account\x20type\x20not\x20recognized','catch','error','abandoned','[ABANDONED]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','isNil','request-promise','moment','md5','jsforce','util','ioredis','../../../../config/environment','salesforce','redis','defaults','localhost','socket.io-emitter','emit','ticketType','utc','getString','Descriptions','WhoId','Case','assign','Subjects','ContactId','create','validateEmail','sobject','User','find','execute','then','length','info','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','Contact','Lead','contact','lead','Phone','Enduser\x20with\x20phone\x20%s\x20not\x20found.','','format','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Task','Company','No\x20Company','forEach','type','string','idField','toString','variable','variableName','customVariable','Variable','name','toLowerCase','password','Connection','remoteUri','clientId','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash'];(function(_0x18f572,_0x2c99c8){var _0x1f39eb=function(_0x1dcbd7){while(--_0x1dcbd7){_0x18f572['push'](_0x18f572['shift']());}};_0x1f39eb(++_0x2c99c8);}(_0xf786,0x152));var _0x6f78=function(_0xcb7324,_0x13f781){_0xcb7324=_0xcb7324-0x0;var _0x4d6f26=_0xf786[_0xcb7324];return _0x4d6f26;};'use strict';var _=require('lodash');var rp=require(_0x6f78('0x0'));var moment=require(_0x6f78('0x1'));var BPromise=require('bluebird');var md5=require(_0x6f78('0x2'));var jsforce=require(_0x6f78('0x3'));var util=require(_0x6f78('0x4'));var Redis=require(_0x6f78('0x5'));var intUtil=require('./util');var config=require(_0x6f78('0x6'));var logger=require('../../../../config/logger')(_0x6f78('0x7'));config[_0x6f78('0x8')]=_[_0x6f78('0x9')](config[_0x6f78('0x8')],{'host':_0x6f78('0xa'),'port':0x18eb});var io=require(_0x6f78('0xb'))(new Redis(config[_0x6f78('0x8')]));function emit(_0x1e803d,_0x564a0b,_0x3bca42){io['to'](_0x1e803d)[_0x6f78('0xc')](_0x564a0b,_0x3bca42);}function getTicket(_0x60adb1,_0x303b6d,_0x4f7c08,_0x24c900,_0x30bb68,_0x54e675,_0x2c080d,_0x2e39c6){var _0x20c24f={};if(_0x24c900[_0x6f78('0xd')]==='Task'){_0x20c24f=Object['assign']({},{'OwnerId':_0x303b6d['id'],'ActivityDate':moment[_0x6f78('0xe')](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil[_0x6f78('0xf')](_0x24c900['Subjects'],_0x30bb68,'\x20'),'Description':intUtil[_0x6f78('0xf')](_0x24c900[_0x6f78('0x10')],_0x30bb68,'\x0a')},getCustomFields(_0x54e675,_0x30bb68));if(_0x4f7c08){_0x20c24f[_0x6f78('0x11')]=_0x4f7c08['id'];}}else if(_0x24c900[_0x6f78('0xd')]===_0x6f78('0x12')){_0x20c24f=Object[_0x6f78('0x13')]({},{'OwnerId':_0x303b6d['id'],'Subject':intUtil['getString'](_0x24c900[_0x6f78('0x14')],_0x30bb68,'\x20'),'Description':intUtil[_0x6f78('0xf')](_0x24c900['Descriptions'],_0x30bb68,'\x0a')},getCustomFields(_0x54e675,_0x30bb68));if(_0x4f7c08){_0x20c24f[_0x6f78('0x15')]=_0x4f7c08['id'];}}return _0x2c080d['sobject'](_0x24c900['ticketType'])[_0x6f78('0x16')](_0x20c24f);}function getUser(_0x2007ac,_0x3e5e75,_0x13d97b){if(!_['isNil'](_0x3e5e75)&&intUtil[_0x6f78('0x17')](_0x3e5e75)){var _0x58e440={'Email':_0x3e5e75};var _0x10f2b2={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x13d97b[_0x6f78('0x18')](_0x6f78('0x19'))[_0x6f78('0x1a')](_0x58e440,_0x10f2b2)[_0x6f78('0x1b')]()[_0x6f78('0x1c')](function(_0x44cba4){if(_0x44cba4[_0x6f78('0x1d')]){var _0x4eb5b3=_['find'](_0x44cba4,function(_0x40b044){return _0x40b044['Email']===_0x3e5e75;});if(_0x4eb5b3){logger[_0x6f78('0x1e')](_0x6f78('0x1f'),_0x3e5e75);return BPromise[_0x6f78('0x20')]({'id':_0x4eb5b3['Id'],'name':_0x4eb5b3[_0x6f78('0x21')]});}}else{logger[_0x6f78('0x1e')](_0x6f78('0x22'),_0x3e5e75);return _0x13d97b[_0x6f78('0x23')]()[_0x6f78('0x1c')](function(_0x77a72c){return BPromise[_0x6f78('0x20')]({'id':_0x77a72c[_0x6f78('0x24')],'name':_0x77a72c[_0x6f78('0x25')]});});}});}else{logger[_0x6f78('0x1e')](_0x6f78('0x22'),_0x3e5e75);return _0x13d97b[_0x6f78('0x23')]()[_0x6f78('0x1c')](function(_0x49cd5d){return BPromise[_0x6f78('0x20')]({'id':_0x49cd5d[_0x6f78('0x24')],'name':_0x49cd5d['display_name']});});}}function getEndUser(_0xa5c439,_0x35f24a,_0x1ec501,_0x18c4df,_0x7e2aa8){var _0x4ec0a9={'Phone':_0x18c4df};var _0x4ee551={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()[_0x6f78('0x1c')](function(){if(_0x35f24a[_0x6f78('0xd')]==='Task'){logger[_0x6f78('0x1e')](_0x6f78('0x26'),_0x18c4df,_0x35f24a[_0x6f78('0x27')]);switch(_0x35f24a[_0x6f78('0x27')]){case'contact_lead':return _0x7e2aa8[_0x6f78('0x18')](_0x6f78('0x28'))['find'](_0x4ec0a9,_0x4ee551)[_0x6f78('0x1b')]()['then'](function(_0x16c120){if(_0x16c120&&_0x16c120[_0x6f78('0x1d')]){return _0x16c120;}else{return _0x7e2aa8['sobject'](_0x6f78('0x29'))[_0x6f78('0x1a')](_0x4ec0a9,_0x4ee551);}});case _0x6f78('0x2a'):return _0x7e2aa8[_0x6f78('0x18')]('Contact')['find'](_0x4ec0a9,_0x4ee551)[_0x6f78('0x1b')]();case _0x6f78('0x2b'):return _0x7e2aa8[_0x6f78('0x18')]('Lead')[_0x6f78('0x1a')](_0x4ec0a9,_0x4ee551);default:return null;}}else if(_0x35f24a[_0x6f78('0xd')]===_0x6f78('0x12')){logger[_0x6f78('0x1e')](_0x6f78('0x26'),_0x18c4df,_0x6f78('0x2a'));return _0x7e2aa8['sobject'](_0x6f78('0x28'))[_0x6f78('0x1a')](_0x4ec0a9,_0x4ee551)[_0x6f78('0x1b')]();}})[_0x6f78('0x1c')](function(_0x9daed1){if(_0x9daed1&&_0x9daed1[_0x6f78('0x1d')]){var _0x49cafd=_[_0x6f78('0x1a')](_0x9daed1,function(_0x25a31a){return _0x25a31a[_0x6f78('0x2c')]===_0x18c4df;});if(_0x49cafd){return BPromise[_0x6f78('0x20')]({'id':_0x49cafd['Id'],'name':_0x49cafd[_0x6f78('0x21')],'phone':_0x49cafd[_0x6f78('0x2c')]});}}})['then'](function(_0x17179c){if(_0x17179c){logger[_0x6f78('0x1e')]('Enduser\x20with\x20phone\x20%s\x20found.',_0x18c4df);return BPromise[_0x6f78('0x20')](_0x17179c);}else{logger[_0x6f78('0x1e')](_0x6f78('0x2d'),_0x18c4df);var _0xa7ad6e={'LastName':_0x1ec501!==_0x6f78('0x2e')?_0x1ec501:util[_0x6f78('0x2f')]('Caller\x20-\x20%s',_0x18c4df),'Phone':_0x18c4df};if(_0x35f24a[_0x6f78('0x30')]){if(_0x35f24a[_0x6f78('0x30')]===_0x6f78('0x2a')){logger[_0x6f78('0x1e')](_0x6f78('0x31'),_0x18c4df,_0x35f24a['moduleCreate']);}else if(_0x35f24a[_0x6f78('0x30')]===_0x6f78('0x2b')&&_0x35f24a[_0x6f78('0xd')]===_0x6f78('0x32')){logger['info'](_0x6f78('0x31'),_0x18c4df,_0x35f24a['moduleCreate']);_0xa7ad6e[_0x6f78('0x33')]=_0x6f78('0x34');}else{return null;}}return _0x7e2aa8['sobject'](_['upperFirst'](_0x35f24a[_0x6f78('0x30')]))[_0x6f78('0x16')](_0xa7ad6e);}});}function getCustomFields(_0x8fa8c4,_0x2b4cca){var _0x5782a3={};if(_0x8fa8c4[_0x6f78('0x1d')]>0x0){_[_0x6f78('0x35')](_0x8fa8c4,function(_0x179736){if(_0x179736[_0x6f78('0x36')]===_0x6f78('0x37')&&_0x179736[_0x6f78('0x38')]){_0x5782a3[_0x179736[_0x6f78('0x38')]]=_0x179736['content'][_0x6f78('0x39')]();}else if(_0x179736[_0x6f78('0x36')]===_0x6f78('0x3a')&&_0x179736['variableName']&&_0x179736['idField']){_0x2b4cca[_0x179736[_0x6f78('0x3b')]]&&(_0x5782a3[_0x179736[_0x6f78('0x38')]]=_0x2b4cca[_0x179736['variableName']][_0x6f78('0x39')]());}else if(_0x179736[_0x6f78('0x36')]===_0x6f78('0x3c')&&_0x179736[_0x6f78('0x3d')]&&_0x179736['Variable'][_0x6f78('0x3e')]&&_0x179736[_0x6f78('0x38')]){_0x2b4cca[_0x179736[_0x6f78('0x3d')][_0x6f78('0x3e')][_0x6f78('0x3f')]()]&&(_0x5782a3[_0x179736[_0x6f78('0x38')]]=_0x2b4cca[_0x179736[_0x6f78('0x3d')][_0x6f78('0x3e')]['toLowerCase']()]['toString']());}});}return _0x5782a3;}function getConnection(_0x37921e){var _0x1dcdaf=_0x37921e[_0x6f78('0x40')]['concat'](_0x37921e['securityToken']);var _0x102225=new jsforce[(_0x6f78('0x41'))]({'oauth2':{'loginUrl':_0x37921e[_0x6f78('0x42')]||'https://login.salesforce.com','clientId':_0x37921e[_0x6f78('0x43')],'clientSecret':_0x37921e['clientSecret']}});return _0x102225[_0x6f78('0x44')](_0x37921e[_0x6f78('0x45')],_0x1dcdaf)[_0x6f78('0x1c')](function(){logger[_0x6f78('0x1e')](_0x6f78('0x46'));return _0x102225;});}exports[_0x6f78('0x47')]=function(_0x561acd,_0x4337ea,_0x282523,_0x3eae7c,_0x124c78,_0x36707d){var _0x43ac4d,_0x4dded7,_0x15bc11,_0x3f5858;_0x36707d[_0x6f78('0x48')]=intUtil[_0x6f78('0x49')](_0x36707d[_0x6f78('0x48')]);_0x36707d[_0x6f78('0x42')]=intUtil['stripTrailingSlash'](_0x36707d[_0x6f78('0x42')]);if(_0x124c78&&_0x124c78[_0x6f78('0x4a')]){logger['info'](_0x6f78('0x4b'),'Recording\x20is\x20enabled!');_0x4337ea[_0x6f78('0x4c')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x36707d['serverUrl'],_0x4337ea['uniqueid'],md5(_0x4337ea[_0x6f78('0x4d')]));}else{_0x4337ea[_0x6f78('0x4c')]='';}return getConnection(_0x36707d)[_0x6f78('0x1c')](function(_0x5458ee){_0x3f5858=_0x5458ee;return getUser(_0x36707d,_0x3eae7c[_0x6f78('0x4e')],_0x3f5858);})['then'](function(_0x215662){_0x43ac4d=_0x215662;return getEndUser(_0x36707d,_0x282523,_0x4337ea[_0x6f78('0x4f')],_0x4337ea['calleridnum'],_0x3f5858);})[_0x6f78('0x1c')](function(_0x5b0405){_0x4dded7=_0x5b0405;return getTicket(_0x36707d,_0x43ac4d,_0x4dded7,_0x282523,_0x4337ea,_0x282523[_0x6f78('0x50')],_0x3f5858,_0x6f78('0x47'));})[_0x6f78('0x1c')](function(_0x190e7f){_0x15bc11=_0x190e7f;logger[_0x6f78('0x1e')]('[QUEUE]\x20Ticket\x20%s\x20created',_0x15bc11['id']);logger['info']('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x15bc11['id'],_0x3eae7c[_0x6f78('0x3e')],_0x36707d['type']);switch(_0x36707d['type']){case'integrationTab':emit(util[_0x6f78('0x2f')](_0x6f78('0x51'),_0x3eae7c[_0x6f78('0x3e')]),'trigger:salesforce:display',{'recordId':_0x15bc11['id']});break;case'newTab':emit(util[_0x6f78('0x2f')](_0x6f78('0x51'),_0x3eae7c[_0x6f78('0x3e')]),_0x6f78('0x52'),{'uri':util[_0x6f78('0x2f')](_0x6f78('0x53'),_0x3f5858[_0x6f78('0x54')],_0x15bc11['id'])});break;default:logger['error'](_0x6f78('0x55'));}})['catch'](function(_0x51ad77){logger['error'](_0x6f78('0x4b'),JSON[_0x6f78('0x56')](_0x51ad77));});};exports[_0x6f78('0x57')]=function(_0x646539,_0x1742db,_0x43b769,_0x31ed9b,_0x342216,_0x2038a1,_0x475b56){var _0xe18704,_0x425f60,_0x17635f,_0x327e64;_0x2038a1[_0x6f78('0x48')]=intUtil[_0x6f78('0x49')](_0x2038a1[_0x6f78('0x48')]);_0x2038a1[_0x6f78('0x42')]=intUtil[_0x6f78('0x49')](_0x2038a1[_0x6f78('0x42')]);if(_0x475b56&&_0x475b56[_0x6f78('0x58')]&&_0x475b56[_0x6f78('0x58')]!==_0x6f78('0x59')){logger[_0x6f78('0x1e')](_0x6f78('0x5a'),_0x6f78('0x5b'));_0x1742db[_0x6f78('0x4c')]=util[_0x6f78('0x2f')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2038a1['serverUrl'],_0x1742db[_0x6f78('0x4d')],md5(_0x1742db['uniqueid']));}return getConnection(_0x2038a1)[_0x6f78('0x1c')](function(_0x1fa0b9){_0x327e64=_0x1fa0b9;return getUser(_0x2038a1,_0x31ed9b['email'],_0x327e64);})[_0x6f78('0x1c')](function(_0x216ff1){_0xe18704=_0x216ff1;return getEndUser(_0x2038a1,_0x43b769,_0x1742db['destcalleridname'],_0x1742db[_0x6f78('0x5c')],_0x327e64);})[_0x6f78('0x1c')](function(_0x1c067a){_0x425f60=_0x1c067a;return getTicket(_0x2038a1,_0xe18704,_0x425f60,_0x43b769,_0x1742db,_0x43b769['Fields'],_0x327e64,_0x6f78('0x57'));})['then'](function(_0xbf8da){_0x17635f=_0xbf8da;logger[_0x6f78('0x1e')]('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x17635f['id']);logger['info']('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x17635f['id'],_0x31ed9b[_0x6f78('0x3e')],_0x2038a1['type']);switch(_0x2038a1[_0x6f78('0x36')]){case _0x6f78('0x5d'):emit(util[_0x6f78('0x2f')](_0x6f78('0x51'),_0x31ed9b[_0x6f78('0x3e')]),_0x6f78('0x5e'),{'recordId':_0x17635f['id']});break;case _0x6f78('0x5f'):emit(util[_0x6f78('0x2f')]('user:%s',_0x31ed9b[_0x6f78('0x3e')]),'trigger:browser:url',{'uri':util[_0x6f78('0x2f')](_0x6f78('0x53'),_0x327e64[_0x6f78('0x54')],_0x17635f['id'])});break;default:logger['error']('[OUTBOUND]',_0x6f78('0x60'));}})[_0x6f78('0x61')](function(_0x17aebe){logger[_0x6f78('0x62')](_0x6f78('0x5a'),JSON[_0x6f78('0x56')](_0x17aebe));});};exports[_0x6f78('0x63')]=function(_0xea828e,_0x12aa55,_0x24b797,_0x970cb4,_0x4accf8,_0x13fd0c){var _0xcf4e2e,_0x265526,_0xdfd9b5,_0x45abfe;_0x13fd0c[_0x6f78('0x48')]=intUtil['stripTrailingSlash'](_0x13fd0c[_0x6f78('0x48')]);_0x13fd0c[_0x6f78('0x42')]=intUtil[_0x6f78('0x49')](_0x13fd0c[_0x6f78('0x42')]);if(_0x4accf8&&_0x4accf8['monitor_format']){logger[_0x6f78('0x1e')](_0x6f78('0x64'),_0x6f78('0x5b'));_0x12aa55[_0x6f78('0x4c')]=util[_0x6f78('0x2f')](_0x6f78('0x65'),_0x13fd0c['serverUrl'],_0x12aa55[_0x6f78('0x4d')],md5(_0x12aa55[_0x6f78('0x4d')]));}else{_0x12aa55['recordingURL']='';}return getConnection(_0x13fd0c)[_0x6f78('0x1c')](function(_0x441656){_0x45abfe=_0x441656;if(!_[_0x6f78('0x66')](_0x970cb4)){return getUser(_0x13fd0c,_0x970cb4[_0x6f78('0x3e')],_0x45abfe);}else{return getUser(_0x13fd0c,null,_0x45abfe);}})[_0x6f78('0x1c')](function(_0x34b27d){_0xcf4e2e=_0x34b27d;return getEndUser(_0x13fd0c,_0x24b797,_0x12aa55[_0x6f78('0x4f')],_0x12aa55['calleridnum'],_0x45abfe);})[_0x6f78('0x1c')](function(_0x2bd2f4){_0x265526=_0x2bd2f4;return getTicket(_0x13fd0c,_0xcf4e2e,_0x265526,_0x24b797,_0x12aa55,_0x24b797[_0x6f78('0x50')],_0x45abfe);})[_0x6f78('0x1c')](function(_0x316239){_0xdfd9b5=_0x316239;logger[_0x6f78('0x1e')]('[ABANDONED]\x20Ticket\x20%s\x20created.',_0xdfd9b5['id']);logger[_0x6f78('0x1e')]('[ABANDONED]\x20Integration\x20account\x20type\x20%s.',_0x13fd0c[_0x6f78('0x36')]);})[_0x6f78('0x61')](function(_0x190fd2){logger[_0x6f78('0x62')](_0x6f78('0x64'),JSON[_0x6f78('0x56')](_0x190fd2));});}; \ 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 9fd64b8..a1f2cc1 100644 --- a/server/services/ami/trigger/integration/servicenow.js +++ b/server/services/ami/trigger/integration/servicenow.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','then','],\x20getUser\x20entity','userId','adminEmail','],\x20getUser\x20crm','catch','],\x20createEndUser\x20input\x20crm','POST','sys_user?','user','endUserNumber','true','System','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','length','forEach','type','customField','idField','content','toString','toLowerCase','variable','variableName','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema',']\x20getTicket\x20crm','label','Incident','ticketId','Incident\x20-\x20','ticketNumber','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','password','sysparm_limit=1','sysparm_display_value=true','serverUrl','stripTrailingSlash','%s/api/now/table/','remoteUri','email','destcalleridnum','calleridnum','queue','abandoned','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s',']\x20Error\x20running\x20ServiceNow\x20integration','lodash','bluebird','request-promise','ioredis','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','adminId','result','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','error','message'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x0a9e('0x0'));var Promise=require(_0x0a9e('0x1'));var rp=require(_0x0a9e('0x2'));var util=require('util');var md5=require('md5');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function getAdminUser(_0x5f41ea,_0x503809,_0xe42b77,_0x56465b,_0x52cace,_0x39753a){return new Promise(function(_0xf81284,_0x307b3e){var _0x3ab53f={'method':_0x0a9e('0xb'),'uri':_0x56465b+_0x0a9e('0xc')+'&'+_0x52cace+'&'+_0x39753a,'auth':_0x503809,'json':!![]};return rp(_0x3ab53f)['then'](function(_0x50dfb2){if(_0x50dfb2['result']['length']>0x0){_0xe42b77[_0x0a9e('0xd')]=_0x50dfb2[_0x0a9e('0xe')][0x0][_0x0a9e('0xf')];}logger[_0x0a9e('0x10')]('['+[_0x5f41ea[_0x0a9e('0x11')]()]+_0x0a9e('0x12'),_0xe42b77);_0xf81284(_0xe42b77);})['catch'](function(_0x4283ce){logger[_0x0a9e('0x13')]('['+[_0x5f41ea[_0x0a9e('0x11')]()]+']',_0x4283ce[_0x0a9e('0x14')]);_0x307b3e(_0x4283ce[_0x0a9e('0x14')]);});});}function getUser(_0x4d5611,_0x52a03d,_0x22dccb,_0x5d0880,_0x1985b6){return function(_0x519dfd){logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+'],\x20getUser\x20input\x20crm',_0x519dfd);return new Promise(function(_0x225616,_0x5a0a06){if(intUtil[_0x0a9e('0x15')](_0x519dfd[_0x0a9e('0x16')])){var _0x106033={'method':_0x0a9e('0xb'),'uri':_0x22dccb+_0x0a9e('0x17')+_0x519dfd[_0x0a9e('0x16')]+'&'+_0x5d0880+'&'+_0x1985b6,'auth':_0x52a03d,'json':!![]};logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+_0x0a9e('0x18'),_0x106033);return rp(_0x106033)[_0x0a9e('0x19')](function(_0x1c696a){logger[_0x0a9e('0x10')]('['+[_0x4d5611['toUpperCase']()]+_0x0a9e('0x1a'),_0x1c696a);if(_0x1c696a[_0x0a9e('0xe')]['length']>0x0&&String(_0x1c696a[_0x0a9e('0xe')][0x0]['active'])==='true'){_0x519dfd[_0x0a9e('0x1b')]=_0x1c696a[_0x0a9e('0xe')][0x0][_0x0a9e('0xf')];}else{_0x519dfd[_0x0a9e('0x1b')]=_0x519dfd['adminId'];_0x519dfd[_0x0a9e('0x16')]=_0x519dfd[_0x0a9e('0x1c')];}logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+_0x0a9e('0x1d'),_0x519dfd);_0x225616(_0x519dfd);})[_0x0a9e('0x1e')](function(_0x16b1ca){logger['error']('['+[_0x4d5611['toUpperCase']()]+']',_0x16b1ca[_0x0a9e('0x14')]);_0x5a0a06(_0x16b1ca[_0x0a9e('0x14')]);});}else{logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+']\x20using\x20admin\x20profile');_0x519dfd[_0x0a9e('0x1b')]=_0x519dfd['adminId'];_0x519dfd[_0x0a9e('0x16')]=_0x519dfd['adminEmail'];_0x225616(_0x519dfd);}});};}function createEndUser(_0x1dc186,_0x34dc65,_0x25fba9,_0x14433c,_0x140511){logger[_0x0a9e('0x10')]('['+[_0x1dc186[_0x0a9e('0x11')]()]+_0x0a9e('0x1f'),_0x25fba9);return new Promise(function(_0x5a101a,_0x3652a7){var _0x468813={'method':_0x0a9e('0x20'),'uri':_0x14433c+_0x0a9e('0x21')+_0x140511,'body':{'user_name':_0x25fba9['endUserNumber'],'roles':_0x0a9e('0x22'),'first_name':_0x25fba9[_0x0a9e('0x23')],'active':_0x0a9e('0x24'),'date_format':_0x0a9e('0x25'),'phone':_0x25fba9[_0x0a9e('0x23')]},'auth':_0x34dc65,'json':!![]};return rp(_0x468813)[_0x0a9e('0x19')](function(_0x296f41){logger[_0x0a9e('0x10')]('['+[_0x1dc186[_0x0a9e('0x11')]()]+'],\x20EndUser\x20schema',_0x296f41[_0x0a9e('0xe')]);_0x25fba9['endUserId']=_0x296f41[_0x0a9e('0xe')][_0x0a9e('0xf')];_0x5a101a(_0x25fba9);})[_0x0a9e('0x1e')](function(_0x33bdb7){logger[_0x0a9e('0x13')]('['+[_0x1dc186['toUpperCase']()]+']',_0x33bdb7[_0x0a9e('0x14')]);_0x3652a7(_0x33bdb7[_0x0a9e('0x14')]);});});}function getEndUser(_0x40cb85,_0x2da5c0,_0x2b45ea,_0x409319,_0x332d35){return function(_0x39e565){logger['info']('['+[_0x40cb85[_0x0a9e('0x11')]()]+'],\x20getEndUser\x20input\x20crm',_0x39e565);return new Promise(function(_0x2cc7a0,_0x14b13f){var _0x2b7e7f={'method':_0x0a9e('0xb'),'uri':_0x2b45ea+'sys_user?sysparm_query=phone%3D'+_0x39e565[_0x0a9e('0x23')]+'&'+_0x409319+'&'+_0x332d35,'auth':_0x2da5c0,'json':!![]};return rp(_0x2b7e7f)[_0x0a9e('0x19')](function(_0x1fa90d){if(_0x1fa90d[_0x0a9e('0xe')]['length']>0x0){_0x39e565['endUserId']=_0x1fa90d[_0x0a9e('0xe')][0x0]['sys_id'];logger[_0x0a9e('0x10')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+_0x0a9e('0x26'),_0x39e565);_0x2cc7a0(_0x39e565);}else{return createEndUser(_0x40cb85,_0x2da5c0,_0x39e565,_0x2b45ea,_0x409319)[_0x0a9e('0x19')](function(_0x4f41ae){logger[_0x0a9e('0x10')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+_0x0a9e('0x27'),_0x4f41ae);_0x2cc7a0(_0x4f41ae);});}})['catch'](function(_0x1dbf74){logger[_0x0a9e('0x13')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+']',_0x1dbf74['message']);_0x14b13f(_0x1dbf74['message']);});});};}function getCustomFields(_0x11b61d,_0x40d766){var _0x5adda1={};if(_0x11b61d[_0x0a9e('0x28')]>0x0){_[_0x0a9e('0x29')](_0x11b61d,function(_0x2e1b3a){if(_0x2e1b3a[_0x0a9e('0x2a')]==='string'&&_0x2e1b3a['nameField']&&!_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')]['toLowerCase']()]=_0x2e1b3a[_0x0a9e('0x2d')][_0x0a9e('0x2e')]();}else if(_0x2e1b3a[_0x0a9e('0x2a')]==='string'&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x2e1b3a[_0x0a9e('0x2d')][_0x0a9e('0x2e')]();}else if(_0x2e1b3a[_0x0a9e('0x2a')]===_0x0a9e('0x30')&&_0x2e1b3a[_0x0a9e('0x31')]&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x40d766[_0x2e1b3a[_0x0a9e('0x31')]][_0x0a9e('0x2e')]();}else if(_0x2e1b3a['type']==='customVariable'&&_0x2e1b3a[_0x0a9e('0x32')]&&_0x2e1b3a[_0x0a9e('0x32')][_0x0a9e('0x33')]&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x40d766[_0x2e1b3a[_0x0a9e('0x32')][_0x0a9e('0x33')][_0x0a9e('0x2f')]()][_0x0a9e('0x2e')]();}});}return _0x5adda1;}function getTicket(_0x35ed4a,_0x5026aa,_0x117c99,_0x138b8b,_0xdd268f,_0xfbd5ad){return function(_0x2e8caf){logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x34'),_0x2e8caf);return new Promise(function(_0x59afe8,_0x2e9d90){var _0x48fd45=_0x35ed4a[_0x0a9e('0x2f')]()===_0x0a9e('0x35')?_0x2e8caf[_0x0a9e('0x1b')]:_0x2e8caf['endUserId'];var _0x14bec2={'method':_0x0a9e('0x20'),'uri':_0x117c99+_0x0a9e('0x36')+'?'+_0xfbd5ad,'body':Object[_0x0a9e('0x37')]({},{'active':_0x0a9e('0x24'),'caller_id':_0x48fd45,'assigned_to':_0x2e8caf[_0x0a9e('0x1b')],'short_description':intUtil[_0x0a9e('0x38')](_0x138b8b['Subjects'],_0xdd268f,'\x20'),'description':intUtil[_0x0a9e('0x38')](_0x138b8b[_0x0a9e('0x39')],_0xdd268f,'\x0a')},getCustomFields(_0x138b8b[_0x0a9e('0x3a')],_0xdd268f)),'auth':_0x5026aa,'json':!![]};return rp(_0x14bec2)[_0x0a9e('0x19')](function(_0x409789){logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x3b'),_0x409789[_0x0a9e('0xe')]);_0x2e8caf['ticketId']=_0x409789[_0x0a9e('0xe')][_0x0a9e('0xf')];_0x2e8caf['ticketNumber']=_0x409789['result']['number'];logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x3c'),_0x2e8caf);_0x59afe8(_0x2e8caf);})[_0x0a9e('0x1e')](function(_0x61bb17){logger[_0x0a9e('0x13')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+']',_0x61bb17[_0x0a9e('0x14')]);_0x2e9d90(_0x61bb17['message']);});});};}function createRemoteTag(_0x4b1b9f,_0x53975a,_0x39d77d,_0x204173){return new Promise(function(_0x14d602,_0x5bb3ed){var _0x2b69d9={'method':_0x0a9e('0x20'),'uri':_0x39d77d+'label'+'?'+_0x204173,'body':{'short_description':_0x4b1b9f,'global':!![],'active':!![],'name':_0x4b1b9f},'auth':_0x53975a,'json':!![]};return rp(_0x2b69d9)['then'](function(_0x2ef381){var _0x59c6ff=_0x2ef381[_0x0a9e('0xe')]['sys_id'];_0x14d602(_0x59c6ff);});});}function getRemoteTag(_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a,_0x2f82da){return new Promise(function(_0x1bf38a,_0x508b47){var _0x50f687={'method':_0x0a9e('0xb'),'uri':_0x439340+_0x0a9e('0x3d')+'?sysparm_query=name%3D'+_0x2e5e62+'&'+_0x53613a,'auth':_0x3c20b2,'json':!![]};return rp(_0x50f687)[_0x0a9e('0x19')](function(_0x5ce9ac){if(_0x5ce9ac[_0x0a9e('0xe')]['length']>0x0){var _0xe22ccc=_0x5ce9ac['result'][0x0]['sys_id'];_0x1bf38a(_0xe22ccc);}else{return createRemoteTag(_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a)['then'](function(_0x2da03c){_0x1bf38a(_0x2da03c);});}});});}function assignTagToIncident(_0x47de4c,_0x2f7092,_0x65432,_0x3cfd00,_0x19b4df){return new Promise(function(_0x232830,_0x272738){var _0xd10662={'method':_0x0a9e('0x20'),'uri':_0x65432+'label_entry'+'?'+_0x19b4df,'body':{'label':_0x47de4c,'table':_0x0a9e('0x36'),'id_type':_0x0a9e('0x3e'),'table_key':_0x3cfd00[_0x0a9e('0x3f')],'title':_0x0a9e('0x40')+_0x3cfd00[_0x0a9e('0x41')],'id_display':_0x3cfd00[_0x0a9e('0x41')]},'auth':_0x2f7092,'json':!![]};return rp(_0xd10662)['then'](function(_0x956fbe){_0x232830();})[_0x0a9e('0x1e')](function(){_0x232830();});});}function manageTags(_0x5239ef,_0x3649cc,_0x5cc8fb,_0x20c668,_0x5ba1f9,_0x4b3c1a,_0x5674ee){return new Promise(function(_0x273cb5,_0x49d231){var _0x2244d6=[];_0x3649cc[_0x0a9e('0x29')](function(_0x261adb){_0x2244d6[_0x0a9e('0x42')](getRemoteTag(_0x261adb,_0x5cc8fb,_0x20c668,_0x4b3c1a,_0x5674ee));});return Promise[_0x0a9e('0x43')](_0x2244d6)[_0x0a9e('0x19')](function(_0x49eed0){if(_0x49eed0[_0x0a9e('0x28')]){logger['info']('['+[_0x5239ef[_0x0a9e('0x11')]()]+_0x0a9e('0x44'),_0x49eed0);var _0x51aaf7=[];_0x49eed0['forEach'](function(_0x453360){_0x51aaf7[_0x0a9e('0x42')](assignTagToIncident(_0x453360,_0x5cc8fb,_0x20c668,_0x5ba1f9,_0x4b3c1a));});return Promise[_0x0a9e('0x43')](_0x51aaf7)[_0x0a9e('0x19')](function(){_0x273cb5();})['catch'](function(){_0x273cb5();});}else{_0x273cb5();}});});}function getTags(_0x1d0dc8,_0xe05a5a,_0x54327c,_0x797b45,_0x17e88c,_0x88dcbf){return function(_0x409b29){return new Promise(function(_0x401837,_0x4d4a35){var _0x176840=[];var _0x2937e0=_0x797b45[_0x0a9e('0x45')];if(_0x2937e0&&_0x2937e0['length']>0x0){_0x176840=_[_0x0a9e('0x46')](_0x2937e0,'name');}if(_0x176840['length']>0x0){return manageTags(_0x1d0dc8,_0x176840,_0xe05a5a,_0x54327c,_0x409b29,_0x17e88c,_0x88dcbf)[_0x0a9e('0x19')](function(){_0x401837(_0x409b29);});}else{_0x401837(_0x409b29);}});};}function emit(_0x4556c5,_0x9375fb,_0x19c995){var _0x186f39=_0x0a9e('0x47')+_0x0a9e('0x48')+_0x0a9e('0x49')+_0x0a9e('0x4a');var _0x1cc4f3={'uri':_0x4556c5+_0x0a9e('0x4b')+_0x19c995+_0x186f39};io['to'](util[_0x0a9e('0x4c')](_0x0a9e('0x4d'),_0x9375fb))[_0x0a9e('0x4e')](_0x0a9e('0x4f'),_0x1cc4f3);}exports['cs']=function(_0x412a72,_0x2a28c0,_0x4257c9,_0x5150a4,_0x1b0b98,_0x295763,_0x243d12,_0x4edbb0){var _0x1148a1={};var _0x30944e={'user':_0x295763['username'],'pass':_0x295763[_0x0a9e('0x50')]};var _0x56e31e=_0x0a9e('0x51');var _0x427946=_0x0a9e('0x52');_0x295763['remoteUri']=intUtil['stripTrailingSlash'](_0x295763['remoteUri']);_0x295763[_0x0a9e('0x53')]=intUtil[_0x0a9e('0x54')](_0x295763[_0x0a9e('0x53')]);var _0x23a7d3=util[_0x0a9e('0x4c')](_0x0a9e('0x55'),_0x295763[_0x0a9e('0x56')]);_0x1148a1[_0x0a9e('0x16')]=!_['isNil'](_0x5150a4)?_0x5150a4[_0x0a9e('0x57')]:null;_0x1148a1[_0x0a9e('0x1c')]=_0x295763[_0x0a9e('0x57')];_0x1148a1['endUserNumber']=_0x4edbb0[_0x0a9e('0x2f')]()==='outbound'?_0x2a28c0[_0x0a9e('0x58')]:_0x2a28c0[_0x0a9e('0x59')];_0x1148a1['callDirection']=_0x4edbb0===_0x0a9e('0x5a')||_0x4edbb0===_0x0a9e('0x5b')?_0x0a9e('0x5a'):_0x0a9e('0x35');var _0x542ece=util[_0x0a9e('0x4c')](_0x0a9e('0x5c'),_0x295763[_0x0a9e('0x53')],_0x2a28c0[_0x0a9e('0x5d')],md5(_0x2a28c0['uniqueid']));if(_0x1b0b98&&_0x1b0b98[_0x0a9e('0x5e')]){logger[_0x0a9e('0x10')](_0x0a9e('0x5f'),_0x0a9e('0x60'));_0x2a28c0['recordingURL']=_0x542ece;}else if(_0x243d12&&_0x243d12[_0x0a9e('0x61')]&&_0x243d12[_0x0a9e('0x61')]!==_0x0a9e('0x62')){logger[_0x0a9e('0x10')](_0x0a9e('0x63'),_0x0a9e('0x60'));_0x2a28c0[_0x0a9e('0x64')]=_0x542ece;}else{_0x2a28c0[_0x0a9e('0x64')]='';}return getAdminUser(_0x4edbb0,_0x30944e,_0x1148a1,_0x23a7d3,_0x427946,_0x56e31e)[_0x0a9e('0x19')](getUser(_0x4edbb0,_0x30944e,_0x23a7d3,_0x427946,_0x56e31e))[_0x0a9e('0x19')](getEndUser(_0x4edbb0,_0x30944e,_0x23a7d3,_0x427946,_0x56e31e))[_0x0a9e('0x19')](getTicket(_0x4edbb0,_0x30944e,_0x23a7d3,_0x4257c9,_0x2a28c0,_0x427946))[_0x0a9e('0x19')](function(_0x25744a){logger[_0x0a9e('0x10')](util['format'](_0x0a9e('0x65'),_0x25744a[_0x0a9e('0x3f')]));logger[_0x0a9e('0x10')](util['format'](_0x0a9e('0x66'),_0x4edbb0));if(_0x4edbb0!==_0x0a9e('0x5b')){logger[_0x0a9e('0x10')]('['+[_0x4edbb0[_0x0a9e('0x11')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x295763['remoteUri'],_0x5150a4[_0x0a9e('0x33')],_0x25744a[_0x0a9e('0x3f')]);}})['catch'](function(_0x45108c){logger['error']('['+[_0x4edbb0[_0x0a9e('0x11')]()]+_0x0a9e('0x67'),util['inspect'](_0x45108c,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xa9e0=['validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','then','],\x20getUser\x20entity','userId','adminEmail','],\x20getUser\x20crm','catch','],\x20createEndUser\x20input\x20crm','POST','sys_user?','user','endUserNumber','true','System','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','length','forEach','type','customField','idField','content','toString','toLowerCase','variable','variableName','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema',']\x20getTicket\x20crm','label','Incident','ticketId','Incident\x20-\x20','ticketNumber','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','password','sysparm_limit=1','sysparm_display_value=true','serverUrl','stripTrailingSlash','%s/api/now/table/','remoteUri','email','destcalleridnum','calleridnum','queue','abandoned','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s',']\x20Error\x20running\x20ServiceNow\x20integration','lodash','bluebird','request-promise','ioredis','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','adminId','result','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','error','message'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x0a9e('0x0'));var Promise=require(_0x0a9e('0x1'));var rp=require(_0x0a9e('0x2'));var util=require('util');var md5=require('md5');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function getAdminUser(_0x5f41ea,_0x503809,_0xe42b77,_0x56465b,_0x52cace,_0x39753a){return new Promise(function(_0xf81284,_0x307b3e){var _0x3ab53f={'method':_0x0a9e('0xb'),'uri':_0x56465b+_0x0a9e('0xc')+'&'+_0x52cace+'&'+_0x39753a,'auth':_0x503809,'json':!![]};return rp(_0x3ab53f)['then'](function(_0x50dfb2){if(_0x50dfb2['result']['length']>0x0){_0xe42b77[_0x0a9e('0xd')]=_0x50dfb2[_0x0a9e('0xe')][0x0][_0x0a9e('0xf')];}logger[_0x0a9e('0x10')]('['+[_0x5f41ea[_0x0a9e('0x11')]()]+_0x0a9e('0x12'),_0xe42b77);_0xf81284(_0xe42b77);})['catch'](function(_0x4283ce){logger[_0x0a9e('0x13')]('['+[_0x5f41ea[_0x0a9e('0x11')]()]+']',_0x4283ce[_0x0a9e('0x14')]);_0x307b3e(_0x4283ce[_0x0a9e('0x14')]);});});}function getUser(_0x4d5611,_0x52a03d,_0x22dccb,_0x5d0880,_0x1985b6){return function(_0x519dfd){logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+'],\x20getUser\x20input\x20crm',_0x519dfd);return new Promise(function(_0x225616,_0x5a0a06){if(intUtil[_0x0a9e('0x15')](_0x519dfd[_0x0a9e('0x16')])){var _0x106033={'method':_0x0a9e('0xb'),'uri':_0x22dccb+_0x0a9e('0x17')+_0x519dfd[_0x0a9e('0x16')]+'&'+_0x5d0880+'&'+_0x1985b6,'auth':_0x52a03d,'json':!![]};logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+_0x0a9e('0x18'),_0x106033);return rp(_0x106033)[_0x0a9e('0x19')](function(_0x1c696a){logger[_0x0a9e('0x10')]('['+[_0x4d5611['toUpperCase']()]+_0x0a9e('0x1a'),_0x1c696a);if(_0x1c696a[_0x0a9e('0xe')]['length']>0x0&&String(_0x1c696a[_0x0a9e('0xe')][0x0]['active'])==='true'){_0x519dfd[_0x0a9e('0x1b')]=_0x1c696a[_0x0a9e('0xe')][0x0][_0x0a9e('0xf')];}else{_0x519dfd[_0x0a9e('0x1b')]=_0x519dfd['adminId'];_0x519dfd[_0x0a9e('0x16')]=_0x519dfd[_0x0a9e('0x1c')];}logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+_0x0a9e('0x1d'),_0x519dfd);_0x225616(_0x519dfd);})[_0x0a9e('0x1e')](function(_0x16b1ca){logger['error']('['+[_0x4d5611['toUpperCase']()]+']',_0x16b1ca[_0x0a9e('0x14')]);_0x5a0a06(_0x16b1ca[_0x0a9e('0x14')]);});}else{logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+']\x20using\x20admin\x20profile');_0x519dfd[_0x0a9e('0x1b')]=_0x519dfd['adminId'];_0x519dfd[_0x0a9e('0x16')]=_0x519dfd['adminEmail'];_0x225616(_0x519dfd);}});};}function createEndUser(_0x1dc186,_0x34dc65,_0x25fba9,_0x14433c,_0x140511){logger[_0x0a9e('0x10')]('['+[_0x1dc186[_0x0a9e('0x11')]()]+_0x0a9e('0x1f'),_0x25fba9);return new Promise(function(_0x5a101a,_0x3652a7){var _0x468813={'method':_0x0a9e('0x20'),'uri':_0x14433c+_0x0a9e('0x21')+_0x140511,'body':{'user_name':_0x25fba9['endUserNumber'],'roles':_0x0a9e('0x22'),'first_name':_0x25fba9[_0x0a9e('0x23')],'active':_0x0a9e('0x24'),'date_format':_0x0a9e('0x25'),'phone':_0x25fba9[_0x0a9e('0x23')]},'auth':_0x34dc65,'json':!![]};return rp(_0x468813)[_0x0a9e('0x19')](function(_0x296f41){logger[_0x0a9e('0x10')]('['+[_0x1dc186[_0x0a9e('0x11')]()]+'],\x20EndUser\x20schema',_0x296f41[_0x0a9e('0xe')]);_0x25fba9['endUserId']=_0x296f41[_0x0a9e('0xe')][_0x0a9e('0xf')];_0x5a101a(_0x25fba9);})[_0x0a9e('0x1e')](function(_0x33bdb7){logger[_0x0a9e('0x13')]('['+[_0x1dc186['toUpperCase']()]+']',_0x33bdb7[_0x0a9e('0x14')]);_0x3652a7(_0x33bdb7[_0x0a9e('0x14')]);});});}function getEndUser(_0x40cb85,_0x2da5c0,_0x2b45ea,_0x409319,_0x332d35){return function(_0x39e565){logger['info']('['+[_0x40cb85[_0x0a9e('0x11')]()]+'],\x20getEndUser\x20input\x20crm',_0x39e565);return new Promise(function(_0x2cc7a0,_0x14b13f){var _0x2b7e7f={'method':_0x0a9e('0xb'),'uri':_0x2b45ea+'sys_user?sysparm_query=phone%3D'+_0x39e565[_0x0a9e('0x23')]+'&'+_0x409319+'&'+_0x332d35,'auth':_0x2da5c0,'json':!![]};return rp(_0x2b7e7f)[_0x0a9e('0x19')](function(_0x1fa90d){if(_0x1fa90d[_0x0a9e('0xe')]['length']>0x0){_0x39e565['endUserId']=_0x1fa90d[_0x0a9e('0xe')][0x0]['sys_id'];logger[_0x0a9e('0x10')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+_0x0a9e('0x26'),_0x39e565);_0x2cc7a0(_0x39e565);}else{return createEndUser(_0x40cb85,_0x2da5c0,_0x39e565,_0x2b45ea,_0x409319)[_0x0a9e('0x19')](function(_0x4f41ae){logger[_0x0a9e('0x10')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+_0x0a9e('0x27'),_0x4f41ae);_0x2cc7a0(_0x4f41ae);});}})['catch'](function(_0x1dbf74){logger[_0x0a9e('0x13')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+']',_0x1dbf74['message']);_0x14b13f(_0x1dbf74['message']);});});};}function getCustomFields(_0x11b61d,_0x40d766){var _0x5adda1={};if(_0x11b61d[_0x0a9e('0x28')]>0x0){_[_0x0a9e('0x29')](_0x11b61d,function(_0x2e1b3a){if(_0x2e1b3a[_0x0a9e('0x2a')]==='string'&&_0x2e1b3a['nameField']&&!_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')]['toLowerCase']()]=_0x2e1b3a[_0x0a9e('0x2d')][_0x0a9e('0x2e')]();}else if(_0x2e1b3a[_0x0a9e('0x2a')]==='string'&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x2e1b3a[_0x0a9e('0x2d')][_0x0a9e('0x2e')]();}else if(_0x2e1b3a[_0x0a9e('0x2a')]===_0x0a9e('0x30')&&_0x2e1b3a[_0x0a9e('0x31')]&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x40d766[_0x2e1b3a[_0x0a9e('0x31')]][_0x0a9e('0x2e')]();}else if(_0x2e1b3a['type']==='customVariable'&&_0x2e1b3a[_0x0a9e('0x32')]&&_0x2e1b3a[_0x0a9e('0x32')][_0x0a9e('0x33')]&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x40d766[_0x2e1b3a[_0x0a9e('0x32')][_0x0a9e('0x33')][_0x0a9e('0x2f')]()][_0x0a9e('0x2e')]();}});}return _0x5adda1;}function getTicket(_0x35ed4a,_0x5026aa,_0x117c99,_0x138b8b,_0xdd268f,_0xfbd5ad){return function(_0x2e8caf){logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x34'),_0x2e8caf);return new Promise(function(_0x59afe8,_0x2e9d90){var _0x48fd45=_0x35ed4a[_0x0a9e('0x2f')]()===_0x0a9e('0x35')?_0x2e8caf[_0x0a9e('0x1b')]:_0x2e8caf['endUserId'];var _0x14bec2={'method':_0x0a9e('0x20'),'uri':_0x117c99+_0x0a9e('0x36')+'?'+_0xfbd5ad,'body':Object[_0x0a9e('0x37')]({},{'active':_0x0a9e('0x24'),'caller_id':_0x48fd45,'assigned_to':_0x2e8caf[_0x0a9e('0x1b')],'short_description':intUtil[_0x0a9e('0x38')](_0x138b8b['Subjects'],_0xdd268f,'\x20'),'description':intUtil[_0x0a9e('0x38')](_0x138b8b[_0x0a9e('0x39')],_0xdd268f,'\x0a')},getCustomFields(_0x138b8b[_0x0a9e('0x3a')],_0xdd268f)),'auth':_0x5026aa,'json':!![]};return rp(_0x14bec2)[_0x0a9e('0x19')](function(_0x409789){logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x3b'),_0x409789[_0x0a9e('0xe')]);_0x2e8caf['ticketId']=_0x409789[_0x0a9e('0xe')][_0x0a9e('0xf')];_0x2e8caf['ticketNumber']=_0x409789['result']['number'];logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x3c'),_0x2e8caf);_0x59afe8(_0x2e8caf);})[_0x0a9e('0x1e')](function(_0x61bb17){logger[_0x0a9e('0x13')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+']',_0x61bb17[_0x0a9e('0x14')]);_0x2e9d90(_0x61bb17['message']);});});};}function createRemoteTag(_0x4b1b9f,_0x53975a,_0x39d77d,_0x204173){return new Promise(function(_0x14d602,_0x5bb3ed){var _0x2b69d9={'method':_0x0a9e('0x20'),'uri':_0x39d77d+'label'+'?'+_0x204173,'body':{'short_description':_0x4b1b9f,'global':!![],'active':!![],'name':_0x4b1b9f},'auth':_0x53975a,'json':!![]};return rp(_0x2b69d9)['then'](function(_0x2ef381){var _0x59c6ff=_0x2ef381[_0x0a9e('0xe')]['sys_id'];_0x14d602(_0x59c6ff);});});}function getRemoteTag(_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a,_0x2f82da){return new Promise(function(_0x1bf38a,_0x508b47){var _0x50f687={'method':_0x0a9e('0xb'),'uri':_0x439340+_0x0a9e('0x3d')+'?sysparm_query=name%3D'+_0x2e5e62+'&'+_0x53613a,'auth':_0x3c20b2,'json':!![]};return rp(_0x50f687)[_0x0a9e('0x19')](function(_0x5ce9ac){if(_0x5ce9ac[_0x0a9e('0xe')]['length']>0x0){var _0xe22ccc=_0x5ce9ac['result'][0x0]['sys_id'];_0x1bf38a(_0xe22ccc);}else{return createRemoteTag(_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a)['then'](function(_0x2da03c){_0x1bf38a(_0x2da03c);});}});});}function assignTagToIncident(_0x47de4c,_0x2f7092,_0x65432,_0x3cfd00,_0x19b4df){return new Promise(function(_0x232830,_0x272738){var _0xd10662={'method':_0x0a9e('0x20'),'uri':_0x65432+'label_entry'+'?'+_0x19b4df,'body':{'label':_0x47de4c,'table':_0x0a9e('0x36'),'id_type':_0x0a9e('0x3e'),'table_key':_0x3cfd00[_0x0a9e('0x3f')],'title':_0x0a9e('0x40')+_0x3cfd00[_0x0a9e('0x41')],'id_display':_0x3cfd00[_0x0a9e('0x41')]},'auth':_0x2f7092,'json':!![]};return rp(_0xd10662)['then'](function(_0x956fbe){_0x232830();})[_0x0a9e('0x1e')](function(){_0x232830();});});}function manageTags(_0x5239ef,_0x3649cc,_0x5cc8fb,_0x20c668,_0x5ba1f9,_0x4b3c1a,_0x5674ee){return new Promise(function(_0x273cb5,_0x49d231){var _0x2244d6=[];_0x3649cc[_0x0a9e('0x29')](function(_0x261adb){_0x2244d6[_0x0a9e('0x42')](getRemoteTag(_0x261adb,_0x5cc8fb,_0x20c668,_0x4b3c1a,_0x5674ee));});return Promise[_0x0a9e('0x43')](_0x2244d6)[_0x0a9e('0x19')](function(_0x49eed0){if(_0x49eed0[_0x0a9e('0x28')]){logger['info']('['+[_0x5239ef[_0x0a9e('0x11')]()]+_0x0a9e('0x44'),_0x49eed0);var _0x51aaf7=[];_0x49eed0['forEach'](function(_0x453360){_0x51aaf7[_0x0a9e('0x42')](assignTagToIncident(_0x453360,_0x5cc8fb,_0x20c668,_0x5ba1f9,_0x4b3c1a));});return Promise[_0x0a9e('0x43')](_0x51aaf7)[_0x0a9e('0x19')](function(){_0x273cb5();})['catch'](function(){_0x273cb5();});}else{_0x273cb5();}});});}function getTags(_0x1d0dc8,_0xe05a5a,_0x54327c,_0x797b45,_0x17e88c,_0x88dcbf){return function(_0x409b29){return new Promise(function(_0x401837,_0x4d4a35){var _0x176840=[];var _0x2937e0=_0x797b45[_0x0a9e('0x45')];if(_0x2937e0&&_0x2937e0['length']>0x0){_0x176840=_[_0x0a9e('0x46')](_0x2937e0,'name');}if(_0x176840['length']>0x0){return manageTags(_0x1d0dc8,_0x176840,_0xe05a5a,_0x54327c,_0x409b29,_0x17e88c,_0x88dcbf)[_0x0a9e('0x19')](function(){_0x401837(_0x409b29);});}else{_0x401837(_0x409b29);}});};}function emit(_0x4556c5,_0x9375fb,_0x19c995){var _0x186f39=_0x0a9e('0x47')+_0x0a9e('0x48')+_0x0a9e('0x49')+_0x0a9e('0x4a');var _0x1cc4f3={'uri':_0x4556c5+_0x0a9e('0x4b')+_0x19c995+_0x186f39};io['to'](util[_0x0a9e('0x4c')](_0x0a9e('0x4d'),_0x9375fb))[_0x0a9e('0x4e')](_0x0a9e('0x4f'),_0x1cc4f3);}exports['cs']=function(_0x412a72,_0x2a28c0,_0x4257c9,_0x5150a4,_0x1b0b98,_0x295763,_0x243d12,_0x4edbb0){var _0x1148a1={};var _0x30944e={'user':_0x295763['username'],'pass':_0x295763[_0x0a9e('0x50')]};var _0x56e31e=_0x0a9e('0x51');var _0x427946=_0x0a9e('0x52');_0x295763['remoteUri']=intUtil['stripTrailingSlash'](_0x295763['remoteUri']);_0x295763[_0x0a9e('0x53')]=intUtil[_0x0a9e('0x54')](_0x295763[_0x0a9e('0x53')]);var _0x23a7d3=util[_0x0a9e('0x4c')](_0x0a9e('0x55'),_0x295763[_0x0a9e('0x56')]);_0x1148a1[_0x0a9e('0x16')]=!_['isNil'](_0x5150a4)?_0x5150a4[_0x0a9e('0x57')]:null;_0x1148a1[_0x0a9e('0x1c')]=_0x295763[_0x0a9e('0x57')];_0x1148a1['endUserNumber']=_0x4edbb0[_0x0a9e('0x2f')]()==='outbound'?_0x2a28c0[_0x0a9e('0x58')]:_0x2a28c0[_0x0a9e('0x59')];_0x1148a1['callDirection']=_0x4edbb0===_0x0a9e('0x5a')||_0x4edbb0===_0x0a9e('0x5b')?_0x0a9e('0x5a'):_0x0a9e('0x35');var _0x542ece=util[_0x0a9e('0x4c')](_0x0a9e('0x5c'),_0x295763[_0x0a9e('0x53')],_0x2a28c0[_0x0a9e('0x5d')],md5(_0x2a28c0['uniqueid']));if(_0x1b0b98&&_0x1b0b98[_0x0a9e('0x5e')]){logger[_0x0a9e('0x10')](_0x0a9e('0x5f'),_0x0a9e('0x60'));_0x2a28c0['recordingURL']=_0x542ece;}else if(_0x243d12&&_0x243d12[_0x0a9e('0x61')]&&_0x243d12[_0x0a9e('0x61')]!==_0x0a9e('0x62')){logger[_0x0a9e('0x10')](_0x0a9e('0x63'),_0x0a9e('0x60'));_0x2a28c0[_0x0a9e('0x64')]=_0x542ece;}else{_0x2a28c0[_0x0a9e('0x64')]='';}return getAdminUser(_0x4edbb0,_0x30944e,_0x1148a1,_0x23a7d3,_0x427946,_0x56e31e)[_0x0a9e('0x19')](getUser(_0x4edbb0,_0x30944e,_0x23a7d3,_0x427946,_0x56e31e))[_0x0a9e('0x19')](getEndUser(_0x4edbb0,_0x30944e,_0x23a7d3,_0x427946,_0x56e31e))[_0x0a9e('0x19')](getTicket(_0x4edbb0,_0x30944e,_0x23a7d3,_0x4257c9,_0x2a28c0,_0x427946))[_0x0a9e('0x19')](function(_0x25744a){logger[_0x0a9e('0x10')](util['format'](_0x0a9e('0x65'),_0x25744a[_0x0a9e('0x3f')]));logger[_0x0a9e('0x10')](util['format'](_0x0a9e('0x66'),_0x4edbb0));if(_0x4edbb0!==_0x0a9e('0x5b')){logger[_0x0a9e('0x10')]('['+[_0x4edbb0[_0x0a9e('0x11')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x295763['remoteUri'],_0x5150a4[_0x0a9e('0x33')],_0x25744a[_0x0a9e('0x3f')]);}})['catch'](function(_0x45108c){logger['error']('['+[_0x4edbb0[_0x0a9e('0x11')]()]+_0x0a9e('0x67'),util['inspect'](_0x45108c,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/sugarcrm.js b/server/services/ami/trigger/integration/sugarcrm.js index 3e02285..207636c 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 _0xc239=['Ticket\x20created!','The\x20Ticket\x20ID\x20is:','contacts','version','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','catch','outbound','%s/service/v4_1/rest.php','recordingFormat','none','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Outbound','users','charAt','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','trigger:browser:url','[OUTBOUND]','[ABANDONED]','Recording\x20is\x20enabled!','calleridname','lodash','bluebird','md5','util','ioredis','./util','../../../../config/environment','sugarcrm','redis','defaults','POST','emit','info','Creating\x20new\x20ticket...','name','getString','assigned_user_id','created_by','description','Descriptions','date_start','toISOString','slice','replace','duration_hours','duration_minutes','parent_id','parent_type','Contacts','parent_name','length','forEach','push','idField','variableName','set_entry','JSON','Calls','format','Basic\x20%s','apiKey','base64','stringify','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','user_name','then','entry_list','find','name_value_list','value','Agent\x20found!','resolve','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!','','Enduser\x20created.','debug','merge','map','type','string','nameField','customField','toLowerCase','toString','custom_fields','content','variable','customVariable','Variable','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','uri','monitor_format','[QUEUE]','uniqueid','recordingURL','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound'];(function(_0x5df79a,_0x20d3be){var _0x3f4994=function(_0x250270){while(--_0x250270){_0x5df79a['push'](_0x5df79a['shift']());}};_0x3f4994(++_0x20d3be);}(_0xc239,0x182));var _0x9c23=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xc239[_0x1cc8fe];return _0x230054;};'use strict';var _=require(_0x9c23('0x0'));var rp=require('request-promise');var BPromise=require(_0x9c23('0x1'));var md5=require(_0x9c23('0x2'));var util=require(_0x9c23('0x3'));var Redis=require(_0x9c23('0x4'));var intUtil=require(_0x9c23('0x5'));var config=require(_0x9c23('0x6'));var logger=require('../../../../config/logger')(_0x9c23('0x7'));config[_0x9c23('0x8')]=_[_0x9c23('0x9')](config[_0x9c23('0x8')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9c23('0x8')]));var def={'method':_0x9c23('0xa'),'json':!![]};function emit(_0x3813d2,_0x3af5d2,_0x242634){io['to'](_0x3813d2)[_0x9c23('0xb')](_0x3af5d2,_0x242634);}function getTicket(_0x4aad16,_0x83aafc,_0x549919,_0x43b623,_0x319767,_0x28a6a7,_0x4d7a83,_0x6c5bfe){logger[_0x9c23('0xc')](_0x9c23('0xd'));var _0x5dd66a=new Date();var _0x13b10f=[{'name':_0x9c23('0xe'),'value':intUtil[_0x9c23('0xf')](_0x43b623['Subjects'],_0x319767,'\x20')},{'name':_0x9c23('0x10'),'value':_0x83aafc['id']},{'name':_0x9c23('0x11'),'value':_0x83aafc['id']},{'name':_0x9c23('0x12'),'value':intUtil[_0x9c23('0xf')](_0x43b623[_0x9c23('0x13')],_0x319767,'\x0a')},{'name':_0x9c23('0x14'),'value':_0x5dd66a[_0x9c23('0x15')]()[_0x9c23('0x16')](0x0,0x13)[_0x9c23('0x17')]('T','\x20')},{'name':_0x9c23('0x18'),'value':'0'},{'name':_0x9c23('0x19'),'value':'15'},{'name':_0x9c23('0x1a'),'value':_0x549919['id']},{'name':_0x9c23('0x1b'),'value':_0x9c23('0x1c')},{'name':_0x9c23('0x1d'),'value':_0x549919[_0x9c23('0xe')]},{'name':'direction','value':_0x6c5bfe}];if(_0x28a6a7[_0x9c23('0x1e')]){_[_0x9c23('0x1f')](_0x28a6a7,function(_0x331587){if(_0x319767[_0x331587['variableName']]){_0x13b10f[_0x9c23('0x20')]({'name':_0x331587[_0x9c23('0x21')],'value':_0x319767[_0x331587[_0x9c23('0x22')]]});}});}return request({'form':{'method':_0x9c23('0x23'),'input_type':_0x9c23('0x24'),'response_type':_0x9c23('0x24'),'rest_data':JSON['stringify']({'session':_0x4d7a83['id'],'module_name':_0x9c23('0x25'),'name_value_list':_0x13b10f})}});}function getAuth(_0x279bb7){return util[_0x9c23('0x26')](_0x9c23('0x27'),new Buffer(_0x279bb7[_0x9c23('0x28')]+':X')['toString'](_0x9c23('0x29')));}function getServerInfo(_0x197233){return request({'form':{'method':'get_server_info','input_type':_0x9c23('0x24'),'response_type':_0x9c23('0x24'),'rest_data':JSON[_0x9c23('0x2a')]({'session':_0x197233['id']})}});}function getUser(_0x3ae76b,_0xbfe603,_0x5dd23f){if(!_[_0x9c23('0x2b')](_0xbfe603)){logger[_0x9c23('0xc')](_0x9c23('0x2c'),_0xbfe603);return request({'form':{'method':_0x9c23('0x2d'),'input_type':_0x9c23('0x24'),'response_type':_0x9c23('0x24'),'rest_data':JSON['stringify']({'session':_0x5dd23f['id'],'module_name':_0x9c23('0x2e'),'query':util[_0x9c23('0x26')]('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0xbfe603),'order_by':'','offset':'0','select_fields':['id','name',_0x9c23('0x2f')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x9c23('0x30')](function(_0x299283){if(_0x299283[_0x9c23('0x31')][_0x9c23('0x1e')]){var _0xee5a2a=_[_0x9c23('0x32')](_0x299283['entry_list'],function(_0x3fc681){return _0x3fc681[_0x9c23('0x33')][_0x9c23('0x2f')][_0x9c23('0x34')]===_0xbfe603;});if(_0xee5a2a){logger[_0x9c23('0xc')](_0x9c23('0x35'));return BPromise[_0x9c23('0x36')]({'id':_0xee5a2a[_0x9c23('0x33')]['id'][_0x9c23('0x34')],'name':_0xee5a2a[_0x9c23('0x33')][_0x9c23('0xe')][_0x9c23('0x34')]});}}logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x9c23('0x36')]({'id':_0x5dd23f[_0x9c23('0x33')][_0x9c23('0x37')]['value'],'name':_0x5dd23f['name_value_list'][_0x9c23('0x2f')]['value']});});}else{logger[_0x9c23('0xc')]('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise[_0x9c23('0x36')]({'id':_0x5dd23f[_0x9c23('0x33')][_0x9c23('0x37')][_0x9c23('0x34')],'name':_0x5dd23f[_0x9c23('0x33')][_0x9c23('0x2f')]['value']});}}function getEndUser(_0x2c3c56,_0x1edcd,_0x418b2c,_0x4b48f9){logger[_0x9c23('0xc')](_0x9c23('0x38'),_0x418b2c);return request({'form':{'method':_0x9c23('0x2d'),'input_type':_0x9c23('0x24'),'response_type':_0x9c23('0x24'),'rest_data':JSON['stringify']({'session':_0x4b48f9['id'],'module_name':'Contacts','query':util['format'](_0x9c23('0x39'),_0x418b2c),'order_by':'','offset':'0','select_fields':['id',_0x9c23('0xe'),'phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x9c23('0x30')](function(_0xbc6b9f){if(_0xbc6b9f['entry_list'][_0x9c23('0x1e')]){var _0x14f14e=_['find'](_0xbc6b9f[_0x9c23('0x31')],function(_0x43c696){return _0x43c696[_0x9c23('0x33')][_0x9c23('0x3a')][_0x9c23('0x34')]===_0x418b2c;});if(_0x14f14e){logger['info'](_0x9c23('0x3b'));return BPromise['resolve']({'id':_0x14f14e[_0x9c23('0x33')]['id']['value'],'name':_0x14f14e[_0x9c23('0x33')][_0x9c23('0xe')][_0x9c23('0x34')],'phone':_0x14f14e[_0x9c23('0x33')]['phone_home'][_0x9c23('0x34')]});}}else{logger[_0x9c23('0xc')](_0x9c23('0x3c'));return request({'form':{'method':'set_entry','input_type':_0x9c23('0x24'),'response_type':_0x9c23('0x24'),'rest_data':JSON[_0x9c23('0x2a')]({'session':_0x4b48f9['id'],'module_name':'Contacts','name_value_list':[{'name':'first_name','value':_0x1edcd!==_0x9c23('0x3d')?_0x1edcd:util['format']('Caller\x20-\x20%s',_0x418b2c)},{'name':'phone_home','value':_0x418b2c}]})}})[_0x9c23('0x30')](function(_0x177de9){logger[_0x9c23('0xc')](_0x9c23('0x3e'));return BPromise[_0x9c23('0x36')]({'id':_0x177de9['id'],'name':_0x177de9[_0x9c23('0x31')]['first_name']['value'],'phone':_0x177de9[_0x9c23('0x31')][_0x9c23('0x3a')][_0x9c23('0x34')]});});}});}function request(_0x29cd45){logger[_0x9c23('0x3f')]('[HTTP]',JSON[_0x9c23('0x2a')](_0x29cd45));return rp(_[_0x9c23('0x40')](def,_0x29cd45));}function getTags(_0x397111,_0x75d8c8){var _0x297368=[];if(_0x397111&&_0x397111[_0x9c23('0x1e')]>0x0){_0x297368=_[_0x9c23('0x41')](_0x397111,_0x75d8c8);}return _0x297368;}function getCustomFields(_0x53cef2,_0x28cfe3){var _0x24be6a=[];var _0x32231a={'custom_fields':[]};if(_0x53cef2[_0x9c23('0x1e')]>0x0){_[_0x9c23('0x1f')](_0x53cef2,function(_0x5a8bbc){if(_0x5a8bbc[_0x9c23('0x42')]===_0x9c23('0x43')&&_0x5a8bbc[_0x9c23('0x44')]&&!_0x5a8bbc[_0x9c23('0x45')]){_0x32231a[_0x5a8bbc[_0x9c23('0x44')][_0x9c23('0x46')]()]=_0x5a8bbc['content'][_0x9c23('0x47')]();}else if(_0x5a8bbc[_0x9c23('0x42')]===_0x9c23('0x43')&&_0x5a8bbc[_0x9c23('0x21')]&&_0x5a8bbc[_0x9c23('0x45')]){_0x32231a[_0x9c23('0x48')][_0x9c23('0x20')]({'id':_0x5a8bbc[_0x9c23('0x21')],'value':_0x5a8bbc[_0x9c23('0x49')]['toString']()});}else if(_0x5a8bbc[_0x9c23('0x42')]===_0x9c23('0x4a')&&_0x5a8bbc[_0x9c23('0x22')]&&_0x5a8bbc[_0x9c23('0x21')]&&_0x5a8bbc[_0x9c23('0x45')]){_0x28cfe3[_0x5a8bbc[_0x9c23('0x22')]]&&_0x32231a[_0x9c23('0x48')][_0x9c23('0x20')]({'id':_0x5a8bbc['idField'],'value':_0x28cfe3[_0x5a8bbc['variableName']][_0x9c23('0x47')]()});}else if(_0x5a8bbc[_0x9c23('0x42')]===_0x9c23('0x4b')&&_0x5a8bbc['Variable']&&_0x5a8bbc[_0x9c23('0x4c')][_0x9c23('0xe')]&&_0x5a8bbc[_0x9c23('0x21')]&&_0x5a8bbc[_0x9c23('0x45')]){_0x28cfe3[_0x5a8bbc[_0x9c23('0x4c')]['name'][_0x9c23('0x46')]()]&&_0x32231a[_0x9c23('0x48')][_0x9c23('0x20')]({'id':_0x5a8bbc[_0x9c23('0x21')],'value':_0x28cfe3[_0x5a8bbc[_0x9c23('0x4c')][_0x9c23('0xe')][_0x9c23('0x46')]()]['toString']()});}});}return _0x32231a;}function getConnection(_0x3ca81b){return request({'method':'POST','form':{'method':_0x9c23('0x4d'),'input_type':_0x9c23('0x24'),'response_type':_0x9c23('0x24'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x3ca81b[_0x9c23('0x4e')],'password':_0x3ca81b[_0x9c23('0x4f')],'encryption':_0x9c23('0x50')},'application':_0x9c23('0x51')})}})['then'](function(_0x5863ca){var _0xd5451a=_0x5863ca;if(_0xd5451a['id']){def[_0x9c23('0x52')]=_0xd5451a['id'];return BPromise[_0x9c23('0x36')](_0xd5451a);}else{throw new Error(util[_0x9c23('0x26')](_0x9c23('0x53'),_0x3ca81b['id']));}});}function setRelationship(_0x1081ab,_0x91f0dd,_0x4c8df2,_0x42de79){return request({'form':{'method':_0x9c23('0x54'),'input_type':_0x9c23('0x24'),'response_type':_0x9c23('0x24'),'rest_data':JSON[_0x9c23('0x2a')]({'session':_0x1081ab['id'],'module_name':_0x9c23('0x25'),'module_id':_0x4c8df2['id'],'link_field_name':_0x42de79,'related_ids':[_0x91f0dd['id']]})}});}exports[_0x9c23('0x55')]=function(_0x3cb214,_0x537799,_0x160379,_0x5af119,_0x19e6c6,_0x29f2a8){var _0x4d2012,_0x167704,_0x2ef153,_0x2f14a9;_0x29f2a8[_0x9c23('0x56')]=intUtil[_0x9c23('0x57')](_0x29f2a8[_0x9c23('0x56')]);_0x29f2a8[_0x9c23('0x58')]=intUtil['stripTrailingSlash'](_0x29f2a8[_0x9c23('0x58')]);def[_0x9c23('0x59')]=util[_0x9c23('0x26')]('%s/service/v4_1/rest.php',_0x29f2a8[_0x9c23('0x56')]);if(_0x19e6c6&&_0x19e6c6[_0x9c23('0x5a')]){logger[_0x9c23('0xc')](_0x9c23('0x5b'),'Recording\x20is\x20enabled!');_0x537799['recordingURL']=util[_0x9c23('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x29f2a8[_0x9c23('0x58')],_0x537799[_0x9c23('0x5c')],md5(_0x537799[_0x9c23('0x5c')]));}else{_0x537799[_0x9c23('0x5d')]='';}return getConnection(_0x29f2a8)[_0x9c23('0x30')](function(_0xab1382){_0x2f14a9=_0xab1382;return getUser(_0x29f2a8,_0x5af119['name'],_0x2f14a9);})[_0x9c23('0x30')](function(_0x295bd2){_0x4d2012=_0x295bd2;logger[_0x9c23('0xc')]('The\x20User\x20ID\x20is:',_0x4d2012['id']);return getEndUser(_0x29f2a8,_0x537799['calleridname'],_0x537799[_0x9c23('0x5e')],_0x2f14a9);})[_0x9c23('0x30')](function(_0x2dcca6){_0x167704=_0x2dcca6;logger['info'](_0x9c23('0x5f'),_0x167704['id']);return getTicket(_0x29f2a8,_0x4d2012,_0x167704,_0x160379,_0x537799,_0x160379[_0x9c23('0x60')],_0x2f14a9,_0x9c23('0x61'));})[_0x9c23('0x30')](function(_0x6f4440){_0x2ef153=_0x6f4440;logger[_0x9c23('0xc')](_0x9c23('0x62'));logger[_0x9c23('0xc')](_0x9c23('0x63'),_0x2ef153['id']);return setRelationship(_0x2f14a9,_0x4d2012,_0x2ef153,'users');})[_0x9c23('0x30')](function(){return setRelationship(_0x2f14a9,_0x167704,_0x2ef153,_0x9c23('0x64'));})['then'](function(){return getServerInfo(_0x2f14a9);})[_0x9c23('0x30')](function(_0x5adc24){var _0x48e52c=parseInt(_0x5adc24[_0x9c23('0x65')]['charAt'](0x0));var _0xb9486a=util[_0x9c23('0x26')](_0x9c23('0x66'),_0x29f2a8[_0x9c23('0x56')],_0x2ef153['id']);if(_0x48e52c>0x6){_0xb9486a=util[_0x9c23('0x26')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x29f2a8[_0x9c23('0x56')],_0x2ef153['id']);}logger[_0x9c23('0xc')](_0x9c23('0x5b'),_0x9c23('0x67'));emit(util[_0x9c23('0x26')]('user:%s',_0x5af119[_0x9c23('0xe')]),'trigger:browser:url',{'uri':_0xb9486a});})[_0x9c23('0x68')](function(_0x3a7e88){logger['error'](_0x9c23('0x5b'),JSON[_0x9c23('0x2a')](_0x3a7e88));});};exports[_0x9c23('0x69')]=function(_0x4787f2,_0x564b23,_0x2bacfb,_0x1fd841,_0x1d4005,_0x4da48c,_0x4864d3){var _0x4208fd,_0x5f4aad,_0x28711f,_0x2bad21;_0x4da48c['remoteUri']=intUtil[_0x9c23('0x57')](_0x4da48c['remoteUri']);_0x4da48c[_0x9c23('0x58')]=intUtil[_0x9c23('0x57')](_0x4da48c[_0x9c23('0x58')]);def[_0x9c23('0x59')]=util[_0x9c23('0x26')](_0x9c23('0x6a'),_0x4da48c[_0x9c23('0x56')]);if(_0x4864d3&&_0x4864d3[_0x9c23('0x6b')]&&_0x4864d3['recordingFormat']!==_0x9c23('0x6c')){logger['info']('[OUTBOUND]','Recording\x20is\x20enabled!');_0x564b23[_0x9c23('0x5d')]=util[_0x9c23('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4da48c[_0x9c23('0x58')],_0x564b23['uniqueid'],md5(_0x564b23[_0x9c23('0x5c')]));}return getConnection(_0x4da48c)['then'](function(_0xbd6e5e){_0x2bad21=_0xbd6e5e;return getUser(_0x4da48c,_0x1fd841[_0x9c23('0xe')],_0x2bad21);})[_0x9c23('0x30')](function(_0x123f17){_0x4208fd=_0x123f17;logger[_0x9c23('0xc')](_0x9c23('0x6d'),_0x4208fd['id']);return getEndUser(_0x4da48c,_0x564b23[_0x9c23('0x6e')],_0x564b23[_0x9c23('0x6f')],_0x2bad21);})[_0x9c23('0x30')](function(_0x13ee5f){_0x5f4aad=_0x13ee5f;logger['info']('The\x20Enduser\x20ID\x20is:',_0x5f4aad['id']);return getTicket(_0x4da48c,_0x4208fd,_0x5f4aad,_0x2bacfb,_0x564b23,_0x2bacfb['Fields'],_0x2bad21,_0x9c23('0x70'));})[_0x9c23('0x30')](function(_0x451170){_0x28711f=_0x451170;logger['info']('Ticket\x20created!');logger[_0x9c23('0xc')]('The\x20Ticket\x20ID\x20is:',_0x28711f['id']);return setRelationship(_0x2bad21,_0x4208fd,_0x28711f,_0x9c23('0x71'));})[_0x9c23('0x30')](function(){return setRelationship(_0x2bad21,_0x5f4aad,_0x28711f,'contacts');})['then'](function(){return getServerInfo(_0x2bad21);})['then'](function(_0x5915a1){var _0x5b0b0c=parseInt(_0x5915a1[_0x9c23('0x65')][_0x9c23('0x72')](0x0));var _0x39dc78=util[_0x9c23('0x26')](_0x9c23('0x66'),_0x4da48c['remoteUri'],_0x28711f['id']);if(_0x5b0b0c>0x6){_0x39dc78=util['format'](_0x9c23('0x73'),_0x4da48c[_0x9c23('0x56')],_0x28711f['id']);}logger[_0x9c23('0xc')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x1fd841[_0x9c23('0xe')]),_0x9c23('0x74'),{'uri':_0x39dc78});})[_0x9c23('0x68')](function(_0x4201bf){logger['error'](_0x9c23('0x75'),JSON[_0x9c23('0x2a')](_0x4201bf));});};exports['abandoned']=function(_0xa948ef,_0x4335aa,_0x59c0cc,_0x2dd8d4,_0x29b756,_0x117d36){var _0x34beca,_0x3a843b,_0x223956,_0x587884;_0x117d36[_0x9c23('0x56')]=intUtil[_0x9c23('0x57')](_0x117d36[_0x9c23('0x56')]);_0x117d36['serverUrl']=intUtil['stripTrailingSlash'](_0x117d36['serverUrl']);def[_0x9c23('0x59')]=util['format'](_0x9c23('0x6a'),_0x117d36['remoteUri']);if(_0x29b756&&_0x29b756['monitor_format']){logger[_0x9c23('0xc')](_0x9c23('0x76'),_0x9c23('0x77'));_0x4335aa[_0x9c23('0x5d')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x117d36[_0x9c23('0x58')],_0x4335aa[_0x9c23('0x5c')],md5(_0x4335aa[_0x9c23('0x5c')]));}else{_0x4335aa[_0x9c23('0x5d')]='';}return getConnection(_0x117d36)[_0x9c23('0x30')](function(_0x1bb593){_0x587884=_0x1bb593;if(!_[_0x9c23('0x2b')](_0x2dd8d4)){return getUser(_0x117d36,_0x2dd8d4[_0x9c23('0xe')],_0x587884);}else{return getUser(_0x117d36,null,_0x587884);}})[_0x9c23('0x30')](function(_0x2662c2){_0x34beca=_0x2662c2;logger['info'](_0x9c23('0x6d'),_0x34beca['id']);return getEndUser(_0x117d36,_0x4335aa[_0x9c23('0x78')],_0x4335aa['calleridnum'],_0x587884);})[_0x9c23('0x30')](function(_0x24b0fe){_0x3a843b=_0x24b0fe;logger[_0x9c23('0xc')](_0x9c23('0x5f'),_0x3a843b['id']);return getTicket(_0x117d36,_0x34beca,_0x3a843b,_0x59c0cc,_0x4335aa,_0x59c0cc['Fields'],_0x587884,_0x9c23('0x61'));})[_0x9c23('0x30')](function(_0x5e6c5f){_0x223956=_0x5e6c5f;logger['info'](_0x9c23('0x62'));logger[_0x9c23('0xc')](_0x9c23('0x63'),_0x223956['id']);return setRelationship(_0x587884,_0x34beca,_0x223956,_0x9c23('0x71'));})[_0x9c23('0x30')](function(){return setRelationship(_0x587884,_0x3a843b,_0x223956,_0x9c23('0x64'));})[_0x9c23('0x30')](function(){return getServerInfo(_0x587884);})['catch'](function(_0x2c44c9){logger['error']('[ABANDONED]',JSON[_0x9c23('0x2a')](_0x2c44c9));});}; \ No newline at end of file +var _0x6fff=['abandoned','The\x20User\x20ID\x20is:','error','[ABANDONED]','lodash','request-promise','util','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','localhost','socket.io-emitter','POST','info','name','getString','Subjects','assigned_user_id','created_by','toISOString','slice','replace','duration_hours','parent_id','Contacts','direction','length','forEach','push','idField','set_entry','JSON','Calls','apiKey','toString','base64','get_server_info','stringify','isNil','Getting\x20agent\x20with\x20name','Employees','format','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','then','entry_list','find','name_value_list','user_name','value','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Searching\x20enduser\x20with\x20phone','get_entry_list','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Caller\x20-\x20%s','Enduser\x20created.','first_name','debug','[HTTP]','map','type','string','nameField','toLowerCase','customField','custom_fields','content','variable','variableName','customVariable','Variable','login','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','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','contacts','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','outbound','none','[OUTBOUND]','destcalleridname','Outbound','catch'];(function(_0x1a0daa,_0x2a4634){var _0x1dbe15=function(_0xa8ab22){while(--_0xa8ab22){_0x1a0daa['push'](_0x1a0daa['shift']());}};_0x1dbe15(++_0x2a4634);}(_0x6fff,0x160));var _0xf6ff=function(_0xa4ec5b,_0x119b8f){_0xa4ec5b=_0xa4ec5b-0x0;var _0x5b6150=_0x6fff[_0xa4ec5b];return _0x5b6150;};'use strict';var _=require(_0xf6ff('0x0'));var rp=require(_0xf6ff('0x1'));var BPromise=require('bluebird');var md5=require('md5');var util=require(_0xf6ff('0x2'));var Redis=require('ioredis');var intUtil=require(_0xf6ff('0x3'));var config=require(_0xf6ff('0x4'));var logger=require(_0xf6ff('0x5'))(_0xf6ff('0x6'));config[_0xf6ff('0x7')]=_[_0xf6ff('0x8')](config[_0xf6ff('0x7')],{'host':_0xf6ff('0x9'),'port':0x18eb});var io=require(_0xf6ff('0xa'))(new Redis(config[_0xf6ff('0x7')]));var def={'method':_0xf6ff('0xb'),'json':!![]};function emit(_0x77862b,_0x23c695,_0x4e22a8){io['to'](_0x77862b)['emit'](_0x23c695,_0x4e22a8);}function getTicket(_0x47f311,_0x37b6ba,_0x3c1d45,_0x23d6f1,_0x3efbba,_0x32110f,_0x39ee58,_0x3b0766){logger[_0xf6ff('0xc')]('Creating\x20new\x20ticket...');var _0x55723b=new Date();var _0xc02214=[{'name':_0xf6ff('0xd'),'value':intUtil[_0xf6ff('0xe')](_0x23d6f1[_0xf6ff('0xf')],_0x3efbba,'\x20')},{'name':_0xf6ff('0x10'),'value':_0x37b6ba['id']},{'name':_0xf6ff('0x11'),'value':_0x37b6ba['id']},{'name':'description','value':intUtil[_0xf6ff('0xe')](_0x23d6f1['Descriptions'],_0x3efbba,'\x0a')},{'name':'date_start','value':_0x55723b[_0xf6ff('0x12')]()[_0xf6ff('0x13')](0x0,0x13)[_0xf6ff('0x14')]('T','\x20')},{'name':_0xf6ff('0x15'),'value':'0'},{'name':'duration_minutes','value':'15'},{'name':_0xf6ff('0x16'),'value':_0x3c1d45['id']},{'name':'parent_type','value':_0xf6ff('0x17')},{'name':'parent_name','value':_0x3c1d45['name']},{'name':_0xf6ff('0x18'),'value':_0x3b0766}];if(_0x32110f[_0xf6ff('0x19')]){_[_0xf6ff('0x1a')](_0x32110f,function(_0x5c0566){if(_0x3efbba[_0x5c0566['variableName']]){_0xc02214[_0xf6ff('0x1b')]({'name':_0x5c0566[_0xf6ff('0x1c')],'value':_0x3efbba[_0x5c0566['variableName']]});}});}return request({'form':{'method':_0xf6ff('0x1d'),'input_type':_0xf6ff('0x1e'),'response_type':_0xf6ff('0x1e'),'rest_data':JSON['stringify']({'session':_0x39ee58['id'],'module_name':_0xf6ff('0x1f'),'name_value_list':_0xc02214})}});}function getAuth(_0x37c585){return util['format']('Basic\x20%s',new Buffer(_0x37c585[_0xf6ff('0x20')]+':X')[_0xf6ff('0x21')](_0xf6ff('0x22')));}function getServerInfo(_0x2469ca){return request({'form':{'method':_0xf6ff('0x23'),'input_type':_0xf6ff('0x1e'),'response_type':_0xf6ff('0x1e'),'rest_data':JSON[_0xf6ff('0x24')]({'session':_0x2469ca['id']})}});}function getUser(_0x4ac214,_0x56ec18,_0x5150fb){if(!_[_0xf6ff('0x25')](_0x56ec18)){logger[_0xf6ff('0xc')](_0xf6ff('0x26'),_0x56ec18);return request({'form':{'method':'get_entry_list','input_type':'JSON','response_type':_0xf6ff('0x1e'),'rest_data':JSON[_0xf6ff('0x24')]({'session':_0x5150fb['id'],'module_name':_0xf6ff('0x27'),'query':util[_0xf6ff('0x28')](_0xf6ff('0x29'),_0x56ec18),'order_by':'','offset':'0','select_fields':['id',_0xf6ff('0xd'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xf6ff('0x2a')](function(_0x1d87e7){if(_0x1d87e7[_0xf6ff('0x2b')]['length']){var _0x531dfc=_[_0xf6ff('0x2c')](_0x1d87e7[_0xf6ff('0x2b')],function(_0x22615a){return _0x22615a[_0xf6ff('0x2d')][_0xf6ff('0x2e')][_0xf6ff('0x2f')]===_0x56ec18;});if(_0x531dfc){logger['info']('Agent\x20found!');return BPromise[_0xf6ff('0x30')]({'id':_0x531dfc[_0xf6ff('0x2d')]['id'][_0xf6ff('0x2f')],'name':_0x531dfc[_0xf6ff('0x2d')][_0xf6ff('0xd')][_0xf6ff('0x2f')]});}}logger[_0xf6ff('0xc')](_0xf6ff('0x31'));return BPromise[_0xf6ff('0x30')]({'id':_0x5150fb['name_value_list'][_0xf6ff('0x32')][_0xf6ff('0x2f')],'name':_0x5150fb[_0xf6ff('0x2d')][_0xf6ff('0x2e')]['value']});});}else{logger[_0xf6ff('0xc')]('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise[_0xf6ff('0x30')]({'id':_0x5150fb[_0xf6ff('0x2d')][_0xf6ff('0x32')][_0xf6ff('0x2f')],'name':_0x5150fb[_0xf6ff('0x2d')]['user_name'][_0xf6ff('0x2f')]});}}function getEndUser(_0x54e139,_0x5be6a1,_0x175bee,_0x411daf){logger[_0xf6ff('0xc')](_0xf6ff('0x33'),_0x175bee);return request({'form':{'method':_0xf6ff('0x34'),'input_type':'JSON','response_type':_0xf6ff('0x1e'),'rest_data':JSON[_0xf6ff('0x24')]({'session':_0x411daf['id'],'module_name':_0xf6ff('0x17'),'query':util['format'](_0xf6ff('0x35'),_0x175bee),'order_by':'','offset':'0','select_fields':['id','name',_0xf6ff('0x36')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xf6ff('0x2a')](function(_0x461cfc){if(_0x461cfc['entry_list'][_0xf6ff('0x19')]){var _0x44ba74=_[_0xf6ff('0x2c')](_0x461cfc[_0xf6ff('0x2b')],function(_0x5f4215){return _0x5f4215[_0xf6ff('0x2d')]['phone_home'][_0xf6ff('0x2f')]===_0x175bee;});if(_0x44ba74){logger[_0xf6ff('0xc')](_0xf6ff('0x37'));return BPromise[_0xf6ff('0x30')]({'id':_0x44ba74[_0xf6ff('0x2d')]['id'][_0xf6ff('0x2f')],'name':_0x44ba74['name_value_list']['name'][_0xf6ff('0x2f')],'phone':_0x44ba74[_0xf6ff('0x2d')][_0xf6ff('0x36')][_0xf6ff('0x2f')]});}}else{logger[_0xf6ff('0xc')](_0xf6ff('0x38'));return request({'form':{'method':_0xf6ff('0x1d'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0xf6ff('0x24')]({'session':_0x411daf['id'],'module_name':_0xf6ff('0x17'),'name_value_list':[{'name':'first_name','value':_0x5be6a1!==''?_0x5be6a1:util['format'](_0xf6ff('0x39'),_0x175bee)},{'name':_0xf6ff('0x36'),'value':_0x175bee}]})}})[_0xf6ff('0x2a')](function(_0x3e1008){logger[_0xf6ff('0xc')](_0xf6ff('0x3a'));return BPromise[_0xf6ff('0x30')]({'id':_0x3e1008['id'],'name':_0x3e1008[_0xf6ff('0x2b')][_0xf6ff('0x3b')][_0xf6ff('0x2f')],'phone':_0x3e1008[_0xf6ff('0x2b')][_0xf6ff('0x36')][_0xf6ff('0x2f')]});});}});}function request(_0x3b2ee3){logger[_0xf6ff('0x3c')](_0xf6ff('0x3d'),JSON['stringify'](_0x3b2ee3));return rp(_['merge'](def,_0x3b2ee3));}function getTags(_0x550034,_0x1a441d){var _0x1d6a91=[];if(_0x550034&&_0x550034[_0xf6ff('0x19')]>0x0){_0x1d6a91=_[_0xf6ff('0x3e')](_0x550034,_0x1a441d);}return _0x1d6a91;}function getCustomFields(_0x2d98fc,_0x571c83){var _0x30491c=[];var _0x333362={'custom_fields':[]};if(_0x2d98fc[_0xf6ff('0x19')]>0x0){_[_0xf6ff('0x1a')](_0x2d98fc,function(_0x3d3e7c){if(_0x3d3e7c[_0xf6ff('0x3f')]===_0xf6ff('0x40')&&_0x3d3e7c[_0xf6ff('0x41')]&&!_0x3d3e7c['customField']){_0x333362[_0x3d3e7c[_0xf6ff('0x41')][_0xf6ff('0x42')]()]=_0x3d3e7c['content']['toString']();}else if(_0x3d3e7c[_0xf6ff('0x3f')]===_0xf6ff('0x40')&&_0x3d3e7c[_0xf6ff('0x1c')]&&_0x3d3e7c[_0xf6ff('0x43')]){_0x333362[_0xf6ff('0x44')][_0xf6ff('0x1b')]({'id':_0x3d3e7c[_0xf6ff('0x1c')],'value':_0x3d3e7c[_0xf6ff('0x45')]['toString']()});}else if(_0x3d3e7c[_0xf6ff('0x3f')]===_0xf6ff('0x46')&&_0x3d3e7c[_0xf6ff('0x47')]&&_0x3d3e7c['idField']&&_0x3d3e7c[_0xf6ff('0x43')]){_0x571c83[_0x3d3e7c['variableName']]&&_0x333362[_0xf6ff('0x44')][_0xf6ff('0x1b')]({'id':_0x3d3e7c['idField'],'value':_0x571c83[_0x3d3e7c[_0xf6ff('0x47')]][_0xf6ff('0x21')]()});}else if(_0x3d3e7c['type']===_0xf6ff('0x48')&&_0x3d3e7c[_0xf6ff('0x49')]&&_0x3d3e7c[_0xf6ff('0x49')][_0xf6ff('0xd')]&&_0x3d3e7c[_0xf6ff('0x1c')]&&_0x3d3e7c[_0xf6ff('0x43')]){_0x571c83[_0x3d3e7c[_0xf6ff('0x49')][_0xf6ff('0xd')][_0xf6ff('0x42')]()]&&_0x333362[_0xf6ff('0x44')][_0xf6ff('0x1b')]({'id':_0x3d3e7c[_0xf6ff('0x1c')],'value':_0x571c83[_0x3d3e7c['Variable'][_0xf6ff('0xd')][_0xf6ff('0x42')]()][_0xf6ff('0x21')]()});}});}return _0x333362;}function getConnection(_0x16d53e){return request({'method':_0xf6ff('0xb'),'form':{'method':_0xf6ff('0x4a'),'input_type':_0xf6ff('0x1e'),'response_type':'JSON','rest_data':JSON[_0xf6ff('0x24')]({'user_auth':{'user_name':_0x16d53e[_0xf6ff('0x4b')],'password':_0x16d53e[_0xf6ff('0x4c')],'encryption':'PLAIN'},'application':_0xf6ff('0x4d')})}})['then'](function(_0x36834c){var _0x47cb72=_0x36834c;if(_0x47cb72['id']){def[_0xf6ff('0x4e')]=_0x47cb72['id'];return BPromise[_0xf6ff('0x30')](_0x47cb72);}else{throw new Error(util[_0xf6ff('0x28')](_0xf6ff('0x4f'),_0x16d53e['id']));}});}function setRelationship(_0x2a3939,_0x5ed3c5,_0x3107c9,_0x21ec29){return request({'form':{'method':_0xf6ff('0x50'),'input_type':_0xf6ff('0x1e'),'response_type':_0xf6ff('0x1e'),'rest_data':JSON[_0xf6ff('0x24')]({'session':_0x2a3939['id'],'module_name':_0xf6ff('0x1f'),'module_id':_0x3107c9['id'],'link_field_name':_0x21ec29,'related_ids':[_0x5ed3c5['id']]})}});}exports[_0xf6ff('0x51')]=function(_0x314804,_0x174965,_0x332ad0,_0x14a60f,_0x432ff5,_0x39a72e){var _0x32a1dd,_0x39c4ce,_0x34ea74,_0x14ea2a;_0x39a72e[_0xf6ff('0x52')]=intUtil[_0xf6ff('0x53')](_0x39a72e[_0xf6ff('0x52')]);_0x39a72e[_0xf6ff('0x54')]=intUtil[_0xf6ff('0x53')](_0x39a72e[_0xf6ff('0x54')]);def[_0xf6ff('0x55')]=util[_0xf6ff('0x28')](_0xf6ff('0x56'),_0x39a72e[_0xf6ff('0x52')]);if(_0x432ff5&&_0x432ff5[_0xf6ff('0x57')]){logger[_0xf6ff('0xc')](_0xf6ff('0x58'),_0xf6ff('0x59'));_0x174965[_0xf6ff('0x5a')]=util['format'](_0xf6ff('0x5b'),_0x39a72e['serverUrl'],_0x174965[_0xf6ff('0x5c')],md5(_0x174965['uniqueid']));}else{_0x174965['recordingURL']='';}return getConnection(_0x39a72e)[_0xf6ff('0x2a')](function(_0x4ee515){_0x14ea2a=_0x4ee515;return getUser(_0x39a72e,_0x14a60f[_0xf6ff('0xd')],_0x14ea2a);})[_0xf6ff('0x2a')](function(_0x28c68f){_0x32a1dd=_0x28c68f;logger[_0xf6ff('0xc')]('The\x20User\x20ID\x20is:',_0x32a1dd['id']);return getEndUser(_0x39a72e,_0x174965[_0xf6ff('0x5d')],_0x174965[_0xf6ff('0x5e')],_0x14ea2a);})[_0xf6ff('0x2a')](function(_0x3f579d){_0x39c4ce=_0x3f579d;logger[_0xf6ff('0xc')](_0xf6ff('0x5f'),_0x39c4ce['id']);return getTicket(_0x39a72e,_0x32a1dd,_0x39c4ce,_0x332ad0,_0x174965,_0x332ad0[_0xf6ff('0x60')],_0x14ea2a,_0xf6ff('0x61'));})[_0xf6ff('0x2a')](function(_0xd4a298){_0x34ea74=_0xd4a298;logger['info'](_0xf6ff('0x62'));logger[_0xf6ff('0xc')](_0xf6ff('0x63'),_0x34ea74['id']);return setRelationship(_0x14ea2a,_0x32a1dd,_0x34ea74,'users');})[_0xf6ff('0x2a')](function(){return setRelationship(_0x14ea2a,_0x39c4ce,_0x34ea74,_0xf6ff('0x64'));})[_0xf6ff('0x2a')](function(){return getServerInfo(_0x14ea2a);})[_0xf6ff('0x2a')](function(_0x2d7b76){var _0x1b1775=parseInt(_0x2d7b76['version'][_0xf6ff('0x65')](0x0));var _0x443072=util[_0xf6ff('0x28')](_0xf6ff('0x66'),_0x39a72e['remoteUri'],_0x34ea74['id']);if(_0x1b1775>0x6){_0x443072=util[_0xf6ff('0x28')](_0xf6ff('0x67'),_0x39a72e[_0xf6ff('0x52')],_0x34ea74['id']);}logger[_0xf6ff('0xc')](_0xf6ff('0x58'),_0xf6ff('0x68'));emit(util[_0xf6ff('0x28')](_0xf6ff('0x69'),_0x14a60f[_0xf6ff('0xd')]),'trigger:browser:url',{'uri':_0x443072});})['catch'](function(_0x18bd01){logger['error']('[QUEUE]',JSON['stringify'](_0x18bd01));});};exports[_0xf6ff('0x6a')]=function(_0x253caf,_0x2a6acb,_0x981a76,_0x489e5a,_0x104bd0,_0x383adb,_0x37c233){var _0x2f42a0,_0x1db094,_0x3e48ad,_0x36ed9e;_0x383adb['remoteUri']=intUtil['stripTrailingSlash'](_0x383adb['remoteUri']);_0x383adb[_0xf6ff('0x54')]=intUtil[_0xf6ff('0x53')](_0x383adb[_0xf6ff('0x54')]);def['uri']=util[_0xf6ff('0x28')](_0xf6ff('0x56'),_0x383adb[_0xf6ff('0x52')]);if(_0x37c233&&_0x37c233['recordingFormat']&&_0x37c233['recordingFormat']!==_0xf6ff('0x6b')){logger[_0xf6ff('0xc')](_0xf6ff('0x6c'),'Recording\x20is\x20enabled!');_0x2a6acb[_0xf6ff('0x5a')]=util[_0xf6ff('0x28')](_0xf6ff('0x5b'),_0x383adb['serverUrl'],_0x2a6acb[_0xf6ff('0x5c')],md5(_0x2a6acb[_0xf6ff('0x5c')]));}return getConnection(_0x383adb)['then'](function(_0xcea791){_0x36ed9e=_0xcea791;return getUser(_0x383adb,_0x489e5a[_0xf6ff('0xd')],_0x36ed9e);})[_0xf6ff('0x2a')](function(_0x40b48c){_0x2f42a0=_0x40b48c;logger[_0xf6ff('0xc')]('The\x20User\x20ID\x20is:',_0x2f42a0['id']);return getEndUser(_0x383adb,_0x2a6acb[_0xf6ff('0x6d')],_0x2a6acb['destcalleridnum'],_0x36ed9e);})[_0xf6ff('0x2a')](function(_0x25a303){_0x1db094=_0x25a303;logger[_0xf6ff('0xc')]('The\x20Enduser\x20ID\x20is:',_0x1db094['id']);return getTicket(_0x383adb,_0x2f42a0,_0x1db094,_0x981a76,_0x2a6acb,_0x981a76['Fields'],_0x36ed9e,_0xf6ff('0x6e'));})[_0xf6ff('0x2a')](function(_0xf7aeed){_0x3e48ad=_0xf7aeed;logger[_0xf6ff('0xc')](_0xf6ff('0x62'));logger[_0xf6ff('0xc')](_0xf6ff('0x63'),_0x3e48ad['id']);return setRelationship(_0x36ed9e,_0x2f42a0,_0x3e48ad,'users');})[_0xf6ff('0x2a')](function(){return setRelationship(_0x36ed9e,_0x1db094,_0x3e48ad,_0xf6ff('0x64'));})[_0xf6ff('0x2a')](function(){return getServerInfo(_0x36ed9e);})[_0xf6ff('0x2a')](function(_0x2aaccd){var _0x4b1203=parseInt(_0x2aaccd['version']['charAt'](0x0));var _0x5130f4=util[_0xf6ff('0x28')](_0xf6ff('0x66'),_0x383adb['remoteUri'],_0x3e48ad['id']);if(_0x4b1203>0x6){_0x5130f4=util[_0xf6ff('0x28')](_0xf6ff('0x67'),_0x383adb[_0xf6ff('0x52')],_0x3e48ad['id']);}logger[_0xf6ff('0xc')]('[OUTBOUND]',_0xf6ff('0x68'));emit(util[_0xf6ff('0x28')](_0xf6ff('0x69'),_0x489e5a['name']),'trigger:browser:url',{'uri':_0x5130f4});})[_0xf6ff('0x6f')](function(_0x50eb31){logger['error'](_0xf6ff('0x6c'),JSON[_0xf6ff('0x24')](_0x50eb31));});};exports[_0xf6ff('0x70')]=function(_0x140524,_0x4adb65,_0x13cece,_0x3e0c5e,_0x1b06d1,_0x482487){var _0xe54633,_0x433f6c,_0x28824f,_0xc32c91;_0x482487[_0xf6ff('0x52')]=intUtil['stripTrailingSlash'](_0x482487[_0xf6ff('0x52')]);_0x482487[_0xf6ff('0x54')]=intUtil['stripTrailingSlash'](_0x482487[_0xf6ff('0x54')]);def[_0xf6ff('0x55')]=util[_0xf6ff('0x28')](_0xf6ff('0x56'),_0x482487['remoteUri']);if(_0x1b06d1&&_0x1b06d1[_0xf6ff('0x57')]){logger[_0xf6ff('0xc')]('[ABANDONED]','Recording\x20is\x20enabled!');_0x4adb65['recordingURL']=util[_0xf6ff('0x28')](_0xf6ff('0x5b'),_0x482487[_0xf6ff('0x54')],_0x4adb65['uniqueid'],md5(_0x4adb65['uniqueid']));}else{_0x4adb65[_0xf6ff('0x5a')]='';}return getConnection(_0x482487)[_0xf6ff('0x2a')](function(_0x14f1dd){_0xc32c91=_0x14f1dd;if(!_[_0xf6ff('0x25')](_0x3e0c5e)){return getUser(_0x482487,_0x3e0c5e[_0xf6ff('0xd')],_0xc32c91);}else{return getUser(_0x482487,null,_0xc32c91);}})['then'](function(_0x49172c){_0xe54633=_0x49172c;logger[_0xf6ff('0xc')](_0xf6ff('0x71'),_0xe54633['id']);return getEndUser(_0x482487,_0x4adb65['calleridname'],_0x4adb65[_0xf6ff('0x5e')],_0xc32c91);})['then'](function(_0x58e620){_0x433f6c=_0x58e620;logger[_0xf6ff('0xc')](_0xf6ff('0x5f'),_0x433f6c['id']);return getTicket(_0x482487,_0xe54633,_0x433f6c,_0x13cece,_0x4adb65,_0x13cece[_0xf6ff('0x60')],_0xc32c91,'Inbound');})[_0xf6ff('0x2a')](function(_0x472dcf){_0x28824f=_0x472dcf;logger['info'](_0xf6ff('0x62'));logger[_0xf6ff('0xc')](_0xf6ff('0x63'),_0x28824f['id']);return setRelationship(_0xc32c91,_0xe54633,_0x28824f,'users');})['then'](function(){return setRelationship(_0xc32c91,_0x433f6c,_0x28824f,'contacts');})[_0xf6ff('0x2a')](function(){return getServerInfo(_0xc32c91);})[_0xf6ff('0x6f')](function(_0x24fe4f){logger[_0xf6ff('0x72')](_0xf6ff('0x73'),JSON['stringify'](_0x24fe4f));});}; \ 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 3fb68d8..b4eb152 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 _0x367a=['key','format','keyContent','join','stripTrailingSlash','slice','substring','lastIndexOf','validateEmail','isNil','lodash','util','getString','length','sortBy','type','string','push','content','variable','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','keyType'];(function(_0x467ca8,_0x562379){var _0x268035=function(_0x30ef7a){while(--_0x30ef7a){_0x467ca8['push'](_0x467ca8['shift']());}};_0x268035(++_0x562379);}(_0x367a,0xea));var _0xa367=function(_0x3308a0,_0x5a71c4){_0x3308a0=_0x3308a0-0x0;var _0x3adbf3=_0x367a[_0x3308a0];return _0x3adbf3;};'use strict';var _=require(_0xa367('0x0'));var util=require(_0xa367('0x1'));exports[_0xa367('0x2')]=function(_0x3fc45e,_0x11cac8,_0x147615){var _0x512824=[];if(_0x3fc45e[_0xa367('0x3')]>0x0){var _0x2ac0b1=_[_0xa367('0x4')](_0x3fc45e,['id']);for(var _0x1faf4d=0x0;_0x1faf4d<_0x2ac0b1[_0xa367('0x3')];_0x1faf4d++){var _0x555f58=_0x2ac0b1[_0x1faf4d];if(_0x555f58[_0xa367('0x5')]===_0xa367('0x6')){_0x512824[_0xa367('0x7')](_0x555f58[_0xa367('0x8')]);}else if(_0x555f58['type']===_0xa367('0x9')&&_0x555f58['variableName']){_0x11cac8[_0x555f58[_0xa367('0xa')]]&&_0x512824[_0xa367('0x7')](_0x11cac8[_0x555f58[_0xa367('0xa')]][_0xa367('0xb')]());}else if(_0x555f58[_0xa367('0x5')]===_0xa367('0xc')&&_0x555f58[_0xa367('0xd')]&&_0x555f58['Variable'][_0xa367('0xe')]){_0x11cac8[_0x555f58[_0xa367('0xd')]['name'][_0xa367('0xf')]()]&&_0x512824[_0xa367('0x7')](_0x11cac8[_0x555f58['Variable'][_0xa367('0xe')]['toLowerCase']()][_0xa367('0xb')]());}else if(_0x555f58['type']===_0xa367('0x10')){if(_0x555f58[_0xa367('0x11')]===_0xa367('0x6')&&_0x555f58[_0xa367('0x12')]){_0x512824[_0xa367('0x7')](util[_0xa367('0x13')]('%s:\x20%s',_0x555f58[_0xa367('0x12')],_0x555f58[_0xa367('0x14')]));}else if(_0x555f58[_0xa367('0x11')]===_0xa367('0x9')&&_0x555f58[_0xa367('0xa')]&&_0x555f58[_0xa367('0x12')]){_0x11cac8[_0x555f58[_0xa367('0xa')]]&&_0x512824[_0xa367('0x7')](util[_0xa367('0x13')]('%s:\x20%s',_0x555f58['key'],_0x11cac8[_0x555f58['variableName']]));}else if(_0x555f58[_0xa367('0x11')]==='customVariable'&&_0x555f58[_0xa367('0xd')]&&_0x555f58[_0xa367('0xd')]['name']&&_0x555f58[_0xa367('0x12')]){_0x11cac8[_0x555f58[_0xa367('0xd')][_0xa367('0xe')][_0xa367('0xf')]()]&&_0x512824['push'](util['format']('%s:\x20%s',_0x555f58[_0xa367('0x12')],_0x11cac8[_0x555f58['Variable'][_0xa367('0xe')][_0xa367('0xf')]()]));}}}}return _0x512824[_0xa367('0x15')](_0x147615);};exports[_0xa367('0x16')]=function(_0x1e5ace){var _0x3f292f=_0x1e5ace[_0xa367('0x17')](-0x1);if(_0x3f292f==='/'){_0x1e5ace=_0x1e5ace[_0xa367('0x18')](0x0,_0x1e5ace[_0xa367('0x19')](_0x3f292f));}return _0x1e5ace;};exports[_0xa367('0x1a')]=function(_0x31e495){if(!_[_0xa367('0x1b')](_0x31e495)&&_0x31e495!==''){var _0x2c0bcb=/^(([^<>()\[\]\\.,;:\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 _0x2c0bcb['test'](String(_0x31e495)[_0xa367('0xf')]());}else{return![];}}; \ No newline at end of file +var _0x966f=['getString','length','sortBy','push','content','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','keyType','string','key','%s:\x20%s','keyContent','format','join','stripTrailingSlash','slice','substring','lastIndexOf','isNil','test','lodash','util'];(function(_0x4f1e23,_0x166b91){var _0x4354b1=function(_0x1a3b71){while(--_0x1a3b71){_0x4f1e23['push'](_0x4f1e23['shift']());}};_0x4354b1(++_0x166b91);}(_0x966f,0x1eb));var _0xf966=function(_0xcc96a6,_0x481705){_0xcc96a6=_0xcc96a6-0x0;var _0x574eff=_0x966f[_0xcc96a6];return _0x574eff;};'use strict';var _=require(_0xf966('0x0'));var util=require(_0xf966('0x1'));exports[_0xf966('0x2')]=function(_0x5920fe,_0x22812a,_0x380095){var _0x3beb40=[];if(_0x5920fe[_0xf966('0x3')]>0x0){var _0x5c592c=_[_0xf966('0x4')](_0x5920fe,['id']);for(var _0x49d23d=0x0;_0x49d23d<_0x5c592c[_0xf966('0x3')];_0x49d23d++){var _0x447b97=_0x5c592c[_0x49d23d];if(_0x447b97['type']==='string'){_0x3beb40[_0xf966('0x5')](_0x447b97[_0xf966('0x6')]);}else if(_0x447b97[_0xf966('0x7')]===_0xf966('0x8')&&_0x447b97['variableName']){_0x22812a[_0x447b97[_0xf966('0x9')]]&&_0x3beb40[_0xf966('0x5')](_0x22812a[_0x447b97['variableName']][_0xf966('0xa')]());}else if(_0x447b97[_0xf966('0x7')]===_0xf966('0xb')&&_0x447b97[_0xf966('0xc')]&&_0x447b97[_0xf966('0xc')][_0xf966('0xd')]){_0x22812a[_0x447b97[_0xf966('0xc')]['name'][_0xf966('0xe')]()]&&_0x3beb40[_0xf966('0x5')](_0x22812a[_0x447b97[_0xf966('0xc')][_0xf966('0xd')][_0xf966('0xe')]()]['toString']());}else if(_0x447b97[_0xf966('0x7')]===_0xf966('0xf')){if(_0x447b97[_0xf966('0x10')]===_0xf966('0x11')&&_0x447b97[_0xf966('0x12')]){_0x3beb40['push'](util['format'](_0xf966('0x13'),_0x447b97['key'],_0x447b97[_0xf966('0x14')]));}else if(_0x447b97[_0xf966('0x10')]===_0xf966('0x8')&&_0x447b97[_0xf966('0x9')]&&_0x447b97['key']){_0x22812a[_0x447b97['variableName']]&&_0x3beb40['push'](util[_0xf966('0x15')](_0xf966('0x13'),_0x447b97['key'],_0x22812a[_0x447b97[_0xf966('0x9')]]));}else if(_0x447b97['keyType']===_0xf966('0xb')&&_0x447b97[_0xf966('0xc')]&&_0x447b97[_0xf966('0xc')][_0xf966('0xd')]&&_0x447b97[_0xf966('0x12')]){_0x22812a[_0x447b97['Variable'][_0xf966('0xd')][_0xf966('0xe')]()]&&_0x3beb40[_0xf966('0x5')](util['format'](_0xf966('0x13'),_0x447b97[_0xf966('0x12')],_0x22812a[_0x447b97[_0xf966('0xc')][_0xf966('0xd')][_0xf966('0xe')]()]));}}}}return _0x3beb40[_0xf966('0x16')](_0x380095);};exports[_0xf966('0x17')]=function(_0x1fe7e7){var _0x362d01=_0x1fe7e7[_0xf966('0x18')](-0x1);if(_0x362d01==='/'){_0x1fe7e7=_0x1fe7e7[_0xf966('0x19')](0x0,_0x1fe7e7[_0xf966('0x1a')](_0x362d01));}return _0x1fe7e7;};exports['validateEmail']=function(_0x3d8314){if(!_[_0xf966('0x1b')](_0x3d8314)&&_0x3d8314!==''){var _0x417b75=/^(([^<>()\[\]\\.,;:\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 _0x417b75[_0xf966('0x1c')](String(_0x3d8314)[_0xf966('0xe')]());}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 e9d3841..affe2e6 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 _0x55ca=['email','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','abandoned','[ABANDONED]','lodash','request-promise','ioredis','./util','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','emit','length','forEach','type','string','idField','content','toString','customVariable','Variable','name','toLowerCase','info','merge','Normal','Open','Subjects','getString','POST','format','%s/webservice.php','remoteUri','username','then','success','resolve','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','stringify','error','catch','statusCode','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','sessionName','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','Agent\x20found!','email1','last_name','userId','admin','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','getUser','Searching\x20end\x20user\x20with\x20phone','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','lastname','phone','getEndUser','accessKey','getConnection','queue','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','[QUEUE]','outbound','serverUrl','recordingFormat','none','[OUTBOUND]'];(function(_0x46188f,_0x35b81c){var _0x5bad99=function(_0x10b643){while(--_0x10b643){_0x46188f['push'](_0x46188f['shift']());}};_0x5bad99(++_0x35b81c);}(_0x55ca,0x126));var _0xa55c=function(_0x5f34a3,_0x4ba871){_0x5f34a3=_0x5f34a3-0x0;var _0xeabd05=_0x55ca[_0x5f34a3];return _0xeabd05;};'use strict';var _=require(_0xa55c('0x0'));var rp=require(_0xa55c('0x1'));var BPromise=require('bluebird');var md5=require('md5');var util=require('util');var Redis=require(_0xa55c('0x2'));var intUtil=require(_0xa55c('0x3'));var config=require('../../../../config/environment');var logger=require(_0xa55c('0x4'))(_0xa55c('0x5'));config[_0xa55c('0x6')]=_[_0xa55c('0x7')](config[_0xa55c('0x6')],{'host':_0xa55c('0x8'),'port':0x18eb});var io=require(_0xa55c('0x9'))(new Redis(config['redis']));function emit(_0x2121fd,_0x2537f0,_0x57e069){io['to'](_0x2121fd)[_0xa55c('0xa')](_0x2537f0,_0x57e069);}function getCustomFields(_0x290d28,_0x52a3bc){var _0x5849ad={};if(_0x290d28[_0xa55c('0xb')]>0x0){_[_0xa55c('0xc')](_0x290d28,function(_0x381d07){if(_0x381d07[_0xa55c('0xd')]===_0xa55c('0xe')&&_0x381d07[_0xa55c('0xf')]){_0x5849ad[_0x381d07[_0xa55c('0xf')]]=_0x381d07[_0xa55c('0x10')][_0xa55c('0x11')]();}else if(_0x381d07[_0xa55c('0xd')]==='variable'&&_0x381d07['variableName']&&_0x381d07[_0xa55c('0xf')]&&_0x52a3bc[_0x381d07['variableName']]){_0x5849ad[_0x381d07['idField']]=_0x52a3bc[_0x381d07['variableName']][_0xa55c('0x11')]();}else if(_0x381d07[_0xa55c('0xd')]===_0xa55c('0x12')&&_0x381d07[_0xa55c('0x13')]&&_0x381d07[_0xa55c('0x13')][_0xa55c('0x14')]&&_0x381d07['idField']&&_0x52a3bc[_0x381d07[_0xa55c('0x13')][_0xa55c('0x14')][_0xa55c('0x15')]()]){_0x5849ad[_0x381d07[_0xa55c('0xf')]]=_0x52a3bc[_0x381d07[_0xa55c('0x13')][_0xa55c('0x14')][_0xa55c('0x15')]()][_0xa55c('0x11')]();}});}return _0x5849ad;}function createTicket(_0x24783b,_0x4cee3c,_0x3d4c9e,_0x104a99,_0x461284,_0x358b61,_0x23a1ae){logger[_0xa55c('0x16')]('Creating\x20new\x20ticket...');var _0x5f5158=_[_0xa55c('0x17')]({'parent_id':'','assigned_user_id':_0x4cee3c['id'],'ticketpriorities':_0xa55c('0x18'),'ticketstatus':_0xa55c('0x19'),'ticket_title':intUtil['getString'](_0x104a99[_0xa55c('0x1a')],_0x461284,'\x20'),'description':intUtil[_0xa55c('0x1b')](_0x104a99['Descriptions'],_0x461284,'\x0a'),'contact_id':_0x3d4c9e['id']},getCustomFields(_0x358b61,_0x461284));var _0x187a87={'method':_0xa55c('0x1c'),'uri':util[_0xa55c('0x1d')](_0xa55c('0x1e'),_0x24783b[_0xa55c('0x1f')]),'form':{'operation':'create','username':_0x24783b[_0xa55c('0x20')],'sessionName':_0x23a1ae['sessionName'],'elementType':'HelpDesk','element':JSON['stringify'](_0x5f5158)},'json':!![]};return request(_0x187a87)[_0xa55c('0x21')](function(_0x54b038){if(_0x54b038[_0xa55c('0x22')]){return BPromise[_0xa55c('0x23')]({'id':_0x54b038[_0xa55c('0x24')]['id']});}else{throw new Error(util[_0xa55c('0x1d')](_0xa55c('0x25'),JSON[_0xa55c('0x26')](_0x54b038[_0xa55c('0x27')])));}})[_0xa55c('0x28')](function(_0x192df2){var _0x3cd152=_0x192df2[_0xa55c('0x29')]||0x1f4;logger['error'](_0xa55c('0x2a'),_0xa55c('0x2b'),_0x3cd152,JSON[_0xa55c('0x26')](_0x192df2));});}function getUser(_0x906caa,_0x5d940d,_0x1377b0){if(intUtil[_0xa55c('0x2c')](_0x5d940d)){logger[_0xa55c('0x16')](_0xa55c('0x2d'),_0x5d940d);return request({'method':_0xa55c('0x2e'),'uri':util[_0xa55c('0x1d')]('%s/webservice.php',_0x906caa[_0xa55c('0x1f')]),'qs':{'operation':'query','username':_0x906caa[_0xa55c('0x20')],'sessionName':_0x1377b0[_0xa55c('0x2f')],'query':util[_0xa55c('0x1d')](_0xa55c('0x30'),_0x5d940d)},'json':!![]})['then'](function(_0x3d28fb){if(_0x3d28fb[_0xa55c('0x22')]&&_0x3d28fb[_0xa55c('0x24')][_0xa55c('0xb')]){logger[_0xa55c('0x16')](_0xa55c('0x31'));return BPromise[_0xa55c('0x23')]({'id':_0x3d28fb[_0xa55c('0x24')][0x0]['id'],'email':_0x3d28fb[_0xa55c('0x24')][0x0][_0xa55c('0x32')],'name':_0x3d28fb[_0xa55c('0x24')][0x0]['first_name']+'\x20'+_0x3d28fb['result'][_0xa55c('0x33')]});}else{logger[_0xa55c('0x16')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0xa55c('0x23')]({'id':_0x1377b0[_0xa55c('0x34')],'email':_0x906caa[_0xa55c('0x20')],'name':_0xa55c('0x35')});}})[_0xa55c('0x28')](function(_0x38ff96){var _0x3ce1b3=_0x38ff96[_0xa55c('0x29')]||0x1f4;logger[_0xa55c('0x27')]('[vTiger],\x20%s,\x20%s,\x20%s','getUser',_0x3ce1b3,JSON['stringify'](_0x38ff96));});}else{logger[_0xa55c('0x16')](_0xa55c('0x36'));return BPromise[_0xa55c('0x23')]({'id':_0x1377b0['userId'],'email':_0x906caa[_0xa55c('0x20')],'name':'admin'})[_0xa55c('0x28')](function(_0x4ad813){var _0x18c6f1=_0x4ad813[_0xa55c('0x29')]||0x1f4;logger[_0xa55c('0x27')]('[vTiger],\x20%s,\x20%s,\x20%s',_0xa55c('0x37'),_0x18c6f1,JSON[_0xa55c('0x26')](_0x4ad813));});}}function getEndUser(_0x47e93c,_0x6f9c4c,_0x194e78,_0x4d9083){logger['info'](_0xa55c('0x38'),_0x194e78);return request({'method':'GET','uri':util[_0xa55c('0x1d')](_0xa55c('0x1e'),_0x47e93c['remoteUri']),'qs':{'operation':'query','username':_0x47e93c['username'],'sessionName':_0x4d9083['sessionName'],'query':util[_0xa55c('0x1d')](_0xa55c('0x39'),_0x194e78,_0x194e78,_0x194e78,_0x194e78,_0x194e78)},'json':!![]})[_0xa55c('0x21')](function(_0x99c4f8){if(_0x99c4f8[_0xa55c('0x22')]&&_0x99c4f8['result'][_0xa55c('0xb')]){logger[_0xa55c('0x16')](_0xa55c('0x3a'));return BPromise[_0xa55c('0x23')]({'id':_0x99c4f8[_0xa55c('0x24')][0x0]['id'],'name':_0x99c4f8[_0xa55c('0x24')][0x0]['firstname']+'\x20'+_0x99c4f8[_0xa55c('0x24')][0x0]['lastname'],'phone':_0x194e78});}else{logger['info'](_0xa55c('0x3b'));return request({'method':_0xa55c('0x1c'),'uri':util['format'](_0xa55c('0x1e'),_0x47e93c['remoteUri']),'form':{'operation':'create','sessionName':_0x4d9083[_0xa55c('0x2f')],'elementType':_0xa55c('0x3c'),'element':JSON[_0xa55c('0x26')]({'lastname':_0x6f9c4c,'phone':_0x194e78,'assigned_user_id':'\x20'})},'json':!![]})['then'](function(_0x1b2708){logger[_0xa55c('0x16')]('Enduser\x20created.');return BPromise[_0xa55c('0x23')]({'id':_0x1b2708['result']['id'],'name':_0x1b2708[_0xa55c('0x24')][_0xa55c('0x3d')],'phone':_0x1b2708['result'][_0xa55c('0x3e')]});})[_0xa55c('0x28')](function(_0x5d834d){var _0x40c352=_0x5d834d[_0xa55c('0x29')]||0x1f4;logger[_0xa55c('0x27')]('[vTiger],\x20%s,\x20%s,\x20%s',_0xa55c('0x3f'),_0x40c352,JSON['stringify'](_0x5d834d));});}});}function getConnection(_0x2f9717){var _0x3a8af4=_0x2f9717[_0xa55c('0x20')];var _0x51d663=_0x2f9717[_0xa55c('0x40')];return request({'method':_0xa55c('0x2e'),'uri':util['format'](_0xa55c('0x1e'),_0x2f9717[_0xa55c('0x1f')]),'qs':{'operation':'getchallenge','username':_0x3a8af4},'json':!![]})[_0xa55c('0x21')](function(_0xd3fe78){if(_0xd3fe78['success']){return request({'method':_0xa55c('0x1c'),'uri':util[_0xa55c('0x1d')](_0xa55c('0x1e'),_0x2f9717[_0xa55c('0x1f')]),'form':{'operation':'login','username':_0x3a8af4,'accessKey':md5(_0xd3fe78[_0xa55c('0x24')]['token']+_0x51d663)},'json':!![]});}})[_0xa55c('0x21')](function(_0x213100){if(_0x213100[_0xa55c('0x22')]){return BPromise['resolve'](_0x213100[_0xa55c('0x24')]);}else{throw new Error(util[_0xa55c('0x1d')]('Account\x20%d\x20is\x20not\x20valid',_0x2f9717['id']));}})[_0xa55c('0x28')](function(_0x34de95){var _0x3822b7=_0x34de95[_0xa55c('0x29')]||0x1f4;logger[_0xa55c('0x27')](_0xa55c('0x2a'),_0xa55c('0x41'),_0x3822b7,JSON[_0xa55c('0x26')](_0x34de95));});}function request(_0x3c147b){logger[_0xa55c('0x16')]('[HTTP]',JSON[_0xa55c('0x26')](_0x3c147b));return rp(_0x3c147b);}exports[_0xa55c('0x42')]=function(_0x216de8,_0x4f73b6,_0x4c3095,_0x35bf0a,_0x4f5ecd,_0x21b760){var _0x4fa412,_0x2b6a0e,_0x228df4,_0x181802;_0x21b760[_0xa55c('0x1f')]=intUtil[_0xa55c('0x43')](_0x21b760['remoteUri']);if(_0x4f5ecd&&_0x4f5ecd[_0xa55c('0x44')]){logger[_0xa55c('0x16')]('[QUEUE]',_0xa55c('0x45'));_0x4f73b6[_0xa55c('0x46')]=util[_0xa55c('0x1d')](_0xa55c('0x47'),_0x21b760['serverUrl'],_0x4f73b6['uniqueid'],md5(_0x4f73b6[_0xa55c('0x48')]));}else{_0x4f73b6[_0xa55c('0x46')]='';}return getConnection(_0x21b760)[_0xa55c('0x21')](function(_0x44ac57){_0x181802=_0x44ac57;return getUser(_0x21b760,_0x35bf0a['email'],_0x181802);})[_0xa55c('0x21')](function(_0x5ce463){_0x4fa412=_0x5ce463;logger[_0xa55c('0x16')](_0xa55c('0x49'),_0x4fa412['id']);return getEndUser(_0x21b760,_0x4f73b6[_0xa55c('0x4a')],_0x4f73b6[_0xa55c('0x4b')],_0x181802);})[_0xa55c('0x21')](function(_0x53b2f7){_0x2b6a0e=_0x53b2f7;logger[_0xa55c('0x16')]('The\x20Enduser\x20ID\x20is:',_0x2b6a0e['id']);return createTicket(_0x21b760,_0x4fa412,_0x2b6a0e,_0x4c3095,_0x4f73b6,_0x4c3095[_0xa55c('0x4c')],_0x181802);})[_0xa55c('0x21')](function(_0x2cfe08){_0x228df4=_0x2cfe08;logger[_0xa55c('0x16')](_0xa55c('0x4d'));logger[_0xa55c('0x16')](_0xa55c('0x4e'),_0x228df4['id']);var _0x53e2be=util[_0xa55c('0x1d')](_0xa55c('0x4f'),_0x21b760[_0xa55c('0x1f')],_[_0xa55c('0x50')](_0x228df4['id'],'x')[0x1]);logger[_0xa55c('0x16')]('[QUEUE]',_0xa55c('0x51'));emit(util[_0xa55c('0x1d')](_0xa55c('0x52'),_0x35bf0a[_0xa55c('0x14')]),_0xa55c('0x53'),{'uri':_0x53e2be});})['catch'](function(_0xdd92c1){logger[_0xa55c('0x27')](_0xa55c('0x54'),JSON[_0xa55c('0x26')](_0xdd92c1));});};exports[_0xa55c('0x55')]=function(_0x480dfc,_0x419fc3,_0x4d94fc,_0x2e482a,_0x5e3a28,_0x3495a7,_0x5a8897){var _0x34edc5,_0x1333da,_0x21d6b4,_0x2f811e;_0x3495a7[_0xa55c('0x1f')]=intUtil[_0xa55c('0x43')](_0x3495a7[_0xa55c('0x1f')]);_0x3495a7[_0xa55c('0x56')]=intUtil[_0xa55c('0x43')](_0x3495a7[_0xa55c('0x56')]);if(_0x5a8897&&_0x5a8897['recordingFormat']&&_0x5a8897[_0xa55c('0x57')]!==_0xa55c('0x58')){logger['info'](_0xa55c('0x59'),_0xa55c('0x45'));_0x419fc3[_0xa55c('0x46')]=util[_0xa55c('0x1d')](_0xa55c('0x47'),_0x3495a7[_0xa55c('0x56')],_0x419fc3[_0xa55c('0x48')],md5(_0x419fc3[_0xa55c('0x48')]));}return getConnection(_0x3495a7)['then'](function(_0x1dfaf7){_0x2f811e=_0x1dfaf7;return getUser(_0x3495a7,_0x2e482a[_0xa55c('0x5a')],_0x2f811e);})[_0xa55c('0x21')](function(_0xd309a9){_0x34edc5=_0xd309a9;logger[_0xa55c('0x16')](_0xa55c('0x49'),_0x34edc5['id']);return getEndUser(_0x3495a7,_0x419fc3[_0xa55c('0x5b')],_0x419fc3[_0xa55c('0x5c')],_0x2f811e);})[_0xa55c('0x21')](function(_0x4a08ca){_0x1333da=_0x4a08ca;logger[_0xa55c('0x16')](_0xa55c('0x5d'),_0x1333da['id']);return createTicket(_0x3495a7,_0x34edc5,_0x1333da,_0x4d94fc,_0x419fc3,_0x4d94fc[_0xa55c('0x4c')],_0x2f811e);})[_0xa55c('0x21')](function(_0x3a269d){_0x21d6b4=_0x3a269d;logger[_0xa55c('0x16')](_0xa55c('0x4d'));logger[_0xa55c('0x16')](_0xa55c('0x4e'),_0x21d6b4['id']);var _0x3178a6=util[_0xa55c('0x1d')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x3495a7[_0xa55c('0x1f')],_['split'](_0x21d6b4['id'],'x')[0x1]);logger[_0xa55c('0x16')](_0xa55c('0x59'),_0xa55c('0x51'));emit(util['format']('user:%s',_0x2e482a[_0xa55c('0x14')]),_0xa55c('0x53'),{'uri':_0x3178a6});})[_0xa55c('0x28')](function(_0x42529f){logger['error'](_0xa55c('0x59'),JSON[_0xa55c('0x26')](_0x42529f));});};exports[_0xa55c('0x5e')]=function(_0x3a9910,_0x21fc9b,_0x500968,_0x4b090c,_0x3f7fca,_0x38689e){var _0x3f9d0a,_0x36ee32,_0x1af9d5,_0x4b2032;_0x38689e[_0xa55c('0x1f')]=intUtil[_0xa55c('0x43')](_0x38689e['remoteUri']);_0x38689e[_0xa55c('0x56')]=intUtil[_0xa55c('0x43')](_0x38689e[_0xa55c('0x56')]);if(_0x3f7fca&&_0x3f7fca['monitor_format']){logger[_0xa55c('0x16')](_0xa55c('0x5f'),_0xa55c('0x45'));_0x21fc9b[_0xa55c('0x46')]=util[_0xa55c('0x1d')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x38689e[_0xa55c('0x56')],_0x21fc9b[_0xa55c('0x48')],md5(_0x21fc9b['uniqueid']));}else{_0x21fc9b['recordingURL']='';}return getConnection(_0x38689e)[_0xa55c('0x21')](function(_0x4e1cbd){_0x4b2032=_0x4e1cbd;return getUser(_0x38689e,'',_0x4b2032);})[_0xa55c('0x21')](function(_0x5ca0bc){_0x3f9d0a=_0x5ca0bc;logger[_0xa55c('0x16')](_0xa55c('0x49'),_0x3f9d0a['id']);return getEndUser(_0x38689e,_0x21fc9b[_0xa55c('0x4a')],_0x21fc9b[_0xa55c('0x4b')],_0x4b2032);})[_0xa55c('0x21')](function(_0xff7b1c){_0x36ee32=_0xff7b1c;logger[_0xa55c('0x16')]('The\x20Enduser\x20ID\x20is:',_0x36ee32['id']);return createTicket(_0x38689e,_0x3f9d0a,_0x36ee32,_0x500968,_0x21fc9b,_0x500968[_0xa55c('0x4c')],_0x4b2032);})[_0xa55c('0x21')](function(_0x21de68){_0x1af9d5=_0x21de68;logger[_0xa55c('0x16')]('Ticket\x20created!');logger[_0xa55c('0x16')](_0xa55c('0x4e'),_0x1af9d5['id']);})[_0xa55c('0x28')](function(_0x2298ac){logger['error']('[ABANDONED]',JSON[_0xa55c('0x26')](_0x2298ac));});}; \ No newline at end of file +var _0x34e8=['user:%s','trigger:browser:url','[QUEUE]','outbound','serverUrl','recordingFormat','[OUTBOUND]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','monitor_format','[ABANDONED]','lodash','request-promise','bluebird','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','emit','length','forEach','type','string','idField','content','toString','variable','variableName','customVariable','Variable','name','info','Creating\x20new\x20ticket...','merge','Open','getString','Descriptions','%s/webservice.php','remoteUri','username','sessionName','stringify','then','resolve','result','catch','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s','validateEmail','GET','format','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','admin','getUser','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','Enduser\x20created.','phone','accessKey','success','login','token','Account\x20%d\x20is\x20not\x20valid','[HTTP]','queue','stripTrailingSlash','Recording\x20is\x20enabled!','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','Fields','The\x20Ticket\x20ID\x20is:','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x34e8,0x12c));var _0x834e=function(_0x3e9cc1,_0xe4349b){_0x3e9cc1=_0x3e9cc1-0x0;var _0x2ff97a=_0x34e8[_0x3e9cc1];return _0x2ff97a;};'use strict';var _=require(_0x834e('0x0'));var rp=require(_0x834e('0x1'));var BPromise=require(_0x834e('0x2'));var md5=require(_0x834e('0x3'));var util=require('util');var Redis=require(_0x834e('0x4'));var intUtil=require(_0x834e('0x5'));var config=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));config[_0x834e('0x9')]=_[_0x834e('0xa')](config['redis'],{'host':_0x834e('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x834e('0x9')]));function emit(_0x3cc2e3,_0x3a3ef6,_0x2e69e2){io['to'](_0x3cc2e3)[_0x834e('0xc')](_0x3a3ef6,_0x2e69e2);}function getCustomFields(_0x23501c,_0x363786){var _0x1af45a={};if(_0x23501c[_0x834e('0xd')]>0x0){_[_0x834e('0xe')](_0x23501c,function(_0x1e41fe){if(_0x1e41fe[_0x834e('0xf')]===_0x834e('0x10')&&_0x1e41fe[_0x834e('0x11')]){_0x1af45a[_0x1e41fe[_0x834e('0x11')]]=_0x1e41fe[_0x834e('0x12')][_0x834e('0x13')]();}else if(_0x1e41fe['type']===_0x834e('0x14')&&_0x1e41fe[_0x834e('0x15')]&&_0x1e41fe['idField']&&_0x363786[_0x1e41fe[_0x834e('0x15')]]){_0x1af45a[_0x1e41fe[_0x834e('0x11')]]=_0x363786[_0x1e41fe[_0x834e('0x15')]][_0x834e('0x13')]();}else if(_0x1e41fe['type']===_0x834e('0x16')&&_0x1e41fe[_0x834e('0x17')]&&_0x1e41fe['Variable'][_0x834e('0x18')]&&_0x1e41fe['idField']&&_0x363786[_0x1e41fe[_0x834e('0x17')][_0x834e('0x18')]['toLowerCase']()]){_0x1af45a[_0x1e41fe[_0x834e('0x11')]]=_0x363786[_0x1e41fe[_0x834e('0x17')][_0x834e('0x18')]['toLowerCase']()][_0x834e('0x13')]();}});}return _0x1af45a;}function createTicket(_0x211e9a,_0x34e41a,_0xb993a1,_0x237947,_0x254677,_0x1dd214,_0x595515){logger[_0x834e('0x19')](_0x834e('0x1a'));var _0x113ff4=_[_0x834e('0x1b')]({'parent_id':'','assigned_user_id':_0x34e41a['id'],'ticketpriorities':'Normal','ticketstatus':_0x834e('0x1c'),'ticket_title':intUtil[_0x834e('0x1d')](_0x237947['Subjects'],_0x254677,'\x20'),'description':intUtil[_0x834e('0x1d')](_0x237947[_0x834e('0x1e')],_0x254677,'\x0a'),'contact_id':_0xb993a1['id']},getCustomFields(_0x1dd214,_0x254677));var _0x8d406e={'method':'POST','uri':util['format'](_0x834e('0x1f'),_0x211e9a[_0x834e('0x20')]),'form':{'operation':'create','username':_0x211e9a[_0x834e('0x21')],'sessionName':_0x595515[_0x834e('0x22')],'elementType':'HelpDesk','element':JSON[_0x834e('0x23')](_0x113ff4)},'json':!![]};return request(_0x8d406e)[_0x834e('0x24')](function(_0x338636){if(_0x338636['success']){return BPromise[_0x834e('0x25')]({'id':_0x338636[_0x834e('0x26')]['id']});}else{throw new Error(util['format']('Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s',JSON[_0x834e('0x23')](_0x338636['error'])));}})[_0x834e('0x27')](function(_0x3f1b0b){var _0x3db026=_0x3f1b0b[_0x834e('0x28')]||0x1f4;logger[_0x834e('0x29')](_0x834e('0x2a'),'createTicket',_0x3db026,JSON['stringify'](_0x3f1b0b));});}function getUser(_0x4dc64a,_0x58c1d7,_0x2c7a8d){if(intUtil[_0x834e('0x2b')](_0x58c1d7)){logger[_0x834e('0x19')]('Getting\x20agent\x20with\x20email',_0x58c1d7);return request({'method':_0x834e('0x2c'),'uri':util[_0x834e('0x2d')](_0x834e('0x1f'),_0x4dc64a[_0x834e('0x20')]),'qs':{'operation':_0x834e('0x2e'),'username':_0x4dc64a[_0x834e('0x21')],'sessionName':_0x2c7a8d[_0x834e('0x22')],'query':util[_0x834e('0x2d')](_0x834e('0x2f'),_0x58c1d7)},'json':!![]})['then'](function(_0xef9ec2){if(_0xef9ec2['success']&&_0xef9ec2[_0x834e('0x26')][_0x834e('0xd')]){logger[_0x834e('0x19')](_0x834e('0x30'));return BPromise[_0x834e('0x25')]({'id':_0xef9ec2[_0x834e('0x26')][0x0]['id'],'email':_0xef9ec2[_0x834e('0x26')][0x0][_0x834e('0x31')],'name':_0xef9ec2[_0x834e('0x26')][0x0][_0x834e('0x32')]+'\x20'+_0xef9ec2['result'][_0x834e('0x33')]});}else{logger[_0x834e('0x19')](_0x834e('0x34'));return BPromise[_0x834e('0x25')]({'id':_0x2c7a8d['userId'],'email':_0x4dc64a[_0x834e('0x21')],'name':_0x834e('0x35')});}})['catch'](function(_0x496533){var _0x59385a=_0x496533[_0x834e('0x28')]||0x1f4;logger[_0x834e('0x29')](_0x834e('0x2a'),_0x834e('0x36'),_0x59385a,JSON[_0x834e('0x23')](_0x496533));});}else{logger[_0x834e('0x19')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x834e('0x25')]({'id':_0x2c7a8d['userId'],'email':_0x4dc64a[_0x834e('0x21')],'name':_0x834e('0x35')})['catch'](function(_0x18ac3b){var _0x2f56c7=_0x18ac3b['statusCode']||0x1f4;logger['error'](_0x834e('0x2a'),_0x834e('0x36'),_0x2f56c7,JSON[_0x834e('0x23')](_0x18ac3b));});}}function getEndUser(_0x130c23,_0x3c49bd,_0x4ca43c,_0x1c5ed6){logger['info']('Searching\x20end\x20user\x20with\x20phone',_0x4ca43c);return request({'method':_0x834e('0x2c'),'uri':util['format'](_0x834e('0x1f'),_0x130c23[_0x834e('0x20')]),'qs':{'operation':_0x834e('0x2e'),'username':_0x130c23[_0x834e('0x21')],'sessionName':_0x1c5ed6[_0x834e('0x22')],'query':util['format'](_0x834e('0x37'),_0x4ca43c,_0x4ca43c,_0x4ca43c,_0x4ca43c,_0x4ca43c)},'json':!![]})[_0x834e('0x24')](function(_0x38f266){if(_0x38f266['success']&&_0x38f266[_0x834e('0x26')][_0x834e('0xd')]){logger['info'](_0x834e('0x38'));return BPromise['resolve']({'id':_0x38f266[_0x834e('0x26')][0x0]['id'],'name':_0x38f266[_0x834e('0x26')][0x0]['firstname']+'\x20'+_0x38f266['result'][0x0][_0x834e('0x39')],'phone':_0x4ca43c});}else{logger[_0x834e('0x19')](_0x834e('0x3a'));return request({'method':_0x834e('0x3b'),'uri':util[_0x834e('0x2d')](_0x834e('0x1f'),_0x130c23[_0x834e('0x20')]),'form':{'operation':'create','sessionName':_0x1c5ed6[_0x834e('0x22')],'elementType':'Contacts','element':JSON[_0x834e('0x23')]({'lastname':_0x3c49bd,'phone':_0x4ca43c,'assigned_user_id':'\x20'})},'json':!![]})['then'](function(_0x1df5b0){logger['info'](_0x834e('0x3c'));return BPromise[_0x834e('0x25')]({'id':_0x1df5b0['result']['id'],'name':_0x1df5b0[_0x834e('0x26')][_0x834e('0x39')],'phone':_0x1df5b0[_0x834e('0x26')][_0x834e('0x3d')]});})[_0x834e('0x27')](function(_0x1a7149){var _0xfa28da=_0x1a7149[_0x834e('0x28')]||0x1f4;logger[_0x834e('0x29')](_0x834e('0x2a'),'getEndUser',_0xfa28da,JSON[_0x834e('0x23')](_0x1a7149));});}});}function getConnection(_0x6fff27){var _0x47a8a9=_0x6fff27[_0x834e('0x21')];var _0x42fd90=_0x6fff27[_0x834e('0x3e')];return request({'method':_0x834e('0x2c'),'uri':util[_0x834e('0x2d')](_0x834e('0x1f'),_0x6fff27['remoteUri']),'qs':{'operation':'getchallenge','username':_0x47a8a9},'json':!![]})[_0x834e('0x24')](function(_0x1a5444){if(_0x1a5444[_0x834e('0x3f')]){return request({'method':_0x834e('0x3b'),'uri':util[_0x834e('0x2d')](_0x834e('0x1f'),_0x6fff27[_0x834e('0x20')]),'form':{'operation':_0x834e('0x40'),'username':_0x47a8a9,'accessKey':md5(_0x1a5444[_0x834e('0x26')][_0x834e('0x41')]+_0x42fd90)},'json':!![]});}})[_0x834e('0x24')](function(_0x385435){if(_0x385435[_0x834e('0x3f')]){return BPromise[_0x834e('0x25')](_0x385435[_0x834e('0x26')]);}else{throw new Error(util[_0x834e('0x2d')](_0x834e('0x42'),_0x6fff27['id']));}})[_0x834e('0x27')](function(_0x420841){var _0x1adf86=_0x420841['statusCode']||0x1f4;logger[_0x834e('0x29')](_0x834e('0x2a'),'getConnection',_0x1adf86,JSON[_0x834e('0x23')](_0x420841));});}function request(_0x3b0988){logger['info'](_0x834e('0x43'),JSON[_0x834e('0x23')](_0x3b0988));return rp(_0x3b0988);}exports[_0x834e('0x44')]=function(_0x35636e,_0x4288e4,_0xb77aab,_0x4549ba,_0x4a8b32,_0x1ad7fe){var _0x8bc6c6,_0x3e0550,_0x363675,_0x86ad2b;_0x1ad7fe[_0x834e('0x20')]=intUtil[_0x834e('0x45')](_0x1ad7fe[_0x834e('0x20')]);if(_0x4a8b32&&_0x4a8b32['monitor_format']){logger[_0x834e('0x19')]('[QUEUE]',_0x834e('0x46'));_0x4288e4['recordingURL']=util[_0x834e('0x2d')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1ad7fe['serverUrl'],_0x4288e4[_0x834e('0x47')],md5(_0x4288e4[_0x834e('0x47')]));}else{_0x4288e4['recordingURL']='';}return getConnection(_0x1ad7fe)['then'](function(_0x2c8155){_0x86ad2b=_0x2c8155;return getUser(_0x1ad7fe,_0x4549ba[_0x834e('0x48')],_0x86ad2b);})[_0x834e('0x24')](function(_0x387365){_0x8bc6c6=_0x387365;logger[_0x834e('0x19')](_0x834e('0x49'),_0x8bc6c6['id']);return getEndUser(_0x1ad7fe,_0x4288e4[_0x834e('0x4a')],_0x4288e4[_0x834e('0x4b')],_0x86ad2b);})['then'](function(_0x142334){_0x3e0550=_0x142334;logger[_0x834e('0x19')]('The\x20Enduser\x20ID\x20is:',_0x3e0550['id']);return createTicket(_0x1ad7fe,_0x8bc6c6,_0x3e0550,_0xb77aab,_0x4288e4,_0xb77aab[_0x834e('0x4c')],_0x86ad2b);})['then'](function(_0x3e58ef){_0x363675=_0x3e58ef;logger[_0x834e('0x19')]('Ticket\x20created!');logger[_0x834e('0x19')](_0x834e('0x4d'),_0x363675['id']);var _0x2de29a=util[_0x834e('0x2d')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x1ad7fe[_0x834e('0x20')],_[_0x834e('0x4e')](_0x363675['id'],'x')[0x1]);logger[_0x834e('0x19')]('[QUEUE]',_0x834e('0x4f'));emit(util[_0x834e('0x2d')](_0x834e('0x50'),_0x4549ba[_0x834e('0x18')]),_0x834e('0x51'),{'uri':_0x2de29a});})[_0x834e('0x27')](function(_0x3a1426){logger[_0x834e('0x29')](_0x834e('0x52'),JSON[_0x834e('0x23')](_0x3a1426));});};exports[_0x834e('0x53')]=function(_0x1dfa95,_0x1b7045,_0x1659c8,_0x460a7a,_0x17b8e3,_0x297cce,_0x14ed83){var _0x193a15,_0x3e3467,_0xed4081,_0x2cb233;_0x297cce['remoteUri']=intUtil[_0x834e('0x45')](_0x297cce[_0x834e('0x20')]);_0x297cce[_0x834e('0x54')]=intUtil[_0x834e('0x45')](_0x297cce['serverUrl']);if(_0x14ed83&&_0x14ed83[_0x834e('0x55')]&&_0x14ed83['recordingFormat']!=='none'){logger[_0x834e('0x19')](_0x834e('0x56'),_0x834e('0x46'));_0x1b7045[_0x834e('0x57')]=util[_0x834e('0x2d')](_0x834e('0x58'),_0x297cce[_0x834e('0x54')],_0x1b7045[_0x834e('0x47')],md5(_0x1b7045['uniqueid']));}return getConnection(_0x297cce)[_0x834e('0x24')](function(_0x5a99e6){_0x2cb233=_0x5a99e6;return getUser(_0x297cce,_0x460a7a[_0x834e('0x48')],_0x2cb233);})[_0x834e('0x24')](function(_0x514fe5){_0x193a15=_0x514fe5;logger['info'](_0x834e('0x49'),_0x193a15['id']);return getEndUser(_0x297cce,_0x1b7045[_0x834e('0x59')],_0x1b7045[_0x834e('0x5a')],_0x2cb233);})[_0x834e('0x24')](function(_0x2c41bd){_0x3e3467=_0x2c41bd;logger['info'](_0x834e('0x5b'),_0x3e3467['id']);return createTicket(_0x297cce,_0x193a15,_0x3e3467,_0x1659c8,_0x1b7045,_0x1659c8[_0x834e('0x4c')],_0x2cb233);})[_0x834e('0x24')](function(_0x228a60){_0xed4081=_0x228a60;logger[_0x834e('0x19')](_0x834e('0x5c'));logger[_0x834e('0x19')](_0x834e('0x4d'),_0xed4081['id']);var _0x376f72=util[_0x834e('0x2d')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x297cce[_0x834e('0x20')],_[_0x834e('0x4e')](_0xed4081['id'],'x')[0x1]);logger[_0x834e('0x19')](_0x834e('0x56'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x834e('0x2d')]('user:%s',_0x460a7a['name']),'trigger:browser:url',{'uri':_0x376f72});})[_0x834e('0x27')](function(_0x332d8f){logger['error'](_0x834e('0x56'),JSON[_0x834e('0x23')](_0x332d8f));});};exports['abandoned']=function(_0x353246,_0x18ccb2,_0x4b88e7,_0x5df169,_0x346be5,_0x2a42a3){var _0x8bc7d9,_0x44c909,_0x1d8e7,_0x493239;_0x2a42a3[_0x834e('0x20')]=intUtil['stripTrailingSlash'](_0x2a42a3[_0x834e('0x20')]);_0x2a42a3[_0x834e('0x54')]=intUtil[_0x834e('0x45')](_0x2a42a3['serverUrl']);if(_0x346be5&&_0x346be5[_0x834e('0x5d')]){logger[_0x834e('0x19')]('[ABANDONED]',_0x834e('0x46'));_0x18ccb2[_0x834e('0x57')]=util[_0x834e('0x2d')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2a42a3[_0x834e('0x54')],_0x18ccb2[_0x834e('0x47')],md5(_0x18ccb2[_0x834e('0x47')]));}else{_0x18ccb2[_0x834e('0x57')]='';}return getConnection(_0x2a42a3)[_0x834e('0x24')](function(_0x29bfd7){_0x493239=_0x29bfd7;return getUser(_0x2a42a3,'',_0x493239);})[_0x834e('0x24')](function(_0x23b5d9){_0x8bc7d9=_0x23b5d9;logger[_0x834e('0x19')](_0x834e('0x49'),_0x8bc7d9['id']);return getEndUser(_0x2a42a3,_0x18ccb2['calleridname'],_0x18ccb2['calleridnum'],_0x493239);})['then'](function(_0x36ede9){_0x44c909=_0x36ede9;logger[_0x834e('0x19')](_0x834e('0x5b'),_0x44c909['id']);return createTicket(_0x2a42a3,_0x8bc7d9,_0x44c909,_0x4b88e7,_0x18ccb2,_0x4b88e7[_0x834e('0x4c')],_0x493239);})[_0x834e('0x24')](function(_0x5758fb){_0x1d8e7=_0x5758fb;logger['info'](_0x834e('0x5c'));logger[_0x834e('0x19')](_0x834e('0x4d'),_0x1d8e7['id']);})[_0x834e('0x27')](function(_0x40a705){logger['error'](_0x834e('0x5e'),JSON[_0x834e('0x23')](_0x40a705));});}; \ 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 f0a0c05..cd8d7c1 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 _0x80fb=['Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','length','filter','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','authType','password','%s:%s','username','token','toString','debug','[HTTP]','stringify','GET','map','forEach','type','string','nameField','customField','content','custom_fields','idField','variable','variableName','customVariable','Variable','toLowerCase','push','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','POST','newTab','user:%s','trigger:browser:url','Zendesk\x20account\x20type\x20not\x20recognized','error','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridnum','%s/channels/voice/agents/%d/tickets/%d/display.json','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','%s/agent/tickets/%s','catch','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','abandoned','[ABANDONED]','calleridnum','request-promise','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','remoteUri','merge','Tags','name','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','%s/search.json','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0x80fb,0x11e));var _0xb80f=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x80fb[_0x465028];return _0xb783d4;};'use strict';var _=require('lodash');var rp=require(_0xb80f('0x0'));var md5=require(_0xb80f('0x1'));var util=require('util');var Redis=require(_0xb80f('0x2'));var intUtil=require(_0xb80f('0x3'));var config=require(_0xb80f('0x4'));var logger=require(_0xb80f('0x5'))(_0xb80f('0x6'));config[_0xb80f('0x7')]=_[_0xb80f('0x8')](config[_0xb80f('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0xb80f('0x9'))(new Redis(config[_0xb80f('0x7')]));function emit(_0x44cc46,_0x2083ab,_0x28027c){io['to'](_0x44cc46)[_0xb80f('0xa')](_0x2083ab,_0x28027c);}var headers={'Content-Type':_0xb80f('0xb'),'Accept':_0xb80f('0xb')};function getTicket(_0x197faa,_0x126c8b,_0x46f991,_0x38069f,_0xceb549){logger[_0xb80f('0xc')](_0xb80f('0xd'));return request({'uri':util[_0xb80f('0xe')]('%s/tickets.json',_0x197faa[_0xb80f('0xf')]),'method':'POST','body':{'ticket':_[_0xb80f('0x10')]({'requester_id':_0x46f991['id'],'submitter_id':_0x126c8b?_0x126c8b['id']:undefined,'assignee_id':_0x126c8b?_0x126c8b['id']:undefined,'tags':getTags(_0x38069f[_0xb80f('0x11')],_0xb80f('0x12')),'subject':intUtil[_0xb80f('0x13')](_0x38069f[_0xb80f('0x14')],_0xceb549,'\x20'),'description':intUtil[_0xb80f('0x13')](_0x38069f[_0xb80f('0x15')],_0xceb549,'\x0a'),'comment':{'public':![],'body':intUtil[_0xb80f('0x13')](_0x38069f[_0xb80f('0x15')],_0xceb549,'\x0a')}},getCustomFields(_0x38069f[_0xb80f('0x16')],_0xceb549))}})[_0xb80f('0x17')](function(_0x3eccd1){logger[_0xb80f('0xc')](_0xb80f('0x18'));return _0x3eccd1[_0xb80f('0x19')];});}function getUser(_0x59cc1b,_0x2558f6){if(intUtil[_0xb80f('0x1a')](_0x2558f6)){logger['info']('Getting\x20agent\x20with\x20email',_0x2558f6);return request({'uri':util[_0xb80f('0xe')](_0xb80f('0x1b'),_0x59cc1b[_0xb80f('0xf')]),'qs':{'query':util[_0xb80f('0xe')](_0xb80f('0x1c'),_0x2558f6)}})[_0xb80f('0x17')](function(_0x5dbf34){if(_0x5dbf34[_0xb80f('0x1d')]){logger[_0xb80f('0xc')](_0xb80f('0x1e'));return _[_0xb80f('0x1f')](_0x5dbf34[_0xb80f('0x20')],{'email':_0x2558f6,'role':_0xb80f('0x21')});}else{logger[_0xb80f('0xc')](_0xb80f('0x22'));return request({'uri':util[_0xb80f('0xe')](_0xb80f('0x23'),_0x59cc1b[_0xb80f('0xf')])})['then'](function(_0x2ad259){logger['info'](_0xb80f('0x24'));return _0x2ad259[_0xb80f('0x25')];});}});}else{logger['info'](_0xb80f('0x22'));return request({'uri':util[_0xb80f('0xe')]('%s/users/me.json',_0x59cc1b['remoteUri'])})[_0xb80f('0x17')](function(_0x2a1650){logger[_0xb80f('0xc')]('Admin\x20account\x20selected.');return _0x2a1650[_0xb80f('0x25')];});}}function getEndUser(_0x49d2c0,_0x510180,_0x475caf){logger[_0xb80f('0xc')](_0xb80f('0x26'),_0x475caf);return request({'uri':util[_0xb80f('0xe')](_0xb80f('0x1b'),_0x49d2c0[_0xb80f('0xf')]),'qs':{'query':util[_0xb80f('0xe')](_0xb80f('0x27'),_0x475caf)}})['then'](function(_0x56551d){var _0x4c962b;if(_0x56551d['results'][_0xb80f('0x28')]){_0x56551d[_0xb80f('0x20')]=_[_0xb80f('0x29')](_0x56551d[_0xb80f('0x20')],{'suspended':![],'role':_0xb80f('0x2a')});if(_0x56551d[_0xb80f('0x20')]['length']){_0x4c962b=_[_0xb80f('0x2b')](_0x56551d[_0xb80f('0x20')]);}}if(_0x4c962b){logger['info'](_0xb80f('0x2c'));return _0x4c962b;}else{logger['info'](_0xb80f('0x2d'));return request({'uri':util['format']('%s/users.json',_0x49d2c0[_0xb80f('0xf')]),'method':'POST','body':{'user':{'role':_0xb80f('0x2a'),'name':util[_0xb80f('0xe')]('Caller\x20-\x20%s',_0x510180||_0x475caf),'phone':_0x475caf}}})['then'](function(_0x3642a5){logger[_0xb80f('0xc')]('Enduser\x20created.');return _0x3642a5[_0xb80f('0x25')];});}});}function getAuth(_0x4135de){var _0x2558b2;if(_0x4135de[_0xb80f('0x2e')]===_0xb80f('0x2f')){_0x2558b2=util['format'](_0xb80f('0x30'),_0x4135de[_0xb80f('0x31')],_0x4135de['password']);}else if(_0x4135de[_0xb80f('0x2e')]===_0xb80f('0x32')){_0x2558b2=util[_0xb80f('0xe')]('%s/token:%s',_0x4135de[_0xb80f('0x31')],_0x4135de['token']);}return util[_0xb80f('0xe')]('Basic\x20%s',new Buffer(_0x2558b2)[_0xb80f('0x33')]('base64'));}function request(_0x3512c6){logger[_0xb80f('0x34')](_0xb80f('0x35'),JSON[_0xb80f('0x36')](_0x3512c6));return rp(_['defaults'](_0x3512c6,{'method':_0xb80f('0x37'),'headers':headers,'json':!![]}));}function getTags(_0x3b250e,_0x3260cd){var _0x451757=[];if(_0x3b250e&&_0x3b250e[_0xb80f('0x28')]>0x0){_0x451757=_[_0xb80f('0x38')](_0x3b250e,_0x3260cd);}return _0x451757;}function getCustomFields(_0x14b6db,_0xf68bcb){var _0x5a9db6=[];var _0x2e3f5f={'custom_fields':[]};if(_0x14b6db[_0xb80f('0x28')]>0x0){_[_0xb80f('0x39')](_0x14b6db,function(_0xb17fa0){if(_0xb17fa0[_0xb80f('0x3a')]===_0xb80f('0x3b')&&_0xb17fa0[_0xb80f('0x3c')]&&!_0xb17fa0[_0xb80f('0x3d')]){_0x2e3f5f[_0xb17fa0['nameField']['toLowerCase']()]=_0xb17fa0[_0xb80f('0x3e')][_0xb80f('0x33')]();}else if(_0xb17fa0[_0xb80f('0x3a')]===_0xb80f('0x3b')&&_0xb17fa0['idField']&&_0xb17fa0['customField']){_0x2e3f5f[_0xb80f('0x3f')]['push']({'id':_0xb17fa0[_0xb80f('0x40')],'value':_0xb17fa0[_0xb80f('0x3e')][_0xb80f('0x33')]()});}else if(_0xb17fa0[_0xb80f('0x3a')]===_0xb80f('0x41')&&_0xb17fa0[_0xb80f('0x42')]&&_0xb17fa0[_0xb80f('0x40')]&&_0xb17fa0[_0xb80f('0x3d')]){_0xf68bcb[_0xb17fa0[_0xb80f('0x42')]]&&_0x2e3f5f[_0xb80f('0x3f')]['push']({'id':_0xb17fa0[_0xb80f('0x40')],'value':_0xf68bcb[_0xb17fa0[_0xb80f('0x42')]][_0xb80f('0x33')]()});}else if(_0xb17fa0[_0xb80f('0x3a')]===_0xb80f('0x43')&&_0xb17fa0['Variable']&&_0xb17fa0['Variable']['name']&&_0xb17fa0['idField']&&_0xb17fa0[_0xb80f('0x3d')]){_0xf68bcb[_0xb17fa0[_0xb80f('0x44')][_0xb80f('0x12')][_0xb80f('0x45')]()]&&_0x2e3f5f[_0xb80f('0x3f')][_0xb80f('0x46')]({'id':_0xb17fa0[_0xb80f('0x40')],'value':_0xf68bcb[_0xb17fa0[_0xb80f('0x44')]['name']['toLowerCase']()]['toString']()});}});}return _0x2e3f5f;}exports[_0xb80f('0x47')]=function(_0x5b6786,_0x134663,_0x345608,_0x1de8df,_0x10ee00,_0x58bd4b){var _0x14d315,_0x51e9a0;_0x58bd4b[_0xb80f('0xf')]=intUtil[_0xb80f('0x48')](_0x58bd4b['remoteUri']);_0x58bd4b['serverUrl']=intUtil[_0xb80f('0x48')](_0x58bd4b[_0xb80f('0x49')]);if(_0x10ee00&&_0x10ee00[_0xb80f('0x4a')]){logger[_0xb80f('0xc')](_0xb80f('0x4b'),'Recording\x20is\x20enabled!');_0x134663[_0xb80f('0x4c')]=util['format'](_0xb80f('0x4d'),_0x58bd4b[_0xb80f('0x49')],_0x134663[_0xb80f('0x4e')],md5(_0x134663[_0xb80f('0x4e')]));}else{_0x134663[_0xb80f('0x4c')]='';}headers[_0xb80f('0x4f')]=getAuth(_0x58bd4b);return getUser(_0x58bd4b,_0x1de8df[_0xb80f('0x50')])[_0xb80f('0x17')](function(_0xf3e2a){_0x14d315=_0xf3e2a;logger['info'](_0xb80f('0x51'),_0x14d315['id']);return getEndUser(_0x58bd4b,_0x134663[_0xb80f('0x52')],_0x134663['calleridnum']);})['then'](function(_0x439d84){_0x51e9a0=_0x439d84;logger[_0xb80f('0xc')](_0xb80f('0x53'),_0x51e9a0['id']);return getTicket(_0x58bd4b,_0x14d315,_0x51e9a0,_0x345608,_0x134663);})[_0xb80f('0x17')](function(_0x5ae0bb){if(_0x5ae0bb){logger[_0xb80f('0xc')](_0xb80f('0x54'),_0x5ae0bb['id']);switch(_0x58bd4b['type']){case _0xb80f('0x55'):logger['info'](_0xb80f('0x4b'),_0xb80f('0x56'));return request({'uri':util[_0xb80f('0xe')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x58bd4b['remoteUri'],_0x14d315['id'],_0x5ae0bb['id']),'method':_0xb80f('0x57')});case _0xb80f('0x58'):logger[_0xb80f('0xc')](_0xb80f('0x4b'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xb80f('0xe')](_0xb80f('0x59'),_0x1de8df[_0xb80f('0x12')]),_0xb80f('0x5a'),{'uri':util[_0xb80f('0xe')]('%s/agent/tickets/%s',_0x58bd4b[_0xb80f('0xf')],_0x5ae0bb['id'])});break;default:logger['error']('[QUEUE]',_0xb80f('0x5b'));}}})['catch'](function(_0x1b25aa){logger[_0xb80f('0x5c')](_0xb80f('0x5d'),util[_0xb80f('0x5e')](_0x1b25aa,{'showHidden':!![],'depth':null}));});};exports[_0xb80f('0x5f')]=function(_0x1b26e3,_0x438a05,_0x1f23e5,_0x1a3fe4,_0x5553c9,_0x2bb579,_0x530b1b){var _0x5e1ccb,_0x552438;_0x2bb579['remoteUri']=intUtil[_0xb80f('0x48')](_0x2bb579['remoteUri']);_0x2bb579[_0xb80f('0x49')]=intUtil[_0xb80f('0x48')](_0x2bb579[_0xb80f('0x49')]);if(_0x530b1b&&_0x530b1b['recordingFormat']&&_0x530b1b['recordingFormat']!==_0xb80f('0x60')){logger[_0xb80f('0xc')](_0xb80f('0x61'),_0xb80f('0x62'));_0x438a05[_0xb80f('0x4c')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2bb579[_0xb80f('0x49')],_0x438a05[_0xb80f('0x4e')],md5(_0x438a05[_0xb80f('0x4e')]));}headers['Authorization']=getAuth(_0x2bb579);return getUser(_0x2bb579,_0x1a3fe4['email'])[_0xb80f('0x17')](function(_0x207af5){_0x5e1ccb=_0x207af5;logger[_0xb80f('0xc')](_0xb80f('0x51'),_0x5e1ccb['id']);return getEndUser(_0x2bb579,_0x438a05['destcalleridname'],_0x438a05[_0xb80f('0x63')]);})[_0xb80f('0x17')](function(_0x4f350b){_0x552438=_0x4f350b;logger[_0xb80f('0xc')](_0xb80f('0x53'),_0x552438['id']);return getTicket(_0x2bb579,_0x5e1ccb,_0x552438,_0x1f23e5,_0x438a05);})[_0xb80f('0x17')](function(_0x15d913){if(_0x15d913){logger[_0xb80f('0xc')]('The\x20Ticket\x20ID\x20is:',_0x15d913['id']);switch(_0x2bb579[_0xb80f('0x3a')]){case'integrationTab':logger[_0xb80f('0xc')](_0xb80f('0x61'),_0xb80f('0x56'));return request({'uri':util[_0xb80f('0xe')](_0xb80f('0x64'),_0x2bb579[_0xb80f('0xf')],_0x5e1ccb['id'],_0x15d913['id']),'method':'POST'});case _0xb80f('0x58'):logger[_0xb80f('0xc')](_0xb80f('0x61'),_0xb80f('0x65'));emit(util[_0xb80f('0xe')](_0xb80f('0x59'),_0x1a3fe4[_0xb80f('0x12')]),_0xb80f('0x5a'),{'uri':util[_0xb80f('0xe')](_0xb80f('0x66'),_0x2bb579['remoteUri'],_0x15d913['id'])});break;default:logger['error'](_0xb80f('0x61'),_0xb80f('0x5b'));}}})[_0xb80f('0x67')](function(_0x111d55){logger[_0xb80f('0x5c')](_0xb80f('0x68'),util['inspect'](_0x111d55,{'showHidden':!![],'depth':null}));});};exports[_0xb80f('0x69')]=function(_0x5499f2,_0xfb3d8b,_0x2bdbe8,_0x2ec366,_0x5106cc,_0x3a3850){var _0x20c9d8,_0x231f8e;_0x3a3850['remoteUri']=intUtil[_0xb80f('0x48')](_0x3a3850[_0xb80f('0xf')]);_0x3a3850[_0xb80f('0x49')]=intUtil[_0xb80f('0x48')](_0x3a3850[_0xb80f('0x49')]);if(_0x5106cc&&_0x5106cc['monitor_format']){logger[_0xb80f('0xc')](_0xb80f('0x6a'),'Recording\x20is\x20enabled!');_0xfb3d8b[_0xb80f('0x4c')]=util[_0xb80f('0xe')](_0xb80f('0x4d'),_0x3a3850[_0xb80f('0x49')],_0xfb3d8b[_0xb80f('0x4e')],md5(_0xfb3d8b[_0xb80f('0x4e')]));}else{_0xfb3d8b['recordingURL']='';}headers['Authorization']=getAuth(_0x3a3850);return getUser(_0x3a3850)[_0xb80f('0x17')](function(_0x552ccf){_0x20c9d8=_0x552ccf;logger[_0xb80f('0xc')]('The\x20User\x20ID\x20is:',_0x20c9d8['id']);return getEndUser(_0x3a3850,_0xfb3d8b[_0xb80f('0x52')],_0xfb3d8b[_0xb80f('0x6b')]);})['then'](function(_0x5ce875){_0x231f8e=_0x5ce875;logger['info'](_0xb80f('0x53'),_0x231f8e['id']);return getTicket(_0x3a3850,_0x20c9d8,_0x231f8e,_0x2bdbe8,_0xfb3d8b);})[_0xb80f('0x17')](function(_0x2bbf8a){if(_0x2bbf8a){logger[_0xb80f('0xc')]('The\x20Ticket\x20ID\x20is:',_0x2bbf8a['id']);}})[_0xb80f('0x67')](function(_0x45ffc6){logger[_0xb80f('0x5c')]('[ABANDONED]\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x45ffc6,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x4f82=['Ticket\x20created!','validateEmail','Getting\x20agent\x20with\x20email','format','%s/search.json','type:user\x20role:agent\x20email:%s','Agent\x20found!','find','agent','%s/users/me.json','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user','Searching\x20enduser\x20with\x20phone','results','length','end-user','Enduser\x20found!','%s/users.json','POST','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','username','token','%s/token:%s','Basic\x20%s','toString','base64','[HTTP]','stringify','GET','map','forEach','type','customField','nameField','toLowerCase','content','string','idField','custom_fields','push','variable','variableName','customVariable','Variable','name','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:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','[QUEUE]','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','outbound','recordingFormat','none','[OUTBOUND]','integrationTab','%s/agent/tickets/%s','inspect','abandoned','[ABANDONED]','[ABANDONED]\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','util','./util','../../../../config/logger','redis','defaults','localhost','emit','application/json','info','remoteUri','merge','getString','Subjects','Descriptions','Fields','then'];(function(_0x2018ba,_0x3a71f9){var _0x4db201=function(_0x5da0b7){while(--_0x5da0b7){_0x2018ba['push'](_0x2018ba['shift']());}};_0x4db201(++_0x3a71f9);}(_0x4f82,0xbc));var _0x24f8=function(_0x397cfb,_0xb8f317){_0x397cfb=_0x397cfb-0x0;var _0x15fed9=_0x4f82[_0x397cfb];return _0x15fed9;};'use strict';var _=require(_0x24f8('0x0'));var rp=require(_0x24f8('0x1'));var md5=require('md5');var util=require(_0x24f8('0x2'));var Redis=require('ioredis');var intUtil=require(_0x24f8('0x3'));var config=require('../../../../config/environment');var logger=require(_0x24f8('0x4'))('zendesk');config[_0x24f8('0x5')]=_[_0x24f8('0x6')](config[_0x24f8('0x5')],{'host':_0x24f8('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x24f8('0x5')]));function emit(_0x3fede7,_0x7364f9,_0x2ed80f){io['to'](_0x3fede7)[_0x24f8('0x8')](_0x7364f9,_0x2ed80f);}var headers={'Content-Type':_0x24f8('0x9'),'Accept':'application/json'};function getTicket(_0x33ef2c,_0x2b1417,_0x2d15f1,_0x302c5a,_0x4eba51){logger[_0x24f8('0xa')]('Creating\x20new\x20ticket...');return request({'uri':util['format']('%s/tickets.json',_0x33ef2c[_0x24f8('0xb')]),'method':'POST','body':{'ticket':_[_0x24f8('0xc')]({'requester_id':_0x2d15f1['id'],'submitter_id':_0x2b1417?_0x2b1417['id']:undefined,'assignee_id':_0x2b1417?_0x2b1417['id']:undefined,'tags':getTags(_0x302c5a['Tags'],'name'),'subject':intUtil[_0x24f8('0xd')](_0x302c5a[_0x24f8('0xe')],_0x4eba51,'\x20'),'description':intUtil[_0x24f8('0xd')](_0x302c5a[_0x24f8('0xf')],_0x4eba51,'\x0a'),'comment':{'public':![],'body':intUtil[_0x24f8('0xd')](_0x302c5a[_0x24f8('0xf')],_0x4eba51,'\x0a')}},getCustomFields(_0x302c5a[_0x24f8('0x10')],_0x4eba51))}})[_0x24f8('0x11')](function(_0x38ec25){logger[_0x24f8('0xa')](_0x24f8('0x12'));return _0x38ec25['ticket'];});}function getUser(_0x3a4760,_0x2a980d){if(intUtil[_0x24f8('0x13')](_0x2a980d)){logger[_0x24f8('0xa')](_0x24f8('0x14'),_0x2a980d);return request({'uri':util[_0x24f8('0x15')](_0x24f8('0x16'),_0x3a4760[_0x24f8('0xb')]),'qs':{'query':util[_0x24f8('0x15')](_0x24f8('0x17'),_0x2a980d)}})[_0x24f8('0x11')](function(_0x244af5){if(_0x244af5['count']){logger[_0x24f8('0xa')](_0x24f8('0x18'));return _[_0x24f8('0x19')](_0x244af5['results'],{'email':_0x2a980d,'role':_0x24f8('0x1a')});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x24f8('0x15')](_0x24f8('0x1b'),_0x3a4760['remoteUri'])})[_0x24f8('0x11')](function(_0x5ac5e){logger[_0x24f8('0xa')]('Admin\x20account\x20selected.');return _0x5ac5e['user'];});}});}else{logger[_0x24f8('0xa')](_0x24f8('0x1c'));return request({'uri':util[_0x24f8('0x15')](_0x24f8('0x1b'),_0x3a4760[_0x24f8('0xb')])})[_0x24f8('0x11')](function(_0x5cd49a){logger[_0x24f8('0xa')]('Admin\x20account\x20selected.');return _0x5cd49a[_0x24f8('0x1d')];});}}function getEndUser(_0x3b89b5,_0x3ba0a3,_0x432c9d){logger[_0x24f8('0xa')](_0x24f8('0x1e'),_0x432c9d);return request({'uri':util[_0x24f8('0x15')](_0x24f8('0x16'),_0x3b89b5[_0x24f8('0xb')]),'qs':{'query':util[_0x24f8('0x15')]('type:user\x20role:end-user\x20phone:%s',_0x432c9d)}})[_0x24f8('0x11')](function(_0x2290ff){var _0x47370b;if(_0x2290ff[_0x24f8('0x1f')][_0x24f8('0x20')]){_0x2290ff[_0x24f8('0x1f')]=_['filter'](_0x2290ff[_0x24f8('0x1f')],{'suspended':![],'role':_0x24f8('0x21')});if(_0x2290ff[_0x24f8('0x1f')][_0x24f8('0x20')]){_0x47370b=_['first'](_0x2290ff[_0x24f8('0x1f')]);}}if(_0x47370b){logger[_0x24f8('0xa')](_0x24f8('0x22'));return _0x47370b;}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util['format'](_0x24f8('0x23'),_0x3b89b5[_0x24f8('0xb')]),'method':_0x24f8('0x24'),'body':{'user':{'role':_0x24f8('0x21'),'name':util[_0x24f8('0x15')](_0x24f8('0x25'),_0x3ba0a3||_0x432c9d),'phone':_0x432c9d}}})[_0x24f8('0x11')](function(_0x38d898){logger['info'](_0x24f8('0x26'));return _0x38d898[_0x24f8('0x1d')];});}});}function getAuth(_0x19a186){var _0x15eef6;if(_0x19a186[_0x24f8('0x27')]===_0x24f8('0x28')){_0x15eef6=util['format'](_0x24f8('0x29'),_0x19a186[_0x24f8('0x2a')],_0x19a186[_0x24f8('0x28')]);}else if(_0x19a186[_0x24f8('0x27')]===_0x24f8('0x2b')){_0x15eef6=util['format'](_0x24f8('0x2c'),_0x19a186[_0x24f8('0x2a')],_0x19a186[_0x24f8('0x2b')]);}return util[_0x24f8('0x15')](_0x24f8('0x2d'),new Buffer(_0x15eef6)[_0x24f8('0x2e')](_0x24f8('0x2f')));}function request(_0x5844e){logger['debug'](_0x24f8('0x30'),JSON[_0x24f8('0x31')](_0x5844e));return rp(_[_0x24f8('0x6')](_0x5844e,{'method':_0x24f8('0x32'),'headers':headers,'json':!![]}));}function getTags(_0x44f248,_0x37bfff){var _0x50a67e=[];if(_0x44f248&&_0x44f248['length']>0x0){_0x50a67e=_[_0x24f8('0x33')](_0x44f248,_0x37bfff);}return _0x50a67e;}function getCustomFields(_0x50c72c,_0x9f37a0){var _0x5a80fe=[];var _0x4e69c8={'custom_fields':[]};if(_0x50c72c['length']>0x0){_[_0x24f8('0x34')](_0x50c72c,function(_0x1b9f2a){if(_0x1b9f2a[_0x24f8('0x35')]==='string'&&_0x1b9f2a['nameField']&&!_0x1b9f2a[_0x24f8('0x36')]){_0x4e69c8[_0x1b9f2a[_0x24f8('0x37')][_0x24f8('0x38')]()]=_0x1b9f2a[_0x24f8('0x39')]['toString']();}else if(_0x1b9f2a[_0x24f8('0x35')]===_0x24f8('0x3a')&&_0x1b9f2a[_0x24f8('0x3b')]&&_0x1b9f2a['customField']){_0x4e69c8[_0x24f8('0x3c')][_0x24f8('0x3d')]({'id':_0x1b9f2a[_0x24f8('0x3b')],'value':_0x1b9f2a[_0x24f8('0x39')][_0x24f8('0x2e')]()});}else if(_0x1b9f2a[_0x24f8('0x35')]===_0x24f8('0x3e')&&_0x1b9f2a['variableName']&&_0x1b9f2a[_0x24f8('0x3b')]&&_0x1b9f2a[_0x24f8('0x36')]){_0x9f37a0[_0x1b9f2a['variableName']]&&_0x4e69c8[_0x24f8('0x3c')][_0x24f8('0x3d')]({'id':_0x1b9f2a[_0x24f8('0x3b')],'value':_0x9f37a0[_0x1b9f2a[_0x24f8('0x3f')]][_0x24f8('0x2e')]()});}else if(_0x1b9f2a[_0x24f8('0x35')]===_0x24f8('0x40')&&_0x1b9f2a[_0x24f8('0x41')]&&_0x1b9f2a[_0x24f8('0x41')]['name']&&_0x1b9f2a['idField']&&_0x1b9f2a['customField']){_0x9f37a0[_0x1b9f2a[_0x24f8('0x41')]['name']['toLowerCase']()]&&_0x4e69c8[_0x24f8('0x3c')][_0x24f8('0x3d')]({'id':_0x1b9f2a[_0x24f8('0x3b')],'value':_0x9f37a0[_0x1b9f2a[_0x24f8('0x41')][_0x24f8('0x42')][_0x24f8('0x38')]()][_0x24f8('0x2e')]()});}});}return _0x4e69c8;}exports[_0x24f8('0x43')]=function(_0x5e60fa,_0x3f3929,_0x2fd59f,_0xb3d2c6,_0x263fc5,_0x31d491){var _0x3be4f6,_0x4823f7;_0x31d491['remoteUri']=intUtil[_0x24f8('0x44')](_0x31d491[_0x24f8('0xb')]);_0x31d491[_0x24f8('0x45')]=intUtil['stripTrailingSlash'](_0x31d491[_0x24f8('0x45')]);if(_0x263fc5&&_0x263fc5[_0x24f8('0x46')]){logger[_0x24f8('0xa')]('[QUEUE]',_0x24f8('0x47'));_0x3f3929[_0x24f8('0x48')]=util[_0x24f8('0x15')](_0x24f8('0x49'),_0x31d491[_0x24f8('0x45')],_0x3f3929[_0x24f8('0x4a')],md5(_0x3f3929[_0x24f8('0x4a')]));}else{_0x3f3929[_0x24f8('0x48')]='';}headers[_0x24f8('0x4b')]=getAuth(_0x31d491);return getUser(_0x31d491,_0xb3d2c6[_0x24f8('0x4c')])['then'](function(_0x553463){_0x3be4f6=_0x553463;logger[_0x24f8('0xa')](_0x24f8('0x4d'),_0x3be4f6['id']);return getEndUser(_0x31d491,_0x3f3929[_0x24f8('0x4e')],_0x3f3929[_0x24f8('0x4f')]);})[_0x24f8('0x11')](function(_0x4f9049){_0x4823f7=_0x4f9049;logger[_0x24f8('0xa')](_0x24f8('0x50'),_0x4823f7['id']);return getTicket(_0x31d491,_0x3be4f6,_0x4823f7,_0x2fd59f,_0x3f3929);})[_0x24f8('0x11')](function(_0x132258){if(_0x132258){logger[_0x24f8('0xa')](_0x24f8('0x51'),_0x132258['id']);switch(_0x31d491[_0x24f8('0x35')]){case'integrationTab':logger[_0x24f8('0xa')](_0x24f8('0x52'),_0x24f8('0x53'));return request({'uri':util[_0x24f8('0x15')](_0x24f8('0x54'),_0x31d491['remoteUri'],_0x3be4f6['id'],_0x132258['id']),'method':_0x24f8('0x24')});case _0x24f8('0x55'):logger[_0x24f8('0xa')](_0x24f8('0x52'),_0x24f8('0x56'));emit(util[_0x24f8('0x15')](_0x24f8('0x57'),_0xb3d2c6[_0x24f8('0x42')]),_0x24f8('0x58'),{'uri':util[_0x24f8('0x15')]('%s/agent/tickets/%s',_0x31d491['remoteUri'],_0x132258['id'])});break;default:logger[_0x24f8('0x59')](_0x24f8('0x52'),_0x24f8('0x5a'));}}})[_0x24f8('0x5b')](function(_0x49b230){logger[_0x24f8('0x59')](_0x24f8('0x5c'),util['inspect'](_0x49b230,{'showHidden':!![],'depth':null}));});};exports[_0x24f8('0x5d')]=function(_0x5396d7,_0x384225,_0x53dcea,_0x204540,_0xfd2b9,_0x4d85ca,_0x48db4e){var _0x50ea3f,_0x5bb998;_0x4d85ca['remoteUri']=intUtil[_0x24f8('0x44')](_0x4d85ca[_0x24f8('0xb')]);_0x4d85ca[_0x24f8('0x45')]=intUtil[_0x24f8('0x44')](_0x4d85ca[_0x24f8('0x45')]);if(_0x48db4e&&_0x48db4e[_0x24f8('0x5e')]&&_0x48db4e[_0x24f8('0x5e')]!==_0x24f8('0x5f')){logger[_0x24f8('0xa')](_0x24f8('0x60'),_0x24f8('0x47'));_0x384225['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4d85ca['serverUrl'],_0x384225['uniqueid'],md5(_0x384225[_0x24f8('0x4a')]));}headers[_0x24f8('0x4b')]=getAuth(_0x4d85ca);return getUser(_0x4d85ca,_0x204540[_0x24f8('0x4c')])['then'](function(_0x1f8d84){_0x50ea3f=_0x1f8d84;logger[_0x24f8('0xa')](_0x24f8('0x4d'),_0x50ea3f['id']);return getEndUser(_0x4d85ca,_0x384225['destcalleridname'],_0x384225['destcalleridnum']);})[_0x24f8('0x11')](function(_0x2784c0){_0x5bb998=_0x2784c0;logger[_0x24f8('0xa')](_0x24f8('0x50'),_0x5bb998['id']);return getTicket(_0x4d85ca,_0x50ea3f,_0x5bb998,_0x53dcea,_0x384225);})['then'](function(_0x26c2fa){if(_0x26c2fa){logger[_0x24f8('0xa')](_0x24f8('0x51'),_0x26c2fa['id']);switch(_0x4d85ca[_0x24f8('0x35')]){case _0x24f8('0x61'):logger[_0x24f8('0xa')](_0x24f8('0x60'),_0x24f8('0x53'));return request({'uri':util[_0x24f8('0x15')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x4d85ca[_0x24f8('0xb')],_0x50ea3f['id'],_0x26c2fa['id']),'method':_0x24f8('0x24')});case _0x24f8('0x55'):logger[_0x24f8('0xa')](_0x24f8('0x60'),_0x24f8('0x56'));emit(util[_0x24f8('0x15')](_0x24f8('0x57'),_0x204540[_0x24f8('0x42')]),_0x24f8('0x58'),{'uri':util[_0x24f8('0x15')](_0x24f8('0x62'),_0x4d85ca[_0x24f8('0xb')],_0x26c2fa['id'])});break;default:logger['error'](_0x24f8('0x60'),_0x24f8('0x5a'));}}})['catch'](function(_0x5e3012){logger[_0x24f8('0x59')]('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util[_0x24f8('0x63')](_0x5e3012,{'showHidden':!![],'depth':null}));});};exports[_0x24f8('0x64')]=function(_0xf17b64,_0x3731db,_0x4c97d9,_0x10c7f0,_0x2f74b5,_0xfe23dd){var _0x5eeb65,_0x59c903;_0xfe23dd[_0x24f8('0xb')]=intUtil[_0x24f8('0x44')](_0xfe23dd[_0x24f8('0xb')]);_0xfe23dd[_0x24f8('0x45')]=intUtil['stripTrailingSlash'](_0xfe23dd['serverUrl']);if(_0x2f74b5&&_0x2f74b5[_0x24f8('0x46')]){logger[_0x24f8('0xa')](_0x24f8('0x65'),_0x24f8('0x47'));_0x3731db['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xfe23dd[_0x24f8('0x45')],_0x3731db['uniqueid'],md5(_0x3731db['uniqueid']));}else{_0x3731db[_0x24f8('0x48')]='';}headers[_0x24f8('0x4b')]=getAuth(_0xfe23dd);return getUser(_0xfe23dd)['then'](function(_0x26b661){_0x5eeb65=_0x26b661;logger[_0x24f8('0xa')](_0x24f8('0x4d'),_0x5eeb65['id']);return getEndUser(_0xfe23dd,_0x3731db[_0x24f8('0x4e')],_0x3731db[_0x24f8('0x4f')]);})[_0x24f8('0x11')](function(_0x595b48){_0x59c903=_0x595b48;logger[_0x24f8('0xa')](_0x24f8('0x50'),_0x59c903['id']);return getTicket(_0xfe23dd,_0x5eeb65,_0x59c903,_0x4c97d9,_0x3731db);})['then'](function(_0x324eea){if(_0x324eea){logger[_0x24f8('0xa')](_0x24f8('0x51'),_0x324eea['id']);}})[_0x24f8('0x5b')](function(_0x1efd4f){logger[_0x24f8('0x59')](_0x24f8('0x66'),util[_0x24f8('0x63')](_0x1efd4f,{'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 9a371e4..563c975 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 _0xbfd2=['user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','stripTrailingSlash','recordingFormat','[OUTBOUND]','uniqueid','zoho.eu','com','destcalleridname','destcalleridnum','/api/voice/recordings/','/downloads?type=uniqueid&token=','lodash','util','moment','ioredis','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','localhost','emit','[HTTP]','stringify','forEach','idField','content','toString','type','variable','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','then','add','seconds','catch','error','stack','info','Search\x20user','GET','format','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','Using\x20the\x20admin\x20account!','user','profile','Administrator','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','/crm/v2/','startCase','role','first_name','last_name','SUCCESS','details','moduleCreate','Error:\x20','log','CREATE\x20ERROR','moduleSearch','contact_lead','uri','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','contact','/crm/v2/Contacts/search?criteria=((Phone:equals:','nothing','lead','Creating\x20new\x20call...','Owner','administrator','getString','Subjects','Who_Id','Full_Name','Last_Name','What_Id','First_Name','talktime','Call_Duration','utc','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','lastevent','called','Call_Result','Called','complete','connect','Answered','rejected','Rejected','abandoned','Abandoned','outbound','starttime','agentcalledAt','Call_Type','Inbound','merge','/crm/v2/Calls','err','queue','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','host','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...'];(function(_0x410e31,_0x196cf5){var _0x4082ba=function(_0x57d0ff){while(--_0x57d0ff){_0x410e31['push'](_0x410e31['shift']());}};_0x4082ba(++_0x196cf5);}(_0xbfd2,0x1ca));var _0x2bfd=function(_0x23542f,_0x34055b){_0x23542f=_0x23542f-0x0;var _0x3585a9=_0xbfd2[_0x23542f];return _0x3585a9;};'use strict';var _=require(_0x2bfd('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require(_0x2bfd('0x1'));var intUtil=require('./util');var moment=require(_0x2bfd('0x2'));var Redis=require(_0x2bfd('0x3'));var BPromise=require('bluebird');var config=require(_0x2bfd('0x4'));var logger=require(_0x2bfd('0x5'))(_0x2bfd('0x6'));config[_0x2bfd('0x7')]=_[_0x2bfd('0x8')](config[_0x2bfd('0x7')],{'host':_0x2bfd('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x2bfd('0x7')]));function emit(_0x1ed470,_0x1b2705,_0x54f141){io['to'](_0x1ed470)[_0x2bfd('0xa')](_0x1b2705,_0x54f141);}function request(_0x4af857){logger['debug'](_0x2bfd('0xb'),JSON[_0x2bfd('0xc')](_0x4af857));return rp(_0x4af857);}function getCustomFields(_0x59e0c7,_0x346b51){var _0x51fa06={};if(_0x59e0c7['length']>0x0){_[_0x2bfd('0xd')](_0x59e0c7,function(_0xe1dd93){if(_0xe1dd93['type']==='string'&&_0xe1dd93[_0x2bfd('0xe')]){_0x51fa06[_0xe1dd93['idField']]=_0xe1dd93[_0x2bfd('0xf')][_0x2bfd('0x10')]();}else if(_0xe1dd93[_0x2bfd('0x11')]===_0x2bfd('0x12')&&_0xe1dd93[_0x2bfd('0x13')]&&_0xe1dd93['idField']&&_0x346b51[_0xe1dd93[_0x2bfd('0x13')]]){_0x51fa06[_0xe1dd93['idField']]=_0x346b51[_0xe1dd93[_0x2bfd('0x13')]]['toString']();}else if(_0xe1dd93[_0x2bfd('0x11')]===_0x2bfd('0x14')&&_0xe1dd93['Variable']&&_0xe1dd93[_0x2bfd('0x15')][_0x2bfd('0x16')]&&_0xe1dd93[_0x2bfd('0xe')]&&_0x346b51[_0xe1dd93[_0x2bfd('0x15')][_0x2bfd('0x16')][_0x2bfd('0x17')]()]){_0x51fa06[_0xe1dd93['idField']]=_0x346b51[_0xe1dd93[_0x2bfd('0x15')][_0x2bfd('0x16')][_0x2bfd('0x17')]()]['toString']();}});}return _0x51fa06;}function getName(_0x19ffcf){if(_0x19ffcf[_0x2bfd('0x18')]('\x20')>0x0){var _0x3c352b=_0x19ffcf[_0x2bfd('0x19')](/ (.+)/);if(_0x3c352b[0x1]){return _0x3c352b;}}return[_0x19ffcf,_0x19ffcf];}var accountsTokens={};function getAccessToken(_0x518217){return new Promise(function(_0x153943,_0xab1393){if(!_[_0x2bfd('0x1a')](accountsTokens[_0x518217['id']])&&!_[_0x2bfd('0x1a')](accountsTokens[_0x518217['id']][_0x2bfd('0x1b')])){if(moment()['isBefore'](accountsTokens[_0x518217['id']][_0x2bfd('0x1c')])){_0x153943(accountsTokens[_0x518217['id']]['access_token']);}}var _0x3d0729;switch(_0x518217[_0x2bfd('0x1d')]){case'US':_0x3d0729=_0x2bfd('0x1e');break;case'AU':_0x3d0729=_0x2bfd('0x1f');break;case'EU':_0x3d0729=_0x2bfd('0x20');break;case'IN':_0x3d0729='https://accounts.zoho.in';break;case'CN':_0x3d0729=_0x2bfd('0x21');break;default:_0x3d0729='https://accounts.zoho.eu';break;}var _0x309d17={'method':_0x2bfd('0x22'),'uri':_0x3d0729+_0x2bfd('0x23'),'qs':{'refresh_token':_0x518217[_0x2bfd('0x24')],'client_id':_0x518217[_0x2bfd('0x25')],'client_secret':_0x518217[_0x2bfd('0x26')],'grant_type':_0x2bfd('0x27')},'json':!![]};return rp(_0x309d17)[_0x2bfd('0x28')](function(_0x56b454){accountsTokens[_0x518217['id']]={'access_token':_0x56b454[_0x2bfd('0x1b')],'expires_in':moment()[_0x2bfd('0x29')](_0x56b454[_0x2bfd('0x1c')],_0x2bfd('0x2a'))};_0x153943(_0x56b454[_0x2bfd('0x1b')]);})[_0x2bfd('0x2b')](function(_0x698be8){logger[_0x2bfd('0x2c')]('Failing\x20creating\x20the\x20access_token',_0x698be8[_0x2bfd('0x2d')]);_0xab1393(_0x698be8);});});}function getUser(_0x3356c1,_0x7f7bd4,_0x58beb4,_0xe84c10){logger[_0x2bfd('0x2e')](_0x2bfd('0x2f'));return request({'method':_0x2bfd('0x30'),'uri':util[_0x2bfd('0x31')]('https://www.zohoapis.%s/crm/v2/users',_0x7f7bd4),'qs':{'type':_0x2bfd('0x32')},'headers':{'Authorization':_0x2bfd('0x33')+_0x3356c1},'json':!![]})[_0x2bfd('0x28')](function(_0x383977){if(_0x383977[_0x2bfd('0x34')]){var _0x5df282=-0x1;if(_[_0x2bfd('0x35')](_0x383977['users'])){if(!_[_0x2bfd('0x1a')](_0xe84c10)){_0x5df282=_[_0x2bfd('0x36')](_0x383977[_0x2bfd('0x34')],function(_0x59722d){return _0x59722d['email']===_0xe84c10;});}if(_0x5df282>=0x0){logger[_0x2bfd('0x2e')]('Agent\x20found!');}else{logger[_0x2bfd('0x2e')](_0x2bfd('0x37'));_0x5df282=_[_0x2bfd('0x36')](_0x383977[_0x2bfd('0x34')],function(_0x2ab379){return _0x2ab379['profile']['name']==='Administrator';});}return _0x383977[_0x2bfd('0x34')][_0x5df282];}else{if(_0x383977[_0x2bfd('0x38')][_0x2bfd('0x39')][_0x2bfd('0x16')]===_0x2bfd('0x3a')){logger[_0x2bfd('0x2e')](_0x2bfd('0x37'));user=_0x383977[_0x2bfd('0x38')];return user;}else{logger['error']('The\x20failing\x20result\x20is',JSON['stringify'](_0x383977));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON['stringify'](_0x383977));}}}else{logger[_0x2bfd('0x2c')]('The\x20failing\x20result\x20is',JSON['stringify'](_0x383977));throw new Error(_0x2bfd('0x3b')+JSON[_0x2bfd('0xc')](_0x383977));}})[_0x2bfd('0x2b')](function(_0x2c4c70){console[_0x2bfd('0x2c')](_0x2c4c70);});}function getZohoUser(_0x3e7ad1,_0x361ec6){return new BPromise(function(_0x4cf152,_0x4a7925){request(_0x3e7ad1)[_0x2bfd('0x28')](function(_0x1f0756){var _0x43f4e6=null;if(_0x1f0756){_0x43f4e6=_0x1f0756[_0x2bfd('0x3c')][0x0];_0x43f4e6[_0x2bfd('0x3d')]=_0x361ec6;}_0x4cf152(_0x43f4e6);})['catch'](function(_0x50ad5a){_0x4a7925(_0x50ad5a);});});}function createEndUser(_0xaf4957,_0xc17e17,_0x159fb9,_0x36f554,_0x807f83,_0x181f25){var _0x159fb9=getName(_0x159fb9);return request({'method':_0x2bfd('0x22'),'uri':_0x2bfd('0x3e')+_0xc17e17+_0x2bfd('0x3f')+_[_0x2bfd('0x40')](_0x181f25['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0x159fb9[0x1],'First_Name':_0x159fb9[0x0],'Phone':_0x36f554,'Owner':{'name':!_[_0x2bfd('0x1a')](_0x807f83['role'][_0x2bfd('0x16')])?_0x807f83[_0x2bfd('0x41')][_0x2bfd('0x16')]:!_[_0x2bfd('0x1a')](_0x807f83[_0x2bfd('0x42')])?_0x807f83[_0x2bfd('0x42')]+'\x20'+_0x807f83[_0x2bfd('0x43')]:_0x807f83[_0x2bfd('0x43')],'id':_0x807f83['id']}}]},'headers':{'Authorization':_0x2bfd('0x33')+_0xaf4957},'json':!![]})[_0x2bfd('0x28')](function(_0x443419){if(_0x443419&&_0x443419['data'][0x0]['code']===_0x2bfd('0x44')){var _0x3d722a=_0x443419[_0x2bfd('0x3c')][0x0][_0x2bfd('0x45')];_0x3d722a[_0x2bfd('0x3d')]=_['startCase'](_0x181f25[_0x2bfd('0x46')])+'s';return _0x3d722a;}logger[_0x2bfd('0x2c')]('The\x20failing\x20result\x20is',JSON[_0x2bfd('0xc')](data));throw new Error(_0x2bfd('0x47')+JSON[_0x2bfd('0xc')](data));})[_0x2bfd('0x2b')](function(_0x29f416){console[_0x2bfd('0x48')](_0x2bfd('0x49'),_0x29f416);});}function getEndUser(_0x2eb933,_0x10444f,_0x3014fd,_0xaa6d2b,_0x261b3d,_0xaea63a,_0x30ca33){var _0x29bd27={'method':'GET','uri':'','headers':{'Authorization':_0x2bfd('0x33')+_0x2eb933},'json':!![]};switch(_0x30ca33[_0x2bfd('0x4a')]){case _0x2bfd('0x4b'):_0x29bd27[_0x2bfd('0x4c')]=_0x2bfd('0x3e')+_0x10444f+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x261b3d+'))';return getZohoUser(_0x29bd27,_0x2bfd('0x4d'))['then'](function(_0x4de9c7){if(_0x4de9c7)return _0x4de9c7;_0x29bd27['uri']=_0x2bfd('0x3e')+_0x10444f+_0x2bfd('0x4e')+_0x261b3d+'))';return getZohoUser(_0x29bd27,_0x2bfd('0x4f'))[_0x2bfd('0x28')](function(_0x16c2d4){if(_0x16c2d4)return _0x16c2d4;if(_0x30ca33[_0x2bfd('0x46')]!='nothing'){return createEndUser(_0x2eb933,_0x10444f,_0xaa6d2b,_0x261b3d,_0xaea63a,_0x30ca33);}else{return{};}});});break;case _0x2bfd('0x50'):_0x29bd27[_0x2bfd('0x4c')]=_0x2bfd('0x3e')+_0x10444f+_0x2bfd('0x51')+_0x261b3d+'))';return getZohoUser(_0x29bd27,'Contacts')[_0x2bfd('0x28')](function(_0x2a788d){if(_0x2a788d)return _0x2a788d;if(_0x30ca33[_0x2bfd('0x46')]!=_0x2bfd('0x52')){return createEndUser(_0x2eb933,_0x10444f,_0xaa6d2b,_0x261b3d,_0xaea63a,_0x30ca33);}else{return{};}});break;case _0x2bfd('0x53'):_0x29bd27[_0x2bfd('0x4c')]=_0x2bfd('0x3e')+_0x10444f+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x261b3d+'))';return getZohoUser(_0x29bd27,'Leads')[_0x2bfd('0x28')](function(_0x3a268b){if(_0x3a268b)return _0x3a268b;if(_0x30ca33['moduleCreate']!=_0x2bfd('0x52')){return createEndUser(_0x2eb933,_0x10444f,_0xaa6d2b,_0x261b3d,_0xaea63a,_0x30ca33);}else{return{};}});break;}}function getCall(_0x349ffb,_0x2c2b40,_0x4ee025,_0x2f6249,_0x585880,_0x59b75b,_0x2148ac,_0x107524){logger[_0x2bfd('0x2e')](_0x2bfd('0x54'));var _0x22c55e={};_0x22c55e[_0x2bfd('0x55')]={'name':!_[_0x2bfd('0x1a')](_0x2f6249[_0x2bfd('0x41')][_0x2bfd('0x16')])&&!_[_0x2bfd('0x1a')](_0x2f6249['profile'][_0x2bfd('0x16')])&&_0x2f6249['profile'][_0x2bfd('0x16')]===_0x2bfd('0x56')?_0x2f6249[_0x2bfd('0x41')][_0x2bfd('0x16')]:!_[_0x2bfd('0x1a')](_0x2f6249['first_name'])?_0x2f6249['first_name']+'\x20'+_0x2f6249[_0x2bfd('0x43')]:_0x2f6249['last_name'],'id':_0x2f6249['id']};_0x22c55e['Subject']=intUtil[_0x2bfd('0x57')](_0x59b75b[_0x2bfd('0x58')],_0x2148ac,'\x20');_0x22c55e['Description']=intUtil[_0x2bfd('0x57')](_0x59b75b['Descriptions'],_0x2148ac,'\x0a');if(_0x585880[_0x2bfd('0x3d')]==='Contacts'){_0x22c55e[_0x2bfd('0x59')]={'name':!_[_0x2bfd('0x1a')](_0x585880['Full_Name'])?_0x585880[_0x2bfd('0x5a')]:!_['isNil'](_0x585880['First_Name'])?_0x585880['First_Name']+'\x20'+_0x585880['Last_Name']:_0x585880[_0x2bfd('0x5b')],'id':_0x585880['id']};}if(_0x585880[_0x2bfd('0x3d')]===_0x2bfd('0x4f')){_0x22c55e[_0x2bfd('0x5c')]={'name':!_[_0x2bfd('0x1a')](_0x585880[_0x2bfd('0x5a')])?_0x585880['Full_Name']:!_[_0x2bfd('0x1a')](_0x585880[_0x2bfd('0x5d')])?_0x585880[_0x2bfd('0x5d')]+'\x20'+_0x585880[_0x2bfd('0x5b')]:_0x585880['Last_Name'],'id':_0x585880['id']};_0x22c55e['$se_module']=_[_0x2bfd('0x40')](_0x585880[_0x2bfd('0x3d')]);}if(_0x2148ac[_0x2bfd('0x5e')]){_0x22c55e[_0x2bfd('0x5f')]=moment[_0x2bfd('0x60')](parseInt(_0x2148ac['talktime'])*0x3e8)[_0x2bfd('0x31')](_0x2bfd('0x61'));}else if(_0x2148ac[_0x2bfd('0x62')]&&_0x2148ac['endtime']){_0x22c55e['Call_Duration']=moment[_0x2bfd('0x60')](moment(_0x2148ac[_0x2bfd('0x63')],_0x2bfd('0x64'))[_0x2bfd('0x65')](moment(_0x2148ac['starttime'],_0x2bfd('0x64'))))['format'](_0x2bfd('0x61'));}switch(_0x2148ac[_0x2bfd('0x66')]){case _0x2bfd('0x67'):_0x22c55e[_0x2bfd('0x68')]=_0x2bfd('0x69');break;case _0x2bfd('0x6a'):case _0x2bfd('0x6b'):_0x22c55e['Call_Result']=_0x2bfd('0x6c');break;case _0x2bfd('0x6d'):_0x22c55e[_0x2bfd('0x68')]=_0x2bfd('0x6e');break;case _0x2bfd('0x6f'):_0x22c55e[_0x2bfd('0x68')]=_0x2bfd('0x70');break;default:}_0x22c55e['Call_Start_Time']=(_0x107524===_0x2bfd('0x71')?moment(_0x2148ac[_0x2bfd('0x72')])['format']('YYYY-MM-DDTHH:mm:ss'):moment(_0x2148ac[_0x2bfd('0x73')])['format'](_0x2bfd('0x64')))||moment()[_0x2bfd('0x31')]('YYYY-MM-DDTHH:mm:ss');_0x22c55e[_0x2bfd('0x74')]=_0x107524||_0x2bfd('0x75');_0x22c55e=_[_0x2bfd('0x76')](_0x22c55e,getCustomFields(_0x59b75b['Fields'],_0x2148ac));return request({'method':_0x2bfd('0x22'),'uri':_0x2bfd('0x3e')+_0x2c2b40+_0x2bfd('0x77'),'headers':{'Authorization':_0x2bfd('0x33')+_0x349ffb},'body':{'data':[_0x22c55e]},'json':!![]})[_0x2bfd('0x28')](function(_0x237afe){if(_0x237afe&&_0x237afe[_0x2bfd('0x3c')][0x0]['code']===_0x2bfd('0x44')){logger[_0x2bfd('0x2e')]('Call\x20created!');return{'id':_0x237afe[_0x2bfd('0x3c')][0x0][_0x2bfd('0x45')]['id']};}})['catch'](function(_0xad8f57){logger[_0x2bfd('0x2e')](_0x2bfd('0x78'),_0xad8f57[_0x2bfd('0x2d')]);console['log']('err',_0xad8f57);});}exports[_0x2bfd('0x79')]=function(_0x417eca,_0xa09331,_0x1dfa7b,_0x4399b2,_0x5ec4ba,_0x51a4ae){var _0x481490,_0x922a2d,_0x181a15;_0x51a4ae['host']=intUtil['stripTrailingSlash'](_0x51a4ae['host']);_0x51a4ae[_0x2bfd('0x7a')]=intUtil['stripTrailingSlash'](_0x51a4ae['serverUrl']);if(_0x5ec4ba&&_0x5ec4ba[_0x2bfd('0x7b')]){logger[_0x2bfd('0x2e')](_0x2bfd('0x7c'),_0x2bfd('0x7d'));_0xa09331[_0x2bfd('0x7e')]=_0x51a4ae[_0x2bfd('0x7a')]+'/api/voice/recordings/'+_0xa09331['uniqueid']+'/downloads?type=uniqueid&token='+md5(_0xa09331['uniqueid']);}else{_0xa09331[_0x2bfd('0x7e')]='';}var _0x4ca201=_0x51a4ae[_0x2bfd('0x7f')]==='zoho.eu'?'eu':'com';return getAccessToken(_0x51a4ae)[_0x2bfd('0x28')](function(_0xa25249){_0x181a15=_0xa25249;return getUser(_0x181a15,_0x4ca201,_0x51a4ae,_0x4399b2[_0x2bfd('0x80')]);})[_0x2bfd('0x28')](function(_0x588873){_0x481490=_0x588873;logger[_0x2bfd('0x2e')](_0x2bfd('0x81'),_0x481490['id']);return getEndUser(_0x181a15,_0x4ca201,_0x51a4ae,_0xa09331[_0x2bfd('0x82')],_0xa09331[_0x2bfd('0x83')],_0x481490,_0x1dfa7b);})[_0x2bfd('0x28')](function(_0x214b25){_0x922a2d=_0x214b25;return getCall(_0x181a15,_0x4ca201,_0x51a4ae,_0x481490,_0x922a2d,_0x1dfa7b,_0xa09331,_0x2bfd('0x75'));})[_0x2bfd('0x28')](function(_0x1ec3ca){if(_0x1ec3ca){logger[_0x2bfd('0x2e')](_0x2bfd('0x84'),_0x1ec3ca['id']);logger[_0x2bfd('0x2e')]('[QUEUE]',_0x2bfd('0x85'));emit(util[_0x2bfd('0x31')](_0x2bfd('0x86'),_0x4399b2['name']),_0x2bfd('0x87'),{'uri':_0x2bfd('0x88')+_0x51a4ae[_0x2bfd('0x7f')]+_0x2bfd('0x89')+_0x1ec3ca['id']});}})[_0x2bfd('0x2b')](function(_0x63c0cc){logger['error'](_0x2bfd('0x7c'),JSON[_0x2bfd('0xc')](_0x63c0cc));});};exports['outbound']=function(_0x405b93,_0x32fa6d,_0x1759c0,_0x282716,_0x3a3509,_0x437856,_0x44efc7){var _0x3f7023,_0x3de707,_0x1b4d16;_0x437856[_0x2bfd('0x7f')]=intUtil[_0x2bfd('0x8a')](_0x437856[_0x2bfd('0x7f')]);_0x437856['serverUrl']=intUtil[_0x2bfd('0x8a')](_0x437856[_0x2bfd('0x7a')]);if(_0x44efc7&&_0x44efc7[_0x2bfd('0x8b')]&&_0x44efc7[_0x2bfd('0x8b')]!=='none'){logger[_0x2bfd('0x2e')](_0x2bfd('0x8c'),_0x2bfd('0x7d'));_0x32fa6d[_0x2bfd('0x7e')]=_0x437856[_0x2bfd('0x7a')]+'/api/voice/recordings/'+_0x32fa6d[_0x2bfd('0x8d')]+'/downloads?type=uniqueid&token='+md5(_0x32fa6d['uniqueid']);}var _0x2b4af0=_0x437856[_0x2bfd('0x7f')]===_0x2bfd('0x8e')?'eu':_0x2bfd('0x8f');return getAccessToken(_0x437856)['then'](function(_0x2306dd){_0x1b4d16=_0x2306dd;return getUser(_0x1b4d16,_0x2b4af0,_0x437856,_0x282716[_0x2bfd('0x80')]);})['then'](function(_0x5c9214){_0x3f7023=_0x5c9214;logger[_0x2bfd('0x2e')](_0x2bfd('0x81'),_0x3f7023['id']);return getEndUser(_0x1b4d16,_0x2b4af0,_0x437856,_0x32fa6d[_0x2bfd('0x90')],_0x32fa6d[_0x2bfd('0x91')],_0x3f7023,_0x1759c0);})[_0x2bfd('0x28')](function(_0x6de4cb){_0x3de707=_0x6de4cb;return getCall(_0x1b4d16,_0x2b4af0,_0x437856,_0x3f7023,_0x3de707,_0x1759c0,_0x32fa6d,'Outbound');})[_0x2bfd('0x28')](function(_0x2333dd){if(_0x2333dd){logger[_0x2bfd('0x2e')](_0x2bfd('0x84'),_0x2333dd['id']);logger[_0x2bfd('0x2e')](_0x2bfd('0x8c'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x2bfd('0x86'),_0x282716[_0x2bfd('0x16')]),_0x2bfd('0x87'),{'uri':_0x2bfd('0x88')+_0x437856[_0x2bfd('0x7f')]+'/crm/EntityInfo.do?module=Calls&id='+_0x2333dd['id']});}})[_0x2bfd('0x2b')](function(_0x30b3b2){logger[_0x2bfd('0x2c')](_0x2bfd('0x8c'),JSON[_0x2bfd('0xc')](_0x30b3b2));});};exports[_0x2bfd('0x6f')]=function(_0x58678d,_0x2cc33e,_0x454e53,_0x362ab6,_0x1e064e,_0xdfcd6c){var _0x226e9f,_0x50e845,_0x43b6c8;_0xdfcd6c[_0x2bfd('0x7f')]=intUtil['stripTrailingSlash'](_0xdfcd6c[_0x2bfd('0x7f')]);_0xdfcd6c[_0x2bfd('0x7a')]=intUtil[_0x2bfd('0x8a')](_0xdfcd6c[_0x2bfd('0x7a')]);if(_0x1e064e&&_0x1e064e['monitor_format']){logger[_0x2bfd('0x2e')]('[ABANDONED]',_0x2bfd('0x7d'));_0x2cc33e[_0x2bfd('0x7e')]=_0xdfcd6c['serverUrl']+_0x2bfd('0x92')+_0x2cc33e[_0x2bfd('0x8d')]+_0x2bfd('0x93')+md5(_0x2cc33e[_0x2bfd('0x8d')]);}else{_0x2cc33e[_0x2bfd('0x7e')]='';}var _0xd0214a=_0xdfcd6c['host']==='zoho.eu'?'eu':'com';return getAccessToken(_0xdfcd6c)[_0x2bfd('0x28')](function(_0x586678){_0x43b6c8=_0x586678;return getUser(_0x43b6c8,_0xd0214a,_0xdfcd6c);})[_0x2bfd('0x28')](function(_0x5ce9a1){_0x226e9f=_0x5ce9a1;logger[_0x2bfd('0x2e')]('The\x20User\x20ID\x20is:',_0x226e9f['id']);return getEndUser(_0x43b6c8,_0xd0214a,_0xdfcd6c,_0x2cc33e[_0x2bfd('0x82')],_0x2cc33e[_0x2bfd('0x83')],_0x226e9f,_0x454e53);})[_0x2bfd('0x28')](function(_0x17dd5d){_0x50e845=_0x17dd5d;return getCall(_0x43b6c8,_0xd0214a,_0xdfcd6c,_0x226e9f,_0x50e845,_0x454e53,_0x2cc33e,'Inbound');})[_0x2bfd('0x28')](function(_0x5449e7){if(_0x5449e7){logger[_0x2bfd('0x2e')](_0x2bfd('0x84'),_0x5449e7['id']);}})[_0x2bfd('0x2b')](function(_0x56d27d){logger[_0x2bfd('0x2c')]('[ABANDONED]',JSON['stringify'](_0x56d27d));});}; \ No newline at end of file +var _0x28dd=['/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','contact','nothing','administrator','Subject','Subjects','Description','getString','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','Call_Duration','mm:ss','answertime','endtime','utc','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','called','Call_Result','Called','connect','rejected','Rejected','abandoned','Abandoned','Call_Start_Time','agentcalledAt','merge','Fields','/crm/v2/Calls','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','Inbound','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','https://crm.','[ABANDONED]','lodash','md5','util','moment','ioredis','bluebird','../../../../config/logger','zoho','redis','socket.io-emitter','debug','[HTTP]','stringify','forEach','type','string','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','isNil','access_token','isBefore','expires_in','zone','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','add','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','then','users','email','Agent\x20found!','Using\x20the\x20admin\x20account!','findIndex','profile','Administrator','user','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','The\x20failing\x20result\x20is','data','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','code','SUCCESS','details','enduserType','Error:\x20','log','CREATE\x20ERROR','Zoho-oauthtoken\x20','moduleSearch','contact_lead','uri'];(function(_0x3e69ae,_0x366e8d){var _0x3d7f42=function(_0x5df093){while(--_0x5df093){_0x3e69ae['push'](_0x3e69ae['shift']());}};_0x3d7f42(++_0x366e8d);}(_0x28dd,0xe0));var _0xd28d=function(_0x51b2f1,_0x22c27a){_0x51b2f1=_0x51b2f1-0x0;var _0xf9ddf8=_0x28dd[_0x51b2f1];return _0xf9ddf8;};'use strict';var _=require(_0xd28d('0x0'));var rp=require('request-promise');var md5=require(_0xd28d('0x1'));var util=require(_0xd28d('0x2'));var intUtil=require('./util');var moment=require(_0xd28d('0x3'));var Redis=require(_0xd28d('0x4'));var BPromise=require(_0xd28d('0x5'));var config=require('../../../../config/environment');var logger=require(_0xd28d('0x6'))(_0xd28d('0x7'));config[_0xd28d('0x8')]=_['defaults'](config[_0xd28d('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xd28d('0x9'))(new Redis(config['redis']));function emit(_0x41e964,_0xf919a1,_0x423db5){io['to'](_0x41e964)['emit'](_0xf919a1,_0x423db5);}function request(_0x43b87a){logger[_0xd28d('0xa')](_0xd28d('0xb'),JSON[_0xd28d('0xc')](_0x43b87a));return rp(_0x43b87a);}function getCustomFields(_0x125d04,_0x5462b6){var _0x3ccc52={};if(_0x125d04['length']>0x0){_[_0xd28d('0xd')](_0x125d04,function(_0x23b7c6){if(_0x23b7c6[_0xd28d('0xe')]===_0xd28d('0xf')&&_0x23b7c6[_0xd28d('0x10')]){_0x3ccc52[_0x23b7c6[_0xd28d('0x10')]]=_0x23b7c6[_0xd28d('0x11')][_0xd28d('0x12')]();}else if(_0x23b7c6[_0xd28d('0xe')]===_0xd28d('0x13')&&_0x23b7c6['variableName']&&_0x23b7c6[_0xd28d('0x10')]&&_0x5462b6[_0x23b7c6[_0xd28d('0x14')]]){_0x3ccc52[_0x23b7c6['idField']]=_0x5462b6[_0x23b7c6[_0xd28d('0x14')]][_0xd28d('0x12')]();}else if(_0x23b7c6[_0xd28d('0xe')]===_0xd28d('0x15')&&_0x23b7c6[_0xd28d('0x16')]&&_0x23b7c6['Variable']['name']&&_0x23b7c6['idField']&&_0x5462b6[_0x23b7c6[_0xd28d('0x16')][_0xd28d('0x17')][_0xd28d('0x18')]()]){_0x3ccc52[_0x23b7c6[_0xd28d('0x10')]]=_0x5462b6[_0x23b7c6[_0xd28d('0x16')][_0xd28d('0x17')]['toLowerCase']()][_0xd28d('0x12')]();}});}return _0x3ccc52;}function getName(_0x5be444){if(_0x5be444['indexOf']('\x20')>0x0){var _0x16b4f8=_0x5be444['split'](/ (.+)/);if(_0x16b4f8[0x1]){return _0x16b4f8;}}return[_0x5be444,_0x5be444];}var accountsTokens={};function getAccessToken(_0x37ec2e){return new Promise(function(_0x1ffca8,_0xd3cb34){if(!_['isNil'](accountsTokens[_0x37ec2e['id']])&&!_[_0xd28d('0x19')](accountsTokens[_0x37ec2e['id']][_0xd28d('0x1a')])){if(moment()[_0xd28d('0x1b')](accountsTokens[_0x37ec2e['id']][_0xd28d('0x1c')])){_0x1ffca8(accountsTokens[_0x37ec2e['id']][_0xd28d('0x1a')]);}}var _0x120272;switch(_0x37ec2e[_0xd28d('0x1d')]){case'US':_0x120272=_0xd28d('0x1e');break;case'AU':_0x120272=_0xd28d('0x1f');break;case'EU':_0x120272=_0xd28d('0x20');break;case'IN':_0x120272=_0xd28d('0x21');break;case'CN':_0x120272=_0xd28d('0x22');break;default:_0x120272=_0xd28d('0x20');break;}var _0x436da7={'method':_0xd28d('0x23'),'uri':_0x120272+_0xd28d('0x24'),'qs':{'refresh_token':_0x37ec2e[_0xd28d('0x25')],'client_id':_0x37ec2e[_0xd28d('0x26')],'client_secret':_0x37ec2e[_0xd28d('0x27')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x436da7)['then'](function(_0x469fc4){accountsTokens[_0x37ec2e['id']]={'access_token':_0x469fc4['access_token'],'expires_in':moment()[_0xd28d('0x28')](_0x469fc4[_0xd28d('0x1c')],'seconds')};_0x1ffca8(_0x469fc4[_0xd28d('0x1a')]);})[_0xd28d('0x29')](function(_0x100122){logger[_0xd28d('0x2a')](_0xd28d('0x2b'),_0x100122[_0xd28d('0x2c')]);_0xd3cb34(_0x100122);});});}function getUser(_0x462ad8,_0x5a33e2,_0x45e9ce,_0x52a487){logger[_0xd28d('0x2d')]('Search\x20user');return request({'method':_0xd28d('0x2e'),'uri':util[_0xd28d('0x2f')](_0xd28d('0x30'),_0x5a33e2),'qs':{'type':_0xd28d('0x31')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x462ad8},'json':!![]})[_0xd28d('0x32')](function(_0x157997){if(_0x157997[_0xd28d('0x33')]){var _0x17b40f=-0x1;if(_['isArrayLikeObject'](_0x157997[_0xd28d('0x33')])){if(!_[_0xd28d('0x19')](_0x52a487)){_0x17b40f=_['findIndex'](_0x157997['users'],function(_0x1ea29e){return _0x1ea29e[_0xd28d('0x34')]===_0x52a487;});}if(_0x17b40f>=0x0){logger[_0xd28d('0x2d')](_0xd28d('0x35'));}else{logger['info'](_0xd28d('0x36'));_0x17b40f=_[_0xd28d('0x37')](_0x157997[_0xd28d('0x33')],function(_0x57baf5){return _0x57baf5[_0xd28d('0x38')][_0xd28d('0x17')]===_0xd28d('0x39');});}return _0x157997[_0xd28d('0x33')][_0x17b40f];}else{if(_0x157997[_0xd28d('0x3a')][_0xd28d('0x38')][_0xd28d('0x17')]==='Administrator'){logger['info'](_0xd28d('0x36'));user=_0x157997['user'];return user;}else{logger['error']('The\x20failing\x20result\x20is',JSON['stringify'](_0x157997));throw new Error(_0xd28d('0x3b')+JSON['stringify'](_0x157997));}}}else{logger[_0xd28d('0x2a')](_0xd28d('0x3c'),JSON[_0xd28d('0xc')](_0x157997));throw new Error(_0xd28d('0x3b')+JSON[_0xd28d('0xc')](_0x157997));}})['catch'](function(_0x2f5ad2){console['error'](_0x2f5ad2);});}function getZohoUser(_0x3ac17b,_0x40d1d3){return new BPromise(function(_0x51f004,_0x54edcf){request(_0x3ac17b)[_0xd28d('0x32')](function(_0x19cc44){var _0x15eb48=null;if(_0x19cc44){_0x15eb48=_0x19cc44[_0xd28d('0x3d')][0x0];_0x15eb48['enduserType']=_0x40d1d3;}_0x51f004(_0x15eb48);})[_0xd28d('0x29')](function(_0x47070f){_0x54edcf(_0x47070f);});});}function createEndUser(_0x4c91cb,_0x5b5e45,_0x4ede08,_0x138e91,_0x5a8e56,_0x2560b8){var _0x4ede08=getName(_0x4ede08);return request({'method':_0xd28d('0x23'),'uri':_0xd28d('0x3e')+_0x5b5e45+_0xd28d('0x3f')+_[_0xd28d('0x40')](_0x2560b8[_0xd28d('0x41')])+'s','body':{'data':[{'Last_Name':_0x4ede08[0x1],'First_Name':_0x4ede08[0x0],'Phone':_0x138e91,'Owner':{'name':!_[_0xd28d('0x19')](_0x5a8e56[_0xd28d('0x42')][_0xd28d('0x17')])?_0x5a8e56[_0xd28d('0x42')][_0xd28d('0x17')]:!_[_0xd28d('0x19')](_0x5a8e56['first_name'])?_0x5a8e56[_0xd28d('0x43')]+'\x20'+_0x5a8e56[_0xd28d('0x44')]:_0x5a8e56[_0xd28d('0x44')],'id':_0x5a8e56['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x4c91cb},'json':!![]})[_0xd28d('0x32')](function(_0x10cc06){if(_0x10cc06&&_0x10cc06['data'][0x0][_0xd28d('0x45')]===_0xd28d('0x46')){var _0x1b7fc0=_0x10cc06['data'][0x0][_0xd28d('0x47')];_0x1b7fc0[_0xd28d('0x48')]=_[_0xd28d('0x40')](_0x2560b8[_0xd28d('0x41')])+'s';return _0x1b7fc0;}logger[_0xd28d('0x2a')](_0xd28d('0x3c'),JSON[_0xd28d('0xc')](data));throw new Error(_0xd28d('0x49')+JSON[_0xd28d('0xc')](data));})[_0xd28d('0x29')](function(_0x1b9f12){console[_0xd28d('0x4a')](_0xd28d('0x4b'),_0x1b9f12);});}function getEndUser(_0x3bacba,_0x1f2621,_0x4964,_0x56abfe,_0x139314,_0x12c86c,_0x363114){var _0x41c965={'method':_0xd28d('0x2e'),'uri':'','headers':{'Authorization':_0xd28d('0x4c')+_0x3bacba},'json':!![]};switch(_0x363114[_0xd28d('0x4d')]){case _0xd28d('0x4e'):_0x41c965[_0xd28d('0x4f')]=_0xd28d('0x3e')+_0x1f2621+_0xd28d('0x50')+_0x139314+'))';return getZohoUser(_0x41c965,_0xd28d('0x51'))[_0xd28d('0x32')](function(_0x306e7a){if(_0x306e7a)return _0x306e7a;_0x41c965[_0xd28d('0x4f')]=_0xd28d('0x3e')+_0x1f2621+_0xd28d('0x52')+_0x139314+'))';return getZohoUser(_0x41c965,_0xd28d('0x53'))['then'](function(_0x4ef59){if(_0x4ef59)return _0x4ef59;if(_0x363114['moduleCreate']!='nothing'){return createEndUser(_0x3bacba,_0x1f2621,_0x56abfe,_0x139314,_0x12c86c,_0x363114);}else{return{};}});});break;case _0xd28d('0x54'):_0x41c965[_0xd28d('0x4f')]=_0xd28d('0x3e')+_0x1f2621+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x139314+'))';return getZohoUser(_0x41c965,_0xd28d('0x51'))[_0xd28d('0x32')](function(_0x4c42bc){if(_0x4c42bc)return _0x4c42bc;if(_0x363114[_0xd28d('0x41')]!=_0xd28d('0x55')){return createEndUser(_0x3bacba,_0x1f2621,_0x56abfe,_0x139314,_0x12c86c,_0x363114);}else{return{};}});break;case'lead':_0x41c965[_0xd28d('0x4f')]=_0xd28d('0x3e')+_0x1f2621+_0xd28d('0x52')+_0x139314+'))';return getZohoUser(_0x41c965,_0xd28d('0x53'))['then'](function(_0x3c9046){if(_0x3c9046)return _0x3c9046;if(_0x363114['moduleCreate']!=_0xd28d('0x55')){return createEndUser(_0x3bacba,_0x1f2621,_0x56abfe,_0x139314,_0x12c86c,_0x363114);}else{return{};}});break;}}function getCall(_0x4654e4,_0x2b2fb7,_0x1525b3,_0x4c4e40,_0x5e8873,_0x919e1c,_0x7b2181,_0x20a1dc){logger['info']('Creating\x20new\x20call...');var _0x338fd8={};_0x338fd8['Owner']={'name':!_['isNil'](_0x4c4e40[_0xd28d('0x42')]['name'])&&!_['isNil'](_0x4c4e40[_0xd28d('0x38')][_0xd28d('0x17')])&&_0x4c4e40['profile'][_0xd28d('0x17')]===_0xd28d('0x56')?_0x4c4e40[_0xd28d('0x42')][_0xd28d('0x17')]:!_[_0xd28d('0x19')](_0x4c4e40[_0xd28d('0x43')])?_0x4c4e40[_0xd28d('0x43')]+'\x20'+_0x4c4e40[_0xd28d('0x44')]:_0x4c4e40['last_name'],'id':_0x4c4e40['id']};_0x338fd8[_0xd28d('0x57')]=intUtil['getString'](_0x919e1c[_0xd28d('0x58')],_0x7b2181,'\x20');_0x338fd8[_0xd28d('0x59')]=intUtil[_0xd28d('0x5a')](_0x919e1c[_0xd28d('0x5b')],_0x7b2181,'\x0a');if(_0x5e8873[_0xd28d('0x48')]==='Contacts'){_0x338fd8[_0xd28d('0x5c')]={'name':!_['isNil'](_0x5e8873[_0xd28d('0x5d')])?_0x5e8873['Full_Name']:!_['isNil'](_0x5e8873['First_Name'])?_0x5e8873[_0xd28d('0x5e')]+'\x20'+_0x5e8873[_0xd28d('0x5f')]:_0x5e8873['Last_Name'],'id':_0x5e8873['id']};}if(_0x5e8873[_0xd28d('0x48')]===_0xd28d('0x53')){_0x338fd8[_0xd28d('0x60')]={'name':!_[_0xd28d('0x19')](_0x5e8873[_0xd28d('0x5d')])?_0x5e8873[_0xd28d('0x5d')]:!_['isNil'](_0x5e8873[_0xd28d('0x5e')])?_0x5e8873[_0xd28d('0x5e')]+'\x20'+_0x5e8873[_0xd28d('0x5f')]:_0x5e8873['Last_Name'],'id':_0x5e8873['id']};_0x338fd8[_0xd28d('0x61')]=_[_0xd28d('0x40')](_0x5e8873[_0xd28d('0x48')]);}if(_0x7b2181[_0xd28d('0x62')]){_0x338fd8[_0xd28d('0x63')]=moment['utc'](parseInt(_0x7b2181[_0xd28d('0x62')])*0x3e8)[_0xd28d('0x2f')](_0xd28d('0x64'));}else if(_0x7b2181[_0xd28d('0x65')]&&_0x7b2181[_0xd28d('0x66')]){_0x338fd8[_0xd28d('0x63')]=moment[_0xd28d('0x67')](moment(_0x7b2181[_0xd28d('0x66')],_0xd28d('0x68'))[_0xd28d('0x69')](moment(_0x7b2181[_0xd28d('0x6a')],_0xd28d('0x68'))))[_0xd28d('0x2f')]('mm:ss');}switch(_0x7b2181[_0xd28d('0x6b')]){case _0xd28d('0x6c'):_0x338fd8[_0xd28d('0x6d')]=_0xd28d('0x6e');break;case'complete':case _0xd28d('0x6f'):_0x338fd8[_0xd28d('0x6d')]='Answered';break;case _0xd28d('0x70'):_0x338fd8[_0xd28d('0x6d')]=_0xd28d('0x71');break;case _0xd28d('0x72'):_0x338fd8['Call_Result']=_0xd28d('0x73');break;default:}_0x338fd8[_0xd28d('0x74')]=(_0x20a1dc==='outbound'?moment(_0x7b2181[_0xd28d('0x6a')])['format'](_0xd28d('0x68')):moment(_0x7b2181[_0xd28d('0x75')])['format'](_0xd28d('0x68')))||moment()[_0xd28d('0x2f')](_0xd28d('0x68'));_0x338fd8['Call_Type']=_0x20a1dc||'Inbound';_0x338fd8=_[_0xd28d('0x76')](_0x338fd8,getCustomFields(_0x919e1c[_0xd28d('0x77')],_0x7b2181));return request({'method':_0xd28d('0x23'),'uri':_0xd28d('0x3e')+_0x2b2fb7+_0xd28d('0x78'),'headers':{'Authorization':_0xd28d('0x4c')+_0x4654e4},'body':{'data':[_0x338fd8]},'json':!![]})[_0xd28d('0x32')](function(_0x1daa5a){if(_0x1daa5a&&_0x1daa5a[_0xd28d('0x3d')][0x0][_0xd28d('0x45')]===_0xd28d('0x46')){logger[_0xd28d('0x2d')](_0xd28d('0x79'));return{'id':_0x1daa5a[_0xd28d('0x3d')][0x0][_0xd28d('0x47')]['id']};}})[_0xd28d('0x29')](function(_0x1b2a74){logger[_0xd28d('0x2d')](_0xd28d('0x7a'),_0x1b2a74[_0xd28d('0x2c')]);console[_0xd28d('0x4a')]('err',_0x1b2a74);});}exports[_0xd28d('0x7b')]=function(_0x4ee00b,_0x369941,_0x585837,_0x3b8b8f,_0x2e6115,_0x1773a0){var _0x57d3de,_0x5f2041,_0x6272b9;_0x1773a0[_0xd28d('0x7c')]=intUtil[_0xd28d('0x7d')](_0x1773a0[_0xd28d('0x7c')]);_0x1773a0[_0xd28d('0x7e')]=intUtil['stripTrailingSlash'](_0x1773a0[_0xd28d('0x7e')]);if(_0x2e6115&&_0x2e6115[_0xd28d('0x7f')]){logger['info'](_0xd28d('0x80'),_0xd28d('0x81'));_0x369941[_0xd28d('0x82')]=_0x1773a0[_0xd28d('0x7e')]+_0xd28d('0x83')+_0x369941[_0xd28d('0x84')]+_0xd28d('0x85')+md5(_0x369941[_0xd28d('0x84')]);}else{_0x369941[_0xd28d('0x82')]='';}var _0x5ef512=_0x1773a0[_0xd28d('0x7c')]===_0xd28d('0x86')?'eu':_0xd28d('0x87');return getAccessToken(_0x1773a0)[_0xd28d('0x32')](function(_0x4aa529){_0x6272b9=_0x4aa529;return getUser(_0x6272b9,_0x5ef512,_0x1773a0,_0x3b8b8f[_0xd28d('0x34')]);})[_0xd28d('0x32')](function(_0x2908b2){_0x57d3de=_0x2908b2;logger['info'](_0xd28d('0x88'),_0x57d3de['id']);return getEndUser(_0x6272b9,_0x5ef512,_0x1773a0,_0x369941[_0xd28d('0x89')],_0x369941['calleridnum'],_0x57d3de,_0x585837);})['then'](function(_0x438009){_0x5f2041=_0x438009;return getCall(_0x6272b9,_0x5ef512,_0x1773a0,_0x57d3de,_0x5f2041,_0x585837,_0x369941,_0xd28d('0x8a'));})[_0xd28d('0x32')](function(_0x2956e6){if(_0x2956e6){logger[_0xd28d('0x2d')](_0xd28d('0x8b'),_0x2956e6['id']);logger['info'](_0xd28d('0x80'),_0xd28d('0x8c'));emit(util[_0xd28d('0x2f')](_0xd28d('0x8d'),_0x3b8b8f['name']),_0xd28d('0x8e'),{'uri':'https://crm.'+_0x1773a0[_0xd28d('0x7c')]+_0xd28d('0x8f')+_0x2956e6['id']});}})[_0xd28d('0x29')](function(_0xf44db2){logger[_0xd28d('0x2a')](_0xd28d('0x80'),JSON['stringify'](_0xf44db2));});};exports['outbound']=function(_0x10a1cd,_0x2674ee,_0x35d532,_0x18436d,_0x2903e9,_0x4970ae,_0x1cb232){var _0x2289a7,_0x5e6a4f,_0x415e56;_0x4970ae[_0xd28d('0x7c')]=intUtil[_0xd28d('0x7d')](_0x4970ae[_0xd28d('0x7c')]);_0x4970ae[_0xd28d('0x7e')]=intUtil[_0xd28d('0x7d')](_0x4970ae[_0xd28d('0x7e')]);if(_0x1cb232&&_0x1cb232[_0xd28d('0x90')]&&_0x1cb232[_0xd28d('0x90')]!==_0xd28d('0x91')){logger[_0xd28d('0x2d')](_0xd28d('0x92'),'Recording\x20is\x20enabled!');_0x2674ee[_0xd28d('0x82')]=_0x4970ae[_0xd28d('0x7e')]+'/api/voice/recordings/'+_0x2674ee[_0xd28d('0x84')]+'/downloads?type=uniqueid&token='+md5(_0x2674ee['uniqueid']);}var _0x277102=_0x4970ae['host']===_0xd28d('0x86')?'eu':_0xd28d('0x87');return getAccessToken(_0x4970ae)[_0xd28d('0x32')](function(_0x573c7e){_0x415e56=_0x573c7e;return getUser(_0x415e56,_0x277102,_0x4970ae,_0x18436d[_0xd28d('0x34')]);})[_0xd28d('0x32')](function(_0x2cdafd){_0x2289a7=_0x2cdafd;logger[_0xd28d('0x2d')](_0xd28d('0x88'),_0x2289a7['id']);return getEndUser(_0x415e56,_0x277102,_0x4970ae,_0x2674ee[_0xd28d('0x93')],_0x2674ee[_0xd28d('0x94')],_0x2289a7,_0x35d532);})[_0xd28d('0x32')](function(_0x13d7d8){_0x5e6a4f=_0x13d7d8;return getCall(_0x415e56,_0x277102,_0x4970ae,_0x2289a7,_0x5e6a4f,_0x35d532,_0x2674ee,_0xd28d('0x95'));})[_0xd28d('0x32')](function(_0x4baedd){if(_0x4baedd){logger[_0xd28d('0x2d')](_0xd28d('0x8b'),_0x4baedd['id']);logger['info'](_0xd28d('0x92'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xd28d('0x2f')]('user:%s',_0x18436d[_0xd28d('0x17')]),'trigger:browser:url',{'uri':_0xd28d('0x96')+_0x4970ae[_0xd28d('0x7c')]+_0xd28d('0x8f')+_0x4baedd['id']});}})[_0xd28d('0x29')](function(_0x1fe169){logger[_0xd28d('0x2a')]('[OUTBOUND]',JSON[_0xd28d('0xc')](_0x1fe169));});};exports[_0xd28d('0x72')]=function(_0x1a49b6,_0x587ac3,_0xc187ac,_0x15d3c7,_0x2519e9,_0x5c63c2){var _0x553ad1,_0x555ce8,_0xf19e42;_0x5c63c2[_0xd28d('0x7c')]=intUtil['stripTrailingSlash'](_0x5c63c2[_0xd28d('0x7c')]);_0x5c63c2[_0xd28d('0x7e')]=intUtil[_0xd28d('0x7d')](_0x5c63c2[_0xd28d('0x7e')]);if(_0x2519e9&&_0x2519e9['monitor_format']){logger[_0xd28d('0x2d')](_0xd28d('0x97'),_0xd28d('0x81'));_0x587ac3[_0xd28d('0x82')]=_0x5c63c2[_0xd28d('0x7e')]+_0xd28d('0x83')+_0x587ac3['uniqueid']+_0xd28d('0x85')+md5(_0x587ac3[_0xd28d('0x84')]);}else{_0x587ac3[_0xd28d('0x82')]='';}var _0x35876c=_0x5c63c2[_0xd28d('0x7c')]===_0xd28d('0x86')?'eu':_0xd28d('0x87');return getAccessToken(_0x5c63c2)[_0xd28d('0x32')](function(_0x5b4fc4){_0xf19e42=_0x5b4fc4;return getUser(_0xf19e42,_0x35876c,_0x5c63c2);})[_0xd28d('0x32')](function(_0x6de694){_0x553ad1=_0x6de694;logger[_0xd28d('0x2d')](_0xd28d('0x88'),_0x553ad1['id']);return getEndUser(_0xf19e42,_0x35876c,_0x5c63c2,_0x587ac3['calleridname'],_0x587ac3['calleridnum'],_0x553ad1,_0xc187ac);})[_0xd28d('0x32')](function(_0x188edc){_0x555ce8=_0x188edc;return getCall(_0xf19e42,_0x35876c,_0x5c63c2,_0x553ad1,_0x555ce8,_0xc187ac,_0x587ac3,_0xd28d('0x8a'));})[_0xd28d('0x32')](function(_0x545673){if(_0x545673){logger[_0xd28d('0x2d')](_0xd28d('0x8b'),_0x545673['id']);}})[_0xd28d('0x29')](function(_0x154f4d){logger[_0xd28d('0x2a')](_0xd28d('0x97'),JSON[_0xd28d('0xc')](_0x154f4d));});}; \ 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 7dd2281..1edbaab 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(_0x55400d,_0x3d6b3f){var _0x246535=function(_0xd9f0b1){while(--_0xd9f0b1){_0x55400d['push'](_0x55400d['shift']());}};_0x246535(++_0x3d6b3f);}(_0x7a54,0x106));var _0x47a5=function(_0x3757c8,_0x5c8dcb){_0x3757c8=_0x3757c8-0x0;var _0x285bbc=_0x7a54[_0x3757c8];return _0x285bbc;};'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(_0x122728,_0x3f1db0){var _0x398bae=function(_0x596665){while(--_0x596665){_0x122728['push'](_0x122728['shift']());}};_0x398bae(++_0x3f1db0);}(_0x7a54,0x106));var _0x47a5=function(_0x4c803e,_0x676d29){_0x4c803e=_0x4c803e-0x0;var _0xcadbcd=_0x7a54[_0x4c803e];return _0xcadbcd;};'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 c8a4de5..1e73028 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 _0xb10b=['number','headers','data6','parse','error','stack','DELETE','POST','PUT','data7','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','data2','stringify','then','isNil',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','data1','statusCode','name','message','request-promise','lodash','mustache','../../../../config/logger','exec','toUpperCase','render','data5'];(function(_0x484e0f,_0x273fbb){var _0x4890f6=function(_0x17580a){while(--_0x17580a){_0x484e0f['push'](_0x484e0f['shift']());}};_0x4890f6(++_0x273fbb);}(_0xb10b,0x12a));var _0xbb10=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0xb10b[_0x4792c8];return _0x35edb1;};'use strict';var rp=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var Mustache=require(_0xbb10('0x2'));var logger=require(_0xbb10('0x3'))('trigger');exports[_0xbb10('0x4')]=function(_0x9bbed,_0x460981){var _0x22320e,_0x49baf4;var _0x312b72={'method':_0x9bbed['data1'][_0xbb10('0x5')](),'uri':Mustache[_0xbb10('0x6')](_0x9bbed['data2'],_0x460981),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x9bbed[_0xbb10('0x7')])===_0xbb10('0x8')&&parseInt(_0x9bbed[_0xbb10('0x7')])>=0x1&&parseInt(_0x9bbed[_0xbb10('0x7')])<=0xa?parseInt(_0x9bbed[_0xbb10('0x7')])*0x3e8:0x5*0x3e8};try{_0x312b72[_0xbb10('0x9')]=_0x9bbed[_0xbb10('0xa')]?JSON[_0xbb10('0xb')](Mustache['render'](_0x9bbed['data6'],_0x460981)):{};}catch(_0x20bd61){logger[_0xbb10('0xc')](_0x20bd61[_0xbb10('0xd')]);}switch(_0x9bbed['data1'][_0xbb10('0x5')]()){case'GET':case _0xbb10('0xe'):_0x22320e=null;_0x312b72['qs']=_0x460981;break;case _0xbb10('0xf'):case _0xbb10('0x10'):if(_0x9bbed[_0xbb10('0x11')]){try{_0x22320e=JSON[_0xbb10('0xb')](Mustache[_0xbb10('0x6')](_0x9bbed['data7'],_0x460981));_0x312b72[_0xbb10('0x12')]=_0x22320e;}catch(_0x42d7e4){logger[_0xbb10('0xc')](_0x42d7e4[_0xbb10('0xd')]);logger[_0xbb10('0xc')](_0xbb10('0x13'));}}else{_0x22320e=_0x460981;_0x312b72[_0xbb10('0x12')]=_0x22320e;}break;}logger[_0xbb10('0x14')](util[_0xbb10('0x15')](_0xbb10('0x16'),_0x9bbed['data1'],_0x9bbed[_0xbb10('0x17')],JSON[_0xbb10('0x18')](_0x312b72)));rp(_0x312b72)[_0xbb10('0x19')](function(_0x42db98){_0x22320e=!_[_0xbb10('0x1a')](_0x22320e)?_0xbb10('0x1b')+_0x22320e:'';_0x49baf4=typeof _0x42db98[_0xbb10('0x12')]===_0xbb10('0x1c')?JSON[_0xbb10('0x18')](_0x42db98[_0xbb10('0x12')]):_0x42db98['body'];logger[_0xbb10('0x14')](util[_0xbb10('0x15')](_0xbb10('0x1d'),_0x9bbed[_0xbb10('0x1e')],_0x9bbed[_0xbb10('0x17')],_0x42db98[_0xbb10('0x1f')],_0x49baf4));})['catch'](function(_0x12f888){logger[_0xbb10('0xc')](util['format']('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x9bbed[_0xbb10('0x1e')],_0x9bbed[_0xbb10('0x17')],_0x12f888[_0xbb10('0x1f')],_0x12f888[_0xbb10('0x20')],_0x12f888[_0xbb10('0x21')]));});}; \ No newline at end of file +var _0xb10b=['number','headers','data6','parse','error','stack','DELETE','POST','PUT','data7','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','data2','stringify','then','isNil',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','data1','statusCode','name','message','request-promise','lodash','mustache','../../../../config/logger','exec','toUpperCase','render','data5'];(function(_0x100f8c,_0x5e830e){var _0x3f1b8a=function(_0x35f575){while(--_0x35f575){_0x100f8c['push'](_0x100f8c['shift']());}};_0x3f1b8a(++_0x5e830e);}(_0xb10b,0x12a));var _0xbb10=function(_0x20fb02,_0x96c029){_0x20fb02=_0x20fb02-0x0;var _0x24a33e=_0xb10b[_0x20fb02];return _0x24a33e;};'use strict';var rp=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var Mustache=require(_0xbb10('0x2'));var logger=require(_0xbb10('0x3'))('trigger');exports[_0xbb10('0x4')]=function(_0x9bbed,_0x460981){var _0x22320e,_0x49baf4;var _0x312b72={'method':_0x9bbed['data1'][_0xbb10('0x5')](),'uri':Mustache[_0xbb10('0x6')](_0x9bbed['data2'],_0x460981),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x9bbed[_0xbb10('0x7')])===_0xbb10('0x8')&&parseInt(_0x9bbed[_0xbb10('0x7')])>=0x1&&parseInt(_0x9bbed[_0xbb10('0x7')])<=0xa?parseInt(_0x9bbed[_0xbb10('0x7')])*0x3e8:0x5*0x3e8};try{_0x312b72[_0xbb10('0x9')]=_0x9bbed[_0xbb10('0xa')]?JSON[_0xbb10('0xb')](Mustache['render'](_0x9bbed['data6'],_0x460981)):{};}catch(_0x20bd61){logger[_0xbb10('0xc')](_0x20bd61[_0xbb10('0xd')]);}switch(_0x9bbed['data1'][_0xbb10('0x5')]()){case'GET':case _0xbb10('0xe'):_0x22320e=null;_0x312b72['qs']=_0x460981;break;case _0xbb10('0xf'):case _0xbb10('0x10'):if(_0x9bbed[_0xbb10('0x11')]){try{_0x22320e=JSON[_0xbb10('0xb')](Mustache[_0xbb10('0x6')](_0x9bbed['data7'],_0x460981));_0x312b72[_0xbb10('0x12')]=_0x22320e;}catch(_0x42d7e4){logger[_0xbb10('0xc')](_0x42d7e4[_0xbb10('0xd')]);logger[_0xbb10('0xc')](_0xbb10('0x13'));}}else{_0x22320e=_0x460981;_0x312b72[_0xbb10('0x12')]=_0x22320e;}break;}logger[_0xbb10('0x14')](util[_0xbb10('0x15')](_0xbb10('0x16'),_0x9bbed['data1'],_0x9bbed[_0xbb10('0x17')],JSON[_0xbb10('0x18')](_0x312b72)));rp(_0x312b72)[_0xbb10('0x19')](function(_0x42db98){_0x22320e=!_[_0xbb10('0x1a')](_0x22320e)?_0xbb10('0x1b')+_0x22320e:'';_0x49baf4=typeof _0x42db98[_0xbb10('0x12')]===_0xbb10('0x1c')?JSON[_0xbb10('0x18')](_0x42db98[_0xbb10('0x12')]):_0x42db98['body'];logger[_0xbb10('0x14')](util[_0xbb10('0x15')](_0xbb10('0x1d'),_0x9bbed[_0xbb10('0x1e')],_0x9bbed[_0xbb10('0x17')],_0x42db98[_0xbb10('0x1f')],_0x49baf4));})['catch'](function(_0x12f888){logger[_0xbb10('0xc')](util['format']('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x9bbed[_0xbb10('0x1e')],_0x9bbed[_0xbb10('0x17')],_0x12f888[_0xbb10('0x1f')],_0x12f888[_0xbb10('0x20')],_0x12f888[_0xbb10('0x21')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 9539284..3104901 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 _0x2208=['http','Request','then','debug','rpc','error','message','result','catch','exports','bluebird','routing'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x2208,0x11e));var _0x8220=function(_0x254527,_0x5dc524){_0x254527=_0x254527-0x0;var _0x4888cf=_0x2208[_0x254527];return _0x4888cf;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x8220('0x0'));var logger=require('../../config/logger')(_0x8220('0x1'));var client=jayson['client'][_0x8220('0x2')]({'port':0x2329});client[_0x8220('0x3')]=function(_0x3d2530,_0x231a4b){return new BPromise(function(_0x464d1c,_0x32703d){return client['request'](_0x3d2530,_0x231a4b)[_0x8220('0x4')](function(_0x4dd1a0){logger[_0x8220('0x5')](_0x8220('0x6'),_0x8220('0x1'),_0x3d2530,_0x231a4b,_0x4dd1a0);if(_0x4dd1a0[_0x8220('0x7')]){logger[_0x8220('0x7')](_0x8220('0x6'),'routing',_0x3d2530,_0x4dd1a0[_0x8220('0x7')][_0x8220('0x8')],_0x231a4b);return _0x32703d(_0x4dd1a0['error'][_0x8220('0x8')]);}else{return _0x464d1c(_0x4dd1a0[_0x8220('0x9')]);}})[_0x8220('0xa')](function(_0x282223){logger[_0x8220('0x7')]('rpc','routing',_0x3d2530,_0x282223,_0x231a4b);return _0x32703d(_0x282223);});});};module[_0x8220('0xb')]=client; \ No newline at end of file +var _0xb31a=['message','exports','jayson/promise','bluebird','../../config/logger','routing','client','http','Request','request','then','debug','error','rpc'];(function(_0x3a3758,_0x4dd8cf){var _0x1a9234=function(_0x3dda22){while(--_0x3dda22){_0x3a3758['push'](_0x3a3758['shift']());}};_0x1a9234(++_0x4dd8cf);}(_0xb31a,0xd4));var _0xab31=function(_0x11e266,_0x2888e9){_0x11e266=_0x11e266-0x0;var _0x462fb1=_0xb31a[_0x11e266];return _0x462fb1;};'use strict';var jayson=require(_0xab31('0x0'));var BPromise=require(_0xab31('0x1'));var logger=require(_0xab31('0x2'))(_0xab31('0x3'));var client=jayson[_0xab31('0x4')][_0xab31('0x5')]({'port':0x2329});client[_0xab31('0x6')]=function(_0x20b002,_0x2addad){return new BPromise(function(_0x37541c,_0xdf523b){return client[_0xab31('0x7')](_0x20b002,_0x2addad)[_0xab31('0x8')](function(_0x2c336b){logger[_0xab31('0x9')]('rpc',_0xab31('0x3'),_0x20b002,_0x2addad,_0x2c336b);if(_0x2c336b[_0xab31('0xa')]){logger[_0xab31('0xa')](_0xab31('0xb'),_0xab31('0x3'),_0x20b002,_0x2c336b[_0xab31('0xa')][_0xab31('0xc')],_0x2addad);return _0xdf523b(_0x2c336b[_0xab31('0xa')][_0xab31('0xc')]);}else{return _0x37541c(_0x2c336b['result']);}})['catch'](function(_0x410969){logger[_0xab31('0xa')]('rpc',_0xab31('0x3'),_0x20b002,_0x410969,_0x2addad);return _0xdf523b(_0x410969);});});};module[_0xab31('0xd')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 63eedf3..f80de53 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 _0x34f2=['listen','Setting','findOne','loginMailFrequency','catch','log','bluebird','./server','./lib/email','./rpc/mailAccount','../../mysqldb','resolve','then','getMailAccounts','initMailAccounts','refresh','mailAccounts'];(function(_0x3b7052,_0x980e05){var _0xfc8bd7=function(_0x2a97c9){while(--_0x2a97c9){_0x3b7052['push'](_0x3b7052['shift']());}};_0xfc8bd7(++_0x980e05);}(_0x34f2,0x15a));var _0x234f=function(_0xa6254,_0x4109dc){_0xa6254=_0xa6254-0x0;var _0x57961d=_0x34f2[_0xa6254];return _0x57961d;};'use strict';var BPromise=require(_0x234f('0x0'));var server=require(_0x234f('0x1'));var Realtime=require('./realtime');var EmailChannel=require(_0x234f('0x2'));var mailAccount=require(_0x234f('0x3'));var realtime=new Realtime();var email=new EmailChannel(realtime);var db=require(_0x234f('0x4'))['db'];function initRealtime(){return BPromise[_0x234f('0x5')]()[_0x234f('0x6')](mailAccount[_0x234f('0x7')]())[_0x234f('0x6')](realtime[_0x234f('0x8')]())[_0x234f('0x6')](function(){email[_0x234f('0x9')](realtime[_0x234f('0xa')]);return realtime;});}function main(){return server[_0x234f('0xb')](realtime,email)[_0x234f('0x6')](function(_0x477918){return initRealtime();})[_0x234f('0x6')](function(_0x514588){return db[_0x234f('0xc')][_0x234f('0xd')]({'attributes':['id','loginMailFrequency'],'raw':!![]});})['then'](function(_0x1c88df){return setInterval(initRealtime,_0x1c88df[_0x234f('0xe')]*0x3e8);})[_0x234f('0xf')](function(_0x362ec1){console[_0x234f('0x10')](_0x362ec1);});}main(); \ No newline at end of file +var _0x5334=['mailAccounts','Setting','findOne','loginMailFrequency','catch','log','bluebird','./server','./realtime','./lib/email','./rpc/mailAccount','resolve','getMailAccounts','then'];(function(_0xb93f4e,_0x3dd863){var _0x20fbcc=function(_0x3acdc0){while(--_0x3acdc0){_0xb93f4e['push'](_0xb93f4e['shift']());}};_0x20fbcc(++_0x3dd863);}(_0x5334,0x84));var _0x4533=function(_0x47df9d,_0x532aed){_0x47df9d=_0x47df9d-0x0;var _0x16971a=_0x5334[_0x47df9d];return _0x16971a;};'use strict';var BPromise=require(_0x4533('0x0'));var server=require(_0x4533('0x1'));var Realtime=require(_0x4533('0x2'));var EmailChannel=require(_0x4533('0x3'));var mailAccount=require(_0x4533('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);var db=require('../../mysqldb')['db'];function initRealtime(){return BPromise[_0x4533('0x5')]()['then'](mailAccount[_0x4533('0x6')]())[_0x4533('0x7')](realtime['initMailAccounts']())['then'](function(){email['refresh'](realtime[_0x4533('0x8')]);return realtime;});}function main(){return server['listen'](realtime,email)['then'](function(_0x487906){return initRealtime();})[_0x4533('0x7')](function(_0x42f94b){return db[_0x4533('0x9')][_0x4533('0xa')]({'attributes':['id',_0x4533('0xb')],'raw':!![]});})[_0x4533('0x7')](function(_0xd417){return setInterval(initRealtime,_0xd417['loginMailFrequency']*0x3e8);})[_0x4533('0xc')](function(_0x2e67b3){console[_0x4533('0xd')](_0x2e67b3);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index f888247..85206d5 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 _0x1344=['imapAccounts','smtp','prototype','emit','key','active','status','Imap','total','isNil','stringify','refresh','hasOwnProperty','handleImapBox','bind','handleImapEmail','end','error','handleImapError','connected','messageStatus','messages','info','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','notify','then','Mail\x20accepted\x20from\x20routing','handleImapEnd','lastSync','sendMail','send','verifySmtp','Smtp','verify','verified','catch','exports','moment','md5','ioredis','../../../config/environment','../../../config/logger','email','redis','defaults','socket.io-emitter','./smtp','start\x20email\x20channel','mailAccounts'];(function(_0x61326c,_0x102e54){var _0x285610=function(_0xc37353){while(--_0xc37353){_0x61326c['push'](_0x61326c['shift']());}};_0x285610(++_0x102e54);}(_0x1344,0x8a));var _0x4134=function(_0x458f09,_0xf2ee90){_0x458f09=_0x458f09-0x0;var _0x1ca565=_0x1344[_0x458f09];return _0x1ca565;};'use strict';var _=require('lodash');var moment=require(_0x4134('0x0'));var BPromise=require('bluebird');var md5=require(_0x4134('0x1'));var Redis=require(_0x4134('0x2'));var config=require(_0x4134('0x3'));var logger=require(_0x4134('0x4'))(_0x4134('0x5'));config[_0x4134('0x6')]=_[_0x4134('0x7')](config[_0x4134('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x4134('0x8'))(new Redis(config['redis']));var EmailImap=require('./imap');var EmailSmtp=require(_0x4134('0x9'));var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x395477){logger['info'](_0x4134('0xa'));this[_0x4134('0xb')]=_0x395477[_0x4134('0xb')];this[_0x4134('0xc')]={};this[_0x4134('0xd')]=new EmailSmtp();}EmailChannel[_0x4134('0xe')][_0x4134('0xf')]=function(_0x1b8550){var _0x4469dd=this[_0x4134('0xb')][_0x1b8550];var _0x5ee2e2={'id':_0x4469dd['id'],'name':_0x4469dd['name'],'key':_0x4469dd[_0x4134('0x10')],'active':_0x4469dd[_0x4134('0x11')],'Imap':{'status':_0x4469dd['Imap'][_0x4134('0x12')],'messageStatus':_0x4469dd['Imap']['messageStatus'],'total':_0x4469dd[_0x4134('0x13')][_0x4134('0x14')]}};if(_[_0x4134('0x15')](md5Accounts[_0x1b8550])){md5Accounts[_0x1b8550]={};}var _0x33f1e8=md5(JSON[_0x4134('0x16')](_0x5ee2e2));if(md5Accounts[_0x1b8550][_0x4134('0x1')]!==_0x33f1e8){md5Accounts[_0x1b8550][_0x4134('0x1')]=_0x33f1e8;io['emit']('mailAccount:update',_0x5ee2e2);}};EmailChannel[_0x4134('0xe')][_0x4134('0x17')]=function(_0xd6c2e1){for(var _0x2ef887 in _0xd6c2e1){if(_0xd6c2e1['hasOwnProperty'](_0x2ef887)){if(_0xd6c2e1[_0x2ef887][_0x4134('0x13')]&&_0xd6c2e1[_0x2ef887][_0x4134('0x11')]){var _0x2f9f2c=_0xd6c2e1[_0x2ef887]['Imap'];if(!this['imapAccounts'][_0x4134('0x18')](_0x2f9f2c['id'])){this[_0x4134('0xc')][_0x2f9f2c['id']]=new EmailImap(_0x2f9f2c,_0xd6c2e1[_0x2ef887][_0x4134('0x5')]);this[_0x4134('0xc')][_0x2f9f2c['id']]['on']('box',this[_0x4134('0x19')][_0x4134('0x1a')](this,_0x2ef887));this['imapAccounts'][_0x2f9f2c['id']]['on'](_0x4134('0x5'),this[_0x4134('0x1b')][_0x4134('0x1a')](this,_0x2ef887));this['imapAccounts'][_0x2f9f2c['id']]['on'](_0x4134('0x1c'),this['handleImapEnd'][_0x4134('0x1a')](this,_0x2ef887));this['imapAccounts'][_0x2f9f2c['id']]['on'](_0x4134('0x1d'),this[_0x4134('0x1e')][_0x4134('0x1a')](this,_0x2ef887));}}else{if(_[_0x4134('0x15')](this['mailAccounts'][_0x2ef887][_0x4134('0x13')])){this[_0x4134('0xb')][_0x2ef887]['Imap']={};}this[_0x4134('0xb')][_0x2ef887][_0x4134('0x13')][_0x4134('0x12')]='disabled';this[_0x4134('0xb')][_0x2ef887][_0x4134('0x13')]['messageStatus']='';this['emit'](_0x2ef887);}}}};EmailChannel[_0x4134('0xe')][_0x4134('0x19')]=function(_0x36cd8e,_0x4e31d9){if(this['mailAccounts'][_0x36cd8e]){this[_0x4134('0xb')][_0x36cd8e][_0x4134('0x13')][_0x4134('0x12')]=_0x4134('0x1f');this[_0x4134('0xb')][_0x36cd8e][_0x4134('0x13')][_0x4134('0x20')]=_0x4e31d9['name'];if(_0x4e31d9[_0x4134('0x21')]){this[_0x4134('0xb')][_0x36cd8e][_0x4134('0x13')][_0x4134('0x14')]=_0x4e31d9[_0x4134('0x21')][_0x4134('0x14')];}return this[_0x4134('0xf')](_0x36cd8e);}};EmailChannel['prototype']['handleImapEmail']=function(_0x1085ba,_0x175e34){logger[_0x4134('0x22')](_0x4134('0x23'),_0x175e34[_0x4134('0x24')],_0x175e34['lastName'],_0x175e34['from'],_0x1085ba);if(this['mailAccounts'][_0x1085ba]){return mailAccount[_0x4134('0x25')](_0x1085ba,_0x175e34)[_0x4134('0x26')](function(_0x494b5a){if(_0x494b5a){logger['info'](_0x4134('0x27'));}})['catch'](function(_0x2ee218){logger[_0x4134('0x1d')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0x4134('0x16')](_0x2ee218));});}};EmailChannel[_0x4134('0xe')][_0x4134('0x28')]=function(_0x241c08){if(this[_0x4134('0xb')][_0x241c08]&&this['mailAccounts'][_0x241c08][_0x4134('0x13')]){if(this[_0x4134('0xc')][this[_0x4134('0xb')][_0x241c08]['Imap']['id']]){delete this[_0x4134('0xc')][this[_0x4134('0xb')][_0x241c08][_0x4134('0x13')]['id']];}this[_0x4134('0xb')][_0x241c08][_0x4134('0x13')][_0x4134('0x29')]=moment();this[_0x4134('0xf')](_0x241c08);}};EmailChannel[_0x4134('0xe')][_0x4134('0x1e')]=function(_0x4b7a48,_0x6841cc){if(this[_0x4134('0xb')][_0x4b7a48]){this[_0x4134('0xb')][_0x4b7a48][_0x4134('0x13')][_0x4134('0x12')]=_0x4134('0x1d');this['mailAccounts'][_0x4b7a48][_0x4134('0x13')][_0x4134('0x20')]=_0x6841cc;return this['emit'](_0x4b7a48);}};EmailChannel[_0x4134('0xe')][_0x4134('0x2a')]=function(_0x46e411,_0x1c5b44){return this[_0x4134('0xd')][_0x4134('0x2b')](_0x46e411,_0x1c5b44);};EmailChannel[_0x4134('0xe')][_0x4134('0x2c')]=function(_0x3d053d){var _0x187c9c=this;if(this[_0x4134('0xb')][_0x3d053d['id']]){if(_[_0x4134('0x15')](this[_0x4134('0xb')][_0x3d053d['id']][_0x4134('0x2d')])){this['mailAccounts'][_0x3d053d['id']][_0x4134('0x2d')]={};}this[_0x4134('0xb')][_0x3d053d['id']][_0x4134('0x2d')][_0x4134('0x29')]=moment();return new BPromise(function(_0x146544,_0x3ab4f){return _0x187c9c[_0x4134('0xd')][_0x4134('0x2e')](_0x3d053d)['then'](function(_0x488ac4){_0x187c9c[_0x4134('0xb')][_0x3d053d['id']][_0x4134('0x2d')][_0x4134('0x12')]=_0x4134('0x2f');_0x187c9c[_0x4134('0xb')][_0x3d053d['id']][_0x4134('0x2d')]['messageStatus']='';_0x187c9c[_0x4134('0xf')](_0x3d053d['id']);_0x146544(_0x488ac4);})[_0x4134('0x30')](function(_0x12b978){_0x187c9c['mailAccounts'][_0x3d053d['id']][_0x4134('0x2d')][_0x4134('0x12')]=_0x4134('0x1d');_0x187c9c[_0x4134('0xb')][_0x3d053d['id']][_0x4134('0x2d')][_0x4134('0x20')]=_0x12b978;_0x187c9c[_0x4134('0xf')](_0x3d053d['id']);_0x3ab4f(_0x12b978);});});}return this['smtp'][_0x4134('0x2e')](_0x3d053d);};module[_0x4134('0x31')]=EmailChannel; \ No newline at end of file +var _0x3caf=['../../../config/environment','../../../config/logger','email','redis','defaults','localhost','./imap','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','name','active','status','Imap','messageStatus','total','isNil','mailAccount:update','refresh','hasOwnProperty','box','handleImapBox','bind','handleImapEmail','handleImapEnd','error','handleImapError','disabled','emit','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','lastName','from','notify','then','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','stringify','lastSync','sendMail','Smtp','verify','verified','exports','bluebird','md5'];(function(_0x39b014,_0x111848){var _0x5890fa=function(_0x279163){while(--_0x279163){_0x39b014['push'](_0x39b014['shift']());}};_0x5890fa(++_0x111848);}(_0x3caf,0xce));var _0xf3ca=function(_0x229f4,_0x2ae27f){_0x229f4=_0x229f4-0x0;var _0x32f980=_0x3caf[_0x229f4];return _0x32f980;};'use strict';var _=require('lodash');var moment=require('moment');var BPromise=require(_0xf3ca('0x0'));var md5=require(_0xf3ca('0x1'));var Redis=require('ioredis');var config=require(_0xf3ca('0x2'));var logger=require(_0xf3ca('0x3'))(_0xf3ca('0x4'));config[_0xf3ca('0x5')]=_[_0xf3ca('0x6')](config[_0xf3ca('0x5')],{'host':_0xf3ca('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf3ca('0x5')]));var EmailImap=require(_0xf3ca('0x8'));var EmailSmtp=require(_0xf3ca('0x9'));var mailAccount=require(_0xf3ca('0xa'));var md5Accounts={};function EmailChannel(_0x4488cd){logger[_0xf3ca('0xb')](_0xf3ca('0xc'));this[_0xf3ca('0xd')]=_0x4488cd[_0xf3ca('0xd')];this[_0xf3ca('0xe')]={};this[_0xf3ca('0xf')]=new EmailSmtp();}EmailChannel[_0xf3ca('0x10')]['emit']=function(_0x264e2e){var _0x4b2dd6=this[_0xf3ca('0xd')][_0x264e2e];var _0x1c65c9={'id':_0x4b2dd6['id'],'name':_0x4b2dd6[_0xf3ca('0x11')],'key':_0x4b2dd6['key'],'active':_0x4b2dd6[_0xf3ca('0x12')],'Imap':{'status':_0x4b2dd6['Imap'][_0xf3ca('0x13')],'messageStatus':_0x4b2dd6[_0xf3ca('0x14')][_0xf3ca('0x15')],'total':_0x4b2dd6[_0xf3ca('0x14')][_0xf3ca('0x16')]}};if(_[_0xf3ca('0x17')](md5Accounts[_0x264e2e])){md5Accounts[_0x264e2e]={};}var _0x415a6=md5(JSON['stringify'](_0x1c65c9));if(md5Accounts[_0x264e2e][_0xf3ca('0x1')]!==_0x415a6){md5Accounts[_0x264e2e][_0xf3ca('0x1')]=_0x415a6;io['emit'](_0xf3ca('0x18'),_0x1c65c9);}};EmailChannel[_0xf3ca('0x10')][_0xf3ca('0x19')]=function(_0x91f1cd){for(var _0x1f49ae in _0x91f1cd){if(_0x91f1cd['hasOwnProperty'](_0x1f49ae)){if(_0x91f1cd[_0x1f49ae]['Imap']&&_0x91f1cd[_0x1f49ae][_0xf3ca('0x12')]){var _0x79e55=_0x91f1cd[_0x1f49ae][_0xf3ca('0x14')];if(!this['imapAccounts'][_0xf3ca('0x1a')](_0x79e55['id'])){this[_0xf3ca('0xe')][_0x79e55['id']]=new EmailImap(_0x79e55,_0x91f1cd[_0x1f49ae]['email']);this['imapAccounts'][_0x79e55['id']]['on'](_0xf3ca('0x1b'),this[_0xf3ca('0x1c')][_0xf3ca('0x1d')](this,_0x1f49ae));this[_0xf3ca('0xe')][_0x79e55['id']]['on'](_0xf3ca('0x4'),this[_0xf3ca('0x1e')][_0xf3ca('0x1d')](this,_0x1f49ae));this['imapAccounts'][_0x79e55['id']]['on']('end',this[_0xf3ca('0x1f')][_0xf3ca('0x1d')](this,_0x1f49ae));this[_0xf3ca('0xe')][_0x79e55['id']]['on'](_0xf3ca('0x20'),this[_0xf3ca('0x21')][_0xf3ca('0x1d')](this,_0x1f49ae));}}else{if(_[_0xf3ca('0x17')](this['mailAccounts'][_0x1f49ae][_0xf3ca('0x14')])){this[_0xf3ca('0xd')][_0x1f49ae][_0xf3ca('0x14')]={};}this[_0xf3ca('0xd')][_0x1f49ae]['Imap'][_0xf3ca('0x13')]=_0xf3ca('0x22');this[_0xf3ca('0xd')][_0x1f49ae]['Imap'][_0xf3ca('0x15')]='';this[_0xf3ca('0x23')](_0x1f49ae);}}}};EmailChannel[_0xf3ca('0x10')][_0xf3ca('0x1c')]=function(_0x20bbb6,_0xeef52d){if(this[_0xf3ca('0xd')][_0x20bbb6]){this['mailAccounts'][_0x20bbb6]['Imap']['status']=_0xf3ca('0x24');this[_0xf3ca('0xd')][_0x20bbb6][_0xf3ca('0x14')][_0xf3ca('0x15')]=_0xeef52d[_0xf3ca('0x11')];if(_0xeef52d[_0xf3ca('0x25')]){this['mailAccounts'][_0x20bbb6][_0xf3ca('0x14')]['total']=_0xeef52d['messages'][_0xf3ca('0x16')];}return this[_0xf3ca('0x23')](_0x20bbb6);}};EmailChannel['prototype'][_0xf3ca('0x1e')]=function(_0x56802d,_0x70d45d){logger[_0xf3ca('0xb')](_0xf3ca('0x26'),_0x70d45d['firstName'],_0x70d45d[_0xf3ca('0x27')],_0x70d45d[_0xf3ca('0x28')],_0x56802d);if(this[_0xf3ca('0xd')][_0x56802d]){return mailAccount[_0xf3ca('0x29')](_0x56802d,_0x70d45d)[_0xf3ca('0x2a')](function(_0x49926c){if(_0x49926c){logger[_0xf3ca('0xb')]('Mail\x20accepted\x20from\x20routing');}})[_0xf3ca('0x2b')](function(_0x2e4090){logger[_0xf3ca('0x20')](_0xf3ca('0x2c'),JSON[_0xf3ca('0x2d')](_0x2e4090));});}};EmailChannel[_0xf3ca('0x10')]['handleImapEnd']=function(_0x13350d){if(this[_0xf3ca('0xd')][_0x13350d]&&this['mailAccounts'][_0x13350d][_0xf3ca('0x14')]){if(this[_0xf3ca('0xe')][this[_0xf3ca('0xd')][_0x13350d][_0xf3ca('0x14')]['id']]){delete this[_0xf3ca('0xe')][this[_0xf3ca('0xd')][_0x13350d][_0xf3ca('0x14')]['id']];}this[_0xf3ca('0xd')][_0x13350d][_0xf3ca('0x14')][_0xf3ca('0x2e')]=moment();this[_0xf3ca('0x23')](_0x13350d);}};EmailChannel[_0xf3ca('0x10')][_0xf3ca('0x21')]=function(_0x3933eb,_0x33d349){if(this['mailAccounts'][_0x3933eb]){this[_0xf3ca('0xd')][_0x3933eb][_0xf3ca('0x14')]['status']=_0xf3ca('0x20');this[_0xf3ca('0xd')][_0x3933eb]['Imap'][_0xf3ca('0x15')]=_0x33d349;return this[_0xf3ca('0x23')](_0x3933eb);}};EmailChannel[_0xf3ca('0x10')][_0xf3ca('0x2f')]=function(_0x24ac95,_0x2d6fb3){return this[_0xf3ca('0xf')]['send'](_0x24ac95,_0x2d6fb3);};EmailChannel[_0xf3ca('0x10')]['verifySmtp']=function(_0x204df9){var _0x27a053=this;if(this[_0xf3ca('0xd')][_0x204df9['id']]){if(_[_0xf3ca('0x17')](this[_0xf3ca('0xd')][_0x204df9['id']]['Smtp'])){this[_0xf3ca('0xd')][_0x204df9['id']][_0xf3ca('0x30')]={};}this['mailAccounts'][_0x204df9['id']][_0xf3ca('0x30')][_0xf3ca('0x2e')]=moment();return new BPromise(function(_0x18fa49,_0x26ff9a){return _0x27a053[_0xf3ca('0xf')][_0xf3ca('0x31')](_0x204df9)['then'](function(_0x9b3eaa){_0x27a053[_0xf3ca('0xd')][_0x204df9['id']][_0xf3ca('0x30')][_0xf3ca('0x13')]=_0xf3ca('0x32');_0x27a053[_0xf3ca('0xd')][_0x204df9['id']]['Smtp'][_0xf3ca('0x15')]='';_0x27a053[_0xf3ca('0x23')](_0x204df9['id']);_0x18fa49(_0x9b3eaa);})['catch'](function(_0x3571ff){_0x27a053[_0xf3ca('0xd')][_0x204df9['id']][_0xf3ca('0x30')][_0xf3ca('0x13')]=_0xf3ca('0x20');_0x27a053[_0xf3ca('0xd')][_0x204df9['id']][_0xf3ca('0x30')]['messageStatus']=_0x3571ff;_0x27a053[_0xf3ca('0x23')](_0x204df9['id']);_0x26ff9a(_0x3571ff);});});}return this['smtp'][_0xf3ca('0x31')](_0x204df9);};module[_0xf3ca('0x33')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index a050f67..ed131e5 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 _0x2081=['autotls','required','getHost','anonymous@xcally.com','openBox','handleOpenBox','box','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','handleMessageBody','attributes','handleMessageEnd','handleSimpleParser','parser','emit','stringify','textCode','hasOwnProperty','upperFirst','exports','path','util','imap','lodash','randomstring','mailparser','iconv','Iconv','events','EventEmitter','./utils','../../../config/logger','email','account','once','ready','handleReady','bind','end','handleEnd','error','handleError','inherits','prototype','getAccount','connTimeout','authTimeout','isNil','service','authentication','user','password','host','port','tls'];(function(_0x4401ba,_0x42e6db){var _0x1f51bd=function(_0xbcead){while(--_0xbcead){_0x4401ba['push'](_0x4401ba['shift']());}};_0x1f51bd(++_0x42e6db);}(_0x2081,0x1e5));var _0x1208=function(_0x2c0be1,_0x1e88f2){_0x2c0be1=_0x2c0be1-0x0;var _0x3d4bd2=_0x2081[_0x2c0be1];return _0x3d4bd2;};'use strict';var fs=require('fs');var path=require(_0x1208('0x0'));var util=require(_0x1208('0x1'));var Imap=require(_0x1208('0x2'));var _=require(_0x1208('0x3'));var rs=require(_0x1208('0x4'));var simpleParser=require(_0x1208('0x5'))['simpleParser'];var Iconv=require(_0x1208('0x6'))[_0x1208('0x7')];var EventEmitter=require(_0x1208('0x8'))[_0x1208('0x9')];var utils=require(_0x1208('0xa'));var logger=require(_0x1208('0xb'))(_0x1208('0xc'));function EmailImap(_0x2ff2e,_0x5882ad){this['mailbox']='INBOX';this['account']=this['getAccount'](_0x2ff2e,_0x5882ad);this[_0x1208('0x2')]=new Imap(this[_0x1208('0xd')]);this[_0x1208('0x2')][_0x1208('0xe')](_0x1208('0xf'),this[_0x1208('0x10')][_0x1208('0x11')](this));this[_0x1208('0x2')][_0x1208('0xe')](_0x1208('0x12'),this[_0x1208('0x13')][_0x1208('0x11')](this));this[_0x1208('0x2')]['on'](_0x1208('0x14'),this[_0x1208('0x15')][_0x1208('0x11')](this));this[_0x1208('0x2')]['connect']();}util[_0x1208('0x16')](EmailImap,EventEmitter);EmailImap[_0x1208('0x17')][_0x1208('0x18')]=function(_0xd3b703,_0x26a5f4){var _0x570a5a={'connTimeout':_0xd3b703[_0x1208('0x19')]?_0xd3b703[_0x1208('0x19')]*0x3e8:0x2710,'authTimeout':_0xd3b703[_0x1208('0x1a')]?_0xd3b703[_0x1208('0x1a')]*0x3e8:0x1388};if(_[_0x1208('0x1b')](_0xd3b703[_0x1208('0x1c')])){if(_0xd3b703[_0x1208('0x1d')]){_0x570a5a[_0x1208('0x1e')]=_0xd3b703[_0x1208('0x1e')];_0x570a5a[_0x1208('0x1f')]=_0xd3b703[_0x1208('0x1f')];}_0x570a5a['host']=_0xd3b703[_0x1208('0x20')];_0x570a5a['port']=_0xd3b703[_0x1208('0x21')]||0x3e1;if(_0xd3b703[_0x1208('0x22')]){_0x570a5a[_0x1208('0x22')]=!![];}else{_0x570a5a[_0x1208('0x22')]=![];_0x570a5a[_0x1208('0x23')]=_0x1208('0x24');}}else{_0x570a5a[_0x1208('0x1e')]=_0xd3b703['user'];_0x570a5a['password']=_0xd3b703['password'];_0x570a5a['host']=utils[_0x1208('0x25')](_0xd3b703[_0x1208('0x1c')]);_0x570a5a[_0x1208('0x21')]=0x3e1;_0x570a5a[_0x1208('0x22')]=!![];}_0x570a5a['email']=_0x26a5f4||_0xd3b703[_0x1208('0x1e')]||_0x1208('0x26');return _0x570a5a;};EmailImap[_0x1208('0x17')][_0x1208('0x10')]=function(){this[_0x1208('0x2')][_0x1208('0x27')](this['mailbox'],![],this[_0x1208('0x28')][_0x1208('0x11')](this));};EmailImap[_0x1208('0x17')][_0x1208('0x28')]=function(_0x59fed1,_0x1e491f){if(_0x59fed1){this[_0x1208('0x15')](_0x59fed1,!![]);}else{this['emit'](_0x1208('0x29'),_0x1e491f);this[_0x1208('0x2a')]();}};EmailImap[_0x1208('0x17')][_0x1208('0x2b')]=function(_0x46b95a){if(_0x46b95a){this[_0x1208('0x15')](_0x46b95a,!![]);}else{this[_0x1208('0x2')][_0x1208('0x12')]();}};EmailImap[_0x1208('0x17')][_0x1208('0x2a')]=function(){this[_0x1208('0x2')][_0x1208('0x2c')]([_0x1208('0x2d')],this[_0x1208('0x2e')]['bind'](this));};EmailImap[_0x1208('0x17')]['handleReadUnseen']=function(_0x2f3a2f,_0x44a73d){if(_0x2f3a2f){this[_0x1208('0x15')](_0x2f3a2f,!![]);}else{if(_0x44a73d[_0x1208('0x2f')]){try{var _0x5e76b7=this[_0x1208('0x2')][_0x1208('0x30')](_0x44a73d,{'bodies':'','markSeen':!![]});_0x5e76b7['on'](_0x1208('0x31'),this[_0x1208('0x32')][_0x1208('0x11')](this));_0x5e76b7[_0x1208('0xe')](_0x1208('0x14'),this[_0x1208('0x33')]['bind'](this));_0x5e76b7[_0x1208('0xe')]('end',this[_0x1208('0x34')]['bind'](this));}catch(_0x2f027a){logger[_0x1208('0x14')](_0x2f027a);}}else{this[_0x1208('0x2')][_0x1208('0x35')](!![],this[_0x1208('0x2b')][_0x1208('0x11')](this));}}};EmailImap[_0x1208('0x17')][_0x1208('0x32')]=function(_0x511701,_0x4500ad){_0x511701['on']('body',this[_0x1208('0x36')]['bind'](this));_0x511701[_0x1208('0xe')](_0x1208('0x37'),this['handleMessageAttributes'][_0x1208('0x11')](this));_0x511701[_0x1208('0xe')](_0x1208('0x12'),this[_0x1208('0x38')][_0x1208('0x11')](this));};EmailImap[_0x1208('0x17')][_0x1208('0x36')]=function(_0x379290,_0x5f0eb5){simpleParser(_0x379290,{'Iconv':Iconv},this['handleSimpleParser'][_0x1208('0x11')](this));};EmailImap[_0x1208('0x17')]['handleMessageAttributes']=function(_0x8e0274){};EmailImap[_0x1208('0x17')][_0x1208('0x38')]=function(){};EmailImap[_0x1208('0x17')][_0x1208('0x39')]=function(_0x429591,_0x382f87){if(_0x429591){logger[_0x1208('0x14')](_0x429591);}else{var _0x43b1ee=this;utils[_0x1208('0x3a')](this[_0x1208('0xd')],_0x382f87,function(_0x1cbfc4){_0x43b1ee[_0x1208('0x3b')](_0x1208('0xc'),_0x1cbfc4);});}};EmailImap['prototype'][_0x1208('0x34')]=function(){this[_0x1208('0x2')]['closeBox'](!![],this[_0x1208('0x2b')][_0x1208('0x11')](this));};EmailImap[_0x1208('0x17')][_0x1208('0x33')]=function(_0x499ca2){this[_0x1208('0x15')](_0x499ca2);this[_0x1208('0x2')]['closeBox'](!![],this[_0x1208('0x2b')][_0x1208('0x11')](this));};EmailImap['prototype'][_0x1208('0x13')]=function(){this['emit'](_0x1208('0x12'));};EmailImap[_0x1208('0x17')]['handleError']=function(_0x148a59,_0x4ca6bd){logger[_0x1208('0x14')]('handleError',this[_0x1208('0xd')]['email'],JSON[_0x1208('0x3c')](_0x148a59));var _0xa10842='';if(_0x148a59){if(_0x148a59[_0x1208('0x3d')]){_0xa10842=_0x148a59['textCode'];}else{for(var _0x369f2e in _0x148a59){if(_0x148a59[_0x1208('0x3e')](_0x369f2e)){_0xa10842+=_[_0x1208('0x3f')](_0x369f2e)+':\x20'+_0x148a59[_0x369f2e]+'\x0a';}}}}if(_0x4ca6bd){this[_0x1208('0x2')]['end']();}else{this[_0x1208('0x3b')](_0x1208('0x14'),_0xa10842);this['emit'](_0x1208('0x12'));}};module[_0x1208('0x40')]=EmailImap; \ No newline at end of file +var _0xbb8a=['port','tls','autotls','getHost','email','anonymous@xcally.com','mailbox','handleOpenBox','emit','box','readUnseen','handleCloseBox','handleError','search','handleReadUnseen','length','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','textCode','hasOwnProperty','upperFirst','exports','path','util','imap','lodash','mailparser','simpleParser','Iconv','events','EventEmitter','./utils','../../../config/logger','INBOX','account','getAccount','once','ready','handleReady','end','handleEnd','bind','error','connect','inherits','prototype','connTimeout','authTimeout','service','user','password','host'];(function(_0x4ee2a3,_0x96a346){var _0x16a4cb=function(_0x1f4e36){while(--_0x1f4e36){_0x4ee2a3['push'](_0x4ee2a3['shift']());}};_0x16a4cb(++_0x96a346);}(_0xbb8a,0x99));var _0xabb8=function(_0x4e3ab7,_0x270bed){_0x4e3ab7=_0x4e3ab7-0x0;var _0x2f2184=_0xbb8a[_0x4e3ab7];return _0x2f2184;};'use strict';var fs=require('fs');var path=require(_0xabb8('0x0'));var util=require(_0xabb8('0x1'));var Imap=require(_0xabb8('0x2'));var _=require(_0xabb8('0x3'));var rs=require('randomstring');var simpleParser=require(_0xabb8('0x4'))[_0xabb8('0x5')];var Iconv=require('iconv')[_0xabb8('0x6')];var EventEmitter=require(_0xabb8('0x7'))[_0xabb8('0x8')];var utils=require(_0xabb8('0x9'));var logger=require(_0xabb8('0xa'))('email');function EmailImap(_0x2f3522,_0x7a0792){this['mailbox']=_0xabb8('0xb');this[_0xabb8('0xc')]=this[_0xabb8('0xd')](_0x2f3522,_0x7a0792);this['imap']=new Imap(this[_0xabb8('0xc')]);this[_0xabb8('0x2')][_0xabb8('0xe')](_0xabb8('0xf'),this[_0xabb8('0x10')]['bind'](this));this[_0xabb8('0x2')]['once'](_0xabb8('0x11'),this[_0xabb8('0x12')][_0xabb8('0x13')](this));this[_0xabb8('0x2')]['on'](_0xabb8('0x14'),this['handleError'][_0xabb8('0x13')](this));this[_0xabb8('0x2')][_0xabb8('0x15')]();}util[_0xabb8('0x16')](EmailImap,EventEmitter);EmailImap[_0xabb8('0x17')][_0xabb8('0xd')]=function(_0x31c7bf,_0x564bca){var _0x5e82ea={'connTimeout':_0x31c7bf['connTimeout']?_0x31c7bf[_0xabb8('0x18')]*0x3e8:0x2710,'authTimeout':_0x31c7bf[_0xabb8('0x19')]?_0x31c7bf[_0xabb8('0x19')]*0x3e8:0x1388};if(_['isNil'](_0x31c7bf[_0xabb8('0x1a')])){if(_0x31c7bf['authentication']){_0x5e82ea[_0xabb8('0x1b')]=_0x31c7bf[_0xabb8('0x1b')];_0x5e82ea[_0xabb8('0x1c')]=_0x31c7bf[_0xabb8('0x1c')];}_0x5e82ea[_0xabb8('0x1d')]=_0x31c7bf['host'];_0x5e82ea[_0xabb8('0x1e')]=_0x31c7bf[_0xabb8('0x1e')]||0x3e1;if(_0x31c7bf[_0xabb8('0x1f')]){_0x5e82ea[_0xabb8('0x1f')]=!![];}else{_0x5e82ea[_0xabb8('0x1f')]=![];_0x5e82ea[_0xabb8('0x20')]='required';}}else{_0x5e82ea[_0xabb8('0x1b')]=_0x31c7bf[_0xabb8('0x1b')];_0x5e82ea[_0xabb8('0x1c')]=_0x31c7bf[_0xabb8('0x1c')];_0x5e82ea[_0xabb8('0x1d')]=utils[_0xabb8('0x21')](_0x31c7bf['service']);_0x5e82ea[_0xabb8('0x1e')]=0x3e1;_0x5e82ea['tls']=!![];}_0x5e82ea[_0xabb8('0x22')]=_0x564bca||_0x31c7bf[_0xabb8('0x1b')]||_0xabb8('0x23');return _0x5e82ea;};EmailImap[_0xabb8('0x17')][_0xabb8('0x10')]=function(){this[_0xabb8('0x2')]['openBox'](this[_0xabb8('0x24')],![],this[_0xabb8('0x25')][_0xabb8('0x13')](this));};EmailImap[_0xabb8('0x17')][_0xabb8('0x25')]=function(_0x4f5764,_0x1eed88){if(_0x4f5764){this['handleError'](_0x4f5764,!![]);}else{this[_0xabb8('0x26')](_0xabb8('0x27'),_0x1eed88);this[_0xabb8('0x28')]();}};EmailImap[_0xabb8('0x17')][_0xabb8('0x29')]=function(_0x5e4f88){if(_0x5e4f88){this[_0xabb8('0x2a')](_0x5e4f88,!![]);}else{this[_0xabb8('0x2')][_0xabb8('0x11')]();}};EmailImap[_0xabb8('0x17')][_0xabb8('0x28')]=function(){this['imap'][_0xabb8('0x2b')](['UNSEEN'],this[_0xabb8('0x2c')][_0xabb8('0x13')](this));};EmailImap[_0xabb8('0x17')][_0xabb8('0x2c')]=function(_0x2594d1,_0x17f707){if(_0x2594d1){this['handleError'](_0x2594d1,!![]);}else{if(_0x17f707[_0xabb8('0x2d')]){try{var _0x314b08=this[_0xabb8('0x2')]['fetch'](_0x17f707,{'bodies':'','markSeen':!![]});_0x314b08['on']('message',this[_0xabb8('0x2e')][_0xabb8('0x13')](this));_0x314b08[_0xabb8('0xe')](_0xabb8('0x14'),this[_0xabb8('0x2f')][_0xabb8('0x13')](this));_0x314b08[_0xabb8('0xe')]('end',this[_0xabb8('0x30')][_0xabb8('0x13')](this));}catch(_0x2f06ea){logger[_0xabb8('0x14')](_0x2f06ea);}}else{this[_0xabb8('0x2')][_0xabb8('0x31')](!![],this[_0xabb8('0x29')][_0xabb8('0x13')](this));}}};EmailImap['prototype'][_0xabb8('0x2e')]=function(_0x8a7999,_0x1a4615){_0x8a7999['on'](_0xabb8('0x32'),this[_0xabb8('0x33')]['bind'](this));_0x8a7999[_0xabb8('0xe')](_0xabb8('0x34'),this[_0xabb8('0x35')][_0xabb8('0x13')](this));_0x8a7999['once']('end',this[_0xabb8('0x36')]['bind'](this));};EmailImap[_0xabb8('0x17')][_0xabb8('0x33')]=function(_0x3458a7,_0x825e8a){simpleParser(_0x3458a7,{'Iconv':Iconv},this[_0xabb8('0x37')][_0xabb8('0x13')](this));};EmailImap[_0xabb8('0x17')][_0xabb8('0x35')]=function(_0x9d7f76){};EmailImap['prototype'][_0xabb8('0x36')]=function(){};EmailImap[_0xabb8('0x17')][_0xabb8('0x37')]=function(_0x28ec72,_0x2842b9){if(_0x28ec72){logger[_0xabb8('0x14')](_0x28ec72);}else{var _0x4e01d9=this;utils[_0xabb8('0x38')](this[_0xabb8('0xc')],_0x2842b9,function(_0x3b4256){_0x4e01d9[_0xabb8('0x26')](_0xabb8('0x22'),_0x3b4256);});}};EmailImap[_0xabb8('0x17')]['handleFetchEnd']=function(){this[_0xabb8('0x2')][_0xabb8('0x31')](!![],this[_0xabb8('0x29')]['bind'](this));};EmailImap[_0xabb8('0x17')][_0xabb8('0x2f')]=function(_0x17cf6d){this[_0xabb8('0x2a')](_0x17cf6d);this['imap'][_0xabb8('0x31')](!![],this[_0xabb8('0x29')][_0xabb8('0x13')](this));};EmailImap[_0xabb8('0x17')][_0xabb8('0x12')]=function(){this[_0xabb8('0x26')](_0xabb8('0x11'));};EmailImap[_0xabb8('0x17')][_0xabb8('0x2a')]=function(_0x1d0f0a,_0x277858){logger[_0xabb8('0x14')](_0xabb8('0x2a'),this['account'][_0xabb8('0x22')],JSON['stringify'](_0x1d0f0a));var _0x4aad69='';if(_0x1d0f0a){if(_0x1d0f0a[_0xabb8('0x39')]){_0x4aad69=_0x1d0f0a['textCode'];}else{for(var _0x3c1d3d in _0x1d0f0a){if(_0x1d0f0a[_0xabb8('0x3a')](_0x3c1d3d)){_0x4aad69+=_[_0xabb8('0x3b')](_0x3c1d3d)+':\x20'+_0x1d0f0a[_0x3c1d3d]+'\x0a';}}}}if(_0x277858){this[_0xabb8('0x2')][_0xabb8('0x11')]();}else{this['emit'](_0xabb8('0x14'),_0x4aad69);this[_0xabb8('0x26')](_0xabb8('0x11'));}};module[_0xabb8('0x3c')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 091a128..4f52de5 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 _0x0275=['nodemailer-plugin-inline-base64','prototype','send','compile','sendMail','toString','verify','Not\x20verifired','exports','bluebird'];(function(_0x549565,_0x54bdb0){var _0x23c3cd=function(_0x3a81e7){while(--_0x3a81e7){_0x549565['push'](_0x549565['shift']());}};_0x23c3cd(++_0x54bdb0);}(_0x0275,0x1b7));var _0x5027=function(_0x1296ec,_0x18c4b6){_0x1296ec=_0x1296ec-0x0;var _0x49c5ae=_0x0275[_0x1296ec];return _0x49c5ae;};'use strict';var nodemailer=require('nodemailer');var BPromise=require(_0x5027('0x0'));var inlineBase64=require(_0x5027('0x1'));function EmailSmtp(){}EmailSmtp[_0x5027('0x2')][_0x5027('0x3')]=function(_0x12c49e,_0x325cfb){return new BPromise(function(_0x36d16a,_0x7db0aa){var _0x5753c5=nodemailer['createTransport'](_0x12c49e);_0x5753c5['use'](_0x5027('0x4'),inlineBase64());_0x5753c5[_0x5027('0x5')](_0x325cfb,function(_0x45fc35,_0x4f0298){if(_0x45fc35){_0x7db0aa(_0x45fc35[_0x5027('0x6')]());}else{_0x36d16a(_0x4f0298);}});});};EmailSmtp[_0x5027('0x2')][_0x5027('0x7')]=function(_0x160448){return new BPromise(function(_0x3dee64,_0x1e045f){var _0x21c3fb=nodemailer['createTransport'](_0x160448);_0x21c3fb[_0x5027('0x7')](function(_0x37538f,_0x2cf7c7){if(_0x37538f){_0x1e045f(_0x37538f[_0x5027('0x6')]());}else{if(_0x2cf7c7){_0x3dee64(_0x2cf7c7);}else{_0x1e045f(_0x5027('0x8'));}}});});};module[_0x5027('0x9')]=EmailSmtp; \ No newline at end of file +var _0xaebd=['prototype','send','use','compile','sendMail','verify','createTransport','toString','Not\x20verifired','nodemailer','bluebird'];(function(_0x46c5e8,_0x41b6ca){var _0x54df50=function(_0xec1ef6){while(--_0xec1ef6){_0x46c5e8['push'](_0x46c5e8['shift']());}};_0x54df50(++_0x41b6ca);}(_0xaebd,0xb9));var _0xdaeb=function(_0x4bb61f,_0x533ac6){_0x4bb61f=_0x4bb61f-0x0;var _0xe729f4=_0xaebd[_0x4bb61f];return _0xe729f4;};'use strict';var nodemailer=require(_0xdaeb('0x0'));var BPromise=require(_0xdaeb('0x1'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp[_0xdaeb('0x2')][_0xdaeb('0x3')]=function(_0x2eccc7,_0x2924f1){return new BPromise(function(_0x47f775,_0x45ce9a){var _0x538b4f=nodemailer['createTransport'](_0x2eccc7);_0x538b4f[_0xdaeb('0x4')](_0xdaeb('0x5'),inlineBase64());_0x538b4f[_0xdaeb('0x6')](_0x2924f1,function(_0x229dde,_0x3ac3fa){if(_0x229dde){_0x45ce9a(_0x229dde['toString']());}else{_0x47f775(_0x3ac3fa);}});});};EmailSmtp[_0xdaeb('0x2')][_0xdaeb('0x7')]=function(_0x13d0e1){return new BPromise(function(_0x2c99b1,_0xbc423d){var _0x223798=nodemailer[_0xdaeb('0x8')](_0x13d0e1);_0x223798['verify'](function(_0x305676,_0x579847){if(_0x305676){_0xbc423d(_0x305676[_0xdaeb('0x9')]());}else{if(_0x579847){_0x2c99b1(_0x579847);}else{_0xbc423d(_0xdaeb('0xa'));}}});});};module['exports']=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index fc0cdb3..87af608 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 _0xc269=['address','anonymous','generate','@xcally.com','name','split','Anonymous','length','pop','isEmpty','html','test','replace','body','message','originTo','originCc','includes','attachments','attachment','filename','attachment-','format','%s-%s','now','root','server/files/attachments/','writeFileSync','content','push','contentType','parser','from','subject','inReplyTo','date','textAsHtml','filter','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','BodyHTML','Attachments','Title','

Empty\x20message

','getHost','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','outlook365','127.0.0.1','moment','randomstring','path','node-tnef','../../../config/logger','email','../../../config/environment','head','value'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc269,0x1a2));var _0x9c26=function(_0x325f3b,_0x5e131e){_0x325f3b=_0x325f3b-0x0;var _0x4a98f2=_0xc269[_0x325f3b];return _0x4a98f2;};'use strict';var _=require('lodash');var moment=require(_0x9c26('0x0'));var random=require(_0x9c26('0x1'));var fs=require('fs');var path=require(_0x9c26('0x2'));var util=require('util');var tnef=require(_0x9c26('0x3'));var logger=require(_0x9c26('0x4'))(_0x9c26('0x5'));var config=require(_0x9c26('0x6'));function getAddress(_0x4a700a){var _0x14ba08=_[_0x9c26('0x7')](_0x4a700a[_0x9c26('0x8')]);return _0x14ba08&&_0x14ba08[_0x9c26('0x9')]?_0x14ba08[_0x9c26('0x9')]:_0x9c26('0xa')+random[_0x9c26('0xb')](0x6)+_0x9c26('0xc');}function getFirstName(_0x581dbc){var _0x2a67d3=_[_0x9c26('0x7')](_0x581dbc[_0x9c26('0x8')]);if(_0x2a67d3&&_0x2a67d3[_0x9c26('0xd')]){var _0x112cad=_0x2a67d3[_0x9c26('0xd')][_0x9c26('0xe')](/\s+/);return _0x112cad['length']?_0x112cad['slice'](0x0,-0x1)['join']('\x20'):_0x2a67d3[_0x9c26('0xd')];}return _0x9c26('0xf');}function getLastName(_0x55856d){var _0x4aae7d=_[_0x9c26('0x7')](_0x55856d[_0x9c26('0x8')]);if(_0x4aae7d&&_0x4aae7d[_0x9c26('0xd')]){var _0x1aff7a=_0x4aae7d[_0x9c26('0xd')][_0x9c26('0xe')](/\s+/);return _0x1aff7a[_0x9c26('0x10')]>0x1?_0x1aff7a[_0x9c26('0x11')]():'';}return'';}function getMails(_0x569dd0,_0x76651){var _0xb35bc2='';for(var _0x41e783=0x0;_0x41e783<_0x76651['value'][_0x9c26('0x10')];_0x41e783+=0x1){if(_0x76651[_0x9c26('0x8')][_0x41e783]['address']!==_0x569dd0){if(!_[_0x9c26('0x12')](_0xb35bc2)){_0xb35bc2+=',';}_0xb35bc2+=_0x76651['value'][_0x41e783][_0x9c26('0xd')]||_0x76651['value'][_0x41e783][_0x9c26('0x9')]||'';_0xb35bc2+='\x20<';_0xb35bc2+=_0x76651[_0x9c26('0x8')][_0x41e783][_0x9c26('0x9')]?_0x76651[_0x9c26('0x8')][_0x41e783][_0x9c26('0x9')]:_0x9c26('0xa')+random[_0x9c26('0xb')](0x6)+_0x9c26('0xc');_0xb35bc2+='>';}}return _0xb35bc2;}function parseEmail(_0x50cf32,_0x4090d1,_0x505b88){if(_0x4090d1[_0x9c26('0x13')]){var _0x288efb=/)<[^<]*)*<\/script>/gi;while(_0x288efb[_0x9c26('0x14')](_0x4090d1[_0x9c26('0x13')])){_0x4090d1[_0x9c26('0x13')]=_0x4090d1[_0x9c26('0x13')][_0x9c26('0x15')](_0x288efb,'');}_0x505b88[_0x9c26('0x16')]=_0x4090d1[_0x9c26('0x13')];}else{_0x505b88['body']=_0x4090d1['textAsHtml'];}if(_0x505b88[_0x9c26('0x16')]){_0x505b88[_0x9c26('0x16')]=_0x505b88[_0x9c26('0x16')][_0x9c26('0x15')](/Empty\x20message

';if(_0x3a7bef[_0x9c26('0x32')]){for(var _0x857025=0x0;_0x857025<_0x3a7bef[_0x9c26('0x32')][_0x9c26('0x10')];_0x857025++){var _0x241718=_0x3a7bef[_0x9c26('0x32')][_0x857025];_0x679e29[_0x9c26('0x17')][_0x9c26('0x1b')][_0x9c26('0x26')]({'filename':_0x241718[_0x9c26('0x33')],'content':new Buffer(_0x241718['Data'])});}}}_0x3c7f64(parseEmail(_0x48a1f4,_0x30fbcb,_0x679e29));});}else{_0x30fbcb[_0x9c26('0x13')]=_0x9c26('0x34');_0x3c7f64(parseEmail(_0x48a1f4,_0x30fbcb,_0x679e29));}}else{_0x3c7f64(parseEmail(_0x48a1f4,_0x30fbcb,_0x679e29));}};exports[_0x9c26('0x35')]=function(_0x5a9d5c){switch(_0x5a9d5c){case _0x9c26('0x36'):return _0x9c26('0x37');case _0x9c26('0x38'):return _0x9c26('0x39');case _0x9c26('0x3a'):return'imap-mail.outlook.com';case _0x9c26('0x3b'):return'outlook.office365.com';}return _0x9c26('0x3c');}; \ No newline at end of file +var _0xa2e1=['attachment-','format','%s-%s','server/files/attachments/','writeFileSync','content','push','contentType','parser','from','subject','inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss','application/ms-tnef','info','messageId','first','BodyHTML','

Empty\x20message

','Attachments','Title','getHost','gmail','imap.gmail.com','yahoo','imap-mail.outlook.com','outlook365','outlook.office365.com','lodash','randomstring','util','node-tnef','../../../config/logger','../../../config/environment','head','value','address','generate','@xcally.com','name','split','length','slice','join','Anonymous','isEmpty','anonymous','test','html','replace','body','textAsHtml','0x1?_0x352cf3['pop']():'';}return'';}function getMails(_0x4e7d26,_0x4947b4){var _0x529562='';for(var _0x4bc21d=0x0;_0x4bc21d<_0x4947b4[_0x1a2e('0x7')][_0x1a2e('0xd')];_0x4bc21d+=0x1){if(_0x4947b4[_0x1a2e('0x7')][_0x4bc21d][_0x1a2e('0x8')]!==_0x4e7d26){if(!_[_0x1a2e('0x11')](_0x529562)){_0x529562+=',';}_0x529562+=_0x4947b4[_0x1a2e('0x7')][_0x4bc21d][_0x1a2e('0xb')]||_0x4947b4[_0x1a2e('0x7')][_0x4bc21d][_0x1a2e('0x8')]||'';_0x529562+='\x20<';_0x529562+=_0x4947b4['value'][_0x4bc21d]['address']?_0x4947b4[_0x1a2e('0x7')][_0x4bc21d][_0x1a2e('0x8')]:_0x1a2e('0x12')+random[_0x1a2e('0x9')](0x6)+_0x1a2e('0xa');_0x529562+='>';}}return _0x529562;}function parseEmail(_0x5f35b4,_0x57d127,_0x260164){if(_0x57d127['html']){var _0x29507b=/)<[^<]*)*<\/script>/gi;while(_0x29507b[_0x1a2e('0x13')](_0x57d127['html'])){_0x57d127[_0x1a2e('0x14')]=_0x57d127[_0x1a2e('0x14')][_0x1a2e('0x15')](_0x29507b,'');}_0x260164[_0x1a2e('0x16')]=_0x57d127['html'];}else{_0x260164[_0x1a2e('0x16')]=_0x57d127[_0x1a2e('0x17')];}if(_0x260164[_0x1a2e('0x16')]){_0x260164[_0x1a2e('0x16')]=_0x260164[_0x1a2e('0x16')]['replace'](/0x0){if(this[_0x5b7332+_0xb41b('0x20')]>0x0&&this[_0x5b7332+_0xb41b('0x21')]>=this[_0x5b7332+_0xb41b('0x20')]){return _0xb41b('0x22');}else{return _0xb41b('0x23');}}else{return _0xb41b('0x24');}};Agent['prototype']['updateRealtime']=function(){var _0x2b436f=[_0xb41b('0x25'),_0xb41b('0x26'),'openchannel',_0xb41b('0x27'),_0xb41b('0x28')];for(var _0x546101=0x0;_0x546101<_0x2b436f[_0xb41b('0x29')];_0x546101+=0x1){var _0x34f908=this['getChannelStatus'](_0x2b436f[_0x546101]);if(this[_0x2b436f[_0x546101]+_0xb41b('0x2a')]!==_0x34f908){this[_0x2b436f[_0x546101]+'StatusTime']=_[_0xb41b('0x2b')](moment()[_0xb41b('0x2c')]('x'));}this[_0x2b436f[_0x546101]+'Status']=_0x34f908;}var _0x3af2c={'id':this['id'],'name':this[_0xb41b('0x6')],'online':this['online'],'voicePause':this['voicePause'],'chatPause':this[_0xb41b('0x8')],'mailPause':this[_0xb41b('0x9')],'smsPause':this[_0xb41b('0xb')],'faxPause':this[_0xb41b('0xa')],'openchannelPause':this[_0xb41b('0xc')],'chatStatus':this[_0xb41b('0x2d')],'chatStatusTime':this[_0xb41b('0xe')],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this[_0xb41b('0x10')],'mailStatus':this[_0xb41b('0x2e')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this[_0xb41b('0x12')],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0xb41b('0x2f')],'faxStatusTime':this[_0xb41b('0x30')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0xb41b('0x15')],'smsStatus':this['smsStatus'],'smsStatusTime':this[_0xb41b('0x31')],'smsCapacity':this[_0xb41b('0x17')],'smsCurrentCapacity':this['smsCurrentCapacity'],'openchannelStatus':this[_0xb41b('0x19')],'openchannelStatusTime':this[_0xb41b('0x1a')],'openchannelCapacity':this[_0xb41b('0x1b')],'openchannelCurrentCapacity':this[_0xb41b('0x32')],'busy':this[_0xb41b('0x33')],'busyQueue':this[_0xb41b('0x1c')]};var _0x157048=md5(JSON[_0xb41b('0x34')](_0x3af2c));if(this[_0xb41b('0x35')]!==_0x157048){this[_0xb41b('0x35')]=_0x157048;io['emit'](_0xb41b('0x36'),_0x3af2c);}};module['exports']=Agent; \ No newline at end of file +var _0xb4e6=['chatStatusTime','stringify','emit','user:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','localhost','name','online','voicePause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','updateRealtime','prototype','CurrentCapacity','Capacity','maxcapacity','idle','mail','chat','openchannel','sms','length','getChannelStatus','Status','toNumber','format'];(function(_0x582354,_0x478506){var _0x247036=function(_0x5c0394){while(--_0x5c0394){_0x582354['push'](_0x582354['shift']());}};_0x247036(++_0x478506);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x687ddc,_0x2092fa){_0x687ddc=_0x687ddc-0x0;var _0x441991=_0xb4e6[_0x687ddc];return _0x441991;};'use strict';var _=require(_0x6b4e('0x0'));var moment=require('moment');var md5=require(_0x6b4e('0x1'));var Redis=require(_0x6b4e('0x2'));var config=require(_0x6b4e('0x3'));config[_0x6b4e('0x4')]=_[_0x6b4e('0x5')](config[_0x6b4e('0x4')],{'host':_0x6b4e('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x6b4e('0x4')]));function Agent(_0x1edf06){this['id']=_0x1edf06['id']||0x0;this[_0x6b4e('0x7')]=_0x1edf06['name']||'';this[_0x6b4e('0x8')]=_0x1edf06['online']||!![];this['voicePause']=_0x1edf06[_0x6b4e('0x9')]||![];this['chatPause']=_0x1edf06['chatPause']||![];this[_0x6b4e('0xa')]=_0x1edf06[_0x6b4e('0xa')]||![];this[_0x6b4e('0xb')]=_0x1edf06[_0x6b4e('0xb')]||![];this[_0x6b4e('0xc')]=_0x1edf06[_0x6b4e('0xc')]||![];this[_0x6b4e('0xd')]=_0x1edf06['openchannelPause']||![];this[_0x6b4e('0xe')]=_0x6b4e('0xf');this['chatStatusTime']=0x0;this[_0x6b4e('0x10')]=_0x1edf06[_0x6b4e('0x10')]||0x0;this[_0x6b4e('0x11')]=0x0;this[_0x6b4e('0x12')]=_0x6b4e('0xf');this[_0x6b4e('0x13')]=0x0;this[_0x6b4e('0x14')]=_0x1edf06['mailCapacity']||0x0;this[_0x6b4e('0x15')]=0x0;this[_0x6b4e('0x16')]='unknown';this[_0x6b4e('0x17')]=0x0;this['faxCapacity']=_0x1edf06[_0x6b4e('0x18')]||0x0;this[_0x6b4e('0x19')]=0x0;this[_0x6b4e('0x1a')]=_0x6b4e('0xf');this[_0x6b4e('0x1b')]=0x0;this[_0x6b4e('0x1c')]=_0x1edf06['smsCapacity']||0x0;this['smsCurrentCapacity']=0x0;this[_0x6b4e('0x1d')]=_0x6b4e('0xf');this[_0x6b4e('0x1e')]=0x0;this[_0x6b4e('0x1f')]=_0x1edf06[_0x6b4e('0x1f')]||0x0;this[_0x6b4e('0x20')]=0x0;this[_0x6b4e('0x21')]=![];this[_0x6b4e('0x22')]=undefined;this[_0x6b4e('0x1')]='';this[_0x6b4e('0x23')]();}Agent[_0x6b4e('0x24')]['getChannelStatus']=function(_0x378233){if(this[_0x378233+_0x6b4e('0x25')]>0x0){if(this[_0x378233+_0x6b4e('0x26')]>0x0&&this[_0x378233+_0x6b4e('0x25')]>=this[_0x378233+'Capacity']){return _0x6b4e('0x27');}else{return'working';}}else{return _0x6b4e('0x28');}};Agent[_0x6b4e('0x24')][_0x6b4e('0x23')]=function(){var _0x4344b7=[_0x6b4e('0x29'),_0x6b4e('0x2a'),_0x6b4e('0x2b'),'fax',_0x6b4e('0x2c')];for(var _0x4a8ac4=0x0;_0x4a8ac4<_0x4344b7[_0x6b4e('0x2d')];_0x4a8ac4+=0x1){var _0x884b7e=this[_0x6b4e('0x2e')](_0x4344b7[_0x4a8ac4]);if(this[_0x4344b7[_0x4a8ac4]+_0x6b4e('0x2f')]!==_0x884b7e){this[_0x4344b7[_0x4a8ac4]+'StatusTime']=_[_0x6b4e('0x30')](moment()[_0x6b4e('0x31')]('x'));}this[_0x4344b7[_0x4a8ac4]+'Status']=_0x884b7e;}var _0x32102f={'id':this['id'],'name':this[_0x6b4e('0x7')],'online':this[_0x6b4e('0x8')],'voicePause':this[_0x6b4e('0x9')],'chatPause':this['chatPause'],'mailPause':this[_0x6b4e('0xa')],'smsPause':this[_0x6b4e('0xc')],'faxPause':this['faxPause'],'openchannelPause':this[_0x6b4e('0xd')],'chatStatus':this[_0x6b4e('0xe')],'chatStatusTime':this[_0x6b4e('0x32')],'chatCapacity':this[_0x6b4e('0x10')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this[_0x6b4e('0x12')],'mailStatusTime':this[_0x6b4e('0x13')],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this[_0x6b4e('0x15')],'faxStatus':this[_0x6b4e('0x16')],'faxStatusTime':this[_0x6b4e('0x17')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this[_0x6b4e('0x1a')],'smsStatusTime':this[_0x6b4e('0x1b')],'smsCapacity':this[_0x6b4e('0x1c')],'smsCurrentCapacity':this['smsCurrentCapacity'],'openchannelStatus':this[_0x6b4e('0x1d')],'openchannelStatusTime':this[_0x6b4e('0x1e')],'openchannelCapacity':this[_0x6b4e('0x1f')],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this['busy'],'busyQueue':this[_0x6b4e('0x22')]};var _0x4952ef=md5(JSON[_0x6b4e('0x33')](_0x32102f));if(this[_0x6b4e('0x1')]!==_0x4952ef){this['md5']=_0x4952ef;io[_0x6b4e('0x34')](_0x6b4e('0x35'),_0x32102f);}};module[_0x6b4e('0x36')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 3cbbe7b..e75810e 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 _0xb94d=['waiting','updateRouting','prototype','_rr','updateRealtime','loggedIn','length','online','chatPause','paused','available','stringify','chat:queue:%s','chat_queue:save','lodash','md5','util','ioredis','../../../config/environment','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId'];(function(_0x29b9f0,_0x3d3c5d){var _0x5bf28c=function(_0x2dfb9a){while(--_0x2dfb9a){_0x29b9f0['push'](_0x29b9f0['shift']());}};_0x5bf28c(++_0x3d3c5d);}(_0xb94d,0x7a));var _0xdb94=function(_0x421725,_0x318a04){_0x421725=_0x421725-0x0;var _0x51b322=_0xb94d[_0x421725];return _0x51b322;};'use strict';var _=require(_0xdb94('0x0'));var md5=require(_0xdb94('0x1'));var util=require(_0xdb94('0x2'));var Redis=require(_0xdb94('0x3'));var config=require(_0xdb94('0x4'));config['redis']=_[_0xdb94('0x5')](config['redis'],{'host':_0xdb94('0x6'),'port':0x18eb});var io=require(_0xdb94('0x7'))(new Redis(config['redis']));function ChatQueue(_0x5dc55d){this['id']=_0x5dc55d['id']||0x0;this[_0xdb94('0x8')]=_0x5dc55d['name']||'';this['timeout']=_0x5dc55d[_0xdb94('0x9')]||0xa;this['strategy']=_0x5dc55d[_0xdb94('0xa')]||'beepall';this['Agents']=_0x5dc55d[_0xdb94('0xb')];this[_0xdb94('0xc')]={};this[_0xdb94('0xd')]=0x0;this[_0xdb94('0x1')]='';this[_0xdb94('0xe')]();this['updateRealtime']();}ChatQueue[_0xdb94('0xf')][_0xdb94('0xe')]=function(){var _0x21279e=this[_0xdb94('0xc')][_0xdb94('0x10')];this[_0xdb94('0xc')]=_['map'](this[_0xdb94('0xb')],'id');this[_0xdb94('0xc')][_0xdb94('0x10')]=_0x21279e;};ChatQueue[_0xdb94('0xf')][_0xdb94('0x11')]=function(){this[_0xdb94('0x12')]=0x0;this['paused']=0x0;for(var _0x32c656=0x0;_0x32c656=0x0?this['available']:0x0;var _0xf9f88f={'id':this['id'],'available':this[_0xdb94('0x17')],'loggedIn':this[_0xdb94('0x12')],'name':this[_0xdb94('0x8')],'paused':this[_0xdb94('0x16')],'waiting':this[_0xdb94('0xd')]};var _0x4d939d=md5(JSON[_0xdb94('0x18')](_0xf9f88f));if(this[_0xdb94('0x1')]!==_0x4d939d){this['md5']=_0x4d939d;io['to'](util['format'](_0xdb94('0x19'),_0xf9f88f[_0xdb94('0x8')]))['emit'](_0xdb94('0x1a'),_0xf9f88f);}};module['exports']=ChatQueue; \ No newline at end of file +var _0x2410=['defaults','localhost','socket.io-emitter','redis','name','timeout','strategy','Agents','updateRouting','prototype','_rr','mapAgentsId','map','updateRealtime','loggedIn','paused','online','chatPause','available','waiting','stringify','format','emit','chat_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment'];(function(_0x5811eb,_0x26e0aa){var _0x5ab6d1=function(_0x25fd2f){while(--_0x25fd2f){_0x5811eb['push'](_0x5811eb['shift']());}};_0x5ab6d1(++_0x26e0aa);}(_0x2410,0x1db));var _0x0241=function(_0x4d47a3,_0x497b2e){_0x4d47a3=_0x4d47a3-0x0;var _0x48c3a3=_0x2410[_0x4d47a3];return _0x48c3a3;};'use strict';var _=require(_0x0241('0x0'));var md5=require(_0x0241('0x1'));var util=require(_0x0241('0x2'));var Redis=require(_0x0241('0x3'));var config=require(_0x0241('0x4'));config['redis']=_[_0x0241('0x5')](config['redis'],{'host':_0x0241('0x6'),'port':0x18eb});var io=require(_0x0241('0x7'))(new Redis(config[_0x0241('0x8')]));function ChatQueue(_0x217782){this['id']=_0x217782['id']||0x0;this[_0x0241('0x9')]=_0x217782['name']||'';this[_0x0241('0xa')]=_0x217782[_0x0241('0xa')]||0xa;this[_0x0241('0xb')]=_0x217782[_0x0241('0xb')]||'beepall';this[_0x0241('0xc')]=_0x217782[_0x0241('0xc')];this['mapAgentsId']={};this['waiting']=0x0;this[_0x0241('0x1')]='';this[_0x0241('0xd')]();this['updateRealtime']();}ChatQueue[_0x0241('0xe')]['updateRouting']=function(){var _0x4fd2c4=this['mapAgentsId'][_0x0241('0xf')];this[_0x0241('0x10')]=_[_0x0241('0x11')](this['Agents'],'id');this[_0x0241('0x10')][_0x0241('0xf')]=_0x4fd2c4;};ChatQueue[_0x0241('0xe')][_0x0241('0x12')]=function(){this[_0x0241('0x13')]=0x0;this[_0x0241('0x14')]=0x0;for(var _0x3b4262=0x0;_0x3b4262=0x0?this[_0x0241('0x17')]:0x0;var _0x188766={'id':this['id'],'available':this[_0x0241('0x17')],'loggedIn':this[_0x0241('0x13')],'name':this[_0x0241('0x9')],'paused':this[_0x0241('0x14')],'waiting':this[_0x0241('0x18')]};var _0xb1e15b=md5(JSON[_0x0241('0x19')](_0x188766));if(this[_0x0241('0x1')]!==_0xb1e15b){this[_0x0241('0x1')]=_0xb1e15b;io['to'](util[_0x0241('0x1a')]('chat:queue:%s',_0x188766[_0x0241('0x9')]))[_0x0241('0x1b')](_0x0241('0x1c'),_0x188766);}};module[_0x0241('0x1d')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 877bbd4..b84979a 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(_0x554139,_0x2a7d90){var _0x4100b6=function(_0x4aabfe){while(--_0x4aabfe){_0x554139['push'](_0x554139['shift']());}};_0x4100b6(++_0x2a7d90);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'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(_0x1da744,_0x40b475){var _0x588db0=function(_0x7d4c16){while(--_0x7d4c16){_0x1da744['push'](_0x1da744['shift']());}};_0x588db0(++_0x40b475);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'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 ffc08ec..74670c0 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 _0x660e=['Intervals','exports','name'];(function(_0x3fd9ad,_0x1e58b6){var _0x57143b=function(_0x1c6a54){while(--_0x1c6a54){_0x3fd9ad['push'](_0x3fd9ad['shift']());}};_0x57143b(++_0x1e58b6);}(_0x660e,0x179));var _0xe660=function(_0x4f8550,_0x4ec1e7){_0x4f8550=_0x4f8550-0x0;var _0x3a1abd=_0x660e[_0x4f8550];return _0x3a1abd;};'use strict';function Interval(_0x5955eb){this['id']=_0x5955eb['id']||0x0;this[_0xe660('0x0')]=_0x5955eb[_0xe660('0x0')]||'';this['Intervals']=_0x5955eb[_0xe660('0x1')]||{};}module[_0xe660('0x2')]=Interval; \ No newline at end of file +var _0x720f=['Intervals','exports','name'];(function(_0x4bc4c8,_0x3139d3){var _0x3bb121=function(_0x95ad12){while(--_0x95ad12){_0x4bc4c8['push'](_0x4bc4c8['shift']());}};_0x3bb121(++_0x3139d3);}(_0x720f,0x80));var _0xf720=function(_0x292f93,_0x2c6e8e){_0x292f93=_0x292f93-0x0;var _0x5a94b1=_0x720f[_0x292f93];return _0x5a94b1;};'use strict';function Interval(_0x59e349){this['id']=_0x59e349['id']||0x0;this[_0xf720('0x0')]=_0x59e349[_0xf720('0x0')]||'';this[_0xf720('0x1')]=_0x59e349[_0xf720('0x1')]||{};}module[_0xf720('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 a919918..d5ad0ce 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 _0x41e0=['paused','online','available','waiting','format','mail:queue:%s','emit','mail_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','map','loggedIn'];(function(_0xb12e51,_0x35f8c4){var _0x3d8dd4=function(_0x3613ca){while(--_0x3613ca){_0xb12e51['push'](_0xb12e51['shift']());}};_0x3d8dd4(++_0x35f8c4);}(_0x41e0,0x18f));var _0x041e=function(_0x219d87,_0x1cb6f7){_0x219d87=_0x219d87-0x0;var _0x22823d=_0x41e0[_0x219d87];return _0x22823d;};'use strict';var _=require(_0x041e('0x0'));var md5=require(_0x041e('0x1'));var util=require(_0x041e('0x2'));var Redis=require(_0x041e('0x3'));var config=require(_0x041e('0x4'));config[_0x041e('0x5')]=_[_0x041e('0x6')](config[_0x041e('0x5')],{'host':_0x041e('0x7'),'port':0x18eb});var io=require(_0x041e('0x8'))(new Redis(config[_0x041e('0x5')]));function MailQueue(_0x144c23){this['id']=_0x144c23['id']||0x0;this[_0x041e('0x9')]=_0x144c23[_0x041e('0x9')]||'';this[_0x041e('0xa')]=_0x144c23[_0x041e('0xa')]||0xa;this[_0x041e('0xb')]=_0x144c23['strategy']||_0x041e('0xc');this[_0x041e('0xd')]=_0x144c23[_0x041e('0xd')];this[_0x041e('0xe')]={};this['waiting']=0x0;this[_0x041e('0x1')]='';this[_0x041e('0xf')]();this[_0x041e('0x10')]();}MailQueue[_0x041e('0x11')]['updateRouting']=function(){var _0x45c02c=this['mapAgentsId'][_0x041e('0x12')];this[_0x041e('0xe')]=_[_0x041e('0x13')](this['Agents'],'id');this[_0x041e('0xe')][_0x041e('0x12')]=_0x45c02c;};MailQueue[_0x041e('0x11')]['updateRealtime']=function(){this[_0x041e('0x14')]=0x0;this[_0x041e('0x15')]=0x0;for(var _0x1fdf2c=0x0;_0x1fdf2c=0x0?this[_0x041e('0x17')]:0x0;var _0x737a2d={'id':this['id'],'available':this[_0x041e('0x17')],'loggedIn':this[_0x041e('0x14')],'name':this[_0x041e('0x9')],'paused':this[_0x041e('0x15')],'waiting':this[_0x041e('0x18')]};var _0x1e3960=md5(JSON['stringify'](_0x737a2d));if(this[_0x041e('0x1')]!==_0x1e3960){this[_0x041e('0x1')]=_0x1e3960;io['to'](util[_0x041e('0x19')](_0x041e('0x1a'),_0x737a2d[_0x041e('0x9')]))[_0x041e('0x1b')](_0x041e('0x1c'),_0x737a2d);}};module[_0x041e('0x1d')]=MailQueue; \ No newline at end of file +var _0x99b7=['map','updateRealtime','loggedIn','paused','length','online','mailPause','available','format','emit','mail_queue:save','exports','lodash','md5','ioredis','defaults','redis','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','prototype','updateRouting','_rr'];(function(_0x40c92e,_0x7a4732){var _0x4a7ffa=function(_0x24b240){while(--_0x24b240){_0x40c92e['push'](_0x40c92e['shift']());}};_0x4a7ffa(++_0x7a4732);}(_0x99b7,0x1e8));var _0x799b=function(_0x1bc013,_0x7771c6){_0x1bc013=_0x1bc013-0x0;var _0x55df36=_0x99b7[_0x1bc013];return _0x55df36;};'use strict';var _=require(_0x799b('0x0'));var md5=require(_0x799b('0x1'));var util=require('util');var Redis=require(_0x799b('0x2'));var config=require('../../../config/environment');config['redis']=_[_0x799b('0x3')](config[_0x799b('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x799b('0x5'))(new Redis(config[_0x799b('0x4')]));function MailQueue(_0x3038c0){this['id']=_0x3038c0['id']||0x0;this[_0x799b('0x6')]=_0x3038c0[_0x799b('0x6')]||'';this[_0x799b('0x7')]=_0x3038c0[_0x799b('0x7')]||0xa;this[_0x799b('0x8')]=_0x3038c0[_0x799b('0x8')]||_0x799b('0x9');this[_0x799b('0xa')]=_0x3038c0['Agents'];this[_0x799b('0xb')]={};this[_0x799b('0xc')]=0x0;this['md5']='';this['updateRouting']();this['updateRealtime']();}MailQueue[_0x799b('0xd')][_0x799b('0xe')]=function(){var _0x54776b=this['mapAgentsId'][_0x799b('0xf')];this[_0x799b('0xb')]=_[_0x799b('0x10')](this[_0x799b('0xa')],'id');this[_0x799b('0xb')]['_rr']=_0x54776b;};MailQueue['prototype'][_0x799b('0x11')]=function(){this[_0x799b('0x12')]=0x0;this[_0x799b('0x13')]=0x0;for(var _0x57411c=0x0;_0x57411c=0x0?this[_0x799b('0x17')]:0x0;var _0x7d6b90={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0x799b('0x6')],'paused':this[_0x799b('0x13')],'waiting':this[_0x799b('0xc')]};var _0x2fb130=md5(JSON['stringify'](_0x7d6b90));if(this['md5']!==_0x2fb130){this[_0x799b('0x1')]=_0x2fb130;io['to'](util[_0x799b('0x18')]('mail:queue:%s',_0x7d6b90[_0x799b('0x6')]))[_0x799b('0x19')](_0x799b('0x1a'),_0x7d6b90);}};module[_0x799b('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 e59c681..6cc4de2 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 _0x81e0=['util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','prototype','_rr','loggedIn','paused','length','online','openchannelPause','available','format','openchannel:queue:%s','emit','openchannel_queue:save','lodash','md5'];(function(_0x355f14,_0x42b14c){var _0x472a5d=function(_0x546a66){while(--_0x546a66){_0x355f14['push'](_0x355f14['shift']());}};_0x472a5d(++_0x42b14c);}(_0x81e0,0x6e));var _0x081e=function(_0x3190a7,_0x1e36f6){_0x3190a7=_0x3190a7-0x0;var _0x1d5eb3=_0x81e0[_0x3190a7];return _0x1d5eb3;};'use strict';var _=require(_0x081e('0x0'));var md5=require(_0x081e('0x1'));var util=require(_0x081e('0x2'));var Redis=require(_0x081e('0x3'));var config=require(_0x081e('0x4'));config['redis']=_['defaults'](config[_0x081e('0x5')],{'host':_0x081e('0x6'),'port':0x18eb});var io=require(_0x081e('0x7'))(new Redis(config[_0x081e('0x5')]));function OpenchannelQueue(_0x17505b){this['id']=_0x17505b['id']||0x0;this[_0x081e('0x8')]=_0x17505b['name']||'';this[_0x081e('0x9')]=_0x17505b[_0x081e('0x9')]||0xa;this[_0x081e('0xa')]=_0x17505b[_0x081e('0xa')]||_0x081e('0xb');this['Agents']=_0x17505b[_0x081e('0xc')];this[_0x081e('0xd')]={};this[_0x081e('0xe')]=0x0;this[_0x081e('0x1')]='';this['updateRouting']();this[_0x081e('0xf')]();}OpenchannelQueue[_0x081e('0x10')]['updateRouting']=function(){var _0x401d01=this[_0x081e('0xd')][_0x081e('0x11')];this[_0x081e('0xd')]=_['map'](this[_0x081e('0xc')],'id');this['mapAgentsId'][_0x081e('0x11')]=_0x401d01;};OpenchannelQueue[_0x081e('0x10')][_0x081e('0xf')]=function(){this[_0x081e('0x12')]=0x0;this[_0x081e('0x13')]=0x0;for(var _0x1d3df0=0x0;_0x1d3df0=0x0?this[_0x081e('0x17')]:0x0;var _0x263bcd={'id':this['id'],'available':this[_0x081e('0x17')],'loggedIn':this[_0x081e('0x12')],'name':this[_0x081e('0x8')],'paused':this[_0x081e('0x13')],'waiting':this[_0x081e('0xe')]};var _0x3570fb=md5(JSON['stringify'](_0x263bcd));if(this[_0x081e('0x1')]!==_0x3570fb){this['md5']=_0x3570fb;io['to'](util[_0x081e('0x18')](_0x081e('0x19'),_0x263bcd[_0x081e('0x8')]))[_0x081e('0x1a')](_0x081e('0x1b'),_0x263bcd);}};module['exports']=OpenchannelQueue; \ No newline at end of file +var _0x73ef=['socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','prototype','_rr','map','updateRealtime','loggedIn','length','online','paused','available','waiting','stringify','format','openchannel:queue:%s','emit','openchannel_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','localhost'];(function(_0x28801e,_0x225be6){var _0x1fa728=function(_0x6d86fd){while(--_0x6d86fd){_0x28801e['push'](_0x28801e['shift']());}};_0x1fa728(++_0x225be6);}(_0x73ef,0x94));var _0xf73e=function(_0x5ce8c8,_0x3faf86){_0x5ce8c8=_0x5ce8c8-0x0;var _0x30ec0e=_0x73ef[_0x5ce8c8];return _0x30ec0e;};'use strict';var _=require(_0xf73e('0x0'));var md5=require(_0xf73e('0x1'));var util=require('util');var Redis=require(_0xf73e('0x2'));var config=require(_0xf73e('0x3'));config[_0xf73e('0x4')]=_[_0xf73e('0x5')](config[_0xf73e('0x4')],{'host':_0xf73e('0x6'),'port':0x18eb});var io=require(_0xf73e('0x7'))(new Redis(config['redis']));function OpenchannelQueue(_0x10bc7c){this['id']=_0x10bc7c['id']||0x0;this[_0xf73e('0x8')]=_0x10bc7c[_0xf73e('0x8')]||'';this['timeout']=_0x10bc7c[_0xf73e('0x9')]||0xa;this['strategy']=_0x10bc7c[_0xf73e('0xa')]||_0xf73e('0xb');this['Agents']=_0x10bc7c[_0xf73e('0xc')];this[_0xf73e('0xd')]={};this['waiting']=0x0;this[_0xf73e('0x1')]='';this[_0xf73e('0xe')]();this['updateRealtime']();}OpenchannelQueue[_0xf73e('0xf')][_0xf73e('0xe')]=function(){var _0x107f0a=this[_0xf73e('0xd')][_0xf73e('0x10')];this[_0xf73e('0xd')]=_[_0xf73e('0x11')](this[_0xf73e('0xc')],'id');this[_0xf73e('0xd')]['_rr']=_0x107f0a;};OpenchannelQueue[_0xf73e('0xf')][_0xf73e('0x12')]=function(){this[_0xf73e('0x13')]=0x0;this['paused']=0x0;for(var _0x25474d=0x0;_0x25474d=0x0?this[_0xf73e('0x17')]:0x0;var _0x4d4c21={'id':this['id'],'available':this[_0xf73e('0x17')],'loggedIn':this[_0xf73e('0x13')],'name':this['name'],'paused':this[_0xf73e('0x16')],'waiting':this[_0xf73e('0x18')]};var _0x2a1fba=md5(JSON[_0xf73e('0x19')](_0x4d4c21));if(this['md5']!==_0x2a1fba){this[_0xf73e('0x1')]=_0x2a1fba;io['to'](util[_0xf73e('0x1a')](_0xf73e('0x1b'),_0x4d4c21['name']))[_0xf73e('0x1c')](_0xf73e('0x1d'),_0x4d4c21);}};module[_0xf73e('0x1e')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index a392bf0..5999914 100644 --- a/server/services/routing/model/smsQueue.js +++ b/server/services/routing/model/smsQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['smsPause','paused','available','stringify','sms:queue:%s','emit','sms_queue:save','exports','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','md5','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','loggedIn','length','online'];(function(_0x1b3c46,_0x44dc2a){var _0x218b70=function(_0x51228b){while(--_0x51228b){_0x1b3c46['push'](_0x1b3c46['shift']());}};_0x218b70(++_0x44dc2a);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0x3071('0x0'));var Redis=require(_0x3071('0x1'));var config=require(_0x3071('0x2'));config[_0x3071('0x3')]=_[_0x3071('0x4')](config['redis'],{'host':_0x3071('0x5'),'port':0x18eb});var io=require(_0x3071('0x6'))(new Redis(config[_0x3071('0x3')]));function SmsQueue(_0x3137c8){this['id']=_0x3137c8['id']||0x0;this[_0x3071('0x7')]=_0x3137c8[_0x3071('0x7')]||'';this[_0x3071('0x8')]=_0x3137c8[_0x3071('0x8')]||0xa;this[_0x3071('0x9')]=_0x3137c8[_0x3071('0x9')]||_0x3071('0xa');this[_0x3071('0xb')]=_0x3137c8[_0x3071('0xb')];this['mapAgentsId']={};this[_0x3071('0xc')]=0x0;this[_0x3071('0xd')]='';this[_0x3071('0xe')]();this[_0x3071('0xf')]();}SmsQueue[_0x3071('0x10')]['updateRouting']=function(){var _0x2ace21=this[_0x3071('0x11')][_0x3071('0x12')];this[_0x3071('0x11')]=_[_0x3071('0x13')](this['Agents'],'id');this['mapAgentsId'][_0x3071('0x12')]=_0x2ace21;};SmsQueue['prototype'][_0x3071('0xf')]=function(){this[_0x3071('0x14')]=0x0;this['paused']=0x0;for(var _0x104e73=0x0;_0x104e73=0x0?this[_0x3071('0x19')]:0x0;var _0x1068d9={'id':this['id'],'available':this[_0x3071('0x19')],'loggedIn':this[_0x3071('0x14')],'name':this[_0x3071('0x7')],'paused':this[_0x3071('0x18')],'waiting':this[_0x3071('0xc')]};var _0x502a16=md5(JSON[_0x3071('0x1a')](_0x1068d9));if(this[_0x3071('0xd')]!==_0x502a16){this[_0x3071('0xd')]=_0x502a16;io['to'](util['format'](_0x3071('0x1b'),_0x1068d9['name']))[_0x3071('0x1c')](_0x3071('0x1d'),_0x1068d9);}};module[_0x3071('0x1e')]=SmsQueue; \ No newline at end of file +var _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(_0x87d3ec,_0x387888){var _0x5f3f6f=function(_0x5492ac){while(--_0x5492ac){_0x87d3ec['push'](_0x87d3ec['shift']());}};_0x5f3f6f(++_0x387888);}(_0x757a,0xde));var _0xa757=function(_0x13ddb1,_0x19a7bf){_0x13ddb1=_0x13ddb1-0x0;var _0x5c5d1b=_0x757a[_0x13ddb1];return _0x5c5d1b;};'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 diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index d1d285b..e79d383 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 _0x77ae=['updateRealtime','initChatQueues','initSmsQueues','initMailQueues','initFaxQueues','bluebird','util','lodash','../model/agent','../model/interval','../model/chatQueue','../model/mailQueue','agents','chatQueues','smsQueues','mailQueues','faxQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','mapKeys','prototype','mergeFromDatabase','initAgents','isUndefined','intervals','length','initOpenchannelQueues','openchannelQueues','updateRouting'];(function(_0x489792,_0x5344f3){var _0x410393=function(_0x3147fb){while(--_0x3147fb){_0x489792['push'](_0x489792['shift']());}};_0x410393(++_0x5344f3);}(_0x77ae,0xa5));var _0xe77a=function(_0x532ff5,_0x58b785){_0x532ff5=_0x532ff5-0x0;var _0x3a24f9=_0x77ae[_0x532ff5];return _0x3a24f9;};'use strict';var BPromise=require(_0xe77a('0x0'));var util=require(_0xe77a('0x1'));var _=require(_0xe77a('0x2'));var moment=require('moment');var Agent=require(_0xe77a('0x3'));var Interval=require(_0xe77a('0x4'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0xe77a('0x5'));var SmsQueue=require('../model/smsQueue');var MailQueue=require(_0xe77a('0x6'));var FaxQueue=require('../model/faxQueue');var Realtime=function(){this[_0xe77a('0x7')]={};this['intervals']={};this['openchannelQueues']={};this[_0xe77a('0x8')]={};this[_0xe77a('0x9')]={};this[_0xe77a('0xa')]={};this[_0xe77a('0xb')]={};this[_0xe77a('0xc')]={};this[_0xe77a('0xd')]={};this[_0xe77a('0xe')]={};this[_0xe77a('0xf')]={};this[_0xe77a('0x10')]={};};function freeIsNotKey(_0x5f3a2a,_0x1ff205,_0x18b9af){var _0x40f9d4=_[_0xe77a('0x11')](_0x5f3a2a,function(_0x2bb4e5,_0x537fb8){return _0x2bb4e5[_0x18b9af];});for(var _0x5e0446 in _0x1ff205){if(_0x1ff205['hasOwnProperty'](_0x5e0446)){if(!_0x40f9d4[_0x5e0446]){delete _0x1ff205[_0x5e0446];}}}}Realtime[_0xe77a('0x12')][_0xe77a('0x13')]=function(_0xd21c0f,_0x3807ba){for(var _0x437ef5 in _0x3807ba){if(_0xd21c0f['hasOwnProperty'](_0x437ef5)){_0xd21c0f[_0x437ef5]=_0x3807ba[_0x437ef5];}}};Realtime['prototype'][_0xe77a('0x14')]=function(){var _0x4dc82e=this;return function(_0xa47d94){if(_0xa47d94){freeIsNotKey(_0xa47d94,_0x4dc82e[_0xe77a('0x7')],'id');for(var _0xccfe04=0x0,_0x191eef={},_0x5e46f5={};_0xccfe04<_0xa47d94['length'];_0xccfe04+=0x1){_0x191eef=_0xa47d94[_0xccfe04];if(_[_0xe77a('0x15')](_0x4dc82e[_0xe77a('0x7')][_0x191eef['id']])){_0x4dc82e[_0xe77a('0x7')][_0x191eef['id']]=new Agent(_0x191eef);}else{_0x4dc82e[_0xe77a('0x13')](_0x4dc82e[_0xe77a('0x7')][_0x191eef['id']],_0x191eef);}}}return _0x4dc82e[_0xe77a('0x7')];};};Realtime[_0xe77a('0x12')]['initIntervals']=function(){var _0x592e10=this;return function(_0x39b386){if(_0x39b386){freeIsNotKey(_0x39b386,_0x592e10[_0xe77a('0x16')],'id');for(var _0x430df6=0x0,_0x5d3eab={},_0x326064={};_0x430df6<_0x39b386[_0xe77a('0x17')];_0x430df6+=0x1){_0x5d3eab=_0x39b386[_0x430df6];if(_[_0xe77a('0x15')](_0x592e10[_0xe77a('0x16')][_0x5d3eab['id']])){_0x592e10[_0xe77a('0x16')][_0x5d3eab['id']]=new Interval(_0x5d3eab);}else{_0x592e10[_0xe77a('0x13')](_0x592e10['intervals'][_0x5d3eab['id']],_0x5d3eab);}}}return _0x592e10[_0xe77a('0x16')];};};Realtime['prototype'][_0xe77a('0x18')]=function(){var _0x15b9e0=this;return function(_0x1d0d98){if(_0x1d0d98){freeIsNotKey(_0x1d0d98,_0x15b9e0[_0xe77a('0x19')],'id');for(var _0x3acca5=0x0,_0x5e574a={},_0x1e9f8c={};_0x3acca5<_0x1d0d98[_0xe77a('0x17')];_0x3acca5+=0x1){_0x5e574a=_0x1d0d98[_0x3acca5];if(_[_0xe77a('0x15')](_0x15b9e0[_0xe77a('0x19')][_0x5e574a['id']])){_0x15b9e0[_0xe77a('0x19')][_0x5e574a['id']]=new OpenchannelQueue(_0x5e574a);}else{_0x15b9e0[_0xe77a('0x13')](_0x15b9e0[_0xe77a('0x19')][_0x5e574a['id']],_0x5e574a);}_0x15b9e0[_0xe77a('0x19')][_0x5e574a['id']][_0xe77a('0x1a')]();_0x15b9e0[_0xe77a('0x19')][_0x5e574a['id']][_0xe77a('0x1b')]();}}return _0x15b9e0[_0xe77a('0x19')];};};Realtime[_0xe77a('0x12')][_0xe77a('0x1c')]=function(){var _0x42396e=this;return function(_0x532ac4){if(_0x532ac4){freeIsNotKey(_0x532ac4,_0x42396e[_0xe77a('0x8')],'id');for(var _0x2e06d0=0x0,_0x5e1eca={},_0x3acb94={};_0x2e06d0<_0x532ac4[_0xe77a('0x17')];_0x2e06d0+=0x1){_0x5e1eca=_0x532ac4[_0x2e06d0];if(_[_0xe77a('0x15')](_0x42396e[_0xe77a('0x8')][_0x5e1eca['id']])){_0x42396e[_0xe77a('0x8')][_0x5e1eca['id']]=new ChatQueue(_0x5e1eca);}else{_0x42396e[_0xe77a('0x13')](_0x42396e['chatQueues'][_0x5e1eca['id']],_0x5e1eca);}_0x42396e[_0xe77a('0x8')][_0x5e1eca['id']][_0xe77a('0x1a')]();_0x42396e[_0xe77a('0x8')][_0x5e1eca['id']][_0xe77a('0x1b')]();}}return _0x42396e[_0xe77a('0x8')];};};Realtime['prototype'][_0xe77a('0x1d')]=function(){var _0xd27fd4=this;return function(_0x4e41a0){if(_0x4e41a0){freeIsNotKey(_0x4e41a0,_0xd27fd4[_0xe77a('0x9')],'id');for(var _0x286200=0x0,_0x4c9f0d={},_0x5526f2={};_0x286200<_0x4e41a0['length'];_0x286200+=0x1){_0x4c9f0d=_0x4e41a0[_0x286200];if(_[_0xe77a('0x15')](_0xd27fd4['smsQueues'][_0x4c9f0d['id']])){_0xd27fd4[_0xe77a('0x9')][_0x4c9f0d['id']]=new SmsQueue(_0x4c9f0d);}else{_0xd27fd4[_0xe77a('0x13')](_0xd27fd4[_0xe77a('0x9')][_0x4c9f0d['id']],_0x4c9f0d);}_0xd27fd4['smsQueues'][_0x4c9f0d['id']]['updateRouting']();_0xd27fd4[_0xe77a('0x9')][_0x4c9f0d['id']][_0xe77a('0x1b')]();}}return _0xd27fd4[_0xe77a('0x9')];};};Realtime['prototype'][_0xe77a('0x1e')]=function(){var _0x4f5f6a=this;return function(_0x48c642){if(_0x48c642){freeIsNotKey(_0x48c642,_0x4f5f6a[_0xe77a('0xa')],'id');for(var _0x4f39f8=0x0,_0x31ffba={},_0x4548ab={};_0x4f39f8<_0x48c642['length'];_0x4f39f8+=0x1){_0x31ffba=_0x48c642[_0x4f39f8];if(_['isUndefined'](_0x4f5f6a[_0xe77a('0xa')][_0x31ffba['id']])){_0x4f5f6a[_0xe77a('0xa')][_0x31ffba['id']]=new MailQueue(_0x31ffba);}else{_0x4f5f6a[_0xe77a('0x13')](_0x4f5f6a[_0xe77a('0xa')][_0x31ffba['id']],_0x31ffba);}_0x4f5f6a[_0xe77a('0xa')][_0x31ffba['id']]['updateRouting']();_0x4f5f6a['mailQueues'][_0x31ffba['id']][_0xe77a('0x1b')]();}}return _0x4f5f6a[_0xe77a('0xa')];};};Realtime['prototype'][_0xe77a('0x1f')]=function(){var _0x59481a=this;return function(_0x28add6){if(_0x28add6){freeIsNotKey(_0x28add6,_0x59481a['faxQueues'],'id');for(var _0x59eaa2=0x0,_0x5e9f14={},_0x4cb57a={};_0x59eaa2<_0x28add6[_0xe77a('0x17')];_0x59eaa2+=0x1){_0x5e9f14=_0x28add6[_0x59eaa2];if(_[_0xe77a('0x15')](_0x59481a[_0xe77a('0xb')][_0x5e9f14['id']])){_0x59481a[_0xe77a('0xb')][_0x5e9f14['id']]=new FaxQueue(_0x5e9f14);}else{_0x59481a[_0xe77a('0x13')](_0x59481a[_0xe77a('0xb')][_0x5e9f14['id']],_0x5e9f14);}_0x59481a[_0xe77a('0xb')][_0x5e9f14['id']][_0xe77a('0x1a')]();_0x59481a[_0xe77a('0xb')][_0x5e9f14['id']][_0xe77a('0x1b')]();}}return _0x59481a[_0xe77a('0xb')];};};module['exports']=Realtime; \ No newline at end of file +var _0x7645=['../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','agents','intervals','openchannelQueues','smsQueues','mailQueues','faxQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','mergeFromDatabase','prototype','initAgents','length','isUndefined','initIntervals','initOpenchannelQueues','updateRouting','initChatQueues','chatQueues','initSmsQueues','updateRealtime','initFaxQueues','exports','bluebird','lodash','../model/agent','../model/interval','../model/openchannelQueue'];(function(_0x355707,_0x328f3e){var _0x58dbb4=function(_0x57ab16){while(--_0x57ab16){_0x355707['push'](_0x355707['shift']());}};_0x58dbb4(++_0x328f3e);}(_0x7645,0x17c));var _0x5764=function(_0xab3630,_0x3484c3){_0xab3630=_0xab3630-0x0;var _0x5310dd=_0x7645[_0xab3630];return _0x5310dd;};'use strict';var BPromise=require(_0x5764('0x0'));var util=require('util');var _=require(_0x5764('0x1'));var moment=require('moment');var Agent=require(_0x5764('0x2'));var Interval=require(_0x5764('0x3'));var OpenchannelQueue=require(_0x5764('0x4'));var ChatQueue=require(_0x5764('0x5'));var SmsQueue=require(_0x5764('0x6'));var MailQueue=require(_0x5764('0x7'));var FaxQueue=require(_0x5764('0x8'));var Realtime=function(){this[_0x5764('0x9')]={};this[_0x5764('0xa')]={};this[_0x5764('0xb')]={};this['chatQueues']={};this[_0x5764('0xc')]={};this[_0x5764('0xd')]={};this[_0x5764('0xe')]={};this[_0x5764('0xf')]={};this[_0x5764('0x10')]={};this[_0x5764('0x11')]={};this[_0x5764('0x12')]={};this['faxQueuesWaitingInteractions']={};};function freeIsNotKey(_0x22b37e,_0x280e93,_0x1f51f4){var _0x15009c=_[_0x5764('0x13')](_0x22b37e,function(_0xabb41a,_0x54fb07){return _0xabb41a[_0x1f51f4];});for(var _0x28ed64 in _0x280e93){if(_0x280e93[_0x5764('0x14')](_0x28ed64)){if(!_0x15009c[_0x28ed64]){delete _0x280e93[_0x28ed64];}}}}Realtime['prototype'][_0x5764('0x15')]=function(_0x448607,_0x21be71){for(var _0x4cb336 in _0x21be71){if(_0x448607[_0x5764('0x14')](_0x4cb336)){_0x448607[_0x4cb336]=_0x21be71[_0x4cb336];}}};Realtime[_0x5764('0x16')][_0x5764('0x17')]=function(){var _0x33f833=this;return function(_0x9fdadc){if(_0x9fdadc){freeIsNotKey(_0x9fdadc,_0x33f833[_0x5764('0x9')],'id');for(var _0x2f7ba7=0x0,_0x2b7a66={},_0x35a160={};_0x2f7ba7<_0x9fdadc[_0x5764('0x18')];_0x2f7ba7+=0x1){_0x2b7a66=_0x9fdadc[_0x2f7ba7];if(_[_0x5764('0x19')](_0x33f833[_0x5764('0x9')][_0x2b7a66['id']])){_0x33f833['agents'][_0x2b7a66['id']]=new Agent(_0x2b7a66);}else{_0x33f833[_0x5764('0x15')](_0x33f833[_0x5764('0x9')][_0x2b7a66['id']],_0x2b7a66);}}}return _0x33f833[_0x5764('0x9')];};};Realtime[_0x5764('0x16')][_0x5764('0x1a')]=function(){var _0x16b558=this;return function(_0x4c34f9){if(_0x4c34f9){freeIsNotKey(_0x4c34f9,_0x16b558[_0x5764('0xa')],'id');for(var _0xafa8f2=0x0,_0xf77126={},_0x30a5e6={};_0xafa8f2<_0x4c34f9[_0x5764('0x18')];_0xafa8f2+=0x1){_0xf77126=_0x4c34f9[_0xafa8f2];if(_[_0x5764('0x19')](_0x16b558['intervals'][_0xf77126['id']])){_0x16b558['intervals'][_0xf77126['id']]=new Interval(_0xf77126);}else{_0x16b558[_0x5764('0x15')](_0x16b558[_0x5764('0xa')][_0xf77126['id']],_0xf77126);}}}return _0x16b558[_0x5764('0xa')];};};Realtime[_0x5764('0x16')][_0x5764('0x1b')]=function(){var _0x33441f=this;return function(_0x3b07e6){if(_0x3b07e6){freeIsNotKey(_0x3b07e6,_0x33441f['openchannelQueues'],'id');for(var _0x5cb931=0x0,_0x4624fe={},_0xdba225={};_0x5cb931<_0x3b07e6[_0x5764('0x18')];_0x5cb931+=0x1){_0x4624fe=_0x3b07e6[_0x5cb931];if(_[_0x5764('0x19')](_0x33441f[_0x5764('0xb')][_0x4624fe['id']])){_0x33441f[_0x5764('0xb')][_0x4624fe['id']]=new OpenchannelQueue(_0x4624fe);}else{_0x33441f['mergeFromDatabase'](_0x33441f[_0x5764('0xb')][_0x4624fe['id']],_0x4624fe);}_0x33441f[_0x5764('0xb')][_0x4624fe['id']][_0x5764('0x1c')]();_0x33441f['openchannelQueues'][_0x4624fe['id']]['updateRealtime']();}}return _0x33441f[_0x5764('0xb')];};};Realtime[_0x5764('0x16')][_0x5764('0x1d')]=function(){var _0x3b25f7=this;return function(_0x240441){if(_0x240441){freeIsNotKey(_0x240441,_0x3b25f7[_0x5764('0x1e')],'id');for(var _0x180c78=0x0,_0x6a1ae2={},_0x5db082={};_0x180c78<_0x240441[_0x5764('0x18')];_0x180c78+=0x1){_0x6a1ae2=_0x240441[_0x180c78];if(_[_0x5764('0x19')](_0x3b25f7[_0x5764('0x1e')][_0x6a1ae2['id']])){_0x3b25f7['chatQueues'][_0x6a1ae2['id']]=new ChatQueue(_0x6a1ae2);}else{_0x3b25f7['mergeFromDatabase'](_0x3b25f7[_0x5764('0x1e')][_0x6a1ae2['id']],_0x6a1ae2);}_0x3b25f7['chatQueues'][_0x6a1ae2['id']][_0x5764('0x1c')]();_0x3b25f7[_0x5764('0x1e')][_0x6a1ae2['id']]['updateRealtime']();}}return _0x3b25f7[_0x5764('0x1e')];};};Realtime[_0x5764('0x16')][_0x5764('0x1f')]=function(){var _0x20895d=this;return function(_0x524915){if(_0x524915){freeIsNotKey(_0x524915,_0x20895d[_0x5764('0xc')],'id');for(var _0xc366be=0x0,_0x217f51={},_0x5eff94={};_0xc366be<_0x524915[_0x5764('0x18')];_0xc366be+=0x1){_0x217f51=_0x524915[_0xc366be];if(_[_0x5764('0x19')](_0x20895d[_0x5764('0xc')][_0x217f51['id']])){_0x20895d['smsQueues'][_0x217f51['id']]=new SmsQueue(_0x217f51);}else{_0x20895d['mergeFromDatabase'](_0x20895d['smsQueues'][_0x217f51['id']],_0x217f51);}_0x20895d[_0x5764('0xc')][_0x217f51['id']][_0x5764('0x1c')]();_0x20895d[_0x5764('0xc')][_0x217f51['id']][_0x5764('0x20')]();}}return _0x20895d[_0x5764('0xc')];};};Realtime[_0x5764('0x16')]['initMailQueues']=function(){var _0x2e8f63=this;return function(_0x28a34f){if(_0x28a34f){freeIsNotKey(_0x28a34f,_0x2e8f63[_0x5764('0xd')],'id');for(var _0x4094b5=0x0,_0x56937c={},_0x564874={};_0x4094b5<_0x28a34f['length'];_0x4094b5+=0x1){_0x56937c=_0x28a34f[_0x4094b5];if(_[_0x5764('0x19')](_0x2e8f63[_0x5764('0xd')][_0x56937c['id']])){_0x2e8f63[_0x5764('0xd')][_0x56937c['id']]=new MailQueue(_0x56937c);}else{_0x2e8f63['mergeFromDatabase'](_0x2e8f63['mailQueues'][_0x56937c['id']],_0x56937c);}_0x2e8f63[_0x5764('0xd')][_0x56937c['id']]['updateRouting']();_0x2e8f63[_0x5764('0xd')][_0x56937c['id']][_0x5764('0x20')]();}}return _0x2e8f63[_0x5764('0xd')];};};Realtime['prototype'][_0x5764('0x21')]=function(){var _0x304743=this;return function(_0x31ce62){if(_0x31ce62){freeIsNotKey(_0x31ce62,_0x304743[_0x5764('0xe')],'id');for(var _0x2379df=0x0,_0x5b257e={},_0x4edff2={};_0x2379df<_0x31ce62[_0x5764('0x18')];_0x2379df+=0x1){_0x5b257e=_0x31ce62[_0x2379df];if(_['isUndefined'](_0x304743['faxQueues'][_0x5b257e['id']])){_0x304743['faxQueues'][_0x5b257e['id']]=new FaxQueue(_0x5b257e);}else{_0x304743[_0x5764('0x15')](_0x304743[_0x5764('0xe')][_0x5b257e['id']],_0x5b257e);}_0x304743[_0x5764('0xe')][_0x5b257e['id']]['updateRouting']();_0x304743[_0x5764('0xe')][_0x5b257e['id']][_0x5764('0x20')]();}}return _0x304743[_0x5764('0xe')];};};module[_0x5764('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 6c8fa5f..e4bfd2f 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 _0xb9e4=['Request','UpdateChatInteraction','updateChatInteraction','addTags','AddTagsToChatInteraction','../client','update'];(function(_0x578275,_0xe7ae46){var _0xf78041=function(_0x13148c){while(--_0x13148c){_0x578275['push'](_0x578275['shift']());}};_0xf78041(++_0xe7ae46);}(_0xb9e4,0x83));var _0x4b9e=function(_0x2ddbcd,_0x3ae56a){_0x2ddbcd=_0x2ddbcd-0x0;var _0x5b6830=_0xb9e4[_0x2ddbcd];return _0x5b6830;};'use strict';var client=require(_0x4b9e('0x0'));exports[_0x4b9e('0x1')]=function(_0x492fc1,_0x35c93b){return client[_0x4b9e('0x2')](_0x4b9e('0x3'),{'body':_0x35c93b,'options':{'where':{'id':_0x492fc1}},'log':_0x4b9e('0x4')});};exports[_0x4b9e('0x5')]=function(_0xcf08a9,_0x537cfe){return client[_0x4b9e('0x2')](_0x4b9e('0x6'),{'body':_0x537cfe,'options':{'where':{'id':_0xcf08a9}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x6776=['UpdateChatInteraction','updateChatInteraction','addTags','Request','AddTagsToChatInteraction','../client','update'];(function(_0xcaf33e,_0x3734c6){var _0x263423=function(_0x53e51b){while(--_0x53e51b){_0xcaf33e['push'](_0xcaf33e['shift']());}};_0x263423(++_0x3734c6);}(_0x6776,0x171));var _0x6677=function(_0x127b25,_0x135632){_0x127b25=_0x127b25-0x0;var _0x137db2=_0x6776[_0x127b25];return _0x137db2;};'use strict';var client=require(_0x6677('0x0'));exports[_0x6677('0x1')]=function(_0xdc4d05,_0x135e26){return client['Request'](_0x6677('0x2'),{'body':_0x135e26,'options':{'where':{'id':_0xdc4d05}},'log':_0x6677('0x3')});};exports[_0x6677('0x4')]=function(_0xae8216,_0x43501a){return client[_0x6677('0x5')](_0x6677('0x6'),{'body':_0x43501a,'options':{'where':{'id':_0xae8216}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 5b66c54..366782c 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 _0xd351=['createChatMessage','Request','CreateChatMessage'];(function(_0x5c9307,_0x5b97e4){var _0x373e29=function(_0xefebbd){while(--_0xefebbd){_0x5c9307['push'](_0x5c9307['shift']());}};_0x373e29(++_0x5b97e4);}(_0xd351,0x1c6));var _0x1d35=function(_0x2ea544,_0x49f9b0){_0x2ea544=_0x2ea544-0x0;var _0x243c60=_0xd351[_0x2ea544];return _0x243c60;};'use strict';var client=require('../client');exports['create']=function(_0x56b6d0){return client[_0x1d35('0x0')](_0x1d35('0x1'),{'body':_0x56b6d0,'log':_0x1d35('0x2')});}; \ No newline at end of file +var _0xc3e1=['CreateChatMessage','createChatMessage','../client','Request'];(function(_0x37eff2,_0x5c1639){var _0x3c9e7f=function(_0x17c6c6){while(--_0x17c6c6){_0x37eff2['push'](_0x37eff2['shift']());}};_0x3c9e7f(++_0x5c1639);}(_0xc3e1,0x92));var _0x1c3e=function(_0x5bb64d,_0x43a720){_0x5bb64d=_0x5bb64d-0x0;var _0xfc883=_0xc3e1[_0x5bb64d];return _0xfc883;};'use strict';var client=require(_0x1c3e('0x0'));exports['create']=function(_0x38a2a1){return client[_0x1c3e('0x1')](_0x1c3e('0x2'),{'body':_0x38a2a1,'log':_0x1c3e('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 140d5bd..d4910d1 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 _0xbab6=['../client','getChatQueues','Request','GetChatQueue','name','User','online','chatPause'];(function(_0x1b6c6d,_0x2983b0){var _0x290d9d=function(_0x5b9779){while(--_0x5b9779){_0x1b6c6d['push'](_0x1b6c6d['shift']());}};_0x290d9d(++_0x2983b0);}(_0xbab6,0x178));var _0x6bab=function(_0x522e3a,_0x50c8c9){_0x522e3a=_0x522e3a-0x0;var _0x562fc7=_0xbab6[_0x522e3a];return _0x562fc7;};'use strict';var client=require(_0x6bab('0x0'));exports[_0x6bab('0x1')]=function(){return function(){return client[_0x6bab('0x2')](_0x6bab('0x3'),{'options':{'raw':![],'attributes':['id',_0x6bab('0x4'),'timeout','strategy'],'include':[{'model':_0x6bab('0x5'),'as':'Agents','attributes':['id',_0x6bab('0x4'),_0x6bab('0x6'),_0x6bab('0x7')]}]},'log':_0x6bab('0x1')});};}; \ No newline at end of file +var _0x3e1f=['getChatQueues','Request','strategy','User','Agents','online','chatPause'];(function(_0x421b6d,_0x19ea53){var _0xf0ad7c=function(_0x2f81e3){while(--_0x2f81e3){_0x421b6d['push'](_0x421b6d['shift']());}};_0xf0ad7c(++_0x19ea53);}(_0x3e1f,0x173));var _0xf3e1=function(_0x3cb09b,_0x31c2a5){_0x3cb09b=_0x3cb09b-0x0;var _0x242048=_0x3e1f[_0x3cb09b];return _0x242048;};'use strict';var client=require('../client');exports[_0xf3e1('0x0')]=function(){return function(){return client[_0xf3e1('0x1')]('GetChatQueue',{'options':{'raw':![],'attributes':['id','name','timeout',_0xf3e1('0x2')],'include':[{'model':_0xf3e1('0x3'),'as':_0xf3e1('0x4'),'attributes':['id','name',_0xf3e1('0x5'),_0xf3e1('0x6')]}]},'log':'getChatQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index bd0f509..cd83c9e 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 _0xe105=['CreateChatQueueReport','update','UpdateChatQueueReport','DESC','../client'];(function(_0x332be0,_0x4c1e43){var _0x3d4319=function(_0x325ed4){while(--_0x325ed4){_0x332be0['push'](_0x332be0['shift']());}};_0x3d4319(++_0x4c1e43);}(_0xe105,0xef));var _0x5e10=function(_0x46c0ab,_0x3f8608){_0x46c0ab=_0x46c0ab-0x0;var _0x46021a=_0xe105[_0x46c0ab];return _0x46021a;};'use strict';var client=require(_0x5e10('0x0'));exports['create']=function(_0x4d5a73){return client['Request']('CreateChatQueueReport',{'body':_0x4d5a73,'log':_0x5e10('0x1')});};exports[_0x5e10('0x2')]=function(_0x1cddb3,_0x191ab2){return client['Request'](_0x5e10('0x3'),{'body':_0x191ab2,'options':{'where':{'uniqueid':_0x1cddb3},'order':[['id',_0x5e10('0x4')]],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file +var _0x8135=['CreateChatQueueReport','update','UpdateChatQueueReport','create','Request'];(function(_0x329fac,_0x12810b){var _0x32a292=function(_0x38298b){while(--_0x38298b){_0x329fac['push'](_0x329fac['shift']());}};_0x32a292(++_0x12810b);}(_0x8135,0x99));var _0x5813=function(_0x401877,_0x57e620){_0x401877=_0x401877-0x0;var _0x444338=_0x8135[_0x401877];return _0x444338;};'use strict';var client=require('../client');exports[_0x5813('0x0')]=function(_0x19e006){return client[_0x5813('0x1')](_0x5813('0x2'),{'body':_0x19e006,'log':'CreateChatQueueReport'});};exports[_0x5813('0x3')]=function(_0x196ea8,_0xf23c29){return client[_0x5813('0x1')](_0x5813('0x4'),{'body':_0xf23c29,'options':{'where':{'uniqueid':_0x196ea8},'order':[['id','DESC']],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index d513531..bde39e1 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 _0x8dd4=['update','Request','addTags','AddTagsToFaxInteraction','addTagsToFaxInteraction'];(function(_0x481bf7,_0x437f69){var _0x461787=function(_0xb3bc9d){while(--_0xb3bc9d){_0x481bf7['push'](_0x481bf7['shift']());}};_0x461787(++_0x437f69);}(_0x8dd4,0x16d));var _0x48dd=function(_0x59a93c,_0x3cd720){_0x59a93c=_0x59a93c-0x0;var _0x1fb9ac=_0x8dd4[_0x59a93c];return _0x1fb9ac;};'use strict';var client=require('../client');exports[_0x48dd('0x0')]=function(_0x5de1db,_0x2b3a59){return client[_0x48dd('0x1')]('UpdateFaxInteraction',{'body':_0x2b3a59,'options':{'where':{'id':_0x5de1db}},'log':'updateFaxInteraction'});};exports[_0x48dd('0x2')]=function(_0x38ad3b,_0x54dd63){return client[_0x48dd('0x1')](_0x48dd('0x3'),{'body':_0x54dd63,'options':{'where':{'id':_0x38ad3b}},'log':_0x48dd('0x4')});}; \ No newline at end of file +var _0x45c2=['addTagsToFaxInteraction','../client','Request','UpdateFaxInteraction','AddTagsToFaxInteraction'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x45c2,0x13c));var _0x245c=function(_0x4e1119,_0x32dc78){_0x4e1119=_0x4e1119-0x0;var _0x35f53d=_0x45c2[_0x4e1119];return _0x35f53d;};'use strict';var client=require(_0x245c('0x0'));exports['update']=function(_0x13940f,_0x48b14d){return client[_0x245c('0x1')](_0x245c('0x2'),{'body':_0x48b14d,'options':{'where':{'id':_0x13940f}},'log':'updateFaxInteraction'});};exports['addTags']=function(_0x40e6b3,_0x5215ab){return client[_0x245c('0x1')](_0x245c('0x3'),{'body':_0x5215ab,'options':{'where':{'id':_0x40e6b3}},'log':_0x245c('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index 07866dd..4d82ba8 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 _0xd174=['../client','Request','CreateFaxMessage','createFaxMessage'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0xd174,0x124));var _0x4d17=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd174[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x4d17('0x0'));exports['create']=function(_0x57ddfb){return client[_0x4d17('0x1')](_0x4d17('0x2'),{'body':_0x57ddfb,'log':_0x4d17('0x3')});}; \ No newline at end of file +var _0x2a99=['../client','create','CreateFaxMessage','createFaxMessage'];(function(_0x414bcd,_0x5e88b5){var _0x9ca809=function(_0x2ec505){while(--_0x2ec505){_0x414bcd['push'](_0x414bcd['shift']());}};_0x9ca809(++_0x5e88b5);}(_0x2a99,0x100));var _0x92a9=function(_0x391c55,_0x168617){_0x391c55=_0x391c55-0x0;var _0xa434e0=_0x2a99[_0x391c55];return _0xa434e0;};'use strict';var client=require(_0x92a9('0x0'));exports[_0x92a9('0x1')]=function(_0x5ea622){return client['Request'](_0x92a9('0x2'),{'body':_0x5ea622,'log':_0x92a9('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index a5a0f4c..45c2d0d 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 _0x76b4=['timeout','strategy','User','Agents','online','faxPause','getFaxQueues','Request','name'];(function(_0x512dfb,_0x1ade4a){var _0x466c7a=function(_0x58de19){while(--_0x58de19){_0x512dfb['push'](_0x512dfb['shift']());}};_0x466c7a(++_0x1ade4a);}(_0x76b4,0xba));var _0x476b=function(_0x1dc8f5,_0x280b42){_0x1dc8f5=_0x1dc8f5-0x0;var _0x5cedf3=_0x76b4[_0x1dc8f5];return _0x5cedf3;};'use strict';var client=require('../client');exports[_0x476b('0x0')]=function(){return function(){return client[_0x476b('0x1')]('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0x476b('0x2'),_0x476b('0x3'),_0x476b('0x4')],'include':[{'model':_0x476b('0x5'),'as':_0x476b('0x6'),'attributes':['id',_0x476b('0x2'),_0x476b('0x7'),_0x476b('0x8')]}]},'log':'getFaxQueues'});};}; \ No newline at end of file +var _0xa34c=['GetFaxQueue','name','timeout','strategy','User','faxPause','../client','getFaxQueues','Request'];(function(_0x174af8,_0x4416b5){var _0x56b0a1=function(_0x5f3472){while(--_0x5f3472){_0x174af8['push'](_0x174af8['shift']());}};_0x56b0a1(++_0x4416b5);}(_0xa34c,0xcc));var _0xca34=function(_0x5b4520,_0x1b61b1){_0x5b4520=_0x5b4520-0x0;var _0x592ad5=_0xa34c[_0x5b4520];return _0x592ad5;};'use strict';var client=require(_0xca34('0x0'));exports[_0xca34('0x1')]=function(){return function(){return client[_0xca34('0x2')](_0xca34('0x3'),{'options':{'raw':![],'attributes':['id',_0xca34('0x4'),_0xca34('0x5'),_0xca34('0x6')],'include':[{'model':_0xca34('0x7'),'as':'Agents','attributes':['id',_0xca34('0x4'),'online',_0xca34('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 f3825a9..fdccd93 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 _0x169c=['create','Request','CreateFaxQueueReport','update','UpdateFaxQueueReport','../client'];(function(_0x5b658a,_0x4bddc0){var _0x40dde2=function(_0x289a20){while(--_0x289a20){_0x5b658a['push'](_0x5b658a['shift']());}};_0x40dde2(++_0x4bddc0);}(_0x169c,0xe3));var _0xc169=function(_0x2869f8,_0x9756fb){_0x2869f8=_0x2869f8-0x0;var _0x2a9fe6=_0x169c[_0x2869f8];return _0x2a9fe6;};'use strict';var client=require(_0xc169('0x0'));exports[_0xc169('0x1')]=function(_0x3b7230){return client[_0xc169('0x2')](_0xc169('0x3'),{'body':_0x3b7230,'log':'CreateFaxQueueReport'});};exports[_0xc169('0x4')]=function(_0x481d07,_0x2da529){return client[_0xc169('0x2')](_0xc169('0x5'),{'body':_0x2da529,'options':{'where':{'uniqueid':_0x481d07},'order':[['id','DESC']],'limit':0x1},'log':_0xc169('0x5')});}; \ No newline at end of file +var _0xe0c5=['Request','CreateFaxQueueReport','update','UpdateFaxQueueReport','DESC','../client','create'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xe0c5,0x98));var _0x5e0c=function(_0x5d090a,_0x5ed49b){_0x5d090a=_0x5d090a-0x0;var _0x432f45=_0xe0c5[_0x5d090a];return _0x432f45;};'use strict';var client=require(_0x5e0c('0x0'));exports[_0x5e0c('0x1')]=function(_0x1d8bea){return client[_0x5e0c('0x2')](_0x5e0c('0x3'),{'body':_0x1d8bea,'log':_0x5e0c('0x3')});};exports[_0x5e0c('0x4')]=function(_0x47e10f,_0xd5c59){return client['Request'](_0x5e0c('0x5'),{'body':_0xd5c59,'options':{'where':{'uniqueid':_0x47e10f},'order':[['id',_0x5e0c('0x6')]],'limit':0x1},'log':_0x5e0c('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 59c5ce8..54292d1 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 _0x1b0e=['Request','GetInterval','name','Interval','interval','../client','getIntervals'];(function(_0x17b040,_0x4a5a33){var _0x28d8d1=function(_0x23c16c){while(--_0x23c16c){_0x17b040['push'](_0x17b040['shift']());}};_0x28d8d1(++_0x4a5a33);}(_0x1b0e,0x132));var _0xe1b0=function(_0x1cce71,_0x42e7ab){_0x1cce71=_0x1cce71-0x0;var _0x130599=_0x1b0e[_0x1cce71];return _0x130599;};'use strict';var client=require(_0xe1b0('0x0'));exports[_0xe1b0('0x1')]=function(){return function(){return client[_0xe1b0('0x2')](_0xe1b0('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xe1b0('0x4')],'include':[{'model':_0xe1b0('0x5'),'as':'Intervals','attributes':['id','name',_0xe1b0('0x6')]}]},'log':_0xe1b0('0x1')});};}; \ No newline at end of file +var _0xdd4f=['interval','getIntervals','../client','name','Interval'];(function(_0x3d85be,_0x53c96c){var _0x41242c=function(_0x4b87fd){while(--_0x4b87fd){_0x3d85be['push'](_0x3d85be['shift']());}};_0x41242c(++_0x53c96c);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0x446f6f,_0xef94a0){_0x446f6f=_0x446f6f-0x0;var _0x6f93e5=_0xdd4f[_0x446f6f];return _0x6f93e5;};'use strict';var client=require(_0xfdd4('0x0'));exports['getIntervals']=function(){return function(){return client['Request']('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xfdd4('0x1')],'include':[{'model':_0xfdd4('0x2'),'as':'Intervals','attributes':['id',_0xfdd4('0x1'),_0xfdd4('0x3')]}]},'log':_0xfdd4('0x4')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 382d98d..66cfe0d 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 _0x191a=['addTagsToChatInteraction','../client','update','Request','UpdateMailInteraction','updateMailInteraction','addTags','AddTagsToMailInteraction'];(function(_0x22b68a,_0x2bffc3){var _0x1ac67a=function(_0x25f9d5){while(--_0x25f9d5){_0x22b68a['push'](_0x22b68a['shift']());}};_0x1ac67a(++_0x2bffc3);}(_0x191a,0x161));var _0xa191=function(_0x469fe7,_0x5bc002){_0x469fe7=_0x469fe7-0x0;var _0x2b7b89=_0x191a[_0x469fe7];return _0x2b7b89;};'use strict';var client=require(_0xa191('0x0'));exports[_0xa191('0x1')]=function(_0x5cf4a7,_0x40f7f0){return client[_0xa191('0x2')](_0xa191('0x3'),{'body':_0x40f7f0,'options':{'where':{'id':_0x5cf4a7}},'log':_0xa191('0x4')});};exports[_0xa191('0x5')]=function(_0x2e4458,_0x33c892){return client[_0xa191('0x2')](_0xa191('0x6'),{'body':_0x33c892,'options':{'where':{'id':_0x2e4458}},'log':_0xa191('0x7')});}; \ No newline at end of file +var _0xcdb9=['updateMailInteraction','AddTagsToMailInteraction','addTagsToChatInteraction','update','Request','UpdateMailInteraction'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xcdb9,0xff));var _0x9cdb=function(_0x151e14,_0x4b69fe){_0x151e14=_0x151e14-0x0;var _0x21386e=_0xcdb9[_0x151e14];return _0x21386e;};'use strict';var client=require('../client');exports[_0x9cdb('0x0')]=function(_0xc4dfb,_0x5d46a5){return client[_0x9cdb('0x1')](_0x9cdb('0x2'),{'body':_0x5d46a5,'options':{'where':{'id':_0xc4dfb}},'log':_0x9cdb('0x3')});};exports['addTags']=function(_0x49c2d0,_0x2d38df){return client['Request'](_0x9cdb('0x4'),{'body':_0x2d38df,'options':{'where':{'id':_0x49c2d0}},'log':_0x9cdb('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 5b60333..bc65ae1 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 _0xb7f9=['Request','CreateMailMessage','createMailMessage','../client','create'];(function(_0x28407a,_0x2a7269){var _0x8bd6ef=function(_0x3c886f){while(--_0x3c886f){_0x28407a['push'](_0x28407a['shift']());}};_0x8bd6ef(++_0x2a7269);}(_0xb7f9,0xc6));var _0x9b7f=function(_0x16e690,_0x5d4683){_0x16e690=_0x16e690-0x0;var _0x3beb56=_0xb7f9[_0x16e690];return _0x3beb56;};'use strict';var client=require(_0x9b7f('0x0'));exports[_0x9b7f('0x1')]=function(_0x237ee4){return client[_0x9b7f('0x2')](_0x9b7f('0x3'),{'body':_0x237ee4,'log':_0x9b7f('0x4')});}; \ No newline at end of file +var _0x3c4e=['create','Request','CreateMailMessage','createMailMessage','../client'];(function(_0x256593,_0x2ed938){var _0x2cc3dc=function(_0x2f8e18){while(--_0x2f8e18){_0x256593['push'](_0x256593['shift']());}};_0x2cc3dc(++_0x2ed938);}(_0x3c4e,0x135));var _0xe3c4=function(_0x174dc2,_0x11d3ba){_0x174dc2=_0x174dc2-0x0;var _0x2ff346=_0x3c4e[_0x174dc2];return _0x2ff346;};'use strict';var client=require(_0xe3c4('0x0'));exports[_0xe3c4('0x1')]=function(_0x424098){return client[_0xe3c4('0x2')](_0xe3c4('0x3'),{'body':_0x424098,'log':_0xe3c4('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 0836e8b..c074432 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 _0x9dcf=['Agents','online','mailPause','../client','getMailQueues','Request','GetMailQueue','name','timeout','strategy','User'];(function(_0x576170,_0x1712ae){var _0x397c70=function(_0x2eb9de){while(--_0x2eb9de){_0x576170['push'](_0x576170['shift']());}};_0x397c70(++_0x1712ae);}(_0x9dcf,0x184));var _0xf9dc=function(_0x573907,_0x18ca4c){_0x573907=_0x573907-0x0;var _0x422a2d=_0x9dcf[_0x573907];return _0x422a2d;};'use strict';var client=require(_0xf9dc('0x0'));exports[_0xf9dc('0x1')]=function(){return function(){return client[_0xf9dc('0x2')](_0xf9dc('0x3'),{'options':{'raw':![],'attributes':['id',_0xf9dc('0x4'),_0xf9dc('0x5'),_0xf9dc('0x6')],'include':[{'model':_0xf9dc('0x7'),'as':_0xf9dc('0x8'),'attributes':['id',_0xf9dc('0x4'),_0xf9dc('0x9'),_0xf9dc('0xa')]}]},'log':_0xf9dc('0x1')});};}; \ No newline at end of file +var _0x7bf0=['name','online','mailPause','../client','getMailQueues','GetMailQueue','timeout','User','Agents'];(function(_0x2bbe6e,_0x2bfbe1){var _0x9b39a=function(_0x5a1e05){while(--_0x5a1e05){_0x2bbe6e['push'](_0x2bbe6e['shift']());}};_0x9b39a(++_0x2bfbe1);}(_0x7bf0,0x162));var _0x07bf=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x7bf0[_0x2d7f0e];return _0x110b07;};'use strict';var client=require(_0x07bf('0x0'));exports[_0x07bf('0x1')]=function(){return function(){return client['Request'](_0x07bf('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x07bf('0x3'),'strategy'],'include':[{'model':_0x07bf('0x4'),'as':_0x07bf('0x5'),'attributes':['id',_0x07bf('0x6'),_0x07bf('0x7'),_0x07bf('0x8')]}]},'log':'getMailQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 40cbecc..8ebba9e 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 _0x32de=['create','Request','CreateMailQueueReport','update','UpdateMailQueueReport','DESC','../client'];(function(_0x5c2a2b,_0x22c94e){var _0x19921f=function(_0x3fb937){while(--_0x3fb937){_0x5c2a2b['push'](_0x5c2a2b['shift']());}};_0x19921f(++_0x22c94e);}(_0x32de,0x19c));var _0xe32d=function(_0x5f0ecc,_0x51c82e){_0x5f0ecc=_0x5f0ecc-0x0;var _0x5e0cbe=_0x32de[_0x5f0ecc];return _0x5e0cbe;};'use strict';var client=require(_0xe32d('0x0'));exports[_0xe32d('0x1')]=function(_0x14aad9){return client[_0xe32d('0x2')](_0xe32d('0x3'),{'body':_0x14aad9,'log':_0xe32d('0x3')});};exports[_0xe32d('0x4')]=function(_0x17533e,_0x5aa03f){return client['Request'](_0xe32d('0x5'),{'body':_0x5aa03f,'options':{'where':{'uniqueid':_0x17533e},'order':[['id',_0xe32d('0x6')]],'limit':0x1},'log':_0xe32d('0x5')});}; \ No newline at end of file +var _0xed64=['create','Request','update','UpdateMailQueueReport','../client'];(function(_0x2b716b,_0x2424d3){var _0x5a66ad=function(_0x171919){while(--_0x171919){_0x2b716b['push'](_0x2b716b['shift']());}};_0x5a66ad(++_0x2424d3);}(_0xed64,0x117));var _0x4ed6=function(_0x55fa03,_0xcb96c2){_0x55fa03=_0x55fa03-0x0;var _0x2cd7cd=_0xed64[_0x55fa03];return _0x2cd7cd;};'use strict';var client=require(_0x4ed6('0x0'));exports[_0x4ed6('0x1')]=function(_0x2601ae){return client[_0x4ed6('0x2')]('CreateMailQueueReport',{'body':_0x2601ae,'log':'CreateMailQueueReport'});};exports[_0x4ed6('0x3')]=function(_0x2cfff1,_0x5712a4){return client[_0x4ed6('0x2')](_0x4ed6('0x4'),{'body':_0x5712a4,'options':{'where':{'uniqueid':_0x2cfff1},'order':[['id','DESC']],'limit':0x1},'log':_0x4ed6('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index ba7fbf3..6895369 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 _0xbafc=['AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','Request','UpdateOpenchannelInteraction','addTags'];(function(_0x8bf574,_0x468ab3){var _0x1cdae2=function(_0x53451c){while(--_0x53451c){_0x8bf574['push'](_0x8bf574['shift']());}};_0x1cdae2(++_0x468ab3);}(_0xbafc,0x13a));var _0xcbaf=function(_0xbb14db,_0x3ee8c6){_0xbb14db=_0xbb14db-0x0;var _0x36bed7=_0xbafc[_0xbb14db];return _0x36bed7;};'use strict';var client=require(_0xcbaf('0x0'));exports['update']=function(_0x287443,_0x523ecd){return client[_0xcbaf('0x1')](_0xcbaf('0x2'),{'body':_0x523ecd,'options':{'where':{'id':_0x287443}},'log':'updateOpenchannelInteraction'});};exports[_0xcbaf('0x3')]=function(_0x29119a,_0xabb422){return client[_0xcbaf('0x1')](_0xcbaf('0x4'),{'body':_0xabb422,'options':{'where':{'id':_0x29119a}},'log':_0xcbaf('0x5')});}; \ No newline at end of file +var _0x2d88=['../client','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction'];(function(_0x213df7,_0x7872f6){var _0x212834=function(_0x4f3761){while(--_0x4f3761){_0x213df7['push'](_0x213df7['shift']());}};_0x212834(++_0x7872f6);}(_0x2d88,0x1c7));var _0x82d8=function(_0x132737,_0xb95113){_0x132737=_0x132737-0x0;var _0x3dc144=_0x2d88[_0x132737];return _0x3dc144;};'use strict';var client=require(_0x82d8('0x0'));exports['update']=function(_0x4e5394,_0x484305){return client[_0x82d8('0x1')](_0x82d8('0x2'),{'body':_0x484305,'options':{'where':{'id':_0x4e5394}},'log':_0x82d8('0x3')});};exports[_0x82d8('0x4')]=function(_0x4cbc12,_0x1e385c){return client[_0x82d8('0x1')](_0x82d8('0x5'),{'body':_0x1e385c,'options':{'where':{'id':_0x4cbc12}},'log':_0x82d8('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index d1f4ad9..5f32246 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 _0x5b02=['create','Request','../client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5b02,0xe9));var _0x25b0=function(_0x5ac534,_0x536506){_0x5ac534=_0x5ac534-0x0;var _0x176d8c=_0x5b02[_0x5ac534];return _0x176d8c;};'use strict';var client=require(_0x25b0('0x0'));exports[_0x25b0('0x1')]=function(_0x428458){return client[_0x25b0('0x2')]('CreateOpenchannelMessage',{'body':_0x428458,'log':'createOpenchannelMessage'});}; \ No newline at end of file +var _0x54ef=['CreateOpenchannelMessage','createOpenchannelMessage','../client','create'];(function(_0x5a228f,_0x21e8f9){var _0x8103a7=function(_0x1f845a){while(--_0x1f845a){_0x5a228f['push'](_0x5a228f['shift']());}};_0x8103a7(++_0x21e8f9);}(_0x54ef,0x112));var _0xf54e=function(_0x20459a,_0x5b6e07){_0x20459a=_0x20459a-0x0;var _0x1e3a10=_0x54ef[_0x20459a];return _0x1e3a10;};'use strict';var client=require(_0xf54e('0x0'));exports[_0xf54e('0x1')]=function(_0x12c070){return client['Request'](_0xf54e('0x2'),{'body':_0x12c070,'log':_0xf54e('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index e6dff79..cd877ee 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 _0xe74d=['name','User','Agents','online','../client','getOpenchannelQueues','Request'];(function(_0x2e5405,_0x42ec09){var _0x2f0270=function(_0x70c5c8){while(--_0x70c5c8){_0x2e5405['push'](_0x2e5405['shift']());}};_0x2f0270(++_0x42ec09);}(_0xe74d,0x1d9));var _0xde74=function(_0x2912b9,_0x55e6e1){_0x2912b9=_0x2912b9-0x0;var _0x154da8=_0xe74d[_0x2912b9];return _0x154da8;};'use strict';var client=require(_0xde74('0x0'));exports[_0xde74('0x1')]=function(){return function(){return client[_0xde74('0x2')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0xde74('0x3'),'timeout','strategy'],'include':[{'model':_0xde74('0x4'),'as':_0xde74('0x5'),'attributes':['id','name',_0xde74('0x6'),'openchannelPause']}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file +var _0x6290=['Agents','name','online','getOpenchannelQueues','Request','GetOpenchannelQueue','User'];(function(_0x3306f6,_0x5059e1){var _0x47daa5=function(_0x45c515){while(--_0x45c515){_0x3306f6['push'](_0x3306f6['shift']());}};_0x47daa5(++_0x5059e1);}(_0x6290,0x11b));var _0x0629=function(_0x28ccad,_0x413b5b){_0x28ccad=_0x28ccad-0x0;var _0x3271cc=_0x6290[_0x28ccad];return _0x3271cc;};'use strict';var client=require('../client');exports[_0x0629('0x0')]=function(){return function(){return client[_0x0629('0x1')](_0x0629('0x2'),{'options':{'raw':![],'attributes':['id','name','timeout','strategy'],'include':[{'model':_0x0629('0x3'),'as':_0x0629('0x4'),'attributes':['id',_0x0629('0x5'),_0x0629('0x6'),'openchannelPause']}]},'log':_0x0629('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 31db6dd..622d485 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 _0x82cf=['update','UpdateOpenchannelQueueReport','DESC','create','Request','CreateOpenchannelQueueReport'];(function(_0x402b40,_0x4e4ce9){var _0x5e34da=function(_0x482ee6){while(--_0x482ee6){_0x402b40['push'](_0x402b40['shift']());}};_0x5e34da(++_0x4e4ce9);}(_0x82cf,0x13b));var _0xf82c=function(_0x1057a3,_0x28d9b7){_0x1057a3=_0x1057a3-0x0;var _0x131cdb=_0x82cf[_0x1057a3];return _0x131cdb;};'use strict';var client=require('../client');exports[_0xf82c('0x0')]=function(_0x27c498){return client[_0xf82c('0x1')](_0xf82c('0x2'),{'body':_0x27c498,'log':'CreateOpenchannelQueueReport'});};exports[_0xf82c('0x3')]=function(_0x9efe02,_0x305f43){return client[_0xf82c('0x1')](_0xf82c('0x4'),{'body':_0x305f43,'options':{'where':{'uniqueid':_0x9efe02},'order':[['id',_0xf82c('0x5')]],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file +var _0x0913=['Request','UpdateOpenchannelQueueReport','DESC','create','update'];(function(_0x25303d,_0x3be54c){var _0x5100cc=function(_0x239813){while(--_0x239813){_0x25303d['push'](_0x25303d['shift']());}};_0x5100cc(++_0x3be54c);}(_0x0913,0x14d));var _0x3091=function(_0x3ee3b3,_0x1f20cc){_0x3ee3b3=_0x3ee3b3-0x0;var _0x3313da=_0x0913[_0x3ee3b3];return _0x3313da;};'use strict';var client=require('../client');exports[_0x3091('0x0')]=function(_0x15dcf4){return client['Request']('CreateOpenchannelQueueReport',{'body':_0x15dcf4,'log':'CreateOpenchannelQueueReport'});};exports[_0x3091('0x1')]=function(_0x462758,_0x42ebd4){return client[_0x3091('0x2')](_0x3091('0x3'),{'body':_0x42ebd4,'options':{'where':{'uniqueid':_0x462758},'order':[['id',_0x3091('0x4')]],'limit':0x1},'log':_0x3091('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index f755837..02726c4 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 _0x3475=['AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','update','UpdateSmsInteraction','updateSmsInteraction'];(function(_0x230883,_0x4e4b8c){var _0x16cd82=function(_0x9f7dec){while(--_0x9f7dec){_0x230883['push'](_0x230883['shift']());}};_0x16cd82(++_0x4e4b8c);}(_0x3475,0xbc));var _0x5347=function(_0x5bce59,_0x346590){_0x5bce59=_0x5bce59-0x0;var _0x8885ae=_0x3475[_0x5bce59];return _0x8885ae;};'use strict';var client=require(_0x5347('0x0'));exports[_0x5347('0x1')]=function(_0x1b994e,_0x3ec5a8){return client['Request'](_0x5347('0x2'),{'body':_0x3ec5a8,'options':{'where':{'id':_0x1b994e}},'log':_0x5347('0x3')});};exports['addTags']=function(_0x38134b,_0x128d3b){return client['Request'](_0x5347('0x4'),{'body':_0x128d3b,'options':{'where':{'id':_0x38134b}},'log':_0x5347('0x5')});}; \ No newline at end of file +var _0xd7ea=['addTagsToSmsInteraction','../client','update','Request','updateSmsInteraction','addTags'];(function(_0x148c53,_0x593964){var _0x2a1c0b=function(_0x269815){while(--_0x269815){_0x148c53['push'](_0x148c53['shift']());}};_0x2a1c0b(++_0x593964);}(_0xd7ea,0xeb));var _0xad7e=function(_0x20446a,_0x46e1c7){_0x20446a=_0x20446a-0x0;var _0x5f30e5=_0xd7ea[_0x20446a];return _0x5f30e5;};'use strict';var client=require(_0xad7e('0x0'));exports[_0xad7e('0x1')]=function(_0x461b22,_0x94e0b8){return client[_0xad7e('0x2')]('UpdateSmsInteraction',{'body':_0x94e0b8,'options':{'where':{'id':_0x461b22}},'log':_0xad7e('0x3')});};exports[_0xad7e('0x4')]=function(_0x532f0d,_0x33aeb1){return client['Request']('AddTagsToSmsInteraction',{'body':_0x33aeb1,'options':{'where':{'id':_0x532f0d}},'log':_0xad7e('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 18f02b3..21e0c8f 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 _0xe3e8=['../client','create','Request','CreateSmsMessage','createSmsMessage'];(function(_0x599570,_0x460668){var _0x3d743f=function(_0x179db6){while(--_0x179db6){_0x599570['push'](_0x599570['shift']());}};_0x3d743f(++_0x460668);}(_0xe3e8,0x181));var _0x8e3e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xe3e8[_0x32d457];return _0x338386;};'use strict';var client=require(_0x8e3e('0x0'));exports[_0x8e3e('0x1')]=function(_0x15e4f0){return client[_0x8e3e('0x2')](_0x8e3e('0x3'),{'body':_0x15e4f0,'log':_0x8e3e('0x4')});}; \ No newline at end of file +var _0x3d2a=['Request','CreateSmsMessage'];(function(_0x15ad02,_0x56ace9){var _0x3c87da=function(_0x32ced0){while(--_0x32ced0){_0x15ad02['push'](_0x15ad02['shift']());}};_0x3c87da(++_0x56ace9);}(_0x3d2a,0x1d4));var _0xa3d2=function(_0x20c59f,_0x583d0a){_0x20c59f=_0x20c59f-0x0;var _0x2b6df8=_0x3d2a[_0x20c59f];return _0x2b6df8;};'use strict';var client=require('../client');exports['create']=function(_0xc29cf4){return client[_0xa3d2('0x0')](_0xa3d2('0x1'),{'body':_0xc29cf4,'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 b819160..b722a81 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 _0x9a33=['timeout','strategy','User','smsPause','getSmsQueues','Request','GetSmsQueue','name'];(function(_0x49d41c,_0x2bdc35){var _0xb64c5f=function(_0x28f535){while(--_0x28f535){_0x49d41c['push'](_0x49d41c['shift']());}};_0xb64c5f(++_0x2bdc35);}(_0x9a33,0x6c));var _0x39a3=function(_0xf1f0bc,_0x523550){_0xf1f0bc=_0xf1f0bc-0x0;var _0x2bc5d6=_0x9a33[_0xf1f0bc];return _0x2bc5d6;};'use strict';var client=require('../client');exports[_0x39a3('0x0')]=function(){return function(){return client[_0x39a3('0x1')](_0x39a3('0x2'),{'options':{'raw':![],'attributes':['id',_0x39a3('0x3'),_0x39a3('0x4'),_0x39a3('0x5')],'include':[{'model':_0x39a3('0x6'),'as':'Agents','attributes':['id',_0x39a3('0x3'),'online',_0x39a3('0x7')]}]},'log':_0x39a3('0x0')});};}; \ No newline at end of file +var _0x0b97=['getSmsQueues','Request','GetSmsQueue','name','timeout','strategy','User','Agents','smsPause'];(function(_0x39157f,_0x3d8c1e){var _0x1ae4e2=function(_0x3429af){while(--_0x3429af){_0x39157f['push'](_0x39157f['shift']());}};_0x1ae4e2(++_0x3d8c1e);}(_0x0b97,0xf4));var _0x70b9=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x0b97[_0x21a9d9];return _0x46adce;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x70b9('0x0')](_0x70b9('0x1'),{'options':{'raw':![],'attributes':['id',_0x70b9('0x2'),_0x70b9('0x3'),_0x70b9('0x4')],'include':[{'model':_0x70b9('0x5'),'as':_0x70b9('0x6'),'attributes':['id',_0x70b9('0x2'),'online',_0x70b9('0x7')]}]},'log':_0x70b9('0x8')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 0f78c32..c22e484 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 _0x317b=['../client','create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x317b,0x1c7));var _0xb317=function(_0x82cee8,_0x11b20a){_0x82cee8=_0x82cee8-0x0;var _0x5c5dca=_0x317b[_0x82cee8];return _0x5c5dca;};'use strict';var client=require(_0xb317('0x0'));exports[_0xb317('0x1')]=function(_0x50abf9){return client[_0xb317('0x2')](_0xb317('0x3'),{'body':_0x50abf9,'log':'CreateSmsQueueReport'});};exports[_0xb317('0x4')]=function(_0x2c297f,_0x423e4e){return client[_0xb317('0x2')](_0xb317('0x5'),{'body':_0x423e4e,'options':{'where':{'uniqueid':_0x2c297f},'order':[['id',_0xb317('0x6')]],'limit':0x1},'log':_0xb317('0x5')});}; \ No newline at end of file +var _0xe31a=['UpdateSmsQueueReport','DESC','../client','create','CreateSmsQueueReport','update','Request'];(function(_0x2d8821,_0x39db99){var _0x1b4663=function(_0x2eae42){while(--_0x2eae42){_0x2d8821['push'](_0x2d8821['shift']());}};_0x1b4663(++_0x39db99);}(_0xe31a,0x87));var _0xae31=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0xe31a[_0x1d24eb];return _0x1dc576;};'use strict';var client=require(_0xae31('0x0'));exports[_0xae31('0x1')]=function(_0x4b6ff4){return client['Request'](_0xae31('0x2'),{'body':_0x4b6ff4,'log':_0xae31('0x2')});};exports[_0xae31('0x3')]=function(_0x178ccf,_0x4050d5){return client[_0xae31('0x4')](_0xae31('0x5'),{'body':_0x4050d5,'options':{'where':{'uniqueid':_0x178ccf},'order':[['id',_0xae31('0x6')]],'limit':0x1},'log':'UpdateSmsQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 80e72f9..a3af98e 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 _0x78f5=['lastPauseAt','voicePause','chatPause','faxPause','smsPause','chatCapacity','faxCapacity','smsCapacity','getAgents','Request','GetUser','name','online','pauseType'];(function(_0x5b7daa,_0x38b900){var _0x55022e=function(_0x577e57){while(--_0x577e57){_0x5b7daa['push'](_0x5b7daa['shift']());}};_0x55022e(++_0x38b900);}(_0x78f5,0xf6));var _0x578f=function(_0x559cd9,_0x161f8a){_0x559cd9=_0x559cd9-0x0;var _0x40ca25=_0x78f5[_0x559cd9];return _0x40ca25;};'use strict';var client=require('../client');exports[_0x578f('0x0')]=function(){return function(){return client[_0x578f('0x1')](_0x578f('0x2'),{'options':{'raw':!![],'where':{'role':'agent'},'attributes':['id',_0x578f('0x3'),_0x578f('0x4'),_0x578f('0x5'),_0x578f('0x6'),_0x578f('0x7'),_0x578f('0x8'),'mailPause',_0x578f('0x9'),_0x578f('0xa'),'openchannelPause',_0x578f('0xb'),'mailCapacity',_0x578f('0xc'),_0x578f('0xd'),'openchannelCapacity']},'log':_0x578f('0x0')});};}; \ No newline at end of file +var _0x04e6=['voicePause','chatPause','mailPause','faxPause','openchannelPause','faxCapacity','smsCapacity','getAgents','GetUser','online','pauseType','lastPauseAt'];(function(_0x5c59a7,_0x256104){var _0x44ae58=function(_0xf68147){while(--_0xf68147){_0x5c59a7['push'](_0x5c59a7['shift']());}};_0x44ae58(++_0x256104);}(_0x04e6,0x1b8));var _0x604e=function(_0x425716,_0x3e9d1c){_0x425716=_0x425716-0x0;var _0x2d39af=_0x04e6[_0x425716];return _0x2d39af;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client['Request'](_0x604e('0x0'),{'options':{'raw':!![],'where':{'role':'agent'},'attributes':['id','name',_0x604e('0x1'),_0x604e('0x2'),_0x604e('0x3'),_0x604e('0x4'),_0x604e('0x5'),_0x604e('0x6'),_0x604e('0x7'),'smsPause',_0x604e('0x8'),'chatCapacity','mailCapacity',_0x604e('0x9'),_0x604e('0xa'),'openchannelCapacity']},'log':_0x604e('0xb')});};}; \ 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 ea9a0d6..c840e33 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 _0x9c18=['string','number','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','message','stop','find','atimeout','channel','START:%s','rules','[%s][AGENT]\x20ROUTING\x20STOPPED','close','[%s][AGENT]\x20ROUTING\x20END','agent','log','[%s][QUEUE]\x20%s','stack','validate','seq-queue','./strategy'];(function(_0x47a756,_0xc38065){var _0x4db04c=function(_0x5c1a72){while(--_0x5c1a72){_0x47a756['push'](_0x47a756['shift']());}};_0x4db04c(++_0xc38065);}(_0x9c18,0x8e));var _0x89c1=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x9c18[_0xc6be3a];return _0x56a310;};'use strict';var schema=require(_0x89c1('0x0'));var _=require('lodash');var util=require('util');var seqqueue=require(_0x89c1('0x1'));var logger=require('../../../../config/logger')('routing');var strategy=require(_0x89c1('0x2'));var queue=schema({'name':{'type':_0x89c1('0x3'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x89c1('0x4'),'message':_0x89c1('0x5')}});function writeLog(_0x1c94ec,_0x525b25,_0x5f4a1b){return logger[_0x89c1('0x6')](util[_0x89c1('0x7')](_0x89c1('0x8'),_0x1c94ec,_0x525b25['name'],_0x5f4a1b));}function handleFindAgent(_0x3aa565){return function(_0x5222dc){return _0x5222dc[_0x89c1('0x9')][_0x89c1('0xa')]()===_0x3aa565[_0x89c1('0xa')]();};}exports[_0x89c1('0xb')]=function(_0x128350,_0x5bd3bd,_0x4f80ca,_0x53225d){return function(_0x3673d8){try{var _0x98c208={'name':_0x5bd3bd[0x0],'timeout':_0x5bd3bd[0x1]};var _0x13485e=queue['validate'](_0x98c208,{'typecast':!![]});if(_0x13485e[_0x89c1('0xc')]){logger[_0x89c1('0xd')](_0x89c1('0xe'),_0x128350,_['map'](_0x13485e,_0x89c1('0xf'))['join'](',\x20'));_0x3673d8[_0x89c1('0x10')]();}else{var _0x282ec7=_[_0x89c1('0x11')](_0x4f80ca['agents'],handleFindAgent(_0x98c208[_0x89c1('0x9')]));if(_0x282ec7){var _0x3326bf=(_0x98c208['timeout']||0xa)*0x3e8;var _0x405a93,_0x5cd521;var _0x380a92=seqqueue['createQueue'](_0x3326bf);_0x380a92['id']=_0x128350;_0x380a92[_0x89c1('0x12')]=_0x3326bf;_0x380a92['channel']=_0x53225d[_0x89c1('0x13')];writeLog(_0x128350,_0x282ec7,util[_0x89c1('0x7')](_0x89c1('0x14'),_0x3326bf));_0x4f80ca[_0x89c1('0x15')][_0x128350]['on']('end',function(){logger['info'](_0x89c1('0x16'),_0x128350);clearTimeout(_0x5cd521);_0x5cd521=undefined;_0x380a92[_0x89c1('0x17')]();if(_0x4f80ca[_0x89c1('0x15')][_0x128350]){delete _0x4f80ca[_0x89c1('0x15')][_0x128350];}_0x3673d8['stop']();});_0x4f80ca[_0x89c1('0x15')][_0x128350]['on']('complete',function(){if(_0x4f80ca[_0x89c1('0x15')][_0x128350]){delete _0x4f80ca[_0x89c1('0x15')][_0x128350];}});_0x5cd521=setTimeout(function(){logger['info'](_0x89c1('0x18'),_0x128350);clearTimeout(_0x5cd521);_0x380a92[_0x89c1('0x17')]();_0x3673d8['next']();},_0x3326bf);strategy[_0x89c1('0x19')](_0x380a92,_0x282ec7,_0x4f80ca,_0x53225d);}else{logger[_0x89c1('0xd')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x128350,_0x98c208[_0x89c1('0x9')]);_0x3673d8['stop']();}}}catch(_0x3cf1f4){console[_0x89c1('0x1a')](_0x3cf1f4);logger[_0x89c1('0xd')](_0x89c1('0x1b'),_0x128350,_0x3cf1f4[_0x89c1('0x1c')]);_0x3673d8[_0x89c1('0x10')]();}};}; \ No newline at end of file +var _0xca67=['toLowerCase','consequence','validate','length','error','map','message','join','find','agents','timeout','atimeout','channel','START:%s','rules','end','close','complete','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','stop','[%s][QUEUE]\x20%s','stack','lodash','util','seq-queue','../../../../config/logger','routing','./strategy','string','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name'];(function(_0x9ae99e,_0x2ac9e7){var _0x281db5=function(_0x44f834){while(--_0x44f834){_0x9ae99e['push'](_0x9ae99e['shift']());}};_0x281db5(++_0x2ac9e7);}(_0xca67,0x166));var _0x7ca6=function(_0x29eeb6,_0x2b9838){_0x29eeb6=_0x29eeb6-0x0;var _0x37e6c1=_0xca67[_0x29eeb6];return _0x37e6c1;};'use strict';var schema=require('validate');var _=require(_0x7ca6('0x0'));var util=require(_0x7ca6('0x1'));var seqqueue=require(_0x7ca6('0x2'));var logger=require(_0x7ca6('0x3'))(_0x7ca6('0x4'));var strategy=require(_0x7ca6('0x5'));var queue=schema({'name':{'type':_0x7ca6('0x6'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':'number','message':_0x7ca6('0x7')}});function writeLog(_0x338ab4,_0xe1907e,_0x5d1867){return logger[_0x7ca6('0x8')](util[_0x7ca6('0x9')](_0x7ca6('0xa'),_0x338ab4,_0xe1907e[_0x7ca6('0xb')],_0x5d1867));}function handleFindAgent(_0x186f37){return function(_0x39abf0){return _0x39abf0[_0x7ca6('0xb')][_0x7ca6('0xc')]()===_0x186f37[_0x7ca6('0xc')]();};}exports[_0x7ca6('0xd')]=function(_0x5e51d9,_0x43bbc2,_0x401d00,_0x3287c7){return function(_0x4d663a){try{var _0x357cf4={'name':_0x43bbc2[0x0],'timeout':_0x43bbc2[0x1]};var _0x173ba8=queue[_0x7ca6('0xe')](_0x357cf4,{'typecast':!![]});if(_0x173ba8[_0x7ca6('0xf')]){logger[_0x7ca6('0x10')]('[%s][AGENT]\x20%s',_0x5e51d9,_[_0x7ca6('0x11')](_0x173ba8,_0x7ca6('0x12'))[_0x7ca6('0x13')](',\x20'));_0x4d663a['stop']();}else{var _0x4615e0=_[_0x7ca6('0x14')](_0x401d00[_0x7ca6('0x15')],handleFindAgent(_0x357cf4['name']));if(_0x4615e0){var _0x1fd686=(_0x357cf4[_0x7ca6('0x16')]||0xa)*0x3e8;var _0x469081,_0x406889;var _0x50d9ec=seqqueue['createQueue'](_0x1fd686);_0x50d9ec['id']=_0x5e51d9;_0x50d9ec[_0x7ca6('0x17')]=_0x1fd686;_0x50d9ec[_0x7ca6('0x18')]=_0x3287c7[_0x7ca6('0x18')];writeLog(_0x5e51d9,_0x4615e0,util[_0x7ca6('0x9')](_0x7ca6('0x19'),_0x1fd686));_0x401d00[_0x7ca6('0x1a')][_0x5e51d9]['on'](_0x7ca6('0x1b'),function(){logger[_0x7ca6('0x8')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x5e51d9);clearTimeout(_0x406889);_0x406889=undefined;_0x50d9ec[_0x7ca6('0x1c')]();if(_0x401d00[_0x7ca6('0x1a')][_0x5e51d9]){delete _0x401d00[_0x7ca6('0x1a')][_0x5e51d9];}_0x4d663a['stop']();});_0x401d00['rules'][_0x5e51d9]['on'](_0x7ca6('0x1d'),function(){if(_0x401d00[_0x7ca6('0x1a')][_0x5e51d9]){delete _0x401d00[_0x7ca6('0x1a')][_0x5e51d9];}});_0x406889=setTimeout(function(){logger[_0x7ca6('0x8')](_0x7ca6('0x1e'),_0x5e51d9);clearTimeout(_0x406889);_0x50d9ec[_0x7ca6('0x1c')]();_0x4d663a[_0x7ca6('0x1f')]();},_0x1fd686);strategy[_0x7ca6('0x20')](_0x50d9ec,_0x4615e0,_0x401d00,_0x3287c7);}else{logger[_0x7ca6('0x10')](_0x7ca6('0x21'),_0x5e51d9,_0x357cf4[_0x7ca6('0xb')]);_0x4d663a[_0x7ca6('0x22')]();}}}catch(_0x2eeca1){console['log'](_0x2eeca1);logger[_0x7ca6('0x10')](_0x7ca6('0x23'),_0x5e51d9,_0x2eeca1[_0x7ca6('0x24')]);_0x4d663a[_0x7ca6('0x22')]();}};}; \ 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 484db52..458e500 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 _0xc05f=['then','info','[%s][AMAZONLEX]\x20%s','error','stringify','finally','$LATEST','message','toString','next','amazonlex','dialogState','Failed','stop','catch','lodash','moment','aws-sdk','./utils','routing','../../rpc/chatMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','chat','AccountId','account','upperFirst','created','isEmpty','body','getMustacheRender','Message','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc05f,0x1dd));var _0xfc05=function(_0x972a8e,_0x5ef65e){_0x972a8e=_0x972a8e-0x0;var _0x2f6d99=_0xc05f[_0x972a8e];return _0x2f6d99;};'use strict';var _=require(_0xfc05('0x0'));var moment=require(_0xfc05('0x1'));var AWS=require(_0xfc05('0x2'));var utils=require(_0xfc05('0x3'));var logger=require('../../../../config/logger')(_0xfc05('0x4'));var rpc={'chatMessage':require(_0xfc05('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xfc05('0x6')),'faxMessage':require(_0xfc05('0x7'))};exports[_0xfc05('0x8')]=function(_0x5e74a2,_0x409655){return function(_0x4ece46){try{if(!_['isNil'](this[_0xfc05('0x9')][_0xfc05('0xa')])){logger['info']('[%s][AMAZONLEX]\x20%s',_0x5e74a2,_0xfc05('0xb'));return _0x4ece46['next']();}var _0x24b31d={'ContactId':this[_0xfc05('0xc')]['id'],'sentAt':moment()[_0xfc05('0xd')](_0xfc05('0xe')),'direction':_0xfc05('0xf')};var _0x30b7d5=this[_0xfc05('0x10')];if(_0x30b7d5===_0xfc05('0x11')){_0x24b31d['ChatWebsiteId']=this['account']['id'];}else{_0x24b31d[_['upperFirst'](_0x30b7d5)+_0xfc05('0x12')]=this[_0xfc05('0x13')]['id'];}_0x24b31d[_[_0xfc05('0x14')](_0x30b7d5)+'InteractionId']=this[_0xfc05('0x9')]['id'];if(this[_0xfc05('0x9')][_0xfc05('0x15')]){var _0x2aeb33=_0x409655[0x4];if(!_[_0xfc05('0x16')](_0x2aeb33)){_0x24b31d[_0xfc05('0x17')]=utils[_0xfc05('0x18')](_0x2aeb33,this);return rpc[_0x30b7d5+_0xfc05('0x19')][_0xfc05('0x1a')](_0x24b31d)[_0xfc05('0x1b')](function(_0x22def0){logger[_0xfc05('0x1c')](_0xfc05('0x1d'),_0x5e74a2,_0x24b31d['body']);})['catch'](function(_0x55f2bc){logger[_0xfc05('0x1e')](_0xfc05('0x1d'),_0x5e74a2,JSON[_0xfc05('0x1f')](_0x55f2bc));})[_0xfc05('0x20')](function(){logger[_0xfc05('0x1c')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x5e74a2);_0x4ece46['stop']();});}else{logger['info']('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x5e74a2);_0x4ece46['stop']();}}else{var _0x551bf0=this;var _0x4ce8fe=new AWS['LexRuntime']({'accessKeyId':_0x409655[0x0],'secretAccessKey':_0x409655[0x1],'region':_0x409655[0x2]});var _0x70120e={'botAlias':_0xfc05('0x21'),'botName':_0x409655[0x3],'inputText':this[_0xfc05('0x22')][_0xfc05('0x17')],'userId':this[_0xfc05('0x9')]['id'][_0xfc05('0x23')]()};_0x4ce8fe['postText'](_0x70120e,function(_0x11deee,_0x3458bf){if(_0x11deee){logger['error']('[%s][AMAZONLEX]\x20%s',_0x5e74a2,_0x11deee[_0xfc05('0x22')]);_0x4ece46[_0xfc05('0x24')]();}else if(_0x3458bf&&_0x3458bf[_0xfc05('0x22')]){_0x551bf0[_0xfc05('0x17')][_0xfc05('0x25')]=_0x3458bf;_0x24b31d[_0xfc05('0x17')]=_0x3458bf[_0xfc05('0x22')];return rpc[_0x30b7d5+_0xfc05('0x19')][_0xfc05('0x1a')](_0x24b31d)[_0xfc05('0x1b')](function(_0x6f1edb){logger[_0xfc05('0x1c')]('[%s][AMAZONLEX]\x20%s',_0x5e74a2,_0x24b31d[_0xfc05('0x17')]);if(_0x3458bf[_0xfc05('0x26')]==_0xfc05('0x27')){_0x4ece46[_0xfc05('0x24')]();}else{_0x4ece46[_0xfc05('0x28')]();}})[_0xfc05('0x29')](function(_0xa4b43d){logger['error'](_0xfc05('0x1d'),_0x5e74a2,JSON[_0xfc05('0x1f')](_0xa4b43d));_0x4ece46['next']();});}else{_0x4ece46[_0xfc05('0x24')]();}});}}catch(_0x31fd83){logger['error']('[%s][AMAZONLEX]\x20%s',_0x5e74a2,JSON[_0xfc05('0x1f')](_0x31fd83));_0x4ece46['stop']();}};}; \ No newline at end of file +var _0x126f=['channel','chat','ChatWebsiteId','account','upperFirst','InteractionId','isEmpty','body','getMustacheRender','Message','create','then','catch','info','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','LexRuntime','$LATEST','error','message','amazonlex','Failed','stringify','lodash','moment','aws-sdk','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','interaction','UserId','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0xac151d,_0x4ea1d2){var _0x111dba=function(_0x13d7f4){while(--_0x13d7f4){_0xac151d['push'](_0xac151d['shift']());}};_0x111dba(++_0x4ea1d2);}(_0x126f,0x95));var _0xf126=function(_0x2308db,_0x2e95c9){_0x2308db=_0x2308db-0x0;var _0x38d5de=_0x126f[_0x2308db];return _0x38d5de;};'use strict';var _=require(_0xf126('0x0'));var moment=require(_0xf126('0x1'));var AWS=require(_0xf126('0x2'));var utils=require('./utils');var logger=require(_0xf126('0x3'))(_0xf126('0x4'));var rpc={'chatMessage':require(_0xf126('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xf126('0x6')),'smsMessage':require(_0xf126('0x7')),'faxMessage':require(_0xf126('0x8'))};exports[_0xf126('0x9')]=function(_0x518c3d,_0x1d1c90){return function(_0x647ee5){try{if(!_[_0xf126('0xa')](this[_0xf126('0xb')][_0xf126('0xc')])){logger['info'](_0xf126('0xd'),_0x518c3d,_0xf126('0xe'));return _0x647ee5[_0xf126('0xf')]();}var _0x365d22={'ContactId':this[_0xf126('0x10')]['id'],'sentAt':moment()[_0xf126('0x11')](_0xf126('0x12')),'direction':'out'};var _0x509ec4=this[_0xf126('0x13')];if(_0x509ec4===_0xf126('0x14')){_0x365d22[_0xf126('0x15')]=this[_0xf126('0x16')]['id'];}else{_0x365d22[_[_0xf126('0x17')](_0x509ec4)+'AccountId']=this[_0xf126('0x16')]['id'];}_0x365d22[_[_0xf126('0x17')](_0x509ec4)+_0xf126('0x18')]=this[_0xf126('0xb')]['id'];if(this[_0xf126('0xb')]['created']){var _0x2f0ad0=_0x1d1c90[0x4];if(!_[_0xf126('0x19')](_0x2f0ad0)){_0x365d22[_0xf126('0x1a')]=utils[_0xf126('0x1b')](_0x2f0ad0,this);return rpc[_0x509ec4+_0xf126('0x1c')][_0xf126('0x1d')](_0x365d22)[_0xf126('0x1e')](function(_0x2e156a){logger['info'](_0xf126('0xd'),_0x518c3d,_0x365d22[_0xf126('0x1a')]);})[_0xf126('0x1f')](function(_0x103342){logger['error'](_0xf126('0xd'),_0x518c3d,JSON['stringify'](_0x103342));})['finally'](function(){logger[_0xf126('0x20')](_0xf126('0x21'),_0x518c3d);_0x647ee5[_0xf126('0x22')]();});}else{logger['info']('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x518c3d);_0x647ee5['stop']();}}else{var _0x58af76=this;var _0x23b932=new AWS[(_0xf126('0x23'))]({'accessKeyId':_0x1d1c90[0x0],'secretAccessKey':_0x1d1c90[0x1],'region':_0x1d1c90[0x2]});var _0x5cb4b5={'botAlias':_0xf126('0x24'),'botName':_0x1d1c90[0x3],'inputText':this['message'][_0xf126('0x1a')],'userId':this[_0xf126('0xb')]['id']['toString']()};_0x23b932['postText'](_0x5cb4b5,function(_0x25f628,_0x3795b3){if(_0x25f628){logger[_0xf126('0x25')](_0xf126('0xd'),_0x518c3d,_0x25f628['message']);_0x647ee5['next']();}else if(_0x3795b3&&_0x3795b3[_0xf126('0x26')]){_0x58af76['body'][_0xf126('0x27')]=_0x3795b3;_0x365d22['body']=_0x3795b3[_0xf126('0x26')];return rpc[_0x509ec4+'Message'][_0xf126('0x1d')](_0x365d22)[_0xf126('0x1e')](function(_0xccc86e){logger[_0xf126('0x20')](_0xf126('0xd'),_0x518c3d,_0x365d22[_0xf126('0x1a')]);if(_0x3795b3['dialogState']==_0xf126('0x28')){_0x647ee5[_0xf126('0xf')]();}else{_0x647ee5[_0xf126('0x22')]();}})['catch'](function(_0x365a5e){logger[_0xf126('0x25')]('[%s][AMAZONLEX]\x20%s',_0x518c3d,JSON[_0xf126('0x29')](_0x365a5e));_0x647ee5['next']();});}else{_0x647ee5['next']();}});}}catch(_0x3c2558){logger['error'](_0xf126('0xd'),_0x518c3d,JSON['stringify'](_0x3c2558));_0x647ee5[_0xf126('0x22')]();}};}; \ 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 2da3345..4380d4c 100644 --- a/server/services/routing/server/applications/autoreply.js +++ b/server/services/routing/server/applications/autoreply.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['from','phone','subject','startsWith','Re:','chat','ChatWebsiteId','upperFirst','AccountId','account','Message','Smtp','service','host','port','secure','authentication','user','pass','inReplyTo','html','','replace','','sendMailMessage','[%s][AUTOREPLY]\x20SMTP\x20SENT','messageId','then','error','finally','next','create','body','catch','stringify','stop','lodash','moment','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../mailRpc','interaction','created','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20already\x20sent','channel','getMustacheRender','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','message'];(function(_0x3fe47b,_0x3b5c19){var _0x59a0d9=function(_0x591009){while(--_0x591009){_0x3fe47b['push'](_0x3fe47b['shift']());}};_0x59a0d9(++_0x3b5c19);}(_0x70e0,0x17b));var _0x070e=function(_0x3048f2,_0x52dec6){_0x3048f2=_0x3048f2-0x0;var _0x431988=_0x70e0[_0x3048f2];return _0x431988;};'use strict';var _=require(_0x070e('0x0'));var moment=require(_0x070e('0x1'));var utils=require(_0x070e('0x2'));var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require(_0x070e('0x3')),'openchannelMessage':require(_0x070e('0x4')),'mailMessage':require(_0x070e('0x5')),'smsMessage':require(_0x070e('0x6')),'faxMessage':require('../../rpc/faxMessage')};var mailRpc=require(_0x070e('0x7'));exports['consequence']=function(_0x46fe68,_0x4b041d){return function(_0x56e420){try{if(_0x4b041d[0x0]==='1'&&(_['isNil'](this[_0x070e('0x8')][_0x070e('0x9')])||!this[_0x070e('0x8')][_0x070e('0x9')])){logger[_0x070e('0xa')](_0x070e('0xb'),_0x46fe68,_0x070e('0xc'));return _0x56e420['next']();}var _0x49b2fb=this[_0x070e('0xd')];var _0x2e3e5e={'body':utils[_0x070e('0xe')](_0x4b041d[0x1],this),'ContactId':this[_0x070e('0xf')]['id'],'sentAt':moment()[_0x070e('0x10')](_0x070e('0x11')),'direction':_0x070e('0x12')};if(this[_0x070e('0x13')]){_0x2e3e5e['to']=this[_0x070e('0x13')][_0x070e('0x14')]||'';_0x2e3e5e['cc']=this[_0x070e('0x13')]['cc']||'';_0x2e3e5e['from']=this['message']['to']||'';_0x2e3e5e[_0x070e('0x15')]=this['message']['phone']||'';_0x2e3e5e['read']=!![];if(this[_0x070e('0x13')][_0x070e('0x16')]){_0x2e3e5e['subject']='';_0x2e3e5e['subject']+=_[_0x070e('0x17')](this[_0x070e('0x13')][_0x070e('0x16')],_0x070e('0x18'))?'':'Re:\x20';_0x2e3e5e['subject']+=this[_0x070e('0x13')][_0x070e('0x16')];}}if(this[_0x070e('0xd')]===_0x070e('0x19')){_0x2e3e5e[_0x070e('0x1a')]=this['account']['id'];}else{_0x2e3e5e[_[_0x070e('0x1b')](this[_0x070e('0xd')])+_0x070e('0x1c')]=this[_0x070e('0x1d')]['id'];}_0x2e3e5e[_[_0x070e('0x1b')](this['channel'])+'InteractionId']=this['interaction']['id'];if(rpc[this[_0x070e('0xd')]+_0x070e('0x1e')]){if(this[_0x070e('0xd')]==='mail'){var _0x5b184={'tls':{'rejectUnauthorized':![]}};if(this['account'][_0x070e('0x1f')][_0x070e('0x20')]){_0x5b184[_0x070e('0x20')]=this[_0x070e('0x1d')][_0x070e('0x1f')][_0x070e('0x20')];}else{_0x5b184[_0x070e('0x21')]=this[_0x070e('0x1d')]['Smtp'][_0x070e('0x21')];_0x5b184[_0x070e('0x22')]=this[_0x070e('0x1d')]['Smtp'][_0x070e('0x22')];_0x5b184['secure']=this['account'][_0x070e('0x1f')][_0x070e('0x23')];}if(this[_0x070e('0x1d')][_0x070e('0x1f')][_0x070e('0x24')]){_0x5b184['auth']={'user':this[_0x070e('0x1d')][_0x070e('0x1f')][_0x070e('0x25')],'pass':this[_0x070e('0x1d')][_0x070e('0x1f')][_0x070e('0x26')]};}_0x2e3e5e[_0x070e('0x27')]=this[_0x070e('0x13')]['messageId'];_0x2e3e5e[_0x070e('0x28')]=_0x070e('0x29')+_[_0x070e('0x2a')](_0x2e3e5e['body'],'','replace','body','','sendMailMessage','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','stringify'];(function(_0x41f2d6,_0x57106d){var _0x15fa09=function(_0x539203){while(--_0x539203){_0x41f2d6['push'](_0x41f2d6['shift']());}};_0x15fa09(++_0x57106d);}(_0xedd9,0xfc));var _0x9edd=function(_0x26a463,_0x1d10b9){_0x26a463=_0x26a463-0x0;var _0x5d43a3=_0xedd9[_0x26a463];return _0x5d43a3;};'use strict';var _=require('lodash');var moment=require(_0x9edd('0x0'));var utils=require(_0x9edd('0x1'));var logger=require(_0x9edd('0x2'))(_0x9edd('0x3'));var rpc={'chatMessage':require(_0x9edd('0x4')),'openchannelMessage':require(_0x9edd('0x5')),'mailMessage':require(_0x9edd('0x6')),'smsMessage':require(_0x9edd('0x7')),'faxMessage':require('../../rpc/faxMessage')};var mailRpc=require(_0x9edd('0x8'));exports[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return function(_0x5319f7){try{if(_0x34c1a7[0x0]==='1'&&(_[_0x9edd('0xa')](this['interaction'][_0x9edd('0xb')])||!this[_0x9edd('0xc')][_0x9edd('0xb')])){logger[_0x9edd('0xd')]('[%s][AUTOREPLY]\x20%s',_0x268f9e,_0x9edd('0xe'));return _0x5319f7['next']();}var _0x2076fc=this[_0x9edd('0xf')];var _0x523026={'body':utils[_0x9edd('0x10')](_0x34c1a7[0x1],this),'ContactId':this[_0x9edd('0x11')]['id'],'sentAt':moment()['format'](_0x9edd('0x12')),'direction':_0x9edd('0x13')};if(this[_0x9edd('0x14')]){_0x523026['to']=this[_0x9edd('0x14')][_0x9edd('0x15')]||'';_0x523026['cc']=this[_0x9edd('0x14')]['cc']||'';_0x523026[_0x9edd('0x15')]=this[_0x9edd('0x14')]['to']||'';_0x523026['phone']=this[_0x9edd('0x14')][_0x9edd('0x16')]||'';_0x523026[_0x9edd('0x17')]=!![];if(this[_0x9edd('0x14')][_0x9edd('0x18')]){_0x523026[_0x9edd('0x18')]='';_0x523026[_0x9edd('0x18')]+=_[_0x9edd('0x19')](this['message'][_0x9edd('0x18')],_0x9edd('0x1a'))?'':_0x9edd('0x1b');_0x523026['subject']+=this[_0x9edd('0x14')][_0x9edd('0x18')];}}if(this[_0x9edd('0xf')]==='chat'){_0x523026[_0x9edd('0x1c')]=this['account']['id'];}else{_0x523026[_[_0x9edd('0x1d')](this[_0x9edd('0xf')])+'AccountId']=this['account']['id'];}_0x523026[_[_0x9edd('0x1d')](this['channel'])+_0x9edd('0x1e')]=this['interaction']['id'];if(rpc[this['channel']+_0x9edd('0x1f')]){if(this[_0x9edd('0xf')]==='mail'){var _0x5823bc={'tls':{'rejectUnauthorized':![]}};if(this[_0x9edd('0x20')][_0x9edd('0x21')][_0x9edd('0x22')]){_0x5823bc['service']=this[_0x9edd('0x20')][_0x9edd('0x21')][_0x9edd('0x22')];}else{_0x5823bc[_0x9edd('0x23')]=this[_0x9edd('0x20')]['Smtp'][_0x9edd('0x23')];_0x5823bc[_0x9edd('0x24')]=this[_0x9edd('0x20')][_0x9edd('0x21')][_0x9edd('0x24')];_0x5823bc['secure']=this['account'][_0x9edd('0x21')][_0x9edd('0x25')];}if(this[_0x9edd('0x20')][_0x9edd('0x21')][_0x9edd('0x26')]){_0x5823bc['auth']={'user':this['account'][_0x9edd('0x21')][_0x9edd('0x27')],'pass':this[_0x9edd('0x20')]['Smtp'][_0x9edd('0x28')]};}_0x523026[_0x9edd('0x29')]=this[_0x9edd('0x14')][_0x9edd('0x2a')];_0x523026['html']=_0x9edd('0x2b')+_[_0x9edd('0x2c')](_0x523026[_0x9edd('0x2d')],_0x9edd('0x2e'),_0x9edd('0x2f'))+_0x9edd('0x30');return mailRpc[_0x9edd('0x31')](_0x5823bc,_0x523026)[_0x9edd('0x32')](function(_0x19b6c1){logger[_0x9edd('0xd')](_0x9edd('0x33'),_0x268f9e);_0x523026[_0x9edd('0x2a')]=_0x19b6c1[_0x9edd('0x14')][_0x9edd('0x2a')];return rpc[_0x2076fc+_0x9edd('0x1f')]['create'](_0x523026);})[_0x9edd('0x32')](function(_0x259259){logger[_0x9edd('0xd')]('[%s][AUTOREPLY]\x20%s',_0x268f9e,JSON[_0x9edd('0x34')](_0x259259));})[_0x9edd('0x35')](function(_0xde9b13){logger[_0x9edd('0x36')](_0x9edd('0x37'),_0x268f9e,JSON[_0x9edd('0x34')](_0xde9b13));})[_0x9edd('0x38')](function(){_0x5319f7[_0x9edd('0x39')]();});}else{return rpc[this[_0x9edd('0xf')]+_0x9edd('0x1f')][_0x9edd('0x3a')](_0x523026)[_0x9edd('0x32')](function(_0x27eb7e){logger[_0x9edd('0xd')]('[%s][AUTOREPLY]\x20%s',_0x268f9e,_0x523026[_0x9edd('0x2d')]);})['catch'](function(_0x968303){logger[_0x9edd('0x36')](_0x9edd('0x3b'),_0x268f9e,JSON[_0x9edd('0x34')](_0x968303));})[_0x9edd('0x38')](function(){_0x5319f7['next']();});}}}catch(_0x6de835){logger[_0x9edd('0x36')](_0x9edd('0x3b'),_0x268f9e,JSON[_0x9edd('0x34')](_0x6de835));_0x5319f7[_0x9edd('0x3c')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/close.js b/server/services/routing/server/applications/close.js index 8559f97..f49a8aa 100644 --- a/server/services/routing/server/applications/close.js +++ b/server/services/routing/server/applications/close.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3c0d=['[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update','then','interaction','catch','error','stringify','finally','stop','[%s][CLOSE]\x20%s','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','consequence'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3c0d,0xf6));var _0xd3c0=function(_0x216948,_0xf6d435){_0x216948=_0x216948-0x0;var _0xeea7d8=_0x3c0d[_0x216948];return _0xeea7d8;};'use strict';var moment=require('moment');var logger=require('../../../../config/logger')('routing');var rpc={'chatInteraction':require(_0xd3c0('0x0')),'openchannelInteraction':require(_0xd3c0('0x1')),'smsInteraction':require(_0xd3c0('0x2')),'mailInteraction':require(_0xd3c0('0x3')),'faxInteraction':require(_0xd3c0('0x4'))};exports[_0xd3c0('0x5')]=function(_0xe14278,_0x161aac,_0x347711,_0x4d5cf1){return function(_0x36ce7f){try{logger['info'](_0xd3c0('0x6'),_0xe14278,_0x161aac[0x0]);var _0x10f804={'closed':0x1,'closedAt':moment()[_0xd3c0('0x7')](_0xd3c0('0x8')),'closeReason':_0xd3c0('0x9'),'disposition':_0x161aac[0x0]};if(rpc[_0x4d5cf1[_0xd3c0('0xa')]+_0xd3c0('0xb')]){rpc[_0x4d5cf1[_0xd3c0('0xa')]+_0xd3c0('0xb')][_0xd3c0('0xc')](_0x4d5cf1['interaction']['id'],_0x10f804)[_0xd3c0('0xd')](function(_0x4152c1){logger['info']('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0xe14278,_0x4d5cf1[_0xd3c0('0xe')]['id']);})[_0xd3c0('0xf')](function(_0xbcc62a){logger[_0xd3c0('0x10')]('[%s][CLOSE]\x20%s',_0xe14278,JSON[_0xd3c0('0x11')](_0xbcc62a));})[_0xd3c0('0x12')](function(){_0x36ce7f[_0xd3c0('0x13')]();});}}catch(_0x4ede9e){logger[_0xd3c0('0x10')](_0xd3c0('0x14'),_0xe14278,JSON[_0xd3c0('0x11')](_0x4ede9e));_0x36ce7f[_0xd3c0('0x13')]();}};}; \ No newline at end of file +var _0xf682=['interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s','stringify','finally','stop','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','consequence','info','format','channel','Interaction','update'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xf682,0x12f));var _0x2f68=function(_0x3adf7e,_0x1f4506){_0x3adf7e=_0x3adf7e-0x0;var _0x4ca250=_0xf682[_0x3adf7e];return _0x4ca250;};'use strict';var moment=require(_0x2f68('0x0'));var logger=require(_0x2f68('0x1'))(_0x2f68('0x2'));var rpc={'chatInteraction':require(_0x2f68('0x3')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x2f68('0x4')),'faxInteraction':require(_0x2f68('0x5'))};exports[_0x2f68('0x6')]=function(_0x39c412,_0x4a1466,_0x382bd8,_0x46dd32){return function(_0x6f92f6){try{logger[_0x2f68('0x7')]('[%s][CLOSE]\x20reason\x20%s',_0x39c412,_0x4a1466[0x0]);var _0x2523dc={'closed':0x1,'closedAt':moment()[_0x2f68('0x8')]('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':'system','disposition':_0x4a1466[0x0]};if(rpc[_0x46dd32['channel']+'Interaction']){rpc[_0x46dd32[_0x2f68('0x9')]+_0x2f68('0xa')][_0x2f68('0xb')](_0x46dd32[_0x2f68('0xc')]['id'],_0x2523dc)[_0x2f68('0xd')](function(_0x294364){logger[_0x2f68('0x7')](_0x2f68('0xe'),_0x39c412,_0x46dd32[_0x2f68('0xc')]['id']);})[_0x2f68('0xf')](function(_0x375ac8){logger[_0x2f68('0x10')](_0x2f68('0x11'),_0x39c412,JSON[_0x2f68('0x12')](_0x375ac8));})[_0x2f68('0x13')](function(){_0x6f92f6[_0x2f68('0x14')]();});}}catch(_0x596e19){logger[_0x2f68('0x10')](_0x2f68('0x11'),_0x39c412,JSON[_0x2f68('0x12')](_0x596e19));_0x6f92f6[_0x2f68('0x14')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflow.js b/server/services/routing/server/applications/dialogflow.js index 91318ae..bd5e484 100644 --- a/server/services/routing/server/applications/dialogflow.js +++ b/server/services/routing/server/applications/dialogflow.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3b87=['message','result','fulfillment','metadata','catch','stringify','lodash','moment','apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','interaction','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','YYYY-MM-DD\x20HH:mm:ss','out','channel','chat','account','upperFirst','AccountId','InteractionId','created','isEmpty','body','getMustacheRender','Message','create','then','info','[%s][DIALOGFLOW]\x20%s','error','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!'];(function(_0x20f94f,_0x218788){var _0x148244=function(_0x2e89a0){while(--_0x2e89a0){_0x20f94f['push'](_0x20f94f['shift']());}};_0x148244(++_0x218788);}(_0x3b87,0x10e));var _0x73b8=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x3b87[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x73b8('0x0'));var moment=require(_0x73b8('0x1'));var apiai=require(_0x73b8('0x2'));var md5=require(_0x73b8('0x3'));var utils=require(_0x73b8('0x4'));var logger=require(_0x73b8('0x5'))(_0x73b8('0x6'));var rpc={'chatMessage':require(_0x73b8('0x7')),'openchannelMessage':require(_0x73b8('0x8')),'mailMessage':require(_0x73b8('0x9')),'smsMessage':require(_0x73b8('0xa')),'faxMessage':require(_0x73b8('0xb'))};exports[_0x73b8('0xc')]=function(_0xdddfcd,_0x483571){return function(_0x5dee8b){try{if(!_['isNil'](this[_0x73b8('0xd')]['UserId'])){logger['info']('[%s][DIALOGFLOW]\x20%s',_0xdddfcd,_0x73b8('0xe'));return _0x5dee8b[_0x73b8('0xf')]();}var _0x2c34a9={'ContactId':this['contact']['id'],'sentAt':moment()['format'](_0x73b8('0x10')),'direction':_0x73b8('0x11')};var _0x19c5e3=this[_0x73b8('0x12')];if(_0x19c5e3===_0x73b8('0x13')){_0x2c34a9['ChatWebsiteId']=this[_0x73b8('0x14')]['id'];}else{_0x2c34a9[_[_0x73b8('0x15')](_0x19c5e3)+_0x73b8('0x16')]=this[_0x73b8('0x14')]['id'];}_0x2c34a9[_[_0x73b8('0x15')](_0x19c5e3)+_0x73b8('0x17')]=this[_0x73b8('0xd')]['id'];if(this[_0x73b8('0xd')][_0x73b8('0x18')]){var _0x5d9c68=_0x483571[0x2];if(!_[_0x73b8('0x19')](_0x5d9c68)){_0x2c34a9[_0x73b8('0x1a')]=utils[_0x73b8('0x1b')](_0x5d9c68,this);return rpc[_0x19c5e3+_0x73b8('0x1c')][_0x73b8('0x1d')](_0x2c34a9)[_0x73b8('0x1e')](function(_0x5d68a1){logger[_0x73b8('0x1f')](_0x73b8('0x20'),_0xdddfcd,_0x2c34a9[_0x73b8('0x1a')]);})['catch'](function(_0x4f804f){logger[_0x73b8('0x21')](_0x73b8('0x20'),_0xdddfcd,JSON['stringify'](_0x4f804f));})[_0x73b8('0x22')](function(){logger[_0x73b8('0x1f')](_0x73b8('0x23'),_0xdddfcd);_0x5dee8b[_0x73b8('0x24')]();});}else{logger[_0x73b8('0x1f')](_0x73b8('0x25'),_0xdddfcd);_0x5dee8b['stop']();}}else{var _0x5963f2=this;var _0x48f9ad=apiai(_0x483571[0x0],{'language':_0x483571[0x1]||'en'});return _0x48f9ad['textRequest'](this[_0x73b8('0x26')][_0x73b8('0x1a')],{'sessionId':md5(this[_0x73b8('0xd')]['id'])})['then'](function(_0x5d6631){_0x5963f2[_0x73b8('0x1a')]['dialogflow']=_0x5d6631;_0x2c34a9[_0x73b8('0x1a')]=_0x5d6631[_0x73b8('0x27')][_0x73b8('0x28')]['speech'];return rpc[_0x19c5e3+_0x73b8('0x1c')][_0x73b8('0x1d')](_0x2c34a9)[_0x73b8('0x1e')](function(_0x391957){logger[_0x73b8('0x1f')](_0x73b8('0x20'),_0xdddfcd,_0x2c34a9['body']);if(_0x5d6631[_0x73b8('0x27')][_0x73b8('0x29')]['endConversation']){_0x5dee8b[_0x73b8('0xf')]();}else{_0x5dee8b[_0x73b8('0x24')]();}})[_0x73b8('0x2a')](function(_0x3a0567){logger['error'](_0x73b8('0x20'),_0xdddfcd,JSON[_0x73b8('0x2b')](_0x3a0567));_0x5dee8b[_0x73b8('0xf')]();});})['catch'](function(_0x40c5ab){logger[_0x73b8('0x21')](_0x73b8('0x20'),_0xdddfcd,_0x40c5ab['message']);_0x5dee8b[_0x73b8('0xf')]();});}}catch(_0x23057d){logger[_0x73b8('0x21')]('[%s][DIALOGFLOW]\x20%s',_0xdddfcd,JSON[_0x73b8('0x2b')](_0x23057d));_0x5dee8b[_0x73b8('0x24')]();}};}; \ No newline at end of file +var _0x8495=['../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','isNil','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','format','YYYY-MM-DD\x20HH:mm:ss','chat','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','created','isEmpty','body','getMustacheRender','create','catch','error','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','then','dialogflow','result','fulfillment','speech','Message','metadata','stringify','moment','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage'];(function(_0xb41e7f,_0x195aa3){var _0x447808=function(_0x27d600){while(--_0x27d600){_0xb41e7f['push'](_0xb41e7f['shift']());}};_0x447808(++_0x195aa3);}(_0x8495,0x81));var _0x5849=function(_0x42f009,_0x5e27b1){_0x42f009=_0x42f009-0x0;var _0x22a1e0=_0x8495[_0x42f009];return _0x22a1e0;};'use strict';var _=require('lodash');var moment=require(_0x5849('0x0'));var apiai=require('apiai-promise');var md5=require(_0x5849('0x1'));var utils=require(_0x5849('0x2'));var logger=require(_0x5849('0x3'))(_0x5849('0x4'));var rpc={'chatMessage':require(_0x5849('0x5')),'openchannelMessage':require(_0x5849('0x6')),'mailMessage':require(_0x5849('0x7')),'smsMessage':require(_0x5849('0x8')),'faxMessage':require('../../rpc/faxMessage')};exports['consequence']=function(_0x4d9d87,_0x174a2e){return function(_0x5a7180){try{if(!_[_0x5849('0x9')](this[_0x5849('0xa')][_0x5849('0xb')])){logger[_0x5849('0xc')](_0x5849('0xd'),_0x4d9d87,_0x5849('0xe'));return _0x5a7180[_0x5849('0xf')]();}var _0x12442e={'ContactId':this['contact']['id'],'sentAt':moment()[_0x5849('0x10')](_0x5849('0x11')),'direction':'out'};var _0x3c13da=this['channel'];if(_0x3c13da===_0x5849('0x12')){_0x12442e[_0x5849('0x13')]=this['account']['id'];}else{_0x12442e[_[_0x5849('0x14')](_0x3c13da)+_0x5849('0x15')]=this[_0x5849('0x16')]['id'];}_0x12442e[_[_0x5849('0x14')](_0x3c13da)+_0x5849('0x17')]=this['interaction']['id'];if(this['interaction'][_0x5849('0x18')]){var _0x114fe3=_0x174a2e[0x2];if(!_[_0x5849('0x19')](_0x114fe3)){_0x12442e[_0x5849('0x1a')]=utils[_0x5849('0x1b')](_0x114fe3,this);return rpc[_0x3c13da+'Message'][_0x5849('0x1c')](_0x12442e)['then'](function(_0x2036dd){logger[_0x5849('0xc')](_0x5849('0xd'),_0x4d9d87,_0x12442e[_0x5849('0x1a')]);})[_0x5849('0x1d')](function(_0x5636d4){logger[_0x5849('0x1e')](_0x5849('0xd'),_0x4d9d87,JSON['stringify'](_0x5636d4));})[_0x5849('0x1f')](function(){logger[_0x5849('0xc')](_0x5849('0x20'),_0x4d9d87);_0x5a7180[_0x5849('0x21')]();});}else{logger[_0x5849('0xc')](_0x5849('0x22'),_0x4d9d87);_0x5a7180[_0x5849('0x21')]();}}else{var _0xe20244=this;var _0x2f7fd2=apiai(_0x174a2e[0x0],{'language':_0x174a2e[0x1]||'en'});return _0x2f7fd2[_0x5849('0x23')](this[_0x5849('0x24')][_0x5849('0x1a')],{'sessionId':md5(this[_0x5849('0xa')]['id'])})[_0x5849('0x25')](function(_0x405ac8){_0xe20244['body'][_0x5849('0x26')]=_0x405ac8;_0x12442e['body']=_0x405ac8[_0x5849('0x27')][_0x5849('0x28')][_0x5849('0x29')];return rpc[_0x3c13da+_0x5849('0x2a')][_0x5849('0x1c')](_0x12442e)[_0x5849('0x25')](function(_0xa25667){logger[_0x5849('0xc')](_0x5849('0xd'),_0x4d9d87,_0x12442e[_0x5849('0x1a')]);if(_0x405ac8['result'][_0x5849('0x2b')]['endConversation']){_0x5a7180[_0x5849('0xf')]();}else{_0x5a7180['stop']();}})['catch'](function(_0x223a5f){logger[_0x5849('0x1e')](_0x5849('0xd'),_0x4d9d87,JSON[_0x5849('0x2c')](_0x223a5f));_0x5a7180[_0x5849('0xf')]();});})[_0x5849('0x1d')](function(_0x3892d2){logger[_0x5849('0x1e')](_0x5849('0xd'),_0x4d9d87,_0x3892d2[_0x5849('0x24')]);_0x5a7180[_0x5849('0xf')]();});}}catch(_0x447b40){logger[_0x5849('0x1e')](_0x5849('0xd'),_0x4d9d87,JSON[_0x5849('0x2c')](_0x447b40));_0x5a7180['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotoif.js b/server/services/routing/server/applications/gotoif.js index 03a0b56..99db3ee 100644 --- a/server/services/routing/server/applications/gotoif.js +++ b/server/services/routing/server/applications/gotoif.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x646c=['stop','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','condition','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','[%s][GOTOIF]\x20%s','stringify','validate','lodash','html-to-text','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','replace','error','map','message','join'];(function(_0x3a19d4,_0x3f19a4){var _0x5b858b=function(_0x4ddce5){while(--_0x4ddce5){_0x3a19d4['push'](_0x3a19d4['shift']());}};_0x5b858b(++_0x3f19a4);}(_0x646c,0x193));var _0xc646=function(_0x223461,_0x2bca70){_0x223461=_0x223461-0x0;var _0x4dbe0a=_0x646c[_0x223461];return _0x4dbe0a;};'use strict';var schema=require(_0xc646('0x0'));var _=require(_0xc646('0x1'));var htmlToText=require(_0xc646('0x2'));var utils=require(_0xc646('0x3'));var logger=require(_0xc646('0x4'))(_0xc646('0x5'));var gotoif=schema({'condition':{'type':_0xc646('0x6'),'required':!![],'message':_0xc646('0x7')},'priorityTrue':{'type':'number','message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':'number','message':_0xc646('0x8')}});exports[_0xc646('0x9')]=function(_0x2db65d,_0x242ed8){return function(_0xd7f2cb){try{var _0x4be75f={'condition':htmlToText[_0xc646('0xa')](utils[_0xc646('0xb')](_0x242ed8[0x0],this),{'wordwrap':![]})[_0xc646('0xc')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x242ed8[0x1],'priorityFalse':_0x242ed8[0x2]};var _0x16721b=gotoif['validate'](_0x4be75f,{'typecast':!![]});if(_0x16721b['length']){logger[_0xc646('0xd')]('[%s][GOTOIF]\x20%s',_0x2db65d,_[_0xc646('0xe')](_0x16721b,_0xc646('0xf'))[_0xc646('0x10')](',\x20'));_0xd7f2cb[_0xc646('0x11')]();}else{try{var _0xd49d85=eval('('+_0x4be75f['condition']+')');var _0x3e7b51=_0xd49d85?_0x4be75f[_0xc646('0x12')]:_0x4be75f[_0xc646('0x13')];logger[_0xc646('0x14')](_0xc646('0x15'),_0x2db65d,_0x4be75f[_0xc646('0x16')],_0xd49d85,_0x3e7b51||_0xc646('0x17'));if(_0x3e7b51){var _0x33469d=_[_0xc646('0x18')](_0xd7f2cb['rules'](),{'p':_0x3e7b51});if(_0x33469d>=0x0){logger['info'](_0xc646('0x19'),_0x2db65d,_0x3e7b51||_0xc646('0x17'),_0x33469d);_0xd7f2cb['next'](_0x33469d);}else{logger[_0xc646('0x14')](_0xc646('0x1a'),_0x2db65d,_0x3e7b51||_0xc646('0x17'));_0xd7f2cb['stop']();}}else{_0xd7f2cb[_0xc646('0x17')]();}}catch(_0x77823){logger[_0xc646('0xd')](_0xc646('0x1b'),_0x2db65d,_0x77823['message']);_0xd7f2cb[_0xc646('0x11')]();}}}catch(_0x1ee306){logger['error'](_0xc646('0x1c'),_0x2db65d,JSON[_0xc646('0x1d')](_0x1ee306));_0xd7f2cb[_0xc646('0x11')]();}};}; \ No newline at end of file +var _0x07c5=['findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','message','error','stringify','validate','./utils','../../../../config/logger','routing','number','priority\x20true\x20is\x20a\x20number','consequence','replace','length','[%s][GOTOIF]\x20%s','join','stop','condition','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s'];(function(_0x24225d,_0x355681){var _0x364b83=function(_0x2c5bfe){while(--_0x2c5bfe){_0x24225d['push'](_0x24225d['shift']());}};_0x364b83(++_0x355681);}(_0x07c5,0x135));var _0x507c=function(_0x236b78,_0x4a9a7a){_0x236b78=_0x236b78-0x0;var _0x460f53=_0x07c5[_0x236b78];return _0x460f53;};'use strict';var schema=require(_0x507c('0x0'));var _=require('lodash');var htmlToText=require('html-to-text');var utils=require(_0x507c('0x1'));var logger=require(_0x507c('0x2'))(_0x507c('0x3'));var gotoif=schema({'condition':{'type':'string','required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':_0x507c('0x4'),'message':_0x507c('0x5')},'priorityFalse':{'type':_0x507c('0x4'),'message':'priority\x20false\x20is\x20a\x20number'}});exports[_0x507c('0x6')]=function(_0x488bb4,_0xb4339){return function(_0x4b7eba){try{var _0x20848e={'condition':htmlToText['fromString'](utils['getMustacheRender'](_0xb4339[0x0],this),{'wordwrap':![]})[_0x507c('0x7')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0xb4339[0x1],'priorityFalse':_0xb4339[0x2]};var _0x32b141=gotoif[_0x507c('0x0')](_0x20848e,{'typecast':!![]});if(_0x32b141[_0x507c('0x8')]){logger['error'](_0x507c('0x9'),_0x488bb4,_['map'](_0x32b141,'message')[_0x507c('0xa')](',\x20'));_0x4b7eba[_0x507c('0xb')]();}else{try{var _0x56e47b=eval('('+_0x20848e[_0x507c('0xc')]+')');var _0x33d9e9=_0x56e47b?_0x20848e['priorityTrue']:_0x20848e[_0x507c('0xd')];logger[_0x507c('0xe')](_0x507c('0xf'),_0x488bb4,_0x20848e[_0x507c('0xc')],_0x56e47b,_0x33d9e9||'next');if(_0x33d9e9){var _0x4246fb=_[_0x507c('0x10')](_0x4b7eba[_0x507c('0x11')](),{'p':_0x33d9e9});if(_0x4246fb>=0x0){logger['info'](_0x507c('0x12'),_0x488bb4,_0x33d9e9||_0x507c('0x13'),_0x4246fb);_0x4b7eba['next'](_0x4246fb);}else{logger['info'](_0x507c('0x14'),_0x488bb4,_0x33d9e9||_0x507c('0x13'));_0x4b7eba[_0x507c('0xb')]();}}else{_0x4b7eba[_0x507c('0x13')]();}}catch(_0x1f5835){logger['error'](_0x507c('0x15'),_0x488bb4,_0x1f5835[_0x507c('0x16')]);_0x4b7eba[_0x507c('0xb')]();}}}catch(_0x10773d){logger[_0x507c('0x17')](_0x507c('0x9'),_0x488bb4,JSON[_0x507c('0x18')](_0x10773d));_0x4b7eba['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotop.js b/server/services/routing/server/applications/gotop.js index b7f338d..4370ecc 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 _0xae52=['message','join','info','[%s][GOTOP]\x20priority\x20%s','priority','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','stop','stringify','validate','lodash','routing','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','[%s][GOTOP]\x20%s','map'];(function(_0x390a19,_0x5dd137){var _0x5d8230=function(_0x2e6234){while(--_0x2e6234){_0x390a19['push'](_0x390a19['shift']());}};_0x5d8230(++_0x5dd137);}(_0xae52,0xa2));var _0x2ae5=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0xae52[_0x5d4607];return _0x5e4a86;};'use strict';var schema=require(_0x2ae5('0x0'));var _=require(_0x2ae5('0x1'));var logger=require('../../../../config/logger')(_0x2ae5('0x2'));var gotop=schema({'priority':{'type':'number','required':!![],'message':_0x2ae5('0x3')}});exports[_0x2ae5('0x4')]=function(_0x1532b4,_0x54c3c3){return function(_0x3c36bf){try{var _0x31d2cd={'priority':_0x54c3c3[0x0]};var _0x1b6ec5=gotop['validate'](_0x31d2cd,{'typecast':!![]});if(_0x1b6ec5[_0x2ae5('0x5')]){logger[_0x2ae5('0x6')](_0x2ae5('0x7'),_0x1532b4,_[_0x2ae5('0x8')](_0x1b6ec5,_0x2ae5('0x9'))[_0x2ae5('0xa')](',\x20'));_0x3c36bf['stop']();}else{logger[_0x2ae5('0xb')](_0x2ae5('0xc'),_0x1532b4,_0x31d2cd[_0x2ae5('0xd')]);if(_0x31d2cd[_0x2ae5('0xd')]){var _0x500d84=_['findIndex'](_0x3c36bf[_0x2ae5('0xe')](),{'p':_0x31d2cd[_0x2ae5('0xd')]});if(_0x500d84>=0x0){logger['info'](_0x2ae5('0xf'),_0x1532b4,_0x31d2cd[_0x2ae5('0xd')]||_0x2ae5('0x10'),_0x500d84);_0x3c36bf[_0x2ae5('0x10')](_0x500d84);}else{logger[_0x2ae5('0xb')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x1532b4,_0x31d2cd[_0x2ae5('0xd')]||'next');_0x3c36bf[_0x2ae5('0x11')]();}}else{_0x3c36bf[_0x2ae5('0x10')]();}}}catch(_0xdaf539){logger[_0x2ae5('0x6')](_0x2ae5('0x7'),_0x1532b4,JSON[_0x2ae5('0x12')](_0xdaf539));_0x3c36bf[_0x2ae5('0x11')]();}};}; \ No newline at end of file +var _0xac6b=['message','join','stop','info','priority','findIndex','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','error','[%s][GOTOP]\x20%s','stringify','validate','lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','map'];(function(_0x5d0593,_0x3781d7){var _0x515589=function(_0x44b614){while(--_0x44b614){_0x5d0593['push'](_0x5d0593['shift']());}};_0x515589(++_0x3781d7);}(_0xac6b,0x1d7));var _0xbac6=function(_0x3086b1,_0x567b86){_0x3086b1=_0x3086b1-0x0;var _0x318838=_0xac6b[_0x3086b1];return _0x318838;};'use strict';var schema=require(_0xbac6('0x0'));var _=require(_0xbac6('0x1'));var logger=require(_0xbac6('0x2'))(_0xbac6('0x3'));var gotop=schema({'priority':{'type':_0xbac6('0x4'),'required':!![],'message':_0xbac6('0x5')}});exports[_0xbac6('0x6')]=function(_0x5acbce,_0x399aec){return function(_0x23c1de){try{var _0x2f0e46={'priority':_0x399aec[0x0]};var _0x2487ec=gotop[_0xbac6('0x0')](_0x2f0e46,{'typecast':!![]});if(_0x2487ec[_0xbac6('0x7')]){logger['error']('[%s][GOTOP]\x20%s',_0x5acbce,_[_0xbac6('0x8')](_0x2487ec,_0xbac6('0x9'))[_0xbac6('0xa')](',\x20'));_0x23c1de[_0xbac6('0xb')]();}else{logger[_0xbac6('0xc')]('[%s][GOTOP]\x20priority\x20%s',_0x5acbce,_0x2f0e46[_0xbac6('0xd')]);if(_0x2f0e46[_0xbac6('0xd')]){var _0x5d7b76=_[_0xbac6('0xe')](_0x23c1de['rules'](),{'p':_0x2f0e46[_0xbac6('0xd')]});if(_0x5d7b76>=0x0){logger[_0xbac6('0xc')](_0xbac6('0xf'),_0x5acbce,_0x2f0e46['priority']||'next',_0x5d7b76);_0x23c1de[_0xbac6('0x10')](_0x5d7b76);}else{logger[_0xbac6('0xc')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x5acbce,_0x2f0e46[_0xbac6('0xd')]||_0xbac6('0x10'));_0x23c1de[_0xbac6('0xb')]();}}else{_0x23c1de['next']();}}}catch(_0x42dc15){logger[_0xbac6('0x11')](_0xbac6('0x12'),_0x5acbce,JSON[_0xbac6('0x13')](_0x42dc15));_0x23c1de['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/message.js b/server/services/routing/server/applications/message.js index 3a23979..af88e2f 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 _0x9599=['../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','getMustacheRender','contact','chat','ChatWebsiteId','account','upperFirst','channel','AccountId','create','then','[%s][MESSAGE]\x20%s','body','catch','error','stop','./utils'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x9599,0x19d));var _0x9959=function(_0x3434d7,_0x4d4eb0){_0x3434d7=_0x3434d7-0x0;var _0x51eebd=_0x9599[_0x3434d7];return _0x51eebd;};'use strict';var _=require('lodash');var utils=require(_0x9959('0x0'));var logger=require(_0x9959('0x1'))('routing');var rpc={'chatMessage':require(_0x9959('0x2')),'openchannelMessage':require(_0x9959('0x3')),'mailMessage':require(_0x9959('0x4')),'smsMessage':require(_0x9959('0x5')),'faxMessage':require(_0x9959('0x6'))};exports[_0x9959('0x7')]=function(_0x12aa7d,_0x161a4f){return function(_0x14c157){try{var _0x385f5b={'body':utils[_0x9959('0x8')](_0x161a4f[0x0],this),'ContactId':this[_0x9959('0x9')]['id']};if(this['channel']===_0x9959('0xa')){_0x385f5b[_0x9959('0xb')]=this[_0x9959('0xc')]['id'];}else{_0x385f5b[_[_0x9959('0xd')](this[_0x9959('0xe')])+_0x9959('0xf')]=this[_0x9959('0xc')]['id'];}_0x385f5b[_[_0x9959('0xd')](this['channel'])+'InteractionId']=this['interaction']['id'];if(rpc[this[_0x9959('0xe')]+'Message']){return rpc[this['channel']+'Message'][_0x9959('0x10')](_0x385f5b)[_0x9959('0x11')](function(_0x29d5c4){logger['info'](_0x9959('0x12'),_0x12aa7d,_0x385f5b[_0x9959('0x13')]);_0x14c157['next']();})[_0x9959('0x14')](function(_0x48b8de){logger[_0x9959('0x15')]('[%s][MESSAGE]\x20%s',_0x12aa7d,JSON['stringify'](_0x48b8de));_0x14c157['stop']();});}}catch(_0x30763e){logger[_0x9959('0x15')](_0x9959('0x12'),_0x12aa7d,JSON['stringify'](_0x30763e));_0x14c157[_0x9959('0x16')]();}};}; \ No newline at end of file +var _0x2d27=['routing','../../rpc/openchannelMessage','../../rpc/mailMessage','consequence','contact','chat','ChatWebsiteId','account','upperFirst','AccountId','channel','InteractionId','interaction','Message','then','[%s][MESSAGE]\x20%s','next','catch','error','stringify','stop','./utils'];(function(_0x31a961,_0xe193c3){var _0xd09142=function(_0x326531){while(--_0x326531){_0x31a961['push'](_0x31a961['shift']());}};_0xd09142(++_0xe193c3);}(_0x2d27,0x1cd));var _0x72d2=function(_0x159152,_0x174251){_0x159152=_0x159152-0x0;var _0x50a4aa=_0x2d27[_0x159152];return _0x50a4aa;};'use strict';var _=require('lodash');var utils=require(_0x72d2('0x0'));var logger=require('../../../../config/logger')(_0x72d2('0x1'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x72d2('0x2')),'mailMessage':require(_0x72d2('0x3')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage')};exports[_0x72d2('0x4')]=function(_0x4f5199,_0x56eccb){return function(_0x39959d){try{var _0x56189a={'body':utils['getMustacheRender'](_0x56eccb[0x0],this),'ContactId':this[_0x72d2('0x5')]['id']};if(this['channel']===_0x72d2('0x6')){_0x56189a[_0x72d2('0x7')]=this[_0x72d2('0x8')]['id'];}else{_0x56189a[_[_0x72d2('0x9')](this['channel'])+_0x72d2('0xa')]=this['account']['id'];}_0x56189a[_[_0x72d2('0x9')](this[_0x72d2('0xb')])+_0x72d2('0xc')]=this[_0x72d2('0xd')]['id'];if(rpc[this[_0x72d2('0xb')]+'Message']){return rpc[this[_0x72d2('0xb')]+_0x72d2('0xe')]['create'](_0x56189a)[_0x72d2('0xf')](function(_0x1c3c73){logger['info'](_0x72d2('0x10'),_0x4f5199,_0x56189a['body']);_0x39959d[_0x72d2('0x11')]();})[_0x72d2('0x12')](function(_0x1b8c3d){logger[_0x72d2('0x13')](_0x72d2('0x10'),_0x4f5199,JSON[_0x72d2('0x14')](_0x1b8c3d));_0x39959d['stop']();});}}catch(_0x2d83c7){logger['error']('[%s][MESSAGE]\x20%s',_0x4f5199,JSON[_0x72d2('0x14')](_0x2d83c7));_0x39959d[_0x72d2('0x15')]();}};}; \ 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 0082a98..7fc397e 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 _0xc4fc=['stop','../../../../config/logger','routing','consequence','[%s][NOOP]\x20%s','next','error','stringify'];(function(_0x8a969d,_0x339d9f){var _0x1d8dc7=function(_0x283ec0){while(--_0x283ec0){_0x8a969d['push'](_0x8a969d['shift']());}};_0x1d8dc7(++_0x339d9f);}(_0xc4fc,0x1e1));var _0xcc4f=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xc4fc[_0x46aff0];return _0x9d78cf;};'use strict';var utils=require('./utils');var logger=require(_0xcc4f('0x0'))(_0xcc4f('0x1'));exports[_0xcc4f('0x2')]=function(_0x1221c8,_0xdd0308){return function(_0x4ee187){try{logger['info'](_0xcc4f('0x3'),_0x1221c8,utils['getMustacheRender'](_0xdd0308[0x0],this));_0x4ee187[_0xcc4f('0x4')]();}catch(_0x5a7d6e){logger[_0xcc4f('0x5')](_0xcc4f('0x3'),_0x1221c8,JSON[_0xcc4f('0x6')](_0x5a7d6e));_0x4ee187[_0xcc4f('0x7')]();}};}; \ No newline at end of file +var _0x5eb1=['error','stringify','stop','./utils','../../../../config/logger','consequence','[%s][NOOP]\x20%s','getMustacheRender','next'];(function(_0x27a611,_0xe00621){var _0x39c5de=function(_0x1bdcfc){while(--_0x1bdcfc){_0x27a611['push'](_0x27a611['shift']());}};_0x39c5de(++_0xe00621);}(_0x5eb1,0x1aa));var _0x15eb=function(_0xc2c353,_0x41a5a3){_0xc2c353=_0xc2c353-0x0;var _0x806605=_0x5eb1[_0xc2c353];return _0x806605;};'use strict';var utils=require(_0x15eb('0x0'));var logger=require(_0x15eb('0x1'))('routing');exports[_0x15eb('0x2')]=function(_0x590a28,_0x470ccf){return function(_0x5c848c){try{logger['info'](_0x15eb('0x3'),_0x590a28,utils[_0x15eb('0x4')](_0x470ccf[0x0],this));_0x5c848c[_0x15eb('0x5')]();}catch(_0x2494be){logger[_0x15eb('0x6')]('[%s][NOOP]\x20%s',_0x590a28,JSON[_0x15eb('0x7')](_0x2494be));_0x5c848c[_0x15eb('0x8')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/queue.js b/server/services/routing/server/applications/queue.js index 02846be..8d6a1b7 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 _0xe605=['socket.io-emitter','queue_id','joinAt','emit','clone','queue','account','format','pick','%sQueuesWaitingInteractions','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','waiting','body','from','contact','list','upperFirst','channel','QueueId','interaction','MessageId','message','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','YYYY-MM-DD\x20HH:mm:ss','accepted','update','update\x20queue\x20report','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','join','stop','find','Queues','timeout','qtimeout','rules','end','close','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','lodash','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults','localhost'];(function(_0x468a8b,_0xd56c40){var _0x19f562=function(_0x444938){while(--_0x444938){_0x468a8b['push'](_0x468a8b['shift']());}};_0x19f562(++_0xd56c40);}(_0xe605,0x92));var _0x5e60=function(_0x455071,_0x3152af){_0x455071=_0x455071-0x0;var _0xac699c=_0xe605[_0x455071];return _0xac699c;};'use strict';var schema=require(_0x5e60('0x0'));var _=require(_0x5e60('0x1'));var util=require('util');var seqqueue=require(_0x5e60('0x2'));var moment=require(_0x5e60('0x3'));var Redis=require(_0x5e60('0x4'));var config=require(_0x5e60('0x5'));var logger=require(_0x5e60('0x6'))(_0x5e60('0x7'));var strategy=require(_0x5e60('0x8'));config[_0x5e60('0x9')]=_[_0x5e60('0xa')](config[_0x5e60('0x9')],{'host':_0x5e60('0xb'),'port':0x18eb});var io=require(_0x5e60('0xc'))(new Redis(config['redis']));var attributes=['id',_0x5e60('0xd'),'account','queue','from',_0x5e60('0xe')];function emit(_0xe93f9c,_0x150a51,_0x2c5425){io['to'](_0xe93f9c)[_0x5e60('0xf')](_0x150a51,_0x2c5425);}function emitChannelQueueInteraction(_0x2cbe4e,_0x56f05a,_0x6ab0ce,_0x527f7b,_0x1d2558,_0x15035f,_0xcf1188,_0x51e7f6){var _0x371df7=_[_0x5e60('0x10')](_0x6ab0ce);_0x371df7[_0x5e60('0xd')]=_0x51e7f6;_0x371df7[_0x5e60('0x11')]=_0x56f05a;_0x371df7[_0x5e60('0x12')]=_0x527f7b;_0x371df7['id']=_0x1d2558;if(_0x15035f){_0xcf1188[util[_0x5e60('0x13')]('%sQueuesWaitingInteractions',_0x2cbe4e)][_0x1d2558]=_[_0x5e60('0x14')](_0x371df7,attributes);}else{delete _0xcf1188[util[_0x5e60('0x13')](_0x5e60('0x15'),_0x2cbe4e)][_0x1d2558];}emit(util[_0x5e60('0x13')]('%s:queue:%s',_0x2cbe4e,_0x56f05a),util[_0x5e60('0x13')]('%s_queue_waiting_interaction:%s',_0x2cbe4e,_0x15035f?_0x5e60('0x16'):_0x5e60('0x17')),_['pick'](_0x371df7,attributes));}var rpc={'openchannelQueueReport':require(_0x5e60('0x18')),'mailQueueReport':require(_0x5e60('0x19')),'chatQueueReport':require(_0x5e60('0x1a')),'smsQueueReport':require(_0x5e60('0x1b')),'faxQueueReport':require('../../rpc/faxQueueReport')};var queue=schema({'name':{'type':_0x5e60('0x1c'),'required':!![],'message':_0x5e60('0x1d')},'timeout':{'type':'number','message':_0x5e60('0x1e')}});function startRouting(_0x3a9e6b,_0x17c630,_0x311fef,_0x20db03){if(_0x3a9e6b&&_0x17c630&&_0x311fef){_0x17c630[_0x5e60('0x1f')]+=0x1;var _0x41294f={'uniqueid':_0x3a9e6b,'from':_0x311fef[_0x5e60('0x20')]?_0x311fef[_0x5e60('0x20')][_0x5e60('0x21')]:'','joinAt':moment()[_0x5e60('0x13')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x311fef[_0x5e60('0x22')]?_0x311fef['contact']['id']:null,'ListId':_0x311fef[_0x5e60('0x23')]?_0x311fef[_0x5e60('0x23')]['id']:null};_0x41294f[_[_0x5e60('0x24')](_0x311fef[_0x5e60('0x25')])+_0x5e60('0x26')]=_0x17c630['id']||null;_0x41294f[_[_0x5e60('0x24')](_0x311fef[_0x5e60('0x25')])+'InteractionId']=_0x311fef[_0x5e60('0x27')]?_0x311fef[_0x5e60('0x27')]['id']:null;_0x41294f[_[_0x5e60('0x24')](_0x311fef['channel'])+_0x5e60('0x28')]=_0x311fef[_0x5e60('0x29')]?_0x311fef[_0x5e60('0x29')]['id']:null;_0x41294f[_[_0x5e60('0x24')](_0x311fef['channel'])+(_0x311fef[_0x5e60('0x25')]!=='chat'?_0x5e60('0x2a'):_0x5e60('0x2b'))]=_0x311fef['account']?_0x311fef[_0x5e60('0x12')]['id']:null;logger[_0x5e60('0x2c')](util['format'](_0x5e60('0x2d'),_0x3a9e6b,_0x17c630[_0x5e60('0x2e')]));emitChannelQueueInteraction(_0x311fef['channel'],_0x17c630['name'],_0x41294f,_0x311fef['account'][_0x5e60('0x2e')],_0x311fef[_0x5e60('0x29')]['id'],!![],_0x20db03,_0x17c630['id']);if(rpc[_0x311fef[_0x5e60('0x25')]+_0x5e60('0x2f')]){return rpc[_0x311fef[_0x5e60('0x25')]+'QueueReport'][_0x5e60('0x30')](_0x41294f)[_0x5e60('0x31')](function(_0x4d4b55){logger[_0x5e60('0x32')]('create\x20queue\x20report');});}}}function stopRouting(_0x50f024,_0x1035b0,_0x3c4340,_0x1f474b){if(_0x50f024&&_0x1035b0){_0x1035b0[_0x5e60('0x1f')]-=0x1;var _0xaf3a35={'leaveAt':moment()[_0x5e60('0x13')](_0x5e60('0x33')),'acceptAt':moment()[_0x5e60('0x13')](_0x5e60('0x33')),'reason':_0x5e60('0x34')};logger['info'](util[_0x5e60('0x13')]('[%s][STOP:QUEUE][NAME:%s]',_0x50f024,_0x1035b0['name']));emitChannelQueueInteraction(_0x3c4340[_0x5e60('0x25')],_0x1035b0[_0x5e60('0x2e')],_0x3c4340['body'],_0x3c4340[_0x5e60('0x12')]['name'],_0x3c4340[_0x5e60('0x29')]['id'],![],_0x1f474b,_0x1035b0['id']);if(rpc[_0x3c4340[_0x5e60('0x25')]+_0x5e60('0x2f')]){return rpc[_0x3c4340[_0x5e60('0x25')]+_0x5e60('0x2f')][_0x5e60('0x35')](_0x50f024,_0xaf3a35)[_0x5e60('0x31')](function(_0x3c5200){logger['error'](_0x5e60('0x36'));});}}}function endRouting(_0x3f744d,_0x22d4ad,_0x1a3782,_0x200744){if(_0x3f744d&&_0x22d4ad){_0x22d4ad[_0x5e60('0x1f')]-=0x1;var _0x261245={'leaveAt':moment()['format'](_0x5e60('0x33')),'exitAt':moment()[_0x5e60('0x13')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':'timeout'};logger[_0x5e60('0x2c')](util[_0x5e60('0x13')](_0x5e60('0x37'),_0x3f744d,_0x22d4ad[_0x5e60('0x2e')]));emitChannelQueueInteraction(_0x1a3782[_0x5e60('0x25')],_0x22d4ad['name'],_0x1a3782[_0x5e60('0x20')],_0x1a3782[_0x5e60('0x12')][_0x5e60('0x2e')],_0x1a3782[_0x5e60('0x29')]['id'],![],_0x200744);if(rpc[_0x1a3782[_0x5e60('0x25')]+_0x5e60('0x2f')]){return rpc[_0x1a3782[_0x5e60('0x25')]+'QueueReport'][_0x5e60('0x35')](_0x3f744d,_0x261245)[_0x5e60('0x31')](function(_0x486185){logger['error']('update\x20queue\x20report');});}}}function handleFindQueue(_0x15a97b){return function(_0x1b80ad){return _0x1b80ad[_0x5e60('0x2e')][_0x5e60('0x38')]()===_0x15a97b['toLowerCase']();};}exports[_0x5e60('0x39')]=function(_0x24e893,_0x4b6192,_0x5bda22,_0x1bf6e4){return function(_0x42b9b0){try{var _0x40cb06={'name':_0x4b6192[0x0],'timeout':_0x4b6192[0x1]};var _0x38ff1d=queue[_0x5e60('0x0')](_0x40cb06,{'typecast':!![]});if(_0x38ff1d[_0x5e60('0x3a')]){logger[_0x5e60('0x32')](_0x5e60('0x3b'),_0x24e893,_[_0x5e60('0x3c')](_0x38ff1d,'message')[_0x5e60('0x3d')](',\x20'));_0x42b9b0[_0x5e60('0x3e')]();}else{var _0x59a2eb=_[_0x5e60('0x3f')](_0x5bda22[_0x1bf6e4[_0x5e60('0x25')]+_0x5e60('0x40')],handleFindQueue(_0x40cb06[_0x5e60('0x2e')]));if(_0x59a2eb){startRouting(_0x24e893,_0x59a2eb,_0x1bf6e4,_0x5bda22);var _0x76f97f=(_0x59a2eb['timeout']||0xa)*0x3e8;var _0x3f1a53=(_0x40cb06[_0x5e60('0x41')]||0x14)*0x3e8;var _0x172aff,_0x46ced1;if(_0x76f97f>_0x3f1a53){_0x3f1a53=_0x76f97f;}var _0x4b6e30=seqqueue['createQueue'](_0x76f97f);_0x4b6e30['id']=_0x24e893;_0x4b6e30['atimeout']=_0x76f97f;_0x4b6e30[_0x5e60('0x42')]=_0x3f1a53;_0x4b6e30[_0x5e60('0x25')]=_0x1bf6e4[_0x5e60('0x25')];_0x5bda22[_0x5e60('0x43')][_0x24e893]['on'](_0x5e60('0x44'),function(){logger[_0x5e60('0x2c')]('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x24e893);stopRouting(_0x24e893,_0x59a2eb,_0x1bf6e4,_0x5bda22);clearTimeout(_0x172aff);_0x172aff=undefined;_0x4b6e30[_0x5e60('0x45')](!![]);if(_0x5bda22[_0x5e60('0x43')][_0x24e893]){delete _0x5bda22[_0x5e60('0x43')][_0x24e893];}_0x42b9b0[_0x5e60('0x3e')]();});_0x5bda22[_0x5e60('0x43')][_0x24e893]['on'](_0x5e60('0x46'),function(){if(_0x5bda22[_0x5e60('0x43')][_0x24e893]){delete _0x5bda22['rules'][_0x24e893];}});_0x172aff=setTimeout(function(){logger[_0x5e60('0x2c')](_0x5e60('0x47'),_0x24e893);endRouting(_0x24e893,_0x59a2eb,_0x1bf6e4,_0x5bda22);clearTimeout(_0x172aff);_0x4b6e30[_0x5e60('0x45')](!![]);_0x42b9b0[_0x5e60('0x48')]();},_0x3f1a53);switch(_0x59a2eb[_0x5e60('0x49')]){case _0x5e60('0x4a'):strategy[_0x5e60('0x4a')](_0x4b6e30,_0x59a2eb,_0x5bda22,_0x1bf6e4);break;default:strategy[_0x5e60('0x4b')](_0x4b6e30,_0x59a2eb,_0x5bda22,_0x1bf6e4);}}else{logger[_0x5e60('0x32')](_0x5e60('0x4c'),_0x24e893,_0x40cb06[_0x5e60('0x2e')]);_0x42b9b0[_0x5e60('0x3e')]();}}}catch(_0x3e84be){console[_0x5e60('0x4d')](_0x3e84be);logger[_0x5e60('0x32')](_0x5e60('0x3b'),_0x24e893,_0x3e84be[_0x5e60('0x4e')]);_0x42b9b0[_0x5e60('0x3e')]();}};}; \ No newline at end of file +var _0xf109=['redis','defaults','localhost','socket.io-emitter','queue_id','queue','from','joinAt','emit','clone','account','format','pick','%s:queue:%s','save','../../rpc/openchannelQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','string','number','waiting','body','contact','list','upperFirst','QueueId','channel','interaction','MessageId','message','AccountId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','create\x20queue\x20report','YYYY-MM-DD\x20HH:mm:ss','accepted','update','[%s][END:QUEUE][NAME:%s]','update\x20queue\x20report','toLowerCase','length','[%s][QUEUE]\x20%s','map','find','Queues','timeout','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','stop','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','beepall','log','validate','lodash','util','../../../../config/environment','../../../../config/logger','routing','./strategy'];(function(_0xb4710a,_0x585188){var _0x602935=function(_0x1e86bd){while(--_0x1e86bd){_0xb4710a['push'](_0xb4710a['shift']());}};_0x602935(++_0x585188);}(_0xf109,0xce));var _0x9f10=function(_0x4c445a,_0x4ee80f){_0x4c445a=_0x4c445a-0x0;var _0x2f611c=_0xf109[_0x4c445a];return _0x2f611c;};'use strict';var schema=require(_0x9f10('0x0'));var _=require(_0x9f10('0x1'));var util=require(_0x9f10('0x2'));var seqqueue=require('seq-queue');var moment=require('moment');var Redis=require('ioredis');var config=require(_0x9f10('0x3'));var logger=require(_0x9f10('0x4'))(_0x9f10('0x5'));var strategy=require(_0x9f10('0x6'));config[_0x9f10('0x7')]=_[_0x9f10('0x8')](config[_0x9f10('0x7')],{'host':_0x9f10('0x9'),'port':0x18eb});var io=require(_0x9f10('0xa'))(new Redis(config[_0x9f10('0x7')]));var attributes=['id',_0x9f10('0xb'),'account',_0x9f10('0xc'),_0x9f10('0xd'),_0x9f10('0xe')];function emit(_0x1bde2e,_0x325f22,_0x5d5f53){io['to'](_0x1bde2e)[_0x9f10('0xf')](_0x325f22,_0x5d5f53);}function emitChannelQueueInteraction(_0x18995b,_0x4522d9,_0x4e577d,_0x50215f,_0x3fac2b,_0x311935,_0x407336,_0x56780e){var _0x289164=_[_0x9f10('0x10')](_0x4e577d);_0x289164[_0x9f10('0xb')]=_0x56780e;_0x289164['queue']=_0x4522d9;_0x289164[_0x9f10('0x11')]=_0x50215f;_0x289164['id']=_0x3fac2b;if(_0x311935){_0x407336[util[_0x9f10('0x12')]('%sQueuesWaitingInteractions',_0x18995b)][_0x3fac2b]=_[_0x9f10('0x13')](_0x289164,attributes);}else{delete _0x407336[util[_0x9f10('0x12')]('%sQueuesWaitingInteractions',_0x18995b)][_0x3fac2b];}emit(util['format'](_0x9f10('0x14'),_0x18995b,_0x4522d9),util[_0x9f10('0x12')]('%s_queue_waiting_interaction:%s',_0x18995b,_0x311935?_0x9f10('0x15'):'remove'),_[_0x9f10('0x13')](_0x289164,attributes));}var rpc={'openchannelQueueReport':require(_0x9f10('0x16')),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require(_0x9f10('0x17')),'smsQueueReport':require(_0x9f10('0x18')),'faxQueueReport':require('../../rpc/faxQueueReport')};var queue=schema({'name':{'type':_0x9f10('0x19'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x9f10('0x1a'),'message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x2c5064,_0x56fb44,_0x54c262,_0x3d216b){if(_0x2c5064&&_0x56fb44&&_0x54c262){_0x56fb44[_0x9f10('0x1b')]+=0x1;var _0x25f870={'uniqueid':_0x2c5064,'from':_0x54c262[_0x9f10('0x1c')]?_0x54c262[_0x9f10('0x1c')][_0x9f10('0xd')]:'','joinAt':moment()[_0x9f10('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x54c262[_0x9f10('0x1d')]?_0x54c262['contact']['id']:null,'ListId':_0x54c262[_0x9f10('0x1e')]?_0x54c262[_0x9f10('0x1e')]['id']:null};_0x25f870[_[_0x9f10('0x1f')](_0x54c262['channel'])+_0x9f10('0x20')]=_0x56fb44['id']||null;_0x25f870[_[_0x9f10('0x1f')](_0x54c262[_0x9f10('0x21')])+'InteractionId']=_0x54c262[_0x9f10('0x22')]?_0x54c262[_0x9f10('0x22')]['id']:null;_0x25f870[_[_0x9f10('0x1f')](_0x54c262['channel'])+_0x9f10('0x23')]=_0x54c262[_0x9f10('0x24')]?_0x54c262[_0x9f10('0x24')]['id']:null;_0x25f870[_[_0x9f10('0x1f')](_0x54c262['channel'])+(_0x54c262['channel']!=='chat'?_0x9f10('0x25'):'WebsiteId')]=_0x54c262[_0x9f10('0x11')]?_0x54c262[_0x9f10('0x11')]['id']:null;logger[_0x9f10('0x26')](util[_0x9f10('0x12')](_0x9f10('0x27'),_0x2c5064,_0x56fb44['name']));emitChannelQueueInteraction(_0x54c262[_0x9f10('0x21')],_0x56fb44[_0x9f10('0x28')],_0x25f870,_0x54c262[_0x9f10('0x11')][_0x9f10('0x28')],_0x54c262[_0x9f10('0x24')]['id'],!![],_0x3d216b,_0x56fb44['id']);if(rpc[_0x54c262[_0x9f10('0x21')]+'QueueReport']){return rpc[_0x54c262[_0x9f10('0x21')]+_0x9f10('0x29')][_0x9f10('0x2a')](_0x25f870)[_0x9f10('0x2b')](function(_0x49b3f4){logger[_0x9f10('0x2c')](_0x9f10('0x2d'));});}}}function stopRouting(_0x34d8f6,_0x5dd404,_0x434128,_0x5af399){if(_0x34d8f6&&_0x5dd404){_0x5dd404[_0x9f10('0x1b')]-=0x1;var _0x362cab={'leaveAt':moment()[_0x9f10('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()[_0x9f10('0x12')](_0x9f10('0x2e')),'reason':_0x9f10('0x2f')};logger[_0x9f10('0x26')](util[_0x9f10('0x12')]('[%s][STOP:QUEUE][NAME:%s]',_0x34d8f6,_0x5dd404[_0x9f10('0x28')]));emitChannelQueueInteraction(_0x434128['channel'],_0x5dd404[_0x9f10('0x28')],_0x434128[_0x9f10('0x1c')],_0x434128[_0x9f10('0x11')][_0x9f10('0x28')],_0x434128[_0x9f10('0x24')]['id'],![],_0x5af399,_0x5dd404['id']);if(rpc[_0x434128[_0x9f10('0x21')]+'QueueReport']){return rpc[_0x434128[_0x9f10('0x21')]+_0x9f10('0x29')][_0x9f10('0x30')](_0x34d8f6,_0x362cab)['catch'](function(_0x2310d0){logger[_0x9f10('0x2c')]('update\x20queue\x20report');});}}}function endRouting(_0x2b0b17,_0x5671fe,_0x428bf0,_0x1b7a66){if(_0x2b0b17&&_0x5671fe){_0x5671fe[_0x9f10('0x1b')]-=0x1;var _0xc17ea2={'leaveAt':moment()[_0x9f10('0x12')](_0x9f10('0x2e')),'exitAt':moment()[_0x9f10('0x12')](_0x9f10('0x2e')),'reason':'timeout'};logger[_0x9f10('0x26')](util[_0x9f10('0x12')](_0x9f10('0x31'),_0x2b0b17,_0x5671fe['name']));emitChannelQueueInteraction(_0x428bf0[_0x9f10('0x21')],_0x5671fe[_0x9f10('0x28')],_0x428bf0['body'],_0x428bf0[_0x9f10('0x11')][_0x9f10('0x28')],_0x428bf0[_0x9f10('0x24')]['id'],![],_0x1b7a66);if(rpc[_0x428bf0['channel']+'QueueReport']){return rpc[_0x428bf0[_0x9f10('0x21')]+_0x9f10('0x29')][_0x9f10('0x30')](_0x2b0b17,_0xc17ea2)[_0x9f10('0x2b')](function(_0x2e5e46){logger[_0x9f10('0x2c')](_0x9f10('0x32'));});}}}function handleFindQueue(_0x34869c){return function(_0x7fe320){return _0x7fe320[_0x9f10('0x28')][_0x9f10('0x33')]()===_0x34869c[_0x9f10('0x33')]();};}exports['consequence']=function(_0x5e3f06,_0x4bb805,_0x24700a,_0x5c8c44){return function(_0x420027){try{var _0xf61167={'name':_0x4bb805[0x0],'timeout':_0x4bb805[0x1]};var _0x426d30=queue['validate'](_0xf61167,{'typecast':!![]});if(_0x426d30[_0x9f10('0x34')]){logger[_0x9f10('0x2c')](_0x9f10('0x35'),_0x5e3f06,_[_0x9f10('0x36')](_0x426d30,_0x9f10('0x24'))['join'](',\x20'));_0x420027['stop']();}else{var _0x542a22=_[_0x9f10('0x37')](_0x24700a[_0x5c8c44['channel']+_0x9f10('0x38')],handleFindQueue(_0xf61167['name']));if(_0x542a22){startRouting(_0x5e3f06,_0x542a22,_0x5c8c44,_0x24700a);var _0x15706b=(_0x542a22[_0x9f10('0x39')]||0xa)*0x3e8;var _0x413df4=(_0xf61167[_0x9f10('0x39')]||0x14)*0x3e8;var _0x553fff,_0x369600;if(_0x15706b>_0x413df4){_0x413df4=_0x15706b;}var _0x2d1d0d=seqqueue['createQueue'](_0x15706b);_0x2d1d0d['id']=_0x5e3f06;_0x2d1d0d[_0x9f10('0x3a')]=_0x15706b;_0x2d1d0d[_0x9f10('0x3b')]=_0x413df4;_0x2d1d0d[_0x9f10('0x21')]=_0x5c8c44[_0x9f10('0x21')];_0x24700a[_0x9f10('0x3c')][_0x5e3f06]['on'](_0x9f10('0x3d'),function(){logger[_0x9f10('0x26')](_0x9f10('0x3e'),_0x5e3f06);stopRouting(_0x5e3f06,_0x542a22,_0x5c8c44,_0x24700a);clearTimeout(_0x553fff);_0x553fff=undefined;_0x2d1d0d[_0x9f10('0x3f')](!![]);if(_0x24700a[_0x9f10('0x3c')][_0x5e3f06]){delete _0x24700a['rules'][_0x5e3f06];}_0x420027[_0x9f10('0x40')]();});_0x24700a[_0x9f10('0x3c')][_0x5e3f06]['on']('complete',function(){if(_0x24700a[_0x9f10('0x3c')][_0x5e3f06]){delete _0x24700a[_0x9f10('0x3c')][_0x5e3f06];}});_0x553fff=setTimeout(function(){logger[_0x9f10('0x26')](_0x9f10('0x41'),_0x5e3f06);endRouting(_0x5e3f06,_0x542a22,_0x5c8c44,_0x24700a);clearTimeout(_0x553fff);_0x2d1d0d['close'](!![]);_0x420027[_0x9f10('0x42')]();},_0x413df4);switch(_0x542a22[_0x9f10('0x43')]){case _0x9f10('0x44'):strategy[_0x9f10('0x44')](_0x2d1d0d,_0x542a22,_0x24700a,_0x5c8c44);break;default:strategy[_0x9f10('0x45')](_0x2d1d0d,_0x542a22,_0x24700a,_0x5c8c44);}}else{logger[_0x9f10('0x2c')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x5e3f06,_0xf61167[_0x9f10('0x28')]);_0x420027[_0x9f10('0x40')]();}}}catch(_0x1ba49d){console[_0x9f10('0x46')](_0x1ba49d);logger[_0x9f10('0x2c')](_0x9f10('0x35'),_0x5e3f06,_0x1ba49d['stack']);_0x420027[_0x9f10('0x40')]();}};}; \ 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 c4b7b2a..0ef73c7 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 _0x94ca=['exports','lodash','./util','../../../../../config/logger','routing','notificationId','squeue','realtime','handleRun','bind','timeout','handleTimeout','drained','push','prototype','handleDrained','info','isNil','agents','agent','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel','busy','showNotification','RINGING','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','busyQueue','writeLog','TIMEOUT'];(function(_0xd0cd0b,_0x490956){var _0x59cced=function(_0x567251){while(--_0x567251){_0xd0cd0b['push'](_0xd0cd0b['shift']());}};_0x59cced(++_0x490956);}(_0x94ca,0x85));var _0xa94c=function(_0xdc509,_0x1f62f3){_0xdc509=_0xdc509-0x0;var _0x27219e=_0x94ca[_0xdc509];return _0x27219e;};'use strict';var _=require(_0xa94c('0x0'));var uuid=require('uuid');var util=require(_0xa94c('0x1'));var logger=require(_0xa94c('0x2'))(_0xa94c('0x3'));var Agent=function(_0x5c0d68,_0x1847d4,_0x58b3bf,_0x1e6f08){this[_0xa94c('0x4')]=uuid['v4']();this[_0xa94c('0x5')]=_0x5c0d68;this['agent']=_0x1847d4;this[_0xa94c('0x6')]=_0x58b3bf;this[_0xa94c('0x3')]=_0x1e6f08;this[_0xa94c('0x5')]['push'](this[_0xa94c('0x7')][_0xa94c('0x8')](this),this['handleTimeout'][_0xa94c('0x8')](this));this[_0xa94c('0x5')]['on'](_0xa94c('0x9'),this[_0xa94c('0xa')]['bind'](this));this[_0xa94c('0x5')]['on'](_0xa94c('0xb'),this['handleDrained']['bind'](this));};Agent['prototype'][_0xa94c('0xc')]=function(){this['squeue']['push'](this[_0xa94c('0x7')][_0xa94c('0x8')](this),this[_0xa94c('0xa')][_0xa94c('0x8')](this));};Agent[_0xa94c('0xd')][_0xa94c('0xe')]=function(){this[_0xa94c('0xa')](!![]);};Agent[_0xa94c('0xd')][_0xa94c('0x7')]=function(_0x5980c4){logger[_0xa94c('0xf')]('[%s][AGENT]\x20try\x20with\x20%s',this['squeue']['id'],this['agent']['id']);if(_[_0xa94c('0x10')](this[_0xa94c('0x6')][_0xa94c('0x11')][this[_0xa94c('0x12')]['id']])){logger['info'](_0xa94c('0x13'),this['squeue']['id'],this['agent']['id']);setTimeout(this[_0xa94c('0xc')][_0xa94c('0x8')](this),0x3e8);}else{if(this['routing'][_0xa94c('0x14')]||util[_0xa94c('0x15')](this[_0xa94c('0x5')]['id'],this[_0xa94c('0x6')][_0xa94c('0x11')][this[_0xa94c('0x12')]['id']],this[_0xa94c('0x5')][_0xa94c('0x16')],![])){this[_0xa94c('0x6')][_0xa94c('0x11')][this[_0xa94c('0x12')]['id']][_0xa94c('0x17')]=!![];this[_0xa94c('0x6')][_0xa94c('0x11')][this[_0xa94c('0x12')]['id']]['busyQueue']=undefined;util[_0xa94c('0x18')](this[_0xa94c('0x4')],this[_0xa94c('0x5')]['id'],this[_0xa94c('0x6')]['agents'][this[_0xa94c('0x12')]['id']],null,this[_0xa94c('0x3')]);util['writeLog'](this[_0xa94c('0x5')]['id'],this['realtime'][_0xa94c('0x11')][this[_0xa94c('0x12')]['id']],_0xa94c('0x19')+(this[_0xa94c('0x3')][_0xa94c('0x14')]?':FORCED':''));}else{logger['info'](_0xa94c('0x1a'),this[_0xa94c('0x5')]['id'],this['agent']['id']);setTimeout(this[_0xa94c('0xc')][_0xa94c('0x8')](this),0x3e8);}}};Agent[_0xa94c('0xd')][_0xa94c('0xa')]=function(_0x47ba56){if(_[_0xa94c('0x10')](this['realtime']['agents'][this[_0xa94c('0x12')]['id']])){return logger['info'](_0xa94c('0x13'),this['squeue']['id'],this[_0xa94c('0x12')]['id']);}else{logger[_0xa94c('0xf')](_0xa94c('0x1b'),this[_0xa94c('0x5')]['id'],this['agent']['id']);util[_0xa94c('0x1c')](this[_0xa94c('0x4')],this[_0xa94c('0x5')]['id'],this[_0xa94c('0x6')][_0xa94c('0x11')][this[_0xa94c('0x12')]['id']],null,this[_0xa94c('0x3')]);this['realtime'][_0xa94c('0x11')][this['agent']['id']][_0xa94c('0x17')]=![];this[_0xa94c('0x6')][_0xa94c('0x11')][this[_0xa94c('0x12')]['id']][_0xa94c('0x1d')]=undefined;util[_0xa94c('0x1e')](this[_0xa94c('0x5')]['id'],this[_0xa94c('0x6')][_0xa94c('0x11')][this[_0xa94c('0x12')]['id']],_0x47ba56?'STOP':_0xa94c('0x1f'));}if(!_0x47ba56){setTimeout(this[_0xa94c('0xc')][_0xa94c('0x8')](this),0x3e8);}};function agent(_0x1fd198,_0xd32d57,_0x11429d,_0x44668f){return new Agent(_0x1fd198,_0xd32d57,_0x11429d,_0x44668f);}module[_0xa94c('0x20')]=agent; \ No newline at end of file +var _0xc841=['notificationId','squeue','agent','realtime','push','handleRun','timeout','handleTimeout','bind','drained','prototype','handleDrained','info','isNil','agents','forcedOwnership','isAgentAvailable','channel','busy','busyQueue','showNotification','writeLog','RINGING','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','hideNotification','STOP','TIMEOUT','exports','lodash','./util','../../../../../config/logger','routing'];(function(_0x43de21,_0x3e28ee){var _0x99cd52=function(_0x200c2e){while(--_0x200c2e){_0x43de21['push'](_0x43de21['shift']());}};_0x99cd52(++_0x3e28ee);}(_0xc841,0x104));var _0x1c84=function(_0x3205bb,_0x256845){_0x3205bb=_0x3205bb-0x0;var _0x5cc7a3=_0xc841[_0x3205bb];return _0x5cc7a3;};'use strict';var _=require(_0x1c84('0x0'));var uuid=require('uuid');var util=require(_0x1c84('0x1'));var logger=require(_0x1c84('0x2'))(_0x1c84('0x3'));var Agent=function(_0x47a0e6,_0x14fe53,_0x2ffbc1,_0x338682){this[_0x1c84('0x4')]=uuid['v4']();this[_0x1c84('0x5')]=_0x47a0e6;this[_0x1c84('0x6')]=_0x14fe53;this[_0x1c84('0x7')]=_0x2ffbc1;this['routing']=_0x338682;this[_0x1c84('0x5')][_0x1c84('0x8')](this[_0x1c84('0x9')]['bind'](this),this['handleTimeout']['bind'](this));this[_0x1c84('0x5')]['on'](_0x1c84('0xa'),this[_0x1c84('0xb')][_0x1c84('0xc')](this));this['squeue']['on'](_0x1c84('0xd'),this['handleDrained'][_0x1c84('0xc')](this));};Agent[_0x1c84('0xe')][_0x1c84('0x8')]=function(){this[_0x1c84('0x5')]['push'](this[_0x1c84('0x9')][_0x1c84('0xc')](this),this[_0x1c84('0xb')][_0x1c84('0xc')](this));};Agent[_0x1c84('0xe')][_0x1c84('0xf')]=function(){this[_0x1c84('0xb')](!![]);};Agent[_0x1c84('0xe')]['handleRun']=function(_0x4e2c75){logger[_0x1c84('0x10')]('[%s][AGENT]\x20try\x20with\x20%s',this[_0x1c84('0x5')]['id'],this[_0x1c84('0x6')]['id']);if(_[_0x1c84('0x11')](this[_0x1c84('0x7')][_0x1c84('0x12')][this[_0x1c84('0x6')]['id']])){logger[_0x1c84('0x10')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x1c84('0x5')]['id'],this[_0x1c84('0x6')]['id']);setTimeout(this[_0x1c84('0x8')][_0x1c84('0xc')](this),0x3e8);}else{if(this['routing'][_0x1c84('0x13')]||util[_0x1c84('0x14')](this[_0x1c84('0x5')]['id'],this[_0x1c84('0x7')][_0x1c84('0x12')][this[_0x1c84('0x6')]['id']],this['squeue'][_0x1c84('0x15')],![])){this[_0x1c84('0x7')][_0x1c84('0x12')][this[_0x1c84('0x6')]['id']][_0x1c84('0x16')]=!![];this['realtime'][_0x1c84('0x12')][this[_0x1c84('0x6')]['id']][_0x1c84('0x17')]=undefined;util[_0x1c84('0x18')](this[_0x1c84('0x4')],this[_0x1c84('0x5')]['id'],this[_0x1c84('0x7')][_0x1c84('0x12')][this[_0x1c84('0x6')]['id']],null,this[_0x1c84('0x3')]);util[_0x1c84('0x19')](this[_0x1c84('0x5')]['id'],this[_0x1c84('0x7')][_0x1c84('0x12')][this['agent']['id']],_0x1c84('0x1a')+(this[_0x1c84('0x3')][_0x1c84('0x13')]?':FORCED':''));}else{logger[_0x1c84('0x10')](_0x1c84('0x1b'),this[_0x1c84('0x5')]['id'],this[_0x1c84('0x6')]['id']);setTimeout(this[_0x1c84('0x8')][_0x1c84('0xc')](this),0x3e8);}}};Agent[_0x1c84('0xe')]['handleTimeout']=function(_0x3537ec){if(_[_0x1c84('0x11')](this[_0x1c84('0x7')][_0x1c84('0x12')][this[_0x1c84('0x6')]['id']])){return logger[_0x1c84('0x10')](_0x1c84('0x1c'),this[_0x1c84('0x5')]['id'],this['agent']['id']);}else{logger[_0x1c84('0x10')]('[%s][AGENT]\x20timeout\x20with\x20%s',this[_0x1c84('0x5')]['id'],this[_0x1c84('0x6')]['id']);util[_0x1c84('0x1d')](this[_0x1c84('0x4')],this[_0x1c84('0x5')]['id'],this[_0x1c84('0x7')][_0x1c84('0x12')][this[_0x1c84('0x6')]['id']],null,this[_0x1c84('0x3')]);this['realtime']['agents'][this[_0x1c84('0x6')]['id']][_0x1c84('0x16')]=![];this['realtime'][_0x1c84('0x12')][this['agent']['id']][_0x1c84('0x17')]=undefined;util[_0x1c84('0x19')](this['squeue']['id'],this[_0x1c84('0x7')]['agents'][this[_0x1c84('0x6')]['id']],_0x3537ec?_0x1c84('0x1e'):_0x1c84('0x1f'));}if(!_0x3537ec){setTimeout(this[_0x1c84('0x8')]['bind'](this),0x3e8);}};function agent(_0x1e1424,_0x21faec,_0x5cac5c,_0x124dc8){return new Agent(_0x1e1424,_0x21faec,_0x5cac5c,_0x124dc8);}module[_0x1c84('0x20')]=agent; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/beepall.js b/server/services/routing/server/applications/strategy/beepall.js index 30dfe06..2502fba 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 _0x5135=['drained','push','prototype','handleDrained','isNil','queue','Agents','length','agents','info','isAgentAvailable','channel','writeLog','RINGING','busy','name','showNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','STOP','TIMEOUT','busyQueue','exports','uuid','./util','../../../../../config/logger','routing','notificationId','realtime','squeue','handleRun','bind','handleTimeout','timeout'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0x5135,0x1bc));var _0x5513=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0x5135[_0x37c22c];return _0x119d79;};'use strict';var _=require('lodash');var uuid=require(_0x5513('0x0'));var util=require(_0x5513('0x1'));var logger=require(_0x5513('0x2'))(_0x5513('0x3'));var Beepall=function(_0x44a42f,_0x405ec8,_0x20cb0b,_0x44560a){this[_0x5513('0x4')]=uuid['v4']();this['squeue']=_0x44a42f;this['queue']=_0x405ec8;this[_0x5513('0x5')]=_0x20cb0b;this[_0x5513('0x3')]=_0x44560a;this[_0x5513('0x6')]['push'](this[_0x5513('0x7')][_0x5513('0x8')](this),this[_0x5513('0x9')][_0x5513('0x8')](this));this[_0x5513('0x6')]['on'](_0x5513('0xa'),this['handleTimeout'][_0x5513('0x8')](this));this['squeue']['on'](_0x5513('0xb'),this['handleDrained'][_0x5513('0x8')](this));};Beepall['prototype'][_0x5513('0xc')]=function(){this[_0x5513('0x6')][_0x5513('0xc')](this[_0x5513('0x7')][_0x5513('0x8')](this),this['handleTimeout'][_0x5513('0x8')](this));};Beepall[_0x5513('0xd')][_0x5513('0xe')]=function(_0x4e7e97){this[_0x5513('0x9')](!![]);};Beepall[_0x5513('0xd')][_0x5513('0x7')]=function(_0x4613df){var _0x54f255=!![];if(!_[_0x5513('0xf')](this[_0x5513('0x10')])&&!_[_0x5513('0xf')](this['queue'][_0x5513('0x11')])&&this['queue'][_0x5513('0x11')][_0x5513('0x12')]>0x0){for(var _0x46f5d5=0x0,_0x32f351;_0x46f5d50x0){for(var _0x46bf93=0x0,_0xf32c4e;_0x46bf930x0&&_0x3b93ce[_0x343405+_0xd777('0x21')]>=_0x3b93ce[_0x343405+'Capacity']){writeLog(_0x35d0f4,_0x3b93ce,_0x343405[_0xd777('0x22')]()+'\x20MAXCAPACITY');return![];}}return!![];};exports['showNotification']=function(_0x2ff04b,_0x21e38c,_0x2dae46,_0x3db307,_0x4c941c){return sendNotification(!![],_0x2ff04b,_0x21e38c,_0x2dae46,_0x3db307,_0x4c941c);};exports[_0xd777('0x23')]=function(_0x141baa,_0x4f93eb,_0x1975e2,_0xb63cf7,_0x1ac201){return sendNotification(![],_0x141baa,_0x4f93eb,_0x1975e2,_0xb63cf7,_0x1ac201);};exports[_0xd777('0x24')]=writeLog; \ No newline at end of file +var _0xf482=['format','user:%s','\x20interaction','name','account','notificationSound','notificationShake','body','queue','getMustacheRender','notificationTemplate','msg','I\x20can\x27t\x20render\x20your\x20template','error','save','info','busy','BUSY','online','OFFLINE','Pause','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','showNotification','hideNotification','writeLog','lodash','util','../utils','mustache','ioredis','../../../../../config/environment','../../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit'];(function(_0xf6005d,_0x2f157f){var _0x180e52=function(_0x47702c){while(--_0x47702c){_0xf6005d['push'](_0xf6005d['shift']());}};_0x180e52(++_0x2f157f);}(_0xf482,0xf0));var _0x2f48=function(_0x45444b,_0xe72def){_0x45444b=_0x45444b-0x0;var _0x4660b3=_0xf482[_0x45444b];return _0x4660b3;};'use strict';var _=require(_0x2f48('0x0'));var util=require(_0x2f48('0x1'));var utils=require(_0x2f48('0x2'));var Mustache=require(_0x2f48('0x3'));var Redis=require(_0x2f48('0x4'));var config=require(_0x2f48('0x5'));var logger=require(_0x2f48('0x6'))('routing');config[_0x2f48('0x7')]=_[_0x2f48('0x8')](config[_0x2f48('0x7')],{'host':_0x2f48('0x9'),'port':0x18eb});var io=require(_0x2f48('0xa'))(new Redis(config['redis']));function emit(_0x2ef12d,_0x3a919c,_0x24e80d){io['to'](_0x2ef12d)[_0x2f48('0xb')](_0x3a919c,_0x24e80d);}function sendNotification(_0x3224d1,_0x5f0945,_0x4a8cfd,_0x3a695f,_0x496fea,_0x1d6080){io['to'](util[_0x2f48('0xc')](_0x2f48('0xd'),_0x3a695f['name']))[_0x2f48('0xb')]('user:save',_0x3a695f);var _0x2bcf94=_0x1d6080||{};var _0x30fe3e=_0x4a8cfd['split']('.');var _0x3d2e0e={'uniqueid':_0x5f0945,'channel':_0x30fe3e[0x0],'id':_0x30fe3e[0x1],'title':_0x30fe3e[0x0]+_0x2f48('0xe'),'interactionId':_0x30fe3e[0x2],'queue':_0x496fea?_0x496fea[_0x2f48('0xf')]:null,'sound':_0x2bcf94[_0x2f48('0x10')][_0x2f48('0x11')],'shake':_0x2bcf94[_0x2f48('0x10')][_0x2f48('0x12')]};try{if(!_0x2bcf94[_0x2f48('0x13')]){_0x2bcf94[_0x2f48('0x13')]={};}if(_0x496fea){_0x2bcf94[_0x2f48('0x13')][_0x2f48('0x14')]=_0x496fea;}else if(_0x2bcf94[_0x2f48('0x13')][_0x2f48('0x14')]){delete _0x2bcf94['body']['queue'];}_0x3d2e0e['msg']=utils[_0x2f48('0x15')](_0x2bcf94[_0x2f48('0x10')][_0x2f48('0x16')],_0x2bcf94);}catch(_0x5eb6d9){_0x3d2e0e[_0x2f48('0x17')]=_0x2f48('0x18');logger[_0x2f48('0x19')](util['format']('[%s][QUEUE]\x20%s',_0x5f0945,_0x5eb6d9['message']));}io['to'](util[_0x2f48('0xc')](_0x2f48('0xd'),_0x3a695f['name']))['emit'](util[_0x2f48('0xc')]('notification:%s',_0x3224d1?_0x2f48('0x1a'):'remove'),_0x3d2e0e);}function writeLog(_0x2da161,_0x34a04f,_0x5e8eb5){return logger[_0x2f48('0x1b')](util[_0x2f48('0xc')]('[%s][QUEUE][AGENT:%s][STATUS:%s]',_0x2da161,_0x34a04f[_0x2f48('0xf')],_0x5e8eb5));}exports['isAgentAvailable']=function(_0x50faa8,_0x2c1ec0,_0x3c5f6a,_0x1b4ded){if(_0x2c1ec0[_0x2f48('0x1c')]){writeLog(_0x50faa8,_0x2c1ec0,_0x2f48('0x1d'));return![];}if(!_0x2c1ec0[_0x2f48('0x1e')]){writeLog(_0x50faa8,_0x2c1ec0,_0x2f48('0x1f'));return![];}if(_0x2c1ec0[_0x3c5f6a+_0x2f48('0x20')]){writeLog(_0x50faa8,_0x2c1ec0,_0x2f48('0x21'));return![];}if(_0x1b4ded&&_0x2c1ec0[_0x2f48('0x22')](_0x3c5f6a+_0x2f48('0x23'))&&_0x2c1ec0[_0x2f48('0x22')](_0x3c5f6a+_0x2f48('0x24'))){if(_0x2c1ec0[_0x3c5f6a+'Capacity']>0x0&&_0x2c1ec0[_0x3c5f6a+'CurrentCapacity']>=_0x2c1ec0[_0x3c5f6a+'Capacity']){writeLog(_0x50faa8,_0x2c1ec0,_0x3c5f6a[_0x2f48('0x25')]()+_0x2f48('0x26'));return![];}}return!![];};exports[_0x2f48('0x27')]=function(_0xfa371a,_0x25e11e,_0x20e033,_0x49c44a,_0x4504d0){return sendNotification(!![],_0xfa371a,_0x25e11e,_0x20e033,_0x49c44a,_0x4504d0);};exports[_0x2f48('0x28')]=function(_0x160f76,_0x4a372d,_0x4e3cca,_0x418071,_0x955677){return sendNotification(![],_0x160f76,_0x4a372d,_0x4e3cca,_0x418071,_0x955677);};exports[_0x2f48('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 aa515d5..cea9b50 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 _0x9a2b=['isObject','validate','lodash','./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][SYSTEM]\x20%s','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s'];(function(_0x54d4fe,_0x55e869){var _0x1ab5bb=function(_0x5b1af2){while(--_0x5b1af2){_0x54d4fe['push'](_0x54d4fe['shift']());}};_0x1ab5bb(++_0x55e869);}(_0x9a2b,0x83));var _0xb9a2=function(_0x4e1991,_0xeb727c){_0x4e1991=_0x4e1991-0x0;var _0x318050=_0x9a2b[_0x4e1991];return _0x318050;};'use strict';var schema=require(_0xb9a2('0x0'));var sh=require('shelljs');var _=require(_0xb9a2('0x1'));var utils=require(_0xb9a2('0x2'));var logger=require(_0xb9a2('0x3'))(_0xb9a2('0x4'));var system=schema({'command':{'type':_0xb9a2('0x5'),'required':!![],'message':_0xb9a2('0x6')}});exports[_0xb9a2('0x7')]=function(_0x178744,_0x4279b3){return function(_0x173a01){try{var _0xe3867={'command':_0x4279b3[0x0]};var _0x4f05de=system[_0xb9a2('0x0')](_0xe3867,{'typecast':!![]});if(_0x4f05de[_0xb9a2('0x8')]){logger[_0xb9a2('0x9')](_0xb9a2('0xa'),_0x178744,_['map'](_0x4f05de,_0xb9a2('0xb'))[_0xb9a2('0xc')](',\x20'));logger[_0xb9a2('0xd')](_0xb9a2('0xe'),_0x178744);_0x173a01[_0xb9a2('0xf')]();}else{var _0x135675=this;var _0x420153=utils['getMustacheRender'](_0x4279b3[0x0],this);logger[_0xb9a2('0xd')](_0xb9a2('0x10'),_0x178744,_0x420153);sh[_0xb9a2('0x11')](_[_0xb9a2('0x12')](_0x420153),function(_0xa68fa8,_0x38ee8b){logger['info'](_0xb9a2('0x13'),_0x178744,_0xa68fa8);if(_0xa68fa8==0x0){var _0x5e4096=_0x38ee8b[_0xb9a2('0x14')](/(\r\n|\n|\r)/gm,'');if(_[_0xb9a2('0x15')](_0x4279b3[0x1])||_[_0xb9a2('0x16')](_0x4279b3[0x1])){logger['info']('[%s][SYSTEM]\x20no\x20variable',_0x178744);_0x135675[_0xb9a2('0x17')][_0x4279b3[0x1]]=_0x5e4096;}else{logger[_0xb9a2('0xd')](_0xb9a2('0x18'),_0x178744,_0x4279b3[0x1],_0x5e4096);_0x135675[_0xb9a2('0x17')][_0x4279b3[0x1]]=_0x5e4096;}}_0x173a01[_0xb9a2('0xf')]();});}}catch(_0x2cf3e4){logger[_0xb9a2('0x9')]('[%s][SYSTEM]\x20%s',_0x178744,_[_0xb9a2('0x19')](_0x2cf3e4)?JSON['stringify'](_0x2cf3e4):_0x2cf3e4);logger[_0xb9a2('0xd')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x178744);_0x173a01[_0xb9a2('0xf')]();}};}; \ No newline at end of file +var _0xce8a=['../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][SYSTEM]\x20%s','map','message','join','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','info','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','stringify','validate','shelljs','lodash'];(function(_0x1571a2,_0x1abcf7){var _0x3d7b5b=function(_0x5d66ae){while(--_0x5d66ae){_0x1571a2['push'](_0x1571a2['shift']());}};_0x3d7b5b(++_0x1abcf7);}(_0xce8a,0x10b));var _0xace8=function(_0x5468f7,_0x38770f){_0x5468f7=_0x5468f7-0x0;var _0x54cca7=_0xce8a[_0x5468f7];return _0x54cca7;};'use strict';var schema=require(_0xace8('0x0'));var sh=require(_0xace8('0x1'));var _=require(_0xace8('0x2'));var utils=require('./utils');var logger=require(_0xace8('0x3'))(_0xace8('0x4'));var system=schema({'command':{'type':_0xace8('0x5'),'required':!![],'message':_0xace8('0x6')}});exports[_0xace8('0x7')]=function(_0x294651,_0x17721f){return function(_0x52e437){try{var _0x3628d0={'command':_0x17721f[0x0]};var _0x2f8f31=system[_0xace8('0x0')](_0x3628d0,{'typecast':!![]});if(_0x2f8f31[_0xace8('0x8')]){logger[_0xace8('0x9')](_0xace8('0xa'),_0x294651,_[_0xace8('0xb')](_0x2f8f31,_0xace8('0xc'))[_0xace8('0xd')](',\x20'));logger['info'](_0xace8('0xe'),_0x294651);_0x52e437[_0xace8('0xf')]();}else{var _0x362922=this;var _0x2133e6=utils[_0xace8('0x10')](_0x17721f[0x0],this);logger[_0xace8('0x11')](_0xace8('0x12'),_0x294651,_0x2133e6);sh[_0xace8('0x13')](_[_0xace8('0x14')](_0x2133e6),function(_0x1950c7,_0x27930c){logger['info'](_0xace8('0x15'),_0x294651,_0x1950c7);if(_0x1950c7==0x0){var _0x25e4c9=_0x27930c[_0xace8('0x16')](/(\r\n|\n|\r)/gm,'');if(_[_0xace8('0x17')](_0x17721f[0x1])||_[_0xace8('0x18')](_0x17721f[0x1])){logger[_0xace8('0x11')](_0xace8('0x19'),_0x294651);_0x362922[_0xace8('0x1a')][_0x17721f[0x1]]=_0x25e4c9;}else{logger[_0xace8('0x11')](_0xace8('0x1b'),_0x294651,_0x17721f[0x1],_0x25e4c9);_0x362922[_0xace8('0x1a')][_0x17721f[0x1]]=_0x25e4c9;}}_0x52e437['next']();});}}catch(_0x5e55c2){logger[_0xace8('0x9')](_0xace8('0xa'),_0x294651,_[_0xace8('0x1c')](_0x5e55c2)?JSON[_0xace8('0x1d')](_0x5e55c2):_0x5e55c2);logger['info']('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x294651);_0x52e437[_0xace8('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 4e3b709..33e67dd 100644 --- a/server/services/routing/server/applications/tag.js +++ b/server/services/routing/server/applications/tag.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['finally','error','validate','lodash','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','[%s][TAG]\x20%s','map','join','next','channel','Interaction','addTags','then','info','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','interaction','catch','stringify','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next'];(function(_0x4aa168,_0x4faf71){var _0x13f81c=function(_0x1cad02){while(--_0x1cad02){_0x4aa168['push'](_0x4aa168['shift']());}};_0x13f81c(++_0x4faf71);}(_0x7a54,0x106));var _0x47a5=function(_0x153e24,_0x2fa400){_0x153e24=_0x153e24-0x0;var _0x2b7651=_0x7a54[_0x153e24];return _0x2b7651;};'use strict';var schema=require(_0x47a5('0x0'));var _=require(_0x47a5('0x1'));var rpc={'chatInteraction':require(_0x47a5('0x2')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x47a5('0x3')),'mailInteraction':require(_0x47a5('0x4')),'faxInteraction':require('../../rpc/faxInteraction')};var logger=require(_0x47a5('0x5'))(_0x47a5('0x6'));var tag=schema({'tag':{'type':_0x47a5('0x7'),'required':!![],'message':_0x47a5('0x8')}});exports[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629,_0x59199c,_0x343372){return function(_0x30e405){try{var _0x506eda={'tag':_0x3d5629[0x0]};var _0x194fb0=tag['validate'](_0x506eda,{'typecast':!![]});if(_0x194fb0['length']){logger['error'](_0x47a5('0xa'),_0x545a97,_[_0x47a5('0xb')](_0x194fb0,'message')[_0x47a5('0xc')](',\x20'));logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x545a97);_0x30e405[_0x47a5('0xd')]();}else{var _0x69e4d4={'ids':[_0x3d5629[0x0]]};if(rpc[_0x343372[_0x47a5('0xe')]+_0x47a5('0xf')]){rpc[_0x343372[_0x47a5('0xe')]+_0x47a5('0xf')][_0x47a5('0x10')](_0x343372['interaction']['id'],_0x69e4d4)[_0x47a5('0x11')](function(_0x221b54){logger[_0x47a5('0x12')](_0x47a5('0x13'),_0x545a97,_0x3d5629[0x1],_0x343372[_0x47a5('0xe')],_0x343372[_0x47a5('0x14')]['id']);})[_0x47a5('0x15')](function(_0x190faa){logger['error'](_0x47a5('0xa'),_0x545a97,JSON[_0x47a5('0x16')](_0x190faa));logger[_0x47a5('0x12')](_0x47a5('0x17'),_0x545a97);})[_0x47a5('0x18')](function(){_0x30e405['next']();});}}}catch(_0x549de3){logger[_0x47a5('0x19')]('[%s][TAG]\x20%s',_0x545a97,_['isObject'](_0x549de3)?JSON[_0x47a5('0x16')](_0x549de3):_0x549de3);logger[_0x47a5('0x12')](_0x47a5('0x17'),_0x545a97);_0x30e405[_0x47a5('0xd')]();}};}; \ No newline at end of file +var _0x9957=['join','info','next','Interaction','channel','addTags','interaction','then','catch','stringify','finally','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../../../config/logger','routing','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][TAG]\x20%s','map','message'];(function(_0x38d825,_0x357fd6){var _0xc39a03=function(_0x10e2de){while(--_0x10e2de){_0x38d825['push'](_0x38d825['shift']());}};_0xc39a03(++_0x357fd6);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var schema=require(_0x7995('0x0'));var _=require(_0x7995('0x1'));var rpc={'chatInteraction':require(_0x7995('0x2')),'openchannelInteraction':require(_0x7995('0x3')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x7995('0x4')),'faxInteraction':require(_0x7995('0x5'))};var logger=require(_0x7995('0x6'))(_0x7995('0x7'));var tag=schema({'tag':{'type':'number','required':!![],'message':_0x7995('0x8')}});exports[_0x7995('0x9')]=function(_0x137b6b,_0x219534,_0xbda126,_0x326741){return function(_0x4996ca){try{var _0x465276={'tag':_0x219534[0x0]};var _0x1cad37=tag['validate'](_0x465276,{'typecast':!![]});if(_0x1cad37[_0x7995('0xa')]){logger[_0x7995('0xb')](_0x7995('0xc'),_0x137b6b,_[_0x7995('0xd')](_0x1cad37,_0x7995('0xe'))[_0x7995('0xf')](',\x20'));logger[_0x7995('0x10')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x137b6b);_0x4996ca[_0x7995('0x11')]();}else{var _0x41c652={'ids':[_0x219534[0x0]]};if(rpc[_0x326741['channel']+_0x7995('0x12')]){rpc[_0x326741[_0x7995('0x13')]+_0x7995('0x12')][_0x7995('0x14')](_0x326741[_0x7995('0x15')]['id'],_0x41c652)[_0x7995('0x16')](function(_0x2bbe7a){logger['info']('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x137b6b,_0x219534[0x1],_0x326741[_0x7995('0x13')],_0x326741[_0x7995('0x15')]['id']);})[_0x7995('0x17')](function(_0x321ae8){logger[_0x7995('0xb')](_0x7995('0xc'),_0x137b6b,JSON[_0x7995('0x18')](_0x321ae8));logger[_0x7995('0x10')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x137b6b);})[_0x7995('0x19')](function(){_0x4996ca['next']();});}}}catch(_0x2f832e){logger[_0x7995('0xb')](_0x7995('0xc'),_0x137b6b,_[_0x7995('0x1a')](_0x2f832e)?JSON[_0x7995('0x18')](_0x2f832e):_0x2f832e);logger[_0x7995('0x10')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x137b6b);_0x4996ca['next']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/utils.js b/server/services/routing/server/applications/utils.js index 2befae2..dce7752 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 _0x72b1=['merge','body','contact','account','interaction','list','mustache','exports','render'];(function(_0x4561a4,_0x53d61d){var _0xa65325=function(_0xe339a4){while(--_0xe339a4){_0x4561a4['push'](_0x4561a4['shift']());}};_0xa65325(++_0x53d61d);}(_0x72b1,0x16e));var _0x172b=function(_0x115645,_0xe1de99){_0x115645=_0x115645-0x0;var _0x42ac6e=_0x72b1[_0x115645];return _0x42ac6e;};'use strict';var Mustache=require(_0x172b('0x0'));var _=require('lodash');module[_0x172b('0x1')]={'getMustacheRender':function(_0x29189f,_0x42b795){return Mustache[_0x172b('0x2')](_0x29189f,_[_0x172b('0x3')](_0x42b795[_0x172b('0x4')],{'contact':_0x42b795[_0x172b('0x5')],'message':_0x42b795['message'],'account':_0x42b795[_0x172b('0x6')],'interaction':_0x42b795[_0x172b('0x7')],'list':_0x42b795[_0x172b('0x8')]}))||'';}}; \ No newline at end of file +var _0x7341=['message','account','interaction','list','exports','render','body','contact'];(function(_0x1484e5,_0x2a588b){var _0x1243f7=function(_0x4fd767){while(--_0x4fd767){_0x1484e5['push'](_0x1484e5['shift']());}};_0x1243f7(++_0x2a588b);}(_0x7341,0xe4));var _0x1734=function(_0x133487,_0x35214a){_0x133487=_0x133487-0x0;var _0xcd3115=_0x7341[_0x133487];return _0xcd3115;};'use strict';var Mustache=require('mustache');var _=require('lodash');module[_0x1734('0x0')]={'getMustacheRender':function(_0x495e58,_0x2cfd38){return Mustache[_0x1734('0x1')](_0x495e58,_['merge'](_0x2cfd38[_0x1734('0x2')],{'contact':_0x2cfd38[_0x1734('0x3')],'message':_0x2cfd38[_0x1734('0x4')],'account':_0x2cfd38[_0x1734('0x5')],'interaction':_0x2cfd38[_0x1734('0x6')],'list':_0x2cfd38[_0x1734('0x7')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 2f6d3a9..28d9741 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 _0x748d=['available','waiting','mailQueues','loggedIn','name','openchannelQueues','paused','smsQueues','faxQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','server','listen','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','uuid','routing','../rpc/openchannelQueueReport','../rpc/chatQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','interval','message','interaction','applications','isArray','length','join','.js','app','toLowerCase','autoreply','appdata','split','push','slice','dialogflow','amazonlex','tag','TagId','%s:%s:%s','./interval','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','Please\x20create\x20a\x20new\x20file\x20under','rules','execute','stringify','complete','error','stack','routing\x20is\x20empty','channel','emit','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','agent','agents','busy','busyQueue','end','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues'];(function(_0x458b97,_0x24d421){var _0x3f42e3=function(_0x55df79){while(--_0x55df79){_0x458b97['push'](_0x458b97['shift']());}};_0x3f42e3(++_0x24d421);}(_0x748d,0x121));var _0xd748=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x748d[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0xd748('0x0'));var util=require(_0xd748('0x1'));var path=require(_0xd748('0x2'));var fs=require('fs');var jayson=require(_0xd748('0x3'));var BPromise=require(_0xd748('0x4'));var uuid=require(_0xd748('0x5'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0xd748('0x6'));var rpc={'openchannelQueueReport':require(_0xd748('0x7'))};var rpc={'openchannelQueueReport':require(_0xd748('0x7')),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require(_0xd748('0x8')),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require('../rpc/faxQueueReport')};var RuleEngine=require(_0xd748('0x9'));function getId(_0x21dc06,_0x2e7357,_0x5af03a){return util[_0xd748('0xa')](_0xd748('0xb'),_0x21dc06,_0x2e7357||0x0,_0x5af03a||0x0);}function getIntervals(_0x4bf37a,_0x17c959){var _0x769d4=[];if(!_[_0xd748('0xc')](_0x17c959[_0xd748('0xd')])&&!_[_0xd748('0xc')](_0x4bf37a[_0x17c959['IntervalId']])&&!_['isNil'](_0x4bf37a[_0x17c959[_0xd748('0xd')]]['Intervals'])){_0x769d4=_['map'](_0x4bf37a[_0x17c959[_0xd748('0xd')]]['Intervals'],_0xd748('0xe'));}else if(!_[_0xd748('0xc')](_0x17c959[_0xd748('0xe')])){_0x769d4=[_0x17c959[_0xd748('0xe')]];}return _0x769d4;}exports['listen']=function(_0x4e677b){_0x4e677b['rules']={};return new BPromise(function(_0x137fd6,_0x33b495){var _0x4b9712={'Start':function(_0x1f5b81){var _0x382429=this;return new Promise(function(_0x45cd8f,_0x459e2f){if(_0x1f5b81){try{var _0x4c2e64=[];var _0x37630c=getId(_0x1f5b81['channel'],_0x1f5b81[_0xd748('0xf')]?_0x1f5b81[_0xd748('0xf')]['id']:0x0,_0x1f5b81[_0xd748('0x10')]?_0x1f5b81[_0xd748('0x10')]['id']:0x0);if(_0x1f5b81[_0xd748('0x11')]&&_[_0xd748('0x12')](_0x1f5b81[_0xd748('0x11')])&&_0x1f5b81[_0xd748('0x11')][_0xd748('0x13')]){for(var _0x319aac=0x0;_0x319aac<_0x1f5b81[_0xd748('0x11')]['length'];_0x319aac+=0x1){var _0x1d6a66=_0x1f5b81[_0xd748('0x11')][_0x319aac];if(fs['existsSync'](path[_0xd748('0x14')](__dirname,_0xd748('0x11'),_0x1d6a66['app']+_0xd748('0x15')))){var _0x4e85a1=[];switch(_0x1d6a66[_0xd748('0x16')][_0xd748('0x17')]()){case _0xd748('0x18'):var _0x1469f6=_0x1d6a66[_0xd748('0x19')][_0xd748('0x1a')](',');_0x4e85a1[_0xd748('0x1b')](_0x1469f6[0x0]);_0x4e85a1[_0xd748('0x1b')](_0x1469f6[_0xd748('0x1c')](0x1,_0x1469f6[_0xd748('0x13')])['join'](','));break;case _0xd748('0x1d'):var _0x35019f=_0x1d6a66[_0xd748('0x19')]['split'](',');_0x4e85a1[_0xd748('0x1b')](_0x35019f[0x0]);_0x4e85a1[_0xd748('0x1b')](_0x35019f[0x1]);_0x4e85a1['push'](_0x35019f[_0xd748('0x1c')](0x2,_0x35019f[_0xd748('0x13')])[_0xd748('0x14')](','));break;case _0xd748('0x1e'):var _0x2f650e=_0x1d6a66[_0xd748('0x19')]['split'](',');_0x4e85a1[_0xd748('0x1b')](_0x2f650e[0x0]);_0x4e85a1[_0xd748('0x1b')](_0x2f650e[0x1]);_0x4e85a1[_0xd748('0x1b')](_0x2f650e[0x2]);_0x4e85a1[_0xd748('0x1b')](_0x2f650e[0x3]);_0x4e85a1['push'](_0x2f650e[_0xd748('0x1c')](0x4,_0x2f650e['length'])[_0xd748('0x14')](','));break;case _0xd748('0xf'):_0x4e85a1[_0xd748('0x1b')](_0x1d6a66['appdata']);break;case _0xd748('0x1f'):_0x4e85a1[_0xd748('0x1b')](_0x1d6a66[_0xd748('0x20')]);_0x4e85a1[_0xd748('0x1b')](_0x1d6a66['appdata']);break;default:_0x4e85a1=_[_0xd748('0xc')](_0x1d6a66[_0xd748('0x19')])?[]:_0x1d6a66['appdata'][_0xd748('0x1a')](',');}var _0x267f11={'id':util[_0xd748('0xa')](_0xd748('0x21'),_0x37630c,_0x1d6a66['id'],_0x1d6a66[_0xd748('0x16')]),'condition':require(_0xd748('0x22'))['condition'](_0x37630c,getIntervals(_0x4e677b[_0xd748('0x23')],_0x1d6a66),_0x4e677b),'consequence':require(_0xd748('0x24')+_0x1d6a66[_0xd748('0x16')])[_0xd748('0x25')](_0x37630c,_0x4e85a1,_0x4e677b,_0x1f5b81),'p':_0x1d6a66[_0xd748('0x26')]||0x0};logger[_0xd748('0x27')](_0xd748('0x28'),_0x267f11['id'],_0xd748('0x29'),getIntervals(_0x4e677b[_0xd748('0x23')],_0x1d6a66)[_0xd748('0x14')](_0xd748('0x2a')));_0x4c2e64[_0xd748('0x1b')](_0x267f11);}else{logger['error'](_0xd748('0x2b'),path['join'](__dirname,_0xd748('0x11'),_0x1d6a66[_0xd748('0x16')]+_0xd748('0x15')));}}_0x4e677b[_0xd748('0x2c')][_0x37630c]=new RuleEngine(_0x4c2e64);_0x4e677b[_0xd748('0x2c')][_0x37630c][_0xd748('0x2d')](_0x1f5b81,function(_0x41dc6c){logger[_0xd748('0x27')]('Applications\x20executed',JSON[_0xd748('0x2e')](_0x41dc6c['matchPath']));if(_0x4e677b[_0xd748('0x2c')][_0x37630c]){_0x4e677b[_0xd748('0x2c')][_0x37630c]['emit'](_0xd748('0x2f'));}});return _0x45cd8f({'code':0xc8,'message':_0x1f5b81});}else{logger[_0xd748('0x27')]('No\x20applications\x20to\x20execute');return _0x45cd8f({'code':0xc8,'message':_0x1f5b81});}}catch(_0x255f8f){logger[_0xd748('0x30')](_0x255f8f[_0xd748('0x31')]);return _0x459e2f(_0x382429['error'](0x1f4,_0x255f8f));}}return _0x459e2f(_0xd748('0x32'));});},'AcceptMessage':function(_0x38e2b7){var _0x1ea71f=this;return new Promise(function(_0x24682a,_0x4db342){if(_0x38e2b7[_0xd748('0xf')]&&_0x38e2b7[_0xd748('0xf')]['id']){try{var _0x4342ce=getId(_0x38e2b7[_0xd748('0x33')],_0x38e2b7[_0xd748('0xf')]?_0x38e2b7[_0xd748('0xf')]['id']:0x0,_0x38e2b7[_0xd748('0x10')]?_0x38e2b7[_0xd748('0x10')]['id']:0x0);if(_0x4e677b[_0xd748('0x2c')][_0x4342ce]){_0x4e677b[_0xd748('0x2c')][_0x4342ce][_0xd748('0x34')]('end');if(rpc[_0x38e2b7[_0xd748('0x33')]+_0xd748('0x35')]){rpc[_0x38e2b7[_0xd748('0x33')]+_0xd748('0x35')][_0xd748('0x36')](_0x4342ce,{'UserId':_0x38e2b7[_0xd748('0xf')][_0xd748('0x37')]})[_0xd748('0x38')](function(_0x36fa94){logger[_0xd748('0x30')](_0xd748('0x39'));});}}return _0x24682a({'code':0xc8,'message':_0x38e2b7});}catch(_0x2a503d){logger[_0xd748('0x30')](_0x2a503d['stack']);return _0x4db342(_0x1ea71f['error'](0x1f4,_0x2a503d));}}logger[_0xd748('0x30')](_0xd748('0x3a'));return _0x4db342(_0x1ea71f['error'](0x1f4,_0xd748('0x3a')));});},'RejectMessage':function(_0x53b2b8){var _0x298b39=this;return new Promise(function(_0x107d68,_0xfb133a){if(_0x53b2b8[_0xd748('0x3b')]&&_0x53b2b8[_0xd748('0x3b')]['id']){try{if(_0x4e677b['agents'][_0x53b2b8[_0xd748('0x3b')]['id']]){_0x4e677b[_0xd748('0x3c')][_0x53b2b8[_0xd748('0x3b')]['id']][_0xd748('0x3d')]=![];_0x4e677b[_0xd748('0x3c')][_0x53b2b8['agent']['id']][_0xd748('0x3e')]=undefined;}return _0x107d68({'code':0xc8,'message':_0x53b2b8});}catch(_0x5a6137){logger[_0xd748('0x30')](_0x5a6137[_0xd748('0x31')]);return _0xfb133a(_0x298b39['error'](0x1f4,_0x5a6137));}}logger[_0xd748('0x30')](_0xd748('0x3a'));return _0xfb133a(_0x298b39[_0xd748('0x30')](0x1f4,_0xd748('0x3a')));});},'AbandonInteraction':function(_0x3f795e){var _0x86713b=this;return new Promise(function(_0x4c7f57,_0x5ae24e){if(_0x3f795e[_0xd748('0x33')]&&_0x3f795e[_0xd748('0x10')]&&_0x3f795e['interaction']['id']){try{var _0x2b9cf5=getId(_0x3f795e['channel'],_0x3f795e['message']?_0x3f795e['message']['id']:0x0,_0x3f795e[_0xd748('0x10')]?_0x3f795e['interaction']['id']:0x0);if(_0x4e677b[_0xd748('0x2c')][_0x2b9cf5]){_0x4e677b['rules'][_0x2b9cf5][_0xd748('0x34')](_0xd748('0x3f'));}return _0x4c7f57({'code':0xc8,'message':_0x3f795e});}catch(_0x4bad00){logger[_0xd748('0x30')](_0x4bad00[_0xd748('0x31')]);return _0x5ae24e(_0x86713b[_0xd748('0x30')](0x1f4,_0x4bad00));}}logger['error'](_0xd748('0x3a'));return _0x5ae24e(_0x86713b[_0xd748('0x30')](0x1f4,_0xd748('0x3a')));});},'AgentCapacity':function(_0x1b803f){var _0x1d9fd8=this;return new Promise(function(_0x4fc8e6,_0x14f563){if(_0x4e677b[_0xd748('0x3c')][_0xd748('0x40')](_0x1b803f['id'])){for(var _0x11d569 in _0x1b803f[_0xd748('0x41')]){if(_0x1b803f[_0xd748('0x41')]['hasOwnProperty'](_0x11d569)){if(_0x4e677b[_0xd748('0x3c')][_0x1b803f['id']]['hasOwnProperty'](_0x11d569+_0xd748('0x42'))){_0x4e677b[_0xd748('0x3c')][_0x1b803f['id']][_0x11d569+'CurrentCapacity']=parseInt(_0x1b803f[_0xd748('0x41')][_0x11d569],0xa);}}}_0x4e677b[_0xd748('0x3c')][_0x1b803f['id']][_0xd748('0x43')]();return _0x4fc8e6({'code':0xc8,'message':_0x4e677b[_0xd748('0x3c')][_0x1b803f['id']]});}else{return _0x14f563(_0x1d9fd8['error'](0x1f4,_0xd748('0x44')));}});},'Agents':function(_0x3b2f0b){return new Promise(function(_0x2a73e7,_0x159dd0){var _0x2877c5=_[_0xd748('0x45')](_0x4e677b['agents']);_0x2a73e7({'count':_0x2877c5['length'],'rows':_0x2877c5});});},'ChatQueues':function(_0x2e09d4){return new Promise(function(_0x1f97b3,_0x325dee){var _0x3c2371=[];for(var _0x12d6c1 in _0x4e677b[_0xd748('0x46')]){if(_0x4e677b[_0xd748('0x46')][_0xd748('0x40')](_0x12d6c1)){var _0x3451c1=_0x4e677b['chatQueues'][_0x12d6c1];var _0x4b24cd={'id':_0x3451c1['id'],'available':_0x3451c1[_0xd748('0x47')],'loggedIn':_0x3451c1['loggedIn'],'name':_0x3451c1['name'],'paused':_0x3451c1['paused'],'waiting':_0x3451c1[_0xd748('0x48')]};_0x3c2371[_0xd748('0x1b')](_0x4b24cd);}}_0x1f97b3({'count':_0x3c2371[_0xd748('0x13')],'rows':_0x3c2371});});},'MailQueues':function(_0x5508da){return new Promise(function(_0xd5541c,_0x134bb6){var _0x48ac9c=[];for(var _0x102a64 in _0x4e677b[_0xd748('0x49')]){if(_0x4e677b[_0xd748('0x49')][_0xd748('0x40')](_0x102a64)){var _0x3bcdea=_0x4e677b[_0xd748('0x49')][_0x102a64];var _0x467eb0={'id':_0x3bcdea['id'],'available':_0x3bcdea['available'],'loggedIn':_0x3bcdea[_0xd748('0x4a')],'name':_0x3bcdea[_0xd748('0x4b')],'paused':_0x3bcdea['paused'],'waiting':_0x3bcdea[_0xd748('0x48')]};_0x48ac9c[_0xd748('0x1b')](_0x467eb0);}}_0xd5541c({'count':_0x48ac9c[_0xd748('0x13')],'rows':_0x48ac9c});});},'OpenchannelQueues':function(_0x2e8638){return new Promise(function(_0x11c72e,_0xbc7cbe){var _0x418527=[];for(var _0x38197d in _0x4e677b[_0xd748('0x4c')]){if(_0x4e677b[_0xd748('0x4c')][_0xd748('0x40')](_0x38197d)){var _0x547178=_0x4e677b[_0xd748('0x4c')][_0x38197d];var _0x3202ce={'id':_0x547178['id'],'available':_0x547178[_0xd748('0x47')],'loggedIn':_0x547178['loggedIn'],'name':_0x547178['name'],'paused':_0x547178[_0xd748('0x4d')],'waiting':_0x547178[_0xd748('0x48')]};_0x418527['push'](_0x3202ce);}}_0x11c72e({'count':_0x418527[_0xd748('0x13')],'rows':_0x418527});});},'SmsQueues':function(_0x2ac443){return new Promise(function(_0x4b2e3c,_0x42f80e){var _0x2ec11e=[];for(var _0x379a58 in _0x4e677b[_0xd748('0x4e')]){if(_0x4e677b[_0xd748('0x4e')][_0xd748('0x40')](_0x379a58)){var _0x37af12=_0x4e677b['smsQueues'][_0x379a58];var _0x41c666={'id':_0x37af12['id'],'available':_0x37af12[_0xd748('0x47')],'loggedIn':_0x37af12[_0xd748('0x4a')],'name':_0x37af12[_0xd748('0x4b')],'paused':_0x37af12[_0xd748('0x4d')],'waiting':_0x37af12[_0xd748('0x48')]};_0x2ec11e[_0xd748('0x1b')](_0x41c666);}}_0x4b2e3c({'count':_0x2ec11e[_0xd748('0x13')],'rows':_0x2ec11e});});},'FaxQueues':function(_0x311b36){return new Promise(function(_0x93424e,_0x21ffe9){var _0x1aa5ad=[];for(var _0xd48f94 in _0x4e677b[_0xd748('0x4f')]){if(_0x4e677b['faxQueues']['hasOwnProperty'](_0xd48f94)){var _0x26bfb2=_0x4e677b[_0xd748('0x4f')][_0xd48f94];var _0x2af73d={'id':_0x26bfb2['id'],'available':_0x26bfb2[_0xd748('0x47')],'loggedIn':_0x26bfb2[_0xd748('0x4a')],'name':_0x26bfb2[_0xd748('0x4b')],'paused':_0x26bfb2[_0xd748('0x4d')],'waiting':_0x26bfb2[_0xd748('0x48')]};_0x1aa5ad[_0xd748('0x1b')](_0x2af73d);}}_0x93424e({'count':_0x1aa5ad[_0xd748('0x13')],'rows':_0x1aa5ad});});},'ChatQueuesWaitingInteractions':function(_0x148052){return new Promise(function(_0x56bfa4,_0x392040){var _0x179e4a=_['values'](_0x4e677b[_0xd748('0x50')]);_0x56bfa4({'count':_0x179e4a[_0xd748('0x13')],'rows':_0x179e4a});});},'MailQueuesWaitingInteractions':function(_0x161036){return new Promise(function(_0x27b4f6,_0x274593){var _0xeaf7d5=_[_0xd748('0x45')](_0x4e677b[_0xd748('0x51')]);_0x27b4f6({'count':_0xeaf7d5[_0xd748('0x13')],'rows':_0xeaf7d5});});},'OpenchannelQueuesWaitingInteractions':function(_0x194e8e){return new Promise(function(_0x10615f,_0xbc1633){var _0x1deab9=_[_0xd748('0x45')](_0x4e677b[_0xd748('0x52')]);_0x10615f({'count':_0x1deab9[_0xd748('0x13')],'rows':_0x1deab9});});},'SmsQueuesWaitingInteractions':function(_0xf83988){return new Promise(function(_0x10a503,_0x1b1701){var _0x16583b=_[_0xd748('0x45')](_0x4e677b[_0xd748('0x53')]);_0x10a503({'count':_0x16583b[_0xd748('0x13')],'rows':_0x16583b});});},'FaxQueuesWaitingInteractions':function(_0x2ded02){return new Promise(function(_0x49d9a6,_0x56b3d6){var _0x14fc6a=_[_0xd748('0x45')](_0x4e677b['faxQueuesWaitingInteractions']);_0x49d9a6({'count':_0x14fc6a['length'],'rows':_0x14fc6a});});}};var _0x5c9977=jayson[_0xd748('0x54')](_0x4b9712)['http']();_0x5c9977['on'](_0xd748('0x30'),function(_0x4159da){logger[_0xd748('0x30')](JSON[_0xd748('0x2e')](_0x4159da));return _0x33b495(_0x4159da);});_0x5c9977[_0xd748('0x55')](0x232c,_0xd748('0x56'),function(){console[_0xd748('0x57')](_0xd748('0x58'),0x232c);return _0x137fd6(_0xd748('0x59')+0x232c);});});}; \ No newline at end of file +var _0x1b37=['slice','amazonlex','appdata','join','tag','TagId','format','%s:%s:%s','./interval','condition','intervals','./applications/','app','consequence','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','stringify','matchPath','emit','complete','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','end','QueueReport','UserId','catch','message\x20is\x20empty','agents','agent','busy','busyQueue','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','loggedIn','paused','mailQueues','waiting','openchannelQueues','smsQueues','name','faxQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','server','http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','bluebird','uuid','../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../lib/rule-engine','%s.%s.%s','isNil','IntervalId','map','Intervals','interval','listen','rules','channel','message','interaction','applications','isArray','length','existsSync','.js','toLowerCase','autoreply','split','push','dialogflow'];(function(_0x3a7c8b,_0x4196d6){var _0xd715d=function(_0x1e2597){while(--_0x1e2597){_0x3a7c8b['push'](_0x3a7c8b['shift']());}};_0xd715d(++_0x4196d6);}(_0x1b37,0x167));var _0x71b3=function(_0x30fb4f,_0x2e4430){_0x30fb4f=_0x30fb4f-0x0;var _0x4ff8c8=_0x1b37[_0x30fb4f];return _0x4ff8c8;};'use strict';var _=require(_0x71b3('0x0'));var util=require(_0x71b3('0x1'));var path=require('path');var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require(_0x71b3('0x2'));var uuid=require(_0x71b3('0x3'));var config=require(_0x71b3('0x4'));var logger=require(_0x71b3('0x5'))(_0x71b3('0x6'));var rpc={'openchannelQueueReport':require(_0x71b3('0x7'))};var rpc={'openchannelQueueReport':require(_0x71b3('0x7')),'mailQueueReport':require(_0x71b3('0x8')),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require(_0x71b3('0x9')),'faxQueueReport':require(_0x71b3('0xa'))};var RuleEngine=require(_0x71b3('0xb'));function getId(_0x5f236,_0x215b5a,_0x194bde){return util['format'](_0x71b3('0xc'),_0x5f236,_0x215b5a||0x0,_0x194bde||0x0);}function getIntervals(_0x57c160,_0x185664){var _0xc1d3c3=[];if(!_[_0x71b3('0xd')](_0x185664[_0x71b3('0xe')])&&!_[_0x71b3('0xd')](_0x57c160[_0x185664[_0x71b3('0xe')]])&&!_[_0x71b3('0xd')](_0x57c160[_0x185664[_0x71b3('0xe')]]['Intervals'])){_0xc1d3c3=_[_0x71b3('0xf')](_0x57c160[_0x185664[_0x71b3('0xe')]][_0x71b3('0x10')],_0x71b3('0x11'));}else if(!_[_0x71b3('0xd')](_0x185664['interval'])){_0xc1d3c3=[_0x185664[_0x71b3('0x11')]];}return _0xc1d3c3;}exports[_0x71b3('0x12')]=function(_0x31c4be){_0x31c4be[_0x71b3('0x13')]={};return new BPromise(function(_0x22cf5f,_0x195bcc){var _0x1a39c7={'Start':function(_0x4a5c50){var _0x53c20b=this;return new Promise(function(_0x1c024b,_0x53aa8a){if(_0x4a5c50){try{var _0x214e61=[];var _0x18eb05=getId(_0x4a5c50[_0x71b3('0x14')],_0x4a5c50[_0x71b3('0x15')]?_0x4a5c50[_0x71b3('0x15')]['id']:0x0,_0x4a5c50[_0x71b3('0x16')]?_0x4a5c50['interaction']['id']:0x0);if(_0x4a5c50[_0x71b3('0x17')]&&_[_0x71b3('0x18')](_0x4a5c50['applications'])&&_0x4a5c50[_0x71b3('0x17')][_0x71b3('0x19')]){for(var _0x284733=0x0;_0x284733<_0x4a5c50['applications'][_0x71b3('0x19')];_0x284733+=0x1){var _0x5a652d=_0x4a5c50[_0x71b3('0x17')][_0x284733];if(fs[_0x71b3('0x1a')](path['join'](__dirname,'applications',_0x5a652d['app']+_0x71b3('0x1b')))){var _0x5e26e8=[];switch(_0x5a652d['app'][_0x71b3('0x1c')]()){case _0x71b3('0x1d'):var _0x34e1b6=_0x5a652d['appdata'][_0x71b3('0x1e')](',');_0x5e26e8[_0x71b3('0x1f')](_0x34e1b6[0x0]);_0x5e26e8['push'](_0x34e1b6['slice'](0x1,_0x34e1b6[_0x71b3('0x19')])['join'](','));break;case _0x71b3('0x20'):var _0x55d7e0=_0x5a652d['appdata']['split'](',');_0x5e26e8[_0x71b3('0x1f')](_0x55d7e0[0x0]);_0x5e26e8['push'](_0x55d7e0[0x1]);_0x5e26e8[_0x71b3('0x1f')](_0x55d7e0[_0x71b3('0x21')](0x2,_0x55d7e0[_0x71b3('0x19')])['join'](','));break;case _0x71b3('0x22'):var _0x206cfe=_0x5a652d[_0x71b3('0x23')][_0x71b3('0x1e')](',');_0x5e26e8['push'](_0x206cfe[0x0]);_0x5e26e8[_0x71b3('0x1f')](_0x206cfe[0x1]);_0x5e26e8[_0x71b3('0x1f')](_0x206cfe[0x2]);_0x5e26e8[_0x71b3('0x1f')](_0x206cfe[0x3]);_0x5e26e8[_0x71b3('0x1f')](_0x206cfe['slice'](0x4,_0x206cfe['length'])[_0x71b3('0x24')](','));break;case _0x71b3('0x15'):_0x5e26e8[_0x71b3('0x1f')](_0x5a652d[_0x71b3('0x23')]);break;case _0x71b3('0x25'):_0x5e26e8['push'](_0x5a652d[_0x71b3('0x26')]);_0x5e26e8[_0x71b3('0x1f')](_0x5a652d['appdata']);break;default:_0x5e26e8=_['isNil'](_0x5a652d[_0x71b3('0x23')])?[]:_0x5a652d[_0x71b3('0x23')]['split'](',');}var _0xf60c59={'id':util[_0x71b3('0x27')](_0x71b3('0x28'),_0x18eb05,_0x5a652d['id'],_0x5a652d['app']),'condition':require(_0x71b3('0x29'))[_0x71b3('0x2a')](_0x18eb05,getIntervals(_0x31c4be[_0x71b3('0x2b')],_0x5a652d),_0x31c4be),'consequence':require(_0x71b3('0x2c')+_0x5a652d[_0x71b3('0x2d')])[_0x71b3('0x2e')](_0x18eb05,_0x5e26e8,_0x31c4be,_0x4a5c50),'p':_0x5a652d[_0x71b3('0x2f')]||0x0};logger[_0x71b3('0x30')](_0x71b3('0x31'),_0xf60c59['id'],_0x71b3('0x32'),getIntervals(_0x31c4be[_0x71b3('0x2b')],_0x5a652d)['join'](_0x71b3('0x33')));_0x214e61[_0x71b3('0x1f')](_0xf60c59);}else{logger[_0x71b3('0x34')](_0x71b3('0x35'),path[_0x71b3('0x24')](__dirname,_0x71b3('0x17'),_0x5a652d['app']+_0x71b3('0x1b')));}}_0x31c4be[_0x71b3('0x13')][_0x18eb05]=new RuleEngine(_0x214e61);_0x31c4be[_0x71b3('0x13')][_0x18eb05][_0x71b3('0x36')](_0x4a5c50,function(_0xa09996){logger[_0x71b3('0x30')](_0x71b3('0x37'),JSON[_0x71b3('0x38')](_0xa09996[_0x71b3('0x39')]));if(_0x31c4be[_0x71b3('0x13')][_0x18eb05]){_0x31c4be[_0x71b3('0x13')][_0x18eb05][_0x71b3('0x3a')](_0x71b3('0x3b'));}});return _0x1c024b({'code':0xc8,'message':_0x4a5c50});}else{logger['info'](_0x71b3('0x3c'));return _0x1c024b({'code':0xc8,'message':_0x4a5c50});}}catch(_0x3723e8){logger[_0x71b3('0x34')](_0x3723e8[_0x71b3('0x3d')]);return _0x53aa8a(_0x53c20b[_0x71b3('0x34')](0x1f4,_0x3723e8));}}return _0x53aa8a(_0x71b3('0x3e'));});},'AcceptMessage':function(_0x278d70){var _0x36bd78=this;return new Promise(function(_0x517e7f,_0x4a14b3){if(_0x278d70[_0x71b3('0x15')]&&_0x278d70['message']['id']){try{var _0x1471f6=getId(_0x278d70[_0x71b3('0x14')],_0x278d70[_0x71b3('0x15')]?_0x278d70[_0x71b3('0x15')]['id']:0x0,_0x278d70[_0x71b3('0x16')]?_0x278d70[_0x71b3('0x16')]['id']:0x0);if(_0x31c4be[_0x71b3('0x13')][_0x1471f6]){_0x31c4be[_0x71b3('0x13')][_0x1471f6][_0x71b3('0x3a')](_0x71b3('0x3f'));if(rpc[_0x278d70[_0x71b3('0x14')]+_0x71b3('0x40')]){rpc[_0x278d70[_0x71b3('0x14')]+'QueueReport']['update'](_0x1471f6,{'UserId':_0x278d70[_0x71b3('0x15')][_0x71b3('0x41')]})[_0x71b3('0x42')](function(_0x1d6ad9){logger['error']('error\x20update\x20queue\x20report');});}}return _0x517e7f({'code':0xc8,'message':_0x278d70});}catch(_0x763d6a){logger['error'](_0x763d6a[_0x71b3('0x3d')]);return _0x4a14b3(_0x36bd78['error'](0x1f4,_0x763d6a));}}logger['error'](_0x71b3('0x43'));return _0x4a14b3(_0x36bd78['error'](0x1f4,_0x71b3('0x43')));});},'RejectMessage':function(_0xdbe926){var _0x2f287c=this;return new Promise(function(_0x1badf1,_0x57b493){if(_0xdbe926['agent']&&_0xdbe926['agent']['id']){try{if(_0x31c4be[_0x71b3('0x44')][_0xdbe926[_0x71b3('0x45')]['id']]){_0x31c4be['agents'][_0xdbe926[_0x71b3('0x45')]['id']][_0x71b3('0x46')]=![];_0x31c4be[_0x71b3('0x44')][_0xdbe926['agent']['id']][_0x71b3('0x47')]=undefined;}return _0x1badf1({'code':0xc8,'message':_0xdbe926});}catch(_0x29fb6b){logger['error'](_0x29fb6b[_0x71b3('0x3d')]);return _0x57b493(_0x2f287c[_0x71b3('0x34')](0x1f4,_0x29fb6b));}}logger['error'](_0x71b3('0x43'));return _0x57b493(_0x2f287c['error'](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0xcba90){var _0x36ff45=this;return new Promise(function(_0x339396,_0x29a181){if(_0xcba90[_0x71b3('0x14')]&&_0xcba90[_0x71b3('0x16')]&&_0xcba90['interaction']['id']){try{var _0x391e83=getId(_0xcba90[_0x71b3('0x14')],_0xcba90[_0x71b3('0x15')]?_0xcba90[_0x71b3('0x15')]['id']:0x0,_0xcba90['interaction']?_0xcba90[_0x71b3('0x16')]['id']:0x0);if(_0x31c4be['rules'][_0x391e83]){_0x31c4be['rules'][_0x391e83]['emit'](_0x71b3('0x3f'));}return _0x339396({'code':0xc8,'message':_0xcba90});}catch(_0x3176f3){logger['error'](_0x3176f3['stack']);return _0x29a181(_0x36ff45['error'](0x1f4,_0x3176f3));}}logger[_0x71b3('0x34')](_0x71b3('0x43'));return _0x29a181(_0x36ff45[_0x71b3('0x34')](0x1f4,_0x71b3('0x43')));});},'AgentCapacity':function(_0x153fc4){var _0x404f7c=this;return new Promise(function(_0x395d32,_0xa086eb){if(_0x31c4be[_0x71b3('0x44')][_0x71b3('0x48')](_0x153fc4['id'])){for(var _0x52268d in _0x153fc4[_0x71b3('0x49')]){if(_0x153fc4[_0x71b3('0x49')][_0x71b3('0x48')](_0x52268d)){if(_0x31c4be[_0x71b3('0x44')][_0x153fc4['id']][_0x71b3('0x48')](_0x52268d+_0x71b3('0x4a'))){_0x31c4be[_0x71b3('0x44')][_0x153fc4['id']][_0x52268d+_0x71b3('0x4a')]=parseInt(_0x153fc4[_0x71b3('0x49')][_0x52268d],0xa);}}}_0x31c4be[_0x71b3('0x44')][_0x153fc4['id']][_0x71b3('0x4b')]();return _0x395d32({'code':0xc8,'message':_0x31c4be[_0x71b3('0x44')][_0x153fc4['id']]});}else{return _0xa086eb(_0x404f7c[_0x71b3('0x34')](0x1f4,_0x71b3('0x4c')));}});},'Agents':function(_0x38d76f){return new Promise(function(_0xe308c,_0x50b0b9){var _0x4d0924=_[_0x71b3('0x4d')](_0x31c4be[_0x71b3('0x44')]);_0xe308c({'count':_0x4d0924[_0x71b3('0x19')],'rows':_0x4d0924});});},'ChatQueues':function(_0x4c2a69){return new Promise(function(_0x1c2419,_0x56f0b2){var _0x4e30af=[];for(var _0x49b8e0 in _0x31c4be['chatQueues']){if(_0x31c4be[_0x71b3('0x4e')][_0x71b3('0x48')](_0x49b8e0)){var _0x3c8c59=_0x31c4be['chatQueues'][_0x49b8e0];var _0x38ae0d={'id':_0x3c8c59['id'],'available':_0x3c8c59[_0x71b3('0x4f')],'loggedIn':_0x3c8c59[_0x71b3('0x50')],'name':_0x3c8c59['name'],'paused':_0x3c8c59[_0x71b3('0x51')],'waiting':_0x3c8c59['waiting']};_0x4e30af['push'](_0x38ae0d);}}_0x1c2419({'count':_0x4e30af[_0x71b3('0x19')],'rows':_0x4e30af});});},'MailQueues':function(_0x18f425){return new Promise(function(_0x51d943,_0x548622){var _0x517499=[];for(var _0x46bfcf in _0x31c4be['mailQueues']){if(_0x31c4be[_0x71b3('0x52')]['hasOwnProperty'](_0x46bfcf)){var _0x3a6c58=_0x31c4be[_0x71b3('0x52')][_0x46bfcf];var _0x449132={'id':_0x3a6c58['id'],'available':_0x3a6c58[_0x71b3('0x4f')],'loggedIn':_0x3a6c58[_0x71b3('0x50')],'name':_0x3a6c58['name'],'paused':_0x3a6c58[_0x71b3('0x51')],'waiting':_0x3a6c58[_0x71b3('0x53')]};_0x517499[_0x71b3('0x1f')](_0x449132);}}_0x51d943({'count':_0x517499[_0x71b3('0x19')],'rows':_0x517499});});},'OpenchannelQueues':function(_0x5caf2a){return new Promise(function(_0xd64bab,_0x1a67fe){var _0x375992=[];for(var _0x7709d8 in _0x31c4be['openchannelQueues']){if(_0x31c4be[_0x71b3('0x54')][_0x71b3('0x48')](_0x7709d8)){var _0x123a0c=_0x31c4be['openchannelQueues'][_0x7709d8];var _0x508453={'id':_0x123a0c['id'],'available':_0x123a0c[_0x71b3('0x4f')],'loggedIn':_0x123a0c[_0x71b3('0x50')],'name':_0x123a0c['name'],'paused':_0x123a0c[_0x71b3('0x51')],'waiting':_0x123a0c[_0x71b3('0x53')]};_0x375992['push'](_0x508453);}}_0xd64bab({'count':_0x375992['length'],'rows':_0x375992});});},'SmsQueues':function(_0x4bbe0f){return new Promise(function(_0x418229,_0x1f2779){var _0x418186=[];for(var _0x171536 in _0x31c4be['smsQueues']){if(_0x31c4be['smsQueues']['hasOwnProperty'](_0x171536)){var _0x3e8515=_0x31c4be[_0x71b3('0x55')][_0x171536];var _0x3b7504={'id':_0x3e8515['id'],'available':_0x3e8515[_0x71b3('0x4f')],'loggedIn':_0x3e8515[_0x71b3('0x50')],'name':_0x3e8515[_0x71b3('0x56')],'paused':_0x3e8515[_0x71b3('0x51')],'waiting':_0x3e8515[_0x71b3('0x53')]};_0x418186[_0x71b3('0x1f')](_0x3b7504);}}_0x418229({'count':_0x418186[_0x71b3('0x19')],'rows':_0x418186});});},'FaxQueues':function(_0x4356be){return new Promise(function(_0x468ac9,_0xe8757a){var _0x3355a3=[];for(var _0x220340 in _0x31c4be[_0x71b3('0x57')]){if(_0x31c4be['faxQueues']['hasOwnProperty'](_0x220340)){var _0x4a5ae5=_0x31c4be['faxQueues'][_0x220340];var _0x358ac7={'id':_0x4a5ae5['id'],'available':_0x4a5ae5['available'],'loggedIn':_0x4a5ae5['loggedIn'],'name':_0x4a5ae5[_0x71b3('0x56')],'paused':_0x4a5ae5[_0x71b3('0x51')],'waiting':_0x4a5ae5['waiting']};_0x3355a3['push'](_0x358ac7);}}_0x468ac9({'count':_0x3355a3[_0x71b3('0x19')],'rows':_0x3355a3});});},'ChatQueuesWaitingInteractions':function(_0x5bf461){return new Promise(function(_0x557a51,_0x243780){var _0x2ec69e=_['values'](_0x31c4be[_0x71b3('0x58')]);_0x557a51({'count':_0x2ec69e[_0x71b3('0x19')],'rows':_0x2ec69e});});},'MailQueuesWaitingInteractions':function(_0x1fa067){return new Promise(function(_0x55fc03,_0x4958f5){var _0x29af0e=_[_0x71b3('0x4d')](_0x31c4be[_0x71b3('0x59')]);_0x55fc03({'count':_0x29af0e[_0x71b3('0x19')],'rows':_0x29af0e});});},'OpenchannelQueuesWaitingInteractions':function(_0x4d5c36){return new Promise(function(_0x34584a,_0x141dcf){var _0x1b37a9=_[_0x71b3('0x4d')](_0x31c4be[_0x71b3('0x5a')]);_0x34584a({'count':_0x1b37a9[_0x71b3('0x19')],'rows':_0x1b37a9});});},'SmsQueuesWaitingInteractions':function(_0x4cf0f3){return new Promise(function(_0x1b78d4,_0x5f57f4){var _0x15976d=_[_0x71b3('0x4d')](_0x31c4be[_0x71b3('0x5b')]);_0x1b78d4({'count':_0x15976d[_0x71b3('0x19')],'rows':_0x15976d});});},'FaxQueuesWaitingInteractions':function(_0x351903){return new Promise(function(_0x3201fa,_0x1dda9c){var _0x11f44b=_['values'](_0x31c4be['faxQueuesWaitingInteractions']);_0x3201fa({'count':_0x11f44b[_0x71b3('0x19')],'rows':_0x11f44b});});}};var _0xf74855=jayson[_0x71b3('0x5c')](_0x1a39c7)[_0x71b3('0x5d')]();_0xf74855['on'](_0x71b3('0x34'),function(_0x58ef8a){logger['error'](JSON['stringify'](_0x58ef8a));return _0x195bcc(_0x58ef8a);});_0xf74855['listen'](0x232c,_0x71b3('0x5e'),function(){console[_0x71b3('0x5f')](_0x71b3('0x60'),0x232c);return _0x22cf5f(_0x71b3('0x61')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 65731b9..a386141 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 _0x104c=['util','bluebird','lodash','routing','client','http','then','error','message','result','catch','condition','[%s][INTERVAL]\x20ROUTING\x20STOPPED','length','push','Command','format','iftime\x20%s','indexOf','true','[%s][INTERVAL]\x20%s','all','some','info','[%s][INTERVAL]\x20%s\x20%s','when','log','join','\x20|\x20','stack'];(function(_0x1a7094,_0xb9437){var _0x4eaffd=function(_0x5444ad){while(--_0x5444ad){_0x1a7094['push'](_0x1a7094['shift']());}};_0x4eaffd(++_0xb9437);}(_0x104c,0x1c2));var _0xc104=function(_0x516e1a,_0x53e314){_0x516e1a=_0x516e1a-0x0;var _0x3bb19d=_0x104c[_0x516e1a];return _0x3bb19d;};'use strict';var util=require(_0xc104('0x0'));var BPromise=require(_0xc104('0x1'));var jayson=require('jayson/promise');var _=require(_0xc104('0x2'));var logger=require('../../../config/logger')(_0xc104('0x3'));var client=jayson[_0xc104('0x4')][_0xc104('0x5')]({'port':0x232a});function request(_0x11514f,_0x46a79c){return new BPromise(function(_0x5bddf1,_0x141229){return client['request'](_0x11514f,_0x46a79c)[_0xc104('0x6')](function(_0x133188){if(_0x133188[_0xc104('0x7')]){return _0x141229(_0x133188[_0xc104('0x7')][_0xc104('0x8')]);}else{return _0x5bddf1(_0x133188[_0xc104('0x9')]);}})[_0xc104('0xa')](function(_0x3611ee){return _0x141229(_0x3611ee);});});}exports[_0xc104('0xb')]=function(_0x73df3f,_0x53b807,_0x4cd042){return function(_0x4bd64c){if(_0x4cd042['rules']&&!_0x4cd042['rules'][_0x73df3f]){logger['info'](_0xc104('0xc'),_0x73df3f);return _0x4bd64c['stop']();}var _0x6c393f=[];for(var _0x55f317=0x0;_0x55f317<_0x53b807[_0xc104('0xd')];_0x55f317+=0x1){_0x6c393f[_0xc104('0xe')](request(_0xc104('0xf'),{'command':util[_0xc104('0x10')](_0xc104('0x11'),_0x53b807[_0x55f317])})[_0xc104('0x6')](function(_0x78571){return _0x78571&&_0x78571[_0xc104('0x8')]&&_0x78571[_0xc104('0x8')][_0xc104('0x12')](_0xc104('0x13'))>=0x0?!![]:![];})['catch'](function(_0x3022c9){logger[_0xc104('0x7')](_0xc104('0x14'),_0x73df3f,_0x53b807[_0x55f317]);}));}BPromise[_0xc104('0x15')](_0x6c393f)['then'](function(_0x14db24){var _0x3d000f=_[_0xc104('0x16')](_0x14db24);logger[_0xc104('0x17')](_0xc104('0x18'),_0x73df3f,_0x53b807['join']('\x20|\x20'),_0x3d000f);_0x4bd64c[_0xc104('0x19')](_0x3d000f);})['catch'](function(_0x204f53){console[_0xc104('0x1a')](_0x204f53);logger['error'](_0xc104('0x18'),_0x73df3f,_0x53b807[_0xc104('0x1b')](_0xc104('0x1c')),_0x204f53[_0xc104('0x1d')]);_0x4bd64c['stop']();});};}; \ No newline at end of file +var _0x8545=['rules','[%s][INTERVAL]\x20ROUTING\x20STOPPED','length','Command','iftime\x20%s','true','[%s][INTERVAL]\x20%s','all','some','info','[%s][INTERVAL]\x20%s\x20%s','\x20|\x20','when','join','stack','util','bluebird','jayson/promise','lodash','../../../config/logger','client','http','request','then','error','message','result','catch','condition'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8545,0x114));var _0x5854=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0x8545[_0x51020b];return _0x371e47;};'use strict';var util=require(_0x5854('0x0'));var BPromise=require(_0x5854('0x1'));var jayson=require(_0x5854('0x2'));var _=require(_0x5854('0x3'));var logger=require(_0x5854('0x4'))('routing');var client=jayson[_0x5854('0x5')][_0x5854('0x6')]({'port':0x232a});function request(_0x5cad2c,_0x1e3edf){return new BPromise(function(_0x5cd4f0,_0x242a06){return client[_0x5854('0x7')](_0x5cad2c,_0x1e3edf)[_0x5854('0x8')](function(_0xc23626){if(_0xc23626[_0x5854('0x9')]){return _0x242a06(_0xc23626[_0x5854('0x9')][_0x5854('0xa')]);}else{return _0x5cd4f0(_0xc23626[_0x5854('0xb')]);}})[_0x5854('0xc')](function(_0x394896){return _0x242a06(_0x394896);});});}exports[_0x5854('0xd')]=function(_0x37e67b,_0x2518c4,_0x5869a5){return function(_0x59f70e){if(_0x5869a5[_0x5854('0xe')]&&!_0x5869a5[_0x5854('0xe')][_0x37e67b]){logger['info'](_0x5854('0xf'),_0x37e67b);return _0x59f70e['stop']();}var _0x1f1d2c=[];for(var _0x1b2b69=0x0;_0x1b2b69<_0x2518c4[_0x5854('0x10')];_0x1b2b69+=0x1){_0x1f1d2c['push'](request(_0x5854('0x11'),{'command':util['format'](_0x5854('0x12'),_0x2518c4[_0x1b2b69])})[_0x5854('0x8')](function(_0x267414){return _0x267414&&_0x267414[_0x5854('0xa')]&&_0x267414[_0x5854('0xa')]['indexOf'](_0x5854('0x13'))>=0x0?!![]:![];})[_0x5854('0xc')](function(_0x4692f8){logger[_0x5854('0x9')](_0x5854('0x14'),_0x37e67b,_0x2518c4[_0x1b2b69]);}));}BPromise[_0x5854('0x15')](_0x1f1d2c)[_0x5854('0x8')](function(_0xabdc8e){var _0x137bfa=_[_0x5854('0x16')](_0xabdc8e);logger[_0x5854('0x17')](_0x5854('0x18'),_0x37e67b,_0x2518c4['join'](_0x5854('0x19')),_0x137bfa);_0x59f70e[_0x5854('0x1a')](_0x137bfa);})[_0x5854('0xc')](function(_0x216749){console['log'](_0x216749);logger[_0x5854('0x9')](_0x5854('0x18'),_0x37e67b,_0x2518c4[_0x5854('0x1b')](_0x5854('0x19')),_0x216749[_0x5854('0x1c')]);_0x59f70e['stop']();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 143aafc..06c5acb 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 _0x7a71=['holdtime','agentconnect','agentconnectAt','connectedlinename','connect','talktime','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','agentcompleteAt','complete','blindtransfer','transfereruniqueid','transfer','transfertype','blind','transferexten','extension','attendedtransfer','secondtransfereruniqueid','origtransfererexten','origtransfereruniqueid','transfereeuniqueid','agententerreason','clone','calleridnum','calleridname','secondtransfererlinkedid','ATTENDED','secondtransfererexten','transferuniqueid','transfertargetuniqueid','hangup','diffTime','agent','lodash','util','./utils','info','uniqueid','membername','connectedlinenum','lastevent','queue','getVoiceQueueByName','then','agentacw','agentcomplete','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','agentcalled','destuniqueid','agentcalledAt','now','called','error','stack','agentringnoanswer','isNil','agentringnoanswerAt','timeout','ringtime','queuecallerabandon','forIn','reason','abandoned'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x7a71,0xad));var _0x17a7=function(_0x194341,_0x142eba){_0x194341=_0x194341-0x0;var _0x1e931d=_0x7a71[_0x194341];return _0x1e931d;};'use strict';var _=require(_0x17a7('0x0'));var util=require(_0x17a7('0x1'));var utils=require(_0x17a7('0x2'));var agents={};var transfers={};function writeDB(_0x534a08,_0x1ec1c9){utils[_0x17a7('0x3')](util['format']('AGENT|%s|%s|%s|%s|%s|%s|%s|%s',_0x534a08[_0x17a7('0x4')],_0x534a08['channel'],_0x534a08['queue'],_0x534a08[_0x17a7('0x5')],_0x534a08['interface'],_0x534a08['calleridnum'],_0x534a08[_0x17a7('0x6')],_0x534a08[_0x17a7('0x7')]));if(_0x534a08[_0x17a7('0x8')]){utils[_0x17a7('0x9')](_0x534a08[_0x17a7('0x8')])[_0x17a7('0xa')](function(_0xc2aa0d){if(_0xc2aa0d){_0x534a08['type']=_0xc2aa0d['type'];_0x534a08[_0x17a7('0xb')]=_0x534a08[_0x17a7('0xc')]?_0xc2aa0d[_0x17a7('0xd')]:![];_0x534a08[_0x17a7('0xe')]=_0x534a08[_0x17a7('0xb')]?_0xc2aa0d[_0x17a7('0xf')]:0x0;}utils[_0x17a7('0x10')](_0x17a7('0x11'),_0x534a08);});}else{utils[_0x17a7('0x10')](_0x17a7('0x11'),_0x534a08);}if(_0x1ec1c9){delete transfers[_0x534a08[_0x17a7('0x4')]];}else{delete agents[_0x534a08['destuniqueid']];}}exports[_0x17a7('0x12')]=function(_0xca5aa){try{agents[_0xca5aa['destuniqueid']]=_0xca5aa;agents[_0xca5aa[_0x17a7('0x13')]][_0x17a7('0x14')]=utils[_0x17a7('0x15')]();agents[_0xca5aa[_0x17a7('0x13')]][_0x17a7('0x7')]=_0x17a7('0x16');agents[_0xca5aa[_0x17a7('0x13')]][_0x17a7('0x6')]=null;agents[_0xca5aa[_0x17a7('0x13')]]['connectedlinename']=null;}catch(_0x4ba057){utils[_0x17a7('0x17')](_0x4ba057[_0x17a7('0x18')]);}};exports[_0x17a7('0x19')]=function(_0x3e02f9){try{if(!_[_0x17a7('0x1a')](agents[_0x3e02f9[_0x17a7('0x13')]])){agents[_0x3e02f9[_0x17a7('0x13')]][_0x17a7('0x19')]=!![];agents[_0x3e02f9[_0x17a7('0x13')]][_0x17a7('0x1b')]=utils['now']();agents[_0x3e02f9[_0x17a7('0x13')]]['lastevent']=_0x17a7('0x1c');agents[_0x3e02f9['destuniqueid']]['reason']=_0x17a7('0x1c');agents[_0x3e02f9[_0x17a7('0x13')]]['holdtime']=_0x3e02f9[_0x17a7('0x1d')]?parseInt(_0x3e02f9['ringtime'])/0x3e8:0x0;agents[_0x3e02f9[_0x17a7('0x13')]]['talktime']=0x0;writeDB(agents[_0x3e02f9[_0x17a7('0x13')]]);}}catch(_0x2dc3cf){utils[_0x17a7('0x17')](_0x2dc3cf[_0x17a7('0x18')]);}};exports[_0x17a7('0x1e')]=function(_0x47afec){try{_[_0x17a7('0x1f')](agents,function(_0x1f99f7,_0x49b855){if(_0x1f99f7[_0x17a7('0x4')]==_0x47afec['uniqueid']){_0x1f99f7[_0x17a7('0x19')]=!![];_0x1f99f7[_0x17a7('0x1b')]=utils[_0x17a7('0x15')]();_0x1f99f7['lastevent']='abandoned';_0x1f99f7[_0x17a7('0x20')]=_0x17a7('0x21');_0x1f99f7[_0x17a7('0x22')]=_0x47afec[_0x17a7('0x22')];_0x1f99f7['talktime']=0x0;writeDB(_0x1f99f7);}});}catch(_0x4ff417){utils['error'](_0x4ff417[_0x17a7('0x18')]);}};exports[_0x17a7('0x23')]=function(_0x394a4d){try{if(agents[_0x394a4d['destuniqueid']]){agents[_0x394a4d[_0x17a7('0x13')]][_0x17a7('0x24')]=utils[_0x17a7('0x15')]();agents[_0x394a4d[_0x17a7('0x13')]][_0x17a7('0x6')]=_0x394a4d[_0x17a7('0x6')];agents[_0x394a4d[_0x17a7('0x13')]][_0x17a7('0x25')]=_0x394a4d[_0x17a7('0x25')];agents[_0x394a4d[_0x17a7('0x13')]][_0x17a7('0x22')]=_0x394a4d[_0x17a7('0x1d')];agents[_0x394a4d['destuniqueid']][_0x17a7('0x7')]=_0x17a7('0x26');_[_0x17a7('0x1f')](agents,function(_0x5e9e12,_0x4d77ee){if(_0x5e9e12[_0x17a7('0x13')]!=_0x394a4d[_0x17a7('0x13')]&&_0x5e9e12[_0x17a7('0x4')]==_0x394a4d['uniqueid']){_0x5e9e12[_0x17a7('0x27')]=0x0;_0x5e9e12['holdtime']=_0x394a4d[_0x17a7('0x1d')];_0x5e9e12[_0x17a7('0x19')]=!![];_0x5e9e12[_0x17a7('0x1b')]=utils[_0x17a7('0x15')]();_0x5e9e12['lastevent']=_0x17a7('0x28');_0x5e9e12[_0x17a7('0x20')]=_0x17a7('0x28');_0x5e9e12[_0x17a7('0x29')]=_0x394a4d['destuniqueid'];_0x5e9e12[_0x17a7('0x2a')]=_0x394a4d[_0x17a7('0x5')];writeDB(_0x5e9e12);}});}}catch(_0x2704f4){utils[_0x17a7('0x17')](_0x2704f4['stack']);}};exports[_0x17a7('0xc')]=function(_0x357670){try{if(!_[_0x17a7('0x1a')](agents[_0x357670['destuniqueid']])){agents[_0x357670[_0x17a7('0x13')]][_0x17a7('0xc')]=!![];agents[_0x357670['destuniqueid']][_0x17a7('0x2b')]=utils['now']();agents[_0x357670[_0x17a7('0x13')]]['talktime']=utils['diffTime'](agents[_0x357670['destuniqueid']][_0x17a7('0x2b')],agents[_0x357670[_0x17a7('0x13')]][_0x17a7('0x24')]);agents[_0x357670[_0x17a7('0x13')]]['reason']=_0x357670[_0x17a7('0x20')];agents[_0x357670[_0x17a7('0x13')]][_0x17a7('0x7')]=_0x17a7('0x2c');writeDB(agents[_0x357670[_0x17a7('0x13')]]);}}catch(_0x269ded){utils['error'](_0x269ded[_0x17a7('0x18')]);}};exports[_0x17a7('0x2d')]=function(_0xc5e825){try{if(!_[_0x17a7('0x1a')](agents[_0xc5e825[_0x17a7('0x2e')]])){agents[_0xc5e825[_0x17a7('0x2e')]][_0x17a7('0x2f')]=!![];agents[_0xc5e825[_0x17a7('0x2e')]][_0x17a7('0x30')]=_0x17a7('0x31');agents[_0xc5e825[_0x17a7('0x2e')]][_0x17a7('0x32')]=_0xc5e825[_0x17a7('0x33')];agents[_0xc5e825[_0x17a7('0x2e')]]['transferuniqueid']=agents[_0xc5e825[_0x17a7('0x2e')]]['uniqueid'];}}catch(_0xd32294){utils['error'](_0xd32294[_0x17a7('0x18')]);}};exports[_0x17a7('0x34')]=function(_0x5e5c0b){try{if(_0x5e5c0b['origtransfereruniqueid']==_0x5e5c0b['origtransfererlinkedid']){if(!_[_0x17a7('0x1a')](agents[_0x5e5c0b[_0x17a7('0x35')]])){agents[_0x5e5c0b[_0x17a7('0x35')]][_0x17a7('0x2f')]=!![];agents[_0x5e5c0b[_0x17a7('0x35')]][_0x17a7('0x30')]='ATTENDED';agents[_0x5e5c0b[_0x17a7('0x35')]][_0x17a7('0x32')]=_0x5e5c0b[_0x17a7('0x36')];agents[_0x5e5c0b[_0x17a7('0x35')]]['transferuniqueid']=_0x5e5c0b[_0x17a7('0x37')];}if(_0x5e5c0b['transfereeuniqueid']&&agents[_0x5e5c0b[_0x17a7('0x38')]]){agents[_0x5e5c0b[_0x17a7('0x38')]][_0x17a7('0x39')]=0x1;transfers[_0x5e5c0b[_0x17a7('0x38')]]=_[_0x17a7('0x3a')](agents[_0x5e5c0b[_0x17a7('0x38')]]);transfers[_0x5e5c0b[_0x17a7('0x38')]][_0x17a7('0x3b')]=agents[_0x5e5c0b[_0x17a7('0x35')]]['calleridnum'];transfers[_0x5e5c0b['transfereeuniqueid']]['calleridname']=agents[_0x5e5c0b[_0x17a7('0x35')]][_0x17a7('0x3c')];transfers[_0x5e5c0b[_0x17a7('0x38')]][_0x17a7('0x14')]=utils[_0x17a7('0x15')]();transfers[_0x5e5c0b[_0x17a7('0x38')]][_0x17a7('0x24')]=utils[_0x17a7('0x15')]();transfers[_0x5e5c0b[_0x17a7('0x38')]]['holdtime']=0x0;transfers[_0x5e5c0b[_0x17a7('0x38')]][_0x17a7('0x39')]=0x2;}}else if(_0x5e5c0b['secondtransfereruniqueid']==_0x5e5c0b[_0x17a7('0x3d')]){if(!_[_0x17a7('0x1a')](agents[_0x5e5c0b[_0x17a7('0x37')]])){agents[_0x5e5c0b[_0x17a7('0x37')]]['transfer']=!![];agents[_0x5e5c0b['origtransfereruniqueid']]['transfertype']=_0x17a7('0x3e');agents[_0x5e5c0b[_0x17a7('0x37')]]['transferexten']=_0x5e5c0b[_0x17a7('0x3f')];agents[_0x5e5c0b[_0x17a7('0x37')]][_0x17a7('0x40')]=_0x5e5c0b[_0x17a7('0x35')];}if(_0x5e5c0b['transfertargetuniqueid']&&agents[_0x5e5c0b[_0x17a7('0x41')]]){agents[_0x5e5c0b[_0x17a7('0x41')]][_0x17a7('0x39')]=0x1;transfers[_0x5e5c0b[_0x17a7('0x41')]]=_[_0x17a7('0x3a')](agents[_0x5e5c0b[_0x17a7('0x41')]]);transfers[_0x5e5c0b[_0x17a7('0x41')]][_0x17a7('0x3b')]=agents[_0x5e5c0b[_0x17a7('0x37')]][_0x17a7('0x3b')];transfers[_0x5e5c0b['transfertargetuniqueid']][_0x17a7('0x3c')]=agents[_0x5e5c0b[_0x17a7('0x37')]][_0x17a7('0x3c')];transfers[_0x5e5c0b[_0x17a7('0x41')]][_0x17a7('0x14')]=utils[_0x17a7('0x15')]();transfers[_0x5e5c0b['transfertargetuniqueid']][_0x17a7('0x24')]=utils[_0x17a7('0x15')]();transfers[_0x5e5c0b[_0x17a7('0x41')]]['holdtime']=0x0;transfers[_0x5e5c0b[_0x17a7('0x41')]][_0x17a7('0x39')]=0x2;}}}catch(_0x3f5a8c){utils[_0x17a7('0x17')](_0x3f5a8c['stack']);}};exports[_0x17a7('0x42')]=function(_0x2bb86e){try{if(transfers[_0x2bb86e['uniqueid']]){transfers[_0x2bb86e[_0x17a7('0x4')]]['agentcomplete']=!![];transfers[_0x2bb86e[_0x17a7('0x4')]]['agentcompleteAt']=utils[_0x17a7('0x15')]();transfers[_0x2bb86e['uniqueid']][_0x17a7('0x27')]=utils[_0x17a7('0x43')](transfers[_0x2bb86e['uniqueid']]['agentcompleteAt'],transfers[_0x2bb86e['uniqueid']][_0x17a7('0x24')]);transfers[_0x2bb86e['uniqueid']]['reason']='agent';transfers[_0x2bb86e['uniqueid']][_0x17a7('0x7')]='complete';writeDB(transfers[_0x2bb86e[_0x17a7('0x4')]],!![]);}if(agents[_0x2bb86e[_0x17a7('0x4')]]&&agents[_0x2bb86e[_0x17a7('0x4')]]['agentconnectAt']){agents[_0x2bb86e[_0x17a7('0x4')]][_0x17a7('0xc')]=!![];agents[_0x2bb86e[_0x17a7('0x4')]][_0x17a7('0x2b')]=utils[_0x17a7('0x15')]();agents[_0x2bb86e[_0x17a7('0x4')]][_0x17a7('0x27')]=utils[_0x17a7('0x43')](agents[_0x2bb86e['uniqueid']][_0x17a7('0x2b')],agents[_0x2bb86e[_0x17a7('0x4')]][_0x17a7('0x24')]);agents[_0x2bb86e[_0x17a7('0x4')]][_0x17a7('0x20')]=agents[_0x2bb86e[_0x17a7('0x4')]][_0x17a7('0x2f')]?_0x17a7('0x2f'):_0x17a7('0x44');agents[_0x2bb86e[_0x17a7('0x4')]]['lastevent']=_0x17a7('0x2c');writeDB(agents[_0x2bb86e[_0x17a7('0x4')]]);}}catch(_0x2a4fba){utils['error'](_0x2a4fba[_0x17a7('0x18')]);}}; \ No newline at end of file +var _0xbac1=['agentacw','agentcomplete','acwtime','acwTimeout','request','CreateVoiceAgentReport','agentcalled','destuniqueid','agentcalledAt','now','error','isNil','agentringnoanswerAt','timeout','reason','ringtime','stack','forIn','agentringnoanswer','abandoned','holdtime','agentconnect','connectedlinename','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','agentcompleteAt','talktime','diffTime','agentconnectAt','complete','transfereruniqueid','transfer','transfertype','blind','transferuniqueid','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','transfereeuniqueid','clone','calleridnum','calleridname','agententerreason','secondtransfererlinkedid','ATTENDED','transferexten','secondtransfererexten','transfertargetuniqueid','hangup','agent','util','./utils','info','format','uniqueid','channel','queue','membername','connectedlinenum','lastevent','getVoiceQueueByName','then','type'];(function(_0x1f38c6,_0x428650){var _0x259367=function(_0x22bad0){while(--_0x22bad0){_0x1f38c6['push'](_0x1f38c6['shift']());}};_0x259367(++_0x428650);}(_0xbac1,0x17f));var _0x1bac=function(_0x2d001c,_0x147632){_0x2d001c=_0x2d001c-0x0;var _0x4a4085=_0xbac1[_0x2d001c];return _0x4a4085;};'use strict';var _=require('lodash');var util=require(_0x1bac('0x0'));var utils=require(_0x1bac('0x1'));var agents={};var transfers={};function writeDB(_0xc0b021,_0x761710){utils[_0x1bac('0x2')](util[_0x1bac('0x3')]('AGENT|%s|%s|%s|%s|%s|%s|%s|%s',_0xc0b021[_0x1bac('0x4')],_0xc0b021[_0x1bac('0x5')],_0xc0b021[_0x1bac('0x6')],_0xc0b021[_0x1bac('0x7')],_0xc0b021['interface'],_0xc0b021['calleridnum'],_0xc0b021[_0x1bac('0x8')],_0xc0b021[_0x1bac('0x9')]));if(_0xc0b021['queue']){utils[_0x1bac('0xa')](_0xc0b021[_0x1bac('0x6')])[_0x1bac('0xb')](function(_0x4c0b14){if(_0x4c0b14){_0xc0b021[_0x1bac('0xc')]=_0x4c0b14[_0x1bac('0xc')];_0xc0b021[_0x1bac('0xd')]=_0xc0b021[_0x1bac('0xe')]?_0x4c0b14['acw']:![];_0xc0b021[_0x1bac('0xf')]=_0xc0b021[_0x1bac('0xd')]?_0x4c0b14[_0x1bac('0x10')]:0x0;}utils[_0x1bac('0x11')](_0x1bac('0x12'),_0xc0b021);});}else{utils[_0x1bac('0x11')](_0x1bac('0x12'),_0xc0b021);}if(_0x761710){delete transfers[_0xc0b021[_0x1bac('0x4')]];}else{delete agents[_0xc0b021['destuniqueid']];}}exports[_0x1bac('0x13')]=function(_0x51b8de){try{agents[_0x51b8de['destuniqueid']]=_0x51b8de;agents[_0x51b8de[_0x1bac('0x14')]][_0x1bac('0x15')]=utils[_0x1bac('0x16')]();agents[_0x51b8de[_0x1bac('0x14')]][_0x1bac('0x9')]='called';agents[_0x51b8de[_0x1bac('0x14')]]['connectedlinenum']=null;agents[_0x51b8de[_0x1bac('0x14')]]['connectedlinename']=null;}catch(_0x47c516){utils[_0x1bac('0x17')](_0x47c516['stack']);}};exports['agentringnoanswer']=function(_0xf57821){try{if(!_[_0x1bac('0x18')](agents[_0xf57821[_0x1bac('0x14')]])){agents[_0xf57821[_0x1bac('0x14')]]['agentringnoanswer']=!![];agents[_0xf57821['destuniqueid']][_0x1bac('0x19')]=utils[_0x1bac('0x16')]();agents[_0xf57821[_0x1bac('0x14')]][_0x1bac('0x9')]=_0x1bac('0x1a');agents[_0xf57821['destuniqueid']][_0x1bac('0x1b')]=_0x1bac('0x1a');agents[_0xf57821[_0x1bac('0x14')]]['holdtime']=_0xf57821[_0x1bac('0x1c')]?parseInt(_0xf57821[_0x1bac('0x1c')])/0x3e8:0x0;agents[_0xf57821[_0x1bac('0x14')]]['talktime']=0x0;writeDB(agents[_0xf57821[_0x1bac('0x14')]]);}}catch(_0x57a5e3){utils[_0x1bac('0x17')](_0x57a5e3[_0x1bac('0x1d')]);}};exports['queuecallerabandon']=function(_0x3296f0){try{_[_0x1bac('0x1e')](agents,function(_0x3b3902,_0xf23a27){if(_0x3b3902[_0x1bac('0x4')]==_0x3296f0[_0x1bac('0x4')]){_0x3b3902[_0x1bac('0x1f')]=!![];_0x3b3902[_0x1bac('0x19')]=utils[_0x1bac('0x16')]();_0x3b3902[_0x1bac('0x9')]=_0x1bac('0x20');_0x3b3902[_0x1bac('0x1b')]=_0x1bac('0x20');_0x3b3902[_0x1bac('0x21')]=_0x3296f0[_0x1bac('0x21')];_0x3b3902['talktime']=0x0;writeDB(_0x3b3902);}});}catch(_0x388faf){utils[_0x1bac('0x17')](_0x388faf['stack']);}};exports[_0x1bac('0x22')]=function(_0xf0eebc){try{if(agents[_0xf0eebc['destuniqueid']]){agents[_0xf0eebc[_0x1bac('0x14')]]['agentconnectAt']=utils[_0x1bac('0x16')]();agents[_0xf0eebc[_0x1bac('0x14')]][_0x1bac('0x8')]=_0xf0eebc['connectedlinenum'];agents[_0xf0eebc[_0x1bac('0x14')]][_0x1bac('0x23')]=_0xf0eebc[_0x1bac('0x23')];agents[_0xf0eebc['destuniqueid']]['holdtime']=_0xf0eebc[_0x1bac('0x1c')];agents[_0xf0eebc['destuniqueid']]['lastevent']=_0x1bac('0x24');_[_0x1bac('0x1e')](agents,function(_0x1200d4,_0x5dec3b){if(_0x1200d4[_0x1bac('0x14')]!=_0xf0eebc[_0x1bac('0x14')]&&_0x1200d4[_0x1bac('0x4')]==_0xf0eebc[_0x1bac('0x4')]){_0x1200d4['talktime']=0x0;_0x1200d4['holdtime']=_0xf0eebc[_0x1bac('0x1c')];_0x1200d4['agentringnoanswer']=!![];_0x1200d4[_0x1bac('0x19')]=utils['now']();_0x1200d4[_0x1bac('0x9')]=_0x1bac('0x25');_0x1200d4[_0x1bac('0x1b')]=_0x1bac('0x25');_0x1200d4[_0x1bac('0x26')]=_0xf0eebc['destuniqueid'];_0x1200d4[_0x1bac('0x27')]=_0xf0eebc['membername'];writeDB(_0x1200d4);}});}}catch(_0x56570f){utils[_0x1bac('0x17')](_0x56570f[_0x1bac('0x1d')]);}};exports[_0x1bac('0xe')]=function(_0x5b50cc){try{if(!_[_0x1bac('0x18')](agents[_0x5b50cc[_0x1bac('0x14')]])){agents[_0x5b50cc[_0x1bac('0x14')]][_0x1bac('0xe')]=!![];agents[_0x5b50cc[_0x1bac('0x14')]][_0x1bac('0x28')]=utils[_0x1bac('0x16')]();agents[_0x5b50cc['destuniqueid']][_0x1bac('0x29')]=utils[_0x1bac('0x2a')](agents[_0x5b50cc[_0x1bac('0x14')]][_0x1bac('0x28')],agents[_0x5b50cc['destuniqueid']][_0x1bac('0x2b')]);agents[_0x5b50cc[_0x1bac('0x14')]][_0x1bac('0x1b')]=_0x5b50cc[_0x1bac('0x1b')];agents[_0x5b50cc[_0x1bac('0x14')]][_0x1bac('0x9')]=_0x1bac('0x2c');writeDB(agents[_0x5b50cc[_0x1bac('0x14')]]);}}catch(_0x22680b){utils[_0x1bac('0x17')](_0x22680b[_0x1bac('0x1d')]);}};exports['blindtransfer']=function(_0x2b89e3){try{if(!_['isNil'](agents[_0x2b89e3[_0x1bac('0x2d')]])){agents[_0x2b89e3[_0x1bac('0x2d')]][_0x1bac('0x2e')]=!![];agents[_0x2b89e3[_0x1bac('0x2d')]][_0x1bac('0x2f')]=_0x1bac('0x30');agents[_0x2b89e3['transfereruniqueid']]['transferexten']=_0x2b89e3['extension'];agents[_0x2b89e3[_0x1bac('0x2d')]][_0x1bac('0x31')]=agents[_0x2b89e3[_0x1bac('0x2d')]][_0x1bac('0x4')];}}catch(_0x35229c){utils[_0x1bac('0x17')](_0x35229c[_0x1bac('0x1d')]);}};exports[_0x1bac('0x32')]=function(_0x208b9a){try{if(_0x208b9a[_0x1bac('0x33')]==_0x208b9a[_0x1bac('0x34')]){if(!_[_0x1bac('0x18')](agents[_0x208b9a[_0x1bac('0x35')]])){agents[_0x208b9a['secondtransfereruniqueid']][_0x1bac('0x2e')]=!![];agents[_0x208b9a[_0x1bac('0x35')]][_0x1bac('0x2f')]='ATTENDED';agents[_0x208b9a[_0x1bac('0x35')]]['transferexten']=_0x208b9a['origtransfererexten'];agents[_0x208b9a[_0x1bac('0x35')]]['transferuniqueid']=_0x208b9a[_0x1bac('0x33')];}if(_0x208b9a[_0x1bac('0x36')]&&agents[_0x208b9a[_0x1bac('0x36')]]){agents[_0x208b9a[_0x1bac('0x36')]]['agententerreason']=0x1;transfers[_0x208b9a[_0x1bac('0x36')]]=_[_0x1bac('0x37')](agents[_0x208b9a['transfereeuniqueid']]);transfers[_0x208b9a['transfereeuniqueid']]['calleridnum']=agents[_0x208b9a[_0x1bac('0x35')]][_0x1bac('0x38')];transfers[_0x208b9a[_0x1bac('0x36')]][_0x1bac('0x39')]=agents[_0x208b9a[_0x1bac('0x35')]][_0x1bac('0x39')];transfers[_0x208b9a[_0x1bac('0x36')]][_0x1bac('0x15')]=utils['now']();transfers[_0x208b9a['transfereeuniqueid']]['agentconnectAt']=utils['now']();transfers[_0x208b9a[_0x1bac('0x36')]]['holdtime']=0x0;transfers[_0x208b9a[_0x1bac('0x36')]][_0x1bac('0x3a')]=0x2;}}else if(_0x208b9a[_0x1bac('0x35')]==_0x208b9a[_0x1bac('0x3b')]){if(!_['isNil'](agents[_0x208b9a['origtransfereruniqueid']])){agents[_0x208b9a[_0x1bac('0x33')]]['transfer']=!![];agents[_0x208b9a['origtransfereruniqueid']]['transfertype']=_0x1bac('0x3c');agents[_0x208b9a[_0x1bac('0x33')]][_0x1bac('0x3d')]=_0x208b9a[_0x1bac('0x3e')];agents[_0x208b9a[_0x1bac('0x33')]][_0x1bac('0x31')]=_0x208b9a['secondtransfereruniqueid'];}if(_0x208b9a[_0x1bac('0x3f')]&&agents[_0x208b9a[_0x1bac('0x3f')]]){agents[_0x208b9a['transfertargetuniqueid']]['agententerreason']=0x1;transfers[_0x208b9a['transfertargetuniqueid']]=_[_0x1bac('0x37')](agents[_0x208b9a['transfertargetuniqueid']]);transfers[_0x208b9a[_0x1bac('0x3f')]][_0x1bac('0x38')]=agents[_0x208b9a[_0x1bac('0x33')]][_0x1bac('0x38')];transfers[_0x208b9a[_0x1bac('0x3f')]][_0x1bac('0x39')]=agents[_0x208b9a['origtransfereruniqueid']]['calleridname'];transfers[_0x208b9a['transfertargetuniqueid']][_0x1bac('0x15')]=utils[_0x1bac('0x16')]();transfers[_0x208b9a[_0x1bac('0x3f')]]['agentconnectAt']=utils[_0x1bac('0x16')]();transfers[_0x208b9a[_0x1bac('0x3f')]][_0x1bac('0x21')]=0x0;transfers[_0x208b9a[_0x1bac('0x3f')]]['agententerreason']=0x2;}}}catch(_0x8c0a3d){utils[_0x1bac('0x17')](_0x8c0a3d[_0x1bac('0x1d')]);}};exports[_0x1bac('0x40')]=function(_0x1478cc){try{if(transfers[_0x1478cc[_0x1bac('0x4')]]){transfers[_0x1478cc[_0x1bac('0x4')]][_0x1bac('0xe')]=!![];transfers[_0x1478cc['uniqueid']][_0x1bac('0x28')]=utils[_0x1bac('0x16')]();transfers[_0x1478cc[_0x1bac('0x4')]][_0x1bac('0x29')]=utils[_0x1bac('0x2a')](transfers[_0x1478cc[_0x1bac('0x4')]]['agentcompleteAt'],transfers[_0x1478cc['uniqueid']][_0x1bac('0x2b')]);transfers[_0x1478cc[_0x1bac('0x4')]]['reason']=_0x1bac('0x41');transfers[_0x1478cc[_0x1bac('0x4')]]['lastevent']=_0x1bac('0x2c');writeDB(transfers[_0x1478cc[_0x1bac('0x4')]],!![]);}if(agents[_0x1478cc['uniqueid']]&&agents[_0x1478cc[_0x1bac('0x4')]][_0x1bac('0x2b')]){agents[_0x1478cc['uniqueid']][_0x1bac('0xe')]=!![];agents[_0x1478cc[_0x1bac('0x4')]][_0x1bac('0x28')]=utils[_0x1bac('0x16')]();agents[_0x1478cc['uniqueid']][_0x1bac('0x29')]=utils[_0x1bac('0x2a')](agents[_0x1478cc['uniqueid']][_0x1bac('0x28')],agents[_0x1478cc[_0x1bac('0x4')]]['agentconnectAt']);agents[_0x1478cc[_0x1bac('0x4')]][_0x1bac('0x1b')]=agents[_0x1478cc[_0x1bac('0x4')]]['transfer']?_0x1bac('0x2e'):_0x1bac('0x41');agents[_0x1478cc[_0x1bac('0x4')]]['lastevent']='complete';writeDB(agents[_0x1478cc[_0x1bac('0x4')]]);}}catch(_0x345113){utils['error'](_0x345113[_0x1bac('0x1d')]);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 8519180..4825cc3 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 _0x8386=['musiconholdstart','musiconholdstartAt','musiconholdstop','varset','variable','xmd-originatecalleridnum','value','\x22\x20<','xmd-callerid-preview','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','queue','xmd-contactid','ContactId','xmd-cdrtype','type','sipcallid','toLowerCase','set','startsWith','appdata','cdr','split','lastIndexOf','hangup','noop','execif','gotoif','application','lodash','./utils','NO\x20ANSWER','FAILED','ANSWERED','BUSY','format','uniqueid','channel','source','destination','callerid','accountcode','then','UserId','request','CreateVoiceCallReport','newchannel','linkedid','OutgoingSpoolFailed','calleridnum','exten','context','DOCUMENTATION','stack','newstate','isNil','channelstate','systemanswertime','now','transfer','destinationchannel','answertime','toNumber','error','calleridname','endtime','duration','starttime','diffTime','attendedtransfer','localtwolinkedid','transfereechannel','secondtransfererchannel','userfield','transfertargetchannel','origtransfererchannel','_attended'];(function(_0x19c860,_0x568e76){var _0x25aa01=function(_0x40be14){while(--_0x40be14){_0x19c860['push'](_0x19c860['shift']());}};_0x25aa01(++_0x568e76);}(_0x8386,0x110));var _0x6838=function(_0x152953,_0x6ba428){_0x152953=_0x152953-0x0;var _0x9748a0=_0x8386[_0x152953];return _0x9748a0;};'use strict';var _=require(_0x6838('0x0'));var util=require('util');var utils=require(_0x6838('0x1'));var dispositions=[_0x6838('0x2'),_0x6838('0x3'),_0x6838('0x3'),_0x6838('0x2'),'NO\x20ANSWER','NO\x20ANSWER',_0x6838('0x4'),_0x6838('0x5'),_0x6838('0x3'),_0x6838('0x3'),'FAILED'];var channels={};function writeDB(_0x5c9f7c){utils['info'](util[_0x6838('0x6')]('CALL|%s|%s|%s|%s|%s|%s|%s|%s',_0x5c9f7c[_0x6838('0x7')],_0x5c9f7c[_0x6838('0x8')],_0x5c9f7c['type'],_0x5c9f7c['accountcode'],_0x5c9f7c[_0x6838('0x9')],_0x5c9f7c[_0x6838('0xa')],_0x5c9f7c[_0x6838('0xb')],_0x5c9f7c['disposition']));if(_0x5c9f7c['accountcode']){utils['getUserByInternal'](_0x5c9f7c[_0x6838('0xc')])[_0x6838('0xd')](function(_0x150078){if(_0x150078){_0x5c9f7c[_0x6838('0xe')]=_0x150078['id'];}utils[_0x6838('0xf')]('CreateVoiceCallReport',_0x5c9f7c);});}else{utils[_0x6838('0xf')](_0x6838('0x10'),_0x5c9f7c);}if(channels[_0x5c9f7c[_0x6838('0x7')]]){delete channels[_0x5c9f7c[_0x6838('0x7')]];}}exports[_0x6838('0x11')]=function(_0x32d675){try{if(_0x32d675[_0x6838('0x7')]==_0x32d675[_0x6838('0x12')]&&_0x32d675[_0x6838('0x8')]!=_0x6838('0x13')){channels[_0x32d675[_0x6838('0x7')]]={'uniqueid':_0x32d675['uniqueid'],'accountcode':_0x32d675[_0x6838('0xc')],'source':_0x32d675[_0x6838('0x14')],'destination':_0x32d675[_0x6838('0x15')],'destinationcontext':_0x32d675[_0x6838('0x16')],'channel':_0x32d675[_0x6838('0x8')],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0x6838('0x17')};}}catch(_0x5aaf9f){utils['error'](_0x5aaf9f[_0x6838('0x18')]);}};exports[_0x6838('0x19')]=function(_0x28f074){try{if(!_[_0x6838('0x1a')](channels[_0x28f074[_0x6838('0x7')]])&&_0x28f074[_0x6838('0x1b')]==0x6){if(_[_0x6838('0x1a')](channels[_0x28f074[_0x6838('0x7')]][_0x6838('0x1c')])){channels[_0x28f074['uniqueid']][_0x6838('0x1c')]=utils[_0x6838('0x1d')]();}}else if(!_[_0x6838('0x1a')](channels[_0x28f074['linkedid']])&&_0x28f074[_0x6838('0x1b')]==0x6&&_0x28f074[_0x6838('0x16')]!=_0x6838('0x1e')){channels[_0x28f074['linkedid']][_0x6838('0xc')]=_0x28f074['accountcode'];channels[_0x28f074[_0x6838('0x12')]][_0x6838('0x1f')]=_0x28f074[_0x6838('0x8')];if(_[_0x6838('0x1a')](channels[_0x28f074[_0x6838('0x12')]][_0x6838('0x20')])){channels[_0x28f074[_0x6838('0x12')]][_0x6838('0x20')]=utils[_0x6838('0x1d')]();}channels[_0x28f074[_0x6838('0x12')]]['disposition']=dispositions[_[_0x6838('0x21')](_0x28f074[_0x6838('0x1b')])]||_0x6838('0x4');}}catch(_0x253343){utils[_0x6838('0x22')](_0x253343[_0x6838('0x18')]);}};exports['hangup']=function(_0x4a1007){try{if(!_[_0x6838('0x1a')](channels[_0x4a1007[_0x6838('0x7')]])){if(_[_0x6838('0x1a')](channels[_0x4a1007[_0x6838('0x7')]][_0x6838('0xb')])){channels[_0x4a1007[_0x6838('0x7')]]['callerid']=_0x4a1007[_0x6838('0x23')]+'\x20<'+_0x4a1007[_0x6838('0x14')]+'>';}channels[_0x4a1007[_0x6838('0x7')]][_0x6838('0x24')]=utils[_0x6838('0x1d')]();channels[_0x4a1007['uniqueid']][_0x6838('0x25')]=utils['diffTime'](channels[_0x4a1007[_0x6838('0x7')]][_0x6838('0x24')],channels[_0x4a1007[_0x6838('0x7')]][_0x6838('0x26')]);channels[_0x4a1007['uniqueid']]['billableseconds']=channels[_0x4a1007['uniqueid']][_0x6838('0x20')]?utils[_0x6838('0x27')](channels[_0x4a1007['uniqueid']][_0x6838('0x24')],channels[_0x4a1007[_0x6838('0x7')]][_0x6838('0x20')]):0x0;writeDB(channels[_0x4a1007[_0x6838('0x7')]]);}}catch(_0x1551bc){utils[_0x6838('0x22')](_0x1551bc[_0x6838('0x18')]);}};exports[_0x6838('0x28')]=function(_0x3e05b7){try{if(!_[_0x6838('0x1a')](channels[_0x3e05b7[_0x6838('0x29')]])){if(channels[_0x3e05b7[_0x6838('0x29')]][_0x6838('0x8')]==_0x3e05b7[_0x6838('0x2a')]){channels[_0x3e05b7['localtwolinkedid']][_0x6838('0x1f')]=_0x3e05b7[_0x6838('0x2b')];channels[_0x3e05b7[_0x6838('0x29')]][_0x6838('0x2c')]='_attended';}else if(channels[_0x3e05b7[_0x6838('0x29')]]['channel']=_0x3e05b7[_0x6838('0x2d')]){channels[_0x3e05b7['localtwolinkedid']][_0x6838('0x1f')]=_0x3e05b7[_0x6838('0x2e')];channels[_0x3e05b7['localtwolinkedid']]['userfield']=_0x6838('0x2f');}}}catch(_0x5900ca){utils[_0x6838('0x22')](_0x5900ca['stack']);}};exports[_0x6838('0x30')]=function(_0x2f6fda){try{if(!_['isNil'](channels[_0x2f6fda[_0x6838('0x7')]])){channels[_0x2f6fda['uniqueid']][_0x6838('0x31')]=utils[_0x6838('0x1d')]();}}catch(_0x359457){utils[_0x6838('0x22')](_0x359457[_0x6838('0x18')]);}};exports[_0x6838('0x32')]=function(_0x517e10){try{if(!_[_0x6838('0x1a')](channels[_0x517e10[_0x6838('0x7')]])){if(!_[_0x6838('0x1a')](channels[_0x517e10[_0x6838('0x7')]]['musiconholdstartAt'])){channels[_0x517e10[_0x6838('0x7')]]['mohtime']+=utils[_0x6838('0x27')](utils['now'](),channels[_0x517e10[_0x6838('0x7')]]['musiconholdstartAt']);delete channels[_0x517e10[_0x6838('0x7')]][_0x6838('0x31')];}}}catch(_0x46a94b){utils[_0x6838('0x22')](_0x46a94b[_0x6838('0x18')]);}};exports[_0x6838('0x33')]=function(_0xf56a21){try{if(!_['isNil'](channels[_0xf56a21[_0x6838('0x7')]])){if(!_[_0x6838('0x1a')](_0xf56a21[_0x6838('0x34')][_0x6838('0x35')])){channels[_0xf56a21[_0x6838('0x7')]]['source']=_0xf56a21[_0x6838('0x36')];}if(!_[_0x6838('0x1a')](_0xf56a21[_0x6838('0x34')]['xmd-phone'])){channels[_0xf56a21[_0x6838('0x7')]]['destination']=_0xf56a21[_0x6838('0x36')];channels[_0xf56a21[_0x6838('0x7')]][_0x6838('0xb')]='\x22'+_0xf56a21[_0x6838('0x36')]+_0x6838('0x37')+_0xf56a21['value']+'>';}if(!_[_0x6838('0x1a')](_0xf56a21[_0x6838('0x34')][_0x6838('0x38')])||!_[_0x6838('0x1a')](_0xf56a21[_0x6838('0x34')]['xmd-callerid'])){channels[_0xf56a21[_0x6838('0x7')]]['callerid']=_0xf56a21['value'];}if(!_['isNil'](_0xf56a21['variable'][_0x6838('0x39')])||!_[_0x6838('0x1a')](_0xf56a21[_0x6838('0x34')][_0x6838('0x3a')])){channels[_0xf56a21[_0x6838('0x7')]][_0x6838('0x3b')]=_0x6838('0x3c');channels[_0xf56a21[_0x6838('0x7')]][_0x6838('0x3d')]=_0xf56a21[_0x6838('0x36')];channels[_0xf56a21[_0x6838('0x7')]][_0x6838('0x3e')]=!![];}if(!_[_0x6838('0x1a')](_0xf56a21['variable'][_0x6838('0x3f')])){channels[_0xf56a21[_0x6838('0x7')]][_0x6838('0x40')]=_0xf56a21[_0x6838('0x36')];}if(!_['isNil'](_0xf56a21[_0x6838('0x34')][_0x6838('0x41')])){channels[_0xf56a21[_0x6838('0x7')]][_0x6838('0x42')]=_0xf56a21[_0x6838('0x36')];}if(!_['isNil'](_0xf56a21['variable']['outboundrouteid'])){channels[_0xf56a21['uniqueid']]['routeid']=_0xf56a21[_0x6838('0x36')];}if(!_[_0x6838('0x1a')](_0xf56a21['variable'][_0x6838('0x43')])){channels[_0xf56a21['uniqueid']][_0x6838('0x43')]=_0xf56a21[_0x6838('0x36')];}}}catch(_0x4248d4){utils['error'](_0x4248d4[_0x6838('0x18')]);}};exports['newexten']=function(_0x225b87){try{if(!_[_0x6838('0x1a')](channels[_0x225b87[_0x6838('0x7')]])){if(_0x225b87['application'][_0x6838('0x44')]()==_0x6838('0x45')&&_[_0x6838('0x46')](_0x225b87[_0x6838('0x47')]['toLowerCase'](),_0x6838('0x48'))){var _0x221342=_0x225b87['appdata'][_0x6838('0x49')]('=');var _0x3a3605=_0x221342[0x0]['substring'](_0x221342[0x0][_0x6838('0x4a')]('(')+0x1,_0x221342[0x0][_0x6838('0x4a')](')'));var _0x34b8fc=_0x221342[0x1];channels[_0x225b87[_0x6838('0x7')]][_0x3a3605]=_0x34b8fc;}if(!_['includes']([_0x6838('0x4b'),_0x6838('0x4c'),_0x6838('0x4d'),_0x6838('0x45'),_0x6838('0x4e')],_0x225b87[_0x6838('0x4f')][_0x6838('0x44')]())){channels[_0x225b87[_0x6838('0x7')]][_0x6838('0x3b')]=_0x225b87[_0x6838('0x4f')];channels[_0x225b87[_0x6838('0x7')]][_0x6838('0x3d')]=_0x225b87['appdata'];}}}catch(_0x253511){utils[_0x6838('0x22')](_0x253511[_0x6838('0x18')]);}}; \ No newline at end of file +var _0x6b68=['request','linkedid','calleridnum','error','stack','newstate','isNil','channelstate','systemanswertime','now','context','transfer','destinationchannel','answertime','toNumber','ANSWERED','hangup','calleridname','endtime','duration','diffTime','starttime','billableseconds','attendedtransfer','localtwolinkedid','transfereechannel','userfield','transfertargetchannel','origtransfererchannel','_attended','musiconholdstart','musiconholdstartAt','musiconholdstop','mohtime','varset','variable','xmd-originatecalleridnum','value','xmd-phone','\x22\x20<','xmd-callerid-preview','xmd-callerid','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','queue','ContactId','xmd-cdrtype','outboundrouteid','routeid','sipcallid','newexten','application','toLowerCase','set','appdata','cdr','split','lastIndexOf','noop','execif','gotoif','lodash','NO\x20ANSWER','FAILED','info','format','uniqueid','channel','type','accountcode','source','destination','callerid','disposition','getUserByInternal','then','CreateVoiceCallReport'];(function(_0x5e6e23,_0x34a18b){var _0x497079=function(_0x4616e2){while(--_0x4616e2){_0x5e6e23['push'](_0x5e6e23['shift']());}};_0x497079(++_0x34a18b);}(_0x6b68,0xe0));var _0x86b6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6b68[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x86b6('0x0'));var util=require('util');var utils=require('./utils');var dispositions=[_0x86b6('0x1'),_0x86b6('0x2'),'FAILED','NO\x20ANSWER','NO\x20ANSWER',_0x86b6('0x1'),'ANSWERED','BUSY',_0x86b6('0x2'),_0x86b6('0x2'),_0x86b6('0x2')];var channels={};function writeDB(_0x283522){utils[_0x86b6('0x3')](util[_0x86b6('0x4')]('CALL|%s|%s|%s|%s|%s|%s|%s|%s',_0x283522[_0x86b6('0x5')],_0x283522[_0x86b6('0x6')],_0x283522[_0x86b6('0x7')],_0x283522[_0x86b6('0x8')],_0x283522[_0x86b6('0x9')],_0x283522[_0x86b6('0xa')],_0x283522[_0x86b6('0xb')],_0x283522[_0x86b6('0xc')]));if(_0x283522[_0x86b6('0x8')]){utils[_0x86b6('0xd')](_0x283522[_0x86b6('0x8')])[_0x86b6('0xe')](function(_0x2b3d3e){if(_0x2b3d3e){_0x283522['UserId']=_0x2b3d3e['id'];}utils['request'](_0x86b6('0xf'),_0x283522);});}else{utils[_0x86b6('0x10')]('CreateVoiceCallReport',_0x283522);}if(channels[_0x283522[_0x86b6('0x5')]]){delete channels[_0x283522[_0x86b6('0x5')]];}}exports['newchannel']=function(_0x479151){try{if(_0x479151[_0x86b6('0x5')]==_0x479151[_0x86b6('0x11')]&&_0x479151[_0x86b6('0x6')]!='OutgoingSpoolFailed'){channels[_0x479151[_0x86b6('0x5')]]={'uniqueid':_0x479151[_0x86b6('0x5')],'accountcode':_0x479151[_0x86b6('0x8')],'source':_0x479151[_0x86b6('0x12')],'destination':_0x479151['exten'],'destinationcontext':_0x479151['context'],'channel':_0x479151['channel'],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':'DOCUMENTATION'};}}catch(_0xe7b42b){utils[_0x86b6('0x13')](_0xe7b42b[_0x86b6('0x14')]);}};exports[_0x86b6('0x15')]=function(_0x8fd5fa){try{if(!_[_0x86b6('0x16')](channels[_0x8fd5fa[_0x86b6('0x5')]])&&_0x8fd5fa[_0x86b6('0x17')]==0x6){if(_['isNil'](channels[_0x8fd5fa['uniqueid']]['systemanswertime'])){channels[_0x8fd5fa['uniqueid']][_0x86b6('0x18')]=utils[_0x86b6('0x19')]();}}else if(!_['isNil'](channels[_0x8fd5fa[_0x86b6('0x11')]])&&_0x8fd5fa[_0x86b6('0x17')]==0x6&&_0x8fd5fa[_0x86b6('0x1a')]!=_0x86b6('0x1b')){channels[_0x8fd5fa[_0x86b6('0x11')]][_0x86b6('0x8')]=_0x8fd5fa[_0x86b6('0x8')];channels[_0x8fd5fa[_0x86b6('0x11')]][_0x86b6('0x1c')]=_0x8fd5fa[_0x86b6('0x6')];if(_[_0x86b6('0x16')](channels[_0x8fd5fa['linkedid']][_0x86b6('0x1d')])){channels[_0x8fd5fa['linkedid']]['answertime']=utils[_0x86b6('0x19')]();}channels[_0x8fd5fa['linkedid']]['disposition']=dispositions[_[_0x86b6('0x1e')](_0x8fd5fa[_0x86b6('0x17')])]||_0x86b6('0x1f');}}catch(_0x458867){utils['error'](_0x458867[_0x86b6('0x14')]);}};exports[_0x86b6('0x20')]=function(_0x51571f){try{if(!_['isNil'](channels[_0x51571f[_0x86b6('0x5')]])){if(_['isNil'](channels[_0x51571f[_0x86b6('0x5')]][_0x86b6('0xb')])){channels[_0x51571f[_0x86b6('0x5')]][_0x86b6('0xb')]=_0x51571f[_0x86b6('0x21')]+'\x20<'+_0x51571f['calleridnum']+'>';}channels[_0x51571f[_0x86b6('0x5')]][_0x86b6('0x22')]=utils[_0x86b6('0x19')]();channels[_0x51571f['uniqueid']][_0x86b6('0x23')]=utils[_0x86b6('0x24')](channels[_0x51571f[_0x86b6('0x5')]][_0x86b6('0x22')],channels[_0x51571f[_0x86b6('0x5')]][_0x86b6('0x25')]);channels[_0x51571f['uniqueid']][_0x86b6('0x26')]=channels[_0x51571f[_0x86b6('0x5')]]['answertime']?utils[_0x86b6('0x24')](channels[_0x51571f[_0x86b6('0x5')]][_0x86b6('0x22')],channels[_0x51571f[_0x86b6('0x5')]][_0x86b6('0x1d')]):0x0;writeDB(channels[_0x51571f[_0x86b6('0x5')]]);}}catch(_0x69791){utils['error'](_0x69791[_0x86b6('0x14')]);}};exports[_0x86b6('0x27')]=function(_0x476670){try{if(!_[_0x86b6('0x16')](channels[_0x476670[_0x86b6('0x28')]])){if(channels[_0x476670[_0x86b6('0x28')]][_0x86b6('0x6')]==_0x476670[_0x86b6('0x29')]){channels[_0x476670[_0x86b6('0x28')]][_0x86b6('0x1c')]=_0x476670['secondtransfererchannel'];channels[_0x476670[_0x86b6('0x28')]][_0x86b6('0x2a')]='_attended';}else if(channels[_0x476670[_0x86b6('0x28')]][_0x86b6('0x6')]=_0x476670[_0x86b6('0x2b')]){channels[_0x476670[_0x86b6('0x28')]]['destinationchannel']=_0x476670[_0x86b6('0x2c')];channels[_0x476670['localtwolinkedid']]['userfield']=_0x86b6('0x2d');}}}catch(_0x4ea6c7){utils[_0x86b6('0x13')](_0x4ea6c7[_0x86b6('0x14')]);}};exports[_0x86b6('0x2e')]=function(_0x1c800a){try{if(!_[_0x86b6('0x16')](channels[_0x1c800a[_0x86b6('0x5')]])){channels[_0x1c800a['uniqueid']][_0x86b6('0x2f')]=utils[_0x86b6('0x19')]();}}catch(_0xebf433){utils[_0x86b6('0x13')](_0xebf433[_0x86b6('0x14')]);}};exports[_0x86b6('0x30')]=function(_0x2d4c6c){try{if(!_[_0x86b6('0x16')](channels[_0x2d4c6c[_0x86b6('0x5')]])){if(!_[_0x86b6('0x16')](channels[_0x2d4c6c[_0x86b6('0x5')]][_0x86b6('0x2f')])){channels[_0x2d4c6c['uniqueid']][_0x86b6('0x31')]+=utils[_0x86b6('0x24')](utils['now'](),channels[_0x2d4c6c['uniqueid']][_0x86b6('0x2f')]);delete channels[_0x2d4c6c[_0x86b6('0x5')]][_0x86b6('0x2f')];}}}catch(_0x2a9950){utils[_0x86b6('0x13')](_0x2a9950['stack']);}};exports[_0x86b6('0x32')]=function(_0x43c44c){try{if(!_[_0x86b6('0x16')](channels[_0x43c44c[_0x86b6('0x5')]])){if(!_[_0x86b6('0x16')](_0x43c44c[_0x86b6('0x33')][_0x86b6('0x34')])){channels[_0x43c44c[_0x86b6('0x5')]][_0x86b6('0x9')]=_0x43c44c[_0x86b6('0x35')];}if(!_[_0x86b6('0x16')](_0x43c44c[_0x86b6('0x33')][_0x86b6('0x36')])){channels[_0x43c44c[_0x86b6('0x5')]][_0x86b6('0xa')]=_0x43c44c[_0x86b6('0x35')];channels[_0x43c44c[_0x86b6('0x5')]]['callerid']='\x22'+_0x43c44c['value']+_0x86b6('0x37')+_0x43c44c[_0x86b6('0x35')]+'>';}if(!_[_0x86b6('0x16')](_0x43c44c[_0x86b6('0x33')][_0x86b6('0x38')])||!_['isNil'](_0x43c44c[_0x86b6('0x33')][_0x86b6('0x39')])){channels[_0x43c44c['uniqueid']][_0x86b6('0xb')]=_0x43c44c['value'];}if(!_[_0x86b6('0x16')](_0x43c44c[_0x86b6('0x33')][_0x86b6('0x3a')])||!_[_0x86b6('0x16')](_0x43c44c[_0x86b6('0x33')][_0x86b6('0x3b')])){channels[_0x43c44c[_0x86b6('0x5')]][_0x86b6('0x3c')]=_0x86b6('0x3d');channels[_0x43c44c[_0x86b6('0x5')]][_0x86b6('0x3e')]=_0x43c44c[_0x86b6('0x35')];channels[_0x43c44c['uniqueid']][_0x86b6('0x3f')]=!![];}if(!_['isNil'](_0x43c44c['variable']['xmd-contactid'])){channels[_0x43c44c[_0x86b6('0x5')]][_0x86b6('0x40')]=_0x43c44c['value'];}if(!_[_0x86b6('0x16')](_0x43c44c[_0x86b6('0x33')][_0x86b6('0x41')])){channels[_0x43c44c['uniqueid']][_0x86b6('0x7')]=_0x43c44c[_0x86b6('0x35')];}if(!_['isNil'](_0x43c44c[_0x86b6('0x33')][_0x86b6('0x42')])){channels[_0x43c44c[_0x86b6('0x5')]][_0x86b6('0x43')]=_0x43c44c[_0x86b6('0x35')];}if(!_[_0x86b6('0x16')](_0x43c44c[_0x86b6('0x33')][_0x86b6('0x44')])){channels[_0x43c44c[_0x86b6('0x5')]][_0x86b6('0x44')]=_0x43c44c[_0x86b6('0x35')];}}}catch(_0x15eff9){utils['error'](_0x15eff9[_0x86b6('0x14')]);}};exports[_0x86b6('0x45')]=function(_0x2d29b4){try{if(!_['isNil'](channels[_0x2d29b4['uniqueid']])){if(_0x2d29b4[_0x86b6('0x46')][_0x86b6('0x47')]()==_0x86b6('0x48')&&_['startsWith'](_0x2d29b4[_0x86b6('0x49')][_0x86b6('0x47')](),_0x86b6('0x4a'))){var _0x3f69f2=_0x2d29b4[_0x86b6('0x49')][_0x86b6('0x4b')]('=');var _0x3ec7e6=_0x3f69f2[0x0]['substring'](_0x3f69f2[0x0][_0x86b6('0x4c')]('(')+0x1,_0x3f69f2[0x0][_0x86b6('0x4c')](')'));var _0x42c6f7=_0x3f69f2[0x1];channels[_0x2d29b4[_0x86b6('0x5')]][_0x3ec7e6]=_0x42c6f7;}if(!_['includes']([_0x86b6('0x20'),_0x86b6('0x4d'),_0x86b6('0x4e'),_0x86b6('0x48'),_0x86b6('0x4f')],_0x2d29b4['application']['toLowerCase']())){channels[_0x2d29b4[_0x86b6('0x5')]][_0x86b6('0x3c')]=_0x2d29b4[_0x86b6('0x46')];channels[_0x2d29b4['uniqueid']][_0x86b6('0x3e')]=_0x2d29b4[_0x86b6('0x49')];}}}catch(_0xca91d3){utils['error'](_0xca91d3[_0x86b6('0x14')]);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 75acfe8..6ba3673 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 _0x687b=['./utils','lodash','connect','info','SHUTDOWN','fullybooted','FULLYBOOTED','error','close','managerevent'];(function(_0x2aac92,_0x399a96){var _0x427e08=function(_0xee2dc3){while(--_0xee2dc3){_0x2aac92['push'](_0x2aac92['shift']());}};_0x427e08(++_0x399a96);}(_0x687b,0x14a));var _0xb687=function(_0x4d8fe1,_0x3ed474){_0x4d8fe1=_0x4d8fe1-0x0;var _0x46685e=_0x687b[_0x4d8fe1];return _0x46685e;};'use strict';var utils=require(_0xb687('0x0'));var _=require(_0xb687('0x1'));exports[_0xb687('0x2')]=function(){utils[_0xb687('0x3')]('CONNECTED');};exports['shutdown']=function(){utils[_0xb687('0x3')](_0xb687('0x4'));};exports[_0xb687('0x5')]=function(){utils[_0xb687('0x3')](_0xb687('0x6'));};exports[_0xb687('0x7')]=function(_0x16ccf3){utils[_0xb687('0x7')](_0x16ccf3);};exports[_0xb687('0x8')]=function(){utils[_0xb687('0x3')]('CLOSE');};exports[_0xb687('0x9')]=function(_0xd40346){}; \ No newline at end of file +var _0xeff8=['fullybooted','FULLYBOOTED','error','close','managerevent','./utils','lodash','info','CONNECTED','shutdown','SHUTDOWN'];(function(_0x409ba6,_0x1fdadd){var _0x3d9ac9=function(_0xc59da5){while(--_0xc59da5){_0x409ba6['push'](_0x409ba6['shift']());}};_0x3d9ac9(++_0x1fdadd);}(_0xeff8,0x186));var _0x8eff=function(_0x50007c,_0x1cbf11){_0x50007c=_0x50007c-0x0;var _0x5c1ec7=_0xeff8[_0x50007c];return _0x5c1ec7;};'use strict';var utils=require(_0x8eff('0x0'));var _=require(_0x8eff('0x1'));exports['connect']=function(){utils[_0x8eff('0x2')](_0x8eff('0x3'));};exports[_0x8eff('0x4')]=function(){utils['info'](_0x8eff('0x5'));};exports[_0x8eff('0x6')]=function(){utils[_0x8eff('0x2')](_0x8eff('0x7'));};exports['error']=function(_0x469641){utils[_0x8eff('0x8')](_0x469641);};exports[_0x8eff('0x9')]=function(){utils[_0x8eff('0x2')]('CLOSE');};exports[_0x8eff('0xa')]=function(_0x19557f){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 55f68f6..20fd31d 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 _0xd01c=['appdata','split','error','stack','varset','isNil','variable','outboundrouteid','value','starttime','now','lastevent','called','ANSWER','assign','connect','complete','duration','diffTime','holdtime','answertime','billableseconds','endtime','lodash','util','./utils','info','DIAL|%s|%s|%s|%s|%s|%s','uniqueid','channel','calleridnum','connectedlinenum','dialstatus','request','newexten','application','toLowerCase','startsWith'];(function(_0x1fb1c1,_0x4ebe69){var _0x1622df=function(_0x52b793){while(--_0x52b793){_0x1fb1c1['push'](_0x1fb1c1['shift']());}};_0x1622df(++_0x4ebe69);}(_0xd01c,0xfb));var _0xcd01=function(_0x46f866,_0xd90fcd){_0x46f866=_0x46f866-0x0;var _0x34775d=_0xd01c[_0x46f866];return _0x34775d;};'use strict';var _=require(_0xcd01('0x0'));var util=require(_0xcd01('0x1'));var utils=require(_0xcd01('0x2'));var dials={};function writeDB(_0x593407){utils[_0xcd01('0x3')](util['format'](_0xcd01('0x4'),_0x593407[_0xcd01('0x5')],_0x593407[_0xcd01('0x6')],_0x593407['dialstring'],_0x593407[_0xcd01('0x7')],_0x593407[_0xcd01('0x8')],_0x593407[_0xcd01('0x9')]));utils[_0xcd01('0xa')]('CreateVoiceDialReport',_0x593407);delete dials[_0x593407[_0xcd01('0x5')]];}exports[_0xcd01('0xb')]=function(_0x3b9975){try{if(_0x3b9975[_0xcd01('0xc')][_0xcd01('0xd')]()=='set'&&_[_0xcd01('0xe')](_0x3b9975[_0xcd01('0xf')]['toLowerCase'](),'cdr(routeid)')){var _0x2efc0f=_0x3b9975[_0xcd01('0xf')][_0xcd01('0x10')]('=');dials[_0x3b9975['uniqueid']]={'routeId':_0x2efc0f[0x1]};}}catch(_0x3bfc22){utils[_0xcd01('0x11')](_0x3bfc22[_0xcd01('0x12')]);}};exports[_0xcd01('0x13')]=function(_0x5b8a88){try{if(!_[_0xcd01('0x14')](_0x5b8a88[_0xcd01('0x15')][_0xcd01('0x16')])){dials[_0x5b8a88[_0xcd01('0x5')]]={'routeId':_0x5b8a88[_0xcd01('0x17')]};}}catch(_0x5ed39e){utils[_0xcd01('0x11')](_0x5ed39e[_0xcd01('0x12')]);}};exports['dialbegin']=function(_0x555a2d){try{if(!_[_0xcd01('0x14')](dials[_0x555a2d['uniqueid']])){dials[_0x555a2d[_0xcd01('0x5')]]=_['assign'](dials[_0x555a2d[_0xcd01('0x5')]],_0x555a2d);dials[_0x555a2d['uniqueid']][_0xcd01('0x18')]=utils[_0xcd01('0x19')]();dials[_0x555a2d['uniqueid']][_0xcd01('0x1a')]=_0xcd01('0x1b');}}catch(_0x232dce){utils['error'](_0x232dce['stack']);}};exports['dialend']=function(_0x595b00){try{if(!_[_0xcd01('0x14')](dials[_0x595b00[_0xcd01('0x5')]])){dials[_0x595b00['uniqueid']]['dialstatus']=_0x595b00['dialstatus'];if(_0x595b00['dialstatus']==_0xcd01('0x1c')){dials[_0x595b00['uniqueid']]=_[_0xcd01('0x1d')](dials[_0x595b00[_0xcd01('0x5')]],_0x595b00);dials[_0x595b00[_0xcd01('0x5')]]['answertime']=utils['now']();dials[_0x595b00[_0xcd01('0x5')]][_0xcd01('0x1a')]=_0xcd01('0x1e');}}}catch(_0x5cf7c3){utils[_0xcd01('0x11')](_0x5cf7c3['stack']);}};exports['hangup']=function(_0x41eb79){try{if(!_['isNil'](dials[_0x41eb79[_0xcd01('0x5')]])){dials[_0x41eb79[_0xcd01('0x5')]]=_[_0xcd01('0x1d')](dials[_0x41eb79['uniqueid']],{'endtime':utils[_0xcd01('0x19')](),'lastevent':_0xcd01('0x1f')});dials[_0x41eb79[_0xcd01('0x5')]][_0xcd01('0x20')]=utils[_0xcd01('0x21')](dials[_0x41eb79[_0xcd01('0x5')]]['endtime'],dials[_0x41eb79[_0xcd01('0x5')]][_0xcd01('0x18')]);dials[_0x41eb79[_0xcd01('0x5')]][_0xcd01('0x22')]=utils[_0xcd01('0x21')](dials[_0x41eb79[_0xcd01('0x5')]][_0xcd01('0x23')]||dials[_0x41eb79[_0xcd01('0x5')]]['endtime'],dials[_0x41eb79[_0xcd01('0x5')]][_0xcd01('0x18')]);dials[_0x41eb79[_0xcd01('0x5')]][_0xcd01('0x24')]=dials[_0x41eb79[_0xcd01('0x5')]][_0xcd01('0x23')]?utils[_0xcd01('0x21')](dials[_0x41eb79['uniqueid']][_0xcd01('0x25')],dials[_0x41eb79[_0xcd01('0x5')]][_0xcd01('0x23')]):0x0;writeDB(dials[_0x41eb79[_0xcd01('0x5')]]);}}catch(_0xc173d){utils['error'](_0xc173d[_0xcd01('0x12')]);}}; \ No newline at end of file +var _0x305a=['dialstring','calleridnum','connectedlinenum','request','CreateVoiceDialReport','uniqueid','startsWith','appdata','cdr(routeid)','split','error','stack','varset','outboundrouteid','dialbegin','now','lastevent','called','dialend','isNil','dialstatus','ANSWER','assign','answertime','connect','complete','duration','diffTime','endtime','starttime','holdtime','billableseconds','lodash','util','./utils','info','format','DIAL|%s|%s|%s|%s|%s|%s','channel'];(function(_0x38d351,_0x332c03){var _0x544fd3=function(_0x1bd054){while(--_0x1bd054){_0x38d351['push'](_0x38d351['shift']());}};_0x544fd3(++_0x332c03);}(_0x305a,0x158));var _0xa305=function(_0x1dba28,_0x46bb18){_0x1dba28=_0x1dba28-0x0;var _0x14050d=_0x305a[_0x1dba28];return _0x14050d;};'use strict';var _=require(_0xa305('0x0'));var util=require(_0xa305('0x1'));var utils=require(_0xa305('0x2'));var dials={};function writeDB(_0x565c79){utils[_0xa305('0x3')](util[_0xa305('0x4')](_0xa305('0x5'),_0x565c79['uniqueid'],_0x565c79[_0xa305('0x6')],_0x565c79[_0xa305('0x7')],_0x565c79[_0xa305('0x8')],_0x565c79[_0xa305('0x9')],_0x565c79['dialstatus']));utils[_0xa305('0xa')](_0xa305('0xb'),_0x565c79);delete dials[_0x565c79[_0xa305('0xc')]];}exports['newexten']=function(_0x2c6ad1){try{if(_0x2c6ad1['application']['toLowerCase']()=='set'&&_[_0xa305('0xd')](_0x2c6ad1[_0xa305('0xe')]['toLowerCase'](),_0xa305('0xf'))){var _0x3e4755=_0x2c6ad1[_0xa305('0xe')][_0xa305('0x10')]('=');dials[_0x2c6ad1[_0xa305('0xc')]]={'routeId':_0x3e4755[0x1]};}}catch(_0x350731){utils[_0xa305('0x11')](_0x350731[_0xa305('0x12')]);}};exports[_0xa305('0x13')]=function(_0x338f56){try{if(!_['isNil'](_0x338f56['variable'][_0xa305('0x14')])){dials[_0x338f56[_0xa305('0xc')]]={'routeId':_0x338f56['value']};}}catch(_0x7c2315){utils['error'](_0x7c2315['stack']);}};exports[_0xa305('0x15')]=function(_0x39537a){try{if(!_['isNil'](dials[_0x39537a[_0xa305('0xc')]])){dials[_0x39537a[_0xa305('0xc')]]=_['assign'](dials[_0x39537a[_0xa305('0xc')]],_0x39537a);dials[_0x39537a[_0xa305('0xc')]]['starttime']=utils[_0xa305('0x16')]();dials[_0x39537a[_0xa305('0xc')]][_0xa305('0x17')]=_0xa305('0x18');}}catch(_0x4ff038){utils['error'](_0x4ff038[_0xa305('0x12')]);}};exports[_0xa305('0x19')]=function(_0x47d753){try{if(!_[_0xa305('0x1a')](dials[_0x47d753['uniqueid']])){dials[_0x47d753[_0xa305('0xc')]][_0xa305('0x1b')]=_0x47d753[_0xa305('0x1b')];if(_0x47d753['dialstatus']==_0xa305('0x1c')){dials[_0x47d753[_0xa305('0xc')]]=_[_0xa305('0x1d')](dials[_0x47d753[_0xa305('0xc')]],_0x47d753);dials[_0x47d753['uniqueid']][_0xa305('0x1e')]=utils[_0xa305('0x16')]();dials[_0x47d753['uniqueid']][_0xa305('0x17')]=_0xa305('0x1f');}}}catch(_0xe3d64){utils[_0xa305('0x11')](_0xe3d64[_0xa305('0x12')]);}};exports['hangup']=function(_0x2a3011){try{if(!_[_0xa305('0x1a')](dials[_0x2a3011['uniqueid']])){dials[_0x2a3011[_0xa305('0xc')]]=_[_0xa305('0x1d')](dials[_0x2a3011[_0xa305('0xc')]],{'endtime':utils['now'](),'lastevent':_0xa305('0x20')});dials[_0x2a3011['uniqueid']][_0xa305('0x21')]=utils[_0xa305('0x22')](dials[_0x2a3011[_0xa305('0xc')]][_0xa305('0x23')],dials[_0x2a3011[_0xa305('0xc')]][_0xa305('0x24')]);dials[_0x2a3011[_0xa305('0xc')]][_0xa305('0x25')]=utils[_0xa305('0x22')](dials[_0x2a3011[_0xa305('0xc')]][_0xa305('0x1e')]||dials[_0x2a3011[_0xa305('0xc')]]['endtime'],dials[_0x2a3011[_0xa305('0xc')]][_0xa305('0x24')]);dials[_0x2a3011[_0xa305('0xc')]][_0xa305('0x26')]=dials[_0x2a3011[_0xa305('0xc')]][_0xa305('0x1e')]?utils[_0xa305('0x22')](dials[_0x2a3011['uniqueid']][_0xa305('0x23')],dials[_0x2a3011[_0xa305('0xc')]]['answertime']):0x0;writeDB(dials[_0x2a3011['uniqueid']]);}}catch(_0x463be4){utils[_0xa305('0x11')](_0x463be4['stack']);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 9248c87..b057de5 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 _0xe3d1=['queuecallerabandon','queuecallerjoin','musiconholdstart','musiconholdstop','newstate','hangup','cdr','blindtransfer','attendedtransfer','varset','newexten','newchannel','dialbegin','dialend','asterisk-manager','asterisk','port','keepConnected','xdr','disabled','XDR\x20DISABLED','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','devicestatechange','agentcalled','agentringnoanswer','agentconnect','agentcomplete'];(function(_0x386092,_0x32a500){var _0x380729=function(_0x1f3f4c){while(--_0x1f3f4c){_0x386092['push'](_0x386092['shift']());}};_0x380729(++_0x32a500);}(_0xe3d1,0x146));var _0x1e3d=function(_0x435044,_0x36ab8e){_0x435044=_0x435044-0x0;var _0x33d4c6=_0xe3d1[_0x435044];return _0x33d4c6;};var AsteriskManager=require(_0x1e3d('0x0'));var config=require('../../config/environment');var utils=require('./utils');var ami=new AsteriskManager(config[_0x1e3d('0x1')][_0x1e3d('0x2')],config[_0x1e3d('0x1')]['ip'],config[_0x1e3d('0x1')]['username'],config[_0x1e3d('0x1')]['password'],!![]);ami[_0x1e3d('0x3')]();if(config[_0x1e3d('0x4')]&&config['xdr'][_0x1e3d('0x5')]){utils['info'](_0x1e3d('0x6'));}else{var agents=require(_0x1e3d('0x7'));var calls=require(_0x1e3d('0x8'));var queues=require(_0x1e3d('0x9'));var recordings=require(_0x1e3d('0xa'));var members=require(_0x1e3d('0xb'));var dials=require(_0x1e3d('0xc'));var transfers=require(_0x1e3d('0xd'));var core=require(_0x1e3d('0xe'));ami['on'](_0x1e3d('0xf'),core[_0x1e3d('0xf')]);ami['on']('shutdown',core[_0x1e3d('0x10')]);ami['on'](_0x1e3d('0x11'),core[_0x1e3d('0x11')]);ami['on'](_0x1e3d('0x12'),core[_0x1e3d('0x12')]);ami['on'](_0x1e3d('0x13'),core[_0x1e3d('0x13')]);ami['on']('managerevent',core['managerevent']);ami['on'](_0x1e3d('0x14'),function(_0x55ae5){try{members[_0x1e3d('0x14')](_0x55ae5);}catch(_0x2a7fd3){utils[_0x1e3d('0x12')](_0x2a7fd3);}});ami['on'](_0x1e3d('0x15'),function(_0x5c5cd1){try{agents[_0x1e3d('0x15')](_0x5c5cd1);}catch(_0x28d78c){utils[_0x1e3d('0x12')](_0x28d78c);}});ami['on'](_0x1e3d('0x16'),function(_0x10a7a2){try{agents['agentringnoanswer'](_0x10a7a2);}catch(_0x43405f){utils[_0x1e3d('0x12')](_0x43405f);}});ami['on'](_0x1e3d('0x17'),function(_0x2cff65){try{agents[_0x1e3d('0x17')](_0x2cff65);queues[_0x1e3d('0x17')](_0x2cff65);}catch(_0x3ff180){utils[_0x1e3d('0x12')](_0x3ff180);}});ami['on'](_0x1e3d('0x18'),function(_0x46dd7c){try{agents[_0x1e3d('0x18')](_0x46dd7c);queues['agentcomplete'](_0x46dd7c);members[_0x1e3d('0x18')](_0x46dd7c);}catch(_0x5a90aa){utils['error'](_0x5a90aa);}});ami['on'](_0x1e3d('0x19'),function(_0x36a98f){try{agents[_0x1e3d('0x19')](_0x36a98f);queues[_0x1e3d('0x19')](_0x36a98f);}catch(_0x2c58a3){utils[_0x1e3d('0x12')](_0x2c58a3);}});ami['on'](_0x1e3d('0x1a'),function(_0x100bdd){try{queues[_0x1e3d('0x1a')](_0x100bdd);recordings['queuecallerjoin'](_0x100bdd);}catch(_0x30f737){utils[_0x1e3d('0x12')](_0x30f737);}});ami['on']('queuecallerleave',function(_0x44585a){try{queues['queuecallerleave'](_0x44585a);}catch(_0x1bf51e){utils['error'](_0x1bf51e);}});ami['on'](_0x1e3d('0x1b'),function(_0x3dc8b4){try{queues[_0x1e3d('0x1b')](_0x3dc8b4);calls['musiconholdstart'](_0x3dc8b4);}catch(_0xa8f3a2){utils[_0x1e3d('0x12')](_0xa8f3a2);}});ami['on'](_0x1e3d('0x1c'),function(_0x2be295){try{queues['musiconholdstop'](_0x2be295);calls['musiconholdstop'](_0x2be295);}catch(_0x45ba8){utils[_0x1e3d('0x12')](_0x45ba8);}});ami['on'](_0x1e3d('0x1d'),function(_0x3d75da){try{calls[_0x1e3d('0x1d')](_0x3d75da);recordings[_0x1e3d('0x1d')](_0x3d75da);}catch(_0x1fa384){utils[_0x1e3d('0x12')](_0x1fa384);}});ami['on'](_0x1e3d('0x1e'),function(_0x305efe){try{calls[_0x1e3d('0x1e')](_0x305efe);recordings[_0x1e3d('0x1e')](_0x305efe);dials[_0x1e3d('0x1e')](_0x305efe);agents['hangup'](_0x305efe);queues[_0x1e3d('0x1e')](_0x305efe);}catch(_0x2fed91){utils['error'](_0x2fed91);}});ami['on'](_0x1e3d('0x1f'),function(_0x2694a9){try{members[_0x1e3d('0x1f')](_0x2694a9);}catch(_0x224a04){utils[_0x1e3d('0x12')](_0x224a04);}});ami['on'](_0x1e3d('0x20'),function(_0x1c5612){try{queues[_0x1e3d('0x20')](_0x1c5612);agents[_0x1e3d('0x20')](_0x1c5612);transfers[_0x1e3d('0x20')](_0x1c5612);}catch(_0x4125f9){utils[_0x1e3d('0x12')](_0x4125f9);}});ami['on']('attendedtransfer',function(_0x86ab81){try{queues['attendedtransfer'](_0x86ab81);transfers[_0x1e3d('0x21')](_0x86ab81);agents[_0x1e3d('0x21')](_0x86ab81);calls[_0x1e3d('0x21')](_0x86ab81);}catch(_0x7ca731){utils['error'](_0x7ca731);}});ami['on'](_0x1e3d('0x22'),function(_0x37842e){try{queues[_0x1e3d('0x22')](_0x37842e);recordings['varset'](_0x37842e);calls[_0x1e3d('0x22')](_0x37842e);dials[_0x1e3d('0x22')](_0x37842e);}catch(_0x1df588){utils[_0x1e3d('0x12')](_0x1df588);}});ami['on'](_0x1e3d('0x23'),function(_0x15f063){try{calls['newexten'](_0x15f063);recordings[_0x1e3d('0x23')](_0x15f063);dials[_0x1e3d('0x23')](_0x15f063);}catch(_0x60682){utils[_0x1e3d('0x12')](_0x60682);}});ami['on'](_0x1e3d('0x24'),function(_0x3a6fc5){try{calls[_0x1e3d('0x24')](_0x3a6fc5);recordings['newchannel'](_0x3a6fc5);}catch(_0x52902f){utils[_0x1e3d('0x12')](_0x52902f);}});ami['on'](_0x1e3d('0x25'),function(_0x4797d9){try{dials[_0x1e3d('0x25')](_0x4797d9);}catch(_0xda359d){utils['error'](_0xda359d);}});ami['on']('dialend',function(_0x2e7e2c){try{dials[_0x1e3d('0x26')](_0x2e7e2c);}catch(_0x2db31f){utils['error'](_0x2db31f);}});} \ No newline at end of file +var _0x8f98=['agentringnoanswer','agentconnect','agentcomplete','queuecallerabandon','queuecallerjoin','queuecallerleave','musiconholdstart','musiconholdstop','newstate','hangup','cdr','blindtransfer','attendedtransfer','varset','newexten','newchannel','dialbegin','dialend','asterisk-manager','../../config/environment','./utils','asterisk','port','password','keepConnected','xdr','disabled','info','XDR\x20DISABLED','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','agentcalled'];(function(_0x1a3eb1,_0x5188d5){var _0x29efec=function(_0x34f0da){while(--_0x34f0da){_0x1a3eb1['push'](_0x1a3eb1['shift']());}};_0x29efec(++_0x5188d5);}(_0x8f98,0x6c));var _0x88f9=function(_0x3e09b5,_0x27d472){_0x3e09b5=_0x3e09b5-0x0;var _0x14a2df=_0x8f98[_0x3e09b5];return _0x14a2df;};var AsteriskManager=require(_0x88f9('0x0'));var config=require(_0x88f9('0x1'));var utils=require(_0x88f9('0x2'));var ami=new AsteriskManager(config[_0x88f9('0x3')][_0x88f9('0x4')],config[_0x88f9('0x3')]['ip'],config['asterisk']['username'],config[_0x88f9('0x3')][_0x88f9('0x5')],!![]);ami[_0x88f9('0x6')]();if(config[_0x88f9('0x7')]&&config[_0x88f9('0x7')][_0x88f9('0x8')]){utils[_0x88f9('0x9')](_0x88f9('0xa'));}else{var agents=require(_0x88f9('0xb'));var calls=require(_0x88f9('0xc'));var queues=require(_0x88f9('0xd'));var recordings=require(_0x88f9('0xe'));var members=require(_0x88f9('0xf'));var dials=require(_0x88f9('0x10'));var transfers=require(_0x88f9('0x11'));var core=require(_0x88f9('0x12'));ami['on'](_0x88f9('0x13'),core[_0x88f9('0x13')]);ami['on'](_0x88f9('0x14'),core['shutdown']);ami['on'](_0x88f9('0x15'),core[_0x88f9('0x15')]);ami['on'](_0x88f9('0x16'),core[_0x88f9('0x16')]);ami['on'](_0x88f9('0x17'),core['close']);ami['on'](_0x88f9('0x18'),core['managerevent']);ami['on'](_0x88f9('0x19'),function(_0x4e05d6){try{members[_0x88f9('0x19')](_0x4e05d6);}catch(_0x1e9dde){utils[_0x88f9('0x16')](_0x1e9dde);}});ami['on']('agentcalled',function(_0x36e5ed){try{agents[_0x88f9('0x1a')](_0x36e5ed);}catch(_0x1e0435){utils[_0x88f9('0x16')](_0x1e0435);}});ami['on']('agentringnoanswer',function(_0x4824ce){try{agents[_0x88f9('0x1b')](_0x4824ce);}catch(_0x54b73d){utils[_0x88f9('0x16')](_0x54b73d);}});ami['on'](_0x88f9('0x1c'),function(_0x29e31d){try{agents[_0x88f9('0x1c')](_0x29e31d);queues[_0x88f9('0x1c')](_0x29e31d);}catch(_0x19c342){utils[_0x88f9('0x16')](_0x19c342);}});ami['on']('agentcomplete',function(_0x569448){try{agents['agentcomplete'](_0x569448);queues[_0x88f9('0x1d')](_0x569448);members[_0x88f9('0x1d')](_0x569448);}catch(_0x426896){utils[_0x88f9('0x16')](_0x426896);}});ami['on'](_0x88f9('0x1e'),function(_0x521637){try{agents[_0x88f9('0x1e')](_0x521637);queues[_0x88f9('0x1e')](_0x521637);}catch(_0x33a9ff){utils[_0x88f9('0x16')](_0x33a9ff);}});ami['on'](_0x88f9('0x1f'),function(_0x3cc827){try{queues[_0x88f9('0x1f')](_0x3cc827);recordings[_0x88f9('0x1f')](_0x3cc827);}catch(_0x423743){utils['error'](_0x423743);}});ami['on']('queuecallerleave',function(_0xe43365){try{queues[_0x88f9('0x20')](_0xe43365);}catch(_0xd4cf60){utils[_0x88f9('0x16')](_0xd4cf60);}});ami['on']('musiconholdstart',function(_0x1d28e1){try{queues['musiconholdstart'](_0x1d28e1);calls[_0x88f9('0x21')](_0x1d28e1);}catch(_0x319567){utils[_0x88f9('0x16')](_0x319567);}});ami['on'](_0x88f9('0x22'),function(_0x498dd7){try{queues[_0x88f9('0x22')](_0x498dd7);calls[_0x88f9('0x22')](_0x498dd7);}catch(_0x159642){utils[_0x88f9('0x16')](_0x159642);}});ami['on']('newstate',function(_0x29dd63){try{calls['newstate'](_0x29dd63);recordings[_0x88f9('0x23')](_0x29dd63);}catch(_0x5af635){utils['error'](_0x5af635);}});ami['on'](_0x88f9('0x24'),function(_0x329dfa){try{calls[_0x88f9('0x24')](_0x329dfa);recordings['hangup'](_0x329dfa);dials[_0x88f9('0x24')](_0x329dfa);agents[_0x88f9('0x24')](_0x329dfa);queues[_0x88f9('0x24')](_0x329dfa);}catch(_0x2f902f){utils['error'](_0x2f902f);}});ami['on'](_0x88f9('0x25'),function(_0x66249f){try{members[_0x88f9('0x25')](_0x66249f);}catch(_0x2ff4de){utils['error'](_0x2ff4de);}});ami['on']('blindtransfer',function(_0x6fd8cf){try{queues[_0x88f9('0x26')](_0x6fd8cf);agents[_0x88f9('0x26')](_0x6fd8cf);transfers['blindtransfer'](_0x6fd8cf);}catch(_0x2d7532){utils[_0x88f9('0x16')](_0x2d7532);}});ami['on'](_0x88f9('0x27'),function(_0x39ec48){try{queues[_0x88f9('0x27')](_0x39ec48);transfers[_0x88f9('0x27')](_0x39ec48);agents[_0x88f9('0x27')](_0x39ec48);calls['attendedtransfer'](_0x39ec48);}catch(_0x56d444){utils[_0x88f9('0x16')](_0x56d444);}});ami['on']('varset',function(_0x1556f7){try{queues[_0x88f9('0x28')](_0x1556f7);recordings[_0x88f9('0x28')](_0x1556f7);calls[_0x88f9('0x28')](_0x1556f7);dials[_0x88f9('0x28')](_0x1556f7);}catch(_0x54b2b7){utils[_0x88f9('0x16')](_0x54b2b7);}});ami['on'](_0x88f9('0x29'),function(_0x3ec767){try{calls[_0x88f9('0x29')](_0x3ec767);recordings[_0x88f9('0x29')](_0x3ec767);dials[_0x88f9('0x29')](_0x3ec767);}catch(_0x23b095){utils[_0x88f9('0x16')](_0x23b095);}});ami['on']('newchannel',function(_0x4b0650){try{calls[_0x88f9('0x2a')](_0x4b0650);recordings[_0x88f9('0x2a')](_0x4b0650);}catch(_0x21356b){utils[_0x88f9('0x16')](_0x21356b);}});ami['on'](_0x88f9('0x2b'),function(_0x223e09){try{dials['dialbegin'](_0x223e09);}catch(_0x58b819){utils[_0x88f9('0x16')](_0x58b819);}});ami['on'](_0x88f9('0x2c'),function(_0x31c6ec){try{dials[_0x88f9('0x2c')](_0x31c6ec);}catch(_0x2ce717){utils['error'](_0x2ce717);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index ec94d0b..f94b8ce 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 _0xe282=['data3','lodash','util','./utils','Local/_attended@transfer','Queue:','info','format','uniqueid','data2','membername','type','interface','getUserByInterface','then','name','internal','request','CreateMemberReport','getUserByName','split','catch','startsWith','devicestatechange','state','INUSE','device','voice','now','NOT_INUSE','isNil','duration','diffTime','exitAt','enterAt','queue','channel','assign','data1','source','destination','destinationchannel'];(function(_0x5023f2,_0x451c9f){var _0x1af2cd=function(_0x596b72){while(--_0x596b72){_0x5023f2['push'](_0x5023f2['shift']());}};_0x1af2cd(++_0x451c9f);}(_0xe282,0x151));var _0x2e28=function(_0x4a407b,_0x400841){_0x4a407b=_0x4a407b-0x0;var _0x5ca19b=_0xe282[_0x4a407b];return _0x5ca19b;};'use strict';var _=require(_0x2e28('0x0'));var util=require(_0x2e28('0x1'));var utils=require(_0x2e28('0x2'));var members={};var exclude=[_0x2e28('0x3'),_0x2e28('0x4')];function writeDB(_0x59c534){utils[_0x2e28('0x5')](util[_0x2e28('0x6')]('MEMBER|%s|%s|%s|%s|%s|%s',_0x59c534[_0x2e28('0x7')],_0x59c534['interface'],_0x59c534['channel'],_0x59c534[_0x2e28('0x8')],_0x59c534[_0x2e28('0x9')],_0x59c534[_0x2e28('0xa')]));if(_0x59c534[_0x2e28('0xb')]){utils[_0x2e28('0xc')](_0x59c534['interface'])[_0x2e28('0xd')](function(_0x30aafa){if(_0x30aafa){_0x59c534[_0x2e28('0x9')]=_0x30aafa[_0x2e28('0xe')];_0x59c534[_0x2e28('0xf')]=_0x30aafa[_0x2e28('0xf')];utils[_0x2e28('0x10')](_0x2e28('0x11'),_0x59c534);}else{utils[_0x2e28('0x12')](_0x59c534['interface'][_0x2e28('0x13')]('/')[0x1])['then'](function(_0x40581b){if(_0x40581b){_0x59c534[_0x2e28('0x9')]=_0x40581b[_0x2e28('0xe')];_0x59c534[_0x2e28('0xf')]=_0x40581b[_0x2e28('0xf')];utils[_0x2e28('0x10')](_0x2e28('0x11'),_0x59c534);}});}})[_0x2e28('0x14')](function(_0x4db365){utils['error'](_0x4db365);});}delete members[_0x59c534[_0x2e28('0xb')]];}function startsWith(_0x17328d,_0x840076){return _['some'](_0x17328d,function(_0x27ac77){return _[_0x2e28('0x15')](_0x840076,_0x27ac77);});}exports[_0x2e28('0x16')]=function(_0x4bb5b8){switch(_0x4bb5b8[_0x2e28('0x17')]){case _0x2e28('0x18'):case'BUSY':if(!startsWith(exclude,_0x4bb5b8['device'])){members[_0x4bb5b8[_0x2e28('0x19')]]={'channel':_0x2e28('0x1a'),'interface':_0x4bb5b8[_0x2e28('0x19')],'type':'TALKING','enterAt':utils[_0x2e28('0x1b')](),'role':'agent'};}break;case _0x2e28('0x1c'):if(!_[_0x2e28('0x1d')](members[_0x4bb5b8[_0x2e28('0x19')]])){members[_0x4bb5b8[_0x2e28('0x19')]]['exitAt']=utils['now']();members[_0x4bb5b8[_0x2e28('0x19')]][_0x2e28('0x1e')]=utils[_0x2e28('0x1f')](members[_0x4bb5b8['device']][_0x2e28('0x20')],members[_0x4bb5b8[_0x2e28('0x19')]][_0x2e28('0x21')]);if(members[_0x4bb5b8[_0x2e28('0x19')]]['uniqueid']){writeDB(members[_0x4bb5b8[_0x2e28('0x19')]]);}}default:break;}};exports['agentcomplete']=function(_0x5da7bc){if(!_['isNil'](members[_0x5da7bc['interface']])){members[_0x5da7bc[_0x2e28('0xb')]]=_['assign'](members[_0x5da7bc[_0x2e28('0xb')]],{'data4':_0x5da7bc[_0x2e28('0x22')],'uniqueid':_0x5da7bc[_0x2e28('0x7')]});}};exports['cdr']=function(_0x200891){if(_0x200891[_0x2e28('0x23')]){var _0x54d113=_0x200891[_0x2e28('0x23')][_0x2e28('0x13')]('-')[0x0];if(!_['isNil'](members[_0x54d113])){members[_0x54d113]=_[_0x2e28('0x24')](members[_0x54d113],{'data1':members[_0x54d113][_0x2e28('0x25')]||_0x200891[_0x2e28('0xa')],'data2':members[_0x54d113][_0x2e28('0x8')]||_0x200891[_0x2e28('0x26')],'data3':members[_0x54d113]['data3']||_0x200891[_0x2e28('0x27')],'uniqueid':members[_0x54d113][_0x2e28('0x7')]||_0x200891[_0x2e28('0x7')]});if(members[_0x54d113][_0x2e28('0x20')]){writeDB(members[_0x54d113]);}}}if(_0x200891[_0x2e28('0x28')]){var _0x498d5b=_0x200891[_0x2e28('0x28')][_0x2e28('0x13')]('-')[0x0];if(!_[_0x2e28('0x1d')](members[_0x498d5b])){members[_0x498d5b]=_['assign'](members[_0x498d5b],{'data1':members[_0x498d5b]['data1']||_0x200891[_0x2e28('0xa')],'data2':members[_0x498d5b][_0x2e28('0x8')]||_0x200891[_0x2e28('0x26')],'data3':members[_0x498d5b][_0x2e28('0x29')]||_0x200891['destination'],'uniqueid':members[_0x498d5b][_0x2e28('0x7')]||_0x200891[_0x2e28('0x7')]});if(members[_0x498d5b][_0x2e28('0x20')]){writeDB(members[_0x498d5b]);}}}}; \ No newline at end of file +var _0x9bab=['voice','TALKING','now','agent','isNil','duration','diffTime','exitAt','enterAt','agentcomplete','assign','queue','cdr','data1','destination','destinationchannel','source','data3','lodash','util','./utils','Local/_attended@transfer','Queue:','info','format','MEMBER|%s|%s|%s|%s|%s|%s','uniqueid','interface','channel','data2','membername','type','getUserByInterface','then','name','internal','request','split','CreateMemberReport','catch','some','startsWith','devicestatechange','INUSE','BUSY','device'];(function(_0x351e7b,_0x2fa6d9){var _0x1c7857=function(_0x6b3a9d){while(--_0x6b3a9d){_0x351e7b['push'](_0x351e7b['shift']());}};_0x1c7857(++_0x2fa6d9);}(_0x9bab,0xf8));var _0xb9ba=function(_0x1d2e75,_0x575b6d){_0x1d2e75=_0x1d2e75-0x0;var _0x3a6a8d=_0x9bab[_0x1d2e75];return _0x3a6a8d;};'use strict';var _=require(_0xb9ba('0x0'));var util=require(_0xb9ba('0x1'));var utils=require(_0xb9ba('0x2'));var members={};var exclude=[_0xb9ba('0x3'),_0xb9ba('0x4')];function writeDB(_0x55962f){utils[_0xb9ba('0x5')](util[_0xb9ba('0x6')](_0xb9ba('0x7'),_0x55962f[_0xb9ba('0x8')],_0x55962f[_0xb9ba('0x9')],_0x55962f[_0xb9ba('0xa')],_0x55962f[_0xb9ba('0xb')],_0x55962f[_0xb9ba('0xc')],_0x55962f[_0xb9ba('0xd')]));if(_0x55962f[_0xb9ba('0x9')]){utils[_0xb9ba('0xe')](_0x55962f[_0xb9ba('0x9')])[_0xb9ba('0xf')](function(_0x153991){if(_0x153991){_0x55962f[_0xb9ba('0xc')]=_0x153991[_0xb9ba('0x10')];_0x55962f['internal']=_0x153991[_0xb9ba('0x11')];utils[_0xb9ba('0x12')]('CreateMemberReport',_0x55962f);}else{utils['getUserByName'](_0x55962f[_0xb9ba('0x9')][_0xb9ba('0x13')]('/')[0x1])[_0xb9ba('0xf')](function(_0x46af3c){if(_0x46af3c){_0x55962f[_0xb9ba('0xc')]=_0x46af3c[_0xb9ba('0x10')];_0x55962f[_0xb9ba('0x11')]=_0x46af3c[_0xb9ba('0x11')];utils['request'](_0xb9ba('0x14'),_0x55962f);}});}})[_0xb9ba('0x15')](function(_0x1d9ef4){utils['error'](_0x1d9ef4);});}delete members[_0x55962f[_0xb9ba('0x9')]];}function startsWith(_0x518056,_0xec8c91){return _[_0xb9ba('0x16')](_0x518056,function(_0x51f863){return _[_0xb9ba('0x17')](_0xec8c91,_0x51f863);});}exports[_0xb9ba('0x18')]=function(_0x3fa06f){switch(_0x3fa06f['state']){case _0xb9ba('0x19'):case _0xb9ba('0x1a'):if(!startsWith(exclude,_0x3fa06f[_0xb9ba('0x1b')])){members[_0x3fa06f['device']]={'channel':_0xb9ba('0x1c'),'interface':_0x3fa06f[_0xb9ba('0x1b')],'type':_0xb9ba('0x1d'),'enterAt':utils[_0xb9ba('0x1e')](),'role':_0xb9ba('0x1f')};}break;case'NOT_INUSE':if(!_[_0xb9ba('0x20')](members[_0x3fa06f[_0xb9ba('0x1b')]])){members[_0x3fa06f['device']]['exitAt']=utils[_0xb9ba('0x1e')]();members[_0x3fa06f[_0xb9ba('0x1b')]][_0xb9ba('0x21')]=utils[_0xb9ba('0x22')](members[_0x3fa06f[_0xb9ba('0x1b')]][_0xb9ba('0x23')],members[_0x3fa06f['device']][_0xb9ba('0x24')]);if(members[_0x3fa06f[_0xb9ba('0x1b')]]['uniqueid']){writeDB(members[_0x3fa06f[_0xb9ba('0x1b')]]);}}default:break;}};exports[_0xb9ba('0x25')]=function(_0xac5db){if(!_[_0xb9ba('0x20')](members[_0xac5db[_0xb9ba('0x9')]])){members[_0xac5db[_0xb9ba('0x9')]]=_[_0xb9ba('0x26')](members[_0xac5db[_0xb9ba('0x9')]],{'data4':_0xac5db[_0xb9ba('0x27')],'uniqueid':_0xac5db[_0xb9ba('0x8')]});}};exports[_0xb9ba('0x28')]=function(_0x52d8c6){if(_0x52d8c6[_0xb9ba('0xa')]){var _0x993539=_0x52d8c6[_0xb9ba('0xa')][_0xb9ba('0x13')]('-')[0x0];if(!_[_0xb9ba('0x20')](members[_0x993539])){members[_0x993539]=_['assign'](members[_0x993539],{'data1':members[_0x993539][_0xb9ba('0x29')]||_0x52d8c6[_0xb9ba('0xd')],'data2':members[_0x993539][_0xb9ba('0xb')]||_0x52d8c6['source'],'data3':members[_0x993539]['data3']||_0x52d8c6[_0xb9ba('0x2a')],'uniqueid':members[_0x993539][_0xb9ba('0x8')]||_0x52d8c6[_0xb9ba('0x8')]});if(members[_0x993539]['exitAt']){writeDB(members[_0x993539]);}}}if(_0x52d8c6[_0xb9ba('0x2b')]){var _0x32769c=_0x52d8c6[_0xb9ba('0x2b')][_0xb9ba('0x13')]('-')[0x0];if(!_[_0xb9ba('0x20')](members[_0x32769c])){members[_0x32769c]=_[_0xb9ba('0x26')](members[_0x32769c],{'data1':members[_0x32769c][_0xb9ba('0x29')]||_0x52d8c6[_0xb9ba('0xd')],'data2':members[_0x32769c][_0xb9ba('0xb')]||_0x52d8c6[_0xb9ba('0x2c')],'data3':members[_0x32769c][_0xb9ba('0x2d')]||_0x52d8c6['destination'],'uniqueid':members[_0x32769c][_0xb9ba('0x8')]||_0x52d8c6['uniqueid']});if(members[_0x32769c]['exitAt']){writeDB(members[_0x32769c]);}}}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 12aa847..05a6d09 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 _0xded8=['musiconholdstartAt','diffTime','lodash','./utils','info','format','queue','lastAssignedTo','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','uniqueid','assign','position','hangup','isNil','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','now','COMPLETEDBYAGENT','varset','variable','queuestatus','value','toUpperCase','CONTINUE','queuecallerexit','queuecallerexitAt','queuecallerabandon','queuecallerabandonAt','EXITWITHKEY','ABANDONED','queuecallerleave','holdtime','queuecallerjoinAt','count','connectedlinenum','agentconnect','assigned','destaccountcode','membername','reason','transfer','TRANSFER','blindtransfer','transfereeuniqueid','transfertype','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','ATTENDED','origtransfererexten','ATTENDEDTRANSFER','transfereelinkedid','queuecallerenterreason','transfertargetuniqueid','calleridnum','calleridname','mohtime','secondtransfererexten','secondtransfereruniqueid','transfertargetlinkedid','error','stack','musiconholdstart','musiconholdstop'];(function(_0x209603,_0x351b88){var _0x3e06d4=function(_0x4e9655){while(--_0x4e9655){_0x209603['push'](_0x209603['shift']());}};_0x3e06d4(++_0x351b88);}(_0xded8,0x9e));var _0x8ded=function(_0x2d4edd,_0x435148){_0x2d4edd=_0x2d4edd-0x0;var _0x3a6113=_0xded8[_0x2d4edd];return _0x3a6113;};'use strict';var _=require(_0x8ded('0x0'));var util=require('util');var utils=require(_0x8ded('0x1'));var queues={};function writeDB(_0x2427a0){utils[_0x8ded('0x2')](util[_0x8ded('0x3')]('QUEUE|%s|%s|%s|%s|%s|%s|%s',_0x2427a0['uniqueid'],_0x2427a0['channel'],_0x2427a0[_0x8ded('0x4')],_0x2427a0[_0x8ded('0x5')],_0x2427a0['calleridnum'],_0x2427a0[_0x8ded('0x6')],_0x2427a0[_0x8ded('0x7')]));if(_0x2427a0[_0x8ded('0x4')]){utils[_0x8ded('0x8')](_0x2427a0[_0x8ded('0x4')])[_0x8ded('0x9')](function(_0x1d5a31){if(_0x1d5a31){_0x2427a0[_0x8ded('0xa')]=_0x1d5a31[_0x8ded('0xa')];}utils['request']('CreateVoiceQueueReport',_0x2427a0);});}else{utils[_0x8ded('0xb')](_0x8ded('0xc'),_0x2427a0);}if(_0x2427a0[_0x8ded('0xd')]){delete queues[_0x2427a0[_0x8ded('0xd')]];}else{delete queues[_0x2427a0[_0x8ded('0xe')]];}}exports['queuecallerjoin']=function(_0x3769bc){queues[_0x3769bc['uniqueid']]=_[_0x8ded('0xf')](_0x3769bc,{'originalposition':_0x3769bc[_0x8ded('0x10')],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});};exports[_0x8ded('0x11')]=function(_0x546c82){if(!_[_0x8ded('0x12')](queues[_0x546c82[_0x8ded('0xe')]])){if(queues[_0x546c82[_0x8ded('0xe')]][_0x8ded('0x13')]){if(!queues[_0x546c82['uniqueid']]['queuecallerabandon']&&!queues[_0x546c82[_0x8ded('0xe')]]['queuecallerexit']){queues[_0x546c82[_0x8ded('0xe')]][_0x8ded('0x14')]=!![];queues[_0x546c82['uniqueid']][_0x8ded('0x15')]=utils[_0x8ded('0x16')]();queues[_0x546c82[_0x8ded('0xe')]][_0x8ded('0x7')]=_0x8ded('0x17');}writeDB(queues[_0x546c82[_0x8ded('0xe')]]);}else{if(queues[_0x546c82['uniqueid']][_0x8ded('0xd')]){queues[queues[_0x546c82['uniqueid']][_0x8ded('0xd')]]=queues[_0x546c82[_0x8ded('0xe')]];queues[queues[_0x546c82['uniqueid']][_0x8ded('0xd')]]['queuecallerenterreason']=0x2;delete queues[_0x546c82[_0x8ded('0xe')]];}}}};exports[_0x8ded('0x18')]=function(_0x1deb06){if(!_[_0x8ded('0x12')](_0x1deb06[_0x8ded('0x19')][_0x8ded('0x1a')])&&_0x1deb06[_0x8ded('0x1b')][_0x8ded('0x1c')]()!==_0x8ded('0x1d')){if(!_[_0x8ded('0x12')](queues[_0x1deb06[_0x8ded('0xe')]])){queues[_0x1deb06[_0x8ded('0xe')]]['queuecallerabandon']=![];queues[_0x1deb06[_0x8ded('0xe')]]['queuecallerabandonAt']=null;queues[_0x1deb06['uniqueid']][_0x8ded('0x1e')]=!![];queues[_0x1deb06[_0x8ded('0xe')]][_0x8ded('0x1f')]=utils['now']();queues[_0x1deb06[_0x8ded('0xe')]][_0x8ded('0x7')]=_0x1deb06['value'][_0x8ded('0x1c')]();writeDB(queues[_0x1deb06[_0x8ded('0xe')]]);}}else if(!_['isNil'](_0x1deb06[_0x8ded('0x19')]['queueposition'])){if(!_[_0x8ded('0x12')](queues[_0x1deb06[_0x8ded('0xe')]])&&!queues[_0x1deb06['uniqueid']][_0x8ded('0x20')]){queues[_0x1deb06['uniqueid']]['queuecallerabandon']=![];queues[_0x1deb06[_0x8ded('0xe')]][_0x8ded('0x21')]=null;queues[_0x1deb06[_0x8ded('0xe')]][_0x8ded('0x1e')]=!![];queues[_0x1deb06['uniqueid']]['queuecallerexitAt']=utils['now']();queues[_0x1deb06[_0x8ded('0xe')]][_0x8ded('0x7')]=_0x8ded('0x22');}}};exports[_0x8ded('0x20')]=function(_0x19ebf4){if(!_[_0x8ded('0x12')](queues[_0x19ebf4[_0x8ded('0xe')]])){queues[_0x19ebf4[_0x8ded('0xe')]][_0x8ded('0x1e')]=![];queues[_0x19ebf4[_0x8ded('0xe')]]['queuecallerexitAt']=null;queues[_0x19ebf4[_0x8ded('0xe')]][_0x8ded('0x20')]=!![];queues[_0x19ebf4[_0x8ded('0xe')]][_0x8ded('0x21')]=utils['now']();queues[_0x19ebf4['uniqueid']][_0x8ded('0x7')]=_0x8ded('0x23');}};exports[_0x8ded('0x24')]=function(_0x4fed6e){if(!_[_0x8ded('0x12')](queues[_0x4fed6e['uniqueid']])){queues[_0x4fed6e[_0x8ded('0xe')]][_0x8ded('0x24')]=!![];queues[_0x4fed6e[_0x8ded('0xe')]][_0x8ded('0x13')]=utils[_0x8ded('0x16')]();queues[_0x4fed6e[_0x8ded('0xe')]][_0x8ded('0x25')]=utils['diffTime'](queues[_0x4fed6e[_0x8ded('0xe')]][_0x8ded('0x13')],queues[_0x4fed6e['uniqueid']][_0x8ded('0x26')]);queues[_0x4fed6e[_0x8ded('0xe')]]['position']=_0x4fed6e[_0x8ded('0x10')];queues[_0x4fed6e['uniqueid']][_0x8ded('0x27')]=_0x4fed6e[_0x8ded('0x27')];queues[_0x4fed6e[_0x8ded('0xe')]][_0x8ded('0x28')]=_0x4fed6e[_0x8ded('0x28')];queues[_0x4fed6e['uniqueid']]['connectedlinename']=_0x4fed6e['connectedlinename'];}};exports[_0x8ded('0x29')]=function(_0x534a45){if(!_[_0x8ded('0x12')](queues[_0x534a45[_0x8ded('0xe')]])){queues[_0x534a45['uniqueid']][_0x8ded('0x20')]=![];queues[_0x534a45[_0x8ded('0xe')]]['queuecallerabandon']=![];queues[_0x534a45[_0x8ded('0xe')]][_0x8ded('0x21')]=null;queues[_0x534a45[_0x8ded('0xe')]][_0x8ded('0x1e')]=![];queues[_0x534a45[_0x8ded('0xe')]][_0x8ded('0x7')]=null;queues[_0x534a45[_0x8ded('0xe')]]['queuecallerexitAt']=null;queues[_0x534a45[_0x8ded('0xe')]][_0x8ded('0x2a')]=!![];queues[_0x534a45['uniqueid']][_0x8ded('0x6')]=_0x534a45[_0x8ded('0x2b')];queues[_0x534a45[_0x8ded('0xe')]][_0x8ded('0x5')]=_0x534a45[_0x8ded('0x2c')];}};exports['agentcomplete']=function(_0x52322a){if(!_[_0x8ded('0x12')](queues[_0x52322a['uniqueid']])){if(queues[_0x52322a[_0x8ded('0xe')]][_0x8ded('0x13')]){queues[_0x52322a['uniqueid']][_0x8ded('0x20')]=![];queues[_0x52322a['uniqueid']][_0x8ded('0x20')]=![];queues[_0x52322a[_0x8ded('0xe')]]['queuecallerabandonAt']=null;queues[_0x52322a[_0x8ded('0xe')]][_0x8ded('0x1e')]=![];queues[_0x52322a[_0x8ded('0xe')]]['queuecallerexitAt']=null;queues[_0x52322a['uniqueid']][_0x8ded('0x2a')]=!![];queues[_0x52322a[_0x8ded('0xe')]][_0x8ded('0x5')]=_0x52322a[_0x8ded('0x2c')];queues[_0x52322a['uniqueid']]['queuecallercomplete']=!![];queues[_0x52322a[_0x8ded('0xe')]]['queuecallercompleteAt']=utils[_0x8ded('0x16')]();if(_0x52322a[_0x8ded('0x2d')]==_0x8ded('0x2e')){if(!queues[_0x52322a['uniqueid']]['transfer']){queues[_0x52322a[_0x8ded('0xe')]][_0x8ded('0x7')]=_0x8ded('0x2f');}}else{queues[_0x52322a[_0x8ded('0xe')]]['queuecallerexitreason']='COMPLETEDBY'+_0x52322a[_0x8ded('0x2d')][_0x8ded('0x1c')]();}writeDB(queues[_0x52322a['uniqueid']]);}}};exports[_0x8ded('0x30')]=function(_0x2da1c6){if(!_[_0x8ded('0x12')](queues[_0x2da1c6['transfereeuniqueid']])){queues[_0x2da1c6[_0x8ded('0x31')]]['transfer']=!![];queues[_0x2da1c6[_0x8ded('0x31')]][_0x8ded('0x32')]=_0x8ded('0x33');queues[_0x2da1c6[_0x8ded('0x31')]][_0x8ded('0x34')]=_0x2da1c6[_0x8ded('0x35')];queues[_0x2da1c6['transfereeuniqueid']][_0x8ded('0x36')]=_0x2da1c6[_0x8ded('0x31')];queues[_0x2da1c6[_0x8ded('0x31')]][_0x8ded('0x7')]=_0x8ded('0x37');}};exports[_0x8ded('0x38')]=function(_0x55d368){try{if(_0x55d368[_0x8ded('0x39')]==_0x55d368[_0x8ded('0x3a')]){if(!_[_0x8ded('0x12')](queues[_0x55d368[_0x8ded('0x3b')]])){queues[_0x55d368['secondtransfererlinkedid']][_0x8ded('0x2e')]=!![];queues[_0x55d368[_0x8ded('0x3b')]][_0x8ded('0x32')]=_0x8ded('0x3c');queues[_0x55d368[_0x8ded('0x3b')]][_0x8ded('0x34')]=_0x55d368[_0x8ded('0x3d')];queues[_0x55d368['secondtransfererlinkedid']][_0x8ded('0x36')]=_0x55d368[_0x8ded('0x39')];queues[_0x55d368[_0x8ded('0x3b')]][_0x8ded('0x7')]=_0x8ded('0x3e');}if(!_[_0x8ded('0x12')](queues[_0x55d368['origtransfererlinkedid']])){if(_0x55d368[_0x8ded('0x3f')]&&queues[_0x55d368[_0x8ded('0x3f')]]){queues[_0x55d368[_0x8ded('0x3f')]][_0x8ded('0x40')]=0x1;queues[_0x55d368[_0x8ded('0x31')]]=_['clone'](queues[_0x55d368[_0x8ded('0x3f')]]);queues[_0x55d368[_0x8ded('0x31')]]['transfereduniqueid']=_0x55d368[_0x8ded('0x41')];queues[_0x55d368['transfereeuniqueid']][_0x8ded('0x40')]=0x2;queues[_0x55d368[_0x8ded('0x31')]][_0x8ded('0x42')]=queues[_0x55d368[_0x8ded('0x3b')]][_0x8ded('0x42')];queues[_0x55d368[_0x8ded('0x31')]]['calleridname']=queues[_0x55d368['secondtransfererlinkedid']][_0x8ded('0x43')];queues[_0x55d368['transfereeuniqueid']][_0x8ded('0x26')]=utils[_0x8ded('0x16')]();queues[_0x55d368[_0x8ded('0x31')]][_0x8ded('0x13')]=utils['now']();queues[_0x55d368[_0x8ded('0x31')]][_0x8ded('0x25')]=0x0;queues[_0x55d368[_0x8ded('0x31')]][_0x8ded('0x44')]=0x0;}else{queues[_0x55d368[_0x8ded('0x3a')]][_0x8ded('0xd')]=_0x55d368[_0x8ded('0x3b')];}}}else if(_0x55d368['secondtransfereruniqueid']==_0x55d368['secondtransfererlinkedid']){if(!_[_0x8ded('0x12')](queues[_0x55d368[_0x8ded('0x3a')]])){queues[_0x55d368[_0x8ded('0x3a')]][_0x8ded('0x2e')]=!![];queues[_0x55d368[_0x8ded('0x3a')]][_0x8ded('0x32')]='ATTENDED';queues[_0x55d368[_0x8ded('0x3a')]][_0x8ded('0x34')]=_0x55d368[_0x8ded('0x45')];queues[_0x55d368[_0x8ded('0x3a')]][_0x8ded('0x36')]=_0x55d368[_0x8ded('0x46')];queues[_0x55d368['origtransfererlinkedid']][_0x8ded('0x7')]=_0x8ded('0x3e');}if(!_['isNil'](queues[_0x55d368[_0x8ded('0x3b')]])){if(_0x55d368[_0x8ded('0x47')]&&queues[_0x55d368['transfertargetlinkedid']]){queues[_0x55d368[_0x8ded('0x47')]][_0x8ded('0x40')]=0x1;queues[_0x55d368[_0x8ded('0x41')]]=_['clone'](queues[_0x55d368['transfertargetlinkedid']]);queues[_0x55d368['transfertargetuniqueid']][_0x8ded('0xd')]=_0x55d368['transfertargetuniqueid'];queues[_0x55d368[_0x8ded('0x41')]][_0x8ded('0x40')]=0x2;queues[_0x55d368[_0x8ded('0x41')]][_0x8ded('0x42')]=queues[_0x55d368[_0x8ded('0x3a')]][_0x8ded('0x42')];queues[_0x55d368[_0x8ded('0x41')]]['calleridname']=queues[_0x55d368[_0x8ded('0x3a')]]['calleridname'];queues[_0x55d368[_0x8ded('0x41')]][_0x8ded('0x26')]=utils[_0x8ded('0x16')]();queues[_0x55d368[_0x8ded('0x41')]][_0x8ded('0x13')]=utils[_0x8ded('0x16')]();queues[_0x55d368[_0x8ded('0x41')]][_0x8ded('0x25')]=0x0;queues[_0x55d368[_0x8ded('0x41')]][_0x8ded('0x44')]=0x0;}else{queues[_0x55d368[_0x8ded('0x3b')]][_0x8ded('0xd')]=_0x55d368[_0x8ded('0x3a')];}}}}catch(_0x2a7dea){utils[_0x8ded('0x48')](_0x2a7dea[_0x8ded('0x49')]);}};exports[_0x8ded('0x4a')]=function(_0x417559){if(!_['isNil'](queues[_0x417559[_0x8ded('0xe')]])){queues[_0x417559['uniqueid']]['musiconholdstartAt']=utils[_0x8ded('0x16')]();}};exports[_0x8ded('0x4b')]=function(_0x2d62b8){if(!_[_0x8ded('0x12')](queues[_0x2d62b8[_0x8ded('0xe')]])){if(!_[_0x8ded('0x12')](queues[_0x2d62b8['uniqueid']][_0x8ded('0x4c')])){queues[_0x2d62b8[_0x8ded('0xe')]][_0x8ded('0x44')]+=utils[_0x8ded('0x4d')](utils['now'](),queues[_0x2d62b8['uniqueid']][_0x8ded('0x4c')]);delete queues[_0x2d62b8[_0x8ded('0xe')]][_0x8ded('0x4c')];}}}; \ No newline at end of file +var _0x706a=['queueposition','queuecallerabandonAt','queuecallerexitAt','EXITWITHKEY','holdtime','diffTime','queuecallerjoinAt','position','count','connectedlinenum','connectedlinename','assigned','destaccountcode','membername','agentcomplete','queuecallercompleteAt','reason','transfer','TRANSFER','blindtransfer','transfereeuniqueid','transfertype','BLIND','transferuniqueid','BLINDTRANSFER','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','ATTENDED','transferexten','origtransfererexten','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridname','mohtime','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','error','musiconholdstart','musiconholdstartAt','lodash','util','./utils','info','format','QUEUE|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','queue','lastAssignedTo','calleridnum','accountcode','getVoiceQueueByName','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','assign','now','hangup','queuecallerleaveAt','queuecallerabandon','queuecallercomplete','queuecallerexitreason','COMPLETEDBYAGENT','queuecallerenterreason','isNil','variable','queuestatus','value','toUpperCase','CONTINUE','queuecallerexit'];(function(_0x52f159,_0x419d8a){var _0x156799=function(_0xf168e8){while(--_0xf168e8){_0x52f159['push'](_0x52f159['shift']());}};_0x156799(++_0x419d8a);}(_0x706a,0x7a));var _0xa706=function(_0x43d16c,_0x2b5447){_0x43d16c=_0x43d16c-0x0;var _0x208cce=_0x706a[_0x43d16c];return _0x208cce;};'use strict';var _=require(_0xa706('0x0'));var util=require(_0xa706('0x1'));var utils=require(_0xa706('0x2'));var queues={};function writeDB(_0x53cfcc){utils[_0xa706('0x3')](util[_0xa706('0x4')](_0xa706('0x5'),_0x53cfcc[_0xa706('0x6')],_0x53cfcc[_0xa706('0x7')],_0x53cfcc[_0xa706('0x8')],_0x53cfcc[_0xa706('0x9')],_0x53cfcc[_0xa706('0xa')],_0x53cfcc[_0xa706('0xb')],_0x53cfcc['queuecallerexitreason']));if(_0x53cfcc[_0xa706('0x8')]){utils[_0xa706('0xc')](_0x53cfcc[_0xa706('0x8')])['then'](function(_0x2821f3){if(_0x2821f3){_0x53cfcc[_0xa706('0xd')]=_0x2821f3[_0xa706('0xd')];}utils['request']('CreateVoiceQueueReport',_0x53cfcc);});}else{utils[_0xa706('0xe')](_0xa706('0xf'),_0x53cfcc);}if(_0x53cfcc[_0xa706('0x10')]){delete queues[_0x53cfcc[_0xa706('0x10')]];}else{delete queues[_0x53cfcc[_0xa706('0x6')]];}}exports[_0xa706('0x11')]=function(_0x2e9703){queues[_0x2e9703[_0xa706('0x6')]]=_[_0xa706('0x12')](_0x2e9703,{'originalposition':_0x2e9703['position'],'queuecallerjoinAt':utils[_0xa706('0x13')](),'mohtime':0x0});};exports[_0xa706('0x14')]=function(_0x1f5d77){if(!_['isNil'](queues[_0x1f5d77[_0xa706('0x6')]])){if(queues[_0x1f5d77[_0xa706('0x6')]][_0xa706('0x15')]){if(!queues[_0x1f5d77[_0xa706('0x6')]][_0xa706('0x16')]&&!queues[_0x1f5d77['uniqueid']]['queuecallerexit']){queues[_0x1f5d77[_0xa706('0x6')]][_0xa706('0x17')]=!![];queues[_0x1f5d77[_0xa706('0x6')]]['queuecallercompleteAt']=utils[_0xa706('0x13')]();queues[_0x1f5d77['uniqueid']][_0xa706('0x18')]=_0xa706('0x19');}writeDB(queues[_0x1f5d77['uniqueid']]);}else{if(queues[_0x1f5d77[_0xa706('0x6')]][_0xa706('0x10')]){queues[queues[_0x1f5d77[_0xa706('0x6')]][_0xa706('0x10')]]=queues[_0x1f5d77['uniqueid']];queues[queues[_0x1f5d77[_0xa706('0x6')]][_0xa706('0x10')]][_0xa706('0x1a')]=0x2;delete queues[_0x1f5d77[_0xa706('0x6')]];}}}};exports['varset']=function(_0x25d411){if(!_[_0xa706('0x1b')](_0x25d411[_0xa706('0x1c')][_0xa706('0x1d')])&&_0x25d411[_0xa706('0x1e')][_0xa706('0x1f')]()!==_0xa706('0x20')){if(!_[_0xa706('0x1b')](queues[_0x25d411[_0xa706('0x6')]])){queues[_0x25d411[_0xa706('0x6')]][_0xa706('0x16')]=![];queues[_0x25d411['uniqueid']]['queuecallerabandonAt']=null;queues[_0x25d411[_0xa706('0x6')]][_0xa706('0x21')]=!![];queues[_0x25d411[_0xa706('0x6')]]['queuecallerexitAt']=utils[_0xa706('0x13')]();queues[_0x25d411[_0xa706('0x6')]][_0xa706('0x18')]=_0x25d411['value'][_0xa706('0x1f')]();writeDB(queues[_0x25d411[_0xa706('0x6')]]);}}else if(!_['isNil'](_0x25d411[_0xa706('0x1c')][_0xa706('0x22')])){if(!_[_0xa706('0x1b')](queues[_0x25d411[_0xa706('0x6')]])&&!queues[_0x25d411['uniqueid']][_0xa706('0x16')]){queues[_0x25d411[_0xa706('0x6')]][_0xa706('0x16')]=![];queues[_0x25d411[_0xa706('0x6')]][_0xa706('0x23')]=null;queues[_0x25d411[_0xa706('0x6')]][_0xa706('0x21')]=!![];queues[_0x25d411[_0xa706('0x6')]][_0xa706('0x24')]=utils['now']();queues[_0x25d411['uniqueid']][_0xa706('0x18')]=_0xa706('0x25');}}};exports[_0xa706('0x16')]=function(_0x15f6d5){if(!_[_0xa706('0x1b')](queues[_0x15f6d5['uniqueid']])){queues[_0x15f6d5['uniqueid']]['queuecallerexit']=![];queues[_0x15f6d5[_0xa706('0x6')]][_0xa706('0x24')]=null;queues[_0x15f6d5[_0xa706('0x6')]]['queuecallerabandon']=!![];queues[_0x15f6d5['uniqueid']][_0xa706('0x23')]=utils['now']();queues[_0x15f6d5[_0xa706('0x6')]]['queuecallerexitreason']='ABANDONED';}};exports['queuecallerleave']=function(_0x14343a){if(!_[_0xa706('0x1b')](queues[_0x14343a['uniqueid']])){queues[_0x14343a[_0xa706('0x6')]]['queuecallerleave']=!![];queues[_0x14343a[_0xa706('0x6')]][_0xa706('0x15')]=utils[_0xa706('0x13')]();queues[_0x14343a[_0xa706('0x6')]][_0xa706('0x26')]=utils[_0xa706('0x27')](queues[_0x14343a['uniqueid']][_0xa706('0x15')],queues[_0x14343a['uniqueid']][_0xa706('0x28')]);queues[_0x14343a[_0xa706('0x6')]][_0xa706('0x29')]=_0x14343a['position'];queues[_0x14343a[_0xa706('0x6')]][_0xa706('0x2a')]=_0x14343a[_0xa706('0x2a')];queues[_0x14343a[_0xa706('0x6')]][_0xa706('0x2b')]=_0x14343a[_0xa706('0x2b')];queues[_0x14343a[_0xa706('0x6')]][_0xa706('0x2c')]=_0x14343a[_0xa706('0x2c')];}};exports['agentconnect']=function(_0xaa28d6){if(!_[_0xa706('0x1b')](queues[_0xaa28d6[_0xa706('0x6')]])){queues[_0xaa28d6['uniqueid']][_0xa706('0x16')]=![];queues[_0xaa28d6[_0xa706('0x6')]][_0xa706('0x16')]=![];queues[_0xaa28d6[_0xa706('0x6')]][_0xa706('0x23')]=null;queues[_0xaa28d6[_0xa706('0x6')]][_0xa706('0x21')]=![];queues[_0xaa28d6[_0xa706('0x6')]][_0xa706('0x18')]=null;queues[_0xaa28d6['uniqueid']][_0xa706('0x24')]=null;queues[_0xaa28d6[_0xa706('0x6')]][_0xa706('0x2d')]=!![];queues[_0xaa28d6[_0xa706('0x6')]][_0xa706('0xb')]=_0xaa28d6[_0xa706('0x2e')];queues[_0xaa28d6[_0xa706('0x6')]][_0xa706('0x9')]=_0xaa28d6[_0xa706('0x2f')];}};exports[_0xa706('0x30')]=function(_0x5916a7){if(!_[_0xa706('0x1b')](queues[_0x5916a7[_0xa706('0x6')]])){if(queues[_0x5916a7['uniqueid']]['queuecallerleaveAt']){queues[_0x5916a7[_0xa706('0x6')]][_0xa706('0x16')]=![];queues[_0x5916a7['uniqueid']][_0xa706('0x16')]=![];queues[_0x5916a7[_0xa706('0x6')]][_0xa706('0x23')]=null;queues[_0x5916a7[_0xa706('0x6')]][_0xa706('0x21')]=![];queues[_0x5916a7[_0xa706('0x6')]]['queuecallerexitAt']=null;queues[_0x5916a7[_0xa706('0x6')]][_0xa706('0x2d')]=!![];queues[_0x5916a7[_0xa706('0x6')]][_0xa706('0x9')]=_0x5916a7[_0xa706('0x2f')];queues[_0x5916a7[_0xa706('0x6')]][_0xa706('0x17')]=!![];queues[_0x5916a7[_0xa706('0x6')]][_0xa706('0x31')]=utils[_0xa706('0x13')]();if(_0x5916a7[_0xa706('0x32')]==_0xa706('0x33')){if(!queues[_0x5916a7['uniqueid']][_0xa706('0x33')]){queues[_0x5916a7['uniqueid']][_0xa706('0x18')]=_0xa706('0x34');}}else{queues[_0x5916a7[_0xa706('0x6')]][_0xa706('0x18')]='COMPLETEDBY'+_0x5916a7[_0xa706('0x32')][_0xa706('0x1f')]();}writeDB(queues[_0x5916a7[_0xa706('0x6')]]);}}};exports[_0xa706('0x35')]=function(_0x50dfc5){if(!_[_0xa706('0x1b')](queues[_0x50dfc5[_0xa706('0x36')]])){queues[_0x50dfc5[_0xa706('0x36')]][_0xa706('0x33')]=!![];queues[_0x50dfc5['transfereeuniqueid']][_0xa706('0x37')]=_0xa706('0x38');queues[_0x50dfc5[_0xa706('0x36')]]['transferexten']=_0x50dfc5['extension'];queues[_0x50dfc5[_0xa706('0x36')]][_0xa706('0x39')]=_0x50dfc5['transfereeuniqueid'];queues[_0x50dfc5[_0xa706('0x36')]][_0xa706('0x18')]=_0xa706('0x3a');}};exports[_0xa706('0x3b')]=function(_0x28f92d){try{if(_0x28f92d[_0xa706('0x3c')]==_0x28f92d[_0xa706('0x3d')]){if(!_[_0xa706('0x1b')](queues[_0x28f92d['secondtransfererlinkedid']])){queues[_0x28f92d[_0xa706('0x3e')]]['transfer']=!![];queues[_0x28f92d[_0xa706('0x3e')]]['transfertype']=_0xa706('0x3f');queues[_0x28f92d[_0xa706('0x3e')]][_0xa706('0x40')]=_0x28f92d[_0xa706('0x41')];queues[_0x28f92d[_0xa706('0x3e')]][_0xa706('0x39')]=_0x28f92d[_0xa706('0x3c')];queues[_0x28f92d[_0xa706('0x3e')]][_0xa706('0x18')]=_0xa706('0x42');}if(!_[_0xa706('0x1b')](queues[_0x28f92d[_0xa706('0x3d')]])){if(_0x28f92d[_0xa706('0x43')]&&queues[_0x28f92d[_0xa706('0x43')]]){queues[_0x28f92d['transfereelinkedid']][_0xa706('0x1a')]=0x1;queues[_0x28f92d['transfereeuniqueid']]=_[_0xa706('0x44')](queues[_0x28f92d[_0xa706('0x43')]]);queues[_0x28f92d[_0xa706('0x36')]]['transfereduniqueid']=_0x28f92d[_0xa706('0x45')];queues[_0x28f92d[_0xa706('0x36')]][_0xa706('0x1a')]=0x2;queues[_0x28f92d[_0xa706('0x36')]][_0xa706('0xa')]=queues[_0x28f92d[_0xa706('0x3e')]][_0xa706('0xa')];queues[_0x28f92d[_0xa706('0x36')]][_0xa706('0x46')]=queues[_0x28f92d['secondtransfererlinkedid']][_0xa706('0x46')];queues[_0x28f92d[_0xa706('0x36')]]['queuecallerjoinAt']=utils[_0xa706('0x13')]();queues[_0x28f92d['transfereeuniqueid']][_0xa706('0x15')]=utils[_0xa706('0x13')]();queues[_0x28f92d[_0xa706('0x36')]]['holdtime']=0x0;queues[_0x28f92d['transfereeuniqueid']][_0xa706('0x47')]=0x0;}else{queues[_0x28f92d[_0xa706('0x3d')]]['transfereduniqueid']=_0x28f92d['secondtransfererlinkedid'];}}}else if(_0x28f92d[_0xa706('0x48')]==_0x28f92d[_0xa706('0x3e')]){if(!_[_0xa706('0x1b')](queues[_0x28f92d[_0xa706('0x3d')]])){queues[_0x28f92d[_0xa706('0x3d')]]['transfer']=!![];queues[_0x28f92d[_0xa706('0x3d')]][_0xa706('0x37')]=_0xa706('0x3f');queues[_0x28f92d[_0xa706('0x3d')]][_0xa706('0x40')]=_0x28f92d[_0xa706('0x49')];queues[_0x28f92d[_0xa706('0x3d')]][_0xa706('0x39')]=_0x28f92d[_0xa706('0x48')];queues[_0x28f92d[_0xa706('0x3d')]]['queuecallerexitreason']=_0xa706('0x42');}if(!_[_0xa706('0x1b')](queues[_0x28f92d[_0xa706('0x3e')]])){if(_0x28f92d[_0xa706('0x4a')]&&queues[_0x28f92d['transfertargetlinkedid']]){queues[_0x28f92d[_0xa706('0x4a')]][_0xa706('0x1a')]=0x1;queues[_0x28f92d[_0xa706('0x45')]]=_['clone'](queues[_0x28f92d[_0xa706('0x4a')]]);queues[_0x28f92d[_0xa706('0x45')]][_0xa706('0x10')]=_0x28f92d[_0xa706('0x45')];queues[_0x28f92d[_0xa706('0x45')]][_0xa706('0x1a')]=0x2;queues[_0x28f92d[_0xa706('0x45')]][_0xa706('0xa')]=queues[_0x28f92d[_0xa706('0x3d')]][_0xa706('0xa')];queues[_0x28f92d[_0xa706('0x45')]][_0xa706('0x46')]=queues[_0x28f92d[_0xa706('0x3d')]][_0xa706('0x46')];queues[_0x28f92d[_0xa706('0x45')]][_0xa706('0x28')]=utils[_0xa706('0x13')]();queues[_0x28f92d[_0xa706('0x45')]]['queuecallerleaveAt']=utils[_0xa706('0x13')]();queues[_0x28f92d['transfertargetuniqueid']]['holdtime']=0x0;queues[_0x28f92d['transfertargetuniqueid']][_0xa706('0x47')]=0x0;}else{queues[_0x28f92d['secondtransfererlinkedid']][_0xa706('0x10')]=_0x28f92d[_0xa706('0x3d')];}}}}catch(_0x59182c){utils[_0xa706('0x4b')](_0x59182c['stack']);}};exports[_0xa706('0x4c')]=function(_0x3b2fa8){if(!_['isNil'](queues[_0x3b2fa8['uniqueid']])){queues[_0x3b2fa8['uniqueid']]['musiconholdstartAt']=utils[_0xa706('0x13')]();}};exports['musiconholdstop']=function(_0x4cd8cd){if(!_[_0xa706('0x1b')](queues[_0x4cd8cd[_0xa706('0x6')]])){if(!_[_0xa706('0x1b')](queues[_0x4cd8cd[_0xa706('0x6')]]['musiconholdstartAt'])){queues[_0x4cd8cd[_0xa706('0x6')]][_0xa706('0x47')]+=utils['diffTime'](utils[_0xa706('0x13')](),queues[_0x4cd8cd[_0xa706('0x6')]]['musiconholdstartAt']);delete queues[_0x4cd8cd['uniqueid']][_0xa706('0x4d')];}}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index c981cf4..3f8e36b 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 _0xe706=['CreateVoiceRecording','newchannel','uniqueid','linkedid','exten','context','channel','error','isNil','channelstate','stack','varset','variable','value','.WAV','find','monitors','hangup','calleridname','connectedlinenum','connectedlinename','forEach','clone','newexten','application','toLowerCase','startsWith','appdata','cdr','split','substring','lastIndexOf','queuecallerjoin','queue','lodash','./utils','accountcode','getUserByInternal','then','membername','name','UserId','request'];(function(_0x296f67,_0x4a12df){var _0x58d01a=function(_0x38561e){while(--_0x38561e){_0x296f67['push'](_0x296f67['shift']());}};_0x58d01a(++_0x4a12df);}(_0xe706,0xa3));var _0x6e70=function(_0x5474b4,_0x5027aa){_0x5474b4=_0x5474b4-0x0;var _0x33a0b5=_0xe706[_0x5474b4];return _0x33a0b5;};'use strict';var _=require(_0x6e70('0x0'));var utils=require(_0x6e70('0x1'));var recordings={};function writeDB(_0x311951){utils['debug'](_0x311951);if(_0x311951[_0x6e70('0x2')]){utils[_0x6e70('0x3')](_0x311951[_0x6e70('0x2')])[_0x6e70('0x4')](function(_0x142c27){if(_0x142c27){_0x311951[_0x6e70('0x5')]=_0x142c27[_0x6e70('0x6')];_0x311951[_0x6e70('0x7')]=_0x142c27['id'];}utils[_0x6e70('0x8')](_0x6e70('0x9'),_0x311951);});}else{utils[_0x6e70('0x8')](_0x6e70('0x9'),_0x311951);}}exports[_0x6e70('0xa')]=function(_0x188ed3){try{if(_0x188ed3[_0x6e70('0xb')]==_0x188ed3[_0x6e70('0xc')]){recordings[_0x188ed3[_0x6e70('0xb')]]={'uniqueid':_0x188ed3[_0x6e70('0xb')],'accountcode':_0x188ed3[_0x6e70('0x2')],'exten':_0x188ed3[_0x6e70('0xd')],'context':_0x188ed3[_0x6e70('0xe')],'channel':_0x188ed3[_0x6e70('0xf')],'monitors':[]};}}catch(_0x37b3e0){utils[_0x6e70('0x10')](_0x37b3e0['stack']);}};exports['newstate']=function(_0x3594c1){try{if(!_[_0x6e70('0x11')](recordings[_0x3594c1[_0x6e70('0xb')]])&&_0x3594c1[_0x6e70('0x12')]==0x6){}else if(!_[_0x6e70('0x11')](recordings[_0x3594c1[_0x6e70('0xc')]])&&_0x3594c1[_0x6e70('0x12')]==0x6&&_0x3594c1[_0x6e70('0xe')]!='transfer'){recordings[_0x3594c1['linkedid']]['accountcode']=_0x3594c1[_0x6e70('0x2')];}}catch(_0x5a37a6){utils['error'](_0x5a37a6[_0x6e70('0x13')]);}};exports[_0x6e70('0x14')]=function(_0x5d9263){try{if(!_[_0x6e70('0x11')](_0x5d9263['variable'])&&!_[_0x6e70('0x11')](_0x5d9263[_0x6e70('0x15')]['mixmonitor_filename'])){if(_['endsWith'](_0x5d9263[_0x6e70('0x16')],'.wav49')){_0x5d9263[_0x6e70('0x16')]=_0x5d9263[_0x6e70('0x16')]['replace']('.wav49',_0x6e70('0x17'));}if(recordings[_0x5d9263[_0x6e70('0xc')]]){var _0x2368eb=_[_0x6e70('0x18')](recordings[_0x5d9263[_0x6e70('0xc')]][_0x6e70('0x19')],{'value':_0x5d9263[_0x6e70('0x16')]});if(_[_0x6e70('0x11')](_0x2368eb)){recordings[_0x5d9263[_0x6e70('0xc')]][_0x6e70('0x19')]['push']({'value':_0x5d9263[_0x6e70('0x16')]});}}}}catch(_0x344b65){utils[_0x6e70('0x10')](_0x344b65['stack']);}};exports[_0x6e70('0x1a')]=function(_0xa5d49){try{if(!_[_0x6e70('0x11')](recordings[_0xa5d49['uniqueid']])){recordings[_0xa5d49[_0x6e70('0xb')]]['calleridnum']=_0xa5d49['calleridnum'];recordings[_0xa5d49['uniqueid']][_0x6e70('0x1b')]=_0xa5d49[_0x6e70('0x1b')];recordings[_0xa5d49['uniqueid']][_0x6e70('0x1c')]=_0xa5d49[_0x6e70('0x1c')];recordings[_0xa5d49['uniqueid']][_0x6e70('0x1d')]=_0xa5d49[_0x6e70('0x1d')];if(recordings[_0xa5d49[_0x6e70('0xb')]]['type']=='outbound'&&recordings[_0xa5d49[_0x6e70('0xb')]][_0x6e70('0x2')]){recordings[_0xa5d49[_0x6e70('0xb')]][_0x6e70('0x1c')]=recordings[_0xa5d49[_0x6e70('0xb')]]['accountcode'];recordings[_0xa5d49[_0x6e70('0xb')]][_0x6e70('0x1d')]='';}recordings[_0xa5d49[_0x6e70('0xb')]][_0x6e70('0x19')][_0x6e70('0x1e')](_0x20a225=>{var _0x3f78d2=_[_0x6e70('0x1f')](recordings[_0xa5d49[_0x6e70('0xb')]]);_0x3f78d2[_0x6e70('0x16')]=_0x20a225['value'];writeDB(_0x3f78d2);});delete recordings[_0xa5d49[_0x6e70('0xb')]];}}catch(_0x50d60b){utils[_0x6e70('0x10')](_0x50d60b['stack']);}};exports[_0x6e70('0x20')]=function(_0x2722e8){try{if(!_[_0x6e70('0x11')](recordings[_0x2722e8['uniqueid']])){if(_0x2722e8[_0x6e70('0x21')][_0x6e70('0x22')]()=='set'&&_[_0x6e70('0x23')](_0x2722e8[_0x6e70('0x24')]['toLowerCase'](),_0x6e70('0x25'))){var _0x3665a1=_0x2722e8[_0x6e70('0x24')][_0x6e70('0x26')]('=');var _0x3b4a13=_0x3665a1[0x0][_0x6e70('0x27')](_0x3665a1[0x0][_0x6e70('0x28')]('(')+0x1,_0x3665a1[0x0][_0x6e70('0x28')](')'));var _0xf146fd=_0x3665a1[0x1];recordings[_0x2722e8[_0x6e70('0xb')]][_0x3b4a13]=_0xf146fd;}}}catch(_0x4d32d8){utils[_0x6e70('0x10')](_0x4d32d8['stack']);}};exports[_0x6e70('0x29')]=function(_0x3222a2){try{if(!_[_0x6e70('0x11')](recordings[_0x3222a2[_0x6e70('0xb')]])){recordings[_0x3222a2[_0x6e70('0xb')]][_0x6e70('0x2a')]=_0x3222a2[_0x6e70('0x2a')];}}catch(_0xdd0bee){utils[_0x6e70('0x10')](_0xdd0bee[_0x6e70('0x13')]);}}; \ No newline at end of file +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(_0x11afd1,_0x4d62ff){var _0x5e8b34=function(_0x77b8b7){while(--_0x77b8b7){_0x11afd1['push'](_0x11afd1['shift']());}};_0x5e8b34(++_0x4d62ff);}(_0xedd9,0xfc));var _0x9edd=function(_0x3b1452,_0x2429b8){_0x3b1452=_0x3b1452-0x0;var _0x19a400=_0xedd9[_0x3b1452];return _0x19a400;};'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 diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index b8b6f8a..0b4b6f4 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 _0x950a=['transfertargetexten','transfertargetlinkedid','stack','lodash','util','./utils','format','TRANSFER|%s','type','request','blindtransfer','blind','attendedtransfer','assign','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransferercontext','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode'];(function(_0x100e56,_0x2d02e1){var _0x535e88=function(_0x3b05dd){while(--_0x3b05dd){_0x100e56['push'](_0x100e56['shift']());}};_0x535e88(++_0x2d02e1);}(_0x950a,0x111));var _0xa950=function(_0x351aad,_0x146763){_0x351aad=_0x351aad-0x0;var _0x3f4ef4=_0x950a[_0x351aad];return _0x3f4ef4;};'use strict';var _=require(_0xa950('0x0'));var util=require(_0xa950('0x1'));var utils=require(_0xa950('0x2'));function writeDB(_0x13e6a3){utils['info'](util[_0xa950('0x3')](_0xa950('0x4'),_0x13e6a3[_0xa950('0x5')]));utils[_0xa950('0x6')]('CreateVoiceTransferReport',_0x13e6a3);}exports[_0xa950('0x7')]=function(_0x46f86d){try{_0x46f86d['type']=_0xa950('0x8');writeDB(_0x46f86d);}catch(_0x3645b6){utils['error'](_0x3645b6['stack']);}};exports[_0xa950('0x9')]=function(_0x12ef5a){try{_0x12ef5a=_[_0xa950('0xa')](_0x12ef5a,{'transfererchannel':_0x12ef5a[_0xa950('0xb')],'transferercalleridnum':_0x12ef5a[_0xa950('0xc')],'transferercalleridname':_0x12ef5a[_0xa950('0xd')],'transfererconnectedlinenum':_0x12ef5a['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x12ef5a['secondtransfererconnectedlinename'],'transfereraccountcode':_0x12ef5a['origtransfereraccountcode'],'transferercontext':_0x12ef5a[_0xa950('0xe')],'transfererexten':_0x12ef5a['secondtransfererexten'],'transfererlinkedid':_0x12ef5a[_0xa950('0xf')],'context':_0x12ef5a[_0xa950('0x10')],'extension':_0x12ef5a[_0xa950('0x11')],'type':'attended'});if(_[_0xa950('0x12')](_0x12ef5a['transfereechannel'])){_0x12ef5a=_[_0xa950('0xa')](_0x12ef5a,{'transfereechannel':_0x12ef5a[_0xa950('0x13')],'transfereecalleridnum':_0x12ef5a[_0xa950('0x14')],'transfereecalleridname':_0x12ef5a['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x12ef5a[_0xa950('0x15')],'transfereeconnectedlinename':_0x12ef5a[_0xa950('0x16')],'transfereeaccountcode':_0x12ef5a[_0xa950('0x17')],'transfereecontext':_0x12ef5a['transfertargetcontext'],'transfereeexten':_0x12ef5a[_0xa950('0x18')],'transfereelinkedid':_0x12ef5a[_0xa950('0x19')]});}writeDB(_0x12ef5a);}catch(_0x425201){utils['error'](_0x425201[_0xa950('0x1a')]);}}; \ No newline at end of file +var _0xa86f=['isNil','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinename','transfertargetcontext','transfertargetlinkedid','lodash','./utils','info','format','type','request','CreateVoiceTransferReport','blindtransfer','blind','stack','assign','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext'];(function(_0xe6894,_0x5a1755){var _0x4e2ea7=function(_0x535e0a){while(--_0x535e0a){_0xe6894['push'](_0xe6894['shift']());}};_0x4e2ea7(++_0x5a1755);}(_0xa86f,0x1b7));var _0xfa86=function(_0x62cbbc,_0x5eb0a7){_0x62cbbc=_0x62cbbc-0x0;var _0x37e748=_0xa86f[_0x62cbbc];return _0x37e748;};'use strict';var _=require(_0xfa86('0x0'));var util=require('util');var utils=require(_0xfa86('0x1'));function writeDB(_0x4ce2c7){utils[_0xfa86('0x2')](util[_0xfa86('0x3')]('TRANSFER|%s',_0x4ce2c7[_0xfa86('0x4')]));utils[_0xfa86('0x5')](_0xfa86('0x6'),_0x4ce2c7);}exports[_0xfa86('0x7')]=function(_0x25d0ab){try{_0x25d0ab[_0xfa86('0x4')]=_0xfa86('0x8');writeDB(_0x25d0ab);}catch(_0x567a94){utils['error'](_0x567a94[_0xfa86('0x9')]);}};exports['attendedtransfer']=function(_0x3a4945){try{_0x3a4945=_[_0xfa86('0xa')](_0x3a4945,{'transfererchannel':_0x3a4945[_0xfa86('0xb')],'transferercalleridnum':_0x3a4945[_0xfa86('0xc')],'transferercalleridname':_0x3a4945[_0xfa86('0xd')],'transfererconnectedlinenum':_0x3a4945[_0xfa86('0xe')],'transfererconnectedlinename':_0x3a4945[_0xfa86('0xf')],'transfereraccountcode':_0x3a4945['origtransfereraccountcode'],'transferercontext':_0x3a4945[_0xfa86('0x10')],'transfererexten':_0x3a4945[_0xfa86('0x11')],'transfererlinkedid':_0x3a4945[_0xfa86('0x12')],'context':_0x3a4945[_0xfa86('0x13')],'extension':_0x3a4945['origtransfererexten'],'type':'attended'});if(_[_0xfa86('0x14')](_0x3a4945['transfereechannel'])){_0x3a4945=_[_0xfa86('0xa')](_0x3a4945,{'transfereechannel':_0x3a4945[_0xfa86('0x15')],'transfereecalleridnum':_0x3a4945[_0xfa86('0x16')],'transfereecalleridname':_0x3a4945[_0xfa86('0x17')],'transfereeconnectedlinenum':_0x3a4945['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x3a4945[_0xfa86('0x18')],'transfereeaccountcode':_0x3a4945['transfertargetaccountcode'],'transfereecontext':_0x3a4945[_0xfa86('0x19')],'transfereeexten':_0x3a4945['transfertargetexten'],'transfereelinkedid':_0x3a4945[_0xfa86('0x1a')]});}writeDB(_0x3a4945);}catch(_0x114aa0){utils['error'](_0x114aa0[_0xfa86('0x9')]);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 679f277..2cb9e0b 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 _0x64d4=['NOTFOUND','getUserByInternal','getVoiceQueueByName','GetVoiceQueue','type','length','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtract','diff','sumTime','now','isAfter','isBefore','jayson/promise','moment','bluebird','client','http','debug','stringify','error','stack','request','then','catch','GetUser','internal','name','interface','info','GETUSER|','result','FOUND'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0x64d4,0x114));var _0x464d=function(_0x46ee43,_0x57ae16){_0x46ee43=_0x46ee43-0x0;var _0x209354=_0x64d4[_0x46ee43];return _0x209354;};'use strict';var jayson=require(_0x464d('0x0'));var moment=require(_0x464d('0x1'));var BPromise=require(_0x464d('0x2'));var client=jayson[_0x464d('0x3')][_0x464d('0x4')]({'port':0x2329});var logger=require('../../config/logger')('xdr');exports['info']=function(_0x2ff9ba){logger['info'](_0x2ff9ba);};exports[_0x464d('0x5')]=function(_0x2fcfdd){logger[_0x464d('0x5')](JSON[_0x464d('0x6')](_0x2fcfdd));};exports[_0x464d('0x7')]=function(_0x1f67b3){logger[_0x464d('0x7')](_0x1f67b3[_0x464d('0x8')]);};exports[_0x464d('0x9')]=function(_0x2a619d,_0x19d894){return client[_0x464d('0x9')](_0x2a619d,{'body':_0x19d894})[_0x464d('0xa')](function(_0x371b2c){logger[_0x464d('0x5')](JSON[_0x464d('0x6')](_0x371b2c));})[_0x464d('0xb')](function(_0x4acb6e){logger['error'](_0x4acb6e['stack']);});};function getUser(_0x5bca8e){return client[_0x464d('0x9')](_0x464d('0xc'),{'options':{'raw':!![],'attributes':['id',_0x464d('0xd'),_0x464d('0xe'),_0x464d('0xf')],'where':_0x5bca8e,'limit':0x1}})[_0x464d('0xa')](function(_0x1f9ec1){logger[_0x464d('0x10')](_0x464d('0x11')+JSON[_0x464d('0x6')](_0x5bca8e)+'|'+(_0x1f9ec1[_0x464d('0x12')]['length']?_0x464d('0x13'):_0x464d('0x14')));return _0x1f9ec1[_0x464d('0x12')]['length']?_0x1f9ec1[_0x464d('0x12')][0x0]:null;});}exports[_0x464d('0x15')]=function(_0x3dcf4b){return new BPromise(function(_0x4f6e52,_0x3c7fa9){if(_0x3dcf4b){return getUser({'internal':_0x3dcf4b})[_0x464d('0xa')](function(_0x1aa081){return _0x4f6e52(_0x1aa081);})[_0x464d('0xb')](function(_0x5c424a){logger[_0x464d('0x7')](_0x5c424a[_0x464d('0x8')]);return _0x4f6e52(null);});}else{return _0x4f6e52(null);}});};exports['getUserByInterface']=function(_0x3f4768){return new BPromise(function(_0x17b3a2,_0x182a9b){if(_0x3f4768){return getUser({'interface':_0x3f4768})[_0x464d('0xa')](function(_0x18d9bc){return _0x17b3a2(_0x18d9bc);})['catch'](function(_0xdc6aac){logger[_0x464d('0x7')](_0xdc6aac[_0x464d('0x8')]);return _0x17b3a2(null);});}else{return _0x17b3a2(null);}});};exports['getUserByName']=function(_0x363279){return new BPromise(function(_0x3b92ff,_0x453fde){if(_0x363279){return getUser({'name':_0x363279})[_0x464d('0xa')](function(_0x36c8e7){return _0x3b92ff(_0x36c8e7);})[_0x464d('0xb')](function(_0x70a438){logger[_0x464d('0x7')](_0x70a438[_0x464d('0x8')]);return _0x3b92ff(null);});}else{return _0x3b92ff(null);}});};exports[_0x464d('0x16')]=function(_0x10c1d4){return new BPromise(function(_0x1f120d,_0x45f19c){if(_0x10c1d4){return client[_0x464d('0x9')](_0x464d('0x17'),{'options':{'raw':!![],'attributes':['id',_0x464d('0xe'),_0x464d('0x18'),'acw','acwTimeout'],'where':{'name':_0x10c1d4},'limit':0x1}})[_0x464d('0xa')](function(_0x3ae3b4){logger[_0x464d('0x10')]('GETVOICEQUEUEBYNAME|'+_0x10c1d4+'|'+(_0x3ae3b4[_0x464d('0x12')][_0x464d('0x19')]?_0x464d('0x13'):_0x464d('0x14')));return _0x1f120d(_0x3ae3b4['result'][_0x464d('0x19')]?_0x3ae3b4['result'][0x0]:null);})['catch'](function(_0x272acb){logger[_0x464d('0x7')](_0x272acb['stack']);return _0x1f120d(null);});}else{return _0x1f120d(null);}});};exports[_0x464d('0x1a')]=function(_0x147f81,_0x4fbda1){return moment(_0x147f81)[_0x464d('0x1b')](_0x4fbda1,_0x464d('0x1c'))[_0x464d('0x1d')](_0x464d('0x1e'));};exports['subtractTime']=function(_0x17458d,_0x253cc1){return moment(_0x17458d)[_0x464d('0x1f')](_0x253cc1,_0x464d('0x1c'))[_0x464d('0x1d')](_0x464d('0x1e'));};exports['diffTime']=function(_0x17bdf1,_0x62a9f1){return moment(_0x17bdf1)[_0x464d('0x20')](moment(_0x62a9f1),_0x464d('0x1c'));};exports[_0x464d('0x21')]=function(_0x1c66a1,_0x51f334){return parseInt(_0x1c66a1,0xa)+parseInt(_0x51f334,0xa);};exports[_0x464d('0x22')]=function(){return moment()[_0x464d('0x1d')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x464d('0x23')]=function(_0x3dc7f2,_0x46d9d5){if(_0x46d9d5){return moment(_0x3dc7f2)[_0x464d('0x23')](_0x46d9d5);}else{return!![];}};exports[_0x464d('0x24')]=function(_0x1a033d,_0x3c30e5){if(_0x3c30e5){return moment(_0x1a033d)['isBefore'](_0x3c30e5);}else if(_0x1a033d){return!![];}else{return![];}}; \ No newline at end of file +var _0x53e5=['add','seconds','format','subtractTime','subtract','YYYY-MM-DD\x20HH:mm:ss','diffTime','sumTime','now','isAfter','isBefore','jayson/promise','moment','bluebird','client','http','../../config/logger','info','debug','error','stack','request','then','stringify','catch','GetUser','internal','name','GETUSER|','result','length','FOUND','NOTFOUND','getUserByInternal','getUserByInterface','getUserByName','getVoiceQueueByName','GetVoiceQueue','type','acw','acwTimeout','addTime'];(function(_0x350d61,_0x1f0d08){var _0x3a66aa=function(_0x38f987){while(--_0x38f987){_0x350d61['push'](_0x350d61['shift']());}};_0x3a66aa(++_0x1f0d08);}(_0x53e5,0x89));var _0x553e=function(_0x3c8d79,_0x8d92d5){_0x3c8d79=_0x3c8d79-0x0;var _0x1dc122=_0x53e5[_0x3c8d79];return _0x1dc122;};'use strict';var jayson=require(_0x553e('0x0'));var moment=require(_0x553e('0x1'));var BPromise=require(_0x553e('0x2'));var client=jayson[_0x553e('0x3')][_0x553e('0x4')]({'port':0x2329});var logger=require(_0x553e('0x5'))('xdr');exports[_0x553e('0x6')]=function(_0x3efd37){logger[_0x553e('0x6')](_0x3efd37);};exports['debug']=function(_0x9724b5){logger[_0x553e('0x7')](JSON['stringify'](_0x9724b5));};exports[_0x553e('0x8')]=function(_0x20a1b5){logger['error'](_0x20a1b5[_0x553e('0x9')]);};exports[_0x553e('0xa')]=function(_0x1a86ad,_0x3adec2){return client[_0x553e('0xa')](_0x1a86ad,{'body':_0x3adec2})[_0x553e('0xb')](function(_0x4da3de){logger[_0x553e('0x7')](JSON[_0x553e('0xc')](_0x4da3de));})[_0x553e('0xd')](function(_0x529b94){logger[_0x553e('0x8')](_0x529b94['stack']);});};function getUser(_0x52ea37){return client[_0x553e('0xa')](_0x553e('0xe'),{'options':{'raw':!![],'attributes':['id',_0x553e('0xf'),_0x553e('0x10'),'interface'],'where':_0x52ea37,'limit':0x1}})[_0x553e('0xb')](function(_0x492ea0){logger[_0x553e('0x6')](_0x553e('0x11')+JSON[_0x553e('0xc')](_0x52ea37)+'|'+(_0x492ea0[_0x553e('0x12')][_0x553e('0x13')]?_0x553e('0x14'):_0x553e('0x15')));return _0x492ea0['result'][_0x553e('0x13')]?_0x492ea0[_0x553e('0x12')][0x0]:null;});}exports[_0x553e('0x16')]=function(_0x2261bf){return new BPromise(function(_0x103945,_0x24b666){if(_0x2261bf){return getUser({'internal':_0x2261bf})[_0x553e('0xb')](function(_0x1fe7f2){return _0x103945(_0x1fe7f2);})[_0x553e('0xd')](function(_0x369069){logger[_0x553e('0x8')](_0x369069[_0x553e('0x9')]);return _0x103945(null);});}else{return _0x103945(null);}});};exports[_0x553e('0x17')]=function(_0x514845){return new BPromise(function(_0x129bee,_0x366343){if(_0x514845){return getUser({'interface':_0x514845})[_0x553e('0xb')](function(_0x5e62b9){return _0x129bee(_0x5e62b9);})[_0x553e('0xd')](function(_0x3545a8){logger['error'](_0x3545a8[_0x553e('0x9')]);return _0x129bee(null);});}else{return _0x129bee(null);}});};exports[_0x553e('0x18')]=function(_0x3bc3da){return new BPromise(function(_0x16fffb,_0x80740d){if(_0x3bc3da){return getUser({'name':_0x3bc3da})[_0x553e('0xb')](function(_0xd69fff){return _0x16fffb(_0xd69fff);})[_0x553e('0xd')](function(_0x5d0498){logger[_0x553e('0x8')](_0x5d0498[_0x553e('0x9')]);return _0x16fffb(null);});}else{return _0x16fffb(null);}});};exports[_0x553e('0x19')]=function(_0x318428){return new BPromise(function(_0xb52277,_0x459084){if(_0x318428){return client[_0x553e('0xa')](_0x553e('0x1a'),{'options':{'raw':!![],'attributes':['id','name',_0x553e('0x1b'),_0x553e('0x1c'),_0x553e('0x1d')],'where':{'name':_0x318428},'limit':0x1}})[_0x553e('0xb')](function(_0x343d5b){logger[_0x553e('0x6')]('GETVOICEQUEUEBYNAME|'+_0x318428+'|'+(_0x343d5b[_0x553e('0x12')]['length']?_0x553e('0x14'):_0x553e('0x15')));return _0xb52277(_0x343d5b['result'][_0x553e('0x13')]?_0x343d5b[_0x553e('0x12')][0x0]:null);})[_0x553e('0xd')](function(_0x42ebc6){logger[_0x553e('0x8')](_0x42ebc6[_0x553e('0x9')]);return _0xb52277(null);});}else{return _0xb52277(null);}});};exports[_0x553e('0x1e')]=function(_0x18ee8f,_0x1e7fea){return moment(_0x18ee8f)[_0x553e('0x1f')](_0x1e7fea,_0x553e('0x20'))[_0x553e('0x21')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x553e('0x22')]=function(_0x351e5d,_0x1a49b1){return moment(_0x351e5d)[_0x553e('0x23')](_0x1a49b1,_0x553e('0x20'))['format'](_0x553e('0x24'));};exports[_0x553e('0x25')]=function(_0x533c0b,_0x4cb507){return moment(_0x533c0b)['diff'](moment(_0x4cb507),_0x553e('0x20'));};exports[_0x553e('0x26')]=function(_0x4f024c,_0x5bcb26){return parseInt(_0x4f024c,0xa)+parseInt(_0x5bcb26,0xa);};exports[_0x553e('0x27')]=function(){return moment()[_0x553e('0x21')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x553e('0x28')]=function(_0x406891,_0x9d97e5){if(_0x9d97e5){return moment(_0x406891)[_0x553e('0x28')](_0x9d97e5);}else{return!![];}};exports['isBefore']=function(_0x12d776,_0x54542c){if(_0x54542c){return moment(_0x12d776)[_0x553e('0x29')](_0x54542c);}else if(_0x12d776){return!![];}else{return![];}}; \ No newline at end of file